summaryrefslogtreecommitdiff
path: root/libguile/vm-i-scheme.c
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2009-09-15 23:48:01 +0200
committerLudovic Courtès <ludo@gnu.org>2009-09-15 23:48:01 +0200
commitdddacb233ba4559dcfc4355b33706a32f77e5b64 (patch)
tree476b3739fc6ebab307d6a96336164f0e384928d0 /libguile/vm-i-scheme.c
parent238f9a4f72a1537d8be9a21c1140a368a118f85b (diff)
downloadguile-dddacb233ba4559dcfc4355b33706a32f77e5b64.tar.gz
Use fixnums for int32 when the native word size of greater than 4 bytes.
This should also fix "condition is always true" warnings. * libguile/vm-i-scheme.c (bv_u32_native_ref, bv_s32_native_ref, bv_u32_native_set, bv_s32_native_set): Conditionalize use of `BV_FIXABLE_INT_REF' vs. `BV_INT_REF' based on `SIZEOF_VOID_P'.
Diffstat (limited to 'libguile/vm-i-scheme.c')
-rw-r--r--libguile/vm-i-scheme.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/libguile/vm-i-scheme.c b/libguile/vm-i-scheme.c
index 0cace147d..b4aadf931 100644
--- a/libguile/vm-i-scheme.c
+++ b/libguile/vm-i-scheme.c
@@ -433,10 +433,17 @@ BV_FIXABLE_INT_REF (u16, u16_native, uint16, 2)
VM_DEFINE_FUNCTION (142, bv_s16_native_ref, "bv-s16-native-ref", 2)
BV_FIXABLE_INT_REF (s16, s16_native, int16, 2)
VM_DEFINE_FUNCTION (143, bv_u32_native_ref, "bv-u32-native-ref", 2)
-/* FIXME: u32 is always a fixnum on 64-bit builds */
+#if SIZEOF_VOID_P > 4
+BV_FIXABLE_INT_REF (u32, u32_native, uint32, 4)
+#else
BV_INT_REF (u32, uint32, 4)
+#endif
VM_DEFINE_FUNCTION (144, bv_s32_native_ref, "bv-s32-native-ref", 2)
+#if SIZEOF_VOID_P > 4
+BV_FIXABLE_INT_REF (s32, s32_native, int32, 4)
+#else
BV_INT_REF (s32, int32, 4)
+#endif
VM_DEFINE_FUNCTION (145, bv_u64_native_ref, "bv-u64-native-ref", 2)
BV_INT_REF (u64, uint64, 8)
VM_DEFINE_FUNCTION (146, bv_s64_native_ref, "bv-s64-native-ref", 2)
@@ -541,10 +548,17 @@ BV_FIXABLE_INT_SET (u16, u16_native, uint16, 0, SCM_T_UINT16_MAX, 2)
VM_DEFINE_INSTRUCTION (160, bv_s16_native_set, "bv-s16-native-set", 0, 3, 0)
BV_FIXABLE_INT_SET (s16, s16_native, int16, SCM_T_INT16_MIN, SCM_T_INT16_MAX, 2)
VM_DEFINE_INSTRUCTION (161, bv_u32_native_set, "bv-u32-native-set", 0, 3, 0)
-/* FIXME: u32 is always a fixnum on 64-bit builds */
+#if SIZEOF_VOID_P > 4
+BV_FIXABLE_INT_SET (u32, u32_native, uint32, 0, SCM_T_UINT32_MAX, 4)
+#else
BV_INT_SET (u32, uint32, 4)
+#endif
VM_DEFINE_INSTRUCTION (162, bv_s32_native_set, "bv-s32-native-set", 0, 3, 0)
+#if SIZEOF_VOID_P > 4
+BV_FIXABLE_INT_SET (s32, s32_native, int32, SCM_T_INT32_MIN, SCM_T_INT32_MAX, 4)
+#else
BV_INT_SET (s32, int32, 4)
+#endif
VM_DEFINE_INSTRUCTION (163, bv_u64_native_set, "bv-u64-native-set", 0, 3, 0)
BV_INT_SET (u64, uint64, 8)
VM_DEFINE_INSTRUCTION (164, bv_s64_native_set, "bv-s64-native-set", 0, 3, 0)