- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Can anyone interpret "call __libm_sse2_sincos". I simply understand it as computation of sine and cosine of the same number.
I did got above during generation of .S for C/C++ source code using ICC-v11.0 on Linux x86_64 Intel Xeon 5345 processor.
Out of curiosity, wish to know the list of SSE2/SSE3/SSE4 built-in libraries (libm_sse2_sincos, etc.) to support SSE2/SSE3/SSE4 if any.
~BR
Mukkaysh Srivastav
Can anyone interpret "call __libm_sse2_sincos". I simply understand it as computation of sine and cosine of the same number.
I did got above during generation of .S for C/C++ source code using ICC-v11.0 on Linux x86_64 Intel Xeon 5345 processor.
Out of curiosity, wish to know the list of SSE2/SSE3/SSE4 built-in libraries (libm_sse2_sincos, etc.) to support SSE2/SSE3/SSE4 if any.
~BR
Mukkaysh Srivastav
Link Copied
9 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The sincos function returns both the sine and cosine of x measured in radians. This function may be inlined by the Itanium compiler.
Calling interface:
void sincos(double x, double *sinval, double *cosval);
void sincosl(long double x, long double *sinval, long double *cosval);
void sincosf(float x, float *sinval, float *cosval);
The compiler may optimize the function and use appropriate built-ins. The built-ins are not documented. You may find some of the math built-is mentioned in mathimf.h header file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Om Sachan (Intel)
The sincos function returns both the sine and cosine of x measured in radians. This function may be inlined by the Itanium compiler.
Calling interface:
void sincos(double x, double *sinval, double *cosval);
void sincosl(long double x, long double *sinval, long double *cosval);
void sincosf(float x, float *sinval, float *cosval);
The compiler may optimize the function and use appropriate built-ins. The built-ins are not documented. You may find some of the math built-is mentioned in mathimf.h header file.
Since you listed couple of sincos() built-ins, how can I compare and know useability (i.e., performances) of sincos() & w.r.t other fsin, fcos, __libm_SSE2_sin, etc.
What you call these type of built-in attributes for SSE2? Is this some enhanced library support for SSE(n) on Intel Xeon processors?
I did find sincos reference in "/app/intel/Compiler/11.0/074/include/mathimf.h & math.h".
Why ICC-v11.0 uses __libm_SSE2_sin, __libm_SSE2_sincos rather than fsin, fsincos, etc?
Morover, the same C/C++ code if done to generate with -O3, it has seperate "call cos" & "call sin" within .S, not able to figure out the difference with these built-in calls with seperate -On levels.
~BR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You may ignore my comment regarding Itanium. Sorry for refereing it by mistake.
The fsin and fcos instruction are available in old Intel processors. The __libm_SSE2_sin, __libm_SSE2_sincos are available in newer Intel processors (at least from Intel Pentium IV onwards) and are faster.
Depending on the compiler options, the compiler generates suitable code for the targeted platform.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Om Sachan (Intel)
You may ignore my comment regarding Itanium. Sorry for refereing it by mistake.
The fsin and fcos instruction are available in old Intel processors. The __libm_SSE2_sin, __libm_SSE2_sincos are available in newer Intel processors (at least from Intel Pentium IV onwards) and are faster.
Depending on the compiler options, the compiler generates suitable code for the targeted platform.
Looking for better explanation.
~Br
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Om Sachan (Intel)
You may ignore my comment regarding Itanium. Sorry for refereing it by mistake.
The fsin and fcos instruction are available in old Intel processors. The __libm_SSE2_sin, __libm_SSE2_sincos are available in newer Intel processors (at least from Intel Pentium IV onwards) and are faster.
Depending on the compiler options, the compiler generates suitable code for the targeted platform.
~BR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Not knowing specifically what you still want to know, I'll add one or two comments.
fsin, fsincos should be used only with the option /arch:ia32 of the 32-bit compiler. As these instructions use x87 top of stack register, there would be a large delay involved in moving data through memory when mixing them into SSE code.
Provision of SSE2 math functions is among the performance advantages of the Intel compilers. Although a similar math library may be expected to appear some day for gcc, it has been a long time in development.
fsin, fsincos should be used only with the option /arch:ia32 of the 32-bit compiler. As these instructions use x87 top of stack register, there would be a large delay involved in moving data through memory when mixing them into SSE code.
Provision of SSE2 math functions is among the performance advantages of the Intel compilers. Although a similar math library may be expected to appear some day for gcc, it has been a long time in development.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - tim18
Not knowing specifically what you still want to know, I'll add one or two comments.
fsin, fsincos should be used only with the option /arch:ia32 of the 32-bit compiler. As these instructions use x87 top of stack register, there would be a large delay involved in moving data through memory when mixing them into SSE code.
Provision of SSE2 math functions is among the performance advantages of the Intel compilers. Although a similar math library may be expected to appear some day for gcc, it has been a long time in development.
fsin, fsincos should be used only with the option /arch:ia32 of the 32-bit compiler. As these instructions use x87 top of stack register, there would be a large delay involved in moving data through memory when mixing them into SSE code.
Provision of SSE2 math functions is among the performance advantages of the Intel compilers. Although a similar math library may be expected to appear some day for gcc, it has been a long time in development.
$as -o file.o file.s
$ld -o file file
so I get from "ld" as -
---
file.o(.text+0x68): In function `B3':
: undefined reference to `fmod'
file.o(.text+0x6d): In function `B12':
: undefined reference to `__libm_sse2_sincos'
---
If I incorporate, dynamic-linking "-lm" as "ld -o file -lm file.o", fmod is through which means fmod is define in "libm", but I get an error message from ld as -
--------
file.o(.text+0x6d): In function `B12':
: undefined reference to `__libm_sse2_sincos'
-------
As, I said earlier, __lib_sse2_sincos is defined in both ../../11.0/074/include/math.h & ../../11.0/074/include/mathimf.h , do you have any information if __libm_sse2_sincos is provided as one of the contents of any library which I can either call through static or dynamic linking
OR
How can I pass reference to __libm_sse2_sincos in .S file in .bss section of it, such that when I perform "call __lib_sse2_sincos", ld understands the memory reference of it as an address.
Also, you qouted "Although a similar math library may be expected to appear some day for gcc ..." could I either have some reference or link to it, great news .. Thanks.
~BR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You could use dumpbin or the utility of your choice to see which of the libraries provided by icc include this function, and you could generate a .s file for an example .c file to see how icc invokes it. It's not really intended to be invoked except by standard C or C++ sin/cos intrinsics, as far as I know, and I don't see a good reason for you to pursue your tack.
I haven't seen any schedule for submission of gcc-compatible SSE3 libraries.
I haven't seen any schedule for submission of gcc-compatible SSE3 libraries.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - tim18
You could use dumpbin or the utility of your choice to see which of the libraries provided by icc include this function, and you could generate a .s file for an example .c file to see how icc invokes it. It's not really intended to be invoked except by standard C or C++ sin/cos intrinsics, as far as I know, and I don't see a good reason for you to pursue your tack.
I haven't seen any schedule for submission of gcc-compatible SSE3 libraries.
I haven't seen any schedule for submission of gcc-compatible SSE3 libraries.
Looking if someone from Intel Compiler Team could suggest either with a .S prototype of calling __lib_sse2_sincos or is their any dynamic/static linking possible for __lib_sse2_sincos. Intel Compiler team might have used _lib_sse2_sincos either in .S call or as -I/../..include/mathimf.h .
~BR

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page