Implement support for the bizarre 3DNow! encoding (which is unlike anything
[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
41
42
43
44 // TODO: Add support for the rest of the 3DNow! and "3DNowA" instructions.