Source file src/math/big/internal/asmgen/loong64.go

     1  // Copyright 2025 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  package asmgen
     6  
     7  var ArchLoong64 = &Arch{
     8  	Name:          "loong64",
     9  	WordBits:      64,
    10  	WordBytes:     8,
    11  	CarrySafeLoop: true,
    12  
    13  	regs: []string{
    14  		// R0 is set to 0.
    15  		// R1 is LR.
    16  		// R2 is ???
    17  		// R3 is SP.
    18  		// R22 is g.
    19  		// R28 and R29 are our virtual carry flags.
    20  		// R30 is the linker/assembler temp, which we use too.
    21  		"R4", "R5", "R6", "R7", "R8", "R9",
    22  		"R10", "R11", "R12", "R13", "R14", "R15", "R16", "R17", "R18", "R19",
    23  		"R20", "R21", "R23", "R24", "R25", "R26", "R27",
    24  		"R31",
    25  	},
    26  	reg0:        "R0",
    27  	regCarry:    "R28",
    28  	regAltCarry: "R29",
    29  	regTmp:      "R30",
    30  
    31  	mov:   "MOVV",
    32  	add:   "ADDVU",
    33  	sub:   "SUBVU",
    34  	sltu:  "SGTU",
    35  	mul:   "MULV",
    36  	mulhi: "MULHVU",
    37  	lsh:   "SLLV",
    38  	rsh:   "SRLV",
    39  	and:   "AND",
    40  	or:    "OR",
    41  	xor:   "XOR",
    42  
    43  	jmpZero:    "BEQ %s, %s",
    44  	jmpNonZero: "BNE %s, %s",
    45  }
    46  

View as plain text