Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
/coreclrPublic archive

Implement the SSE hardware intrinsics.#15538

Merged
tannergooding merged 32 commits intodotnet:masterfromtannergooding:sse-intrinsics
Jan 17, 2018
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
32 commits
Select commitHold shift + click to select a range
bd56bb3
Adding the remaining SSE intrinsics to hwintrinsiclistxarch.h
tannergoodingDec 15, 2017
adadee1
Adding support for the SSE And, AndNot, Divide, Max, Min, MoveHighToL…
tannergoodingDec 15, 2017
1cb5722
Adding tests for the And, AndNot, Divide, Max, Min, MoveHighToLow, Mo…
tannergoodingDec 15, 2017
402550c
Adding support for the SSE compare eq, gt, ge, lt, le, ne, ord, and u…
tannergoodingDec 15, 2017
77fa074
Adding tests for the SSE compare eq, gt, ge, lt, le, ne, ord, and uno…
tannergoodingDec 15, 2017
91c7550
Adding support for the SSE Reciprocal, ReciprocalSqrt, and Sqrt intri…
tannergoodingDec 24, 2017
c09ad38
Adding tests for the SSE Reciprocal, ReciprocalSqrt, and Sqrt intrinsics
tannergoodingDec 24, 2017
3f115ef
Adding support for the SSE Set, SetAll, and SetZero intrinsics
tannergoodingDec 25, 2017
fbc91fc
Adding tests for the SSE Set, SetAll, and SetZero intrinsics
tannergoodingDec 25, 2017
94f82fb
Adding support for the SSE Shuffle intrinsic
tannergoodingDec 24, 2017
9e54585
Adding tests for the SSE Shuffle intrinsic
tannergoodingDec 24, 2017
224b8dc
Adding support for the SSE StaticCast intrinsic
tannergoodingDec 28, 2017
1283d87
Adding tests for the SSE StaticCast intrinsic
tannergoodingDec 28, 2017
bfc992e
Adding support for the SSE Add, Divide, Max, Min, Move, Multiply, and…
tannergoodingDec 29, 2017
38af536
Adding tests for the SSE Add, Divide, Max, Min, Move, Multiply, and S…
tannergoodingDec 29, 2017
eaf9aef
Adding support for the SSE compare eq, gt, ge, lt, le, ne, ord, and u…
tannergoodingDec 29, 2017
cd60a85
Adding tests for the SSE compare eq, gt, ge, lt, le, ne, ord, and uno…
tannergoodingDec 29, 2017
3fcdaf8
Adding support for the SSE Reciprocal, ReciprocalSqrt, and Sqrt scala…
tannergoodingDec 29, 2017
db75c98
Adding tests for the SSE Reciprocal, ReciprocalSqrt, and Sqrt scalar …
tannergoodingDec 29, 2017
e84b55e
Adding support for the SSE ConvertTo Int32, Int32WithTruncation, Int6…
tannergoodingDec 30, 2017
2a256bd
Adding tests for the SSE ConvertTo Int32, Int32WithTruncation, Int64W…
tannergoodingDec 30, 2017
887d5c4
Adding support for the SSE Compare<op>Ordered and Compare<op>Unordere…
tannergoodingDec 30, 2017
0817912
Adding tests for the SSE Compare<op>Ordered and Compare<op>Unordered …
tannergoodingDec 31, 2017
5ef844b
Adding support for the SSE Set scalar intrinsic
tannergoodingDec 31, 2017
dee8fb7
Adding tests for the SSE Set scalar intrinsic
tannergoodingDec 31, 2017
baeed0c
Adding support for the SSE MoveMask intrinsic
tannergoodingJan 12, 2018
51a1a59
Adding tests for the SSE MoveMask intrinsic
tannergoodingJan 12, 2018
a15aa12
Updating the SSE HWIntrinsics to share code where possible.
tannergoodingJan 13, 2018
5ca9417
Updating most of the SSE Compare intrinsics to support containment
tannergoodingJan 13, 2018
677c5c3
Adding support for the SSE Load, LoadAligned, LoadHigh, LoadLow, and …
tannergoodingJan 16, 2018
11b6ac8
Adding tests for the SSE Load, LoadAligned, LoadHigh, LoadLow, and Lo…
tannergoodingJan 16, 2018
a8db845
Resolving PR feedback
tannergoodingJan 17, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Adding tests for the SSE Set scalar intrinsic
  • Loading branch information
@tannergooding
tannergooding committedJan 17, 2018
commitdee8fb7386799ee85c0e106a48400e0d9ab14661
75 changes: 75 additions & 0 deletionstests/src/JIT/HardwareIntrinsics/X86/Sse/SetScalar.cs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
// 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.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics.X86;
using System.Runtime.Intrinsics;

namespace IntelHardwareIntrinsicTest
{
class Program
{
const int Pass = 100;
const int Fail = 0;

static unsafe int Main(string[] args)
{
int testResult = Pass;

if (Sse.IsSupported)
{
using (TestTable<float> floatTable = new TestTable<float>(new float[4] { float.NaN, float.NaN, float.NaN, float.NaN }))
{
var vf1 = Sse.SetScalar(3);
Unsafe.Write(floatTable.outArrayPtr, vf1);

if (!floatTable.CheckResult((x) => (x[0] == 3)
&& (BitConverter.SingleToInt32Bits(x[1]) == 0)
&& (BitConverter.SingleToInt32Bits(x[2]) == 0)
&& (BitConverter.SingleToInt32Bits(x[3]) == 0)))
{
Console.WriteLine("SSE SetScalar failed on float:");
foreach (var item in floatTable.outArray)
{
Console.Write(item + ", ");
}
Console.WriteLine();
testResult = Fail;
}
}
}


return testResult;
}

public unsafe struct TestTable<T> : IDisposable where T : struct
{
public T[] outArray;

public void* outArrayPtr => outHandle.AddrOfPinnedObject().ToPointer();

GCHandle outHandle;
public TestTable(T[] a)
{
this.outArray = a;

outHandle = GCHandle.Alloc(outArray, GCHandleType.Pinned);
}
public bool CheckResult(Func<T[], bool> check)
{
return check(outArray);
}

public void Dispose()
{
outHandle.Free();
}
}

}
}
34 changes: 34 additions & 0 deletionstests/src/JIT/HardwareIntrinsics/X86/Sse/SetScalar_r.csproj
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
<?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)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
<OutputType>Exe</OutputType>
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
<ItemGroup>
<CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
<Visible>False</Visible>
</CodeAnalysisDependentAssemblyPaths>
</ItemGroup>
<PropertyGroup>
<DebugType>None</DebugType>
<Optimize></Optimize>
</PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<ItemGroup>
<Compile Include="SetScalar.cs" />
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
</Project>
34 changes: 34 additions & 0 deletionstests/src/JIT/HardwareIntrinsics/X86/Sse/SetScalar_ro.csproj
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
<?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)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
<OutputType>Exe</OutputType>
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
<ItemGroup>
<CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
<Visible>False</Visible>
</CodeAnalysisDependentAssemblyPaths>
</ItemGroup>
<PropertyGroup>
<DebugType>None</DebugType>
<Optimize>True</Optimize>
</PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<ItemGroup>
<Compile Include="SetScalar.cs" />
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
</Project>

[8]ページ先頭

©2009-2026 Movatter.jp