Introduce architecture specific guards for the simulator
This patch makes the VIXL_INCLUDE_SIMULATOR and
VIXL_GENERATE_SIMULATOR_CODE header guards specific to either AArch64 or
AArch32. Even though the simulator only support AArch64. The build
system was updated accordingly, the "simulator" variable now takes
"aarch64" or "none" as possible values instead of "on" and "off".
This fixes issues we have when we want to build VIXL natively on
AArch64 without a simulator, but still include the AArch32
macro-assembler. The later would check for VIXL_GENERATE_SIMULATOR_CODE
and then generate calls to native code, which breaks.
Change-Id: I2850782558d4cc37f37c1644f0efbd70a3123057
diff --git a/src/aarch32/macro-assembler-aarch32.h b/src/aarch32/macro-assembler-aarch32.h
index 5fd8e71..32dd395 100644
--- a/src/aarch32/macro-assembler-aarch32.h
+++ b/src/aarch32/macro-assembler-aarch32.h
@@ -368,7 +368,8 @@
available_(r12),
checkpoint_(Label::kMaxOffset),
literal_pool_manager_(this),
- veneer_pool_manager_(this) {
+ veneer_pool_manager_(this),
+ generate_simulator_code_(VIXL_AARCH32_GENERATE_SIMULATOR_CODE) {
#ifdef VIXL_DEBUG
SetAllowMacroInstructions(true);
#else
@@ -382,7 +383,8 @@
available_(r12),
checkpoint_(Label::kMaxOffset),
literal_pool_manager_(this),
- veneer_pool_manager_(this) {
+ veneer_pool_manager_(this),
+ generate_simulator_code_(VIXL_AARCH32_GENERATE_SIMULATOR_CODE) {
#ifdef VIXL_DEBUG
SetAllowMacroInstructions(true);
#endif
@@ -393,13 +395,16 @@
available_(r12),
checkpoint_(Label::kMaxOffset),
literal_pool_manager_(this),
- veneer_pool_manager_(this) {
+ veneer_pool_manager_(this),
+ generate_simulator_code_(VIXL_AARCH32_GENERATE_SIMULATOR_CODE) {
#ifdef VIXL_DEBUG
SetAllowMacroInstructions(true);
#endif
ComputeCheckpoint();
}
+ bool GenerateSimulatorCode() const { return generate_simulator_code_; }
+
#ifdef VIXL_DEBUG
// Tell whether any of the macro instruction can be used. When false the
// MacroAssembler will assert if a method which can emit a variable number
@@ -604,12 +609,10 @@
CPURegister reg4 = NoReg);
// Functions used by Printf for generation.
void PushRegister(CPURegister reg);
-#if !VIXL_GENERATE_SIMULATOR_CODE
void PreparePrintfArgument(CPURegister reg,
int* core_count,
int* vfp_count,
uint32_t* printf_type);
-#endif
// Handlers for cases not handled by the assembler.
virtual void Delegate(InstructionType type,
InstructionCondROp instruction,
@@ -8091,6 +8094,7 @@
Label::Offset checkpoint_;
LiteralPoolManager literal_pool_manager_;
VeneerPoolManager veneer_pool_manager_;
+ bool generate_simulator_code_;
bool allow_macro_instructions_;
};