Skip to content

Commit

Permalink
[X86] Add isel pattern to match VZEXT_MOVL and a v2i64 scalar_to_vect…
Browse files Browse the repository at this point in the history
…or bitcasted from x86mmx to MOVQ2DQ.

We already had the pattern for just the scalar to vector and bitcast,
but not the case where we wanted zeroes in the high half of the xmm.

llvm-svn: 368972
  • Loading branch information
topperc committed Aug 15, 2019
1 parent e640960 commit 1e246b2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 4 additions & 0 deletions llvm/lib/Target/X86/X86InstrMMX.td
Expand Up @@ -577,6 +577,10 @@ def : Pat<(x86mmx (MMX_X86movdq2q VR128:$src)),
def : Pat<(x86mmx (MMX_X86movdq2q (v2i64 (nonvolatile_load addr:$src)))),
(x86mmx (MMX_MOVQ64rm addr:$src))>;

def : Pat<(v2i64 (X86vzmovl (scalar_to_vector
(i64 (bitconvert (x86mmx VR64:$src)))))),
(MMX_MOVQ2DQrr VR64:$src)>;

// Misc.
let SchedRW = [SchedWriteShuffle.MMX] in {
let Uses = [EDI], Predicates = [HasMMX, HasSSE1,Not64BitMode] in
Expand Down
3 changes: 1 addition & 2 deletions llvm/test/CodeGen/X86/mmx-cvt.ll
Expand Up @@ -346,8 +346,7 @@ define <4 x float> @cvt_v2i32_v2f32(<1 x i64>*) nounwind {
; X64: # %bb.0:
; X64-NEXT: movq (%rdi), %mm0
; X64-NEXT: paddd %mm0, %mm0
; X64-NEXT: movq %mm0, %rax
; X64-NEXT: movq %rax, %xmm0
; X64-NEXT: movq2dq %mm0, %xmm0
; X64-NEXT: cvtdq2ps %xmm0, %xmm0
; X64-NEXT: retq
%2 = bitcast <1 x i64>* %0 to x86_mmx*
Expand Down

0 comments on commit 1e246b2

Please sign in to comment.