1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

Split the Add, Sub, and Mul instruction opcodes into separate

integer and floating-point opcodes, introducing
FAdd, FSub, and FMul.

For now, the AsmParser, BitcodeReader, and IRBuilder all preserve
backwards compatability, and the Core LLVM APIs preserve backwards
compatibility for IR producers. Most front-ends won't need to change
immediately.

This implements the first step of the plan outlined here:
http://nondot.org/sabre/LLVMNotes/IntegerOverflow.txt

llvm-svn: 72897
This commit is contained in:
Dan Gohman 2009-06-04 22:49:04 +00:00
parent 9757e4f9f3
commit 5f6f8101d5
265 changed files with 2374 additions and 1924 deletions

View File

@ -89,8 +89,11 @@
<li><a href="#binaryops">Binary Operations</a> <li><a href="#binaryops">Binary Operations</a>
<ol> <ol>
<li><a href="#i_add">'<tt>add</tt>' Instruction</a></li> <li><a href="#i_add">'<tt>add</tt>' Instruction</a></li>
<li><a href="#i_fadd">'<tt>fadd</tt>' Instruction</a></li>
<li><a href="#i_sub">'<tt>sub</tt>' Instruction</a></li> <li><a href="#i_sub">'<tt>sub</tt>' Instruction</a></li>
<li><a href="#i_fsub">'<tt>fsub</tt>' Instruction</a></li>
<li><a href="#i_mul">'<tt>mul</tt>' Instruction</a></li> <li><a href="#i_mul">'<tt>mul</tt>' Instruction</a></li>
<li><a href="#i_fmul">'<tt>fmul</tt>' Instruction</a></li>
<li><a href="#i_udiv">'<tt>udiv</tt>' Instruction</a></li> <li><a href="#i_udiv">'<tt>udiv</tt>' Instruction</a></li>
<li><a href="#i_sdiv">'<tt>sdiv</tt>' Instruction</a></li> <li><a href="#i_sdiv">'<tt>sdiv</tt>' Instruction</a></li>
<li><a href="#i_fdiv">'<tt>fdiv</tt>' Instruction</a></li> <li><a href="#i_fdiv">'<tt>fdiv</tt>' Instruction</a></li>
@ -2503,16 +2506,15 @@ The result value has the same type as its operands.</p>
<h5>Arguments:</h5> <h5>Arguments:</h5>
<p>The two arguments to the '<tt>add</tt>' instruction must be <a <p>The two arguments to the '<tt>add</tt>' instruction must be <a
href="#t_integer">integer</a>, <a href="#t_floating">floating point</a>, or href="#t_integer">integer</a> or
<a href="#t_vector">vector</a> values. Both arguments must have identical <a href="#t_vector">vector</a> of integer values. Both arguments must
types.</p> have identical types.</p>
<h5>Semantics:</h5> <h5>Semantics:</h5>
<p>The value produced is the integer or floating point sum of the two <p>The value produced is the integer sum of the two operands.</p>
operands.</p>
<p>If an integer sum has unsigned overflow, the result returned is the <p>If the sum has unsigned overflow, the result returned is the
mathematical result modulo 2<sup>n</sup>, where n is the bit width of mathematical result modulo 2<sup>n</sup>, where n is the bit width of
the result.</p> the result.</p>
@ -2526,6 +2528,39 @@ instruction is appropriate for both signed and unsigned integers.</p>
</pre> </pre>
</div> </div>
<!-- _______________________________________________________________________ --> <!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">
<a name="i_fadd">'<tt>fadd</tt>' Instruction</a>
</div>
<div class="doc_text">
<h5>Syntax:</h5>
<pre>
&lt;result&gt; = fadd &lt;ty&gt; &lt;op1&gt;, &lt;op2&gt; <i>; yields {ty}:result</i>
</pre>
<h5>Overview:</h5>
<p>The '<tt>fadd</tt>' instruction returns the sum of its two operands.</p>
<h5>Arguments:</h5>
<p>The two arguments to the '<tt>fadd</tt>' instruction must be
<a href="#t_floating">floating point</a> or <a href="#t_vector">vector</a> of
floating point values. Both arguments must have identical types.</p>
<h5>Semantics:</h5>
<p>The value produced is the floating point sum of the two operands.</p>
<h5>Example:</h5>
<pre>
&lt;result&gt; = fadd float 4.0, %var <i>; yields {float}:result = 4.0 + %var</i>
</pre>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection"> <div class="doc_subsubsection">
<a name="i_sub">'<tt>sub</tt>' Instruction</a> <a name="i_sub">'<tt>sub</tt>' Instruction</a>
</div> </div>
@ -2550,16 +2585,14 @@ representations.</p>
<h5>Arguments:</h5> <h5>Arguments:</h5>
<p>The two arguments to the '<tt>sub</tt>' instruction must be <a <p>The two arguments to the '<tt>sub</tt>' instruction must be <a
href="#t_integer">integer</a>, <a href="#t_floating">floating point</a>, href="#t_integer">integer</a> or <a href="#t_vector">vector</a> of
or <a href="#t_vector">vector</a> values. Both arguments must have identical integer values. Both arguments must have identical types.</p>
types.</p>
<h5>Semantics:</h5> <h5>Semantics:</h5>
<p>The value produced is the integer or floating point difference of <p>The value produced is the integer difference of the two operands.</p>
the two operands.</p>
<p>If an integer difference has unsigned overflow, the result returned is the <p>If the difference has unsigned overflow, the result returned is the
mathematical result modulo 2<sup>n</sup>, where n is the bit width of mathematical result modulo 2<sup>n</sup>, where n is the bit width of
the result.</p> the result.</p>
@ -2573,6 +2606,45 @@ instruction is appropriate for both signed and unsigned integers.</p>
</pre> </pre>
</div> </div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">
<a name="i_fsub">'<tt>fsub</tt>' Instruction</a>
</div>
<div class="doc_text">
<h5>Syntax:</h5>
<pre>
&lt;result&gt; = fsub &lt;ty&gt; &lt;op1&gt;, &lt;op2&gt; <i>; yields {ty}:result</i>
</pre>
<h5>Overview:</h5>
<p>The '<tt>fsub</tt>' instruction returns the difference of its two
operands.</p>
<p>Note that the '<tt>fsub</tt>' instruction is used to represent the
'<tt>fneg</tt>' instruction present in most other intermediate
representations.</p>
<h5>Arguments:</h5>
<p>The two arguments to the '<tt>fsub</tt>' instruction must be <a
<a href="#t_floating">floating point</a> or <a href="#t_vector">vector</a>
of floating point values. Both arguments must have identical types.</p>
<h5>Semantics:</h5>
<p>The value produced is the floating point difference of the two operands.</p>
<h5>Example:</h5>
<pre>
&lt;result&gt; = fsub float 4.0, %var <i>; yields {float}:result = 4.0 - %var</i>
&lt;result&gt; = fsub float -0.0, %val <i>; yields {float}:result = -%var</i>
</pre>
</div>
<!-- _______________________________________________________________________ --> <!-- _______________________________________________________________________ -->
<div class="doc_subsubsection"> <div class="doc_subsubsection">
<a name="i_mul">'<tt>mul</tt>' Instruction</a> <a name="i_mul">'<tt>mul</tt>' Instruction</a>
@ -2590,16 +2662,14 @@ operands.</p>
<h5>Arguments:</h5> <h5>Arguments:</h5>
<p>The two arguments to the '<tt>mul</tt>' instruction must be <a <p>The two arguments to the '<tt>mul</tt>' instruction must be <a
href="#t_integer">integer</a>, <a href="#t_floating">floating point</a>, href="#t_integer">integer</a> or <a href="#t_vector">vector</a> of integer
or <a href="#t_vector">vector</a> values. Both arguments must have identical values. Both arguments must have identical types.</p>
types.</p>
<h5>Semantics:</h5> <h5>Semantics:</h5>
<p>The value produced is the integer or floating point product of the <p>The value produced is the integer product of the two operands.</p>
two operands.</p>
<p>If the result of an integer multiplication has unsigned overflow, <p>If the result of the multiplication has unsigned overflow,
the result returned is the mathematical result modulo the result returned is the mathematical result modulo
2<sup>n</sup>, where n is the bit width of the result.</p> 2<sup>n</sup>, where n is the bit width of the result.</p>
<p>Because LLVM integers use a two's complement representation, and the <p>Because LLVM integers use a two's complement representation, and the
@ -2613,6 +2683,35 @@ width of the full product.</p>
</pre> </pre>
</div> </div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">
<a name="i_fmul">'<tt>fmul</tt>' Instruction</a>
</div>
<div class="doc_text">
<h5>Syntax:</h5>
<pre> &lt;result&gt; = fmul &lt;ty&gt; &lt;op1&gt;, &lt;op2&gt; <i>; yields {ty}:result</i>
</pre>
<h5>Overview:</h5>
<p>The '<tt>fmul</tt>' instruction returns the product of its two
operands.</p>
<h5>Arguments:</h5>
<p>The two arguments to the '<tt>fmul</tt>' instruction must be
<a href="#t_floating">floating point</a> or <a href="#t_vector">vector</a>
of floating point values. Both arguments must have identical types.</p>
<h5>Semantics:</h5>
<p>The value produced is the floating point product of the two operands.</p>
<h5>Example:</h5>
<pre> &lt;result&gt; = fmul float 4.0, %var <i>; yields {float}:result = 4.0 * %var</i>
</pre>
</div>
<!-- _______________________________________________________________________ --> <!-- _______________________________________________________________________ -->
<div class="doc_subsubsection"> <a name="i_udiv">'<tt>udiv</tt>' Instruction <div class="doc_subsubsection"> <a name="i_udiv">'<tt>udiv</tt>' Instruction
</a></div> </a></div>

View File

@ -704,10 +704,14 @@ public:
/// specify the full Instruction::OPCODE identifier. /// specify the full Instruction::OPCODE identifier.
/// ///
static Constant *getNeg(Constant *C); static Constant *getNeg(Constant *C);
static Constant *getFNeg(Constant *C);
static Constant *getNot(Constant *C); static Constant *getNot(Constant *C);
static Constant *getAdd(Constant *C1, Constant *C2); static Constant *getAdd(Constant *C1, Constant *C2);
static Constant *getFAdd(Constant *C1, Constant *C2);
static Constant *getSub(Constant *C1, Constant *C2); static Constant *getSub(Constant *C1, Constant *C2);
static Constant *getFSub(Constant *C1, Constant *C2);
static Constant *getMul(Constant *C1, Constant *C2); static Constant *getMul(Constant *C1, Constant *C2);
static Constant *getFMul(Constant *C1, Constant *C2);
static Constant *getUDiv(Constant *C1, Constant *C2); static Constant *getUDiv(Constant *C1, Constant *C2);
static Constant *getSDiv(Constant *C1, Constant *C2); static Constant *getSDiv(Constant *C1, Constant *C2);
static Constant *getFDiv(Constant *C1, Constant *C2); static Constant *getFDiv(Constant *C1, Constant *C2);

View File

@ -204,21 +204,30 @@ public:
Instruction *InsertBefore = 0); Instruction *InsertBefore = 0);
static BinaryOperator *CreateNeg(Value *Op, const std::string &Name, static BinaryOperator *CreateNeg(Value *Op, const std::string &Name,
BasicBlock *InsertAtEnd); BasicBlock *InsertAtEnd);
static BinaryOperator *CreateFNeg(Value *Op, const std::string &Name = "",
Instruction *InsertBefore = 0);
static BinaryOperator *CreateFNeg(Value *Op, const std::string &Name,
BasicBlock *InsertAtEnd);
static BinaryOperator *CreateNot(Value *Op, const std::string &Name = "", static BinaryOperator *CreateNot(Value *Op, const std::string &Name = "",
Instruction *InsertBefore = 0); Instruction *InsertBefore = 0);
static BinaryOperator *CreateNot(Value *Op, const std::string &Name, static BinaryOperator *CreateNot(Value *Op, const std::string &Name,
BasicBlock *InsertAtEnd); BasicBlock *InsertAtEnd);
/// isNeg, isNot - Check if the given Value is a NEG or NOT instruction. /// isNeg, isFNeg, isNot - Check if the given Value is a
/// NEG, FNeg, or NOT instruction.
/// ///
static bool isNeg(const Value *V); static bool isNeg(const Value *V);
static bool isFNeg(const Value *V);
static bool isNot(const Value *V); static bool isNot(const Value *V);
/// getNegArgument, getNotArgument - Helper functions to extract the /// getNegArgument, getNotArgument - Helper functions to extract the
/// unary argument of a NEG or NOT operation implemented via Sub or Xor. /// unary argument of a NEG, FNEG or NOT operation implemented via
/// Sub, FSub, or Xor.
/// ///
static const Value *getNegArgument(const Value *BinOp); static const Value *getNegArgument(const Value *BinOp);
static Value *getNegArgument( Value *BinOp); static Value *getNegArgument( Value *BinOp);
static const Value *getFNegArgument(const Value *BinOp);
static Value *getFNegArgument( Value *BinOp);
static const Value *getNotArgument(const Value *BinOp); static const Value *getNotArgument(const Value *BinOp);
static Value *getNotArgument( Value *BinOp); static Value *getNotArgument( Value *BinOp);

View File

@ -105,71 +105,74 @@ HANDLE_TERM_INST ( 6, Unreachable, UnreachableInst)
// Standard binary operators... // Standard binary operators...
FIRST_BINARY_INST( 7) FIRST_BINARY_INST( 7)
HANDLE_BINARY_INST( 7, Add , BinaryOperator) HANDLE_BINARY_INST( 7, Add , BinaryOperator)
HANDLE_BINARY_INST( 8, Sub , BinaryOperator) HANDLE_BINARY_INST( 8, FAdd , BinaryOperator)
HANDLE_BINARY_INST( 9, Mul , BinaryOperator) HANDLE_BINARY_INST( 9, Sub , BinaryOperator)
HANDLE_BINARY_INST(10, UDiv , BinaryOperator) HANDLE_BINARY_INST(10, FSub , BinaryOperator)
HANDLE_BINARY_INST(11, SDiv , BinaryOperator) HANDLE_BINARY_INST(11, Mul , BinaryOperator)
HANDLE_BINARY_INST(12, FDiv , BinaryOperator) HANDLE_BINARY_INST(12, FMul , BinaryOperator)
HANDLE_BINARY_INST(13, URem , BinaryOperator) HANDLE_BINARY_INST(13, UDiv , BinaryOperator)
HANDLE_BINARY_INST(14, SRem , BinaryOperator) HANDLE_BINARY_INST(14, SDiv , BinaryOperator)
HANDLE_BINARY_INST(15, FRem , BinaryOperator) HANDLE_BINARY_INST(15, FDiv , BinaryOperator)
HANDLE_BINARY_INST(16, URem , BinaryOperator)
HANDLE_BINARY_INST(17, SRem , BinaryOperator)
HANDLE_BINARY_INST(18, FRem , BinaryOperator)
// Logical operators (integer operands) // Logical operators (integer operands)
HANDLE_BINARY_INST(16, Shl , BinaryOperator) // Shift left (logical) HANDLE_BINARY_INST(19, Shl , BinaryOperator) // Shift left (logical)
HANDLE_BINARY_INST(17, LShr , BinaryOperator) // Shift right (logical) HANDLE_BINARY_INST(20, LShr , BinaryOperator) // Shift right (logical)
HANDLE_BINARY_INST(18, AShr , BinaryOperator) // Shift right (arithmetic) HANDLE_BINARY_INST(21, AShr , BinaryOperator) // Shift right (arithmetic)
HANDLE_BINARY_INST(19, And , BinaryOperator) HANDLE_BINARY_INST(22, And , BinaryOperator)
HANDLE_BINARY_INST(20, Or , BinaryOperator) HANDLE_BINARY_INST(23, Or , BinaryOperator)
HANDLE_BINARY_INST(21, Xor , BinaryOperator) HANDLE_BINARY_INST(24, Xor , BinaryOperator)
LAST_BINARY_INST(21) LAST_BINARY_INST(24)
// Memory operators... // Memory operators...
FIRST_MEMORY_INST(22) FIRST_MEMORY_INST(25)
HANDLE_MEMORY_INST(22, Malloc, MallocInst) // Heap management instructions HANDLE_MEMORY_INST(25, Malloc, MallocInst) // Heap management instructions
HANDLE_MEMORY_INST(23, Free , FreeInst ) HANDLE_MEMORY_INST(26, Free , FreeInst )
HANDLE_MEMORY_INST(24, Alloca, AllocaInst) // Stack management HANDLE_MEMORY_INST(27, Alloca, AllocaInst) // Stack management
HANDLE_MEMORY_INST(25, Load , LoadInst ) // Memory manipulation instrs HANDLE_MEMORY_INST(28, Load , LoadInst ) // Memory manipulation instrs
HANDLE_MEMORY_INST(26, Store , StoreInst ) HANDLE_MEMORY_INST(29, Store , StoreInst )
HANDLE_MEMORY_INST(27, GetElementPtr, GetElementPtrInst) HANDLE_MEMORY_INST(30, GetElementPtr, GetElementPtrInst)
LAST_MEMORY_INST(27) LAST_MEMORY_INST(30)
// Cast operators ... // Cast operators ...
// NOTE: The order matters here because CastInst::isEliminableCastPair // NOTE: The order matters here because CastInst::isEliminableCastPair
// NOTE: (see Instructions.cpp) encodes a table based on this ordering. // NOTE: (see Instructions.cpp) encodes a table based on this ordering.
FIRST_CAST_INST(28) FIRST_CAST_INST(31)
HANDLE_CAST_INST(28, Trunc , TruncInst ) // Truncate integers HANDLE_CAST_INST(31, Trunc , TruncInst ) // Truncate integers
HANDLE_CAST_INST(29, ZExt , ZExtInst ) // Zero extend integers HANDLE_CAST_INST(32, ZExt , ZExtInst ) // Zero extend integers
HANDLE_CAST_INST(30, SExt , SExtInst ) // Sign extend integers HANDLE_CAST_INST(33, SExt , SExtInst ) // Sign extend integers
HANDLE_CAST_INST(31, FPToUI , FPToUIInst ) // floating point -> UInt HANDLE_CAST_INST(34, FPToUI , FPToUIInst ) // floating point -> UInt
HANDLE_CAST_INST(32, FPToSI , FPToSIInst ) // floating point -> SInt HANDLE_CAST_INST(35, FPToSI , FPToSIInst ) // floating point -> SInt
HANDLE_CAST_INST(33, UIToFP , UIToFPInst ) // UInt -> floating point HANDLE_CAST_INST(36, UIToFP , UIToFPInst ) // UInt -> floating point
HANDLE_CAST_INST(34, SIToFP , SIToFPInst ) // SInt -> floating point HANDLE_CAST_INST(37, SIToFP , SIToFPInst ) // SInt -> floating point
HANDLE_CAST_INST(35, FPTrunc , FPTruncInst ) // Truncate floating point HANDLE_CAST_INST(38, FPTrunc , FPTruncInst ) // Truncate floating point
HANDLE_CAST_INST(36, FPExt , FPExtInst ) // Extend floating point HANDLE_CAST_INST(39, FPExt , FPExtInst ) // Extend floating point
HANDLE_CAST_INST(37, PtrToInt, PtrToIntInst) // Pointer -> Integer HANDLE_CAST_INST(40, PtrToInt, PtrToIntInst) // Pointer -> Integer
HANDLE_CAST_INST(38, IntToPtr, IntToPtrInst) // Integer -> Pointer HANDLE_CAST_INST(41, IntToPtr, IntToPtrInst) // Integer -> Pointer
HANDLE_CAST_INST(39, BitCast , BitCastInst ) // Type cast HANDLE_CAST_INST(42, BitCast , BitCastInst ) // Type cast
LAST_CAST_INST(39) LAST_CAST_INST(42)
// Other operators... // Other operators...
FIRST_OTHER_INST(40) FIRST_OTHER_INST(43)
HANDLE_OTHER_INST(40, ICmp , ICmpInst ) // Integer comparison instruction HANDLE_OTHER_INST(43, ICmp , ICmpInst ) // Integer comparison instruction
HANDLE_OTHER_INST(41, FCmp , FCmpInst ) // Floating point comparison instr. HANDLE_OTHER_INST(44, FCmp , FCmpInst ) // Floating point comparison instr.
HANDLE_OTHER_INST(42, PHI , PHINode ) // PHI node instruction HANDLE_OTHER_INST(45, PHI , PHINode ) // PHI node instruction
HANDLE_OTHER_INST(43, Call , CallInst ) // Call a function HANDLE_OTHER_INST(46, Call , CallInst ) // Call a function
HANDLE_OTHER_INST(44, Select , SelectInst ) // select instruction HANDLE_OTHER_INST(47, Select , SelectInst ) // select instruction
HANDLE_OTHER_INST(45, UserOp1, Instruction) // May be used internally in a pass HANDLE_OTHER_INST(48, UserOp1, Instruction) // May be used internally in a pass
HANDLE_OTHER_INST(46, UserOp2, Instruction) // Internal to passes only HANDLE_OTHER_INST(49, UserOp2, Instruction) // Internal to passes only
HANDLE_OTHER_INST(47, VAArg , VAArgInst ) // vaarg instruction HANDLE_OTHER_INST(50, VAArg , VAArgInst ) // vaarg instruction
HANDLE_OTHER_INST(48, ExtractElement, ExtractElementInst)// extract from vector HANDLE_OTHER_INST(51, ExtractElement, ExtractElementInst)// extract from vector
HANDLE_OTHER_INST(49, InsertElement, InsertElementInst) // insert into vector HANDLE_OTHER_INST(52, InsertElement, InsertElementInst) // insert into vector
HANDLE_OTHER_INST(50, ShuffleVector, ShuffleVectorInst) // shuffle two vectors. HANDLE_OTHER_INST(53, ShuffleVector, ShuffleVectorInst) // shuffle two vectors.
HANDLE_OTHER_INST(51, ExtractValue, ExtractValueInst)// extract from aggregate HANDLE_OTHER_INST(54, ExtractValue, ExtractValueInst)// extract from aggregate
HANDLE_OTHER_INST(52, InsertValue, InsertValueInst) // insert into aggregate HANDLE_OTHER_INST(55, InsertValue, InsertValueInst) // insert into aggregate
HANDLE_OTHER_INST(53, VICmp , VICmpInst ) // Vec Int comparison instruction. HANDLE_OTHER_INST(56, VICmp , VICmpInst ) // Vec Int comparison instruction.
HANDLE_OTHER_INST(54, VFCmp , VFCmpInst ) // Vec FP point comparison instr. HANDLE_OTHER_INST(57, VFCmp , VFCmpInst ) // Vec FP point comparison instr.
LAST_OTHER_INST(55) LAST_OTHER_INST(57)
#undef FIRST_TERM_INST #undef FIRST_TERM_INST
#undef HANDLE_TERM_INST #undef HANDLE_TERM_INST

View File

@ -32,12 +32,21 @@ public:
Constant *CreateAdd(Constant *LHS, Constant *RHS) const { Constant *CreateAdd(Constant *LHS, Constant *RHS) const {
return ConstantExpr::getAdd(LHS, RHS); return ConstantExpr::getAdd(LHS, RHS);
} }
Constant *CreateFAdd(Constant *LHS, Constant *RHS) const {
return ConstantExpr::getFAdd(LHS, RHS);
}
Constant *CreateSub(Constant *LHS, Constant *RHS) const { Constant *CreateSub(Constant *LHS, Constant *RHS) const {
return ConstantExpr::getSub(LHS, RHS); return ConstantExpr::getSub(LHS, RHS);
} }
Constant *CreateFSub(Constant *LHS, Constant *RHS) const {
return ConstantExpr::getFSub(LHS, RHS);
}
Constant *CreateMul(Constant *LHS, Constant *RHS) const { Constant *CreateMul(Constant *LHS, Constant *RHS) const {
return ConstantExpr::getMul(LHS, RHS); return ConstantExpr::getMul(LHS, RHS);
} }
Constant *CreateFMul(Constant *LHS, Constant *RHS) const {
return ConstantExpr::getFMul(LHS, RHS);
}
Constant *CreateUDiv(Constant *LHS, Constant *RHS) const { Constant *CreateUDiv(Constant *LHS, Constant *RHS) const {
return ConstantExpr::getUDiv(LHS, RHS); return ConstantExpr::getUDiv(LHS, RHS);
} }
@ -87,6 +96,9 @@ public:
Constant *CreateNeg(Constant *C) const { Constant *CreateNeg(Constant *C) const {
return ConstantExpr::getNeg(C); return ConstantExpr::getNeg(C);
} }
Constant *CreateFNeg(Constant *C) const {
return ConstantExpr::getFNeg(C);
}
Constant *CreateNot(Constant *C) const { Constant *CreateNot(Constant *C) const {
return ConstantExpr::getNot(C); return ConstantExpr::getNot(C);
} }

View File

