Commit 531f242f authored by Russ Cox's avatar Russ Cox

move bits.c from 6g to gc

R=ken
OCL=26909
CL=26909
parent f5387605
......@@ -22,7 +22,6 @@ OFILES=\
obj.$O\
peep.$O\
reg.$O\
bits.$O\
../6l/enam.$O\
LIB=\
......
......@@ -28,13 +28,9 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#define Z N
#define Adr Addr
#define BITS 5
#define NVAR (BITS*sizeof(uint32)*8)
#define D_HI D_NONE
#define D_LO D_NONE
......@@ -50,16 +46,9 @@
#define CINF 1000
#define LOOP 3
typedef struct Bits Bits;
typedef struct Reg Reg;
typedef struct Var Var;
typedef struct Rgn Rgn;
struct Bits
{
uint32 b[BITS];
};
struct Reg
{
......@@ -91,14 +80,6 @@ struct Reg
};
#define R ((Reg*)0)
struct Var
{
vlong offset;
Sym* sym;
char name;
char etype;
};
#define NRGN 600
struct Rgn
{
......@@ -108,14 +89,12 @@ struct Rgn
short regno;
};
EXTERN int32 exregoffset; // not set
EXTERN int32 exfregoffset; // not set
EXTERN Reg* firstr;
EXTERN Reg* lastr;
EXTERN Reg zreg;
EXTERN Reg* freer;
EXTERN Var var[NVAR];
EXTERN Reg** rpo2r;
EXTERN Rgn region[NRGN];
EXTERN Rgn* rgp;
......@@ -129,24 +108,10 @@ EXTERN Bits consts;
EXTERN Bits addrs;
EXTERN Bits ovar;
EXTERN int change;
EXTERN Bits zbits;
EXTERN int32 maxnr;
EXTERN int32* idom;
/*
* bits.c
*/
Bits bor(Bits, Bits);
Bits band(Bits, Bits);
Bits bnot(Bits);
int bany(Bits*);
int bnum(Bits);
Bits blsh(uint);
int beq(Bits, Bits);
int bset(Bits, uint);
int Qconv(Fmt *fp);
int bitno(int32);
struct
EXTERN struct
{
int32 ncvtreg;
int32 nspill;
......
......@@ -28,6 +28,7 @@ OFILES=\
mparith3.$O\
builtin.$O\
compat.$O\
bits.$O\
$(LIB): $(OFILES)
ar rsc $(LIB) $(OFILES)
......
......@@ -28,8 +28,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#include "gg.h"
#include "opt.h"
#include "go.h"
Bits
bor(Bits a, Bits b)
......
......@@ -420,6 +420,29 @@ enum
Erv, // evaluated in rvalue context
};
#define BITS 5
#define NVAR (BITS*sizeof(uint32)*8)
typedef struct Bits Bits;
struct Bits
{
uint32 b[BITS];
};
EXTERN Bits zbits;
typedef struct Var Var;
struct Var
{
vlong offset;
Sym* sym;
char name;
char etype;
};
EXTERN Var var[NVAR];
typedef struct Io Io;
struct Io
{
......@@ -871,3 +894,17 @@ Node* nodarg(Type*, int);
void nodconst(Node*, Type*, vlong);
Type* deep(Type*);
Type* shallow(Type*);
/*
* bits.c
*/
Bits bor(Bits, Bits);
Bits band(Bits, Bits);
Bits bnot(Bits);
int bany(Bits*);
int bnum(Bits);
Bits blsh(uint);
int beq(Bits, Bits);
int bset(Bits, uint);
int Qconv(Fmt *fp);
int bitno(int32);
# Copyright 2009 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
#!/bin/bash
set -e
bash clean.bash
cd 8l
bash mkenam
make enam.o
cd ..
for i in cc 8l 8a 8c gc 8g ar db nm acid cov gobuild godefs prof gotest
do
echo; echo; echo %%%% making $i %%%%; echo
cd $i
make install
cd ..
done
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