s390.c (s390_preferred_reload_class): Never return ADDR_REGS if it isn't a subset...
authorUlrich Weigand <uweigand@de.ibm.com>
Tue, 8 Jan 2002 21:00:02 +0000 (21:00 +0000)
committerUlrich Weigand <uweigand@gcc.gnu.org>
Tue, 8 Jan 2002 21:00:02 +0000 (21:00 +0000)
* 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

gcc/ChangeLog
gcc/config/s390/s390.c
gcc/config/s390/s390.h
gcc/config/s390/s390.md

index 03f1643f98046662abd772dfb2e6522f50c737ee..99c9c0bd4966d43afa2885b1944d751411478ba5 100644 (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.
index 83de4da2cc1a3eacc50069e1cfae018f7adcfe57..f1f45ccf8155695db3b3f3c03dd653d95adfc338 100644 (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);
index b1583399a077829f58d5b41c6832111153c3544c..99a4318f8b880d21911b9fc5a6c3ae5315a00c30 100644 (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
index 31822c9413ca2e6085ec1cb31632fcca130450f2..68fe9e71717eb309efa8b1afd0b69c547e71a3da 100644 (file)
 
 (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"
 
 (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"
 
 (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"
 
 (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"