Skip to content
Commit e9a6453d authored by Chris Lattner's avatar Chris Lattner
Browse files

add some infrastructure for codegen'ing complex numbers. implement addition

of complex.  We now produce optimal code for:

void test(_Complex float *Y) {
  *Y = *Y + *Y;
}

$ clang -emit-llvm cg.c | llvm-as | opt -std-compile-opts | llc -march=x86-64
...
_test:
        movss (%rdi), %xmm0
        addss %xmm0, %xmm0
        movss 4(%rdi), %xmm1
        movss %xmm0, (%rdi)
        addss %xmm1, %xmm1
        movss %xmm1, 4(%rdi)
        ret

llvm-svn: 39673
parent c6395936
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment