detect bmi2 feature

dev
MITSUNARI Shigeo 8 years ago
parent 374acb1577
commit a63abe39c4
  1. 16
      src/fp.cpp
  2. 6
      src/fp_generator.hpp

@ -1,8 +1,10 @@
#include <mcl/op.hpp> #include <mcl/op.hpp>
#include <mcl/util.hpp> #include <mcl/util.hpp>
#include "conversion.hpp" #include "conversion.hpp"
#ifdef MCL_USE_XBYAK #if CYBOZU_HOST == CYBOZU_HOST_INTEL
#include "fp_generator.hpp" #define XBYAK_NO_OP_NAMES
#include <xbyak/xbyak_util.h>
#include "fp_generator.hpp"
#endif #endif
#include "low_func.hpp" #include "low_func.hpp"
#ifdef MCL_USE_LLVM #ifdef MCL_USE_LLVM
@ -231,7 +233,15 @@ void setOp(Op& op, Mode mode)
setOp2<N, Gtag, true>(op); setOp2<N, Gtag, true>(op);
#ifdef MCL_USE_LLVM #ifdef MCL_USE_LLVM
if (mode != fp::FP_GMP && mode != fp::FP_GMP_MONT) { if (mode != fp::FP_GMP && mode != fp::FP_GMP_MONT) {
setOp2<N, LBMI2tag, (N * UnitBitSize <= 256)>(op); #if CYBOZU_HOST == CYBOZU_HOST_INTEL
Xbyak::util::Cpu cpu;
if (0&&cpu.has(Xbyak::util::Cpu::tBMI2)) {
setOp2<N, LBMI2tag, (N * UnitBitSize <= 256)>(op);
} else
#endif
{
setOp2<N, Ltag, (N * UnitBitSize <= 256)>(op);
}
} }
#else #else
(void)mode; (void)mode;

@ -9,15 +9,9 @@
#include <stdio.h> #include <stdio.h>
#include <assert.h> #include <assert.h>
#include <cybozu/exception.hpp> #include <cybozu/exception.hpp>
#include <mcl/op.hpp>
#if (CYBOZU_HOST == CYBOZU_HOST_INTEL) && (CYBOZU_OS_BIT == 64) #if (CYBOZU_HOST == CYBOZU_HOST_INTEL) && (CYBOZU_OS_BIT == 64)
#ifndef XBYAK_NO_OP_NAMES
#define XBYAK_NO_OP_NAMES
#endif
#include <xbyak/xbyak.h>
#include <xbyak/xbyak_util.h>
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma warning(push) #pragma warning(push)
#pragma warning(disable : 4127) #pragma warning(disable : 4127)

Loading…
Cancel
Save