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

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

View as plain text