diff options
author | Leonard Chan <leonardchan@google.com> | 2019-02-04 17:18:11 +0000 |
---|---|---|
committer | Leonard Chan <leonardchan@google.com> | 2019-02-04 17:18:11 +0000 |
commit | 18c82e623e0f08cb5e55927959be3f90a52b572b (patch) | |
tree | 73b22dbd951ffe91cb8f5fe765e9dc2452dd9d0b /include/llvm/CodeGen | |
parent | 511056753e6c8c25e3776369e09042abc0512435 (diff) | |
download | llvm-18c82e623e0f08cb5e55927959be3f90a52b572b.tar.gz |
[Intrinsic] Unsigned Fixed Point Multiplication Intrinsic
Add an intrinsic that takes 2 unsigned integers with the scale of them
provided as the third argument and performs fixed point multiplication on
them.
This is a part of implementing fixed point arithmetic in clang where some of
the more complex operations will be implemented as intrinsics.
Differential Revision: https://reviews.llvm.org/D55625
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353059 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen')
-rw-r--r-- | include/llvm/CodeGen/ISDOpcodes.h | 4 | ||||
-rw-r--r-- | include/llvm/CodeGen/TargetLowering.h | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/include/llvm/CodeGen/ISDOpcodes.h b/include/llvm/CodeGen/ISDOpcodes.h index 8f9957eff9c..89356641b7b 100644 --- a/include/llvm/CodeGen/ISDOpcodes.h +++ b/include/llvm/CodeGen/ISDOpcodes.h @@ -271,12 +271,12 @@ namespace ISD { /// resulting value is this minimum value. SSUBSAT, USUBSAT, - /// RESULT = SMULFIX(LHS, RHS, SCALE) - Perform fixed point multiplication on + /// RESULT = [US]MULFIX(LHS, RHS, SCALE) - Perform fixed point multiplication on /// 2 integers with the same width and scale. SCALE represents the scale of /// both operands as fixed point numbers. This SCALE parameter must be a /// constant integer. A scale of zero is effectively performing /// multiplication on 2 integers. - SMULFIX, + SMULFIX, UMULFIX, /// Simple binary floating point operators. FADD, FSUB, FMUL, FDIV, FREM, diff --git a/include/llvm/CodeGen/TargetLowering.h b/include/llvm/CodeGen/TargetLowering.h index 4a44a9e6c55..4a00556a537 100644 --- a/include/llvm/CodeGen/TargetLowering.h +++ b/include/llvm/CodeGen/TargetLowering.h @@ -836,6 +836,7 @@ public: default: llvm_unreachable("Unexpected fixed point operation."); case ISD::SMULFIX: + case ISD::UMULFIX: Supported = isSupportedFixedPointOperation(Op, VT, Scale); break; } |