This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[AVX]: Add more AVX support
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Joey Ye <joey dot ye at intel dot com>, Xuepeng Guo <xuepeng dot guo at intel dot com>
- Date: Sun, 11 May 2008 09:22:16 -0700
- Subject: [AVX]: Add more AVX support
Hi,
I am checking in this patch to add AVX support. Also I used
_avx as suffix for all vector patterns.
H.J.
---
2008-05-11 H.J. Lu <hongjiu.lu@intel.com>
* config/i386/sse.md (*vec_dupv4sf_avx): New.
(*vec_dupv4si_avx): Likewise.
(*vec_dupv2di_avx): Likewise.
(*avx_vec_setv4sf_0): Renamed to ...
(*vec_setv4sf_0_avx): This.
(*vec_dupv2df_sse3): Support AVX.
Index: sse.md
===================================================================
--- sse.md (revision 135176)
+++ sse.md (working copy)
@@ -3355,6 +3355,16 @@
[(set_attr "type" "ssemov")
(set_attr "mode" "SF")])
+(define_insn "*vec_dupv4sf_avx"
+ [(set (match_operand:V4SF 0 "register_operand" "=x")
+ (vec_duplicate:V4SF
+ (match_operand:SF 1 "register_operand" "x")))]
+ "TARGET_AVX"
+ "vshufps\t{$0, %1, %1, %0|%0, %1, %1, 0}"
+ [(set_attr "type" "sselog1")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V4SF")])
+
(define_insn "*vec_dupv4sf"
[(set (match_operand:V4SF 0 "register_operand" "=x")
(vec_duplicate:V4SF
@@ -3415,8 +3425,8 @@
DONE;
})
-(define_insn "*avx_vec_setv4sf_0"
- [(set (match_operand:V4SF 0 "nonimmediate_operand" "=x,x,Y2,m")
+(define_insn "*vec_setv4sf_0_avx"
+ [(set (match_operand:V4SF 0 "nonimmediate_operand" "=x,x,x,m")
(vec_merge:V4SF
(vec_duplicate:V4SF
(match_operand:SF 2 "general_operand" " x,m,*r,x*rfF"))
@@ -4168,8 +4178,13 @@
(match_operand:DF 1 "nonimmediate_operand" "xm")
(match_dup 1)))]
"TARGET_SSE3"
- "movddup\t{%1, %0|%0, %1}"
+ "* return TARGET_AVX ? \"vmovddup\t{%1, %0|%0, %1}\"
+ : \"movddup\t{%1, %0|%0, %1}\";"
[(set_attr "type" "sselog1")
+ (set (attr "prefix")
+ (if_then_else (ne (symbol_ref "TARGET_AVX") (const_int 0))
+ (const_string "vex")
+ (const_string "orig")))
(set_attr "mode" "DF")])
(define_insn "*vec_concatv2df"
@@ -6269,6 +6284,15 @@
[(set_attr "type" "ssemov")
(set_attr "mode" "V2SF,V4SF,V2SF")])
+(define_insn "*vec_dupv4si_avx"
+ [(set (match_operand:V4SI 0 "register_operand" "=x")
+ (vec_duplicate:V4SI
+ (match_operand:SI 1 "register_operand" "x")))]
+ "TARGET_AVX"
+ "vpshufd\t{$0, %1, %0|%0, %1, 0}"
+ [(set_attr "type" "sselog1")
+ (set_attr "mode" "TI")])
+
(define_insn "*vec_dupv4si"
[(set (match_operand:V4SI 0 "register_operand" "=Y2,x")
(vec_duplicate:V4SI
@@ -6280,6 +6304,16 @@
[(set_attr "type" "sselog1")
(set_attr "mode" "TI,V4SF")])
+(define_insn "*vec_dupv2di_avx"
+ [(set (match_operand:V2DI 0 "register_operand" "=x")
+ (vec_duplicate:V2DI
+ (match_operand:DI 1 "register_operand" "x")))]
+ "TARGET_AVX"
+ "vpunpcklqdq\t{%1, %1, %0|%0, %1, %1}"
+ [(set_attr "type" "sselog1")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "*vec_dupv2di"
[(set (match_operand:V2DI 0 "register_operand" "=Y2,x")
(vec_duplicate:V2DI