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

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

View as plain text