Re: Templates and SIMD - examining types

2020-07-27 Thread Cecil Ward via Digitalmars-d-learn
On Wednesday, 22 July 2020 at 22:21:47 UTC, Dennis wrote: On Wednesday, 22 July 2020 at 21:58:16 UTC, Cecil Ward wrote: I need to then work out what is the size of the internal units within the 128-bit value, size in bytes,1 or 2, at compile time. You can use the .sizeof property on the

Re: Templates and SIMD - examining types

2020-07-22 Thread Dennis via Digitalmars-d-learn
On Wednesday, 22 July 2020 at 21:58:16 UTC, Cecil Ward wrote: I need to then work out what is the size of the internal units within the 128-bit value, size in bytes,1 or 2, at compile time. You can use the .sizeof property on the type. ``` import core.simd; void main() { ubyte16 a;

Templates and SIMD - examining types

2020-07-22 Thread Cecil Ward via Digitalmars-d-learn
I am using SIMD and I have a case in a template where I am being passed an argument that is a pointer to a 128-bit chunk of either 16 bytes or 8 uwords but I don’t know which? What’s the best way to discover this at compile time - using the ‘is’ operator ? I forget for the moment. It will only