github.com/Rookout/GoSDK@v0.1.48/pkg/services/assembler/insts_amd64.go (about)

     1  package assembler
     2  
     3  import (
     4  	"github.com/Rookout/GoSDK/pkg/services/assembler/internal/obj"
     5  )
     6  
     7  
     8  
     9  func (b *Builder) Inst(op obj.As, dst, src Arg) *Instruction {
    10  	inst := b.NewInstruction()
    11  	inst.As = op
    12  	inst.To = argToAddr(dst)
    13  	inst.From = argToAddr(src)
    14  	return inst
    15  }
    16  
    17  
    18  
    19  func (b *Builder) Cmp(dst, src Arg) *Instruction {
    20  	inst := b.NewInstruction()
    21  	inst.As = ACMPQ
    22  	
    23  	inst.To = argToAddr(src)
    24  	inst.From = argToAddr(dst)
    25  	return inst
    26  }
    27  
    28  
    29  
    30  
    31  func (b *Builder) BranchToReg(op obj.As, dst Arg) *Instruction {
    32  	return b.Inst(op, dst, NoArg)
    33  }