This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 3/3] arm-tdep.c: Refactor arm_decode_media
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: Simon Marchi <simon dot marchi at ericsson dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Thu, 11 Feb 2016 11:58:34 +0000
- Subject: Re: [PATCH 3/3] arm-tdep.c: Refactor arm_decode_media
- Authentication-results: sourceware.org; auth=none
- References: <1455121027-27061-1-git-send-email-simon dot marchi at ericsson dot com> <1455121027-27061-4-git-send-email-simon dot marchi at ericsson dot com>
Simon Marchi <simon.marchi@ericsson.com> writes:
> - switch (bits (insn, 20, 24))
> + uint8_t op1 = bits (insn, 20, 24);
> + uint8_t rd = bits (insn, 12, 15);
> + uint8_t op2 = bits (insn, 5, 7);
> + uint8_t rn = bits (insn, 0, 3);
> +
> + switch (op1)
op1 is only used once, I prefer using bits (insn, 20, 24) rather than
defining a new variable.
Other variables, like rd and rn, can be defined where they are used.
--
Yao (éå)