void gpu_rotation_generator_x(const float m[9], float ans[9]) {
  ans[0] = 0;
  ans[1] = -m[2];
  ans[2] = m[1];
  ans[3] = 0;
  ans[4] = -m[5];
  ans[5] = m[4];
  ans[6] = 0;
  ans[7] = -m[8];
  ans[8] = m[7];
}


x86 assembly (clang, -O0):
<gpu_rotation_generator_x>:
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    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0xc(%rax)
mov    -0x8(%rbp),%rax
movss  0x14(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x10(%rax)
mov    -0x8(%rbp),%rax
movss  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x14(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x18(%rax)
mov    -0x8(%rbp),%rax
movss  0x20(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x1c(%rax)
mov    -0x8(%rbp),%rax
movss  0x1c(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x20(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpu_rotation_generator_x>:
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)
movl   $0x0,0xc(%rsi)
movss  0x14(%rdi),%xmm0
xorps  %xmm1,%xmm0
movss  %xmm0,0x10(%rsi)
movss  0x10(%rdi),%xmm0
movss  %xmm0,0x14(%rsi)
movl   $0x0,0x18(%rsi)
movss  0x20(%rdi),%xmm0
xorps  %xmm1,%xmm0
movss  %xmm0,0x1c(%rsi)
movss  0x1c(%rdi),%xmm0
movss  %xmm0,0x20(%rsi)
ret

LLVM IR (-O0):
define void @gpu_rotation_generator_x(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** %4
%19 = getelementptr inbounds float, float* %18, i64 3
store float 0.000000e+00, float* %19
%20 = load float*, float** %3
%21 = getelementptr inbounds float, float* %20, i64 5
%22 = load float, float* %21
%23 = fneg float %22
%24 = load float*, float** %4
%25 = getelementptr inbounds float, float* %24, i64 4
store float %23, float* %25
%26 = load float*, float** %3
%27 = getelementptr inbounds float, float* %26, i64 4
%28 = load float, float* %27
%29 = load float*, float** %4
%30 = getelementptr inbounds float, float* %29, i64 5
store float %28, float* %30
%31 = load float*, float** %4
%32 = getelementptr inbounds float, float* %31, i64 6
store float 0.000000e+00, float* %32
%33 = load float*, float** %3
%34 = getelementptr inbounds float, float* %33, i64 8
%35 = load float, float* %34
%36 = fneg float %35
%37 = load float*, float** %4
%38 = getelementptr inbounds float, float* %37, i64 7
store float %36, float* %38
%39 = load float*, float** %3
%40 = getelementptr inbounds float, float* %39, i64 7
%41 = load float, float* %40
%42 = load float*, float** %4
%43 = getelementptr inbounds float, float* %42, i64 8
store float %41, float* %43
ret void
}

LLVM IR (-O2):
define void @gpu_rotation_generator_x(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 = getelementptr inbounds float, float* %1, i64 3
store float 0.000000e+00, float* %10
%11 = getelementptr inbounds float, float* %0, i64 5
%12 = load float, float* %11
%13 = fneg float %12
%14 = getelementptr inbounds float, float* %1, i64 4
store float %13, float* %14
%15 = getelementptr inbounds float, float* %0, i64 4
%16 = load float, float* %15
%17 = getelementptr inbounds float, float* %1, i64 5
store float %16, float* %17
%18 = getelementptr inbounds float, float* %1, i64 6
store float 0.000000e+00, float* %18
%19 = getelementptr inbounds float, float* %0, i64 8
%20 = load float, float* %19
%21 = fneg float %20
%22 = getelementptr inbounds float, float* %1, i64 7
store float %21, float* %22
%23 = getelementptr inbounds float, float* %0, i64 7
%24 = load float, float* %23
%25 = getelementptr inbounds float, float* %1, i64 8
store float %24, float* %25
ret void
}