diff --git a/test/samples/Sync/test_tmov_col_major_16x1_align_a5.pto b/test/samples/Sync/test_tmov_col_major_16x1_align_a5.pto new file mode 100644 index 00000000..1503da00 --- /dev/null +++ b/test/samples/Sync/test_tmov_col_major_16x1_align_a5.pto @@ -0,0 +1,12 @@ +module { + // A5 repro case: TMOV on a 16x1 f32 col_major view. + // Layout stride is [1, 16], i.e. RowStride=1. + // On A5 TMOV_V2V this tends to hit unaligned vector accesses at i>0. + func.func @test_tmov_col_major_16x1_align_a5() { + %src = pto.alloc_tile : !pto.tile_buf + %dst = pto.alloc_tile : !pto.tile_buf + pto.tmov ins(%src : !pto.tile_buf) + outs(%dst : !pto.tile_buf) + return + } +} diff --git a/test/samples/Sync/test_tmov_col_major_16x1_align_a5.py b/test/samples/Sync/test_tmov_col_major_16x1_align_a5.py new file mode 100644 index 00000000..7baa3c4c --- /dev/null +++ b/test/samples/Sync/test_tmov_col_major_16x1_align_a5.py @@ -0,0 +1,6 @@ +#!/usr/bin/env python3 +from pathlib import Path + + +if __name__ == "__main__": + print(Path(__file__).with_suffix(".pto").read_text(encoding="utf-8")) diff --git a/test/samples/Sync/test_tmov_row_major_1x16_control_a5.pto b/test/samples/Sync/test_tmov_row_major_1x16_control_a5.pto new file mode 100644 index 00000000..65434448 --- /dev/null +++ b/test/samples/Sync/test_tmov_row_major_1x16_control_a5.pto @@ -0,0 +1,11 @@ +module { + // Control case: TMOV on a 1x16 f32 row_major view. + // Layout stride is [16, 1], and validRow=1. + func.func @test_tmov_row_major_1x16_control_a5() { + %src = pto.alloc_tile : !pto.tile_buf + %dst = pto.alloc_tile : !pto.tile_buf + pto.tmov ins(%src : !pto.tile_buf) + outs(%dst : !pto.tile_buf) + return + } +} diff --git a/test/samples/Sync/test_tmov_row_major_1x16_control_a5.py b/test/samples/Sync/test_tmov_row_major_1x16_control_a5.py new file mode 100644 index 00000000..7baa3c4c --- /dev/null +++ b/test/samples/Sync/test_tmov_row_major_1x16_control_a5.py @@ -0,0 +1,6 @@ +#!/usr/bin/env python3 +from pathlib import Path + + +if __name__ == "__main__": + print(Path(__file__).with_suffix(".pto").read_text(encoding="utf-8")) diff --git a/test/samples/runop.sh b/test/samples/runop.sh index bd992aea..a35fb5d3 100755 --- a/test/samples/runop.sh +++ b/test/samples/runop.sh @@ -181,9 +181,11 @@ process_one_dir() { fi done fi + local target_arch_lc + target_arch_lc="$(printf '%s' "$target_arch" | tr '[:upper:]' '[:lower:]')" local expected_vec_barrier="pipe_barrier(PIPE_V)" local skip_vec_barrier=0 - if [[ "$(printf '%s' "$target_arch" | tr '[:upper:]' '[:lower:]')" == "a5" ]]; then + if [[ "${target_arch_lc}" == "a5" ]]; then skip_vec_barrier=1 fi @@ -269,6 +271,12 @@ process_one_dir() { echo -e "${A}(${base}.py)\tSKIP\trequires --pto-arch=a3" continue fi + if [[ ( "$base" == "test_tmov_col_major_16x1_align_a5" || \ + "$base" == "test_tmov_row_major_1x16_control_a5" ) && \ + "${target_arch_lc}" != "a5" ]]; then + echo -e "${A}(${base}.py)\tSKIP\trequires --pto-arch=a5" + continue + fi # Some samples are expected to fail depending on the selected ptoas flags. # @@ -627,6 +635,34 @@ process_one_dir() { fi fi + # A5 TMOV alignment repro/control samples: + # - col_major 16x1 should preserve TMOV + ColMajor tile shape in emitted C++ + # - row_major 1x16 control should preserve TMOV + RowMajor tile shape + if [[ "$base" == "test_tmov_col_major_16x1_align_a5" ]]; then + if ! grep -Eq "\\bTMOV\\(" "$cpp"; then + echo -e "${A}(${base}.py)\tFAIL\tmissing TMOV() in col_major repro sample" + overall=1 + continue + fi + if ! grep -Fq "Tile