P4C
The P4 Compiler
Loading...
Searching...
No Matches
slice.h
1
19#ifndef BF_P4C_COMMON_SLICE_H_
20#define BF_P4C_COMMON_SLICE_H_
21
22#include "ir/ir.h"
23#include "lib/safe_vector.h"
24
25using namespace P4;
26
29std::pair<int, int> getSliceLoHi(const IR::Expression *e);
30
39const IR::Expression *MakeSlice(const IR::Expression *e, int lo, int hi);
40inline const IR::Expression *MakeSlice(const IR::Expression *e, le_bitrange slice) {
41 return MakeSlice(e, slice.lo, slice.hi);
42}
43
50const IR::Expression *MakeSliceDestination(const IR::Expression *e, int lo, int hi);
51
59const IR::Expression *MakeSliceSource(const IR::Expression *read, int lo, int hi,
60 const IR::Expression *write);
61
66safe_vector<const IR::Expression *> convertMaskToSlices(const IR::Mask *m);
67
73const IR::Expression *MakeWrappedSlice(const IR::Expression *e, int lo, int hi, int wrap_size);
74
75#endif /* BF_P4C_COMMON_SLICE_H_ */
Definition safe_vector.h:27
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24
int lo
Definition lib/bitrange.h:694
int hi
Definition lib/bitrange.h:700