Changeset 7910


Ignore:
Timestamp:
Dec 14, 2007, 1:53:35 AM (13 years ago)
Author:
rme
Message:

Use defx8632lapfunction. Also duplicate some lisp code from
x8664-array.lisp, which should probably be factored back out.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ia32/level-0/X86/X8632/x8632-array.lisp

    r7349 r7910  
    55  (require "X86-LAPMACROS"))
    66
     7;; rewrite in LAP someday (soon).
     8(defun %init-misc (val uvector)
     9  (dotimes (i (uvsize uvector) uvector)
     10    (setf (uvref uvector i) val)))
     11
     12;;; Make a new vector of size newsize whose subtag matches that of oldv-arg.
     13;;; Blast the contents of the old vector into the new one as quickly as
     14;;; possible; leave remaining elements of new vector undefined (0).
     15;;; Return new-vector.
     16(defun %extend-vector (start oldv newsize)
     17  (declare (fixnum start))
     18  (let* ((new (%alloc-misc newsize (typecode oldv)))
     19         (oldsize (uvsize oldv)))
     20    (declare (fixnum oldsize))
     21    (do* ((i 0 (1+ i))
     22          (j start (1+ j)))
     23         ((= i oldsize) new)
     24      (declare (fixnum i j))
     25      (setf (uvref new j) (uvref oldv i)))))
     26   
    727;;; argument is a vector header or an array header.  Or else.
    8 (defx86lapfunction %array-header-data-and-offset ((a arg_z))
     28(defx8632lapfunction %array-header-data-and-offset ((a arg_z))
    929  (let ((offset arg_y)
    1030        (temp temp1))
     
    2444    (jmp-subprim  .SPvalues)))
    2545
    26 (defx86lapfunction %boole-clr ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
     46(defx8632lapfunction %boole-clr ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
    2747  (movl (@ idx (% esp)) (% temp0))
    2848  (movl ($ 0) (@ x8632::misc-data-offset (% dest) (% temp0)))
    2949  (single-value-return 4))
    3050
    31 (defx86lapfunction %boole-set ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
     51(defx8632lapfunction %boole-set ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
    3252  (movl (@ idx (% esp)) (% temp0))
    3353  (movl ($ -1) (@ x8632::misc-data-offset (% dest) (% temp0)))
    3454  (single-value-return 4))
    3555
    36 (defx86lapfunction %boole-1 ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
    37   (movl (@ idx (% esp)) (% temp0))
    38   (movl (@ b0 (% esp)) (% temp1))
    39   (movl (@ x8632::misc-data-offset (% temp1) (% temp0)) (% imm0))
    40   (movl (% imm0) (@ x8632::misc-data-offset (% dest) (% temp0)))
    41   (single-value-return 4))
    42 
    43 (defx86lapfunction %boole-2 ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
    44   (movl (@ idx (% esp)) (% temp0))
    45   (movl (@ x8632::misc-data-offset (% b1) (% temp0)) (% imm0))
    46   (movl (% imm0) (@ x8632::misc-data-offset (% dest) (% temp0)))
    47   (single-value-return 4))
    48 
    49 (defx86lapfunction %boole-c1 ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
    50   (movl (@ idx (% esp)) (% temp0))
    51   (movl (@ b0 (% esp)) (% temp1))
    52   (movl (@ x8632::misc-data-offset (% temp1) (% temp0)) (% imm0))
    53   (notl (% imm0))
    54   (movl (% imm0) (@ x8632::misc-data-offset (% dest) (% temp0)))
    55   (single-value-return 4))
    56 
    57 (defx86lapfunction %boole-c2 ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
    58   (movl (@ idx (% esp)) (% temp0))
    59   (movl (@ x8632::misc-data-offset (% b1) (% temp0)) (% imm0))
    60   (notl (% imm0))
    61   (movl (% imm0) (@ x8632::misc-data-offset (% dest) (% temp0)))
    62   (single-value-return 4))
    63 
    64 (defx86lapfunction %boole-and ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
     56(defx8632lapfunction %boole-1 ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
     57  (movl (@ idx (% esp)) (% temp0))
     58  (movl (@ b0 (% esp)) (% temp1))
     59  (movl (@ x8632::misc-data-offset (% temp1) (% temp0)) (% imm0))
     60  (movl (% imm0) (@ x8632::misc-data-offset (% dest) (% temp0)))
     61  (single-value-return 4))
     62
     63(defx8632lapfunction %boole-2 ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
     64  (movl (@ idx (% esp)) (% temp0))
     65  (movl (@ x8632::misc-data-offset (% b1) (% temp0)) (% imm0))
     66  (movl (% imm0) (@ x8632::misc-data-offset (% dest) (% temp0)))
     67  (single-value-return 4))
     68
     69(defx8632lapfunction %boole-c1 ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
     70  (movl (@ idx (% esp)) (% temp0))
     71  (movl (@ b0 (% esp)) (% temp1))
     72  (movl (@ x8632::misc-data-offset (% temp1) (% temp0)) (% imm0))
     73  (notl (% imm0))
     74  (movl (% imm0) (@ x8632::misc-data-offset (% dest) (% temp0)))
     75  (single-value-return 4))
     76
     77(defx8632lapfunction %boole-c2 ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
     78  (movl (@ idx (% esp)) (% temp0))
     79  (movl (@ x8632::misc-data-offset (% b1) (% temp0)) (% imm0))
     80  (notl (% imm0))
     81  (movl (% imm0) (@ x8632::misc-data-offset (% dest) (% temp0)))
     82  (single-value-return 4))
     83
     84(defx8632lapfunction %boole-and ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
    6585  (movl (@ idx (% esp)) (% temp0))
    6686  (movl (@ b0 (% esp)) (% temp1))
     
    7090  (single-value-return 4))
    7191
    72 (defx86lapfunction %boole-ior ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
     92(defx8632lapfunction %boole-ior ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
    7393  (movl (@ idx (% esp)) (% temp0))
    7494  (movl (@ b0 (% esp)) (% temp1))
     
    7898  (single-value-return 4))
    7999
    80 (defx86lapfunction %boole-xor ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
     100(defx8632lapfunction %boole-xor ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
    81101  (movl (@ idx (% esp)) (% temp0))
    82102  (movl (@ b0 (% esp)) (% temp1))
     
    86106  (single-value-return 4))
    87107
    88 (defx86lapfunction %boole-eqv ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
     108(defx8632lapfunction %boole-eqv ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
    89109  (movl (@ idx (% esp)) (% temp0))
    90110  (movl (@ b0 (% esp)) (% temp1))
     
    95115  (single-value-return 4))
    96116
    97 (defx86lapfunction %boole-nand ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
     117(defx8632lapfunction %boole-nand ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
    98118  (movl (@ idx (% esp)) (% temp0))
    99119  (movl (@ b0 (% esp)) (% temp1))
     
    104124  (single-value-return 4))
    105125
    106 (defx86lapfunction %boole-nor ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
     126(defx8632lapfunction %boole-nor ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
    107127  (movl (@ idx (% esp)) (% temp0))
    108128  (movl (@ b0 (% esp)) (% temp1))
     
    113133  (single-value-return 4))
    114134
    115 (defx86lapfunction %boole-andc1 ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
     135(defx8632lapfunction %boole-andc1 ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
    116136  (movl (@ idx (% esp)) (% temp0))
    117137  (movl (@ b0 (% esp)) (% temp1))
     
    122142  (single-value-return 4))
    123143
    124 (defx86lapfunction %boole-andc2 ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
     144(defx8632lapfunction %boole-andc2 ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
    125145  (movl (@ idx (% esp)) (% temp0))
    126146  (movl (@ b0 (% esp)) (% temp1))
     
    131151  (single-value-return 4))
    132152
    133 (defx86lapfunction %boole-orc1 ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
     153(defx8632lapfunction %boole-orc1 ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
    134154  (movl (@ idx (% esp)) (% temp0))
    135155  (movl (@ b0 (% esp)) (% temp1))
     
    140160  (single-value-return 4))
    141161
    142 (defx86lapfunction %boole-orc2 ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
     162(defx8632lapfunction %boole-orc2 ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
    143163  (movl (@ idx (% esp)) (% temp0))
    144164  (movl (@ b0 (% esp)) (% temp1))
     
    148168  (movl (% imm0) (@ x8632::misc-data-offset (% dest) (% temp0)))
    149169  (single-value-return 4))
     170
     171(defparameter *simple-bit-boole-functions* ())
     172
     173(setq *simple-bit-boole-functions*
     174      (vector
     175       #'%boole-clr
     176       #'%boole-set
     177       #'%boole-1
     178       #'%boole-2
     179       #'%boole-c1
     180       #'%boole-c2
     181       #'%boole-and
     182       #'%boole-ior
     183       #'%boole-xor
     184       #'%boole-eqv
     185       #'%boole-nand
     186       #'%boole-nor
     187       #'%boole-andc1
     188       #'%boole-andc2
     189       #'%boole-orc1
     190       #'%boole-orc2))
     191
     192(defun %simple-bit-boole (op b1 b2 result)
     193  (let* ((f (svref *simple-bit-boole-functions* op)))
     194    (dotimes (i (ash (the fixnum (+ (length result) 31)) -5) result)
     195      (funcall f i b1 b2 result))))
    150196
    151197;;; placeholders for future specialized versions
Note: See TracChangeset for help on using the changeset viewer.