Index: /branches/arm/lisp-kernel/arm-spentry.s
===================================================================
--- /branches/arm/lisp-kernel/arm-spentry.s	(revision 13754)
+++ /branches/arm/lisp-kernel/arm-spentry.s	(revision 13755)
@@ -88,14 +88,6 @@
 	__(bne 1f)
 	__(unbox_fixnum(imm2,arg_z))
-	__(smull arg_z,imm1,imm2,arg_y)
-	/* Now have a "64-bit fixnum" in imm1(high) and arg_z(low). If */
-	/* imm1 is just a sign extension of arg_z, return arg_z */
-	__(cmp imm1,arg_z,asr #(nbits_in_word-1))
-	__(bxeq lr)
-	/* Need to ashift the pair imm1:imm0 right fixnumshift bits */
-	__(mov imm0,imm0,lsr #fixnumshift)
-	__(and imm2,imm1,#fixnummask)
-	__(orr imm0,imm0,imm2,lsl #(nbits_in_word-fixnumshift))
-	__(unbox_fixnum(imm1,imm1))
+        __(unbox_fixnum(imm0,arg_y))
+	__(smull imm0,imm1,imm2,imm0)
 	__(b _SPmakes64)
 
@@ -1325,6 +1317,6 @@
         /* (vpush (< imm1 nargs))  */
         __(cmp imm1,nargs)
-        __(subeq imm1,imm1,#t_offset)
-        __(vpush1(imm1))
+        __(subeq arg_x,arg_x,#t_offset)
+        __(vpush1(arg_x))
         __(cmp imm1,imm0)
         __(bne 1b)
@@ -1380,192 +1372,46 @@
 
 
-_spentry(simple_keywords)
-dnl  __(mov imm0,#0)
-dnl         __(vpush_argregs())
-dnl         __(b _SPkeyword_bind)
-dnl                 
-_spentry(keyword_args)
-dnl  __(vpush_argregs())
-dnl         __(b _SPkeyword_bind)
-dnl 
-dnl /* Treat the last (- nargs imm0) values on the vstack as keyword/value  */
-dnl /* pairs.  There'll be imm3 keyword arguments.  Imm2 contains flags  */
-dnl /* that indicate whether &allow-other-keys was specified and whether  */
-dnl /* or not to leave the keyword/value pairs on the vstack for an &rest  */
-dnl /* argument.  Temp3 contains a vector of keyword specifiers which we  */
-dnl /* must (in general) match.  */
-dnl /* If the number of arguments is greater than imm0, the difference must  */
-dnl /* be even.  */
-dnl /* Note that the caller hasn't yet saved its caller's context and that  */
-dnl /* the temp registers used to pass next_method_context  */
-dnl /* (temp1) may still have "live" values in them, as does nfn (temp2).  */
-dnl 
-dnl define(`keyword_flags',`imm2')
-dnl define(`keyword_vector',`temp3')
-dnl define(`keyword_count',`imm3')
-dnl 
-dnl 
-dnl 
-dnl define(`varptr',`save0')
-dnl define(`valptr',`save1')
-dnl define(`limit',`save2')
-dnl 
-_spentry(keyword_bind)
-dnl         /* Before we can really do anything, we have to  */
-dnl         /* save the caller's context.  To do so, we need to know  */
-dnl         /* how many args have actually been pushed.  Ordinarily, that'd  */
-dnl         /* be "nargs", but we may have pushed more args than we received  */
-dnl  /* if we had to default any &optionals.  */
-dnl  /* So, the number of args pushed so far is the larger of nargs  */
-dnl  /* and the (canonical) total of required/&optional args received.  */
-dnl  __(cmpr(nargs,imm0))
-dnl  __(add arg_z,vsp,nargs)
-dnl  __(bge+ 1f)
-dnl  __(add arg_z,vsp,imm0)
-dnl 1:
-dnl  __(build_lisp_frame(fn,loc_pc,arg_z))
-dnl  __(mov fn,nfn)
-dnl  /* If there are key/value pairs to consider, we slide them down  */
-dnl  /* the vstack to make room for the value/supplied-p pairs.  */
-dnl  /* The first step in that operation involves pushing imm3 pairs  */
-dnl  /* of NILs.  */
-dnl  /* If there aren't any such pairs, the first step is the last  */
-dnl  /* step.  */
-dnl  __(cmp imm3,#0)
-dnl  __(mov arg_z,#0)
-dnl  __(sub imm1,nargs,imm0)
-dnl  __(mov imm4,vsp) /* in case odd keywords error  */
-dnl  __(cmpri(cr1,imm1,0))
-dnl  __(b 3f)
-dnl 2:
-dnl  __(addi arg_z,arg_z,fixnum_one)
-dnl  __(cmplr(arg_z,imm3))
-dnl  __(mov imm5,#nil_value)
-dnl  __(vpush1(imm5))
-dnl  __(vpush1(imm5))
-dnl 3:
-dnl  __(bne 2b)
-dnl  __(andi. arg_z,imm1,fixnum_one)
-dnl  __(blelr cr1) /* no keyword/value pairs to consider.  */
-dnl  __(bne odd_keywords)
-dnl  /* We have key/value pairs.  Move them to the top of the vstack,  */
-dnl  /* then set the value/supplied-p vars to NIL.  */
-dnl  /* Have to use some save regs to do this.  */
-dnl  __(vpush1(limit))
-dnl  __(vpush1(valptr))
-dnl  __(vpush1(varptr))
-dnl  /* recompute ptr to user args in case stack overflowed  */
-dnl  __(add imm4,vsp,imm3)
-dnl  __(add imm4,imm4,imm3)
-dnl  __(addi imm4,imm4,3*node_size)
-dnl  /* error if odd number of keyword/value args  */
-dnl  __(mov varptr,imm4)
-dnl  __(la limit,3*node_size(vsp))
-dnl  __(mov valptr,limit)
-dnl  __(mov arg_z,imm1)
-dnl 4:
-dnl  __(mov imm4,#nil_value)
-dnl  __(subi arg_z,arg_z,2<<fixnumshift)
-dnl  __(cmplri(arg_z,0))
-dnl  __(ldr arg_x,[varptr,#node_size*0])
-dnl  __(ldr arg_y,[varptr,#node_size*1])
-dnl  __(str(imm4,node_size*0(varptr)))
-dnl  __(str(imm4,node_size*1(varptr)))
-dnl  __(la varptr,node_size*2(varptr))
-dnl  __(str(arg_x,node_size*0(valptr)))
-dnl  __(str(arg_y,node_size*1(valptr)))
-dnl  __(la valptr,node_size*2(valptr))
-dnl  __(bne 4b)
-dnl 
-dnl 
-dnl         /* Now, iterate through each supplied keyword/value pair.  If  */
-dnl         /* it's :allow-other-keys and the corresponding value is non-nil,  */
-dnl         /* note that other keys will be allowed.  */
-dnl         /* Find its position in the function's keywords vector.  If that's  */
-dnl         /* nil, note that an unknown keyword was encountered.  */
-dnl         /* Otherwise, if the keyword arg hasn't already had a value supplied,  */
-dnl         /* supply it.  */
-dnl         /* When done, complain if any unknown keywords were found and that  */
-dnl         /* situation was unexpected.  */
-dnl  __(mov imm4,valptr)
-dnl 5:
-dnl         __(cmpri(keyword_flags,16<<fixnumshift)) /* seen :a-o-k yet ?  */
-dnl  __(ldru(arg_z,-node_size(valptr)))
-dnl  __(ldru(arg_y,-node_size(valptr)))
-dnl  __(cmpri(cr1,arg_y,nil_value))
-dnl  __(mov arg_x,#nrs.kallowotherkeys)
-dnl         /* cr6_eq <- (eq current-keyword :allow-other-keys)  */
-dnl  __(cmpr(cr6,arg_x,arg_z))
-dnl  __(cmpr(cr7,valptr,limit))
-dnl  __(bne cr6,6f)
-dnl         __(bge 6f) /* Already seen :allow-other-keys  */
-dnl         __(ori keyword_flags,keyword_flags,16<<fixnumshift)
-dnl  __(beq cr1,6f)
-dnl  __(ori keyword_flags,keyword_flags,fixnum_one)
-dnl 6:
-dnl  __(cmpri(cr1,imm3,0))
-dnl  __(mov imm1,#misc_data_offset)
-dnl  __(mov imm0,#0)
-dnl  __(b 8f)
-dnl 7:
-dnl  __(addi imm0,imm0,fixnum_one)
-dnl  __(cmpr(cr1,imm0,imm3))
-dnl  __(ldrx(arg_x,keyword_vector,imm1))
-dnl  __(cmpr(arg_x,arg_z))
-dnl  __(addi imm1,imm1,fixnum_one)
-dnl  __(bne 8f)
-dnl  __(add imm0,imm0,imm0)
-dnl  __(sub imm0,varptr,imm0)
-dnl  __(ldr arg_x,[imm0,#0])
-dnl  __(cmp arg_x,#nil_value)
-dnl  __(mov arg_z,#t_value)
-dnl  __(bne 9f)
-dnl  __(str(arg_y,node_size(imm0)))
-dnl  __(str(arg_z,0(imm0)))
-dnl  __(b 9f)
-dnl 8:
-dnl  __(bne cr1,7b)
-dnl  /* Unknown keyword. If it was :allow-other-keys, cr6_eq will still */
-dnl         /* be set.  */
-dnl         __(beq cr6,9f)
-dnl  __(ori keyword_flags,keyword_flags,2<<fixnumshift)
-dnl 9:
-dnl  __(bne cr7,5b)
-dnl  __(vpop(varptr))
-dnl  __(vpop(valptr))
-dnl  __(vpop(limit))
-dnl  /* All keyword/value pairs have been processed.  */
-dnl  /* If we saw an unknown keyword and didn't expect to, error.  */
-dnl  /* Unless bit 2 is set in the fixnum in keyword_flags, discard the  */
-dnl  /* keyword/value pairs from the vstack.  */
-dnl  __(andi. imm0,keyword_flags,(fixnum_one)|(2<<fixnumshift))
-dnl  __(cmpri(imm0,2<<fixnumshift))
-dnl  __(beq- badkeys)
-dnl  __(andi. imm2,keyword_flags,4<<fixnumshift)
-dnl  __(bnelr cr0)
-dnl  __(mov vsp,imm4)
-dnl  __(bx lr)
-dnl 
-dnl /* Signal an error.  We saved context on entry, so this thing doesn't  */
-dnl /* have to.  */
-dnl /* The "unknown keywords" error could be continuable (ignore them.)  */
-dnl /* It might be hard to then cons an &rest arg.  */
-dnl /* In the general case, it's hard to recover the set of args that were  */
-dnl /* actually supplied to us ...  */
-dnl /* For now, just cons a list out of the keyword/value pairs */
-dnl /* that were actually provided, and signal an "invalid keywords" */
-dnl /* error with that list as an operand.  */
-dnl odd_keywords:
-dnl  __(mov vsp,imm4)
-dnl  __(mov nargs,imm1)
-dnl  __(b 1f)
-dnl badkeys:
-dnl  __(sub nargs,imm4,vsp)
-dnl 1:
-dnl  __(bl _SPconslist)
-dnl  __(mov arg_y,#XBADKEYS)
-dnl  __(set_nargs(2))
-dnl  __(b _SPksignalerr)
-dnl 
+_spentry(check_fpu_exception)
+
+_spentry(discard_stack_object)
+        new_local_labels()        
+        __(ldr imm0,[sp,#0])
+        __(cmp imm0,#stack_alloc_marker)
+        __(ldreq sp,[sp,#node_size])
+        __(bxeq lr)
+        __(cmp imm0,#lisp_frame_marker)
+        __(extract_fulltag(imm1,imm0))
+        __(addeq sp,sp,#lisp_frame.size)
+        __(bxeq lr)
+        __(cmp imm1,#fulltag_immheader)
+        __(and imm1,imm0,#subtag_mask)
+        __(bic imm0,imm0,#subtag_mask)
+        __(beq local_label(ivector))
+local_label(word):
+        __(mov imm0,imm0,lsr #num_subtag_bits-word_shift)
+local_label(out):       
+        __(dnode_align(imm0,imm0,node_size))
+        __(add sp,sp,imm0)
+        __(bx lr)
+local_label(ivector):      
+        __(cmp imm1,#max_32_bit_ivector_subtag)
+        __(bls local_label(word))        
+        __(cmp imm1,#max_8_bit_ivector_subtag)
+        __(movls imm0,imm0,lsr #num_subtag_bits)
+        __(bls local_label(out))
+        __(cmp imm1,#max_16_bit_ivector_subtag)
+        __(movls imm0,imm0,lsr #num_subtag_bits-1)
+        __(bls local_label(out))
+        __(cmp imm1,#subtag_bit_vector)
+        __(moveq imm0,imm0,lsr #num_subtag_bits)
+        __(addeq imm0,imm0,#7)
+        __(moveq imm0,imm0,lsr #3)
+        __(beq local_label(out))
+        /* The infamous 'stack-consed double-float vector' case */
+        __(mov imm0,imm0,lsr #num_subtag_bits-dnode_shift)
+        __(b local_label(out))
+
+
+	
 /* Signal an error synchronously, via %ERR-DISP.  */
 /* If %ERR-DISP isn't fbound, it'd be nice to print a message  */
@@ -2856,4 +2702,275 @@
 
 
+/* Treat the last (- nargs imm0) values on the vstack as keyword/value  */
+/* pairs.  There'll be arg_z keyword arguments.  arg_y contains flags  */
+/* that indicate whether &allow-other-keys was specified and whether  */
+/* or not to leave the keyword/value pairs on the vstack for an &rest  */
+/* argument.  Element 2 of the function in fn contains a vector of keyword.  */
+/* If the number of arguments is greater than imm0, the difference must  */
+/* be even.  */
+/* All arg regs have been vpushed and the calling function has built a */
+/* stack frame.  next_method_context must be preserved, as must the incoming */
+/* key/value pairs and their number if we're going to make an &rest arg. */
+           
+
+define(`keyword_flags',`arg_y')
+define(`key_value_count',`arg_z')
+
+define(`keyword_flag_allow_other_keys',`(1<<fixnumshift)')
+define(`keyword_flag_seen_allow_other_keys',`(2<<fixnumshift)')
+define(`keyword_flag_unknown_keyword_seen',`(3<<fixnumshift)')
+define(`keyword_flag_rest',`(4<<fixnumshift)')
+
+_spentry(keyword_bind)
+        new_local_labels()        
+        __(subs key_value_count,nargs,imm0)
+        __(movmi key_value_count,#0)
+        __(tst key_value_count,#fixnumone)
+        __(bne local_label(odd_keywords))
+        __(mov imm1,key_value_count,lsl #num_subtag_bits-fixnumshift)
+        __(orr imm1,imm1,subtag_u32_vector)
+        __(add imm0,key_value_count,#dnode_size) /* we know  count is even */
+        __(stack_allocate_zeroed_ivector(imm1,imm0))
+        __(mov imm0,#subtag_simple_vector)
+        __(strb imm0,[sp])
+        /* Copy key/value pairs in reverse order from the vstack to
+           the gvector we just created on the cstack. */
+        __(add imm0,vsp,key_value_count) /* src, predecrement */
+        __(add imm1,sp,#node_size)       /* dest, postincrement */
+        __(mov temp2,key_value_count)
+        __(b 1f)
+0:      __(ldr arg_x,[imm0,#-node_size]!)
+        __(str arg_x,[imm1],#node_size)
+1:      __(subs temp2,temp2,#fixnumone)
+        __(bge 0b)
+        /* Discard the key/value pairs from the vstack. */
+        __(add vsp,vsp,key_value_count)
+        __(ldr temp2,[fn,#misc_data_offset+(2*node_size)])
+        __(getvheader(imm0,temp2))
+        __(mov imm0,imm0,lsr #num_subtag_bits)
+        __(mov temp0,vsp)
+        __(mov imm1,#nil_value)
+        /* Push a pair of NILs (value, supplied-p) for each defined keyword */
+        __(b 3f)
+2:      __(vpush1(imm1))
+        __(vpush1(imm1))
+3:      __(subs imm0,imm0,#1)
+        __(bge 2f)
+        /* Save nargs and temp1 so that we can use them in the loop(s) */
+        __(stmdb vsp!,{imm2,temp1})
+        /* For each provided key/value pair: if the key is :allow-other-keys
+           and that hasn't been seen before, note that it's been seen and
+           if the value is non-nil set the allow-other-keys bit in flags.
+           Then search for the key in the defined keys vector.  If it's
+           not found, note that an undefined keyword was seen by setting
+           a bit in keyword_flags ; if it is found, use its position to
+           index the table of value/supplied-p pairs that we pushed above.
+           If the supplied-p var is already set, do nothing; otherwise,
+           set the supplied-p var and value.
+           When done, signal an error if we got an unknown keyword, or
+           either copy the supplied key/value pairs back to the vstack
+           if we're going to cons an &rest arg or discard them if we aren't.
+        */
+        __(mov imm2,#0)
+        __(b local_label(nextvalpairtest))
+local_label(nextvalpairloop):   
+        __(add temp1,sp,#4)
+        __(ldr temp1,[temp1,imm2])
+        __(ref_nrs_symbol(imm1,kallowotherkeys,imm1))
+        __(cmp temp1,imm1)
+        __(tsteq keyword_flags,#keyword_flag_seen_allow_other_keys)
+        __(bne local_label(current_key_allow_other_keys_handled))
+        __(orr keyword_flags,keyword_flags,#keyword_flag_seen_allow_other_keys)
+        /* Fortunately, we know what the keyword is.  Need to check the
+           value here, and don't have a lot of free registers ... */
+        __(add temp1,sp,#8)
+        __(ldr temp1,[temp1,imm2])
+        __(cmp temp1,#nil_value)
+        __(orrne keyword_flags,keyword_flags,#keyword_flag_allow_other_keys)
+        __(mov temp1,imm1)      /* from comparison above */
+local_label(current_key_allow_other_keys_handled):
+        __(getvheader(imm0,temp1))
+        __(header_length(imm0,imm0))
+        __(add imm0,imm0,#misc_data_offset)
+        __(b local_label(defined_keyword_compare_test))
+local_label(defined_keyword_compare_loop):      
+        __(ldr arg_x,[temp2,imm0])
+        __(cmp arg_x,temp1)
+        __(subeq imm0,imm0,#misc_data_offset)
+        __(beq local_label(defined_keyword_found))
+local_label(defined_keyword_compare_test):      
+        __(sub imm0,imm0,#node_size)
+        __(cmp imm0,#misc_data_offset)
+        __(bge local_label(defined_keyword_compare_loop))
+        /* keyword wasn't defined.  Note that ... */
+        __(orr keyword_flags,keyword_flags,#keyword_flag_unknown_keyword_seen)
+        __(b local_label(nextkeyvalpairnext))
+local_label(defined_keyword_found):     
+        __(sub imm0,temp0,imm0,lsl #1)
+        __(ldr arg_x,[imm0,#-4])
+        __(cmp arg_x,#nil_value) /* seen this keyword yet ? */
+        __(bne local_label(nextkeyvalpairnext))
+        __(add arg_x,arg_x,#t_offset)
+        __(str arg_x,[imm0,#-4])
+        __(add temp1,sp,#8)
+        __(ldr temp1,[temp1,imm2])
+        __(str temp1,[imm0,#0])
+local_label(nextkeyvalpairnext):
+        __(add imm2,imm2,#8)
+local_label(nextvalpairtest):   
+        __(cmp imm2,key_value_count)
+        __(bne local_label(nextvalpairloop))
+        __(ldmia vsp!,{imm2,temp1})
+        /* If unknown keywords and that's not allowed, signal error.
+           Otherwise, discard the stack-consed vector and return,
+           possibly after having copied the vector's contents back
+           to the vstack so that an &rest arg can be constructed.
+        */
+        __(tst keyword_flags,#keyword_flag_unknown_keyword_seen)
+        __(beq 0f)
+        __(tst keyword_flags,#keyword_flag_allow_other_keys)
+        __(beq local_label(badkeys))
+0:      __(tst keyword_flags,#keyword_flag_rest)
+        __(beq local_label(discard_stack_vector))
+        __(mov nargs,#0)
+        __(add temp2,sp,#node_size)
+        __(b 2f)
+1:      __(ldr arg_x,[temp2],#node_size)
+        __(vpush1(arg_x))
+        __(add nargs,nargs,#fixnumone)
+2:      __(cmp nargs,key_value_count)
+        __(bne 1b)
+local_label(discard_stack_vector):      
+        __(add key_value_count,key_value_count,#dnode_size)
+        __(add sp,sp,key_value_count)
+        __(bx lr)               /* it's finally over ! */
+
+local_label(badkeys):   /* Disturbingly similar to the &rest case */
+        __(mov nargs,#0)
+        __(add temp2,sp,#node_size)
+        __(mov vsp,temp0)
+        __(b 1f)
+0:      __(ldr arg_x,[temp2],#node_size)
+        __(vpush1(arg_x))
+        __(add nargs,nargs,#fixnumone)
+1:      __(cmp nargs,key_value_count)
+        __(bne 0b)
+        /* Lose the stack vector */
+        __(add key_value_count,key_value_count,#dnode_size)
+        __(add sp,sp,key_value_count)
+local_label(error_exit):                
+        __(bl _SPconslist)
+        __(mov arg_y,#XBADKEYS)
+        __(set_nargs(2))
+        __(b _SPksignalerr)
+local_label(odd_keywords):       
+        __(mov nargs,key_value_count)
+        __(b local_label(error_exit))
+
+/* Most ARMs don't have hardware integer division.  This algorithm's
+  from Sloss, Symes, & Wright.  On entry: imm0 = numerator, imm1 = denominator;
+  on exit, imm0 = quotient, imm1 = remainder, imm2 clobbered.  Check for /0
+  here, so that callers don't have to.
+*/        
+_spentry(udiv32)
+        __(cmp imm0,#0)
+        __(moveq arg_z,#XDIVZRO)
+        __(moveq nargs,#1<<fixnumshift)
+        __(beq _SPksignalerr)
+        __(ldr imm2,[rcontext,#tcr.flags])
+        __(orr imm2,imm2,#(1<<TCR_FLAG_BIT_ALLOCPTR_FOREIGN))
+        __(str imm2,[rcontext,#tcr.flags])
+        __(vpush1(rcontext))
+        /* Hopefully safe now to use r3 (rcontext) and r12 (allocptr)
+           as imm regs. */
+pushdef(`q',`r0')
+pushdef(`r',`r1')
+pushdef(`s',`r2')
+pushdef(`m',`r3')
+pushdef(`a',`r12')
+        __(clz s,q)
+        __(movs a,q,lsl s)
+        __(add a,pc,a,lsr #25)
+        __(ldrbeq a,[a,#local_label(t32)-local_label(b32)-64])
+local_label(b32):
+        __(subs s,s,#7)
+        __(rsb m,q,#0)
+        __(movpl q,a,lsl s)
+        __(mulpl a,q,m)
+        __(bmi local_label(udiv_by_large_d))
+        __(smlawt q,q,a,q)
+        __(teq m,m,asr #1)
+        __(mulne a,q,m)
+        __(movne s,#0)
+        __(smlalne s,q,a,q)
+        __(beq local_label(udiv_by_1))
+        __(umull s,q,r,q)
+        __(add r,r,m)
+        __(mla r,q,m,r)
+        __(cmn r,m)
+        __(subcs r,r,m)
+        __(addcc q,q,#1)
+        __(addpl r,r,m,lsl #1)
+        __(addpl q,q,#2)
+        __(b local_label(done))
+local_label(udiv_by_large_d):        
+        __(sub a,a,#4)
+        __(rsb s,s,#0)
+        __(mov q,a,lsr s)
+        __(umull s,q,r,q)
+        __(mla r,q,m,r)
+        __(cmn m,r,lsr #1)
+        __(addcs r,r,m,lsl #1)
+        __(addcs q,q,#2)
+        __(cmn m,r)
+        __(addcs q,q,#1)
+        __(b local_label(done))
+local_label(udiv_by_1):
+        __(mov q,r)
+        __(mov r,#0)
+local_label(done):   
+        __(mov allocptr,#-8)
+        __(vpop1(rcontext))
+        __(ldr imm2,[rcontext,tcr.flags])
+        __(bic imm2,imm2,#(1<<TCR_FLAG_BIT_ALLOCPTR_FOREIGN))
+        __(str imm2,[rcontext,tcr.flags])
+        __(ldr allocptr,[rcontext,tcr.save_allocptr])
+        __(bx lr)
+popdef(`s')
+popdef(`m')
+popdef(`a')
+popdef(`q')
+popdef(`r')
+local_label(t32):    
+        .byte 0xff,0xfc,0xf8,0xf4,0xf0,0xed,0xea,0xe6
+        .byte 0xe3,0xe0,0xdd,0xda,0xd7,0xd4,0xd2,0xcf
+        .byte 0xcc,0xca,0xc7,0xc5,0xc3,0xc0,0xbe,0xbc
+        .byte 0xba,0xb8,0xb6,0xb4,0xb2,0xb0,0xae,0xac
+        .byte 0xaa,0xa8,0xa7,0xa5,0xa3,0xa2,0xa0,0x9f
+        .byte 0x9d,0x9c,0x9a,0x99,0x97,0x96,0x94,0x93
+        .byte 0x92,0x90,0x8f,0x8e,0x8d,0x8c,0x8a,0x89
+        .byte 0x88,0x87,0x86,0x85,0x84,0x83,0x82,0x81
+
+_spentry(sdiv32)
+        __(build_lisp_frame(imm2))
+pushdef(`sign',`temp0')
+pushdef(`d',`r0')
+pushdef(`r',`r1')                
+        __(ands sign,d,#0x80000000)
+        __(rsbmi d,d,#0)
+        __(eors sign,sign,r,asr #32)
+        __(rsbcs r,r,#0)
+        __(bl _SPudiv32)
+        __(movs sign,sign,lsl #1)
+        __(rsbcs d,d,#0)
+        __(rsbmi r,r,#0)
+        __(return_lisp_frame(imm2))
+popdef(`sign')
+popdef(`d',)
+popdef(`r',)                
+        
+        
+                        
+                        
 
 /*  EOF, basically  */
