From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Graf Date: Fri, 1 Dec 2017 22:46:29 +0100 Subject: [U-Boot] [PATCH] arm: arm64: only use general regs In-Reply-To: <20171128020937.27906-1-peng.fan@nxp.com> References: <20171128020937.27906-1-peng.fan@nxp.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 28.11.17 03:09, Peng Fan wrote: > When compiling with android toolchain, there is an instruction > "str q0, [x8],#16", but x8 is not 16bytes aligned, > this instruction will trigger sync abort. > > So, following Linux kernel, only use general regs for arm64. > If not, compiler may use simd registers Q[x]. We need to avoid > using simd registers in U-Boot, because load/store Q[x] has > restriction that 128bits aligned when str/ldr. > > Signed-off-by: Peng Fan The compiler should only output 16-byte-alignemnt-requiring instructions when it can safely assume that the variable in question is 16 byte aligned. Where did x8 come from? That was probably just an unsafe cast? For reference, I ran into something similar recently on 32bit ARM: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82445 And this indeed turned out to be a compiler bug. FWIW the main reason Linux doesn't want to use FPU registers in kernel space is simply that it doesn't want to bother saving/restoring them on syscalls or interrupts. But I don't quite see why we would care in U-Boot. Alex