1 ; RUN: llc -O0 -fast-isel -verify-machineinstrs -mtriple=arm64-eabi < %s | FileCheck --enable-var-scope %s
4 define i32 @fptosi_wh(half %a) nounwind ssp {
6 ; CHECK-LABEL: fptosi_wh
7 ; CHECK: fcvt [[REG:s[0-9]+]], h0
8 ; CHECK: fcvtzs w0, [[REG]]
9 %conv = fptosi half %a to i32
14 define i32 @fptoui_swh(half %a) nounwind ssp {
16 ; CHECK-LABEL: fptoui_swh
17 ; CHECK: fcvt [[REG:s[0-9]+]], h0
18 ; CHECK: fcvtzu w0, [[REG]]
19 %conv = fptoui half %a to i32
24 define half @sitofp_hw_i1(i1 %a) nounwind ssp {
26 ; CHECK-LABEL: sitofp_hw_i1
27 ; CHECK: sbfx [[REG:w[0-9]+]], w0, #0, #1
28 ; CHECK: scvtf s0, [[REG]]
30 %conv = sitofp i1 %a to half
35 define half @sitofp_hw_i8(i8 %a) nounwind ssp {
37 ; CHECK-LABEL: sitofp_hw_i8
38 ; CHECK: sxtb [[REG:w[0-9]+]], w0
39 ; CHECK: scvtf s0, [[REG]]
41 %conv = sitofp i8 %a to half
46 define half @sitofp_hw_i16(i16 %a) nounwind ssp {
48 ; CHECK-LABEL: sitofp_hw_i16
49 ; CHECK: sxth [[REG:w[0-9]+]], w0
50 ; CHECK: scvtf s0, [[REG]]
52 %conv = sitofp i16 %a to half
57 define half @sitofp_hw_i32(i32 %a) nounwind ssp {
59 ; CHECK-LABEL: sitofp_hw_i32
62 %conv = sitofp i32 %a to half
67 define half @sitofp_hx(i64 %a) nounwind ssp {
69 ; CHECK-LABEL: sitofp_hx
72 %conv = sitofp i64 %a to half
77 define half @uitofp_hw_i1(i1 %a) nounwind ssp {
79 ; CHECK-LABEL: uitofp_hw_i1
80 ; CHECK: and [[REG:w[0-9]+]], w0, #0x1
81 ; CHECK: ucvtf s0, [[REG]]
83 %conv = uitofp i1 %a to half
88 define half @uitofp_hw_i8(i8 %a) nounwind ssp {
90 ; CHECK-LABEL: uitofp_hw_i8
91 ; CHECK: and [[REG:w[0-9]+]], w0, #0xff
92 ; CHECK: ucvtf s0, [[REG]]
94 %conv = uitofp i8 %a to half
99 define half @uitofp_hw_i16(i16 %a) nounwind ssp {
101 ; CHECK-LABEL: uitofp_hw_i16
102 ; CHECK: and [[REG:w[0-9]+]], w0, #0xffff
103 ; CHECK: ucvtf s0, [[REG]]
105 %conv = uitofp i16 %a to half
110 define half @uitofp_hw_i32(i32 %a) nounwind ssp {
112 ; CHECK-LABEL: uitofp_hw_i32
113 ; CHECK: ucvtf s0, w0
115 %conv = uitofp i32 %a to half
120 define half @uitofp_hx(i64 %a) nounwind ssp {
122 ; CHECK-LABEL: uitofp_hx
123 ; CHECK: ucvtf s0, x0
125 %conv = uitofp i64 %a to half