Commit 4eb20b03 by Jakub Jelinek Committed by Jakub Jelinek

sse.md (vec_unpacks_lo_<mode>, [...]): Change VI124_128 mode to VI124_AVX2.

	* config/i386/sse.md (vec_unpacks_lo_<mode>,
	vec_unpacks_hi_<mode>, vec_unpacku_lo_<mode>,
	vec_unpacku_hi_<mode>): Change VI124_128 mode to
	VI124_AVX2.
	* config/i386/i386.c (ix86_expand_sse_unpack): Handle
	V32QImode, V16HImode and V8SImode for TARGET_AVX2.

From-SVN: r179872
parent f2289672
2011-10-12 Jakub Jelinek <jakub@redhat.com> 2011-10-12 Jakub Jelinek <jakub@redhat.com>
* config/i386/sse.md (vec_unpacks_lo_<mode>,
vec_unpacks_hi_<mode>, vec_unpacku_lo_<mode>,
vec_unpacku_hi_<mode>): Change VI124_128 mode to
VI124_AVX2.
* config/i386/i386.c (ix86_expand_sse_unpack): Handle
V32QImode, V16HImode and V8SImode for TARGET_AVX2.
* config/i386/sse.md (vec_avx2): New mode_attr. * config/i386/sse.md (vec_avx2): New mode_attr.
(mulv16qi3): Macroize to cover also mulv32qi3 for (mulv16qi3): Macroize to cover also mulv32qi3 for
TARGET_AVX2 into ... TARGET_AVX2 into ...
...@@ -19683,9 +19683,38 @@ ix86_expand_sse_unpack (rtx operands[2], bool unsigned_p, bool high_p) ...@@ -19683,9 +19683,38 @@ ix86_expand_sse_unpack (rtx operands[2], bool unsigned_p, bool high_p)
if (TARGET_SSE4_1) if (TARGET_SSE4_1)
{ {
rtx (*unpack)(rtx, rtx); rtx (*unpack)(rtx, rtx);
rtx (*extract)(rtx, rtx) = NULL;
enum machine_mode halfmode = BLKmode;
switch (imode) switch (imode)
{ {
case V32QImode:
if (unsigned_p)
unpack = gen_avx2_zero_extendv16qiv16hi2;
else
unpack = gen_avx2_sign_extendv16qiv16hi2;
halfmode = V16QImode;
extract
= high_p ? gen_vec_extract_hi_v32qi : gen_vec_extract_lo_v32qi;
break;
case V16HImode:
if (unsigned_p)
unpack = gen_avx2_zero_extendv8hiv8si2;
else
unpack = gen_avx2_sign_extendv8hiv8si2;
halfmode = V8HImode;
extract
= high_p ? gen_vec_extract_hi_v16hi : gen_vec_extract_lo_v16hi;
break;
case V8SImode:
if (unsigned_p)
unpack = gen_avx2_zero_extendv4siv4di2;
else
unpack = gen_avx2_sign_extendv4siv4di2;
halfmode = V4SImode;
extract
= high_p ? gen_vec_extract_hi_v8si : gen_vec_extract_lo_v8si;
break;
case V16QImode: case V16QImode:
if (unsigned_p) if (unsigned_p)
unpack = gen_sse4_1_zero_extendv8qiv8hi2; unpack = gen_sse4_1_zero_extendv8qiv8hi2;
...@@ -19708,7 +19737,12 @@ ix86_expand_sse_unpack (rtx operands[2], bool unsigned_p, bool high_p) ...@@ -19708,7 +19737,12 @@ ix86_expand_sse_unpack (rtx operands[2], bool unsigned_p, bool high_p)
gcc_unreachable (); gcc_unreachable ();
} }
if (high_p) if (GET_MODE_SIZE (imode) == 32)
{
tmp = gen_reg_rtx (halfmode);
emit_insn (extract (tmp, operands[1]));
}
else if (high_p)
{ {
/* Shift higher 8 bytes to lower 8 bytes. */ /* Shift higher 8 bytes to lower 8 bytes. */
tmp = gen_reg_rtx (imode); tmp = gen_reg_rtx (imode);
...@@ -7536,25 +7536,25 @@ ...@@ -7536,25 +7536,25 @@
(define_expand "vec_unpacks_lo_<mode>" (define_expand "vec_unpacks_lo_<mode>"
[(match_operand:<sseunpackmode> 0 "register_operand" "") [(match_operand:<sseunpackmode> 0 "register_operand" "")
(match_operand:VI124_128 1 "register_operand" "")] (match_operand:VI124_AVX2 1 "register_operand" "")]
"TARGET_SSE2" "TARGET_SSE2"
"ix86_expand_sse_unpack (operands, false, false); DONE;") "ix86_expand_sse_unpack (operands, false, false); DONE;")
(define_expand "vec_unpacks_hi_<mode>" (define_expand "vec_unpacks_hi_<mode>"
[(match_operand:<sseunpackmode> 0 "register_operand" "") [(match_operand:<sseunpackmode> 0 "register_operand" "")
(match_operand:VI124_128 1 "register_operand" "")] (match_operand:VI124_AVX2 1 "register_operand" "")]
"TARGET_SSE2" "TARGET_SSE2"
"ix86_expand_sse_unpack (operands, false, true); DONE;") "ix86_expand_sse_unpack (operands, false, true); DONE;")
(define_expand "vec_unpacku_lo_<mode>" (define_expand "vec_unpacku_lo_<mode>"
[(match_operand:<sseunpackmode> 0 "register_operand" "") [(match_operand:<sseunpackmode> 0 "register_operand" "")
(match_operand:VI124_128 1 "register_operand" "")] (match_operand:VI124_AVX2 1 "register_operand" "")]
"TARGET_SSE2" "TARGET_SSE2"
"ix86_expand_sse_unpack (operands, true, false); DONE;") "ix86_expand_sse_unpack (operands, true, false); DONE;")
(define_expand "vec_unpacku_hi_<mode>" (define_expand "vec_unpacku_hi_<mode>"
[(match_operand:<sseunpackmode> 0 "register_operand" "") [(match_operand:<sseunpackmode> 0 "register_operand" "")
(match_operand:VI124_128 1 "register_operand" "")] (match_operand:VI124_AVX2 1 "register_operand" "")]
"TARGET_SSE2" "TARGET_SSE2"
"ix86_expand_sse_unpack (operands, true, true); DONE;") "ix86_expand_sse_unpack (operands, true, true); DONE;")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment