aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorUros Bizjak <uros@gcc.gnu.org>2009-08-14 12:31:09 +0200
committerUros Bizjak <uros@gcc.gnu.org>2009-08-14 12:31:09 +0200
commit1262fd02b65bb037b36551b91df729bace07ba46 (patch)
tree9a7c526dfaa2ff8b3a0e7551ef2e56ef87703395 /gcc
parent34d3575322b96adb6147df121b6eef8ac03953dd (diff)
downloadgcc-1262fd02b65bb037b36551b91df729bace07ba46.zip
gcc-1262fd02b65bb037b36551b91df729bace07ba46.tar.gz
gcc-1262fd02b65bb037b36551b91df729bace07ba46.tar.bz2
re PR target/41019 (Vector conditional move produces wrong code with -O3.)
PR target/41019 * config/i386/sse.md (SSEMODE124C8): New mode iterator. (vcond<SSEMODEF2P:mode>): Assert that operation is supported by ix86_expand_fp_vcond. (vcond<SSEMODE124C8:mode>): Use SSEMODE124C8 instead of SSEMODE124. Assert that operation is supported by ix86_expand_int_vcond. (vcondu<SSEMODE124C8:mode>): Ditto. testsuite/ChangeLog: PR target/41019 * gcc.target/i386/pr41019.c: New test. From-SVN: r150738
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog29
-rw-r--r--gcc/config/i386/sse.md49
-rw-r--r--gcc/testsuite/ChangeLog19
-rw-r--r--gcc/testsuite/gcc.target/i386/pr41019.c19
4 files changed, 75 insertions, 41 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6eb1889..e48cbcd 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+2009-08-14 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/41019
+ * config/i386/sse.md (SSEMODE124C8): New mode iterator.
+ (vcond<SSEMODEF2P:mode>): Assert that operation is supported by
+ ix86_expand_fp_vcond.
+ (vcond<SSEMODE124C8:mode>): Use SSEMODE124C8 instead of SSEMODE124.
+ Assert that operation is supported by ix86_expand_int_vcond.
+ (vcondu<SSEMODE124C8:mode>): Ditto.
+
2009-08-13 DJ Delorie <dj@redhat.com>
* config/i386/djgpp-stdint.h: New.
@@ -6,8 +16,7 @@
2009-08-13 Kaz Kojima <kkojima@gcc.gnu.org>
* config/sh/sh.c (sh_override_options): When flag_exceptions or
- flag_unwind_tables is on, turn flag_reorder_blocks_and_partition
- off.
+ flag_unwind_tables is on, turn flag_reorder_blocks_and_partition off.
2009-08-13 Ghassan Shobaki <ghassan.shobaki@amd.com>
@@ -182,18 +191,19 @@
transform has been done. Call restore_scattering if the transform
is not legal.
(graphite-interchange.c): Same.
- * graphite-poly.c (print_scattering_function): Test for PBB_TRANSFORMED.
+ * graphite-poly.c (print_scattering_function): Test for
+ PBB_TRANSFORMED.
(graphite_read_transforms): Initialize PBB_TRANSFORMED.
(apply_poly_transforms): Do not gcc_assert that
the transform is legal.
- (new_poly_bb): Initialize PBB_TRANSFORMED, PBB_SAVED, and PBB_ORIGINAL.
+ (new_poly_bb): Initialize PBB_TRANSFORMED, PBB_SAVED and PBB_ORIGINAL.
Do not initialize PBB_NB_SCATTERING_TRANSFORM, PBB_NB_LOCAL_VARIABLES,
PBB_TRANSFORMED_SCATTERING, and PBB_ORIGINAL_SCATTERING.
(free_poly_dr): Free PBB_TRANSFORMED, PBB_SAVED, and PBB_ORIGINAL.
* graphite-poly.h (struct poly_scattering): New.
(struct poly_bb): Add original, transformed, and saved fields.
- Remove transformed_scattering, original_scattering, nb_local_variables,
- and nb_scattering_transform fields.
+ Remove transformed_scattering, original_scattering,
+ nb_local_variables and nb_scattering_transform fields.
(PBB_ORIGINAL, PBB_TRANSFORMED, PBB_SAVED): New.
(poly_scattering_new): New.
(poly_scattering_free): New.
@@ -248,8 +258,7 @@
* config/mips/mips-protos.h (and_operands_ok): Declare it.
* config/mips/mips.md (move_type): Add ext_ins and logical.
(type): Handle them.
- (and<mode>3): Use and_reg_operand as the second operand's
- predicate.
+ (and<mode>3): Use and_reg_operand as the second operand's predicate.
(*and<mode>3): Add alternatives for lbu, lhu, lwu, <d>ext and
shift_shift. Remove commutative constraint modifier.
(*and<mode>3_mips16): Add alternatives for lbu, lhu, lwu and
@@ -1396,9 +1405,9 @@
(vec_unpacks_hi_v4sf): Ditto.
(vec_unpacks_lo_v4sf): Ditto.
(vec_unpacks_float_hi_v4si): Ditto.
- (vec_unpacku_float_lo_v4si): Ditto.
- (vec_unpacku_float_hi_v4si): Ditto.
(vec_unpacks_float_lo_v4si): Ditto.
+ (vec_unpacku_float_hi_v4si): Ditto.
+ (vec_unpacku_float_lo_v4si): Ditto.
(movmisalign<mode>): Ditto.
(vector_ceil<mode>2): New patterns for vectorizing math library.
(vector_floor<mode>2): Ditto.
diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index 43ec67a..7c60f01 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -64,6 +64,10 @@
(define_mode_iterator SSEMODE4S [V4SF V4SI])
(define_mode_iterator SSEMODE2D [V2DF V2DI])
+;; Modes handled by integer vcond pattern
+(define_mode_iterator SSEMODE124C8 [V16QI V8HI V4SI
+ (V2DI "TARGET_SSE4_2 || TARGET_SSE5")])
+
;; Mapping from float mode to required SSE level
(define_mode_attr sse [(SF "sse") (DF "sse2") (V4SF "sse") (V2DF "sse2")])
@@ -1520,10 +1524,9 @@
(match_operand:SSEMODEF2P 2 "general_operand" "")))]
"SSE_VEC_FLOAT_MODE_P (<MODE>mode)"
{
- if (ix86_expand_fp_vcond (operands))
- DONE;
- else
- FAIL;
+ bool ok = ix86_expand_fp_vcond (operands);
+ gcc_assert (ok);
+ DONE;
})
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -6071,35 +6074,33 @@
(set_attr "mode" "TI")])
(define_expand "vcond<mode>"
- [(set (match_operand:SSEMODEI 0 "register_operand" "")
- (if_then_else:SSEMODEI
+ [(set (match_operand:SSEMODE124C8 0 "register_operand" "")
+ (if_then_else:SSEMODE124C8
(match_operator 3 ""
- [(match_operand:SSEMODEI 4 "nonimmediate_operand" "")
- (match_operand:SSEMODEI 5 "nonimmediate_operand" "")])
- (match_operand:SSEMODEI 1 "general_operand" "")
- (match_operand:SSEMODEI 2 "general_operand" "")))]
+ [(match_operand:SSEMODE124C8 4 "nonimmediate_operand" "")
+ (match_operand:SSEMODE124C8 5 "nonimmediate_operand" "")])
+ (match_operand:SSEMODE124C8 1 "general_operand" "")
+ (match_operand:SSEMODE124C8 2 "general_operand" "")))]
"TARGET_SSE2"
{
- if (ix86_expand_int_vcond (operands))
- DONE;
- else
- FAIL;
+ bool ok = ix86_expand_int_vcond (operands);
+ gcc_assert (ok);
+ DONE;
})
(define_expand "vcondu<mode>"
- [(set (match_operand:SSEMODEI 0 "register_operand" "")
- (if_then_else:SSEMODEI
+ [(set (match_operand:SSEMODE124C8 0 "register_operand" "")
+ (if_then_else:SSEMODE124C8
(match_operator 3 ""
- [(match_operand:SSEMODEI 4 "nonimmediate_operand" "")
- (match_operand:SSEMODEI 5 "nonimmediate_operand" "")])
- (match_operand:SSEMODEI 1 "general_operand" "")
- (match_operand:SSEMODEI 2 "general_operand" "")))]
+ [(match_operand:SSEMODE124C8 4 "nonimmediate_operand" "")
+ (match_operand:SSEMODE124C8 5 "nonimmediate_operand" "")])
+ (match_operand:SSEMODE124C8 1 "general_operand" "")
+ (match_operand:SSEMODE124C8 2 "general_operand" "")))]
"TARGET_SSE2"
{
- if (ix86_expand_int_vcond (operands))
- DONE;
- else
- FAIL;
+ bool ok = ix86_expand_int_vcond (operands);
+ gcc_assert (ok);
+ DONE;
})
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index bb136c5..db94b62 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2009-08-14 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/41019
+ * gcc.target/i386/pr41019.c: New test.
+
2009-08-13 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/40955
@@ -77,13 +82,13 @@
2009-08-10 Manuel López-Ibáñez <manu@gcc.gnu.org>
- * gcc.dg/dg.exp: Test also c-c++-common dir.
- * g++.dg/dg.exp: Likewise.
- * g++.dg/warn/Wconversion-real.C: Delete.
- * gcc.dg/Wconversion-real.c: Move to ...
- * c-c++-common/Wconversion-real.c: ... here.
- * lib/target-supports.exp
- (check_effective_target_c,check_effective_target_c++): New.
+ * gcc.dg/dg.exp: Test also c-c++-common dir.
+ * g++.dg/dg.exp: Likewise.
+ * g++.dg/warn/Wconversion-real.C: Delete.
+ * gcc.dg/Wconversion-real.c: Move to ...
+ * c-c++-common/Wconversion-real.c: ... here.
+ * lib/target-supports.exp
+ (check_effective_target_c,check_effective_target_c++): New.
2009-08-10 Daniel Kraft <d@domob.eu>
diff --git a/gcc/testsuite/gcc.target/i386/pr41019.c b/gcc/testsuite/gcc.target/i386/pr41019.c
new file mode 100644
index 0000000..c0021c6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr41019.c
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -msse2 -ftree-vectorize" } */
+
+#include "sse2-check.h"
+
+long long int a[64];
+
+void
+sse2_test (void)
+{
+ int k;
+
+ for (k = 0; k < 64; k++)
+ a[k] = a[k] != 5 ? 12 : 10;
+
+ for (k = 0; k < 64; k++)
+ if (a[k] != 12)
+ abort ();
+}