Changeset 13927 for branches


Ignore:
Timestamp:
Jul 6, 2010, 4:05:27 PM (9 years ago)
Author:
gb
Message:

arm-bignum.lisp: BIGNUM-ADD-LOOP-+.
arm-utils.lisp: %ALLOCATE-LIST.
arm-misc.lisp, l0-misc.lisp, Makefile: use futexes on ARM Linux.

Location:
branches/arm
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/arm/level-0/ARM/arm-bignum.lisp

    r13913 r13927  
    488488    (bx lr)))
    489489
    490 ;; same as above but with initial a index and finishes
    491 #+notyet
     490;; same as above but with initial a index and finishes, and is actually called.
    492491(defarmlapfunction bignum-add-loop-+ ((init-a 0)(aptr arg_x)(bptr arg_y)(length arg_z))
    493   (let ((idx imm0)       
    494         (count imm1)
    495         (x imm2)
    496         (y imm3)
    497         (aidx imm4))
    498     (li idx arm::misc-data-offset)
    499     (ldr aidx vsp (:$ init-a))
    500     (addi aidx aidx arm::misc-data-offset)
    501     (li count 0)
     492  (let ((count temp0)
     493        (carry temp1)
     494        (x imm0)
     495        (y imm1)
     496        (aidx imm2)
     497        (idx y))
     498    (ldr aidx (:@ vsp (:$ init-a)))
     499    (add aidx aidx (:$ arm::misc-data-offset))
     500    (mov count (:$ 0))
    502501    ; initialize carry 0
    503     (addc x rzero rzero)
     502    (mov carry (:$ 0))
    504503    @loop
    505504    (ldr x (:@ aptr aidx))
     505    (add idx count (:$ arm::misc-data-offset))
    506506    (ldr y (:@ bptr idx))
    507     (adde x x y)
     507    (add x x y)
     508    (adds x x (:asr carry (:$ arm::fixnumshift)))
     509    (movcc carry (:$ 0))
     510    (movcs carry (:$ arm::fixnumone))
    508511    (str x (:@ aptr aidx))
    509     (addi count count '1)
    510     (cmpw count length)
    511     (addi idx idx '1)
    512     (addi aidx aidx '1)
     512    (add count count '1)
     513    (cmp count length)
     514    (add aidx aidx '1)
    513515    (blt @loop)
    514516    (ldr x (:@ aptr aidx))  ; add carry into next one
    515     (adde x x  rzero)
     517    (add x x (:asr carry (:$ arm::fixnumshift)))
    516518    (str x (:@ aptr aidx))
    517519    (add vsp vsp (:$ 4))
  • branches/arm/level-0/ARM/arm-misc.lisp

    r13926 r13927  
    415415  (ba .SPatomic-incf-node))
    416416
    417 #+notyet                                ;needs ARM subprim ?
    418417(defarmlapfunction %atomic-incf-ptr ((ptr arg_z))
    419418  (macptr-ptr imm1 ptr)
    420419  @again
    421   (lrarx imm0 0 imm1)
    422   (addi imm0 imm0 1)
    423   (strcx. imm0 0 imm1)
    424   (bne @again)
    425   (isync)
     420  (ldrex imm0 (:@ imm1))
     421  (add imm0 imm0 (:$ 1))
     422  (strex imm2 imm0 (:@ imm1))
     423  (cmp imm2 (:$ 0))
     424  (bne @again)
    426425  (box-fixnum arg_z imm0)
    427426  (bx lr))
    428427
    429 #+notyet                                ;needs ARM subprim ?
     428
    430429(defarmlapfunction %atomic-incf-ptr-by ((ptr arg_y) (by arg_z))
    431430  (macptr-ptr imm1 ptr)
    432   (unbox-fixnum imm2 by)
    433   @again
    434   (lrarx imm0 0 imm1)
    435   (add imm0 imm0 imm2)
    436   (strcx. imm0 0 imm1)
    437   (bne @again)
    438   (isync)
     431  @again
     432  (ldrex imm0 (:@ imm1))
     433  (add imm0 imm0 (:asr by (:$ arm::fixnumshift)))
     434  (strex imm2 imm0 (:@ imm1))
     435  (bne @again)
    439436  (box-fixnum arg_z imm0)
    440437  (bx lr))
    441438
    442 #+notyet                                ;needs ARM subprim
    443439(defarmlapfunction %atomic-decf-ptr ((ptr arg_z))
    444440  (macptr-ptr imm1 ptr)
    445441  @again
    446   (lrarx imm0 0 imm1)
    447   (subi imm0 imm0 1)
    448   (strcx. imm0 0 imm1)
    449   (bne @again)
    450   (isync)
     442  (ldrex imm0 (:@ imm1))
     443  (sub imm0 imm0 (:$ 1))
     444  (strex imm2 imm0 (:@ imm1))
     445  (cmp imm2 (:$ 0))
     446  (bne @again)
    451447  (box-fixnum arg_z imm0)
    452448  (bx lr))
    453449
    454 #+notyet                                ;Needs ARM subprim ?
    455450(defarmlapfunction %atomic-decf-ptr-if-positive ((ptr arg_z))
    456451  (macptr-ptr imm1 ptr)
    457452  @again
    458   (lrarx imm0 0 imm1)
    459   (cmpri cr1 imm0 0)
    460   (subi imm0 imm0 1)
     453  (ldrex imm0 (:@ imm1))
     454  (cmp imm0 (:$ 0))
     455  (sub imm0 imm0 (:$ 1))
    461456  (beq @done)
    462   (strcx. imm0 0 imm1)
    463   (bne @again)
    464   (isync)
     457  (strex imm2 imm0 (:@ imm1))
     458  (cmp imm2 (:$ 0))
     459  (bne @again)
    465460  (box-fixnum arg_z imm0)
    466461  (bx lr)
    467462  @done
    468   (li imm1 arm::reservation-discharge)
     463  (clrex)
    469464  (box-fixnum arg_z imm0)
    470   (strcx. rzero rzero imm1)
    471   (bx lr))
    472 
    473 #+notyet                                ;guess why not ?
     465  (bx lr))
     466
     467
    474468(defarmlapfunction %atomic-swap-ptr ((ptr arg_y) (newval arg_z))
    475   (sync)
    476469  (macptr-ptr imm1 ptr)
     470  @again
    477471  (unbox-fixnum imm2 arg_z)
    478   @again
    479   (lrarx imm0 0 imm1)
    480   (strcx. imm2 0 imm1)
    481   (bne @again)
    482   (isync)
     472  (ldrex imm0 (:@ imm1))
     473  (strex imm2 imm2 (:@ imm1))
     474  (cmp imm2 (:$ 0))
     475  (bne @again)
    483476  (box-fixnum arg_z imm0)
    484477  (bx lr))
     
    486479;;; Try to store the fixnum NEWVAL at PTR, if and only if the old value
    487480;;; was equal to OLDVAL.  Return the old value
    488 #+notyet                                 ;still
    489481(defarmlapfunction %ptr-store-conditional ((ptr arg_x) (expected-oldval arg_y) (newval arg_z))
    490482  (macptr-ptr imm0 ptr)
    491   (unbox-fixnum imm1 expected-oldval)
     483  @again
     484  (ldrex imm1 (:@ imm0))
     485  (cmp imm1 (:asr expected-oldval (:$ arm::fixnumshift)))
    492486  (unbox-fixnum imm2 newval)
    493   @again
    494   (lrarx imm3 0 imm0)
    495   (cmpr imm3 imm1)
    496   (bne- @done)
    497   (strcx. imm2 0 imm0)
    498   (bne- @again)
    499   (isync)
    500   (box-fixnum arg_z imm3)
     487  (bne @done)
     488  (strex imm2 imm2 (:@ imm0))
     489  (cmp imm2 (:$ 0))
     490  (bne @again)
     491  (box-fixnum arg_z imm1)
    501492  (bx lr)
    502493  @done
    503   (li imm0 arm::reservation-discharge)
    504   (box-fixnum arg_z imm3)
    505   (strcx. rzero 0 imm0)
     494  (clrex)
     495  (box-fixnum arg_z imm1)
    506496  (bx lr))
    507497
  • branches/arm/level-0/ARM/arm-utils.lisp

    r13897 r13927  
    318318  (bx lr))
    319319
     320
     321;;; Make a list.  This can be faster than doing so by doing CONS
     322;;; repeatedly, since the latter strategy might triger the GC several
     323;;; times if N is large.
     324(defarmlapfunction %allocate-list ((initial-element arg_y) (nconses arg_z))
     325  (check-nargs 2)
     326  (build-lisp-frame)
     327  (mov fn nfn)
     328  (uuo-kernel-service (:? al) (:$ arch::error-allocate-list))
     329  (vpush1 arg_z)
     330  (vpush1 arg_y)
     331  (set-nargs 2)
     332  (ba .SPnvalret))
     333
    320334#+notyet                                ;trap encoding
    321335(progn
     
    426440  (error "watching objects not supported on ARM yet"))
    427441
    428 ;;; Make a list.  This can be faster than doing so by doing CONS
    429 ;;; repeatedly, since the latter strategy might triger the GC several
    430 ;;; times if N is large.
    431 (defarmlapfunction %allocate-list ((initial-element arg_y) (nconses arg_z))
    432   (check-nargs 2)
    433   (save-lisp-context)
    434   (uuo_interr arch::error-allocate-list rzero)
    435   (vpush arg_z)
    436   (vpush arg_y)
    437   (set-nargs 2)
    438   (ba .SPnvalret))
     442
    439443 
    440444(defarmlapfunction %ensure-static-conses ()
  • branches/arm/level-0/l0-misc.lisp

    r13892 r13927  
    2020
    2121;;; Bootstrapping for futexes
    22 #+(and linux-target x86-target)
     22#+(and linux-target (or x86-target arm-target))
    2323(eval-when (:compile-toplevel :execute)
    2424  (pushnew :futex *features*))
  • branches/arm/lisp-kernel/linuxarm/Makefile

    r13897 r13927  
    2323ASFLAGS =
    2424M4FLAGS = -DLINUX -DARM
    25 CDEFINES = -DLINUX -DARM -D_REENTRANT -D_GNU_SOURCE -DDISABLE_EGC -DGC_INTEGRITY_CHECKING
     25CDEFINES = -DLINUX -DARM -D_REENTRANT -D_GNU_SOURCE -DDISABLE_EGC -DGC_INTEGRITY_CHECKING -DUSE_FUTEX
    2626CDEBUG = -g
    2727COPT = #-O2
     
    4343
    4444# Likewise, some versions of GAS may need a "-a32" flag, to force the
     45
    4546# output file to be 32-bit compatible.
    4647
Note: See TracChangeset for help on using the changeset viewer.