Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
cd9e1d02
Kaydet (Commit)
cd9e1d02
authored
Mar 23, 2012
tarafından
Stefan Krah
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Whitespace.
üst
b6405efd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
102 additions
and
102 deletions
+102
-102
mpdecimal.c
Modules/_decimal/libmpdec/mpdecimal.c
+7
-7
umodarith.h
Modules/_decimal/libmpdec/umodarith.h
+95
-95
No files found.
Modules/_decimal/libmpdec/mpdecimal.c
Dosyayı görüntüle @
cd9e1d02
...
@@ -5849,7 +5849,7 @@ _lower_bound_zeta(const mpd_t *x, uint32_t *status)
...
@@ -5849,7 +5849,7 @@ _lower_bound_zeta(const mpd_t *x, uint32_t *status)
t
=
mpd_adjexp
(
x
);
t
=
mpd_adjexp
(
x
);
if
(
t
>
0
)
{
if
(
t
>
0
)
{
/* x >= 10 -> floor(log10(floor(abs(log10(x))))) */
/* x >= 10 -> floor(log10(floor(abs(log10(x))))) */
return
mpd_exp_digits
(
t
)
-
1
;
return
mpd_exp_digits
(
t
)
-
1
;
}
}
else
if
(
t
<
-
1
)
{
else
if
(
t
<
-
1
)
{
...
@@ -5907,7 +5907,7 @@ _qcheck_pow_bounds(mpd_t *result, const mpd_t *x, const mpd_t *y,
...
@@ -5907,7 +5907,7 @@ _qcheck_pow_bounds(mpd_t *result, const mpd_t *x, const mpd_t *y,
}
}
}
}
else
{
else
{
/* (0 < |x| < 1 and y > 0) or (|x| > 1 and y < 0). */
/* (0 < |x| < 1 and y > 0) or (|x| > 1 and y < 0). */
ub_omega
=
mpd_exp_digits
(
mpd_etiny
(
ctx
));
ub_omega
=
mpd_exp_digits
(
mpd_etiny
(
ctx
));
if
(
ub_omega
<
lb_zeta
+
lb_theta
)
{
if
(
ub_omega
<
lb_zeta
+
lb_theta
)
{
_settriple
(
result
,
resultsign
,
1
,
mpd_etiny
(
ctx
)
-
1
);
_settriple
(
result
,
resultsign
,
1
,
mpd_etiny
(
ctx
)
-
1
);
...
@@ -6637,7 +6637,7 @@ mpd_same_quantum(const mpd_t *a, const mpd_t *b)
...
@@ -6637,7 +6637,7 @@ mpd_same_quantum(const mpd_t *a, const mpd_t *b)
{
{
if
(
mpd_isspecial
(
a
)
||
mpd_isspecial
(
b
))
{
if
(
mpd_isspecial
(
a
)
||
mpd_isspecial
(
b
))
{
return
((
mpd_isnan
(
a
)
&&
mpd_isnan
(
b
))
||
return
((
mpd_isnan
(
a
)
&&
mpd_isnan
(
b
))
||
(
mpd_isinfinite
(
a
)
&&
mpd_isinfinite
(
b
)));
(
mpd_isinfinite
(
a
)
&&
mpd_isinfinite
(
b
)));
}
}
return
a
->
exp
==
b
->
exp
;
return
a
->
exp
==
b
->
exp
;
...
@@ -7055,10 +7055,10 @@ _mpd_fix_sqrt(mpd_t *result, const mpd_t *a, mpd_t *tmp,
...
@@ -7055,10 +7055,10 @@ _mpd_fix_sqrt(mpd_t *result, const mpd_t *a, mpd_t *tmp,
u
.
exp
=
u
.
digits
-
ctx
->
prec
+
result
->
exp
-
1
;
u
.
exp
=
u
.
digits
-
ctx
->
prec
+
result
->
exp
-
1
;
_mpd_qsub
(
tmp
,
result
,
&
u
,
&
maxctx
,
status
);
_mpd_qsub
(
tmp
,
result
,
&
u
,
&
maxctx
,
status
);
if
(
*
status
&
MPD_Errors
)
goto
nanresult
;
if
(
*
status
&
MPD_Errors
)
goto
nanresult
;
_mpd_qmul
(
tmp
,
tmp
,
tmp
,
&
maxctx
,
status
);
_mpd_qmul
(
tmp
,
tmp
,
tmp
,
&
maxctx
,
status
);
if
(
*
status
&
MPD_Errors
)
goto
nanresult
;
if
(
*
status
&
MPD_Errors
)
goto
nanresult
;
if
(
_mpd_cmp
(
tmp
,
a
)
==
1
)
{
if
(
_mpd_cmp
(
tmp
,
a
)
==
1
)
{
u
.
exp
+=
1
;
u
.
exp
+=
1
;
...
@@ -7067,10 +7067,10 @@ _mpd_fix_sqrt(mpd_t *result, const mpd_t *a, mpd_t *tmp,
...
@@ -7067,10 +7067,10 @@ _mpd_fix_sqrt(mpd_t *result, const mpd_t *a, mpd_t *tmp,
}
}
else
{
else
{
_mpd_qadd
(
tmp
,
result
,
&
u
,
&
maxctx
,
status
);
_mpd_qadd
(
tmp
,
result
,
&
u
,
&
maxctx
,
status
);
if
(
*
status
&
MPD_Errors
)
goto
nanresult
;
if
(
*
status
&
MPD_Errors
)
goto
nanresult
;
_mpd_qmul
(
tmp
,
tmp
,
tmp
,
&
maxctx
,
status
);
_mpd_qmul
(
tmp
,
tmp
,
tmp
,
&
maxctx
,
status
);
if
(
*
status
&
MPD_Errors
)
goto
nanresult
;
if
(
*
status
&
MPD_Errors
)
goto
nanresult
;
if
(
_mpd_cmp
(
tmp
,
a
)
==
-
1
)
{
if
(
_mpd_cmp
(
tmp
,
a
)
==
-
1
)
{
u
.
exp
+=
1
;
u
.
exp
+=
1
;
...
...
Modules/_decimal/libmpdec/umodarith.h
Dosyayı görüntüle @
cd9e1d02
...
@@ -403,18 +403,18 @@ ppro_mulmod(mpd_uint_t a, mpd_uint_t b, double *dmod, uint32_t *dinvmod)
...
@@ -403,18 +403,18 @@ ppro_mulmod(mpd_uint_t a, mpd_uint_t b, double *dmod, uint32_t *dinvmod)
mpd_uint_t
retval
;
mpd_uint_t
retval
;
asm
(
asm
(
"fildl
%2
\n\t
"
"fildl %2
\n\t
"
"fildl
%1
\n\t
"
"fildl %1
\n\t
"
"fmulp
%%st, %%st(1)
\n\t
"
"fmulp %%st, %%st(1)
\n\t
"
"fldt
(%4)
\n\t
"
"fldt (%4)
\n\t
"
"fmul
%%st(1), %%st
\n\t
"
"fmul %%st(1), %%st
\n\t
"
"flds
%5
\n\t
"
"flds %5
\n\t
"
"fadd
%%st, %%st(1)
\n\t
"
"fadd %%st, %%st(1)
\n\t
"
"fsubrp
%%st, %%st(1)
\n\t
"
"fsubrp %%st, %%st(1)
\n\t
"
"fldl
(%3)
\n\t
"
"fldl (%3)
\n\t
"
"fmulp
%%st, %%st(1)
\n\t
"
"fmulp %%st, %%st(1)
\n\t
"
"fsubrp
%%st, %%st(1)
\n\t
"
"fsubrp %%st, %%st(1)
\n\t
"
"fistpl
%0
\n\t
"
"fistpl %0
\n\t
"
:
"=m"
(
retval
)
:
"=m"
(
retval
)
:
"m"
(
a
),
"m"
(
b
),
"r"
(
dmod
),
"r"
(
dinvmod
),
"m"
(
MPD_TWO63
)
:
"m"
(
a
),
"m"
(
b
),
"r"
(
dmod
),
"r"
(
dinvmod
),
"m"
(
MPD_TWO63
)
:
"st"
,
"memory"
:
"st"
,
"memory"
...
@@ -433,24 +433,24 @@ ppro_mulmod2c(mpd_uint_t *a0, mpd_uint_t *a1, mpd_uint_t w,
...
@@ -433,24 +433,24 @@ ppro_mulmod2c(mpd_uint_t *a0, mpd_uint_t *a1, mpd_uint_t w,
double
*
dmod
,
uint32_t
*
dinvmod
)
double
*
dmod
,
uint32_t
*
dinvmod
)
{
{
asm
(
asm
(
"fildl
%2
\n\t
"
"fildl %2
\n\t
"
"fildl
(%1)
\n\t
"
"fildl (%1)
\n\t
"
"fmul
%%st(1), %%st
\n\t
"
"fmul %%st(1), %%st
\n\t
"
"fxch
%%st(1)
\n\t
"
"fxch %%st(1)
\n\t
"
"fildl
(%0)
\n\t
"
"fildl (%0)
\n\t
"
"fmulp
%%st, %%st(1)
\n\t
"
"fmulp %%st, %%st(1)
\n\t
"
"fldt
(%4)
\n\t
"
"fldt (%4)
\n\t
"
"flds
%5
\n\t
"
"flds %5
\n\t
"
"fld %%st(2)
\n\t
"
"fld %%st(2)
\n\t
"
"fmul
%%st(2)
\n\t
"
"fmul %%st(2)
\n\t
"
"fadd
%%st(1)
\n\t
"
"fadd %%st(1)
\n\t
"
"fsub
%%st(1)
\n\t
"
"fsub %%st(1)
\n\t
"
"fmull
(%3)
\n\t
"
"fmull (%3)
\n\t
"
"fsubrp %%st, %%st(3)
\n\t
"
"fsubrp %%st, %%st(3)
\n\t
"
"fxch %%st(2)
\n\t
"
"fxch %%st(2)
\n\t
"
"fistpl
(%0)
\n\t
"
"fistpl (%0)
\n\t
"
"fmul
%%st(2)
\n\t
"
"fmul %%st(2)
\n\t
"
"fadd
%%st(1)
\n\t
"
"fadd %%st(1)
\n\t
"
"fsubp %%st, %%st(1)
\n\t
"
"fsubp %%st, %%st(1)
\n\t
"
"fmull (%3)
\n\t
"
"fmull (%3)
\n\t
"
"fsubrp %%st, %%st(1)
\n\t
"
"fsubrp %%st, %%st(1)
\n\t
"
...
@@ -472,36 +472,36 @@ ppro_mulmod2(mpd_uint_t *a0, mpd_uint_t b0, mpd_uint_t *a1, mpd_uint_t b1,
...
@@ -472,36 +472,36 @@ ppro_mulmod2(mpd_uint_t *a0, mpd_uint_t b0, mpd_uint_t *a1, mpd_uint_t b1,
double
*
dmod
,
uint32_t
*
dinvmod
)
double
*
dmod
,
uint32_t
*
dinvmod
)
{
{
asm
(
asm
(
"fildl
%3
\n\t
"
"fildl %3
\n\t
"
"fildl
(%2)
\n\t
"
"fildl (%2)
\n\t
"
"fmulp
%%st, %%st(1)
\n\t
"
"fmulp %%st, %%st(1)
\n\t
"
"fildl
%1
\n\t
"
"fildl %1
\n\t
"
"fildl
(%0)
\n\t
"
"fildl (%0)
\n\t
"
"fmulp
%%st, %%st(1)
\n\t
"
"fmulp %%st, %%st(1)
\n\t
"
"fldt
(%5)
\n\t
"
"fldt (%5)
\n\t
"
"fld %%st(2)
\n\t
"
"fld %%st(2)
\n\t
"
"fmul
%%st(1), %%st
\n\t
"
"fmul %%st(1), %%st
\n\t
"
"fxch
%%st(1)
\n\t
"
"fxch %%st(1)
\n\t
"
"fmul
%%st(2), %%st
\n\t
"
"fmul %%st(2), %%st
\n\t
"
"flds
%6
\n\t
"
"flds %6
\n\t
"
"fldl
(%4)
\n\t
"
"fldl (%4)
\n\t
"
"fxch
%%st(3)
\n\t
"
"fxch %%st(3)
\n\t
"
"fadd
%%st(1), %%st
\n\t
"
"fadd %%st(1), %%st
\n\t
"
"fxch
%%st(2)
\n\t
"
"fxch %%st(2)
\n\t
"
"fadd
%%st(1), %%st
\n\t
"
"fadd %%st(1), %%st
\n\t
"
"fxch
%%st(2)
\n\t
"
"fxch %%st(2)
\n\t
"
"fsub
%%st(1), %%st
\n\t
"
"fsub %%st(1), %%st
\n\t
"
"fxch
%%st(2)
\n\t
"
"fxch %%st(2)
\n\t
"
"fsubp
%%st, %%st(1)
\n\t
"
"fsubp %%st, %%st(1)
\n\t
"
"fxch
%%st(1)
\n\t
"
"fxch %%st(1)
\n\t
"
"fmul
%%st(2), %%st
\n\t
"
"fmul %%st(2), %%st
\n\t
"
"fxch
%%st(1)
\n\t
"
"fxch %%st(1)
\n\t
"
"fmulp
%%st, %%st(2)
\n\t
"
"fmulp %%st, %%st(2)
\n\t
"
"fsubrp
%%st, %%st(3)
\n\t
"
"fsubrp %%st, %%st(3)
\n\t
"
"fsubrp
%%st, %%st(1)
\n\t
"
"fsubrp %%st, %%st(1)
\n\t
"
"fxch
%%st(1)
\n\t
"
"fxch %%st(1)
\n\t
"
"fistpl
(%2)
\n\t
"
"fistpl (%2)
\n\t
"
"fistpl
(%0)
\n\t
"
"fistpl (%0)
\n\t
"
:
:
"r"
(
a0
),
"m"
(
b0
),
"r"
(
a1
),
"m"
(
b1
),
:
:
"r"
(
a0
),
"m"
(
b0
),
"r"
(
a1
),
"m"
(
b1
),
"r"
(
dmod
),
"r"
(
dinvmod
),
"r"
(
dmod
),
"r"
(
dinvmod
),
"m"
(
MPD_TWO63
)
"m"
(
MPD_TWO63
)
...
@@ -518,20 +518,20 @@ ppro_mulmod(mpd_uint_t a, mpd_uint_t b, double *dmod, uint32_t *dinvmod)
...
@@ -518,20 +518,20 @@ ppro_mulmod(mpd_uint_t a, mpd_uint_t b, double *dmod, uint32_t *dinvmod)
mpd_uint_t
retval
;
mpd_uint_t
retval
;
__asm
{
__asm
{
mov
eax
,
dinvmod
mov
eax
,
dinvmod
mov
edx
,
dmod
mov
edx
,
dmod
fild
b
fild
b
fild
a
fild
a
fmulp
st
(
1
),
st
fmulp
st
(
1
),
st
fld
TBYTE
PTR
[
eax
]
fld
TBYTE
PTR
[
eax
]
fmul
st
,
st
(
1
)
fmul
st
,
st
(
1
)
fld
MPD_TWO63
fld
MPD_TWO63
fadd
st
(
1
),
st
fadd
st
(
1
),
st
fsubp
st
(
1
),
st
fsubp
st
(
1
),
st
fld
QWORD
PTR
[
edx
]
fld
QWORD
PTR
[
edx
]
fmulp
st
(
1
),
st
fmulp
st
(
1
),
st
fsubp
st
(
1
),
st
fsubp
st
(
1
),
st
fistp
retval
fistp
retval
}
}
return
retval
;
return
retval
;
...
@@ -547,32 +547,32 @@ ppro_mulmod2c(mpd_uint_t *a0, mpd_uint_t *a1, mpd_uint_t w,
...
@@ -547,32 +547,32 @@ ppro_mulmod2c(mpd_uint_t *a0, mpd_uint_t *a1, mpd_uint_t w,
double
*
dmod
,
uint32_t
*
dinvmod
)
double
*
dmod
,
uint32_t
*
dinvmod
)
{
{
__asm
{
__asm
{
mov
ecx
,
dmod
mov
ecx
,
dmod
mov
edx
,
a1
mov
edx
,
a1
mov
ebx
,
dinvmod
mov
ebx
,
dinvmod
mov
eax
,
a0
mov
eax
,
a0
fild
w
fild
w
fild
DWORD
PTR
[
edx
]
fild
DWORD
PTR
[
edx
]
fmul
st
,
st
(
1
)
fmul
st
,
st
(
1
)
fxch
st
(
1
)
fxch
st
(
1
)
fild
DWORD
PTR
[
eax
]
fild
DWORD
PTR
[
eax
]
fmulp
st
(
1
),
st
fmulp
st
(
1
),
st
fld
TBYTE
PTR
[
ebx
]
fld
TBYTE
PTR
[
ebx
]
fld
MPD_TWO63
fld
MPD_TWO63
fld
st
(
2
)
fld
st
(
2
)
fmul
st
,
st
(
2
)
fmul
st
,
st
(
2
)
fadd
st
,
st
(
1
)
fadd
st
,
st
(
1
)
fsub
st
,
st
(
1
)
fsub
st
,
st
(
1
)
fmul
QWORD
PTR
[
ecx
]
fmul
QWORD
PTR
[
ecx
]
fsubp
st
(
3
),
st
fsubp
st
(
3
),
st
fxch
st
(
2
)
fxch
st
(
2
)
fistp
DWORD
PTR
[
eax
]
fistp
DWORD
PTR
[
eax
]
fmul
st
,
st
(
2
)
fmul
st
,
st
(
2
)
fadd
st
,
st
(
1
)
fadd
st
,
st
(
1
)
fsubrp
st
(
1
),
st
fsubrp
st
(
1
),
st
fmul
QWORD
PTR
[
ecx
]
fmul
QWORD
PTR
[
ecx
]
fsubp
st
(
1
),
st
fsubp
st
(
1
),
st
fistp
DWORD
PTR
[
edx
]
fistp
DWORD
PTR
[
edx
]
}
}
}
}
...
@@ -586,23 +586,23 @@ ppro_mulmod2(mpd_uint_t *a0, mpd_uint_t b0, mpd_uint_t *a1, mpd_uint_t b1,
...
@@ -586,23 +586,23 @@ ppro_mulmod2(mpd_uint_t *a0, mpd_uint_t b0, mpd_uint_t *a1, mpd_uint_t b1,
double
*
dmod
,
uint32_t
*
dinvmod
)
double
*
dmod
,
uint32_t
*
dinvmod
)
{
{
__asm
{
__asm
{
mov
ecx
,
dmod
mov
ecx
,
dmod
mov
edx
,
a1
mov
edx
,
a1
mov
ebx
,
dinvmod
mov
ebx
,
dinvmod
mov
eax
,
a0
mov
eax
,
a0
fild
b1
fild
b1
fild
DWORD
PTR
[
edx
]
fild
DWORD
PTR
[
edx
]
fmulp
st
(
1
),
st
fmulp
st
(
1
),
st
fild
b0
fild
b0
fild
DWORD
PTR
[
eax
]
fild
DWORD
PTR
[
eax
]
fmulp
st
(
1
),
st
fmulp
st
(
1
),
st
fld
TBYTE
PTR
[
ebx
]
fld
TBYTE
PTR
[
ebx
]
fld
st
(
2
)
fld
st
(
2
)
fmul
st
,
st
(
1
)
fmul
st
,
st
(
1
)
fxch
st
(
1
)
fxch
st
(
1
)
fmul
st
,
st
(
2
)
fmul
st
,
st
(
2
)
fld
DWORD
PTR
MPD_TWO63
fld
DWORD
PTR
MPD_TWO63
fld
QWORD
PTR
[
ecx
]
fld
QWORD
PTR
[
ecx
]
fxch
st
(
3
)
fxch
st
(
3
)
fadd
st
,
st
(
1
)
fadd
st
,
st
(
1
)
fxch
st
(
2
)
fxch
st
(
2
)
...
@@ -610,16 +610,16 @@ ppro_mulmod2(mpd_uint_t *a0, mpd_uint_t b0, mpd_uint_t *a1, mpd_uint_t b1,
...
@@ -610,16 +610,16 @@ ppro_mulmod2(mpd_uint_t *a0, mpd_uint_t b0, mpd_uint_t *a1, mpd_uint_t b1,
fxch
st
(
2
)
fxch
st
(
2
)
fsub
st
,
st
(
1
)
fsub
st
,
st
(
1
)
fxch
st
(
2
)
fxch
st
(
2
)
fsubrp
st
(
1
),
st
fsubrp
st
(
1
),
st
fxch
st
(
1
)
fxch
st
(
1
)
fmul
st
,
st
(
2
)
fmul
st
,
st
(
2
)
fxch
st
(
1
)
fxch
st
(
1
)
fmulp
st
(
2
),
st
fmulp
st
(
2
),
st
fsubp
st
(
3
),
st
fsubp
st
(
3
),
st
fsubp
st
(
1
),
st
fsubp
st
(
1
),
st
fxch
st
(
1
)
fxch
st
(
1
)
fistp
DWORD
PTR
[
edx
]
fistp
DWORD
PTR
[
edx
]
fistp
DWORD
PTR
[
eax
]
fistp
DWORD
PTR
[
eax
]
}
}
}
}
#endif
/* PPRO MASM (_MSC_VER) */
#endif
/* PPRO MASM (_MSC_VER) */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment