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.  *      Author: Zhao Yakui <yakui.zhao@intel.com>
  10.  *
  11.  *  Unless required by applicable law or agreed to in writing, software
  12.  *  distributed under the License is distributed on an "AS IS" BASIS,
  13.  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.  *  See the License for the specific language governing permissions and
  15.  *  limitations under the License.
  16.  */
  17. //   84    // Total instruction count
  18. //    1    // Total kernel count
  19.  
  20.  
  21.  
  22. // Module name: common.inc
  23. //
  24. // Common header file for all Video-Processing kernels
  25. //
  26.  
  27. .default_execution_size (16)
  28. .default_register_type  :ub
  29.  
  30. .reg_count_total        128
  31. .reg_count_payload      7
  32.  
  33. //========== Common constants ==========
  34.  
  35.  
  36. //========== Macros ==========
  37.  
  38.  
  39. //Fast Jump, For more details see "Set_Layer_N.asm"
  40.  
  41.  
  42. //========== Defines ====================
  43.  
  44. //========== Static Parameters (Common To All) ==========
  45. //r1
  46.  
  47.  
  48. //r2
  49.  
  50.                                     //  e.g.            byte0   byte1  byte2
  51.                                     // YUYV               0       1      3
  52.                                     // YVYU               0       3      1
  53.  
  54. //Color Pipe (IECP) parameters
  55.  
  56.  
  57. //ByteCopy
  58.  
  59.  
  60. //r4
  61.  
  62.                                     //  e.g.              byte0           byte1           byte2
  63.                                     // YUYV                 0               1               3
  64.                                     // YVYU                 0               3               1
  65.  
  66.  
  67. //========== Inline parameters (Common To All) ===========
  68.  
  69.  
  70. //============== Binding Index Table===========
  71. //Common between DNDI and DNUV
  72.  
  73.  
  74. //================= Common Message Descriptor =====
  75. // Message descriptor for thread spawning
  76. // Message Descriptors
  77. //                = 000 0001 (min message len 1 ) 0,0000 (resp len 0   -add later)
  78. //                  0000,0000,0000
  79. //                  0001(Spawn a root thread),0001 (Root thread spawn thread)
  80. //                = 0x02000011
  81. // Thread Spawner Message Descriptor
  82.  
  83.  
  84. // Message descriptor for atomic operation add
  85. // Message Descriptors
  86. //                = 000 0110 (min message len 6 ) 0,0000 (resp len 0   -add later)
  87. //                  1(header present)001,10(typed atomic operation)0(return enabled)0(slot group, low 8 bits),0111 (AOP_Add)
  88. //                  0000,0000 (Binding table index, added later)
  89. //                = 0x02000011
  90.  
  91. // Atomic Operation Add Message Descriptor
  92.  
  93.  
  94. // Message descriptor for dataport media write
  95.         // Message Descriptors
  96.                 //                = 000 0001 (min message len 1 - add later) 00000 (resp len 0)
  97.                 //                  1 (header present 1) 0 1010 (media block write) 000000
  98.                 //                  00000000 (binding table index - set later)
  99.                 //                = 0x020A8000
  100.  
  101.  
  102. // Message Length defines
  103.  
  104.  
  105. // Response Length defines
  106.  
  107.  
  108. // Block Width and Height Size defines
  109.  
  110.  
  111. // Extended Message Descriptors
  112.  
  113.  
  114. // Common message descriptors:
  115.  
  116.  
  117. //===================== Math Function Control ===================================
  118.  
  119.  
  120. //============ Message Registers ===============
  121.                              // buf4 starts from r28
  122.  
  123.  
  124. //#define mMSGHDR_EOT  r43    // Dummy Message Register for EOT
  125.  
  126.  
  127. .declare    mubMSGPAYLOAD  Base=r30 ElementSize=1 SrcRegion=<16;16,1> Type=ub
  128. .declare    muwMSGPAYLOAD  Base=r30 ElementSize=2 SrcRegion=<16;16,1> Type=uw
  129. .declare    mudMSGPAYLOAD  Base=r30 ElementSize=4 SrcRegion=<8;8,1> Type=ud
  130. .declare    mfMSGPAYLOAD   Base=r30 ElementSize=4 SrcRegion=<8;8,1> Type=f
  131.  
  132. //=================== End of thread instruction ===========================
  133.  
  134.  
  135. //=====================Pointers Used=====================================
  136.  
  137.  
  138. //=======================================================================
  139.  
  140.  
  141. //r9-r17
  142. // Define temp space for any usages
  143.  
  144.  
  145. // Common Buffers
  146.  
  147.  
  148. // temp space for rotation
  149.  
  150. .declare fROBUF           Base=r9.0             ElementSize=4           SrcRegion=<8;8,1>                 DstRegion=<1>         Type=f
  151.  
  152. .declare udROBUF                Base=r9.0               ElementSize=4           SrcRegion=<8;8,1>                 DstRegion=<1>         Type=ud
  153.  
  154. .declare uwROBUF                Base=r9.0               ElementSize=2           SrcRegion=<16;16,1>             DstRegion=<1>           Type=uw
  155.  
  156. .declare ubROBUF                Base=r9.0               ElementSize=1           SrcRegion=<16;16,1>             DstRegion=<1>           Type=ub
  157.  
  158. .declare ub4ROBUF       Base=r9.0               ElementSize=1           SrcRegion=<32;8,4>              DstRegion=<4>           Type=ub
  159.  
  160.  
  161. // End of common.inc
  162.  
  163.  
  164. // Module name: Save_AVS_PL3.asm
  165. //
  166. // Save PL3 420 frame data block of size 16x16
  167. //
  168. // To save 16x16 block (16x16 byte of Y and 8x8 byte of U and V each) we need 3 send instructions with one of size 16x16 and two of size 8x8.
  169. //  -----------------
  170. //  |    16x16 Y    |
  171. //  |               |
  172. //  -----------------
  173. //  | 8x8 U |
  174. //  ---------
  175. //  | 8x8 V |
  176. //  ---------
  177.  
  178. //-----------------------------------------------------------------
  179. //The layout of data is as follows:
  180. //mMSGHDR0                      : Y data header (16x16)
  181. //mubMSGPAYLOAD0        : Y data payload (8 GRFs)
  182. //mMSGHDR1                      : U data header (8x8)
  183. //mubMSGPAYLOAD1        : U data payload (2 GRFs)
  184. //mMSGHDR2                      : V data header (8x8)
  185. //mubMSGPAYLOAD2        : V data payload (2 GRFs)
  186. //------------------------------------------------------------------
  187.  
  188.  
  189.  
  190. // Module name: Save.inc
  191.  
  192.  
  193.  
  194.  
  195. // Description: Includes all definitions explicit to Fast Composite.
  196.  
  197.  
  198.  
  199.  
  200. // End of common.inc
  201.  
  202.  
  203. //========== GRF partition ==========
  204.      // r0 header            :   r0          (1 GRF)
  205.      // Static parameters    :   r1 - r6     (6 GRFS)
  206.      // Inline parameters    :   r7 - r8     (2 GRFs)
  207.      // MSGSRC               :   r27         (1 GRF)
  208. //===================================
  209.  
  210. //Interface:
  211. //========== Static Parameters (Explicit To Fast Composite) ==========
  212. //r1
  213. //CSC Set 0
  214.  
  215.  
  216. .declare udCSC_CURBE    Base=r1.0      ElementSize=4       Type=ud
  217.  
  218. //Constant alpha
  219.  
  220.  
  221. //r2
  222.  
  223.  
  224. // Gen7 AVS WA
  225.  
  226.  
  227. // WiDi Definitions
  228.  
  229.  
  230. //Colorfill
  231.  
  232.  
  233.                                       // 0: 0-degree, 1: 90, 2: 180, 3: 270-degree, clockwise.     
  234.  
  235. .declare ubCOLOR_PIXEL_VAL      Base=r2.20      ElementSize=1       SrcRegion=<0;1,0>       DstRegion=<1>       Type=ub
  236.  
  237. //r3
  238. //Normalised Ratio of Horizontal step size with main video for all layers
  239.  
  240.  
  241.     //Normalised Ratio of Horizontal step size with main video for all layers becomes
  242.     //Normalised Horizontal step size for all layers in VP_Setup.asm
  243.  
  244.  
  245. //r4
  246. //Normalised Vertical step size for all layers
  247.  
  248.  
  249. //r5
  250. //Normalised Vertical Frame Origin for all layers
  251.  
  252.  
  253. //r6
  254. //Normalised Horizontal Frame Origin for all layers
  255.  
  256.  
  257. //========== Inline Parameters (Explicit To Fast Composite) ==========
  258.  
  259.  
  260. //Main video Step X
  261.  
  262.  
  263. //====================== Binding table (Explicit To Fast Composite)=========================================
  264.  
  265.  
  266. //Used by Interlaced Scaling Kernels
  267.  
  268.  
  269. //========== Sampler State Table Index (Explicit To Fast Composite)==========
  270. //Sampler Index for AVS/IEF messages
  271.  
  272.  
  273. //Sampler Index for SIMD16 sampler messages
  274.  
  275.  
  276. //=============================================================================
  277.  
  278. .declare fBUFFER_0      Base=r64.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=f
  279. .declare fBUFFER_1      Base=r80.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=f
  280. .declare fBUFFER_2      Base=r96.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=f
  281. .declare fBUFFER_3      Base=r112.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=f
  282. .declare fBUFFER_4      Base=r28.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=f
  283. .declare fBUFFER_5      Base=r46.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=f
  284.  
  285. .declare udBUFFER_0     Base=r64.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=ud
  286. .declare udBUFFER_1     Base=r80.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=ud
  287. .declare udBUFFER_2     Base=r96.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=ud
  288. .declare udBUFFER_3     Base=r112.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=ud
  289. .declare udBUFFER_4     Base=r28.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=ud
  290. .declare udBUFFER_5     Base=r46.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=ud
  291.  
  292. .declare uwBUFFER_0     Base=r64.0       ElementSize=2       SrcRegion=<16;16,1>     DstRegion=<1>       Type=uw
  293. .declare uwBUFFER_1     Base=r80.0       ElementSize=2       SrcRegion=<16;16,1>     DstRegion=<1>       Type=uw
  294. .declare uwBUFFER_2     Base=r96.0       ElementSize=2       SrcRegion=<16;16,1>     DstRegion=<1>       Type=uw
  295. .declare uwBUFFER_3     Base=r112.0       ElementSize=2       SrcRegion=<16;16,1>     DstRegion=<1>       Type=uw
  296. .declare uwBUFFER_4     Base=r28.0       ElementSize=2       SrcRegion=<16;16,1>     DstRegion=<1>       Type=uw
  297. .declare uwBUFFER_5     Base=r46.0       ElementSize=2       SrcRegion=<16;16,1>     DstRegion=<1>       Type=uw
  298.  
  299. .declare ubBUFFER_0     Base=r64.0       ElementSize=1       SrcRegion=<16;16,1>     DstRegion=<1>       Type=ub
  300. .declare ubBUFFER_1     Base=r80.0       ElementSize=1       SrcRegion=<16;16,1>     DstRegion=<1>       Type=ub
  301. .declare ubBUFFER_2     Base=r96.0       ElementSize=1       SrcRegion=<16;16,1>     DstRegion=<1>       Type=ub
  302. .declare ubBUFFER_3     Base=r112.0       ElementSize=1       SrcRegion=<16;16,1>     DstRegion=<1>       Type=ub
  303. .declare ubBUFFER_4     Base=r28.0       ElementSize=1       SrcRegion=<16;16,1>     DstRegion=<1>       Type=ub
  304. .declare ubBUFFER_5     Base=r46.0       ElementSize=1       SrcRegion=<16;16,1>     DstRegion=<1>       Type=ub
  305.  
  306. .declare ub4BUFFER_0    Base=r64.0       ElementSize=1       SrcRegion=<32;8,4>      DstRegion=<4>       Type=ub
  307. .declare ub4BUFFER_1    Base=r80.0       ElementSize=1       SrcRegion=<32;8,4>      DstRegion=<4>       Type=ub
  308. .declare ub4BUFFER_2    Base=r96.0       ElementSize=1       SrcRegion=<32;8,4>      DstRegion=<4>       Type=ub
  309. .declare ub4BUFFER_3    Base=r112.0       ElementSize=1       SrcRegion=<32;8,4>      DstRegion=<4>       Type=ub
  310. .declare ub4BUFFER_4    Base=r28.0       ElementSize=1       SrcRegion=<32;8,4>      DstRegion=<4>       Type=ub
  311. .declare ub4BUFFER_5    Base=r46.0       ElementSize=1       SrcRegion=<32;8,4>      DstRegion=<4>       Type=ub
  312.  
  313. //Pointer to mask reg
  314.  
  315.  
  316. //r18
  317.  
  318.  
  319. //Always keep Cannel Pointers and Offsets in same GRF, so that we can use
  320. // NODDCLR, NODDCHK flags. -rT
  321.  
  322.  
  323. .declare udCSC_COEFF_0  Base=r18.0    ElementSize=4 Type=ud       // 1 GRF
  324.  
  325. //r19
  326.  
  327.  
  328. .declare udCSC_COEFF_1  Base=r19.0    ElementSize=4 Type=ud       // 1 GRF
  329.  
  330.  
  331. //r20
  332.  
  333. .declare uwALPHA_MASK_REG_TEMP  Base=r20.0    ElementSize=2 SrcRegion=<16;16,1> Type=uw        // 1 GRF
  334.  
  335. //r21
  336.  
  337. .declare uwALPHA_MASK_REG       Base=r21.0         ElementSize=2 SrcRegion=<16;16,1> Type=uw        // 1 GRF
  338.  
  339. //r22
  340.  
  341.  
  342. //Always keep Cannel Pointers and Offsets in same GRF, so that we can use
  343. // NODDCLR, NODDCHK flags. -rT
  344.  
  345.  
  346. //Keep fORIGIN_X_NLAS, fY_OFFSET_2ND_BLOCK, fSTEP_X_NLAS, pMSGDSC_COPY, ubCONST_ALPHA_COPY as
  347. //sub registers of same GRF to enable using NODDCLR NODDCHK. -rT
  348.  
  349. //r23
  350.  
  351.  
  352. //Lumakey
  353.  
  354.  
  355. //r24
  356.  
  357.  
  358. //r25
  359.  
  360.  
  361. //r26
  362.  
  363.  
  364. //defines to generate LABELS during compile time.
  365.  
  366.  
  367. //Msg payload buffers; upto 4 full-size messages can be written
  368.  
  369.  
  370. .declare    mudMSGPAYLOAD0  Base=r29.0 ElementSize=4 SrcRegion=<8;8,1> Type=ud
  371. .declare    mudMSGPAYLOAD1  Base=r38.0 ElementSize=4 SrcRegion=<8;8,1> Type=ud
  372. .declare    mudMSGPAYLOAD2  Base=r47.0 ElementSize=4 SrcRegion=<8;8,1> Type=ud
  373. .declare    mudMSGPAYLOAD3  Base=r56.0 ElementSize=4 SrcRegion=<8;8,1> Type=ud
  374.  
  375. .declare    muwMSGPAYLOAD0  Base=r29.0 ElementSize=2 SrcRegion=<16;16,1> Type=uw
  376. .declare    muwMSGPAYLOAD1  Base=r38.0 ElementSize=2 SrcRegion=<16;16,1> Type=uw
  377. .declare    muwMSGPAYLOAD2  Base=r47.0 ElementSize=2 SrcRegion=<16;16,1> Type=uw
  378. .declare    muwMSGPAYLOAD3  Base=r56.0 ElementSize=2 SrcRegion=<16;16,1> Type=uw
  379.  
  380. .declare    mubMSGPAYLOAD0  Base=r29.0 ElementSize=1 SrcRegion=<16;16,1> Type=ub
  381. .declare    mubMSGPAYLOAD1  Base=r38.0 ElementSize=1 SrcRegion=<16;16,1> Type=ub
  382. .declare    mubMSGPAYLOAD2  Base=r47.0 ElementSize=1 SrcRegion=<16;16,1> Type=ub
  383. .declare    mubMSGPAYLOAD3  Base=r56.0 ElementSize=1 SrcRegion=<16;16,1> Type=ub
  384. .declare    mubMSGPAYLOAD4  Base=r32.0 ElementSize=1 SrcRegion=<16;16,1> Type=ub
  385. .declare    mubMSGPAYLOAD5  Base=r41.0 ElementSize=1 SrcRegion=<16;16,1> Type=ub
  386. .declare    mubMSGPAYLOAD6  Base=r50.0 ElementSize=1 SrcRegion=<16;16,1> Type=ub
  387. .declare    mubMSGPAYLOAD7  Base=r59.0 ElementSize=1 SrcRegion=<16;16,1> Type=ub
  388.  
  389.  
  390.         // the r17 register (nTEMP0) is originally defined from "Common.inc"
  391.         // instead of re-defining a nTEMP0 here, we use "SAVE_RGB" suffix for its naming
  392.  
  393.         .declare uwTemp0 Base=r17.0 ElementSize=2 Type=uw
  394.  
  395.  
  396. //_SAVE_INC_
  397.  
  398.  
  399.         // At the save module we have all 8 address sub-registers available.
  400.         // So we will use PING-PONG type of scheme to save the data using
  401.         // pointers pBUF_CHNL_TOP_8x4 and pBUF_CHNL_BOT_8x4. This will help
  402.         // reduce dependency. - rT
  403.  
  404.         //wBUFF_CHNL_PTR points to either buffer 0 or buffer 4.
  405.         //Add appropriate offsets to get pointers for all buffers (1,2,3 or 5).
  406.         //Offsets are zero for buffer 0 and buffer 4.
  407.         add   (4) a0.0<1>:uw   r22.0<4;4,1>:w          0:uw
  408.         add   (4) a0.4<1>:uw   r22.0<4;4,1>:w          512:uw
  409.  
  410.         //Set up header for Y,U and V data
  411.         mov  (8) r28<1>:ud      r27<8;8,1>:ud
  412.         mov  (8) r37<1>:ud      r27<8;8,1>:ud
  413.         mov  (8) r46<1>:ud      r27<8;8,1>:ud
  414.  
  415.         mov  (2) r28.0<1>:d     r7.0<2;2,1>:w                                   { NoDDClr }  //ORI Y (LUMA) = ORI
  416.         shr  (2) r37.0<1>:d     r7.0<2;2,1>:w            1:w            { NoDDClr }  //H/V ORI U        = H/V ORI/2
  417.         shr  (2) r46.0<1>:d     r7.0<2;2,1>:w            1:w            { NoDDClr }  //H/V ORI V        = H/V ORI/2
  418.  
  419.         mov  (1) r28.2<1>:ud    0xF000F:ud      { NoDDChk }  // Y Block width and height (16x16)
  420.         mov  (1) r37.2<1>:ud     0x70007:ud     { NoDDChk }  // U Block width and height (8x8)
  421.         mov  (1) r46.2<1>:ud     0x70007:ud     { NoDDChk }  // V Block width and height (8x8)
  422.  
  423. // Unscramble, and pack data directly to MRFs
  424.  
  425. //      Data 16x16 block is divided as -
  426. //              ---------
  427. //              |   0   |
  428. //              ---------
  429. //              |   1   |
  430. //              ---------
  431. //              |   2   |
  432. //              ---------
  433. //              |   3   |
  434. //              ---------
  435. //              All sub-blocks are of size 16x4
  436. //              0: ubBUFFER_0
  437. //              1: ubBUFFER_1, ubBUFFER_0+16
  438. //              2: ubBUFFER_2
  439. //              3: ubBUFFER_3, ubBUFFER_2+16
  440.  
  441.         //Y Rounding, first
  442.         add.sat (16) r[a0.1,0]<1>:uw            r[a0.1,0]<16;16,1>:uw           0x0080:uw              
  443.         add.sat (16) r[a0.1,32]<1>:uw           r[a0.1,32]<16;16,1>:uw  0x0080:uw              
  444.         add.sat (16) r[a0.1,64]<1>:uw           r[a0.1,64]<16;16,1>:uw  0x0080:uw              
  445.         add.sat (16) r[a0.1,96]<1>:uw           r[a0.1,96]<16;16,1>:uw  0x0080:uw              
  446.  
  447.         // U rounding
  448.         add.sat (8) r[a0.2,0]<2>:uw             r[a0.2,0]<16;8,2>:uw            0x0080:uw              
  449.         add.sat (8) r[a0.2,64]<2>:uw            r[a0.2,64]<16;8,2>:uw           0x0080:uw              
  450.  
  451.         // V rounding
  452.         add.sat (8) r[a0.0,0]<2>:uw             r[a0.0,0]<16;8,2>:uw            0x0080:uw              
  453.         add.sat (8) r[a0.0,64]<2>:uw            r[a0.0,64]<16;8,2>:uw           0x0080:uw              
  454.  
  455.         add   (4) a0.0<1>:uw                    r22.0<4;4,1>:w          1024:uw //Update Buffer 2 pointers
  456.  
  457.         //Y Rounding, second
  458.         add.sat (16) r[a0.5,0]<1>:uw            r[a0.5,0]<16;16,1>:uw           0x0080:uw              
  459.         add.sat (16) r[a0.5,32]<1>:uw           r[a0.5,32]<16;16,1>:uw  0x0080:uw              
  460.         add.sat (16) r[a0.5,64]<1>:uw           r[a0.5,64]<16;16,1>:uw  0x0080:uw              
  461.         add.sat (16) r[a0.5,96]<1>:uw           r[a0.5,96]<16;16,1>:uw  0x0080:uw              
  462.  
  463.         // U rounding
  464.         add.sat (8) r[a0.6,0]<2>:uw             r[a0.6,0]<16;8,2>:uw            0x0080:uw              
  465.         add.sat (8) r[a0.6,64]<2>:uw            r[a0.6,64]<16;8,2>:uw           0x0080:uw              
  466.  
  467.         // V rounding
  468.         add.sat (8) r[a0.4,0]<2>:uw             r[a0.4,0]<16;8,2>:uw            0x0080:uw              
  469.         add.sat (8) r[a0.4,64]<2>:uw            r[a0.4,64]<16;8,2>:uw           0x0080:uw              
  470.  
  471.         add   (4) a0.4<1>:uw            r22.0<4;4,1>:w          1536:uw //Update Buffer 3 pointers
  472.  
  473.         //Y Rounding, third
  474.         add.sat (16) r[a0.1,0]<1>:uw            r[a0.1,0]<16;16,1>:uw           0x0080:uw              
  475.         add.sat (16) r[a0.1,32]<1>:uw           r[a0.1,32]<16;16,1>:uw  0x0080:uw              
  476.         add.sat (16) r[a0.1,64]<1>:uw           r[a0.1,64]<16;16,1>:uw  0x0080:uw              
  477.         add.sat (16) r[a0.1,96]<1>:uw           r[a0.1,96]<16;16,1>:uw  0x0080:uw              
  478.  
  479.         // U rounding
  480.         add.sat (8) r[a0.2,0]<2>:uw             r[a0.2,0]<16;8,2>:uw            0x0080:uw              
  481.         add.sat (8) r[a0.2,64]<2>:uw            r[a0.2,64]<16;8,2>:uw           0x0080:uw              
  482.  
  483.         // V rounding
  484.         add.sat (8) r[a0.0,0]<2>:uw             r[a0.0,0]<16;8,2>:uw            0x0080:uw              
  485.         add.sat (8) r[a0.0,64]<2>:uw            r[a0.0,64]<16;8,2>:uw           0x0080:uw              
  486.  
  487.  
  488.         //Y Rounding, fourth
  489.         add.sat (16) r[a0.5,0]<1>:uw            r[a0.5,0]<16;16,1>:uw           0x0080:uw              
  490.         add.sat (16) r[a0.5,32]<1>:uw           r[a0.5,32]<16;16,1>:uw  0x0080:uw              
  491.         add.sat (16) r[a0.5,64]<1>:uw           r[a0.5,64]<16;16,1>:uw  0x0080:uw              
  492.         add.sat (16) r[a0.5,96]<1>:uw           r[a0.5,96]<16;16,1>:uw  0x0080:uw              
  493.  
  494.         // U rounding
  495.         add.sat (8) r[a0.6,0]<2>:uw             r[a0.6,0]<16;8,2>:uw            0x0080:uw              
  496.         add.sat (8) r[a0.6,64]<2>:uw            r[a0.6,64]<16;8,2>:uw           0x0080:uw              
  497.  
  498.         // V rounding
  499.         add.sat (8) r[a0.4,0]<2>:uw             r[a0.4,0]<16;8,2>:uw            0x0080:uw              
  500.         add.sat (8) r[a0.4,64]<2>:uw            r[a0.4,64]<16;8,2>:uw           0x0080:uw              
  501.  
  502.         // restore the TOP and BOT pointers
  503.         add   (4) a0.0<1>:uw   r22.0<4;4,1>:w          0:uw
  504.         add   (4) a0.4<1>:uw   r22.0<4;4,1>:w          512:uw
  505.  
  506. //Buffer 0
  507. //Move Y to msg payload
  508.         mov  (16)  mubMSGPAYLOAD0(0,0)<1>                       r[a0.1, 1]<32;16,2>:ub          { NoDDClr }
  509.         mov  (16)  mubMSGPAYLOAD0(0,16)<1>                      r[a0.1, 33]<32;16,2>:ub         { NoDDChk }
  510.         mov  (16)  mubMSGPAYLOAD0(1,0)<1>                       r[a0.1, 65]<32;16,2>:ub         { NoDDClr }
  511.         mov  (16)  mubMSGPAYLOAD0(1,16)<1>                      r[a0.1, 97]<32;16,2>:ub         { NoDDChk }
  512.  
  513. //Move U to msg payload
  514.         mov  (8)  mubMSGPAYLOAD1(0,0)<1>                        r[a0.2, 1]<32;8,4>:ub           { NoDDClr }
  515.         mov  (8)  mubMSGPAYLOAD1(0,8)<1>                        r[a0.2, 65]<32;8,4>:ub          { NoDDClr, NoDDChk }
  516.  
  517. //Move V to msg payload
  518.         mov  (8)  mubMSGPAYLOAD2(0,0)<1>                        r[a0.0, 1]<32;8,4>:ub           { NoDDClr }
  519.         mov  (8)  mubMSGPAYLOAD2(0,8)<1>                        r[a0.0, 65]<32;8,4>:ub          { NoDDClr, NoDDChk }
  520.  
  521.         add   (4) a0.0<1>:uw                    r22.0<4;4,1>:w          1024:uw //Update Buffer 2 pointers
  522.  
  523. //Buffer 1
  524.         mov  (16)  mubMSGPAYLOAD0(2,0)<1>                       r[a0.5, 1]<32;16,2>:ub          { NoDDClr }
  525.         mov  (16)  mubMSGPAYLOAD0(2,16)<1>                      r[a0.5, 33]<32;16,2>:ub         { NoDDChk }
  526.         mov  (16)  mubMSGPAYLOAD0(3,0)<1>                       r[a0.5, 65]<32;16,2>:ub         { NoDDClr }
  527.         mov  (16)  mubMSGPAYLOAD0(3,16)<1>                      r[a0.5, 97]<32;16,2>:ub         { NoDDChk }
  528.  
  529.         mov  (8)  mubMSGPAYLOAD1(0,16)<1>                       r[a0.6, 1]<32;8,4>:ub           { NoDDClr, NoDDChk }
  530.         mov  (8)  mubMSGPAYLOAD1(0,24)<1>                       r[a0.6, 65]<32;8,4>:ub          { NoDDChk }
  531.  
  532.         mov  (8)  mubMSGPAYLOAD2(0,16)<1>                       r[a0.4, 1]<32;8,4>:ub           { NoDDClr, NoDDChk }
  533.         mov  (8)  mubMSGPAYLOAD2(0,24)<1>                       r[a0.4, 65]<32;8,4>:ub          { NoDDChk }
  534.  
  535.         add   (4) a0.4<1>:uw            r22.0<4;4,1>:w          1536:uw //Update Buffer 3 pointers
  536.  
  537. //Buffer 2
  538.         mov  (16)  mubMSGPAYLOAD0(4,0)<1>                       r[a0.1, 1]<32;16,2>:ub          { NoDDClr }
  539.         mov  (16)  mubMSGPAYLOAD0(4,16)<1>                      r[a0.1, 33]<32;16,2>:ub         { NoDDChk }
  540.         mov  (16)  mubMSGPAYLOAD0(5,0)<1>                       r[a0.1, 65]<32;16,2>:ub         { NoDDClr }
  541.         mov  (16)  mubMSGPAYLOAD0(5,16)<1>                      r[a0.1, 97]<32;16,2>:ub         { NoDDChk }
  542.  
  543.         mov  (8)  mubMSGPAYLOAD1(1,0)<1>                        r[a0.2, 1]<32;8,4>:ub           { NoDDClr }
  544.         mov  (8)  mubMSGPAYLOAD1(1,8)<1>                        r[a0.2, 65]<32;8,4>:ub          { NoDDClr, NoDDChk }
  545.  
  546.         mov  (8)  mubMSGPAYLOAD2(1,0)<1>                        r[a0.0, 1]<32;8,4>:ub           { NoDDClr }
  547.         mov  (8)  mubMSGPAYLOAD2(1,8)<1>                        r[a0.0, 65]<32;8,4>:ub          { NoDDClr, NoDDChk }
  548.  
  549. //Buffer 3
  550.         mov  (16)  mubMSGPAYLOAD0(6,0)<1>                       r[a0.5, 1]<32;16,2>:ub          { NoDDClr }
  551.         mov  (16)  mubMSGPAYLOAD0(6,16)<1>                      r[a0.5, 33]<32;16,2>:ub         { NoDDChk }
  552.         mov  (16)  mubMSGPAYLOAD0(7,0)<1>                       r[a0.5, 65]<32;16,2>:ub         { NoDDClr }
  553.         mov  (16)  mubMSGPAYLOAD0(7,16)<1>                      r[a0.5, 97]<32;16,2>:ub         { NoDDChk }
  554.  
  555.         mov  (8)  mubMSGPAYLOAD1(1,16)<1>                       r[a0.6, 1]<32;8,4>:ub           { NoDDClr, NoDDChk }
  556.         mov  (8)  mubMSGPAYLOAD1(1,24)<1>                       r[a0.6, 65]<32;8,4>:ub          { NoDDChk }
  557.  
  558.         mov  (8)  mubMSGPAYLOAD2(1,16)<1>                       r[a0.4, 1]<32;8,4>:ub           { NoDDClr, NoDDChk }
  559.         mov  (8)  mubMSGPAYLOAD2(1,24)<1>                       r[a0.4, 65]<32;8,4>:ub          { NoDDChk }
  560.  
  561. //===========================================================================
  562.  
  563. send (1)    null<1>:d    r28    0xc                     0x120A8018:ud
  564. send (1)    null<1>:d    r37    0xc                     0x60A8019:ud
  565. send (1)    null<1>:d    r46    0xc                     0x60A801A:ud
  566.