Changeset 5588 for trunk/ccl/level-0/X86/X8664
- Timestamp:
- Dec 4, 2006, 7:46:36 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ccl/level-0/X86/X8664/x8664-bignum.lisp
r4153 r5588 97 97 ;;; resulting from dividing hi:low by divisor. 98 98 ;;; We only have two immediate registers, and -have- to use them 99 ;;; to represent hi:low. We -can- store the unboxed divisor in 100 ;;; %ebp, if we commit to the idea that %rbp will never be traced 101 ;;; by the GC. I'm willing to commit to that for x8664, since 102 ;;; this is an example of not having enough imm regs. We do need 103 ;;; to save/restore %rbp, but hopefully we can do wo without 104 ;;; hitting memory. 99 ;;; to represent hi:low. Keep the unboxed divisor in the high 100 ;;; word of a fixnum on the top of the stack. (That's probably 101 ;;; slower than using %rbp, but clobbering %rbp confuses backtrace). 105 102 ;;; For x8632, we'll probably have to mark something (%ecx ?) as 106 103 ;;; being "temporarily unboxed" by mucking with some bits in the … … 109 106 (let ((unboxed-high imm1) 110 107 (unboxed-low imm0) 111 (unboxed-divisor ebp)112 108 (unboxed-quo imm0) 113 109 (unboxed-rem imm1)) 114 (movd (% rbp) (% mm0)) 115 (unbox-fixnum divisor rbp) 110 (unbox-fixnum divisor imm0) 111 (pushq ($ 0)) 112 (movl (%l imm0) (@ 4 (% rsp))) 116 113 (unbox-fixnum num-high unboxed-high) 117 114 (unbox-fixnum num-low unboxed-low) 118 (divl ( % ebp))119 ( movd (% mm0) (% rbp))115 (divl (@ 4 (% rsp))) 116 (addq ($ 8) (% rsp)) 120 117 (box-fixnum unboxed-quo arg_y) 121 118 (box-fixnum unboxed-rem arg_z) … … 205 202 ;;; Again, we're out of imm regs: a variable shift count has to go in %cl. 206 203 ;;; Make sure that the rest of %rcx is 0, to keep the GC happy. 207 ;;; %rcx == temp 1204 ;;; %rcx == temp2 208 205 (defx86lapfunction %digit-logical-shift-right ((digit arg_y) (count arg_z)) 209 206 (unbox-fixnum digit imm0) … … 215 212 (box-fixnum imm0 arg_z) 216 213 (single-value-return)) 214 215 217 216 218 217 (defx86lapfunction %ashr ((digit arg_y) (count arg_z)) … … 232 231 (xorq (% temp2) (% temp2)) 233 232 (movb (% imm1.b) (% temp2.b)) 234 (shl l (% temp2.b) (%limm0))233 (shlq (% temp2.b) (% imm0)) 235 234 (movb ($ 0) (% temp2.b)) 236 235 (movl (%l imm0) (%l imm0)) ;zero-extend
Note: See TracChangeset
for help on using the changeset viewer.