detect bmi2 feature

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

@ -1,8 +1,10 @@
#include <mcl/op.hpp>
#include <mcl/util.hpp>
#include "conversion.hpp"
#ifdef MCL_USE_XBYAK
#include "fp_generator.hpp"
#if CYBOZU_HOST == CYBOZU_HOST_INTEL
#define XBYAK_NO_OP_NAMES
#include <xbyak/xbyak_util.h>
#include "fp_generator.hpp"
#endif
#include "low_func.hpp"
#ifdef MCL_USE_LLVM
@ -231,7 +233,15 @@ void setOp(Op& op, Mode mode)
setOp2<N, Gtag, true>(op);
#ifdef MCL_USE_LLVM
if (mode != fp::FP_GMP && mode != fp::FP_GMP_MONT) {
#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
(void)mode;

@ -9,15 +9,9 @@
#include <stdio.h>
#include <assert.h>
#include <cybozu/exception.hpp>
#include <mcl/op.hpp>
#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
#pragma warning(push)
#pragma warning(disable : 4127)

Loading…
Cancel
Save