Skip to content

Commit b07aec9

Browse files
authored
Merge pull request #41 from ApolloTeam-dev/v4-results-core-12556
First V4 measurements (Core 12556): add.l mem loop, FPU, CCC
2 parents 7fb891f + 6123e16 commit b07aec9

6 files changed

Lines changed: 20 additions & 6 deletions

File tree

‎core/cpu-68080/caches-and-memory.md‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ counter, median of 7, two identical runs (M, Core 12841, 2026-10-29):
6262
- Store-to-load forwarding works, but a counter kept in memory with
6363
read-modify-write in a loop serialises (M). Gunnar expects a loop of
6464
`add.l #1,memcounter` + `dbra` to run at about 1 iteration per cycle (G,
65-
2026-11-03); a measurement of that loop is still to be done.
65+
2026-11-03). Measured on Core 12556, the loop takes 2 cycles per
66+
iteration, and 20–23 when the counter is in the same 64-byte line as the
67+
loop code; `dbra` alone and `addq.l #1,Dn` + `dbra` take 1 cycle
68+
(M, Core 12556, V4 UniCorn, `tools/v4/tests/add-mem-dbra`, 2026-11-09). Not yet measured on Core 12841.
6669

6770
### What a miss costs (G, 2026-11-03)
6871

@@ -130,5 +133,8 @@ Copy of a 156 x 2464-byte shape (M):
130133
random.
131134
- DON'T use a table for anything you can compute in 16 cycles or less (G).
132135
- DON'T keep a loop counter in memory.
136+
- DON'T write data in a loop that sits in the same 64-byte line as the
137+
loop's code: a read-modify-write there cost 10 times as much (M, Core
138+
12556).
133139
- DON'T compare memory-bound timings across Core 12600: the memory
134140
controller doubled from 64 to 128 bits there.

‎core/cpu-68080/core-at-a-glance.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ statement wins.
3636
| Pipes | PRM: 3 (Anton, Bruno, Cesar). **2 enabled on Core 12798-12841** (M): IEP3 always reads 0. A third pipe comes in a future core (G) |
3737
| Decoders | 3. Only the first takes multi-cycle instructions (mul, div, movem, bitfields, FPU) and addx/subx/negx, which need the flags of the previous instruction |
3838
| I-cache | 32 KB, **64-byte line** (G, 2026-10-29). Feeds the decoders **16 bytes per cycle**; a group of instructions that run together is at most 16 bytes (some I-cache variants: 18) (G, 2026-11-03), see [execution-units.md](execution-units.md). Few ways on Core 12841 (G); the number of ways is a build option: 4, 2 or 1 (G, 2026-10-30). Note the core build with every measurement |
39-
| D-cache | 128 KB, **64-byte line** (G, 2026-10-29; M). **1 read and 1 write per cycle** (G, 2026-11-03): `add.l #1,mem` runs at about 1 per cycle. One memory address per cycle, so an instruction with two memory operands needs more than one |
39+
| D-cache | 128 KB, **64-byte line** (G, 2026-10-29; M). **1 read and 1 write per cycle** (G, 2026-11-03): `add.l #1,mem` runs at about 1 per cycle; measured with `dbra` on Core 12556: 2 cycles per iteration (M). One memory address per cycle, so an instruction with two memory operands needs more than one |
4040
| Bus and memory | Memory controller 128-bit from Core 12600, 64-bit before (G, 2026-11-04). 64-byte bursts (one cache line), about 12 cycles latency, automatic prefetch of sequential streams |
4141
| Branch cache | 1024-entry BTC, a loop predictor, and a return cache for rts/rtd/rtr |
4242
| MMU | None. PMMU and cp4–cp6 opcodes are illegal (`lpstop` remains) |

