[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 02/12] xen/arm: fix get_cpu_info() when built with clang
On Wed, 17 Apr 2019, Julien Grall wrote: > Hi, > > On 4/17/19 9:45 PM, Stefano Stabellini wrote: > > On Wed, 27 Mar 2019, Julien Grall wrote: > > > Clang understands the GCCism in use here, but still complains that sp is > > > unitialised. In such cases, resort to the older versions of this code, > > > which directly read sp into the temporary variable. > > > > > > Note that we still keep the GCCism in the default case, as it causes GCC > > > to create rather better assembly. > > > > > > This is based on the x86 counterpart. > > > > I understand this is based on an existing approach but what about other > > compilers? I have a suggestion below. > > What if the compiler actually support named registers? Why would we make the > code less efficient? It is not my intention to make the code less efficient for other compilers. However, reading the commit message and the patch I have the impression that the clang version is more likely to be applicable to other compilers, compared to the gcc version. More "standard". The reason is that the clang version only requires asm inline, while the gcc version requires both asm inline and named registers. For the sake of getting Xen to compile out of the box with any C compiler, I think it is best if we default to the less demanding version of the implementation for unknown compilers. _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |