---------------------------------------------------------------------- For compilers (such as Microsoft VC++) which don't allow "LL" after a constant to make it 64-bit, this patch declares all such constants as BX_CONST64(value). Then in config.in, a switch called BX_64BIT_CONSTANTS_USE_LL controls whether the macro puts the LL's in or not. Configure sets the macro, if you're on a platform that can run such things. To patch, go to main bochs directory. Type "patch -p1 < THIS_PATCH_FILE". ---------------------------------------------------------------------- diff -cr clean-portable1/config.h.in 64bit-constant/config.h.in *** clean-portable1/config.h.in Wed Apr 4 18:52:18 2001 --- 64bit-constant/config.h.in Wed Apr 4 18:41:05 2001 *************** *** 264,269 **** --- 264,277 ---- #define SIZEOF_UNSIGNED_LONG_LONG 0 #define SIZEOF_INT_P 0 + #define BX_64BIT_CONSTANTS_USE_LL 1 + #if BX_64BIT_CONSTANTS_USE_LL + // doesn't work on Microsoft Visual C++, maybe others + #define BX_CONST64(x) (x##LL) + #else + #define BX_CONST64(x) (x) + #endif + #if BX_WITH_WIN32 typedef unsigned char Bit8u; typedef signed char Bit8s; diff -cr clean-portable1/configure 64bit-constant/configure *** clean-portable1/configure Wed Apr 4 18:52:18 2001 --- 64bit-constant/configure Wed Apr 4 18:45:11 2001 *************** *** 2582,2589 **** cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking for cpu level""... $ac_c" 1>&6 ! echo "configure:2587: checking for cpu level" >&5 # Check whether --enable-cpu-level or --disable-cpu-level was given. if test "${enable_cpu_level+set}" = set; then enableval="$enable_cpu_level" --- 2582,2617 ---- cross_compiling=$ac_cv_prog_cc_cross + echo $ac_n "checking if compiler allows LL for 64-bit constants""... $ac_c" 1>&6 + echo "configure:2587: checking if compiler allows LL for 64-bit constants" >&5 + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + echo "$ac_t""yes" 1>&6 + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + + echo "$ac_t""no" 1>&6 + cat >> confdefs.h <<\EOF + #define BX_64BIT_CONSTANTS_USE_LL 0 + EOF + + + fi + rm -f conftest* + + echo $ac_n "checking for cpu level""... $ac_c" 1>&6 ! echo "configure:2615: checking for cpu level" >&5 # Check whether --enable-cpu-level or --disable-cpu-level was given. if test "${enable_cpu_level+set}" = set; then enableval="$enable_cpu_level" *************** *** 2646,2652 **** echo $ac_n "checking for dynamic translation support""... $ac_c" 1>&6 ! echo "configure:2650: checking for dynamic translation support" >&5 # Check whether --enable-dynamic or --disable-dynamic was given. if test "${enable_dynamic+set}" = set; then enableval="$enable_dynamic" --- 2674,2680 ---- echo $ac_n "checking for dynamic translation support""... $ac_c" 1>&6 ! echo "configure:2678: checking for dynamic translation support" >&5 # Check whether --enable-dynamic or --disable-dynamic was given. if test "${enable_dynamic+set}" = set; then enableval="$enable_dynamic" *************** *** 2719,2725 **** echo $ac_n "checking for NE2000 support""... $ac_c" 1>&6 ! echo "configure:2723: checking for NE2000 support" >&5 # Check whether --enable-ne2000 or --disable-ne2000 was given. if test "${enable_ne2000+set}" = set; then enableval="$enable_ne2000" --- 2747,2753 ---- echo $ac_n "checking for NE2000 support""... $ac_c" 1>&6 ! echo "configure:2751: checking for NE2000 support" >&5 # Check whether --enable-ne2000 or --disable-ne2000 was given. if test "${enable_ne2000+set}" = set; then enableval="$enable_ne2000" *************** *** 2754,2760 **** echo $ac_n "checking for i440FX PCI support""... $ac_c" 1>&6 ! echo "configure:2758: checking for i440FX PCI support" >&5 # Check whether --enable-pci or --disable-pci was given. if test "${enable_pci+set}" = set; then enableval="$enable_pci" --- 2782,2788 ---- echo $ac_n "checking for i440FX PCI support""... $ac_c" 1>&6 ! echo "configure:2786: checking for i440FX PCI support" >&5 # Check whether --enable-pci or --disable-pci was given. if test "${enable_pci+set}" = set; then enableval="$enable_pci" *************** *** 2789,2795 **** echo $ac_n "checking for port e9 hack""... $ac_c" 1>&6 ! echo "configure:2793: checking for port e9 hack" >&5 # Check whether --enable-port-e9-hack or --disable-port-e9-hack was given. if test "${enable_port_e9_hack+set}" = set; then enableval="$enable_port_e9_hack" --- 2817,2823 ---- echo $ac_n "checking for port e9 hack""... $ac_c" 1>&6 ! echo "configure:2821: checking for port e9 hack" >&5 # Check whether --enable-port-e9-hack or --disable-port-e9-hack was given. if test "${enable_port_e9_hack+set}" = set; then enableval="$enable_port_e9_hack" *************** *** 2820,2826 **** echo $ac_n "checking for use of .cpp as suffix""... $ac_c" 1>&6 ! echo "configure:2824: checking for use of .cpp as suffix" >&5 # Check whether --enable-cpp or --disable-cpp was given. if test "${enable_cpp+set}" = set; then enableval="$enable_cpp" --- 2848,2854 ---- echo $ac_n "checking for use of .cpp as suffix""... $ac_c" 1>&6 ! echo "configure:2852: checking for use of .cpp as suffix" >&5 # Check whether --enable-cpp or --disable-cpp was given. if test "${enable_cpp+set}" = set; then enableval="$enable_cpp" *************** *** 2862,2868 **** echo $ac_n "checking for Bochs internal debugger support""... $ac_c" 1>&6 ! echo "configure:2866: checking for Bochs internal debugger support" >&5 # Check whether --enable-debugger or --disable-debugger was given. if test "${enable_debugger+set}" = set; then enableval="$enable_debugger" --- 2890,2896 ---- echo $ac_n "checking for Bochs internal debugger support""... $ac_c" 1>&6 ! echo "configure:2894: checking for Bochs internal debugger support" >&5 # Check whether --enable-debugger or --disable-debugger was given. if test "${enable_debugger+set}" = set; then enableval="$enable_debugger" *************** *** 2900,2906 **** echo $ac_n "checking for disassembler support""... $ac_c" 1>&6 ! echo "configure:2904: checking for disassembler support" >&5 # Check whether --enable-disasm or --disable-disasm was given. if test "${enable_disasm+set}" = set; then enableval="$enable_disasm" --- 2928,2934 ---- echo $ac_n "checking for disassembler support""... $ac_c" 1>&6 ! echo "configure:2932: checking for disassembler support" >&5 # Check whether --enable-disasm or --disable-disasm was given. if test "${enable_disasm+set}" = set; then enableval="$enable_disasm" *************** *** 2947,2953 **** echo $ac_n "checking for loader support""... $ac_c" 1>&6 ! echo "configure:2951: checking for loader support" >&5 # Check whether --enable-loader or --disable-loader was given. if test "${enable_loader+set}" = set; then enableval="$enable_loader" --- 2975,2981 ---- echo $ac_n "checking for loader support""... $ac_c" 1>&6 ! echo "configure:2979: checking for loader support" >&5 # Check whether --enable-loader or --disable-loader was given. if test "${enable_loader+set}" = set; then enableval="$enable_loader" *************** *** 2985,2991 **** INSTRUMENT_DIR='instrument/stubs' echo $ac_n "checking for instrumentation support""... $ac_c" 1>&6 ! echo "configure:2989: checking for instrumentation support" >&5 # Check whether --enable-instrumentation or --disable-instrumentation was given. if test "${enable_instrumentation+set}" = set; then enableval="$enable_instrumentation" --- 3013,3019 ---- INSTRUMENT_DIR='instrument/stubs' echo $ac_n "checking for instrumentation support""... $ac_c" 1>&6 ! echo "configure:3017: checking for instrumentation support" >&5 # Check whether --enable-instrumentation or --disable-instrumentation was given. if test "${enable_instrumentation+set}" = set; then enableval="$enable_instrumentation" *************** *** 3120,3126 **** echo $ac_n "checking for VGA emulation""... $ac_c" 1>&6 ! echo "configure:3124: checking for VGA emulation" >&5 # Check whether --enable-vga or --disable-vga was given. if test "${enable_vga+set}" = set; then enableval="$enable_vga" --- 3148,3154 ---- echo $ac_n "checking for VGA emulation""... $ac_c" 1>&6 ! echo "configure:3152: checking for VGA emulation" >&5 # Check whether --enable-vga or --disable-vga was given. if test "${enable_vga+set}" = set; then enableval="$enable_vga" *************** *** 3154,3160 **** echo $ac_n "checking for FPU emulation""... $ac_c" 1>&6 ! echo "configure:3158: checking for FPU emulation" >&5 FPU_VAR='' FPU_GLUE_OBJ='' # Check whether --enable-fpu or --disable-fpu was given. --- 3182,3188 ---- echo $ac_n "checking for FPU emulation""... $ac_c" 1>&6 ! echo "configure:3186: checking for FPU emulation" >&5 FPU_VAR='' FPU_GLUE_OBJ='' # Check whether --enable-fpu or --disable-fpu was given. *************** *** 3196,3202 **** echo $ac_n "checking for x86 debugger support""... $ac_c" 1>&6 ! echo "configure:3200: checking for x86 debugger support" >&5 # Check whether --enable-x86-debugger or --disable-x86-debugger was given. if test "${enable_x86_debugger+set}" = set; then enableval="$enable_x86_debugger" --- 3224,3230 ---- echo $ac_n "checking for x86 debugger support""... $ac_c" 1>&6 ! echo "configure:3228: checking for x86 debugger support" >&5 # Check whether --enable-x86-debugger or --disable-x86-debugger was given. if test "${enable_x86_debugger+set}" = set; then enableval="$enable_x86_debugger" *************** *** 3232,3238 **** echo $ac_n "checking for CDROM support""... $ac_c" 1>&6 ! echo "configure:3236: checking for CDROM support" >&5 # Check whether --enable-cdrom or --disable-cdrom was given. if test "${enable_cdrom+set}" = set; then enableval="$enable_cdrom" --- 3260,3266 ---- echo $ac_n "checking for CDROM support""... $ac_c" 1>&6 ! echo "configure:3264: checking for CDROM support" >&5 # Check whether --enable-cdrom or --disable-cdrom was given. if test "${enable_cdrom+set}" = set; then enableval="$enable_cdrom" *************** *** 3274,3280 **** echo $ac_n "checking for Sound Blaster 16 support""... $ac_c" 1>&6 ! echo "configure:3278: checking for Sound Blaster 16 support" >&5 # Check whether --enable-sb16 or --disable-sb16 was given. if test "${enable_sb16+set}" = set; then enableval="$enable_sb16" --- 3302,3308 ---- echo $ac_n "checking for Sound Blaster 16 support""... $ac_c" 1>&6 ! echo "configure:3306: checking for Sound Blaster 16 support" >&5 # Check whether --enable-sb16 or --disable-sb16 was given. if test "${enable_sb16+set}" = set; then enableval="$enable_sb16" diff -cr clean-portable1/configure.in 64bit-constant/configure.in *** clean-portable1/configure.in Wed Apr 4 18:52:18 2001 --- 64bit-constant/configure.in Wed Apr 4 18:45:09 2001 *************** *** 60,65 **** --- 60,74 ---- ]) AC_LANG_RESTORE + AC_MSG_CHECKING(if compiler allows LL for 64-bit constants) + AC_TRY_COMPILE([], [ { 42LL; } ], + AC_MSG_RESULT(yes), + [ + AC_MSG_RESULT(no) + AC_DEFINE(BX_64BIT_CONSTANTS_USE_LL, 0) + ]) + AC_LANG_RESTORE + AC_MSG_CHECKING(for cpu level) AC_ARG_ENABLE(cpu-level, [ --enable-cpu-level select cpu level (3,4,5)], diff -cr clean-portable1/fpu/errors.c 64bit-constant/fpu/errors.c *** clean-portable1/fpu/errors.c Wed Apr 4 18:52:18 2001 --- 64bit-constant/fpu/errors.c Wed Apr 4 18:47:33 2001 *************** *** 18,25 **** +---------------------------------------------------------------------------*/ #include - #include #include "fpu_emu.h" #include "fpu_system.h" --- 18,25 ---- +---------------------------------------------------------------------------*/ #include #include + #include #include "fpu_emu.h" #include "fpu_system.h" *************** *** 654,666 **** { case 01: case PR_64_BITS: ! significand(dest) = 0xffffffffffffffffLL; break; case PR_53_BITS: ! significand(dest) = 0xfffffffffffff800LL; break; case PR_24_BITS: ! significand(dest) = 0xffffff0000000000LL; break; } } --- 654,666 ---- { case 01: case PR_64_BITS: ! significand(dest) = BX_CONST64(0xffffffffffffffff); break; case PR_53_BITS: ! significand(dest) = BX_CONST64(0xfffffffffffff800); break; case PR_24_BITS: ! significand(dest) = BX_CONST64(0xffffff0000000000); break; } } diff -cr clean-portable1/fpu/fpu_trig.c 64bit-constant/fpu/fpu_trig.c *** clean-portable1/fpu/fpu_trig.c Wed Apr 4 18:52:18 2001 --- 64bit-constant/fpu/fpu_trig.c Wed Apr 4 18:14:35 2001 *************** *** 707,713 **** { if ( (exponent(st0_ptr) < 0) || ((exponent(st0_ptr) == 0) ! && (significand(st0_ptr) <= 0xc90fdaa22168c234LL)) ) { poly_cos(st0_ptr); --- 707,713 ---- { if ( (exponent(st0_ptr) < 0) || ((exponent(st0_ptr) == 0) ! && (significand(st0_ptr) <= BX_CONST64(0xc90fdaa22168c234))) ) { poly_cos(st0_ptr); diff -cr clean-portable1/fpu/poly_2xm1.c 64bit-constant/fpu/poly_2xm1.c *** clean-portable1/fpu/poly_2xm1.c Wed Apr 4 18:52:18 2001 --- 64bit-constant/fpu/poly_2xm1.c Wed Apr 4 18:14:35 2001 *************** *** 21,37 **** #define HIPOWER 11 static const u64 lterms[HIPOWER] = { ! 0x0000000000000000LL, /* This term done separately as 12 bytes */ ! 0xf5fdeffc162c7543LL, ! 0x1c6b08d704a0bfa6LL, ! 0x0276556df749cc21LL, ! 0x002bb0ffcf14f6b8LL, ! 0x0002861225ef751cLL, ! 0x00001ffcbfcd5422LL, ! 0x00000162c005d5f1LL, ! 0x0000000da96ccb1bLL, ! 0x0000000078d1b897LL, ! 0x000000000422b029LL }; static const Xsig hiterm = MK_XSIG(0xb17217f7, 0xd1cf79ab, 0xc8a39194); --- 21,37 ---- #define HIPOWER 11 static const u64 lterms[HIPOWER] = { ! BX_CONST64(0x0000000000000000), /* This term done separately as 12 bytes */ ! BX_CONST64(0xf5fdeffc162c7543), ! BX_CONST64(0x1c6b08d704a0bfa6), ! BX_CONST64(0x0276556df749cc21), ! BX_CONST64(0x002bb0ffcf14f6b8), ! BX_CONST64(0x0002861225ef751c), ! BX_CONST64(0x00001ffcbfcd5422), ! BX_CONST64(0x00000162c005d5f1), ! BX_CONST64(0x0000000da96ccb1b), ! BX_CONST64(0x0000000078d1b897), ! BX_CONST64(0x000000000422b029) }; static const Xsig hiterm = MK_XSIG(0xb17217f7, 0xd1cf79ab, 0xc8a39194); diff -cr clean-portable1/fpu/poly_atan.c 64bit-constant/fpu/poly_atan.c *** clean-portable1/fpu/poly_atan.c Wed Apr 4 18:52:18 2001 --- 64bit-constant/fpu/poly_atan.c Wed Apr 4 18:42:36 2001 *************** *** 21,47 **** #define HIPOWERon 6 /* odd poly, negative terms */ static const u64 oddnegterms[HIPOWERon] = { ! 0x0000000000000000LL, /* Dummy (not for - 1.0) */ ! 0x015328437f756467LL, ! 0x0005dda27b73dec6LL, ! 0x0000226bf2bfb91aLL, ! 0x000000ccc439c5f7LL, ! 0x0000000355438407LL } ; #define HIPOWERop 6 /* odd poly, positive terms */ static const u64 oddplterms[HIPOWERop] = { ! /* 0xaaaaaaaaaaaaaaabLL, transferred to fixedpterm[] */ ! 0x0db55a71875c9ac2LL, ! 0x0029fce2d67880b0LL, ! 0x0000dfd3908b4596LL, ! 0x00000550fd61dab4LL, ! 0x0000001c9422b3f9LL, ! 0x000000003e3301e1LL }; ! static const u64 denomterm = 0xebd9b842c5c53a0eLL; static const Xsig fixedpterm = MK_XSIG(0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa); --- 21,47 ---- #define HIPOWERon 6 /* odd poly, negative terms */ static const u64 oddnegterms[HIPOWERon] = { ! BX_CONST64(0x0000000000000000), /* Dummy (not for - 1.0) */ ! BX_CONST64(0x015328437f756467), ! BX_CONST64(0x0005dda27b73dec6), ! BX_CONST64(0x0000226bf2bfb91a), ! BX_CONST64(0x000000ccc439c5f7), ! BX_CONST64(0x0000000355438407) } ; #define HIPOWERop 6 /* odd poly, positive terms */ static const u64 oddplterms[HIPOWERop] = { ! /* BX_CONST64(0xaaaaaaaaaaaaaaab), transferred to fixedpterm[] */ ! BX_CONST64(0x0db55a71875c9ac2), ! BX_CONST64(0x0029fce2d67880b0), ! BX_CONST64(0x0000dfd3908b4596), ! BX_CONST64(0x00000550fd61dab4), ! BX_CONST64(0x0000001c9422b3f9), ! BX_CONST64(0x000000003e3301e1) }; ! static const u64 denomterm = BX_CONST64(0xebd9b842c5c53a0e); static const Xsig fixedpterm = MK_XSIG(0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa); diff -cr clean-portable1/fpu/poly_l2.c 64bit-constant/fpu/poly_l2.c *** clean-portable1/fpu/poly_l2.c Wed Apr 4 18:52:18 2001 --- 64bit-constant/fpu/poly_l2.c Wed Apr 4 18:14:35 2001 *************** *** 181,196 **** #define HIPOWER 10 static const u64 logterms[HIPOWER] = { ! 0x2a8eca5705fc2ef0LL, ! 0xf6384ee1d01febceLL, ! 0x093bb62877cdf642LL, ! 0x006985d8a9ec439bLL, ! 0x0005212c4f55a9c8LL, ! 0x00004326a16927f0LL, ! 0x0000038d1d80a0e7LL, ! 0x0000003141cc80c6LL, ! 0x00000002b1668c9fLL, ! 0x000000002c7a46aaLL }; static const u32 leadterm = 0xb8000000; --- 181,196 ---- #define HIPOWER 10 static const u64 logterms[HIPOWER] = { ! BX_CONST64(0x2a8eca5705fc2ef0), ! BX_CONST64(0xf6384ee1d01febce), ! BX_CONST64(0x093bb62877cdf642), ! BX_CONST64(0x006985d8a9ec439b), ! BX_CONST64(0x0005212c4f55a9c8), ! BX_CONST64(0x00004326a16927f0), ! BX_CONST64(0x0000038d1d80a0e7), ! BX_CONST64(0x0000003141cc80c6), ! BX_CONST64(0x00000002b1668c9f), ! BX_CONST64(0x000000002c7a46aa) }; static const u32 leadterm = 0xb8000000; diff -cr clean-portable1/fpu/poly_sin.c 64bit-constant/fpu/poly_sin.c *** clean-portable1/fpu/poly_sin.c Wed Apr 4 18:52:18 2001 --- 64bit-constant/fpu/poly_sin.c Wed Apr 4 18:50:11 2001 *************** *** 25,42 **** static const u64 pos_terms_l[N_COEFF_P] = { ! 0xaaaaaaaaaaaaaaabLL, ! 0x00d00d00d00cf906LL, ! 0x000006b99159a8bbLL, ! 0x000000000d7392e6LL }; static const u64 neg_terms_l[N_COEFF_N] = { ! 0x2222222222222167LL, ! 0x0002e3bc74aab624LL, ! 0x0000000b09229062LL, ! 0x00000000000c7973LL }; --- 25,42 ---- static const u64 pos_terms_l[N_COEFF_P] = { ! BX_CONST64(0xaaaaaaaaaaaaaaab), ! BX_CONST64(0x00d00d00d00cf906), ! BX_CONST64(0x000006b99159a8bb), ! BX_CONST64(0x000000000d7392e6) }; static const u64 neg_terms_l[N_COEFF_N] = { ! BX_CONST64(0x2222222222222167), ! BX_CONST64(0x0002e3bc74aab624), ! BX_CONST64(0x0000000b09229062), ! BX_CONST64(0x00000000000c7973) }; *************** *** 45,62 **** #define N_COEFF_NH 4 static const u64 pos_terms_h[N_COEFF_PH] = { ! 0x0000000000000000LL, ! 0x05b05b05b05b0406LL, ! 0x000049f93edd91a9LL, ! 0x00000000c9c9ed62LL }; static const u64 neg_terms_h[N_COEFF_NH] = { ! 0xaaaaaaaaaaaaaa98LL, ! 0x001a01a01a019064LL, ! 0x0000008f76c68a77LL, ! 0x0000000000d58f5eLL }; --- 45,62 ---- #define N_COEFF_NH 4 static const u64 pos_terms_h[N_COEFF_PH] = { ! BX_CONST64(0x0000000000000000), ! BX_CONST64(0x05b05b05b05b0406), ! BX_CONST64(0x000049f93edd91a9), ! BX_CONST64(0x00000000c9c9ed62) }; static const u64 neg_terms_h[N_COEFF_NH] = { ! BX_CONST64(0xaaaaaaaaaaaaaa98), ! BX_CONST64(0x001a01a01a019064), ! BX_CONST64(0x0000008f76c68a77), ! BX_CONST64(0x0000000000d58f5e) }; *************** *** 131,139 **** fixed_arg <<= 1; } /* pi/2 in hex is: 1.921fb54442d18469 898CC51701B839A2 52049C1 */ ! fixed_arg = 0x921fb54442d18469LL - fixed_arg; /* There is a special case which arises due to rounding, to fix here. */ ! if ( fixed_arg == 0xffffffffffffffffLL ) fixed_arg = 0; XSIG_LL(argSqrd) = fixed_arg; argSqrd.lsw = 0; --- 131,139 ---- fixed_arg <<= 1; } /* pi/2 in hex is: 1.921fb54442d18469 898CC51701B839A2 52049C1 */ ! fixed_arg = BX_CONST64(0x921fb54442d18469) - fixed_arg; /* There is a special case which arises due to rounding, to fix here. */ ! if ( fixed_arg == BX_CONST64(0xffffffffffffffff)) fixed_arg = 0; XSIG_LL(argSqrd) = fixed_arg; argSqrd.lsw = 0; *************** *** 195,201 **** #ifdef PARANOID if ( (exponent(&result) >= 0) ! && (significand(&result) > 0x8000000000000000LL) ) { EXCEPTION(EX_INTERNAL|0x150); } --- 195,201 ---- #ifdef PARANOID if ( (exponent(&result) >= 0) ! && (significand(&result) > BX_CONST64(0x8000000000000000)) ) { EXCEPTION(EX_INTERNAL|0x150); } *************** *** 218,224 **** #ifdef PARANOID if ( (exponent(st0_ptr) > 0) || ((exponent(st0_ptr) == 0) ! && (significand(st0_ptr) > 0xc90fdaa22168c234LL)) ) { EXCEPTION(EX_Invalid); FPU_copy_to_reg0(&CONST_QNaN, TAG_Special); --- 218,224 ---- #ifdef PARANOID if ( (exponent(st0_ptr) > 0) || ((exponent(st0_ptr) == 0) ! && (significand(st0_ptr) > BX_CONST64(0xc90fdaa22168c234))) ) { EXCEPTION(EX_Invalid); FPU_copy_to_reg0(&CONST_QNaN, TAG_Special); *************** *** 300,308 **** fixed_arg <<= 1; } /* pi/2 in hex is: 1.921fb54442d18469 898CC51701B839A2 52049C1 */ ! fixed_arg = 0x921fb54442d18469LL - fixed_arg; /* There is a special case which arises due to rounding, to fix here. */ ! if ( fixed_arg == 0xffffffffffffffffLL ) fixed_arg = 0; exponent = -1; --- 300,308 ---- fixed_arg <<= 1; } /* pi/2 in hex is: 1.921fb54442d18469 898CC51701B839A2 52049C1 */ ! fixed_arg = BX_CONST64(0x921fb54442d18469) - fixed_arg; /* There is a special case which arises due to rounding, to fix here. */ ! if ( fixed_arg == BX_CONST64(0xffffffffffffffff)) fixed_arg = 0; exponent = -1; *************** *** 360,366 **** */ /* This has an exponent of -65 */ ! XSIG_LL(fix_up) = 0x898cc51701b839a2ll; fix_up.lsw = 0; /* The fix-up needs to be improved for larger args */ --- 360,366 ---- */ /* This has an exponent of -65 */ ! XSIG_LL(fix_up) = BX_CONST64(0x898cc51701b839a2); fix_up.lsw = 0; /* The fix-up needs to be improved for larger args */ *************** *** 388,394 **** #ifdef PARANOID if ( (exponent(&result) >= 0) ! && (significand(&result) > 0x8000000000000000LL) ) { EXCEPTION(EX_INTERNAL|0x151); } --- 388,394 ---- #ifdef PARANOID if ( (exponent(&result) >= 0) ! && (significand(&result) > BX_CONST64(0x8000000000000000)) ) { EXCEPTION(EX_INTERNAL|0x151); } diff -cr clean-portable1/fpu/poly_tan.c 64bit-constant/fpu/poly_tan.c *** clean-portable1/fpu/poly_tan.c Wed Apr 4 18:52:18 2001 --- 64bit-constant/fpu/poly_tan.c Wed Apr 4 18:42:54 2001 *************** *** 22,54 **** #define HiPOWERop 3 /* odd poly, positive terms */ static const u64 oddplterm[HiPOWERop] = { ! 0x0000000000000000LL, ! 0x0051a1cf08fca228LL, ! 0x0000000071284ff7LL }; #define HiPOWERon 2 /* odd poly, negative terms */ static const u64 oddnegterm[HiPOWERon] = { ! 0x1291a9a184244e80LL, ! 0x0000583245819c21LL }; #define HiPOWERep 2 /* even poly, positive terms */ static const u64 evenplterm[HiPOWERep] = { ! 0x0e848884b539e888LL, ! 0x00003c7f18b887daLL }; #define HiPOWERen 2 /* even poly, negative terms */ static const u64 evennegterm[HiPOWERen] = { ! 0xf1f0200fd51569ccLL, ! 0x003afb46105c4432LL }; ! static const u64 twothirds = 0xaaaaaaaaaaaaaaabLL; /*--- poly_tan() ------------------------------------------------------------+ --- 22,54 ---- #define HiPOWERop 3 /* odd poly, positive terms */ static const u64 oddplterm[HiPOWERop] = { ! BX_CONST64(0x0000000000000000), ! BX_CONST64(0x0051a1cf08fca228), ! BX_CONST64(0x0000000071284ff7) }; #define HiPOWERon 2 /* odd poly, negative terms */ static const u64 oddnegterm[HiPOWERon] = { ! BX_CONST64(0x1291a9a184244e80), ! BX_CONST64(0x0000583245819c21) }; #define HiPOWERep 2 /* even poly, positive terms */ static const u64 evenplterm[HiPOWERep] = { ! BX_CONST64(0x0e848884b539e888), ! BX_CONST64(0x00003c7f18b887da) }; #define HiPOWERen 2 /* even poly, negative terms */ static const u64 evennegterm[HiPOWERen] = { ! BX_CONST64(0xf1f0200fd51569cc), ! BX_CONST64(0x003afb46105c4432) }; ! static const u64 twothirds = BX_CONST64(0xaaaaaaaaaaaaaaab); /*--- poly_tan() ------------------------------------------------------------+ *************** *** 121,127 **** really doesn't matter what value we use because it will have negligible effect in later calculations */ ! XSIG_LL(accum) = 0x8000000000000000LL; accum.lsw = 0; } else --- 121,127 ---- really doesn't matter what value we use because it will have negligible effect in later calculations */ ! XSIG_LL(accum) = BX_CONST64(0x8000000000000000); accum.lsw = 0; } else diff -cr clean-portable1/fpu/reg_ld_str.c 64bit-constant/fpu/reg_ld_str.c *** clean-portable1/fpu/reg_ld_str.c Wed Apr 4 18:52:18 2001 --- 64bit-constant/fpu/reg_ld_str.c Wed Apr 4 18:14:35 2001 *************** *** 913,919 **** if ( control_word & EX_Invalid ) { /* Produce something like QNaN "indefinite" */ ! tll = 0x8000000000000000LL; } else return 0; --- 913,919 ---- if ( control_word & EX_Invalid ) { /* Produce something like QNaN "indefinite" */ ! tll = BX_CONST64(0x8000000000000000); } else return 0; diff -cr clean-portable1/fpu/reg_u_mul.c 64bit-constant/fpu/reg_u_mul.c *** clean-portable1/fpu/reg_u_mul.c Sat Mar 17 01:10:57 2001 --- 64bit-constant/fpu/reg_u_mul.c Wed Apr 4 18:09:28 2001 *************** *** 72,81 **** c->exp = expon; ! if ( ! (mu & 0x8000000000000000LL) ) { mu <<= 1; ! if ( ml & 0x8000000000000000LL ) mu |= 1; ml <<= 1; c->exp --; --- 72,81 ---- c->exp = expon; ! if ( ! (mu & BX_CONST64(0x8000000000000000)) ) { mu <<= 1; ! if ( ml & BX_CONST64(0x8000000000000000) ) mu |= 1; ml <<= 1; c->exp --; diff -cr clean-portable1/fpu/wm_sqrt.c 64bit-constant/fpu/wm_sqrt.c *** clean-portable1/fpu/wm_sqrt.c Sat Mar 17 01:10:58 2001 --- 64bit-constant/fpu/wm_sqrt.c Wed Apr 4 18:11:10 2001 *************** *** 87,93 **** work += ((u64)guess32) << 32; if ( work == 0 ) /* This happens in one or two special cases */ ! work = 0xffffffffffffffffLL; guess = work; --- 87,93 ---- work += ((u64)guess32) << 32; if ( work == 0 ) /* This happens in one or two special cases */ ! work = BX_CONST64(0xffffffffffffffff); guess = work;