mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-07 16:42:07 +00:00
Simplify and fix signed int -> FP conversions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42483 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
cd8bc05102
commit
cce23a4c35
@ -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