タグ

binaryに関するpetite_blueのブックマーク (4)

  • MessagePack: JSONをもっと速く、小さく。

    MessagePack for Actionscript3 (Flash, Flex and AIR). as3-msgpack was designed to work with the interfaces IDataInput and IDataOutput, thus the API might be easily connected with the native classes that handle binary data (such as ByteArray, Socket, FileStream and URLStream). Moreover, as3-msgpack is capable of decoding data from binary streams. Get started: http://loteixeira.github.io/lib/2013/08/

  • 2で割ることと3で割ること - Qiita

    この記事でお題にするのはCPUレジスタ上の整数除算です。以下、単に除算とも書きます。 除算は非常に高コストな演算なため、コンパイラは最適化によって、できるだけ整数除算を別の計算に置き換えようとします。 最適化ができる場合の一つとして、割る数が定数である場合があります。頭のいいコンパイラは、除算を乗算とビットシフト等を駆使した演算に置き換えます。この記事では、そういった最適化の背景にある理屈を部分的に解説します。 計算機環境としてはモダンなx86 CPUを仮定します。したがってレジスタは32/64ビットであり、負数は2の補数表現になっています。ある程度は他の命令セットでも通用する話になっているかもしれません。 そもそも整数の除算とは プログラミングにおける整数の除算の定義について確認します。整数$n$を整数$d$で割るとき $$ n = q \times d + r $$ が成り立つように除

    2で割ることと3で割ること - Qiita
  • GNU lightning - GNU Project - Free Software Foundation

    Using and porting GNU lightning GNU lightning is a library that generates assembly language code at run-time; it is very fast, making it ideal for Just-In-Time compilers, and it abstracts over the target CPU, as it exposes to the clients a standardized RISC instruction set inspired by the MIPS and SPARC chips. Contribute GNU lightning is usable in complex code generation tasks. The available backe

    petite_blue
    petite_blue 2006/04/24
    仮想アセンブリコードを実行時に生成して実行
  • 更新履歴兼雑記 - C で curry 化 @x86

    http://nicosia.is.s.u-tokyo.ac.jp/pub/essay/hagiya/h/curry を Sun から x86 に。 C言語は便利で楽しいなあ、と思わざる得ないのである。 に激しく同意なのです。 #include <stdio.h> #include <stdlib.h> #include <sys/mman.h> int (*curry(int (*F)(), int A))() { char *code = (char*)malloc(18); *(char*)code = 0x55; *(short int*)(code+1) = 0xe589; *(short int*)(code+3) = 0x75ff; *(char*)(code+5) = 0x08; *(char*)(code+6) = 0x6a; *(char*)(code+7) = (ch

    更新履歴兼雑記 - C で curry 化 @x86
    petite_blue
    petite_blue 2006/04/24
    実行時に関数を生成できるよ
  • 1