unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* MPS: nativecomp ABI
@ 2024-07-05 14:44 Pip Cet
  2024-07-06 17:53 ` Andrea Corallo
  0 siblings, 1 reply; 4+ messages in thread
From: Pip Cet @ 2024-07-05 14:44 UTC (permalink / raw)
  To: Emacs Devel, Andrea Corallo

Hello,

I'm working on scratch/igc. One thing I'd like to do is put the IGC header which all objects will require (for now) into these structs:

struct Lisp_Cons
struct Lisp_Symbol
struct Lisp_String
struct Lisp_Float
union vectorlike_header

IIUC, this means changing the nativecomp ABI hash (which means I'll have to rebuild the .eln files, I think) and adjusting any nativecomp code which knows about the structure layouts. However, I've only been able to find that for Lisp_Cons and struct Lisp_Symbol_With_Pos, which declares its header as ptrdiff_t. Are there more, or do the others all use C functions for access?

Things appear to work, but I'd rather not miss anything and haven't looked at this code in years.

Thanks!
Pip



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: MPS: nativecomp ABI
  2024-07-05 14:44 MPS: nativecomp ABI Pip Cet
@ 2024-07-06 17:53 ` Andrea Corallo
  2024-07-07 19:11   ` Pip Cet
  0 siblings, 1 reply; 4+ messages in thread
From: Andrea Corallo @ 2024-07-06 17:53 UTC (permalink / raw)
  To: Pip Cet; +Cc: Emacs Devel

Pip Cet <pipcet@protonmail.com> writes:

> Hello,
>
> I'm working on scratch/igc. One thing I'd like to do is put the IGC header which all objects will require (for now) into these structs:
>
> struct Lisp_Cons
> struct Lisp_Symbol
> struct Lisp_String
> struct Lisp_Float
> union vectorlike_header
>
> IIUC, this means changing the nativecomp ABI hash (which means I'll
> have to rebuild the .eln files, I think) and adjusting any nativecomp
> code which knows about the structure layouts. However, I've only been
> able to find that for Lisp_Cons and struct Lisp_Symbol_With_Pos, which
> declares its header as ptrdiff_t. Are there more, or do the others all
> use C functions for access?
>
> Things appear to work, but I'd rather not miss anything and haven't looked at this code in years.
>
> Thanks!
> Pip

Hello,

I believe the easiest is that you compile a .eln with
native-comp-debug >= 2 and have a look to the generated pseudo C.

Indipendently to the code being compiled, on top you'll see all the
structures defined to libgccjit.

I'll not have access to a machine where I can do it before next week but
this is the easiest way to aswer your question.

  Andrea



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: MPS: nativecomp ABI
  2024-07-06 17:53 ` Andrea Corallo
@ 2024-07-07 19:11   ` Pip Cet
  2024-07-08  9:08     ` Andrea Corallo
  0 siblings, 1 reply; 4+ messages in thread
From: Pip Cet @ 2024-07-07 19:11 UTC (permalink / raw)
  To: Andrea Corallo; +Cc: Emacs Devel

On Saturday, July 6th, 2024 at 17:53, Andrea Corallo <acorallo@gnu.org> wrote:
> Pip Cet pipcet@protonmail.com writes:
> > I'm working on scratch/igc. One thing I'd like to do is put the IGC header which all objects will require (for now) into these structs:
> >
> > struct Lisp_Cons
> > struct Lisp_Symbol
> > struct Lisp_String
> > struct Lisp_Float
> > union vectorlike_header
> >
> > IIUC, this means changing the nativecomp ABI hash (which means I'll
> > have to rebuild the .eln files, I think) and adjusting any nativecomp
> > code which knows about the structure layouts. However, I've only been
> > able to find that for Lisp_Cons and struct Lisp_Symbol_With_Pos, which
> > declares its header as ptrdiff_t. Are there more, or do the others all
> > use C functions for access?
> >
> > Things appear to work, but I'd rather not miss anything and haven't looked at this code in years.
> >
> > Thanks!
> > Pip

> I believe the easiest is that you compile a .eln with
> native-comp-debug >= 2 and have a look to the generated pseudo C.
>

> Indipendently to the code being compiled, on top you'll see all the
> structures defined to libgccjit.

Thanks for the advice. That worked for me, though I must confess I was looking in the wrong place for the pseudo-C code.

Pip



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: MPS: nativecomp ABI
  2024-07-07 19:11   ` Pip Cet
@ 2024-07-08  9:08     ` Andrea Corallo
  0 siblings, 0 replies; 4+ messages in thread
From: Andrea Corallo @ 2024-07-08  9:08 UTC (permalink / raw)
  To: Pip Cet; +Cc: Emacs Devel

Pip Cet <pipcet@protonmail.com> writes:

> On Saturday, July 6th, 2024 at 17:53, Andrea Corallo <acorallo@gnu.org> wrote:
>> Pip Cet pipcet@protonmail.com writes:
>> > I'm working on scratch/igc. One thing I'd like to do is put the IGC header which all objects will require (for now) into these structs:
>> >
>> > struct Lisp_Cons
>> > struct Lisp_Symbol
>> > struct Lisp_String
>> > struct Lisp_Float
>> > union vectorlike_header
>> >
>> > IIUC, this means changing the nativecomp ABI hash (which means I'll
>> > have to rebuild the .eln files, I think) and adjusting any nativecomp
>> > code which knows about the structure layouts. However, I've only been
>> > able to find that for Lisp_Cons and struct Lisp_Symbol_With_Pos, which
>> > declares its header as ptrdiff_t. Are there more, or do the others all
>> > use C functions for access?
>> >
>> > Things appear to work, but I'd rather not miss anything and haven't looked at this code in years.
>> >
>> > Thanks!
>> > Pip
>
>> I believe the easiest is that you compile a .eln with
>> native-comp-debug >= 2 and have a look to the generated pseudo C.
>>
>
>> Indipendently to the code being compiled, on top you'll see all the
>> structures defined to libgccjit.
>
> Thanks for the advice. That worked for me, though I must confess I was looking in the wrong place for the pseudo-C code.

Right I improved the doc to make it clear where to find it.

  Andrea



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-07-08  9:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-05 14:44 MPS: nativecomp ABI Pip Cet
2024-07-06 17:53 ` Andrea Corallo
2024-07-07 19:11   ` Pip Cet
2024-07-08  9:08     ` Andrea Corallo

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).