...

Text file src/crypto/internal/bigmod/nat_386.s

Documentation: crypto/internal/bigmod

     1// Copyright 2009 The Go Authors. All rights reserved.
     2// Use of this source code is governed by a BSD-style
     3// license that can be found in the LICENSE file.
     4
     5//go:build !purego
     6
     7#include "textflag.h"
     8
     9// func addMulVVW1024(z, x *uint, y uint) (c uint)
    10TEXT ·addMulVVW1024(SB), $0-16
    11	MOVL	$32, BX
    12	JMP		addMulVVWx(SB)
    13
    14// func addMulVVW1536(z, x *uint, y uint) (c uint)
    15TEXT ·addMulVVW1536(SB), $0-16
    16	MOVL	$48, BX
    17	JMP		addMulVVWx(SB)
    18
    19// func addMulVVW2048(z, x *uint, y uint) (c uint)
    20TEXT ·addMulVVW2048(SB), $0-16
    21	MOVL	$64, BX
    22	JMP		addMulVVWx(SB)
    23
    24TEXT addMulVVWx(SB), NOFRAME|NOSPLIT, $0
    25	MOVL z+0(FP), DI
    26	MOVL x+4(FP), SI
    27	MOVL y+8(FP), BP
    28	LEAL (DI)(BX*4), DI
    29	LEAL (SI)(BX*4), SI
    30	NEGL BX			// i = -n
    31	MOVL $0, CX		// c = 0
    32	JMP E6
    33
    34L6:	MOVL (SI)(BX*4), AX
    35	MULL BP
    36	ADDL CX, AX
    37	ADCL $0, DX
    38	ADDL AX, (DI)(BX*4)
    39	ADCL $0, DX
    40	MOVL DX, CX
    41	ADDL $1, BX		// i++
    42
    43E6:	CMPL BX, $0		// i < 0
    44	JL L6
    45
    46	MOVL CX, c+12(FP)
    47	RET

View as plain text