From 5f67d2a265eb2ef8706d5ff131188d78c898ddc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?= Date: Wed, 31 May 2023 19:48:35 +0200 Subject: [PATCH] xtensa/memcpy.S: Fix invalid asm code "srli a11, a8, 30" is invalid, srli shifts by 0 to 15 bits. Some assemblers (e.g. gas 2.40) automatically translate a srli statement with > 15 bit shift to an extui statement, some others (clang 16 with espressif patches) don't. Using extui works with both. Closes https://github.com/espressif/newlib-esp32/issues/11 --- newlib/libc/machine/xtensa/memcpy.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/newlib/libc/machine/xtensa/memcpy.S b/newlib/libc/machine/xtensa/memcpy.S index 849e8091de..88f8f7e8a0 100644 --- a/newlib/libc/machine/xtensa/memcpy.S +++ b/newlib/libc/machine/xtensa/memcpy.S @@ -258,7 +258,7 @@ memcpy: unaligned src. */ ssa8 a3 // set shift amount from byte offset #if UNALIGNED_ADDRESSES_CHECKED - srli a11, a8, 30 // save unalignment offset for below + extui a11, a8, 30, 2 // save unalignment offset for below sub a3, a3, a11 // align a3 #endif l32i a6, a3, 0 // load first word