@ -37,6 +37,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# include "superscalar.hpp"
# include "intrin_portable.h"
# include "reciprocal.h"
# include "common.hpp"
namespace randomx {
@ -334,7 +335,7 @@ namespace randomx {
return false ;
if ( availableRegisters . size ( ) > 1 ) {
index = gen . get Int32( ) % availableRegisters . size ( ) ;
index = gen . get U Int32( ) % availableRegisters . size ( ) ;
}
else {
index = 0 ;
@ -447,7 +448,7 @@ namespace randomx {
case SuperscalarInstructionType : : IADD_C8 :
case SuperscalarInstructionType : : IADD_C9 : {
mod_ = 0 ;
imm32_ = gen . get Int32( ) ;
imm32_ = gen . get U Int32( ) ;
opGroup_ = SuperscalarInstructionType : : IADD_C7 ;
opGroupPar_ = - 1 ;
} break ;
@ -456,7 +457,7 @@ namespace randomx {
case SuperscalarInstructionType : : IXOR_C8 :
case SuperscalarInstructionType : : IXOR_C9 : {
mod_ = 0 ;
imm32_ = gen . get Int32( ) ;
imm32_ = gen . get U Int32( ) ;
opGroup_ = SuperscalarInstructionType : : IXOR_C7 ;
opGroupPar_ = - 1 ;
} break ;
@ -466,7 +467,7 @@ namespace randomx {
mod_ = 0 ;
imm32_ = 0 ;
opGroup_ = SuperscalarInstructionType : : IMULH_R ;
opGroupPar_ = gen . get Int32( ) ;
opGroupPar_ = gen . get U Int32( ) ;
} break ;
case SuperscalarInstructionType : : ISMULH_R : {
@ -474,14 +475,14 @@ namespace randomx {
mod_ = 0 ;
imm32_ = 0 ;
opGroup_ = SuperscalarInstructionType : : ISMULH_R ;
opGroupPar_ = gen . get Int32( ) ;
opGroupPar_ = gen . get U Int32( ) ;
} break ;
case SuperscalarInstructionType : : IMUL_RCP : {
mod_ = 0 ;
do {
imm32_ = gen . get Int32( ) ;
} while ( ( imm32_ & ( imm32_ - 1 ) ) = = 0 ) ;
imm32_ = gen . get U Int32( ) ;
} while ( isZeroOrPowerOf2 ( imm32_ ) ) ;
opGroup_ = SuperscalarInstructionType : : IMUL_RCP ;
opGroupPar_ = - 1 ;
} break ;