blob: aa655aeb16fa320355a24c0cb225eec9edf88221 [file] [log] [blame]
Wouter van Oortmerssen8a9cb242018-08-27 15:45:51 +00001; RUN: llc -asm-verbose=false < %s -wasm-keep-registers | FileCheck %s
Dan Gohmanb17de642018-05-31 22:27:24 +00002
3; Test that 128-bit smul.with.overflow assembles as expected.
4
5target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
6target triple = "wasm32-unknown-unknown"
7
8define i128 @call_muloti4(i128 %a, i128 %b) nounwind {
9entry:
10 %smul = tail call { i128, i1 } @llvm.smul.with.overflow.i128(i128 %a, i128 %b)
11 %cmp = extractvalue { i128, i1 } %smul, 1
12 %smul.result = extractvalue { i128, i1 } %smul, 0
13 %X = select i1 %cmp, i128 %smul.result, i128 42
14 ret i128 %X
15}
16
17; CHECK: call __muloti4@FUNCTION, $pop{{[0-9]*}}, $pop{{[0-9]*}}, $pop{{[0-9]*}}, $pop{{[0-9]*}}, $pop{{[0-9]*}}, $pop{{[0-9]*}}{{$}}
18
19declare { i128, i1 } @llvm.smul.with.overflow.i128(i128, i128) nounwind readnone