assert(dest.file == BRW_GENERAL_REGISTER_FILE ||
(devinfo->gen >= 7 && dest.file == BRW_MESSAGE_REGISTER_FILE));
- assert(src0.file == BRW_GENERAL_REGISTER_FILE ||
- (devinfo->gen >= 8 && src0.file == BRW_IMMEDIATE_VALUE));
assert(dest.hstride == BRW_HORIZONTAL_STRIDE_1);
if (devinfo->gen == 6) {
} else {
assert(src0.type == BRW_REGISTER_TYPE_F);
assert(src1.type == BRW_REGISTER_TYPE_F);
- if (function == BRW_MATH_FUNCTION_POW) {
- assert(src1.file == BRW_GENERAL_REGISTER_FILE ||
- (devinfo->gen >= 8 && src1.file == BRW_IMMEDIATE_VALUE));
- } else {
- assert(src1.file == BRW_ARCHITECTURE_REGISTER_FILE &&
- src1.nr == BRW_ARF_NULL);
- }
}
/* Source modifiers are ignored for extended math instructions on Gen6. */
EXPECT_FALSE(validate(p));
}
+TEST_P(validation_test, math_src0_null_reg)
+{
+ if (devinfo.gen >= 6) {
+ gen6_math(p, g0, BRW_MATH_FUNCTION_SIN, null, null);
+ } else {
+ gen4_math(p, g0, BRW_MATH_FUNCTION_SIN, 0, null, BRW_MATH_PRECISION_FULL);
+ }
+
+ EXPECT_FALSE(validate(p));
+}
+
+TEST_P(validation_test, math_src1_null_reg)
+{
+ if (devinfo.gen >= 6) {
+ gen6_math(p, g0, BRW_MATH_FUNCTION_POW, g0, null);
+ EXPECT_FALSE(validate(p));
+ } else {
+ /* Math instructions on Gen4/5 are actually SEND messages with payloads.
+ * src1 is an immediate message descriptor set by gen4_math.
+ */
+ }
+}
+
TEST_P(validation_test, opcode46)
{
/* opcode 46 is "push" on Gen 4 and 5