void set_bilinear_weights(double iw, double jw, double wgts[4]) {
  wgts[0] = (1. - iw) * (1. - jw);
  wgts[1] = iw * (1. - jw);
  wgts[2] = iw * jw;
  wgts[3] = (1. - iw) * jw;
}


x86 assembly (clang, -O0):
<set_bilinear_weights>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movsd  0xee6(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  0xed9(%rip),%xmm1
subsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
movsd  0xebb(%rip),%xmm1
subsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x10(%rax)
movsd  0xe8e(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bilinear_weights>:
movsd  0xef8(%rip),%xmm2
movapd %xmm2,%xmm3
subsd  %xmm0,%xmm3
subsd  %xmm1,%xmm2
unpcklpd %xmm2,%xmm2
movapd %xmm3,%xmm4
unpcklpd %xmm0,%xmm4
mulpd  %xmm2,%xmm4
movupd %xmm4,(%rdi)
unpcklpd %xmm3,%xmm0
unpcklpd %xmm1,%xmm1
mulpd  %xmm0,%xmm1
movupd %xmm1,0x10(%rdi)
ret

LLVM IR (-O0):
define void @set_bilinear_weights(double %0, double %1, double* %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double*
store double %0, double* %4
store double %1, double* %5
store double* %2, double** %6
%7 = load double, double* %4
%8 = fsub double 1.000000e+00, %7
%9 = load double, double* %5
%10 = fsub double 1.000000e+00, %9
%11 = fmul double %8, %10
%12 = load double*, double** %6
%13 = getelementptr inbounds double, double* %12, i64 0
store double %11, double* %13
%14 = load double, double* %4
%15 = load double, double* %5
%16 = fsub double 1.000000e+00, %15
%17 = fmul double %14, %16
%18 = load double*, double** %6
%19 = getelementptr inbounds double, double* %18, i64 1
store double %17, double* %19
%20 = load double, double* %4
%21 = load double, double* %5
%22 = fmul double %20, %21
%23 = load double*, double** %6
%24 = getelementptr inbounds double, double* %23, i64 2
store double %22, double* %24
%25 = load double, double* %4
%26 = fsub double 1.000000e+00, %25
%27 = load double, double* %5
%28 = fmul double %26, %27
%29 = load double*, double** %6
%30 = getelementptr inbounds double, double* %29, i64 3
store double %28, double* %30
ret void
}

LLVM IR (-O2):
define void @set_bilinear_weights(double %0, double %1, double* nocapture writeonly %2) {
%4 = fsub double 1.000000e+00, %0
%5 = fsub double 1.000000e+00, %1
%6 = insertelement <2 x double> poison, double %5, i64 0
%7 = shufflevector <2 x double> %6, <2 x double> poison, <2 x i32> zeroinitializer
%8 = insertelement <2 x double> poison, double %0, i64 1
%9 = insertelement <2 x double> %8, double %4, i64 0
%10 = fmul <2 x double> %7, %9
%11 = bitcast double* %2 to <2 x double>*
store <2 x double> %10, <2 x double>* %11
%12 = getelementptr inbounds double, double* %2, i64 2
%13 = insertelement <2 x double> poison, double %0, i64 0
%14 = insertelement <2 x double> %13, double %4, i64 1
%15 = insertelement <2 x double> poison, double %1, i64 0
%16 = shufflevector <2 x double> %15, <2 x double> poison, <2 x i32> zeroinitializer
%17 = fmul <2 x double> %14, %16
%18 = bitcast double* %12 to <2 x double>*
store <2 x double> %17, <2 x double>* %18
ret void
}