s390.c (s390_preferred_reload_class): Never return ADDR_REGS if it isn't a subset of the given class.

* config/s390/s390.c (s390_preferred_reload_class): Never
	return ADDR_REGS if it isn't a subset of the given class.
	* config/s390/s390.h (REGISTER_MOVE_COST): Penalize not just
	FP_REGS, but all superclasses as well.

	* config/s390/s390.c (s390_function_profiler): Fix thinko.

	* config/s390/s390.md (cmpdi_ccu_mem, cmpsi_ccu_mem,
	cmphi_ccu_mem, cmpqi_ccu_mem): First operand of compare
	must not be a const_int.

From-SVN: r48661
This commit is contained in:
Ulrich Weigand 2002-01-08 21:00:02 +00:00 committed by Ulrich Weigand
parent bd917d3a24
commit 14b3e8ef09
4 changed files with 30 additions and 10 deletions

View File

@ -1,3 +1,16 @@
2002-01-08 Ulrich Weigand <uweigand@de.ibm.com>
* config/s390/s390.c (s390_preferred_reload_class): Never
return ADDR_REGS if it isn't a subset of the given class.
* config/s390/s390.h (REGISTER_MOVE_COST): Penalize not just
FP_REGS, but all superclasses as well.
* config/s390/s390.c (s390_function_profiler): Fix thinko.
* config/s390/s390.md (cmpdi_ccu_mem, cmpsi_ccu_mem,
cmphi_ccu_mem, cmpqi_ccu_mem): First operand of compare
must not be a const_int.
2002-01-08 Richard Henderson <rth@redhat.com>
* Makefile.in (toplev.o): Depend on options.h.

View File

@ -1106,12 +1106,17 @@ s390_preferred_reload_class (op, class)
return NO_REGS;
/* If a symbolic constant or a PLUS is reloaded,
it is most likely being used as an address. */
it is most likely being used as an address, so
prefer ADDR_REGS. If 'class' is not a superset
of ADDR_REGS, e.g. FP_REGS, reject this reload. */
case PLUS:
case LABEL_REF:
case SYMBOL_REF:
case CONST:
return ADDR_REGS;
if (reg_class_subset_p (ADDR_REGS, class))
return ADDR_REGS;
else
return NO_REGS;
default:
break;
@ -3730,8 +3735,8 @@ s390_function_profiler (file, labelno)
output_asm_insn ("st\t%0,%1", op);
output_asm_insn ("bras\t%2,%l6", op);
output_asm_insn (".long\t%3", op);
output_asm_insn (".long\t%4", op);
output_asm_insn (".long\t%3", op);
ASM_OUTPUT_INTERNAL_LABEL (file, "L", CODE_LABEL_NUMBER (op[6]));
output_asm_insn ("l\t%0,0(%2)", op);
output_asm_insn ("l\t%2,4(%2)", op);
@ -3746,8 +3751,8 @@ s390_function_profiler (file, labelno)
output_asm_insn ("st\t%0,%1", op);
output_asm_insn ("bras\t%2,%l6", op);
ASM_OUTPUT_INTERNAL_LABEL (file, "L", CODE_LABEL_NUMBER (op[5]));
output_asm_insn (".long\t%3-%l5", op);
output_asm_insn (".long\t%4-%l5", op);
output_asm_insn (".long\t%3-%l5", op);
ASM_OUTPUT_INTERNAL_LABEL (file, "L", CODE_LABEL_NUMBER (op[6]));
output_asm_insn ("lr\t%0,%2", op);
output_asm_insn ("a\t%0,0(%2)", op);

View File

@ -1228,8 +1228,10 @@ CUMULATIVE_ARGS;
/* On s390, copy between fprs and gprs is expensive. */
#define REGISTER_MOVE_COST(MODE, CLASS1, CLASS2) \
(((CLASS1 != CLASS2) && \
(CLASS1 == FP_REGS || CLASS2 == FP_REGS)) ? 10 : 1)
(( ( reg_classes_intersect_p ((CLASS1), GENERAL_REGS) \
&& reg_classes_intersect_p ((CLASS2), FP_REGS)) \
|| ( reg_classes_intersect_p ((CLASS1), FP_REGS) \
&& reg_classes_intersect_p ((CLASS2), GENERAL_REGS))) ? 10 : 1)
/* A C expression for the cost of moving data of mode M between a

View File

@ -365,7 +365,7 @@
(define_insn "*cmpdi_ccu_mem"
[(set (reg 33)
(compare (match_operand:DI 0 "s_imm_operand" "oQ")
(compare (match_operand:DI 0 "s_operand" "oQ")
(match_operand:DI 1 "s_imm_operand" "oQ")))]
"s390_match_ccmode(insn, CCUmode)"
"clc\\t%O0(8,%R0),%1"
@ -515,7 +515,7 @@
(define_insn "*cmpsi_ccu_mem"
[(set (reg 33)
(compare (match_operand:SI 0 "s_imm_operand" "oQ")
(compare (match_operand:SI 0 "s_operand" "oQ")
(match_operand:SI 1 "s_imm_operand" "oQ")))]
"s390_match_ccmode(insn, CCUmode)"
"clc\\t%O0(4,%R0),%1"
@ -584,7 +584,7 @@
(define_insn "*cmphi_ccu_mem"
[(set (reg 33)
(compare (match_operand:HI 0 "s_imm_operand" "oQ")
(compare (match_operand:HI 0 "s_operand" "oQ")
(match_operand:HI 1 "s_imm_operand" "oQ")))]
"s390_match_ccmode(insn, CCUmode)"
"clc\\t%O0(2,%R0),%1"
@ -706,7 +706,7 @@
(define_insn "*cmpqi_ccu_mem"
[(set (reg 33)
(compare (match_operand:QI 0 "s_imm_operand" "oQ")
(compare (match_operand:QI 0 "s_operand" "oQ")
(match_operand:QI 1 "s_imm_operand" "oQ")))]
"s390_match_ccmode(insn, CCUmode)"
"clc\\t%O0(1,%R0),%1"