* each element twice.
*/
if (devinfo->gen == 7 && !devinfo->is_haswell &&
- brw_inst_access_mode(devinfo, p->current) == BRW_ALIGN_1 &&
+ brw_get_default_access_mode(p) == BRW_ALIGN_1 &&
dest.type == BRW_REGISTER_TYPE_DF &&
(src0.type == BRW_REGISTER_TYPE_F ||
src0.type == BRW_REGISTER_TYPE_D ||
brw_F32TO16(struct brw_codegen *p, struct brw_reg dst, struct brw_reg src)
{
const struct gen_device_info *devinfo = p->devinfo;
- const bool align16 = brw_inst_access_mode(devinfo, p->current) == BRW_ALIGN_16;
+ const bool align16 = brw_get_default_access_mode(p) == BRW_ALIGN_16;
/* The F32TO16 instruction doesn't support 32-bit destination types in
* Align1 mode, and neither does the Gen8 implementation in terms of a
* converting MOV. Gen7 does zero out the high 16 bits in Align16 mode as
brw_F16TO32(struct brw_codegen *p, struct brw_reg dst, struct brw_reg src)
{
const struct gen_device_info *devinfo = p->devinfo;
- bool align16 = brw_inst_access_mode(devinfo, p->current) == BRW_ALIGN_16;
+ bool align16 = brw_get_default_access_mode(p) == BRW_ALIGN_16;
if (align16) {
assert(src.type == BRW_REGISTER_TYPE_UD);
insn = next_insn(p, BRW_OPCODE_IF);
brw_set_dest(p, insn, brw_imm_w(0));
- brw_inst_set_exec_size(devinfo, insn,
- brw_inst_exec_size(devinfo, p->current));
+ brw_inst_set_exec_size(devinfo, insn, brw_get_default_exec_size(p));
brw_inst_set_gen6_jump_count(devinfo, insn, 0);
brw_set_src0(p, insn, src0);
brw_set_src1(p, insn, src1);
p->if_depth_in_loop[p->loop_stack_depth]);
}
brw_inst_set_qtr_control(devinfo, insn, BRW_COMPRESSION_NONE);
- brw_inst_set_exec_size(devinfo, insn,
- brw_inst_exec_size(devinfo, p->current));
+ brw_inst_set_exec_size(devinfo, insn, brw_get_default_exec_size(p));
return insn;
}
p->if_depth_in_loop[p->loop_stack_depth]);
}
brw_inst_set_qtr_control(devinfo, insn, BRW_COMPRESSION_NONE);
- brw_inst_set_exec_size(devinfo, insn,
- brw_inst_exec_size(devinfo, p->current));
+ brw_inst_set_exec_size(devinfo, insn, brw_get_default_exec_size(p));
return insn;
}
}
brw_inst_set_qtr_control(devinfo, insn, BRW_COMPRESSION_NONE);
- brw_inst_set_exec_size(devinfo, insn,
- brw_inst_exec_size(devinfo, p->current));
+ brw_inst_set_exec_size(devinfo, insn, brw_get_default_exec_size(p));
return insn;
}
brw_set_src1(p, insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D));
}
- brw_inst_set_exec_size(devinfo, insn,
- brw_inst_exec_size(devinfo, p->current));
+ brw_inst_set_exec_size(devinfo, insn, brw_get_default_exec_size(p));
} else {
if (p->single_program_flow) {
const unsigned target_cache =
(devinfo->gen >= 6 ? GEN6_SFID_DATAPORT_CONSTANT_CACHE :
BRW_DATAPORT_READ_TARGET_DATA_CACHE);
- const unsigned exec_size = 1 << brw_inst_exec_size(devinfo, p->current);
+ const unsigned exec_size = 1 << brw_get_default_exec_size(p);
/* On newer hardware, offset is in units of owords. */
if (devinfo->gen >= 6)
unsigned msg_type;
struct brw_reg dest, src0;
- if (brw_inst_exec_size(devinfo, p->current) >= BRW_EXECUTE_16)
+ if (brw_get_default_exec_size(p) >= BRW_EXECUTE_16)
dest = retype(vec16(brw_null_reg()), BRW_REGISTER_TYPE_UW);
else
dest = retype(vec8(brw_null_reg()), BRW_REGISTER_TYPE_UW);
const struct gen_device_info *devinfo = p->devinfo;
assert(devinfo->gen >= 9);
const unsigned msg_subtype =
- brw_inst_exec_size(devinfo, p->current) == BRW_EXECUTE_16 ? 0 : 1;
+ brw_get_default_exec_size(p) == BRW_EXECUTE_16 ? 0 : 1;
brw_inst *insn = next_insn(p, BRW_OPCODE_SENDC);
brw_set_dest(p, insn, dst);
GEN6_SFID_DATAPORT_RENDER_CACHE,
msg_length, true /* header_present */,
response_length);
- brw_inst_set_rt_slot_group(devinfo, insn,
- brw_inst_qtr_control(devinfo, p->current) / 2);
+ brw_inst_set_rt_slot_group(devinfo, insn, brw_get_default_group(p) / 16);
return insn;
}
bool has_simd4x2,
bool has_simd16)
{
- if (has_simd4x2 &&
- brw_inst_access_mode(p->devinfo, p->current) == BRW_ALIGN_16)
+ if (has_simd4x2 && brw_get_default_access_mode(p) == BRW_ALIGN_16)
return 1;
- else if (has_simd16 &&
- brw_inst_exec_size(p->devinfo, p->current) == BRW_EXECUTE_16)
+ else if (has_simd16 && brw_get_default_exec_size(p) == BRW_EXECUTE_16)
return 2 * num_channels;
else
return num_channels;
(response_expected ? 1 << 5 : 0); /* Return data expected */
if (devinfo->gen >= 8 || devinfo->is_haswell) {
- if (brw_inst_access_mode(devinfo, p->current) == BRW_ALIGN_1) {
- if (brw_inst_exec_size(devinfo, p->current) != BRW_EXECUTE_16)
+ if (brw_get_default_access_mode(p) == BRW_ALIGN_1) {
+ if (brw_get_default_exec_size(p) != BRW_EXECUTE_16)
msg_control |= 1 << 4; /* SIMD8 mode */
brw_inst_set_dp_msg_type(devinfo, insn,
brw_inst_set_dp_msg_type(devinfo, insn,
GEN7_DATAPORT_DC_UNTYPED_ATOMIC_OP);
- if (brw_inst_exec_size(devinfo, p->current) != BRW_EXECUTE_16)
+ if (brw_get_default_exec_size(p) != BRW_EXECUTE_16)
msg_control |= 1 << 4; /* SIMD8 mode */
}
const unsigned sfid = (devinfo->gen >= 8 || devinfo->is_haswell ?
HSW_SFID_DATAPORT_DATA_CACHE_1 :
GEN7_SFID_DATAPORT_DATA_CACHE);
- const bool align1 = brw_inst_access_mode(devinfo, p->current) == BRW_ALIGN_1;
+ const bool align1 = brw_get_default_access_mode(p) == BRW_ALIGN_1;
/* Mask out unused components -- This is especially important in Align16
* mode on generations that don't have native support for SIMD4x2 atomics,
* because unused but enabled components will cause the dataport to perform
/* Set mask of 32-bit channels to drop. */
unsigned msg_control = 0xf & (0xf << num_channels);
- if (brw_inst_access_mode(devinfo, p->current) == BRW_ALIGN_1) {
- if (brw_inst_exec_size(devinfo, p->current) == BRW_EXECUTE_16)
+ if (brw_get_default_access_mode(p) == BRW_ALIGN_1) {
+ if (brw_get_default_exec_size(p) == BRW_EXECUTE_16)
msg_control |= 1 << 4; /* SIMD16 mode */
else
msg_control |= 2 << 4; /* SIMD8 mode */
/* Set mask of 32-bit channels to drop. */
unsigned msg_control = 0xf & (0xf << num_channels);
- if (brw_inst_access_mode(devinfo, p->current) == BRW_ALIGN_1) {
- if (brw_inst_exec_size(devinfo, p->current) == BRW_EXECUTE_16)
+ if (brw_get_default_access_mode(p) == BRW_ALIGN_1) {
+ if (brw_get_default_exec_size(p) == BRW_EXECUTE_16)
msg_control |= 1 << 4; /* SIMD16 mode */
else
msg_control |= 2 << 4; /* SIMD8 mode */
const unsigned sfid = (devinfo->gen >= 8 || devinfo->is_haswell ?
HSW_SFID_DATAPORT_DATA_CACHE_1 :
GEN7_SFID_DATAPORT_DATA_CACHE);
- const bool align1 = brw_inst_access_mode(devinfo, p->current) == BRW_ALIGN_1;
+ const bool align1 = brw_get_default_access_mode(p) == BRW_ALIGN_1;
/* Mask out unused components -- See comment in brw_untyped_atomic(). */
const unsigned mask = devinfo->gen == 7 && !devinfo->is_haswell && !align1 ?
WRITEMASK_X : WRITEMASK_XYZW;
{
const struct gen_device_info *devinfo = p->devinfo;
assert(devinfo->gen > 7 || devinfo->is_haswell);
- assert(brw_inst_access_mode(devinfo, p->current) == BRW_ALIGN_1);
+ assert(brw_get_default_access_mode(p) == BRW_ALIGN_1);
const unsigned sfid = GEN7_SFID_DATAPORT_DATA_CACHE;
struct brw_inst *insn = brw_send_indirect_surface_message(
unsigned msg_control =
brw_byte_scattered_data_element_from_bit_size(bit_size) << 2;
- if (brw_inst_exec_size(devinfo, p->current) == BRW_EXECUTE_16)
+ if (brw_get_default_exec_size(p) == BRW_EXECUTE_16)
msg_control |= 1; /* SIMD16 mode */
else
msg_control |= 0; /* SIMD8 mode */
{
const struct gen_device_info *devinfo = p->devinfo;
assert(devinfo->gen > 7 || devinfo->is_haswell);
- assert(brw_inst_access_mode(devinfo, p->current) == BRW_ALIGN_1);
+ assert(brw_get_default_access_mode(p) == BRW_ALIGN_1);
const unsigned sfid = GEN7_SFID_DATAPORT_DATA_CACHE;
struct brw_inst *insn = brw_send_indirect_surface_message(
unsigned msg_control =
brw_byte_scattered_data_element_from_bit_size(bit_size) << 2;
- if (brw_inst_exec_size(devinfo, p->current) == BRW_EXECUTE_16)
+ if (brw_get_default_exec_size(p) == BRW_EXECUTE_16)
msg_control |= 1;
else
msg_control |= 0;
(response_expected ? 1 << 5 : 0); /* Return data expected */
if (devinfo->gen >= 8 || devinfo->is_haswell) {
- if (brw_inst_access_mode(devinfo, p->current) == BRW_ALIGN_1) {
- if (brw_inst_qtr_control(devinfo, p->current) % 2 == 1)
+ if (brw_get_default_access_mode(p) == BRW_ALIGN_1) {
+ if ((brw_get_default_group(p) / 8) % 2 == 1)
msg_control |= 1 << 4; /* Use high 8 slots of the sample mask */
brw_inst_set_dp_msg_type(devinfo, insn,
brw_inst_set_dp_msg_type(devinfo, insn,
GEN7_DATAPORT_RC_TYPED_ATOMIC_OP);
- if (brw_inst_qtr_control(devinfo, p->current) % 2 == 1)
+ if ((brw_get_default_group(p) / 8) % 2 == 1)
msg_control |= 1 << 4; /* Use high 8 slots of the sample mask */
}
const unsigned sfid = (devinfo->gen >= 8 || devinfo->is_haswell ?
HSW_SFID_DATAPORT_DATA_CACHE_1 :
GEN6_SFID_DATAPORT_RENDER_CACHE);
- const bool align1 = (brw_inst_access_mode(devinfo, p->current) == BRW_ALIGN_1);
+ const bool align1 = brw_get_default_access_mode(p) == BRW_ALIGN_1;
/* Mask out unused components -- See comment in brw_untyped_atomic(). */
const unsigned mask = align1 ? WRITEMASK_XYZW : WRITEMASK_X;
struct brw_inst *insn = brw_send_indirect_surface_message(
unsigned msg_control = 0xf & (0xf << num_channels);
if (devinfo->gen >= 8 || devinfo->is_haswell) {
- if (brw_inst_access_mode(devinfo, p->current) == BRW_ALIGN_1) {
- if (brw_inst_qtr_control(devinfo, p->current) % 2 == 1)
+ if (brw_get_default_access_mode(p) == BRW_ALIGN_1) {
+ if ((brw_get_default_group(p) / 8) % 2 == 1)
msg_control |= 2 << 4; /* Use high 8 slots of the sample mask */
else
msg_control |= 1 << 4; /* Use low 8 slots of the sample mask */
brw_inst_set_dp_msg_type(devinfo, insn,
HSW_DATAPORT_DC_PORT1_TYPED_SURFACE_READ);
} else {
- if (brw_inst_access_mode(devinfo, p->current) == BRW_ALIGN_1) {
- if (brw_inst_qtr_control(devinfo, p->current) % 2 == 1)
+ if (brw_get_default_access_mode(p) == BRW_ALIGN_1) {
+ if ((brw_get_default_group(p) / 8) % 2 == 1)
msg_control |= 1 << 5; /* Use high 8 slots of the sample mask */
}
unsigned msg_control = 0xf & (0xf << num_channels);
if (devinfo->gen >= 8 || devinfo->is_haswell) {
- if (brw_inst_access_mode(devinfo, p->current) == BRW_ALIGN_1) {
- if (brw_inst_qtr_control(devinfo, p->current) % 2 == 1)
+ if (brw_get_default_access_mode(p) == BRW_ALIGN_1) {
+ if ((brw_get_default_group(p) / 8) % 2 == 1)
msg_control |= 2 << 4; /* Use high 8 slots of the sample mask */
else
msg_control |= 1 << 4; /* Use low 8 slots of the sample mask */
HSW_DATAPORT_DC_PORT1_TYPED_SURFACE_WRITE);
} else {
- if (brw_inst_access_mode(devinfo, p->current) == BRW_ALIGN_1) {
- if (brw_inst_qtr_control(devinfo, p->current) % 2 == 1)
+ if (brw_get_default_access_mode(p) == BRW_ALIGN_1) {
+ if ((brw_get_default_group(p) / 8) % 2 == 1)
msg_control |= 1 << 5; /* Use high 8 slots of the sample mask */
}
const unsigned sfid = (devinfo->gen >= 8 || devinfo->is_haswell ?
HSW_SFID_DATAPORT_DATA_CACHE_1 :
GEN6_SFID_DATAPORT_RENDER_CACHE);
- const bool align1 = (brw_inst_access_mode(devinfo, p->current) == BRW_ALIGN_1);
+ const bool align1 = brw_get_default_access_mode(p) == BRW_ALIGN_1;
/* Mask out unused components -- See comment in brw_untyped_atomic(). */
const unsigned mask = (devinfo->gen == 7 && !devinfo->is_haswell && !align1 ?
WRITEMASK_X : WRITEMASK_XYZW);
{
const struct gen_device_info *devinfo = p->devinfo;
struct brw_inst *insn;
- const uint16_t exec_size = brw_inst_exec_size(devinfo, p->current);
+ const uint16_t exec_size = brw_get_default_exec_size(p);
/* brw_send_indirect_message will automatically use a direct send message
* if data is actually immediate.
struct brw_reg mask)
{
const struct gen_device_info *devinfo = p->devinfo;
- const unsigned exec_size = 1 << brw_inst_exec_size(devinfo, p->current);
- const unsigned qtr_control = brw_inst_qtr_control(devinfo, p->current);
+ const unsigned exec_size = 1 << brw_get_default_exec_size(p);
+ const unsigned qtr_control = brw_get_default_group(p) / 8;
brw_inst *inst;
assert(devinfo->gen >= 7);
brw_push_insn_state(p);
- if (brw_inst_access_mode(devinfo, p->current) == BRW_ALIGN_1) {
+ if (brw_get_default_access_mode(p) == BRW_ALIGN_1) {
brw_set_default_mask_control(p, BRW_MASK_DISABLE);
if (devinfo->gen >= 8) {
struct brw_reg idx)
{
const struct gen_device_info *devinfo = p->devinfo;
- const bool align1 = brw_inst_access_mode(devinfo, p->current) == BRW_ALIGN_1;
+ const bool align1 = brw_get_default_access_mode(p) == BRW_ALIGN_1;
brw_inst *inst;
brw_push_insn_state(p);