void test(void) {
  do {
    do {
      volatile double a = 1.5, b;
      b = __builtin_rint(a);
    } while (0);
    do {
      volatile float a = 1.5, b;
      b = __builtin_rintf(a);
    } while (0);
    do {
      volatile long double a = 1.5, b;
      b = __builtin_rintl(a);
    } while (0);
  } while (0);
  do {
    do {
      volatile double a = 1.5, b;
      b = __builtin_ceil(a);
    } while (0);
    do {
      volatile float a = 1.5, b;
      b = __builtin_ceilf(a);
    } while (0);
    do {
      volatile long double a = 1.5, b;
      b = __builtin_ceill(a);
    } while (0);
  } while (0);
  do {
    do {
      volatile double a = 1.5, b;
      b = __builtin_floor(a);
    } while (0);
    do {
      volatile float a = 1.5, b;
      b = __builtin_floorf(a);
    } while (0);
    do {
      volatile long double a = 1.5, b;
      b = __builtin_floorl(a);
    } while (0);
  } while (0);
  do {
    do {
      volatile double a = 1.5, b;
      b = __builtin_trunc(a);
    } while (0);
    do {
      volatile float a = 1.5, b;
      b = __builtin_truncf(a);
    } while (0);
    do {
      volatile long double a = 1.5, b;
      b = __builtin_truncl(a);
    } while (0);
  } while (0);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
jmp    11d0 <test+0x10>
movsd  0xe28(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <rint@plt>
movsd  %xmm0,-0x10(%rbp)
jmp    11f1 <test+0x31>
movss  0xe0f(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
call   1070 <rintf@plt>
movss  %xmm0,-0x18(%rbp)
jmp    1212 <test+0x52>
flds   0xdf0(%rip)
fstpt  -0x30(%rbp)
fldt   -0x30(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1060 <rintl@plt>
fstpt  -0x40(%rbp)
jmp    1230 <test+0x70>
jmp    1235 <test+0x75>
jmp    123a <test+0x7a>
movsd  0xdbe(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
call   1030 <ceil@plt>
movsd  %xmm0,-0x50(%rbp)
jmp    125b <test+0x9b>
movss  0xda5(%rip),%xmm0
movss  %xmm0,-0x54(%rbp)
movss  -0x54(%rbp),%xmm0
call   1090 <ceilf@plt>
movss  %xmm0,-0x58(%rbp)
jmp    127c <test+0xbc>
flds   0xd86(%rip)
fstpt  -0x70(%rbp)
fldt   -0x70(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1080 <ceill@plt>
fstpt  -0x80(%rbp)
jmp    129a <test+0xda>
jmp    129f <test+0xdf>
jmp    12a4 <test+0xe4>
movsd  0xd54(%rip),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
call   10e0 <floor@plt>
movsd  %xmm0,-0x90(%rbp)
ff
jmp    12ce <test+0x10e>
movss  0xd32(%rip),%xmm0
movss  %xmm0,-0x94(%rbp)
ff
movss  -0x94(%rbp),%xmm0
ff
call   1040 <floorf@plt>
movss  %xmm0,-0x98(%rbp)
ff
jmp    12f8 <test+0x138>
flds   0xd0a(%rip)
fstpt  -0xb0(%rbp)
fldt   -0xb0(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   10d0 <floorl@plt>
fstpt  -0xc0(%rbp)
jmp    131f <test+0x15f>
jmp    1324 <test+0x164>
jmp    1329 <test+0x169>
movsd  0xccf(%rip),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0xc8(%rbp),%xmm0
ff
call   10a0 <trunc@plt>
movsd  %xmm0,-0xd0(%rbp)
ff
jmp    1353 <test+0x193>
movss  0xcad(%rip),%xmm0
movss  %xmm0,-0xd4(%rbp)
ff
movss  -0xd4(%rbp),%xmm0
ff
call   10c0 <truncf@plt>
movss  %xmm0,-0xd8(%rbp)
ff
jmp    137d <test+0x1bd>
flds   0xc85(%rip)
fstpt  -0xf0(%rbp)
fldt   -0xf0(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   10b0 <truncl@plt>
fstpt  -0x100(%rbp)
jmp    13a4 <test+0x1e4>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
sub    $0x40,%rsp
movabs $0x3ff8000000000000,%rbx
mov    %rbx,0x10(%rsp)
movsd  0x10(%rsp),%xmm0
call   1050 <rint@plt>
movsd  %xmm0,0x20(%rsp)
movl   $0x3fc00000,0x10(%rsp)
3f
movss  0x10(%rsp),%xmm0
call   1070 <rintf@plt>
movss  %xmm0,0x20(%rsp)
flds   0xdfc(%rip)
fld    %st(0)
fstpt  0x34(%rsp)
fstpt  0x10(%rsp)
fldt   0x10(%rsp)
fstpt  (%rsp)
call   1060 <rintl@plt>
fstpt  0x20(%rsp)
mov    %rbx,0x10(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <ceil@plt>
movsd  %xmm0,0x20(%rsp)
movl   $0x3fc00000,0x10(%rsp)
3f
movss  0x10(%rsp),%xmm0
call   1090 <ceilf@plt>
movss  %xmm0,0x20(%rsp)
fldt   0x34(%rsp)
fstpt  0x10(%rsp)
fldt   0x10(%rsp)
fstpt  (%rsp)
call   1080 <ceill@plt>
fstpt  0x20(%rsp)
mov    %rbx,0x10(%rsp)
movsd  0x10(%rsp),%xmm0
call   10e0 <floor@plt>
movsd  %xmm0,0x20(%rsp)
movl   $0x3fc00000,0x10(%rsp)
3f
movss  0x10(%rsp),%xmm0
call   1040 <floorf@plt>
movss  %xmm0,0x20(%rsp)
fldt   0x34(%rsp)
fstpt  0x10(%rsp)
fldt   0x10(%rsp)
fstpt  (%rsp)
call   10d0 <floorl@plt>
fstpt  0x20(%rsp)
mov    %rbx,0x10(%rsp)
movsd  0x10(%rsp),%xmm0
call   10a0 <trunc@plt>
movsd  %xmm0,0x20(%rsp)
movl   $0x3fc00000,0x10(%rsp)
3f
movss  0x10(%rsp),%xmm0
call   10c0 <truncf@plt>
movss  %xmm0,0x20(%rsp)
fldt   0x34(%rsp)
fstpt  0x10(%rsp)
fldt   0x10(%rsp)
fstpt  (%rsp)
call   10b0 <truncl@plt>
fstpt  0x20(%rsp)
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @test() {
%1 = alloca double
%2 = alloca double
%3 = alloca float
%4 = alloca float
%5 = alloca x86_fp80
%6 = alloca x86_fp80
%7 = alloca double
%8 = alloca double
%9 = alloca float
%10 = alloca float
%11 = alloca x86_fp80
%12 = alloca x86_fp80
%13 = alloca double
%14 = alloca double
%15 = alloca float
%16 = alloca float
%17 = alloca x86_fp80
%18 = alloca x86_fp80
%19 = alloca double
%20 = alloca double
%21 = alloca float
%22 = alloca float
%23 = alloca x86_fp80
%24 = alloca x86_fp80
br label %25
25: ; preds = %0
br label %26
26: ; preds = %25
store volatile double 1.500000e+00, double* %1
%27 = load volatile double, double* %1
%28 = call double @llvm.rint.f64(double %27)
store volatile double %28, double* %2
br label %29
29: ; preds = %26
br label %30
30: ; preds = %29
store volatile float 1.500000e+00, float* %3
%31 = load volatile float, float* %3
%32 = call float @llvm.rint.f32(float %31)
store volatile float %32, float* %4
br label %33
33: ; preds = %30
br label %34
34: ; preds = %33
store volatile x86_fp80 0xK3FFFC000000000000000, x86_fp80* %5
%35 = load volatile x86_fp80, x86_fp80* %5
%36 = call x86_fp80 @llvm.rint.f80(x86_fp80 %35)
store volatile x86_fp80 %36, x86_fp80* %6
br label %37
37: ; preds = %34
br label %38
38: ; preds = %37
br label %39
39: ; preds = %38
br label %40
40: ; preds = %39
store volatile double 1.500000e+00, double* %7
%41 = load volatile double, double* %7
%42 = call double @llvm.ceil.f64(double %41)
store volatile double %42, double* %8
br label %43
43: ; preds = %40
br label %44
44: ; preds = %43
store volatile float 1.500000e+00, float* %9
%45 = load volatile float, float* %9
%46 = call float @llvm.ceil.f32(float %45)
store volatile float %46, float* %10
br label %47
47: ; preds = %44
br label %48
48: ; preds = %47
store volatile x86_fp80 0xK3FFFC000000000000000, x86_fp80* %11
%49 = load volatile x86_fp80, x86_fp80* %11
%50 = call x86_fp80 @llvm.ceil.f80(x86_fp80 %49)
store volatile x86_fp80 %50, x86_fp80* %12
br label %51
51: ; preds = %48
br label %52
52: ; preds = %51
br label %53
53: ; preds = %52
br label %54
54: ; preds = %53
store volatile double 1.500000e+00, double* %13
%55 = load volatile double, double* %13
%56 = call double @llvm.floor.f64(double %55)
store volatile double %56, double* %14
br label %57
57: ; preds = %54
br label %58
58: ; preds = %57
store volatile float 1.500000e+00, float* %15
%59 = load volatile float, float* %15
%60 = call float @llvm.floor.f32(float %59)
store volatile float %60, float* %16
br label %61
61: ; preds = %58
br label %62
62: ; preds = %61
store volatile x86_fp80 0xK3FFFC000000000000000, x86_fp80* %17
%63 = load volatile x86_fp80, x86_fp80* %17
%64 = call x86_fp80 @llvm.floor.f80(x86_fp80 %63)
store volatile x86_fp80 %64, x86_fp80* %18
br label %65
65: ; preds = %62
br label %66
66: ; preds = %65
br label %67
67: ; preds = %66
br label %68
68: ; preds = %67
store volatile double 1.500000e+00, double* %19
%69 = load volatile double, double* %19
%70 = call double @llvm.trunc.f64(double %69)
store volatile double %70, double* %20
br label %71
71: ; preds = %68
br label %72
72: ; preds = %71
store volatile float 1.500000e+00, float* %21
%73 = load volatile float, float* %21
%74 = call float @llvm.trunc.f32(float %73)
store volatile float %74, float* %22
br label %75
75: ; preds = %72
br label %76
76: ; preds = %75
store volatile x86_fp80 0xK3FFFC000000000000000, x86_fp80* %23
%77 = load volatile x86_fp80, x86_fp80* %23
%78 = call x86_fp80 @llvm.trunc.f80(x86_fp80 %77)
store volatile x86_fp80 %78, x86_fp80* %24
br label %79
79: ; preds = %76
br label %80
80: ; preds = %79
ret void
}

LLVM IR (-O2):
define void @test() {
%1 = alloca double
%2 = alloca double
%3 = alloca float
%4 = alloca float
%5 = alloca x86_fp80
%6 = alloca x86_fp80
%7 = alloca double
%8 = alloca double
%9 = alloca float
%10 = alloca float
%11 = alloca x86_fp80
%12 = alloca x86_fp80
%13 = alloca double
%14 = alloca double
%15 = alloca float
%16 = alloca float
%17 = alloca x86_fp80
%18 = alloca x86_fp80
%19 = alloca double
%20 = alloca double
%21 = alloca float
%22 = alloca float
%23 = alloca x86_fp80
%24 = alloca x86_fp80
%25 = bitcast double* %1 to i8*
store volatile double 1.500000e+00, double* %1
%26 = bitcast double* %2 to i8*
%27 = load volatile double, double* %1
%28 = tail call double @llvm.rint.f64(double %27)
store volatile double %28, double* %2
%29 = bitcast float* %3 to i8*
store volatile float 1.500000e+00, float* %3
%30 = bitcast float* %4 to i8*
%31 = load volatile float, float* %3
%32 = tail call float @llvm.rint.f32(float %31)
store volatile float %32, float* %4
%33 = bitcast x86_fp80* %5 to i8*
store volatile x86_fp80 0xK3FFFC000000000000000, x86_fp80* %5
%34 = bitcast x86_fp80* %6 to i8*
%35 = load volatile x86_fp80, x86_fp80* %5
%36 = tail call x86_fp80 @llvm.rint.f80(x86_fp80 %35)
store volatile x86_fp80 %36, x86_fp80* %6
%37 = bitcast double* %7 to i8*
store volatile double 1.500000e+00, double* %7
%38 = bitcast double* %8 to i8*
%39 = load volatile double, double* %7
%40 = tail call double @llvm.ceil.f64(double %39)
store volatile double %40, double* %8
%41 = bitcast float* %9 to i8*
store volatile float 1.500000e+00, float* %9
%42 = bitcast float* %10 to i8*
%43 = load volatile float, float* %9
%44 = tail call float @llvm.ceil.f32(float %43)
store volatile float %44, float* %10
%45 = bitcast x86_fp80* %11 to i8*
store volatile x86_fp80 0xK3FFFC000000000000000, x86_fp80* %11
%46 = bitcast x86_fp80* %12 to i8*
%47 = load volatile x86_fp80, x86_fp80* %11
%48 = tail call x86_fp80 @llvm.ceil.f80(x86_fp80 %47)
store volatile x86_fp80 %48, x86_fp80* %12
%49 = bitcast double* %13 to i8*
store volatile double 1.500000e+00, double* %13
%50 = bitcast double* %14 to i8*
%51 = load volatile double, double* %13
%52 = tail call double @llvm.floor.f64(double %51)
store volatile double %52, double* %14
%53 = bitcast float* %15 to i8*
store volatile float 1.500000e+00, float* %15
%54 = bitcast float* %16 to i8*
%55 = load volatile float, float* %15
%56 = tail call float @llvm.floor.f32(float %55)
store volatile float %56, float* %16
%57 = bitcast x86_fp80* %17 to i8*
store volatile x86_fp80 0xK3FFFC000000000000000, x86_fp80* %17
%58 = bitcast x86_fp80* %18 to i8*
%59 = load volatile x86_fp80, x86_fp80* %17
%60 = tail call x86_fp80 @llvm.floor.f80(x86_fp80 %59)
store volatile x86_fp80 %60, x86_fp80* %18
%61 = bitcast double* %19 to i8*
store volatile double 1.500000e+00, double* %19
%62 = bitcast double* %20 to i8*
%63 = load volatile double, double* %19
%64 = tail call double @llvm.trunc.f64(double %63)
store volatile double %64, double* %20
%65 = bitcast float* %21 to i8*
store volatile float 1.500000e+00, float* %21
%66 = bitcast float* %22 to i8*
%67 = load volatile float, float* %21
%68 = tail call float @llvm.trunc.f32(float %67)
store volatile float %68, float* %22
%69 = bitcast x86_fp80* %23 to i8*
store volatile x86_fp80 0xK3FFFC000000000000000, x86_fp80* %23
%70 = bitcast x86_fp80* %24 to i8*
%71 = load volatile x86_fp80, x86_fp80* %23
%72 = tail call x86_fp80 @llvm.trunc.f80(x86_fp80 %71)
store volatile x86_fp80 %72, x86_fp80* %24
ret void
}