blob: 6915f93e9b96d9dc9f7949b3935dfb414d93c4b1 [file] [log] [blame]
Dan Gohmana63e8eb2017-02-22 16:28:00 +00001; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt | FileCheck %s
Dan Gohman6999c4f2017-02-24 21:05:35 +00002; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -fast-isel | FileCheck %s
Dan Gohmana63e8eb2017-02-22 16:28:00 +00003
4; Test that f16 is expanded.
5
6target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
7target triple = "wasm32-unknown-unknown-wasm"
8
9; CHECK-LABEL: demote:
10; CHECK-NEXT: .param f32{{$}}
11; CHECK-NEXT: .result f32{{$}}
12; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}}
13; CHECK-NEXT: i32.call $push[[L1:[0-9]+]]=, __gnu_f2h_ieee@FUNCTION, $pop[[L0]]{{$}}
14; CHECK-NEXT: f32.call $push[[L2:[0-9]+]]=, __gnu_h2f_ieee@FUNCTION, $pop[[L1]]{{$}}
15; CHECK-NEXT: return $pop[[L2]]{{$}}
16define half @demote(float %f) {
17 %t = fptrunc float %f to half
18 ret half %t
19}
20
21; CHECK-LABEL: promote:
22; CHECK-NEXT: .param f32{{$}}
23; CHECK-NEXT: .result f32{{$}}
24; CHECK-NEXT: get_local $push0=, 0{{$}}
25; CHECK-NEXT: return $pop0{{$}}
26define float @promote(half %f) {
27 %t = fpext half %f to float
28 ret float %t
29}