Skip to contentSkip to conversation

envydis: gk110: Add support for dadd with an immediate src

PATCH In review Hans de Goede 2 participants 2 messages Nov 5, 2015 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 envydis: gk110: Add support for dadd with an immediate src

This commit adds support for dadd with an immediate src in gk110 code. The machine-code in question is generated by e.g. nouveau_compiler with the new "Make use of double immediates" patch series when building the piglit glsl-algebraic-double-add.shader_test.

This commit changes the output from:

00000010: 001c0001 c38001ff $r0 $r0 $r0 $r0 0x3fe00 0x3fe00
0x3fe0000000000000 0x3fe00000 0x0 0x3 ??? [unknown: 00000000 c0800000] [unknown instruction]

Into:

00000010: 001c0001 c38001ff add rn f64 $r0d $r0d 0x3fe0000000000000

The machine-code in question disassembles to the same using nvdisasm and works properly on an actual gpu.

---
 envydis/gk110.c | 2 ++
 1 file changed, 2 insertions(+)
envydis/gk110.c +2 -0
index 9af18e1..4790533 100644
@@ -1274,6 +1274,7 @@ static struct insn tabcctlmod[] = {
  * 000000007f800000 2nd src
  * 0000003fff800000 2nd src (immediate)
  * 0000007fff800000 address
+ * 000003ffff800000 float/double immediate
  * 007fffffff800000 long immediate
  * 0003fc0000000000 3rd src
  * 007c000000000000 misc flags
@@ -1410,6 +1411,7 @@ static struct insn tabi[] = {
 	{ 0x02c0000000000001ull, 0x37c0000000000003ull, N("add"), T(ftz2f), T(sat35), T(frm2a), N("f32"), DST, T(neg33), T(abs31), SRC1, T(neg3b), T(fi2) },
 	{ 0x0300000000000001ull, 0x37c0000000000003ull, T(minmax), T(ftz2f), N("f32"), DST, T(neg33), T(abs31), SRC1, T(neg3b), T(fi2) },
 	{ 0x0340000000000001ull, 0x37c0000000000003ull, N("mul"), T(ftz2f), T(sat35), T(frm2a), T(neg3b), N("f32"), DST, SRC1, T(fi2) },
+	{ 0x0380000000000001ull, 0x37c0000000000003ull, N("add"), T(frm2a), N("f64"), DSTD, T(neg33), T(abs31), SRC1D, T(neg3b), T(di2) },
 	{ 0x0400000000000001ull, 0x37c0000000000003ull, N("mul"), T(frm2a), T(neg3b), N("f64"), DSTD, SRC1D, T(di2) },
 	{ 0x0500000000000001ull, 0x37c0000000000003ull, N("selp"), DST, SRC1, T(i3bi2), T(pnot2d), PSRC3 },
 	{ 0x07c0000000000001ull, 0x37c0000000000003ull, N("rshf"), N("b32"), DST, SESTART, T(us64_28), SRC1, SRC3, SEEND, T(shfclamp), T(sui2b) }, // d = (s1 >> s2) | (s3 << (32 - s2))
Signature · 6 lines
2.5.0

_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

A message that is not in the archive (sent off-list or not yet received): 1446730963-9919-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org

#2 lore raw
Quoted 37 lines · Hans de Goede

This commit adds support for dadd with an immediate src in gk110 code. The machine-code in question is generated by e.g. nouveau_compiler with the new "Make use of double immediates" patch series when building the piglit glsl-algebraic-double-add.shader_test.

This commit changes the output from:

00000010: 001c0001 c38001ff $r0 $r0 $r0 $r0 0x3fe00 0x3fe00
0x3fe0000000000000 0x3fe00000 0x0 0x3 ??? [unknown: 00000000 c0800000] [unknown instruction]

Into:

00000010: 001c0001 c38001ff add rn f64 $r0d $r0d 0x3fe0000000000000

The machine-code in question disassembles to the same using nvdisasm and works properly on an actual gpu.

---
  envydis/gk110.c | 2 ++
  1 file changed, 2 insertions(+)
envydis/gk110.c +1 -0
index 9af18e1..4790533 100644
@@ -1274,6 +1274,7 @@ static struct insn tabcctlmod[] = {
   * 000000007f800000 2nd src
   * 0000003fff800000 2nd src (immediate)
   * 0000007fff800000 address
+ * 000003ffff800000 float/double immediate
   * 007fffffff800000 long immediate
   * 0003fc0000000000 3rd src
   * 007c000000000000 misc flags

envydis/gk110.c static struct insn tabi[] = { · line 1417

Quoted 7 lines
envydis/gk110.c +1 -0
@@ -1410,6 +1411,7 @@ static struct insn tabi[] = {
  	{ 0x02c0000000000001ull, 0x37c0000000000003ull, N("add"), T(ftz2f), T(sat35), T(frm2a), N("f32"), DST, T(neg33), T(abs31), SRC1, T(neg3b), T(fi2) },
  	{ 0x0300000000000001ull, 0x37c0000000000003ull, T(minmax), T(ftz2f), N("f32"), DST, T(neg33), T(abs31), SRC1, T(neg3b), T(fi2) },
  	{ 0x0340000000000001ull, 0x37c0000000000003ull, N("mul"), T(ftz2f), T(sat35), T(frm2a), T(neg3b), N("f32"), DST, SRC1, T(fi2) },
+	{ 0x0380000000000001ull, 0x37c0000000000003ull, N("add"), T(frm2a), N("f64"), DSTD, T(neg33), T(abs31), SRC1D, T(neg3b), T(di2) },
  	{ 0x0400000000000001ull, 0x37c0000000000003ull, N("mul"), T(frm2a), T(neg3b), N("f64"), DSTD, SRC1D, T(di2) },
  	{ 0x0500000000000001ull, 0x37c0000000000003ull, N("selp"), DST, SRC1, T(i3bi2), T(pnot2d), PSRC3 },
  	{ 0x07c0000000000001ull, 0x37c0000000000003ull, N("rshf"), N("b32"), DST, SESTART, T(us64_28), SRC1, SRC3, SEEND, T(shfclamp), T(sui2b) }, // d = (s1 >> s2) | (s3 << (32 - s2))

Thanks, applied.
_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau