Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print {z} decorator for instructions with zero-only mask mode #220

Closed
flobernd opened this issue Sep 8, 2021 · 3 comments
Closed

Print {z} decorator for instructions with zero-only mask mode #220

flobernd opened this issue Sep 8, 2021 · 3 comments
Assignees
Labels
A-formatter Area: Formatter C-bug Category: This is a bug (or a fix for a bug, when applied to PRs) P-low Priority: Low

Comments

@flobernd
Copy link
Member

flobernd commented Sep 8, 2021

Certain instructions like e.g. vpshufbitqmb use hardcoded zero masking.

Intel SDM says:

This instruction uses write masking (zeroing only).

Zydis correctly reflects this in the ZydisDecodedInstruction, but currently we do not print the {z} decorator for these cases.

Related to intelxed/xed#277

@flobernd flobernd self-assigned this Sep 8, 2021
@flobernd flobernd added A-formatter Area: Formatter C-bug Category: This is a bug (or a fix for a bug, when applied to PRs) P-low Priority: Low labels Sep 8, 2021
@flobernd
Copy link
Member Author

I just found my own comment while working on it:

// Only print the zeroing decorator, if the instruction is not a "zeroing masking only"

@athre0z Can we compare against other disassemblers or assemblers?

@mappzor
Copy link
Contributor

mappzor commented Sep 12, 2021

I'm aware of two cases:

  • NASM: will not accept {z} decorator when assembling, ndisasm will not show it when disassembling
  • capstone (cstool): fails to decode instruction completely ;)

@flobernd
Copy link
Member Author

Thanks for checking!

I think in this case I will close this issue and don't print it as well. The .avx.mask_mode property will correctly contain ZYDIS_MASK_MODE_ZEROING or ZYDIS_MASK_MODE_CONTROL_ZEROING anyways, if somebody needs this information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-formatter Area: Formatter C-bug Category: This is a bug (or a fix for a bug, when applied to PRs) P-low Priority: Low
Projects
None yet
Development

No branches or pull requests

2 participants