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

[mono][interp] Align simd types to 16 bytes by default #81219

Merged
merged 6 commits into from
Feb 6, 2023

Conversation

BrzVlad
Copy link
Member

@BrzVlad BrzVlad commented Jan 26, 2023

All simd interp vars (args, IL locals and other allocated vars) are now aligned to 16 byte offsets, instead of the 8 byte default alignment.

We use the general MonoClass->simd_type for now, which encapsulates vectors of all sizes, to determine if we align them. This PR has no benefit by itself, it is just prerequisite for addition of intrisics for vectorized operations, and submitted by itself for independent testing purposes.

@ghost
Copy link

ghost commented Jan 26, 2023

Tagging subscribers to this area: @BrzVlad
See info in area-owners.md if you want to be subscribed.

Issue Details

All simd interp vars (args, IL locals and other allocated vars) are now aligned to 16 byte offsets, instead of the 8 byte default alignment.

We use the general MonoClass->simd_type for now, which encapsulates vectors of all sizes, to determine if we align them. This PR has no benefit by itself, it is just prerequisite for addition of intrisics for vectorized operations, and submitted by itself for independent testing purposes.

Author: BrzVlad
Assignees: BrzVlad
Labels:

area-Codegen-Interpreter-mono

Milestone: -

@BrzVlad
Copy link
Member Author

BrzVlad commented Jan 29, 2023

/azp run runtime-wasm

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@BrzVlad
Copy link
Member Author

BrzVlad commented Jan 29, 2023

/azp run runtime-wasm-libtests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@BrzVlad BrzVlad force-pushed the feature-interp-align-v128 branch from 215d2c3 to d07cb1a Compare January 29, 2023 16:50
@BrzVlad BrzVlad marked this pull request as ready for review January 29, 2023 20:39
@@ -4167,8 +4187,13 @@ interp_method_compute_offsets (TransformData *td, InterpMethod *imethod, MonoMet
return;
}
}
offset += align - 1;
offset &= ~(align - 1);
MonoClass *klass = mono_class_from_mono_type_internal (header->locals [i]);
Copy link
Member

Choose a reason for hiding this comment

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

Could be encapsulated if used on multiple occasions

@BrzVlad BrzVlad force-pushed the feature-interp-align-v128 branch from d07cb1a to 51043ee Compare February 6, 2023 10:11
All interp vars (args, il locals and other allocated vars) are now aligned to 16 byte offsets.
Assumption that return offset is identical to location of param offset for this opcode is no longer true. Set the param_offset explicitly, separate from the return, similar to dotnet#81017
@BrzVlad BrzVlad force-pushed the feature-interp-align-v128 branch from 51043ee to 5491767 Compare February 6, 2023 10:24
@BrzVlad BrzVlad merged commit 287621c into dotnet:main Feb 6, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Mar 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants