[x64] Swap to using anchor variables instead of dummy function calls

This commit is contained in:
Dr. Chat 2018-11-23 17:24:55 -06:00
parent a8bef91cc4
commit dda78da4b3
6 changed files with 12 additions and 16 deletions

View File

@ -82,8 +82,6 @@ bool X64Backend::Initialize(Processor* processor) {
return false;
}
RegisterSequences();
// Need movbe to do advanced LOAD/STORE tricks.
if (FLAGS_enable_haswell_instructions) {
machine_info_.supports_extended_load_store =

View File

@ -19,7 +19,7 @@ namespace cpu {
namespace backend {
namespace x64 {
void RegisterControl() {}
volatile int anchor_control = 0;
// ============================================================================
// OPCODE_DEBUG_BREAK

View File

@ -20,7 +20,7 @@ namespace cpu {
namespace backend {
namespace x64 {
void RegisterMemory() {}
volatile int anchor_memory = 0;
// Note: all types are always aligned in the context.
RegExp ComputeContextAddress(X64Emitter& e, const OffsetOp& offset) {

View File

@ -22,7 +22,7 @@ namespace cpu {
namespace backend {
namespace x64 {
void RegisterVector() {}
volatile int anchor_vector = 0;
// ============================================================================
// OPCODE_VECTOR_CONVERT_I2F

View File

@ -3057,11 +3057,15 @@ struct SET_ROUNDING_MODE_I32
};
EMITTER_OPCODE_TABLE(OPCODE_SET_ROUNDING_MODE, SET_ROUNDING_MODE_I32);
void RegisterSequences() {
RegisterControl();
RegisterMemory();
RegisterVector();
}
// Include anchors to other sequence sources so they get included in the build.
extern volatile int anchor_control;
static int anchor_control_dest = anchor_control;
extern volatile int anchor_memory;
static int anchor_memory_dest = anchor_memory;
extern volatile int anchor_vector;
static int anchor_vector_dest = anchor_vector;
bool SelectSequence(X64Emitter* e, const Instr* i, const Instr** new_tail) {
const InstrKey key(i);

View File

@ -40,12 +40,6 @@ static bool Register() {
#define EMITTER_OPCODE_TABLE(name, ...) \
const auto X64_INSTR_##name = Register<__VA_ARGS__>();
// Registration functions to force inclusion of several files
void RegisterControl();
void RegisterMemory();
void RegisterVector();
void RegisterSequences();
bool SelectSequence(X64Emitter* e, const hir::Instr* i,
const hir::Instr** new_tail);