summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorS. Gilles <sgilles@math.umd.edu>2018-04-17 19:38:45 -0400
committerS. Gilles <sgilles@math.umd.edu>2018-04-18 08:32:37 -0400
commitd25b147ccbeff5b7f086b2e43d835543aaa8e6dd (patch)
tree1da8cebec17837bc766995d824d147e457a22c82
parentcbdb7d937450b0905b465fec2be2f84a66541cbc (diff)
downloadmc-d25b147ccbeff5b7f086b2e43d835543aaa8e6dd.tar.gz
Boilerplate FP control word code for ASM round.
-rw-r--r--lib/math/round-impl+posixy-x64-sse4.s18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/math/round-impl+posixy-x64-sse4.s b/lib/math/round-impl+posixy-x64-sse4.s
index 1f6acb0..5e3af3e 100644
--- a/lib/math/round-impl+posixy-x64-sse4.s
+++ b/lib/math/round-impl+posixy-x64-sse4.s
@@ -2,13 +2,31 @@
.globl math$_rn32
math$rn32:
math$_rn32:
+ pushq %rbp
+ movq %rsp, %rbp
+ subq $16, %rsp
+ fnstcw (%rsp)
+ fnstcw 8(%rsp)
+ andl $0xf3ff, 8(%rsp)
+ fldcw 8(%rsp)
cvtss2si %xmm0, %eax
+ fldcw (%rsp)
+ leave
ret
.globl math$rn64
.globl math$_rn64
math$rn64:
math$_rn64:
+ pushq %rbp
+ movq %rsp, %rbp
+ subq $16, %rsp
+ fnstcw (%rsp)
+ fnstcw 8(%rsp)
+ andl $0xf3ff, 8(%rsp)
+ fldcw 8(%rsp)
cvtsd2si %xmm0, %rax
+ fldcw (%rsp)
+ leave
ret