1 ; RUN: llc < %s -asm-verbose=false -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 datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
6 target triple = "wasm32-unknown-unknown"
9 ; CHECK: i32.const $push0=, 7{{$}}
10 ; CHECK: i32.and $push1=, $1, $pop0{{$}}
11 ; CHECK: i32.shl $push2=, $0, $pop1{{$}}
12 define i3 @shl_i3(i3 %a, i3 %b, i3* %p) {
17 ; CHECK-LABEL: shl_i53:
18 ; CHECK: i64.const $push0=, 9007199254740991{{$}}
19 ; CHECK: i64.and $push1=, $1, $pop0{{$}}
20 ; CHECK: i64.shl $push2=, $0, $pop1{{$}}
21 define i53 @shl_i53(i53 %a, i53 %b, i53* %p) {
26 ; CHECK-LABEL: sext_in_reg_i32_i64:
29 define i64 @sext_in_reg_i32_i64(i64 %a) {
35 ; CHECK-LABEL: fpext_f32_f64:
36 ; CHECK: f32.load $push0=, 0($0){{$}}
37 ; CHECK: f64.promote_f32 $push1=, $pop0{{$}}
38 ; CHECK: return $pop1{{$}}
39 define double @fpext_f32_f64(float *%p) {
40 %v = load float, float* %p
41 %e = fpext float %v to double
45 ; CHECK-LABEL: fpconv_f64_f32:
46 ; CHECK: f64.load $push0=, 0($0){{$}}
47 ; CHECK: f32.demote_f64 $push1=, $pop0{{$}}
48 ; CHECK: return $pop1{{$}}
49 define float @fpconv_f64_f32(double *%p) {
50 %v = load double, double* %p
51 %e = fptrunc double %v to float
55 ; Check that big shifts work. This generates a big pile of code from the
56 ; legalizer; the main thing here is that we don't abort.
58 ; CHECK-LABEL: bigshift:
59 define i1024 @bigshift(i1024 %a, i1024 %b) {