@ -175,18 +175,36 @@ public:
return Folder.CreateAdd(LC, RC); return Folder.CreateAdd(LC, RC);
return Insert(BinaryOperator::CreateAdd(LHS, RHS), Name); return Insert(BinaryOperator::CreateAdd(LHS, RHS), Name);
} }
Value *CreateFAdd(Value *LHS, Value *RHS, const char *Name = "") {
if (Constant *LC = dyn_cast<Constant>(LHS))
if (Constant *RC = dyn_cast<Constant>(RHS))
return Folder.CreateFAdd(LC, RC);
return Insert(BinaryOperator::CreateFAdd(LHS, RHS), Name);
}
Value *CreateSub(Value *LHS, Value *RHS, const char *Name = "") { Value *CreateSub(Value *LHS, Value *RHS, const char *Name = "") {
if (Constant *LC = dyn_cast<Constant>(LHS)) if (Constant *LC = dyn_cast<Constant>(LHS))
if (Constant *RC = dyn_cast<Constant>(RHS)) if (Constant *RC = dyn_cast<Constant>(RHS))
return Folder.CreateSub(LC, RC); return Folder.CreateSub(LC, RC);
return Insert(BinaryOperator::CreateSub(LHS, RHS), Name); return Insert(BinaryOperator::CreateSub(LHS, RHS), Name);
} }
Value *CreateFSub(Value *LHS, Value *RHS, const char *Name = "") {
if (Constant *LC = dyn_cast<Constant>(LHS))
if (Constant *RC = dyn_cast<Constant>(RHS))
return Folder.CreateFSub(LC, RC);
return Insert(BinaryOperator::CreateFSub(LHS, RHS), Name);
}
Value *CreateMul(Value *LHS, Value *RHS, const char *Name = "") { Value *CreateMul(Value *LHS, Value *RHS, const char *Name = "") {
if (Constant *LC = dyn_cast<Constant>(LHS)) if (Constant *LC = dyn_cast<Constant>(LHS))
if (Constant *RC = dyn_cast<Constant>(RHS)) if (Constant *RC = dyn_cast<Constant>(RHS))
return Folder.CreateMul(LC, RC); return Folder.CreateMul(LC, RC);
return Insert(BinaryOperator::CreateMul(LHS, RHS), Name); return Insert(BinaryOperator::CreateMul(LHS, RHS), Name);
} }
Value *CreateFMul(Value *LHS, Value *RHS, const char *Name = "") {
if (Constant *LC = dyn_cast<Constant>(LHS))
if (Constant *RC = dyn_cast<Constant>(RHS))
return Folder.CreateMul(LC, RC);
return Insert(BinaryOperator::CreateFMul(LHS, RHS), Name);
}
Value *CreateUDiv(Value *LHS, Value *RHS, const char *Name = "") { Value *CreateUDiv(Value *LHS, Value *RHS, const char *Name = "") {
if (Constant *LC = dyn_cast<Constant>(LHS)) if (Constant *LC = dyn_cast<Constant>(LHS))
if (Constant *RC = dyn_cast<Constant>(RHS)) if (Constant *RC = dyn_cast<Constant>(RHS))

View File

@ -39,12 +39,21 @@ public:
Value *CreateAdd(Constant *LHS, Constant *RHS) const { Value *CreateAdd(Constant *LHS, Constant *RHS) const {
return BinaryOperator::CreateAdd(LHS, RHS); return BinaryOperator::CreateAdd(LHS, RHS);
} }
Value *CreateFAdd(Constant *LHS, Constant *RHS) const {
return BinaryOperator::CreateFAdd(LHS, RHS);
}
Value *CreateSub(Constant *LHS, Constant *RHS) const { Value *CreateSub(Constant *LHS, Constant *RHS) const {
return BinaryOperator::CreateSub(LHS, RHS); return BinaryOperator::CreateSub(LHS, RHS);
} }
Value *CreateFSub(Constant *LHS, Constant *RHS) const {
return BinaryOperator::CreateFSub(LHS, RHS);
}
Value *CreateMul(Constant *LHS, Constant *RHS) const { Value *CreateMul(Constant *LHS, Constant *RHS) const {
return BinaryOperator::CreateMul(LHS, RHS); return BinaryOperator::CreateMul(LHS, RHS);
} }
Value *CreateFMul(Constant *LHS, Constant *RHS) const {
return BinaryOperator::CreateFMul(LHS, RHS);
}
Value *CreateUDiv(Constant *LHS, Constant *RHS) const { Value *CreateUDiv(Constant *LHS, Constant *RHS) const {
return BinaryOperator::CreateUDiv(LHS, RHS); return BinaryOperator::CreateUDiv(LHS, RHS);
} }

View File

@ -156,18 +156,36 @@ inline BinaryOp_match<LHS, RHS, Instruction::Add> m_Add(const LHS &L,
return BinaryOp_match<LHS, RHS, Instruction::Add>(L, R); return BinaryOp_match<LHS, RHS, Instruction::Add>(L, R);
} }
template<typename LHS, typename RHS>
inline BinaryOp_match<LHS, RHS, Instruction::FAdd> m_FAdd(const LHS &L,
const RHS &R) {
return BinaryOp_match<LHS, RHS, Instruction::FAdd>(L, R);
}
template<typename LHS, typename RHS> template<typename LHS, typename RHS>
inline BinaryOp_match<LHS, RHS, Instruction::Sub> m_Sub(const LHS &L, inline BinaryOp_match<LHS, RHS, Instruction::Sub> m_Sub(const LHS &L,
const RHS &R) { const RHS &R) {
return BinaryOp_match<LHS, RHS, Instruction::Sub>(L, R); return BinaryOp_match<LHS, RHS, Instruction::Sub>(L, R);
} }
template<typename LHS, typename RHS>
inline BinaryOp_match<LHS, RHS, Instruction::FSub> m_FSub(const LHS &L,
const RHS &R) {
return BinaryOp_match<LHS, RHS, Instruction::FSub>(L, R);
}
template<typename LHS, typename RHS> template<typename LHS, typename RHS>
inline BinaryOp_match<LHS, RHS, Instruction::Mul> m_Mul(const LHS &L, inline BinaryOp_match<LHS, RHS, Instruction::Mul> m_Mul(const LHS &L,
const RHS &R) { const RHS &R) {
return BinaryOp_match<LHS, RHS, Instruction::Mul>(L, R); return BinaryOp_match<LHS, RHS, Instruction::Mul>(L, R);
} }
template<typename LHS, typename RHS>
inline BinaryOp_match<LHS, RHS, Instruction::FMul> m_FMul(const LHS &L,
const RHS &R) {
return BinaryOp_match<LHS, RHS, Instruction::FMul>(L, R);
}
template<typename LHS, typename RHS> template<typename LHS, typename RHS>
inline BinaryOp_match<LHS, RHS, Instruction::UDiv> m_UDiv(const LHS &L, inline BinaryOp_match<LHS, RHS, Instruction::UDiv> m_UDiv(const LHS &L,
const RHS &R) { const RHS &R) {
@ -494,6 +512,35 @@ template<typename LHS>
inline neg_match<LHS> m_Neg(const LHS &L) { return L; } inline neg_match<LHS> m_Neg(const LHS &L) { return L; }
template<typename LHS_t>
struct fneg_match {
LHS_t L;
fneg_match(const LHS_t &LHS) : L(LHS) {}
template<typename OpTy>
bool match(OpTy *V) {
if (Instruction *I = dyn_cast<Instruction>(V))
if (I->getOpcode() == Instruction::FSub)
return matchIfFNeg(I->getOperand(0), I->getOperand(1));
if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V))
if (CE->getOpcode() == Instruction::FSub)
return matchIfFNeg(CE->getOperand(0), CE->getOperand(1));
if (ConstantFP *CF = dyn_cast<ConstantFP>(V))
return L.match(ConstantExpr::getFNeg(CF));
return false;
}
private:
bool matchIfFNeg(Value *LHS, Value *RHS) {
return LHS == ConstantExpr::getZeroValueForNegationExpr(LHS->getType()) &&
L.match(RHS);
}
};
template<typename LHS>
inline fneg_match<LHS> m_FNeg(const LHS &L) { return L; }
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// Matchers for control flow // Matchers for control flow
// //

View File

@ -48,12 +48,21 @@ public:
Constant *CreateAdd(Constant *LHS, Constant *RHS) const { Constant *CreateAdd(Constant *LHS, Constant *RHS) const {
return Fold(ConstantExpr::getAdd(LHS, RHS)); return Fold(ConstantExpr::getAdd(LHS, RHS));
} }
Constant *CreateFAdd(Constant *LHS, Constant *RHS) const {
return Fold(ConstantExpr::getFAdd(LHS, RHS));
}
Constant *CreateSub(Constant *LHS, Constant *RHS) const { Constant *CreateSub(Constant *LHS, Constant *RHS) const {
return Fold(ConstantExpr::getSub(LHS, RHS)); return Fold(ConstantExpr::getSub(LHS, RHS));
} }
Constant *CreateFSub(Constant *LHS, Constant *RHS) const {
return Fold(ConstantExpr::getFSub(LHS, RHS));
}
Constant *CreateMul(Constant *LHS, Constant *RHS) const { Constant *CreateMul(Constant *LHS, Constant *RHS) const {
return Fold(ConstantExpr::getMul(LHS, RHS)); return Fold(ConstantExpr::getMul(LHS, RHS));
} }
Constant *CreateFMul(Constant *LHS, Constant *RHS) const {
return Fold(ConstantExpr::getFMul(LHS, RHS));
}
Constant *CreateUDiv(Constant *LHS, Constant *RHS) const { Constant *CreateUDiv(Constant *LHS, Constant *RHS) const {
return Fold(ConstantExpr::getUDiv(LHS, RHS)); return Fold(ConstantExpr::getUDiv(LHS, RHS));
} }
@ -103,6 +112,9 @@ public:
Constant *CreateNeg(Constant *C) const { Constant *CreateNeg(Constant *C) const {
return Fold(ConstantExpr::getNeg(C)); return Fold(ConstantExpr::getNeg(C));
} }
Constant *CreateFNeg(Constant *C) const {
return Fold(ConstantExpr::getFNeg(C));
}
Constant *CreateNot(Constant *C) const { Constant *CreateNot(Constant *C) const {
return Fold(ConstantExpr::getNot(C)); return Fold(ConstantExpr::getNot(C));
} }

View File

@ -771,7 +771,7 @@ bool llvm::CannotBeNegativeZero(const Value *V, unsigned Depth) {
if (I == 0) return false; if (I == 0) return false;
// (add x, 0.0) is guaranteed to return +0.0, not -0.0. // (add x, 0.0) is guaranteed to return +0.0, not -0.0.
if (I->getOpcode() == Instruction::Add && if (I->getOpcode() == Instruction::FAdd &&
isa<ConstantFP>(I->getOperand(1)) && isa<ConstantFP>(I->getOperand(1)) &&
cast<ConstantFP>(I->getOperand(1))->isNullValue()) cast<ConstantFP>(I->getOperand(1))->isNullValue())
return true; return true;

View File

@ -591,7 +591,9 @@ lltok::Kind LLLexer::LexIdentifier() {
if (Len == strlen(#STR) && !memcmp(StartChar, #STR, strlen(#STR))) { \ if (Len == strlen(#STR) && !memcmp(StartChar, #STR, strlen(#STR))) { \
UIntVal = Instruction::Enum; return lltok::kw_##STR; } UIntVal = Instruction::Enum; return lltok::kw_##STR; }
INSTKEYWORD(add, Add); INSTKEYWORD(sub, Sub); INSTKEYWORD(mul, Mul); INSTKEYWORD(add, Add); INSTKEYWORD(fadd, FAdd);
INSTKEYWORD(sub, Sub); INSTKEYWORD(fsub, FSub);
INSTKEYWORD(mul, Mul); INSTKEYWORD(fmul, FMul);
INSTKEYWORD(udiv, UDiv); INSTKEYWORD(sdiv, SDiv); INSTKEYWORD(fdiv, FDiv); INSTKEYWORD(udiv, UDiv); INSTKEYWORD(sdiv, SDiv); INSTKEYWORD(fdiv, FDiv);
INSTKEYWORD(urem, URem); INSTKEYWORD(srem, SRem); INSTKEYWORD(frem, FRem); INSTKEYWORD(urem, URem); INSTKEYWORD(srem, SRem); INSTKEYWORD(frem, FRem);
INSTKEYWORD(shl, Shl); INSTKEYWORD(lshr, LShr); INSTKEYWORD(ashr, AShr); INSTKEYWORD(shl, Shl); INSTKEYWORD(lshr, LShr); INSTKEYWORD(ashr, AShr);

View File

@ -1835,8 +1835,11 @@ bool LLParser::ParseValID(ValID &ID) {
// Binary Operators. // Binary Operators.
case lltok::kw_add: case lltok::kw_add:
case lltok::kw_fadd:
case lltok::kw_sub: case lltok::kw_sub:
case lltok::kw_fsub:
case lltok::kw_mul: case lltok::kw_mul:
case lltok::kw_fmul:
case lltok::kw_udiv: case lltok::kw_udiv:
case lltok::kw_sdiv: case lltok::kw_sdiv:
case lltok::kw_fdiv: case lltok::kw_fdiv:
@ -2400,8 +2403,13 @@ bool LLParser::ParseInstruction(Instruction *&Inst, BasicBlock *BB,
// Binary Operators. // Binary Operators.
case lltok::kw_add: case lltok::kw_add:
case lltok::kw_sub: case lltok::kw_sub:
case lltok::kw_mul: return ParseArithmetic(Inst, PFS, KeywordVal, 0); case lltok::kw_mul:
// API compatibility: Accept either integer or floating-point types.
return ParseArithmetic(Inst, PFS, KeywordVal, 0);
case lltok::kw_fadd:
case lltok::kw_fsub:
case lltok::kw_fmul: return ParseArithmetic(Inst, PFS, KeywordVal, 2);
case lltok::kw_udiv: case lltok::kw_udiv:
case lltok::kw_sdiv: case lltok::kw_sdiv:
case lltok::kw_urem: case lltok::kw_urem:

View File

@ -90,7 +90,8 @@ namespace lltok {
kw_ueq, kw_une, kw_ueq, kw_une,
// Instruction Opcodes (Opcode in UIntVal). // Instruction Opcodes (Opcode in UIntVal).
kw_add, kw_sub, kw_mul, kw_udiv, kw_sdiv, kw_fdiv, kw_add, kw_fadd, kw_sub, kw_fsub, kw_mul, kw_fmul,
kw_udiv, kw_sdiv, kw_fdiv,
kw_urem, kw_srem, kw_frem, kw_shl, kw_lshr, kw_ashr, kw_urem, kw_srem, kw_frem, kw_shl, kw_lshr, kw_ashr,
kw_and, kw_or, kw_xor, kw_icmp, kw_fcmp, kw_vicmp, kw_vfcmp, kw_and, kw_or, kw_xor, kw_icmp, kw_fcmp, kw_vicmp, kw_vfcmp,

View File

@ -104,9 +104,12 @@ static int GetDecodedCastOpcode(unsigned Val) {
static int GetDecodedBinaryOpcode(unsigned Val, const Type *Ty) { static int GetDecodedBinaryOpcode(unsigned Val, const Type *Ty) {
switch (Val) { switch (Val) {
default: return -1; default: return -1;
case bitc::BINOP_ADD: return Instruction::Add; case bitc::BINOP_ADD:
case bitc::BINOP_SUB: return Instruction::Sub; return Ty->isFPOrFPVector() ? Instruction::FAdd : Instruction::Add;
case bitc::BINOP_MUL: return Instruction::Mul; case bitc::BINOP_SUB:
return Ty->isFPOrFPVector() ? Instruction::FSub : Instruction::Sub;
case bitc::BINOP_MUL:
return Ty->isFPOrFPVector() ? Instruction::FMul : Instruction::Mul;
case bitc::BINOP_UDIV: return Instruction::UDiv; case bitc::BINOP_UDIV: return Instruction::UDiv;
case bitc::BINOP_SDIV: case bitc::BINOP_SDIV:
return Ty->isFPOrFPVector() ? Instruction::FDiv : Instruction::SDiv; return Ty->isFPOrFPVector() ? Instruction::FDiv : Instruction::SDiv;

View File

@ -77,9 +77,12 @@ static unsigned GetEncodedCastOpcode(unsigned Opcode) {
static unsigned GetEncodedBinaryOpcode(unsigned Opcode) { static unsigned GetEncodedBinaryOpcode(unsigned Opcode) {
switch (Opcode) { switch (Opcode) {
default: assert(0 && "Unknown binary instruction!"); default: assert(0 && "Unknown binary instruction!");
case Instruction::Add: return bitc::BINOP_ADD; case Instruction::Add:
case Instruction::Sub: return bitc::BINOP_SUB; case Instruction::FAdd: return bitc::BINOP_ADD;
case Instruction::Mul: return bitc::BINOP_MUL; case Instruction::Sub:
case Instruction::FSub: return bitc::BINOP_SUB;
case Instruction::Mul:
case Instruction::FMul: return bitc::BINOP_MUL;
case Instruction::UDiv: return bitc::BINOP_UDIV; case Instruction::UDiv: return bitc::BINOP_UDIV;
case Instruction::FDiv: case Instruction::FDiv:
case Instruction::SDiv: return bitc::BINOP_SDIV; case Instruction::SDiv: return bitc::BINOP_SDIV;

View File

@ -639,18 +639,18 @@ FastISel::FastEmitBranch(MachineBasicBlock *MSucc) {
bool bool
FastISel::SelectOperator(User *I, unsigned Opcode) { FastISel::SelectOperator(User *I, unsigned Opcode) {
switch (Opcode) { switch (Opcode) {
case Instruction::Add: { case Instruction::Add:
ISD::NodeType Opc = I->getType()->isFPOrFPVector() ? ISD::FADD : ISD::ADD; return SelectBinaryOp(I, ISD::ADD);
return SelectBinaryOp(I, Opc); case Instruction::FAdd:
} return SelectBinaryOp(I, ISD::FADD);
case Instruction::Sub: { case Instruction::Sub:
ISD::NodeType Opc = I->getType()->isFPOrFPVector() ? ISD::FSUB : ISD::SUB; return SelectBinaryOp(I, ISD::SUB);
return SelectBinaryOp(I, Opc); case Instruction::FSub:
} return SelectBinaryOp(I, ISD::FSUB);
case Instruction::Mul: { case Instruction::Mul:
ISD::NodeType Opc = I->getType()->isFPOrFPVector() ? ISD::FMUL : ISD::MUL; return SelectBinaryOp(I, ISD::MUL);
return SelectBinaryOp(I, Opc); case Instruction::FMul:
} return SelectBinaryOp(I, ISD::FMUL);
case Instruction::SDiv: case Instruction::SDiv:
return SelectBinaryOp(I, ISD::SDIV); return SelectBinaryOp(I, ISD::SDIV);
case Instruction::UDiv: case Instruction::UDiv:

View File

@ -842,20 +842,6 @@ void SelectionDAGLowering::visit(unsigned Opcode, User &I) {
} }
} }
void SelectionDAGLowering::visitAdd(User &I) {
if (I.getType()->isFPOrFPVector())
visitBinary(I, ISD::FADD);
else
visitBinary(I, ISD::ADD);
}
void SelectionDAGLowering::visitMul(User &I) {
if (I.getType()->isFPOrFPVector())
visitBinary(I, ISD::FMUL);
else
visitBinary(I, ISD::MUL);
}
SDValue SelectionDAGLowering::getValue(const Value *V) { SDValue SelectionDAGLowering::getValue(const Value *V) {
SDValue &N = NodeMap[V]; SDValue &N = NodeMap[V];
if (N.getNode()) return N; if (N.getNode()) return N;
@ -2161,37 +2147,33 @@ void SelectionDAGLowering::visitSwitch(SwitchInst &SI) {
} }
void SelectionDAGLowering::visitSub(User &I) { void SelectionDAGLowering::visitFSub(User &I) {
// -0.0 - X --> fneg // -0.0 - X --> fneg
const Type *Ty = I.getType(); const Type *Ty = I.getType();
if (isa<VectorType>(Ty)) { if (isa<VectorType>(Ty)) {
if (ConstantVector *CV = dyn_cast<ConstantVector>(I.getOperand(0))) { if (ConstantVector *CV = dyn_cast<ConstantVector>(I.getOperand(0))) {
const VectorType *DestTy = cast<VectorType>(I.getType()); const VectorType *DestTy = cast<VectorType>(I.getType());
const Type *ElTy = DestTy->getElementType(); const Type *ElTy = DestTy->getElementType();
if (ElTy->isFloatingPoint()) { unsigned VL = DestTy->getNumElements();
unsigned VL = DestTy->getNumElements(); std::vector<Constant*> NZ(VL, ConstantFP::getNegativeZero(ElTy));
std::vector<Constant*> NZ(VL, ConstantFP::getNegativeZero(ElTy)); Constant *CNZ = ConstantVector::get(&NZ[0], NZ.size());
Constant *CNZ = ConstantVector::get(&NZ[0], NZ.size()); if (CV == CNZ) {
if (CV == CNZ) {
SDValue Op2 = getValue(I.getOperand(1));
setValue(&I, DAG.getNode(ISD::FNEG, getCurDebugLoc(),
Op2.getValueType(), Op2));
return;
}
}
}
}
if (Ty->isFloatingPoint()) {
if (ConstantFP *CFP = dyn_cast<ConstantFP>(I.getOperand(0)))
if (CFP->isExactlyValue(ConstantFP::getNegativeZero(Ty)->getValueAPF())) {
SDValue Op2 = getValue(I.getOperand(1)); SDValue Op2 = getValue(I.getOperand(1));
setValue(&I, DAG.getNode(ISD::FNEG, getCurDebugLoc(), setValue(&I, DAG.getNode(ISD::FNEG, getCurDebugLoc(),
Op2.getValueType(), Op2)); Op2.getValueType(), Op2));
return; return;
} }
}
} }
if (ConstantFP *CFP = dyn_cast<ConstantFP>(I.getOperand(0)))
if (CFP->isExactlyValue(ConstantFP::getNegativeZero(Ty)->getValueAPF())) {
SDValue Op2 = getValue(I.getOperand(1));
setValue(&I, DAG.getNode(ISD::FNEG, getCurDebugLoc(),
Op2.getValueType(), Op2));
return;
}
visitBinary(I, Ty->isFPOrFPVector() ? ISD::FSUB : ISD::SUB); visitBinary(I, ISD::FSUB);
} }
void SelectionDAGLowering::visitBinary(User &I, unsigned OpCode) { void SelectionDAGLowering::visitBinary(User &I, unsigned OpCode) {

View File

@ -469,9 +469,12 @@ private:
void visitBinary(User &I, unsigned OpCode); void visitBinary(User &I, unsigned OpCode);
void visitShift(User &I, unsigned Opcode); void visitShift(User &I, unsigned Opcode);
void visitAdd(User &I); void visitAdd(User &I) { visitBinary(I, ISD::ADD); }
void visitSub(User &I); void visitFAdd(User &I) { visitBinary(I, ISD::FADD); }
void visitMul(User &I); void visitSub(User &I) { visitBinary(I, ISD::SUB); }
void visitFSub(User &I);
void visitMul(User &I) { visitBinary(I, ISD::MUL); }
void visitFMul(User &I) { visitBinary(I, ISD::FMUL); }
void visitURem(User &I) { visitBinary(I, ISD::UREM); } void visitURem(User &I) { visitBinary(I, ISD::UREM); }
void visitSRem(User &I) { visitBinary(I, ISD::SREM); } void visitSRem(User &I) { visitBinary(I, ISD::SREM); }
void visitFRem(User &I) { visitBinary(I, ISD::FREM); } void visitFRem(User &I) { visitBinary(I, ISD::FREM); }

View File

@ -573,8 +573,11 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) {
return GV; return GV;
} }
case Instruction::Add: case Instruction::Add:
case Instruction::FAdd:
case Instruction::Sub: case Instruction::Sub:
case Instruction::FSub:
case Instruction::Mul: case Instruction::Mul:
case Instruction::FMul:
case Instruction::UDiv: case Instruction::UDiv:
case Instruction::SDiv: case Instruction::SDiv:
case Instruction::URem: case Instruction::URem:
@ -605,11 +608,11 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) {
case Type::FloatTyID: case Type::FloatTyID:
switch (CE->getOpcode()) { switch (CE->getOpcode()) {
default: assert(0 && "Invalid float opcode"); abort(); default: assert(0 && "Invalid float opcode"); abort();
case Instruction::Add: case Instruction::FAdd:
GV.FloatVal = LHS.FloatVal + RHS.FloatVal; break; GV.FloatVal = LHS.FloatVal + RHS.FloatVal; break;
case Instruction::Sub: case Instruction::FSub:
GV.FloatVal = LHS.FloatVal - RHS.FloatVal; break; GV.FloatVal = LHS.FloatVal - RHS.FloatVal; break;
case Instruction::Mul: case Instruction::FMul:
GV.FloatVal = LHS.FloatVal * RHS.FloatVal; break; GV.FloatVal = LHS.FloatVal * RHS.FloatVal; break;
case Instruction::FDiv: case Instruction::FDiv:
GV.FloatVal = LHS.FloatVal / RHS.FloatVal; break; GV.FloatVal = LHS.FloatVal / RHS.FloatVal; break;
@ -620,11 +623,11 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) {
case Type::DoubleTyID: case Type::DoubleTyID:
switch (CE->getOpcode()) { switch (CE->getOpcode()) {
default: assert(0 && "Invalid double opcode"); abort(); default: assert(0 && "Invalid double opcode"); abort();
case Instruction::Add: case Instruction::FAdd:
GV.DoubleVal = LHS.DoubleVal + RHS.DoubleVal; break; GV.DoubleVal = LHS.DoubleVal + RHS.DoubleVal; break;
case Instruction::Sub: case Instruction::FSub:
GV.DoubleVal = LHS.DoubleVal - RHS.DoubleVal; break; GV.DoubleVal = LHS.DoubleVal - RHS.DoubleVal; break;
case Instruction::Mul: case Instruction::FMul:
GV.DoubleVal = LHS.DoubleVal * RHS.DoubleVal; break; GV.DoubleVal = LHS.DoubleVal * RHS.DoubleVal; break;
case Instruction::FDiv: case Instruction::FDiv:
GV.DoubleVal = LHS.DoubleVal / RHS.DoubleVal; break; GV.DoubleVal = LHS.DoubleVal / RHS.DoubleVal; break;
@ -638,15 +641,15 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) {
APFloat apfLHS = APFloat(LHS.IntVal); APFloat apfLHS = APFloat(LHS.IntVal);
switch (CE->getOpcode()) { switch (CE->getOpcode()) {
default: assert(0 && "Invalid long double opcode"); abort(); default: assert(0 && "Invalid long double opcode"); abort();
case Instruction::Add: case Instruction::FAdd:
apfLHS.add(APFloat(RHS.IntVal), APFloat::rmNearestTiesToEven); apfLHS.add(APFloat(RHS.IntVal), APFloat::rmNearestTiesToEven);
GV.IntVal = apfLHS.bitcastToAPInt(); GV.IntVal = apfLHS.bitcastToAPInt();
break; break;
case Instruction::Sub: case Instruction::FSub:
apfLHS.subtract(APFloat(RHS.IntVal), APFloat::rmNearestTiesToEven); apfLHS.subtract(APFloat(RHS.IntVal), APFloat::rmNearestTiesToEven);
GV.IntVal = apfLHS.bitcastToAPInt(); GV.IntVal = apfLHS.bitcastToAPInt();
break; break;
case Instruction::Mul: case Instruction::FMul:
apfLHS.multiply(APFloat(RHS.IntVal), APFloat::rmNearestTiesToEven); apfLHS.multiply(APFloat(RHS.IntVal), APFloat::rmNearestTiesToEven);
GV.IntVal = apfLHS.bitcastToAPInt(); GV.IntVal = apfLHS.bitcastToAPInt();
break; break;

View File

@ -64,45 +64,35 @@ void Interpreter::initializeExecutionEngine() {
Dest.TY##Val = Src1.TY##Val OP Src2.TY##Val; \ Dest.TY##Val = Src1.TY##Val OP Src2.TY##Val; \
break break
#define IMPLEMENT_INTEGER_BINOP1(OP, TY) \ static void executeFAddInst(GenericValue &Dest, GenericValue Src1,
case Type::IntegerTyID: { \ GenericValue Src2, const Type *Ty) {
Dest.IntVal = Src1.IntVal OP Src2.IntVal; \
break; \
}
static void executeAddInst(GenericValue &Dest, GenericValue Src1,
GenericValue Src2, const Type *Ty) {
switch (Ty->getTypeID()) { switch (Ty->getTypeID()) {
IMPLEMENT_INTEGER_BINOP1(+, Ty);
IMPLEMENT_BINARY_OPERATOR(+, Float); IMPLEMENT_BINARY_OPERATOR(+, Float);
IMPLEMENT_BINARY_OPERATOR(+, Double); IMPLEMENT_BINARY_OPERATOR(+, Double);
default: default:
cerr << "Unhandled type for Add instruction: " << *Ty << "\n"; cerr << "Unhandled type for FAdd instruction: " << *Ty << "\n";
abort(); abort();
} }
} }
static void executeSubInst(GenericValue &Dest, GenericValue Src1, static void executeFSubInst(GenericValue &Dest, GenericValue Src1,
GenericValue Src2, const Type *Ty) { GenericValue Src2, const Type *Ty) {
switch (Ty->getTypeID()) { switch (Ty->getTypeID()) {
IMPLEMENT_INTEGER_BINOP1(-, Ty);
IMPLEMENT_BINARY_OPERATOR(-, Float); IMPLEMENT_BINARY_OPERATOR(-, Float);
IMPLEMENT_BINARY_OPERATOR(-, Double); IMPLEMENT_BINARY_OPERATOR(-, Double);
default: default:
cerr << "Unhandled type for Sub instruction: " << *Ty << "\n"; cerr << "Unhandled type for FSub instruction: " << *Ty << "\n";
abort(); abort();
} }
} }
static void executeMulInst(GenericValue &Dest, GenericValue Src1, static void executeFMulInst(GenericValue &Dest, GenericValue Src1,
GenericValue Src2, const Type *Ty) { GenericValue Src2, const Type *Ty) {
switch (Ty->getTypeID()) { switch (Ty->getTypeID()) {
IMPLEMENT_INTEGER_BINOP1(*, Ty);
IMPLEMENT_BINARY_OPERATOR(*, Float); IMPLEMENT_BINARY_OPERATOR(*, Float);
IMPLEMENT_BINARY_OPERATOR(*, Double); IMPLEMENT_BINARY_OPERATOR(*, Double);
default: default:
cerr << "Unhandled type for Mul instruction: " << *Ty << "\n"; cerr << "Unhandled type for FMul instruction: " << *Ty << "\n";
abort(); abort();
} }
} }
@ -550,11 +540,14 @@ void Interpreter::visitBinaryOperator(BinaryOperator &I) {
GenericValue R; // Result GenericValue R; // Result
switch (I.getOpcode()) { switch (I.getOpcode()) {
case Instruction::Add: executeAddInst (R, Src1, Src2, Ty); break; case Instruction::Add: R.IntVal = Src1.IntVal + Src2.IntVal; break;
case Instruction::Sub: executeSubInst (R, Src1, Src2, Ty); break; case Instruction::Sub: R.IntVal = Src1.IntVal - Src2.IntVal; break;
case Instruction::Mul: executeMulInst (R, Src1, Src2, Ty); break; case Instruction::Mul: R.IntVal = Src1.IntVal * Src2.IntVal; break;
case Instruction::FDiv: executeFDivInst (R, Src1, Src2, Ty); break; case Instruction::FAdd: executeFAddInst(R, Src1, Src2, Ty); break;
case Instruction::FRem: executeFRemInst (R, Src1, Src2, Ty); break; case Instruction::FSub: executeFSubInst(R, Src1, Src2, Ty); break;
case Instruction::FMul: executeFMulInst(R, Src1, Src2, Ty); break;
case Instruction::FDiv: executeFDivInst(R, Src1, Src2, Ty); break;
case Instruction::FRem: executeFRemInst(R, Src1, Src2, Ty); break;
case Instruction::UDiv: R.IntVal = Src1.IntVal.udiv(Src2.IntVal); break; case Instruction::UDiv: R.IntVal = Src1.IntVal.udiv(Src2.IntVal); break;
case Instruction::SDiv: R.IntVal = Src1.IntVal.sdiv(Src2.IntVal); break; case Instruction::SDiv: R.IntVal = Src1.IntVal.sdiv(Src2.IntVal); break;
case Instruction::URem: R.IntVal = Src1.IntVal.urem(Src2.IntVal); break; case Instruction::URem: R.IntVal = Src1.IntVal.urem(Src2.IntVal); break;
@ -1258,18 +1251,21 @@ GenericValue Interpreter::getConstantExprValue (ConstantExpr *CE,
GenericValue Dest; GenericValue Dest;
const Type * Ty = CE->getOperand(0)->getType(); const Type * Ty = CE->getOperand(0)->getType();
switch (CE->getOpcode()) { switch (CE->getOpcode()) {
case Instruction::Add: executeAddInst (Dest, Op0, Op1, Ty); break; case Instruction::Add: Dest.IntVal = Op0.IntVal + Op1.IntVal; break;
case Instruction::Sub: executeSubInst (Dest, Op0, Op1, Ty); break; case Instruction::Sub: Dest.IntVal = Op0.IntVal - Op1.IntVal; break;
case Instruction::Mul: executeMulInst (Dest, Op0, Op1, Ty); break; case Instruction::Mul: Dest.IntVal = Op0.IntVal * Op1.IntVal; break;
case Instruction::FAdd: executeFAddInst(Dest, Op0, Op1, Ty); break;
case Instruction::FSub: executeFSubInst(Dest, Op0, Op1, Ty); break;
case Instruction::FMul: executeFMulInst(Dest, Op0, Op1, Ty); break;
case Instruction::FDiv: executeFDivInst(Dest, Op0, Op1, Ty); break; case Instruction::FDiv: executeFDivInst(Dest, Op0, Op1, Ty); break;
case Instruction::FRem: executeFRemInst(Dest, Op0, Op1, Ty); break; case Instruction::FRem: executeFRemInst(Dest, Op0, Op1, Ty); break;
case Instruction::SDiv: Dest.IntVal = Op0.IntVal.sdiv(Op1.IntVal); break; case Instruction::SDiv: Dest.IntVal = Op0.IntVal.sdiv(Op1.IntVal); break;
case Instruction::UDiv: Dest.IntVal = Op0.IntVal.udiv(Op1.IntVal); break; case Instruction::UDiv: Dest.IntVal = Op0.IntVal.udiv(Op1.IntVal); break;
case Instruction::URem: Dest.IntVal = Op0.IntVal.urem(Op1.IntVal); break; case Instruction::URem: Dest.IntVal = Op0.IntVal.urem(Op1.IntVal); break;
case Instruction::SRem: Dest.IntVal = Op0.IntVal.srem(Op1.IntVal); break; case Instruction::SRem: Dest.IntVal = Op0.IntVal.srem(Op1.IntVal); break;
case Instruction::And: Dest.IntVal = Op0.IntVal.And(Op1.IntVal); break; case Instruction::And: Dest.IntVal = Op0.IntVal & Op1.IntVal; break;
case Instruction::Or: Dest.IntVal = Op0.IntVal.Or(Op1.IntVal); break; case Instruction::Or: Dest.IntVal = Op0.IntVal | Op1.IntVal; break;
case Instruction::Xor: Dest.IntVal = Op0.IntVal.Xor(Op1.IntVal); break; case Instruction::Xor: Dest.IntVal = Op0.IntVal ^ Op1.IntVal; break;
case Instruction::Shl: case Instruction::Shl:
Dest.IntVal = Op0.IntVal.shl(Op1.IntVal.getZExtValue()); Dest.IntVal = Op0.IntVal.shl(Op1.IntVal.getZExtValue());
break; break;

View File

@ -891,8 +891,11 @@ unsigned JITEmitter::addSizeOfGlobalsInConstantVal(const Constant *C,
break; break;
} }
case Instruction::Add: case Instruction::Add:
case Instruction::FAdd:
case Instruction::Sub: case Instruction::Sub:
case Instruction::FSub:
case Instruction::Mul: case Instruction::Mul:
case Instruction::FMul:
case Instruction::UDiv: case Instruction::UDiv:
case Instruction::SDiv: case Instruction::SDiv:
case Instruction::URem: case Instruction::URem:

View File

@ -1000,8 +1000,11 @@ void CWriter::printConstant(Constant *CPV, bool Static) {
Out << ')'; Out << ')';
return; return;
case Instruction::Add: case Instruction::Add:
case Instruction::FAdd:
case Instruction::Sub: case Instruction::Sub:
case Instruction::FSub:
case Instruction::Mul: case Instruction::Mul:
case Instruction::FMul:
case Instruction::SDiv: case Instruction::SDiv:
case Instruction::UDiv: case Instruction::UDiv:
case Instruction::FDiv: case Instruction::FDiv:
@ -1020,9 +1023,12 @@ void CWriter::printConstant(Constant *CPV, bool Static) {
bool NeedsClosingParens = printConstExprCast(CE, Static); bool NeedsClosingParens = printConstExprCast(CE, Static);
printConstantWithCast(CE->getOperand(0), CE->getOpcode()); printConstantWithCast(CE->getOperand(0), CE->getOpcode());
switch (CE->getOpcode()) { switch (CE->getOpcode()) {
case Instruction::Add: Out << " + "; break; case Instruction::Add:
case Instruction::Sub: Out << " - "; break; case Instruction::FAdd: Out << " + "; break;
case Instruction::Mul: Out << " * "; break; case Instruction::Sub:
case Instruction::FSub: Out << " - "; break;
case Instruction::Mul:
case Instruction::FMul: Out << " * "; break;
case Instruction::URem: case Instruction::URem:
case Instruction::SRem: case Instruction::SRem:
case Instruction::FRem: Out << " % "; break; case Instruction::FRem: Out << " % "; break;
@ -1322,8 +1328,6 @@ bool CWriter::printConstExprCast(const ConstantExpr* CE, bool Static) {
case Instruction::Mul: case Instruction::Mul:
// We need to cast integer arithmetic so that it is always performed // We need to cast integer arithmetic so that it is always performed
// as unsigned, to avoid undefined behavior on overflow. // as unsigned, to avoid undefined behavior on overflow.
if (!Ty->isIntOrIntVector()) break;
// FALL THROUGH
case Instruction::LShr: case Instruction::LShr:
case Instruction::URem: case Instruction::URem:
case Instruction::UDiv: NeedsExplicitCast = true; break; case Instruction::UDiv: NeedsExplicitCast = true; break;
@ -1387,8 +1391,6 @@ void CWriter::printConstantWithCast(Constant* CPV, unsigned Opcode) {
case Instruction::Mul: case Instruction::Mul:
// We need to cast integer arithmetic so that it is always performed // We need to cast integer arithmetic so that it is always performed
// as unsigned, to avoid undefined behavior on overflow. // as unsigned, to avoid undefined behavior on overflow.
if (!OpTy->isIntOrIntVector()) break;
// FALL THROUGH
case Instruction::LShr: case Instruction::LShr:
case Instruction::UDiv: case Instruction::UDiv:
case Instruction::URem: case Instruction::URem:
@ -1505,8 +1507,6 @@ bool CWriter::writeInstructionCast(const Instruction &I) {
case Instruction::Mul: case Instruction::Mul:
// We need to cast integer arithmetic so that it is always performed // We need to cast integer arithmetic so that it is always performed
// as unsigned, to avoid undefined behavior on overflow. // as unsigned, to avoid undefined behavior on overflow.
if (!Ty->isIntOrIntVector()) break;
// FALL THROUGH
case Instruction::LShr: case Instruction::LShr:
case Instruction::URem: case Instruction::URem:
case Instruction::UDiv: case Instruction::UDiv:
@ -1552,8 +1552,6 @@ void CWriter::writeOperandWithCast(Value* Operand, unsigned Opcode) {
case Instruction::Mul: case Instruction::Mul:
// We need to cast integer arithmetic so that it is always performed // We need to cast integer arithmetic so that it is always performed
// as unsigned, to avoid undefined behavior on overflow. // as unsigned, to avoid undefined behavior on overflow.
if (!OpTy->isIntOrIntVector()) break;
// FALL THROUGH
case Instruction::LShr: case Instruction::LShr:
case Instruction::UDiv: case Instruction::UDiv:
case Instruction::URem: // Cast to unsigned first case Instruction::URem: // Cast to unsigned first
@ -2602,10 +2600,14 @@ void CWriter::visitBinaryOperator(Instruction &I) {
// If this is a negation operation, print it out as such. For FP, we don't // If this is a negation operation, print it out as such. For FP, we don't
// want to print "-0.0 - X". // want to print "-0.0 - X".
if (BinaryOperator::isNeg(&I)) { if (BinaryOperator::isNeg(&I) || BinaryOperator::isFNeg(&I)) {
Out << "-("; Out << "-(";
writeOperand(BinaryOperator::getNegArgument(cast<BinaryOperator>(&I))); writeOperand(BinaryOperator::getNegArgument(cast<BinaryOperator>(&I)));
Out << ")"; Out << ")";
} else if (BinaryOperator::isFNeg(&I)) {
Out << "-(";
writeOperand(BinaryOperator::getFNegArgument(cast<BinaryOperator>(&I)));
Out << ")";
} else if (I.getOpcode() == Instruction::FRem) { } else if (I.getOpcode() == Instruction::FRem) {
// Output a call to fmod/fmodf instead of emitting a%b // Output a call to fmod/fmodf instead of emitting a%b
if (I.getType() == Type::FloatTy) if (I.getType() == Type::FloatTy)
@ -2630,9 +2632,12 @@ void CWriter::visitBinaryOperator(Instruction &I) {
writeOperandWithCast(I.getOperand(0), I.getOpcode()); writeOperandWithCast(I.getOperand(0), I.getOpcode());
switch (I.getOpcode()) { switch (I.getOpcode()) {
case Instruction::Add: Out << " + "; break; case Instruction::Add:
case Instruction::Sub: Out << " - "; break; case Instruction::FAdd: Out << " + "; break;
case Instruction::Mul: Out << " * "; break; case Instruction::Sub:
case Instruction::FSub: Out << " - "; break;
case Instruction::Mul:
case Instruction::FMul: Out << " * "; break;
case Instruction::URem: case Instruction::URem:
case Instruction::SRem: case Instruction::SRem:
case Instruction::FRem: Out << " % "; break; case Instruction::FRem: Out << " % "; break;

View File

@ -865,8 +865,11 @@ namespace {
Out << "Constant* " << constName << " = ConstantExpr::"; Out << "Constant* " << constName << " = ConstantExpr::";
switch (CE->getOpcode()) { switch (CE->getOpcode()) {
case Instruction::Add: Out << "getAdd("; break; case Instruction::Add: Out << "getAdd("; break;
case Instruction::FAdd: Out << "getFAdd("; break;
case Instruction::Sub: Out << "getSub("; break; case Instruction::Sub: Out << "getSub("; break;
case Instruction::FSub: Out << "getFSub("; break;
case Instruction::Mul: Out << "getMul("; break; case Instruction::Mul: Out << "getMul("; break;
case Instruction::FMul: Out << "getFMul("; break;
case Instruction::UDiv: Out << "getUDiv("; break; case Instruction::UDiv: Out << "getUDiv("; break;
case Instruction::SDiv: Out << "getSDiv("; break; case Instruction::SDiv: Out << "getSDiv("; break;
case Instruction::FDiv: Out << "getFDiv("; break; case Instruction::FDiv: Out << "getFDiv("; break;
@ -1159,8 +1162,11 @@ namespace {
break; break;
} }
case Instruction::Add: case Instruction::Add:
case Instruction::FAdd:
case Instruction::Sub: case Instruction::Sub:
case Instruction::FSub:
case Instruction::Mul: case Instruction::Mul:
case Instruction::FMul:
case Instruction::UDiv: case Instruction::UDiv:
case Instruction::SDiv: case Instruction::SDiv:
case Instruction::FDiv: case Instruction::FDiv:
@ -1176,8 +1182,11 @@ namespace {
Out << "BinaryOperator* " << iName << " = BinaryOperator::Create("; Out << "BinaryOperator* " << iName << " = BinaryOperator::Create(";
switch (I->getOpcode()) { switch (I->getOpcode()) {
case Instruction::Add: Out << "Instruction::Add"; break; case Instruction::Add: Out << "Instruction::Add"; break;
case Instruction::FAdd: Out << "Instruction::FAdd"; break;
case Instruction::Sub: Out << "Instruction::Sub"; break; case Instruction::Sub: Out << "Instruction::Sub"; break;
case Instruction::FSub: Out << "Instruction::FSub"; break;
case Instruction::Mul: Out << "Instruction::Mul"; break; case Instruction::Mul: Out << "Instruction::Mul"; break;
case Instruction::FMul: Out << "Instruction::FMul"; break;
case Instruction::UDiv:Out << "Instruction::UDiv"; break; case Instruction::UDiv:Out << "Instruction::UDiv"; break;
case Instruction::SDiv:Out << "Instruction::SDiv"; break; case Instruction::SDiv:Out << "Instruction::SDiv"; break;
case Instruction::FDiv:Out << "Instruction::FDiv"; break; case Instruction::FDiv:Out << "Instruction::FDiv"; break;

View File

@ -1060,12 +1060,15 @@ void MSILWriter::printInstruction(const Instruction* Inst) {
break; break;
// Binary // Binary
case Instruction::Add: case Instruction::Add:
case Instruction::FAdd:
printBinaryInstruction("add",Left,Right); printBinaryInstruction("add",Left,Right);
break; break;
case Instruction::Sub: case Instruction::Sub:
case Instruction::FSub:
printBinaryInstruction("sub",Left,Right); printBinaryInstruction("sub",Left,Right);
break; break;
case Instruction::Mul: case Instruction::Mul:
case Instruction::FMul:
printBinaryInstruction("mul",Left,Right); printBinaryInstruction("mul",Left,Right);
break; break;
case Instruction::UDiv: case Instruction::UDiv:
@ -1322,12 +1325,15 @@ void MSILWriter::printConstantExpr(const ConstantExpr* CE) {
printSelectInstruction(CE->getOperand(0),CE->getOperand(1),CE->getOperand(2)); printSelectInstruction(CE->getOperand(0),CE->getOperand(1),CE->getOperand(2));
break; break;
case Instruction::Add: case Instruction::Add:
case Instruction::FAdd:
printBinaryInstruction("add",left,right); printBinaryInstruction("add",left,right);
break; break;
case Instruction::Sub: case Instruction::Sub:
case Instruction::FSub:
printBinaryInstruction("sub",left,right); printBinaryInstruction("sub",left,right);
break; break;
case Instruction::Mul: case Instruction::Mul:
case Instruction::FMul:
printBinaryInstruction("mul",left,right); printBinaryInstruction("mul",left,right);
break; break;
case Instruction::UDiv: case Instruction::UDiv:

View File

@ -59,7 +59,8 @@ cl::opt<bool> EnableLoadPRE("enable-load-pre", cl::init(true));
/// two values. /// two values.
namespace { namespace {
struct VISIBILITY_HIDDEN Expression { struct VISIBILITY_HIDDEN Expression {
enum ExpressionOpcode { ADD, SUB, MUL, UDIV, SDIV, FDIV, UREM, SREM, enum ExpressionOpcode { ADD, FADD, SUB, FSUB, MUL, FMUL,
UDIV, SDIV, FDIV, UREM, SREM,
FREM, SHL, LSHR, ASHR, AND, OR, XOR, ICMPEQ, FREM, SHL, LSHR, ASHR, AND, OR, XOR, ICMPEQ,
ICMPNE, ICMPUGT, ICMPUGE, ICMPULT, ICMPULE, ICMPNE, ICMPUGT, ICMPUGE, ICMPULT, ICMPULE,
ICMPSGT, ICMPSGE, ICMPSLT, ICMPSLE, FCMPOEQ, ICMPSGT, ICMPSGE, ICMPSLT, ICMPSLE, FCMPOEQ,
@ -200,8 +201,11 @@ Expression::ExpressionOpcode ValueTable::getOpcode(BinaryOperator* BO) {
default: // THIS SHOULD NEVER HAPPEN default: // THIS SHOULD NEVER HAPPEN
assert(0 && "Binary operator with unknown opcode?"); assert(0 && "Binary operator with unknown opcode?");
case Instruction::Add: return Expression::ADD; case Instruction::Add: return Expression::ADD;
case Instruction::FAdd: return Expression::FADD;
case Instruction::Sub: return Expression::SUB; case Instruction::Sub: return Expression::SUB;
case Instruction::FSub: return Expression::FSUB;
case Instruction::Mul: return Expression::MUL; case Instruction::Mul: return Expression::MUL;
case Instruction::FMul: return Expression::FMUL;
case Instruction::UDiv: return Expression::UDIV; case Instruction::UDiv: return Expression::UDIV;
case Instruction::SDiv: return Expression::SDIV; case Instruction::SDiv: return Expression::SDIV;
case Instruction::FDiv: return Expression::FDIV; case Instruction::FDiv: return Expression::FDIV;

View File

@ -55,7 +55,8 @@ namespace {
/// two values. /// two values.
struct Expression { struct Expression {
enum ExpressionOpcode { ADD, SUB, MUL, UDIV, SDIV, FDIV, UREM, SREM, enum ExpressionOpcode { ADD, FADD, SUB, FSUB, MUL, FMUL,
UDIV, SDIV, FDIV, UREM, SREM,
FREM, SHL, LSHR, ASHR, AND, OR, XOR, ICMPEQ, FREM, SHL, LSHR, ASHR, AND, OR, XOR, ICMPEQ,
ICMPNE, ICMPUGT, ICMPUGE, ICMPULT, ICMPULE, ICMPNE, ICMPUGT, ICMPUGE, ICMPULT, ICMPULE,
ICMPSGT, ICMPSGE, ICMPSLT, ICMPSLE, FCMPOEQ, ICMPSGT, ICMPSGE, ICMPSLT, ICMPSLE, FCMPOEQ,
@ -202,10 +203,16 @@ Expression::ExpressionOpcode
switch(BO->getOpcode()) { switch(BO->getOpcode()) {
case Instruction::Add: case Instruction::Add:
return Expression::ADD; return Expression::ADD;
case Instruction::FAdd:
return Expression::FADD;
case Instruction::Sub: case Instruction::Sub:
return Expression::SUB; return Expression::SUB;
case Instruction::FSub:
return Expression::FSUB;
case Instruction::Mul: case Instruction::Mul:
return Expression::MUL; return Expression::MUL;
case Instruction::FMul:
return Expression::FMUL;
case Instruction::UDiv: case Instruction::UDiv:
return Expression::UDIV; return Expression::UDIV;
case Instruction::SDiv: case Instruction::SDiv:

View File

@ -754,7 +754,7 @@ void IndVarSimplify::HandleFloatingPointIV(Loop *L, PHINode *PH) {
BinaryOperator *Incr = BinaryOperator *Incr =
dyn_cast<BinaryOperator>(PH->getIncomingValue(BackEdge)); dyn_cast<BinaryOperator>(PH->getIncomingValue(BackEdge));
if (!Incr) return; if (!Incr) return;
if (Incr->getOpcode() != Instruction::Add) return; if (Incr->getOpcode() != Instruction::FAdd) return;
ConstantFP *IncrValue = NULL; ConstantFP *IncrValue = NULL;
unsigned IncrVIndex = 1; unsigned IncrVIndex = 1;
if (Incr->getOperand(1) == PH) if (Incr->getOperand(1) == PH)

View File

@ -167,8 +167,11 @@ namespace {
// otherwise - Change was made, replace I with returned instruction // otherwise - Change was made, replace I with returned instruction
// //
Instruction *visitAdd(BinaryOperator &I); Instruction *visitAdd(BinaryOperator &I);
Instruction *visitFAdd(BinaryOperator &I);
Instruction *visitSub(BinaryOperator &I); Instruction *visitSub(BinaryOperator &I);
Instruction *visitFSub(BinaryOperator &I);
Instruction *visitMul(BinaryOperator &I); Instruction *visitMul(BinaryOperator &I);
Instruction *visitFMul(BinaryOperator &I);
Instruction *visitURem(BinaryOperator &I); Instruction *visitURem(BinaryOperator &I);
Instruction *visitSRem(BinaryOperator &I); Instruction *visitSRem(BinaryOperator &I);
Instruction *visitFRem(BinaryOperator &I); Instruction *visitFRem(BinaryOperator &I);
@ -403,7 +406,8 @@ X("instcombine", "Combine redundant instructions");
// 0 -> undef, 1 -> Const, 2 -> Other, 3 -> Arg, 3 -> Unary, 4 -> OtherInst // 0 -> undef, 1 -> Const, 2 -> Other, 3 -> Arg, 3 -> Unary, 4 -> OtherInst
static unsigned getComplexity(Value *V) { static unsigned getComplexity(Value *V) {
if (isa<Instruction>(V)) { if (isa<Instruction>(V)) {
if (BinaryOperator::isNeg(V) || BinaryOperator::isNot(V)) if (BinaryOperator::isNeg(V) || BinaryOperator::isFNeg(V) ||
BinaryOperator::isNot(V))
return 3; return 3;
return 4; return 4;
} }
@ -576,6 +580,25 @@ static inline Value *dyn_castNegVal(Value *V) {
return 0; return 0;
} }
// dyn_castFNegVal - Given a 'fsub' instruction, return the RHS of the
// instruction if the LHS is a constant negative zero (which is the 'negate'
// form).
//
static inline Value *dyn_castFNegVal(Value *V) {
if (BinaryOperator::isFNeg(V))
return BinaryOperator::getFNegArgument(V);
// Constants can be considered to be negated values if they can be folded.
if (ConstantFP *C = dyn_cast<ConstantFP>(V))
return ConstantExpr::getFNeg(C);
if (ConstantVector *C = dyn_cast<ConstantVector>(V))
if (C->getType()->getElementType()->isFloatingPoint())
return ConstantExpr::getFNeg(C);
return 0;
}
static inline Value *dyn_castNotVal(Value *V) { static inline Value *dyn_castNotVal(Value *V) {
if (BinaryOperator::isNot(V)) if (BinaryOperator::isNot(V))
return BinaryOperator::getNotArgument(V); return BinaryOperator::getNotArgument(V);
@ -1733,12 +1756,12 @@ Value *InstCombiner::SimplifyDemandedVectorElts(Value *V, APInt DemandedElts,
default: assert(0 && "Case stmts out of sync!"); default: assert(0 && "Case stmts out of sync!");
case Intrinsic::x86_sse_sub_ss: case Intrinsic::x86_sse_sub_ss:
case Intrinsic::x86_sse2_sub_sd: case Intrinsic::x86_sse2_sub_sd:
TmpV = InsertNewInstBefore(BinaryOperator::CreateSub(LHS, RHS, TmpV = InsertNewInstBefore(BinaryOperator::CreateFSub(LHS, RHS,
II->getName()), *II); II->getName()), *II);
break; break;
case Intrinsic::x86_sse_mul_ss: case Intrinsic::x86_sse_mul_ss:
case Intrinsic::x86_sse2_mul_sd: case Intrinsic::x86_sse2_mul_sd:
TmpV = InsertNewInstBefore(BinaryOperator::CreateMul(LHS, RHS, TmpV = InsertNewInstBefore(BinaryOperator::CreateFMul(LHS, RHS,
II->getName()), *II); II->getName()), *II);
break; break;
} }
@ -2052,14 +2075,8 @@ Instruction *InstCombiner::visitAdd(BinaryOperator &I) {
return ReplaceInstUsesWith(I, RHS); return ReplaceInstUsesWith(I, RHS);
// X + 0 --> X // X + 0 --> X
if (!I.getType()->isFPOrFPVector()) { // NOTE: -0 + +0 = +0. if (RHSC->isNullValue())
if (RHSC->isNullValue()) return ReplaceInstUsesWith(I, LHS);
return ReplaceInstUsesWith(I, LHS);
} else if (ConstantFP *CFP = dyn_cast<ConstantFP>(RHSC)) {
if (CFP->isExactlyValue(ConstantFP::getNegativeZero
(I.getType())->getValueAPF()))
return ReplaceInstUsesWith(I, LHS);
}
if (ConstantInt *CI = dyn_cast<ConstantInt>(RHSC)) { if (ConstantInt *CI = dyn_cast<ConstantInt>(RHSC)) {
// X + (signbit) --> X ^ signbit // X + (signbit) --> X ^ signbit
@ -2317,11 +2334,6 @@ Instruction *InstCombiner::visitAdd(BinaryOperator &I) {
return SelectInst::Create(SI->getCondition(), A, N); return SelectInst::Create(SI->getCondition(), A, N);
} }
} }
// Check for X+0.0. Simplify it to X if we know X is not -0.0.
if (ConstantFP *CFP = dyn_cast<ConstantFP>(RHS))
if (CFP->getValueAPF().isPosZero() && CannotBeNegativeZero(LHS))
return ReplaceInstUsesWith(I, LHS);
// Check for (add (sext x), y), see if we can merge this into an // Check for (add (sext x), y), see if we can merge this into an
// integer add followed by a sext. // integer add followed by a sext.
@ -2359,7 +2371,42 @@ Instruction *InstCombiner::visitAdd(BinaryOperator &I) {
} }
} }
} }
return Changed ? &I : 0;
}
Instruction *InstCombiner::visitFAdd(BinaryOperator &I) {
bool Changed = SimplifyCommutative(I);
Value *LHS = I.getOperand(0), *RHS = I.getOperand(1);
if (Constant *RHSC = dyn_cast<Constant>(RHS)) {
// X + 0 --> X
if (ConstantFP *CFP = dyn_cast<ConstantFP>(RHSC)) {
if (CFP->isExactlyValue(ConstantFP::getNegativeZero
(I.getType())->getValueAPF()))
return ReplaceInstUsesWith(I, LHS);
}
if (isa<PHINode>(LHS))
if (Instruction *NV = FoldOpIntoPhi(I))
return NV;
}
// -A + B --> B - A
// -A + -B --> -(A + B)
if (Value *LHSV = dyn_castFNegVal(LHS))
return BinaryOperator::CreateFSub(RHS, LHSV);
// A + -B --> A - B
if (!isa<Constant>(RHS))
if (Value *V = dyn_castFNegVal(RHS))
return BinaryOperator::CreateFSub(LHS, V);
// Check for X+0.0. Simplify it to X if we know X is not -0.0.
if (ConstantFP *CFP = dyn_cast<ConstantFP>(RHS))
if (CFP->getValueAPF().isPosZero() && CannotBeNegativeZero(LHS))
return ReplaceInstUsesWith(I, LHS);
// Check for (add double (sitofp x), y), see if we can merge this into an // Check for (add double (sitofp x), y), see if we can merge this into an
// integer add followed by a promotion. // integer add followed by a promotion.
if (SIToFPInst *LHSConv = dyn_cast<SIToFPInst>(LHS)) { if (SIToFPInst *LHSConv = dyn_cast<SIToFPInst>(LHS)) {
@ -2407,8 +2454,7 @@ Instruction *InstCombiner::visitAdd(BinaryOperator &I) {
Instruction *InstCombiner::visitSub(BinaryOperator &I) { Instruction *InstCombiner::visitSub(BinaryOperator &I) {
Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);
if (Op0 == Op1 && // sub X, X -> 0 if (Op0 == Op1) // sub X, X -> 0
!I.getType()->isFPOrFPVector())
return ReplaceInstUsesWith(I, Constant::getNullValue(I.getType())); return ReplaceInstUsesWith(I, Constant::getNullValue(I.getType()));
// If this is a 'B = x-(-A)', change to B = x+A... // If this is a 'B = x-(-A)', change to B = x+A...
@ -2469,8 +2515,7 @@ Instruction *InstCombiner::visitSub(BinaryOperator &I) {
return BinaryOperator::CreateXor(Op0, Op1); return BinaryOperator::CreateXor(Op0, Op1);
if (BinaryOperator *Op1I = dyn_cast<BinaryOperator>(Op1)) { if (BinaryOperator *Op1I = dyn_cast<BinaryOperator>(Op1)) {
if (Op1I->getOpcode() == Instruction::Add && if (Op1I->getOpcode() == Instruction::Add) {
!Op0->getType()->isFPOrFPVector()) {
if (Op1I->getOperand(0) == Op0) // X-(X+Y) == -Y if (Op1I->getOperand(0) == Op0) // X-(X+Y) == -Y
return BinaryOperator::CreateNeg(Op1I->getOperand(1), I.getName()); return BinaryOperator::CreateNeg(Op1I->getOperand(1), I.getName());
else if (Op1I->getOperand(1) == Op0) // X-(Y+X) == -Y else if (Op1I->getOperand(1) == Op0) // X-(Y+X) == -Y
@ -2487,8 +2532,7 @@ Instruction *InstCombiner::visitSub(BinaryOperator &I) {
// Replace (x - (y - z)) with (x + (z - y)) if the (y - z) subexpression // Replace (x - (y - z)) with (x + (z - y)) if the (y - z) subexpression
// is not used by anyone else... // is not used by anyone else...
// //
if (Op1I->getOpcode() == Instruction::Sub && if (Op1I->getOpcode() == Instruction::Sub) {
!Op1I->getType()->isFPOrFPVector()) {
// Swap the two operands of the subexpr... // Swap the two operands of the subexpr...
Value *IIOp0 = Op1I->getOperand(0), *IIOp1 = Op1I->getOperand(1); Value *IIOp0 = Op1I->getOperand(0), *IIOp1 = Op1I->getOperand(1);
Op1I->setOperand(0, IIOp1); Op1I->setOperand(0, IIOp1);
@ -2526,18 +2570,17 @@ Instruction *InstCombiner::visitSub(BinaryOperator &I) {
} }
} }
if (!Op0->getType()->isFPOrFPVector()) if (BinaryOperator *Op0I = dyn_cast<BinaryOperator>(Op0)) {
if (BinaryOperator *Op0I = dyn_cast<BinaryOperator>(Op0)) { if (Op0I->getOpcode() == Instruction::Add) {
if (Op0I->getOpcode() == Instruction::Add) { if (Op0I->getOperand(0) == Op1) // (Y+X)-Y == X
if (Op0I->getOperand(0) == Op1) // (Y+X)-Y == X return ReplaceInstUsesWith(I, Op0I->getOperand(1));
return ReplaceInstUsesWith(I, Op0I->getOperand(1)); else if (Op0I->getOperand(1) == Op1) // (X+Y)-Y == X
else if (Op0I->getOperand(1) == Op1) // (X+Y)-Y == X return ReplaceInstUsesWith(I, Op0I->getOperand(0));
return ReplaceInstUsesWith(I, Op0I->getOperand(0)); } else if (Op0I->getOpcode() == Instruction::Sub) {
} else if (Op0I->getOpcode() == Instruction::Sub) { if (Op0I->getOperand(0) == Op1) // (X-Y)-X == -Y
if (Op0I->getOperand(0) == Op1) // (X-Y)-X == -Y return BinaryOperator::CreateNeg(Op0I->getOperand(1), I.getName());
return BinaryOperator::CreateNeg(Op0I->getOperand(1), I.getName());
}
} }
}
ConstantInt *C1; ConstantInt *C1;
if (Value *X = dyn_castFoldableMul(Op0, C1)) { if (Value *X = dyn_castFoldableMul(Op0, C1)) {
@ -2551,6 +2594,40 @@ Instruction *InstCombiner::visitSub(BinaryOperator &I) {
return 0; return 0;
} }
Instruction *InstCombiner::visitFSub(BinaryOperator &I) {
Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);
// If this is a 'B = x-(-A)', change to B = x+A...
if (Value *V = dyn_castFNegVal(Op1))
return BinaryOperator::CreateFAdd(Op0, V);
if (BinaryOperator *Op1I = dyn_cast<BinaryOperator>(Op1)) {
if (Op1I->getOpcode() == Instruction::FAdd) {
if (Op1I->getOperand(0) == Op0) // X-(X+Y) == -Y
return BinaryOperator::CreateFNeg(Op1I->getOperand(1), I.getName());
else if (Op1I->getOperand(1) == Op0) // X-(Y+X) == -Y
return BinaryOperator::CreateFNeg(Op1I->getOperand(0), I.getName());
}
if (Op1I->hasOneUse()) {
// Replace (x - (y - z)) with (x + (z - y)) if the (y - z) subexpression
// is not used by anyone else...
//
if (Op1I->getOpcode() == Instruction::FSub) {
// Swap the two operands of the subexpr...
Value *IIOp0 = Op1I->getOperand(0), *IIOp1 = Op1I->getOperand(1);
Op1I->setOperand(0, IIOp1);
Op1I->setOperand(1, IIOp0);
// Create the new top level fadd instruction...
return BinaryOperator::CreateFAdd(Op0, Op1);
}
}
}
return 0;
}
/// isSignBitCheck - Given an exploded icmp instruction, return true if the /// isSignBitCheck - Given an exploded icmp instruction, return true if the
/// comparison only checks the sign bit. If it only checks the sign bit, set /// comparison only checks the sign bit. If it only checks the sign bit, set
/// TrueIfSigned if the result of the comparison is true when the input value is /// TrueIfSigned if the result of the comparison is true when the input value is
@ -2613,13 +2690,6 @@ Instruction *InstCombiner::visitMul(BinaryOperator &I) {
return BinaryOperator::CreateShl(Op0, return BinaryOperator::CreateShl(Op0,
ConstantInt::get(Op0->getType(), Val.logBase2())); ConstantInt::get(Op0->getType(), Val.logBase2()));
} }
} else if (ConstantFP *Op1F = dyn_cast<ConstantFP>(Op1)) {
// TODO: If Op1 is zero and Op0 is finite, return zero.
// "In IEEE floating point, x*1 is not equivalent to x for nans. However,
// ANSI says we can drop signals, so we can do this anyway." (from GCC)
if (Op1F->isExactlyValue(1.0))
return ReplaceInstUsesWith(I, Op0); // Eliminate 'mul double %X, 1.0'
} else if (isa<VectorType>(Op1->getType())) { } else if (isa<VectorType>(Op1->getType())) {
// TODO: If Op1 is all zeros and Op0 is all finite, return all zeros. // TODO: If Op1 is all zeros and Op0 is all finite, return all zeros.
@ -2629,9 +2699,6 @@ Instruction *InstCombiner::visitMul(BinaryOperator &I) {
// As above, vector X*splat(1.0) -> X in all defined cases. // As above, vector X*splat(1.0) -> X in all defined cases.
if (Constant *Splat = Op1V->getSplatValue()) { if (Constant *Splat = Op1V->getSplatValue()) {
if (ConstantFP *F = dyn_cast<ConstantFP>(Splat))
if (F->isExactlyValue(1.0))
return ReplaceInstUsesWith(I, Op0);
if (ConstantInt *CI = dyn_cast<ConstantInt>(Splat)) if (ConstantInt *CI = dyn_cast<ConstantInt>(Splat))
if (CI->equalsInt(1)) if (CI->equalsInt(1))
return ReplaceInstUsesWith(I, Op0); return ReplaceInstUsesWith(I, Op0);
@ -2755,6 +2822,45 @@ Instruction *InstCombiner::visitMul(BinaryOperator &I) {
return Changed ? &I : 0; return Changed ? &I : 0;
} }
Instruction *InstCombiner::visitFMul(BinaryOperator &I) {
bool Changed = SimplifyCommutative(I);
Value *Op0 = I.getOperand(0);
// Simplify mul instructions with a constant RHS...
if (Constant *Op1 = dyn_cast<Constant>(I.getOperand(1))) {
if (ConstantFP *Op1F = dyn_cast<ConstantFP>(Op1)) {
// "In IEEE floating point, x*1 is not equivalent to x for nans. However,
// ANSI says we can drop signals, so we can do this anyway." (from GCC)
if (Op1F->isExactlyValue(1.0))
return ReplaceInstUsesWith(I, Op0); // Eliminate 'mul double %X, 1.0'
} else if (isa<VectorType>(Op1->getType())) {
if (ConstantVector *Op1V = dyn_cast<ConstantVector>(Op1)) {
// As above, vector X*splat(1.0) -> X in all defined cases.
if (Constant *Splat = Op1V->getSplatValue()) {
if (ConstantFP *F = dyn_cast<ConstantFP>(Splat))
if (F->isExactlyValue(1.0))
return ReplaceInstUsesWith(I, Op0);
}
}
}
// Try to fold constant mul into select arguments.
if (SelectInst *SI = dyn_cast<SelectInst>(Op0))
if (Instruction *R = FoldOpIntoSelect(I, SI, this))
return R;
if (isa<PHINode>(Op0))
if (Instruction *NV = FoldOpIntoPhi(I))
return NV;
}
if (Value *Op0v = dyn_castFNegVal(Op0)) // -X * -Y = X*Y
if (Value *Op1v = dyn_castFNegVal(I.getOperand(1)))
return BinaryOperator::CreateFMul(Op0v, Op1v);
return Changed ? &I : 0;
}
/// SimplifyDivRemOfSelect - Try to fold a divide or remainder of a select /// SimplifyDivRemOfSelect - Try to fold a divide or remainder of a select
/// instruction. /// instruction.
bool InstCombiner::SimplifyDivRemOfSelect(BinaryOperator &I) { bool InstCombiner::SimplifyDivRemOfSelect(BinaryOperator &I) {
@ -8562,17 +8668,17 @@ Instruction *InstCombiner::visitFPTrunc(FPTruncInst &CI) {
if (Instruction *I = commonCastTransforms(CI)) if (Instruction *I = commonCastTransforms(CI))
return I; return I;
// If we have fptrunc(add (fpextend x), (fpextend y)), where x and y are // If we have fptrunc(fadd (fpextend x), (fpextend y)), where x and y are
// smaller than the destination type, we can eliminate the truncate by doing // smaller than the destination type, we can eliminate the truncate by doing
// the add as the smaller type. This applies to add/sub/mul/div as well as // the add as the smaller type. This applies to fadd/fsub/fmul/fdiv as well as
// many builtins (sqrt, etc). // many builtins (sqrt, etc).
BinaryOperator *OpI = dyn_cast<BinaryOperator>(CI.getOperand(0)); BinaryOperator *OpI = dyn_cast<BinaryOperator>(CI.getOperand(0));
if (OpI && OpI->hasOneUse()) { if (OpI && OpI->hasOneUse()) {
switch (OpI->getOpcode()) { switch (OpI->getOpcode()) {
default: break; default: break;
case Instruction::Add: case Instruction::FAdd:
case Instruction::Sub: case Instruction::FSub:
case Instruction::Mul: case Instruction::FMul:
case Instruction::FDiv: case Instruction::FDiv:
case Instruction::FRem: case Instruction::FRem:
const Type *SrcTy = OpI->getType(); const Type *SrcTy = OpI->getType();
@ -9322,11 +9428,15 @@ Instruction *InstCombiner::visitSelectInst(SelectInst &SI) {
// Turn select C, (X+Y), (X-Y) --> (X+(select C, Y, (-Y))). This is // Turn select C, (X+Y), (X-Y) --> (X+(select C, Y, (-Y))). This is
// even legal for FP. // even legal for FP.
if (TI->getOpcode() == Instruction::Sub && if ((TI->getOpcode() == Instruction::Sub &&
FI->getOpcode() == Instruction::Add) { FI->getOpcode() == Instruction::Add) ||
(TI->getOpcode() == Instruction::FSub &&
FI->getOpcode() == Instruction::FAdd)) {
AddOp = FI; SubOp = TI; AddOp = FI; SubOp = TI;
} else if (FI->getOpcode() == Instruction::Sub && } else if ((FI->getOpcode() == Instruction::Sub &&
TI->getOpcode() == Instruction::Add) { TI->getOpcode() == Instruction::Add) ||
(FI->getOpcode() == Instruction::FSub &&
TI->getOpcode() == Instruction::FAdd)) {
AddOp = TI; SubOp = FI; AddOp = TI; SubOp = FI;
} }

View File

@ -2268,7 +2268,8 @@ void LoopStrengthReduce::OptimizeShadowIV(Loop *L) {
/* create new increment. '++d' in above example. */ /* create new increment. '++d' in above example. */
ConstantFP *CFP = ConstantFP::get(DestTy, C->getZExtValue()); ConstantFP *CFP = ConstantFP::get(DestTy, C->getZExtValue());
BinaryOperator *NewIncr = BinaryOperator *NewIncr =
BinaryOperator::Create(Incr->getOpcode(), BinaryOperator::Create(Incr->getOpcode() == Instruction::Add ?
Instruction::FAdd : Instruction::FSub,
NewPH, CFP, "IV.S.next.", Incr); NewPH, CFP, "IV.S.next.", Incr);
NewPH->addIncoming(NewInit, PH->getIncomingBlock(Entry)); NewPH->addIncoming(NewInit, PH->getIncomingBlock(Entry));

View File

@ -1009,7 +1009,7 @@ struct VISIBILITY_HIDDEN PowOpt : public LibCallOptimization {
if (Op2C->isExactlyValue(1.0)) // pow(x, 1.0) -> x if (Op2C->isExactlyValue(1.0)) // pow(x, 1.0) -> x
return Op1; return Op1;
if (Op2C->isExactlyValue(2.0)) // pow(x, 2.0) -> x*x if (Op2C->isExactlyValue(2.0)) // pow(x, 2.0) -> x*x
return B.CreateMul(Op1, Op1, "pow2"); return B.CreateFMul(Op1, Op1, "pow2");
if (Op2C->isExactlyValue(-1.0)) // pow(x, -1.0) -> 1.0/x if (Op2C->isExactlyValue(-1.0)) // pow(x, -1.0) -> 1.0/x
return B.CreateFDiv(ConstantFP::get(CI->getType(), 1.0), Op1, "powrecip"); return B.CreateFDiv(ConstantFP::get(CI->getType(), 1.0), Op1, "powrecip");
return 0; return 0;

View File

@ -419,9 +419,6 @@ static bool DominatesMergePoint(Value *V, BasicBlock *BB,
case Instruction::LShr: case Instruction::LShr:
case Instruction::AShr: case Instruction::AShr:
case Instruction::ICmp: case Instruction::ICmp:
case Instruction::FCmp:
if (I->getOperand(0)->getType()->isFPOrFPVector())
return false; // FP arithmetic might trap.
break; // These are all cheap and non-trapping instructions. break; // These are all cheap and non-trapping instructions.
} }
@ -1012,9 +1009,8 @@ static bool SpeculativelyExecuteBB(BranchInst *BI, BasicBlock *BB1) {
default: return false; // Not safe / profitable to hoist. default: return false; // Not safe / profitable to hoist.
case Instruction::Add: case Instruction::Add:
case Instruction::Sub: case Instruction::Sub:
// FP arithmetic might trap. Not worth doing for vector ops. // Not worth doing for vector ops.
if (HInst->getType()->isFloatingPoint() if (isa<VectorType>(HInst->getType()))
|| isa<VectorType>(HInst->getType()))
return false; return false;
break; break;
case Instruction::And: case Instruction::And:

View File

@ -602,10 +602,8 @@ Constant *llvm::ConstantFoldBinaryInstruction(unsigned Opcode,
return Constant::getNullValue(C1->getType()); return Constant::getNullValue(C1->getType());
case Instruction::UDiv: case Instruction::UDiv:
case Instruction::SDiv: case Instruction::SDiv:
case Instruction::FDiv:
case Instruction::URem: case Instruction::URem:
case Instruction::SRem: case Instruction::SRem:
case Instruction::FRem:
if (!isa<UndefValue>(C2)) // undef / X -> 0 if (!isa<UndefValue>(C2)) // undef / X -> 0
return Constant::getNullValue(C1->getType()); return Constant::getNullValue(C1->getType());
return const_cast<Constant*>(C2); // X / undef -> undef return const_cast<Constant*>(C2); // X / undef -> undef
@ -783,13 +781,13 @@ Constant *llvm::ConstantFoldBinaryInstruction(unsigned Opcode,
switch (Opcode) { switch (Opcode) {
default: default:
break; break;
case Instruction::Add: case Instruction::FAdd:
(void)C3V.add(C2V, APFloat::rmNearestTiesToEven); (void)C3V.add(C2V, APFloat::rmNearestTiesToEven);
return ConstantFP::get(C3V); return ConstantFP::get(C3V);
case Instruction::Sub: case Instruction::FSub:
(void)C3V.subtract(C2V, APFloat::rmNearestTiesToEven); (void)C3V.subtract(C2V, APFloat::rmNearestTiesToEven);
return ConstantFP::get(C3V); return ConstantFP::get(C3V);
case Instruction::Mul: case Instruction::FMul:
(void)C3V.multiply(C2V, APFloat::rmNearestTiesToEven); (void)C3V.multiply(C2V, APFloat::rmNearestTiesToEven);
return ConstantFP::get(C3V); return ConstantFP::get(C3V);
case Instruction::FDiv: case Instruction::FDiv:
@ -808,12 +806,18 @@ Constant *llvm::ConstantFoldBinaryInstruction(unsigned Opcode,
switch (Opcode) { switch (Opcode) {
default: default:
break; break;
case Instruction::Add: case Instruction::Add:
return EvalVectorOp(CP1, CP2, VTy, ConstantExpr::getAdd); return EvalVectorOp(CP1, CP2, VTy, ConstantExpr::getAdd);
case Instruction::Sub: case Instruction::FAdd:
return EvalVectorOp(CP1, CP2, VTy, ConstantExpr::getFAdd);
case Instruction::Sub:
return EvalVectorOp(CP1, CP2, VTy, ConstantExpr::getSub); return EvalVectorOp(CP1, CP2, VTy, ConstantExpr::getSub);
case Instruction::Mul: case Instruction::FSub:
return EvalVectorOp(CP1, CP2, VTy, ConstantExpr::getFSub);
case Instruction::Mul:
return EvalVectorOp(CP1, CP2, VTy, ConstantExpr::getMul); return EvalVectorOp(CP1, CP2, VTy, ConstantExpr::getMul);
case Instruction::FMul:
return EvalVectorOp(CP1, CP2, VTy, ConstantExpr::getFMul);
case Instruction::UDiv: case Instruction::UDiv:
return EvalVectorOp(CP1, CP2, VTy, ConstantExpr::getUDiv); return EvalVectorOp(CP1, CP2, VTy, ConstantExpr::getUDiv);
case Instruction::SDiv: case Instruction::SDiv:
@ -851,7 +855,9 @@ Constant *llvm::ConstantFoldBinaryInstruction(unsigned Opcode,
// other way if possible. // other way if possible.
switch (Opcode) { switch (Opcode) {
case Instruction::Add: case Instruction::Add:
case Instruction::FAdd:
case Instruction::Mul: case Instruction::Mul:
case Instruction::FMul:
case Instruction::And: case Instruction::And:
case Instruction::Or: case Instruction::Or:
case Instruction::Xor: case Instruction::Xor:
@ -862,6 +868,7 @@ Constant *llvm::ConstantFoldBinaryInstruction(unsigned Opcode,
case Instruction::LShr: case Instruction::LShr:
case Instruction::AShr: case Instruction::AShr:
case Instruction::Sub: case Instruction::Sub:
case Instruction::FSub:
case Instruction::SDiv: case Instruction::SDiv:
case Instruction::UDiv: case Instruction::UDiv:
case Instruction::FDiv: case Instruction::FDiv:

View File

@ -775,26 +775,46 @@ const SmallVector<unsigned, 4> &ConstantExpr::getIndices() const {
/// specify the full Instruction::OPCODE identifier. /// specify the full Instruction::OPCODE identifier.
/// ///
Constant *ConstantExpr::getNeg(Constant *C) { Constant *ConstantExpr::getNeg(Constant *C) {
// API compatibility: Adjust integer opcodes to floating-point opcodes.
if (C->getType()->isFPOrFPVector())
return getFNeg(C);
assert(C->getType()->isIntOrIntVector() &&
"Cannot NEG a nonintegral value!");
return get(Instruction::Sub, return get(Instruction::Sub,
ConstantExpr::getZeroValueForNegationExpr(C->getType()), ConstantExpr::getZeroValueForNegationExpr(C->getType()),
C); C);
} }
Constant *ConstantExpr::getFNeg(Constant *C) {
assert(C->getType()->isFPOrFPVector() &&
"Cannot FNEG a non-floating-point value!");
return get(Instruction::FSub,
ConstantExpr::getZeroValueForNegationExpr(C->getType()),
C);
}
Constant *ConstantExpr::getNot(Constant *C) { Constant *ConstantExpr::getNot(Constant *C) {
assert((isa<IntegerType>(C->getType()) || assert(C->getType()->isIntOrIntVector() &&
cast<VectorType>(C->getType())->getElementType()->isInteger()) && "Cannot NOT a nonintegral value!");
"Cannot NOT a nonintegral value!");
return get(Instruction::Xor, C, return get(Instruction::Xor, C,
Constant::getAllOnesValue(C->getType())); Constant::getAllOnesValue(C->getType()));
} }
Constant *ConstantExpr::getAdd(Constant *C1, Constant *C2) { Constant *ConstantExpr::getAdd(Constant *C1, Constant *C2) {
return get(Instruction::Add, C1, C2); return get(Instruction::Add, C1, C2);
} }
Constant *ConstantExpr::getFAdd(Constant *C1, Constant *C2) {
return get(Instruction::FAdd, C1, C2);
}
Constant *ConstantExpr::getSub(Constant *C1, Constant *C2) { Constant *ConstantExpr::getSub(Constant *C1, Constant *C2) {
return get(Instruction::Sub, C1, C2); return get(Instruction::Sub, C1, C2);
} }
Constant *ConstantExpr::getFSub(Constant *C1, Constant *C2) {
return get(Instruction::FSub, C1, C2);
}
Constant *ConstantExpr::getMul(Constant *C1, Constant *C2) { Constant *ConstantExpr::getMul(Constant *C1, Constant *C2) {
return get(Instruction::Mul, C1, C2); return get(Instruction::Mul, C1, C2);
} }
Constant *ConstantExpr::getFMul(Constant *C1, Constant *C2) {
return get(Instruction::FMul, C1, C2);
}
Constant *ConstantExpr::getUDiv(Constant *C1, Constant *C2) { Constant *ConstantExpr::getUDiv(Constant *C1, Constant *C2) {
return get(Instruction::UDiv, C1, C2); return get(Instruction::UDiv, C1, C2);
} }
@ -2142,15 +2162,28 @@ Constant *ConstantExpr::getCompareTy(unsigned short predicate,
} }
Constant *ConstantExpr::get(unsigned Opcode, Constant *C1, Constant *C2) { Constant *ConstantExpr::get(unsigned Opcode, Constant *C1, Constant *C2) {
// API compatibility: Adjust integer opcodes to floating-point opcodes.
if (C1->getType()->isFPOrFPVector()) {
if (Opcode == Instruction::Add) Opcode = Instruction::FAdd;
else if (Opcode == Instruction::Sub) Opcode = Instruction::FSub;
else if (Opcode == Instruction::Mul) Opcode = Instruction::FMul;
}
#ifndef NDEBUG #ifndef NDEBUG
switch (Opcode) { switch (Opcode) {
case Instruction::Add: case Instruction::Add:
case Instruction::Sub: case Instruction::Sub:
case Instruction::Mul: case Instruction::Mul:
assert(C1->getType() == C2->getType() && "Op types should be identical!"); assert(C1->getType() == C2->getType() && "Op types should be identical!");
assert((C1->getType()->isInteger() || C1->getType()->isFloatingPoint() || assert(C1->getType()->isIntOrIntVector() &&
isa<VectorType>(C1->getType())) && "Tried to create an integer operation on a non-integer type!");
"Tried to create an arithmetic operation on a non-arithmetic type!"); break;
case Instruction::FAdd:
case Instruction::FSub:
case Instruction::FMul:
assert(C1->getType() == C2->getType() && "Op types should be identical!");
assert(C1->getType()->isFPOrFPVector() &&
"Tried to create a floating-point operation on a "
"non-floating-point type!");
break; break;
case Instruction::UDiv: case Instruction::UDiv:
case Instruction::SDiv: case Instruction::SDiv:

View File

@ -101,8 +101,11 @@ const char *Instruction::getOpcodeName(unsigned OpCode) {
// Standard binary operators... // Standard binary operators...
case Add: return "add"; case Add: return "add";
case FAdd: return "fadd";
case Sub: return "sub"; case Sub: return "sub";
case FSub: return "fsub";
case Mul: return "mul"; case Mul: return "mul";
case FMul: return "fmul";
case UDiv: return "udiv"; case UDiv: return "udiv";
case SDiv: return "sdiv"; case SDiv: return "sdiv";
case FDiv: return "fdiv"; case FDiv: return "fdiv";
@ -330,19 +333,13 @@ bool Instruction::mayThrow() const {
/// isAssociative - Return true if the instruction is associative: /// isAssociative - Return true if the instruction is associative:
/// ///
/// Associative operators satisfy: x op (y op z) === (x op y) op z) /// Associative operators satisfy: x op (y op z) === (x op y) op z
/// ///
/// In LLVM, the Add, Mul, And, Or, and Xor operators are associative, when not /// In LLVM, the Add, Mul, And, Or, and Xor operators are associative.
/// applied to floating point types.
/// ///
bool Instruction::isAssociative(unsigned Opcode, const Type *Ty) { bool Instruction::isAssociative(unsigned Opcode, const Type *Ty) {
if (Opcode == And || Opcode == Or || Opcode == Xor) return Opcode == And || Opcode == Or || Opcode == Xor ||
return true; Opcode == Add || Opcode == Mul;
// Add/Mul reassociate unless they are FP or FP vectors.
if (Opcode == Add || Opcode == Mul)
return !Ty->isFPOrFPVector();
return 0;
} }
/// isCommutative - Return true if the instruction is commutative: /// isCommutative - Return true if the instruction is commutative:
@ -355,7 +352,9 @@ bool Instruction::isAssociative(unsigned Opcode, const Type *Ty) {
bool Instruction::isCommutative(unsigned op) { bool Instruction::isCommutative(unsigned op) {
switch (op) { switch (op) {
case Add: case Add:
case FAdd:
case Mul: case Mul:
case FMul:
case And: case And:
case Or: case Or:
case Xor: case Xor:

View File

@ -1502,29 +1502,43 @@ const Type* ExtractValueInst::getIndexedType(const Type *Agg,
// BinaryOperator Class // BinaryOperator Class
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// AdjustIType - Map Add, Sub, and Mul to FAdd, FSub, and FMul when the
/// type is floating-point, to help provide compatibility with an older API.
///
static BinaryOperator::BinaryOps AdjustIType(BinaryOperator::BinaryOps iType,
const Type *Ty) {
// API compatibility: Adjust integer opcodes to floating-point opcodes.
if (Ty->isFPOrFPVector()) {
if (iType == BinaryOperator::Add) iType = BinaryOperator::FAdd;
else if (iType == BinaryOperator::Sub) iType = BinaryOperator::FSub;
else if (iType == BinaryOperator::Mul) iType = BinaryOperator::FMul;
}
return iType;
}
BinaryOperator::BinaryOperator(BinaryOps iType, Value *S1, Value *S2, BinaryOperator::BinaryOperator(BinaryOps iType, Value *S1, Value *S2,
const Type *Ty, const std::string &Name, const Type *Ty, const std::string &Name,
Instruction *InsertBefore) Instruction *InsertBefore)
: Instruction(Ty, iType, : Instruction(Ty, AdjustIType(iType, Ty),
OperandTraits<BinaryOperator>::op_begin(this), OperandTraits<BinaryOperator>::op_begin(this),
OperandTraits<BinaryOperator>::operands(this), OperandTraits<BinaryOperator>::operands(this),
InsertBefore) { InsertBefore) {
Op<0>() = S1; Op<0>() = S1;
Op<1>() = S2; Op<1>() = S2;
init(iType); init(AdjustIType(iType, Ty));
setName(Name); setName(Name);
} }
BinaryOperator::BinaryOperator(BinaryOps iType, Value *S1, Value *S2, BinaryOperator::BinaryOperator(BinaryOps iType, Value *S1, Value *S2,
const Type *Ty, const std::string &Name, const Type *Ty, const std::string &Name,
BasicBlock *InsertAtEnd) BasicBlock *InsertAtEnd)
: Instruction(Ty, iType, : Instruction(Ty, AdjustIType(iType, Ty),
OperandTraits<BinaryOperator>::op_begin(this), OperandTraits<BinaryOperator>::op_begin(this),
OperandTraits<BinaryOperator>::operands(this), OperandTraits<BinaryOperator>::operands(this),
InsertAtEnd) { InsertAtEnd) {
Op<0>() = S1; Op<0>() = S1;
Op<1>() = S2; Op<1>() = S2;
init(iType); init(AdjustIType(iType, Ty));
setName(Name); setName(Name);
} }
@ -1537,12 +1551,19 @@ void BinaryOperator::init(BinaryOps iType) {
#ifndef NDEBUG #ifndef NDEBUG
switch (iType) { switch (iType) {
case Add: case Sub: case Add: case Sub:
case Mul: case Mul:
assert(getType() == LHS->getType() && assert(getType() == LHS->getType() &&
"Arithmetic operation should return same type as operands!"); "Arithmetic operation should return same type as operands!");
assert((getType()->isInteger() || getType()->isFloatingPoint() || assert(getType()->isIntOrIntVector() &&
isa<VectorType>(getType())) && "Tried to create an integer operation on a non-integer type!");
"Tried to create an arithmetic operation on a non-arithmetic type!"); break;
case FAdd: case FSub:
case FMul:
assert(getType() == LHS->getType() &&
"Arithmetic operation should return same type as operands!");
assert(getType()->isFPOrFPVector() &&
"Tried to create a floating-point operation on a "
"non-floating-point type!");
break; break;
case UDiv: case UDiv:
case SDiv: case SDiv:
@ -1631,6 +1652,22 @@ BinaryOperator *BinaryOperator::CreateNeg(Value *Op, const std::string &Name,
Op->getType(), Name, InsertAtEnd); Op->getType(), Name, InsertAtEnd);
} }
BinaryOperator *BinaryOperator::CreateFNeg(Value *Op, const std::string &Name,
Instruction *InsertBefore) {
Value *zero = ConstantExpr::getZeroValueForNegationExpr(Op->getType());
return new BinaryOperator(Instruction::FSub,
zero, Op,
Op->getType(), Name, InsertBefore);
}
BinaryOperator *BinaryOperator::CreateFNeg(Value *Op, const std::string &Name,
BasicBlock *InsertAtEnd) {
Value *zero = ConstantExpr::getZeroValueForNegationExpr(Op->getType());
return new BinaryOperator(Instruction::FSub,
zero, Op,
Op->getType(), Name, InsertAtEnd);
}
BinaryOperator *BinaryOperator::CreateNot(Value *Op, const std::string &Name, BinaryOperator *BinaryOperator::CreateNot(Value *Op, const std::string &Name,
Instruction *InsertBefore) { Instruction *InsertBefore) {
Constant *C; Constant *C;
@ -1679,6 +1716,14 @@ bool BinaryOperator::isNeg(const Value *V) {
return false; return false;
} }
bool BinaryOperator::isFNeg(const Value *V) {
if (const BinaryOperator *Bop = dyn_cast<BinaryOperator>(V))
if (Bop->getOpcode() == Instruction::FSub)
return Bop->getOperand(0) ==
ConstantExpr::getZeroValueForNegationExpr(Bop->getType());
return false;
}
bool BinaryOperator::isNot(const Value *V) { bool BinaryOperator::isNot(const Value *V) {
if (const BinaryOperator *Bop = dyn_cast<BinaryOperator>(V)) if (const BinaryOperator *Bop = dyn_cast<BinaryOperator>(V))
return (Bop->getOpcode() == Instruction::Xor && return (Bop->getOpcode() == Instruction::Xor &&
@ -1696,6 +1741,15 @@ const Value *BinaryOperator::getNegArgument(const Value *BinOp) {
return getNegArgument(const_cast<Value*>(BinOp)); return getNegArgument(const_cast<Value*>(BinOp));
} }
Value *BinaryOperator::getFNegArgument(Value *BinOp) {
assert(isFNeg(BinOp) && "getFNegArgument from non-'fneg' instruction!");
return cast<BinaryOperator>(BinOp)->getOperand(1);
}
const Value *BinaryOperator::getFNegArgument(const Value *BinOp) {
return getFNegArgument(const_cast<Value*>(BinOp));
}
Value *BinaryOperator::getNotArgument(Value *BinOp) { Value *BinaryOperator::getNotArgument(Value *BinOp) {
assert(isNot(BinOp) && "getNotArgument on non-'not' instruction!"); assert(isNot(BinOp) && "getNotArgument on non-'not' instruction!");
BinaryOperator *BO = cast<BinaryOperator>(BinOp); BinaryOperator *BO = cast<BinaryOperator>(BinOp);

View File

@ -18,7 +18,7 @@ bb1: ; preds = %bb1, %bb1.thread
%2 = sext i9 %1 to i64 ; <i64> [#uses=1] %2 = sext i9 %1 to i64 ; <i64> [#uses=1]
%3 = getelementptr double* %x, i64 %2 ; <double*> [#uses=1] %3 = getelementptr double* %x, i64 %2 ; <double*> [#uses=1]
%4 = load double* %3, align 8 ; <double> [#uses=1] %4 = load double* %3, align 8 ; <double> [#uses=1]
%5 = mul double %4, 3.900000e+00 ; <double> [#uses=1] %5 = fmul double %4, 3.900000e+00 ; <double> [#uses=1]
%6 = sext i8 %0 to i64 ; <i64> [#uses=1] %6 = sext i8 %0 to i64 ; <i64> [#uses=1]
%7 = getelementptr double* %x, i64 %6 ; <double*> [#uses=1] %7 = getelementptr double* %x, i64 %6 ; <double*> [#uses=1]
store double %5, double* %7, align 8 store double %5, double* %7, align 8

View File

@ -18,7 +18,7 @@ bb1: ; preds = %bb1, %bb1.thread
%2 = sext i9 %1 to i64 ; <i64> [#uses=1] %2 = sext i9 %1 to i64 ; <i64> [#uses=1]
%3 = getelementptr double* %x, i64 %2 ; <double*> [#uses=1] %3 = getelementptr double* %x, i64 %2 ; <double*> [#uses=1]
%4 = load double* %3, align 8 ; <double> [#uses=1] %4 = load double* %3, align 8 ; <double> [#uses=1]
%5 = mul double %4, 3.900000e+00 ; <double> [#uses=1] %5 = fmul double %4, 3.900000e+00 ; <double> [#uses=1]
%6 = sext i7 %0 to i64 ; <i64> [#uses=1] %6 = sext i7 %0 to i64 ; <i64> [#uses=1]
%7 = getelementptr double* %x, i64 %6 ; <double*> [#uses=1] %7 = getelementptr double* %x, i64 %6 ; <double*> [#uses=1]
store double %5, double* %7, align 8 store double %5, double* %7, align 8
@ -41,7 +41,7 @@ bb1: ; preds = %bb1, %bb1.thread
%2 = sext i9 %1 to i64 ; <i64> [#uses=1] %2 = sext i9 %1 to i64 ; <i64> [#uses=1]
%3 = getelementptr double* %x, i64 %2 ; <double*> [#uses=1] %3 = getelementptr double* %x, i64 %2 ; <double*> [#uses=1]
%4 = load double* %3, align 8 ; <double> [#uses=1] %4 = load double* %3, align 8 ; <double> [#uses=1]
%5 = mul double %4, 3.900000e+00 ; <double> [#uses=1] %5 = fmul double %4, 3.900000e+00 ; <double> [#uses=1]
%6 = sext i8 %0 to i64 ; <i64> [#uses=1] %6 = sext i8 %0 to i64 ; <i64> [#uses=1]
%7 = getelementptr double* %x, i64 %6 ; <double*> [#uses=1] %7 = getelementptr double* %x, i64 %6 ; <double*> [#uses=1]
store double %5, double* %7, align 8 store double %5, double* %7, align 8
@ -64,7 +64,7 @@ bb1: ; preds = %bb1, %bb1.thread
%2 = sext i9 %1 to i64 ; <i64> [#uses=1] %2 = sext i9 %1 to i64 ; <i64> [#uses=1]
%3 = getelementptr double* %x, i64 %2 ; <double*> [#uses=1] %3 = getelementptr double* %x, i64 %2 ; <double*> [#uses=1]
%4 = load double* %3, align 8 ; <double> [#uses=1] %4 = load double* %3, align 8 ; <double> [#uses=1]
%5 = mul double %4, 3.900000e+00 ; <double> [#uses=1] %5 = fmul double %4, 3.900000e+00 ; <double> [#uses=1]
%6 = sext i8 %0 to i64 ; <i64> [#uses=1] %6 = sext i8 %0 to i64 ; <i64> [#uses=1]
%7 = getelementptr double* %x, i64 %6 ; <double*> [#uses=1] %7 = getelementptr double* %x, i64 %6 ; <double*> [#uses=1]
store double %5, double* %7, align 8 store double %5, double* %7, align 8
@ -87,7 +87,7 @@ bb1: ; preds = %bb1, %bb1.thread
%2 = sext i9 %1 to i64 ; <i64> [#uses=1] %2 = sext i9 %1 to i64 ; <i64> [#uses=1]
%3 = getelementptr double* %x, i64 %2 ; <double*> [#uses=1] %3 = getelementptr double* %x, i64 %2 ; <double*> [#uses=1]
%4 = load double* %3, align 8 ; <double> [#uses=1] %4 = load double* %3, align 8 ; <double> [#uses=1]
%5 = mul double %4, 3.900000e+00 ; <double> [#uses=1] %5 = fmul double %4, 3.900000e+00 ; <double> [#uses=1]
%6 = sext i8 %0 to i64 ; <i64> [#uses=1] %6 = sext i8 %0 to i64 ; <i64> [#uses=1]
%7 = getelementptr double* %x, i64 %6 ; <double*> [#uses=1] %7 = getelementptr double* %x, i64 %6 ; <double*> [#uses=1]
store double %5, double* %7, align 8 store double %5, double* %7, align 8

View File

@ -13,7 +13,7 @@ loop: ; preds = %loop, %entry
%indvar.i8 = ashr i64 %s0, 8 ; <i64> [#uses=1] %indvar.i8 = ashr i64 %s0, 8 ; <i64> [#uses=1]
%t0 = getelementptr double* %d, i64 %indvar.i8 ; <double*> [#uses=2] %t0 = getelementptr double* %d, i64 %indvar.i8 ; <double*> [#uses=2]
%t1 = load double* %t0 ; <double> [#uses=1] %t1 = load double* %t0 ; <double> [#uses=1]
%t2 = mul double %t1, 1.000000e-01 ; <double> [#uses=1] %t2 = fmul double %t1, 1.000000e-01 ; <double> [#uses=1]
store double %t2, double* %t0 store double %t2, double* %t0
%indvar.next = sub i64 %indvar, 1 ; <i64> [#uses=2] %indvar.next = sub i64 %indvar, 1 ; <i64> [#uses=2]
%exitcond = icmp eq i64 %indvar.next, 10 ; <i1> [#uses=1] %exitcond = icmp eq i64 %indvar.next, 10 ; <i1> [#uses=1]

View File

@ -11,6 +11,6 @@
; RUN: diff %t.1 %t.2 ; RUN: diff %t.1 %t.2
define double @test() { define double @test() {
%tmp = mul double 7.200000e+101, 0x427F4000 ; <double> [#uses=1] %tmp = fmul double 7.200000e+101, 0x427F4000 ; <double> [#uses=1]
ret double %tmp ret double %tmp
} }

View File

@ -3,7 +3,7 @@
; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | grep 0x7FF0000000000000 ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | grep 0x7FF0000000000000
define float @test() { define float @test() {
%tmp = mul float 0x7FF0000000000000, 1.000000e+01 ; <float> [#uses=1] %tmp = fmul float 0x7FF0000000000000, 1.000000e+01 ; <float> [#uses=1]
ret float %tmp ret float %tmp
} }

View File

@ -35,8 +35,8 @@ cond_next589: ; preds = %cond_next489
%tmp612 = load i32* null ; <i32> [#uses=1] %tmp612 = load i32* null ; <i32> [#uses=1]
%tmp629 = load i32* null ; <i32> [#uses=1] %tmp629 = load i32* null ; <i32> [#uses=1]
%tmp629a = sitofp i32 %tmp629 to double ; <double> [#uses=1] %tmp629a = sitofp i32 %tmp629 to double ; <double> [#uses=1]
%tmp631 = mul double %tmp629a, 0.000000e+00 ; <double> [#uses=1] %tmp631 = fmul double %tmp629a, 0.000000e+00 ; <double> [#uses=1]
%tmp632 = add double 0.000000e+00, %tmp631 ; <double> [#uses=1] %tmp632 = fadd double 0.000000e+00, %tmp631 ; <double> [#uses=1]
%tmp642 = call fastcc i32 @sign( i32 %tmp576, i32 %tmp561 ) ; <i32> [#uses=1] %tmp642 = call fastcc i32 @sign( i32 %tmp576, i32 %tmp561 ) ; <i32> [#uses=1]
%tmp650 = mul i32 %tmp606, %tmp642 ; <i32> [#uses=1] %tmp650 = mul i32 %tmp606, %tmp642 ; <i32> [#uses=1]
%tmp656 = mul i32 %tmp650, %tmp612 ; <i32> [#uses=1] %tmp656 = mul i32 %tmp650, %tmp612 ; <i32> [#uses=1]
@ -46,8 +46,8 @@ cond_next589: ; preds = %cond_next489
%tmp666 = sub i32 %tmp660, %tmp496 ; <i32> [#uses=1] %tmp666 = sub i32 %tmp660, %tmp496 ; <i32> [#uses=1]
%tmp667 = sitofp i32 %tmp666 to double ; <double> [#uses=2] %tmp667 = sitofp i32 %tmp666 to double ; <double> [#uses=2]
call void @levrun_linfo_inter( i32 %tmp576, i32 0, i32* null, i32* null ) call void @levrun_linfo_inter( i32 %tmp576, i32 0, i32* null, i32* null )
%tmp671 = mul double %tmp667, %tmp667 ; <double> [#uses=1] %tmp671 = fmul double %tmp667, %tmp667 ; <double> [#uses=1]
%tmp675 = add double %tmp671, 0.000000e+00 ; <double> [#uses=1] %tmp675 = fadd double %tmp671, 0.000000e+00 ; <double> [#uses=1]
%tmp678 = fcmp oeq double %tmp632, %tmp675 ; <i1> [#uses=1] %tmp678 = fcmp oeq double %tmp632, %tmp675 ; <i1> [#uses=1]
br i1 %tmp678, label %cond_true679, label %cond_false693 br i1 %tmp678, label %cond_true679, label %cond_false693

View File

@ -11,7 +11,7 @@ bb.thread:
br label %bb52 br label %bb52
bb32: ; preds = %bb52 bb32: ; preds = %bb52
%0 = add double 0.000000e+00, 0.000000e+00 ; <double> [#uses=1] %0 = fadd double 0.000000e+00, 0.000000e+00 ; <double> [#uses=1]
%1 = add i32 %j.1, 1 ; <i32> [#uses=1] %1 = add i32 %j.1, 1 ; <i32> [#uses=1]
br label %bb52 br label %bb52
@ -29,14 +29,14 @@ bb53: ; preds = %bb52
bb55: ; preds = %bb53 bb55: ; preds = %bb53
%4 = load double* @a, align 4 ; <double> [#uses=10] %4 = load double* @a, align 4 ; <double> [#uses=10]
%5 = add double %4, 0.000000e+00 ; <double> [#uses=16] %5 = fadd double %4, 0.000000e+00 ; <double> [#uses=16]
%6 = fcmp ogt double %k.4, 0.000000e+00 ; <i1> [#uses=1] %6 = fcmp ogt double %k.4, 0.000000e+00 ; <i1> [#uses=1]
%.pn404 = mul double %4, %4 ; <double> [#uses=4] %.pn404 = fmul double %4, %4 ; <double> [#uses=4]
%.pn402 = mul double %5, %5 ; <double> [#uses=5] %.pn402 = fmul double %5, %5 ; <double> [#uses=5]
%.pn165.in = load double* @N ; <double> [#uses=5] %.pn165.in = load double* @N ; <double> [#uses=5]
%.pn198 = mul double 0.000000e+00, %5 ; <double> [#uses=1] %.pn198 = fmul double 0.000000e+00, %5 ; <double> [#uses=1]
%.pn185 = sub double -0.000000e+00, 0.000000e+00 ; <double> [#uses=1] %.pn185 = fsub double -0.000000e+00, 0.000000e+00 ; <double> [#uses=1]
%.pn147 = sub double -0.000000e+00, 0.000000e+00 ; <double> [#uses=1] %.pn147 = fsub double -0.000000e+00, 0.000000e+00 ; <double> [#uses=1]
%.pn141 = fdiv double 0.000000e+00, %4 ; <double> [#uses=1] %.pn141 = fdiv double 0.000000e+00, %4 ; <double> [#uses=1]
%.pn142 = fdiv double 0.000000e+00, %5 ; <double> [#uses=1] %.pn142 = fdiv double 0.000000e+00, %5 ; <double> [#uses=1]
%.pn136 = fdiv double 0.000000e+00, 0.000000e+00 ; <double> [#uses=1] %.pn136 = fdiv double 0.000000e+00, 0.000000e+00 ; <double> [#uses=1]
@ -47,178 +47,178 @@ bb55: ; preds = %bb53
%.pn117 = fdiv double 0.000000e+00, %4 ; <double> [#uses=1] %.pn117 = fdiv double 0.000000e+00, %4 ; <double> [#uses=1]
%.pn118 = fdiv double %.pn185, %5 ; <double> [#uses=1] %.pn118 = fdiv double %.pn185, %5 ; <double> [#uses=1]
%.pn88 = fdiv double %.pn147, %5 ; <double> [#uses=1] %.pn88 = fdiv double %.pn147, %5 ; <double> [#uses=1]
%.pn81 = sub double %.pn141, %.pn142 ; <double> [#uses=1] %.pn81 = fsub double %.pn141, %.pn142 ; <double> [#uses=1]
%.pn77 = sub double 0.000000e+00, %.pn136 ; <double> [#uses=1] %.pn77 = fsub double 0.000000e+00, %.pn136 ; <double> [#uses=1]
%.pn75 = sub double 0.000000e+00, %.pn132 ; <double> [#uses=1] %.pn75 = fsub double 0.000000e+00, %.pn132 ; <double> [#uses=1]
%.pn69 = sub double %.pn123, %.pn124 ; <double> [#uses=1] %.pn69 = fsub double %.pn123, %.pn124 ; <double> [#uses=1]
%.pn67 = sub double 0.000000e+00, %.pn120 ; <double> [#uses=1] %.pn67 = fsub double 0.000000e+00, %.pn120 ; <double> [#uses=1]
%.pn56 = sub double %.pn117, %.pn118 ; <double> [#uses=1] %.pn56 = fsub double %.pn117, %.pn118 ; <double> [#uses=1]
%.pn42 = sub double 0.000000e+00, %.pn88 ; <double> [#uses=1] %.pn42 = fsub double 0.000000e+00, %.pn88 ; <double> [#uses=1]
%.pn60 = mul double %.pn81, 0.000000e+00 ; <double> [#uses=1] %.pn60 = fmul double %.pn81, 0.000000e+00 ; <double> [#uses=1]
%.pn57 = add double %.pn77, 0.000000e+00 ; <double> [#uses=1] %.pn57 = fadd double %.pn77, 0.000000e+00 ; <double> [#uses=1]
%.pn58 = mul double %.pn75, %.pn165.in ; <double> [#uses=1] %.pn58 = fmul double %.pn75, %.pn165.in ; <double> [#uses=1]
%.pn32 = add double %.pn69, 0.000000e+00 ; <double> [#uses=1] %.pn32 = fadd double %.pn69, 0.000000e+00 ; <double> [#uses=1]
%.pn33 = mul double %.pn67, %.pn165.in ; <double> [#uses=1] %.pn33 = fmul double %.pn67, %.pn165.in ; <double> [#uses=1]
%.pn17 = sub double 0.000000e+00, %.pn60 ; <double> [#uses=1] %.pn17 = fsub double 0.000000e+00, %.pn60 ; <double> [#uses=1]
%.pn9 = add double %.pn57, %.pn58 ; <double> [#uses=1] %.pn9 = fadd double %.pn57, %.pn58 ; <double> [#uses=1]
%.pn30 = mul double 0.000000e+00, %.pn56 ; <double> [#uses=1] %.pn30 = fmul double 0.000000e+00, %.pn56 ; <double> [#uses=1]
%.pn24 = mul double 0.000000e+00, %.pn42 ; <double> [#uses=1] %.pn24 = fmul double 0.000000e+00, %.pn42 ; <double> [#uses=1]
%.pn1 = add double %.pn32, %.pn33 ; <double> [#uses=1] %.pn1 = fadd double %.pn32, %.pn33 ; <double> [#uses=1]
%.pn28 = sub double %.pn30, 0.000000e+00 ; <double> [#uses=1] %.pn28 = fsub double %.pn30, 0.000000e+00 ; <double> [#uses=1]
%.pn26 = add double %.pn28, 0.000000e+00 ; <double> [#uses=1] %.pn26 = fadd double %.pn28, 0.000000e+00 ; <double> [#uses=1]
%.pn22 = sub double %.pn26, 0.000000e+00 ; <double> [#uses=1] %.pn22 = fsub double %.pn26, 0.000000e+00 ; <double> [#uses=1]
%.pn20 = sub double %.pn24, 0.000000e+00 ; <double> [#uses=1] %.pn20 = fsub double %.pn24, 0.000000e+00 ; <double> [#uses=1]
%.pn18 = add double %.pn22, 0.000000e+00 ; <double> [#uses=1] %.pn18 = fadd double %.pn22, 0.000000e+00 ; <double> [#uses=1]
%.pn16 = add double %.pn20, 0.000000e+00 ; <double> [#uses=1] %.pn16 = fadd double %.pn20, 0.000000e+00 ; <double> [#uses=1]
%.pn14 = sub double %.pn18, 0.000000e+00 ; <double> [#uses=1] %.pn14 = fsub double %.pn18, 0.000000e+00 ; <double> [#uses=1]
%.pn12 = sub double %.pn16, %.pn17 ; <double> [#uses=1] %.pn12 = fsub double %.pn16, %.pn17 ; <double> [#uses=1]
%.pn10 = add double %.pn14, 0.000000e+00 ; <double> [#uses=1] %.pn10 = fadd double %.pn14, 0.000000e+00 ; <double> [#uses=1]
%.pn8 = add double %.pn12, 0.000000e+00 ; <double> [#uses=1] %.pn8 = fadd double %.pn12, 0.000000e+00 ; <double> [#uses=1]
%.pn6 = sub double %.pn10, 0.000000e+00 ; <double> [#uses=1] %.pn6 = fsub double %.pn10, 0.000000e+00 ; <double> [#uses=1]
%.pn4 = sub double %.pn8, %.pn9 ; <double> [#uses=1] %.pn4 = fsub double %.pn8, %.pn9 ; <double> [#uses=1]
%.pn2 = add double %.pn6, 0.000000e+00 ; <double> [#uses=1] %.pn2 = fadd double %.pn6, 0.000000e+00 ; <double> [#uses=1]
%.pn = add double %.pn4, 0.000000e+00 ; <double> [#uses=1] %.pn = fadd double %.pn4, 0.000000e+00 ; <double> [#uses=1]
%N1.0 = sub double %.pn2, 0.000000e+00 ; <double> [#uses=2] %N1.0 = fsub double %.pn2, 0.000000e+00 ; <double> [#uses=2]
%D1.0 = sub double %.pn, %.pn1 ; <double> [#uses=2] %D1.0 = fsub double %.pn, %.pn1 ; <double> [#uses=2]
br i1 %6, label %bb62, label %bb64 br i1 %6, label %bb62, label %bb64
bb62: ; preds = %bb55 bb62: ; preds = %bb55
%7 = mul double 0.000000e+00, %4 ; <double> [#uses=1] %7 = fmul double 0.000000e+00, %4 ; <double> [#uses=1]
%8 = sub double -0.000000e+00, %7 ; <double> [#uses=3] %8 = fsub double -0.000000e+00, %7 ; <double> [#uses=3]
%9 = mul double 0.000000e+00, %5 ; <double> [#uses=1] %9 = fmul double 0.000000e+00, %5 ; <double> [#uses=1]
%10 = sub double -0.000000e+00, %9 ; <double> [#uses=3] %10 = fsub double -0.000000e+00, %9 ; <double> [#uses=3]
%11 = mul double %.pn404, %4 ; <double> [#uses=5] %11 = fmul double %.pn404, %4 ; <double> [#uses=5]
%12 = mul double %.pn402, %5 ; <double> [#uses=5] %12 = fmul double %.pn402, %5 ; <double> [#uses=5]
%13 = mul double 0.000000e+00, -2.000000e+00 ; <double> [#uses=1] %13 = fmul double 0.000000e+00, -2.000000e+00 ; <double> [#uses=1]
%14 = fdiv double 0.000000e+00, %.pn402 ; <double> [#uses=1] %14 = fdiv double 0.000000e+00, %.pn402 ; <double> [#uses=1]
%15 = sub double 0.000000e+00, %14 ; <double> [#uses=1] %15 = fsub double 0.000000e+00, %14 ; <double> [#uses=1]
%16 = mul double 0.000000e+00, %15 ; <double> [#uses=1] %16 = fmul double 0.000000e+00, %15 ; <double> [#uses=1]
%17 = add double %13, %16 ; <double> [#uses=1] %17 = fadd double %13, %16 ; <double> [#uses=1]
%18 = mul double %.pn165.in, -2.000000e+00 ; <double> [#uses=5] %18 = fmul double %.pn165.in, -2.000000e+00 ; <double> [#uses=5]
%19 = mul double %18, 0.000000e+00 ; <double> [#uses=1] %19 = fmul double %18, 0.000000e+00 ; <double> [#uses=1]
%20 = add double %17, %19 ; <double> [#uses=1] %20 = fadd double %17, %19 ; <double> [#uses=1]
%21 = mul double 0.000000e+00, %20 ; <double> [#uses=1] %21 = fmul double 0.000000e+00, %20 ; <double> [#uses=1]
%22 = add double 0.000000e+00, %21 ; <double> [#uses=1] %22 = fadd double 0.000000e+00, %21 ; <double> [#uses=1]
%23 = fdiv double 0.000000e+00, %12 ; <double> [#uses=1] %23 = fdiv double 0.000000e+00, %12 ; <double> [#uses=1]
%24 = sub double 0.000000e+00, %23 ; <double> [#uses=0] %24 = fsub double 0.000000e+00, %23 ; <double> [#uses=0]
%25 = mul double %18, 0.000000e+00 ; <double> [#uses=1] %25 = fmul double %18, 0.000000e+00 ; <double> [#uses=1]
%26 = add double 0.000000e+00, %25 ; <double> [#uses=1] %26 = fadd double 0.000000e+00, %25 ; <double> [#uses=1]
%27 = mul double 0.000000e+00, %26 ; <double> [#uses=1] %27 = fmul double 0.000000e+00, %26 ; <double> [#uses=1]
%28 = sub double %22, %27 ; <double> [#uses=1] %28 = fsub double %22, %27 ; <double> [#uses=1]
%29 = mul double %11, %4 ; <double> [#uses=1] %29 = fmul double %11, %4 ; <double> [#uses=1]
%30 = mul double %12, %5 ; <double> [#uses=3] %30 = fmul double %12, %5 ; <double> [#uses=3]
%31 = mul double %.pn165.in, -4.000000e+00 ; <double> [#uses=1] %31 = fmul double %.pn165.in, -4.000000e+00 ; <double> [#uses=1]
%32 = mul double %.pn165.in, 0x3FF5555555555555 ; <double> [#uses=1] %32 = fmul double %.pn165.in, 0x3FF5555555555555 ; <double> [#uses=1]
%33 = mul double %32, 0.000000e+00 ; <double> [#uses=2] %33 = fmul double %32, 0.000000e+00 ; <double> [#uses=2]
%34 = add double %28, 0.000000e+00 ; <double> [#uses=1] %34 = fadd double %28, 0.000000e+00 ; <double> [#uses=1]
%35 = sub double -0.000000e+00, 0.000000e+00 ; <double> [#uses=1] %35 = fsub double -0.000000e+00, 0.000000e+00 ; <double> [#uses=1]
%36 = fdiv double %35, %11 ; <double> [#uses=1] %36 = fdiv double %35, %11 ; <double> [#uses=1]
%37 = fdiv double 0.000000e+00, %12 ; <double> [#uses=1] %37 = fdiv double 0.000000e+00, %12 ; <double> [#uses=1]
%38 = sub double %36, %37 ; <double> [#uses=1] %38 = fsub double %36, %37 ; <double> [#uses=1]
%39 = mul double 0.000000e+00, %38 ; <double> [#uses=1] %39 = fmul double 0.000000e+00, %38 ; <double> [#uses=1]
%40 = add double 0.000000e+00, %39 ; <double> [#uses=1] %40 = fadd double 0.000000e+00, %39 ; <double> [#uses=1]
%41 = add double %40, 0.000000e+00 ; <double> [#uses=1] %41 = fadd double %40, 0.000000e+00 ; <double> [#uses=1]
%42 = add double %41, 0.000000e+00 ; <double> [#uses=1] %42 = fadd double %41, 0.000000e+00 ; <double> [#uses=1]
%43 = mul double %42, 0.000000e+00 ; <double> [#uses=1] %43 = fmul double %42, 0.000000e+00 ; <double> [#uses=1]
%44 = sub double %34, %43 ; <double> [#uses=1] %44 = fsub double %34, %43 ; <double> [#uses=1]
%45 = tail call double @llvm.exp.f64(double %8) nounwind ; <double> [#uses=1] %45 = tail call double @llvm.exp.f64(double %8) nounwind ; <double> [#uses=1]
%46 = sub double -0.000000e+00, %45 ; <double> [#uses=2] %46 = fsub double -0.000000e+00, %45 ; <double> [#uses=2]
%47 = fdiv double %46, 0.000000e+00 ; <double> [#uses=1] %47 = fdiv double %46, 0.000000e+00 ; <double> [#uses=1]
%48 = mul double %30, %5 ; <double> [#uses=1] %48 = fmul double %30, %5 ; <double> [#uses=1]
%49 = fdiv double 0.000000e+00, %48 ; <double> [#uses=1] %49 = fdiv double 0.000000e+00, %48 ; <double> [#uses=1]
%50 = sub double %47, %49 ; <double> [#uses=1] %50 = fsub double %47, %49 ; <double> [#uses=1]
%51 = mul double %50, -4.000000e+00 ; <double> [#uses=1] %51 = fmul double %50, -4.000000e+00 ; <double> [#uses=1]
%52 = add double %51, 0.000000e+00 ; <double> [#uses=1] %52 = fadd double %51, 0.000000e+00 ; <double> [#uses=1]
%53 = fdiv double %46, %11 ; <double> [#uses=1] %53 = fdiv double %46, %11 ; <double> [#uses=1]
%54 = sub double %53, 0.000000e+00 ; <double> [#uses=1] %54 = fsub double %53, 0.000000e+00 ; <double> [#uses=1]
%55 = mul double %31, %54 ; <double> [#uses=1] %55 = fmul double %31, %54 ; <double> [#uses=1]
%56 = add double %52, %55 ; <double> [#uses=1] %56 = fadd double %52, %55 ; <double> [#uses=1]
%57 = add double %56, 0.000000e+00 ; <double> [#uses=1] %57 = fadd double %56, 0.000000e+00 ; <double> [#uses=1]
%58 = add double %44, %57 ; <double> [#uses=1] %58 = fadd double %44, %57 ; <double> [#uses=1]
%59 = sub double %58, 0.000000e+00 ; <double> [#uses=1] %59 = fsub double %58, 0.000000e+00 ; <double> [#uses=1]
%60 = tail call double @llvm.exp.f64(double 0.000000e+00) nounwind ; <double> [#uses=1] %60 = tail call double @llvm.exp.f64(double 0.000000e+00) nounwind ; <double> [#uses=1]
%61 = sub double -0.000000e+00, %60 ; <double> [#uses=1] %61 = fsub double -0.000000e+00, %60 ; <double> [#uses=1]
%62 = fdiv double 0.000000e+00, -6.000000e+00 ; <double> [#uses=1] %62 = fdiv double 0.000000e+00, -6.000000e+00 ; <double> [#uses=1]
%63 = fdiv double %61, %5 ; <double> [#uses=1] %63 = fdiv double %61, %5 ; <double> [#uses=1]
%64 = sub double 0.000000e+00, %63 ; <double> [#uses=1] %64 = fsub double 0.000000e+00, %63 ; <double> [#uses=1]
%65 = mul double %62, %64 ; <double> [#uses=1] %65 = fmul double %62, %64 ; <double> [#uses=1]
%66 = sub double 0.000000e+00, %65 ; <double> [#uses=1] %66 = fsub double 0.000000e+00, %65 ; <double> [#uses=1]
%67 = sub double -0.000000e+00, 0.000000e+00 ; <double> [#uses=2] %67 = fsub double -0.000000e+00, 0.000000e+00 ; <double> [#uses=2]
%68 = tail call double @llvm.exp.f64(double %10) nounwind ; <double> [#uses=1] %68 = tail call double @llvm.exp.f64(double %10) nounwind ; <double> [#uses=1]
%69 = sub double -0.000000e+00, %68 ; <double> [#uses=2] %69 = fsub double -0.000000e+00, %68 ; <double> [#uses=2]
%70 = fdiv double %67, %.pn404 ; <double> [#uses=1] %70 = fdiv double %67, %.pn404 ; <double> [#uses=1]
%71 = fdiv double %69, %.pn402 ; <double> [#uses=1] %71 = fdiv double %69, %.pn402 ; <double> [#uses=1]
%72 = sub double %70, %71 ; <double> [#uses=1] %72 = fsub double %70, %71 ; <double> [#uses=1]
%73 = mul double %72, -5.000000e-01 ; <double> [#uses=1] %73 = fmul double %72, -5.000000e-01 ; <double> [#uses=1]
%74 = fdiv double %67, %4 ; <double> [#uses=1] %74 = fdiv double %67, %4 ; <double> [#uses=1]
%75 = fdiv double %69, %5 ; <double> [#uses=1] %75 = fdiv double %69, %5 ; <double> [#uses=1]
%76 = sub double %74, %75 ; <double> [#uses=1] %76 = fsub double %74, %75 ; <double> [#uses=1]
%77 = mul double %76, 0.000000e+00 ; <double> [#uses=1] %77 = fmul double %76, 0.000000e+00 ; <double> [#uses=1]
%78 = add double %73, %77 ; <double> [#uses=1] %78 = fadd double %73, %77 ; <double> [#uses=1]
%79 = mul double 0.000000e+00, %78 ; <double> [#uses=1] %79 = fmul double 0.000000e+00, %78 ; <double> [#uses=1]
%80 = add double %66, %79 ; <double> [#uses=1] %80 = fadd double %66, %79 ; <double> [#uses=1]
%81 = fdiv double 0.000000e+00, %.pn404 ; <double> [#uses=1] %81 = fdiv double 0.000000e+00, %.pn404 ; <double> [#uses=1]
%82 = fdiv double 0.000000e+00, %.pn402 ; <double> [#uses=1] %82 = fdiv double 0.000000e+00, %.pn402 ; <double> [#uses=1]
%83 = sub double %81, %82 ; <double> [#uses=1] %83 = fsub double %81, %82 ; <double> [#uses=1]
%84 = mul double %83, -5.000000e-01 ; <double> [#uses=1] %84 = fmul double %83, -5.000000e-01 ; <double> [#uses=1]
%85 = fdiv double 0.000000e+00, %4 ; <double> [#uses=1] %85 = fdiv double 0.000000e+00, %4 ; <double> [#uses=1]
%86 = fdiv double 0.000000e+00, %5 ; <double> [#uses=1] %86 = fdiv double 0.000000e+00, %5 ; <double> [#uses=1]
%87 = sub double %85, %86 ; <double> [#uses=1] %87 = fsub double %85, %86 ; <double> [#uses=1]
%88 = mul double %87, 0.000000e+00 ; <double> [#uses=1] %88 = fmul double %87, 0.000000e+00 ; <double> [#uses=1]
%89 = add double %84, %88 ; <double> [#uses=1] %89 = fadd double %84, %88 ; <double> [#uses=1]
%90 = mul double 0.000000e+00, %89 ; <double> [#uses=1] %90 = fmul double 0.000000e+00, %89 ; <double> [#uses=1]
%91 = sub double %80, %90 ; <double> [#uses=1] %91 = fsub double %80, %90 ; <double> [#uses=1]
%92 = tail call double @llvm.exp.f64(double %8) nounwind ; <double> [#uses=1] %92 = tail call double @llvm.exp.f64(double %8) nounwind ; <double> [#uses=1]
%93 = sub double -0.000000e+00, %92 ; <double> [#uses=1] %93 = fsub double -0.000000e+00, %92 ; <double> [#uses=1]
%94 = tail call double @llvm.exp.f64(double %10) nounwind ; <double> [#uses=1] %94 = tail call double @llvm.exp.f64(double %10) nounwind ; <double> [#uses=1]
%95 = sub double -0.000000e+00, %94 ; <double> [#uses=3] %95 = fsub double -0.000000e+00, %94 ; <double> [#uses=3]
%96 = fdiv double %95, %.pn402 ; <double> [#uses=1] %96 = fdiv double %95, %.pn402 ; <double> [#uses=1]
%97 = sub double 0.000000e+00, %96 ; <double> [#uses=1] %97 = fsub double 0.000000e+00, %96 ; <double> [#uses=1]
%98 = mul double 0.000000e+00, %97 ; <double> [#uses=1] %98 = fmul double 0.000000e+00, %97 ; <double> [#uses=1]
%99 = fdiv double %93, %11 ; <double> [#uses=1] %99 = fdiv double %93, %11 ; <double> [#uses=1]
%100 = fdiv double %95, %12 ; <double> [#uses=1] %100 = fdiv double %95, %12 ; <double> [#uses=1]
%101 = sub double %99, %100 ; <double> [#uses=1] %101 = fsub double %99, %100 ; <double> [#uses=1]
%102 = sub double %98, %101 ; <double> [#uses=1] %102 = fsub double %98, %101 ; <double> [#uses=1]
%103 = fdiv double %95, %5 ; <double> [#uses=1] %103 = fdiv double %95, %5 ; <double> [#uses=1]
%104 = sub double 0.000000e+00, %103 ; <double> [#uses=1] %104 = fsub double 0.000000e+00, %103 ; <double> [#uses=1]
%105 = mul double %18, %104 ; <double> [#uses=1] %105 = fmul double %18, %104 ; <double> [#uses=1]
%106 = add double %102, %105 ; <double> [#uses=1] %106 = fadd double %102, %105 ; <double> [#uses=1]
%107 = mul double %106, %k.4 ; <double> [#uses=1] %107 = fmul double %106, %k.4 ; <double> [#uses=1]
%108 = add double %91, %107 ; <double> [#uses=1] %108 = fadd double %91, %107 ; <double> [#uses=1]
%109 = sub double %108, 0.000000e+00 ; <double> [#uses=1] %109 = fsub double %108, 0.000000e+00 ; <double> [#uses=1]
%110 = tail call double @llvm.exp.f64(double %8) nounwind ; <double> [#uses=1] %110 = tail call double @llvm.exp.f64(double %8) nounwind ; <double> [#uses=1]
%111 = sub double -0.000000e+00, %110 ; <double> [#uses=2] %111 = fsub double -0.000000e+00, %110 ; <double> [#uses=2]
%112 = tail call double @llvm.exp.f64(double %10) nounwind ; <double> [#uses=1] %112 = tail call double @llvm.exp.f64(double %10) nounwind ; <double> [#uses=1]
%113 = sub double -0.000000e+00, %112 ; <double> [#uses=2] %113 = fsub double -0.000000e+00, %112 ; <double> [#uses=2]
%114 = fdiv double %111, %11 ; <double> [#uses=1] %114 = fdiv double %111, %11 ; <double> [#uses=1]
%115 = fdiv double %113, %12 ; <double> [#uses=1] %115 = fdiv double %113, %12 ; <double> [#uses=1]
%116 = sub double %114, %115 ; <double> [#uses=1] %116 = fsub double %114, %115 ; <double> [#uses=1]
%117 = mul double 0.000000e+00, %116 ; <double> [#uses=1] %117 = fmul double 0.000000e+00, %116 ; <double> [#uses=1]
%118 = fdiv double %111, %29 ; <double> [#uses=1] %118 = fdiv double %111, %29 ; <double> [#uses=1]
%119 = fdiv double %113, %30 ; <double> [#uses=1] %119 = fdiv double %113, %30 ; <double> [#uses=1]
%120 = sub double %118, %119 ; <double> [#uses=1] %120 = fsub double %118, %119 ; <double> [#uses=1]
%121 = sub double %117, %120 ; <double> [#uses=1] %121 = fsub double %117, %120 ; <double> [#uses=1]
%122 = mul double %18, 0.000000e+00 ; <double> [#uses=1] %122 = fmul double %18, 0.000000e+00 ; <double> [#uses=1]
%123 = add double %121, %122 ; <double> [#uses=1] %123 = fadd double %121, %122 ; <double> [#uses=1]
%124 = mul double %33, 0.000000e+00 ; <double> [#uses=1] %124 = fmul double %33, 0.000000e+00 ; <double> [#uses=1]
%125 = add double %123, %124 ; <double> [#uses=1] %125 = fadd double %123, %124 ; <double> [#uses=1]
%126 = add double %109, %125 ; <double> [#uses=1] %126 = fadd double %109, %125 ; <double> [#uses=1]
%127 = tail call double @llvm.exp.f64(double 0.000000e+00) nounwind ; <double> [#uses=1] %127 = tail call double @llvm.exp.f64(double 0.000000e+00) nounwind ; <double> [#uses=1]
%128 = sub double -0.000000e+00, %127 ; <double> [#uses=2] %128 = fsub double -0.000000e+00, %127 ; <double> [#uses=2]
%129 = fdiv double %128, %30 ; <double> [#uses=1] %129 = fdiv double %128, %30 ; <double> [#uses=1]
%130 = sub double 0.000000e+00, %129 ; <double> [#uses=1] %130 = fsub double 0.000000e+00, %129 ; <double> [#uses=1]
%131 = sub double 0.000000e+00, %130 ; <double> [#uses=1] %131 = fsub double 0.000000e+00, %130 ; <double> [#uses=1]
%132 = fdiv double 0.000000e+00, %.pn404 ; <double> [#uses=1] %132 = fdiv double 0.000000e+00, %.pn404 ; <double> [#uses=1]
%133 = sub double %132, 0.000000e+00 ; <double> [#uses=1] %133 = fsub double %132, 0.000000e+00 ; <double> [#uses=1]
%134 = mul double %18, %133 ; <double> [#uses=1] %134 = fmul double %18, %133 ; <double> [#uses=1]
%135 = add double %131, %134 ; <double> [#uses=1] %135 = fadd double %131, %134 ; <double> [#uses=1]
%136 = fdiv double %128, %5 ; <double> [#uses=1] %136 = fdiv double %128, %5 ; <double> [#uses=1]
%137 = sub double 0.000000e+00, %136 ; <double> [#uses=1] %137 = fsub double 0.000000e+00, %136 ; <double> [#uses=1]
%138 = mul double %33, %137 ; <double> [#uses=1] %138 = fmul double %33, %137 ; <double> [#uses=1]
%139 = add double %135, %138 ; <double> [#uses=1] %139 = fadd double %135, %138 ; <double> [#uses=1]
%140 = sub double %126, %139 ; <double> [#uses=1] %140 = fsub double %126, %139 ; <double> [#uses=1]
%141 = add double %N1.0, %59 ; <double> [#uses=1] %141 = fadd double %N1.0, %59 ; <double> [#uses=1]
%142 = add double %D1.0, %140 ; <double> [#uses=1] %142 = fadd double %D1.0, %140 ; <double> [#uses=1]
br label %bb64 br label %bb64
bb64: ; preds = %bb62, %bb55 bb64: ; preds = %bb62, %bb55

View File

@ -26,39 +26,39 @@ entry:
bb3: ; preds = %entry bb3: ; preds = %entry
%2 = fdiv double 1.000000e+00, 0.000000e+00 ; <double> [#uses=1] %2 = fdiv double 1.000000e+00, 0.000000e+00 ; <double> [#uses=1]
%3 = mul double 0.000000e+00, %2 ; <double> [#uses=2] %3 = fmul double 0.000000e+00, %2 ; <double> [#uses=2]
%4 = call double @llvm.sqrt.f64(double 0.000000e+00) nounwind ; <double> [#uses=1] %4 = call double @llvm.sqrt.f64(double 0.000000e+00) nounwind ; <double> [#uses=1]
%5 = fdiv double 1.000000e+00, %4 ; <double> [#uses=2] %5 = fdiv double 1.000000e+00, %4 ; <double> [#uses=2]
%6 = mul double %3, %5 ; <double> [#uses=2] %6 = fmul double %3, %5 ; <double> [#uses=2]
%7 = mul double 0.000000e+00, %5 ; <double> [#uses=2] %7 = fmul double 0.000000e+00, %5 ; <double> [#uses=2]
%8 = mul double %3, %7 ; <double> [#uses=1] %8 = fmul double %3, %7 ; <double> [#uses=1]
%9 = sub double %8, 0.000000e+00 ; <double> [#uses=1] %9 = fsub double %8, 0.000000e+00 ; <double> [#uses=1]
%10 = mul double 0.000000e+00, %6 ; <double> [#uses=1] %10 = fmul double 0.000000e+00, %6 ; <double> [#uses=1]
%11 = sub double 0.000000e+00, %10 ; <double> [#uses=1] %11 = fsub double 0.000000e+00, %10 ; <double> [#uses=1]
%12 = sub double -0.000000e+00, %11 ; <double> [#uses=1] %12 = fsub double -0.000000e+00, %11 ; <double> [#uses=1]
%13 = mul double %0, %0 ; <double> [#uses=2] %13 = fmul double %0, %0 ; <double> [#uses=2]
%14 = sub double %13, 0.000000e+00 ; <double> [#uses=1] %14 = fsub double %13, 0.000000e+00 ; <double> [#uses=1]
%15 = call double @llvm.sqrt.f64(double %14) ; <double> [#uses=1] %15 = call double @llvm.sqrt.f64(double %14) ; <double> [#uses=1]
%16 = mul double 0.000000e+00, %15 ; <double> [#uses=1] %16 = fmul double 0.000000e+00, %15 ; <double> [#uses=1]
%17 = fdiv double %16, %0 ; <double> [#uses=1] %17 = fdiv double %16, %0 ; <double> [#uses=1]
%18 = add double 0.000000e+00, %17 ; <double> [#uses=1] %18 = fadd double 0.000000e+00, %17 ; <double> [#uses=1]
%19 = call double @acos(double %18) nounwind readonly ; <double> [#uses=1] %19 = call double @acos(double %18) nounwind readonly ; <double> [#uses=1]
%20 = load double* null, align 4 ; <double> [#uses=1] %20 = load double* null, align 4 ; <double> [#uses=1]
%21 = mul double %20, 0x401921FB54442D18 ; <double> [#uses=1] %21 = fmul double %20, 0x401921FB54442D18 ; <double> [#uses=1]
%22 = call double @sin(double %19) nounwind readonly ; <double> [#uses=2] %22 = call double @sin(double %19) nounwind readonly ; <double> [#uses=2]
%23 = mul double %22, 0.000000e+00 ; <double> [#uses=2] %23 = fmul double %22, 0.000000e+00 ; <double> [#uses=2]
%24 = mul double %6, %23 ; <double> [#uses=1] %24 = fmul double %6, %23 ; <double> [#uses=1]
%25 = mul double %7, %23 ; <double> [#uses=1] %25 = fmul double %7, %23 ; <double> [#uses=1]
%26 = call double @sin(double %21) nounwind readonly ; <double> [#uses=1] %26 = call double @sin(double %21) nounwind readonly ; <double> [#uses=1]
%27 = mul double %22, %26 ; <double> [#uses=2] %27 = fmul double %22, %26 ; <double> [#uses=2]
%28 = mul double %9, %27 ; <double> [#uses=1] %28 = fmul double %9, %27 ; <double> [#uses=1]
%29 = mul double %27, %12 ; <double> [#uses=1] %29 = fmul double %27, %12 ; <double> [#uses=1]
%30 = add double %24, %28 ; <double> [#uses=1] %30 = fadd double %24, %28 ; <double> [#uses=1]
%31 = add double 0.000000e+00, %29 ; <double> [#uses=1] %31 = fadd double 0.000000e+00, %29 ; <double> [#uses=1]
%32 = add double %25, 0.000000e+00 ; <double> [#uses=1] %32 = fadd double %25, 0.000000e+00 ; <double> [#uses=1]
%33 = add double %30, 0.000000e+00 ; <double> [#uses=1] %33 = fadd double %30, 0.000000e+00 ; <double> [#uses=1]
%34 = add double %31, 0.000000e+00 ; <double> [#uses=1] %34 = fadd double %31, 0.000000e+00 ; <double> [#uses=1]
%35 = add double %32, 0.000000e+00 ; <double> [#uses=1] %35 = fadd double %32, 0.000000e+00 ; <double> [#uses=1]
%36 = bitcast %struct.ggPoint3* %x to i8* ; <i8*> [#uses=1] %36 = bitcast %struct.ggPoint3* %x to i8* ; <i8*> [#uses=1]
call void @llvm.memcpy.i32(i8* null, i8* %36, i32 24, i32 4) nounwind call void @llvm.memcpy.i32(i8* null, i8* %36, i32 24, i32 4) nounwind
store double %33, double* null, align 8 store double %33, double* null, align 8
@ -68,9 +68,9 @@ bb5.i.i.i: ; preds = %bb3
unreachable unreachable
_Z20ggRaySphereIntersectRK6ggRay3RK8ggSphereddRd.exit: ; preds = %bb3 _Z20ggRaySphereIntersectRK6ggRay3RK8ggSphereddRd.exit: ; preds = %bb3
%37 = sub double %13, 0.000000e+00 ; <double> [#uses=0] %37 = fsub double %13, 0.000000e+00 ; <double> [#uses=0]
%38 = sub double -0.000000e+00, %34 ; <double> [#uses=0] %38 = fsub double -0.000000e+00, %34 ; <double> [#uses=0]
%39 = sub double -0.000000e+00, %35 ; <double> [#uses=0] %39 = fsub double -0.000000e+00, %35 ; <double> [#uses=0]
ret i32 1 ret i32 1
bb7: ; preds = %entry bb7: ; preds = %entry

View File

@ -4,8 +4,8 @@ define void @execute_shader(<4 x float>* %OUT, <4 x float>* %IN, <4 x float>* %C
entry: entry:
%input2 = load <4 x float>* null, align 16 ; <<4 x float>> [#uses=2] %input2 = load <4 x float>* null, align 16 ; <<4 x float>> [#uses=2]
%shuffle7 = shufflevector <4 x float> %input2, <4 x float> <float 0.000000e+00, float 1.000000e+00, float 0.000000e+00, float 1.000000e+00>, <4 x i32> <i32 2, i32 2, i32 2, i32 2> ; <<4 x float>> [#uses=1] %shuffle7 = shufflevector <4 x float> %input2, <4 x float> <float 0.000000e+00, float 1.000000e+00, float 0.000000e+00, float 1.000000e+00>, <4 x i32> <i32 2, i32 2, i32 2, i32 2> ; <<4 x float>> [#uses=1]
%mul1 = mul <4 x float> %shuffle7, zeroinitializer ; <<4 x float>> [#uses=1] %mul1 = fmul <4 x float> %shuffle7, zeroinitializer ; <<4 x float>> [#uses=1]
%add2 = add <4 x float> %mul1, %input2 ; <<4 x float>> [#uses=1] %add2 = fadd <4 x float> %mul1, %input2 ; <<4 x float>> [#uses=1]
store <4 x float> %add2, <4 x float>* null, align 16 store <4 x float> %add2, <4 x float>* null, align 16
ret void ret void
} }

View File

@ -16,7 +16,7 @@ bb28.i: ; preds = %bb28.i, %entry
br i1 false, label %bb502.loopexit.i, label %bb28.i br i1 false, label %bb502.loopexit.i, label %bb28.i
bb.nph53.i: ; preds = %bb502.loopexit.i bb.nph53.i: ; preds = %bb502.loopexit.i
%tmp354.i = sub double -0.000000e+00, %tmp10.i4 ; <double> [#uses=0] %tmp354.i = fsub double -0.000000e+00, %tmp10.i4 ; <double> [#uses=0]
br label %bb244.i br label %bb244.i
bb244.i: ; preds = %bb244.i, %bb.nph53.i bb244.i: ; preds = %bb244.i, %bb.nph53.i

View File

@ -13,7 +13,7 @@ bb5: ; preds = %bb3
%u.in.mask = and i64 %x14, -4294967296 ; <i64> [#uses=1] %u.in.mask = and i64 %x14, -4294967296 ; <i64> [#uses=1]
%.ins = or i64 0, %u.in.mask ; <i64> [#uses=1] %.ins = or i64 0, %u.in.mask ; <i64> [#uses=1]
%0 = bitcast i64 %.ins to double ; <double> [#uses=1] %0 = bitcast i64 %.ins to double ; <double> [#uses=1]
%1 = sub double %x, %0 ; <double> [#uses=1] %1 = fsub double %x, %0 ; <double> [#uses=1]
%2 = fptosi double %1 to i32 ; <i32> [#uses=1] %2 = fptosi double %1 to i32 ; <i32> [#uses=1]
%3 = add i32 %2, 0 ; <i32> [#uses=1] %3 = add i32 %2, 0 ; <i32> [#uses=1]
%4 = zext i32 %3 to i64 ; <i64> [#uses=1] %4 = zext i32 %3 to i64 ; <i64> [#uses=1]

View File

@ -4,8 +4,8 @@
define double @t1(double %a, double %b) { define double @t1(double %a, double %b) {
entry: entry:
%tmp2 = sub double -0.000000e+00, %a ; <double> [#uses=1] %tmp2 = fsub double -0.000000e+00, %a ; <double> [#uses=1]
%tmp4 = mul double %tmp2, %b ; <double> [#uses=1] %tmp4 = fmul double %tmp2, %b ; <double> [#uses=1]
ret double %tmp4 ret double %tmp4
} }

View File

@ -10,49 +10,49 @@
define float @f1(float %a, float %b) { define float @f1(float %a, float %b) {
entry: entry:
%tmp = add float %a, %b ; <float> [#uses=1] %tmp = fadd float %a, %b ; <float> [#uses=1]
ret float %tmp ret float %tmp
} }
define double @f2(double %a, double %b) { define double @f2(double %a, double %b) {
entry: entry:
%tmp = add double %a, %b ; <double> [#uses=1] %tmp = fadd double %a, %b ; <double> [#uses=1]
ret double %tmp ret double %tmp
} }
define float @f3(float %a, float %b) { define float @f3(float %a, float %b) {
entry: entry:
%tmp = mul float %a, %b ; <float> [#uses=1] %tmp = fmul float %a, %b ; <float> [#uses=1]
ret float %tmp ret float %tmp
} }
define double @f4(double %a, double %b) { define double @f4(double %a, double %b) {
entry: entry:
%tmp = mul double %a, %b ; <double> [#uses=1] %tmp = fmul double %a, %b ; <double> [#uses=1]
ret double %tmp ret double %tmp
} }
define float @f5(float %a, float %b) { define float @f5(float %a, float %b) {
entry: entry:
%tmp = sub float %a, %b ; <float> [#uses=1] %tmp = fsub float %a, %b ; <float> [#uses=1]
ret float %tmp ret float %tmp
} }
define double @f6(double %a, double %b) { define double @f6(double %a, double %b) {
entry: entry:
%tmp = sub double %a, %b ; <double> [#uses=1] %tmp = fsub double %a, %b ; <double> [#uses=1]
ret double %tmp ret double %tmp
} }
define float @f7(float %a) { define float @f7(float %a) {
entry: entry:
%tmp1 = sub float -0.000000e+00, %a ; <float> [#uses=1] %tmp1 = fsub float -0.000000e+00, %a ; <float> [#uses=1]
ret float %tmp1 ret float %tmp1
} }
define double @f8(double %a) { define double @f8(double %a) {
entry: entry:
%tmp1 = sub double -0.000000e+00, %a ; <double> [#uses=1] %tmp1 = fsub double -0.000000e+00, %a ; <double> [#uses=1]
ret double %tmp1 ret double %tmp1
} }

View File

@ -11,12 +11,12 @@ define float @f1(float %a) {
define float @f2(float* %v, float %u) { define float @f2(float* %v, float %u) {
%tmp = load float* %v ; <float> [#uses=1] %tmp = load float* %v ; <float> [#uses=1]
%tmp1 = add float %tmp, %u ; <float> [#uses=1] %tmp1 = fadd float %tmp, %u ; <float> [#uses=1]
ret float %tmp1 ret float %tmp1
} }
define void @f3(float %a, float %b, float* %v) { define void @f3(float %a, float %b, float* %v) {
%tmp = add float %a, %b ; <float> [#uses=1] %tmp = fadd float %a, %b ; <float> [#uses=1]
store float %tmp, float* %v store float %tmp, float* %v
ret void ret void
} }

View File

@ -3,7 +3,7 @@
define void @foo(<8 x float>* %f, <8 x float>* %g, <4 x i64>* %y) define void @foo(<8 x float>* %f, <8 x float>* %g, <4 x i64>* %y)
{ {
%h = load <8 x float>* %f %h = load <8 x float>* %f
%i = mul <8 x float> %h, <float 0x3FF19999A0000000, float 0x400A666660000000, float 0x40119999A0000000, float 0x40159999A0000000, float 0.5, float 0x3FE3333340000000, float 0x3FE6666660000000, float 0x3FE99999A0000000> %i = fmul <8 x float> %h, <float 0x3FF19999A0000000, float 0x400A666660000000, float 0x40119999A0000000, float 0x40159999A0000000, float 0.5, float 0x3FE3333340000000, float 0x3FE6666660000000, float 0x3FE99999A0000000>
%m = bitcast <8 x float> %i to <4 x i64> %m = bitcast <8 x float> %i to <4 x i64>
%z = load <4 x i64>* %y %z = load <4 x i64>* %y
%n = mul <4 x i64> %z, %m %n = mul <4 x i64> %z, %m

View File

@ -39,10 +39,10 @@ define void @test_abs(float* %P, double* %D) {
define void @test_add(float* %P, double* %D) { define void @test_add(float* %P, double* %D) {
%a = load float* %P ; <float> [#uses=2] %a = load float* %P ; <float> [#uses=2]
%b = add float %a, %a ; <float> [#uses=1] %b = fadd float %a, %a ; <float> [#uses=1]
store float %b, float* %P store float %b, float* %P
%A = load double* %D ; <double> [#uses=2] %A = load double* %D ; <double> [#uses=2]
%B = add double %A, %A ; <double> [#uses=1] %B = fadd double %A, %A ; <double> [#uses=1]
store double %B, double* %D store double %B, double* %D
ret void ret void
} }
@ -61,8 +61,8 @@ define void @test_fma(float* %P1, float* %P2, float* %P3) {
%a1 = load float* %P1 ; <float> [#uses=1] %a1 = load float* %P1 ; <float> [#uses=1]
%a2 = load float* %P2 ; <float> [#uses=1] %a2 = load float* %P2 ; <float> [#uses=1]
%a3 = load float* %P3 ; <float> [#uses=1] %a3 = load float* %P3 ; <float> [#uses=1]
%X = mul float %a1, %a2 ; <float> [#uses=1] %X = fmul float %a1, %a2 ; <float> [#uses=1]
%Y = sub float %X, %a3 ; <float> [#uses=1] %Y = fsub float %X, %a3 ; <float> [#uses=1]
store float %Y, float* %P1 store float %Y, float* %P1
ret void ret void
} }

View File

@ -23,7 +23,7 @@ define double @test4(i64 %L) {
define double @test5(double %D) { define double @test5(double %D) {
%X = bitcast double %D to double ; <double> [#uses=1] %X = bitcast double %D to double ; <double> [#uses=1]
%Y = add double %X, 2.000000e+00 ; <double> [#uses=1] %Y = fadd double %X, 2.000000e+00 ; <double> [#uses=1]
%Z = bitcast double %Y to i64 ; <i64> [#uses=1] %Z = bitcast double %Y to i64 ; <i64> [#uses=1]
%res = bitcast i64 %Z to double ; <double> [#uses=1] %res = bitcast i64 %Z to double ; <double> [#uses=1]
ret double %res ret double %res
@ -31,7 +31,7 @@ define double @test5(double %D) {
define float @test6(float %F) { define float @test6(float %F) {
%X = bitcast float %F to float ; <float> [#uses=1] %X = bitcast float %F to float ; <float> [#uses=1]
%Y = add float %X, 2.000000e+00 ; <float> [#uses=1] %Y = fadd float %X, 2.000000e+00 ; <float> [#uses=1]
%Z = bitcast float %Y to i32 ; <i32> [#uses=1] %Z = bitcast float %Y to i32 ; <i32> [#uses=1]
%res = bitcast i32 %Z to float ; <float> [#uses=1] %res = bitcast i32 %Z to float ; <float> [#uses=1]
ret float %res ret float %res

View File

@ -20,7 +20,7 @@ entry:
br label %bb4 br label %bb4
bb4: ; preds = %bb5.split, %bb4, %entry bb4: ; preds = %bb5.split, %bb4, %entry
%0 = fcmp ogt ppc_fp128 0xM00000000000000000000000000000000, select (i1 fcmp olt (ppc_fp128 fpext (double 0x3C447AE147AE147B to ppc_fp128), ppc_fp128 mul (ppc_fp128 0xM00000000000000010000000000000000, ppc_fp128 0xM40140000000000000000000000000000)), ppc_fp128 mul (ppc_fp128 0xM00000000000000010000000000000000, ppc_fp128 0xM40140000000000000000000000000000), ppc_fp128 fpext (double 0x3C447AE147AE147B to ppc_fp128)) ; <i1> [#uses=1] %0 = fcmp ogt ppc_fp128 0xM00000000000000000000000000000000, select (i1 fcmp olt (ppc_fp128 fpext (double 0x3C447AE147AE147B to ppc_fp128), ppc_fp128 fmul (ppc_fp128 0xM00000000000000010000000000000000, ppc_fp128 0xM40140000000000000000000000000000)), ppc_fp128 fmul (ppc_fp128 0xM00000000000000010000000000000000, ppc_fp128 0xM40140000000000000000000000000000), ppc_fp128 fpext (double 0x3C447AE147AE147B to ppc_fp128)) ; <i1> [#uses=1]
br i1 %0, label %bb4, label %bb5.split br i1 %0, label %bb4, label %bb5.split
bb5.split: ; preds = %bb4 bb5.split: ; preds = %bb4

View File

@ -14,7 +14,7 @@ define i32 @test2(<4 x i32> %a, i32 %b) {
} }
define <4 x float> @test3(<4 x float> %Y) { define <4 x float> @test3(<4 x float> %Y) {
%Z = add <4 x float> %Y, %Y %Z = fadd <4 x float> %Y, %Y
%X = shufflevector <4 x float> zeroinitializer, <4 x float> %Z, <4 x i32> < i32 0, i32 5, i32 6, i32 7 > %X = shufflevector <4 x float> zeroinitializer, <4 x float> %Z, <4 x i32> < i32 0, i32 5, i32 6, i32 7 >
ret <4 x float> %X ret <4 x float> %X
} }

View File

@ -11,88 +11,88 @@ target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i
target triple = "spu" target triple = "spu"
define double @fadd(double %arg1, double %arg2) { define double @fadd(double %arg1, double %arg2) {
%A = add double %arg1, %arg2 %A = fadd double %arg1, %arg2
ret double %A ret double %A
} }
define <2 x double> @fadd_vec(<2 x double> %arg1, <2 x double> %arg2) { define <2 x double> @fadd_vec(<2 x double> %arg1, <2 x double> %arg2) {
%A = add <2 x double> %arg1, %arg2 %A = fadd <2 x double> %arg1, %arg2
ret <2 x double> %A ret <2 x double> %A
} }
define double @fsub(double %arg1, double %arg2) { define double @fsub(double %arg1, double %arg2) {
%A = sub double %arg1, %arg2 %A = fsub double %arg1, %arg2
ret double %A ret double %A
} }
define <2 x double> @fsub_vec(<2 x double> %arg1, <2 x double> %arg2) { define <2 x double> @fsub_vec(<2 x double> %arg1, <2 x double> %arg2) {
%A = sub <2 x double> %arg1, %arg2 %A = fsub <2 x double> %arg1, %arg2
ret <2 x double> %A ret <2 x double> %A
} }
define double @fmul(double %arg1, double %arg2) { define double @fmul(double %arg1, double %arg2) {
%A = mul double %arg1, %arg2 %A = fmul double %arg1, %arg2
ret double %A ret double %A
} }
define <2 x double> @fmul_vec(<2 x double> %arg1, <2 x double> %arg2) { define <2 x double> @fmul_vec(<2 x double> %arg1, <2 x double> %arg2) {
%A = mul <2 x double> %arg1, %arg2 %A = fmul <2 x double> %arg1, %arg2
ret <2 x double> %A ret <2 x double> %A
} }
define double @fma(double %arg1, double %arg2, double %arg3) { define double @fma(double %arg1, double %arg2, double %arg3) {
%A = mul double %arg1, %arg2 %A = fmul double %arg1, %arg2
%B = add double %A, %arg3 %B = fadd double %A, %arg3
ret double %B ret double %B
} }
define <2 x double> @fma_vec(<2 x double> %arg1, <2 x double> %arg2, <2 x double> %arg3) { define <2 x double> @fma_vec(<2 x double> %arg1, <2 x double> %arg2, <2 x double> %arg3) {
%A = mul <2 x double> %arg1, %arg2 %A = fmul <2 x double> %arg1, %arg2
%B = add <2 x double> %A, %arg3 %B = fadd <2 x double> %A, %arg3
ret <2 x double> %B ret <2 x double> %B
} }
define double @fms(double %arg1, double %arg2, double %arg3) { define double @fms(double %arg1, double %arg2, double %arg3) {
%A = mul double %arg1, %arg2 %A = fmul double %arg1, %arg2
%B = sub double %A, %arg3 %B = fsub double %A, %arg3
ret double %B ret double %B
} }
define <2 x double> @fms_vec(<2 x double> %arg1, <2 x double> %arg2, <2 x double> %arg3) { define <2 x double> @fms_vec(<2 x double> %arg1, <2 x double> %arg2, <2 x double> %arg3) {
%A = mul <2 x double> %arg1, %arg2 %A = fmul <2 x double> %arg1, %arg2
%B = sub <2 x double> %A, %arg3 %B = fsub <2 x double> %A, %arg3
ret <2 x double> %B ret <2 x double> %B
} }
; - (a * b - c) ; - (a * b - c)
define double @d_fnms_1(double %arg1, double %arg2, double %arg3) { define double @d_fnms_1(double %arg1, double %arg2, double %arg3) {
%A = mul double %arg1, %arg2 %A = fmul double %arg1, %arg2
%B = sub double %A, %arg3 %B = fsub double %A, %arg3
%C = sub double -0.000000e+00, %B ; <double> [#uses=1] %C = fsub double -0.000000e+00, %B ; <double> [#uses=1]
ret double %C ret double %C
} }
; Annother way of getting fnms ; Annother way of getting fnms
; - ( a * b ) + c => c - (a * b) ; - ( a * b ) + c => c - (a * b)
define double @d_fnms_2(double %arg1, double %arg2, double %arg3) { define double @d_fnms_2(double %arg1, double %arg2, double %arg3) {
%A = mul double %arg1, %arg2 %A = fmul double %arg1, %arg2
%B = sub double %arg3, %A %B = fsub double %arg3, %A
ret double %B ret double %B
} }
; FNMS: - (a * b - c) => c - (a * b) ; FNMS: - (a * b - c) => c - (a * b)
define <2 x double> @d_fnms_vec_1(<2 x double> %arg1, <2 x double> %arg2, <2 x double> %arg3) { define <2 x double> @d_fnms_vec_1(<2 x double> %arg1, <2 x double> %arg2, <2 x double> %arg3) {
%A = mul <2 x double> %arg1, %arg2 %A = fmul <2 x double> %arg1, %arg2
%B = sub <2 x double> %arg3, %A ; %B = fsub <2 x double> %arg3, %A ;
ret <2 x double> %B ret <2 x double> %B
} }
; Another way to get fnms using a constant vector ; Another way to get fnms using a constant vector
; - ( a * b - c) ; - ( a * b - c)
define <2 x double> @d_fnms_vec_2(<2 x double> %arg1, <2 x double> %arg2, <2 x double> %arg3) { define <2 x double> @d_fnms_vec_2(<2 x double> %arg1, <2 x double> %arg2, <2 x double> %arg3) {
%A = mul <2 x double> %arg1, %arg2 ; <<2 x double>> [#uses=1] %A = fmul <2 x double> %arg1, %arg2 ; <<2 x double>> [#uses=1]
%B = sub <2 x double> %A, %arg3 ; <<2 x double>> [#uses=1] %B = fsub <2 x double> %A, %arg3 ; <<2 x double>> [#uses=1]
%C = sub <2 x double> < double -0.00000e+00, double -0.00000e+00 >, %B %C = fsub <2 x double> < double -0.00000e+00, double -0.00000e+00 >, %B
ret <2 x double> %C ret <2 x double> %C
} }

View File

@ -7,22 +7,22 @@ target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i
target triple = "spu" target triple = "spu"
define double @fneg_dp(double %X) { define double @fneg_dp(double %X) {
%Y = sub double -0.000000e+00, %X %Y = fsub double -0.000000e+00, %X
ret double %Y ret double %Y
} }
define <2 x double> @fneg_dp_vec(<2 x double> %X) { define <2 x double> @fneg_dp_vec(<2 x double> %X) {
%Y = sub <2 x double> < double -0.0000e+00, double -0.0000e+00 >, %X %Y = fsub <2 x double> < double -0.0000e+00, double -0.0000e+00 >, %X
ret <2 x double> %Y ret <2 x double> %Y
} }
define float @fneg_sp(float %X) { define float @fneg_sp(float %X) {
%Y = sub float -0.000000e+00, %X %Y = fsub float -0.000000e+00, %X
ret float %Y ret float %Y
} }
define <4 x float> @fneg_sp_vec(<4 x float> %X) { define <4 x float> @fneg_sp_vec(<4 x float> %X) {
%Y = sub <4 x float> <float -0.000000e+00, float -0.000000e+00, %Y = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00,
float -0.000000e+00, float -0.000000e+00>, %X float -0.000000e+00, float -0.000000e+00>, %X
ret <4 x float> %Y ret <4 x float> %Y
} }

View File

@ -12,79 +12,79 @@ target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i
target triple = "spu" target triple = "spu"
define float @fp_add(float %arg1, float %arg2) { define float @fp_add(float %arg1, float %arg2) {
%A = add float %arg1, %arg2 ; <float> [#uses=1] %A = fadd float %arg1, %arg2 ; <float> [#uses=1]
ret float %A ret float %A
} }
define <4 x float> @fp_add_vec(<4 x float> %arg1, <4 x float> %arg2) { define <4 x float> @fp_add_vec(<4 x float> %arg1, <4 x float> %arg2) {
%A = add <4 x float> %arg1, %arg2 ; <<4 x float>> [#uses=1] %A = fadd <4 x float> %arg1, %arg2 ; <<4 x float>> [#uses=1]
ret <4 x float> %A ret <4 x float> %A
} }
define float @fp_sub(float %arg1, float %arg2) { define float @fp_sub(float %arg1, float %arg2) {
%A = sub float %arg1, %arg2 ; <float> [#uses=1] %A = fsub float %arg1, %arg2 ; <float> [#uses=1]
ret float %A ret float %A
} }
define <4 x float> @fp_sub_vec(<4 x float> %arg1, <4 x float> %arg2) { define <4 x float> @fp_sub_vec(<4 x float> %arg1, <4 x float> %arg2) {
%A = sub <4 x float> %arg1, %arg2 ; <<4 x float>> [#uses=1] %A = fsub <4 x float> %arg1, %arg2 ; <<4 x float>> [#uses=1]
ret <4 x float> %A ret <4 x float> %A
} }
define float @fp_mul(float %arg1, float %arg2) { define float @fp_mul(float %arg1, float %arg2) {
%A = mul float %arg1, %arg2 ; <float> [#uses=1] %A = fmul float %arg1, %arg2 ; <float> [#uses=1]
ret float %A ret float %A
} }
define <4 x float> @fp_mul_vec(<4 x float> %arg1, <4 x float> %arg2) { define <4 x float> @fp_mul_vec(<4 x float> %arg1, <4 x float> %arg2) {
%A = mul <4 x float> %arg1, %arg2 ; <<4 x float>> [#uses=1] %A = fmul <4 x float> %arg1, %arg2 ; <<4 x float>> [#uses=1]
ret <4 x float> %A ret <4 x float> %A
} }
define float @fp_mul_add(float %arg1, float %arg2, float %arg3) { define float @fp_mul_add(float %arg1, float %arg2, float %arg3) {
%A = mul float %arg1, %arg2 ; <float> [#uses=1] %A = fmul float %arg1, %arg2 ; <float> [#uses=1]
%B = add float %A, %arg3 ; <float> [#uses=1] %B = fadd float %A, %arg3 ; <float> [#uses=1]
ret float %B ret float %B
} }
define <4 x float> @fp_mul_add_vec(<4 x float> %arg1, <4 x float> %arg2, <4 x float> %arg3) { define <4 x float> @fp_mul_add_vec(<4 x float> %arg1, <4 x float> %arg2, <4 x float> %arg3) {
%A = mul <4 x float> %arg1, %arg2 ; <<4 x float>> [#uses=1] %A = fmul <4 x float> %arg1, %arg2 ; <<4 x float>> [#uses=1]
%B = add <4 x float> %A, %arg3 ; <<4 x float>> [#uses=1] %B = fadd <4 x float> %A, %arg3 ; <<4 x float>> [#uses=1]
ret <4 x float> %B ret <4 x float> %B
} }
define float @fp_mul_sub(float %arg1, float %arg2, float %arg3) { define float @fp_mul_sub(float %arg1, float %arg2, float %arg3) {
%A = mul float %arg1, %arg2 ; <float> [#uses=1] %A = fmul float %arg1, %arg2 ; <float> [#uses=1]
%B = sub float %A, %arg3 ; <float> [#uses=1] %B = fsub float %A, %arg3 ; <float> [#uses=1]
ret float %B ret float %B
} }
define <4 x float> @fp_mul_sub_vec(<4 x float> %arg1, <4 x float> %arg2, <4 x float> %arg3) { define <4 x float> @fp_mul_sub_vec(<4 x float> %arg1, <4 x float> %arg2, <4 x float> %arg3) {
%A = mul <4 x float> %arg1, %arg2 ; <<4 x float>> [#uses=1] %A = fmul <4 x float> %arg1, %arg2 ; <<4 x float>> [#uses=1]
%B = sub <4 x float> %A, %arg3 ; <<4 x float>> [#uses=1] %B = fsub <4 x float> %A, %arg3 ; <<4 x float>> [#uses=1]
ret <4 x float> %B ret <4 x float> %B
} }
; Test the straightforward way of getting fnms ; Test the straightforward way of getting fnms
; c - a * b ; c - a * b
define float @fp_neg_mul_sub_1(float %arg1, float %arg2, float %arg3) { define float @fp_neg_mul_sub_1(float %arg1, float %arg2, float %arg3) {
%A = mul float %arg1, %arg2 %A = fmul float %arg1, %arg2
%B = sub float %arg3, %A %B = fsub float %arg3, %A
ret float %B ret float %B
} }
; Test another way of getting fnms ; Test another way of getting fnms
; - ( a *b -c ) = c - a * b ; - ( a *b -c ) = c - a * b
define float @fp_neg_mul_sub_2(float %arg1, float %arg2, float %arg3) { define float @fp_neg_mul_sub_2(float %arg1, float %arg2, float %arg3) {
%A = mul float %arg1, %arg2 %A = fmul float %arg1, %arg2
%B = sub float %A, %arg3 %B = fsub float %A, %arg3
%C = sub float -0.0, %B %C = fsub float -0.0, %B
ret float %C ret float %C
} }
define <4 x float> @fp_neg_mul_sub_vec(<4 x float> %arg1, <4 x float> %arg2, <4 x float> %arg3) { define <4 x float> @fp_neg_mul_sub_vec(<4 x float> %arg1, <4 x float> %arg2, <4 x float> %arg3) {
%A = mul <4 x float> %arg1, %arg2 %A = fmul <4 x float> %arg1, %arg2
%B = sub <4 x float> %A, %arg3 %B = fsub <4 x float> %A, %arg3
%D = sub <4 x float> < float -0.0, float -0.0, float -0.0, float -0.0 >, %B %D = fsub <4 x float> < float -0.0, float -0.0, float -0.0, float -0.0 >, %B
ret <4 x float> %D ret <4 x float> %D
} }

View File

@ -12,13 +12,13 @@ define i32 @testissue(i32 %i, float %x, float %y) {
br label %bb1 br label %bb1
bb1: ; preds = %bb1, %0 bb1: ; preds = %bb1, %0
%x1 = mul float %x, %y ; <float> [#uses=1] %x1 = fmul float %x, %y ; <float> [#uses=1]
%y1 = mul float %y, 7.500000e-01 ; <float> [#uses=1] %y1 = fmul float %y, 7.500000e-01 ; <float> [#uses=1]
%z1 = add float %x1, %y1 ; <float> [#uses=1] %z1 = fadd float %x1, %y1 ; <float> [#uses=1]
%x2 = mul float %x, 5.000000e-01 ; <float> [#uses=1] %x2 = fmul float %x, 5.000000e-01 ; <float> [#uses=1]
%y2 = mul float %y, 0x3FECCCCCC0000000 ; <float> [#uses=1] %y2 = fmul float %y, 0x3FECCCCCC0000000 ; <float> [#uses=1]
%z2 = add float %x2, %y2 ; <float> [#uses=1] %z2 = fadd float %x2, %y2 ; <float> [#uses=1]
%z3 = add float %z1, %z2 ; <float> [#uses=1] %z3 = fadd float %z1, %z2 ; <float> [#uses=1]
%i1 = shl i32 %i, 3 ; <i32> [#uses=1] %i1 = shl i32 %i, 3 ; <i32> [#uses=1]
%j1 = add i32 %i, 7 ; <i32> [#uses=1] %j1 = add i32 %i, 7 ; <i32> [#uses=1]
%m1 = add i32 %i1, %j1 ; <i32> [#uses=2] %m1 = add i32 %i1, %j1 ; <i32> [#uses=2]

View File

@ -71,10 +71,10 @@ cond_next159.i: ; preds = %cond_true356.i.preheader
%tmp178.i = add i32 %tmp116117.i, -128 ; <i32> [#uses=2] %tmp178.i = add i32 %tmp116117.i, -128 ; <i32> [#uses=2]
%tmp181.i = mul i32 %tmp178.i, %tmp178.i ; <i32> [#uses=1] %tmp181.i = mul i32 %tmp178.i, %tmp178.i ; <i32> [#uses=1]
%tmp181182.i = sitofp i32 %tmp181.i to float ; <float> [#uses=1] %tmp181182.i = sitofp i32 %tmp181.i to float ; <float> [#uses=1]
%tmp199200.pn.in.i = mul float %tmp181182.i, 0.000000e+00 ; <float> [#uses=1] %tmp199200.pn.in.i = fmul float %tmp181182.i, 0.000000e+00 ; <float> [#uses=1]
%tmp199200.pn.i = fpext float %tmp199200.pn.in.i to double ; <double> [#uses=1] %tmp199200.pn.i = fpext float %tmp199200.pn.in.i to double ; <double> [#uses=1]
%tmp201.pn.i = sub double 1.000000e+00, %tmp199200.pn.i ; <double> [#uses=1] %tmp201.pn.i = fsub double 1.000000e+00, %tmp199200.pn.i ; <double> [#uses=1]
%factor.2.in.i = mul double 0.000000e+00, %tmp201.pn.i ; <double> [#uses=1] %factor.2.in.i = fmul double 0.000000e+00, %tmp201.pn.i ; <double> [#uses=1]
%factor.2.i = fptrunc double %factor.2.in.i to float ; <float> [#uses=1] %factor.2.i = fptrunc double %factor.2.in.i to float ; <float> [#uses=1]
br i1 false, label %cond_next312.i, label %cond_false222.i br i1 false, label %cond_next312.i, label %cond_false222.i

View File

@ -5,7 +5,7 @@ entry:
br label %bb15 br label %bb15
bb15: ; preds = %bb15, %entry bb15: ; preds = %bb15, %entry
%tmp21 = add <8 x double> zeroinitializer, zeroinitializer ; <<8 x double>> [#uses=1] %tmp21 = fadd <8 x double> zeroinitializer, zeroinitializer ; <<8 x double>> [#uses=1]
br i1 false, label %bb30, label %bb15 br i1 false, label %bb30, label %bb15
bb30: ; preds = %bb15 bb30: ; preds = %bb15

View File

@ -5,8 +5,8 @@ define void @test() {
entry: entry:
%tmp98 = load float* null, align 4 ; <float> [#uses=1] %tmp98 = load float* null, align 4 ; <float> [#uses=1]
%tmp106 = load float* null, align 4 ; <float> [#uses=1] %tmp106 = load float* null, align 4 ; <float> [#uses=1]
%tmp113 = add float %tmp98, %tmp106 ; <float> [#uses=1] %tmp113 = fadd float %tmp98, %tmp106 ; <float> [#uses=1]
%tmp119 = sub float %tmp113, 0.000000e+00 ; <float> [#uses=1] %tmp119 = fsub float %tmp113, 0.000000e+00 ; <float> [#uses=1]
call void (i32, ...)* @foo( i32 0, float 0.000000e+00, float %tmp119 ) nounwind call void (i32, ...)* @foo( i32 0, float 0.000000e+00, float %tmp119 ) nounwind
ret void ret void
} }

View File

@ -30,16 +30,16 @@ bb.nph1770: ; preds = %bb429
br i1 false, label %bb471, label %bb505 br i1 false, label %bb471, label %bb505
bb471: ; preds = %bb471, %bb.nph1770 bb471: ; preds = %bb471, %bb.nph1770
%tmp487 = add double 0.000000e+00, 0.000000e+00 ; <double> [#uses=1] %tmp487 = fadd double 0.000000e+00, 0.000000e+00 ; <double> [#uses=1]
br i1 false, label %bb505, label %bb471 br i1 false, label %bb505, label %bb471
bb505: ; preds = %bb471, %bb.nph1770 bb505: ; preds = %bb471, %bb.nph1770
%xy.0.lcssa = phi double [ 0.000000e+00, %bb.nph1770 ], [ %tmp487, %bb471 ] ; <double> [#uses=1] %xy.0.lcssa = phi double [ 0.000000e+00, %bb.nph1770 ], [ %tmp487, %bb471 ] ; <double> [#uses=1]
%tmp507 = sub double -0.000000e+00, %xy.0.lcssa ; <double> [#uses=1] %tmp507 = fsub double -0.000000e+00, %xy.0.lcssa ; <double> [#uses=1]
%tmp509 = fdiv double %tmp507, 0.000000e+00 ; <double> [#uses=1] %tmp509 = fdiv double %tmp507, 0.000000e+00 ; <double> [#uses=1]
%tmp510 = mul double %tmp509, 1.024000e+03 ; <double> [#uses=1] %tmp510 = fmul double %tmp509, 1.024000e+03 ; <double> [#uses=1]
%tmp516 = fdiv double %tmp510, 0.000000e+00 ; <double> [#uses=1] %tmp516 = fdiv double %tmp510, 0.000000e+00 ; <double> [#uses=1]
%tmp517 = add double %tmp516, 5.000000e-01 ; <double> [#uses=1] %tmp517 = fadd double %tmp516, 5.000000e-01 ; <double> [#uses=1]
%tmp518 = tail call double @floor( double %tmp517 ) nounwind readnone ; <double> [#uses=0] %tmp518 = tail call double @floor( double %tmp517 ) nounwind readnone ; <double> [#uses=0]
ret i32 0 ret i32 0

View File

@ -1,12 +1,12 @@
; RUN: llvm-as < %s | llc ; RUN: llvm-as < %s | llc
define double @fneg(double %X) { define double @fneg(double %X) {
%Y = sub double -0.000000e+00, %X ; <double> [#uses=1] %Y = fsub double -0.000000e+00, %X ; <double> [#uses=1]
ret double %Y ret double %Y
} }
define float @fnegf(float %X) { define float @fnegf(float %X) {
%Y = sub float -0.000000e+00, %X ; <float> [#uses=1] %Y = fsub float -0.000000e+00, %X ; <float> [#uses=1]
ret float %Y ret float %Y
} }

View File

@ -24,9 +24,9 @@ define i32 @main() {
%b_s = getelementptr [8 x i8]* @b_str, i64 0, i64 0 ; <i8*> [#uses=1] %b_s = getelementptr [8 x i8]* @b_str, i64 0, i64 0 ; <i8*> [#uses=1]
call i32 (i8*, ...)* @printf( i8* %a_s, double %a ) ; <i32>:1 [#uses=0] call i32 (i8*, ...)* @printf( i8* %a_s, double %a ) ; <i32>:1 [#uses=0]
call i32 (i8*, ...)* @printf( i8* %b_s, double %b ) ; <i32>:2 [#uses=0] call i32 (i8*, ...)* @printf( i8* %b_s, double %b ) ; <i32>:2 [#uses=0]
%add_r = add double %a, %b ; <double> [#uses=1] %add_r = fadd double %a, %b ; <double> [#uses=1]
%sub_r = sub double %a, %b ; <double> [#uses=1] %sub_r = fsub double %a, %b ; <double> [#uses=1]
%mul_r = mul double %a, %b ; <double> [#uses=1] %mul_r = fmul double %a, %b ; <double> [#uses=1]
%div_r = fdiv double %b, %a ; <double> [#uses=1] %div_r = fdiv double %b, %a ; <double> [#uses=1]
%rem_r = frem double %b, %a ; <double> [#uses=1] %rem_r = frem double %b, %a ; <double> [#uses=1]
%add_s = getelementptr [12 x i8]* @add_str, i64 0, i64 0 ; <i8*> [#uses=1] %add_s = getelementptr [12 x i8]* @add_str, i64 0, i64 0 ; <i8*> [#uses=1]

View File

@ -9,8 +9,8 @@ define void @testConsts(i32 %N, float %X) {
%a = add i32 %N, 1 ; <i32> [#uses=0] %a = add i32 %N, 1 ; <i32> [#uses=0]
%i = add i32 %N, 12345678 ; <i32> [#uses=0] %i = add i32 %N, 12345678 ; <i32> [#uses=0]
%b = add i16 4, 3 ; <i16> [#uses=0] %b = add i16 4, 3 ; <i16> [#uses=0]
%c = add float %X, 0.000000e+00 ; <float> [#uses=0] %c = fadd float %X, 0.000000e+00 ; <float> [#uses=0]
%d = add float %X, 0x400921CAC0000000 ; <float> [#uses=0] %d = fadd float %X, 0x400921CAC0000000 ; <float> [#uses=0]
%f = add i32 -1, 10 ; <i32> [#uses=0] %f = add i32 -1, 10 ; <i32> [#uses=0]
%g = add i16 20, -1 ; <i16> [#uses=0] %g = add i16 20, -1 ; <i16> [#uses=0]
%j = add i16 -1, 30 ; <i16> [#uses=0] %j = add i16 -1, 30 ; <i16> [#uses=0]
@ -126,8 +126,8 @@ define void @testfloatbool(float %x, float %y) {
br label %Top br label %Top
Top: ; preds = %Top, %0 Top: ; preds = %Top, %0
%p = add float %x, %y ; <float> [#uses=1] %p = fadd float %x, %y ; <float> [#uses=1]
%z = sub float %x, %y ; <float> [#uses=1] %z = fsub float %x, %y ; <float> [#uses=1]
%b = fcmp ole float %p, %z ; <i1> [#uses=2] %b = fcmp ole float %p, %z ; <i1> [#uses=2]
%c = xor i1 %b, true ; <i1> [#uses=0] %c = xor i1 %b, true ; <i1> [#uses=0]
br i1 %b, label %Top, label %goon br i1 %b, label %Top, label %goon

View File

@ -1,7 +1,7 @@
; RUN: llvm-as < %s | llc ; RUN: llvm-as < %s | llc
define void @foo(double %a, double %b, float* %fp) { define void @foo(double %a, double %b, float* %fp) {
%c = add double %a, %b %c = fadd double %a, %b
%d = fptrunc double %c to float %d = fptrunc double %c to float
store float %d, float* %fp store float %d, float* %fp
ret void ret void

View File

@ -4,7 +4,7 @@
define void @test_f8(%f8 *%P, %f8* %Q, %f8 *%S) { define void @test_f8(%f8 *%P, %f8* %Q, %f8 *%S) {
%p = load %f8* %P %p = load %f8* %P
%q = load %f8* %Q %q = load %f8* %Q
%R = add %f8 %p, %q %R = fadd %f8 %p, %q
store %f8 %R, %f8 *%S store %f8 %R, %f8 *%S
ret void ret void
} }

View File

@ -14,7 +14,7 @@
define void @test_f1(%f1* %P, %f1* %Q, %f1* %S) { define void @test_f1(%f1* %P, %f1* %Q, %f1* %S) {
%p = load %f1* %P ; <%f1> [#uses=1] %p = load %f1* %P ; <%f1> [#uses=1]
%q = load %f1* %Q ; <%f1> [#uses=1] %q = load %f1* %Q ; <%f1> [#uses=1]
%R = add %f1 %p, %q ; <%f1> [#uses=1] %R = fadd %f1 %p, %q ; <%f1> [#uses=1]
store %f1 %R, %f1* %S store %f1 %R, %f1* %S
ret void ret void
} }
@ -22,7 +22,7 @@ define void @test_f1(%f1* %P, %f1* %Q, %f1* %S) {
define void @test_f2(%f2* %P, %f2* %Q, %f2* %S) { define void @test_f2(%f2* %P, %f2* %Q, %f2* %S) {
%p = load %f2* %P ; <%f2> [#uses=1] %p = load %f2* %P ; <%f2> [#uses=1]
%q = load %f2* %Q ; <%f2> [#uses=1] %q = load %f2* %Q ; <%f2> [#uses=1]
%R = add %f2 %p, %q ; <%f2> [#uses=1] %R = fadd %f2 %p, %q ; <%f2> [#uses=1]
store %f2 %R, %f2* %S store %f2 %R, %f2* %S
ret void ret void
} }
@ -30,7 +30,7 @@ define void @test_f2(%f2* %P, %f2* %Q, %f2* %S) {
define void @test_f4(%f4* %P, %f4* %Q, %f4* %S) { define void @test_f4(%f4* %P, %f4* %Q, %f4* %S) {
%p = load %f4* %P ; <%f4> [#uses=1] %p = load %f4* %P ; <%f4> [#uses=1]
%q = load %f4* %Q ; <%f4> [#uses=1] %q = load %f4* %Q ; <%f4> [#uses=1]
%R = add %f4 %p, %q ; <%f4> [#uses=1] %R = fadd %f4 %p, %q ; <%f4> [#uses=1]
store %f4 %R, %f4* %S store %f4 %R, %f4* %S
ret void ret void
} }
@ -38,7 +38,7 @@ define void @test_f4(%f4* %P, %f4* %Q, %f4* %S) {
define void @test_f8(%f8* %P, %f8* %Q, %f8* %S) { define void @test_f8(%f8* %P, %f8* %Q, %f8* %S) {
%p = load %f8* %P ; <%f8> [#uses=1] %p = load %f8* %P ; <%f8> [#uses=1]
%q = load %f8* %Q ; <%f8> [#uses=1] %q = load %f8* %Q ; <%f8> [#uses=1]
%R = add %f8 %p, %q ; <%f8> [#uses=1] %R = fadd %f8 %p, %q ; <%f8> [#uses=1]
store %f8 %R, %f8* %S store %f8 %R, %f8* %S
ret void ret void
} }
@ -46,7 +46,7 @@ define void @test_f8(%f8* %P, %f8* %Q, %f8* %S) {
define void @test_fmul(%f8* %P, %f8* %Q, %f8* %S) { define void @test_fmul(%f8* %P, %f8* %Q, %f8* %S) {
%p = load %f8* %P ; <%f8> [#uses=1] %p = load %f8* %P ; <%f8> [#uses=1]
%q = load %f8* %Q ; <%f8> [#uses=1] %q = load %f8* %Q ; <%f8> [#uses=1]
%R = mul %f8 %p, %q ; <%f8> [#uses=1] %R = fmul %f8 %p, %q ; <%f8> [#uses=1]
store %f8 %R, %f8* %S store %f8 %R, %f8* %S
ret void ret void
} }
@ -64,21 +64,21 @@ define void @test_div(%f8* %P, %f8* %Q, %f8* %S) {
define void @test_cst(%f4* %P, %f4* %S) { define void @test_cst(%f4* %P, %f4* %S) {
%p = load %f4* %P ; <%f4> [#uses=1] %p = load %f4* %P ; <%f4> [#uses=1]
%R = add %f4 %p, < float 0x3FB99999A0000000, float 1.000000e+00, float 2.000000e+00, float 4.500000e+00 > ; <%f4> [#uses=1] %R = fadd %f4 %p, < float 0x3FB99999A0000000, float 1.000000e+00, float 2.000000e+00, float 4.500000e+00 > ; <%f4> [#uses=1]
store %f4 %R, %f4* %S store %f4 %R, %f4* %S
ret void ret void
} }
define void @test_zero(%f4* %P, %f4* %S) { define void @test_zero(%f4* %P, %f4* %S) {
%p = load %f4* %P ; <%f4> [#uses=1] %p = load %f4* %P ; <%f4> [#uses=1]
%R = add %f4 %p, zeroinitializer ; <%f4> [#uses=1] %R = fadd %f4 %p, zeroinitializer ; <%f4> [#uses=1]
store %f4 %R, %f4* %S store %f4 %R, %f4* %S
ret void ret void
} }
define void @test_undef(%f4* %P, %f4* %S) { define void @test_undef(%f4* %P, %f4* %S) {
%p = load %f4* %P ; <%f4> [#uses=1] %p = load %f4* %P ; <%f4> [#uses=1]
%R = add %f4 %p, undef ; <%f4> [#uses=1] %R = fadd %f4 %p, undef ; <%f4> [#uses=1]
store %f4 %R, %f4* %S store %f4 %R, %f4* %S
ret void ret void
} }
@ -115,7 +115,7 @@ define double @test_extract_elt2(%d8* %P) {
define void @test_cast_1(%f4* %b, %i4* %a) { define void @test_cast_1(%f4* %b, %i4* %a) {
%tmp = load %f4* %b ; <%f4> [#uses=1] %tmp = load %f4* %b ; <%f4> [#uses=1]
%tmp2 = add %f4 %tmp, < float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00 > ; <%f4> [#uses=1] %tmp2 = fadd %f4 %tmp, < float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00 > ; <%f4> [#uses=1]
%tmp3 = bitcast %f4 %tmp2 to %i4 ; <%i4> [#uses=1] %tmp3 = bitcast %f4 %tmp2 to %i4 ; <%i4> [#uses=1]
%tmp4 = add %i4 %tmp3, < i32 1, i32 2, i32 3, i32 4 > ; <%i4> [#uses=1] %tmp4 = add %i4 %tmp3, < i32 1, i32 2, i32 3, i32 4 > ; <%i4> [#uses=1]
store %i4 %tmp4, %i4* %a store %i4 %tmp4, %i4* %a
@ -137,7 +137,7 @@ define void @splat(%f4* %P, %f4* %Q, float %X) {
%tmp4 = insertelement %f4 %tmp2, float %X, i32 2 ; <%f4> [#uses=1] %tmp4 = insertelement %f4 %tmp2, float %X, i32 2 ; <%f4> [#uses=1]
%tmp6 = insertelement %f4 %tmp4, float %X, i32 3 ; <%f4> [#uses=1] %tmp6 = insertelement %f4 %tmp4, float %X, i32 3 ; <%f4> [#uses=1]
%q = load %f4* %Q ; <%f4> [#uses=1] %q = load %f4* %Q ; <%f4> [#uses=1]
%R = add %f4 %q, %tmp6 ; <%f4> [#uses=1] %R = fadd %f4 %q, %tmp6 ; <%f4> [#uses=1]
store %f4 %R, %f4* %P store %f4 %R, %f4* %P
ret void ret void
} }

View File

@ -2,7 +2,7 @@
define i16 @test(double %d) nounwind { define i16 @test(double %d) nounwind {
entry: entry:
%add = add double %d, 1.000000e+00 %add = fadd double %d, 1.000000e+00
%call = tail call i16 @funct(double %add) nounwind %call = tail call i16 @funct(double %add) nounwind
ret i16 %call ret i16 %call
} }

View File

@ -5,6 +5,6 @@ target triple = "mipsallegrexel-psp-elf"
define double @dofloat(double %a, double %b) nounwind { define double @dofloat(double %a, double %b) nounwind {
entry: entry:
add double %a, %b ; <double>:0 [#uses=1] fadd double %a, %b ; <double>:0 [#uses=1]
ret double %0 ret double %0
} }

View File

@ -6,7 +6,7 @@ target triple = "mipsallegrexel-psp-elf"
define float @F(float %a) nounwind { define float @F(float %a) nounwind {
entry: entry:
add float %a, 0x4011333340000000 ; <float>:0 [#uses=1] fadd float %a, 0x4011333340000000 ; <float>:0 [#uses=1]
add float %0, 0x4010666660000000 ; <float>:1 [#uses=1] fadd float %0, 0x4010666660000000 ; <float>:1 [#uses=1]
ret float %1 ret float %1
} }

View File

@ -11,7 +11,7 @@ entry:
br i1 %0, label %bb, label %bb2 br i1 %0, label %bb, label %bb2
bb: ; preds = %entry bb: ; preds = %entry
add float %a, 1.000000e+00 ; <float>:1 [#uses=1] fadd float %a, 1.000000e+00 ; <float>:1 [#uses=1]
ret float %1 ret float %1
bb2: ; preds = %entry bb2: ; preds = %entry

View File

@ -9,7 +9,7 @@ define double @A(double %c, double %d) nounwind readnone {
entry: entry:
tail call double @fabs( double %c ) nounwind readnone ; <double>:0 [#uses=1] tail call double @fabs( double %c ) nounwind readnone ; <double>:0 [#uses=1]
tail call double @fabs( double %d ) nounwind readnone ; <double>:0 [#uses=1] tail call double @fabs( double %d ) nounwind readnone ; <double>:0 [#uses=1]
add double %0, %1 fadd double %0, %1
ret double %2 ret double %2
} }

View File

@ -21,12 +21,12 @@ entry:
load i16* %3, align 2 ; <i16>:4 [#uses=1] load i16* %3, align 2 ; <i16>:4 [#uses=1]
uitofp i16 %4 to double ; <double>:5 [#uses=1] uitofp i16 %4 to double ; <double>:5 [#uses=1]
tail call double @ldexp( double %5, i32 -32 ) nounwind ; <double>:6 [#uses=1] tail call double @ldexp( double %5, i32 -32 ) nounwind ; <double>:6 [#uses=1]
add double %2, %6 ; <double>:7 [#uses=1] fadd double %2, %6 ; <double>:7 [#uses=1]
getelementptr i16* %xseed, i32 2 ; <i16*>:8 [#uses=1] getelementptr i16* %xseed, i32 2 ; <i16*>:8 [#uses=1]
load i16* %8, align 2 ; <i16>:9 [#uses=1] load i16* %8, align 2 ; <i16>:9 [#uses=1]
uitofp i16 %9 to double ; <double>:10 [#uses=1] uitofp i16 %9 to double ; <double>:10 [#uses=1]
tail call double @ldexp( double %10, i32 -16 ) nounwind ; <double>:11 [#uses=1] tail call double @ldexp( double %10, i32 -16 ) nounwind ; <double>:11 [#uses=1]
add double %7, %11 ; <double>:12 [#uses=1] fadd double %7, %11 ; <double>:12 [#uses=1]
ret double %12 ret double %12
} }
@ -45,11 +45,11 @@ entry:
load i16* %4, align 2 ; <i16>:5 [#uses=1] load i16* %4, align 2 ; <i16>:5 [#uses=1]
uitofp i16 %5 to double ; <double>:6 [#uses=1] uitofp i16 %5 to double ; <double>:6 [#uses=1]
tail call double @ldexp( double %6, i32 -32 ) nounwind ; <double>:7 [#uses=1] tail call double @ldexp( double %6, i32 -32 ) nounwind ; <double>:7 [#uses=1]
add double %3, %7 ; <double>:8 [#uses=1] fadd double %3, %7 ; <double>:8 [#uses=1]
getelementptr i16* %xseed, i32 2 ; <i16*>:9 [#uses=1] getelementptr i16* %xseed, i32 2 ; <i16*>:9 [#uses=1]
load i16* %9, align 2 ; <i16>:10 [#uses=1] load i16* %9, align 2 ; <i16>:10 [#uses=1]
uitofp i16 %10 to double ; <double>:11 [#uses=1] uitofp i16 %10 to double ; <double>:11 [#uses=1]
tail call double @ldexp( double %11, i32 -16 ) nounwind ; <double>:12 [#uses=1] tail call double @ldexp( double %11, i32 -16 ) nounwind ; <double>:12 [#uses=1]
add double %8, %12 ; <double>:13 [#uses=1] fadd double %8, %12 ; <double>:13 [#uses=1]
ret double %13 ret double %13
} }

View File

@ -5,6 +5,6 @@ target triple = "powerpc-apple-darwin8.2.0"
; Dead argument should reserve an FP register. ; Dead argument should reserve an FP register.
define double @bar(double %DEAD, double %X, double %Y) { define double @bar(double %DEAD, double %X, double %Y) {
%tmp.2 = add double %X, %Y ; <double> [#uses=1] %tmp.2 = fadd double %X, %Y ; <double> [#uses=1]
ret double %tmp.2 ret double %tmp.2
} }

View File

@ -9,15 +9,15 @@ define void @offset(%struct.Point* %pt, double %x, double %y, double %z) {
entry: entry:
%tmp = getelementptr %struct.Point* %pt, i32 0, i32 0 ; <double*> [#uses=2] %tmp = getelementptr %struct.Point* %pt, i32 0, i32 0 ; <double*> [#uses=2]
%tmp.upgrd.1 = load double* %tmp ; <double> [#uses=1] %tmp.upgrd.1 = load double* %tmp ; <double> [#uses=1]
%tmp2 = add double %tmp.upgrd.1, %x ; <double> [#uses=1] %tmp2 = fadd double %tmp.upgrd.1, %x ; <double> [#uses=1]
store double %tmp2, double* %tmp store double %tmp2, double* %tmp
%tmp6 = getelementptr %struct.Point* %pt, i32 0, i32 1 ; <double*> [#uses=2] %tmp6 = getelementptr %struct.Point* %pt, i32 0, i32 1 ; <double*> [#uses=2]
%tmp7 = load double* %tmp6 ; <double> [#uses=1] %tmp7 = load double* %tmp6 ; <double> [#uses=1]
%tmp9 = add double %tmp7, %y ; <double> [#uses=1] %tmp9 = fadd double %tmp7, %y ; <double> [#uses=1]
store double %tmp9, double* %tmp6 store double %tmp9, double* %tmp6
%tmp13 = getelementptr %struct.Point* %pt, i32 0, i32 2 ; <double*> [#uses=2] %tmp13 = getelementptr %struct.Point* %pt, i32 0, i32 2 ; <double*> [#uses=2]
%tmp14 = load double* %tmp13 ; <double> [#uses=1] %tmp14 = load double* %tmp13 ; <double> [#uses=1]
%tmp16 = add double %tmp14, %z ; <double> [#uses=1] %tmp16 = fadd double %tmp14, %z ; <double> [#uses=1]
store double %tmp16, double* %tmp13 store double %tmp16, double* %tmp13
ret void ret void
} }

View File

@ -604,10 +604,10 @@ xPIF.exit: ; preds = %.critedge7898, %xOperationInitMasks.exit
shufflevector <4 x float> %583, <4 x float> undef, <4 x i32> < i32 3, i32 3, i32 3, i32 3 > ; <<4 x float>>:589 [#uses=1] shufflevector <4 x float> %583, <4 x float> undef, <4 x i32> < i32 3, i32 3, i32 3, i32 3 > ; <<4 x float>>:589 [#uses=1]
shufflevector <4 x float> %585, <4 x float> undef, <4 x i32> < i32 3, i32 3, i32 3, i32 3 > ; <<4 x float>>:590 [#uses=1] shufflevector <4 x float> %585, <4 x float> undef, <4 x i32> < i32 3, i32 3, i32 3, i32 3 > ; <<4 x float>>:590 [#uses=1]
shufflevector <4 x float> %588, <4 x float> undef, <4 x i32> < i32 3, i32 3, i32 3, i32 3 > ; <<4 x float>>:591 [#uses=1] shufflevector <4 x float> %588, <4 x float> undef, <4 x i32> < i32 3, i32 3, i32 3, i32 3 > ; <<4 x float>>:591 [#uses=1]
mul <4 x float> zeroinitializer, %589 ; <<4 x float>>:592 [#uses=0] fmul <4 x float> zeroinitializer, %589 ; <<4 x float>>:592 [#uses=0]
mul <4 x float> zeroinitializer, %590 ; <<4 x float>>:593 [#uses=0] fmul <4 x float> zeroinitializer, %590 ; <<4 x float>>:593 [#uses=0]
mul <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:594 [#uses=1] fmul <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:594 [#uses=1]
mul <4 x float> zeroinitializer, %591 ; <<4 x float>>:595 [#uses=0] fmul <4 x float> zeroinitializer, %591 ; <<4 x float>>:595 [#uses=0]
getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 4, i32 0 ; <<4 x float>*>:596 [#uses=2] getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 4, i32 0 ; <<4 x float>*>:596 [#uses=2]
load <4 x float>* %596 ; <<4 x float>>:597 [#uses=0] load <4 x float>* %596 ; <<4 x float>>:597 [#uses=0]
store <4 x float> zeroinitializer, <4 x float>* %596 store <4 x float> zeroinitializer, <4 x float>* %596
@ -621,8 +621,8 @@ xPIF.exit: ; preds = %.critedge7898, %xOperationInitMasks.exit
load <4 x float>* null ; <<4 x float>>:604 [#uses=1] load <4 x float>* null ; <<4 x float>>:604 [#uses=1]
getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 4, i32 2 ; <<4 x float>*>:605 [#uses=1] getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 4, i32 2 ; <<4 x float>*>:605 [#uses=1]
load <4 x float>* %605 ; <<4 x float>>:606 [#uses=1] load <4 x float>* %605 ; <<4 x float>>:606 [#uses=1]
sub <4 x float> zeroinitializer, %604 ; <<4 x float>>:607 [#uses=2] fsub <4 x float> zeroinitializer, %604 ; <<4 x float>>:607 [#uses=2]
sub <4 x float> zeroinitializer, %606 ; <<4 x float>>:608 [#uses=2] fsub <4 x float> zeroinitializer, %606 ; <<4 x float>>:608 [#uses=2]
call i32 @llvm.ppc.altivec.vcmpequw.p( i32 0, <4 x i32> zeroinitializer, <4 x i32> zeroinitializer ) ; <i32>:609 [#uses=0] call i32 @llvm.ppc.altivec.vcmpequw.p( i32 0, <4 x i32> zeroinitializer, <4 x i32> zeroinitializer ) ; <i32>:609 [#uses=0]
br i1 false, label %617, label %610 br i1 false, label %617, label %610
@ -672,21 +672,21 @@ xST.exit400: ; preds = %633, %625, %610
load <4 x float>* null ; <<4 x float>>:638 [#uses=2] load <4 x float>* null ; <<4 x float>>:638 [#uses=2]
getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 0, i32 2 ; <<4 x float>*>:639 [#uses=0] getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 0, i32 2 ; <<4 x float>*>:639 [#uses=0]
load <4 x float>* null ; <<4 x float>>:640 [#uses=2] load <4 x float>* null ; <<4 x float>>:640 [#uses=2]
mul <4 x float> %638, %638 ; <<4 x float>>:641 [#uses=1] fmul <4 x float> %638, %638 ; <<4 x float>>:641 [#uses=1]
mul <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:642 [#uses=0] fmul <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:642 [#uses=0]
mul <4 x float> %640, %640 ; <<4 x float>>:643 [#uses=2] fmul <4 x float> %640, %640 ; <<4 x float>>:643 [#uses=2]
shufflevector <4 x float> zeroinitializer, <4 x float> undef, <4 x i32> < i32 1, i32 1, i32 1, i32 1 > ; <<4 x float>>:644 [#uses=0] shufflevector <4 x float> zeroinitializer, <4 x float> undef, <4 x i32> < i32 1, i32 1, i32 1, i32 1 > ; <<4 x float>>:644 [#uses=0]
shufflevector <4 x float> %643, <4 x float> undef, <4 x i32> < i32 1, i32 1, i32 1, i32 1 > ; <<4 x float>>:645 [#uses=1] shufflevector <4 x float> %643, <4 x float> undef, <4 x i32> < i32 1, i32 1, i32 1, i32 1 > ; <<4 x float>>:645 [#uses=1]
add <4 x float> %645, %643 ; <<4 x float>>:646 [#uses=0] fadd <4 x float> %645, %643 ; <<4 x float>>:646 [#uses=0]
shufflevector <4 x float> zeroinitializer, <4 x float> undef, <4 x i32> < i32 2, i32 2, i32 2, i32 2 > ; <<4 x float>>:647 [#uses=1] shufflevector <4 x float> zeroinitializer, <4 x float> undef, <4 x i32> < i32 2, i32 2, i32 2, i32 2 > ; <<4 x float>>:647 [#uses=1]
shufflevector <4 x float> %641, <4 x float> undef, <4 x i32> < i32 2, i32 2, i32 2, i32 2 > ; <<4 x float>>:648 [#uses=1] shufflevector <4 x float> %641, <4 x float> undef, <4 x i32> < i32 2, i32 2, i32 2, i32 2 > ; <<4 x float>>:648 [#uses=1]
add <4 x float> zeroinitializer, %647 ; <<4 x float>>:649 [#uses=2] fadd <4 x float> zeroinitializer, %647 ; <<4 x float>>:649 [#uses=2]
add <4 x float> zeroinitializer, %648 ; <<4 x float>>:650 [#uses=0] fadd <4 x float> zeroinitializer, %648 ; <<4 x float>>:650 [#uses=0]
add <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:651 [#uses=2] fadd <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:651 [#uses=2]
call <4 x float> @llvm.ppc.altivec.vrsqrtefp( <4 x float> %649 ) ; <<4 x float>>:652 [#uses=1] call <4 x float> @llvm.ppc.altivec.vrsqrtefp( <4 x float> %649 ) ; <<4 x float>>:652 [#uses=1]
mul <4 x float> %652, %649 ; <<4 x float>>:653 [#uses=1] fmul <4 x float> %652, %649 ; <<4 x float>>:653 [#uses=1]
call <4 x float> @llvm.ppc.altivec.vrsqrtefp( <4 x float> %651 ) ; <<4 x float>>:654 [#uses=1] call <4 x float> @llvm.ppc.altivec.vrsqrtefp( <4 x float> %651 ) ; <<4 x float>>:654 [#uses=1]
mul <4 x float> %654, %651 ; <<4 x float>>:655 [#uses=0] fmul <4 x float> %654, %651 ; <<4 x float>>:655 [#uses=0]
icmp eq i32 0, 0 ; <i1>:656 [#uses=1] icmp eq i32 0, 0 ; <i1>:656 [#uses=1]
br i1 %656, label %665, label %657 br i1 %656, label %665, label %657
@ -721,9 +721,9 @@ xST.exit402: ; preds = %669, %657
load <4 x float>* null ; <<4 x float>>:676 [#uses=0] load <4 x float>* null ; <<4 x float>>:676 [#uses=0]
shufflevector <4 x float> zeroinitializer, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:677 [#uses=1] shufflevector <4 x float> zeroinitializer, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:677 [#uses=1]
shufflevector <4 x float> %675, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:678 [#uses=1] shufflevector <4 x float> %675, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:678 [#uses=1]
mul <4 x float> zeroinitializer, %677 ; <<4 x float>>:679 [#uses=0] fmul <4 x float> zeroinitializer, %677 ; <<4 x float>>:679 [#uses=0]
mul <4 x float> zeroinitializer, %678 ; <<4 x float>>:680 [#uses=0] fmul <4 x float> zeroinitializer, %678 ; <<4 x float>>:680 [#uses=0]
mul <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:681 [#uses=1] fmul <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:681 [#uses=1]
icmp eq i32 0, 0 ; <i1>:682 [#uses=1] icmp eq i32 0, 0 ; <i1>:682 [#uses=1]
br i1 %682, label %689, label %683 br i1 %682, label %689, label %683
@ -750,7 +750,7 @@ xST.exit405: ; preds = %689, %683
load <4 x float>* null ; <<4 x float>>:698 [#uses=0] load <4 x float>* null ; <<4 x float>>:698 [#uses=0]
getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 5, i32 2 ; <<4 x float>*>:699 [#uses=0] getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 5, i32 2 ; <<4 x float>*>:699 [#uses=0]
shufflevector <4 x float> zeroinitializer, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:700 [#uses=1] shufflevector <4 x float> zeroinitializer, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:700 [#uses=1]
add <4 x float> zeroinitializer, %700 ; <<4 x float>>:701 [#uses=0] fadd <4 x float> zeroinitializer, %700 ; <<4 x float>>:701 [#uses=0]
load <4 x i32>* %.sub7896 ; <<4 x i32>>:702 [#uses=1] load <4 x i32>* %.sub7896 ; <<4 x i32>>:702 [#uses=1]
call i32 @llvm.ppc.altivec.vcmpequw.p( i32 0, <4 x i32> %702, <4 x i32> zeroinitializer ) ; <i32>:703 [#uses=0] call i32 @llvm.ppc.altivec.vcmpequw.p( i32 0, <4 x i32> %702, <4 x i32> zeroinitializer ) ; <i32>:703 [#uses=0]
getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 1, i32 1 ; <<4 x float>*>:704 [#uses=2] getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 1, i32 1 ; <<4 x float>*>:704 [#uses=2]
@ -769,7 +769,7 @@ xST.exit405: ; preds = %689, %683
getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 4, i32 2 ; <<4 x float>*>:714 [#uses=1] getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 4, i32 2 ; <<4 x float>*>:714 [#uses=1]
load <4 x float>* %714 ; <<4 x float>>:715 [#uses=0] load <4 x float>* %714 ; <<4 x float>>:715 [#uses=0]
shufflevector <4 x float> zeroinitializer, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:716 [#uses=0] shufflevector <4 x float> zeroinitializer, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:716 [#uses=0]
mul <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:717 [#uses=1] fmul <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:717 [#uses=1]
load <4 x i32>* %.sub7896 ; <<4 x i32>>:718 [#uses=0] load <4 x i32>* %.sub7896 ; <<4 x i32>>:718 [#uses=0]
getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 5, i32 0 ; <<4 x float>*>:719 [#uses=1] getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 5, i32 0 ; <<4 x float>*>:719 [#uses=1]
store <4 x float> zeroinitializer, <4 x float>* %719 store <4 x float> zeroinitializer, <4 x float>* %719
@ -791,10 +791,10 @@ xST.exit405: ; preds = %689, %683
load <4 x float>* %732 ; <<4 x float>>:733 [#uses=0] load <4 x float>* %732 ; <<4 x float>>:733 [#uses=0]
getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 4, i32 3 ; <<4 x float>*>:734 [#uses=0] getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 4, i32 3 ; <<4 x float>*>:734 [#uses=0]
shufflevector <4 x float> zeroinitializer, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:735 [#uses=1] shufflevector <4 x float> zeroinitializer, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:735 [#uses=1]
mul <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:736 [#uses=1] fmul <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:736 [#uses=1]
mul <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:737 [#uses=1] fmul <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:737 [#uses=1]
mul <4 x float> zeroinitializer, %735 ; <<4 x float>>:738 [#uses=1] fmul <4 x float> zeroinitializer, %735 ; <<4 x float>>:738 [#uses=1]
mul <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:739 [#uses=1] fmul <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:739 [#uses=1]
call i32 @llvm.ppc.altivec.vcmpequw.p( i32 0, <4 x i32> zeroinitializer, <4 x i32> zeroinitializer ) ; <i32>:740 [#uses=1] call i32 @llvm.ppc.altivec.vcmpequw.p( i32 0, <4 x i32> zeroinitializer, <4 x i32> zeroinitializer ) ; <i32>:740 [#uses=1]
icmp eq i32 %740, 0 ; <i1>:741 [#uses=0] icmp eq i32 %740, 0 ; <i1>:741 [#uses=0]
getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 4, i32 0 ; <<4 x float>*>:742 [#uses=2] getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 4, i32 0 ; <<4 x float>*>:742 [#uses=2]
@ -821,9 +821,9 @@ xST.exit405: ; preds = %689, %683
getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 4, i32 3 ; <<4 x float>*>:761 [#uses=0] getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 4, i32 3 ; <<4 x float>*>:761 [#uses=0]
shufflevector <4 x float> zeroinitializer, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:762 [#uses=0] shufflevector <4 x float> zeroinitializer, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:762 [#uses=0]
shufflevector <4 x float> zeroinitializer, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:763 [#uses=1] shufflevector <4 x float> zeroinitializer, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:763 [#uses=1]
add <4 x float> %757, zeroinitializer ; <<4 x float>>:764 [#uses=0] fadd <4 x float> %757, zeroinitializer ; <<4 x float>>:764 [#uses=0]
add <4 x float> %758, %763 ; <<4 x float>>:765 [#uses=0] fadd <4 x float> %758, %763 ; <<4 x float>>:765 [#uses=0]
mul <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:766 [#uses=1] fmul <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:766 [#uses=1]
br i1 false, label %773, label %767 br i1 false, label %773, label %767
; <label>:767 ; preds = %xST.exit405 ; <label>:767 ; preds = %xST.exit405
@ -841,7 +841,7 @@ xST.exit405: ; preds = %689, %683
xST.exit422: ; preds = %773, %767 xST.exit422: ; preds = %773, %767
%.07267 = phi <4 x float> [ %766, %767 ], [ undef, %773 ] ; <<4 x float>> [#uses=0] %.07267 = phi <4 x float> [ %766, %767 ], [ undef, %773 ] ; <<4 x float>> [#uses=0]
getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 0, i32 3 ; <<4 x float>*>:774 [#uses=0] getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 0, i32 3 ; <<4 x float>*>:774 [#uses=0]
mul <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:775 [#uses=0] fmul <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:775 [#uses=0]
icmp eq i32 0, 0 ; <i1>:776 [#uses=1] icmp eq i32 0, 0 ; <i1>:776 [#uses=1]
br i1 %776, label %780, label %777 br i1 %776, label %780, label %777
@ -1295,7 +1295,7 @@ xST.exit469: ; preds = %1027, %1025, %1005
%.07489 = phi <4 x float> [ %1002, %1005 ], [ %.17490, %1027 ], [ %.17490, %1025 ] ; <<4 x float>> [#uses=1] %.07489 = phi <4 x float> [ %1002, %1005 ], [ %.17490, %1027 ], [ %.17490, %1025 ] ; <<4 x float>> [#uses=1]
load <4 x float>* null ; <<4 x float>>:1029 [#uses=0] load <4 x float>* null ; <<4 x float>>:1029 [#uses=0]
load <4 x float>* null ; <<4 x float>>:1030 [#uses=0] load <4 x float>* null ; <<4 x float>>:1030 [#uses=0]
sub <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:1031 [#uses=1] fsub <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:1031 [#uses=1]
br i1 false, label %1037, label %1032 br i1 false, label %1037, label %1032
; <label>:1032 ; preds = %xST.exit469 ; <label>:1032 ; preds = %xST.exit469
@ -1368,8 +1368,8 @@ xST.exit472: ; preds = %1050, %1048, %1032
xST.exit474: ; preds = %1059, %1058, %1051 xST.exit474: ; preds = %1059, %1058, %1051
load <4 x float>* null ; <<4 x float>>:1060 [#uses=1] load <4 x float>* null ; <<4 x float>>:1060 [#uses=1]
mul <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:1061 [#uses=1] fmul <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:1061 [#uses=1]
mul <4 x float> %1060, zeroinitializer ; <<4 x float>>:1062 [#uses=2] fmul <4 x float> %1060, zeroinitializer ; <<4 x float>>:1062 [#uses=2]
br i1 false, label %1065, label %1063 br i1 false, label %1065, label %1063
; <label>:1063 ; preds = %xST.exit474 ; <label>:1063 ; preds = %xST.exit474
@ -1556,8 +1556,8 @@ xST.exit489: ; preds = %1109, %1108, %1101
xST.exit492: ; preds = %1118, %1117, %1110 xST.exit492: ; preds = %1118, %1117, %1110
load <4 x float>* null ; <<4 x float>>:1119 [#uses=1] load <4 x float>* null ; <<4 x float>>:1119 [#uses=1]
mul <4 x float> %1119, zeroinitializer ; <<4 x float>>:1120 [#uses=1] fmul <4 x float> %1119, zeroinitializer ; <<4 x float>>:1120 [#uses=1]
mul <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:1121 [#uses=1] fmul <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:1121 [#uses=1]
br i1 false, label %1123, label %1122 br i1 false, label %1123, label %1122
; <label>:1122 ; preds = %xST.exit492 ; <label>:1122 ; preds = %xST.exit492
@ -1591,8 +1591,8 @@ xST.exit495: ; preds = %1130, %1129, %1122
%.07582 = phi <4 x float> [ %1121, %1122 ], [ %.17583, %1130 ], [ %.17583, %1129 ] ; <<4 x float>> [#uses=1] %.07582 = phi <4 x float> [ %1121, %1122 ], [ %.17583, %1130 ], [ %.17583, %1129 ] ; <<4 x float>> [#uses=1]
%.07590 = phi <4 x float> [ %1120, %1122 ], [ %.17591, %1130 ], [ %.17591, %1129 ] ; <<4 x float>> [#uses=1] %.07590 = phi <4 x float> [ %1120, %1122 ], [ %.17591, %1130 ], [ %.17591, %1129 ] ; <<4 x float>> [#uses=1]
load <4 x float>* null ; <<4 x float>>:1131 [#uses=1] load <4 x float>* null ; <<4 x float>>:1131 [#uses=1]
add <4 x float> %1131, zeroinitializer ; <<4 x float>>:1132 [#uses=1] fadd <4 x float> %1131, zeroinitializer ; <<4 x float>>:1132 [#uses=1]
add <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:1133 [#uses=1] fadd <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:1133 [#uses=1]
br i1 false, label %1135, label %1134 br i1 false, label %1135, label %1134
; <label>:1134 ; preds = %xST.exit495 ; <label>:1134 ; preds = %xST.exit495
@ -1633,10 +1633,10 @@ xST.exit498: ; preds = %1142, %1141, %1134
shufflevector <4 x float> %1143, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:1148 [#uses=1] shufflevector <4 x float> %1143, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:1148 [#uses=1]
shufflevector <4 x float> %1145, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:1149 [#uses=1] shufflevector <4 x float> %1145, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:1149 [#uses=1]
shufflevector <4 x float> %1147, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:1150 [#uses=1] shufflevector <4 x float> %1147, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:1150 [#uses=1]
mul <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:1151 [#uses=1] fmul <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:1151 [#uses=1]
mul <4 x float> zeroinitializer, %1148 ; <<4 x float>>:1152 [#uses=1] fmul <4 x float> zeroinitializer, %1148 ; <<4 x float>>:1152 [#uses=1]
mul <4 x float> zeroinitializer, %1149 ; <<4 x float>>:1153 [#uses=1] fmul <4 x float> zeroinitializer, %1149 ; <<4 x float>>:1153 [#uses=1]
mul <4 x float> zeroinitializer, %1150 ; <<4 x float>>:1154 [#uses=1] fmul <4 x float> zeroinitializer, %1150 ; <<4 x float>>:1154 [#uses=1]
br i1 false, label %1156, label %1155 br i1 false, label %1156, label %1155
; <label>:1155 ; preds = %xST.exit498 ; <label>:1155 ; preds = %xST.exit498
@ -1676,10 +1676,10 @@ xST.exit501: ; preds = %1163, %1162, %1155
load <4 x float>* %1165 ; <<4 x float>>:1166 [#uses=1] load <4 x float>* %1165 ; <<4 x float>>:1166 [#uses=1]
getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 0, i32 3 ; <<4 x float>*>:1167 [#uses=1] getelementptr [193 x [4 x <4 x float>]]* null, i32 0, i32 0, i32 3 ; <<4 x float>*>:1167 [#uses=1]
load <4 x float>* %1167 ; <<4 x float>>:1168 [#uses=1] load <4 x float>* %1167 ; <<4 x float>>:1168 [#uses=1]
add <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:1169 [#uses=1] fadd <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:1169 [#uses=1]
add <4 x float> zeroinitializer, %1164 ; <<4 x float>>:1170 [#uses=1] fadd <4 x float> zeroinitializer, %1164 ; <<4 x float>>:1170 [#uses=1]
add <4 x float> zeroinitializer, %1166 ; <<4 x float>>:1171 [#uses=1] fadd <4 x float> zeroinitializer, %1166 ; <<4 x float>>:1171 [#uses=1]
add <4 x float> zeroinitializer, %1168 ; <<4 x float>>:1172 [#uses=1] fadd <4 x float> zeroinitializer, %1168 ; <<4 x float>>:1172 [#uses=1]
br i1 false, label %1174, label %1173 br i1 false, label %1174, label %1173
; <label>:1173 ; preds = %xST.exit501 ; <label>:1173 ; preds = %xST.exit501
@ -1714,7 +1714,7 @@ xST.exit504: ; preds = %1181, %1180, %1173
%.07726 = phi <4 x float> [ %1171, %1173 ], [ %.17727, %1181 ], [ %.17727, %1180 ] ; <<4 x float>> [#uses=1] %.07726 = phi <4 x float> [ %1171, %1173 ], [ %.17727, %1181 ], [ %.17727, %1180 ] ; <<4 x float>> [#uses=1]
%.07730 = phi <4 x float> [ %1170, %1173 ], [ %.17731, %1181 ], [ %.17731, %1180 ] ; <<4 x float>> [#uses=1] %.07730 = phi <4 x float> [ %1170, %1173 ], [ %.17731, %1181 ], [ %.17731, %1180 ] ; <<4 x float>> [#uses=1]
%.07734 = phi <4 x float> [ %1169, %1173 ], [ %.17735, %1181 ], [ %.17735, %1180 ] ; <<4 x float>> [#uses=1] %.07734 = phi <4 x float> [ %1169, %1173 ], [ %.17735, %1181 ], [ %.17735, %1180 ] ; <<4 x float>> [#uses=1]
add <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:1182 [#uses=1] fadd <4 x float> zeroinitializer, zeroinitializer ; <<4 x float>>:1182 [#uses=1]
br i1 false, label %1184, label %1183 br i1 false, label %1184, label %1183
; <label>:1183 ; preds = %xST.exit504 ; <label>:1183 ; preds = %xST.exit504

View File

@ -9,8 +9,8 @@ entry:
%input2 = load <4 x float>* null, align 16 ; <<4 x float>> %input2 = load <4 x float>* null, align 16 ; <<4 x float>>
%shuffle7 = shufflevector <4 x float> %input2, <4 x float> < float 0.000000e+00, float 1.000000e+00, float 0.000000e+00, float 1.000000e+00 >, <4 x i32> < i32 2, i32 2, i32 2, i32 2 > ; <<4 x float>> [#uses=1] %shuffle7 = shufflevector <4 x float> %input2, <4 x float> < float 0.000000e+00, float 1.000000e+00, float 0.000000e+00, float 1.000000e+00 >, <4 x i32> < i32 2, i32 2, i32 2, i32 2 > ; <<4 x float>> [#uses=1]
%mul1 = mul <4 x float> %shuffle7, zeroinitializer ; <<4 x %mul1 = fmul <4 x float> %shuffle7, zeroinitializer ; <<4 x
%add2 = add <4 x float> %mul1, %input2 ; <<4 x float>> %add2 = fadd <4 x float> %mul1, %input2 ; <<4 x float>>
store <4 x float> %add2, <4 x float>* null, align 16 store <4 x float> %add2, <4 x float>* null, align 16
ret void ret void
} }

View File

@ -7,11 +7,11 @@ entry:
call ppc_fp128 @fabsl( ppc_fp128 %d ) nounwind readnone ; <ppc_fp128>:0 [#uses=1] call ppc_fp128 @fabsl( ppc_fp128 %d ) nounwind readnone ; <ppc_fp128>:0 [#uses=1]
fcmp olt ppc_fp128 0xM00000000000000000000000000000000, %0 ; <i1>:1 [#uses=1] fcmp olt ppc_fp128 0xM00000000000000000000000000000000, %0 ; <i1>:1 [#uses=1]
%.pn106 = select i1 %1, ppc_fp128 %a, ppc_fp128 0xM00000000000000000000000000000000 ; <ppc_fp128> [#uses=1] %.pn106 = select i1 %1, ppc_fp128 %a, ppc_fp128 0xM00000000000000000000000000000000 ; <ppc_fp128> [#uses=1]
%.pn = sub ppc_fp128 0xM00000000000000000000000000000000, %.pn106 ; <ppc_fp128> [#uses=1] %.pn = fsub ppc_fp128 0xM00000000000000000000000000000000, %.pn106 ; <ppc_fp128> [#uses=1]
%y.0 = fdiv ppc_fp128 %.pn, 0xM00000000000000000000000000000000 ; <ppc_fp128> [#uses=1] %y.0 = fdiv ppc_fp128 %.pn, 0xM00000000000000000000000000000000 ; <ppc_fp128> [#uses=1]
mul ppc_fp128 %y.0, 0xM3FF00000000000000000000000000000 ; <ppc_fp128>:2 [#uses=1] fmul ppc_fp128 %y.0, 0xM3FF00000000000000000000000000000 ; <ppc_fp128>:2 [#uses=1]
add ppc_fp128 %2, mul (ppc_fp128 0xM00000000000000000000000000000000, ppc_fp128 0xM00000000000000000000000000000000) ; <ppc_fp128>:3 [#uses=1] fadd ppc_fp128 %2, fmul (ppc_fp128 0xM00000000000000000000000000000000, ppc_fp128 0xM00000000000000000000000000000000) ; <ppc_fp128>:3 [#uses=1]
%tmpi = add ppc_fp128 %3, 0xM00000000000000000000000000000000 ; <ppc_fp128> [#uses=1] %tmpi = fadd ppc_fp128 %3, 0xM00000000000000000000000000000000 ; <ppc_fp128> [#uses=1]
store ppc_fp128 %tmpi, ppc_fp128* null, align 16 store ppc_fp128 %tmpi, ppc_fp128* null, align 16
ret i256 0 ret i256 0
} }

View File

@ -7,7 +7,7 @@ entry:
br i1 false, label %bb3, label %bb4 br i1 false, label %bb3, label %bb4
bb3: ; preds = %entry bb3: ; preds = %entry
sub ppc_fp128 0xM80000000000000000000000000000000, 0xM00000000000000000000000000000000 ; <ppc_fp128>:0 [#uses=1] fsub ppc_fp128 0xM80000000000000000000000000000000, 0xM00000000000000000000000000000000 ; <ppc_fp128>:0 [#uses=1]
fptoui ppc_fp128 %0 to i32 ; <i32>:1 [#uses=1] fptoui ppc_fp128 %0 to i32 ; <i32>:1 [#uses=1]
zext i32 %1 to i64 ; <i64>:2 [#uses=1] zext i32 %1 to i64 ; <i64>:2 [#uses=1]
sub i64 0, %2 ; <i64>:3 [#uses=1] sub i64 0, %2 ; <i64>:3 [#uses=1]

View File

@ -29,10 +29,10 @@ bb2217: ; preds = %bb2326
%10 = load float* %9, align 4 ; <float> [#uses=1] %10 = load float* %9, align 4 ; <float> [#uses=1]
%11 = getelementptr float* null, i32 3 ; <float*> [#uses=1] %11 = getelementptr float* null, i32 3 ; <float*> [#uses=1]
%12 = load float* %11, align 4 ; <float> [#uses=1] %12 = load float* %11, align 4 ; <float> [#uses=1]
%13 = mul float %10, 6.553500e+04 ; <float> [#uses=1] %13 = fmul float %10, 6.553500e+04 ; <float> [#uses=1]
%14 = add float %13, 5.000000e-01 ; <float> [#uses=1] %14 = fadd float %13, 5.000000e-01 ; <float> [#uses=1]
%15 = mul float %12, 6.553500e+04 ; <float> [#uses=1] %15 = fmul float %12, 6.553500e+04 ; <float> [#uses=1]
%16 = add float %15, 5.000000e-01 ; <float> [#uses=3] %16 = fadd float %15, 5.000000e-01 ; <float> [#uses=3]
%17 = fcmp olt float %14, 0.000000e+00 ; <i1> [#uses=0] %17 = fcmp olt float %14, 0.000000e+00 ; <i1> [#uses=0]
%18 = fcmp olt float %16, 0.000000e+00 ; <i1> [#uses=1] %18 = fcmp olt float %16, 0.000000e+00 ; <i1> [#uses=1]
br i1 %18, label %bb2265, label %bb2262 br i1 %18, label %bb2265, label %bb2262
@ -68,10 +68,10 @@ bb2265: ; preds = %bb2264, %bb2262, %bb2217
%37 = load float* %36, align 4 ; <float> [#uses=1] %37 = load float* %36, align 4 ; <float> [#uses=1]
%38 = getelementptr float* %36, i32 1 ; <float*> [#uses=1] %38 = getelementptr float* %36, i32 1 ; <float*> [#uses=1]
%39 = load float* %38, align 4 ; <float> [#uses=1] %39 = load float* %38, align 4 ; <float> [#uses=1]
%40 = mul float %37, 6.553500e+04 ; <float> [#uses=1] %40 = fmul float %37, 6.553500e+04 ; <float> [#uses=1]
%41 = add float %40, 5.000000e-01 ; <float> [#uses=1] %41 = fadd float %40, 5.000000e-01 ; <float> [#uses=1]
%42 = mul float %39, 6.553500e+04 ; <float> [#uses=1] %42 = fmul float %39, 6.553500e+04 ; <float> [#uses=1]
%43 = add float %42, 5.000000e-01 ; <float> [#uses=3] %43 = fadd float %42, 5.000000e-01 ; <float> [#uses=3]
%44 = fcmp olt float %41, 0.000000e+00 ; <i1> [#uses=0] %44 = fcmp olt float %41, 0.000000e+00 ; <i1> [#uses=0]
%45 = fcmp olt float %43, 0.000000e+00 ; <i1> [#uses=1] %45 = fcmp olt float %43, 0.000000e+00 ; <i1> [#uses=1]
br i1 %45, label %bb2277, label %bb2274 br i1 %45, label %bb2277, label %bb2274
@ -88,10 +88,10 @@ bb2277: ; preds = %bb2274, %bb2265
%50 = load float* %49, align 4 ; <float> [#uses=1] %50 = load float* %49, align 4 ; <float> [#uses=1]
%51 = getelementptr float* %36, i32 3 ; <float*> [#uses=1] %51 = getelementptr float* %36, i32 3 ; <float*> [#uses=1]
%52 = load float* %51, align 4 ; <float> [#uses=1] %52 = load float* %51, align 4 ; <float> [#uses=1]
%53 = mul float %50, 6.553500e+04 ; <float> [#uses=1] %53 = fmul float %50, 6.553500e+04 ; <float> [#uses=1]
%54 = add float %53, 5.000000e-01 ; <float> [#uses=1] %54 = fadd float %53, 5.000000e-01 ; <float> [#uses=1]
%55 = mul float %52, 6.553500e+04 ; <float> [#uses=1] %55 = fmul float %52, 6.553500e+04 ; <float> [#uses=1]
%56 = add float %55, 5.000000e-01 ; <float> [#uses=1] %56 = fadd float %55, 5.000000e-01 ; <float> [#uses=1]
%57 = fcmp olt float %54, 0.000000e+00 ; <i1> [#uses=0] %57 = fcmp olt float %54, 0.000000e+00 ; <i1> [#uses=0]
%58 = fcmp olt float %56, 0.000000e+00 ; <i1> [#uses=0] %58 = fcmp olt float %56, 0.000000e+00 ; <i1> [#uses=0]
%59 = fptosi float 0.000000e+00 to i32 ; <i32> [#uses=1] %59 = fptosi float 0.000000e+00 to i32 ; <i32> [#uses=1]
@ -111,10 +111,10 @@ bb2277: ; preds = %bb2274, %bb2265
%73 = load float* %72, align 4 ; <float> [#uses=1] %73 = load float* %72, align 4 ; <float> [#uses=1]
%74 = getelementptr float* %72, i32 1 ; <float*> [#uses=1] %74 = getelementptr float* %72, i32 1 ; <float*> [#uses=1]
%75 = load float* %74, align 4 ; <float> [#uses=1] %75 = load float* %74, align 4 ; <float> [#uses=1]
%76 = mul float %73, 6.553500e+04 ; <float> [#uses=1] %76 = fmul float %73, 6.553500e+04 ; <float> [#uses=1]
%77 = add float %76, 5.000000e-01 ; <float> [#uses=3] %77 = fadd float %76, 5.000000e-01 ; <float> [#uses=3]
%78 = mul float %75, 6.553500e+04 ; <float> [#uses=1] %78 = fmul float %75, 6.553500e+04 ; <float> [#uses=1]
%79 = add float %78, 5.000000e-01 ; <float> [#uses=1] %79 = fadd float %78, 5.000000e-01 ; <float> [#uses=1]
%80 = fcmp olt float %77, 0.000000e+00 ; <i1> [#uses=1] %80 = fcmp olt float %77, 0.000000e+00 ; <i1> [#uses=1]
br i1 %80, label %bb2295, label %bb2292 br i1 %80, label %bb2295, label %bb2292
@ -134,10 +134,10 @@ bb2295: ; preds = %bb2294, %bb2292, %bb2277
%86 = load float* %85, align 4 ; <float> [#uses=1] %86 = load float* %85, align 4 ; <float> [#uses=1]
%87 = getelementptr float* %72, i32 3 ; <float*> [#uses=1] %87 = getelementptr float* %72, i32 3 ; <float*> [#uses=1]
%88 = load float* %87, align 4 ; <float> [#uses=1] %88 = load float* %87, align 4 ; <float> [#uses=1]
%89 = mul float %86, 6.553500e+04 ; <float> [#uses=1] %89 = fmul float %86, 6.553500e+04 ; <float> [#uses=1]
%90 = add float %89, 5.000000e-01 ; <float> [#uses=1] %90 = fadd float %89, 5.000000e-01 ; <float> [#uses=1]
%91 = mul float %88, 6.553500e+04 ; <float> [#uses=1] %91 = fmul float %88, 6.553500e+04 ; <float> [#uses=1]
%92 = add float %91, 5.000000e-01 ; <float> [#uses=1] %92 = fadd float %91, 5.000000e-01 ; <float> [#uses=1]
%93 = fcmp olt float %90, 0.000000e+00 ; <i1> [#uses=0] %93 = fcmp olt float %90, 0.000000e+00 ; <i1> [#uses=0]
%94 = fcmp olt float %92, 0.000000e+00 ; <i1> [#uses=0] %94 = fcmp olt float %92, 0.000000e+00 ; <i1> [#uses=0]
%95 = fptosi float 0.000000e+00 to i32 ; <i32> [#uses=1] %95 = fptosi float 0.000000e+00 to i32 ; <i32> [#uses=1]

View File

@ -3,9 +3,9 @@
define void @__divtc3({ ppc_fp128, ppc_fp128 }* noalias sret %agg.result, ppc_fp128 %a, ppc_fp128 %b, ppc_fp128 %c, ppc_fp128 %d) nounwind { define void @__divtc3({ ppc_fp128, ppc_fp128 }* noalias sret %agg.result, ppc_fp128 %a, ppc_fp128 %b, ppc_fp128 %c, ppc_fp128 %d) nounwind {
entry: entry:
%imag59 = load ppc_fp128* null, align 8 ; <ppc_fp128> [#uses=1] %imag59 = load ppc_fp128* null, align 8 ; <ppc_fp128> [#uses=1]
%0 = mul ppc_fp128 0xM00000000000000000000000000000000, %imag59 ; <ppc_fp128> [#uses=1] %0 = fmul ppc_fp128 0xM00000000000000000000000000000000, %imag59 ; <ppc_fp128> [#uses=1]
%1 = mul ppc_fp128 0xM00000000000000000000000000000000, 0xM00000000000000000000000000000000 ; <ppc_fp128> [#uses=1] %1 = fmul ppc_fp128 0xM00000000000000000000000000000000, 0xM00000000000000000000000000000000 ; <ppc_fp128> [#uses=1]
%2 = add ppc_fp128 %0, %1 ; <ppc_fp128> [#uses=1] %2 = fadd ppc_fp128 %0, %1 ; <ppc_fp128> [#uses=1]
store ppc_fp128 %2, ppc_fp128* null, align 16 store ppc_fp128 %2, ppc_fp128* null, align 16
unreachable unreachable
} }

View File

@ -6,17 +6,17 @@ entry:
br i1 %0, label %bb5, label %bb1 br i1 %0, label %bb5, label %bb1
bb1: ; preds = %entry bb1: ; preds = %entry
%1 = mul ppc_fp128 %a, 0xM3DF00000000000000000000000000000 ; <ppc_fp128> [#uses=1] %1 = fmul ppc_fp128 %a, 0xM3DF00000000000000000000000000000 ; <ppc_fp128> [#uses=1]
%2 = fptoui ppc_fp128 %1 to i32 ; <i32> [#uses=1] %2 = fptoui ppc_fp128 %1 to i32 ; <i32> [#uses=1]
%3 = zext i32 %2 to i64 ; <i64> [#uses=1] %3 = zext i32 %2 to i64 ; <i64> [#uses=1]
%4 = shl i64 %3, 32 ; <i64> [#uses=3] %4 = shl i64 %3, 32 ; <i64> [#uses=3]
%5 = uitofp i64 %4 to ppc_fp128 ; <ppc_fp128> [#uses=1] %5 = uitofp i64 %4 to ppc_fp128 ; <ppc_fp128> [#uses=1]
%6 = sub ppc_fp128 %a, %5 ; <ppc_fp128> [#uses=3] %6 = fsub ppc_fp128 %a, %5 ; <ppc_fp128> [#uses=3]
%7 = fcmp olt ppc_fp128 %6, 0xM00000000000000000000000000000000 ; <i1> [#uses=1] %7 = fcmp olt ppc_fp128 %6, 0xM00000000000000000000000000000000 ; <i1> [#uses=1]
br i1 %7, label %bb2, label %bb3 br i1 %7, label %bb2, label %bb3
bb2: ; preds = %bb1 bb2: ; preds = %bb1
%8 = sub ppc_fp128 0xM80000000000000000000000000000000, %6 ; <ppc_fp128> [#uses=1] %8 = fsub ppc_fp128 0xM80000000000000000000000000000000, %6 ; <ppc_fp128> [#uses=1]
%9 = fptoui ppc_fp128 %8 to i32 ; <i32> [#uses=1] %9 = fptoui ppc_fp128 %8 to i32 ; <i32> [#uses=1]
%10 = zext i32 %9 to i64 ; <i64> [#uses=1] %10 = zext i32 %9 to i64 ; <i64> [#uses=1]
%11 = sub i64 %4, %10 ; <i64> [#uses=1] %11 = sub i64 %4, %10 ; <i64> [#uses=1]

View File

@ -11,7 +11,7 @@
define void @VXOR(<4 x float>* %P1, <4 x i32>* %P2, <4 x float>* %P3) { define void @VXOR(<4 x float>* %P1, <4 x i32>* %P2, <4 x float>* %P3) {
%tmp = load <4 x float>* %P3 ; <<4 x float>> [#uses=1] %tmp = load <4 x float>* %P3 ; <<4 x float>> [#uses=1]
%tmp3 = load <4 x float>* %P1 ; <<4 x float>> [#uses=1] %tmp3 = load <4 x float>* %P1 ; <<4 x float>> [#uses=1]
%tmp4 = mul <4 x float> %tmp, %tmp3 ; <<4 x float>> [#uses=1] %tmp4 = fmul <4 x float> %tmp, %tmp3 ; <<4 x float>> [#uses=1]
store <4 x float> %tmp4, <4 x float>* %P3 store <4 x float> %tmp4, <4 x float>* %P3
store <4 x float> zeroinitializer, <4 x float>* %P1 store <4 x float> zeroinitializer, <4 x float>* %P1
store <4 x i32> zeroinitializer, <4 x i32>* %P2 store <4 x i32> zeroinitializer, <4 x i32>* %P2

View File

@ -2,53 +2,53 @@
; RUN: egrep {fn?madd|fn?msub} | count 8 ; RUN: egrep {fn?madd|fn?msub} | count 8
define double @test_FMADD1(double %A, double %B, double %C) { define double @test_FMADD1(double %A, double %B, double %C) {
%D = mul double %A, %B ; <double> [#uses=1] %D = fmul double %A, %B ; <double> [#uses=1]
%E = add double %D, %C ; <double> [#uses=1] %E = fadd double %D, %C ; <double> [#uses=1]
ret double %E ret double %E
} }
define double @test_FMADD2(double %A, double %B, double %C) { define double @test_FMADD2(double %A, double %B, double %C) {
%D = mul double %A, %B ; <double> [#uses=1] %D = fmul double %A, %B ; <double> [#uses=1]
%E = add double %D, %C ; <double> [#uses=1] %E = fadd double %D, %C ; <double> [#uses=1]
ret double %E ret double %E
} }
define double @test_FMSUB(double %A, double %B, double %C) { define double @test_FMSUB(double %A, double %B, double %C) {
%D = mul double %A, %B ; <double> [#uses=1] %D = fmul double %A, %B ; <double> [#uses=1]
%E = sub double %D, %C ; <double> [#uses=1] %E = fsub double %D, %C ; <double> [#uses=1]
ret double %E ret double %E
} }
define double @test_FNMADD1(double %A, double %B, double %C) { define double @test_FNMADD1(double %A, double %B, double %C) {
%D = mul double %A, %B ; <double> [#uses=1] %D = fmul double %A, %B ; <double> [#uses=1]
%E = add double %D, %C ; <double> [#uses=1] %E = fadd double %D, %C ; <double> [#uses=1]
%F = sub double -0.000000e+00, %E ; <double> [#uses=1] %F = fsub double -0.000000e+00, %E ; <double> [#uses=1]
ret double %F ret double %F
} }
define double @test_FNMADD2(double %A, double %B, double %C) { define double @test_FNMADD2(double %A, double %B, double %C) {
%D = mul double %A, %B ; <double> [#uses=1] %D = fmul double %A, %B ; <double> [#uses=1]
%E = add double %C, %D ; <double> [#uses=1] %E = fadd double %C, %D ; <double> [#uses=1]
%F = sub double -0.000000e+00, %E ; <double> [#uses=1] %F = fsub double -0.000000e+00, %E ; <double> [#uses=1]
ret double %F ret double %F
} }
define double @test_FNMSUB1(double %A, double %B, double %C) { define double @test_FNMSUB1(double %A, double %B, double %C) {
%D = mul double %A, %B ; <double> [#uses=1] %D = fmul double %A, %B ; <double> [#uses=1]
%E = sub double %C, %D ; <double> [#uses=1] %E = fsub double %C, %D ; <double> [#uses=1]
ret double %E ret double %E
} }
define double @test_FNMSUB2(double %A, double %B, double %C) { define double @test_FNMSUB2(double %A, double %B, double %C) {
%D = mul double %A, %B ; <double> [#uses=1] %D = fmul double %A, %B ; <double> [#uses=1]
%E = sub double %D, %C ; <double> [#uses=1] %E = fsub double %D, %C ; <double> [#uses=1]
%F = sub double -0.000000e+00, %E ; <double> [#uses=1] %F = fsub double -0.000000e+00, %E ; <double> [#uses=1]
ret double %F ret double %F
} }
define float @test_FNMSUBS(float %A, float %B, float %C) { define float @test_FNMSUBS(float %A, float %B, float %C) {
%D = mul float %A, %B ; <float> [#uses=1] %D = fmul float %A, %B ; <float> [#uses=1]
%E = sub float %D, %C ; <float> [#uses=1] %E = fsub float %D, %C ; <float> [#uses=1]
%F = sub float -0.000000e+00, %E ; <float> [#uses=1] %F = fsub float -0.000000e+00, %E ; <float> [#uses=1]
ret float %F ret float %F
} }

View File

@ -4,7 +4,7 @@ declare double @fabs(double)
define double @test(double %X) { define double @test(double %X) {
%Y = call double @fabs( double %X ) ; <double> [#uses=1] %Y = call double @fabs( double %X ) ; <double> [#uses=1]
%Z = sub double -0.000000e+00, %Y ; <double> [#uses=1] %Z = fsub double -0.000000e+00, %Y ; <double> [#uses=1]
ret double %Z ret double %Z
} }

View File

@ -2,10 +2,10 @@
define double @test1(double %a, double %b, double %c, double %d) { define double @test1(double %a, double %b, double %c, double %d) {
entry: entry:
%tmp2 = sub double -0.000000e+00, %c ; <double> [#uses=1] %tmp2 = fsub double -0.000000e+00, %c ; <double> [#uses=1]
%tmp4 = mul double %tmp2, %d ; <double> [#uses=1] %tmp4 = fmul double %tmp2, %d ; <double> [#uses=1]
%tmp7 = mul double %a, %b ; <double> [#uses=1] %tmp7 = fmul double %a, %b ; <double> [#uses=1]
%tmp9 = sub double %tmp7, %tmp4 ; <double> [#uses=1] %tmp9 = fsub double %tmp7, %tmp4 ; <double> [#uses=1]
ret double %tmp9 ret double %tmp9
} }

View File

@ -3,7 +3,7 @@
define i64 @__fixunstfdi(ppc_fp128 %a) nounwind { define i64 @__fixunstfdi(ppc_fp128 %a) nounwind {
entry: entry:
%tmp1213 = uitofp i64 0 to ppc_fp128 ; <ppc_fp128> [#uses=1] %tmp1213 = uitofp i64 0 to ppc_fp128 ; <ppc_fp128> [#uses=1]
%tmp15 = sub ppc_fp128 %a, %tmp1213 ; <ppc_fp128> [#uses=1] %tmp15 = fsub ppc_fp128 %a, %tmp1213 ; <ppc_fp128> [#uses=1]
%tmp2829 = fptoui ppc_fp128 %tmp15 to i32 ; <i32> [#uses=1] %tmp2829 = fptoui ppc_fp128 %tmp15 to i32 ; <i32> [#uses=1]
%tmp282930 = zext i32 %tmp2829 to i64 ; <i64> [#uses=1] %tmp282930 = zext i32 %tmp2829 to i64 ; <i64> [#uses=1]
%tmp32 = add i64 %tmp282930, 0 ; <i64> [#uses=1] %tmp32 = add i64 %tmp282930, 0 ; <i64> [#uses=1]

View File

@ -6,7 +6,7 @@ target triple = "powerpc64-apple-darwin9.2.0"
define i128 @__fixunstfti(ppc_fp128 %a) nounwind { define i128 @__fixunstfti(ppc_fp128 %a) nounwind {
entry: entry:
%tmp1213 = uitofp i128 0 to ppc_fp128 ; <ppc_fp128> [#uses=1] %tmp1213 = uitofp i128 0 to ppc_fp128 ; <ppc_fp128> [#uses=1]
%tmp15 = sub ppc_fp128 %a, %tmp1213 ; <ppc_fp128> [#uses=1] %tmp15 = fsub ppc_fp128 %a, %tmp1213 ; <ppc_fp128> [#uses=1]
%tmp2829 = fptoui ppc_fp128 %tmp15 to i64 ; <i64> [#uses=1] %tmp2829 = fptoui ppc_fp128 %tmp15 to i64 ; <i64> [#uses=1]
%tmp282930 = zext i64 %tmp2829 to i128 ; <i128> [#uses=1] %tmp282930 = zext i64 %tmp2829 to i128 ; <i128> [#uses=1]
%tmp32 = add i128 %tmp282930, 0 ; <i128> [#uses=1] %tmp32 = add i128 %tmp282930, 0 ; <i128> [#uses=1]

View File

@ -9,9 +9,9 @@ define void @func(<4 x float>* %a, <4 x float>* %b) {
%tmp = load <4 x float>* %tmp1 ; <<4 x float>> [#uses=1] %tmp = load <4 x float>* %tmp1 ; <<4 x float>> [#uses=1]
%tmp3 = getelementptr <4 x float>* %a, i32 1 ; <<4 x float>*> [#uses=1] %tmp3 = getelementptr <4 x float>* %a, i32 1 ; <<4 x float>*> [#uses=1]
%tmp4 = load <4 x float>* %tmp3 ; <<4 x float>> [#uses=1] %tmp4 = load <4 x float>* %tmp3 ; <<4 x float>> [#uses=1]
%tmp5 = mul <4 x float> %tmp, %tmp4 ; <<4 x float>> [#uses=1] %tmp5 = fmul <4 x float> %tmp, %tmp4 ; <<4 x float>> [#uses=1]
%tmp8 = load <4 x float>* %b ; <<4 x float>> [#uses=1] %tmp8 = load <4 x float>* %b ; <<4 x float>> [#uses=1]
%tmp9 = add <4 x float> %tmp5, %tmp8 ; <<4 x float>> [#uses=1] %tmp9 = fadd <4 x float> %tmp5, %tmp8 ; <<4 x float>> [#uses=1]
store <4 x float> %tmp9, <4 x float>* %a store <4 x float> %tmp9, <4 x float>* %a
ret void ret void
} }

View File

@ -3,7 +3,7 @@
define {i64, float} @bar(i64 %a, float %b) { define {i64, float} @bar(i64 %a, float %b) {
%y = add i64 %a, 7 %y = add i64 %a, 7
%z = add float %b, 7.0 %z = fadd float %b, 7.0
ret i64 %y, float %z ret i64 %y, float %z
} }

View File

@ -5,19 +5,19 @@ target triple = "powerpc-apple-darwin8"
define ppc_fp128 @plus(ppc_fp128 %x, ppc_fp128 %y) { define ppc_fp128 @plus(ppc_fp128 %x, ppc_fp128 %y) {
entry: entry:
%tmp3 = add ppc_fp128 %x, %y ; <ppc_fp128> [#uses=1] %tmp3 = fadd ppc_fp128 %x, %y ; <ppc_fp128> [#uses=1]
ret ppc_fp128 %tmp3 ret ppc_fp128 %tmp3
} }
define ppc_fp128 @minus(ppc_fp128 %x, ppc_fp128 %y) { define ppc_fp128 @minus(ppc_fp128 %x, ppc_fp128 %y) {
entry: entry:
%tmp3 = sub ppc_fp128 %x, %y ; <ppc_fp128> [#uses=1] %tmp3 = fsub ppc_fp128 %x, %y ; <ppc_fp128> [#uses=1]
ret ppc_fp128 %tmp3 ret ppc_fp128 %tmp3
} }
define ppc_fp128 @times(ppc_fp128 %x, ppc_fp128 %y) { define ppc_fp128 @times(ppc_fp128 %x, ppc_fp128 %y) {
entry: entry:
%tmp3 = mul ppc_fp128 %x, %y ; <ppc_fp128> [#uses=1] %tmp3 = fmul ppc_fp128 %x, %y ; <ppc_fp128> [#uses=1]
ret ppc_fp128 %tmp3 ret ppc_fp128 %tmp3
} }

View File

@ -14,7 +14,7 @@ entry:
store ppc_fp128 %y, ppc_fp128* %y_addr store ppc_fp128 %y, ppc_fp128* %y_addr
%tmp1 = load ppc_fp128* %x_addr, align 16 ; <ppc_fp128> [#uses=1] %tmp1 = load ppc_fp128* %x_addr, align 16 ; <ppc_fp128> [#uses=1]
%tmp2 = load ppc_fp128* %y_addr, align 16 ; <ppc_fp128> [#uses=1] %tmp2 = load ppc_fp128* %y_addr, align 16 ; <ppc_fp128> [#uses=1]
%tmp3 = add ppc_fp128 %tmp1, %tmp2 ; <ppc_fp128> [#uses=1] %tmp3 = fadd ppc_fp128 %tmp1, %tmp2 ; <ppc_fp128> [#uses=1]
store ppc_fp128 %tmp3, ppc_fp128* %tmp, align 16 store ppc_fp128 %tmp3, ppc_fp128* %tmp, align 16
%tmp4 = load ppc_fp128* %tmp, align 16 ; <ppc_fp128> [#uses=1] %tmp4 = load ppc_fp128* %tmp, align 16 ; <ppc_fp128> [#uses=1]
store ppc_fp128 %tmp4, ppc_fp128* %retval, align 16 store ppc_fp128 %tmp4, ppc_fp128* %retval, align 16
@ -36,7 +36,7 @@ entry:
store ppc_fp128 %y, ppc_fp128* %y_addr store ppc_fp128 %y, ppc_fp128* %y_addr
%tmp1 = load ppc_fp128* %x_addr, align 16 ; <ppc_fp128> [#uses=1] %tmp1 = load ppc_fp128* %x_addr, align 16 ; <ppc_fp128> [#uses=1]
%tmp2 = load ppc_fp128* %y_addr, align 16 ; <ppc_fp128> [#uses=1] %tmp2 = load ppc_fp128* %y_addr, align 16 ; <ppc_fp128> [#uses=1]
%tmp3 = sub ppc_fp128 %tmp1, %tmp2 ; <ppc_fp128> [#uses=1] %tmp3 = fsub ppc_fp128 %tmp1, %tmp2 ; <ppc_fp128> [#uses=1]
store ppc_fp128 %tmp3, ppc_fp128* %tmp, align 16 store ppc_fp128 %tmp3, ppc_fp128* %tmp, align 16
%tmp4 = load ppc_fp128* %tmp, align 16 ; <ppc_fp128> [#uses=1] %tmp4 = load ppc_fp128* %tmp, align 16 ; <ppc_fp128> [#uses=1]
store ppc_fp128 %tmp4, ppc_fp128* %retval, align 16 store ppc_fp128 %tmp4, ppc_fp128* %retval, align 16
@ -58,7 +58,7 @@ entry:
store ppc_fp128 %y, ppc_fp128* %y_addr store ppc_fp128 %y, ppc_fp128* %y_addr
%tmp1 = load ppc_fp128* %x_addr, align 16 ; <ppc_fp128> [#uses=1] %tmp1 = load ppc_fp128* %x_addr, align 16 ; <ppc_fp128> [#uses=1]
%tmp2 = load ppc_fp128* %y_addr, align 16 ; <ppc_fp128> [#uses=1] %tmp2 = load ppc_fp128* %y_addr, align 16 ; <ppc_fp128> [#uses=1]
%tmp3 = mul ppc_fp128 %tmp1, %tmp2 ; <ppc_fp128> [#uses=1] %tmp3 = fmul ppc_fp128 %tmp1, %tmp2 ; <ppc_fp128> [#uses=1]
store ppc_fp128 %tmp3, ppc_fp128* %tmp, align 16 store ppc_fp128 %tmp3, ppc_fp128* %tmp, align 16
%tmp4 = load ppc_fp128* %tmp, align 16 ; <ppc_fp128> [#uses=1] %tmp4 = load ppc_fp128* %tmp, align 16 ; <ppc_fp128> [#uses=1]
store ppc_fp128 %tmp4, ppc_fp128* %retval, align 16 store ppc_fp128 %tmp4, ppc_fp128* %retval, align 16

View File

@ -4,7 +4,7 @@ define i64 @__fixtfdi(ppc_fp128 %a) nounwind {
entry: entry:
br i1 false, label %bb, label %bb8 br i1 false, label %bb, label %bb8
bb: ; preds = %entry bb: ; preds = %entry
%tmp5 = sub ppc_fp128 0xM80000000000000000000000000000000, %a ; <ppc_fp128> [#uses=1] %tmp5 = fsub ppc_fp128 0xM80000000000000000000000000000000, %a ; <ppc_fp128> [#uses=1]
%tmp6 = tail call i64 @__fixunstfdi( ppc_fp128 %tmp5 ) nounwind ; <i64> [#uses=0] %tmp6 = tail call i64 @__fixunstfdi( ppc_fp128 %tmp5 ) nounwind ; <i64> [#uses=0]
ret i64 0 ret i64 0
bb8: ; preds = %entry bb8: ; preds = %entry

View File

@ -2,9 +2,9 @@
define ppc_fp128 @__floatditf(i64 %u) nounwind { define ppc_fp128 @__floatditf(i64 %u) nounwind {
entry: entry:
%tmp6 = mul ppc_fp128 0xM00000000000000000000000000000000, 0xM41F00000000000000000000000000000 %tmp6 = fmul ppc_fp128 0xM00000000000000000000000000000000, 0xM41F00000000000000000000000000000
%tmp78 = trunc i64 %u to i32 %tmp78 = trunc i64 %u to i32
%tmp789 = uitofp i32 %tmp78 to ppc_fp128 %tmp789 = uitofp i32 %tmp78 to ppc_fp128
%tmp11 = add ppc_fp128 %tmp789, %tmp6 %tmp11 = fadd ppc_fp128 %tmp789, %tmp6
ret ppc_fp128 %tmp11 ret ppc_fp128 %tmp11
} }

View File

@ -14,7 +14,7 @@ entry:
br i1 %toBool, label %bb, label %bb8 br i1 %toBool, label %bb, label %bb8
bb: ; preds = %entry bb: ; preds = %entry
%tmp4 = load float* %a_addr, align 4 ; <float> [#uses=1] %tmp4 = load float* %a_addr, align 4 ; <float> [#uses=1]
%tmp5 = sub float -0.000000e+00, %tmp4 ; <float> [#uses=1] %tmp5 = fsub float -0.000000e+00, %tmp4 ; <float> [#uses=1]
%tmp6 = call i128 @__fixunssfDI( float %tmp5 ) nounwind ; <i128> [#uses=1] %tmp6 = call i128 @__fixunssfDI( float %tmp5 ) nounwind ; <i128> [#uses=1]
%tmp7 = sub i128 0, %tmp6 ; <i128> [#uses=1] %tmp7 = sub i128 0, %tmp6 ; <i128> [#uses=1]
store i128 %tmp7, i128* %tmp, align 16 store i128 %tmp7, i128* %tmp, align 16

View File

@ -3,8 +3,8 @@
; RUN: grep fmul | count 1 ; RUN: grep fmul | count 1
define double @foo(double %X) { define double @foo(double %X) {
%tmp1 = mul double %X, 1.23 %tmp1 = fmul double %X, 1.23
%tmp2 = mul double %tmp1, 4.124 %tmp2 = fmul double %tmp1, 4.124
ret double %tmp2 ret double %tmp2
} }

View File

@ -2,7 +2,7 @@
define void @t(<4 x float>* %A) { define void @t(<4 x float>* %A) {
%tmp2 = load <4 x float>* %A %tmp2 = load <4 x float>* %A
%tmp3 = sub <4 x float> < float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00 >, %tmp2 %tmp3 = fsub <4 x float> < float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00 >, %tmp2
store <4 x float> %tmp3, <4 x float>* %A store <4 x float> %tmp3, <4 x float>* %A
ret void ret void
} }

View File

@ -15,7 +15,7 @@ define void @splat(%f4* %P, %f4* %Q, float %X) nounwind {
%tmp4 = insertelement %f4 %tmp2, float %X, i32 2 ; <%f4> [#uses=1] %tmp4 = insertelement %f4 %tmp2, float %X, i32 2 ; <%f4> [#uses=1]
%tmp6 = insertelement %f4 %tmp4, float %X, i32 3 ; <%f4> [#uses=1] %tmp6 = insertelement %f4 %tmp4, float %X, i32 3 ; <%f4> [#uses=1]
%q = load %f4* %Q ; <%f4> [#uses=1] %q = load %f4* %Q ; <%f4> [#uses=1]
%R = add %f4 %q, %tmp6 ; <%f4> [#uses=1] %R = fadd %f4 %q, %tmp6 ; <%f4> [#uses=1]
store %f4 %R, %f4* %P store %f4 %R, %f4* %P
ret void ret void
} }

View File

@ -2,7 +2,7 @@
define void @foo(<4 x float>* %P) { define void @foo(<4 x float>* %P) {
%T = load <4 x float>* %P ; <<4 x float>> [#uses=1] %T = load <4 x float>* %P ; <<4 x float>> [#uses=1]
%S = add <4 x float> zeroinitializer, %T ; <<4 x float>> [#uses=1] %S = fadd <4 x float> zeroinitializer, %T ; <<4 x float>> [#uses=1]
store <4 x float> %S, <4 x float>* %P store <4 x float> %S, <4 x float>* %P
ret void ret void
} }

Some files were not shown because too many files have changed in this diff Show More