P4C
The P4 Compiler
Loading...
Searching...
No Matches
check_for_unimplemented_features.h
1
19#ifndef BACKENDS_TOFINO_BF_P4C_COMMON_CHECK_FOR_UNIMPLEMENTED_FEATURES_H_
20#define BACKENDS_TOFINO_BF_P4C_COMMON_CHECK_FOR_UNIMPLEMENTED_FEATURES_H_
21
22#include <optional>
23
24#include "ir/ir.h"
25#include "ir/pass_manager.h"
26
35class CheckOperations : public Inspector {
36 // Helper that removes casts to make identifying unsupported operator
37 // combinations easier.
38 struct RemoveCasts : public Transform {
39 IR::Node *preorder(IR::Cast *cast) override { return cast->expr->clone(); }
40 };
41
44 std::optional<const IR::Operation_Binary *> getSrcBinop(const IR::MAU::Primitive *p) const;
45
48 bool isFunnelShift(const IR::MAU::Primitive *p) const;
49
52 bool isModBitMask(const IR::MAU::Primitive *p) const;
53
54 bool preorder(const IR::MAU::Primitive *) override;
55};
56
57class CheckForUnimplementedFeatures : public PassManager {
58 public:
60 addPasses({
61 new CheckOperations(),
62 });
63 }
64};
65
66#endif /* BACKENDS_TOFINO_BF_P4C_COMMON_CHECK_FOR_UNIMPLEMENTED_FEATURES_H_ */
Definition check_for_unimplemented_features.h:57
Definition check_for_unimplemented_features.h:35