103b705cfSriastradh/*
203b705cfSriastradh * Copyright © 2006 Intel Corporation
303b705cfSriastradh *
403b705cfSriastradh * Permission is hereby granted, free of charge, to any person obtaining a
503b705cfSriastradh * copy of this software and associated documentation files (the "Software"),
603b705cfSriastradh * to deal in the Software without restriction, including without limitation
703b705cfSriastradh * the rights to use, copy, modify, merge, publish, distribute, sublicense,
803b705cfSriastradh * and/or sell copies of the Software, and to permit persons to whom the
903b705cfSriastradh * Software is furnished to do so, subject to the following conditions:
1003b705cfSriastradh *
1103b705cfSriastradh * The above copyright notice and this permission notice (including the next
1203b705cfSriastradh * paragraph) shall be included in all copies or substantial portions of the
1303b705cfSriastradh * Software.
1403b705cfSriastradh *
1503b705cfSriastradh * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1603b705cfSriastradh * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1703b705cfSriastradh * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
1803b705cfSriastradh * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1903b705cfSriastradh * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
2003b705cfSriastradh * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2103b705cfSriastradh * IN THE SOFTWARE.
2203b705cfSriastradh *
2303b705cfSriastradh * Authors:
2403b705cfSriastradh *    Wang Zhenyu <zhenyu.z.wang@intel.com>
2503b705cfSriastradh *    Keith Packard <keithp@keithp.com>
2603b705cfSriastradh */
2703b705cfSriastradh 
2803b705cfSriastradh/*
2903b705cfSriastradh * Input parameters
3003b705cfSriastradh */
3103b705cfSriastradh
3203b705cfSriastradh/* Destination X/Y */
3303b705cfSriastradhdefine(`dst_x_uw',  `g1.8<2,4,0>UW')
3403b705cfSriastradhdefine(`dst_y_uw',  `g1.10<2,4,0>UW')
3503b705cfSriastradhdefine(`screen_x0', `g1.0<0,1,0>F')
3603b705cfSriastradhdefine(`screen_y0', `g1.4<0,1,0>F')
3703b705cfSriastradh
3803b705cfSriastradh/* Source transformation parameters */
3903b705cfSriastradhdefine(`src_du_dx', `g3.0<0,1,0>F')
4003b705cfSriastradhdefine(`src_du_dy', `g3.4<0,1,0>F')
4103b705cfSriastradhdefine(`src_uo',    `g3.12<0,1,0>F')
4203b705cfSriastradhdefine(`src_dv_dx', `g3.16<0,1,0>F')
4303b705cfSriastradhdefine(`src_dv_dy', `g3.20<0,1,0>F')
4403b705cfSriastradhdefine(`src_vo',    `g3.28<0,1,0>F')
4503b705cfSriastradhdefine(`src_dw_dx', `g4.0<0,1,0>F')
4603b705cfSriastradhdefine(`src_dw_dy', `g4.4<0,1,0>F')
4703b705cfSriastradhdefine(`src_wo',    `g4.12<0,1,0>F')
4803b705cfSriastradh
4903b705cfSriastradhdefine(`mask_du_dx', `g5.0<0,1,0>F')
5003b705cfSriastradhdefine(`mask_du_dy', `g5.4<0,1,0>F')
5103b705cfSriastradhdefine(`mask_uo',    `g5.12<0,1,0>F')
5203b705cfSriastradhdefine(`mask_dv_dx', `g5.16<0,1,0>F')
5303b705cfSriastradhdefine(`mask_dv_dy', `g5.20<0,1,0>F')
5403b705cfSriastradhdefine(`mask_vo',    `g5.28<0,1,0>F')
5503b705cfSriastradhdefine(`mask_dw_dx', `g6.0<0,1,0>F')
5603b705cfSriastradhdefine(`mask_dw_dy', `g6.4<0,1,0>F')
5703b705cfSriastradhdefine(`mask_wo',    `g6.12<0,1,0>F')
5803b705cfSriastradh
5903b705cfSriastradh/*
60fe8aea9eSmrg * Local variables. Pairs must be aligned on even reg boundary
6103b705cfSriastradh */
6203b705cfSriastradh
6303b705cfSriastradh/* this holds the X dest coordinates */
6403b705cfSriastradhdefine(`dst_x',	    `g8')
6503b705cfSriastradhdefine(`dst_x_0',   `dst_x')
6603b705cfSriastradhdefine(`dst_x_1',   `g9')
6703b705cfSriastradh
6803b705cfSriastradh/* this holds the Y dest coordinates */
6903b705cfSriastradhdefine(`dst_y',	    `g10')
7003b705cfSriastradhdefine(`dst_y_0',   `dst_y')
7103b705cfSriastradhdefine(`dst_y_1',   `g11')
7203b705cfSriastradh
7303b705cfSriastradh/* When computing x * dn/dx, use this */
7403b705cfSriastradhdefine(`temp_x',    `g30')
7503b705cfSriastradhdefine(`temp_x_0',  `temp_x')
7603b705cfSriastradhdefine(`temp_x_1',  `g31')
7703b705cfSriastradh
7803b705cfSriastradh/* When computing y * dn/dy, use this */
7903b705cfSriastradhdefine(`temp_y',    `g28')
8003b705cfSriastradhdefine(`temp_y_0',  temp_y)
8103b705cfSriastradhdefine(`temp_y_1',  `g29')
8203b705cfSriastradh
8303b705cfSriastradh/* when loading x/y, use these to hold them in UW format */
8403b705cfSriastradhdefine(`temp_x_uw', temp_x)
8503b705cfSriastradhdefine(`temp_y_uw', temp_y)
8603b705cfSriastradh
8703b705cfSriastradh/* compute source and mask u/v to this pair to send to sampler */
8803b705cfSriastradhdefine(`src_msg',   `m1')
8903b705cfSriastradhdefine(`src_msg_ind',`1')
9003b705cfSriastradhdefine(`src_u',	    `m2')
9103b705cfSriastradhdefine(`src_v',	    `m4')
9203b705cfSriastradhdefine(`src_w',	    `g12')
9303b705cfSriastradhdefine(`src_w_0',   `src_w')
9403b705cfSriastradhdefine(`src_w_1',   `g13')
9503b705cfSriastradh
9603b705cfSriastradhdefine(`mask_msg',  `m7')
9703b705cfSriastradhdefine(`mask_msg_ind',`7')
9803b705cfSriastradhdefine(`mask_u',    `m8')
9903b705cfSriastradhdefine(`mask_v',    `m10')
10003b705cfSriastradhdefine(`mask_w',    `src_w')
10103b705cfSriastradhdefine(`mask_w_0',  `src_w_0')
10203b705cfSriastradhdefine(`mask_w_1',  `src_w_1')
10303b705cfSriastradh
10403b705cfSriastradh/* sample src to these registers */
10503b705cfSriastradhdefine(`src_sample_base',	`g14')
10603b705cfSriastradh
10703b705cfSriastradhdefine(`src_sample_r',		`g14')
10803b705cfSriastradhdefine(`src_sample_r_01',	`g14')
10903b705cfSriastradhdefine(`src_sample_r_23',	`g15')
11003b705cfSriastradh
11103b705cfSriastradhdefine(`src_sample_g',		`g16')
11203b705cfSriastradhdefine(`src_sample_g_01',	`g16')
11303b705cfSriastradhdefine(`src_sample_g_23',	`g17')
11403b705cfSriastradh
11503b705cfSriastradhdefine(`src_sample_b',		`g18')
11603b705cfSriastradhdefine(`src_sample_b_01',	`g18')
11703b705cfSriastradhdefine(`src_sample_b_23',	`g19')
11803b705cfSriastradh
11903b705cfSriastradhdefine(`src_sample_a',		`g20')
12003b705cfSriastradhdefine(`src_sample_a_01',	`g20')
12103b705cfSriastradhdefine(`src_sample_a_23',	`g21')
12203b705cfSriastradh
12303b705cfSriastradh/* sample mask to these registers */
12403b705cfSriastradhdefine(`mask_sample_base',	`g22')
12503b705cfSriastradh    
12603b705cfSriastradhdefine(`mask_sample_r',		`g22')
12703b705cfSriastradhdefine(`mask_sample_r_01',	`g22')
12803b705cfSriastradhdefine(`mask_sample_r_23',	`g23')
12903b705cfSriastradh    
13003b705cfSriastradhdefine(`mask_sample_g',		`g24')
13103b705cfSriastradhdefine(`mask_sample_g_01',	`g24')
13203b705cfSriastradhdefine(`mask_sample_g_23',	`g25')
13303b705cfSriastradh    
13403b705cfSriastradhdefine(`mask_sample_b',		`g26')
13503b705cfSriastradhdefine(`mask_sample_b_01',	`g26')
13603b705cfSriastradhdefine(`mask_sample_b_23',	`g27')
13703b705cfSriastradh    
13803b705cfSriastradhdefine(`mask_sample_a',		`g28')
13903b705cfSriastradhdefine(`mask_sample_a_01',	`g28')
14003b705cfSriastradhdefine(`mask_sample_a_23',	`g29')
14103b705cfSriastradh
14203b705cfSriastradh/* data port SIMD16 send registers */
14303b705cfSriastradh
14403b705cfSriastradhdefine(`data_port_msg_0',	`m0')
14503b705cfSriastradhdefine(`data_port_msg_0_ind',	`0')
14603b705cfSriastradhdefine(`data_port_msg_1',	`m1')
14703b705cfSriastradhdefine(`data_port_r_01',	`m2')
14803b705cfSriastradhdefine(`data_port_g_01',	`m3')
14903b705cfSriastradhdefine(`data_port_b_01',	`m4')
15003b705cfSriastradhdefine(`data_port_a_01',	`m5')
15103b705cfSriastradh
15203b705cfSriastradhdefine(`data_port_r_23',	`m6')
15303b705cfSriastradhdefine(`data_port_g_23',	`m7')
15403b705cfSriastradhdefine(`data_port_b_23',	`m8')
15503b705cfSriastradhdefine(`data_port_a_23',	`m9')
15603b705cfSriastradh
157