Compiler Interface Model
Names and Ownership
The compiler builtin namespace begins with __builtin_bedrock_. Each Name entry in this document denotes that prefix followed by the displayed name. For example, cpuid denotes __builtin_bedrock_cpuid. The ordinary header wrapper uses the __bedrock_ prefix with the same name unless its entry specifies a macro spelling.
All of these identifiers are implementation-reserved. A builtin is a compiler primitive, not an external function symbol. The target headers own wrapper declarations and umbrella include topology; this document owns their ABI-visible meaning.
Header Topology and Exposure
<bedrockintrin.h> is the public umbrella. It includes the core, memory, integer, and floating-point families. <bedrocksystemintrin.h> is the system umbrella for system-register, cache, and MMU facilities. Any family header may also be included directly.
Target Intrinsic Header Families
| Family | Header | Umbrella | Exposure |
|---|---|---|---|
| Cache-Management | <bedrockcacheintrin.h> |
system | cache management |
| Core | <bedrockcoreintrin.h> |
public | unprivileged core operations |
| Floating-Point | <bedrockfpuintrin.h> |
public | floating-point environment, classification, and approximate operations |
| Integer | <bedrockintegerintrin.h> |
public | Bedrock-specific integer operations |
| Memory | <bedrockmemoryintrin.h> |
public | user ordering and access hints |
| MMU | <bedrockmmuintrin.h> |
system | supervisor translation operations |
| System-Register | <bedrocksysregintrin.h> |
system | architectural system-register access |
Common Compilation Rules
Family wrappers are static inline functions unless an encoded immediate or type operand requires a macro. Every builtin listed by an enabled profile must be recognized by the compiler. If a required optional feature is disabled, compilation fails rather than emitting an unresolved call.
An encoded immediate must be an integer constant expression in the stated range. Header inclusion neither suppresses nor emulates architectural privilege checks. An operation is volatile only when its entry states an externally observable architectural effect. Compiler memory effects and hardware ordering are exactly those stated by the entry; one does not imply the other.
The C interface column uses shorthand. Exact declarations are in the named header; u8, u16, u32, and u64 abbreviate the corresponding uintN_t types, and result denotes __bedrock_query_result_t. A clobber means a compiler memory clobber, while a named fence also has the hardware behavior defined by the ISA.