Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(648)

Delta Between Two Patch Sets: src/cmd/6g/cgen.c

Issue 81370046: code review 81370046: runtime: get rid of most uses of REP for copying/zeroing. (Closed)
Left Patch Set: diff -r a70a32dc121a https://khr%40golang.org@code.google.com/p/go/ Created 11 years ago
Right Patch Set: diff -r 1427fb6bcfa3 https://khr%40golang.org@code.google.com/p/go/ Created 11 years ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | src/cmd/6g/ggen.c » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 #include <u.h> 5 #include <u.h>
6 #include <libc.h> 6 #include <libc.h>
7 #include "gg.h" 7 #include "gg.h"
8 8
9 /* 9 /*
10 * generate: 10 * generate:
(...skipping 1438 matching lines...) Expand 10 before | Expand all | Expand 10 after
1449 } else { 1449 } else {
1450 // normal direction 1450 // normal direction
1451 if(q > 128) { 1451 if(q > 128) {
1452 gconreg(movptr, q, D_CX); 1452 gconreg(movptr, q, D_CX);
1453 gins(AREP, N, N); // repeat 1453 gins(AREP, N, N); // repeat
1454 gins(AMOVSQ, N, N); // MOVQ *(SI)+,*(DI)+ 1454 gins(AMOVSQ, N, N); // MOVQ *(SI)+,*(DI)+
1455 } else if (q >= 4) { 1455 } else if (q >= 4) {
1456 p = gins(ADUFFCOPY, N, N); 1456 p = gins(ADUFFCOPY, N, N);
1457 p->to.type = D_ADDR; 1457 p->to.type = D_ADDR;
1458 p->to.sym = linksym(pkglookup("duffcopy", runtimepkg)); 1458 p->to.sym = linksym(pkglookup("duffcopy", runtimepkg));
1459 » » » // 14 = magic constant: see ../../pkg/runtime/asm_amd64. s 1459 » » » // 14 and 128 = magic constants: see ../../pkg/runtime/a sm_amd64.s
1460 p->to.offset = 14*(128-q); 1460 p->to.offset = 14*(128-q);
1461 } else 1461 } else
1462 while(q > 0) { 1462 while(q > 0) {
1463 gins(AMOVSQ, N, N); // MOVQ *(SI)+,*(DI)+ 1463 gins(AMOVSQ, N, N); // MOVQ *(SI)+,*(DI)+
1464 q--; 1464 q--;
1465 } 1465 }
1466 // copy the remaining c bytes 1466 // copy the remaining c bytes
1467 if(w < 4 || c <= 1 || (odst < osrc && osrc < odst+w)) { 1467 if(w < 4 || c <= 1 || (odst < osrc && osrc < odst+w)) {
1468 while(c > 0) { 1468 while(c > 0) {
1469 gins(AMOVSB, N, N); // MOVB *(SI)+,*(DI)+ 1469 gins(AMOVSB, N, N); // MOVB *(SI)+,*(DI)+
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
1721 regfree(&nodl); 1721 regfree(&nodl);
1722 return 0; 1722 return 0;
1723 1723
1724 yes: 1724 yes:
1725 if(freer) 1725 if(freer)
1726 regfree(&nodr); 1726 regfree(&nodr);
1727 if(freel) 1727 if(freel)
1728 regfree(&nodl); 1728 regfree(&nodl);
1729 return 1; 1729 return 1;
1730 } 1730 }
LEFTRIGHT
« no previous file | src/cmd/6g/ggen.c » ('j') | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b