Latest update.
This commit is contained in:
@@ -74,7 +74,7 @@ if (!$addx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&
|
||||
$addx = ($1>=12);
|
||||
}
|
||||
|
||||
if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on LLVM) ([3-9])\.([0-9]+)/) {
|
||||
if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on LLVM) ([0-9]+)\.([0-9]+)/) {
|
||||
my $ver = $2 + $3/100.0; # 3.1->3.01, 3.10->3.10
|
||||
$avx = ($ver>=3.0) + ($ver>=3.01);
|
||||
$addx = ($ver>=3.03);
|
||||
@@ -1581,6 +1581,7 @@ $code.=<<___;
|
||||
.type ecp_nistz256_to_mont,\@function,2
|
||||
.align 32
|
||||
ecp_nistz256_to_mont:
|
||||
.cfi_startproc
|
||||
___
|
||||
$code.=<<___ if ($addx);
|
||||
mov \$0x80100, %ecx
|
||||
@@ -1589,6 +1590,7 @@ ___
|
||||
$code.=<<___;
|
||||
lea .LRR(%rip), $b_org
|
||||
jmp .Lmul_mont
|
||||
.cfi_endproc
|
||||
.size ecp_nistz256_to_mont,.-ecp_nistz256_to_mont
|
||||
|
||||
################################################################################
|
||||
@@ -2564,6 +2566,7 @@ $code.=<<___;
|
||||
.type ecp_nistz256_scatter_w5,\@abi-omnipotent
|
||||
.align 32
|
||||
ecp_nistz256_scatter_w5:
|
||||
.cfi_startproc
|
||||
lea -3($index,$index,2), $index
|
||||
movdqa 0x00($in_t), %xmm0
|
||||
shl \$5, $index
|
||||
@@ -2580,6 +2583,7 @@ ecp_nistz256_scatter_w5:
|
||||
movdqa %xmm5, 0x50($val,$index)
|
||||
|
||||
ret
|
||||
.cfi_endproc
|
||||
.size ecp_nistz256_scatter_w5,.-ecp_nistz256_scatter_w5
|
||||
|
||||
################################################################################
|
||||
@@ -2687,6 +2691,7 @@ $code.=<<___;
|
||||
.type ecp_nistz256_scatter_w7,\@abi-omnipotent
|
||||
.align 32
|
||||
ecp_nistz256_scatter_w7:
|
||||
.cfi_startproc
|
||||
movdqu 0x00($in_t), %xmm0
|
||||
shl \$6, $index
|
||||
movdqu 0x10($in_t), %xmm1
|
||||
@@ -2698,6 +2703,7 @@ ecp_nistz256_scatter_w7:
|
||||
movdqa %xmm3, 0x30($val,$index)
|
||||
|
||||
ret
|
||||
.cfi_endproc
|
||||
.size ecp_nistz256_scatter_w7,.-ecp_nistz256_scatter_w7
|
||||
|
||||
################################################################################
|
||||
@@ -3022,8 +3028,10 @@ $code.=<<___;
|
||||
.type ecp_nistz256_avx2_gather_w7,\@function,3
|
||||
.align 32
|
||||
ecp_nistz256_avx2_gather_w7:
|
||||
.cfi_startproc
|
||||
.byte 0x0f,0x0b # ud2
|
||||
ret
|
||||
.cfi_endproc
|
||||
.size ecp_nistz256_avx2_gather_w7,.-ecp_nistz256_avx2_gather_w7
|
||||
___
|
||||
}
|
||||
@@ -3619,29 +3627,19 @@ $code.=<<___;
|
||||
call __ecp_nistz256_sub_from$x # p256_sub(H, U2, U1);
|
||||
|
||||
or $acc5, $acc4 # see if result is zero
|
||||
or $acc0, $acc4
|
||||
or $acc1, $acc4 # !is_equal(U1, U2)
|
||||
|
||||
movq %xmm2, $acc0 # in1infty | in2infty
|
||||
movq %xmm3, $acc1 # !is_equal(S1, S2)
|
||||
|
||||
or $acc0, $acc4
|
||||
or $acc1, $acc4
|
||||
|
||||
# if (!is_equal(U1, U2) | in1infty | in2infty | !is_equal(S1, S2))
|
||||
.byte 0x3e # predict taken
|
||||
jnz .Ladd_proceed$x # is_equal(U1,U2)?
|
||||
movq %xmm2, $acc0
|
||||
movq %xmm3, $acc1
|
||||
test $acc0, $acc0
|
||||
jnz .Ladd_proceed$x # (in1infty || in2infty)?
|
||||
test $acc1, $acc1
|
||||
jz .Ladd_double$x # is_equal(S1,S2)?
|
||||
jnz .Ladd_proceed$x
|
||||
|
||||
movq %xmm0, $r_ptr # restore $r_ptr
|
||||
pxor %xmm0, %xmm0
|
||||
movdqu %xmm0, 0x00($r_ptr)
|
||||
movdqu %xmm0, 0x10($r_ptr)
|
||||
movdqu %xmm0, 0x20($r_ptr)
|
||||
movdqu %xmm0, 0x30($r_ptr)
|
||||
movdqu %xmm0, 0x40($r_ptr)
|
||||
movdqu %xmm0, 0x50($r_ptr)
|
||||
jmp .Ladd_done$x
|
||||
|
||||
.align 32
|
||||
.Ladd_double$x:
|
||||
movq %xmm1, $a_ptr # restore $a_ptr
|
||||
movq %xmm0, $r_ptr # restore $r_ptr
|
||||
|
||||
Reference in New Issue
Block a user