Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1407 lines
38 KiB

  1. /*
  2. File: vBigNum.h
  3. Contains: Algebraic and logical operations on large operands.
  4. Version: QuickTime 7.3
  5. Copyright: (c) 2007 (c) 1999-2001 by Apple Computer, Inc., all rights reserved.
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://developer.apple.com/bugreporter/
  9. */
  10. #ifndef __VBIGNUM__
  11. #define __VBIGNUM__
  12. #ifndef __CONDITIONALMACROS__
  13. #include <ConditionalMacros.h>
  14. #endif
  15. #if PRAGMA_ONCE
  16. #pragma once
  17. #endif
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21. #if PRAGMA_IMPORT
  22. #pragma import on
  23. #endif
  24. #if PRAGMA_STRUCT_ALIGN
  25. #pragma options align=mac68k
  26. #elif PRAGMA_STRUCT_PACKPUSH
  27. #pragma pack(push, 2)
  28. #elif PRAGMA_STRUCT_PACK
  29. #pragma pack(2)
  30. #endif
  31. #ifdef __VEC__
  32. /************************************************************************************
  33. * *
  34. * This library provides a set of subroutines for basic algebraic and some logical *
  35. * operations performed on operands with the following sizes: *
  36. * *
  37. * 128 - bits *
  38. * 256 - bits *
  39. * 512 - bits *
  40. * 1024 - bits *
  41. * *
  42. * Following basic and algebraic operations are included: *
  43. * *
  44. * Addition *
  45. * Subtraction *
  46. * Multiplication *
  47. * Division *
  48. * Mod *
  49. * Shift Right *
  50. * Shift Right Arithmatic *
  51. * Shift Left *
  52. * Rotate Right *
  53. * Rotate Left *
  54. * *
  55. * *
  56. ************************************************************************************/
  57. /***********************************************************************************
  58. * Following abbreviations are used in the names of functions in this library: *
  59. * *
  60. * v Vector *
  61. * U Unsigned *
  62. * S Signed *
  63. * 128 128 - bit *
  64. * 256 256 - bit *
  65. * 512 512 - bit *
  66. * 1024 1024 - bit *
  67. * Add Addition, modular arithmetic *
  68. * AddS Addition with Saturation *
  69. * Sub Subtraction, modular arithmetic *
  70. * SubS Subtraction with Saturation *
  71. * Multiply Multiplication *
  72. * Divide Division *
  73. * Half Half (multiplication, width of result is the same as width of *
  74. * operands) *
  75. * Full Full (multiplication, width of result is twice width of each *
  76. * operand) *
  77. * *
  78. * Mod Modular operation *
  79. * Neg Negate a number *
  80. * A Algebraic *
  81. * LL Logical Left *
  82. * LR Logical Right *
  83. * Shift Shift *
  84. * Rotate Rotation *
  85. * *
  86. ***********************************************************************************/
  87. /************************************************************************************
  88. * *
  89. * A few explanations for the choices made in naming, passing arguments, and *
  90. * various functions. *
  91. * *
  92. * 1) Names for the functions are made compatible with the names used in the *
  93. * vBasicOps library. The format of the names are the same and include a *
  94. * designation to show a vector operation, then a symbol for the type of data *
  95. * (signed or unsigned), followed by the size of operands, then the operation *
  96. * performed. *
  97. * *
  98. * 2) Note that the logical and arithmetic shiftLeft operation are the same. *
  99. * *
  100. * 3) Rotate operation is performed on unsigned and signed numbers. *
  101. * *
  102. ************************************************************************************/
  103. /************************************************************************************
  104. * *
  105. * Following are a set of structures for vector data types and scalar data types *
  106. * *
  107. ************************************************************************************/
  108. union vU128 {
  109. vector unsigned int v;
  110. struct {
  111. unsigned long MSW;
  112. unsigned long d2;
  113. unsigned long d3;
  114. unsigned long LSW;
  115. } s;
  116. };
  117. typedef union vU128 vU128;
  118. union vS128 {
  119. vector unsigned int v;
  120. struct {
  121. signed long MSW;
  122. unsigned long d2;
  123. unsigned long d3;
  124. unsigned long LSW;
  125. } s;
  126. };
  127. typedef union vS128 vS128;
  128. union vU256 {
  129. vector unsigned int v[2];
  130. struct {
  131. unsigned long MSW;
  132. unsigned long d2;
  133. unsigned long d3;
  134. unsigned long d4;
  135. unsigned long d5;
  136. unsigned long d6;
  137. unsigned long d7;
  138. unsigned long LSW;
  139. } s;
  140. };
  141. typedef union vU256 vU256;
  142. union vS256 {
  143. vector unsigned int v[2];
  144. struct {
  145. signed long MSW;
  146. unsigned long d2;
  147. unsigned long d3;
  148. unsigned long d4;
  149. unsigned long d5;
  150. unsigned long d6;
  151. unsigned long d7;
  152. unsigned long LSW;
  153. } s;
  154. };
  155. typedef union vS256 vS256;
  156. union vU512 {
  157. vector unsigned int v[4];
  158. struct {
  159. unsigned long MSB;
  160. unsigned long d2;
  161. unsigned long d3;
  162. unsigned long d4;
  163. unsigned long d5;
  164. unsigned long d6;
  165. unsigned long d7;
  166. unsigned long d8;
  167. unsigned long d9;
  168. unsigned long d10;
  169. unsigned long d11;
  170. unsigned long d12;
  171. unsigned long d13;
  172. unsigned long d14;
  173. unsigned long d15;
  174. unsigned long LSB;
  175. } s;
  176. };
  177. typedef union vU512 vU512;
  178. union vS512 {
  179. vector unsigned int v[4];
  180. struct {
  181. signed long MSW;
  182. unsigned long d2;
  183. unsigned long d3;
  184. unsigned long d4;
  185. unsigned long d5;
  186. unsigned long d6;
  187. unsigned long d7;
  188. unsigned long d8;
  189. unsigned long d9;
  190. unsigned long d10;
  191. unsigned long d11;
  192. unsigned long d12;
  193. unsigned long d13;
  194. unsigned long d14;
  195. unsigned long d15;
  196. unsigned long LSW;
  197. } s;
  198. };
  199. typedef union vS512 vS512;
  200. union vU1024 {
  201. vector unsigned int v[8];
  202. struct {
  203. unsigned long MSW;
  204. unsigned long d2;
  205. unsigned long d3;
  206. unsigned long d4;
  207. unsigned long d5;
  208. unsigned long d6;
  209. unsigned long d7;
  210. unsigned long d8;
  211. unsigned long d9;
  212. unsigned long d10;
  213. unsigned long d11;
  214. unsigned long d12;
  215. unsigned long d13;
  216. unsigned long d14;
  217. unsigned long d15;
  218. unsigned long d16;
  219. unsigned long d17;
  220. unsigned long d18;
  221. unsigned long d19;
  222. unsigned long d20;
  223. unsigned long d21;
  224. unsigned long d22;
  225. unsigned long d23;
  226. unsigned long d24;
  227. unsigned long d25;
  228. unsigned long d26;
  229. unsigned long d27;
  230. unsigned long d28;
  231. unsigned long d29;
  232. unsigned long d30;
  233. unsigned long d31;
  234. unsigned long LSW;
  235. } s;
  236. };
  237. typedef union vU1024 vU1024;
  238. union vS1024 {
  239. vector unsigned int v[8];
  240. struct {
  241. signed long MSW;
  242. unsigned long d2;
  243. unsigned long d3;
  244. unsigned long d4;
  245. unsigned long d5;
  246. unsigned long d6;
  247. unsigned long d7;
  248. unsigned long d8;
  249. unsigned long d9;
  250. unsigned long d10;
  251. unsigned long d11;
  252. unsigned long d12;
  253. unsigned long d13;
  254. unsigned long d14;
  255. unsigned long d15;
  256. unsigned long d16;
  257. unsigned long d17;
  258. unsigned long d18;
  259. unsigned long d19;
  260. unsigned long d20;
  261. unsigned long d21;
  262. unsigned long d22;
  263. unsigned long d23;
  264. unsigned long d24;
  265. unsigned long d25;
  266. unsigned long d26;
  267. unsigned long d27;
  268. unsigned long d28;
  269. unsigned long d29;
  270. unsigned long d30;
  271. unsigned long d31;
  272. unsigned long LSW;
  273. } s;
  274. };
  275. typedef union vS1024 vS1024;
  276. /************************************************************************************
  277. * *
  278. * Division operations *
  279. * *
  280. ************************************************************************************/
  281. /*
  282. * vU256Divide()
  283. *
  284. * Availability:
  285. * Non-Carbon CFM: in vecLib 1.0 and later
  286. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  287. * Mac OS X: in version 10.0 and later
  288. */
  289. EXTERN_API_C( void )
  290. vU256Divide(
  291. const vU256 * numerator,
  292. const vU256 * divisor,
  293. vU256 * result,
  294. vU256 * remainder);
  295. /*
  296. * vS256Divide()
  297. *
  298. * Availability:
  299. * Non-Carbon CFM: in vecLib 1.0 and later
  300. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  301. * Mac OS X: in version 10.0 and later
  302. */
  303. EXTERN_API_C( void )
  304. vS256Divide(
  305. const vS256 * numerator,
  306. const vS256 * divisor,
  307. vS256 * result,
  308. vS256 * remainder);
  309. /*
  310. * vU512Divide()
  311. *
  312. * Availability:
  313. * Non-Carbon CFM: in vecLib 1.0 and later
  314. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  315. * Mac OS X: in version 10.0 and later
  316. */
  317. EXTERN_API_C( void )
  318. vU512Divide(
  319. const vU512 * numerator,
  320. const vU512 * divisor,
  321. vU512 * result,
  322. vU512 * remainder);
  323. /*
  324. * vS512Divide()
  325. *
  326. * Availability:
  327. * Non-Carbon CFM: in vecLib 1.0 and later
  328. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  329. * Mac OS X: in version 10.0 and later
  330. */
  331. EXTERN_API_C( void )
  332. vS512Divide(
  333. const vS512 * numerator,
  334. const vS512 * divisor,
  335. vS512 * result,
  336. vS512 * remainder);
  337. /*
  338. * vU1024Divide()
  339. *
  340. * Availability:
  341. * Non-Carbon CFM: in vecLib 1.0 and later
  342. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  343. * Mac OS X: in version 10.0 and later
  344. */
  345. EXTERN_API_C( void )
  346. vU1024Divide(
  347. const vU1024 * numerator,
  348. const vU1024 * divisor,
  349. vU1024 * result,
  350. vU1024 * remainder);
  351. /*
  352. * vS1024Divide()
  353. *
  354. * Availability:
  355. * Non-Carbon CFM: in vecLib 1.0 and later
  356. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  357. * Mac OS X: in version 10.0 and later
  358. */
  359. EXTERN_API_C( void )
  360. vS1024Divide(
  361. const vS1024 * numerator,
  362. const vS1024 * divisor,
  363. vS1024 * result,
  364. vS1024 * remainder);
  365. /************************************************************************************
  366. * *
  367. * Multiply operations *
  368. * *
  369. ************************************************************************************/
  370. /*
  371. * vU128FullMultiply()
  372. *
  373. * Availability:
  374. * Non-Carbon CFM: in vecLib 1.0 and later
  375. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  376. * Mac OS X: in version 10.0 and later
  377. */
  378. EXTERN_API_C( void )
  379. vU128FullMultiply(
  380. const vU128 * a,
  381. const vU128 * b,
  382. vU256 * result);
  383. /*
  384. * vS128FullMultiply()
  385. *
  386. * Availability:
  387. * Non-Carbon CFM: in vecLib 1.0 and later
  388. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  389. * Mac OS X: in version 10.0 and later
  390. */
  391. EXTERN_API_C( void )
  392. vS128FullMultiply(
  393. const vS128 * a,
  394. const vS128 * b,
  395. vS256 * result);
  396. /*
  397. * vU256FullMultiply()
  398. *
  399. * Availability:
  400. * Non-Carbon CFM: in vecLib 1.0 and later
  401. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  402. * Mac OS X: in version 10.0 and later
  403. */
  404. EXTERN_API_C( void )
  405. vU256FullMultiply(
  406. const vU256 * a,
  407. const vU256 * b,
  408. vU512 * result);
  409. /*
  410. * vS256FullMultiply()
  411. *
  412. * Availability:
  413. * Non-Carbon CFM: in vecLib 1.0 and later
  414. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  415. * Mac OS X: in version 10.0 and later
  416. */
  417. EXTERN_API_C( void )
  418. vS256FullMultiply(
  419. const vS256 * a,
  420. const vS256 * b,
  421. vS512 * result);
  422. /*
  423. * vU512FullMultiply()
  424. *
  425. * Availability:
  426. * Non-Carbon CFM: in vecLib 1.0 and later
  427. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  428. * Mac OS X: in version 10.0 and later
  429. */
  430. EXTERN_API_C( void )
  431. vU512FullMultiply(
  432. const vU512 * a,
  433. const vU512 * b,
  434. vU1024 * result);
  435. /*
  436. * vS512FullMultiply()
  437. *
  438. * Availability:
  439. * Non-Carbon CFM: in vecLib 1.0 and later
  440. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  441. * Mac OS X: in version 10.0 and later
  442. */
  443. EXTERN_API_C( void )
  444. vS512FullMultiply(
  445. const vS512 * a,
  446. const vS512 * b,
  447. vS1024 * result);
  448. /*
  449. * vU256HalfMultiply()
  450. *
  451. * Availability:
  452. * Non-Carbon CFM: in vecLib 1.0 and later
  453. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  454. * Mac OS X: in version 10.0 and later
  455. */
  456. EXTERN_API_C( void )
  457. vU256HalfMultiply(
  458. const vU256 * a,
  459. const vU256 * b,
  460. vU256 * result);
  461. /*
  462. * vS256HalfMultiply()
  463. *
  464. * Availability:
  465. * Non-Carbon CFM: in vecLib 1.0 and later
  466. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  467. * Mac OS X: in version 10.0 and later
  468. */
  469. EXTERN_API_C( void )
  470. vS256HalfMultiply(
  471. const vS256 * a,
  472. const vS256 * b,
  473. vS256 * result);
  474. /*
  475. * vU512HalfMultiply()
  476. *
  477. * Availability:
  478. * Non-Carbon CFM: in vecLib 1.0 and later
  479. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  480. * Mac OS X: in version 10.0 and later
  481. */
  482. EXTERN_API_C( void )
  483. vU512HalfMultiply(
  484. const vU512 * a,
  485. const vU512 * b,
  486. vU512 * result);
  487. /*
  488. * vS512HalfMultiply()
  489. *
  490. * Availability:
  491. * Non-Carbon CFM: in vecLib 1.0 and later
  492. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  493. * Mac OS X: in version 10.0 and later
  494. */
  495. EXTERN_API_C( void )
  496. vS512HalfMultiply(
  497. const vS512 * a,
  498. const vS512 * b,
  499. vS512 * result);
  500. /*
  501. * vU1024HalfMultiply()
  502. *
  503. * Availability:
  504. * Non-Carbon CFM: in vecLib 1.0 and later
  505. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  506. * Mac OS X: in version 10.0 and later
  507. */
  508. EXTERN_API_C( void )
  509. vU1024HalfMultiply(
  510. const vU1024 * a,
  511. const vU1024 * b,
  512. vU1024 * result);
  513. /*
  514. * vS1024HalfMultiply()
  515. *
  516. * Availability:
  517. * Non-Carbon CFM: in vecLib 1.0 and later
  518. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  519. * Mac OS X: in version 10.0 and later
  520. */
  521. EXTERN_API_C( void )
  522. vS1024HalfMultiply(
  523. const vS1024 * a,
  524. const vS1024 * b,
  525. vS1024 * result);
  526. /************************************************************************************
  527. * *
  528. * Subtraction operations *
  529. * *
  530. ************************************************************************************/
  531. /*
  532. * vU256Sub()
  533. *
  534. * Availability:
  535. * Non-Carbon CFM: in vecLib 1.0 and later
  536. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  537. * Mac OS X: in version 10.0 and later
  538. */
  539. EXTERN_API_C( void )
  540. vU256Sub(
  541. const vU256 * a,
  542. const vU256 * b,
  543. vU256 * result);
  544. /*
  545. * vS256Sub()
  546. *
  547. * Availability:
  548. * Non-Carbon CFM: in vecLib 1.0 and later
  549. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  550. * Mac OS X: in version 10.0 and later
  551. */
  552. EXTERN_API_C( void )
  553. vS256Sub(
  554. const vS256 * a,
  555. const vS256 * b,
  556. vS256 * result);
  557. /*
  558. * vU256SubS()
  559. *
  560. * Availability:
  561. * Non-Carbon CFM: in vecLib 1.0 and later
  562. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  563. * Mac OS X: in version 10.0 and later
  564. */
  565. EXTERN_API_C( void )
  566. vU256SubS(
  567. const vU256 * a,
  568. const vU256 * b,
  569. vU256 * result);
  570. /*
  571. * vS256SubS()
  572. *
  573. * Availability:
  574. * Non-Carbon CFM: in vecLib 1.0 and later
  575. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  576. * Mac OS X: in version 10.0 and later
  577. */
  578. EXTERN_API_C( void )
  579. vS256SubS(
  580. const vS256 * a,
  581. const vS256 * b,
  582. vS256 * result);
  583. /*
  584. * vU512Sub()
  585. *
  586. * Availability:
  587. * Non-Carbon CFM: in vecLib 1.0 and later
  588. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  589. * Mac OS X: in version 10.0 and later
  590. */
  591. EXTERN_API_C( void )
  592. vU512Sub(
  593. const vU512 * a,
  594. const vU512 * b,
  595. vU512 * result);
  596. /*
  597. * vS512Sub()
  598. *
  599. * Availability:
  600. * Non-Carbon CFM: in vecLib 1.0 and later
  601. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  602. * Mac OS X: in version 10.0 and later
  603. */
  604. EXTERN_API_C( void )
  605. vS512Sub(
  606. const vS512 * a,
  607. const vS512 * b,
  608. vS512 * result);
  609. /*
  610. * vU512SubS()
  611. *
  612. * Availability:
  613. * Non-Carbon CFM: in vecLib 1.0 and later
  614. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  615. * Mac OS X: in version 10.0 and later
  616. */
  617. EXTERN_API_C( void )
  618. vU512SubS(
  619. const vU512 * a,
  620. const vU512 * b,
  621. vU512 * result);
  622. /*
  623. * vS512SubS()
  624. *
  625. * Availability:
  626. * Non-Carbon CFM: in vecLib 1.0 and later
  627. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  628. * Mac OS X: in version 10.0 and later
  629. */
  630. EXTERN_API_C( void )
  631. vS512SubS(
  632. const vS512 * a,
  633. const vS512 * b,
  634. vS512 * result);
  635. /*
  636. * vU1024Sub()
  637. *
  638. * Availability:
  639. * Non-Carbon CFM: in vecLib 1.0 and later
  640. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  641. * Mac OS X: in version 10.0 and later
  642. */
  643. EXTERN_API_C( void )
  644. vU1024Sub(
  645. const vU1024 * a,
  646. const vU1024 * b,
  647. vU1024 * result);
  648. /*
  649. * vS1024Sub()
  650. *
  651. * Availability:
  652. * Non-Carbon CFM: in vecLib 1.0 and later
  653. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  654. * Mac OS X: in version 10.0 and later
  655. */
  656. EXTERN_API_C( void )
  657. vS1024Sub(
  658. const vS1024 * a,
  659. const vS1024 * b,
  660. vS1024 * result);
  661. /*
  662. * vU1024SubS()
  663. *
  664. * Availability:
  665. * Non-Carbon CFM: in vecLib 1.0 and later
  666. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  667. * Mac OS X: in version 10.0 and later
  668. */
  669. EXTERN_API_C( void )
  670. vU1024SubS(
  671. const vU1024 * a,
  672. const vU1024 * b,
  673. vU1024 * result);
  674. /*
  675. * vS1024SubS()
  676. *
  677. * Availability:
  678. * Non-Carbon CFM: in vecLib 1.0 and later
  679. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  680. * Mac OS X: in version 10.0 and later
  681. */
  682. EXTERN_API_C( void )
  683. vS1024SubS(
  684. const vS1024 * a,
  685. const vS1024 * b,
  686. vS1024 * result);
  687. /************************************************************************************
  688. * *
  689. * Negate operations *
  690. * *
  691. ************************************************************************************/
  692. /*
  693. * vU256Neg()
  694. *
  695. * Availability:
  696. * Non-Carbon CFM: in vecLib 1.0 and later
  697. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  698. * Mac OS X: in version 10.0 and later
  699. */
  700. EXTERN_API_C( void )
  701. vU256Neg(
  702. const vU256 * a,
  703. vU256 * result);
  704. /*
  705. * vS256Neg()
  706. *
  707. * Availability:
  708. * Non-Carbon CFM: in vecLib 1.0 and later
  709. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  710. * Mac OS X: in version 10.0 and later
  711. */
  712. EXTERN_API_C( void )
  713. vS256Neg(
  714. const vS256 * a,
  715. vS256 * result);
  716. /*
  717. * vU512Neg()
  718. *
  719. * Availability:
  720. * Non-Carbon CFM: in vecLib 1.0 and later
  721. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  722. * Mac OS X: in version 10.0 and later
  723. */
  724. EXTERN_API_C( void )
  725. vU512Neg(
  726. const vU512 * a,
  727. vU512 * result);
  728. /*
  729. * vS512Neg()
  730. *
  731. * Availability:
  732. * Non-Carbon CFM: in vecLib 1.0 and later
  733. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  734. * Mac OS X: in version 10.0 and later
  735. */
  736. EXTERN_API_C( void )
  737. vS512Neg(
  738. const vS512 * a,
  739. vS512 * result);
  740. /*
  741. * vU1024Neg()
  742. *
  743. * Availability:
  744. * Non-Carbon CFM: in vecLib 1.0 and later
  745. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  746. * Mac OS X: in version 10.0 and later
  747. */
  748. EXTERN_API_C( void )
  749. vU1024Neg(
  750. const vU1024 * a,
  751. vU1024 * result);
  752. /*
  753. * vS1024Neg()
  754. *
  755. * Availability:
  756. * Non-Carbon CFM: in vecLib 1.0 and later
  757. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  758. * Mac OS X: in version 10.0 and later
  759. */
  760. EXTERN_API_C( void )
  761. vS1024Neg(
  762. const vS1024 * a,
  763. vS1024 * result);
  764. /************************************************************************************
  765. * *
  766. * Addition operations *
  767. * *
  768. ************************************************************************************/
  769. /*
  770. * vU256Add()
  771. *
  772. * Availability:
  773. * Non-Carbon CFM: in vecLib 1.0 and later
  774. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  775. * Mac OS X: in version 10.0 and later
  776. */
  777. EXTERN_API_C( void )
  778. vU256Add(
  779. const vU256 * a,
  780. const vU256 * b,
  781. vU256 * result);
  782. /*
  783. * vS256Add()
  784. *
  785. * Availability:
  786. * Non-Carbon CFM: in vecLib 1.0 and later
  787. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  788. * Mac OS X: in version 10.0 and later
  789. */
  790. EXTERN_API_C( void )
  791. vS256Add(
  792. const vS256 * a,
  793. const vS256 * b,
  794. vS256 * result);
  795. /*
  796. * vU256AddS()
  797. *
  798. * Availability:
  799. * Non-Carbon CFM: in vecLib 1.0 and later
  800. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  801. * Mac OS X: in version 10.0 and later
  802. */
  803. EXTERN_API_C( void )
  804. vU256AddS(
  805. const vU256 * a,
  806. const vU256 * b,
  807. vU256 * result);
  808. /*
  809. * vS256AddS()
  810. *
  811. * Availability:
  812. * Non-Carbon CFM: in vecLib 1.0 and later
  813. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  814. * Mac OS X: in version 10.0 and later
  815. */
  816. EXTERN_API_C( void )
  817. vS256AddS(
  818. const vS256 * a,
  819. const vS256 * b,
  820. vS256 * result);
  821. /*
  822. * vU512Add()
  823. *
  824. * Availability:
  825. * Non-Carbon CFM: in vecLib 1.0 and later
  826. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  827. * Mac OS X: in version 10.0 and later
  828. */
  829. EXTERN_API_C( void )
  830. vU512Add(
  831. const vU512 * a,
  832. const vU512 * b,
  833. vU512 * result);
  834. /*
  835. * vS512Add()
  836. *
  837. * Availability:
  838. * Non-Carbon CFM: in vecLib 1.0 and later
  839. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  840. * Mac OS X: in version 10.0 and later
  841. */
  842. EXTERN_API_C( void )
  843. vS512Add(
  844. const vS512 * a,
  845. const vS512 * b,
  846. vS512 * result);
  847. /*
  848. * vU512AddS()
  849. *
  850. * Availability:
  851. * Non-Carbon CFM: in vecLib 1.0 and later
  852. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  853. * Mac OS X: in version 10.0 and later
  854. */
  855. EXTERN_API_C( void )
  856. vU512AddS(
  857. const vU512 * a,
  858. const vU512 * b,
  859. vU512 * result);
  860. /*
  861. * vS512AddS()
  862. *
  863. * Availability:
  864. * Non-Carbon CFM: in vecLib 1.0 and later
  865. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  866. * Mac OS X: in version 10.0 and later
  867. */
  868. EXTERN_API_C( void )
  869. vS512AddS(
  870. const vS512 * a,
  871. const vS512 * b,
  872. vS512 * result);
  873. /*
  874. * vU1024Add()
  875. *
  876. * Availability:
  877. * Non-Carbon CFM: in vecLib 1.0 and later
  878. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  879. * Mac OS X: in version 10.0 and later
  880. */
  881. EXTERN_API_C( void )
  882. vU1024Add(
  883. const vU1024 * a,
  884. const vU1024 * b,
  885. vU1024 * result);
  886. /*
  887. * vS1024Add()
  888. *
  889. * Availability:
  890. * Non-Carbon CFM: in vecLib 1.0 and later
  891. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  892. * Mac OS X: in version 10.0 and later
  893. */
  894. EXTERN_API_C( void )
  895. vS1024Add(
  896. const vS1024 * a,
  897. const vS1024 * b,
  898. vS1024 * result);
  899. /*
  900. * vU1024AddS()
  901. *
  902. * Availability:
  903. * Non-Carbon CFM: in vecLib 1.0 and later
  904. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  905. * Mac OS X: in version 10.0 and later
  906. */
  907. EXTERN_API_C( void )
  908. vU1024AddS(
  909. const vU1024 * a,
  910. const vU1024 * b,
  911. vU1024 * result);
  912. /*
  913. * vS1024AddS()
  914. *
  915. * Availability:
  916. * Non-Carbon CFM: in vecLib 1.0 and later
  917. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  918. * Mac OS X: in version 10.0 and later
  919. */
  920. EXTERN_API_C( void )
  921. vS1024AddS(
  922. const vS1024 * a,
  923. const vS1024 * b,
  924. vS1024 * result);
  925. /************************************************************************************
  926. * *
  927. * Mod operations *
  928. * *
  929. ************************************************************************************/
  930. /*
  931. * vU256Mod()
  932. *
  933. * Availability:
  934. * Non-Carbon CFM: in vecLib 1.0 and later
  935. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  936. * Mac OS X: in version 10.0 and later
  937. */
  938. EXTERN_API_C( void )
  939. vU256Mod(
  940. const vU256 * numerator,
  941. const vU256 * divisor,
  942. vU256 * remainder);
  943. /*
  944. * vS256Mod()
  945. *
  946. * Availability:
  947. * Non-Carbon CFM: in vecLib 1.0 and later
  948. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  949. * Mac OS X: in version 10.0 and later
  950. */
  951. EXTERN_API_C( void )
  952. vS256Mod(
  953. const vS256 * numerator,
  954. const vS256 * divisor,
  955. vS256 * remainder);
  956. /*
  957. * vU512Mod()
  958. *
  959. * Availability:
  960. * Non-Carbon CFM: in vecLib 1.0 and later
  961. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  962. * Mac OS X: in version 10.0 and later
  963. */
  964. EXTERN_API_C( void )
  965. vU512Mod(
  966. const vU512 * numerator,
  967. const vU512 * divisor,
  968. vU512 * remainder);
  969. /*
  970. * vS512Mod()
  971. *
  972. * Availability:
  973. * Non-Carbon CFM: in vecLib 1.0 and later
  974. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  975. * Mac OS X: in version 10.0 and later
  976. */
  977. EXTERN_API_C( void )
  978. vS512Mod(
  979. const vS512 * numerator,
  980. const vS512 * divisor,
  981. vS512 * remainder);
  982. /*
  983. * vU1024Mod()
  984. *
  985. * Availability:
  986. * Non-Carbon CFM: in vecLib 1.0 and later
  987. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  988. * Mac OS X: in version 10.0 and later
  989. */
  990. EXTERN_API_C( void )
  991. vU1024Mod(
  992. const vU1024 * numerator,
  993. const vU1024 * divisor,
  994. vU1024 * remainder);
  995. /*
  996. * vS1024Mod()
  997. *
  998. * Availability:
  999. * Non-Carbon CFM: in vecLib 1.0 and later
  1000. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  1001. * Mac OS X: in version 10.0 and later
  1002. */
  1003. EXTERN_API_C( void )
  1004. vS1024Mod(
  1005. const vS1024 * numerator,
  1006. const vS1024 * divisor,
  1007. vS1024 * remainder);
  1008. /************************************************************************************
  1009. * *
  1010. * Shift operations *
  1011. * *
  1012. ************************************************************************************/
  1013. /*
  1014. * vLL256Shift()
  1015. *
  1016. * Availability:
  1017. * Non-Carbon CFM: in vecLib 1.0 and later
  1018. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  1019. * Mac OS X: in version 10.0 and later
  1020. */
  1021. EXTERN_API_C( void )
  1022. vLL256Shift(
  1023. const vU256 * a,
  1024. unsigned long shiftAmount,
  1025. vU256 * result);
  1026. /*
  1027. * vLL512Shift()
  1028. *
  1029. * Availability:
  1030. * Non-Carbon CFM: in vecLib 1.0 and later
  1031. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  1032. * Mac OS X: in version 10.0 and later
  1033. */
  1034. EXTERN_API_C( void )
  1035. vLL512Shift(
  1036. const vU512 * a,
  1037. unsigned long shiftAmount,
  1038. vU512 * result);
  1039. /*
  1040. * vLL1024Shift()
  1041. *
  1042. * Availability:
  1043. * Non-Carbon CFM: in vecLib 1.0 and later
  1044. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  1045. * Mac OS X: in version 10.0 and later
  1046. */
  1047. EXTERN_API_C( void )
  1048. vLL1024Shift(
  1049. const vU1024 * a,
  1050. unsigned long shiftAmount,
  1051. vU1024 * result);
  1052. /*
  1053. * vLR256Shift()
  1054. *
  1055. * Availability:
  1056. * Non-Carbon CFM: in vecLib 1.0 and later
  1057. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  1058. * Mac OS X: in version 10.0 and later
  1059. */
  1060. EXTERN_API_C( void )
  1061. vLR256Shift(
  1062. const vU256 * a,
  1063. unsigned long shiftAmount,
  1064. vU256 * result);
  1065. /*
  1066. * vLR512Shift()
  1067. *
  1068. * Availability:
  1069. * Non-Carbon CFM: in vecLib 1.0 and later
  1070. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  1071. * Mac OS X: in version 10.0 and later
  1072. */
  1073. EXTERN_API_C( void )
  1074. vLR512Shift(
  1075. const vU512 * a,
  1076. unsigned long shiftAmount,
  1077. vU512 * result);
  1078. /*
  1079. * vLR1024Shift()
  1080. *
  1081. * Availability:
  1082. * Non-Carbon CFM: in vecLib 1.0 and later
  1083. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  1084. * Mac OS X: in version 10.0 and later
  1085. */
  1086. EXTERN_API_C( void )
  1087. vLR1024Shift(
  1088. const vU1024 * a,
  1089. unsigned long shiftAmount,
  1090. vU1024 * result);
  1091. /*
  1092. * vA256Shift()
  1093. *
  1094. * Availability:
  1095. * Non-Carbon CFM: in vecLib 1.0 and later
  1096. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  1097. * Mac OS X: in version 10.0 and later
  1098. */
  1099. EXTERN_API_C( void )
  1100. vA256Shift(
  1101. const vS256 * a,
  1102. unsigned long shiftAmount,
  1103. vS256 * result);
  1104. /*
  1105. * vA512Shift()
  1106. *
  1107. * Availability:
  1108. * Non-Carbon CFM: in vecLib 1.0 and later
  1109. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  1110. * Mac OS X: in version 10.0 and later
  1111. */
  1112. EXTERN_API_C( void )
  1113. vA512Shift(
  1114. const vS512 * a,
  1115. unsigned long shiftAmount,
  1116. vS512 * result);
  1117. /*
  1118. * vA1024Shift()
  1119. *
  1120. * Availability:
  1121. * Non-Carbon CFM: in vecLib 1.0 and later
  1122. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  1123. * Mac OS X: in version 10.0 and later
  1124. */
  1125. EXTERN_API_C( void )
  1126. vA1024Shift(
  1127. const vS1024 * a,
  1128. unsigned long shiftAmount,
  1129. vS1024 * result);
  1130. /************************************************************************************
  1131. * *
  1132. * Rotate operations *
  1133. * *
  1134. ************************************************************************************/
  1135. /*
  1136. * vL256Rotate()
  1137. *
  1138. * Availability:
  1139. * Non-Carbon CFM: in vecLib 1.0 and later
  1140. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  1141. * Mac OS X: in version 10.0 and later
  1142. */
  1143. EXTERN_API_C( void )
  1144. vL256Rotate(
  1145. const vU256 * a,
  1146. unsigned long rotateAmount,
  1147. vU256 * result);
  1148. /*
  1149. * vL512Rotate()
  1150. *
  1151. * Availability:
  1152. * Non-Carbon CFM: in vecLib 1.0 and later
  1153. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  1154. * Mac OS X: in version 10.0 and later
  1155. */
  1156. EXTERN_API_C( void )
  1157. vL512Rotate(
  1158. const vU512 * a,
  1159. unsigned long rotateAmount,
  1160. vU512 * result);
  1161. /*
  1162. * vL1024Rotate()
  1163. *
  1164. * Availability:
  1165. * Non-Carbon CFM: in vecLib 1.0 and later
  1166. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  1167. * Mac OS X: in version 10.0 and later
  1168. */
  1169. EXTERN_API_C( void )
  1170. vL1024Rotate(
  1171. const vU1024 * a,
  1172. unsigned long rotateAmount,
  1173. vU1024 * result);
  1174. /*
  1175. * vR256Rotate()
  1176. *
  1177. * Availability:
  1178. * Non-Carbon CFM: in vecLib 1.0 and later
  1179. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  1180. * Mac OS X: in version 10.0 and later
  1181. */
  1182. EXTERN_API_C( void )
  1183. vR256Rotate(
  1184. const vU256 * a,
  1185. unsigned long rotateAmount,
  1186. vU256 * result);
  1187. /*
  1188. * vR512Rotate()
  1189. *
  1190. * Availability:
  1191. * Non-Carbon CFM: in vecLib 1.0 and later
  1192. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  1193. * Mac OS X: in version 10.0 and later
  1194. */
  1195. EXTERN_API_C( void )
  1196. vR512Rotate(
  1197. const vU512 * a,
  1198. unsigned long rotateAmount,
  1199. vU512 * result);
  1200. /*
  1201. * vR1024Rotate()
  1202. *
  1203. * Availability:
  1204. * Non-Carbon CFM: in vecLib 1.0 and later
  1205. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  1206. * Mac OS X: in version 10.0 and later
  1207. */
  1208. EXTERN_API_C( void )
  1209. vR1024Rotate(
  1210. const vU1024 * a,
  1211. unsigned long rotateAmount,
  1212. vU1024 * result);
  1213. #endif /* defined(__VEC__) */
  1214. #if PRAGMA_STRUCT_ALIGN
  1215. #pragma options align=reset
  1216. #elif PRAGMA_STRUCT_PACKPUSH
  1217. #pragma pack(pop)
  1218. #elif PRAGMA_STRUCT_PACK
  1219. #pragma pack()
  1220. #endif
  1221. #ifdef PRAGMA_IMPORT_OFF
  1222. #pragma import off
  1223. #elif PRAGMA_IMPORT
  1224. #pragma import reset
  1225. #endif
  1226. #ifdef __cplusplus
  1227. }
  1228. #endif
  1229. #endif /* __VBIGNUM__ */