<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - [NV96] neg modifiers not working in MIN and MAX operations"
href="https://bugs.freedesktop.org/show_bug.cgi?id=86618">86618</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[NV96] neg modifiers not working in MIN and MAX operations
</td>
</tr>
<tr>
<th>Product</th>
<td>Mesa
</td>
</tr>
<tr>
<th>Version</th>
<td>git
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Other
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>medium
</td>
</tr>
<tr>
<th>Component</th>
<td>Drivers/DRI/nouveau
</td>
</tr>
<tr>
<th>Assignee</th>
<td>nouveau@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>gzregozrw@wp.pl
</td>
</tr></table>
<p>
<div>
<pre>Neg modifier for source in MIN and MAX ops is ignored.
Tested on git 89b9ef9.
I tested it only on NV96.
shader with:
float x = -sin(uv.x);
float d = max(0.0, x);
generates:
EMIT: presin f32 $r0 $r0 (8)
EMIT: sin f32 $r0 $r0 (8)
EMIT: mov u32 $r1 0x00000000 (8)
EMIT: max f32 $r2 neg $r0 $r1 (8)
Shader output is identical to version without unary minus.
Only difference is lack of neg modifier.
After disabling modifiers shader works as expected:
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp
@@ -85,8 +85,8 @@ static const struct opProperties _initProps[] =
{ OP_ADD, 0x3, 0x0, 0x0, 0x8, 0x2, 0x1, 0x1, 0x2 },
{ OP_SUB, 0x3, 0x0, 0x0, 0x0, 0x2, 0x1, 0x1, 0x2 },
{ OP_MUL, 0x3, 0x0, 0x0, 0x0, 0x2, 0x1, 0x1, 0x2 },
- { OP_MAX, 0x3, 0x3, 0x0, 0x0, 0x2, 0x1, 0x1, 0x0 },
- { OP_MIN, 0x3, 0x3, 0x0, 0x0, 0x2, 0x1, 0x1, 0x0 },
+ { OP_MAX, 0x0, 0x3, 0x0, 0x0, 0x2, 0x1, 0x1, 0x0 },
+ { OP_MIN, 0x0, 0x3, 0x0, 0x0, 0x2, 0x1, 0x1, 0x0 },
{ OP_MAD, 0x7, 0x0, 0x0, 0x0, 0x6, 0x1, 0x1, 0x0 }, // special
constraint
{ OP_ABS, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x1, 0x0 },
{ OP_NEG, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x1, 0x0 },
After this change:
EMIT: presin f32 $r0 $r0 (8)
EMIT: sin f32 $r0 $r0 (8)
EMIT: mov u32 $r1 0x00000000 (8)
EMIT: neg f32 $r0 $r0 (8)
EMIT: max f32 $r2 $r0 $r1 (8)</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>