aes | ||
argon2 | ||
asm | ||
keys | ||
.drone.yml | ||
blake2b.go | ||
cache.go | ||
config.go | ||
dataset.go | ||
dataset_light.go | ||
exec.go | ||
exec_generic.go | ||
exec_mmap_unix.go | ||
float.go | ||
go.mod | ||
go.sum | ||
jit_amd64.go | ||
LICENSE | ||
randomx.go | ||
randomx_test.go | ||
README.md | ||
register.go | ||
superscalar.go | ||
superscalar_jit_amd64.go | ||
superscalar_noasm.go | ||
vm.go | ||
vm_bytecode.go | ||
vm_bytecode_native.go | ||
vm_bytecode_purego.go | ||
vm_instruction.go | ||
vm_instruction_native.go | ||
vm_instruction_purego.go |
RandomX (Golang Implementation)
Fork from git.dero.io/DERO_Foundation/RandomX. Also related, their Analysis of RandomX writeup.
Original code failed RandomX testcases and was implemented using big.Float.
This package implements RandomX without CGO, using only Golang code, pure float64 ops and two small assembly sections to implement CFROUND modes, with optional soft float implementation.
All test cases pass properly.
Uses minimal Go assembly due to having to set rounding mode natively. Native hard float can be added with supporting rounding mode under asm.
JIT is supported on a few platforms but can be hard-disabled via the disable_jit
build flag, or at runtime.
A pure Golang implementation can be used on platforms without hard float support or via the purego
build flag manually.
Platform | Supported | Hard Float | SuperScalar JIT | Notes |
---|---|---|---|---|
386 | ✅ | ✅ | ❌ | |
amd64 | ✅ | ✅ | ✅* | JIT only on Unix |
arm | ✅* | ❌ | ❌ | |
arm64 | ✅ | ✅ | ❌ | |
mips | ✅* | ❌ | ❌ | |
mips64 | ✅* | ❌ | ❌ | |
riscv64 | ✅* | ❌ | ❌ | |
wasm | ✅* | ❌ | ❌ |
* these platforms only support software floating point / purego and will not be performant.