mirror of
https://github.com/raspberrypi/pico-sdk.git
synced 2025-12-10 07:14:36 +01:00
RISC-V inline assembly constraints fix - platform.h (#1923)
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.
This commit is contained in:
parent
0f38151002
commit
f12ac1c2c1
1 changed files with 1 additions and 1 deletions
|
|
@ -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) {
|
__force_inline static int32_t __mul_instruction(int32_t a, int32_t b) {
|
||||||
#ifdef __riscv
|
#ifdef __riscv
|
||||||
__asm ("mul %0, %0, %1" : "+l" (a) : "l" (b) : );
|
__asm ("mul %0, %0, %1" : "+r" (a) : "r" (b) : );
|
||||||
#else
|
#else
|
||||||
pico_default_asm ("muls %0, %1" : "+l" (a) : "l" (b) : "cc");
|
pico_default_asm ("muls %0, %1" : "+l" (a) : "l" (b) : "cc");
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue