return;
}
- if(w == 8 || w == 12)
- if(componentgen(n, res))
- return;
+ // Avoid taking the address for simple enough types.
+ if(componentgen(n, res))
+ return;
// determine alignment.
// want to avoid unaligned access, so have to use
}
/*
- * copy a structure component by component
+ * copy a composite value by moving its individual components.
+ * Slices, strings and interfaces are supported.
+ * nr is N when assigning a zero value.
* return 1 if can do, 0 if cant.
- * nr is N for copy zero
*/
int
componentgen(Node *nr, Node *nl)
w = nl->type->width;
- if(w == 8 || w == 12)
- if(componentgen(N, nl))
- return;
+ // Avoid taking the address for simple enough types.
+ if(componentgen(N, nl))
+ return;
c = w % 4; // bytes
q = w / 4; // quads
if(w < 0)
fatal("sgen copy %lld", w);
- if(w == 16)
- if(componentgen(n, ns))
- return;
+ // Avoid taking the address for simple enough types.
+ if(componentgen(n, ns))
+ return;
if(w == 0) {
// evaluate side effects only
}
/*
- * copy a structure component by component
+ * copy a composite value by moving its individual components.
+ * Slices, strings and interfaces are supported.
+ * nr is N when assigning a zero value.
* return 1 if can do, 0 if cant.
- * nr is N for copy zero
*/
int
componentgen(Node *nr, Node *nl)
w = nl->type->width;
- if(w == 16)
- if(componentgen(N, nl))
- return;
+ // Avoid taking the address for simple enough types.
+ if(componentgen(N, nl))
+ return;
c = w % 8; // bytes
q = w / 8; // quads
return;
}
- if (w == 8 || w == 12) {
- if(componentgen(n, res))
- return;
- }
+ // Avoid taking the address for simple enough types.
+ if(componentgen(n, res))
+ return;
// offset on the stack
osrc = stkof(n);
}
/*
- * copy a structure component by component
+ * copy a composite value by moving its individual components.
+ * Slices, strings and interfaces are supported.
+ * nr is N when assigning a zero value.
* return 1 if can do, 0 if cant.
- * nr is N for copy zero
*/
int
componentgen(Node *nr, Node *nl)
dump("\nclearfat", nl);
w = nl->type->width;
- if(w == 8 || w == 12)
- if(componentgen(N, nl))
- return;
+ // Avoid taking the address for simple enough types.
+ if(componentgen(N, nl))
+ return;
c = w % 4; // bytes
q = w / 4; // quads