Leaked source code of windows server 2003
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.

872 lines
25 KiB

  1. .file "asin.s"
  2. // Copyright (c) 2000, 2001, Intel Corporation
  3. // All rights reserved.
  4. //
  5. // Contributed 2/2/2000 by John Harrison, Ted Kubaska, Bob Norin, Shane Story,
  6. // and Ping Tak Peter Tang of the Computational Software Lab, Intel Corporation.
  7. //
  8. // WARRANTY DISCLAIMER
  9. //
  10. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  11. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  12. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  13. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR ITS
  14. // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  15. // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  16. // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  17. // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  18. // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR TORT (INCLUDING
  19. // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  20. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  21. //
  22. // Intel Corporation is the author of this code, and requests that all
  23. // problem reports or change requests be submitted to it directly at
  24. // http://developer.intel.com/opensource.
  25. // History
  26. //==============================================================
  27. // 2/02/00 Initial version
  28. // 8/17/00 New and much faster algorithm.
  29. // 8/31/00 Avoided bank conflicts on loads, shortened |x|=1 path,
  30. // fixed mfb split issue stalls.
  31. // 12/19/00 Fixed small arg cases to force inexact, or inexact and underflow.
  32. // Description
  33. //=========================================
  34. // The asin function computes the principle value of the arc sine of x.
  35. // asin(0) returns 0, asin(1) returns pi/2, asin(-1) returns -pi/2.
  36. // A doman error occurs for arguments not in the range [-1,+1].
  37. // The asin function returns the arc sine in the range [-pi/2, +pi/2] radians.
  38. //
  39. // Assembly macros
  40. //=========================================
  41. // predicate registers
  42. //asin_pred_LEsqrt2by2 = p7
  43. //asin_pred_GTsqrt2by2 = p8
  44. // integer registers
  45. ASIN_Addr1 = r33
  46. ASIN_Addr2 = r34
  47. ASIN_FFFE = r35
  48. ASIN_lnorm_sig = r36
  49. ASIN_snorm_exp = r37
  50. GR_SAVE_B0 = r36
  51. GR_SAVE_PFS = r37
  52. GR_SAVE_GP = r38
  53. GR_Parameter_X = r39
  54. GR_Parameter_Y = r40
  55. GR_Parameter_RESULT = r41
  56. GR_Parameter_Tag = r42
  57. // floating point registers
  58. asin_coeff_P1 = f32
  59. asin_coeff_P2 = f33
  60. asin_coeff_P3 = f34
  61. asin_coeff_P4 = f35
  62. asin_coeff_P5 = f36
  63. asin_coeff_P6 = f37
  64. asin_coeff_P7 = f38
  65. asin_coeff_P8 = f39
  66. asin_coeff_P9 = f40
  67. asin_coeff_P10 = f41
  68. asin_coeff_P11 = f42
  69. asin_coeff_P12 = f43
  70. asin_coeff_P13 = f44
  71. asin_coeff_P14 = f45
  72. asin_coeff_P15 = f46
  73. asin_coeff_P16 = f47
  74. asin_coeff_P17 = f48
  75. asin_coeff_P18 = f49
  76. asin_coeff_P19 = f50
  77. asin_coeff_P20 = f51
  78. asin_coeff_P21 = f52
  79. asin_const_sqrt2by2 = f53
  80. asin_const_piby2 = f54
  81. asin_abs_x = f55
  82. asin_tx = f56
  83. asin_tx2 = f57
  84. asin_tx3 = f58
  85. asin_tx4 = f59
  86. asin_tx8 = f60
  87. asin_tx11 = f61
  88. asin_1poly_p8 = f62
  89. asin_1poly_p19 = f63
  90. asin_1poly_p4 = f64
  91. asin_1poly_p15 = f65
  92. asin_1poly_p6 = f66
  93. asin_1poly_p17 = f67
  94. asin_1poly_p0 = f68
  95. asin_1poly_p11 = f69
  96. asin_1poly_p2 = f70
  97. asin_1poly_p13 = f71
  98. asin_series_tx = f72
  99. asin_t = f73
  100. asin_t2 = f74
  101. asin_t3 = f75
  102. asin_t4 = f76
  103. asin_t8 = f77
  104. asin_t11 = f78
  105. asin_poly_p8 = f79
  106. asin_poly_p19 = f80
  107. asin_poly_p4 = f81
  108. asin_poly_p15 = f82
  109. asin_poly_p6 = f83
  110. asin_poly_p17 = f84
  111. asin_poly_p0 = f85
  112. asin_poly_p11 = f86
  113. asin_poly_p2 = f87
  114. asin_poly_p13 = f88
  115. asin_series_t = f89
  116. asin_1by2 = f90
  117. asin_3by2 = f91
  118. asin_5by2 = f92
  119. asin_11by4 = f93
  120. asin_35by8 = f94
  121. asin_63by8 = f95
  122. asin_231by16 = f96
  123. asin_y0 = f97
  124. asin_H0 = f98
  125. asin_S0 = f99
  126. asin_d = f100
  127. asin_l1 = f101
  128. asin_d2 = f102
  129. asin_T0 = f103
  130. asin_d1 = f104
  131. asin_e0 = f105
  132. asin_l2 = f106
  133. asin_d3 = f107
  134. asin_T3 = f108
  135. asin_S1 = f109
  136. asin_e1 = f110
  137. asin_z = f111
  138. answer2 = f112
  139. asin_sgn_x = f113
  140. asin_429by16 = f114
  141. asin_18by4 = f115
  142. asin_3by4 = f116
  143. asin_l3 = f117
  144. asin_T6 = f118
  145. asin_eps_exp = f119
  146. asin_eps_sig = f120
  147. asin_eps = f120
  148. // Data tables
  149. //==============================================================
  150. .data
  151. .align 16
  152. asin_coeff_1_table:
  153. data8 0xE4E7E0A423A21249 , 0x00003FF8 //P7
  154. data8 0xC2F7EE0200FCE2A5 , 0x0000C003 //P18
  155. data8 0xB745D7F6C65C20E0 , 0x00003FF9 //P5
  156. data8 0xF75E381A323D4D94 , 0x0000C002 //P16
  157. data8 0x8959C2629C1024C0 , 0x0000C002 //P20
  158. data8 0xAFF68E7D241292C5 , 0x00003FF8 //P9
  159. data8 0xB6DB6DB7260AC30D , 0x00003FFA //P3
  160. data8 0xD0417CE2B41CB7BF , 0x0000C000 //P14
  161. data8 0x81D570FEA724E3E4 , 0x0000BFFD //P12
  162. data8 0xAAAAAAAAAAAAC277 , 0x00003FFC //P1
  163. data8 0xF534912FF3E7B76F , 0x00003FFF //P21
  164. data8 0xc90fdaa22168c235 , 0x00003fff // pi/2
  165. data8 0x0000000000000000 , 0x00000000 // pad to avoid data bank conflict
  166. asin_coeff_2_table:
  167. data8 0x8E26AF5F29B39A2A , 0x00003FF9 //P6
  168. data8 0xB4F118A4B1015470 , 0x00004003 //P17
  169. data8 0xF8E38E10C25990E0 , 0x00003FF9 //P4
  170. data8 0x80F50489AEF1CAC6 , 0x00004002 //P15
  171. data8 0x92728015172CFE1C , 0x00004003 //P19
  172. data8 0xBBC3D831D4595971 , 0x00003FF8 //P8
  173. data8 0x999999999952A5C3 , 0x00003FFB //P2
  174. data8 0x855576BE6F0975EC , 0x00003FFF //P13
  175. data8 0xF12420E778077D89 , 0x00003FFA //P11
  176. data8 0xB6590FF4D23DE003 , 0x00003FF3 //P10
  177. data8 0xb504f333f9de6484 , 0x00003ffe // sqrt(2)/2
  178. .align 32
  179. .global asin
  180. .section .text
  181. .proc asin
  182. .align 32
  183. asin:
  184. { .mfi
  185. alloc r32 = ar.pfs,1,6,4,0
  186. fma.s1 asin_tx = f8,f8,f0
  187. addl ASIN_Addr2 = @ltoff(asin_coeff_2_table),gp
  188. }
  189. { .mfi
  190. mov ASIN_FFFE = 0xFFFE
  191. fnma.s1 asin_t = f8,f8,f1
  192. addl ASIN_Addr1 = @ltoff(asin_coeff_1_table),gp
  193. }
  194. ;;
  195. { .mfi
  196. setf.exp asin_1by2 = ASIN_FFFE
  197. fmerge.s asin_abs_x = f1,f8
  198. nop.i 999 ;;
  199. }
  200. { .mmf
  201. ld8 ASIN_Addr1 = [ASIN_Addr1]
  202. ld8 ASIN_Addr2 = [ASIN_Addr2]
  203. fmerge.s asin_sgn_x = f8,f1 ;;
  204. }
  205. { .mfi
  206. ldfe asin_coeff_P7 = [ASIN_Addr1],16
  207. fma.s1 asin_tx2 = asin_tx,asin_tx,f0
  208. nop.i 999
  209. }
  210. { .mfi
  211. ldfe asin_coeff_P6 = [ASIN_Addr2],16
  212. fma.s1 asin_t2 = asin_t,asin_t,f0
  213. nop.i 999;;
  214. }
  215. { .mmf
  216. ldfe asin_coeff_P18 = [ASIN_Addr1],16
  217. ldfe asin_coeff_P17 = [ASIN_Addr2],16
  218. fclass.m.unc p8,p0 = f8, 0xc3 //@qnan |@snan
  219. }
  220. ;;
  221. { .mmf
  222. ldfe asin_coeff_P5 = [ASIN_Addr1],16
  223. ldfe asin_coeff_P4 = [ASIN_Addr2],16
  224. frsqrta.s1 asin_y0,p0 = asin_t
  225. }
  226. ;;
  227. { .mfi
  228. ldfe asin_coeff_P16 = [ASIN_Addr1],16
  229. fcmp.gt.s1 p9,p0 = asin_abs_x,f1
  230. nop.i 999
  231. }
  232. { .mfb
  233. ldfe asin_coeff_P15 = [ASIN_Addr2],16
  234. (p8) fma.d f8 = f8,f1,f0
  235. (p8) br.ret.spnt b0
  236. }
  237. ;;
  238. { .mmf
  239. ldfe asin_coeff_P20 = [ASIN_Addr1],16
  240. ldfe asin_coeff_P19 = [ASIN_Addr2],16
  241. fclass.m.unc p8,p0 = f8, 0x07 //@zero
  242. }
  243. ;;
  244. { .mfi
  245. ldfe asin_coeff_P9 = [ASIN_Addr1],16
  246. fma.s1 asin_t4 = asin_t2,asin_t2,f0
  247. (p9) mov GR_Parameter_Tag = 61
  248. }
  249. { .mfi
  250. ldfe asin_coeff_P8 = [ASIN_Addr2],16
  251. fma.s1 asin_3by2 = asin_1by2,f1,f1
  252. nop.i 999;;
  253. }
  254. { .mfi
  255. ldfe asin_coeff_P2 = [ASIN_Addr2],16
  256. fma.s1 asin_tx4 = asin_tx2,asin_tx2,f0
  257. nop.i 999
  258. }
  259. { .mfb
  260. ldfe asin_coeff_P3 = [ASIN_Addr1],16
  261. fma.s1 asin_t3 = asin_t,asin_t2,f0
  262. (p8) br.ret.spnt b0
  263. }
  264. ;;
  265. { .mfi
  266. ldfe asin_coeff_P13 = [ASIN_Addr2],16
  267. fma.s1 asin_H0 = asin_y0,asin_1by2,f0
  268. nop.i 999
  269. }
  270. { .mfb
  271. ldfe asin_coeff_P14 = [ASIN_Addr1],16
  272. fma.s1 asin_S0 = asin_y0,asin_t,f0
  273. (p9) br.cond.spnt __libm_error_region
  274. }
  275. ;;
  276. { .mfi
  277. ldfe asin_coeff_P11 = [ASIN_Addr2],16
  278. fcmp.eq.s1 p6,p0 = asin_abs_x,f1
  279. nop.i 999
  280. }
  281. { .mfi
  282. ldfe asin_coeff_P12 = [ASIN_Addr1],16
  283. fma.s1 asin_tx3 = asin_tx,asin_tx2,f0
  284. nop.i 999;;
  285. }
  286. { .mfi
  287. ldfe asin_coeff_P10 = [ASIN_Addr2],16
  288. fma.s1 asin_1poly_p6 = asin_tx,asin_coeff_P7,asin_coeff_P6
  289. nop.i 999
  290. }
  291. { .mfi
  292. ldfe asin_coeff_P1 = [ASIN_Addr1],16
  293. fma.s1 asin_poly_p6 = asin_t,asin_coeff_P7,asin_coeff_P6
  294. nop.i 999;;
  295. }
  296. { .mfi
  297. ldfe asin_const_sqrt2by2 = [ASIN_Addr2],16
  298. fma.s1 asin_5by2 = asin_3by2,f1,f1
  299. nop.i 999
  300. }
  301. { .mfi
  302. ldfe asin_coeff_P21 = [ASIN_Addr1],16
  303. fma.s1 asin_11by4 = asin_3by2,asin_3by2,asin_1by2
  304. nop.i 999;;
  305. }
  306. { .mfi
  307. ldfe asin_const_piby2 = [ASIN_Addr1],16
  308. fma.s1 asin_poly_p17 = asin_t,asin_coeff_P18,asin_coeff_P17
  309. nop.i 999
  310. }
  311. { .mfb
  312. nop.m 999
  313. fma.s1 asin_3by4 = asin_3by2,asin_1by2,f0
  314. (p6) br.cond.spnt ASIN_ABS_1 // Branch to short exit if |x|=1
  315. }
  316. ;;
  317. { .mfi
  318. addl ASIN_lnorm_sig = -0x1,r0 // Form significand 0xffffffffffffffff
  319. fma.s1 asin_poly_p15 = asin_t,asin_coeff_P16,asin_coeff_P15
  320. nop.i 999
  321. }
  322. { .mfi
  323. addl ASIN_snorm_exp = 0x0c001,r0 // Form small exponent
  324. fnma.s1 asin_d = asin_S0,asin_H0,asin_1by2
  325. nop.i 999;;
  326. }
  327. // Form the exponent and significand of a small number
  328. { .mfi
  329. setf.sig asin_eps_sig = ASIN_lnorm_sig
  330. fma.s1 asin_poly_p19 = asin_t,asin_coeff_P20,asin_coeff_P19
  331. nop.i 999
  332. }
  333. { .mfi
  334. setf.exp asin_eps_exp = ASIN_snorm_exp
  335. fma.s1 asin_poly_p4 = asin_t,asin_coeff_P5,asin_coeff_P4
  336. nop.i 999;;
  337. }
  338. { .mfi
  339. nop.m 999
  340. fma.s1 asin_1poly_p17 = asin_tx,asin_coeff_P18,asin_coeff_P17
  341. nop.i 999
  342. }
  343. { .mfi
  344. nop.m 999
  345. fma.s1 asin_poly_p8 = asin_t,asin_coeff_P9,asin_coeff_P8
  346. nop.i 999;;
  347. }
  348. { .mfi
  349. nop.m 999
  350. fms.s1 asin_35by8 = asin_5by2,asin_11by4,asin_5by2
  351. nop.i 999
  352. }
  353. { .mfi
  354. nop.m 999
  355. fma.s1 asin_63by8 = asin_5by2,asin_11by4,f1
  356. nop.i 999;;
  357. }
  358. { .mfi
  359. nop.m 999
  360. fma.s1 asin_poly_p13 = asin_t,asin_coeff_P14,asin_coeff_P13
  361. nop.i 999
  362. }
  363. { .mfi
  364. nop.m 999
  365. fma.s1 asin_18by4 = asin_3by2,asin_5by2,asin_3by4
  366. nop.i 999;;
  367. }
  368. { .mfi
  369. nop.m 999
  370. fma.s1 asin_l1 = asin_5by2,asin_d,asin_3by2
  371. nop.i 999
  372. }
  373. { .mfi
  374. nop.m 999
  375. fma.s1 asin_d2 = asin_d,asin_d,f0
  376. nop.i 999;;
  377. }
  378. { .mfi
  379. nop.m 999
  380. fma.s1 asin_poly_p15 = asin_t2,asin_poly_p17,asin_poly_p15
  381. nop.i 999
  382. }
  383. { .mfi
  384. nop.m 999
  385. fma.s1 asin_T0 = asin_d,asin_S0,f0
  386. nop.i 999;;
  387. }
  388. { .mfi
  389. nop.m 999
  390. fma.s1 asin_poly_p19 = asin_t2,asin_coeff_P21,asin_poly_p19
  391. nop.i 999
  392. }
  393. { .mfi
  394. nop.m 999
  395. fma.s1 asin_poly_p4 = asin_t2,asin_poly_p6,asin_poly_p4
  396. nop.i 999;;
  397. }
  398. { .mfi
  399. nop.m 999
  400. fma.s1 asin_d1 = asin_35by8,asin_d,f0
  401. nop.i 999
  402. }
  403. { .mfi
  404. nop.m 999
  405. fma.s1 asin_231by16 = asin_3by2,asin_35by8,asin_63by8
  406. nop.i 999;;
  407. }
  408. { .mfi
  409. nop.m 999
  410. fma.s1 asin_poly_p2 = asin_t,asin_coeff_P3,asin_coeff_P2
  411. nop.i 999
  412. }
  413. { .mfi
  414. nop.m 999
  415. fma.s1 asin_poly_p8 = asin_t2,asin_coeff_P10,asin_poly_p8
  416. nop.i 999;;
  417. }
  418. { .mfi
  419. nop.m 999
  420. fma.s1 asin_poly_p11 = asin_t,asin_coeff_P12,asin_coeff_P11
  421. nop.i 999
  422. }
  423. { .mfi
  424. nop.m 999
  425. fma.s1 asin_e0 = asin_d2,asin_l1,asin_d
  426. nop.i 999;;
  427. }
  428. { .mfi
  429. nop.m 999
  430. fma.s1 asin_1poly_p15 = asin_tx,asin_coeff_P16,asin_coeff_P15
  431. nop.i 999
  432. }
  433. { .mfi
  434. nop.m 999
  435. fma.s1 asin_poly_p0 = asin_t,asin_coeff_P1,f1
  436. nop.i 999;;
  437. }
  438. { .mfi
  439. nop.m 999
  440. fma.s1 asin_1poly_p19 = asin_tx,asin_coeff_P20,asin_coeff_P19
  441. nop.i 999
  442. }
  443. { .mfi
  444. nop.m 999
  445. fma.s1 asin_1poly_p4 = asin_tx,asin_coeff_P5,asin_coeff_P4
  446. nop.i 999;;
  447. }
  448. { .mfi
  449. nop.m 999
  450. fma.s1 asin_1poly_p8 = asin_tx,asin_coeff_P9,asin_coeff_P8
  451. nop.i 999
  452. }
  453. { .mfi
  454. nop.m 999
  455. fma.s1 asin_l2 = asin_231by16,asin_d,asin_63by8
  456. nop.i 999;;
  457. }
  458. { .mfi
  459. nop.m 999
  460. fma.s1 asin_d3 = asin_d2,asin_d,f0
  461. nop.i 999
  462. }
  463. { .mfi
  464. nop.m 999
  465. fma.s1 asin_T3 = asin_d2,asin_T0,f0
  466. nop.i 999;;
  467. }
  468. { .mfi
  469. nop.m 999
  470. fma.s1 asin_429by16 = asin_18by4,asin_11by4,asin_231by16
  471. nop.i 999
  472. }
  473. { .mfi
  474. nop.m 999
  475. fma.s1 asin_S1 = asin_e0,asin_S0,asin_S0
  476. nop.i 999;;
  477. }
  478. { .mfi
  479. nop.m 999
  480. fma.s1 asin_poly_p4 = asin_t4,asin_poly_p8,asin_poly_p4
  481. nop.i 999
  482. }
  483. { .mfi
  484. nop.m 999
  485. fma.s1 asin_poly_p15 = asin_t4,asin_poly_p19,asin_poly_p15
  486. nop.i 999;;
  487. }
  488. { .mfi
  489. nop.m 999
  490. fma.s1 asin_poly_p0 = asin_t2,asin_poly_p2,asin_poly_p0
  491. nop.i 999
  492. }
  493. { .mfi
  494. nop.m 999
  495. fma.s1 asin_poly_p11 = asin_t2,asin_poly_p13,asin_poly_p11
  496. nop.i 999;;
  497. }
  498. { .mfi
  499. nop.m 999
  500. fma.s1 asin_t8 = asin_t4,asin_t4,f0
  501. nop.i 999
  502. }
  503. { .mfi
  504. nop.m 999
  505. fma.s1 asin_e1 = asin_d2,asin_l2,asin_d1
  506. nop.i 999;;
  507. }
  508. { .mfi
  509. nop.m 999
  510. fma.s1 asin_1poly_p4 = asin_tx2,asin_1poly_p6,asin_1poly_p4
  511. nop.i 999
  512. }
  513. { .mfi
  514. nop.m 999
  515. fma.s1 asin_1poly_p15 = asin_tx2,asin_1poly_p17,asin_1poly_p15
  516. nop.i 999;;
  517. }
  518. { .mfi
  519. nop.m 999
  520. fma.s1 asin_1poly_p8 = asin_tx2,asin_coeff_P10,asin_1poly_p8
  521. nop.i 999
  522. }
  523. { .mfi
  524. nop.m 999
  525. fma.s1 asin_1poly_p19 = asin_tx2,asin_coeff_P21,asin_1poly_p19
  526. nop.i 999;;
  527. }
  528. { .mfi
  529. nop.m 999
  530. fma.s1 asin_1poly_p2 = asin_tx,asin_coeff_P3,asin_coeff_P2
  531. nop.i 999
  532. }
  533. { .mfi
  534. nop.m 999
  535. fma.s1 asin_1poly_p13 = asin_tx,asin_coeff_P14,asin_coeff_P13
  536. nop.i 999;;
  537. }
  538. { .mfi
  539. nop.m 999
  540. fma.s1 asin_1poly_p0 = asin_tx,asin_coeff_P1,f1
  541. nop.i 999
  542. }
  543. { .mfi
  544. nop.m 999
  545. fma.s1 asin_1poly_p11 = asin_tx,asin_coeff_P12,asin_coeff_P11
  546. nop.i 999;;
  547. }
  548. { .mfi
  549. nop.m 999
  550. fma.s1 asin_l3 = asin_429by16,asin_d,f0
  551. nop.i 999
  552. }
  553. { .mfi
  554. nop.m 999
  555. fma.s1 asin_z = asin_e1,asin_T3,asin_S1
  556. nop.i 999;;
  557. }
  558. { .mfi
  559. nop.m 999
  560. fma.s1 asin_poly_p11 = asin_t4,asin_poly_p15,asin_poly_p11
  561. nop.i 999
  562. }
  563. { .mfi
  564. nop.m 999
  565. fma.s1 asin_T6 = asin_T3,asin_d3,f0
  566. nop.i 999;;
  567. }
  568. { .mfi
  569. nop.m 999
  570. fma.s1 asin_t11 = asin_t8,asin_t3,f0
  571. nop.i 999
  572. }
  573. { .mfi
  574. nop.m 999
  575. fma.s1 asin_poly_p0 = asin_t4,asin_poly_p4,asin_poly_p0
  576. nop.i 999;;
  577. }
  578. { .mfi
  579. nop.m 999
  580. fma.s1 asin_1poly_p4 = asin_tx4,asin_1poly_p8,asin_1poly_p4
  581. nop.i 999
  582. }
  583. { .mfi
  584. nop.m 999
  585. fma.s1 asin_1poly_p15 = asin_tx4,asin_1poly_p19,asin_1poly_p15
  586. nop.i 999;;
  587. }
  588. { .mfi
  589. nop.m 999
  590. fma.s1 asin_1poly_p0 = asin_tx2,asin_1poly_p2,asin_1poly_p0
  591. nop.i 999
  592. }
  593. { .mfi
  594. nop.m 999
  595. fma.s1 asin_1poly_p11 = asin_tx2,asin_1poly_p13,asin_1poly_p11
  596. nop.i 999;;
  597. }
  598. { .mfi
  599. nop.m 999
  600. // fcmp.le.s1 asin_pred_LEsqrt2by2,asin_pred_GTsqrt2by2 = asin_abs_x,asin_const_sqrt2by2
  601. fcmp.le.s1 p7,p8 = asin_abs_x,asin_const_sqrt2by2
  602. nop.i 999
  603. }
  604. { .mfi
  605. nop.m 999
  606. fma.s1 asin_tx8 = asin_tx4,asin_tx4,f0
  607. nop.i 999;;
  608. }
  609. // Form a small number to force inexact flag for small args
  610. { .mfi
  611. nop.m 999
  612. fmerge.se asin_eps = asin_eps_exp,asin_eps_sig
  613. nop.i 999
  614. }
  615. { .mfi
  616. nop.m 999
  617. fma.s1 asin_z = asin_l3,asin_T6,asin_z
  618. nop.i 999;;
  619. }
  620. { .mfi
  621. nop.m 999
  622. fma.s1 asin_series_t = asin_t11,asin_poly_p11,asin_poly_p0
  623. nop.i 999;;
  624. }
  625. { .mfi
  626. nop.m 999
  627. fma.s1 asin_1poly_p0 = asin_tx4,asin_1poly_p4,asin_1poly_p0
  628. nop.i 999
  629. }
  630. { .mfi
  631. nop.m 999
  632. fma.s1 asin_1poly_p11 = asin_tx4,asin_1poly_p15,asin_1poly_p11
  633. nop.i 999;;
  634. }
  635. { .mfi
  636. nop.m 999
  637. fma.s1 asin_tx11 = asin_tx8,asin_tx3,f0
  638. nop.i 999;;
  639. }
  640. { .mfi
  641. nop.m 999
  642. //(asin_pred_GTsqrt2by2) fnma.s1 answer2 = asin_z,asin_series_t,asin_const_piby2
  643. (p8) fnma.s1 answer2 = asin_z,asin_series_t,asin_const_piby2
  644. nop.i 999;;
  645. }
  646. { .mfi
  647. nop.m 999
  648. fma.s1 asin_series_tx = asin_tx11,asin_1poly_p11,asin_1poly_p0
  649. nop.i 999;;
  650. }
  651. { .mfi
  652. nop.m 999
  653. //(asin_pred_GTsqrt2by2) fma.d f8 = asin_sgn_x,answer2,f0
  654. (p8) fma.d f8 = asin_sgn_x,answer2,f0
  655. nop.i 999;;
  656. }
  657. // asin_eps is added only to force inexact and possibly underflow flag
  658. // in case asin_series_tx is zero
  659. //
  660. { .mfi
  661. nop.m 999
  662. (p7) fma.d asin_eps = f8,asin_series_tx,asin_eps
  663. nop.i 999
  664. }
  665. { .mfb
  666. nop.m 999
  667. //(asin_pred_LEsqrt2by2) fma.d f8 = f8,asin_series_tx,f0
  668. (p7) fma.d f8 = f8,asin_series_tx,f0
  669. br.ret.sptk b0
  670. }
  671. ;;
  672. ASIN_ABS_1:
  673. // Here for short exit if |x|=1
  674. { .mfb
  675. nop.m 999
  676. fma.d f8 = asin_sgn_x,asin_const_piby2,f0
  677. br.ret.sptk b0
  678. }
  679. ;;
  680. .endp asin
  681. .proc __libm_error_region
  682. __libm_error_region:
  683. .prologue
  684. { .mfi
  685. add GR_Parameter_Y=-32,sp // Parameter 2 value
  686. nop.f 999
  687. .save ar.pfs,GR_SAVE_PFS
  688. mov GR_SAVE_PFS=ar.pfs // Save ar.pfs
  689. }
  690. { .mfi
  691. .fframe 64
  692. add sp=-64,sp // Create new stack
  693. nop.f 0
  694. mov GR_SAVE_GP=gp // Save gp
  695. };;
  696. { .mmi
  697. stfs [GR_Parameter_Y] = f1,16 // Store Parameter 2 on stack
  698. add GR_Parameter_X = 16,sp // Parameter 1 address
  699. .save b0, GR_SAVE_B0
  700. mov GR_SAVE_B0=b0 // Save b0
  701. };;
  702. .body
  703. frcpa.s0 f9,p0 = f0,f0
  704. ;;
  705. { .mib
  706. stfd [GR_Parameter_X] = f8 // Store Parameter 1 on stack
  707. add GR_Parameter_RESULT = 0,GR_Parameter_Y
  708. nop.b 0 // Parameter 3 address
  709. }
  710. { .mib
  711. stfd [GR_Parameter_Y] = f9,-16 // Store Parameter 3 on stack
  712. adds r32 = 48,sp
  713. br.call.sptk b0=__libm_error_support# // Call error handling function
  714. };;
  715. { .mmi
  716. ldfd f8 = [r32] // Get return result off stack
  717. .restore
  718. add sp = 64,sp // Restore stack pointer
  719. mov b0 = GR_SAVE_B0 // Restore return address
  720. };;
  721. { .mib
  722. mov gp = GR_SAVE_GP // Restore gp
  723. mov ar.pfs = GR_SAVE_PFS // Restore ar.pfs
  724. br.ret.sptk b0 // Return
  725. };;
  726. .endp __libm_error_region
  727. .type __libm_error_support,@function
  728. .global __libm_error_support