* [PATCH, test, i386] Fix for PR50155
@ 2011-08-22 19:09 Kirill Yukhin
2011-08-22 19:51 ` Uros Bizjak
2011-08-22 20:36 ` Jakub Jelinek
0 siblings, 2 replies; 5+ messages in thread
From: Kirill Yukhin @ 2011-08-22 19:09 UTC (permalink / raw)
To: gcc-patches List; +Cc: Jakub Jelinek, H.J. Lu, Uros Bizjak
[-- Attachment #1: Type: text/plain, Size: 653 bytes --]
Hi,
Attached fix for http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50155
ChangeLog entry:
2011-08-22 Kirill Yukhin <kirill.yukhin@intel.com>
PR target/50155
* config/i386/sse.md (VI1248_AVX2): New.
(<plusminus_insn><mode>3): Update.
(*<plusminus_insn><mode>3): Likewise.
(<sse2_avx2>_andnot<mode>3): Likewise.
(avx2_pbroadcast<mode>): Likewise.
testsuite/ChangeLog entry:
2011-08-22 Kirill Yukhin <kirill.yukhin@intel.com>
PR target/50155
* gcc.target/i386/pr50155.c: New test.
New test fails without fix, passed with it applied.
Ok for trunk if bootstrap will success?
Thanks, K
[-- Attachment #2: pr50155.gcc.patch --]
[-- Type: application/octet-stream, Size: 3074 bytes --]
diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index 5bc8586..ac542ba 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -93,6 +93,13 @@
(define_mode_iterator VI8_AVX2
[(V4DI "TARGET_AVX2") V2DI])
+(define_mode_iterator VI1248_AVX2
+ [(V32QI "TARGET_AVX2") V16QI
+ (V16HI "TARGET_AVX2") V8HI
+ (V8SI "TARGET_AVX2") V4SI
+ (V4DI "TARGET_AVX2") V2DI])
+
+
(define_mode_iterator VIMAX_AVX2
[(V4DI "TARGET_AVX2") V1TI])
@@ -4641,18 +4648,18 @@
"operands[2] = force_reg (<MODE>mode, CONST0_RTX (<MODE>mode));")
(define_expand "<plusminus_insn><mode>3"
- [(set (match_operand:VI 0 "register_operand" "")
- (plusminus:VI
- (match_operand:VI 1 "nonimmediate_operand" "")
- (match_operand:VI 2 "nonimmediate_operand" "")))]
+ [(set (match_operand:VI1248_AVX2 0 "register_operand" "")
+ (plusminus:VI1248_AVX2
+ (match_operand:VI1248_AVX2 1 "nonimmediate_operand" "")
+ (match_operand:VI1248_AVX2 2 "nonimmediate_operand" "")))]
"TARGET_SSE2"
"ix86_fixup_binary_operands_no_copy (<CODE>, <MODE>mode, operands);")
(define_insn "*<plusminus_insn><mode>3"
- [(set (match_operand:VI 0 "register_operand" "=x,x")
- (plusminus:VI
- (match_operand:VI 1 "nonimmediate_operand" "<comm>0,x")
- (match_operand:VI 2 "nonimmediate_operand" "xm,xm")))]
+ [(set (match_operand:VI1248_AVX2 0 "register_operand" "=x,x")
+ (plusminus:VI1248_AVX2
+ (match_operand:VI1248_AVX2 1 "nonimmediate_operand" "<comm>0,x")
+ (match_operand:VI1248_AVX2 2 "nonimmediate_operand" "xm,xm")))]
"TARGET_SSE2 && ix86_binary_operator_ok (<CODE>, <MODE>mode, operands)"
"@
p<plusminus_mnemonic><ssemodesuffix>\t{%2, %0|%0, %2}
@@ -6161,10 +6168,10 @@
})
(define_expand "<sse2_avx2>_andnot<mode>3"
- [(set (match_operand:VI 0 "register_operand" "")
- (and:VI
- (not:VI (match_operand:VI 1 "register_operand" ""))
- (match_operand:VI 2 "nonimmediate_operand" "")))]
+ [(set (match_operand:VI1248_AVX2 0 "register_operand" "")
+ (and:VI1248_AVX2
+ (not:VI1248_AVX2 (match_operand:VI1248_AVX2 1 "register_operand" ""))
+ (match_operand:VI1248_AVX2 2 "nonimmediate_operand" "")))]
"TARGET_SSE2")
(define_insn "*andnot<mode>3"
@@ -11291,8 +11298,8 @@
(V32QI "V16QI") (V16QI "V16QI")])
(define_insn "avx2_pbroadcast<mode>"
- [(set (match_operand:VI 0 "register_operand" "=x")
- (vec_duplicate:VI
+ [(set (match_operand:VI1248_AVX2 0 "register_operand" "=x")
+ (vec_duplicate:VI1248_AVX2
(vec_select:<ssescalarmode>
(match_operand:<AVXTOSSEMODE> 1 "nonimmediate_operand" "xm")
(parallel [(const_int 0)]))))]
diff --git a/gcc/testsuite/gcc.target/i386/pr50155.c b/gcc/testsuite/gcc.target/i386/pr50155.c
new file mode 100644
index 0000000..d7730b7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr50155.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -mavx" } */
+
+void
+foo (int x, double *a, double *b, double c)
+{
+ int i;
+
+ for (i = 0; i < x; i++)
+ *a++ = *b++ * i / c;
+}
+
+/* { dg-final { scan-assembler-not "vpaddd\[ \\t\]+\[^\n\]*%ymm\[0-9\]" } } */
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH, test, i386] Fix for PR50155
2011-08-22 19:09 [PATCH, test, i386] Fix for PR50155 Kirill Yukhin
@ 2011-08-22 19:51 ` Uros Bizjak
2011-08-22 20:36 ` Jakub Jelinek
1 sibling, 0 replies; 5+ messages in thread
From: Uros Bizjak @ 2011-08-22 19:51 UTC (permalink / raw)
To: Kirill Yukhin; +Cc: gcc-patches List, Jakub Jelinek, H.J. Lu
[-- Attachment #1: Type: text/plain, Size: 1260 bytes --]
On Mon, Aug 22, 2011 at 8:51 PM, Kirill Yukhin <kirill.yukhin@gmail.com> wrote:
> Attached fix for http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50155
>
> ChangeLog entry:
> 2011-08-22 Kirill Yukhin <kirill.yukhin@intel.com>
>
> PR target/50155
> * config/i386/sse.md (VI1248_AVX2): New.
> (<plusminus_insn><mode>3): Update.
> (*<plusminus_insn><mode>3): Likewise.
> (<sse2_avx2>_andnot<mode>3): Likewise.
> (avx2_pbroadcast<mode>): Likewise.
>
> testsuite/ChangeLog entry:
> 2011-08-22 Kirill Yukhin <kirill.yukhin@intel.com>
>
> PR target/50155
> * gcc.target/i386/pr50155.c: New test.
>
> New test fails without fix, passed with it applied.
>
> Ok for trunk if bootstrap will success?
No.
- you are disabling andnotps for 256bit integer modes on !TARGET_AVX2 targets.
- avx2_pbroadcast change is a no-op.
I found two additional problems with the patch:
- order of evaluation of cond RTX in mode attribute calculation is
wrong for *andnot<mode>3 and *<any_logic:code><mode>3 instructions.
- shortmode mode attribute is not used (minor)
Attached (lightly tested) patch fixes all problems and adds additional
asserts into mentioned logic instructions.
Uros.
[-- Attachment #2: p.diff.txt --]
[-- Type: text/plain, Size: 4646 bytes --]
Index: sse.md
===================================================================
--- sse.md (revision 177968)
+++ sse.md (working copy)
@@ -73,6 +73,12 @@
(V8SI "TARGET_AVX") V4SI
(V4DI "TARGET_AVX") V2DI])
+(define_mode_iterator VI_AVX2
+ [(V32QI "TARGET_AVX2") V16QI
+ (V16HI "TARGET_AVX2") V8HI
+ (V8SI "TARGET_AVX2") V4SI
+ (V4DI "TARGET_AVX2") V2DI])
+
;; All QImode vector integer modes
(define_mode_iterator VI1
[(V32QI "TARGET_AVX") V16QI])
@@ -124,8 +130,8 @@
[V4SI V4DI])
(define_mode_iterator V48_AVX2
- [(V4SF "TARGET_SSE") (V2DF "TARGET_SSE2")
- (V8SF "TARGET_AVX") (V4DF "TARGET_AVX")
+ [V4SF V2DF
+ V8SF V4DF
(V4SI "TARGET_AVX2") (V2DI "TARGET_AVX2")
(V8SI "TARGET_AVX2") (V4DI "TARGET_AVX2")])
@@ -170,9 +176,6 @@
(define_mode_attr ssebytemode
[(V4DI "V32QI") (V2DI "V16QI")])
-(define_mode_attr shortmode
- [(V4DI "v4si") (V2DI "v2si")])
-
;; All 128bit vector integer modes
(define_mode_iterator VI_128 [V16QI V8HI V4SI V2DI])
@@ -4641,18 +4644,18 @@
"operands[2] = force_reg (<MODE>mode, CONST0_RTX (<MODE>mode));")
(define_expand "<plusminus_insn><mode>3"
- [(set (match_operand:VI 0 "register_operand" "")
- (plusminus:VI
- (match_operand:VI 1 "nonimmediate_operand" "")
- (match_operand:VI 2 "nonimmediate_operand" "")))]
+ [(set (match_operand:VI_AVX2 0 "register_operand" "")
+ (plusminus:VI_AVX2
+ (match_operand:VI_AVX2 1 "nonimmediate_operand" "")
+ (match_operand:VI_AVX2 2 "nonimmediate_operand" "")))]
"TARGET_SSE2"
"ix86_fixup_binary_operands_no_copy (<CODE>, <MODE>mode, operands);")
(define_insn "*<plusminus_insn><mode>3"
- [(set (match_operand:VI 0 "register_operand" "=x,x")
- (plusminus:VI
- (match_operand:VI 1 "nonimmediate_operand" "<comm>0,x")
- (match_operand:VI 2 "nonimmediate_operand" "xm,xm")))]
+ [(set (match_operand:VI_AVX2 0 "register_operand" "=x,x")
+ (plusminus:VI_AVX2
+ (match_operand:VI_AVX2 1 "nonimmediate_operand" "<comm>0,x")
+ (match_operand:VI_AVX2 2 "nonimmediate_operand" "xm,xm")))]
"TARGET_SSE2 && ix86_binary_operator_ok (<CODE>, <MODE>mode, operands)"
"@
p<plusminus_mnemonic><ssemodesuffix>\t{%2, %0|%0, %2}
@@ -6176,10 +6179,30 @@
{
static char buf[32];
const char *ops;
- const char *tmp
- = ((get_attr_mode (insn) == MODE_TI) ||
- (get_attr_mode (insn) == MODE_OI)) ? "pandn" : "andnps";
+ const char *tmp;
+ switch (get_attr_mode (insn))
+ {
+ case MODE_OI:
+ gcc_assert (TARGET_AVX2);
+ case MODE_TI:
+ gcc_assert (TARGET_SSE2);
+
+ tmp = "pandn";
+ break;
+
+ case MODE_V8SF:
+ gcc_assert (TARGET_AVX);
+ case MODE_V4SF:
+ gcc_assert (TARGET_SSE);
+
+ tmp = "andnps";
+ break;
+
+ default:
+ gcc_unreachable ();
+ }
+
switch (which_alternative)
{
case 0:
@@ -6205,12 +6228,12 @@
(const_string "*")))
(set_attr "prefix" "orig,vex")
(set (attr "mode")
- (cond [(ne (symbol_ref "GET_MODE_SIZE (<MODE>mode) > 128") (const_int 0))
+ (cond [(ne (symbol_ref "TARGET_AVX2") (const_int 0))
+ (const_string "OI")
+ (ne (symbol_ref "GET_MODE_SIZE (<MODE>mode) > 128") (const_int 0))
(const_string "V8SF")
(ne (symbol_ref "TARGET_SSE2") (const_int 0))
(const_string "TI")
- (ne (symbol_ref "TARGET_AVX2") (const_int 0))
- (const_string "OI")
]
(const_string "V4SF")))])
@@ -6232,10 +6255,30 @@
{
static char buf[32];
const char *ops;
- const char *tmp
- = (get_attr_mode (insn) == MODE_TI)||
- (get_attr_mode (insn) == MODE_OI) ? "p<logic>" : "<logic>ps";
+ const char *tmp;
+ switch (get_attr_mode (insn))
+ {
+ case MODE_OI:
+ gcc_assert (TARGET_AVX2);
+ case MODE_TI:
+ gcc_assert (TARGET_SSE2);
+
+ tmp = "p<logic>";
+ break;
+
+ case MODE_V8SF:
+ gcc_assert (TARGET_AVX);
+ case MODE_V4SF:
+ gcc_assert (TARGET_SSE);
+
+ tmp = "<logic>ps";
+ break;
+
+ default:
+ gcc_unreachable ();
+ }
+
switch (which_alternative)
{
case 0:
@@ -6261,12 +6304,12 @@
(const_string "*")))
(set_attr "prefix" "orig,vex")
(set (attr "mode")
- (cond [(ne (symbol_ref "GET_MODE_SIZE (<MODE>mode) > 128") (const_int 0))
+ (cond [(ne (symbol_ref "TARGET_AVX2") (const_int 0))
+ (const_string "OI")
+ (ne (symbol_ref "GET_MODE_SIZE (<MODE>mode) > 128") (const_int 0))
(const_string "V8SF")
(ne (symbol_ref "TARGET_SSE2") (const_int 0))
(const_string "TI")
- (ne (symbol_ref "TARGET_AVX2") (const_int 0))
- (const_string "OI")
]
(const_string "V4SF")))])
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH, test, i386] Fix for PR50155
2011-08-22 19:09 [PATCH, test, i386] Fix for PR50155 Kirill Yukhin
2011-08-22 19:51 ` Uros Bizjak
@ 2011-08-22 20:36 ` Jakub Jelinek
2011-08-22 20:42 ` Kirill Yukhin
1 sibling, 1 reply; 5+ messages in thread
From: Jakub Jelinek @ 2011-08-22 20:36 UTC (permalink / raw)
To: Kirill Yukhin; +Cc: gcc-patches List, H.J. Lu, Uros Bizjak
On Mon, Aug 22, 2011 at 10:51:19PM +0400, Kirill Yukhin wrote:
> testsuite/ChangeLog entry:
> 2011-08-22 Kirill Yukhin <kirill.yukhin@intel.com>
>
> PR target/50155
> * gcc.target/i386/pr50155.c: New test.
For the testcase, I think you want explicit -mno-avx2 if
you want to check that vpaddd hasn't been emitted, otherwise
anybody testing with --with-arch=corei7-avx2 tuned compiler
ot --target_board=unix/-mavx2 will see failures.
Jakub
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH, test, i386] Fix for PR50155
2011-08-22 20:36 ` Jakub Jelinek
@ 2011-08-22 20:42 ` Kirill Yukhin
2011-08-22 23:04 ` Uros Bizjak
0 siblings, 1 reply; 5+ messages in thread
From: Kirill Yukhin @ 2011-08-22 20:42 UTC (permalink / raw)
To: Jakub Jelinek; +Cc: gcc-patches List, H.J. Lu, Uros Bizjak
[-- Attachment #1: Type: text/plain, Size: 627 bytes --]
Thanks for inputs.
Updated test attached.
K
On Mon, Aug 22, 2011 at 11:12 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Mon, Aug 22, 2011 at 10:51:19PM +0400, Kirill Yukhin wrote:
>> testsuite/ChangeLog entry:
>> 2011-08-22 Kirill Yukhin <kirill.yukhin@intel.com>
>>
>> PR target/50155
>> * gcc.target/i386/pr50155.c: New test.
>
> For the testcase, I think you want explicit -mno-avx2 if
> you want to check that vpaddd hasn't been emitted, otherwise
> anybody testing with --with-arch=corei7-avx2 tuned compiler
> ot --target_board=unix/-mavx2 will see failures.
>
> Jakub
>
[-- Attachment #2: pr50155.test.patch --]
[-- Type: application/octet-stream, Size: 491 bytes --]
diff --git a/gcc/testsuite/gcc.target/i386/pr50155.c b/gcc/testsuite/gcc.target/i386/pr50155.c
new file mode 100644
index 0000000..c641d4c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr50155.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -mavx -mno-avx2" } */
+
+void
+foo (int x, double *a, double *b, double c)
+{
+ int i;
+
+ for (i = 0; i < x; i++)
+ *a++ = *b++ * i / c;
+}
+
+/* { dg-final { scan-assembler-not "vpaddd\[ \\t\]+\[^\n\]*%ymm\[0-9\]" } } */
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH, test, i386] Fix for PR50155
2011-08-22 20:42 ` Kirill Yukhin
@ 2011-08-22 23:04 ` Uros Bizjak
0 siblings, 0 replies; 5+ messages in thread
From: Uros Bizjak @ 2011-08-22 23:04 UTC (permalink / raw)
To: Kirill Yukhin; +Cc: Jakub Jelinek, gcc-patches List, H.J. Lu
[-- Attachment #1: Type: text/plain, Size: 1113 bytes --]
On Mon, Aug 22, 2011 at 9:38 PM, Kirill Yukhin <kirill.yukhin@gmail.com> wrote:
> Thanks for inputs.
> Updated test attached.
>>> testsuite/ChangeLog entry:
>>> 2011-08-22 Kirill Yukhin <kirill.yukhin@intel.com>
>>>
>>> PR target/50155
>>> * gcc.target/i386/pr50155.c: New test.
>>
>> For the testcase, I think you want explicit -mno-avx2 if
>> you want to check that vpaddd hasn't been emitted, otherwise
>> anybody testing with --with-arch=corei7-avx2 tuned compiler
>> ot --target_board=unix/-mavx2 will see failures.
Attached is the patch I have committed in addition to your testcase.
2011-08-22 Uros Bizjak <ubizjak@gmail.com>
Kirill Yukhin <kirill.yukhin@intel.com>
PR target/50155
* config/i386/sse.md (VI_AVX2): New.
(<plusminus_insn><mode>3): Use VI_AVX2 mode iterator.
(*<plusminus_insn><mode>3): Ditto.
(<sse2_avx2>_andnot<mode>3): Ditto.
(*andnot<mode>3): Fix order of cond operands.
Add asserts for correct TARGET_xxx.
(*<any_logic:code><mode>3): Ditto.
Bootstrapped and regression tested on x86_64-pc-linux-gnu {,-m32}.
Uros.
[-- Attachment #2: p.diff.txt --]
[-- Type: text/plain, Size: 5140 bytes --]
Index: sse.md
===================================================================
--- sse.md (revision 177955)
+++ sse.md (working copy)
@@ -73,6 +73,12 @@
(V8SI "TARGET_AVX") V4SI
(V4DI "TARGET_AVX") V2DI])
+(define_mode_iterator VI_AVX2
+ [(V32QI "TARGET_AVX2") V16QI
+ (V16HI "TARGET_AVX2") V8HI
+ (V8SI "TARGET_AVX2") V4SI
+ (V4DI "TARGET_AVX2") V2DI])
+
;; All QImode vector integer modes
(define_mode_iterator VI1
[(V32QI "TARGET_AVX") V16QI])
@@ -124,8 +130,8 @@
[V4SI V4DI])
(define_mode_iterator V48_AVX2
- [(V4SF "TARGET_SSE") (V2DF "TARGET_SSE2")
- (V8SF "TARGET_AVX") (V4DF "TARGET_AVX")
+ [V4SF V2DF
+ V8SF V4DF
(V4SI "TARGET_AVX2") (V2DI "TARGET_AVX2")
(V8SI "TARGET_AVX2") (V4DI "TARGET_AVX2")])
@@ -170,9 +176,6 @@
(define_mode_attr ssebytemode
[(V4DI "V32QI") (V2DI "V16QI")])
-(define_mode_attr shortmode
- [(V4DI "v4si") (V2DI "v2si")])
-
;; All 128bit vector integer modes
(define_mode_iterator VI_128 [V16QI V8HI V4SI V2DI])
@@ -4641,18 +4644,18 @@
"operands[2] = force_reg (<MODE>mode, CONST0_RTX (<MODE>mode));")
(define_expand "<plusminus_insn><mode>3"
- [(set (match_operand:VI 0 "register_operand" "")
- (plusminus:VI
- (match_operand:VI 1 "nonimmediate_operand" "")
- (match_operand:VI 2 "nonimmediate_operand" "")))]
+ [(set (match_operand:VI_AVX2 0 "register_operand" "")
+ (plusminus:VI_AVX2
+ (match_operand:VI_AVX2 1 "nonimmediate_operand" "")
+ (match_operand:VI_AVX2 2 "nonimmediate_operand" "")))]
"TARGET_SSE2"
"ix86_fixup_binary_operands_no_copy (<CODE>, <MODE>mode, operands);")
(define_insn "*<plusminus_insn><mode>3"
- [(set (match_operand:VI 0 "register_operand" "=x,x")
- (plusminus:VI
- (match_operand:VI 1 "nonimmediate_operand" "<comm>0,x")
- (match_operand:VI 2 "nonimmediate_operand" "xm,xm")))]
+ [(set (match_operand:VI_AVX2 0 "register_operand" "=x,x")
+ (plusminus:VI_AVX2
+ (match_operand:VI_AVX2 1 "nonimmediate_operand" "<comm>0,x")
+ (match_operand:VI_AVX2 2 "nonimmediate_operand" "xm,xm")))]
"TARGET_SSE2 && ix86_binary_operator_ok (<CODE>, <MODE>mode, operands)"
"@
p<plusminus_mnemonic><ssemodesuffix>\t{%2, %0|%0, %2}
@@ -6161,10 +6164,10 @@
})
(define_expand "<sse2_avx2>_andnot<mode>3"
- [(set (match_operand:VI 0 "register_operand" "")
- (and:VI
- (not:VI (match_operand:VI 1 "register_operand" ""))
- (match_operand:VI 2 "nonimmediate_operand" "")))]
+ [(set (match_operand:VI_AVX2 0 "register_operand" "")
+ (and:VI_AVX2
+ (not:VI_AVX2 (match_operand:VI_AVX2 1 "register_operand" ""))
+ (match_operand:VI_AVX2 2 "nonimmediate_operand" "")))]
"TARGET_SSE2")
(define_insn "*andnot<mode>3"
@@ -6176,10 +6179,30 @@
{
static char buf[32];
const char *ops;
- const char *tmp
- = ((get_attr_mode (insn) == MODE_TI) ||
- (get_attr_mode (insn) == MODE_OI)) ? "pandn" : "andnps";
+ const char *tmp;
+ switch (get_attr_mode (insn))
+ {
+ case MODE_OI:
+ gcc_assert (TARGET_AVX2);
+ case MODE_TI:
+ gcc_assert (TARGET_SSE2);
+
+ tmp = "pandn";
+ break;
+
+ case MODE_V8SF:
+ gcc_assert (TARGET_AVX);
+ case MODE_V4SF:
+ gcc_assert (TARGET_SSE);
+
+ tmp = "andnps";
+ break;
+
+ default:
+ gcc_unreachable ();
+ }
+
switch (which_alternative)
{
case 0:
@@ -6205,12 +6228,12 @@
(const_string "*")))
(set_attr "prefix" "orig,vex")
(set (attr "mode")
- (cond [(ne (symbol_ref "GET_MODE_SIZE (<MODE>mode) > 128") (const_int 0))
+ (cond [(ne (symbol_ref "TARGET_AVX2") (const_int 0))
+ (const_string "OI")
+ (ne (symbol_ref "GET_MODE_SIZE (<MODE>mode) > 128") (const_int 0))
(const_string "V8SF")
(ne (symbol_ref "TARGET_SSE2") (const_int 0))
(const_string "TI")
- (ne (symbol_ref "TARGET_AVX2") (const_int 0))
- (const_string "OI")
]
(const_string "V4SF")))])
@@ -6232,10 +6255,30 @@
{
static char buf[32];
const char *ops;
- const char *tmp
- = (get_attr_mode (insn) == MODE_TI)||
- (get_attr_mode (insn) == MODE_OI) ? "p<logic>" : "<logic>ps";
+ const char *tmp;
+ switch (get_attr_mode (insn))
+ {
+ case MODE_OI:
+ gcc_assert (TARGET_AVX2);
+ case MODE_TI:
+ gcc_assert (TARGET_SSE2);
+
+ tmp = "p<logic>";
+ break;
+
+ case MODE_V8SF:
+ gcc_assert (TARGET_AVX);
+ case MODE_V4SF:
+ gcc_assert (TARGET_SSE);
+
+ tmp = "<logic>ps";
+ break;
+
+ default:
+ gcc_unreachable ();
+ }
+
switch (which_alternative)
{
case 0:
@@ -6261,12 +6304,12 @@
(const_string "*")))
(set_attr "prefix" "orig,vex")
(set (attr "mode")
- (cond [(ne (symbol_ref "GET_MODE_SIZE (<MODE>mode) > 128") (const_int 0))
+ (cond [(ne (symbol_ref "TARGET_AVX2") (const_int 0))
+ (const_string "OI")
+ (ne (symbol_ref "GET_MODE_SIZE (<MODE>mode) > 128") (const_int 0))
(const_string "V8SF")
(ne (symbol_ref "TARGET_SSE2") (const_int 0))
(const_string "TI")
- (ne (symbol_ref "TARGET_AVX2") (const_int 0))
- (const_string "OI")
]
(const_string "V4SF")))])
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-08-22 21:07 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-22 19:09 [PATCH, test, i386] Fix for PR50155 Kirill Yukhin
2011-08-22 19:51 ` Uros Bizjak
2011-08-22 20:36 ` Jakub Jelinek
2011-08-22 20:42 ` Kirill Yukhin
2011-08-22 23:04 ` Uros Bizjak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).