search for: cfp0

Displaying 4 results from an estimated 4 matches for "cfp0".

Did you mean: cfp
2012 Apr 16
2
[LLVMdev] Representing -ffast-math at the IR level
...#39;. + return HUGE_VALF; Can we add an assert instead of a comment? It's just as documenting and will catch any goofs. + // If it's not a floating point number then it must be 'fast'. + return !isa<ConstantFP>(MD->getOperand(0)); Here as well. + if (ConstantFP *CFP0 = dyn_cast_or_null<ConstantFP>(Op0)) { + APFloat Accuracy = CFP0->getValueAPF(); + Assert1(Accuracy.isNormal() && !Accuracy.isNegative(), + "fpmath accuracy not a positive number!", &I); To be pedantic for a moment, zero is not a positive numbe...
2012 Apr 16
0
[LLVMdev] Representing -ffast-math at the IR level
...ssert instead of a comment? It's just as documenting and will > catch any goofs. Done. > > + // If it's not a floating point number then it must be 'fast'. > + return !isa<ConstantFP>(MD->getOperand(0)); > > Here as well. > > + if (ConstantFP *CFP0 = dyn_cast_or_null<ConstantFP>(Op0)) { > + APFloat Accuracy = CFP0->getValueAPF(); > + Assert1(Accuracy.isNormal() && !Accuracy.isNegative(), > + "fpmath accuracy not a positive number!", &I); > > To be pedantic for a moment, zero is not a pos...
2012 Apr 16
0
[LLVMdev] Representing -ffast-math at the IR level
Here's a revised patch, plus patches showing how fpmath metadata could be turned on in clang and dragonegg (it seemed safest for the moment to condition on -ffast-math rather than on one of the flags implied by -ffast-math). Major changes: - The FPMathOperator class can no longer be used to change math settings, only to read them. Currently it can be queried for accuracy info. I split the
2012 Apr 14
9
[LLVMdev] Representing -ffast-math at the IR level
The attached patch is a first attempt at representing "-ffast-math" at the IR level, in fact on individual floating point instructions (fadd, fsub etc). It is done using metadata. We already have a "fpmath" metadata type which can be used to signal that reduced precision is OK for a floating point operation, eg %z = fmul float %x, %y, !fpmath !0 ... !0 = metadata