mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-09 11:25:55 +00:00
clean up various VT manipulations, patch by Micah Villmow! PR6337
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97072 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -862,14 +862,14 @@ SDValue SelectionDAG::getZeroExtendInReg(SDValue Op, DebugLoc DL, EVT VT) {
|
|||||||
/// getNOT - Create a bitwise NOT operation as (XOR Val, -1).
|
/// getNOT - Create a bitwise NOT operation as (XOR Val, -1).
|
||||||
///
|
///
|
||||||
SDValue SelectionDAG::getNOT(DebugLoc DL, SDValue Val, EVT VT) {
|
SDValue SelectionDAG::getNOT(DebugLoc DL, SDValue Val, EVT VT) {
|
||||||
EVT EltVT = VT.isVector() ? VT.getVectorElementType() : VT;
|
EVT EltVT = VT.getScalarType();
|
||||||
SDValue NegOne =
|
SDValue NegOne =
|
||||||
getConstant(APInt::getAllOnesValue(EltVT.getSizeInBits()), VT);
|
getConstant(APInt::getAllOnesValue(EltVT.getSizeInBits()), VT);
|
||||||
return getNode(ISD::XOR, DL, VT, Val, NegOne);
|
return getNode(ISD::XOR, DL, VT, Val, NegOne);
|
||||||
}
|
}
|
||||||
|
|
||||||
SDValue SelectionDAG::getConstant(uint64_t Val, EVT VT, bool isT) {
|
SDValue SelectionDAG::getConstant(uint64_t Val, EVT VT, bool isT) {
|
||||||
EVT EltVT = VT.isVector() ? VT.getVectorElementType() : VT;
|
EVT EltVT = VT.getScalarType();
|
||||||
assert((EltVT.getSizeInBits() >= 64 ||
|
assert((EltVT.getSizeInBits() >= 64 ||
|
||||||
(uint64_t)((int64_t)Val >> EltVT.getSizeInBits()) + 1 < 2) &&
|
(uint64_t)((int64_t)Val >> EltVT.getSizeInBits()) + 1 < 2) &&
|
||||||
"getConstant with a uint64_t value that doesn't fit in the type!");
|
"getConstant with a uint64_t value that doesn't fit in the type!");
|
||||||
@@ -883,7 +883,7 @@ SDValue SelectionDAG::getConstant(const APInt &Val, EVT VT, bool isT) {
|
|||||||
SDValue SelectionDAG::getConstant(const ConstantInt &Val, EVT VT, bool isT) {
|
SDValue SelectionDAG::getConstant(const ConstantInt &Val, EVT VT, bool isT) {
|
||||||
assert(VT.isInteger() && "Cannot create FP integer constant!");
|
assert(VT.isInteger() && "Cannot create FP integer constant!");
|
||||||
|
|
||||||
EVT EltVT = VT.isVector() ? VT.getVectorElementType() : VT;
|
EVT EltVT = VT.getScalarType();
|
||||||
assert(Val.getBitWidth() == EltVT.getSizeInBits() &&
|
assert(Val.getBitWidth() == EltVT.getSizeInBits() &&
|
||||||
"APInt size does not match type size!");
|
"APInt size does not match type size!");
|
||||||
|
|
||||||
@@ -926,8 +926,7 @@ SDValue SelectionDAG::getConstantFP(const APFloat& V, EVT VT, bool isTarget) {
|
|||||||
SDValue SelectionDAG::getConstantFP(const ConstantFP& V, EVT VT, bool isTarget){
|
SDValue SelectionDAG::getConstantFP(const ConstantFP& V, EVT VT, bool isTarget){
|
||||||
assert(VT.isFloatingPoint() && "Cannot create integer FP constant!");
|
assert(VT.isFloatingPoint() && "Cannot create integer FP constant!");
|
||||||
|
|
||||||
EVT EltVT =
|
EVT EltVT = VT.getScalarType();
|
||||||
VT.isVector() ? VT.getVectorElementType() : VT;
|
|
||||||
|
|
||||||
// Do the map lookup using the actual bit pattern for the floating point
|
// Do the map lookup using the actual bit pattern for the floating point
|
||||||
// value, so that we don't have problems with 0.0 comparing equal to -0.0, and
|
// value, so that we don't have problems with 0.0 comparing equal to -0.0, and
|
||||||
@@ -961,8 +960,7 @@ SDValue SelectionDAG::getConstantFP(const ConstantFP& V, EVT VT, bool isTarget){
|
|||||||
}
|
}
|
||||||
|
|
||||||
SDValue SelectionDAG::getConstantFP(double Val, EVT VT, bool isTarget) {
|
SDValue SelectionDAG::getConstantFP(double Val, EVT VT, bool isTarget) {
|
||||||
EVT EltVT =
|
EVT EltVT = VT.getScalarType();
|
||||||
VT.isVector() ? VT.getVectorElementType() : VT;
|
|
||||||
if (EltVT==MVT::f32)
|
if (EltVT==MVT::f32)
|
||||||
return getConstantFP(APFloat((float)Val), VT, isTarget);
|
return getConstantFP(APFloat((float)Val), VT, isTarget);
|
||||||
else
|
else
|
||||||
@@ -3106,8 +3104,7 @@ SDValue SelectionDAG::getStackArgumentTokenFactor(SDValue Chain) {
|
|||||||
/// operand.
|
/// operand.
|
||||||
static SDValue getMemsetValue(SDValue Value, EVT VT, SelectionDAG &DAG,
|
static SDValue getMemsetValue(SDValue Value, EVT VT, SelectionDAG &DAG,
|
||||||
DebugLoc dl) {
|
DebugLoc dl) {
|
||||||
unsigned NumBits = VT.isVector() ?
|
unsigned NumBits = VT.getScalarType().getSizeInBits();
|
||||||
VT.getVectorElementType().getSizeInBits() : VT.getSizeInBits();
|
|
||||||
if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Value)) {
|
if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Value)) {
|
||||||
APInt Val = APInt(NumBits, C->getZExtValue() & 255);
|
APInt Val = APInt(NumBits, C->getZExtValue() & 255);
|
||||||
unsigned Shift = 8;
|
unsigned Shift = 8;
|
||||||
|
Reference in New Issue
Block a user