Commit a88994f8 authored by Jaroslavas Počepko's avatar Jaroslavas Počepko Committed by Russ Cox

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

R=golang-dev
CC=golang-dev, rsc
https://golang.org/cl/4950050
parent f6a9807f
...@@ -456,8 +456,8 @@ struct ...@@ -456,8 +456,8 @@ struct
"JGT", LTYPER, AJGT, "JGT", LTYPER, AJGT,
"JG", LTYPER, AJGT, /* alternate */ "JG", LTYPER, AJGT, /* alternate */
"JNLE", LTYPER, AJGT, /* alternate */ "JNLE", LTYPER, AJGT, /* alternate */
"JCXZL", LTYPER, AJCXZL,
"JCXZ", LTYPER, AJCXZ, "JCXZQ", LTYPER, AJCXZQ,
"JMP", LTYPEC, AJMP, "JMP", LTYPEC, AJMP,
"LAHF", LTYPE0, ALAHF, "LAHF", LTYPE0, ALAHF,
"LARL", LTYPE3, ALARL, "LARL", LTYPE3, ALARL,
......
...@@ -121,7 +121,7 @@ enum as ...@@ -121,7 +121,7 @@ enum as
AIRETW, AIRETW,
AJCC, AJCC,
AJCS, AJCS,
AJCXZ, AJCXZL,
AJEQ, AJEQ,
AJGE, AJGE,
AJGT, AJGT,
...@@ -487,6 +487,7 @@ enum as ...@@ -487,6 +487,7 @@ enum as
AIDIVQ, AIDIVQ,
AIMULQ, AIMULQ,
AIRETQ, AIRETQ,
AJCXZQ,
ALEAQ, ALEAQ,
ALEAVEQ, ALEAVEQ,
ALODSQ, ALODSQ,
......
...@@ -788,7 +788,8 @@ Optab optab[] = ...@@ -788,7 +788,8 @@ Optab optab[] =
{ AIRETW, ynone, Pe, 0xcf }, { AIRETW, ynone, Pe, 0xcf },
{ AJCC, yjcond, Px, 0x73,0x83,(00) }, { AJCC, yjcond, Px, 0x73,0x83,(00) },
{ AJCS, yjcond, Px, 0x72,0x82 }, { AJCS, yjcond, Px, 0x72,0x82 },
{ AJCXZ, yloop, Px, 0xe3 }, { AJCXZL, yloop, Px, 0xe3 },
{ AJCXZQ, yloop, Px, 0xe3 },
{ AJEQ, yjcond, Px, 0x74,0x84 }, { AJEQ, yjcond, Px, 0x74,0x84 },
{ AJGE, yjcond, Px, 0x7d,0x8d }, { AJGE, yjcond, Px, 0x7d,0x8d },
{ AJGT, yjcond, Px, 0x7f,0x8f }, { AJGT, yjcond, Px, 0x7f,0x8f },
......
...@@ -88,6 +88,9 @@ span1(Sym *s) ...@@ -88,6 +88,9 @@ span1(Sym *s)
loop++; loop++;
q->back ^= 2; q->back ^= 2;
} }
if(q->as == AJCXZL)
s->p[q->pc+2] = v;
else
s->p[q->pc+1] = v; s->p[q->pc+1] = v;
} else { } else {
bp = s->p + q->pc + q->mark - 4; bp = s->p + q->pc + q->mark - 4;
...@@ -1467,6 +1470,8 @@ found: ...@@ -1467,6 +1470,8 @@ found:
if(p->back & 1) { if(p->back & 1) {
v = q->pc - (p->pc + 2); v = q->pc - (p->pc + 2);
if(v >= -128) { if(v >= -128) {
if(p->as == AJCXZL)
*andptr++ = 0x67;
*andptr++ = op; *andptr++ = op;
*andptr++ = v; *andptr++ = v;
} else if(t[2] == Zloop) { } else if(t[2] == Zloop) {
...@@ -1490,6 +1495,8 @@ found: ...@@ -1490,6 +1495,8 @@ found:
p->forwd = q->comefrom; p->forwd = q->comefrom;
q->comefrom = p; q->comefrom = p;
if(p->back & 2) { // short if(p->back & 2) { // short
if(p->as == AJCXZL)
*andptr++ = 0x67;
*andptr++ = op; *andptr++ = op;
*andptr++ = 0; *andptr++ = 0;
} else if(t[2] == Zloop) { } else if(t[2] == Zloop) {
......
...@@ -371,7 +371,8 @@ struct ...@@ -371,7 +371,8 @@ struct
"JG", LTYPER, AJGT, /* alternate */ "JG", LTYPER, AJGT, /* alternate */
"JNLE", LTYPER, AJGT, /* alternate */ "JNLE", LTYPER, AJGT, /* alternate */
"JCXZ", LTYPER, AJCXZ, "JCXZL", LTYPER, AJCXZL,
"JCXZW", LTYPER, AJCXZW,
"JMP", LTYPEC, AJMP, "JMP", LTYPEC, AJMP,
"LAHF", LTYPE0, ALAHF, "LAHF", LTYPE0, ALAHF,
"LARL", LTYPE3, ALARL, "LARL", LTYPE3, ALARL,
......
...@@ -115,7 +115,8 @@ enum as ...@@ -115,7 +115,8 @@ enum as
AIRETW, AIRETW,
AJCC, AJCC,
AJCS, AJCS,
AJCXZ, AJCXZL,
AJCXZW,
AJEQ, AJEQ,
AJGE, AJGE,
AJGT, AJGT,
......
...@@ -430,7 +430,8 @@ Optab optab[] = ...@@ -430,7 +430,8 @@ Optab optab[] =
{ AIRETW, ynone, Pe, 0xcf }, { AIRETW, ynone, Pe, 0xcf },
{ AJCC, yjcond, Px, 0x73,0x83,(00) }, { AJCC, yjcond, Px, 0x73,0x83,(00) },
{ AJCS, yjcond, Px, 0x72,0x82 }, { AJCS, yjcond, Px, 0x72,0x82 },
{ AJCXZ, yloop, Px, 0xe3 }, { AJCXZL, yloop, Px, 0xe3 },
{ AJCXZW, yloop, Px, 0xe3 },
{ AJEQ, yjcond, Px, 0x74,0x84 }, { AJEQ, yjcond, Px, 0x74,0x84 },
{ AJGE, yjcond, Px, 0x7d,0x8d }, { AJGE, yjcond, Px, 0x7d,0x8d },
{ AJGT, yjcond, Px, 0x7f,0x8f }, { AJGT, yjcond, Px, 0x7f,0x8f },
......
...@@ -83,6 +83,9 @@ span1(Sym *s) ...@@ -83,6 +83,9 @@ span1(Sym *s)
loop++; loop++;
q->back ^= 2; q->back ^= 2;
} }
if(q->as == AJCXZW)
s->p[q->pc+2] = v;
else
s->p[q->pc+1] = v; s->p[q->pc+1] = v;
} else { } else {
bp = s->p + q->pc + q->mark - 4; bp = s->p + q->pc + q->mark - 4;
...@@ -1085,6 +1088,8 @@ found: ...@@ -1085,6 +1088,8 @@ found:
if(p->back & 1) { if(p->back & 1) {
v = q->pc - (p->pc + 2); v = q->pc - (p->pc + 2);
if(v >= -128) { if(v >= -128) {
if(p->as == AJCXZW)
*andptr++ = 0x67;
*andptr++ = op; *andptr++ = op;
*andptr++ = v; *andptr++ = v;
} else if(t[2] == Zloop) { } else if(t[2] == Zloop) {
...@@ -1108,6 +1113,8 @@ found: ...@@ -1108,6 +1113,8 @@ found:
p->forwd = q->comefrom; p->forwd = q->comefrom;
q->comefrom = p; q->comefrom = p;
if(p->back & 2) { // short if(p->back & 2) { // short
if(p->as == AJCXZW)
*andptr++ = 0x67;
*andptr++ = op; *andptr++ = op;
*andptr++ = 0; *andptr++ = 0;
} else if(t[2] == Zloop) { } else if(t[2] == Zloop) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment