static const char *const m_abs[2] = { "", "(abs)" };
+static const char *const m_bitnot[2] = { "", "~" };
+
static const char *const m_vert_stride[16] = {
"0",
"1",
return err;
}
+static bool
+is_logic_instruction(unsigned opcode)
+{
+ return (opcode == BRW_OPCODE_AND ||
+ opcode == BRW_OPCODE_NOT ||
+ opcode == BRW_OPCODE_OR ||
+ opcode == BRW_OPCODE_XOR);
+}
+
static int
-src_da1(FILE *file, unsigned type, unsigned reg_file,
+src_da1(FILE *file, unsigned opcode, unsigned type, unsigned reg_file,
unsigned vert_stride, unsigned _width, unsigned horiz_stride,
unsigned reg_num, unsigned sub_reg_num, unsigned _abs, unsigned negate)
{
int err = 0;
- err |= control(file, "negate", m_negate, negate, NULL);
+ err |= control(file, "negate", is_logic_instruction(opcode) ?
+ m_bitnot : m_negate, negate, NULL);
err |= control(file, "abs", m_abs, _abs, NULL);
err |= reg(file, reg_file, reg_num);
static int
src_da16(FILE *file,
+ unsigned opcode,
unsigned _reg_type,
unsigned reg_file,
unsigned vert_stride,
unsigned swz_w)
{
int err = 0;
- err |= control(file, "negate", m_negate, negate, NULL);
+ err |= control(file, "negate", is_logic_instruction(opcode) ?
+ m_bitnot : m_negate, negate, NULL);
err |= control(file, "abs", m_abs, _abs, NULL);
err |= reg(file, reg_file, _reg_nr);
if (gen8_access_mode(inst) == BRW_ALIGN_1) {
assert(gen8_src0_address_mode(inst) == BRW_ADDRESS_DIRECT);
return src_da1(file,
+ gen8_opcode(inst),
gen8_src0_reg_type(inst),
gen8_src0_reg_file(inst),
gen8_src0_vert_stride(inst),
} else {
assert(gen8_src0_address_mode(inst) == BRW_ADDRESS_DIRECT);
return src_da16(file,
+ gen8_opcode(inst),
gen8_src0_reg_type(inst),
gen8_src0_reg_file(inst),
gen8_src0_vert_stride(inst),
if (gen8_access_mode(inst) == BRW_ALIGN_1) {
assert(gen8_src1_address_mode(inst) == BRW_ADDRESS_DIRECT);
return src_da1(file,
+ gen8_opcode(inst),
gen8_src1_reg_type(inst),
gen8_src1_reg_file(inst),
gen8_src1_vert_stride(inst),
} else {
assert(gen8_src1_address_mode(inst) == BRW_ADDRESS_DIRECT);
return src_da16(file,
+ gen8_opcode(inst),
gen8_src1_reg_type(inst),
gen8_src1_reg_file(inst),
gen8_src1_vert_stride(inst),