Displaying 14 results from an estimated 14 matches for "getactivebits".
2012 Nov 16
5
[LLVMdev] Assert with getZExtValue()?
Was hoping it might get some help or a better explanation of this:
/ADT/APInt.h:1217: uint64_t llvm::APInt::getZExtValue() const: Assertion
`getActiveBits() <= 64 && "Too many bits for uint64_t"' failed.
Program received signal SIGABRT, Aborted.
0x00007ffff6eb4d05 in raise (sig=6) at
../nptl/sysdeps/unix/sysv/linux/raise.c:64
64 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
in ../nptl/sysdeps/uni...
2012 Nov 16
0
[LLVMdev] Assert with getZExtValue()?
On Fri, Nov 16, 2012 at 3:00 PM, Ryan Taylor <ryta1203 at gmail.com> wrote:
> Was hoping it might get some help or a better explanation of this:
>
> /ADT/APInt.h:1217: uint64_t llvm::APInt::getZExtValue() const: Assertion
> `getActiveBits() <= 64 && "Too many bits for uint64_t"' failed.
The error message is exactly what it says: you're trying to call
getZExtValue() on an APInt whose value doesn't fit into a uint64_t.
> Program received signal SIGABRT, Aborted.
> 0x00007ffff6eb4d05 in raise (s...
2012 Nov 16
2
[LLVMdev] Assert with getZExtValue()?
...riedman at gmail.com>wrote:
> On Fri, Nov 16, 2012 at 3:00 PM, Ryan Taylor <ryta1203 at gmail.com> wrote:
> > Was hoping it might get some help or a better explanation of this:
> >
> > /ADT/APInt.h:1217: uint64_t llvm::APInt::getZExtValue() const: Assertion
> > `getActiveBits() <= 64 && "Too many bits for uint64_t"' failed.
>
> The error message is exactly what it says: you're trying to call
> getZExtValue() on an APInt whose value doesn't fit into a uint64_t.
>
> > Program received signal SIGABRT, Aborted.
> > 0x...
2016 Jul 21
2
FreeBSD user willing to try fix a unit test?
...tem gcc-4.2.1 seems to miscompile it.
#if defined(__llvm__) || !defined(__FreeBSD__)
TEST(APIntTest, i33_Count) {
APInt i33minus2(33, static_cast<uint64_t>(-2), true);
EXPECT_EQ(0u, i33minus2.countLeadingZeros());
EXPECT_EQ(32u, i33minus2.countLeadingOnes());
EXPECT_EQ(33u, i33minus2.getActiveBits());
EXPECT_EQ(1u, i33minus2.countTrailingZeros());
EXPECT_EQ(32u, i33minus2.countPopulation());
EXPECT_EQ(-2, i33minus2.getSExtValue());
EXPECT_EQ(((uint64_t)-2)&((1ull<<33) -1), i33minus2.getZExtValue());
}
#endif
Given that we are long past gcc 4.2, any chance someone with Fre...
2012 Dec 04
0
[LLVMdev] Assert with getZExtValue()?
...s there a way to return the value as a string instead?
On Fri, Nov 16, 2012 at 3:00 PM, Ryan Taylor <ryta1203 at gmail.com> wrote:
> Was hoping it might get some help or a better explanation of this:
>
> /ADT/APInt.h:1217: uint64_t llvm::APInt::getZExtValue() const: Assertion
> `getActiveBits() <= 64 && "Too many bits for uint64_t"' failed.
>
> Program received signal SIGABRT, Aborted.
> 0x00007ffff6eb4d05 in raise (sig=6) at
> ../nptl/sysdeps/unix/sysv/linux/raise.c:64
> 64 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
&g...
2012 Dec 03
0
[LLVMdev] Assert with getZExtValue()?
...wrote:
>
>> On Fri, Nov 16, 2012 at 3:00 PM, Ryan Taylor <ryta1203 at gmail.com> wrote:
>> > Was hoping it might get some help or a better explanation of this:
>> >
>> > /ADT/APInt.h:1217: uint64_t llvm::APInt::getZExtValue() const: Assertion
>> > `getActiveBits() <= 64 && "Too many bits for uint64_t"' failed.
>>
>> The error message is exactly what it says: you're trying to call
>> getZExtValue() on an APInt whose value doesn't fit into a uint64_t.
>>
>> > Program received signal SIGABRT, A...
2008 Jan 24
2
[LLVMdev] Complex constant expressions?
...to be able to detect
overflow / loss of precision when casting constant values so that I can
issue the appropriate warning. Since the values are constant, I ought to
be able to tell whether or not they can "fit" in the destination type
without loss. For ints, this is easy enough using getActiveBits(). For
floats, I guess I would need to know whether the fractional part of the
number is zero or not, and I'd need floating-point equivalents to the
various integer min and max values, so that I could compare them with
the APFloat.
What would be a good technique for accomplishing this?
>...
2015 Aug 10
2
Bug or expected behavior of APFloat class?
...strRep;
// FormatPrecision=0 means that the "natural precision" of the number is used
f.toString(strRep,/*FormatPrecision=*/0, /*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(ge...
2008 Jan 24
0
[LLVMdev] Complex constant expressions?
...> overflow / loss of precision when casting constant values so that I can
> issue the appropriate warning. Since the values are constant, I ought to
> be able to tell whether or not they can "fit" in the destination type
> without loss. For ints, this is easy enough using getActiveBits(). For
> floats, I guess I would need to know whether the fractional part of the
> number is zero or not, and I'd need floating-point equivalents to the
> various integer min and max values, so that I could compare them with
> the APFloat.
>
> What would be a good techniq...
2008 Jan 23
0
[LLVMdev] Complex constant expressions?
Talin wrote:-
> Well, I may be using it wrong. But looking at APFloat.h, I see four
> functions that purport to convert to integer:
>
> opStatus convertToInteger(integerPart *, unsigned int, bool,
> roundingMode) const;
> opStatus convertFromSignExtendedInteger(const integerPart *,
> unsigned int,
>
2008 Jan 23
4
[LLVMdev] Complex constant expressions?
Neil Booth wrote:
> Talin wrote:-
>
>> On the other hand, writing an interpreter means duplicating a lot of
>> the functionality that's already in LLVM. For example, consider just
>> the problem of float to int conversions:
>>
>> char B[ (int)3.0 ];
>>
>> Generating code for this is relatively simple; Converting
>> arbitrary-sized
2008 May 09
3
[LLVMdev] [PATCH] Split LoopUnroll pass into mechanism and policy
...cast<ConstantInt>(TripCount)) {
+ // Guard against huge trip counts. This also guards against
assertions in
+ // APInt from the use of getZExtValue, below.
This comment is a little stale now. Just say it guards against huge
trip counts.
+ if (TripCountC->getValue().getActiveBits() <= 32) {
+ return (unsigned)TripCountC->getZExtValue();
+ }
+ }
+ }
+ return 0;
+ }
+ /// getSmallConstantTripMultiple - Returns the largest constant
divisor of the
+ /// trip count of this loop as a normal unsigned value, if
possible. This
+ /// means th...
2008 May 09
0
[LLVMdev] [PATCH] Split LoopUnroll pass into mechanism and policy
Hi All,
the attached patch performs the splitting in the proposed manner.
before applying the patch, please execute
svn cp lib/Transforms/Scalar/LoopUnroll.cpp lib/Transforms/Utils/UnrollLoop.cpp
to make the patch apply and preserve proper history.
Transforms/Utils/UnrollLoop.cpp contains the unrollLoop function, which is now
used by the LoopUnroll pass. I've also moved the
2008 May 07
8
[LLVMdev] [PATCH] Split LoopUnroll pass into mechanism and policy
Hello Matthijs,
Separating mechanism from policy is a good thing for the LoopUnroll
pass. Instead of moving the policy to a subclass though, I think it'd
be better to move the mechanism, the unrollLoop function, out to be a
standalone utility function, with the LoopInfo object passed in
explicitly. FoldBlockIntoPredecessor would also be good to make into
a standalone utility function, since