]> granicus.if.org Git - yasm/log
yasm
17 years agoSupport "oword", "do", and "reso" as aliases for "dqword", "ddq", and
Peter Johnson [Wed, 19 Sep 2007 02:52:33 +0000 (02:52 -0000)]
Support "oword", "do", and "reso" as aliases for "dqword", "ddq", and
"resdq" respectively, for compatibility with NASM (sigh).

svn path=/trunk/yasm/; revision=1962

17 years agoMake Python messages a little less threatening.
Peter Johnson [Tue, 18 Sep 2007 08:34:57 +0000 (08:34 -0000)]
Make Python messages a little less threatening.

Suggested by: Brian Gladman

svn path=/trunk/yasm/; revision=1960

17 years agoRemove unused variable.
Peter Johnson [Tue, 18 Sep 2007 05:38:06 +0000 (05:38 -0000)]
Remove unused variable.

svn path=/trunk/yasm/; revision=1959

17 years agoFix VC++ build order dependencies.
Peter Johnson [Tue, 18 Sep 2007 05:22:07 +0000 (05:22 -0000)]
Fix VC++ build order dependencies.
Patch by: mu@

svn path=/trunk/yasm/; revision=1958

17 years agoEnsure Python is available before trying to run gen_x86_insn.py.
Peter Johnson [Tue, 18 Sep 2007 02:33:31 +0000 (02:33 -0000)]
Ensure Python is available before trying to run gen_x86_insn.py.
Use registry key search to avoid version/location dependency.

Noticed by: Brian Gladman  <brg@gladman.plus.com>

svn path=/trunk/yasm/; revision=1957

17 years agoInclude ctype.h into files that now use tolower().
Peter Johnson [Mon, 17 Sep 2007 03:42:01 +0000 (03:42 -0000)]
Include ctype.h into files that now use tolower().

svn path=/trunk/yasm/; revision=1956

17 years agoMake CPU feature flags and registers case insensitive again.
Peter Johnson [Mon, 17 Sep 2007 02:58:05 +0000 (02:58 -0000)]
Make CPU feature flags and registers case insensitive again.
This was accidentally removed in [1929].
Add test case for these so it doesn't happen again.

svn path=/trunk/yasm/; revision=1955

17 years agoAdd support for IEEE-754r "half precision" (16-bit) float format.
Peter Johnson [Sun, 16 Sep 2007 20:41:16 +0000 (20:41 -0000)]
Add support for IEEE-754r "half precision" (16-bit) float format.
This format is used by SSE5.
Update minor tests; more extensive tests will be added soon.

svn path=/trunk/yasm/; revision=1954

17 years agoAdd SSE5 (new AMD SSE) instructions support.
Peter Johnson [Sun, 16 Sep 2007 20:29:59 +0000 (20:29 -0000)]
Add SSE5 (new AMD SSE) instructions support.

svn path=/trunk/yasm/; revision=1953

17 years agoFix #114: Incorrect ELF32 ..gotpc address calculation.
Peter Johnson [Sat, 15 Sep 2007 06:40:27 +0000 (06:40 -0000)]
Fix #114: Incorrect ELF32 ..gotpc address calculation.
Reported by: Loren Merritt
Fix by: mu@

We already had a testcase for this, but it had an incorrect "golden" result.

svn path=/trunk/yasm/; revision=1952

17 years agoFinish cleanup made in [1948].
Peter Johnson [Fri, 14 Sep 2007 05:19:10 +0000 (05:19 -0000)]
Finish cleanup made in [1948].

svn path=/trunk/yasm/; revision=1951

17 years agoSwitch x86 operand storage from manual bitfields to C structure bitfields.
Peter Johnson [Thu, 13 Sep 2007 07:26:17 +0000 (07:26 -0000)]
Switch x86 operand storage from manual bitfields to C structure bitfields.

svn path=/trunk/yasm/; revision=1950

17 years agoChange modifiers from a prioritized shifted sequence into an ordered array.
Peter Johnson [Thu, 13 Sep 2007 06:35:24 +0000 (06:35 -0000)]
Change modifiers from a prioritized shifted sequence into an ordered array.
Move GAS suffixes to a separate field in x86_insn_info rather than
having them embedded in the modifier field.

svn path=/trunk/yasm/; revision=1949

17 years agoNow that part of the build uses just Python, break apart the Python
Peter Johnson [Thu, 13 Sep 2007 02:53:30 +0000 (02:53 -0000)]
Now that part of the build uses just Python, break apart the Python
and Pyrex (only required for bindings) checks.

svn path=/trunk/yasm/; revision=1948

