metaforce/hecl-gui/VectorISATableModelIntel.hpp

97 lines
2.2 KiB
C++
Raw Normal View History

2018-10-07 03:41:18 +00:00
#pragma once
#include "VectorISATableModel.hpp"
2018-12-08 05:19:40 +00:00
class VectorISATableModelIntel : public VectorISATableModel {
Q_OBJECT
public:
2018-12-08 05:19:40 +00:00
VectorISATableModelIntel(QObject* parent = Q_NULLPTR) : VectorISATableModel(parent) {}
2019-08-30 07:40:25 +00:00
int columnCount(const QModelIndex& parent = QModelIndex()) const override { return 7; }
2019-08-30 07:40:25 +00:00
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override {
2018-12-08 05:19:40 +00:00
if (role != Qt::DisplayRole && role != Qt::UserRole)
return {};
2018-12-08 05:19:40 +00:00
if (role == Qt::UserRole) {
switch (index.column()) {
case 0:
default:
return true;
case 1:
return m_features.SSE1;
case 2:
return m_features.SSE2;
case 3:
return m_features.SSE3;
case 4:
return m_features.SSE41;
case 5:
return m_features.AVX;
case 6:
return m_features.AVX2;
}
} else {
switch (index.column()) {
case 0:
default:
return QStringLiteral("x87");
case 1:
return QStringLiteral("SSE");
case 2:
return QStringLiteral("SSE2");
case 3:
return QStringLiteral("SSE3");
case 4:
return QStringLiteral("SSE4.1");
case 5:
return QStringLiteral("AVX");
case 6:
return QStringLiteral("AVX2");
}
}
2018-12-08 05:19:40 +00:00
}
2018-12-08 05:19:40 +00:00
VectorISA getISA(int idx) const {
switch (idx) {
default:
return VectorISA::Invalid;
case 0:
return VectorISA::X87;
case 1:
return VectorISA::SSE;
case 2:
return VectorISA::SSE2;
case 3:
return VectorISA::SSE3;
case 4:
return VectorISA::SSE41;
case 5:
return VectorISA::AVX;
case 6:
return VectorISA::AVX2;
}
2018-12-08 05:19:40 +00:00
}
2018-12-08 05:19:40 +00:00
bool willRun(VectorISA visa) const {
switch (visa) {
default:
return false;
case VectorISA::X87:
return true;
case VectorISA::SSE:
return m_features.SSE1;
case VectorISA::SSE2:
return m_features.SSE2;
case VectorISA::SSE3:
return m_features.SSE3;
case VectorISA::SSE41:
return m_features.SSE41;
case VectorISA::AVX:
return m_features.AVX;
case VectorISA::AVX2:
return m_features.AVX2;
}
2018-12-08 05:19:40 +00:00
}
};