Sun Jan 12 12:35:39 2014 UTC ()
Pull up following revision(s) (requested by martin in ticket #1006):
	external/gpl3/gcc/dist/gcc/config/sparc/constraints.md: revision 1.2
	external/gpl3/gcc/dist/gcc/config/sparc/predicates.md: revision 1.2
	external/gpl3/gcc/dist/gcc/config/sparc/sync.md: revision 1.2
Port from newer gcc:
Add a "mem_noofs_operand" predicate and corresponding "w" constraint.
Use those instead of "memory_reg_operand"/"m" for some atomic instrinsic
patterns: casx (and friends) do not accept an offset from the pointer
register (they are synthetic instructions mapping to e.g. casxa [..]
ASI_P, ... and the opcode space encoding offsets in other instructions
is needed to encode the ASI here).
This fixes the build of gtk+-3.10.6 from pkgsrc on sparc64.


(bouyer)
diff -r1.1.1.1 -r1.1.1.1.10.1 src/external/gpl3/gcc/dist/gcc/config/sparc/constraints.md
diff -r1.1.1.1 -r1.1.1.1.10.1 src/external/gpl3/gcc/dist/gcc/config/sparc/predicates.md
diff -r1.1.1.1 -r1.1.1.1.10.1 src/external/gpl3/gcc/dist/gcc/config/sparc/sync.md

cvs diff -r1.1.1.1 -r1.1.1.1.10.1 src/external/gpl3/gcc/dist/gcc/config/sparc/constraints.md (expand / switch to unified diff)

--- src/external/gpl3/gcc/dist/gcc/config/sparc/constraints.md 2011/06/21 01:22:24 1.1.1.1
+++ src/external/gpl3/gcc/dist/gcc/config/sparc/constraints.md 2014/01/12 12:35:39 1.1.1.1.10.1
@@ -131,18 +131,22 @@ @@ -131,18 +131,22 @@
131(define_constraint "U" 131(define_constraint "U"
132 "Pseudo-register or hard even-numbered integer register" 132 "Pseudo-register or hard even-numbered integer register"
133 (and (match_test "TARGET_ARCH32") 133 (and (match_test "TARGET_ARCH32")
134 (match_code "reg") 134 (match_code "reg")
135 (ior (match_test "REGNO (op) < FIRST_PSEUDO_REGISTER") 135 (ior (match_test "REGNO (op) < FIRST_PSEUDO_REGISTER")
136 (not (match_test "reload_in_progress && reg_renumber [REGNO (op)] < 0"))) 136 (not (match_test "reload_in_progress && reg_renumber [REGNO (op)] < 0")))
137 (match_test "register_ok_for_ldd (op)"))) 137 (match_test "register_ok_for_ldd (op)")))
138 138
139;; Equivalent to 'T' but available in 64-bit mode 139;; Equivalent to 'T' but available in 64-bit mode
140(define_constraint "W" 140(define_constraint "W"
141 "Memory reference for 'e' constraint floating-point register" 141 "Memory reference for 'e' constraint floating-point register"
142 (and (match_code "mem,reg") 142 (and (match_code "mem,reg")
143 (match_test "memory_ok_for_ldd (op)"))) 143 (match_test "memory_ok_for_ldd (op)")))
 144
 145(define_memory_constraint "w"
 146 "A memory with only a base register"
 147 (match_operand 0 "mem_noofs_operand"))
144 148
145(define_constraint "Y" 149(define_constraint "Y"
146 "The vector zero constant" 150 "The vector zero constant"
147 (and (match_code "const_vector") 151 (and (match_code "const_vector")
148 (match_test "const_zero_operand (op, mode)"))) 152 (match_test "const_zero_operand (op, mode)")))

cvs diff -r1.1.1.1 -r1.1.1.1.10.1 src/external/gpl3/gcc/dist/gcc/config/sparc/predicates.md (expand / switch to unified diff)

--- src/external/gpl3/gcc/dist/gcc/config/sparc/predicates.md 2011/06/21 01:22:24 1.1.1.1
+++ src/external/gpl3/gcc/dist/gcc/config/sparc/predicates.md 2014/01/12 12:35:39 1.1.1.1.10.1
@@ -417,26 +417,29 @@ @@ -417,26 +417,29 @@
417 417
418;; Return true if OP is an address suitable for a call insn. 418;; Return true if OP is an address suitable for a call insn.
419;; Call insn on SPARC can take a PC-relative constant address 419;; Call insn on SPARC can take a PC-relative constant address
420;; or any regular memory address. 420;; or any regular memory address.
421(define_predicate "call_address_operand" 421(define_predicate "call_address_operand"
422 (ior (match_operand 0 "symbolic_operand") 422 (ior (match_operand 0 "symbolic_operand")
423 (match_test "memory_address_p (Pmode, op)"))) 423 (match_test "memory_address_p (Pmode, op)")))
424 424
425;; Return true if OP is an operand suitable for a call insn. 425;; Return true if OP is an operand suitable for a call insn.
426(define_predicate "call_operand" 426(define_predicate "call_operand"
427 (and (match_code "mem") 427 (and (match_code "mem")
428 (match_test "call_address_operand (XEXP (op, 0), mode)"))) 428 (match_test "call_address_operand (XEXP (op, 0), mode)")))
429 429
 430(define_predicate "mem_noofs_operand"
 431 (and (match_code "mem")
 432 (match_code "reg" "0")))
430 433
431;; Predicates for operators. 434;; Predicates for operators.
432 435
433;; Return true if OP is a comparison operator. This allows the use of 436;; Return true if OP is a comparison operator. This allows the use of
434;; MATCH_OPERATOR to recognize all the branch insns. 437;; MATCH_OPERATOR to recognize all the branch insns.
435(define_predicate "noov_compare_operator" 438(define_predicate "noov_compare_operator"
436 (match_code "ne,eq,ge,gt,le,lt,geu,gtu,leu,ltu") 439 (match_code "ne,eq,ge,gt,le,lt,geu,gtu,leu,ltu")
437{ 440{
438 enum rtx_code code = GET_CODE (op); 441 enum rtx_code code = GET_CODE (op);
439 if (GET_MODE (XEXP (op, 0)) == CC_NOOVmode 442 if (GET_MODE (XEXP (op, 0)) == CC_NOOVmode
440 || GET_MODE (XEXP (op, 0)) == CCX_NOOVmode) 443 || GET_MODE (XEXP (op, 0)) == CCX_NOOVmode)
441 /* These are the only branches which work with CC_NOOVmode. */ 444 /* These are the only branches which work with CC_NOOVmode. */
442 return (code == EQ || code == NE || code == GE || code == LT); 445 return (code == EQ || code == NE || code == GE || code == LT);

cvs diff -r1.1.1.1 -r1.1.1.1.10.1 src/external/gpl3/gcc/dist/gcc/config/sparc/sync.md (expand / switch to unified diff)

--- src/external/gpl3/gcc/dist/gcc/config/sparc/sync.md 2011/06/21 01:22:25 1.1.1.1
+++ src/external/gpl3/gcc/dist/gcc/config/sparc/sync.md 2014/01/12 12:35:39 1.1.1.1.10.1
@@ -71,39 +71,39 @@ @@ -71,39 +71,39 @@
71 UNSPECV_CAS))])] 71 UNSPECV_CAS))])]
72 "TARGET_V9" 72 "TARGET_V9"
73{ 73{
74 if (! REG_P (XEXP (operands[1], 0))) 74 if (! REG_P (XEXP (operands[1], 0)))
75 { 75 {
76 rtx addr = force_reg (Pmode, XEXP (operands[1], 0)); 76 rtx addr = force_reg (Pmode, XEXP (operands[1], 0));
77 operands[1] = replace_equiv_address (operands[1], addr); 77 operands[1] = replace_equiv_address (operands[1], addr);
78 } 78 }
79 emit_insn (gen_memory_barrier ()); 79 emit_insn (gen_memory_barrier ());
80}) 80})
81 81
82(define_insn "*sync_compare_and_swap<mode>" 82(define_insn "*sync_compare_and_swap<mode>"
83 [(set (match_operand:I48MODE 0 "register_operand" "=r") 83 [(set (match_operand:I48MODE 0 "register_operand" "=r")
84 (match_operand:I48MODE 1 "memory_reg_operand" "+m")) 84 (match_operand:I48MODE 1 "mem_noofs_operand" "+w"))
85 (set (match_dup 1) 85 (set (match_dup 1)
86 (unspec_volatile:I48MODE 86 (unspec_volatile:I48MODE
87 [(match_operand:I48MODE 2 "register_operand" "r") 87 [(match_operand:I48MODE 2 "register_operand" "r")
88 (match_operand:I48MODE 3 "register_operand" "0")] 88 (match_operand:I48MODE 3 "register_operand" "0")]
89 UNSPECV_CAS))] 89 UNSPECV_CAS))]
90 "TARGET_V9 && (<MODE>mode == SImode || TARGET_ARCH64)" 90 "TARGET_V9 && (<MODE>mode == SImode || TARGET_ARCH64)"
91 "cas<modesuffix>\t%1, %2, %0" 91 "cas<modesuffix>\t%1, %2, %0"
92 [(set_attr "type" "multi")]) 92 [(set_attr "type" "multi")])
93 93
94(define_insn "*sync_compare_and_swapdi_v8plus" 94(define_insn "*sync_compare_and_swapdi_v8plus"
95 [(set (match_operand:DI 0 "register_operand" "=h") 95 [(set (match_operand:DI 0 "register_operand" "=h")
96 (match_operand:DI 1 "memory_reg_operand" "+m")) 96 (match_operand:DI 1 "mem_noofs_operand" "+w"))
97 (set (match_dup 1) 97 (set (match_dup 1)
98 (unspec_volatile:DI 98 (unspec_volatile:DI
99 [(match_operand:DI 2 "register_operand" "h") 99 [(match_operand:DI 2 "register_operand" "h")
100 (match_operand:DI 3 "register_operand" "0")] 100 (match_operand:DI 3 "register_operand" "0")]
101 UNSPECV_CAS))] 101 UNSPECV_CAS))]
102 "TARGET_V8PLUS" 102 "TARGET_V8PLUS"
103{ 103{
104 if (sparc_check_64 (operands[3], insn) <= 0) 104 if (sparc_check_64 (operands[3], insn) <= 0)
105 output_asm_insn ("srl\t%L3, 0, %L3", operands); 105 output_asm_insn ("srl\t%L3, 0, %L3", operands);
106 output_asm_insn ("sllx\t%H3, 32, %H3", operands); 106 output_asm_insn ("sllx\t%H3, 32, %H3", operands);
107 output_asm_insn ("or\t%L3, %H3, %L3", operands); 107 output_asm_insn ("or\t%L3, %H3, %L3", operands);
108 if (sparc_check_64 (operands[2], insn) <= 0) 108 if (sparc_check_64 (operands[2], insn) <= 0)
109 output_asm_insn ("srl\t%L2, 0, %L2", operands); 109 output_asm_insn ("srl\t%L2, 0, %L2", operands);