Commit 73371f6a by H.J. Lu Committed by H.J. Lu

i386: Emulate MMX mmx_pmovmskb with SSE

Emulate MMX mmx_pmovmskb with SSE by zero-extending result of SSE pmovmskb
from QImode to SImode.  Only SSE register source operand is allowed.

	PR target/89021
	* config/i386/mmx.md (mmx_pmovmskb): Changed to
	define_insn_and_split to support SSE emulation.

From-SVN: r271232
parent 18184fdd
2019-05-15 H.J. Lu <hongjiu.lu@intel.com> 2019-05-15 H.J. Lu <hongjiu.lu@intel.com>
PR target/89021 PR target/89021
* config/i386/mmx.md (mmx_pmovmskb): Changed to
define_insn_and_split to support SSE emulation.
2019-05-15 H.J. Lu <hongjiu.lu@intel.com>
PR target/89021
* config/i386/mmx.md (mmx_<code>v4hi3): Also check TARGET_MMX * config/i386/mmx.md (mmx_<code>v4hi3): Also check TARGET_MMX
and TARGET_MMX_WITH_SSE. and TARGET_MMX_WITH_SSE.
(mmx_<code>v8qi3): Likewise. (mmx_<code>v8qi3): Likewise.
......
...@@ -1788,14 +1788,30 @@ ...@@ -1788,14 +1788,30 @@
[(set_attr "type" "mmxshft") [(set_attr "type" "mmxshft")
(set_attr "mode" "DI")]) (set_attr "mode" "DI")])
(define_insn "mmx_pmovmskb" (define_insn_and_split "mmx_pmovmskb"
[(set (match_operand:SI 0 "register_operand" "=r") [(set (match_operand:SI 0 "register_operand" "=r,r")
(unspec:SI [(match_operand:V8QI 1 "register_operand" "y")] (unspec:SI [(match_operand:V8QI 1 "register_operand" "y,x")]
UNSPEC_MOVMSK))] UNSPEC_MOVMSK))]
"TARGET_SSE || TARGET_3DNOW_A" "(TARGET_MMX || TARGET_MMX_WITH_SSE)
"pmovmskb\t{%1, %0|%0, %1}" && (TARGET_SSE || TARGET_3DNOW_A)"
[(set_attr "type" "mmxcvt") "@
(set_attr "mode" "DI")]) pmovmskb\t{%1, %0|%0, %1}
#"
"TARGET_MMX_WITH_SSE && reload_completed"
[(set (match_dup 0)
(unspec:SI [(match_dup 1)] UNSPEC_MOVMSK))
(set (match_dup 0)
(zero_extend:SI (match_dup 2)))]
{
/* Generate SSE pmovmskb and zero-extend from QImode to SImode. */
operands[1] = lowpart_subreg (V16QImode, operands[1],
GET_MODE (operands[1]));
operands[2] = lowpart_subreg (QImode, operands[0],
GET_MODE (operands[0]));
}
[(set_attr "mmx_isa" "native,x64")
(set_attr "type" "mmxcvt,ssemov")
(set_attr "mode" "DI,TI")])
(define_expand "mmx_maskmovq" (define_expand "mmx_maskmovq"
[(set (match_operand:V8QI 0 "memory_operand") [(set (match_operand:V8QI 0 "memory_operand")
......
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