fpclassify.S 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465
  1. /*
  2. * Math library
  3. *
  4. * Copyright (C) 2016 Intel Corporation. All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. *
  10. * * Redistributions of source code must retain the above copyright
  11. * notice, this list of conditions and the following disclaimer.
  12. * * Redistributions in binary form must reproduce the above copyright
  13. * notice, this list of conditions and the following disclaimer in
  14. * the documentation and/or other materials provided with the
  15. * distribution.
  16. * * Neither the name of Intel Corporation nor the names of its
  17. * contributors may be used to endorse or promote products derived
  18. * from this software without specific prior written permission.
  19. *
  20. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  21. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  22. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  23. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  24. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  25. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  26. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  27. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  28. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  29. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  30. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  31. *
  32. *
  33. * Author Name <jingwei.zhang@intel.com>
  34. * History:
  35. * 03-14-2016 Initial version. numerics svn rev. 12864
  36. */
  37. .file "fpclassify.c"
  38. .text
  39. ..TXTST0:
  40. # -- Begin __fpclassifyd
  41. .text
  42. .align 16,0x90
  43. .globl __fpclassifyd
  44. __fpclassifyd:
  45. # parameter 1: 4 + %esp
  46. ..B1.1:
  47. ..L1:
  48. fldl 4(%esp)
  49. fwait
  50. fstp %st(0)
  51. movl 8(%esp), %edx
  52. andl $2147483647, %edx
  53. movl 4(%esp), %ecx
  54. cmpl $2146435072, %edx
  55. jb ..B1.6
  56. ..B1.2:
  57. movl $2146435072, %eax
  58. subl %eax, %edx
  59. jb ..B1.4
  60. ..B1.14:
  61. orl %edx, %ecx
  62. je ..B1.4
  63. ..B1.3:
  64. xorl %eax, %eax
  65. ret
  66. ..B1.4:
  67. movl $1, %eax
  68. ..B1.5:
  69. ret
  70. ..B1.6:
  71. cmpl $1048576, %edx
  72. jae ..B1.11
  73. ..B1.7:
  74. orl %edx, %ecx
  75. je ..B1.9
  76. ..B1.8:
  77. movl $3, %eax
  78. ret
  79. ..B1.9:
  80. movl $2, %eax
  81. ..B1.10:
  82. ret
  83. ..B1.11:
  84. movl $4, %eax
  85. ret
  86. .align 16,0x90
  87. .type __fpclassifyd,@function
  88. .size __fpclassifyd,.-__fpclassifyd
  89. .data
  90. # -- End __fpclassifyd
  91. .text
  92. # -- Begin fpclassifyd
  93. .text
  94. .align 16,0x90
  95. .globl fpclassifyd
  96. fpclassifyd:
  97. # parameter 1: 4 + %esp
  98. ..B2.1:
  99. ..L2:
  100. fldl 4(%esp)
  101. fwait
  102. fstp %st(0)
  103. movl 8(%esp), %edx
  104. andl $2147483647, %edx
  105. movl 4(%esp), %ecx
  106. cmpl $2146435072, %edx
  107. jb ..B2.6
  108. ..B2.2:
  109. movl $2146435072, %eax
  110. subl %eax, %edx
  111. jb ..B2.4
  112. ..B2.14:
  113. orl %edx, %ecx
  114. je ..B2.4
  115. ..B2.3:
  116. xorl %eax, %eax
  117. ret
  118. ..B2.4:
  119. movl $1, %eax
  120. ..B2.5:
  121. ret
  122. ..B2.6:
  123. cmpl $1048576, %edx
  124. jae ..B2.11
  125. ..B2.7:
  126. orl %edx, %ecx
  127. je ..B2.9
  128. ..B2.8:
  129. movl $3, %eax
  130. ret
  131. ..B2.9:
  132. movl $2, %eax
  133. ..B2.10:
  134. ret
  135. ..B2.11:
  136. movl $4, %eax
  137. ret
  138. .align 16,0x90
  139. .type fpclassifyd,@function
  140. .size fpclassifyd,.-fpclassifyd
  141. .data
  142. # -- End fpclassifyd
  143. .text
  144. # -- Begin __fpclassify
  145. .text
  146. .align 16,0x90
  147. .globl __fpclassify
  148. __fpclassify:
  149. # parameter 1: 4 + %esp
  150. ..B3.1:
  151. ..L3:
  152. fldl 4(%esp)
  153. fwait
  154. fstp %st(0)
  155. movl 8(%esp), %edx
  156. andl $2147483647, %edx
  157. movl 4(%esp), %ecx
  158. cmpl $2146435072, %edx
  159. jb ..B3.6
  160. ..B3.2:
  161. movl $2146435072, %eax
  162. subl %eax, %edx
  163. jb ..B3.4
  164. ..B3.14:
  165. orl %edx, %ecx
  166. je ..B3.4
  167. ..B3.3:
  168. xorl %eax, %eax
  169. ret
  170. ..B3.4:
  171. movl $1, %eax
  172. ..B3.5:
  173. ret
  174. ..B3.6:
  175. cmpl $1048576, %edx
  176. jae ..B3.11
  177. ..B3.7:
  178. orl %edx, %ecx
  179. je ..B3.9
  180. ..B3.8:
  181. movl $3, %eax
  182. ret
  183. ..B3.9:
  184. movl $2, %eax
  185. ..B3.10:
  186. ret
  187. ..B3.11:
  188. movl $4, %eax
  189. ret
  190. .align 16,0x90
  191. .type __fpclassify,@function
  192. .size __fpclassify,.-__fpclassify
  193. .data
  194. # -- End __fpclassify
  195. .text
  196. # -- Begin fpclassify
  197. .text
  198. .align 16,0x90
  199. .globl fpclassify
  200. fpclassify:
  201. # parameter 1: 4 + %esp
  202. ..B4.1:
  203. ..L4:
  204. fldl 4(%esp)
  205. fwait
  206. fstp %st(0)
  207. movl 8(%esp), %edx
  208. andl $2147483647, %edx
  209. movl 4(%esp), %ecx
  210. cmpl $2146435072, %edx
  211. jb ..B4.6
  212. ..B4.2:
  213. movl $2146435072, %eax
  214. subl %eax, %edx
  215. jb ..B4.4
  216. ..B4.14:
  217. orl %edx, %ecx
  218. je ..B4.4
  219. ..B4.3:
  220. xorl %eax, %eax
  221. ret
  222. ..B4.4:
  223. movl $1, %eax
  224. ..B4.5:
  225. ret
  226. ..B4.6:
  227. cmpl $1048576, %edx
  228. jae ..B4.11
  229. ..B4.7:
  230. orl %edx, %ecx
  231. je ..B4.9
  232. ..B4.8:
  233. movl $3, %eax
  234. ret
  235. ..B4.9:
  236. movl $2, %eax
  237. ..B4.10:
  238. ret
  239. ..B4.11:
  240. movl $4, %eax
  241. ret
  242. .align 16,0x90
  243. .type fpclassify,@function
  244. .size fpclassify,.-fpclassify
  245. .data
  246. # -- End fpclassify
  247. .text
  248. # -- Begin __fpclassifyf
  249. .text
  250. .align 16,0x90
  251. .globl __fpclassifyf
  252. __fpclassifyf:
  253. # parameter 1: 4 + %esp
  254. ..B5.1:
  255. ..L5:
  256. flds 4(%esp)
  257. fwait
  258. fstp %st(0)
  259. movl 4(%esp), %edx
  260. andl $2147483647, %edx
  261. cmpl $2139095040, %edx
  262. jb ..B5.3
  263. ..B5.2:
  264. movl $0, %eax
  265. setbe %al
  266. ret
  267. ..B5.3:
  268. cmpl $8388608, %edx
  269. jae ..B5.5
  270. ..B5.4:
  271. testl %edx, %edx
  272. movl $0, %eax
  273. setne %al
  274. addl $2, %eax
  275. ret
  276. ..B5.5:
  277. movl $4, %eax
  278. ret
  279. .align 16,0x90
  280. .type __fpclassifyf,@function
  281. .size __fpclassifyf,.-__fpclassifyf
  282. .data
  283. # -- End __fpclassifyf
  284. .text
  285. # -- Begin fpclassifyf
  286. .text
  287. .align 16,0x90
  288. .globl fpclassifyf
  289. fpclassifyf:
  290. # parameter 1: 4 + %esp
  291. ..B6.1:
  292. ..L6:
  293. flds 4(%esp)
  294. fwait
  295. fstp %st(0)
  296. movl 4(%esp), %edx
  297. andl $2147483647, %edx
  298. cmpl $2139095040, %edx
  299. jb ..B6.3
  300. ..B6.2:
  301. movl $0, %eax
  302. setbe %al
  303. ret
  304. ..B6.3:
  305. cmpl $8388608, %edx
  306. jae ..B6.5
  307. ..B6.4:
  308. testl %edx, %edx
  309. movl $0, %eax
  310. setne %al
  311. addl $2, %eax
  312. ret
  313. ..B6.5:
  314. movl $4, %eax
  315. ret
  316. .align 16,0x90
  317. .type fpclassifyf,@function
  318. .size fpclassifyf,.-fpclassifyf
  319. .data
  320. # -- End fpclassifyf
  321. .text
  322. # -- Begin __fpclassifyl
  323. .text
  324. .align 16,0x90
  325. .globl __fpclassifyl
  326. __fpclassifyl:
  327. # parameter 1: 8 + %esp
  328. ..B7.1:
  329. ..L7:
  330. pushl %ebx
  331. movzwl 16(%esp), %ecx
  332. andl $32767, %ecx
  333. movl 12(%esp), %ebx
  334. movl %ecx, %eax
  335. movl %ebx, %edx
  336. shll $16, %eax
  337. shrl $16, %edx
  338. orl %edx, %eax
  339. cmpl $2147418112, %eax
  340. jb ..B7.5
  341. ..B7.2:
  342. cmpl $32767, %ecx
  343. je ..B7.12
  344. ..B7.3:
  345. xorl %eax, %eax
  346. ..B7.4:
  347. popl %ebx
  348. ret
  349. ..B7.5:
  350. cmpl $65536, %eax
  351. jae ..B7.11
  352. ..B7.6:
  353. testl %ebx, %ebx
  354. jne ..B7.8
  355. ..B7.7:
  356. cmpl $0, 8(%esp)
  357. je ..B7.9
  358. ..B7.8:
  359. movl $3, %eax
  360. popl %ebx
  361. ret
  362. ..B7.9:
  363. movl $2, %eax
  364. ..B7.10:
  365. popl %ebx
  366. ret
  367. ..B7.11:
  368. andl $32768, %eax
  369. shrl $15, %eax
  370. addl $3, %eax
  371. popl %ebx
  372. ret
  373. ..B7.12:
  374. cmpl $-2147483648, %ebx
  375. jne ..B7.3
  376. ..B7.13:
  377. cmpl $0, 8(%esp)
  378. jne ..B7.3
  379. ..B7.14:
  380. movl $1, %eax
  381. popl %ebx
  382. ret
  383. .align 16,0x90
  384. .type __fpclassifyl,@function
  385. .size __fpclassifyl,.-__fpclassifyl
  386. .data
  387. # -- End __fpclassifyl
  388. .text
  389. # -- Begin fpclassifyl
  390. .text
  391. .align 16,0x90
  392. .globl fpclassifyl
  393. fpclassifyl:
  394. # parameter 1: 8 + %esp
  395. ..B8.1:
  396. ..L8:
  397. pushl %ebx
  398. movzwl 16(%esp), %ecx
  399. andl $32767, %ecx
  400. movl 12(%esp), %ebx
  401. movl %ecx, %eax
  402. movl %ebx, %edx
  403. shll $16, %eax
  404. shrl $16, %edx
  405. orl %edx, %eax
  406. cmpl $2147418112, %eax
  407. jb ..B8.5
  408. ..B8.2:
  409. cmpl $32767, %ecx
  410. je ..B8.12
  411. ..B8.3:
  412. xorl %eax, %eax
  413. ..B8.4:
  414. popl %ebx
  415. ret
  416. ..B8.5:
  417. cmpl $65536, %eax
  418. jae ..B8.11
  419. ..B8.6:
  420. testl %ebx, %ebx
  421. jne ..B8.8
  422. ..B8.7:
  423. cmpl $0, 8(%esp)
  424. je ..B8.9
  425. ..B8.8:
  426. movl $3, %eax
  427. popl %ebx
  428. ret
  429. ..B8.9:
  430. movl $2, %eax
  431. ..B8.10:
  432. popl %ebx
  433. ret
  434. ..B8.11:
  435. andl $32768, %eax
  436. shrl $15, %eax
  437. addl $3, %eax
  438. popl %ebx
  439. ret
  440. ..B8.12:
  441. cmpl $-2147483648, %ebx
  442. jne ..B8.3
  443. ..B8.13:
  444. cmpl $0, 8(%esp)
  445. jne ..B8.3
  446. ..B8.14:
  447. movl $1, %eax
  448. popl %ebx
  449. ret
  450. .align 16,0x90
  451. .type fpclassifyl,@function
  452. .size fpclassifyl,.-fpclassifyl
  453. .data
  454. # -- End fpclassifyl
  455. .data
  456. .section .note.GNU-stack, ""
  457. # End