PageRenderTime 38350ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 2ms

/arch/m68k/ifpsp060/src/fplsp.S

https://bitbucket.org/cresqo/cm7-p500-kernel
Assembly | 10980 lines | 9796 code | 1184 blank | 0 comment | 71 complexity | c8c88f2e1c605f8e83e2ae51cdf83207 MD5 | raw file
Possible License(s): LGPL-2.0, AGPL-1.0, GPL-2.0
  1. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2. MOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY GROUP
  3. M68000 Hi-Performance Microprocessor Division
  4. M68060 Software Package
  5. Production Release P1.00 -- October 10, 1994
  6. M68060 Software Package Copyright © 1993, 1994 Motorola Inc. All rights reserved.
  7. THE SOFTWARE is provided on an "AS IS" basis and without warranty.
  8. To the maximum extent permitted by applicable law,
  9. MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
  10. INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
  11. and any warranty against infringement with regard to the SOFTWARE
  12. (INCLUDING ANY MODIFIED VERSIONS THEREOF) and any accompanying written materials.
  13. To the maximum extent permitted by applicable law,
  14. IN NO EVENT SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER
  15. (INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS,
  16. BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS)
  17. ARISING OF THE USE OR INABILITY TO USE THE SOFTWARE.
  18. Motorola assumes no responsibility for the maintenance and support of the SOFTWARE.
  19. You are hereby granted a copyright license to use, modify, and distribute the SOFTWARE
  20. so long as this entire notice is retained without alteration in any modified and/or
  21. redistributed versions, and that such modified versions are clearly identified as such.
  22. No licenses are granted by implication, estoppel or otherwise under any patents
  23. or trademarks of Motorola, Inc.
  24. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  25. #
  26. # lfptop.s:
  27. # This file is appended to the top of the 060ILSP package
  28. # and contains the entry points into the package. The user, in
  29. # effect, branches to one of the branch table entries located here.
  30. #
  31. bra.l _facoss_
  32. short 0x0000
  33. bra.l _facosd_
  34. short 0x0000
  35. bra.l _facosx_
  36. short 0x0000
  37. bra.l _fasins_
  38. short 0x0000
  39. bra.l _fasind_
  40. short 0x0000
  41. bra.l _fasinx_
  42. short 0x0000
  43. bra.l _fatans_
  44. short 0x0000
  45. bra.l _fatand_
  46. short 0x0000
  47. bra.l _fatanx_
  48. short 0x0000
  49. bra.l _fatanhs_
  50. short 0x0000
  51. bra.l _fatanhd_
  52. short 0x0000
  53. bra.l _fatanhx_
  54. short 0x0000
  55. bra.l _fcoss_
  56. short 0x0000
  57. bra.l _fcosd_
  58. short 0x0000
  59. bra.l _fcosx_
  60. short 0x0000
  61. bra.l _fcoshs_
  62. short 0x0000
  63. bra.l _fcoshd_
  64. short 0x0000
  65. bra.l _fcoshx_
  66. short 0x0000
  67. bra.l _fetoxs_
  68. short 0x0000
  69. bra.l _fetoxd_
  70. short 0x0000
  71. bra.l _fetoxx_
  72. short 0x0000
  73. bra.l _fetoxm1s_
  74. short 0x0000
  75. bra.l _fetoxm1d_
  76. short 0x0000
  77. bra.l _fetoxm1x_
  78. short 0x0000
  79. bra.l _fgetexps_
  80. short 0x0000
  81. bra.l _fgetexpd_
  82. short 0x0000
  83. bra.l _fgetexpx_
  84. short 0x0000
  85. bra.l _fgetmans_
  86. short 0x0000
  87. bra.l _fgetmand_
  88. short 0x0000
  89. bra.l _fgetmanx_
  90. short 0x0000
  91. bra.l _flog10s_
  92. short 0x0000
  93. bra.l _flog10d_
  94. short 0x0000
  95. bra.l _flog10x_
  96. short 0x0000
  97. bra.l _flog2s_
  98. short 0x0000
  99. bra.l _flog2d_
  100. short 0x0000
  101. bra.l _flog2x_
  102. short 0x0000
  103. bra.l _flogns_
  104. short 0x0000
  105. bra.l _flognd_
  106. short 0x0000
  107. bra.l _flognx_
  108. short 0x0000
  109. bra.l _flognp1s_
  110. short 0x0000
  111. bra.l _flognp1d_
  112. short 0x0000
  113. bra.l _flognp1x_
  114. short 0x0000
  115. bra.l _fmods_
  116. short 0x0000
  117. bra.l _fmodd_
  118. short 0x0000
  119. bra.l _fmodx_
  120. short 0x0000
  121. bra.l _frems_
  122. short 0x0000
  123. bra.l _fremd_
  124. short 0x0000
  125. bra.l _fremx_
  126. short 0x0000
  127. bra.l _fscales_
  128. short 0x0000
  129. bra.l _fscaled_
  130. short 0x0000
  131. bra.l _fscalex_
  132. short 0x0000
  133. bra.l _fsins_
  134. short 0x0000
  135. bra.l _fsind_
  136. short 0x0000
  137. bra.l _fsinx_
  138. short 0x0000
  139. bra.l _fsincoss_
  140. short 0x0000
  141. bra.l _fsincosd_
  142. short 0x0000
  143. bra.l _fsincosx_
  144. short 0x0000
  145. bra.l _fsinhs_
  146. short 0x0000
  147. bra.l _fsinhd_
  148. short 0x0000
  149. bra.l _fsinhx_
  150. short 0x0000
  151. bra.l _ftans_
  152. short 0x0000
  153. bra.l _ftand_
  154. short 0x0000
  155. bra.l _ftanx_
  156. short 0x0000
  157. bra.l _ftanhs_
  158. short 0x0000
  159. bra.l _ftanhd_
  160. short 0x0000
  161. bra.l _ftanhx_
  162. short 0x0000
  163. bra.l _ftentoxs_
  164. short 0x0000
  165. bra.l _ftentoxd_
  166. short 0x0000
  167. bra.l _ftentoxx_
  168. short 0x0000
  169. bra.l _ftwotoxs_
  170. short 0x0000
  171. bra.l _ftwotoxd_
  172. short 0x0000
  173. bra.l _ftwotoxx_
  174. short 0x0000
  175. bra.l _fabss_
  176. short 0x0000
  177. bra.l _fabsd_
  178. short 0x0000
  179. bra.l _fabsx_
  180. short 0x0000
  181. bra.l _fadds_
  182. short 0x0000
  183. bra.l _faddd_
  184. short 0x0000
  185. bra.l _faddx_
  186. short 0x0000
  187. bra.l _fdivs_
  188. short 0x0000
  189. bra.l _fdivd_
  190. short 0x0000
  191. bra.l _fdivx_
  192. short 0x0000
  193. bra.l _fints_
  194. short 0x0000
  195. bra.l _fintd_
  196. short 0x0000
  197. bra.l _fintx_
  198. short 0x0000
  199. bra.l _fintrzs_
  200. short 0x0000
  201. bra.l _fintrzd_
  202. short 0x0000
  203. bra.l _fintrzx_
  204. short 0x0000
  205. bra.l _fmuls_
  206. short 0x0000
  207. bra.l _fmuld_
  208. short 0x0000
  209. bra.l _fmulx_
  210. short 0x0000
  211. bra.l _fnegs_
  212. short 0x0000
  213. bra.l _fnegd_
  214. short 0x0000
  215. bra.l _fnegx_
  216. short 0x0000
  217. bra.l _fsqrts_
  218. short 0x0000
  219. bra.l _fsqrtd_
  220. short 0x0000
  221. bra.l _fsqrtx_
  222. short 0x0000
  223. bra.l _fsubs_
  224. short 0x0000
  225. bra.l _fsubd_
  226. short 0x0000
  227. bra.l _fsubx_
  228. short 0x0000
  229. # leave room for future possible additions
  230. align 0x400
  231. #
  232. # This file contains a set of define statements for constants
  233. # in order to promote readability within the corecode itself.
  234. #
  235. set LOCAL_SIZE, 192 # stack frame size(bytes)
  236. set LV, -LOCAL_SIZE # stack offset
  237. set EXC_SR, 0x4 # stack status register
  238. set EXC_PC, 0x6 # stack pc
  239. set EXC_VOFF, 0xa # stacked vector offset
  240. set EXC_EA, 0xc # stacked <ea>
  241. set EXC_FP, 0x0 # frame pointer
  242. set EXC_AREGS, -68 # offset of all address regs
  243. set EXC_DREGS, -100 # offset of all data regs
  244. set EXC_FPREGS, -36 # offset of all fp regs
  245. set EXC_A7, EXC_AREGS+(7*4) # offset of saved a7
  246. set OLD_A7, EXC_AREGS+(6*4) # extra copy of saved a7
  247. set EXC_A6, EXC_AREGS+(6*4) # offset of saved a6
  248. set EXC_A5, EXC_AREGS+(5*4)
  249. set EXC_A4, EXC_AREGS+(4*4)
  250. set EXC_A3, EXC_AREGS+(3*4)
  251. set EXC_A2, EXC_AREGS+(2*4)
  252. set EXC_A1, EXC_AREGS+(1*4)
  253. set EXC_A0, EXC_AREGS+(0*4)
  254. set EXC_D7, EXC_DREGS+(7*4)
  255. set EXC_D6, EXC_DREGS+(6*4)
  256. set EXC_D5, EXC_DREGS+(5*4)
  257. set EXC_D4, EXC_DREGS+(4*4)
  258. set EXC_D3, EXC_DREGS+(3*4)
  259. set EXC_D2, EXC_DREGS+(2*4)
  260. set EXC_D1, EXC_DREGS+(1*4)
  261. set EXC_D0, EXC_DREGS+(0*4)
  262. set EXC_FP0, EXC_FPREGS+(0*12) # offset of saved fp0
  263. set EXC_FP1, EXC_FPREGS+(1*12) # offset of saved fp1
  264. set EXC_FP2, EXC_FPREGS+(2*12) # offset of saved fp2 (not used)
  265. set FP_SCR1, LV+80 # fp scratch 1
  266. set FP_SCR1_EX, FP_SCR1+0
  267. set FP_SCR1_SGN, FP_SCR1+2
  268. set FP_SCR1_HI, FP_SCR1+4
  269. set FP_SCR1_LO, FP_SCR1+8
  270. set FP_SCR0, LV+68 # fp scratch 0
  271. set FP_SCR0_EX, FP_SCR0+0
  272. set FP_SCR0_SGN, FP_SCR0+2
  273. set FP_SCR0_HI, FP_SCR0+4
  274. set FP_SCR0_LO, FP_SCR0+8
  275. set FP_DST, LV+56 # fp destination operand
  276. set FP_DST_EX, FP_DST+0
  277. set FP_DST_SGN, FP_DST+2
  278. set FP_DST_HI, FP_DST+4
  279. set FP_DST_LO, FP_DST+8
  280. set FP_SRC, LV+44 # fp source operand
  281. set FP_SRC_EX, FP_SRC+0
  282. set FP_SRC_SGN, FP_SRC+2
  283. set FP_SRC_HI, FP_SRC+4
  284. set FP_SRC_LO, FP_SRC+8
  285. set USER_FPIAR, LV+40 # FP instr address register
  286. set USER_FPSR, LV+36 # FP status register
  287. set FPSR_CC, USER_FPSR+0 # FPSR condition codes
  288. set FPSR_QBYTE, USER_FPSR+1 # FPSR qoutient byte
  289. set FPSR_EXCEPT, USER_FPSR+2 # FPSR exception status byte
  290. set FPSR_AEXCEPT, USER_FPSR+3 # FPSR accrued exception byte
  291. set USER_FPCR, LV+32 # FP control register
  292. set FPCR_ENABLE, USER_FPCR+2 # FPCR exception enable
  293. set FPCR_MODE, USER_FPCR+3 # FPCR rounding mode control
  294. set L_SCR3, LV+28 # integer scratch 3
  295. set L_SCR2, LV+24 # integer scratch 2
  296. set L_SCR1, LV+20 # integer scratch 1
  297. set STORE_FLG, LV+19 # flag: operand store (ie. not fcmp/ftst)
  298. set EXC_TEMP2, LV+24 # temporary space
  299. set EXC_TEMP, LV+16 # temporary space
  300. set DTAG, LV+15 # destination operand type
  301. set STAG, LV+14 # source operand type
  302. set SPCOND_FLG, LV+10 # flag: special case (see below)
  303. set EXC_CC, LV+8 # saved condition codes
  304. set EXC_EXTWPTR, LV+4 # saved current PC (active)
  305. set EXC_EXTWORD, LV+2 # saved extension word
  306. set EXC_CMDREG, LV+2 # saved extension word
  307. set EXC_OPWORD, LV+0 # saved operation word
  308. ################################
  309. # Helpful macros
  310. set FTEMP, 0 # offsets within an
  311. set FTEMP_EX, 0 # extended precision
  312. set FTEMP_SGN, 2 # value saved in memory.
  313. set FTEMP_HI, 4
  314. set FTEMP_LO, 8
  315. set FTEMP_GRS, 12
  316. set LOCAL, 0 # offsets within an
  317. set LOCAL_EX, 0 # extended precision
  318. set LOCAL_SGN, 2 # value saved in memory.
  319. set LOCAL_HI, 4
  320. set LOCAL_LO, 8
  321. set LOCAL_GRS, 12
  322. set DST, 0 # offsets within an
  323. set DST_EX, 0 # extended precision
  324. set DST_HI, 4 # value saved in memory.
  325. set DST_LO, 8
  326. set SRC, 0 # offsets within an
  327. set SRC_EX, 0 # extended precision
  328. set SRC_HI, 4 # value saved in memory.
  329. set SRC_LO, 8
  330. set SGL_LO, 0x3f81 # min sgl prec exponent
  331. set SGL_HI, 0x407e # max sgl prec exponent
  332. set DBL_LO, 0x3c01 # min dbl prec exponent
  333. set DBL_HI, 0x43fe # max dbl prec exponent
  334. set EXT_LO, 0x0 # min ext prec exponent
  335. set EXT_HI, 0x7ffe # max ext prec exponent
  336. set EXT_BIAS, 0x3fff # extended precision bias
  337. set SGL_BIAS, 0x007f # single precision bias
  338. set DBL_BIAS, 0x03ff # double precision bias
  339. set NORM, 0x00 # operand type for STAG/DTAG
  340. set ZERO, 0x01 # operand type for STAG/DTAG
  341. set INF, 0x02 # operand type for STAG/DTAG
  342. set QNAN, 0x03 # operand type for STAG/DTAG
  343. set DENORM, 0x04 # operand type for STAG/DTAG
  344. set SNAN, 0x05 # operand type for STAG/DTAG
  345. set UNNORM, 0x06 # operand type for STAG/DTAG
  346. ##################
  347. # FPSR/FPCR bits #
  348. ##################
  349. set neg_bit, 0x3 # negative result
  350. set z_bit, 0x2 # zero result
  351. set inf_bit, 0x1 # infinite result
  352. set nan_bit, 0x0 # NAN result
  353. set q_sn_bit, 0x7 # sign bit of quotient byte
  354. set bsun_bit, 7 # branch on unordered
  355. set snan_bit, 6 # signalling NAN
  356. set operr_bit, 5 # operand error
  357. set ovfl_bit, 4 # overflow
  358. set unfl_bit, 3 # underflow
  359. set dz_bit, 2 # divide by zero
  360. set inex2_bit, 1 # inexact result 2
  361. set inex1_bit, 0 # inexact result 1
  362. set aiop_bit, 7 # accrued inexact operation bit
  363. set aovfl_bit, 6 # accrued overflow bit
  364. set aunfl_bit, 5 # accrued underflow bit
  365. set adz_bit, 4 # accrued dz bit
  366. set ainex_bit, 3 # accrued inexact bit
  367. #############################
  368. # FPSR individual bit masks #
  369. #############################
  370. set neg_mask, 0x08000000 # negative bit mask (lw)
  371. set inf_mask, 0x02000000 # infinity bit mask (lw)
  372. set z_mask, 0x04000000 # zero bit mask (lw)
  373. set nan_mask, 0x01000000 # nan bit mask (lw)
  374. set neg_bmask, 0x08 # negative bit mask (byte)
  375. set inf_bmask, 0x02 # infinity bit mask (byte)
  376. set z_bmask, 0x04 # zero bit mask (byte)
  377. set nan_bmask, 0x01 # nan bit mask (byte)
  378. set bsun_mask, 0x00008000 # bsun exception mask
  379. set snan_mask, 0x00004000 # snan exception mask
  380. set operr_mask, 0x00002000 # operr exception mask
  381. set ovfl_mask, 0x00001000 # overflow exception mask
  382. set unfl_mask, 0x00000800 # underflow exception mask
  383. set dz_mask, 0x00000400 # dz exception mask
  384. set inex2_mask, 0x00000200 # inex2 exception mask
  385. set inex1_mask, 0x00000100 # inex1 exception mask
  386. set aiop_mask, 0x00000080 # accrued illegal operation
  387. set aovfl_mask, 0x00000040 # accrued overflow
  388. set aunfl_mask, 0x00000020 # accrued underflow
  389. set adz_mask, 0x00000010 # accrued divide by zero
  390. set ainex_mask, 0x00000008 # accrued inexact
  391. ######################################
  392. # FPSR combinations used in the FPSP #
  393. ######################################
  394. set dzinf_mask, inf_mask+dz_mask+adz_mask
  395. set opnan_mask, nan_mask+operr_mask+aiop_mask
  396. set nzi_mask, 0x01ffffff #clears N, Z, and I
  397. set unfinx_mask, unfl_mask+inex2_mask+aunfl_mask+ainex_mask
  398. set unf2inx_mask, unfl_mask+inex2_mask+ainex_mask
  399. set ovfinx_mask, ovfl_mask+inex2_mask+aovfl_mask+ainex_mask
  400. set inx1a_mask, inex1_mask+ainex_mask
  401. set inx2a_mask, inex2_mask+ainex_mask
  402. set snaniop_mask, nan_mask+snan_mask+aiop_mask
  403. set snaniop2_mask, snan_mask+aiop_mask
  404. set naniop_mask, nan_mask+aiop_mask
  405. set neginf_mask, neg_mask+inf_mask
  406. set infaiop_mask, inf_mask+aiop_mask
  407. set negz_mask, neg_mask+z_mask
  408. set opaop_mask, operr_mask+aiop_mask
  409. set unfl_inx_mask, unfl_mask+aunfl_mask+ainex_mask
  410. set ovfl_inx_mask, ovfl_mask+aovfl_mask+ainex_mask
  411. #########
  412. # misc. #
  413. #########
  414. set rnd_stky_bit, 29 # stky bit pos in longword
  415. set sign_bit, 0x7 # sign bit
  416. set signan_bit, 0x6 # signalling nan bit
  417. set sgl_thresh, 0x3f81 # minimum sgl exponent
  418. set dbl_thresh, 0x3c01 # minimum dbl exponent
  419. set x_mode, 0x0 # extended precision
  420. set s_mode, 0x4 # single precision
  421. set d_mode, 0x8 # double precision
  422. set rn_mode, 0x0 # round-to-nearest
  423. set rz_mode, 0x1 # round-to-zero
  424. set rm_mode, 0x2 # round-tp-minus-infinity
  425. set rp_mode, 0x3 # round-to-plus-infinity
  426. set mantissalen, 64 # length of mantissa in bits
  427. set BYTE, 1 # len(byte) == 1 byte
  428. set WORD, 2 # len(word) == 2 bytes
  429. set LONG, 4 # len(longword) == 2 bytes
  430. set BSUN_VEC, 0xc0 # bsun vector offset
  431. set INEX_VEC, 0xc4 # inexact vector offset
  432. set DZ_VEC, 0xc8 # dz vector offset
  433. set UNFL_VEC, 0xcc # unfl vector offset
  434. set OPERR_VEC, 0xd0 # operr vector offset
  435. set OVFL_VEC, 0xd4 # ovfl vector offset
  436. set SNAN_VEC, 0xd8 # snan vector offset
  437. ###########################
  438. # SPecial CONDition FLaGs #
  439. ###########################
  440. set ftrapcc_flg, 0x01 # flag bit: ftrapcc exception
  441. set fbsun_flg, 0x02 # flag bit: bsun exception
  442. set mia7_flg, 0x04 # flag bit: (a7)+ <ea>
  443. set mda7_flg, 0x08 # flag bit: -(a7) <ea>
  444. set fmovm_flg, 0x40 # flag bit: fmovm instruction
  445. set immed_flg, 0x80 # flag bit: &<data> <ea>
  446. set ftrapcc_bit, 0x0
  447. set fbsun_bit, 0x1
  448. set mia7_bit, 0x2
  449. set mda7_bit, 0x3
  450. set immed_bit, 0x7
  451. ##################################
  452. # TRANSCENDENTAL "LAST-OP" FLAGS #
  453. ##################################
  454. set FMUL_OP, 0x0 # fmul instr performed last
  455. set FDIV_OP, 0x1 # fdiv performed last
  456. set FADD_OP, 0x2 # fadd performed last
  457. set FMOV_OP, 0x3 # fmov performed last
  458. #############
  459. # CONSTANTS #
  460. #############
  461. T1: long 0x40C62D38,0xD3D64634 # 16381 LOG2 LEAD
  462. T2: long 0x3D6F90AE,0xB1E75CC7 # 16381 LOG2 TRAIL
  463. PI: long 0x40000000,0xC90FDAA2,0x2168C235,0x00000000
  464. PIBY2: long 0x3FFF0000,0xC90FDAA2,0x2168C235,0x00000000
  465. TWOBYPI:
  466. long 0x3FE45F30,0x6DC9C883
  467. #########################################################################
  468. # MONADIC TEMPLATE #
  469. #########################################################################
  470. global _fsins_
  471. _fsins_:
  472. link %a6,&-LOCAL_SIZE
  473. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  474. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  475. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  476. fmov.l &0x0,%fpcr # zero FPCR
  477. #
  478. # copy, convert, and tag input argument
  479. #
  480. fmov.s 0x8(%a6),%fp0 # load sgl input
  481. fmov.x %fp0,FP_SRC(%a6)
  482. lea FP_SRC(%a6),%a0
  483. bsr.l tag # fetch operand type
  484. mov.b %d0,STAG(%a6)
  485. mov.b %d0,%d1
  486. andi.l &0x00ff00ff,USER_FPSR(%a6)
  487. clr.l %d0
  488. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  489. tst.b %d1
  490. bne.b _L0_2s
  491. bsr.l ssin # operand is a NORM
  492. bra.b _L0_6s
  493. _L0_2s:
  494. cmpi.b %d1,&ZERO # is operand a ZERO?
  495. bne.b _L0_3s # no
  496. bsr.l src_zero # yes
  497. bra.b _L0_6s
  498. _L0_3s:
  499. cmpi.b %d1,&INF # is operand an INF?
  500. bne.b _L0_4s # no
  501. bsr.l t_operr # yes
  502. bra.b _L0_6s
  503. _L0_4s:
  504. cmpi.b %d1,&QNAN # is operand a QNAN?
  505. bne.b _L0_5s # no
  506. bsr.l src_qnan # yes
  507. bra.b _L0_6s
  508. _L0_5s:
  509. bsr.l ssind # operand is a DENORM
  510. _L0_6s:
  511. #
  512. # Result is now in FP0
  513. #
  514. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  515. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  516. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  517. unlk %a6
  518. rts
  519. global _fsind_
  520. _fsind_:
  521. link %a6,&-LOCAL_SIZE
  522. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  523. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  524. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  525. fmov.l &0x0,%fpcr # zero FPCR
  526. #
  527. # copy, convert, and tag input argument
  528. #
  529. fmov.d 0x8(%a6),%fp0 # load dbl input
  530. fmov.x %fp0,FP_SRC(%a6)
  531. lea FP_SRC(%a6),%a0
  532. bsr.l tag # fetch operand type
  533. mov.b %d0,STAG(%a6)
  534. mov.b %d0,%d1
  535. andi.l &0x00ff00ff,USER_FPSR(%a6)
  536. clr.l %d0
  537. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  538. mov.b %d1,STAG(%a6)
  539. tst.b %d1
  540. bne.b _L0_2d
  541. bsr.l ssin # operand is a NORM
  542. bra.b _L0_6d
  543. _L0_2d:
  544. cmpi.b %d1,&ZERO # is operand a ZERO?
  545. bne.b _L0_3d # no
  546. bsr.l src_zero # yes
  547. bra.b _L0_6d
  548. _L0_3d:
  549. cmpi.b %d1,&INF # is operand an INF?
  550. bne.b _L0_4d # no
  551. bsr.l t_operr # yes
  552. bra.b _L0_6d
  553. _L0_4d:
  554. cmpi.b %d1,&QNAN # is operand a QNAN?
  555. bne.b _L0_5d # no
  556. bsr.l src_qnan # yes
  557. bra.b _L0_6d
  558. _L0_5d:
  559. bsr.l ssind # operand is a DENORM
  560. _L0_6d:
  561. #
  562. # Result is now in FP0
  563. #
  564. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  565. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  566. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  567. unlk %a6
  568. rts
  569. global _fsinx_
  570. _fsinx_:
  571. link %a6,&-LOCAL_SIZE
  572. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  573. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  574. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  575. fmov.l &0x0,%fpcr # zero FPCR
  576. #
  577. # copy, convert, and tag input argument
  578. #
  579. lea FP_SRC(%a6),%a0
  580. mov.l 0x8+0x0(%a6),0x0(%a0) # load ext input
  581. mov.l 0x8+0x4(%a6),0x4(%a0)
  582. mov.l 0x8+0x8(%a6),0x8(%a0)
  583. bsr.l tag # fetch operand type
  584. mov.b %d0,STAG(%a6)
  585. mov.b %d0,%d1
  586. andi.l &0x00ff00ff,USER_FPSR(%a6)
  587. clr.l %d0
  588. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  589. tst.b %d1
  590. bne.b _L0_2x
  591. bsr.l ssin # operand is a NORM
  592. bra.b _L0_6x
  593. _L0_2x:
  594. cmpi.b %d1,&ZERO # is operand a ZERO?
  595. bne.b _L0_3x # no
  596. bsr.l src_zero # yes
  597. bra.b _L0_6x
  598. _L0_3x:
  599. cmpi.b %d1,&INF # is operand an INF?
  600. bne.b _L0_4x # no
  601. bsr.l t_operr # yes
  602. bra.b _L0_6x
  603. _L0_4x:
  604. cmpi.b %d1,&QNAN # is operand a QNAN?
  605. bne.b _L0_5x # no
  606. bsr.l src_qnan # yes
  607. bra.b _L0_6x
  608. _L0_5x:
  609. bsr.l ssind # operand is a DENORM
  610. _L0_6x:
  611. #
  612. # Result is now in FP0
  613. #
  614. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  615. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  616. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  617. unlk %a6
  618. rts
  619. #########################################################################
  620. # MONADIC TEMPLATE #
  621. #########################################################################
  622. global _fcoss_
  623. _fcoss_:
  624. link %a6,&-LOCAL_SIZE
  625. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  626. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  627. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  628. fmov.l &0x0,%fpcr # zero FPCR
  629. #
  630. # copy, convert, and tag input argument
  631. #
  632. fmov.s 0x8(%a6),%fp0 # load sgl input
  633. fmov.x %fp0,FP_SRC(%a6)
  634. lea FP_SRC(%a6),%a0
  635. bsr.l tag # fetch operand type
  636. mov.b %d0,STAG(%a6)
  637. mov.b %d0,%d1
  638. andi.l &0x00ff00ff,USER_FPSR(%a6)
  639. clr.l %d0
  640. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  641. tst.b %d1
  642. bne.b _L1_2s
  643. bsr.l scos # operand is a NORM
  644. bra.b _L1_6s
  645. _L1_2s:
  646. cmpi.b %d1,&ZERO # is operand a ZERO?
  647. bne.b _L1_3s # no
  648. bsr.l ld_pone # yes
  649. bra.b _L1_6s
  650. _L1_3s:
  651. cmpi.b %d1,&INF # is operand an INF?
  652. bne.b _L1_4s # no
  653. bsr.l t_operr # yes
  654. bra.b _L1_6s
  655. _L1_4s:
  656. cmpi.b %d1,&QNAN # is operand a QNAN?
  657. bne.b _L1_5s # no
  658. bsr.l src_qnan # yes
  659. bra.b _L1_6s
  660. _L1_5s:
  661. bsr.l scosd # operand is a DENORM
  662. _L1_6s:
  663. #
  664. # Result is now in FP0
  665. #
  666. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  667. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  668. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  669. unlk %a6
  670. rts
  671. global _fcosd_
  672. _fcosd_:
  673. link %a6,&-LOCAL_SIZE
  674. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  675. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  676. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  677. fmov.l &0x0,%fpcr # zero FPCR
  678. #
  679. # copy, convert, and tag input argument
  680. #
  681. fmov.d 0x8(%a6),%fp0 # load dbl input
  682. fmov.x %fp0,FP_SRC(%a6)
  683. lea FP_SRC(%a6),%a0
  684. bsr.l tag # fetch operand type
  685. mov.b %d0,STAG(%a6)
  686. mov.b %d0,%d1
  687. andi.l &0x00ff00ff,USER_FPSR(%a6)
  688. clr.l %d0
  689. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  690. mov.b %d1,STAG(%a6)
  691. tst.b %d1
  692. bne.b _L1_2d
  693. bsr.l scos # operand is a NORM
  694. bra.b _L1_6d
  695. _L1_2d:
  696. cmpi.b %d1,&ZERO # is operand a ZERO?
  697. bne.b _L1_3d # no
  698. bsr.l ld_pone # yes
  699. bra.b _L1_6d
  700. _L1_3d:
  701. cmpi.b %d1,&INF # is operand an INF?
  702. bne.b _L1_4d # no
  703. bsr.l t_operr # yes
  704. bra.b _L1_6d
  705. _L1_4d:
  706. cmpi.b %d1,&QNAN # is operand a QNAN?
  707. bne.b _L1_5d # no
  708. bsr.l src_qnan # yes
  709. bra.b _L1_6d
  710. _L1_5d:
  711. bsr.l scosd # operand is a DENORM
  712. _L1_6d:
  713. #
  714. # Result is now in FP0
  715. #
  716. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  717. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  718. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  719. unlk %a6
  720. rts
  721. global _fcosx_
  722. _fcosx_:
  723. link %a6,&-LOCAL_SIZE
  724. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  725. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  726. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  727. fmov.l &0x0,%fpcr # zero FPCR
  728. #
  729. # copy, convert, and tag input argument
  730. #
  731. lea FP_SRC(%a6),%a0
  732. mov.l 0x8+0x0(%a6),0x0(%a0) # load ext input
  733. mov.l 0x8+0x4(%a6),0x4(%a0)
  734. mov.l 0x8+0x8(%a6),0x8(%a0)
  735. bsr.l tag # fetch operand type
  736. mov.b %d0,STAG(%a6)
  737. mov.b %d0,%d1
  738. andi.l &0x00ff00ff,USER_FPSR(%a6)
  739. clr.l %d0
  740. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  741. tst.b %d1
  742. bne.b _L1_2x
  743. bsr.l scos # operand is a NORM
  744. bra.b _L1_6x
  745. _L1_2x:
  746. cmpi.b %d1,&ZERO # is operand a ZERO?
  747. bne.b _L1_3x # no
  748. bsr.l ld_pone # yes
  749. bra.b _L1_6x
  750. _L1_3x:
  751. cmpi.b %d1,&INF # is operand an INF?
  752. bne.b _L1_4x # no
  753. bsr.l t_operr # yes
  754. bra.b _L1_6x
  755. _L1_4x:
  756. cmpi.b %d1,&QNAN # is operand a QNAN?
  757. bne.b _L1_5x # no
  758. bsr.l src_qnan # yes
  759. bra.b _L1_6x
  760. _L1_5x:
  761. bsr.l scosd # operand is a DENORM
  762. _L1_6x:
  763. #
  764. # Result is now in FP0
  765. #
  766. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  767. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  768. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  769. unlk %a6
  770. rts
  771. #########################################################################
  772. # MONADIC TEMPLATE #
  773. #########################################################################
  774. global _fsinhs_
  775. _fsinhs_:
  776. link %a6,&-LOCAL_SIZE
  777. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  778. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  779. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  780. fmov.l &0x0,%fpcr # zero FPCR
  781. #
  782. # copy, convert, and tag input argument
  783. #
  784. fmov.s 0x8(%a6),%fp0 # load sgl input
  785. fmov.x %fp0,FP_SRC(%a6)
  786. lea FP_SRC(%a6),%a0
  787. bsr.l tag # fetch operand type
  788. mov.b %d0,STAG(%a6)
  789. mov.b %d0,%d1
  790. andi.l &0x00ff00ff,USER_FPSR(%a6)
  791. clr.l %d0
  792. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  793. tst.b %d1
  794. bne.b _L2_2s
  795. bsr.l ssinh # operand is a NORM
  796. bra.b _L2_6s
  797. _L2_2s:
  798. cmpi.b %d1,&ZERO # is operand a ZERO?
  799. bne.b _L2_3s # no
  800. bsr.l src_zero # yes
  801. bra.b _L2_6s
  802. _L2_3s:
  803. cmpi.b %d1,&INF # is operand an INF?
  804. bne.b _L2_4s # no
  805. bsr.l src_inf # yes
  806. bra.b _L2_6s
  807. _L2_4s:
  808. cmpi.b %d1,&QNAN # is operand a QNAN?
  809. bne.b _L2_5s # no
  810. bsr.l src_qnan # yes
  811. bra.b _L2_6s
  812. _L2_5s:
  813. bsr.l ssinhd # operand is a DENORM
  814. _L2_6s:
  815. #
  816. # Result is now in FP0
  817. #
  818. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  819. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  820. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  821. unlk %a6
  822. rts
  823. global _fsinhd_
  824. _fsinhd_:
  825. link %a6,&-LOCAL_SIZE
  826. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  827. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  828. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  829. fmov.l &0x0,%fpcr # zero FPCR
  830. #
  831. # copy, convert, and tag input argument
  832. #
  833. fmov.d 0x8(%a6),%fp0 # load dbl input
  834. fmov.x %fp0,FP_SRC(%a6)
  835. lea FP_SRC(%a6),%a0
  836. bsr.l tag # fetch operand type
  837. mov.b %d0,STAG(%a6)
  838. mov.b %d0,%d1
  839. andi.l &0x00ff00ff,USER_FPSR(%a6)
  840. clr.l %d0
  841. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  842. mov.b %d1,STAG(%a6)
  843. tst.b %d1
  844. bne.b _L2_2d
  845. bsr.l ssinh # operand is a NORM
  846. bra.b _L2_6d
  847. _L2_2d:
  848. cmpi.b %d1,&ZERO # is operand a ZERO?
  849. bne.b _L2_3d # no
  850. bsr.l src_zero # yes
  851. bra.b _L2_6d
  852. _L2_3d:
  853. cmpi.b %d1,&INF # is operand an INF?
  854. bne.b _L2_4d # no
  855. bsr.l src_inf # yes
  856. bra.b _L2_6d
  857. _L2_4d:
  858. cmpi.b %d1,&QNAN # is operand a QNAN?
  859. bne.b _L2_5d # no
  860. bsr.l src_qnan # yes
  861. bra.b _L2_6d
  862. _L2_5d:
  863. bsr.l ssinhd # operand is a DENORM
  864. _L2_6d:
  865. #
  866. # Result is now in FP0
  867. #
  868. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  869. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  870. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  871. unlk %a6
  872. rts
  873. global _fsinhx_
  874. _fsinhx_:
  875. link %a6,&-LOCAL_SIZE
  876. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  877. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  878. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  879. fmov.l &0x0,%fpcr # zero FPCR
  880. #
  881. # copy, convert, and tag input argument
  882. #
  883. lea FP_SRC(%a6),%a0
  884. mov.l 0x8+0x0(%a6),0x0(%a0) # load ext input
  885. mov.l 0x8+0x4(%a6),0x4(%a0)
  886. mov.l 0x8+0x8(%a6),0x8(%a0)
  887. bsr.l tag # fetch operand type
  888. mov.b %d0,STAG(%a6)
  889. mov.b %d0,%d1
  890. andi.l &0x00ff00ff,USER_FPSR(%a6)
  891. clr.l %d0
  892. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  893. tst.b %d1
  894. bne.b _L2_2x
  895. bsr.l ssinh # operand is a NORM
  896. bra.b _L2_6x
  897. _L2_2x:
  898. cmpi.b %d1,&ZERO # is operand a ZERO?
  899. bne.b _L2_3x # no
  900. bsr.l src_zero # yes
  901. bra.b _L2_6x
  902. _L2_3x:
  903. cmpi.b %d1,&INF # is operand an INF?
  904. bne.b _L2_4x # no
  905. bsr.l src_inf # yes
  906. bra.b _L2_6x
  907. _L2_4x:
  908. cmpi.b %d1,&QNAN # is operand a QNAN?
  909. bne.b _L2_5x # no
  910. bsr.l src_qnan # yes
  911. bra.b _L2_6x
  912. _L2_5x:
  913. bsr.l ssinhd # operand is a DENORM
  914. _L2_6x:
  915. #
  916. # Result is now in FP0
  917. #
  918. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  919. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  920. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  921. unlk %a6
  922. rts
  923. #########################################################################
  924. # MONADIC TEMPLATE #
  925. #########################################################################
  926. global _flognp1s_
  927. _flognp1s_:
  928. link %a6,&-LOCAL_SIZE
  929. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  930. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  931. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  932. fmov.l &0x0,%fpcr # zero FPCR
  933. #
  934. # copy, convert, and tag input argument
  935. #
  936. fmov.s 0x8(%a6),%fp0 # load sgl input
  937. fmov.x %fp0,FP_SRC(%a6)
  938. lea FP_SRC(%a6),%a0
  939. bsr.l tag # fetch operand type
  940. mov.b %d0,STAG(%a6)
  941. mov.b %d0,%d1
  942. andi.l &0x00ff00ff,USER_FPSR(%a6)
  943. clr.l %d0
  944. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  945. tst.b %d1
  946. bne.b _L3_2s
  947. bsr.l slognp1 # operand is a NORM
  948. bra.b _L3_6s
  949. _L3_2s:
  950. cmpi.b %d1,&ZERO # is operand a ZERO?
  951. bne.b _L3_3s # no
  952. bsr.l src_zero # yes
  953. bra.b _L3_6s
  954. _L3_3s:
  955. cmpi.b %d1,&INF # is operand an INF?
  956. bne.b _L3_4s # no
  957. bsr.l sopr_inf # yes
  958. bra.b _L3_6s
  959. _L3_4s:
  960. cmpi.b %d1,&QNAN # is operand a QNAN?
  961. bne.b _L3_5s # no
  962. bsr.l src_qnan # yes
  963. bra.b _L3_6s
  964. _L3_5s:
  965. bsr.l slognp1d # operand is a DENORM
  966. _L3_6s:
  967. #
  968. # Result is now in FP0
  969. #
  970. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  971. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  972. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  973. unlk %a6
  974. rts
  975. global _flognp1d_
  976. _flognp1d_:
  977. link %a6,&-LOCAL_SIZE
  978. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  979. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  980. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  981. fmov.l &0x0,%fpcr # zero FPCR
  982. #
  983. # copy, convert, and tag input argument
  984. #
  985. fmov.d 0x8(%a6),%fp0 # load dbl input
  986. fmov.x %fp0,FP_SRC(%a6)
  987. lea FP_SRC(%a6),%a0
  988. bsr.l tag # fetch operand type
  989. mov.b %d0,STAG(%a6)
  990. mov.b %d0,%d1
  991. andi.l &0x00ff00ff,USER_FPSR(%a6)
  992. clr.l %d0
  993. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  994. mov.b %d1,STAG(%a6)
  995. tst.b %d1
  996. bne.b _L3_2d
  997. bsr.l slognp1 # operand is a NORM
  998. bra.b _L3_6d
  999. _L3_2d:
  1000. cmpi.b %d1,&ZERO # is operand a ZERO?
  1001. bne.b _L3_3d # no
  1002. bsr.l src_zero # yes
  1003. bra.b _L3_6d
  1004. _L3_3d:
  1005. cmpi.b %d1,&INF # is operand an INF?
  1006. bne.b _L3_4d # no
  1007. bsr.l sopr_inf # yes
  1008. bra.b _L3_6d
  1009. _L3_4d:
  1010. cmpi.b %d1,&QNAN # is operand a QNAN?
  1011. bne.b _L3_5d # no
  1012. bsr.l src_qnan # yes
  1013. bra.b _L3_6d
  1014. _L3_5d:
  1015. bsr.l slognp1d # operand is a DENORM
  1016. _L3_6d:
  1017. #
  1018. # Result is now in FP0
  1019. #
  1020. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  1021. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  1022. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  1023. unlk %a6
  1024. rts
  1025. global _flognp1x_
  1026. _flognp1x_:
  1027. link %a6,&-LOCAL_SIZE
  1028. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  1029. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  1030. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  1031. fmov.l &0x0,%fpcr # zero FPCR
  1032. #
  1033. # copy, convert, and tag input argument
  1034. #
  1035. lea FP_SRC(%a6),%a0
  1036. mov.l 0x8+0x0(%a6),0x0(%a0) # load ext input
  1037. mov.l 0x8+0x4(%a6),0x4(%a0)
  1038. mov.l 0x8+0x8(%a6),0x8(%a0)
  1039. bsr.l tag # fetch operand type
  1040. mov.b %d0,STAG(%a6)
  1041. mov.b %d0,%d1
  1042. andi.l &0x00ff00ff,USER_FPSR(%a6)
  1043. clr.l %d0
  1044. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  1045. tst.b %d1
  1046. bne.b _L3_2x
  1047. bsr.l slognp1 # operand is a NORM
  1048. bra.b _L3_6x
  1049. _L3_2x:
  1050. cmpi.b %d1,&ZERO # is operand a ZERO?
  1051. bne.b _L3_3x # no
  1052. bsr.l src_zero # yes
  1053. bra.b _L3_6x
  1054. _L3_3x:
  1055. cmpi.b %d1,&INF # is operand an INF?
  1056. bne.b _L3_4x # no
  1057. bsr.l sopr_inf # yes
  1058. bra.b _L3_6x
  1059. _L3_4x:
  1060. cmpi.b %d1,&QNAN # is operand a QNAN?
  1061. bne.b _L3_5x # no
  1062. bsr.l src_qnan # yes
  1063. bra.b _L3_6x
  1064. _L3_5x:
  1065. bsr.l slognp1d # operand is a DENORM
  1066. _L3_6x:
  1067. #
  1068. # Result is now in FP0
  1069. #
  1070. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  1071. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  1072. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  1073. unlk %a6
  1074. rts
  1075. #########################################################################
  1076. # MONADIC TEMPLATE #
  1077. #########################################################################
  1078. global _fetoxm1s_
  1079. _fetoxm1s_:
  1080. link %a6,&-LOCAL_SIZE
  1081. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  1082. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  1083. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  1084. fmov.l &0x0,%fpcr # zero FPCR
  1085. #
  1086. # copy, convert, and tag input argument
  1087. #
  1088. fmov.s 0x8(%a6),%fp0 # load sgl input
  1089. fmov.x %fp0,FP_SRC(%a6)
  1090. lea FP_SRC(%a6),%a0
  1091. bsr.l tag # fetch operand type
  1092. mov.b %d0,STAG(%a6)
  1093. mov.b %d0,%d1
  1094. andi.l &0x00ff00ff,USER_FPSR(%a6)
  1095. clr.l %d0
  1096. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  1097. tst.b %d1
  1098. bne.b _L4_2s
  1099. bsr.l setoxm1 # operand is a NORM
  1100. bra.b _L4_6s
  1101. _L4_2s:
  1102. cmpi.b %d1,&ZERO # is operand a ZERO?
  1103. bne.b _L4_3s # no
  1104. bsr.l src_zero # yes
  1105. bra.b _L4_6s
  1106. _L4_3s:
  1107. cmpi.b %d1,&INF # is operand an INF?
  1108. bne.b _L4_4s # no
  1109. bsr.l setoxm1i # yes
  1110. bra.b _L4_6s
  1111. _L4_4s:
  1112. cmpi.b %d1,&QNAN # is operand a QNAN?
  1113. bne.b _L4_5s # no
  1114. bsr.l src_qnan # yes
  1115. bra.b _L4_6s
  1116. _L4_5s:
  1117. bsr.l setoxm1d # operand is a DENORM
  1118. _L4_6s:
  1119. #
  1120. # Result is now in FP0
  1121. #
  1122. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  1123. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  1124. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  1125. unlk %a6
  1126. rts
  1127. global _fetoxm1d_
  1128. _fetoxm1d_:
  1129. link %a6,&-LOCAL_SIZE
  1130. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  1131. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  1132. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  1133. fmov.l &0x0,%fpcr # zero FPCR
  1134. #
  1135. # copy, convert, and tag input argument
  1136. #
  1137. fmov.d 0x8(%a6),%fp0 # load dbl input
  1138. fmov.x %fp0,FP_SRC(%a6)
  1139. lea FP_SRC(%a6),%a0
  1140. bsr.l tag # fetch operand type
  1141. mov.b %d0,STAG(%a6)
  1142. mov.b %d0,%d1
  1143. andi.l &0x00ff00ff,USER_FPSR(%a6)
  1144. clr.l %d0
  1145. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  1146. mov.b %d1,STAG(%a6)
  1147. tst.b %d1
  1148. bne.b _L4_2d
  1149. bsr.l setoxm1 # operand is a NORM
  1150. bra.b _L4_6d
  1151. _L4_2d:
  1152. cmpi.b %d1,&ZERO # is operand a ZERO?
  1153. bne.b _L4_3d # no
  1154. bsr.l src_zero # yes
  1155. bra.b _L4_6d
  1156. _L4_3d:
  1157. cmpi.b %d1,&INF # is operand an INF?
  1158. bne.b _L4_4d # no
  1159. bsr.l setoxm1i # yes
  1160. bra.b _L4_6d
  1161. _L4_4d:
  1162. cmpi.b %d1,&QNAN # is operand a QNAN?
  1163. bne.b _L4_5d # no
  1164. bsr.l src_qnan # yes
  1165. bra.b _L4_6d
  1166. _L4_5d:
  1167. bsr.l setoxm1d # operand is a DENORM
  1168. _L4_6d:
  1169. #
  1170. # Result is now in FP0
  1171. #
  1172. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  1173. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  1174. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  1175. unlk %a6
  1176. rts
  1177. global _fetoxm1x_
  1178. _fetoxm1x_:
  1179. link %a6,&-LOCAL_SIZE
  1180. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  1181. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  1182. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  1183. fmov.l &0x0,%fpcr # zero FPCR
  1184. #
  1185. # copy, convert, and tag input argument
  1186. #
  1187. lea FP_SRC(%a6),%a0
  1188. mov.l 0x8+0x0(%a6),0x0(%a0) # load ext input
  1189. mov.l 0x8+0x4(%a6),0x4(%a0)
  1190. mov.l 0x8+0x8(%a6),0x8(%a0)
  1191. bsr.l tag # fetch operand type
  1192. mov.b %d0,STAG(%a6)
  1193. mov.b %d0,%d1
  1194. andi.l &0x00ff00ff,USER_FPSR(%a6)
  1195. clr.l %d0
  1196. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  1197. tst.b %d1
  1198. bne.b _L4_2x
  1199. bsr.l setoxm1 # operand is a NORM
  1200. bra.b _L4_6x
  1201. _L4_2x:
  1202. cmpi.b %d1,&ZERO # is operand a ZERO?
  1203. bne.b _L4_3x # no
  1204. bsr.l src_zero # yes
  1205. bra.b _L4_6x
  1206. _L4_3x:
  1207. cmpi.b %d1,&INF # is operand an INF?
  1208. bne.b _L4_4x # no
  1209. bsr.l setoxm1i # yes
  1210. bra.b _L4_6x
  1211. _L4_4x:
  1212. cmpi.b %d1,&QNAN # is operand a QNAN?
  1213. bne.b _L4_5x # no
  1214. bsr.l src_qnan # yes
  1215. bra.b _L4_6x
  1216. _L4_5x:
  1217. bsr.l setoxm1d # operand is a DENORM
  1218. _L4_6x:
  1219. #
  1220. # Result is now in FP0
  1221. #
  1222. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  1223. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  1224. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  1225. unlk %a6
  1226. rts
  1227. #########################################################################
  1228. # MONADIC TEMPLATE #
  1229. #########################################################################
  1230. global _ftanhs_
  1231. _ftanhs_:
  1232. link %a6,&-LOCAL_SIZE
  1233. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  1234. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  1235. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  1236. fmov.l &0x0,%fpcr # zero FPCR
  1237. #
  1238. # copy, convert, and tag input argument
  1239. #
  1240. fmov.s 0x8(%a6),%fp0 # load sgl input
  1241. fmov.x %fp0,FP_SRC(%a6)
  1242. lea FP_SRC(%a6),%a0
  1243. bsr.l tag # fetch operand type
  1244. mov.b %d0,STAG(%a6)
  1245. mov.b %d0,%d1
  1246. andi.l &0x00ff00ff,USER_FPSR(%a6)
  1247. clr.l %d0
  1248. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  1249. tst.b %d1
  1250. bne.b _L5_2s
  1251. bsr.l stanh # operand is a NORM
  1252. bra.b _L5_6s
  1253. _L5_2s:
  1254. cmpi.b %d1,&ZERO # is operand a ZERO?
  1255. bne.b _L5_3s # no
  1256. bsr.l src_zero # yes
  1257. bra.b _L5_6s
  1258. _L5_3s:
  1259. cmpi.b %d1,&INF # is operand an INF?
  1260. bne.b _L5_4s # no
  1261. bsr.l src_one # yes
  1262. bra.b _L5_6s
  1263. _L5_4s:
  1264. cmpi.b %d1,&QNAN # is operand a QNAN?
  1265. bne.b _L5_5s # no
  1266. bsr.l src_qnan # yes
  1267. bra.b _L5_6s
  1268. _L5_5s:
  1269. bsr.l stanhd # operand is a DENORM
  1270. _L5_6s:
  1271. #
  1272. # Result is now in FP0
  1273. #
  1274. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  1275. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  1276. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  1277. unlk %a6
  1278. rts
  1279. global _ftanhd_
  1280. _ftanhd_:
  1281. link %a6,&-LOCAL_SIZE
  1282. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  1283. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  1284. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  1285. fmov.l &0x0,%fpcr # zero FPCR
  1286. #
  1287. # copy, convert, and tag input argument
  1288. #
  1289. fmov.d 0x8(%a6),%fp0 # load dbl input
  1290. fmov.x %fp0,FP_SRC(%a6)
  1291. lea FP_SRC(%a6),%a0
  1292. bsr.l tag # fetch operand type
  1293. mov.b %d0,STAG(%a6)
  1294. mov.b %d0,%d1
  1295. andi.l &0x00ff00ff,USER_FPSR(%a6)
  1296. clr.l %d0
  1297. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  1298. mov.b %d1,STAG(%a6)
  1299. tst.b %d1
  1300. bne.b _L5_2d
  1301. bsr.l stanh # operand is a NORM
  1302. bra.b _L5_6d
  1303. _L5_2d:
  1304. cmpi.b %d1,&ZERO # is operand a ZERO?
  1305. bne.b _L5_3d # no
  1306. bsr.l src_zero # yes
  1307. bra.b _L5_6d
  1308. _L5_3d:
  1309. cmpi.b %d1,&INF # is operand an INF?
  1310. bne.b _L5_4d # no
  1311. bsr.l src_one # yes
  1312. bra.b _L5_6d
  1313. _L5_4d:
  1314. cmpi.b %d1,&QNAN # is operand a QNAN?
  1315. bne.b _L5_5d # no
  1316. bsr.l src_qnan # yes
  1317. bra.b _L5_6d
  1318. _L5_5d:
  1319. bsr.l stanhd # operand is a DENORM
  1320. _L5_6d:
  1321. #
  1322. # Result is now in FP0
  1323. #
  1324. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  1325. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  1326. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  1327. unlk %a6
  1328. rts
  1329. global _ftanhx_
  1330. _ftanhx_:
  1331. link %a6,&-LOCAL_SIZE
  1332. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  1333. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  1334. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  1335. fmov.l &0x0,%fpcr # zero FPCR
  1336. #
  1337. # copy, convert, and tag input argument
  1338. #
  1339. lea FP_SRC(%a6),%a0
  1340. mov.l 0x8+0x0(%a6),0x0(%a0) # load ext input
  1341. mov.l 0x8+0x4(%a6),0x4(%a0)
  1342. mov.l 0x8+0x8(%a6),0x8(%a0)
  1343. bsr.l tag # fetch operand type
  1344. mov.b %d0,STAG(%a6)
  1345. mov.b %d0,%d1
  1346. andi.l &0x00ff00ff,USER_FPSR(%a6)
  1347. clr.l %d0
  1348. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  1349. tst.b %d1
  1350. bne.b _L5_2x
  1351. bsr.l stanh # operand is a NORM
  1352. bra.b _L5_6x
  1353. _L5_2x:
  1354. cmpi.b %d1,&ZERO # is operand a ZERO?
  1355. bne.b _L5_3x # no
  1356. bsr.l src_zero # yes
  1357. bra.b _L5_6x
  1358. _L5_3x:
  1359. cmpi.b %d1,&INF # is operand an INF?
  1360. bne.b _L5_4x # no
  1361. bsr.l src_one # yes
  1362. bra.b _L5_6x
  1363. _L5_4x:
  1364. cmpi.b %d1,&QNAN # is operand a QNAN?
  1365. bne.b _L5_5x # no
  1366. bsr.l src_qnan # yes
  1367. bra.b _L5_6x
  1368. _L5_5x:
  1369. bsr.l stanhd # operand is a DENORM
  1370. _L5_6x:
  1371. #
  1372. # Result is now in FP0
  1373. #
  1374. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  1375. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  1376. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  1377. unlk %a6
  1378. rts
  1379. #########################################################################
  1380. # MONADIC TEMPLATE #
  1381. #########################################################################
  1382. global _fatans_
  1383. _fatans_:
  1384. link %a6,&-LOCAL_SIZE
  1385. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  1386. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  1387. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  1388. fmov.l &0x0,%fpcr # zero FPCR
  1389. #
  1390. # copy, convert, and tag input argument
  1391. #
  1392. fmov.s 0x8(%a6),%fp0 # load sgl input
  1393. fmov.x %fp0,FP_SRC(%a6)
  1394. lea FP_SRC(%a6),%a0
  1395. bsr.l tag # fetch operand type
  1396. mov.b %d0,STAG(%a6)
  1397. mov.b %d0,%d1
  1398. andi.l &0x00ff00ff,USER_FPSR(%a6)
  1399. clr.l %d0
  1400. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  1401. tst.b %d1
  1402. bne.b _L6_2s
  1403. bsr.l satan # operand is a NORM
  1404. bra.b _L6_6s
  1405. _L6_2s:
  1406. cmpi.b %d1,&ZERO # is operand a ZERO?
  1407. bne.b _L6_3s # no
  1408. bsr.l src_zero # yes
  1409. bra.b _L6_6s
  1410. _L6_3s:
  1411. cmpi.b %d1,&INF # is operand an INF?
  1412. bne.b _L6_4s # no
  1413. bsr.l spi_2 # yes
  1414. bra.b _L6_6s
  1415. _L6_4s:
  1416. cmpi.b %d1,&QNAN # is operand a QNAN?
  1417. bne.b _L6_5s # no
  1418. bsr.l src_qnan # yes
  1419. bra.b _L6_6s
  1420. _L6_5s:
  1421. bsr.l satand # operand is a DENORM
  1422. _L6_6s:
  1423. #
  1424. # Result is now in FP0
  1425. #
  1426. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  1427. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  1428. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  1429. unlk %a6
  1430. rts
  1431. global _fatand_
  1432. _fatand_:
  1433. link %a6,&-LOCAL_SIZE
  1434. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  1435. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  1436. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  1437. fmov.l &0x0,%fpcr # zero FPCR
  1438. #
  1439. # copy, convert, and tag input argument
  1440. #
  1441. fmov.d 0x8(%a6),%fp0 # load dbl input
  1442. fmov.x %fp0,FP_SRC(%a6)
  1443. lea FP_SRC(%a6),%a0
  1444. bsr.l tag # fetch operand type
  1445. mov.b %d0,STAG(%a6)
  1446. mov.b %d0,%d1
  1447. andi.l &0x00ff00ff,USER_FPSR(%a6)
  1448. clr.l %d0
  1449. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  1450. mov.b %d1,STAG(%a6)
  1451. tst.b %d1
  1452. bne.b _L6_2d
  1453. bsr.l satan # operand is a NORM
  1454. bra.b _L6_6d
  1455. _L6_2d:
  1456. cmpi.b %d1,&ZERO # is operand a ZERO?
  1457. bne.b _L6_3d # no
  1458. bsr.l src_zero # yes
  1459. bra.b _L6_6d
  1460. _L6_3d:
  1461. cmpi.b %d1,&INF # is operand an INF?
  1462. bne.b _L6_4d # no
  1463. bsr.l spi_2 # yes
  1464. bra.b _L6_6d
  1465. _L6_4d:
  1466. cmpi.b %d1,&QNAN # is operand a QNAN?
  1467. bne.b _L6_5d # no
  1468. bsr.l src_qnan # yes
  1469. bra.b _L6_6d
  1470. _L6_5d:
  1471. bsr.l satand # operand is a DENORM
  1472. _L6_6d:
  1473. #
  1474. # Result is now in FP0
  1475. #
  1476. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  1477. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  1478. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  1479. unlk %a6
  1480. rts
  1481. global _fatanx_
  1482. _fatanx_:
  1483. link %a6,&-LOCAL_SIZE
  1484. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  1485. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  1486. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  1487. fmov.l &0x0,%fpcr # zero FPCR
  1488. #
  1489. # copy, convert, and tag input argument
  1490. #
  1491. lea FP_SRC(%a6),%a0
  1492. mov.l 0x8+0x0(%a6),0x0(%a0) # load ext input
  1493. mov.l 0x8+0x4(%a6),0x4(%a0)
  1494. mov.l 0x8+0x8(%a6),0x8(%a0)
  1495. bsr.l tag # fetch operand type
  1496. mov.b %d0,STAG(%a6)
  1497. mov.b %d0,%d1
  1498. andi.l &0x00ff00ff,USER_FPSR(%a6)
  1499. clr.l %d0
  1500. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  1501. tst.b %d1
  1502. bne.b _L6_2x
  1503. bsr.l satan # operand is a NORM
  1504. bra.b _L6_6x
  1505. _L6_2x:
  1506. cmpi.b %d1,&ZERO # is operand a ZERO?
  1507. bne.b _L6_3x # no
  1508. bsr.l src_zero # yes
  1509. bra.b _L6_6x
  1510. _L6_3x:
  1511. cmpi.b %d1,&INF # is operand an INF?
  1512. bne.b _L6_4x # no
  1513. bsr.l spi_2 # yes
  1514. bra.b _L6_6x
  1515. _L6_4x:
  1516. cmpi.b %d1,&QNAN # is operand a QNAN?
  1517. bne.b _L6_5x # no
  1518. bsr.l src_qnan # yes
  1519. bra.b _L6_6x
  1520. _L6_5x:
  1521. bsr.l satand # operand is a DENORM
  1522. _L6_6x:
  1523. #
  1524. # Result is now in FP0
  1525. #
  1526. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  1527. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  1528. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  1529. unlk %a6
  1530. rts
  1531. #########################################################################
  1532. # MONADIC TEMPLATE #
  1533. #########################################################################
  1534. global _fasins_
  1535. _fasins_:
  1536. link %a6,&-LOCAL_SIZE
  1537. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  1538. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  1539. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  1540. fmov.l &0x0,%fpcr # zero FPCR
  1541. #
  1542. # copy, convert, and tag input argument
  1543. #
  1544. fmov.s 0x8(%a6),%fp0 # load sgl input
  1545. fmov.x %fp0,FP_SRC(%a6)
  1546. lea FP_SRC(%a6),%a0
  1547. bsr.l tag # fetch operand type
  1548. mov.b %d0,STAG(%a6)
  1549. mov.b %d0,%d1
  1550. andi.l &0x00ff00ff,USER_FPSR(%a6)
  1551. clr.l %d0
  1552. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  1553. tst.b %d1
  1554. bne.b _L7_2s
  1555. bsr.l sasin # operand is a NORM
  1556. bra.b _L7_6s
  1557. _L7_2s:
  1558. cmpi.b %d1,&ZERO # is operand a ZERO?
  1559. bne.b _L7_3s # no
  1560. bsr.l src_zero # yes
  1561. bra.b _L7_6s
  1562. _L7_3s:
  1563. cmpi.b %d1,&INF # is operand an INF?
  1564. bne.b _L7_4s # no
  1565. bsr.l t_operr # yes
  1566. bra.b _L7_6s
  1567. _L7_4s:
  1568. cmpi.b %d1,&QNAN # is operand a QNAN?
  1569. bne.b _L7_5s # no
  1570. bsr.l src_qnan # yes
  1571. bra.b _L7_6s
  1572. _L7_5s:
  1573. bsr.l sasind # operand is a DENORM
  1574. _L7_6s:
  1575. #
  1576. # Result is now in FP0
  1577. #
  1578. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  1579. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  1580. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  1581. unlk %a6
  1582. rts
  1583. global _fasind_
  1584. _fasind_:
  1585. link %a6,&-LOCAL_SIZE
  1586. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  1587. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  1588. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  1589. fmov.l &0x0,%fpcr # zero FPCR
  1590. #
  1591. # copy, convert, and tag input argument
  1592. #
  1593. fmov.d 0x8(%a6),%fp0 # load dbl input
  1594. fmov.x %fp0,FP_SRC(%a6)
  1595. lea FP_SRC(%a6),%a0
  1596. bsr.l tag # fetch operand type
  1597. mov.b %d0,STAG(%a6)
  1598. mov.b %d0,%d1
  1599. andi.l &0x00ff00ff,USER_FPSR(%a6)
  1600. clr.l %d0
  1601. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  1602. mov.b %d1,STAG(%a6)
  1603. tst.b %d1
  1604. bne.b _L7_2d
  1605. bsr.l sasin # operand is a NORM
  1606. bra.b _L7_6d
  1607. _L7_2d:
  1608. cmpi.b %d1,&ZERO # is operand a ZERO?
  1609. bne.b _L7_3d # no
  1610. bsr.l src_zero # yes
  1611. bra.b _L7_6d
  1612. _L7_3d:
  1613. cmpi.b %d1,&INF # is operand an INF?
  1614. bne.b _L7_4d # no
  1615. bsr.l t_operr # yes
  1616. bra.b _L7_6d
  1617. _L7_4d:
  1618. cmpi.b %d1,&QNAN # is operand a QNAN?
  1619. bne.b _L7_5d # no
  1620. bsr.l src_qnan # yes
  1621. bra.b _L7_6d
  1622. _L7_5d:
  1623. bsr.l sasind # operand is a DENORM
  1624. _L7_6d:
  1625. #
  1626. # Result is now in FP0
  1627. #
  1628. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  1629. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  1630. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  1631. unlk %a6
  1632. rts
  1633. global _fasinx_
  1634. _fasinx_:
  1635. link %a6,&-LOCAL_SIZE
  1636. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  1637. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  1638. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  1639. fmov.l &0x0,%fpcr # zero FPCR
  1640. #
  1641. # copy, convert, and tag input argument
  1642. #
  1643. lea FP_SRC(%a6),%a0
  1644. mov.l 0x8+0x0(%a6),0x0(%a0) # load ext input
  1645. mov.l 0x8+0x4(%a6),0x4(%a0)
  1646. mov.l 0x8+0x8(%a6),0x8(%a0)
  1647. bsr.l tag # fetch operand type
  1648. mov.b %d0,STAG(%a6)
  1649. mov.b %d0,%d1
  1650. andi.l &0x00ff00ff,USER_FPSR(%a6)
  1651. clr.l %d0
  1652. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  1653. tst.b %d1
  1654. bne.b _L7_2x
  1655. bsr.l sasin # operand is a NORM
  1656. bra.b _L7_6x
  1657. _L7_2x:
  1658. cmpi.b %d1,&ZERO # is operand a ZERO?
  1659. bne.b _L7_3x # no
  1660. bsr.l src_zero # yes
  1661. bra.b _L7_6x
  1662. _L7_3x:
  1663. cmpi.b %d1,&INF # is operand an INF?
  1664. bne.b _L7_4x # no
  1665. bsr.l t_operr # yes
  1666. bra.b _L7_6x
  1667. _L7_4x:
  1668. cmpi.b %d1,&QNAN # is operand a QNAN?
  1669. bne.b _L7_5x # no
  1670. bsr.l src_qnan # yes
  1671. bra.b _L7_6x
  1672. _L7_5x:
  1673. bsr.l sasind # operand is a DENORM
  1674. _L7_6x:
  1675. #
  1676. # Result is now in FP0
  1677. #
  1678. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  1679. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  1680. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  1681. unlk %a6
  1682. rts
  1683. #########################################################################
  1684. # MONADIC TEMPLATE #
  1685. #########################################################################
  1686. global _fatanhs_
  1687. _fatanhs_:
  1688. link %a6,&-LOCAL_SIZE
  1689. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  1690. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  1691. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  1692. fmov.l &0x0,%fpcr # zero FPCR
  1693. #
  1694. # copy, convert, and tag input argument
  1695. #
  1696. fmov.s 0x8(%a6),%fp0 # load sgl input
  1697. fmov.x %fp0,FP_SRC(%a6)
  1698. lea FP_SRC(%a6),%a0
  1699. bsr.l tag # fetch operand type
  1700. mov.b %d0,STAG(%a6)
  1701. mov.b %d0,%d1
  1702. andi.l &0x00ff00ff,USER_FPSR(%a6)
  1703. clr.l %d0
  1704. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  1705. tst.b %d1
  1706. bne.b _L8_2s
  1707. bsr.l satanh # operand is a NORM
  1708. bra.b _L8_6s
  1709. _L8_2s:
  1710. cmpi.b %d1,&ZERO # is operand a ZERO?
  1711. bne.b _L8_3s # no
  1712. bsr.l src_zero # yes
  1713. bra.b _L8_6s
  1714. _L8_3s:
  1715. cmpi.b %d1,&INF # is operand an INF?
  1716. bne.b _L8_4s # no
  1717. bsr.l t_operr # yes
  1718. bra.b _L8_6s
  1719. _L8_4s:
  1720. cmpi.b %d1,&QNAN # is operand a QNAN?
  1721. bne.b _L8_5s # no
  1722. bsr.l src_qnan # yes
  1723. bra.b _L8_6s
  1724. _L8_5s:
  1725. bsr.l satanhd # operand is a DENORM
  1726. _L8_6s:
  1727. #
  1728. # Result is now in FP0
  1729. #
  1730. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  1731. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  1732. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  1733. unlk %a6
  1734. rts
  1735. global _fatanhd_
  1736. _fatanhd_:
  1737. link %a6,&-LOCAL_SIZE
  1738. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  1739. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  1740. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  1741. fmov.l &0x0,%fpcr # zero FPCR
  1742. #
  1743. # copy, convert, and tag input argument
  1744. #
  1745. fmov.d 0x8(%a6),%fp0 # load dbl input
  1746. fmov.x %fp0,FP_SRC(%a6)
  1747. lea FP_SRC(%a6),%a0
  1748. bsr.l tag # fetch operand type
  1749. mov.b %d0,STAG(%a6)
  1750. mov.b %d0,%d1
  1751. andi.l &0x00ff00ff,USER_FPSR(%a6)
  1752. clr.l %d0
  1753. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  1754. mov.b %d1,STAG(%a6)
  1755. tst.b %d1
  1756. bne.b _L8_2d
  1757. bsr.l satanh # operand is a NORM
  1758. bra.b _L8_6d
  1759. _L8_2d:
  1760. cmpi.b %d1,&ZERO # is operand a ZERO?
  1761. bne.b _L8_3d # no
  1762. bsr.l src_zero # yes
  1763. bra.b _L8_6d
  1764. _L8_3d:
  1765. cmpi.b %d1,&INF # is operand an INF?
  1766. bne.b _L8_4d # no
  1767. bsr.l t_operr # yes
  1768. bra.b _L8_6d
  1769. _L8_4d:
  1770. cmpi.b %d1,&QNAN # is operand a QNAN?
  1771. bne.b _L8_5d # no
  1772. bsr.l src_qnan # yes
  1773. bra.b _L8_6d
  1774. _L8_5d:
  1775. bsr.l satanhd # operand is a DENORM
  1776. _L8_6d:
  1777. #
  1778. # Result is now in FP0
  1779. #
  1780. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  1781. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  1782. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  1783. unlk %a6
  1784. rts
  1785. global _fatanhx_
  1786. _fatanhx_:
  1787. link %a6,&-LOCAL_SIZE
  1788. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  1789. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  1790. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  1791. fmov.l &0x0,%fpcr # zero FPCR
  1792. #
  1793. # copy, convert, and tag input argument
  1794. #
  1795. lea FP_SRC(%a6),%a0
  1796. mov.l 0x8+0x0(%a6),0x0(%a0) # load ext input
  1797. mov.l 0x8+0x4(%a6),0x4(%a0)
  1798. mov.l 0x8+0x8(%a6),0x8(%a0)
  1799. bsr.l tag # fetch operand type
  1800. mov.b %d0,STAG(%a6)
  1801. mov.b %d0,%d1
  1802. andi.l &0x00ff00ff,USER_FPSR(%a6)
  1803. clr.l %d0
  1804. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  1805. tst.b %d1
  1806. bne.b _L8_2x
  1807. bsr.l satanh # operand is a NORM
  1808. bra.b _L8_6x
  1809. _L8_2x:
  1810. cmpi.b %d1,&ZERO # is operand a ZERO?
  1811. bne.b _L8_3x # no
  1812. bsr.l src_zero # yes
  1813. bra.b _L8_6x
  1814. _L8_3x:
  1815. cmpi.b %d1,&INF # is operand an INF?
  1816. bne.b _L8_4x # no
  1817. bsr.l t_operr # yes
  1818. bra.b _L8_6x
  1819. _L8_4x:
  1820. cmpi.b %d1,&QNAN # is operand a QNAN?
  1821. bne.b _L8_5x # no
  1822. bsr.l src_qnan # yes
  1823. bra.b _L8_6x
  1824. _L8_5x:
  1825. bsr.l satanhd # operand is a DENORM
  1826. _L8_6x:
  1827. #
  1828. # Result is now in FP0
  1829. #
  1830. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  1831. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  1832. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  1833. unlk %a6
  1834. rts
  1835. #########################################################################
  1836. # MONADIC TEMPLATE #
  1837. #########################################################################
  1838. global _ftans_
  1839. _ftans_:
  1840. link %a6,&-LOCAL_SIZE
  1841. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  1842. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  1843. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  1844. fmov.l &0x0,%fpcr # zero FPCR
  1845. #
  1846. # copy, convert, and tag input argument
  1847. #
  1848. fmov.s 0x8(%a6),%fp0 # load sgl input
  1849. fmov.x %fp0,FP_SRC(%a6)
  1850. lea FP_SRC(%a6),%a0
  1851. bsr.l tag # fetch operand type
  1852. mov.b %d0,STAG(%a6)
  1853. mov.b %d0,%d1
  1854. andi.l &0x00ff00ff,USER_FPSR(%a6)
  1855. clr.l %d0
  1856. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  1857. tst.b %d1
  1858. bne.b _L9_2s
  1859. bsr.l stan # operand is a NORM
  1860. bra.b _L9_6s
  1861. _L9_2s:
  1862. cmpi.b %d1,&ZERO # is operand a ZERO?
  1863. bne.b _L9_3s # no
  1864. bsr.l src_zero # yes
  1865. bra.b _L9_6s
  1866. _L9_3s:
  1867. cmpi.b %d1,&INF # is operand an INF?
  1868. bne.b _L9_4s # no
  1869. bsr.l t_operr # yes
  1870. bra.b _L9_6s
  1871. _L9_4s:
  1872. cmpi.b %d1,&QNAN # is operand a QNAN?
  1873. bne.b _L9_5s # no
  1874. bsr.l src_qnan # yes
  1875. bra.b _L9_6s
  1876. _L9_5s:
  1877. bsr.l stand # operand is a DENORM
  1878. _L9_6s:
  1879. #
  1880. # Result is now in FP0
  1881. #
  1882. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  1883. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  1884. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  1885. unlk %a6
  1886. rts
  1887. global _ftand_
  1888. _ftand_:
  1889. link %a6,&-LOCAL_SIZE
  1890. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  1891. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  1892. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  1893. fmov.l &0x0,%fpcr # zero FPCR
  1894. #
  1895. # copy, convert, and tag input argument
  1896. #
  1897. fmov.d 0x8(%a6),%fp0 # load dbl input
  1898. fmov.x %fp0,FP_SRC(%a6)
  1899. lea FP_SRC(%a6),%a0
  1900. bsr.l tag # fetch operand type
  1901. mov.b %d0,STAG(%a6)
  1902. mov.b %d0,%d1
  1903. andi.l &0x00ff00ff,USER_FPSR(%a6)
  1904. clr.l %d0
  1905. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  1906. mov.b %d1,STAG(%a6)
  1907. tst.b %d1
  1908. bne.b _L9_2d
  1909. bsr.l stan # operand is a NORM
  1910. bra.b _L9_6d
  1911. _L9_2d:
  1912. cmpi.b %d1,&ZERO # is operand a ZERO?
  1913. bne.b _L9_3d # no
  1914. bsr.l src_zero # yes
  1915. bra.b _L9_6d
  1916. _L9_3d:
  1917. cmpi.b %d1,&INF # is operand an INF?
  1918. bne.b _L9_4d # no
  1919. bsr.l t_operr # yes
  1920. bra.b _L9_6d
  1921. _L9_4d:
  1922. cmpi.b %d1,&QNAN # is operand a QNAN?
  1923. bne.b _L9_5d # no
  1924. bsr.l src_qnan # yes
  1925. bra.b _L9_6d
  1926. _L9_5d:
  1927. bsr.l stand # operand is a DENORM
  1928. _L9_6d:
  1929. #
  1930. # Result is now in FP0
  1931. #
  1932. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  1933. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  1934. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  1935. unlk %a6
  1936. rts
  1937. global _ftanx_
  1938. _ftanx_:
  1939. link %a6,&-LOCAL_SIZE
  1940. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  1941. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  1942. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  1943. fmov.l &0x0,%fpcr # zero FPCR
  1944. #
  1945. # copy, convert, and tag input argument
  1946. #
  1947. lea FP_SRC(%a6),%a0
  1948. mov.l 0x8+0x0(%a6),0x0(%a0) # load ext input
  1949. mov.l 0x8+0x4(%a6),0x4(%a0)
  1950. mov.l 0x8+0x8(%a6),0x8(%a0)
  1951. bsr.l tag # fetch operand type
  1952. mov.b %d0,STAG(%a6)
  1953. mov.b %d0,%d1
  1954. andi.l &0x00ff00ff,USER_FPSR(%a6)
  1955. clr.l %d0
  1956. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  1957. tst.b %d1
  1958. bne.b _L9_2x
  1959. bsr.l stan # operand is a NORM
  1960. bra.b _L9_6x
  1961. _L9_2x:
  1962. cmpi.b %d1,&ZERO # is operand a ZERO?
  1963. bne.b _L9_3x # no
  1964. bsr.l src_zero # yes
  1965. bra.b _L9_6x
  1966. _L9_3x:
  1967. cmpi.b %d1,&INF # is operand an INF?
  1968. bne.b _L9_4x # no
  1969. bsr.l t_operr # yes
  1970. bra.b _L9_6x
  1971. _L9_4x:
  1972. cmpi.b %d1,&QNAN # is operand a QNAN?
  1973. bne.b _L9_5x # no
  1974. bsr.l src_qnan # yes
  1975. bra.b _L9_6x
  1976. _L9_5x:
  1977. bsr.l stand # operand is a DENORM
  1978. _L9_6x:
  1979. #
  1980. # Result is now in FP0
  1981. #
  1982. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  1983. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  1984. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  1985. unlk %a6
  1986. rts
  1987. #########################################################################
  1988. # MONADIC TEMPLATE #
  1989. #########################################################################
  1990. global _fetoxs_
  1991. _fetoxs_:
  1992. link %a6,&-LOCAL_SIZE
  1993. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  1994. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  1995. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  1996. fmov.l &0x0,%fpcr # zero FPCR
  1997. #
  1998. # copy, convert, and tag input argument
  1999. #
  2000. fmov.s 0x8(%a6),%fp0 # load sgl input
  2001. fmov.x %fp0,FP_SRC(%a6)
  2002. lea FP_SRC(%a6),%a0
  2003. bsr.l tag # fetch operand type
  2004. mov.b %d0,STAG(%a6)
  2005. mov.b %d0,%d1
  2006. andi.l &0x00ff00ff,USER_FPSR(%a6)
  2007. clr.l %d0
  2008. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  2009. tst.b %d1
  2010. bne.b _L10_2s
  2011. bsr.l setox # operand is a NORM
  2012. bra.b _L10_6s
  2013. _L10_2s:
  2014. cmpi.b %d1,&ZERO # is operand a ZERO?
  2015. bne.b _L10_3s # no
  2016. bsr.l ld_pone # yes
  2017. bra.b _L10_6s
  2018. _L10_3s:
  2019. cmpi.b %d1,&INF # is operand an INF?
  2020. bne.b _L10_4s # no
  2021. bsr.l szr_inf # yes
  2022. bra.b _L10_6s
  2023. _L10_4s:
  2024. cmpi.b %d1,&QNAN # is operand a QNAN?
  2025. bne.b _L10_5s # no
  2026. bsr.l src_qnan # yes
  2027. bra.b _L10_6s
  2028. _L10_5s:
  2029. bsr.l setoxd # operand is a DENORM
  2030. _L10_6s:
  2031. #
  2032. # Result is now in FP0
  2033. #
  2034. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  2035. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  2036. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  2037. unlk %a6
  2038. rts
  2039. global _fetoxd_
  2040. _fetoxd_:
  2041. link %a6,&-LOCAL_SIZE
  2042. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  2043. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  2044. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  2045. fmov.l &0x0,%fpcr # zero FPCR
  2046. #
  2047. # copy, convert, and tag input argument
  2048. #
  2049. fmov.d 0x8(%a6),%fp0 # load dbl input
  2050. fmov.x %fp0,FP_SRC(%a6)
  2051. lea FP_SRC(%a6),%a0
  2052. bsr.l tag # fetch operand type
  2053. mov.b %d0,STAG(%a6)
  2054. mov.b %d0,%d1
  2055. andi.l &0x00ff00ff,USER_FPSR(%a6)
  2056. clr.l %d0
  2057. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  2058. mov.b %d1,STAG(%a6)
  2059. tst.b %d1
  2060. bne.b _L10_2d
  2061. bsr.l setox # operand is a NORM
  2062. bra.b _L10_6d
  2063. _L10_2d:
  2064. cmpi.b %d1,&ZERO # is operand a ZERO?
  2065. bne.b _L10_3d # no
  2066. bsr.l ld_pone # yes
  2067. bra.b _L10_6d
  2068. _L10_3d:
  2069. cmpi.b %d1,&INF # is operand an INF?
  2070. bne.b _L10_4d # no
  2071. bsr.l szr_inf # yes
  2072. bra.b _L10_6d
  2073. _L10_4d:
  2074. cmpi.b %d1,&QNAN # is operand a QNAN?
  2075. bne.b _L10_5d # no
  2076. bsr.l src_qnan # yes
  2077. bra.b _L10_6d
  2078. _L10_5d:
  2079. bsr.l setoxd # operand is a DENORM
  2080. _L10_6d:
  2081. #
  2082. # Result is now in FP0
  2083. #
  2084. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  2085. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  2086. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  2087. unlk %a6
  2088. rts
  2089. global _fetoxx_
  2090. _fetoxx_:
  2091. link %a6,&-LOCAL_SIZE
  2092. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  2093. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  2094. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  2095. fmov.l &0x0,%fpcr # zero FPCR
  2096. #
  2097. # copy, convert, and tag input argument
  2098. #
  2099. lea FP_SRC(%a6),%a0
  2100. mov.l 0x8+0x0(%a6),0x0(%a0) # load ext input
  2101. mov.l 0x8+0x4(%a6),0x4(%a0)
  2102. mov.l 0x8+0x8(%a6),0x8(%a0)
  2103. bsr.l tag # fetch operand type
  2104. mov.b %d0,STAG(%a6)
  2105. mov.b %d0,%d1
  2106. andi.l &0x00ff00ff,USER_FPSR(%a6)
  2107. clr.l %d0
  2108. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  2109. tst.b %d1
  2110. bne.b _L10_2x
  2111. bsr.l setox # operand is a NORM
  2112. bra.b _L10_6x
  2113. _L10_2x:
  2114. cmpi.b %d1,&ZERO # is operand a ZERO?
  2115. bne.b _L10_3x # no
  2116. bsr.l ld_pone # yes
  2117. bra.b _L10_6x
  2118. _L10_3x:
  2119. cmpi.b %d1,&INF # is operand an INF?
  2120. bne.b _L10_4x # no
  2121. bsr.l szr_inf # yes
  2122. bra.b _L10_6x
  2123. _L10_4x:
  2124. cmpi.b %d1,&QNAN # is operand a QNAN?
  2125. bne.b _L10_5x # no
  2126. bsr.l src_qnan # yes
  2127. bra.b _L10_6x
  2128. _L10_5x:
  2129. bsr.l setoxd # operand is a DENORM
  2130. _L10_6x:
  2131. #
  2132. # Result is now in FP0
  2133. #
  2134. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  2135. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  2136. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  2137. unlk %a6
  2138. rts
  2139. #########################################################################
  2140. # MONADIC TEMPLATE #
  2141. #########################################################################
  2142. global _ftwotoxs_
  2143. _ftwotoxs_:
  2144. link %a6,&-LOCAL_SIZE
  2145. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  2146. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  2147. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  2148. fmov.l &0x0,%fpcr # zero FPCR
  2149. #
  2150. # copy, convert, and tag input argument
  2151. #
  2152. fmov.s 0x8(%a6),%fp0 # load sgl input
  2153. fmov.x %fp0,FP_SRC(%a6)
  2154. lea FP_SRC(%a6),%a0
  2155. bsr.l tag # fetch operand type
  2156. mov.b %d0,STAG(%a6)
  2157. mov.b %d0,%d1
  2158. andi.l &0x00ff00ff,USER_FPSR(%a6)
  2159. clr.l %d0
  2160. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  2161. tst.b %d1
  2162. bne.b _L11_2s
  2163. bsr.l stwotox # operand is a NORM
  2164. bra.b _L11_6s
  2165. _L11_2s:
  2166. cmpi.b %d1,&ZERO # is operand a ZERO?
  2167. bne.b _L11_3s # no
  2168. bsr.l ld_pone # yes
  2169. bra.b _L11_6s
  2170. _L11_3s:
  2171. cmpi.b %d1,&INF # is operand an INF?
  2172. bne.b _L11_4s # no
  2173. bsr.l szr_inf # yes
  2174. bra.b _L11_6s
  2175. _L11_4s:
  2176. cmpi.b %d1,&QNAN # is operand a QNAN?
  2177. bne.b _L11_5s # no
  2178. bsr.l src_qnan # yes
  2179. bra.b _L11_6s
  2180. _L11_5s:
  2181. bsr.l stwotoxd # operand is a DENORM
  2182. _L11_6s:
  2183. #
  2184. # Result is now in FP0
  2185. #
  2186. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  2187. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  2188. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  2189. unlk %a6
  2190. rts
  2191. global _ftwotoxd_
  2192. _ftwotoxd_:
  2193. link %a6,&-LOCAL_SIZE
  2194. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  2195. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  2196. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  2197. fmov.l &0x0,%fpcr # zero FPCR
  2198. #
  2199. # copy, convert, and tag input argument
  2200. #
  2201. fmov.d 0x8(%a6),%fp0 # load dbl input
  2202. fmov.x %fp0,FP_SRC(%a6)
  2203. lea FP_SRC(%a6),%a0
  2204. bsr.l tag # fetch operand type
  2205. mov.b %d0,STAG(%a6)
  2206. mov.b %d0,%d1
  2207. andi.l &0x00ff00ff,USER_FPSR(%a6)
  2208. clr.l %d0
  2209. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  2210. mov.b %d1,STAG(%a6)
  2211. tst.b %d1
  2212. bne.b _L11_2d
  2213. bsr.l stwotox # operand is a NORM
  2214. bra.b _L11_6d
  2215. _L11_2d:
  2216. cmpi.b %d1,&ZERO # is operand a ZERO?
  2217. bne.b _L11_3d # no
  2218. bsr.l ld_pone # yes
  2219. bra.b _L11_6d
  2220. _L11_3d:
  2221. cmpi.b %d1,&INF # is operand an INF?
  2222. bne.b _L11_4d # no
  2223. bsr.l szr_inf # yes
  2224. bra.b _L11_6d
  2225. _L11_4d:
  2226. cmpi.b %d1,&QNAN # is operand a QNAN?
  2227. bne.b _L11_5d # no
  2228. bsr.l src_qnan # yes
  2229. bra.b _L11_6d
  2230. _L11_5d:
  2231. bsr.l stwotoxd # operand is a DENORM
  2232. _L11_6d:
  2233. #
  2234. # Result is now in FP0
  2235. #
  2236. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  2237. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  2238. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  2239. unlk %a6
  2240. rts
  2241. global _ftwotoxx_
  2242. _ftwotoxx_:
  2243. link %a6,&-LOCAL_SIZE
  2244. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  2245. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  2246. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  2247. fmov.l &0x0,%fpcr # zero FPCR
  2248. #
  2249. # copy, convert, and tag input argument
  2250. #
  2251. lea FP_SRC(%a6),%a0
  2252. mov.l 0x8+0x0(%a6),0x0(%a0) # load ext input
  2253. mov.l 0x8+0x4(%a6),0x4(%a0)
  2254. mov.l 0x8+0x8(%a6),0x8(%a0)
  2255. bsr.l tag # fetch operand type
  2256. mov.b %d0,STAG(%a6)
  2257. mov.b %d0,%d1
  2258. andi.l &0x00ff00ff,USER_FPSR(%a6)
  2259. clr.l %d0
  2260. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  2261. tst.b %d1
  2262. bne.b _L11_2x
  2263. bsr.l stwotox # operand is a NORM
  2264. bra.b _L11_6x
  2265. _L11_2x:
  2266. cmpi.b %d1,&ZERO # is operand a ZERO?
  2267. bne.b _L11_3x # no
  2268. bsr.l ld_pone # yes
  2269. bra.b _L11_6x
  2270. _L11_3x:
  2271. cmpi.b %d1,&INF # is operand an INF?
  2272. bne.b _L11_4x # no
  2273. bsr.l szr_inf # yes
  2274. bra.b _L11_6x
  2275. _L11_4x:
  2276. cmpi.b %d1,&QNAN # is operand a QNAN?
  2277. bne.b _L11_5x # no
  2278. bsr.l src_qnan # yes
  2279. bra.b _L11_6x
  2280. _L11_5x:
  2281. bsr.l stwotoxd # operand is a DENORM
  2282. _L11_6x:
  2283. #
  2284. # Result is now in FP0
  2285. #
  2286. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  2287. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  2288. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  2289. unlk %a6
  2290. rts
  2291. #########################################################################
  2292. # MONADIC TEMPLATE #
  2293. #########################################################################
  2294. global _ftentoxs_
  2295. _ftentoxs_:
  2296. link %a6,&-LOCAL_SIZE
  2297. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  2298. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  2299. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  2300. fmov.l &0x0,%fpcr # zero FPCR
  2301. #
  2302. # copy, convert, and tag input argument
  2303. #
  2304. fmov.s 0x8(%a6),%fp0 # load sgl input
  2305. fmov.x %fp0,FP_SRC(%a6)
  2306. lea FP_SRC(%a6),%a0
  2307. bsr.l tag # fetch operand type
  2308. mov.b %d0,STAG(%a6)
  2309. mov.b %d0,%d1
  2310. andi.l &0x00ff00ff,USER_FPSR(%a6)
  2311. clr.l %d0
  2312. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  2313. tst.b %d1
  2314. bne.b _L12_2s
  2315. bsr.l stentox # operand is a NORM
  2316. bra.b _L12_6s
  2317. _L12_2s:
  2318. cmpi.b %d1,&ZERO # is operand a ZERO?
  2319. bne.b _L12_3s # no
  2320. bsr.l ld_pone # yes
  2321. bra.b _L12_6s
  2322. _L12_3s:
  2323. cmpi.b %d1,&INF # is operand an INF?
  2324. bne.b _L12_4s # no
  2325. bsr.l szr_inf # yes
  2326. bra.b _L12_6s
  2327. _L12_4s:
  2328. cmpi.b %d1,&QNAN # is operand a QNAN?
  2329. bne.b _L12_5s # no
  2330. bsr.l src_qnan # yes
  2331. bra.b _L12_6s
  2332. _L12_5s:
  2333. bsr.l stentoxd # operand is a DENORM
  2334. _L12_6s:
  2335. #
  2336. # Result is now in FP0
  2337. #
  2338. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  2339. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  2340. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  2341. unlk %a6
  2342. rts
  2343. global _ftentoxd_
  2344. _ftentoxd_:
  2345. link %a6,&-LOCAL_SIZE
  2346. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  2347. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  2348. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  2349. fmov.l &0x0,%fpcr # zero FPCR
  2350. #
  2351. # copy, convert, and tag input argument
  2352. #
  2353. fmov.d 0x8(%a6),%fp0 # load dbl input
  2354. fmov.x %fp0,FP_SRC(%a6)
  2355. lea FP_SRC(%a6),%a0
  2356. bsr.l tag # fetch operand type
  2357. mov.b %d0,STAG(%a6)
  2358. mov.b %d0,%d1
  2359. andi.l &0x00ff00ff,USER_FPSR(%a6)
  2360. clr.l %d0
  2361. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  2362. mov.b %d1,STAG(%a6)
  2363. tst.b %d1
  2364. bne.b _L12_2d
  2365. bsr.l stentox # operand is a NORM
  2366. bra.b _L12_6d
  2367. _L12_2d:
  2368. cmpi.b %d1,&ZERO # is operand a ZERO?
  2369. bne.b _L12_3d # no
  2370. bsr.l ld_pone # yes
  2371. bra.b _L12_6d
  2372. _L12_3d:
  2373. cmpi.b %d1,&INF # is operand an INF?
  2374. bne.b _L12_4d # no
  2375. bsr.l szr_inf # yes
  2376. bra.b _L12_6d
  2377. _L12_4d:
  2378. cmpi.b %d1,&QNAN # is operand a QNAN?
  2379. bne.b _L12_5d # no
  2380. bsr.l src_qnan # yes
  2381. bra.b _L12_6d
  2382. _L12_5d:
  2383. bsr.l stentoxd # operand is a DENORM
  2384. _L12_6d:
  2385. #
  2386. # Result is now in FP0
  2387. #
  2388. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  2389. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  2390. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  2391. unlk %a6
  2392. rts
  2393. global _ftentoxx_
  2394. _ftentoxx_:
  2395. link %a6,&-LOCAL_SIZE
  2396. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  2397. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  2398. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  2399. fmov.l &0x0,%fpcr # zero FPCR
  2400. #
  2401. # copy, convert, and tag input argument
  2402. #
  2403. lea FP_SRC(%a6),%a0
  2404. mov.l 0x8+0x0(%a6),0x0(%a0) # load ext input
  2405. mov.l 0x8+0x4(%a6),0x4(%a0)
  2406. mov.l 0x8+0x8(%a6),0x8(%a0)
  2407. bsr.l tag # fetch operand type
  2408. mov.b %d0,STAG(%a6)
  2409. mov.b %d0,%d1
  2410. andi.l &0x00ff00ff,USER_FPSR(%a6)
  2411. clr.l %d0
  2412. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  2413. tst.b %d1
  2414. bne.b _L12_2x
  2415. bsr.l stentox # operand is a NORM
  2416. bra.b _L12_6x
  2417. _L12_2x:
  2418. cmpi.b %d1,&ZERO # is operand a ZERO?
  2419. bne.b _L12_3x # no
  2420. bsr.l ld_pone # yes
  2421. bra.b _L12_6x
  2422. _L12_3x:
  2423. cmpi.b %d1,&INF # is operand an INF?
  2424. bne.b _L12_4x # no
  2425. bsr.l szr_inf # yes
  2426. bra.b _L12_6x
  2427. _L12_4x:
  2428. cmpi.b %d1,&QNAN # is operand a QNAN?
  2429. bne.b _L12_5x # no
  2430. bsr.l src_qnan # yes
  2431. bra.b _L12_6x
  2432. _L12_5x:
  2433. bsr.l stentoxd # operand is a DENORM
  2434. _L12_6x:
  2435. #
  2436. # Result is now in FP0
  2437. #
  2438. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  2439. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  2440. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  2441. unlk %a6
  2442. rts
  2443. #########################################################################
  2444. # MONADIC TEMPLATE #
  2445. #########################################################################
  2446. global _flogns_
  2447. _flogns_:
  2448. link %a6,&-LOCAL_SIZE
  2449. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  2450. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  2451. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  2452. fmov.l &0x0,%fpcr # zero FPCR
  2453. #
  2454. # copy, convert, and tag input argument
  2455. #
  2456. fmov.s 0x8(%a6),%fp0 # load sgl input
  2457. fmov.x %fp0,FP_SRC(%a6)
  2458. lea FP_SRC(%a6),%a0
  2459. bsr.l tag # fetch operand type
  2460. mov.b %d0,STAG(%a6)
  2461. mov.b %d0,%d1
  2462. andi.l &0x00ff00ff,USER_FPSR(%a6)
  2463. clr.l %d0
  2464. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  2465. tst.b %d1
  2466. bne.b _L13_2s
  2467. bsr.l slogn # operand is a NORM
  2468. bra.b _L13_6s
  2469. _L13_2s:
  2470. cmpi.b %d1,&ZERO # is operand a ZERO?
  2471. bne.b _L13_3s # no
  2472. bsr.l t_dz2 # yes
  2473. bra.b _L13_6s
  2474. _L13_3s:
  2475. cmpi.b %d1,&INF # is operand an INF?
  2476. bne.b _L13_4s # no
  2477. bsr.l sopr_inf # yes
  2478. bra.b _L13_6s
  2479. _L13_4s:
  2480. cmpi.b %d1,&QNAN # is operand a QNAN?
  2481. bne.b _L13_5s # no
  2482. bsr.l src_qnan # yes
  2483. bra.b _L13_6s
  2484. _L13_5s:
  2485. bsr.l slognd # operand is a DENORM
  2486. _L13_6s:
  2487. #
  2488. # Result is now in FP0
  2489. #
  2490. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  2491. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  2492. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  2493. unlk %a6
  2494. rts
  2495. global _flognd_
  2496. _flognd_:
  2497. link %a6,&-LOCAL_SIZE
  2498. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  2499. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  2500. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  2501. fmov.l &0x0,%fpcr # zero FPCR
  2502. #
  2503. # copy, convert, and tag input argument
  2504. #
  2505. fmov.d 0x8(%a6),%fp0 # load dbl input
  2506. fmov.x %fp0,FP_SRC(%a6)
  2507. lea FP_SRC(%a6),%a0
  2508. bsr.l tag # fetch operand type
  2509. mov.b %d0,STAG(%a6)
  2510. mov.b %d0,%d1
  2511. andi.l &0x00ff00ff,USER_FPSR(%a6)
  2512. clr.l %d0
  2513. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  2514. mov.b %d1,STAG(%a6)
  2515. tst.b %d1
  2516. bne.b _L13_2d
  2517. bsr.l slogn # operand is a NORM
  2518. bra.b _L13_6d
  2519. _L13_2d:
  2520. cmpi.b %d1,&ZERO # is operand a ZERO?
  2521. bne.b _L13_3d # no
  2522. bsr.l t_dz2 # yes
  2523. bra.b _L13_6d
  2524. _L13_3d:
  2525. cmpi.b %d1,&INF # is operand an INF?
  2526. bne.b _L13_4d # no
  2527. bsr.l sopr_inf # yes
  2528. bra.b _L13_6d
  2529. _L13_4d:
  2530. cmpi.b %d1,&QNAN # is operand a QNAN?
  2531. bne.b _L13_5d # no
  2532. bsr.l src_qnan # yes
  2533. bra.b _L13_6d
  2534. _L13_5d:
  2535. bsr.l slognd # operand is a DENORM
  2536. _L13_6d:
  2537. #
  2538. # Result is now in FP0
  2539. #
  2540. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  2541. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  2542. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  2543. unlk %a6
  2544. rts
  2545. global _flognx_
  2546. _flognx_:
  2547. link %a6,&-LOCAL_SIZE
  2548. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  2549. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  2550. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  2551. fmov.l &0x0,%fpcr # zero FPCR
  2552. #
  2553. # copy, convert, and tag input argument
  2554. #
  2555. lea FP_SRC(%a6),%a0
  2556. mov.l 0x8+0x0(%a6),0x0(%a0) # load ext input
  2557. mov.l 0x8+0x4(%a6),0x4(%a0)
  2558. mov.l 0x8+0x8(%a6),0x8(%a0)
  2559. bsr.l tag # fetch operand type
  2560. mov.b %d0,STAG(%a6)
  2561. mov.b %d0,%d1
  2562. andi.l &0x00ff00ff,USER_FPSR(%a6)
  2563. clr.l %d0
  2564. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  2565. tst.b %d1
  2566. bne.b _L13_2x
  2567. bsr.l slogn # operand is a NORM
  2568. bra.b _L13_6x
  2569. _L13_2x:
  2570. cmpi.b %d1,&ZERO # is operand a ZERO?
  2571. bne.b _L13_3x # no
  2572. bsr.l t_dz2 # yes
  2573. bra.b _L13_6x
  2574. _L13_3x:
  2575. cmpi.b %d1,&INF # is operand an INF?
  2576. bne.b _L13_4x # no
  2577. bsr.l sopr_inf # yes
  2578. bra.b _L13_6x
  2579. _L13_4x:
  2580. cmpi.b %d1,&QNAN # is operand a QNAN?
  2581. bne.b _L13_5x # no
  2582. bsr.l src_qnan # yes
  2583. bra.b _L13_6x
  2584. _L13_5x:
  2585. bsr.l slognd # operand is a DENORM
  2586. _L13_6x:
  2587. #
  2588. # Result is now in FP0
  2589. #
  2590. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  2591. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  2592. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  2593. unlk %a6
  2594. rts
  2595. #########################################################################
  2596. # MONADIC TEMPLATE #
  2597. #########################################################################
  2598. global _flog10s_
  2599. _flog10s_:
  2600. link %a6,&-LOCAL_SIZE
  2601. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  2602. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  2603. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  2604. fmov.l &0x0,%fpcr # zero FPCR
  2605. #
  2606. # copy, convert, and tag input argument
  2607. #
  2608. fmov.s 0x8(%a6),%fp0 # load sgl input
  2609. fmov.x %fp0,FP_SRC(%a6)
  2610. lea FP_SRC(%a6),%a0
  2611. bsr.l tag # fetch operand type
  2612. mov.b %d0,STAG(%a6)
  2613. mov.b %d0,%d1
  2614. andi.l &0x00ff00ff,USER_FPSR(%a6)
  2615. clr.l %d0
  2616. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  2617. tst.b %d1
  2618. bne.b _L14_2s
  2619. bsr.l slog10 # operand is a NORM
  2620. bra.b _L14_6s
  2621. _L14_2s:
  2622. cmpi.b %d1,&ZERO # is operand a ZERO?
  2623. bne.b _L14_3s # no
  2624. bsr.l t_dz2 # yes
  2625. bra.b _L14_6s
  2626. _L14_3s:
  2627. cmpi.b %d1,&INF # is operand an INF?
  2628. bne.b _L14_4s # no
  2629. bsr.l sopr_inf # yes
  2630. bra.b _L14_6s
  2631. _L14_4s:
  2632. cmpi.b %d1,&QNAN # is operand a QNAN?
  2633. bne.b _L14_5s # no
  2634. bsr.l src_qnan # yes
  2635. bra.b _L14_6s
  2636. _L14_5s:
  2637. bsr.l slog10d # operand is a DENORM
  2638. _L14_6s:
  2639. #
  2640. # Result is now in FP0
  2641. #
  2642. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  2643. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  2644. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  2645. unlk %a6
  2646. rts
  2647. global _flog10d_
  2648. _flog10d_:
  2649. link %a6,&-LOCAL_SIZE
  2650. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  2651. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  2652. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  2653. fmov.l &0x0,%fpcr # zero FPCR
  2654. #
  2655. # copy, convert, and tag input argument
  2656. #
  2657. fmov.d 0x8(%a6),%fp0 # load dbl input
  2658. fmov.x %fp0,FP_SRC(%a6)
  2659. lea FP_SRC(%a6),%a0
  2660. bsr.l tag # fetch operand type
  2661. mov.b %d0,STAG(%a6)
  2662. mov.b %d0,%d1
  2663. andi.l &0x00ff00ff,USER_FPSR(%a6)
  2664. clr.l %d0
  2665. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  2666. mov.b %d1,STAG(%a6)
  2667. tst.b %d1
  2668. bne.b _L14_2d
  2669. bsr.l slog10 # operand is a NORM
  2670. bra.b _L14_6d
  2671. _L14_2d:
  2672. cmpi.b %d1,&ZERO # is operand a ZERO?
  2673. bne.b _L14_3d # no
  2674. bsr.l t_dz2 # yes
  2675. bra.b _L14_6d
  2676. _L14_3d:
  2677. cmpi.b %d1,&INF # is operand an INF?
  2678. bne.b _L14_4d # no
  2679. bsr.l sopr_inf # yes
  2680. bra.b _L14_6d
  2681. _L14_4d:
  2682. cmpi.b %d1,&QNAN # is operand a QNAN?
  2683. bne.b _L14_5d # no
  2684. bsr.l src_qnan # yes
  2685. bra.b _L14_6d
  2686. _L14_5d:
  2687. bsr.l slog10d # operand is a DENORM
  2688. _L14_6d:
  2689. #
  2690. # Result is now in FP0
  2691. #
  2692. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  2693. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  2694. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  2695. unlk %a6
  2696. rts
  2697. global _flog10x_
  2698. _flog10x_:
  2699. link %a6,&-LOCAL_SIZE
  2700. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  2701. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  2702. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  2703. fmov.l &0x0,%fpcr # zero FPCR
  2704. #
  2705. # copy, convert, and tag input argument
  2706. #
  2707. lea FP_SRC(%a6),%a0
  2708. mov.l 0x8+0x0(%a6),0x0(%a0) # load ext input
  2709. mov.l 0x8+0x4(%a6),0x4(%a0)
  2710. mov.l 0x8+0x8(%a6),0x8(%a0)
  2711. bsr.l tag # fetch operand type
  2712. mov.b %d0,STAG(%a6)
  2713. mov.b %d0,%d1
  2714. andi.l &0x00ff00ff,USER_FPSR(%a6)
  2715. clr.l %d0
  2716. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  2717. tst.b %d1
  2718. bne.b _L14_2x
  2719. bsr.l slog10 # operand is a NORM
  2720. bra.b _L14_6x
  2721. _L14_2x:
  2722. cmpi.b %d1,&ZERO # is operand a ZERO?
  2723. bne.b _L14_3x # no
  2724. bsr.l t_dz2 # yes
  2725. bra.b _L14_6x
  2726. _L14_3x:
  2727. cmpi.b %d1,&INF # is operand an INF?
  2728. bne.b _L14_4x # no
  2729. bsr.l sopr_inf # yes
  2730. bra.b _L14_6x
  2731. _L14_4x:
  2732. cmpi.b %d1,&QNAN # is operand a QNAN?
  2733. bne.b _L14_5x # no
  2734. bsr.l src_qnan # yes
  2735. bra.b _L14_6x
  2736. _L14_5x:
  2737. bsr.l slog10d # operand is a DENORM
  2738. _L14_6x:
  2739. #
  2740. # Result is now in FP0
  2741. #
  2742. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  2743. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  2744. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  2745. unlk %a6
  2746. rts
  2747. #########################################################################
  2748. # MONADIC TEMPLATE #
  2749. #########################################################################
  2750. global _flog2s_
  2751. _flog2s_:
  2752. link %a6,&-LOCAL_SIZE
  2753. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  2754. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  2755. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  2756. fmov.l &0x0,%fpcr # zero FPCR
  2757. #
  2758. # copy, convert, and tag input argument
  2759. #
  2760. fmov.s 0x8(%a6),%fp0 # load sgl input
  2761. fmov.x %fp0,FP_SRC(%a6)
  2762. lea FP_SRC(%a6),%a0
  2763. bsr.l tag # fetch operand type
  2764. mov.b %d0,STAG(%a6)
  2765. mov.b %d0,%d1
  2766. andi.l &0x00ff00ff,USER_FPSR(%a6)
  2767. clr.l %d0
  2768. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  2769. tst.b %d1
  2770. bne.b _L15_2s
  2771. bsr.l slog2 # operand is a NORM
  2772. bra.b _L15_6s
  2773. _L15_2s:
  2774. cmpi.b %d1,&ZERO # is operand a ZERO?
  2775. bne.b _L15_3s # no
  2776. bsr.l t_dz2 # yes
  2777. bra.b _L15_6s
  2778. _L15_3s:
  2779. cmpi.b %d1,&INF # is operand an INF?
  2780. bne.b _L15_4s # no
  2781. bsr.l sopr_inf # yes
  2782. bra.b _L15_6s
  2783. _L15_4s:
  2784. cmpi.b %d1,&QNAN # is operand a QNAN?
  2785. bne.b _L15_5s # no
  2786. bsr.l src_qnan # yes
  2787. bra.b _L15_6s
  2788. _L15_5s:
  2789. bsr.l slog2d # operand is a DENORM
  2790. _L15_6s:
  2791. #
  2792. # Result is now in FP0
  2793. #
  2794. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  2795. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  2796. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  2797. unlk %a6
  2798. rts
  2799. global _flog2d_
  2800. _flog2d_:
  2801. link %a6,&-LOCAL_SIZE
  2802. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  2803. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  2804. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  2805. fmov.l &0x0,%fpcr # zero FPCR
  2806. #
  2807. # copy, convert, and tag input argument
  2808. #
  2809. fmov.d 0x8(%a6),%fp0 # load dbl input
  2810. fmov.x %fp0,FP_SRC(%a6)
  2811. lea FP_SRC(%a6),%a0
  2812. bsr.l tag # fetch operand type
  2813. mov.b %d0,STAG(%a6)
  2814. mov.b %d0,%d1
  2815. andi.l &0x00ff00ff,USER_FPSR(%a6)
  2816. clr.l %d0
  2817. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  2818. mov.b %d1,STAG(%a6)
  2819. tst.b %d1
  2820. bne.b _L15_2d
  2821. bsr.l slog2 # operand is a NORM
  2822. bra.b _L15_6d
  2823. _L15_2d:
  2824. cmpi.b %d1,&ZERO # is operand a ZERO?
  2825. bne.b _L15_3d # no
  2826. bsr.l t_dz2 # yes
  2827. bra.b _L15_6d
  2828. _L15_3d:
  2829. cmpi.b %d1,&INF # is operand an INF?
  2830. bne.b _L15_4d # no
  2831. bsr.l sopr_inf # yes
  2832. bra.b _L15_6d
  2833. _L15_4d:
  2834. cmpi.b %d1,&QNAN # is operand a QNAN?
  2835. bne.b _L15_5d # no
  2836. bsr.l src_qnan # yes
  2837. bra.b _L15_6d
  2838. _L15_5d:
  2839. bsr.l slog2d # operand is a DENORM
  2840. _L15_6d:
  2841. #
  2842. # Result is now in FP0
  2843. #
  2844. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  2845. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  2846. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  2847. unlk %a6
  2848. rts
  2849. global _flog2x_
  2850. _flog2x_:
  2851. link %a6,&-LOCAL_SIZE
  2852. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  2853. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  2854. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  2855. fmov.l &0x0,%fpcr # zero FPCR
  2856. #
  2857. # copy, convert, and tag input argument
  2858. #
  2859. lea FP_SRC(%a6),%a0
  2860. mov.l 0x8+0x0(%a6),0x0(%a0) # load ext input
  2861. mov.l 0x8+0x4(%a6),0x4(%a0)
  2862. mov.l 0x8+0x8(%a6),0x8(%a0)
  2863. bsr.l tag # fetch operand type
  2864. mov.b %d0,STAG(%a6)
  2865. mov.b %d0,%d1
  2866. andi.l &0x00ff00ff,USER_FPSR(%a6)
  2867. clr.l %d0
  2868. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  2869. tst.b %d1
  2870. bne.b _L15_2x
  2871. bsr.l slog2 # operand is a NORM
  2872. bra.b _L15_6x
  2873. _L15_2x:
  2874. cmpi.b %d1,&ZERO # is operand a ZERO?
  2875. bne.b _L15_3x # no
  2876. bsr.l t_dz2 # yes
  2877. bra.b _L15_6x
  2878. _L15_3x:
  2879. cmpi.b %d1,&INF # is operand an INF?
  2880. bne.b _L15_4x # no
  2881. bsr.l sopr_inf # yes
  2882. bra.b _L15_6x
  2883. _L15_4x:
  2884. cmpi.b %d1,&QNAN # is operand a QNAN?
  2885. bne.b _L15_5x # no
  2886. bsr.l src_qnan # yes
  2887. bra.b _L15_6x
  2888. _L15_5x:
  2889. bsr.l slog2d # operand is a DENORM
  2890. _L15_6x:
  2891. #
  2892. # Result is now in FP0
  2893. #
  2894. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  2895. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  2896. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  2897. unlk %a6
  2898. rts
  2899. #########################################################################
  2900. # MONADIC TEMPLATE #
  2901. #########################################################################
  2902. global _fcoshs_
  2903. _fcoshs_:
  2904. link %a6,&-LOCAL_SIZE
  2905. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  2906. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  2907. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  2908. fmov.l &0x0,%fpcr # zero FPCR
  2909. #
  2910. # copy, convert, and tag input argument
  2911. #
  2912. fmov.s 0x8(%a6),%fp0 # load sgl input
  2913. fmov.x %fp0,FP_SRC(%a6)
  2914. lea FP_SRC(%a6),%a0
  2915. bsr.l tag # fetch operand type
  2916. mov.b %d0,STAG(%a6)
  2917. mov.b %d0,%d1
  2918. andi.l &0x00ff00ff,USER_FPSR(%a6)
  2919. clr.l %d0
  2920. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  2921. tst.b %d1
  2922. bne.b _L16_2s
  2923. bsr.l scosh # operand is a NORM
  2924. bra.b _L16_6s
  2925. _L16_2s:
  2926. cmpi.b %d1,&ZERO # is operand a ZERO?
  2927. bne.b _L16_3s # no
  2928. bsr.l ld_pone # yes
  2929. bra.b _L16_6s
  2930. _L16_3s:
  2931. cmpi.b %d1,&INF # is operand an INF?
  2932. bne.b _L16_4s # no
  2933. bsr.l ld_pinf # yes
  2934. bra.b _L16_6s
  2935. _L16_4s:
  2936. cmpi.b %d1,&QNAN # is operand a QNAN?
  2937. bne.b _L16_5s # no
  2938. bsr.l src_qnan # yes
  2939. bra.b _L16_6s
  2940. _L16_5s:
  2941. bsr.l scoshd # operand is a DENORM
  2942. _L16_6s:
  2943. #
  2944. # Result is now in FP0
  2945. #
  2946. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  2947. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  2948. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  2949. unlk %a6
  2950. rts
  2951. global _fcoshd_
  2952. _fcoshd_:
  2953. link %a6,&-LOCAL_SIZE
  2954. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  2955. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  2956. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  2957. fmov.l &0x0,%fpcr # zero FPCR
  2958. #
  2959. # copy, convert, and tag input argument
  2960. #
  2961. fmov.d 0x8(%a6),%fp0 # load dbl input
  2962. fmov.x %fp0,FP_SRC(%a6)
  2963. lea FP_SRC(%a6),%a0
  2964. bsr.l tag # fetch operand type
  2965. mov.b %d0,STAG(%a6)
  2966. mov.b %d0,%d1
  2967. andi.l &0x00ff00ff,USER_FPSR(%a6)
  2968. clr.l %d0
  2969. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  2970. mov.b %d1,STAG(%a6)
  2971. tst.b %d1
  2972. bne.b _L16_2d
  2973. bsr.l scosh # operand is a NORM
  2974. bra.b _L16_6d
  2975. _L16_2d:
  2976. cmpi.b %d1,&ZERO # is operand a ZERO?
  2977. bne.b _L16_3d # no
  2978. bsr.l ld_pone # yes
  2979. bra.b _L16_6d
  2980. _L16_3d:
  2981. cmpi.b %d1,&INF # is operand an INF?
  2982. bne.b _L16_4d # no
  2983. bsr.l ld_pinf # yes
  2984. bra.b _L16_6d
  2985. _L16_4d:
  2986. cmpi.b %d1,&QNAN # is operand a QNAN?
  2987. bne.b _L16_5d # no
  2988. bsr.l src_qnan # yes
  2989. bra.b _L16_6d
  2990. _L16_5d:
  2991. bsr.l scoshd # operand is a DENORM
  2992. _L16_6d:
  2993. #
  2994. # Result is now in FP0
  2995. #
  2996. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  2997. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  2998. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  2999. unlk %a6
  3000. rts
  3001. global _fcoshx_
  3002. _fcoshx_:
  3003. link %a6,&-LOCAL_SIZE
  3004. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  3005. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  3006. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  3007. fmov.l &0x0,%fpcr # zero FPCR
  3008. #
  3009. # copy, convert, and tag input argument
  3010. #
  3011. lea FP_SRC(%a6),%a0
  3012. mov.l 0x8+0x0(%a6),0x0(%a0) # load ext input
  3013. mov.l 0x8+0x4(%a6),0x4(%a0)
  3014. mov.l 0x8+0x8(%a6),0x8(%a0)
  3015. bsr.l tag # fetch operand type
  3016. mov.b %d0,STAG(%a6)
  3017. mov.b %d0,%d1
  3018. andi.l &0x00ff00ff,USER_FPSR(%a6)
  3019. clr.l %d0
  3020. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  3021. tst.b %d1
  3022. bne.b _L16_2x
  3023. bsr.l scosh # operand is a NORM
  3024. bra.b _L16_6x
  3025. _L16_2x:
  3026. cmpi.b %d1,&ZERO # is operand a ZERO?
  3027. bne.b _L16_3x # no
  3028. bsr.l ld_pone # yes
  3029. bra.b _L16_6x
  3030. _L16_3x:
  3031. cmpi.b %d1,&INF # is operand an INF?
  3032. bne.b _L16_4x # no
  3033. bsr.l ld_pinf # yes
  3034. bra.b _L16_6x
  3035. _L16_4x:
  3036. cmpi.b %d1,&QNAN # is operand a QNAN?
  3037. bne.b _L16_5x # no
  3038. bsr.l src_qnan # yes
  3039. bra.b _L16_6x
  3040. _L16_5x:
  3041. bsr.l scoshd # operand is a DENORM
  3042. _L16_6x:
  3043. #
  3044. # Result is now in FP0
  3045. #
  3046. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  3047. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  3048. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  3049. unlk %a6
  3050. rts
  3051. #########################################################################
  3052. # MONADIC TEMPLATE #
  3053. #########################################################################
  3054. global _facoss_
  3055. _facoss_:
  3056. link %a6,&-LOCAL_SIZE
  3057. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  3058. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  3059. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  3060. fmov.l &0x0,%fpcr # zero FPCR
  3061. #
  3062. # copy, convert, and tag input argument
  3063. #
  3064. fmov.s 0x8(%a6),%fp0 # load sgl input
  3065. fmov.x %fp0,FP_SRC(%a6)
  3066. lea FP_SRC(%a6),%a0
  3067. bsr.l tag # fetch operand type
  3068. mov.b %d0,STAG(%a6)
  3069. mov.b %d0,%d1
  3070. andi.l &0x00ff00ff,USER_FPSR(%a6)
  3071. clr.l %d0
  3072. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  3073. tst.b %d1
  3074. bne.b _L17_2s
  3075. bsr.l sacos # operand is a NORM
  3076. bra.b _L17_6s
  3077. _L17_2s:
  3078. cmpi.b %d1,&ZERO # is operand a ZERO?
  3079. bne.b _L17_3s # no
  3080. bsr.l ld_ppi2 # yes
  3081. bra.b _L17_6s
  3082. _L17_3s:
  3083. cmpi.b %d1,&INF # is operand an INF?
  3084. bne.b _L17_4s # no
  3085. bsr.l t_operr # yes
  3086. bra.b _L17_6s
  3087. _L17_4s:
  3088. cmpi.b %d1,&QNAN # is operand a QNAN?
  3089. bne.b _L17_5s # no
  3090. bsr.l src_qnan # yes
  3091. bra.b _L17_6s
  3092. _L17_5s:
  3093. bsr.l sacosd # operand is a DENORM
  3094. _L17_6s:
  3095. #
  3096. # Result is now in FP0
  3097. #
  3098. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  3099. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  3100. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  3101. unlk %a6
  3102. rts
  3103. global _facosd_
  3104. _facosd_:
  3105. link %a6,&-LOCAL_SIZE
  3106. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  3107. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  3108. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  3109. fmov.l &0x0,%fpcr # zero FPCR
  3110. #
  3111. # copy, convert, and tag input argument
  3112. #
  3113. fmov.d 0x8(%a6),%fp0 # load dbl input
  3114. fmov.x %fp0,FP_SRC(%a6)
  3115. lea FP_SRC(%a6),%a0
  3116. bsr.l tag # fetch operand type
  3117. mov.b %d0,STAG(%a6)
  3118. mov.b %d0,%d1
  3119. andi.l &0x00ff00ff,USER_FPSR(%a6)
  3120. clr.l %d0
  3121. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  3122. mov.b %d1,STAG(%a6)
  3123. tst.b %d1
  3124. bne.b _L17_2d
  3125. bsr.l sacos # operand is a NORM
  3126. bra.b _L17_6d
  3127. _L17_2d:
  3128. cmpi.b %d1,&ZERO # is operand a ZERO?
  3129. bne.b _L17_3d # no
  3130. bsr.l ld_ppi2 # yes
  3131. bra.b _L17_6d
  3132. _L17_3d:
  3133. cmpi.b %d1,&INF # is operand an INF?
  3134. bne.b _L17_4d # no
  3135. bsr.l t_operr # yes
  3136. bra.b _L17_6d
  3137. _L17_4d:
  3138. cmpi.b %d1,&QNAN # is operand a QNAN?
  3139. bne.b _L17_5d # no
  3140. bsr.l src_qnan # yes
  3141. bra.b _L17_6d
  3142. _L17_5d:
  3143. bsr.l sacosd # operand is a DENORM
  3144. _L17_6d:
  3145. #
  3146. # Result is now in FP0
  3147. #
  3148. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  3149. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  3150. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  3151. unlk %a6
  3152. rts
  3153. global _facosx_
  3154. _facosx_:
  3155. link %a6,&-LOCAL_SIZE
  3156. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  3157. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  3158. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  3159. fmov.l &0x0,%fpcr # zero FPCR
  3160. #
  3161. # copy, convert, and tag input argument
  3162. #
  3163. lea FP_SRC(%a6),%a0
  3164. mov.l 0x8+0x0(%a6),0x0(%a0) # load ext input
  3165. mov.l 0x8+0x4(%a6),0x4(%a0)
  3166. mov.l 0x8+0x8(%a6),0x8(%a0)
  3167. bsr.l tag # fetch operand type
  3168. mov.b %d0,STAG(%a6)
  3169. mov.b %d0,%d1
  3170. andi.l &0x00ff00ff,USER_FPSR(%a6)
  3171. clr.l %d0
  3172. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  3173. tst.b %d1
  3174. bne.b _L17_2x
  3175. bsr.l sacos # operand is a NORM
  3176. bra.b _L17_6x
  3177. _L17_2x:
  3178. cmpi.b %d1,&ZERO # is operand a ZERO?
  3179. bne.b _L17_3x # no
  3180. bsr.l ld_ppi2 # yes
  3181. bra.b _L17_6x
  3182. _L17_3x:
  3183. cmpi.b %d1,&INF # is operand an INF?
  3184. bne.b _L17_4x # no
  3185. bsr.l t_operr # yes
  3186. bra.b _L17_6x
  3187. _L17_4x:
  3188. cmpi.b %d1,&QNAN # is operand a QNAN?
  3189. bne.b _L17_5x # no
  3190. bsr.l src_qnan # yes
  3191. bra.b _L17_6x
  3192. _L17_5x:
  3193. bsr.l sacosd # operand is a DENORM
  3194. _L17_6x:
  3195. #
  3196. # Result is now in FP0
  3197. #
  3198. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  3199. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  3200. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  3201. unlk %a6
  3202. rts
  3203. #########################################################################
  3204. # MONADIC TEMPLATE #
  3205. #########################################################################
  3206. global _fgetexps_
  3207. _fgetexps_:
  3208. link %a6,&-LOCAL_SIZE
  3209. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  3210. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  3211. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  3212. fmov.l &0x0,%fpcr # zero FPCR
  3213. #
  3214. # copy, convert, and tag input argument
  3215. #
  3216. fmov.s 0x8(%a6),%fp0 # load sgl input
  3217. fmov.x %fp0,FP_SRC(%a6)
  3218. lea FP_SRC(%a6),%a0
  3219. bsr.l tag # fetch operand type
  3220. mov.b %d0,STAG(%a6)
  3221. mov.b %d0,%d1
  3222. andi.l &0x00ff00ff,USER_FPSR(%a6)
  3223. clr.l %d0
  3224. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  3225. tst.b %d1
  3226. bne.b _L18_2s
  3227. bsr.l sgetexp # operand is a NORM
  3228. bra.b _L18_6s
  3229. _L18_2s:
  3230. cmpi.b %d1,&ZERO # is operand a ZERO?
  3231. bne.b _L18_3s # no
  3232. bsr.l src_zero # yes
  3233. bra.b _L18_6s
  3234. _L18_3s:
  3235. cmpi.b %d1,&INF # is operand an INF?
  3236. bne.b _L18_4s # no
  3237. bsr.l t_operr # yes
  3238. bra.b _L18_6s
  3239. _L18_4s:
  3240. cmpi.b %d1,&QNAN # is operand a QNAN?
  3241. bne.b _L18_5s # no
  3242. bsr.l src_qnan # yes
  3243. bra.b _L18_6s
  3244. _L18_5s:
  3245. bsr.l sgetexpd # operand is a DENORM
  3246. _L18_6s:
  3247. #
  3248. # Result is now in FP0
  3249. #
  3250. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  3251. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  3252. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  3253. unlk %a6
  3254. rts
  3255. global _fgetexpd_
  3256. _fgetexpd_:
  3257. link %a6,&-LOCAL_SIZE
  3258. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  3259. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  3260. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  3261. fmov.l &0x0,%fpcr # zero FPCR
  3262. #
  3263. # copy, convert, and tag input argument
  3264. #
  3265. fmov.d 0x8(%a6),%fp0 # load dbl input
  3266. fmov.x %fp0,FP_SRC(%a6)
  3267. lea FP_SRC(%a6),%a0
  3268. bsr.l tag # fetch operand type
  3269. mov.b %d0,STAG(%a6)
  3270. mov.b %d0,%d1
  3271. andi.l &0x00ff00ff,USER_FPSR(%a6)
  3272. clr.l %d0
  3273. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  3274. mov.b %d1,STAG(%a6)
  3275. tst.b %d1
  3276. bne.b _L18_2d
  3277. bsr.l sgetexp # operand is a NORM
  3278. bra.b _L18_6d
  3279. _L18_2d:
  3280. cmpi.b %d1,&ZERO # is operand a ZERO?
  3281. bne.b _L18_3d # no
  3282. bsr.l src_zero # yes
  3283. bra.b _L18_6d
  3284. _L18_3d:
  3285. cmpi.b %d1,&INF # is operand an INF?
  3286. bne.b _L18_4d # no
  3287. bsr.l t_operr # yes
  3288. bra.b _L18_6d
  3289. _L18_4d:
  3290. cmpi.b %d1,&QNAN # is operand a QNAN?
  3291. bne.b _L18_5d # no
  3292. bsr.l src_qnan # yes
  3293. bra.b _L18_6d
  3294. _L18_5d:
  3295. bsr.l sgetexpd # operand is a DENORM
  3296. _L18_6d:
  3297. #
  3298. # Result is now in FP0
  3299. #
  3300. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  3301. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  3302. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  3303. unlk %a6
  3304. rts
  3305. global _fgetexpx_
  3306. _fgetexpx_:
  3307. link %a6,&-LOCAL_SIZE
  3308. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  3309. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  3310. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  3311. fmov.l &0x0,%fpcr # zero FPCR
  3312. #
  3313. # copy, convert, and tag input argument
  3314. #
  3315. lea FP_SRC(%a6),%a0
  3316. mov.l 0x8+0x0(%a6),0x0(%a0) # load ext input
  3317. mov.l 0x8+0x4(%a6),0x4(%a0)
  3318. mov.l 0x8+0x8(%a6),0x8(%a0)
  3319. bsr.l tag # fetch operand type
  3320. mov.b %d0,STAG(%a6)
  3321. mov.b %d0,%d1
  3322. andi.l &0x00ff00ff,USER_FPSR(%a6)
  3323. clr.l %d0
  3324. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  3325. tst.b %d1
  3326. bne.b _L18_2x
  3327. bsr.l sgetexp # operand is a NORM
  3328. bra.b _L18_6x
  3329. _L18_2x:
  3330. cmpi.b %d1,&ZERO # is operand a ZERO?
  3331. bne.b _L18_3x # no
  3332. bsr.l src_zero # yes
  3333. bra.b _L18_6x
  3334. _L18_3x:
  3335. cmpi.b %d1,&INF # is operand an INF?
  3336. bne.b _L18_4x # no
  3337. bsr.l t_operr # yes
  3338. bra.b _L18_6x
  3339. _L18_4x:
  3340. cmpi.b %d1,&QNAN # is operand a QNAN?
  3341. bne.b _L18_5x # no
  3342. bsr.l src_qnan # yes
  3343. bra.b _L18_6x
  3344. _L18_5x:
  3345. bsr.l sgetexpd # operand is a DENORM
  3346. _L18_6x:
  3347. #
  3348. # Result is now in FP0
  3349. #
  3350. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  3351. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  3352. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  3353. unlk %a6
  3354. rts
  3355. #########################################################################
  3356. # MONADIC TEMPLATE #
  3357. #########################################################################
  3358. global _fgetmans_
  3359. _fgetmans_:
  3360. link %a6,&-LOCAL_SIZE
  3361. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  3362. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  3363. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  3364. fmov.l &0x0,%fpcr # zero FPCR
  3365. #
  3366. # copy, convert, and tag input argument
  3367. #
  3368. fmov.s 0x8(%a6),%fp0 # load sgl input
  3369. fmov.x %fp0,FP_SRC(%a6)
  3370. lea FP_SRC(%a6),%a0
  3371. bsr.l tag # fetch operand type
  3372. mov.b %d0,STAG(%a6)
  3373. mov.b %d0,%d1
  3374. andi.l &0x00ff00ff,USER_FPSR(%a6)
  3375. clr.l %d0
  3376. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  3377. tst.b %d1
  3378. bne.b _L19_2s
  3379. bsr.l sgetman # operand is a NORM
  3380. bra.b _L19_6s
  3381. _L19_2s:
  3382. cmpi.b %d1,&ZERO # is operand a ZERO?
  3383. bne.b _L19_3s # no
  3384. bsr.l src_zero # yes
  3385. bra.b _L19_6s
  3386. _L19_3s:
  3387. cmpi.b %d1,&INF # is operand an INF?
  3388. bne.b _L19_4s # no
  3389. bsr.l t_operr # yes
  3390. bra.b _L19_6s
  3391. _L19_4s:
  3392. cmpi.b %d1,&QNAN # is operand a QNAN?
  3393. bne.b _L19_5s # no
  3394. bsr.l src_qnan # yes
  3395. bra.b _L19_6s
  3396. _L19_5s:
  3397. bsr.l sgetmand # operand is a DENORM
  3398. _L19_6s:
  3399. #
  3400. # Result is now in FP0
  3401. #
  3402. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  3403. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  3404. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  3405. unlk %a6
  3406. rts
  3407. global _fgetmand_
  3408. _fgetmand_:
  3409. link %a6,&-LOCAL_SIZE
  3410. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  3411. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  3412. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  3413. fmov.l &0x0,%fpcr # zero FPCR
  3414. #
  3415. # copy, convert, and tag input argument
  3416. #
  3417. fmov.d 0x8(%a6),%fp0 # load dbl input
  3418. fmov.x %fp0,FP_SRC(%a6)
  3419. lea FP_SRC(%a6),%a0
  3420. bsr.l tag # fetch operand type
  3421. mov.b %d0,STAG(%a6)
  3422. mov.b %d0,%d1
  3423. andi.l &0x00ff00ff,USER_FPSR(%a6)
  3424. clr.l %d0
  3425. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  3426. mov.b %d1,STAG(%a6)
  3427. tst.b %d1
  3428. bne.b _L19_2d
  3429. bsr.l sgetman # operand is a NORM
  3430. bra.b _L19_6d
  3431. _L19_2d:
  3432. cmpi.b %d1,&ZERO # is operand a ZERO?
  3433. bne.b _L19_3d # no
  3434. bsr.l src_zero # yes
  3435. bra.b _L19_6d
  3436. _L19_3d:
  3437. cmpi.b %d1,&INF # is operand an INF?
  3438. bne.b _L19_4d # no
  3439. bsr.l t_operr # yes
  3440. bra.b _L19_6d
  3441. _L19_4d:
  3442. cmpi.b %d1,&QNAN # is operand a QNAN?
  3443. bne.b _L19_5d # no
  3444. bsr.l src_qnan # yes
  3445. bra.b _L19_6d
  3446. _L19_5d:
  3447. bsr.l sgetmand # operand is a DENORM
  3448. _L19_6d:
  3449. #
  3450. # Result is now in FP0
  3451. #
  3452. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  3453. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  3454. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  3455. unlk %a6
  3456. rts
  3457. global _fgetmanx_
  3458. _fgetmanx_:
  3459. link %a6,&-LOCAL_SIZE
  3460. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  3461. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  3462. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  3463. fmov.l &0x0,%fpcr # zero FPCR
  3464. #
  3465. # copy, convert, and tag input argument
  3466. #
  3467. lea FP_SRC(%a6),%a0
  3468. mov.l 0x8+0x0(%a6),0x0(%a0) # load ext input
  3469. mov.l 0x8+0x4(%a6),0x4(%a0)
  3470. mov.l 0x8+0x8(%a6),0x8(%a0)
  3471. bsr.l tag # fetch operand type
  3472. mov.b %d0,STAG(%a6)
  3473. mov.b %d0,%d1
  3474. andi.l &0x00ff00ff,USER_FPSR(%a6)
  3475. clr.l %d0
  3476. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  3477. tst.b %d1
  3478. bne.b _L19_2x
  3479. bsr.l sgetman # operand is a NORM
  3480. bra.b _L19_6x
  3481. _L19_2x:
  3482. cmpi.b %d1,&ZERO # is operand a ZERO?
  3483. bne.b _L19_3x # no
  3484. bsr.l src_zero # yes
  3485. bra.b _L19_6x
  3486. _L19_3x:
  3487. cmpi.b %d1,&INF # is operand an INF?
  3488. bne.b _L19_4x # no
  3489. bsr.l t_operr # yes
  3490. bra.b _L19_6x
  3491. _L19_4x:
  3492. cmpi.b %d1,&QNAN # is operand a QNAN?
  3493. bne.b _L19_5x # no
  3494. bsr.l src_qnan # yes
  3495. bra.b _L19_6x
  3496. _L19_5x:
  3497. bsr.l sgetmand # operand is a DENORM
  3498. _L19_6x:
  3499. #
  3500. # Result is now in FP0
  3501. #
  3502. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  3503. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  3504. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  3505. unlk %a6
  3506. rts
  3507. #########################################################################
  3508. # MONADIC TEMPLATE #
  3509. #########################################################################
  3510. global _fsincoss_
  3511. _fsincoss_:
  3512. link %a6,&-LOCAL_SIZE
  3513. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  3514. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  3515. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  3516. fmov.l &0x0,%fpcr # zero FPCR
  3517. #
  3518. # copy, convert, and tag input argument
  3519. #
  3520. fmov.s 0x8(%a6),%fp0 # load sgl input
  3521. fmov.x %fp0,FP_SRC(%a6)
  3522. lea FP_SRC(%a6),%a0
  3523. bsr.l tag # fetch operand type
  3524. mov.b %d0,STAG(%a6)
  3525. mov.b %d0,%d1
  3526. andi.l &0x00ff00ff,USER_FPSR(%a6)
  3527. clr.l %d0
  3528. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  3529. tst.b %d1
  3530. bne.b _L20_2s
  3531. bsr.l ssincos # operand is a NORM
  3532. bra.b _L20_6s
  3533. _L20_2s:
  3534. cmpi.b %d1,&ZERO # is operand a ZERO?
  3535. bne.b _L20_3s # no
  3536. bsr.l ssincosz # yes
  3537. bra.b _L20_6s
  3538. _L20_3s:
  3539. cmpi.b %d1,&INF # is operand an INF?
  3540. bne.b _L20_4s # no
  3541. bsr.l ssincosi # yes
  3542. bra.b _L20_6s
  3543. _L20_4s:
  3544. cmpi.b %d1,&QNAN # is operand a QNAN?
  3545. bne.b _L20_5s # no
  3546. bsr.l ssincosqnan # yes
  3547. bra.b _L20_6s
  3548. _L20_5s:
  3549. bsr.l ssincosd # operand is a DENORM
  3550. _L20_6s:
  3551. #
  3552. # Result is now in FP0
  3553. #
  3554. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  3555. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  3556. fmovm.x &0x03,-(%sp) # store off fp0/fp1
  3557. fmovm.x (%sp)+,&0x40 # fp0 now in fp1
  3558. fmovm.x (%sp)+,&0x80 # fp1 now in fp0
  3559. unlk %a6
  3560. rts
  3561. global _fsincosd_
  3562. _fsincosd_:
  3563. link %a6,&-LOCAL_SIZE
  3564. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  3565. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  3566. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  3567. fmov.l &0x0,%fpcr # zero FPCR
  3568. #
  3569. # copy, convert, and tag input argument
  3570. #
  3571. fmov.d 0x8(%a6),%fp0 # load dbl input
  3572. fmov.x %fp0,FP_SRC(%a6)
  3573. lea FP_SRC(%a6),%a0
  3574. bsr.l tag # fetch operand type
  3575. mov.b %d0,STAG(%a6)
  3576. mov.b %d0,%d1
  3577. andi.l &0x00ff00ff,USER_FPSR(%a6)
  3578. clr.l %d0
  3579. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  3580. mov.b %d1,STAG(%a6)
  3581. tst.b %d1
  3582. bne.b _L20_2d
  3583. bsr.l ssincos # operand is a NORM
  3584. bra.b _L20_6d
  3585. _L20_2d:
  3586. cmpi.b %d1,&ZERO # is operand a ZERO?
  3587. bne.b _L20_3d # no
  3588. bsr.l ssincosz # yes
  3589. bra.b _L20_6d
  3590. _L20_3d:
  3591. cmpi.b %d1,&INF # is operand an INF?
  3592. bne.b _L20_4d # no
  3593. bsr.l ssincosi # yes
  3594. bra.b _L20_6d
  3595. _L20_4d:
  3596. cmpi.b %d1,&QNAN # is operand a QNAN?
  3597. bne.b _L20_5d # no
  3598. bsr.l ssincosqnan # yes
  3599. bra.b _L20_6d
  3600. _L20_5d:
  3601. bsr.l ssincosd # operand is a DENORM
  3602. _L20_6d:
  3603. #
  3604. # Result is now in FP0
  3605. #
  3606. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  3607. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  3608. fmovm.x &0x03,-(%sp) # store off fp0/fp1
  3609. fmovm.x (%sp)+,&0x40 # fp0 now in fp1
  3610. fmovm.x (%sp)+,&0x80 # fp1 now in fp0
  3611. unlk %a6
  3612. rts
  3613. global _fsincosx_
  3614. _fsincosx_:
  3615. link %a6,&-LOCAL_SIZE
  3616. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  3617. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  3618. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  3619. fmov.l &0x0,%fpcr # zero FPCR
  3620. #
  3621. # copy, convert, and tag input argument
  3622. #
  3623. lea FP_SRC(%a6),%a0
  3624. mov.l 0x8+0x0(%a6),0x0(%a0) # load ext input
  3625. mov.l 0x8+0x4(%a6),0x4(%a0)
  3626. mov.l 0x8+0x8(%a6),0x8(%a0)
  3627. bsr.l tag # fetch operand type
  3628. mov.b %d0,STAG(%a6)
  3629. mov.b %d0,%d1
  3630. andi.l &0x00ff00ff,USER_FPSR(%a6)
  3631. clr.l %d0
  3632. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  3633. tst.b %d1
  3634. bne.b _L20_2x
  3635. bsr.l ssincos # operand is a NORM
  3636. bra.b _L20_6x
  3637. _L20_2x:
  3638. cmpi.b %d1,&ZERO # is operand a ZERO?
  3639. bne.b _L20_3x # no
  3640. bsr.l ssincosz # yes
  3641. bra.b _L20_6x
  3642. _L20_3x:
  3643. cmpi.b %d1,&INF # is operand an INF?
  3644. bne.b _L20_4x # no
  3645. bsr.l ssincosi # yes
  3646. bra.b _L20_6x
  3647. _L20_4x:
  3648. cmpi.b %d1,&QNAN # is operand a QNAN?
  3649. bne.b _L20_5x # no
  3650. bsr.l ssincosqnan # yes
  3651. bra.b _L20_6x
  3652. _L20_5x:
  3653. bsr.l ssincosd # operand is a DENORM
  3654. _L20_6x:
  3655. #
  3656. # Result is now in FP0
  3657. #
  3658. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  3659. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  3660. fmovm.x &0x03,-(%sp) # store off fp0/fp1
  3661. fmovm.x (%sp)+,&0x40 # fp0 now in fp1
  3662. fmovm.x (%sp)+,&0x80 # fp1 now in fp0
  3663. unlk %a6
  3664. rts
  3665. #########################################################################
  3666. # DYADIC TEMPLATE #
  3667. #########################################################################
  3668. global _frems_
  3669. _frems_:
  3670. link %a6,&-LOCAL_SIZE
  3671. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  3672. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  3673. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  3674. fmov.l &0x0,%fpcr # zero FPCR
  3675. #
  3676. # copy, convert, and tag input argument
  3677. #
  3678. fmov.s 0x8(%a6),%fp0 # load sgl dst
  3679. fmov.x %fp0,FP_DST(%a6)
  3680. lea FP_DST(%a6),%a0
  3681. bsr.l tag # fetch operand type
  3682. mov.b %d0,DTAG(%a6)
  3683. fmov.s 0xc(%a6),%fp0 # load sgl src
  3684. fmov.x %fp0,FP_SRC(%a6)
  3685. lea FP_SRC(%a6),%a0
  3686. bsr.l tag # fetch operand type
  3687. mov.b %d0,STAG(%a6)
  3688. mov.l %d0,%d1
  3689. andi.l &0x00ff00ff,USER_FPSR(%a6)
  3690. clr.l %d0
  3691. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  3692. lea FP_SRC(%a6),%a0 # pass ptr to src
  3693. lea FP_DST(%a6),%a1 # pass ptr to dst
  3694. tst.b %d1
  3695. bne.b _L21_2s
  3696. bsr.l srem_snorm # operand is a NORM
  3697. bra.b _L21_6s
  3698. _L21_2s:
  3699. cmpi.b %d1,&ZERO # is operand a ZERO?
  3700. bne.b _L21_3s # no
  3701. bsr.l srem_szero # yes
  3702. bra.b _L21_6s
  3703. _L21_3s:
  3704. cmpi.b %d1,&INF # is operand an INF?
  3705. bne.b _L21_4s # no
  3706. bsr.l srem_sinf # yes
  3707. bra.b _L21_6s
  3708. _L21_4s:
  3709. cmpi.b %d1,&QNAN # is operand a QNAN?
  3710. bne.b _L21_5s # no
  3711. bsr.l sop_sqnan # yes
  3712. bra.b _L21_6s
  3713. _L21_5s:
  3714. bsr.l srem_sdnrm # operand is a DENORM
  3715. _L21_6s:
  3716. #
  3717. # Result is now in FP0
  3718. #
  3719. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  3720. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  3721. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  3722. unlk %a6
  3723. rts
  3724. global _fremd_
  3725. _fremd_:
  3726. link %a6,&-LOCAL_SIZE
  3727. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  3728. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  3729. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  3730. fmov.l &0x0,%fpcr # zero FPCR
  3731. #
  3732. # copy, convert, and tag input argument
  3733. #
  3734. fmov.d 0x8(%a6),%fp0 # load dbl dst
  3735. fmov.x %fp0,FP_DST(%a6)
  3736. lea FP_DST(%a6),%a0
  3737. bsr.l tag # fetch operand type
  3738. mov.b %d0,DTAG(%a6)
  3739. fmov.d 0x10(%a6),%fp0 # load dbl src
  3740. fmov.x %fp0,FP_SRC(%a6)
  3741. lea FP_SRC(%a6),%a0
  3742. bsr.l tag # fetch operand type
  3743. mov.b %d0,STAG(%a6)
  3744. mov.l %d0,%d1
  3745. andi.l &0x00ff00ff,USER_FPSR(%a6)
  3746. clr.l %d0
  3747. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  3748. lea FP_SRC(%a6),%a0 # pass ptr to src
  3749. lea FP_DST(%a6),%a1 # pass ptr to dst
  3750. tst.b %d1
  3751. bne.b _L21_2d
  3752. bsr.l srem_snorm # operand is a NORM
  3753. bra.b _L21_6d
  3754. _L21_2d:
  3755. cmpi.b %d1,&ZERO # is operand a ZERO?
  3756. bne.b _L21_3d # no
  3757. bsr.l srem_szero # yes
  3758. bra.b _L21_6d
  3759. _L21_3d:
  3760. cmpi.b %d1,&INF # is operand an INF?
  3761. bne.b _L21_4d # no
  3762. bsr.l srem_sinf # yes
  3763. bra.b _L21_6d
  3764. _L21_4d:
  3765. cmpi.b %d1,&QNAN # is operand a QNAN?
  3766. bne.b _L21_5d # no
  3767. bsr.l sop_sqnan # yes
  3768. bra.b _L21_6d
  3769. _L21_5d:
  3770. bsr.l srem_sdnrm # operand is a DENORM
  3771. _L21_6d:
  3772. #
  3773. # Result is now in FP0
  3774. #
  3775. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  3776. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  3777. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  3778. unlk %a6
  3779. rts
  3780. global _fremx_
  3781. _fremx_:
  3782. link %a6,&-LOCAL_SIZE
  3783. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  3784. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  3785. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  3786. fmov.l &0x0,%fpcr # zero FPCR
  3787. #
  3788. # copy, convert, and tag input argument
  3789. #
  3790. lea FP_DST(%a6),%a0
  3791. mov.l 0x8+0x0(%a6),0x0(%a0) # load ext dst
  3792. mov.l 0x8+0x4(%a6),0x4(%a0)
  3793. mov.l 0x8+0x8(%a6),0x8(%a0)
  3794. bsr.l tag # fetch operand type
  3795. mov.b %d0,DTAG(%a6)
  3796. lea FP_SRC(%a6),%a0
  3797. mov.l 0x14+0x0(%a6),0x0(%a0) # load ext src
  3798. mov.l 0x14+0x4(%a6),0x4(%a0)
  3799. mov.l 0x14+0x8(%a6),0x8(%a0)
  3800. bsr.l tag # fetch operand type
  3801. mov.b %d0,STAG(%a6)
  3802. mov.l %d0,%d1
  3803. andi.l &0x00ff00ff,USER_FPSR(%a6)
  3804. clr.l %d0
  3805. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  3806. lea FP_SRC(%a6),%a0 # pass ptr to src
  3807. lea FP_DST(%a6),%a1 # pass ptr to dst
  3808. tst.b %d1
  3809. bne.b _L21_2x
  3810. bsr.l srem_snorm # operand is a NORM
  3811. bra.b _L21_6x
  3812. _L21_2x:
  3813. cmpi.b %d1,&ZERO # is operand a ZERO?
  3814. bne.b _L21_3x # no
  3815. bsr.l srem_szero # yes
  3816. bra.b _L21_6x
  3817. _L21_3x:
  3818. cmpi.b %d1,&INF # is operand an INF?
  3819. bne.b _L21_4x # no
  3820. bsr.l srem_sinf # yes
  3821. bra.b _L21_6x
  3822. _L21_4x:
  3823. cmpi.b %d1,&QNAN # is operand a QNAN?
  3824. bne.b _L21_5x # no
  3825. bsr.l sop_sqnan # yes
  3826. bra.b _L21_6x
  3827. _L21_5x:
  3828. bsr.l srem_sdnrm # operand is a DENORM
  3829. _L21_6x:
  3830. #
  3831. # Result is now in FP0
  3832. #
  3833. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  3834. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  3835. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  3836. unlk %a6
  3837. rts
  3838. #########################################################################
  3839. # DYADIC TEMPLATE #
  3840. #########################################################################
  3841. global _fmods_
  3842. _fmods_:
  3843. link %a6,&-LOCAL_SIZE
  3844. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  3845. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  3846. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  3847. fmov.l &0x0,%fpcr # zero FPCR
  3848. #
  3849. # copy, convert, and tag input argument
  3850. #
  3851. fmov.s 0x8(%a6),%fp0 # load sgl dst
  3852. fmov.x %fp0,FP_DST(%a6)
  3853. lea FP_DST(%a6),%a0
  3854. bsr.l tag # fetch operand type
  3855. mov.b %d0,DTAG(%a6)
  3856. fmov.s 0xc(%a6),%fp0 # load sgl src
  3857. fmov.x %fp0,FP_SRC(%a6)
  3858. lea FP_SRC(%a6),%a0
  3859. bsr.l tag # fetch operand type
  3860. mov.b %d0,STAG(%a6)
  3861. mov.l %d0,%d1
  3862. andi.l &0x00ff00ff,USER_FPSR(%a6)
  3863. clr.l %d0
  3864. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  3865. lea FP_SRC(%a6),%a0 # pass ptr to src
  3866. lea FP_DST(%a6),%a1 # pass ptr to dst
  3867. tst.b %d1
  3868. bne.b _L22_2s
  3869. bsr.l smod_snorm # operand is a NORM
  3870. bra.b _L22_6s
  3871. _L22_2s:
  3872. cmpi.b %d1,&ZERO # is operand a ZERO?
  3873. bne.b _L22_3s # no
  3874. bsr.l smod_szero # yes
  3875. bra.b _L22_6s
  3876. _L22_3s:
  3877. cmpi.b %d1,&INF # is operand an INF?
  3878. bne.b _L22_4s # no
  3879. bsr.l smod_sinf # yes
  3880. bra.b _L22_6s
  3881. _L22_4s:
  3882. cmpi.b %d1,&QNAN # is operand a QNAN?
  3883. bne.b _L22_5s # no
  3884. bsr.l sop_sqnan # yes
  3885. bra.b _L22_6s
  3886. _L22_5s:
  3887. bsr.l smod_sdnrm # operand is a DENORM
  3888. _L22_6s:
  3889. #
  3890. # Result is now in FP0
  3891. #
  3892. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  3893. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  3894. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  3895. unlk %a6
  3896. rts
  3897. global _fmodd_
  3898. _fmodd_:
  3899. link %a6,&-LOCAL_SIZE
  3900. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  3901. fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs
  3902. fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1
  3903. fmov.l &0x0,%fpcr # zero FPCR
  3904. #
  3905. # copy, convert, and tag input argument
  3906. #
  3907. fmov.d 0x8(%a6),%fp0 # load dbl dst
  3908. fmov.x %fp0,FP_DST(%a6)
  3909. lea FP_DST(%a6),%a0
  3910. bsr.l tag # fetch operand type
  3911. mov.b %d0,DTAG(%a6)
  3912. fmov.d 0x10(%a6),%fp0 # load dbl src
  3913. fmov.x %fp0,FP_SRC(%a6)
  3914. lea FP_SRC(%a6),%a0
  3915. bsr.l tag # fetch operand type
  3916. mov.b %d0,STAG(%a6)
  3917. mov.l %d0,%d1
  3918. andi.l &0x00ff00ff,USER_FPSR(%a6)
  3919. clr.l %d0
  3920. mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec
  3921. lea FP_SRC(%a6),%a0 # pass ptr to src
  3922. lea FP_DST(%a6),%a1 # pass ptr to dst
  3923. tst.b %d1
  3924. bne.b _L22_2d
  3925. bsr.l smod_snorm # operand is a NORM
  3926. bra.b _L22_6d
  3927. _L22_2d:
  3928. cmpi.b %d1,&ZERO # is operand a ZERO?
  3929. bne.b _L22_3d # no
  3930. bsr.l smod_szero # yes
  3931. bra.b _L22_6d
  3932. _L22_3d:
  3933. cmpi.b %d1,&INF # is operand an INF?
  3934. bne.b _L22_4d # no
  3935. bsr.l smod_sinf # yes
  3936. bra.b _L22_6d
  3937. _L22_4d:
  3938. cmpi.b %d1,&QNAN # is operand a QNAN?
  3939. bne.b _L22_5d # no
  3940. bsr.l sop_sqnan # yes
  3941. bra.b _L22_6d
  3942. _L22_5d:
  3943. bsr.l smod_sdnrm # operand is a DENORM
  3944. _L22_6d:
  3945. #
  3946. # Result is now in FP0
  3947. #
  3948. movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1
  3949. fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs
  3950. fmovm.x EXC_FP1(%a6),&0x40 # restore fp1
  3951. unlk %a6
  3952. rts
  3953. global _fmodx_
  3954. _fmodx_:
  3955. link %a6,&-LOCAL_SIZE
  3956. movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1
  3957. fmovm.l