This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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: [PATCH][RX] v2 instructions support


On 22 Dec 2015 02:34, Yoshinori Sato wrote:
> --- a/sim/rx/fpu.c
> +++ b/sim/rx/fpu.c
>  
> +double sqrt(double x);

never declare your own prototype for system funcs.  include math.h instead.

> +static FP_ExceptionCases ex_sqrt_tab[5][5] = {

please constify this.  you might have to update check_exceptions too.

> +  tprintf("sqrt(%g) = %g\n", da, sqrt(da));

space before the (.  this comes up a few times in your patch, so please
fix them all.

> +      /* Less than 0.49999 */

period at the end and two spaces:
	/* Less than 0.49999.  */

this comes up a few times in your patch, so please fix them all.

> +	if (rx_big_endian)
> +	  {
> +	    put_be (buf, 8, acc.lo);
> +	  }
> +	else
> +	  {
> +	    put_le (buf, 8, acc.lo);
> +	  }

no need for braces here

> +  for(i = 0; i < 2; i++)

space before the (

>      {
> -      if (tag) { printf (tag); tag = 0; }
> -      printf("  acc %016llx:", oldregs.r_acc);
> -      printf("%016llx", regs.r_acc);
> -      oldregs.r_acc = regs.r_acc;
> +      if (oldregs.r_acc[i].hi != regs.r_acc[i].hi ||
> +	  oldregs.r_acc[i].lo != regs.r_acc[i].lo)
> +	{
> +	  if (tag) { printf (tag); tag = 0; }
> +	  printf("  acc%d %08x%016lx:", i, oldregs.r_acc[i].hi,
> +		 oldregs.r_acc[i].lo);
> +	  printf("%08x%016lx", regs.r_acc[i].hi,
> +		 oldregs.r_acc[i].lo);
> +	  oldregs.r_acc[i] = regs.r_acc[i];
> +	}

i know you aren't writing this code, but please fix the style in the process.

> +#define MULADD(val, s)				\

the trailing \ style in these macros is inconsistent.  if you don't want to
align them to 80 cols, then just put one space before them.
-mike

Attachment: signature.asc
Description: Digital signature


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