<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    隨筆 - 53, 文章 - 0, 評論 - 3, 引用 - 0
    數據加載中……

    The analysis of MOR(MXOR) instruction implementation in MMIXWare

    The analysis of MOR(MXOR) instruction implementation in MMIXWare
     
     -- A stupid way to understand the source code.
     
     the implementation of MOR(MXOR) is in file: mmix-arith.w
     436 octa bool_mult(y,z,xor)
     437   octa y,z; /* the operands */
     438   bool xor; /* do we do xor instead of or? */
     439 {
     440   octa o,x;
     441   register tetra a,b,c;
     442   register int k;
     443   for (k=0,o=y,x=zero_octa;o.h||o.l;k++,o=shift_right(o,8,1))
     444     if (o.l&0xff) {
     445       a=((z.h>>k)&0x01010101)*0xff;
     446       b=((z.l>>k)&0x01010101)*0xff;
     447       c=(o.l&0xff)*0x01010101;
     448       if (xor) x.h^=a&c, x.l^=b&c;
     449       else x.h|=a&c, x.l|=b&c;
     450     }
     451   return x;
     452 }
     
     It takes me several hours to understand the details.
     
     If we treat each octabyte as a matrix, each row corresponds to a byte, then
     y MOR z = z (matrix_mulitiply) y
     
     For a=((z.h>>k)&0x01010101)*0xff;
     (z.h>>k)&0x01010101 will get the four last bit in (z.h>>k). depends on the bit in last row,
     ((z.h>>k)&0x01010101)*0xff will expand the bit (either 0 or 1) into the whole row.
     e.g.
                 ff
     *     0x01010101   
     ---------------
     =           ff
               ff
             ff
           ff
     ----------------
     =    ffffffff      
    (depending on the last bit in each row of z, the result could be #ff00ff00. #ff0000ff, etc.)

    similarily, b=((z.l>>k)&0x01010101)*0xff; will expand the last bit in each byte into the
    whole byte.

    over all, after these two step, the z becomes the replication of it's last row, since k vary
    from 0 to 7, it will loop on all the rows actually.


     For c=(o.l&0xff)*0x01010101, it will get the last byte in o.l and populate it to other three byte.
     since it will not only or/xor h but also l. it is not necessary populate it to o.h.
     
     one example,
     let (z.h>>k)&0x01010101 = 0x01000101, then a= 0xff00ffff;
     let (z.l>>k)&0x01010101 = 0x01010001, then b= 0xffff00ff;
     let (o.l&0xff)=0xuv, then c= 0xuvuvuvuv;
      then a&c=0xuv00uvuv;
             b&c=0xuvuv00uv;
           
     consider the elements [i,j] in result x.  in this round, what value was accumalated in by operation
     or(xor).
     it is the jth bit in last byte of o.l & ith bit in last column of z.(do not consider looping now.)
     in this round, the 64 combination of i and j, contirbute the value to the 64 bits in z.
     
     Noticed that o loop on y from last byte to first byte. There are 8 loop/rounds, in another round.
     say kth round.
     the elements[i,j] will accumuate the jth bit in last (k + 1)th row & the jth bit in last (k+1)th
     column.
     that means the jth column in y multiply the ith row in z. it conform to the definiton for
     z matrix_multiply y.
     
     
             
           
           
     

    posted on 2009-01-16 10:54 InPractice 閱讀(277) 評論(0)  編輯  收藏


    只有注冊用戶登錄后才能發表評論。


    網站導航:
     
    主站蜘蛛池模板: 99re免费视频| 在线免费视频一区| 亚洲影视自拍揄拍愉拍| 免费欧洲毛片A级视频无风险| 久久毛片免费看一区二区三区| 亚洲av日韩综合一区在线观看| 亚洲精品免费网站| 精品无码一级毛片免费视频观看| 久久亚洲国产精品成人AV秋霞| 国产精品国产午夜免费福利看 | 免费网站观看WWW在线观看| 日韩亚洲AV无码一区二区不卡| 国产真人无遮挡作爱免费视频| 中国一级毛片免费看视频| 亚洲伊人久久大香线蕉在观| xvideos亚洲永久网址| 中文字幕在线免费观看| 美国免费高清一级毛片| 99久久亚洲综合精品成人网| 亚洲AV日韩精品一区二区三区| 久久免费看黄a级毛片| fc2成年免费共享视频18| 亚洲人配人种jizz| 久久亚洲AV无码精品色午夜麻| 日日操夜夜操免费视频| 18禁成人网站免费观看 | 中文字幕人成无码免费视频| 二个人看的www免费视频| 亚洲成a人无码亚洲成www牛牛 | 亚洲精品午夜无码电影网| 免费观看的av毛片的网站| 精品一区二区三区免费毛片爱| 曰韩无码AV片免费播放不卡 | 亚洲日本VA中文字幕久久道具| 亚洲精品私拍国产福利在线| 亚洲日韩中文在线精品第一| 四虎影院免费在线播放| 美女视频黄免费亚洲| 中文字幕视频免费| 国产精品白浆在线观看免费| jizz18免费视频|