diff options
author | Kevin Ryde <user42@zip.com.au> | 2001-07-06 23:30:03 +0200 |
---|---|---|
committer | Kevin Ryde <user42@zip.com.au> | 2001-07-06 23:30:03 +0200 |
commit | 36e8c6af64ae7c712731b17c0fc7cc2952179fb6 (patch) | |
tree | d4dc85da2c011dcae8f26f29fd3c34bbf97a4910 /gmp-impl.h | |
parent | 3d552ab43aef9af8b140635e0d2cfcbe06a75dd1 (diff) | |
download | gmp-36e8c6af64ae7c712731b17c0fc7cc2952179fb6.tar.gz |
* gmp-impl.h (MPN_NORMALIZE): Add notes on x86 repe/scasl slow.
Diffstat (limited to 'gmp-impl.h')
-rw-r--r-- | gmp-impl.h | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/gmp-impl.h b/gmp-impl.h index 8a5d18e53..1f045d9c3 100644 --- a/gmp-impl.h +++ b/gmp-impl.h @@ -450,13 +450,6 @@ void __gmp_default_free _PROTO ((void *, size_t)); __asm__ ("std\n\trep\n\tmovsl" : : \ "D" ((DST) + (N) - 1), "S" ((SRC) + (N) - 1), "c" (N) : \ "cx", "di", "si", "memory") -#define MPN_NORMALIZE_NOT_ZERO(P, N) \ - do { \ - __asm__ ("std\n\trepe\n\tscasl" : "=c" (N) : \ - "a" (0), "D" ((P) + (N) - 1), "0" (N) : \ - "cx", "di"); \ - (N)++; \ - } while (0) #endif #endif @@ -648,6 +641,17 @@ _MPN_COPY (d, s, n) mp_ptr d; mp_srcptr s; mp_size_t n; } while (0) #endif + +/* On the x86s repe/scasl doesn't seem useful, since it takes many cycles to + start up and would need to strip a lot of zeros before it'd be faster + than a simple cmpl loop. std/repe/scasl/cld stripping no zeros runs as + follows, + cycles + P5 18 + P6 46 + K6 36 + K7 21 +*/ #ifndef MPN_NORMALIZE #define MPN_NORMALIZE(DST, NLIMBS) \ do { \ |