xref: /llvm-project/llvm/test/CodeGen/WebAssembly/muloti4.ll (revision 122b0220fd45ee71acda912b0b712bb8edb6ba46)
1; RUN: llc -asm-verbose=false < %s -wasm-keep-registers | FileCheck %s
2
3; Test that 128-bit smul.with.overflow assembles as expected.
4
5target triple = "wasm32-unknown-unknown"
6
7define i128 @call_muloti4(i128 %a, i128 %b) nounwind {
8entry:
9  %smul = tail call { i128, i1 } @llvm.smul.with.overflow.i128(i128 %a, i128 %b)
10  %cmp = extractvalue { i128, i1 } %smul, 1
11  %smul.result = extractvalue { i128, i1 } %smul, 0
12  %X = select i1 %cmp, i128 %smul.result, i128 42
13  ret i128 %X
14}
15
16; CHECK: call __muloti4, $pop{{[0-9]*}}, $pop{{[0-9]*}}, $pop{{[0-9]*}}, $pop{{[0-9]*}}, $pop{{[0-9]*}}, $pop{{[0-9]*}}{{$}}
17
18declare { i128, i1 } @llvm.smul.with.overflow.i128(i128, i128) nounwind readnone
19