-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Closed
Description
Description
Currently on mono, SIMD is only supported when using LLVM compiled code. This can lead to various problems when mixing llvm and non-llvm compiled code. This mixing can happen for various reasons:
- profiled AOT
- LLVM doesn't support some IL constructs like filter clauses
- Different calling conventions
LLVM code passes SIMD types in SIMD registers, while JITted code passes them on the stack.
Testcase:
using System;
using System.Numerics;
public class Tests
{
public static void Main () {
foo (new Vector<int> (1));
}
static void foo (Vector<int> v) {
try {
Console.WriteLine (v);
} catch (Exception ex) when (ex is OverflowException) {
}
}
}
- The IsSupported methods return different values in LLVM and non-LLVM methods, leading to subtle logic problems:
using System;
using System.Numerics;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.Arm;
public class Tests
{
public static void Main () {
if (AdvSimd.Arm64.IsSupported)
foo (new Vector128<double> ());
}
static void foo (Vector128<double> v) {
try {
} catch (Exception ex) when (ex is OverflowException) {
}
AdvSimd.Arm64.Abs (v);
}
}
This will fail when AOT-ed using --aot=llvm
Reproduction Steps
.
Expected behavior
.
Actual behavior
.
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done