src_vec_type = lp_build_vec_type(gallivm, src_type);
- /* Read whole vector from memory, unaligned */
+ /*
+ * Read whole vector from memory, unaligned.
+ * XXX: Note it's actually aligned to element type. Not sure if all
+ * callers are able to guarantee that (whereas for others, we should
+ * be able to use full alignment when there's 2 or 4 channels).
+ * (If all callers can guarantee element type alignment, we should
+ * relax alignment restrictions elsewhere.)
+ */
ptr = LLVMBuildGEP(builder, base_ptr, &offset, 1, "");
ptr = LLVMBuildPointerCast(builder, ptr, LLVMPointerType(src_vec_type, 0), "");
res = LLVMBuildLoad(builder, ptr, "");
- lp_set_load_alignment(res, src_type.width / 8);
+ LLVMSetAlignment(res, src_type.width / 8);
/* Truncate doubles to float */
if (src_type.floating && src_type.width == 64) {