Changeset 8163


Ignore:
Timestamp:
Jan 17, 2008, 2:59:18 PM (12 years ago)
Author:
gb
Message:

RME's fixes memory reference functions that assumed addresses were
fixnum-aligned.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.2/devel/source/level-0/X86/x86-misc.lisp

    r8137 r8163  
    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))
     
    409409
    410410(defx86lapfunction %atomic-incf-ptr ((ptr arg_z))
    411   (macptr-ptr ptr ptr)
    412   @again
    413   (movq (@ (% ptr)) (% rax))
     411  (macptr-ptr ptr imm2)
     412  @again
     413  (movq (@ (% imm2)) (% rax))
    414414  (lea (@ 1 (% rax)) (% imm1))
    415415  (lock)
    416   (cmpxchgq (% imm1) (@ (% ptr)))
     416  (cmpxchgq (% imm1) (@ (% imm2)))
    417417  (jne @again)
    418418  (box-fixnum imm1 arg_z)
     
    420420
    421421(defx86lapfunction %atomic-incf-ptr-by ((ptr arg_y) (by arg_z))
    422   (macptr-ptr ptr ptr)
    423   @again
    424   (movq (@ (% ptr)) (% rax))
     422  (macptr-ptr ptr imm2)
     423  @again
     424  (movq (@ (% imm2)) (% rax))
    425425  (unbox-fixnum by imm1)
    426426  (add (% rax) (% imm1))
    427427  (lock)
    428   (cmpxchgq (% imm1) (@ (% ptr)))
     428  (cmpxchgq (% imm1) (@ (% imm2)))
    429429  (jnz @again)
    430430  (box-fixnum imm1 arg_z)
     
    433433
    434434(defx86lapfunction %atomic-decf-ptr ((ptr arg_z))
    435   (macptr-ptr ptr ptr)
    436   @again
    437   (movq (@ (% ptr)) (% rax))
     435  (macptr-ptr ptr imm2)
     436  @again
     437  (movq (@ (% imm2)) (% rax))
    438438  (lea (@ -1 (% rax)) (% imm1))
    439439  (lock)
    440   (cmpxchgq (% imm1) (@ (% ptr)))
     440  (cmpxchgq (% imm1) (@ (% imm2)))
    441441  (jnz @again)
    442442  (box-fixnum imm1 arg_z)
     
    444444
    445445(defx86lapfunction %atomic-decf-ptr-if-positive ((ptr arg_z))
    446   (macptr-ptr ptr ptr)                  ;must be fixnum-aligned
    447   @again
    448   (movq (@ (% ptr)) (% rax))
     446  (macptr-ptr ptr imm2)
     447  @again
     448  (movq (@ (% imm2)) (% rax))
    449449  (testq (% rax) (% rax))
    450450  (lea (@ -1 (% rax)) (% imm1))
    451451  (jz @done)
    452452  (lock)
    453   (cmpxchgq (% imm1) (@ (% ptr)))
     453  (cmpxchgq (% imm1) (@ (% imm2)))
    454454  (jnz @again)
    455455  @done
     
    469469;;; was equal to OLDVAL.  Return the old value
    470470(defx86lapfunction %ptr-store-conditional ((ptr arg_x) (expected-oldval arg_y) (newval arg_z))
    471   (macptr-ptr ptr ptr)                  ;  must be fixnum-aligned
    472   @again
    473   (movq (@ (% ptr)) (% imm0))
     471  (macptr-ptr ptr imm2)
     472  @again
     473  (movq (@ (% imm2)) (% imm0))
    474474  (box-fixnum imm0 temp0)
    475475  (cmpq (% temp0) (% expected-oldval))
     
    477477  (unbox-fixnum newval imm1)
    478478  (lock)
    479   (cmpxchgq (% imm1) (@ (% ptr)))
     479  (cmpxchgq (% imm1) (@ (% imm2)))
    480480  (jne @again)
    481481  @done
     
    499499(defx86lapfunction xchgl ((newval arg_y) (ptr arg_z))
    500500  (unbox-fixnum newval imm0)
    501   (macptr-ptr ptr arg_y)                ; had better be aligned
     501  (macptr-ptr ptr im1)
    502502  (lock)                                ; implicit ?
    503   (xchgl (% imm0.l) (@ (% arg_y)))
     503  (xchgl (% imm0.l) (@ (% im1)))
    504504  (box-fixnum imm0 arg_z)
    505505  (single-value-return))
Note: See TracChangeset for help on using the changeset viewer.