2 Replies Latest reply on Dec 21, 2010 4:25 PM by adm271828

    CAL IL macro - what does 'outline' means?

    adm271828

      Hi,

      could someboy explain what _outline means in macro definition?

      Accordint to IL spec (v. 2.0d, page 7-283): "use _outline to outline as a function". Not very explicit IMHO.

      Also, I think I have some lexical captures when macros are called with temporaries whose names are already used inside macro's body. It seems the renaming scheme (page 7-285) does not really work as suggested.

      Best regards

        • CAL IL macro - what does 'outline' means?
          MicahVillmow
          adm271828,
          All it means is to convert the macro into a function instead of inlining the macro. Also if you have examples of the macro not working correctly, please let us know.
            • CAL IL macro - what does 'outline' means?
              adm271828

              Thanks, Micah, for your answer.

              This was one of my guess, but unfortunately, I never observed in the generated ISA that macros marked as outline were turned into functions (unless the normal behaviour of a function is to be inlined...).

              Moreover, just saying "it is converted into a function" is a little short for a semantic.

              Since macro can have arguments (unlimited count?), with lexical scope (if I understood corretly the - very limited - documentation) and I didn't find in the documentation a description of some argument passing conventions (using specific registers?), nor a description of a stack mechanism, what arises with multiple outlined macro calls, possibly nested, with a high argument number??? Will this clobber temp registers?

              Of course, if everything stays inlined, as it seems to be in practice, then the problem disappears.

              Regarding macros not working, I got very different results just by changing the name of some registers in a way that shouldn't affect the result. Basically I used registers (supposed to be local according to the doc) inside the macro body with the same names as the one passed as macro arguments and also used by the caller (a classical case of lexical capture in most languages with C-like macros). I changed the names in order to avoid any conflicts and  I got back what I expected.

              This is a large file I can't send you. I will try to isolate it in a limited example.

              Best regards,

              Antoine