Wouter van Oortmerssen | 8a9cb24 | 2018-08-27 15:45:51 +0000 | [diff] [blame] | 1 | ; RUN: llc -asm-verbose=false < %s -wasm-keep-registers | FileCheck %s |
Dan Gohman | b17de64 | 2018-05-31 22:27:24 +0000 | [diff] [blame] | 2 | |
| 3 | ; Test that 128-bit smul.with.overflow assembles as expected. |
| 4 | |
| 5 | target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" |
| 6 | target triple = "wasm32-unknown-unknown" |
| 7 | |
| 8 | define i128 @call_muloti4(i128 %a, i128 %b) nounwind { |
| 9 | entry: |
| 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 | |
| 19 | declare { i128, i1 } @llvm.smul.with.overflow.i128(i128, i128) nounwind readnone |