diff options
author | MITSUNARI Shigeo <[email protected]> | 2024-11-11 15:05:00 +0900 |
---|---|---|
committer | MITSUNARI Shigeo <[email protected]> | 2024-11-11 15:05:00 +0900 |
commit | 9cdbbbc644078edbe79d736a700bdf97dd16b3c5 (patch) | |
tree | 701d891c95bec8970223b2da1195a46ec26904e1 | |
parent | afa85b785d50bce04ed16d630f330b578669a3ec (diff) | |
download | xbyak-9cdbbbc644078edbe79d736a700bdf97dd16b3c5.tar.gz xbyak-9cdbbbc644078edbe79d736a700bdf97dd16b3c5.zip |
move cvt{128,256,512} methods to Reg
-rw-r--r-- | xbyak/xbyak.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/xbyak/xbyak.h b/xbyak/xbyak.h index 4e2620f..0c9c93a 100644 --- a/xbyak/xbyak.h +++ b/xbyak/xbyak.h @@ -786,6 +786,9 @@ class Label; struct Reg8; struct Reg16; struct Reg32; +struct Xmm; +struct Ymm; +struct Zmm; #ifdef XBYAK64 struct Reg64; #endif @@ -801,6 +804,9 @@ public: #ifdef XBYAK64 Reg64 cvt64() const; #endif + Xmm cvt128() const; + Ymm cvt256() const; + Zmm cvt512() const; Reg operator|(const ApxFlagNF&) const { Reg r(*this); r.setNF(); return r; } Reg operator|(const ApxFlagZU&) const { Reg r(*this); r.setZU(); return r; } }; @@ -836,17 +842,12 @@ 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 { @@ -943,17 +944,17 @@ inline Reg64 Reg::cvt64() const } #endif -inline Xmm Xmm::cvt128() const +inline Xmm Reg::cvt128() const { return Xmm(changeBit(128).getIdx()); } -inline Ymm Xmm::cvt256() const +inline Ymm Reg::cvt256() const { return Ymm(changeBit(256).getIdx()); } -inline Zmm Xmm::cvt512() const +inline Zmm Reg::cvt512() const { return Zmm(changeBit(512).getIdx()); } |