Displaying 11 results from an estimated 11 matches for "isexactlyvalu".
Did you mean:
isexactlyvalue
2005 May 03
2
[LLVMdev] VC++ build broken
The recently added code:
static Constant *Div(const ConstantClass *V1, const ConstantClass *V2) {
if (V2->isExactlyValue(0.0)) return ConstantClass::get(*Ty, INFINITY);
if (V2->isExactlyValue(-0.0)) return ConstantClass::get(*Ty, -INFINITY);
if (V2->isNullValue()) return 0;
BuiltinType R = (BuiltinType)V1->getValue() /
(BuiltinType)V2->getValue();
return ConstantClass::get(*Ty, R);
}...
2005 May 03
0
[LLVMdev] VC++ build broken
On Mon, 2 May 2005, Jeff Cohen wrote:
> The recently added code:
> static Constant *Div(const ConstantClass *V1, const ConstantClass *V2) {
> if (V2->isExactlyValue(0.0)) return ConstantClass::get(*Ty, INFINITY);
> if (V2->isExactlyValue(-0.0)) return ConstantClass::get(*Ty, -INFINITY);
> if (V2->isNullValue()) return 0;
> BuiltinType R = (BuiltinType)V1->getValue() / (BuiltinType)V2->getValue();
> return ConstantClass::get(*Ty...
2005 May 03
2
[LLVMdev] VC++ build broken
Yes, that will work. I'll make the change.
Chris Lattner wrote:
> On Mon, 2 May 2005, Jeff Cohen wrote:
>
>> The recently added code:
>> static Constant *Div(const ConstantClass *V1, const ConstantClass *V2) {
>> if (V2->isExactlyValue(0.0)) return ConstantClass::get(*Ty, INFINITY);
>> if (V2->isExactlyValue(-0.0)) return ConstantClass::get(*Ty,
>> -INFINITY);
>> if (V2->isNullValue()) return 0;
>> BuiltinType R = (BuiltinType)V1->getValue() /
>> (BuiltinType)V2->getValue();
>...
2013 Jul 22
0
[LLVMdev] Inverse of ConstantFP::get and similar functions?
...e various ConstantFoo::isBar() functions, which take a value as a
> parameter and check that the value is of a constant of the
> appropriate
> type and value (checking for vectors matching the predicate in the
> vector case).
>
> For example:
>
> static bool ConstantFP::isExactlyValue(Value *V, double D);
You can currently do this:
if (const ConstantVector *CV = dyn_cast<ConstantVector>(X))
if (Constant *Splat = CV->getSplatValue())
// Now you know that Splat is a splatted value, so check it for something.
-Hal
>
> would return true is V is Const...
2013 Jul 22
6
[LLVMdev] Inverse of ConstantFP::get and similar functions?
...propose adding static versions of all
the various ConstantFoo::isBar() functions, which take a value as a
parameter and check that the value is of a constant of the appropriate
type and value (checking for vectors matching the predicate in the
vector case).
For example:
static bool ConstantFP::isExactlyValue(Value *V, double D);
would return true is V is ConstantFP, a splat ConstantVector, or a
ConstantDataVector with the appropriate type. Similarly,
static bool ConstantFP::isZero(Value *V);
would return true if V is a ConstantFP with zero of either sign, a
ConstantVector or ConstantDataVector w...
2005 May 03
0
[LLVMdev] VC++ build broken
...ad:
if (V2->isNullValue()) return 0;
Thanks,
-Chris
> Chris Lattner wrote:
>
>> On Mon, 2 May 2005, Jeff Cohen wrote:
>>
>>> The recently added code:
>>> static Constant *Div(const ConstantClass *V1, const ConstantClass *V2) {
>>> if (V2->isExactlyValue(0.0)) return ConstantClass::get(*Ty, INFINITY);
>>> if (V2->isExactlyValue(-0.0)) return ConstantClass::get(*Ty, -INFINITY);
>>> if (V2->isNullValue()) return 0;
>>> BuiltinType R = (BuiltinType)V1->getValue() /
>>> (BuiltinType)V2->getValue()...
2013 Aug 13
2
[LLVMdev] SimplifyLibCalls doesn't check TLI for LibFunc availability
...&B) {
Value *Ret = NULL;
if (UnsafeFPShrink && Callee->getName() == "pow" &&
TLI->has(LibFunc::powf)) {
UnaryDoubleFPOpt UnsafeUnaryDoubleFP(true);
Ret = UnsafeUnaryDoubleFP.callOptimizer(Callee, CI, B);
}
[...]
if (Op2C->isExactlyValue(0.5)) {
// Expand pow(x, 0.5) to (x == -infinity ? +infinity : fabs(sqrt(x))).
// This is faster than calling pow, and still handles negative zero
// and negative infinity correctly.
// TODO: In fast-math mode, this could be just sqrt(x).
// TODO: In finite-only mode,...
2013 Aug 13
0
[LLVMdev] SimplifyLibCalls doesn't check TLI for LibFunc availability
...amp;****
>
> TLI->has(LibFunc::powf)) {****
>
> UnaryDoubleFPOpt UnsafeUnaryDoubleFP(true);****
>
> Ret = UnsafeUnaryDoubleFP.callOptimizer(Callee, CI, B);****
>
> }****
>
> ** **
>
> [...]****
>
> ** **
>
> if (Op2C->isExactlyValue(0.5)) {****
>
> // Expand pow(x, 0.5) to (x == -infinity ? +infinity :
> fabs(sqrt(x))).****
>
> // This is faster than calling pow, and still handles negative zero*
> ***
>
> // and negative infinity correctly.****
>
> // TODO: In fast-math mo...
2013 Jul 22
0
[LLVMdev] Inverse of ConstantFP::get and similar functions?
...> the various ConstantFoo::isBar() functions, which take a value as a
> parameter and check that the value is of a constant of the appropriate
> type and value (checking for vectors matching the predicate in the
> vector case).
>
> For example:
>
> static bool ConstantFP::isExactlyValue(Value *V, double D);
>
> would return true is V is ConstantFP, a splat ConstantVector, or a
> ConstantDataVector with the appropriate type. Similarly,
>
> static bool ConstantFP::isZero(Value *V);
>
> would return true if V is a ConstantFP with zero of either sign, a
> C...
2012 Aug 10
1
[LLVMdev] Pseudo instructions expansion
Hi Jim,
thank you for the quick response. I have used InstAlias in some cases, but these are really simple pseudo instructions where the pseudo instruction is more like a special case of existing one, like using fixed operand or simply a more human understandable way of presenting an operation. I know that there are predicates available to improve matching, but can InstAlias use conditions to
2012 Jul 16
3
[LLVMdev] RFC: LLVM incubation, or requirements for committing new backends
...==//
> +// Helper functions
> +//===----------------------------------------------------------------------===//
> +
> +bool AMDGPUTargetLowering::isHWTrueValue(SDValue Op) const
> +{
> + if (ConstantFPSDNode * CFP = dyn_cast<ConstantFPSDNode>(Op)) {
> + return CFP->isExactlyValue(1.0);
> + }
> + if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op)) {
> + return C->isAllOnesValue();
> + }
> + return false;
> +}
> +
> +bool AMDGPUTargetLowering::isHWFalseValue(SDValue Op) const
> +{
> + if (ConstantFPSDNode * CFP = dyn_cast<C...