summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2014-05-02 14:40:15 +0000
committerGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2014-05-02 14:40:15 +0000
commit7a93de2caaa6e1adca77b1d33d1e97f5d30e52ae (patch)
tree434726f9efecbee81010fca5d74dcc080220f91a /runtime
parent63722daa40aabf505c634d5cd88b03574f96dc70 (diff)
Adapt to the two different calling conventions for floats.
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2476 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'runtime')
-rw-r--r--runtime/arm/i64_dtos.S3
-rw-r--r--runtime/arm/i64_dtou.S3
-rw-r--r--runtime/arm/i64_stod.S2
-rw-r--r--runtime/arm/i64_stof.S2
-rw-r--r--runtime/arm/i64_utod.S2
-rw-r--r--runtime/arm/i64_utof.S2
6 files changed, 14 insertions, 0 deletions
diff --git a/runtime/arm/i64_dtos.S b/runtime/arm/i64_dtos.S
index 4374868..e454fd4 100644
--- a/runtime/arm/i64_dtos.S
+++ b/runtime/arm/i64_dtos.S
@@ -40,6 +40,9 @@
.global __i64_dtos
__i64_dtos:
+#ifdef VARIANT_hardfloat
+ fmrrd r0, r1, d0
+#endif
mov r12, r1, asr #31 @ save sign of result in r12
@ extract unbiased exponent ((HI & 0x7FF00000) >> 20) - (1023 + 52) in r2
@ note: 1023 + 52 = 1075 = 1024 + 51
diff --git a/runtime/arm/i64_dtou.S b/runtime/arm/i64_dtou.S
index 50648a5..a9e7b65 100644
--- a/runtime/arm/i64_dtou.S
+++ b/runtime/arm/i64_dtou.S
@@ -40,6 +40,9 @@
.global __i64_dtou
__i64_dtou:
+#ifdef VARIANT_hardfloat
+ fmrrd r0, r1, d0
+#endif
cmp r1, #0 @ is double < 0 ?
blt 1f @ then it converts to 0
@ extract unbiased exponent ((HI & 0x7FF00000) >> 20) - (1023 + 52) in r2
diff --git a/runtime/arm/i64_stod.S b/runtime/arm/i64_stod.S
index 828d8b3..7e5a06f 100644
--- a/runtime/arm/i64_stod.S
+++ b/runtime/arm/i64_stod.S
@@ -46,7 +46,9 @@ __i64_stod:
fsitod d1, s2 @ convert high half to double (signed)
fldd d2, .LC1 @ d2 = 2^32
fmacd d0, d1, d2 @ d0 = d0 + d1 * d2 = double value of int64
+#ifdef VARIANT_eabi
fmrrd r0, r1, d0 @ return result in r0, r1
+#endif
bx lr
.type __i64_stod, %function
.size __i64_stod, . - __i64_stod
diff --git a/runtime/arm/i64_stof.S b/runtime/arm/i64_stof.S
index 22f2687..3f33f04 100644
--- a/runtime/arm/i64_stof.S
+++ b/runtime/arm/i64_stof.S
@@ -67,8 +67,10 @@ __i64_stof:
fmacd d0, d1, d2 @ d0 = d0 + d1 * d2 = double value of int64
@ Round to single
fcvtsd s0, d0
+#ifdef VARIANT_eabi
@ Return result in r0
fmrs r0, s0
+#endif
bx lr
.type __i64_stof, %function
.size __i64_stof, . - __i64_stof
diff --git a/runtime/arm/i64_utod.S b/runtime/arm/i64_utod.S
index e98e46c..1110874 100644
--- a/runtime/arm/i64_utod.S
+++ b/runtime/arm/i64_utod.S
@@ -46,7 +46,9 @@ __i64_utod:
fuitod d1, s2 @ convert high half to double (unsigned)
fldd d2, .LC1 @ d2 = 2^32
fmacd d0, d1, d2 @ d0 = d0 + d1 * d2 = double value of int64
+#ifdef VARIANT_eabi
fmrrd r0, r1, d0 @ return result in r0, r1
+#endif
bx lr
.type __i64_utod, %function
.size __i64_utod, . - __i64_utod
diff --git a/runtime/arm/i64_utof.S b/runtime/arm/i64_utof.S
index 6fb11df..a959076 100644
--- a/runtime/arm/i64_utof.S
+++ b/runtime/arm/i64_utof.S
@@ -63,8 +63,10 @@ __i64_utof:
fmacd d0, d1, d2 @ d0 = d0 + d1 * d2 = double value of int64
@ Round to single
fcvtsd s0, d0
+#ifdef VARIANT_eabi
@ Return result in r0
fmrs r0, s0
+#endif
bx lr
.type __i64_utof, %function
.size __i64_utof, . - __i64_utof