Re: [PATCH][RX] v2 instructions support

Mike Frysinger
2015-12-25T16:57:13Z

[-- Attachment #1: Type: text/plain, Size: 3359 bytes --]

On 25 Dec 2015 23:19, Yoshinori Sato wrote:
> +rxfp_fsqrt (fp_t fa)
> ...
> + tprintf("sqrt(%g) = %g\n", da, sqrt(da));
> +
> + double_to_fp (sqrt(da), &c);

needs space before the ( -- comes up three times here

> +void
> +get_acc (int id, acc_t *acc)
> {
> + if (id >= 2)
> + abort ();
> + *acc = regs.r_acc[id];
> + if (trace > 0)
> + printf ("get_reg (%s) = %08x%016lx\n", reg_names[acc0 + id], acc->hi, acc->lo);

don't you want to use tprintf ?

> +put_acc (int id, acc_t *acc)
> {
> + if (id >= 2)
> + abort ();
> + if (trace > 0)
> + printf ("put_reg (%s) = %08x%016lx\n", reg_names[acc0 + id], acc->hi, acc->lo);

same here

> + {
> + if (tag) { printf (tag); tag = 0; }

need to unwrap this:
if (tag)
{
printf (tag);
tag = NULL;
}

> +#define MULADD(val, s) \
> +{ \
> + get_acc (opcode->op[0].reg - 32, &acc); \

these macro bodies are indented by one space when they should start at two

> +#define MULSUB(val, s) \
> +{ \
> + get_acc (opcode->op[0].reg - 32, &acc); \

same here

> +#define MULACC(val, s) \
> +{ \
> + sll = val; \

same here

> +#define RAC(add, pl, ml) \
> +{ \
> + get_acc (opcode->op[0].reg - 32, &acc); \

and here

> + case RXO_emaca:
> + MULADD((long long)GS2 () * (long long)GS (), 0)
> +
> + case RXO_emsba:
> + MULSUB((long long)GS2 () * (long long)GS (), 0)

space before the (

> + tprintf ("(int) %g = %d\n", int2float(ma), mb);

space before the ( -- see int2float

> + tprintf ("(int) %g = %d\n", int2float(ma), mb);

same here

> case RXO_machi:
> + MULADD((long long)(signed short)(GS() >> 16) *
> + (long long)(signed short)(GS2 () >> 16), 16)
> +
> + case RXO_maclh:
> + MULADD((long long)(signed short)(GS()) *
> + (long long)(signed short)(GS2 () >> 16), 16)
>
> case RXO_maclo:
> + MULADD((long long)(signed short)(GS()) *
> + (long long)(signed short)(GS2 ()), 16)

comes up a few times here w/ MULADD & GS

> + case RXO_msbhi:
> + MULSUB((long long)(signed short)(GS() >> 16) *
> + (long long)(signed short)(GS2 () >> 16), 16)
> +
> + case RXO_msblh:
> + MULSUB((long long)(signed short)(GS()) *
> + (long long)(signed short)(GS2 () >> 16), 16)
> +
> + case RXO_msblo:
> + MULSUB((long long)(signed short)(GS()) *
> + (long long)(signed short)(GS2 ()), 16)
>
> case RXO_mulhi:
> + MULACC((long long)(signed short)(GS() >> 16) *
> + (long long)(signed short)(GS2 () >> 16), 16)
> + case RXO_mullh:
> + MULACC((long long)(signed short)(GS()) *
> + (long long)(signed short)(GS2 () >> 16), 16)
>
> case RXO_mullo:
> + MULACC((long long)(signed short)(GS()) *
> + (long long)(signed short)(GS2 ()), 16)

and here w/ MULSUB & GS & MULACC

> case RXO_racw:
> + RAC(0x80000000ULL, 0x00007fff00000000ULL, 0xffff800000000000ULL)
> +
> + case RXO_rdacw:
> + RAC(0, 0x00007fff00000000ULL, 0xffffffff80000000ULL)
> +
> + case RXO_racl:
> + RAC(0x80000000ULL, 0x7fffffff00000000ULL, 0xffffffff80000000ULL)
> +
> + case RXO_rdacl:
> + RAC(0, 0x7fffffff00000000ULL, 0xffff800000000000ULL)

and here w/ RAC
-mike

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]