aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/x86_64/i64_utof.S
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/x86_64/i64_utof.S')
-rw-r--r--runtime/x86_64/i64_utof.S18
1 files changed, 9 insertions, 9 deletions
diff --git a/runtime/x86_64/i64_utof.S b/runtime/x86_64/i64_utof.S
index 63a33920..0e878121 100644
--- a/runtime/x86_64/i64_utof.S
+++ b/runtime/x86_64/i64_utof.S
@@ -39,18 +39,18 @@
// Conversion unsigned long -> single-precision float
FUNCTION(__compcert_i64_utof)
- testq %rdi, %rdi
+ testq INT_ARG_1, INT_ARG_1
js 1f
- pxor %xmm0, %xmm0 // if < 2^63,
- cvtsi2ssq %rdi, %xmm0 // convert as if signed
+ pxor FP_RES, FP_RES // if < 2^63,
+ cvtsi2ssq INT_ARG_1, FP_RES // convert as if signed
ret
1: // if >= 2^63, use round-to-odd trick
- movq %rdi, %rax
+ movq INT_ARG_1, %rax
shrq %rax
- andq $1, %rdi
- orq %rdi, %rax // (arg >> 1) | (arg & 1)
- pxor %xmm0, %xmm0
- cvtsi2ssq %rax, %xmm0 // convert as if signed
- addss %xmm0, %xmm0 // multiply result by 2.0
+ andq $1, INT_ARG_1
+ orq INT_ARG_1, %rax // (arg >> 1) | (arg & 1)
+ pxor FP_RES, FP_RES
+ cvtsi2ssq %rax, FP_RES // convert as if signed
+ addss FP_RES, FP_RES // multiply result by 2.0
ret
ENDFUNCTION(__compcert_i64_utof)