diff --git a/doc/langref.html.in b/doc/langref.html.in index 61fc06fd02..1158135dab 100644 --- a/doc/langref.html.in +++ b/doc/langref.html.in @@ -5864,7 +5864,7 @@ volatile ( : [number] "{rax}" (number), [arg1] "{rdi}" (arg1) // Next is the list of clobbers. These declare a set of registers whose -// values will not be preserved by the execution of this assembly code. +// values will not be preserved by the execution of this assembly code. // These do not include output or input registers. The special clobber // value of "memory" means that the assembly writes to arbitrary undeclared // memory locations - not only the memory pointed to by a declared indirect @@ -5885,7 +5885,7 @@ volatile (
{#header_open|Output Constraints#}- Output constraints are still considered to be unstable in Zig, and + Output constraints are still considered to be unstable in Zig, and so LLVM documentation and @@ -5900,7 +5900,7 @@ volatile ( {#header_open|Input Constraints#}
- Input constraints are still considered to be unstable in Zig, and + Input constraints are still considered to be unstable in Zig, and so LLVM documentation and @@ -5919,7 +5919,7 @@ volatile ( the assembly code. These do not include output or input registers. The special clobber value of {#syntax#}"memory"{#endsyntax#} means that the assembly causes writes to arbitrary undeclared memory locations - not only the memory pointed to by a declared - indirect output. + indirect output.
Failure to declare the full set of clobbers for a given inline assembly @@ -7746,6 +7746,30 @@ test "@setRuntimeSafety" {
{#header_close#} + {#header_open|@splat#} +{#syntax#}@splat(comptime len: u32, scalar: var) @Vector(len, @typeOf(scalar)){#endsyntax#}
+ + Produces a vector of length {#syntax#}len{#endsyntax#} where each element is the value + {#syntax#}scalar{#endsyntax#}: +
+ {#code_begin|test#} +const std = @import("std"); +const assert = std.debug.assert; + +test "vector @splat" { + const scalar: u32 = 5; + const result = @splat(4, scalar); + comptime assert(@typeOf(result) == @Vector(4, u32)); + assert(std.mem.eql(u32, ([4]u32)(result), [_]u32{ 5, 5, 5, 5 })); +} + {#code_end#} ++ {#syntax#}scalar{#endsyntax#} must be an {#link|integer|Integers#}, {#link|bool|Primitive Types#}, + {#link|float|Floats#}, or {#link|pointer|Pointers#}. +
+ {#see_also|Vectors|@shuffle#} + {#header_close#} + {#header_open|@sqrt#}{#syntax#}@sqrt(comptime T: type, value: T) T{#endsyntax#}
@@ -9456,8 +9480,8 @@ const c = @cImport({
When a C pointer is pointing to a single struct (not an array), deference the C pointer to - access to the struct's fields or member data. That syntax looks like +
When a C pointer is pointing to a single struct (not an array), deference the C pointer to + access to the struct's fields or member data. That syntax looks like this:
{#syntax#}ptr_to_struct.*.struct_member{#endsyntax#}
This is comparable to doing {#syntax#}->{#endsyntax#} in C.