mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-20 12:49:08 +02:00
* cleanup
This commit is contained in:
parent
b416418134
commit
54dcfa78f8
@ -415,32 +415,6 @@ asm
|
|||||||
sub $16, %ecx
|
sub $16, %ecx
|
||||||
jl .LFallback { probably dead branch... }
|
jl .LFallback { probably dead branch... }
|
||||||
|
|
||||||
{$if false}
|
|
||||||
{ Scans 16 bytes at a time left to right with early exits.
|
|
||||||
Would be better for large enough sets (maybe around 64 bytes or even more) — if they existed, but worse for actually existing 32.
|
|
||||||
Kept for the future. }
|
|
||||||
push %ebx
|
|
||||||
pxor %xmm2, %xmm2 { xmm2 = 0 }
|
|
||||||
add %ecx, %eax { set1 += size }
|
|
||||||
add %ecx, %edx { set2 += size }
|
|
||||||
neg %ecx { Now "size" (ecx) = -(orig.size - 16), "set1" (eax) points to orig.set1 + orig.size - 16, "set2" (edx) points to orig.set2 + orig.size - 16.
|
|
||||||
Loop ends on "size" >= 0, leaving up to 16 tail bytes. }
|
|
||||||
.L16x_Loop:
|
|
||||||
movdqu (%eax,%ecx), %xmm1
|
|
||||||
movdqu (%edx,%ecx), %xmm0
|
|
||||||
pandn %xmm1, %xmm0
|
|
||||||
pcmpeqb %xmm2, %xmm0
|
|
||||||
pmovmskb %xmm0, %ebx
|
|
||||||
inc %bx
|
|
||||||
jnz .LNo
|
|
||||||
add $16, %ecx
|
|
||||||
js .L16x_Loop
|
|
||||||
pop %ebx
|
|
||||||
|
|
||||||
movdqu (%eax), %xmm1
|
|
||||||
movdqu (%edx), %xmm0
|
|
||||||
pandn %xmm1, %xmm0
|
|
||||||
{$else}
|
|
||||||
{ Folds all 16-byte "set1 and not set2" chunks with OR and checks the final result for zero. Better for small enough sets. }
|
{ Folds all 16-byte "set1 and not set2" chunks with OR and checks the final result for zero. Better for small enough sets. }
|
||||||
movdqu (%eax), %xmm1
|
movdqu (%eax), %xmm1
|
||||||
movdqu (%edx), %xmm2
|
movdqu (%edx), %xmm2
|
||||||
@ -455,7 +429,6 @@ asm
|
|||||||
ja .L16x_Loop
|
ja .L16x_Loop
|
||||||
|
|
||||||
pxor %xmm0, %xmm0
|
pxor %xmm0, %xmm0
|
||||||
{$endif}
|
|
||||||
pcmpeqb %xmm2,%xmm0
|
pcmpeqb %xmm2,%xmm0
|
||||||
pmovmskb %xmm0, %ecx
|
pmovmskb %xmm0, %ecx
|
||||||
xor %eax, %eax
|
xor %eax, %eax
|
||||||
@ -466,12 +439,6 @@ asm
|
|||||||
.LFallback:
|
.LFallback:
|
||||||
add $16, %ecx
|
add $16, %ecx
|
||||||
jmp fpc_varset_contains_sets_plain
|
jmp fpc_varset_contains_sets_plain
|
||||||
|
|
||||||
{$if false}
|
|
||||||
.LNo:
|
|
||||||
xor %eax, %eax
|
|
||||||
pop %ebx
|
|
||||||
{$endif}
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function fpc_varset_contains_sets_dispatch(const set1,set2;size : ptrint):boolean; forward;
|
function fpc_varset_contains_sets_dispatch(const set1,set2;size : ptrint):boolean; forward;
|
||||||
|
@ -163,30 +163,6 @@ asm
|
|||||||
sub size, 16
|
sub size, 16
|
||||||
jl @Bytewise_Prepare { probably dead branch... }
|
jl @Bytewise_Prepare { probably dead branch... }
|
||||||
|
|
||||||
{$if false}
|
|
||||||
{ Scans 16 bytes at a time left to right with early exits.
|
|
||||||
Would be better for large enough sets (maybe around 64 bytes or even more) — if they existed, but worse for actually existing 32.
|
|
||||||
Kept for the future. }
|
|
||||||
pxor xmm2, xmm2 { xmm2 = 0 }
|
|
||||||
add set1, size
|
|
||||||
add set2, size
|
|
||||||
neg size { Now "size" = -(orig.size - 16), "set1" points to orig.set1 + orig.size - 16, "set2" points to orig.set2 + orig.size - 16.
|
|
||||||
Loop ends on "size" >= 0, leaving up to 16 tail bytes. }
|
|
||||||
@16x_Loop:
|
|
||||||
movdqu xmm1, xmmword ptr [set1 + size]
|
|
||||||
movdqu xmm0, xmmword ptr [set2 + size]
|
|
||||||
pandn xmm0, xmm1
|
|
||||||
pcmpeqb xmm0, xmm2
|
|
||||||
pmovmskb eax, xmm0
|
|
||||||
inc ax
|
|
||||||
jnz @No
|
|
||||||
add size, 16
|
|
||||||
js @16x_Loop
|
|
||||||
|
|
||||||
movdqu xmm1, xmmword ptr [set1]
|
|
||||||
movdqu xmm0, xmmword ptr [set2]
|
|
||||||
pandn xmm0, xmm1
|
|
||||||
{$else}
|
|
||||||
{ Folds all 16-byte "set1 and not set2" chunks with OR and checks the final result for zero. Better for small enough sets. }
|
{ Folds all 16-byte "set1 and not set2" chunks with OR and checks the final result for zero. Better for small enough sets. }
|
||||||
movdqu xmm1, xmmword ptr [set1]
|
movdqu xmm1, xmmword ptr [set1]
|
||||||
movdqu xmm2, xmmword ptr [set2]
|
movdqu xmm2, xmmword ptr [set2]
|
||||||
@ -201,7 +177,6 @@ asm
|
|||||||
ja @16x_Loop
|
ja @16x_Loop
|
||||||
|
|
||||||
pxor xmm0, xmm0
|
pxor xmm0, xmm0
|
||||||
{$endif}
|
|
||||||
pcmpeqb xmm0, xmm2
|
pcmpeqb xmm0, xmm2
|
||||||
pmovmskb ecx, xmm0
|
pmovmskb ecx, xmm0
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
|
Loading…
Reference in New Issue
Block a user