Hi Tristan,
Thank you, my part to help the project along and have others benefit.
For reference I included part of what MountStudio generated within the
makefile:

# Tool invocations
GLANN_033-251222x.elf: $(OBJS) $(USER_OBJS_ESCAPE)
    @   riscv-none-embed-gcc -march=rv32imacxw -mabi=ilp32
-msmall-data-limit=8 -msave-restore -fmax-errors=20 -Os -fmessage-length=0
-fsigned-char -ffunction-sections -fdata-sections -fno-common -Wunused
-Wuninitialized -g -T "h:/MRS_DATA/workspace/GLANN_033-251205x/Ld/Link.ld"
-nostartfiles -Xlinker --gc-sections -Wl,-Map,"GLANN_033-251222x.map"
--specs=nano.specs --specs=nosys.specs -o "GLANN_033-251222x.elf" $(OBJS) $(
LIBS)
GLANN_033-251222x.hex: GLANN_033-251222x.elf
    @   riscv-none-embed-objcopy -O ihex "GLANN_033-251222x.elf"
"GLANN_033-251222x.hex"
GLANN_033-251222x.lst: GLANN_033-251222x.elf

what the ITC looks like (in the assembly listing):

00000a1e <DO_NEXT>:
     a1e: 00082883           lw a7,0(a6)
     a22: 0811                 addi a6,a6,4

00000a24 <DO_EXECUTE>:
     a24: 0008a503           lw a0,0(a7)
     a28: 0891                 addi a7,a7,4
     a2a: 00050067           jr a0 # fffe1000 <Flag_invisible+0xfffe1001>
     a2e: 5555                 li a0,-11

Regards,
John S

On Thu, Jan 8, 2026 at 6:15 PM <[email protected]> wrote:

> Hi John,
>
> The existing svn RISC-V repo is an assembly only build, assembled
> without compressed instructions using -march=rv32im As a result the
> default option for rvc (using compressed instructions) is off. Provided
> there isn't an .option rvc in the repo codebase (which there isn't),
> then compressed instructions will not be used [1]. This means that,
> built only from the source and the Makefile in the repo, the dictionary
> will be word aligned as required. However, as it stands, this *is*
> fragile and liable to break if compressed instructions find their way
> into the dictionary. Your patch makes the repo RISC-V AmForth more
> robust, important if external files are going to be introduced. It also
> saves some flash memory if rvc and relax are on. Very much appreciated
> and currently #2 in my commit queue!
>
> Best wishes,
> Tristan
>
> [1] Small test of rvc/relax default options
>
> riscv-none-embed-as -march=rv32im -ahl test.S -o output.o
> riscv-none-embed-ld output.o -o test.elf
>
> ---test.S---
>      add a5, a5, 1  # will not be compressed
> .option rvc
>      add a5, a5, 1  # will be compressed
> ----EOF----
>
> riscv-none-embed-objdump -d -M no-aliases test.elf
>
> 00010054 <__BSS_END__-0x1008>:
>     10054:      00178793                addi    a5,a5,1
>     10058:      0785                    c.addi  a5,1
>
>

_______________________________________________
Amforth-devel mailing list for http://amforth.sf.net/
[email protected]
https://lists.sourceforge.net/lists/listinfo/amforth-devel

Reply via email to