[llvm-bugs] [Bug 43475] New: [AArch64] Inconsistent __FLT_EVAL_METHOD__ value with GCC

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Sep 26 23:56:30 PDT 2019


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

            Bug ID: 43475
           Summary: [AArch64] Inconsistent __FLT_EVAL_METHOD__ value with
                    GCC
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Driver
          Assignee: unassignedclangbugs at nondot.org
          Reporter: npickito at gmail.com
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

$ aarch64-elf-gcc -mcpu=cortex-a55 -dM -E - < /dev/null | grep
__FLT_EVAL_METHOD__
#define __FLT_EVAL_METHOD__ 16

$ clang -target aarch64-elf -mcpu=cortex-a55 -dM -E - < /dev/null | grep
__FLT_EVAL_METHOD__
#define __FLT_EVAL_METHOD__ 0


GCC will check fp16 is supported or not to decide the value of
__FLT_EVAL_METHOD__:

static enum flt_eval_method
aarch64_excess_precision (enum excess_precision_type type) 
{
  switch (type)
    {
      case EXCESS_PRECISION_TYPE_FAST:
      case EXCESS_PRECISION_TYPE_STANDARD:
        /* We can calculate either in 16-bit range and precision or
           32-bit range and precision.  Make that decision based on whether
           we have native support for the ARMv8.2-A 16-bit floating-point
           instructions or not.  */
        return (TARGET_FP_F16INST
                ? FLT_EVAL_METHOD_PROMOTE_TO_FLOAT16
                : FLT_EVAL_METHOD_PROMOTE_TO_FLOAT);
      case EXCESS_PRECISION_TYPE_IMPLICIT:
        return FLT_EVAL_METHOD_PROMOTE_TO_FLOAT16;
      default:
        gcc_unreachable ();
    }
  return FLT_EVAL_METHOD_UNPREDICTABLE;
}

But clang/LLVM for AArch64 seems like didn't override
TargetInfo::getFloatEvalMethod().

-- 
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/20190927/0b0d007d/attachment.html>


More information about the llvm-bugs mailing list