llvmpipe: enforce fixed memory limit on scenes
[mesa.git] / src / gallium / drivers / llvmpipe / lp_test.h
index a88e110c6631eeaee07d6b6f148b676c6bcc9ee3..90422e42588bf7e8fa4ca8b51a9d141e39b2e069 100644 (file)
@@ -41,7 +41,7 @@
 #include <stdio.h>
 #include <float.h>
 
-#include <llvm-c/Core.h>
+#include "gallivm/lp_bld.h"
 #include <llvm-c/Analysis.h>
 #include <llvm-c/ExecutionEngine.h>
 #include <llvm-c/Target.h>
 #include "pipe/p_state.h"
 #include "util/u_format.h"
 #include "util/u_math.h"
-#include "util/u_debug_dump.h"
+#include "util/u_dump.h"
 
-#include "lp_bld_type.h"
+#include "gallivm/lp_bld_type.h"
+
+
+#define LP_TEST_NUM_SAMPLES 32
 
 
 void
@@ -63,22 +66,35 @@ write_tsv_header(FILE *fp);
 boolean
 test_some(unsigned verbose, FILE *fp, unsigned long n);
 
+boolean
+test_single(unsigned verbose, FILE *fp);
 
 boolean
 test_all(unsigned verbose, FILE *fp);
 
 
+#if defined(PIPE_CC_MSVC)
+
+unsigned __int64 __rdtsc();
+#pragma intrinsic(__rdtsc)
+#define rdtsc() __rdtsc()
+
+#elif defined(PIPE_CC_GCC) && (defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64))
+
 static INLINE uint64_t
 rdtsc(void)
 {
-#if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64)
    uint32_t hi, lo;
    __asm__ __volatile__ ("rdtsc" : "=a"(lo), "=d"(hi));
    return ((uint64_t)lo) | (((uint64_t)hi) << 32);
+}
+
 #else
-   return 0;
+
+#define rdtsc() 0
+
 #endif
-}
+
 
 
 float