Commit 55953cea by Richard Henderson Committed by Richard Henderson

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
parent 37834fc8
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> Sat Sep 5 14:23:31 1998 Torbjorn Granlund <tege@matematik.su.se>
* m68k.md (zero_extendsidi2): Fix typo. * m68k.md (zero_extendsidi2): Fix typo.
......
...@@ -932,7 +932,8 @@ enum reg_class ...@@ -932,7 +932,8 @@ enum reg_class
movdf to do mem-to-mem moves through integer regs. */ movdf to do mem-to-mem moves through integer regs. */
#define PREFERRED_RELOAD_CLASS(X,CLASS) \ #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 \ : GET_MODE (X) == QImode && ! reg_class_subset_p (CLASS, Q_REGS) ? Q_REGS \
: ((CLASS) == ALL_REGS \ : ((CLASS) == ALL_REGS \
&& GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT) ? GENERAL_REGS \ && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT) ? GENERAL_REGS \
......
...@@ -1234,27 +1234,14 @@ ...@@ -1234,27 +1234,14 @@
} }
/* If we are loading a floating point constant that isn't 0 or 1 /* 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 into a register, force the value to memory now, since we'll
be optimized into stores of constants if the target eventually moves get better code out the back end. */
to memory, but better safe than sorry. */
else if ((reload_in_progress | reload_completed) == 0 else if ((reload_in_progress | reload_completed) == 0
&& GET_CODE (operands[0]) != MEM && GET_CODE (operands[0]) != MEM
&& GET_CODE (operands[1]) == CONST_DOUBLE && GET_CODE (operands[1]) == CONST_DOUBLE
&& !standard_80387_constant_p (operands[1])) && !standard_80387_constant_p (operands[1]))
{ {
rtx insn, note, fp_const; operands[1] = validize_mem (force_const_mem (SFmode, operands[1]));
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));
} }
}") }")
...@@ -1330,6 +1317,7 @@ ...@@ -1330,6 +1317,7 @@
return AS1 (fxch,%0); return AS1 (fxch,%0);
}") }")
(define_insn "movdf_push" (define_insn "movdf_push"
[(set (match_operand:DF 0 "push_operand" "=<,<") [(set (match_operand:DF 0 "push_operand" "=<,<")
(match_operand:DF 1 "general_operand" "*rfF,o"))] (match_operand:DF 1 "general_operand" "*rfF,o"))]
...@@ -1386,23 +1374,11 @@ ...@@ -1386,23 +1374,11 @@
optimized into stores of constants if the target eventually moves to optimized into stores of constants if the target eventually moves to
memory, but better safe than sorry. */ memory, but better safe than sorry. */
else if ((reload_in_progress | reload_completed) == 0 else if ((reload_in_progress | reload_completed) == 0
&& GET_CODE (operands[0]) != MEM && GET_CODE (operands[0]) != MEM
&& GET_CODE (operands[1]) == CONST_DOUBLE && GET_CODE (operands[1]) == CONST_DOUBLE
&& !standard_80387_constant_p (operands[1])) && !standard_80387_constant_p (operands[1]))
{ {
rtx insn, note, fp_const; operands[1] = validize_mem (force_const_mem (DFmode, operands[1]));
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));
} }
}") }")
...@@ -1535,23 +1511,11 @@ ...@@ -1535,23 +1511,11 @@
be optimized into stores of constants if the target eventually moves be optimized into stores of constants if the target eventually moves
to memory, but better safe than sorry. */ to memory, but better safe than sorry. */
else if ((reload_in_progress | reload_completed) == 0 else if ((reload_in_progress | reload_completed) == 0
&& GET_CODE (operands[0]) != MEM && GET_CODE (operands[0]) != MEM
&& GET_CODE (operands[1]) == CONST_DOUBLE && GET_CODE (operands[1]) == CONST_DOUBLE
&& !standard_80387_constant_p (operands[1])) && !standard_80387_constant_p (operands[1]))
{ {
rtx insn, note, fp_const; operands[1] = validize_mem (force_const_mem (XFmode, operands[1]));
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));
} }
}") }")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment