mirror of
https://github.com/golang/go
synced 2024-11-20 08:14:41 -07:00
cmd/[568]g: explain the purpose of various Reg fields.
R=golang-dev, rsc CC=golang-dev, remy https://golang.org/cl/6554062
This commit is contained in:
parent
afa233a893
commit
5e3fb887a3
@ -49,12 +49,16 @@
|
|||||||
typedef struct Reg Reg;
|
typedef struct Reg Reg;
|
||||||
typedef struct Rgn Rgn;
|
typedef struct Rgn Rgn;
|
||||||
|
|
||||||
|
// A Reg is a wrapper around a single Prog (one instruction) that holds
|
||||||
|
// register optimization information while the optimizer runs.
|
||||||
|
// r->prog is the instruction.
|
||||||
|
// r->prog->regp points back to r.
|
||||||
struct Reg
|
struct Reg
|
||||||
{
|
{
|
||||||
|
|
||||||
Bits set;
|
Bits set; // variables written by this instruction.
|
||||||
Bits use1;
|
Bits use1; // variables read by prog->from.
|
||||||
Bits use2;
|
Bits use2; // variables read by prog->to.
|
||||||
|
|
||||||
Bits refbehind;
|
Bits refbehind;
|
||||||
Bits refahead;
|
Bits refahead;
|
||||||
@ -70,13 +74,13 @@ struct Reg
|
|||||||
uint16 loop; // x5 for every loop
|
uint16 loop; // x5 for every loop
|
||||||
uchar refset; // diagnostic generated
|
uchar refset; // diagnostic generated
|
||||||
|
|
||||||
Reg* p1;
|
Reg* p1; // predecessors of this instruction: p1,
|
||||||
Reg* p2;
|
Reg* p2; // and then p2 linked though p2link.
|
||||||
Reg* p2link;
|
Reg* p2link;
|
||||||
Reg* s1;
|
Reg* s1; // successors of this instruction (at most two: s1 and s2).
|
||||||
Reg* s2;
|
Reg* s2;
|
||||||
Reg* link;
|
Reg* link; // next instruction in function code
|
||||||
Prog* prog;
|
Prog* prog; // actual instruction
|
||||||
};
|
};
|
||||||
#define R ((Reg*)0)
|
#define R ((Reg*)0)
|
||||||
|
|
||||||
|
@ -49,12 +49,16 @@
|
|||||||
typedef struct Reg Reg;
|
typedef struct Reg Reg;
|
||||||
typedef struct Rgn Rgn;
|
typedef struct Rgn Rgn;
|
||||||
|
|
||||||
|
// A Reg is a wrapper around a single Prog (one instruction) that holds
|
||||||
|
// register optimization information while the optimizer runs.
|
||||||
|
// r->prog is the instruction.
|
||||||
|
// r->prog->regp points back to r.
|
||||||
struct Reg
|
struct Reg
|
||||||
{
|
{
|
||||||
|
|
||||||
Bits set;
|
Bits set; // variables written by this instruction.
|
||||||
Bits use1;
|
Bits use1; // variables read by prog->from.
|
||||||
Bits use2;
|
Bits use2; // variables read by prog->to.
|
||||||
|
|
||||||
Bits refbehind;
|
Bits refbehind;
|
||||||
Bits refahead;
|
Bits refahead;
|
||||||
@ -70,13 +74,13 @@ struct Reg
|
|||||||
uint16 loop; // x5 for every loop
|
uint16 loop; // x5 for every loop
|
||||||
uchar refset; // diagnostic generated
|
uchar refset; // diagnostic generated
|
||||||
|
|
||||||
Reg* p1;
|
Reg* p1; // predecessors of this instruction: p1,
|
||||||
Reg* p2;
|
Reg* p2; // and then p2 linked though p2link.
|
||||||
Reg* p2link;
|
Reg* p2link;
|
||||||
Reg* s1;
|
Reg* s1; // successors of this instruction (at most two: s1 and s2).
|
||||||
Reg* s2;
|
Reg* s2;
|
||||||
Reg* link;
|
Reg* link; // next instruction in function code
|
||||||
Prog* prog;
|
Prog* prog; // actual instruction
|
||||||
};
|
};
|
||||||
#define R ((Reg*)0)
|
#define R ((Reg*)0)
|
||||||
|
|
||||||
|
@ -47,12 +47,16 @@
|
|||||||
typedef struct Reg Reg;
|
typedef struct Reg Reg;
|
||||||
typedef struct Rgn Rgn;
|
typedef struct Rgn Rgn;
|
||||||
|
|
||||||
|
// A Reg is a wrapper around a single Prog (one instruction) that holds
|
||||||
|
// register optimization information while the optimizer runs.
|
||||||
|
// r->prog is the instruction.
|
||||||
|
// r->prog->regp points back to r.
|
||||||
struct Reg
|
struct Reg
|
||||||
{
|
{
|
||||||
|
|
||||||
Bits set;
|
Bits set; // variables written by this instruction.
|
||||||
Bits use1;
|
Bits use1; // variables read by prog->from.
|
||||||
Bits use2;
|
Bits use2; // variables read by prog->to.
|
||||||
|
|
||||||
Bits refbehind;
|
Bits refbehind;
|
||||||
Bits refahead;
|
Bits refahead;
|
||||||
@ -68,13 +72,13 @@ struct Reg
|
|||||||
uint16 loop; // x5 for every loop
|
uint16 loop; // x5 for every loop
|
||||||
uchar refset; // diagnostic generated
|
uchar refset; // diagnostic generated
|
||||||
|
|
||||||
Reg* p1;
|
Reg* p1; // predecessors of this instruction: p1,
|
||||||
Reg* p2;
|
Reg* p2; // and then p2 linked though p2link.
|
||||||
Reg* p2link;
|
Reg* p2link;
|
||||||
Reg* s1;
|
Reg* s1; // successors of this instruction (at most two: s1 and s2).
|
||||||
Reg* s2;
|
Reg* s2;
|
||||||
Reg* link;
|
Reg* link; // next instruction in function code
|
||||||
Prog* prog;
|
Prog* prog; // actual instruction
|
||||||
};
|
};
|
||||||
#define R ((Reg*)0)
|
#define R ((Reg*)0)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user