Closed dezgeg closed 6 months ago
The previous logic for whether to allow gp addressing for symbol+offset seems incomplete. I tested this C with vec declared in different ways:
vec
extern VECTOR vec; void Test(SVECTOR* v) { vec.vx = v->vx; vec.vy = v->vy; vec.vz = v->vz; }
and results for gcc 2.7.2.SN32.3.7.0002 + aspsx 2.56 are:
C variable type | gp used? | asm declaration -----------------------------------+-----------------+--------------------------- extern | never | .extern vec, 16 func static initialized | always | .sdata; vec.2: .word 1,2,3 func static uninitialized | always | .lcomm vec.2,16 global static initialized | always | .sdata; vec: .word 1,2,3 global static uninitialized | always | .lcomm vec,16 global initialized | always | .sdata; vec: .word 1,2,3 global uninitialized | only w/o offset | .comm vec,16 global uninitialized w/-fno-common | always | .sdata; vec: .space 16
so it seems only symbols declared with .comm shouldn't be allowed to use offset in older aspsx.
Ok, so there's a distinction between .comm and .lcomm. I'll have a look at this tomorrow and add some new tests based on my findings, thanks for raising this.
.comm
.lcomm
The previous logic for whether to allow gp addressing for symbol+offset seems incomplete. I tested this C with
vec
declared in different ways:and results for gcc 2.7.2.SN32.3.7.0002 + aspsx 2.56 are:
so it seems only symbols declared with .comm shouldn't be allowed to use offset in older aspsx.