Add arm neon intrinsics
This commit is contained in:
parent
b91e88a9a6
commit
0de30ebdd9
6 changed files with 30 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue