Commit e9e80858 by Jan Hubicka Committed by Jan Hubicka

i386.md (HI to SImode promoting splitters): Rewrite.

	* i386.md (HI to SImode promoting splitters): Rewrite.
	(pushsf mem peep2): New.
	(testhi to andhi peep2): Remove.
	* i386.h (x86_promote_QImode): New.
	(TARGET_PROMOTE_QImode): New.
	(PREDICATE_CODES): Add promotable_binary_operator.
	* i386.c (x86_promote_QImode0: New.
	(promotable_binary_operator): New.
	* i386-protos.h (promotable_binary_operator): New.

From-SVN: r30985
parent a1cbdd7f
Fri Dec 17 01:32:38 MET 1999 Jan Hubicka <hubicka@freesoft.cz>
* i386.md (HI to SImode promoting splitters): Rewrite.
(pushsf mem peep2): New.
(testhi to andhi peep2): Remove.
* i386.h (x86_promote_QImode): New.
(TARGET_PROMOTE_QImode): New.
(PREDICATE_CODES): Add promotable_binary_operator.
* i386.c (x86_promote_QImode0: New.
(promotable_binary_operator): New.
* i386-protos.h (promotable_binary_operator): New.
* i386.md (test?i_1): Use "nonmemory_operand" predicate, simplify
condition.
(one_cmpl?i*): Pass "NOT" to unary_operator_ok.
......
......@@ -60,6 +60,7 @@ extern int binary_fp_operator PROTO((rtx, enum machine_mode));
extern int mult_operator PROTO((rtx, enum machine_mode));
extern int div_operator PROTO((rtx, enum machine_mode));
extern int arith_or_logical_operator PROTO((rtx, enum machine_mode));
extern int promotable_binary_operator PROTO((rtx, enum machine_mode));
extern int memory_displacement_operand PROTO((rtx, enum machine_mode));
extern int cmpsi_operand PROTO((rtx, enum machine_mode));
extern int long_memory_operand PROTO((rtx, enum machine_mode));
......
......@@ -205,6 +205,7 @@ const int x86_use_cltd = ~(m_PENT | m_K6);
const int x86_read_modify_write = ~m_PENT;
const int x86_read_modify = ~(m_PENT | m_PPRO);
const int x86_split_long_moves = m_PPRO;
const int x86_promote_QImode = m_K6 | m_PENT | m_386 | m_486;
#define AT_BP(mode) (gen_rtx_MEM ((mode), frame_pointer_rtx))
......@@ -1177,6 +1178,30 @@ fcmov_comparison_operator (op, mode)
&& GET_CODE (op) == unsigned_condition (GET_CODE (op)));
}
/* Return 1 if OP is a binary operator that can be promoted to wider mode. */
int
promotable_binary_operator (op, mode)
register rtx op;
enum machine_mode mode ATTRIBUTE_UNUSED;
{
switch (GET_CODE (op))
{
case MULT:
/* Modern CPUs have same latency for HImode and SImode multiply,
but 386 and 486 do HImode multiply faster. */
return ix86_cpu > PROCESSOR_I486;
case PLUS:
case AND:
case IOR:
case XOR:
case ASHIFT:
return 1;
default:
return 0;
}
}
/* Nearly general operand, but accept any const_double, since we wish
to be able to drop them into memory rather than have them get pulled
into registers. */
......
......@@ -161,6 +161,7 @@ extern const int x86_double_with_add, x86_partial_reg_stall, x86_movx;
extern const int x86_use_loop, x86_use_fiop, x86_use_mov0;
extern const int x86_use_cltd, x86_read_modify_write;
extern const int x86_read_modify, x86_split_long_moves;
extern const int x86_promote_QImode;
#define TARGET_USE_LEAVE (x86_use_leave & CPUMASK)
#define TARGET_PUSH_MEMORY (x86_push_memory & CPUMASK)
......@@ -182,6 +183,7 @@ extern const int x86_read_modify, x86_split_long_moves;
#define TARGET_SPLIT_LONG_MOVES (x86_split_long_moves & CPUMASK)
#define TARGET_READ_MODIFY_WRITE (x86_read_modify_write & CPUMASK)
#define TARGET_READ_MODIFY (x86_read_modify & CPUMASK)
#define TARGET_PROMOTE_QImode (x86_promote_QImode & CPUMASK)
#define TARGET_STACK_PROBE (target_flags & MASK_STACK_PROBE)
......@@ -2437,6 +2439,7 @@ do { long l; \
UMIN, UMAX, COMPARE, MINUS, DIV, MOD, \
UDIV, UMOD, ASHIFT, ROTATE, ASHIFTRT, \
LSHIFTRT, ROTATERT}}, \
{"promotable_binary_operator", {PLUS, MULT, AND, IOR, XOR, ASHIFT}}, \
{"memory_displacement_operand", {MEM}}, \
{"cmpsi_operand", {CONST_INT, CONST_DOUBLE, CONST, SYMBOL_REF, \
LABEL_REF, SUBREG, REG, MEM, AND}}, \
......
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