Home | History | Annotate | Download | only in arch
      1 // Copyright 2016 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 // This file encapsulates some of the odd characteristics of the
      6 // AMD64 instruction set, to minimize its interaction
      7 // with the core of the assembler.
      8 
      9 package arch
     10 
     11 import (
     12 	"cmd/internal/obj"
     13 	"cmd/internal/obj/x86"
     14 )
     15 
     16 // IsAMD4OP reports whether the op (as defined by an amd64.A* constant) is
     17 // a 4-operand instruction.
     18 func IsAMD4OP(op obj.As) bool {
     19 	switch op {
     20 	case x86.AVPERM2F128,
     21 		x86.AVPALIGNR,
     22 		x86.AVPERM2I128,
     23 		x86.AVINSERTI128,
     24 		x86.AVPBLENDD:
     25 		return true
     26 	}
     27 	return false
     28 }
     29