To adopt the m4 macrology used in GMP, for optionally substituting r0-->0, r1-->1, etc, I tried to copy the m4 macros, including an m4 forloop.
But that didn't work out of the box, and it seems that one complication is that Nettle's uses <> as m4 quote characters. I've used them since I introduced m4 preprocessing back in 2002, and I honestly don't remember why I thought that was a good idea at the time. I guess I found `' ugly, and the autoconf choice of [] didn't work well with assembly syntax (in particular on sparc).
In a few places nettle needs to use < as an operator in m4 eval, and there are workarounds for that using local changequote, with the curious hack
define(<W64_ENTRY>, < changequote([,])dnl ifelse(<<<<<<<<<<<<<<<<<< ignored; only for balancing) ifelse(W64_ABI,yes,[ dnl unconditionally push %rdi, making %rsp 16-byte aligned push %rdi dnl Save %xmm6, ..., if needed ifelse(eval($2 > 6), 1, [ sub [$]eval(16*($2 - 6)), %rsp movdqa %xmm6, 0(%rsp) ]) ifelse(eval($2 > 7), 1, [ movdqa %xmm7, 16(%rsp) ]) ...
So I'm considering changing that, and instead stick to m4 default quotes. Opinions?
Regards, /Niels
nisse@lysator.liu.se (Niels Möller) writes:
So I'm considering changing that, and instead stick to m4 default quotes. Opinions?
Pushed changes to do that to a branch, default-m4-quote-char. Seems to pass the ci tests, as well as manual testing on sparc. I'll likely merge in a day or two, if I don't become aware of any problems.
Regards, /Niels
I apologize for the late reply. I just saw this post. I'm a little confused here, are these changes conflict with the patch I just posted?
On Mon, Sep 14, 2020 at 9:38 PM Niels Möller nisse@lysator.liu.se wrote:
nisse@lysator.liu.se (Niels Möller) writes:
So I'm considering changing that, and instead stick to m4 default quotes. Opinions?
Pushed changes to do that to a branch, default-m4-quote-char. Seems to pass the ci tests, as well as manual testing on sparc. I'll likely merge in a day or two, if I don't become aware of any problems.
Regards, /Niels
-- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. _______________________________________________ nettle-bugs mailing list nettle-bugs@lists.lysator.liu.se http://lists.lysator.liu.se/mailman/listinfo/nettle-bugs
Maamoun TK maamoun.tk@googlemail.com writes:
I apologize for the late reply. I just saw this post. I'm a little confused here, are these changes conflict with the patch I just posted?
I don't think so, it looks like your patch is against the code after the conversion from <> to `'.
Regards, /Niels
nettle-bugs@lists.lysator.liu.se