From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35551) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0sOl-00014M-H5 for qemu-devel@nongnu.org; Sun, 21 Jul 2013 08:06:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V0sOj-0007et-Gd for qemu-devel@nongnu.org; Sun, 21 Jul 2013 08:05:59 -0400 Received: from mail-la0-x229.google.com ([2a00:1450:4010:c03::229]:42489) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0sOj-0007eg-9t for qemu-devel@nongnu.org; Sun, 21 Jul 2013 08:05:57 -0400 Received: by mail-la0-f41.google.com with SMTP id fn20so4540488lab.0 for ; Sun, 21 Jul 2013 05:05:56 -0700 (PDT) From: Max Filippov Date: Sun, 21 Jul 2013 16:05:01 +0400 Message-Id: <1374408306-2684-2-git-send-email-jcmvbkbc@gmail.com> In-Reply-To: <1374408306-2684-1-git-send-email-jcmvbkbc@gmail.com> References: <1374408306-2684-1-git-send-email-jcmvbkbc@gmail.com> Subject: [Qemu-devel] [PATCH 1/6] target-xtensa: add extui unit test List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Blue Swirl , Max Filippov , Anthony Liguori Signed-off-by: Max Filippov --- tests/tcg/xtensa/Makefile | 1 + tests/tcg/xtensa/test_extui.S | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 tests/tcg/xtensa/test_extui.S diff --git a/tests/tcg/xtensa/Makefile b/tests/tcg/xtensa/Makefile index 002fd87..9e50d8d 100644 --- a/tests/tcg/xtensa/Makefile +++ b/tests/tcg/xtensa/Makefile @@ -26,6 +26,7 @@ TESTCASES += test_bi.tst TESTCASES += test_break.tst TESTCASES += test_bz.tst TESTCASES += test_clamps.tst +TESTCASES += test_extui.tst TESTCASES += test_fail.tst TESTCASES += test_interrupt.tst TESTCASES += test_loop.tst diff --git a/tests/tcg/xtensa/test_extui.S b/tests/tcg/xtensa/test_extui.S new file mode 100644 index 0000000..5d55451 --- /dev/null +++ b/tests/tcg/xtensa/test_extui.S @@ -0,0 +1,26 @@ +.include "macros.inc" + +test_suite extui + +.macro test_extui v, shiftimm, maskimm + .if \shiftimm + \maskimm <= 32 + movi a2, \v + extui a3, a2, \shiftimm, \maskimm + movi a4, ((\v) >> (\shiftimm)) & ((1 << (\maskimm)) - 1) + assert eq, a3, a4 + .endif +.endm + +test extui + .set shiftimm, 0 + .rept 32 + .set maskimm, 1 + .rept 16 + test_extui 0xc8df1370, shiftimm, maskimm + .set maskimm, maskimm + 1 + .endr + .set shiftimm, shiftimm + 1 + .endr +test_end + +test_suite_end -- 1.8.1.4