Changeset 7996


Ignore:
Timestamp:
Jan 4, 2008, 5:48:06 AM (12 years ago)
Author:
rme
Message:

Use imm2 to hold pointers, rather than assuming/hoping that the addresses
will be 64-bit aligned, and hence fixnum-tagged.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/level-0/X86/x86-misc.lisp

    r7343 r7996  
    253253  (trap-unless-typecode= ptr x8664::subtag-macptr)
    254254  (call-subprim .SPgetu64)
    255   (macptr-ptr ptr ptr)
     255  (macptr-ptr ptr imm2)
    256256  (unbox-fixnum offset imm1)
    257   (movq (% imm0) (@ (% ptr) (% imm1)))
     257  (movq (% imm0) (@ (% imm2) (% imm1)))
    258258  (restore-simple-frame)
    259259  (single-value-return))
     
    266266  (trap-unless-typecode= ptr x8664::subtag-macptr)
    267267  (call-subprim .SPgets64)
    268   (macptr-ptr ptr ptr)
     268  (macptr-ptr ptr imm2)
    269269  (unbox-fixnum offset imm1)
    270   (movq (% imm0) (@ (% ptr) (% imm1)))
     270  (movq (% imm0) (@ (% imm2) (% imm1)))
    271271  (restore-simple-frame)
    272272  (single-value-return))
     
    448448
    449449(defx86lapfunction %atomic-incf-ptr ((ptr arg_z))
    450   (macptr-ptr ptr ptr)
    451   @again
    452   (movq (@ (% ptr)) (% rax))
     450  (macptr-ptr ptr imm2)
     451  @again
     452  (movq (@ (% imm2)) (% rax))
    453453  (lea (@ 1 (% rax)) (% imm1))
    454454  (lock)
    455   (cmpxchgq (% imm1) (@ (% ptr)))
     455  (cmpxchgq (% imm1) (@ (% imm2)))
    456456  (jne @again)
    457457  (box-fixnum imm1 arg_z)
     
    459459
    460460(defx86lapfunction %atomic-incf-ptr-by ((ptr arg_y) (by arg_z))
    461   (macptr-ptr ptr ptr)
    462   @again
    463   (movq (@ (% ptr)) (% rax))
     461  (macptr-ptr ptr imm2)
     462  @again
     463  (movq (@ (% imm2)) (% rax))
    464464  (unbox-fixnum by imm1)
    465465  (add (% rax) (% imm1))
    466466  (lock)
    467   (cmpxchgq (% imm1) (@ (% ptr)))
     467  (cmpxchgq (% imm1) (@ (% imm2)))
    468468  (jnz @again)
    469469  (box-fixnum imm1 arg_z)
     
    472472
    473473(defx86lapfunction %atomic-decf-ptr ((ptr arg_z))
    474   (macptr-ptr ptr ptr)
    475   @again
    476   (movq (@ (% ptr)) (% rax))
     474  (macptr-ptr ptr imm2)
     475  @again
     476  (movq (@ (% imm2)) (% rax))
    477477  (lea (@ -1 (% rax)) (% imm1))
    478478  (lock)
    479   (cmpxchgq (% imm1) (@ (% ptr)))
     479  (cmpxchgq (% imm1) (@ (% imm2)))
    480480  (jnz @again)
    481481  (box-fixnum imm1 arg_z)
     
    483483
    484484(defx86lapfunction %atomic-decf-ptr-if-positive ((ptr arg_z))
    485   (macptr-ptr ptr ptr)                  ;must be fixnum-aligned
    486   @again
    487   (movq (@ (% ptr)) (% rax))
     485  (macptr-ptr ptr imm2)
     486  @again
     487  (movq (@ (% imm2)) (% rax))
    488488  (testq (% rax) (% rax))
    489489  (lea (@ -1 (% rax)) (% imm1))
    490490  (jz @done)
    491491  (lock)
    492   (cmpxchgq (% imm1) (@ (% ptr)))
     492  (cmpxchgq (% imm1) (@ (% imm2)))
    493493  (jnz @again)
    494494  @done
     
    508508;;; was equal to OLDVAL.  Return the old value
    509509(defx86lapfunction %ptr-store-conditional ((ptr arg_x) (expected-oldval arg_y) (newval arg_z))
    510   (macptr-ptr ptr ptr)                  ;  must be fixnum-aligned
    511   @again
    512   (movq (@ (% ptr)) (% imm0))
     510  (macptr-ptr ptr imm2)
     511  @again
     512  (movq (@ (% imm2)) (% imm0))
    513513  (box-fixnum imm0 temp0)
    514514  (cmpq (% temp0) (% expected-oldval))
     
    516516  (unbox-fixnum newval imm1)
    517517  (lock)
    518   (cmpxchgq (% imm1) (@ (% ptr)))
     518  (cmpxchgq (% imm1) (@ (% imm2)))
    519519  (jne @again)
    520520  @done
Note: See TracChangeset for help on using the changeset viewer.