Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Change array load function name to include type width

  • Loading branch information...
commit ba4c190ecc1881465a0de91aec8fa3ef4b6f00c1 1 parent 4c06596
@nickg authored
Showing with 5 additions and 5 deletions.
  1. +5 −5 src/cgen.c
View
10 src/cgen.c
@@ -671,8 +671,7 @@ static LLVMValueRef cgen_vec_load(LLVMValueRef signal, type_t type,
"vec_load_tmp");
char name[256];
- snprintf(name, sizeof(name), "%s_vec_load",
- istr(type_ident(type_elem(type))));
+ snprintf(name, sizeof(name), "vec_load.i%d", bit_width(type_elem(type)));
range_t r = type_dim(slice_type, 0);
@@ -1833,7 +1832,7 @@ static LLVMValueRef cgen_signal_lvalue(tree_t t, cgen_ctx_t *ctx)
else {
LLVMValueRef p_base = cgen_signal_lvalue(tree_value(t), ctx);
- LLVMValueRef indexes[] = { idx };
+ LLVMValueRef indexes[] = {idx };
return LLVMBuildGEP(builder, p_base,
indexes, ARRAY_LEN(indexes), "");
}
@@ -2429,9 +2428,10 @@ static void cgen_array_signal_load_fn(type_t elem_type)
while (type_is_array(elem_type))
elem_type = type_elem(elem_type);
+ int width = bit_width(elem_type);
+
char name[256];
- snprintf(name, sizeof(name), "%s_vec_load",
- istr(type_ident(elem_type)));
+ snprintf(name, sizeof(name), "vec_load.i%d", width);
LLVMValueRef fn;
if ((fn = LLVMGetNamedFunction(module, name)))
Please sign in to comment.
Something went wrong with that request. Please try again.