Repository navigation
E112: the primitives (a survey), and the plan made from them - #88
Merged
Merged
Conversation
23 small C programs, one for each thing a program is made of (loop, if, the conditional operator, pointer, recursion, pointer to a function, switch, arrays and structures, multiply and divide, bytes, double, float, long double, shifts, rotations, bit fields, filling and copying, pixels, a hash, large numbers), built with GCC and kept built. All print on g86m what they print on the real CPU. tools/prim64.sh runs and compares them; tools/prim64_table.py prints host instructions for a guest instruction and what the short front does not run. The integer primitives are alike (291 to 339); the expensive groups are the string instructions with a repeat count, division, the XMM registers and the x87. The order of work is docs/primitives64.md. No change to src/. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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.
What
The owner's proposal: not benchmarks, which measure a mixture, but one small C program for each thing a program is made of, built with GCC as real programs are. No change to
src/.tests/prim64/: 23 programs (loop, if, the conditional operator, pointer, recursion, pointer to a function, switch, arrays and structures, multiply and divide, bytes; double arithmetic, comparison and conversion, float, long double; shifts, rotations and bit searching, bit fields; filling and copying, pixels one at a time and several at a time; a hash, large numbers), kept built (p_*.elf, GCC 15.2) with what each prints on the real CPU (p_*.out).tools/prim64.sh: runs each on g86m and compares; withORACLE_HOST=namebuilds them again there and takes the expected text.tools/prim64_table.py: the table, from/usr/bin/time -land a counting copy of the sources.docs/primitives64.md: the table and the order of work. E112 indocs/experiments.md.Found
Order of work (each an entry of its own)
Not measured
The primitives inside the machine, with paging; how common each primitive is in real programs.
🤖 Generated with Claude Code