mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Print -X like this:
double test(double l1_X) { return (-l1_X); } instead of like this: double test(double l1_X) { return (-0x0p+0 - l1_X); } git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20423 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1359,6 +1359,13 @@ void CWriter::visitBinaryOperator(Instruction &I) {
|
|||||||
Out << ")(";
|
Out << ")(";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If this is a negation operation, print it out as such. For FP, we don't
|
||||||
|
// want to print "-0.0 - X".
|
||||||
|
if (BinaryOperator::isNeg(&I)) {
|
||||||
|
Out << "-";
|
||||||
|
writeOperand(BinaryOperator::getNegArgument(cast<BinaryOperator>(&I)));
|
||||||
|
|
||||||
|
} else {
|
||||||
writeOperand(I.getOperand(0));
|
writeOperand(I.getOperand(0));
|
||||||
|
|
||||||
switch (I.getOpcode()) {
|
switch (I.getOpcode()) {
|
||||||
@@ -1382,6 +1389,7 @@ void CWriter::visitBinaryOperator(Instruction &I) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
writeOperand(I.getOperand(1));
|
writeOperand(I.getOperand(1));
|
||||||
|
}
|
||||||
|
|
||||||
if (needsCast) {
|
if (needsCast) {
|
||||||
Out << "))";
|
Out << "))";
|
||||||
|
@@ -1359,6 +1359,13 @@ void CWriter::visitBinaryOperator(Instruction &I) {
|
|||||||
Out << ")(";
|
Out << ")(";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If this is a negation operation, print it out as such. For FP, we don't
|
||||||
|
// want to print "-0.0 - X".
|
||||||
|
if (BinaryOperator::isNeg(&I)) {
|
||||||
|
Out << "-";
|
||||||
|
writeOperand(BinaryOperator::getNegArgument(cast<BinaryOperator>(&I)));
|
||||||
|
|
||||||
|
} else {
|
||||||
writeOperand(I.getOperand(0));
|
writeOperand(I.getOperand(0));
|
||||||
|
|
||||||
switch (I.getOpcode()) {
|
switch (I.getOpcode()) {
|
||||||
@@ -1382,6 +1389,7 @@ void CWriter::visitBinaryOperator(Instruction &I) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
writeOperand(I.getOperand(1));
|
writeOperand(I.getOperand(1));
|
||||||
|
}
|
||||||
|
|
||||||
if (needsCast) {
|
if (needsCast) {
|
||||||
Out << "))";
|
Out << "))";
|
||||||
|
Reference in New Issue
Block a user