<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 閱讀(275) 評論(0)  編輯  收藏


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


    網站導航:
     
    主站蜘蛛池模板: 成人奭片免费观看| 猫咪免费人成在线网站| 国产成人亚洲精品无码AV大片| A毛片毛片看免费| 精品国产免费一区二区| 亚洲国产美女福利直播秀一区二区| 美女视频黄的免费视频网页 | 毛片免费vip会员在线看| 亚洲日产无码中文字幕| a毛片在线还看免费网站| 伊人久久综在合线亚洲2019| 亚洲美女视频免费| 免费无码午夜福利片| 亚洲一区精品伊人久久伊人| eeuss影院ss奇兵免费com| 亚洲美女大bbbbbbbbb| 亚洲AV无码成人精品区大在线| 久久免费香蕉视频| 国产猛男猛女超爽免费视频| 91成人在线免费视频| 亚洲AV日韩AV一区二区三曲| 亚洲乱码中文字幕久久孕妇黑人| 91精品国产免费久久国语麻豆| 久久精品免费观看| 在线视频免费观看高清| 91福利视频免费观看| 天堂在线免费观看中文版| 久久久久成人片免费观看蜜芽| 亚洲国产成人久久综合| 亚洲一区在线视频| 亚洲Aⅴ无码专区在线观看q| 亚洲色精品88色婷婷七月丁香| 在线观看亚洲人成网站| 91亚洲精品自在在线观看| 中文字幕亚洲综合久久2| 亚洲情A成黄在线观看动漫软件 | 无码视频免费一区二三区| 亚洲精品高清在线| 成人免费视频国产| 亚洲国产精品狼友中文久久久| 亚洲精品乱码久久久久66|