Merge branch 'master' into vulkan

This commit is contained in:
Triang3l
2020-10-30 22:58:55 +03:00
5 changed files with 188 additions and 245 deletions

View File

@@ -235,14 +235,18 @@ struct InstructionOperand {
return false;
}
// Returns which components of two operands are identical, but may have
// different signs (for simplicity of usage with GetComponent, treating the
// rightmost component as replicated).
uint32_t GetAbsoluteIdenticalComponents(
const InstructionOperand& other) const {
// Returns which components of two operands will always be bitwise equal
// (disregarding component_count for simplicity of usage with GetComponent,
// treating the rightmost component as replicated). This, strictly with all
// conditions, must be used when emulating Shader Model 3 +-0 * x = +0
// multiplication behavior with IEEE-compliant multiplication (because
// -0 * |-0|, or -0 * +0, is -0, while the result must be +0).
uint32_t GetIdenticalComponents(const InstructionOperand& other) const {
if (storage_source != other.storage_source ||
storage_index != other.storage_index ||
storage_addressing_mode != other.storage_addressing_mode) {
storage_addressing_mode != other.storage_addressing_mode ||
is_negated != other.is_negated ||
is_absolute_value != other.is_absolute_value) {
return 0;
}
uint32_t identical_components = 0;
@@ -252,16 +256,6 @@ struct InstructionOperand {
}
return identical_components;
}
// Returns which components of two operands will always be bitwise equal, but
// may have different signs (disregarding component_count for simplicity of
// usage with GetComponent, treating the rightmost component as replicated).
uint32_t GetIdenticalComponents(const InstructionOperand& other) const {
if (is_negated != other.is_negated ||
is_absolute_value != other.is_absolute_value) {
return 0;
}
return GetAbsoluteIdenticalComponents(other);
}
};
struct ParsedExecInstruction {