authorgravatar for me@tadeo.caTadeo Kondrak <me@tadeo.ca> 2020-04-27 23:46:49-06:00
committergravatar for me@tadeo.caTadeo Kondrak <me@tadeo.ca> 2020-04-28 00:47:14-06:00
log0673a8d5763bf0fec007d8ed05128310a9e66719
tree8961ba31223d8a27720782f067d5931e68d0e9e4
parentf977155fdbee95a68799ec3a2199db6c79487125
signaturelock-open Commit is signed but in an unrecognized format.

Update language reference for std.meta.Vector


1 files changed, 5 insertions(+), 16 deletions(-)

doc/langref.html.in+5-16
......@@ -1850,8 +1850,8 @@ test "null terminated array" {
18501850 {#header_open|Vectors#}
18511851 <p>
18521852 A vector is a group of {#link|Integers#}, {#link|Floats#}, or {#link|Pointers#} which are operated on
1853 in parallel using a single instruction ({#link|SIMD#}). Vector types are created with the builtin
1854 function {#link|@Vector#}.
1853 in parallel using a single instruction ({#link|SIMD#}). Vector types are created with the builtin function {#link|@Type#},
1854 or using the shorthand as {#syntax#}std.meta.Vector{#endsyntax#}.
18551855 </p>
18561856 <p>
18571857 TODO talk about C ABI interop
......@@ -7934,7 +7934,7 @@ test "@setRuntimeSafety" {
79347934 {#header_close#}
79357935
79367936 {#header_open|@shuffle#}
7937 <pre>{#syntax#}@shuffle(comptime E: type, a: @Vector(a_len, E), b: @Vector(b_len, E), comptime mask: @Vector(mask_len, i32)) @Vector(mask_len, E){#endsyntax#}</pre>
7937 <pre>{#syntax#}@shuffle(comptime E: type, a: std.meta.Vector(a_len, E), b: std.meta.Vector(b_len, E), comptime mask: std.meta.Vector(mask_len, i32)) std.meta.Vector(mask_len, E){#endsyntax#}</pre>
79387938 <p>
79397939 Constructs a new {#link|vector|Vectors#} by selecting elements from {#syntax#}a{#endsyntax#} and
79407940 {#syntax#}b{#endsyntax#} based on {#syntax#}mask{#endsyntax#}.
......@@ -7990,7 +7990,7 @@ test "@setRuntimeSafety" {
79907990 {#header_close#}
79917991
79927992 {#header_open|@splat#}
7993 <pre>{#syntax#}@splat(comptime len: u32, scalar: var) @Vector(len, @TypeOf(scalar)){#endsyntax#}</pre>
7993 <pre>{#syntax#}@splat(comptime len: u32, scalar: var) std.meta.Vector(len, @TypeOf(scalar)){#endsyntax#}</pre>
79947994 <p>
79957995 Produces a vector of length {#syntax#}len{#endsyntax#} where each element is the value
79967996 {#syntax#}scalar{#endsyntax#}:
......@@ -8002,7 +8002,7 @@ const assert = std.debug.assert;
80028002test "vector @splat" {
80038003 const scalar: u32 = 5;
80048004 const result = @splat(4, scalar);
8005 comptime assert(@TypeOf(result) == @Vector(4, u32));
8005 comptime assert(@TypeOf(result) == std.meta.Vector(4, u32));
80068006 assert(std.mem.eql(u32, &@as([4]u32, result), &[_]u32{ 5, 5, 5, 5 }));
80078007}
80088008 {#code_end#}
......@@ -8360,17 +8360,6 @@ fn foo(comptime T: type, ptr: *T) T {
83608360 {#syntax#}@unionInit{#endsyntax#} forwards its {#link|result location|Result Location Semantics#} to {#syntax#}init_expr{#endsyntax#}.
83618361 </p>
83628362 {#header_close#}
8363
8364 {#header_open|@Vector#}
8365 <pre>{#syntax#}@Vector(comptime len: u32, comptime ElemType: type) type{#endsyntax#}</pre>
8366 <p>
8367 This function returns a vector type for {#link|SIMD#}.
8368 </p>
8369 <p>
8370 {#syntax#}ElemType{#endsyntax#} must be an {#link|integer|Integers#}, a {#link|float|Floats#}, or a
8371 {#link|pointer|Pointers#}.
8372 </p>
8373 {#header_close#}
83748363 {#header_close#}
83758364
83768365 {#header_open|Build Mode#}