summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2009-02-12 20:58:09 +0000
committerDale Johannesen <dalej@apple.com>2009-02-12 20:58:09 +0000
commit655775293f318b43fb80427274675250b4b7b7a7 (patch)
tree866774c66d73ca112dfd03b430970b1ff7348791 /llvm/lib/CodeGen
parentaf2037fbfd81571170343fd85c879836d4ded215 (diff)
downloadbcm5719-llvm-655775293f318b43fb80427274675250b4b7b7a7.tar.gz
bcm5719-llvm-655775293f318b43fb80427274675250b4b7b7a7.zip
Arrange to print constants that match "n" and "i" constraints
in inline asm as signed (what gcc does). Add partial support for x86-specific "e" and "Z" constraints, with appropriate signedness for printing. llvm-svn: 64400
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index fce57f93b7f..909789b970b 100644
--- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -2082,8 +2082,11 @@ void TargetLowering::LowerAsmOperandForConstraint(SDValue Op,
if (C) { // just C, no GV.
// Simple constants are not allowed for 's'.
if (ConstraintLetter != 's') {
- Ops.push_back(DAG.getTargetConstant(C->getAPIntValue(),
- Op.getValueType()));
+ // gcc prints these as sign extended. Sign extend value to 64 bits
+ // now; without this it would get ZExt'd later in
+ // ScheduleDAGSDNodes::EmitNode, which is very generic.
+ Ops.push_back(DAG.getTargetConstant(C->getAPIntValue().getSExtValue(),
+ MVT::i64));
return;
}
}
OpenPOWER on IntegriCloud