- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hardware: Centrino 2 vPro (Core2Duo) in 64-bit mode
O.S.: Linux Fedora Core 10 in 64-bit mode
Compiler: Intel icc 11.1, 072 in Intel64 mode
Command line options: "-msse3 -O0 -fp-model strict -fp-speculation=strict -H ${INCS}"
Results: bad 3 and bad 4 => multiply and divide of decimal floating point done wrong.
Program:
#define __STDC_WANT_DEC_FP__ 1 /* Tell compiler we want DFP */
#include
int main(void){
int j;
_Decimal32 x,y;
x = 1.0000000DF;
for(j=1; j<=3; j++){
y = x + 10.000000DF;
if( y == x ) (void)printf("Bad1\\n");
x = y;
}
x = 1.0000000DF;
for(j=1; j<=3; j++){
y = x - 10.000000DF;
if( y == x ) (void)printf("Bad2\\n");
x = y;
}
x = 1.0000000DF;
for(j=1; j<=3; j++){
y = x * 10.000000DF;
if( y == x ) (void)printf("Bad3\\n");
x = y;
}
x = 1.0000000DF;
for(j=1; j<=3; j++){
y = x / 10.000000DF;
if( y == x ) (void)printf("Bad4\\n");
x = y;
}
return 0;
}
O.S.: Linux Fedora Core 10 in 64-bit mode
Compiler: Intel icc 11.1, 072 in Intel64 mode
Command line options: "-msse3 -O0 -fp-model strict -fp-speculation=strict -H ${INCS}"
Results: bad 3 and bad 4 => multiply and divide of decimal floating point done wrong.
Program:
#define __STDC_WANT_DEC_FP__ 1 /* Tell compiler we want DFP */
#include
int main(void){
int j;
_Decimal32 x,y;
x = 1.0000000DF;
for(j=1; j<=3; j++){
y = x + 10.000000DF;
if( y == x ) (void)printf("Bad1\\n");
x = y;
}
x = 1.0000000DF;
for(j=1; j<=3; j++){
y = x - 10.000000DF;
if( y == x ) (void)printf("Bad2\\n");
x = y;
}
x = 1.0000000DF;
for(j=1; j<=3; j++){
y = x * 10.000000DF;
if( y == x ) (void)printf("Bad3\\n");
x = y;
}
x = 1.0000000DF;
for(j=1; j<=3; j++){
y = x / 10.000000DF;
if( y == x ) (void)printf("Bad4\\n");
x = y;
}
return 0;
}
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for raising the issue. I have escalated this issue to the developer team. The gcc from 4.3.x and later give the correct result, i.e, no "Bad" output. While, icc give the Bad3 & Bad4 output.
There seem to be quite many issues with Decimal data types. One of the recent is here:--
http://software.intel.com/en-us/forums/showthread.php?t=75875
There seem to be quite many issues with Decimal data types. One of the recent is here:--
http://software.intel.com/en-us/forums/showthread.php?t=75875
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This issue has been resolved in 12.1 compilers.
Closing the issue now.
Closing the issue now.
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