www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10444] New: writeln of a SIMD register

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10444

           Summary: writeln of a SIMD register
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc


--- Comment #0 from bearophile_hugs eml.cc 2013-06-22 07:33:30 PDT ---
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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 22 2013
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10444


bearophile_hugs eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|enhancement                 |normal


--- Comment #1 from bearophile_hugs eml.cc 2013-06-23 15:06:28 PDT ---
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
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 23 2013