https://bugs.llvm.org/show_bug.cgi?id=42576

            Bug ID: 42576
           Summary: aarch64: -march=armv8-a produces armv8.2 'bfc'
                    instruction
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C
          Assignee: unassignedclangb...@nondot.org
          Reporter: a...@linaro.org
                CC: blitzrak...@gmail.com, dgre...@apple.com,
                    erik.pilking...@gmail.com, llvm-bugs@lists.llvm.org,
                    richard-l...@metafoo.co.uk

Building arm64 linux randconfig kernels, I came across this assembler error:

/tmp/sdma_v4_0-f95fd3.s: Assembler messages:
/tmp/sdma_v4_0-f95fd3.s:44: Error: selected processor does not support `bfc
w0,#1,#5'

I reduced the test case to

int a, b, c;
int __order_base_2() { return a > 1 ? __builtin_constant_p(a) ?: b : 0; }
int sdma_v4_0_rb_cntl(int p1) {
  int d = c ?: __order_base_2();
  p1 = (p1 & ~0x0000003EL) | (62 & (d << 1));
  return p1;
}
$ clang-8  --prefix=/home/arnd/cross/x86_64/gcc-8.1.0-nolibc/aarch64-linux/bin/
-no-integrated-as -O2 sdma_v4_0.i --target=aarch64-linux -S -o-
-march=armv8.1-a

https://godbolt.org/z/8Gcjl9 shows the 'bfc' instruction being generated, but
not the error message as it is unable to call the external assembler correctly.

According to https://sourceware.org/ml/binutils/2015-11/msg00221.html, the
'bfc' instruction is only valid in armv8.2 or higher but llvm uses it for any
armv8 version.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to