diff options
author | Kevin Ryde <user42@zip.com.au> | 2001-11-15 21:50:42 +0100 |
---|---|---|
committer | Kevin Ryde <user42@zip.com.au> | 2001-11-15 21:50:42 +0100 |
commit | 546f18de82dd9b41506b198c0e11ced3ea87f737 (patch) | |
tree | 9a3e51fcaf36ddec35508790689abde9624870b0 /mpn | |
parent | 49183a4c593bbae009f85b5e0bbbbf4101ebcd21 (diff) | |
download | gmp-546f18de82dd9b41506b198c0e11ced3ea87f737.tar.gz |
* mpn/x86/pentium4/README: New file.
Diffstat (limited to 'mpn')
-rw-r--r-- | mpn/x86/pentium4/README | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/mpn/x86/pentium4/README b/mpn/x86/pentium4/README new file mode 100644 index 000000000..777d9a6c4 --- /dev/null +++ b/mpn/x86/pentium4/README @@ -0,0 +1,98 @@ +Copyright 2001 Free Software Foundation, Inc. + +This file is part of the GNU MP Library. + +The GNU MP Library is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or (at your +option) any later version. + +The GNU MP Library is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with the GNU MP Library; see the file COPYING.LIB. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. + + + + + INTEL PENTIUM-4 MPN SUBROUTINES + + +This directory contains mpn functions optimized for Intel Pentium-4. + +The mmx subdirectory has routines using MMX instructions, the sse2 +subdirectory has routines using SSE2 instructions. All P4s have these, the +separate directories are just so configure can omit that code if the +assembler doesn't support it. + + +STATUS + + cycles/limb + + mpn_add_n/sub_n 4 normal, 6 in-place + + mpn_mul_1 4 normal, 6 in-place + mpn_addmul_1 6 + mpn_submul_1 7 + + mpn_mul_basecase 6 cycles/crossproduct (approx) + + mpn_sqr_basecase 3.5 cycles/crossproduct (approx) + or 7.0 cycles/triangleproduct (approx) + + mpn_l/rshift 1.75 + + + +The shifts ought to be able to go at 1.5 c/l, but not much effort has been +applied to them yet. + +In-place operations, and all addmul, submul, mul_basecase and sqr_basecase +calls, suffer from hardware slowdowns associated with write combining and +movd reads and writes to the same or nearby locations. Software movq and +splitting/combining seems to require too many extra instructions to help. +Perhaps future chip steppings will be better. + + + +NOTES + +incl and decl are to be avoided, and instead add $1 and sub $1 used, since +the carry flag is apparently not separately renamed, making incl and decl +dependent on the last (or perhaps all) previous flags-setting instructions. + +movq mmx -> mmx does have 6 cycle latency, as noted in the documentation. +pxor/por or similar combination at 2 cycles latency can be used instead. +The movq however executes in the float unit, thereby saving MMX execution +resources. With the right juggling, data moves shouldn't be on a dependent +chain. + +L1 is write-through, but the write-combining sounds like it does enough to +not require explicit destination prefetching. + +xmm registers so far haven't found a use, but not much effort has been +expended. A configure test for whether the operating system knows +fxsave/fxrestor will be needed if they're used. + + + +REFERENCES + +"Intel Pentium 4 Processor Optimization Reference Manual", Intel, 2001, +order number 248966. Available on-line: + + http://developer.intel.com/design/pentium4/manuals/248966.htm + + + +---------------- +Local variables: +mode: text +fill-column: 76 +End: |