P4C
The P4 Compiler
Loading...
Searching...
No Matches
pad_alignment.h
1
18
19#ifndef BACKENDS_TOFINO_BF_P4C_LIB_PAD_ALIGNMENT_H_
20#define BACKENDS_TOFINO_BF_P4C_LIB_PAD_ALIGNMENT_H_
21
22#include "lib/algorithm.h"
23
24static inline int getAlignment(int bitSize) {
25 int nextByteBoundary = 8 * ROUNDUP(bitSize, 8);
26 return (nextByteBoundary - bitSize);
27}
28
29#endif /* BACKENDS_TOFINO_BF_P4C_LIB_PAD_ALIGNMENT_H_ */