1 ; RUN: llc < %s -asm-verbose=false -mcpu=mvp -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers | FileCheck %s
3 ; Test various types and operators that need to be legalized.
5 target triple = "wasm32-unknown-unknown"
8 ; CHECK: i32.const $push0=, 7{{$}}
9 ; CHECK: i32.and $push1=, $1, $pop0{{$}}
10 ; CHECK: i32.shl $push2=, $0, $pop1{{$}}
11 define i3 @shl_i3(i3 %a, i3 %b, ptr %p) {
16 ; CHECK-LABEL: shl_i53:
17 ; CHECK: i64.const $push0=, 9007199254740991{{$}}
18 ; CHECK: i64.and $push1=, $1, $pop0{{$}}
19 ; CHECK: i64.shl $push2=, $0, $pop1{{$}}
20 define i53 @shl_i53(i53 %a, i53 %b, ptr %p) {
25 ; CHECK-LABEL: sext_in_reg_i32_i64:
28 define i64 @sext_in_reg_i32_i64(i64 %a) {
34 ; CHECK-LABEL: fpext_f32_f64:
35 ; CHECK: f32.load $push0=, 0($0){{$}}
36 ; CHECK: f64.promote_f32 $push1=, $pop0{{$}}
37 ; CHECK: return $pop1{{$}}
38 define double @fpext_f32_f64(ptr %p) {
39 %v = load float, ptr %p
40 %e = fpext float %v to double
44 ; CHECK-LABEL: fpconv_f64_f32:
45 ; CHECK: f64.load $push0=, 0($0){{$}}
46 ; CHECK: f32.demote_f64 $push1=, $pop0{{$}}
47 ; CHECK: return $pop1{{$}}
48 define float @fpconv_f64_f32(ptr %p) {
49 %v = load double, ptr %p
50 %e = fptrunc double %v to float
54 ; Check that big shifts work. This generates a big pile of code from the
55 ; legalizer; the main thing here is that we don't abort.
57 ; CHECK-LABEL: bigshift:
58 define i1024 @bigshift(i1024 %a, i1024 %b) {