PowerPC For Dummies: A simplified guide to understanding the PowerPC Instruction Set
#7
(06-23-2021, 10:00 PM)Vega Wrote: Nice guide! Btw, here's an explanation of what eieio is...

Eieio is usually used with sync to create strict memory barriers. For Wii related stuff, it's used to ensure proper communication with the SEEPROM.

Normally, many different instructions can be executed out of order (such as load instructions)

Store instructions are always executed in order in when speaking in reference to each other but that doesn't mean they execute in order when referenced to non-store instructions. This is known as store gathering. Store gathering can be disabled by the Hardware Registers (HID0 - SGE bit), or you can use eieio (preferably immediately after your desired store instruction). Even if Store Gathering is enabled in HID0, eieio will prevent it.

example:
lwz rD, VALUE (rA) #Load Value from SEEPROM
sync #Wait for all instructions to finish before continuing <----start of memory 'barrier'
ori rD, rD, VALUE #Edit Value
stw rD, VALUE (rA) #Update New Value on SEEPROM
eieio #Prevent Store Gathering <----end of memory 'barrier'



Also, your definition and example for mr is incorrect.

Move Register actually copies a value from one register to another, A basic copy-paste, not a cut-paste.

mr is the simplified mnemonic for or (the register is just or'd with itself)

example:
mr r0, r1 = or r0, r1, r1

Thanks! I have a question though. Is "isync" the same as eieio? I wasn't able to tell based on it's description I found.
Reply


Messages In This Thread
RE: PowerPC For Dummies: A simplified guide to understanding the PowerPC Instruction Set - by JimmyKazakhstan - 06-24-2021, 12:22 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)