Home | History | Annotate | Download | only in SystemZ
      1 ; Test rint()-like rounding, with non-integer values triggering an
      2 ; inexact condition.
      3 ;
      4 ; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
      5 
      6 ; Test f32.
      7 declare float @llvm.rint.f32(float %f)
      8 define float @f1(float %f) {
      9 ; CHECK-LABEL: f1:
     10 ; CHECK: fiebr %f0, 0, %f0
     11 ; CHECK: br %r14
     12   %res = call float @llvm.rint.f32(float %f)
     13   ret float %res
     14 }
     15 
     16 ; Test f64.
     17 declare double @llvm.rint.f64(double %f)
     18 define double @f2(double %f) {
     19 ; CHECK-LABEL: f2:
     20 ; CHECK: fidbr %f0, 0, %f0
     21 ; CHECK: br %r14
     22   %res = call double @llvm.rint.f64(double %f)
     23   ret double %res
     24 }
     25 
     26 ; Test f128.
     27 declare fp128 @llvm.rint.f128(fp128 %f)
     28 define void @f3(fp128 *%ptr) {
     29 ; CHECK-LABEL: f3:
     30 ; CHECK: fixbr %f0, 0, %f0
     31 ; CHECK: br %r14
     32   %src = load fp128 *%ptr
     33   %res = call fp128 @llvm.rint.f128(fp128 %src)
     34   store fp128 %res, fp128 *%ptr
     35   ret void
     36 }
     37