From 174faa21e9068550ca2eee679103cf7e2393c9a5 Mon Sep 17 00:00:00 2001 From: Bjorn Pettersson Date: Sat, 31 Aug 2019 09:01:16 +0000 Subject: [PATCH] [LangRef] Update saturating examples for llvm.smul.fix.sat. NFC Some saturation examples for llvm.smul.fix.sat were not showing the correct result. I've adjusted the operands to make sure that we actually trigger overflow in those examples. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370566 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/LangRef.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/LangRef.rst b/docs/LangRef.rst index 39095303361..f35ceb8518f 100644 --- a/docs/LangRef.rst +++ b/docs/LangRef.rst @@ -13754,9 +13754,9 @@ Examples ; Saturation %res = call i4 @llvm.smul.fix.sat.i4(i4 7, i4 2, i32 0) ; %res = 7 - %res = call i4 @llvm.smul.fix.sat.i4(i4 7, i4 2, i32 2) ; %res = 7 - %res = call i4 @llvm.smul.fix.sat.i4(i4 -8, i4 2, i32 2) ; %res = -8 - %res = call i4 @llvm.smul.fix.sat.i4(i4 -8, i4 -2, i32 2) ; %res = 7 + %res = call i4 @llvm.smul.fix.sat.i4(i4 7, i4 4, i32 2) ; %res = 7 + %res = call i4 @llvm.smul.fix.sat.i4(i4 -8, i4 5, i32 2) ; %res = -8 + %res = call i4 @llvm.smul.fix.sat.i4(i4 -8, i4 -2, i32 1) ; %res = 7 ; Scale can affect the saturation result %res = call i4 @llvm.smul.fix.sat.i4(i4 2, i4 4, i32 0) ; %res = 7 (2 x 4 -> clamped to 7) -- 2.40.0