1 //===- MipsDSPInstrInfo.td - DSP ASE instructions -*- tablegen ------------*-=//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file describes Mips DSP ASE instructions.
12 //===----------------------------------------------------------------------===//
15 def immZExt2 : ImmLeaf<i32, [{return isUInt<2>(Imm);}]>;
16 def immZExt3 : ImmLeaf<i32, [{return isUInt<3>(Imm);}]>;
17 def immZExt4 : ImmLeaf<i32, [{return isUInt<4>(Imm);}]>;
18 def immZExt8 : ImmLeaf<i32, [{return isUInt<8>(Imm);}]>;
19 def immZExt10 : ImmLeaf<i32, [{return isUInt<10>(Imm);}]>;
20 def immSExt6 : ImmLeaf<i32, [{return isInt<6>(Imm);}]>;
23 class DSPPat<dag pattern, dag result, Predicate pred = HasDSP> :
24 Pat<pattern, result>, Requires<[pred]>;
26 def : DSPPat<(v2i16 (load addr:$a)),
27 (v2i16 (COPY_TO_REGCLASS (LW addr:$a), DSPRegs))>;
28 def : DSPPat<(v4i8 (load addr:$a)),
29 (v4i8 (COPY_TO_REGCLASS (LW addr:$a), DSPRegs))>;
30 def : DSPPat<(store (v2i16 DSPRegs:$val), addr:$a),
31 (SW (COPY_TO_REGCLASS DSPRegs:$val, CPURegs), addr:$a)>;
32 def : DSPPat<(store (v4i8 DSPRegs:$val), addr:$a),
33 (SW (COPY_TO_REGCLASS DSPRegs:$val, CPURegs), addr:$a)>;