omega-mv
Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.
Brought by drakestapleton
omega-mv / mk / polyglot-encoder.mk
| 1 | # POLYGLOT-0 lane B2: B1's kernels emitted by Omega's pure seeded OM-2 AArch64 |
| 2 | # encoder (src/polyglot/omx_encoder.om; spec/polyglot-0.md section 4). |
| 3 | # test-polyglot-encoder: |
| 4 | # 1. assembles B1's .S with GNU as (via $(CC)) and extracts each .text with |
| 5 | # objcopy -O binary (the reference bytes); |
| 6 | # 2. builds tests/polyglot/test_encoder.om via seed/out/omc; |
| 7 | # 3. runs byte comparison vs GNU as (356/356 identical), final-form relocation |
| 8 | # check, Omega decoder round trip, fail-closed checks + all 5,334 logical |
| 9 | # immediates, and the B1 correctness suite. |
| 10 | ifndef POLYGLOT_ENCODER_MK |
| 11 | POLYGLOT_ENCODER_MK := 1 |
| 12 | |
| 13 | PGE_OMC ?= seed/out/omc |
| 14 | PGE_ARCH = -march=armv8.6-a+dotprod+i8mm |
| 15 | OBJCOPY ?= objcopy |
| 16 | PGE_SRCS = src/polyglot/omx_common.om src/polyglot/omx_encoder.om tests/polyglot/test_encoder.om |
| 17 | PGE_DIR = $(OUT_DIR)/tests-polyglot-encoder |
| 18 | PGE_BINS = $(PGE_DIR)/gnu_sdot.text.bin $(PGE_DIR)/gnu_crumb.text.bin |
| 19 | PGE_TEST = $(PGE_DIR)/test_encoder |
| 20 | |
| 21 | $(PGE_DIR)/gnu_%.o: src/polyglot/asm/omx_%.S |
| 22 | @mkdir -p $(dir $@) |
| 23 | $(CC) $(PGE_ARCH) -c -o $@ $< |
| 24 | |
| 25 | $(PGE_DIR)/gnu_%.text.bin: $(PGE_DIR)/gnu_%.o |
| 26 | $(OBJCOPY) -O binary --only-section=.text $< $@ |
| 27 | |
| 28 | $(PGE_TEST): $(PGE_SRCS) |
| 29 | @mkdir -p $(dir $@) |
| 30 | cat $(PGE_SRCS) | $(PGE_OMC) > $@ && chmod +x $@ |
| 31 | |
| 32 | .PHONY: test-polyglot-encoder |
| 33 | test-polyglot-encoder: $(PGE_TEST) $(PGE_BINS) |
| 34 | ./$(PGE_TEST) $(PGE_BINS) |
| 35 | |
| 36 | endif |