diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-08-11 14:42:08 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-08-22 09:25:34 +0200 |
| commit | bea53a10f6db02d7253fa9f05390bc4caad14628 (patch) | |
| tree | f5af753adf8072f36846e12e8dfcb85b69319c4a /simplify.c | |
| parent | bb6d1415822f539e44b825f180a063b917c07612 (diff) | |
| download | sparse-dev-bea53a10f6db02d7253fa9f05390bc4caad14628.tar.gz | |
document simplify_mask_or() & simplify_mask_or_and()
These function are relatively complex and will be even more.
Add minimal documentation to them.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'simplify.c')
| -rw-r--r-- | simplify.c | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -577,6 +577,17 @@ undef: return NULL; } +/// +// Simplifications +// ^^^^^^^^^^^^^^^ + +/// +// try to simplify OP(OR(AND(x, M'), b), K) +// @insn: the 'masking' instruction +// @mask: the mask associated to @insn (M) +// @ora: one of the OR's operands +// @orb: the other OR's operand +// @return: 0 if no changes have been made, one or more REPEAT_* flags otherwise. static int simplify_mask_or_and(struct instruction *insn, unsigned long long mask, pseudo_t ora, pseudo_t orb) { @@ -596,6 +607,16 @@ static int simplify_mask_or_and(struct instruction *insn, unsigned long long mas return replace_pseudo(insn, &insn->src1, orb); } +/// +// try to simplify OP(OR(a, b), K) +// @insn: the 'masking' instruction +// @mask: the mask associated to @insn (M): +// @or: the OR instruction +// @return: 0 if no changes have been made, one or more REPEAT_* flags otherwise. +// +// For the @mask (M): +// * if OP(x, K) == AND(x, M), @mask M is K +// * if OP(x, K) == LSR(x, S), @mask M is (-1 << S) static int simplify_mask_or(struct instruction *insn, unsigned long long mask, struct instruction *or) { pseudo_t src1 = or->src1; |
