Mercurial > hg > graal-jvmci-8
comparison src/share/vm/runtime/sharedRuntimeTrig.cpp @ 1485:fb57d4cf76c2
6931180: Migration to recent versions of MS Platform SDK
6951582: Build problems on win64
Summary: Changes to enable building JDK7 with Microsoft Visual Studio 2010
Reviewed-by: ohair, art, ccheung, dcubed
author | prr |
---|---|
date | Tue, 11 May 2010 14:35:43 -0700 |
parents | a61af66fc99e |
children | c18cbe5936b8 |
comparison
equal
deleted
inserted
replaced
1403:3221d1887d30 | 1485:fb57d4cf76c2 |
---|---|
37 // Enabling optimizations in this file causes incorrect code to be | 37 // Enabling optimizations in this file causes incorrect code to be |
38 // generated; can not figure out how to turn down optimization for one | 38 // generated; can not figure out how to turn down optimization for one |
39 // file in the IDE on Windows | 39 // file in the IDE on Windows |
40 #ifdef WIN32 | 40 #ifdef WIN32 |
41 # pragma optimize ( "", off ) | 41 # pragma optimize ( "", off ) |
42 #endif | |
43 | |
44 /* The above workaround now causes more problems with the latest MS compiler. | |
45 * Visual Studio 2010's /GS option tries to guard against buffer overruns. | |
46 * /GS is on by default if you specify optimizations, which we do globally | |
47 * via /W3 /O2. However the above selective turning off of optimizations means | |
48 * that /GS issues a warning "4748". And since we treat warnings as errors (/WX) | |
49 * then the compilation fails. There are several possible solutions | |
50 * (1) Remove that pragma above as obsolete with VS2010 - requires testing. | |
51 * (2) Stop treating warnings as errors - would be a backward step | |
52 * (3) Disable /GS - may help performance but you lose the security checks | |
53 * (4) Disable the warning with "#pragma warning( disable : 4748 )" | |
54 * (5) Disable planting the code with __declspec(safebuffers) | |
55 * I've opted for (5) although we should investigate the local performance | |
56 * benefits of (1) and global performance benefit of (3). | |
57 */ | |
58 #if defined(WIN32) && (defined(_MSC_VER) && (_MSC_VER >= 1600)) | |
59 #define SAFEBUF __declspec(safebuffers) | |
60 #else | |
61 #define SAFEBUF | |
42 #endif | 62 #endif |
43 | 63 |
44 #include <math.h> | 64 #include <math.h> |
45 | 65 |
46 // VM_LITTLE_ENDIAN is #defined appropriately in the Makefiles | 66 // VM_LITTLE_ENDIAN is #defined appropriately in the Makefiles |
233 zeroB = 0.0, | 253 zeroB = 0.0, |
234 one = 1.0, | 254 one = 1.0, |
235 two24B = 1.67772160000000000000e+07, /* 0x41700000, 0x00000000 */ | 255 two24B = 1.67772160000000000000e+07, /* 0x41700000, 0x00000000 */ |
236 twon24 = 5.96046447753906250000e-08; /* 0x3E700000, 0x00000000 */ | 256 twon24 = 5.96046447753906250000e-08; /* 0x3E700000, 0x00000000 */ |
237 | 257 |
238 static int __kernel_rem_pio2(double *x, double *y, int e0, int nx, int prec, const int *ipio2) { | 258 static SAFEBUF int __kernel_rem_pio2(double *x, double *y, int e0, int nx, int prec, const int *ipio2) { |
239 int jz,jx,jv,jp,jk,carry,n,iq[20],i,j,k,m,q0,ih; | 259 int jz,jx,jv,jp,jk,carry,n,iq[20],i,j,k,m,q0,ih; |
240 double z,fw,f[20],fq[20],q[20]; | 260 double z,fw,f[20],fq[20],q[20]; |
241 | 261 |
242 /* initialize jk*/ | 262 /* initialize jk*/ |
243 jk = init_jk[prec]; | 263 jk = init_jk[prec]; |
449 pio2_2 = 6.07710050630396597660e-11, /* 0x3DD0B461, 0x1A600000 */ | 469 pio2_2 = 6.07710050630396597660e-11, /* 0x3DD0B461, 0x1A600000 */ |
450 pio2_2t = 2.02226624879595063154e-21, /* 0x3BA3198A, 0x2E037073 */ | 470 pio2_2t = 2.02226624879595063154e-21, /* 0x3BA3198A, 0x2E037073 */ |
451 pio2_3 = 2.02226624871116645580e-21, /* 0x3BA3198A, 0x2E000000 */ | 471 pio2_3 = 2.02226624871116645580e-21, /* 0x3BA3198A, 0x2E000000 */ |
452 pio2_3t = 8.47842766036889956997e-32; /* 0x397B839A, 0x252049C1 */ | 472 pio2_3t = 8.47842766036889956997e-32; /* 0x397B839A, 0x252049C1 */ |
453 | 473 |
454 static int __ieee754_rem_pio2(double x, double *y) { | 474 static SAFEBUF int __ieee754_rem_pio2(double x, double *y) { |
455 double z,w,t,r,fn; | 475 double z,w,t,r,fn; |
456 double tx[3]; | 476 double tx[3]; |
457 int e0,i,j,nx,n,ix,hx,i0; | 477 int e0,i,j,nx,n,ix,hx,i0; |
458 | 478 |
459 i0 = ((*(int*)&two24A)>>30)^1; /* high word index */ | 479 i0 = ((*(int*)&two24A)>>30)^1; /* high word index */ |