i386: Fix zero/sign extend expanders [PR95229]

2020-05-20  Uroš Bizjak  <ubizjak@gmail.com>

gcc/ChangeLog:
	PR target/95229
	* config/i386/sse.md (<code>v8qiv8hi2): Use
	simplify_gen_subreg instead of simplify_subreg.
	(<code>v8qiv8si2): Ditto.
	(<code>v4qiv4si2): Ditto.
	(<code>v4hiv4si2): Ditto.
	(<code>v8qiv8di2): Ditto.
	(<code>v4qiv4di2): Ditto.
	(<code>v2qiv2di2): Ditto.
	(<code>v4hiv4di2): Ditto.
	(<code>v2hiv2di2): Ditto.
	(<code>v2siv2di2): Ditto.

gcc/testsuite/ChangeLog:
	PR target/95229
	* g++.target/i386/pr95229.C: New test.
This commit is contained in:
Uros Bizjak 2020-05-20 19:00:39 +02:00
parent 2cf6f31527
commit 3872a519c8
4 changed files with 54 additions and 10 deletions

View File

@ -1,3 +1,18 @@
2020-05-20 Uroš Bizjak <ubizjak@gmail.com>
PR target/95229
* config/i386/sse.md (<code>v8qiv8hi2): Use
simplify_gen_subreg instead of simplify_subreg.
(<code>v8qiv8si2): Ditto.
(<code>v4qiv4si2): Ditto.
(<code>v4hiv4si2): Ditto.
(<code>v8qiv8di2): Ditto.
(<code>v4qiv4di2): Ditto.
(<code>v2qiv2di2): Ditto.
(<code>v4hiv4di2): Ditto.
(<code>v2hiv2di2): Ditto.
(<code>v2siv2di2): Ditto.
2020-05-20 Uroš Bizjak <ubizjak@gmail.com>
PR target/95238

View File

@ -17408,7 +17408,7 @@
{
if (!MEM_P (operands[1]))
{
operands[1] = simplify_subreg (V16QImode, operands[1], V8QImode, 0);
operands[1] = simplify_gen_subreg (V16QImode, operands[1], V8QImode, 0);
emit_insn (gen_sse4_1_<code>v8qiv8hi2 (operands[0], operands[1]));
DONE;
}
@ -17485,7 +17485,7 @@
{
if (!MEM_P (operands[1]))
{
operands[1] = simplify_subreg (V16QImode, operands[1], V8QImode, 0);
operands[1] = simplify_gen_subreg (V16QImode, operands[1], V8QImode, 0);
emit_insn (gen_avx2_<code>v8qiv8si2 (operands[0], operands[1]));
DONE;
}
@ -17548,7 +17548,7 @@
{
if (!MEM_P (operands[1]))
{
operands[1] = simplify_subreg (V16QImode, operands[1], V4QImode, 0);
operands[1] = simplify_gen_subreg (V16QImode, operands[1], V4QImode, 0);
emit_insn (gen_sse4_1_<code>v4qiv4si2 (operands[0], operands[1]));
DONE;
}
@ -17640,7 +17640,7 @@
{
if (!MEM_P (operands[1]))
{
operands[1] = simplify_subreg (V8HImode, operands[1], V4HImode, 0);
operands[1] = simplify_gen_subreg (V8HImode, operands[1], V4HImode, 0);
emit_insn (gen_sse4_1_<code>v4hiv4si2 (operands[0], operands[1]));
DONE;
}
@ -17698,7 +17698,7 @@
{
if (!MEM_P (operands[1]))
{
operands[1] = simplify_subreg (V16QImode, operands[1], V8QImode, 0);
operands[1] = simplify_gen_subreg (V16QImode, operands[1], V8QImode, 0);
emit_insn (gen_avx512f_<code>v8qiv8di2 (operands[0], operands[1]));
DONE;
}
@ -17759,7 +17759,7 @@
{
if (!MEM_P (operands[1]))
{
operands[1] = simplify_subreg (V16QImode, operands[1], V8QImode, 0);
operands[1] = simplify_gen_subreg (V16QImode, operands[1], V8QImode, 0);
emit_insn (gen_avx2_<code>v4qiv4di2 (operands[0], operands[1]));
DONE;
}
@ -17785,7 +17785,7 @@
(match_operand:V2QI 1 "register_operand")))]
"TARGET_SSE4_1"
{
operands[1] = simplify_subreg (V16QImode, operands[1], V2QImode, 0);
operands[1] = simplify_gen_subreg (V16QImode, operands[1], V2QImode, 0);
emit_insn (gen_sse4_1_<code>v2qiv2di2 (operands[0], operands[1]));
DONE;
})
@ -17857,7 +17857,7 @@
{
if (!MEM_P (operands[1]))
{
operands[1] = simplify_subreg (V8HImode, operands[1], V4HImode, 0);
operands[1] = simplify_gen_subreg (V8HImode, operands[1], V4HImode, 0);
emit_insn (gen_avx2_<code>v4hiv4di2 (operands[0], operands[1]));
DONE;
}
@ -17918,7 +17918,7 @@
{
if (!MEM_P (operands[1]))
{
operands[1] = simplify_subreg (V8HImode, operands[1], V2HImode, 0);
operands[1] = simplify_gen_subreg (V8HImode, operands[1], V2HImode, 0);
emit_insn (gen_sse4_1_<code>v2hiv2di2 (operands[0], operands[1]));
DONE;
}
@ -18008,7 +18008,7 @@
{
if (!MEM_P (operands[1]))
{
operands[1] = simplify_subreg (V4SImode, operands[1], V2SImode, 0);
operands[1] = simplify_gen_subreg (V4SImode, operands[1], V2SImode, 0);
emit_insn (gen_sse4_1_<code>v2siv2di2 (operands[0], operands[1]));
DONE;
}

View File

@ -1,3 +1,8 @@
2020-05-20 Uroš Bizjak <ubizjak@gmail.com>
PR target/95229
* g++.target/i386/pr95229.C: New test.
2020-05-20 Mark Eggleston <markeggleston@gcc.gnu.org>
PR fortran/39695

View File

@ -0,0 +1,24 @@
// PR target/95229
// { dg-do compile }
// { dg-options "-O3 -march=znver1" }
struct a {
unsigned long long b;
unsigned long long c;
};
class {
public:
a d;
} e;
struct f {
unsigned g;
unsigned h;
void i();
};
void f::i() {
e.d.b += g;
e.d.c += h;
}