This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [x86] do not issue invalid vec_select from V2DI
On Jan 6, 2006, Richard Henderson <rth@redhat.com> wrote:
> On Fri, Jan 06, 2006 at 09:59:55PM -0200, Alexandre Oliva wrote:
>> * config/i386/sse.md (*vec_extractv2di_1_sse2): New.
>> (*vec_extractv2di_1_sse): New.
> Yes. But like I said, we need a similar set of sse1 patterns
> for V2DF.
Here they are. Bootstrapping on amd64-linux-gnu is now past stage1,
which doesn't exactly test the patterns. I'm actually not sure about
how to test them; my initial attempts have all failed.
Ok to install if bootstrap completes?
Index: gcc/ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
* config/i386/sse.md (vec_extractv2df_1_sse): New.
(vec_extractv2df_0_sse): New.
Index: gcc/config/i386/sse.md
===================================================================
--- gcc/config/i386/sse.md.orig 2006-01-09 14:44:26.000000000 -0200
+++ gcc/config/i386/sse.md 2006-01-09 15:07:08.000000000 -0200
@@ -2289,6 +2289,36 @@
operands[0] = adjust_address (operands[0], DFmode, 8);
})
+;; Not sure these two are ever used, but it doesn't hurt to have
+;; them. -aoliva
+(define_insn "*vec_extractv2df_1_sse"
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=m,x,x")
+ (vec_select:DF
+ (match_operand:V2DF 1 "nonimmediate_operand" "x,x,o")
+ (parallel [(const_int 1)])))]
+ "!TARGET_SSE2 && TARGET_SSE
+ && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
+ "@
+ movhps\t{%1, %0|%0, %1}
+ movhlps\t{%1, %0|%0, %1}
+ movlps\t{%H1, %0|%0, %H1}"
+ [(set_attr "type" "ssemov")
+ (set_attr "mode" "V2SF,V4SF,V2SF")])
+
+(define_insn "*vec_extractv2df_0_sse"
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=m,x,x")
+ (vec_select:DF
+ (match_operand:V2DF 1 "nonimmediate_operand" "x,x,m")
+ (parallel [(const_int 0)])))]
+ "!TARGET_SSE2 && TARGET_SSE
+ && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
+ "@
+ movlps\t{%1, %0|%0, %1}
+ movaps\t{%1, %0|%0, %1}
+ movlps\t{%1, %0|%0, %1}"
+ [(set_attr "type" "ssemov")
+ (set_attr "mode" "V2SF,V4SF,V2SF")])
+
(define_insn "sse2_movsd"
[(set (match_operand:V2DF 0 "nonimmediate_operand" "=x,x,m,x,x,o")
(vec_merge:V2DF
--
Alexandre Oliva http://www.lsd.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist oliva@{lsd.ic.unicamp.br, gnu.org}