Skip to content

Commit 1e8a8ec

Browse files
committed
Formatting change
1 parent 1ba8318 commit 1e8a8ec

29 files changed

Lines changed: 292 additions & 308 deletions

CONTRIBUTING.md

Lines changed: 0 additions & 23 deletions
This file was deleted.

README.md

Lines changed: 129 additions & 270 deletions
Large diffs are not rendered by default.

docs/CONTRIBUTING.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Contributing to Ternary GCC Plugin
2+
3+
## How to Contribute
4+
5+
1. Fork the repository.
6+
2. Create a feature branch.
7+
3. Make your changes and add any new tests or helpers.
8+
4. Run `make test` (and `make check-helper-docs` if you touched the helper ABI).
9+
5. Submit a PR with a concise description of the behavioral changes and any test results.
10+
11+
## Guidelines
12+
13+
- Follow GCC plugin best practices.
14+
- Run `tools/check_helper_docs.py` (via `make check-helper-docs`) whenever you add or update helpers so the documentation stays in sync with `include/ternary_runtime.h`.
15+
- Add regression tests whenever the helper ABI or runtime behavior changes.
16+
- Reference the updated README sections when describing functionality and compatibility.
17+
18+
## Building with CMake
19+
20+
```bash
21+
mkdir build && cd build
22+
cmake ..
23+
make
24+
```
File renamed without changes.
File renamed without changes.

docs/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Documentation Index
2+
3+
The repository README now lives at [`../README.md`](../README.md) so that visitors landing at the root get the full guide. This folder continues to hold supplemental documents listed below.
4+
5+
- [docs/CONTRIBUTING.md](CONTRIBUTING.md)
6+
- [docs/ROADMAP.md](ROADMAP.md)
7+
- [docs/SPECIFICATION.md](SPECIFICATION.md)
8+
- [docs/MASTER_ISA.md](MASTER_ISA.md)
9+
- [docs/ENCODING.md](ENCODING.md)

ROADMAP.md renamed to docs/ROADMAP.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,12 @@ Deliverables:
4141
- Expand lowering to cover all defined intrinsics and ternary ops.
4242
- Ensure safe handling for unsupported types and conditions.
4343
- Add diagnostics for unsupported or ambiguous cases.
44+
- Track Phase 3/4 regression coverage (lowering + diagnostics) with a dedicated script/log so each milestone emits a clear artifact.
4445

4546
Deliverables:
4647
- Plugin coverage test suite in `tests/`.
4748
- GIMPLE-based regression tests (golden output or dg tests).
49+
- `tests/run_phase34_coverage.sh` + `tests/PHASE34_COVERAGE.md` document the targeted entries and log file for upcoming checkpoints.
4850

4951
## Phase 4: Optimization and Codegen Validation
5052

@@ -82,7 +84,8 @@ Deliverables:
8284
- Document supported platform/compiler versions and current status.
8385
- Add ABI validation checks in CI (symbol presence or hash).
8486
- Ensure the documented helper ABI (`SPECIFICATION.md`/README) stays aligned with the headers
85-
(`include/ternary_runtime.h`, `include/ternary_helpers.h`), ideally via a CI regression.
87+
(`include/ternary_runtime.h`, `include/ternary_helpers.h`), ideally via a CI regression triggered by
88+
`tools/check_helper_docs.py` so README/SPEC restructure stays aligned with the header order.
8689

8790
Deliverables:
8891
- Compatibility matrix in `README.md`.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,8 @@ helper implementations can be shared between plugin tests and downstream runtime
447447
`__ternary_tt2b_t64`, `__ternary_t2f32_t32`, `__ternary_t2f32_t64`, `__ternary_t2f64_t32`,
448448
`__ternary_t2f64_t64`, `__ternary_f2t32_t32`, `__ternary_f2t32_t64`, `__ternary_f2t64_t32`,
449449
`__ternary_f2t64_t64`.
450+
- **Conversion helpers (t128, when `_BitInt(256)` is available)**:
451+
`__ternary_tb2t_t128`, `__ternary_tt2b_t128`.
450452
- **Memory helpers**: `__ternary_load_t32`, `__ternary_store_t32`, `__ternary_load_t64`,
451453
`__ternary_store_t64`.
452454
- **Vector SIMD helpers**: `__ternary_add_tv32`, `__ternary_sub_tv32`, `__ternary_mul_tv32`,

include/ternary_helpers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Adjust the assembly to match your actual ISA and calling convention.
77
*
88
* The Setun ISA and modern REBEL-6 work inspired the helpers below. When possible prefer
9-
* the ternary-only ops listed in MASTER_ISA.md (three-valued implication, majority voting,
9+
* the ternary-only ops listed in ../docs/MASTER_ISA.md (three-valued implication, majority voting,
1010
* TMIN/TMAX, TQUANT, TMULADD, and symmetric rounding) instead of emulating them with
1111
* binary sequences. These helpers stay compatible with the GCC plugin ABI and are intended
1212
* to survive into hardware-friendly implementations.

include/ternary_runtime.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ t128_t __ternary_tmux_t128(t128_t sel, t128_t neg, t128_t zero, t128_t pos);
164164
t128_t __ternary_tequiv_t128(t128_t a, t128_t b);
165165
t128_t __ternary_txor_t128(t128_t a, t128_t b);
166166
int __ternary_tnet_t128(t128_t a);
167+
int64_t __ternary_tt2b_t128(t128_t v);
168+
t128_t __ternary_tb2t_t128(int64_t v);
167169
#endif
168170

169171
/* Ternary-specific comparison operations for t64 (return ternary results) */

0 commit comments

Comments
 (0)