[LLVMbugs] [Bug 1631] New: llvm-gcc --fast-math option emits powf() for simple multiplies for x86

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Thu Aug 30 22:01:17 PDT 2007


http://llvm.org/bugs/show_bug.cgi?id=1631

           Summary: llvm-gcc --fast-math option emits powf() for simple
                    multiplies for x86
           Product: cfe
           Version: unspecified
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Keywords: quality-of-implementation
          Severity: major
          Priority: P2
         Component: LLVM Codegen
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: arobison at cs.utah.edu
                CC: llvmbugs at cs.uiuc.edu


Enabling the --fast-math option through the llvm C or C++ front end produces
code that calls powf instead of producing multiply instructions.  For low
numbers of operands the individual multiplies are faster.  For example, the
function: 

float square(float x)
{
  return x * x;
}

will produce a call to powf instead of just multiply the argument with itself
in a single instruction.

------------------

"llvm-gcc --fastmath -c file.c" produces:

calll   0x00000046      ; symbol stub for: _powf

while "llvm-gcc -c file.c" produces:

mulss   %xmm0,%xmm0


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list