Results 1 to 3 of 3

Thread: sh4 delayed branches all parallel executing

                  
   
  1. #1

    Default sh4 delayed branches all parallel executing

    Hi.This is my first post on this forum so hi everyone.
    I'm one of the developer working on dcemu and a couple of days back while i trying to run one demo which didn't work on dcemu.The reason why it didn't ran layed on a code like this

    TST R1 R1
    something
    BTS the_address_of_TST
    something
    move stuff from a given address to R1

    Does because of the superscalar nature of the sh4 the 2 instructions after a delayed branch always get executed?

    PS - Sorry if this isn't the right place to be asking this

  2. #2
    Dream Coder
    Join Date
    Apr 2004
    Location
    Miami, FL
    Age
    28
    Posts
    4,677
    Rep Power
    50

    Default

    no. even though the sh4 allows for multiple simultaneous opcode execution, it is smart enough not to let that happen with a delayed branch so that the asm can be written as normal. if you want to illicit that effect, the best way would be to do a jmp to another segment of code, and then execute two ops simultaneously (depending on the cycles of each of the ops of course).

    That is my understanding of the way it works, but i've only written a little asm code, so I could be wrong.
    If anyone is looking to buy, sell, trade games and support a developer directly at the same time, consider joining Goozex. Enjoy!

  3. #3
    DCEmu Coder fox68k's Avatar
    Join Date
    Aug 2004
    Location
    Spain
    Posts
    100
    Rep Power
    38

    Default

    Hi,

    the BT/S instruction is "branch if T with delayed slot". This is, the following instruction to the BT/S is executed before the jump is evaluated and despiting the fact the jump is taken. If the jump is taken, the "move stuff from a given address to R1" will not be executed.

    Cheers.
    - fox68k -

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •