From b32846bb354c81831e60c18d149aa0039dd267a9 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Wed, 12 Aug 2026 14:16:10 +0100 Subject: [PATCH] Minor change to `implies_side_effects` --- core/rexcode/isa/x86/tablegen/cpp-compiler/cpp-gen.odin | 3 +++ src/asm_tables_amd64.cpp | 3 +++ src/check_asm.cpp | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/core/rexcode/isa/x86/tablegen/cpp-compiler/cpp-gen.odin b/core/rexcode/isa/x86/tablegen/cpp-compiler/cpp-gen.odin index 1dbff1890..cb23e4666 100644 --- a/core/rexcode/isa/x86/tablegen/cpp-compiler/cpp-gen.odin +++ b/core/rexcode/isa/x86/tablegen/cpp-compiler/cpp-gen.odin @@ -199,6 +199,9 @@ main :: proc() { strings.write_string(&sb, "\t\t\t\t SideEffectFlag_CACHE |\n") strings.write_string(&sb, "\t\t\t\t SideEffectFlag_SERIALIZING)) != 0;\n") strings.write_string(&sb, "\t\t}\n") + strings.write_string(&sb, "\t\tbool implies_side_effects() {\n") + strings.write_string(&sb, "\t\t\treturn side_effects;\n") + strings.write_string(&sb, "\t\t}\n") strings.write_string(&sb, "\t};\n") } strings.write_string(&sb, "\n"); diff --git a/src/asm_tables_amd64.cpp b/src/asm_tables_amd64.cpp index c5a722f14..f35abb5d3 100644 --- a/src/asm_tables_amd64.cpp +++ b/src/asm_tables_amd64.cpp @@ -204,6 +204,9 @@ struct Asm_amd64 { SideEffectFlag_CACHE | SideEffectFlag_SERIALIZING)) != 0; } + bool implies_side_effects() { + return side_effects; + } }; static u16 const register_codes[REG_COUNT]; diff --git a/src/check_asm.cpp b/src/check_asm.cpp index b40e3b167..f60e85817 100644 --- a/src/check_asm.cpp +++ b/src/check_asm.cpp @@ -870,7 +870,7 @@ gb_internal void check_mnemonic(AsmCtx *asm_ctx, CheckerContext *ctx, Entity *tm tmpl_entity->AsmTemplate.clobber_cc |= clobber.implies_clobber_cc(); tmpl_entity->AsmTemplate.clobber_memory |= clobber.implies_clobber_memory(); - tmpl_entity->AsmTemplate.has_side_effects |= clobber.side_effects != 0; + tmpl_entity->AsmTemplate.has_side_effects |= clobber.implies_side_effects(); return; }