Closed karl-zylinski closed 1 month ago
Odin: dev-2024-05:7058d6f32 OS: Windows 10 Professional (version: 22H2), build 19045.4412 CPU: Intel(R) Core(TM) i7-6950X CPU @ 3.00GHz RAM: 32674 MiB Backend: LLVM 17.0.1
Feeding row_major matrices to linalg.transpose should work
Feeding row_major matrices to linalg.transpose crashes
package transpose_crash_repro import "core:math/linalg" import "core:fmt" main :: proc() { inv := linalg.inverse((#row_major matrix[4,4]f32)(1)) fmt.println(inv) transp := linalg.transpose(inv) fmt.println("got here") }
run this code, you'll never get to "got here". It seems to crash. Remove #row_major on the line inv := linalg.inverse((#row_major matrix[4,4]f32)(1)) and it works.
inv := linalg.inverse((#row_major matrix[4,4]f32)(1))
If I change lb_emit_matrix_tranpose and remove the if (lb_is_matrix_simdable(mt)) {} block then the compiler outputs code that works.
lb_emit_matrix_tranpose
if (lb_is_matrix_simdable(mt)) {}
Context
Expected Behavior
Feeding row_major matrices to linalg.transpose should work
Current Behavior
Feeding row_major matrices to linalg.transpose crashes
Steps to Reproduce
run this code, you'll never get to "got here". It seems to crash. Remove #row_major on the line
inv := linalg.inverse((#row_major matrix[4,4]f32)(1))
and it works.