Sync, Eieio
I'm writing a HBC program (actually done with it, just trying to make sure it's as optimized as possible) that interacts with an external device. I need strict ordering for my load-store instructions. I'm changing bits in the Hollywood GPIO's, fyi.

Here's a snippet of code from the program

lwz r0, 0 (r11)
sync 0
ori r0, r0, XXXX #Set a bit in the register
stw r0, 0 (r11)

bl sub_routine

lwz r0, 0 (r11)
sync 0
rlwinm r0, r0, 0, XX, XX #Now remove the bit
stw r0, 0 (r11)

Sorry for the lack of detail, but I don't want to 'release' to much info before I decide to post my work entirely (it's sort of useless but still...). I essentially have to do a lot of these load-store combos (via various bits) with the GPIO. I was wondering if there is a better way to enforce ordering like 'globally' if that makes any sense... I don't like the idea of having to sync after every load and eieio after every store.

In the Broadway manual, I found this .. "If store gathering is enabled and the stores do not fall under the above categories, an eieio or sync construction must be used to prevent 2 stores from being gathered ... ... ... "

My stores do not fit in the category that was listed above the quote. So wouldn't I be able to simply set bit 24 (store gathering enable) of HID0 to 0, then switch the bit back to 1 once I'm done with messing with the GPIOs?
I don’t know much about those specific registers, but in general you can modify “settings” registers like that freely. Well, on the Wii U you can’t (you need to be operating in the kernel to have permissions for supervisor level instructions) but I believe the Wii has no such checks.

For example, if you modify the DR bit of the MSR to 0, as long as you don’t set it back, every load/store operation you do afterward will be with reference to the physical (not effective) address. I think setting HID0 would work similarly.
Yeah I don't know anything about this Tongue If anything I am going to learn a lot of things from this
(10-14-2019, 11:55 PM)Vega Wrote: Was lucky enough to be one of few to learn proper ASM. Now I just post random garbage on Make it to a 1000 thread.
Was lucky enough to be one of few to learn proper ASM. Now I'm writing codes that I hope amaze!  Tongue
Welp I noticed when you launch an HBC app, the HID0 register is 0x0011C664 (unless your own app changes this ofc...). The Bit 24 for Store-Gather-Enable is already set to 0. I removed the sync's and eieio's off my snippets of codes... and they all still work.

Added back the instructions after reading this article -

Forum Jump:

Users browsing this thread: 1 Guest(s)