Value* Builder::VIMMED1(uint64_t i)
{
+#if LLVM_VERSION_MAJOR > 10
+ return ConstantVector::getSplat(ElementCount(mVWidth, false), cast<ConstantInt>(C(i)));
+#else
return ConstantVector::getSplat(mVWidth, cast<ConstantInt>(C(i)));
+#endif
}
Value* Builder::VIMMED1_16(uint64_t i)
{
+#if LLVM_VERSION_MAJOR > 10
+ return ConstantVector::getSplat(ElementCount(mVWidth16, false), cast<ConstantInt>(C(i)));
+#else
return ConstantVector::getSplat(mVWidth16, cast<ConstantInt>(C(i)));
+#endif
}
Value* Builder::VIMMED1(int i)
{
+#if LLVM_VERSION_MAJOR > 10
+ return ConstantVector::getSplat(ElementCount(mVWidth, false), cast<ConstantInt>(C(i)));
+#else
return ConstantVector::getSplat(mVWidth, cast<ConstantInt>(C(i)));
+#endif
}
Value* Builder::VIMMED1_16(int i)
{
+#if LLVM_VERSION_MAJOR > 10
+ return ConstantVector::getSplat(ElementCount(mVWidth16, false), cast<ConstantInt>(C(i)));
+#else
return ConstantVector::getSplat(mVWidth16, cast<ConstantInt>(C(i)));
+#endif
}
Value* Builder::VIMMED1(uint32_t i)
{
+#if LLVM_VERSION_MAJOR > 10
+ return ConstantVector::getSplat(ElementCount(mVWidth, false), cast<ConstantInt>(C(i)));
+#else
return ConstantVector::getSplat(mVWidth, cast<ConstantInt>(C(i)));
+#endif
}
Value* Builder::VIMMED1_16(uint32_t i)
{
+#if LLVM_VERSION_MAJOR > 10
+ return ConstantVector::getSplat(ElementCount(mVWidth16, false), cast<ConstantInt>(C(i)));
+#else
return ConstantVector::getSplat(mVWidth16, cast<ConstantInt>(C(i)));
+#endif
}
Value* Builder::VIMMED1(float i)
{
+#if LLVM_VERSION_MAJOR > 10
+ return ConstantVector::getSplat(ElementCount(mVWidth, false), cast<ConstantFP>(C(i)));
+#else
return ConstantVector::getSplat(mVWidth, cast<ConstantFP>(C(i)));
+#endif
}
Value* Builder::VIMMED1_16(float i)
{
+#if LLVM_VERSION_MAJOR > 10
+ return ConstantVector::getSplat(ElementCount(mVWidth16, false), cast<ConstantFP>(C(i)));
+#else
return ConstantVector::getSplat(mVWidth16, cast<ConstantFP>(C(i)));
+#endif
}
Value* Builder::VIMMED1(bool i)
{
+#if LLVM_VERSION_MAJOR > 10
+ return ConstantVector::getSplat(ElementCount(mVWidth, false), cast<ConstantInt>(C(i)));
+#else
return ConstantVector::getSplat(mVWidth, cast<ConstantInt>(C(i)));
+#endif
}
Value* Builder::VIMMED1_16(bool i)
{
+#if LLVM_VERSION_MAJOR > 10
+ return ConstantVector::getSplat(ElementCount(mVWidth16, false), cast<ConstantInt>(C(i)));
+#else
return ConstantVector::getSplat(mVWidth16, cast<ConstantInt>(C(i)));
+#endif
}
Value* Builder::VUNDEF_IPTR() { return UndefValue::get(VectorType::get(mInt32PtrTy, mVWidth)); }
{
using namespace llvm;
-#if LLVM_VERSION_MAJOR > 10
- typedef unsigned IntrinsicID;
-#else
- typedef Intrinsic::ID IntrinsicID;
-#endif
-
enum TargetArch
{
AVX = 0,
auto vi1Mask = pCallInst->getArgOperand(3);
auto i8Scale = pCallInst->getArgOperand(4);
- pBase = B->POINTER_CAST(pBase, PointerType::get(B->mInt8Ty, 0));
- uint32_t numElem = vSrc->getType()->getVectorNumElements();
- auto i32Scale = B->Z_EXT(i8Scale, B->mInt32Ty);
- auto srcTy = vSrc->getType()->getVectorElementType();
+ pBase = B->POINTER_CAST(pBase, PointerType::get(B->mInt8Ty, 0));
+ uint32_t numElem = vSrc->getType()->getVectorNumElements();
+ auto i32Scale = B->Z_EXT(i8Scale, B->mInt32Ty);
+ auto srcTy = vSrc->getType()->getVectorElementType();
Value* v32Gather = nullptr;
if (arch == AVX)
{
B->STORE(vSrc, pTmp);
v32Gather = UndefValue::get(vSrc->getType());
+#if LLVM_VERSION_MAJOR > 10
+ auto vi32Scale = ConstantVector::getSplat(ElementCount(numElem, false), cast<ConstantInt>(i32Scale));
+#else
auto vi32Scale = ConstantVector::getSplat(numElem, cast<ConstantInt>(i32Scale));
+#endif
auto vi32Offsets = B->MUL(vi32Indices, vi32Scale);
for (uint32_t i = 0; i < numElem; ++i)
/****************************************************************************
- * Copyright (C) 2017-2018 Intel Corporation. All Rights Reserved.
+ * Copyright (C) 2017-2020 Intel Corporation. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
#pragma pop_macro("DEBUG")
#endif
+#if LLVM_VERSION_MAJOR > 10
+ typedef unsigned IntrinsicID;
+ typedef llvm::Align AlignType;
+#else
+ typedef llvm::Intrinsic::ID IntrinsicID;
+ typedef unsigned AlignType;
+#endif
+
#include <deque>
#include <list>
#include <unordered_map>