Source file src/cmd/compile/internal/loong64/ggen.go

     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  	"cmd/compile/internal/base"
     9  	"cmd/compile/internal/objw"
    10  	"cmd/internal/obj"
    11  	"cmd/internal/obj/loong64"
    12  )
    13  
    14  func zerorange(pp *objw.Progs, p *obj.Prog, off, cnt int64, _ *uint32) *obj.Prog {
    15  	if cnt%8 != 0 {
    16  		panic("zeroed region not aligned")
    17  	}
    18  
    19  	// Adjust the frame to account for LR.
    20  	off += base.Ctxt.Arch.FixedFrameSize
    21  
    22  	for cnt != 0 {
    23  		p = pp.Append(p, loong64.AMOVV, obj.TYPE_REG, loong64.REGZERO, 0, obj.TYPE_MEM, loong64.REGSP, off)
    24  		off += 8
    25  		cnt -= 8
    26  	}
    27  
    28  	return p
    29  }
    30  
    31  func ginsnop(pp *objw.Progs) *obj.Prog {
    32  	p := pp.Prog(loong64.ANOOP)
    33  	return p
    34  }
    35  

View as plain text