[qfcc] Create vector lists only for constants

Defs and symbols benefit from swizzling as that's one instruction vs 2-3
for loading a scalar into a vector component by component. Constants are
ok because the result gets converted to a vector constant.
This commit is contained in:
Bill Currie 2022-05-01 14:12:43 +09:00
parent be4021f8f4
commit b9bd45ad99

View file

@ -658,8 +658,7 @@ convert_scalar (expr_t *scalar, int op, expr_t *vec)
// expand the scalar to a vector of the same width as vec
type_t *vec_type = get_type (vec);
if (scalar->type == ex_symbol || scalar->type == ex_def
|| is_constant (scalar)) {
if (is_constant (scalar)) {
for (int i = 1; i < type_width (get_type (vec)); i++) {
expr_t *s = copy_expr (scalar);
s->next = scalar;