[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 02/11] target/riscv/vector_helper: Fix build on 32-bit big en
From: |
Richard Henderson |
Subject: |
Re: [PATCH 02/11] target/riscv/vector_helper: Fix build on 32-bit big endian targets |
Date: |
Tue, 4 Aug 2020 10:34:10 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
On 8/4/20 10:00 AM, Thomas Huth wrote:
> The code currently fails to compile on 32-bit big endian targets:
>
> target/riscv/vector_helper.c: In function 'vext_clear':
> target/riscv/vector_helper.c:154:16: error: cast to pointer from integer
> of different size [-Werror=int-to-pointer-cast]
> memset((void *)((uintptr_t)tail & ~(7ULL)), 0, part1);
> ^
> target/riscv/vector_helper.c:155:16: error: cast to pointer from integer
> of different size [-Werror=int-to-pointer-cast]
> memset((void *)(((uintptr_t)tail + 8) & ~(7ULL)), 0, part2);
> ^
> cc1: all warnings being treated as errors
>
> We should not use "long long" (i.e. 64-bit) values here to avoid the
> problem. Switch to our QEMU_ALIGN_PTR_DOWN/UP macros instead.
>
> Fixes: 751538d5da ("add vector stride load and store instructions")
> Suggested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
> target/riscv/vector_helper.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
- [PATCH 00/11] Run cross-compilation build tests in the gitlab-CI, Thomas Huth, 2020/08/04
- [PATCH 02/11] target/riscv/vector_helper: Fix build on 32-bit big endian targets, Thomas Huth, 2020/08/04
- [PATCH 01/11] virtio-mem: Correct format specifier mismatch for RISC-V, Thomas Huth, 2020/08/04
- [PATCH 03/11] tests/Makefile: test-image-locking needs CONFIG_POSIX, Thomas Huth, 2020/08/04
- [PATCH 04/11] tests/Makefile: test-replication needs CONFIG_POSIX, Thomas Huth, 2020/08/04
- [PATCH 05/11] tests/Makefile: Only build usable targets during 'make check-build', Thomas Huth, 2020/08/04
- [PATCH 07/11] Get rid of the libqemustub.a remainders, Thomas Huth, 2020/08/04
- [PATCH 06/11] tests/Makefile: Add $(EXESUF) to fp-test target, Thomas Huth, 2020/08/04