Tcl Source Code

Check-in [f5324453ec]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:
[kennykb-numerics-branch]
* 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.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | kennykb-numerics-branch
Files: files | file ages | folders
SHA1: f5324453ec01b2bda10d06e9a7813105b57722bf
User & Date: dgp 2005-09-16 15:35:52
Context
2005-09-16
16:13
* libtommath/bn_mp_add_d.c: Bug fix. For mp_add_d(&a, d, &c), when &a has the v...
check-in: dc9f2eaf23 user: dgp tags: kennykb-numerics-branch
15:35
[kennykb-numerics-branch]
* generic/tclTomMath.h: Added mp_cmp_d to routines from ...
check-in: f5324453ec user: dgp tags: kennykb-numerics-branch
2005-09-15
20:58
merge updates from HEAD check-in: 29cc0feeb2 user: dgp tags: kennykb-numerics-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.













1
2
3
4
5
6
7











2005-09-15  Don Porter  <[email protected]>

	[kennykb-numerics-branch]	Merge updates from HEAD.

	* generic/tclStringObj.c (TclAppendFormattedObjs):	Revision
	to eliminate one round of string copying.

>
>
>
>
>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
2005-09-16  Don Porter  <[email protected]>

	[kennykb-numerics-branch]

	* 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.

2005-09-15  Don Porter  <[email protected]>

	[kennykb-numerics-branch]	Merge updates from HEAD.

	* generic/tclStringObj.c (TclAppendFormattedObjs):	Revision
	to eliminate one round of string copying.

Changes to generic/tclExecute.c.

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
....
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
....
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952

3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963

3964
3965

3966
3967
3968
3969

3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986

3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000

4001
4002

4003
4004
4005
4006

4007
4008
4009
4010
4011
4012
4013
....
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024

4025
4026
4027
4028

4029
4030
4031
4032
4033
4034
4035
4036
4037

4038
4039

4040
4041
4042
4043
4044
4045
4046
4047
4048
....
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
....
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900

4901
4902
4903
4904
4905
4906




4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
....
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
 * Copyright (c) 2001 by Kevin B. Kenny.  All rights reserved.
 * Copyright (c) 2002-2005 by Miguel Sofer.
 * Copyright (c) 2005 by Donal K. Fellows.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclExecute.c,v 1.167.2.39 2005/09/15 20:58:39 dgp Exp $
 */

#include "tclInt.h"
#include "tclCompile.h"
#include "tommath.h"

