interplane.Get Omega
Read in your language

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

branch main Branches Tags History

omega-mv / mk / polyglot-encoder.mk

36 lines · 1359 bytes Raw Blame History
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.
10ifndef POLYGLOT_ENCODER_MK
11POLYGLOT_ENCODER_MK := 1
12
13PGE_OMC ?= seed/out/omc
14PGE_ARCH = -march=armv8.6-a+dotprod+i8mm
15OBJCOPY ?= objcopy
16PGE_SRCS = src/polyglot/omx_common.om src/polyglot/omx_encoder.om tests/polyglot/test_encoder.om
17PGE_DIR = $(OUT_DIR)/tests-polyglot-encoder
18PGE_BINS = $(PGE_DIR)/gnu_sdot.text.bin $(PGE_DIR)/gnu_crumb.text.bin
19PGE_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
33test-polyglot-encoder: $(PGE_TEST) $(PGE_BINS)
34 ./$(PGE_TEST) $(PGE_BINS)
35
36endif