github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/cmd/internal/obj/loong64/asm.go (about) 1 // Copyright 2022 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 loong64 6 7 import ( 8 "github.com/shogo82148/std/cmd/internal/obj" 9 ) 10 11 const ( 12 FuncAlign = 4 13 ) 14 15 type Optab struct { 16 as obj.As 17 from1 uint8 18 reg uint8 19 from3 uint8 20 to1 uint8 21 to2 uint8 22 type_ int8 23 size int8 24 param int16 25 flag uint8 26 } 27 28 const ( 29 NOTUSETMP = 1 << iota 30 ) 31 32 func OP(x uint32, y uint32) uint32 33 34 func SP(x uint32, y uint32) uint32 35 36 func OP_TEN(x uint32, y uint32) uint32 37 38 // r1 -> rk 39 // r2 -> rj 40 // r3 -> rd 41 func OP_RRR(op uint32, r1 uint32, r2 uint32, r3 uint32) uint32 42 43 // r2 -> rj 44 // r3 -> rd 45 func OP_RR(op uint32, r2 uint32, r3 uint32) uint32 46 47 func OP_16IR_5I(op uint32, i uint32, r2 uint32) uint32 48 49 func OP_16IRR(op uint32, i uint32, r2 uint32, r3 uint32) uint32 50 51 func OP_12IRR(op uint32, i uint32, r2 uint32, r3 uint32) uint32 52 53 func OP_IR(op uint32, i uint32, r2 uint32) uint32 54 55 // Encoding for the 'b' or 'bl' instruction. 56 func OP_B_BL(op uint32, i uint32) uint32