From 824858ebb06fe0f6afbd2337b7d06fe6a3747381 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 24 May 2010 20:51:08 +0000 Subject: [PATCH] Fix an mmx movd encoding. llvm-svn: 104552 --- lib/Target/X86/X86InstrMMX.td | 8 +++---- test/MC/AsmParser/X86/x86_64-encoding.s | 32 +++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/lib/Target/X86/X86InstrMMX.td b/lib/Target/X86/X86InstrMMX.td index 103f60c2226..0952fc8d7dc 100644 --- a/lib/Target/X86/X86InstrMMX.td +++ b/lib/Target/X86/X86InstrMMX.td @@ -130,10 +130,10 @@ let neverHasSideEffects = 1 in def MMX_MOVD64from64rr : MMXRI<0x7E, MRMDestReg, (outs GR64:$dst), (ins VR64:$src), "movd\t{$src, $dst|$dst, $src}", []>; -def MMX_MOVD64rrv164 : MMXI<0x6E, MRMSrcReg, (outs VR64:$dst), (ins GR64:$src), - "movd\t{$src, $dst|$dst, $src}", - [(set VR64:$dst, - (v1i64 (scalar_to_vector GR64:$src)))]>; +def MMX_MOVD64rrv164 : MMXRI<0x6E, MRMSrcReg, (outs VR64:$dst), (ins GR64:$src), + "movd\t{$src, $dst|$dst, $src}", + [(set VR64:$dst, + (v1i64 (scalar_to_vector GR64:$src)))]>; let neverHasSideEffects = 1 in def MMX_MOVQ64rr : MMXI<0x6F, MRMSrcReg, (outs VR64:$dst), (ins VR64:$src), diff --git a/test/MC/AsmParser/X86/x86_64-encoding.s b/test/MC/AsmParser/X86/x86_64-encoding.s index 3920c5b5f22..036f7d49da0 100644 --- a/test/MC/AsmParser/X86/x86_64-encoding.s +++ b/test/MC/AsmParser/X86/x86_64-encoding.s @@ -71,3 +71,35 @@ // CHECK: crc32q 4(%rbx), %rax // CHECK: encoding: [0xf2,0x48,0x0f,0x38,0xf1,0x43,0x04] crc32q 4(%rbx), %rax + +// CHECK: movd %r8, %mm1 +// CHECK: encoding: [0x49,0x0f,0x6e,0xc8] +movd %r8, %mm1 + +// CHECK: movd %r8d, %mm1 +// CHECK: encoding: [0x41,0x0f,0x6e,0xc8] +movd %r8d, %mm1 + +// CHECK: movd %rdx, %mm1 +// CHECK: encoding: [0x48,0x0f,0x6e,0xca] +movd %rdx, %mm1 + +// CHECK: movd %edx, %mm1 +// CHECK: encoding: [0x0f,0x6e,0xca] +movd %edx, %mm1 + +// CHECK: movd %mm1, %r8 +// CHECK: encoding: [0x49,0x0f,0x7e,0xc8] +movd %mm1, %r8 + +// CHECK: movd %mm1, %r8d +// CHECK: encoding: [0x41,0x0f,0x7e,0xc8] +movd %mm1, %r8d + +// CHECK: movd %mm1, %rdx +// CHECK: encoding: [0x48,0x0f,0x7e,0xca] +movd %mm1, %rdx + +// CHECK: movd %mm1, %edx +// CHECK: encoding: [0x0f,0x7e,0xca] +movd %mm1, %edx