‎core/cpu-68080/execution-units.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ type: reference
44
owner: WDrijver
55
status: reviewed
66
origin: ai-assisted
7-
basis: [core-developer]
7+
basis: [core-developer, measured]
88
components: [cpu-68080]
99
applies_to:
1010
core: "any"
@@ -67,7 +67,8 @@ the ALUs that own the data registers. Most cores run 2 pipes; 3 are planned.
6767
- The data cache does one read and one write per cycle. A loop of
6868
`add.l #1,memcounter` + `dbra` should run about 100 million times a second
6969
at 100 MHz: 100 million reads and 100 million writes, here to the same
70-
address.
70+
address. Measured on Core 12556: 2 cycles per iteration, see
71+
[caches-and-memory.md](caches-and-memory.md) (M, Core 12556, V4 UniCorn, `tools/v4/tests/add-mem-dbra`, 2026-11-09).
7172
- One memory address is computed per cycle (one EAMEM in
7273
[pipeline-15-stages.md](pipeline-15-stages.md)). An instruction with two
7374
memory operands, such as `move.l (a0)+,(a1)+`, needs two addresses. A

‎core/cpu-68080/performance-counters.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ reliable way to time code. The other event counters read 0 on release cores.
3838
- The debug and event counters (BPC/BPW, DCH/DCM `$80E/$80F`,
3939
STR/STC/STB/MWR) read 0 on release cores (M).
4040
- On Core 12830–12841 the counters are readable with `movec` in user mode.
41+
CCC is too on Core 12556 (M, V4 UniCorn, `tools/v4/tests/`, 2026-11-09).
4142

4243
### Reading the cycle counter
4344

‎core/cpu-68080/pipeline-15-stages.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ hazard unit, the D-cache read and the write FIFO.
5757
- **One memory address per cycle.** There is one EAMEM, shared by all
5858
pipes. Two loads in one cycle are impossible by design. The data cache does
5959
one read and one write per cycle, so a read-modify-write such as
60-
`add.l #1,mem` runs at about 1 per cycle (G, 2026-11-03).
60+
`add.l #1,mem` runs at about 1 per cycle (G, 2026-11-03). Measured with
61+
`dbra` on Core 12556: 2 cycles per iteration (M, see
62+
[caches-and-memory.md](caches-and-memory.md)).
6163
- **The ALU-to-EA bubble.** Addresses are computed at stage 8; an ALU result
6264
arrives at stage 11/12. A Dn produced by the ALU and used for an address by
6365
a following instruction arrives 3–4 stages too late (M: write it about 4

‎toolchain/pitfalls/float-settings-mismatch.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ sources:
2929

3030
- For the AmigaOS target, `-m68080` alone does **not** turn on the FPU: no
3131
680x0 CPU option does (SRC). Hardware floating point comes from `-m68881`
32-
(assumed correct; still to be validated with a test build). `-m68080`
32+
(M: on Core 12556 a float loop built with `-m68080 -m68881` ran 7.9
33+
times faster than with `-m68080` alone). `-m68080`
3334
alone compiles float work into calls such as `__floatsisf` (M).
3435
- Objects built with different float settings, linked together (for example
3536
`-m68080` objects with a libnix `printf` built for the other setting), pass
@@ -50,6 +51,8 @@ m68k-amigaos-gcc lib.o app.o -noixemul -o app # mixed
5051

5152
- Compile **and** link everything with the same flags, including `-m68881`:
5253
the standard set is in [c-compiler-options.md](../c-compiler-options.md).
54+
- A program built for soft-float on purpose links with `-lm`: libnix keeps
55+
`__mulsf3` and the other soft-float routines in its `libm` (M).
5356
- Keep library code (`-nostartfiles`) integer (fixed point), and check its
5457
objects for soft-float symbols.
5558
- Write FPU kernels in assembler when you need full control over the FPU
@@ -90,3 +93,4 @@ float scale(float a, float b) { return a * b; }
9093
| No 680x0 CPU option sets the FPU flag for AmigaOS; `-m68881` sets hard float explicitly | (SRC) | any | GCC source, `m68k.c` |
9194
| `-m68080` objects with libnix `printf` printed garbage doubles | (M) | any | MP3 project |
9295
| Soft-float in a `-nostartfiles` library crashed with a CHK error | (M) | any | MP3 library, ReplayGain path |
96+
| `-m68080 -m68881` runs FPU code on a V4: 8 cycles per element of a float dot product, 63 with `-m68080` alone | (M) | Core 12556 | `tools/v4/tests/fpu-m68881`, V4 UniCorn, 3 alternating rounds, 2026-11-09 |

0 commit comments

Comments
 (0)