aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_backend_expr.cpp
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2025-12-01 11:53:08 +0000
committergingerBill <gingerBill@users.noreply.github.com>2025-12-01 11:53:08 +0000
commit3771ff7b123bf1debe2da2886d833791ee890b39 (patch)
tree69cc14a85ef5cb47ede1280df76f6206aa934d00 /src/llvm_backend_expr.cpp
parent9f80d697027a41a9c36b8eb42d9c98f9b7fcbe2c (diff)
parente72aad983bb683858a1aee935b2956ced40f69f8 (diff)
Merge branch 'master' into vendor/curl
Diffstat (limited to 'src/llvm_backend_expr.cpp')
-rw-r--r--src/llvm_backend_expr.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/llvm_backend_expr.cpp b/src/llvm_backend_expr.cpp
index 187c34595..d5658b9d5 100644
--- a/src/llvm_backend_expr.cpp
+++ b/src/llvm_backend_expr.cpp
@@ -634,7 +634,7 @@ gb_internal LLVMValueRef lb_matrix_to_trimmed_vector(lbProcedure *p, lbValue m)
}
-gb_internal lbValue lb_emit_matrix_tranpose(lbProcedure *p, lbValue m, Type *type) {
+gb_internal lbValue lb_emit_matrix_transpose(lbProcedure *p, lbValue m, Type *type) {
if (is_type_array(m.type)) {
i32 rank = type_math_rank(m.type);
if (rank == 2) {
@@ -664,7 +664,12 @@ gb_internal lbValue lb_emit_matrix_tranpose(lbProcedure *p, lbValue m, Type *typ
Type *mt = base_type(m.type);
GB_ASSERT(mt->kind == Type_Matrix);
- if (lb_is_matrix_simdable(mt)) {
+ Type *rt = base_type(type);
+ if (rt->kind == Type_Matrix && rt->Matrix.is_row_major != mt->Matrix.is_row_major) {
+ GB_PANIC("TODO: transpose with changing layout");
+ }
+
+ if (lb_is_matrix_simdable(mt) && lb_is_matrix_simdable(type)) {
unsigned stride = cast(unsigned)matrix_type_stride_in_elems(mt);
unsigned row_count = cast(unsigned)mt->Matrix.row_count;
unsigned column_count = cast(unsigned)mt->Matrix.column_count;