Commit 481e5c6a authored by Nigel Tao's avatar Nigel Tao

cmd/gc: re-order some OFOO constants. Rename ORRC to ORROTC to be

consistent with OLROT. Delete unused OBAD, OLRC.

R=rsc, dave
CC=golang-dev
https://golang.org/cl/6489082
parent 5e3224ce
...@@ -758,7 +758,7 @@ divbymul: ...@@ -758,7 +758,7 @@ divbymul:
// need to add numerator accounting for overflow // need to add numerator accounting for overflow
gins(optoas(OADD, nl->type), &n1, &dx); gins(optoas(OADD, nl->type), &n1, &dx);
nodconst(&n2, nl->type, 1); nodconst(&n2, nl->type, 1);
gins(optoas(ORRC, nl->type), &n2, &dx); gins(optoas(ORROTC, nl->type), &n2, &dx);
nodconst(&n2, nl->type, m.s-1); nodconst(&n2, nl->type, m.s-1);
gins(optoas(ORSH, nl->type), &n2, &dx); gins(optoas(ORSH, nl->type), &n2, &dx);
} else { } else {
......
...@@ -1724,23 +1724,23 @@ optoas(int op, Type *t) ...@@ -1724,23 +1724,23 @@ optoas(int op, Type *t)
a = ASARQ; a = ASARQ;
break; break;
case CASE(ORRC, TINT8): case CASE(ORROTC, TINT8):
case CASE(ORRC, TUINT8): case CASE(ORROTC, TUINT8):
a = ARCRB; a = ARCRB;
break; break;
case CASE(ORRC, TINT16): case CASE(ORROTC, TINT16):
case CASE(ORRC, TUINT16): case CASE(ORROTC, TUINT16):
a = ARCRW; a = ARCRW;
break; break;
case CASE(ORRC, TINT32): case CASE(ORROTC, TINT32):
case CASE(ORRC, TUINT32): case CASE(ORROTC, TUINT32):
a = ARCRL; a = ARCRL;
break; break;
case CASE(ORRC, TINT64): case CASE(ORROTC, TINT64):
case CASE(ORRC, TUINT64): case CASE(ORROTC, TUINT64):
a = ARCRQ; a = ARCRQ;
break; break;
......
...@@ -431,7 +431,6 @@ enum ...@@ -431,7 +431,6 @@ enum
OAS2MAPR, // x, ok = m["foo"] OAS2MAPR, // x, ok = m["foo"]
OAS2DOTTYPE, // x, ok = I.(int) OAS2DOTTYPE, // x, ok = I.(int)
OASOP, // x += y OASOP, // x += y
OBAD, // unused.
OCALL, // function call, method call or type conversion, possibly preceded by defer or go. OCALL, // function call, method call or type conversion, possibly preceded by defer or go.
OCALLFUNC, // f() OCALLFUNC, // f()
OCALLMETH, // t.Method() OCALLMETH, // t.Method()
...@@ -479,12 +478,6 @@ enum ...@@ -479,12 +478,6 @@ enum
OMAKECHAN, // make(chan int) OMAKECHAN, // make(chan int)
OMAKEMAP, // make(map[string]int) OMAKEMAP, // make(map[string]int)
OMAKESLICE, // make([]int, 0) OMAKESLICE, // make([]int, 0)
// TODO: move these to the "for back ends" section, like OLROT.
OHMUL, // high-mul. 386/amd64: AMUL/AIMUL for unsigned/signed (OMUL uses AIMUL for both).
ORRC, // right rotate-carry. 386/amd64: ARCR.
OLRC, // unused.
OMUL, // x * y OMUL, // x * y
ODIV, // x / y ODIV, // x / y
OMOD, // x % y OMOD, // x % y
...@@ -553,14 +546,18 @@ enum ...@@ -553,14 +546,18 @@ enum
OEFACE, // itable and data words of an empty-interface value. OEFACE, // itable and data words of an empty-interface value.
OITAB, // itable word of an interface value. OITAB, // itable word of an interface value.
// for back ends // arch-specific registers
OCMP, // compare. 386/amd64: ACMP. OREGISTER, // a register, such as AX.
ODEC, // decrement. 386/amd64: ADEC.
OEXTEND, // extend. 386/amd64: ACWD/ACDQ/ACQO.
OINC, // increment. 386/amd64: AINC.
OREGISTER, // an arch-specific register.
OINDREG, // offset plus indirect of a register, such as 8(SP). OINDREG, // offset plus indirect of a register, such as 8(SP).
OLROT, // rotate left. 386/amd64: AROL.
// 386/amd64-specific opcodes
OCMP, // compare: ACMP.
ODEC, // decrement: ADEC.
OINC, // increment: AINC.
OEXTEND, // extend: ACWD/ACDQ/ACQO.
OHMUL, // high mul: AMUL/AIMUL for unsigned/signed (OMUL uses AIMUL for both).
OLROT, // left rotate: AROL.
ORROTC, // right rotate-carry: ARCR.
OEND, OEND,
}; };
......
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