Add mpn_add_nc and mpn_sub_nc to the Windows Core2 assembler

This commit is contained in:
gladman 2009-08-10 16:47:45 +00:00
parent 22998b1140
commit 27b3a6de72
5 changed files with 27 additions and 7 deletions

View File

@ -136,6 +136,7 @@ MA 02111-1307, USA. */
#undef HAVE_NATIVE_mpn_xnor_n
#define HAVE_NATIVE_mpn_add_n 1
#define HAVE_NATIVE_mpn_add_nc 1
#define HAVE_NATIVE_mpn_addadd_n 1
#define HAVE_NATIVE_mpn_subadd_n 1
#define HAVE_NATIVE_mpn_addlsh1_n 1
@ -162,6 +163,7 @@ MA 02111-1307, USA. */
#define HAVE_NATIVE_mpn_rshift 1
#define HAVE_NATIVE_mpn_sqr_basecase 1
#define HAVE_NATIVE_mpn_sub_n 1
#define HAVE_NATIVE_mpn_sub_nc 1
#define HAVE_NATIVE_mpn_sublsh1_n 1
#define HAVE_NATIVE_mpn_submul_1 1
#define HAVE_NATIVE_mpn_submul_1c 1

View File

@ -64,7 +64,7 @@ entry:
and rax, 3
shr r9, 2
lea r9,[r10+r9*2]
shr r9, 1
sar r9, 1
jnz .2
mov r10, [rdx]

View File

@ -64,7 +64,7 @@ entry:
and rax, 3
shr r9, 2
lea r9,[r10+r9*2]
shr r9, 1
sar r9, 1
jnz .2
mov r10, [rdx]

View File

@ -30,7 +30,14 @@
CPU Core2
BITS 64
LEAF_PROC mpn_add_n
LEAF_PROC mpn_add_nc
mov r10, [rsp+0x28]
jmp mpn_add_entry
LEAF_PROC mpn_add_n
xor r10, r10
mpn_add_entry:
movsxd rax, r9d
mov r9, rcx
mov rcx, rax
@ -40,8 +47,10 @@
lea rdx, [rdx+rcx*8]
lea r8, [r8+rcx*8]
neg rcx
cmp rcx, 0
jz L_skiplp
lea rcx, [r10+rcx*2]
sar rcx, 1
jz L_exitlp
xalign 16
L_lp:
mov r10, [rdx+rcx*8]

View File

@ -30,7 +30,14 @@
CPU Core2
BITS 64
LEAF_PROC mpn_sub_nc
mov r10, [rsp+0x28]
jmp mpn_sub_entry
LEAF_PROC mpn_sub_n
xor r10, r10
mpn_sub_entry:
movsxd rax, r9d
mov r9, rcx
mov rcx, rax
@ -40,8 +47,10 @@
lea rdx, [rdx+rcx*8]
lea r8, [r8+rcx*8]
neg rcx
cmp rcx, 0
jz L_skiplp
lea rcx, [r10+rcx*2]
sar rcx, 1
jz L_exitlp
xalign 16
L_lp:
mov r10, [rdx+rcx*8]