void __attribute__((no))
vf(double x, __attribute__((vector_size(16))) double *v1,
   __attribute__((vector_size(16))) double *v2,
   __attribute__((vector_size(16))) double *result) {
  __attribute__((vector_size(16))) double s = v1[0];
  __attribute__((vector_size(16))) double t = -v2[0];
  __attribute__((vector_size(16))) double m = {x, x};
  __attribute__((vector_size(16))) double r = t * m + s;
  result[0] = r;
}


x86 assembly (clang, -O0):
<vf>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movapd (%rax),%xmm0
movapd %xmm0,-0x30(%rbp)
mov    -0x18(%rbp),%rax
movaps (%rax),%xmm0
movaps 0xed0(%rip),%xmm1
pxor   %xmm1,%xmm0
movaps %xmm0,-0x40(%rbp)
movsd  -0x8(%rbp),%xmm0
unpcklpd %xmm0,%xmm0
movapd %xmm0,-0x50(%rbp)
movapd -0x40(%rbp),%xmm0
movapd -0x50(%rbp),%xmm2
movapd -0x30(%rbp),%xmm1
mulpd  %xmm2,%xmm0
addpd  %xmm1,%xmm0
movapd %xmm0,-0x60(%rbp)
movapd -0x60(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movapd %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vf>:
movapd (%rdi),%xmm1
unpcklpd %xmm0,%xmm0
mulpd  (%rsi),%xmm0
subpd  %xmm0,%xmm1
movapd %xmm1,(%rdx)
ret

LLVM IR (-O0):
define void @vf(double %0, <2 x double>* %1, <2 x double>* %2, <2 x double>* %3) {
%5 = alloca double
%6 = alloca <2 x double>*
%7 = alloca <2 x double>*
%8 = alloca <2 x double>*
%9 = alloca <2 x double>
%10 = alloca <2 x double>
%11 = alloca <2 x double>
%12 = alloca <2 x double>
store double %0, double* %5
store <2 x double>* %1, <2 x double>** %6
store <2 x double>* %2, <2 x double>** %7
store <2 x double>* %3, <2 x double>** %8
%13 = load <2 x double>*, <2 x double>** %6
%14 = getelementptr inbounds <2 x double>, <2 x double>* %13, i64 0
%15 = load <2 x double>, <2 x double>* %14
store <2 x double> %15, <2 x double>* %9
%16 = load <2 x double>*, <2 x double>** %7
%17 = getelementptr inbounds <2 x double>, <2 x double>* %16, i64 0
%18 = load <2 x double>, <2 x double>* %17
%19 = fneg <2 x double> %18
store <2 x double> %19, <2 x double>* %10
%20 = load double, double* %5
%21 = insertelement <2 x double> undef, double %20, i32 0
%22 = load double, double* %5
%23 = insertelement <2 x double> %21, double %22, i32 1
store <2 x double> %23, <2 x double>* %11
%24 = load <2 x double>, <2 x double>* %10
%25 = load <2 x double>, <2 x double>* %11
%26 = load <2 x double>, <2 x double>* %9
%27 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %24, <2 x double> %25, <2 x double> %26)
store <2 x double> %27, <2 x double>* %12
%28 = load <2 x double>, <2 x double>* %12
%29 = load <2 x double>*, <2 x double>** %8
%30 = getelementptr inbounds <2 x double>, <2 x double>* %29, i64 0
store <2 x double> %28, <2 x double>* %30
ret void
}

LLVM IR (-O2):
define void @vf(double %0, <2 x double>* nocapture %1, <2 x double>* nocapture %2, <2 x double>* nocapture writeonly %3) {
%5 = load <2 x double>, <2 x double>* %1
%6 = load <2 x double>, <2 x double>* %2
%7 = fneg <2 x double> %6
%8 = insertelement <2 x double> undef, double %0, i64 0
%9 = shufflevector <2 x double> %8, <2 x double> poison, <2 x i32> zeroinitializer
%10 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %7, <2 x double> %9, <2 x double> %5)
store <2 x double> %10, <2 x double>* %3
ret void
}