Commit 141e454b by Jan Hubicka Committed by Jan Hubicka

rtl.h (simplify_gen_relational): Add cmp_mode parameter.

	* rtl.h (simplify_gen_relational): Add cmp_mode parameter.
	* simplify-rtx.c (simplify_gen_relational): Likewise.

	* simplify-rtx.c (simplify_replace_rtx): Handle relationals and MEMs.

	* i386.h (VALID_SSE_REG_MODE): Accept MMX modes if SSE2
	* i386.md (movsi_1, movdi2, movdi_1_rex64): Handle SSE2 moves.

	* i386.md (negsf2, negdf2, abssf2, absdf2): Force operands to
	registers in SSE case; fix handling of the immediates.
	(negsf2_ifs, abssf2_ifs): Tweak constraints; require
	operands to be in regsiters before reload.
	(negdf2_ifs, absdf2_ifs): Likewise; disable for 64bit
	(negdf2_ifs_rex64, absdf2_ifs_rtx64): New.
	(abstf,absxf,negtf,negxf splitters): Compute
	properly the regnum for x86_64.
	(avsdf2_if_rex64): New.

From-SVN: r41664
parent 5bb86bf2
Sat Apr 28 21:02:58 CEST 2001 Jan Hubicka <jh@suse.cz>
* rtl.h (simplify_gen_relational): Add cmp_mode parameter.
* simplify-rtx.c (simplify_gen_relational): Likewise.
* simplify-rtx.c (simplify_replace_rtx): Handle relationals and MEMs.
* i386.h (VALID_SSE_REG_MODE): Accept MMX modes if SSE2
* i386.md (movsi_1, movdi2, movdi_1_rex64): Handle SSE2 moves.
* i386.md (negsf2, negdf2, abssf2, absdf2): Force operands to
registers in SSE case; fix handling of the immediates.
(negsf2_ifs, abssf2_ifs): Tweak constraints; require
operands to be in regsiters before reload.
(negdf2_ifs, absdf2_ifs): Likewise; disable for 64bit
(negdf2_ifs_rex64, absdf2_ifs_rtx64): New.
(abstf,absxf,negtf,negxf splitters): Compute
properly the regnum for x86_64.
(avsdf2_if_rex64): New.
Sat Apr 28 10:36:23 2001 Jeffrey A Law (law@cygnus.com) Sat Apr 28 10:36:23 2001 Jeffrey A Law (law@cygnus.com)
* flow.c (propagate_block_delete_insn): Handle deletion of ADDR_VEC * flow.c (propagate_block_delete_insn): Handle deletion of ADDR_VEC
......
...@@ -861,7 +861,8 @@ extern int ix86_arch; ...@@ -861,7 +861,8 @@ extern int ix86_arch;
#define VALID_SSE_REG_MODE(MODE) \ #define VALID_SSE_REG_MODE(MODE) \
((MODE) == TImode || (MODE) == V4SFmode || (MODE) == V4SImode \ ((MODE) == TImode || (MODE) == V4SFmode || (MODE) == V4SImode \
|| (MODE) == SFmode || (TARGET_SSE2 && (MODE) == DFmode)) || (MODE) == SFmode \
|| (TARGET_SSE2 && ((MODE) == DFmode || VALID_MMX_REG_MODE (MODE))))
#define VALID_MMX_REG_MODE(MODE) \ #define VALID_MMX_REG_MODE(MODE) \
((MODE) == DImode || (MODE) == V8QImode || (MODE) == V4HImode \ ((MODE) == DImode || (MODE) == V8QImode || (MODE) == V4HImode \
......
...@@ -1318,6 +1318,7 @@ extern rtx simplify_gen_ternary PARAMS ((enum rtx_code, ...@@ -1318,6 +1318,7 @@ extern rtx simplify_gen_ternary PARAMS ((enum rtx_code,
rtx, rtx, rtx)); rtx, rtx, rtx));
extern rtx simplify_gen_relational PARAMS ((enum rtx_code, extern rtx simplify_gen_relational PARAMS ((enum rtx_code,
enum machine_mode, enum machine_mode,
enum machine_mode,
rtx, rtx)); rtx, rtx));
extern rtx simplify_replace_rtx PARAMS ((rtx, rtx, rtx)); extern rtx simplify_replace_rtx PARAMS ((rtx, rtx, rtx));
extern rtx simplify_rtx PARAMS ((rtx)); extern rtx simplify_rtx PARAMS ((rtx));
......
...@@ -177,17 +177,20 @@ simplify_gen_ternary (code, mode, op0_mode, op0, op1, op2) ...@@ -177,17 +177,20 @@ simplify_gen_ternary (code, mode, op0_mode, op0, op1, op2)
return gen_rtx_fmt_eee (code, mode, op0, op1, op2); return gen_rtx_fmt_eee (code, mode, op0, op1, op2);
} }
/* Likewise, for relational operations. */ /* Likewise, for relational operations.
CMP_MODE specifies mode comparison is done in.
*/
rtx rtx
simplify_gen_relational (code, mode, op0, op1) simplify_gen_relational (code, mode, cmp_mode, op0, op1)
enum rtx_code code; enum rtx_code code;
enum machine_mode mode; enum machine_mode mode;
enum machine_mode cmp_mode;
rtx op0, op1; rtx op0, op1;
{ {
rtx tem; rtx tem;
if ((tem = simplify_relational_operation (code, mode, op0, op1)) != 0) if ((tem = simplify_relational_operation (code, cmp_mode, op0, op1)) != 0)
return tem; return tem;
/* Put complex operands first and constants second. */ /* Put complex operands first and constants second. */
...@@ -238,6 +241,14 @@ simplify_replace_rtx (x, old, new) ...@@ -238,6 +241,14 @@ simplify_replace_rtx (x, old, new)
simplify_gen_binary (code, mode, simplify_gen_binary (code, mode,
simplify_replace_rtx (XEXP (x, 0), old, new), simplify_replace_rtx (XEXP (x, 0), old, new),
simplify_replace_rtx (XEXP (x, 1), old, new)); simplify_replace_rtx (XEXP (x, 1), old, new));
case '<':
return
simplify_gen_relational (code, mode,
(GET_MODE (XEXP (x, 0)) != VOIDmode
? GET_MODE (XEXP (x, 0))
: GET_MODE (XEXP (x, 1))),
simplify_replace_rtx (XEXP (x, 0), old, new),
simplify_replace_rtx (XEXP (x, 1), old, new));
case '3': case '3':
case 'b': case 'b':
...@@ -258,8 +269,27 @@ simplify_replace_rtx (x, old, new) ...@@ -258,8 +269,27 @@ simplify_replace_rtx (x, old, new)
return x; return x;
default: default:
if (GET_CODE (x) == MEM)
{
/* We can't use change_address here, since it verifies memory address
for corectness. We don't want such check, since we may handle
addresses previously incorect (such as ones in push instructions)
and it is caller's work to verify whether resulting insn match. */
rtx addr = simplify_replace_rtx (XEXP (x, 0), old, new);
rtx mem;
if (XEXP (x, 0) != addr)
{
mem = gen_rtx_MEM (GET_MODE (x), addr);
MEM_COPY_ATTRIBUTES (mem, x);
}
else
mem = x;
return mem;
}
return x; return x;
} }
return x;
} }
/* Try to simplify a unary operation CODE whose output mode is to be /* Try to simplify a unary operation CODE whose output mode is to be
......
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