void test_complex_float(_Complex float x) {
  (void)abs(x);
  (void)labs(x);
  (void)llabs(x);
  (void)fabsf(x);
  (void)fabs(x);
  (void)fabsl(x);
  (void)cabsf(x);
  (void)cabs(x);
  (void)cabsl(x);
  (void)__builtin_abs(x);
  (void)__builtin_labs(x);
  (void)__builtin_llabs(x);
  (void)__builtin_fabsf(x);
  (void)__builtin_fabs(x);
  (void)__builtin_fabsl(x);
  (void)__builtin_cabsf(x);
  (void)__builtin_cabs(x);
  (void)__builtin_cabsl(x);
}


x86 assembly (clang, -O0):
<test_complex_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movlpd %xmm0,-0x8(%rbp)
cvttss2si -0x8(%rbp),%edi
call   1030 <abs@plt>
cvttss2si -0x8(%rbp),%rdi
call   1040 <labs@plt>
cvttss2si -0x8(%rbp),%rdi
call   1080 <llabs@plt>
movss  -0x8(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
movss  %xmm1,-0x10(%rbp)
movss  %xmm0,-0xc(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1070 <cabsf@plt>
movss  -0x8(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm1,%xmm1
cvtss2sd %xmm0,%xmm0
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1050 <cabs@plt>
flds   -0x8(%rbp)
flds   -0x4(%rbp)
fxch   %st(1)
fstpt  -0x40(%rbp)
fstpt  -0x30(%rbp)
movaps -0x40(%rbp),%xmm0
movaps -0x30(%rbp),%xmm1
mov    %rsp,%rax
movaps %xmm1,0x10(%rax)
movaps %xmm0,(%rax)
call   1060 <cabsl@plt>
fstp   %st(0)
movss  -0x8(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
movss  %xmm1,-0x48(%rbp)
movss  %xmm0,-0x44(%rbp)
movsd  -0x48(%rbp),%xmm0
call   1070 <cabsf@plt>
movss  -0x8(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm1,%xmm1
cvtss2sd %xmm0,%xmm0
movsd  %xmm1,-0x58(%rbp)
movsd  %xmm0,-0x50(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
call   1050 <cabs@plt>
flds   -0x8(%rbp)
flds   -0x4(%rbp)
fxch   %st(1)
fstpt  -0x80(%rbp)
fstpt  -0x70(%rbp)
lea    -0x80(%rbp),%rax
mov    (%rax),%rcx
mov    %rcx,(%rsp)
mov    0x8(%rax),%rcx
mov    %rcx,0x8(%rsp)
mov    0x10(%rax),%rcx
mov    %rcx,0x10(%rsp)
mov    0x18(%rax),%rax
mov    %rax,0x18(%rsp)
call   1060 <cabsl@plt>
fstp   %st(0)
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_complex_float>:
sub    $0xb8,%rsp
movaps %xmm0,%xmm1
movaps %xmm0,0x60(%rsp)
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x28(%rsp)
movss  %xmm1,0x20(%rsp)
flds   0x20(%rsp)
fstpt  0x4c(%rsp)
movaps %xmm1,%xmm0
shufps $0x55,%xmm1,%xmm0
movaps %xmm0,0x30(%rsp)
movaps %xmm1,%xmm0
call   1050 <cabsf@plt>
movaps 0x30(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  %xmm1,0x58(%rsp)
movsd  0x28(%rsp),%xmm0
call   1030 <cabs@plt>
movaps 0x30(%rsp),%xmm0
movss  %xmm0,0x24(%rsp)
flds   0x24(%rsp)
fld    %st(0)
fstpt  0x30(%rsp)
fldt   0x4c(%rsp)
fstpt  0x90(%rsp)
fstpt  0xa0(%rsp)
movaps 0x90(%rsp),%xmm0
movaps 0xa0(%rsp),%xmm1
movaps %xmm1,0x10(%rsp)
movaps %xmm0,(%rsp)
call   1040 <cabsl@plt>
fstp   %st(0)
movaps 0x60(%rsp),%xmm0
call   1050 <cabsf@plt>
movsd  0x28(%rsp),%xmm0
movsd  0x58(%rsp),%xmm1
call   1030 <cabs@plt>
fldt   0x4c(%rsp)
fstpt  0x70(%rsp)
fldt   0x30(%rsp)
fstpt  0x80(%rsp)
movaps 0x70(%rsp),%xmm0
movaps 0x80(%rsp),%xmm1
movaps %xmm1,0x10(%rsp)
movaps %xmm0,(%rsp)
call   1040 <cabsl@plt>
fstp   %st(0)
add    $0xb8,%rsp
ret

LLVM IR (-O0):
define void @test_complex_float(<2 x float> %0) {
%2 = alloca { float, float }
%3 = alloca { float, float }
%4 = alloca { double, double }
%5 = alloca { x86_fp80, x86_fp80 }
%6 = alloca { float, float }
%7 = alloca { double, double }
%8 = alloca { x86_fp80, x86_fp80 }
%9 = bitcast { float, float }* %2 to <2 x float>*
store <2 x float> %0, <2 x float>* %9
%10 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%11 = load float, float* %10
%12 = fptosi float %11 to i32
%13 = call i32 @abs(i32 %12)
%14 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%15 = load float, float* %14
%16 = fptosi float %15 to i64
%17 = call i64 @labs(i64 %16)
%18 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%19 = load float, float* %18
%20 = fptosi float %19 to i64
%21 = call i64 @llabs(i64 %20)
%22 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%23 = load float, float* %22
%24 = call float @llvm.fabs.f32(float %23)
%25 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%26 = load float, float* %25
%27 = fpext float %26 to double
%28 = call double @llvm.fabs.f64(double %27)
%29 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%30 = load float, float* %29
%31 = fpext float %30 to x86_fp80
%32 = call x86_fp80 @llvm.fabs.f80(x86_fp80 %31)
%33 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%34 = load float, float* %33
%35 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 1
%36 = load float, float* %35
%37 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 0
%38 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 1
store float %34, float* %37
store float %36, float* %38
%39 = bitcast { float, float }* %3 to <2 x float>*
%40 = load <2 x float>, <2 x float>* %39
%41 = call float @cabsf(<2 x float> %40)
%42 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%43 = load float, float* %42
%44 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 1
%45 = load float, float* %44
%46 = fpext float %43 to double
%47 = fpext float %45 to double
%48 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
%49 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
store double %46, double* %48
store double %47, double* %49
%50 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
%51 = load double, double* %50
%52 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
%53 = load double, double* %52
%54 = call double @cabs(double %51, double %53)
%55 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%56 = load float, float* %55
%57 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 1
%58 = load float, float* %57
%59 = fpext float %56 to x86_fp80
%60 = fpext float %58 to x86_fp80
%61 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %5, i32 0, i32 0
%62 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %5, i32 0, i32 1
store x86_fp80 %59, x86_fp80* %61
store x86_fp80 %60, x86_fp80* %62
%63 = call x86_fp80 @cabsl({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %5)
%64 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%65 = load float, float* %64
%66 = fptosi float %65 to i32
%67 = sub nsw i32 0, %66
%68 = icmp slt i32 %66, 0
%69 = select i1 %68, i32 %67, i32 %66
%70 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%71 = load float, float* %70
%72 = fptosi float %71 to i64
%73 = sub nsw i64 0, %72
%74 = icmp slt i64 %72, 0
%75 = select i1 %74, i64 %73, i64 %72
%76 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%77 = load float, float* %76
%78 = fptosi float %77 to i64
%79 = sub nsw i64 0, %78
%80 = icmp slt i64 %78, 0
%81 = select i1 %80, i64 %79, i64 %78
%82 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%83 = load float, float* %82
%84 = call float @llvm.fabs.f32(float %83)
%85 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%86 = load float, float* %85
%87 = fpext float %86 to double
%88 = call double @llvm.fabs.f64(double %87)
%89 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%90 = load float, float* %89
%91 = fpext float %90 to x86_fp80
%92 = call x86_fp80 @llvm.fabs.f80(x86_fp80 %91)
%93 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%94 = load float, float* %93
%95 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 1
%96 = load float, float* %95
%97 = getelementptr inbounds { float, float }, { float, float }* %6, i32 0, i32 0
%98 = getelementptr inbounds { float, float }, { float, float }* %6, i32 0, i32 1
store float %94, float* %97
store float %96, float* %98
%99 = bitcast { float, float }* %6 to <2 x float>*
%100 = load <2 x float>, <2 x float>* %99
%101 = call float @cabsf(<2 x float> %100)
%102 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%103 = load float, float* %102
%104 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 1
%105 = load float, float* %104
%106 = fpext float %103 to double
%107 = fpext float %105 to double
%108 = getelementptr inbounds { double, double }, { double, double }* %7, i32 0, i32 0
%109 = getelementptr inbounds { double, double }, { double, double }* %7, i32 0, i32 1
store double %106, double* %108
store double %107, double* %109
%110 = getelementptr inbounds { double, double }, { double, double }* %7, i32 0, i32 0
%111 = load double, double* %110
%112 = getelementptr inbounds { double, double }, { double, double }* %7, i32 0, i32 1
%113 = load double, double* %112
%114 = call double @cabs(double %111, double %113)
%115 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%116 = load float, float* %115
%117 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 1
%118 = load float, float* %117
%119 = fpext float %116 to x86_fp80
%120 = fpext float %118 to x86_fp80
%121 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %8, i32 0, i32 0
%122 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %8, i32 0, i32 1
store x86_fp80 %119, x86_fp80* %121
store x86_fp80 %120, x86_fp80* %122
%123 = call x86_fp80 @cabsl({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %8)
ret void
}

LLVM IR (-O2):
define void @test_complex_float(<2 x float> %0) {
%2 = alloca { x86_fp80, x86_fp80 }
%3 = alloca { x86_fp80, x86_fp80 }
%4 = extractelement <2 x float> %0, i64 0
%5 = fpext float %4 to double
%6 = fpext float %4 to x86_fp80
%7 = extractelement <2 x float> %0, i64 1
%8 = tail call float @cabsf(<2 x float> %0)
%9 = fpext float %7 to double
%10 = tail call double @cabs(double %5, double %9)
%11 = fpext float %7 to x86_fp80
%12 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2, i64 0, i32 0
%13 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2, i64 0, i32 1
store x86_fp80 %6, x86_fp80* %12
store x86_fp80 %11, x86_fp80* %13
%14 = tail call x86_fp80 @cabsl({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %2)
%15 = tail call float @cabsf(<2 x float> %0)
%16 = tail call double @cabs(double %5, double %9)
%17 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3, i64 0, i32 0
%18 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3, i64 0, i32 1
store x86_fp80 %6, x86_fp80* %17
store x86_fp80 %11, x86_fp80* %18
%19 = tail call x86_fp80 @cabsl({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %3)
ret void
}