I wonder if there is a way to tell memcpy()
in visual studio 2022 to only move up to 32bit, 64bit or 128bits at a time or if it could tell me in the preprocessor what the max size it may use.
This is a special need, but while I can assume 256bits today, if it moves to 512bits it will break the expected copy.
The solution would be to either tell memcpy()
what the max bits (or bytes) it can use, or have something defined in visual studio that tells me how many bits (or bytes) it could use; I could then #if
an #error
when the size becomes too large it could be adjusted and fixed when the compile fails.
Or even something like the SIMD level as a value so could say if <= SSE4 it's 128bits, <= AVX2 it's 256bits, and if > AFX2 #error.
Does something like that exist?
Is the #pragma omp simd safelen(length)
before a memcpy()
what I'm looking for?
I don't think so, looking at the memcpy
disassembly, looks like I had better roll my own.
TIA!!