Register variables notation style = SOLVED!! Thanks Migario
Posted: Wed Jun 20, 2012 2:13 pm
I'm currently walking into a problem with GCC refusing to follow what is documented for which register to have a named variable placed into.
Ive got ~24 variables I need fixated into a defined register layout around the SysV ABI calling style and I have to keep all changes to these variables when they are in use from a private process across two libraries worth of functions in addition to the private process functionality...
Has anyone else looked at what constraints or other options there are for the current SDK edition of GCC?
If there is any equivalent to declaring a variable in a register and using it from that register for the duration of a function (where the register *will* keep state into the next function call) without leaving the compiler to handle which register the variable ends up in...(I need a specific direct layout for use with inline assembly), I would like to get my hands on some examples please...
this is so that I can actively define an extended API/ABI calling convention within polymorph for its extensive plugin mechanism...
I have tried to follow what I can in the GCC documentation and so far failed to have any C variables retained in a register on calling into inline assembly...
Defining an Inline Assembly block so far has been the easy part... but retaining state on-entry and on-exit from that assembly without the entire system getting mangled in the process has been annoying (so far I have not seen GCC place any variable where I want it and it also insists on prologue and epilogue doing save/restore of the registers concerned... I do not need nor want this... this actively breaks what I am writing)
I was originally able to do this with SAS/C6.58 on the 680x0 series however I would like to get to grips with the same facilities inside GCC as that is the native compiler in the SDK that I can make use of (yes, I admit I am being a picky pain in the ass about this and I have my reasons)
any assistance with examples would be more appreciated than getting the same documentation thrown at me which I have already tried to deal with.
Ive got ~24 variables I need fixated into a defined register layout around the SysV ABI calling style and I have to keep all changes to these variables when they are in use from a private process across two libraries worth of functions in addition to the private process functionality...
Has anyone else looked at what constraints or other options there are for the current SDK edition of GCC?
If there is any equivalent to declaring a variable in a register and using it from that register for the duration of a function (where the register *will* keep state into the next function call) without leaving the compiler to handle which register the variable ends up in...(I need a specific direct layout for use with inline assembly), I would like to get my hands on some examples please...
this is so that I can actively define an extended API/ABI calling convention within polymorph for its extensive plugin mechanism...
I have tried to follow what I can in the GCC documentation and so far failed to have any C variables retained in a register on calling into inline assembly...
Defining an Inline Assembly block so far has been the easy part... but retaining state on-entry and on-exit from that assembly without the entire system getting mangled in the process has been annoying (so far I have not seen GCC place any variable where I want it and it also insists on prologue and epilogue doing save/restore of the registers concerned... I do not need nor want this... this actively breaks what I am writing)
I was originally able to do this with SAS/C6.58 on the 680x0 series however I would like to get to grips with the same facilities inside GCC as that is the native compiler in the SDK that I can make use of (yes, I admit I am being a picky pain in the ass about this and I have my reasons)
any assistance with examples would be more appreciated than getting the same documentation thrown at me which I have already tried to deal with.