projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tic4x: sign extension using shifts
[deliverable/binutils-gdb.git]
/
opcodes
/
aarch64-dis.c
diff --git
a/opcodes/aarch64-dis.c
b/opcodes/aarch64-dis.c
index 8b32097a5fa116d728e7e70b15be11534740c843..7bd2c49aee39e724f3cce375cd2fa965f9c06718 100644
(file)
--- a/
opcodes/aarch64-dis.c
+++ b/
opcodes/aarch64-dis.c
@@
-1,5
+1,5
@@
/* aarch64-dis.c -- AArch64 disassembler.
/* aarch64-dis.c -- AArch64 disassembler.
- Copyright (C) 2009-20
19
Free Software Foundation, Inc.
+ Copyright (C) 2009-20
20
Free Software Foundation, Inc.
Contributed by ARM Ltd.
This file is part of the GNU opcodes library.
Contributed by ARM Ltd.
This file is part of the GNU opcodes library.
@@
-178,18
+178,15
@@
extract_all_fields (const aarch64_operand *self, aarch64_insn code)
}
/* Sign-extend bit I of VALUE. */
}
/* Sign-extend bit I of VALUE. */
-static inline
int32
_t
+static inline
uint64
_t
sign_extend (aarch64_insn value, unsigned i)
{
sign_extend (aarch64_insn value, unsigned i)
{
- uint
32_t ret = value
;
+ uint
64_t ret, sign
;
assert (i < 32);
assert (i < 32);
- if ((value >> i) & 0x1)
- {
- uint32_t val = (uint32_t)(-1) << i;
- ret = ret | val;
- }
- return (int32_t) ret;
+ ret = value;
+ sign = (uint64_t) 1 << i;
+ return ((ret & (sign + sign - 1)) ^ sign) - sign;
}
/* N.B. the following inline helpfer functions create a dependency on the
}
/* N.B. the following inline helpfer functions create a dependency on the
@@
-658,7
+655,7
@@
aarch64_ext_imm (const aarch64_operand *self, aarch64_opnd_info *info,
const aarch64_inst *inst ATTRIBUTE_UNUSED,
aarch64_operand_error *errors ATTRIBUTE_UNUSED)
{
const aarch64_inst *inst ATTRIBUTE_UNUSED,
aarch64_operand_error *errors ATTRIBUTE_UNUSED)
{
- int64_t imm;
+
u
int64_t imm;
imm = extract_all_fields (self, code);
imm = extract_all_fields (self, code);
This page took
0.024546 seconds
and
4
git commands to generate.