This code is the most optimal way to convert an integer of any value to float, supporting negative values and being self contained:
NOTE: This is meant to be called as a function
Code:
# Args: r3 = Integer to convert to float
# Returns: f1 = Float representation of the input integer
lis r4, 0x5980
ori r4, r4, 0x0004
stw r4, -0x4 (sp)
lis r4, 0x4330
lfs f1, -0x4 (sp)
xoris r3, r3, 0x8000
stw r3, -0x4 (sp)
stw r4, -0x8 (sp)
lfd f0, -0x8 (sp)
fsubs f1, f0, f1
blr
NOTE: This is meant to be called as a function
Super Mario Eclipse, what Super Mario Sunshine could've been.