mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-28 05:19:42 +00:00
[Codegen] Add intrinsics 'absdiff' and corresponding SDNodes for absolute difference operation
This adds new intrinsics "*absdiff" for absolute difference ops to facilitate efficient code generation for "sum of absolute differences" operation. The patch also contains the introduction of corresponding SDNodes and basic legalization support.Sanity of the generated code is tested on X86. This is 1st of the three patches. Patch by Shahid Asghar-ahmad! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242409 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -334,6 +334,10 @@ namespace ISD {
|
||||
/// Byte Swap and Counting operators.
|
||||
BSWAP, CTTZ, CTLZ, CTPOP,
|
||||
|
||||
/// [SU]ABSDIFF - Signed/Unsigned absolute difference of two input integer
|
||||
/// vector. These nodes are generated from llvm.*absdiff* intrinsics.
|
||||
SABSDIFF, UABSDIFF,
|
||||
|
||||
/// Bit counting operators with an undefined result for zero inputs.
|
||||
CTTZ_ZERO_UNDEF, CTLZ_ZERO_UNDEF,
|
||||
|
||||
|
||||
@@ -605,6 +605,12 @@ def int_convertuu : Intrinsic<[llvm_anyint_ty],
|
||||
def int_clear_cache : Intrinsic<[], [llvm_ptr_ty, llvm_ptr_ty],
|
||||
[], "llvm.clear_cache">;
|
||||
|
||||
// Calculate the Absolute Differences of the two input vectors.
|
||||
def int_sabsdiff : Intrinsic<[llvm_anyvector_ty],
|
||||
[ LLVMMatchType<0>, LLVMMatchType<0> ], [IntrNoMem]>;
|
||||
def int_uabsdiff : Intrinsic<[llvm_anyvector_ty],
|
||||
[ LLVMMatchType<0>, LLVMMatchType<0> ], [IntrNoMem]>;
|
||||
|
||||
//===-------------------------- Masked Intrinsics -------------------------===//
|
||||
//
|
||||
def int_masked_store : Intrinsic<[], [llvm_anyvector_ty, LLVMPointerTo<0>,
|
||||
|
||||
@@ -386,6 +386,8 @@ def smax : SDNode<"ISD::SMAX" , SDTIntBinOp>;
|
||||
def umin : SDNode<"ISD::UMIN" , SDTIntBinOp>;
|
||||
def umax : SDNode<"ISD::UMAX" , SDTIntBinOp>;
|
||||
|
||||
def sabsdiff : SDNode<"ISD::SABSDIFF" , SDTIntBinOp>;
|
||||
def uabsdiff : SDNode<"ISD::UABSDIFF" , SDTIntBinOp>;
|
||||
def sext_inreg : SDNode<"ISD::SIGN_EXTEND_INREG", SDTExtInreg>;
|
||||
def bswap : SDNode<"ISD::BSWAP" , SDTIntUnaryOp>;
|
||||
def ctlz : SDNode<"ISD::CTLZ" , SDTIntUnaryOp>;
|
||||
|
||||
Reference in New Issue
Block a user