OLD | NEW |
1 // Copyright 2013 The Go Authors. All rights reserved. | 1 // Copyright 2013 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 #include "opt.h" | 8 #include "opt.h" |
9 | 9 |
10 enum | 10 enum |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 [AMOVDW]= {SizeL | LeftRead | RightWrite | Conv}, | 86 [AMOVDW]= {SizeL | LeftRead | RightWrite | Conv}, |
87 [AMOVFD]= {SizeD | LeftRead | RightWrite | Conv}, | 87 [AMOVFD]= {SizeD | LeftRead | RightWrite | Conv}, |
88 [AMOVFW]= {SizeL | LeftRead | RightWrite | Conv}, | 88 [AMOVFW]= {SizeL | LeftRead | RightWrite | Conv}, |
89 | 89 |
90 // Moves. | 90 // Moves. |
91 [AMOVB]= {SizeB | LeftRead | RightWrite | Move}, | 91 [AMOVB]= {SizeB | LeftRead | RightWrite | Move}, |
92 [AMOVD]= {SizeD | LeftRead | RightWrite | Move}, | 92 [AMOVD]= {SizeD | LeftRead | RightWrite | Move}, |
93 [AMOVF]= {SizeF | LeftRead | RightWrite | Move}, | 93 [AMOVF]= {SizeF | LeftRead | RightWrite | Move}, |
94 [AMOVH]= {SizeW | LeftRead | RightWrite | Move}, | 94 [AMOVH]= {SizeW | LeftRead | RightWrite | Move}, |
95 [AMOVW]= {SizeL | LeftRead | RightWrite | Move}, | 95 [AMOVW]= {SizeL | LeftRead | RightWrite | Move}, |
| 96 // In addtion, duffzero reads R0,R1 and writes R1. This fact is |
| 97 // encoded in peep.c |
| 98 [ADUFFZERO]= {Call}, |
| 99 // In addtion, duffcopy reads R1,R2 and writes R0,R1,R2. This fact is |
| 100 // encoded in peep.c |
| 101 [ADUFFCOPY]= {Call}, |
96 | 102 |
97 // These should be split into the two different conversions instead | 103 // These should be split into the two different conversions instead |
98 // of overloading the one. | 104 // of overloading the one. |
99 [AMOVBS]= {SizeB | LeftRead | RightWrite | Conv}, | 105 [AMOVBS]= {SizeB | LeftRead | RightWrite | Conv}, |
100 [AMOVBU]= {SizeB | LeftRead | RightWrite | Conv}, | 106 [AMOVBU]= {SizeB | LeftRead | RightWrite | Conv}, |
101 [AMOVHS]= {SizeW | LeftRead | RightWrite | Conv}, | 107 [AMOVHS]= {SizeW | LeftRead | RightWrite | Conv}, |
102 [AMOVHU]= {SizeW | LeftRead | RightWrite | Conv}, | 108 [AMOVHU]= {SizeW | LeftRead | RightWrite | Conv}, |
103 ········ | 109 ········ |
104 // Jumps. | 110 // Jumps. |
105 [AB]= {Jump | Break}, | 111 [AB]= {Jump | Break}, |
(...skipping 30 matching lines...) Expand all Loading... |
136 } | 142 } |
137 | 143 |
138 if((info->flags & RegRead) && p->reg == NREG) { | 144 if((info->flags & RegRead) && p->reg == NREG) { |
139 info->flags &= ~RegRead; | 145 info->flags &= ~RegRead; |
140 info->flags |= CanRegRead | RightRead; | 146 info->flags |= CanRegRead | RightRead; |
141 } | 147 } |
142 ········ | 148 ········ |
143 if(((p->scond & C_SCOND) != C_SCOND_NONE) && (info->flags & RightWrite)) | 149 if(((p->scond & C_SCOND) != C_SCOND_NONE) && (info->flags & RightWrite)) |
144 info->flags |= RightRead; | 150 info->flags |= RightRead; |
145 } | 151 } |
OLD | NEW |