summaryrefslogtreecommitdiff
path: root/src/exa_wm.g4i
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2008-03-31 02:20:43 -0700
committerKeith Packard <keithp@keithp.com>2008-03-31 02:20:43 -0700
commit08500507284f13ad7084eb231b43e117e9728129 (patch)
tree2150b2ec6731be012091c68a98026452dd5311c3 /src/exa_wm.g4i
parent949d73271d7100c1f028fd60f185f4929461304e (diff)
Use m4 to clean up gen4 asm progs. Start adding projective transform support.
Use macros for register names, modularize functions into separate files.
Diffstat (limited to 'src/exa_wm.g4i')
-rw-r--r--src/exa_wm.g4i119
1 files changed, 119 insertions, 0 deletions
diff --git a/src/exa_wm.g4i b/src/exa_wm.g4i
new file mode 100644
index 00000000..c7ecb09d
--- /dev/null
+++ b/src/exa_wm.g4i
@@ -0,0 +1,119 @@
+/*
+ * Copyright © 2006 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Authors:
+ * Wang Zhenyu <zhenyu.z.wang@intel.com>
+ * Keith Packard <keithp@keithp.com>
+ */
+
+/*
+ * Input parameters
+ */
+
+define(`quote', `ifelse(`$#', `0', `', ``$*'')')
+
+/* Destination X/Y */
+define(`dst_x_uw', `g1.8<2,4,0>UW')
+define(`dst_y_uw', `g1.10<2,4,0>UW')
+define(`screen_x0', `g1.0<0,1,0>F')
+define(`screen_y0', `g1.4<0,1,0>F')
+
+/* Source transformation parameters */
+define(`src_du_dx', `g3.0<0,1,0>F')
+define(`src_du_dy', `g3.4<0,1,0>F')
+define(`src_uo', `g3.12<0,1,0>F')
+define(`src_dv_dx', `g3.16<0,1,0>F')
+define(`src_dv_dy', `g3.20<0,1,0>F')
+define(`src_vo', `g3.28<0,1,0>F')
+define(`src_dw_dx', `g4.0<0,1,0>F')
+define(`src_dw_dy', `g4.4<0,1,0>F')
+define(`src_wo', `g4.12<0,1,0>F')
+
+define(`mask_du_dx', `g4.16<0,1,0>F')
+define(`mask_du_dy', `g4.20<0,1,0>F')
+define(`mask_uo', `g4.28<0,1,0>F')
+define(`mask_dv_dx', `g5.0<0,1,0>F')
+define(`mask_dv_dy', `g5.4<0,1,0>F')
+define(`mask_vo', `g5.12<0,1,0>F')
+define(`mask_dw_dx', `g5.16<0,1,0>F')
+define(`mask_dw_dy', `g5.20<0,1,0>F')
+define(`mask_wo', `g5.28<0,1,0>F')
+
+/*
+ * Local variables
+ */
+
+/* this holds the X dest coordinates */
+define(`dst_x', `g8')
+define(`dst_x_0', `dst_x')
+define(`dst_x_1', `g9')
+
+/* this holds the Y dest coordinates */
+define(`dst_y', `g10')
+define(`dst_y_0', `dst_y')
+define(`dst_y_1', `g11')
+
+/* When computing x * dn/dx, use this */
+define(`temp_x', `g12')
+define(`temp_x_0', `temp_x')
+define(`temp_x_1', `g13')
+
+/* When computing y * dn/dy, use this */
+define(`temp_y', `g14')
+define(`temp_y_0', temp_y)
+define(`temp_y_1', `g15')
+
+/* when loading x/y, use these to hold them in UW format */
+define(`temp_x_uw', temp_x)
+define(`temp_y_uw', temp_y)
+
+/* compute source and mask u/v to this pair to send to sampler */
+define(`src_u', `m1')
+define(`src_v', `m3')
+define(`mask_u', src_u)
+define(`mask_v', src_v)
+define(`src_w', `g16')
+define(`src_w_0', src_w)
+define(`src_w_1', `g17')
+define(`mask_w', src_w)
+define(`mask_w_0', src_w_0)
+define(`mask_w_1', src_w_1)
+
+/* sample src to these registers */
+define(`src_sample0', `g18')
+define(`src_sample1', `g19')
+define(`src_sample2', `g20')
+define(`src_sample3', `g21')
+define(`src_sample4', `g22')
+define(`src_sample5', `g23')
+define(`src_sample6', `g24')
+define(`src_sample7', `g25')
+
+/* sample mask to these registers */
+define(`mask_sample0', `g26')
+define(`mask_sample1', `g27')
+define(`mask_sample2', `g28')
+define(`mask_sample3', `g29')
+define(`mask_sample4', `g30')
+define(`mask_sample5', `g31')
+define(`mask_sample6', `g32')
+define(`mask_sample7', `g33')