Skip to content

Commit

Permalink
remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
nunoplopes committed Dec 11, 2024
1 parent 40f9209 commit 9530422
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 25 deletions.
34 changes: 11 additions & 23 deletions ir/x86_intrinsics.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
#include "ir/x86_intrinsics.h"
#include "smt/expr.h"

using namespace smt;
using namespace std;

namespace IR {
// the shape of a vector is stored as <# of lanes, element bits>
static constexpr std::pair<unsigned, unsigned> binop_shape_op0[] = {
#define PROCESS(NAME, A, B, C, D, E, F) std::make_pair(C, D),
Expand All @@ -30,9 +28,7 @@ static constexpr unsigned binop_ret_width[] = {
#undef PROCESS
};

unsigned X86IntrinBinOp::getRetWidth(Op op) {
return binop_ret_width[op];
}
namespace IR {

vector<Value *> X86IntrinBinOp::operands() const {
return {a, b};
Expand All @@ -51,19 +47,17 @@ void X86IntrinBinOp::rauw(const Value &what, Value &with) {
RAUW(b);
}

string X86IntrinBinOp::getOpName(Op op) {
void X86IntrinBinOp::print(ostream &os) const {
const char *name;
switch (op) {
#define PROCESS(NAME, A, B, C, D, E, F) \
case NAME: \
return #NAME;
name = #NAME; \
break;
#include "x86_intrinsics_binop.inc"
#undef PROCESS
}
UNREACHABLE();
}

void X86IntrinBinOp::print(ostream &os) const {
os << getName() << " = " << getOpName(op) << " " << *a << ", " << *b;
os << getName() << " = " << name << ' ' << *a << ", " << *b;
}

StateValue X86IntrinBinOp::toSMT(State &s) const {
Expand Down Expand Up @@ -641,23 +635,17 @@ static constexpr unsigned terop_ret_width[] = {
#undef PROCESS
};

string X86IntrinTerOp::getOpName(Op op) {
void X86IntrinTerOp::print(ostream &os) const {
const char *name;
switch (op) {
#define PROCESS(NAME, A, B, C, D, E, F, G, H) \
case NAME: \
return #NAME;
name = #NAME; \
break;
#include "x86_intrinsics_terop.inc"
#undef PROCESS
}
UNREACHABLE();
}

unsigned X86IntrinTerOp::getRetWidth(Op op) {
return terop_ret_width[op];
}

void X86IntrinTerOp::print(ostream &os) const {
os << getName() << " = " << getOpName(op) << " " << *a << ", " << *b;
os << getName() << " = " << name << ' ' << *a << ", " << *b;
}

StateValue X86IntrinTerOp::toSMT(State &s) const {
Expand Down
2 changes: 0 additions & 2 deletions ir/x86_intrinsics.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class X86IntrinBinOp final : public Instr {
Op op;

public:
static unsigned getRetWidth(Op op);
X86IntrinBinOp(Type &type, std::string &&name, Value &a, Value &b, Op op)
: Instr(type, std::move(name)), a(&a), b(&b), op(op) {}
std::vector<Value *> operands() const override;
Expand Down Expand Up @@ -44,7 +43,6 @@ class X86IntrinTerOp final : public Instr {
Op op;

public:
static unsigned getRetWidth(Op op);
X86IntrinTerOp(Type &type, std::string &&name, Value &a, Value &b, Value &c,
Op op)
: Instr(type, std::move(name)), a(&a), b(&b), c(&c), op(op) {}
Expand Down

0 comments on commit 9530422

Please sign in to comment.