1 // cmd/7l/noop.c, cmd/7l/obj.c, cmd/ld/pass.c from Vita Nuova.
2 // https://code.google.com/p/ken-cc/source/browse/
4 // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved.
5 // Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net)
6 // Portions Copyright © 1997-1999 Vita Nuova Limited
7 // Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com)
8 // Portions Copyright © 2004,2006 Bruce Ellis
9 // Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net)
10 // Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others
11 // Portions Copyright © 2009 The Go Authors. All rights reserved.
13 // Permission is hereby granted, free of charge, to any person obtaining a copy
14 // of this software and associated documentation files (the "Software"), to deal
15 // in the Software without restriction, including without limitation the rights
16 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17 // copies of the Software, and to permit persons to whom the Software is
18 // furnished to do so, subject to the following conditions:
20 // The above copyright notice and this permission notice shall be included in
21 // all copies or substantial portions of the Software.
23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
41 var complements = []obj.As{
52 func (c *ctxt7) stacksplit(p *obj.Prog, framesize int32) *obj.Prog {
53 // MOV g_stackguard(g), R1
54 p = obj.Appendp(p, c.newprog)
57 p.From.Type = obj.TYPE_MEM
59 p.From.Offset = 2 * int64(c.ctxt.Arch.PtrSize) // G.stackguard0
61 p.From.Offset = 3 * int64(c.ctxt.Arch.PtrSize) // G.stackguard1
63 p.To.Type = obj.TYPE_REG
66 // Mark the stack bound check and morestack call async nonpreemptible.
67 // If we get preempted here, when resumed the preemption request is
68 // cleared, but we'll still call morestack, which will double the stack
69 // unnecessarily. See issue #35470.
70 p = c.ctxt.StartUnsafePoint(p, c.newprog)
73 if framesize <= objabi.StackSmall {
74 // small stack: SP < stackguard
77 p = obj.Appendp(p, c.newprog)
80 p.From.Type = obj.TYPE_REG
82 p.To.Type = obj.TYPE_REG
85 p = obj.Appendp(p, c.newprog)
87 p.From.Type = obj.TYPE_REG
90 } else if framesize <= objabi.StackBig {
91 // large stack: SP-framesize < stackguard-StackSmall
92 // SUB $(framesize-StackSmall), SP, R2
94 p = obj.Appendp(p, c.newprog)
97 p.From.Type = obj.TYPE_CONST
98 p.From.Offset = int64(framesize) - objabi.StackSmall
100 p.To.Type = obj.TYPE_REG
103 p = obj.Appendp(p, c.newprog)
105 p.From.Type = obj.TYPE_REG
109 // Such a large stack we need to protect against wraparound
110 // if SP is close to zero.
111 // SP-stackguard+StackGuard < framesize + (StackGuard-StackSmall)
112 // The +StackGuard on both sides is required to keep the left side positive:
113 // SP is allowed to be slightly below stackguard. See stack.h.
114 // CMP $StackPreempt, R1
115 // BEQ label_of_call_to_morestack
116 // ADD $StackGuard, SP, R2
118 // MOV $(framesize+(StackGuard-StackSmall)), R3
120 p = obj.Appendp(p, c.newprog)
123 p.From.Type = obj.TYPE_CONST
124 p.From.Offset = objabi.StackPreempt
127 p = obj.Appendp(p, c.newprog)
130 p.To.Type = obj.TYPE_BRANCH
132 p = obj.Appendp(p, c.newprog)
134 p.From.Type = obj.TYPE_CONST
135 p.From.Offset = int64(objabi.StackGuard)
137 p.To.Type = obj.TYPE_REG
140 p = obj.Appendp(p, c.newprog)
142 p.From.Type = obj.TYPE_REG
144 p.To.Type = obj.TYPE_REG
147 p = obj.Appendp(p, c.newprog)
149 p.From.Type = obj.TYPE_CONST
150 p.From.Offset = int64(framesize) + (int64(objabi.StackGuard) - objabi.StackSmall)
151 p.To.Type = obj.TYPE_REG
154 p = obj.Appendp(p, c.newprog)
156 p.From.Type = obj.TYPE_REG
162 bls := obj.Appendp(p, c.newprog)
164 bls.To.Type = obj.TYPE_BRANCH
166 end := c.ctxt.EndUnsafePoint(bls, c.newprog, -1)
169 for last = c.cursym.Func.Text; last.Link != nil; last = last.Link {
172 // Now we are at the end of the function, but logically
173 // we are still in function prologue. We need to fix the
174 // SP data and PCDATA.
175 spfix := obj.Appendp(last, c.newprog)
177 spfix.Spadj = -framesize
179 pcdata := c.ctxt.EmitEntryStackMap(c.cursym, spfix, c.newprog)
180 pcdata = c.ctxt.StartUnsafePoint(pcdata, c.newprog)
183 movlr := obj.Appendp(pcdata, c.newprog)
185 movlr.From.Type = obj.TYPE_REG
186 movlr.From.Reg = REGLINK
187 movlr.To.Type = obj.TYPE_REG
188 movlr.To.Reg = REG_R3
196 debug = obj.Appendp(debug, c.newprog)
198 debug.From.Type = obj.TYPE_CONST
199 debug.From.Offset = int64(framesize)
200 debug.To.Type = obj.TYPE_REG
201 debug.To.Reg = REGTMP
204 // BL runtime.morestack(SB)
205 call := obj.Appendp(debug, c.newprog)
207 call.To.Type = obj.TYPE_BRANCH
208 morestack := "runtime.morestack"
210 case c.cursym.CFunc():
211 morestack = "runtime.morestackc"
212 case !c.cursym.Func.Text.From.Sym.NeedCtxt():
213 morestack = "runtime.morestack_noctxt"
215 call.To.Sym = c.ctxt.Lookup(morestack)
217 pcdata = c.ctxt.EndUnsafePoint(call, c.newprog, -1)
220 jmp := obj.Appendp(pcdata, c.newprog)
222 jmp.To.Type = obj.TYPE_BRANCH
223 jmp.Pcond = c.cursym.Func.Text.Link
224 jmp.Spadj = +framesize
229 func progedit(ctxt *obj.Link, p *obj.Prog, newprog obj.ProgAlloc) {
230 c := ctxt7{ctxt: ctxt, newprog: newprog}
235 // $0 results in C_ZCON, which matches both C_REG and various
236 // C_xCON, however the C_REG cases in asmout don't expect a
237 // constant, so they will use the register fields and assemble
238 // a R0. To prevent that, rewrite $0 as ZR.
239 if p.From.Type == obj.TYPE_CONST && p.From.Offset == 0 {
240 p.From.Type = obj.TYPE_REG
243 if p.To.Type == obj.TYPE_CONST && p.To.Offset == 0 {
244 p.To.Type = obj.TYPE_REG
248 // Rewrite BR/BL to symbol as TYPE_BRANCH.
256 p.To.Type = obj.TYPE_BRANCH
261 // Rewrite float constants to values stored in memory.
264 if p.From.Type == obj.TYPE_FCONST {
265 f64 := p.From.Val.(float64)
267 if c.chipfloat7(f64) > 0 {
270 if math.Float32bits(f32) == 0 {
271 p.From.Type = obj.TYPE_REG
275 p.From.Type = obj.TYPE_MEM
276 p.From.Sym = c.ctxt.Float32Sym(f32)
277 p.From.Name = obj.NAME_EXTERN
282 if p.From.Type == obj.TYPE_FCONST {
283 f64 := p.From.Val.(float64)
284 if c.chipfloat7(f64) > 0 {
287 if math.Float64bits(f64) == 0 {
288 p.From.Type = obj.TYPE_REG
292 p.From.Type = obj.TYPE_MEM
293 p.From.Sym = c.ctxt.Float64Sym(f64)
294 p.From.Name = obj.NAME_EXTERN
301 // Rewrite negative immediates as positive immediates with
302 // complementary instruction.
304 case AADD, ASUB, ACMP, ACMN:
305 if p.From.Type == obj.TYPE_CONST && p.From.Offset < 0 && p.From.Offset != -1<<63 {
306 p.From.Offset = -p.From.Offset
307 p.As = complements[p.As]
309 case AADDW, ASUBW, ACMPW, ACMNW:
310 if p.From.Type == obj.TYPE_CONST && p.From.Offset < 0 && int32(p.From.Offset) != -1<<31 {
311 p.From.Offset = -p.From.Offset
312 p.As = complements[p.As]
316 // For 32-bit logical instruction with constant,
317 // rewrite the high 32-bit to be a repetition of
318 // the low 32-bit, so that the BITCON test can be
319 // shared for both 32-bit and 64-bit. 32-bit ops
320 // will zero the high 32-bit of the destination
322 if isANDWop(p.As) && p.From.Type == obj.TYPE_CONST {
323 v := p.From.Offset & 0xffffffff
324 p.From.Offset = v | v<<32
327 if c.ctxt.Flag_dynlink {
332 // Rewrite p, if necessary, to access global data via the global offset table.
333 func (c *ctxt7) rewriteToUseGot(p *obj.Prog) {
334 if p.As == obj.ADUFFCOPY || p.As == obj.ADUFFZERO {
337 // MOVD runtime.duffxxx@GOT, REGTMP
338 // ADD $offset, REGTMP
341 if p.As == obj.ADUFFZERO {
342 sym = c.ctxt.Lookup("runtime.duffzero")
344 sym = c.ctxt.Lookup("runtime.duffcopy")
346 offset := p.To.Offset
348 p.From.Type = obj.TYPE_MEM
349 p.From.Name = obj.NAME_GOTREF
351 p.To.Type = obj.TYPE_REG
353 p.To.Name = obj.NAME_NONE
356 p1 := obj.Appendp(p, c.newprog)
358 p1.From.Type = obj.TYPE_CONST
359 p1.From.Offset = offset
360 p1.To.Type = obj.TYPE_REG
362 p2 := obj.Appendp(p1, c.newprog)
364 p2.To.Type = obj.TYPE_REG
368 // We only care about global data: NAME_EXTERN means a global
369 // symbol in the Go sense, and p.Sym.Local is true for a few
370 // internally defined symbols.
371 if p.From.Type == obj.TYPE_ADDR && p.From.Name == obj.NAME_EXTERN && !p.From.Sym.Local() {
372 // MOVD $sym, Rx becomes MOVD sym@GOT, Rx
373 // MOVD $sym+<off>, Rx becomes MOVD sym@GOT, Rx; ADD <off>, Rx
375 c.ctxt.Diag("do not know how to handle TYPE_ADDR in %v with -dynlink", p)
377 if p.To.Type != obj.TYPE_REG {
378 c.ctxt.Diag("do not know how to handle LEAQ-type insn to non-register in %v with -dynlink", p)
380 p.From.Type = obj.TYPE_MEM
381 p.From.Name = obj.NAME_GOTREF
382 if p.From.Offset != 0 {
383 q := obj.Appendp(p, c.newprog)
385 q.From.Type = obj.TYPE_CONST
386 q.From.Offset = p.From.Offset
391 if p.GetFrom3() != nil && p.GetFrom3().Name == obj.NAME_EXTERN {
392 c.ctxt.Diag("don't know how to handle %v with -dynlink", p)
395 // MOVx sym, Ry becomes MOVD sym@GOT, REGTMP; MOVx (REGTMP), Ry
396 // MOVx Ry, sym becomes MOVD sym@GOT, REGTMP; MOVD Ry, (REGTMP)
397 // An addition may be inserted between the two MOVs if there is an offset.
398 if p.From.Name == obj.NAME_EXTERN && !p.From.Sym.Local() {
399 if p.To.Name == obj.NAME_EXTERN && !p.To.Sym.Local() {
400 c.ctxt.Diag("cannot handle NAME_EXTERN on both sides in %v with -dynlink", p)
403 } else if p.To.Name == obj.NAME_EXTERN && !p.To.Sym.Local() {
408 if p.As == obj.ATEXT || p.As == obj.AFUNCDATA || p.As == obj.ACALL || p.As == obj.ARET || p.As == obj.AJMP {
411 if source.Sym.Type == objabi.STLSBSS {
414 if source.Type != obj.TYPE_MEM {
415 c.ctxt.Diag("don't know how to handle %v with -dynlink", p)
417 p1 := obj.Appendp(p, c.newprog)
418 p2 := obj.Appendp(p1, c.newprog)
420 p1.From.Type = obj.TYPE_MEM
421 p1.From.Sym = source.Sym
422 p1.From.Name = obj.NAME_GOTREF
423 p1.To.Type = obj.TYPE_REG
429 if p.From.Name == obj.NAME_EXTERN {
431 p2.From.Name = obj.NAME_NONE
433 } else if p.To.Name == obj.NAME_EXTERN {
435 p2.To.Name = obj.NAME_NONE
443 func preprocess(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
444 if cursym.Func.Text == nil || cursym.Func.Text.Link == nil {
448 c := ctxt7{ctxt: ctxt, newprog: newprog, cursym: cursym}
450 p := c.cursym.Func.Text
451 textstksiz := p.To.Offset
452 if textstksiz == -8 {
453 // Historical way to mark NOFRAME.
454 p.From.Sym.Set(obj.AttrNoFrame, true)
458 c.ctxt.Diag("negative frame size %d - did you mean NOFRAME?", textstksiz)
460 if p.From.Sym.NoFrame() {
462 c.ctxt.Diag("NOFRAME functions must have a frame size of 0, not %d", textstksiz)
466 c.cursym.Func.Args = p.To.Val.(int32)
467 c.cursym.Func.Locals = int32(textstksiz)
470 * find leaf subroutines
472 for p := c.cursym.Func.Text; p != nil; p = p.Link {
480 c.cursym.Func.Text.Mark &^= LEAF
487 for p := c.cursym.Func.Text; p != nil; p = p.Link {
491 c.cursym.Func.Text = p
492 c.autosize = int32(textstksiz)
494 if p.Mark&LEAF != 0 && c.autosize == 0 {
495 // A leaf function with no locals has no frame.
496 p.From.Sym.Set(obj.AttrNoFrame, true)
499 if !p.From.Sym.NoFrame() {
500 // If there is a stack frame at all, it includes
501 // space to save the LR.
506 extrasize := int32(0)
507 if c.autosize%16 == 8 {
508 // Allocate extra 8 bytes on the frame top to save FP
510 } else if c.autosize&(16-1) == 0 {
511 // Allocate extra 16 bytes to save FP for the old frame whose size is 8 mod 16
514 c.ctxt.Diag("%v: unaligned frame size %d - must be 16 aligned", p, c.autosize-8)
516 c.autosize += extrasize
517 c.cursym.Func.Locals += extrasize
519 // low 32 bits for autosize
520 // high 32 bits for extrasize
521 p.To.Offset = int64(c.autosize) | int64(extrasize)<<32
527 if c.autosize == 0 && c.cursym.Func.Text.Mark&LEAF == 0 {
528 if c.ctxt.Debugvlog {
529 c.ctxt.Logf("save suppressed in: %s\n", c.cursym.Func.Text.From.Sym.Name)
531 c.cursym.Func.Text.Mark |= LEAF
534 if cursym.Func.Text.Mark&LEAF != 0 {
535 cursym.Set(obj.AttrLeaf, true)
536 if p.From.Sym.NoFrame() {
541 if !p.From.Sym.NoSplit() {
542 p = c.stacksplit(p, c.autosize) // emit split check
545 var prologueEnd *obj.Prog
547 aoffset := c.autosize
552 // Frame is non-empty. Make sure to save link register, even if
553 // it is a leaf function, so that traceback works.
555 if c.autosize > aoffset {
556 // Frame size is too large for a MOVD.W instruction.
557 // Store link register before decrementing SP, so if a signal comes
558 // during the execution of the function prologue, the traceback
559 // code will not see a half-updated stack frame.
560 // This sequence is not async preemptible, as if we open a frame
561 // at the current SP, it will clobber the saved LR.
562 q = c.ctxt.StartUnsafePoint(q, c.newprog)
564 q = obj.Appendp(q, c.newprog)
567 q.From.Type = obj.TYPE_CONST
568 q.From.Offset = int64(c.autosize)
570 q.To.Type = obj.TYPE_REG
575 q = obj.Appendp(q, c.newprog)
578 q.From.Type = obj.TYPE_REG
580 q.To.Type = obj.TYPE_MEM
583 q1 = obj.Appendp(q, c.newprog)
586 q1.From.Type = obj.TYPE_REG
588 q1.To.Type = obj.TYPE_REG
590 q1.Spadj = c.autosize
592 if c.ctxt.Headtype == objabi.Hdarwin {
593 // iOS does not support SA_ONSTACK. We will run the signal handler
594 // on the G stack. If we write below SP, it may be clobbered by
595 // the signal handler. So we save LR after decrementing SP.
596 q1 = obj.Appendp(q1, c.newprog)
599 q1.From.Type = obj.TYPE_REG
600 q1.From.Reg = REGLINK
601 q1.To.Type = obj.TYPE_MEM
605 q1 = c.ctxt.EndUnsafePoint(q1, c.newprog, -1)
607 // small frame, update SP and save LR in a single MOVD.W instruction
608 q1 = obj.Appendp(q, c.newprog)
611 q1.From.Type = obj.TYPE_REG
612 q1.From.Reg = REGLINK
613 q1.To.Type = obj.TYPE_MEM
615 q1.To.Offset = int64(-aoffset)
622 prologueEnd.Pos = prologueEnd.Pos.WithXlogue(src.PosPrologueEnd)
624 if objabi.Framepointer_enabled(objabi.GOOS, objabi.GOARCH) {
625 q1 = obj.Appendp(q1, c.newprog)
628 q1.From.Type = obj.TYPE_REG
630 q1.To.Type = obj.TYPE_MEM
634 q1 = obj.Appendp(q1, c.newprog)
637 q1.From.Type = obj.TYPE_CONST
640 q1.To.Type = obj.TYPE_REG
644 if c.cursym.Func.Text.From.Sym.Wrapper() {
645 // if(g->panic != nil && g->panic->argp == FP) g->panic->argp = bottom-of-frame
647 // MOV g_panic(g), R1
651 // ... function body ...
653 // MOV panic_argp(R1), R2
654 // ADD $(autosize+8), RSP, R3
658 // MOVD R4, panic_argp(R1)
661 // The NOP is needed to give the jumps somewhere to land.
662 // It is a liblink NOP, not an ARM64 NOP: it encodes to 0 instruction bytes.
665 // MOV g_panic(g), R1
666 q = obj.Appendp(q, c.newprog)
668 q.From.Type = obj.TYPE_MEM
670 q.From.Offset = 4 * int64(c.ctxt.Arch.PtrSize) // G.panic
671 q.To.Type = obj.TYPE_REG
674 // CBNZ R1, checkargp
675 cbnz := obj.Appendp(q, c.newprog)
677 cbnz.From.Type = obj.TYPE_REG
678 cbnz.From.Reg = REG_R1
679 cbnz.To.Type = obj.TYPE_BRANCH
681 // Empty branch target at the top of the function body
682 end := obj.Appendp(cbnz, c.newprog)
685 // find the end of the function
687 for last = end; last.Link != nil; last = last.Link {
690 // MOV panic_argp(R1), R2
691 mov := obj.Appendp(last, c.newprog)
693 mov.From.Type = obj.TYPE_MEM
694 mov.From.Reg = REG_R1
695 mov.From.Offset = 0 // Panic.argp
696 mov.To.Type = obj.TYPE_REG
699 // CBNZ branches to the MOV above
702 // ADD $(autosize+8), SP, R3
703 q = obj.Appendp(mov, c.newprog)
705 q.From.Type = obj.TYPE_CONST
706 q.From.Offset = int64(c.autosize) + 8
708 q.To.Type = obj.TYPE_REG
712 q = obj.Appendp(q, c.newprog)
714 q.From.Type = obj.TYPE_REG
719 q = obj.Appendp(q, c.newprog)
721 q.To.Type = obj.TYPE_BRANCH
725 q = obj.Appendp(q, c.newprog)
727 q.From.Type = obj.TYPE_CONST
730 q.To.Type = obj.TYPE_REG
733 // MOV R4, panic_argp(R1)
734 q = obj.Appendp(q, c.newprog)
736 q.From.Type = obj.TYPE_REG
738 q.To.Type = obj.TYPE_MEM
740 q.To.Offset = 0 // Panic.argp
743 q = obj.Appendp(q, c.newprog)
745 q.To.Type = obj.TYPE_BRANCH
751 if p.From.Type == obj.TYPE_CONST {
752 c.ctxt.Diag("using BECOME (%v) is not supported!", p)
758 if c.cursym.Func.Text.Mark&LEAF != 0 {
761 p.From.Type = obj.TYPE_CONST
762 p.From.Offset = int64(c.autosize)
763 p.To.Type = obj.TYPE_REG
765 p.Spadj = -c.autosize
767 if objabi.Framepointer_enabled(objabi.GOOS, objabi.GOARCH) {
768 p = obj.Appendp(p, c.newprog)
770 p.From.Type = obj.TYPE_CONST
773 p.To.Type = obj.TYPE_REG
778 /* want write-back pre-indexed SP+autosize -> SP, loading REGLINK*/
780 if objabi.Framepointer_enabled(objabi.GOOS, objabi.GOARCH) {
782 p.From.Type = obj.TYPE_MEM
785 p.To.Type = obj.TYPE_REG
787 p = obj.Appendp(p, c.newprog)
790 aoffset := c.autosize
794 p.From.Type = obj.TYPE_MEM
796 p.From.Offset = int64(aoffset)
798 p.To.Type = obj.TYPE_REG
803 p.From.Type = obj.TYPE_MEM
806 p.To.Type = obj.TYPE_REG
811 q.From.Type = obj.TYPE_CONST
812 q.From.Offset = int64(aoffset)
813 q.To.Type = obj.TYPE_REG
816 q.Spadj = int32(-q.From.Offset)
823 if p.As != obj.ARET {
831 if retjmp != nil { // retjmp
833 p.To.Type = obj.TYPE_BRANCH
835 p.Spadj = +c.autosize
840 p.To.Type = obj.TYPE_MEM
843 p.Spadj = +c.autosize
846 if p.To.Type == obj.TYPE_REG && p.To.Reg == REGSP && p.From.Type == obj.TYPE_CONST {
848 p.Spadj = int32(-p.From.Offset)
850 p.Spadj = int32(+p.From.Offset)
854 case obj.AGETCALLERPC:
858 p.From.Type = obj.TYPE_REG
863 p.From.Type = obj.TYPE_MEM
868 if objabi.Framepointer_enabled(objabi.GOOS, objabi.GOARCH) {
870 // STP (FP, R27), -24(SP)
877 // copy DUFFCOPY from q1 to q4
878 q4 := obj.Appendp(p, c.newprog)
880 q4.As = obj.ADUFFCOPY
884 q1.From.Type = obj.TYPE_BRANCH
885 q1.To.Type = obj.TYPE_REG
888 q2 := obj.Appendp(q1, c.newprog)
891 q2.From.Type = obj.TYPE_REGREG
893 q2.From.Offset = int64(REG_R27)
894 q2.To.Type = obj.TYPE_MEM
898 // maintaine FP for DUFFCOPY
899 q3 := obj.Appendp(q2, c.newprog)
902 q3.From.Type = obj.TYPE_CONST
905 q3.To.Type = obj.TYPE_REG
908 q5 := obj.Appendp(q4, c.newprog)
911 q5.From.Type = obj.TYPE_CONST
914 q5.To.Type = obj.TYPE_REG
921 if objabi.Framepointer_enabled(objabi.GOOS, objabi.GOARCH) {
923 // STP (FP, R27), -24(SP)
930 // copy DUFFZERO from q1 to q4
931 q4 := obj.Appendp(p, c.newprog)
933 q4.As = obj.ADUFFZERO
937 q1.From.Type = obj.TYPE_BRANCH
938 q1.To.Type = obj.TYPE_REG
941 q2 := obj.Appendp(q1, c.newprog)
944 q2.From.Type = obj.TYPE_REGREG
946 q2.From.Offset = int64(REG_R27)
947 q2.To.Type = obj.TYPE_MEM
951 // maintaine FP for DUFFZERO
952 q3 := obj.Appendp(q2, c.newprog)
955 q3.From.Type = obj.TYPE_CONST
958 q3.To.Type = obj.TYPE_REG
961 q5 := obj.Appendp(q4, c.newprog)
964 q5.From.Type = obj.TYPE_CONST
967 q5.To.Type = obj.TYPE_REG
976 func nocache(p *obj.Prog) {
982 var unaryDst = map[obj.As]bool{
990 var Linkarm64 = obj.LinkArch{
993 Preprocess: preprocess,
997 DWARFRegisters: ARM64DWARFRegisters,