1 //====- X86InstrMMX.td - Describe the X86 Instruction Set -------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by the Evan Cheng and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file describes the X86 MMX instruction set, defining the instructions,
11 // and properties of the instructions which are needed for code generation,
12 // machine code emission, and analysis.
14 //===----------------------------------------------------------------------===//
16 // Instruction templates
17 // MMXi8 - MMX instructions with ImmT == Imm8 and TB prefix.
18 class MMXIi8<bits<8> o, Format F, dag ops, string asm, list<dag> pattern>
19 : X86Inst<o, F, Imm8, ops, asm>, TB, Requires<[HasMMX]> {
20 let Pattern = pattern;
23 // Some 'special' instructions
24 def IMPLICIT_DEF_VR64 : I<0, Pseudo, (ops VR64:$dst),
26 [(set VR64:$dst, (v8i8 (undef)))]>,
29 def : Pat<(v4i16 (undef)), (IMPLICIT_DEF_VR64)>, Requires<[HasMMX]>;
30 def : Pat<(v2i32 (undef)), (IMPLICIT_DEF_VR64)>, Requires<[HasMMX]>;
33 def MOVD64rr : I<0x6E, MRMSrcReg, (ops VR64:$dst, R32:$src),
34 "movd {$src, $dst|$dst, $src}", []>, TB,
36 def MOVD64rm : I<0x6E, MRMSrcMem, (ops VR64:$dst, i32mem:$src),
37 "movd {$src, $dst|$dst, $src}", []>, TB,
39 def MOVD64mr : I<0x7E, MRMDestMem, (ops i32mem:$dst, VR64:$src),
40 "movd {$src, $dst|$dst, $src}", []>, TB,
43 def MOVQ64rr : I<0x6F, MRMSrcReg, (ops VR64:$dst, VR64:$src),
44 "movq {$src, $dst|$dst, $src}", []>, TB,
46 def MOVQ64rm : I<0x6F, MRMSrcMem, (ops VR64:$dst, i64mem:$src),
47 "movq {$src, $dst|$dst, $src}", []>, TB,
49 def MOVQ64mr : I<0x7F, MRMDestMem, (ops i64mem:$dst, VR64:$src),
50 "movq {$src, $dst|$dst, $src}", []>, TB,
53 // Conversion instructions
54 def CVTTPS2PIrr: I<0x2C, MRMSrcReg, (ops VR64:$dst, VR128:$src),
55 "cvttps2pi {$src, $dst|$dst, $src}", []>, TB,
57 def CVTTPS2PIrm: I<0x2C, MRMSrcMem, (ops VR64:$dst, f64mem:$src),
58 "cvttps2pi {$src, $dst|$dst, $src}", []>, TB,
61 // Shuffle and unpack instructions
62 def PSHUFWri : MMXIi8<0x70, MRMSrcReg,
63 (ops VR64:$dst, VR64:$src1, i8imm:$src2),
64 "pshufw {$src2, $src1, $dst|$dst, $src1, $src2}", []>;
65 def PSHUFWmi : MMXIi8<0x70, MRMSrcMem,
66 (ops VR64:$dst, i64mem:$src1, i8imm:$src2),
67 "pshufw {$src2, $src1, $dst|$dst, $src1, $src2}", []>;
70 def MOVNTQ : I<0xE7, MRMDestMem, (ops i64mem:$dst, VR64:$src),
71 "movntq {$src, $dst|$dst, $src}", []>, TB,
74 def MASKMOVQ : I<0xF7, MRMDestMem, (ops VR64:$src, VR64:$mask),
75 "maskmovq {$mask, $src|$src, $mask}", []>, TB,