Re: Move to Fast ZPP?
| From: | Matt Wilmas | Date: | Thu, 06 Aug 2015 09:00:48 +0000 |
| Subject: | Re: Move to Fast ZPP? | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-87666@lists.php.net to get a copy of this message | ||
Hi Pierre,
----- Original Message -----
From: "Pierre Joye"
Sent: Thursday, August 06, 2015
On Aug 6, 2015 1:49 PM, "Matt Wilmas" <php_lists@realplain.com> wrote:Sure! Simply: size_t num = 4; char foo[num]; I wondered about emulating with _alloca(), but a quick check (in 2008!) shows that it doesn't optimize it out even with a true constant value... - MattHi Levi, ----- Original Message ----- From: "Levi Morrison" Sent: Thursday, August 06, 2015withDon't know about Windows now... Visual Studio 2008 and 2012 (not much difference) are NOT optimizing away the code (other times it was GCChaveissues). :-/ Not sure why. Of course they don't support the necessary compound literals anyway, but I was just testing a manual case... I'llcode that would use them. A compound literal (void *[]), derived from variadic macro, is needed to transform zend_parse_parameters() into a non-varargs inline function call (since va_arg usage prevents inlining).Yes, VS 2013 added, AFAIK. But I was just talking about optimizing theto try and check 2015 version soon.VS 2015 supports compound literals, I believe.The problem in the earlier VS versions, which I simulated manuallywithout compound literals, is that it doesn't want to optimize away all the inlined stuff, leaving only the result. Definitely can't have something creating several KB of extra instructions! :-)So unless they improved something in the newest versions, this wouldn'tbe able to be used there, unless I can work around it somehow. I don't know if macros, instead of inline functions, inside the main inline function would help or not...Although, it *would* simplify a couple tiny parts if didn't need tosupport MSVC... First, detecting a string *literal* (99% of usage): could just use __builtin_constant_p() instead of a macro trick.And second, using a variable length array, with size set by, well, avariable, which I think VS still doesn't support from C99, right? (It's for a "variable" in this case, but always the same, so should optimize like a compile-time size.) If you have a piece of self contained code to test it, we can then add it to the VC test repo to valid what we can support with 7+.