Skip to main content

Crate vyre_intrinsics

Crate vyre_intrinsics 

Source
Expand description

§vyre-intrinsics - Cat-C hardware intrinsics

This crate holds every vyre op that requires dedicated backend and reference-interpreter support - the ones that cannot be written as fn(...) -> Program over existing vyre::ir::* primitives. If an op can be expressed purely as a composition of existing Expr/Node variants, it belongs in vyre-libs or a user package, NOT here.

See docs/migration-vyre-ops-to-intrinsics.md for the classification rule that drove the split.

§Current surface (9 intrinsics)

  • subgroup_add, subgroup_ballot, subgroup_shuffle - wave-level ops backed by target builder 25+ subgroup lowering.
  • workgroup_barrier, storage_barrier - concurrency fences.
  • bit_reverse_u32, popcount_u32 - bit intrinsics mapping 1:1 to hardware instructions (reverseBits, countOneBits).
  • fma_f32 - fused multiply-add (byte-identical to f32::mul_add).
  • inverse_sqrt_f32 - maps to hardware inverseSqrt() via target builder.

Everything else that used to live here (atomics, lzcnt/tzcnt, clamp_u32, hashes) moved to vyre-libs in Migration 2–3.

Modules§

category_check
Category-classification consistency gate (F-IR-34). Runtime category-classification consistency check (F-IR-34).
cpu_op
CPU reference evaluation traits re-exported from vyre-foundation. CPU-side Op trait + helpers for op-by-op evaluation. CPU reference execution contract for operation types.
hardware
Category C hardware intrinsics - subgroup collectives, barriers, bit intrinsics, FMA, inverseSqrt. Cat-C hardware intrinsics - each ships a builder, CPU reference (in vyre-reference), and dedicated target builder emitter arm. Backends that cannot lower return UnsupportedByBackend rather than falling back to slow CPU paths.
region
Region builder - the composition-chain wrap helper mandatory at every tier. Spec: docs/region-chain.md. Region builder - mandatory wrap-every-body helper for every Cat-C intrinsic. Spec: docs/region-chain.md.

Structs§

Backend
Spec types every intrinsic registers against: algebraic laws, backend identifiers, intrinsic descriptors. Backend identity used when checking Category C intrinsic availability.
BackendId
Spec types every intrinsic registers against: algebraic laws, backend identifiers, intrinsic descriptors. Stable string identity for a backend.
IntrinsicDescriptor
Spec types every intrinsic registers against: algebraic laws, backend identifiers, intrinsic descriptors. Descriptor for a Category C hardware intrinsic.

Enums§

AlgebraicLaw
Spec types every intrinsic registers against: algebraic laws, backend identifiers, intrinsic descriptors. An algebraic law that an operation must satisfy in the frozen data contract.

Traits§

CategoryAOp
CPU reference evaluation traits re-exported from vyre-foundation. Marker trait for Category A operations with an executable IR program.
CpuOp
CPU reference evaluation traits re-exported from vyre-foundation. CPU reference implementation for an operation.

Functions§

structured_intrinsic_cpuDeprecated
CPU reference evaluation traits re-exported from vyre-foundation. Failing CPU adapter for intrinsics whose existing reference accepts structured buffers.

Type Aliases§

CpuFn
Spec types every intrinsic registers against: algebraic laws, backend identifiers, intrinsic descriptors. Flat byte-ABI CPU reference function used by Category C descriptors.