Skip to content

IALU2 mode setting causes longer latency than necessary #42

@MichaelBell

Description

@MichaelBell

When setting integer arithmetic mode, the CONFIG register is set to 0x00080000.

If instead it was set to 0x00080001 IALU2 operations would have 1 less cycle of latency with no downside (because integer arithmetic operations never require rounding).

I believe the only change required is the following diff, but I'm not familiar enough with either gcc or the epiphany code within gcc to be certain there aren't other places that need changing.

--- a/gcc/config/epiphany/epiphany.c
+++ b/gcc/config/epiphany/epiphany.c
@@ -2618,7 +2618,7 @@ emit_set_fp_mode (int entity, int mode, HARD_REG_SET regs_
     {
       gcc_assert (mode >= 0 && mode <= 2);
       if (mode == 1)
-       emit_move_insn (MACHINE_FUNCTION (cfun)->or_mask, GEN_INT(0x00080000));
+       emit_move_insn (MACHINE_FUNCTION (cfun)->or_mask, GEN_INT(0x00080001));
       return;
     }
   else if (entity == EPIPHANY_MSW_ENTITY_CONFIG)

Cheers,
Mike

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions