home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c      Meh, in C you gotta define EVERYTHING      243,242 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 243,198 of 243,242   
   Waldek Hebisch to Bart   
   Re: printf and time_t   
   09 Feb 26 01:40:02   
   
   From: antispam@fricas.org   
      
   Bart  wrote:   
   >>> On 07/02/2026 22:48, Waldek Hebisch wrote:   
   >   
   >> BTW, my amd64 code is assembler, so off-topic here, but arm32 code   
   >> is mostly C.  I use two helper structures:   
   >>   
   >> struct registers_buffer {   
   >>      int i_reg[4];   
   >>      union {double d; struct {float sl; float sh;} sf2;} f_reg[8];   
   >> };   
   >>   
   >> typedef struct registers_buffer reg_buff;   
   >>   
   >> typedef struct arg_state { int ni; int sfi; int dfi; int si;} arg_state;   
   >>   
   >> C code fills 'reg_buff' with values and later low-level assembly   
   >> copies values from the buffer to registers.  I allocate enough space on   
   >> the stack so that C code can write to the stack without risk of   
   >> stack overflow.   
   >>   
   >> There are 3 helper routines:   
   >   
   >   
   > This looks pretty complicated, but what is it for: is it still to do   
   > with variadic functions, or is to with the LIBFFI problem?   
      
   Just little extra thing: the code I posted just copies arguments, but   
   the same logic can be used at compile time to generate parameter   
   passing code.   
      
   Concerning "pretty complicated", it is doing what specification says   
   it should do, it is shorter than the specification and IMO it is   
   at least as readible as the specification (OK, for people that do not   
   know the specification bunch of comments would be useful).  Since   
   it is C a few things that are not entirely clear in the specification   
   are precisly specified.   
      
   --   
                                 Waldek Hebisch   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca