tiny.simd.promoteTo
Defined in convert.
Source
Source: lib/simd/src/convert.zig:60
zig
pub fn promoteTo(comptime D: type, value: anytype) D.Vector { const V = @TypeOf(value); const From = sourceLane(V); validateLaneCount(D, V); if (comptime D.Lane == f32 and From == u16) return bfloat.promoteF32(D, value); if (@bitSizeOf(D.Lane) <= @bitSizeOf(From)) { @compileError("promoteTo requires a wider destination lane"); } if (@typeInfo(From) == .int and @typeInfo(D.Lane) == .int and @typeInfo(From).int.signedness == .signed and @typeInfo(D.Lane).int.signedness == .unsigned) { @compileError("promoteTo does not convert signed integers to unsigned integers"); } return numericCast(D, value);}Source: lib/simd/src/root.zig:801
zig
pub const promoteTo = convert.promoteTo;Audit
| Definitions | 1 |
|---|---|
| Public names | 2 |
| Members | 0 |
| Version | 26.7.0 |
| Revision | daab053ee433 |