Commit 052c96b1 by Jan Hubicka Committed by Jan Hubicka

i386.md (prefetch): Fix for 64bit mode.

	* i386.md (prefetch): Fix for 64bit mode.
	(prefetch_sse_rex, prefetch_3dnow_rex): New patterns.

	* i386.md (movss, movsd): Use xorps/xorpd for Athlon.

From-SVN: r55481
parent 984812cd
Tue Jul 16 12:22:44 CEST 2002 Jan Hubicka <jh@suse.cz>
* i386.md (prefetch): Fix for 64bit mode.
(prefetch_sse_rex, prefetch_3dnow_rex): New patterns.
* i386.md (movss, movsd): Use xorps/xorpd for Athlon.
2002-07-16 Marek Michalkiewicz <marekm@amelek.gda.pl> 2002-07-16 Marek Michalkiewicz <marekm@amelek.gda.pl>
* hard-reg-set.h (TEST_HARD_REG_BIT): Return 1 if the bit is set. * hard-reg-set.h (TEST_HARD_REG_BIT): Return 1 if the bit is set.
......
...@@ -2129,7 +2129,7 @@ ...@@ -2129,7 +2129,7 @@
case 4: case 4:
return "mov{l}\t{%1, %0|%0, %1}"; return "mov{l}\t{%1, %0|%0, %1}";
case 5: case 5:
if (TARGET_SSE2) if (TARGET_SSE2 && !TARGET_ATHLON)
return "pxor\t%0, %0"; return "pxor\t%0, %0";
else else
return "xorps\t%0, %0"; return "xorps\t%0, %0";
...@@ -2315,7 +2315,10 @@ ...@@ -2315,7 +2315,10 @@
case 4: case 4:
return "#"; return "#";
case 5: case 5:
return "pxor\t%0, %0"; if (TARGET_ATHLON)
return "xorpd\t%0, %0";
else
return "pxor\t%0, %0";
case 6: case 6:
if (TARGET_PARTIAL_REG_DEPENDENCY) if (TARGET_PARTIAL_REG_DEPENDENCY)
return "movapd\t{%1, %0|%0, %1}"; return "movapd\t{%1, %0|%0, %1}";
...@@ -2374,7 +2377,10 @@ ...@@ -2374,7 +2377,10 @@
return "#"; return "#";
case 5: case 5:
return "pxor\t%0, %0"; if (TARGET_ATHLON)
return "xorpd\t%0, %0";
else
return "pxor\t%0, %0";
case 6: case 6:
if (TARGET_PARTIAL_REG_DEPENDENCY) if (TARGET_PARTIAL_REG_DEPENDENCY)
return "movapd\t{%1, %0|%0, %1}"; return "movapd\t{%1, %0|%0, %1}";
...@@ -20015,7 +20021,7 @@ ...@@ -20015,7 +20021,7 @@
(set_attr "mode" "TI")]) (set_attr "mode" "TI")])
(define_expand "prefetch" (define_expand "prefetch"
[(prefetch (match_operand:SI 0 "address_operand" "") [(prefetch (match_operand 0 "address_operand" "")
(match_operand:SI 1 "const_int_operand" "") (match_operand:SI 1 "const_int_operand" "")
(match_operand:SI 2 "const_int_operand" ""))] (match_operand:SI 2 "const_int_operand" ""))]
"TARGET_PREFETCH_SSE || TARGET_3DNOW" "TARGET_PREFETCH_SSE || TARGET_3DNOW"
...@@ -20027,6 +20033,8 @@ ...@@ -20027,6 +20033,8 @@
abort (); abort ();
if (locality < 0 || locality > 3) if (locality < 0 || locality > 3)
abort (); abort ();
if (GET_MODE (operands[0]) != Pmode && GET_MODE (operands[0]) != VOIDmode)
abort ();
/* Use 3dNOW prefetch in case we are asking for write prefetch not /* Use 3dNOW prefetch in case we are asking for write prefetch not
suported by SSE counterpart or the SSE prefetch is not available suported by SSE counterpart or the SSE prefetch is not available
...@@ -20042,7 +20050,26 @@ ...@@ -20042,7 +20050,26 @@
[(prefetch (match_operand:SI 0 "address_operand" "p") [(prefetch (match_operand:SI 0 "address_operand" "p")
(const_int 0) (const_int 0)
(match_operand:SI 1 "const_int_operand" ""))] (match_operand:SI 1 "const_int_operand" ""))]
"TARGET_PREFETCH_SSE" "TARGET_PREFETCH_SSE && !TARGET_64BIT"
{
static const char * const patterns[4] = {
"prefetchnta\t%a0", "prefetcht2\t%a0", "prefetcht1\t%a0", "prefetcht0\t%a0"
};
int locality = INTVAL (operands[1]);
if (locality < 0 || locality > 3)
abort ();
return patterns[locality];
}
[(set_attr "type" "sse")
(set_attr "memory" "none")])
(define_insn "*prefetch_sse_rex"
[(prefetch (match_operand:DI 0 "address_operand" "p")
(const_int 0)
(match_operand:SI 1 "const_int_operand" ""))]
"TARGET_PREFETCH_SSE && TARGET_64BIT"
{ {
static const char * const patterns[4] = { static const char * const patterns[4] = {
"prefetchnta\t%a0", "prefetcht2\t%a0", "prefetcht1\t%a0", "prefetcht0\t%a0" "prefetchnta\t%a0", "prefetcht2\t%a0", "prefetcht1\t%a0", "prefetcht0\t%a0"
...@@ -20061,7 +20088,21 @@ ...@@ -20061,7 +20088,21 @@
[(prefetch (match_operand:SI 0 "address_operand" "p") [(prefetch (match_operand:SI 0 "address_operand" "p")
(match_operand:SI 1 "const_int_operand" "n") (match_operand:SI 1 "const_int_operand" "n")
(const_int 3))] (const_int 3))]
"TARGET_3DNOW" "TARGET_3DNOW && !TARGET_64BIT"
{
if (INTVAL (operands[1]) == 0)
return "prefetch\t%a0";
else
return "prefetchw\t%a0";
}
[(set_attr "type" "mmx")
(set_attr "memory" "none")])
(define_insn "*prefetch_3dnow_rex"
[(prefetch (match_operand:DI 0 "address_operand" "p")
(match_operand:SI 1 "const_int_operand" "n")
(const_int 3))]
"TARGET_3DNOW && TARGET_64BIT"
{ {
if (INTVAL (operands[1]) == 0) if (INTVAL (operands[1]) == 0)
return "prefetch\t%a0"; return "prefetch\t%a0";
......
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