forked from ShuriZma/suyu
1
0
Fork 0

Includde saturation in the evaluation of the control code

This commit is contained in:
Rodolfo Bogado 2018-12-12 00:54:21 -03:00
parent 946777601b
commit bbf8d6bf01
1 changed files with 4 additions and 3 deletions

View File

@ -416,12 +416,13 @@ public:
u64 dest_num_components, u64 value_num_components,
bool is_saturated = false, bool sets_cc = false, u64 dest_elem = 0,
bool precise = false) {
SetRegister(reg, elem, is_saturated ? "clamp(" + value + ", 0.0, 1.0)" : value,
const const std::string clamped_value =
is_saturated ? "clamp(" + value + ", 0.0, 1.0)" : value;
SetRegister(reg, elem, clamped_value,
dest_num_components, value_num_components, dest_elem, precise);
if (sets_cc) {
if (reg == Register::ZeroIndex) {
SetConditionalCodesFromExpression(value);
SetConditionalCodesFromExpression(clamped_value);
} else {
SetConditionalCodesFromRegister(reg, dest_elem);
}