Skip to content

[Bug]: Packed_Vector_Mem_Read? and Packed_Vector_Mem_Write? are too strict on the no-op check #130

Backlog

Description

@pkhuong

Description

Both packed vector memory accesses functions check for a no-op (all-zero mask) with Is_Zero against the full 64-bit mask. However, only the low bits that map to lanes need to be zero. Maybe we should do something like Is_Zero(k[0 +: elements]), or even num_unmasked_elements > 0, to check whether we should leave early without validating the logical address.

On a KNL, vpexpandq zmm0{k1}, [rax], rax = 0xffff800000000000 segfaults with k1 = 1, but no-ops gracefully with k1 = 0x100, same for vpcompressq [rax]{k1}, zmm0.

The SDM's code checks for #GP on the invalid RAX even though the mask is a no-op (non-zero only in irrelevant high bits).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions