projects
/
mesa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of ssh://people.freedesktop.org/~jbarnes/mesa
[mesa.git]
/
src
/
gallium
/
drivers
/
llvmpipe
/
lp_test_blend.c
diff --git
a/src/gallium/drivers/llvmpipe/lp_test_blend.c
b/src/gallium/drivers/llvmpipe/lp_test_blend.c
index 8dfad468e3cca1dcaaeecee0c6b706c8cbb2f41f..29fff91981aef423770c2c0ce24e4ab8f3fce4cc 100644
(file)
--- a/
src/gallium/drivers/llvmpipe/lp_test_blend.c
+++ b/
src/gallium/drivers/llvmpipe/lp_test_blend.c
@@
-80,7
+80,7
@@
static void
write_tsv_row(FILE *fp,
const struct pipe_blend_state *blend,
enum vector_mode mode,
write_tsv_row(FILE *fp,
const struct pipe_blend_state *blend,
enum vector_mode mode,
-
union
lp_type type,
+
struct
lp_type type,
double cycles,
boolean success)
{
double cycles,
boolean success)
{
@@
-125,7
+125,7
@@
static void
dump_blend_type(FILE *fp,
const struct pipe_blend_state *blend,
enum vector_mode mode,
dump_blend_type(FILE *fp,
const struct pipe_blend_state *blend,
enum vector_mode mode,
-
union
lp_type type)
+
struct
lp_type type)
{
fprintf(fp, "%s", mode ? "soa" : "aos");
{
fprintf(fp, "%s", mode ? "soa" : "aos");
@@
-153,7
+153,7
@@
static LLVMValueRef
add_blend_test(LLVMModuleRef module,
const struct pipe_blend_state *blend,
enum vector_mode mode,
add_blend_test(LLVMModuleRef module,
const struct pipe_blend_state *blend,
enum vector_mode mode,
-
union
lp_type type)
+
struct
lp_type type)
{
LLVMTypeRef ret_type;
LLVMTypeRef vec_type;
{
LLVMTypeRef ret_type;
LLVMTypeRef vec_type;
@@
-462,12
+462,13
@@
compute_blend_ref(const struct pipe_blend_state *blend,
}
}
+ALIGN_STACK
static boolean
test_one(unsigned verbose,
FILE *fp,
const struct pipe_blend_state *blend,
enum vector_mode mode,
static boolean
test_one(unsigned verbose,
FILE *fp,
const struct pipe_blend_state *blend,
enum vector_mode mode,
-
union
lp_type type)
+
struct
lp_type type)
{
LLVMModuleRef module = NULL;
LLVMValueRef func = NULL;
{
LLVMModuleRef module = NULL;
LLVMValueRef func = NULL;
@@
-477,8
+478,8
@@
test_one(unsigned verbose,
char *error = NULL;
blend_test_ptr_t blend_test_ptr;
boolean success;
char *error = NULL;
blend_test_ptr_t blend_test_ptr;
boolean success;
- const unsigned n =
32
;
- int64_t cycles[
n
];
+ const unsigned n =
LP_TEST_NUM_SAMPLES
;
+ int64_t cycles[
LP_TEST_NUM_SAMPLES
];
double cycles_avg = 0.0;
unsigned i, j;
double cycles_avg = 0.0;
unsigned i, j;
@@
-530,11
+531,11
@@
test_one(unsigned verbose,
success = TRUE;
for(i = 0; i < n && success; ++i) {
if(mode == AoS) {
success = TRUE;
for(i = 0; i < n && success; ++i) {
if(mode == AoS) {
-
uint8_t src[LP_MAX_VECTOR_LENGTH*LP_MAX_TYPE
_WIDTH/8];
-
uint8_t dst[LP_MAX_VECTOR_LENGTH*LP_MAX_TYPE
_WIDTH/8];
-
uint8_t con[LP_MAX_VECTOR_LENGTH*LP_MAX_TYPE
_WIDTH/8];
-
uint8_t res[LP_MAX_VECTOR_LENGTH*LP_MAX_TYPE
_WIDTH/8];
-
uint8_t ref[LP_MAX_VECTOR_LENGTH*LP_MAX_TYPE
_WIDTH/8];
+
ALIGN16_ATTRIB uint8_t src[LP_NATIVE_VECTOR
_WIDTH/8];
+
ALIGN16_ATTRIB uint8_t dst[LP_NATIVE_VECTOR
_WIDTH/8];
+
ALIGN16_ATTRIB uint8_t con[LP_NATIVE_VECTOR
_WIDTH/8];
+
ALIGN16_ATTRIB uint8_t res[LP_NATIVE_VECTOR
_WIDTH/8];
+
ALIGN16_ATTRIB uint8_t ref[LP_NATIVE_VECTOR
_WIDTH/8];
int64_t start_counter = 0;
int64_t end_counter = 0;
int64_t start_counter = 0;
int64_t end_counter = 0;
@@
-595,11
+596,11
@@
test_one(unsigned verbose,
if(mode == SoA) {
const unsigned stride = type.length*type.width/8;
if(mode == SoA) {
const unsigned stride = type.length*type.width/8;
-
uint8_t src[4*LP_MAX_VECTOR_LENGTH*LP_MAX_TYPE
_WIDTH/8];
-
uint8_t dst[4*LP_MAX_VECTOR_LENGTH*LP_MAX_TYPE
_WIDTH/8];
-
uint8_t con[4*LP_MAX_VECTOR_LENGTH*LP_MAX_TYPE
_WIDTH/8];
-
uint8_t res[4*LP_MAX_VECTOR_LENGTH*LP_MAX_TYPE
_WIDTH/8];
-
uint8_t ref[4*LP_MAX_VECTOR_LENGTH*LP_MAX_TYPE
_WIDTH/8];
+
ALIGN16_ATTRIB uint8_t src[4*LP_NATIVE_VECTOR
_WIDTH/8];
+
ALIGN16_ATTRIB uint8_t dst[4*LP_NATIVE_VECTOR
_WIDTH/8];
+
ALIGN16_ATTRIB uint8_t con[4*LP_NATIVE_VECTOR
_WIDTH/8];
+
ALIGN16_ATTRIB uint8_t res[4*LP_NATIVE_VECTOR
_WIDTH/8];
+
ALIGN16_ATTRIB uint8_t ref[4*LP_NATIVE_VECTOR
_WIDTH/8];
int64_t start_counter = 0;
int64_t end_counter = 0;
boolean mismatch;
int64_t start_counter = 0;
int64_t end_counter = 0;
boolean mismatch;
@@
-765,10
+766,10
@@
blend_funcs[] = {
};
};
-const
union
lp_type blend_types[] = {
+const
struct
lp_type blend_types[] = {
/* float, fixed, sign, norm, width, len */
/* float, fixed, sign, norm, width, len */
- {
{ TRUE, FALSE, FALSE, TRUE, 32, 4 }
}, /* f32 x 4 */
- {
{ FALSE, FALSE, FALSE, TRUE, 8, 16 }
}, /* u8n x 16 */
+ {
TRUE, FALSE, FALSE, TRUE, 32, 4
}, /* f32 x 4 */
+ {
FALSE, FALSE, FALSE, TRUE, 8, 16
}, /* u8n x 16 */
};
};
@@
-788,7
+789,7
@@
test_all(unsigned verbose, FILE *fp)
const unsigned *alpha_dst_factor;
struct pipe_blend_state blend;
enum vector_mode mode;
const unsigned *alpha_dst_factor;
struct pipe_blend_state blend;
enum vector_mode mode;
- const
union
lp_type *type;
+ const
struct
lp_type *type;
bool success = TRUE;
for(rgb_func = blend_funcs; rgb_func < &blend_funcs[num_funcs]; ++rgb_func) {
bool success = TRUE;
for(rgb_func = blend_funcs; rgb_func < &blend_funcs[num_funcs]; ++rgb_func) {
@@
-841,27
+842,27
@@
test_some(unsigned verbose, FILE *fp, unsigned long n)
const unsigned *alpha_dst_factor;
struct pipe_blend_state blend;
enum vector_mode mode;
const unsigned *alpha_dst_factor;
struct pipe_blend_state blend;
enum vector_mode mode;
- const
union
lp_type *type;
+ const
struct
lp_type *type;
unsigned long i;
bool success = TRUE;
for(i = 0; i < n; ++i) {
unsigned long i;
bool success = TRUE;
for(i = 0; i < n; ++i) {
- rgb_func = &blend_funcs[rand
om
() % num_funcs];
- alpha_func = &blend_funcs[rand
om
() % num_funcs];
- rgb_src_factor = &blend_factors[rand
om
() % num_factors];
- alpha_src_factor = &blend_factors[rand
om
() % num_factors];
+ rgb_func = &blend_funcs[rand() % num_funcs];
+ alpha_func = &blend_funcs[rand() % num_funcs];
+ rgb_src_factor = &blend_factors[rand() % num_factors];
+ alpha_src_factor = &blend_factors[rand() % num_factors];
do {
do {
- rgb_dst_factor = &blend_factors[rand
om
() % num_factors];
+ rgb_dst_factor = &blend_factors[rand() % num_factors];
} while(*rgb_dst_factor == PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE);
do {
} while(*rgb_dst_factor == PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE);
do {
- alpha_dst_factor = &blend_factors[rand
om
() % num_factors];
+ alpha_dst_factor = &blend_factors[rand() % num_factors];
} while(*alpha_dst_factor == PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE);
} while(*alpha_dst_factor == PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE);
- mode = rand
om
() & 1;
+ mode = rand() & 1;
- type = &blend_types[rand
om
() % num_types];
+ type = &blend_types[rand() % num_types];
memset(&blend, 0, sizeof blend);
blend.blend_enable = 1;
memset(&blend, 0, sizeof blend);
blend.blend_enable = 1;