[llvm-bugs] [Bug 47955] New: arm_neon.h should include arm_fp16.h

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Oct 23 11:41:34 PDT 2020


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

            Bug ID: 47955
           Summary: arm_neon.h should include arm_fp16.h
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Headers
          Assignee: unassignedclangbugs at nondot.org
          Reporter: david.tellenbach at arm.com
                CC: craig.topper at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

Hi,

the Arm ACLE
(https://developer.arm.com/documentation/101028/0012/3--C-language-extensions)
states that

"<arm_fp16.h> is provided to define the scalar 16-bit floating point arithmetic
intrinsics. As these intrinsics are in the user namespace, an implementation
would not normally define them until the header is included. The
__ARM_FEATURE_FP16_SCALAR_ARITHMETIC feature macro should be tested before
including the header:

#ifdef __ARM_FEATURE_FP16_SCALAR_ARITHMETIC
#include <arm_fp16.h>
#endif /* __ARM_FEATURE_FP16_SCALAR_ARITHMETIC */

Including <arm_neon.h> will also cause <arm_fp16.h> to be included if
appropriate."

Currently our arm_neon.h doesn't include arm_fp16.h. This causes e.g. the
following to fail:

#include <arm_neon.h>

int main() {
#if defined(__ARM_FEATURE_FP16_SCALAR_ARITHMETIC)
  __fp16 a = 2;
  __fp16 b = 3;
  __fp16 c = vaddh_f16(a, b);
#endif
}

with 

error: use of undeclared identifier 'vaddh_f16'

  __fp16 c = vaddh_f16(a, b);

-- 
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/20201023/6596b25f/attachment.html>


More information about the llvm-bugs mailing list