Skip to content

Build with DICE-nx - #4

Open
codewiz wants to merge 1 commit into
mainfrom
compiler/dice-nx
Open

codewiz wants to merge 1 commit into
mainfrom
compiler/dice-nx

Conversation

@codewiz

@codewiz codewiz commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

Builds Benchwork with DICE-nx 3.20.0: make CC=dcc, or CC=dcc-volamos to run it under volamos. All 14 benchmarks it builds give gcc's checksums. png-encode and png-decode are left out until dcpp can preprocess libpng.

Results

Fastest iteration in ms under volamos --clock-mhz 25 --cpu 68040 --fpu, percentages against gcc 6.5.0b. The fastest cell of each row is in bold.

benchmark gcc 6.5.0b gcc 16.2-rc14 SAS/C 6.58 DICE-nx 3.20
dhrystone 420 421 (+0.26%) 581 (+38.21%) 1023 (+143.55%)
backdrop 2891 1941 (-32.87%) 4267 (+47.57%) 7954 (+175.10%)
lha-pack 4375 4441 (+1.49%) 5022 (+14.77%) 6330 (+44.67%)
lha-unpack 1378 1379 (+0.05%) 1507 (+9.32%) 1560 (+13.22%)
zlib-deflate 3172 3698 (+16.59%) 4096 (+29.13%) 4432 (+39.73%)
zlib-inflate 447 511 (+14.21%) 492 (+10.05%) 543 (+21.45%)
png-encode 6562 7543 (+14.95%) 9483 (+44.51%) not built
png-decode 1529 1587 (+3.82%) 1985 (+29.87%) not built
ftgrays 845 858 (+1.56%) 942 (+11.48%) 1191 (+40.85%)
memcpy-small 186 193 (+4.14%) 348 (+87.63%) 940 (+406.76%)
memcpy-large 328 326 (-0.44%) 501 (+52.81%) 1283 (+291.23%)
memcpy-var-small 588 565 (-3.92%) 423 (-27.94%) 1061 (+80.47%)
memcpy-var-large 638 635 (-0.52%) 644 (+0.92%) 1673 (+162.17%)
memmove-small 2247 2351 (+4.61%) 3110 (+38.40%) 1274 (-43.33%)
memmove-large 4011 4127 (+2.89%) 8911 (+122.20%) 2291 (-42.87%)
wipeout-tris 507 519 (+2.38%) 672 (+32.73%) 1390 (+174.50%)
GEOMEAN, 16 rows 1149 1162 (+1.17%) 1491 (+29.78%)
GEOMEAN, 14 rows 994 994 (+0.07%) 1280 (+28.78%) 1721 (+73.20%)

The 14-row geomean leaves out the two PNG rows, so DICE can be compared. DICE generates no 68040 or FPU code (its -881 is documented as unfinished), so its column is the 68020 soft-float build; its float math goes to the ROM libraries, which volamos runs at zero cycles, which flatters it on wipeout-tris. Its C library's memmove is the fastest of the four.

Changes

  • compiler.mk: a DICE-nx branch: -3.2 -//, the small data model except -mD for the Wipeout kernel (no auto-open library exists for the large model), libpng left out, and the version strings through a generated bench-defines.h, since dcc drops the quoting of a -D value when it passes it to dcpp.
  • src/compiler.h: a _DCC section. DICE's long long is 32 bits wide, so HAVE_LONG_LONG stays undefined; inline and restrict are defined away. The sections are indented.
  • benches/png.c: with BENCH_NO_LIBPNG the two benchmarks keep their rows and fail their setup.
  • benches/*.c: the bench registrations lose their trailing commas, which dc1 rejects.
  • third_party/freetype/ftgrays.c: under _DCC, the Smooth_Err_* codes are an enum, so FT_ERR_CAT's pasted names need no rescan.
  • Makefile: the optional libpng sources, the generated header rule, and reported flags with stray spaces stripped.

The LHa K&R cleanup this needed is already on main (80f469d). Running DICE-nx under volamos needs sidick/volamos#117.

Upstream issues

🤖 Generated with Claude Code


Note

Low Risk
Additive toolchain and ifdef-guarded build paths; default GCC/vbcc/SAS/C behavior is unchanged aside from harmless trailing-comma removal in bench tables.

Overview
Adds DICE-nx as a build target (make CC=dcc), alongside existing GCC/vbcc/SAS/C paths.

Build (compiler.mk, Makefile): New dcc branch sets AmigaOS 3.2 flags, small data model (large model only for Wipeout via -mD), extra include paths, and omits libpng sources when NO_LIBPNG is set. Version/CFLAGS strings that cannot be passed through dcc’s -D quoting are emitted into generated bench-defines.h; main.c includes it when BENCH_DEFINES_H is defined. REPORTED_CFLAGS is stripped of extra whitespace.

Compiler portability (src/compiler.h): _DCC defines C89-style bool, disables inline/restrict, and leaves HAVE_LONG_LONG unset (32-bit long long).

Benchmarks: png-encode / png-decode stay in the table but use stub setup/run paths under BENCH_NO_LIBPNG so they fail setup instead of linking libpng. All struct bench registrations drop trailing commas (required by DICE’s dc1).

Vendored FreeType (ftgrays.c): Under _DCC, Smooth_Err_* are real enum constants so error macros do not rely on ## rescan in dcpp.

Reviewed by Cursor Bugbot for commit 1e24324. Bugbot is set up for automated code reviews on this repo. Configure here.

make CC=dcc (or dcc-volamos), with the 68020 binary standing in for the
040 one, since DICE generates no 68040 or FPU code. libpng is left out:
dcpp does not rescan the result of ##, which its chunk tables need, so
png-encode and png-decode fail their setup. The bench registrations
lose their trailing commas, FreeType's error codes become an enum under
_DCC, and the version strings reach main.c through a generated header,
since dcc drops the quoting of a -D.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T15:13:59.621290Z 1e24324 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1e24324. Configure here.

Comment thread compiler.mk
DEFINE_FLAG = -D
# dcpp looks up quoted includes on the include path only, not beside
# the including file.
EXTRA_INCLUDES = compat third_party/freetype third_party/wipeout $(BUILD)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wipeout kernel includes wrong header

Medium Severity

dcpp only searches the -I path for quoted includes, and that path lists src before third_party/wipeout. kernel.c's #include "bench.h" therefore picks up src/bench.h instead of Wipeout's header, so the intended layout assertions never run and bench_consume is only implicitly declared.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1e24324. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant