June 05, 2019 [Issue 19940] New: core.simd.{load,store}Unaligned functions do not support 32-byte vectors | ||||
---|---|---|---|---|
| ||||
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@puremagic.com Reporter: slavo5150@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. -- |
Copyright © 1999-2021 by the D Language Foundation