mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 23:17:16 +00:00
Reduce dyn_cast<> to isa<> or cast<> where possible.
No functional change intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234586 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -316,7 +316,7 @@ void Interpreter::visitICmpInst(ICmpInst &I) {
|
||||
|
||||
#define IMPLEMENT_VECTOR_FCMP(OP) \
|
||||
case Type::VectorTyID: \
|
||||
if(dyn_cast<VectorType>(Ty)->getElementType()->isFloatTy()) { \
|
||||
if (cast<VectorType>(Ty)->getElementType()->isFloatTy()) { \
|
||||
IMPLEMENT_VECTOR_FCMP_T(OP, Float); \
|
||||
} else { \
|
||||
IMPLEMENT_VECTOR_FCMP_T(OP, Double); \
|
||||
@@ -363,7 +363,7 @@ static GenericValue executeFCMP_OEQ(GenericValue Src1, GenericValue Src2,
|
||||
|
||||
#define MASK_VECTOR_NANS(TY, X,Y, FLAG) \
|
||||
if (TY->isVectorTy()) { \
|
||||
if (dyn_cast<VectorType>(TY)->getElementType()->isFloatTy()) { \
|
||||
if (cast<VectorType>(TY)->getElementType()->isFloatTy()) { \
|
||||
MASK_VECTOR_NANS_T(X, Y, Float, FLAG) \
|
||||
} else { \
|
||||
MASK_VECTOR_NANS_T(X, Y, Double, FLAG) \
|
||||
@@ -536,7 +536,7 @@ static GenericValue executeFCMP_ORD(GenericValue Src1, GenericValue Src2,
|
||||
if(Ty->isVectorTy()) {
|
||||
assert(Src1.AggregateVal.size() == Src2.AggregateVal.size());
|
||||
Dest.AggregateVal.resize( Src1.AggregateVal.size() );
|
||||
if(dyn_cast<VectorType>(Ty)->getElementType()->isFloatTy()) {
|
||||
if (cast<VectorType>(Ty)->getElementType()->isFloatTy()) {
|
||||
for( size_t _i=0;_i<Src1.AggregateVal.size();_i++)
|
||||
Dest.AggregateVal[_i].IntVal = APInt(1,
|
||||
( (Src1.AggregateVal[_i].FloatVal ==
|
||||
@@ -567,7 +567,7 @@ static GenericValue executeFCMP_UNO(GenericValue Src1, GenericValue Src2,
|
||||
if(Ty->isVectorTy()) {
|
||||
assert(Src1.AggregateVal.size() == Src2.AggregateVal.size());
|
||||
Dest.AggregateVal.resize( Src1.AggregateVal.size() );
|
||||
if(dyn_cast<VectorType>(Ty)->getElementType()->isFloatTy()) {
|
||||
if (cast<VectorType>(Ty)->getElementType()->isFloatTy()) {
|
||||
for( size_t _i=0;_i<Src1.AggregateVal.size();_i++)
|
||||
Dest.AggregateVal[_i].IntVal = APInt(1,
|
||||
( (Src1.AggregateVal[_i].FloatVal !=
|
||||
@@ -713,10 +713,10 @@ void Interpreter::visitBinaryOperator(BinaryOperator &I) {
|
||||
// Macros to choose appropriate TY: float or double and run operation
|
||||
// execution
|
||||
#define FLOAT_VECTOR_OP(OP) { \
|
||||
if (dyn_cast<VectorType>(Ty)->getElementType()->isFloatTy()) \
|
||||
if (cast<VectorType>(Ty)->getElementType()->isFloatTy()) \
|
||||
FLOAT_VECTOR_FUNCTION(OP, FloatVal) \
|
||||
else { \
|
||||
if (dyn_cast<VectorType>(Ty)->getElementType()->isDoubleTy()) \
|
||||
if (cast<VectorType>(Ty)->getElementType()->isDoubleTy()) \
|
||||
FLOAT_VECTOR_FUNCTION(OP, DoubleVal) \
|
||||
else { \
|
||||
dbgs() << "Unhandled type for OP instruction: " << *Ty << "\n"; \
|
||||
@@ -745,12 +745,12 @@ void Interpreter::visitBinaryOperator(BinaryOperator &I) {
|
||||
case Instruction::FMul: FLOAT_VECTOR_OP(*) break;
|
||||
case Instruction::FDiv: FLOAT_VECTOR_OP(/) break;
|
||||
case Instruction::FRem:
|
||||
if (dyn_cast<VectorType>(Ty)->getElementType()->isFloatTy())
|
||||
if (cast<VectorType>(Ty)->getElementType()->isFloatTy())
|
||||
for (unsigned i = 0; i < R.AggregateVal.size(); ++i)
|
||||
R.AggregateVal[i].FloatVal =
|
||||
fmod(Src1.AggregateVal[i].FloatVal, Src2.AggregateVal[i].FloatVal);
|
||||
else {
|
||||
if (dyn_cast<VectorType>(Ty)->getElementType()->isDoubleTy())
|
||||
if (cast<VectorType>(Ty)->getElementType()->isDoubleTy())
|
||||
for (unsigned i = 0; i < R.AggregateVal.size(); ++i)
|
||||
R.AggregateVal[i].DoubleVal =
|
||||
fmod(Src1.AggregateVal[i].DoubleVal, Src2.AggregateVal[i].DoubleVal);
|
||||
|
||||
Reference in New Issue
Block a user