aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2005-12-06 20:02:29 +0000
committerDale Johannesen <dalej@apple.com>2005-12-06 20:02:29 +0000
commit47d79e23f619083582656d8f1222caf996dada17 (patch)
tree8b058e7af36c247e02603dc3733412724a3530cb
parent805708b91ac5a5df13e0d3d0c1946b20d7fd036d (diff)
2005-12-05 Dale Johannesen <dalej@apple.com>apple/gcc-5250
Radar 4332318 * config/i386/sse.md (sse_movhlps): Reverse operands for 2nd and 3rd alternatives. 2005-12-05 Dale Johannesen <dalej@apple.com> * gcc.target/i386/sse-17.c: New. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/apple-200511-release-branch@108127 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog.apple-ppc5
-rw-r--r--gcc/config/i386/sse.md14
-rw-r--r--gcc/testsuite/ChangeLog.apple-ppc4
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-17.c31
4 files changed, 48 insertions, 6 deletions
diff --git a/gcc/ChangeLog.apple-ppc b/gcc/ChangeLog.apple-ppc
index b6b83cad73c..e5b72bf61b7 100644
--- a/gcc/ChangeLog.apple-ppc
+++ b/gcc/ChangeLog.apple-ppc
@@ -1,3 +1,8 @@
+2005-12-06 Dale Johannesen <dalej@apple.com>
+
+ * config/i386/sse.md (sse_movhlps): Reverse operands for
+ 2nd and 3rd alternatives.
+
2005-11-17 Dale Johannesen <dalej@apple.com>
Radar 4321079
diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index 7d2837f930c..883b6fa43c9 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -942,23 +942,25 @@
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; APPLE LOCAL begin 4332318
(define_insn "sse_movhlps"
[(set (match_operand:V4SF 0 "nonimmediate_operand" "=x,x,m")
(vec_select:V4SF
(vec_concat:V8SF
- (match_operand:V4SF 1 "nonimmediate_operand" " 0,o,x")
- (match_operand:V4SF 2 "nonimmediate_operand" " x,0,0"))
- (parallel [(const_int 4)
- (const_int 5)
+ (match_operand:V4SF 1 "nonimmediate_operand" " 0,0,0")
+ (match_operand:V4SF 2 "nonimmediate_operand" " x,o,x"))
+ (parallel [(const_int 6)
+ (const_int 7)
(const_int 2)
(const_int 3)])))]
"TARGET_SSE && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
"@
movhlps\t{%2, %0|%0, %2}
- movlps\t{%H1, %0|%0, %H1}
- movhps\t{%1, %0|%0, %1}"
+ movlps\t{%H2, %0|%0, %H2}
+ movhps\t{%2, %0|%0, %2}"
[(set_attr "type" "ssemov")
(set_attr "mode" "V4SF,V2SF,V2SF")])
+;; APPLE LOCAL end 4332318
; APPLE LOCAL begin radar 4099352
(define_insn "sse_movlhps"
diff --git a/gcc/testsuite/ChangeLog.apple-ppc b/gcc/testsuite/ChangeLog.apple-ppc
index 7a4f873c9b9..7775cb27327 100644
--- a/gcc/testsuite/ChangeLog.apple-ppc
+++ b/gcc/testsuite/ChangeLog.apple-ppc
@@ -1,3 +1,7 @@
+2005-12-06 Dale Johannesen <dalej@apple.com>
+
+ * gcc.target/i386/sse-17.c: New.
+
2005-11-15 Dale Johannesen <dalej@apple.com>
* gcc.c-torture/execute/20051113-1.c: New.
diff --git a/gcc/testsuite/gcc.target/i386/sse-17.c b/gcc/testsuite/gcc.target/i386/sse-17.c
new file mode 100644
index 00000000000..98ebf7f4b3c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/sse-17.c
@@ -0,0 +1,31 @@
+/* APPLE LOCAL file 4332318 mainline candidate */
+/* { dg-do run { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-O2 -msse2" } */
+#include <xmmintrin.h>
+extern void abort();
+int untrue = 0;
+typedef union {
+ __v4sf v;
+ float f[4];
+} u;
+void foo (u, u) __attribute__((noinline));
+void foo (u a, u b) {
+ if (b.f[0] != 7.0 || b.f[1] != 8.0 || b.f[2] != 3.0 || b.f[3] != 4.0)
+ abort();
+}
+void bar (__v4sf, __v4sf) __attribute__((noinline));
+void bar (__v4sf a __attribute((unused)), __v4sf b __attribute((unused))) { untrue = 0;}
+__v4sf setupa () __attribute((noinline));
+__v4sf setupa () { __v4sf t = { 1.0, 2.0, 3.0, 4.0 }; return t; }
+__v4sf setupb () __attribute((noinline));
+__v4sf setupb () { __v4sf t = { 5.0, 6.0, 7.0, 8.0 }; return t; }
+main() {
+ u a, b;
+ a.v = setupa ();
+ b.v = setupb ();
+ if (untrue)
+ bar(a.v, b.v);
+ b.v = (__v4sf) _mm_movehl_ps ((__m128)a.v, (__m128)b.v);
+ foo (a, b);
+ return 0;
+}