1
0
mirror of https://github.com/golang/go synced 2024-11-21 22:04:39 -07:00

6l, 8l: remove JCXZ; add JCXZW, JCXZL, and JCXZQ

R=golang-dev
CC=golang-dev, rsc
https://golang.org/cl/4950050
This commit is contained in:
Jaroslavas Počepko 2011-08-26 17:45:19 -04:00 committed by Russ Cox
parent f6a9807f56
commit a88994f804
8 changed files with 28 additions and 9 deletions

View File

@ -456,8 +456,8 @@ struct
"JGT", LTYPER, AJGT,
"JG", LTYPER, AJGT, /* alternate */
"JNLE", LTYPER, AJGT, /* alternate */
"JCXZ", LTYPER, AJCXZ,
"JCXZL", LTYPER, AJCXZL,
"JCXZQ", LTYPER, AJCXZQ,
"JMP", LTYPEC, AJMP,
"LAHF", LTYPE0, ALAHF,
"LARL", LTYPE3, ALARL,

View File

@ -121,7 +121,7 @@ enum as
AIRETW,
AJCC,
AJCS,
AJCXZ,
AJCXZL,
AJEQ,
AJGE,
AJGT,
@ -487,6 +487,7 @@ enum as
AIDIVQ,
AIMULQ,
AIRETQ,
AJCXZQ,
ALEAQ,
ALEAVEQ,
ALODSQ,

View File

@ -788,7 +788,8 @@ Optab optab[] =
{ AIRETW, ynone, Pe, 0xcf },
{ AJCC, yjcond, Px, 0x73,0x83,(00) },
{ AJCS, yjcond, Px, 0x72,0x82 },
{ AJCXZ, yloop, Px, 0xe3 },
{ AJCXZL, yloop, Px, 0xe3 },
{ AJCXZQ, yloop, Px, 0xe3 },
{ AJEQ, yjcond, Px, 0x74,0x84 },
{ AJGE, yjcond, Px, 0x7d,0x8d },
{ AJGT, yjcond, Px, 0x7f,0x8f },

View File

@ -88,7 +88,10 @@ span1(Sym *s)
loop++;
q->back ^= 2;
}
s->p[q->pc+1] = v;
if(q->as == AJCXZL)
s->p[q->pc+2] = v;
else
s->p[q->pc+1] = v;
} else {
bp = s->p + q->pc + q->mark - 4;
*bp++ = v;
@ -1467,6 +1470,8 @@ found:
if(p->back & 1) {
v = q->pc - (p->pc + 2);
if(v >= -128) {
if(p->as == AJCXZL)
*andptr++ = 0x67;
*andptr++ = op;
*andptr++ = v;
} else if(t[2] == Zloop) {
@ -1490,6 +1495,8 @@ found:
p->forwd = q->comefrom;
q->comefrom = p;
if(p->back & 2) { // short
if(p->as == AJCXZL)
*andptr++ = 0x67;
*andptr++ = op;
*andptr++ = 0;
} else if(t[2] == Zloop) {

View File

@ -371,7 +371,8 @@ struct
"JG", LTYPER, AJGT, /* alternate */
"JNLE", LTYPER, AJGT, /* alternate */
"JCXZ", LTYPER, AJCXZ,
"JCXZL", LTYPER, AJCXZL,
"JCXZW", LTYPER, AJCXZW,
"JMP", LTYPEC, AJMP,
"LAHF", LTYPE0, ALAHF,
"LARL", LTYPE3, ALARL,

View File

@ -115,7 +115,8 @@ enum as
AIRETW,
AJCC,
AJCS,
AJCXZ,
AJCXZL,
AJCXZW,
AJEQ,
AJGE,
AJGT,

View File

@ -430,7 +430,8 @@ Optab optab[] =
{ AIRETW, ynone, Pe, 0xcf },
{ AJCC, yjcond, Px, 0x73,0x83,(00) },
{ AJCS, yjcond, Px, 0x72,0x82 },
{ AJCXZ, yloop, Px, 0xe3 },
{ AJCXZL, yloop, Px, 0xe3 },
{ AJCXZW, yloop, Px, 0xe3 },
{ AJEQ, yjcond, Px, 0x74,0x84 },
{ AJGE, yjcond, Px, 0x7d,0x8d },
{ AJGT, yjcond, Px, 0x7f,0x8f },

View File

@ -83,7 +83,10 @@ span1(Sym *s)
loop++;
q->back ^= 2;
}
s->p[q->pc+1] = v;
if(q->as == AJCXZW)
s->p[q->pc+2] = v;
else
s->p[q->pc+1] = v;
} else {
bp = s->p + q->pc + q->mark - 4;
*bp++ = v;
@ -1085,6 +1088,8 @@ found:
if(p->back & 1) {
v = q->pc - (p->pc + 2);
if(v >= -128) {
if(p->as == AJCXZW)
*andptr++ = 0x67;
*andptr++ = op;
*andptr++ = v;
} else if(t[2] == Zloop) {
@ -1108,6 +1113,8 @@ found:
p->forwd = q->comefrom;
q->comefrom = p;
if(p->back & 2) { // short
if(p->as == AJCXZW)
*andptr++ = 0x67;
*andptr++ = op;
*andptr++ = 0;
} else if(t[2] == Zloop) {