17 years agoAdd Id tag.
Peter Johnson [Wed, 12 Sep 2007 07:11:42 +0000 (07:11 -0000)]
Add Id tag.

svn path=/trunk/yasm/; revision=1947

17 years agoNow that we have more cpu feature bits, properly document SSE4a as such.
Peter Johnson [Wed, 12 Sep 2007 07:10:26 +0000 (07:10 -0000)]
Now that we have more cpu feature bits, properly document SSE4a as such.
Also correct name of k8 chip (clawhammer) and add venice, k10 processors.

svn path=/trunk/yasm/; revision=1946

17 years agoRestructure x86 CPU handling to allow for more than 30 CPU feature flags.
Peter Johnson [Wed, 12 Sep 2007 06:55:51 +0000 (06:55 -0000)]
Restructure x86 CPU handling to allow for more than 30 CPU feature flags.

svn path=/trunk/yasm/; revision=1945

17 years agoRun gen_x86_insn.py from vc and vc8 builds.
Peter Johnson [Wed, 12 Sep 2007 04:15:33 +0000 (04:15 -0000)]
Run gen_x86_insn.py from vc and vc8 builds.
Users who build out of SVN will need to install Python, but this is painless even for
Windows users
(go to http://www.python.org/download/ and download and install the appropriate MSI)

Delete generated files from SVN; these are massive and annoying to keep updated
(massive diffs).

svn path=/trunk/yasm/; revision=1944

17 years agoShrink the size of the x86_insn_info structure, particularly on 64-bit
Peter Johnson [Tue, 11 Sep 2007 04:49:53 +0000 (04:49 -0000)]
Shrink the size of the x86_insn_info structure, particularly on 64-bit
systems, by combining operand lists into a single array (and trying to find
overlaps where possible).  This saves about 4K even on a 32-bit system.

Also shrink the generated gperf code by outputting the number of info
structures directly rather than using NELEMS().

svn path=/trunk/yasm/; revision=1943

17 years agoNow that genperf takes an output filename, change informational outputs
Peter Johnson [Tue, 11 Sep 2007 02:11:19 +0000 (02:11 -0000)]
Now that genperf takes an output filename, change informational outputs
to stdout instead of stderr.

svn path=/trunk/yasm/; revision=1942

17 years agoChange genperf to take input and output filenames rather than outputting to
Peter Johnson [Mon, 10 Sep 2007 07:15:50 +0000 (07:15 -0000)]
Change genperf to take input and output filenames rather than outputting to
standard output.  This makes for better error handling behavior with make
(redirecting the standard output could leave empty files behind on error).

svn path=/trunk/yasm/; revision=1939

17 years agoCheck in generated files from the Python script added in [1937].
Peter Johnson [Mon, 10 Sep 2007 07:03:53 +0000 (07:03 -0000)]
Check in generated files from the Python script added in [1937].

While I prefer not to have generated files in the source repository,
do this for now in the interest of sanity on the Windows side (to allow
building directly from a SVN checkout).

An alternative might be to require Python on Windows when building from
SVN.  If at some point we decide to go that route, it will be easy enough
to remove these files and add the necessary bits to Mkfiles/vc and
Mkfiles/vc8.

svn path=/trunk/yasm/; revision=1938

17 years agoChange x86 instruction tables to be automatically generated.
Peter Johnson [Mon, 10 Sep 2007 06:59:47 +0000 (06:59 -0000)]
Change x86 instruction tables to be automatically generated.
This combines the C and perfect hash tables into a single source file,
and allows for easier future changes to the source-level structures.

The Python-built files are included in the distribution so that Python
is not added as a dependency.

The generated code has been verified equal against the old tables,
excepting a number of bugfixes.

Most of the bugs fixed are in the CPU field, plus a few GAS suffix fixes.

svn path=/trunk/yasm/; revision=1937

17 years agoRe-enable lc3b in flat Mkfiles.
Peter Johnson [Sat, 8 Sep 2007 02:19:33 +0000 (02:19 -0000)]
Re-enable lc3b in flat Mkfiles.

svn path=/trunk/yasm/; revision=1933

17 years agoWindows build fixes:
Peter Johnson [Sat, 8 Sep 2007 02:13:25 +0000 (02:13 -0000)]
Windows build fixes:
* modules.vcproj: Add x86cpu.c, x86regtmod.c, and lc3b arch files to fix build.
* x85geninsn.c: Clean up a couple of unused variables.
* genperf.c: Use sprintf instead of snprintf; convert filename backslashes to slashes.

svn path=/trunk/yasm/; revision=1932

17 years agoFix a couple of Doxygen nits.
Peter Johnson [Sat, 8 Sep 2007 01:34:51 +0000 (01:34 -0000)]
Fix a couple of Doxygen nits.

svn path=/trunk/yasm/; revision=1931

17 years agoBring Mkfiles up to date with [1929].
Peter Johnson [Sat, 8 Sep 2007 00:04:08 +0000 (00:04 -0000)]
Bring Mkfiles up to date with [1929].

svn path=/trunk/yasm/; revision=1930

17 years agoBreak apart perfect hash lookup generation and x86 arch-specific
Peter Johnson [Fri, 7 Sep 2007 22:05:33 +0000 (22:05 -0000)]
Break apart perfect hash lookup generation and x86 arch-specific
instruction handling.

Use the GNU gperf file format, but continue to use our custom minimal
perfect hash generator.

svn path=/trunk/yasm/; revision=1929

17 years agoUnbreak distcheck in lc3b tests.
Peter Johnson [Fri, 7 Sep 2007 22:03:34 +0000 (22:03 -0000)]
Unbreak distcheck in lc3b tests.

svn path=/trunk/yasm/; revision=1928

17 years agoUnbreak distcheck when Python is available by pulling in bitvect.h.
Peter Johnson [Fri, 7 Sep 2007 21:49:35 +0000 (21:49 -0000)]
Unbreak distcheck when Python is available by pulling in bitvect.h.

svn path=/trunk/yasm/; revision=1927

17 years agoUnbitrot lc3b architecture.
Peter Johnson [Mon, 20 Aug 2007 05:13:35 +0000 (05:13 -0000)]
Unbitrot lc3b architecture.
Requested by: Paul Barker <paulbarker@mailsnare.net>

svn path=/trunk/yasm/; revision=1914

17 years agoSet value->sign appropriately instead of ineffective passing of -1 to
Peter Johnson [Mon, 20 Aug 2007 05:11:11 +0000 (05:11 -0000)]
Set value->sign appropriately instead of ineffective passing of -1 to
output_value().

svn path=/trunk/yasm/; revision=1913

17 years agoFix warning documentation to match behavior of yasm_value_output_basic().
Peter Johnson [Mon, 20 Aug 2007 05:10:26 +0000 (05:10 -0000)]
Fix warning documentation to match behavior of yasm_value_output_basic().

svn path=/trunk/yasm/; revision=1912

17 years agoGAS parser: Push down directive lookup to parser to simplify tokenizer.
Peter Johnson [Sun, 19 Aug 2007 23:59:08 +0000 (23:59 -0000)]
GAS parser: Push down directive lookup to parser to simplify tokenizer.

svn path=/trunk/yasm/; revision=1910

17 years agoAdd support for the following AMD instructions added in their July 2007
Peter Johnson [Thu, 16 Aug 2007 05:50:59 +0000 (05:50 -0000)]
Add support for the following AMD instructions added in their July 2007
documentation update:
 - LZCNT
 - POPCNT
 - EXTRQ
 - INSERTQ
 - MOVNTSD
 - MOVNTSS

This required some new tricks in the x86 code, as EXTRQ and INSERTQ have
two imm8 parameters (the first one of which goes into the EA field), and
INSERTQ has a *4* parameter version (xmm1, xmm2, imm8, imm8).  Instead of
globally making the structures 4 wide, we just special-case INSERTQ.

svn path=/trunk/yasm/; revision=1909

17 years agoUpdate yasm.rules so that it's compatible with the Intel compiler.
Peter Johnson [Fri, 10 Aug 2007 16:56:13 +0000 (16:56 -0000)]
Update yasm.rules so that it's compatible with the Intel compiler.

Contributed by: Brian Gladman <brg@gladman.plus.com>

svn path=/trunk/yasm/; revision=1908

17 years agoFix #112: Use yasm__strcasecmp instead of strcasecmp.
Peter Johnson [Sun, 5 Aug 2007 16:44:07 +0000 (16:44 -0000)]
Fix #112: Use yasm__strcasecmp instead of strcasecmp.

svn path=/trunk/yasm/; revision=1907

17 years agoFix typo in VC7 modules.vcproj.
Peter Johnson [Thu, 2 Aug 2007 02:55:13 +0000 (02:55 -0000)]
Fix typo in VC7 modules.vcproj.

Reported by: Stefan Sellmer <stefansel@hotmail.de>

svn path=/trunk/yasm/; revision=1906

17 years agoHAMT: Update stored key when building tree downwards from identical keys.
Peter Johnson [Wed, 1 Aug 2007 05:14:53 +0000 (05:14 -0000)]
HAMT: Update stored key when building tree downwards from identical keys.
Not doing this could cause us to lose an entry if the tree is deep enough
that we need to rehash the keys as we're moving downward.

Reported by: Stefan Sellmer <stefansel@hotmail.de>

svn path=/trunk/yasm/; revision=1905

17 years agoFix #111: Correctly #define HAVE__STRICMP for vc and vc8.
Peter Johnson [Wed, 1 Aug 2007 04:08:04 +0000 (04:08 -0000)]
Fix #111: Correctly #define HAVE__STRICMP for vc and vc8.

Reported by: Brian Gladman

svn path=/trunk/yasm/; revision=1904

17 years agoFix two bugs in HAMT:
Peter Johnson [Tue, 31 Jul 2007 04:53:22 +0000 (04:53 -0000)]
Fix two bugs in HAMT:
 - HAMT_search() wasn't doing a full string comparison on the key before
   returning success.
 - HAMT_insert()'s check for the above was always doing a case-sensitive
   check; fixed to use case-insensitive when the HAMT is supposed to be
   case-insensitive (and likewise for HAMT_search).

svn path=/trunk/yasm/; revision=1903

17 years agoAdd command line option aliases for -d (to -D) and -u (to -U) for
Peter Johnson [Sun, 29 Jul 2007 06:11:47 +0000 (06:11 -0000)]
Add command line option aliases for -d (to -D) and -u (to -U) for
compatibility with NASM command line.

Requested by: Mike Frysinger <vapier@gentoo.org>

svn path=/trunk/yasm/; revision=1902

17 years agoUse intnum_tobv() in a couple more places.
Peter Johnson [Thu, 26 Jul 2007 07:36:05 +0000 (07:36 -0000)]
Use intnum_tobv() in a couple more places.

svn path=/trunk/yasm/; revision=1901

17 years agoChange intnum so it stores long instead of unsigned long; this allows
Peter Johnson [Thu, 26 Jul 2007 06:55:27 +0000 (06:55 -0000)]
Change intnum so it stores long instead of unsigned long; this allows
intnum to not allocate bitvectors for "most" negative numbers.

We pay a bit more in conversion, but save big in terms of memory and
malloc/free calls
(e.g. ~10,000 allocations and ~250K bytes for elf-x86id.asm test).

svn path=/trunk/yasm/; revision=1900

17 years agoAdd support for second parameter (fill value) to .org directive in GAS
Peter Johnson [Fri, 20 Jul 2007 03:40:59 +0000 (03:40 -0000)]
Add support for second parameter (fill value) to .org directive in GAS
parser.

Add testcase for both local labels and .org fill.

Noticed by: Jung Lee <moorang@gmail.com>
Testcase from: Xiaoming Mo <xiaoming.mo@skelix.org>

svn path=/trunk/yasm/; revision=1899

17 years agoAdd support for GAS local labels (1:, 1f, 1b).
Peter Johnson [Fri, 20 Jul 2007 03:28:24 +0000 (03:28 -0000)]
Add support for GAS local labels (1:, 1f, 1b).

Noticed by: Jung Lee <moorang@gmail.com>

svn path=/trunk/yasm/; revision=1898

17 years agoDoxygen documentation fixes.
Peter Johnson [Mon, 16 Jul 2007 04:42:02 +0000 (04:42 -0000)]
Doxygen documentation fixes.

svn path=/trunk/yasm/; revision=1897

17 years agoDon't use an inner structure for line mappings.
Peter Johnson [Sun, 15 Jul 2007 21:54:11 +0000 (21:54 -0000)]
Don't use an inner structure for line mappings.
Fix a nit in yasm_linemap_poke() for the case when set() has not been
called before calling this function; the prior behavior could result
in incorrect line numbers due to not properly adjusting the new line
number.

svn path=/trunk/yasm/; revision=1896

17 years agoMerge expr-int.h into expr.h, removing YASM_EXPR_INTERNAL in the process.
Peter Johnson [Sat, 14 Jul 2007 05:31:08 +0000 (05:31 -0000)]
Merge expr-int.h into expr.h, removing YASM_EXPR_INTERNAL in the process.

svn path=/trunk/yasm/; revision=1895

17 years agoMerge bc-int.h into bytecode.h, removing YASM_BC_INTERNAL in the process.
Peter Johnson [Sat, 14 Jul 2007 04:34:41 +0000 (04:34 -0000)]
Merge bc-int.h into bytecode.h, removing YASM_BC_INTERNAL in the process.

svn path=/trunk/yasm/; revision=1894

17 years agoRemove YASM_LIB_INTERNAL. It never really gained us that much in terms of
Peter Johnson [Sat, 14 Jul 2007 03:11:32 +0000 (03:11 -0000)]
Remove YASM_LIB_INTERNAL.  It never really gained us that much in terms of
visibility savings, as basically everything defined it.

svn path=/trunk/yasm/; revision=1893

17 years agoClean up a number of obsolete autoconf-detected standard C things.
Peter Johnson [Fri, 13 Jul 2007 20:56:28 +0000 (20:56 -0000)]
Clean up a number of obsolete autoconf-detected standard C things.

svn path=/trunk/yasm/; revision=1892

17 years agoBring Mkfiles up-to-date with [1889].
Peter Johnson [Fri, 13 Jul 2007 17:34:21 +0000 (17:34 -0000)]
Bring Mkfiles up-to-date with [1889].

svn path=/trunk/yasm/; revision=1891

17 years agoBring POTFILES.in up to date.
Peter Johnson [Fri, 13 Jul 2007 17:29:59 +0000 (17:29 -0000)]
Bring POTFILES.in up to date.

svn path=/trunk/yasm/; revision=1890

17 years agoChange handling of frontend (mnenomic) instructions to make it easier to
Peter Johnson [Sun, 8 Jul 2007 05:31:59 +0000 (05:31 -0000)]
Change handling of frontend (mnenomic) instructions to make it easier to
customize on the arch side of things.  Instead of passing around an
arch_data[4] for instructions, now the arch can extend the structure itself
to add additional information in any format it likes.

svn path=/trunk/yasm/; revision=1889

17 years agoProperly mark yasm_arch->create() error parameter as an output param.
Peter Johnson [Sat, 30 Jun 2007 20:19:20 +0000 (20:19 -0000)]
Properly mark yasm_arch->create() error parameter as an output param.

svn path=/trunk/yasm/; revision=1888

17 years agoUpdate splint script.
Peter Johnson [Sat, 30 Jun 2007 20:18:50 +0000 (20:18 -0000)]
Update splint script.

svn path=/trunk/yasm/; revision=1887

17 years agoOptimize negating a simple intnum.
Peter Johnson [Sat, 30 Jun 2007 19:46:36 +0000 (19:46 -0000)]
Optimize negating a simple intnum.

svn path=/trunk/yasm/; revision=1886

17 years agoFix buglet in handling of SEG of SEG:OFF. We were deleting the term at
Peter Johnson [Mon, 25 Jun 2007 01:05:04 +0000 (01:05 -0000)]
Fix buglet in handling of SEG of SEG:OFF.  We were deleting the term at
the wrong level.  As we weren't changing numterms before either, this
really could have no effect other than not freeing the memory immediately
(it would be freed later).

svn path=/trunk/yasm/; revision=1885

17 years agoFix default filename buffer overflow.
Peter Johnson [Sat, 23 Jun 2007 00:19:57 +0000 (00:19 -0000)]
Fix default filename buffer overflow.
Note: this is not a security issue.

Noticed by: Mike Frysinger <vapier@gentoo.org>

svn path=/trunk/yasm/; revision=1884

17 years agoRemove errant else. This should not have had any serious effects, as
Peter Johnson [Sun, 10 Jun 2007 03:44:27 +0000 (03:44 -0000)]
Remove errant else.  This should not have had any serious effects, as
combining IP-relative and shifts is very unusual (and probably not possible).

svn path=/trunk/yasm/; revision=1883

17 years agoFix bin objfmt handling of cross-section RIP-relative values; also clean
Peter Johnson [Mon, 4 Jun 2007 01:12:37 +0000 (01:12 -0000)]
Fix bin objfmt handling of cross-section RIP-relative values; also clean
up absolute value handling.

svn path=/trunk/yasm/; revision=1878

17 years agoMake sure objfmt_coff->win64 gets set to 0 in win32 mode.
Peter Johnson [Sat, 2 Jun 2007 08:34:40 +0000 (08:34 -0000)]
Make sure objfmt_coff->win64 gets set to 0 in win32 mode.

svn path=/trunk/yasm/; revision=1873

17 years agoFix uninitialized variable, memory leak.
Peter Johnson [Sat, 2 Jun 2007 08:23:29 +0000 (08:23 -0000)]
Fix uninitialized variable, memory leak.

svn path=/trunk/yasm/; revision=1872

17 years agoCorrect CPU definitions for Prescott, Conroe, Penryn, and Nehalem.
Peter Johnson [Sat, 2 Jun 2007 05:21:33 +0000 (05:21 -0000)]
Correct CPU definitions for Prescott, Conroe, Penryn, and Nehalem.
All are 64-bit capable and thus should set CPU_Hammer; Prescott
was mistakingly also setting AMD features such as 3DNow.

svn path=/trunk/yasm/; revision=1870

17 years agoDon't try to yasm_expr_copy(NULL).
Peter Johnson [Fri, 1 Jun 2007 19:44:38 +0000 (19:44 -0000)]
Don't try to yasm_expr_copy(NULL).

Found by: zzuf

svn path=/trunk/yasm/; revision=1867

17 years agoFix use-after-free in linemap_poke. The first yasm_linemap_set call can
Peter Johnson [Fri, 1 Jun 2007 19:39:29 +0000 (19:39 -0000)]
Fix use-after-free in linemap_poke.  The first yasm_linemap_set call can
realloc linemap->map->vector, invalidating the mapping pointer.

Found by: zzuf+valgrind

svn path=/trunk/yasm/; revision=1866

17 years agoFix a few bugs in new directive handling.
Peter Johnson [Fri, 1 Jun 2007 19:31:00 +0000 (19:31 -0000)]
Fix a few bugs in new directive handling.

Found by: zzuf

svn path=/trunk/yasm/; revision=1865

17 years agoFix typo in filename reference in [1853].
Peter Johnson [Thu, 31 May 2007 06:16:49 +0000 (06:16 -0000)]
Fix typo in filename reference in [1853].

svn path=/trunk/yasm/; revision=1854

17 years agoFix #102: Permit non-standard macho section names.
Peter Johnson [Mon, 28 May 2007 08:52:18 +0000 (08:52 -0000)]
Fix #102: Permit non-standard macho section names.

Two forms are legal ({} are replaceables):
SECTION {segname} {sectname}
SECTION {sectname} segname={segname}
Also,
SECTION {sectname}
where sectname is unrecognized is also legal, defaults segname to __TEXT,
and generates a warning.

Contributed by: bird-yasm@anduin.net

svn path=/trunk/yasm/; revision=1852

17 years agoClean up directive handling. This standardizes error/warning messages and
Peter Johnson [Sat, 26 May 2007 17:56:36 +0000 (17:56 -0000)]
Clean up directive handling.  This standardizes error/warning messages and
makes value/parameters more well-defined and flexible enough to handle
string parameters.  Value/parameters would now be better called name/values,
but avoid changing the name for now.

svn path=/trunk/yasm/; revision=1851

17 years agoSupport .set in GAS parser.
Peter Johnson [Sat, 26 May 2007 17:39:42 +0000 (17:39 -0000)]
Support .set in GAS parser.

Contributed by: Sebastian D'Alessandro <sejawoya@yahoo.com.ar>

svn path=/trunk/yasm/; revision=1850

17 years agoFix issue with [1843]; we can't use strlen() here as we can be given
Peter Johnson [Sun, 20 May 2007 19:50:04 +0000 (19:50 -0000)]
Fix issue with [1843]; we can't use strlen() here as we can be given
an unterminated input string.

svn path=/trunk/yasm/; revision=1849

17 years agoFix yasm__xstrdup() for the case when the destination is larger than the
Peter Johnson [Fri, 18 May 2007 21:11:46 +0000 (21:11 -0000)]
Fix yasm__xstrdup() for the case when the destination is larger than the
source.

svn path=/trunk/yasm/; revision=1843

17 years agoMove absolute section handling into NASM parser, removing all traces of it
Peter Johnson [Tue, 15 May 2007 07:27:26 +0000 (07:27 -0000)]
Move absolute section handling into NASM parser, removing all traces of it
from libyasm core.  Now absolute sections are tracked locally to the parser
and the parser generates EQUs directly for labels in absolute sections.

Fixes #106 and #103.

svn path=/trunk/yasm/; revision=1842

17 years agoUpdated testcase result to match [1840] missed in that commit.
Peter Johnson [Tue, 15 May 2007 06:26:52 +0000 (06:26 -0000)]
Updated testcase result to match [1840] missed in that commit.

svn path=/trunk/yasm/; revision=1841

17 years agoFix handling of SVM (AMD Pacifica) instructions that take an implicit
Peter Johnson [Tue, 15 May 2007 06:25:56 +0000 (06:25 -0000)]
Fix handling of SVM (AMD Pacifica) instructions that take an implicit
rax/eax/ax operand.  This operand actually selects the address size, so
make it a memory operand instead of a register operand (GAS follows this
approach as well).  Enable SVM instructions in non-64-bit mode as well.

Now the following opcodes work as intended:
 invlpga [rax/eax/ax], ecx
 skinit [eax]
 vmload/vmrun/vmsave [rax/eax/ax]

Noticed by: arkon@ragestorm.net
MFC after: 2 days

svn path=/trunk/yasm/; revision=1840

17 years agoClean up expect_() in both parsers. In the nasm parser we were passing a
Peter Johnson [Sun, 13 May 2007 19:55:54 +0000 (19:55 -0000)]
Clean up expect_() in both parsers.  In the nasm parser we were passing a
raw string as a printf string which could have resulted in a random memory
access.

svn path=/trunk/yasm/; revision=1839

17 years agoFix #107: Float input "1.000000" hit an edge case in the code that caused
Peter Johnson [Fri, 11 May 2007 02:19:36 +0000 (02:19 -0000)]
Fix #107: Float input "1.000000" hit an edge case in the code that caused
the rounding increment at the end of float conversion to wrap the mantissa
from all 1's to 0, resulting in an incorrect result.

svn path=/trunk/yasm/; revision=1836

17 years agoFix handling of SSE4 crc opcodes with 64-bit register operands.
Peter Johnson [Wed, 9 May 2007 04:31:19 +0000 (04:31 -0000)]
Fix handling of SSE4 crc opcodes with 64-bit register operands.
Noticed by: arkon@ragestorm.net

Fix bug relating to recognizing crc32 rax, bh as an error: the opersize=64
changing into REX prefix was happening too late to be caught as an error.
Move this logic from tobytes()/len() functions into finalize(), with proper
prefix handling.

MFC after: 2 days

svn path=/trunk/yasm/; revision=1835

17 years agoAdd copyright and license text to GAP input file.
Peter Johnson [Mon, 30 Apr 2007 01:08:34 +0000 (01:08 -0000)]
Add copyright and license text to GAP input file.

svn path=/trunk/yasm/; revision=1831

17 years agoAdd SSE4.1 and SSE4.2 instructions.
Peter Johnson [Mon, 30 Apr 2007 00:53:22 +0000 (00:53 -0000)]
Add SSE4.1 and SSE4.2 instructions.

Noticed by: arkon@ragestorm.net

svn path=/trunk/yasm/; revision=1830

17 years agoRename sse4 test to ssse3, to make way for the real SSE4.
Peter Johnson [Mon, 30 Apr 2007 00:25:41 +0000 (00:25 -0000)]
Rename sse4 test to ssse3, to make way for the real SSE4.

svn path=/trunk/yasm/; revision=1829

17 years agoCall yasm_symtab_parser_finalize() from parser so caller doesn't need to
Peter Johnson [Mon, 23 Apr 2007 04:53:01 +0000 (04:53 -0000)]
Call yasm_symtab_parser_finalize() from parser so caller doesn't need to
figure out itself if undef should be changed into extern or not.

svn path=/trunk/yasm/; revision=1828

17 years agoUpdate all copyright dates.
Peter Johnson [Sun, 22 Apr 2007 05:09:49 +0000 (05:09 -0000)]
Update all copyright dates.

svn path=/trunk/yasm/; revision=1827

17 years agoExpand tabs to spaces.
Peter Johnson [Sun, 22 Apr 2007 04:59:36 +0000 (04:59 -0000)]
Expand tabs to spaces.

svn path=/trunk/yasm/; revision=1826

17 years agoBite the bullet and convert tabs to spaces. Previously yasm's source has
Peter Johnson [Sun, 22 Apr 2007 03:32:46 +0000 (03:32 -0000)]
Bite the bullet and convert tabs to spaces.  Previously yasm's source has
been using a mix of tabs and 4 spaces to indent; this looks horrible if
tab size is ever not 8.  While I debated converting to tab-only indentation
that would have been a far higher impact to the source.

svn path=/trunk/yasm/; revision=1825

17 years agoAdd end_prolog macro (maps to [endprolog]) in addition to end_prologue.
Peter Johnson [Sat, 14 Apr 2007 20:01:16 +0000 (20:01 -0000)]
Add end_prolog macro (maps to [endprolog]) in addition to end_prologue.

Suggested by: Brian Gladman

svn path=/trunk/yasm/; revision=1823

17 years agoFix #104 by removing obsolete comment about -m amd64 not setting BITS=64.
Peter Johnson [Sat, 14 Apr 2007 19:55:45 +0000 (19:55 -0000)]
Fix #104 by removing obsolete comment about -m amd64 not setting BITS=64.

svn path=/trunk/yasm/; revision=1822

17 years agoUnbreak Windows build by using yasm__strcasecmp instead of strcasecmp.
Peter Johnson [Fri, 23 Mar 2007 04:55:00 +0000 (04:55 -0000)]
Unbreak Windows build by using yasm__strcasecmp instead of strcasecmp.

Patch by: Chris tophe <cohika@gmail.com>

svn path=/trunk/yasm/; revision=1821

17 years agoFix a couple of doxygen comments.
Peter Johnson [Thu, 22 Mar 2007 05:46:59 +0000 (05:46 -0000)]
Fix a couple of doxygen comments.

svn path=/trunk/yasm/; revision=1820

17 years agoMassive update of directive handling, including handling of extern, global,
Peter Johnson [Wed, 21 Mar 2007 04:23:59 +0000 (04:23 -0000)]
Massive update of directive handling, including handling of extern, global,
and common declare.  The latter no longer passes through objfmt at parse time;
instead the objfmt must handle them at output time (objfmt-specific
extensions are parsed & stored by the parser).  Directives are now handled
using a list (with function pointers) rather than a single function entry
point.

svn path=/trunk/yasm/; revision=1819

17 years agohamt.c: Fix portability nit (uintptr_t & ~1UL) and make some minor cleanups.
Peter Johnson [Thu, 8 Mar 2007 06:05:20 +0000 (06:05 -0000)]
hamt.c: Fix portability nit (uintptr_t & ~1UL) and make some minor cleanups.

Backport in: 3 days

svn path=/trunk/yasm/; revision=1814

17 years agoUpdate doxygen comments.
Peter Johnson [Tue, 6 Mar 2007 06:58:55 +0000 (06:58 -0000)]
Update doxygen comments.

svn path=/trunk/yasm/; revision=1813

17 years agoRestructure yasm_object as the central clearing house for yasm_objfmt,
Peter Johnson [Mon, 5 Mar 2007 08:43:00 +0000 (08:43 -0000)]
Restructure yasm_object as the central clearing house for yasm_objfmt,
yasm_dbgfmt, and yasm_arch.  This eliminates a lot of redundant keeping
track of this information in the individual object and debug formats and
also simplifies a fair amount of code.

I'm still not happy with how arch gets passed around in output code, but
there may not be much of an alternative there.

While I'm here, clean up some unused variables and functions and re-enable
the warning for unused variables in configure.ac.

svn path=/trunk/yasm/; revision=1812

17 years agoMach-O object format: 0-fill unused portion of section and segment names
Peter Johnson [Sun, 4 Mar 2007 09:21:03 +0000 (09:21 -0000)]
Mach-O object format: 0-fill unused portion of section and segment names
in load commands.  This caused test miscompares on other platforms and
could conceivably cause yasm to crash by reading beyond proper boundaries
(but this is unlikely).  Functionally the output is the same.

Reported by: christophe.malvasio1@aliceadsl.fr

Backport in: 1 week

svn path=/trunk/yasm/; revision=1811

17 years agoMake symrec robust against defining a symbol both as a label and an equ,
Peter Johnson [Sun, 4 Mar 2007 02:32:38 +0000 (02:32 -0000)]
Make symrec robust against defining a symbol both as a label and an equ,
or as an equ multiple times.

Found by: zzuf (http://sam.zoy.org/zzuf/)

svn path=/trunk/yasm/; revision=1810

17 years agoGAS parser: fix unterminated string handling to properly handle EOF.
Peter Johnson [Sun, 4 Mar 2007 01:53:50 +0000 (01:53 -0000)]
GAS parser: fix unterminated string handling to properly handle EOF.

Found by: zzuf (http://sam.zoy.org/zzuf/)

svn path=/trunk/yasm/; revision=1809

17 years agoFix a couple of NULL pointer derefs.
Peter Johnson [Sun, 4 Mar 2007 01:00:01 +0000 (01:00 -0000)]
Fix a couple of NULL pointer derefs.

Found by: zzuf (http://sam.zoy.org/zzuf/)

svn path=/trunk/yasm/; revision=1808

17 years agoFollow the lead of GAS and change the prefix order to SEG, ADDR, DATA,
Peter Johnson [Fri, 2 Mar 2007 07:09:28 +0000 (07:09 -0000)]
Follow the lead of GAS and change the prefix order to SEG, ADDR, DATA,
LOCKREP.  According to mailing list traffic, Intel prefers this order
(apparently for SIMD?) and AMD doesn't care.

GAS commit by: H.J. Lu <hongjiu.lu@intel.com>

svn path=/trunk/yasm/; revision=1807