search for: convertfromstr

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

2016 Mar 02
2
Incorrect return values for APFloat::convertFromString?
I noticed some odd behavior with APFloat's convertFromString method. 1. If I pass the hex representation of the closest value to 0.1 (0x19999Ap-24), everything is fine and opOk is returned. However, if I pass the same value as a decimal string (0.10000002384185791015625), opInexact is set. 2. On the lower end of the scale, the smallest deno...
2015 Aug 10
2
Bug or expected behavior of APFloat class?
...ep.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=0 // that this can be used to construct another APFloa...
2010 Jun 02
0
[LLVMdev] Generating Floating point constants
On Jun 2, 2010, at 3:28 AMPDT, Stéphane Letz wrote: > > Le 2 juin 2010 à 12:21, Eli Friedman a écrit : > >> On Wed, Jun 2, 2010 at 2:59 AM, Stéphane Letz <letz at free.fr> wrote: >>> Hi, >>> >>> We need to generate "Floating point constants" in our code. In http://llvm.org/docs/LangRef.html it is explained that FP has to follow special
2008 Feb 17
1
[LLVMdev] llvm 2.2 build problems
...Archive Library libLLVMSystem.a llvm[1]: Compiling APFloat.cpp for Release build APFloat.cpp: In constructor 'llvm::APFloat::APFloat(const llvm::fltSemantics&, const char*)': APFloat.cpp:680: warning: control may reach end of non-void function 'llvm::APFloat::opStatus llvm::APFloat::convertFromString(const char*, llvm::APFloat::roundingMode)' being inlined llvm[1]: Compiling APInt.cpp for Release build llvm[1]: Compiling Allocator.cpp for Release build llvm[1]: Compiling Annotation.cpp for Release build llvm[1]: Compiling CommandLine.cpp for Release build llvm[1]: Compiling ConstantRange...
2010 Jun 02
3
[LLVMdev] Generating Floating point constants
Le 2 juin 2010 à 12:21, Eli Friedman a écrit : > On Wed, Jun 2, 2010 at 2:59 AM, Stéphane Letz <letz at free.fr> wrote: >> Hi, >> >> We need to generate "Floating point constants" in our code. In http://llvm.org/docs/LangRef.html it is explained that FP has to follow special encoding rules to be handled by LLVM later one (hexadecimal coding...) >>
2007 Aug 18
1
[LLVMdev] Soft floating point support
This patch supplies software IEEE floating point support. The comment from the patch reproduced below says all there is to say. This patch contains the prior "cleanup" patch; please don't apply that one. Please let me know of any bugs. It is tested reasonably well, but until I put together random tests it's hard to have 100% confidence. Neil. /* A self-contained host- and