mirror of
https://github.com/odin-lang/Odin.git
synced 2026-08-21 04:30:50 +00:00
Correct instruction_size_suffix so that the correct suffix can be selected for the instruction to adhere to AT&T syntax
This commit is contained in:
@@ -597,6 +597,10 @@ gb_internal void check_asm_specs(AsmCtx *asm_ctx, CheckerContext *ctx, Scope *sc
|
||||
auto *i = &(*asm_template_entity_decls)[index];
|
||||
if (i->pin.len == 0) {
|
||||
i->pin = pin;
|
||||
i->pin_flag = pin_flag;
|
||||
if (pin_flag.len != 0 && group != AsmTemplateEntityDeclParamGroup_Output) {
|
||||
error(spec->value, "Input parameters cannot be pinned to a flag style register");
|
||||
}
|
||||
} else {
|
||||
error(spec_, "Asm register has already been pinned");
|
||||
}
|
||||
@@ -648,14 +652,14 @@ gb_internal void check_asm_specs(AsmCtx *asm_ctx, CheckerContext *ctx, Scope *sc
|
||||
|
||||
i->pin = pin;
|
||||
o->pin = pin;
|
||||
|
||||
i->pin_flag = pin_flag;
|
||||
o->pin_flag = pin_flag;
|
||||
|
||||
if (other_scratch != nullptr) {
|
||||
GB_ASSERT(spec->value != nullptr);
|
||||
error(spec->value, "Another parameter must be assigned/paired with a scratch parameter declaration, not a tie");
|
||||
}
|
||||
|
||||
if (pin_flag.len != 0) {
|
||||
error(spec->value, "Input parameters, and thus tied parameters, cannot be pinned to a flag style register");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -920,6 +924,10 @@ gb_internal void check_mnemonic(AsmCtx *asm_ctx, CheckerContext *ctx, Entity *tm
|
||||
|
||||
GB_ASSERT(tmpl_entity->kind == Entity_AsmTemplate);
|
||||
|
||||
GB_ASSERT(valid_form_index >= 0);
|
||||
instr->mnemonic = mnemonic;
|
||||
instr->valid_form_index = cast(i32)valid_form_index;
|
||||
|
||||
// Handle clobbering from mnemonic
|
||||
auto clobber = asm_ctx->clobber(mnemonic);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user