I don't see a problem with reentrancy or recursion if the code follows the 
documented guidelines.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3


________________________________________
From: IBM Mainframe Assembler List <ASSEMBLER-LIST@LISTSERV.UGA.EDU> on behalf 
of Thomas David Rivers <riv...@dignus.com>
Sent: Wednesday, September 30, 2020 6:15 PM
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Subject: Re: Register saving formats

What if:

 a) your function is (directly or indirectly) recursive?

 b) your program needs to be RENT?

Mix this problem with the problem of dynamically allocating save
area and it gets to be quite an issue.

The Dignus C runtime makes the same guarantee of the high-halves that
the IBM Assembler Services do (when a 31-bit routine invokes a 64-bit
one), as was mentioned before, only the high-halves of R2-R14 are guaranteed
to be unchanged for a normal 64-bit function.

The Dignus C compiler _can_ generate code that uses the high-halves
of registers, and depending on different environment options, will save
and restore those 64-bit registers in the caller... which is an
even easier approach (the caller has allocated space for this in its DSA.)
That way the invoked function can do whatever it needs to them.
It's surprising how little saving/restoring winds up happening,
as the full 64-bit registers are not frequently busy across a function
call in a 31-bit environment.

So - that could be another approach, and it would allow you to use
standard linkage.

        - Dave R. -

--
riv...@dignus.com                        Work: (919) 676-0847
Get your mainframe programming tools at 
http://secure-web.cisco.com/1kEaHjwuENl2Xn-yVtTTPAjmKO5dvKcgMh6_C2adAYlTfz_I4vHdu3qv1rD9o6R5HsChIieskI5B2eZQubh0W4OBDCjdmiJqG5YIAwEHDi1p-K0nmO4O8HAO6KFNJS_Up8irmbhL2vZBMVTo2-jbkrZAipE6HiSvBhQOjbBqkFcQqRIaesAweJnyvikAsGnfT5alYND9GlegzsEfnANbc_mS-npWlEI7l1p5Yn9WRA67beBHxuu6UaNGk_AqymXKw_KhhFxnDuUF4xCyJJKTWAMzFTRNVEnpwy-eoSkcKsiyRVeYnDLNY7ZAqGeZ1NP_PVvnXSrmscvVDPmzTWKbFIDC1swyJJtuxzmhSS3Fp6gzzuEM_UsowmcBG4JjLpRiR-Wz3i1MCW6RVQnZ4SZYREigYfU7mE9naGHs1VfmTZvHS3aKuyJaX-Pz77agn_C86/http%3A%2F%2Fwww.dignus.com

Reply via email to