ããã«ã¡ã¯ãµã¤ãã¦ãºã»ã©ãã®å æã§ãã
ä»åã¯3æ30æ¥ã«éå¬ããããx86/x64æé©ååå¼·ä¼5ãã®æ¨¡æ§ã«ã¤ãã¦ãä¼ããã¾ãã
ããã°ã©ã éçºã«ããã¦ã¯ãéçºã®æ®µéã«ããã¦æ©ãããæé©åã¯æªãæ¬å½ã«å¿ è¦ã«ãªã£ã¦ããæå°éã ãè¡ããªããã¨è¨ããã¦ãã¾ãã ã¾ãä»ã©ãã®ã³ã³ãã¤ã©ã¯åªç§ãªã®ã§ãä¸æãªå°ç´°å·¥ã¯ããã«ã³ã³ãã¤ã©ã«ä»»ãã¦ããã®ãããã¨ãè¨ããã¦ãã¾ãã
ãã¡ããä¸è¬çã«ã¯ããã¯æ£ããã®ã§ãããæ®æ®µåç»ãé³å£°ãå©ç¨ããã¨ãã«ä½¿ããã¦ããã³ã¼ããã¯ããããä¸ã§ã®æ±ºæ¸æã«å©ç¨ãããæå·ã©ã¤ãã©ãªãªã©ã¯ã人ã®æã«ããã¢ã»ã³ããªè¨èªã§éçºããã¦ãããã¨ãå¤ãã®ãã¾ãäºå®ã§ãã
ç§ã主å¬ãã¦ãããã®åå¼·ä¼ã¯ããããä¸åãã®ã©ã¤ãã©ãªãéçºããã¨ãã«å¿ è¦ãªæè¡ãæ å ±ã®äº¤æã®ããã«è¡ã£ã¦ãã¾ãã ustreamã§éå»ã®ä¼ã®åç»ãå«ãã¦ã¿ããã¨ãã§ãã¾ãã
以ä¸ãããç´°ããå 容ãå«ã¿ã¾ãããä»åã®çºè¡¨ã«ã¤ãã¦ç°¡åã«è§£èª¬ãã¾ãã
LLVM ã»ãã·ã§ã³
æåã®ã»ãã·ã§ã³ã§ã¯ããã°ã©ã éçºåºç¤ã¨ãã¦æ³¨ç®ããã¦ããLLVMé¢ä¿ã®ãã®ã«ãã¾ããã LLVMã¯C++11æºæ 度ã®é«ãC/C++ã³ã³ãã¤ã©Clangã®ããã¯ã¨ã³ãã¨ãã¦ãå©ç¨ããã¦ãã¾ãã
æåã¯ç§ããLLVMå ¥éãã¨ããé¡ã§çºè¡¨ãã¾ãã(åç»1)ã LLVMã¯CPUãç°å¢ã«ä¾åããªãä»®æ³ãã·ã³ä¸ãã¿ã¼ã²ããã«ãã¦ããã®ã§ããã ãã®ä»®æ³ãã·ã³ä¸ã®LLVM IRã¢ã»ã³ãã©ã使ã£ã¦ç°¡åãªé¢æ°ãä½ãæ¹æ³ã«ã¤ãã¦èª¬æãã¾ããã
調ã¹ã¦ã¿ãã¨LLVMã¯é常ã«ããã§ãããã¬ã¼ã ã¯ã¼ã¯ã§ã¯ããã¾ãããç¾ç¶ã®ä»æ§ã§ã¯x86/x64ã§ã®carryå½ä»¤ãæ±ãã«ãããã¨ãåããã¾ããã ãã®ããããããå¤ç¨ããããã°ã©ã ã§ã¯é«éãªã³ã¼ãã¯æ¸ãã¥ããããã«æãã¾ããã
@maropuããã®çºè¡¨ã¯ãLLVMã§éã¶ï¼æ´æ°å§ç¸®ã¨ãx86åãã®èªååã¨ãï¼ãã§ãã(åç»2)ã æ´æ°å§ç¸®ã¯2005年以éãå¦ä¼ãªã©ã§æ´»çºã«æ°ããã¢ã«ã´ãªãºã ãå®è£ ãææ¡ããã¦ããããã§ãã maropuããã¯èªä½ã®æ´æ°å§ç¸®ã©ã¤ãã©ãªvpackerã§clangã使ã£ã¦èªåãã¯ãã«åã«é¢ããå®é¨ããã¾ããã èªåãã¯ãã«åããããã®ãªãã·ã§ã³ã注æç¹ãªã©ãç´¹ä»ããã¾ãããæ®å¿µãªããä»ã®ã¨ããgcc-4.8ã®èªåãã¯ãã«åã«ã¯å£ãããã§ãä»å¾ã®æå¾ ã ããã§ãã
@kazegusuriããã®çºè¡¨ã¯ã人éã§ããããLLVMããã¯ã¨ã³ãå ¥éãã§ãã(åç»3)ã kazegusuriããã¯ããã¤ãããã§ããããLLVMãï¼ææ¨é¤ å 風è¬ï¼ã®èè ã®ä¸äººã§ãã LLVM IRããå®éã®ã¿ã¼ã²ããCPUã®ã³ã¼ãã¸ã¨å¤æãæé©åãããã¾ã§ã®å¦çã®æµãã説æããã¾ããã LLVMã«æãå ¥ãããã¨ãããæé©åå¦çãã©ããªã£ã¦ããã®ã調ã¹ããã¨ãã«ãã®ãããªå ¨ä½åãææ¡ã§ããè³æã¯ã¨ã¦ãå½¹ã«ç«ã¤ã¨æãã¾ãã
x86/x64ç³» ã»ãã·ã§ã³
次ã®ã»ãã·ã§ã³ã¯x86/x64ç³»ã®è©±ã§ããã
éæ¨å麻åããã¯æå·ã®ç 究è ã§ãCamelliaãè¨è¨ããã768ãããã®ç´ å æ°å解ã§ä¸çè¨é²ãåºãããã¨ãããæ¹ã§ãã ä»åã®çºè¡¨ã¯ãAES-NI@Sandy Bridgeãã§ãã(åç»4)ã
å ±ééµæå·ã®ä¸ã¤ã§ããAESæå·ã¯åºã使ããã¦ããããé«éãªå¦çãæã¾ãã¾ãã x86/x64ã§ã¯NehalemãSandy Bridge以éã®CPUã§AESãå¦çããããã®å°ç¨å½ä»¤ï¼AES-NIï¼ãæè¼ããã¦ãã¾ãã æ®éã«å®è£ ããã¨11åã®å½ä»¤ã並ã¹ããããªãã®ã§ãããAES-NIã詳ãã調æ»ãã¦ã ã©ã®ãããªé åºã§ä»ã®å½ä»¤ãå ¥ããã¨æé«æ§è½ãåºãããã¨ããã話ãããã¾ããã OpenSSLã®å®è£ ãããé«éãªãã®ãããããããçè«éçå¤ã«ã¯éæããªãçç±ã«ã¤ãã¦èå¯ããã¦ãã¦ããªãæ¿ãå 容ã ã¨æãã¾ãã
w_oããã®çºè¡¨ã¯ããã¼ãã¦ã§ã¢ããªãã§ãããã§ãã(åç»5)ããã¼ãã¦ã§ã¢ããªãã§ããã¨ã¯loadå½ä»¤ãªã©ã®å±¥æ´ã調ã¹ã¦èªåçã«æ¬¡ã«èªãã¹ãå¤ãäºåã«ãã§ããããæ©è½ã®ãã¨ã§ãã ãã¾ãã¾ãªã³ã¼ãã§ãã³ããã¼ã¯ãããã¨ã§ãã®æ©è½ã®å¹æã確èªããã¦ãã¾ããã Intelã¯ãããããã¿ã¼ã³ã«ããã¦é«éåããããããªæ©è½ãå ¥ãã¦ããããã§ããæåã§ã®ããªãã§ããå½ä»¤ã®æ¿å ¥ã§å¹æãåºãçµé¨ããã¾ããªãã®ã§ããããã¼ãã¦ã§ã¢ã«ä»»ãã¦ããã°ããã®ããªã¨æãã¾ããã
@s5yataããã®çºè¡¨ã¯ãRemove Branches in BitVector Select Operationsï¼marisa 0.2.2ï¼ãã§ãã(åç»6)ã s5yataããã¯marisa-trieã¨ããå ¨ææ¤ç´¢ãªã©ãæ³å®ããã¡ã¢ãªå¹çã®ããæ¤ç´¢ã©ã¤ãã©ãªã®ä½è ã§ãã ä»åã¯ãã®ã©ã¤ãã©ãªã®ä¸ã®åºæ¬é¢æ°ã§ããselectã®å®è£ ææ³ã®ç´¹ä»ããã¦ããã ãã¾ããã SSSE3ã§å°å ¥ãããpshufbã使ã£ããã¼ãã«å¼ãã®ã¢ã¤ãã¢ãªã©ãã°ãããã£ãã§ãã
ARM ã»ãã·ã§ã³
ä»åã®åå¼·ä¼ã§ã¯å®é¨çã«x86/x64以å¤ã®è©±ã¨ãã¦æè¿ã¹ãã¼ããã©ã³ãªã©ã§å©ç¨ããã¦ããARMã«ã¤ãã¦ã®ã»ãã·ã§ã³ãå ¥ãã¦ã¿ã¾ããã
@takehiro_tããã®çºè¡¨ã¯ãx86ã¢ã»ã³ãã©ã¯ããã£ã¦ãã人ãARMãå¦ã³ã ãã¨ã¯ã¾ããã¡ãªã¨ãããã§ãã(åç»7)ã ä¸è¨ãARMãã¨è¨ã£ãã¨ãã«ä½ãæãã®ãã¨ããåºæ¬çãªè©±ããããã©ã°ã®æ±ããARMã®ç¹å¾´ã§ããæ¡ä»¶ä»ãå®è¡ãä»ã§ã¯åºæ¬çã«æ¨å¥¨ãããªãã å³å¤ã«é¢ããç´°ããå¶ç´ãªã©å¤å²ã«ããã£ããã£ã¼ããªè©±ã§ããã ããããARMã®åå¼·ãããã¨æã£ã¦ããã®ã§ã¨ã¦ãããããã²ã¼ã·ã§ã³ã«ãªãã¾ããã
@naturyããã®çºè¡¨ã¯ãARM NEONãã§ãã(åç»8)ãNEONã使ãå ´åãå®æ©ã§ãã試ããªãã®ã§éçºå¹çãæªããèªåã®ã¨ãã¥ã¬ã¼ã·ã§ã³é¢æ°ãç¨æããããã§ãã è¤æ°ã®åã«å¯¾å¿ããããã«ã大éã®ä¼¼ãé¢æ°ãä½æããªããã°ãªãã¾ããã æ®éãªãã¹ã¯ãªããè¨èªã§èªåçæããC++ã®templateã使ããããã¨ããã§ãããnaturyããã¯Boost.Preprocessorã試ãã¦ã¿ãã¨ããã¨ããã§ä¼å ´ã«ã©ããããèµ·ããã¾ããã
ã¯ãã¼ã¸ã³ã°ã»ãã·ã§ã³
æå¾ã¯x86/x64åãã«ã¾ãç§ãããã©ã°ãæã§ããã¨ããçºè¡¨ããã¾ãã(åç»9)ã
Westmereã¾ã§ã¯ãã©ã°ã¬ã¸ã¹ã¿ã®ä¾åé¢ä¿ã«ãããã¼ã·ã£ã«ã¬ã¸ã¹ã¿ã¹ãã¼ã«ã¯é常ã«éãã¨ããå¶ç´ãããã¾ãããæå·ãªã©ã§ä½¿ãããå¤åé·æ´æ°æ¼ç®å ç®ãå®è£ ããã¨ãã«ãã©ã°ãéé¿ããã®ã§ã¯ãªãjrcxzã¨ããå½ä»¤ã使ããã¨ã§éããªãä¾ã示ãã¾ãããã¾ãSandy Bridgeããã¯ãã®å¶ç´ãç·©ããªã£ã¦ããã·ã³ãã«ã§éãã³ã¼ãããããããã«ãªã£ã¦ãããã¨ãç´¹ä»ãã¾ããã
ãªã5æä¸æ¬ã«çºå£²äºå®ã®Haswellããã¯ããé«éã«ããããã«ãã©ã°ãå¤æ´ããªãå½ä»¤ç¾¤ã追å ããã¦ãã¾ãã ã¡ãªã¿ã«ã¹ã©ã¤ãå ï¼20ãã¼ã¸ï¼ã§ç´¹ä»ãã1024ãããã®å ç®ã³ã¼ãã¯ããã¨ãã°ãã¤ã³ãã«Â®ãã¤ã¯ãã¢ã¼ããã¯ãã£ã¼Sandy Bridgeåãã¯ã¼ã¯ãã¼ãã®æé©åãï¼53ãã¼ã¸ï¼ã®ä¾ãããéãåä½ããããã§ãã
ãããã«
ä»åããããããªã話ãèãã¦ã¨ã¦ãå å®ãã¦ãã¾ããã 次åã®éå¬æ¥ãªã©ã¯ã¾ã 決ã¾ã£ã¦ãã¾ãããããç§ã話ããã!ãã¨ããæ¹ãããã£ãããã¾ãããããã²ã¨ãç§ã®twitterã¢ã«ã¦ã³ã@herumiã¾ã§è¡¨æãã¦ãã ããã¨ãããããã§ãã ãããããé¡ããã¾ãã
æå¾ã«ãªãã¾ããããæ¯åä¼å ´æä¾ãç¡ç·LANå©ç¨ãããã³ustreamã®ä¸ç¶ããã¦ãã ãã£ã¦ããï¼æ ªï¼AXELL社ã®ã好æã«æè¬ãããã¾ãã