aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2004-04-12 23:23:16 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2004-04-12 23:23:16 +0000
commit5ea9cb6ede38250fa0fef5928908d10ba13e63d0 (patch)
tree3fa86f7ce4c6891a3230a78c0029036923ddbc85 /gcc
parent1c9766da11d71cb57f8962a2eb88833c1ca966f5 (diff)
downloadgcc-5ea9cb6ede38250fa0fef5928908d10ba13e63d0.zip
gcc-5ea9cb6ede38250fa0fef5928908d10ba13e63d0.tar.gz
gcc-5ea9cb6ede38250fa0fef5928908d10ba13e63d0.tar.bz2
i386.c (output_387_reg_move): New function.
* config/i386/i386.c (output_387_reg_move): New function. * config/i386/i386-protos.h (output_387_reg_move): Prototype here. * config/i386/i386.md (*movsf_1, *movsf1_nointerunit, *movdf_nointeger, *movdf_integer, *movxf_nointeger, *movxf_integer, *extendsfdf2_1, *extendsfxf2_1, *extenddfxf2_1, truncdfsf2_noop, truncxfsf2_noop, truncxfdf2_noop): Call output_387_reg_move. From-SVN: r80631
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/config/i386/i386-protos.h1
-rw-r--r--gcc/config/i386/i386.c19
-rw-r--r--gcc/config/i386/i386.md123
4 files changed, 42 insertions, 110 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 72ec5b5..504da82 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+2004-04-12 Roger Sayle <roger@eyesopen.com>
+
+ * config/i386/i386.c (output_387_reg_move): New function.
+ * config/i386/i386-protos.h (output_387_reg_move): Prototype here.
+ * config/i386/i386.md (*movsf_1, *movsf1_nointerunit,
+ *movdf_nointeger, *movdf_integer, *movxf_nointeger, *movxf_integer,
+ *extendsfdf2_1, *extendsfxf2_1, *extenddfxf2_1, truncdfsf2_noop,
+ truncxfsf2_noop, truncxfdf2_noop): Call output_387_reg_move.
+
2004-04-12 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* c-decl.c (finish_decl): Make a decl_stmt for a variable-sized
diff --git a/gcc/config/i386/i386-protos.h b/gcc/config/i386/i386-protos.h
index 947f15d..d95be60 100644
--- a/gcc/config/i386/i386-protos.h
+++ b/gcc/config/i386/i386-protos.h
@@ -117,6 +117,7 @@ extern void split_ti (rtx[], int, rtx[], rtx[]);
extern const char *output_set_got (rtx);
extern const char *output_387_binary_op (rtx, rtx*);
+extern const char *output_387_reg_move (rtx, rtx*);
extern const char *output_fix_trunc (rtx, rtx*);
extern const char *output_fp_compare (rtx, rtx*, int, int);
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index f2da7e0..615f2ee 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -15909,4 +15909,23 @@ ix86_reverse_condition (enum rtx_code code, enum machine_mode mode)
: reverse_condition_maybe_unordered (code));
}
+/* Output code to perform an x87 FP register move, from OPERANDS[1]
+ to OPERANDS[0]. */
+
+const char *
+output_387_reg_move (rtx insn, rtx *operands)
+{
+ if (REG_P (operands[1])
+ && find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
+ {
+ if (REGNO (operands[0]) == FIRST_STACK_REG
+ && TARGET_USE_FFREEP)
+ return "ffreep\t%y0";
+ return "fstp\t%y0";
+ }
+ if (STACK_TOP_P (operands[0]))
+ return "fld%z1\t%y1";
+ return "fst\t%y0";
+}
+
#include "gt-i386.h"
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index a9d8eed..c8590d5 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -2197,13 +2197,7 @@
switch (which_alternative)
{
case 0:
- if (REG_P (operands[1])
- && find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
- return "fstp\t%y0";
- else if (STACK_TOP_P (operands[0]))
- return "fld%z1\t%y1";
- else
- return "fst\t%y0";
+ return output_387_reg_move (insn, operands);
case 1:
if (find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
@@ -2291,18 +2285,7 @@
switch (which_alternative)
{
case 0:
- if (REG_P (operands[1])
- && find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
- {
- if (REGNO (operands[0]) == FIRST_STACK_REG
- && TARGET_USE_FFREEP)
- return "ffreep\t%y0";
- return "fstp\t%y0";
- }
- else if (STACK_TOP_P (operands[0]))
- return "fld%z1\t%y1";
- else
- return "fst\t%y0";
+ return output_387_reg_move (insn, operands);
case 1:
if (find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
@@ -2466,18 +2449,7 @@
switch (which_alternative)
{
case 0:
- if (REG_P (operands[1])
- && find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
- {
- if (REGNO (operands[0]) == FIRST_STACK_REG
- && TARGET_USE_FFREEP)
- return "ffreep\t%y0";
- return "fstp\t%y0";
- }
- else if (STACK_TOP_P (operands[0]))
- return "fld%z1\t%y1";
- else
- return "fst\t%y0";
+ return output_387_reg_move (insn, operands);
case 1:
if (find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
@@ -2578,18 +2550,7 @@
switch (which_alternative)
{
case 0:
- if (REG_P (operands[1])
- && find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
- {
- if (REGNO (operands[0]) == FIRST_STACK_REG
- && TARGET_USE_FFREEP)
- return "ffreep\t%y0";
- return "fstp\t%y0";
- }
- else if (STACK_TOP_P (operands[0]))
- return "fld%z1\t%y1";
- else
- return "fst\t%y0";
+ return output_387_reg_move (insn, operands);
case 1:
if (find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
@@ -2781,18 +2742,7 @@
switch (which_alternative)
{
case 0:
- if (REG_P (operands[1])
- && find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
- {
- if (REGNO (operands[0]) == FIRST_STACK_REG
- && TARGET_USE_FFREEP)
- return "ffreep\t%y0";
- return "fstp\t%y0";
- }
- else if (STACK_TOP_P (operands[0]))
- return "fld%z1\t%y1";
- else
- return "fst\t%y0";
+ return output_387_reg_move (insn, operands);
case 1:
/* There is no non-popping store to memory for XFmode. So if
@@ -2825,18 +2775,7 @@
switch (which_alternative)
{
case 0:
- if (REG_P (operands[1])
- && find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
- {
- if (REGNO (operands[0]) == FIRST_STACK_REG
- && TARGET_USE_FFREEP)
- return "ffreep\t%y0";
- return "fstp\t%y0";
- }
- else if (STACK_TOP_P (operands[0]))
- return "fld%z1\t%y1";
- else
- return "fst\t%y0";
+ return output_387_reg_move (insn, operands);
case 1:
/* There is no non-popping store to memory for XFmode. So if
@@ -3520,20 +3459,14 @@
switch (which_alternative)
{
case 0:
- if (REG_P (operands[1])
- && find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
- return "fstp\t%y0";
- else if (STACK_TOP_P (operands[0]))
- return "fld%z1\t%y1";
- else
- return "fst\t%y0";
+ return output_387_reg_move (insn, operands);
case 1:
if (find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
return "fstp%z0\t%y0";
-
else
return "fst%z0\t%y0";
+
case 2:
return "cvtss2sd\t{%1, %0|%0, %1}";
@@ -3575,13 +3508,7 @@
switch (which_alternative)
{
case 0:
- if (REG_P (operands[1])
- && find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
- return "fstp\t%y0";
- else if (STACK_TOP_P (operands[0]))
- return "fld%z1\t%y1";
- else
- return "fst\t%y0";
+ return output_387_reg_move (insn, operands);
case 1:
/* There is no non-popping store to memory for XFmode. So if
@@ -3620,13 +3547,7 @@
switch (which_alternative)
{
case 0:
- if (REG_P (operands[1])
- && find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
- return "fstp\t%y0";
- else if (STACK_TOP_P (operands[0]))
- return "fld%z1\t%y1";
- else
- return "fst\t%y0";
+ return output_387_reg_move (insn, operands);
case 1:
/* There is no non-popping store to memory for XFmode. So if
@@ -3678,13 +3599,7 @@
(float_truncate:SF (match_operand:DF 1 "register_operand" "f")))]
"TARGET_80387 && flag_unsafe_math_optimizations"
{
- if (REG_P (operands[1])
- && find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
- return "fstp\t%y0";
- else if (STACK_TOP_P (operands[0]))
- return "fld%z1\t%y1";
- else
- return "fst\t%y0";
+ return output_387_reg_move (insn, operands);
}
[(set_attr "type" "fmov")
(set_attr "mode" "SF")])
@@ -3931,13 +3846,7 @@
(float_truncate:SF (match_operand:XF 1 "register_operand" "f")))]
"TARGET_80387 && flag_unsafe_math_optimizations"
{
- if (REG_P (operands[1])
- && find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
- return "fstp\t%y0";
- else if (STACK_TOP_P (operands[0]))
- return "fld%z1\t%y1";
- else
- return "fst\t%y0";
+ return output_387_reg_move (insn, operands);
}
[(set_attr "type" "fmov")
(set_attr "mode" "SF")])
@@ -4020,13 +3929,7 @@
(float_truncate:DF (match_operand:XF 1 "register_operand" "f")))]
"TARGET_80387 && flag_unsafe_math_optimizations"
{
- if (REG_P (operands[1])
- && find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
- return "fstp\t%y0";
- else if (STACK_TOP_P (operands[0]))
- return "fld%z1\t%y1";
- else
- return "fst\t%y0";
+ return output_387_reg_move (insn, operands);
}
[(set_attr "type" "fmov")
(set_attr "mode" "DF")])