From: "Xiang, Haihao" <haihao.xiang@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [Intel gfx][i-g-t PATCH (v3) 4/4] tests/gem_media_fill: the assembly code for the shader used in the case
Date: Fri, 6 Dec 2013 08:55:18 +0800 [thread overview]
Message-ID: <1386291318-12670-4-git-send-email-haihao.xiang@intel.com> (raw)
In-Reply-To: <1386291318-12670-1-git-send-email-haihao.xiang@intel.com>
From: "Xiang, Haihao" <haihao.xiang@intel.com>
The code is for reference only
v2: Fixed the source register used for the send with EOT
Fixed the posted destination operand for the send with EOT
v3: Fixed the cache agent used in media_block_write message on GEN8
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
---
shaders/media/README | 5 +++++
shaders/media/media_fill.gxa | 44 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 49 insertions(+)
create mode 100644 shaders/media/README
create mode 100644 shaders/media/media_fill.gxa
diff --git a/shaders/media/README b/shaders/media/README
new file mode 100644
index 0000000..9f29601
--- /dev/null
+++ b/shaders/media/README
@@ -0,0 +1,5 @@
+These files are here for reference only.
+
+Commands used to generate the shader on gen8
+$> m4 media_fill.gxa > media_fill.gxm
+$> intel-gen4asm -g 8 -o <output> media_fill.gxm
diff --git a/shaders/media/media_fill.gxa b/shaders/media/media_fill.gxa
new file mode 100644
index 0000000..7578890
--- /dev/null
+++ b/shaders/media/media_fill.gxa
@@ -0,0 +1,44 @@
+/*
+ * Registers
+ * g0 -- header
+ * g1 -- constant
+ * g2 -- inline data
+ * g3 -- reserved
+ * g4-g12 payload for write message
+ */
+define(`ORIG', `g2.0<2,2,1>UD')
+define(`COLOR', `g1.0')
+define(`COLORUB', `COLOR<0,1,0>UB')
+define(`COLORUD', `COLOR<0,1,0>UD')
+
+mov(4) COLOR<1>UB COLORUB {align1};
+
+/* WRITE */
+mov(8) g4.0<1>UD g0.0<8,8,1>UD {align1};
+mov(2) g4.0<1>UD ORIG {align1};
+mov(1) g4.8<1>UD 0x000f000fUD {align1};
+
+mov(16) g5.0<1>UD COLORUD {align1 compr};
+mov(16) g7.0<1>UD COLORUD {align1 compr};
+mov(16) g9.0<1>UD COLORUD {align1 compr};
+mov(16) g11.0<1>UD COLORUD {align1 compr};
+
+/*
+ * comment out the following instruction on Gen7
+ * write(0, 0, 10, 12)
+ * 10: media_block_write
+ * 12: data cache data port 1
+ */
+send(16) 4 acc0<1>UW null write(0, 0, 10, 12) mlen 9 rlen 0 {align1};
+
+/*
+ * uncomment the following instruction on Gen7
+ * write(0, 0, 10, 0)
+ * 10: media_block_write
+ * 0: reander cache data port
+ */
+/* send(16) 4 acc0<1>UW null write(0, 0, 10, 0) mlen 9 rlen 0 {align1}; */
+
+/* EOT */
+mov(8) g112.0<1>UD g0.0<8,8,1>UD {align1};
+send(16) 112 null<1>UW null thread_spawner(0, 0, 1) mlen 1 rlen 0 {align1 EOT};
--
1.7.9.5
next prev parent reply other threads:[~2013-12-06 0:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-06 0:55 [Intel gfx][i-g-t PATCH (v3) 1/4] tests: add gem_media_fill Xiang, Haihao
2013-12-06 0:55 ` [Intel gfx][i-g-t PATCH (v3) 2/4] tests/gem_media_fill: add support for gen8 Xiang, Haihao
2013-12-06 0:55 ` [Intel gfx][i-g-t PATCH (v3) 3/4] tests/gem_media_fill: add support for gen7 Xiang, Haihao
2013-12-06 0:55 ` Xiang, Haihao [this message]
2013-12-06 12:03 ` [Intel gfx][i-g-t PATCH (v3) 1/4] tests: add gem_media_fill Tvrtko Ursulin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1386291318-12670-4-git-send-email-haihao.xiang@intel.com \
--to=haihao.xiang@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox