On 07/01/2017 03:30 PM, Peter Maydell wrote:
On 1 July 2017 at 23:20, Richard Henderson <r...@twiddle.net> wrote:
On 06/30/2017 08:39 AM, Pranith Kumar wrote:

Clang generates the following warning on aarch64 host:

    CC      util/cacheinfo.o
/home/pranith/qemu/util/cacheinfo.c:121:48: warning: value size does not
match register size specified by the constraint and modifier
[-Wasm-operand-widths]
          asm volatile("mrs\t%0, ctr_el0" : "=r"(ctr));
                                                 ^
/home/pranith/qemu/util/cacheinfo.c:121:28: note: use constraint modifier
"w"
          asm volatile("mrs\t%0, ctr_el0" : "=r"(ctr));
                             ^~
                             %w0


That is an absolutely stupid warning.  There's long precedent for the
compiler choosing the prefix for you based on the type of the argument.

Isn't that the problem? The type of the argument says "32 bits"
but the instruction here really wants 64 bits (MRS takes Xn, not Wn).

The warning is telling me to use %w to force Wn. So if the assembler really doesn't like Wn, the warning is a bit more than confusing.

Perhaps it ought to be telling me to use %x to force Xn in spite of the type?


r~

Reply via email to