Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

471 lines
18 KiB

  1. ;//
  2. ;// INTEL CORPORATION PROPRIETARY INFORMATION
  3. ;// This software is supplied under the terms of a license agreement or
  4. ;// nondisclosure agreement with Intel Corporation and may not be copied
  5. ;// or disclosed except in accordance with the terms of that agreement.
  6. ;// Copyright (c) 2000 Intel Corporation. All Rights Reserved.
  7. ;//
  8. ;//
  9. ; log10_wmt.asm
  10. ;
  11. ; double log10(double);
  12. ;
  13. ; Initial version: 11/30/2000
  14. ;
  15. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  16. ;; This is a second implementation of the branch-free log10 function ;;
  17. ;; In this version, we use a trick to get the index j = 0,1,...,64 that ;;
  18. ;; does not require integer testing. By adding 2^(42)-1 (FP) to Y, the ;;
  19. ;; least 4 bits contains dob't cares and the 7 bits following that has ;;
  20. ;; the range 0 to 64. Hence obtaining, say, the 16 lsb and masking off ;;
  21. ;; everything except bit 4 through 10 gives the shifted index. ;;
  22. ;; This saves an integer shift as well. ;;
  23. ;; ;;
  24. ;; Another important feature is that we use the table of log(1/B) ;;
  25. ;; throughout. To ensure numerical accuracy, we only need to ensure that ;;
  26. ;; T(0)_hi = B(last)_hi, T(0)_lo = B(last)_lo. This ensures W_hi = 0 and ;;
  27. ;; W_lo = 0 exactly in the case of |X-1| <= 2^(-7). ;;
  28. ;; Finally, we do away with the need for extra-precision addition by the ;;
  29. ;; following observation. The three pieces at the end are ;;
  30. ;; A = W_hi + r_hi; B = r_lo; C = P + W_lo. ;;
  31. ;; When W_hi = W_lo = 0, the addition sequence (A+B) + C is accurate as ;;
  32. ;; the sum A+B is exact. ;;
  33. ;; Otherwise, A + (B+C) is accurate as B is going to be largely shifted ;;
  34. ;; off compared to the final result. ;;
  35. ;; Hence if we use compare and mask operations to ;;
  36. ;; create alpha = (r_lo or 0), beta = (0 or r_lo), Res_hi <- W_hi+alpha, ;;
  37. ;; Res_lo <- C + beta, then result is accurately computed as ;;
  38. ;; Res_hi+Res_lo. ;;
  39. ;; ;;
  40. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  41. .686P
  42. .387
  43. .XMM
  44. .MODEL FLAT,C
  45. EXTRN C __libm_error_support : NEAR
  46. CONST SEGMENT PARA PUBLIC USE32 'CONST'
  47. ALIGN 16
  48. emask DQ 000FFFFFFFFFFFFFH, 000FFFFFFFFFFFFFH ; mask off sign/expo field
  49. CC DQ 3FDBC00000000000H, 3FDBC00000000000H ; pair of C
  50. Magic DQ 428FFFFFFFFFF810H, 428FFFFFFFFFF810H ; 2^(42)-1+2^(-7)
  51. hi_mask DQ 7FFFFFFF80000000H, 7FFFFFFF80000000H ; maks of bottom 31 bits
  52. LOG10_2 DQ 3FD34413509F7800H, 3D1FEF311F12B358H ; L_hi,L_lo -> [L_lo|L_hi]
  53. place_L DQ 0000000000000000H,0FFFFFFFFFFFFFFFFH ; 0,1 -> [FF..FF|00..00]
  54. DQ 0FFFFFFFFFFFFFFFFH, 0000000000000000H ; 1,0 -> [00..00|FF..FF]
  55. One DQ 3ff0000000000000H, 3ff0000000000000H ; 1,1
  56. Zero DQ 0000000000000000H, 0000000000000000H ; 0,0
  57. Two52 DQ 4330000000000000H, 4330000000000000H ; 2^52 for normalization
  58. Infs DQ 0FFF0000000000000H, 7FF0000000000000H ; -inf,+inf --> [+inf|-inf]
  59. NaN DQ 7FF0000000000001H, 7FF0000000000001H ; NaN for log(-ve), log(Nan)
  60. coeff DQ 40358914C697CEF9H, 0C00893096429813DH ; p6,p3 ->[p3|p6]
  61. DQ 0C025C9806A358455H, 3FFC6A02DC9635D2H ; p5,p2 ->[p2|p5]
  62. DQ 4016AB9F7E1899F7H, 0BFF27AF2DC77B135H ; p4,p1 ->[p1|p4]
  63. DQ 3F5A7A6CBF2E4108H, 0000000000000000H ; p0,0 -> [0|p0]
  64. ;-------Table T_hi,T_lo so that movapd gives [ T_lo | T_hi ]
  65. T_Tbl DQ 0000000000000000H, 0000000000000000H
  66. DQ 3F7C03A80AE40000H, 3D3E05382D51F71BH
  67. DQ 3F8B579DB6DE0000H, 3D386B09FEFB3005H
  68. DQ 3F9470AEDE968000H, 3D39FC780C91E11DH
  69. DQ 3F9ADA2E8E3E0000H, 3D351BD19E6E701AH
  70. DQ 3FA0ADD8F759C000H, 3D1B2A51090000A1H
  71. DQ 3FA3FAF7C6630000H, 3D083662F181F53FH
  72. DQ 3FA7171E59EFC000H, 3D16BD1A3FCF54DBH
  73. DQ 3FAA3E9002C70000H, 3D21D257C8D0D386H
  74. DQ 3FAD32332DC34000H, 3D1B7ADBF8D9441FH
  75. DQ 3FB0281170D6A000H, 3D1BF38B28AF5076H
  76. DQ 3FB19C1FECF16000H, 3D3EE03F1E5355D4H
  77. DQ 3FB3151BFD65C000H, 3D37E280048C6795H
  78. DQ 3FB4932780C56000H, 3D2FC4ACCD62A5F3H
  79. DQ 3FB605735EE98000H, 3D17C3CF23A17D9FH
  80. DQ 3FB76B778D4AA000H, 3D1C03E812A06E7AH
  81. DQ 3FB8D60B4EE4C000H, 3D3900E5CC4E4C82H
  82. DQ 3FBA33B422244000H, 3D36F17034675735H
  83. DQ 3FBB95B654A78000H, 3D290E5E24764EC7H
  84. DQ 3FBCEA2602E9E000H, 3CEBD129822ECBCBH
  85. DQ 3FBE42B4C16CA000H, 3D25E50FF38D4DE9H
  86. DQ 3FBF8D05B16A6000H, 3D2A8EA5A2B777A7H
  87. DQ 3FC06D9BC53C2000H, 3D32818DEEE1FA45H
  88. DQ 3FC10D3EACDE0000H, 3D1E8A45CB83F0AEH
  89. DQ 3FC1B83F1574D000H, 3D010B19F193FFD4H
  90. DQ 3FC251FE054FD000H, 3CFEAC09402877C0H
  91. DQ 3FC2F7301CF4E000H, 3D30F5C70D1A6341H
  92. DQ 3FC394700F795000H, 3D1FE93F791A7264H
  93. DQ 3FC4297453B4A000H, 3D3ECE09C5BC4B34H
  94. DQ 3FC4CA24FAFEC000H, 3D2E204342E66851H
  95. DQ 3FC5627512093000H, 3D30DFECB3AA172DH
  96. DQ 3FC5F21A1AF60000H, 3D3FEF1B2D3E6113H
  97. DQ 3FC68DA216900000H, 3CED942CFC9699D0H
  98. DQ 3FC720586C280000H, 3D3D20A8624054CDH
  99. DQ 3FC7B495FF1C5000H, 3D25012C689133C5H
  100. DQ 3FC83FA266CEA000H, 3D20C6C18687239FH
  101. DQ 3FC8CC0E0C56F000H, 3D36E3B4A1CFA0DFH
  102. DQ 3FC959DFEFE7D000H, 3D2420027AFFE0E5H
  103. DQ 3FC9E91F47D2C000H, 3D35330E6CF22420H
  104. DQ 3FCA6EA48B034000H, 3D33EBACB92B5B7FH
  105. DQ 3FCB00B7C552F000H, 3D3DF4694C64AA73H
  106. DQ 3FCB88E67CF97000H, 3D32FF232278A072H
  107. DQ 3FCC06E3BA2E4000H, 3D32CB15CD55BD7CH
  108. DQ 3FCC919DD46C0000H, 3D0EB64694E6AC72H
  109. DQ 3FCD11FB61139000H, 3D1A34DB91AE960BH
  110. DQ 3FCD9F59ABFD1000H, 3D207B23BCD76C73H
  111. DQ 3FCE163D527E6000H, 3D319D69F22E93E4H
  112. DQ 3FCE9A2CDC02A000H, 3D20EBF59081F187H
  113. DQ 3FCF1F5876949000H, 3D07AFEBEA179000H
  114. DQ 3FCF99801FDB7000H, 3D22737DF7F29668H
  115. DQ 3FD00A5B4509D000H, 3D1F6B5B2353257FH
  116. DQ 3FD0488037FBE800H, 3D1B6A93B9B912C6H
  117. DQ 3FD087315621A800H, 3D3261DA7DBFF3AEH
  118. DQ 3FD0C6711D6AB800H, 3D35E94A8D30C132H
  119. DQ 3FD0FFD9CDD2A800H, 3D16350EF6F19D80H
  120. DQ 3FD1402FBEC27800H, 3D313C204222BA8BH
  121. DQ 3FD17A9719699000H, 3D21F279212D5C99H
  122. DQ 3FD1B57A30AC5800H, 3D3DCF3E62FF847EH
  123. DQ 3FD1F0DB153AB800H, 3D27582E230C0EDFH
  124. DQ 3FD2260E4F424800H, 3D157E1028A41FF9H
  125. DQ 3FD26262A6117800H, 3D12B01A2E0C1912H
  126. DQ 3FD29871C043D800H, 3D2B3969AC9E3779H
  127. DQ 3FD2D5C1760B8000H, 3D3AEADEBE0F08BFH
  128. DQ 3FD30CB3A7BB3000H, 3D38929919B6D832H
  129. DQ 3FD34413509F7800H, 3D1FEF311F12B358H
  130. ;-----------------
  131. CB_Tbl DQ 3FDBC00000000000H, 3FDBC00000000000H
  132. DQ 3FDB510000000000H, 3FDB510000000000H
  133. DQ 3FDAE8F000000000H, 3FDAE8F000000000H
  134. DQ 3FDA80E000000000H, 3FDA80E000000000H
  135. DQ 3FDA1FC000000000H, 3FDA1FC000000000H
  136. DQ 3FD9BEA000000000H, 3FD9BEA000000000H
  137. DQ 3FD95D8000000000H, 3FD95D8000000000H
  138. DQ 3FD9035000000000H, 3FD9035000000000H
  139. DQ 3FD8A92000000000H, 3FD8A92000000000H
  140. DQ 3FD855E000000000H, 3FD855E000000000H
  141. DQ 3FD7FF2800000000H, 3FD7FF2800000000H
  142. DQ 3FD7AF6000000000H, 3FD7AF6000000000H
  143. DQ 3FD75F9800000000H, 3FD75F9800000000H
  144. DQ 3FD70FD000000000H, 3FD70FD000000000H
  145. DQ 3FD6C38000000000H, 3FD6C38000000000H
  146. DQ 3FD67AA800000000H, 3FD67AA800000000H
  147. DQ 3FD631D000000000H, 3FD631D000000000H
  148. DQ 3FD5EC7000000000H, 3FD5EC7000000000H
  149. DQ 3FD5A71000000000H, 3FD5A71000000000H
  150. DQ 3FD5652800000000H, 3FD5652800000000H
  151. DQ 3FD5234000000000H, 3FD5234000000000H
  152. DQ 3FD4E4D000000000H, 3FD4E4D000000000H
  153. DQ 3FD4A66000000000H, 3FD4A66000000000H
  154. DQ 3FD46B6800000000H, 3FD46B6800000000H
  155. DQ 3FD42CF800000000H, 3FD42CF800000000H
  156. DQ 3FD3F57800000000H, 3FD3F57800000000H
  157. DQ 3FD3BA8000000000H, 3FD3BA8000000000H
  158. DQ 3FD3830000000000H, 3FD3830000000000H
  159. DQ 3FD34EF800000000H, 3FD34EF800000000H
  160. DQ 3FD3177800000000H, 3FD3177800000000H
  161. DQ 3FD2E37000000000H, 3FD2E37000000000H
  162. DQ 3FD2B2E000000000H, 3FD2B2E000000000H
  163. DQ 3FD27ED800000000H, 3FD27ED800000000H
  164. DQ 3FD24E4800000000H, 3FD24E4800000000H
  165. DQ 3FD21DB800000000H, 3FD21DB800000000H
  166. DQ 3FD1F0A000000000H, 3FD1F0A000000000H
  167. DQ 3FD1C38800000000H, 3FD1C38800000000H
  168. DQ 3FD1967000000000H, 3FD1967000000000H
  169. DQ 3FD1695800000000H, 3FD1695800000000H
  170. DQ 3FD13FB800000000H, 3FD13FB800000000H
  171. DQ 3FD112A000000000H, 3FD112A000000000H
  172. DQ 3FD0E90000000000H, 3FD0E90000000000H
  173. DQ 3FD0C2D800000000H, 3FD0C2D800000000H
  174. DQ 3FD0993800000000H, 3FD0993800000000H
  175. DQ 3FD0731000000000H, 3FD0731000000000H
  176. DQ 3FD0497000000000H, 3FD0497000000000H
  177. DQ 3FD026C000000000H, 3FD026C000000000H
  178. DQ 3FD0009800000000H, 3FD0009800000000H
  179. DQ 3FCFB4E000000000H, 3FCFB4E000000000H
  180. DQ 3FCF6F8000000000H, 3FCF6F8000000000H
  181. DQ 3FCF2A2000000000H, 3FCF2A2000000000H
  182. DQ 3FCEE4C000000000H, 3FCEE4C000000000H
  183. DQ 3FCE9F6000000000H, 3FCE9F6000000000H
  184. DQ 3FCE5A0000000000H, 3FCE5A0000000000H
  185. DQ 3FCE1B9000000000H, 3FCE1B9000000000H
  186. DQ 3FCDD63000000000H, 3FCDD63000000000H
  187. DQ 3FCD97C000000000H, 3FCD97C000000000H
  188. DQ 3FCD595000000000H, 3FCD595000000000H
  189. DQ 3FCD1AE000000000H, 3FCD1AE000000000H
  190. DQ 3FCCE36000000000H, 3FCCE36000000000H
  191. DQ 3FCCA4F000000000H, 3FCCA4F000000000H
  192. DQ 3FCC6D7000000000H, 3FCC6D7000000000H
  193. DQ 3FCC2F0000000000H, 3FCC2F0000000000H
  194. DQ 3FCBF78000000000H, 3FCBF78000000000H
  195. DQ 3FCBC00000000000H, 3FCBC00000000000H
  196. ALIGN 16
  197. CONST ENDS
  198. $cmpsd MACRO op1, op2, op3
  199. LOCAL begin_cmpsd, end_cmpsd
  200. begin_cmpsd:
  201. cmppd op1, op2, op3
  202. end_cmpsd:
  203. org begin_cmpsd
  204. db 0F2h
  205. org end_cmpsd
  206. ENDM
  207. _TEXT SEGMENT PARA PUBLIC USE32 'CODE'
  208. ALIGN 16
  209. PUBLIC _log10_pentium4, _CIlog10_pentium4
  210. _CIlog10_pentium4 PROC NEAR
  211. push ebp
  212. mov ebp, esp
  213. sub esp, 8 ; for argument DBLSIZE
  214. and esp, 0fffffff0h
  215. fstp qword ptr [esp]
  216. movq xmm0, qword ptr [esp]
  217. call start
  218. leave
  219. ret
  220. ;----------------------;
  221. ;--Argument Reduction--;
  222. ;----------------------;
  223. _log10_pentium4 label proc
  224. movlpd xmm0, QWORD PTR [4+esp] ;... load X to low part of xmm0
  225. start:
  226. mov edx,0 ;... set edx to 0
  227. DENORMAL_RETRY:
  228. movapd xmm5,xmm0
  229. unpcklpd xmm0,xmm0 ;... [X|X]
  230. psrlq xmm5,52
  231. pextrw ecx,xmm5,0
  232. movapd xmm1, QWORD PTR [emask] ;... pair of 000FF...FF
  233. movapd xmm2, QWORD PTR [CC] ;... pair of CC
  234. movapd xmm3, QWORD PTR [One] ;... pair of 3FF000...000
  235. movapd xmm4, QWORD PTR [Magic] ;... pair of 2^(42)-1+2^(-7)
  236. movapd xmm6, QWORD PTR [hi_mask] ;... pair of 7FFFFFFF8000..00
  237. andpd xmm0,xmm1
  238. orpd xmm0,xmm3 ;... [Y|Y]
  239. addpd xmm4,xmm0 ;... 11 lsb contains the index to CB
  240. ;... the last 4 lsb are don't cares, the
  241. ;... 7 bits following that is the index
  242. ;... Hence by masking, we already have index*16
  243. pextrw eax,xmm4,0
  244. and eax,000007F0H ;... eax is offset
  245. movapd xmm4, QWORD PTR [eax+CB_Tbl] ;... [CB|CB]
  246. movapd xmm7, QWORD PTR [eax+T_Tbl]
  247. andpd xmm6,xmm0 ;... [Y_hi|Y_hi]
  248. subpd xmm0,xmm6 ;... [Y_lo|Y_lo]
  249. mulpd xmm6,xmm4 ;... [CB*Y_hi|CB*Y_hi]
  250. subpd xmm6,xmm2 ;... [R_hi|R_hi]
  251. addsd xmm7,xmm6 ;... [T_lo|T_hi+R_hi]
  252. mulpd xmm0,xmm4 ;... [R_lo|R_lo]
  253. movapd xmm4,xmm0 ;... [R_lo|R_lo]
  254. addpd xmm0,xmm6 ;... [R|R]
  255. ;-----------------------------------------;
  256. ;--Approx and Reconstruction in parallel--;
  257. ;-----------------------------------------;
  258. ;...m is in ecx, [T_lo,T_hi+R_hi] in xmm7
  259. ;...xmm4 through xmm6 will be used
  260. and ecx,00000FFFH ;... note we need sign and biased exponent
  261. sub ecx,1
  262. cmp ecx,2045 ;... the largest biased exponent 2046-1
  263. ;... if ecx is ABOVE (unsigned) this, either
  264. ;... the sign is +ve and biased exponent is 7FF
  265. ;... or the sign is +ve and exponent is 0, or
  266. ;... the sign is -ve (i.e. sign bit 1)
  267. ja SPECIAL_CASES
  268. sub ecx,1022 ;... m in integer format
  269. add ecx,edx ;... this is the denormal adjustment
  270. cvtsi2sd xmm6,ecx
  271. unpcklpd xmm6,xmm6 ;... [m | m] in FP format
  272. shl ecx,10
  273. add eax,ecx ;16*(64*m + j) 0 <=> (m=-1 & j=64) or (m=0 & j=0)
  274. mov ecx,16
  275. mov edx,0
  276. cmp eax,0
  277. cmove edx,ecx ;this is the index into the mask table (place_{L,R})
  278. movapd xmm1, QWORD PTR [coeff] ;... loading [p3|p6]
  279. movapd xmm3,xmm0
  280. movapd xmm2, QWORD PTR [coeff+16] ;... loading [p2|p5]
  281. mulpd xmm1,xmm0 ;... [p3 R | p6 R]
  282. mulpd xmm3,xmm3 ;... [R^2|R^2]
  283. addpd xmm1,xmm2 ;... [p2+p3 R |p5+p6 R]
  284. movapd xmm2, QWORD PTR [coeff+32] ;... [p1|p4]
  285. mulsd xmm3,xmm3 ;... [R^2|R^4]
  286. movapd xmm5, QWORD PTR [LOG10_2] ;... loading [L_lo|L_hi]
  287. ;... [T_lo|T_hi+R_hi] already in xmm7
  288. mulpd xmm6,xmm5 ;... [m L_lo | m L_hi]
  289. movapd xmm5, QWORD PTR [edx+place_L] ;... [FF..FF|00.00] or [00..00|FF..FF]
  290. andpd xmm4,xmm5 ;... [R_lo|0] or [0|R_lo]
  291. addpd xmm7,xmm6 ;... [W_lo|W_hi]
  292. addpd xmm7,xmm4 ;... [A_lo|A_hi]
  293. mulpd xmm1,xmm0 ;... [p2 R+p3 R^2|p5 R+p6 R^2]
  294. mulsd xmm3,xmm0 ;... [R^2|R^5]
  295. addpd xmm1,xmm2 ;... [p1+.. | p4+...]
  296. movapd xmm2, QWORD PTR [coeff+48] ;... [0|p0]
  297. mulpd xmm2,xmm0 ;... [0|p0 R]
  298. movapd xmm6,xmm7
  299. unpckhpd xmm6,xmm6 ;... [*|A_lo]
  300. mulpd xmm1,xmm3 ;... [P_hi|P_lo]
  301. sub esp, 16
  302. movapd xmm0,xmm1 ;... copy of [P_hi|P_lo]
  303. addpd xmm1,xmm2 ;... [P_hi|P_lo]
  304. unpckhpd xmm0,xmm0 ;... [P_hi|P_hi]
  305. ;...[P_hi|P_lo] in xmm1 at this point
  306. addsd xmm0,xmm1 ;... [*|P]
  307. addsd xmm0,xmm6
  308. addsd xmm0,xmm7
  309. movlpd QWORD PTR [esp+4], xmm0 ; return result
  310. fld QWORD PTR [esp+4] ;
  311. add esp, 16
  312. ret
  313. SPECIAL_CASES:
  314. movlpd xmm0, QWORD PTR [4+esp] ;... load X again
  315. movapd xmm1, QWORD PTR [Zero]
  316. $cmpsd xmm1,xmm0,0
  317. pextrw eax,xmm1,0 ;... ones if X = +-0.0
  318. cmp eax,0
  319. ja INPUT_ZERO
  320. cmp ecx,-1 ;... ecx = -1 iff X is positive denormal
  321. je INPUT_DENORM
  322. cmp ecx,000007FEH
  323. ja INPUT_NEGATIVE
  324. movlpd xmm0, QWORD PTR [4+esp]
  325. movapd xmm1, QWORD PTR [emask]
  326. movapd xmm2, QWORD PTR [One]
  327. andpd xmm0,xmm1
  328. orpd xmm0,xmm2 ;... xmm0 is 1 iff the input argument was +inf
  329. $cmpsd xmm2,xmm0,0
  330. pextrw eax,xmm2,0 ;... 0 if X is NaN
  331. cmp eax, 0
  332. je INPUT_NaN
  333. INPUT_INF:
  334. ;....Input is +Inf
  335. fld QWORD PTR [Infs+8] ;
  336. ret
  337. INPUT_NaN:
  338. ; movlpd xmm0, [esp+4]
  339. ; addsd xmm0, xmm0
  340. ; sub esp, 16
  341. ; movlpd [esp+4], xmm0
  342. ; fld QWORD PTR [esp+4]
  343. ; add esp, 16
  344. ; ret
  345. mov edx, 1001
  346. jmp CALL_LIBM_ERROR
  347. INPUT_ZERO:
  348. ; raise Divide by Zero
  349. movlpd xmm2, QWORD PTR [One]
  350. divsd xmm2, xmm0
  351. movlpd xmm1, QWORD PTR [Infs]
  352. mov edx, 8
  353. jmp CALL_LIBM_ERROR
  354. INPUT_DENORM:
  355. ;....check for zero or denormal
  356. ;....for now I assume this is simply denormal
  357. ;....in reality, we need to check for zero and handle appropriately
  358. movlpd xmm1,Two52
  359. mulsd xmm0,xmm1
  360. mov edx,-52 ;...set adjustment to exponent
  361. jmp DENORMAL_RETRY ;...branch back
  362. INPUT_NEGATIVE:
  363. add ecx,1
  364. and ecx, 7ffH
  365. cmp ecx, 7ffH
  366. jae NEG_INF_NAN
  367. NEG_NORMAL_INFINITY:
  368. ; xmm1=0
  369. xorpd xmm1, xmm1
  370. ; raise Invalid
  371. divsd xmm1, xmm1
  372. mov edx, 9
  373. CALL_LIBM_ERROR:
  374. ;call libm_error_support(void *arg1,void *arg2,void *retval,error_types input_tag)
  375. sub esp, 28
  376. movlpd QWORD PTR [esp+16], xmm1
  377. mov DWORD PTR [esp+12],edx
  378. mov edx, esp
  379. add edx,16
  380. mov DWORD PTR [esp+8],edx
  381. add edx,16
  382. mov DWORD PTR [esp+4],edx
  383. mov DWORD PTR [esp],edx
  384. call NEAR PTR __libm_error_support
  385. fld QWORD PTR [esp+16] ;
  386. add esp,28
  387. ret
  388. NEG_INF_NAN:
  389. movlpd xmm2, QWORD PTR [esp+4]
  390. movlpd xmm0, QWORD PTR [esp+4]
  391. movd eax, xmm2
  392. psrlq xmm2, 32
  393. movd ecx, xmm2
  394. and ecx, 0fffffH ; eliminate sign/exponent
  395. or eax, ecx
  396. cmp eax,0
  397. jz NEG_NORMAL_INFINITY ; negative infinity
  398. ; addsd xmm0, xmm0
  399. ; sub esp,16
  400. ; movlpd QWORD PTR [esp+4], xmm0
  401. ; fld QWORD PTR [esp+4]
  402. ; add esp, 16
  403. ; ret
  404. mov edx, 1001
  405. jmp CALL_LIBM_ERROR
  406. _CIlog10_pentium4 ENDP
  407. ALIGN 16
  408. _TEXT ENDS
  409. END