void test_float_builtin_ops(float F, double D, long double LD) {
  volatile float resf;
  volatile double resd;
  volatile long double resld;
  resf = __builtin_fmodf(F, F);
  resd = __builtin_fmod(D, D);
  resld = __builtin_fmodl(LD, LD);
  resf = __builtin_fabsf(F);
  resd = __builtin_fabs(D);
  resld = __builtin_fabsl(LD);
}


x86 assembly (clang, -O0):
<test_float_builtin_ops>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
fldt   0x10(%rbp)
movss  %xmm0,-0x4(%rbp)
movsd  %xmm1,-0x10(%rbp)
fstpt  -0x20(%rbp)
movss  -0x4(%rbp),%xmm1
movaps %xmm1,%xmm0
call   1050 <fmodf@plt>
movss  %xmm0,-0x24(%rbp)
movsd  -0x10(%rbp),%xmm1
movaps %xmm1,%xmm0
call   1040 <fmod@plt>
movsd  %xmm0,-0x30(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fld    %st(0)
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <fmodl@plt>
fstpt  -0x40(%rbp)
movaps 0xe78(%rip),%xmm1
movss  -0x4(%rbp),%xmm0
pand   %xmm1,%xmm0
movss  %xmm0,-0x24(%rbp)
movaps 0xe73(%rip),%xmm1
movsd  -0x10(%rbp),%xmm0
pand   %xmm1,%xmm0
movlpd %xmm0,-0x30(%rbp)
fldt   -0x20(%rbp)
fabs
fstpt  -0x40(%rbp)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_float_builtin_ops>:
sub    $0x78,%rsp
movaps %xmm1,0x40(%rsp)
movaps %xmm0,0x50(%rsp)
fldt   0x80(%rsp)
fstpt  0x2c(%rsp)
movaps %xmm0,%xmm1
call   1050 <fmodf@plt>
movss  %xmm0,0x28(%rsp)
movaps 0x40(%rsp),%xmm0
movaps %xmm0,%xmm1
call   1040 <fmod@plt>
movsd  %xmm0,0x38(%rsp)
fldt   0x2c(%rsp)
fld    %st(0)
fstpt  0x10(%rsp)
fstpt  (%rsp)
call   1030 <fmodl@plt>
fstpt  0x60(%rsp)
movaps 0x50(%rsp),%xmm0
andps  0xe74(%rip),%xmm0
movaps 0x40(%rsp),%xmm1
andps  0xe78(%rip),%xmm1
movss  %xmm0,0x28(%rsp)
movlps %xmm1,0x38(%rsp)
fldt   0x2c(%rsp)
fabs
fstpt  0x60(%rsp)
add    $0x78,%rsp
ret

LLVM IR (-O0):
define void @test_float_builtin_ops(float %0, double %1, x86_fp80 %2) {
%4 = alloca float
%5 = alloca double
%6 = alloca x86_fp80
%7 = alloca float
%8 = alloca double
%9 = alloca x86_fp80
store float %0, float* %4
store double %1, double* %5
store x86_fp80 %2, x86_fp80* %6
%10 = load float, float* %4
%11 = load float, float* %4
%12 = call float @fmodf(float %10, float %11)
store volatile float %12, float* %7
%13 = load double, double* %5
%14 = load double, double* %5
%15 = call double @fmod(double %13, double %14)
store volatile double %15, double* %8
%16 = load x86_fp80, x86_fp80* %6
%17 = load x86_fp80, x86_fp80* %6
%18 = call x86_fp80 @fmodl(x86_fp80 %16, x86_fp80 %17)
store volatile x86_fp80 %18, x86_fp80* %9
%19 = load float, float* %4
%20 = call float @llvm.fabs.f32(float %19)
store volatile float %20, float* %7
%21 = load double, double* %5
%22 = call double @llvm.fabs.f64(double %21)
store volatile double %22, double* %8
%23 = load x86_fp80, x86_fp80* %6
%24 = call x86_fp80 @llvm.fabs.f80(x86_fp80 %23)
store volatile x86_fp80 %24, x86_fp80* %9
ret void
}

LLVM IR (-O2):
define void @test_float_builtin_ops(float %0, double %1, x86_fp80 %2) {
%4 = alloca float
%5 = alloca double
%6 = alloca x86_fp80
%7 = bitcast float* %4 to i8*
%8 = bitcast double* %5 to i8*
%9 = bitcast x86_fp80* %6 to i8*
%10 = tail call float @fmodf(float %0, float %0)
store volatile float %10, float* %4
%11 = tail call double @fmod(double %1, double %1)
store volatile double %11, double* %5
%12 = tail call x86_fp80 @fmodl(x86_fp80 %2, x86_fp80 %2)
store volatile x86_fp80 %12, x86_fp80* %6
%13 = tail call float @llvm.fabs.f32(float %0)
store volatile float %13, float* %4
%14 = tail call double @llvm.fabs.f64(double %1)
store volatile double %14, double* %5
%15 = tail call x86_fp80 @llvm.fabs.f80(x86_fp80 %2)
store volatile x86_fp80 %15, x86_fp80* %6
ret void
}