Zig 0.17.0-dev (Split by item) This is an example of documentation generated by
ZigDoc , an alternative to Zig's built-in
Auto Doc feature. See also
examples in other modes/formats . The project being documented here (as the example) is the Zig standard library.
std › zig › llvm › Builder › x86_fp80ConstAssumeCapacity Private Function x86_fp80ConstAssumeCapacity Doc Source Private Function std.zig.llvm.Builder.x86_fp80ConstAssumeCapacity
fn x86_fp80ConstAssumeCapacity (self : *Builder , val : f80 ) Constant Params File zig/llvm/Builder.zig: 12447
12447
12448
12449
12450
12451
12452
12453
12454
12455
12456
12457
12458
12459
12460
12461
12462
12463
12464
12465
12466
12467
12468
12469
12470
12471
12472
12473
12474
12475
12476
12477
12478 fn x86_fp80ConstAssumeCapacity (self : *Builder , val : f80 ) Constant {
const Adapter = struct {
builder : *const Builder ,
pub fn hash (_ : @This (), key : f80 ) u32 {
return @truncate (std .hash .Wyhash .hash (
comptime std .hash .int (@backingInt (Constant .Tag .x86_fp80 )),
std .mem .asBytes (&key )[0 ..10 ],
));
}
pub fn eql (ctx : @This (), lhs_key : f80 , _ : void , rhs_index : usize ) bool {
if (ctx .builder .constant_items .items (.tag )[rhs_index ] != .x86_fp80 ) return false ;
const rhs_data = ctx .builder .constant_items .items (.data )[rhs_index ];
const rhs_extra = ctx .builder .constantExtraData (Constant .Fp80 , rhs_data );
return @as (u80 , @bitCast (lhs_key )) == @as (u80 , rhs_extra .hi ) << 64 |
@as (u80 , rhs_extra .lo_hi ) << 32 | rhs_extra .lo_lo ;
}
};
const gop = self .constant_map .getOrPutAssumeCapacityAdapted (val , Adapter { .builder = self });
if (!gop .found_existing ) {
gop .key_ptr .* = {};
gop .value_ptr .* = {};
self .constant_items .appendAssumeCapacity (.{
.tag = .x86_fp80 ,
.data = self .addConstantExtraAssumeCapacity (Constant .Fp80 {
.lo_lo = @truncate (@as (u80 , @bitCast (val ))),
.lo_hi = @truncate (@as (u80 , @bitCast (val )) >> 32 ),
.hi = @intCast (@as (u80 , @bitCast (val )) >> 64 ),
}),
});
}
return @fromBackingInt (@intCast (gop .index ));
}