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:
CMD 2024-09-11 18:08:15 +03:00 committed by GitHub
parent 0f38151002
commit f12ac1c2c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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