blob: 556cf6bc50003f20ff326ce4707c073b37574cbe [file] [log] [blame]
Akira Hatanakaecfb8282012-09-22 00:07:12 +00001//===- MipsDSPInstrInfo.td - DSP ASE instructions -*- 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 Mips DSP ASE instructions.
11//
12//===----------------------------------------------------------------------===//
13
14// ImmLeaf
15def immZExt2 : ImmLeaf<i32, [{return isUInt<2>(Imm);}]>;
16def immZExt3 : ImmLeaf<i32, [{return isUInt<3>(Imm);}]>;
17def immZExt4 : ImmLeaf<i32, [{return isUInt<4>(Imm);}]>;
18def immZExt8 : ImmLeaf<i32, [{return isUInt<8>(Imm);}]>;
19def immZExt10 : ImmLeaf<i32, [{return isUInt<10>(Imm);}]>;
20def immSExt6 : ImmLeaf<i32, [{return isInt<6>(Imm);}]>;
Akira Hatanaka5eeac4f2012-09-27 01:50:59 +000021
22// Patterns.
23class DSPPat<dag pattern, dag result, Predicate pred = HasDSP> :
24 Pat<pattern, result>, Requires<[pred]>;
25
26def : DSPPat<(v2i16 (load addr:$a)),
27 (v2i16 (COPY_TO_REGCLASS (LW addr:$a), DSPRegs))>;
28def : DSPPat<(v4i8 (load addr:$a)),
29 (v4i8 (COPY_TO_REGCLASS (LW addr:$a), DSPRegs))>;
30def : DSPPat<(store (v2i16 DSPRegs:$val), addr:$a),
31 (SW (COPY_TO_REGCLASS DSPRegs:$val, CPURegs), addr:$a)>;
32def : DSPPat<(store (v4i8 DSPRegs:$val), addr:$a),
33 (SW (COPY_TO_REGCLASS DSPRegs:$val, CPURegs), addr:$a)>;