Index: /trunk/ccl/lisp-kernel/x86-spentry64.s
===================================================================
--- /trunk/ccl/lisp-kernel/x86-spentry64.s	(revision 5456)
+++ /trunk/ccl/lisp-kernel/x86-spentry64.s	(revision 5457)
@@ -4324,4 +4324,75 @@
 _endsubp(callback)
 
+/* arg_x = array, arg_y = i, arg_z = j. Typecheck everything.
+   We don't know whether the array is alleged to be simple or
+   not, and don't know anythng about the element type.  */
+        	
+_spentry(aref2)
+        __(testb $fixnummask,%arg_y_b)
+        __(je,pt 0f)
+        __(uuo_error_reg_not_fixnum(Rarg_y))
+0:      __(testb $fixnummask,%arg_z_b)
+        __(je,pt 1f)
+        __(uuo_error_reg_not_fixnum(Rarg_z))
+1:      __(extract_typecode(%arg_x,%imm0))
+        __(cmpb $subtag_arrayH,%imm0_b)
+        __(jne 2f)
+        __(cmpq $2<<fixnumshift,arrayH.rank(%arg_x))
+        __(je,pt 3f)
+2:      __(uuo_error_reg_not_type(Rarg_x,error_object_not_array_2d))
+3:      __(cmpq arrayH.dim0(%arg_x),%arg_y)
+        __(jb,pt 4f)
+        __(uuo_error_array_bounds(Rarg_y,Rarg_x))
+4:      __(movq arrayH.dim0+node_size(%arg_x),%imm0)
+        __(cmpq %imm0,%arg_z)
+        __(jb,pt 5f)
+        __(uuo_error_array_bounds(Rarg_z,Rarg_x))
+5:      __(unbox_fixnum(%imm0,%imm0))
+        __(mulq %arg_y)         /* imm0 <- imm0 * arg_y */
+        __(addq %imm0,%arg_z)
+        __(movq %arg_x,%arg_y)
+6:      __(movq arrayH.data_vector(%arg_y),%arg_y)
+        __(extract_subtag(%arg_y,%imm1_b))
+        __(cmpb $subtag_vectorH,%imm1_b)
+        __(ja C(misc_ref_common))
+        __(addq arrayH.displacement(%arg_x),%arg_z)
+        __(movq %arg_y,%arg_x)
+        __(jmp 6b)
+_endsubp(aref2)
+
+/* As with aref2, but temp0 = array, arg_x = i, arg_y = j, arg_z = new_value */
+_spentry(aset2)
+        __(testb $fixnummask,%arg_x_b)
+        __(je,pt 0f)
+        __(uuo_error_reg_not_fixnum(Rarg_x))
+0:      __(testb $fixnummask,%arg_y_b)
+        __(je,pt 1f)
+        __(uuo_error_reg_not_fixnum(Rarg_y))
+1:      __(extract_typecode(%temp0,%imm0))
+        __(cmpb $subtag_arrayH,%imm0_b)
+        __(jne 2f)
+        __(cmpq $2<<fixnumshift,arrayH.rank(%temp0))
+        __(je,pt 3f)
+2:      __(uuo_error_reg_not_type(Rtemp0,error_object_not_array_2d))
+3:      __(cmpq arrayH.dim0(%temp0),%arg_x)
+        __(jb,pt 4f)
+        __(uuo_error_array_bounds(Rarg_x,Rtemp0))
+4:      __(movq arrayH.dim0+node_size(%arg_x),%imm0)
+        __(cmpq %imm0,%arg_y)
+        __(jb,pt 5f)
+        __(uuo_error_array_bounds(Rarg_y,Rtemp0))
+5:      __(unbox_fixnum(%imm0,%imm0))
+        __(mulq %arg_x)         /* imm0 <- imm0 * arg_x */
+        __(addq %imm0,%arg_y)
+        __(movq %temp0,%arg_x)
+6:      __(movq arrayH.data_vector(%arg_x),%arg_x)
+        __(extract_subtag(%arg_x,%imm1_b))
+        __(cmpb $subtag_vectorH,%imm1_b)
+        __(ja C(misc_set_common))
+        __(addq arrayH.displacement(%temp0),%arg_y)
+        __(movq %arg_x,%temp0)
+        __(jmp 6b)
+_endsubp(aset2)
+        
 _spentry(poweropen_callbackX)
 _endsubp(poweropen_callbackX)
@@ -4392,10 +4463,5 @@
 _spentry(breakpoint)
 _endsubp(breakpoint)
-	
-_spentry(unused_0)
-_endsubp(unused_0)
-
-_spentry(unused_1)
-_endsubp(unused_1)
+
 		
 _spentry(unused_2)
Index: /trunk/ccl/lisp-kernel/x86-spjump64.s
===================================================================
--- /trunk/ccl/lisp-kernel/x86-spjump64.s	(revision 5456)
+++ /trunk/ccl/lisp-kernel/x86-spjump64.s	(revision 5457)
@@ -65,5 +65,5 @@
         _spjump(keyword_bind)
         _spjump(ffcall)
-        _spjump(unused_0)
+        _spjump(aref2)
         _spjump(ksignalerr)
         _spjump(stack_rest_arg)
@@ -112,5 +112,5 @@
         _spjump(stack_misc_alloc_init)
         _spjump(set_hash_key)
-        _spjump(unused_1)
+        _spjump(aset2)
         _spjump(callbuiltin)
         _spjump(callbuiltin0)
