diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2018-07-28 10:51:19 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2018-07-28 10:51:19 +0000 |
| commit | eb11fae6d08f479c0799db45860a98af528fa6e7 (patch) | |
| tree | 44d492a50c8c1a7eb8e2d17ea3360ec4d066f042 /test/CodeGen/AArch64/ftrunc.ll | |
| parent | b8a2042aa938069e862750553db0e4d82d25822c (diff) | |
Notes
Diffstat (limited to 'test/CodeGen/AArch64/ftrunc.ll')
| -rw-r--r-- | test/CodeGen/AArch64/ftrunc.ll | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/test/CodeGen/AArch64/ftrunc.ll b/test/CodeGen/AArch64/ftrunc.ll new file mode 100644 index 000000000000..c7bf514e902b --- /dev/null +++ b/test/CodeGen/AArch64/ftrunc.ll @@ -0,0 +1,45 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc -mtriple=aarch64-unknown-unknown < %s | FileCheck %s + +define float @trunc_unsigned_f32(float %x) #0 { +; CHECK-LABEL: trunc_unsigned_f32: +; CHECK: // %bb.0: +; CHECK-NEXT: frintz s0, s0 +; CHECK-NEXT: ret + %i = fptoui float %x to i32 + %r = uitofp i32 %i to float + ret float %r +} + +define double @trunc_unsigned_f64(double %x) #0 { +; CHECK-LABEL: trunc_unsigned_f64: +; CHECK: // %bb.0: +; CHECK-NEXT: frintz d0, d0 +; CHECK-NEXT: ret + %i = fptoui double %x to i64 + %r = uitofp i64 %i to double + ret double %r +} + +define float @trunc_signed_f32(float %x) #0 { +; CHECK-LABEL: trunc_signed_f32: +; CHECK: // %bb.0: +; CHECK-NEXT: frintz s0, s0 +; CHECK-NEXT: ret + %i = fptosi float %x to i32 + %r = sitofp i32 %i to float + ret float %r +} + +define double @trunc_signed_f64(double %x) #0 { +; CHECK-LABEL: trunc_signed_f64: +; CHECK: // %bb.0: +; CHECK-NEXT: frintz d0, d0 +; CHECK-NEXT: ret + %i = fptosi double %x to i64 + %r = sitofp i64 %i to double + ret double %r +} + +attributes #0 = { "no-signed-zeros-fp-math"="true" } + |
