summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Schleef <ds@ginger.bigkitten.com>2008-02-18 14:01:21 -0800
committerDavid Schleef <ds@ginger.bigkitten.com>2008-02-18 14:01:21 -0800
commit7f3e10f25c4315c2fd9d9000d7dee9bf8abefa4c (patch)
tree942f77328e8c7e1c7af56a7b2822dd6f021271aa
parentf06e19392112ec45b4d9d9eaf4524fb31cee5298 (diff)
downloadliboil-7f3e10f25c4315c2fd9d9000d7dee9bf8abefa4c.tar.gz
Add SSE3 and SSSE3 flags.
-rw-r--r--doc/tmpl/liboilimpl-unstable.sgml1
-rw-r--r--liboil/liboilcpu-x86.c13
-rw-r--r--liboil/liboilfunction.h6
-rwxr-xr-xtestsuite/instruction/check-instructions.pl39
-rw-r--r--testsuite/instruction/list-impls.c2
5 files changed, 60 insertions, 1 deletions
diff --git a/doc/tmpl/liboilimpl-unstable.sgml b/doc/tmpl/liboilimpl-unstable.sgml
index 706d2c3..209b549 100644
--- a/doc/tmpl/liboilimpl-unstable.sgml
+++ b/doc/tmpl/liboilimpl-unstable.sgml
@@ -62,6 +62,7 @@
@OIL_IMPL_FLAG_EDSP:
@OIL_IMPL_FLAG_ARM6:
@OIL_IMPL_FLAG_VFP:
+@OIL_IMPL_FLAG_SSSE3:
<!-- ##### MACRO OIL_CPU_FLAG_MASK ##### -->
<para>
diff --git a/liboil/liboilcpu-x86.c b/liboil/liboilcpu-x86.c
index 1b6917d..b192c76 100644
--- a/liboil/liboilcpu-x86.c
+++ b/liboil/liboilcpu-x86.c
@@ -107,6 +107,19 @@ oil_cpu_i386_getflags_cpuinfo (char *cpuinfo)
OIL_DEBUG ("cpu flag %s", *f);
oil_cpu_flags |= OIL_IMPL_FLAG_3DNOWEXT;
}
+ if (strcmp (*f, "sse3") == 0) {
+ OIL_DEBUG ("cpu flag %s", *f);
+ oil_cpu_flags |= OIL_IMPL_FLAG_SSE3;
+ oil_cpu_flags |= OIL_IMPL_FLAG_SSE2;
+ oil_cpu_flags |= OIL_IMPL_FLAG_MMXEXT;
+ }
+ if (strcmp (*f, "ssse3") == 0) {
+ OIL_DEBUG ("cpu flag %s", *f);
+ oil_cpu_flags |= OIL_IMPL_FLAG_SSSE3;
+ oil_cpu_flags |= OIL_IMPL_FLAG_SSE3;
+ oil_cpu_flags |= OIL_IMPL_FLAG_SSE2;
+ oil_cpu_flags |= OIL_IMPL_FLAG_MMXEXT;
+ }
free (*f);
}
diff --git a/liboil/liboilfunction.h b/liboil/liboilfunction.h
index 34c6b74..2d1f505 100644
--- a/liboil/liboilfunction.h
+++ b/liboil/liboilfunction.h
@@ -83,6 +83,9 @@ OIL_BEGIN_DECLS
* @OIL_IMPL_FLAG_SSE3: uses SSE3 instructions. This flag implies
* @OIL_IMPL_FLAG_SSE2.
*
+ * @OIL_IMPL_FLAG_SSSE3: uses SSSE3 instructions. This flag implies
+ * @OIL_IMPL_FLAG_SSE3.
+ *
* @OIL_IMPL_FLAG_ALTIVEC: uses Altivec instructions.
*
*/
@@ -102,7 +105,8 @@ typedef enum {
OIL_IMPL_FLAG_ALTIVEC = (1<<24),
OIL_IMPL_FLAG_EDSP = (1<<25),
OIL_IMPL_FLAG_ARM6 = (1<<26),
- OIL_IMPL_FLAG_VFP = (1<<27)
+ OIL_IMPL_FLAG_VFP = (1<<27),
+ OIL_IMPL_FLAG_SSSE3 = (1<<28)
} OilImplFlag;
#ifdef OIL_ENABLE_UNSTABLE_API
diff --git a/testsuite/instruction/check-instructions.pl b/testsuite/instruction/check-instructions.pl
index 877d030..7ed3aa7 100755
--- a/testsuite/instruction/check-instructions.pl
+++ b/testsuite/instruction/check-instructions.pl
@@ -48,6 +48,12 @@ sub get_flags
}elsif (grep { /^$opcode$/ } @sse2_list) {
$exts->{"sse2"} = 1;
$debug && print " $opcode: sse2\n";
+ }elsif (grep { /^$opcode$/ } @sse3_list) {
+ $exts->{"sse3"} = 1;
+ $debug && print " $opcode: sse3\n";
+ }elsif (grep { /^$opcode$/ } @ssse3_list) {
+ $exts->{"ssse3"} = 1;
+ $debug && print " $opcode: ssse3\n";
}else {
print "FIXME:\t\"$opcode\",\n";
$error = 1;
@@ -513,6 +519,39 @@ sub check
"mfence",
);
+@sse3_list = (
+ "addsubpd",
+ "addsubps",
+ "haddpd",
+ "haddps",
+ "hsubpd",
+ "hsubps",
+ "lddqu",
+ "movddup",
+ "movshdup",
+ "movsldup",
+ "fisttp"
+);
+
+@ssse3_list = (
+ "psignb",
+ "psignw",
+ "psignd",
+ "pabsb",
+ "pabsw",
+ "pabsd",
+ "palignr",
+ "pshufb",
+ "pmulhrsw",
+ "pmaddubsw",
+ "phsubw",
+ "phsubd",
+ "phsubsw",
+ "phaddw",
+ "phaddd",
+ "phaddsw"
+);
+
#@clflush_list = (
# "clflush",
#);
diff --git a/testsuite/instruction/list-impls.c b/testsuite/instruction/list-impls.c
index 02e79d1..a8cc7c2 100644
--- a/testsuite/instruction/list-impls.c
+++ b/testsuite/instruction/list-impls.c
@@ -69,6 +69,8 @@ main (int argc, char *argv[])
if (flags & OIL_IMPL_FLAG_MMXEXT) printf(" mmxext");
if (flags & OIL_IMPL_FLAG_SSE) printf(" sse");
if (flags & OIL_IMPL_FLAG_SSE2) printf(" sse2");
+ if (flags & OIL_IMPL_FLAG_SSE3) printf(" sse3");
+ if (flags & OIL_IMPL_FLAG_SSSE3) printf(" ssse3");
if (flags & OIL_IMPL_FLAG_ALTIVEC) printf(" altivec");
printf("\n");
}