aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorUros Bizjak <uros@gcc.gnu.org>2013-01-14 17:44:55 +0100
committerUros Bizjak <uros@gcc.gnu.org>2013-01-14 17:44:55 +0100
commite6f0e05240317c022d19de26508730b9b7d81299 (patch)
tree8dabc46decc226ac7e33e4c8b887522986bde774 /gcc/config
parent197fa28c0eb545670416129d3bb545dd13ddfa1a (diff)
downloadgcc-e6f0e05240317c022d19de26508730b9b7d81299.zip
gcc-e6f0e05240317c022d19de26508730b9b7d81299.tar.gz
gcc-e6f0e05240317c022d19de26508730b9b7d81299.tar.bz2
re PR target/55948 (__atomic_clear / __atomic_store_n ignore HLE_RELEASE flags)
PR target/55948 * config/i386/sync.md (atomic_store<mode>_1): New pattern. (atomic_store<mode>): Call atomic_store<mode>_1 for IX86_HLE_RELEASE memmodel flag. testsuite/ChangeLog PR target/55948 * gcc.target/i386/hle-clear-rel.c: New file * gcc.target/i386/hle-store-rel.c: New file. From-SVN: r195155
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/i386/sync.md16
1 files changed, 14 insertions, 2 deletions
diff --git a/gcc/config/i386/sync.md b/gcc/config/i386/sync.md
index 83198b9..2309c83 100644
--- a/gcc/config/i386/sync.md
+++ b/gcc/config/i386/sync.md
@@ -224,8 +224,12 @@
DONE;
}
- /* Otherwise use a normal store. */
- emit_move_insn (operands[0], operands[1]);
+ /* Otherwise use a store. */
+ if (INTVAL (operands[2]) & IX86_HLE_RELEASE)
+ emit_insn (gen_atomic_store<mode>_1 (operands[0], operands[1],
+ operands[2]));
+ else
+ emit_move_insn (operands[0], operands[1]);
}
/* ... followed by an MFENCE, if required. */
if (model == MEMMODEL_SEQ_CST)
@@ -233,6 +237,14 @@
DONE;
})
+(define_insn "atomic_store<mode>_1"
+ [(set (match_operand:ATOMIC 0 "memory_operand" "=m")
+ (unspec:ATOMIC [(match_operand:ATOMIC 1 "<nonmemory_operand>" "<r><i>")
+ (match_operand:SI 2 "const_int_operand")]
+ UNSPEC_MOVA))]
+ ""
+ "%K2mov{<imodesuffix>}\t{%1, %0|%0, %1}")
+
(define_insn_and_split "atomic_storedi_fpu"
[(set (match_operand:DI 0 "memory_operand" "=m,m,m")
(unspec:DI [(match_operand:DI 1 "register_operand" "x,m,?r")]