[bug] Fixed a bug in Vec::half() that halved to ZMM instead of XMM

This commit is contained in:
kobalicek
2025-11-13 21:50:54 +01:00
parent b56f4176cb
commit 9888fcf213
2 changed files with 5 additions and 1 deletions

View File

@@ -141,6 +141,10 @@ UNIT(x86_operand) {
EXPECT_EQ(zmm7.ymm(), ymm7);
EXPECT_EQ(zmm7.zmm(), zmm7);
EXPECT_EQ(xmm4.half(), xmm4);
EXPECT_EQ(ymm4.half(), xmm4);
EXPECT_EQ(zmm4.half(), ymm4);
INFO("Checking x86::Mm register properties");
EXPECT_TRUE(Mm().is_reg());
EXPECT_TRUE(mm2.is_reg());

View File

@@ -237,7 +237,7 @@ class Vec : public UniVec {
//! was ZMM, or XMM for whatever else input.
[[nodiscard]]
ASMJIT_INLINE_CONSTEXPR Vec half() const noexcept {
return Vec(is_vec512() ? signature_of_t<RegType::kVec256>() : signature_of_t<RegType::kVec512>(), id());
return Vec(is_vec512() ? signature_of_t<RegType::kVec256>() : signature_of_t<RegType::kVec128>(), id());
}
//! \}