Changeset 13412


Ignore:
Timestamp:
Jan 28, 2010, 4:07:05 AM (10 years ago)
Author:
gb
Message:

%SIMPLE-BIT-BOOLE passes the length (in 32-bit words) to the LAP
primitives; the primitives do the loop themselves. (Still done
32 bits at a time; could maybe use MMX here, if the assembler supports
the needed instructions. Hard to use aligned SSE2 references.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-0/X86/X8632/x8632-array.lisp

    r13067 r13412  
    5858    (jmp-subprim  .SPvalues)))
    5959
    60 (defx8632lapfunction %boole-clr ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
    61   (movl (@ idx (% esp)) (% temp0))
     60(defx8632lapfunction %boole-clr ((len 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
     61  (movl (@ len (% esp)) (% temp0))
     62  (jmp @test)
     63  @loop
    6264  (movl ($ 0) (@ x8632::misc-data-offset (% dest) (% temp0)))
    63   (single-value-return 4))
    64 
    65 (defx8632lapfunction %boole-set ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
    66   (movl (@ idx (% esp)) (% temp0))
     65  @test
     66  (subl ($ '1) (% temp0))
     67  (jge @loop)
     68  (single-value-return 4))
     69
     70(defx8632lapfunction %boole-set ((len 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
     71  (movl (@ len (% esp)) (% temp0))
     72  (jmp @test)
     73  @loop
    6774  (movl ($ -1) (@ x8632::misc-data-offset (% dest) (% temp0)))
    68   (single-value-return 4))
    69 
    70 (defx8632lapfunction %boole-1 ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
    71   (movl (@ idx (% esp)) (% temp0))
    72   (movl (@ b0 (% esp)) (% temp1))
    73   (movl (@ x8632::misc-data-offset (% temp1) (% temp0)) (% imm0))
    74   (movl (% imm0) (@ x8632::misc-data-offset (% dest) (% temp0)))
    75   (single-value-return 4))
    76 
    77 (defx8632lapfunction %boole-2 ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
    78   (movl (@ idx (% esp)) (% temp0))
     75  @test
     76  (subl ($ '1) (% temp0))
     77  (jge @loop)
     78  (single-value-return 4))
     79
     80(defx8632lapfunction %boole-1 ((len 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
     81  (movl (@ len (% esp)) (% temp0))
     82  (jmp @test)
     83  @loop
     84  (movl (@ b0 (% esp)) (% temp1))
     85  (movl (@ x8632::misc-data-offset (% temp1) (% temp0)) (% imm0))
     86  (movl (% imm0) (@ x8632::misc-data-offset (% dest) (% temp0)))
     87  @test
     88  (subl ($ '1) (% temp0))
     89  (jge @loop)
     90  (single-value-return 4))
     91
     92(defx8632lapfunction %boole-2 ((len 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
     93  (movl (@ len (% esp)) (% temp0))
     94  (jmp @test)
     95  @loop
    7996  (movl (@ x8632::misc-data-offset (% b1) (% temp0)) (% imm0))
    8097  (movl (% imm0) (@ x8632::misc-data-offset (% dest) (% temp0)))
    81   (single-value-return 4))
    82 
    83 (defx8632lapfunction %boole-c1 ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
    84   (movl (@ idx (% esp)) (% temp0))
    85   (movl (@ b0 (% esp)) (% temp1))
    86   (movl (@ x8632::misc-data-offset (% temp1) (% temp0)) (% imm0))
    87   (notl (% imm0))
    88   (movl (% imm0) (@ x8632::misc-data-offset (% dest) (% temp0)))
    89   (single-value-return 4))
    90 
    91 (defx8632lapfunction %boole-c2 ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
    92   (movl (@ idx (% esp)) (% temp0))
     98  @test
     99  (subl ($ '1) (% temp0))
     100  (jge @loop)
     101  (single-value-return 4))
     102
     103(defx8632lapfunction %boole-c1 ((len 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
     104  (movl (@ len (% esp)) (% temp0))
     105  (jmp @test)
     106  @loop
     107  (movl (@ b0 (% esp)) (% temp1))
     108  (movl (@ x8632::misc-data-offset (% temp1) (% temp0)) (% imm0))
     109  (notl (% imm0))
     110  (movl (% imm0) (@ x8632::misc-data-offset (% dest) (% temp0)))
     111  @test
     112  (subl ($ '1) (% temp0))
     113  (jge @loop)
     114  (single-value-return 4))
     115
     116(defx8632lapfunction %boole-c2 ((len 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
     117  (movl (@ len (% esp)) (% temp0))
     118  (jmp @test)
     119  @loop
    93120  (movl (@ x8632::misc-data-offset (% b1) (% temp0)) (% imm0))
    94121  (notl (% imm0))
    95122  (movl (% imm0) (@ x8632::misc-data-offset (% dest) (% temp0)))
    96   (single-value-return 4))
    97 
    98 (defx8632lapfunction %boole-and ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
    99   (movl (@ idx (% esp)) (% temp0))
     123  @test
     124  (subl ($ '1) (% temp0))
     125  (jge @loop)
     126  (single-value-return 4))
     127
     128(defx8632lapfunction %boole-and ((len 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
     129  (movl (@ len (% esp)) (% temp0))
     130  (jmp @test)
     131  @loop
    100132  (movl (@ b0 (% esp)) (% temp1))
    101133  (movl (@ x8632::misc-data-offset (% temp1) (% temp0)) (% imm0))
    102134  (andl (@ x8632::misc-data-offset (% b1) (% temp0)) (% imm0))
    103135  (movl (% imm0) (@ x8632::misc-data-offset (% dest) (% temp0)))
    104   (single-value-return 4))
    105 
    106 (defx8632lapfunction %boole-ior ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
    107   (movl (@ idx (% esp)) (% temp0))
     136  @test
     137  (subl ($ '1) (% temp0))
     138  (jge @loop)
     139  (single-value-return 4))
     140
     141(defx8632lapfunction %boole-ior ((len 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
     142  (movl (@ len (% esp)) (% temp0))
     143  (jmp @test)
     144  @loop
    108145  (movl (@ b0 (% esp)) (% temp1))
    109146  (movl (@ x8632::misc-data-offset (% temp1) (% temp0)) (% imm0))
    110147  (orl (@ x8632::misc-data-offset (% b1) (% temp0)) (% imm0))
    111148  (movl (% imm0) (@ x8632::misc-data-offset (% dest) (% temp0)))
    112   (single-value-return 4))
    113 
    114 (defx8632lapfunction %boole-xor ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
    115   (movl (@ idx (% esp)) (% temp0))
     149  @test
     150  (subl ($ '1) (% temp0))
     151  (jge @loop)
     152  (single-value-return 4))
     153
     154(defx8632lapfunction %boole-xor ((len 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
     155  (movl (@ len (% esp)) (% temp0))
     156  (jmp @test)
     157  @loop
    116158  (movl (@ b0 (% esp)) (% temp1))
    117159  (movl (@ x8632::misc-data-offset (% temp1) (% temp0)) (% imm0))
    118160  (xorl (@ x8632::misc-data-offset (% b1) (% temp0)) (% imm0))
    119161  (movl (% imm0) (@ x8632::misc-data-offset (% dest) (% temp0)))
    120   (single-value-return 4))
    121 
    122 (defx8632lapfunction %boole-eqv ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
    123   (movl (@ idx (% esp)) (% temp0))
     162  @test
     163  (subl ($ '1) (% temp0))
     164  (jge @loop)
     165  (single-value-return 4))
     166
     167(defx8632lapfunction %boole-eqv ((len 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
     168  (movl (@ len (% esp)) (% temp0))
     169  (jmp @test)
     170  @loop
    124171  (movl (@ b0 (% esp)) (% temp1))
    125172  (movl (@ x8632::misc-data-offset (% temp1) (% temp0)) (% imm0))
     
    127174  (notl (% imm0))
    128175  (movl (% imm0) (@ x8632::misc-data-offset (% dest) (% temp0)))
    129   (single-value-return 4))
    130 
    131 (defx8632lapfunction %boole-nand ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
    132   (movl (@ idx (% esp)) (% temp0))
     176  @test
     177  (subl ($ '1) (% temp0))
     178  (jge @loop)
     179  (single-value-return 4))
     180
     181(defx8632lapfunction %boole-nand ((len 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
     182  (movl (@ len (% esp)) (% temp0))
     183  (jmp @test)
     184  @loop
    133185  (movl (@ b0 (% esp)) (% temp1))
    134186  (movl (@ x8632::misc-data-offset (% temp1) (% temp0)) (% imm0))
     
    136188  (notl (% imm0))
    137189  (movl (% imm0) (@ x8632::misc-data-offset (% dest) (% temp0)))
    138   (single-value-return 4))
    139 
    140 (defx8632lapfunction %boole-nor ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
    141   (movl (@ idx (% esp)) (% temp0))
     190  @test
     191  (subl ($ '1) (% temp0))
     192  (jge @loop)
     193  (single-value-return 4))
     194
     195(defx8632lapfunction %boole-nor ((len 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
     196  (movl (@ len (% esp)) (% temp0))
     197  (jmp @test)
     198  @loop
    142199  (movl (@ b0 (% esp)) (% temp1))
    143200  (movl (@ x8632::misc-data-offset (% temp1) (% temp0)) (% imm0))
     
    145202  (notl (% imm0))
    146203  (movl (% imm0) (@ x8632::misc-data-offset (% dest) (% temp0)))
    147   (single-value-return 4))
    148 
    149 (defx8632lapfunction %boole-andc1 ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
    150   (movl (@ idx (% esp)) (% temp0))
     204  @test
     205  (subl ($ '1) (% temp0))
     206  (jge @loop)
     207  (single-value-return 4))
     208
     209(defx8632lapfunction %boole-andc1 ((len 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
     210  (movl (@ len (% esp)) (% temp0))
     211  (jmp @test)
     212  @loop
    151213  (movl (@ b0 (% esp)) (% temp1))
    152214  (movl (@ x8632::misc-data-offset (% temp1) (% temp0)) (% imm0))
     
    154216  (andl (@ x8632::misc-data-offset (% b1) (% temp0)) (% imm0))
    155217  (movl (% imm0) (@ x8632::misc-data-offset (% dest) (% temp0)))
    156   (single-value-return 4))
    157 
    158 (defx8632lapfunction %boole-andc2 ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
    159   (movl (@ idx (% esp)) (% temp0))
     218  @test
     219  (subl ($ '1) (% temp0))
     220  (jge @loop)
     221  (single-value-return 4))
     222
     223(defx8632lapfunction %boole-andc2 ((len 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
     224  (movl (@ len (% esp)) (% temp0))
     225  (jmp @test)
     226  @loop
    160227  (movl (@ b0 (% esp)) (% temp1))
    161228  (movl (@ x8632::misc-data-offset (% b1) (% temp0)) (% imm0))
     
    163230  (andl (@ x8632::misc-data-offset (% temp1) (% temp0)) (% imm0))
    164231  (movl (% imm0) (@ x8632::misc-data-offset (% dest) (% temp0)))
    165   (single-value-return 4))
    166 
    167 (defx8632lapfunction %boole-orc1 ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
    168   (movl (@ idx (% esp)) (% temp0))
     232  @test
     233  (subl ($ '1) (% temp0))
     234  (jge @loop)
     235  (single-value-return 4))
     236
     237(defx8632lapfunction %boole-orc1 ((len 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
     238  (movl (@ len (% esp)) (% temp0))
     239  (jmp @test)
     240  @loop
    169241  (movl (@ b0 (% esp)) (% temp1))
    170242  (movl (@ x8632::misc-data-offset (% temp1) (% temp0)) (% imm0))
     
    172244  (orl (@ x8632::misc-data-offset (% b1) (% temp0)) (% imm0))
    173245  (movl (% imm0) (@ x8632::misc-data-offset (% dest) (% temp0)))
    174   (single-value-return 4))
    175 
    176 (defx8632lapfunction %boole-orc2 ((idx 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
    177   (movl (@ idx (% esp)) (% temp0))
     246  @test
     247  (subl ($ '1) (% temp0))
     248  (jge @loop)
     249  (single-value-return 4))
     250
     251(defx8632lapfunction %boole-orc2 ((len 8) (b0 4) #|(ra 0)|# (b1 arg_y) (dest arg_z))
     252  (movl (@ len (% esp)) (% temp0))
     253  (jmp @test)
     254  @loop
    178255  (movl (@ b0 (% esp)) (% temp1))
    179256  (movl (@ x8632::misc-data-offset (% b1) (% temp0)) (% imm0))
     
    181258  (orl (@ x8632::misc-data-offset (% temp1) (% temp0)) (% imm0))
    182259  (movl (% imm0) (@ x8632::misc-data-offset (% dest) (% temp0)))
     260  @test
     261  (subl ($ '1) (% temp0))
     262  (jge @loop)
    183263  (single-value-return 4))
    184264
     
    205285
    206286(defun %simple-bit-boole (op b1 b2 result)
    207   (let* ((f (svref *simple-bit-boole-functions* op)))
    208     (dotimes (i (ash (the fixnum (+ (length result) 31)) -5) result)
    209       (funcall f i b1 b2 result))))
     287  (funcall (svref *simple-bit-boole-functions* op)
     288           (ash (the fixnum (+ (length result) 31)) -5)
     289           b1
     290           b2
     291           result))
    210292
    211293(defx8632lapfunction %aref2 ((array 4) #|(ra 0)|# (i arg_y) (j arg_z))
Note: See TracChangeset for help on using the changeset viewer.