From: Alastair Bridgewater Date: Sun, 5 Sep 2010 17:01:01 +0000 (+0000) Subject: 1.0.42.33: ppc: Improve pseudo-atomic implementation X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=b119de9cf02b07c8af6e74b6e0bc6860a38c93d8;p=sbcl.git 1.0.42.33: ppc: Improve pseudo-atomic implementation * The runtime (ppc-assem.S) used a shorter, more concise sequence of instructions for testing pseudo-atomic than the compiler (ppc/macros.lisp) did. Altered the compiler to use the same sequence as the runtime. * Both the compiler and the runtime used magic numbers in the pseudo-atomic sequence instead of using named constants. Fixed, using the existing named constants. --- diff --git a/src/compiler/ppc/macros.lisp b/src/compiler/ppc/macros.lisp index c52d4d5..c84757d 100644 --- a/src/compiler/ppc/macros.lisp +++ b/src/compiler/ppc/macros.lisp @@ -341,19 +341,18 @@ ;; Extra debugging stuff: #+debug (progn - (inst andi. ,flag-tn alloc-tn 7) + (inst andi. ,flag-tn alloc-tn lowtag-mask) (inst twi :ne ,flag-tn 0)) - (inst ori alloc-tn alloc-tn 4)) + (inst ori alloc-tn alloc-tn pseudo-atomic-flag)) ,@forms (without-scheduling () - (inst li ,flag-tn -5) - (inst and alloc-tn alloc-tn ,flag-tn) + (inst subi alloc-tn alloc-tn pseudo-atomic-flag) ;; Now test to see if the pseudo-atomic interrupted bit is set. - (inst andi. ,flag-tn alloc-tn 1) + (inst andi. ,flag-tn alloc-tn pseudo-atomic-interrupted-flag) (inst twi :ne ,flag-tn 0)) #+debug (progn - (inst andi. ,flag-tn alloc-tn 7) + (inst andi. ,flag-tn alloc-tn lowtag-mask) (inst twi :ne ,flag-tn 0)))) (def!macro with-pinned-objects ((&rest objects) &body body) diff --git a/src/runtime/ppc-assem.S b/src/runtime/ppc-assem.S index 5ecd384..a8a165c 100644 --- a/src/runtime/ppc-assem.S +++ b/src/runtime/ppc-assem.S @@ -344,7 +344,7 @@ x: #endif /* Turn on pseudo-atomic */ - li reg_ALLOC,4 + li reg_ALLOC,flag_PseudoAtomic #if defined(LISP_FEATURE_SB_THREAD) stw reg_ZERO,THREAD_FOREIGN_FUNCTION_CALL_ACTIVE_OFFSET(reg_THREAD) lwz reg_BSP,THREAD_BINDING_STACK_POINTER_OFFSET(reg_THREAD) @@ -364,8 +364,8 @@ x: add reg_ALLOC,reg_ALLOC,reg_NL4 /* No longer atomic, and check for interrupt */ - subi reg_ALLOC,reg_ALLOC,4 - andi. reg_NL3, reg_ALLOC, 1 + subi reg_ALLOC,reg_ALLOC,flag_PseudoAtomic + andi. reg_NL3, reg_ALLOC, flag_PseudoAtomicInterrupted twnei reg_NL3, 0 /* Pass in the arguments */ @@ -407,7 +407,7 @@ lra: mr REG(3),reg_A0 /* Turn on pseudo-atomic */ - la reg_ALLOC,4(reg_ALLOC) + la reg_ALLOC,flag_PseudoAtomic(reg_ALLOC) #if defined(LISP_FEATURE_SB_THREAD) /* Store lisp state */ @@ -433,8 +433,8 @@ lra: #endif /* Check for interrupt */ - subi reg_ALLOC, reg_ALLOC, 4 - andi. reg_NL3, reg_ALLOC, 1 + subi reg_ALLOC, reg_ALLOC, flag_PseudoAtomic + andi. reg_NL3, reg_ALLOC, flag_PseudoAtomicInterrupted twnei reg_NL3,0 /* Back to C */ @@ -465,7 +465,7 @@ lra: mr reg_NARGS,reg_NL3 /* Turn on pseudo-atomic */ - la reg_ALLOC,4(reg_ALLOC) + la reg_ALLOC,flag_PseudoAtomic(reg_ALLOC) /* Convert the return address to an offset and save it on the stack. */ sub reg_NFP,reg_LIP,reg_CODE @@ -495,8 +495,8 @@ lra: #endif /* load(reg_POLL,saver2) */ /* Disable pseudo-atomic; check pending interrupt */ - subi reg_ALLOC, reg_ALLOC, 4 - andi. reg_NL3, reg_ALLOC, 1 + subi reg_ALLOC, reg_ALLOC, flag_PseudoAtomic + andi. reg_NL3, reg_ALLOC, flag_PseudoAtomicInterrupted twnei reg_NL3, 0 mr reg_NL3,reg_NARGS @@ -542,8 +542,7 @@ lra: li reg_LIP,0 /* Atomic ... */ - li reg_NL3,-4 - li reg_ALLOC,4 + li reg_ALLOC,flag_PseudoAtomic #if defined(LISP_FEATURE_SB_THREAD) /* No longer in foreign function call. */ @@ -578,8 +577,8 @@ lra: la reg_LIP,-OTHER_POINTER_LOWTAG(reg_LIP) /* No longer atomic */ - subi reg_ALLOC, reg_ALLOC, 4 - andi. reg_NL3, reg_ALLOC, 1 + subi reg_ALLOC, reg_ALLOC, flag_PseudoAtomic + andi. reg_NL3, reg_ALLOC, flag_PseudoAtomicInterrupted twnei reg_NL3, 0 mtlr reg_LIP diff --git a/version.lisp-expr b/version.lisp-expr index 110b44e..99b1066 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"1.0.42.32" +"1.0.42.33"