aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Support/APFloat.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/lib/Support/APFloat.cpp b/lib/Support/APFloat.cpp
index 278e546..8e1580b 100644
--- a/lib/Support/APFloat.cpp
+++ b/lib/Support/APFloat.cpp
@@ -1519,17 +1519,9 @@ APFloat::convertFromInteger(const integerPart *parts, unsigned int width,
integerPart *copy = new integerPart[partCount];
sign = false;
- if(isSigned) {
- if (APInt::tcExtractBit(parts, width - 1)) {
- sign = true;
- if (width < partCount * integerPartWidth)
- api = api.sext(partCount * integerPartWidth);
- }
- else if (width < partCount * integerPartWidth)
- api = api.zext(partCount * integerPartWidth);
- } else {
- if (width < partCount * integerPartWidth)
- api = api.zext(partCount * integerPartWidth);
+ if(isSigned && APInt::tcExtractBit(parts, width - 1)) {
+ sign = true;
+ api = -api;
}
APInt::tcAssign(copy, api.getRawData(), partCount);