Skip to content

x64: Add AVX encodings for cvt* instructions #10954

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

Merged
merged 3 commits into from
Jun 6, 2025

Conversation

alexcrichton
Copy link
Member

Helps to light the CvtIntToFloatVex instruction shape on 🔥.

Helps to light the `CvtIntToFloatVex` instruction shape on 🔥.
@alexcrichton alexcrichton requested a review from a team as a code owner June 6, 2025 16:27
@alexcrichton alexcrichton requested review from abrown and removed request for a team June 6, 2025 16:27
Copy link
Member

@abrown abrown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

pub fn vcvttpd2dq_a<R: Registers>(inst: &inst::vcvttpd2dq_a<R>) -> String {
match inst.xmm_m128 {
XmmMem::Xmm(_) => "vcvttpd2dq".to_string(),
XmmMem::Mem(_) => "vcvttpd2dqx".to_string(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, weird... 🤷

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is to disambiguate between

VEX.128.66.0F.WIG E6 /r
VCVTTPD2DQ xmm1, xmm2/m128

and

VEX.256.66.0F.WIG E6 /r
VCVTTPD2DQ xmm1, ymm2/m256

where in the memory-to-register case the att-style assembler, without the x suffix, would look like vcvttpd2dq (%rax), %xmm1 and it's ambiguous as to which instruction you want. I think the x and y suffixes are used to disambiguate at the assembler level. Now if we used intel syntax...

Co-authored-by: Andrew Brown <andrew.brown@intel.com>
@alexcrichton alexcrichton enabled auto-merge June 6, 2025 17:24
@alexcrichton alexcrichton added this pull request to the merge queue Jun 6, 2025
Merged via the queue into bytecodealliance:main with commit 2174b9e Jun 6, 2025
53 checks passed
@alexcrichton alexcrichton deleted the x64-vcvt branch June 6, 2025 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants