guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] 269/437: ARM: Minor changes that should allow building o


From: Andy Wingo
Subject: [Guile-commits] 269/437: ARM: Minor changes that should allow building on non gnu-linux/gcc.
Date: Mon, 2 Jul 2018 05:14:34 -0400 (EDT)

wingo pushed a commit to branch lightning
in repository guile.

commit 6fa5123855b3312dcd22352f58897895fc7a4e3b
Author: pcpa <address@hidden>
Date:   Wed Nov 27 15:05:27 2013 -0200

    ARM: Minor changes that should allow building on non gnu-linux/gcc.
    
        * configure.ac, lib/jit_arm-swf.c, lib/jit_arm.c: Add
        changes that should at least allow building lightning
        on Apple iOS7.
---
 ChangeLog         |   6 ++
 configure.ac      |   2 +
 lib/jit_arm-swf.c | 161 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
 lib/jit_arm.c     |   7 +++
 4 files changed, 174 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 4fe45c7..82a0c09 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-11-27 Paulo Andrade <address@hidden>
+
+       * configure.ac, lib/jit_arm-swf.c, lib/jit_arm.c: Add
+       changes that should at least allow building lightning
+       on Apple iOS7.
+
 2013-10-08 Paulo Andrade <address@hidden>
 
        * lib/jit_ppc-cpu.c: Correct wrong shortcut for ldxi_l with
diff --git a/configure.ac b/configure.ac
index 830e53f..9f5e1fe 100644
--- a/configure.ac
+++ b/configure.ac
@@ -186,6 +186,8 @@ elif test $cpu = arm; then
            }
        }
        fclose(fp);
+    #elif defined(__thumb2__)
+       return 0;
     #endif
        return 1;
     }
diff --git a/lib/jit_arm-swf.c b/lib/jit_arm-swf.c
index 972c8ec..f07d65d 100644
--- a/lib/jit_arm-swf.c
+++ b/lib/jit_arm-swf.c
@@ -34,8 +34,8 @@ extern float  __aeabi_i2f(int);
 extern double  __aeabi_i2d(int);
 extern float   __aeabi_d2f(double);
 extern double  __aeabi_f2d(float);
-extern int     __aeabi_f2iz(double);
-extern int     __aeabi_d2iz(float);
+extern int     __aeabi_f2iz(float);
+extern int     __aeabi_d2iz(double);
 extern int     __aeabi_fcmplt(float, float);
 extern int     __aeabi_dcmplt(double, double);
 extern int     __aeabi_fcmple(float, float);
@@ -394,6 +394,163 @@ static void 
_swf_stxi_d(jit_state_t*,jit_word_t,jit_int32_t,jit_int32_t);
            BICI(rt, rn, encode_arm_immediate(im));                     \
     } while (0)
 
+#if !defined(__GNUC__)
+float __addsf3(float u, float v)
+{
+    return (u + v);
+}
+
+double
+__adddf3(double u, double v)
+{
+    return (u + v);
+}
+
+float
+__aeabi_fsub(float u, float v)
+{
+    return (u - v);
+}
+
+double
+__aeabi_dsub(double u, double v)
+{
+    return (u - v);
+}
+
+float
+__aeabi_fmul(float u, float v)
+{
+    return (u * v);
+}
+
+double
+__aeabi_dmul(double u, double v)
+{
+    return (u * v);
+}
+
+float
+__aeabi_fdiv(float u, float v)
+{
+    return (u / v);
+}
+
+double
+__aeabi_ddiv(double u, double v)
+{
+    return (u / v);
+}
+
+float
+__aeabi_i2f(int u)
+{
+    return (u);
+}
+
+double
+__aeabi_i2d(int u)
+{
+    return (u);
+}
+
+float
+__aeabi_d2f(double u)
+{
+    return (u);
+}
+
+double
+__aeabi_f2d(float u)
+{
+    return (u);
+}
+
+extern int
+__aeabi_f2iz(float u)
+{
+    return (u);
+}
+
+int
+__aeabi_d2iz(double u)
+{
+    return (u);
+}
+
+int
+__aeabi_fcmplt(float u, float v)
+{
+    return (u < v);
+}
+
+int
+__aeabi_dcmplt(double u, double v)
+{
+    return (u < v);
+}
+
+int
+__aeabi_fcmple(float u, float v)
+{
+    return (u <= v);
+}
+
+int
+__aeabi_dcmple(double u, double v)
+{
+    return (u <= v);
+}
+
+int
+__aeabi_fcmpeq(float u, float v)
+{
+    return (u == v);
+}
+
+int
+__aeabi_dcmpeq(double u, double v)
+{
+    return (u == v);
+}
+
+int
+__aeabi_fcmpge(float u, float v)
+{
+    return (u >= v);
+}
+
+int
+__aeabi_dcmpge(double u, double v)
+{
+    return (u >= v);
+}
+
+int
+__aeabi_fcmpgt(float u, float v)
+{
+    return (u > v);
+}
+
+int
+__aeabi_dcmpgt(double u, double v)
+{
+    return (u > v);
+}
+
+int
+__aeabi_fcmpun(float u, float v)
+{
+    return ((u != u) || (v != v));
+}
+
+int
+__aeabi_dcmpun(double u, double v)
+{
+    return ((u != u) || (v != v));
+}
+#endif
+
 static void
 _swf_ff(jit_state_t *_jit, float(*i0)(float),
        jit_int32_t r0, jit_int32_t r1)
diff --git a/lib/jit_arm.c b/lib/jit_arm.c
index 86435bc..71c1a79 100644
--- a/lib/jit_arm.c
+++ b/lib/jit_arm.c
@@ -64,8 +64,10 @@ static void _invalidate_consts(jit_state_t*);
 #define patch(instr, node)             _patch(_jit, instr, node)
 static void _patch(jit_state_t*,jit_word_t,jit_node_t*);
 
+#if defined(__GNUC__)
 /* libgcc */
 extern void __clear_cache(void *, void *);
+#endif
 
 #define PROTO                          1
 #  include "jit_arm-cpu.c"
@@ -177,6 +179,9 @@ jit_get_cpu(void)
        jit_cpu.version = 7;
     jit_cpu.abi = 1;
 #endif
+#if defined(__thumb2__)
+    jit_cpu.thumb = 1;
+#endif
     /* armv6t2 todo (software float and thumb2) */
     if (!jit_cpu.vfp && jit_cpu.thumb)
        jit_cpu.thumb = 0;
@@ -1564,8 +1569,10 @@ _emit_code(jit_state_t *_jit)
        patch_at(_jitc->patches.ptr[offset].kind & ~arm_patch_node, word, 
value);
     }
 
+#if defined(__GNUC__)
     word = sysconf(_SC_PAGE_SIZE);
     __clear_cache(_jit->code.ptr, (void *)((_jit->pc.w + word) & -word));
+#endif
 
     return (_jit->code.ptr);
 }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]