123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641 |
- /*
- * Math library
- *
- * Copyright (C) 2016 Intel Corporation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Intel Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- *
- * Author Name <jingwei.zhang@intel.com>
- * History:
- * 03-14-2016 Initial version. numerics svn rev. 12864
- */
- .file "scalbl.c"
- .text
- ..TXTST0:
- # -- Begin scalbl
- .text
- .align 16,0x90
- .globl scalbl
- scalbl:
- # parameter 1: 8 + %ebp
- # parameter 2: 20 + %ebp
- ..B1.1:
- ..L1:
- pushl %ebp
- movl %esp, %ebp
- andl $-16, %esp
- pushl %esi
- pushl %edi
- pushl %ebx
- subl $36, %esp
- ..B1.2:
- fnstcw 22(%esp)
- ..B1.3:
- movzwl 16(%ebp), %edi
- andl $32767, %edi
- movzwl 28(%ebp), %ecx
- andl $32767, %ecx
- call ..L2
- ..L2:
- popl %esi
- lea _GLOBAL_OFFSET_TABLE_+[. - ..L2](%esi), %esi
- cmpl $32767, %edi
- je ..B1.107
- ..B1.4:
- cmpl $32767, %ecx
- je ..B1.74
- ..B1.5:
- cmpl $16383, %ecx
- jl ..B1.33
- ..B1.6:
- movzwl 22(%esp), %edx
- movl %edx, %eax
- andl $768, %eax
- cmpl $768, %eax
- je ..B1.57
- ..B1.7:
- orl $-64768, %edx
- movw %dx, 20(%esp)
- ..B1.8:
- fldcw 20(%esp)
- ..B1.9:
- movl $1, %ebx
- ..B1.10:
- cmpl $16414, %ecx
- jge ..B1.15
- ..B1.11:
- fldt 20(%ebp)
- fldl _TWO_63H@GOTOFF(%esi)
- fadd %st(1), %st
- fstpt 8(%esp)
- fildl 8(%esp)
- movl 8(%esp), %edx
- fucompp
- fnstsw %ax
- sahf
- jp ..B1.12
- je ..B1.20
- ..B1.12:
- fldl _infs@GOTOFF(%esi)
- testl %ebx, %ebx
- fmull _zeros@GOTOFF(%esi)
- fstpt 8(%esp)
- je ..B1.14
- ..B1.13:
- fldcw 22(%esp)
- ..B1.14:
- fldt 8(%esp)
- addl $36, %esp
- popl %ebx
- popl %edi
- popl %esi
- movl %ebp, %esp
- popl %ebp
- ret
- ..B1.15:
- movzbl 29(%ebp), %eax
- andl $128, %eax
- shrl $7, %eax
- cmpl $16446, %ecx
- movl large_integers@GOTOFF(%esi,%eax,4), %edx
- jge ..B1.20
- ..B1.16:
- addl $2, %ecx
- movl 20(%ebp), %eax
- shll %cl, %eax
- testl %eax, %eax
- je ..B1.20
- ..B1.17:
- fldl _infs@GOTOFF(%esi)
- testl %ebx, %ebx
- fmull _zeros@GOTOFF(%esi)
- fstpt 8(%esp)
- je ..B1.19
- ..B1.18:
- fldcw 22(%esp)
- ..B1.19:
- fldt 8(%esp)
- addl $36, %esp
- popl %ebx
- popl %edi
- popl %esi
- movl %ebp, %esp
- popl %ebp
- ret
- ..B1.20:
- testl %edi, %edi
- jne ..B1.27
- ..B1.21:
- cmpl $0, 12(%ebp)
- jne ..B1.26
- ..B1.22:
- cmpl $0, 8(%ebp)
- jne ..B1.26
- ..B1.23:
- testl %ebx, %ebx
- je ..B1.25
- ..B1.24:
- fldcw 22(%esp)
- ..B1.25:
- fldt 8(%ebp)
- addl $36, %esp
- popl %ebx
- popl %edi
- popl %esi
- movl %ebp, %esp
- popl %ebp
- ret
- ..B1.26:
- fldt 8(%ebp)
- fmull _TWO_75@GOTOFF(%esi)
- fstpt 8(%ebp)
- movzwl 16(%ebp), %edi
- andl $32767, %edi
- addl $-75, %edi
- ..B1.27:
- cmpl $65536, %edx
- jle ..L3
- movl $65536, %edx
- ..L3:
- cmpl $-65536, %edx
- jge ..L4
- movl $-65536, %edx
- ..L4:
- lea (%edi,%edx), %ecx
- testl %ecx, %ecx
- jle ..B1.51
- ..B1.28:
- cmpl $32767, %ecx
- jge ..B1.50
- ..B1.29:
- movzwl 16(%ebp), %eax
- andl $32767, %ecx
- andl $-32768, %eax
- orl %ecx, %eax
- movw %ax, 16(%ebp)
- fldt 8(%ebp)
- ..B1.30:
- fstpt 8(%esp)
- testl %ebx, %ebx
- je ..B1.32
- ..B1.31:
- fldcw 22(%esp)
- ..B1.32:
- fldt 8(%esp)
- addl $36, %esp
- popl %ebx
- popl %edi
- popl %esi
- movl %ebp, %esp
- popl %ebp
- ret
- ..B1.33:
- testl %ecx, %ecx
- jne ..B1.42
- ..B1.34:
- cmpl $0, 24(%ebp)
- jne ..B1.42
- ..B1.35:
- cmpl $0, 20(%ebp)
- jne ..B1.42
- ..B1.36:
- movzwl 22(%esp), %edx
- movl %edx, %eax
- andl $768, %eax
- cmpl $768, %eax
- je ..B1.58
- ..B1.37:
- orl $-64768, %edx
- movw %dx, 20(%esp)
- ..B1.38:
- fldcw 20(%esp)
- ..B1.39:
- fldt 8(%ebp)
- fmull _ones@GOTOFF(%esi)
- fstpt 8(%esp)
- ..B1.40:
- fldcw 22(%esp)
- ..B1.41:
- fldt 8(%esp)
- addl $36, %esp
- popl %ebx
- popl %edi
- popl %esi
- movl %ebp, %esp
- popl %ebp
- ret
- ..B1.42:
- cmpl $32767, %edi
- je ..B1.60
- ..B1.43:
- movzwl 22(%esp), %edx
- movl %edx, %eax
- andl $768, %eax
- cmpl $768, %eax
- je ..B1.59
- ..B1.44:
- orl $-64768, %edx
- movw %dx, 20(%esp)
- ..B1.45:
- fldcw 20(%esp)
- ..B1.46:
- movl $1, %eax
- ..B1.47:
- fldl _infs@GOTOFF(%esi)
- testl %eax, %eax
- fmull _zeros@GOTOFF(%esi)
- fstpt 8(%esp)
- je ..B1.49
- ..B1.48:
- fldcw 22(%esp)
- ..B1.49:
- fldt 8(%esp)
- addl $36, %esp
- popl %ebx
- popl %edi
- popl %esi
- movl %ebp, %esp
- popl %ebp
- ret
- ..B1.50:
- fldt _large_value_80@GOTOFF(%esi)
- movzbl 17(%ebp), %edx
- andl $128, %edx
- shrl $7, %edx
- lea (,%edx,8), %eax
- lea (%eax,%edx,4), %ecx
- fldt _large_value_80@GOTOFF(%esi,%ecx)
- fmulp %st, %st(1)
- jmp ..B1.30
- ..B1.51:
- cmpl $-63, %ecx
- jge ..B1.53
- ..B1.52:
- fldt _small_value_80@GOTOFF(%esi)
- movzbl 17(%ebp), %edx
- andl $128, %edx
- shrl $7, %edx
- lea (,%edx,8), %eax
- lea (%eax,%edx,4), %ecx
- fldt _small_value_80@GOTOFF(%esi,%ecx)
- fmulp %st, %st(1)
- jmp ..B1.54
- ..B1.53:
- fldt 8(%ebp)
- lea 75(%edi,%edx), %edx
- movzwl 16(%ebp), %eax
- andl $32767, %edx
- andl $-32768, %eax
- fstpt 8(%esp)
- orl %edx, %eax
- movw %ax, 16(%esp)
- fldt 8(%esp)
- fmull 8+_TWO_75@GOTOFF(%esi)
- ..B1.54:
- fstpt 8(%esp)
- testl %ebx, %ebx
- je ..B1.56
- ..B1.55:
- fldcw 22(%esp)
- ..B1.56:
- fldt 8(%esp)
- addl $36, %esp
- popl %ebx
- popl %edi
- popl %esi
- movl %ebp, %esp
- popl %ebp
- ret
- ..B1.57:
- xorl %ebx, %ebx
- jmp ..B1.10
- ..B1.58:
- fldt 8(%ebp)
- fmull _ones@GOTOFF(%esi)
- fstpt 8(%esp)
- jmp ..B1.41
- ..B1.59:
- xorl %eax, %eax
- jmp ..B1.47
- ..B1.60:
- testl %ecx, %ecx
- jg ..B1.68
- ..B1.61:
- movzwl 22(%esp), %edx
- movl %edx, %eax
- andl $768, %eax
- cmpl $768, %eax
- je ..B1.70
- ..B1.62:
- orl $-64768, %edx
- movw %dx, 20(%esp)
- ..B1.63:
- fldcw 20(%esp)
- ..B1.64:
- movl $1, %eax
- ..B1.65:
- fldl _infs@GOTOFF(%esi)
- testl %eax, %eax
- fmull _zeros@GOTOFF(%esi)
- fstpt 8(%esp)
- je ..B1.67
- ..B1.66:
- fldcw 22(%esp)
- ..B1.67:
- fldt 8(%esp)
- addl $36, %esp
- popl %ebx
- popl %edi
- popl %esi
- movl %ebp, %esp
- popl %ebp
- ret
- ..B1.68:
- cmpl $1, %ecx
- je ..B1.71
- ..B1.69:
- movzbl 17(%ebp), %eax
- andl $128, %eax
- shrl $7, %eax
- fldl _infs@GOTOFF(%esi,%eax,8)
- addl $36, %esp
- popl %ebx
- popl %edi
- popl %esi
- movl %ebp, %esp
- popl %ebp
- ret
- ..B1.70:
- xorl %eax, %eax
- jmp ..B1.65
- ..B1.71:
- movl 24(%ebp), %eax
- cmpl $-2147483648, %eax
- jb ..B1.61
- ..B1.72:
- jne ..B1.69
- ..B1.73:
- cmpl $0, 20(%ebp)
- jbe ..B1.61
- jmp ..B1.69
- ..B1.74:
- cmpl $-2147483648, 24(%ebp)
- jne ..B1.76
- ..B1.75:
- cmpl $0, 20(%ebp)
- je ..B1.82
- ..B1.76:
- movzwl 22(%esp), %edx
- movl %edx, %eax
- andl $768, %eax
- cmpl $768, %eax
- je ..B1.102
- ..B1.77:
- orl $-64768, %edx
- movw %dx, 20(%esp)
- ..B1.78:
- fldcw 20(%esp)
- ..B1.79:
- fldt 8(%ebp)
- fldt 20(%ebp)
- faddp %st, %st(1)
- fstpt 8(%esp)
- ..B1.80:
- fldcw 22(%esp)
- ..B1.81:
- fldt 8(%esp)
- addl $36, %esp
- popl %ebx
- popl %edi
- popl %esi
- movl %ebp, %esp
- popl %ebp
- ret
- ..B1.82:
- movzwl 22(%esp), %edx
- movl %edx, %eax
- andl $768, %eax
- cmpl $768, %eax
- je ..B1.106
- ..B1.83:
- orl $-64768, %edx
- movw %dx, 20(%esp)
- ..B1.84:
- fldcw 20(%esp)
- ..B1.85:
- movl $1, %eax
- ..B1.86:
- testl %edi, %edi
- jne ..B1.94
- ..B1.87:
- cmpl $0, 12(%ebp)
- jne ..B1.89
- ..B1.88:
- cmpl $0, 8(%ebp)
- je ..B1.90
- ..B1.112:
- cmpl $0, 12(%ebp)
- ..B1.89:
- fldl _smallest_value_64@GOTOFF(%esi)
- fstpl (%esp)
- jne ..B1.95
- ..B1.113:
- cmpl $0, 8(%ebp)
- ..B1.90:
- jne ..B1.95
- ..B1.91:
- movzbl 29(%ebp), %edx
- testl $128, %edx
- je ..B1.93
- ..B1.92:
- fldt 8(%ebp)
- fstpt 8(%esp)
- jmp ..B1.99
- ..B1.93:
- fldl _infs@GOTOFF(%esi)
- fmull _zeros@GOTOFF(%esi)
- fstpt 8(%esp)
- jmp ..B1.99
- ..B1.94:
- cmpl $32767, %edi
- je ..B1.103
- ..B1.95:
- movzbl 17(%ebp), %ecx
- andl $128, %ecx
- movzbl 29(%ebp), %edx
- shrl $7, %ecx
- testl $128, %edx
- je ..B1.97
- ..B1.96:
- fldl _zeros@GOTOFF(%esi,%ecx,8)
- jmp ..B1.98
- ..B1.97:
- fldl _infs@GOTOFF(%esi,%ecx,8)
- ..B1.98:
- fstpt 8(%esp)
- ..B1.99:
- testl %eax, %eax
- je ..B1.101
- ..B1.100:
- fldcw 22(%esp)
- ..B1.101:
- fldt 8(%esp)
- addl $36, %esp
- popl %ebx
- popl %edi
- popl %esi
- movl %ebp, %esp
- popl %ebp
- ret
- ..B1.102:
- fldt 8(%ebp)
- fldt 20(%ebp)
- faddp %st, %st(1)
- fstpt 8(%esp)
- jmp ..B1.81
- ..B1.103:
- movzbl 29(%ebp), %edx
- testl $128, %edx
- jne ..B1.105
- ..B1.104:
- fldt 8(%ebp)
- fstpt 8(%esp)
- jmp ..B1.99
- ..B1.105:
- fldl _infs@GOTOFF(%esi)
- fmull _zeros@GOTOFF(%esi)
- fstpt 8(%esp)
- jmp ..B1.99
- ..B1.106:
- xorl %eax, %eax
- jmp ..B1.86
- ..B1.107:
- cmpl $-2147483648, 12(%ebp)
- jne ..B1.76
- ..B1.108:
- cmpl $0, 8(%ebp)
- jne ..B1.76
- ..B1.109:
- cmpl $32767, %ecx
- je ..B1.74
- jmp ..B1.33
- .align 16,0x90
- .type scalbl,@function
- .size scalbl,.-scalbl
- .data
- # -- End scalbl
- .section .rodata, "a"
- .align 4
- .align 4
- _TWO_63H:
- .long 0
- .long 1139277824
- .type _TWO_63H,@object
- .size _TWO_63H,8
- .align 4
- _infs:
- .long 0
- .long 2146435072
- .long 0
- .long 4293918720
- .type _infs,@object
- .size _infs,16
- .align 4
- _zeros:
- .long 0
- .long 0
- .long 0
- .long 2147483648
- .type _zeros,@object
- .size _zeros,16
- .align 4
- large_integers:
- .long 65536
- .long -65536
- .type large_integers,@object
- .size large_integers,8
- .align 4
- _TWO_75:
- .long 0
- .long 1151336448
- .long 0
- .long 994050048
- .type _TWO_75,@object
- .size _TWO_75,16
- .align 4
- _ones:
- .long 0
- .long 1072693248
- .long 0
- .long 3220176896
- .type _ones,@object
- .size _ones,16
- .align 4
- _smallest_value_64:
- .long 1
- .long 0
- .long 1
- .long 2147483648
- .type _smallest_value_64,@object
- .size _smallest_value_64,16
- .align 2
- _large_value_80:
- .word 0
- .word 0
- .word 0
- .word 32768
- .word 26383
- .word 0
- .word 0
- .word 0
- .word 0
- .word 32768
- .word 59151
- .word 0
- .type _large_value_80,@object
- .size _large_value_80,24
- .align 2
- _small_value_80:
- .word 0
- .word 0
- .word 0
- .word 32768
- .word 6383
- .word 0
- .word 0
- .word 0
- .word 0
- .word 32768
- .word 39151
- .word 0
- .type _small_value_80,@object
- .size _small_value_80,24
- .data
- .section .note.GNU-stack, ""
- # End
|