blob: b5a045005207c4bf685b2de907713eab5e629ddc [file] [log] [blame] [edit]
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6
; RUN: llc < %s -mtriple=aarch64-unknown-unknown -mattr=+neon,+fullfp16,+fprcvt | FileCheck %s --check-prefixes=CHECK
define double @scvtf_bitcast_f32_to_f64(float %f) nounwind {
; CHECK-LABEL: scvtf_bitcast_f32_to_f64:
; CHECK: // %bb.0:
; CHECK-NEXT: scvtf d0, s0
; CHECK-NEXT: ret
%i = bitcast float %f to i32
%r = sitofp i32 %i to double
ret double %r
}
define double @ucvtf_bitcast_f32_to_f64(float %f) nounwind {
; CHECK-LABEL: ucvtf_bitcast_f32_to_f64:
; CHECK: // %bb.0:
; CHECK-NEXT: ucvtf d0, s0
; CHECK-NEXT: ret
%i = bitcast float %f to i32
%r = uitofp i32 %i to double
ret double %r
}
define half @scvtf_bitcast_f32_to_f16(float %f) nounwind {
; CHECK-LABEL: scvtf_bitcast_f32_to_f16:
; CHECK: // %bb.0:
; CHECK-NEXT: scvtf h0, s0
; CHECK-NEXT: ret
%i = bitcast float %f to i32
%r = sitofp i32 %i to half
ret half %r
}
define half @ucvtf_bitcast_f32_to_f16(float %f) nounwind {
; CHECK-LABEL: ucvtf_bitcast_f32_to_f16:
; CHECK: // %bb.0:
; CHECK-NEXT: ucvtf h0, s0
; CHECK-NEXT: ret
%i = bitcast float %f to i32
%r = uitofp i32 %i to half
ret half %r
}
define float @scvtf_bitcast_f64_to_f32(double %d) nounwind {
; CHECK-LABEL: scvtf_bitcast_f64_to_f32:
; CHECK: // %bb.0:
; CHECK-NEXT: scvtf s0, d0
; CHECK-NEXT: ret
%i = bitcast double %d to i64
%r = sitofp i64 %i to float
ret float %r
}
define float @ucvtf_bitcast_f64_to_f32(double %d) nounwind {
; CHECK-LABEL: ucvtf_bitcast_f64_to_f32:
; CHECK: // %bb.0:
; CHECK-NEXT: ucvtf s0, d0
; CHECK-NEXT: ret
%i = bitcast double %d to i64
%r = uitofp i64 %i to float
ret float %r
}
define half @scvtf_bitcast_f64_to_f16(double %d) nounwind {
; CHECK-LABEL: scvtf_bitcast_f64_to_f16:
; CHECK: // %bb.0:
; CHECK-NEXT: scvtf h0, d0
; CHECK-NEXT: ret
%i = bitcast double %d to i64
%r = sitofp i64 %i to half
ret half %r
}
define half @ucvtf_bitcast_f64_to_f16(double %d) nounwind {
; CHECK-LABEL: ucvtf_bitcast_f64_to_f16:
; CHECK: // %bb.0:
; CHECK-NEXT: ucvtf h0, d0
; CHECK-NEXT: ret
%i = bitcast double %d to i64
%r = uitofp i64 %i to half
ret half %r
}
define float @scvtf_bitcast_f32_to_f32(float %f) nounwind {
; CHECK-LABEL: scvtf_bitcast_f32_to_f32:
; CHECK: // %bb.0:
; CHECK-NEXT: scvtf s0, s0
; CHECK-NEXT: ret
%i = bitcast float %f to i32
%r = sitofp i32 %i to float
ret float %r
}
define float @ucvtf_bitcast_f32_to_f32(float %f) nounwind {
; CHECK-LABEL: ucvtf_bitcast_f32_to_f32:
; CHECK: // %bb.0:
; CHECK-NEXT: ucvtf s0, s0
; CHECK-NEXT: ret
%i = bitcast float %f to i32
%r = uitofp i32 %i to float
ret float %r
}
define double @scvtf_bitcast_f64_to_f64(double %d) nounwind {
; CHECK-LABEL: scvtf_bitcast_f64_to_f64:
; CHECK: // %bb.0:
; CHECK-NEXT: scvtf d0, d0
; CHECK-NEXT: ret
%i = bitcast double %d to i64
%r = sitofp i64 %i to double
ret double %r
}
define double @ucvtf_bitcast_f64_to_f64(double %d) nounwind {
; CHECK-LABEL: ucvtf_bitcast_f64_to_f64:
; CHECK: // %bb.0:
; CHECK-NEXT: ucvtf d0, d0
; CHECK-NEXT: ret
%i = bitcast double %d to i64
%r = uitofp i64 %i to double
ret double %r
}
;
; Also test `strictfp` nodes
;
define double @scvtf_bitcast_f32_to_f64_strict(float %f) nounwind strictfp {
; CHECK-LABEL: scvtf_bitcast_f32_to_f64_strict:
; CHECK: // %bb.0:
; CHECK-NEXT: scvtf d0, s0
; CHECK-NEXT: ret
%i = bitcast float %f to i32
%r = call double @llvm.experimental.constrained.sitofp.f64.i32(i32 %i, metadata !"round.dynamic", metadata !"fpexcept.strict")
ret double %r
}
define double @ucvtf_bitcast_f32_to_f64_strict(float %f) nounwind strictfp {
; CHECK-LABEL: ucvtf_bitcast_f32_to_f64_strict:
; CHECK: // %bb.0:
; CHECK-NEXT: ucvtf d0, s0
; CHECK-NEXT: ret
%i = bitcast float %f to i32
%r = call double @llvm.experimental.constrained.uitofp.f64.i32(i32 %i, metadata !"round.dynamic", metadata !"fpexcept.strict")
ret double %r
}
define half @scvtf_bitcast_f32_to_f16_strict(float %f) nounwind strictfp {
; CHECK-LABEL: scvtf_bitcast_f32_to_f16_strict:
; CHECK: // %bb.0:
; CHECK-NEXT: scvtf h0, s0
; CHECK-NEXT: ret
%i = bitcast float %f to i32
%r = call half @llvm.experimental.constrained.sitofp.f16.i32(i32 %i, metadata !"round.dynamic", metadata !"fpexcept.strict")
ret half %r
}
define half @ucvtf_bitcast_f32_to_f16_strict(float %f) nounwind strictfp {
; CHECK-LABEL: ucvtf_bitcast_f32_to_f16_strict:
; CHECK: // %bb.0:
; CHECK-NEXT: ucvtf h0, s0
; CHECK-NEXT: ret
%i = bitcast float %f to i32
%r = call half @llvm.experimental.constrained.uitofp.f16.i32(i32 %i, metadata !"round.dynamic", metadata !"fpexcept.strict")
ret half %r
}
define float @scvtf_bitcast_f64_to_f32_strict(double %d) nounwind strictfp {
; CHECK-LABEL: scvtf_bitcast_f64_to_f32_strict:
; CHECK: // %bb.0:
; CHECK-NEXT: scvtf s0, d0
; CHECK-NEXT: ret
%i = bitcast double %d to i64
%r = call float @llvm.experimental.constrained.sitofp.f32.i64(i64 %i, metadata !"round.dynamic", metadata !"fpexcept.strict")
ret float %r
}
define float @ucvtf_bitcast_f64_to_f32_strict(double %d) nounwind strictfp {
; CHECK-LABEL: ucvtf_bitcast_f64_to_f32_strict:
; CHECK: // %bb.0:
; CHECK-NEXT: ucvtf s0, d0
; CHECK-NEXT: ret
%i = bitcast double %d to i64
%r = call float @llvm.experimental.constrained.uitofp.f32.i64(i64 %i, metadata !"round.dynamic", metadata !"fpexcept.strict")
ret float %r
}
define half @scvtf_bitcast_f64_to_f16_strict(double %d) nounwind strictfp {
; CHECK-LABEL: scvtf_bitcast_f64_to_f16_strict:
; CHECK: // %bb.0:
; CHECK-NEXT: scvtf h0, d0
; CHECK-NEXT: ret
%i = bitcast double %d to i64
%r = call half @llvm.experimental.constrained.sitofp.f16.i64(i64 %i, metadata !"round.dynamic", metadata !"fpexcept.strict")
ret half %r
}
define half @ucvtf_bitcast_f64_to_f16_strict(double %d) nounwind strictfp {
; CHECK-LABEL: ucvtf_bitcast_f64_to_f16_strict:
; CHECK: // %bb.0:
; CHECK-NEXT: ucvtf h0, d0
; CHECK-NEXT: ret
%i = bitcast double %d to i64
%r = call half @llvm.experimental.constrained.uitofp.f16.i64(i64 %i, metadata !"round.dynamic", metadata !"fpexcept.strict")
ret half %r
}
define float @scvtf_bitcast_f32_to_f32_strict(float %f) nounwind strictfp {
; CHECK-LABEL: scvtf_bitcast_f32_to_f32_strict:
; CHECK: // %bb.0:
; CHECK-NEXT: scvtf s0, s0
; CHECK-NEXT: ret
%i = bitcast float %f to i32
%r = call float @llvm.experimental.constrained.sitofp.f32.i32(i32 %i, metadata !"round.dynamic", metadata !"fpexcept.strict")
ret float %r
}
define float @ucvtf_bitcast_f32_to_f32_strict(float %f) nounwind strictfp {
; CHECK-LABEL: ucvtf_bitcast_f32_to_f32_strict:
; CHECK: // %bb.0:
; CHECK-NEXT: ucvtf s0, s0
; CHECK-NEXT: ret
%i = bitcast float %f to i32
%r = call float @llvm.experimental.constrained.uitofp.f32.i32(i32 %i, metadata !"round.dynamic", metadata !"fpexcept.strict")
ret float %r
}
define double @scvtf_bitcast_f64_to_f64_strict(double %d) nounwind strictfp {
; CHECK-LABEL: scvtf_bitcast_f64_to_f64_strict:
; CHECK: // %bb.0:
; CHECK-NEXT: scvtf d0, d0
; CHECK-NEXT: ret
%i = bitcast double %d to i64
%r = call double @llvm.experimental.constrained.sitofp.f64.i64(i64 %i, metadata !"round.dynamic", metadata !"fpexcept.strict")
ret double %r
}
define double @ucvtf_bitcast_f64_to_f64_strict(double %d) nounwind strictfp {
; CHECK-LABEL: ucvtf_bitcast_f64_to_f64_strict:
; CHECK: // %bb.0:
; CHECK-NEXT: ucvtf d0, d0
; CHECK-NEXT: ret
%i = bitcast double %d to i64
%r = call double @llvm.experimental.constrained.uitofp.f64.i64(i64 %i, metadata !"round.dynamic", metadata !"fpexcept.strict")
ret double %r
}