Changeset 13931
 Timestamp:
 Jul 7, 2010, 6:52:06 PM (9 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

branches/arm/level0/ARM/armbignum.lisp
r13927 r13931 853 853 ;; y1 is at index, y2 at index1 854 854 ;; this doesnt help much 855 #+notyet856 855 (defarmlapfunction truncateguessloop ((guessh 8)(guessl 4)(x 0) 857 856 (xidx arg_x)(yptr arg_y) (yidx arg_z)) … … 864 863 (gy2hi imm2) 865 864 (xptr temp0) 866 (m imm3) 867 (tem imm4) 868 (y1idx 28) 869 (y2idx 24) 870 (x0idx 20) 871 (x1idx 16) 872 (x2idx 12)) 873 (stru 32 (:$ tsp)) tsp 874 (str tsp tsp (:$ 4)) 875 (ldr y1 vsp (:$ guessh)) 876 (ldr tem vsp (:$ guessl)) 877 (composedigit guess y1 tem) 878 (addi tem yidx arm::miscdataoffset) 879 (ldr y1 (:@ yptr tem)) 880 (str y1 tsp (:$ y1idx)) 881 (subi tem tem 4) 882 (ldr y2 (:@ yptr tem)) 883 (str y2 tsp (:$ y2idx)) 884 (ldr xptr vsp (:$ x)) 885 (addi tem xidx arm::miscdataoffset) 886 (ldr y1 (:@ xptr tem)) ; its x0 887 (str y1 tsp (:$ x0idx)) 888 (subi tem tem 4) 889 (ldr y1 (:@ xptr tem)) 890 (str y1 tsp (:$ x1idx)) 891 (subi tem tem 4) 892 (ldr y1 (:@ xptr tem)) 893 (str y1 tsp (:$ x2idx)) 865 (m r3) 866 (tem temp1) 867 (savercontext temp2) 868 (msave 24) 869 (y1idx 20) 870 (y2idx 16) 871 (x0idx 12) 872 (x1idx 8) 873 (x2idx 4)) 874 (mov imm0 (:$ (ash 6 arm::numsubtagbits))) 875 (orr imm0 imm0 (:$ arm::subtagu32vector)) 876 (str imm0 (:@! sp (:$ 32))) 877 (mov savercontext rcontext) 878 (ldr y1 (:@ vsp (:$ guessh))) 879 (ldr y2 (:@ vsp (:$ guessl))) 880 (composedigit guess y1 y2) 881 (mov tem (:lsl yidx (:$ arm::fixnumshift))) 882 (add tem tem (:$ (ash arm::miscdataoffset arm::fixnumshift))) 883 (ldr y1 (:@ yptr (:asr tem (:$ arm::fixnumshift)))) 884 (str y1 (:@ sp (:$ y1idx))) 885 (sub tem tem '4) 886 (ldr y2 (:@ yptr (:asr tem (:$ arm::fixnumshift)))) 887 (str y2 (:@ sp (:$ y2idx))) 888 (ldr xptr (:@ vsp (:$ x))) 889 (mov tem (:lsl xidx (:$ arm::fixnumshift))) 890 (add tem tem (:$ (ash arm::miscdataoffset arm::fixnumshift))) 891 (ldr y1 (:@ xptr (:asr tem (:$ arm::fixnumshift)))) ; its x0 892 (str y1 (:@ sp (:$ x0idx))) 893 (sub tem tem '4) 894 (ldr y1 (:@ xptr (:asr tem (:$ arm::fixnumshift)))) 895 (str y1 (:@ sp (:$ x1idx))) 896 (sub tem tem '4) 897 (ldr y1 (:@ xptr (:asr tem (:$ arm::fixnumshift)))) 898 (str y1 (:@ sp (:$ x2idx))) 894 899 @loop 895 (ldr y1 tsp (:$ y1idx)) ; get y1 896 (mullw gy1lo guess y1) 897 (ldr m tsp (:$ x1idx)) ; get x1 898 (subc m m gy1lo) ; x1  gy1lo => m 899 (mulhwu gy1hi guess y1) 900 (ldr tem tsp (:$ x0idx)) ; get x0 901 (subfe. tem gy1hi tem) ;  val not used just cr 902 (ldr y2 tsp (:$ y2idx)) ; get y2 903 (mulhwu gy2hi guess y2) ; does it pay to do this now even tho may not need? 900 (ldr y1 (:@ sp (:$ y1idx))) ; get y1 901 (mul gy1lo guess y1) 902 (ldr m (:@ sp (:$ x1idx))) ; get x1 903 (subs m m gy1lo) ; x1  gy1lo => m 904 (umull gy1hi y2 guess y1) 905 (ldr y2 (:@ sp (:$ x0idx))) ; get x0 906 (rscs y2 gy1hi y2) ;  val not used just cr 907 (ldr y2 (:@ sp (:$ y2idx))) ; get y2 908 (str m (:@ sp (:$ msave))) 909 (umull gy2hi m guess y2) ; does it pay to do this now even tho may not need? 910 (ldr m (:@ sp (:$ msave))) 904 911 (bne @done) 905 (cmp l :cr0gy2hi m) ; if > or = and foo then more  L means logical means unsigned906 (bl t@done) ; if < done912 (cmp gy2hi m) ; if > or = and foo then more  L means logical means unsigned 913 (blo @done) ; if < done 907 914 (bne @more) ; if = test lo 908 (mul lwgy2lo guess y2)909 (ldr tem tsp (:$ x2idx)) ; get x2910 (cmp l :cr0 gy2lo tem)911 (bl e@done)915 (mul gy2lo guess y2) 916 (ldr y1 (:@ sp (:$ x2idx))) ; get x2 917 (cmp gy2lo y1) 918 (bls @done) 912 919 @more 913 (sub i guess guess 1)920 (sub guess guess (:$ 1)) 914 921 (b @loop) 915 922 @done 923 (mov rcontext savercontext) 916 924 (digith temp0 guess) 917 (vpush temp0)925 (vpush1 temp0) 918 926 (digitl temp0 guess) 919 (vpush temp0)927 (vpush1 temp0) 920 928 (add temp0 vsp (:$ 20)) 921 ( ldr tsp tsp (:$ 0))929 (add sp sp (:$ 32)) 922 930 (setnargs 2) 923 931 (ba .spvalues))) … … 1160 1168 (ldr x (:@ bignum (:asr i (:$ 2)))) 1161 1169 (rsb shift shift (:$ 32)) 1162 (mov x (: asr x shift))1170 (mov x (:lsr x shift)) 1163 1171 (add i i '4) ;sic 1164 1172 (ldr y (:@ bignum (:asr i (:$ 2)))) … … 1169 1177 (add j j '1) 1170 1178 (cmp j len) 1171 (add i i '4)1172 1179 (blt @loop) 1173 1180 @done 1174 ; do first  lo order 1175 1176 ; do last  hi order 1177 ;(dbg t) 1181 (rsb shift shift (:$ 32)) 1178 1182 (ldr y (:@ bignum (:asr i (:$ 2)))) 1179 (mov y (: asr y shift))1183 (mov y (:lsr y shift)) 1180 1184 (add x len (:$ arm::miscdataoffset)) 1181 1185 (str y (:@ resptr x))
Note: See TracChangeset
for help on using the changeset viewer.