This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[AVX]: Add AVX support to *movdf_integer_rex64
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 22 May 2008 06:56:31 -0700
- Subject: [AVX]: Add AVX support to *movdf_integer_rex64
Hi,
I checked this patch into AVX branch to add AVX support to
*movdf_integer_rex64.
H.J.
----
Index: ChangeLog.avx
===================================================================
--- ChangeLog.avx (revision 135765)
+++ ChangeLog.avx (working copy)
@@ -1,3 +1,8 @@
+2008-05-22 Joey Ye <joey.ye@intel.com>
+ H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/i386/i386.md (*movdf_integer_rex64): Support AVX.
+
2008-05-21 H.J. Lu <hongjiu.lu@intel.com>
* config/i386/i386.c (ix86_expand_vector_init_one_var): Support
Index: config/i386/i386.md
===================================================================
--- config/i386/i386.md (revision 135765)
+++ config/i386/i386.md (working copy)
@@ -3027,11 +3027,11 @@
switch (get_attr_mode (insn))
{
case MODE_V4SF:
- return "xorps\t%0, %0";
+ return TARGET_AVX ? "vxorps\t%0, %0, %0" : "xorps\t%0, %0";
case MODE_V2DF:
- return "xorpd\t%0, %0";
+ return TARGET_AVX ? "vxorpd\t%0, %0, %0" : "xorpd\t%0, %0";
case MODE_TI:
- return "pxor\t%0, %0";
+ return TARGET_AVX ? "vpxor\t%0, %0, %0" : "pxor\t%0, %0";
default:
gcc_unreachable ();
}
@@ -3041,32 +3041,53 @@
switch (get_attr_mode (insn))
{
case MODE_V4SF:
- return "movaps\t{%1, %0|%0, %1}";
+ return TARGET_AVX ? "vmovaps\t{%1, %0|%0, %1}"
+ : "movaps\t{%1, %0|%0, %1}";
case MODE_V2DF:
- return "movapd\t{%1, %0|%0, %1}";
+ return TARGET_AVX ? "vmovapd\t{%1, %0|%0, %1}"
+ : "movapd\t{%1, %0|%0, %1}";
case MODE_TI:
- return "movdqa\t{%1, %0|%0, %1}";
+ return TARGET_AVX ? "vmovdqa\t{%1, %0|%0, %1}"
+ : "movdqa\t{%1, %0|%0, %1}";
case MODE_DI:
- return "movq\t{%1, %0|%0, %1}";
+ return TARGET_AVX ? "vmovq\t{%1, %0|%0, %1}"
+ : "movq\t{%1, %0|%0, %1}";
case MODE_DF:
- return "movsd\t{%1, %0|%0, %1}";
+ if (TARGET_AVX)
+ {
+ if (REG_P (operands[0]) && REG_P (operands[1]))
+ return "vmovsd\t{%1, %0, %0|%0, %0, %1}";
+ else
+ return "vmovsd\t{%1, %0|%0, %1}";
+ }
+ else
+ return "movsd\t{%1, %0|%0, %1}";
case MODE_V1DF:
- return "movlpd\t{%1, %0|%0, %1}";
+ return TARGET_AVX ? "vmovlpd\t{%1, %0|%0, %1}"
+ : "movlpd\t{%1, %0|%0, %1}";
case MODE_V2SF:
- return "movlps\t{%1, %0|%0, %1}";
+ return TARGET_AVX ? "vmovlps\t{%1, %0|%0, %1}"
+ : "movlps\t{%1, %0|%0, %1}";
default:
gcc_unreachable ();
}
case 9:
case 10:
- return "movd\t{%1, %0|%0, %1}";
+ if (TARGET_AVX)
+ return "vmovq\t{%1, %0|%0, %1}";
+ else
+ return "movd\t{%1, %0|%0, %1}";
default:
gcc_unreachable();
}
}
[(set_attr "type" "fmov,fmov,fmov,multi,multi,sselog1,ssemov,ssemov,ssemov,ssemov,ssemov")
+ (set (attr "prefix")
+ (if_then_else (eq_attr "alternative" "0,1,2,3,4")
+ (const_string "orig")
+ (const_string "maybe_vex")))
(set (attr "mode")
(cond [(eq_attr "alternative" "0,1,2")
(const_string "DF")