what the heck, add support for the rest of the 3dNow! binary operations.
[oota-llvm.git] / lib / Target / X86 / X86Instr3DNow.td
1 //====- X86Instr3DNow.td - The 3DNow! Instruction Set ------*- tablegen -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file describes the 3DNow! instruction set, which extends MMX to support
11 // floating point and also adds a few more random instructions for good measure.
12 //
13 //===----------------------------------------------------------------------===//
14
15 // FIXME: We don't support any intrinsics for these instructions yet.
16
17 class I3DNow<bits<8> o, Format F, dag outs, dag ins, string asm, 
18              list<dag> pattern>
19       : I<o, F, outs, ins, asm, pattern>, TB, Requires<[Has3DNow]>,
20         Has3DNow0F0FOpcode {
21   // FIXME: The disassembler doesn't support 3DNow! yet.
22   let isAsmParserOnly = 1;
23 }
24
25
26 let Constraints = "$src1 = $dst" in {
27   // MMXI_binop_rm_int - Simple MMX binary operator based on intrinsic.
28   // When this is cleaned up, remove the FIXME from X86RecognizableInstr.cpp.
29   multiclass I3DNow_binop_rm<bits<8> opc, string Mnemonic> {
30     def rr : I3DNow<opc, MRMSrcReg, (outs VR64:$dst),
31                     (ins VR64:$src1, VR64:$src2),
32                     !strconcat(Mnemonic, "\t{$src2, $dst|$dst, $src2}"), []>;
33     def rm : I3DNow<opc, MRMSrcMem, (outs VR64:$dst),
34                     (ins VR64:$src1, i64mem:$src2),
35                     !strconcat(Mnemonic, "\t{$src2, $dst|$dst, $src2}"), []>;
36   }
37 }
38
39 defm PAVGUSB  : I3DNow_binop_rm<0xBF, "pavgusb">;
40 defm PF2ID    : I3DNow_binop_rm<0x1D, "pf2id">;
41 defm PFACC    : I3DNow_binop_rm<0xAE, "pfacc">;
42 defm PFADD    : I3DNow_binop_rm<0x9E, "pfadd">;
43 defm PFCMPEQ  : I3DNow_binop_rm<0xB0, "pfcmpeq">;
44 defm PFCMPGE  : I3DNow_binop_rm<0x90, "pfcmpge">;
45 defm PFCMPGT  : I3DNow_binop_rm<0xA0, "pfcmpgt">;
46 defm PFMAX    : I3DNow_binop_rm<0xA4, "pfmax">;
47 defm PFMIN    : I3DNow_binop_rm<0x94, "pfmin">;
48 defm PFMUL    : I3DNow_binop_rm<0xB4, "pfmul">;
49 defm PFRCP    : I3DNow_binop_rm<0x96, "pfrcp">;
50 defm PFRCPIT1 : I3DNow_binop_rm<0xA6, "pfrcpit1">;
51 defm PFRCPIT2 : I3DNow_binop_rm<0xB6, "pfrcpit2">;
52 defm PFRSQIT1 : I3DNow_binop_rm<0xA7, "pfrsqit1">;
53 defm PFRSQRT  : I3DNow_binop_rm<0x97, "pfrsqrt">;
54 defm PFSUB    : I3DNow_binop_rm<0x9A, "pfsub">;
55 defm PFSUBR   : I3DNow_binop_rm<0xAA, "pfsubr">;
56 defm PI2FD    : I3DNow_binop_rm<0x0D, "pi2fd">;
57 defm PMULHRW  : I3DNow_binop_rm<0xB7, "pmulhrw">;
58
59
60
61
62 // TODO: Add support for the "3DNowA" instructions.