Compiler Explorer - C++ (RISC-V (64-bits) gcc 15.2.0)

using u16 = uint16_t; using i16 = int16_t; using u32 = uint32_t; using i32 = int32_t; using u64 = uint32_t; using i64 = int64_t; #define cvt(op1, op2) op2 op1##_to_##op2(op1 a){ return static_cast<op2>(a); } #define cvt_matrix(col, row1, row2, row3, row4, row5, row6) \ cvt(col, row1) cvt(col, row2) </op2>…