From: Chris Lattner Date: Sat, 25 Mar 2006 07:27:18 +0000 (+0000) Subject: Add a bunch of simple altivec intrinsics X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=64caa8c5cce0e327eeab4dae2d4939ce535998da;p=oota-llvm.git Add a bunch of simple altivec intrinsics git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27113 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Intrinsics.td b/include/llvm/Intrinsics.td index b81f44febec..360141c6e40 100644 --- a/include/llvm/Intrinsics.td +++ b/include/llvm/Intrinsics.td @@ -79,6 +79,9 @@ def llvm_ptr_ty : LLVMType; // sbyte* def llvm_ptrptr_ty : LLVMType; // sbyte** def llvm_descriptor_ty : LLVMType; // global* +def llvm_v16i8_ty : LLVMPackedType; // 16 x sbyte +def llvm_v8i16_ty : LLVMPackedType; // 8 x short + def llvm_v2i32_ty : LLVMPackedType; // 2 x int def llvm_v4i32_ty : LLVMPackedType; // 4 x int def llvm_v4f32_ty : LLVMPackedType; // 4 x float @@ -233,9 +236,41 @@ let TargetPrefix = "ppc" in { // All intrinsics start with "llvm.ppc.". def int_ppc_altivec_vnmsubfp : GCCBuiltin<"__builtin_altivec_vnmsubfp">, Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty], [InstrNoMem]>; - def int_ppc_altivec_vadduwm : GCCBuiltin<"__builtin_altivec_vadduwm">, + + def int_ppc_altivec_vaddcuw : GCCBuiltin<"__builtin_altivec_vaddcuw">, + Intrinsic<[llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty], + [InstrNoMem]>; + + // Saturating adds: + def int_ppc_altivec_vaddubs : GCCBuiltin<"__builtin_altivec_vaddubs">, + Intrinsic<[llvm_v16i8_ty, llvm_v16i8_ty, llvm_v16i8_ty], + [InstrNoMem]>; + def int_ppc_altivec_vaddsbs : GCCBuiltin<"__builtin_altivec_vaddsbs">, + Intrinsic<[llvm_v16i8_ty, llvm_v16i8_ty, llvm_v16i8_ty], + [InstrNoMem]>; + def int_ppc_altivec_vadduhs : GCCBuiltin<"__builtin_altivec_vadduhs">, + Intrinsic<[llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty], + [InstrNoMem]>; + def int_ppc_altivec_vaddshs : GCCBuiltin<"__builtin_altivec_vaddshs">, + Intrinsic<[llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty], + [InstrNoMem]>; + def int_ppc_altivec_vadduws : GCCBuiltin<"__builtin_altivec_vadduws">, + Intrinsic<[llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty], + [InstrNoMem]>; + def int_ppc_altivec_vaddsws : GCCBuiltin<"__builtin_altivec_vaddsws">, Intrinsic<[llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty], [InstrNoMem]>; + + // FP to integer conversion. + def int_ppc_altivec_vcfsx : GCCBuiltin<"__builtin_altivec_vcfsx">, + Intrinsic<[llvm_v4f32_ty, llvm_v4i32_ty, llvm_int_ty], + [InstrNoMem]>; + def int_ppc_altivec_vcfux : GCCBuiltin<"__builtin_altivec_vcfux">, + Intrinsic<[llvm_v4f32_ty, llvm_v4i32_ty, llvm_int_ty], + [InstrNoMem]>; + + def int_ppc_altivec_vrsqrtefp : GCCBuiltin<"__builtin_altivec_vrsqrtefp">, + Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty], [InstrNoMem]>; }