qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/3] pc-bios/s390-ccw: Fix inline assembly for older versions


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH 1/3] pc-bios/s390-ccw: Fix inline assembly for older versions of Clang
Date: Mon, 17 May 2021 18:49:32 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1

On 5/17/21 6:14 PM, Cornelia Huck wrote:
> On Wed, 12 May 2021 19:15:48 +0200
> Thomas Huth <thuth@redhat.com> wrote:
> 
>> Clang versions before v11.0 insist on having the %rX or %cX register
>> names instead of just a number. Since our Travis-CI is currently
>> still using Clang v6.0, we have to fix this to avoid failing jobs.
>>
>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>> ---
>>  pc-bios/s390-ccw/helper.h   | 2 +-
>>  pc-bios/s390-ccw/jump2ipl.c | 4 ++--
>>  pc-bios/s390-ccw/menu.c     | 8 ++++----
>>  pc-bios/s390-ccw/virtio.c   | 2 +-
>>  4 files changed, 8 insertions(+), 8 deletions(-)
>>
>> diff --git a/pc-bios/s390-ccw/helper.h b/pc-bios/s390-ccw/helper.h
>> index dfcfea0ff0..3d0731c4c6 100644
>> --- a/pc-bios/s390-ccw/helper.h
>> +++ b/pc-bios/s390-ccw/helper.h
>> @@ -31,7 +31,7 @@ static inline void *u32toptr(uint32_t n)
>>  
>>  static inline void yield(void)
>>  {
>> -    asm volatile ("diag 0,0,0x44"
>> +    asm volatile ("diag %%r0,%%r0,0x44"
>>                    : :
>>                    : "memory", "cc");
>>  }
> 
> Sigh, this really looks uglier, but if it pleases the compiler...

Personally I find it easier to read, it makes obvious we are
accessing a register, not using an immediate value.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]