This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [PATCHv2] Implementing ARC NPS-400 Ultra Ip and Miscellaneous instructions


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;
> +}
> +


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]