2018-08-27 23:45:51 +08:00
|
|
|
; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-keep-registers | FileCheck %s
|
|
|
|
; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-keep-registers -fast-isel | FileCheck %s
|
2017-02-23 00:28:00 +08:00
|
|
|
|
|
|
|
; Test that f16 is expanded.
|
|
|
|
|
|
|
|
target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
|
2018-05-11 01:49:11 +08:00
|
|
|
target triple = "wasm32-unknown-unknown"
|
2017-02-23 00:28:00 +08:00
|
|
|
|
2019-05-01 03:17:59 +08:00
|
|
|
; CHECK-LABEL: demote.f32:
|
|
|
|
; CHECK-NEXT: .functype demote.f32 (f32) -> (f32){{$}}
|
2019-01-08 14:25:55 +08:00
|
|
|
; CHECK-NEXT: local.get $push[[L0:[0-9]+]]=, 0{{$}}
|
[WebAssembly] Replace all calls with generalized multivalue calls
Summary:
Extends the multivalue call infrastructure to tail calls, removes all
legacy calls specialized for particular result types, and removes the
CallIndirectFixup pass, since all indirect call arguments are now
fixed up directly in the post-insertion hook.
In order to keep supporting pretty-printed defs and uses in test
expectations, MCInstLower now inserts an immediate containing the
number of defs for each call and call_indirect. The InstPrinter is
updated to query this immediate if it is present and determine which
MCOperands are defs and uses accordingly.
Depends on D72902.
Reviewers: aheejin
Subscribers: dschuff, mgorny, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74192
2020-02-07 08:29:59 +08:00
|
|
|
; CHECK-NEXT: call $push[[L1:[0-9]+]]=, __truncsfhf2, $pop[[L0]]{{$}}
|
|
|
|
; CHECK-NEXT: call $push[[L2:[0-9]+]]=, __extendhfsf2, $pop[[L1]]{{$}}
|
2017-02-23 00:28:00 +08:00
|
|
|
; CHECK-NEXT: return $pop[[L2]]{{$}}
|
2019-05-01 03:17:59 +08:00
|
|
|
define half @demote.f32(float %f) {
|
2017-02-23 00:28:00 +08:00
|
|
|
%t = fptrunc float %f to half
|
|
|
|
ret half %t
|
|
|
|
}
|
|
|
|
|
2019-05-01 03:17:59 +08:00
|
|
|
; CHECK-LABEL: promote.f32:
|
|
|
|
; CHECK-NEXT: .functype promote.f32 (f32) -> (f32){{$}}
|
2019-01-08 14:25:55 +08:00
|
|
|
; CHECK-NEXT: local.get $push0=, 0{{$}}
|
2017-02-23 00:28:00 +08:00
|
|
|
; CHECK-NEXT: return $pop0{{$}}
|
2019-05-01 03:17:59 +08:00
|
|
|
define float @promote.f32(half %f) {
|
2017-02-23 00:28:00 +08:00
|
|
|
%t = fpext half %f to float
|
|
|
|
ret float %t
|
|
|
|
}
|
2019-05-01 03:17:59 +08:00
|
|
|
|
|
|
|
; CHECK-LABEL: demote.f64:
|
|
|
|
; CHECK-NEXT: .functype demote.f64 (f64) -> (f32){{$}}
|
|
|
|
; CHECK-NEXT: local.get $push[[L0:[0-9]+]]=, 0{{$}}
|
[WebAssembly] Replace all calls with generalized multivalue calls
Summary:
Extends the multivalue call infrastructure to tail calls, removes all
legacy calls specialized for particular result types, and removes the
CallIndirectFixup pass, since all indirect call arguments are now
fixed up directly in the post-insertion hook.
In order to keep supporting pretty-printed defs and uses in test
expectations, MCInstLower now inserts an immediate containing the
number of defs for each call and call_indirect. The InstPrinter is
updated to query this immediate if it is present and determine which
MCOperands are defs and uses accordingly.
Depends on D72902.
Reviewers: aheejin
Subscribers: dschuff, mgorny, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74192
2020-02-07 08:29:59 +08:00
|
|
|
; CHECK-NEXT: call $push[[L1:[0-9]+]]=, __truncdfhf2, $pop[[L0]]{{$}}
|
|
|
|
; CHECK-NEXT: call $push[[L2:[0-9]+]]=, __extendhfsf2, $pop[[L1]]{{$}}
|
2019-05-01 03:17:59 +08:00
|
|
|
; CHECK-NEXT: return $pop[[L2]]{{$}}
|
|
|
|
define half @demote.f64(double %f) {
|
|
|
|
%t = fptrunc double %f to half
|
|
|
|
ret half %t
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK-LABEL: promote.f64:
|
|
|
|
; CHECK-NEXT: .functype promote.f64 (f32) -> (f64){{$}}
|
|
|
|
; CHECK-NEXT: local.get $push[[L0:[0-9]+]]=, 0{{$}}
|
|
|
|
; CHECK-NEXT: f64.promote_f32 $push[[L1:[0-9]+]]=, $pop[[L0]]{{$}}
|
|
|
|
; CHECK-NEXT: return $pop[[L1]]{{$}}
|
|
|
|
define double @promote.f64(half %f) {
|
|
|
|
%t = fpext half %f to double
|
|
|
|
ret double %t
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK-LABEL: demote.f128:
|
|
|
|
; CHECK-NEXT: .functype demote.f128 (i64, i64) -> (f32){{$}}
|
|
|
|
; CHECK-NEXT: local.get $push[[L0:[0-9]+]]=, 0{{$}}
|
|
|
|
; CHECK-NEXT: local.get $push[[L1:[0-9]+]]=, 1{{$}}
|
[WebAssembly] Replace all calls with generalized multivalue calls
Summary:
Extends the multivalue call infrastructure to tail calls, removes all
legacy calls specialized for particular result types, and removes the
CallIndirectFixup pass, since all indirect call arguments are now
fixed up directly in the post-insertion hook.
In order to keep supporting pretty-printed defs and uses in test
expectations, MCInstLower now inserts an immediate containing the
number of defs for each call and call_indirect. The InstPrinter is
updated to query this immediate if it is present and determine which
MCOperands are defs and uses accordingly.
Depends on D72902.
Reviewers: aheejin
Subscribers: dschuff, mgorny, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74192
2020-02-07 08:29:59 +08:00
|
|
|
; CHECK-NEXT: call $push[[L2:[0-9]+]]=, __trunctfhf2, $pop[[L0]], $pop[[L1]]{{$}}
|
|
|
|
; CHECK-NEXT: call $push[[L3:[0-9]+]]=, __extendhfsf2, $pop[[L2]]{{$}}
|
2019-05-01 03:17:59 +08:00
|
|
|
; CHECK-NEXT: return $pop[[L3]]{{$}}
|
|
|
|
define half @demote.f128(fp128 %f) {
|
|
|
|
%t = fptrunc fp128 %f to half
|
|
|
|
ret half %t
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK-LABEL: promote.f128:
|
|
|
|
; CHECK-NEXT: .functype promote.f128 (i32, f32) -> (){{$}}
|
|
|
|
; CHECK: call __extendsftf2
|
|
|
|
; CHECK: i64.store
|
|
|
|
; CHECK: i64.store
|
|
|
|
define fp128 @promote.f128(half %f) {
|
|
|
|
%t = fpext half %f to fp128
|
|
|
|
ret fp128 %t
|
|
|
|
}
|