github.com/Rookout/GoSDK@v0.1.48/pkg/services/assembler/internal/obj/x86/ytab.go (about)

     1  // Copyright 2017 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.assembler file.
     4  
     5  package x86
     6  
     7  
     8  
     9  const argListMax int = 6
    10  
    11  type argList [argListMax]uint8
    12  
    13  type ytab struct {
    14  	zcase   uint8
    15  	zoffset uint8
    16  
    17  	
    18  	
    19  	
    20  	args argList
    21  }
    22  
    23  
    24  
    25  
    26  
    27  
    28  
    29  func (yt *ytab) match(args []int) bool {
    30  	
    31  	
    32  	
    33  	if len(args) < len(yt.args) && yt.args[len(args)] != Yxxx {
    34  		return false
    35  	}
    36  
    37  	for i := range args {
    38  		if ycover[args[i]+int(yt.args[i])] == 0 {
    39  			return false
    40  		}
    41  	}
    42  
    43  	return true
    44  }