<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - arm_neon.h should include arm_fp16.h"
   href="https://bugs.llvm.org/show_bug.cgi?id=47955">47955</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>arm_neon.h should include arm_fp16.h
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Headers
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>david.tellenbach@arm.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>craig.topper@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Hi,

the Arm ACLE
(<a href="https://developer.arm.com/documentation/101028/0012/3--C-language-extensions">https://developer.arm.com/documentation/101028/0012/3--C-language-extensions</a>)
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);</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>