mirror of
https://codeberg.org/wownero/RandomX.git
synced 2026-10-18 05:51:26 +02:00
Vector FPU instructions
JitCompilerX86 - static code written in asm Updated ALU/FPU tests Updated instruction weights
This commit is contained in:
+14
-2
@@ -24,8 +24,19 @@ along with RandomX. If not, see<http://www.gnu.org/licenses/>.
|
||||
#include "t1ha/t1ha.h"
|
||||
#include "blake2/blake2.h"
|
||||
#include <cstring>
|
||||
#include <iomanip>
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const RandomX::RegisterFile& rf) {
|
||||
for (int i = 0; i < RandomX::RegistersCount; ++i)
|
||||
os << std::hex << "r" << i << " = " << rf.r[i].u64 << std::endl << std::dec;
|
||||
for (int i = 0; i < RandomX::RegistersCount; ++i)
|
||||
os << std::hex << "f" << i << " = " << rf.f[i].hi.u64 << " (" << rf.f[i].hi.f64 << ")" << std::endl
|
||||
<< " = " << rf.f[i].lo.u64 << " (" << rf.f[i].lo.f64 << ")" << std::endl << std::dec;
|
||||
return os;
|
||||
}
|
||||
|
||||
namespace RandomX {
|
||||
|
||||
VirtualMachine::VirtualMachine(bool softAes) : softAes(softAes), lightClient(false) {
|
||||
mem.ds.dataset = nullptr;
|
||||
}
|
||||
@@ -83,9 +94,10 @@ namespace RandomX {
|
||||
}
|
||||
|
||||
void VirtualMachine::getResult(void* out) {
|
||||
uint64_t smallState[sizeof(RegisterFile) / sizeof(uint64_t) + 2];
|
||||
constexpr size_t smallStateLength = sizeof(RegisterFile) / sizeof(uint64_t) + 2;
|
||||
uint64_t smallState[smallStateLength];
|
||||
memcpy(smallState, ®, sizeof(RegisterFile));
|
||||
smallState[17] = t1ha2_atonce128(&smallState[16], scratchpad, ScratchpadSize, reg.r[0].u64);
|
||||
smallState[smallStateLength - 1] = t1ha2_atonce128(&smallState[smallStateLength - 2], scratchpad, ScratchpadSize, reg.r[0].u64);
|
||||
blake2b(out, ResultSize, smallState, sizeof(smallState), nullptr, 0);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user