[Issue 19940] New: core.simd.{load,store}Unaligned functions do not support 32-byte vectors
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Jun 5 01:33:50 UTC 2019
https://issues.dlang.org/show_bug.cgi?id=19940
Issue ID: 19940
Summary: core.simd.{load,store}Unaligned functions do not
support 32-byte vectors
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: druntime
Assignee: nobody at puremagic.com
Reporter: slavo5150 at yahoo.com
void copy32(T)(T* d, const T* s)
{
import core.simd;
static foreach(i; 0..T.sizeof/32)
{
// Error: {load,store}Unaligned is not supported for 32-byte vectors
storeUnaligned(cast(void32*)(d) + i, loadUnaligned(cast(const
void32*)(s) + i));
}
}
void copy16(T)(T* d, const T* s)
{
import core.simd;
static foreach(i; 0..T.sizeof/16)
{
// This works fine for 16-byte vectors
storeUnaligned(cast(void16*)(d) + i, loadUnaligned(cast(const
void16*)(s) + i));
}
}
struct S(size_t n)
{
align(32)
ubyte[n] x;
}
void main()
{
S!64 s1;
S!64 s2;
copy16(&s2, &s1);
copy32(&s2, &s1);
}
Compile with `dmd -mcpu=avx`. The {load,store}Unaligned calls with 32-byte
vector types will fail to compile, but will work fine for 16-byte vector types.
--
More information about the Digitalmars-d-bugs
mailing list