search for: ieeehalf

Displaying 6 results from an estimated 6 matches for "ieeehalf".

2015 Aug 10
2
Bug or expected behavior of APFloat class?
.../*FormatMaxPadding=*/0); return std::string(strRep.begin(), strRep.end()); } uint16_t getBits(APFloat f) { APInt bits = f.bitcastToAPInt(); assert(bits.getActiveBits() <= 16); return (uint16_t) (bits.getZExtValue() & 0xffff); } int main(int argc, char** argv) { APFloat f(APFloat::IEEEhalf); APFloat newF(APFloat::IEEEhalf); f.convertFromString("0.3", APFloat::rmTowardZero); outs() << "f bits: 0x"; outs().write_hex(getBits(f)); outs() << "\n"; assert(getBits(f) == 0x34cc); // Check that if we get the string using FormatPrecision=...
2012 May 17
0
[LLVMdev] [PATCH] OpenCL half support
...lf case from the code for single and double. > So you should remove the "bool isHalf" variable in that spot. (line > 720) I'm not sure I get it. This variable is still needed couple of lines below: bool isHalf = &CFP->getValueAPF().getSemantics()==&APFloat::IEEEhalf; bool isDouble = &CFP->getValueAPF().getSemantics()==&APFloat::IEEEdouble; bool isInf = CFP->getValueAPF().isInfinity(); bool isNaN = CFP->getValueAPF().isNaN(); if (!isHalf && !isInf && !isNaN) { > // Either half, or some form of lon...
2012 May 17
3
[LLVMdev] [PATCH] OpenCL half support
...double. > > So you should remove the "bool isHalf" variable in that spot. (line > > 720) > I'm not sure I get it. This variable is still needed couple of lines > below: > > bool isHalf = &CFP- > >getValueAPF().getSemantics()==&APFloat::IEEEhalf; > bool isDouble = > &CFP->getValueAPF().getSemantics()==&APFloat::IEEEdouble; > bool isInf = CFP->getValueAPF().isInfinity(); > bool isNaN = CFP->getValueAPF().isNaN(); > if (!isHalf && !isInf && !isNaN) { > > >...
2012 May 11
2
[LLVMdev] [PATCH] OpenCL half support
I've got comments on the code change. The test cases look ok, but I haven't fully checked the math on the half-values. I checked with reference to trunk top-of-tree at revision 156617. I have not compiled the code. lib/AsmParser/LLLexer.cpp Adds support to parse format: 0xH<hexdigits> Tha 0xH format should be described in LangRef.html alongside 0xK<hex> and
2012 May 17
0
[LLVMdev] [PATCH] OpenCL half support
...he "bool isHalf" variable in that spot. > > > (line > > > 720) > > I'm not sure I get it. This variable is still needed couple of lines > > below: > > > > bool isHalf = &CFP- > > >getValueAPF().getSemantics()==&APFloat::IEEEhalf; > > bool isDouble = > > &CFP->getValueAPF().getSemantics()==&APFloat::IEEEdouble; > > bool isInf = CFP->getValueAPF().isInfinity(); > > bool isNaN = CFP->getValueAPF().isNaN(); > > if (!isHalf && !isInf && !isNa...
2015 Jan 22
3
[LLVMdev] numeric limits of llvm Types?
Hi all, can I access the numeric limits of the llvm types, e.g. HalfTy, FloatTy, DoubleTy, etc. in a fashion like the std numeric_limits tool? std::numeric_limits<half>::min() std::numeric_limits<half>::max() In c++API, I want to initialize values and need to know the correct range for the llvm types.... Thx Alex