Skip to content

Commit

Permalink
[RISCV] Fix registers class for esp32p4 HW loop instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
gerekon committed Aug 29, 2024
1 parent 8728786 commit 8e1d87c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions llvm/lib/Target/RISCV/RISCVInstrInfoP4HWLP.td
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def ESP_LP_SETUPI: Esp32P4Inst<(outs), (ins uimm1:$id, uimm12:$count, uimm10_ste
let Inst{0} = 1;
}

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

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

let Inst{31-20} = 0xb000000000000;
let Inst{19-15} = 0xb00000;
let Inst{19-15} = rs1{4-0};
let Inst{14} = 0;
let Inst{13} = 1;
let Inst{12} = 0;
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/MC/RISCV/esp32p4-hwlp-valid.s
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dl_hwlp_test:
esp.lp.counti 0, 4000
# CHECK: esp.lp.counti 0, 4000 # encoding: [0x2b,0x30,0x00,0xfa]
esp.lp.count 0, a1
# CHECK: esp.lp.count 0, a1 # encoding: [0x2b,0x20,0x00,0x00]
# CHECK: esp.lp.count 0, a1 # encoding: [0x2b,0xa0,0x05,0x00]
esp.lp.setupi 0, 1234, loop_last_instruction
# CHECK: esp.lp.setupi 0, 1234, loop_last_instruction # encoding: [0x2b'A',0x50'A',0x20'A',0x4d'A']
# lp.setup 0, a1, loop_last_instruction
Expand Down

0 comments on commit 8e1d87c

Please sign in to comment.