mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-28 22:42:52 +01:00
098fb42690
* Add support for promoting unions with fp values in them. This produces our new int<->fp bitcast instructions, implementing Transforms/ScalarRepl/union-fp-int.ll As an example, this allows us to compile this: union intfloat { int i; float f; }; float invsqrt(const float arg_x) { union intfloat x = { .f = arg_x }; const float xhalf = arg_x * 0.5f; x.i = 0x5f3759df - (x.i >> 1); return x.f * (1.5f - xhalf * x.f * x.f); } into: _invsqrt: movss 4(%esp), %xmm0 movd %xmm0, %eax sarl %eax movl $1597463007, %ecx subl %eax, %ecx movd %ecx, %xmm1 mulss LCPI1_0, %xmm0 mulss %xmm1, %xmm0 movss LCPI1_1, %xmm2 mulss %xmm1, %xmm0 subss %xmm0, %xmm2 movl 8(%esp), %eax mulss %xmm2, %xmm1 movss %xmm1, (%eax) ret instead of: _invsqrt: subl $4, %esp movss 8(%esp), %xmm0 movss %xmm0, (%esp) movl (%esp), %eax movl $1597463007, %ecx sarl %eax subl %eax, %ecx movl %ecx, (%esp) mulss LCPI1_0, %xmm0 movss (%esp), %xmm1 mulss %xmm1, %xmm0 mulss %xmm1, %xmm0 movss LCPI1_1, %xmm2 subss %xmm0, %xmm2 mulss %xmm2, %xmm1 movl 12(%esp), %eax movss %xmm1, (%eax) addl $4, %esp ret llvm-svn: 32418 |
||
---|---|---|
.. | ||
ADCE.cpp | ||
BasicBlockPlacement.cpp | ||
CondPropagate.cpp | ||
ConstantProp.cpp | ||
CorrelatedExprs.cpp | ||
DCE.cpp | ||
DeadStoreElimination.cpp | ||
GCSE.cpp | ||
IndVarSimplify.cpp | ||
InstructionCombining.cpp | ||
LICM.cpp | ||
LoopStrengthReduce.cpp | ||
LoopUnroll.cpp | ||
LoopUnswitch.cpp | ||
LowerGC.cpp | ||
LowerPacked.cpp | ||
Makefile | ||
PredicateSimplifier.cpp | ||
Reassociate.cpp | ||
Reg2Mem.cpp | ||
ScalarReplAggregates.cpp | ||
SCCP.cpp | ||
SimplifyCFG.cpp | ||
TailDuplication.cpp | ||
TailRecursionElimination.cpp |