summaryrefslogtreecommitdiff
path: root/libgcc/config/arm
diff options
context:
space:
mode:
authorjules <jules@138bc75d-0d04-0410-961f-82ee72b054a4>2013-04-11 14:22:54 +0000
committerjules <jules@138bc75d-0d04-0410-961f-82ee72b054a4>2013-04-11 14:22:54 +0000
commit912507e58c2d5d50a7b5793f288810490ddd37df (patch)
tree1972f5690519e6c9a85128a35af43374510145f3 /libgcc/config/arm
parent6c2c88c7ce98c476419876946c3416c925a84734 (diff)
downloadgcc-912507e58c2d5d50a7b5793f288810490ddd37df.tar.gz
libgcc/
* config/arm/linux-atomic.c (SUBWORD_SYNC_OP, SUBWORD_VAL_CAS) (SUBWORD_TEST_AND_SET): Use signed char/short types instead of unsigned char/unsigned short. (__sync_val_compare_and_swap_{1,2}): Handle signed argument. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@197806 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgcc/config/arm')
-rw-r--r--libgcc/config/arm/linux-atomic.c64
1 files changed, 32 insertions, 32 deletions
diff --git a/libgcc/config/arm/linux-atomic.c b/libgcc/config/arm/linux-atomic.c
index ee13107f1d6..d601c4ebf2a 100644
--- a/libgcc/config/arm/linux-atomic.c
+++ b/libgcc/config/arm/linux-atomic.c
@@ -97,19 +97,19 @@ FETCH_AND_OP_WORD (nand, ~, &)
return (RETURN & mask) >> shift; \
}
-SUBWORD_SYNC_OP (add, , +, unsigned short, 2, oldval)
-SUBWORD_SYNC_OP (sub, , -, unsigned short, 2, oldval)
-SUBWORD_SYNC_OP (or, , |, unsigned short, 2, oldval)
-SUBWORD_SYNC_OP (and, , &, unsigned short, 2, oldval)
-SUBWORD_SYNC_OP (xor, , ^, unsigned short, 2, oldval)
-SUBWORD_SYNC_OP (nand, ~, &, unsigned short, 2, oldval)
-
-SUBWORD_SYNC_OP (add, , +, unsigned char, 1, oldval)
-SUBWORD_SYNC_OP (sub, , -, unsigned char, 1, oldval)
-SUBWORD_SYNC_OP (or, , |, unsigned char, 1, oldval)
-SUBWORD_SYNC_OP (and, , &, unsigned char, 1, oldval)
-SUBWORD_SYNC_OP (xor, , ^, unsigned char, 1, oldval)
-SUBWORD_SYNC_OP (nand, ~, &, unsigned char, 1, oldval)
+SUBWORD_SYNC_OP (add, , +, short, 2, oldval)
+SUBWORD_SYNC_OP (sub, , -, short, 2, oldval)
+SUBWORD_SYNC_OP (or, , |, short, 2, oldval)
+SUBWORD_SYNC_OP (and, , &, short, 2, oldval)
+SUBWORD_SYNC_OP (xor, , ^, short, 2, oldval)
+SUBWORD_SYNC_OP (nand, ~, &, short, 2, oldval)
+
+SUBWORD_SYNC_OP (add, , +, signed char, 1, oldval)
+SUBWORD_SYNC_OP (sub, , -, signed char, 1, oldval)
+SUBWORD_SYNC_OP (or, , |, signed char, 1, oldval)
+SUBWORD_SYNC_OP (and, , &, signed char, 1, oldval)
+SUBWORD_SYNC_OP (xor, , ^, signed char, 1, oldval)
+SUBWORD_SYNC_OP (nand, ~, &, signed char, 1, oldval)
#define OP_AND_FETCH_WORD(OP, PFX_OP, INF_OP) \
int HIDDEN \
@@ -132,19 +132,19 @@ OP_AND_FETCH_WORD (and, , &)
OP_AND_FETCH_WORD (xor, , ^)
OP_AND_FETCH_WORD (nand, ~, &)
-SUBWORD_SYNC_OP (add, , +, unsigned short, 2, newval)
-SUBWORD_SYNC_OP (sub, , -, unsigned short, 2, newval)
-SUBWORD_SYNC_OP (or, , |, unsigned short, 2, newval)
-SUBWORD_SYNC_OP (and, , &, unsigned short, 2, newval)
-SUBWORD_SYNC_OP (xor, , ^, unsigned short, 2, newval)
-SUBWORD_SYNC_OP (nand, ~, &, unsigned short, 2, newval)
+SUBWORD_SYNC_OP (add, , +, short, 2, newval)
+SUBWORD_SYNC_OP (sub, , -, short, 2, newval)
+SUBWORD_SYNC_OP (or, , |, short, 2, newval)
+SUBWORD_SYNC_OP (and, , &, short, 2, newval)
+SUBWORD_SYNC_OP (xor, , ^, short, 2, newval)
+SUBWORD_SYNC_OP (nand, ~, &, short, 2, newval)
-SUBWORD_SYNC_OP (add, , +, unsigned char, 1, newval)
-SUBWORD_SYNC_OP (sub, , -, unsigned char, 1, newval)
-SUBWORD_SYNC_OP (or, , |, unsigned char, 1, newval)
-SUBWORD_SYNC_OP (and, , &, unsigned char, 1, newval)
-SUBWORD_SYNC_OP (xor, , ^, unsigned char, 1, newval)
-SUBWORD_SYNC_OP (nand, ~, &, unsigned char, 1, newval)
+SUBWORD_SYNC_OP (add, , +, signed char, 1, newval)
+SUBWORD_SYNC_OP (sub, , -, signed char, 1, newval)
+SUBWORD_SYNC_OP (or, , |, signed char, 1, newval)
+SUBWORD_SYNC_OP (and, , &, signed char, 1, newval)
+SUBWORD_SYNC_OP (xor, , ^, signed char, 1, newval)
+SUBWORD_SYNC_OP (nand, ~, &, signed char, 1, newval)
int HIDDEN
__sync_val_compare_and_swap_4 (int *ptr, int oldval, int newval)
@@ -181,7 +181,7 @@ __sync_val_compare_and_swap_4 (int *ptr, int oldval, int newval)
actual_oldval = *wordptr; \
\
if (__builtin_expect (((actual_oldval & mask) >> shift) != \
- (unsigned int) oldval, 0)) \
+ ((unsigned int) oldval & MASK_##WIDTH), 0)) \
return (actual_oldval & mask) >> shift; \
\
actual_newval = (actual_oldval & ~mask) \
@@ -195,8 +195,8 @@ __sync_val_compare_and_swap_4 (int *ptr, int oldval, int newval)
} \
}
-SUBWORD_VAL_CAS (unsigned short, 2)
-SUBWORD_VAL_CAS (unsigned char, 1)
+SUBWORD_VAL_CAS (short, 2)
+SUBWORD_VAL_CAS (signed char, 1)
typedef unsigned char bool;
@@ -217,8 +217,8 @@ __sync_bool_compare_and_swap_4 (int *ptr, int oldval, int newval)
return (oldval == actual_oldval); \
}
-SUBWORD_BOOL_CAS (unsigned short, 2)
-SUBWORD_BOOL_CAS (unsigned char, 1)
+SUBWORD_BOOL_CAS (short, 2)
+SUBWORD_BOOL_CAS (signed char, 1)
void HIDDEN
__sync_synchronize (void)
@@ -260,8 +260,8 @@ __sync_lock_test_and_set_4 (int *ptr, int val)
return (oldval & mask) >> shift; \
}
-SUBWORD_TEST_AND_SET (unsigned short, 2)
-SUBWORD_TEST_AND_SET (unsigned char, 1)
+SUBWORD_TEST_AND_SET (short, 2)
+SUBWORD_TEST_AND_SET (signed char, 1)
#define SYNC_LOCK_RELEASE(TYPE, WIDTH) \
void HIDDEN \