void pd_minus(double *a) {
  a[0] = -a[0];
  a[1] = -a[1];
  a[2] = -a[2];
  a[3] = -a[3];
  a[4] = -a[4];
}


x86 assembly (clang, -O0):
<pd_minus>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x18(%rax)
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x20(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<pd_minus>:
movaps 0xef9(%rip),%xmm0
movups (%rdi),%xmm1
movups 0x10(%rdi),%xmm2
xorps  %xmm0,%xmm1
movups %xmm1,(%rdi)
xorps  %xmm0,%xmm2
movups %xmm2,0x10(%rdi)
movsd  0x20(%rdi),%xmm1
xorps  %xmm0,%xmm1
movlps %xmm1,0x20(%rdi)
ret

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

LLVM IR (-O2):
define void @pd_minus(double* nocapture %0) {
%2 = bitcast double* %0 to <2 x double>*
%3 = load <2 x double>, <2 x double>* %2
%4 = fneg <2 x double> %3
%5 = bitcast double* %0 to <2 x double>*
store <2 x double> %4, <2 x double>* %5
%6 = getelementptr inbounds double, double* %0, i64 2
%7 = bitcast double* %6 to <2 x double>*
%8 = load <2 x double>, <2 x double>* %7
%9 = fneg <2 x double> %8
%10 = bitcast double* %6 to <2 x double>*
store <2 x double> %9, <2 x double>* %10
%11 = getelementptr inbounds double, double* %0, i64 4
%12 = load double, double* %11
%13 = fneg double %12
store double %13, double* %11
ret void
}