On AIX in 32bit mode, malloc may not be 16 byte aligned as required for vector
data types. This causes these test cases to generate incorrect output.
Using posix_memalign instead we ensure 16 byte alignment in 64 and
32 bit mode and correct output.
Details
- Reviewers
bmahjour sfertile hubert.reinterpretcast - Group Reviewers
Restricted Project - Commits
- rT7d06bc9ba145: [AIX] Use posix_memalign instead of malloc to ensure 16 byte alignment
Diff Detail
- Repository
- rT test-suite
Event Timeline
SingleSource/UnitTests/Vector/Altivec/alti.expandfft.c | ||
---|---|---|
38 | The alignment requirements for the VMX instructions are OS-agnostic, so ideally we should just replace malloc with posix_memalign (without checking for AIX). I believe this test runs only on PPC platforms, so should be safe to change. |
SingleSource/UnitTests/Vector/Altivec/alti.expandfft.c | ||
---|---|---|
38 | I had read that Mac OS/X doesn't support posix_memalign and wanted to be conservative with the change. But, AFAIK, we don't even support that platform anymore on PPC, so yes, it should be safe to change for all PPC platforms. |
LGTM
SingleSource/UnitTests/Vector/Altivec/alti.expandfft.c | ||
---|---|---|
38 | Tried on my Mac (Darwin Kernel Version 20.4.0) and it worked. In any case, if some OS shows a failure, we could go back and guard those ones. |
The alignment requirements for the VMX instructions are OS-agnostic, so ideally we should just replace malloc with posix_memalign (without checking for AIX). I believe this test runs only on PPC platforms, so should be safe to change.