Rizin
unix-like reverse engineering framework and cli tools
arm_il_common.inc
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: 2022 Florian Märkl <info@florianmaerkl.de>
2
// SPDX-License-Identifier: LGPL-3.0-only
3
7
static
RZ_OWN
RzILOpBool
*add_carry(
RZ_OWN
RzILOpBitVector
*
a
,
RZ_OWN
RzILOpBitVector
*
b
,
bool
with_carry,
ut32
bits
) {
8
RzILOpBitVector
*
r
=
ADD
(
UNSIGNED
(
bits
+ 1,
a
),
UNSIGNED
(
bits
+ 1,
b
));
9
if
(with_carry) {
10
r
=
ADD
(
r
,
ITE
(
VARG
(
"cf"
),
UN
(
bits
+ 1, 1),
UN
(
bits
+ 1, 0)));
11
}
12
return
MSB
(
r
);
13
}
14
18
static
RZ_OWN
RzILOpBool
*sub_carry(
RZ_OWN
RzILOpBitVector
*
a
,
RZ_OWN
RzILOpBitVector
*
b
,
bool
with_carry,
ut32
bits
) {
19
if
(with_carry) {
20
return
add_carry(
a
,
LOGNOT
(
b
),
true
,
bits
);
21
}
22
return
ULE
(
b
,
a
);
23
}
24
28
static
RZ_OWN
RzILOpBool
*add_overflow(
RZ_OWN
RzILOpBitVector
*
a
,
RZ_OWN
RzILOpBitVector
*
b
,
RZ_OWN
RzILOpBitVector
*res) {
29
return
AND
(
INV
(
XOR
(
MSB
(
a
),
MSB
(
b
))),
XOR
(
MSB
(
DUP
(
a
)),
MSB
(res)));
30
}
31
35
static
RZ_OWN
RzILOpBool
*sub_overflow(
RZ_OWN
RzILOpBitVector
*
a
,
RZ_OWN
RzILOpBitVector
*
b
,
RZ_OWN
RzILOpBitVector
*res) {
36
return
AND
(
XOR
(
MSB
(
a
),
MSB
(
b
)),
XOR
(
MSB
(
DUP
(
a
)),
MSB
(res)));
37
}
bits
int bits(struct state *s, int need)
Definition:
blast.c:72
r
#define r
Definition:
crypto_rc6.c:12
ut32
uint32_t ut32
Definition:
demangler_util.h:31
AND
#define AND
Definition:
ansidecl.h:254
XOR
#define XOR
Definition:
rsp_idec.c:212
ADD
#define ADD
Definition:
rsp_idec.c:200
LOGNOT
#define LOGNOT(x)
Definition:
rz_il_opbuilder_begin.h:77
UN
#define UN(l, val)
Definition:
rz_il_opbuilder_begin.h:40
ULE
#define ULE(x, y)
Definition:
rz_il_opbuilder_begin.h:86
INV
#define INV(x)
Definition:
rz_il_opbuilder_begin.h:54
ITE
#define ITE(c, t, f)
Definition:
rz_il_opbuilder_begin.h:38
UNSIGNED
#define UNSIGNED(n, x)
Definition:
rz_il_opbuilder_begin.h:59
MSB
#define MSB(x)
Definition:
rz_il_opbuilder_begin.h:82
VARG
#define VARG(name)
Definition:
rz_il_opbuilder_begin.h:99
RZ_OWN
#define RZ_OWN
Definition:
rz_types.h:62
DUP
@ DUP
Definition:
packet.c:12
b
#define b(i)
Definition:
sha256.c:42
a
#define a(i)
Definition:
sha256.c:41
rz_il_op_pure_t
An IL op performing a pure computation, 'a pure.
Definition:
rz_il_opcodes.h:399
librz
analysis
arch
arm
arm_il_common.inc
Generated by
1.9.1