Finished updating alignment issues for vector types; don't assume pointers

are aligned to the natural vector width.
This commit is contained in:
Matt Pharr
2011-06-23 18:51:15 -07:00
parent 990bee5a86
commit 865e430b56
3 changed files with 44 additions and 74 deletions

View File

@@ -38,15 +38,7 @@
using namespace ispc;
int main() {
// Pointers passed to ispc-compiled code are currently required to have
// alignment equal to the target's native vector size. Here we align
// to 32 bytes to be safe for both SSE and AVX targets.
#ifdef _MSC_VER
__declspec(align(32)) float vin[16], vout[16];
#else
float vin[16] __attribute__((aligned(32)));
float vout[16] __attribute__((aligned(32)));
#endif
float vin[16], vout[16];
// Initialize input buffer
for (int i = 0; i < 16; ++i)