vyoma-systems / zilsd

0 stars 0 forks source link

Clang compile issue for branch instructions #5

Closed kumaransvyoma closed 2 weeks ago

kumaransvyoma commented 2 months ago

Branch instruction compiles inversely

compiled as

" 80000120: fffff437 lui s0,0xfffff 80000124: fff40413 add s0,s0,-1 # ffffefff <immx+0x452f152f> 80000128: 00020237 lui tp,0x20 8000012c: 00440663 beq s0,tp,80000138 80000130: 00441463 bne s0,tp,80000138 80000134: 0040006f j 80000138 "

## To reproduce the issue

to compile

clang -march=rv32i -static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles -T ./env/link.ld -I ./env -mabi=ilp32 ./beq.S -o dut.elf -DTEST_CASE_1=True -DXLEN=32

to see disassembly file

riscv32-unknown-elf-objdump -d dut.elf > dut.disass

lavanyajagan commented 2 weeks ago

fixed with version 18 release