Chromium Code Reviews| Index: src/IceTargetLoweringX8632.cpp |
| diff --git a/src/IceTargetLoweringX8632.cpp b/src/IceTargetLoweringX8632.cpp |
| index df7d04f591fb487293b29f8d21352219ce5112a5..198cc32a3c40decbfa240b040708a51d426e25c5 100644 |
| --- a/src/IceTargetLoweringX8632.cpp |
| +++ b/src/IceTargetLoweringX8632.cpp |
| @@ -107,7 +107,7 @@ CondX86::BrCond getIcmp32Mapping(InstIcmp::ICond Cond) { |
| const struct TableTypeX8632Attributes_ { |
| Type InVectorElementType; |
| } TableTypeX8632Attributes[] = { |
| -#define X(tag, elementty, cvt, sdss, pack, width) \ |
| +#define X(tag, elementty, cvt, sdss, pack, width, fld) \ |
| { elementty } \ |
| , |
| ICETYPEX8632_TABLE |
| @@ -245,7 +245,7 @@ namespace dummy3 { |
| // Define a temporary set of enum values based on low-level table |
| // entries. |
| enum _tmp_enum { |
| -#define X(tag, elementty, cvt, sdss, pack, width) _tmp_##tag, |
| +#define X(tag, elementty, cvt, sdss, pack, width, fld) _tmp_##tag, |
| ICETYPEX8632_TABLE |
| #undef X |
| _num |
| @@ -257,7 +257,7 @@ ICETYPE_TABLE; |
| #undef X |
| // Define a set of constants based on low-level table entries, and |
| // ensure the table entry keys are consistent. |
| -#define X(tag, elementty, cvt, sdss, pack, width) \ |
| +#define X(tag, elementty, cvt, sdss, pack, width, fld) \ |
| static const int _table2_##tag = _tmp_##tag; \ |
| static_assert(_table1_##tag == _table2_##tag, \ |
| "Inconsistency between ICETYPEX8632_TABLE and ICETYPE_TABLE"); |
| @@ -509,20 +509,16 @@ IceString TargetX8632::getRegName(SizeT RegNum, Type Ty) const { |
| void TargetX8632::emitVariable(const Variable *Var) const { |
| Ostream &Str = Ctx->getStrEmit(); |
| if (Var->hasReg()) { |
| - Str << getRegName(Var->getRegNum(), Var->getType()); |
| + Str << "%" << getRegName(Var->getRegNum(), Var->getType()); |
| return; |
| } |
| - Str << InstX8632::getWidthString(Var->getType()); |
| - Str << " [" << getRegName(getFrameOrStackReg(), IceType_i32); |
| + const Type Ty = IceType_i32; |
| int32_t Offset = Var->getStackOffset(); |
| if (!hasFramePointer()) |
| Offset += getStackAdjustment(); |
| - if (Offset) { |
| - if (Offset > 0) |
| - Str << "+"; |
| + if (Offset) |
| Str << Offset; |
| - } |
| - Str << "]"; |
| + Str << "(%" << getRegName(getFrameOrStackReg(), Ty) << ")"; |
| } |
| x86::Address TargetX8632::stackVarToAsmOperand(const Variable *Var) const { |
| @@ -4598,7 +4594,7 @@ void TargetX8632::postLower() { |
| template <> void ConstantInteger32::emit(GlobalContext *Ctx) const { |
| Ostream &Str = Ctx->getStrEmit(); |
| - Str << (int32_t)getValue(); |
| + Str << "$" << (int32_t)getValue(); |
| } |
| template <> void ConstantInteger64::emit(GlobalContext *) const { |
| @@ -4609,12 +4605,12 @@ template <> void ConstantFloat::emit(GlobalContext *Ctx) const { |
| Ostream &Str = Ctx->getStrEmit(); |
| // It would be better to prefix with ".L$" instead of "L$", but |
| // llvm-mc doesn't parse "dword ptr [.L$foo]". |
|
jvoung (off chromium)
2014/10/31 22:12:18
adjust comment about "dword ptr" ?
Jim Stichnoth
2014/11/01 13:44:17
Even better, adjusted the code to use .L$ prefix.
|
| - Str << "dword ptr [L$" << IceType_f32 << "$" << getPoolEntryID() << "]"; |
| + Str << "L$" << IceType_f32 << "$" << getPoolEntryID(); |
| } |
| template <> void ConstantDouble::emit(GlobalContext *Ctx) const { |
| Ostream &Str = Ctx->getStrEmit(); |
| - Str << "qword ptr [L$" << IceType_f64 << "$" << getPoolEntryID() << "]"; |
| + Str << "L$" << IceType_f64 << "$" << getPoolEntryID(); |
| } |
| void ConstantUndef::emit(GlobalContext *) const { |