Skip to content

[mono][aot] optimize aot Unsafe.BitCast for more cases #115130

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
May 7, 2025

Conversation

lewing
Copy link
Member

@lewing lewing commented Apr 28, 2025

Exrtacted from #115062

VType bitcast should work fine on wasm,

digging through the history some related prs (this will not address all of them)
#105150
#103915
#104694
#106430 (not fixed by this pr)

@lewing lewing marked this pull request as ready for review May 5, 2025 19:42
@Copilot Copilot AI review requested due to automatic review settings May 5, 2025 19:42
@lewing lewing requested a review from kg May 5, 2025 19:42
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enables xcast support for wasm by updating type conversions and removing target size restrictions for SIMD operations. Key changes include:

  • Introducing conditional type mapping for size 4 and size 8 conversions.
  • Removing the TARGET_SIZEOF_VOID_P check for SIMD xcast operations to allow them unconditionally.
Comments suppressed due to low confidence (1)

src/mono/mono/mini/intrinsics.c:757

  • Consider verifying that removing the TARGET_SIZEOF_VOID_P check for SIMD xcast is intentional, as this may inadvertently enable xcast on non-wasm platforms.
opcode = OP_XCAST;

@lewing lewing changed the title [wasm] Allow xcast [mono][aot] optimize aot Unsafe.BitCast for more cases May 5, 2025
@lewing
Copy link
Member Author

lewing commented May 5, 2025

I don't know if we are running any aot tests on non-wasm 32 bit platforms at this point? I can easily limit it to Wasm. There may have been a reason @fanyang-mono excluded it initially in #105150

@steveisok
Copy link
Member

I don't know if we are running any aot tests on non-wasm 32 bit platforms at this point? I can easily limit it to Wasm. There may have been a reason @fanyang-mono excluded it initially in #105150

I think it's ok limiting it to Wasm. The majority of our tests on arm android is JIT based.

@lewing
Copy link
Member Author

lewing commented May 7, 2025

/ba-g timeouts are not related

@lewing lewing merged commit 54bec5f into dotnet:main May 7, 2025
74 of 84 checks passed
@lewing lewing deleted the allow-xcast branch May 7, 2025 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants