diff options
author | Jakub Jelinek <jakub@redhat.com> | 2005-12-22 16:43:34 -0800 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2005-12-22 16:43:34 -0800 |
commit | a0274e3e23a38ee21e35b50e778bb1107322b762 (patch) | |
tree | 225e7d74032f42f96e15423bfcbf7cdf88e6d1e8 /gcc/builtins.c | |
parent | c52243fe1103584323ced1e66d601233c23a4b75 (diff) | |
download | gcc-a0274e3e23a38ee21e35b50e778bb1107322b762.zip gcc-a0274e3e23a38ee21e35b50e778bb1107322b762.tar.gz gcc-a0274e3e23a38ee21e35b50e778bb1107322b762.tar.bz2 |
backport: builtins.def: Move all DEF_SYNC_BUILTIN to ...
Merge from gomp-branch.
* builtins.def: Move all DEF_SYNC_BUILTIN to ...
* sync-builtins.def: ... new file.
(BUILT_IN_FETCH_AND_ADD_16,
BUILT_IN_FETCH_AND_SUB_16, BUILT_IN_FETCH_AND_OR_16,
BUILT_IN_FETCH_AND_AND_16, BUILT_IN_FETCH_AND_XOR_16,
BUILT_IN_FETCH_AND_NAND_16, BUILT_IN_ADD_AND_FETCH_16,
BUILT_IN_SUB_AND_FETCH_16, BUILT_IN_OR_AND_FETCH_16,
BUILT_IN_AND_AND_FETCH_16, BUILT_IN_XOR_AND_FETCH_16,
BUILT_IN_NAND_AND_FETCH_16, BUILT_IN_BOOL_COMPARE_AND_SWAP_16,
BUILT_IN_VAL_COMPARE_AND_SWAP_16, BUILT_IN_LOCK_TEST_AND_SET_16,
BUILT_IN_LOCK_RELEASE_16): New builtins.
* builtin-types.def (BT_I16, BT_FN_I16_VPTR_I16,
BT_FN_BOOL_VPTR_I16_I16, BT_FN_I16_VPTR_I16_I16): Add.
* builtins.c (expand_builtin): Handle sync BUILT_IN_*_16 builtins.
* c-common.c (enum c_builtin_type): Move to top-level from
c_common_nodes_and_builtins enum builtin_type.
(builtin_types): Move from c_common_nodes_and_builtins.
(def_fn_type): New.
(c_common_nodes_and_builtins): Use it.
(def_builtin_1): Check for error_mark_node.
(sync_resolve_size): Handle also 128 bit sync builtins.
* Makefile.in (BUILTINS_DEF): New. Use it instead of builtins.def.
* config/i386/i386.h (x86_cmpxchg8b, x86_cmpxchg16b): New decls.
(TARGET_CMPXCHG8B, TARGET_CMPXCHG16B): Define.
* config/i386/i386.c (x86_cmpxchg8b, x86_cmpxchg16b): New variables.
* config/i386/sync.md (CASMODE, DCASMODE): New mode macros.
(doublemodesuffix, DCASHMODE): New mode attrs.
(sync_compare_and_swap<mode>): Change into expand, use CASMODE
instead of IMODE, if mode is wider than a word, expand into
sync_double_compare_and_swap*.
(*sync_compare_and_swap<mode>): New insn.
(sync_double_compare_and_swap<mode>): Likewise.
(*sync_double_compare_and_swapdi_pic): Likewise.
(sync_compare_and_swap_cc<mode>): Use CASMODE instead of IMODE, if
mode is wider than a word, expand into
sync_double_compare_and_swap_cc*.
(sync_double_compare_and_swap_cc<mode>): New insn.
(*sync_double_compare_and_swap_ccdi_pic): Likewise.
From-SVN: r108997
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r-- | gcc/builtins.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c index 7c57111..90cb021 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -6073,6 +6073,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, case BUILT_IN_FETCH_AND_ADD_2: case BUILT_IN_FETCH_AND_ADD_4: case BUILT_IN_FETCH_AND_ADD_8: + case BUILT_IN_FETCH_AND_ADD_16: mode = get_builtin_sync_mode (fcode - BUILT_IN_FETCH_AND_ADD_1); target = expand_builtin_sync_operation (mode, arglist, PLUS, false, target, ignore); @@ -6084,6 +6085,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, case BUILT_IN_FETCH_AND_SUB_2: case BUILT_IN_FETCH_AND_SUB_4: case BUILT_IN_FETCH_AND_SUB_8: + case BUILT_IN_FETCH_AND_SUB_16: mode = get_builtin_sync_mode (fcode - BUILT_IN_FETCH_AND_SUB_1); target = expand_builtin_sync_operation (mode, arglist, MINUS, false, target, ignore); @@ -6095,6 +6097,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, case BUILT_IN_FETCH_AND_OR_2: case BUILT_IN_FETCH_AND_OR_4: case BUILT_IN_FETCH_AND_OR_8: + case BUILT_IN_FETCH_AND_OR_16: mode = get_builtin_sync_mode (fcode - BUILT_IN_FETCH_AND_OR_1); target = expand_builtin_sync_operation (mode, arglist, IOR, false, target, ignore); @@ -6106,6 +6109,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, case BUILT_IN_FETCH_AND_AND_2: case BUILT_IN_FETCH_AND_AND_4: case BUILT_IN_FETCH_AND_AND_8: + case BUILT_IN_FETCH_AND_AND_16: mode = get_builtin_sync_mode (fcode - BUILT_IN_FETCH_AND_AND_1); target = expand_builtin_sync_operation (mode, arglist, AND, false, target, ignore); @@ -6117,6 +6121,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, case BUILT_IN_FETCH_AND_XOR_2: case BUILT_IN_FETCH_AND_XOR_4: case BUILT_IN_FETCH_AND_XOR_8: + case BUILT_IN_FETCH_AND_XOR_16: mode = get_builtin_sync_mode (fcode - BUILT_IN_FETCH_AND_XOR_1); target = expand_builtin_sync_operation (mode, arglist, XOR, false, target, ignore); @@ -6128,6 +6133,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, case BUILT_IN_FETCH_AND_NAND_2: case BUILT_IN_FETCH_AND_NAND_4: case BUILT_IN_FETCH_AND_NAND_8: + case BUILT_IN_FETCH_AND_NAND_16: mode = get_builtin_sync_mode (fcode - BUILT_IN_FETCH_AND_NAND_1); target = expand_builtin_sync_operation (mode, arglist, NOT, false, target, ignore); @@ -6139,6 +6145,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, case BUILT_IN_ADD_AND_FETCH_2: case BUILT_IN_ADD_AND_FETCH_4: case BUILT_IN_ADD_AND_FETCH_8: + case BUILT_IN_ADD_AND_FETCH_16: mode = get_builtin_sync_mode (fcode - BUILT_IN_ADD_AND_FETCH_1); target = expand_builtin_sync_operation (mode, arglist, PLUS, true, target, ignore); @@ -6150,6 +6157,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, case BUILT_IN_SUB_AND_FETCH_2: case BUILT_IN_SUB_AND_FETCH_4: case BUILT_IN_SUB_AND_FETCH_8: + case BUILT_IN_SUB_AND_FETCH_16: mode = get_builtin_sync_mode (fcode - BUILT_IN_SUB_AND_FETCH_1); target = expand_builtin_sync_operation (mode, arglist, MINUS, true, target, ignore); @@ -6161,6 +6169,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, case BUILT_IN_OR_AND_FETCH_2: case BUILT_IN_OR_AND_FETCH_4: case BUILT_IN_OR_AND_FETCH_8: + case BUILT_IN_OR_AND_FETCH_16: mode = get_builtin_sync_mode (fcode - BUILT_IN_OR_AND_FETCH_1); target = expand_builtin_sync_operation (mode, arglist, IOR, true, target, ignore); @@ -6172,6 +6181,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, case BUILT_IN_AND_AND_FETCH_2: case BUILT_IN_AND_AND_FETCH_4: case BUILT_IN_AND_AND_FETCH_8: + case BUILT_IN_AND_AND_FETCH_16: mode = get_builtin_sync_mode (fcode - BUILT_IN_AND_AND_FETCH_1); target = expand_builtin_sync_operation (mode, arglist, AND, true, target, ignore); @@ -6183,6 +6193,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, case BUILT_IN_XOR_AND_FETCH_2: case BUILT_IN_XOR_AND_FETCH_4: case BUILT_IN_XOR_AND_FETCH_8: + case BUILT_IN_XOR_AND_FETCH_16: mode = get_builtin_sync_mode (fcode - BUILT_IN_XOR_AND_FETCH_1); target = expand_builtin_sync_operation (mode, arglist, XOR, true, target, ignore); @@ -6194,6 +6205,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, case BUILT_IN_NAND_AND_FETCH_2: case BUILT_IN_NAND_AND_FETCH_4: case BUILT_IN_NAND_AND_FETCH_8: + case BUILT_IN_NAND_AND_FETCH_16: mode = get_builtin_sync_mode (fcode - BUILT_IN_NAND_AND_FETCH_1); target = expand_builtin_sync_operation (mode, arglist, NOT, true, target, ignore); @@ -6205,6 +6217,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, case BUILT_IN_BOOL_COMPARE_AND_SWAP_2: case BUILT_IN_BOOL_COMPARE_AND_SWAP_4: case BUILT_IN_BOOL_COMPARE_AND_SWAP_8: + case BUILT_IN_BOOL_COMPARE_AND_SWAP_16: if (mode == VOIDmode) mode = TYPE_MODE (boolean_type_node); if (!target || !register_operand (target, mode)) @@ -6220,6 +6233,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, case BUILT_IN_VAL_COMPARE_AND_SWAP_2: case BUILT_IN_VAL_COMPARE_AND_SWAP_4: case BUILT_IN_VAL_COMPARE_AND_SWAP_8: + case BUILT_IN_VAL_COMPARE_AND_SWAP_16: mode = get_builtin_sync_mode (fcode - BUILT_IN_VAL_COMPARE_AND_SWAP_1); target = expand_builtin_compare_and_swap (mode, arglist, false, target); if (target) @@ -6230,6 +6244,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, case BUILT_IN_LOCK_TEST_AND_SET_2: case BUILT_IN_LOCK_TEST_AND_SET_4: case BUILT_IN_LOCK_TEST_AND_SET_8: + case BUILT_IN_LOCK_TEST_AND_SET_16: mode = get_builtin_sync_mode (fcode - BUILT_IN_LOCK_TEST_AND_SET_1); target = expand_builtin_lock_test_and_set (mode, arglist, target); if (target) @@ -6240,6 +6255,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, case BUILT_IN_LOCK_RELEASE_2: case BUILT_IN_LOCK_RELEASE_4: case BUILT_IN_LOCK_RELEASE_8: + case BUILT_IN_LOCK_RELEASE_16: mode = get_builtin_sync_mode (fcode - BUILT_IN_LOCK_RELEASE_1); expand_builtin_lock_release (mode, arglist); return const0_rtx; |