From f12ac1c2c178714d65b09aed16c5c2b9f20f5ee3 Mon Sep 17 00:00:00 2001 From: CMD <80255379+iCMDdev@users.noreply.github.com> Date: Wed, 11 Sep 2024 18:08:15 +0300 Subject: [PATCH] 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. --- src/rp2350/pico_platform/include/pico/platform.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rp2350/pico_platform/include/pico/platform.h b/src/rp2350/pico_platform/include/pico/platform.h index a5ef5d6d..bfc4fabe 100644 --- a/src/rp2350/pico_platform/include/pico/platform.h +++ b/src/rp2350/pico_platform/include/pico/platform.h @@ -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