OLD | NEW |
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 #undef EXTERN | 5 #undef EXTERN |
6 #define EXTERN | 6 #define EXTERN |
7 #include <u.h> | 7 #include <u.h> |
8 #include <libc.h> | 8 #include <libc.h> |
9 #include "gg.h" | 9 #include "gg.h" |
10 #include "opt.h" | 10 #include "opt.h" |
(...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
936 cgenr(nr, &n2, N); | 936 cgenr(nr, &n2, N); |
937 nodreg(&ax, t, D_AX); | 937 nodreg(&ax, t, D_AX); |
938 gmove(&n1, &ax); | 938 gmove(&n1, &ax); |
939 gins(a, &n2, N); | 939 gins(a, &n2, N); |
940 regfree(&n2); | 940 regfree(&n2); |
941 regfree(&n1); | 941 regfree(&n1); |
942 | 942 |
943 if(t->width == 1) { | 943 if(t->width == 1) { |
944 // byte multiply behaves differently. | 944 // byte multiply behaves differently. |
945 nodreg(&ax, t, D_AH); | 945 nodreg(&ax, t, D_AH); |
946 » » nodreg(&dx, t, D_DL); | 946 » » nodreg(&dx, t, D_DX); |
947 gmove(&ax, &dx); | 947 gmove(&ax, &dx); |
948 } | 948 } |
949 nodreg(&dx, t, D_DX); | 949 nodreg(&dx, t, D_DX); |
950 gmove(&dx, res); | 950 gmove(&dx, res); |
951 } | 951 } |
952 | 952 |
953 /* | 953 /* |
954 * generate shift according to op, one of: | 954 * generate shift according to op, one of: |
955 * res = nl << nr | 955 * res = nl << nr |
956 * res = nl >> nr | 956 * res = nl >> nr |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1210 // which will be shorter to encode than plain 0. | 1210 // which will be shorter to encode than plain 0. |
1211 p2->as = AMOVL; | 1211 p2->as = AMOVL; |
1212 p2->from.type = D_AX; | 1212 p2->from.type = D_AX; |
1213 if(regtyp(&p->from)) | 1213 if(regtyp(&p->from)) |
1214 p2->to.type = p->from.type + D_INDIR; | 1214 p2->to.type = p->from.type + D_INDIR; |
1215 else | 1215 else |
1216 p2->to.type = D_INDIR+D_NONE; | 1216 p2->to.type = D_INDIR+D_NONE; |
1217 p2->to.offset = 0; | 1217 p2->to.offset = 0; |
1218 } | 1218 } |
1219 } | 1219 } |
OLD | NEW |