#include <math.h>
................................................................................
		    "integer value too large to represent", -1));
	    goto checkForCatch;
	}
	mp_init(&bigResult);
	if (*pc == INST_LSHIFT) {
	    mp_mul_2d(&big1, shift, &bigResult);
	} else {
#if 0
	    mp_div_2d(&big1, shift, &bigResult, NULL);
	    if (mp_iszero(&bigResult) && big1.sign == MP_NEG) {
		/* When right shifting a negative value, keep the sign bit */
		/* TODO: consider direct SetLongObj to -1 */
		mp_int bigOne;
		Tcl_GetBignumFromObj(NULL, eePtr->constants[1], &bigOne);
		mp_sub(&bigResult, &bigOne, &bigResult);
	    }
#else
	    mp_int bigRemainder;
	    mp_init(&bigRemainder);
	    mp_div_2d(&big1, shift, &bigResult, &bigRemainder);
	    if (!mp_iszero(&bigRemainder) && (bigRemainder.sign == MP_NEG)) {
		/* Convert to Tcl's integer division rules */
		mp_int bigOne;
		Tcl_GetBignumFromObj(NULL, eePtr->constants[1], &bigOne);
		mp_sub(&bigResult, &bigOne, &bigResult);
		mp_clear(&bigOne);
	    }
	    mp_clear(&bigRemainder);
#endif
	}
	mp_clear(&big1);
	TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr)));
	if (Tcl_IsShared(valuePtr)) {
	    objResultPtr = Tcl_NewBignumObj(&bigResult);
	    TRACE(("%s\n", O2S(objResultPtr)));
	    NEXT_INST_F(1, 2, 1);
................................................................................
	    case 2:
		/* Both arguments positive, base case */
		mp_and(Pos, Other, &bigResult);
		break;
	    case 1: {
		/* One arg positive; one negative
		 * P & N = P & ~~N = P&~(-N-1) = P & (P ^ (-N-1)) */
		mp_int bigOne;
		Tcl_GetBignumFromObj(NULL, eePtr->constants[1], &bigOne);
		mp_neg(Neg, Neg);
		mp_sub(Neg, &bigOne, Neg);
		mp_clear(&bigOne);

		mp_xor(Pos, Neg, &bigResult);
		mp_and(Pos, &bigResult, &bigResult);
		break;
	    }
	    case 0: {
		/* Both arguments negative 
		 * a & b = ~ (~a | ~b) = -(-a-1|-b-1)-1 */
		mp_int bigOne;
		Tcl_GetBignumFromObj(NULL, eePtr->constants[1], &bigOne);
		mp_neg(Neg, Neg);
		mp_sub(Neg, &bigOne, Neg);

		mp_neg(Other, Other);
		mp_sub(Other, &bigOne, Other);

		mp_or(Neg, Other, &bigResult);
		mp_neg(&bigResult, &bigResult);
		mp_sub(&bigResult, &bigOne, &bigResult);
		mp_clear(&bigOne);

		break;
	    }
	    }
	    break;
	case INST_BITOR:
	    switch (numPos) {
	    case 2:
		/* Both arguments positive, base case */
		mp_or(Pos, Other, &bigResult);
		break;
	    case 1: {
		/* One arg positive; one negative
		 * N|P = ~(~N&~P) = ~((-N-1)&~P) = -((-N-1)&((-N-1)^P))-1 */
		mp_int bigOne;
		Tcl_GetBignumFromObj(NULL, eePtr->constants[1], &bigOne);
		mp_neg(Neg, Neg);
		mp_sub(Neg, &bigOne, Neg);

		mp_xor(Pos, Neg, &bigResult);
		mp_and(Neg, &bigResult, &bigResult);
		mp_neg(&bigResult, &bigResult);
		mp_sub(&bigResult, &bigOne, &bigResult);
		mp_clear(&bigOne);
		break;
	    }
	    case 0: {
		/* Both arguments negative 
		 * a | b = ~ (~a & ~b) = -(-a-1&-b-1)-1 */
		mp_int bigOne;
		Tcl_GetBignumFromObj(NULL, eePtr->constants[1], &bigOne);
		mp_neg(Neg, Neg);
		mp_sub(Neg, &bigOne, Neg);

		mp_neg(Other, Other);
		mp_sub(Other, &bigOne, Other);

		mp_and(Neg, Other, &bigResult);
		mp_neg(&bigResult, &bigResult);
		mp_sub(&bigResult, &bigOne, &bigResult);
		mp_clear(&bigOne);

		break;
	    }
	    }
	    break;
	case INST_BITXOR:
	    switch (numPos) {
	    case 2:
................................................................................
		/* Both arguments positive, base case */
		mp_xor(Pos, Other, &bigResult);
		break;
	    case 1: {
		/* One arg positive; one negative
		 * P^N = ~(P^~N) = -(P^(-N-1))-1
		 */
		mp_int bigOne;
		Tcl_GetBignumFromObj(NULL, eePtr->constants[1], &bigOne);
		mp_neg(Neg, Neg);
		mp_sub(Neg, &bigOne, Neg);

		mp_xor(Pos, Neg, &bigResult);
		mp_neg(&bigResult, &bigResult);
		mp_sub(&bigResult, &bigOne, &bigResult);
		mp_clear(&bigOne);

		break;
	    }
	    case 0: {
		/* Both arguments negative 
		 * a ^ b = (~a ^ ~b) = (-a-1^-b-1) */
		mp_int bigOne;
		Tcl_GetBignumFromObj(NULL, eePtr->constants[1], &bigOne);
		mp_neg(Neg, Neg);
		mp_sub(Neg, &bigOne, Neg);

		mp_neg(Other, Other);
		mp_sub(Other, &bigOne, Other);

		mp_xor(Neg, Other, &bigResult);
		mp_clear(&bigOne);
		break;
	    }
	    }
	    break;
	}
	mp_clear(&big1);
	mp_clear(&big2);
................................................................................
		    goto divideByZero;
		}
		mp_init(&bigRemainder);
		mp_div(&big1, &big2, &bigResult, &bigRemainder);
		if (!mp_iszero(&bigRemainder) 
			&& (bigRemainder.sign != big2.sign)) {
		    /* Convert to Tcl's integer division rules */
		    mp_int bigOne;
		    Tcl_GetBignumFromObj(NULL, eePtr->constants[1], &bigOne);
		    mp_sub(&bigResult, &bigOne, &bigResult);
		    mp_add(&bigRemainder, &big2, &bigRemainder);
		    mp_clear(&bigOne);
		}
		if (*pc == INST_MOD) {
		    mp_copy(&bigRemainder, &bigResult);
		}
		mp_clear(&bigRemainder);
		break;
	    case INST_EXPON:
