// LoongArchLSXInstrFormats.td - LoongArch LSX Instr Formats -*- tablegen -*-=// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===// // Describe LoongArch LSX instructions format // // opcode - operation code. // vd/rd/cd - destination register operand. // {r/v}{j/k} - source register operand. // immN - immediate data operand. // //===----------------------------------------------------------------------===// // 1RI13-type // class Fmt1RI13_VI op, dag outs, dag ins, string opnstr, list pattern = []> : LAInst.ret, opnstr, pattern> { bits<13> imm13; bits<5> vd; let Inst{31-0} = op; let Inst{17-5} = imm13; let Inst{4-0} = vd; } // 2R-type // class Fmt2R_VV op, dag outs, dag ins, string opnstr, list pattern = []> : LAInst.ret, opnstr, pattern> { bits<5> vj; bits<5> vd; let Inst{31-0} = op; let Inst{9-5} = vj; let Inst{4-0} = vd; } // class Fmt2R_VR op, dag outs, dag ins, string opnstr, list pattern = []> : LAInst.ret, opnstr, pattern> { bits<5> rj; bits<5> vd; let Inst{31-0} = op; let Inst{9-5} = rj; let Inst{4-0} = vd; } // class Fmt2R_CV op, dag outs, dag ins, string opnstr, list pattern = []> : LAInst.ret, opnstr, pattern> { bits<5> vj; bits<3> cd; let Inst{31-0} = op; let Inst{9-5} = vj; let Inst{2-0} = cd; } // 2RI1-type // class Fmt2RI1_VVI op, dag outs, dag ins, string opnstr, list pattern = []> : LAInst.ret, opnstr, pattern> { bits<1> imm1; bits<5> vj; bits<5> vd; let Inst{31-0} = op; let Inst{10} = imm1; let Inst{9-5} = vj; let Inst{4-0} = vd; } // class Fmt2RI1_VRI op, dag outs, dag ins, string opnstr, list pattern = []> : LAInst.ret, opnstr, pattern> { bits<1> imm1; bits<5> rj; bits<5> vd; let Inst{31-0} = op; let Inst{10} = imm1; let Inst{9-5} = rj; let Inst{4-0} = vd; } // class Fmt2RI1_RVI op, dag outs, dag ins, string opnstr, list pattern = []> : LAInst.ret, opnstr, pattern> { bits<1> imm1; bits<5> vj; bits<5> rd; let Inst{31-0} = op; let Inst{10} = imm1; let Inst{9-5} = vj; let Inst{4-0} = rd; } // 2RI2-type // class Fmt2RI2_VVI op, dag outs, dag ins, string opnstr, list pattern = []> : LAInst.ret, opnstr, pattern> { bits<2> imm2; bits<5> vj; bits<5> vd; let Inst{31-0} = op; let Inst{11-10} = imm2; let Inst{9-5} = vj; let Inst{4-0} = vd; } // class Fmt2RI2_VRI op, dag outs, dag ins, string opnstr, list pattern = []> : LAInst.ret, opnstr, pattern> { bits<2> imm2; bits<5> rj; bits<5> vd; let Inst{31-0} = op; let Inst{11-10} = imm2; let Inst{9-5} = rj; let Inst{4-0} = vd; } // class Fmt2RI2_RVI op, dag outs, dag ins, string opnstr, list pattern = []> : LAInst.ret, opnstr, pattern> { bits<2> imm2; bits<5> vj; bits<5> rd; let Inst{31-0} = op; let Inst{11-10} = imm2; let Inst{9-5} = vj; let Inst{4-0} = rd; } // 2RI3-type // class Fmt2RI3_VVI op, dag outs, dag ins, string opnstr, list pattern = []> : LAInst.ret, opnstr, pattern> { bits<3> imm3; bits<5> vj; bits<5> vd; let Inst{31-0} = op; let Inst{12-10} = imm3; let Inst{9-5} = vj; let Inst{4-0} = vd; } // class Fmt2RI3_VRI op, dag outs, dag ins, string opnstr, list pattern = []> : LAInst.ret, opnstr, pattern> { bits<3> imm3; bits<5> rj; bits<5> vd; let Inst{31-0} = op; let Inst{12-10} = imm3; let Inst{9-5} = rj; let Inst{4-0} = vd; } // class Fmt2RI3_RVI op, dag outs, dag ins, string opnstr, list pattern = []> : LAInst.ret, opnstr, pattern> { bits<3> imm3; bits<5> vj; bits<5> rd; let Inst{31-0} = op; let Inst{12-10} = imm3; let Inst{9-5} = vj; let Inst{4-0} = rd; } // 2RI4-type // class Fmt2RI4_VVI op, dag outs, dag ins, string opnstr, list pattern = []> : LAInst.ret, opnstr, pattern> { bits<4> imm4; bits<5> vj; bits<5> vd; let Inst{31-0} = op; let Inst{13-10} = imm4; let Inst{9-5} = vj; let Inst{4-0} = vd; } // class Fmt2RI4_VRI op, dag outs, dag ins, string opnstr, list pattern = []> : LAInst.ret, opnstr, pattern> { bits<4> imm4; bits<5> rj; bits<5> vd; let Inst{31-0} = op; let Inst{13-10} = imm4; let Inst{9-5} = rj; let Inst{4-0} = vd; } // class Fmt2RI4_RVI op, dag outs, dag ins, string opnstr, list pattern = []> : LAInst.ret, opnstr, pattern> { bits<4> imm4; bits<5> vj; bits<5> rd; let Inst{31-0} = op; let Inst{13-10} = imm4; let Inst{9-5} = vj; let Inst{4-0} = rd; } // 2RI5-type // class Fmt2RI5_VVI op, dag outs, dag ins, string opnstr, list pattern = []> : LAInst.ret, opnstr, pattern> { bits<5> imm5; bits<5> vj; bits<5> vd; let Inst{31-0} = op; let Inst{14-10} = imm5; let Inst{9-5} = vj; let Inst{4-0} = vd; } // 2RI6-type // class Fmt2RI6_VVI op, dag outs, dag ins, string opnstr, list pattern = []> : LAInst.ret, opnstr, pattern> { bits<6> imm6; bits<5> vj; bits<5> vd; let Inst{31-0} = op; let Inst{15-10} = imm6; let Inst{9-5} = vj; let Inst{4-0} = vd; } // 2RI7-type // class Fmt2RI7_VVI op, dag outs, dag ins, string opnstr, list pattern = []> : LAInst.ret, opnstr, pattern> { bits<7> imm7; bits<5> vj; bits<5> vd; let Inst{31-0} = op; let Inst{16-10} = imm7; let Inst{9-5} = vj; let Inst{4-0} = vd; } // 2RI8-type // class Fmt2RI8_VVI op, dag outs, dag ins, string opnstr, list pattern = []> : LAInst.ret, opnstr, pattern> { bits<8> imm8; bits<5> vj; bits<5> vd; let Inst{31-0} = op; let Inst{17-10} = imm8; let Inst{9-5} = vj; let Inst{4-0} = vd; } // 2RI8I1-type // class Fmt2RI8I1_VRII op, dag outs, dag ins, string opnstr, list pattern = []> : LAInst.ret, opnstr, pattern> { bits<1> imm1; bits<8> imm8; bits<5> rj; bits<5> vd; let Inst{31-0} = op; let Inst{18} = imm1; let Inst{17-10} = imm8; let Inst{9-5} = rj; let Inst{4-0} = vd; } // 2RI8I2-type // class Fmt2RI8I2_VRII op, dag outs, dag ins, string opnstr, list pattern = []> : LAInst.ret, opnstr, pattern> { bits<2> imm2; bits<8> imm8; bits<5> rj; bits<5> vd; let Inst{31-0} = op; let Inst{19-18} = imm2; let Inst{17-10} = imm8; let Inst{9-5} = rj; let Inst{4-0} = vd; } // 2RI8I3-type // class Fmt2RI8I3_VRII op, dag outs, dag ins, string opnstr, list pattern = []> : LAInst.ret, opnstr, pattern> { bits<3> imm3; bits<8> imm8; bits<5> rj; bits<5> vd; let Inst{31-0} = op; let Inst{20-18} = imm3; let Inst{17-10} = imm8; let Inst{9-5} = rj; let Inst{4-0} = vd; } // 2RI8I4-type // class Fmt2RI8I4_VRII op, dag outs, dag ins, string opnstr, list pattern = []> : LAInst.ret, opnstr, pattern> { bits<4> imm4; bits<8> imm8; bits<5> rj; bits<5> vd; let Inst{31-0} = op; let Inst{21-18} = imm4; let Inst{17-10} = imm8; let Inst{9-5} = rj; let Inst{4-0} = vd; } // 2RI9-type // class Fmt2RI9_VRI op, dag outs, dag ins, string opnstr, list pattern = []> : LAInst.ret, opnstr, pattern> { bits<9> imm9; bits<5> rj; bits<5> vd; let Inst{31-0} = op; let Inst{18-10} = imm9; let Inst{9-5} = rj; let Inst{4-0} = vd; } // 2RI10-type // class Fmt2RI10_VRI op, dag outs, dag ins, string opnstr, list pattern = []> : LAInst.ret, opnstr, pattern> { bits<10> imm10; bits<5> rj; bits<5> vd; let Inst{31-0} = op; let Inst{19-10} = imm10; let Inst{9-5} = rj; let Inst{4-0} = vd; } // 2RI11-type // class Fmt2RI11_VRI op, dag outs, dag ins, string opnstr, list pattern = []> : LAInst.ret, opnstr, pattern> { bits<11> imm11; bits<5> rj; bits<5> vd; let Inst{31-0} = op; let Inst{20-10} = imm11; let Inst{9-5} = rj; let Inst{4-0} = vd; } // 2RI12-type // class Fmt2RI12_VRI op, dag outs, dag ins, string opnstr, list pattern = []> : LAInst.ret, opnstr, pattern> { bits<12> imm12; bits<5> rj; bits<5> vd; let Inst{31-0} = op; let Inst{21-10} = imm12; let Inst{9-5} = rj; let Inst{4-0} = vd; } // 3R-type // class Fmt3R_VVV op, dag outs, dag ins, string opnstr, list pattern = []> : LAInst.ret, opnstr, pattern> { bits<5> vk; bits<5> vj; bits<5> vd; let Inst{31-0} = op; let Inst{14-10} = vk; let Inst{9-5} = vj; let Inst{4-0} = vd; } // class Fmt3R_VVR op, dag outs, dag ins, string opnstr, list pattern = []> : LAInst.ret, opnstr, pattern> { bits<5> rk; bits<5> vj; bits<5> vd; let Inst{31-0} = op; let Inst{14-10} = rk; let Inst{9-5} = vj; let Inst{4-0} = vd; } // class Fmt3R_VRR op, dag outs, dag ins, string opnstr, list pattern = []> : LAInst.ret, opnstr, pattern> { bits<5> rk; bits<5> rj; bits<5> vd; let Inst{31-0} = op; let Inst{14-10} = rk; let Inst{9-5} = rj; let Inst{4-0} = vd; } // 4R-type // class Fmt4R_VVVV op, dag outs, dag ins, string opnstr, list pattern = []> : LAInst.ret, opnstr, pattern> { bits<5> va; bits<5> vk; bits<5> vj; bits<5> vd; let Inst{31-0} = op; let Inst{19-15} = va; let Inst{14-10} = vk; let Inst{9-5} = vj; let Inst{4-0} = vd; }