How do I get the following code to not crash in Berlin?

How do I get the following code to not crash in Berlin?

{$align 16}

type
TInput = record
i1: array[0..7] of word;
end;

function Generate_PtoQ_x64_AVX(A,B,C,D: Int64):Int64;
// A RCX
// B RDX
// C R8
// D R9
const
input: Tinput = (i1:(0,0,0,8,8,8,0,0));
asm
movdqa xmm0,[input]
// ;extract 8 bitplanes with the neighborhood cells
db $C5,$B9,$73,$F8,$02 // vpslldq xmm8,xmm0,2 // C
db $C5,$B1,$73,$D8,$02 // vpsrldq xmm9,xmm0,2 // C'
end;

The record const does not get aligned.
Obviously I can do an unaligned read using
*movdqu xmm0,[input]*
But there are a couple of reads and I'd really like them to be aligned.
Is there a trick I can use?

I don't mind putting my input anywhere, I just want it to be dqword aligned.

Comments

  1. Bug looks the same to
    quality.embarcadero.com - Log in - Embarcadero Technologies
    https://quality.embarcadero.com/browse/RSP-12787

    Musing how much time it'll take to provide AVX/AVX2 vpslldq/vpsrldq asm instructions support.

    ReplyDelete
  2. Ilya S That report was closed because the compiler behaves as designed. Packed records are intended to have alignment of 1.

    ReplyDelete
  3. David Heffernan so we are lost at data alignment options for SIMD. Another report https://quality.embarcadero.com/browse/RSP-12380 is still open as new-feature.

    ReplyDelete

Post a Comment