This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
RE: [PATCHv2] Implementing ARC NPS-400 Ultra Ip and Miscellaneous instructions
- From: Claudiu Zissulescu <Claudiu dot Zissulescu at synopsys dot com>
- To: Rinat Zelig <rinat at mellanox dot com>, Nick Clifton <nickc at redhat dot com>, "binutils at sourceware dot org" <binutils at sourceware dot org>
- Cc: Francois Bedard <Francois dot Bedard at synopsys dot com>, "Cupertino dot Miranda at synopsys dot com" <Cupertino dot Miranda at synopsys dot com>, Noam Camus <noamca at mellanox dot com>, Andrew Burgess <andrew dot burgess at embecosm dot com>
- Date: Mon, 27 Mar 2017 09:16:50 +0000
- Subject: RE: [PATCHv2] Implementing ARC NPS-400 Ultra Ip and Miscellaneous instructions
- Authentication-results: sourceware.org; auth=none
- References: <DB6PR0501MB2615B3C68DA56D240E4BB952C53C0@DB6PR0501MB2615.eurprd05.prod.outlook.com>
Hi Rinat,
There are a number of issues related with this patch (inserted). I would also recommend you to use the check_GNU_style.sh script which you can find in any gcc/contrib sources. The script should do some easy to spot check on GNU coding standards [1]. If you use emacs, I would recommend to use Whitespace package[2] for spotting the trailing spaces and or missing tabs.
On top of the above when I do:
git apply --check <your_patch>
I am getting:
fatal: corrupt patch at line 273
It will be nice if you can also check why it is so.
Cheers,
Claudiu
Reference:
[1] https://www.gnu.org/prep/standards/standards.html
[2] https://www.emacswiki.org/emacs/WhiteSpace
> +BRAKETdup, BRAKET, NPS_CM, COLON, NPS_R_SRC2_3B, BRAKETdup,
> +NPS_MISC_IMM_SIZE }, { C_NPS_SR, C_NPS_M }},
> +
> +#define ASRI_LIKE(SUBOP2, FLAG)
> \
This line exceeds 80 characters.
> +static unsigned long long
> +insert_nps_size_16bit (unsigned long long insn ATTRIBUTE_UNUSED,
> + long long int value ATTRIBUTE_UNUSED,
> + const char **errmsg ATTRIBUTE_UNUSED) {
The brace (i.e., { ) should be on the next line.
> + if ((value < 1) || (value > 64))
> + {
> + *errmsg = _("Invalid size value must be on range 1-64.");
> + value = 0;
> + }
> + value = value & 0x3f;
> + insn |= (value << 6);
> + return insn;
> +}
> +
> +static long long int
> +extract_nps_size_16bit (unsigned long long insn ATTRIBUTE_UNUSED,
> + bfd_boolean * invalid ATTRIBUTE_UNUSED) {
The brace (i.e., { ) should be on the next line.
> + return ((insn & 0xfc0) >> 6) ? ((insn & 0xfc0) >> 6) : 64; }
The brace (i.e., { ) should be on the next line.
> +static unsigned long long
> +insert_nps_misc_imm_offset (unsigned long long insn
> ATTRIBUTE_UNUSED,
> + long long int value ATTRIBUTE_UNUSED,
> + const char **errmsg ATTRIBUTE_UNUSED) {
The brace (i.e., { ) should be on the next line.
> + if (value & 0x3)
> + {
> + *errmsg = _("Invalid position, should be 0,4, 8,...124.");
> + value = 0;
> + }
> + insn |= (value << 6);
> + return insn;
> +}
> +
> +static long long int
> +extract_nps_misc_imm_offset (unsigned long long insn
> ATTRIBUTE_UNUSED,
> + bfd_boolean * invalid ATTRIBUTE_UNUSED) {
The brace (i.e., { ) should be on the next line.
> + return ((insn >> 8) & 0x1f) * 4;
> +}
> +