................................................................................
		    }
		    mp_clear(&big1);
		    mp_clear(&big2);
		    objResultPtr = eePtr->constants[0];
		    NEXT_INST_F(1, 2, 1);
		}
		if (big2.sign == MP_NEG) {
		    mp_int bigOne;
		    Tcl_GetBignumFromObj(NULL, eePtr->constants[1], &bigOne);
		    if (mp_cmp_mag(&big1, &bigOne) == MP_GT) {
			objResultPtr = eePtr->constants[0];

		    } else if (big1.sign == MP_ZPOS) {
			objResultPtr = eePtr->constants[1];
		    } else {
			mp_int bigBit;
			mp_init(&bigBit);
			mp_and(&big2, &bigOne, &bigBit);




			if (mp_iszero(&bigBit)) {
			    objResultPtr = eePtr->constants[1];
			} else {
			    TclNewIntObj(objResultPtr, -1);
			}
			mp_clear(&bigBit);
		    }
		    mp_clear(&bigOne);
		    mp_clear(&big1);
		    mp_clear(&big2);
		    NEXT_INST_F(1, 2, 1);
		}
		if (big2.used > 1) {
		    Tcl_SetObjResult(interp,
			    Tcl_NewStringObj("exponent too large", -1));
................................................................................
	    } else {
		/* TODO: optimize use of narrower native integers */
		mp_int big;
		Tcl_GetBignumFromObj(NULL, valuePtr, &big);
		mp_neg(&big, &big);
		if (*pc == INST_BITNOT) {
		    /* ~a = - a - 1 */
		    mp_int bigOne;
		    Tcl_GetBignumFromObj(NULL, eePtr->constants[1], &bigOne);
		    mp_sub(&big, &bigOne, &big);
		    mp_clear(&bigOne);
		}
		if (Tcl_IsShared(valuePtr)) {
		    objResultPtr = Tcl_NewBignumObj(&big);
		    NEXT_INST_F(1, 1, 1);
		}
		Tcl_SetBignumObj(valuePtr, &big);
		NEXT_INST_F(1, 0, 0);






|







 







<
<
<
<
<
<
<
<
<
<





|
<
<
<


<







 







<
<

<
<
>







<
<

<
>

<
>


<
<
>













<
<

<
>



|
<





<
<

<
>

<
>


<
<
>







 







<
<

<
>


<
<
>





<
<

<
>

<
>

<







 







|
<
<

<







 







|
|
<

>
|

|
|
|
|
>
>
>
>
|




<

<







 







|
<
<
<







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
....
3850
3851
3852
3853
3854
3855
3856










3857
3858
3859
3860
3861
3862



3863
3864

3865
3866
3867
3868
3869
3870
3871
....
3927
3928
3929
3930
3931
3932
3933


3934


3935
3936
3937
3938
3939
3940
3941
3942


3943

3944
3945

3946
3947
3948


3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962


3963

3964
3965
3966
3967
3968

3969
3970
3971
3972
3973


3974

3975
3976

3977
3978
3979


3980
3981
3982
3983
3984
3985
3986
3987
....
3988
3989
3990
3991
3992
3993
3994


3995

3996
3997
3998


3999
4000
4001
4002
4003
4004


4005

4006
4007

4008
4009

4010
4011
4012
4013
4014
4015
4016
....
4824
4825
4826
4827
4828
4829
4830
4831


4832

4833
4834
4835
4836
4837
4838
4839
....
4855
4856
4857
4858
4859
4860
4861
4862
4863

4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880

4881

4882
4883
4884
4885
4886
4887
4888
....
5137
5138
5139
5140
5141
5142
5143
5144



5145
5146
5147
5148
5149
5150
5151
 * Copyright (c) 2001 by Kevin B. Kenny.  All rights reserved.
 * Copyright (c) 2002-2005 by Miguel Sofer.
 * Copyright (c) 2005 by Donal K. Fellows.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclExecute.c,v 1.167.2.40 2005/09/16 15:35:54 dgp Exp $
 */

#include "tclInt.h"
#include "tclCompile.h"
#include "tommath.h"

#include <math.h>
................................................................................
		    "integer value too large to represent", -1));
	    goto checkForCatch;
	}
	mp_init(&bigResult);
	if (*pc == INST_LSHIFT) {
	    mp_mul_2d(&big1, shift, &bigResult);
	} else {










	    mp_int bigRemainder;
	    mp_init(&bigRemainder);
	    mp_div_2d(&big1, shift, &bigResult, &bigRemainder);
	    if (!mp_iszero(&bigRemainder) && (bigRemainder.sign == MP_NEG)) {
		/* Convert to Tcl's integer division rules */
		mp_sub_d(&bigResult, 1, &bigResult);



	    }
	    mp_clear(&bigRemainder);

	}
	mp_clear(&big1);
	TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr)));
	if (Tcl_IsShared(valuePtr)) {
	    objResultPtr = Tcl_NewBignumObj(&bigResult);
	    TRACE(("%s\n", O2S(objResultPtr)));
	    NEXT_INST_F(1, 2, 1);
................................................................................
	    case 2:
		/* Both arguments positive, base case */
		mp_and(Pos, Other, &bigResult);
		break;
	    case 1: {
		/* One arg positive; one negative
		 * P & N = P & ~~N = P&~(-N-1) = P & (P ^ (-N-1)) */


		mp_neg(Neg, Neg);


		mp_sub_d(Neg, 1, Neg);
		mp_xor(Pos, Neg, &bigResult);
		mp_and(Pos, &bigResult, &bigResult);
		break;
	    }
	    case 0: {
		/* Both arguments negative 
		 * a & b = ~ (~a | ~b) = -(-a-1|-b-1)-1 */


		mp_neg(Neg, Neg);

		mp_sub_d(Neg, 1, Neg);
		mp_neg(Other, Other);

		mp_sub_d(Other, 1, Other);
		mp_or(Neg, Other, &bigResult);
		mp_neg(&bigResult, &bigResult);


		mp_sub_d(&bigResult, 1, &bigResult);
		break;
	    }
	    }
	    break;
	case INST_BITOR:
	    switch (numPos) {
	    case 2:
		/* Both arguments positive, base case */
		mp_or(Pos, Other, &bigResult);
		break;
	    case 1: {
		/* One arg positive; one negative
		 * N|P = ~(~N&~P) = ~((-N-1)&~P) = -((-N-1)&((-N-1)^P))-1 */


		mp_neg(Neg, Neg);

		mp_sub_d(Neg, 1, Neg);
		mp_xor(Pos, Neg, &bigResult);
		mp_and(Neg, &bigResult, &bigResult);
		mp_neg(&bigResult, &bigResult);
		mp_sub_d(&bigResult, 1, &bigResult);

		break;
	    }
	    case 0: {
		/* Both arguments negative 
		 * a | b = ~ (~a & ~b) = -(-a-1&-b-1)-1 */


		mp_neg(Neg, Neg);

		mp_sub_d(Neg, 1, Neg);
		mp_neg(Other, Other);

		mp_sub_d(Other, 1, Other);
		mp_and(Neg, Other, &bigResult);
		mp_neg(&bigResult, &bigResult);


		mp_sub_d(&bigResult, 1, &bigResult);
		break;
	    }
	    }
	    break;
	case INST_BITXOR:
	    switch (numPos) {
	    case 2:
................................................................................
		/* Both arguments positive, base case */
		mp_xor(Pos, Other, &bigResult);
		break;
	    case 1: {
		/* One arg positive; one negative
		 * P^N = ~(P^~N) = -(P^(-N-1))-1
		 */


		mp_neg(Neg, Neg);

		mp_sub_d(Neg, 1, Neg);
		mp_xor(Pos, Neg, &bigResult);
		mp_neg(&bigResult, &bigResult);


		mp_sub_d(&bigResult, 1, &bigResult);
		break;
	    }
	    case 0: {
		/* Both arguments negative 
		 * a ^ b = (~a ^ ~b) = (-a-1^-b-1) */


		mp_neg(Neg, Neg);

		mp_sub_d(Neg, 1, Neg);
		mp_neg(Other, Other);

		mp_sub_d(Other, 1, Other);
		mp_xor(Neg, Other, &bigResult);

		break;
	    }
	    }
	    break;
	}
	mp_clear(&big1);
	mp_clear(&big2);
