[LLVMbugs] [Bug 6214] New: scalar absolute value of single precision floating point values
bugzilla-daemon at cs.uiuc.edu
bugzilla-daemon at cs.uiuc.edu
Tue Feb 2 14:14:50 PST 2010
http://llvm.org/bugs/show_bug.cgi?id=6214
Summary: scalar absolute value of single precision floating point
values
Product: libraries
Version: 2.6
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Backend: X86
AssignedTo: unassignedbugs at nondot.org
ReportedBy: llvm at henning-thielemann.de
CC: llvmbugs at cs.uiuc.edu
I noticed that LLVM uses SSE registers also for scalar floating point
operations.
Thus when I want to compute the absolute value,
it would be certainly most efficient to implement it using 'andss' or 'andsd'
with an appropriate mask to clear the sign bit.
(Similarly LLVM's X86 backend implements negation using 'xorss'.)
However, when I cast a single precision floating point value to a 32 bit
integer and clear the sign bit in this representation,
then the X86 code generator moves the floating point value to a general purpose
register, clears the sign bit there and moves the floating point value back to
an XMM register for subsequent operations.
The only way to stay in XMM registers is to cast the whole vector to a 32 bit
integer vector and apply an 128 bit mask that clears bit 31.
This would be certainly inefficient, if the floating point number was in an FPU
register before. (But so far I have never seen LLVM using FPU registers. I have
only seen XMM usage and calls to math lib for sin, cos, exp.)
--
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