From eb279bcedea1a332f88a55421a02032b6a2ee672 Mon Sep 17 00:00:00 2001 From: Michal Gorny Date: Mon, 29 Apr 2019 11:38:17 +0000 Subject: [PATCH] [lldb] [test] Remove duplicate YMM/ZMM dotest tests llvm-svn: 359440 --- .../functionalities/register/intel_avx/Makefile | 7 - .../register/intel_avx/TestYMMRegister.py | 79 ------------ .../register/intel_avx/TestZMMRegister.py | 126 ------------------ .../test/functionalities/register/intel_avx/main.c | 142 --------------------- 4 files changed, 354 deletions(-) delete mode 100644 lldb/packages/Python/lldbsuite/test/functionalities/register/intel_avx/Makefile delete mode 100644 lldb/packages/Python/lldbsuite/test/functionalities/register/intel_avx/TestYMMRegister.py delete mode 100644 lldb/packages/Python/lldbsuite/test/functionalities/register/intel_avx/TestZMMRegister.py delete mode 100644 lldb/packages/Python/lldbsuite/test/functionalities/register/intel_avx/main.c diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/register/intel_avx/Makefile b/lldb/packages/Python/lldbsuite/test/functionalities/register/intel_avx/Makefile deleted file mode 100644 index 7aadba9..0000000 --- a/lldb/packages/Python/lldbsuite/test/functionalities/register/intel_avx/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -LEVEL = ../../../make - -C_SOURCES := main.c - -CFLAGS_EXTRAS ?= -g -O1 - -include $(LEVEL)/Makefile.rules diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/register/intel_avx/TestYMMRegister.py b/lldb/packages/Python/lldbsuite/test/functionalities/register/intel_avx/TestYMMRegister.py deleted file mode 100644 index a65e965..0000000 --- a/lldb/packages/Python/lldbsuite/test/functionalities/register/intel_avx/TestYMMRegister.py +++ /dev/null @@ -1,79 +0,0 @@ -""" -Test that we correctly read the YMM registers. -""" - -from __future__ import print_function - - -import os -import time -import lldb -from lldbsuite.test.decorators import * -from lldbsuite.test.lldbtest import * -from lldbsuite.test import lldbutil - - -class TestYMMRegister(TestBase): - mydir = TestBase.compute_mydir(__file__) - NO_DEBUG_INFO_TESTCASE = True - - @skipIfFreeBSD - @skipIfiOSSimulator - @skipIfTargetAndroid() - @skipIf(archs=no_match(['i386', 'x86_64'])) - @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr37995") - @expectedFailureNetBSD - def test(self): - self.build(dictionary={"CFLAGS_EXTRAS": "-march=haswell"}) - self.setTearDownCleanup() - - exe = self.getBuildArtifact("a.out") - target = self.dbg.CreateTarget(exe) - - self.assertTrue(target, VALID_TARGET) - - byte_pattern1 = 0x80 - byte_pattern2 = 0xFF - - # Launch the process and stop. - self.expect("run", PROCESS_STOPPED, substrs=['stopped']) - - # Check stop reason; Should be either signal SIGTRAP or EXC_BREAKPOINT - output = self.res.GetOutput() - matched = False - substrs = [ - 'stop reason = EXC_BREAKPOINT', - 'stop reason = signal SIGTRAP'] - for str1 in substrs: - matched = output.find(str1) != -1 - with recording(self, False) as sbuf: - print("%s sub string: %s" % ('Expecting', str1), file=sbuf) - print("Matched" if matched else "Not Matched", file=sbuf) - if matched: - break - self.assertTrue(matched, STOPPED_DUE_TO_SIGNAL) - - if self.getArchitecture() == 'x86_64': - register_range = 16 - else: - register_range = 8 - for i in range(register_range): - j = i - ((i // 8) * 8) - self.runCmd("thread step-inst") - - register_byte = (byte_pattern1 | j) - pattern = "ymm" + str(i) + " = " + str('{') + ( - str(hex(register_byte)) + ' ') * 31 + str(hex(register_byte)) + str('}') - - self.expect( - "register read ymm" + str(i), - substrs=[pattern]) - - register_byte = (byte_pattern2 | j) - pattern = "ymm" + str(i) + " = " + str('{') + ( - str(hex(register_byte)) + ' ') * 31 + str(hex(register_byte)) + str('}') - - self.runCmd("thread step-inst") - self.expect( - "register read ymm" + str(i), - substrs=[pattern]) diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/register/intel_avx/TestZMMRegister.py b/lldb/packages/Python/lldbsuite/test/functionalities/register/intel_avx/TestZMMRegister.py deleted file mode 100644 index f6fb65d..0000000 --- a/lldb/packages/Python/lldbsuite/test/functionalities/register/intel_avx/TestZMMRegister.py +++ /dev/null @@ -1,126 +0,0 @@ -""" -Test that we correctly read the YMM registers. -""" - -from __future__ import print_function - - -import os -import time -import lldb -from lldbsuite.test.decorators import * -from lldbsuite.test.lldbtest import * -from lldbsuite.test import lldbutil - - -class TestYMMRegister(TestBase): - mydir = TestBase.compute_mydir(__file__) - NO_DEBUG_INFO_TESTCASE = True - - @skipUnlessDarwin - @skipIfiOSSimulator - @skipIf(archs=no_match(['i386', 'x86_64'])) - @debugserver_test - @skipUnlessFeature('hw.optional.avx512f') - def test(self): - self.build(dictionary={"CFLAGS_EXTRAS": "-mavx512f"}) - self.setTearDownCleanup() - - exe = self.getBuildArtifact("a.out") - target = self.dbg.CreateTarget(exe) - - self.assertTrue(target, VALID_TARGET) - - byte_pattern1 = 0x80 - byte_pattern2 = 0xFF - - # This test is working with assembly instructions; it'll make - # it easier to debug the console output if the assembly is - # displayed. - self.runCmd("settings set stop-disassembly-display always") - - # Launch the process and stop. - self.expect("run", PROCESS_STOPPED, substrs=['stopped']) - - # Check stop reason; Should be either signal SIGTRAP or EXC_BREAKPOINT - output = self.res.GetOutput() - matched = False - substrs = [ - 'stop reason = EXC_BREAKPOINT', - 'stop reason = signal SIGTRAP'] - for str1 in substrs: - matched = output.find(str1) != -1 - with recording(self, False) as sbuf: - print("%s sub string: %s" % ('Expecting', str1), file=sbuf) - print("Matched" if matched else "Not Matched", file=sbuf) - if matched: - break - self.assertTrue(matched, STOPPED_DUE_TO_SIGNAL) - - if self.getArchitecture() == 'x86_64': - register_range = 16 - else: - register_range = 8 - for i in range(register_range): - j = i - ((i // 8) * 8) - self.runCmd("thread step-inst") - - register_byte = (byte_pattern1 | j) - pattern = "ymm" + str(i) + " = " + str('{') + ( - str(hex(register_byte)) + ' ') * 31 + str(hex(register_byte)) + str('}') - - self.expect( - "register read ymm" + str(i), - substrs=[pattern]) - - register_byte = (byte_pattern2 | j) - pattern = "ymm" + str(i) + " = " + str('{') + ( - str(hex(register_byte)) + ' ') * 31 + str(hex(register_byte)) + str('}') - - self.runCmd("thread step-inst") - self.expect( - "register read ymm" + str(i), - substrs=[pattern]) - - self.expect("continue", PROCESS_STOPPED, substrs=['stopped']) - - # Check stop reason; Should be either signal SIGTRAP or EXC_BREAKPOINT - output = self.res.GetOutput() - matched = False - substrs = [ - 'stop reason = EXC_BREAKPOINT', - 'stop reason = signal SIGTRAP'] - for str1 in substrs: - matched = output.find(str1) != -1 - with recording(self, False) as sbuf: - print("%s sub string: %s" % ('Expecting', str1), file=sbuf) - print("Matched" if matched else "Not Matched", file=sbuf) - if matched: - break - self.assertTrue(matched, STOPPED_DUE_TO_SIGNAL) - - if self.getArchitecture() == 'x86_64': - register_range = 32 - else: - register_range = 8 - for i in range(register_range): - j = i - ((i // 8) * 8) - self.runCmd("thread step-inst") - self.runCmd("thread step-inst") - - register_byte = (byte_pattern2 | j) - pattern = "zmm" + str(i) + " = " + str('{') + ( - str(hex(register_byte)) + ' ') * 63 + str(hex(register_byte)) + str('}') - - self.expect( - "register read zmm" + str(i), - substrs=[pattern]) - - register_byte = (byte_pattern2 | j) - pattern = "zmm" + str(i) + " = " + str('{') + ( - str(hex(register_byte)) + ' ') * 63 + str(hex(register_byte)) + str('}') - - self.runCmd("thread step-inst") - self.expect( - "register read zmm" + str(i), - substrs=[pattern]) diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/register/intel_avx/main.c b/lldb/packages/Python/lldbsuite/test/functionalities/register/intel_avx/main.c deleted file mode 100644 index c7c3a04..0000000 --- a/lldb/packages/Python/lldbsuite/test/functionalities/register/intel_avx/main.c +++ /dev/null @@ -1,142 +0,0 @@ -//===-- main.c ------------------------------------------------*- C -*-===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -void func() { - unsigned int ymmvalues[16]; - for (int i = 0 ; i < 16 ; i++) - { - unsigned char val = (0x80 | i); - ymmvalues[i] = (val << 24) | (val << 16) | (val << 8) | val; - } - - unsigned int ymmallones = 0xFFFFFFFF; -#if defined(__AVX__) - __asm__("int3;" - "vbroadcastss %1, %%ymm0;" - "vbroadcastss %0, %%ymm0;" - "vbroadcastss %2, %%ymm1;" - "vbroadcastss %0, %%ymm1;" - "vbroadcastss %3, %%ymm2;" - "vbroadcastss %0, %%ymm2;" - "vbroadcastss %4, %%ymm3;" - "vbroadcastss %0, %%ymm3;" - "vbroadcastss %5, %%ymm4;" - "vbroadcastss %0, %%ymm4;" - "vbroadcastss %6, %%ymm5;" - "vbroadcastss %0, %%ymm5;" - "vbroadcastss %7, %%ymm6;" - "vbroadcastss %0, %%ymm6;" - "vbroadcastss %8, %%ymm7;" - "vbroadcastss %0, %%ymm7;" -#if defined(__x86_64__) - "vbroadcastss %1, %%ymm8;" - "vbroadcastss %0, %%ymm8;" - "vbroadcastss %2, %%ymm9;" - "vbroadcastss %0, %%ymm9;" - "vbroadcastss %3, %%ymm10;" - "vbroadcastss %0, %%ymm10;" - "vbroadcastss %4, %%ymm11;" - "vbroadcastss %0, %%ymm11;" - "vbroadcastss %5, %%ymm12;" - "vbroadcastss %0, %%ymm12;" - "vbroadcastss %6, %%ymm13;" - "vbroadcastss %0, %%ymm13;" - "vbroadcastss %7, %%ymm14;" - "vbroadcastss %0, %%ymm14;" - "vbroadcastss %8, %%ymm15;" - "vbroadcastss %0, %%ymm15;" -#endif - ::"m"(ymmallones), - "m"(ymmvalues[0]), "m"(ymmvalues[1]), "m"(ymmvalues[2]), "m"(ymmvalues[3]), - "m"(ymmvalues[4]), "m"(ymmvalues[5]), "m"(ymmvalues[6]), "m"(ymmvalues[7]) - ); -#endif - -#if defined(__AVX512F__) - unsigned int zmmvalues[32]; - for (int i = 0 ; i < 32 ; i++) - { - unsigned char val = (0x80 | i); - zmmvalues[i] = (val << 24) | (val << 16) | (val << 8) | val; - } - - __asm__("int3;" - "vbroadcastss %1, %%zmm0;" - "vbroadcastss %0, %%zmm0;" - "vbroadcastss %2, %%zmm1;" - "vbroadcastss %0, %%zmm1;" - "vbroadcastss %3, %%zmm2;" - "vbroadcastss %0, %%zmm2;" - "vbroadcastss %4, %%zmm3;" - "vbroadcastss %0, %%zmm3;" - "vbroadcastss %5, %%zmm4;" - "vbroadcastss %0, %%zmm4;" - "vbroadcastss %6, %%zmm5;" - "vbroadcastss %0, %%zmm5;" - "vbroadcastss %7, %%zmm6;" - "vbroadcastss %0, %%zmm6;" - "vbroadcastss %8, %%zmm7;" - "vbroadcastss %0, %%zmm7;" -#if defined(__x86_64__) - "vbroadcastss %1, %%zmm8;" - "vbroadcastss %0, %%zmm8;" - "vbroadcastss %2, %%zmm9;" - "vbroadcastss %0, %%zmm9;" - "vbroadcastss %3, %%zmm10;" - "vbroadcastss %0, %%zmm10;" - "vbroadcastss %4, %%zmm11;" - "vbroadcastss %0, %%zmm11;" - "vbroadcastss %5, %%zmm12;" - "vbroadcastss %0, %%zmm12;" - "vbroadcastss %6, %%zmm13;" - "vbroadcastss %0, %%zmm13;" - "vbroadcastss %7, %%zmm14;" - "vbroadcastss %0, %%zmm14;" - "vbroadcastss %8, %%zmm15;" - "vbroadcastss %0, %%zmm15;" - "vbroadcastss %1, %%zmm16;" - "vbroadcastss %0, %%zmm16;" - "vbroadcastss %2, %%zmm17;" - "vbroadcastss %0, %%zmm17;" - "vbroadcastss %3, %%zmm18;" - "vbroadcastss %0, %%zmm18;" - "vbroadcastss %4, %%zmm19;" - "vbroadcastss %0, %%zmm19;" - "vbroadcastss %5, %%zmm20;" - "vbroadcastss %0, %%zmm20;" - "vbroadcastss %6, %%zmm21;" - "vbroadcastss %0, %%zmm21;" - "vbroadcastss %7, %%zmm22;" - "vbroadcastss %0, %%zmm22;" - "vbroadcastss %8, %%zmm23;" - "vbroadcastss %0, %%zmm23;" - "vbroadcastss %1, %%zmm24;" - "vbroadcastss %0, %%zmm24;" - "vbroadcastss %2, %%zmm25;" - "vbroadcastss %0, %%zmm25;" - "vbroadcastss %3, %%zmm26;" - "vbroadcastss %0, %%zmm26;" - "vbroadcastss %4, %%zmm27;" - "vbroadcastss %0, %%zmm27;" - "vbroadcastss %5, %%zmm28;" - "vbroadcastss %0, %%zmm28;" - "vbroadcastss %6, %%zmm29;" - "vbroadcastss %0, %%zmm29;" - "vbroadcastss %7, %%zmm30;" - "vbroadcastss %0, %%zmm30;" - "vbroadcastss %8, %%zmm31;" - "vbroadcastss %0, %%zmm31;" -#endif - ::"m"(ymmallones), - "m"(zmmvalues[0]), "m"(zmmvalues[1]), "m"(zmmvalues[2]), "m"(zmmvalues[3]), - "m"(zmmvalues[4]), "m"(zmmvalues[5]), "m"(zmmvalues[6]), "m"(zmmvalues[7]) - ); -#endif -} - -int main(int argc, char const *argv[]) { func(); } -- 2.7.4