github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/cmd/internal/obj/mips/asm0.go (about)

     1  // cmd/9l/optab.c, cmd/9l/asmout.c from Vita Nuova.
     2  //
     3  //	Copyright © 1994-1999 Lucent Technologies Inc.  All rights reserved.
     4  //	Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net)
     5  //	Portions Copyright © 1997-1999 Vita Nuova Limited
     6  //	Portions Copyright © 2000-2008 Vita Nuova Holdings Limited (www.vitanuova.com)
     7  //	Portions Copyright © 2004,2006 Bruce Ellis
     8  //	Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net)
     9  //	Revisions Copyright © 2000-2008 Lucent Technologies Inc. and others
    10  //	Portions Copyright © 2009 The Go Authors. All rights reserved.
    11  //
    12  // Permission is hereby granted, free of charge, to any person obtaining a copy
    13  // of this software and associated documentation files (the "Software"), to deal
    14  // in the Software without restriction, including without limitation the rights
    15  // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    16  // copies of the Software, and to permit persons to whom the Software is
    17  // furnished to do so, subject to the following conditions:
    18  //
    19  // The above copyright notice and this permission notice shall be included in
    20  // all copies or substantial portions of the Software.
    21  //
    22  // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    23  // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    24  // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
    25  // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    26  // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    27  // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    28  // THE SOFTWARE.
    29  
    30  package mips
    31  
    32  import (
    33  	"github.com/shogo82148/std/cmd/internal/obj"
    34  	"github.com/shogo82148/std/cmd/internal/sys"
    35  )
    36  
    37  type Optab struct {
    38  	as     obj.As
    39  	a1     uint8
    40  	a2     uint8
    41  	a3     uint8
    42  	type_  int8
    43  	size   int8
    44  	param  int16
    45  	family sys.ArchFamily
    46  	flag   uint8
    47  }
    48  
    49  const (
    50  	// Optab.flag
    51  	NOTUSETMP = 1 << iota
    52  )
    53  
    54  func OP(x uint32, y uint32) uint32
    55  
    56  func SP(x uint32, y uint32) uint32
    57  
    58  func BCOND(x uint32, y uint32) uint32
    59  
    60  func MMU(x uint32, y uint32) uint32
    61  
    62  func FPF(x uint32, y uint32) uint32
    63  
    64  func FPD(x uint32, y uint32) uint32
    65  
    66  func FPW(x uint32, y uint32) uint32
    67  
    68  func FPV(x uint32, y uint32) uint32
    69  
    70  func OP_RRR(op uint32, r1 int16, r2 int16, r3 int16) uint32
    71  
    72  func OP_IRR(op uint32, i uint32, r2 int16, r3 int16) uint32
    73  
    74  func OP_SRR(op uint32, s uint32, r2 int16, r3 int16) uint32
    75  
    76  func OP_FRRR(op uint32, r1 int16, r2 int16, r3 int16) uint32
    77  
    78  func OP_JMP(op uint32, i uint32) uint32
    79  
    80  func OP_VI10(op uint32, df uint32, s10 int32, wd uint32, minor uint32) uint32
    81  
    82  func OP_VMI10(s10 int32, rs uint32, wd uint32, minor uint32, df uint32) uint32