mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-22 23:24:59 +00:00
Add support for fast-math flags to the FCmp instruction.
FCmp behaves a lot like a floating-point binary operator in many ways, and can benefit from fast-math information. Flags such as nsz and nnan can affect if this fcmp (in combination with a select) can be treated as a fminnum/fmaxnum operation. This adds backwards-compatible bitcode support, IR parsing and writing, LangRef changes and IRBuilder changes. I'll need to audit InstSimplify and InstCombine in a followup to find places where flags should be copied. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241901 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1759,13 +1759,17 @@ static void WriteInstruction(const Instruction &I, unsigned InstID,
|
||||
pushValue(I.getOperand(2), InstID, Vals, VE);
|
||||
break;
|
||||
case Instruction::ICmp:
|
||||
case Instruction::FCmp:
|
||||
case Instruction::FCmp: {
|
||||
// compare returning Int1Ty or vector of Int1Ty
|
||||
Code = bitc::FUNC_CODE_INST_CMP2;
|
||||
PushValueAndType(I.getOperand(0), InstID, Vals, VE);
|
||||
pushValue(I.getOperand(1), InstID, Vals, VE);
|
||||
Vals.push_back(cast<CmpInst>(I).getPredicate());
|
||||
uint64_t Flags = GetOptimizationFlags(&I);
|
||||
if (Flags != 0)
|
||||
Vals.push_back(Flags);
|
||||
break;
|
||||
}
|
||||
|
||||
case Instruction::Ret:
|
||||
{
|
||||
|
Reference in New Issue
Block a user