MCPcopy Create free account
hub / github.com/JeanLucPons/VanitySearch / ModSquareK1

Method ModSquareK1

IntMod.cpp:1034–1149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1032}
1033
1034void Int::ModSquareK1(Int *a) {
1035
1036#ifndef WIN64
1037#if (__GNUC__ > 7) || (__GNUC__ == 7 && (__GNUC_MINOR__ > 2))
1038 unsigned char c;
1039#else
1040 #warning "GCC lass than 7.3 detected, upgrade gcc to get best perfromance"
1041 volatile unsigned char c;
1042#endif
1043#else
1044 unsigned char c;
1045#endif
1046
1047 uint64_t r512[8];
1048 uint64_t u10, u11;
1049 uint64_t t1;
1050 uint64_t t2;
1051 uint64_t t[5];
1052
1053
1054 //k=0
1055 r512[0] = _umul128(a->bits64[0], a->bits64[0], &t[1]);
1056
1057 //k=1
1058 t[3] = _umul128(a->bits64[0], a->bits64[1], &t[4]);
1059 c = _addcarry_u64(0, t[3], t[3], &t[3]);
1060 c = _addcarry_u64(c, t[4], t[4], &t[4]);
1061 c = _addcarry_u64(c, 0, 0, &t1);
1062 c = _addcarry_u64(0, t[1], t[3], &t[3]);
1063 c = _addcarry_u64(c, t[4], 0, &t[4]);
1064 c = _addcarry_u64(c, t1, 0, &t1);
1065 r512[1] = t[3];
1066
1067 //k=2
1068 t[0] = _umul128(a->bits64[0], a->bits64[2], &t[1]);
1069 c = _addcarry_u64(0, t[0], t[0], &t[0]);
1070 c = _addcarry_u64(c, t[1], t[1], &t[1]);
1071 c = _addcarry_u64(c, 0, 0, &t2);
1072
1073 u10 = _umul128(a->bits64[1], a->bits64[1], &u11);
1074 c = _addcarry_u64(0, t[0] , u10, &t[0]);
1075 c = _addcarry_u64(c, t[1] , u11, &t[1]);
1076 c = _addcarry_u64(c, t2 , 0, &t2);
1077 c = _addcarry_u64(0, t[0], t[4], &t[0]);
1078 c = _addcarry_u64(c, t[1], t1, &t[1]);
1079 c = _addcarry_u64(c, t2, 0, &t2);
1080 r512[2] = t[0];
1081
1082 //k=3
1083 t[3] = _umul128(a->bits64[0], a->bits64[3], &t[4]);
1084 u10 = _umul128(a->bits64[1], a->bits64[2], &u11);
1085
1086 c = _addcarry_u64(0, t[3], u10, &t[3]);
1087 c = _addcarry_u64(c, t[4], u11, &t[4]);
1088 c = _addcarry_u64(c, 0, 0, &t1);
1089 t1 += t1;
1090 c = _addcarry_u64(0, t[3], t[3], &t[3]);
1091 c = _addcarry_u64(c, t[4], t[4], &t[4]);

Callers 8

CheckMethod · 0.80
AddDirectMethod · 0.80
Add2Method · 0.80
AddMethod · 0.80
DoubleMethod · 0.80
GetYMethod · 0.80
ECMethod · 0.80
FindKeyCPUMethod · 0.80

Calls 2

_umul128Function · 0.85
imm_umulFunction · 0.85

Tested by

no test coverage detected