Skip to content

Don't use s0 in Risc-V zcmp test compile#3076

Merged
will-v-pi merged 1 commit into
developfrom
fix-riscv-arch
Jul 16, 2026
Merged

Don't use s0 in Risc-V zcmp test compile#3076
will-v-pi merged 1 commit into
developfrom
fix-riscv-arch

Conversation

@will-v-pi

Copy link
Copy Markdown
Contributor

This file currently fails to compile with any compilers, resulting in pico_riscv_gcc always falling through to the non-zcmp arch string

The fix is to change the registers used to s1 and s2 instead

This file currently fails to compile with any compilers, resulting in `pico_riscv_gcc` always falling through to the non-zcmp arch string

The fix is to change the registers used to `s1` and `s2` instead
@will-v-pi will-v-pi added this to the 2.3.1 milestone Jul 15, 2026
@will-v-pi
will-v-pi requested a review from Wren6991 July 15, 2026 16:05
@kilograham

Copy link
Copy Markdown
Contributor

ha; i was just making the same fix - but with said compiler i still didn't get any cm.push/pop etc.

@Wren6991

Copy link
Copy Markdown
Contributor

but with said compiler i still didn't get any cm.push/pop etc.

I think the Zcmp codegen itself has regressed in GCC. It looks like prolog/epilog scheduling can cause the push/pop pattern matching to fail (with no performance benefit from the scheduling). You should still get them, but they're rarer than they should be.

Do you still get cm.mva01s and cm.mvsa01?

@lurch

lurch commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Is this also the fix for #3073 or is that a similar-but-different problem?

@will-v-pi

Copy link
Copy Markdown
Contributor Author

Is this also the fix for #3073 or is that a similar-but-different problem?

Yes, that is this exact problem

@shtirlic

shtirlic commented Jul 15, 2026

Copy link
Copy Markdown

When I build with Release variant there are only 75 cm.mva01s instructions, but with MinSizeRel i got around ~600 cm. instructions.

@will-v-pi

Copy link
Copy Markdown
Contributor Author

The Multi GCC run (https://github.com/raspberrypi/pico-sdk/actions/runs/29430965108/job/87405548355) has passed the RISC-V GCC 14.1.0 builds, so I think that means this is tested now and can be merged

@will-v-pi
will-v-pi merged commit dcaf9c4 into develop Jul 16, 2026
13 of 14 checks passed
@will-v-pi
will-v-pi deleted the fix-riscv-arch branch July 16, 2026 14:55
@lurch

lurch commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Is it "expected" for the CI to fail on the Pico W builds for GCC 6 and GCC 7? https://github.com/raspberrypi/pico-sdk/actions/runs/29430965108/job/87405548355

@will-v-pi

Copy link
Copy Markdown
Contributor Author

Is it "expected" for the CI to fail on the Pico W builds for GCC 6 and GCC 7? https://github.com/raspberrypi/pico-sdk/actions/runs/29430965108/job/87405548355

Yes, I think that's fixed in some way in multi-gcc-develop branch - ping @liamfraser

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.

5 participants