llvm.org GIT mirror llvm / aeda136
[APInt] Fix a few places that use APInt::getRawData to operate within the normal API. getRawData exposes the internal type of the APInt class directly to its users. Ideally we wouldn't expose such an implementation detail. This patch fixes a few of the easy cases by using truncate, extract, or a rotate. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301105 91177308-0d34-0410-b5e6-96231b3b80d8 Craig Topper 3 years ago
3 changed file(s) with 5 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
19481948 return true;
19491949 StringRef V = S.substr(2);
19501950 APInt A(V.size()*4, V, 16);
1951 Result = APInt(A.getActiveBits(),
1952 ArrayRef(A.getRawData(), A.getNumWords()));
1951 Result = A.zextOrTrunc(A.getActiveBits());
19531952 return false;
19541953 }
19551954
157157 // and the low 64 bits here.
158158 if (DAG.getDataLayout().isBigEndian() &&
159159 CN->getValueType(0).getSimpleVT() == llvm::MVT::ppcf128) {
160 uint64_t words[2] = { CN->getValueAPF().bitcastToAPInt().getRawData()[1],
161 CN->getValueAPF().bitcastToAPInt().getRawData()[0] };
162 APInt Val(128, words);
160 APInt Val = CN->getValueAPF().bitcastToAPInt().rotl(64);
163161 return DAG.getConstant(Val, SDLoc(CN),
164162 TLI.getTypeToTransformTo(*DAG.getContext(),
165163 CN->getValueType(0)));
10591057 APInt C = cast(N)->getValueAPF().bitcastToAPInt();
10601058 SDLoc dl(N);
10611059 Lo = DAG.getConstantFP(APFloat(DAG.EVTToAPFloatSemantics(NVT),
1062 APInt(64, C.getRawData()[1])),
1060 C.extractBits(64, 64)),
10631061 dl, NVT);
10641062 Hi = DAG.getConstantFP(APFloat(DAG.EVTToAPFloatSemantics(NVT),
1065 APInt(64, C.getRawData()[0])),
1063 C.extractBits(64, 0)),
10661064 dl, NVT);
10671065 }
10681066
123123 // FP immediates are used only when setting GPRs, so they may be dealt
124124 // with like regular immediates from this point on.
125125 auto Expr = HexagonMCExpr::create(
126 MCConstantExpr::create(*Val.bitcastToAPInt().getRawData(),
126 MCConstantExpr::create(Val.bitcastToAPInt().getZExtValue(),
127127 AP.OutContext),
128128 AP.OutContext);
129129 HexagonMCInstrInfo::setMustExtend(*Expr, MustExtend);