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

Implements convert low signed integer to float for x64 simd #2771

Merged
merged 1 commit into from
Mar 26, 2021

Conversation

jlb6740
Copy link
Contributor

@jlb6740 jlb6740 commented Mar 25, 2021

No description provided.

@jlb6740 jlb6740 force-pushed the x64_simd_convert_i32_to_f64 branch from b9c597c to 63ad387 Compare March 25, 2021 19:39
@jlb6740 jlb6740 changed the title Implments convert low signed integer to float for x64 simd Impelments convert low signed integer to float for x64 simd Mar 25, 2021
@jlb6740 jlb6740 changed the title Impelments convert low signed integer to float for x64 simd Implements convert low signed integer to float for x64 simd Mar 25, 2021
@jlb6740 jlb6740 requested a review from abrown March 25, 2021 19:42
@github-actions github-actions bot added cranelift Issues related to the Cranelift code generator cranelift:area:aarch64 Issues related to AArch64 backend. cranelift:area:x64 Issues related to x64 codegen cranelift:meta Everything related to the meta-language. cranelift:wasm labels Mar 25, 2021
@jlb6740
Copy link
Contributor Author

jlb6740 commented Mar 26, 2021

Also .. this patch is tested against the spec tests for "f64x2.convert_low_i32x4_s"

@jlb6740 jlb6740 requested review from fitzgen and cfallin March 26, 2021 02:37
Copy link
Contributor

@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.

Looks good to me with the documentation fixes I noted.

Convert signed integer to floating point.

Each lane in `x` is interpreted as a signed integer and converted to
floating point.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should add something about rounding like in fcvt_from_sint and something describing what the low part of the name means.

Copy link
Contributor

@abrown abrown Mar 26, 2021

Choose a reason for hiding this comment

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

I mean, it's not like the SIMD documentation is much more verbose... perhaps that should get fixed too. I think we need to say something about how the two lowest i32s in the vector (lanes 0 and 1) are the ones converted to the f64. From the Intel reference:

CVTDQ2PD (128-bit Legacy SSE version)
DEST[63:0] := Convert_Integer_To_Double_Precision_Floating_Point(SRC[31:0])
DEST[127:64] := Convert_Integer_To_Double_Precision_Floating_Point(SRC[63:32])
DEST[MAXVL-1:128] (unmodified)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this is a good point. In updating the comments I just used language of half. That is because the "fcvt_low_from_sint" can also support AVX-512 where we could convert the "four" lowest i32s. That instruction doesn't exist of course in the spec, but could be a candidate for a future iteration of the spec or relaxed simd.

Copy link
Member

@cfallin cfallin left a comment

Choose a reason for hiding this comment

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

LGTM, with a +1 to Andrew's thoughts on adding some doc details. Thanks!

@jlb6740 jlb6740 force-pushed the x64_simd_convert_i32_to_f64 branch from 63ad387 to 4a48904 Compare March 26, 2021 17:56
@jlb6740 jlb6740 merged commit 31d3db1 into bytecodealliance:main Mar 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cranelift:area:aarch64 Issues related to AArch64 backend. cranelift:area:x64 Issues related to x64 codegen cranelift:meta Everything related to the meta-language. cranelift:wasm cranelift Issues related to the Cranelift code generator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants