mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-03-04 18:38:37 +00:00
Simplify and fix signed int -> FP conversions.
llvm-svn: 42483
This commit is contained in:
parent
9b5a117d01
commit
4b203b8e44
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user