Skip to documentation
SLOP

tiny.simd.BFloat16

Reference tiny.simd BFloat16

Defined in bfloat.

API (12)

Actions

Public operations.

Types and contracts

Public types and contracts.

Fields and members

Public fields and members.

No direct callersNo direct callsbfloatBFloat16
Static calls · unresolved targets: unknown · external targets: unknown.

Source

Source: lib/simd/src/bfloat.zig:4

zig
pub const BFloat16 = extern struct {    pub const is_bfloat16 = true;    pub const Storage = u16;    bits: u16,    pub fn fromBits(bits: u16) BFloat16 {        return .{ .bits = bits };    }    pub fn fromF32(value: f32) BFloat16 {        return .{ .bits = bitsFromF32(value) };    }    pub fn fromF64(value: f64) BFloat16 {        const bits: u64 = @bitCast(value);        const rounded_bits = (bits & 0xffff_ffc0_0000_0000) |            ((bits +% 0x0000_003f_ffff_ffff) & 0x0000_0040_0000_0000);        return fromF32(@floatCast(@as(f64, @bitCast(rounded_bits))));    }    pub fn toF32(self: BFloat16) f32 {        return f32FromBits(self.bits);    }    pub fn neg(self: BFloat16) BFloat16 {        return fromBits(self.bits ^ 0x8000);    }    pub fn add(self: BFloat16, other: BFloat16) BFloat16 {        return fromF32(self.toF32() + other.toF32());    }    pub fn sub(self: BFloat16, other: BFloat16) BFloat16 {        return fromF32(self.toF32() - other.toF32());    }    pub fn mul(self: BFloat16, other: BFloat16) BFloat16 {        return fromF32(self.toF32() * other.toF32());    }    pub fn div(self: BFloat16, other: BFloat16) BFloat16 {        return fromF32(self.toF32() / other.toF32());    }};

Source: lib/simd/src/root.zig:143

zig
pub const BFloat16 = bfloat.BFloat16;
Called byCallsNo direct callersBFloat16fromF32BFloat16toF32BFloat16add
Static calls · unresolved targets: 0 · external targets: 1.
Called byCallsNo direct callersBFloat16fromF32BFloat16toF32BFloat16div
Static calls · unresolved targets: 0 · external targets: 1.
Called byCallsNo direct callsBFloat16negbfloatstoretest sourcelib.simd.src.printtest: pinned Highway diagnostic type ...test sourcelib.simd.src.printtest: vector diagnostics preserve arr...printwriteVectorBFloat16fromBits
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersBFloat16fromF32BFloat16toF32BFloat16mul
Static calls · unresolved targets: 0 · external targets: 1.
Called byCallsNo direct callersBFloat16fromBitsBFloat16neg
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersBFloat16fromF32BFloat16toF32BFloat16sub
Static calls · unresolved targets: 0 · external targets: 1.

Audit

Definitions9
Public names18
Members1
Version26.7.0
Revisiondaab053ee433