aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <rth@cygnus.com>1998-09-05 07:50:25 -0700
committerRichard Henderson <rth@gcc.gnu.org>1998-09-05 07:50:25 -0700
commit55953cea37e38f43343078f92e208fd3d1ad756d (patch)
treee65d8d30522639992463a28b9295dfde7427ff23
parent37834fc834858b246daa77fbdb3d66f458734037 (diff)
downloadgcc-55953cea37e38f43343078f92e208fd3d1ad756d.zip
gcc-55953cea37e38f43343078f92e208fd3d1ad756d.tar.gz
gcc-55953cea37e38f43343078f92e208fd3d1ad756d.tar.bz2
i386.h (PREFERRED_RELOAD_CLASS): Standard fp constants load to TOS.
* i386.h (PREFERRED_RELOAD_CLASS): Standard fp constants load to TOS. * i386.md (movsf, movdf, movxf): Validate memory address returned from force_const_mem. Kill useless REG_EQUAL setting code. From-SVN: r22269
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/i386/i386.h3
-rw-r--r--gcc/config/i386/i386.md66
3 files changed, 23 insertions, 52 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 912533d..8b65a18 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+Sat Sep 5 14:47:17 1998 Richard Henderson <rth@cygnus.com>
+
+ * i386.h (PREFERRED_RELOAD_CLASS): Standard fp constants load to TOS.
+ * i386.md (movsf, movdf, movxf): Validate memory address returned
+ from force_const_mem. Kill useless REG_EQUAL setting code.
+
Sat Sep 5 14:23:31 1998 Torbjorn Granlund <tege@matematik.su.se>
* m68k.md (zero_extendsidi2): Fix typo.
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 75e0298..7e3f723 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -932,7 +932,8 @@ enum reg_class
movdf to do mem-to-mem moves through integer regs. */
#define PREFERRED_RELOAD_CLASS(X,CLASS) \
- (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) != VOIDmode ? NO_REGS \
+ (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) != VOIDmode \
+ ? (standard_80387_constant_p (X) ? FP_TOP_REG : NO_REGS) \
: GET_MODE (X) == QImode && ! reg_class_subset_p (CLASS, Q_REGS) ? Q_REGS \
: ((CLASS) == ALL_REGS \
&& GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT) ? GENERAL_REGS \
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index e65ca1c..69134dd 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -1234,27 +1234,14 @@
}
/* If we are loading a floating point constant that isn't 0 or 1
- into a register, indicate we need the pic register loaded. This could
- be optimized into stores of constants if the target eventually moves
- to memory, but better safe than sorry. */
+ into a register, force the value to memory now, since we'll
+ get better code out the back end. */
else if ((reload_in_progress | reload_completed) == 0
- && GET_CODE (operands[0]) != MEM
- && GET_CODE (operands[1]) == CONST_DOUBLE
- && !standard_80387_constant_p (operands[1]))
+ && GET_CODE (operands[0]) != MEM
+ && GET_CODE (operands[1]) == CONST_DOUBLE
+ && !standard_80387_constant_p (operands[1]))
{
- rtx insn, note, fp_const;
-
- fp_const = force_const_mem (SFmode, operands[1]);
- if (flag_pic)
- current_function_uses_pic_offset_table = 1;
-
- insn = emit_insn (gen_rtx_SET (SFmode, operands[0], fp_const));
- note = find_reg_note (insn, REG_EQUAL, NULL_RTX);
-
- if (note)
- XEXP (note, 0) = operands[1];
- else
- REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUAL, operands[1], REG_NOTES (insn));
+ operands[1] = validize_mem (force_const_mem (SFmode, operands[1]));
}
}")
@@ -1330,6 +1317,7 @@
return AS1 (fxch,%0);
}")
+
(define_insn "movdf_push"
[(set (match_operand:DF 0 "push_operand" "=<,<")
(match_operand:DF 1 "general_operand" "*rfF,o"))]
@@ -1386,23 +1374,11 @@
optimized into stores of constants if the target eventually moves to
memory, but better safe than sorry. */
else if ((reload_in_progress | reload_completed) == 0
- && GET_CODE (operands[0]) != MEM
- && GET_CODE (operands[1]) == CONST_DOUBLE
- && !standard_80387_constant_p (operands[1]))
+ && GET_CODE (operands[0]) != MEM
+ && GET_CODE (operands[1]) == CONST_DOUBLE
+ && !standard_80387_constant_p (operands[1]))
{
- rtx insn, note, fp_const;
-
- fp_const = force_const_mem (DFmode, operands[1]);
- if (flag_pic)
- current_function_uses_pic_offset_table = 1;
-
- insn = emit_insn (gen_rtx_SET (DFmode, operands[0], fp_const));
- note = find_reg_note (insn, REG_EQUAL, NULL_RTX);
-
- if (note)
- XEXP (note, 0) = operands[1];
- else
- REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUAL, operands[1], REG_NOTES (insn));
+ operands[1] = validize_mem (force_const_mem (DFmode, operands[1]));
}
}")
@@ -1535,23 +1511,11 @@
be optimized into stores of constants if the target eventually moves
to memory, but better safe than sorry. */
else if ((reload_in_progress | reload_completed) == 0
- && GET_CODE (operands[0]) != MEM
- && GET_CODE (operands[1]) == CONST_DOUBLE
- && !standard_80387_constant_p (operands[1]))
+ && GET_CODE (operands[0]) != MEM
+ && GET_CODE (operands[1]) == CONST_DOUBLE
+ && !standard_80387_constant_p (operands[1]))
{
- rtx insn, note, fp_const;
-
- fp_const = force_const_mem (XFmode, operands[1]);
- if (flag_pic)
- current_function_uses_pic_offset_table = 1;
-
- insn = emit_insn (gen_rtx_SET (XFmode, operands[0], fp_const));
- note = find_reg_note (insn, REG_EQUAL, NULL_RTX);
-
- if (note)
- XEXP (note, 0) = operands[1];
- else
- REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUAL, operands[1], REG_NOTES (insn));
+ operands[1] = validize_mem (force_const_mem (XFmode, operands[1]));
}
}")