Comment #0 by bearophile_hugs — 2013-06-22T07:33:30Z
import std.stdio, core.simd;
void main() {
ubyte16 x;
writeln(x); // Error
}
DMD 2.064alpha gives a long sequence of errors:
...\format.d(2950): Error: template std.format.formatValue does not match any function template declaration. Candidates are:
...
test.d(4): Error: template instance std.stdio.writeln!(__vector(ubyte[16u])) error instantiating
The workaround is to use .array:
writeln(x.array); // OK
But I'd like writeln to write SIMD values as ubyte16 even without .array for greater uniformity in debugging code.
Comment #1 by bearophile_hugs — 2013-06-23T15:06:28Z
It's kind of needed to print arrays of simd vectors:
import std.stdio: writeln;
import core.simd: int4;
void main() {
int4[] v = [[1, 2, 3, 4], [5, 6, 7, 8]];
writeln(v[0].array, " ", v[1].array); // OK
writeln(v); // error
}