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);
  } 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);
  } 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);
  } 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);
  } while (0);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
jmp    118d <test+0xd>
movsd  0xe6b(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <rint@plt>
movsd  %xmm0,-0x10(%rbp)
jmp    11ae <test+0x2e>
movss  0xe52(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
call   1060 <rintf@plt>
movss  %xmm0,-0x18(%rbp)
jmp    11cf <test+0x4f>
jmp    11d4 <test+0x54>
jmp    11d9 <test+0x59>
movsd  0xe1f(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <ceil@plt>
movsd  %xmm0,-0x28(%rbp)
jmp    11fa <test+0x7a>
movss  0xe06(%rip),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
call   1070 <ceilf@plt>
movss  %xmm0,-0x30(%rbp)
jmp    121b <test+0x9b>
jmp    1220 <test+0xa0>
jmp    1225 <test+0xa5>
movsd  0xdd3(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
call   10a0 <floor@plt>
movsd  %xmm0,-0x40(%rbp)
jmp    1246 <test+0xc6>
movss  0xdba(%rip),%xmm0
movss  %xmm0,-0x44(%rbp)
movss  -0x44(%rbp),%xmm0
call   1040 <floorf@plt>
movss  %xmm0,-0x48(%rbp)
jmp    1267 <test+0xe7>
jmp    126c <test+0xec>
jmp    1271 <test+0xf1>
movsd  0xd87(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
call   1080 <trunc@plt>
movsd  %xmm0,-0x58(%rbp)
jmp    1292 <test+0x112>
movss  0xd6e(%rip),%xmm0
movss  %xmm0,-0x5c(%rbp)
movss  -0x5c(%rbp),%xmm0
call   1090 <truncf@plt>
movss  %xmm0,-0x60(%rbp)
jmp    12b3 <test+0x133>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
sub    $0x10,%rsp
movabs $0x3ff8000000000000,%rbx
mov    %rbx,(%rsp)
movsd  (%rsp),%xmm0
call   1050 <rint@plt>
movsd  %xmm0,0x8(%rsp)
movl   $0x3fc00000,(%rsp)
movss  (%rsp),%xmm0
call   1060 <rintf@plt>
movss  %xmm0,0x8(%rsp)
mov    %rbx,(%rsp)
movsd  (%rsp),%xmm0
call   1030 <ceil@plt>
movsd  %xmm0,0x8(%rsp)
movl   $0x3fc00000,(%rsp)
movss  (%rsp),%xmm0
call   1070 <ceilf@plt>
movss  %xmm0,0x8(%rsp)
mov    %rbx,(%rsp)
movsd  (%rsp),%xmm0
call   10a0 <floor@plt>
movsd  %xmm0,0x8(%rsp)
movl   $0x3fc00000,(%rsp)
movss  (%rsp),%xmm0
call   1040 <floorf@plt>
movss  %xmm0,0x8(%rsp)
mov    %rbx,(%rsp)
movsd  (%rsp),%xmm0
call   1080 <trunc@plt>
movsd  %xmm0,0x8(%rsp)
movl   $0x3fc00000,(%rsp)
movss  (%rsp),%xmm0
call   1090 <truncf@plt>
movss  %xmm0,0x8(%rsp)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @test() {
%1 = alloca double
%2 = alloca double
%3 = alloca float
%4 = alloca float
%5 = alloca double
%6 = alloca double
%7 = alloca float
%8 = alloca float
%9 = alloca double
%10 = alloca double
%11 = alloca float
%12 = alloca float
%13 = alloca double
%14 = alloca double
%15 = alloca float
%16 = alloca float
br label %17
17: ; preds = %0
br label %18
18: ; preds = %17
store volatile double 1.500000e+00, double* %1
%19 = load volatile double, double* %1
%20 = call double @llvm.rint.f64(double %19)
store volatile double %20, double* %2
br label %21
21: ; preds = %18
br label %22
22: ; preds = %21
store volatile float 1.500000e+00, float* %3
%23 = load volatile float, float* %3
%24 = call float @llvm.rint.f32(float %23)
store volatile float %24, float* %4
br label %25
25: ; preds = %22
br label %26
26: ; preds = %25
br label %27
27: ; preds = %26
br label %28
28: ; preds = %27
store volatile double 1.500000e+00, double* %5
%29 = load volatile double, double* %5
%30 = call double @llvm.ceil.f64(double %29)
store volatile double %30, double* %6
br label %31
31: ; preds = %28
br label %32
32: ; preds = %31
store volatile float 1.500000e+00, float* %7
%33 = load volatile float, float* %7
%34 = call float @llvm.ceil.f32(float %33)
store volatile float %34, float* %8
br label %35
35: ; preds = %32
br label %36
36: ; preds = %35
br label %37
37: ; preds = %36
br label %38
38: ; preds = %37
store volatile double 1.500000e+00, double* %9
%39 = load volatile double, double* %9
%40 = call double @llvm.floor.f64(double %39)
store volatile double %40, double* %10
br label %41
41: ; preds = %38
br label %42
42: ; preds = %41
store volatile float 1.500000e+00, float* %11
%43 = load volatile float, float* %11
%44 = call float @llvm.floor.f32(float %43)
store volatile float %44, float* %12
br label %45
45: ; preds = %42
br label %46
46: ; preds = %45
br label %47
47: ; preds = %46
br label %48
48: ; preds = %47
store volatile double 1.500000e+00, double* %13
%49 = load volatile double, double* %13
%50 = call double @llvm.trunc.f64(double %49)
store volatile double %50, double* %14
br label %51
51: ; preds = %48
br label %52
52: ; preds = %51
store volatile float 1.500000e+00, float* %15
%53 = load volatile float, float* %15
%54 = call float @llvm.trunc.f32(float %53)
store volatile float %54, float* %16
br label %55
55: ; preds = %52
br label %56
56: ; preds = %55
ret void
}

LLVM IR (-O2):
define void @test() {
%1 = alloca double
%2 = alloca double
%3 = alloca float
%4 = alloca float
%5 = alloca double
%6 = alloca double
%7 = alloca float
%8 = alloca float
%9 = alloca double
%10 = alloca double
%11 = alloca float
%12 = alloca float
%13 = alloca double
%14 = alloca double
%15 = alloca float
%16 = alloca float
%17 = bitcast double* %1 to i8*
store volatile double 1.500000e+00, double* %1
%18 = bitcast double* %2 to i8*
%19 = load volatile double, double* %1
%20 = tail call double @llvm.rint.f64(double %19)
store volatile double %20, double* %2
%21 = bitcast float* %3 to i8*
store volatile float 1.500000e+00, float* %3
%22 = bitcast float* %4 to i8*
%23 = load volatile float, float* %3
%24 = tail call float @llvm.rint.f32(float %23)
store volatile float %24, float* %4
%25 = bitcast double* %5 to i8*
store volatile double 1.500000e+00, double* %5
%26 = bitcast double* %6 to i8*
%27 = load volatile double, double* %5
%28 = tail call double @llvm.ceil.f64(double %27)
store volatile double %28, double* %6
%29 = bitcast float* %7 to i8*
store volatile float 1.500000e+00, float* %7
%30 = bitcast float* %8 to i8*
%31 = load volatile float, float* %7
%32 = tail call float @llvm.ceil.f32(float %31)
store volatile float %32, float* %8
%33 = bitcast double* %9 to i8*
store volatile double 1.500000e+00, double* %9
%34 = bitcast double* %10 to i8*
%35 = load volatile double, double* %9
%36 = tail call double @llvm.floor.f64(double %35)
store volatile double %36, double* %10
%37 = bitcast float* %11 to i8*
store volatile float 1.500000e+00, float* %11
%38 = bitcast float* %12 to i8*
%39 = load volatile float, float* %11
%40 = tail call float @llvm.floor.f32(float %39)
store volatile float %40, float* %12
%41 = bitcast double* %13 to i8*
store volatile double 1.500000e+00, double* %13
%42 = bitcast double* %14 to i8*
%43 = load volatile double, double* %13
%44 = tail call double @llvm.trunc.f64(double %43)
store volatile double %44, double* %14
%45 = bitcast float* %15 to i8*
store volatile float 1.500000e+00, float* %15
%46 = bitcast float* %16 to i8*
%47 = load volatile float, float* %15
%48 = tail call float @llvm.trunc.f32(float %47)
store volatile float %48, float* %16
ret void
}