]> granicus.if.org Git - clang/commit
[AArch64] Add workaround for Cortex-A53 erratum (835769)
authorBradley Smith <bradley.smith@arm.com>
Mon, 13 Oct 2014 10:16:06 +0000 (10:16 +0000)
committerBradley Smith <bradley.smith@arm.com>
Mon, 13 Oct 2014 10:16:06 +0000 (10:16 +0000)
commit8af1acab3e5f2e87a3e20c6af3694bdfff361f94
tree5f60eb329c73897e013e2a1bf7f0ba2f8255614f
parent7bb329290a455ad38df2ebcf903206d084348e8f
[AArch64] Add workaround for Cortex-A53 erratum (835769)

Some early revisions of the Cortex-A53 have an erratum (835769) whereby it is
possible for a 64-bit multiply-accumulate instruction in AArch64 state to
generate an incorrect result.  The details are quite complex and hard to
determine statically, since branches in the code may exist in some
circumstances, but all cases end with a memory (load, store, or prefetch)
instruction followed immediately by the multiply-accumulate operation.

The safest work-around for this issue is to make the compiler avoid emitting
multiply-accumulate instructions immediately after memory instructions and the
simplest way to do this is to insert a NOP.

This patch implements clang options to enable this workaround in the backend.

The work-around code generation is not enabled by default.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219604 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Driver/Options.td
lib/Driver/Tools.cpp
test/Driver/aarch64-fix-cortex-a53-835769-cg.c [new file with mode: 0644]
test/Driver/aarch64-fix-cortex-a53-835769.c [new file with mode: 0644]