search for: getsignbit

Displaying 9 results from an estimated 9 matches for "getsignbit".

2015 Jan 22
2
[LLVMdev] access IntegerType::getSignBit from Type *
Hi, I have a Type * which may come from an IntegerType as shown below: Type.getIntegerBitWidth() tells me numBits. But how to extract the IntegerType.getSignBit? If pType isIntegerType, I need to know if it is signed or unsigned... How to achieve this? Thx Alex llvm::Type * getRandomValid_IntegerType(llvm::LLVMContext &C) { using namespace llvm; //--- determine num of bits between allowed bits int rI=randInt(IntegerType::MIN_INT_BIT...
2012 Nov 28
0
[LLVMdev] [llvm-commits] [dragonegg] r168787 - in /dragonegg/trunk: src/x86/Target.cpp src/x86/x86_builtins test/validator/c/copysignp.c
...; + Type *EltTy = VecTy->getElementType(); > + unsigned EltBitWidth = EltTy->getPrimitiveSizeInBits(); > + Type *IntEltTy = IntegerType::get(Context, EltBitWidth); > + Type *IntVecTy = VectorType::get(IntEltTy, VecTy->getNumElements()); > + APInt SignBit = APInt::getSignBit(EltBitWidth); > + Constant *SignMask = ConstantInt::get(IntVecTy, SignBit); > + Value *IntLHS = Builder.CreateBitCast(Ops[0], IntVecTy); > + Value *IntRHS = Builder.CreateBitCast(Ops[1], IntVecTy); > + Value *Sign = Builder.CreateAnd(IntRHS, SignMask); > + Value *Abs =...
2017 Apr 21
2
[cfe-dev] FE_INEXACT being set for an exact conversion from float to unsigned long long
...the version I last fetched: case ISD::FP_TO_UINT: { SDValue True, False; EVT VT = Node->getOperand(0).getValueType(); EVT NVT = Node->getValueType(0); APFloat apf(DAG.EVTToAPFloatSemantics(VT), APInt::getNullValue(VT.getSizeInBits())); APInt x = APInt::getSignBit(NVT.getSizeInBits()); (void)apf.convertFromAPInt(x, false, APFloat::rmNearestTiesToEven); Tmp1 = DAG.getConstantFP(apf, dl, VT); Tmp2 = DAG.getSetCC(dl, getSetCCResultType(VT), Node->getOperand(0), Tmp1, ISD::SETLT); True = DAG.getN...
2011 Mar 06
0
[LLVMdev] First Patch
...mask = APInt::getBitsSet(width, power+1, width-2); else mask.clearAllBits(); (This would mean the clearAllBits() above would again be redundant) However, a nice way to handle the signbit-only case would be to wrap that in an extra if as follows: if (power == width - 1) mask = APInt::getSignBit(width); // Alternatively: LHSKnownOne, which should be equivalent. else if // ... the code above ... so that for signbit-only LHS the check below tests whether the RHS is non-negative. > + ComputeMaskedBits(RHS, mask, zeroes, ones); > + > + // At least one 0 > + if (ze...
2011 Mar 08
0
[LLVMdev] First Patch
...supposed to compile without warnings). So I guess changing width back to int isn't a disaster. (Who needs integers with over 2 million bits anyway?) Alternatively, since you know 'power' is non-negative here you can safely cast it to unsigned for the comparison. > + mask = APInt::getSignBit(width); > + else > + mask = APInt::getBitsSet(width, power + 1, width - 2); You removed the 'if (power < width-2)' case from the code I mentioned as equivalent to your loop. Because of this, if power + 1 > width - 2 (or equivalently in this case, if power == width - 2) this...
2011 Mar 08
2
[LLVMdev] First Patch
Hi! I've attached a patch which takes care of the issues mentioned (and adds two tests). -- Sanjoy Das http://playingwithpointers.com -------------- next part -------------- A non-text attachment was scrubbed... Name: ripple-bucket.diff Type: text/x-diff Size: 3318 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110308/0814e3e8/attachment.diff>
2011 Mar 06
1
[LLVMdev] First Patch
Hi all! I've been tinkering with LLVM's code-base for a few days, hoping to start on one of the ideas mentioned in the "Open Projects" page (I was told 'Improving the current system'/'Miscellaneous Improvements'/5 would be a good start). While I was at it, I also took a stab at finishing up one of the TODOs. I've attached the patch for review. --
2011 Mar 02
3
[LLVMdev] live variable analysis
Hi As I understand live variable analysis will set the def/kill properties of operands. In that case, is it still needed to set the kill flags when possible during lowering? thanks dz
2017 Apr 20
4
[cfe-dev] FE_INEXACT being set for an exact conversion from float to unsigned long long
> This seems like it was done for perf reason (mispredict). Conditional-to-cmov transformation should keep > from introducing additional observable side-effects, and it's clear that whatever did this did not account > for floating point exception. That’s a very reasonable statement, but I’m not sure it corresponds to the way we have typically approached this sort of problem. In