From: Uros Bizjak Date: Sun, 4 Jan 2009 11:45:50 +0000 (+0100) Subject: s390.md (UNSPEC_MB): Rename from UNSPECV_MB. X-Git-Tag: releases/gcc-4.4.0~1055 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1a8c13b33ce1470d5a291063a5f5d0beebf421ee;p=thirdparty%2Fgcc.git s390.md (UNSPEC_MB): Rename from UNSPECV_MB. * config/s390/s390.md (UNSPEC_MB): Rename from UNSPECV_MB. (memory_barrier): Expand as unspec instead of unspec_volatile. Remove mem:BLK from insn operands. Use Pmode scratch register. (*memory_barrier): Define as unspec instead of unspec_volatile. Use (match_dup 0) as input operand. * config/sparc/sparc.md (UNSPEC_MEMBAR): Rename from UNSPECV_MEMBAR. * config/sparc/sync.md (memory_barrier): Expand as unspec instead of unspec_volatile. Remove mem:BLK from insn operands. Use Pmode scratch register. Remove operand 1. (*stbar): Define as unspec instead of unspec_volatile. Use (match_dup 0) as input operand, remove (const_int 8). (*membar): Define as unspec instead of unspec_volatile. Use (match_dup 0) as input operand, remove input operand 2. * config/xtensa/xtensa.md (UNSPEC_MEMW): Rename from UNSPECV_MEMW. (memory_barrier): Expand as unspec instead of unspec_volatile. Remove mem:BLK from insn operands. Use Pmode scratch register. (*memory_barrier): Define as unspec instead of unspec_volatile. Use (match_dup 0) as input operand. * config/ia64/sync.md (memory_barrier): Redefine as expander pattern. Remove mem:BLK from insn operands. Use Pmode scratch register. Set volatile flag on operand 0. (*memory_barrier): New insn pattern. * config/rs6000/sync.md (memory_barrier): Remove mem:BLK from insn operands. (*memory_barrier): Use (match_dup 0) as input operand. * config/mips/sync.md (memory_barrier): Redefine as expander pattern. Remove mem:BLK from insn operands. Use Pmode scratch register. Set volatile flag on operand 0. (*memory_barrier): New insn pattern. * config/alpha/sync.md (*memory_barrier): Rename from *mb_internal. From-SVN: r143047 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 627fcb4420a5..bd19cbe26533 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,42 @@ +2009-01-04 Uros Bizjak + + * config/s390/s390.md (UNSPEC_MB): Rename from UNSPECV_MB. + (memory_barrier): Expand as unspec instead of unspec_volatile. + Remove mem:BLK from insn operands. Use Pmode scratch register. + (*memory_barrier): Define as unspec instead of unspec_volatile. + Use (match_dup 0) as input operand. + + * config/sparc/sparc.md (UNSPEC_MEMBAR): Rename from UNSPECV_MEMBAR. + * config/sparc/sync.md (memory_barrier): Expand as unspec instead of + unspec_volatile. Remove mem:BLK from insn operands. Use Pmode + scratch register. Remove operand 1. + (*stbar): Define as unspec instead of unspec_volatile. + Use (match_dup 0) as input operand, remove (const_int 8). + (*membar): Define as unspec instead of unspec_volatile. + Use (match_dup 0) as input operand, remove input operand 2. + + * config/xtensa/xtensa.md (UNSPEC_MEMW): Rename from UNSPECV_MEMW. + (memory_barrier): Expand as unspec instead of unspec_volatile. + Remove mem:BLK from insn operands. Use Pmode scratch register. + (*memory_barrier): Define as unspec instead of unspec_volatile. + Use (match_dup 0) as input operand. + + * config/ia64/sync.md (memory_barrier): Redefine as expander pattern. + Remove mem:BLK from insn operands. Use Pmode scratch register. + Set volatile flag on operand 0. + (*memory_barrier): New insn pattern. + + * config/rs6000/sync.md (memory_barrier): Remove mem:BLK from + insn operands. + (*memory_barrier): Use (match_dup 0) as input operand. + + * config/mips/sync.md (memory_barrier): Redefine as expander pattern. + Remove mem:BLK from insn operands. Use Pmode scratch register. + Set volatile flag on operand 0. + (*memory_barrier): New insn pattern. + + * config/alpha/sync.md (*memory_barrier): Rename from *mb_internal. + 2009-01-04 Steven Bosscher PR middle-end/38586 diff --git a/gcc/config/alpha/sync.md b/gcc/config/alpha/sync.md index 1c7ee45c588b..88087f191012 100644 --- a/gcc/config/alpha/sync.md +++ b/gcc/config/alpha/sync.md @@ -36,7 +36,7 @@ MEM_VOLATILE_P (operands[0]) = 1; }) -(define_insn "*mb_internal" +(define_insn "*memory_barrier" [(set (match_operand:BLK 0 "" "") (unspec:BLK [(match_dup 0)] UNSPEC_MB))] "" diff --git a/gcc/config/ia64/sync.md b/gcc/config/ia64/sync.md index 69b5d08274be..0c2ae2e47a81 100644 --- a/gcc/config/ia64/sync.md +++ b/gcc/config/ia64/sync.md @@ -27,9 +27,18 @@ (define_code_attr fetchop_name [(plus "add") (minus "sub") (ior "ior") (xor "xor") (and "and")]) -(define_insn "memory_barrier" - [(set (mem:BLK (match_scratch:DI 0 "X")) - (unspec:BLK [(mem:BLK (match_scratch:DI 1 "X"))] UNSPEC_MF))] +(define_expand "memory_barrier" + [(set (match_dup 0) + (unspec:BLK [(match_dup 0)] UNSPEC_MF))] + "" +{ + operands[0] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (Pmode)); + MEM_VOLATILE_P (operands[0]) = 1; +}) + +(define_insn "*memory_barrier" + [(set (match_operand:BLK 0 "" "") + (unspec:BLK [(match_dup 0)] UNSPEC_MF))] "" "mf" [(set_attr "itanium_class" "syst_m")]) diff --git a/gcc/config/mips/sync.md b/gcc/config/mips/sync.md index f053be65b223..41266d13563b 100644 --- a/gcc/config/mips/sync.md +++ b/gcc/config/mips/sync.md @@ -27,9 +27,18 @@ ;; Atomic memory operations. -(define_insn "memory_barrier" - [(set (mem:BLK (scratch)) - (unspec:BLK [(const_int 0)] UNSPEC_MEMORY_BARRIER))] +(define_expand "memory_barrier" + [(set (match_dup 0) + (unspec:BLK [(match_dup 0)] UNSPEC_MEMORY_BARRIER))] + "GENERATE_SYNC" +{ + operands[0] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (Pmode)); + MEM_VOLATILE_P (operands[0]) = 1; +}) + +(define_insn "*mb_internal" + [(set (match_operand:BLK 0 "" "") + (unspec:BLK [(match_dup 0)] UNSPEC_MEMORY_BARRIER))] "GENERATE_SYNC" "%|sync%-") diff --git a/gcc/config/rs6000/sync.md b/gcc/config/rs6000/sync.md index 0adc23cfc04b..bb5de392f559 100644 --- a/gcc/config/rs6000/sync.md +++ b/gcc/config/rs6000/sync.md @@ -33,8 +33,8 @@ [(plus "rIL") (minus "r") (ior "rKJF") (xor "rKJF") (and "rSTKJ")]) (define_expand "memory_barrier" - [(set (mem:BLK (match_dup 0)) - (unspec:BLK [(mem:BLK (match_dup 0))] UNSPEC_SYNC))] + [(set (match_dup 0) + (unspec:BLK [(match_dup 0)] UNSPEC_SYNC))] "" { operands[0] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (Pmode)); @@ -43,7 +43,7 @@ (define_insn "*sync_internal" [(set (match_operand:BLK 0 "" "") - (unspec:BLK [(match_operand:BLK 1 "" "")] UNSPEC_SYNC))] + (unspec:BLK [(match_dup 0)] UNSPEC_SYNC))] "" "{dcs|sync}" [(set_attr "type" "sync")]) diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md index 3df8755ba808..e8b50830d583 100644 --- a/gcc/config/s390/s390.md +++ b/gcc/config/s390/s390.md @@ -82,6 +82,9 @@ (UNSPEC_INSN 213) (UNSPEC_EXECUTE 214) + ; Atomic Support + (UNSPEC_MB 400) + ; TLS relocation specifiers (UNSPEC_TLSGD 500) (UNSPEC_TLSLDM 501) @@ -132,8 +135,7 @@ (UNSPECV_SET_TP 500) ; Atomic Support - (UNSPECV_MB 700) - (UNSPECV_CAS 701) + (UNSPECV_CAS 700) ]) ;; @@ -8183,20 +8185,21 @@ ; (define_expand "memory_barrier" - [(set (mem:BLK (match_dup 0)) - (unspec_volatile:BLK [(mem:BLK (match_dup 0))] UNSPECV_MB))] + [(set (match_dup 0) + (unspec:BLK [(match_dup 0)] UNSPEC_MB))] "" { - operands[0] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (DImode)); + operands[0] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (Pmode)); MEM_VOLATILE_P (operands[0]) = 1; }) (define_insn "*memory_barrier" [(set (match_operand:BLK 0 "" "") - (unspec_volatile:BLK [(match_operand:BLK 1 "" "")] UNSPECV_MB))] + (unspec:BLK [(match_dup 0)] UNSPEC_MB))] "" "bcr\t15,0" [(set_attr "op_type" "RR")]) + ; Although bcr is superscalar on Z10, this variant will never become part of ; an execution group. diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md index 0a82e89adf7b..a3eb01f51bda 100644 --- a/gcc/config/sparc/sparc.md +++ b/gcc/config/sparc/sparc.md @@ -38,6 +38,8 @@ (UNSPEC_EMB_TEXTULO 15) (UNSPEC_EMB_SETHM 18) + (UNSPEC_MEMBAR 20) + (UNSPEC_TLSGD 30) (UNSPEC_TLSLDM 31) (UNSPEC_TLSLDO 32) @@ -68,7 +70,6 @@ (UNSPECV_FLUSH 4) (UNSPECV_SETJMP 5) (UNSPECV_SAVEW 6) - (UNSPECV_MEMBAR 7) (UNSPECV_CAS 8) (UNSPECV_SWAP 9) (UNSPECV_LDSTUB 10) diff --git a/gcc/config/sparc/sync.md b/gcc/config/sparc/sync.md index 17cf691d5b48..f1444d8f7672 100644 --- a/gcc/config/sparc/sync.md +++ b/gcc/config/sparc/sync.md @@ -24,36 +24,28 @@ (define_mode_attr modesuffix [(SI "") (DI "x")]) (define_expand "memory_barrier" - [(set (mem:BLK (match_dup 0)) - (unspec_volatile:BLK [(mem:BLK (match_dup 0)) (match_dup 1)] - UNSPECV_MEMBAR))] + [(set (match_dup 0) + (unspec:BLK [(match_dup 0)] UNSPEC_MEMBAR))] "TARGET_V8 || TARGET_V9" { - operands[0] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (DImode)); + operands[0] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (Pmode)); MEM_VOLATILE_P (operands[0]) = 1; - if (TARGET_V9) - /* member #StoreStore | #LoadStore | #StoreLoad | #LoadLoad */ - operands[1] = GEN_INT (15); - else - /* stbar */ - operands[1] = GEN_INT (8); + }) (define_insn "*stbar" [(set (match_operand:BLK 0 "" "") - (unspec_volatile:BLK [(match_operand:BLK 1 "" "") - (const_int 8)] UNSPECV_MEMBAR))] + (unspec:BLK [(match_dup 0)] UNSPEC_MEMBAR))] "TARGET_V8" "stbar" [(set_attr "type" "multi")]) +;; membar #StoreStore | #LoadStore | #StoreLoad | #LoadLoad (define_insn "*membar" [(set (match_operand:BLK 0 "" "") - (unspec_volatile:BLK [(match_operand:BLK 1 "" "") - (match_operand:SI 2 "immediate_operand" "I")] - UNSPECV_MEMBAR))] + (unspec:BLK [(match_dup 0)] UNSPEC_MEMBAR))] "TARGET_V9" - "membar\t%2" + "membar\t15" [(set_attr "type" "multi")]) (define_expand "sync_compare_and_swap" diff --git a/gcc/config/xtensa/xtensa.md b/gcc/config/xtensa/xtensa.md index abaf29d73333..d0e4772cc839 100644 --- a/gcc/config/xtensa/xtensa.md +++ b/gcc/config/xtensa/xtensa.md @@ -35,10 +35,10 @@ (UNSPEC_TLS_ARG 8) (UNSPEC_TLS_CALL 9) (UNSPEC_TP 10) + (UNSPEC_MEMW 11) (UNSPECV_SET_FP 1) (UNSPECV_ENTRY 2) - (UNSPECV_MEMW 3) (UNSPECV_S32RI 4) (UNSPECV_S32C1I 5) (UNSPECV_EH_RETURN 6) @@ -1819,17 +1819,17 @@ ;; Atomic operations (define_expand "memory_barrier" - [(set (mem:BLK (match_dup 0)) - (unspec_volatile:BLK [(mem:BLK (match_dup 0))] UNSPECV_MEMW))] + [(set (match_dup 0) + (unspec:BLK [(match_dup 0)] UNSPEC_MEMW))] "" { - operands[0] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (SImode)); + operands[0] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (Pmode)); MEM_VOLATILE_P (operands[0]) = 1; }) (define_insn "*memory_barrier" [(set (match_operand:BLK 0 "" "") - (unspec_volatile:BLK [(match_operand:BLK 1 "" "")] UNSPECV_MEMW))] + (unspec:BLK [(match_dup 0)] UNSPEC_MEMW))] "" "memw" [(set_attr "type" "unknown")