Add arm neon intrinsics

This commit is contained in:
Magnus Norddahl 2017-01-09 12:11:44 +01:00
commit 0de30ebdd9
6 changed files with 30 additions and 0 deletions

View file

@ -56,9 +56,13 @@ llvm::Type *SSAFloat::llvm_type()
SSAFloat SSAFloat::rsqrt(SSAFloat f)
{
#ifdef ARM_TARGET
return SSAFloat::from_llvm(SSAScope::builder().CreateCall(SSAScope::intrinsic(llvm::Intrinsic::aarch64_neon_frsqrts), f.v, SSAScope::hint()));
#else
llvm::Value *f_ss = SSAScope::builder().CreateInsertElement(llvm::UndefValue::get(SSAVec4f::llvm_type()), f.v, llvm::ConstantInt::get(SSAScope::context(), llvm::APInt(32, (uint64_t)0)));
f_ss = SSAScope::builder().CreateCall(SSAScope::intrinsic(llvm::Intrinsic::x86_sse_rsqrt_ss), f_ss, SSAScope::hint());
return SSAFloat::from_llvm(SSAScope::builder().CreateExtractElement(f_ss, SSAInt(0).v, SSAScope::hint()));
#endif
}
SSAFloat SSAFloat::MIN(SSAFloat a, SSAFloat b)