Source code of Windows XP (NT5)
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.

851 lines
23 KiB

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