T.R | Title | User | Personal Name | Date | Lines |
---|
511.1 | More information from Doug | KMOOSE::CMCCUTCHEON | Charlie McCutcheon | Tue Apr 22 1997 14:29 | 20 |
| From: US2RMC::"[email protected]" "Douglas Rupp" 22-APR-1997 13:26:15.86
To: Charlie 22-Apr-1997 1249 -0500 <begin::cmccutcheon>
CC:
Subj: Re: VMS GDB: lib$callg and float args?
Charlie 22-Apr-1997 1249 -0500 wrote:
>
> >Lib$callg apparently doesn't work with floating point args, is that
> >right? Is there any (easy) way around this?
>
> How does it not work? Args aren't correct, or image access violates? ;-)
....
The args aren't correct. I think what happens is this: The called
function expects fp args to be passed in regs F16 and et al, but
lib$callg has no way of knowing if particular arg is fp, so it just
passes everything in R16 and et al. Seems like it would be simple
enough to pass a mask to lib$callg but it doesn't take one.
% ====== Internet headers and postmarks (see DECWRL::GATEWAY.DOC) ======
|
511.2 | Alternatives; Code Would Be Interesting | XDELTA::HOFFMAN | Steve, OpenVMS Engineering | Tue Apr 22 1997 15:01 | 17 |
|
CALLG is a VAX instruction, with no direct Alpha equivalent...
And yes, Alpha uses a parallel set of registers for floating point
storage and manipulation...
Consider passing the arguments by reference, and then redistribute
the arguments as appropriate. Or consider passing an array or
data structure by reference -- possibly with type-length-value
encoding or other scheme -- and then processing the structure as
appropriate in the receiving routine...
But code that would allow us to duplicate the problem would be quite
interesting and useful -- I'd expect that direct OpenVMS VAX code
would port to OpenVMS Alpha, even if floating point values were
passed around via lib$callg. (The contents of the argument array
are of central interest here.)
|
511.3 | | KMOOSE::CMCCUTCHEON | Charlie McCutcheon | Tue Apr 22 1997 18:03 | 8 |
| Doug tells me that Debug saw this and contacted him directly (thanks, Lon!).
It sounds like a restriction.
Doug's trying to implement an Ada '95 debugger (since VMS Debug won't be extended
for the '95 standard of Ada), and is trying to implement the "call" debug instruction.
I assume VMS Debug does this somehow on Alpha?
Charlie
|
511.4 | | AUSS::GARSON | DECcharity Program Office | Tue Apr 22 1997 20:50 | 28 |
| re .2
> But code that would allow us to duplicate the problem would be quite
> interesting and useful -- I'd expect that direct OpenVMS VAX code
> would port to OpenVMS Alpha, even if floating point values were
> passed around via lib$callg.
Passing a floating argument by value through LIB$CALLG does not seem to
work on V6.2. I can see why extra sophistication would be needed in
LIB$CALLG. It doesn't seem to be there. I don't have a V7.0 system to
test the customer's claim.
re .3
Quick testing of the debugger on Alpha VMS V6.2 suggests that it has not
solved this problem i.e. it doesn't work to use the CALL command to
pass a float by value. (Who knows? Maybe the debugger uses LIB$CALLG.)
You might want to ask in the DEBUG conference as to whether a later version
of VMS/DEBUG supports this.
re .1
LIB$CALLG doesn't have a mask because it is originates in VAX where a
mask isn't needed. It isn't clear to me whether a mask *argument* is
actually needed on Alpha since there are all these nice blocks like the
procedure descriptor and procedure signature that may already contain
the needed info.
|
511.5 | | KMOOSE::CMCCUTCHEON | Charlie McCutcheon | Wed Apr 23 1997 11:03 | 7 |
| > You might want to ask in the DEBUG conference as to whether a later version
> of VMS/DEBUG supports this.
Apparently Debug folk read this conference. They use other means than lib$callg apparently.
Thanks!
Charlie
|
511.6 | Not insoluble, and a subset looks easy | WIBBIN::NOYCE | Pulling weeds, pickin' stones | Wed Apr 23 1997 14:18 | 8 |
| At first glance, it seems as if LIB$CALLG ought to simply load each of the
first 6 longwords of the argument list into both the appropriate integer
register (R16 thru R21) and the appropriate floating register (F16 thry F21).
You could make this work properly for VAX F_float types. But if other types
(double-precision, or IEEE) are passed, you can't make them all work without
additional information. If the routine to be called was compiled /TIE, then
its procedure descriptor contains information about the arguments it expects,
and one could imagine LIB$CALLG using that...
|
511.7 | | AUSS::GARSON | DECcharity Program Office | Wed Apr 23 1997 20:09 | 13 |
| re .6
>But if other types (double-precision
Presumably double precision isn't an issue here. You just can't pass
double by value with LIB$CALLG, right? [I am aware that C on VAX has an
obnoxious hack that would require this and I can imagine that anyone
doing this would simply have non-portable code.]
>If the routine to be called was compiled /TIE,
Hmmm. Just for grins I tried that but on V6.2 it doesn't help. I think
we can assume that LIB$CALLG just doesn't have the smarts in V6.2.
|
511.8 | | AUSS::GARSON | DECcharity Program Office | Thu Apr 24 1997 04:12 | 3 |
| re .*
I've summarised this discussion in a QAR (V6 #01401).
|