void rgb_to_xyz_floats(float *xyz, float *rgb) {
  float n = 0.17697;
  xyz[0] = (0.49 * rgb[0] + 0.31 * rgb[1] + 0.2 * rgb[2]) / n;
  xyz[1] = (0.17697 * rgb[0] + 0.8124 * rgb[1] + 0.01063 * rgb[2]) / n;
  xyz[2] = (0 * rgb[0] + 0.01 * rgb[1] + 0.99 * rgb[2]) / n;
}


x86 assembly (clang, -O0):
<rgb_to_xyz_floats>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  0xf2c(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm1
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
cvtss2sd %xmm0,%xmm2
movsd  0xefe(%rip),%xmm0
mulsd  %xmm2,%xmm0
movsd  0xeea(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec5(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movss  -0x14(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm1
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
cvtss2sd %xmm0,%xmm2
movsd  0xe7b(%rip),%xmm0
mulsd  %xmm2,%xmm0
movsd  0xe67(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe42(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movss  -0x14(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
mulss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xdf4(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdcf(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movss  -0x14(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgb_to_xyz_floats>:
movss  (%rsi),%xmm0
movss  0x4(%rsi),%xmm1
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
mulsd  0xee7(%rip),%xmm1
mulsd  0xee7(%rip),%xmm0
movss  0x8(%rsi),%xmm2
cvtss2sd %xmm2,%xmm2
mulsd  0xede(%rip),%xmm2
addsd  %xmm1,%xmm0
addsd  %xmm0,%xmm2
movsd  0xed6(%rip),%xmm0
divsd  %xmm0,%xmm2
xorps  %xmm1,%xmm1
cvtsd2ss %xmm2,%xmm1
movss  %xmm1,(%rdi)
movss  (%rsi),%xmm1
movss  0x4(%rsi),%xmm2
cvtss2sd %xmm2,%xmm2
mulsd  0xeba(%rip),%xmm2
cvtss2sd %xmm1,%xmm1
mulsd  0xeb6(%rip),%xmm1
addsd  %xmm2,%xmm1
movss  0x8(%rsi),%xmm2
cvtss2sd %xmm2,%xmm2
mulsd  0xea9(%rip),%xmm2
addsd  %xmm1,%xmm2
divsd  %xmm0,%xmm2
xorps  %xmm1,%xmm1
cvtsd2ss %xmm2,%xmm1
movss  %xmm1,0x4(%rdi)
xorps  %xmm1,%xmm1
mulss  (%rsi),%xmm1
cvtss2sd %xmm1,%xmm1
movss  0x4(%rsi),%xmm2
movss  0x8(%rsi),%xmm3
cvtss2sd %xmm2,%xmm2
mulsd  0xe7c(%rip),%xmm2
addsd  %xmm1,%xmm2
xorps  %xmm1,%xmm1
cvtss2sd %xmm3,%xmm1
mulsd  0xe71(%rip),%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
movss  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @rgb_to_xyz_floats(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca float
store float* %0, float** %3
store float* %1, float** %4
store float 0x3FC6A6F400000000, float* %5
%6 = load float*, float** %4
%7 = getelementptr inbounds float, float* %6, i64 0
%8 = load float, float* %7
%9 = fpext float %8 to double
%10 = load float*, float** %4
%11 = getelementptr inbounds float, float* %10, i64 1
%12 = load float, float* %11
%13 = fpext float %12 to double
%14 = fmul double 3.100000e-01, %13
%15 = call double @llvm.fmuladd.f64(double 4.900000e-01, double %9, double %14)
%16 = load float*, float** %4
%17 = getelementptr inbounds float, float* %16, i64 2
%18 = load float, float* %17
%19 = fpext float %18 to double
%20 = call double @llvm.fmuladd.f64(double 2.000000e-01, double %19, double %15)
%21 = load float, float* %5
%22 = fpext float %21 to double
%23 = fdiv double %20, %22
%24 = fptrunc double %23 to float
%25 = load float*, float** %3
%26 = getelementptr inbounds float, float* %25, i64 0
store float %24, float* %26
%27 = load float*, float** %4
%28 = getelementptr inbounds float, float* %27, i64 0
%29 = load float, float* %28
%30 = fpext float %29 to double
%31 = load float*, float** %4
%32 = getelementptr inbounds float, float* %31, i64 1
%33 = load float, float* %32
%34 = fpext float %33 to double
%35 = fmul double 8.124000e-01, %34
%36 = call double @llvm.fmuladd.f64(double 1.769700e-01, double %30, double %35)
%37 = load float*, float** %4
%38 = getelementptr inbounds float, float* %37, i64 2
%39 = load float, float* %38
%40 = fpext float %39 to double
%41 = call double @llvm.fmuladd.f64(double 1.063000e-02, double %40, double %36)
%42 = load float, float* %5
%43 = fpext float %42 to double
%44 = fdiv double %41, %43
%45 = fptrunc double %44 to float
%46 = load float*, float** %3
%47 = getelementptr inbounds float, float* %46, i64 1
store float %45, float* %47
%48 = load float*, float** %4
%49 = getelementptr inbounds float, float* %48, i64 0
%50 = load float, float* %49
%51 = fmul float 0.000000e+00, %50
%52 = fpext float %51 to double
%53 = load float*, float** %4
%54 = getelementptr inbounds float, float* %53, i64 1
%55 = load float, float* %54
%56 = fpext float %55 to double
%57 = call double @llvm.fmuladd.f64(double 1.000000e-02, double %56, double %52)
%58 = load float*, float** %4
%59 = getelementptr inbounds float, float* %58, i64 2
%60 = load float, float* %59
%61 = fpext float %60 to double
%62 = call double @llvm.fmuladd.f64(double 0x3FEFAE147AE147AE, double %61, double %57)
%63 = load float, float* %5
%64 = fpext float %63 to double
%65 = fdiv double %62, %64
%66 = fptrunc double %65 to float
%67 = load float*, float** %3
%68 = getelementptr inbounds float, float* %67, i64 2
store float %66, float* %68
ret void
}

LLVM IR (-O2):
define void @rgb_to_xyz_floats(float* nocapture writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = fpext float %3 to double
%5 = getelementptr inbounds float, float* %1, i64 1
%6 = load float, float* %5
%7 = fpext float %6 to double
%8 = fmul double %7, 3.100000e-01
%9 = tail call double @llvm.fmuladd.f64(double %4, double 4.900000e-01, double %8)
%10 = getelementptr inbounds float, float* %1, i64 2
%11 = load float, float* %10
%12 = fpext float %11 to double
%13 = tail call double @llvm.fmuladd.f64(double %12, double 2.000000e-01, double %9)
%14 = fdiv double %13, 0x3FC6A6F400000000
%15 = fptrunc double %14 to float
store float %15, float* %0
%16 = load float, float* %1
%17 = fpext float %16 to double
%18 = load float, float* %5
%19 = fpext float %18 to double
%20 = fmul double %19, 8.124000e-01
%21 = tail call double @llvm.fmuladd.f64(double %17, double 1.769700e-01, double %20)
%22 = load float, float* %10
%23 = fpext float %22 to double
%24 = tail call double @llvm.fmuladd.f64(double %23, double 1.063000e-02, double %21)
%25 = fdiv double %24, 0x3FC6A6F400000000
%26 = fptrunc double %25 to float
%27 = getelementptr inbounds float, float* %0, i64 1
store float %26, float* %27
%28 = load float, float* %1
%29 = fmul float %28, 0.000000e+00
%30 = fpext float %29 to double
%31 = load float, float* %5
%32 = fpext float %31 to double
%33 = tail call double @llvm.fmuladd.f64(double %32, double 1.000000e-02, double %30)
%34 = load float, float* %10
%35 = fpext float %34 to double
%36 = tail call double @llvm.fmuladd.f64(double %35, double 0x3FEFAE147AE147AE, double %33)
%37 = fdiv double %36, 0x3FC6A6F400000000
%38 = fptrunc double %37 to float
%39 = getelementptr inbounds float, float* %0, i64 2
store float %38, float* %39
ret void
}