@@ -1121,7 +1121,7 @@ InstructionCost RISCVTTIImpl::getCastInstrCost(unsigned Opcode, Type *Dst,
1121
1121
unsigned DstEltSize = Dst->getScalarSizeInBits ();
1122
1122
InstructionCost Cost = 0 ;
1123
1123
if ((SrcEltSize == 16 ) &&
1124
- (!ST->hasVInstructionsF16 () || ((DstEltSize >> 1 ) > SrcEltSize))) {
1124
+ (!ST->hasVInstructionsF16 () || ((DstEltSize / 2 ) > SrcEltSize))) {
1125
1125
// If the target only supports vfhmin or it is fp16-to-i64 conversion
1126
1126
// pre-widening to f32 and then convert f32 to integer
1127
1127
VectorType *VecF32Ty =
@@ -1142,10 +1142,10 @@ InstructionCost RISCVTTIImpl::getCastInstrCost(unsigned Opcode, Type *Dst,
1142
1142
else { // (SrcEltSize > DstEltSize)
1143
1143
// First do a narrowing conversion to an integer half the size, then
1144
1144
// truncate if needed.
1145
- MVT ElementVT = MVT::getIntegerVT (SrcEltSize >> 1 );
1145
+ MVT ElementVT = MVT::getIntegerVT (SrcEltSize / 2 );
1146
1146
MVT VecVT = DstLT.second .changeVectorElementType (ElementVT);
1147
1147
Cost += getRISCVInstructionCost (FNCVT, VecVT, CostKind);
1148
- if ((SrcEltSize >> 1 ) > DstEltSize) {
1148
+ if ((SrcEltSize / 2 ) > DstEltSize) {
1149
1149
Type *VecTy = EVT (VecVT).getTypeForEVT (Dst->getContext ());
1150
1150
Cost +=
1151
1151
getCastInstrCost (Instruction::Trunc, Dst, VecTy, CCH, CostKind, I);
@@ -1164,7 +1164,7 @@ InstructionCost RISCVTTIImpl::getCastInstrCost(unsigned Opcode, Type *Dst,
1164
1164
1165
1165
InstructionCost Cost = 0 ;
1166
1166
if ((DstEltSize == 16 ) &&
1167
- (!ST->hasVInstructionsF16 () || ((SrcEltSize >> 1 ) > DstEltSize))) {
1167
+ (!ST->hasVInstructionsF16 () || ((SrcEltSize / 2 ) > DstEltSize))) {
1168
1168
// If the target only supports vfhmin or it is i64-to-fp16 conversion
1169
1169
// it is converted to f32 and then converted to f16
1170
1170
VectorType *VecF32Ty =
@@ -1181,8 +1181,8 @@ InstructionCost RISCVTTIImpl::getCastInstrCost(unsigned Opcode, Type *Dst,
1181
1181
if (DstEltSize == SrcEltSize)
1182
1182
Cost += getRISCVInstructionCost (FCVT, DstLT.second , CostKind);
1183
1183
else if (DstEltSize > SrcEltSize) {
1184
- if ((DstEltSize >> 1 ) > SrcEltSize) {
1185
- SrcEltSize = DstEltSize >> 1 ;
1184
+ if ((DstEltSize / 2 ) > SrcEltSize) {
1185
+ SrcEltSize = DstEltSize / 2 ;
1186
1186
VectorType *VecTy =
1187
1187
VectorType::get (IntegerType::get (Dst->getContext (), SrcEltSize),
1188
1188
cast<VectorType>(Dst)->getElementCount ());
0 commit comments