Skip to content

Comments

Add initial support for Vector64 on Arm64 and Amd64#47618

Merged
imhameed merged 13 commits intodotnet:masterfrom
fanyang-mono:arm_v64
Feb 17, 2021
Merged

Add initial support for Vector64 on Arm64 and Amd64#47618
imhameed merged 13 commits intodotnet:masterfrom
fanyang-mono:arm_v64

Conversation

@fanyang-mono
Copy link
Member

@fanyang-mono fanyang-mono commented Jan 29, 2021

Contributes to #42350

This change:

  • Conditionally marks Vector64 as a SIMD type. Vector64 is treated as a
    SIMD type on amd64 and arm64 only when the LLVM backend is in use. Vector128
    continues to be supported with both LLVM and mini on amd64, as before; on arm64,
    it continues to only be supported with LLVM.

  • Checks vector widths for compatibility when bitcasting.

  • Slightly cleans up return value handling for SIMD value types--conversion
    from an aggregate to an LLVM vector-typed value now happens in one location.

  • Removes a 128-bit SIMD assumption in the lowering code for OP_SETRET.

  • Renames emit_vector128 to emit_sri_vector and makes it width-agnostic.

  • Improves the generated IR for non-broadcasting Vector64/Vector128.Create; the
    resulting code works entirely in registers and does not depend on temporary
    stack storage for writing values into individual vector lanes.

@fanyang-mono fanyang-mono changed the title Add initial support for Vector64 on Arm64 Add initial support for Vector64 on Arm64 and Amd64 Jan 29, 2021
@fanyang-mono fanyang-mono marked this pull request as draft January 29, 2021 14:34
@imhameed imhameed force-pushed the arm_v64 branch 3 times, most recently from 226a00a to 9d9f4e7 Compare February 10, 2021 22:54
… a width-agnostic round-trip through memory instead of assuming 128-bit
@imhameed imhameed force-pushed the arm_v64 branch 2 times, most recently from 4e2f0ae to 5b48eee Compare February 16, 2021 08:38
@imhameed imhameed marked this pull request as ready for review February 16, 2021 09:02
@SamMonoRT
Copy link
Member

LGTM

#else
#define MONO_CLASS_IS_SIMD(cfg, klass) (((cfg)->opt & MONO_OPT_SIMD) && m_class_is_simd_type (klass))
#define MONO_CLASS_IS_SIMD(cfg, klass) (((cfg)->opt & MONO_OPT_SIMD) && m_class_is_simd_type (klass) && (COMPILE_LLVM (cfg) || mono_type_size (m_class_get_byval_arg (klass), NULL) == 16))
#endif
Copy link
Contributor

Choose a reason for hiding this comment

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

This means that non-arm64 only supports vector128 in non-llvm mode right ?

Copy link
Contributor

@imhameed imhameed Feb 17, 2021

Choose a reason for hiding this comment

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

Yeah. Maybe the enclosing preprocessor conditionals should be made more specific, and MONO_CLASS_IS_SIMD should expand to a constant "false" expression on everything other than x86, amd64, and arm64.

@imhameed imhameed merged commit a752d8d into dotnet:master Feb 17, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Mar 19, 2021
@fanyang-mono fanyang-mono deleted the arm_v64 branch May 27, 2021 14:47
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.

4 participants