Commit f258e5e5 by Jan Hubicka Committed by Jan Hubicka

i386.md (sse5 cmov pattern): Update call of ix86_sse5_valid_op_p

	* i386.md (sse5 cmov pattern): Update call of ix86_sse5_valid_op_p
	* sse.md (sse5 patterns): Update call of ix86_sse5_valid_op_p;
	fix predicates and constraints.
	* i386.c (ix86_sse5_valid_op_p): Add commutative parameter.
	* i386-protos.h (ix86_sse5_valid_op_p): Update declaration.

From-SVN: r137800
parent 8abc1906
2008-07-14 Jan Hubicka <jh@suse.cz>
* i386.md (sse5 cmov pattern): Update call of ix86_sse5_valid_op_p
* sse.md (sse5 patterns): Update call of ix86_sse5_valid_op_p;
fix predicates and constraints.
* i386.c (ix86_sse5_valid_op_p): Add commutative parameter.
* i386-protos.h (ix86_sse5_valid_op_p): Update declaration.
2008-07-14 Doug Kwan <dougkwan@google.com>
* config.gcc (arm*-*-eabi*): Include arm/eabi.h and use
......
......@@ -212,7 +212,7 @@ extern void ix86_expand_vector_set (bool, rtx, rtx, int);
extern void ix86_expand_vector_extract (bool, rtx, rtx, int);
extern void ix86_expand_reduc_v4sf (rtx (*)(rtx, rtx, rtx), rtx, rtx);
extern bool ix86_sse5_valid_op_p (rtx [], rtx, int, bool, int);
extern bool ix86_sse5_valid_op_p (rtx [], rtx, int, bool, int, bool);
extern void ix86_expand_sse5_multiple_memory (rtx [], int, enum machine_mode);
/* In winnt.c */
......
......@@ -25853,11 +25853,12 @@ ix86_expand_round (rtx operand0, rtx operand1)
OPERANDS is the array of operands.
NUM is the number of operands.
USES_OC0 is true if the instruction uses OC0 and provides 4 variants.
NUM_MEMORY is the maximum number of memory operands to accept. */
NUM_MEMORY is the maximum number of memory operands to accept.
when COMMUTATIVE is set, operand 1 and 2 can be swapped. */
bool
ix86_sse5_valid_op_p (rtx operands[], rtx insn ATTRIBUTE_UNUSED, int num,
bool uses_oc0, int num_memory)
bool uses_oc0, int num_memory, bool commutative)
{
int mem_mask;
int mem_count;
......@@ -25941,6 +25942,8 @@ ix86_sse5_valid_op_p (rtx operands[], rtx insn ATTRIBUTE_UNUSED, int num,
/* format, example pmacsdd:
xmm1, xmm2, xmm3/mem, xmm1 */
if (commutative)
return (mem_mask == (1 << 2) || mem_mask == (1 << 1));
else
return (mem_mask == (1 << 2));
}
......@@ -25975,6 +25978,8 @@ ix86_sse5_valid_op_p (rtx operands[], rtx insn ATTRIBUTE_UNUSED, int num,
For the integer multiply/add instructions be more restrictive and
require operands[2] and operands[3] to be the memory operands. */
if (commutative)
return (mem_mask == ((1 << 1) | (1 << 3)) || ((1 << 2) | (1 << 3)));
else
return (mem_mask == ((1 << 2) | (1 << 3)));
}
......
......@@ -19508,7 +19508,7 @@
(match_operand:MODEF 1 "register_operand" "x,0")
(match_operand:MODEF 2 "register_operand" "0,x")
(match_operand:MODEF 3 "register_operand" "x,x")))]
"TARGET_SSE5 && ix86_sse5_valid_op_p (operands, insn, 4, true, 1)"
"TARGET_SSE5 && ix86_sse5_valid_op_p (operands, insn, 4, true, 1, false)"
"pcmov\t{%1, %3, %2, %0|%0, %2, %3, %1}"
[(set_attr "type" "sse4arg")])
......
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