mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-20 14:26:17 +00:00
Add support for GEN5
Add a new option [-g n], n=4(GEN4),5(GEN5). If don't use -g, the default value is 4(GEN4)
This commit is contained in:
parent
be9bcee15f
commit
549b751afb
@ -1185,6 +1185,14 @@ struct brw_instruction
|
|||||||
GLuint pad1:6;
|
GLuint pad1:6;
|
||||||
} ia16;
|
} ia16;
|
||||||
|
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
GLuint pad:26;
|
||||||
|
GLuint end_of_thread:1;
|
||||||
|
GLuint pad1:1;
|
||||||
|
GLuint sfid:4;
|
||||||
|
} send_gen5; /* for GEN5 only */
|
||||||
|
|
||||||
} bits2;
|
} bits2;
|
||||||
|
|
||||||
union
|
union
|
||||||
@ -1332,6 +1340,99 @@ struct brw_instruction
|
|||||||
GLuint end_of_thread:1;
|
GLuint end_of_thread:1;
|
||||||
} generic;
|
} generic;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
GLuint function:4;
|
||||||
|
GLuint int_type:1;
|
||||||
|
GLuint precision:1;
|
||||||
|
GLuint saturate:1;
|
||||||
|
GLuint data_type:1;
|
||||||
|
GLuint snapshot:1;
|
||||||
|
GLuint pad0:10;
|
||||||
|
GLuint header_present:1;
|
||||||
|
GLuint response_length:5;
|
||||||
|
GLuint msg_length:4;
|
||||||
|
GLuint pad1:2;
|
||||||
|
GLuint end_of_thread:1;
|
||||||
|
} math_gen5;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
GLuint opcode:4;
|
||||||
|
GLuint offset:6;
|
||||||
|
GLuint swizzle_control:2;
|
||||||
|
GLuint pad:1;
|
||||||
|
GLuint allocate:1;
|
||||||
|
GLuint used:1;
|
||||||
|
GLuint complete:1;
|
||||||
|
GLuint pad0:3;
|
||||||
|
GLuint header_present:1;
|
||||||
|
GLuint response_length:5;
|
||||||
|
GLuint msg_length:4;
|
||||||
|
GLuint pad1:2;
|
||||||
|
GLuint end_of_thread:1;
|
||||||
|
} urb_gen5;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
GLuint binding_table_index:8;
|
||||||
|
GLuint sampler:4;
|
||||||
|
GLuint msg_type:4;
|
||||||
|
GLuint simd_mode:2;
|
||||||
|
GLuint pad0:1;
|
||||||
|
GLuint header_present:1;
|
||||||
|
GLuint response_length:5;
|
||||||
|
GLuint msg_length:4;
|
||||||
|
GLuint pad1:2;
|
||||||
|
GLuint end_of_thread:1;
|
||||||
|
} sampler_gen5;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
GLuint binding_table_index:8;
|
||||||
|
GLuint msg_control:3;
|
||||||
|
GLuint msg_type:3;
|
||||||
|
GLuint target_cache:2;
|
||||||
|
GLuint pad0:3;
|
||||||
|
GLuint header_present:1;
|
||||||
|
GLuint response_length:5;
|
||||||
|
GLuint msg_length:4;
|
||||||
|
GLuint pad1:2;
|
||||||
|
GLuint end_of_thread:1;
|
||||||
|
} dp_read_gen5;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
GLuint binding_table_index:8;
|
||||||
|
GLuint msg_control:3;
|
||||||
|
GLuint pixel_scoreboard_clear:1;
|
||||||
|
GLuint msg_type:3;
|
||||||
|
GLuint send_commit_msg:1;
|
||||||
|
GLuint pad0:3;
|
||||||
|
GLuint header_present:1;
|
||||||
|
GLuint response_length:5;
|
||||||
|
GLuint msg_length:4;
|
||||||
|
GLuint pad1:2;
|
||||||
|
GLuint end_of_thread:1;
|
||||||
|
} dp_write_gen5;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
GLuint opcode:1;
|
||||||
|
GLuint requester_type:1;
|
||||||
|
GLuint pad0:2;
|
||||||
|
GLuint resource_select:1;
|
||||||
|
GLuint pad1:14;
|
||||||
|
GLuint header_present:1;
|
||||||
|
GLuint response_length:5;
|
||||||
|
GLuint msg_length:4;
|
||||||
|
GLuint pad2:2;
|
||||||
|
GLuint end_of_thread:1;
|
||||||
|
} thread_spawner_gen5;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
GLuint pad:19;
|
||||||
|
GLuint header_present:1;
|
||||||
|
GLuint response_length:5;
|
||||||
|
GLuint msg_length:4;
|
||||||
|
GLuint pad1:2;
|
||||||
|
GLuint end_of_thread:1;
|
||||||
|
} generic_gen5;
|
||||||
|
|
||||||
GLuint ud;
|
GLuint ud;
|
||||||
GLint id;
|
GLint id;
|
||||||
GLfloat fd;
|
GLfloat fd;
|
||||||
|
@ -32,6 +32,8 @@
|
|||||||
#include "gen4asm.h"
|
#include "gen4asm.h"
|
||||||
#include "brw_defines.h"
|
#include "brw_defines.h"
|
||||||
|
|
||||||
|
extern long int gen_level;
|
||||||
|
|
||||||
int set_instruction_dest(struct brw_instruction *instr,
|
int set_instruction_dest(struct brw_instruction *instr,
|
||||||
struct dst_operand *dest);
|
struct dst_operand *dest);
|
||||||
int set_instruction_src0(struct brw_instruction *instr,
|
int set_instruction_src0(struct brw_instruction *instr,
|
||||||
@ -308,12 +310,23 @@ sendinstruction: predicate SEND execsize INTEGER post_dst payload msgtarget
|
|||||||
YYERROR;
|
YYERROR;
|
||||||
$$.bits1.da1.src1_reg_file = BRW_IMMEDIATE_VALUE;
|
$$.bits1.da1.src1_reg_file = BRW_IMMEDIATE_VALUE;
|
||||||
$$.bits1.da1.src1_reg_type = BRW_REGISTER_TYPE_D;
|
$$.bits1.da1.src1_reg_type = BRW_REGISTER_TYPE_D;
|
||||||
|
|
||||||
|
if (gen_level == 5) {
|
||||||
|
$$.bits2.send_gen5.sfid = $7.bits2.send_gen5.sfid;
|
||||||
|
$$.bits2.send_gen5.end_of_thread = $12.bits3.generic_gen5.end_of_thread;
|
||||||
|
$$.bits3.generic_gen5 = $7.bits3.generic_gen5;
|
||||||
|
$$.bits3.generic_gen5.msg_length = $9;
|
||||||
|
$$.bits3.generic_gen5.response_length = $11;
|
||||||
|
$$.bits3.generic_gen5.end_of_thread =
|
||||||
|
$12.bits3.generic_gen5.end_of_thread;
|
||||||
|
} else {
|
||||||
$$.bits3.generic = $7.bits3.generic;
|
$$.bits3.generic = $7.bits3.generic;
|
||||||
$$.bits3.generic.msg_length = $9;
|
$$.bits3.generic.msg_length = $9;
|
||||||
$$.bits3.generic.response_length = $11;
|
$$.bits3.generic.response_length = $11;
|
||||||
$$.bits3.generic.end_of_thread =
|
$$.bits3.generic.end_of_thread =
|
||||||
$12.bits3.generic.end_of_thread;
|
$12.bits3.generic.end_of_thread;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
jumpinstruction: predicate JMPI relativelocation2
|
jumpinstruction: predicate JMPI relativelocation2
|
||||||
@ -518,11 +531,23 @@ post_dst: dst
|
|||||||
|
|
||||||
msgtarget: NULL_TOKEN
|
msgtarget: NULL_TOKEN
|
||||||
{
|
{
|
||||||
|
if (gen_level == 5) {
|
||||||
|
$$.bits2.send_gen5.sfid= BRW_MESSAGE_TARGET_NULL;
|
||||||
|
$$.bits3.generic_gen5.header_present = 0; /* ??? */
|
||||||
|
} else {
|
||||||
$$.bits3.generic.msg_target = BRW_MESSAGE_TARGET_NULL;
|
$$.bits3.generic.msg_target = BRW_MESSAGE_TARGET_NULL;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
| SAMPLER LPAREN INTEGER COMMA INTEGER COMMA
|
| SAMPLER LPAREN INTEGER COMMA INTEGER COMMA
|
||||||
sampler_datatype RPAREN
|
sampler_datatype RPAREN
|
||||||
{
|
{
|
||||||
|
if (gen_level == 5) {
|
||||||
|
$$.bits2.send_gen5.sfid = BRW_MESSAGE_TARGET_SAMPLER;
|
||||||
|
$$.bits3.generic_gen5.header_present = 1; /* ??? */
|
||||||
|
$$.bits3.sampler_gen5.binding_table_index = $3;
|
||||||
|
$$.bits3.sampler_gen5.sampler = $5;
|
||||||
|
$$.bits3.sampler_gen5.simd_mode = 2; /* SIMD16, maybe we should add a new parameter */
|
||||||
|
} else {
|
||||||
$$.bits3.generic.msg_target = BRW_MESSAGE_TARGET_SAMPLER;
|
$$.bits3.generic.msg_target = BRW_MESSAGE_TARGET_SAMPLER;
|
||||||
$$.bits3.sampler.binding_table_index = $3;
|
$$.bits3.sampler.binding_table_index = $3;
|
||||||
$$.bits3.sampler.sampler = $5;
|
$$.bits3.sampler.sampler = $5;
|
||||||
@ -541,8 +566,21 @@ msgtarget: NULL_TOKEN
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
| MATH math_function saturate math_signed math_scalar
|
| MATH math_function saturate math_signed math_scalar
|
||||||
{
|
{
|
||||||
|
if (gen_level == 5) {
|
||||||
|
$$.bits2.send_gen5.sfid = BRW_MESSAGE_TARGET_MATH;
|
||||||
|
$$.bits3.generic_gen5.header_present = 0;
|
||||||
|
$$.bits3.math_gen5.function = $2;
|
||||||
|
if ($3 == BRW_INSTRUCTION_SATURATE)
|
||||||
|
$$.bits3.math_gen5.saturate = 1;
|
||||||
|
else
|
||||||
|
$$.bits3.math_gen5.saturate = 0;
|
||||||
|
$$.bits3.math_gen5.int_type = $4;
|
||||||
|
$$.bits3.math_gen5.precision = BRW_MATH_PRECISION_FULL;
|
||||||
|
$$.bits3.math_gen5.data_type = $5;
|
||||||
|
} else {
|
||||||
$$.bits3.generic.msg_target = BRW_MESSAGE_TARGET_MATH;
|
$$.bits3.generic.msg_target = BRW_MESSAGE_TARGET_MATH;
|
||||||
$$.bits3.math.function = $2;
|
$$.bits3.math.function = $2;
|
||||||
if ($3 == BRW_INSTRUCTION_SATURATE)
|
if ($3 == BRW_INSTRUCTION_SATURATE)
|
||||||
@ -553,13 +591,28 @@ msgtarget: NULL_TOKEN
|
|||||||
$$.bits3.math.precision = BRW_MATH_PRECISION_FULL;
|
$$.bits3.math.precision = BRW_MATH_PRECISION_FULL;
|
||||||
$$.bits3.math.data_type = $5;
|
$$.bits3.math.data_type = $5;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
| GATEWAY
|
| GATEWAY
|
||||||
{
|
{
|
||||||
|
if (gen_level == 5) {
|
||||||
|
$$.bits2.send_gen5.sfid = BRW_MESSAGE_TARGET_GATEWAY;
|
||||||
|
$$.bits3.generic_gen5.header_present = 0; /* ??? */
|
||||||
|
} else {
|
||||||
$$.bits3.generic.msg_target = BRW_MESSAGE_TARGET_GATEWAY;
|
$$.bits3.generic.msg_target = BRW_MESSAGE_TARGET_GATEWAY;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
| READ LPAREN INTEGER COMMA INTEGER COMMA INTEGER COMMA
|
| READ LPAREN INTEGER COMMA INTEGER COMMA INTEGER COMMA
|
||||||
INTEGER RPAREN
|
INTEGER RPAREN
|
||||||
{
|
{
|
||||||
|
if (gen_level == 5) {
|
||||||
|
$$.bits2.send_gen5.sfid =
|
||||||
|
BRW_MESSAGE_TARGET_DATAPORT_READ;
|
||||||
|
$$.bits3.generic_gen5.header_present = 1;
|
||||||
|
$$.bits3.dp_read_gen5.binding_table_index = $3;
|
||||||
|
$$.bits3.dp_read_gen5.target_cache = $5;
|
||||||
|
$$.bits3.dp_read_gen5.msg_control = $7;
|
||||||
|
$$.bits3.dp_read_gen5.msg_type = $9;
|
||||||
|
} else {
|
||||||
$$.bits3.generic.msg_target =
|
$$.bits3.generic.msg_target =
|
||||||
BRW_MESSAGE_TARGET_DATAPORT_READ;
|
BRW_MESSAGE_TARGET_DATAPORT_READ;
|
||||||
$$.bits3.dp_read.binding_table_index = $3;
|
$$.bits3.dp_read.binding_table_index = $3;
|
||||||
@ -567,9 +620,20 @@ msgtarget: NULL_TOKEN
|
|||||||
$$.bits3.dp_read.msg_control = $7;
|
$$.bits3.dp_read.msg_control = $7;
|
||||||
$$.bits3.dp_read.msg_type = $9;
|
$$.bits3.dp_read.msg_type = $9;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
| WRITE LPAREN INTEGER COMMA INTEGER COMMA INTEGER COMMA
|
| WRITE LPAREN INTEGER COMMA INTEGER COMMA INTEGER COMMA
|
||||||
INTEGER RPAREN
|
INTEGER RPAREN
|
||||||
{
|
{
|
||||||
|
if (gen_level == 5) {
|
||||||
|
$$.bits2.send_gen5.sfid =
|
||||||
|
BRW_MESSAGE_TARGET_DATAPORT_WRITE;
|
||||||
|
$$.bits3.generic_gen5.header_present = 1;
|
||||||
|
$$.bits3.dp_write_gen5.binding_table_index = $3;
|
||||||
|
$$.bits3.dp_write_gen5.pixel_scoreboard_clear = ($5 & 0x8) >> 3;
|
||||||
|
$$.bits3.dp_write_gen5.msg_control = $5 & 0x7;
|
||||||
|
$$.bits3.dp_write_gen5.msg_type = $7;
|
||||||
|
$$.bits3.dp_write_gen5.send_commit_msg = $9;
|
||||||
|
} else {
|
||||||
$$.bits3.generic.msg_target =
|
$$.bits3.generic.msg_target =
|
||||||
BRW_MESSAGE_TARGET_DATAPORT_WRITE;
|
BRW_MESSAGE_TARGET_DATAPORT_WRITE;
|
||||||
$$.bits3.dp_write.binding_table_index = $3;
|
$$.bits3.dp_write.binding_table_index = $3;
|
||||||
@ -582,8 +646,21 @@ msgtarget: NULL_TOKEN
|
|||||||
$$.bits3.dp_write.msg_type = $7;
|
$$.bits3.dp_write.msg_type = $7;
|
||||||
$$.bits3.dp_write.send_commit_msg = $9;
|
$$.bits3.dp_write.send_commit_msg = $9;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
| URB INTEGER urb_swizzle urb_allocate urb_used urb_complete
|
| URB INTEGER urb_swizzle urb_allocate urb_used urb_complete
|
||||||
{
|
{
|
||||||
|
$$.bits3.generic.msg_target = BRW_MESSAGE_TARGET_URB;
|
||||||
|
if (gen_level == 5) {
|
||||||
|
$$.bits2.send_gen5.sfid = BRW_MESSAGE_TARGET_URB;
|
||||||
|
$$.bits3.generic_gen5.header_present = 1;
|
||||||
|
$$.bits3.urb_gen5.opcode = BRW_URB_OPCODE_WRITE;
|
||||||
|
$$.bits3.urb_gen5.offset = $2;
|
||||||
|
$$.bits3.urb_gen5.swizzle_control = $3;
|
||||||
|
$$.bits3.urb_gen5.pad = 0;
|
||||||
|
$$.bits3.urb_gen5.allocate = $4;
|
||||||
|
$$.bits3.urb_gen5.used = $5;
|
||||||
|
$$.bits3.urb_gen5.complete = $6;
|
||||||
|
} else {
|
||||||
$$.bits3.generic.msg_target = BRW_MESSAGE_TARGET_URB;
|
$$.bits3.generic.msg_target = BRW_MESSAGE_TARGET_URB;
|
||||||
$$.bits3.urb.opcode = BRW_URB_OPCODE_WRITE;
|
$$.bits3.urb.opcode = BRW_URB_OPCODE_WRITE;
|
||||||
$$.bits3.urb.offset = $2;
|
$$.bits3.urb.offset = $2;
|
||||||
@ -593,15 +670,27 @@ msgtarget: NULL_TOKEN
|
|||||||
$$.bits3.urb.used = $5;
|
$$.bits3.urb.used = $5;
|
||||||
$$.bits3.urb.complete = $6;
|
$$.bits3.urb.complete = $6;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
| THREAD_SPAWNER LPAREN INTEGER COMMA INTEGER COMMA
|
| THREAD_SPAWNER LPAREN INTEGER COMMA INTEGER COMMA
|
||||||
INTEGER RPAREN
|
INTEGER RPAREN
|
||||||
{
|
{
|
||||||
|
$$.bits3.generic.msg_target =
|
||||||
|
BRW_MESSAGE_TARGET_THREAD_SPAWNER;
|
||||||
|
if (gen_level == 5) {
|
||||||
|
$$.bits2.send_gen5.sfid =
|
||||||
|
BRW_MESSAGE_TARGET_THREAD_SPAWNER;
|
||||||
|
$$.bits3.generic_gen5.header_present = 0;
|
||||||
|
$$.bits3.thread_spawner_gen5.opcode = $3;
|
||||||
|
$$.bits3.thread_spawner_gen5.requester_type = $5;
|
||||||
|
$$.bits3.thread_spawner_gen5.resource_select = $7;
|
||||||
|
} else {
|
||||||
$$.bits3.generic.msg_target =
|
$$.bits3.generic.msg_target =
|
||||||
BRW_MESSAGE_TARGET_THREAD_SPAWNER;
|
BRW_MESSAGE_TARGET_THREAD_SPAWNER;
|
||||||
$$.bits3.thread_spawner.opcode = $3;
|
$$.bits3.thread_spawner.opcode = $3;
|
||||||
$$.bits3.thread_spawner.requester_type = $5;
|
$$.bits3.thread_spawner.requester_type = $5;
|
||||||
$$.bits3.thread_spawner.resource_select = $7;
|
$$.bits3.thread_spawner.resource_select = $7;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
urb_allocate: ALLOCATE { $$ = 1; }
|
urb_allocate: ALLOCATE { $$ = 1; }
|
||||||
|
@ -38,6 +38,7 @@ extern FILE *yyin;
|
|||||||
|
|
||||||
extern int errors;
|
extern int errors;
|
||||||
|
|
||||||
|
long int gen_level = 4;
|
||||||
char *input_filename = "<stdin>";
|
char *input_filename = "<stdin>";
|
||||||
|
|
||||||
struct brw_program compiled_program;
|
struct brw_program compiled_program;
|
||||||
@ -48,7 +49,7 @@ static const struct option longopts[] = {
|
|||||||
|
|
||||||
static void usage(void)
|
static void usage(void)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "usage: intel-gen4asm [-o outputfile] inputfile\n");
|
fprintf(stderr, "usage: intel-gen4asm [-o outputfile] [-g <4|5>] inputfile\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
@ -59,12 +60,23 @@ int main(int argc, char **argv)
|
|||||||
int err, inst_offset;
|
int err, inst_offset;
|
||||||
char o;
|
char o;
|
||||||
|
|
||||||
while ((o = getopt_long(argc, argv, "o:", longopts, NULL)) != -1) {
|
while ((o = getopt_long(argc, argv, "o:g:", longopts, NULL)) != -1) {
|
||||||
switch (o) {
|
switch (o) {
|
||||||
case 'o':
|
case 'o':
|
||||||
if (strcmp(optarg, "-") != 0)
|
if (strcmp(optarg, "-") != 0)
|
||||||
output_file = optarg;
|
output_file = optarg;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'g':
|
||||||
|
gen_level = strtol(optarg, NULL, 0);
|
||||||
|
|
||||||
|
if (gen_level < 4 || gen_level > 5) {
|
||||||
|
usage();
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
usage();
|
usage();
|
||||||
exit(1);
|
exit(1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user