]> granicus.if.org Git - llvm/commit
[Intrinsic] Add the llvm.umul.fix.sat intrinsic
authorBjorn Pettersson <bjorn.a.pettersson@ericsson.com>
Sat, 7 Sep 2019 12:16:14 +0000 (12:16 +0000)
committerBjorn Pettersson <bjorn.a.pettersson@ericsson.com>
Sat, 7 Sep 2019 12:16:14 +0000 (12:16 +0000)
commit2d0b4264f327bb23fd225b7f20ceff8b24ce5072
tree852f673d77daeadbe242fa209e641f9d64937692
parentdf591a43ba24bb1e93b7480c079f5ea2a58592b6
[Intrinsic] Add the llvm.umul.fix.sat intrinsic

Summary:
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. The
result is saturated and clamped between the largest and
smallest representable values of the first 2 operands.

This is a part of implementing fixed point arithmetic
in clang where some of the more complex operations
will be implemented as intrinsics.

Patch by: leonardchan, bjope

Reviewers: RKSimon, craig.topper, bevinh, leonardchan, lebedev.ri, spatel

Reviewed By: leonardchan

Subscribers: ychen, wuzish, nemanjai, MaskRay, jsji, jdoerfert, Ka-Ka, hiraditya, rjmccall, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D57836

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371308 91177308-0d34-0410-b5e6-96231b3b80d8
22 files changed:
docs/LangRef.rst
include/llvm/CodeGen/ISDOpcodes.h
include/llvm/CodeGen/TargetLowering.h
include/llvm/IR/Intrinsics.td
include/llvm/Target/TargetSelectionDAG.td
lib/Analysis/VectorUtils.cpp
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp
lib/CodeGen/SelectionDAG/TargetLowering.cpp
lib/CodeGen/TargetLoweringBase.cpp
lib/IR/Verifier.cpp
test/CodeGen/PowerPC/umulfixsat.ll [new file with mode: 0644]
test/CodeGen/X86/mulfix_combine.ll
test/CodeGen/X86/umul_fix_sat.ll [new file with mode: 0644]
test/CodeGen/X86/vector-mulfix-legalize.ll
test/Transforms/Scalarizer/intrinsics.ll
test/Verifier/intrinsic-immarg.ll