; This Source Code Form is subject to the terms of the Mozilla Public ; License, v. 2.0. If a copy of the MPL was not distributed with this ; file, You can obtain one at http://mozilla.org/MPL/2.0/.
; ; This code is converted from mpi_amd64_gas.asm for MASM for x64. ;
; ------------------------------------------------------------------------ ; ; Implementation of s_mpv_mul_set_vec which exploits ; the 64X64->128 bit unsigned multiply instruction. ; ; ------------------------------------------------------------------------
; r = a * digit, r and a are vectors of length len ; returns the carry digit ; r and a are 64 bit aligned. ; ; uint64_t ; s_mpv_mul_set_vec64(uint64_t *r, uint64_t *a, int len, uint64_t digit) ;
.CODE
s_mpv_mul_set_vec64 PROC
; compatibilities for paramenter registers ; ; About GAS and MASM, the usage of parameter registers are different.
L16: mov rax, [0+rsi] mul rcx add rax, r9 adc rdx,0 mov [0+rdi],rax mov r9,rdx dec r8 jz L17 mov rax, [8+rsi] mul rcx add rax,r9 adc rdx,0 mov [8+rdi], rax mov r9, rdx dec r8 jz L17 mov rax, [16+rsi] mul rcx add rax, r9 adc rdx, 0 mov [16+rdi],rax mov r9,rdx dec r8 jz L17 mov rax, [24+rsi] mul rcx add rax, r9 adc rdx, 0 mov [24+rdi], rax mov r9, rdx dec r8 jz L17 mov rax, [32+rsi] mul rcx add rax, r9 adc rdx, 0 mov [32+rdi],rax mov r9, rdx dec r8 jz L17 mov rax, [40+rsi] mul rcx add rax, r9 adc rdx, 0 mov [40+rdi], rax mov r9, rdx dec r8 jz L17 mov rax, [48+rsi] mul rcx add rax, r9 adc rdx, 0 mov [48+rdi], rax mov r9, rdx dec r8 jz L17
L17: mov rax, r9 pop rsi pop rdi ret
s_mpv_mul_set_vec64 ENDP
;------------------------------------------------------------------------ ; ; Implementation of s_mpv_mul_add_vec which exploits ; the 64X64->128 bit unsigned multiply instruction. ; ;------------------------------------------------------------------------
; r += a * digit, r and a are vectors of length len ; returns the carry digit ; r and a are 64 bit aligned. ; ; uint64_t ; s_mpv_mul_add_vec64(uint64_t *r, uint64_t *a, int len, uint64_t digit) ;
s_mpv_mul_add_vec64 PROC
; compatibilities for paramenter registers ; ; About GAS and MASM, the usage of parameter registers are different.
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.