Changeset 5591
 Timestamp:
 Dec 4, 2006, 8:02:03 PM (15 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/ccl/level0/l0bignum32.lisp
r3140 r5591 1979 1979 (vtrailing0digits (ash vtrailing0bits 5))) 1980 1980 (declare (fixnum utrailing0bits vtrailing0bits)) 1981 (unless (zerop utrailing0 digits)1981 (unless (zerop utrailing0bits) 1982 1982 (bignumshiftrightloop1 1983 1983 (logand utrailing0bits 31) … … 2002 2002 vtrailing0bits))) 2003 2003 (loop 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2004 (let* ((fixu (and (= ulen 1) 2005 (let* ((hiu (%bignumrefhi u 0))) 2006 (declare (fixnum hiu)) 2007 (= hiu (the fixnum 2008 (logand hiu (ash mostpositivefixnum 16))))) 2009 (uvref u 0))) 2010 (fixv (and (= vlen 1) 2011 (let* ((hiv (%bignumrefhi v 0))) 2012 (declare (fixnum hiv)) 2013 (= hiv (the fixnum 2014 (logand hiv (ash mostpositivefixnum 16))))) 2015 (uvref v 0)))) 2016 (if fixv 2017 (if fixu 2018 (return (ash (%fixnumgcd fixu fixv) shift)) 2019 (return (ash (bignumfixnumgcd u fixv) shift))) 2020 (if fixu 2021 (return (ash (bignumfixnumgcd v fixu) shift))))) 2022 2022 2023 (let* ((signum (if (> ulen vlen) 2024 1 2025 (if (< ulen vlen) 2026 1 2027 (bignumcompare u v))))) 2028 (declare (fixnum signum)) 2029 (case signum 2030 (0 ; (= u v) 2031 (if (zerop shift) 2032 (let* ((copy (%allocatebignum ulen))) 2033 (bignumreplace copy u) 2034 (return copy)) 2035 (return (ash u shift)))) 2036 (1 ; (> u v) 2037 (bignumsubtractloop u ulen v vlen u) 2038 (%mostlynormalizebignummacro u) 2039 (setq ulen (%bignumlength u)) 2040 (setq utrailing0bits 2041 (%bignumcounttrailingzerobits u) 2042 utrailing0digits 2043 (ash utrailing0bits 5)) 2023 (let* ((signum (if (> ulen vlen) 2024 1 2025 (if (< ulen vlen) 2026 1 2027 (bignumcompare u v))))) 2028 (declare (fixnum signum)) 2029 (case signum 2030 (0 ; (= u v) 2031 (if (zerop shift) 2032 (let* ((copy (%allocatebignum ulen))) 2033 (bignumreplace copy u) 2034 (return copy)) 2035 (return (ash u shift)))) 2036 (1 ; (> u v) 2037 (bignumsubtractloop u ulen v vlen u) 2038 (%mostlynormalizebignummacro u) 2039 (setq ulen (%bignumlength u)) 2040 (setq utrailing0bits 2041 (%bignumcounttrailingzerobits u) 2042 utrailing0digits 2043 (ash utrailing0bits 5)) 2044 (unless (zerop utrailing0bits) 2044 2045 (%initmisc 0 u2) 2045 2046 (bignumshiftrightloop1 … … 2052 2053 (rotatef u u2) 2053 2054 (%mostlynormalizebignummacro u) 2054 (setq ulen (%bignumlength u))) 2055 (t ; (> v u) 2056 (bignumsubtractloop v vlen u ulen v) 2057 (%mostlynormalizebignummacro v) 2058 (setq vlen (%bignumlength v)) 2059 (setq vtrailing0bits 2060 (%bignumcounttrailingzerobits v) 2061 vtrailing0digits 2062 (ash vtrailing0bits 5)) 2055 (setq ulen (%bignumlength u)))) 2056 (t ; (> v u) 2057 (bignumsubtractloop v vlen u ulen v) 2058 (%mostlynormalizebignummacro v) 2059 (setq vlen (%bignumlength v)) 2060 (setq vtrailing0bits 2061 (%bignumcounttrailingzerobits v) 2062 vtrailing0digits 2063 (ash vtrailing0bits 5)) 2064 (unless (zerop vtrailing0bits) 2063 2065 (%initmisc 0 v2) 2064 2066 (bignumshiftrightloop1 … … 2070 2072 (rotatef v v2) 2071 2073 (%mostlynormalizebignummacro v) 2072 (setq vlen (%bignumlength v))))))))))) 2074 (setq vlen (%bignumlength v)))))))))))) 2073 2075 2074 2076 (defun %bignumbignumgcd (u v)
Note: See TracChangeset
for help on using the changeset viewer.