Skip to content

Vector Permutation Design Document #251

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to this

The following people from multiple organizations have contributed to this project:

* (Ventana Micro Systems)[https://www.ventanamicro.com]
* (Arup Chakraborty)[https://github.com/arupc]
* [Ventana Micro Systems]([https://www.ventanamicro.com)
* [Arup Chakraborty](https://github.com/arupc)

* (MIPS)[https://mips.com]
* (Knute Lingaard)[https://github.com/klingaard]
* (Kathlene Magnus)[https://github.com/kathlenemagnus]
* [MIPS](https://mips.com)
* [Knute Lingaard](https://github.com/klingaard)
* [Kathlene Magnus](https://github.com/kathlenemagnus)

* (Condor Computing)[https://condorcomputing.com]
* (Jeff Nye)[https://github.com/jeffnye-gh]
* [Condor Computing](https://condorcomputing.com)
* [Jeff Nye](https://github.com/jeffnye-gh)

* (InCore Semiconductors)[https://incoresemi.com/]
* (Sai Govardhan)[https://github.com/govardhnn]
* [InCore Semiconductors](https://incoresemi.com/)
* [Sai Govardhan](https://github.com/govardhnn)

List is incomplete and more contributor names/organizations to be added.
26 changes: 13 additions & 13 deletions arches/isa_json/olympia_uarch_rv64v.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
{
"mnemonic": "vcompress.vm",
"pipe": "vpermute",
"uop_gen": "PERMUTE",
"uop_gen": "COMPRESS",
"latency": 4
},
{
Expand Down Expand Up @@ -302,13 +302,13 @@
{
"mnemonic": "vfmv.f.s",
"pipe": "v2s",
"uop_gen": "NONE",
"uop_gen": "SCALAR_MOVE",
"latency": 1
},
{
"mnemonic": "vfmv.s.f",
"pipe": "vmv",
"uop_gen": "NONE",
"uop_gen": "SCALAR_MOVE",
"latency": 1
},
{
Expand Down Expand Up @@ -1328,7 +1328,7 @@
{
"mnemonic": "vmv.s.x",
"pipe": "vmv",
"uop_gen": "NONE",
"uop_gen": "SCALAR_MOVE",
"latency": 1
},
{
Expand All @@ -1352,7 +1352,7 @@
{
"mnemonic": "vmv.x.s",
"pipe": "v2s",
"uop_gen": "NONE",
"uop_gen": "SCALAR_MOVE",
"latency": 1
},
{
Expand Down Expand Up @@ -1586,25 +1586,25 @@
{
"mnemonic": "vrgather.vi",
"pipe": "vpermute",
"uop_gen": "PERMUTE",
"uop_gen": "RGATHER",
"latency": 4
},
{
"mnemonic": "vrgather.vv",
"pipe": "vpermute",
"uop_gen": "PERMUTE",
"uop_gen": "RGATHER",
"latency": 4
},
{
"mnemonic": "vrgather.vx",
"pipe": "vpermute",
"uop_gen": "PERMUTE",
"uop_gen": "RGATHER",
"latency": 4
},
{
"mnemonic": "vrgatherei16.vv",
"pipe": "vpermute",
"uop_gen": "PERMUTE",
"uop_gen": "RGATHER",
"latency": 4
},
{
Expand Down Expand Up @@ -1766,25 +1766,25 @@
{
"mnemonic": "vslidedown.vi",
"pipe": "vpermute",
"uop_gen": "PERMUTE",
"uop_gen": "SLIDEDOWN",
"latency": 4
},
{
"mnemonic": "vslidedown.vx",
"pipe": "vpermute",
"uop_gen": "PERMUTE",
"uop_gen": "SLIDEDOWN",
"latency": 4
},
{
"mnemonic": "vslideup.vi",
"pipe": "vpermute",
"uop_gen": "PERMUTE",
"uop_gen": "SLIDEUP",
"latency": 4
},
{
"mnemonic": "vslideup.vx",
"pipe": "vpermute",
"uop_gen": "PERMUTE",
"uop_gen": "SLIDEUP",
"latency": 4
},
{
Expand Down
8 changes: 6 additions & 2 deletions core/InstArchInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,12 @@ namespace olympia
{"INT_EXT", InstArchInfo::UopGenType::INT_EXT},
{"SLIDE1UP", InstArchInfo::UopGenType::SLIDE1UP},
{"SLIDE1DOWN", InstArchInfo::UopGenType::SLIDE1DOWN},
{"PERMUTE", InstArchInfo::UopGenType::PERMUTE},
{"NONE", InstArchInfo::UopGenType::NONE}};
{"SCALAR_MOVE", InstArchInfo::UopGenType::SCALAR_MOVE},
{"RGATHER", InstArchInfo::UopGenType::RGATHER},
{"COMPRESS", InstArchInfo::UopGenType::COMPRESS},
{"WHOLE_REG_MOVE", InstArchInfo::UopGenType::WHOLE_REG_MOVE},
{"NONE", InstArchInfo::UopGenType::NONE},
};

void InstArchInfo::update(const nlohmann::json & jobj)
{
Expand Down
11 changes: 8 additions & 3 deletions core/InstArchInfo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,16 @@ namespace olympia
REDUCTION,
REDUCTION_WIDE,
INT_EXT,
SLIDEUP,
SLIDEDOWN,
SLIDE1UP,
SLIDE1DOWN,
PERMUTE,
NONE,
UNKNOWN
SCALAR_MOVE,
RGATHER,
COMPRESS,
WHOLE_REG_MOVE,
UNKNOWN,
NONE
};

static constexpr uint32_t N_UOP_GEN_TYPES = static_cast<uint32_t>(UopGenType::NONE);
Expand Down
18 changes: 13 additions & 5 deletions core/vector/VectorUopGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,15 @@ namespace olympia
// Exe Uop 2: vrgather.vv v21, v9
// Exe Uop 3: vrgather.vv v22, v10
// Exe Uop 4: vrgather.vv v23, v11
uop_gen_function_map_.emplace(InstArchInfo::UopGenType::PERMUTE,
&VectorUopGenerator::generatePermuteUops_);
// uop_gen_function_map_.emplace(InstArchInfo::UopGenType::RGATHER,
// &VectorUopGenerator::generatePermuteUops_);

// Vector scalar move uop generator
// Integer Scalar Move
// Floating-Point Scalar Move
uop_gen_function_map_.emplace(
InstArchInfo::UopGenType::SCALAR_MOVE,
&VectorUopGenerator::generateScalarMoveUops_<InstArchInfo::UopGenType::SCALAR_MOVE>);
}

void VectorUopGenerator::onBindTreeLate_() { mavis_facade_ = getMavis(getContainer()); }
Expand Down Expand Up @@ -359,7 +366,7 @@ namespace olympia
}
}

// For narrowing insturction,
// For narrowing instruction,
if constexpr (Type == InstArchInfo::UopGenType::NARROWING)
{
sparta_assert(src_rs3.field_id != mavis::InstMetaData::OperandFieldID::NONE,
Expand Down Expand Up @@ -479,9 +486,10 @@ namespace olympia
return makeInst_(srcs, dests);
}

InstPtr VectorUopGenerator::generatePermuteUops_()
template <InstArchInfo::UopGenType Type>
InstPtr VectorUopGenerator::generateScalarMoveUops_()
{
sparta_assert(false, "Vector permute uop generation is currently not supported!");
sparta_assert(false, "Vector Scalar move implementation TODO ...");
}

InstPtr VectorUopGenerator::makeInst_(const mavis::OperandInfo::ElementList & srcs,
Expand Down
4 changes: 3 additions & 1 deletion core/vector/VectorUopGenerator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ namespace olympia

template <InstArchInfo::UopGenType Type> InstPtr generateSlideUops_();

InstPtr generatePermuteUops_();
// InstPtr generatePermuteUops_();

template <InstArchInfo::UopGenType Type> InstPtr generateScalarMoveUops_();

InstPtr makeInst_(const mavis::OperandInfo::ElementList & srcs,
const mavis::OperandInfo::ElementList & dests);
Expand Down
Loading
Loading