aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSamuel Neves <[email protected]>2024-11-09 22:38:55 +0000
committerSamuel Neves <[email protected]>2024-11-09 22:38:55 +0000
commit0c018d73d3ebbfaf524d5b013316319ed1599528 (patch)
tree5ebc6c93c680fbc8bb126a60ccb33f15f36ea40d
parent2c02730b822d461aa2010f5b9cec6a8595243866 (diff)
downloadxbyak-0c018d73d3ebbfaf524d5b013316319ed1599528.tar.gz
xbyak-0c018d73d3ebbfaf524d5b013316319ed1599528.zip
add cvt128, cvt256, cvt512 convenience functions
-rw-r--r--xbyak/xbyak.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/xbyak/xbyak.h b/xbyak/xbyak.h
index 28af005..6fa0f83 100644
--- a/xbyak/xbyak.h
+++ b/xbyak/xbyak.h
@@ -836,12 +836,17 @@ struct EvexModifierRounding {
};
struct EvexModifierZero{ XBYAK_CONSTEXPR EvexModifierZero() {}};
+struct Ymm;
+struct Zmm;
struct Xmm : public Mmx {
explicit XBYAK_CONSTEXPR Xmm(int idx = 0, Kind kind = Operand::XMM, int bit = 128) : Mmx(idx, kind, bit) { }
XBYAK_CONSTEXPR Xmm(Kind kind, int idx) : Mmx(idx, kind, kind == XMM ? 128 : kind == YMM ? 256 : 512) { }
Xmm operator|(const EvexModifierRounding& emr) const { Xmm r(*this); r.setRounding(emr.rounding); return r; }
Xmm copyAndSetIdx(int idx) const { Xmm ret(*this); ret.setIdx(idx); return ret; }
Xmm copyAndSetKind(Operand::Kind kind) const { Xmm ret(*this); ret.setKind(kind); return ret; }
+ Xmm cvt128() const;
+ Ymm cvt256() const;
+ Zmm cvt512() const;
};
struct Ymm : public Xmm {
@@ -938,6 +943,21 @@ inline Reg64 Reg::cvt64() const
}
#endif
+inline Xmm Xmm::cvt128() const
+{
+ return Xmm(changeBit(128).getIdx());
+}
+
+inline Ymm Xmm::cvt256() const
+{
+ return Ymm(changeBit(256).getIdx());
+}
+
+inline Zmm Xmm::cvt512() const
+{
+ return Zmm(changeBit(512).getIdx());
+}
+
#ifndef XBYAK_DISABLE_SEGMENT
// not derived from Reg
class Segment {