summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2013-08-04 18:01:52 -0400
committerMark H Weaver <mhw@netris.org>2013-08-04 18:06:07 -0400
commitafa3c37ddc3682939a793a4798f3b55fc8d658ec (patch)
tree55a3fc374f9fc23c8802b48f20b620ba63205f49
parentf91a1864c365abef807714ed0b664849f099152c (diff)
downloadguile-afa3c37ddc3682939a793a4798f3b55fc8d658ec.tar.gz
VM: Define ASM_MUL on ARM only if SMULL instruction is supported.
* libguile/vm-i-scheme.c (ASM_MUL): Define only if the target architecture is known to implement the SMULL instruction.
-rw-r--r--libguile/vm-i-scheme.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/libguile/vm-i-scheme.c b/libguile/vm-i-scheme.c
index a703aed1d..4a686823d 100644
--- a/libguile/vm-i-scheme.c
+++ b/libguile/vm-i-scheme.c
@@ -341,7 +341,21 @@ VM_DEFINE_FUNCTION (149, ge, "ge?", 2)
slow_sub: \
do { } while (0)
-# define ASM_MUL(x, y) \
+# if defined (__ARM_ARCH_3M__) || defined (__ARM_ARCH_4__) \
+ || defined (__ARM_ARCH_4T__) || defined (__ARM_ARCH_5__) \
+ || defined (__ARM_ARCH_5T__) || defined (__ARM_ARCH_5E__) \
+ || defined (__ARM_ARCH_5TE__) || defined (__ARM_ARCH_5TEJ__) \
+ || defined (__ARM_ARCH_6__) || defined (__ARM_ARCH_6J__) \
+ || defined (__ARM_ARCH_6K__) || defined (__ARM_ARCH_6Z__) \
+ || defined (__ARM_ARCH_6ZK__) || defined (__ARM_ARCH_6T2__) \
+ || defined (__ARM_ARCH_6M__) || defined (__ARM_ARCH_7__) \
+ || defined (__ARM_ARCH_7A__) || defined (__ARM_ARCH_7R__) \
+ || defined (__ARM_ARCH_7M__) || defined (__ARM_ARCH_7EM__) \
+ || defined (__ARM_ARCH_8A__)
+
+/* The ARM architectures listed above support the SMULL instruction */
+
+# define ASM_MUL(x, y) \
if (SCM_LIKELY (SCM_I_INUMP (x) && SCM_I_INUMP (y))) \
{ \
scm_t_signed_bits rlo, rhi; \
@@ -354,6 +368,8 @@ VM_DEFINE_FUNCTION (149, ge, "ge?", 2)
} \
do { } while (0)
+# endif
+
#endif
VM_DEFINE_FUNCTION (150, add, "add", 2)