Index: /trunk/ccl/lisp-kernel/x86-spentry64.s
===================================================================
--- /trunk/ccl/lisp-kernel/x86-spentry64.s	(revision 5508)
+++ /trunk/ccl/lisp-kernel/x86-spentry64.s	(revision 5509)
@@ -4360,4 +4360,48 @@
 _endsubp(aref2)
 
+/* %temp0 = array, %arg_x = i,%arg_y = j, %arg_z = k */
+_spentry(aref3)
+        __(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:      __(testb $fixnummask,%arg_z_b)
+        __(je,pt 2f)
+        __(uuo_error_reg_not_fixnum(Rarg_z))
+2:      __(extract_typecode(%temp0,%imm0))
+        __(cmpb $subtag_arrayH,%imm0_b)
+        __(jne 3f)
+        __(cmpq $3<<fixnumshift,arrayH.rank(%temp0))
+        __(je,pt 4f)
+3:      __(uuo_error_reg_not_type(Rtemp0,error_object_not_array_3d))
+4:      __(cmpq arrayH.dim0(%temp0),%arg_x)
+        __(jb,pt 5f)
+        __(uuo_error_array_bounds(Rarg_x,Rtemp0))
+5:      __(movq arrayH.dim0+node_size(%temp0),%imm0)
+        __(cmpq %imm0,%arg_y)
+        __(jb,pt 6f)
+        __(uuo_error_array_bounds(Rarg_y,Rtemp0))
+6:      __(unbox_fixnum(%imm0,%imm0))
+        __(movq arrayH.dim0+(node_size*2)(%temp0),%imm1)
+        __(cmpq %imm1,%arg_z)
+        __(jb,pt 7f)
+        __(uuo_error_array_bounds(Rarg_z,Rtemp0))
+7:      __(unbox_fixnum(%imm1,%imm1))
+        __(imulq %imm1,%arg_y)
+        __(mulq %imm1)
+        __(imulq %imm0,%arg_x)
+        __(addq %arg_x,%arg_z)
+        __(addq %arg_y,%arg_z)
+        __(movq %temp0,%arg_y)
+8:      __(addq arrayH.displacement(%arg_y),%arg_z)
+        __(movq arrayH.data_vector(%arg_y),%arg_y)
+        __(extract_subtag(%arg_y,%imm1_b))
+        __(cmpb $subtag_vectorH,%imm1_b)
+        __(ja C(misc_ref_common))
+        __(jmp 8b)
+_endsubp(aref3)
+        
 /* As with aref2, but temp0 = array, arg_x = i, arg_y = j, arg_z = new_value */
 _spentry(aset2)
@@ -4392,4 +4436,50 @@
         __(jmp 6b)
 _endsubp(aset2)
+
+/% temp1 = array, %temp0 = i, %arg_x = j, %arg_y = k, %arg_y = newval. */
+
+_spentry(aset3)
+        __(testb $fixnummask,%temp0_b)
+        __(je,pt 0f)
+        __(uuo_error_reg_not_fixnum(Rtemp0))
+0:      __(testb $fixnummask,%arg_x_b)
+        __(je,pt 1f)
+        __(uuo_error_reg_not_fixnum(Rarg_x))
+1:      __(testb $fixnummask,%arg_y_b)
+        __(je,pt 2f)
+        __(uuo_error_reg_not_fixnum(Rarg_y))
+2:      __(extract_typecode(%temp1,%imm0))
+        __(cmpb $subtag_arrayH,%imm0_b)
+        __(jne 3f)
+        __(cmpq $3<<fixnumshift,arrayH.rank(%temp1))
+        __(je,pt 4f)
+3:      __(uuo_error_reg_not_type(Rtemp1,error_object_not_array_3d))
+4:      __(cmpq arrayH.dim0(%temp1),%temp0)
+        __(jb,pt 5f)
+        __(uuo_error_array_bounds(Rtemp0,Rtemp1))
+5:      __(movq arrayH.dim0+node_size(%temp1),%imm0)
+        __(cmpq %imm0,%arg_x)
+        __(jb,pt 6f)
+        __(uuo_error_array_bounds(Rarg_x,Rtemp1))
+6:      __(unbox_fixnum(%imm0,%imm0))
+        __(movq arrayH.dim0+(node_size*2)(%temp1),%imm1)
+        __(cmpq %imm1,%arg_y)
+        __(jb,pt 7f)
+        __(uuo_error_array_bounds(Rarg_y,Rtemp1))
+7:      __(unbox_fixnum(%imm1,%imm1))
+        __(imulq %imm1,%arg_x)
+        __(mulq %imm1)
+        __(imulq %imm0,%temp0)
+        __(addq %temp0,%arg_y)
+        __(addq %arg_x,%arg_y)
+        __(movq %temp1,%arg_x)
+8:      __(addq arrayH.displacement(%arg_x),%arg_y)
+        __(movq arrayH.data_vector(%arg_x),%arg_x)
+        __(extract_subtag(%arg_x,%imm1_b))
+        __(cmpb $subtag_vectorH,%imm1_b)
+        __(ja C(misc_set_common))
+        __(jmp 8b)
+_endsubp(aset3)
+        
         
 _spentry(poweropen_callbackX)
@@ -4463,9 +4553,5 @@
 
 		
-_spentry(unused_2)
-_endsubp(unused_2)
-
-_spentry(unused_3)
-_endsubp(unused_3)
+
 
 _spentry(unused_4)
Index: /trunk/ccl/lisp-kernel/x86-spjump64.s
===================================================================
--- /trunk/ccl/lisp-kernel/x86-spjump64.s	(revision 5508)
+++ /trunk/ccl/lisp-kernel/x86-spjump64.s	(revision 5509)
@@ -166,6 +166,6 @@
         _spjump(fix_overflow)
         _spjump(mvpasssym)
-        _spjump(unused_2)
-        _spjump(unused_3)
+        _spjump(aref3)
+        _spjump(aset3)
         _spjump(unused_4)
         _spjump(unused_5)
