break;
case ONAME:
- n->addable = 10;
+ if(flag_largemodel)
+ n->addable = 9;
+ else
+ n->addable = 10;
if(n->class == CPARAM || n->class == CAUTO)
n->addable = 11;
break;
regalloc(&n3, types[tptr], res);
p1 = gins(ALEAQ, N, &n3);
datastring(nl->val.u.sval->s, nl->val.u.sval->len, &p1->from);
- p1->from.scale = 1;
- p1->from.index = n2.val.u.reg;
+ if(flag_largemodel) {
+ gins(AADDQ, &n2, &n3);
+ } else {
+ p1->from.scale = 1;
+ p1->from.index = n2.val.u.reg;
+ }
goto indexdone;
}
{
Prog *p;
Node reg, con;
+ Node r1;
switch(proc) {
default:
case 1: // call in new proc (go)
case 2: // deferred call (defer)
nodreg(®, types[TINT64], D_CX);
- gins(APUSHQ, f, N);
+ if(flag_largemodel) {
+ regalloc(&r1, f->type, f);
+ gmove(f, &r1);
+ gins(APUSHQ, &r1, N);
+ regfree(&r1);
+ } else {
+ gins(APUSHQ, f, N);
+ }
nodconst(&con, types[TINT32], argsize(f->type));
gins(APUSHQ, &con, N);
if(proc == 1)
case ONAME:
case OPARAM:
return 1;
+ case OADDR:
+ if(flag_largemodel)
+ return 1;
+ break;
}
return 0;
}
EXTERN int fproundflg;
EXTERN int textflag;
EXTERN int dataflag;
+EXTERN int flag_largemodel;
EXTERN int ncontin;
EXTERN int canreach;
EXTERN int warnreach;
flagcount("t", "debug code generation", &debug['t']);
flagcount("w", "enable warnings", &debug['w']);
flagcount("v", "increase debug verbosity", &debug['v']);
+ if(thechar == '6')
+ flagcount("largemodel", "generate code that assumes a large memory model", &flag_largemodel);
flagparse(&argc, &argv, usage);
EXTERN int compiling_wrappers;
EXTERN int pure_go;
EXTERN int flag_race;
+EXTERN int flag_largemodel;
EXTERN int nointerface;
EXTERN int fieldtrack_enabled;
flagcount("w", "debug type checking", &debug['w']);
flagcount("x", "debug lexer", &debug['x']);
flagcount("y", "debug declarations in canned imports (with -d)", &debug['y']);
+ if(thechar == '6')
+ flagcount("largemodel", "generate code that assumes a large memory model", &flag_largemodel);
flagparse(&argc, &argv, usage);
# GO_LDFLAGS: Additional 5l/6l/8l arguments to use when
# building the commands.
#
+# GO_CCFLAGS: Additional 5c/6c/8c arguments to use when
+# building.
+#
# CGO_ENABLED: Controls cgo usage during the build. Set it to 1
# to include all cgo related files, .c and .go file with "cgo"
# build directive, in the build. Set it to 0 to ignore them.
if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOHOSTOS" != "$GOOS" ]; then
echo "# Building packages and commands for host, $GOHOSTOS/$GOHOSTARCH."
GOOS=$GOHOSTOS GOARCH=$GOHOSTARCH \
- "$GOTOOLDIR"/go_bootstrap install -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std
+ "$GOTOOLDIR"/go_bootstrap install -ccflags "$GO_CCFLAGS" -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std
echo
fi
echo "# Building packages and commands for $GOOS/$GOARCH."
-"$GOTOOLDIR"/go_bootstrap install -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std
+"$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -ccflags "$GO_CCFLAGS" -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std
echo
rm -f "$GOTOOLDIR"/go_bootstrap