diff mbox series

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

Message ID 20180410193919.28026-14-alex.bennee@linaro.org
State New
Headers show
Series fix building of tests/tcg | expand

Commit Message

Alex Bennée April 10, 2018, 7:39 p.m. UTC
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%)

-- 
2.16.2

Comments

Thomas Huth April 11, 2018, 3:33 p.m. UTC | #1
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
Alex Bennée April 11, 2018, 4:19 p.m. UTC | #2
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
diff mbox series

Patch

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;
 }