This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[power7-meissner] Fix altivec float interleave
- From: Michael Meissner <meissner at linux dot vnet dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 3 Mar 2009 16:23:28 -0500
- Subject: [power7-meissner] Fix altivec float interleave
This fixes the altivec case that shows up in some test suite regressions.
2009-03-03 Michael Meissner <meissner@linux.vnet.ibm.com>
* config/rs6000/vector.md (vec_interleave_highv4sf): Use correct
constants for the extraction.
(vec_interleave_lowv4sf): Ditto.
* config/rs6000/vsx.md (vsx_xxmrglw): Delete for now, use Altivec.
(vsx_xxmrghw): Ditto.
* config/rs6000/altivec.md (altivec_vmrghsf): Use this insn even
on VSX systems.
(altivec_vmrglsf): Ditto.
* config/rs6000/rs6000.h (ASM_CPU_NATIVE_SPEC): Use %(asm_default)
if we are running as a cross compiler.
Index: gcc/config/rs6000/vector.md
===================================================================
--- gcc/config/rs6000/vector.md (revision 144557)
+++ gcc/config/rs6000/vector.md (working copy)
@@ -386,15 +386,15 @@
[(set (match_operand:V4SF 0 "vfloat_operand" "")
(vec_merge:V4SF
(vec_select:V4SF (match_operand:V4SF 1 "vfloat_operand" "")
- (parallel [(const_int 2)
- (const_int 0)
- (const_int 3)
- (const_int 1)]))
- (vec_select:V4SF (match_operand:V4SF 2 "vfloat_operand" "")
(parallel [(const_int 0)
(const_int 2)
(const_int 1)
(const_int 3)]))
+ (vec_select:V4SF (match_operand:V4SF 2 "vfloat_operand" "")
+ (parallel [(const_int 2)
+ (const_int 0)
+ (const_int 3)
+ (const_int 1)]))
(const_int 5)))]
"VECTOR_UNIT_ALTIVEC_OR_VSX_P (V4SFmode)"
"")
@@ -403,15 +403,15 @@
[(set (match_operand:V4SF 0 "vfloat_operand" "")
(vec_merge:V4SF
(vec_select:V4SF (match_operand:V4SF 1 "vfloat_operand" "")
- (parallel [(const_int 0)
- (const_int 2)
- (const_int 1)
- (const_int 3)]))
- (vec_select:V4SF (match_operand:V4SF 2 "vfloat_operand" "")
(parallel [(const_int 2)
(const_int 0)
(const_int 3)
(const_int 1)]))
+ (vec_select:V4SF (match_operand:V4SF 2 "vfloat_operand" "")
+ (parallel [(const_int 0)
+ (const_int 2)
+ (const_int 1)
+ (const_int 3)]))
(const_int 5)))]
"VECTOR_UNIT_ALTIVEC_OR_VSX_P (V4SFmode)"
"")
Index: gcc/config/rs6000/rs6000.h
===================================================================
--- gcc/config/rs6000/rs6000.h (revision 144588)
+++ gcc/config/rs6000/rs6000.h (working copy)
@@ -186,7 +186,7 @@ extern const char *host_detect_local_cpu
#define ASM_CPU_NATIVE_SPEC "%:local_cpu_detect(asm)"
#else
-#define ASM_CPU_NATIVE_SPEC ""
+#define ASM_CPU_NATIVE_SPEC "%(asm_default)"
#endif
#ifndef CC1_CPU_SPEC
Index: gcc/config/rs6000/vsx.md
===================================================================
--- gcc/config/rs6000/vsx.md (revision 144557)
+++ gcc/config/rs6000/vsx.md (working copy)
@@ -713,15 +713,15 @@
[(set (match_operand:V4SF 0 "vsx_register_operand" "=wf")
(vec_merge:V4SF
(vec_select:V4SF (match_operand:V4SF 1 "vsx_register_operand" "wf")
- (parallel [(const_int 2)
- (const_int 0)
- (const_int 3)
- (const_int 1)]))
- (vec_select:V4SF (match_operand:V4SF 2 "vsx_register_operand" "wf")
(parallel [(const_int 0)
(const_int 2)
(const_int 1)
(const_int 3)]))
+ (vec_select:V4SF (match_operand:V4SF 2 "vsx_register_operand" "wf")
+ (parallel [(const_int 2)
+ (const_int 0)
+ (const_int 3)
+ (const_int 1)]))
(const_int 5)))]
"VECTOR_UNIT_VSX_P (V4SFmode)"
"xxmrglw %x0,%x1,%x2"
@@ -731,15 +731,15 @@
[(set (match_operand:V4SF 0 "vsx_register_operand" "=wf")
(vec_merge:V4SF
(vec_select:V4SF (match_operand:V4SF 1 "vsx_register_operand" "wf")
- (parallel [(const_int 0)
- (const_int 2)
- (const_int 1)
- (const_int 3)]))
- (vec_select:V4SF (match_operand:V4SF 2 "vsx_register_operand" "wf")
(parallel [(const_int 2)
(const_int 0)
(const_int 3)
(const_int 1)]))
+ (vec_select:V4SF (match_operand:V4SF 2 "vsx_register_operand" "wf")
+ (parallel [(const_int 0)
+ (const_int 2)
+ (const_int 1)
+ (const_int 3)]))
(const_int 5)))]
"VECTOR_UNIT_VSX_P (V4SFmode)"
"xxmrghw %x0,%x1,%x2"
Index: gcc/config/rs6000/vsx.md
===================================================================
--- gcc/config/rs6000/vsx.md (revision 144557)
+++ gcc/config/rs6000/vsx.md (working copy)
@@ -707,40 +707,3 @@
"VECTOR_UNIT_VSX_P (V4SFmode)"
"xxspltw %x0,%x1,%2"
[(set_attr "type" "vecperm")])
-
-;; V4SF interleave
-(define_insn "vsx_xxmrglw"
- [(set (match_operand:V4SF 0 "vsx_register_operand" "=wf")
- (vec_merge:V4SF
- (vec_select:V4SF (match_operand:V4SF 1 "vsx_register_operand" "wf")
- (parallel [(const_int 2)
- (const_int 0)
- (const_int 3)
- (const_int 1)]))
- (vec_select:V4SF (match_operand:V4SF 2 "vsx_register_operand" "wf")
- (parallel [(const_int 0)
- (const_int 2)
- (const_int 1)
- (const_int 3)]))
- (const_int 5)))]
- "VECTOR_UNIT_VSX_P (V4SFmode)"
- "xxmrglw %x0,%x1,%x2"
- [(set_attr "type" "vecperm")])
-
-(define_insn "vsx_xxmrghw"
- [(set (match_operand:V4SF 0 "vsx_register_operand" "=wf")
- (vec_merge:V4SF
- (vec_select:V4SF (match_operand:V4SF 1 "vsx_register_operand" "wf")
- (parallel [(const_int 0)
- (const_int 2)
- (const_int 1)
- (const_int 3)]))
- (vec_select:V4SF (match_operand:V4SF 2 "vsx_register_operand" "wf")
- (parallel [(const_int 2)
- (const_int 0)
- (const_int 3)
- (const_int 1)]))
- (const_int 5)))]
- "VECTOR_UNIT_VSX_P (V4SFmode)"
- "xxmrghw %x0,%x1,%x2"
- [(set_attr "type" "vecperm")])
Index: gcc/config/rs6000/altivec.md
===================================================================
--- gcc/config/rs6000/altivec.md (revision 144557)
+++ gcc/config/rs6000/altivec.md (working copy)
@@ -797,7 +797,7 @@
(const_int 3)
(const_int 1)]))
(const_int 5)))]
- "VECTOR_UNIT_ALTIVEC_P (V4SFmode)"
+ "VECTOR_UNIT_ALTIVEC_OR_VSX_P (V4SFmode)"
"vmrghw %0,%1,%2"
[(set_attr "type" "vecperm")])
@@ -899,7 +899,7 @@
(const_int 1)
(const_int 3)]))
(const_int 5)))]
- "VECTOR_UNIT_ALTIVEC_P (V4SFmode)"
+ "VECTOR_UNIT_ALTIVEC_OR_VSX_P (V4SFmode)"
"vmrglw %0,%1,%2"
[(set_attr "type" "vecperm")])
--
Michael Meissner, IBM
4 Technology Place Drive, MS 2203A, Westford, MA, 01886, USA
meissner@linux.vnet.ibm.com