aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2020-05-19 11:14:21 -0400
committerMarge Bot <[email protected]>2020-05-26 22:31:31 +0000
commita62123572099cfa173804146771e76dae3637eab (patch)
tree5a02a72e6ad4f8d5a6013dbdcfed7b78418500cc
parent9e535629805deb88ca169f9ce8b82720f2efca02 (diff)
nouveau: Use SATURATE
Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5100>
-rw-r--r--src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
index 2f46b0e886a..e24e74a6463 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
@@ -848,7 +848,7 @@ ConstantFolding::unary(Instruction *i, const ImmediateValue &imm)
switch (i->op) {
case OP_NEG: res.data.f32 = -imm.reg.data.f32; break;
case OP_ABS: res.data.f32 = fabsf(imm.reg.data.f32); break;
- case OP_SAT: res.data.f32 = CLAMP(imm.reg.data.f32, 0.0f, 1.0f); break;
+ case OP_SAT: res.data.f32 = SATURATE(imm.reg.data.f32); break;
case OP_RCP: res.data.f32 = 1.0f / imm.reg.data.f32; break;
case OP_RSQ: res.data.f32 = 1.0f / sqrtf(imm.reg.data.f32); break;
case OP_LG2: res.data.f32 = log2f(imm.reg.data.f32); break;
@@ -1596,12 +1596,12 @@ ConstantFolding::opnd(Instruction *i, ImmediateValue &imm0, int s)
switch (i->sType) {
case TYPE_F64:
res.data.f32 = i->saturate ?
- CLAMP(imm0.reg.data.f64, 0.0f, 1.0f) :
+ SATURATE(imm0.reg.data.f64) :
imm0.reg.data.f64;
break;
case TYPE_F32:
res.data.f32 = i->saturate ?
- CLAMP(imm0.reg.data.f32, 0.0f, 1.0f) :
+ SATURATE(imm0.reg.data.f32) :
imm0.reg.data.f32;
break;
case TYPE_U16: res.data.f32 = (float) imm0.reg.data.u16; break;
@@ -1617,12 +1617,12 @@ ConstantFolding::opnd(Instruction *i, ImmediateValue &imm0, int s)
switch (i->sType) {
case TYPE_F64:
res.data.f64 = i->saturate ?
- CLAMP(imm0.reg.data.f64, 0.0f, 1.0f) :
+ SATURATE(imm0.reg.data.f64) :
imm0.reg.data.f64;
break;
case TYPE_F32:
res.data.f64 = i->saturate ?
- CLAMP(imm0.reg.data.f32, 0.0f, 1.0f) :
+ SATURATE(imm0.reg.data.f32) :
imm0.reg.data.f32;
break;
case TYPE_U16: res.data.f64 = (double) imm0.reg.data.u16; break;