Skip to content

Commit

Permalink
RISC-V inline assembly constraints fix - platform.h (#1923)
Browse files Browse the repository at this point in the history
Changed the constraint from "l" (specific to ARM) to the general "r" in inline assembly used for RISC-V architecture.

This ensures most compilers are able to compile this header file.
  • Loading branch information
iCMDdev authored Sep 11, 2024
1 parent 0f38151 commit f12ac1c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rp2350/pico_platform/include/pico/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ static inline uint8_t rp2040_rom_version(void) {
*/
__force_inline static int32_t __mul_instruction(int32_t a, int32_t b) {
#ifdef __riscv
__asm ("mul %0, %0, %1" : "+l" (a) : "l" (b) : );
__asm ("mul %0, %0, %1" : "+r" (a) : "r" (b) : );
#else
pico_default_asm ("muls %0, %1" : "+l" (a) : "l" (b) : "cc");
#endif
Expand Down

0 comments on commit f12ac1c

Please sign in to comment.