[llvm-bugs] [Bug 43157] New: __float128 can't be passed into an inline asm block's 'x' input

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Aug 28 17:32:01 PDT 2019


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

            Bug ID: 43157
           Summary: __float128 can't be passed into an inline asm block's
                    'x' input
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: gbs at canishe.com
                CC: craig.topper at gmail.com, llvm-bugs at lists.llvm.org,
                    llvm-dev at redking.me.uk, spatel+llvm at rotateright.com

The following code (adapted from glibc) compiles under gcc but not clang:

# define math_force_eval(x)                                             \
  do {                                                                  \
    if (sizeof (x) <= sizeof (double)                                   \
        || __builtin_types_compatible_p (__typeof (x), __float128))     \
      __asm __volatile ("" : : "x" (x));                                \
    else                                                                \
      __asm __volatile ("" : : "f" (x));                                \
  } while (0)

void foo(__float128 x) {
    __float128 bar = x * 1.5;
    math_force_eval(bar); // <-- couldn't allocate input reg for constraint 'x'
}

The issue appears to be in X86TargetLowering::getRegForInlineAsmConstraint,
which has a switch statement covering many other number types and the comment
"TODO: Handle f128 and i128 in FR128RegClass after it is tested well."

-- 
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/20190829/c90e7553/attachment.html>


More information about the llvm-bugs mailing list