37
36
{$define FPC_SYSTEM_HAS_FPC_SET_CREATE_ELEMENT}
39
function fpc_set_create_element(b : byte): fpc_normal_set;assembler;[public,alias:'FPC_SET_CREATE_ELEMENT']; {$ifdef hascompilerproc} compilerproc; {$endif}
38
function fpc_set_create_element(b : byte): fpc_normal_set;assembler;[public,alias:'FPC_SET_CREATE_ELEMENT']; compilerproc;
41
40
create a new set in p from an element b
46
{$ifndef hascompilerproc}
49
{$endif not hascompilerproc}
89
{$else hascompilerproc}
90
function fpc_set_set_byte(b : byte): fpc_normal_set;assembler;[public,alias:'FPC_SET_SET_BYTE'];
92
add the element b to the set pointed by p
106
{$endif hascompilerproc}
109
80
{$define FPC_SYSTEM_HAS_FPC_SET_UNSET_BYTE}
110
{$ifdef hascompilerproc}
111
81
function fpc_set_unset_byte(const source: fpc_normal_set; b : byte): fpc_normal_set;assembler; compilerproc;
113
83
add the element b to the set pointed by source
131
{$else hascompilerproc}
132
function fpc_set_unset_byte(b : byte): fpc_normal_set;assembler;[public,alias:'FPC_SET_UNSET_BYTE']; {$ifdef hascompilerproc} compilerproc; {$endif}
134
suppresses the element b to the set pointed by p
135
used for exclude(set,element)
149
{$endif hascompilerproc}
152
102
{$define FPC_SYSTEM_HAS_FPC_SET_SET_RANGE}
154
{$ifdef hascompilerproc}
155
104
function fpc_set_set_range(const orgset: fpc_normal_set; l,h : byte): fpc_normal_set;assembler; compilerproc;
157
106
adds the range [l..h] to the set pointed to by p
211
160
movl saveebx,%ebx
214
{$else hascompilerproc}
216
function fpc_set_set_range(l,h : byte): fpc_normal_set;assembler;[public,alias:'FPC_SET_SET_RANGE'];
218
adds the range [l..h] to the set pointed to by p
221
movl __RESULT,%edi // set address in edi
222
movzbl l,%eax // lowest bit to be set in eax
223
movzbl h,%ebx // highest in ebx
226
movl %eax,%ecx // lowest also in ecx
227
shrl $3,%eax // divide by 8 to get starting and ending byte
228
shrl $3,%ebx // address
229
andb $31,%cl // low five bits of lo determine start of bit mask
230
movl $0x0ffffffff,%edx // edx = bitmask to be inserted
231
andl $0x0fffffffc,%eax // clear two lowest bits to get start/end longint
232
andl $0x0fffffffc,%ebx // address * 4
233
shll %cl,%edx // shift bitmask to clear bits below lo
234
addl %eax,%edi // go to starting pos in set
235
subl %eax,%ebx // are bit lo and hi in the same longint?
236
jz .Lset_range_hi // yes, keep current mask and adjust for hi bit
237
orl %edx,(%edi) // no, store current mask
238
movl $0x0ffffffff,%edx // new mask
239
addl $4,%edi // next longint of set
240
subl $4,%ebx // bit hi in this longint?
241
jz .Lset_range_hi // yes, keep full mask and adjust for hi bit
243
movl %edx,(%edi) // no, fill longints in between with full mask
249
movl %edx,%ebx // save current bitmask
251
subb $31,%cl // cl := (31 - (hi and 31)) = shift count to
252
negb %cl // adjust bitmask for hi bit
253
shrl %cl,%edx // shift bitmask to clear bits higher than hi
254
andl %edx,%ebx // combine both bitmasks
255
orl %ebx,(%edi) // store to set
258
{$endif hascompilerproc}
261
163
{$define FPC_SYSTEM_HAS_FPC_SET_IN_BYTE}
263
function fpc_set_in_byte(const p: fpc_normal_set; b: byte): boolean; assembler; [public,alias:'FPC_SET_IN_BYTE']; {$ifdef hascompilerproc} compilerproc; {$else} {$ifndef NOSAVEREGISTERS}saveregisters;{$endif} {$endif}
165
function fpc_set_in_byte(const p: fpc_normal_set; b: byte): boolean; assembler; [public,alias:'FPC_SET_IN_BYTE']; compilerproc;
265
167
tests if the element b is in the set p the carryflag is set if it present
268
{$ifdef hascompilerproc}
277
{$else hascompilerproc}
283
{$endif hascompilerproc}
287
181
{$define FPC_SYSTEM_HAS_FPC_SET_ADD_SETS}
289
{$ifdef hascompilerproc}
290
183
function fpc_set_add_sets(const set1,set2: fpc_normal_set): fpc_normal_set;assembler;[public,alias:'FPC_SET_ADD_SETS']; compilerproc;
291
{$else hascompilerproc}
292
procedure fpc_set_add_sets(set1,set2,dest : pointer);assembler;[public,alias:'FPC_SET_ADD_SETS'];
293
{$endif hascompilerproc}
295
185
adds set1 and set2 into set dest
328
214
{$define FPC_SYSTEM_HAS_FPC_SET_MUL_SETS}
330
{$ifdef hascompilerproc}
331
216
function fpc_set_mul_sets(const set1,set2: fpc_normal_set): fpc_normal_set;assembler;[public,alias:'FPC_SET_MUL_SETS']; compilerproc;
332
{$else hascompilerproc}
333
procedure fpc_set_mul_sets(set1,set2,dest:pointer);assembler;[public,alias:'FPC_SET_MUL_SETS'];
334
{$endif hascompilerproc}
336
218
multiplies (takes common elements of) set1 and set2 result put in dest
369
247
{$define FPC_SYSTEM_HAS_FPC_SET_SUB_SETS}
371
{$ifdef hascompilerproc}
372
249
function fpc_set_sub_sets(const set1,set2: fpc_normal_set): fpc_normal_set;assembler;[public,alias:'FPC_SET_SUB_SETS']; compilerproc;
373
{$else hascompilerproc}
374
procedure fpc_set_sub_sets(set1,set2,dest:pointer);assembler;[public,alias:'FPC_SET_SUB_SETS'];
375
{$endif hascompilerproc}
377
251
computes the diff from set1 to set2 result in dest
414
284
{$define FPC_SYSTEM_HAS_FPC_SET_SYMDIF_SETS}
416
{$ifdef hascompilerproc}
417
286
function fpc_set_symdif_sets(const set1,set2: fpc_normal_set): fpc_normal_set;assembler;[public,alias:'FPC_SET_SYMDIF_SETS']; compilerproc;
418
{$else hascompilerproc}
419
procedure fpc_set_symdif_sets(set1,set2,dest:pointer);assembler;[public,alias:'FPC_SET_SYMDIF_SETS'];
420
{$endif hascompilerproc}
422
288
computes the symetric diff from set1 to set2 result in dest
455
317
{$define FPC_SYSTEM_HAS_FPC_SET_COMP_SETS}
457
function fpc_set_comp_sets(const set1,set2: fpc_normal_set): boolean;assembler;[public,alias:'FPC_SET_COMP_SETS']; {$ifdef hascompilerproc} compilerproc; {$endif}
319
function fpc_set_comp_sets(const set1,set2: fpc_normal_set): boolean;assembler;[public,alias:'FPC_SET_COMP_SETS']; compilerproc;
459
321
compares set1 and set2 zeroflag is set if they are equal
489
349
{$define FPC_SYSTEM_HAS_FPC_SET_CONTAINS_SET}
491
function fpc_set_contains_sets(const set1,set2: fpc_normal_set): boolean;assembler;[public,alias:'FPC_SET_CONTAINS_SETS']; {$ifdef hascompilerproc} compilerproc; {$endif}
351
function fpc_set_contains_sets(const set1,set2: fpc_normal_set): boolean;assembler;[public,alias:'FPC_SET_CONTAINS_SETS']; compilerproc;
493
353
on exit, zero flag is set if set1 <= set2 (set2 contains set1)
526
384
{$error Needs to be fixed for register calling first!}
528
procedure fpc_largeset_set_word(p : pointer;b : word);assembler;[public,alias:'FPC_LARGESET_SET_WORD']; {$ifdef hascompilerproc} compilerproc; {$endif}
386
procedure fpc_largeset_set_word(p : pointer;b : word);assembler;[public,alias:'FPC_LARGESET_SET_WORD']; compilerproc;
530
388
sets the element b in set p works for sets larger than 256 elements
531
389
not yet use by the compiler so
566
procedure fpc_largeset_add_sets(set1,set2,dest : pointer;size : longint);assembler;[public,alias:'FPC_LARGESET_ADD_SETS']; {$ifdef hascompilerproc} compilerproc; {$endif}
424
procedure fpc_largeset_add_sets(set1,set2,dest : pointer;size : longint);assembler;[public,alias:'FPC_LARGESET_ADD_SETS']; compilerproc;
568
426
adds set1 and set2 into set dest size is the number of bytes in the set
585
procedure fpc_largeset_mul_sets(set1,set2,dest : pointer;size : longint);assembler;[public,alias:'FPC_LARGESET_MUL_SETS']; {$ifdef hascompilerproc} compilerproc; {$endif}
443
procedure fpc_largeset_mul_sets(set1,set2,dest : pointer;size : longint);assembler;[public,alias:'FPC_LARGESET_MUL_SETS']; compilerproc;
587
445
multiplies (i.E. takes common elements of) set1 and set2 result put in
588
446
dest size is the number of bytes in the set
623
procedure fpc_largeset_symdif_sets(set1,set2,dest : pointer;size : longint);assembler;[public,alias:'FPC_LARGESET_SYMDIF_SETS']; {$ifdef hascompilerproc} compilerproc; {$endif}
481
procedure fpc_largeset_symdif_sets(set1,set2,dest : pointer;size : longint);assembler;[public,alias:'FPC_LARGESET_SYMDIF_SETS']; compilerproc;
625
483
computes the symetric diff from set1 to set2 result in dest
658
516
.LMCOMPSETSIZEEND:
661
procedure fpc_largeset_contains_sets(set1,set2 : pointer; size: longint);assembler;[public,alias:'FPC_LARGESET_CONTAINS_SETS']; {$ifdef hascompilerproc} compilerproc; {$endif}
519
procedure fpc_largeset_contains_sets(set1,set2 : pointer; size: longint);assembler;[public,alias:'FPC_LARGESET_CONTAINS_SETS']; compilerproc;
663
521
on exit, zero flag is set if set1 <= set2 (set2 contains set1)