Repository navigation
CI: check the code GCC and vasm emit (kb:expect) - #32
Merged
Merged
Conversation
kb:compile blocks can now carry kb:expect / kb:expect-not lines (text in GCC's -S output, or hex bytes in vasm's -Fbin output) and kb:opts (other code-generation flags). tools/check_emitted_code.py runs after compiling in the compile-examples job. First checks: hard vs soft float (float-settings-mismatch), the 68080 instructions GCC emits (compiler-variants), four vasm encodings (vasm-68080-encoding-issues). compiler-variants: GCC has patterns for cmpiw.l, addiw.l and dbra.l only; moviw.l and bcc.s+ from the ACD README are not in the GCC source or the ACD patches. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Step 3, part 1:
kb:compileblocks can now check what the toolchain emits. They don't only prove that the code compiles.What it does
// kb:expect <text>/kb:expect-not: for C and C++, the text must, or must not, occur in GCC's-Soutput. For assembly, the text is hex bytes that must, or must not, occur in vasm's-Fbinoutput.kb:opts <flags>: build the block with other code-generation flags.tools/compile-snippets.shalso writes.asm/.binfor blocks that have checks;tools/check_emitted_code.pychecks them (new step incompile-examples).CONTRIBUTING.mdsections 6 and 10, and intoolchain/index.md.The checks read text and bytes:
m68k-amigaos-objdumpcan't decode 68080 instructions (cmpiw.lcomes out as.short 0x4e2f).First checks (13 expectations, all pass locally with GCC-6.50-Dev)
toolchain/pitfalls/float-settings-mismatch.md:-m68080 -m68881givesfsmul.s;-m68080alone gives___mulsf3.toolchain/compiler-variants.md: GCC emitscmpiw.l,addiw.l,dbral, and amove.l #imminstead ofmoviw.l.toolchain/pitfalls/vasm-68080-encoding-issues.md:add.l b1,d0→$71F1,tst e6→$7104 4A46,add.l #imm,En→$7101, out-of-rangebra.s→bra.s+$6049.Content change
compiler-variants.md: the ACD README listsmoviw.landbcc.s+among the instructions GCC generates. Neither WDrijver/gcc (gcc-stable,68080regs) nor the ACD patches have a pattern for them, and GCC-6.50-Dev emitsmove.l #imminstead. The text now says this (SRC), and a check fails as soon as GCC starts emittingmoviw.Not yet checked (findings for TuKo1982)
vasm-68080-encoding-issues.mdsays that without-no-opt, vasm emitsand/or/sub #imminstead ofandi/ori/subiand turnsmove.l #immintomoveq. With vasm 2.0f from ACD (Mac, 2026-11-08):move.l #5,d0stays203C 0000 0005with any option (default,-no-opt,-opt-speed,-devpac,-phxass).and.l #5,d0→C0BCandor.l #5,d1→82BC, also with-no-optand-devpac.-no-opt,sub.l #500,d2becomes the 68080addiw.l #-500,d2(06C2 FE0C); with-no-optit becomes94BC 0000 01F4.Not changed here: these claims are (M) and from TuKo, so he decides.
Knowledge base files relied on
toolchain/pitfalls/float-settings-mismatch.md,toolchain/pitfalls/vasm-68080-encoding-issues.md,toolchain/compiler-variants.md,toolchain/pitfalls/gcc-dbra-address-register-loop.mdcore/cpu-68080/prm/integer/bra-s-plus.md,core/cpu-68080/prm/integer/moviw.md,core/cpu-68080/branches-and-prediction.md🤖 Generated with Claude Code