[Nasm-devel] problem with vcvtph2pd

Henrik Gramner henrik at gramner.com
Fri Mar 22 10:30:06 PDT 2024


On Fri, Mar 22, 2024 at 4:49 PM Lukasz Marek <lukasz.m.luki2 at gmail.com> wrote:
>
> Hello,
>
> I have problem with compiling vcvtph2pd. Following lines compiles, apart from last one. It says: mismatch in the number of broadcasting elements.
> For me it seems 1to2 is correct. Is there something I do wrong or is this a bug? I have similar problems with other vcvt* instructions.
>
> BITS 64
> vcvtph2pd xmm0{k1}{z},xmm1
> vcvtph2pd xmm0{k1}{z},dword [rax]
> vcvtph2pd zmm31{k7}{z},word [rax]{1to8}
> vcvtph2pd ymm31{k7}{z},word [rax]{1to4}
> vcvtph2pd xmm0{k1}{z},word [rax]{1to2}
>
> Best regards,
> Lukasz

>From what I can tell the root cause seems to be at
https://github.com/netwide-assembler/nasm/blob/master/asm/assemble.c#L2508
where opsize == 4 and BITS64 >> SIZE_SHIFT == 8, so the result of the
division becomes 0.

I don't really understand the logic in this function though so I'm not
sure what the correct fix would be.



More information about the Nasm-devel mailing list