Skip to content

Commit 8e1d87c

Browse files
committed
[RISCV] Fix registers class for esp32p4 HW loop instructions
1 parent 8728786 commit 8e1d87c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

llvm/lib/Target/RISCV/RISCVInstrInfoP4HWLP.td

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def ESP_LP_SETUPI: Esp32P4Inst<(outs), (ins uimm1:$id, uimm12:$count, uimm10_ste
4141
let Inst{0} = 1;
4242
}
4343

44-
def ESP_LP_SETUP: Esp32P4Inst<(outs), (ins uimm1:$id, GPRPIE:$rs1, uimm13_step4:$offset),
44+
def ESP_LP_SETUP: Esp32P4Inst<(outs), (ins uimm1:$id, GPR:$rs1, uimm13_step4:$offset),
4545
"esp.lp.setup\t $id, $rs1, $offset", []>
4646
{
4747
bits<1> id;
@@ -145,7 +145,7 @@ def ESP_LP_COUNTI: Esp32P4Inst<(outs), (ins uimm1:$id, uimm12:$count),
145145
let Inst{0} = 1;
146146
}
147147

148-
def ESP_LP_COUNT: Esp32P4Inst<(outs), (ins uimm1:$id, GPRPIE:$rs1),
148+
def ESP_LP_COUNT: Esp32P4Inst<(outs), (ins uimm1:$id, GPR:$rs1),
149149
"esp.lp.count\t $id, $rs1", []>
150150
{
151151
bits<1> id;
@@ -156,7 +156,7 @@ def ESP_LP_COUNT: Esp32P4Inst<(outs), (ins uimm1:$id, GPRPIE:$rs1),
156156
let hasSideEffects = 1;
157157

158158
let Inst{31-20} = 0xb000000000000;
159-
let Inst{19-15} = 0xb00000;
159+
let Inst{19-15} = rs1{4-0};
160160
let Inst{14} = 0;
161161
let Inst{13} = 1;
162162
let Inst{12} = 0;

llvm/test/MC/RISCV/esp32p4-hwlp-valid.s

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dl_hwlp_test:
99
esp.lp.counti 0, 4000
1010
# CHECK: esp.lp.counti 0, 4000 # encoding: [0x2b,0x30,0x00,0xfa]
1111
esp.lp.count 0, a1
12-
# CHECK: esp.lp.count 0, a1 # encoding: [0x2b,0x20,0x00,0x00]
12+
# CHECK: esp.lp.count 0, a1 # encoding: [0x2b,0xa0,0x05,0x00]
1313
esp.lp.setupi 0, 1234, loop_last_instruction
1414
# CHECK: esp.lp.setupi 0, 1234, loop_last_instruction # encoding: [0x2b'A',0x50'A',0x20'A',0x4d'A']
1515
# lp.setup 0, a1, loop_last_instruction

0 commit comments

Comments
 (0)