Skip to content

Commit

Permalink
xe: jit: ngen: store logical offsets for int2/int4
Browse files Browse the repository at this point in the history
  • Loading branch information
petercad committed Nov 12, 2024
1 parent 26de2e3 commit be35890
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/gpu/intel/jit/ngen/ngen_core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -613,15 +613,16 @@ class RegData {
constexpr bool isInvalid() const { return invalid; }
constexpr bool isValid() const { return !invalid; }
constexpr int getOffset() const { return off; }
constexpr14 int getByteOffset() const { return off * getBytes(); }
constexpr14 int getLogicalOffset() const { return off * elementsPerByte(getType()); }
constexpr14 int getByteOffset() const { return (off * getBits()) >> 3; }
constexpr14 int getLogicalOffset() const { return off; } /* Deprecated; use getOffset */
constexpr DataType getType() const { return static_cast<DataType>(type); }
constexpr int getVS() const { return vs; }
constexpr int getWidth() const { return width; }
constexpr int getHS() const { return hs; }
constexpr bool getNeg() const { return mods & 2; }
constexpr bool getAbs() const { return mods & 1; }
constexpr int getMods() const { return mods; }
constexpr14 int getBits() const { return NGEN_NAMESPACE::getBits(getType()); }
constexpr14 int getBytes() const { return NGEN_NAMESPACE::getBytes(getType()); }
constexpr14 int getDwords() const { return NGEN_NAMESPACE::getDwords(getType()); }
constexpr bool isScalar() const { return hs == 0 && vs == 0 && width == 1; }
Expand Down Expand Up @@ -799,7 +800,7 @@ class Subregister : public RegData
constexpr Subregister() : RegData() {}
constexpr14 Subregister(RegData reg_, int offset_, DataType type_) {
*static_cast<RegData *>(this) = reg_;
off = offset_ >> log2ElementsPerByte(type_);
off = offset_;
type = static_cast<int>(type_);
hs = vs = 0;
width = 1;
Expand Down Expand Up @@ -1293,8 +1294,6 @@ inline Subregister Subregister::reinterpret(int offset, DataType type_) const
Subregister r = *this;
r.setType(type_);

offset >>= log2ElementsPerByte(type_);

int o = getOffset();
int oldbytes = getBytes(), newbytes = r.getBytes();
int bitdiff = (oldbytes == 0) ? 0
Expand Down

0 comments on commit be35890

Please sign in to comment.