summaryrefslogtreecommitdiffstats
path: root/clang/utils/TableGen/MveEmitter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/utils/TableGen/MveEmitter.cpp')
-rw-r--r--clang/utils/TableGen/MveEmitter.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/clang/utils/TableGen/MveEmitter.cpp b/clang/utils/TableGen/MveEmitter.cpp
index 9c3328e3bbf..1f9752261fb 100644
--- a/clang/utils/TableGen/MveEmitter.cpp
+++ b/clang/utils/TableGen/MveEmitter.cpp
@@ -782,15 +782,14 @@ public:
}
llvm::APInt typelo, typehi;
- if (cast<ScalarType>(IA.ArgType)->kind() == ScalarTypeKind::UnsignedInt) {
- typelo = llvm::APInt::getSignedMinValue(IA.ArgType->sizeInBits());
- typehi = llvm::APInt::getSignedMaxValue(IA.ArgType->sizeInBits());
+ unsigned Bits = IA.ArgType->sizeInBits();
+ if (cast<ScalarType>(IA.ArgType)->kind() == ScalarTypeKind::SignedInt) {
+ typelo = llvm::APInt::getSignedMinValue(Bits).sext(128);
+ typehi = llvm::APInt::getSignedMaxValue(Bits).sext(128);
} else {
- typelo = llvm::APInt::getMinValue(IA.ArgType->sizeInBits());
- typehi = llvm::APInt::getMaxValue(IA.ArgType->sizeInBits());
+ typelo = llvm::APInt::getMinValue(Bits).zext(128);
+ typehi = llvm::APInt::getMaxValue(Bits).zext(128);
}
- typelo = typelo.sext(128);
- typehi = typehi.sext(128);
std::string Index = utostr(kv.first);
OpenPOWER on IntegriCloud