Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISA change proposal: Allow branches in the second issue slot #73

Open
2 tasks
Emoun opened this issue Sep 16, 2020 · 0 comments
Open
2 tasks

ISA change proposal: Allow branches in the second issue slot #73

Emoun opened this issue Sep 16, 2020 · 0 comments

Comments

@Emoun
Copy link
Member

Emoun commented Sep 16, 2020

This issue will track the discussion into changing the Patmos ISA to allow branches in the second issue slot.

Motivation

The limitation of not allowing branch instructions in the second issue slot is slightly "artificial" in that there are no technical reasons for it (as there is for load instructions.)
However, allowing branches in the second issue slot can provide significant benefit. One example is string copying, where we can use it in an implementation that only uses 3 cycles per character (amortized):

         pmov   $p1 = $p0
loop:
{  ($p1) lbuc   $r1 = [$r2]     ; Load next char
   ($p1) br     loop           }; Loop if not done
{  ($p1) add    $r2 = $r2, 1    ; Increment source pointer
   ($p1) add    $r3 = $r3, 1   }; Increment target pointer
{  ($p1) sbc    [$r3-1] = $r1   ; Save char
         cmpneq $p1 = $r1, 0   }; Check whether null was reached

Note: There might be a better way to do this by loading 4 chars at a time, but this is the fastest way to do it while loading only 1 char at a time.

Todo:

  • Implement in simulator
  • Benchmark on simulator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant