diff options
author | dje <dje@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-01-01 22:00:46 +0000 |
---|---|---|
committer | dje <dje@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-01-01 22:00:46 +0000 |
commit | dee88a74160a09e285a4ddd520b864dd0971dca5 (patch) | |
tree | cb210fda84354e74042ad3bd3e9ca3a46603cc81 /gcc/config/rs6000/sync.md | |
parent | 9815425b85a72d2c663dd09e2e7aa02af7c1b5b3 (diff) | |
download | gcc-dee88a74160a09e285a4ddd520b864dd0971dca5.tar.gz |
* config/rs6000/rs6000.c (rs6000_expand_compare_and_swapqhi): New.
(rs6000_split_compare_and_swapqhi): New.
* config/rs6000/sync.md (sync_compare_and_swap{hi,qi}): New.
(sync_compare_and_swapqhi_internal): New.
* config/rs6000/rs6000-protos.h: Declare.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109226 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/rs6000/sync.md')
-rw-r--r-- | gcc/config/rs6000/sync.md | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/gcc/config/rs6000/sync.md b/gcc/config/rs6000/sync.md index 92a42237605..b244ef63986 100644 --- a/gcc/config/rs6000/sync.md +++ b/gcc/config/rs6000/sync.md @@ -86,6 +86,52 @@ DONE; }) +(define_expand "sync_compare_and_swaphi" + [(match_operand:HI 0 "gpc_reg_operand" "") + (match_operand:HI 1 "memory_operand" "") + (match_operand:HI 2 "gpc_reg_operand" "") + (match_operand:HI 3 "gpc_reg_operand" "")] + "TARGET_POWERPC" +{ + rs6000_expand_compare_and_swapqhi (operands[0], operands[1], + operands[2], operands[3]); + DONE; +}) + +(define_expand "sync_compare_and_swapqi" + [(match_operand:QI 0 "gpc_reg_operand" "") + (match_operand:QI 1 "memory_operand" "") + (match_operand:QI 2 "gpc_reg_operand" "") + (match_operand:QI 3 "gpc_reg_operand" "")] + "TARGET_POWERPC" +{ + rs6000_expand_compare_and_swapqhi (operands[0], operands[1], + operands[2], operands[3]); + DONE; +}) + +(define_insn_and_split "sync_compare_and_swapqhi_internal" + [(set (match_operand:SI 0 "gpc_reg_operand" "=&r") + (match_operand:SI 4 "memory_operand" "+Z")) + (set (match_dup 4) + (unspec:SI + [(match_operand:SI 1 "gpc_reg_operand" "r") + (match_operand:SI 2 "gpc_reg_operand" "r") + (match_operand:SI 3 "gpc_reg_operand" "r")] + UNSPEC_CMPXCHG)) + (clobber (match_scratch:SI 5 "=&r")) + (clobber (match_scratch:CC 6 "=&x"))] + "TARGET_POWERPC" + "#" + "&& reload_completed" + [(const_int 0)] +{ + rs6000_split_compare_and_swapqhi (operands[0], operands[1], + operands[2], operands[3], operands[4], + operands[5]); + DONE; +}) + (define_insn_and_split "sync_lock_test_and_set<mode>" [(set (match_operand:GPR 0 "gpc_reg_operand" "=&r") (match_operand:GPR 1 "memory_operand" "+Z")) |