Mail Archives: djgpp-workers/1998/04/28/08:01:32
Vik Heyndrickx wrote:
>
> Bill Currie wrote:
> > Although not exactly accurate, why not use `long long'? Or has that been
> > suggested already?
>
> You mean "long long unsigned", don't you ;-)
Of course:) But the number of bits was more important than the
signedness
> Not suggested until now. I thought of it a little, but there is nearly
> no use for having a single variable instead of (sel, ofs).
> 'long long' as a return value is nearly as bad as the situation
> experienced with functions like lseek that return -1 on failure: it will
> eventually turn in some problem.
True, that's why I suggested the structure hack below.
> > What about a __far_pointer structure? ie
> >
> > typedef struct {
> > unsigned long offs __attribute__((packed));
> > unsigned short sel __attribute__((packed));
> > } __far_pointer;
>
> The disadvantage may be that users will have to declare a struct,
Why? __far_pointer would be declared by the `far' function header file.
> however no objections on my part.
:)
> Returning the position within the string, however, seems still more
> useful.
But you can return a __far_pointer with the selector and offset (?
irrelevant, really, but I feel both is best) set to 0.
> Compiler support for far pointers would be useful, since the compiler's
> awareness of the segment register could mean that some of their reloads
> could be optimized out. Even when there would be no language support for
> far pointers, compiler support would be interesting.
Yeah, language support could get tricky (especially trying to declare a
far pointer to a far pointer and other nasty combinations). But it
would certainly be nice if gcc at least knew about the segment registers
and could thus optimise their useage, (ie it would be nice to be able to
specifiy them in the parameter and clobbered parts of extended asm (gcc
automaticly saving/restoring ds & es)).
However, any efforts in this direction will have to wait till I get gcc
working on big-endian i860s. It's become a bit of an obsession because
there's a comment in config/i860/i860.h saying that the big-endian i860
is too much trouble to support (gcc assumes mem endianness == reg
endianness, which breaks on the i860), and I want to prove it wrong.
Unfortunatly, gcc keeps dying one way or another whenever it does an
integer multiply, but I'm learning a lot about the internals of gcc in
the process. Cool fun, actully.
Bill
--
Leave others their otherness.
- Raw text -