|
|
@ -307,19 +307,20 @@ struct FpGenerator : Xbyak::CodeGenerator { |
|
|
|
useMulx_ = cpu_.has(Xbyak::util::Cpu::tBMI2); |
|
|
|
useMulx_ = cpu_.has(Xbyak::util::Cpu::tBMI2); |
|
|
|
useAdx_ = cpu_.has(Xbyak::util::Cpu::tADX); |
|
|
|
useAdx_ = cpu_.has(Xbyak::util::Cpu::tADX); |
|
|
|
} |
|
|
|
} |
|
|
|
void init(Op& op) |
|
|
|
bool init(Op& op) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
if (!cpu_.has(Xbyak::util::Cpu::tAVX)) return false; |
|
|
|
reset(); // reset jit code for reuse
|
|
|
|
reset(); // reset jit code for reuse
|
|
|
|
setProtectModeRW(); // read/write memory
|
|
|
|
setProtectModeRW(); // read/write memory
|
|
|
|
init_inner(op); |
|
|
|
init_inner(op); |
|
|
|
// printf("code size=%d\n", (int)getSize());
|
|
|
|
// printf("code size=%d\n", (int)getSize());
|
|
|
|
setProtectModeRE(); // set read/exec memory
|
|
|
|
setProtectModeRE(); // set read/exec memory
|
|
|
|
|
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
private: |
|
|
|
private: |
|
|
|
void init_inner(Op& op) |
|
|
|
void init_inner(Op& op) |
|
|
|
{ |
|
|
|
{ |
|
|
|
op_ = &op; |
|
|
|
op_ = &op; |
|
|
|
if (!cpu_.has(Xbyak::util::Cpu::tAVX)) return; |
|
|
|
|
|
|
|
L(pL_); |
|
|
|
L(pL_); |
|
|
|
p_ = reinterpret_cast<const uint64_t*>(getCurr()); |
|
|
|
p_ = reinterpret_cast<const uint64_t*>(getCurr()); |
|
|
|
for (size_t i = 0; i < op.N; i++) { |
|
|
|
for (size_t i = 0; i < op.N; i++) { |
|
|
|