unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* scm_remember_upto_here asm volatile
@ 2003-05-11 22:19 Kevin Ryde
  2003-05-17 20:26 ` Marius Vollmer
  0 siblings, 1 reply; 10+ messages in thread
From: Kevin Ryde @ 2003-05-11 22:19 UTC (permalink / raw)


I was contemplating scm_remember_upto_here_1 and friends and wondered
if thought had been given to doing them in gcc as

    #define scm_remember_upto_here_1(x)             \
      do {                                          \
        asm volatile ("" : : "g" (x));              \
      } while (0)

    #define scm_remember_upto_here_2(x, y)          \
      do {                                          \
        scm_remember_upto_here_1 (x);               \
        scm_remember_upto_here_1 (y);               \
      } while (0)

"volatile" stops the asm being moved, though it can still go dead.
"g" will mean the value isn't forced into a register, a stack
reference is ok.  (Though gcc quite likes bringing things into
registers.)

Avoiding function calls should make the resulting code a little
smaller and faster.  numbers.o comes down from 45k to 43k for me (i386
debian gcc 3.2 -O3), which is not huge but better than a poke in the
eye with a burnt stick.

Unfortunately I can't see how to do the varargs scm_remember_upto_here
the same way.  But it's not used in the main guile code as far as I
can tell.


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


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

end of thread, other threads:[~2003-08-27 23:49 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-11 22:19 scm_remember_upto_here asm volatile Kevin Ryde
2003-05-17 20:26 ` Marius Vollmer
2003-05-19  0:24   ` Kevin Ryde
2003-06-01 18:47     ` Marius Vollmer
2003-06-01 19:29       ` Mikael Djurfeldt
2003-08-13 21:09         ` Kevin Ryde
2003-08-23 10:32           ` Dirk Herrmann
2003-08-25 23:48             ` Kevin Ryde
2003-08-27  4:28               ` Dirk Herrmann
2003-08-27 23:49                 ` Kevin Ryde

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).