Lines Matching +full:0 +full:x1c0

3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
25 operator Rd() { return Rd{rd + (shift ? 8 : 0)}; } in Rd()
26 operator Rs() { return Rs{rd + (shift ? 8 : 0)}; } in Rs()
35 return RxC{(inst & 0x7C) >> 2, false}; in DecodeCR_RS2()
38 constexpr RxC DecodeCIW_RD(uint32_t inst) { return RxC{(inst & 0x1C) >> 2}; } in DecodeCIW_RD()
40 constexpr RxC DecodeCA_RD(uint32_t inst) { return RxC{(inst & 0x380) >> 7}; } in DecodeCA_RD()
54 uint16_t offset = ((inst << 4) & 0xc0) // offset[7:6] in DecodeC_LWSP()
55 | ((inst >> 7) & 0x20) // offset[5] in DecodeC_LWSP()
56 | ((inst >> 2) & 0x1c); // offset[4:2] in DecodeC_LWSP()
57 if (rd == 0) in DecodeC_LWSP()
64 uint16_t offset = ((inst << 4) & 0x1c0) // offset[8:6] in DecodeC_LDSP()
65 | ((inst >> 7) & 0x20) // offset[5] in DecodeC_LDSP()
66 | ((inst >> 2) & 0x18); // offset[4:3] in DecodeC_LDSP()
67 if (rd == 0) in DecodeC_LDSP()
73 uint16_t offset = ((inst >> 1) & 0xc0) // offset[7:6] in DecodeC_SWSP()
74 | ((inst >> 7) & 0x3c); // offset[5:2] in DecodeC_SWSP()
79 uint16_t offset = ((inst >> 1) & 0x1c0) // offset[8:6] in DecodeC_SDSP()
80 | ((inst >> 7) & 0x38); // offset[5:3] in DecodeC_SDSP()
85 uint16_t offset = ((inst << 1) & 0x40) // imm[6] in DecodeC_LW()
86 | ((inst >> 7) & 0x38) // imm[5:3] in DecodeC_LW()
87 | ((inst >> 4) & 0x4); // imm[2] in DecodeC_LW()
92 uint16_t offset = ((inst << 1) & 0xc0) // imm[7:6] in DecodeC_LD()
93 | ((inst >> 7) & 0x38); // imm[5:3] in DecodeC_LD()
98 uint16_t offset = ((inst << 1) & 0x40) // imm[6] in DecodeC_SW()
99 | ((inst >> 7) & 0x38) // imm[5:3] in DecodeC_SW()
100 | ((inst >> 4) & 0x4); // imm[2] in DecodeC_SW()
105 uint16_t offset = ((inst << 1) & 0xc0) // imm[7:6] in DecodeC_SD()
106 | ((inst >> 7) & 0x38); // imm[5:3] in DecodeC_SD()
111 uint16_t offset = ((inst >> 1) & 0x800) // offset[11] in DecodeC_J()
112 | ((inst << 2) & 0x400) // offset[10] in DecodeC_J()
113 | ((inst >> 1) & 0x300) // offset[9:8] in DecodeC_J()
114 | ((inst << 1) & 0x80) // offset[7] in DecodeC_J()
115 | ((inst >> 1) & 0x40) // offset[6] in DecodeC_J()
116 | ((inst << 3) & 0x20) // offset[5] in DecodeC_J()
117 | ((inst >> 7) & 0x10) // offset[4] in DecodeC_J()
118 | ((inst >> 2) & 0xe); // offset[3:1] in DecodeC_J()
119 if ((offset & 0x800) == 0) in DecodeC_J()
120 return JAL{Rd{0}, uint32_t(offset)}; in DecodeC_J()
121 return JAL{Rd{0}, uint32_t(int32_t(int16_t(offset | 0xf000)))}; in DecodeC_J()
126 if (rs1 == 0) in DecodeC_JR()
128 return JALR{Rd{0}, rs1, 0}; in DecodeC_JR()
133 if (rs1 == 0) in DecodeC_JALR()
135 return JALR{Rd{1}, rs1, 0}; in DecodeC_JALR()
139 return ((inst >> 4) & 0x100) // offset[8] in BOffset()
140 | ((inst << 1) & 0xc0) // offset[7:6] in BOffset()
141 | ((inst << 3) & 0x20) // offset[5] in BOffset()
142 | ((inst >> 7) & 0x18) // offset[4:3] in BOffset()
143 | ((inst >> 2) & 0x6); // offset[2:1] in BOffset()
149 if ((offset & 0x100) == 0) in DecodeC_BNEZ()
150 return B{rs1, Rs{0}, uint32_t(offset), 0b001}; in DecodeC_BNEZ()
151 return B{rs1, Rs{0}, uint32_t(int32_t(int16_t(offset | 0xfe00))), 0b001}; in DecodeC_BNEZ()
157 if ((offset & 0x100) == 0) in DecodeC_BEQZ()
158 return B{rs1, Rs{0}, uint32_t(offset), 0b000}; in DecodeC_BEQZ()
159 return B{rs1, Rs{0}, uint32_t(int32_t(int16_t(offset | 0xfe00))), 0b000}; in DecodeC_BEQZ()
164 uint16_t imm = ((inst >> 7) & 0x20) | ((inst >> 2) & 0x1f); in DecodeC_LI()
165 if ((imm & 0x20) == 0) in DecodeC_LI()
166 return ADDI{rd, Rs{0}, uint32_t(imm)}; in DecodeC_LI()
167 return ADDI{rd, Rs{0}, uint32_t(int32_t(int8_t(imm | 0xc0)))}; in DecodeC_LI()
172 if (rd == 0) in DecodeC_LUI_ADDI16SP()
175 uint16_t nzimm = ((inst >> 3) & 0x200) // nzimm[9] in DecodeC_LUI_ADDI16SP()
176 | ((inst >> 2) & 0x10) // nzimm[4] in DecodeC_LUI_ADDI16SP()
177 | ((inst << 1) & 0x40) // nzimm[6] in DecodeC_LUI_ADDI16SP()
178 | ((inst << 4) & 0x180) // nzimm[8:7] in DecodeC_LUI_ADDI16SP()
179 | ((inst << 3) & 0x20); // nzimm[5] in DecodeC_LUI_ADDI16SP()
180 if (nzimm == 0) in DecodeC_LUI_ADDI16SP()
182 if ((nzimm & 0x200) == 0) in DecodeC_LUI_ADDI16SP()
185 uint32_t(int32_t(int16_t(nzimm | 0xfc00)))}; in DecodeC_LUI_ADDI16SP()
188 ((uint32_t(inst) << 5) & 0x20000) | ((uint32_t(inst) << 10) & 0x1f000); in DecodeC_LUI_ADDI16SP()
189 if ((imm & 0x20000) == 0) in DecodeC_LUI_ADDI16SP()
191 return LUI{rd, uint32_t(int32_t(imm | 0xfffc0000))}; in DecodeC_LUI_ADDI16SP()
196 if (rd == 0) in DecodeC_ADDI()
198 uint16_t imm = ((inst >> 7) & 0x20) | ((inst >> 2) & 0x1f); in DecodeC_ADDI()
199 if ((imm & 0x20) == 0) in DecodeC_ADDI()
201 return ADDI{rd, rd, uint32_t(int32_t(int8_t(imm | 0xc0)))}; in DecodeC_ADDI()
206 if (rd == 0) in DecodeC_ADDIW()
208 uint16_t imm = ((inst >> 7) & 0x20) | ((inst >> 2) & 0x1f); in DecodeC_ADDIW()
209 if ((imm & 0x20) == 0) in DecodeC_ADDIW()
211 return ADDIW{rd, rd, uint32_t(int32_t(int8_t(imm | 0xc0)))}; in DecodeC_ADDIW()
216 uint16_t nzuimm = ((inst >> 1) & 0x3c0) // nzuimm[9:6] in DecodeC_ADDI4SPN()
217 | ((inst >> 7) & 0x30) // nzuimm[5:4] in DecodeC_ADDI4SPN()
218 | ((inst >> 2) & 0x8) // nzuimm[3] in DecodeC_ADDI4SPN()
219 | ((inst >> 4) & 0x4); // nzuimm[2] in DecodeC_ADDI4SPN()
221 if (rd == 0 && nzuimm == 0) in DecodeC_ADDI4SPN()
223 if (nzuimm == 0) in DecodeC_ADDI4SPN()
230 uint16_t shamt = ((inst >> 7) & 0x20) | ((inst >> 2) & 0x1f); in DecodeC_SLLI()
231 if (rd == 0 || shamt == 0) in DecodeC_SLLI()
238 uint16_t shamt = ((inst >> 7) & 0x20) | ((inst >> 2) & 0x1f); in DecodeC_SRLI()
239 if (shamt == 0) in DecodeC_SRLI()
246 uint16_t shamt = ((inst >> 7) & 0x20) | ((inst >> 2) & 0x1f); in DecodeC_SRAI()
247 if (shamt == 0) in DecodeC_SRAI()
254 uint16_t imm = ((inst >> 7) & 0x20) | ((inst >> 2) & 0x1f); in DecodeC_ANDI()
255 if ((imm & 0x20) == 0) in DecodeC_ANDI()
257 return ANDI{rd, rd, uint32_t(int32_t(int8_t(imm | 0xc0)))}; in DecodeC_ANDI()
263 if (rd == 0) in DecodeC_MV()
265 return ADD{rd, Rs{0}, rs2}; in DecodeC_MV()
303 uint16_t offset = ((inst << 1) & 0x40) // imm[6] in DecodeC_FLW()
304 | ((inst >> 7) & 0x38) // imm[5:3] in DecodeC_FLW()
305 | ((inst >> 4) & 0x4); // imm[2] in DecodeC_FLW()
310 uint16_t offset = ((inst << 1) & 0x40) // imm[6] in DecodeC_FSW()
311 | ((inst >> 7) & 0x38) // imm[5:3] in DecodeC_FSW()
312 | ((inst >> 4) & 0x4); // imm[2] in DecodeC_FSW()
318 uint16_t offset = ((inst << 4) & 0xc0) // offset[7:6] in DecodeC_FLWSP()
319 | ((inst >> 7) & 0x20) // offset[5] in DecodeC_FLWSP()
320 | ((inst >> 2) & 0x1c); // offset[4:2] in DecodeC_FLWSP()
325 uint16_t offset = ((inst >> 1) & 0xc0) // offset[7:6] in DecodeC_FSWSP()
326 | ((inst >> 7) & 0x3c); // offset[5:2] in DecodeC_FSWSP()
332 uint16_t offset = ((inst << 4) & 0x1c0) // offset[8:6] in DecodeC_FLDSP()
333 | ((inst >> 7) & 0x20) // offset[5] in DecodeC_FLDSP()
334 | ((inst >> 2) & 0x18); // offset[4:3] in DecodeC_FLDSP()
339 uint16_t offset = ((inst >> 1) & 0x1c0) // offset[8:6] in DecodeC_FSDSP()
340 | ((inst >> 7) & 0x38); // offset[5:3] in DecodeC_FSDSP()
345 uint16_t offset = ((inst << 1) & 0xc0) // imm[7:6] in DecodeC_FLD()
346 | ((inst >> 7) & 0x38); // imm[5:3] in DecodeC_FLD()
351 uint16_t offset = ((inst << 1) & 0xc0) // imm[7:6] in DecodeC_FSD()
352 | ((inst >> 7) & 0x38); // imm[5:3] in DecodeC_FSD()