OLD | NEW |
---|---|
1 //===- subzero/src/IceTargetLoweringX8632.cpp - x86-32 lowering -----------===// | 1 //===- subzero/src/IceTargetLoweringX8632.cpp - x86-32 lowering -----------===// |
2 // | 2 // |
3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // This file implements the TargetLoweringX8632 class, which | 10 // This file implements the TargetLoweringX8632 class, which |
(...skipping 4632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4643 if (!First) | 4643 if (!First) |
4644 Str << " "; | 4644 Str << " "; |
4645 First = false; | 4645 First = false; |
4646 Str << getRegName(Register, IceType_i32); | 4646 Str << getRegName(Register, IceType_i32); |
4647 } | 4647 } |
4648 Str << "}\n"; | 4648 Str << "}\n"; |
4649 } | 4649 } |
4650 } | 4650 } |
4651 } | 4651 } |
4652 | 4652 |
4653 template <> | 4653 void TargetX8632::emit(const ConstantInteger32 *C) const { |
4654 void ConstantInteger32::emitWithoutDollar(GlobalContext *Ctx) const { | |
4655 if (!ALLOW_DUMP) | 4654 if (!ALLOW_DUMP) |
4656 return; | 4655 return; |
4657 Ostream &Str = Ctx->getStrEmit(); | 4656 Ostream &Str = Ctx->getStrEmit(); |
4658 Str << (int32_t)getValue(); | 4657 Str << getConstantPrefix() << C->getValue(); |
4659 } | 4658 } |
4660 | 4659 |
4661 template <> void ConstantInteger32::emit(GlobalContext *Ctx) const { | 4660 void TargetX8632::emit(const ConstantInteger64 *) const { |
4661 llvm_unreachable("Not expecting to emit 64-bit integers"); | |
Jim Stichnoth
2015/05/14 00:36:06
report_fatal_error?
jvoung (off chromium)
2015/05/14 16:14:48
Done.
Should this be conditioned on "if (!ALLOW_D
Jim Stichnoth
2015/05/14 16:22:05
I don't think so. The main purpose of ALLOW_DUMP
| |
4662 } | |
4663 | |
4664 void TargetX8632::emit(const ConstantFloat *C) const { | |
4662 if (!ALLOW_DUMP) | 4665 if (!ALLOW_DUMP) |
4663 return; | 4666 return; |
4664 Ostream &Str = Ctx->getStrEmit(); | 4667 Ostream &Str = Ctx->getStrEmit(); |
4665 Str << "$"; | 4668 C->emitPoolLabel(Str); |
4666 emitWithoutDollar(Ctx); | |
4667 } | 4669 } |
4668 | 4670 |
4669 template <> void ConstantInteger64::emitWithoutDollar(GlobalContext *) const { | 4671 void TargetX8632::emit(const ConstantDouble *C) const { |
4670 llvm_unreachable("Not expecting to emitWithoutDollar 64-bit integers"); | |
4671 } | |
4672 | |
4673 template <> void ConstantInteger64::emit(GlobalContext *) const { | |
4674 llvm_unreachable("Not expecting to emit 64-bit integers"); | |
4675 } | |
4676 | |
4677 template <> void ConstantFloat::emitWithoutDollar(GlobalContext *) const { | |
4678 llvm_unreachable("Not expecting to emitWithoutDollar floats"); | |
4679 } | |
4680 | |
4681 template <> void ConstantFloat::emit(GlobalContext *Ctx) const { | |
4682 if (!ALLOW_DUMP) | 4672 if (!ALLOW_DUMP) |
4683 return; | 4673 return; |
4684 Ostream &Str = Ctx->getStrEmit(); | 4674 Ostream &Str = Ctx->getStrEmit(); |
4685 emitPoolLabel(Str); | 4675 C->emitPoolLabel(Str); |
4686 } | 4676 } |
4687 | 4677 |
4688 template <> void ConstantDouble::emitWithoutDollar(GlobalContext *) const { | 4678 void TargetX8632::emit(const ConstantUndef *) const { |
4689 llvm_unreachable("Not expecting to emitWithoutDollar doubles"); | |
4690 } | |
4691 | |
4692 template <> void ConstantDouble::emit(GlobalContext *Ctx) const { | |
4693 if (!ALLOW_DUMP) | |
4694 return; | |
4695 Ostream &Str = Ctx->getStrEmit(); | |
4696 emitPoolLabel(Str); | |
4697 } | |
4698 | |
4699 void ConstantUndef::emitWithoutDollar(GlobalContext *) const { | |
4700 llvm_unreachable("Not expecting to emitWithoutDollar undef"); | |
4701 } | |
4702 | |
4703 void ConstantUndef::emit(GlobalContext *) const { | |
4704 llvm_unreachable("undef value encountered by emitter."); | 4679 llvm_unreachable("undef value encountered by emitter."); |
4705 } | 4680 } |
4706 | 4681 |
4707 TargetDataX8632::TargetDataX8632(GlobalContext *Ctx) | 4682 TargetDataX8632::TargetDataX8632(GlobalContext *Ctx) |
4708 : TargetDataLowering(Ctx) {} | 4683 : TargetDataLowering(Ctx) {} |
4709 | 4684 |
4710 void TargetDataX8632::lowerGlobal(const VariableDeclaration &Var) const { | 4685 void TargetDataX8632::lowerGlobal(const VariableDeclaration &Var) const { |
4711 // If external and not initialized, this must be a cross test. | 4686 // If external and not initialized, this must be a cross test. |
4712 // Don't generate a declaration for such cases. | 4687 // Don't generate a declaration for such cases. |
4713 bool IsExternal = Var.isExternal() || Ctx->getFlags().getDisableInternal(); | 4688 bool IsExternal = Var.isExternal() || Ctx->getFlags().getDisableInternal(); |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4874 case FT_Asm: | 4849 case FT_Asm: |
4875 case FT_Iasm: { | 4850 case FT_Iasm: { |
4876 OstreamLocker L(Ctx); | 4851 OstreamLocker L(Ctx); |
4877 emitConstantPool<PoolTypeConverter<float>>(Ctx); | 4852 emitConstantPool<PoolTypeConverter<float>>(Ctx); |
4878 emitConstantPool<PoolTypeConverter<double>>(Ctx); | 4853 emitConstantPool<PoolTypeConverter<double>>(Ctx); |
4879 } break; | 4854 } break; |
4880 } | 4855 } |
4881 } | 4856 } |
4882 | 4857 |
4883 } // end of namespace Ice | 4858 } // end of namespace Ice |
OLD | NEW |