Fixed superscalar test projects

This commit is contained in:
tevador 2019-04-21 00:50:57 +02:00
parent 0d21ae85fc
commit 360c8ed913
12 changed files with 31 additions and 168 deletions

View File

@ -20,10 +20,8 @@ along with RandomX. If not, see<http://www.gnu.org/licenses/>.
#include <iostream>
#include <cstdint>
#include <vector>
#include "../superscalarGenerator.hpp"
#include "../InterpretedVirtualMachine.hpp"
#include "../intrinPortable.h"
#include "../Blake2Generator.hpp"
#include "../superscalar.hpp"
#include "../intrin_portable.h"
const uint8_t seed[32] = { 191, 182, 222, 175, 249, 89, 134, 104, 241, 68, 191, 62, 162, 166, 61, 64, 123, 191, 227, 193, 118, 60, 188, 53, 223, 133, 175, 24, 123, 230, 55, 74 };
@ -35,7 +33,7 @@ int main() {
for (int i = 0; i < 10000; ++i) {
uint64_t ra[8] = {
6364136223846793005ULL,
9298410992540426048ULL,
9298410992540426748ULL,
12065312585734608966ULL,
9306329213124610396ULL,
5281919268842080866ULL,
@ -46,11 +44,11 @@ int main() {
uint64_t rb[8];
memcpy(rb, ra, sizeof rb);
rb[0] ^= (1ULL << bit);
RandomX::SuperscalarProgram p;
RandomX::Blake2Generator gen(seed, i);
RandomX::generateSuperscalar(p, gen);
RandomX::InterpretedVirtualMachine<false>::executeSuperscalar(ra, p, dummy);
RandomX::InterpretedVirtualMachine<false>::executeSuperscalar(rb, p, dummy);
randomx::SuperscalarProgram p;
randomx::Blake2Generator gen(seed, sizeof seed, i);
randomx::generateSuperscalar(p, gen);
randomx::executeSuperscalar(ra, p, nullptr);
randomx::executeSuperscalar(rb, p, nullptr);
uint64_t diff = 0;
for (int j = 0; j < 8; ++j) {
diff += __popcnt64(ra[j] ^ rb[j]);

View File

@ -21,10 +21,8 @@ along with RandomX. If not, see<http://www.gnu.org/licenses/>.
#include <cstdint>
#include <vector>
#include <unordered_set>
#include "../superscalarGenerator.hpp"
#include "../InterpretedVirtualMachine.hpp"
#include "../intrinPortable.h"
#include "../configuration.h"
#include "../superscalar.hpp"
#include "../common.hpp"
const uint8_t seed[32] = { 191, 182, 222, 175, 249, 89, 134, 104, 241, 68, 191, 62, 162, 166, 61, 64, 123, 191, 227, 193, 118, 60, 188, 53, 223, 133, 175, 24, 123, 230, 55, 74 };
@ -39,7 +37,7 @@ int main() {
constexpr uint64_t superscalarAdd5 = 10536153434571861004ULL;
constexpr uint64_t superscalarAdd6 = 3398623926847679864ULL;
constexpr uint64_t superscalarAdd7 = 9549104520008361294ULL;
constexpr uint32_t totalBlocks = RANDOMX_DATASET_SIZE / RandomX::CacheLineSize;
constexpr uint32_t totalBlocks = RANDOMX_DATASET_SIZE / randomx::CacheLineSize;
std::unordered_set<uint64_t> registerValues;
registerValues.reserve(totalBlocks);
registerValues.rehash(totalBlocks);

View File

@ -19,8 +19,8 @@ along with RandomX. If not, see<http://www.gnu.org/licenses/>.
#include <iostream>
#include <cstdint>
#include "../superscalarGenerator.hpp"
#include "../Blake2Generator.hpp"
#include "../superscalar.hpp"
#include "../blake2_generator.hpp"
const uint8_t seed[32] = { 191, 182, 222, 175, 249, 89, 134, 104, 241, 68, 191, 62, 162, 166, 61, 64, 123, 191, 227, 193, 118, 60, 188, 53, 223, 133, 175, 24, 123, 230, 55, 74 };
@ -34,9 +34,9 @@ int main() {
int64_t mulCount = 0;
int64_t size = 0;
for (int i = 0; i < count; ++i) {
RandomX::SuperscalarProgram prog;
RandomX::Blake2Generator gen(seed, i);
RandomX::generateSuperscalar(prog, gen);
randomx::SuperscalarProgram prog;
randomx::Blake2Generator gen(seed, i);
randomx::generateSuperscalar(prog, gen);
asicLatency += prog.asicLatency;
codesize += prog.codeSize;
cpuLatency += prog.cpuLatency;

View File

@ -128,7 +128,7 @@
<ClCompile Include="..\src\argon2_core.c" />
<ClCompile Include="..\src\argon2_ref.c" />
<ClCompile Include="..\src\assembly_generator_x86.cpp" />
<ClCompile Include="..\src\blake2_benerator.cpp" />
<ClCompile Include="..\src\blake2_generator.cpp" />
<ClCompile Include="..\src\blake2\blake2b.c" />
<ClCompile Include="..\src\vm_compiled_light.cpp" />
<ClCompile Include="..\src\vm_compiled.cpp" />

View File

@ -39,9 +39,6 @@
<ClCompile Include="..\src\assembly_generator_x86.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\blake2_benerator.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\vm_compiled_light.cpp">
<Filter>Source Files</Filter>
</ClCompile>
@ -78,6 +75,9 @@
<ClCompile Include="..\src\virtual_memory.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\blake2_generator.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\src\argon2.h">

View File

@ -116,25 +116,12 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\src\argon2_core.c" />
<ClCompile Include="..\src\argon2_ref.c" />
<ClCompile Include="..\src\Blake2Generator.cpp" />
<ClCompile Include="..\src\blake2\blake2b.c" />
<ClCompile Include="..\src\Cache.cpp" />
<ClCompile Include="..\src\dataset.cpp" />
<ClCompile Include="..\src\hashAes1Rx4.cpp" />
<ClCompile Include="..\src\Instruction.cpp" />
<ClCompile Include="..\src\instructionsPortable.cpp" />
<ClCompile Include="..\src\InterpretedVirtualMachine.cpp" />
<ClCompile Include="..\src\reciprocal.c" />
<ClCompile Include="..\src\softAes.cpp" />
<ClCompile Include="..\src\superscalarGenerator.cpp" />
<ClCompile Include="..\src\tests\superscalar-avalanche.cpp" />
<ClCompile Include="..\src\VirtualMachine.cpp" />
<ClCompile Include="..\src\virtualMemory.cpp" />
</ItemGroup>
<ItemGroup>
<MASM Include="..\src\squareHash.asm" />
<ProjectReference Include="randomx.vcxproj">
<Project>{3346a4ad-c438-4324-8b77-47a16452954b}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">

View File

@ -18,55 +18,5 @@
<ClCompile Include="..\src\tests\superscalar-avalanche.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\InterpretedVirtualMachine.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\instructionsPortable.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\Instruction.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\Cache.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\VirtualMachine.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\argon2_core.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\argon2_ref.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\reciprocal.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\blake2\blake2b.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\hashAes1Rx4.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\softAes.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\dataset.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\virtualMemory.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\superscalarGenerator.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\Blake2Generator.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<MASM Include="..\src\squareHash.asm">
<Filter>Source Files</Filter>
</MASM>
</ItemGroup>
</Project>

View File

@ -116,25 +116,12 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\src\argon2_core.c" />
<ClCompile Include="..\src\argon2_ref.c" />
<ClCompile Include="..\src\Blake2Generator.cpp" />
<ClCompile Include="..\src\blake2\blake2b.c" />
<ClCompile Include="..\src\Cache.cpp" />
<ClCompile Include="..\src\dataset.cpp" />
<ClCompile Include="..\src\hashAes1Rx4.cpp" />
<ClCompile Include="..\src\Instruction.cpp" />
<ClCompile Include="..\src\instructionsPortable.cpp" />
<ClCompile Include="..\src\InterpretedVirtualMachine.cpp" />
<ClCompile Include="..\src\reciprocal.c" />
<ClCompile Include="..\src\softAes.cpp" />
<ClCompile Include="..\src\superscalarGenerator.cpp" />
<ClCompile Include="..\src\tests\superscalar-init.cpp" />
<ClCompile Include="..\src\VirtualMachine.cpp" />
<ClCompile Include="..\src\virtualMemory.cpp" />
</ItemGroup>
<ItemGroup>
<MASM Include="..\src\squareHash.asm" />
<ProjectReference Include="randomx.vcxproj">
<Project>{3346a4ad-c438-4324-8b77-47a16452954b}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">

View File

@ -15,58 +15,8 @@
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\src\argon2_core.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\argon2_ref.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\blake2\blake2b.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\Cache.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\dataset.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\hashAes1Rx4.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\Instruction.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\instructionsPortable.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\InterpretedVirtualMachine.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\reciprocal.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\softAes.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\tests\superscalar-init.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\VirtualMachine.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\virtualMemory.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\superscalarGenerator.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\Blake2Generator.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<MASM Include="..\src\squareHash.asm">
<Filter>Source Files</Filter>
</MASM>
</ItemGroup>
</Project>

View File

@ -115,11 +115,13 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\src\Blake2Generator.cpp" />
<ClCompile Include="..\src\blake2\blake2b.c" />
<ClCompile Include="..\src\superscalarGenerator.cpp" />
<ClCompile Include="..\src\tests\superscalar-stats.cpp" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="randomx.vcxproj">
<Project>{3346a4ad-c438-4324-8b77-47a16452954b}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>

View File

@ -18,14 +18,5 @@
<ClCompile Include="..\src\tests\superscalar-stats.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\Blake2Generator.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\superscalarGenerator.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\blake2\blake2b.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>