Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; this code gets division remainder of two 64-bit real numbers (DP-FP) using SSE2 instruction set
- ; it's very slow I know
- movsd xmm0, vl ; copy left operand to xmm0
- movsd xmm1, vr ; copy right operand to xmm1
- movsd xmm2, 0x7FFFFFFFFFFFFFFF
- movsd xmm3, 0x8000000000000000
- andpd xmm3, xmm0 ; remember the sign of left operand
- andpd xmm0, xmm2 ; get abs value of left operand
- andpd xmm1, xmm2 ; get abs value of right operand
- start:
- comisd xmm0, xmm1
- jc end
- subsd xmm0, xmm1
- jmp start
- orpd xmm0, xmm3 ; restore the sign of left operand
- end:
- mov [rdx], xmm0
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement