summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* merge updates from HEAD kennykb_numerics_branchdgp2005-10-0875-5301/+5994
|
* more WIDE supportdgp2005-10-081-20/+22
|
* [kennykb-numerics-branch]dgp2005-10-083-72/+290
| | | | | | * generic/tclExecute.c: More performance macros and special handling of the wide integer type for performance on 32-bit systems.
* * generic/tclExecute.c: Macro GetNumberFromObj() is version ofdgp2005-10-082-15/+38
| | | | TclGetNumberFromObj() that saves a function call for common uses.
* [kennykb-numerics-branch]dgp2005-10-074-29/+18
| | | | | | | | * generic/tclInt.h: Made #undef NO_WIDE_TYPE the default on 32-bit systems. Being able to use 64-bit values without leaping to mp_int should help with performance. * generic/tclObj.c: Bug fixes in the #undef NO_WIDE_TYPE * generic/tclExecute.c: configuration.
* [kennykb-numerics-branch]dgp2005-10-072-642/+188
| | | | | * generic/tclExecute.c: Improved performance of comparison opcodes and bitwise operations and removed yet more dead code.
* [kennykb-numerics-branch]dgp2005-10-072-199/+257
| | | | | * generic/tclExecute.c: Improved performance of comparison opcodes and removed yet more dead code.
* store shift result as long, not intdgp2005-10-061-2/+2
|
* [kennykb-numerics-branch]dgp2005-10-062-116/+99
| | | | | * generic/tclExecute.c: Improved performance of INST_RSHIFT and INST_LSHIFT.
* [kennykb-numerics-branch]dgp2005-10-062-2/+126
| | | | * generic/tclExecute.c: Improved performance of INST_RSHIFT.
* [kennykb-numerics-branch]dgp2005-10-062-34/+60
| | | | | | * generic/tclExecute.c: Improved performance of INST_MULT, INST_DIV, INST_ADD, and INST_SUB and replaced a "goto... label" with a "break from loop" in TclIncrObj() and removed some dead code.
* [kennykb-numerics-branch]dgp2005-10-062-264/+106
| | | | | | * generic/tclExecute.c: Improved performance of INST_MULT and INST_DIV and replaced a "goto... label" with a "break from loop" in TclIncrObj() and removed some dead code.
* [kennykb-numerics-branch]dgp2005-10-052-12/+138
| | | | | * generic/tclExecute.c: Improved performance INST_MULT and replaces a "goto... label" with a "break from loop" in TclIncrObj().
* [kennykb-numerics-branch]dgp2005-10-042-148/+53
| | | | | | | * generic/tclExecute.c: Updated TclIncrObj() to more efficiently add native long integers. Also updated IllegalExprOperandType and the INST_UMINUS, INST_UPLUS, INST_BITNOT, and INST_TRY_CVT_TO_NUMERIC sections for performance.
* [kennykb-numerics-branch]dgp2005-10-042-82/+127
| | | | | | * generic/tclExecute.c: Updated TclIncrObj() to more efficiently add native long integers. Also updated IllegalExprOperandType and the INST_UMINUS and INST_BITNOT sections for performance.
* [kennykb-numerics-branch]dgp2005-10-042-1/+24
| | | | | * generic/tclExecute.c: Updated TclIncrObj() to more efficiently add native long integers.
* [kennykb-numerics-branch]dgp2005-10-042-176/+130
| | | | | * generic/tclBasic.c: Updated more callers to make use of TclGetNumberFromObj. Removed some dead code.
* * generic/tclBasic.c: Re-implemented ExprRoundFunc and ExprEntierFuncdgp2005-10-032-15/+24
| | | | to use TclGetNumberFromObj.
* Be more choosy about what doubles get converted to longs.dgp2005-10-031-2/+2
|
* [kennykb-numerics-branch]dgp2005-10-034-96/+121
| | | | | | | | | * generic/tclBasic.c: Re-implemented ExprRoundFunc to use TclGetNumberFromObj. * generic/tclInt.h: Added new routine TclGetNumberFromObj to * generic/tclObj.c: provide efficient access to the actual internal rep of a numeric Tcl_Obj without conversions.
* [kennykb-numerics-branch]dgp2005-09-302-2/+10
| | | | | | * generic/tclStringObj.c: Bug fix: Missing cast to large enough integral size before << operations led to broken [format %llx] results. Thanks to Robert Henry for reporting the bug.
* formattingdgp2005-09-281-2/+3
|
* [kennykb-numerics-branch]dgp2005-09-274-27/+34
| | | | | | | * generic/tcl.h: Changed name of the new Tcl_Obj intrep field * generic/tclObj.c: from "bignumValue" to "ptrAndLongRep" as * generic/tclProc.c: described in TIP 237, and more suitable for other more general uses.
* Merge changes from HEAD, including libtommath 0.36Kevin B Kenny2005-09-26163-524/+12821
|
* [kennykb-numerics-branch]dgp2005-09-234-10/+16
| | | | | | * unix/Makefile.in: Added -DMP_PREC=4 switch to all compiles so * win/Makefile.in: that minimum memory requirements of mp_int's * win/makefile.vc: will not be quite so large. [Bug 1299153].
* [kennykb-numerics-branch]dgp2005-09-232-17/+11
| | | | | * generic/tclStrToD.c: Fixed memory leak. [Bug 1299803]. * generic/tclObj.c:
* [kennykb-numerics-branch]dgp2005-09-233-4/+21
| | | | | | | | | | | | | | | | * generic/tclStrToD.c: Memory leak. Comment in TclSetBignumIntRep * generic/tclObj.c: indicates that mp_init() is called on the bignumValue argument to clear it, while keeping the digits array transferred to the interp of the Tcl_Obj. The implication is that callers of TclSetBignumIntRep() (and their callers) need not call mp_clear(), but can imagine they've transferred ownership of an mp_int value to Tcl. However, mp_init() doesn't merely re-initialize the fields of an mp_int to hold the value zero. It also allocates a fresh dp array of minimum size governed by MP_PREC. Without a corresponding mp_clear() call somewhere, these dp arrays are leaked. Added some mp_clear() calls to fix the leak, but better fix strategies should still be pursued. Perhaps the best approach is to just invade the mp_int struct and do the necessary surgery ourselves.
* [kennykb-numerics-branch]dgp2005-09-206-47/+158
| | | | | | | | | | | * generic/tclExecute.c: Revise TclIncrObj() to call Tcl_GetBignumAndClearObj. * generic/tcl.decls: Add Tcl_GetBignumAndClearObj. * generic/tclObj.c: * generic/tclDecls.h: make genstubs * generic/tclStubInit.c:
* [kennykb-numerics-branch]dgp2005-09-168-50/+66
| | | | | | | | | | | | | | | | | * generic/tclInt.h: Added TclBNInitBigNumFromWideInt() * generic/tclTomMathInterface.c: so that every caller isn't required to duplicate the sign logic to use the unsigned interface. * generic/tclBasic.c: Reduce the number of places where Tcl * generic/tclExecute.c: intrudes into the internal format details * generic/tclObj.c: of the mp_int struct. * generic/tclStrToD.c: * generic/tcLStringObj.c: * generic/tclTomMath.h: Added mp_cmp_d to routines from * unix/Makefile.in: libtommath used by Tcl. * win/Makefile.in: * win/makefile.vc:
* * libtommath/bn_mp_add_d.c: Bug fix. For mp_add_d(&a, d, &c),dgp2005-09-162-0/+112
| | | | | | | when &a has the value -d, then the value &c computed should be zero, but mp_add_d was producing an inconsistent zero value with a sign field of MP_NEG, something like a value of -0, which other routines in libtommath can't handle.
* [kennykb-numerics-branch]dgp2005-09-166-72/+56
| | | | | | | | | | * generic/tclTomMath.h: Added mp_cmp_d to routines from * unix/Makefile.in: libtommath used by Tcl. * win/Makefile.in: * win/makefile.vc: * generic/tclExecute.c: Dropped all creation of "bigOne" values and just use tommath routines that accept the value "1" directly.
* merge updates from HEADdgp2005-09-1531-362/+498
|
* uninitialized vars are bad, mm'kay?dgp2005-09-121-2/+2
|
* * generic/tclCmdAH.c: Added support for the "ll" widthdgp2005-09-123-38/+92
| | | | * generic/tclStringObj.c: specifier to [format].
* [kennykb-numerics-branch] Merge updates from HEAD.dgp2005-09-123-5/+23
|
* silence compiler warningsdgp2005-09-091-5/+2
|
* [kennykb-numerics-branch] Merge updates from HEAD.dgp2005-09-0927-2061/+3541
|
* [kennykb-numerics-branch]dgp2005-09-024-12/+34
| | | | | | | | | * generic/tclScan.c: Bug fix: The %o, %x, %i formats of [scan] must not accept any 0b or 0o prefixes. [scan $s %o] must continue to work even with KILL_OCTAL enabled. * generic/tclInt.h: Added TCL_PARSE_SCAN_PREFIXES to the flags * generic/tclStrToD.c: accepted by TclParseNumber.
* * generic/tclObj.c: TclParseNumber calls meant to parse andgp2005-09-012-7/+10
| | | | integer value now pass the TCL_PARSE_INTEGER_ONLY flag.
* [kennykb-numerics-branch]dgp2005-09-014-22/+151
| | | | | | | | | | | * generic/tclScan.c: Extended [scan] to accept the %lld, %llo, %llx, and %lli formats. Numeric scanning is now done via TclParseNumber calls. * generic/tclInt.h: Extended TclParseNumber to accept new flag * generic/tclStrToD.c: values TCL_PARSE_INTEGER_ONLY, TCL_PARSE_OCTAL_ONLY, and TCL_PARSE_HEXIDECIMAL_ONLY, to give caller more control over the parsing rules.
* [kennykb-numerics-branch]dgp2005-08-302-11/+22
| | | | | | * generic/tclObj.c: Extended bignum support to include bignums so large they will not pack into a Tcl_Obj. When they outgrow Tcl's string rep length limits, a panic will result.
* [kennykb-numerics-branch]dgp2005-08-306-13/+71
| | | | | | | | | | | * generic/tclTomMath.h: Added mp_sqrt to routines from * unix/Makefile.in: libtommath used by Tcl. * win/Makefile.in: * win/makefile.vc: * generic/tclBasic.c: Extended sqrt(.) so that range covers the entire double range, accepting as many bignums in the domain as that will allow.
* [kennykb-numerics-branch] Merge updates from HEAD.dgp2005-08-2912-2249/+2315
|
* [kennykb-numerics-branch]dgp2005-08-292-5/+9
| | | | * generic/tclBasic.c: Restored round(.) to the Tcl 8.4 rules.
* [kennykb-numerics-branch]dgp2005-08-252-2/+19
| | | | | * generic/tclExecute.c: Bug fix. INST_RSHIFT: shift of negative values produced incorrect results.
* [kennykb-numerics-branch] Merge updates from HEADdgp2005-08-2597-386/+7106
| | | | | * generic/tclExecute.c: Bug fix. INST_*SHIFT* opcodes stack management. [expr 0<<6] should be 0, not 6.
* [kennykb-numerics-branch]dgp2005-08-252-16/+47
| | | | | * generic/tclBasic.c: Extended the domain of round(.) to all non-Inf, non-NaN doubles, using bignums for the result as needed.
* [kennykb-numerics-branch]dgp2005-08-244-5/+169
| | | | | | | | | * generic/tclBasic.c: Revised implementation of the ceil(.) and * generic/tclInt.h: floor(.) math functions in light of the * generic/tclStrToD.c: revised comparison operators, so that it is always true that ($x <= ceil($x)) and ($x >= floor($x)). The simple approach of "convert to double and call ceil() or floor()" could not guarantee that.
* corrected TRACE bugs, overflowed negative #s, and bad test constraintsKevin B Kenny2005-08-245-66/+75
|
* [kennykb_numerics_branch]dgp2005-08-242-5/+9
| | | | | * generic/tclExecute.c: Bug fix: TclBignumToDouble return -Inf when appropriate. Removed declarations of removed routines.