int main() {
  volatile float a = 0.125f;
  if (__builtin_fabs(a) != 0.125f) {
    return 1;
  }
  volatile float b = -0.125f;
  if (__builtin_fabs(b) != 0.125f) {
    return 1;
  }
  volatile float c = 0.f;
  if (__builtin_fabs(c) != 0.f) {
    return 1;
  }
  volatile float d = -0.f;
  if (__builtin_fabs(d) != 0.f) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movss  0xf0d(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movaps 0xee8(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  0xecc(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1149 <main+0x49>
jp     1149 <main+0x49>
jmp    1155 <main+0x55>
movl   $0x1,-0x4(%rbp)
jmp    122b <main+0x12b>
movss  0xec7(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movaps 0xe9e(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  0xe82(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1193 <main+0x93>
jp     1193 <main+0x93>
jmp    119f <main+0x9f>
movl   $0x1,-0x4(%rbp)
jmp    122b <main+0x12b>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movaps 0xe59(%rip),%xmm1
pand   %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11d3 <main+0xd3>
jp     11d3 <main+0xd3>
jmp    11df <main+0xdf>
movl   $0x1,-0x4(%rbp)
jmp    122b <main+0x12b>
movss  0xe41(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movaps 0xe14(%rip),%xmm1
pand   %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1218 <main+0x118>
jp     1218 <main+0x118>
jmp    1224 <main+0x124>
movl   $0x1,-0x4(%rbp)
jmp    122b <main+0x12b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movl   $0x3e000000,-0x4(%rsp)
3e
movss  -0x4(%rsp),%xmm0
andps  0xeeb(%rip),%xmm0
mov    $0x1,%eax
ucomiss 0xeef(%rip),%xmm0
jne    1125 <main+0x25>
jnp    1126 <main+0x26>
ret
movl   $0xbe000000,-0x8(%rsp)
be
movss  -0x8(%rsp),%xmm0
andps  0xec5(%rip),%xmm0
mov    $0x1,%eax
ucomiss 0xec9(%rip),%xmm0
jne    1125 <main+0x25>
jp     1125 <main+0x25>
movl   $0x0,-0xc(%rsp)
movss  -0xc(%rsp),%xmm1
mov    $0x1,%eax
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm1
jne    1125 <main+0x25>
jp     1125 <main+0x25>
movl   $0x80000000,-0x10(%rsp)
80
cmpneqss -0x10(%rsp),%xmm0
movd   %xmm0,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
store i32 0, i32* %1
store volatile float 1.250000e-01, float* %2
%6 = load volatile float, float* %2
%7 = fpext float %6 to double
%8 = call double @llvm.fabs.f64(double %7)
%9 = fcmp une double %8, 1.250000e-01
br i1 %9, label %10, label %11
10: ; preds = %0
store i32 1, i32* %1
br label %30
11: ; preds = %0
store volatile float -1.250000e-01, float* %3
%12 = load volatile float, float* %3
%13 = fpext float %12 to double
%14 = call double @llvm.fabs.f64(double %13)
%15 = fcmp une double %14, 1.250000e-01
br i1 %15, label %16, label %17
16: ; preds = %11
store i32 1, i32* %1
br label %30
17: ; preds = %11
store volatile float 0.000000e+00, float* %4
%18 = load volatile float, float* %4
%19 = fpext float %18 to double
%20 = call double @llvm.fabs.f64(double %19)
%21 = fcmp une double %20, 0.000000e+00
br i1 %21, label %22, label %23
22: ; preds = %17
store i32 1, i32* %1
br label %30
23: ; preds = %17
store volatile float -0.000000e+00, float* %5
%24 = load volatile float, float* %5
%25 = fpext float %24 to double
%26 = call double @llvm.fabs.f64(double %25)
%27 = fcmp une double %26, 0.000000e+00
br i1 %27, label %28, label %29
28: ; preds = %23
store i32 1, i32* %1
br label %30
29: ; preds = %23
store i32 0, i32* %1
br label %30
30: ; preds = %29, %28, %22, %16, %10
%31 = load i32, i32* %1
ret i32 %31
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = bitcast float* %1 to i8*
store volatile float 1.250000e-01, float* %1
%6 = load volatile float, float* %1
%7 = tail call float @llvm.fabs.f32(float %6)
%8 = fcmp une float %7, 1.250000e-01
br i1 %8, label %27, label %9
9: ; preds = %0
%10 = bitcast float* %2 to i8*
store volatile float -1.250000e-01, float* %2
%11 = load volatile float, float* %2
%12 = tail call float @llvm.fabs.f32(float %11)
%13 = fcmp une float %12, 1.250000e-01
br i1 %13, label %25, label %14
14: ; preds = %9
%15 = bitcast float* %3 to i8*
store volatile float 0.000000e+00, float* %3
%16 = load volatile float, float* %3
%17 = fcmp une float %16, 0.000000e+00
br i1 %17, label %23, label %18
18: ; preds = %14
%19 = bitcast float* %4 to i8*
store volatile float -0.000000e+00, float* %4
%20 = load volatile float, float* %4
%21 = fcmp une float %20, 0.000000e+00
%22 = zext i1 %21 to i32
br label %23
23: ; preds = %14, %18
%24 = phi i32 [ %22, %18 ], [ 1, %14 ]
br label %25
25: ; preds = %9, %23
%26 = phi i32 [ %24, %23 ], [ 1, %9 ]
br label %27
27: ; preds = %0, %25
%28 = phi i32 [ %26, %25 ], [ 1, %0 ]
ret i32 %28
}