diff options
author | uros <uros@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-09-10 09:10:00 +0000 |
---|---|---|
committer | uros <uros@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-09-10 09:10:00 +0000 |
commit | 5bbb5716aa8e1f9512bfe1f98a35ac7ef508bcbb (patch) | |
tree | f3ec85518b147a9837dfc690b96b6df65b69d2d6 | |
parent | 794a1c73ff5fe9cd400076ef89dbea07a70975b9 (diff) | |
download | gcc-5bbb5716aa8e1f9512bfe1f98a35ac7ef508bcbb.tar.gz |
PR target/33369
* gcc/config/i386/sse.md (ashr<mode>3): Change op2 mode to SImode.
Use 'N' operand constraint for op2.
(lshr<mode>3): Ditto.
(ashl<mode>3): Ditto.
(vec_shl_<mode>): Use const_0_to_255_mul_8_operand predicate for op2.
(vec_shr_<mode>): Use const_0_to_255_mul_8_operand predicate for op2.
* gcc/config/i386/i386.c (ix86_expand_builtin) [IX86_BUILTIN_PSLL?128,
IX86_BUILTIN_PSRA*?128, IX86_BUILTIN_PSRL?128]: Convert op1 to SImode.
testsuite/ChangeLog:
PR target/33369
* gcc.dg/vect/pr33369.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128328 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 13 | ||||
-rw-r--r-- | gcc/config/i386/i386.c | 4 | ||||
-rw-r--r-- | gcc/config/i386/i386.md | 4 | ||||
-rw-r--r-- | gcc/config/i386/sse.md | 14 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/pr33369.c | 21 |
6 files changed, 48 insertions, 13 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index dcf3a5cb1e2..e6868fe2d9f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,16 @@ +2007-09-10 Uros Bizjak <ubizjak@gmail.com> + + PR target/33369 + * gcc/config/i386/sse.md (ashr<mode>3): Change op2 mode to SImode. + Use 'N' operand constraint for op2. + (lshr<mode>3): Ditto. + (ashl<mode>3): Ditto. + (vec_shl_<mode>): Use const_0_to_255_mul_8_operand predicate for op2. + (vec_shr_<mode>): Use const_0_to_255_mul_8_operand predicate for op2. + + * gcc/config/i386/i386.c (ix86_expand_builtin) [IX86_BUILTIN_PSLL?128, + IX86_BUILTIN_PSRA*?128, IX86_BUILTIN_PSRL?128]: Convert op1 to SImode. + 2007-09-10 Andreas Krebbel <krebbel1@de.ibm.com> * config/s390/s390.md ("fixuns_trunc<BFP:mode><GPR:mode>2"): diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 640e9c089b3..b1dda95adc7 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -19476,8 +19476,8 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, if (! (*insn_data[icode].operand[1].predicate) (op0, mode1)) op0 = copy_to_reg (op0); - op1 = simplify_gen_subreg (TImode, op1, GET_MODE (op1), 0); - if (! (*insn_data[icode].operand[2].predicate) (op1, TImode)) + op1 = simplify_gen_subreg (SImode, op1, GET_MODE (op1), 0); + if (! (*insn_data[icode].operand[2].predicate) (op1, SImode)) op1 = copy_to_reg (op1); target = gen_reg_rtx (tmode); diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 3ddf7dc54fa..5b50274fcb8 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -4983,8 +4983,8 @@ "TARGET_SSE2 && TARGET_SSE_MATH && (!TARGET_USE_VECTOR_CONVERTS || optimize_size)" "@ - cvtsi2sd\t{%1, %0|%0, %1} - cvtsi2sd\t{%1, %0|%0, %1} + cvtsi2sd\t{%1, %0|%0, %1} + cvtsi2sd\t{%1, %0|%0, %1} cvtdq2pd\t{%1, %0|%0, %1}" [(set_attr "type" "sseicvt") (set_attr "mode" "DF,DF,V2DF") diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index 03b2577b2ce..65207a403d0 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -3416,7 +3416,7 @@ [(set (match_operand:SSEMODE24 0 "register_operand" "=x") (ashiftrt:SSEMODE24 (match_operand:SSEMODE24 1 "register_operand" "0") - (match_operand:TI 2 "nonmemory_operand" "xn")))] + (match_operand:SI 2 "nonmemory_operand" "xN")))] "TARGET_SSE2" "psra<ssevecsize>\t{%2, %0|%0, %2}" [(set_attr "type" "sseishft") @@ -3427,7 +3427,7 @@ [(set (match_operand:SSEMODE248 0 "register_operand" "=x") (lshiftrt:SSEMODE248 (match_operand:SSEMODE248 1 "register_operand" "0") - (match_operand:TI 2 "nonmemory_operand" "xn")))] + (match_operand:SI 2 "nonmemory_operand" "xN")))] "TARGET_SSE2" "psrl<ssevecsize>\t{%2, %0|%0, %2}" [(set_attr "type" "sseishft") @@ -3438,7 +3438,7 @@ [(set (match_operand:SSEMODE248 0 "register_operand" "=x") (ashift:SSEMODE248 (match_operand:SSEMODE248 1 "register_operand" "0") - (match_operand:TI 2 "nonmemory_operand" "xn")))] + (match_operand:SI 2 "nonmemory_operand" "xN")))] "TARGET_SSE2" "psll<ssevecsize>\t{%2, %0|%0, %2}" [(set_attr "type" "sseishft") @@ -3448,11 +3448,9 @@ (define_expand "vec_shl_<mode>" [(set (match_operand:SSEMODEI 0 "register_operand" "") (ashift:TI (match_operand:SSEMODEI 1 "register_operand" "") - (match_operand:SI 2 "general_operand" "")))] + (match_operand:SI 2 "const_0_to_255_mul_8_operand" "")))] "TARGET_SSE2" { - if (!const_0_to_255_mul_8_operand (operands[2], SImode)) - FAIL; operands[0] = gen_lowpart (TImode, operands[0]); operands[1] = gen_lowpart (TImode, operands[1]); }) @@ -3460,11 +3458,9 @@ (define_expand "vec_shr_<mode>" [(set (match_operand:SSEMODEI 0 "register_operand" "") (lshiftrt:TI (match_operand:SSEMODEI 1 "register_operand" "") - (match_operand:SI 2 "general_operand" "")))] + (match_operand:SI 2 "const_0_to_255_mul_8_operand" "")))] "TARGET_SSE2" { - if (!const_0_to_255_mul_8_operand (operands[2], SImode)) - FAIL; operands[0] = gen_lowpart (TImode, operands[0]); operands[1] = gen_lowpart (TImode, operands[1]); }) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index bd7bde726a2..95280504f23 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-09-10 Uros Bizjak <ubizjak@gmail.com> + + PR target/33369 + * gcc.dg/vect/pr33369.c: New test. + 2007-09-10 Paul Thomas <pault@gcc.gnu.org> PR fortran/33370 diff --git a/gcc/testsuite/gcc.dg/vect/pr33369.c b/gcc/testsuite/gcc.dg/vect/pr33369.c new file mode 100644 index 00000000000..9979cbd01f7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr33369.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target vect_shift } */ + +typedef struct tagPOINT +{ + int x; + int y; +} POINT; + +void +f (POINT * ptBuf) +{ + int i; + for (i = 0; i < 4; i++) + { + ptBuf[i].x = ((ptBuf[i].x) << 4); + ptBuf[i].y = ((ptBuf[i].y) << 4); + } +} + +/* { dg-final { cleanup-tree-dump "vect" } } */ |