Raymond Toy pushed to branch sparc64-dev at cmucl / cmucl

Commits:

4 changed files:

Changes:

  • src/compiler/generic/new-genesis.lisp
    ... ... @@ -2832,9 +2832,20 @@
    2832 2832
     				 funs)))))
    
    2833 2833
     	       *fdefn-objects*)
    
    2834 2834
           (format t "~%~|~%Initially defined functions:~2%")
    
    2835
    -      (dolist (info (sort funs #'< :key #'cdr))
    
    2836
    -	(format t "0x~8,'0X: ~S   #x~8,'0X~%" (cdr info) (car info) 
    
    2837
    -		(- (cdr info) #x17)))
    
    2835
    +      (let ((offset (- (* vm:word-bytes vm:function-code-offset)
    
    2836
    +		       vm:function-pointer-type)))
    
    2837
    +	(dolist (info (sort funs #'< :key #'cdr))
    
    2838
    +	  ;; Note: The cdr is the raw-addr slot of an fdefn.  For
    
    2839
    +	  ;; sparc and ppc, this isn't a raw address---it's a function
    
    2840
    +	  ;; pointer object.  For other architectures, it is the
    
    2841
    +	  ;; raw-addr slot where the code actually starts.  For
    
    2842
    +	  ;; consistency, we'll print out the raw-addr slot on all
    
    2843
    +	  ;; platforms.  However, the last item will be the function
    
    2844
    +	  ;; object pointer for x86 and other archs, but the code
    
    2845
    +	  ;; start for sparc and ppc.
    
    2846
    +	  (format t "0x~12,'0X: ~S   #x~12,'0X~%" (cdr info) (car info)
    
    2847
    +		  #-(or sparc ppc) (- (cdr info) offset)
    
    2848
    +		  #+(or sparc ppc) (+ (cdr info) offset))))
    
    2838 2849
           (format t "~%~|~%Undefined function references:~2%")
    
    2839 2850
           (labels ((key (name)
    
    2840 2851
     		 (etypecase name
    

  • src/compiler/sparc64/insts.lisp
    ... ... @@ -2141,11 +2141,11 @@ about function addresses and register values.")
    2141 2141
     (macrolet ((frob (name inst)
    
    2142 2142
     	     `(define-instruction-macro ,name (dst src1 &optional src2)
    
    2143 2143
     	       `(inst ,',inst ,dst ,src1 ,src2))))
    
    2144
    -  (frob ldn ld)
    
    2145
    -  (frob stn st)
    
    2146
    -  (frob slln sll)
    
    2147
    -  (frob srln srl)
    
    2148
    -  (frob sran sra))
    
    2144
    +  (frob ldn ldx)
    
    2145
    +  (frob stn stx)
    
    2146
    +  (frob slln sllx)
    
    2147
    +  (frob srln srlx)
    
    2148
    +  (frob sran srax))
    
    2149 2149
       
    
    2150 2150
     ;;; Jal to a full 32-bit address.  Tmpreg is trashed.
    
    2151 2151
     (define-instruction jali (segment link tmpreg value)
    

  • src/lisp/Config.sparc64_sunc
    ... ... @@ -26,7 +26,7 @@ AS_V8PLUS = -m64 $(MEM_MODEL)
    26 26
     endif
    
    27 27
     
    
    28 28
     ASSEM_SRC = sparc64-assem.S
    
    29
    -CFLAGS += $(MEM_MODEL) -xlibmieee -g3 -DPRINTNOISE
    
    29
    +CFLAGS += $(MEM_MODEL) -xlibmieee -g -DPRINTNOISE
    
    30 30
     DEPEND_FLAGS = -xM
    
    31 31
     ASFLAGS = $(AS_V8PLUS)
    
    32 32
     OS_LINK_FLAGS = -m64 $(MEM_MODEL) -M /usr/lib/ld/map.noexstk

  • src/lisp/sparc64-assem.S
    ... ... @@ -85,10 +85,10 @@ call_into_lisp:
    85 85
             /* No longer atomic, and check for interrupt. */
    
    86 86
     	andn	reg_ALLOC, pseudo_atomic_Value, reg_ALLOC
    
    87 87
     	andcc	reg_ALLOC, pseudo_atomic_InterruptedValue, reg_ZERO
    
    88
    -	tne	trap_PseudoAtomic
    
    88
    +	tne	%xcc, trap_PseudoAtomic
    
    89 89
     
    
    90 90
             /* Pass in the args. */
    
    91
    -        sll     %i2, 2, reg_NARGS
    
    91
    +        slln    %i2, 2, reg_NARGS
    
    92 92
             mov     %i1, reg_CFP
    
    93 93
     	mov	%i0, reg_LEXENV
    
    94 94
             ldn     [reg_CFP + 0*WORD_BYTES], reg_A0
    
    ... ... @@ -129,12 +129,17 @@ lra:
    129 129
             store(reg_CFP,current_control_frame_pointer)
    
    130 130
     
    
    131 131
             /* No longer in Lisp. */
    
    132
    +#if 0	
    
    132 133
             store(reg_NL1,foreign_function_call_active)
    
    134
    +#else
    
    135
    +	sethi	%hi(foreign_function_call_active), reg_L0
    
    136
    +	st	reg_NL1, [reg_L0 + %lo(foreign_function_call_active)]
    
    137
    +#endif		
    
    133 138
     
    
    134 139
             /* Were we interrupted? */
    
    135 140
     	andn	reg_ALLOC, pseudo_atomic_Value, reg_ALLOC
    
    136 141
     	andcc	reg_ALLOC, pseudo_atomic_InterruptedValue, reg_ZERO
    
    137
    -	tne	trap_PseudoAtomic
    
    142
    +	tne	%xcc, trap_PseudoAtomic
    
    138 143
     
    
    139 144
             /* Back to C we go. */
    
    140 145
     	ld	[%sp + STACK_BIAS +FRAMESIZE-WORD_BYTES], %i7
    
    ... ... @@ -181,12 +186,17 @@ call_into_c:
    181 186
     	load(current_control_frame_pointer, reg_CFP)
    
    182 187
     
    
    183 188
             /* No longer in Lisp. */
    
    189
    +#if 0
    
    184 190
             store(reg_CSP,foreign_function_call_active)
    
    191
    +#else
    
    192
    +	sethi	%hi(foreign_function_call_active), reg_L0
    
    193
    +	st	reg_CSP, [reg_L0 + %lo(foreign_function_call_active)]
    
    194
    +#endif	
    
    185 195
     
    
    186 196
             /* Were we interrupted? */
    
    187 197
     	andn	reg_ALLOC, pseudo_atomic_Value, reg_ALLOC
    
    188 198
     	andcc	reg_ALLOC, pseudo_atomic_InterruptedValue, reg_ZERO
    
    189
    -	tne	trap_PseudoAtomic
    
    199
    +	tne	%xcc, trap_PseudoAtomic
    
    190 200
     
    
    191 201
             /* Into C we go. */
    
    192 202
             call    reg_CFUNC
    
    ... ... @@ -224,7 +234,7 @@ call_into_c:
    224 234
             /* No longer atomic. */
    
    225 235
     	andn	reg_ALLOC, pseudo_atomic_Value, reg_ALLOC
    
    226 236
     	andcc	reg_ALLOC, pseudo_atomic_InterruptedValue, reg_ZERO
    
    227
    -	tne	trap_PseudoAtomic
    
    237
    +	tne	%xcc, trap_PseudoAtomic
    
    228 238
     
    
    229 239
             /* Reset the lisp stack. */
    
    230 240
             /* Note: OCFP is in one of the locals, it gets preserved across C. */