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.

1015 lines
34 KiB

  1. /*
  2. File: vectorOps.h
  3. Contains: vector and matrix functions for AltiVec
  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 __VECTOROPS__
  11. #define __VECTOROPS__
  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. /*
  25. -------------------------------------------------------------------------------------
  26. This section is a collection of Basic Linear Algebra Subprograms (BLAS), which
  27. use AltiVec technology for their implementations. The functions are grouped into
  28. three categories (called levels), as follows:
  29. 1) Vector-scalar linear algebra subprograms
  30. 2) Matrix-vector linear algebra subprograms
  31. 3) Matrix operations
  32. Following is a list of subprograms and a short description of each one.
  33. -------------------------------------------------------------------------------------
  34. */
  35. #ifdef __VEC__
  36. /*
  37. -------------------------------------------------------------------------------------
  38. Level 1
  39. -------------------------------------------------------------------------------------
  40. */
  41. /**************************************************
  42. vIsamax finds the position of the first vector
  43. element having the largest magnitude.
  44. count length of vector x (count is a
  45. multiple of 4)
  46. x array of floats
  47. **************************************************/
  48. /*
  49. * vIsamax()
  50. *
  51. * Availability:
  52. * Non-Carbon CFM: in vecLib 1.0 and later
  53. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  54. * Mac OS X: in version 10.0 and later
  55. */
  56. EXTERN_API_C( long )
  57. vIsamax(
  58. long count,
  59. const vector float x[]);
  60. /**************************************************
  61. vIsamin finds the position of the first vector
  62. element having minimum absolute value.
  63. count length of vector x (count is a
  64. multiple of 4)
  65. x array of floats
  66. **************************************************/
  67. /*
  68. * vIsamin()
  69. *
  70. * Availability:
  71. * Non-Carbon CFM: in vecLib 1.0 and later
  72. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  73. * Mac OS X: in version 10.0 and later
  74. */
  75. EXTERN_API_C( long )
  76. vIsamin(
  77. long count,
  78. const vector float x[]);
  79. /**************************************************
  80. vIsmax finds the position of the first vector
  81. element having maximum value.
  82. count length of vector x (count is a
  83. multiple of 4)
  84. x array of floats
  85. **************************************************/
  86. /*
  87. * vIsmax()
  88. *
  89. * Availability:
  90. * Non-Carbon CFM: in vecLib 1.0 and later
  91. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  92. * Mac OS X: in version 10.0 and later
  93. */
  94. EXTERN_API_C( long )
  95. vIsmax(
  96. long count,
  97. const vector float x[]);
  98. /**************************************************
  99. vIsmin finds the position of the first vector
  100. element having minimum value.
  101. count length of vector x (count is a
  102. multiple of 4)
  103. x array of floats
  104. **************************************************/
  105. /*
  106. * vIsmin()
  107. *
  108. * Availability:
  109. * Non-Carbon CFM: in vecLib 1.0 and later
  110. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  111. * Mac OS X: in version 10.0 and later
  112. */
  113. EXTERN_API_C( long )
  114. vIsmin(
  115. long count,
  116. const vector float x[]);
  117. /**************************************************
  118. vSasum finds the sum of the magnitudes of the
  119. elements in a vector.
  120. count length of vector x (count is a
  121. multiple of 4)
  122. x array of floats
  123. **************************************************/
  124. /*
  125. * vSasum()
  126. *
  127. * Availability:
  128. * Non-Carbon CFM: in vecLib 1.0 and later
  129. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  130. * Mac OS X: in version 10.0 and later
  131. */
  132. EXTERN_API_C( float )
  133. vSasum(
  134. long count,
  135. const vector float x[]);
  136. /**************************************************
  137. vSsum is the vector version of sasum but without
  138. the absolute value. It takes the value of each
  139. element of the array and adds them together.
  140. multiple of 4)
  141. x array of floats
  142. **************************************************/
  143. /*
  144. * vSsum()
  145. *
  146. * Availability:
  147. * Non-Carbon CFM: in vecLib 1.0 and later
  148. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  149. * Mac OS X: in version 10.0 and later
  150. */
  151. EXTERN_API_C( float )
  152. vSsum(
  153. long count,
  154. const vector float x[]);
  155. /**************************************************
  156. vSaxpy multiplies a vector x, by a scalar and
  157. adds it to a vector y and stores the result in y
  158. n number of floats in x (n is a
  159. multiple of 4)
  160. alpha scalar number is single-precision
  161. floating-point
  162. x array of vector floats
  163. y array of vector floats, where the
  164. the result is stored
  165. **************************************************/
  166. /*
  167. * vSaxpy()
  168. *
  169. * Availability:
  170. * Non-Carbon CFM: in vecLib 1.0 and later
  171. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  172. * Mac OS X: in version 10.0 and later
  173. */
  174. EXTERN_API_C( void )
  175. vSaxpy(
  176. long n,
  177. float alpha,
  178. const vector float x[],
  179. vector float y[]);
  180. /*************************************************************
  181. vScopy copies a vector x, into another vector y.
  182. n mumber of floats in x and y (n is a
  183. multiple of 4)
  184. x array of vector floats
  185. y array of vector floats
  186. *************************************************************/
  187. /*
  188. * vScopy()
  189. *
  190. * Availability:
  191. * Non-Carbon CFM: in vecLib 1.0 and later
  192. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  193. * Mac OS X: in version 10.0 and later
  194. */
  195. EXTERN_API_C( void )
  196. vScopy(
  197. long n,
  198. const vector float x[],
  199. vector float y[]);
  200. /*************************************************************
  201. vSdot finds the dot product of two vectors.
  202. n mumber of floats in x and y (n is a
  203. multiple of 4)
  204. x array of vector floats
  205. y array of vector floats
  206. *************************************************************/
  207. /*
  208. * vSdot()
  209. *
  210. * Availability:
  211. * Non-Carbon CFM: in vecLib 1.0 and later
  212. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  213. * Mac OS X: in version 10.0 and later
  214. */
  215. EXTERN_API_C( float )
  216. vSdot(
  217. long n,
  218. const vector float x[],
  219. const vector float y[]);
  220. /*************************************************************
  221. vSnaxpy computes saxpy "n" times.
  222. n number of saxpyV computations to be
  223. performed and the number of elements
  224. in vector A (n is a multiple of 4)
  225. m number of floats in each vector x(i)
  226. or y(i)
  227. a array of vector floats containing
  228. scalars a(i)
  229. x matrix containing arrays of vector-
  230. floats x(i)
  231. y matrix containing vectors y(i)
  232. *************************************************************/
  233. /*
  234. * vSnaxpy()
  235. *
  236. * Availability:
  237. * Non-Carbon CFM: in vecLib 1.0 and later
  238. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  239. * Mac OS X: in version 10.0 and later
  240. */
  241. EXTERN_API_C( void )
  242. vSnaxpy(
  243. long n,
  244. long m,
  245. const vector float a[],
  246. const vector float x[],
  247. vector float y[]);
  248. /*************************************************************
  249. vSndot computes the dot products "n" times.
  250. n number of dot product computations
  251. to be performed and the number of
  252. elements in vector S
  253. m number of elements in vectors x(i)
  254. and y(i) for each dot product
  255. computation (m is a multiple of 4)
  256. s array of floats. Depending on the
  257. value of "isw" different computations/
  258. are performed and the results are
  259. stored in the array S
  260. isw indicates the type of computation
  261. to perform.
  262. if isw=1, S(i) <-- x(i) y(i)
  263. if isw=2, S(i) <-- - x(i) y(i)
  264. if isw=3, S(i) <-- S(i) + x(i) y(i)/
  265. if isw=4, S(i) <-- S(i) - x(i) y(i)/
  266. x matrix containing arrays x(i)
  267. y matrix containing arrays y(i)
  268. *************************************************************/
  269. /*
  270. * vSndot()
  271. *
  272. * Availability:
  273. * Non-Carbon CFM: in vecLib 1.0 and later
  274. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  275. * Mac OS X: in version 10.0 and later
  276. */
  277. EXTERN_API_C( void )
  278. vSndot(
  279. long n,
  280. long m,
  281. float s[],
  282. long isw,
  283. const vector float x[],
  284. const vector float y[]);
  285. /*************************************************************
  286. vSnrm2 finds the Euclidean length of a vector
  287. with scaling of input to avoid destructive
  288. underflow and overflow.
  289. count length of vector (multiple of 4)
  290. x array of vector floats
  291. *************************************************************/
  292. /*
  293. * vSnrm2()
  294. *
  295. * Availability:
  296. * Non-Carbon CFM: in vecLib 1.0 and later
  297. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  298. * Mac OS X: in version 10.0 and later
  299. */
  300. EXTERN_API_C( float )
  301. vSnrm2(
  302. long count,
  303. const vector float x[]);
  304. /*************************************************************
  305. vSnorm2 finds the Euclidean length of a vector
  306. with no scaling of input.
  307. count length of vector (multiple of 4)
  308. x array of vector floats
  309. *************************************************************/
  310. /*
  311. * vSnorm2()
  312. *
  313. * Availability:
  314. * Non-Carbon CFM: in vecLib 1.0 and later
  315. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  316. * Mac OS X: in version 10.0 and later
  317. */
  318. EXTERN_API_C( float )
  319. vSnorm2(
  320. long count,
  321. const vector float x[]);
  322. /*************************************************************
  323. vSrot applies a plane rotation.
  324. n number of points to be rotated, also
  325. number of elements in x and y (n is
  326. a multiple of 4)
  327. x array of vector floats. It is a
  328. vector of length n, containing x(i)
  329. coordinates of points to be rotated
  330. y array of vector floats. It is a
  331. vector of length n, containing y(i)
  332. coordinates of points to be rotated
  333. c cosine of angle of rotation
  334. s sine of angle of rotation
  335. *************************************************************/
  336. /*
  337. * vSrot()
  338. *
  339. * Availability:
  340. * Non-Carbon CFM: in vecLib 1.0 and later
  341. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  342. * Mac OS X: in version 10.0 and later
  343. */
  344. EXTERN_API_C( void )
  345. vSrot(
  346. long n,
  347. vector float x[],
  348. vector float y[],
  349. float c,
  350. float s);
  351. /*************************************************************
  352. vSscal multiplies a vector x, by a scalar and
  353. stores the result in the vector x.
  354. n number of floats in x (n is a
  355. multiple of 4)
  356. alpha scalar number is single-precision
  357. floating-point
  358. x array of vector floats
  359. *************************************************************/
  360. /*
  361. * vSscal()
  362. *
  363. * Availability:
  364. * Non-Carbon CFM: in vecLib 1.0 and later
  365. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  366. * Mac OS X: in version 10.0 and later
  367. */
  368. EXTERN_API_C( void )
  369. vSscal(
  370. long n,
  371. float alpha,
  372. vector float x[]);
  373. /*************************************************************
  374. vSswap interchanges the elements of vectors x
  375. and y
  376. n number of floats in x and y (n is a
  377. multiple of 4)
  378. x array of vector floats
  379. y array of vector floats
  380. *************************************************************/
  381. /*
  382. * vSswap()
  383. *
  384. * Availability:
  385. * Non-Carbon CFM: in vecLib 1.0 and later
  386. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  387. * Mac OS X: in version 10.0 and later
  388. */
  389. EXTERN_API_C( void )
  390. vSswap(
  391. long n,
  392. vector float x[],
  393. vector float y[]);
  394. /*************************************************************
  395. vSyax multiplies a vector x, by a scalar and
  396. stores the result in a vector y.
  397. n number of floats in x (n is a
  398. multiple of 4)
  399. alpha scalar number is single-precision
  400. floating-point
  401. x array of vector floats
  402. y array of vector floats
  403. *************************************************************/
  404. /*
  405. * vSyax()
  406. *
  407. * Availability:
  408. * Non-Carbon CFM: in vecLib 1.0 and later
  409. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  410. * Mac OS X: in version 10.0 and later
  411. */
  412. EXTERN_API_C( void )
  413. vSyax(
  414. long n,
  415. float alpha,
  416. const vector float x[],
  417. vector float y[]);
  418. /*************************************************************
  419. vSzaxpy multiplies a vector x, by a scalar and
  420. adds it to a vector y and stores the result in
  421. vector Z.
  422. n number of floats in x (n is a
  423. multiple of 4)
  424. alpha scalar number is single-precision
  425. floating-point
  426. x array of vector floats
  427. y array of vector floats
  428. Z array of vector floats, where the
  429. is stored
  430. *************************************************************/
  431. /*
  432. * vSzaxpy()
  433. *
  434. * Availability:
  435. * Non-Carbon CFM: in vecLib 1.0 and later
  436. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  437. * Mac OS X: in version 10.0 and later
  438. */
  439. EXTERN_API_C( void )
  440. vSzaxpy(
  441. long n,
  442. float alpha,
  443. const vector float x[],
  444. const vector float yY[],
  445. vector float z[]);
  446. /*
  447. -------------------------------------------------------------------------------------
  448. Level 2
  449. -------------------------------------------------------------------------------------
  450. */
  451. /*************************************************************
  452. vSgemv multiplies an array of vector floats y by
  453. a scalar beta, and takes the result and adds it
  454. to the product of a scalar alpha multiplied by
  455. a matrix A multiplied by a vector x. The above
  456. result is stored in array y. Futhermore, the
  457. same function also performs the above calculation/
  458. with the transpose of matrix A, instead of
  459. matrix A. In this function argument "forma"
  460. distinguishes between the above two cases.
  461. forma indicates the form of matrix A to
  462. use in the computation, where:
  463. If forma = "n", Matrix A is used
  464. If forma = "T", Transpose of Matrix
  465. A is used
  466. m number of rows in matrix A and
  467. depending on value of forma
  468. if forma = "n", it is the length of
  469. vector y
  470. if forma = "T", it is the length of
  471. vector x. m is a multiple of 4
  472. n number of columns in matrix A and
  473. depending on value of forma
  474. if forma = "n", it is the length of
  475. vector x
  476. if forma = "T", it is the length of
  477. vector y. m is a multiple of 4
  478. alpha is a scaling constant
  479. A is an m by n matrix. Its elements
  480. are vector floats
  481. x is an array of vector floats
  482. beta is a scaling constant
  483. y is an array of vector floats
  484. *************************************************************/
  485. /*
  486. * vSgemv()
  487. *
  488. * Availability:
  489. * Non-Carbon CFM: in vecLib 1.0 and later
  490. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  491. * Mac OS X: in version 10.0 and later
  492. */
  493. EXTERN_API_C( void )
  494. vSgemv(
  495. char forma,
  496. long m,
  497. long n,
  498. float alpha,
  499. const vector float a[],
  500. const vector float x[],
  501. float beta,
  502. vector float y[]);
  503. /*************************************************************
  504. vSgemx adds an array of vector floats y to the
  505. product of an scalar alpha by a mtrix A
  506. multiplied by an array of vector floats x. It
  507. then stores the result in the vector y.
  508. m number of rows in matrix A and
  509. the length of vector y. m is a
  510. multiple of 4
  511. n number of columns in matrix A and
  512. the length of vector x. m is a
  513. multiple of 4
  514. alpha is a scaling constant
  515. a is an m by n matrix. Its elements
  516. are vector floats
  517. x is an array of vector floats
  518. y is an array of vector floats
  519. *************************************************************/
  520. /*
  521. * vSgemx()
  522. *
  523. * Availability:
  524. * Non-Carbon CFM: in vecLib 1.0 and later
  525. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  526. * Mac OS X: in version 10.0 and later
  527. */
  528. EXTERN_API_C( void )
  529. vSgemx(
  530. long m,
  531. long n,
  532. float alpha,
  533. const vector float a[],
  534. const vector float x[],
  535. vector float y[]);
  536. /*************************************************************
  537. vSgemtx takes the transpose of a mtrix A and
  538. multiplies it by an array x. It then multiplies
  539. the result by a scalar alpha. Finally adds the
  540. above result to an array y and stores the result
  541. in array y.
  542. m number of rows in matrix A and
  543. the length of vector x. m is a
  544. multiple of 4
  545. n number of columns in matrix A and
  546. the length of vector y. m is a
  547. multiple of 4
  548. alpha is a scaling constant
  549. a is an m by n matrix. Its elements
  550. are vector floats
  551. x is an array of vector floats
  552. y is an array of vector floats
  553. *************************************************************/
  554. /*
  555. * vSgemtx()
  556. *
  557. * Availability:
  558. * Non-Carbon CFM: in vecLib 1.0 and later
  559. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  560. * Mac OS X: in version 10.0 and later
  561. */
  562. EXTERN_API_C( void )
  563. vSgemtx(
  564. long m,
  565. long n,
  566. float alpha,
  567. const vector float a[],
  568. const vector float x[],
  569. vector float y[]);
  570. /*
  571. -------------------------------------------------------------------------------------
  572. Level 3
  573. -------------------------------------------------------------------------------------
  574. */
  575. /*************************************************************
  576. vSgeadd performs matrix addition for general
  577. matrices or their transposes.
  578. height height of the matrix (it is multiple
  579. of 4)
  580. width width of the matrix (it is multiple
  581. of 4)
  582. A matrix A, and depending on forma:
  583. if forma='n', A is used in the
  584. computation, and A has m rows and
  585. n columns
  586. if forma='T', A(T) is used in the
  587. computation, and A has n rows and
  588. m columns
  589. forma indicates the form of matrix A to
  590. use in the computation, where:
  591. if forma='n', A is used in the
  592. computation
  593. if forma='T', A(T) is used in the
  594. computation
  595. b matrix b, and depending on formb:
  596. if formb='n', b is used in the
  597. computation, and b has m rows and
  598. n columns
  599. if formb='T', b(T) is used in the
  600. computation, and b has n rows and
  601. m columns
  602. formb indicates the form of matrix b to
  603. use in the computation, where:
  604. if forma='n', b is used in the
  605. computation
  606. if forma='T', b(T) is used in the
  607. computation
  608. c is an m by n matrix c, containing
  609. the reults of the computation
  610. *************************************************************/
  611. /*
  612. * vSgeadd()
  613. *
  614. * Availability:
  615. * Non-Carbon CFM: in vecLib 1.0 and later
  616. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  617. * Mac OS X: in version 10.0 and later
  618. */
  619. EXTERN_API_C( void )
  620. vSgeadd(
  621. long height,
  622. long width,
  623. const vector float a[],
  624. char forma,
  625. const vector float b[],
  626. char formb,
  627. vector float c[]);
  628. /*************************************************************
  629. vSgesub performs matrix subtraction for general
  630. matrices or their transposes.
  631. height height of the matrix (it is multiple
  632. of 4)
  633. width width of the matrix (it is multiple
  634. of 4)
  635. A matrix A, and depending on forma:
  636. if forma='n', A is used in the
  637. computation, and A has m rows and
  638. n columns
  639. if forma='T', A(T) is used in the
  640. computation, and A has n rows and
  641. m columns
  642. forma indicates the form of matrix A to
  643. use in the computation, where:
  644. if forma='n', A is used in the
  645. computation
  646. if forma='T', A(T) is used in the
  647. computation
  648. b matrix b, and depending on formb:
  649. if formb='n', b is used in the
  650. computation, and b has m rows and
  651. n columns
  652. if formb='T', b(T) is used in the
  653. computation, and b has n rows and
  654. m columns
  655. formb indicates the form of matrix b to
  656. use in the computation, where:
  657. if forma='n', b is used in the
  658. computation
  659. if forma='T', b(T) is used in the
  660. computation
  661. c is an m by n matrix c, containing
  662. the reults of the computation
  663. *************************************************************/
  664. /*
  665. * vSgesub()
  666. *
  667. * Availability:
  668. * Non-Carbon CFM: in vecLib 1.0 and later
  669. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  670. * Mac OS X: in version 10.0 and later
  671. */
  672. EXTERN_API_C( void )
  673. vSgesub(
  674. long height,
  675. long width,
  676. const vector float a[],
  677. char forma,
  678. const vector float b[],
  679. char formb,
  680. vector float c[]);
  681. /*************************************************************
  682. vSgemul performs matrix multiplication for
  683. general matrices or their transposes.
  684. l height of the matrix A (it is
  685. multiple of 4)
  686. m width of matrix A (it is multiple
  687. of 4)
  688. n width of matrix b (it is multiple
  689. of 4)
  690. A matrix A, and depending on forma:
  691. if forma='n', A is used in the
  692. computation, and A has l rows and
  693. m columns
  694. if forma='T', A(T) is used in the
  695. computation, and A has m rows and
  696. l columns
  697. forma indicates the form of matrix A to
  698. use in the computation, where:
  699. if forma='n', A is used in the
  700. computation
  701. if forma='T', A(T) is used in the
  702. computation
  703. b matrix b, and depending on formb:
  704. if formb='n', b is used in the
  705. computation, and b has m rows and
  706. n columns
  707. if formb='T', b(T) is used in the
  708. computation, and b has n rows and
  709. m columns
  710. formb indicates the form of matrix b to
  711. use in the computation, where:
  712. if forma='n', b is used in the
  713. computation
  714. if forma='T', b(T) is used in the
  715. computation
  716. matrix is the matrix containing the
  717. results of the computation
  718. *************************************************************/
  719. /*
  720. * vSgemul()
  721. *
  722. * Availability:
  723. * Non-Carbon CFM: in vecLib 1.0 and later
  724. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  725. * Mac OS X: in version 10.0 and later
  726. */
  727. EXTERN_API_C( void )
  728. vSgemul(
  729. long l,
  730. long m,
  731. long n,
  732. const vector float a[],
  733. char forma,
  734. const vector float b[],
  735. char formb,
  736. vector float matrix[]);
  737. /*************************************************************
  738. vSgemm performs combined matrix multiplication
  739. and addition for general matrices or their transposes.
  740. l number of rows in matrix c (it is
  741. multiple of 4)
  742. m has the following meaning:
  743. if forma='n', it is the number of
  744. columns in matrix A
  745. if forma='T', it is the number of
  746. rows in matrix A. In addition
  747. if formb='n', it is the number of
  748. rows in matrix b
  749. if formb='T', it is the number of
  750. columns in matrix b
  751. n columns in matrix c
  752. A matrix A, and depending on forma:
  753. if forma='n', A is used in the
  754. computation, and A has l rows and
  755. m columns
  756. if forma='T', A(T) is used in the
  757. computation, and A has m rows and
  758. l columns
  759. forma indicates the form of matrix A to
  760. use in the computation, where:
  761. if forma='n', A is used in the
  762. computation
  763. if forma='T', A(T) is used in the
  764. computation
  765. b matrix b, and depending on formb:
  766. if formb='n', b is used in the
  767. computation, and b has m rows and
  768. n columns
  769. if formb='T', b(T) is used in the
  770. computation, and b has n rows and
  771. m columns
  772. formb indicates the form of matrix b to
  773. use in the computation, where:
  774. if forma='n', b is used in the
  775. computation
  776. if forma='T', b(T) is used in the
  777. computation
  778. alpha is a scalar
  779. beta is a scalar
  780. matrix is the l by n matrix
  781. *************************************************************/
  782. /*
  783. * vSgemm()
  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. vSgemm(
  792. long l,
  793. long m,
  794. long n,
  795. const vector float a[],
  796. char forma,
  797. const vector float b[],
  798. char formb,
  799. vector float c[],
  800. float alpha,
  801. float beta,
  802. vector float matrix[]);
  803. /*************************************************************
  804. vSgetmi performs general matrix transpose (in place).
  805. size is the number of rows and columns
  806. in matrix x
  807. *************************************************************/
  808. /*
  809. * vSgetmi()
  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. vSgetmi(
  818. long size,
  819. vector float x[]);
  820. /*************************************************************
  821. vSgetmo performs general matrix transpose (out-of-place).
  822. height is the height of the matrix
  823. width is the width of the matrix
  824. x array of vector floats
  825. y array of vector floats
  826. *************************************************************/
  827. /*
  828. * vSgetmo()
  829. *
  830. * Availability:
  831. * Non-Carbon CFM: in vecLib 1.0 and later
  832. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  833. * Mac OS X: in version 10.0 and later
  834. */
  835. EXTERN_API_C( void )
  836. vSgetmo(
  837. long height,
  838. long width,
  839. const vector float x[],
  840. vector float y[]);
  841. /*************************************************************
  842. vSgevv is a new function. It takes matrix A and
  843. multiplies it by matrix b and puts the result in
  844. matrix m.
  845. l is the height of the matrix
  846. n is the width of the matrix
  847. A array of vector floats of at least
  848. l * m in length
  849. b array of vector floats of at least
  850. m * n in length
  851. m array of vector floats, containing
  852. the results of multiplication. It
  853. is m * n in size
  854. *************************************************************/
  855. /*
  856. * vSgevv()
  857. *
  858. * Availability:
  859. * Non-Carbon CFM: in vecLib 1.0 and later
  860. * CarbonLib: not in Carbon, but vecLib is compatible with CarbonLib
  861. * Mac OS X: in version 10.0 and later
  862. */
  863. EXTERN_API_C( void )
  864. vSgevv(
  865. long l,
  866. long n,
  867. const vector float a[],
  868. const vector float b[],
  869. vector float m[]);
  870. #endif /* defined(__VEC__) */
  871. #ifdef PRAGMA_IMPORT_OFF
  872. #pragma import off
  873. #elif PRAGMA_IMPORT
  874. #pragma import reset
  875. #endif
  876. #ifdef __cplusplus
  877. }
  878. #endif
  879. #endif /* __VECTOROPS__ */