📄 readme
字号:
Copyright 2001, 2003, 2004 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 modifyit under the terms of the GNU Lesser General Public License as published bythe Free Software Foundation; either version 2.1 of the License, or (at youroption) any later version.The GNU MP Library is distributed in the hope that it will be useful, butWITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITYor FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General PublicLicense for more details.You should have received a copy of the GNU Lesser General Public Licensealong with the GNU MP Library; see the file COPYING.LIB. If not, write tothe Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA02111-1307, USA. M68K MPN SUBROUTINESThis directory contains mpn functions for various m68k family chips.CODE ORGANIZATION m68k m68000, m68010, m68060 m68k/mc68020 m68020, m68030, m68040, and CPU32The m5200 "coldfire", which is m68000 less a few instructions, currently hasno assembler code support.STATUSThe code herein is old and poorly maintained. If somebody really cared, itcould be optimized substantially. For example,* mpn_add_n and mpn_sub_n could, with more unrolling be improved from 6 to close to 4 c/l (on m68040).* The multiplication loops could be sped up by using the FPU.* mpn_lshift by 31 should use the special-case mpn_rshift by 1 code, and vice versa mpn_rshift by 31 use the special lshift by 1, when operand overlap permits.* On 68000, mpn_mul_1, mpn_addmul_1 and mpn_submul_1 could check for a 16-bit multiplier and use two multiplies per limb, not four. Similarly various other _1 operations like mpn_mod_1, mpn_divrem_1, mpn_divexact_1, mpn_modexact_1c_odd.* On 68000, mpn_lshift and mpn_rshift could use a roll and mask instead of lsrl and lsll. This promises to be a speedup, effectively trading a 6+2*n shift for one or two 4 cycle masks. Suggested by Jean-Charles Meyrignac.* config.guess detects 68000, 68010, CPU32 and 68020 by running some code, but relies on system information for 030, 040 and 060. Can they be identified by running some code? Currently this only makes a difference to the compiler options selected, since we have no specific asm code for those chips.One novel idea for 68000 would be to use a 16-bit limb instead of 32-bits.This would suit the native 16x16 multiply, but might make it difficult toget full value from the native 32x32 add/sub/etc. This would be an ABIoption, and would select "__GMP_SHORT_LIMB" in gmp.h.Naturally an entirely new set of asm subroutines would be needed for a16-bit limb. Also there's various places in the C code assuming limb>=long,which would need to be updated, eg. mpz_set_ui. Some of the nails changesmay have helped cover some of this.ASM FILESThe .asm files are put through m4 for macro processing, and with the help ofconfigure give either MIT or Motorola syntax. The generic mpn/asm-defs.m4is used, together with mpn/m68k/m68k-defs.m4. See comments in those files.Not all possible syntax variations are covered. GCC config/m68k forinstance has things like $ for immediates on CRDS or reversed cmp order forAT&T SGS. These could probably be handled if anyone really needs it.REFERENCES"Motorola M68000 Family Programmer's Reference Manual", available online, http://e-www.motorola.com/brdata/PDFDB/docs/M68000PM.pdf"System V Application Binary Interface: Motorola 68000 Processor FamilySupplement", AT&T, 1990, ISBN 0-13-877553-6. Has details of callingconventions and ELF style PIC coding.----------------Local variables:mode: textfill-column: 76End:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -