Doubled the frequency of CBRANCH, halved the jumping probability

This commit is contained in:
tevador 2019-04-30 14:09:46 +02:00
parent 3cf6a30076
commit be21ba767c
2 changed files with 5 additions and 5 deletions

View file

@ -65,16 +65,16 @@ along with RandomX. If not, see<http://www.gnu.org/licenses/>.
#define RANDOMX_SCRATCHPAD_L1 (16 * 1024) #define RANDOMX_SCRATCHPAD_L1 (16 * 1024)
//How many register bits must be zero for CBRANCH instruction to jump. Must be an integer in the range 1-16. //How many register bits must be zero for CBRANCH instruction to jump. Must be an integer in the range 1-16.
#define RANDOMX_JUMP_BITS 7 #define RANDOMX_JUMP_BITS 8
/* /*
Instruction frequencies (per 256 opcodes) Instruction frequencies (per 256 opcodes)
Total sum of frequencies must be 256 Total sum of frequencies must be 256
*/ */
#define RANDOMX_FREQ_IADD_RS 32 #define RANDOMX_FREQ_IADD_RS 25
#define RANDOMX_FREQ_IADD_M 7 #define RANDOMX_FREQ_IADD_M 7
#define RANDOMX_FREQ_ISUB_R 17 #define RANDOMX_FREQ_ISUB_R 16
#define RANDOMX_FREQ_ISUB_M 7 #define RANDOMX_FREQ_ISUB_M 7
#define RANDOMX_FREQ_IMUL_R 16 #define RANDOMX_FREQ_IMUL_R 16
#define RANDOMX_FREQ_IMUL_M 4 #define RANDOMX_FREQ_IMUL_M 4
@ -100,7 +100,7 @@ Total sum of frequencies must be 256
#define RANDOMX_FREQ_FDIV_M 4 #define RANDOMX_FREQ_FDIV_M 4
#define RANDOMX_FREQ_FSQRT_R 6 #define RANDOMX_FREQ_FSQRT_R 6
#define RANDOMX_FREQ_CBRANCH 8 #define RANDOMX_FREQ_CBRANCH 16
#define RANDOMX_FREQ_CFROUND 1 #define RANDOMX_FREQ_CFROUND 1
#define RANDOMX_FREQ_ISTORE 16 #define RANDOMX_FREQ_ISTORE 16

View file

@ -229,7 +229,7 @@ int main(int argc, char** argv) {
std::cout << "Calculated result: "; std::cout << "Calculated result: ";
result.print(std::cout); result.print(std::cout);
if (noncesCount == 1000 && seedValue == 0) if (noncesCount == 1000 && seedValue == 0)
std::cout << "Reference result: df0862de0bedf2da0432a5eeb097453f2b020d00eadc60c32ae27b8d9d10ee0c" << std::endl; std::cout << "Reference result: 092868e4cee629a5b3848b97a52199d8a158e5b56ab9064764cda7ff656f3741" << std::endl;
if (!miningMode) { if (!miningMode) {
std::cout << "Performance: " << 1000 * elapsed / noncesCount << " ms per hash" << std::endl; std::cout << "Performance: " << 1000 * elapsed / noncesCount << " ms per hash" << std::endl;
} }