Skip to content

Commit

Permalink
Fix for top-of-tree LLVM (#7194)
Browse files Browse the repository at this point in the history
  • Loading branch information
steven-johnson authored Dec 2, 2022
1 parent 43911f4 commit a9ea9b5
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions test/correctness/simd_op_check_hvx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,18 @@ class SimdOpCheckHVX : public SimdOpCheckTest {
check("vdelta(v*,v*)", hvx_width / 2, in_u32(3 * x / 2));
check("vdelta(v*,v*)", hvx_width * 3, in_u16(x * 3));
check("vdelta(v*,v*)", hvx_width * 3, in_u8(x * 3));
check("vdelta(v*,v*)", hvx_width * 4, in_u16(x * 4));
check("vdelta(v*,v*)", hvx_width * 4, in_u8(x * 4));

if (Halide::Internal::get_llvm_version() >= 160) {
// As of commit 073d5e5945c4, this pattern doesn't generate vdelta,
// but does emit vrdelta, which the author claims is superior codegen
// for this case.
check("vrdelta(v*,v*)", hvx_width * 4, in_u16(x * 4));
check("vrdelta(v*,v*)", hvx_width * 4, in_u8(x * 4));
} else {
abort();
check("vdelta(v*,v*)", hvx_width * 4, in_u16(x * 4));
check("vdelta(v*,v*)", hvx_width * 4, in_u8(x * 4));
}

check("vlut32(v*.b,v*.b,r*)", hvx_width / 1, in_u8(u8_1));
check("vlut32(v*.b,v*.b,r*)", hvx_width / 1, in_u8(clamp(u16_1, 0, 63)));
Expand Down

0 comments on commit a9ea9b5

Please sign in to comment.