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

Added floor and ceiling intrinsics for System.Runtime.Intrinsics.Vector128 and System.Numerics.Vector #83592

Merged
merged 15 commits into from
Mar 23, 2023

Conversation

LeVladIonescu
Copy link
Contributor

@LeVladIonescu LeVladIonescu commented Mar 17, 2023

Contributes to #80566

Vlad - Alexandru Ionescu added 6 commits March 16, 2023 17:00
This reverts commit 7a86e8d6ef1d963328026f82c8c51673a27bffc4.
Signed-off-by: Vlad - Alexandru Ionescu <[email protected]>
Signed-off-by: Vlad - Alexandru Ionescu <[email protected]>
Signed-off-by: Vlad - Alexandru Ionescu <[email protected]>
Signed-off-by: Vlad - Alexandru Ionescu <[email protected]>
@@ -1325,8 +1327,14 @@ emit_sri_vector (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsi
if (!type_enum_is_float (arg0_type))
return NULL;
#ifdef TARGET_ARM64
int ceil_or_floor = id == SN_Ceiling ? INTRINS_AARCH64_ADV_SIMD_FRINTP : INTRINS_AARCH64_ADV_SIMD_FRINTM;
Copy link
Contributor

Choose a reason for hiding this comment

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

This could be implemented by handling OP_XOP_OVR_X_X in mini-arm64.c ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried like that firstly but INTRINS_AARCH64_ADV_SIMD_FRINTP and INTRINS_AARCH64_ADV_SIMD_FRINTM were not defined anywhere…I assume they are LLVM specific.

Copy link
Member

Choose a reason for hiding this comment

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

This is okay for now. We probably need to clean it up later, such as unify the label names.

Copy link
Contributor

Choose a reason for hiding this comment

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

They are defined in llvm-intrinsics-types.h.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, together with llvm-intrinsics.h. And the design only considered LLVM scenarios. Now we have llvm and non-llvm. We need to somehow make the labels/keys fit both backends.

Copy link
Contributor

Choose a reason for hiding this comment

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

A possible approach would be to use the llvm intrinsics in mini-arm64.c as well, they are just constants. If additional constants are needed to encode instructions that llvm doesn't have, they could be added after them, i.e. after INTRINS_NUM.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We want to do this now or after we enable all intrinsics?

Copy link
Member

Choose a reason for hiding this comment

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

I think it's better to do it now. I see we will need that included for other things, too.

@fanyang-mono
Copy link
Member

fanyang-mono commented Mar 17, 2023

It is worth mentioning in the description box that this PR contributes to a certain issue and providing the issue number.

Vlad - Alexandru Ionescu added 3 commits March 21, 2023 13:45
Signed-off-by: Vlad - Alexandru Ionescu <[email protected]>
Signed-off-by: Vlad - Alexandru Ionescu <[email protected]>
Signed-off-by: Vlad - Alexandru Ionescu <[email protected]>
@LeVladIonescu
Copy link
Contributor Author

/azp run runtime-extra-platforms

@azure-pipelines
Copy link

Pull request contains merge conflicts.

@LeVladIonescu
Copy link
Contributor Author

/azp run runtime-extra-platforms

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jandupej
Copy link
Member

Some of your CI failures should be solved by #83770

@@ -21,6 +21,7 @@
#include "ir-emit.h"
#include "aot-runtime.h"
#include "mini-runtime.h"
#include "llvm-intrinsics-types.h"
Copy link
Member

Choose a reason for hiding this comment

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

This is not needed anymore, since line 31 has it already added from Jan's PR.

@LeVladIonescu
Copy link
Contributor Author

/azp run runtime-extra-platforms

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@LeVladIonescu
Copy link
Contributor Author

CI failures not related to this PR

return NULL;
#endif
// #ifdef TARGET_ARM64
// if (!(cfg->compile_aot && cfg->full_aot && !cfg->interp))
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs to be removed before merge.

Vlad - Alexandru Ionescu added 3 commits March 23, 2023 20:55
Signed-off-by: Vlad - Alexandru Ionescu <[email protected]>
Signed-off-by: Vlad - Alexandru Ionescu <[email protected]>
@LeVladIonescu LeVladIonescu merged commit f747a30 into dotnet:main Mar 23, 2023
@LeVladIonescu LeVladIonescu deleted the intrinsics branch March 23, 2023 20:03
@ghost ghost locked as resolved and limited conversation to collaborators Apr 23, 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.

5 participants