mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-25 10:27:04 +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:
@@ -4534,8 +4534,17 @@ int LLParser::ParseInstruction(Instruction *&Inst, BasicBlock *BB,
|
||||
case lltok::kw_and:
|
||||
case lltok::kw_or:
|
||||
case lltok::kw_xor: return ParseLogical(Inst, PFS, KeywordVal);
|
||||
case lltok::kw_icmp:
|
||||
case lltok::kw_fcmp: return ParseCompare(Inst, PFS, KeywordVal);
|
||||
case lltok::kw_icmp: return ParseCompare(Inst, PFS, KeywordVal);
|
||||
case lltok::kw_fcmp: {
|
||||
FastMathFlags FMF = EatFastMathFlagsIfPresent();
|
||||
int Res = ParseCompare(Inst, PFS, KeywordVal);
|
||||
if (Res != 0)
|
||||
return Res;
|
||||
if (FMF.any())
|
||||
Inst->setFastMathFlags(FMF);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Casts.
|
||||
case lltok::kw_trunc:
|
||||
case lltok::kw_zext:
|
||||
|
||||
Reference in New Issue
Block a user