]> granicus.if.org Git - yasm/commit
Add support for LEB128 encoded integers (both signed and unsigned). This
authorPeter Johnson <peter@tortall.net>
Mon, 17 Oct 2005 07:43:16 +0000 (07:43 -0000)
committerPeter Johnson <peter@tortall.net>
Mon, 17 Oct 2005 07:43:16 +0000 (07:43 -0000)
commit1ddc1272d21a9f6758e7399c85a4814944772436
treed0cd1162972b5cf9f8e0800dc842081afda3daa8
parent8ab76706900f5f3186df95496a9dea9334ca8273
Add support for LEB128 encoded integers (both signed and unsigned).  This
is needed for the GAS .uleb128 and .sleb128 directives.

* intnum.c (yasm_intnum_sign): New signedness discovery function.
* intnum.h (yasm_intnum_sign): Prototype.

* intnum.c (yasm_intnum_get_leb128, yasm_intnum_size_leb128): New.
* intnum.h (yasm_intnum_get_leb128, yasm_intnum_size_leb128): Prototype.
* leb128_test.c: New test for intnum-level LEB128 functions.

* bytecode.c (bytecode_leb128): New bytecode and supporting functions.
(yasm_bc_create_leb128): New creation function.
* bytecode.h (yasm_bc_create_leb128): Prototype.

* gas-token.re: Recognize .uleb128 and .sleb128.
* gas-bison.y: Ditto.
(gas_define_leb128): New.
* leb128.asm: New test for GAS .uleb128 and .sleb128 directives.

svn path=/trunk/yasm/; revision=1287
12 files changed:
libyasm/bytecode.c
libyasm/bytecode.h
libyasm/intnum.c
libyasm/intnum.h
libyasm/tests/Makefile.inc
libyasm/tests/leb128_test.c [new file with mode: 0644]
modules/parsers/gas/gas-bison.y
modules/parsers/gas/gas-token.re
modules/parsers/gas/tests/Makefile.inc
modules/parsers/gas/tests/leb128.asm [new file with mode: 0644]
modules/parsers/gas/tests/leb128.errwarn [new file with mode: 0644]
modules/parsers/gas/tests/leb128.hex [new file with mode: 0644]