On 13/02/2018 09:45, Roger Pau Monné wrote:
> On Mon, Feb 12, 2018 at 11:23:05AM +0000, Andrew Cooper wrote:
>> .macro ALTERNATIVE oldinstr, newinstr, feature
>> + .skip (-((repl_len(1) - orig_len) > 0) * (repl_len(1) - orig_len)),
> clang chokes on this expression, because of the negation at the
> beginning and I'm also failing to see why are you adding such
> negation. AFAICT using:
> .skip (((repl_len(1) - orig_len) > 0) * (repl_len(1) - orig_len)), 0x90
> Is correct: it adds the right padding if the alternative code is
> bigger than the original one, while not adding anything is the
> original code is greater than the alternative one.
> The negation just turns the 1 to -1, thus converting the result of the
> whole expression into a negative value.
/sigh so Clang and GAS have different ideas of true.
The reason for this negation is stated in the commit message. "x > 0"
in GAS yields 0 or -1, rather than the expected 1.
Xen-devel mailing list