From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Date: Tue, 10 May 2016 12:05:47 +0000 Subject: Re: [kvm-unit-test PATCH v2] powerpc: Add emulator test for the lswi instruction Message-Id: <5731CE9B.9060904@redhat.com> List-Id: References: <1460645382-31616-1-git-send-email-thuth@redhat.com> <571629BC.6000605@redhat.com> <57174AB9.2090900@redhat.com> In-Reply-To: <57174AB9.2090900@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Thomas Huth , Laurent Vivier , kvm@vger.kernel.org Cc: kvm-ppc@vger.kernel.org, drjones@redhat.com On 20/04/2016 11:24, Thomas Huth wrote: >>> + ".long 0x7fe154aa\n" /* lswi r31, r1, 10 */ >> >> Perhaps you can add a comment explaining why you are using a .long >> instead of the mnemonic? > > The compiler is smart enough to detect that r1 is in the range of > registers that get clobbered, and thus rejects that mnemonic. You > quickly notice that when replacing the .long with the mnemonic, so I'm > not sure whether it's worth to add a verbose comment here... Paolo, what > do you prefer? The assembler does this, not the compiler. Is this a valid operation at all, or is it undefined? (aka, what does it do on real hardware)? O_o Paolo From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [kvm-unit-test PATCH v2] powerpc: Add emulator test for the lswi instruction Date: Tue, 10 May 2016 14:05:47 +0200 Message-ID: <5731CE9B.9060904@redhat.com> References: <1460645382-31616-1-git-send-email-thuth@redhat.com> <571629BC.6000605@redhat.com> <57174AB9.2090900@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: kvm-ppc@vger.kernel.org, drjones@redhat.com To: Thomas Huth , Laurent Vivier , kvm@vger.kernel.org Return-path: Received: from mail-wm0-f67.google.com ([74.125.82.67]:33400 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751304AbcEJMFv (ORCPT ); Tue, 10 May 2016 08:05:51 -0400 In-Reply-To: <57174AB9.2090900@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 20/04/2016 11:24, Thomas Huth wrote: >>> + ".long 0x7fe154aa\n" /* lswi r31, r1, 10 */ >> >> Perhaps you can add a comment explaining why you are using a .long >> instead of the mnemonic? > > The compiler is smart enough to detect that r1 is in the range of > registers that get clobbered, and thus rejects that mnemonic. You > quickly notice that when replacing the .long with the mnemonic, so I'm > not sure whether it's worth to add a verbose comment here... Paolo, what > do you prefer? The assembler does this, not the compiler. Is this a valid operation at all, or is it undefined? (aka, what does it do on real hardware)? O_o Paolo