github.com/emmansun/gmsm@v0.29.1/internal/bigmod/nat_arm.s (about)

     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 addMulVVW256(z, x *uint, y uint) (c uint)
    10  TEXT ·addMulVVW256(SB), $0-16
    11  	MOVW	$8, R5
    12  	JMP		addMulVVWy(SB)
    13  
    14  // func addMulVVW1024(z, x *uint, y uint) (c uint)
    15  TEXT ·addMulVVW1024(SB), $0-16
    16  	MOVW	$32, R5
    17  	JMP		addMulVVWy(SB)
    18  
    19  // func addMulVVW1536(z, x *uint, y uint) (c uint)
    20  TEXT ·addMulVVW1536(SB), $0-16
    21  	MOVW	$48, R5
    22  	JMP		addMulVVWy(SB)
    23  
    24  // func addMulVVW2048(z, x *uint, y uint) (c uint)
    25  TEXT ·addMulVVW2048(SB), $0-16
    26  	MOVW	$64, R5
    27  	JMP		addMulVVWy(SB)
    28  
    29  TEXT addMulVVWy(SB), NOFRAME|NOSPLIT, $0
    30  	MOVW	$0, R0
    31  	MOVW	z+0(FP), R1
    32  	MOVW	x+4(FP), R2
    33  	MOVW	y+8(FP), R3
    34  	ADD	R5<<2, R1, R5
    35  	MOVW	$0, R4
    36  	B E9
    37  
    38  L9:	MOVW.P	4(R2), R6
    39  	MULLU	R6, R3, (R7, R6)
    40  	ADD.S	R4, R6
    41  	ADC	R0, R7
    42  	MOVW	0(R1), R4
    43  	ADD.S	R4, R6
    44  	ADC	R0, R7
    45  	MOVW.P	R6, 4(R1)
    46  	MOVW	R7, R4
    47  
    48  E9:	TEQ	R1, R5
    49  	BNE	L9
    50  
    51  	MOVW	R4, c+12(FP)
    52  	RET