Commit 598f8d89 by Nicolas Capens

Implement initial Subzero based Reactor.

Bug swiftshader:6 Change-Id: I1de2fe8983c7b8d29e0295e5b4705697e5dd6df1 Reviewed-on: https://swiftshader-review.googlesource.com/7292Tested-by: 's avatarNicolas Capens <capn@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com>
parent 0cf20069
...@@ -257,6 +257,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OGLES3Tools", "third_party\ ...@@ -257,6 +257,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OGLES3Tools", "third_party\
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "D3D8", "src\D3D8\D3D8.vcxproj", "{F18D5ABF-CA3A-4B74-BDB2-4A1956C86F18}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "D3D8", "src\D3D8\D3D8.vcxproj", "{F18D5ABF-CA3A-4B74-BDB2-4A1956C86F18}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Subzero", "src\Reactor\Subzero.vcxproj", "{0EB31AEC-B020-46AB-BA05-730F6D01C29B}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SubzeroTest", "src\Reactor\SubzeroTest.vcxproj", "{4EC107AB-89E8-4A0B-8366-B3E81085AE07}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32 Debug|Win32 = Debug|Win32
...@@ -732,6 +736,30 @@ Global ...@@ -732,6 +736,30 @@ Global
{F18D5ABF-CA3A-4B74-BDB2-4A1956C86F18}.Release|Win32.ActiveCfg = Release|Win32 {F18D5ABF-CA3A-4B74-BDB2-4A1956C86F18}.Release|Win32.ActiveCfg = Release|Win32
{F18D5ABF-CA3A-4B74-BDB2-4A1956C86F18}.Release|Win32.Build.0 = Release|Win32 {F18D5ABF-CA3A-4B74-BDB2-4A1956C86F18}.Release|Win32.Build.0 = Release|Win32
{F18D5ABF-CA3A-4B74-BDB2-4A1956C86F18}.Release|x64.ActiveCfg = Release|Win32 {F18D5ABF-CA3A-4B74-BDB2-4A1956C86F18}.Release|x64.ActiveCfg = Release|Win32
{0EB31AEC-B020-46AB-BA05-730F6D01C29B}.Debug|Win32.ActiveCfg = Debug|Win32
{0EB31AEC-B020-46AB-BA05-730F6D01C29B}.Debug|Win32.Build.0 = Debug|Win32
{0EB31AEC-B020-46AB-BA05-730F6D01C29B}.Debug|x64.ActiveCfg = Debug|x64
{0EB31AEC-B020-46AB-BA05-730F6D01C29B}.Debug|x64.Build.0 = Debug|x64
{0EB31AEC-B020-46AB-BA05-730F6D01C29B}.Profile|Win32.ActiveCfg = Release|Win32
{0EB31AEC-B020-46AB-BA05-730F6D01C29B}.Profile|Win32.Build.0 = Release|Win32
{0EB31AEC-B020-46AB-BA05-730F6D01C29B}.Profile|x64.ActiveCfg = Release|x64
{0EB31AEC-B020-46AB-BA05-730F6D01C29B}.Profile|x64.Build.0 = Release|x64
{0EB31AEC-B020-46AB-BA05-730F6D01C29B}.Release|Win32.ActiveCfg = Release|Win32
{0EB31AEC-B020-46AB-BA05-730F6D01C29B}.Release|Win32.Build.0 = Release|Win32
{0EB31AEC-B020-46AB-BA05-730F6D01C29B}.Release|x64.ActiveCfg = Release|x64
{0EB31AEC-B020-46AB-BA05-730F6D01C29B}.Release|x64.Build.0 = Release|x64
{4EC107AB-89E8-4A0B-8366-B3E81085AE07}.Debug|Win32.ActiveCfg = Debug|Win32
{4EC107AB-89E8-4A0B-8366-B3E81085AE07}.Debug|Win32.Build.0 = Debug|Win32
{4EC107AB-89E8-4A0B-8366-B3E81085AE07}.Debug|x64.ActiveCfg = Debug|x64
{4EC107AB-89E8-4A0B-8366-B3E81085AE07}.Debug|x64.Build.0 = Debug|x64
{4EC107AB-89E8-4A0B-8366-B3E81085AE07}.Profile|Win32.ActiveCfg = Release|Win32
{4EC107AB-89E8-4A0B-8366-B3E81085AE07}.Profile|Win32.Build.0 = Release|Win32
{4EC107AB-89E8-4A0B-8366-B3E81085AE07}.Profile|x64.ActiveCfg = Release|x64
{4EC107AB-89E8-4A0B-8366-B3E81085AE07}.Profile|x64.Build.0 = Release|x64
{4EC107AB-89E8-4A0B-8366-B3E81085AE07}.Release|Win32.ActiveCfg = Release|Win32
{4EC107AB-89E8-4A0B-8366-B3E81085AE07}.Release|Win32.Build.0 = Release|Win32
{4EC107AB-89E8-4A0B-8366-B3E81085AE07}.Release|x64.ActiveCfg = Release|x64
{4EC107AB-89E8-4A0B-8366-B3E81085AE07}.Release|x64.Build.0 = Release|x64
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
...@@ -773,5 +801,6 @@ Global ...@@ -773,5 +801,6 @@ Global
{04FC5430-3F1B-42A2-A18A-D8BB7E5B2733} = {ED25C308-5BDB-43A7-BED6-C2C059FC2D7D} {04FC5430-3F1B-42A2-A18A-D8BB7E5B2733} = {ED25C308-5BDB-43A7-BED6-C2C059FC2D7D}
{09ABE661-9BC0-4152-A820-1FB0522CAC01} = {B7E24D8E-6BE9-4DEF-A8B9-6A6E60CA60E9} {09ABE661-9BC0-4152-A820-1FB0522CAC01} = {B7E24D8E-6BE9-4DEF-A8B9-6A6E60CA60E9}
{9088FC9E-9843-4E0D-85D0-1B657AFC480A} = {B7E24D8E-6BE9-4DEF-A8B9-6A6E60CA60E9} {9088FC9E-9843-4E0D-85D0-1B657AFC480A} = {B7E24D8E-6BE9-4DEF-A8B9-6A6E60CA60E9}
{4EC107AB-89E8-4A0B-8366-B3E81085AE07} = {ED25C308-5BDB-43A7-BED6-C2C059FC2D7D}
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal
// Copyright 2016 The SwiftShader Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "Reactor.hpp"
#include <cassert>
using namespace sw;
int main()
{
Routine *routine = nullptr;
{
Function<Int(Int, Int)> function;
{
Int x = function.Arg<0>();
Int y = function.Arg<1>();
Int sum = x + y;
Return(sum);
}
routine = function(L"one");
if(routine)
{
int (*add)(int, int) = (int(*)(int,int))routine->getEntry();
int result = add(1, 2);
assert(result == 3);
}
}
delete routine;
return 0;
}

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Subzero", "Subzero.vcxproj", "{0EB31AEC-B020-46AB-BA05-730F6D01C29B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Profile|x64 = Profile|x64
Profile|x86 = Profile|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0EB31AEC-B020-46AB-BA05-730F6D01C29B}.Debug|x64.ActiveCfg = Debug|x64
{0EB31AEC-B020-46AB-BA05-730F6D01C29B}.Debug|x64.Build.0 = Debug|x64
{0EB31AEC-B020-46AB-BA05-730F6D01C29B}.Debug|x86.ActiveCfg = Debug|Win32
{0EB31AEC-B020-46AB-BA05-730F6D01C29B}.Debug|x86.Build.0 = Debug|Win32
{0EB31AEC-B020-46AB-BA05-730F6D01C29B}.Profile|x64.ActiveCfg = Release|x64
{0EB31AEC-B020-46AB-BA05-730F6D01C29B}.Profile|x64.Build.0 = Release|x64
{0EB31AEC-B020-46AB-BA05-730F6D01C29B}.Profile|x86.ActiveCfg = Release|Win32
{0EB31AEC-B020-46AB-BA05-730F6D01C29B}.Profile|x86.Build.0 = Release|Win32
{0EB31AEC-B020-46AB-BA05-730F6D01C29B}.Release|x64.ActiveCfg = Release|x64
{0EB31AEC-B020-46AB-BA05-730F6D01C29B}.Release|x64.Build.0 = Release|x64
{0EB31AEC-B020-46AB-BA05-730F6D01C29B}.Release|x86.ActiveCfg = Release|Win32
{0EB31AEC-B020-46AB-BA05-730F6D01C29B}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
This source diff could not be displayed because it is too large. You can view the blob instead.
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{4EC107AB-89E8-4A0B-8366-B3E81085AE07}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>SubzeroTest</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IncludePath>$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<IncludePath>$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ProjectReference Include="Subzero.vcxproj">
<Project>{0eb31aec-b020-46ab-ba05-730f6d01c29b}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Main.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment