Change-Id: Iefa0bfc1317f19c8bf2a42a652d35a85319459a3
This commit is contained in:
Henry Case 2019-04-19 11:28:56 +01:00
parent 70c0f56b3b
commit 4d03fe12e5

View File

@ -32,7 +32,7 @@ $code.=<<___;
movdqu $idx*16(%rsi), %xmm1 movdqu $idx*16(%rsi), %xmm1
movdqa %xmm1, %xmm2 movdqa %xmm1, %xmm2
pxor %xmm0, %xmm2 pxor %xmm0, %xmm2
pand %xmm15,%xmm2 pand %xmm3, %xmm2
pxor %xmm2, %xmm0 pxor %xmm2, %xmm0
pxor %xmm2, %xmm1 pxor %xmm2, %xmm1
movdqu %xmm0, $idx*16(%rdi) movdqu %xmm0, $idx*16(%rdi)
@ -340,15 +340,15 @@ $code.=<<___;
.globl ${PREFIX}_cswap_asm .globl ${PREFIX}_cswap_asm
.type ${PREFIX}_cswap_asm,\@function,3 .type ${PREFIX}_cswap_asm,\@function,3
${PREFIX}_cswap_asm: ${PREFIX}_cswap_asm:
# Fill xmm15. After this step first half of XMM15 is # Fill XMM3. After this step first half of XMM3 is
# just zeros and second half is whatever in RDX # just zeros and second half is whatever in RDX
mov %rdx, %xmm15 mov %rdx, %xmm3
# Copy lower double word everywhere else. So that # Copy lower double word everywhere else. So that
# XMM15=RDX|RDX. As RDX has either all bits set # XMM3=RDX|RDX. As RDX has either all bits set
# or non result will be that XMM15 has also either # or non result will be that XMM3 has also either
# all bits set or non of them. 68 = 01000100b # all bits set or non of them. 68 = 01000100b
pshufd \$68, %xmm15, %xmm15 pshufd \$68, %xmm3, %xmm3
___ ___
foreach my $i ( 0.. 3){&CSWAP16($i);} # P[0].X with Q[0].X foreach my $i ( 0.. 3){&CSWAP16($i);} # P[0].X with Q[0].X