Skip to content

Commit 6d8e02c

Browse files
committed
fix use of treg field in i_move instruction to match binutils-esp32 output in all cases
This fix makes compat tests pass for: https://github.com/duff2013/ulptool/blob/master/src/ulp_examples/ulp_rtc_gpio/rtcio.s
1 parent 58001ee commit 6d8e02c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Diff for: esp32_ulp/opcodes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ def i_move(reg_dest, reg_imm_src):
484484
if src.type == REG:
485485
_alu_reg.dreg = dest
486486
_alu_reg.sreg = src.value
487-
_alu_reg.treg = 1 # XXX undocumented, this is the value binutils-esp32 uses
487+
_alu_reg.treg = src.value # XXX undocumented, this is the value binutils-esp32 uses
488488
_alu_reg.unused = 0
489489
_alu_reg.sel = ALU_SEL_MOV
490490
_alu_reg.sub_opcode = SUB_OPCODE_ALU_REG

Diff for: tests/02_compat_rtc_tests.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ for src_file in ulptool/src/ulp_examples/*/*.s binutils-esp32ulp/gas/testsuite/g
6666
test_name="${src_name##*/}"
6767

6868
# for now, skip files that contain known bugs in esp32_ulp (essentially a todo list of what to fix)
69-
for I in rtcio esp32ulp_all esp32ulp_globals esp32ulp_jumpr esp32ulp_ranges test_reg; do
69+
for I in esp32ulp_all esp32ulp_globals esp32ulp_jumpr esp32ulp_ranges test_reg; do
7070
if [ "${test_name}" = "$I" ]; then
7171
# these are old bugs, and not related to the RTC macro handling functionality
7272
# they will still be great to fix over time

0 commit comments

Comments
 (0)