Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | RSS feed

  1. /*
  2.  *  Copyright 2000-2011 Intel Corporation All Rights Reserved
  3.  *
  4.  *  Licensed under the Apache License, Version 2.0 (the "License");
  5.  *  you may not use this file except in compliance with the License.
  6.  *  You may obtain a copy of the License at
  7.  *
  8.  *      http://www.apache.org/licenses/LICENSE-2.0
  9.  *
  10.  *  Unless required by applicable law or agreed to in writing, software
  11.  *  distributed under the License is distributed on an "AS IS" BASIS,
  12.  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13.  *  See the License for the specific language governing permissions and
  14.  *  limitations under the License.
  15.  */
  16. //   39    // Total instruction count
  17. //    1    // Total kernel count
  18.  
  19.  
  20.  
  21. // Module name: common.inc
  22. //
  23. // Common header file for all Video-Processing kernels
  24. //
  25.  
  26. .default_execution_size (16)
  27. .default_register_type  :ub
  28.  
  29. .reg_count_total        128
  30. .reg_count_payload      7
  31.  
  32. //========== Common constants ==========
  33.  
  34.  
  35. //========== Macros ==========
  36.  
  37.  
  38. //Fast Jump, For more details see "Set_Layer_N.asm"
  39.  
  40.  
  41. //========== Defines ====================
  42.  
  43. //========== Static Parameters (Common To All) ==========
  44. //r1
  45.  
  46.  
  47. //r2
  48.  
  49.                                     //  e.g.            byte0   byte1  byte2
  50.                                     // YUYV               0       1      3
  51.                                     // YVYU               0       3      1
  52.  
  53. //Color Pipe (IECP) parameters
  54.  
  55.  
  56. //ByteCopy
  57.  
  58.  
  59. //r4
  60.  
  61.                                     //  e.g.              byte0           byte1           byte2
  62.                                     // YUYV                 0               1               3
  63.                                     // YVYU                 0               3               1
  64.  
  65.  
  66. //========== Inline parameters (Common To All) ===========
  67.  
  68.  
  69. //============== Binding Index Table===========
  70. //Common between DNDI and DNUV
  71.  
  72.  
  73. //================= Common Message Descriptor =====
  74. // Message descriptor for thread spawning
  75. // Message Descriptors
  76. //                = 000 0001 (min message len 1 ) 0,0000 (resp len 0   -add later)
  77. //                  0000,0000,0000
  78. //                  0001(Spawn a root thread),0001 (Root thread spawn thread)
  79. //                = 0x02000011
  80. // Thread Spawner Message Descriptor
  81.  
  82.  
  83. // Message descriptor for atomic operation add
  84. // Message Descriptors
  85. //                = 000 0110 (min message len 6 ) 0,0000 (resp len 0   -add later)
  86. //                  1(header present)001,10(typed atomic operation)0(return enabled)0(slot group, low 8 bits),0111 (AOP_Add)
  87. //                  0000,0000 (Binding table index, added later)
  88. //                = 0x02000011
  89.  
  90. // Atomic Operation Add Message Descriptor
  91.  
  92.  
  93. // Message descriptor for dataport media write
  94.         // Message Descriptors
  95.                 //                = 000 0001 (min message len 1 - add later) 00000 (resp len 0)
  96.                 //                  1 (header present 1) 0 1010 (media block write) 000000
  97.                 //                  00000000 (binding table index - set later)
  98.                 //                = 0x020A8000
  99.  
  100.  
  101. // Message Length defines
  102.  
  103.  
  104. // Response Length defines
  105.  
  106.  
  107. // Block Width and Height Size defines
  108.  
  109.  
  110. // Extended Message Descriptors
  111.  
  112.  
  113. // Common message descriptors:
  114.  
  115.  
  116. //===================== Math Function Control ===================================
  117.  
  118.  
  119. //============ Message Registers ===============
  120.                              // buf4 starts from r28
  121.  
  122.  
  123. //#define mMSGHDR_EOT  r43    // Dummy Message Register for EOT
  124.  
  125.  
  126. .declare    mubMSGPAYLOAD  Base=r30 ElementSize=1 SrcRegion=<16;16,1> Type=ub
  127. .declare    muwMSGPAYLOAD  Base=r30 ElementSize=2 SrcRegion=<16;16,1> Type=uw
  128. .declare    mudMSGPAYLOAD  Base=r30 ElementSize=4 SrcRegion=<8;8,1> Type=ud
  129. .declare    mfMSGPAYLOAD   Base=r30 ElementSize=4 SrcRegion=<8;8,1> Type=f
  130.  
  131. //=================== End of thread instruction ===========================
  132.  
  133.  
  134. //=====================Pointers Used=====================================
  135.  
  136.  
  137. //=======================================================================
  138.  
  139.  
  140. //r9-r17
  141. // Define temp space for any usages
  142.  
  143.  
  144. // Common Buffers
  145.  
  146.  
  147. // temp space for rotation
  148.  
  149. .declare fROBUF           Base=r9.0             ElementSize=4           SrcRegion=<8;8,1>                 DstRegion=<1>         Type=f
  150.  
  151. .declare udROBUF                Base=r9.0               ElementSize=4           SrcRegion=<8;8,1>                 DstRegion=<1>         Type=ud
  152.  
  153. .declare uwROBUF                Base=r9.0               ElementSize=2           SrcRegion=<16;16,1>             DstRegion=<1>           Type=uw
  154.  
  155. .declare ubROBUF                Base=r9.0               ElementSize=1           SrcRegion=<16;16,1>             DstRegion=<1>           Type=ub
  156.  
  157. .declare ub4ROBUF       Base=r9.0               ElementSize=1           SrcRegion=<32;8,4>              DstRegion=<4>           Type=ub
  158.  
  159.  
  160. // End of common.inc
  161.  
  162.  
  163. // FileName:            PA_AVS_Buf_0.asm
  164. // Author:                      Vivek Kumar
  165. // Description: Loads 8x8 AVS/IEF Packed data into Buffer 0
  166.  
  167.  
  168.  
  169. // FileName     :   PA_AVS_Buf.asm
  170. // Author       :   Tatiya, Rupesh
  171. // Description  :   Loads 8x8 AVS/IEF Packed data into Buffer N
  172.  
  173. //On IVB, for AVS module - set buffer pointers offset according to AVS Layout.
  174. //Change it to Sample Unorm layout in Shuffle modules.
  175.  
  176.  
  177.  
  178. // Module name: Scaling.inc
  179.  
  180.  
  181.  
  182.  
  183. // Description: Includes all definitions explicit to Fast Composite.
  184.  
  185.  
  186.  
  187.  
  188. // End of common.inc
  189.  
  190.  
  191. //========== GRF partition ==========
  192.      // r0 header            :   r0          (1 GRF)
  193.      // Static parameters    :   r1 - r6     (6 GRFS)
  194.      // Inline parameters    :   r7 - r8     (2 GRFs)
  195.      // MSGSRC               :   r27         (1 GRF)
  196. //===================================
  197.  
  198. //Interface:
  199. //========== Static Parameters (Explicit To Fast Composite) ==========
  200. //r1
  201. //CSC Set 0
  202.  
  203.  
  204. .declare udCSC_CURBE    Base=r1.0      ElementSize=4       Type=ud
  205.  
  206. //Constant alpha
  207.  
  208.  
  209. //r2
  210.  
  211.  
  212. // Gen7 AVS WA
  213.  
  214.  
  215. // WiDi Definitions
  216.  
  217.  
  218. //Colorfill
  219.  
  220.  
  221.                                       // 0: 0-degree, 1: 90, 2: 180, 3: 270-degree, clockwise.     
  222.  
  223. .declare ubCOLOR_PIXEL_VAL      Base=r2.20      ElementSize=1       SrcRegion=<0;1,0>       DstRegion=<1>       Type=ub
  224.  
  225. //r3
  226. //Normalised Ratio of Horizontal step size with main video for all layers
  227.  
  228.  
  229.     //Normalised Ratio of Horizontal step size with main video for all layers becomes
  230.     //Normalised Horizontal step size for all layers in VP_Setup.asm
  231.  
  232.  
  233. //r4
  234. //Normalised Vertical step size for all layers
  235.  
  236.  
  237. //r5
  238. //Normalised Vertical Frame Origin for all layers
  239.  
  240.  
  241. //r6
  242. //Normalised Horizontal Frame Origin for all layers
  243.  
  244.  
  245. //========== Inline Parameters (Explicit To Fast Composite) ==========
  246.  
  247.  
  248. //Main video Step X
  249.  
  250.  
  251. //====================== Binding table (Explicit To Fast Composite)=========================================
  252.  
  253.  
  254. //Used by Interlaced Scaling Kernels
  255.  
  256.  
  257. //========== Sampler State Table Index (Explicit To Fast Composite)==========
  258. //Sampler Index for AVS/IEF messages
  259.  
  260.  
  261. //Sampler Index for SIMD16 sampler messages
  262.  
  263.  
  264. //=============================================================================
  265.  
  266. .declare fBUFFER_0      Base=r64.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=f
  267. .declare fBUFFER_1      Base=r80.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=f
  268. .declare fBUFFER_2      Base=r96.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=f
  269. .declare fBUFFER_3      Base=r112.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=f
  270. .declare fBUFFER_4      Base=r28.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=f
  271. .declare fBUFFER_5      Base=r46.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=f
  272.  
  273. .declare udBUFFER_0     Base=r64.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=ud
  274. .declare udBUFFER_1     Base=r80.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=ud
  275. .declare udBUFFER_2     Base=r96.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=ud
  276. .declare udBUFFER_3     Base=r112.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=ud
  277. .declare udBUFFER_4     Base=r28.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=ud
  278. .declare udBUFFER_5     Base=r46.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=ud
  279.  
  280. .declare uwBUFFER_0     Base=r64.0       ElementSize=2       SrcRegion=<16;16,1>     DstRegion=<1>       Type=uw
  281. .declare uwBUFFER_1     Base=r80.0       ElementSize=2       SrcRegion=<16;16,1>     DstRegion=<1>       Type=uw
  282. .declare uwBUFFER_2     Base=r96.0       ElementSize=2       SrcRegion=<16;16,1>     DstRegion=<1>       Type=uw
  283. .declare uwBUFFER_3     Base=r112.0       ElementSize=2       SrcRegion=<16;16,1>     DstRegion=<1>       Type=uw
  284. .declare uwBUFFER_4     Base=r28.0       ElementSize=2       SrcRegion=<16;16,1>     DstRegion=<1>       Type=uw
  285. .declare uwBUFFER_5     Base=r46.0       ElementSize=2       SrcRegion=<16;16,1>     DstRegion=<1>       Type=uw
  286.  
  287. .declare ubBUFFER_0     Base=r64.0       ElementSize=1       SrcRegion=<16;16,1>     DstRegion=<1>       Type=ub
  288. .declare ubBUFFER_1     Base=r80.0       ElementSize=1       SrcRegion=<16;16,1>     DstRegion=<1>       Type=ub
  289. .declare ubBUFFER_2     Base=r96.0       ElementSize=1       SrcRegion=<16;16,1>     DstRegion=<1>       Type=ub
  290. .declare ubBUFFER_3     Base=r112.0       ElementSize=1       SrcRegion=<16;16,1>     DstRegion=<1>       Type=ub
  291. .declare ubBUFFER_4     Base=r28.0       ElementSize=1       SrcRegion=<16;16,1>     DstRegion=<1>       Type=ub
  292. .declare ubBUFFER_5     Base=r46.0       ElementSize=1       SrcRegion=<16;16,1>     DstRegion=<1>       Type=ub
  293.  
  294. .declare ub4BUFFER_0    Base=r64.0       ElementSize=1       SrcRegion=<32;8,4>      DstRegion=<4>       Type=ub
  295. .declare ub4BUFFER_1    Base=r80.0       ElementSize=1       SrcRegion=<32;8,4>      DstRegion=<4>       Type=ub
  296. .declare ub4BUFFER_2    Base=r96.0       ElementSize=1       SrcRegion=<32;8,4>      DstRegion=<4>       Type=ub
  297. .declare ub4BUFFER_3    Base=r112.0       ElementSize=1       SrcRegion=<32;8,4>      DstRegion=<4>       Type=ub
  298. .declare ub4BUFFER_4    Base=r28.0       ElementSize=1       SrcRegion=<32;8,4>      DstRegion=<4>       Type=ub
  299. .declare ub4BUFFER_5    Base=r46.0       ElementSize=1       SrcRegion=<32;8,4>      DstRegion=<4>       Type=ub
  300.  
  301. //Pointer to mask reg
  302.  
  303.  
  304. //r18
  305.  
  306.  
  307. //Always keep Cannel Pointers and Offsets in same GRF, so that we can use
  308. // NODDCLR, NODDCHK flags. -rT
  309.  
  310.  
  311. .declare udCSC_COEFF_0  Base=r18.0    ElementSize=4 Type=ud       // 1 GRF
  312.  
  313. //r19
  314.  
  315.  
  316. .declare udCSC_COEFF_1  Base=r19.0    ElementSize=4 Type=ud       // 1 GRF
  317.  
  318.  
  319. //r20
  320.  
  321. .declare uwALPHA_MASK_REG_TEMP  Base=r20.0    ElementSize=2 SrcRegion=<16;16,1> Type=uw        // 1 GRF
  322.  
  323. //r21
  324.  
  325. .declare uwALPHA_MASK_REG       Base=r21.0         ElementSize=2 SrcRegion=<16;16,1> Type=uw        // 1 GRF
  326.  
  327. //r22
  328.  
  329.  
  330. //Always keep Cannel Pointers and Offsets in same GRF, so that we can use
  331. // NODDCLR, NODDCHK flags. -rT
  332.  
  333.  
  334. //Keep fORIGIN_X_NLAS, fY_OFFSET_2ND_BLOCK, fSTEP_X_NLAS, pMSGDSC_COPY, ubCONST_ALPHA_COPY as
  335. //sub registers of same GRF to enable using NODDCLR NODDCHK. -rT
  336.  
  337. //r23
  338.  
  339.  
  340. //Lumakey
  341.  
  342.  
  343. //r24
  344.  
  345.  
  346. //r25
  347.  
  348.  
  349. //r26
  350.  
  351.  
  352. //defines to generate LABELS during compile time.
  353.  
  354.  
  355.         // Message Header
  356.         // m0.7         31:0    Debug
  357.         // m0.6         31:0    Debug
  358.         // m0.5         31:0    Ignored
  359.         // m0.4         31:0    Ignored
  360.         // m0.3         31:0    Ignored
  361.         // m0.2         31:16   Ignored
  362.         //              15      Alpha Write Channel Mask        enable=0, disable=1
  363.         //              14      Blue Write Channel Mask  (U)
  364.         //              13      Green Write Channel Mask (Y)
  365.         //              12      Red Write Channel Mask   (V)
  366.         //              11:0    Ignored
  367.         // m0.1                 Ignored
  368.         // m0.0                 Ignored
  369.  
  370.  
  371.         // AVS payload
  372.         // m1.7                 Group ID Number
  373.         // m1.6                 U 2nd Derivative        ---> NLAS dx
  374.         // m1.5                 Delta V                 ---> Step Y
  375.         // m1.4                 Delta U                 ---> Step X
  376.         // m1.3                 Pixel 0 V Address       ---> ORIY (Y0)
  377.         // m1.2                 Pixel 0 U Address       ---> ORIX (X0)
  378.         // m1.1                 Vertical Block Number
  379.         // m1.0                 Reserved
  380.  
  381.         // Sampler Message Descriptor
  382.         // 31:29        Reserved                        000
  383.         // 28:25        Message length                  0010
  384.         // 24:20        Response length                 xxxxx   ---> 4GRFs for each enabled channel (AVS), 2GRFs for each enabled channel (sample unorm)
  385.         // 19           Header Present                  1
  386.         // 18:17        SIMD Mode                       11      ---> SIMD32/64
  387.         // 16:12        Message Type                    xxxxx   ---> 01011 sample_8x8, 01100 (sample_unorm), 01010 (sample_unorm+killpix)
  388.         // 11:8         Sampler Index                   xxxx
  389.         // 7:0          Binding Table Index             xxxxxxxx
  390.  
  391.  
  392.         // Msg Header M0.2
  393.         // 15:15        Alpha Write Channel Mask, 0: written back, 1: not written back
  394.         // 14:14        Blue  Write Channel Mask
  395.         // 13:13        Green Write Channel Mask
  396.         // 12:12        Red   Write Channel Mask
  397.  
  398.  
  399. //By design, Buffer 0,1,2,3 always have Layer 0 and Buffer 4,5 always have L1-L7
  400.  
  401.  
  402. //used to generate LABELS at compile time.
  403.  
  404.  
  405.         // 18:17        SIMD Mode                       10      ---> SIMD16
  406.         // 16:12        Message Type                    xxxxx   ---> 00000 (SIMD16)
  407.  
  408.  
  409. //r10-17  - 8 GRFs to load SIMD16 data (upto 4 channels)
  410. //r18-19  - 2 GRFs to store sampler ramp.
  411.  
  412.     .declare mfSCALING_0X_34X_PAYLOAD   Base=r14.0      ElementSize=4           SrcRegion=<8;8,1>               DstRegion=<1>           Type=f
  413.     .declare muwSCALING_0X_34X_PAYLOAD  Base=r14.0      ElementSize=2           SrcRegion=<16;16,1>             DstRegion=<1>           Type=uw
  414.     .declare mudCALING_0X_34X_PAYLOAD   Base=r14.0      ElementSize=4           SrcRegion=<8;8,1>               DstRegion=<1>           Type=ud
  415.     .declare mubCALING_0X_34X_PAYLOAD   Base=r14.0      ElementSize=1           SrcRegion=<32;32,1>             DstRegion=<1>           Type=ub
  416.  
  417.  
  418.         .declare fSCALING_0X_34X_TEMP           Base=r9.0       ElementSize=4           SrcRegion=<8;8,1>               DstRegion=<1>           Type=f
  419.         .declare udSCALING_0X_34X_TEMP          Base=r9.0       ElementSize=4           SrcRegion=<8;8,1>               DstRegion=<1>           Type=ud
  420.         .declare ub4SCALING_0X_34X_TEMP         Base=r9.0       ElementSize=1           SrcRegion=<32;8,4>              DstRegion=<1>           Type=ub
  421.         .declare uwSCALING_0X_34X_TEMP          Base=r9.0       ElementSize=2           SrcRegion=<16;16,1>             DstRegion=<1>           Type=uw
  422.  
  423.         // Sampler ramp is used for Scaling 0X_0.34X
  424.         .declare        fSAMPLER_RAMP           Base=r9.0 ElementSize=4 SrcRegion=<8;8,1> Type=f                // 1 GRFs, 8 elements
  425.  
  426.  
  427.         //#define rMSGDSC_UV                    r23.0
  428.  
  429.  
  430. //End of _SCALING_
  431.  
  432.  
  433.         //NOTE: We need offsets for second halfof LAYER 0 - even if we do not load it.
  434.         //Update the channel offset in the buffers for the lower 8x4 data for BUFFER_0.
  435.         mov (1)   r22.4<1>:ud     0x400040:ud
  436.  
  437.  
  438.     //Check if layer is to be skipped
  439.  
  440.  
  441.         // f0.1 pre-computed in Set_Layer_0
  442.         (-f0.1)  jmpi  (1)  SKIP_AVS_LOAD_L0_0_
  443.  
  444.  
  445.     //AVS_PAYLOAD already has all the data loaded at this point
  446.     add (1)     a0.0:ud     r23.5<0;1,0>:ud      0x50EB400:ud      //msg desc
  447.  
  448.     mov (1)     r16.2:ud      0x00000000:ud                 // Enable ARGB channels
  449.  
  450.  
  451.         //OPT: rAVS_PAYLOAD.1 and .7 --> use NODDCLR, NODDCHK -rT
  452.         mov (1)   r25.7<1>:ud      r7.7:ud           { NoDDClr }
  453.         mov (1)   r25.1<1>:ud      r7.12:uw       { NoDDChk }
  454.  
  455.  
  456.     // set the vertical block number
  457.  
  458.  
  459.     mov (8)     r17.0:ud      r25.0<8;8,1>:ud
  460.  
  461.     // Gen7 AVS WA Only for YUV packed surfaces, NV12 and Y-channel only for Planar surfaces
  462.     //   if (((int)(u_left*width + 5.0/256) > (int)(u_left*width))
  463.     //   {
  464.     //       modified_u_coord = u_coord – 5.0/(256*width); //floating point
  465.     //   }
  466.     //   else if(((int)(u_left*width + 255.0/256) == (int)(u_left*width))
  467.     //   {
  468.     //       modified_u_coord = u_coord + 1.0/(256*width); //floating point
  469.     //   }
  470.     //   else{
  471.     //       modified_u_coord = u_coord;
  472.     //   }
  473.     //   Where u_left = u – 2*du + 3*ddu for IEF On
  474.     //   And u_left = u for IEF Off case
  475.     //  
  476.  
  477.     // check whether Gen7 AVS WA is enabled,
  478.     mov  (1)    r14.8:uw            f0.0:uw           // save f0.0
  479.  
  480.     and.nz.f0.0  (1)     null<1>:uw     r2.3:uw    0x2:uw
  481.     (-f0.0)jmpi  (1)     GEN7_AVS_WA_DONE_L0_0_
  482.  
  483.  
  484.     // Gen7 AVS WA, check if IEF is ON for choosing Gen7 AVS WA formula
  485.  
  486.     and.nz.f0.0  (8)     null<1>:uw     r2.3<0;1,0>:uw             0x4:uw
  487.     (f0.0)mov (8)    acc0.0:f          r17.2<0;1,0>:f
  488.     (f0.0)mac (8)    acc0.0:f          r17.4<0;1,0>:f    -2.0:f
  489.     (f0.0)mac (8)    acc0.0:f          r17.6<0;1,0>:f     3.0:f
  490.     (f0.0)mov (1)    r14.2:f        acc0:f                                 // IEF ON,  rTEMP3.2 = u_left
  491.     (-f0.0)mov (1)   r14.2:f        r17.2<0;1,0>:f                // IEF OFF, rTEMP3.2 = u_left
  492.  
  493.     and (1)         r14.1:ud     r2.3:uw    0xFFF8:uw
  494.     asr (1)         r14.1:ud     r14.1:ud    3:d
  495.     mov (1)         r14.1:f      r14.1:ud
  496.  
  497.     // Gen7 AVS WA, if (int)(u_left*width + 5.0/256) > (int)(u_left*width)
  498.     mul (1)          r14.0:f        r14.2:f                  r14.1:f    // rTEMP3.0 = u_left*width
  499.     add (1)          r14.2:f        r14.0:f                  0.01953125:f  // rTEMP3.2 = u_left*width + 5.0/256
  500.     add (1)          r14.3:f        r14.0:f                  0.99609375:f  // rTEMP3.3 = u_left*width + 255.0/256
  501.  
  502.     //Check if the values are < 0 and account for (int) cast of negative numbers
  503.  
  504.     //(int)(u_left*width)
  505.     cmp.l.f0.0 (1)   null<1>:f          r14.0:f                  0.00000000:f          
  506.     mov (1)          r14.0:d        r14.0:f
  507.     (f0.0)add (1)    r14.0:d        r14.0<0;1,0>:d           -1:d        
  508.  
  509.     //(int)(u_left*width + 5.0/256)
  510.     cmp.l.f0.0 (1)   null<1>:f          r14.2:f                  0.00000000:f          
  511.     mov (1)          r14.2:d        r14.2:f        
  512.     (f0.0)add (1)    r14.2:d        r14.2<0;1,0>:d           -1:d        
  513.  
  514.     //(int)(u_left*width + 255.0/256)
  515.     cmp.l.f0.0 (1)   null<1>:f          r14.3:f                  0.00000000:f          
  516.     mov (1)          r14.3:d        r14.3:f
  517.     (f0.0)add (1)    r14.3:d        r14.3<0;1,0>:d           -1:d        
  518.  
  519.     mov  (1)    f0.0:uw                0:uw                   // clear flag
  520.     //if (((int)(u_left*width + 5.0/256) > (int)(u_left*width))
  521.     cmp.g.f1.0  (1)     null<1>:d        r14.2:d    r14.0:d
  522.     // modified_u_coord = u_coord – 5.0/(256*width); //floating point
  523.     (f1.0) add (1)     r17.2:f       r17.2<0;1,0>:f   -r2.3:f
  524.     //else if(((int)(u_left*width + 255.0/256) == (int)(u_left*width))
  525.     (-f1.0) cmp.e.f0.0  (1) null<1>:d    r14.3:d    r14.0:d
  526.     // modified_u_coord = u_coord + 1.0/(256*width); //floating point
  527.     (f0.0) add (1)     r17.2:f       r17.2<0;1,0>:f   r2.2:f
  528.  
  529.  
  530. GEN7_AVS_WA_DONE_L0_0_:
  531.     mov  (1)    f0.0:uw                r14.8:uw                   // restore f0.0
  532.  
  533.     send (1)    uwBUFFER_0(0)<1>   r16    0x2    a0.0:ud
  534.     // Returns packed data in 16 GRFs in scrambled order
  535.  
  536. SKIP_AVS_LOAD_L0_0_:
  537.     nop
  538.  
  539.  
  540.