From: Zhigang Lu <zlu@ezchip.com>
To: <dev@dpdk.org>
Subject: [dpdk-dev] [PATCH v2 10/12] app/test: remove architecture specific code from cpuflags test
Date: Tue, 6 Jan 2015 14:53:48 +0800 [thread overview]
Message-ID: <1420527230-17037-11-git-send-email-zlu@ezchip.com> (raw)
In-Reply-To: <1420527230-17037-1-git-send-email-zlu@ezchip.com>
Test all defined CPU flags for supported architectures so that we
do not have to include conditional compilation for each architecture
in app test case.
Signed-off-by: Zhigang Lu <zlu@ezchip.com>
Signed-off-by: Cyril Chemparathy <cchemparathy@ezchip.com>
---
app/test/test_cpuflags.c | 78 ++++--------------------------------------------
1 file changed, 5 insertions(+), 73 deletions(-)
diff --git a/app/test/test_cpuflags.c b/app/test/test_cpuflags.c
index 5aeba5d..1a58c03 100644
--- a/app/test/test_cpuflags.c
+++ b/app/test/test_cpuflags.c
@@ -77,81 +77,13 @@ cpu_flag_result(int result)
static int
test_cpuflags(void)
{
- int result;
+ int i, result;
printf("\nChecking for flags from different registers...\n");
-#ifdef RTE_ARCH_PPC_64
- printf("Check for PPC64:\t\t");
- CHECK_FOR_FLAG(RTE_CPUFLAG_PPC64);
-
- printf("Check for PPC32:\t\t");
- CHECK_FOR_FLAG(RTE_CPUFLAG_PPC32);
-
- printf("Check for VSX:\t\t");
- CHECK_FOR_FLAG(RTE_CPUFLAG_VSX);
-
- printf("Check for DFP:\t\t");
- CHECK_FOR_FLAG(RTE_CPUFLAG_DFP);
-
- printf("Check for FPU:\t\t");
- CHECK_FOR_FLAG(RTE_CPUFLAG_FPU);
-
- printf("Check for SMT:\t\t");
- CHECK_FOR_FLAG(RTE_CPUFLAG_SMT);
-
- printf("Check for MMU:\t\t");
- CHECK_FOR_FLAG(RTE_CPUFLAG_MMU);
-
- printf("Check for ALTIVEC:\t\t");
- CHECK_FOR_FLAG(RTE_CPUFLAG_ALTIVEC);
-
- printf("Check for ARCH_2_06:\t\t");
- CHECK_FOR_FLAG(RTE_CPUFLAG_ARCH_2_06);
-
- printf("Check for ARCH_2_07:\t\t");
- CHECK_FOR_FLAG(RTE_CPUFLAG_ARCH_2_07);
-
- printf("Check for ICACHE_SNOOP:\t\t");
- CHECK_FOR_FLAG(RTE_CPUFLAG_ICACHE_SNOOP);
-#else
- printf("Check for SSE:\t\t");
- CHECK_FOR_FLAG(RTE_CPUFLAG_SSE);
-
- printf("Check for SSE2:\t\t");
- CHECK_FOR_FLAG(RTE_CPUFLAG_SSE2);
-
- printf("Check for SSE3:\t\t");
- CHECK_FOR_FLAG(RTE_CPUFLAG_SSE3);
-
- printf("Check for SSE4.1:\t");
- CHECK_FOR_FLAG(RTE_CPUFLAG_SSE4_1);
-
- printf("Check for SSE4.2:\t");
- CHECK_FOR_FLAG(RTE_CPUFLAG_SSE4_2);
-
- printf("Check for AVX:\t\t");
- CHECK_FOR_FLAG(RTE_CPUFLAG_AVX);
-
- printf("Check for AVX2:\t\t");
- CHECK_FOR_FLAG(RTE_CPUFLAG_AVX2);
-
- printf("Check for TRBOBST:\t");
- CHECK_FOR_FLAG(RTE_CPUFLAG_TRBOBST);
-
- printf("Check for ENERGY_EFF:\t");
- CHECK_FOR_FLAG(RTE_CPUFLAG_ENERGY_EFF);
-
- printf("Check for LAHF_SAHF:\t");
- CHECK_FOR_FLAG(RTE_CPUFLAG_LAHF_SAHF);
-
- printf("Check for 1GB_PG:\t");
- CHECK_FOR_FLAG(RTE_CPUFLAG_1GB_PG);
-
- printf("Check for INVTSC:\t");
- CHECK_FOR_FLAG(RTE_CPUFLAG_INVTSC);
-
-
-#endif
+ for (i = 0; i < RTE_CPUFLAG_NUMFLAGS; i++) {
+ printf("Check for %s:\t\t", cpu_feature_table[i].name);
+ CHECK_FOR_FLAG(i);
+ }
/*
* Check if invalid data is handled properly
--
2.1.2
next prev parent reply other threads:[~2015-01-06 7:02 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1420527230-17037-1-git-send-email-zlu@ezchip.com>
2015-01-06 6:53 ` [dpdk-dev] [PATCH v2 01/12] eal/tile: add atomic operations for TileGx Zhigang Lu
2015-01-06 6:53 ` [dpdk-dev] [PATCH v2 02/12] eal/tile: add byte order " Zhigang Lu
2015-01-06 6:53 ` [dpdk-dev] [PATCH v2 03/12] eal/tile: add spinlock " Zhigang Lu
2015-01-06 6:53 ` [dpdk-dev] [PATCH v2 04/12] eal/tile: add prefetch " Zhigang Lu
2015-01-06 6:53 ` [dpdk-dev] [PATCH v2 05/12] eal/tile: add memcpy " Zhigang Lu
2015-01-06 6:53 ` [dpdk-dev] [PATCH v2 06/12] eal/tile: add cycle " Zhigang Lu
2015-01-06 6:53 ` [dpdk-dev] [PATCH v2 07/12] eal: split vector operations to architecture specific Zhigang Lu
2015-01-06 6:53 ` [dpdk-dev] [PATCH v2 08/12] eal/tile: add vector operations for TileGx Zhigang Lu
2015-01-06 6:53 ` [dpdk-dev] [PATCH v2 09/12] eal/tile: add CPU flags " Zhigang Lu
2015-01-06 6:53 ` Zhigang Lu [this message]
2015-01-06 6:53 ` [dpdk-dev] [PATCH v2 11/12] eal: allow empty set of compile time cpuflags Zhigang Lu
2015-01-06 6:53 ` [dpdk-dev] [PATCH v2 12/12] mk: introduce Tilera Tile architecture Zhigang Lu
2015-05-22 16:03 ` Thomas Monjalon
2015-05-22 16:42 ` Cyril Chemparathy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1420527230-17037-11-git-send-email-zlu@ezchip.com \
--to=zlu@ezchip.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).