diff options
author | Carol Eidt <carol.eidt@microsoft.com> | 2019-03-29 16:35:09 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-29 16:35:09 -0700 |
commit | 1df87c785e0e43392abf4bcba56e2bf4d9249fd4 (patch) | |
tree | 9e8838acba72027ac276ab36f27439ed0b0f1223 /tests/src/JIT/Regression/JitBlue | |
parent | 8c7d91177742e150b91f11cf37da84b8f80f6620 (diff) | |
download | coreclr-1df87c785e0e43392abf4bcba56e2bf4d9249fd4.tar.gz coreclr-1df87c785e0e43392abf4bcba56e2bf4d9249fd4.tar.bz2 coreclr-1df87c785e0e43392abf4bcba56e2bf4d9249fd4.zip |
Fix HW intrinsic containment bugs (#23558)
* Fix HW intrinsic containment bugs
For the Fma case (#23430), fix the handling of contained 3-operand HW intrinsic nodes.
For the Bmi case (#23534), fix a bad assert placement, and re-enable the Bmi tests.
Fix #23530
Fix #23534
* Add guard for Fma test
Diffstat (limited to 'tests/src/JIT/Regression/JitBlue')
-rw-r--r-- | tests/src/JIT/Regression/JitBlue/GitHub_23530/GitHub_23530.cs | 50 | ||||
-rw-r--r-- | tests/src/JIT/Regression/JitBlue/GitHub_23530/GitHub_23530.csproj | 18 |
2 files changed, 68 insertions, 0 deletions
diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_23530/GitHub_23530.cs b/tests/src/JIT/Regression/JitBlue/GitHub_23530/GitHub_23530.cs new file mode 100644 index 0000000000..0131eebd88 --- /dev/null +++ b/tests/src/JIT/Regression/JitBlue/GitHub_23530/GitHub_23530.cs @@ -0,0 +1,50 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Collections.Generic; +using System.Diagnostics; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.X86; + +namespace GitHub_23530 +{ + class Program + { + struct vec + { + public float f1; + public float f2; + public float f3; + public float f4; + } + + static unsafe float fmaTest() + { + vec a; + var b = Vector128.Create(1f); + var c = Vector128.Create(2f); + var d = Vector128.Create(3f); + + c = Fma.MultiplyAdd(Sse.LoadVector128((float*)&a), b, c); + + return Sse.Add(c, d).ToScalar(); + } + + static int Main(string[] args) + { + if (Fma.IsSupported) + { + float result = fmaTest(); + if (Math.Abs(result - 5.0F) > System.Single.Epsilon) + { + return -1; + } + } + return 100; + } + } +} diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_23530/GitHub_23530.csproj b/tests/src/JIT/Regression/JitBlue/GitHub_23530/GitHub_23530.csproj new file mode 100644 index 0000000000..fb6ae363eb --- /dev/null +++ b/tests/src/JIT/Regression/JitBlue/GitHub_23530/GitHub_23530.csproj @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" /> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <AssemblyName>$(MSBuildProjectName)</AssemblyName> + <OutputType>Exe</OutputType> + <DebugType></DebugType> + <Optimize>True</Optimize> + <AllowUnsafeBlocks>True</AllowUnsafeBlocks> + </PropertyGroup> + <ItemGroup> + <Compile Include="$(MSBuildProjectName).cs" /> + </ItemGroup> + <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" /> + <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup> +</Project> |