From 99b90b9e5cb6dfea9e59d37aa8cbe4a9e49c58fb 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. llvm-svn: 370566 --- 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)