[llvm-bugs] [Bug 42576] New: aarch64: -march=armv8-a produces armv8.2 'bfc' instruction

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jul 11 01:41:59 PDT 2019


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: unassignedclangbugs at nondot.org
          Reporter: arnd at linaro.org
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190711/7d8c29ea/attachment.html>


More information about the llvm-bugs mailing list