................................................................................
		    goto divideByZero;
		}
		mp_init(&bigRemainder);
		mp_div(&big1, &big2, &bigResult, &bigRemainder);
		if (!mp_iszero(&bigRemainder) 
			&& (bigRemainder.sign != big2.sign)) {
		    /* Convert to Tcl's integer division rules */
		    mp_sub_d(&bigResult, 1, &bigResult);


		    mp_add(&bigRemainder, &big2, &bigRemainder);

		}
		if (*pc == INST_MOD) {
		    mp_copy(&bigRemainder, &bigResult);
		}
		mp_clear(&bigRemainder);
		break;
	    case INST_EXPON:
................................................................................
		    }
		    mp_clear(&big1);
		    mp_clear(&big2);
		    objResultPtr = eePtr->constants[0];
		    NEXT_INST_F(1, 2, 1);
		}
		if (big2.sign == MP_NEG) {
		    switch (mp_cmp_d(&big1, 1)) {
		    case MP_GT:

			objResultPtr = eePtr->constants[0];
			break;
		    case MP_EQ:
			objResultPtr = eePtr->constants[1];
			break;
		    case MP_LT:
			mp_add_d(&big1, 1, &big1);
			if (mp_cmp_d(&big1, 0) == MP_LT) {
			    objResultPtr = eePtr->constants[0];
			    break;
			}
			mp_mod_2d(&big2, 1, &big2);
			if (mp_iszero(&big2)) {
			    objResultPtr = eePtr->constants[1];
			} else {
			    TclNewIntObj(objResultPtr, -1);
			}

		    }

		    mp_clear(&big1);
		    mp_clear(&big2);
		    NEXT_INST_F(1, 2, 1);
		}
		if (big2.used > 1) {
		    Tcl_SetObjResult(interp,
			    Tcl_NewStringObj("exponent too large", -1));
................................................................................
	    } else {
		/* TODO: optimize use of narrower native integers */
		mp_int big;
		Tcl_GetBignumFromObj(NULL, valuePtr, &big);
		mp_neg(&big, &big);
		if (*pc == INST_BITNOT) {
		    /* ~a = - a - 1 */
		    mp_sub_d(&big, 1, &big);



		}
		if (Tcl_IsShared(valuePtr)) {
		    objResultPtr = Tcl_NewBignumObj(&big);
		    NEXT_INST_F(1, 1, 1);
		}
		Tcl_SetBignumObj(valuePtr, &big);
		NEXT_INST_F(1, 0, 0);

Changes to generic/tclTomMath.h.

5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
..
71
72
73
74
75
76
77

78
79
80
81
82
83
84
 *	<tommath.h> to adapt the API to Tcl's linkage conventions.
 *
 * Copyright (c) 2005 by Kevin B. Kenny.  All rights reserved.
 *
 * See the file "license.terms" for information on usage and redistribution
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclTomMath.h,v 1.1.2.5 2005/08/30 15:54:29 dgp Exp $
 */

#ifndef TCLTOMMATH_H
#define TCLTOMMATH_H 1

#include <tcl.h>
#include <stdlib.h>
................................................................................
#define fast_s_mp_mul_digs TclBN_fast_s_mp_mul_digs
#define mp_add TclBN_mp_add
#define mp_and TclBN_mp_and
#define mp_clamp TclBN_mp_clamp
#define mp_clear TclBN_mp_clear
#define mp_clear_multi TclBN_mp_clear_multi
#define mp_cmp TclBN_mp_cmp

#define mp_cmp_mag TclBN_mp_cmp_mag
#define mp_copy TclBN_mp_copy
#define mp_count_bits TclBN_mp_count_bits
#define mp_div TclBN_mp_div
#define mp_div_d TclBN_mp_div_d
#define mp_div_2 TclBN_mp_div_2
#define mp_div_2d TclBN_mp_div_2d






|







 







>







5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
..
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
 *	<tommath.h> to adapt the API to Tcl's linkage conventions.
 *
 * Copyright (c) 2005 by Kevin B. Kenny.  All rights reserved.
 *
 * See the file "license.terms" for information on usage and redistribution
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclTomMath.h,v 1.1.2.6 2005/09/16 15:35:54 dgp Exp $
 */

#ifndef TCLTOMMATH_H
#define TCLTOMMATH_H 1

#include <tcl.h>
#include <stdlib.h>
................................................................................
#define fast_s_mp_mul_digs TclBN_fast_s_mp_mul_digs
#define mp_add TclBN_mp_add
#define mp_and TclBN_mp_and
#define mp_clamp TclBN_mp_clamp
#define mp_clear TclBN_mp_clear
#define mp_clear_multi TclBN_mp_clear_multi
#define mp_cmp TclBN_mp_cmp
#define mp_cmp_d TclBN_mp_cmp_d
#define mp_cmp_mag TclBN_mp_cmp_mag
#define mp_copy TclBN_mp_copy
#define mp_count_bits TclBN_mp_count_bits
#define mp_div TclBN_mp_div
#define mp_div_d TclBN_mp_div_d
#define mp_div_2 TclBN_mp_div_2
#define mp_div_2d TclBN_mp_div_2d

Changes to unix/Makefile.in.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
...
312
313
314
315
316
317
318
319

320
321
322
323
324
325
326
327
...
439
440
441
442
443
444
445

446
447
448
449
450
451
452
....
1217
1218
1219
1220
1221
1222
1223



1224
1225
1226
1227
1228
1229
1230
#
# This file is a Makefile for Tcl.  If it has the name "Makefile.in"
# then it is a template for a Makefile;  to generate the actual Makefile,
# run "./configure", which is a configuration script generated by the
# "autoconf" program (constructs like "@[email protected]" will get replaced in the
# actual Makefile.
#
# RCS: @(#) $Id: Makefile.in,v 1.157.2.17 2005/08/30 15:54:29 dgp Exp $

VERSION 		= @[email protected]
MAJOR_VERSION		= @[email protected]
MINOR_VERSION		= @[email protected]
PATCH_LEVEL		= @[email protected]

#----------------------------------------------------------------
................................................................................
	tclThreadAlloc.o tclThreadJoin.o tclThreadStorage.o tclStubInit.o \
	tclStubLib.o tclTimer.o tclTrace.o tclUtf.o tclUtil.o tclVar.o \
	tclTomMathInterface.o

TOMMATH_OBJS = bncore.o bn_reverse.o bn_fast_s_mp_mul_digs.o \
	bn_fast_s_mp_sqr.o bn_mp_add.o bn_mp_and.o \
        bn_mp_add_d.o bn_mp_clamp.o bn_mp_clear.o bn_mp_clear_multi.o \
        bn_mp_cmp.o bn_mp_cmp_mag.o bn_mp_copy.o bn_mp_count_bits.o \

        bn_mp_div.o bn_mp_div_d.o bn_mp_div_2.o bn_mp_div_2d.o bn_mp_div_3.o \
        bn_mp_exch.o bn_mp_expt_d.o bn_mp_grow.o bn_mp_init.o \
	bn_mp_init_copy.o bn_mp_init_multi.o bn_mp_init_set.o \
	bn_mp_init_size.o bn_mp_karatsuba_mul.o \
	bn_mp_karatsuba_sqr.o \
        bn_mp_lshd.o bn_mp_mod.o bn_mp_mod_2d.o bn_mp_mul.o bn_mp_mul_2.o \
        bn_mp_mul_2d.o bn_mp_mul_d.o bn_mp_neg.o bn_mp_or.o \
	bn_mp_radix_size.o bn_mp_radix_smap.o \
................................................................................
	$(TOMMATH_DIR)/bn_mp_add.c \
	$(TOMMATH_DIR)/bn_mp_add_d.c \
	$(TOMMATH_DIR)/bn_mp_and.c \
	$(TOMMATH_DIR)/bn_mp_clamp.c \
	$(TOMMATH_DIR)/bn_mp_clear.c \
	$(TOMMATH_DIR)/bn_mp_clear_multi.c \
	$(TOMMATH_DIR)/bn_mp_cmp.c \

	$(TOMMATH_DIR)/bn_mp_cmp_mag.c \
	$(TOMMATH_DIR)/bn_mp_copy.c \
	$(TOMMATH_DIR)/bn_mp_count_bits.c \
	$(TOMMATH_DIR)/bn_mp_div.c \
	$(TOMMATH_DIR)/bn_mp_div_d.c \
	$(TOMMATH_DIR)/bn_mp_div_2.c \
	$(TOMMATH_DIR)/bn_mp_div_2d.c \
................................................................................

bn_mp_clear_multi.o: $(TOMMATH_DIR)/bn_mp_clear_multi.c
	$(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_clear_multi.c

bn_mp_cmp.o: $(TOMMATH_DIR)/bn_mp_cmp.c
	$(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_cmp.c




bn_mp_cmp_mag.o: $(TOMMATH_DIR)/bn_mp_cmp_mag.c
	$(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_cmp_mag.c

bn_mp_copy.o: $(TOMMATH_DIR)/bn_mp_copy.c
	$(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_copy.c

bn_mp_count_bits.o: $(TOMMATH_DIR)/bn_mp_count_bits.c






|







 







|
>
|







 







>







 







>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
...
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
...
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
....
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
#
# This file is a Makefile for Tcl.  If it has the name "Makefile.in"
# then it is a template for a Makefile;  to generate the actual Makefile,
# run "./configure", which is a configuration script generated by the
# "autoconf" program (constructs like "@[email protected]" will get replaced in the
# actual Makefile.
#
# RCS: @(#) $Id: Makefile.in,v 1.157.2.18 2005/09/16 15:35:54 dgp Exp $

VERSION 		= @[email protected]
MAJOR_VERSION		= @[email protected]
MINOR_VERSION		= @[email protected]
PATCH_LEVEL		= @[email protected]

#----------------------------------------------------------------
................................................................................
	tclThreadAlloc.o tclThreadJoin.o tclThreadStorage.o tclStubInit.o \
	tclStubLib.o tclTimer.o tclTrace.o tclUtf.o tclUtil.o tclVar.o \
	tclTomMathInterface.o

TOMMATH_OBJS = bncore.o bn_reverse.o bn_fast_s_mp_mul_digs.o \
	bn_fast_s_mp_sqr.o bn_mp_add.o bn_mp_and.o \
        bn_mp_add_d.o bn_mp_clamp.o bn_mp_clear.o bn_mp_clear_multi.o \
        bn_mp_cmp.o bn_mp_cmp_d.o bn_mp_cmp_mag.o bn_mp_copy.o \
	bn_mp_count_bits.o bn_mp_div.o bn_mp_div_d.o bn_mp_div_2.o \
	bn_mp_div_2d.o bn_mp_div_3.o \
        bn_mp_exch.o bn_mp_expt_d.o bn_mp_grow.o bn_mp_init.o \
	bn_mp_init_copy.o bn_mp_init_multi.o bn_mp_init_set.o \
	bn_mp_init_size.o bn_mp_karatsuba_mul.o \
	bn_mp_karatsuba_sqr.o \
        bn_mp_lshd.o bn_mp_mod.o bn_mp_mod_2d.o bn_mp_mul.o bn_mp_mul_2.o \
        bn_mp_mul_2d.o bn_mp_mul_d.o bn_mp_neg.o bn_mp_or.o \
	bn_mp_radix_size.o bn_mp_radix_smap.o \
................................................................................
	$(TOMMATH_DIR)/bn_mp_add.c \
	$(TOMMATH_DIR)/bn_mp_add_d.c \
	$(TOMMATH_DIR)/bn_mp_and.c \
	$(TOMMATH_DIR)/bn_mp_clamp.c \
	$(TOMMATH_DIR)/bn_mp_clear.c \
	$(TOMMATH_DIR)/bn_mp_clear_multi.c \
	$(TOMMATH_DIR)/bn_mp_cmp.c \
	$(TOMMATH_DIR)/bn_mp_cmp_d.c \
	$(TOMMATH_DIR)/bn_mp_cmp_mag.c \
	$(TOMMATH_DIR)/bn_mp_copy.c \
	$(TOMMATH_DIR)/bn_mp_count_bits.c \
	$(TOMMATH_DIR)/bn_mp_div.c \
	$(TOMMATH_DIR)/bn_mp_div_d.c \
	$(TOMMATH_DIR)/bn_mp_div_2.c \
	$(TOMMATH_DIR)/bn_mp_div_2d.c \
................................................................................

bn_mp_clear_multi.o: $(TOMMATH_DIR)/bn_mp_clear_multi.c
	$(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_clear_multi.c

bn_mp_cmp.o: $(TOMMATH_DIR)/bn_mp_cmp.c
	$(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_cmp.c

bn_mp_cmp_d.o: $(TOMMATH_DIR)/bn_mp_cmp_d.c
	$(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_cmp_d.c

bn_mp_cmp_mag.o: $(TOMMATH_DIR)/bn_mp_cmp_mag.c
	$(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_cmp_mag.c

bn_mp_copy.o: $(TOMMATH_DIR)/bn_mp_copy.c
	$(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_copy.c

bn_mp_count_bits.o: $(TOMMATH_DIR)/bn_mp_count_bits.c

Changes to win/Makefile.in.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
...
290
291
292
293
294
295
296

297
298
299
300
301
302
303
#
# This file is a Makefile for Tcl.  If it has the name "Makefile.in"
# then it is a template for a Makefile;  to generate the actual Makefile,
# run "./configure", which is a configuration script generated by the
# "autoconf" program (constructs like "@[email protected]" will get replaced in the
# actual Makefile.
#
# RCS: @(#) $Id: Makefile.in,v 1.84.2.13 2005/08/30 15:54:29 dgp Exp $

VERSION = @[email protected]

#----------------------------------------------------------------
# Things you can change to personalize the Makefile for your own
# site (you can make these changes in either Makefile.in or
# Makefile, but changes to Makefile will get lost if you re-run
................................................................................
	bn_mp_add.${OBJEXT} \
	bn_mp_add_d.${OBJEXT} \
	bn_mp_and.${OBJEXT} \
	bn_mp_clamp.${OBJEXT} \
	bn_mp_clear.${OBJEXT} \
	bn_mp_clear_multi.${OBJEXT} \
	bn_mp_cmp.${OBJEXT} \

	bn_mp_cmp_mag.${OBJEXT} \
	bn_mp_copy.${OBJEXT} \
	bn_mp_count_bits.${OBJEXT} \
	bn_mp_div.${OBJEXT} \
	bn_mp_div_d.${OBJEXT} \
	bn_mp_div_2.${OBJEXT} \
	bn_mp_div_2d.${OBJEXT} \






|







 







>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
...
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
#
# This file is a Makefile for Tcl.  If it has the name "Makefile.in"
# then it is a template for a Makefile;  to generate the actual Makefile,
# run "./configure", which is a configuration script generated by the
# "autoconf" program (constructs like "@[email protected]" will get replaced in the
# actual Makefile.
#
# RCS: @(#) $Id: Makefile.in,v 1.84.2.14 2005/09/16 15:35:54 dgp Exp $

VERSION = @[email protected]

#----------------------------------------------------------------
# Things you can change to personalize the Makefile for your own
# site (you can make these changes in either Makefile.in or
# Makefile, but changes to Makefile will get lost if you re-run
................................................................................
	bn_mp_add.${OBJEXT} \
	bn_mp_add_d.${OBJEXT} \
	bn_mp_and.${OBJEXT} \
	bn_mp_clamp.${OBJEXT} \
	bn_mp_clear.${OBJEXT} \
	bn_mp_clear_multi.${OBJEXT} \
	bn_mp_cmp.${OBJEXT} \
	bn_mp_cmp_d.${OBJEXT} \
	bn_mp_cmp_mag.${OBJEXT} \
	bn_mp_copy.${OBJEXT} \
	bn_mp_count_bits.${OBJEXT} \
	bn_mp_div.${OBJEXT} \
	bn_mp_div_d.${OBJEXT} \
	bn_mp_div_2.${OBJEXT} \
	bn_mp_div_2d.${OBJEXT} \

Changes to win/makefile.vc.

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
...
342
343
344
345
346
347
348

349
350
351
352
353
354
355
# 
# Copyright (c) 1995-1996 Sun Microsystems, Inc.
# Copyright (c) 1998-2000 Ajuba Solutions.
# Copyright (c) 2001-2005 ActiveState Corporation.
# Copyright (c) 2001-2004 David Gravereaux.
#
#------------------------------------------------------------------------------
# RCS: @(#) $Id: makefile.vc,v 1.135.2.9 2005/08/30 15:54:29 dgp Exp $
#------------------------------------------------------------------------------

# Check to see we are configured to build with MSVC (MSDEVDIR or MSVCDIR)
# or with the MS Platform SDK (MSSDK)
!if !defined(MSDEVDIR) && !defined(MSVCDIR) && !defined(MSSDK)
MSG = ^
You need to run vcvars32.bat from Developer Studio or setenv.bat from the^
................................................................................
	$(TMP_DIR)\bn_mp_add.obj \
	$(TMP_DIR)\bn_mp_add_d.obj \
	$(TMP_DIR)\bn_mp_and.obj \
	$(TMP_DIR)\bn_mp_clamp.obj \
	$(TMP_DIR)\bn_mp_clear.obj \
	$(TMP_DIR)\bn_mp_clear_multi.obj \
	$(TMP_DIR)\bn_mp_cmp.obj \

	$(TMP_DIR)\bn_mp_cmp_mag.obj \
	$(TMP_DIR)\bn_mp_copy.obj \
	$(TMP_DIR)\bn_mp_count_bits.obj \
	$(TMP_DIR)\bn_mp_div.obj \
	$(TMP_DIR)\bn_mp_div_d.obj \
	$(TMP_DIR)\bn_mp_div_2.obj \
	$(TMP_DIR)\bn_mp_div_2d.obj \






|







 







>







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
...
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
# 
# Copyright (c) 1995-1996 Sun Microsystems, Inc.
# Copyright (c) 1998-2000 Ajuba Solutions.
# Copyright (c) 2001-2005 ActiveState Corporation.
# Copyright (c) 2001-2004 David Gravereaux.
#
#------------------------------------------------------------------------------
# RCS: @(#) $Id: makefile.vc,v 1.135.2.10 2005/09/16 15:35:54 dgp Exp $
#------------------------------------------------------------------------------

# Check to see we are configured to build with MSVC (MSDEVDIR or MSVCDIR)
# or with the MS Platform SDK (MSSDK)
!if !defined(MSDEVDIR) && !defined(MSVCDIR) && !defined(MSSDK)
MSG = ^
You need to run vcvars32.bat from Developer Studio or setenv.bat from the^
................................................................................
	$(TMP_DIR)\bn_mp_add.obj \
	$(TMP_DIR)\bn_mp_add_d.obj \
	$(TMP_DIR)\bn_mp_and.obj \
	$(TMP_DIR)\bn_mp_clamp.obj \
	$(TMP_DIR)\bn_mp_clear.obj \
	$(TMP_DIR)\bn_mp_clear_multi.obj \
	$(TMP_DIR)\bn_mp_cmp.obj \
	$(TMP_DIR)\bn_mp_cmp_d.obj \
	$(TMP_DIR)\bn_mp_cmp_mag.obj \
	$(TMP_DIR)\bn_mp_copy.obj \
	$(TMP_DIR)\bn_mp_count_bits.obj \
	$(TMP_DIR)\bn_mp_div.obj \
	$(TMP_DIR)\bn_mp_div_d.obj \
	$(TMP_DIR)\bn_mp_div_2.obj \
	$(TMP_DIR)\bn_mp_div_2d.obj \