The diff is the instruction strb store param var1 to 1(16-15) byte or 4(16-12) bytes which the type of var1 is int8_t. So, I think the code generated by aarch64_le is more reasonable than aarch64_be.
I want to know how to fix it, or which part of code impact this behavior.
Hi, I found in the clang trunk still generate 15 even set the option -fno-global-isel. I wonder whether have some new changes impact this, and is which commit?
But in the source code, the aarch64 not impl the function enableBigEndian, so the enableBigEndian default return false. Is somewhere else code impact this behavior?
clang-15: warning: -fglobal-isel support for the 'aarch64_be' architecture is incomplete [-Wglobal-isel]
foo.c:28:1: remark: unable to translate in big endian mode [-Rpass-missed=gisel-irtranslator]
{
^
warning: Instruction selection used fallback path for foo [-Wbackend-plugin]
1 warning generated.
New progress:in clang aarch64_be trunk the instruction strb store param var1 to 1(16-15) byte, and in clang aarch64_be 15.0.0 is 4(16-12) bytes.
I guess have a commit fixed this problem, but I don’t know which. Maybe I can learn some thing from it.
Because so far all of GlobalISel’s supported architectures have been little-endian, and so there are likely places where GlobalISel accidentally assumes the architecture is little-endian rather than checking and doing something different for big-endian.