Skip to content

Add tests for Matrix cast #506

@farzonl

Description

@farzonl

llvm/llvm-project#162711

ie support a cast like so:

export int3x2 fn_helper(float2x3 f23) {
    int3x2 i32 = {f23};
    return i32;
}

export int3x2 fn() {
    float2x3 f23 = {1,2,3,4,5,6};
    return fn_helper(f23);
}

We will need to xFail the clang side because shape transformations are not happening.
This is because the curren't indexing is wrong

https://godbolt.org/z/36bGTsfxa

+ %2 = extractelement <6 x float> %0, i32 5, !dbg !33
+ %3 = extractelement <6 x float> %0, i32 3, !dbg !33
+ %4 = extractelement <6 x float> %0, i32 1, !dbg !33
+ %5 = extractelement <6 x float> %0, i32 4, !dbg !33
+ %6 = extractelement <6 x float> %0, i32 2, !dbg !33
+ %7 = extractelement <6 x float> %0, i32 0, !dbg !33
- %2 = extractelement <6 x float> %0, i32 0, !dbg !33
- %3 = extractelement <6 x float> %0, i32 1, !dbg !33
- %4 = extractelement <6 x float> %0, i32 2, !dbg !33
- %5 = extractelement <6 x float> %0, i32 3, !dbg !33
- %6 = extractelement <6 x float> %0, i32 4, !dbg !33
- %7 = extractelement <6 x float> %0, i32 5, !dbg !33

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Active

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions