On Mon, 18 Nov 2024 14:41:25 GMT, Emanuel Peter <epe...@openjdk.org> wrote:
>> @eme64 Please correct me if I'm wrong but the issue is you need the base to >> be aligned at 32 bytes on AVX2 machines for any alignment for vector >> instruction to be meaningful, so I don't see the value of vector alignment >> at all. > > @merykitty >> Please correct me if I'm wrong but the issue is you need the base to be >> aligned at 32 bytes on AVX2 machines for any alignment for vector >> instruction to be meaningful, so I don't see the value of vector alignment >> at all. > > First: without `AlignVector`, the vector instructions can have completely > free alignment. On x64 and aarch64 generally I think most machines do not > need alignment at all. And as far as I know there is also no performance > penalty on modern CPUs for misalignment. I could be wrong here. On older CPUs > alignment was important for performance though. @eme64 You will need the alignment for the whole vector (which means 32 bytes for a `ymm` load), not alignment only on its elements. Vector element is the artefact of ALU units, not the load/store units that actually care about alignment. ------------- PR Comment: https://git.openjdk.org/jdk/pull/20677#issuecomment-2483255086