void floats_cross_matrix(const float v[3], float V[9]) {
  V[0] = 0;
  V[1] = -v[2];
  V[2] = v[1];
  V[3] = v[2];
  V[4] = 0;
  V[5] = -v[0];
  V[6] = -v[1];
  V[7] = v[0];
  V[8] = 0;
}


x86 assembly (clang, -O0):
<floats_cross_matrix>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0xc(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x10(%rax)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x14(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x18(%rax)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x1c(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x20(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<floats_cross_matrix>:
movl   $0x0,(%rsi)
movss  0x8(%rdi),%xmm0
movaps 0xeee(%rip),%xmm1
xorps  %xmm1,%xmm0
movss  %xmm0,0x4(%rsi)
movss  0x4(%rdi),%xmm0
movss  %xmm0,0x8(%rsi)
movss  0x8(%rdi),%xmm0
movss  %xmm0,0xc(%rsi)
movl   $0x0,0x10(%rsi)
movss  (%rdi),%xmm0
xorps  %xmm1,%xmm0
movss  %xmm0,0x14(%rsi)
movss  0x4(%rdi),%xmm0
xorps  %xmm1,%xmm0
movss  %xmm0,0x18(%rsi)
movss  (%rdi),%xmm0
movss  %xmm0,0x1c(%rsi)
movl   $0x0,0x20(%rsi)
ret

LLVM IR (-O0):
define void @floats_cross_matrix(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %4
%6 = getelementptr inbounds float, float* %5, i64 0
store float 0.000000e+00, float* %6
%7 = load float*, float** %3
%8 = getelementptr inbounds float, float* %7, i64 2
%9 = load float, float* %8
%10 = fneg float %9
%11 = load float*, float** %4
%12 = getelementptr inbounds float, float* %11, i64 1
store float %10, float* %12
%13 = load float*, float** %3
%14 = getelementptr inbounds float, float* %13, i64 1
%15 = load float, float* %14
%16 = load float*, float** %4
%17 = getelementptr inbounds float, float* %16, i64 2
store float %15, float* %17
%18 = load float*, float** %3
%19 = getelementptr inbounds float, float* %18, i64 2
%20 = load float, float* %19
%21 = load float*, float** %4
%22 = getelementptr inbounds float, float* %21, i64 3
store float %20, float* %22
%23 = load float*, float** %4
%24 = getelementptr inbounds float, float* %23, i64 4
store float 0.000000e+00, float* %24
%25 = load float*, float** %3
%26 = getelementptr inbounds float, float* %25, i64 0
%27 = load float, float* %26
%28 = fneg float %27
%29 = load float*, float** %4
%30 = getelementptr inbounds float, float* %29, i64 5
store float %28, float* %30
%31 = load float*, float** %3
%32 = getelementptr inbounds float, float* %31, i64 1
%33 = load float, float* %32
%34 = fneg float %33
%35 = load float*, float** %4
%36 = getelementptr inbounds float, float* %35, i64 6
store float %34, float* %36
%37 = load float*, float** %3
%38 = getelementptr inbounds float, float* %37, i64 0
%39 = load float, float* %38
%40 = load float*, float** %4
%41 = getelementptr inbounds float, float* %40, i64 7
store float %39, float* %41
%42 = load float*, float** %4
%43 = getelementptr inbounds float, float* %42, i64 8
store float 0.000000e+00, float* %43
ret void
}

LLVM IR (-O2):
define void @floats_cross_matrix(float* nocapture %0, float* nocapture writeonly %1) {
store float 0.000000e+00, float* %1
%3 = getelementptr inbounds float, float* %0, i64 2
%4 = load float, float* %3
%5 = fneg float %4
%6 = getelementptr inbounds float, float* %1, i64 1
store float %5, float* %6
%7 = getelementptr inbounds float, float* %0, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %1, i64 2
store float %8, float* %9
%10 = load float, float* %3
%11 = getelementptr inbounds float, float* %1, i64 3
store float %10, float* %11
%12 = getelementptr inbounds float, float* %1, i64 4
store float 0.000000e+00, float* %12
%13 = load float, float* %0
%14 = fneg float %13
%15 = getelementptr inbounds float, float* %1, i64 5
store float %14, float* %15
%16 = load float, float* %7
%17 = fneg float %16
%18 = getelementptr inbounds float, float* %1, i64 6
store float %17, float* %18
%19 = load float, float* %0
%20 = getelementptr inbounds float, float* %1, i64 7
store float %19, float* %20
%21 = getelementptr inbounds float, float* %1, i64 8
store float 0.000000e+00, float* %21
ret void
}