fpclassify.S 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423
  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: %xmm0
  46. ..B1.1:
  47. .cfi_startproc
  48. ..___tag_value___fpclassifyd.1:
  49. ..L2:
  50. movd %xmm0, %rcx
  51. movsd %xmm0, -8(%rsp)
  52. movl -4(%rsp), %eax
  53. btrq $63, %rcx
  54. andl $2147483647, %eax
  55. cmpl $2146435072, %eax
  56. jb ..B1.3
  57. ..B1.2:
  58. movq $0x7ff0000000000000, %rdx
  59. xorl %eax, %eax
  60. cmpq %rcx, %rdx
  61. setae %al
  62. ret
  63. ..B1.3:
  64. cmpl $1048576, %eax
  65. jae ..B1.5
  66. ..B1.4:
  67. movl $3, %edx
  68. movl $2, %eax
  69. testq %rcx, %rcx
  70. cmovne %edx, %eax
  71. ret
  72. ..B1.5:
  73. movl $4, %eax
  74. ret
  75. .align 16,0x90
  76. .cfi_endproc
  77. .type __fpclassifyd,@function
  78. .size __fpclassifyd,.-__fpclassifyd
  79. .data
  80. # -- End __fpclassifyd
  81. .text
  82. # -- Begin fpclassifyd
  83. .text
  84. .align 16,0x90
  85. .globl fpclassifyd
  86. fpclassifyd:
  87. # parameter 1: %xmm0
  88. ..B2.1:
  89. .cfi_startproc
  90. ..___tag_value_fpclassifyd.4:
  91. ..L5:
  92. movd %xmm0, %rcx
  93. movsd %xmm0, -8(%rsp)
  94. movl -4(%rsp), %eax
  95. btrq $63, %rcx
  96. andl $2147483647, %eax
  97. cmpl $2146435072, %eax
  98. jb ..B2.3
  99. ..B2.2:
  100. movq $0x7ff0000000000000, %rdx
  101. xorl %eax, %eax
  102. cmpq %rcx, %rdx
  103. setae %al
  104. ret
  105. ..B2.3:
  106. cmpl $1048576, %eax
  107. jae ..B2.5
  108. ..B2.4:
  109. movl $3, %edx
  110. movl $2, %eax
  111. testq %rcx, %rcx
  112. cmovne %edx, %eax
  113. ret
  114. ..B2.5:
  115. movl $4, %eax
  116. ret
  117. .align 16,0x90
  118. .cfi_endproc
  119. .type fpclassifyd,@function
  120. .size fpclassifyd,.-fpclassifyd
  121. .data
  122. # -- End fpclassifyd
  123. .text
  124. # -- Begin __fpclassify
  125. .text
  126. .align 16,0x90
  127. .globl __fpclassify
  128. __fpclassify:
  129. # parameter 1: %xmm0
  130. ..B3.1:
  131. .cfi_startproc
  132. ..___tag_value___fpclassify.7:
  133. ..L8:
  134. movd %xmm0, %rcx
  135. movsd %xmm0, -8(%rsp)
  136. movl -4(%rsp), %eax
  137. btrq $63, %rcx
  138. andl $2147483647, %eax
  139. cmpl $2146435072, %eax
  140. jb ..B3.3
  141. ..B3.2:
  142. movq $0x7ff0000000000000, %rdx
  143. xorl %eax, %eax
  144. cmpq %rcx, %rdx
  145. setae %al
  146. ret
  147. ..B3.3:
  148. cmpl $1048576, %eax
  149. jae ..B3.5
  150. ..B3.4:
  151. movl $3, %edx
  152. movl $2, %eax
  153. testq %rcx, %rcx
  154. cmovne %edx, %eax
  155. ret
  156. ..B3.5:
  157. movl $4, %eax
  158. ret
  159. .align 16,0x90
  160. .cfi_endproc
  161. .type __fpclassify,@function
  162. .size __fpclassify,.-__fpclassify
  163. .data
  164. # -- End __fpclassify
  165. .text
  166. # -- Begin fpclassify
  167. .text
  168. .align 16,0x90
  169. .globl fpclassify
  170. fpclassify:
  171. # parameter 1: %xmm0
  172. ..B4.1:
  173. .cfi_startproc
  174. ..___tag_value_fpclassify.10:
  175. ..L11:
  176. movd %xmm0, %rcx
  177. movsd %xmm0, -8(%rsp)
  178. movl -4(%rsp), %eax
  179. btrq $63, %rcx
  180. andl $2147483647, %eax
  181. cmpl $2146435072, %eax
  182. jb ..B4.3
  183. ..B4.2:
  184. movq $0x7ff0000000000000, %rdx
  185. xorl %eax, %eax
  186. cmpq %rcx, %rdx
  187. setae %al
  188. ret
  189. ..B4.3:
  190. cmpl $1048576, %eax
  191. jae ..B4.5
  192. ..B4.4:
  193. movl $3, %edx
  194. movl $2, %eax
  195. testq %rcx, %rcx
  196. cmovne %edx, %eax
  197. ret
  198. ..B4.5:
  199. movl $4, %eax
  200. ret
  201. .align 16,0x90
  202. .cfi_endproc
  203. .type fpclassify,@function
  204. .size fpclassify,.-fpclassify
  205. .data
  206. # -- End fpclassify
  207. .text
  208. # -- Begin __fpclassifyf
  209. .text
  210. .align 16,0x90
  211. .globl __fpclassifyf
  212. __fpclassifyf:
  213. # parameter 1: %xmm0
  214. ..B5.1:
  215. .cfi_startproc
  216. ..___tag_value___fpclassifyf.13:
  217. ..L14:
  218. movd %xmm0, %edx
  219. andl $2147483647, %edx
  220. cmpl $2139095040, %edx
  221. jb ..B5.3
  222. ..B5.2:
  223. movl $0, %eax
  224. setbe %al
  225. ret
  226. ..B5.3:
  227. cmpl $8388608, %edx
  228. jae ..B5.5
  229. ..B5.4:
  230. movl $3, %ecx
  231. movl $2, %eax
  232. testl %edx, %edx
  233. cmovne %ecx, %eax
  234. ret
  235. ..B5.5:
  236. movl $4, %eax
  237. ret
  238. .align 16,0x90
  239. .cfi_endproc
  240. .type __fpclassifyf,@function
  241. .size __fpclassifyf,.-__fpclassifyf
  242. .data
  243. # -- End __fpclassifyf
  244. .text
  245. # -- Begin fpclassifyf
  246. .text
  247. .align 16,0x90
  248. .globl fpclassifyf
  249. fpclassifyf:
  250. # parameter 1: %xmm0
  251. ..B6.1:
  252. .cfi_startproc
  253. ..___tag_value_fpclassifyf.16:
  254. ..L17:
  255. movd %xmm0, %edx
  256. andl $2147483647, %edx
  257. cmpl $2139095040, %edx
  258. jb ..B6.3
  259. ..B6.2:
  260. movl $0, %eax
  261. setbe %al
  262. ret
  263. ..B6.3:
  264. cmpl $8388608, %edx
  265. jae ..B6.5
  266. ..B6.4:
  267. movl $3, %ecx
  268. movl $2, %eax
  269. testl %edx, %edx
  270. cmovne %ecx, %eax
  271. ret
  272. ..B6.5:
  273. movl $4, %eax
  274. ret
  275. .align 16,0x90
  276. .cfi_endproc
  277. .type fpclassifyf,@function
  278. .size fpclassifyf,.-fpclassifyf
  279. .data
  280. # -- End fpclassifyf
  281. .text
  282. # -- Begin __fpclassifyl
  283. .text
  284. .align 16,0x90
  285. .globl __fpclassifyl
  286. __fpclassifyl:
  287. # parameter 1: 8 + %rsp
  288. ..B7.1:
  289. .cfi_startproc
  290. ..___tag_value___fpclassifyl.19:
  291. ..L20:
  292. movzwl 16(%rsp), %ecx
  293. andl $32767, %ecx
  294. movl 12(%rsp), %esi
  295. movl %ecx, %eax
  296. movl %esi, %edx
  297. shll $16, %eax
  298. shrl $16, %edx
  299. orl %edx, %eax
  300. cmpl $2147418112, %eax
  301. jb ..B7.5
  302. ..B7.2:
  303. cmpl $32767, %ecx
  304. je ..B7.12
  305. ..B7.3:
  306. xorl %eax, %eax
  307. ..B7.4:
  308. ret
  309. ..B7.5:
  310. cmpl $65536, %eax
  311. jae ..B7.11
  312. ..B7.6:
  313. testl %esi, %esi
  314. jne ..B7.8
  315. ..B7.7:
  316. cmpl $0, 8(%rsp)
  317. je ..B7.9
  318. ..B7.8:
  319. movl $3, %eax
  320. ret
  321. ..B7.9:
  322. movl $2, %eax
  323. ..B7.10:
  324. ret
  325. ..B7.11:
  326. andl $32768, %eax
  327. shrl $15, %eax
  328. addl $3, %eax
  329. ret
  330. ..B7.12:
  331. cmpl $-2147483648, %esi
  332. jne ..B7.3
  333. ..B7.13:
  334. cmpl $0, 8(%rsp)
  335. jne ..B7.3
  336. ..B7.14:
  337. movl $1, %eax
  338. ret
  339. .align 16,0x90
  340. .cfi_endproc
  341. .type __fpclassifyl,@function
  342. .size __fpclassifyl,.-__fpclassifyl
  343. .data
  344. # -- End __fpclassifyl
  345. .text
  346. # -- Begin fpclassifyl
  347. .text
  348. .align 16,0x90
  349. .globl fpclassifyl
  350. fpclassifyl:
  351. # parameter 1: 8 + %rsp
  352. ..B8.1:
  353. .cfi_startproc
  354. ..___tag_value_fpclassifyl.22:
  355. ..L23:
  356. movzwl 16(%rsp), %ecx
  357. andl $32767, %ecx
  358. movl 12(%rsp), %esi
  359. movl %ecx, %eax
  360. movl %esi, %edx
  361. shll $16, %eax
  362. shrl $16, %edx
  363. orl %edx, %eax
  364. cmpl $2147418112, %eax
  365. jb ..B8.5
  366. ..B8.2:
  367. cmpl $32767, %ecx
  368. je ..B8.12
  369. ..B8.3:
  370. xorl %eax, %eax
  371. ..B8.4:
  372. ret
  373. ..B8.5:
  374. cmpl $65536, %eax
  375. jae ..B8.11
  376. ..B8.6:
  377. testl %esi, %esi
  378. jne ..B8.8
  379. ..B8.7:
  380. cmpl $0, 8(%rsp)
  381. je ..B8.9
  382. ..B8.8:
  383. movl $3, %eax
  384. ret
  385. ..B8.9:
  386. movl $2, %eax
  387. ..B8.10:
  388. ret
  389. ..B8.11:
  390. andl $32768, %eax
  391. shrl $15, %eax
  392. addl $3, %eax
  393. ret
  394. ..B8.12:
  395. cmpl $-2147483648, %esi
  396. jne ..B8.3
  397. ..B8.13:
  398. cmpl $0, 8(%rsp)
  399. jne ..B8.3
  400. ..B8.14:
  401. movl $1, %eax
  402. ret
  403. .align 16,0x90
  404. .cfi_endproc
  405. .type fpclassifyl,@function
  406. .size fpclassifyl,.-fpclassifyl
  407. .data
  408. # -- End fpclassifyl
  409. .data
  410. .section .note.GNU-stack, ""
  411. // -- Begin DWARF2 SEGMENT .eh_frame
  412. .section .eh_frame,"a",@progbits
  413. .eh_frame_seg:
  414. .align 1
  415. # End