Commit f61639d4 authored by Russ Cox's avatar Russ Cox

6g return struct fix:

make t->width of funarg struct be width of struct.

emit MOVSL for 4-byte copy.

R=ken
OCL=24108
CL=24111
parent fb88a01c
...@@ -68,7 +68,12 @@ widstruct(Type *t, uint32 o, int flag) ...@@ -68,7 +68,12 @@ widstruct(Type *t, uint32 o, int flag)
// final width is rounded // final width is rounded
if(flag) if(flag)
o = rnd(o, maxround); o = rnd(o, maxround);
t->width = o;
// type width only includes back to first field's offset
if(t->type == T)
t->width = 0;
else
t->width = o - t->type->width;
return o; return o;
} }
......
...@@ -906,11 +906,9 @@ sgen(Node *n, Node *ns, int32 w) ...@@ -906,11 +906,9 @@ sgen(Node *n, Node *ns, int32 w)
} }
if(c >= 4) { if(c >= 4) {
gconreg(AMOVQ, c, D_CX); gins(AMOVSL, N, N); // MOVL *(SI)+,*(DI)+
gins(AREP, N, N); // repeat c -= 4;
gins(AMOVSB, N, N); // MOVB *(SI)+,*(DI)+ }
} else
while(c > 0) { while(c > 0) {
gins(AMOVSB, N, N); // MOVB *(SI)+,*(DI)+ gins(AMOVSB, N, N); // MOVB *(SI)+,*(DI)+
c--; c--;
......
...@@ -1887,11 +1887,9 @@ lsort(Sig *l, int(*f)(Sig*, Sig*)) ...@@ -1887,11 +1887,9 @@ lsort(Sig *l, int(*f)(Sig*, Sig*))
void void
setmaxarg(Type *t) setmaxarg(Type *t)
{ {
Type *to;
int32 w; int32 w;
to = *getoutarg(t); w = t->argwid;
w = to->width;
if(w > maxarg) if(w > maxarg)
maxarg = w; maxarg = w;
} }
......
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