mirror of
https://github.com/odin-lang/Odin.git
synced 2026-09-03 18:50:20 +00:00
Restrict riscv to only allow [base + disp] (i.e. disallow index*scale style things)
This commit is contained in:
@@ -1786,6 +1786,17 @@ gb_internal void check_asm_instruction_operand(AsmCtx *asm_ctx, CheckerContext *
|
||||
gb_string_free(s);
|
||||
}
|
||||
|
||||
if (index.expr != nullptr) {
|
||||
if (!asm_ctx->supports_memory_index_not_just_disp()) {
|
||||
error(index.expr, "The target platform does not support memory indexing within memory operands, only displacements");
|
||||
}
|
||||
}
|
||||
if (scale.expr != nullptr) {
|
||||
if (!asm_ctx->supports_memory_index_not_just_disp()) {
|
||||
error(scale.expr, "The target platform does not support memory index scaling within memory operands");
|
||||
}
|
||||
}
|
||||
|
||||
if (mem_op->type) {
|
||||
Type *t = check_type(ctx, mem_op->type);
|
||||
if (t != nullptr && t != t_invalid) {
|
||||
|
||||
Reference in New Issue
Block a user