LLVM asm backend: %gs:disp() -> %gs:disp

This commit is contained in:
gingerBill
2026-08-18 17:18:38 +01:00
parent 14184744ee
commit 27d00c3c1c

View File

@@ -1,3 +1,5 @@
#define LLVM_ASM_DEBUG_PRINT false
struct lbAsmGenerate {
Entity * tmpl_entity;
AstAsmTemplate * tmpl_node;
@@ -306,6 +308,10 @@ struct lbAsmGenerate_amd64 : lbAsmGenerate {
asm_string = this->write_operand(asm_string, op_number, mem_op->disp, disp_flags);
}
if (mem_op->base == nullptr && mem_op->index == nullptr) {
GB_ASSERT(mem_op->scale == nullptr);
return asm_string;
}
asm_string = gb_string_appendc(asm_string, "(");
if (mem_op->base != nullptr) {
asm_string = this->write_operand(asm_string, op_number, mem_op->base, flags);
@@ -668,7 +674,7 @@ struct lbAsmGenerate_amd64 : lbAsmGenerate {
LLVMValueRef call = LLVMBuildCall2(p->builder, fn_ty, ia, call_args.data, cast(unsigned)call_args.count, "");
if (false) {
if (LLVM_ASM_DEBUG_PRINT) {
// DEBUG PRINT!!!
// DEBUG PRINT!!!
// DEBUG PRINT!!!