[Qemu-devel] [PATCH v1 13/24] tests/tcg/i386: move test-i386-sse.c to tests/tcg/x86_64/test-sse.c

Alex Bennée posted 24 patches 7 years, 10 months ago
There is a newer version of this series
[Qemu-devel] [PATCH v1 13/24] tests/tcg/i386: move test-i386-sse.c to tests/tcg/x86_64/test-sse.c
Posted by Alex Bennée 7 years, 10 months ago
The test mixes up 32bit and 64 bit code. It should probably be split
into two distinct test cases. However for now just move it out of the
way of the i386 build.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 tests/tcg/{i386/test-i386-ssse3.c => x86_64/test-sse.c} | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
 rename tests/tcg/{i386/test-i386-ssse3.c => x86_64/test-sse.c} (93%)

diff --git a/tests/tcg/i386/test-i386-ssse3.c b/tests/tcg/x86_64/test-sse.c
similarity index 93%
rename from tests/tcg/i386/test-i386-ssse3.c
rename to tests/tcg/x86_64/test-sse.c
index 0a42bd03e2..196ec7f32f 100644
--- a/tests/tcg/i386/test-i386-ssse3.c
+++ b/tests/tcg/x86_64/test-sse.c
@@ -1,4 +1,4 @@
-/* See if various MMX/SSE SSSE3 instructions give expected results */
+/* See if various MMX/SSE SSSE3/4 instructions give expected results */
 #include <stdio.h>
 #include <string.h>
 #include <stdint.h>
@@ -41,8 +41,7 @@ int main(int argc, char *argv[]) {
 	asm volatile ("movdqa  %%xmm0, (%0)" : : "r" (hello));
 	printf("%5.5s\n", hello);
 
-#if 1 /* SSE4 */
-	/* popcnt r64, r/m64 */
+	/* SSE4 popcnt r64, r/m64 */
 	asm volatile ("movq    $0x8421000010009c63, %%rax" : : : "rax");
 	asm volatile ("popcnt  %%ax, %%dx" : : : "dx");
 	asm volatile ("popcnt  %%eax, %%ecx" : : : "ecx");
@@ -51,7 +50,6 @@ int main(int argc, char *argv[]) {
 	asm volatile ("movl    %%ecx, %0" : "=m" (c));
 	asm volatile ("movw    %%dx, %0" : "=m" (d));
 	printf("%i = %i\n%i = %i = %i\n", 13, (int) a, 9, c, d + 1);
-#endif
 
 	return 0;
 }
-- 
2.16.2


Re: [Qemu-devel] [PATCH v1 13/24] tests/tcg/i386: move test-i386-sse.c to tests/tcg/x86_64/test-sse.c
Posted by Thomas Huth 7 years, 10 months ago
On 10.04.2018 21:39, Alex Bennée wrote:
> The test mixes up 32bit and 64 bit code. It should probably be split
> into two distinct test cases. However for now just move it out of the
> way of the i386 build.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>  tests/tcg/{i386/test-i386-ssse3.c => x86_64/test-sse.c} | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>  rename tests/tcg/{i386/test-i386-ssse3.c => x86_64/test-sse.c} (93%)

Do we really want to have a separate x86_64 folder here? We also have
64-bit code in hw/i386/ and target/i386/ so I don't think that we should
handle this differently for tests/tcg/i386 ? Wouldn't it be sufficient
to simply move this code to a separate file? ... just my 0.02 €

 Thomas

Re: [Qemu-devel] [PATCH v1 13/24] tests/tcg/i386: move test-i386-sse.c to tests/tcg/x86_64/test-sse.c
Posted by Alex Bennée 7 years, 10 months ago
Thomas Huth <thuth@redhat.com> writes:

> On 10.04.2018 21:39, Alex Bennée wrote:
>> The test mixes up 32bit and 64 bit code. It should probably be split
>> into two distinct test cases. However for now just move it out of the
>> way of the i386 build.
>>
>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>> ---
>>  tests/tcg/{i386/test-i386-ssse3.c => x86_64/test-sse.c} | 6 ++----
>>  1 file changed, 2 insertions(+), 4 deletions(-)
>>  rename tests/tcg/{i386/test-i386-ssse3.c => x86_64/test-sse.c} (93%)
>
> Do we really want to have a separate x86_64 folder here? We also have
> 64-bit code in hw/i386/ and target/i386/ so I don't think that we should
> handle this differently for tests/tcg/i386 ? Wouldn't it be sufficient
> to simply move this code to a separate file? ... just my 0.02 €

It's certainly simpler for the build rules to have a simple mapping from
$(TARGET_NAME) to tests/tcg/FOO....

--
Alex Bennée