http://llvm.org/bugs/show_bug.cgi?id=19356
Bug ID: 19356
Summary: builtin cabs(z) resp. hypot(z) squared should be
optimized
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: LLVM Codegen
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
#include <complex>
float abs2(std::complex<float> c)
{
return abs(c) * abs(c);
}
$ clang++ -mllvm --x86-asm-syntax=intel -std=c++11 -O3 -g -ffast-math -S
test.cpp
.type bar(std::complex<float>),@function
bar(std::complex<float>): # @bar(std::complex<float>)
.Lfunc_begin0:
# BB#0: # %entry
.loc 3 584 0 prologue_end # /usr/include/c++/4.8/complex:584:0
582:/usr/include/c++/4.8/complex **** #if _GLIBCXX_USE_C99_COMPLEX
583:/usr/include/c++/4.8/complex **** inline float
584:/usr/include/c++/4.8/complex **** __complex_abs(__complex__ float __z) {
return __builtin_cabsf(__z); }
push rax
.Ltmp0:
.cfi_def_cfa_offset 16
call cabsf
.Ltmp1:
.loc 1 4 18 # testcomplex.cpp:4:18
mulss xmm0, xmm0
pop rax
ret
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs