git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5893
INSN_TESTS = insn_basic insn_mmx insn_sse insn_sse2 insn_fpu
EXTRA_DIST = $(noinst_SCRIPTS) \
+ clc.vgtest clc.stdout.exp clc.stderr.exp \
faultstatus.vgtest faultstatus.stderr.exp \
fcmovnu.vgtest fcmovnu.stderr.exp fcmovnu.stdout.exp \
fxtract.vgtest fxtract.stderr.exp fxtract.stdout.exp \
check_PROGRAMS = \
+ clc \
faultstatus fcmovnu fxtract $(INSN_TESTS) looper jrcxz smc1 shrld
AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -g -I$(top_srcdir)/include
--- /dev/null
+
+#include <stdio.h>
+
+typedef unsigned long long int ULong;
+
+ULong do_clc ( void )
+{
+ ULong res;
+ __asm__ __volatile__(
+ "pushq $0x8d5\n\t" /* OSZACP */
+ "popfq\n\t"
+ "clc\n\t"
+ "pushfq\n\t"
+ "popq %0"
+ : "=r"(res)
+ :
+ : "memory", "cc"
+ );
+ return res;
+}
+
+ULong do_stc ( void )
+{
+ ULong res;
+ __asm__ __volatile__(
+ "pushq $0x0\n\t"
+ "popfq\n\t"
+ "stc\n\t"
+ "pushfq\n\t"
+ "popq %0"
+ : "=r"(res)
+ :
+ : "memory", "cc"
+ );
+ return res;
+}
+
+ULong do_cmc ( void )
+{
+ ULong res;
+ __asm__ __volatile__(
+ "pushq $0x0\n\t"
+ "popfq\n\t"
+ "stc\n\t"
+ "cmc\n\t"
+ "pushfq\n\t"
+ "popq %0"
+ : "=r"(res)
+ :
+ : "memory", "cc"
+ );
+ return res;
+}
+
+int main ( void )
+{
+ printf("clc: 0x%016llx\n", 0x8d5 & do_clc());
+ printf("stc: 0x%016llx\n", 0x8d5 & do_stc());
+ printf("cmc: 0x%016llx\n", 0x8d5 & do_cmc());
+ return 0;
+}
--- /dev/null
+clc: 0x00000000000008d4
+stc: 0x0000000000000001
+cmc: 0x0000000000000000