I am compiling some binaries for ARMv8 and ARMv7 devices and I want to disable the branch predicate . I know this question was asked once ( here ), but the target was an x86 machine. I use linaro gcc for the hand.
I do this for the sake of experiment, and I do not recommend it as a practice.
I used perf to measure branch / branch instructions.
I have 2 questions:
I tried the following options:
Can I be sure that using -fno-if-conversion and -fno-guess-branch-probabilities completely disables branch prediction?
After doing more research and testing, I have my answer.
ARMv7 ISA . , , . -fno-if-conversion -fno-if-conversion2. , , .
-fno-if-conversion -fno-if-conversion2
ARMv8. AArch64 ISA , . . -fno-if-conversion ( perf). , .
-fno-if-conversion