Skip to content

riscv: add new rv32emc configurations #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

masz-nordic
Copy link

Namely:

  • rv32emc_zicsr
  • rv32emc_zicsr_zba_zbb_zbc_zbs
  • rv32emc_zicsr_zicntr_zba_zbb_zbc_zbs
  • rv32emc_zicsr_zicntr_zba_zbb_zbc_zbs_zcb

@carlescufi carlescufi requested a review from stephanosio April 4, 2024 22:52
Copy link
Member

@stephanosio stephanosio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please open a PR to sdk-ng that pulls and tests this change.

Also it would be good to update the commit title to say something like "add rv32emc configurations without Zifencei" since there already exist rv32emc configurations.

Comment on lines 79 to 82
march=rv32emc_zicsr/mabi=ilp32e \
march=rv32emc_zicsr_zba_zbb_zbc_zbs/mabi=ilp32e \
march=rv32emc_zicsr_zicntr_zba_zbb_zbc_zbs/mabi=ilp32e \
march=rv32emc_zicsr_zicntr_zba_zbb_zbc_zbs_zcb/mabi=ilp32e \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you are adding rv32emc multi-lib variants without Zifencei (i.e. support for IFENCE.I) -- is this intentional?

I am asking because IFENCE.I used to be part of the mandatory base instruction set, and generally speaking, it is hard to imagine a processor implementation without one.

Note that there already exist rv32emc_zicsr_zifencei variants if you are targeting processors with Zifencei support.

Copy link
Author

@masz-nordic masz-nordic Apr 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, adding variants without Zifencei is the main purpose of this PR.

I'm also adding variants with zcb and zicntr as those extensions were not used in Zephyr SDK yet, so calling this change "add rv32emc configurations without Zifencei" would not convey full scope here, that's why I picked such generic commit title.
Those variants are not supported yet in GCC version used in SDK. I'll change commit title.

@masz-nordic
Copy link
Author

sdk-ng PR: zephyrproject-rtos/sdk-ng#744

@masz-nordic masz-nordic force-pushed the riscv_rv32 branch 3 times, most recently from 0cdd758 to 36cd53a Compare April 5, 2024 15:01
Signed-off-by: Marcin Szymczyk <marcin.szymczyk@nordicsemi.no>
@stephanosio stephanosio merged commit b016c34 into zephyrproject-rtos:zephyr-gcc-12.2.0 Apr 6, 2024
nashif pushed a commit that referenced this pull request May 31, 2025
Update test case for armv8.1-m.main that supports conditional
arithmetic.

armv7-m:
        push    {r4, lr}
        ldr     r4, .L6
        ldr     r4, [r4]
        lsls    r4, r4, #29
        it      mi
        addmi   r2, r2, #1
        bl      bar
        movs    r0, #0
        pop     {r4, pc}

armv8.1-m.main:
        push    {r3, r4, r5, lr}
        ldr     r4, .L5
        ldr     r5, [r4]
        tst     r5, #4
        csinc   r2, r2, r2, eq
        bl      bar
        movs    r0, #0
        pop     {r3, r4, r5, pc}

gcc/testsuite/ChangeLog:

	* gcc.target/arm/epilog-1.c: Use check-function-bodies.

Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
(cherry picked from commit ec86e87)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants