Christoffer Lerno
Christoffer Lerno
Static initialization is described in the idea section. Globals and constants should be possible to initialize automatically at startup.
``` struct Foo { int w; int v; } func Foo getFoo() { ... } ... struct { int x, int y } result = getFoo(); ```
…s in syntax. Note: this is a largely untested patch, so please check that the copy of the stdlib works as expected before merging.
```c /** * @require $checks(Type a, a == a) **/ module foo; ``` Should work.
On platforms without int128, support must be compiled, either by doing it manually or by implementing the standard routines for it.
This works similar to `@cputarget` but implements switching to be selected at runtime automatically. ```c void foo @multitarget("avx2;atom", "ivybridge", "default") { ... } ``` The above would create versions for...
Set the attribute, e.g. `@cputarget("sse3")` to compile a particular function for a particular featureset.
The attribute allows having a switch setting up functions at runtime, so that it's possible to switch between to version of the function at startup. https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#Common-Function-Attributes
Using a `@deprecated` function or global yields a warning (note). Decide on behaviour for enums, constants etc. Also note the need to link it with versions.
List here: https://www.felixcloutier.com/x86/