From d9a53ecd49e656e9d219642acb8f4d68c07e0d97 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 24 Feb 2007 06:22:32 +0000 Subject: [PATCH 001/585] Python bindings aren't stable enough for 0.6.x release. svn path=/branches/yasm-0.6.x/; revision=1788 --- Makefile.am | 7 - configure.ac | 44 - tools/Makefile.inc | 2 - tools/python-yasm/Makefile.inc | 81 -- tools/python-yasm/bytecode.pxi | 107 -- tools/python-yasm/errwarn.pxi | 73 -- tools/python-yasm/expr.pxi | 136 --- tools/python-yasm/floatnum.pxi | 49 - tools/python-yasm/intnum.pxi | 170 --- tools/python-yasm/pyxelator/TODO | 16 - tools/python-yasm/pyxelator/cparse.py | 819 --------------- tools/python-yasm/pyxelator/genpyx.py | 531 ---------- tools/python-yasm/pyxelator/ir.py | 1163 --------------------- tools/python-yasm/pyxelator/lexer.py | 248 ----- tools/python-yasm/pyxelator/node.py | 301 ------ tools/python-yasm/pyxelator/parse_core.py | 106 -- tools/python-yasm/pyxelator/work_unit.py | 177 ---- tools/python-yasm/pyxelator/wrap_yasm.py | 57 - tools/python-yasm/setup.py | 92 -- tools/python-yasm/symrec.pxi | 285 ----- tools/python-yasm/tests/Makefile.inc | 15 - tools/python-yasm/tests/__init__.py | 70 -- tools/python-yasm/tests/python_test.sh | 20 - tools/python-yasm/tests/test_bytecode.py | 4 - tools/python-yasm/tests/test_expr.py | 19 - tools/python-yasm/tests/test_intnum.py | 78 -- tools/python-yasm/tests/test_symrec.py | 81 -- tools/python-yasm/value.pxi | 56 - tools/python-yasm/yasm.pyx | 137 --- 29 files changed, 4944 deletions(-) delete mode 100644 tools/python-yasm/Makefile.inc delete mode 100644 tools/python-yasm/bytecode.pxi delete mode 100644 tools/python-yasm/errwarn.pxi delete mode 100644 tools/python-yasm/expr.pxi delete mode 100644 tools/python-yasm/floatnum.pxi delete mode 100644 tools/python-yasm/intnum.pxi delete mode 100644 tools/python-yasm/pyxelator/TODO delete mode 100755 tools/python-yasm/pyxelator/cparse.py delete mode 100755 tools/python-yasm/pyxelator/genpyx.py delete mode 100755 tools/python-yasm/pyxelator/ir.py delete mode 100755 tools/python-yasm/pyxelator/lexer.py delete mode 100755 tools/python-yasm/pyxelator/node.py delete mode 100755 tools/python-yasm/pyxelator/parse_core.py delete mode 100755 tools/python-yasm/pyxelator/work_unit.py delete mode 100755 tools/python-yasm/pyxelator/wrap_yasm.py delete mode 100644 tools/python-yasm/setup.py delete mode 100644 tools/python-yasm/symrec.pxi delete mode 100644 tools/python-yasm/tests/Makefile.inc delete mode 100644 tools/python-yasm/tests/__init__.py delete mode 100755 tools/python-yasm/tests/python_test.sh delete mode 100644 tools/python-yasm/tests/test_bytecode.py delete mode 100644 tools/python-yasm/tests/test_expr.py delete mode 100644 tools/python-yasm/tests/test_intnum.py delete mode 100644 tools/python-yasm/tests/test_symrec.py delete mode 100644 tools/python-yasm/value.pxi delete mode 100644 tools/python-yasm/yasm.pyx diff --git a/Makefile.am b/Makefile.am index 31af44d8..f96bcca6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -106,13 +106,6 @@ ACLOCAL_AMFLAGS = -I m4 distclean-local: -rm -rf results -if HAVE_PYTHON - -rm -rf build -endif - -all-local: python-build -install-exec-hook: python-install -uninstall-hook: python-uninstall if BUILD_MAN MAINTAINERCLEANFILES = $(dist_man_MANS) diff --git a/configure.ac b/configure.ac index f2efc713..2e64f311 100644 --- a/configure.ac +++ b/configure.ac @@ -53,14 +53,6 @@ AC_HELP_STRING([--enable-gcov],[Enable gcov code coverage (requires GCC)]), *) AC_MSG_ERROR([bad value ${enableval} for --enable-gcov]) ;; esac]) -AC_ARG_ENABLE(python, -AC_HELP_STRING([--enable-python],[Build Python bindings]), -[case "${enableval}" in - yes) enable_python="yes" ;; - no) enable_python="no" ;; - *) AC_MSG_ERROR([bad value ${enableval} for --enable-python]) ;; -esac], enable_python="auto") - # # Checks for programs. # @@ -247,42 +239,6 @@ AC_SUBST(CCLD_FOR_BUILD) HOST_CC="$CC_FOR_BUILD" AC_SUBST(HOST_CC) -# Detect if we can build Python bindings -# (needs Python, Python headers, and Pyrex) -if test x$enable_python = xno; then - have_python=no -else - AC_MSG_NOTICE([Checking to see if we can build Python bindings]) - have_python=no - AM_PATH_PYTHON(2.4,[],[AC_MSG_WARN([Python not found])]) - - if test -z "$PYTHON" || test "$PYTHON" = : ; then - have_python=no - else - AC_MSG_CHECKING([for Pyrex >= 0.9.5.1]) - PYREX_CHECK_VERSION(0.9.5.1, [AC_MSG_RESULT(yes) - have_pyrex=yes], - [AC_MSG_RESULT(no) - have_pyrex=no]) - - AM_CHECK_PYTHON_HEADERS(have_python_headers=yes,have_python_headers=no) - - if test x$have_pyrex = xyes -a x$have_python_headers = xyes ; then - have_python=yes - fi - fi - - if test x$have_python = xno ; then - if test x$enable_python = xyes ; then - AC_MSG_ERROR([Building Python explicitly requested, but can't build Python bindings because either Pyrex, Python headers or a suitable Python version was not found]) - else - AC_MSG_WARN([Couldn't find either Pyrex, the Python headers or a suitable version of Python, not building Python bindings]) - fi - fi -fi - -AM_CONDITIONAL(HAVE_PYTHON, test x$have_python = xyes) - AC_CONFIG_FILES([Makefile po/Makefile.in ]) diff --git a/tools/Makefile.inc b/tools/Makefile.inc index 56a4697f..264b8e16 100644 --- a/tools/Makefile.inc +++ b/tools/Makefile.inc @@ -2,8 +2,6 @@ EXTRA_DIST += tools/re2c/Makefile.inc EXTRA_DIST += tools/gap/Makefile.inc -EXTRA_DIST += tools/python-yasm/Makefile.inc include tools/re2c/Makefile.inc include tools/gap/Makefile.inc -include tools/python-yasm/Makefile.inc diff --git a/tools/python-yasm/Makefile.inc b/tools/python-yasm/Makefile.inc deleted file mode 100644 index 9a1193c7..00000000 --- a/tools/python-yasm/Makefile.inc +++ /dev/null @@ -1,81 +0,0 @@ -# $Id$ - -PYBINDING_DEPS = tools/python-yasm/bytecode.pxi -PYBINDING_DEPS += tools/python-yasm/errwarn.pxi -PYBINDING_DEPS += tools/python-yasm/expr.pxi -PYBINDING_DEPS += tools/python-yasm/floatnum.pxi -PYBINDING_DEPS += tools/python-yasm/intnum.pxi -PYBINDING_DEPS += tools/python-yasm/symrec.pxi -PYBINDING_DEPS += tools/python-yasm/value.pxi - -EXTRA_DIST += tools/python-yasm/pyxelator/cparse.py -EXTRA_DIST += tools/python-yasm/pyxelator/genpyx.py -EXTRA_DIST += tools/python-yasm/pyxelator/ir.py -EXTRA_DIST += tools/python-yasm/pyxelator/lexer.py -EXTRA_DIST += tools/python-yasm/pyxelator/node.py -EXTRA_DIST += tools/python-yasm/pyxelator/parse_core.py -EXTRA_DIST += tools/python-yasm/pyxelator/work_unit.py -EXTRA_DIST += tools/python-yasm/pyxelator/wrap_yasm.py -EXTRA_DIST += tools/python-yasm/setup.py -EXTRA_DIST += tools/python-yasm/yasm.pyx -EXTRA_DIST += $(PYBINDING_DEPS) - -if HAVE_PYTHON - -# Use Pyxelator to generate Pyrex function headers. -_yasm.pxi: ${HEADERS} - @rm -rf .tmp - @mkdir .tmp - $(PYTHON) $(srcdir)/tools/python-yasm/pyxelator/wrap_yasm.py \ - "YASM_DIR=${srcdir}" "CPP=${CPP}" "CPPFLAGS=${CPPFLAGS}" - @rm -rf .tmp - -CLEANFILES += _yasm.pxi - -# Need to build a local copy of the main Pyrex input file to include _yasm.pxi -# from the build directory. Also need to fixup the other .pxi include paths. -yasm.pyx: $(srcdir)/tools/python-yasm/yasm.pyx - sed -e 's,^include "\([^_]\),include "${srcdir}/tools/python-yasm/\1,' \ - $(srcdir)/tools/python-yasm/yasm.pyx > $@ - -CLEANFILES += yasm.pyx - -# Actually run Pyrex -yasm_python.c: yasm.pyx _yasm.pxi $(PYBINDING_DEPS) - $(PYTHON) -c "from Pyrex.Compiler.Main import main; main(command_line=1)" \ - -o $@ yasm.pyx - -CLEANFILES += yasm_python.c - -# Now the Python build magic... -python-setup.txt: Makefile - echo "includes=${DEFS} ${DEFAULT_INCLUDES} ${INCLUDES} ${AM_CPPFLAGS} ${CPPFLAGS}" > python-setup.txt - echo "sources=${libyasm_a_SOURCES}" >> python-setup.txt - echo "srcdir=${srcdir}" >> python-setup.txt - echo "gcc=${GCC}" >> python-setup.txt - -CLEANFILES += python-setup.txt - -.python-build: python-setup.txt yasm_python.c ${libyasm_a_SOURCES} - $(PYTHON) `test -f tools/python-yasm/setup.py || echo '$(srcdir)/'`tools/python-yasm/setup.py build - touch .python-build -python-build: .python-build - -CLEANFILES += .python-build - -python-install: .python-build - $(PYTHON) `test -f tools/python-yasm/setup.py || echo '$(srcdir)/'`tools/python-yasm/setup.py install "--install-lib=$(DESTDIR)$(pythondir)" - -python-uninstall: - rm -f `$(PYTHON) -c "import sys;sys.path.insert(0, '${DESTDIR}${pythondir}'); import yasm; print yasm.__file__"` - -else - -python-build: -python-install: -python-uninstall: - -endif - -EXTRA_DIST += tools/python-yasm/tests/Makefile.inc -include tools/python-yasm/tests/Makefile.inc diff --git a/tools/python-yasm/bytecode.pxi b/tools/python-yasm/bytecode.pxi deleted file mode 100644 index 8a077b0d..00000000 --- a/tools/python-yasm/bytecode.pxi +++ /dev/null @@ -1,107 +0,0 @@ -# Python bindings for Yasm: Pyrex input file for bytecode.h -# -# Copyright (C) 2006 Michael Urman, Peter Johnson -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. - -cdef class Bytecode: - cdef yasm_bytecode *bc - - cdef object __weakref__ # make weak-referenceable - - def __new__(self, bc): - self.bc = NULL - if PyCObject_Check(bc): - self.bc = __get_voidp(bc, Bytecode) - else: - raise NotImplementedError - - def __dealloc__(self): - # Only free if we're not part of a section; if we're part of a section - # the section takes care of freeing the bytecodes. - if self.bc.section == NULL: - yasm_bc_destroy(self.bc) - - property len: - def __get__(self): return self.bc.len - def __set__(self, value): self.bc.len = value - property mult_int: - def __get__(self): return self.bc.mult_int - def __set__(self, value): self.bc.mult_int = value - property line: - def __get__(self): return self.bc.line - def __set__(self, value): self.bc.line = value - property offset: - def __get__(self): return self.bc.offset - def __set__(self, value): self.bc.offset = value - property bc_index: - def __get__(self): return self.bc.bc_index - def __set__(self, value): self.bc.bc_index = value - property symbols: - # Someday extend this to do something modifiable, e.g. return a - # list-like object. - def __get__(self): - cdef yasm_symrec *sym - cdef int i - if self.bc.symrecs == NULL: - return [] - s = [] - i = 0 - sym = self.bc.symrecs[i] - while sym != NULL: - s.append(__make_symbol(sym)) - i = i+1 - sym = self.bc.symrecs[i] - return s - -# -# Keep Bytecode reference paired with bc using weak references. -# This is broken in Pyrex 0.9.4.1; Pyrex 0.9.5 has a working version. -# - -from weakref import WeakValueDictionary as __weakvaldict -__bytecode_map = __weakvaldict() -#__bytecode_map = {} - -cdef object __make_bytecode(yasm_bytecode *bc): - __error_check() - vptr = PyCObject_FromVoidPtr(bc, NULL) - data = __bytecode_map.get(vptr, None) - if data: - return data - bcobj = Bytecode(__pass_voidp(bc, Bytecode)) - __bytecode_map[vptr] = bcobj - return bcobj - -# Org bytecode -def __org__new__(cls, start, line=0): - cdef yasm_bytecode *bc - bc = yasm_bc_create_org(start, line) - obj = Bytecode.__new__(cls, __pass_voidp(bc, Bytecode)) - __bytecode_map[PyCObject_FromVoidPtr(bc, NULL)] = obj - return obj -__org__new__ = staticmethod(__org__new__) -class Org(Bytecode): - __new__ = __org__new__ - - -#cdef class Section: diff --git a/tools/python-yasm/errwarn.pxi b/tools/python-yasm/errwarn.pxi deleted file mode 100644 index 9568cc07..00000000 --- a/tools/python-yasm/errwarn.pxi +++ /dev/null @@ -1,73 +0,0 @@ -# Python bindings for Yasm: Pyrex input file for errwarn.h -# -# Copyright (C) 2006 Peter Johnson -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. - -class YasmError(Exception): pass - -cdef int __error_check() except 1: - cdef yasm_error_class errclass - cdef unsigned long xrefline - cdef char *errstr, *xrefstr - - # short path for the common case - if not yasm_error_occurred(): - return 0 - - # look up our preferred python error, fall back to YasmError - # Order matters here. Go from most to least specific within a class - if yasm_error_matches(YASM_ERROR_ZERO_DIVISION): - exception = ZeroDivisionError - # Enable these once there are tests that need them. - #elif yasm_error_matches(YASM_ERROR_OVERFLOW): - # exception = OverflowError - #elif yasm_error_matches(YASM_ERROR_FLOATING_POINT): - # exception = FloatingPointError - #elif yasm_error_matches(YASM_ERROR_ARITHMETIC): - # exception = ArithmeticError - #elif yasm_error_matches(YASM_ERROR_ASSERTION): - # exception = AssertionError - #elif yasm_error_matches(YASM_ERROR_VALUE): - # exception = ValueError # include notabs, notconst, toocomplex - #elif yasm_error_matches(YASM_ERROR_IO): - # exception = IOError - #elif yasm_error_matches(YASM_ERROR_NOT_IMPLEMENTED): - # exception = NotImplementedError - #elif yasm_error_matches(YASM_ERROR_TYPE): - # exception = TypeError - #elif yasm_error_matches(YASM_ERROR_SYNTAX): - # exception = SyntaxError #include parse - else: - exception = YasmError - - # retrieve info (clears error) - yasm_error_fetch(&errclass, &errstr, &xrefline, &xrefstr) - - if xrefline and xrefstr: - PyErr_Format(exception, "%s: %d: %s", errstr, xrefline, xrefstr) - else: - PyErr_SetString(exception, errstr) - - if xrefstr: free(xrefstr) - free(errstr) - return 1 diff --git a/tools/python-yasm/expr.pxi b/tools/python-yasm/expr.pxi deleted file mode 100644 index dea75d78..00000000 --- a/tools/python-yasm/expr.pxi +++ /dev/null @@ -1,136 +0,0 @@ -# Python bindings for Yasm: Pyrex input file for expr.h -# -# Copyright (C) 2006 Michael Urman, Peter Johnson -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. - -cdef extern from *: - # Defined as a macro, so not automatically brought in by pyxelator - cdef yasm_expr *yasm_expr_simplify(yasm_expr *e, int calc_bc_dist) - -import operator -__op = {} -for ops, operation in [ - ((operator.__add__, operator.add, '+'), YASM_EXPR_ADD), - ((operator.__and__, operator.and_, '&'), YASM_EXPR_AND), - ((operator.__div__, operator.div, '/'), YASM_EXPR_SIGNDIV), - ((operator.__floordiv__, operator.floordiv, '//'), YASM_EXPR_SIGNDIV), - ((operator.__ge__, operator.ge, '>='), YASM_EXPR_GE), - ((operator.__gt__, operator.gt, '>'), YASM_EXPR_GT), - ((operator.__inv__, operator.inv, '~'), YASM_EXPR_NOT), - ((operator.__invert__, operator.invert), YASM_EXPR_NOT), - ((operator.__le__, operator.le, '<='), YASM_EXPR_LE), - ((operator.__lt__, operator.lt, '<'), YASM_EXPR_LT), - ((operator.__mod__, operator.mod, '%'), YASM_EXPR_SIGNMOD), - ((operator.__mul__, operator.mul, '*'), YASM_EXPR_MUL), - ((operator.__neg__, operator.neg), YASM_EXPR_NEG), - ((operator.__not__, operator.not_, 'not'), YASM_EXPR_LNOT), - ((operator.__or__, operator.or_, '|'), YASM_EXPR_OR), - ((operator.__sub__, operator.sub, '-'), YASM_EXPR_SUB), - ((operator.__xor__, operator.xor, '^'), YASM_EXPR_XOR), - ]: - for op in ops: - __op[op] = operation - -del operator, op, ops, operation - -cdef object __make_expression(yasm_expr *expr): - return Expression(__pass_voidp(expr, Expression)) - -cdef class Expression: - cdef yasm_expr *expr - - def __new__(self, op, *args, **kwargs): - self.expr = NULL - - if isinstance(op, Expression): - self.expr = yasm_expr_copy((op).expr) - return - if PyCObject_Check(op): - self.expr = __get_voidp(op, Expression) - return - - cdef size_t numargs - cdef unsigned long line - - op = __op.get(op, op) - numargs = len(args) - line = kwargs.get('line', 0) - - if numargs == 0 or numargs > 2: - raise NotImplementedError - elif numargs == 2: - self.expr = yasm_expr_create(op, self.__new_item(args[0]), - self.__new_item(args[1]), line) - else: - self.expr = yasm_expr_create(op, self.__new_item(args[0]), NULL, - line) - - cdef yasm_expr__item* __new_item(self, value) except NULL: - cdef yasm_expr__item *retval - if isinstance(value, Expression): - return yasm_expr_expr(yasm_expr_copy((value).expr)) - #elif isinstance(value, Symbol): - # return yasm_expr_sym((value).sym) - #elif isinstance(value, Register): - # return yasm_expr_reg((value).reg) - elif isinstance(value, FloatNum): - return yasm_expr_float(yasm_floatnum_copy((value).flt)) - elif isinstance(value, IntNum): - return yasm_expr_int(yasm_intnum_copy((value).intn)) - else: - try: - intnum = IntNum(value) - except: - raise ValueError("Invalid item value type '%s'" % type(value)) - else: - retval = yasm_expr_int((intnum).intn) - (intnum).intn = NULL - return retval - - def __dealloc__(self): - if self.expr != NULL: yasm_expr_destroy(self.expr) - - def simplify(self, calc_bc_dist=False): - self.expr = yasm_expr_simplify(self.expr, calc_bc_dist) - - def extract_segoff(self): - cdef yasm_expr *retval - retval = yasm_expr_extract_segoff(&self.expr) - if retval == NULL: - raise ValueError("not a SEG:OFF expression") - return __make_expression(retval) - - def extract_wrt(self): - cdef yasm_expr *retval - retval = yasm_expr_extract_wrt(&self.expr) - if retval == NULL: - raise ValueError("not a WRT expression") - return __make_expression(retval) - - def get_intnum(self, calc_bc_dist=False): - cdef yasm_intnum *retval - retval = yasm_expr_get_intnum(&self.expr, calc_bc_dist) - if retval == NULL: - raise ValueError("not an intnum expression") - return __make_intnum(yasm_intnum_copy(retval)) - diff --git a/tools/python-yasm/floatnum.pxi b/tools/python-yasm/floatnum.pxi deleted file mode 100644 index 3939056f..00000000 --- a/tools/python-yasm/floatnum.pxi +++ /dev/null @@ -1,49 +0,0 @@ -# Python bindings for Yasm: Pyrex input file for floatnum.h -# -# Copyright (C) 2006 Michael Urman, Peter Johnson -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. - -cdef class FloatNum: - cdef yasm_floatnum *flt - def __new__(self, value): - self.flt = NULL - if isinstance(value, FloatNum): - self.flt = yasm_floatnum_copy((value).flt) - return - if PyCObject_Check(value): # should check Desc - self.flt = PyCObject_AsVoidPtr(value) - return - - if isinstance(value, float): string = str(float) - else: string = value - self.flt = yasm_floatnum_create(string) - - def __dealloc__(self): - if self.flt != NULL: yasm_floatnum_destroy(self.flt) - - def __neg__(self): - result = FloatNum(self) - yasm_floatnum_calc((result).flt, YASM_EXPR_NEG, NULL) - return result - def __pos__(self): return self - diff --git a/tools/python-yasm/intnum.pxi b/tools/python-yasm/intnum.pxi deleted file mode 100644 index f99769e6..00000000 --- a/tools/python-yasm/intnum.pxi +++ /dev/null @@ -1,170 +0,0 @@ -# Python bindings for Yasm: Pyrex input file for intnum.h -# -# Copyright (C) 2006 Michael Urman, Peter Johnson -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. - -cdef class IntNum - -cdef object __intnum_op_ex(object x, yasm_expr_op op, object y): - value = __intnum_op(x, op, y) - __error_check() - return value - -cdef object __intnum_op(object x, yasm_expr_op op, object y): - if isinstance(x, IntNum): - result = IntNum(x) - if y is None: - yasm_intnum_calc((result).intn, op, NULL) - else: - # Coerce to intnum if not already - if isinstance(y, IntNum): - rhs = y - else: - rhs = IntNum(y) - yasm_intnum_calc((result).intn, op, (rhs).intn) - return result - elif isinstance(y, IntNum): - # Reversed operation - x OP y still, just y is intnum, x isn't. - result = IntNum(x) - yasm_intnum_calc((result).intn, op, (y).intn) - return result - else: - raise NotImplementedError - -cdef object __make_intnum(yasm_intnum *intn): - return IntNum(__pass_voidp(intn, IntNum)) - -cdef class IntNum: - cdef yasm_intnum *intn - - def __new__(self, value, base=None): - cdef unsigned char buf[16] - - self.intn = NULL - - if isinstance(value, IntNum): - self.intn = yasm_intnum_copy((value).intn) - return - if PyCObject_Check(value): - self.intn = __get_voidp(value, IntNum) - return - - if isinstance(value, str): - if base == 2: - self.intn = yasm_intnum_create_bin(value) - elif base == 8: - self.intn = yasm_intnum_create_oct(value) - elif base == 10 or base is None: - self.intn = yasm_intnum_create_dec(value) - elif base == 16: - self.intn = yasm_intnum_create_hex(value) - elif base == "nasm": - self.intn = yasm_intnum_create_charconst_nasm(value) - else: - raise ValueError("base must be 2, 8, 10, 16, or \"nasm\"") - elif isinstance(value, (int, long)): - _PyLong_AsByteArray(long(value), buf, 16, 1, 1) - self.intn = yasm_intnum_create_sized(buf, 1, 16, 0) - else: - raise ValueError - - def __dealloc__(self): - if self.intn != NULL: yasm_intnum_destroy(self.intn) - - def __long__(self): - cdef unsigned char buf[16] - yasm_intnum_get_sized(self.intn, buf, 16, 128, 0, 0, 0) - return _PyLong_FromByteArray(buf, 16, 1, 1) - - def __repr__(self): - return "IntNum(%d)" % self - - def __int__(self): return int(self.__long__()) - def __complex__(self): return complex(self.__long__()) - def __float__(self): return float(self.__long__()) - - def __oct__(self): return oct(int(self.__long__())) - def __hex__(self): return hex(int(self.__long__())) - - def __add__(x, y): return __intnum_op(x, YASM_EXPR_ADD, y) - def __sub__(x, y): return __intnum_op(x, YASM_EXPR_SUB, y) - def __mul__(x, y): return __intnum_op(x, YASM_EXPR_MUL, y) - def __div__(x, y): return __intnum_op_ex(x, YASM_EXPR_SIGNDIV, y) - def __floordiv__(x, y): return __intnum_op_ex(x, YASM_EXPR_SIGNDIV, y) - def __mod__(x, y): return __intnum_op_ex(x, YASM_EXPR_SIGNMOD, y) - def __neg__(self): return __intnum_op(self, YASM_EXPR_NEG, None) - def __pos__(self): return self - def __abs__(self): - if yasm_intnum_sign(self.intn) >= 0: return self - else: return __intnum_op(self, YASM_EXPR_NEG, None) - def __nonzero__(self): return not yasm_intnum_is_zero(self.intn) - def __invert__(self): return __intnum_op(self, YASM_EXPR_NOT, None) - def __lshift__(x, y): return __intnum_op(x, YASM_EXPR_SHL, y) - def __rshift__(x, y): return __intnum_op(x, YASM_EXPR_SHR, y) - def __and__(x, y): return __intnum_op(x, YASM_EXPR_AND, y) - def __or__(x, y): return __intnum_op(x, YASM_EXPR_OR, y) - def __xor__(x, y): return __intnum_op(x, YASM_EXPR_XOR, y) - - cdef object __op(self, yasm_expr_op op, object x): - if isinstance(x, IntNum): - rhs = x - else: - rhs = IntNum(x) - yasm_intnum_calc(self.intn, op, (rhs).intn) - return self - - def __iadd__(self, x): return self.__op(YASM_EXPR_ADD, x) - def __isub__(self, x): return self.__op(YASM_EXPR_SUB, x) - def __imul__(self, x): return self.__op(YASM_EXPR_MUL, x) - def __idiv__(self, x): return self.__op(YASM_EXPR_SIGNDIV, x) - def __ifloordiv__(self, x): return self.__op(YASM_EXPR_SIGNDIV, x) - def __imod__(self, x): return self.__op(YASM_EXPR_MOD, x) - def __ilshift__(self, x): return self.__op(YASM_EXPR_SHL, x) - def __irshift__(self, x): return self.__op(YASM_EXPR_SHR, x) - def __iand__(self, x): return self.__op(YASM_EXPR_AND, x) - def __ior__(self, x): return self.__op(YASM_EXPR_OR, x) - def __ixor__(self, x): return self.__op(YASM_EXPR_XOR, x) - - def __cmp__(self, x): - cdef yasm_intnum *t - t = yasm_intnum_copy(self.intn) - if isinstance(x, IntNum): - rhs = x - else: - rhs = IntNum(x) - yasm_intnum_calc(t, YASM_EXPR_SUB, (rhs).intn) - result = yasm_intnum_sign(t) - yasm_intnum_destroy(t) - return result - - def __richcmp__(x, y, op): - cdef yasm_expr_op aop - if op == 0: aop = YASM_EXPR_LT - elif op == 1: aop = YASM_EXPR_LE - elif op == 2: aop = YASM_EXPR_EQ - elif op == 3: aop = YASM_EXPR_NE - elif op == 4: aop = YASM_EXPR_GT - elif op == 5: aop = YASM_EXPR_GE - else: raise NotImplementedError - v = __intnum_op(x, aop, y) - return bool(not yasm_intnum_is_zero((v).intn)) diff --git a/tools/python-yasm/pyxelator/TODO b/tools/python-yasm/pyxelator/TODO deleted file mode 100644 index cfe1e184..00000000 --- a/tools/python-yasm/pyxelator/TODO +++ /dev/null @@ -1,16 +0,0 @@ - -pyxelator TODO: -=============== - -.) callback functions: these are working but it needs to be thought out some more. Exceptions are not propagated from callbacks. -.) no nice module structure: it's all in one fat module. -.) extern symbols and macros are a little tricky to wrap, some have been hardcoded (!!) in petscmacros.py. -.) type checking -.) upcasting -.) adapt system memory usage audit: record and check every malloc/free/memcpy/memcmp - and every memory access using those nasty void* pointers - -21/10/05 - - - diff --git a/tools/python-yasm/pyxelator/cparse.py b/tools/python-yasm/pyxelator/cparse.py deleted file mode 100755 index 53754f86..00000000 --- a/tools/python-yasm/pyxelator/cparse.py +++ /dev/null @@ -1,819 +0,0 @@ -#!/usr/bin/env python - -""" - -(c) 2002, 2003, 2004, 2005 Simon Burton -Released under GNU LGPL license. - -""" - -import sys - -from lexer import Lexer -from parse_core import Symbols, Parser -import node as node_module - - -class Node(node_module.Node): - - def is_typedef(self): - for x in self: - if isinstance(x,Node): - if x.is_typedef(): - return 1 - return 0 - - #def explain(self): - #l = [] - #for x in self: - #if isinstance(x,Node): - #l.append(x.explain()) - #else: - #l.append(str(x)) - #return string.join(l," ") - ##(self.__class__.__name__,string.join(l) ) - - def psource(self): - if hasattr(self,'lines'): - print "# "+string.join(self.lines,"\n# ")+"\n" - - -################################################################### -# -################################################################### -# - - -class BasicType(Node): - " int char short etc. " - def __init__(self,name): - Node.__init__(self,name) - -class Qualifier(Node): - """ - """ - def __init__(self,name): - Node.__init__(self,name) - self.name=name - -class StorageClass(Node): - """ - """ - def __init__(self,name): - Node.__init__(self,name) - self.name=name - -class Typedef(StorageClass): - """ - """ - def __init__(self,s='typedef'): - Node.__init__(self,s) - #def explain(self): - #return "type" - -class Ellipses(Node): - """ - """ - def __init__(self,s='...'): - Node.__init__(self,s) - -class GCCBuiltin(BasicType): - """ - """ - pass - - -class Identifier(Node): - """ - """ - def __init__(self,name="",*items): - if name or 1: - Node.__init__(self,name,*items) - else: - Node.__init__(self) - self.name=name - -class Function(Node,Parser): - """ - """ - def __init__(self,*items): - Node.__init__(self,*items) - - def parse(self,lexer,symbols): - symbols = Symbols(symbols) - args = '' - #lexer.get_token() - if lexer.tok != ')': - if not lexer.tok: - self.parse_error(lexer) - #lexer.unget_token() # unget start of decl - while lexer.tok != ')': - node = ParameterDeclaration() - node.parse(lexer,symbols) - self.append( node ) - if lexer.tok != ')' and lexer.tok != ',': - self.parse_error(lexer) - if lexer.tok == ',': - lexer.get_token() - lexer.get_token() - - -class Pointer(Node): - """ - """ - def __init__(self,*items): - Node.__init__(self,*items) - -class Array(Node,Parser): - """ - """ - def __init__(self,*items): - Node.__init__(self,*items) - - def parse(self,lexer,symbols): - lexer.get_token() # a number or ']' - # XX - # HACK HACK: constant c expressions can appear in here: - # eg. [ 15 * sizeof (int) - 2 * sizeof (void *) ] - # XX - toks = [] - while lexer.tok != ']': - #self.append( lexer.kind ) - toks.append( lexer.tok ) - lexer.get_token() - child = " ".join(toks) - if child == "": - child = None - self.append( child ) - lexer.get_token() # read past the ']' - -class Tag(Node): - """ - """ - pass - - -class Compound(Node,Parser): - "Struct or Union" - - def __init__(self,*items,**kw): - Node.__init__(self,*items,**kw) - - def parse(self,lexer,symbols): - symbols = Symbols(symbols) - tag = "" # anonymous - if lexer.tok != '{': - tag = lexer.tok - if not ( tag[0]=='_' or tag[0].isalpha() ): - self.parse_error(lexer ,"expected tag, got '%s'"%tag ) - lexer.get_token() - if tag: - self.append(Tag(tag)) - else: - self.append(Tag()) - self.tag = tag - if lexer.tok == '{': - fieldlist = [] - lexer.get_token() - if lexer.tok != '}': - if not lexer.tok: self.parse_error(lexer) - while lexer.tok != '}': - node = StructDeclaration() - node.parse(lexer,symbols) - fieldlist.append( node ) - self += fieldlist - lexer.get_token() - if self.verbose: - print "%s.__init__() #<--"%(self) - -class Struct(Compound): - """ - """ - pass - -class Union(Compound): - """ - """ - pass - -class Enum(Node,Parser): - """ - """ - def __init__(self,*items,**kw): - Node.__init__(self,*items,**kw) - - def parse(self,lexer,symbols): - tag = "" # anonymous - if lexer.tok != '{': - tag = lexer.tok - if not ( tag[0]=='_' or tag[0].isalpha() ): - self.parse_error(lexer ,"expected tag, got '%s'"%tag ) - lexer.get_token() - if tag: - self.append(Tag(tag)) - else: - self.append(Tag()) - self.tag = tag - if lexer.tok == '{': - lexer.get_token() - if lexer.tok != '}': # XX dopey control flow - if not lexer.tok: # XX dopey control flow - self.parse_error(lexer) # XX dopey control flow - while lexer.tok != '}': # XX dopey control flow - if lexer.kind is not None: - self.expected_error(lexer ,"identifier" ) - ident = Identifier(lexer.tok) - if symbols[ident[0]] is not None: - self.parse_error(lexer,"%s already defined."%ident[0]) - symbols[ident[0]]=ident - self.append( ident ) - lexer.get_token() - if lexer.tok == '=': - lexer.get_token() - # ConstantExpr - # XX hack hack XX - while lexer.tok!=',' and lexer.tok!='}': - lexer.get_token() -# if type( lexer.kind ) is not int: -# #self.parse_error(lexer ,"expected integer" ) -# # XX hack hack XX -# while lexer.tok!=',' and lexer.tok!='}': -# lexer.get_token() -# else: -# # put initializer into the Identifier -# ident.append( lexer.kind ) -# lexer.get_token() - if lexer.tok != '}': - if lexer.tok != ',': - self.expected_error(lexer,"}",",") - lexer.get_token() # ',' - lexer.get_token() - if self.verbose: - print "%s.__init__() #<--"%(self) - - - -class Declarator(Node,Parser): - """ - """ - def __init__(self,*items): - Node.__init__(self,*items) - self.ident = None - - def parse(self,lexer,symbols): - #Parser.parse_enter(self,lexer) - stack = [] - # read up to identifier, pushing tokens onto stack - self.ident = self.parse_identifier(lexer,symbols,stack) - self.name = '' - if self.ident is not None: - self.append( self.ident ) - self.name = self.ident.name - # now read outwards from identifier - self.parse_declarator(lexer,symbols,stack) - #Parser.parse_leave(self,lexer) - - def parse_identifier(self,lexer,symbols,stack): - if self.verbose: - print "%s.parse_identifier()"%self - ident = None - if lexer.tok != ';': - while lexer.tok and lexer.kind is not None: - stack.append( (lexer.tok, lexer.kind) ) - lexer.get_token() - if lexer.tok: - ident = Identifier( lexer.tok ) - #stack.append( (ident.name, ident) ) - lexer.get_token() - if self.verbose: - print "%s.parse_identifier()=%s"%(self,repr(ident)) - return ident - - def parse_declarator(self,lexer,symbols,stack,level=0): - if self.verbose: - print " "*level+"%s.parse_declarator(%s) # --->"%\ - (self,stack) - if lexer.tok == '[': - while lexer.tok == '[': - node = Array() - node.parse(lexer,symbols) - self.append(node) - if lexer.tok == '(': - self.parse_error(lexer ,"array of functions" ) - elif lexer.tok == '(': - lexer.get_token() - node = Function() - node.parse(lexer,symbols) - self.append( node ) - if lexer.tok == '(': - self.parse_error(lexer ,"function returns a function" ) - if lexer.tok == '[': - self.parse_error(lexer ,"function returns an array" ) - while stack: - tok, kind = stack[-1] # peek - if tok == '(': - stack.pop() - self.consume(lexer,')') - self.parse_declarator(lexer,symbols,stack,level+1) - elif tok == '*': - stack.pop() - self.append( Pointer() ) - else: - tok, kind = stack.pop() - self.append( kind ) - if self.verbose: - print " "*level+"%s.parse_declarator(%s) # <---"%\ - (self,stack) - - -class AbstractDeclarator(Declarator): - """ used in ParameterDeclaration; may lack an identifier """ - - def parse_identifier(self,lexer,symbols,stack): - if self.verbose: - print "%s.parse_identifier()"%self - ident = None - ident = Identifier() - while 1: - if lexer.tok == ';': - self.parse_error(lexer) - if lexer.tok == ')': - break - if lexer.tok == ',': - break - if lexer.tok == '[': - break - if lexer.kind is None: - #print "%s.new identifier"%self - ident = Identifier( lexer.tok ) - lexer.get_token() - #stack.append( (ident.name, ident) ) - break - stack.append( (lexer.tok, lexer.kind) ) - lexer.get_token() - if self.verbose: - print "%s.parse_identifier()=%s"%(self,repr(ident)) - return ident - -class FieldLength(Node): - """ - """ - pass - -class StructDeclarator(Declarator): - """ - """ - def parse(self,lexer,symbols): - if lexer.tok != ':': - Declarator.parse(self,lexer,symbols) - if lexer.tok == ':': - lexer.get_token() - # ConstantExpr - length = int(lexer.tok) - #print "length = ",length - self.append( FieldLength(length) ) - lexer.get_token() - -class DeclarationSpecifiers(Node,Parser): - """ - """ - def __init__(self,*items): - Node.__init__(self,*items) - - def __eq__(self,other): - " unordered (set/bag) equality " - if not isinstance(other,Node): - return 0 - for i in range(len(self)): - if not self[i] in other: - return 0 - for i in range(len(other)): - if not other[i] in self: - return 0 - return 1 - - def parse(self,lexer,symbols): - self.parse_spec(lexer,symbols) - self.reverse() - - def parse_spec(self,lexer,symbols): - typespec = None - while lexer.tok: - if isinstance( lexer.kind, TypeAlias ) or\ - isinstance( lexer.kind, BasicType ): - if typespec is not None: - self.parse_error(lexer ,"type already specified as %s"\ - %typespec ) - typespec=lexer.kind - self.append( lexer.kind ) - lexer.get_token() - elif isinstance( lexer.kind, Qualifier ): - self.append( lexer.kind ) - lexer.get_token() - elif isinstance( lexer.kind, StorageClass ): - self.append( lexer.kind ) - lexer.get_token() - elif lexer.tok=='struct': - lexer.get_token() - self.parse_struct(lexer,symbols) - break #? - elif lexer.tok=='union': - lexer.get_token() - self.parse_union(lexer,symbols) - break #? - elif lexer.tok=='enum': - lexer.get_token() - self.parse_enum(lexer,symbols) - break #? - elif lexer.kind is None: - # identifier - break - else: - break - - def parse_struct(self,lexer,symbols): - if self.verbose: - print "%s.parse_struct()"%(self) - node = Struct() - node.parse(lexer,symbols) - _node = None - if node.tag: - _node = symbols.get_tag( node.tag ) - if _node is not None: - if not isinstance( _node, Struct ): - self.parse_error(lexer,"tag defined as wrong kind") - if len(node)>1: - if len(_node)>1: - self.parse_error(lexer,"tag already defined as %s"%_node) - #symbols.set_tag( node.tag, node ) - #else: - # refer to the previously defined struct - ##node = _node - #node = _node.clone() - if 0: - # refer to the previously defined struct - if len(node)==1: - _node = symbols.deep_get_tag( node.tag ) - if _node is not None: - node=_node - # But what about any future reference to the struct ? - if node.tag: - symbols.set_tag( node.tag, node ) - self.append( node ) - - def parse_union(self,lexer,symbols): - if self.verbose: - print "%s.parse_union(%s)"%(self,node) - node = Union() - node.parse(lexer,symbols) - _node = None - if node.tag: - _node = symbols.get_tag( node.tag ) - if _node is not None: - if not isinstance( _node, Union ): - self.parse_error(lexer,"tag %s defined as wrong kind"%repr(node.tag)) - if len(node)>1: - if len(_node)>1: - self.parse_error(lexer,"tag already defined as %s"%_node) - #symbols.set_tag( node.tag, node ) - #else: - #node = _node - #if len(node)==1: - #_node = symbols.deep_get_tag( node.tag ) - #if _node is not None: - #node=_node - if node.tag: - symbols.set_tag( node.tag, node ) - self.append( node ) - - def parse_enum(self,lexer,symbols): - if self.verbose: - print "%s.parse_enum(%s)"%(self,node) - node = Enum() - node.parse(lexer,symbols) - _node = None - if node.tag: - _node = symbols.get_tag( node.tag ) - if _node is not None: - if not isinstance( _node, Enum ): - self.parse_error(lexer,"tag defined as wrong kind") - if len(node)>1: - if len(_node)>1: - self.parse_error(lexer,"tag already defined as %s"%_node) - #symbols.set_tag( node.tag, node ) - #else: - #node = _node - #if len(node)==1: - #_node = symbols.deep_get_tag( node.tag ) - #if _node is not None: - #node=_node - if node.tag: - symbols.set_tag( node.tag, node ) - self.append( node ) - - def is_typedef(self): - return self.find(Typedef) is not None - - def needs_declarator(self): - for node in self: - if isinstance( node, Struct ): - return False - if isinstance( node, Enum ): - return False - if isinstance( node, Union ): - return False - return True - - - -class TypeSpecifiers(DeclarationSpecifiers): - " used in ParameterDeclaration " - - def parse_spec(self,lexer,symbols): - typespec = None - while lexer.tok: - if isinstance( lexer.kind, TypeAlias ) or\ - isinstance( lexer.kind, BasicType ): - if typespec is not None: - self.parse_error(lexer ,"type already specified as %s"\ - %typespec ) - typespec=lexer.kind - self.append( lexer.kind ) - lexer.get_token() - elif isinstance( lexer.kind, Qualifier ): - self.append( lexer.kind ) - lexer.get_token() - elif isinstance( lexer.kind, StorageClass ): - self.parse_error(lexer ,"'%s' cannot appear here"%lexer.tok ) - elif lexer.tok=='struct': - lexer.get_token() - self.parse_struct(lexer,symbols) - break #? - elif lexer.tok=='union': - lexer.get_token() - self.parse_union(lexer,symbols) - break #? - elif lexer.tok=='enum': - lexer.get_token() - self.parse_enum(lexer,symbols) - break #? - elif lexer.kind is None: - # identifier - break - else: - break - - -class Initializer(Node,Parser): - """ - """ - def __init__(self,*items): - Node.__init__(self,*items) - - def parse(self,lexer,symbols): - self.parse_error(lexer,"not implemented") - - -class TypeAlias(Node): - " typedefed things " - - def __init__(self,name,decl=None): - Node.__init__(self,name)#,decl) - self.name=name - self.decl=decl - - -class Declaration(Node,Parser): - """ - """ - def __init__(self,*items): - Node.__init__(self,*items) - #self.acted=False - - def parse(self,lexer,symbols): - if not lexer.tok: - return - Parser.parse_enter(self,lexer) - declspec = DeclarationSpecifiers() - declspec.parse(lexer,symbols) - if len(declspec)==0: - if lexer.tok == ';': - lexer.get_token() - # empty declaration... - return - self.parse_error(lexer, - "expected specifiers, got '%s'"%lexer.tok ) - self.append(declspec) - while 1: - decl = Declarator() - decl.parse(lexer,symbols) - if len(decl)==0: - if declspec.needs_declarator(): - self.parse_error(lexer, - "expected declarator, got '%s'"%lexer.tok ) - self.append(decl) - ident = decl.ident - if ident is not None: - #if len(ident): - # install symbol - node = symbols[ident[0]] - if node is not None: - # we allow functions to be defined (as same) again - #print node.deepstr(),'\n', self.deepstr() - _node = node.clone() - _node.delete(Identifier) - _self = self.clone() - _self.delete(Identifier) - if _node != _self: - self.parse_error(lexer, - "\n%s\n already defined as \n%s\n"%\ - (self.deepstr(),node.deepstr())) - else: - if self.is_typedef(): - #lexer.mktypedef( ident[0], self ) - tp = TypeAlias(ident[0],decl) - lexer.mktypedef( ident[0], tp ) - else: - symbols[ident[0]] = self - if lexer.tok == '=': - # parse initializer - lexer.get_token() - init = Initializer() - init.parse(lexer,symbols) - ident.append( init ) # as in Enum - #else: struct, union or enum - if lexer.tok == ';': - # no more declarators - break - if lexer.tok == '{': - # ! ahhh, function body !!! -# sys.stderr.write( -# "WARNING: function body found at line %s\n"%lexer.lno ) - bcount = 1 - while bcount: - lexer.get_brace_token() - if lexer.tok == '}': - bcount -= 1 - if lexer.tok == '{': - bcount += 1 - lexer.get_token() - Parser.parse_leave(self,lexer) - return - self.consume(lexer,',') - self.consume(lexer,';') - Parser.parse_leave(self,lexer) - - def is_typedef(self): - spec=self[0] - assert isinstance(spec,DeclarationSpecifiers), self.deepstr() - return spec.is_typedef() - - -class ParameterDeclaration(Declaration): - """ - """ - def parse(self,lexer,symbols): - typespec = TypeSpecifiers() - typespec.parse(lexer,symbols) - self.append(typespec) - decl = AbstractDeclarator() - decl.parse(lexer,symbols) - self.append(decl) - ident = decl.ident - if ident is not None and ident[0]: - node = symbols[ident[0]] - if node is not None: - self.parse_error(lexer, - "%s already defined as %s"%(ident,node)) - else: - symbols[ident[0]] = self - - -class StructDeclaration(Declaration): - """ - """ - def parse(self,lexer,symbols): - if not lexer.tok: - return - declspec = DeclarationSpecifiers() - declspec.parse(lexer,symbols) - self.append(declspec) - if len(declspec)==0: - if lexer.tok == ';': - lexer.get_token() - # empty declaration... - return - self.parse_error(lexer, - "expected specifiers, got '%s'"%lexer.tok ) - while 1: - decl = StructDeclarator() - decl.parse(lexer,symbols) - if len(decl)==0: - self.parse_error(lexer, - "expected declarator, got '%s'"%lexer.tok ) - self.append(decl) - ident = decl.ident - if ident is not None: - node = symbols[ident[0]] - if node is not None: - self.parse_error(lexer , - "%s already defined as %s"%(ident,node)) - else: - if declspec.is_typedef(): - self.parse_error(lexer,"typedef in struct or union") - else: - symbols[ident[0]] = self - if lexer.tok == ';': - break - self.consume(lexer,',') - self.consume(lexer,';') - - -class TransUnit(Node,Parser): - """ - """ - def __init__(self,*items,**kw): - Node.__init__(self,*items,**kw) - - def parse(self,s,verbose=0): - self.symbols = Symbols() - self.lexer = Lexer(s,verbose=verbose) #,host=__module__) - node = None - while self.lexer.tok: - node=Declaration() - node.parse(self.lexer,self.symbols) - #sys.stderr.write( "# line %s\n"%self.lexer.lno ) - if node: - self.append(node) - #node.psource() - #print node.deepstr(),'\n' - #node.act() - - def strip(self,files): - " leave only the declarations from " - i=0 - while i -Released under GNU LGPL license. - -version 0.xx - -This is a module of mixin classes for ir.py . - -Towards the end of ir.py our global class definitions -are remapped to point to the class definitions in ir.py . -So, for example, when we refer to Node we get ir.Node . - -""" - -import sys -from datetime import datetime -from sets import Set - -# XX use this Context class instead of all those kw dicts !! XX -class Context(object): - " just a record (struct) " - def __init__( self, **kw ): - for key, value in kw.items(): - setattr( self, key, value ) - def __getattr__( self, name ): - return None # ? - def __getitem__( self, name ): - return getattr(self, name) - -class OStream(object): - def __init__( self, filename=None ): - self.filename = filename - self.tokens = [] - self._indent = 0 - def put( self, token="" ): - assert type(token) is str - self.tokens.append( token ) - def startln( self, token="" ): - assert type(token) is str - self.tokens.append( ' '*self._indent + token ) - def putln( self, ln="" ): - assert type(ln) is str - self.tokens.append( ' '*self._indent + ln + '\n') - def endln( self, token="" ): - assert type(token) is str - self.tokens.append( token + '\n') - def indent( self ): - self._indent += 1 - def dedent( self ): - self._indent -= 1 - assert self._indent >= 0, self._indent - def join( self ): - return ''.join( self.tokens ) - def close( self ): - s = ''.join( self.tokens ) - f = open( self.filename, 'w' ) - f.write(s) - -# -############################################################################### -# - -class Node(object): - """ - tree structure - """ - _unique_id = 0 - def get_unique_id(cls): - Node._unique_id += 1 - return Node._unique_id - get_unique_id = classmethod(get_unique_id) - -# XX toks: use a tree of tokens: a list that can be push'ed and pop'ed XX - def pyxstr(self,toks=None,indent=0,**kw): - """ - Build a list of tokens; return the joined tokens string - """ - if toks is None: - toks = [] - for x in self: - if isinstance(x,Node): - x.pyxstr(toks, indent, **kw) - else: - toks.insert(0,str(x)+' ') - s = ''.join(toks) - return s - -# -################################################# - -class Named(object): - "has a .name property" - pass - -class BasicType(object): - "float double void char int" - pass - -class Qualifier(object): - "register signed unsigned short long const volatile inline" - def pyxstr(self,toks=None,indent=0,**kw): - if toks is None: - toks = [] - x = self[0] - if x not in ( 'const','volatile','inline','register'): # ignore these - toks.insert(0,str(x)+' ') - s = ''.join(toks) - return s - -class StorageClass(object): - "extern static auto" - def pyxstr(self,toks=None,indent=0,**kw): - return "" - -class Ellipses(object): - "..." - pass - -class GCCBuiltin(BasicType): - "things with __builtin prefix" - pass - -class Identifier(object): - """ - """ - def pyxstr(self,toks=None,indent=0,**kw): - if toks is None: - toks=[] - if self.name: - toks.append( self.name ) - return " ".join(toks) - -class TypeAlias(object): - """ - typedefed things, eg. size_t - """ - def pyxstr(self,toks=None,indent=0,cprefix="",**kw): - if toks is None: - toks = [] - for x in self: - if isinstance(x,Node): - x.pyxstr(toks, indent, cprefix=cprefix, **kw) - else: - s = str(x)+' ' - if cprefix: - s = cprefix+s - toks.insert(0,s) - s = ''.join(toks) - return s - -class Function(object): - """ - """ - def pyxstr(self,toks,indent=0,**kw): - #print '%s.pyxstr(%s)'%(self,toks) - _toks=[] - assert len(self) - i=0 - while isinstance(self[i],Declarator): - if not self[i].is_void(): - _toks.append( self[i].pyxstr(indent=indent, **kw) ) - i=i+1 - toks.append( '(%s)'% ', '.join(_toks) ) - while i&%s' % (self.name, cprefix+self.name) ) - ## expose a python object: - #ostream.putln( '%s.%s = %s' % (modname,self.name, self.name) ) - ostream.putln( '%s = %s( addr = &%s )' % (self.name, self.pyx_adaptor_name(cobjects), cprefix+self.name) ) - return ostream - - -class Typedef(Declarator): - def pyxstr(self,toks=None,indent=0,cprefix="",use_cdef=True,shadow_name=True,**kw): # shadow_name=True - " warning: i do not check if my name is already in 'names' " - assert shadow_name == True - self = self.clone() # <----- NOTE - toks=[] - names = kw.get('names',{}) # what names have been defined ? - kw['names']=names - - #if self.tagged and not self.tagged.tag.name: - ## "typedef struct {...} foo;" => "typedef struct foo {...} foo;" - ## (to be emitted in the node loop below, and suppressed in the final toks.append) - #self.tagged.tag = Tag( self.name ) # this is how pyrex does it: tag.name == self.name - # XX that doesn't work (the resulting c fails to compile) XX - - self._pyxstr( toks, indent, cprefix, use_cdef, shadow_name, **kw ) - - #print self.deepstr() - if self.name and not names.has_key( self.name ): - names[ self.name ] = self - if not (self.tagged and self.name == self.tagged.tag.name): - comment = "" - if self.name in python_kws: - comment = "#" - #if cprefix: - # self.name = '%s%s "%s" ' % ( cprefix, self.name, self.name ) # XX pyrex can't do this - if cprefix: # shadow_name=True - # My c-name gets this prefix. See also TypeAlias.pyxstr(): it also prepends the cprefix. - self.name = '%s%s "%s" ' % ( cprefix, self.name, self.name ) - toks.append( ' '*indent + comment + 'ctypedef ' + Node.pyxstr(self,indent=indent, cprefix=cprefix, **kw).strip() ) - return ' \n'.join(toks) - - -class AbstractDeclarator(Declarator): - """ used in Function; may lack an identifier """ - def pyxstr(self,toks=None,indent=0,**kw): - if self.name in python_kws: - # Would be better to do this in __init__, but our subclass doesn't call our __init__. - self.name = '_' + self.name - #return ' '*indent + Node.pyxstr(self,toks,indent, **kw).strip() - return Node.pyxstr(self,toks,indent, **kw).strip() - - -class FieldLength(object): - """ - """ - def pyxstr(self,toks,indent,**kw): - pass - - -class StructDeclarator(Declarator): # also used in Union - """ - """ - def pyxstr(self,toks=None,indent=0,**kw): - comment = "" - if self.name in python_kws: - comment = "#" - return ' '*indent + comment + Node.pyxstr(self,toks,indent, **kw).strip() - -class DeclarationSpecifiers(object): - """ - """ - pass - -class TypeSpecifiers(DeclarationSpecifiers): - """ - """ - pass - -class Initializer(object): - """ - """ - pass - -class Declaration(object): - """ - """ - pass - -class ParameterDeclaration(Declaration): - """ - """ - pass - -class StructDeclaration(Declaration): - """ - """ - pass - -class TransUnit(object): - """ - Top level node. - """ - def pyx_decls(self, filenames, modname, macros = {}, names = {}, func_cb=None, cprefix="", **kw): - # PART 1: emit extern declarations - ostream = OStream() - now = datetime.today() - ostream.putln( now.strftime('# Code generated by pyxelator on %x at %X') + '\n' ) - ostream.putln("# PART 1: extern declarations") - for filename in filenames: - ostream.putln( 'cdef extern from "%s":\n pass\n' % filename ) - ostream.putln( 'cdef extern from *:' ) - file = None # current file - for node in self: - ostream.putln('') - ostream.putln(' # ' + node.cstr() ) - assert node.marked - comment = False - if node.name and node.name in names: - comment = True # redeclaration - #ostream.putln( node.deepstr( comment=True ) ) - s = node.pyxstr(indent=1, names=names, tag_lookup = self.tag_lookup, cprefix=cprefix, **kw) - if s.split(): - if comment: - s = "#"+s.replace( '\n', '\n#' ) + " # redeclaration " - if node.file != file: - file = node.file - #ostream.putln( 'cdef extern from "%s":' % file ) - ostream.putln( ' # "%s"' % file ) - ostream.putln( s ) - ostream.putln('\n') - #s = '\n'.join(toks) - return ostream.join() - -# XX warn when we find a python keyword XX -python_kws = """ -break continue del def except exec finally pass print raise -return try global assert lambda yield -for while if elif else and in is not or import from """.split() -python_kws = dict( zip( python_kws, (None,)*len(python_kws) ) ) - - diff --git a/tools/python-yasm/pyxelator/ir.py b/tools/python-yasm/pyxelator/ir.py deleted file mode 100755 index cfa9c02e..00000000 --- a/tools/python-yasm/pyxelator/ir.py +++ /dev/null @@ -1,1163 +0,0 @@ -#!/usr/bin/env python -""" ir.py - parse c declarations - -(c) 2002, 2003, 2004, 2005 Simon Burton -Released under GNU LGPL license. - -version 0.xx - -""" - -import sys -#import cPickle as pickle -import pickle - -#from lexer import Lexer -from parse_core import Symbols #, Parser -import node as node_module -import cparse -import genpyx - -class Node(genpyx.Node, node_module.Node): - """ - tree structure - """ - def __init__( self, *args, **kw ): - node_module.Node.__init__( self, *args, **kw ) - self._marked = False - def get_marked( self ): - return self._marked - def set_marked( self, marked ): -# if marked: -# print "MARK", self - self._marked = marked - marked = property( get_marked, set_marked ) - -# def __getstate__( self ): -# return self.__class__, tuple( [ item.__getstate__() for item in self ] ) -# def __setstate__( self, state ): -# cls, states = state -# states = list(states) -# for idx, state in enumerate(states): -# items[idx] = items[idx].__setstate__( - def __getstate__(self): - return str(self) - def __setstate__(self, state): - Node.__init__(self) - self[:] = eval(state) - -# _unique_id = 0 -# def get_unique_id(cls): -# Node._unique_id += 1 -# return Node._unique_id -# get_unique_id = classmethod(get_unique_id) - - def __hash__( self ): - return hash( tuple([hash(type(self))]+[hash(item) for item in self]) ) - - def clone(self): - l = [] - for item in self: - if isinstance(item,Node): - item = item.clone() - l.append(item) - return self.__class__(*l, **self.__dict__) - - def init_from( self, other ): # class method ? - # Warning: shallow init - self[:] = other - self.__dict__.update( other.__dict__ ) - return self - -# def is_struct(self): -# for x in self: -# if isinstance(x,Node): -# if x.is_struct(): -# return 1 -# return 0 - - - #def explain(self): - #l = [] - #for x in self: - #if isinstance(x,Node): - #l.append(x.explain()) - #else: - #l.append(str(x)) - #return string.join(l," ") - ##(self.__class__.__name__,string.join(l) ) - - def psource(self): - if hasattr(self,'lines'): -# print "# "+string.join(self.lines,"\n# ")+"\n" - print "# "+"\n# ".join(self.lines)+"\n" - - def cstr(self,l=None): - """ - Build a list of tokens; return the joined tokens string - """ - if l is None: - l = [] - for x in self: - if isinstance(x,Node): - x.cstr(l) - else: - l.insert(0,str(x)+' ') - s = ''.join(l) - return s - - def ctype(self): # anon_clone - " return clone of self without identifiers " - #print "%s.ctype()"%self - l=[] - for x in self: - if isinstance(x,Node): - l.append(x.ctype()) - else: - l.append(x) - #print "%s.__class__(*%s)"%(self,l) - return self.__class__(*l, **self.__dict__) # XX **self.__dict__ ? - - def cbasetype(self): - " return ctype with all TypeAlias's replaced " - # WARNING: we cache results (so do not mutate self!!) - l=[] - for x in self: - if isinstance(x,Node): - l.append(x.cbasetype()) - else: - l.append(x) - #print "%s.__class__(*%s)"%(self,l) - return self.__class__(*l, **self.__dict__) # XX **self.__dict__ ? - - def signature( self, tank=None ): - if tank is None: - tank = {} - for node in self.nodes(): - if not tank.has_key( type(node) ): - tank[ type(node) ] = {} - type(node).tank = tank[type(node)] - shape = tuple( [ type(_node).__name__ for _node in node ] ) - if not tank[type(node)].has_key(shape): - tank[type(node)][shape] = [] - tank[type(node)][shape].append( node ) - return tank - - def psig( self, tank=None ): - if tank is None: - tank = {} - tank = self.signature(tank) - for key in tank.keys(): - print key.__name__ - for shape in tank[key].keys(): - print " ", shape - -# -################################################# - -class Named(genpyx.Named, Node): - " has a .name property " - def get_name(self): - if self: - assert type(self[0])==str - return self[0] - return None - def set_name(self, name): - if self: - self[0] = name - else: - self.append(name) - name = property(get_name,set_name) - - -class BasicType(genpyx.BasicType, Named): - "float double void char int" - pass - -class Qualifier(genpyx.Qualifier, Named): - "register signed unsigned short long const volatile inline" - pass - -class StorageClass(genpyx.StorageClass, Named): - "extern static auto" - pass - -class Ellipses(genpyx.Ellipses, Named): - "..." - pass - -class GCCBuiltin(genpyx.GCCBuiltin, BasicType): - "things with __builtin prefix" - pass - -class Identifier(genpyx.Identifier, Named): - """ - shape = +( str, +ConstExpr ) - """ - #def explain(self): - #if len(self)==1: - #return "%s"%self.name - #else: - #return "%s initialized to %s"%(self.name, - #Node(self[1]).explain()) # will handle Initializer - -# def ctype(self): -# return self.__class__(*self[1:]) #.clone() ? - -# def get_name(self): -# if self: -# return self[0] -# def set_name(self, name): -# if self: -# self[0] = name -# else: -# self.append(name) -# name = property(get_name,set_name) - - def cstr(self,l=None): - if l is None: - l=[] - if len(self)>1: - assert len(self)==2 - l.append( '%s = %s'%(self[0],self[1]) ) - elif len(self)==1: - l.append( str(self[0]) ) - return " ".join(l) - -class TypeAlias(genpyx.TypeAlias, Named): - """ - typedefed things, eg. size_t - - """ - def cbasetype( self ): - node = self.typedef.cbasetype().get_rest() - return node - -class Function(genpyx.Function, Node): - """ - """ - #def explain(self): - #if len(self): - #return "function (%s), returning"%\ - #", ".join( map(lambda x:x.explain(),self) ) - #else: - #return "function returning" - - def cstr(self,l): - #print '%s.cstr(%s)'%(self,l) - _l=[] - assert len(self) - i=0 - while isinstance(self[i],Declarator): - _l.append( self[i].cstr() ) - i=i+1 - l.append( '(%s)'% ', '.join(_l) ) - while i1 # more than just a tag - def get_members(self): - return self[1:] - members = property(get_members) # fields ? - - def ctype(self): - if not self.tag.name: - #print "# WARNING : anonymous struct " # OK i think - return self.clone() -# self = self.clone() -# return self[:1] # just the tag - return self.__class__( self.tag, **self.__dict__ ) # just the Tag -# return self.__class__( *self, **self.__dict__ ) - - def cbasetype(self): - return self.ctype() # is this enough ??? -# return Node.cbasetype(self) # XX lookup my tag if i am empty ..? - - -class Compound(genpyx.Compound, Taged): - "Struct or Union" - - def cstr(self,_l=None): - assert isinstance( self[0], Tag ) - tag='' - if len(self[0]): - tag=' '+self[0][0] - if isinstance(self,Struct): - l=[ 'struct%s '%tag ] - elif isinstance(self,Union): - l=[ 'union%s '%tag ] - if len(self)>1: - l.append(' { ') - for decl in self[1:]: - l.append( decl.cstr()+"; " ) - l.append('} ') - if _l is None: - _l=[] - while l: - _l.insert( 0, l.pop() ) - # XX empty struct with no tag -> "struct" XX - return "".join( _l ) - - def ctype(self): - tp = Taged.ctype(self) - for i in range(1,len(tp)): - tp[i] = StructDeclarator().init_from( tp[i] ) - return tp - -class Struct(genpyx.Struct, Compound): - """ - """ - pass - - -class Union(genpyx.Union, Compound): - """ - """ - pass - - -class Enum(genpyx.Enum, Taged): - """ - """ - def cstr(self,_l=None): - assert isinstance( self[0], Tag ) - tag='' - if len(self[0]): - tag=' '+self[0][0] - l=[ 'enum%s '%tag ] - if len(self)>1: - l.append(' { ') - for node in self[1:]: - l.append( node.cstr()+', ' ) - l.append('} ') - if _l is None: - _l=[] - while l: - _l.insert( 0, l.pop() ) - return ''.join( _l ) - -class Declarator(genpyx.Declarator, Node): - """ - """ - - def __eq__(self,other): - " unordered equality " - # ordering sometimes gets lost when we do a cbasetype - if not isinstance(other,Node): - return False - a, b = self[:], other[:] - a.sort() - b.sort() - return a == b - - def __hash__( self ): - hs = [hash(item) for item in self] - hs.sort() - return hash( tuple([hash(type(self))]+hs) ) - - def transform(self): - return - - def get_identifier(self): - if len(self)>1: - return self[0] - def set_identifier(self, identifier): - if len(self)>1: - self[0] = identifier - else: - self.insert(0,identifier) - identifier = property(get_identifier,set_identifier) - - def get_spec(self): - spec = self[-1] - if type(spec)==TypeSpecifiers: # isinstance ?? - return spec - spec = property(get_spec) - - def get_type_alias(self): - if self.spec: - if isinstance(self.spec[0], TypeAlias): - return self.spec[0] - type_alias = property(get_type_alias) - - def get_tagged(self): - if self.spec: - return self.spec.tagged # i am a tagged - tagged = property(get_tagged) - - def get_compound(self): - if self.spec: - return self.spec.compound # i am a compound - compound = property(get_compound) - - def get_struct(self): - if self.spec: - return self.spec.struct # i am a struct - struct = property(get_struct) - - def get_union(self): - if self.spec: - return self.spec.union # i am a union - union = property(get_union) - - def get_enum(self): - if self.spec: - return self.spec.enum # i am an enum - enum = property(get_enum) - - def get_function(self): - if len(self)>1 and type(self[1])==Function: # isinstance ?? - return self[1] - function = property(get_function) - - def get_pointer(self): - if len(self)>1 and type(self[1])==Pointer: # isinstance ?? - return self[1] - pointer = property(get_pointer) - - def get_array(self): - if len(self)>1 and type(self[1])==Array: # isinstance ?? - return self[1] - array = property(get_array) - - def get_name(self): - if self.identifier: - return self.identifier.name - def set_name(self, name): - assert self.identifier is not None - self.identifier.name = name - name = property(get_name, set_name) - - def get_rest(self): # XX needs a better name - if len(self)>1: - return self[1] - return self[0] - - def pointer_to( self ): - " return Declarator pointing to self's type " - decl = Declarator(Identifier(), Pointer(self.get_rest().clone())) - return decl - - def deref( self ): - " return (clone of) Declarator that self is pointing to " - node = self.ctype() # clone - pointer = node.pointer or node.array - assert pointer, "cannot dereference non-pointer" - node[1:2] = pointer - return node - - def is_void(self): - return self.spec and BasicType('void') in self.spec - - def is_pointer_to_fn(self): - return self.pointer and self.deref().function - - def is_pointer_to_char(self): -# return self.ctype() == TransUnit("char *a;").transform()[0].ctype() - node = self.pointer or self.array - if node: - spec = node.spec - if spec and BasicType('char') in spec and not BasicType('unsigned') in spec: - return True - return False - - def is_callback(self): - " i am a pointer to a function whose last arg is void* " - if self.is_pointer_to_fn(): - fn = self.deref().function - if fn.args: - arg = fn.args[-1] - if arg.pointer and arg.deref().is_void(): - return True - - def is_complete( self, tag_lookup ): - if self.tagged and self.tagged.tag.name in tag_lookup and not tag_lookup[self.tagged.tag.name].has_members(): - return False - return True - - def is_primative( self ): - "i am a char,short,int,float,double... " - spec = self.cbasetype().spec - return spec and spec.find(BasicType) - - def is_pyxnative( self ): - # pyrex handles char* too - # but i don't know if we should make this the default - # sometimes we want to send a NULL, so ... XXX - self = self.cbasetype() - if self.is_void(): - return False - if self.is_primative(): - return True - if self.enum: - return True -# pointer = None -# if self.pointer: -# pointer = self.pointer -# elif self.array: -# pointer = self.array -# if pointer and pointer.spec: -# spec = pointer.spec -# if BasicType("char") in spec and not Qualifier("unsigned") in spec: -# # char*, const char* -## print self.deepstr() -# return True - return False - - def cstr(self,l=None): - return Node.cstr(self,l).strip() - - def ctype(self): - decl=Declarator() - decl.init_from( self.clone() ) - decl.identifier = Identifier() - for i in range(1,len(decl)): - decl[i]=decl[i].ctype() - return decl - - def cbasetype(self): - # WARNING: we cache results (so do not mutate self!!) - try: - # this cache improves performance by 50% - return self.__cbasetype.clone() - except AttributeError: - pass - decl = self.ctype() # gets rid of Identifier names - for i, node in enumerate(decl): - decl[i] = decl[i].cbasetype() -# return decl.get_rest() - - done = False - while not done: - done = True - nodes = decl.deepfilter( TypeSpecifiers ) - for node in nodes: - if node.deepfind( TypeSpecifiers ) != node: - # this node has another TypeSpecifier; - decl.expose_node( node ) - done = False - break # start again... - - # each TypeSpecifier needs to absorb primitive siblings (StorageClass, BasicType etc.) - nodes = decl.deepfilter( TypeSpecifiers ) - for node in nodes: - parent = decl.get_parent(node) - i = 0 - while i < len(parent): - assert not type(parent[i]) in (TypeAlias, Enum, Struct, Union) - if type(parent[i]) in (StorageClass, BasicType, Qualifier): - node.append( parent.pop(i) ) - else: - i = i + 1 - - self.__cbasetype = decl.clone() - return decl - - def invalidate(self): - # flush cache, etc. - try: - del self.__cbasetype - except AttributeError: - pass - - def declare_str(self,name): - " return c string declaring name with same type as self " - tp = self.ctype() - tp.name = name - return tp.cstr()+";" - -class Typedef(genpyx.Typedef, Declarator): - def cstr(self,l=None): - return 'typedef ' + Declarator.cstr(self,l) #.strip() - -class AbstractDeclarator(genpyx.AbstractDeclarator, Declarator): - """ used in Function; may lack an identifier """ - - #def cstr(self,l=None): - #return Node.cstr(self,l) - -# def ctype(self): -# # _type_ ignores the name of our identifier -# return Node.ctype(self) - -class FieldLength(genpyx.FieldLength, Node): - """ - """ - #def explain(self): - #return "" - - def cstr(self,l): - l.append(':%s'%self[0]) - -class StructDeclarator(genpyx.StructDeclarator, Declarator): # also used in Union - """ - """ - #def explain(self): - #flen = self.find(FieldLength) - #if flen is not None: - #i = self.index(flen) - #self.pop(i) - #s = Declarator.explain(self) - #self.insert(i,flen) - #width = flen[0] - #if width > 0: - #return s+" bitfield %s wide"%width - #else: - #return s+" alignment bitfield" - #else: - #return Declarator.explain(self) -# def ctype(self): -# return self - def get_field_length(self): - if len(self)>1 and isinstance( self[1], FieldLength ): - return self[1] - field_length = property(get_field_length) - - -class DeclarationSpecifiers(genpyx.DeclarationSpecifiers, Node): -#class TypeSpecifiers(Node): - """ - """ - def __eq__(self,other): - " unordered equality " - if not isinstance(other,Node): - return False - a, b = self[:], other[:] - a.sort() - b.sort() - return a == b - - def __hash__( self ): - hs = [hash(item) for item in self] - hs.sort() - return hash( tuple([hash(type(self))]+hs) ) - -# def is_struct(self): -# return self.find(Struct) is not None - - -class TypeSpecifiers(genpyx.TypeSpecifiers, DeclarationSpecifiers): - """ - """ - def get_tagged(self): - if self and isinstance(self[0],Taged): - return self[0] - tagged = property(get_tagged) - - def get_compound(self): - if self and isinstance(self[0],Compound): - return self[0] - compound = property(get_compound) - - def get_struct(self): - if self and isinstance(self[0],Struct): - return self[0] - struct = property(get_struct) - - def get_union(self): - if self and isinstance(self[0],Union): - return self[0] - union = property(get_union) - - def get_enum(self): - if self and isinstance(self[0],Enum): - return self[0] - enum = property(get_enum) - - def cbasetype(self): - node = Node.cbasetype(self) -# node.expose( TypeSpecifiers ) -# if node.deepfind(TypeSpecifiers) != node: - return node - -class Initializer(genpyx.Initializer, Node): - """ - """ - pass - - - -class Declaration(genpyx.Declaration, Node): - """ - """ - def do_spec(self): - " distribute DeclarationSpecifiers over each Declarator " - spec=self[0] - assert isinstance(spec,DeclarationSpecifiers), spec.deepstr() - self.pop(0) - for declarator in self: - assert isinstance(declarator,Declarator) - #if isinstance(declarator,DeclarationSpecifiers #huh? - ##for node in spec: - ##declarator.append(node.clone()) - declarator.append(spec) - - def transform(self): - # children go first - for node in self.nodes(): - if isinstance(node,Declaration): - node.do_spec() - node.file = self.file # overkill ? - self.expose(Declaration) - - #def explain(self): - #return string.join([x.explain() for x in self],", ") - #return string.join(map(lambda x:x.explain(),self),", ") - - -class ParameterDeclaration(genpyx.ParameterDeclaration, Declaration): - """ - """ - pass - - -class StructDeclaration(genpyx.StructDeclaration, Declaration): - """ - """ - pass - - -class TransUnit(genpyx.TransUnit, Node): - """ - Top level node. - """ - def __init__( self, item ): # XX __init__ uses different signature ! XX - if type(item)==str: - node = cparse.TransUnit() - node.parse(item) - else: - node = item - assert isinstance( node, cparse.TransUnit ), str(node) - Node.__init__(self) - self[:] = [ self.convert(child) for child in node ] - self.__dict__.update( node.__dict__ ) - assert "name" not in node.__dict__ - - self.syms = {} # map identifier names to their Declarator's - self.typedefs = {} # map names to Typedef's - self.tag_lookup = {} # map struct, union, enum tags to Taged's - - # XX should call transform here XX - -# print self.deepstr() - def __getstate__( self ): - nodes = tuple( [ repr(node) for node in self ] ) - typedefs = tuple( [ (key,repr(val)) for key,val in self.typedefs.items() ] ) - return nodes, typedefs - def __setstate__( self, state ): - Node.__init__(self) - nodes, typedefs = state - nodes = [ eval(node) for node in nodes ] - self[:] = nodes - typedefs = [ (key,eval(val)) for key,val in typedefs ] - self.typedefs = dict(typedefs) - - def convert( self, node ): -# name = node.__class__.__name__ -# cls = globals()[ name ] - cls = cls_lookup[ type(node) ] - _node = cls() - for child in node: - if isinstance(child, node_module.Node): - child = self.convert( child ) - else: - assert child is None or type(child) in (str, int), type(child) - _node.append( child ) - _node.__dict__.update( node.__dict__ ) - return _node - - def strip(self,files): - " leave only the declarations from " - i=0 - while i -Released under GNU LGPL license. - -version 0.xx - -""" - -import sys -import string -import types -import copy - -#from cparse import BasicType, Qualifier, StorageClass, Typedef, Ellipses, GCCBuiltin -#from cparse import * - -import cparse as host - -class LexError(Exception): - pass - -class Lexer(object): - def __init__(self,s="",verbose=0,**kw): - self.verbose = verbose - self.lookup = {} # a map for keywords and typedefs - for t in \ - "float double void char int".split(): - self.lookup[t] = host.BasicType( t ) - for t in \ - "register signed unsigned short long const volatile inline".split(): # inline here ??? - self.lookup[t] = host.Qualifier( t ) - for t in "extern static auto".split(): - self.lookup[t] = host.StorageClass( t ) - self.lookup['typedef'] = host.Typedef() - #self.lookup['__inline__'] = host.GCCBuiltin('__inline__') - #self.lookup['__extension__'] = host.Qualifier('__extension__') - self.lookup['...'] = host.Ellipses() - if s: - self.lex(s) - for key in kw.keys(): - self.__dict__[key] = kw[key] - - def lex(self,s): - self.stack = None - self.lines = s.splitlines() - self.set_state("","",0,0) - self.so_file = "" - self._newline() - self.get_token() # start - - def mktypedef(self,tok,node): - if self.verbose: - print "%s.mktypedef(%s,%s)"%(self,tok,node) - self.lookup[ tok ] = node - - def rmtypedef(self,tok): - " used in round trip testing " -# print "# rmtypedef(%s)"%tok - assert isinstance( self.lookup[ tok ], host.Node ) # existance - del self.lookup[ tok ] - - def _get_kind(self,tok): - #print '_get_kind(%s)'%tok,self.lookup - try: - return self.lookup[tok] - #return self.lookup[tok].clone() - except KeyError: - if tok.startswith("__builtin"): - node = host.GCCBuiltin(tok) - self.lookup[tok] = node - return node - #elif tok in ( "__extension__", ): - #node = GCCBuiltin(tok) - #self.lookup[tok] = node - #return node - return None - - def _newline(self): - while self.lno < len(self.lines): - line = self.lines[self.lno] - if not line or line[0] != "#": - break - l = line.split('"') - assert len(l)>=2 - self.so_file = l[1] - #self.so_lno = int( l[0].split()[1] ) - #sys.stderr.write("# %s %s: %s\n"%(so_lno,so_file,l)) - self.lno+=1 - - def get_brace_token( self ): - self.push_state() - ident_chars0 = string.letters+"_" - ident_chars1 = string.letters+string.digits+"_" - tok, kind = "", "" - while self.lno < len(self.lines): - s = self.lines[self.lno] - i=self.col - while i < len(s): - if s[i] not in '{}': - i=i+1 - continue - else: - tok = s[i] - kind = tok - self.col = i+1 - break - # keep moving - #sys.stderr.write( "lexer ignoring '%s'\n"%s[i] ) - i=i+1 - if i==len(s): - # nothing found - assert tok == "" - self.col=0 - self.lno+=1 - self._newline() - else: - assert tok - break - self.set_state(tok,kind,self.lno,self.col) - - def get_token(self): - self.push_state() - ident_chars0 = string.letters+"_" - ident_chars1 = string.letters+string.digits+"_" - tok, kind = "", "" - while self.lno < len(self.lines): - s = self.lines[self.lno] - i=self.col - while i < len(s): - if s[i].isspace(): - i=i+1 - continue - #if s[i] in ident_chars0: - if s[i].isalpha() or s[i]=='_': - # identifier - j=i+1 - while j|&': - tok = s[i] - kind = tok - self.col = i+1 - break - if s[i] == "'": - j = i+2 - while j -Released under GNU LGPL license. - -version 0.xx - -""" - -import string - - -class Node(list): - " A node in a parse tree " - - def __init__(self,*items,**kw): - list.__init__( self, items ) - self.lock1 = 0 # these two should be properties (simplifies serializing) - self.lock2 = 0 - self.verbose = 0 - for key in kw.keys(): - self.__dict__[key] = kw[key] - - def __str__(self): - attrs = [] - for item in self: - if isinstance(item,Node): - attrs.append( str(item) ) - else: - attrs.append( repr(item) ) - attrs = ','.join(attrs) - return "%s(%s)"%(self.__class__.__name__,attrs) - - def safe_repr( self, tank ): - tank[ str(self) ] = None - attrs = [] - for item in self: - if isinstance(item,Node): - attrs.append( item.safe_repr(tank) ) # can we use repr here ? - else: - attrs.append( repr(item) ) - # this is the dangerous bit: - for key, val in self.__dict__.items(): - if isinstance(val,Node): - if str(val) not in tank: - attrs.append( '%s=%s'%(key,val.safe_repr(tank)) ) - else: - attrs.append( '%s=%s'%(key,repr(val)) ) - attrs = ','.join(attrs) - return "%s(%s)"%(self.__class__.__name__,attrs) - - def __repr__(self): - #attrs = ','.join( [repr(item) for item in self] + \ - # [ '%s=%s'%(key,repr(val)) for key,val in self.__dict__.items() ] ) - #return "%s%s"%(self.__class__.__name__,tuple(attrs)) - return self.safe_repr({}) - - def __eq__(self,other): - if not isinstance(other,Node): - return 0 - if len(self)!=len(other): - return 0 - for i in range(len(self)): - if not self[i]==other[i]: - return 0 - return 1 - - def __ne__(self,other): - return not self==other - - def filter(self,cls): - return [x for x in self if isinstance(x,cls)] - #return filter( lambda x:isinstance(x,cls), self ) - - def deepfilter(self,cls): - " bottom-up " - return [x for x in self.nodes() if isinstance(x,cls)] - - def find(self,cls): - for x in self: - if isinstance(x,cls): - return x - return None - - def deepfind(self,cls): - " bottom-up isinstance search " - for x in self: - if isinstance(x,Node): - if isinstance(x,cls): - return x - node = x.deepfind(cls) - if node is not None: - return node - if isinstance(self,cls): - return self - return None - - def leaves(self): - for i in self: - if isinstance( i, Node ): - for j in i.leaves(): - yield j - else: - yield i - - def nodes(self): - " bottom-up iteration " - for i in self: - if isinstance( i, Node ): - for j in i.nodes(): - yield j - yield self - - def deeplen(self): - i=0 - if not self.lock2: - self.lock2=1 - for item in self: - i+=1 - if isinstance(item,Node): - i+=item.deeplen() - self.lock2=0 - else: - i+=1 - return i - - def deepstr(self,level=0,comment=False,nl='\n',indent=' '): - if self.deeplen() < 4: - nl = ""; indent = "" - #else: - #nl="\n"; indent = " " - s = [] - if not self.lock1: - self.lock1=1 - for item in self: - if isinstance(item,Node): - s.append( indent*(level+1)+item.deepstr(level+1,False,nl,indent) ) - else: - s.append( indent*(level+1)+repr(item) ) - self.lock1=0 - else: - for item in self: - if isinstance(item,Node): - s.append( indent*(level+1)+"" ) - else: - s.append( indent*(level+1)+"%s"%repr(item) ) - s = "%s(%s)"%(self.__class__.__name__,nl+string.join(s,","+nl)) - if comment: - s = '#' + s.replace('\n','\n#') - return s - - def clone(self): - items = [] - for item in self: - if isinstance(item,Node): - item = item.clone() - items.append(item) - # we skip any attributes... - return self.__class__(*items) - - def fastclone(self): - # XX is it faster ??? - #print "clone" - nodes = [self] - idxs = [0] - itemss = [ [] ] - while nodes: - assert len(nodes)==len(idxs)==len(itemss) - node = nodes[-1] - items = itemss[-1] - assert idxs[-1] == len(items) - while idxs[-1]==len(node): - # pop - _node = node.__class__( *items ) - _node.__dict__.update( node.__dict__ ) - nodes.pop(-1) - idxs.pop(-1) - itemss.pop(-1) - if not nodes: - #for node0 in self.nodes(): - #for node1 in _node.nodes(): - #assert node0 is not node1 - #assert _node == self - return _node # Done !! - node = nodes[-1] - items = itemss[-1] - items.append(_node) # set - idxs[-1] += 1 - assert idxs[-1] == len(items) - #assert idxs[-1] < len(node), str( (node,nodes,idxs,itemss) ) - - _node = node[ idxs[-1] ] - # while idxs[-1] instance ' - # children first - for x in self: - if isinstance(x,Node): - x.expose(cls) - # now the tricky bit - i=0 - while i < len(self): - if isinstance(self[i],cls): - node=self.pop(i) - for x in node: - assert not isinstance(x,cls) - # pass on some attributes - if hasattr(node,'lines') and not hasattr(x,'lines'): - x.lines=node.lines - if hasattr(node,'file') and not hasattr(x,'file'): - x.file=node.file - self.insert(i,x) # expose - i=i+1 - assert i<=len(self) - else: - i=i+1 - - def get_parent( self, item ): # XX 25% CPU time here XX - assert self != item - if item in self: - return self - for child in self: - if isinstance(child, Node): - parent = child.get_parent(item) - if parent is not None: - return parent - return None - - def expose_node( self, item ): - assert self != item - parent = self.get_parent(item) - idx = parent.index( item ) - parent[idx:idx+1] = item[:] - - def delete(self,cls): - ' delete any subtree ' - for x in self: - if isinstance(x,Node): - x.delete(cls) - # now the tricky bit - i=0 - while i < len(self): - if isinstance(self[i],cls): - self.pop(i) - else: - i=i+1 - - def deeprm(self,item): - ' remove any items matching ' - for x in self: - if isinstance(x,Node): - x.deeprm(item) - # now the tricky bit - i=0 - while i < len(self): - if self[i] == item: - self.pop(i) - else: - i=i+1 - - def idem(self,cls): - " is made idempotent " - # children first - for x in self: - if isinstance(x,Node): - x.idem(cls) - if isinstance(self,cls): - # now the tricky bit - i=0 - while i < len(self): - if isinstance(self[i],cls): - node = self.pop(i) - for x in node: - assert not isinstance(x,cls) - self.insert(i,x) # idempotent - i=i+1 - assert i<=len(self) - else: - i=i+1 - -if __name__=="__main__": - node = Node( 'a', Node(1,2), Node(Node(Node(),1)) ) - - print node - print node.clone() - - - - diff --git a/tools/python-yasm/pyxelator/parse_core.py b/tools/python-yasm/pyxelator/parse_core.py deleted file mode 100755 index 84fb8941..00000000 --- a/tools/python-yasm/pyxelator/parse_core.py +++ /dev/null @@ -1,106 +0,0 @@ -#!/usr/bin/env python -""" cdecl.py - parse c declarations - -(c) 2002, 2003, 2004, 2005 Simon Burton -Released under GNU LGPL license. - -version 0.xx - -""" - -import sys - - -class Symbols(object): - def __init__(self,parent=None,verbose=False): - self.verbose = verbose - self.parent=parent # are we a nested namespace? - self.lookup = {} # identifiers - self.tags = {} # struct, union, enum tags - - def __str__(self): - return "Symbols(%s,%s)"%(self.lookup,self.tags) - - def __getitem__(self,key): - try: - item = self.lookup[key] - except KeyError: - item = None - #if self.parent is not None: - #item = self.parent[item] - ## self[key] = item # cache - #if self.verbose: print "%s.get('%s')='%s'"%(self,key,item) - return item - - def __setitem__(self,key,val): - #if self.verbose: print "%s.set('%s','%s')"%(self,key,val) - assert val is not None - self.lookup[key] = val - - def set_tag(self,key,val): - #if self.verbose: print "%s.set_tag(%s,%s)"%(self,key,val) - assert len(key) - self.tags[key] = val - - def deep_get_tag(self,key): - try: - item = self.tags[key] - except KeyError: - item = None - if self.parent is not None: - item = self.parent.deep_get_tag(key) - #if self.verbose: print "%s.get_tag(%s)=%s"%(self,key,item) - return item - - def get_tag(self,key): - try: - item = self.tags[key] - except KeyError: - item = None - #if self.verbose: print "%s.get_tag(%s)=%s"%(self,key,item) - return item - -################################################################### -# -################################################################### -# - - -class ParseError(Exception): - def __init__(self,*e): - self.e = e - - def __str__(self): - return "".join(map(str,self.e)) - - -class Parser(object): - def parse_error(self,lexer,reason="?",*blah): - sys.stderr.write( "%s.parse_error()\n"%self.deepstr() ) - sys.stderr.write( "at line %s: %s\n"%(lexer.lno+1,reason) ) - sys.stderr.write( lexer.err_string() ) - raise ParseError(reason,*blah) - - def expected_error(self,lexer,*l): - self.parse_error( lexer, "expected %s, got '%s'"\ - %(" or ".join(map(repr,l)),lexer.tok)) - - def consume(self,lexer,tok): - if lexer.tok != tok: - self.expected_error(lexer, tok) - lexer.get_token() - - def parse_enter(self,lexer): - #return - self.start_lno=lexer.lno - self.file=lexer.so_file - - def parse_leave(self,lexer): - #return - self.lines = lexer.lines[self.start_lno:max(lexer.lno,self.start_lno+1)] - -################################################################### -# -################################################################### -# - diff --git a/tools/python-yasm/pyxelator/work_unit.py b/tools/python-yasm/pyxelator/work_unit.py deleted file mode 100755 index 0d888f8b..00000000 --- a/tools/python-yasm/pyxelator/work_unit.py +++ /dev/null @@ -1,177 +0,0 @@ -#!/usr/bin/env python - -""" - -(c) 2002, 2003, 2004, 2005 Simon Burton -Released under GNU LGPL license. - -version 0.xx - -""" - - -import sys -import os - -import cparse -import ir - -class WorkUnit(object): - def __init__(self, files, modname, filename, - std=False, strip=False, mark_cb=None, - extradefs="", use_header=None, CC="gcc", CPP="gcc -E", - CPPFLAGS=""): - self.files = tuple(files) - self.modname = modname - self.filename = filename - self.CPPFLAGS = CPPFLAGS - self.CPP = CPP - if CC == 'g++': - self.CPPFLAGS += " -D__cplusplus" - self.std = std - self.strip = strip - self.mark_cb = mark_cb - self.node = None - self.extradefs = extradefs - self.CC = CC - self.use_header = use_header - - def mkheader( self ): - if self.use_header: - return self.use_header - tmpname = str(abs(hash( (self.files,self.CPPFLAGS) ))) - name = '.tmp/%s' % tmpname - ifile = open( name+'.h', "w" ) - ifile.write( """ -#define __attribute__(...) -#define __const const -#define __restrict -#define __extension__ -#define __asm__(...) -#define __asm(...) -#define __inline__ -#define __inline -""" ) - for filename in self.files: - if self.std: - line = '#include <%s>\n'%filename - else: - line = '#include "%s"\n'%filename - ifile.write( line ) - print line, - ifile.close() - cmd = '%s %s %s > %s'%(self.CPP,name+'.h',self.CPPFLAGS,name+'.E') - sys.stderr.write( "# %s\n" % cmd ) - status = os.system( cmd ) - assert status == 0, "command failed: %s"%cmd - assert open(name+'.E').read().count('\n') > 10, "failed to run preprocessor" - cmd = '%s -dM %s %s > %s'%(self.CPP,name+'.h',self.CPPFLAGS,name+'.dM') - sys.stderr.write( "# %s\n" % cmd ) - status = os.system( cmd ) - assert status == 0, "command failed: %s"%cmd - assert open(name+'.dM').read().count('\n') > 10, "failed to run preprocessor with -dM" - return name - - def parse(self, verbose=False): - sys.stderr.write( "# parse %s\n" % str(self.files) ) - name = self.mkheader() - # read macros - f = open(name+'.dM') - macros = {} - for line in f.readlines(): - if line: - macro = line.split()[1] - if macro.count('('): - macro = macro[:macro.index('(')] - macros[macro] = None - #keys = macros.keys() - #keys.sort() - #for key in keys: - #print key - self.macros = macros - # parse preprocessed code - f = open(name+'.E') - s = f.read() + self.extradefs - self.node = cparse.TransUnit(verbose = verbose) - sys.stderr.write( "# parsing %s lines\n" % s.count('\n') ) - self.node.parse( s ) - if self.strip: - self.node.strip(self.files) - - def transform(self, verbose=False, test_parse=False, test_types=False): - sys.stderr.write( "# processing...\n" ) - self.node = ir.TransUnit( self.node ) - self.node.transform(verbose, test_parse, test_types) - #self.node[0].psource() - if self.mark_cb is not None: - self.node.mark(self.mark_cb,verbose=False) - - def output( self, func_cb = None ): - sys.stderr.write( "# pyxstr...\n" ) - decls = self.node.pyx_decls(self.files, self.modname, macros = self.macros, func_cb = func_cb, names={}, cprefix="" ) - - name = self.filename - assert name.endswith(".pyx") - - pxi = name[:-3]+'pxi' - file = open( pxi, "w" ) - file.write(decls) - sys.stderr.write( "# wrote %s, %d lines\n" % (pxi,decls.count('\n')) ) - - def pprint(self): - for decl in self.node: - #decl.psource() - #cstr = decl.cstr() - #cstr = cstr.replace( '\n', '\n# ' ) - print - #print '#', cstr - print decl.deepstr() - -def file_exists(path): - try: - os.stat(path) - return True - except OSError: - return False - -if sys.platform.count('darwin'): - shared_ext = '.dylib' -else: - shared_ext = '.so' - -def get_syms(libs, libdirs): - # XX write interface to objdump -t XX - libnames = [] - for lib in libs: - for ext in shared_ext,'.a': - libname = 'lib'+lib+ext - for libdir in libdirs: - path = libdir+'/'+libname - if file_exists(path): - libnames.append(path) - break - #else: - #print "cannot find %s lib as %s in %s" % ( lib, libname, libdir ) - print 'libnames:', libnames - syms = {} - accept = [ ' %s '%c for c in 'TVWBCDGRS' ] - #f = open('syms.out','w') - for libname in libnames: - fin, fout = os.popen2( 'nm %s' % libname ) - for line in fout.readlines(): - for acc in accept: - if line.count(acc): - left, right = line.split(acc) - sym = right.strip() - if sys.platform.count('darwin'): - if sym[0] == '_': - sym = sym[1:] # remove underscore prefix - if sym.endswith('.eh'): - sym = sym[:-len('.eh')] - syms[sym] = None - #f.write( '%s: %s %s\n' % (sym,line[:-1],libname) ) - break - return syms - - - diff --git a/tools/python-yasm/pyxelator/wrap_yasm.py b/tools/python-yasm/pyxelator/wrap_yasm.py deleted file mode 100755 index 45ee6237..00000000 --- a/tools/python-yasm/pyxelator/wrap_yasm.py +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env python - -""" - -(c) 2002, 2003, 2004, 2005 Simon Burton -Released under GNU LGPL license. - -version 0.xx - -""" - - -import sys -import os - -from work_unit import WorkUnit, get_syms -import ir - - -def mk_tao(CPPFLAGS = "", CPP = "gcc -E", modname = '_yasm', oname = None, YASM_DIR = ".", **options): - if oname is None: - oname = modname+'.pyx' - CPPFLAGS += " -I"+YASM_DIR - CPPFLAGS += " -DYASM_PYXELATOR" - CPPFLAGS += " -DYASM_LIB_INTERNAL" - CPPFLAGS += " -DYASM_BC_INTERNAL" - CPPFLAGS += " -DYASM_EXPR_INTERNAL" - files = [ 'libyasm.h', 'libyasm/assocdat.h' ] - - syms = get_syms( ['yasm'], [YASM_DIR] ) - def cb(trans_unit, node, *args): - name, file = node.name, node.file - return True - return name in syms - extradefs = "" - unit = WorkUnit(files,modname,oname,False,mark_cb=cb,extradefs=extradefs, - CPPFLAGS=CPPFLAGS, CPP=CPP, **options) - - - unit.parse( False ) - unit.transform(verbose=False, test_parse=False, test_types=False) - unit.output() - -def main(): - options = {} - for i,arg in enumerate(sys.argv[1:]): - if arg.count('='): - key,val = arg.split('=', 1) - options[key]=val - mk_tao(**options) - -if __name__=="__main__": - main() - - - - diff --git a/tools/python-yasm/setup.py b/tools/python-yasm/setup.py deleted file mode 100644 index 60e2364d..00000000 --- a/tools/python-yasm/setup.py +++ /dev/null @@ -1,92 +0,0 @@ -#! /usr/bin/env python -# Build Python extension with configuration file input -# -# Copyright (C) 2006 Peter Johnson -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. - -from distutils.core import setup -from distutils.extension import Extension -from Pyrex.Distutils import build_ext -from os.path import basename, join, exists - -def ReadSetup(filename): - """ReadSetup goes through filename and parses out the values stored - in the file. Values need to be stored in a - \"key=value format\"""" - return dict(line.split('=', 1) for line in open(filename)) - -def ParseCPPFlags(flags): - """parse the CPPFlags macro""" - incl_dir = [x[2:] for x in flags.split() if x.startswith("-I")] - cppflags = [x for x in flags.split() if not x.startswith("-I")] - cppflags.append("-DYASM_LIB_INTERNAL") - cppflags.append("-DYASM_BC_INTERNAL") - cppflags.append("-DYASM_EXPR_INTERNAL") - return (incl_dir, cppflags) - -def ParseSources(src, srcdir): - """parse the Sources macro""" - # do the dance of detecting if the source file is in the current - # directory, and if it's not, prepend srcdir - sources = [] - for tok in src.split(): - if tok.endswith(".c"): - fn = tok - elif tok.endswith(".y"): - fn = basename(tok)[:-2] + ".c" - else: - continue - if not exists(fn): - fn = join(srcdir, fn) - sources.append(fn) - - return sources - -def RunSetup(incldir, cppflags, sources): - setup( - name='yasm', - version='0.0', - description='Python bindings for Yasm', - author='Michael Urman, Peter Johnson', - url='http://www.tortall.net/projects/yasm', - ext_modules=[ - Extension('yasm', - sources=sources, - extra_compile_args=cppflags, - include_dirs=incldir, - library_dirs=['.'], - libraries=['yasm'], - ), - ], - cmdclass = dict(build_ext=build_ext), - ) - -if __name__ == "__main__": - opts = ReadSetup("python-setup.txt") - incldir, cppflags = ParseCPPFlags(opts["includes"]) - sources = ParseSources(opts["sources"], opts["srcdir"].strip()) - sources.append('yasm_python.c') - if opts["gcc"].strip() == "yes": - cppflags.append('-w') - RunSetup(incldir, cppflags, sources) - diff --git a/tools/python-yasm/symrec.pxi b/tools/python-yasm/symrec.pxi deleted file mode 100644 index d91fe7f5..00000000 --- a/tools/python-yasm/symrec.pxi +++ /dev/null @@ -1,285 +0,0 @@ -# Python bindings for Yasm: Pyrex input file for symrec.h -# -# Copyright (C) 2006 Michael Urman, Peter Johnson -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. - -cdef class Symbol: - cdef yasm_symrec *sym - - def __new__(self, symrec): - self.sym = NULL - if PyCObject_Check(symrec): - self.sym = __get_voidp(symrec, Symbol) - else: - raise NotImplementedError - - # no deref or destroy necessary - - property name: - def __get__(self): return yasm_symrec_get_name(self.sym) - - property status: - def __get__(self): - cdef yasm_sym_status status - s = set() - status = yasm_symrec_get_status(self.sym) - if status & SYM_USED: s.add('used') - if status & SYM_DEFINED: s.add('defined') - if status & SYM_VALUED: s.add('valued') - return s - - property in_table: - def __get__(self): - return bool(yasm_symrec_get_status(self.sym) & - SYM_NOTINTABLE) - - property visibility: - def __get__(self): - cdef yasm_sym_vis vis - s = set() - vis = yasm_symrec_get_visibility(self.sym) - if vis & YASM_SYM_GLOBAL: s.add('global') - if vis & YASM_SYM_COMMON: s.add('common') - if vis & YASM_SYM_EXTERN: s.add('extern') - if vis & YASM_SYM_DLOCAL: s.add('dlocal') - return s - - property equ: - def __get__(self): - cdef yasm_expr *e - e = yasm_symrec_get_equ(self.sym) - if not e: - raise AttributeError("not an EQU") - return __make_expression(yasm_expr_copy(e)) - - property label: - def __get__(self): - cdef yasm_symrec_get_label_bytecodep bc - if yasm_symrec_get_label(self.sym, &bc): - return None #Bytecode(bc) - else: - raise AttributeError("not a label or not defined") - - property is_special: - def __get__(self): return bool(yasm_symrec_is_special(self.sym)) - - property is_curpos: - def __get__(self): return bool(yasm_symrec_is_curpos(self.sym)) - - def get_data(self): pass # TODO - #return (yasm_symrec_get_data(self.sym, PyYasmAssocData)) - - def set_data(self, data): pass # TODO - #yasm_symrec_set_data(self.sym, PyYasmAssocData, data) - -# -# Use associated data mechanism to keep Symbol reference paired with symrec. -# - -cdef void __python_symrec_cb_destroy(void *data): - Py_DECREF(data) -cdef void __python_symrec_cb_print(void *data, FILE *f, int indent_level): - pass -__python_symrec_cb = __assoc_data_callback( - PyCObject_FromVoidPtr(&__python_symrec_cb_destroy, NULL), - PyCObject_FromVoidPtr(&__python_symrec_cb_print, NULL)) - -cdef object __make_symbol(yasm_symrec *symrec): - cdef void *data - __error_check() - data = yasm_symrec_get_data(symrec, - (<__assoc_data_callback>__python_symrec_cb).cb) - if data != NULL: - return data - symbol = Symbol(__pass_voidp(symrec, Symbol)) - yasm_symrec_add_data(symrec, - (<__assoc_data_callback>__python_symrec_cb).cb, - symbol) - Py_INCREF(symbol) # We're keeping a reference on the C side! - return symbol - -cdef class Bytecode -cdef class SymbolTable - -cdef class SymbolTableKeyIterator: - cdef yasm_symtab_iter *iter - - def __new__(self, symtab): - if not isinstance(symtab, SymbolTable): - raise TypeError - self.iter = yasm_symtab_first((symtab).symtab) - - def __iter__(self): - return self - - def __next__(self): - if self.iter == NULL: - raise StopIteration - rv = yasm_symrec_get_name(yasm_symtab_iter_value(self.iter)) - self.iter = yasm_symtab_next(self.iter) - return rv - -cdef class SymbolTableValueIterator: - cdef yasm_symtab_iter *iter - - def __new__(self, symtab): - if not isinstance(symtab, SymbolTable): - raise TypeError - self.iter = yasm_symtab_first((symtab).symtab) - - def __iter__(self): - return self - - def __next__(self): - if self.iter == NULL: - raise StopIteration - rv = __make_symbol(yasm_symtab_iter_value(self.iter)) - self.iter = yasm_symtab_next(self.iter) - return rv - -cdef class SymbolTableItemIterator: - cdef yasm_symtab_iter *iter - - def __new__(self, symtab): - if not isinstance(symtab, SymbolTable): - raise TypeError - self.iter = yasm_symtab_first((symtab).symtab) - - def __iter__(self): - return self - - def __next__(self): - cdef yasm_symrec *sym - if self.iter == NULL: - raise StopIteration - sym = yasm_symtab_iter_value(self.iter) - rv = (yasm_symrec_get_name(sym), __make_symbol(sym)) - self.iter = yasm_symtab_next(self.iter) - return rv - -cdef int __parse_vis(vis) except -1: - if not vis or vis == 'local': return YASM_SYM_LOCAL - if vis == 'global': return YASM_SYM_GLOBAL - if vis == 'common': return YASM_SYM_COMMON - if vis == 'extern': return YASM_SYM_EXTERN - if vis == 'dlocal': return YASM_SYM_DLOCAL - msg = "bad visibility value %r" % vis - PyErr_SetString(ValueError, msg) - return -1 - -cdef class SymbolTable: - cdef yasm_symtab *symtab - - def __new__(self): - self.symtab = yasm_symtab_create() - - def __dealloc__(self): - if self.symtab != NULL: yasm_symtab_destroy(self.symtab) - - def use(self, name, line): - return __make_symbol(yasm_symtab_use(self.symtab, name, line)) - - def define_equ(self, name, expr, line): - if not isinstance(expr, Expression): - raise TypeError - return __make_symbol(yasm_symtab_define_equ(self.symtab, name, - yasm_expr_copy((expr).expr), line)) - - def define_label(self, name, precbc, in_table, line): - if not isinstance(precbc, Bytecode): - raise TypeError - return __make_symbol(yasm_symtab_define_label(self.symtab, name, - (precbc).bc, in_table, line)) - - def define_special(self, name, vis): - return __make_symbol( - yasm_symtab_define_special(self.symtab, name, - __parse_vis(vis))) - - def declare(self, name, vis, line): - return __make_symbol( - yasm_symtab_declare(self.symtab, name, - __parse_vis(vis), line)) - - # - # Methods to make SymbolTable behave like a dictionary of Symbols. - # - - def __getitem__(self, key): - cdef yasm_symrec *symrec - symrec = yasm_symtab_get(self.symtab, key) - if symrec == NULL: - raise KeyError - return __make_symbol(symrec) - - def __contains__(self, key): - cdef yasm_symrec *symrec - symrec = yasm_symtab_get(self.symtab, key) - return symrec != NULL - - def keys(self): - cdef yasm_symtab_iter *iter - l = [] - iter = yasm_symtab_first(self.symtab) - while iter != NULL: - l.append(yasm_symrec_get_name(yasm_symtab_iter_value(iter))) - iter = yasm_symtab_next(iter) - return l - - def values(self): - cdef yasm_symtab_iter *iter - l = [] - iter = yasm_symtab_first(self.symtab) - while iter != NULL: - l.append(__make_symbol(yasm_symtab_iter_value(iter))) - iter = yasm_symtab_next(iter) - return l - - def items(self): - cdef yasm_symtab_iter *iter - cdef yasm_symrec *sym - l = [] - iter = yasm_symtab_first(self.symtab) - while iter != NULL: - sym = yasm_symtab_iter_value(iter) - l.append((yasm_symrec_get_name(sym), __make_symbol(sym))) - iter = yasm_symtab_next(iter) - return l - - def has_key(self, key): - cdef yasm_symrec *symrec - symrec = yasm_symtab_get(self.symtab, key) - return symrec != NULL - - def get(self, key, x): - cdef yasm_symrec *symrec - symrec = yasm_symtab_get(self.symtab, key) - if symrec == NULL: - return x - return __make_symbol(symrec) - - def iterkeys(self): return SymbolTableKeyIterator(self) - def itervalues(self): return SymbolTableValueIterator(self) - def iteritems(self): return SymbolTableItemIterator(self) - def __iter__(self): return SymbolTableKeyIterator(self) - diff --git a/tools/python-yasm/tests/Makefile.inc b/tools/python-yasm/tests/Makefile.inc deleted file mode 100644 index 6bf72fdb..00000000 --- a/tools/python-yasm/tests/Makefile.inc +++ /dev/null @@ -1,15 +0,0 @@ -# $Id$ - -EXTRA_DIST += tools/python-yasm/tests/python_test.sh -EXTRA_DIST += tools/python-yasm/tests/__init__.py -EXTRA_DIST += tools/python-yasm/tests/test_bytecode.py -EXTRA_DIST += tools/python-yasm/tests/test_expr.py -EXTRA_DIST += tools/python-yasm/tests/test_intnum.py -EXTRA_DIST += tools/python-yasm/tests/test_symrec.py - -if HAVE_PYTHON - -TESTS_ENVIRONMENT += PYTHON=${PYTHON} -TESTS += tools/python-yasm/tests/python_test.sh - -endif diff --git a/tools/python-yasm/tests/__init__.py b/tools/python-yasm/tests/__init__.py deleted file mode 100644 index 6d608f28..00000000 --- a/tools/python-yasm/tests/__init__.py +++ /dev/null @@ -1,70 +0,0 @@ -# Test wrapper from Quod Libet -# http://www.sacredchao.net/quodlibet/ -# $Id$ -import unittest, sys -suites = [] -add = registerCase = suites.append -from unittest import TestCase - -class Mock(object): - # A generic mocking object. - def __init__(self, **kwargs): self.__dict__.update(kwargs) - -import test_intnum -import test_symrec -import test_bytecode -import test_expr - -class Result(unittest.TestResult): - - separator1 = '=' * 70 - separator2 = '-' * 70 - - def addSuccess(self, test): - unittest.TestResult.addSuccess(self, test) - sys.stdout.write('.') - - def addError(self, test, err): - unittest.TestResult.addError(self, test, err) - sys.stdout.write('E') - - def addFailure(self, test, err): - unittest.TestResult.addFailure(self, test, err) - sys.stdout.write('F') - - def printErrors(self): - succ = self.testsRun - (len(self.errors) + len(self.failures)) - v = "%3d" % succ - count = 50 - self.testsRun - sys.stdout.write((" " * count) + v + "\n") - self.printErrorList('ERROR', self.errors) - self.printErrorList('FAIL', self.failures) - - def printErrorList(self, flavour, errors): - for test, err in errors: - sys.stdout.write(self.separator1 + "\n") - sys.stdout.write("%s: %s\n" % (flavour, str(test))) - sys.stdout.write(self.separator2 + "\n") - sys.stdout.write("%s\n" % err) - -class Runner: - def run(self, test): - suite = unittest.makeSuite(test) - pref = '%s (%d): ' % (test.__name__, len(suite._tests)) - print pref + " " * (25 - len(pref)), - result = Result() - suite(result) - result.printErrors() - return bool(result.failures + result.errors) - -def unit(run = []): - runner = Runner() - failures = False - for test in suites: - if not run or test.__name__ in run: - failures |= runner.run(test) - return failures - -if __name__ == "__main__": - raise SystemExit(unit(sys.argv[1:])) - diff --git a/tools/python-yasm/tests/python_test.sh b/tools/python-yasm/tests/python_test.sh deleted file mode 100755 index 1f3896d6..00000000 --- a/tools/python-yasm/tests/python_test.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh -# Based on _sanity.sh from Quod Libet -# http://www.sacredchao.net/quodlibet/ -# $Id$ - -set -e - -test -n "${srcdir}" || srcdir=. -test -n "${PYTHON}" || PYTHON=python - -if test "$1" = "--help" -o "$1" = "-h"; then - echo "Usage: $0 --sanity | [TestName] ..." - exit 0 -elif [ "$1" = "--sanity" ]; then - echo "Running static sanity checks." - grep "except None:" ${srcdir}/tools/python-yasm/tests/*.py -else - ${PYTHON} -c "import sys; import glob; sys.path.insert(0, '${srcdir}/tools/python-yasm'); sys.path.insert(0, glob.glob('build/lib.*')[0]); import tests; raise SystemExit(tests.unit('$*'.split()))" -fi - diff --git a/tools/python-yasm/tests/test_bytecode.py b/tools/python-yasm/tests/test_bytecode.py deleted file mode 100644 index fb6c2a2b..00000000 --- a/tools/python-yasm/tests/test_bytecode.py +++ /dev/null @@ -1,4 +0,0 @@ -# $Id$ -from tests import TestCase, add -from yasm import Bytecode, Expression - diff --git a/tools/python-yasm/tests/test_expr.py b/tools/python-yasm/tests/test_expr.py deleted file mode 100644 index 1fb930d0..00000000 --- a/tools/python-yasm/tests/test_expr.py +++ /dev/null @@ -1,19 +0,0 @@ -# $Id$ -from tests import TestCase, add -from yasm import Expression -import operator - -class TExpression(TestCase): - def test_create(self): - e1 = Expression(operator.add, 1, 2) - e2 = Expression('+', 1, 2) - - self.assertEquals(e1.get_intnum(), e1.get_intnum()) - - def test_extract(self): - e1 = Expression('/', 15, 5) - self.assertEquals(e1.get_intnum(), 3) - self.assertRaises(ValueError, e1.extract_segoff) - self.assertRaises(ValueError, e1.extract_wrt) - -add(TExpression) diff --git a/tools/python-yasm/tests/test_intnum.py b/tools/python-yasm/tests/test_intnum.py deleted file mode 100644 index 65e09efc..00000000 --- a/tools/python-yasm/tests/test_intnum.py +++ /dev/null @@ -1,78 +0,0 @@ -# $Id$ -from tests import TestCase, add -from yasm import IntNum - -class TIntNum(TestCase): - legal_values = [ - 0, 1, -1, 2, -2, 17, -17, - 2**31-1, -2**31, 2**31, 2**32-1, -2**32, - 2**63-1, -2**63-1, 2**63, 2**64, -2**64, - 2**127-1, -2**127 - ] - overflow_values = [ - 2**127, -2**127-1 - ] - - def test_to_from(self): - for i in self.legal_values: - self.assertEquals(i, int(IntNum(i))) - self.assertEquals(i, long(IntNum(i))) - - def test_overflow(self): - for i in self.overflow_values: - self.assertRaises(OverflowError, IntNum, i) - - str_values = [ - "0", "00000", "1234", "87654321", "010101010", "FADCBEEF" - ] - base_values = [2, 8, 10, 12, 16, None, "nasm", "foo"] - - def test_from_str(self): - pass - - def test_from_str_base(self): - pass - - def test_exceptions(self): - self.assertRaises(ZeroDivisionError, IntNum(1).__div__, 0) - - IntNum(1) / 1 # make sure the above error is cleared - - try: IntNum(1) / 0 - except ZeroDivisionError, err: - self.assertEquals('divide by zero', str(err)) - - def test_xor(self): - a = IntNum(-234) - b = IntNum(432) - c = a ^ b - self.assertEquals(a, -234) - self.assertEquals(b, 432) - self.assertEquals(c, -234 ^ 432) - - def test_ixor(self): - a = IntNum(-234) - b = IntNum(432) - a ^= b; b ^= a; a ^= b - self.assertEquals(a, 432) - self.assertEquals(b, -234) - - def test_cmp(self): - a = IntNum(-1) - b = IntNum(0) - c = IntNum(1) - self.assert_(a < b < c) - self.assert_(a <= b <= c) - self.assert_(c >= b >= a) - self.assert_(c > b > a) - self.assert_(a != b != c) - - def test_abs(self): - a = IntNum(-1) - b = IntNum(0) - c = IntNum(1) - - self.assertEquals(abs(a), abs(c)) - self.assertEquals(abs(a) - abs(c), abs(b)) - -add(TIntNum) diff --git a/tools/python-yasm/tests/test_symrec.py b/tools/python-yasm/tests/test_symrec.py deleted file mode 100644 index a228eebd..00000000 --- a/tools/python-yasm/tests/test_symrec.py +++ /dev/null @@ -1,81 +0,0 @@ -# $Id$ -from tests import TestCase, add -from yasm import SymbolTable, Expression, YasmError - -class TSymbolTable(TestCase): - def setUp(self): - self.symtab = SymbolTable() - - def test_keys(self): - self.assertEquals(len(self.symtab.keys()), 0) - self.symtab.declare("foo", None, 0) - keys = self.symtab.keys() - self.assertEquals(len(keys), 1) - self.assertEquals(keys[0], "foo") - - def test_contains(self): - self.assert_("foo" not in self.symtab) - self.symtab.declare("foo", None, 0) - self.assert_("foo" in self.symtab) - - def test_exception(self): - expr = Expression('+', 1, 2) - self.symtab.define_equ("foo", expr, 0) - self.assertRaises(YasmError, self.symtab.define_equ, "foo", expr, 0) - self.symtab.define_equ("bar", expr, 0) # cleared - self.assertRaises(YasmError, self.symtab.define_special, "bar", - 'global') - - def test_iters(self): - tab = self.symtab - tab.declare("foo", None, 0) - tab.declare("bar", None, 0) - tab.declare("baz", None, 0) - - # while ordering is not known, it must be consistent - self.assertEquals(list(tab.keys()), list(tab.iterkeys())) - self.assertEquals(list(tab.values()), list(tab.itervalues())) - self.assertEquals(list(tab.items()), list(tab.iteritems())) - self.assertEquals(list(tab.iteritems()), zip(tab.keys(), tab.values())) - -add(TSymbolTable) - -class TSymbolAttr(TestCase): - def setUp(self): - self.symtab = SymbolTable() - self.declsym = self.symtab.declare("foo", None, 0) - - def test_visibility(self): - sym = self.symtab.declare("local1", None, 0) - self.assertEquals(sym.visibility, set()) - sym = self.symtab.declare("local2", '', 0) - self.assertEquals(sym.visibility, set()) - sym = self.symtab.declare("local3", 'local', 0) - self.assertEquals(sym.visibility, set()) - sym = self.symtab.declare("global", 'global', 0) - self.assertEquals(sym.visibility, set(['global'])) - sym = self.symtab.declare("common", 'common', 0) - self.assertEquals(sym.visibility, set(['common'])) - sym = self.symtab.declare("extern", 'extern', 0) - self.assertEquals(sym.visibility, set(['extern'])) - sym = self.symtab.declare("dlocal", 'dlocal', 0) - self.assertEquals(sym.visibility, set(['dlocal'])) - - self.assertRaises(ValueError, - lambda: self.symtab.declare("extern2", 'foo', 0)) - def test_name(self): - self.assertEquals(self.declsym.name, "foo") - - def test_equ(self): - self.assertRaises(AttributeError, lambda: self.declsym.equ) - - def test_label(self): - self.assertRaises(AttributeError, lambda: self.declsym.label) - - def test_is_special(self): - self.assertEquals(self.declsym.is_special, False) - - def test_is_curpos(self): - self.assertEquals(self.declsym.is_curpos, False) - -add(TSymbolAttr) diff --git a/tools/python-yasm/value.pxi b/tools/python-yasm/value.pxi deleted file mode 100644 index f2328dd4..00000000 --- a/tools/python-yasm/value.pxi +++ /dev/null @@ -1,56 +0,0 @@ -# Python bindings for Yasm: Pyrex input file for value.h -# -# Copyright (C) 2006 Michael Urman, Peter Johnson -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. - -cdef class Value: - cdef yasm_value value - def __new__(self, value=None, size=None): - cdef unsigned int sz - if size is None: - sz = 0 - else: - sz = size; - - yasm_value_initialize(&self.value, NULL, sz) - if value is None: - pass - elif isinstance(value, Expression): - yasm_value_initialize(&self.value, - yasm_expr_copy((value).expr), sz) - elif isinstance(value, Symbol): - yasm_value_init_sym(&self.value, (value).sym, sz) - else: - raise TypeError("Invalid value type '%s'" % type(value)) - - def __dealloc__(self): - yasm_value_delete(&self.value) - - def finalize(self, precbc=None): - if precbc is None: - return yasm_value_finalize(&self.value, NULL) - elif isinstance(precbc, Bytecode): - return yasm_value_finalize(&self.value, (precbc).bc) - else: - raise TypeError("Invalid precbc type '%s'" % type(precbc)) - diff --git a/tools/python-yasm/yasm.pyx b/tools/python-yasm/yasm.pyx deleted file mode 100644 index f9c6ee4d..00000000 --- a/tools/python-yasm/yasm.pyx +++ /dev/null @@ -1,137 +0,0 @@ -# Python bindings for Yasm: Main Pyrex input file -# -# Copyright (C) 2006 Michael Urman, Peter Johnson -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -"""Interface to the Yasm library. - -The Yasm library (aka libyasm) provides the core functionality of the Yasm -assembler. Classes in this library provide for manipulation of machine -instructions and object file constructs such as symbol tables and sections. - -Expression objects encapsulate complex expressions containing registers, -symbols, and operations such as SEG. - -Bytecode objects encapsulate data or code objects such as data, reserve, -align, or instructions. - -Section objects encapsulate an object file section, including the section -name, any Bytecode objects contained within that section, and other -information. - -""" - -cdef extern from "Python.h": - cdef object PyCObject_FromVoidPtr(void *cobj, void (*destr)(void *)) - cdef object PyCObject_FromVoidPtrAndDesc(void *cobj, void *desc, - void (*destr)(void *, void *)) - cdef int PyType_Check(object) - cdef int PyCObject_Check(object) - cdef void *PyCObject_AsVoidPtr(object) - cdef void *PyCObject_GetDesc(object) - - cdef object _PyLong_FromByteArray(unsigned char *bytes, unsigned int n, - int little_endian, int is_signed) - cdef int _PyLong_AsByteArray(object v, unsigned char *bytes, unsigned int n, - int little_endian, int is_signed) except -1 - - cdef void Py_INCREF(object o) - cdef void Py_DECREF(object o) - - cdef void PyErr_SetString(object type, char *message) - cdef object PyErr_Format(object type, char *format, ...) - -cdef extern from "stdlib.h": - cdef void *malloc(int n) - cdef void free(void *p) - -include "_yasm.pxi" - -cdef object __pass_voidp(void *obj, object forclass): - return PyCObject_FromVoidPtrAndDesc(obj, forclass, NULL) - -cdef void *__get_voidp(object obj, object forclass) except NULL: - cdef void* desc - - if not PyCObject_Check(obj): - msg = "obj %r is not a CObject" % obj - PyErr_SetString(TypeError, msg) - return NULL - - desc = PyCObject_GetDesc(obj) - - if desc != forclass: - if desc == NULL: - msg = "CObject type is not set (expecting %s)" % forclass - elif PyType_Check(desc): - msg = "CObject is for %s not %s" % (desc, forclass) - else: - msg = "CObject is incorrect (expecting %s)" % forclass - PyErr_SetString(TypeError, msg) - return NULL - - return PyCObject_AsVoidPtr(obj) - -# -# Link to associated data mechanism to keep Python references paired with -# yasm objects. -# -cdef class __assoc_data_callback: - cdef yasm_assoc_data_callback *cb - def __new__(self, destroy, print_): - self.cb = malloc(sizeof(yasm_assoc_data_callback)) - self.cb.destroy = PyCObject_AsVoidPtr(destroy) - #self.cb.print_ = PyCObject_AsVoidPtr(print_) - def __dealloc__(self): - free(self.cb) - - -cdef class Register: - cdef unsigned long reg - def __new__(self, reg): - self.reg = reg - -include "errwarn.pxi" -include "intnum.pxi" -include "floatnum.pxi" -include "expr.pxi" -include "symrec.pxi" -include "value.pxi" - -include "bytecode.pxi" - -cdef __initialize(): - BitVector_Boot() - yasm_intnum_initialize() - yasm_floatnum_initialize() - yasm_errwarn_initialize() - -def __cleanup(): - yasm_floatnum_cleanup() - yasm_intnum_cleanup() - yasm_errwarn_cleanup() - BitVector_Shutdown() - -__initialize() -import atexit -atexit.register(__cleanup) - From 832aee27954290db00c6d9dd3fffb45a8b1eec62 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 24 Feb 2007 06:34:05 +0000 Subject: [PATCH 002/585] Bump branch version to 0.6.x, with an internal version of 0.6.0. svn path=/branches/yasm-0.6.x/; revision=1789 --- Mkfiles/dj/config.h | 10 +++++----- Mkfiles/vc/config.h | 10 +++++----- Mkfiles/vc8/config.h | 10 +++++----- configure.ac | 8 ++++---- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Mkfiles/dj/config.h b/Mkfiles/dj/config.h index e5e3f5db..423decc4 100644 --- a/Mkfiles/dj/config.h +++ b/Mkfiles/dj/config.h @@ -120,22 +120,22 @@ #define PACKAGE_BUGREPORT "bug-yasm@tortall.net" /* Define to build version of this package. */ -#define PACKAGE_BUILD "HEAD" +#define PACKAGE_BUILD "BRANCH" /* Define to internal version of this package. */ -#define PACKAGE_INTVER "0.5.99" +#define PACKAGE_INTVER "0.6.0" /* Define to the full name of this package. */ #define PACKAGE_NAME "yasm" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "yasm HEAD" +#define PACKAGE_STRING "yasm 0.6.x" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "yasm" /* Define to the version of this package. */ -#define PACKAGE_VERSION "HEAD" +#define PACKAGE_VERSION "0.6.x" /* Define if the C compiler supports function prototypes. */ #define PROTOTYPES 1 @@ -159,7 +159,7 @@ #define STDC_HEADERS 1 /* Version number of package */ -#define VERSION "HEAD" +#define VERSION "0.6.x" /* Define if using the dmalloc debugging malloc package */ /* #undef WITH_DMALLOC */ diff --git a/Mkfiles/vc/config.h b/Mkfiles/vc/config.h index 35e2a12d..e67ee4c0 100644 --- a/Mkfiles/vc/config.h +++ b/Mkfiles/vc/config.h @@ -121,22 +121,22 @@ #define PACKAGE_BUGREPORT "bug-yasm@tortall.net" /* Define to build version of this package. */ -#define PACKAGE_BUILD "HEAD" +#define PACKAGE_BUILD "BRANCH" /* Define to internal version of this package. */ -#define PACKAGE_INTVER "0.5.99" +#define PACKAGE_INTVER "0.6.0" /* Define to the full name of this package. */ #define PACKAGE_NAME "yasm" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "yasm HEAD" +#define PACKAGE_STRING "yasm 0.6.x" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "yasm" /* Define to the version of this package. */ -#define PACKAGE_VERSION "HEAD" +#define PACKAGE_VERSION "0.6.x" /* Define if the C compiler supports function prototypes. */ #define PROTOTYPES 1 @@ -160,7 +160,7 @@ #define STDC_HEADERS 1 /* Version number of package */ -#define VERSION "HEAD" +#define VERSION "0.6.x" /* Define if using the dmalloc debugging malloc package */ /* #undef WITH_DMALLOC */ diff --git a/Mkfiles/vc8/config.h b/Mkfiles/vc8/config.h index ef786024..864e9fa7 100644 --- a/Mkfiles/vc8/config.h +++ b/Mkfiles/vc8/config.h @@ -121,22 +121,22 @@ #define PACKAGE_BUGREPORT "bug-yasm@tortall.net" /* Define to build version of this package. */ -#define PACKAGE_BUILD "HEAD" +#define PACKAGE_BUILD "BRANCH" /* Define to internal version of this package. */ -#define PACKAGE_INTVER "0.5.99" +#define PACKAGE_INTVER "0.6.0" /* Define to the full name of this package. */ #define PACKAGE_NAME "yasm" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "yasm HEAD" +#define PACKAGE_STRING "yasm 0.6.x" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "yasm" /* Define to the version of this package. */ -#define PACKAGE_VERSION "HEAD" +#define PACKAGE_VERSION "0.6.x" /* Define if the C compiler supports function prototypes. */ #define PROTOTYPES 1 @@ -160,7 +160,7 @@ #define STDC_HEADERS 1 /* Version number of package */ -#define VERSION "HEAD" +#define VERSION "0.6.x" /* Define if using the dmalloc debugging malloc package */ /* #undef WITH_DMALLOC */ diff --git a/configure.ac b/configure.ac index 2e64f311..01b8eb7f 100644 --- a/configure.ac +++ b/configure.ac @@ -5,17 +5,17 @@ # autoconf setup # AC_PREREQ(2.53) -AC_INIT([yasm], [HEAD], [bug-yasm@tortall.net]) +AC_INIT([yasm], [0.6.x], [bug-yasm@tortall.net]) #AC_CONFIG_SRCDIR([src/main.c]) AC_CONFIG_AUX_DIR(config) AM_CONFIG_HEADER([config.h]) -AM_INIT_AUTOMAKE(yasm, [HEAD]) +AM_INIT_AUTOMAKE(yasm, [0.6.x]) AM_MAINTAINER_MODE -AC_DEFINE(PACKAGE_INTVER, ["0.5.99"], +AC_DEFINE(PACKAGE_INTVER, ["0.6.0"], [Define to internal version of this package.]) -AC_DEFINE(PACKAGE_BUILD, ["HEAD"], [Define to build version of this package.]) +AC_DEFINE(PACKAGE_BUILD, ["BRANCH"], [Define to build version of this package.]) # # autoconf command-line options From d0ca56ed4aab066e183b7f38557291a10c30ff6c Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 24 Feb 2007 22:39:55 +0000 Subject: [PATCH 003/585] Merge [1790]-[1794] (inclusive) from trunk. svn path=/branches/yasm-0.6.x/; revision=1795 --- frontends/yasm/yasm-options.c | 4 ++-- libyasm/bitvect.c | 10 ++++---- libyasm/coretype.h | 6 ++--- libyasm/expr.c | 4 ++-- libyasm/floatnum.c | 4 ++-- libyasm/intnum.c | 32 ++++++------------------- libyasm/md5.c | 2 +- libyasm/md5.h | 2 +- libyasm/mergesort.c | 3 ++- libyasm/phash.c | 14 ++++++----- libyasm/phash.h | 4 ++-- modules/arch/x86/x86bc.c | 2 +- modules/arch/x86/x86expr.c | 6 ++--- modules/arch/x86/x86id.c | 27 ++++++++++----------- modules/dbgfmts/codeview/cv-symline.c | 7 +++--- modules/dbgfmts/codeview/cv-type.c | 2 +- modules/dbgfmts/dwarf2/dwarf2-aranges.c | 2 +- modules/dbgfmts/dwarf2/dwarf2-dbgfmt.h | 12 +++++----- modules/dbgfmts/dwarf2/dwarf2-info.c | 4 ++-- modules/dbgfmts/dwarf2/dwarf2-line.c | 21 ++++++++-------- modules/dbgfmts/stabs/stabs-dbgfmt.c | 2 +- modules/listfmts/nasm/nasm-listfmt.c | 2 +- modules/objfmts/bin/bin-objfmt.c | 3 ++- modules/objfmts/coff/coff-objfmt.c | 14 +++++------ modules/objfmts/dbg/dbg-objfmt.c | 2 +- modules/objfmts/elf/elf-objfmt.c | 10 ++++---- modules/objfmts/elf/elf.c | 8 +++---- modules/objfmts/macho/macho-objfmt.c | 6 +++-- modules/objfmts/rdf/rdf-objfmt.c | 6 ++--- modules/objfmts/xdf/xdf-objfmt.c | 8 +++---- modules/parsers/gas/gas-parse.c | 12 ++++++---- modules/parsers/nasm/nasm-parse.c | 9 ++++--- modules/preprocs/nasm/nasm-pp.c | 27 +++++++++++---------- modules/preprocs/nasm/nasmlib.c | 4 ++-- modules/preprocs/nasm/nasmlib.h | 2 +- tools/gap/gap.c | 2 +- tools/gap/perfect.c | 2 +- 37 files changed, 139 insertions(+), 148 deletions(-) diff --git a/frontends/yasm/yasm-options.c b/frontends/yasm/yasm-options.c index 95464d2c..fed8d694 100644 --- a/frontends/yasm/yasm-options.c +++ b/frontends/yasm/yasm-options.c @@ -161,8 +161,8 @@ help_msg(const char *msg, const char *tail, opt_option *options, size_t nopts) printf("%s", gettext(msg)); for (i = 0; i < nopts; i++) { - int shortopt_len = 0; - int longopt_len = 0; + size_t shortopt_len = 0; + size_t longopt_len = 0; optbuf[0] = 0; optopt[0] = 0; diff --git a/libyasm/bitvect.c b/libyasm/bitvect.c index abebc8f8..c39f9b65 100644 --- a/libyasm/bitvect.c +++ b/libyasm/bitvect.c @@ -1497,7 +1497,7 @@ ErrCode BitVector_from_Hex(wordptr addr, charptr string) N_word size = size_(addr); N_word mask = mask_(addr); boolean ok = TRUE; - N_word length; + size_t length; N_word value; N_word count; int digit; @@ -1534,7 +1534,7 @@ ErrCode BitVector_from_Oct(wordptr addr, charptr string) N_word size = size_(addr); N_word mask = mask_(addr); boolean ok = TRUE; - N_word length; + size_t length; N_word value; N_word value_fill = 0; N_word count; @@ -1609,7 +1609,7 @@ ErrCode BitVector_from_Bin(wordptr addr, charptr string) N_word size = size_(addr); N_word mask = mask_(addr); boolean ok = TRUE; - N_word length; + size_t length; N_word value; N_word count; int digit; @@ -1819,7 +1819,7 @@ ErrCode BitVector_from_Dec_static(BitVector_from_Dec_static_data *data, N_word accu; N_word powr; N_word count; - N_word length; + size_t length; int digit; if (bits > 0) @@ -1930,7 +1930,7 @@ ErrCode BitVector_from_Dec(wordptr addr, charptr string) N_word accu; N_word powr; N_word count; - N_word length; + size_t length; int digit; if (bits > 0) diff --git a/libyasm/coretype.h b/libyasm/coretype.h index 1e22709a..a6b92b04 100644 --- a/libyasm/coretype.h +++ b/libyasm/coretype.h @@ -260,7 +260,7 @@ typedef enum yasm_sym_vis { * \return Nonzero if an error occurred, 0 otherwise. */ typedef int (*yasm_output_value_func) - (yasm_value *value, /*@out@*/ unsigned char *buf, size_t destsize, + (yasm_value *value, /*@out@*/ unsigned char *buf, unsigned int destsize, unsigned long offset, yasm_bytecode *bc, int warn, /*@null@*/ void *d); /** Convert a symbol reference to its byte representation. Usually implemented @@ -281,8 +281,8 @@ typedef int (*yasm_output_value_func) * \return Nonzero if an error occurred, 0 otherwise. */ typedef int (*yasm_output_reloc_func) - (yasm_symrec *sym, yasm_bytecode *bc, unsigned char *buf, size_t destsize, - size_t valsize, int warn, void *d); + (yasm_symrec *sym, yasm_bytecode *bc, unsigned char *buf, + unsigned int destsize, unsigned int valsize, int warn, void *d); /** Sort an array using merge sort algorithm. * \internal diff --git a/libyasm/expr.c b/libyasm/expr.c index 461dd1bc..4495b28f 100644 --- a/libyasm/expr.c +++ b/libyasm/expr.c @@ -75,7 +75,7 @@ yasm_expr_create(yasm_expr_op op, yasm_expr__item *left, ptr->terms[1].type = YASM_EXPR_NONE; if (left) { ptr->terms[0] = *left; /* structure copy */ - z = left-itempool; + z = (unsigned long)(left-itempool); if (z>=31) yasm_internal_error(N_("could not find expritem in pool")); itempool_used &= ~(1<terms[1] = *right; /* structure copy */ - z = right-itempool; + z = (unsigned long)(right-itempool); if (z>=31) yasm_internal_error(N_("could not find expritem in pool")); itempool_used &= ~(1< (long)flt->exponent) norm_amt = (long)flt->exponent; BitVector_Move_Left(flt->mantissa, (N_int)norm_amt); - flt->exponent -= norm_amt; + flt->exponent -= (unsigned short)norm_amt; } /* acc *= op */ @@ -291,7 +291,7 @@ floatnum_mul(yasm_floatnum *acc, const yasm_floatnum *op) if (norm_amt > (long)acc->exponent) norm_amt = (long)acc->exponent; BitVector_Move_Left(product, (N_int)norm_amt); - acc->exponent -= norm_amt; + acc->exponent -= (unsigned short)norm_amt; /* Store the highest bits of the result */ BitVector_Interval_Copy(acc->mantissa, product, 0, MANT_BITS, MANT_BITS); diff --git a/libyasm/intnum.c b/libyasm/intnum.c index 95d23a1a..3b3ad374 100644 --- a/libyasm/intnum.c +++ b/libyasm/intnum.c @@ -48,7 +48,6 @@ struct yasm_intnum { wordptr bv; /* bit vector (for integers >32 bits) */ } val; enum { INTNUM_UL, INTNUM_BV } type; - unsigned char origsize; /* original (parsed) size, in bits */ }; /* static bitvect used for conversions */ @@ -87,8 +86,6 @@ yasm_intnum_create_dec(char *str) { yasm_intnum *intn = yasm_xmalloc(sizeof(yasm_intnum)); - intn->origsize = 0; /* no reliable way to figure this out */ - switch (BitVector_from_Dec_static(from_dec_data, conv_bv, (unsigned char *)str)) { case ErrCode_Pars: @@ -117,8 +114,6 @@ yasm_intnum_create_bin(char *str) { yasm_intnum *intn = yasm_xmalloc(sizeof(yasm_intnum)); - intn->origsize = (unsigned char)strlen(str); - switch (BitVector_from_Bin(conv_bv, (unsigned char *)str)) { case ErrCode_Pars: yasm_error_set(YASM_ERROR_VALUE, N_("invalid binary literal")); @@ -146,8 +141,6 @@ yasm_intnum_create_oct(char *str) { yasm_intnum *intn = yasm_xmalloc(sizeof(yasm_intnum)); - intn->origsize = strlen(str)*3; - switch (BitVector_from_Oct(conv_bv, (unsigned char *)str)) { case ErrCode_Pars: yasm_error_set(YASM_ERROR_VALUE, N_("invalid octal literal")); @@ -175,8 +168,6 @@ yasm_intnum_create_hex(char *str) { yasm_intnum *intn = yasm_xmalloc(sizeof(yasm_intnum)); - intn->origsize = strlen(str)*4; - switch (BitVector_from_Hex(conv_bv, (unsigned char *)str)) { case ErrCode_Pars: yasm_error_set(YASM_ERROR_VALUE, N_("invalid hex literal")); @@ -206,9 +197,7 @@ yasm_intnum_create_charconst_nasm(const char *str) yasm_intnum *intn = yasm_xmalloc(sizeof(yasm_intnum)); size_t len = strlen(str); - intn->origsize = len*8; - - if(intn->origsize > BITVECT_NATIVE_SIZE) + if(len*8 > BITVECT_NATIVE_SIZE) yasm_error_set(YASM_ERROR_OVERFLOW, N_("Character constant too large for internal format")); @@ -258,7 +247,6 @@ yasm_intnum_create_uint(unsigned long i) intn->val.ul = i; intn->type = INTNUM_UL; - intn->origsize = 0; return intn; } @@ -279,7 +267,6 @@ yasm_intnum_create_int(long i) intn = yasm_xmalloc(sizeof(yasm_intnum)); intn->val.bv = BitVector_Clone(conv_bv); intn->type = INTNUM_BV; - intn->origsize = 0; return intn; } @@ -292,8 +279,6 @@ yasm_intnum_create_leb128(const unsigned char *ptr, int sign, const unsigned char *ptr_orig = ptr; unsigned long i = 0; - intn->origsize = 0; - BitVector_Empty(conv_bv); for (;;) { BitVector_Chunk_Store(conv_bv, 7, i, *ptr); @@ -303,7 +288,7 @@ yasm_intnum_create_leb128(const unsigned char *ptr, int sign, ptr++; } - *size = (ptr-ptr_orig)+1; + *size = (unsigned long)(ptr-ptr_orig)+1; if(i > BITVECT_NATIVE_SIZE) yasm_error_set(YASM_ERROR_OVERFLOW, @@ -329,8 +314,6 @@ yasm_intnum_create_sized(unsigned char *ptr, int sign, size_t srcsize, yasm_intnum *intn = yasm_xmalloc(sizeof(yasm_intnum)); unsigned long i = 0; - intn->origsize = 0; - if (srcsize*8 > BITVECT_NATIVE_SIZE) yasm_error_set(YASM_ERROR_OVERFLOW, N_("Numeric constant too large for internal format")); @@ -374,7 +357,6 @@ yasm_intnum_copy(const yasm_intnum *intn) break; } n->type = intn->type; - n->origsize = intn->origsize; return n; } @@ -748,7 +730,7 @@ yasm_intnum_get_sized(const yasm_intnum *intn, unsigned char *ptr, /* TODO */ yasm_internal_error(N_("big endian not implemented")); } else - BitVector_Block_Store(op1, ptr, destsize); + BitVector_Block_Store(op1, ptr, (N_int)destsize); /* If not already a bitvect, convert value to be written to a bitvect */ if (intn->type == INTNUM_BV) @@ -762,7 +744,7 @@ yasm_intnum_get_sized(const yasm_intnum *intn, unsigned char *ptr, /* Check low bits if right shifting and warnings enabled */ if (warn && rshift > 0) { BitVector_Copy(conv_bv, op2); - BitVector_Move_Left(conv_bv, BITVECT_NATIVE_SIZE-rshift); + BitVector_Move_Left(conv_bv, (N_int)(BITVECT_NATIVE_SIZE-rshift)); if (!BitVector_is_empty(conv_bv)) yasm_warn_set(YASM_WARN_GENERAL, N_("misaligned value, truncating to boundary")); @@ -777,7 +759,7 @@ yasm_intnum_get_sized(const yasm_intnum *intn, unsigned char *ptr, } /* Write the new value into the destination bitvect */ - BitVector_Interval_Copy(op1, op2, (unsigned int)shift, 0, valsize); + BitVector_Interval_Copy(op1, op2, (unsigned int)shift, 0, (N_int)valsize); /* Write out the new data */ buf = BitVector_Block_Read(op1, &len); @@ -1060,11 +1042,11 @@ yasm_intnum_print(const yasm_intnum *intn, FILE *f) switch (intn->type) { case INTNUM_UL: - fprintf(f, "0x%lx/%u", intn->val.ul, (unsigned int)intn->origsize); + fprintf(f, "0x%lx", intn->val.ul); break; case INTNUM_BV: s = BitVector_to_Hex(intn->val.bv); - fprintf(f, "0x%s/%u", (char *)s, (unsigned int)intn->origsize); + fprintf(f, "0x%s", (char *)s); yasm_xfree(s); break; } diff --git a/libyasm/md5.c b/libyasm/md5.c index d53ef378..af045fbe 100644 --- a/libyasm/md5.c +++ b/libyasm/md5.c @@ -77,7 +77,7 @@ yasm_md5_init(yasm_md5_context *ctx) */ void yasm_md5_update(yasm_md5_context *ctx, unsigned char const *buf, - unsigned len) + unsigned long len) { unsigned long t; diff --git a/libyasm/md5.h b/libyasm/md5.h index 52559a0d..91be1c55 100644 --- a/libyasm/md5.h +++ b/libyasm/md5.h @@ -21,7 +21,7 @@ typedef struct yasm_md5_context { void yasm_md5_init(yasm_md5_context *context); void yasm_md5_update(yasm_md5_context *context, unsigned char const *buf, - unsigned len); + unsigned long len); void yasm_md5_final(unsigned char digest[16], yasm_md5_context *context); void yasm_md5_transform(unsigned long buf[4], const unsigned char in[64]); diff --git a/libyasm/mergesort.c b/libyasm/mergesort.c index e460a178..87e451d0 100644 --- a/libyasm/mergesort.c +++ b/libyasm/mergesort.c @@ -278,7 +278,8 @@ setup(unsigned char *list1, unsigned char *list2, size_t n, size_t size, { size_t i; unsigned int tmp; - int length, size2, sense; + int length, sense; + size_t size2; unsigned char *f1, *f2, *s, *l2, *last, *p2; size2 = size*2; diff --git a/libyasm/phash.c b/libyasm/phash.c index b828bb65..01941c28 100644 --- a/libyasm/phash.c +++ b/libyasm/phash.c @@ -96,10 +96,11 @@ acceptable. Do NOT use for cryptographic purposes. unsigned long phash_lookup( register const char *sk, /* the key */ - register unsigned long length, /* the length of the key */ + register size_t length, /* the length of the key */ register unsigned long level) /* the previous hash, or an arbitrary value */ { - register unsigned long a,b,c,len; + register unsigned long a,b,c; + register size_t len; register const unsigned char *k = (const unsigned char *)sk; /* Set up the internal state */ @@ -121,7 +122,7 @@ phash_lookup( } /*------------------------------------- handle the last 11 bytes */ - c += length; + c += (ub4)length; switch(len) /* all the case statements fall through */ { case 11: c+=((ub4)k[10]<<24); @@ -192,10 +193,11 @@ is trying to cause collisions. Do NOT use for cryptography. void phash_checksum( register const char *sk, - register unsigned long len, + register size_t len, register unsigned long *state) { - register unsigned long a,b,c,d,e,f,g,h,length; + register unsigned long a,b,c,d,e,f,g,h; + register size_t length; register const unsigned char *k = (const unsigned char *)sk; /* Use the length and level; add in the golden ratio. */ @@ -222,7 +224,7 @@ phash_checksum( } /*------------------------------------- handle the last 31 bytes */ - h += length; + h += (ub4)length; switch(len) { case 31: h+=(k[30]<<24); diff --git a/libyasm/phash.h b/libyasm/phash.h index 5fc44e39..bf4cb47c 100644 --- a/libyasm/phash.h +++ b/libyasm/phash.h @@ -10,6 +10,6 @@ Source is http://burtleburtle.net/bob/c/lookupa.h ------------------------------------------------------------------------------ */ -unsigned long phash_lookup(const char *k, unsigned long length, +unsigned long phash_lookup(const char *k, size_t length, unsigned long level); -void phash_checksum(const char *k, unsigned long length, unsigned long *state); +void phash_checksum(const char *k, size_t length, unsigned long *state); diff --git a/modules/arch/x86/x86bc.c b/modules/arch/x86/x86bc.c index f6072787..a4326d32 100644 --- a/modules/arch/x86/x86bc.c +++ b/modules/arch/x86/x86bc.c @@ -793,7 +793,7 @@ x86_bc_insn_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, /* Prefixes */ x86_common_tobytes(&insn->common, bufp, - x86_ea ? (x86_ea->ea.segreg>>8) : 0); + x86_ea ? (unsigned int)(x86_ea->ea.segreg>>8) : 0); if (insn->special_prefix != 0) YASM_WRITE_8(*bufp, insn->special_prefix); if (insn->rex != 0xff) { diff --git a/modules/arch/x86/x86expr.c b/modules/arch/x86/x86expr.c index e0dd2141..33d246e0 100644 --- a/modules/arch/x86/x86expr.c +++ b/modules/arch/x86/x86expr.c @@ -53,12 +53,12 @@ x86_expr_checkea_get_reg3264(yasm_expr__item *ei, int *regnum, case X86_REG32: if (data->addrsize != 32) return 0; - *regnum = ei->data.reg & 0xF; + *regnum = (unsigned int)(ei->data.reg & 0xF); break; case X86_REG64: if (data->addrsize != 64) return 0; - *regnum = ei->data.reg & 0xF; + *regnum = (unsigned int)(ei->data.reg & 0xF); break; case X86_RIP: if (data->bits != 64) @@ -103,7 +103,7 @@ x86_expr_checkea_get_reg16(yasm_expr__item *ei, int *regnum, void *d) return 0; /* & 7 for sanity check */ - *regnum = ei->data.reg & 0x7; + *regnum = (unsigned int)(ei->data.reg & 0x7); /* only allow BX, SI, DI, BP */ if (!reg16[*regnum]) diff --git a/modules/arch/x86/x86id.c b/modules/arch/x86/x86id.c index 46474b9b..93c48b45 100644 --- a/modules/arch/x86/x86id.c +++ b/modules/arch/x86/x86id.c @@ -2097,7 +2097,7 @@ static const x86_insn_info xbts_insn[] = { static void x86_finalize_common(x86_common *common, const x86_insn_info *info, - unsigned int mode_bits) + uintptr_t mode_bits) { common->addrsize = 0; common->opersize = info->opersize; @@ -2171,8 +2171,8 @@ x86_finalize_jmp(yasm_arch *arch, yasm_bytecode *bc, yasm_bytecode *prev_bc, x86_jmp *jmp; int num_info = (int)(data[1]&0xFF); x86_insn_info *info = (x86_insn_info *)data[0]; - unsigned long mod_data = data[1] >> 8; - unsigned char mode_bits = (unsigned char)(data[3] & 0xFF); + unsigned long mod_data = (unsigned long)(data[1] >> 8); + unsigned int mode_bits = (unsigned int)(data[3] & 0xFF); /*unsigned char suffix = (unsigned char)((data[3]>>8) & 0xFF);*/ yasm_insn_operand *op; static const unsigned char size_lookup[] = {0, 8, 16, 32, 64, 80, 128, 0}; @@ -2278,7 +2278,7 @@ x86_finalize_jmp(yasm_arch *arch, yasm_bytecode *bc, yasm_bytecode *prev_bc, static const x86_insn_info * x86_find_match(yasm_arch *arch, int num_info, const x86_insn_info *info, - unsigned long cpu, unsigned int mode_bits, unsigned int suffix, + uintptr_t cpu, unsigned int mode_bits, unsigned int suffix, int num_operands, yasm_insn_operand **ops, yasm_insn_operand **rev_ops, const unsigned int *size_lookup, int bypass) @@ -2611,7 +2611,7 @@ x86_find_match(yasm_arch *arch, int num_info, const x86_insn_info *info, static void x86_match_error(yasm_arch *arch, int num_info, const x86_insn_info *info, - unsigned long cpu, unsigned int mode_bits, unsigned int suffix, + uintptr_t cpu, unsigned int mode_bits, unsigned int suffix, int num_operands, yasm_insn_operand **ops, yasm_insn_operand **rev_ops, const unsigned int *size_lookup) { @@ -2679,8 +2679,8 @@ yasm_x86__finalize_insn(yasm_arch *arch, yasm_bytecode *bc, x86_insn *insn; int num_info = (int)(data[1]&0xFF); const x86_insn_info *info = (const x86_insn_info *)data[0]; - unsigned long mod_data = data[1] >> 8; - unsigned char mode_bits = (unsigned char)(data[3] & 0xFF); + unsigned long mod_data = (unsigned long)(data[1] >> 8); + unsigned int mode_bits = (unsigned int)(data[3] & 0xFF); unsigned int suffix = (unsigned int)((data[3]>>8) & 0xFF); yasm_insn_operand *op, *ops[4], *rev_ops[4]; /*@null@*/ yasm_expr *imm; @@ -2866,10 +2866,9 @@ yasm_x86__finalize_insn(yasm_arch *arch, yasm_bytecode *bc, case OPA_EA: switch (op->type) { case YASM_INSN__OPERAND_REG: - insn->x86_ea = - yasm_x86__ea_create_reg(op->data.reg, - &insn->rex, - mode_bits); + insn->x86_ea = yasm_x86__ea_create_reg( + (unsigned long)op->data.reg, &insn->rex, + mode_bits); break; case YASM_INSN__OPERAND_SEGREG: yasm_internal_error( @@ -2937,9 +2936,9 @@ yasm_x86__finalize_insn(yasm_arch *arch, yasm_bytecode *bc, break; case OPA_SpareEA: if (op->type == YASM_INSN__OPERAND_REG) { - insn->x86_ea = yasm_x86__ea_create_reg(op->data.reg, - &insn->rex, - mode_bits); + insn->x86_ea = + yasm_x86__ea_create_reg((unsigned long)op->data.reg, + &insn->rex, mode_bits); if (!insn->x86_ea || yasm_x86__set_rex_from_reg(&insn->rex, &spare, op->data.reg, mode_bits, X86_REX_R)) { diff --git a/modules/dbgfmts/codeview/cv-symline.c b/modules/dbgfmts/codeview/cv-symline.c index 07178c80..65dd02a4 100644 --- a/modules/dbgfmts/codeview/cv-symline.c +++ b/modules/dbgfmts/codeview/cv-symline.c @@ -384,7 +384,7 @@ cv_dbgfmt_add_file(yasm_dbgfmt_cv *dbgfmt_cv, size_t filenum, if (!f) yasm__fatal(N_("codeview: could not open source file")); while ((len = fread(buf, 1, 1024, f)) > 0) - yasm_md5_update(&context, buf, len); + yasm_md5_update(&context, buf, (unsigned long)len); yasm_md5_final(dbgfmt_cv->filenames[filenum].digest, &context); fclose(f); yasm_xfree(buf); @@ -972,11 +972,12 @@ cv_sym_size(const cv_sym *cvs) break; case 'S': len += 1; /* XXX: is this 1 or 2? */ - slen = strlen((const char *)cvs->args[arg++].p); + slen = (unsigned long)strlen((const char *)cvs->args[arg++].p); len += slen <= 0xff ? slen : 0xff; break; case 'Z': - len += strlen((const char *)cvs->args[arg++].p) + 1; + len += + (unsigned long)strlen((const char *)cvs->args[arg++].p) + 1; break; default: yasm_internal_error(N_("unknown sym format character")); diff --git a/modules/dbgfmts/codeview/cv-type.c b/modules/dbgfmts/codeview/cv-type.c index c5d049cb..70620a03 100644 --- a/modules/dbgfmts/codeview/cv-type.c +++ b/modules/dbgfmts/codeview/cv-type.c @@ -597,7 +597,7 @@ cv_leaf_size(const cv_leaf *leaf) break; case 'S': len += 1; /* XXX: is this 1 or 2? */ - slen = strlen((const char *)leaf->args[arg++].p); + slen = (unsigned long)strlen((const char *)leaf->args[arg++].p); len += slen <= 0xff ? slen : 0xff; break; default: diff --git a/modules/dbgfmts/dwarf2/dwarf2-aranges.c b/modules/dbgfmts/dwarf2/dwarf2-aranges.c index dd82e491..f78e1d47 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-aranges.c +++ b/modules/dbgfmts/dwarf2/dwarf2-aranges.c @@ -35,7 +35,7 @@ static void dwarf2_append_arange(yasm_section *debug_aranges, /*@only@*/ yasm_expr *start, - /*@only@*/ yasm_expr *length, size_t sizeof_address) + /*@only@*/ yasm_expr *length, unsigned int sizeof_address) { yasm_datavalhead dvs; yasm_bytecode *bc; diff --git a/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.h b/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.h index 4f6ad1bc..c60b8f0e 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.h +++ b/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.h @@ -32,7 +32,7 @@ typedef struct { char *pathname; /* full filename */ char *filename; /* basename of full filename */ - size_t dir; /* index into directories array for relative path; + unsigned long dir; /* index into directories array for relative path; * 0 for current directory. */ } dwarf2_filename; @@ -46,19 +46,19 @@ typedef struct yasm_dbgfmt_dwarf2 { yasm_arch *arch; char **dirs; - size_t dirs_size; - size_t dirs_allocated; + unsigned long dirs_size; + unsigned long dirs_allocated; dwarf2_filename *filenames; - size_t filenames_size; - size_t filenames_allocated; + unsigned long filenames_size; + unsigned long filenames_allocated; enum { DWARF2_FORMAT_32BIT, DWARF2_FORMAT_64BIT } format; - size_t sizeof_address, sizeof_offset, min_insn_len; + unsigned int sizeof_address, sizeof_offset, min_insn_len; } yasm_dbgfmt_dwarf2; /* .loc directive data */ diff --git a/modules/dbgfmts/dwarf2/dwarf2-info.c b/modules/dbgfmts/dwarf2/dwarf2-info.c index 0ae801c7..48923135 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-info.c +++ b/modules/dbgfmts/dwarf2/dwarf2-info.c @@ -235,8 +235,8 @@ dwarf2_add_abbrev_attr(dwarf2_abbrev *abbrev, dwarf_attribute name, } static void -dwarf2_append_expr(yasm_section *sect, /*@only@*/ yasm_expr *expr, size_t size, - int leb) +dwarf2_append_expr(yasm_section *sect, /*@only@*/ yasm_expr *expr, + unsigned int size, int leb) { yasm_datavalhead dvs; yasm_bytecode *bc; diff --git a/modules/dbgfmts/dwarf2/dwarf2-line.c b/modules/dbgfmts/dwarf2/dwarf2-line.c index a95ec574..c5718872 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-line.c +++ b/modules/dbgfmts/dwarf2/dwarf2-line.c @@ -170,12 +170,12 @@ static const yasm_bytecode_callback dwarf2_line_op_bc_callback = { static size_t -dwarf2_dbgfmt_add_file(yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2, size_t filenum, +dwarf2_dbgfmt_add_file(yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2, unsigned long filenum, const char *pathname) { size_t dirlen; const char *filename; - size_t i, dir; + unsigned long i, dir; /* Put the directory into the directory table */ dir = 0; @@ -214,7 +214,7 @@ dwarf2_dbgfmt_add_file(yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2, size_t filenum, /* Realloc table if necessary */ if (filenum >= dbgfmt_dwarf2->filenames_allocated) { - size_t old_allocated = dbgfmt_dwarf2->filenames_allocated; + unsigned long old_allocated = dbgfmt_dwarf2->filenames_allocated; dbgfmt_dwarf2->filenames_allocated = filenum+32; dbgfmt_dwarf2->filenames = yasm_xrealloc(dbgfmt_dwarf2->filenames, sizeof(dwarf2_filename)*dbgfmt_dwarf2->filenames_allocated); @@ -448,7 +448,7 @@ typedef struct dwarf2_line_bc_info { yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2; dwarf2_line_state *state; dwarf2_loc loc; - size_t lastfile; + unsigned long lastfile; } dwarf2_line_bc_info; static int @@ -456,7 +456,7 @@ dwarf2_generate_line_bc(yasm_bytecode *bc, /*@null@*/ void *d) { dwarf2_line_bc_info *info = (dwarf2_line_bc_info *)d; yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2 = info->dbgfmt_dwarf2; - size_t i; + unsigned long i; const char *filename; /*@null@*/ yasm_bytecode *nextbc = yasm_bc__next(bc); @@ -657,7 +657,7 @@ yasm_dwarf2__generate_line(yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2, /* directory list */ for (i=0; idirs_size; i++) - sppbc->len += strlen(dbgfmt_dwarf2->dirs[i])+1; + sppbc->len += (unsigned long)strlen(dbgfmt_dwarf2->dirs[i])+1; sppbc->len++; /* filename list */ @@ -668,7 +668,8 @@ yasm_dwarf2__generate_line(yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2, yasm_errwarn_propagate(errwarns, 0); continue; } - sppbc->len += strlen(dbgfmt_dwarf2->filenames[i].filename) + 1 + + sppbc->len += + (unsigned long)strlen(dbgfmt_dwarf2->filenames[i].filename) + 1 + yasm_size_uleb128(dbgfmt_dwarf2->filenames[i].dir) + 2; } sppbc->len++; @@ -722,7 +723,7 @@ dwarf2_spp_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, size_t i, len; /* Prologue length (following this field) */ - cval = yasm_intnum_create_uint(bc->len - (buf-*bufp) - + cval = yasm_intnum_create_uint(bc->len - (unsigned long)(buf-*bufp) - dbgfmt_dwarf2->sizeof_offset); yasm_arch_intnum_tobytes(dbgfmt_dwarf2->arch, cval, buf, dbgfmt_dwarf2->sizeof_offset, @@ -966,7 +967,7 @@ yasm_dwarf2__line_directive(yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2, return 0; } else if (yasm__strcasecmp(name, "file") == 0) { /*@dependent@*/ /*@null@*/ const yasm_intnum *file_intn; - size_t filenum; + unsigned long filenum; if (!valparams) { yasm_error_set(YASM_ERROR_SYNTAX, N_("[%s] requires an argument"), @@ -988,7 +989,7 @@ yasm_dwarf2__line_directive(yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2, N_("file number is not a constant")); return 0; } - filenum = (size_t)yasm_intnum_get_uint(file_intn); + filenum = yasm_intnum_get_uint(file_intn); vp = yasm_vps_next(vp); if (!vp || !vp->val) { diff --git a/modules/dbgfmts/stabs/stabs-dbgfmt.c b/modules/dbgfmts/stabs/stabs-dbgfmt.c index 9e2fe271..0df12a6c 100644 --- a/modules/dbgfmts/stabs/stabs-dbgfmt.c +++ b/modules/dbgfmts/stabs/stabs-dbgfmt.c @@ -191,7 +191,7 @@ stabs_dbgfmt_append_bcstr(yasm_section *sect, const char *str) yasm_bytecode *bc; bc = yasm_bc_create_common(&stabs_bc_str_callback, yasm__xstrdup(str), 0); - bc->len = strlen(str)+1; + bc->len = (unsigned long)(strlen(str)+1); bc->offset = yasm_bc_next_offset(yasm_section_bcs_last(sect)); yasm_section_bcs_append(sect, bc); diff --git a/modules/listfmts/nasm/nasm-listfmt.c b/modules/listfmts/nasm/nasm-listfmt.c index c1272303..0e0f24b2 100644 --- a/modules/listfmts/nasm/nasm-listfmt.c +++ b/modules/listfmts/nasm/nasm-listfmt.c @@ -82,7 +82,7 @@ nasm_listfmt_destroy(/*@only@*/ yasm_listfmt *listfmt) static int nasm_listfmt_output_value(yasm_value *value, unsigned char *buf, - size_t destsize, unsigned long offset, + unsigned int destsize, unsigned long offset, yasm_bytecode *bc, int warn, /*@null@*/ void *d) { /*@null@*/ nasm_listfmt_output_info *info = (nasm_listfmt_output_info *)d; diff --git a/modules/objfmts/bin/bin-objfmt.c b/modules/objfmts/bin/bin-objfmt.c index b33c8bc2..e89efaf2 100644 --- a/modules/objfmts/bin/bin-objfmt.c +++ b/modules/objfmts/bin/bin-objfmt.c @@ -129,7 +129,8 @@ bin_objfmt_expr_xform(/*@returned@*/ /*@only@*/ yasm_expr *e, } static int -bin_objfmt_output_value(yasm_value *value, unsigned char *buf, size_t destsize, +bin_objfmt_output_value(yasm_value *value, unsigned char *buf, + unsigned int destsize, /*@unused@*/ unsigned long offset, yasm_bytecode *bc, int warn, /*@null@*/ void *d) { diff --git a/modules/objfmts/coff/coff-objfmt.c b/modules/objfmts/coff/coff-objfmt.c index 4d3684df..efc15c60 100644 --- a/modules/objfmts/coff/coff-objfmt.c +++ b/modules/objfmts/coff/coff-objfmt.c @@ -442,9 +442,9 @@ coff_objfmt_set_section_addr(yasm_section *sect, /*@null@*/ void *d) } static int -coff_objfmt_output_value(yasm_value *value, unsigned char *buf, size_t destsize, - unsigned long offset, yasm_bytecode *bc, int warn, - /*@null@*/ void *d) +coff_objfmt_output_value(yasm_value *value, unsigned char *buf, + unsigned int destsize, unsigned long offset, + yasm_bytecode *bc, int warn, /*@null@*/ void *d) { /*@null@*/ coff_objfmt_output_info *info = (coff_objfmt_output_info *)d; yasm_objfmt_coff *objfmt_coff; @@ -770,7 +770,7 @@ coff_objfmt_output_section(yasm_section *sect, /*@null@*/ void *d) size_t namelen = strlen(yasm_section_get_name(sect)); if (namelen > 8) { csd->strtab_name = info->strtab_offset; - info->strtab_offset += namelen + 1; + info->strtab_offset += (unsigned long)(namelen + 1); } } @@ -1070,7 +1070,7 @@ coff_objfmt_output_sym(yasm_symrec *sym, /*@null@*/ void *d) if (len > 8) { YASM_WRITE_32_L(localbuf, 0); /* "zeros" field */ YASM_WRITE_32_L(localbuf, info->strtab_offset); /* strtab offset */ - info->strtab_offset += len+1; + info->strtab_offset += (unsigned long)(len+1); } else { /* <8 chars, so no string table entry needed */ strncpy((char *)localbuf, name, 8); @@ -1098,7 +1098,7 @@ coff_objfmt_output_sym(yasm_symrec *sym, /*@null@*/ void *d) if (len > 14) { YASM_WRITE_32_L(localbuf, 0); YASM_WRITE_32_L(localbuf, info->strtab_offset); - info->strtab_offset += len+1; + info->strtab_offset += (unsigned long)(len+1); } else strncpy((char *)localbuf, csymd->aux[0].fname, 14); break; @@ -1977,7 +1977,7 @@ dir_setframe(yasm_objfmt_coff *objfmt_coff, yasm_valparamhead *valparams, } /* Set the frame fields in the unwind info */ - objfmt_coff->unwind->framereg = *reg; + objfmt_coff->unwind->framereg = (unsigned long)(*reg); yasm_value_initialize(&objfmt_coff->unwind->frameoff, off, 8); /* Generate a SET_FPREG unwind code */ diff --git a/modules/objfmts/dbg/dbg-objfmt.c b/modules/objfmts/dbg/dbg-objfmt.c index 33fbdb9e..c346e20c 100644 --- a/modules/objfmts/dbg/dbg-objfmt.c +++ b/modules/objfmts/dbg/dbg-objfmt.c @@ -66,7 +66,7 @@ dbg_objfmt_output(yasm_objfmt *objfmt, FILE *f, int all_syms, yasm_dbgfmt *df, { yasm_objfmt_dbg *objfmt_dbg = (yasm_objfmt_dbg *)objfmt; char buf[1024]; - unsigned int i; + size_t i; /* Copy temp file to real output file */ rewind(objfmt_dbg->dbgfile); diff --git a/modules/objfmts/elf/elf-objfmt.c b/modules/objfmts/elf/elf-objfmt.c index 9473f022..c0ae8416 100644 --- a/modules/objfmts/elf/elf-objfmt.c +++ b/modules/objfmts/elf/elf-objfmt.c @@ -271,8 +271,8 @@ elf_objfmt_output_align(FILE *f, unsigned int align) static int elf_objfmt_output_reloc(yasm_symrec *sym, yasm_bytecode *bc, - unsigned char *buf, size_t destsize, size_t valsize, - int warn, void *d) + unsigned char *buf, unsigned int destsize, + unsigned int valsize, int warn, void *d) { elf_reloc_entry *reloc; elf_objfmt_output_info *info = d; @@ -297,9 +297,9 @@ elf_objfmt_output_reloc(yasm_symrec *sym, yasm_bytecode *bc, } static int -elf_objfmt_output_value(yasm_value *value, unsigned char *buf, size_t destsize, - unsigned long offset, yasm_bytecode *bc, int warn, - /*@null@*/ void *d) +elf_objfmt_output_value(yasm_value *value, unsigned char *buf, + unsigned int destsize, unsigned long offset, + yasm_bytecode *bc, int warn, /*@null@*/ void *d) { /*@null@*/ elf_objfmt_output_info *info = (elf_objfmt_output_info *)d; /*@dependent@*/ /*@null@*/ yasm_intnum *intn; diff --git a/modules/objfmts/elf/elf.c b/modules/objfmts/elf/elf.c index 5961c6a1..12fc58a9 100644 --- a/modules/objfmts/elf/elf.c +++ b/modules/objfmts/elf/elf.c @@ -176,7 +176,7 @@ elf_strtab_entry_set_str(elf_strtab_entry *entry, const char *str) last = entry; entry = STAILQ_NEXT(last, qlink); while (entry) { - entry->index = last->index + strlen(last->str) + 1; + entry->index = last->index + (unsigned long)strlen(last->str) + 1; last = entry; entry = STAILQ_NEXT(last, qlink); } @@ -209,7 +209,7 @@ elf_strtab_append_str(elf_strtab_head *strtab, const char *str) last = STAILQ_LAST(strtab, elf_strtab_entry, qlink); entry = elf_strtab_entry_create(str); - entry->index = last->index + strlen(last->str) + 1; + entry->index = last->index + (unsigned long)strlen(last->str) + 1; STAILQ_INSERT_TAIL(strtab, entry, qlink); return entry; @@ -248,7 +248,7 @@ elf_strtab_output_to_file(FILE *f, elf_strtab_head *strtab) STAILQ_FOREACH(entry, strtab, qlink) { size_t len = 1 + strlen(entry->str); fwrite(entry->str, len, 1, f); - size += len; + size += (unsigned long)len; } return size; } @@ -660,7 +660,7 @@ elf_secthead_name_reloc_section(const char *basesect) } else { - int prepend_length = strlen(elf_march->reloc_section_prefix); + size_t prepend_length = strlen(elf_march->reloc_section_prefix); char *sectname = yasm_xmalloc(prepend_length + strlen(basesect) + 1); strcpy(sectname, elf_march->reloc_section_prefix); strcat(sectname, basesect); diff --git a/modules/objfmts/macho/macho-objfmt.c b/modules/objfmts/macho/macho-objfmt.c index 39884dc3..b0c79bc3 100644 --- a/modules/objfmts/macho/macho-objfmt.c +++ b/modules/objfmts/macho/macho-objfmt.c @@ -424,7 +424,7 @@ macho64_objfmt_create(yasm_object *object, yasm_arch *a) static int macho_objfmt_output_value(yasm_value *value, unsigned char *buf, - size_t destsize, unsigned long offset, + unsigned int destsize, unsigned long offset, yasm_bytecode *bc, int warn, /*@null@*/ void *d) { /*@null@*/ macho_objfmt_output_info *info = (macho_objfmt_output_info *)d; @@ -837,7 +837,9 @@ macho_objfmt_count_sym(yasm_symrec *sym, /*@null@*/ void *d) sym_data->add_uscore = 1; } #endif - sym_data->length = strlen(name) + sym_data->add_uscore + 1; /* name length + delimiter */ + /* name length + delimiter */ + sym_data->length = + (unsigned long)strlen(name) + sym_data->add_uscore + 1; info->strlength += sym_data->length; info->indx++; } diff --git a/modules/objfmts/rdf/rdf-objfmt.c b/modules/objfmts/rdf/rdf-objfmt.c index 4b09a8f9..7ff400bf 100644 --- a/modules/objfmts/rdf/rdf-objfmt.c +++ b/modules/objfmts/rdf/rdf-objfmt.c @@ -198,9 +198,9 @@ rdf_objfmt_create(yasm_object *object, yasm_arch *a) } static int -rdf_objfmt_output_value(yasm_value *value, unsigned char *buf, size_t destsize, - unsigned long offset, yasm_bytecode *bc, int warn, - /*@null@*/ void *d) +rdf_objfmt_output_value(yasm_value *value, unsigned char *buf, + unsigned int destsize, unsigned long offset, + yasm_bytecode *bc, int warn, /*@null@*/ void *d) { /*@null@*/ rdf_objfmt_output_info *info = (rdf_objfmt_output_info *)d; yasm_objfmt_rdf *objfmt_rdf; diff --git a/modules/objfmts/xdf/xdf-objfmt.c b/modules/objfmts/xdf/xdf-objfmt.c index 33aa77ac..5251d525 100644 --- a/modules/objfmts/xdf/xdf-objfmt.c +++ b/modules/objfmts/xdf/xdf-objfmt.c @@ -155,9 +155,9 @@ xdf_objfmt_create(yasm_object *object, yasm_arch *a) } static int -xdf_objfmt_output_value(yasm_value *value, unsigned char *buf, size_t destsize, - unsigned long offset, yasm_bytecode *bc, int warn, - /*@null@*/ void *d) +xdf_objfmt_output_value(yasm_value *value, unsigned char *buf, + unsigned int destsize, unsigned long offset, + yasm_bytecode *bc, int warn, /*@null@*/ void *d) { /*@null@*/ xdf_objfmt_output_info *info = (xdf_objfmt_output_info *)d; yasm_objfmt_xdf *objfmt_xdf; @@ -536,7 +536,7 @@ xdf_objfmt_output_sym(yasm_symrec *sym, /*@null@*/ void *d) YASM_WRITE_32_L(localbuf, scnum); /* section number */ YASM_WRITE_32_L(localbuf, value); /* value */ YASM_WRITE_32_L(localbuf, info->strtab_offset); - info->strtab_offset += len+1; + info->strtab_offset += (unsigned long)(len+1); YASM_WRITE_32_L(localbuf, flags); /* flags */ fwrite(info->buf, 16, 1, info->f); } diff --git a/modules/parsers/gas/gas-parse.c b/modules/parsers/gas/gas-parse.c index f52b9d52..2f0cbb07 100644 --- a/modules/parsers/gas/gas-parse.c +++ b/modules/parsers/gas/gas-parse.c @@ -858,7 +858,7 @@ parse_instr(yasm_parser_gas *parser_gas) } case SEGREG: { - unsigned long segreg = SEGREG_val[0]; + uintptr_t segreg = SEGREG_val[0]; get_next_token(); /* SEGREG */ bc = parse_instr(parser_gas); if (!bc) @@ -977,7 +977,7 @@ parse_memaddr(yasm_parser_gas *parser_gas) int strong = 0; if (curtok == SEGREG) { - unsigned long segreg = SEGREG_val[0]; + uintptr_t segreg = SEGREG_val[0]; get_next_token(); /* SEGREG */ if (!expect(':')) return NULL; get_next_token(); /* ':' */ @@ -1000,7 +1000,8 @@ parse_memaddr(yasm_parser_gas *parser_gas) e1 = NULL; if (curtok == '(') { - unsigned long reg = ULONG_MAX; + int havereg = 0; + uintptr_t reg; yasm_intnum *scale = NULL; get_next_token(); /* '(' */ @@ -1029,6 +1030,7 @@ parse_memaddr(yasm_parser_gas *parser_gas) /* index register */ if (curtok == REG) { reg = REG_val[0]; + havereg = 1; get_next_token(); /* REG */ if (curtok != ',') { scale = yasm_intnum_create_uint(1); @@ -1058,7 +1060,7 @@ done: get_next_token(); /* ')' */ if (scale) { - if (reg == ULONG_MAX) { + if (!havereg) { if (yasm_intnum_get_uint(scale) != 1) yasm_warn_set(YASM_WARN_GENERAL, N_("scale factor of %u without an index register"), @@ -1093,7 +1095,7 @@ parse_operand(yasm_parser_gas *parser_gas) { yasm_effaddr *ea; yasm_insn_operand *op; - unsigned long reg; + uintptr_t reg; switch (curtok) { case REG: diff --git a/modules/parsers/nasm/nasm-parse.c b/modules/parsers/nasm/nasm-parse.c index d7ca2987..0f6fba44 100644 --- a/modules/parsers/nasm/nasm-parse.c +++ b/modules/parsers/nasm/nasm-parse.c @@ -621,7 +621,7 @@ parse_instr(yasm_parser_nasm *parser_nasm) return bc; } case SEGREG: { - unsigned long segreg = SEGREG_val[0]; + uintptr_t segreg = SEGREG_val[0]; yasm_bytecode *bc; get_next_token(); bc = parse_instr(parser_nasm); @@ -686,7 +686,7 @@ parse_operand(yasm_parser_nasm *parser_nasm) } case TARGETMOD: { - unsigned long tmod = TARGETMOD_val[0]; + uintptr_t tmod = TARGETMOD_val[0]; get_next_token(); op = parse_operand(parser_nasm); if (op) @@ -711,7 +711,7 @@ parse_memaddr(yasm_parser_nasm *parser_nasm) switch (curtok) { case SEGREG: { - unsigned long segreg = SEGREG_val[0]; + uintptr_t segreg = SEGREG_val[0]; get_next_token(); if (!expect(':')) { yasm_error_set(YASM_ERROR_SYNTAX, @@ -1209,7 +1209,7 @@ nasm_parser_directive(yasm_parser_nasm *parser_nasm, const char *name, yasm_valparamhead *valparams, yasm_valparamhead *objext_valparams) { - yasm_valparam *vp, *vp2; + yasm_valparam *vp; unsigned long line = cur_line; static const struct { const char *name; @@ -1263,7 +1263,6 @@ nasm_parser_directive(yasm_parser_nasm *parser_nasm, const char *name, name); } -done: if (valparams) yasm_vps_delete(valparams); if (objext_valparams) diff --git a/modules/preprocs/nasm/nasm-pp.c b/modules/preprocs/nasm/nasm-pp.c index f2147195..2b65330b 100644 --- a/modules/preprocs/nasm/nasm-pp.c +++ b/modules/preprocs/nasm/nasm-pp.c @@ -422,7 +422,8 @@ static void make_tok_num(Token * tok, yasm_intnum *val); static void error(int severity, const char *fmt, ...); static void *new_Block(size_t size); static void delete_Blocks(void); -static Token *new_Token(Token * next, int type, const char *text, int txtlen); +static Token *new_Token(Token * next, int type, const char *text, + size_t txtlen); static Token *delete_Token(Token * t); /* @@ -709,7 +710,7 @@ read_line(void) continued_count = 0; while (1) { - q = fgets(p, bufsize - (p - buffer), istk->fp); + q = fgets(p, bufsize - (int)(p - buffer), istk->fp); if (!q) break; p += strlen(p); @@ -735,7 +736,7 @@ read_line(void) } if (p - buffer > bufsize - 10) { - long offset = p - buffer; + long offset = (long)(p - buffer); bufsize += BUF_DELTA; buffer = nasm_realloc(buffer, (size_t)bufsize); p = buffer + offset; /* prevent stale-pointer problems */ @@ -920,13 +921,13 @@ tokenise(char *line) /* Handle unterminated string */ if (type == -1) { - *tail = t = new_Token(NULL, TOK_STRING, line, p-line+1); + *tail = t = new_Token(NULL, TOK_STRING, line, (size_t)(p-line)+1); t->text[p-line] = *line; tail = &t->next; } else if (type != TOK_COMMENT) { - *tail = t = new_Token(NULL, type, line, p - line); + *tail = t = new_Token(NULL, type, line, (size_t)(p - line)); tail = &t->next; } line = p; @@ -988,7 +989,7 @@ delete_Blocks(void) * also the mac and next elements to NULL. */ static Token * -new_Token(Token * next, int type, const char *text, int txtlen) +new_Token(Token * next, int type, const char *text, size_t txtlen) { Token *t; int i; @@ -1013,8 +1014,8 @@ new_Token(Token * next, int type, const char *text, int txtlen) { if (txtlen == 0) txtlen = strlen(text); - t->text = nasm_malloc(1 + (size_t)txtlen); - strncpy(t->text, text, (size_t)txtlen); + t->text = nasm_malloc(1 + txtlen); + strncpy(t->text, text, txtlen); t->text[txtlen] = '\0'; } return t; @@ -1039,7 +1040,7 @@ static char * detoken(Token * tlist, int expand_locals) { Token *t; - int len; + size_t len; char *line, *p; len = 0; @@ -1081,7 +1082,7 @@ detoken(Token * tlist, int expand_locals) len += strlen(t->text); } } - p = line = nasm_malloc((size_t)len + 1); + p = line = nasm_malloc(len + 1); for (t = tlist; t; t = t->next) { if (t->type == TOK_WHITESPACE) @@ -1162,7 +1163,7 @@ ppscan(void *private_data, struct tokenval *tokval) { int rn_warn; char q, *r; - int l; + size_t l; r = tline->text; q = *r++; @@ -1238,7 +1239,7 @@ get_ctx(char *name, int all_contexts) { Context *ctx; SMacro *m; - int i; + size_t i; if (!name || name[0] != '%' || name[1] != '$') return NULL; @@ -2909,7 +2910,7 @@ do_directive(Token * tline) macro_start = nasm_malloc(sizeof(*macro_start)); macro_start->next = NULL; make_tok_num(macro_start, - yasm_intnum_create_uint(strlen(t->text) - 2)); + yasm_intnum_create_uint((unsigned long)(strlen(t->text) - 2))); macro_start->mac = NULL; /* diff --git a/modules/preprocs/nasm/nasmlib.c b/modules/preprocs/nasm/nasmlib.c index 5d9ae4d6..268aa287 100644 --- a/modules/preprocs/nasm/nasmlib.c +++ b/modules/preprocs/nasm/nasmlib.c @@ -112,7 +112,7 @@ yasm_intnum *nasm_readnum (char *str, int *error) return intn; } -yasm_intnum *nasm_readstrnum (char *str, int length, int *warn) +yasm_intnum *nasm_readstrnum (char *str, size_t length, int *warn) { char save; yasm_intnum *intn; @@ -193,7 +193,7 @@ void nasm_quote(char **str) char *nasm_strcat(const char *one, const char *two) { char *rslt; - int l1=strlen(one); + size_t l1=strlen(one); rslt = nasm_malloc(l1+strlen(two)+1); strcpy(rslt, one); strcpy(rslt+l1, two); diff --git a/modules/preprocs/nasm/nasmlib.h b/modules/preprocs/nasm/nasmlib.h index 37538f40..a14f64b4 100644 --- a/modules/preprocs/nasm/nasmlib.h +++ b/modules/preprocs/nasm/nasmlib.h @@ -40,7 +40,7 @@ yasm_intnum *nasm_readnum(char *str, int *error); * str points to and length covers the middle of the string, * without the quotes. */ -yasm_intnum *nasm_readstrnum(char *str, int length, int *warn); +yasm_intnum *nasm_readstrnum(char *str, size_t length, int *warn); char *nasm_src_set_fname(char *newname); char *nasm_src_get_fname(void); diff --git a/tools/gap/gap.c b/tools/gap/gap.c index eb96d166..b9069f20 100644 --- a/tools/gap/gap.c +++ b/tools/gap/gap.c @@ -642,7 +642,7 @@ perfect_dir(FILE *out, const char *which, const char *parser, dir_list *dirs) key *k = yasm_xmalloc(sizeof(key)); k->name_k = yasm__xstrdup(d->name); - k->len_k = strlen(d->name); + k->len_k = (ub4)strlen(d->name); k->next_k = keys; keys = k; nkeys++; diff --git a/tools/gap/perfect.c b/tools/gap/perfect.c index 77464c25..c56304f6 100644 --- a/tools/gap/perfect.c +++ b/tools/gap/perfect.c @@ -515,7 +515,7 @@ static int augment( /* add childb to the queue of reachable things */ if (childb) childb->water_b = highwater; tabq[tail].b_q = childb; - tabq[tail].newval_q = i; /* how to make parent (myb) use this hash */ + tabq[tail].newval_q = (ub2)i; /* how to make parent (myb) use this hash */ tabq[tail].oldval_q = myb->val_b; /* need this for rollback */ tabq[tail].parent_q = q; ++tail; From ce18bfd47579d34bb4de375047efda8828a3e7cb Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 24 Feb 2007 23:35:14 +0000 Subject: [PATCH 004/585] Merge [1796] from trunk. svn path=/branches/yasm-0.6.x/; revision=1797 --- modules/objfmts/yasm_objfmts.xml | 13 ++++++++++++- yasm_objfmts.7 | 11 +++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/modules/objfmts/yasm_objfmts.xml b/modules/objfmts/yasm_objfmts.xml index 1e9f095f..3a70fedc 100644 --- a/modules/objfmts/yasm_objfmts.xml +++ b/modules/objfmts/yasm_objfmts.xml @@ -8,7 +8,7 @@ Yasm Supported Object Formats - October 2006 + February 2007 Yasm Peter @@ -105,6 +105,17 @@ ELF has complex support for relocatable and shared objects. + + macho + + The Mach-O object format really comes in two flavors: + macho32 (for 32-bit targets) and + macho64 (for 64-bit targets). Mach-O is used as + the object format on MacOS X. As Yasm currently only supports + x86 and AMD64 instruction sets, it can only generate Mach-O + objects for Intel-based Macs. + + rdf diff --git a/yasm_objfmts.7 b/yasm_objfmts.7 index b36288d2..9825c0ac 100644 --- a/yasm_objfmts.7 +++ b/yasm_objfmts.7 @@ -1,11 +1,11 @@ .\" Title: yasm_objfmts .\" Author: Peter Johnson .\" Generator: DocBook XSL Stylesheets v1.70.1 -.\" Date: October 2006 +.\" Date: February 2007 .\" Manual: Yasm Supported Object Formats .\" Source: Yasm .\" -.TH "YASM_OBJFMTS" "7" "October 2006" "Yasm" "Yasm Supported Object Formats" +.TH "YASM_OBJFMTS" "7" "February 2007" "Yasm" "Yasm Supported Object Formats" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) @@ -46,6 +46,13 @@ The ELF object format really comes in two flavors: (for 32\-bit targets) and \(lqelf64\(rq (for 64\-bit targets). ELF is a standard object format in common use on modern Unix and compatible systems (e.g. Linux, FreeBSD). ELF has complex support for relocatable and shared objects. +.SH "MACHO" +.PP +The Mach\-O object format really comes in two flavors: +\(lqmacho32\(rq +(for 32\-bit targets) and +\(lqmacho64\(rq +(for 64\-bit targets). Mach\-O is used as the object format on MacOS X. As Yasm currently only supports x86 and AMD64 instruction sets, it can only generate Mach\-O objects for Intel\-based Macs. .SH "RDF" .PP The RDOFF2 object format is a simple multi\-section format originally designed for NASM. It supports segment references but not WRT references. It was designed primarily for simplicity and has minimalistic headers for ease of loading and linking. A complete toolchain (linker, librarian, and loader) is distributed with NASM. From 0e5f1b8ffae0b44731230b9779ad90d5f4a10761 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 25 Feb 2007 00:34:21 +0000 Subject: [PATCH 005/585] Bump 0.6.x branch version to 0.6.1. svn path=/branches/yasm-0.6.x/; revision=1800 --- Mkfiles/dj/config.h | 2 +- Mkfiles/vc/config.h | 2 +- Mkfiles/vc8/config.h | 2 +- configure.ac | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Mkfiles/dj/config.h b/Mkfiles/dj/config.h index 423decc4..c5f7a8e3 100644 --- a/Mkfiles/dj/config.h +++ b/Mkfiles/dj/config.h @@ -123,7 +123,7 @@ #define PACKAGE_BUILD "BRANCH" /* Define to internal version of this package. */ -#define PACKAGE_INTVER "0.6.0" +#define PACKAGE_INTVER "0.6.1" /* Define to the full name of this package. */ #define PACKAGE_NAME "yasm" diff --git a/Mkfiles/vc/config.h b/Mkfiles/vc/config.h index e67ee4c0..ec7329ac 100644 --- a/Mkfiles/vc/config.h +++ b/Mkfiles/vc/config.h @@ -124,7 +124,7 @@ #define PACKAGE_BUILD "BRANCH" /* Define to internal version of this package. */ -#define PACKAGE_INTVER "0.6.0" +#define PACKAGE_INTVER "0.6.1" /* Define to the full name of this package. */ #define PACKAGE_NAME "yasm" diff --git a/Mkfiles/vc8/config.h b/Mkfiles/vc8/config.h index 864e9fa7..f8483f71 100644 --- a/Mkfiles/vc8/config.h +++ b/Mkfiles/vc8/config.h @@ -124,7 +124,7 @@ #define PACKAGE_BUILD "BRANCH" /* Define to internal version of this package. */ -#define PACKAGE_INTVER "0.6.0" +#define PACKAGE_INTVER "0.6.1" /* Define to the full name of this package. */ #define PACKAGE_NAME "yasm" diff --git a/configure.ac b/configure.ac index 01b8eb7f..8d1963d9 100644 --- a/configure.ac +++ b/configure.ac @@ -13,7 +13,7 @@ AM_CONFIG_HEADER([config.h]) AM_INIT_AUTOMAKE(yasm, [0.6.x]) AM_MAINTAINER_MODE -AC_DEFINE(PACKAGE_INTVER, ["0.6.0"], +AC_DEFINE(PACKAGE_INTVER, ["0.6.1"], [Define to internal version of this package.]) AC_DEFINE(PACKAGE_BUILD, ["BRANCH"], [Define to build version of this package.]) From c52ccde63f857fefbdad36a2374d734d9d0d6a70 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 10 Mar 2007 08:38:23 +0000 Subject: [PATCH 006/585] Merge a number of revisions from trunk: [1804]: -E and -s command line options (feature) [1805]: Fix uninit warning [1806]: -Wsize-override option (feature) [1807]: Change prefix order [1808], [1809], [1810]: Bugfixes [1811]: Mach-O section and segment name zeroing bugfix [1814]: HAMT portability fix svn path=/branches/yasm-0.6.x/; revision=1818 --- frontends/yasm/yasm.c | 77 +++++++++-- libyasm/arch.h | 2 +- libyasm/errwarn.h | 3 +- libyasm/hamt.c | 26 ++-- libyasm/symrec.c | 24 +++- libyasm/tests/expr-wide-ident.hex | 2 +- modules/arch/x86/tests/addrop.hex | 2 +- modules/arch/x86/tests/genopcode.hex | 4 +- modules/arch/x86/tests/rep.hex | 2 +- modules/arch/x86/tests/sse-prefix.hex | 8 +- modules/arch/x86/tests/sse4.hex | 128 +++++++++--------- modules/arch/x86/x86bc.c | 8 +- modules/objfmts/elf/elf-objfmt.c | 6 +- modules/objfmts/macho/macho-objfmt.c | 12 +- .../objfmts/macho/tests/gas32/gas-macho32.hex | 106 +++++++-------- .../objfmts/macho/tests/gas64/gas-macho64.hex | 68 +++++----- .../macho/tests/nasm32/macho-reloc.hex | 68 +++++----- .../objfmts/macho/tests/nasm32/machotest.hex | 106 +++++++-------- .../macho/tests/nasm64/machotest64.hex | 106 +++++++-------- modules/parsers/gas/gas-parse.c | 2 +- modules/parsers/gas/gas-token.re | 18 ++- modules/parsers/nasm/nasm-parse.c | 19 ++- modules/parsers/nasm/tests/long.hex | 2 +- 23 files changed, 450 insertions(+), 349 deletions(-) diff --git a/frontends/yasm/yasm.c b/frontends/yasm/yasm.c index b213415b..d49fce04 100644 --- a/frontends/yasm/yasm.c +++ b/frontends/yasm/yasm.c @@ -69,6 +69,8 @@ static int preproc_only = 0; static unsigned int force_strict = 0; static int generate_make_dependencies = 0; static int warning_error = 0; /* warnings being treated as errors */ +static FILE *errfile; +/*@null@*/ /*@only@*/ static char *error_filename = NULL; static enum { EWSTYLE_GNU = 0, EWSTYLE_VC @@ -93,6 +95,8 @@ static int opt_objfile_handler(char *cmd, /*@null@*/ char *param, int extra); static int opt_machine_handler(char *cmd, /*@null@*/ char *param, int extra); static int opt_strict_handler(char *cmd, /*@null@*/ char *param, int extra); static int opt_warning_handler(char *cmd, /*@null@*/ char *param, int extra); +static int opt_error_file(char *cmd, /*@null@*/ char *param, int extra); +static int opt_error_stdout(char *cmd, /*@null@*/ char *param, int extra); static int preproc_only_handler(char *cmd, /*@null@*/ char *param, int extra); static int opt_include_option(char *cmd, /*@null@*/ char *param, int extra); static int opt_preproc_option(char *cmd, /*@null@*/ char *param, int extra); @@ -160,6 +164,10 @@ static opt_option options[] = N_("enables/disables warning"), NULL }, { 'M', NULL, 0, opt_makedep_handler, 0, N_("generate Makefile dependencies on stdout"), NULL }, + { 'E', NULL, 1, opt_error_file, 0, + N_("redirect error messages to file"), N_("file") }, + { 's', NULL, 0, opt_error_stdout, 0, + N_("redirect error messages to stdout"), NULL }, { 'e', "preproc-only", 0, preproc_only_handler, 0, N_("preprocess only (writes output to stdout by default)"), NULL }, { 'i', NULL, 1, opt_include_option, 0, @@ -548,6 +556,8 @@ main(int argc, char *argv[]) /*@null@*/ FILE *in = NULL; size_t i; + errfile = stderr; + #if defined(HAVE_SETLOCALE) && defined(HAVE_LC_MESSAGES) setlocale(LC_MESSAGES, ""); #endif @@ -586,6 +596,13 @@ main(int argc, char *argv[]) return EXIT_SUCCESS; } + /* Open error file if specified. */ + if (error_filename) { + errfile = open_file(error_filename, "wt"); + if (!errfile) + return EXIT_FAILURE; + } + /* Initialize BitVector (needed for intnum/floatnum). */ if (BitVector_Boot() != ErrCode_Ok) { print_error(_("%s: could not initialize BitVector"), _("FATAL")); @@ -773,6 +790,9 @@ cleanup(yasm_object *object) if (objfmt_keyword) yasm_xfree(objfmt_keyword); } + + if (errfile != stderr && errfile != stdout) + fclose(errfile); } /* @@ -1024,12 +1044,42 @@ opt_warning_handler(char *cmd, /*@unused@*/ char *param, int extra) action(YASM_WARN_ORPHAN_LABEL); else if (strcmp(cmd, "uninit-contents") == 0) action(YASM_WARN_UNINIT_CONTENTS); + else if (strcmp(cmd, "size-override") == 0) + action(YASM_WARN_SIZE_OVERRIDE); else return 1; return 0; } +static int +opt_error_file(/*@unused@*/ char *cmd, char *param, /*@unused@*/ int extra) +{ + if (error_filename) { + print_error( + _("warning: can output to only one error file, last specified used")); + yasm_xfree(error_filename); + } + + assert(param != NULL); + error_filename = yasm__xstrdup(param); + + return 0; +} + +static int +opt_error_stdout(/*@unused@*/ char *cmd, /*@unused@*/ char *param, + /*@unused@*/ int extra) +{ + /* Clear any specified error filename */ + if (error_filename) { + yasm_xfree(error_filename); + error_filename = NULL; + } + errfile = stdout; + return 0; +} + static int preproc_only_handler(/*@unused@*/ char *cmd, /*@unused@*/ char *param, /*@unused@*/ int extra) @@ -1184,11 +1234,11 @@ static void print_error(const char *fmt, ...) { va_list va; - fprintf(stderr, "yasm: "); + fprintf(errfile, "yasm: "); va_start(va, fmt); - vfprintf(stderr, fmt, va); + vfprintf(errfile, fmt, va); va_end(va); - fputc('\n', stderr); + fputc('\n', errfile); } static /*@exits@*/ void @@ -1206,9 +1256,9 @@ handle_yasm_int_error(const char *file, unsigned int line, const char *message) static /*@exits@*/ void handle_yasm_fatal(const char *fmt, va_list va) { - fprintf(stderr, "yasm: %s: ", _("FATAL")); - vfprintf(stderr, gettext(fmt), va); - fputc('\n', stderr); + fprintf(errfile, "yasm: %s: ", _("FATAL")); + vfprintf(errfile, gettext(fmt), va); + fputc('\n', errfile); exit(EXIT_FAILURE); } @@ -1234,15 +1284,16 @@ print_yasm_error(const char *filename, unsigned long line, const char *msg, const char *xref_msg) { if (line) - fprintf(stderr, fmt[ewmsg_style], filename, line, "", msg); + fprintf(errfile, fmt[ewmsg_style], filename, line, "", msg); else - fprintf(stderr, fmt_noline[ewmsg_style], filename, "", msg); + fprintf(errfile, fmt_noline[ewmsg_style], filename, "", msg); if (xref_fn && xref_msg) { if (xref_line) - fprintf(stderr, fmt[ewmsg_style], xref_fn, xref_line, "", xref_msg); + fprintf(errfile, fmt[ewmsg_style], xref_fn, xref_line, "", + xref_msg); else - fprintf(stderr, fmt_noline[ewmsg_style], xref_fn, "", xref_msg); + fprintf(errfile, fmt_noline[ewmsg_style], xref_fn, "", xref_msg); } } @@ -1250,7 +1301,9 @@ static void print_yasm_warning(const char *filename, unsigned long line, const char *msg) { if (line) - fprintf(stderr, fmt[ewmsg_style], filename, line, _("warning: "), msg); + fprintf(errfile, fmt[ewmsg_style], filename, line, _("warning: "), + msg); else - fprintf(stderr, fmt_noline[ewmsg_style], filename, _("warning: "), msg); + fprintf(errfile, fmt_noline[ewmsg_style], filename, _("warning: "), + msg); } diff --git a/libyasm/arch.h b/libyasm/arch.h index 7646dc71..4a12884d 100644 --- a/libyasm/arch.h +++ b/libyasm/arch.h @@ -264,7 +264,7 @@ struct yasm_insn_operand { uintptr_t targetmod; /**< Arch target modifier, 0 if none. */ - /** Specified size of the operand, in bytes. 0 if not user-specified. */ + /** Specified size of the operand, in bits. 0 if not user-specified. */ unsigned int size:8; /** Nonzero if dereference. Used for "*foo" in GAS. diff --git a/libyasm/errwarn.h b/libyasm/errwarn.h index d609b9ce..64b73b59 100644 --- a/libyasm/errwarn.h +++ b/libyasm/errwarn.h @@ -41,7 +41,8 @@ typedef enum yasm_warn_class { YASM_WARN_UNREC_CHAR, /**< Unrecognized characters (while tokenizing) */ YASM_WARN_PREPROC, /**< Preprocessor warnings */ YASM_WARN_ORPHAN_LABEL, /**< Label alone on a line without a colon */ - YASM_WARN_UNINIT_CONTENTS /**< Uninitialized space in code/data section */ + YASM_WARN_UNINIT_CONTENTS, /**< Uninitialized space in code/data section */ + YASM_WARN_SIZE_OVERRIDE /**< Double size override */ } yasm_warn_class; /** Error classes. Bitmask-based to support limited subclassing. */ diff --git a/libyasm/hamt.c b/libyasm/hamt.c index 746fb904..6eee0586 100644 --- a/libyasm/hamt.c +++ b/libyasm/hamt.c @@ -45,7 +45,7 @@ struct HAMTEntry { typedef struct HAMTNode { unsigned long BitMapKey; /* 32 bits, bitmap or hash key */ - void *BaseValue; /* Base of HAMTNode list or value */ + uintptr_t BaseValue; /* Base of HAMTNode list or value */ } HAMTNode; struct HAMT { @@ -59,14 +59,20 @@ struct HAMT { * 4 or 2-byte aligned (as it uses the LSB of the pointer variable to store * the subtrie flag! */ -#define IsSubTrie(n) ((uintptr_t)((n)->BaseValue) & 1) +#define IsSubTrie(n) ((n)->BaseValue & 1) #define SetSubTrie(h, n, v) do { \ - if ((uintptr_t)(v) & 1) \ + if ((uintptr_t)(v) & 1) \ h->error_func(__FILE__, __LINE__, \ N_("Subtrie is seen as subtrie before flag is set (misaligned?)")); \ - (n)->BaseValue = (void *)((uintptr_t)(v) | 1); \ + (n)->BaseValue = (uintptr_t)(v) | 1; \ } while (0) -#define GetSubTrie(n) (HAMTNode *)((uintptr_t)((n)->BaseValue)&~1UL) +#define SetValue(h, n, v) do { \ + if ((uintptr_t)(v) & 1) \ + h->error_func(__FILE__, __LINE__, \ + N_("Value is seen as subtrie (misaligned?)")); \ + (n)->BaseValue = (uintptr_t)(v); \ + } while (0) +#define GetSubTrie(n) (HAMTNode *)(((n)->BaseValue | 1) ^ 1) static unsigned long HashKey(const char *key) @@ -98,7 +104,7 @@ HAMT_create(/*@exits@*/ void (*error_func) for (i=0; i<32; i++) { hamt->root[i].BitMapKey = 0; - hamt->root[i].BaseValue = NULL; + hamt->root[i].BaseValue = 0; } hamt->error_func = error_func; @@ -199,7 +205,7 @@ HAMT_insert(HAMT *hamt, const char *str, void *data, int *replace, entry->str = str; entry->data = data; STAILQ_INSERT_TAIL(&hamt->entries, entry, next); - node->BaseValue = entry; + SetValue(hamt, node, entry); if (IsSubTrie(node)) hamt->error_func(__FILE__, __LINE__, N_("Data is seen as subtrie (misaligned?)")); @@ -261,10 +267,10 @@ HAMT_insert(HAMT *hamt, const char *str, void *data, int *replace, if (keypart2 < keypart) { newnodes[0] = *node; /* structure copy */ newnodes[1].BitMapKey = key; - newnodes[1].BaseValue = entry; + SetValue(hamt, &newnodes[1], entry); } else { newnodes[0].BitMapKey = key; - newnodes[0].BaseValue = entry; + SetValue(hamt, &newnodes[0], entry); newnodes[1] = *node; /* structure copy */ } @@ -315,7 +321,7 @@ HAMT_insert(HAMT *hamt, const char *str, void *data, int *replace, entry->str = str; entry->data = data; STAILQ_INSERT_TAIL(&hamt->entries, entry, next); - newnodes[Map].BaseValue = entry; + SetValue(hamt, &newnodes[Map], entry); SetSubTrie(hamt, node, newnodes); *replace = 1; diff --git a/libyasm/symrec.c b/libyasm/symrec.c index 2147a5c6..76ef09ad 100644 --- a/libyasm/symrec.c +++ b/libyasm/symrec.c @@ -104,7 +104,7 @@ symrec_destroy_one(/*@only@*/ void *d) { yasm_symrec *sym = d; yasm_xfree(sym->name); - if (sym->type == SYM_EQU) + if (sym->type == SYM_EQU && (sym->status & YASM_SYM_VALUED)) yasm_expr_destroy(sym->value.expn); yasm__assoc_data_destroy(sym->assoc_data); yasm_xfree(sym); @@ -242,6 +242,8 @@ yasm_symtab_define_equ(yasm_symtab *symtab, const char *name, yasm_expr *e, unsigned long line) { yasm_symrec *rec = symtab_define(symtab, name, SYM_EQU, 1, line); + if (yasm_error_occurred()) + return rec; rec->value.expn = e; rec->status |= YASM_SYM_VALUED; return rec; @@ -252,8 +254,9 @@ yasm_symtab_define_label(yasm_symtab *symtab, const char *name, yasm_bytecode *precbc, int in_table, unsigned long line) { - yasm_symrec *rec; - rec = symtab_define(symtab, name, SYM_LABEL, in_table, line); + yasm_symrec *rec = symtab_define(symtab, name, SYM_LABEL, in_table, line); + if (yasm_error_occurred()) + return rec; rec->value.precbc = precbc; if (in_table && precbc) yasm_bc__add_symrec(precbc, rec); @@ -264,8 +267,9 @@ yasm_symrec * yasm_symtab_define_curpos(yasm_symtab *symtab, const char *name, yasm_bytecode *precbc, unsigned long line) { - yasm_symrec *rec; - rec = symtab_define(symtab, name, SYM_CURPOS, 0, line); + yasm_symrec *rec = symtab_define(symtab, name, SYM_CURPOS, 0, line); + if (yasm_error_occurred()) + return rec; rec->value.precbc = precbc; return rec; } @@ -275,6 +279,8 @@ yasm_symtab_define_special(yasm_symtab *symtab, const char *name, yasm_sym_vis vis) { yasm_symrec *rec = symtab_define(symtab, name, SYM_SPECIAL, 1, 0); + if (yasm_error_occurred()) + return rec; rec->status |= YASM_SYM_VALUED; rec->visibility = vis; return rec; @@ -359,6 +365,7 @@ symtab_parser_finalize_checksym(yasm_symrec *sym, /*@null@*/ void *d) YASM_EXPR_ADD, yasm_expr_copy(yasm_section_get_start(sect)), sym->line); + sym->status |= YASM_SYM_VALUED; } return 0; @@ -449,7 +456,7 @@ yasm_symrec_get_line(const yasm_symrec *sym) const yasm_expr * yasm_symrec_get_equ(const yasm_symrec *sym) { - if (sym->type == SYM_EQU) + if (sym->type == SYM_EQU && (sym->status & YASM_SYM_VALUED)) return sym->value.expn; return (const yasm_expr *)NULL; } @@ -509,7 +516,10 @@ yasm_symrec_print(const yasm_symrec *sym, FILE *f, int indent_level) case SYM_EQU: fprintf(f, "%*s_EQU_\n", indent_level, ""); fprintf(f, "%*sExpn=", indent_level, ""); - yasm_expr_print(sym->value.expn, f); + if (sym->status & YASM_SYM_VALUED) + yasm_expr_print(sym->value.expn, f); + else + fprintf(f, "***UNVALUED***"); fprintf(f, "\n"); break; case SYM_LABEL: diff --git a/libyasm/tests/expr-wide-ident.hex b/libyasm/tests/expr-wide-ident.hex index f5a9ca48..f8d54ff3 100644 --- a/libyasm/tests/expr-wide-ident.hex +++ b/libyasm/tests/expr-wide-ident.hex @@ -1,5 +1,5 @@ -66 67 +66 8d 94 0a diff --git a/modules/arch/x86/tests/addrop.hex b/modules/arch/x86/tests/addrop.hex index da61c873..34e3ff70 100644 --- a/modules/arch/x86/tests/addrop.hex +++ b/modules/arch/x86/tests/addrop.hex @@ -63,8 +63,8 @@ f6 00 00 26 -66 67 +66 f7 3d 05 diff --git a/modules/arch/x86/tests/genopcode.hex b/modules/arch/x86/tests/genopcode.hex index 4814eb28..d6a562d2 100644 --- a/modules/arch/x86/tests/genopcode.hex +++ b/modules/arch/x86/tests/genopcode.hex @@ -92,13 +92,13 @@ d1 0f be 01 -66 67 +66 0f b7 18 -66 67 +66 0f b6 0b diff --git a/modules/arch/x86/tests/rep.hex b/modules/arch/x86/tests/rep.hex index 84f34767..9d95dcc6 100644 --- a/modules/arch/x86/tests/rep.hex +++ b/modules/arch/x86/tests/rep.hex @@ -1,7 +1,7 @@ f2 ad -f2 66 +f2 ad f3 aa diff --git a/modules/arch/x86/tests/sse-prefix.hex b/modules/arch/x86/tests/sse-prefix.hex index d7c78130..968c69f0 100644 --- a/modules/arch/x86/tests/sse-prefix.hex +++ b/modules/arch/x86/tests/sse-prefix.hex @@ -3,15 +3,15 @@ a5 66 26 a5 -f3 66 +f3 a5 -f3 66 +f3 64 a5 -f3 66 +f3 64 a5 a5 @@ -58,8 +58,8 @@ c2 00 66 a5 -f3 66 +f3 a5 a5 f3 diff --git a/modules/arch/x86/tests/sse4.hex b/modules/arch/x86/tests/sse4.hex index 43699ffa..2366d2fd 100644 --- a/modules/arch/x86/tests/sse4.hex +++ b/modules/arch/x86/tests/sse4.hex @@ -1,11 +1,11 @@ -66 67 +66 8b 54 24 04 -66 67 +66 8b 44 24 @@ -27,14 +27,14 @@ c1 7f 02 c3 -66 67 +66 8b 54 24 04 -66 67 +66 8b 44 24 @@ -56,14 +56,14 @@ c1 7f 02 c3 -66 67 +66 8b 54 24 04 -66 67 +66 8b 44 24 @@ -85,14 +85,14 @@ c1 7f 02 c3 -66 67 +66 8b 54 24 04 -66 67 +66 8b 44 24 @@ -118,14 +118,14 @@ f3 7f 02 c3 -66 67 +66 8b 54 24 04 -66 67 +66 8b 44 24 @@ -151,14 +151,14 @@ f3 7f 02 c3 -66 67 +66 8b 54 24 04 -66 67 +66 8b 44 24 @@ -184,14 +184,14 @@ f3 7f 02 c3 -66 67 +66 8b 54 24 04 -66 67 +66 8b 44 24 @@ -213,14 +213,14 @@ c1 7f 02 c3 -66 67 +66 8b 54 24 04 -66 67 +66 8b 44 24 @@ -242,14 +242,14 @@ c1 7f 02 c3 -66 67 +66 8b 54 24 04 -66 67 +66 8b 44 24 @@ -271,14 +271,14 @@ c1 7f 02 c3 -66 67 +66 8b 54 24 04 -66 67 +66 8b 44 24 @@ -304,14 +304,14 @@ f3 7f 02 c3 -66 67 +66 8b 54 24 04 -66 67 +66 8b 44 24 @@ -337,14 +337,14 @@ f3 7f 02 c3 -66 67 +66 8b 54 24 04 -66 67 +66 8b 44 24 @@ -370,14 +370,14 @@ f3 7f 02 c3 -66 67 +66 8b 54 24 04 -66 67 +66 8b 44 24 @@ -399,14 +399,14 @@ c1 7f 02 c3 -66 67 +66 8b 54 24 04 -66 67 +66 8b 44 24 @@ -428,14 +428,14 @@ c1 7f 02 c3 -66 67 +66 8b 54 24 04 -66 67 +66 8b 44 24 @@ -457,14 +457,14 @@ c1 7f 02 c3 -66 67 +66 8b 54 24 04 -66 67 +66 8b 44 24 @@ -490,14 +490,14 @@ f3 7f 02 c3 -66 67 +66 8b 54 24 04 -66 67 +66 8b 44 24 @@ -523,14 +523,14 @@ f3 7f 02 c3 -66 67 +66 8b 54 24 04 -66 67 +66 8b 44 24 @@ -556,14 +556,14 @@ f3 7f 02 c3 -66 67 +66 8b 54 24 04 -66 67 +66 8b 44 24 @@ -585,14 +585,14 @@ c1 7f 02 c3 -66 67 +66 8b 54 24 04 -66 67 +66 8b 44 24 @@ -614,14 +614,14 @@ c1 7f 02 c3 -66 67 +66 8b 54 24 04 -66 67 +66 8b 44 24 @@ -643,14 +643,14 @@ c1 7f 02 c3 -66 67 +66 8b 54 24 04 -66 67 +66 8b 44 24 @@ -676,14 +676,14 @@ f3 7f 02 c3 -66 67 +66 8b 54 24 04 -66 67 +66 8b 44 24 @@ -709,14 +709,14 @@ f3 7f 02 c3 -66 67 +66 8b 54 24 04 -66 67 +66 8b 44 24 @@ -742,14 +742,14 @@ f3 7f 02 c3 -66 67 +66 8b 54 24 04 -66 67 +66 8b 44 24 @@ -771,14 +771,14 @@ c1 7f 02 c3 -66 67 +66 8b 54 24 04 -66 67 +66 8b 44 24 @@ -804,14 +804,14 @@ f3 7f 02 c3 -66 67 +66 8b 54 24 04 -66 67 +66 8b 44 24 @@ -833,14 +833,14 @@ c1 7f 02 c3 -66 67 +66 8b 54 24 04 -66 67 +66 8b 44 24 @@ -866,14 +866,14 @@ f3 7f 02 c3 -66 67 +66 8b 54 24 04 -66 67 +66 8b 44 24 @@ -895,14 +895,14 @@ c1 7f 02 c3 -66 67 +66 8b 54 24 04 -66 67 +66 8b 44 24 @@ -928,14 +928,14 @@ f3 7f 02 c3 -66 67 +66 8b 54 24 04 -66 67 +66 8b 44 24 @@ -958,14 +958,14 @@ c1 7f 02 c3 -66 67 +66 8b 54 24 04 -66 67 +66 8b 44 24 diff --git a/modules/arch/x86/x86bc.c b/modules/arch/x86/x86bc.c index a4326d32..88fa21c9 100644 --- a/modules/arch/x86/x86bc.c +++ b/modules/arch/x86/x86bc.c @@ -761,16 +761,16 @@ static void x86_common_tobytes(const x86_common *common, unsigned char **bufp, unsigned int segreg) { - if (common->lockrep_pre != 0) - YASM_WRITE_8(*bufp, common->lockrep_pre); if (segreg != 0) YASM_WRITE_8(*bufp, (unsigned char)segreg); + if (common->addrsize != 0 && common->addrsize != common->mode_bits) + YASM_WRITE_8(*bufp, 0x67); if (common->opersize != 0 && ((common->mode_bits != 64 && common->opersize != common->mode_bits) || (common->mode_bits == 64 && common->opersize == 16))) YASM_WRITE_8(*bufp, 0x66); - if (common->addrsize != 0 && common->addrsize != common->mode_bits) - YASM_WRITE_8(*bufp, 0x67); + if (common->lockrep_pre != 0) + YASM_WRITE_8(*bufp, common->lockrep_pre); } static void diff --git a/modules/objfmts/elf/elf-objfmt.c b/modules/objfmts/elf/elf-objfmt.c index c0ae8416..d239f057 100644 --- a/modules/objfmts/elf/elf-objfmt.c +++ b/modules/objfmts/elf/elf-objfmt.c @@ -1118,7 +1118,7 @@ dir_type(yasm_objfmt_elf *objfmt_elf, yasm_valparam *vp, unsigned long line) /* Pull new type from val */ vp = yasm_vps_next(vp); - if (vp->val) { + if (vp && vp->val) { if (yasm__strcasecmp(vp->val, "function") == 0) elf_sym_set_type(entry, STT_FUNC); else if (yasm__strcasecmp(vp->val, "object") == 0) @@ -1147,10 +1147,10 @@ dir_size(yasm_objfmt_elf *objfmt_elf, yasm_valparam *vp, unsigned long line) /* Pull new size from either param (expr) or val */ vp = yasm_vps_next(vp); - if (vp->param) { + if (vp && vp->param) { elf_sym_set_size(entry, vp->param); vp->param = NULL; - } else if (vp->val) + } else if (vp && vp->val) elf_sym_set_size(entry, yasm_expr_create_ident(yasm_expr_sym( yasm_symtab_use(objfmt_elf->symtab, vp->val, line)), line)); else diff --git a/modules/objfmts/macho/macho-objfmt.c b/modules/objfmts/macho/macho-objfmt.c index b0c79bc3..68db6adb 100644 --- a/modules/objfmts/macho/macho-objfmt.c +++ b/modules/objfmts/macho/macho-objfmt.c @@ -761,8 +761,12 @@ macho_objfmt_output_secthead(yasm_section *sect, /*@null@*/ void *d) localbuf = info->buf; - fwrite(msd->sectname, 16, 1, info->f); - fwrite(msd->segname, 16, 1, info->f); + memset(localbuf, 0, 16); + strncpy((char *)localbuf, msd->sectname, 16); + localbuf += 16; + memset(localbuf, 0, 16); + strncpy((char *)localbuf, msd->segname, 16); + localbuf += 16; /* section address, size depend on 32/64 bit mode */ YASM_WRITE_32_L(localbuf, msd->vmoff); /* address in memory */ if (info->is_64) @@ -800,9 +804,9 @@ macho_objfmt_output_secthead(yasm_section *sect, /*@null@*/ void *d) YASM_WRITE_32_L(localbuf, 0); /* reserved 2 */ if (info->is_64) - fwrite(info->buf, MACHO_SECTCMD64_SIZE - 32, 1, info->f); /* 2*16 byte strings already written */ + fwrite(info->buf, MACHO_SECTCMD64_SIZE, 1, info->f); else - fwrite(info->buf, MACHO_SECTCMD_SIZE - 32, 1, info->f); /* 2*16 byte strings already written */ + fwrite(info->buf, MACHO_SECTCMD_SIZE, 1, info->f); return 0; } diff --git a/modules/objfmts/macho/tests/gas32/gas-macho32.hex b/modules/objfmts/macho/tests/gas32/gas-macho32.hex index 5ab90a5a..72cdabde 100644 --- a/modules/objfmts/macho/tests/gas32/gas-macho32.hex +++ b/modules/objfmts/macho/tests/gas32/gas-macho32.hex @@ -89,15 +89,15 @@ fe 78 74 00 -2e -63 -6f -6e -73 -74 00 -5f -5f +00 +00 +00 +00 +00 +00 +00 +00 5f 5f 54 @@ -105,15 +105,15 @@ fe 58 54 00 -5f -5f -74 -65 -78 -74 00 -2e -63 +00 +00 +00 +00 +00 +00 +00 +00 00 00 00 @@ -157,15 +157,15 @@ bc 74 61 00 -2e -73 -74 -61 -74 -69 -63 -5f -64 +00 +00 +00 +00 +00 +00 +00 +00 +00 5f 5f 44 @@ -173,15 +173,15 @@ bc 54 41 00 -5f -5f -6d -6f -64 -5f -69 -6e -69 +00 +00 +00 +00 +00 +00 +00 +00 +00 41 00 00 @@ -224,16 +224,16 @@ f4 73 73 00 -2e -6f -62 -6a -63 -5f -63 -6c -61 -73 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 5f 5f 44 @@ -241,15 +241,15 @@ f4 54 41 00 -5f -5f -6d -6f -64 -5f -69 -6e -69 +00 +00 +00 +00 +00 +00 +00 +00 +00 81 00 00 diff --git a/modules/objfmts/macho/tests/gas64/gas-macho64.hex b/modules/objfmts/macho/tests/gas64/gas-macho64.hex index 09f1e8db..e4fa4882 100644 --- a/modules/objfmts/macho/tests/gas64/gas-macho64.hex +++ b/modules/objfmts/macho/tests/gas64/gas-macho64.hex @@ -109,15 +109,15 @@ c5 78 74 00 -2e -63 -6f -6e -73 -74 00 -5f -5f +00 +00 +00 +00 +00 +00 +00 +00 5f 5f 54 @@ -125,15 +125,15 @@ c5 58 54 00 -5f -5f -74 -65 -78 -74 00 -2e -63 +00 +00 +00 +00 +00 +00 +00 +00 00 00 00 @@ -189,15 +189,15 @@ e8 74 61 00 -2e -73 -74 -61 -74 -69 -63 -5f -64 +00 +00 +00 +00 +00 +00 +00 +00 +00 5f 5f 44 @@ -205,15 +205,15 @@ e8 54 41 00 -5f -5f -6d -6f -64 -5f -69 -6e -69 +00 +00 +00 +00 +00 +00 +00 +00 +00 5d 00 00 diff --git a/modules/objfmts/macho/tests/nasm32/macho-reloc.hex b/modules/objfmts/macho/tests/nasm32/macho-reloc.hex index 65406c5d..7ef6e8a1 100644 --- a/modules/objfmts/macho/tests/nasm32/macho-reloc.hex +++ b/modules/objfmts/macho/tests/nasm32/macho-reloc.hex @@ -89,15 +89,15 @@ f4 78 74 00 -2e -63 -6f -6e -73 -74 00 -5f -5f +00 +00 +00 +00 +00 +00 +00 +00 5f 5f 54 @@ -105,15 +105,15 @@ f4 58 54 00 -5f -5f -74 -65 -78 -74 00 -2e -63 +00 +00 +00 +00 +00 +00 +00 +00 00 00 00 @@ -157,15 +157,15 @@ f4 74 61 00 -2e -73 -74 -61 -74 -69 -63 -5f -64 +00 +00 +00 +00 +00 +00 +00 +00 +00 5f 5f 44 @@ -173,15 +173,15 @@ f4 54 41 00 -5f -5f -6d -6f -64 -5f -69 -6e -69 +00 +00 +00 +00 +00 +00 +00 +00 +00 28 00 00 diff --git a/modules/objfmts/macho/tests/nasm32/machotest.hex b/modules/objfmts/macho/tests/nasm32/machotest.hex index d1e36c5b..e6791e4e 100644 --- a/modules/objfmts/macho/tests/nasm32/machotest.hex +++ b/modules/objfmts/macho/tests/nasm32/machotest.hex @@ -89,15 +89,15 @@ fe 78 74 00 -2e -63 -6f -6e -73 -74 00 -5f -5f +00 +00 +00 +00 +00 +00 +00 +00 5f 5f 54 @@ -105,15 +105,15 @@ fe 58 54 00 -5f -5f -74 -65 -78 -74 00 -2e -63 +00 +00 +00 +00 +00 +00 +00 +00 00 00 00 @@ -157,15 +157,15 @@ c0 74 61 00 -2e -73 -74 -61 -74 -69 -63 -5f -64 +00 +00 +00 +00 +00 +00 +00 +00 +00 5f 5f 44 @@ -173,15 +173,15 @@ c0 54 41 00 -5f -5f -6d -6f -64 -5f -69 -6e -69 +00 +00 +00 +00 +00 +00 +00 +00 +00 47 00 00 @@ -224,16 +224,16 @@ f8 73 73 00 -2e -6f -62 -6a -63 -5f -63 -6c -61 -73 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 5f 5f 44 @@ -241,15 +241,15 @@ f8 54 41 00 -5f -5f -6d -6f -64 -5f -69 -6e -69 +00 +00 +00 +00 +00 +00 +00 +00 +00 87 00 00 diff --git a/modules/objfmts/macho/tests/nasm64/machotest64.hex b/modules/objfmts/macho/tests/nasm64/machotest64.hex index 46ecbc58..21395186 100644 --- a/modules/objfmts/macho/tests/nasm64/machotest64.hex +++ b/modules/objfmts/macho/tests/nasm64/machotest64.hex @@ -109,15 +109,15 @@ c6 78 74 00 -2e -63 -6f -6e -73 -74 00 -5f -5f +00 +00 +00 +00 +00 +00 +00 +00 5f 5f 54 @@ -125,15 +125,15 @@ c6 58 54 00 -5f -5f -74 -65 -78 -74 00 -2e -63 +00 +00 +00 +00 +00 +00 +00 +00 00 00 00 @@ -189,15 +189,15 @@ c6 74 61 00 -2e -73 -74 -61 -74 -69 -63 -5f -64 +00 +00 +00 +00 +00 +00 +00 +00 +00 5f 5f 44 @@ -205,15 +205,15 @@ c6 54 41 00 -5f -5f -6d -6f -64 -5f -69 -6e -69 +00 +00 +00 +00 +00 +00 +00 +00 +00 7a 00 00 @@ -268,16 +268,16 @@ ea 73 73 00 -2e -6f -62 -6a -63 -5f -63 -6c -61 -73 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 5f 5f 44 @@ -285,15 +285,15 @@ ea 54 41 00 -5f -5f -6d -6f -64 -5f -69 -6e -69 +00 +00 +00 +00 +00 +00 +00 +00 +00 c6 00 00 diff --git a/modules/parsers/gas/gas-parse.c b/modules/parsers/gas/gas-parse.c index 2f0cbb07..a119938c 100644 --- a/modules/parsers/gas/gas-parse.c +++ b/modules/parsers/gas/gas-parse.c @@ -1001,7 +1001,7 @@ parse_memaddr(yasm_parser_gas *parser_gas) if (curtok == '(') { int havereg = 0; - uintptr_t reg; + uintptr_t reg = 0; yasm_intnum *scale = NULL; get_next_token(); /* '(' */ diff --git a/modules/parsers/gas/gas-token.re b/modules/parsers/gas/gas-token.re index 4f4e2184..eca535bd 100644 --- a/modules/parsers/gas/gas-token.re +++ b/modules/parsers/gas/gas-token.re @@ -214,10 +214,6 @@ static size_t strbuf_size = 0; static void strbuf_append(size_t count, YYCTYPE *cursor, yasm_scanner *s, int ch) { - if (cursor == s->eof) - yasm_error_set(YASM_ERROR_SYNTAX, - N_("unexpected end of file in string")); - if (count >= strbuf_size) { strbuf = yasm_xrealloc(strbuf, strbuf_size + STRBUF_ALLOC_SIZE); strbuf_size += STRBUF_ALLOC_SIZE; @@ -677,6 +673,13 @@ stringconst_scan: /*!re2c /* Handle escaped double-quote by copying and continuing */ "\\\"" { + if (cursor == s->eof) { + yasm_error_set(YASM_ERROR_SYNTAX, + N_("unexpected end of file in string")); + lvalp->str.contents = (char *)strbuf; + lvalp->str.len = count; + RETURN(STRING); + } strbuf_append(count++, cursor, s, '"'); goto stringconst_scan; } @@ -690,6 +693,13 @@ stringconst_scan: } any { + if (cursor == s->eof) { + yasm_error_set(YASM_ERROR_SYNTAX, + N_("unexpected end of file in string")); + lvalp->str.contents = (char *)strbuf; + lvalp->str.len = count; + RETURN(STRING); + } strbuf_append(count++, cursor, s, s->tok[0]); goto stringconst_scan; } diff --git a/modules/parsers/nasm/nasm-parse.c b/modules/parsers/nasm/nasm-parse.c index 0f6fba44..c2687e91 100644 --- a/modules/parsers/nasm/nasm-parse.c +++ b/modules/parsers/nasm/nasm-parse.c @@ -680,8 +680,25 @@ parse_operand(yasm_parser_nasm *parser_nasm) yasm_arch_get_reg_size(parser_nasm->arch, op->data.reg) != size) yasm_error_set(YASM_ERROR_TYPE, N_("cannot override register size")); - else + else { + /* Silently override others unless a warning is turned on. + * This is to allow overrides such as: + * %define arg1 dword [bp+4] + * cmp word arg1, 2 + * Which expands to: + * cmp word dword [bp+4], 2 + */ + if (op->size != 0) { + if (op->size != size) + yasm_warn_set(YASM_WARN_SIZE_OVERRIDE, + N_("overriding operand size from %u-bit to %u-bit"), + op->size, size); + else + yasm_warn_set(YASM_WARN_SIZE_OVERRIDE, + N_("double operand size override")); + } op->size = size; + } return op; } case TARGETMOD: diff --git a/modules/parsers/nasm/tests/long.hex b/modules/parsers/nasm/tests/long.hex index 2ae8e5bb..72e9cc5d 100644 --- a/modules/parsers/nasm/tests/long.hex +++ b/modules/parsers/nasm/tests/long.hex @@ -1,5 +1,5 @@ -66 67 +66 c7 00 00 From ca9d8b3277505f87e68b1bf3605647296824953f Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 1 May 2007 05:28:25 +0000 Subject: [PATCH 007/585] Merge [1823] from trunk: Add end_prolog macro. svn path=/branches/yasm-0.6.x/; revision=1832 --- modules/preprocs/nasm/standard.mac | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/preprocs/nasm/standard.mac b/modules/preprocs/nasm/standard.mac index e88ddef9..6d285d9e 100644 --- a/modules/preprocs/nasm/standard.mac +++ b/modules/preprocs/nasm/standard.mac @@ -239,6 +239,10 @@ lea %1, [rsp+%2] [setframe %1 %2] %endmacro +%imacro end_prolog 0.nolist +[endprolog] +%endmacro + %imacro end_prologue 0.nolist [endprolog] %endmacro From dd9645f1c0ea39bc1d2b17fb74f0e7881dc4f154 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 1 May 2007 05:35:04 +0000 Subject: [PATCH 008/585] Merge [1822] from trunk: Fix obsolete comment about -m amd64 not setting BITS=64. svn path=/branches/yasm-0.6.x/; revision=1834 --- frontends/yasm/yasm.xml | 8 ++- yasm.1 | 112 +++++++++++++++++++++++++++------------- 2 files changed, 78 insertions(+), 42 deletions(-) diff --git a/frontends/yasm/yasm.xml b/frontends/yasm/yasm.xml index 8bdd1331..11a5fb29 100644 --- a/frontends/yasm/yasm.xml +++ b/frontends/yasm/yasm.xml @@ -8,7 +8,7 @@ The Yasm Modular Assembler - October 2006 + April 2007 Yasm Peter @@ -22,6 +22,7 @@ 2004 2005 2006 + 2007 Peter Johnson @@ -548,9 +549,6 @@ easy to generate AMD64 code (using the BITS 64 directive) and generate a 32-bit object file (by failing to specify or selecting a 64-bit - object format such as ELF64 on the command line). Similarly, - specifying does not default the BITS - setting to 64. An easy way to avoid this is by directly specifying - a 64-bit object format such as . + object format such as ELF64 on the command line). diff --git a/yasm.1 b/yasm.1 index a70a3a8e..71db01e0 100644 --- a/yasm.1 +++ b/yasm.1 @@ -1,11 +1,11 @@ .\" Title: yasm .\" Author: Peter Johnson -.\" Generator: DocBook XSL Stylesheets v1.70.1 -.\" Date: October 2006 +.\" Generator: DocBook XSL Stylesheets v1.71.1 +.\" Date: April 2007 .\" Manual: The Yasm Modular Assembler .\" Source: Yasm .\" -.TH "YASM" "1" "October 2006" "Yasm" "The Yasm Modular Assembler" +.TH "YASM" "1" "April 2007" "Yasm" "The Yasm Modular Assembler" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) @@ -58,8 +58,9 @@ is specified. .PP Many options may be given in one of two forms: either a dash followed by a single letter, or two dashes followed by a long option name. Options are listed in alphabetical order. .SS "General Options" -.TP 3n +.PP \fB\-a \fR\fB\fIarch\fR\fR or \fB\-\-arch=\fR\fB\fIarch\fR\fR: Select target architecture +.RS 4 Selects the target architecture. The default architecture is \(lqx86\(rq, which supports both the IA\-32 and derivatives and AMD64 instruction sets. To print a list of available architectures to standard output, use \(lqhelp\(rq @@ -67,8 +68,10 @@ as \fIarch\fR. See \fByasm_arch\fR(7) for a list of supported architectures. -.TP 3n +.RE +.PP \fB\-f \fR\fB\fIformat\fR\fR or \fB\-\-oformat=\fR\fB\fIformat\fR\fR: Select object format +.RS 4 Selects the output object format. The default object format is \(lqbin\(rq, which is a flat format binary with no relocation. To print a list of available object formats to standard output, use \(lqhelp\(rq @@ -76,8 +79,10 @@ as \fIformat\fR. See \fByasm_objfmts\fR(7) for a list of supported object formats. -.TP 3n +.RE +.PP \fB\-g \fR\fB\fIdebug\fR\fR or \fB\-\-dformat=\fR\fB\fIdebug\fR\fR: Select debugging format +.RS 4 Selects the debugging format for debug information. Debugging information can be used by a debugger to associate executable code back to the source file or get data structure and type information. Available debug formats vary between different object formats; \fByasm\fR will error when an invalid combination is selected. The default object format is selected by the object format. To print a list of available debugging formats to standard output, use @@ -86,21 +91,29 @@ as \fIdebug\fR. See \fByasm_dbgfmts\fR(7) for a list of supported debugging formats. -.TP 3n +.RE +.PP \fB\-h\fR or \fB\-\-help\fR: Print a summary of options +.RS 4 Prints a summary of invocation options. All other options are ignored, and no output file is generated. -.TP 3n +.RE +.PP \fB\-L \fR\fB\fIlist\fR\fR or \fB\-\-lformat=\fR\fB\fIlist\fR\fR: Select list file format +.RS 4 Selects the format/style of the output list file. List files typically intermix the original source with the machine code generated by the assembler. The default list format is \(lqnasm\(rq, which mimics the NASM list file format. To print a list of available list file formats to standard output, use \(lqhelp\(rq as \fIlist\fR. -.TP 3n +.RE +.PP \fB\-l \fR\fB\fIlistfile\fR\fR or \fB\-\-list=\fR\fB\fIlistfile\fR\fR: Specify list filename +.RS 4 Specifies the name of the output list file. If this option is not used, no list file is generated. -.TP 3n +.RE +.PP \fB\-m \fR\fB\fImachine\fR\fR or \fB\-\-machine=\fR\fB\fImachine\fR\fR: Select target machine architecture +.RS 4 Selects the target machine architecture. Essentially a subtype of the selected architecture, the machine type selects between major subsets of an architecture. For example, for the \(lqx86\(rq architecture, the two available machines are @@ -113,11 +126,15 @@ and the given architecture using \fB\-a \fR\fB\fIarch\fR\fR. See \fByasm_arch\fR(7) for more details. -.TP 3n +.RE +.PP \fB\-o \fR\fB\fIfilename\fR\fR or \fB\-\-objfile=\fR\fB\fIfilename\fR\fR: Specify object filename +.RS 4 Specifies the name of the output file, overriding any default name generated by Yasm. -.TP 3n +.RE +.PP \fB\-p \fR\fB\fIparser\fR\fR or \fB\-\-parser=\fR\fB\fIparser\fR\fR: Select parser +.RS 4 Selects the parser (the assembler syntax). The default parser is \(lqnasm\(rq, which emulates the syntax of NASM, the Netwide Assembler. Another available parser is \(lqgas\(rq, which emulates the syntax of GNU AS. To print a list of available parsers to standard output, use @@ -126,8 +143,10 @@ as \fIparser\fR. See \fByasm_parsers\fR(7) for a list of supported parsers. -.TP 3n +.RE +.PP \fB\-r \fR\fB\fIpreproc\fR\fR or \fB\-\-preproc=\fR\fB\fIpreproc\fR\fR: Select preprocessor +.RS 4 Selects the preprocessor to use on the input file before passing it to the parser. Preprocessors often provide macro functionality that is not included in the main parser. The default preprocessor is \(lqnasm\(rq, which is an imported version of the actual NASM preprocessor. A \(lqraw\(rq @@ -135,10 +154,12 @@ preprocessor is also available, which simply skips the preprocessing step, passi \(lqhelp\(rq as \fIpreproc\fR. -.TP 3n +.RE +.PP \fB\-\-version\fR: Get the Yasm version +.RS 4 This option causes Yasm to prints the version number of Yasm as well as a license summary to standard output. All other options are ignored, and no output file is generated. -.\" end of SS subsection "General Options" +.RE .SS "Warning Options" .PP \fB\-W\fR @@ -153,21 +174,30 @@ is followed by \fB\-Worphan\-labels\fR, all warnings are turned off \fIexcept\fR for orphan\-labels. -.TP 3n +.PP \fB\-w\fR: Inhibit all warning messages +.RS 4 This option causes Yasm to inhibit all warning messages. As discussed above, this option may be followed by other options to re\-enable specified warnings. -.TP 3n +.RE +.PP \fB\-Werror\fR: Treat warnings as errors +.RS 4 This option causes Yasm to treat all warnings as errors. Normally warnings do not prevent an object file from being generated and do not result in a failure exit status from \fByasm\fR, whereas errors do. This option makes warnings equivalent to errors in terms of this behavior. -.TP 3n +.RE +.PP \fB\-Wno\-unrecognized\-char\fR: Do not warn on unrecognized input characters +.RS 4 Causes Yasm to not warn on unrecognized characters found in the input. Normally Yasm will generate a warning for any non\-ASCII character found in the input file. -.TP 3n +.RE +.PP \fB\-Worphan\-labels\fR: Warn on labels lacking a trailing option +.RS 4 When using the NASM\-compatible parser, causes Yasm to warn about labels found alone on a line without a trailing colon. While these are legal labels in NASM syntax, they may be unintentional, due to typos or macro definition ordering. -.TP 3n +.RE +.PP \fB\-X \fR\fB\fIstyle\fR\fR: Change error/warning reporting style +.RS 4 Selects a specific output style for error and warning messages. The default is \(lqgnu\(rq style, which mimics the output of @@ -179,36 +209,45 @@ This option is available so that Yasm integrates more naturally into IDE environ Visual Studio or Emacs, allowing the IDE to correctly recognize the error/warning message as such and link back to the offending line of source code. -.\" end of SS subsection "Warning Options" +.RE .SS "Preprocessor Options" .PP While these preprocessor options theoretically will affect any preprocessor, the only preprocessor currently in Yasm is the \(lqnasm\(rq preprocessor. -.TP 3n +.PP \fB\-D \fR\fB\fImacro[=value]\fR\fR: Pre\-define a macro +.RS 4 Pre\-defines a single\-line macro. The value is optional (if no value is given, the macro is still defined, but to an empty value). -.TP 3n +.RE +.PP \fB\-e\fR or \fB\-\-preproc\-only\fR: Only preprocess +.RS 4 Stops assembly after the preprocessing stage; preprocessed output is sent to the specified output name or, if no output name is specified, the standard output. No object file is produced. -.TP 3n +.RE +.PP \fB\-I \fR\fB\fIpath\fR\fR: Add include file path +.RS 4 Adds directory \fIpath\fR to the search path for include files. The search path defaults to only including the directory in which the source file resides. -.TP 3n +.RE +.PP \fB\-P \fR\fB\fIfilename\fR\fR: Pre\-include a file +.RS 4 Pre\-includes file \fIfilename\fR, making it look as though \fIfilename\fR was prepended to the input. Can be useful for prepending multi\-line macros that the \fB\-D\fR can't support. -.TP 3n +.RE +.PP \fB\-U \fR\fB\fImacro\fR\fR: Undefine a macro +.RS 4 Undefines a single\-line macro (may be either a built\-in macro or one defined earlier in the command line with \fB\-D\fR. -.\" end of SS subsection "Preprocessor Options" +.RE .SH "EXAMPLES" .PP To assemble NASM syntax, 32\-bit x86 source @@ -216,7 +255,7 @@ To assemble NASM syntax, 32\-bit x86 source into ELF file \fIsource.o\fR, warning on orphan labels: .sp -.RS 3n +.RS 4 .nf yasm \-f elf32 \-Worphan\-labels source.asm .fi @@ -227,7 +266,7 @@ To assemble NASM syntax AMD64 source into Win64 file \fIobject.obj\fR: .sp -.RS 3n +.RS 4 .nf yasm \-f win64 \-o object.obj x.asm .fi @@ -238,7 +277,7 @@ To assemble already preprocessed NASM syntax x86 source into flat binary file \fIy.com\fR: .sp -.RS 3n +.RS 4 .nf yasm \-f bin \-r raw \-o y.com y.asm .fi @@ -277,15 +316,14 @@ architecture, it is overly easy to generate AMD64 code (using the \fBBITS 64\fR directive) and generate a 32\-bit object file (by failing to specify \fB\-m amd64\fR -or selecting a 64\-bit object format such as ELF64 on the command line). Similarly, specifying -\fB\-m amd64\fR -does not default the BITS setting to 64. An easy way to avoid this is by directly specifying a 64\-bit object format such as -\fB\-f elf64\fR. +or selecting a 64\-bit object format such as ELF64 on the command line). .SH "AUTHOR" .PP -\fBPeter\fR \fBJohnson\fR +\fBPeter Johnson\fR <\&peter@tortall.net\&> .sp -1n -.IP "" 3n +.IP "" 4 Author. .SH "COPYRIGHT" -Copyright \(co 2004, 2005, 2006 Peter Johnson +Copyright \(co 2004, 2005, 2006, 2007 Peter Johnson +.br + From 3ad2bebb4b31b74b7aa1c5b36806b8ae6497f0b1 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 11 May 2007 02:41:13 +0000 Subject: [PATCH 009/585] Merge [1836] from trunk (fix floating point edge case). svn path=/branches/yasm-0.6.x/; revision=1838 --- libyasm/floatnum.c | 7 +++++-- libyasm/tests/floatnum_test.c | 16 +++++++++++++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/libyasm/floatnum.c b/libyasm/floatnum.c index 09dddc27..0436b612 100644 --- a/libyasm/floatnum.c +++ b/libyasm/floatnum.c @@ -482,8 +482,11 @@ yasm_floatnum_create(const char *str) } } - /* Round the result. (Don't round underflow or overflow). */ - if ((flt->exponent != EXP_INF) && (flt->exponent != EXP_ZERO)) + /* Round the result. (Don't round underflow or overflow). Also don't + * increment if this would cause the mantissa to wrap. + */ + if ((flt->exponent != EXP_INF) && (flt->exponent != EXP_ZERO) && + !BitVector_is_full(flt->mantissa)) BitVector_increment(flt->mantissa); return flt; diff --git a/libyasm/tests/floatnum_test.c b/libyasm/tests/floatnum_test.c index a7bdb698..a08ee9d6 100644 --- a/libyasm/tests/floatnum_test.c +++ b/libyasm/tests/floatnum_test.c @@ -95,6 +95,19 @@ static Init_Entry normalized_vals[] = { 0, {0x00,0x00,0x00,0x00,0x00,0xf4,0xb6,0xc0}, 0, {0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0xb7,0x0b,0xc0} }, + /* Edge cases for rounding wrap. */ + { "1.00000", + {0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff},0x7ffe,0,0, + 0, {0x00,0x00,0x80,0x3f}, + 0, {0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x3f}, + 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0x3f} + }, + { "1.000000", + {0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff},0x7ffe,0,0, + 0, {0x00,0x00,0x80,0x3f}, + 0, {0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x3f}, + 0, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0x3f} + }, }; /* Still normalized values, but edge cases of various sizes, testing underflow/ @@ -417,7 +430,8 @@ runtest_(const char *testname, int (*testfunc)(void), void (*setup)(void), printf("%c", nf>0 ? 'F':'.'); fflush(stdout); if (nf > 0) - sprintf(failed, "%s ** F: %s failed!\n", failed, testname); + sprintf(failed, "%s ** F: %s failed: %s!\n", failed, testname, + result_msg); return nf; } #define runtest(x,y,z) runtest_(#x,test_##x,y,z) From 34e5aa0db5b2f2719bf5cc92143573a9e2fc27e4 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 19 May 2007 16:47:02 +0000 Subject: [PATCH 010/585] Merge [1839] from trunk: Clean up expect_() in both parsers. svn path=/branches/yasm-0.6.x/; revision=1844 --- modules/parsers/gas/gas-parse.c | 34 ++++++++-------- modules/parsers/nasm/nasm-parse.c | 64 +++++++++++++++---------------- 2 files changed, 49 insertions(+), 49 deletions(-) diff --git a/modules/parsers/gas/gas-parse.c b/modules/parsers/gas/gas-parse.c index a119938c..02774fd1 100644 --- a/modules/parsers/gas/gas-parse.c +++ b/modules/parsers/gas/gas-parse.c @@ -143,26 +143,26 @@ demand_eol_(yasm_parser_gas *parser_gas) static int expect_(yasm_parser_gas *parser_gas, int token) { - static char strch[] = "expected ` '"; + static char strch[] = "` '"; const char *str; if (curtok == token) return 1; switch (token) { - case INTNUM: str = "expected integer"; break; - case FLTNUM: str = "expected floating point value"; break; - case STRING: str = "expected string"; break; - case INSN: str = "expected instruction"; break; - case PREFIX: str = "expected instruction prefix"; break; - case REG: str = "expected register"; break; - case REGGROUP: str = "expected register group"; break; - case SEGREG: str = "expected segment register"; break; - case TARGETMOD: str = "expected target modifier"; break; - case LEFT_OP: str = "expected <<"; break; - case RIGHT_OP: str = "expected >>"; break; - case ID: str = "expected identifier"; break; - case LABEL: str = "expected label"; break; + case INTNUM: str = "integer"; break; + case FLTNUM: str = "floating point value"; break; + case STRING: str = "string"; break; + case INSN: str = "instruction"; break; + case PREFIX: str = "instruction prefix"; break; + case REG: str = "register"; break; + case REGGROUP: str = "register group"; break; + case SEGREG: str = "segment register"; break; + case TARGETMOD: str = "target modifier"; break; + case LEFT_OP: str = "<<"; break; + case RIGHT_OP: str = ">>"; break; + case ID: str = "identifier"; break; + case LABEL: str = "label"; break; case LINE: case DIR_ALIGN: case DIR_ASCII: @@ -189,14 +189,14 @@ expect_(yasm_parser_gas *parser_gas, int token) case DIR_TYPE: case DIR_WEAK: case DIR_ZERO: - str = "expected directive"; + str = "directive"; break; default: - strch[10] = token; + strch[1] = token; str = strch; break; } - yasm_error_set(YASM_ERROR_PARSE, str); + yasm_error_set(YASM_ERROR_PARSE, "expected %s", str); destroy_curtok(); return 0; } diff --git a/modules/parsers/nasm/nasm-parse.c b/modules/parsers/nasm/nasm-parse.c index c2687e91..9c2bc9bf 100644 --- a/modules/parsers/nasm/nasm-parse.c +++ b/modules/parsers/nasm/nasm-parse.c @@ -139,48 +139,48 @@ demand_eol_(yasm_parser_nasm *parser_nasm) static int expect_(yasm_parser_nasm *parser_nasm, int token) { - static char strch[] = "expected ` '"; + static char strch[] = "` '"; const char *str; if (curtok == token) return 1; switch (token) { - case INTNUM: str = "expected integer"; break; - case FLTNUM: str = "expected floating point value"; break; - case DIRECTIVE_NAME: str = "expected directive name"; break; - case FILENAME: str = "expected filename"; break; - case STRING: str = "expected string"; break; - case SIZE_OVERRIDE: str = "expected size override"; break; - case DECLARE_DATA: str = "expected DB/DW/etc."; break; - case RESERVE_SPACE: str = "expected RESB/RESW/etc."; break; - case INCBIN: str = "expected INCBIN"; break; - case EQU: str = "expected EQU"; break; - case TIMES: str = "expected TIMES"; break; - case SEG: str = "expected SEG"; break; - case WRT: str = "expected WRT"; break; - case NOSPLIT: str = "expected NOSPLIT"; break; - case STRICT: str = "expected STRICT"; break; - case INSN: str = "expected instruction"; break; - case PREFIX: str = "expected instruction prefix"; break; - case REG: str = "expected register"; break; - case SEGREG: str = "expected segment register"; break; - case TARGETMOD: str = "expected target modifier"; break; - case LEFT_OP: str = "expected <<"; break; - case RIGHT_OP: str = "expected >>"; break; - case SIGNDIV: str = "expected //"; break; - case SIGNMOD: str = "expected %%"; break; - case START_SECTION_ID: str = "expected $$"; break; - case ID: str = "expected identifier"; break; - case LOCAL_ID: str = "expected .identifier"; break; - case SPECIAL_ID: str = "expected ..identifier"; break; - case LINE: str = "expected %line"; break; + case INTNUM: str = "integer"; break; + case FLTNUM: str = "floating point value"; break; + case DIRECTIVE_NAME: str = "directive name"; break; + case FILENAME: str = "filename"; break; + case STRING: str = "string"; break; + case SIZE_OVERRIDE: str = "size override"; break; + case DECLARE_DATA: str = "DB/DW/etc."; break; + case RESERVE_SPACE: str = "RESB/RESW/etc."; break; + case INCBIN: str = "INCBIN"; break; + case EQU: str = "EQU"; break; + case TIMES: str = "TIMES"; break; + case SEG: str = "SEG"; break; + case WRT: str = "WRT"; break; + case NOSPLIT: str = "NOSPLIT"; break; + case STRICT: str = "STRICT"; break; + case INSN: str = "instruction"; break; + case PREFIX: str = "instruction prefix"; break; + case REG: str = "register"; break; + case SEGREG: str = "segment register"; break; + case TARGETMOD: str = "target modifier"; break; + case LEFT_OP: str = "<<"; break; + case RIGHT_OP: str = ">>"; break; + case SIGNDIV: str = "//"; break; + case SIGNMOD: str = "%%"; break; + case START_SECTION_ID: str = "$$"; break; + case ID: str = "identifier"; break; + case LOCAL_ID: str = ".identifier"; break; + case SPECIAL_ID: str = "..identifier"; break; + case LINE: str = "%line"; break; default: - strch[10] = token; + strch[1] = token; str = strch; break; } - yasm_error_set(YASM_ERROR_PARSE, str); + yasm_error_set(YASM_ERROR_PARSE, "expected %s", str); destroy_curtok(); return 0; } From 7f70534acba1e6591e31c7cc392987f0e76fc4c1 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 19 May 2007 16:52:49 +0000 Subject: [PATCH 011/585] Merge [1840] and [1841] from trunk: Fix handing of SVM (AMD Pacifica) instructions that take an implicit rax/eax/ax operand. svn path=/branches/yasm-0.6.x/; revision=1845 --- modules/arch/x86/tests/svm.asm | 33 +++++++++++++++--- modules/arch/x86/tests/svm.hex | 62 ++++++++++++++++++++++++++++++++++ modules/arch/x86/x86id.c | 56 ++++++++++++++++++++++++++++-- modules/arch/x86/x86parse.gap | 16 ++++----- 4 files changed, 151 insertions(+), 16 deletions(-) diff --git a/modules/arch/x86/tests/svm.asm b/modules/arch/x86/tests/svm.asm index eedf1650..a2fa295c 100644 --- a/modules/arch/x86/tests/svm.asm +++ b/modules/arch/x86/tests/svm.asm @@ -2,15 +2,38 @@ rdtscp clgi invlpga -invlpga rax, ecx +invlpga [rax], ecx +invlpga [eax], ecx +; invlpga [ax], ecx ; invalid skinit -skinit eax +; skinit [rax] ; invalid +skinit [eax] stgi vmload -vmload rax +vmload [rax] +vmload [eax] vmmcall vmrun -vmrun rax +vmrun [rax] +vmrun [eax] vmsave -vmsave rax +vmsave [rax] +vmsave [eax] + +[bits 32] +invlpga +invlpga [eax], ecx +invlpga [ax], ecx +skinit +skinit [eax] +; skinit [ax] ; invalid +vmload +vmload [eax] +vmload [ax] +vmrun +vmrun [eax] +vmrun [ax] +vmsave +vmsave [eax] +vmsave [ax] diff --git a/modules/arch/x86/tests/svm.hex b/modules/arch/x86/tests/svm.hex index 2e1228fc..e4517a2f 100644 --- a/modules/arch/x86/tests/svm.hex +++ b/modules/arch/x86/tests/svm.hex @@ -10,6 +10,10 @@ df 0f 01 df +67 +0f +01 +df 0f 01 de @@ -25,6 +29,10 @@ da 0f 01 da +67 +0f +01 +da 0f 01 d9 @@ -34,9 +42,63 @@ d8 0f 01 d8 +67 +0f +01 +d8 0f 01 db 0f 01 db +67 +0f +01 +db +0f +01 +df +0f +01 +df +67 +0f +01 +df +0f +01 +de +0f +01 +de +0f +01 +da +0f +01 +da +67 +0f +01 +da +0f +01 +d8 +0f +01 +d8 +67 +0f +01 +d8 +0f +01 +db +0f +01 +db +67 +0f +01 +db diff --git a/modules/arch/x86/x86id.c b/modules/arch/x86/x86id.c index f81acf44..6011ce76 100644 --- a/modules/arch/x86/x86id.c +++ b/modules/arch/x86/x86id.c @@ -101,6 +101,10 @@ static const char *cpu_find_reverse(unsigned long cpu); * 16 = immediate, value=1 (for special-case shift) * 17 = immediate, does not contain SEG:OFF (for jmp/call), * 18 = XMM0 + * 19 = AX/EAX/RAX memory operand only (EA) + * [special case for SVM opcodes] + * 20 = EAX memory operand only (EA) + * [special case for SVM skinit opcode] * - 3 bits = size (user-specified, or from register size): * 0 = any size acceptable/no size spec acceptable (dep. on strict) * 1/2/3/4 = 8/16/32/64 bits (from user or reg size) @@ -139,6 +143,7 @@ static const char *cpu_find_reverse(unsigned long cpu); * 8 = relative jump (outputs a jmp instead of normal insn) * 9 = operand size goes into address size (jmp only) * A = far jump (outputs a farjmp instead of normal insn) + * B = ea operand only sets address size (no actual ea field) * The below describes postponed actions: actions which can't be completed at * parse-time due to possibly dependent expressions. For these, some * additional data (stored in the second byte of the opcode with a one-byte @@ -176,6 +181,8 @@ static const char *cpu_find_reverse(unsigned long cpu); #define OPT_Imm1 0x16 #define OPT_ImmNotSegOff 0x17 #define OPT_XMM0 0x18 +#define OPT_MemrAX 0x19 +#define OPT_MemEAX 0x1A #define OPT_MASK 0x1F #define OPS_Any (0UL<<5) @@ -214,6 +221,7 @@ static const char *cpu_find_reverse(unsigned long cpu); #define OPA_JmpRel (8UL<<13) #define OPA_AdSizeR (9UL<<13) #define OPA_JmpFar (0xAUL<<13) +#define OPA_AdSizeEA (0xBUL<<13) #define OPA_MASK (0xFUL<<13) #define OPAP_None (0UL<<17) @@ -2188,17 +2196,17 @@ static const x86_insn_info cmpxchg16b_insn[] = { static const x86_insn_info invlpga_insn[] = { { CPU_SVM, 0, 0, 0, 0, 3, {0x0F, 0x01, 0xDF}, 0, 0, {0, 0, 0} }, { CPU_SVM, 0, 0, 0, 0, 3, {0x0F, 0x01, 0xDF}, 0, 2, - {OPT_Areg|OPS_64|OPA_None, OPT_Creg|OPS_32|OPA_None, 0} } + {OPT_MemrAX|OPS_Any|OPA_AdSizeEA, OPT_Creg|OPS_32|OPA_None, 0} } }; static const x86_insn_info skinit_insn[] = { { CPU_SVM, 0, 0, 0, 0, 3, {0x0F, 0x01, 0xDE}, 0, 0, {0, 0, 0} }, { CPU_SVM, 0, 0, 0, 0, 3, {0x0F, 0x01, 0xDE}, 0, 1, - {OPT_Areg|OPS_32|OPA_None, 0, 0} } + {OPT_MemEAX|OPS_Any|OPA_None, 0, 0} } }; static const x86_insn_info svm_rax_insn[] = { { CPU_SVM, MOD_Op2Add, 0, 0, 0, 3, {0x0F, 0x01, 0x00}, 0, 0, {0, 0, 0} }, { CPU_SVM, MOD_Op2Add, 0, 0, 0, 3, {0x0F, 0x01, 0x00}, 0, 1, - {OPT_Areg|OPS_64|OPA_None, 0, 0} } + {OPT_MemrAX|OPS_Any|OPA_AdSizeEA, 0, 0} } }; /* VIA PadLock instructions */ static const x86_insn_info padlock_insn[] = { @@ -2684,6 +2692,24 @@ x86_find_match(yasm_arch *arch, int num_info, const x86_insn_info *info, op->data.reg != X86_XMMREG) mismatch = 1; break; + case OPT_MemrAX: { + const uintptr_t *regp; + if (op->type != YASM_INSN__OPERAND_MEMORY || + !(regp = yasm_expr_get_reg(&op->data.ea->disp.abs, 0)) || + (*regp != (X86_REG16 | 0) && + *regp != (X86_REG32 | 0) && + *regp != (X86_REG64 | 0))) + mismatch = 1; + break; + } + case OPT_MemEAX: { + const uintptr_t *regp; + if (op->type != YASM_INSN__OPERAND_MEMORY || + !(regp = yasm_expr_get_reg(&op->data.ea->disp.abs, 0)) || + *regp != (X86_REG32 | 0)) + mismatch = 1; + break; + } default: yasm_internal_error(N_("invalid operand type")); } @@ -3131,6 +3157,30 @@ yasm_x86__finalize_insn(yasm_arch *arch, yasm_bytecode *bc, } else yasm_internal_error(N_("invalid operand conversion")); break; + case OPA_AdSizeEA: { + const uintptr_t *regp = NULL; + /* Only implement this for OPT_MemrAX and OPT_MemEAX + * for now. + */ + if (op->type != YASM_INSN__OPERAND_MEMORY || + !(regp = yasm_expr_get_reg(&op->data.ea->disp.abs, 0))) + yasm_internal_error(N_("invalid operand conversion")); + /* 64-bit mode does not allow 16-bit addresses */ + if (mode_bits == 64 && *regp == (X86_REG16 | 0)) + yasm_error_set(YASM_ERROR_TYPE, + N_("16-bit addresses not supported in 64-bit mode")); + else if (*regp == (X86_REG16 | 0)) + insn->common.addrsize = 16; + else if (*regp == (X86_REG32 | 0)) + insn->common.addrsize = 32; + else if (mode_bits == 64 && *regp == (X86_REG64 | 0)) + insn->common.addrsize = 64; + else + yasm_error_set(YASM_ERROR_TYPE, + N_("unsupported address size")); + yasm_ea_destroy(op->data.ea); + break; + } default: yasm_internal_error(N_("unknown operand action")); } diff --git a/modules/arch/x86/x86parse.gap b/modules/arch/x86/x86parse.gap index 1e3bad00..b94006dd 100644 --- a/modules/arch/x86/x86parse.gap +++ b/modules/arch/x86/x86parse.gap @@ -851,14 +851,14 @@ INSN - swapgs NONE threebyte 0x0F01F8 CPU_Hammer|CPU_64 INSN - rdtscp NONE threebyte 0x0F01F9 CPU_686|CPU_AMD|CPU_Priv INSN - cmpxchg16b NONE cmpxchg16b 0 CPU_Hammer|CPU_64 # AMD Pacifica SVM instructions -INSN - clgi NONE threebyte 0x0F01DD CPU_Hammer|CPU_64|CPU_SVM -INSN - invlpga NONE invlpga 0 CPU_Hammer|CPU_64|CPU_SVM -INSN - skinit NONE skinit 0 CPU_Hammer|CPU_64|CPU_SVM -INSN - stgi NONE threebyte 0x0F01DC CPU_Hammer|CPU_64|CPU_SVM -INSN - vmload NONE svm_rax 0xDA CPU_Hammer|CPU_64|CPU_SVM -INSN - vmmcall NONE threebyte 0x0F01D9 CPU_Hammer|CPU_64|CPU_SVM -INSN - vmrun NONE svm_rax 0xD8 CPU_Hammer|CPU_64|CPU_SVM -INSN - vmsave NONE svm_rax 0xDB CPU_Hammer|CPU_64|CPU_SVM +INSN - clgi NONE threebyte 0x0F01DD CPU_SVM +INSN - invlpga NONE invlpga 0 CPU_SVM +INSN - skinit NONE skinit 0 CPU_SVM +INSN - stgi NONE threebyte 0x0F01DC CPU_SVM +INSN - vmload NONE svm_rax 0xDA CPU_SVM +INSN - vmmcall NONE threebyte 0x0F01D9 CPU_SVM +INSN - vmrun NONE svm_rax 0xD8 CPU_SVM +INSN - vmsave NONE svm_rax 0xDB CPU_SVM # VIA PadLock instructions INSN - xstore NONE padlock 0xC000A7 CPU_PadLock INSN - xstorerng NONE padlock 0xC000A7 CPU_PadLock From b93f38738bed7686bd0d71d4e600464a3199cea1 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 19 May 2007 17:19:58 +0000 Subject: [PATCH 012/585] Merge [1812] and [1813] from trunk: Restructure yasm_object as central clearing house for yasm_objfmt, yasm_dbgfmt, and yasm_arch. svn path=/branches/yasm-0.6.x/; revision=1846 --- configure.ac | 4 +- frontends/yasm/yasm.c | 126 +++++------- libyasm/coretype.h | 7 +- libyasm/dbgfmt.h | 49 +++-- libyasm/objfmt.h | 99 +++++----- libyasm/parser.h | 11 +- libyasm/section.c | 113 +++++++---- libyasm/section.h | 59 +++--- libyasm/symrec.c | 10 +- libyasm/symrec.h | 4 +- libyasm/value.c | 10 +- modules/dbgfmts/codeview/cv-dbgfmt.c | 27 +-- modules/dbgfmts/codeview/cv-dbgfmt.h | 11 +- modules/dbgfmts/codeview/cv-symline.c | 128 ++++++------ modules/dbgfmts/codeview/cv-type.c | 22 +-- modules/dbgfmts/dwarf2/dwarf2-aranges.c | 12 +- modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c | 47 ++--- modules/dbgfmts/dwarf2/dwarf2-dbgfmt.h | 17 +- modules/dbgfmts/dwarf2/dwarf2-info.c | 18 +- modules/dbgfmts/dwarf2/dwarf2-line.c | 43 ++-- modules/dbgfmts/null/null-dbgfmt.c | 10 +- modules/dbgfmts/stabs/stabs-dbgfmt.c | 50 ++--- modules/objfmts/bin/bin-objfmt.c | 73 +++---- modules/objfmts/coff/coff-objfmt.c | 250 +++++++++++------------- modules/objfmts/dbg/dbg-objfmt.c | 60 +++--- modules/objfmts/elf/elf-objfmt.c | 152 +++++++------- modules/objfmts/macho/macho-objfmt.c | 120 +++++------- modules/objfmts/rdf/rdf-objfmt.c | 89 ++++----- modules/objfmts/xdf/xdf-objfmt.c | 110 +++++------ modules/parsers/gas/gas-parse.c | 83 ++++---- modules/parsers/gas/gas-parser.c | 16 +- modules/parsers/gas/gas-parser.h | 9 +- modules/parsers/gas/gas-token.re | 16 +- modules/parsers/nasm/nasm-parse.c | 71 +++---- modules/parsers/nasm/nasm-parser.c | 16 +- modules/parsers/nasm/nasm-parser.h | 9 +- modules/parsers/nasm/nasm-token.re | 36 ++-- 37 files changed, 883 insertions(+), 1104 deletions(-) diff --git a/configure.ac b/configure.ac index 8d1963d9..324746ab 100644 --- a/configure.ac +++ b/configure.ac @@ -172,8 +172,8 @@ if test "$USE_MAINTAINER_MODE" = "yes"; then MORE_CFLAGS="$MORE_CFLAGS -Wswitch" MORE_CFLAGS="$MORE_CFLAGS -Wwrite-strings" MORE_CFLAGS="$MORE_CFLAGS -Wno-undef" - MORE_CFLAGS="$MORE_CFLAGS -Wno-unused" -# MORE_CFLAGS="$MORE_CFLAGS -Wno-unused-parameter" +# MORE_CFLAGS="$MORE_CFLAGS -Wno-unused" + MORE_CFLAGS="$MORE_CFLAGS -Wno-unused-parameter" fi fi diff --git a/frontends/yasm/yasm.c b/frontends/yasm/yasm.c index d49fce04..4a315bda 100644 --- a/frontends/yasm/yasm.c +++ b/frontends/yasm/yasm.c @@ -56,10 +56,8 @@ static int special_options = 0; /*@null@*/ /*@dependent@*/ static const yasm_preproc_module * cur_preproc_module = NULL; /*@null@*/ static char *objfmt_keyword = NULL; -/*@null@*/ /*@dependent@*/ static yasm_objfmt *cur_objfmt = NULL; /*@null@*/ /*@dependent@*/ static const yasm_objfmt_module * cur_objfmt_module = NULL; -/*@null@*/ /*@dependent@*/ static yasm_dbgfmt *cur_dbgfmt = NULL; /*@null@*/ /*@dependent@*/ static const yasm_dbgfmt_module * cur_dbgfmt_module = NULL; /*@null@*/ /*@dependent@*/ static yasm_listfmt *cur_listfmt = NULL; @@ -79,7 +77,8 @@ static enum { /*@null@*/ /*@dependent@*/ static FILE *open_file(const char *filename, const char *mode); static void check_errors(/*@only@*/ yasm_errwarns *errwarns, - /*@only@*/ yasm_object *object); + /*@only@*/ yasm_object *object, + /*@only@*/ yasm_linemap *linemap); static void cleanup(/*@null@*/ /*@only@*/ yasm_object *object); /* Forward declarations: cmd line parser handlers */ @@ -226,7 +225,7 @@ do_preproc_only(FILE *in) FILE *out = NULL; yasm_errwarns *errwarns = yasm_errwarns_create(); - /* Initialize line manager */ + /* Initialize line map */ linemap = yasm_linemap_create(); yasm_linemap_set(linemap, in_filename, 1, 1); @@ -321,13 +320,17 @@ static int do_assemble(FILE *in) { yasm_object *object; - yasm_section *def_sect; const char *base_filename; /*@null@*/ FILE *obj = NULL; yasm_arch_create_error arch_error; + yasm_linemap *linemap; yasm_errwarns *errwarns = yasm_errwarns_create(); int i, matched; + /* Initialize line map */ + linemap = yasm_linemap_create(); + yasm_linemap_set(linemap, in_filename, 1, 1); + /* determine the object filename if not specified */ if (!obj_filename) { if (in == stdin) @@ -383,16 +386,18 @@ do_assemble(FILE *in) } /* Create object */ - object = yasm_object_create(in_filename, obj_filename); - yasm_linemap_set(yasm_object_get_linemap(object), in_filename, 1, 1); + object = yasm_object_create(in_filename, obj_filename, cur_arch, + cur_objfmt_module, cur_dbgfmt_module); + if (!object) { + yasm_error_class eclass; + unsigned long xrefline; + /*@only@*/ /*@null@*/ char *estr, *xrefstr; + + yasm_error_fetch(&eclass, &estr, &xrefline, &xrefstr); + print_error("%s: %s", _("FATAL"), estr); + yasm_xfree(estr); + yasm_xfree(xrefstr); - /* Initialize the object format */ - cur_objfmt = yasm_objfmt_create(cur_objfmt_module, object, cur_arch); - if (!cur_objfmt) { - print_error( - _("%s: object format `%s' does not support architecture `%s' machine `%s'"), - _("FATAL"), cur_objfmt_module->keyword, cur_arch_module->keyword, - machine_name); if (in != stdin) fclose(in); cleanup(object); @@ -400,41 +405,7 @@ do_assemble(FILE *in) } /* Get a fresh copy of objfmt_module as it may have changed. */ - cur_objfmt_module = ((yasm_objfmt_base *)cur_objfmt)->module; - - /* Add an initial "default" section to object */ - def_sect = yasm_objfmt_add_default_section(cur_objfmt); - - /* Check to see if the requested debug format is in the allowed list - * for the active object format. - */ - matched = 0; - for (i=0; cur_objfmt_module->dbgfmt_keywords[i]; i++) - if (yasm__strcasecmp(cur_objfmt_module->dbgfmt_keywords[i], - cur_dbgfmt_module->keyword) == 0) - matched = 1; - if (!matched) { - print_error(_("%s: `%s' is not a valid %s for %s `%s'"), - _("FATAL"), cur_dbgfmt_module->keyword, _("debug format"), - _("object format"), cur_objfmt_module->keyword); - if (in != stdin) - fclose(in); - cleanup(object); - return EXIT_FAILURE; - } - - /* Initialize the debug format */ - cur_dbgfmt = yasm_dbgfmt_create(cur_dbgfmt_module, object, cur_objfmt, - cur_arch); - if (!cur_dbgfmt) { - print_error( - _("%s: debug format `%s' does not work with object format `%s'"), - _("FATAL"), cur_dbgfmt_module->keyword, - cur_objfmt_module->keyword); - if (in != stdin) - fclose(in); - return EXIT_FAILURE; - } + cur_objfmt_module = ((yasm_objfmt_base *)object->objfmt)->module; /* Check to see if the requested preprocessor is in the allowed list * for the active parser. @@ -454,8 +425,7 @@ do_assemble(FILE *in) return EXIT_FAILURE; } - cur_preproc = cur_preproc_module->create(in, in_filename, - yasm_object_get_linemap(object), + cur_preproc = cur_preproc_module->create(in, in_filename, linemap, errwarns); apply_preproc_builtins(); @@ -470,34 +440,33 @@ do_assemble(FILE *in) yasm_arch_set_var(cur_arch, "force_strict", force_strict); /* Parse! */ - cur_parser_module->do_parse(object, cur_preproc, cur_arch, cur_objfmt, - cur_dbgfmt, in, in_filename, - list_filename != NULL, def_sect, errwarns); + cur_parser_module->do_parse(object, cur_preproc, in, list_filename != NULL, + linemap, errwarns); /* Close input file */ if (in != stdin) fclose(in); - check_errors(errwarns, object); + check_errors(errwarns, object, linemap); /* Check for undefined symbols */ - yasm_symtab_parser_finalize(yasm_object_get_symtab(object), + yasm_symtab_parser_finalize(object->symtab, strcmp(cur_parser_module->keyword, "gas")==0 || strcmp(cur_parser_module->keyword, "gnu")==0, - cur_objfmt, errwarns); - check_errors(errwarns, object); + object, errwarns); + check_errors(errwarns, object, linemap); /* Finalize parse */ yasm_object_finalize(object, errwarns); - check_errors(errwarns, object); + check_errors(errwarns, object, linemap); /* Optimize */ - yasm_object_optimize(object, cur_arch, errwarns); - check_errors(errwarns, object); + yasm_object_optimize(object, errwarns); + check_errors(errwarns, object, linemap); /* generate any debugging information */ - yasm_dbgfmt_generate(cur_dbgfmt, errwarns); - check_errors(errwarns, object); + yasm_dbgfmt_generate(object, linemap, errwarns); + check_errors(errwarns, object, linemap); /* open the object file for output (if not already opened by dbg objfmt) */ if (!obj && strcmp(cur_objfmt_module->keyword, "dbg") != 0) { @@ -509,9 +478,8 @@ do_assemble(FILE *in) } /* Write the object file */ - yasm_objfmt_output(cur_objfmt, obj?obj:stderr, - strcmp(cur_dbgfmt_module->keyword, "null"), cur_dbgfmt, - errwarns); + yasm_objfmt_output(object, obj?obj:stderr, + strcmp(cur_dbgfmt_module->keyword, "null"), errwarns); /* Close object file */ if (obj) @@ -522,7 +490,7 @@ do_assemble(FILE *in) */ if (yasm_errwarns_num_errors(errwarns, warning_error) > 0) remove(obj_filename); - check_errors(errwarns, object); + check_errors(errwarns, object, linemap); /* Open and write the list file */ if (list_filename) { @@ -534,15 +502,14 @@ do_assemble(FILE *in) /* Initialize the list format */ cur_listfmt = yasm_listfmt_create(cur_listfmt_module, in_filename, obj_filename); - yasm_listfmt_output(cur_listfmt, list, - yasm_object_get_linemap(object), cur_arch); + yasm_listfmt_output(cur_listfmt, list, linemap, cur_arch); fclose(list); } - yasm_errwarns_output_all(errwarns, yasm_object_get_linemap(object), - warning_error, print_yasm_error, - print_yasm_warning); + yasm_errwarns_output_all(errwarns, linemap, warning_error, + print_yasm_error, print_yasm_warning); + yasm_linemap_destroy(linemap); yasm_errwarns_destroy(errwarns); cleanup(object); return EXIT_SUCCESS; @@ -734,12 +701,13 @@ open_file(const char *filename, const char *mode) } static void -check_errors(yasm_errwarns *errwarns, yasm_object *object) +check_errors(yasm_errwarns *errwarns, yasm_object *object, + yasm_linemap *linemap) { if (yasm_errwarns_num_errors(errwarns, warning_error) > 0) { - yasm_errwarns_output_all(errwarns, yasm_object_get_linemap(object), - warning_error, print_yasm_error, - print_yasm_warning); + yasm_errwarns_output_all(errwarns, linemap, warning_error, + print_yasm_error, print_yasm_warning); + yasm_linemap_destroy(linemap); yasm_errwarns_destroy(errwarns); cleanup(object); exit(EXIT_FAILURE); @@ -757,18 +725,12 @@ static void cleanup(yasm_object *object) { if (DO_FREE) { - if (cur_objfmt) - yasm_objfmt_destroy(cur_objfmt); - if (cur_dbgfmt) - yasm_dbgfmt_destroy(cur_dbgfmt); if (cur_listfmt) yasm_listfmt_destroy(cur_listfmt); if (cur_preproc) yasm_preproc_destroy(cur_preproc); if (object) yasm_object_destroy(object); - if (cur_arch) - yasm_arch_destroy(cur_arch); yasm_floatnum_cleanup(); yasm_intnum_cleanup(); diff --git a/libyasm/coretype.h b/libyasm/coretype.h index a6b92b04..3f5e3a79 100644 --- a/libyasm/coretype.h +++ b/libyasm/coretype.h @@ -47,6 +47,11 @@ typedef struct yasm_dbgfmt yasm_dbgfmt; /** List format interface. \see listfmt.h for details. */ typedef struct yasm_listfmt yasm_listfmt; +/** Object format module interface. \see objfmt.h for details. */ +typedef struct yasm_objfmt_module yasm_objfmt_module; +/** Debug format module interface. \see dbgfmt.h for details. */ +typedef struct yasm_dbgfmt_module yasm_dbgfmt_module; + /** YASM associated data callback structure. Many data structures can have * arbitrary data associated with them. */ @@ -75,7 +80,7 @@ typedef struct yasm_errwarns yasm_errwarns; */ typedef struct yasm_bytecode yasm_bytecode; -/** Object (opaque type). \see section.h for related functions. */ +/** Object. \see section.h for details and related functions. */ typedef struct yasm_object yasm_object; /** Section (opaque type). \see section.h for related functions. */ diff --git a/libyasm/dbgfmt.h b/libyasm/dbgfmt.h index cae3568d..acf357a6 100644 --- a/libyasm/dbgfmt.h +++ b/libyasm/dbgfmt.h @@ -44,8 +44,8 @@ typedef struct yasm_dbgfmt_base { } yasm_dbgfmt_base; #endif -/** YASM debug format module interface. */ -typedef struct yasm_dbgfmt_module { +/** Debug format module interface. */ +struct yasm_dbgfmt_module { /** One-line description of the debug format. */ const char *name; @@ -56,12 +56,9 @@ typedef struct yasm_dbgfmt_module { * Module-level implementation of yasm_dbgfmt_create(). * The filenames are provided solely for informational purposes. * \param object object - * \param of object format in use - * \param a architecture in use * \return NULL if object format does not provide needed support. */ - /*@null@*/ /*@only@*/ yasm_dbgfmt * (*create) - (yasm_object *object, yasm_objfmt *of, yasm_arch *a); + /*@null@*/ /*@only@*/ yasm_dbgfmt * (*create) (yasm_object *object); /** Module-level implementation of yasm_dbgfmt_destroy(). * Call yasm_dbgfmt_destroy() instead of calling this function. @@ -71,16 +68,16 @@ typedef struct yasm_dbgfmt_module { /** Module-level implementation of yasm_dbgfmt_directive(). * Call yasm_dbgfmt_directive() instead of calling this function. */ - int (*directive) (yasm_dbgfmt *dbgfmt, const char *name, - yasm_section *sect, + int (*directive) (yasm_object *object, const char *name, /*@null@*/ yasm_valparamhead *valparams, unsigned long line); /** Module-level implementation of yasm_dbgfmt_generate(). * Call yasm_dbgfmt_generate() instead of calling this function. */ - void (*generate) (yasm_dbgfmt *dbgfmt, yasm_errwarns *errwarns); -} yasm_dbgfmt_module; + void (*generate) (yasm_object *object, yasm_linemap *linemap, + yasm_errwarns *errwarns); +}; /** Get the keyword used to select a debug format. * \param dbgfmt debug format @@ -93,13 +90,10 @@ const char *yasm_dbgfmt_keyword(const yasm_dbgfmt *dbgfmt); * purposes. * \param module debug format module * \param object object to generate debugging information for - * \param of object format in use - * \param a architecture in use * \return NULL if object format does not provide needed support. */ /*@null@*/ /*@only@*/ yasm_dbgfmt *yasm_dbgfmt_create - (const yasm_dbgfmt_module *module, yasm_object *object, yasm_objfmt *of, - yasm_arch *a); + (const yasm_dbgfmt_module *module, yasm_object *object); /** Cleans up any allocated debug format memory. * \param dbgfmt debug format @@ -107,25 +101,25 @@ const char *yasm_dbgfmt_keyword(const yasm_dbgfmt *dbgfmt); void yasm_dbgfmt_destroy(/*@only@*/ yasm_dbgfmt *dbgfmt); /** DEBUG directive support. - * \param dbgfmt debug format + * \param object object * \param name directive name - * \param sect current active section * \param valparams value/parameters * \param line virtual line (from yasm_linemap) * \return Nonzero if directive was not recognized; 0 if directive was * recognized even if it wasn't valid. */ -int yasm_dbgfmt_directive(yasm_dbgfmt *dbgfmt, const char *name, - yasm_section *sect, +int yasm_dbgfmt_directive(yasm_object *object, const char *name, /*@null@*/ yasm_valparamhead *valparams, unsigned long line); /** Generate debugging information bytecodes. - * \param dbgfmt debug format + * \param object object + * \param linemap virtual/physical line mapping * \param errwarns error/warning set * \note Errors and warnings are stored into errwarns. */ -void yasm_dbgfmt_generate(yasm_dbgfmt *dbgfmt, yasm_errwarns *errwarns); +void yasm_dbgfmt_generate(yasm_object *object, yasm_linemap *linemap, + yasm_errwarns *errwarns); #ifndef YASM_DOXYGEN @@ -134,16 +128,17 @@ void yasm_dbgfmt_generate(yasm_dbgfmt *dbgfmt, yasm_errwarns *errwarns); #define yasm_dbgfmt_keyword(dbgfmt) \ (((yasm_dbgfmt_base *)dbgfmt)->module->keyword) -#define yasm_dbgfmt_create(module, object, of, a) \ - module->create(object, of, a) +#define yasm_dbgfmt_create(module, object) \ + module->create(object) #define yasm_dbgfmt_destroy(dbgfmt) \ ((yasm_dbgfmt_base *)dbgfmt)->module->destroy(dbgfmt) -#define yasm_dbgfmt_directive(dbgfmt, name, sect, valparams, line) \ - ((yasm_dbgfmt_base *)dbgfmt)->module->directive(dbgfmt, name, sect, \ - valparams, line) -#define yasm_dbgfmt_generate(dbgfmt, ews) \ - ((yasm_dbgfmt_base *)dbgfmt)->module->generate(dbgfmt, ews) +#define yasm_dbgfmt_directive(object, name, valparams, line) \ + ((yasm_dbgfmt_base *)((object)->dbgfmt))->module->directive \ + (object, name, valparams, line) +#define yasm_dbgfmt_generate(object, linemap, ews) \ + ((yasm_dbgfmt_base *)((object)->dbgfmt))->module->generate \ + (object, linemap, ews) #endif diff --git a/libyasm/objfmt.h b/libyasm/objfmt.h index 129803dc..9ada7d2c 100644 --- a/libyasm/objfmt.h +++ b/libyasm/objfmt.h @@ -44,8 +44,8 @@ typedef struct yasm_objfmt_base { } yasm_objfmt_base; #endif -/** YASM object format module interface. */ -typedef struct yasm_objfmt_module { +/** Object format module interface. */ +struct yasm_objfmt_module { /** One-line description of the object format. */ const char *name; @@ -81,13 +81,12 @@ typedef struct yasm_objfmt_module { * \param a architecture in use * \return NULL if architecture/machine combination not supported. */ - /*@null@*/ /*@only@*/ yasm_objfmt * (*create) (yasm_object *object, - yasm_arch *a); + /*@null@*/ /*@only@*/ yasm_objfmt * (*create) (yasm_object *object); /** Module-level implementation of yasm_objfmt_output(). * Call yasm_objfmt_output() instead of calling this function. */ - void (*output) (yasm_objfmt *of, FILE *f, int all_syms, yasm_dbgfmt *df, + void (*output) (yasm_object *o, FILE *f, int all_syms, yasm_errwarns *errwarns); /** Module-level implementation of yasm_objfmt_destroy(). @@ -98,13 +97,13 @@ typedef struct yasm_objfmt_module { /** Module-level implementation of yasm_objfmt_add_default_section(). * Call yasm_objfmt_add_default_section() instead of calling this function. */ - yasm_section * (*add_default_section) (yasm_objfmt *objfmt); + yasm_section * (*add_default_section) (yasm_object *object); /** Module-level implementation of yasm_objfmt_section_switch(). * Call yasm_objfmt_section_switch() instead of calling this function. */ /*@observer@*/ /*@null@*/ yasm_section * - (*section_switch)(yasm_objfmt *objfmt, yasm_valparamhead *valparams, + (*section_switch)(yasm_object *object, yasm_valparamhead *valparams, /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line); @@ -112,54 +111,52 @@ typedef struct yasm_objfmt_module { * Call yasm_objfmt_extern_declare() instead of calling this function. */ yasm_symrec * (*extern_declare) - (yasm_objfmt *objfmt, const char *name, + (yasm_object *object, const char *name, /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line); /** Module-level implementation of yasm_objfmt_global_declare(). * Call yasm_objfmt_global_declare() instead of calling this function. */ yasm_symrec * (*global_declare) - (yasm_objfmt *objfmt, const char *name, + (yasm_object *object, const char *name, /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line); /** Module-level implementation of yasm_objfmt_common_declare(). * Call yasm_objfmt_common_declare() instead of calling this function. */ yasm_symrec * (*common_declare) - (yasm_objfmt *objfmt, const char *name, /*@only@*/ yasm_expr *size, + (yasm_object *object, const char *name, /*@only@*/ yasm_expr *size, /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line); /** Module-level implementation of yasm_objfmt_directive(). * Call yasm_objfmt_directive() instead of calling this function. */ - int (*directive) (yasm_objfmt *objfmt, const char *name, + int (*directive) (yasm_object *object, const char *name, /*@null@*/ yasm_valparamhead *valparams, /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line); -} yasm_objfmt_module; +}; /** Create object format. * \param module object format module * \param object object - * \param a architecture in use * \return NULL if architecture/machine combination not supported. */ /*@null@*/ /*@only@*/ yasm_objfmt *yasm_objfmt_create - (const yasm_objfmt_module *module, yasm_object *object, yasm_arch *a); + (const yasm_objfmt_module *module, yasm_object *object); /** Write out (post-optimized) sections to the object file. * This function may call yasm_symrec_* functions as necessary (including * yasm_symrec_traverse()) to retrieve symbolic information. - * \param objfmt object format + * \param object object * \param f output object file * \param all_syms if nonzero, all symbols should be included in * the object file - * \param df debug format in use * \param errwarns error/warning set * \note Errors and warnings are stored into errwarns. */ -void yasm_objfmt_output(yasm_objfmt *objfmt, FILE *f, int all_syms, - yasm_dbgfmt *df, yasm_errwarns *errwarns); +void yasm_objfmt_output(yasm_object *object, FILE *f, int all_syms, + yasm_errwarns *errwarns); /** Cleans up any allocated object format memory. * \param objfmt object format @@ -167,52 +164,52 @@ void yasm_objfmt_output(yasm_objfmt *objfmt, FILE *f, int all_syms, void yasm_objfmt_destroy(/*@only@*/ yasm_objfmt *objfmt); /** Add a default section to an object. - * \param objfmt object format + * \param object object * \return Default section. */ -yasm_section *yasm_objfmt_add_default_section(yasm_objfmt *objfmt); +yasm_section *yasm_objfmt_add_default_section(yasm_object *object); /** Switch object file sections. The first val of the valparams should * be the section name. Calls yasm_object_get_general() to actually get * the section. - * \param objfmt object format + * \param object object * \param valparams value/parameters * \param objext_valparams object format-specific value/parameters * \param line virtual line (from yasm_linemap) * \return NULL on error, otherwise new section. */ /*@observer@*/ /*@null@*/ yasm_section *yasm_objfmt_section_switch - (yasm_objfmt *objfmt, yasm_valparamhead *valparams, + (yasm_object *object, yasm_valparamhead *valparams, /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line); /** Declare an "extern" (importing from another module) symbol. Should * call yasm_symtab_declare(). - * \param objfmt object format + * \param object object * \param name symbol name * \param objext_valparams object format-specific value/paramaters * \param line virtual line (from yasm_linemap) * \return Declared symbol. */ yasm_symrec *yasm_objfmt_extern_declare - (yasm_objfmt *objfmt, const char *name, + (yasm_object *object, const char *name, /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line); /** Declare a "global" (exporting to other modules) symbol. Should call * yasm_symtab_declare(). - * \param objfmt object format + * \param object object * \param name symbol name * \param objext_valparams object format-specific value/paramaters * \param line virtual line (from yasm_linemap) * \return Declared symbol. */ yasm_symrec *yasm_objfmt_global_declare - (yasm_objfmt *objfmt, const char *name, + (yasm_object *object, const char *name, /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line); /** Declare a "common" (shared space with other modules) symbol. Should * call yasm_symtab_declare(). * declaration. - * \param objfmt object format + * \param object object * \param name symbol name * \param size common data size * \param objext_valparams object format-specific value/paramaters @@ -220,11 +217,11 @@ yasm_symrec *yasm_objfmt_global_declare * \return Declared symbol. */ yasm_symrec *yasm_objfmt_common_declare - (yasm_objfmt *objfmt, const char *name, /*@only@*/ yasm_expr *size, + (yasm_object *object, const char *name, /*@only@*/ yasm_expr *size, /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line); /** Handle object format-specific directives. - * \param objfmt object format + * \param object object * \param name directive name * \param valparams value/parameters * \param objext_valparams object format-specific value/parameters @@ -232,7 +229,7 @@ yasm_symrec *yasm_objfmt_common_declare * \return Nonzero if directive was not recognized; 0 if directive was * recognized, even if it wasn't valid. */ -int yasm_objfmt_directive(yasm_objfmt *objfmt, const char *name, +int yasm_objfmt_directive(yasm_object *object, const char *name, /*@null@*/ yasm_valparamhead *valparams, /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line); @@ -241,29 +238,31 @@ int yasm_objfmt_directive(yasm_objfmt *objfmt, const char *name, /* Inline macro implementations for objfmt functions */ -#define yasm_objfmt_create(module, object, a) module->create(object, a) +#define yasm_objfmt_create(module, object) module->create(object) -#define yasm_objfmt_output(objfmt, f, all_syms, df, ews) \ - ((yasm_objfmt_base *)objfmt)->module->output(objfmt, f, all_syms, df, ews) +#define yasm_objfmt_output(object, f, all_syms, ews) \ + ((yasm_objfmt_base *)((object)->objfmt))->module->output \ + (object, f, all_syms, ews) #define yasm_objfmt_destroy(objfmt) \ ((yasm_objfmt_base *)objfmt)->module->destroy(objfmt) -#define yasm_objfmt_section_switch(objfmt, vpms, oe_vpms, line) \ - ((yasm_objfmt_base *)objfmt)->module->section_switch(objfmt, vpms, \ - oe_vpms, line) -#define yasm_objfmt_extern_declare(objfmt, name, oe_vpms, line) \ - ((yasm_objfmt_base *)objfmt)->module->extern_declare(objfmt, name, \ - oe_vpms, line) -#define yasm_objfmt_global_declare(objfmt, name, oe_vpms, line) \ - ((yasm_objfmt_base *)objfmt)->module->global_declare(objfmt, name, \ - oe_vpms, line) -#define yasm_objfmt_common_declare(objfmt, name, size, oe_vpms, line) \ - ((yasm_objfmt_base *)objfmt)->module->common_declare(objfmt, name, size, \ - oe_vpms, line) -#define yasm_objfmt_directive(objfmt, name, vpms, oe_vpms, line) \ - ((yasm_objfmt_base *)objfmt)->module->directive(objfmt, name, vpms, \ - oe_vpms, line) -#define yasm_objfmt_add_default_section(objfmt) \ - ((yasm_objfmt_base *)objfmt)->module->add_default_section(objfmt) +#define yasm_objfmt_section_switch(object, vpms, oe_vpms, line) \ + ((yasm_objfmt_base *)((object)->objfmt))->module->section_switch \ + (object, vpms, oe_vpms, line) +#define yasm_objfmt_extern_declare(object, name, oe_vpms, line) \ + ((yasm_objfmt_base *)((object)->objfmt))->module->extern_declare \ + (object, name, oe_vpms, line) +#define yasm_objfmt_global_declare(object, name, oe_vpms, line) \ + ((yasm_objfmt_base *)((object)->objfmt))->module->global_declare \ + (object, name, oe_vpms, line) +#define yasm_objfmt_common_declare(object, name, size, oe_vpms, line) \ + ((yasm_objfmt_base *)((object)->objfmt))->module->common_declare \ + (object, name, size, oe_vpms, line) +#define yasm_objfmt_directive(object, name, vpms, oe_vpms, line) \ + ((yasm_objfmt_base *)((object)->objfmt))->module->directive \ + (object, name, vpms, oe_vpms, line) +#define yasm_objfmt_add_default_section(object) \ + ((yasm_objfmt_base *)((object)->objfmt))->module->add_default_section \ + (object) #endif diff --git a/libyasm/parser.h b/libyasm/parser.h index 80b6fcab..e85b217e 100644 --- a/libyasm/parser.h +++ b/libyasm/parser.h @@ -54,23 +54,16 @@ typedef struct yasm_parser_module { /** Parse a source file into an object. * \param object object to parse into (already created) * \param pp preprocessor - * \param a architecture; architecture-specific directives are - * obtained from this. - * \param of object format; objfmt-specific directives and segment - * names are obtained from this. * \param f initial starting file - * \param in_filename initial starting file's filename * \param save_input nonzero if the parser should save the original * lines of source into the object's linemap (via * yasm_linemap_add_data()). - * \param def_sect default (starting) section in the object * \param errwarns error/warning set * \note Parse errors and warnings are stored into errwarns. */ void (*do_parse) - (yasm_object *object, yasm_preproc *pp, yasm_arch *a, yasm_objfmt *of, - yasm_dbgfmt *df, FILE *f, const char *in_filename, int save_input, - yasm_section *def_sect, yasm_errwarns *errwarns); + (yasm_object *object, yasm_preproc *pp, FILE *f, int save_input, + yasm_linemap *linemap, yasm_errwarns *errwarns); } yasm_parser_module; #endif diff --git a/libyasm/section.c b/libyasm/section.c index 357a69d2..812218ac 100644 --- a/libyasm/section.c +++ b/libyasm/section.c @@ -45,6 +45,8 @@ #include "bytecode.h" #include "arch.h" #include "section.h" + +#include "dbgfmt.h" #include "objfmt.h" #include "expr-int.h" @@ -53,16 +55,6 @@ #include "inttree.h" -struct yasm_object { - /*@owned@*/ char *src_filename; - /*@owned@*/ char *obj_filename; - - yasm_symtab *symtab; - yasm_linemap *linemap; - - /*@reldef@*/ STAILQ_HEAD(yasm_sectionhead, yasm_section) sections; -}; - struct yasm_section { /*@reldef@*/ STAILQ_ENTRY(yasm_section) link; @@ -112,21 +104,74 @@ static void yasm_section_destroy(/*@only@*/ yasm_section *sect); /*@-compdestroy@*/ yasm_object * -yasm_object_create(const char *src_filename, const char *obj_filename) +yasm_object_create(const char *src_filename, const char *obj_filename, + /*@kept@*/ yasm_arch *arch, + const yasm_objfmt_module *objfmt_module, + const yasm_dbgfmt_module *dbgfmt_module) { yasm_object *object = yasm_xmalloc(sizeof(yasm_object)); + int matched, i; object->src_filename = yasm__xstrdup(src_filename); object->obj_filename = yasm__xstrdup(obj_filename); - /* Create empty symtab and linemap */ + /* Create empty symbol table */ object->symtab = yasm_symtab_create(); - object->linemap = yasm_linemap_create(); /* Initialize sections linked list */ STAILQ_INIT(&object->sections); + /* Initialize the target architecture */ + object->arch = arch; + + /* Initialize things to NULL in case of error */ + object->dbgfmt = NULL; + + /* Initialize the object format */ + object->objfmt = yasm_objfmt_create(objfmt_module, object); + if (!object->objfmt) { + yasm_error_set(YASM_ERROR_GENERAL, + N_("object format `%s' does not support architecture `%s' machine `%s'"), + objfmt_module->keyword, ((yasm_arch_base *)arch)->module->keyword, + yasm_arch_get_machine(arch)); + goto error; + } + + /* Get a fresh copy of objfmt_module as it may have changed. */ + objfmt_module = ((yasm_objfmt_base *)object->objfmt)->module; + + /* Add an initial "default" section to object */ + object->cur_section = yasm_objfmt_add_default_section(object); + + /* Check to see if the requested debug format is in the allowed list + * for the active object format. + */ + matched = 0; + for (i=0; objfmt_module->dbgfmt_keywords[i]; i++) + if (yasm__strcasecmp(objfmt_module->dbgfmt_keywords[i], + dbgfmt_module->keyword) == 0) + matched = 1; + if (!matched) { + yasm_error_set(YASM_ERROR_GENERAL, + N_("`%s' is not a valid debug format for object format `%s'"), + dbgfmt_module->keyword, objfmt_module->keyword); + goto error; + } + + /* Initialize the debug format */ + object->dbgfmt = yasm_dbgfmt_create(dbgfmt_module, object); + if (!object->dbgfmt) { + yasm_error_set(YASM_ERROR_GENERAL, + N_("debug format `%s' does not work with object format `%s'"), + dbgfmt_module->keyword, objfmt_module->keyword); + goto error; + } + return object; + +error: + yasm_object_destroy(object); + return NULL; } /*@=compdestroy@*/ @@ -236,30 +281,6 @@ yasm_object_set_source_fn(yasm_object *object, const char *src_filename) object->src_filename = yasm__xstrdup(src_filename); } -const char * -yasm_object_get_source_fn(const yasm_object *object) -{ - return object->src_filename; -} - -const char * -yasm_object_get_object_fn(const yasm_object *object) -{ - return object->obj_filename; -} - -yasm_symtab * -yasm_object_get_symtab(const yasm_object *object) -{ - return object->symtab; -} - -yasm_linemap * -yasm_object_get_linemap(const yasm_object *object) -{ - return object->linemap; -} - int yasm_section_is_absolute(yasm_section *sect) { @@ -321,6 +342,14 @@ yasm_object_destroy(yasm_object *object) { yasm_section *cur, *next; + /* Delete object format, debug format, and arch. This can be called + * due to an error in yasm_object_create(), so look out for NULLs. + */ + if (object->objfmt) + yasm_objfmt_destroy(object->objfmt); + if (object->dbgfmt) + yasm_dbgfmt_destroy(object->dbgfmt); + /* Delete sections */ cur = STAILQ_FIRST(&object->sections); while (cur) { @@ -333,9 +362,12 @@ yasm_object_destroy(yasm_object *object) yasm_xfree(object->src_filename); yasm_xfree(object->obj_filename); - /* Delete symbol table and line mappings */ + /* Delete symbol table */ yasm_symtab_destroy(object->symtab); - yasm_linemap_destroy(object->linemap); + + /* Delete architecture */ + if (object->arch) + yasm_arch_destroy(object->arch); yasm_xfree(object); } @@ -1145,8 +1177,7 @@ optimize_term_expand(IntervalTreeNode *node, void *d) } void -yasm_object_optimize(yasm_object *object, yasm_arch *arch, - yasm_errwarns *errwarns) +yasm_object_optimize(yasm_object *object, yasm_errwarns *errwarns) { yasm_section *sect; unsigned long bc_index = 0; diff --git a/libyasm/section.h b/libyasm/section.h index 61b7acdf..07db95ff 100644 --- a/libyasm/section.h +++ b/libyasm/section.h @@ -47,15 +47,39 @@ struct yasm_reloc { }; #endif +/** An object. This is the internal representation of an object file. */ +struct yasm_object { + /*@owned@*/ char *src_filename; /**< Source filename */ + /*@owned@*/ char *obj_filename; /**< Object filename */ + + /*@owned@*/ yasm_symtab *symtab; /**< Symbol table */ + /*@owned@*/ yasm_arch *arch; /**< Target architecture */ + /*@owned@*/ yasm_objfmt *objfmt; /**< Object format */ + /*@owned@*/ yasm_dbgfmt *dbgfmt; /**< Debug format */ + + /** Currently active section. Used by some directives. */ + /*@dependent@*/ yasm_section *cur_section; + +#ifdef YASM_LIB_INTERNAL + /*@reldef@*/ STAILQ_HEAD(yasm_sectionhead, yasm_section) sections; +#endif +}; + /** Create a new object. A default section is created as the first section. * An empty symbol table (yasm_symtab) and line mapping (yasm_linemap) are * automatically created. * \param src_filename source filename (e.g. "file.asm") * \param obj_filename object filename (e.g. "file.o") - * \return Newly allocated object. + * \param arch architecture + * \param objfmt_module object format module + * \param dbgfmt_module debug format module + * \return Newly allocated object, or NULL on error. */ -/*@only@*/ yasm_object *yasm_object_create(const char *src_filename, - const char *obj_filename); +/*@null@*/ /*@only@*/ yasm_object *yasm_object_create + (const char *src_filename, const char *obj_filename, + /*@kept@*/ yasm_arch *arch, + const yasm_objfmt_module *objfmt_module, + const yasm_dbgfmt_module *dbgfmt_module); /** Create a new, or continue an existing, general section. The section is * added to the object if there's not already a section by that name. @@ -133,40 +157,13 @@ int yasm_object_sections_traverse */ void yasm_object_set_source_fn(yasm_object *object, const char *src_filename); -/** Get an object's source filename. - * \param object object - * \return Source filename. - */ -const char *yasm_object_get_source_fn(const yasm_object *object); - -/** Get an object's object filename. - * \param object object - * \return Object filename. - */ -const char *yasm_object_get_object_fn(const yasm_object *object); - -/** Get an object's symbol table (#yasm_symtab). - * \param object object - * \return Symbol table. - */ -/*@dependent@*/ yasm_symtab *yasm_object_get_symtab(const yasm_object *object); - -/** Get an object's line mappings (#yasm_linemap). - * \param object object - * \return Line mappings. - */ -/*@dependent@*/ yasm_linemap *yasm_object_get_linemap - (const yasm_object *object); - /** Optimize an object. Takes the unoptimized object and optimizes it. * If successful, the object is ready for output to an object file. * \param object object - * \param arch architecture * \param errwarns error/warning set * \note Optimization failures are stored into errwarns. */ -void yasm_object_optimize(yasm_object *object, yasm_arch *arch, - yasm_errwarns *errwarns); +void yasm_object_optimize(yasm_object *object, yasm_errwarns *errwarns); /** Determine if a section is absolute or general. * \param sect section diff --git a/libyasm/symrec.c b/libyasm/symrec.c index 76ef09ad..1b8e7219 100644 --- a/libyasm/symrec.c +++ b/libyasm/symrec.c @@ -324,7 +324,7 @@ yasm_symrec_declare(yasm_symrec *rec, yasm_sym_vis vis, unsigned long line) typedef struct symtab_finalize_info { unsigned long firstundef_line; int undef_extern; - /*@null@*/ yasm_objfmt *objfmt; + /*@null@*/ yasm_object *object; yasm_errwarns *errwarns; } symtab_finalize_info; @@ -337,8 +337,8 @@ symtab_parser_finalize_checksym(yasm_symrec *sym, /*@null@*/ void *d) /* error if a symbol is used but never defined or extern/common declared */ if ((sym->status & YASM_SYM_USED) && !(sym->status & YASM_SYM_DEFINED) && !(sym->visibility & (YASM_SYM_EXTERN | YASM_SYM_COMMON))) { - if (info->undef_extern && info->objfmt) - yasm_objfmt_extern_declare(info->objfmt, sym->name, NULL, 1); + if (info->undef_extern && info->object) + yasm_objfmt_extern_declare(info->object, sym->name, NULL, 1); else { yasm_error_set(YASM_ERROR_GENERAL, N_("undefined symbol `%s' (first use)"), sym->name); @@ -373,12 +373,12 @@ symtab_parser_finalize_checksym(yasm_symrec *sym, /*@null@*/ void *d) void yasm_symtab_parser_finalize(yasm_symtab *symtab, int undef_extern, - yasm_objfmt *objfmt, yasm_errwarns *errwarns) + yasm_object *object, yasm_errwarns *errwarns) { symtab_finalize_info info; info.firstundef_line = ULONG_MAX; info.undef_extern = undef_extern; - info.objfmt = objfmt; + info.object = object; info.errwarns = errwarns; yasm_symtab_traverse(symtab, &info, symtab_parser_finalize_checksym); if (info.firstundef_line < ULONG_MAX) { diff --git a/libyasm/symrec.h b/libyasm/symrec.h index 5c3edb37..6cf97559 100644 --- a/libyasm/symrec.h +++ b/libyasm/symrec.h @@ -202,13 +202,13 @@ yasm_symrec *yasm_symtab_iter_value(const yasm_symtab_iter *cur); * used but never defined or declared #YASM_SYM_EXTERN or #YASM_SYM_COMMON. * \param symtab symbol table * \param undef_extern if nonzero, all undef syms should be declared extern - * \param objfmt object format to notify about new extern decls + * \param object object to notify about new extern decls * (may be NULL if undef_extern is 0) * \param errwarns error/warning set * \note Errors/warnings are stored into errwarns. */ void yasm_symtab_parser_finalize(yasm_symtab *symtab, int undef_extern, - /*@null@*/ yasm_objfmt *objfmt, + /*@null@*/ yasm_object *object, yasm_errwarns *errwarns); /** Print the symbol table. For debugging purposes. diff --git a/libyasm/value.c b/libyasm/value.c index 1e530e9a..90cfeeb3 100644 --- a/libyasm/value.c +++ b/libyasm/value.c @@ -117,8 +117,8 @@ yasm_value_set_curpos_rel(yasm_value *value, yasm_bytecode *bc, * to a custom absolute symbol. */ if (!value->rel) { - value->rel = yasm_symtab_abs_sym(yasm_object_get_symtab( - yasm_section_get_object(yasm_bc_get_section(bc)))); + yasm_object *object = yasm_section_get_object(yasm_bc_get_section(bc)); + value->rel = yasm_symtab_abs_sym(object->symtab); } } @@ -274,9 +274,9 @@ value_finalize_scan(yasm_value *value, yasm_expr *e, yasm_intnum_create_uint(0); } else { /* Replace positive portion with curpos */ - yasm_symtab *symtab = - yasm_object_get_symtab( - yasm_section_get_object(sect2)); + yasm_object *object = + yasm_section_get_object(sect2); + yasm_symtab *symtab = object->symtab; e->terms[j].data.sym = yasm_symtab_define_curpos (symtab, ".", expr_precbc, e->line); diff --git a/modules/dbgfmts/codeview/cv-dbgfmt.c b/modules/dbgfmts/codeview/cv-dbgfmt.c index d17f6089..1b045fcf 100644 --- a/modules/dbgfmts/codeview/cv-dbgfmt.c +++ b/modules/dbgfmts/codeview/cv-dbgfmt.c @@ -37,19 +37,13 @@ yasm_dbgfmt_module yasm_cv8_LTX_dbgfmt; static /*@null@*/ /*@only@*/ yasm_dbgfmt * -cv_dbgfmt_create(yasm_object *object, yasm_objfmt *of, yasm_arch *a, - yasm_dbgfmt_module *module, int version) +cv_dbgfmt_create(yasm_object *object, yasm_dbgfmt_module *module, int version) { yasm_dbgfmt_cv *dbgfmt_cv = yasm_xmalloc(sizeof(yasm_dbgfmt_cv)); size_t i; dbgfmt_cv->dbgfmt.module = module; - dbgfmt_cv->object = object; - dbgfmt_cv->symtab = yasm_object_get_symtab(object); - dbgfmt_cv->linemap = yasm_object_get_linemap(object); - dbgfmt_cv->arch = a; - dbgfmt_cv->filenames_allocated = 32; dbgfmt_cv->filenames_size = 0; dbgfmt_cv->filenames = @@ -67,9 +61,9 @@ cv_dbgfmt_create(yasm_object *object, yasm_objfmt *of, yasm_arch *a, } static /*@null@*/ /*@only@*/ yasm_dbgfmt * -cv8_dbgfmt_create(yasm_object *object, yasm_objfmt *of, yasm_arch *a) +cv8_dbgfmt_create(yasm_object *object) { - return cv_dbgfmt_create(object, of, a, &yasm_cv8_LTX_dbgfmt, 8); + return cv_dbgfmt_create(object, &yasm_cv8_LTX_dbgfmt, 8); } static void @@ -98,19 +92,16 @@ yasm_cv__append_bc(yasm_section *sect, yasm_bytecode *bc) } static void -cv_dbgfmt_generate(yasm_dbgfmt *dbgfmt, yasm_errwarns *errwarns) +cv_dbgfmt_generate(yasm_object *object, yasm_linemap *linemap, + yasm_errwarns *errwarns) { - yasm_dbgfmt_cv *dbgfmt_cv = (yasm_dbgfmt_cv *)dbgfmt; - - yasm_cv__generate_symline(dbgfmt_cv, errwarns); - - yasm_cv__generate_type(dbgfmt_cv); + yasm_cv__generate_symline(object, linemap, errwarns); + yasm_cv__generate_type(object); } static int -cv_dbgfmt_directive(yasm_dbgfmt *dbgfmt, const char *name, - yasm_section *sect, yasm_valparamhead *valparams, - unsigned long line) +cv_dbgfmt_directive(yasm_object *object, const char *name, + yasm_valparamhead *valparams, unsigned long line) { return 1; /* TODO */ } diff --git a/modules/dbgfmts/codeview/cv-dbgfmt.h b/modules/dbgfmts/codeview/cv-dbgfmt.h index 246bbdfe..3e8db324 100644 --- a/modules/dbgfmts/codeview/cv-dbgfmt.h +++ b/modules/dbgfmts/codeview/cv-dbgfmt.h @@ -39,11 +39,6 @@ typedef struct { typedef struct yasm_dbgfmt_cv { yasm_dbgfmt_base dbgfmt; /* base structure */ - yasm_object *object; - yasm_symtab *symtab; - yasm_linemap *linemap; - yasm_arch *arch; - cv_filename *filenames; size_t filenames_size; size_t filenames_allocated; @@ -54,10 +49,10 @@ typedef struct yasm_dbgfmt_cv { yasm_bytecode *yasm_cv__append_bc(yasm_section *sect, yasm_bytecode *bc); /* Symbol/Line number functions */ -yasm_section *yasm_cv__generate_symline(yasm_dbgfmt_cv *dbgfmt_cv, - yasm_errwarns *errwarns); +yasm_section *yasm_cv__generate_symline + (yasm_object *object, yasm_linemap *linemap, yasm_errwarns *errwarns); /* Type functions */ -yasm_section *yasm_cv__generate_type(yasm_dbgfmt_cv *dbgfmt_cv); +yasm_section *yasm_cv__generate_type(yasm_object *object); #endif diff --git a/modules/dbgfmts/codeview/cv-symline.c b/modules/dbgfmts/codeview/cv-symline.c index 65dd02a4..068ac566 100644 --- a/modules/dbgfmts/codeview/cv-symline.c +++ b/modules/dbgfmts/codeview/cv-symline.c @@ -107,7 +107,6 @@ enum cv_symtype { }; typedef struct cv8_symhead { - yasm_dbgfmt_cv *dbgfmt_cv; enum cv8_symheadtype type; yasm_bytecode *start_prevbc; yasm_bytecode *end_prevbc; @@ -115,7 +114,6 @@ typedef struct cv8_symhead { } cv8_symhead; typedef struct cv8_fileinfo { - yasm_dbgfmt_cv *dbgfmt_cv; const cv_filename *fn; } cv8_fileinfo; @@ -134,7 +132,6 @@ typedef struct cv8_lineset { typedef struct cv8_lineinfo { STAILQ_ENTRY(cv8_lineinfo) link; - yasm_dbgfmt_cv *dbgfmt_cv; const cv_filename *fn; /* filename associated with line numbers */ yasm_section *sect; /* section line numbers are for */ yasm_symrec *sectsym; /* symbol for beginning of sect */ @@ -153,7 +150,6 @@ typedef struct cv8_lineinfo { * 'Z' : 0-terminated string (pointer) */ typedef struct cv_sym { - yasm_dbgfmt_cv *dbgfmt_cv; enum cv_symtype type; const char *format; union { @@ -243,24 +239,21 @@ static const yasm_bytecode_callback cv_sym_bc_callback = { 0 }; -static cv8_symhead *cv8_add_symhead(yasm_dbgfmt_cv *dbgfmt_cv, - yasm_section *sect, unsigned long type, +static cv8_symhead *cv8_add_symhead(yasm_section *sect, unsigned long type, int first); static void cv8_set_symhead_end(cv8_symhead *head, yasm_bytecode *end_prevbc); static yasm_bytecode *cv8_add_fileinfo - (yasm_dbgfmt_cv *dbgfmt_cv, yasm_section *sect, const cv_filename *fn); + (yasm_section *sect, const cv_filename *fn); static unsigned long cv_sym_size(const cv_sym *cvs); static cv_sym * -cv8_add_sym_objname(yasm_dbgfmt_cv *dbgfmt_cv, yasm_section *sect, - /*@keep@*/ char *objname) +cv8_add_sym_objname(yasm_section *sect, /*@keep@*/ char *objname) { yasm_bytecode *bc; cv_sym *cvs = yasm_xmalloc(sizeof(cv_sym)); - cvs->dbgfmt_cv = dbgfmt_cv; cvs->type = CV8_S_OBJNAME; cvs->format = "wZ"; cvs->args[0].i = 0; /* signature (0=asm) */ @@ -273,19 +266,18 @@ cv8_add_sym_objname(yasm_dbgfmt_cv *dbgfmt_cv, yasm_section *sect, } static cv_sym * -cv8_add_sym_compile(yasm_dbgfmt_cv *dbgfmt_cv, yasm_section *sect, +cv8_add_sym_compile(yasm_object *object, yasm_section *sect, /*@keep@*/ char *creator) { yasm_bytecode *bc; cv_sym *cvs = yasm_xmalloc(sizeof(cv_sym)); - cvs->dbgfmt_cv = dbgfmt_cv; cvs->type = CV8_S_COMPILE; cvs->format = "wwwwZh"; cvs->args[0].i = 3; /* language (3=Masm) */ /* target processor; 0xD0 = AMD64 */ - if (strcmp(yasm_arch_keyword(dbgfmt_cv->arch), "x86") == 0) { - if (strcmp(yasm_arch_get_machine(dbgfmt_cv->arch), "amd64") == 0) + if (strcmp(yasm_arch_keyword(object->arch), "x86") == 0) { + if (strcmp(yasm_arch_get_machine(object->arch), "amd64") == 0) cvs->args[1].i = 0xD0; else cvs->args[1].i = 0x6; /* 686, FIXME */ @@ -304,12 +296,10 @@ cv8_add_sym_compile(yasm_dbgfmt_cv *dbgfmt_cv, yasm_section *sect, } static cv_sym * -cv8_add_sym_label(yasm_dbgfmt_cv *dbgfmt_cv, yasm_section *sect, - yasm_symrec *sym) +cv8_add_sym_label(yasm_section *sect, yasm_symrec *sym) { yasm_bytecode *bc; cv_sym *cvs = yasm_xmalloc(sizeof(cv_sym)); - cvs->dbgfmt_cv = dbgfmt_cv; cvs->type = CV8_S_LABEL32; cvs->format = "YbZ"; cvs->args[0].p = sym; /* symrec for label */ @@ -323,12 +313,11 @@ cv8_add_sym_label(yasm_dbgfmt_cv *dbgfmt_cv, yasm_section *sect, } static cv_sym * -cv8_add_sym_data(yasm_dbgfmt_cv *dbgfmt_cv, yasm_section *sect, - unsigned long type, yasm_symrec *sym, int is_global) +cv8_add_sym_data(yasm_section *sect, unsigned long type, yasm_symrec *sym, + int is_global) { yasm_bytecode *bc; cv_sym *cvs = yasm_xmalloc(sizeof(cv_sym)); - cvs->dbgfmt_cv = dbgfmt_cv; cvs->type = is_global ? CV8_S_GDATA32 : CV8_S_LDATA32; cvs->format = "wYZ"; cvs->args[0].i = type; /* type index */ @@ -423,7 +412,9 @@ cv_append_str(yasm_section *sect, const char *str) typedef struct cv_line_info { yasm_section *debug_symline; + yasm_object *object; yasm_dbgfmt_cv *dbgfmt_cv; + yasm_linemap *linemap; yasm_errwarns *errwarns; unsigned int num_lineinfos; STAILQ_HEAD(, cv8_lineinfo) cv8_lineinfos; @@ -445,7 +436,7 @@ cv_generate_line_bc(yasm_bytecode *bc, /*@null@*/ void *d) if (nextbc && bc->offset == nextbc->offset) return 0; - yasm_linemap_lookup(dbgfmt_cv->linemap, bc->line, &filename, &line); + yasm_linemap_lookup(info->linemap, bc->line, &filename, &line); if (!info->cv8_cur_li || strcmp(filename, info->cv8_cur_li->fn->filename) != 0) { @@ -477,7 +468,6 @@ cv_generate_line_bc(yasm_bytecode *bc, /*@null@*/ void *d) /* and create new lineinfo structure */ info->cv8_cur_li = yasm_xmalloc(sizeof(cv8_lineinfo)); - info->cv8_cur_li->dbgfmt_cv = dbgfmt_cv; info->cv8_cur_li->fn = &dbgfmt_cv->filenames[i]; info->cv8_cur_li->sect = sect; sectbc = yasm_section_bcs_first(sect); @@ -486,7 +476,7 @@ cv_generate_line_bc(yasm_bytecode *bc, /*@null@*/ void *d) else { sprintf(symname, ".%06u", info->num_lineinfos++); info->cv8_cur_li->sectsym = - yasm_symtab_define_label(dbgfmt_cv->symtab, symname, sectbc, + yasm_symtab_define_label(info->object->symtab, symname, sectbc, 1, 0); } info->cv8_cur_li->num_linenums = 0; @@ -532,8 +522,7 @@ cv_generate_line_section(yasm_section *sect, /*@null@*/ void *d) static int cv_generate_filename(const char *filename, void *d) { - yasm_dbgfmt_cv *dbgfmt_cv = (yasm_dbgfmt_cv *)d; - cv_dbgfmt_add_file(dbgfmt_cv, 0, filename); + cv_dbgfmt_add_file((yasm_dbgfmt_cv *)d, 0, filename); return 0; } @@ -553,16 +542,18 @@ cv_generate_sym(yasm_symrec *sym, void *d) /* TODO: add data types; until then, just mark everything as UBYTE */ if (yasm_section_is_code(yasm_bc_get_section(precbc))) - cv8_add_sym_label(info->dbgfmt_cv, info->debug_symline, sym); + cv8_add_sym_label(info->debug_symline, sym); else - cv8_add_sym_data(info->dbgfmt_cv, info->debug_symline, 0x20, sym, + cv8_add_sym_data(info->debug_symline, 0x20, sym, yasm_symrec_get_visibility(sym) & YASM_SYM_GLOBAL?1:0); return 0; } yasm_section * -yasm_cv__generate_symline(yasm_dbgfmt_cv *dbgfmt_cv, yasm_errwarns *errwarns) +yasm_cv__generate_symline(yasm_object *object, yasm_linemap *linemap, + yasm_errwarns *errwarns) { + yasm_dbgfmt_cv *dbgfmt_cv = (yasm_dbgfmt_cv *)object->dbgfmt; cv_line_info info; int new; size_t i; @@ -572,21 +563,22 @@ yasm_cv__generate_symline(yasm_dbgfmt_cv *dbgfmt_cv, yasm_errwarns *errwarns) unsigned long off; /* Generate filenames based on linemap */ - yasm_linemap_traverse_filenames(dbgfmt_cv->linemap, dbgfmt_cv, + yasm_linemap_traverse_filenames(linemap, dbgfmt_cv, cv_generate_filename); + info.object = object; info.dbgfmt_cv = dbgfmt_cv; + info.linemap = linemap; info.errwarns = errwarns; - info.debug_symline = yasm_object_get_general(dbgfmt_cv->object, - ".debug$S", 0, 1, 0, 0, &new, - 0); + info.debug_symline = + yasm_object_get_general(object, ".debug$S", 0, 1, 0, 0, &new, 0); info.num_lineinfos = 0; STAILQ_INIT(&info.cv8_lineinfos); info.cv8_cur_li = NULL; info.cv8_cur_ls = NULL; /* source filenames string table */ - head = cv8_add_symhead(dbgfmt_cv, info.debug_symline, CV8_FILE_STRTAB, 1); + head = cv8_add_symhead(info.debug_symline, CV8_FILE_STRTAB, 1); cv_append_str(info.debug_symline, ""); off = 1; for (i=0; ifilenames_size; i++) { @@ -611,13 +603,12 @@ yasm_cv__generate_symline(yasm_dbgfmt_cv *dbgfmt_cv, yasm_errwarns *errwarns) yasm_bc_calc_len(bc, NULL, NULL); /* source file info table */ - head = cv8_add_symhead(dbgfmt_cv, info.debug_symline, CV8_FILE_INFO, 0); + head = cv8_add_symhead(info.debug_symline, CV8_FILE_INFO, 0); off = 0; for (i=0; ifilenames_size; i++) { if (!dbgfmt_cv->filenames[i].pathname) continue; - bc = cv8_add_fileinfo(dbgfmt_cv, info.debug_symline, - &dbgfmt_cv->filenames[i]); + bc = cv8_add_fileinfo(info.debug_symline, &dbgfmt_cv->filenames[i]); dbgfmt_cv->filenames[i].info_off = off; off += bc->len; } @@ -626,13 +617,12 @@ yasm_cv__generate_symline(yasm_dbgfmt_cv *dbgfmt_cv, yasm_errwarns *errwarns) /* Already aligned 4 */ /* Generate line numbers for sections */ - yasm_object_sections_traverse(dbgfmt_cv->object, (void *)&info, + yasm_object_sections_traverse(object, (void *)&info, cv_generate_line_section); /* Output line numbers for sections */ STAILQ_FOREACH(li, &info.cv8_lineinfos, link) { - head = cv8_add_symhead(dbgfmt_cv, info.debug_symline, CV8_LINE_NUMS, - 0); + head = cv8_add_symhead(info.debug_symline, CV8_LINE_NUMS, 0); bc = yasm_bc_create_common(&cv8_lineinfo_bc_callback, li, 0); bc->len = 24+li->num_linenums*8; yasm_cv__append_bc(info.debug_symline, bc); @@ -642,15 +632,15 @@ yasm_cv__generate_symline(yasm_dbgfmt_cv *dbgfmt_cv, yasm_errwarns *errwarns) /* Already aligned 4 */ /* Output debugging symbols */ - head = cv8_add_symhead(dbgfmt_cv, info.debug_symline, CV8_DEBUG_SYMS, 0); + head = cv8_add_symhead(info.debug_symline, CV8_DEBUG_SYMS, 0); /* add object and compile flag first */ - cv8_add_sym_objname(dbgfmt_cv, info.debug_symline, - yasm__abspath(yasm_object_get_object_fn(dbgfmt_cv->object))); - cv8_add_sym_compile(dbgfmt_cv, info.debug_symline, + cv8_add_sym_objname(info.debug_symline, + yasm__abspath(object->obj_filename)); + cv8_add_sym_compile(object, info.debug_symline, yasm__xstrdup(PACKAGE_NAME " " PACKAGE_INTVER "." PACKAGE_BUILD)); /* then iterate through symbol table */ - yasm_symtab_traverse(dbgfmt_cv->symtab, &info, cv_generate_sym); + yasm_symtab_traverse(object->symtab, &info, cv_generate_sym); cv8_set_symhead_end(head, yasm_section_bcs_last(info.debug_symline)); /* Align 4 at end */ @@ -683,14 +673,12 @@ cv_out_sym(yasm_symrec *sym, unsigned long off, yasm_bytecode *bc, } static cv8_symhead * -cv8_add_symhead(yasm_dbgfmt_cv *dbgfmt_cv, yasm_section *sect, - unsigned long type, int first) +cv8_add_symhead(yasm_section *sect, unsigned long type, int first) { cv8_symhead *head; yasm_bytecode *bc; head = yasm_xmalloc(sizeof(cv8_symhead)); - head->dbgfmt_cv = dbgfmt_cv; head->type = type; head->first = first; head->start_prevbc = yasm_section_bcs_last(sect); @@ -738,28 +726,28 @@ cv8_symhead_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, yasm_output_value_func output_value, yasm_output_reloc_func output_reloc) { + yasm_object *object = yasm_section_get_object(bc->section); cv8_symhead *head = (cv8_symhead *)bc->contents; - yasm_dbgfmt_cv *dbgfmt_cv = head->dbgfmt_cv; unsigned char *buf = *bufp; yasm_intnum *intn, *cval; cval = yasm_intnum_create_uint(4); /* Output "version" if first */ if (head->first) { - yasm_arch_intnum_tobytes(dbgfmt_cv->arch, cval, buf, 4, 32, 0, bc, 0); + yasm_arch_intnum_tobytes(object->arch, cval, buf, 4, 32, 0, bc, 0); buf += 4; } /* Type contained - 4 bytes */ yasm_intnum_set_uint(cval, head->type); - yasm_arch_intnum_tobytes(dbgfmt_cv->arch, cval, buf, 4, 32, 0, bc, 0); + yasm_arch_intnum_tobytes(object->arch, cval, buf, 4, 32, 0, bc, 0); buf += 4; /* Total length of info (following this field) - 4 bytes */ yasm_intnum_set_uint(cval, bc->len); intn = yasm_calc_bc_dist(head->start_prevbc, head->end_prevbc); yasm_intnum_calc(intn, YASM_EXPR_SUB, cval); - yasm_arch_intnum_tobytes(dbgfmt_cv->arch, intn, buf, 4, 32, 0, bc, 0); + yasm_arch_intnum_tobytes(object->arch, intn, buf, 4, 32, 0, bc, 0); buf += 4; yasm_intnum_destroy(intn); @@ -770,14 +758,12 @@ cv8_symhead_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, } static yasm_bytecode * -cv8_add_fileinfo(yasm_dbgfmt_cv *dbgfmt_cv, yasm_section *sect, - const cv_filename *fn) +cv8_add_fileinfo(yasm_section *sect, const cv_filename *fn) { cv8_fileinfo *fi; yasm_bytecode *bc; fi = yasm_xmalloc(sizeof(cv8_fileinfo)); - fi->dbgfmt_cv = dbgfmt_cv; fi->fn = fn; bc = yasm_bc_create_common(&cv8_fileinfo_bc_callback, fi, 0); @@ -813,20 +799,20 @@ cv8_fileinfo_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, yasm_output_value_func output_value, yasm_output_reloc_func output_reloc) { + yasm_object *object = yasm_section_get_object(bc->section); cv8_fileinfo *fi = (cv8_fileinfo *)bc->contents; - yasm_dbgfmt_cv *dbgfmt_cv = fi->dbgfmt_cv; unsigned char *buf = *bufp; yasm_intnum *cval; int i; /* Offset in filename string table */ cval = yasm_intnum_create_uint(fi->fn->str_off); - yasm_arch_intnum_tobytes(dbgfmt_cv->arch, cval, buf, 4, 32, 0, bc, 0); + yasm_arch_intnum_tobytes(object->arch, cval, buf, 4, 32, 0, bc, 0); buf += 4; /* Checksum type/length */ yasm_intnum_set_uint(cval, 0x0110); - yasm_arch_intnum_tobytes(dbgfmt_cv->arch, cval, buf, 2, 16, 0, bc, 0); + yasm_arch_intnum_tobytes(object->arch, cval, buf, 2, 16, 0, bc, 0); buf += 2; /* Checksum */ @@ -880,8 +866,8 @@ cv8_lineinfo_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, yasm_output_value_func output_value, yasm_output_reloc_func output_reloc) { + yasm_object *object = yasm_section_get_object(bc->section); cv8_lineinfo *li = (cv8_lineinfo *)bc->contents; - yasm_dbgfmt_cv *dbgfmt_cv = li->dbgfmt_cv; unsigned char *buf = *bufp; yasm_intnum *cval; unsigned long i; @@ -897,22 +883,22 @@ cv8_lineinfo_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, /* Section length covered by line number info */ cval = yasm_calc_bc_dist(yasm_section_bcs_first(li->sect), yasm_section_bcs_last(li->sect)); - yasm_arch_intnum_tobytes(dbgfmt_cv->arch, cval, buf, 4, 32, 0, bc, 0); + yasm_arch_intnum_tobytes(object->arch, cval, buf, 4, 32, 0, bc, 0); buf += 4; /* Offset of source file in info table */ yasm_intnum_set_uint(cval, li->fn->info_off); - yasm_arch_intnum_tobytes(dbgfmt_cv->arch, cval, buf, 4, 32, 0, bc, 0); + yasm_arch_intnum_tobytes(object->arch, cval, buf, 4, 32, 0, bc, 0); buf += 4; /* Number of line number pairs */ yasm_intnum_set_uint(cval, li->num_linenums); - yasm_arch_intnum_tobytes(dbgfmt_cv->arch, cval, buf, 4, 32, 0, bc, 0); + yasm_arch_intnum_tobytes(object->arch, cval, buf, 4, 32, 0, bc, 0); buf += 4; /* Number of bytes of line number pairs + 12 (no, I don't know why) */ yasm_intnum_set_uint(cval, li->num_linenums*8+12); - yasm_arch_intnum_tobytes(dbgfmt_cv->arch, cval, buf, 4, 32, 0, bc, 0); + yasm_arch_intnum_tobytes(object->arch, cval, buf, 4, 32, 0, bc, 0); buf += 4; /* Offset / line number pairs */ @@ -922,14 +908,12 @@ cv8_lineinfo_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, for (j=0; inum_linenums && j<126; i++, j++) { /* offset in section */ yasm_intnum_set_uint(cval, ls->pairs[j].offset); - yasm_arch_intnum_tobytes(dbgfmt_cv->arch, cval, buf, 4, 32, 0, bc, - 0); + yasm_arch_intnum_tobytes(object->arch, cval, buf, 4, 32, 0, bc, 0); buf += 4; /* line number in file */ yasm_intnum_set_uint(cval, ls->pairs[j].line); - yasm_arch_intnum_tobytes(dbgfmt_cv->arch, cval, buf, 4, 32, 0, bc, - 0); + yasm_arch_intnum_tobytes(object->arch, cval, buf, 4, 32, 0, bc, 0); buf += 4; } } @@ -1037,8 +1021,8 @@ cv_sym_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, yasm_output_value_func output_value, yasm_output_reloc_func output_reloc) { + yasm_object *object = yasm_section_get_object(bc->section); cv_sym *cvs = (cv_sym *)bc->contents; - yasm_dbgfmt_cv *dbgfmt_cv = cvs->dbgfmt_cv; unsigned char *buf = *bufp; yasm_intnum *cval; const char *ch = cvs->format; @@ -1047,12 +1031,12 @@ cv_sym_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, /* Total length of record (following this field) - 2 bytes */ cval = yasm_intnum_create_uint(bc->len-2); - yasm_arch_intnum_tobytes(dbgfmt_cv->arch, cval, buf, 2, 16, 0, bc, 1); + yasm_arch_intnum_tobytes(object->arch, cval, buf, 2, 16, 0, bc, 1); buf += 2; /* Type contained - 2 bytes */ yasm_intnum_set_uint(cval, cvs->type); - yasm_arch_intnum_tobytes(dbgfmt_cv->arch, cval, buf, 2, 16, 0, bc, 0); + yasm_arch_intnum_tobytes(object->arch, cval, buf, 2, 16, 0, bc, 0); buf += 2; while (*ch) { @@ -1063,13 +1047,13 @@ cv_sym_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, break; case 'h': yasm_intnum_set_uint(cval, cvs->args[arg++].i); - yasm_arch_intnum_tobytes(dbgfmt_cv->arch, cval, buf, 2, 16, 0, + yasm_arch_intnum_tobytes(object->arch, cval, buf, 2, 16, 0, bc, 0); buf += 2; break; case 'w': yasm_intnum_set_uint(cval, cvs->args[arg++].i); - yasm_arch_intnum_tobytes(dbgfmt_cv->arch, cval, buf, 4, 32, 0, + yasm_arch_intnum_tobytes(object->arch, cval, buf, 4, 32, 0, bc, 0); buf += 4; break; @@ -1080,7 +1064,7 @@ cv_sym_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, break; case 'T': yasm_intnum_set_uint(cval, cvs->args[arg++].i); - yasm_arch_intnum_tobytes(dbgfmt_cv->arch, cval, buf, 4, 32, 0, + yasm_arch_intnum_tobytes(object->arch, cval, buf, 4, 32, 0, bc, 0); buf += 4; /* XXX: will be 2 in CV4 */ break; diff --git a/modules/dbgfmts/codeview/cv-type.c b/modules/dbgfmts/codeview/cv-type.c index 70620a03..ecec7f9b 100644 --- a/modules/dbgfmts/codeview/cv-type.c +++ b/modules/dbgfmts/codeview/cv-type.c @@ -474,7 +474,6 @@ typedef struct cv_leaf { } cv_leaf; typedef struct cv_type { - yasm_dbgfmt_cv *dbgfmt_cv; unsigned long indx; /* type # (must be same as output order) */ size_t num_leaves; /*@null@*/ /*@only@*/ cv_leaf **leaves; @@ -501,7 +500,7 @@ static const yasm_bytecode_callback cv_type_bc_callback = { 0 }; -static cv_type *cv_type_create(yasm_dbgfmt_cv *dbgfmt_cv, unsigned long indx); +static cv_type *cv_type_create(unsigned long indx); static void cv_type_append_leaf(cv_type *type, /*@keep@*/ cv_leaf *leaf); @@ -516,7 +515,7 @@ cv_leaf_create_label(int is_far) } yasm_section * -yasm_cv__generate_type(yasm_dbgfmt_cv *dbgfmt_cv) +yasm_cv__generate_type(yasm_object *object) { int new; unsigned long indx = CV_FIRST_NONPRIM; @@ -524,11 +523,11 @@ yasm_cv__generate_type(yasm_dbgfmt_cv *dbgfmt_cv) yasm_bytecode *bc; cv_type *type; - debug_type = yasm_object_get_general(dbgfmt_cv->object, ".debug$T", 0, 1, - 0, 0, &new, 0); + debug_type = + yasm_object_get_general(object, ".debug$T", 0, 1, 0, 0, &new, 0); /* Add label type */ - type = cv_type_create(dbgfmt_cv, indx++); + type = cv_type_create(indx++); cv_type_append_leaf(type, cv_leaf_create_label(0)); bc = yasm_bc_create_common(&cv_type_bc_callback, type, 0); yasm_bc_finalize(bc, yasm_cv__append_bc(debug_type, bc)); @@ -667,11 +666,10 @@ cv_leaf_tobytes(const cv_leaf *leaf, yasm_bytecode *bc, yasm_arch *arch, } static cv_type * -cv_type_create(yasm_dbgfmt_cv *dbgfmt_cv, unsigned long indx) +cv_type_create(unsigned long indx) { cv_type *type = yasm_xmalloc(sizeof(cv_type)); - type->dbgfmt_cv = dbgfmt_cv; type->indx = indx; type->num_leaves = 0; type->leaves = NULL; @@ -739,8 +737,8 @@ cv_type_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, yasm_output_value_func output_value, yasm_output_reloc_func output_reloc) { + yasm_object *object = yasm_section_get_object(bc->section); cv_type *type = (cv_type *)bc->contents; - yasm_dbgfmt_cv *dbgfmt_cv = type->dbgfmt_cv; unsigned char *buf = *bufp; yasm_intnum *cval; size_t i; @@ -748,19 +746,19 @@ cv_type_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, cval = yasm_intnum_create_uint(4); /* version */ if (type->indx == CV_FIRST_NONPRIM) { - yasm_arch_intnum_tobytes(dbgfmt_cv->arch, cval, buf, 4, 32, 0, bc, 1); + yasm_arch_intnum_tobytes(object->arch, cval, buf, 4, 32, 0, bc, 1); buf += 4; reclen -= 4; } /* Total length of record (following this field) - 2 bytes */ yasm_intnum_set_uint(cval, reclen); - yasm_arch_intnum_tobytes(dbgfmt_cv->arch, cval, buf, 2, 16, 0, bc, 1); + yasm_arch_intnum_tobytes(object->arch, cval, buf, 2, 16, 0, bc, 1); buf += 2; /* Leaves */ for (i=0; inum_leaves; i++) - cv_leaf_tobytes(type->leaves[i], bc, dbgfmt_cv->arch, &buf, cval); + cv_leaf_tobytes(type->leaves[i], bc, object->arch, &buf, cval); /* Pad to multiple of 4 */ switch ((buf-(*bufp)) & 0x3) { diff --git a/modules/dbgfmts/dwarf2/dwarf2-aranges.c b/modules/dbgfmts/dwarf2/dwarf2-aranges.c index f78e1d47..e277cdaa 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-aranges.c +++ b/modules/dbgfmts/dwarf2/dwarf2-aranges.c @@ -50,6 +50,7 @@ dwarf2_append_arange(yasm_section *debug_aranges, /*@only@*/ yasm_expr *start, typedef struct dwarf2_aranges_info { yasm_section *debug_aranges; /* section to which address ranges go */ + yasm_object *object; yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2; } dwarf2_aranges_info; @@ -67,7 +68,7 @@ dwarf2_generate_aranges_section(yasm_section *sect, /*@null@*/ void *d) /* Create address range descriptor */ start = yasm_expr_create_ident( - yasm_expr_sym(yasm_dwarf2__bc_sym(dbgfmt_dwarf2->symtab, + yasm_expr_sym(yasm_dwarf2__bc_sym(info->object->symtab, yasm_section_bcs_first(sect))), 0); length = yasm_expr_create_ident( yasm_expr_int(yasm_calc_bc_dist(yasm_section_bcs_first(sect), @@ -79,9 +80,9 @@ dwarf2_generate_aranges_section(yasm_section *sect, /*@null@*/ void *d) } yasm_section * -yasm_dwarf2__generate_aranges(yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2, - yasm_section *debug_info) +yasm_dwarf2__generate_aranges(yasm_object *object, yasm_section *debug_info) { + yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2 = (yasm_dbgfmt_dwarf2 *)object->dbgfmt; int new; yasm_section *debug_aranges; yasm_bytecode *bc; @@ -89,7 +90,7 @@ yasm_dwarf2__generate_aranges(yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2, dwarf2_aranges_info info; debug_aranges = - yasm_object_get_general(dbgfmt_dwarf2->object, ".debug_aranges", 0, + yasm_object_get_general(object, ".debug_aranges", 0, 2*dbgfmt_dwarf2->sizeof_address, 0, 0, &new, 0); @@ -106,9 +107,10 @@ yasm_dwarf2__generate_aranges(yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2, yasm_bc_calc_len(bc, NULL, NULL); info.debug_aranges = debug_aranges; + info.object = object; info.dbgfmt_dwarf2 = dbgfmt_dwarf2; - yasm_object_sections_traverse(dbgfmt_dwarf2->object, (void *)&info, + yasm_object_sections_traverse(object, (void *)&info, dwarf2_generate_aranges_section); /* Terminate with empty address range descriptor */ diff --git a/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c b/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c index d6ed56ea..eb76fa30 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c +++ b/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c @@ -34,7 +34,6 @@ #include "dwarf2-dbgfmt.h" struct dwarf2_head { - yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2; yasm_bytecode *start_prevbc; yasm_bytecode *end_prevbc; /*@null@*/ yasm_section *debug_ptr; @@ -78,7 +77,7 @@ yasm_dbgfmt_module yasm_dwarf2_LTX_dbgfmt; static /*@null@*/ /*@only@*/ yasm_dbgfmt * -dwarf2_dbgfmt_create(yasm_object *object, yasm_objfmt *of, yasm_arch *a) +dwarf2_dbgfmt_create(yasm_object *object) { yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2 = yasm_xmalloc(sizeof(yasm_dbgfmt_dwarf2)); @@ -86,11 +85,6 @@ dwarf2_dbgfmt_create(yasm_object *object, yasm_objfmt *of, yasm_arch *a) dbgfmt_dwarf2->dbgfmt.module = &yasm_dwarf2_LTX_dbgfmt; - dbgfmt_dwarf2->object = object; - dbgfmt_dwarf2->symtab = yasm_object_get_symtab(object); - dbgfmt_dwarf2->linemap = yasm_object_get_linemap(object); - dbgfmt_dwarf2->arch = a; - dbgfmt_dwarf2->dirs_allocated = 32; dbgfmt_dwarf2->dirs_size = 0; dbgfmt_dwarf2->dirs = @@ -108,7 +102,7 @@ dwarf2_dbgfmt_create(yasm_object *object, yasm_objfmt *of, yasm_arch *a) dbgfmt_dwarf2->format = DWARF2_FORMAT_32BIT; /* TODO: flexible? */ - dbgfmt_dwarf2->sizeof_address = yasm_arch_get_address_size(a)/8; + dbgfmt_dwarf2->sizeof_address = yasm_arch_get_address_size(object->arch)/8; switch (dbgfmt_dwarf2->format) { case DWARF2_FORMAT_32BIT: dbgfmt_dwarf2->sizeof_offset = 4; @@ -117,7 +111,7 @@ dwarf2_dbgfmt_create(yasm_object *object, yasm_objfmt *of, yasm_arch *a) dbgfmt_dwarf2->sizeof_offset = 8; break; } - dbgfmt_dwarf2->min_insn_len = yasm_arch_min_insn_len(a); + dbgfmt_dwarf2->min_insn_len = yasm_arch_min_insn_len(object->arch); return (yasm_dbgfmt *)dbgfmt_dwarf2; } @@ -154,16 +148,17 @@ yasm_dwarf2__append_bc(yasm_section *sect, yasm_bytecode *bc) } static void -dwarf2_dbgfmt_generate(yasm_dbgfmt *dbgfmt, yasm_errwarns *errwarns) +dwarf2_dbgfmt_generate(yasm_object *object, yasm_linemap *linemap, + yasm_errwarns *errwarns) { - yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2 = (yasm_dbgfmt_dwarf2 *)dbgfmt; + yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2 = (yasm_dbgfmt_dwarf2 *)object->dbgfmt; size_t num_line_sections; /*@null@*/ yasm_section *debug_info, *debug_line, *main_code; /* If we don't have any .file directives, generate line information * based on the asm source. */ - debug_line = yasm_dwarf2__generate_line(dbgfmt_dwarf2, errwarns, + debug_line = yasm_dwarf2__generate_line(object, linemap, errwarns, dbgfmt_dwarf2->filenames_size == 0, &main_code, &num_line_sections); @@ -171,14 +166,13 @@ dwarf2_dbgfmt_generate(yasm_dbgfmt *dbgfmt, yasm_errwarns *errwarns) * set of .debug_info, .debug_aranges, and .debug_abbrev so that the * .debug_line we're generating is actually useful. */ - debug_info = yasm_object_find_general(dbgfmt_dwarf2->object, ".debug_info"); + debug_info = yasm_object_find_general(object, ".debug_info"); if (num_line_sections > 0 && (!debug_info || yasm_section_bcs_first(debug_info) == yasm_section_bcs_last(debug_info))) { - debug_info = yasm_dwarf2__generate_info(dbgfmt_dwarf2, debug_line, - main_code); - yasm_dwarf2__generate_aranges(dbgfmt_dwarf2, debug_info); - /*yasm_dwarf2__generate_pubnames(dbgfmt_dwarf2, debug_info);*/ + debug_info = yasm_dwarf2__generate_info(object, debug_line, main_code); + yasm_dwarf2__generate_aranges(object, debug_info); + /*yasm_dwarf2__generate_pubnames(object, debug_info);*/ } } @@ -202,7 +196,6 @@ yasm_dwarf2__add_head yasm_bytecode *bc; head = yasm_xmalloc(sizeof(dwarf2_head)); - head->dbgfmt_dwarf2 = dbgfmt_dwarf2; head->start_prevbc = yasm_section_bcs_last(sect); bc = yasm_bc_create_common(&dwarf2_head_bc_callback, head, 0); @@ -260,8 +253,9 @@ dwarf2_head_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, yasm_output_value_func output_value, yasm_output_reloc_func output_reloc) { + yasm_object *object = yasm_section_get_object(bc->section); + yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2 = (yasm_dbgfmt_dwarf2 *)object->dbgfmt; dwarf2_head *head = (dwarf2_head *)bc->contents; - yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2 = head->dbgfmt_dwarf2; unsigned char *buf = *bufp; yasm_intnum *intn, *cval; @@ -276,7 +270,7 @@ dwarf2_head_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, cval = yasm_intnum_create_uint(dbgfmt_dwarf2->sizeof_offset); intn = yasm_calc_bc_dist(head->start_prevbc, head->end_prevbc); yasm_intnum_calc(intn, YASM_EXPR_SUB, cval); - yasm_arch_intnum_tobytes(dbgfmt_dwarf2->arch, intn, buf, + yasm_arch_intnum_tobytes(object->arch, intn, buf, dbgfmt_dwarf2->sizeof_offset, dbgfmt_dwarf2->sizeof_offset*8, 0, bc, 0); buf += dbgfmt_dwarf2->sizeof_offset; @@ -284,14 +278,14 @@ dwarf2_head_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, /* DWARF version */ yasm_intnum_set_uint(cval, 2); - yasm_arch_intnum_tobytes(dbgfmt_dwarf2->arch, cval, buf, 2, 16, 0, bc, 0); + yasm_arch_intnum_tobytes(object->arch, cval, buf, 2, 16, 0, bc, 0); buf += 2; /* Pointer to another debug section */ if (head->debug_ptr) { yasm_value value; yasm_value_init_sym(&value, - yasm_dwarf2__bc_sym(dbgfmt_dwarf2->symtab, + yasm_dwarf2__bc_sym(object->symtab, yasm_section_bcs_first(head->debug_ptr)), dbgfmt_dwarf2->sizeof_offset*8); output_value(&value, buf, dbgfmt_dwarf2->sizeof_offset, @@ -337,13 +331,10 @@ dwarf2_section_data_print(void *data, FILE *f, int indent_level) } static int -dwarf2_dbgfmt_directive(yasm_dbgfmt *dbgfmt, const char *name, - yasm_section *sect, yasm_valparamhead *valparams, - unsigned long line) +dwarf2_dbgfmt_directive(yasm_object *object, const char *name, + yasm_valparamhead *valparams, unsigned long line) { - yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2 = (yasm_dbgfmt_dwarf2 *)dbgfmt; - return yasm_dwarf2__line_directive(dbgfmt_dwarf2, name, sect, valparams, - line); + return yasm_dwarf2__line_directive(object, name, valparams, line); } /* Define dbgfmt structure -- see dbgfmt.h for details */ diff --git a/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.h b/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.h index c60b8f0e..1c361b0c 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.h +++ b/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.h @@ -40,11 +40,6 @@ typedef struct { typedef struct yasm_dbgfmt_dwarf2 { yasm_dbgfmt_base dbgfmt; /* base structure */ - yasm_object *object; - yasm_symtab *symtab; - yasm_linemap *linemap; - yasm_arch *arch; - char **dirs; unsigned long dirs_size; unsigned long dirs_allocated; @@ -109,24 +104,24 @@ void yasm_dwarf2__set_head_end(dwarf2_head *head, yasm_bytecode *end_prevbc); /* Line number functions */ yasm_section *yasm_dwarf2__generate_line - (yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2, yasm_errwarns *errwarns, + (yasm_object *object, yasm_linemap *linemap, yasm_errwarns *errwarns, int asm_source, /*@out@*/ yasm_section **main_code, /*@out@*/ size_t *num_line_sections); int yasm_dwarf2__line_directive - (yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2, const char *name, yasm_section *sect, - yasm_valparamhead *valparams, unsigned long line); + (yasm_object *object, const char *name, yasm_valparamhead *valparams, + unsigned long line); /* Address range table functions */ -yasm_section *yasm_dwarf2__generate_aranges(yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2, +yasm_section *yasm_dwarf2__generate_aranges(yasm_object *object, yasm_section *debug_info); /* Name lookup table functions */ -yasm_section *yasm_dwarf2__generate_pubnames(yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2, +yasm_section *yasm_dwarf2__generate_pubnames(yasm_object *object, yasm_section *debug_info); /* Information functions */ yasm_section *yasm_dwarf2__generate_info - (yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2, yasm_section *debug_line, + (yasm_object *object, yasm_section *debug_line, /*@null@*/ yasm_section *main_code); #endif diff --git a/modules/dbgfmts/dwarf2/dwarf2-info.c b/modules/dbgfmts/dwarf2/dwarf2-info.c index 48923135..f17db488 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-info.c +++ b/modules/dbgfmts/dwarf2/dwarf2-info.c @@ -266,20 +266,19 @@ dwarf2_append_str(yasm_section *sect, const char *str) } yasm_section * -yasm_dwarf2__generate_info(yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2, - yasm_section *debug_line, yasm_section *main_code) +yasm_dwarf2__generate_info(yasm_object *object, yasm_section *debug_line, + yasm_section *main_code) { + yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2 = (yasm_dbgfmt_dwarf2 *)object->dbgfmt; int new; yasm_bytecode *abc; dwarf2_abbrev *abbrev; dwarf2_head *head; char *buf; yasm_section *debug_abbrev = - yasm_object_get_general(dbgfmt_dwarf2->object, ".debug_abbrev", 0, - 4, 0, 0, &new, 0); + yasm_object_get_general(object, ".debug_abbrev", 0, 4, 0, 0, &new, 0); yasm_section *debug_info = - yasm_object_get_general(dbgfmt_dwarf2->object, ".debug_info", 0, 4, 0, - 0, &new, 0); + yasm_object_get_general(object, ".debug_info", 0, 4, 0, 0, &new, 0); yasm_section_set_align(debug_abbrev, 0, 0); yasm_section_set_align(debug_info, 0, 0); @@ -311,13 +310,13 @@ yasm_dwarf2__generate_info(yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2, abc->len += dwarf2_add_abbrev_attr(abbrev, DW_AT_stmt_list, DW_FORM_data4); dwarf2_append_expr(debug_info, yasm_expr_create_ident(yasm_expr_sym( - yasm_dwarf2__bc_sym(dbgfmt_dwarf2->symtab, + yasm_dwarf2__bc_sym(object->symtab, yasm_section_bcs_first(debug_line))), 0), dbgfmt_dwarf2->sizeof_offset, 0); if (main_code) { yasm_symrec *first; - first = yasm_dwarf2__bc_sym(dbgfmt_dwarf2->symtab, + first = yasm_dwarf2__bc_sym(object->symtab, yasm_section_bcs_first(main_code)); /* All code is contiguous in one section */ abc->len += dwarf2_add_abbrev_attr(abbrev, DW_AT_low_pc, DW_FORM_addr); @@ -336,8 +335,7 @@ yasm_dwarf2__generate_info(yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2, /* input filename */ abc->len += dwarf2_add_abbrev_attr(abbrev, DW_AT_name, DW_FORM_string); - dwarf2_append_str(debug_info, - yasm_object_get_source_fn(dbgfmt_dwarf2->object)); + dwarf2_append_str(debug_info, object->src_filename); /* compile directory (current working directory) */ abc->len += dwarf2_add_abbrev_attr(abbrev, DW_AT_comp_dir, DW_FORM_string); diff --git a/modules/dbgfmts/dwarf2/dwarf2-line.c b/modules/dbgfmts/dwarf2/dwarf2-line.c index c5718872..c38fda4c 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-line.c +++ b/modules/dbgfmts/dwarf2/dwarf2-line.c @@ -111,7 +111,6 @@ typedef struct dwarf2_line_state { } dwarf2_line_state; typedef struct dwarf2_spp { - yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2; yasm_bytecode *line_start_prevbc; yasm_bytecode *line_end_prevbc; } dwarf2_spp; @@ -445,6 +444,8 @@ dwarf2_dbgfmt_gen_line_op(yasm_section *debug_line, dwarf2_line_state *state, typedef struct dwarf2_line_bc_info { yasm_section *debug_line; + yasm_object *object; + yasm_linemap *linemap; yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2; dwarf2_line_state *state; dwarf2_loc loc; @@ -475,8 +476,7 @@ dwarf2_generate_line_bc(yasm_bytecode *bc, /*@null@*/ void *d) } } - yasm_linemap_lookup(dbgfmt_dwarf2->linemap, bc->line, &filename, - &info->loc.line); + yasm_linemap_lookup(info->linemap, bc->line, &filename, &info->loc.line); /* Find file index; just linear search it unless it was the last used */ if (info->lastfile > 0 && strcmp(filename, dbgfmt_dwarf2->filenames[info->lastfile-1].pathname) @@ -500,6 +500,8 @@ dwarf2_generate_line_bc(yasm_bytecode *bc, /*@null@*/ void *d) typedef struct dwarf2_line_info { yasm_section *debug_line; /* section to which line number info goes */ + yasm_object *object; + yasm_linemap *linemap; yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2; yasm_errwarns *errwarns; @@ -552,6 +554,8 @@ dwarf2_generate_line_section(yasm_section *sect, /*@null@*/ void *d) dwarf2_line_bc_info bcinfo; bcinfo.debug_line = info->debug_line; + bcinfo.object = info->object; + bcinfo.linemap = info->linemap; bcinfo.dbgfmt_dwarf2 = dbgfmt_dwarf2; bcinfo.state = &state; bcinfo.lastfile = 0; @@ -618,11 +622,12 @@ dwarf2_generate_filename(const char *filename, void *d) } yasm_section * -yasm_dwarf2__generate_line(yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2, +yasm_dwarf2__generate_line(yasm_object *object, yasm_linemap *linemap, yasm_errwarns *errwarns, int asm_source, /*@out@*/ yasm_section **main_code, /*@out@*/ size_t *num_line_sections) { + yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2 = (yasm_dbgfmt_dwarf2 *)object->dbgfmt; dwarf2_line_info info; int new; size_t i; @@ -632,17 +637,18 @@ yasm_dwarf2__generate_line(yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2, if (asm_source) { /* Generate dirs and filenames based on linemap */ - yasm_linemap_traverse_filenames(dbgfmt_dwarf2->linemap, dbgfmt_dwarf2, + yasm_linemap_traverse_filenames(linemap, dbgfmt_dwarf2, dwarf2_generate_filename); } info.num_sections = 0; info.last_code = NULL; info.asm_source = asm_source; + info.object = object; + info.linemap = linemap; info.dbgfmt_dwarf2 = dbgfmt_dwarf2; - info.debug_line = yasm_object_get_general(dbgfmt_dwarf2->object, - ".debug_line", 0, 1, 0, 0, &new, - 0); + info.debug_line = yasm_object_get_general(object, ".debug_line", 0, 1, 0, + 0, &new, 0); last = yasm_section_bcs_last(info.debug_line); /* header */ @@ -650,7 +656,6 @@ yasm_dwarf2__generate_line(yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2, /* statement program prologue */ spp = yasm_xmalloc(sizeof(dwarf2_spp)); - spp->dbgfmt_dwarf2 = dbgfmt_dwarf2; sppbc = yasm_bc_create_common(&dwarf2_spp_bc_callback, spp, 0); sppbc->len = dbgfmt_dwarf2->sizeof_offset + 5 + NELEMS(line_opcode_num_operands); @@ -676,7 +681,7 @@ yasm_dwarf2__generate_line(yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2, yasm_dwarf2__append_bc(info.debug_line, sppbc); /* statement program */ - yasm_object_sections_traverse(dbgfmt_dwarf2->object, (void *)&info, + yasm_object_sections_traverse(object, (void *)&info, dwarf2_generate_line_section); /* mark end of line information */ @@ -716,8 +721,8 @@ dwarf2_spp_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, yasm_output_value_func output_value, yasm_output_reloc_func output_reloc) { - dwarf2_spp *spp = (dwarf2_spp *)bc->contents; - yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2 = spp->dbgfmt_dwarf2; + yasm_object *object = yasm_section_get_object(bc->section); + yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2 = (yasm_dbgfmt_dwarf2 *)object->dbgfmt; unsigned char *buf = *bufp; yasm_intnum *cval; size_t i, len; @@ -725,7 +730,7 @@ dwarf2_spp_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, /* Prologue length (following this field) */ cval = yasm_intnum_create_uint(bc->len - (unsigned long)(buf-*bufp) - dbgfmt_dwarf2->sizeof_offset); - yasm_arch_intnum_tobytes(dbgfmt_dwarf2->arch, cval, buf, + yasm_arch_intnum_tobytes(object->arch, cval, buf, dbgfmt_dwarf2->sizeof_offset, dbgfmt_dwarf2->sizeof_offset*8, 0, bc, 0); buf += dbgfmt_dwarf2->sizeof_offset; @@ -822,10 +827,10 @@ dwarf2_line_op_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, } int -yasm_dwarf2__line_directive(yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2, - const char *name, yasm_section *sect, +yasm_dwarf2__line_directive(yasm_object *object, const char *name, yasm_valparamhead *valparams, unsigned long line) { + yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2 = (yasm_dbgfmt_dwarf2 *)object->dbgfmt; yasm_valparam *vp; if (yasm__strcasecmp(name, "loc") == 0) { /*@dependent@*/ /*@null@*/ const yasm_intnum *intn; @@ -870,11 +875,13 @@ yasm_dwarf2__line_directive(yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2, loc->line = yasm_intnum_get_uint(intn); /* Generate new section data if it doesn't already exist */ - dsd = yasm_section_get_data(sect, &yasm_dwarf2__section_data_cb); + dsd = yasm_section_get_data(object->cur_section, + &yasm_dwarf2__section_data_cb); if (!dsd) { dsd = yasm_xmalloc(sizeof(dwarf2_section_data)); STAILQ_INIT(&dsd->locs); - yasm_section_add_data(sect, &yasm_dwarf2__section_data_cb, dsd); + yasm_section_add_data(object->cur_section, + &yasm_dwarf2__section_data_cb, dsd); } /* Defaults for optional settings */ @@ -978,7 +985,7 @@ yasm_dwarf2__line_directive(yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2, vp = yasm_vps_first(valparams); if (vp->val) { /* Just a bare filename */ - yasm_object_set_source_fn(dbgfmt_dwarf2->object, vp->val); + yasm_object_set_source_fn(object, vp->val); return 0; } diff --git a/modules/dbgfmts/null/null-dbgfmt.c b/modules/dbgfmts/null/null-dbgfmt.c index 0ec4928f..9ddf776d 100644 --- a/modules/dbgfmts/null/null-dbgfmt.c +++ b/modules/dbgfmts/null/null-dbgfmt.c @@ -35,7 +35,7 @@ yasm_dbgfmt_module yasm_null_LTX_dbgfmt; static /*@null@*/ /*@only@*/ yasm_dbgfmt * -null_dbgfmt_create(yasm_object *object, yasm_objfmt *of, yasm_arch *a) +null_dbgfmt_create(yasm_object *object) { yasm_dbgfmt_base *dbgfmt = yasm_xmalloc(sizeof(yasm_dbgfmt_base)); dbgfmt->module = &yasm_null_LTX_dbgfmt; @@ -49,15 +49,15 @@ null_dbgfmt_destroy(/*@only@*/ yasm_dbgfmt *dbgfmt) } static int -null_dbgfmt_directive(yasm_dbgfmt *dbgfmt, const char *name, - yasm_section *sect, yasm_valparamhead *valparams, - unsigned long line) +null_dbgfmt_directive(yasm_object *object, const char *name, + yasm_valparamhead *valparams, unsigned long line) { return 1; } static void -null_dbgfmt_generate(yasm_dbgfmt *dbgfmt, yasm_errwarns *errwarns) +null_dbgfmt_generate(yasm_object *object, yasm_linemap *linemap, + yasm_errwarns *errwarns) { } diff --git a/modules/dbgfmts/stabs/stabs-dbgfmt.c b/modules/dbgfmts/stabs/stabs-dbgfmt.c index 0df12a6c..5bf6b8ad 100644 --- a/modules/dbgfmts/stabs/stabs-dbgfmt.c +++ b/modules/dbgfmts/stabs/stabs-dbgfmt.c @@ -82,11 +82,6 @@ typedef enum { typedef struct yasm_dbgfmt_stabs { yasm_dbgfmt_base dbgfmt; /* base structure */ - - yasm_object *object; - yasm_symtab *symtab; - yasm_linemap *linemap; - yasm_arch *arch; } yasm_dbgfmt_stabs; typedef struct { @@ -103,7 +98,8 @@ typedef struct { yasm_bytecode *basebc; /* base bytecode from which to track SLINEs */ - yasm_dbgfmt_stabs *dbgfmt_stabs; + yasm_object *object; + yasm_linemap *linemap; yasm_errwarns *errwarns; } stabs_info; @@ -165,14 +161,10 @@ yasm_dbgfmt_module yasm_stabs_LTX_dbgfmt; static /*@null@*/ /*@only@*/ yasm_dbgfmt * -stabs_dbgfmt_create(yasm_object *object, yasm_objfmt *of, yasm_arch *a) +stabs_dbgfmt_create(yasm_object *object) { yasm_dbgfmt_stabs *dbgfmt_stabs = yasm_xmalloc(sizeof(yasm_dbgfmt_stabs)); dbgfmt_stabs->dbgfmt.module = &yasm_stabs_LTX_dbgfmt; - dbgfmt_stabs->object = object; - dbgfmt_stabs->symtab = yasm_object_get_symtab(object); - dbgfmt_stabs->linemap = yasm_object_get_linemap(object); - dbgfmt_stabs->arch = a; return (yasm_dbgfmt *)dbgfmt_stabs; } @@ -263,7 +255,7 @@ static int stabs_dbgfmt_generate_bcs(yasm_bytecode *bc, void *d) { stabs_info *info = (stabs_info *)d; - yasm_linemap_lookup(info->dbgfmt_stabs->linemap, bc->line, &info->curfile, + yasm_linemap_lookup(info->linemap, bc->line, &info->curfile, &info->curline); /* check for new function */ @@ -309,8 +301,8 @@ stabs_dbgfmt_generate_sections(yasm_section *sect, /*@null@*/ void *d) /* Close out last function by appending a null SO stab after last bc */ yasm_bytecode *bc = yasm_section_bcs_last(sect); yasm_symrec *sym = - yasm_symtab_define_label(yasm_object_get_symtab( - yasm_section_get_object(sect)), ".n_so", bc, 1, bc->line); + yasm_symtab_define_label(info->object->symtab, ".n_so", bc, 1, + bc->line); stabs_dbgfmt_append_stab(info, info->stab, 0, N_SO, 0, sym, bc, 0); } @@ -318,9 +310,9 @@ stabs_dbgfmt_generate_sections(yasm_section *sect, /*@null@*/ void *d) } static void -stabs_dbgfmt_generate(yasm_dbgfmt *dbgfmt, yasm_errwarns *errwarns) +stabs_dbgfmt_generate(yasm_object *object, yasm_linemap *linemap, + yasm_errwarns *errwarns) { - yasm_dbgfmt_stabs *dbgfmt_stabs = (yasm_dbgfmt_stabs *)dbgfmt; stabs_info info; int new; yasm_bytecode *dbgbc; @@ -330,18 +322,18 @@ stabs_dbgfmt_generate(yasm_dbgfmt *dbgfmt, yasm_errwarns *errwarns) yasm_section *stext; /* Stablen is determined by arch/machine */ - if (yasm__strcasecmp(yasm_arch_keyword(dbgfmt_stabs->arch), "x86") == 0) { + if (yasm__strcasecmp(yasm_arch_keyword(object->arch), "x86") == 0) { info.stablen = 12; } else /* unknown machine; generate nothing */ return; - info.dbgfmt_stabs = dbgfmt_stabs; + info.object = object; + info.linemap = linemap; info.errwarns = errwarns; info.lastline = 0; info.stabcount = 0; - info.stab = yasm_object_get_general(dbgfmt_stabs->object, ".stab", 0, 4, 0, - 0, &new, 0); + info.stab = yasm_object_get_general(object, ".stab", 0, 4, 0, 0, &new, 0); if (!new) { yasm_bytecode *last = yasm_section_bcs_last(info.stab); if (last == NULL) { @@ -356,8 +348,8 @@ stabs_dbgfmt_generate(yasm_dbgfmt *dbgfmt, yasm_errwarns *errwarns) } } - info.stabstr = yasm_object_get_general(dbgfmt_stabs->object, ".stabstr", 0, - 1, 0, 0, &new, 0); + info.stabstr = + yasm_object_get_general(object, ".stabstr", 0, 1, 0, 0, &new, 0); if (!new) { yasm_bytecode *last = yasm_section_bcs_last(info.stabstr); if (last == NULL) { @@ -381,17 +373,16 @@ stabs_dbgfmt_generate(yasm_dbgfmt *dbgfmt, yasm_errwarns *errwarns) /* initial strtab bytecodes */ nullbc = stabs_dbgfmt_append_bcstr(info.stabstr, ""); - filebc = stabs_dbgfmt_append_bcstr(info.stabstr, - yasm_object_get_source_fn(dbgfmt_stabs->object)); + filebc = stabs_dbgfmt_append_bcstr(info.stabstr, object->src_filename); - stext = yasm_object_find_general(dbgfmt_stabs->object, ".text"); - firstsym = yasm_symtab_use(dbgfmt_stabs->symtab, ".text", 0); + stext = yasm_object_find_general(object, ".text"); + firstsym = yasm_symtab_use(object->symtab, ".text", 0); firstbc = yasm_section_bcs_first(stext); /* N_SO file stab */ stabs_dbgfmt_append_stab(&info, info.stab, filebc, N_SO, 0, firstsym, firstbc, 0); - yasm_object_sections_traverse(dbgfmt_stabs->object, (void *)&info, + yasm_object_sections_traverse(object, (void *)&info, stabs_dbgfmt_generate_sections); /* fill initial pseudo-stab's fields */ @@ -509,9 +500,8 @@ stabs_bc_str_calc_len(yasm_bytecode *bc, yasm_bc_add_span_func add_span, } static int -stabs_dbgfmt_directive(yasm_dbgfmt *dbgfmt, const char *name, - yasm_section *sect, yasm_valparamhead *valparams, - unsigned long line) +stabs_dbgfmt_directive(yasm_object *object, const char *name, + yasm_valparamhead *valparams, unsigned long line) { return 1; } diff --git a/modules/objfmts/bin/bin-objfmt.c b/modules/objfmts/bin/bin-objfmt.c index e89efaf2..b98ac63a 100644 --- a/modules/objfmts/bin/bin-objfmt.c +++ b/modules/objfmts/bin/bin-objfmt.c @@ -37,23 +37,16 @@ typedef struct yasm_objfmt_bin { yasm_objfmt_base objfmt; /* base structure */ - - yasm_object *object; - yasm_symtab *symtab; - /*@dependent@*/ yasm_arch *arch; } yasm_objfmt_bin; yasm_objfmt_module yasm_bin_LTX_objfmt; static yasm_objfmt * -bin_objfmt_create(yasm_object *object, yasm_arch *a) +bin_objfmt_create(yasm_object *object) { yasm_objfmt_bin *objfmt_bin = yasm_xmalloc(sizeof(yasm_objfmt_bin)); objfmt_bin->objfmt.module = &yasm_bin_LTX_objfmt; - objfmt_bin->object = object; - objfmt_bin->symtab = yasm_object_get_symtab(object); - objfmt_bin->arch = a; return (yasm_objfmt *)objfmt_bin; } @@ -91,7 +84,7 @@ bin_objfmt_align_section(yasm_section *sect, yasm_section *prevsect, } typedef struct bin_objfmt_output_info { - yasm_objfmt_bin *objfmt_bin; + yasm_object *object; /*@dependent@*/ FILE *f; /*@only@*/ unsigned char *buf; /*@observer@*/ const yasm_section *sect; @@ -169,7 +162,7 @@ bin_objfmt_output_value(yasm_value *value, unsigned char *buf, /* Output */ switch (yasm_value_output_basic(value, buf, destsize, bc, warn, - info->objfmt_bin->arch)) { + info->object->arch)) { case -1: return 1; case 0: @@ -200,7 +193,7 @@ bin_objfmt_output_value(yasm_value *value, unsigned char *buf, yasm_intnum_calc(outval, YASM_EXPR_ADD, yasm_expr_get_intnum(&value->abs, 1)); /* Output! */ - if (yasm_arch_intnum_tobytes(info->objfmt_bin->arch, outval, buf, + if (yasm_arch_intnum_tobytes(info->object->arch, outval, buf, destsize, valsize, 0, bc, warn)) retval = 1; yasm_intnum_destroy(outval); @@ -260,10 +253,9 @@ bin_objfmt_output_bytecode(yasm_bytecode *bc, /*@null@*/ void *d) } static void -bin_objfmt_output(yasm_objfmt *objfmt, FILE *f, /*@unused@*/ int all_syms, - /*@unused@*/ yasm_dbgfmt *df, yasm_errwarns *errwarns) +bin_objfmt_output(yasm_object *object, FILE *f, /*@unused@*/ int all_syms, + yasm_errwarns *errwarns) { - yasm_objfmt_bin *objfmt_bin = (yasm_objfmt_bin *)objfmt; /*@observer@*/ /*@null@*/ yasm_section *text, *data, *bss, *prevsect; /*@null@*/ yasm_expr *startexpr; /*@dependent@*/ /*@null@*/ const yasm_intnum *startnum; @@ -273,13 +265,13 @@ bin_objfmt_output(yasm_objfmt *objfmt, FILE *f, /*@unused@*/ int all_syms, unsigned long i; bin_objfmt_output_info info; - info.objfmt_bin = objfmt_bin; + info.object = object; info.f = f; info.buf = yasm_xmalloc(REGULAR_OUTBUF_SIZE); - text = yasm_object_find_general(objfmt_bin->object, ".text"); - data = yasm_object_find_general(objfmt_bin->object, ".data"); - bss = yasm_object_find_general(objfmt_bin->object, ".bss"); + text = yasm_object_find_general(object, ".text"); + data = yasm_object_find_general(object, ".data"); + bss = yasm_object_find_general(object, ".bss"); if (!text) yasm_internal_error(N_("No `.text' section in bin objfmt output")); @@ -361,37 +353,33 @@ bin_objfmt_destroy(yasm_objfmt *objfmt) } static void -bin_objfmt_init_new_section(yasm_objfmt_bin *objfmt_bin, yasm_section *sect, +bin_objfmt_init_new_section(yasm_object *object, yasm_section *sect, const char *sectname, unsigned long line) { - yasm_symtab_define_label( - yasm_object_get_symtab(objfmt_bin->object), sectname, - yasm_section_bcs_first(sect), 1, line); + yasm_symtab_define_label(object->symtab, sectname, + yasm_section_bcs_first(sect), 1, line); } static yasm_section * -bin_objfmt_add_default_section(yasm_objfmt *objfmt) +bin_objfmt_add_default_section(yasm_object *object) { - yasm_objfmt_bin *objfmt_bin = (yasm_objfmt_bin *)objfmt; yasm_section *retval; int isnew; - retval = yasm_object_get_general(objfmt_bin->object, ".text", 0, 16, 1, 0, - &isnew, 0); + retval = yasm_object_get_general(object, ".text", 0, 16, 1, 0, &isnew, 0); if (isnew) { - bin_objfmt_init_new_section(objfmt_bin, retval, ".text", 0); + bin_objfmt_init_new_section(object, retval, ".text", 0); yasm_section_set_default(retval, 1); } return retval; } static /*@observer@*/ /*@null@*/ yasm_section * -bin_objfmt_section_switch(yasm_objfmt *objfmt, yasm_valparamhead *valparams, +bin_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, /*@unused@*/ /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line) { - yasm_objfmt_bin *objfmt_bin = (yasm_objfmt_bin *)objfmt; yasm_valparam *vp; yasm_section *retval; int isnew; @@ -459,13 +447,13 @@ bin_objfmt_section_switch(yasm_objfmt *objfmt, yasm_valparamhead *valparams, } } - retval = yasm_object_get_general(objfmt_bin->object, sectname, + retval = yasm_object_get_general(object, sectname, yasm_expr_create_ident( yasm_expr_int(yasm_intnum_create_uint(start)), line), align, strcmp(sectname, ".text") == 0, resonly, &isnew, line); if (isnew) - bin_objfmt_init_new_section(objfmt_bin, retval, sectname, line); + bin_objfmt_init_new_section(object, retval, sectname, line); if (isnew || yasm_section_is_default(retval)) { yasm_section_set_default(retval, 0); @@ -480,61 +468,57 @@ bin_objfmt_section_switch(yasm_objfmt *objfmt, yasm_valparamhead *valparams, } static yasm_symrec * -bin_objfmt_extern_declare(yasm_objfmt *objfmt, const char *name, +bin_objfmt_extern_declare(yasm_object *object, const char *name, /*@unused@*/ /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line) { - yasm_objfmt_bin *objfmt_bin = (yasm_objfmt_bin *)objfmt; yasm_symrec *sym; yasm_warn_set(YASM_WARN_GENERAL, N_("binary object format does not support extern variables")); - sym = yasm_symtab_declare(objfmt_bin->symtab, name, YASM_SYM_EXTERN, line); + sym = yasm_symtab_declare(object->symtab, name, YASM_SYM_EXTERN, line); return sym; } static yasm_symrec * -bin_objfmt_global_declare(yasm_objfmt *objfmt, const char *name, +bin_objfmt_global_declare(yasm_object *object, const char *name, /*@unused@*/ /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line) { - yasm_objfmt_bin *objfmt_bin = (yasm_objfmt_bin *)objfmt; yasm_symrec *sym; yasm_warn_set(YASM_WARN_GENERAL, N_("binary object format does not support global variables")); - sym = yasm_symtab_declare(objfmt_bin->symtab, name, YASM_SYM_GLOBAL, line); + sym = yasm_symtab_declare(object->symtab, name, YASM_SYM_GLOBAL, line); return sym; } static yasm_symrec * -bin_objfmt_common_declare(yasm_objfmt *objfmt, const char *name, +bin_objfmt_common_declare(yasm_object *object, const char *name, /*@only@*/ yasm_expr *size, /*@unused@*/ /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line) { - yasm_objfmt_bin *objfmt_bin = (yasm_objfmt_bin *)objfmt; yasm_symrec *sym; yasm_expr_destroy(size); yasm_error_set(YASM_ERROR_TYPE, N_("binary object format does not support common variables")); - sym = yasm_symtab_declare(objfmt_bin->symtab, name, YASM_SYM_COMMON, line); + sym = yasm_symtab_declare(object->symtab, name, YASM_SYM_COMMON, line); return sym; } static int -bin_objfmt_directive(yasm_objfmt *objfmt, const char *name, +bin_objfmt_directive(yasm_object *object, const char *name, /*@null@*/ yasm_valparamhead *valparams, /*@unused@*/ /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line) { - yasm_objfmt_bin *objfmt_bin = (yasm_objfmt_bin *)objfmt; yasm_section *sect; yasm_valparam *vp; @@ -551,8 +535,7 @@ bin_objfmt_directive(yasm_objfmt *objfmt, const char *name, vp = yasm_vps_first(valparams); if (vp->val) start = yasm_expr_create_ident(yasm_expr_sym(yasm_symtab_use( - yasm_object_get_symtab(objfmt_bin->object), vp->val, line)), - line); + object->symtab, vp->val, line)), line); else if (vp->param) { start = vp->param; vp->param = NULL; /* Don't let valparams delete it */ @@ -565,7 +548,7 @@ bin_objfmt_directive(yasm_objfmt *objfmt, const char *name, } /* ORG changes the start of the .text section */ - sect = yasm_object_find_general(objfmt_bin->object, ".text"); + sect = yasm_object_find_general(object, ".text"); if (!sect) yasm_internal_error( N_("bin objfmt: .text section does not exist before ORG is called?")); diff --git a/modules/objfmts/coff/coff-objfmt.c b/modules/objfmts/coff/coff-objfmt.c index efc15c60..feb790af 100644 --- a/modules/objfmts/coff/coff-objfmt.c +++ b/modules/objfmts/coff/coff-objfmt.c @@ -184,18 +184,8 @@ typedef struct yasm_objfmt_coff { unsigned int machine; /* COFF machine to use */ - yasm_object *object; - yasm_symtab *symtab; - /*@dependent@*/ yasm_arch *arch; - coff_symrec_data *filesym_data; /* Data for .file symbol */ - /* Last switched-to section. Used by proc_frame directives to help - * them determine the current assembly position. - * XXX: There should be a better way to do this. - */ - yasm_section *cursect; - /* data for win64 proc_frame and related directives */ unsigned long proc_frame; /* Line number of start of proc, or 0 */ unsigned long done_prolog; /* Line number of end of prologue, or 0 */ @@ -203,6 +193,7 @@ typedef struct yasm_objfmt_coff { } yasm_objfmt_coff; typedef struct coff_objfmt_output_info { + yasm_object *object; yasm_objfmt_coff *objfmt_coff; yasm_errwarns *errwarns; /*@dependent@*/ FILE *f; @@ -258,17 +249,13 @@ coff_objfmt_sym_set_data(yasm_symrec *sym, coff_symrec_sclass sclass, } static yasm_objfmt_coff * -coff_common_create(yasm_object *object, yasm_arch *a) +coff_common_create(yasm_object *object) { yasm_objfmt_coff *objfmt_coff = yasm_xmalloc(sizeof(yasm_objfmt_coff)); yasm_symrec *filesym; - objfmt_coff->object = object; - objfmt_coff->symtab = yasm_object_get_symtab(object); - objfmt_coff->arch = a; - /* Only support x86 arch */ - if (yasm__strcasecmp(yasm_arch_keyword(a), "x86") != 0) { + if (yasm__strcasecmp(yasm_arch_keyword(object->arch), "x86") != 0) { yasm_xfree(objfmt_coff); return NULL; } @@ -276,7 +263,7 @@ coff_common_create(yasm_object *object, yasm_arch *a) objfmt_coff->parse_scnum = 1; /* section numbering starts at 1 */ /* FIXME: misuse of NULL bytecode here; it works, but only barely. */ - filesym = yasm_symtab_define_special(objfmt_coff->symtab, ".file", + filesym = yasm_symtab_define_special(object->symtab, ".file", YASM_SYM_GLOBAL); objfmt_coff->filesym_data = coff_objfmt_sym_set_data(filesym, COFF_SCL_FILE, NULL, 1, @@ -284,8 +271,6 @@ coff_common_create(yasm_object *object, yasm_arch *a) /* Filename is set in coff_objfmt_output */ objfmt_coff->filesym_data->aux[0].fname = NULL; - objfmt_coff->cursect = NULL; - objfmt_coff->proc_frame = 0; objfmt_coff->done_prolog = 0; objfmt_coff->unwind = NULL; @@ -294,17 +279,18 @@ coff_common_create(yasm_object *object, yasm_arch *a) } static yasm_objfmt * -coff_objfmt_create(yasm_object *object, yasm_arch *a) +coff_objfmt_create(yasm_object *object) { - yasm_objfmt_coff *objfmt_coff = coff_common_create(object, a); + yasm_objfmt_coff *objfmt_coff = coff_common_create(object); if (objfmt_coff) { /* Support x86 and amd64 machines of x86 arch */ - if (yasm__strcasecmp(yasm_arch_get_machine(a), "x86") == 0) { + if (yasm__strcasecmp(yasm_arch_get_machine(object->arch), "x86") == 0) objfmt_coff->machine = COFF_MACHINE_I386; - } else if (yasm__strcasecmp(yasm_arch_get_machine(a), "amd64") == 0) { + else if (yasm__strcasecmp(yasm_arch_get_machine(object->arch), + "amd64") == 0) objfmt_coff->machine = COFF_MACHINE_AMD64; - } else { + else { yasm_xfree(objfmt_coff); return NULL; } @@ -317,18 +303,20 @@ coff_objfmt_create(yasm_object *object, yasm_arch *a) } static yasm_objfmt * -win32_objfmt_create(yasm_object *object, yasm_arch *a) +win32_objfmt_create(yasm_object *object) { - yasm_objfmt_coff *objfmt_coff = coff_common_create(object, a); + yasm_objfmt_coff *objfmt_coff = coff_common_create(object); if (objfmt_coff) { /* Support x86 and amd64 machines of x86 arch. * (amd64 machine supported for backwards compatibility) */ - if (yasm__strcasecmp(yasm_arch_get_machine(a), "x86") == 0) { + if (yasm__strcasecmp(yasm_arch_get_machine(object->arch), + "x86") == 0) { objfmt_coff->machine = COFF_MACHINE_I386; objfmt_coff->objfmt.module = &yasm_win32_LTX_objfmt; - } else if (yasm__strcasecmp(yasm_arch_get_machine(a), "amd64") == 0) { + } else if (yasm__strcasecmp(yasm_arch_get_machine(object->arch), + "amd64") == 0) { objfmt_coff->machine = COFF_MACHINE_AMD64; objfmt_coff->objfmt.module = &yasm_win64_LTX_objfmt; objfmt_coff->win64 = 1; @@ -343,13 +331,14 @@ win32_objfmt_create(yasm_object *object, yasm_arch *a) } static yasm_objfmt * -win64_objfmt_create(yasm_object *object, yasm_arch *a) +win64_objfmt_create(yasm_object *object) { - yasm_objfmt_coff *objfmt_coff = coff_common_create(object, a); + yasm_objfmt_coff *objfmt_coff = coff_common_create(object); if (objfmt_coff) { /* Support amd64 machine of x86 arch */ - if (yasm__strcasecmp(yasm_arch_get_machine(a), "amd64") == 0) { + if (yasm__strcasecmp(yasm_arch_get_machine(object->arch), + "amd64") == 0) { objfmt_coff->machine = COFF_MACHINE_AMD64; } else { yasm_xfree(objfmt_coff); @@ -364,9 +353,10 @@ win64_objfmt_create(yasm_object *object, yasm_arch *a) } static coff_section_data * -coff_objfmt_init_new_section(yasm_objfmt_coff *objfmt_coff, yasm_section *sect, +coff_objfmt_init_new_section(yasm_object *object, yasm_section *sect, const char *sectname, unsigned long line) { + yasm_objfmt_coff *objfmt_coff = (yasm_objfmt_coff *)object->objfmt; coff_section_data *data; yasm_symrec *sym; @@ -383,7 +373,7 @@ coff_objfmt_init_new_section(yasm_objfmt_coff *objfmt_coff, yasm_section *sect, data->isdebug = 0; yasm_section_add_data(sect, &coff_section_data_cb, data); - sym = yasm_symtab_define_label(objfmt_coff->symtab, sectname, + sym = yasm_symtab_define_label(object->symtab, sectname, yasm_section_bcs_first(sect), 1, line); yasm_symrec_declare(sym, YASM_SYM_GLOBAL, line); coff_objfmt_sym_set_data(sym, COFF_SCL_STAT, NULL, 1, @@ -407,8 +397,7 @@ coff_objfmt_init_remaining_section(yasm_section *sect, /*@null@*/ void *d) if (!csd) { /* Initialize new one */ const char *sectname = yasm_section_get_name(sect); - csd = coff_objfmt_init_new_section(info->objfmt_coff, sect, sectname, - 0); + csd = coff_objfmt_init_new_section(info->object, sect, sectname, 0); if (yasm__strncasecmp(sectname, ".debug", 6)==0) { csd->flags = COFF_STYP_DATA; if (info->objfmt_coff->win32) @@ -465,7 +454,7 @@ coff_objfmt_output_value(yasm_value *value, unsigned char *buf, * cross-section, or non-PC-relative reference (those are handled below). */ switch (yasm_value_output_basic(value, buf, destsize, bc, warn, - info->objfmt_coff->arch)) { + info->object->arch)) { case -1: return 1; case 0: @@ -695,7 +684,7 @@ coff_objfmt_output_value(yasm_value *value, unsigned char *buf, yasm_intnum_destroy(dist); } - retval = yasm_arch_intnum_tobytes(objfmt_coff->arch, intn, buf, destsize, + retval = yasm_arch_intnum_tobytes(info->object->arch, intn, buf, destsize, valsize, 0, bc, warn); yasm_intnum_destroy(intn); return retval; @@ -1149,10 +1138,10 @@ coff_objfmt_output_str(yasm_symrec *sym, /*@null@*/ void *d) } static void -coff_objfmt_output(yasm_objfmt *objfmt, FILE *f, int all_syms, yasm_dbgfmt *df, +coff_objfmt_output(yasm_object *object, FILE *f, int all_syms, yasm_errwarns *errwarns) { - yasm_objfmt_coff *objfmt_coff = (yasm_objfmt_coff *)objfmt; + yasm_objfmt_coff *objfmt_coff = (yasm_objfmt_coff *)object->objfmt; coff_objfmt_output_info info; unsigned char *localbuf; long pos; @@ -1173,7 +1162,7 @@ coff_objfmt_output(yasm_objfmt *objfmt, FILE *f, int all_syms, yasm_dbgfmt *df, if (objfmt_coff->filesym_data->aux[0].fname) yasm_xfree(objfmt_coff->filesym_data->aux[0].fname); objfmt_coff->filesym_data->aux[0].fname = - yasm__xstrdup(yasm_object_get_source_fn(objfmt_coff->object)); + yasm__xstrdup(object->src_filename); /* Force all syms for win64 because they're needed for relocations. * FIXME: Not *all* syms need to be output, only the ones needed for @@ -1182,6 +1171,7 @@ coff_objfmt_output(yasm_objfmt *objfmt, FILE *f, int all_syms, yasm_dbgfmt *df, all_syms |= objfmt_coff->win64; info.strtab_offset = 4; + info.object = object; info.objfmt_coff = objfmt_coff; info.errwarns = errwarns; info.f = f; @@ -1190,7 +1180,7 @@ coff_objfmt_output(yasm_objfmt *objfmt, FILE *f, int all_syms, yasm_dbgfmt *df, /* Initialize section data (and count in parse_scnum) any sections that * we've not initialized so far. */ - yasm_object_sections_traverse(objfmt_coff->object, &info, + yasm_object_sections_traverse(object, &info, coff_objfmt_init_remaining_section); /* Allocate space for headers by seeking forward */ @@ -1203,7 +1193,7 @@ coff_objfmt_output(yasm_objfmt *objfmt, FILE *f, int all_syms, yasm_dbgfmt *df, /* Finalize symbol table (assign index to each symbol) */ info.indx = 0; info.all_syms = all_syms; - yasm_symtab_traverse(objfmt_coff->symtab, &info, coff_objfmt_count_sym); + yasm_symtab_traverse(object->symtab, &info, coff_objfmt_count_sym); symtab_count = info.indx; /* Section data/relocs */ @@ -1214,12 +1204,12 @@ coff_objfmt_output(yasm_objfmt *objfmt, FILE *f, int all_syms, yasm_dbgfmt *df, * addends in the generated code. */ info.addr = 0; - if (yasm_object_sections_traverse(objfmt_coff->object, &info, + if (yasm_object_sections_traverse(object, &info, coff_objfmt_set_section_addr)) return; } info.addr = 0; - if (yasm_object_sections_traverse(objfmt_coff->object, &info, + if (yasm_object_sections_traverse(object, &info, coff_objfmt_output_section)) return; @@ -1231,13 +1221,12 @@ coff_objfmt_output(yasm_objfmt *objfmt, FILE *f, int all_syms, yasm_dbgfmt *df, return; } symtab_pos = (unsigned long)pos; - yasm_symtab_traverse(objfmt_coff->symtab, &info, coff_objfmt_output_sym); + yasm_symtab_traverse(object->symtab, &info, coff_objfmt_output_sym); /* String table */ yasm_fwrite_32_l(info.strtab_offset, f); /* total length */ - yasm_object_sections_traverse(objfmt_coff->object, &info, - coff_objfmt_output_sectstr); - yasm_symtab_traverse(objfmt_coff->symtab, &info, coff_objfmt_output_str); + yasm_object_sections_traverse(object, &info, coff_objfmt_output_sectstr); + yasm_symtab_traverse(object->symtab, &info, coff_objfmt_output_str); /* Write headers */ if (fseek(f, 0, SEEK_SET) < 0) { @@ -1259,7 +1248,7 @@ coff_objfmt_output(yasm_objfmt *objfmt, FILE *f, int all_syms, yasm_dbgfmt *df, YASM_WRITE_16_L(localbuf, 0); /* size of optional header (none) */ /* flags */ flags = 0; - if (strcmp(yasm_dbgfmt_keyword(df), "null")==0) + if (strcmp(yasm_dbgfmt_keyword(object->dbgfmt), "null")==0) flags = COFF_F_LNNO; if (!all_syms) flags |= COFF_F_LSYMS; @@ -1268,8 +1257,7 @@ coff_objfmt_output(yasm_objfmt *objfmt, FILE *f, int all_syms, yasm_dbgfmt *df, YASM_WRITE_16_L(localbuf, flags); fwrite(info.buf, 20, 1, f); - yasm_object_sections_traverse(objfmt_coff->object, &info, - coff_objfmt_output_secthead); + yasm_object_sections_traverse(object, &info, coff_objfmt_output_secthead); yasm_xfree(info.buf); } @@ -1286,33 +1274,31 @@ coff_objfmt_destroy(yasm_objfmt *objfmt) } static yasm_section * -coff_objfmt_add_default_section(yasm_objfmt *objfmt) +coff_objfmt_add_default_section(yasm_object *object) { - yasm_objfmt_coff *objfmt_coff = (yasm_objfmt_coff *)objfmt; + yasm_objfmt_coff *objfmt_coff = (yasm_objfmt_coff *)object->objfmt; yasm_section *retval; coff_section_data *csd; int isnew; - retval = yasm_object_get_general(objfmt_coff->object, ".text", 0, 16, 1, 0, - &isnew, 0); + retval = yasm_object_get_general(object, ".text", 0, 16, 1, 0, &isnew, 0); if (isnew) { - csd = coff_objfmt_init_new_section(objfmt_coff, retval, ".text", 0); + csd = coff_objfmt_init_new_section(object, retval, ".text", 0); csd->flags = COFF_STYP_TEXT; if (objfmt_coff->win32) csd->flags |= COFF_STYP_EXECUTE | COFF_STYP_READ; yasm_section_set_default(retval, 1); } - objfmt_coff->cursect = retval; return retval; } static /*@observer@*/ /*@null@*/ yasm_section * -coff_objfmt_section_switch(yasm_objfmt *objfmt, yasm_valparamhead *valparams, +coff_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, /*@unused@*/ /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line) { - yasm_objfmt_coff *objfmt_coff = (yasm_objfmt_coff *)objfmt; + yasm_objfmt_coff *objfmt_coff = (yasm_objfmt_coff *)object->objfmt; yasm_valparam *vp = yasm_vps_first(valparams); yasm_section *retval; int isnew; @@ -1588,11 +1574,11 @@ coff_objfmt_section_switch(yasm_objfmt *objfmt, yasm_valparamhead *valparams, N_("Standard COFF does not support qualifier `%s'"), vp->val); } - retval = yasm_object_get_general(objfmt_coff->object, sectname, 0, align, - iscode, resonly, &isnew, line); + retval = yasm_object_get_general(object, sectname, 0, align, iscode, + resonly, &isnew, line); if (isnew) - csd = coff_objfmt_init_new_section(objfmt_coff, retval, sectname, line); + csd = coff_objfmt_init_new_section(object, retval, sectname, line); else csd = yasm_section_get_data(retval, &coff_section_data_cb); @@ -1604,7 +1590,6 @@ coff_objfmt_section_switch(yasm_objfmt *objfmt, yasm_valparamhead *valparams, } else if (flags_override) yasm_warn_set(YASM_WARN_GENERAL, N_("section flags ignored on section redeclaration")); - objfmt_coff->cursect = retval; return retval; } @@ -1646,15 +1631,13 @@ coff_section_data_print(void *data, FILE *f, int indent_level) } static yasm_symrec * -coff_objfmt_extern_declare(yasm_objfmt *objfmt, const char *name, /*@unused@*/ +coff_objfmt_extern_declare(yasm_object *object, const char *name, /*@unused@*/ /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line) { - yasm_objfmt_coff *objfmt_coff = (yasm_objfmt_coff *)objfmt; yasm_symrec *sym; - sym = yasm_symtab_declare(objfmt_coff->symtab, name, YASM_SYM_EXTERN, - line); + sym = yasm_symtab_declare(object->symtab, name, YASM_SYM_EXTERN, line); coff_objfmt_sym_set_data(sym, COFF_SCL_EXT, NULL, 0, COFF_SYMTAB_AUX_NONE); @@ -1662,15 +1645,13 @@ coff_objfmt_extern_declare(yasm_objfmt *objfmt, const char *name, /*@unused@*/ } static yasm_symrec * -coff_objfmt_global_declare(yasm_objfmt *objfmt, const char *name, /*@unused@*/ +coff_objfmt_global_declare(yasm_object *object, const char *name, /*@unused@*/ /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line) { - yasm_objfmt_coff *objfmt_coff = (yasm_objfmt_coff *)objfmt; yasm_symrec *sym; - sym = yasm_symtab_declare(objfmt_coff->symtab, name, YASM_SYM_GLOBAL, - line); + sym = yasm_symtab_declare(object->symtab, name, YASM_SYM_GLOBAL, line); coff_objfmt_sym_set_data(sym, COFF_SCL_EXT, NULL, 0, COFF_SYMTAB_AUX_NONE); @@ -1678,16 +1659,14 @@ coff_objfmt_global_declare(yasm_objfmt *objfmt, const char *name, /*@unused@*/ } static yasm_symrec * -coff_objfmt_common_declare(yasm_objfmt *objfmt, const char *name, +coff_objfmt_common_declare(yasm_object *object, const char *name, /*@only@*/ yasm_expr *size, /*@unused@*/ /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line) { - yasm_objfmt_coff *objfmt_coff = (yasm_objfmt_coff *)objfmt; yasm_symrec *sym; - sym = yasm_symtab_declare(objfmt_coff->symtab, name, YASM_SYM_COMMON, - line); + sym = yasm_symtab_declare(object->symtab, name, YASM_SYM_COMMON, line); coff_objfmt_sym_set_data(sym, COFF_SCL_EXT, size, 0, COFF_SYMTAB_AUX_NONE); @@ -1719,7 +1698,7 @@ coff_symrec_data_print(void *data, FILE *f, int indent_level) } static void -dir_export(yasm_objfmt_coff *objfmt_coff, yasm_valparamhead *valparams, +dir_export(yasm_object *object, yasm_valparamhead *valparams, unsigned long line) { yasm_valparam *vp; @@ -1730,7 +1709,7 @@ dir_export(yasm_objfmt_coff *objfmt_coff, yasm_valparamhead *valparams, /* Reference exported symbol (to generate error if not declared) */ vp = yasm_vps_first(valparams); if (vp->val) - yasm_symtab_use(objfmt_coff->symtab, vp->val, line); + yasm_symtab_use(object->symtab, vp->val, line); else { yasm_error_set(YASM_ERROR_SYNTAX, N_("argument to EXPORT must be symbol name")); @@ -1738,13 +1717,13 @@ dir_export(yasm_objfmt_coff *objfmt_coff, yasm_valparamhead *valparams, } /* Add to end of linker directives */ - sect = yasm_object_get_general(objfmt_coff->object, ".drectve", 0, 0, 0, - 0, &isnew, line); + sect = yasm_object_get_general(object, ".drectve", 0, 0, 0, 0, &isnew, + line); /* Initialize directive section if needed */ if (isnew) { coff_section_data *csd; - csd = coff_objfmt_init_new_section(objfmt_coff, sect, + csd = coff_objfmt_init_new_section(object, sect, yasm_section_get_name(sect), line); csd->flags = COFF_STYP_INFO | COFF_STYP_DISCARD | COFF_STYP_READ; } @@ -1760,9 +1739,10 @@ dir_export(yasm_objfmt_coff *objfmt_coff, yasm_valparamhead *valparams, } static void -dir_ident(yasm_objfmt_coff *objfmt_coff, yasm_valparamhead *valparams, +dir_ident(yasm_object *object, yasm_valparamhead *valparams, unsigned long line) { + yasm_objfmt_coff *objfmt_coff = (yasm_objfmt_coff *)object->objfmt; yasm_valparamhead sect_vps; yasm_datavalhead dvs; yasm_section *comment; @@ -1783,8 +1763,7 @@ dir_ident(yasm_objfmt_coff *objfmt_coff, yasm_valparamhead *valparams, yasm_vps_initialize(§_vps); vp2 = yasm_vp_create(yasm__xstrdup(sectname), NULL); yasm_vps_append(§_vps, vp2); - comment = coff_objfmt_section_switch((yasm_objfmt *)objfmt_coff, - §_vps, NULL, line); + comment = coff_objfmt_section_switch(object, §_vps, NULL, line); yasm_vps_delete(§_vps); /* To match GAS output, if the comment section is empty, put an @@ -1796,7 +1775,7 @@ dir_ident(yasm_objfmt_coff *objfmt_coff, yasm_valparamhead *valparams, yasm_expr_create_ident(yasm_expr_int(yasm_intnum_create_uint(0)), line))); yasm_section_bcs_append(comment, - yasm_bc_create_data(&dvs, 1, 0, objfmt_coff->arch, line)); + yasm_bc_create_data(&dvs, 1, 0, object->arch, line)); } yasm_dvs_initialize(&dvs); @@ -1806,41 +1785,39 @@ dir_ident(yasm_objfmt_coff *objfmt_coff, yasm_valparamhead *valparams, } while ((vp = yasm_vps_next(vp))); yasm_section_bcs_append(comment, - yasm_bc_create_data(&dvs, 1, 1, objfmt_coff->arch, line)); + yasm_bc_create_data(&dvs, 1, 1, object->arch, line)); } static int -coff_objfmt_directive(yasm_objfmt *objfmt, const char *name, +coff_objfmt_directive(yasm_object *object, const char *name, /*@null@*/ yasm_valparamhead *valparams, /*@unused@*/ /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line) { - yasm_objfmt_coff *objfmt_coff = (yasm_objfmt_coff *)objfmt; if (yasm__strcasecmp(name, "IDENT") == 0) { if (!valparams) { yasm_error_set(YASM_ERROR_SYNTAX, N_("[%s] requires an argument"), "IDENT"); return 0; } - dir_ident(objfmt_coff, valparams, line); + dir_ident(object, valparams, line); return 0; } return 1; } static int -win32_objfmt_directive(yasm_objfmt *objfmt, const char *name, +win32_objfmt_directive(yasm_object *object, const char *name, /*@null@*/ yasm_valparamhead *valparams, /*@unused@*/ /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line) { - yasm_objfmt_coff *objfmt_coff = (yasm_objfmt_coff *)objfmt; static const struct { const char *name; int required_arg; - void (*func) (yasm_objfmt_coff *, yasm_valparamhead *, unsigned long); + void (*func) (yasm_object *, yasm_valparamhead *, unsigned long); } dirs[] = { {"EXPORT", 1, dir_export}, {"IDENT", 1, dir_ident} @@ -1854,7 +1831,7 @@ win32_objfmt_directive(yasm_objfmt *objfmt, const char *name, N_("[%s] requires an argument"), dirs[i].name); return 0; } - dirs[i].func(objfmt_coff, valparams, line); + dirs[i].func(object, valparams, line); return 0; } } @@ -1862,9 +1839,10 @@ win32_objfmt_directive(yasm_objfmt *objfmt, const char *name, } static void -dir_proc_frame(yasm_objfmt_coff *objfmt_coff, - /*@null@*/ yasm_valparamhead *valparams, unsigned long line) +dir_proc_frame(yasm_object *object, /*@null@*/ yasm_valparamhead *valparams, + unsigned long line) { + yasm_objfmt_coff *objfmt_coff = (yasm_objfmt_coff *)object->objfmt; yasm_valparam *vp = yasm_vps_first(valparams); if (objfmt_coff->proc_frame) { yasm_error_set_xref(objfmt_coff->proc_frame, @@ -1882,15 +1860,14 @@ dir_proc_frame(yasm_objfmt_coff *objfmt_coff, objfmt_coff->proc_frame = line; objfmt_coff->done_prolog = 0; objfmt_coff->unwind = yasm_win64__uwinfo_create(); - objfmt_coff->unwind->proc = - yasm_symtab_use(objfmt_coff->symtab, vp->val, line); + objfmt_coff->unwind->proc = yasm_symtab_use(object->symtab, vp->val, line); /* Optional error handler */ vp = yasm_vps_next(vp); if (!vp || !vp->val) return; objfmt_coff->unwind->ehandler = - yasm_symtab_use(objfmt_coff->symtab, vp->val, line); + yasm_symtab_use(object->symtab, vp->val, line); } static int @@ -1917,16 +1894,17 @@ procframe_checkstate(yasm_objfmt_coff *objfmt_coff, const char *dirname) * XXX: There should be a better way to do this. */ static yasm_symrec * -get_curpos(yasm_objfmt_coff *objfmt_coff, unsigned long line) +get_curpos(yasm_object *object, unsigned long line) { - return yasm_symtab_define_curpos(objfmt_coff->symtab, "$", - yasm_section_bcs_last(objfmt_coff->cursect), line); + return yasm_symtab_define_curpos(object->symtab, "$", + yasm_section_bcs_last(object->cur_section), line); } static void -dir_pushreg(yasm_objfmt_coff *objfmt_coff, yasm_valparamhead *valparams, +dir_pushreg(yasm_object *object, yasm_valparamhead *valparams, unsigned long line) { + yasm_objfmt_coff *objfmt_coff = (yasm_objfmt_coff *)object->objfmt; yasm_valparam *vp = yasm_vps_first(valparams); coff_unwind_code *code; const uintptr_t *reg; @@ -1944,7 +1922,7 @@ dir_pushreg(yasm_objfmt_coff *objfmt_coff, yasm_valparamhead *valparams, /* Generate a PUSH_NONVOL unwind code. */ code = yasm_xmalloc(sizeof(coff_unwind_code)); code->proc = objfmt_coff->unwind->proc; - code->loc = get_curpos(objfmt_coff, line); + code->loc = get_curpos(object, line); code->opcode = UWOP_PUSH_NONVOL; code->info = (unsigned int)(*reg & 0xF); yasm_value_initialize(&code->off, NULL, 0); @@ -1952,9 +1930,10 @@ dir_pushreg(yasm_objfmt_coff *objfmt_coff, yasm_valparamhead *valparams, } static void -dir_setframe(yasm_objfmt_coff *objfmt_coff, yasm_valparamhead *valparams, +dir_setframe(yasm_object *object, yasm_valparamhead *valparams, unsigned long line) { + yasm_objfmt_coff *objfmt_coff = (yasm_objfmt_coff *)object->objfmt; yasm_valparam *vp = yasm_vps_first(valparams); coff_unwind_code *code; const uintptr_t *reg; @@ -1983,7 +1962,7 @@ dir_setframe(yasm_objfmt_coff *objfmt_coff, yasm_valparamhead *valparams, /* Generate a SET_FPREG unwind code */ code = yasm_xmalloc(sizeof(coff_unwind_code)); code->proc = objfmt_coff->unwind->proc; - code->loc = get_curpos(objfmt_coff, line); + code->loc = get_curpos(object, line); code->opcode = UWOP_SET_FPREG; code->info = (unsigned int)(*reg & 0xF); yasm_value_initialize(&code->off, yasm_expr_copy(off), 8); @@ -1991,9 +1970,10 @@ dir_setframe(yasm_objfmt_coff *objfmt_coff, yasm_valparamhead *valparams, } static void -dir_allocstack(yasm_objfmt_coff *objfmt_coff, yasm_valparamhead *valparams, +dir_allocstack(yasm_object *object, yasm_valparamhead *valparams, unsigned long line) { + yasm_objfmt_coff *objfmt_coff = (yasm_objfmt_coff *)object->objfmt; yasm_valparam *vp = yasm_vps_first(valparams); coff_unwind_code *code; @@ -2003,7 +1983,7 @@ dir_allocstack(yasm_objfmt_coff *objfmt_coff, yasm_valparamhead *valparams, /* Transform ID to expression if needed */ if (vp && vp->val && !vp->param) { vp->param = yasm_expr_create_ident(yasm_expr_sym( - yasm_symtab_use(objfmt_coff->symtab, vp->val, line)), line); + yasm_symtab_use(object->symtab, vp->val, line)), line); } if (!vp || !vp->param) { @@ -2017,7 +1997,7 @@ dir_allocstack(yasm_objfmt_coff *objfmt_coff, yasm_valparamhead *valparams, */ code = yasm_xmalloc(sizeof(coff_unwind_code)); code->proc = objfmt_coff->unwind->proc; - code->loc = get_curpos(objfmt_coff, line); + code->loc = get_curpos(object, line); code->opcode = UWOP_ALLOC_SMALL; code->info = 0; yasm_value_initialize(&code->off, vp->param, 7); @@ -2026,9 +2006,10 @@ dir_allocstack(yasm_objfmt_coff *objfmt_coff, yasm_valparamhead *valparams, } static void -dir_save_common(yasm_objfmt_coff *objfmt_coff, yasm_valparamhead *valparams, +dir_save_common(yasm_object *object, yasm_valparamhead *valparams, unsigned long line, const char *name, int op) { + yasm_objfmt_coff *objfmt_coff = (yasm_objfmt_coff *)object->objfmt; yasm_valparam *vp = yasm_vps_first(valparams); coff_unwind_code *code; const uintptr_t *reg; @@ -2048,7 +2029,7 @@ dir_save_common(yasm_objfmt_coff *objfmt_coff, yasm_valparamhead *valparams, /* Transform ID to expression if needed */ if (vp && vp->val && !vp->param) { vp->param = yasm_expr_create_ident(yasm_expr_sym( - yasm_symtab_use(objfmt_coff->symtab, vp->val, line)), line); + yasm_symtab_use(object->symtab, vp->val, line)), line); } if (!vp || !vp->param) { @@ -2063,7 +2044,7 @@ dir_save_common(yasm_objfmt_coff *objfmt_coff, yasm_valparamhead *valparams, */ code = yasm_xmalloc(sizeof(coff_unwind_code)); code->proc = objfmt_coff->unwind->proc; - code->loc = get_curpos(objfmt_coff, line); + code->loc = get_curpos(object, line); code->opcode = op; code->info = (unsigned int)(*reg & 0xF); yasm_value_initialize(&code->off, vp->param, 16); @@ -2072,24 +2053,24 @@ dir_save_common(yasm_objfmt_coff *objfmt_coff, yasm_valparamhead *valparams, } static void -dir_savereg(yasm_objfmt_coff *objfmt_coff, yasm_valparamhead *valparams, +dir_savereg(yasm_object *object, yasm_valparamhead *valparams, unsigned long line) { - dir_save_common(objfmt_coff, valparams, line, "SAVEREG", UWOP_SAVE_NONVOL); + dir_save_common(object, valparams, line, "SAVEREG", UWOP_SAVE_NONVOL); } static void -dir_savexmm128(yasm_objfmt_coff *objfmt_coff, yasm_valparamhead *valparams, +dir_savexmm128(yasm_object *object, yasm_valparamhead *valparams, unsigned long line) { - dir_save_common(objfmt_coff, valparams, line, "SAVEXMM128", - UWOP_SAVE_XMM128); + dir_save_common(object, valparams, line, "SAVEXMM128", UWOP_SAVE_XMM128); } static void -dir_pushframe(yasm_objfmt_coff *objfmt_coff, - /*@null@*/ yasm_valparamhead *valparams, unsigned long line) +dir_pushframe(yasm_object *object, /*@null@*/ yasm_valparamhead *valparams, + unsigned long line) { + yasm_objfmt_coff *objfmt_coff = (yasm_objfmt_coff *)object->objfmt; yasm_valparam *vp = yasm_vps_first(valparams); coff_unwind_code *code; @@ -2101,7 +2082,7 @@ dir_pushframe(yasm_objfmt_coff *objfmt_coff, */ code = yasm_xmalloc(sizeof(coff_unwind_code)); code->proc = objfmt_coff->unwind->proc; - code->loc = get_curpos(objfmt_coff, line); + code->loc = get_curpos(object, line); code->opcode = UWOP_PUSH_MACHFRAME; code->info = vp && (vp->val || vp->param); yasm_value_initialize(&code->off, NULL, 0); @@ -2109,20 +2090,22 @@ dir_pushframe(yasm_objfmt_coff *objfmt_coff, } static void -dir_endprolog(yasm_objfmt_coff *objfmt_coff, - /*@null@*/ yasm_valparamhead *valparams, unsigned long line) +dir_endprolog(yasm_object *object, /*@null@*/ yasm_valparamhead *valparams, + unsigned long line) { + yasm_objfmt_coff *objfmt_coff = (yasm_objfmt_coff *)object->objfmt; if (!procframe_checkstate(objfmt_coff, "ENDPROLOG")) return; objfmt_coff->done_prolog = line; - objfmt_coff->unwind->prolog = get_curpos(objfmt_coff, line); + objfmt_coff->unwind->prolog = get_curpos(object, line); } static void -dir_endproc_frame(yasm_objfmt_coff *objfmt_coff, - /*@null@*/ yasm_valparamhead *valparams, unsigned long line) +dir_endproc_frame(yasm_object *object, /*@null@*/ yasm_valparamhead *valparams, + unsigned long line) { + yasm_objfmt_coff *objfmt_coff = (yasm_objfmt_coff *)object->objfmt; yasm_section *sect; coff_section_data *csd; yasm_datavalhead dvs; @@ -2151,24 +2134,23 @@ dir_endproc_frame(yasm_objfmt_coff *objfmt_coff, proc_sym = objfmt_coff->unwind->proc; - curpos = get_curpos(objfmt_coff, line); + curpos = get_curpos(object, line); /* * Add unwind info to end of .xdata section. */ - sect = yasm_object_get_general(objfmt_coff->object, ".xdata", 0, 0, 0, 0, - &isnew, line); + sect = yasm_object_get_general(object, ".xdata", 0, 0, 0, 0, &isnew, line); /* Initialize xdata section if needed */ if (isnew) { - csd = coff_objfmt_init_new_section(objfmt_coff, sect, ".xdata", line); + csd = coff_objfmt_init_new_section(object, sect, ".xdata", line); csd->flags = COFF_STYP_DATA | COFF_STYP_READ; yasm_section_set_align(sect, 8, line); } /* Get current position in .xdata section */ - unwindpos = yasm_symtab_define_curpos(objfmt_coff->symtab, "$", + unwindpos = yasm_symtab_define_curpos(object->symtab, "$", yasm_section_bcs_last(sect), line); /* Get symbol for .xdata as we'll want to reference it with WRT */ csd = yasm_section_get_data(sect, &coff_section_data_cb); @@ -2183,12 +2165,11 @@ dir_endproc_frame(yasm_objfmt_coff *objfmt_coff, * Add function lookup to end of .pdata section. */ - sect = yasm_object_get_general(objfmt_coff->object, ".pdata", 0, 0, 0, 0, - &isnew, line); + sect = yasm_object_get_general(object, ".pdata", 0, 0, 0, 0, &isnew, line); /* Initialize pdata section if needed */ if (isnew) { - csd = coff_objfmt_init_new_section(objfmt_coff, sect, ".pdata", line); + csd = coff_objfmt_init_new_section(object, sect, ".pdata", line); csd->flags = COFF_STYP_DATA | COFF_STYP_READ; csd->flags2 = COFF_FLAG_NOBASE; yasm_section_set_align(sect, 4, line); @@ -2211,17 +2192,16 @@ dir_endproc_frame(yasm_objfmt_coff *objfmt_coff, } static int -win64_objfmt_directive(yasm_objfmt *objfmt, const char *name, +win64_objfmt_directive(yasm_object *object, const char *name, /*@null@*/ yasm_valparamhead *valparams, /*@unused@*/ /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line) { - yasm_objfmt_coff *objfmt_coff = (yasm_objfmt_coff *)objfmt; static const struct { const char *name; int required_arg; - void (*func) (yasm_objfmt_coff *, yasm_valparamhead *, unsigned long); + void (*func) (yasm_object *, yasm_valparamhead *, unsigned long); } dirs[] = { {"EXPORT", 1, dir_export}, {"IDENT", 1, dir_ident}, @@ -2244,7 +2224,7 @@ win64_objfmt_directive(yasm_objfmt *objfmt, const char *name, N_("[%s] requires an argument"), dirs[i].name); return 0; } - dirs[i].func(objfmt_coff, valparams, line); + dirs[i].func(object, valparams, line); return 0; } } diff --git a/modules/objfmts/dbg/dbg-objfmt.c b/modules/objfmts/dbg/dbg-objfmt.c index c346e20c..e65c2510 100644 --- a/modules/objfmts/dbg/dbg-objfmt.c +++ b/modules/objfmts/dbg/dbg-objfmt.c @@ -34,8 +34,6 @@ typedef struct yasm_objfmt_dbg { yasm_objfmt_base objfmt; /* base structure */ - yasm_object *object; - yasm_symtab *symtab; FILE *dbgfile; } yasm_objfmt_dbg; @@ -43,28 +41,26 @@ yasm_objfmt_module yasm_dbg_LTX_objfmt; static yasm_objfmt * -dbg_objfmt_create(yasm_object *object, yasm_arch *a) +dbg_objfmt_create(yasm_object *object) { yasm_objfmt_dbg *objfmt_dbg = yasm_xmalloc(sizeof(yasm_objfmt_dbg)); objfmt_dbg->objfmt.module = &yasm_dbg_LTX_objfmt; - objfmt_dbg->object = object; - objfmt_dbg->symtab = yasm_object_get_symtab(object); objfmt_dbg->dbgfile = tmpfile(); if (!objfmt_dbg->dbgfile) { fprintf(stderr, N_("could not open temporary file")); return 0; } - fprintf(objfmt_dbg->dbgfile, "create(%s arch)\n", yasm_arch_keyword(a)); + fprintf(objfmt_dbg->dbgfile, "create()\n"); return (yasm_objfmt *)objfmt_dbg; } static void -dbg_objfmt_output(yasm_objfmt *objfmt, FILE *f, int all_syms, yasm_dbgfmt *df, +dbg_objfmt_output(yasm_object *object, FILE *f, int all_syms, yasm_errwarns *errwarns) { - yasm_objfmt_dbg *objfmt_dbg = (yasm_objfmt_dbg *)objfmt; + yasm_objfmt_dbg *objfmt_dbg = (yasm_objfmt_dbg *)object->objfmt; char buf[1024]; size_t i; @@ -80,12 +76,10 @@ dbg_objfmt_output(yasm_objfmt *objfmt, FILE *f, int all_syms, yasm_dbgfmt *df, objfmt_dbg->dbgfile = f; fprintf(objfmt_dbg->dbgfile, "output(f, object->\n"); - yasm_object_print(objfmt_dbg->object, objfmt_dbg->dbgfile, 1); - fprintf(objfmt_dbg->dbgfile, "%d, %s dbgfmt)\n", all_syms, - yasm_dbgfmt_keyword(df)); + yasm_object_print(object, objfmt_dbg->dbgfile, 1); + fprintf(objfmt_dbg->dbgfile, "%d)\n", all_syms); fprintf(objfmt_dbg->dbgfile, " Symbol Table:\n"); - yasm_symtab_print(yasm_object_get_symtab(objfmt_dbg->object), - objfmt_dbg->dbgfile, 1); + yasm_symtab_print(object->symtab, objfmt_dbg->dbgfile, 1); } static void @@ -97,19 +91,18 @@ dbg_objfmt_destroy(yasm_objfmt *objfmt) } static yasm_section * -dbg_objfmt_add_default_section(yasm_objfmt *objfmt) +dbg_objfmt_add_default_section(yasm_object *object) { - yasm_objfmt_dbg *objfmt_dbg = (yasm_objfmt_dbg *)objfmt; + yasm_objfmt_dbg *objfmt_dbg = (yasm_objfmt_dbg *)object->objfmt; yasm_section *retval; int isnew; - retval = yasm_object_get_general(objfmt_dbg->object, ".text", + retval = yasm_object_get_general(object, ".text", yasm_expr_create_ident(yasm_expr_int(yasm_intnum_create_uint(200)), 0), 0, 0, 0, &isnew, 0); if (isnew) { fprintf(objfmt_dbg->dbgfile, "(new) "); - yasm_symtab_define_label( - yasm_object_get_symtab(objfmt_dbg->object), ".text", + yasm_symtab_define_label(object->symtab, ".text", yasm_section_bcs_first(retval), 1, 0); yasm_section_set_default(retval, 1); } @@ -117,12 +110,12 @@ dbg_objfmt_add_default_section(yasm_objfmt *objfmt) } static /*@observer@*/ /*@null@*/ yasm_section * -dbg_objfmt_section_switch(yasm_objfmt *objfmt, yasm_valparamhead *valparams, +dbg_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, /*@unused@*/ /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line) { - yasm_objfmt_dbg *objfmt_dbg = (yasm_objfmt_dbg *)objfmt; + yasm_objfmt_dbg *objfmt_dbg = (yasm_objfmt_dbg *)object->objfmt; yasm_valparam *vp; yasm_section *retval; int isnew; @@ -134,13 +127,12 @@ dbg_objfmt_section_switch(yasm_objfmt *objfmt, yasm_valparamhead *valparams, fprintf(objfmt_dbg->dbgfile, ", %lu), returning ", line); if ((vp = yasm_vps_first(valparams)) && !vp->param && vp->val != NULL) { - retval = yasm_object_get_general(objfmt_dbg->object, vp->val, + retval = yasm_object_get_general(object, vp->val, yasm_expr_create_ident(yasm_expr_int(yasm_intnum_create_uint(200)), line), 0, 0, 0, &isnew, line); if (isnew) { fprintf(objfmt_dbg->dbgfile, "(new) "); - yasm_symtab_define_label( - yasm_object_get_symtab(objfmt_dbg->object), vp->val, + yasm_symtab_define_label(object->symtab, vp->val, yasm_section_bcs_first(retval), 1, line); } yasm_section_set_default(retval, 0); @@ -153,47 +145,47 @@ dbg_objfmt_section_switch(yasm_objfmt *objfmt, yasm_valparamhead *valparams, } static yasm_symrec * -dbg_objfmt_extern_declare(yasm_objfmt *objfmt, const char *name, +dbg_objfmt_extern_declare(yasm_object *object, const char *name, /*@unused@*/ /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line) { - yasm_objfmt_dbg *objfmt_dbg = (yasm_objfmt_dbg *)objfmt; + yasm_objfmt_dbg *objfmt_dbg = (yasm_objfmt_dbg *)object->objfmt; yasm_symrec *sym; fprintf(objfmt_dbg->dbgfile, "extern_declare(\"%s\", ", name); yasm_vps_print(objext_valparams, objfmt_dbg->dbgfile); fprintf(objfmt_dbg->dbgfile, ", %lu), returning sym\n", line); - sym = yasm_symtab_declare(objfmt_dbg->symtab, name, YASM_SYM_EXTERN, line); + sym = yasm_symtab_declare(object->symtab, name, YASM_SYM_EXTERN, line); return sym; } static yasm_symrec * -dbg_objfmt_global_declare(yasm_objfmt *objfmt, const char *name, +dbg_objfmt_global_declare(yasm_object *object, const char *name, /*@unused@*/ /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line) { - yasm_objfmt_dbg *objfmt_dbg = (yasm_objfmt_dbg *)objfmt; + yasm_objfmt_dbg *objfmt_dbg = (yasm_objfmt_dbg *)object->objfmt; yasm_symrec *sym; fprintf(objfmt_dbg->dbgfile, "global_declare(\"%s\", ", name); yasm_vps_print(objext_valparams, objfmt_dbg->dbgfile); fprintf(objfmt_dbg->dbgfile, ", %lu), returning sym\n", line); - sym = yasm_symtab_declare(objfmt_dbg->symtab, name, YASM_SYM_GLOBAL, line); + sym = yasm_symtab_declare(object->symtab, name, YASM_SYM_GLOBAL, line); return sym; } static yasm_symrec * -dbg_objfmt_common_declare(yasm_objfmt *objfmt, const char *name, +dbg_objfmt_common_declare(yasm_object *object, const char *name, /*@only@*/ yasm_expr *size, /*@unused@*/ /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line) { - yasm_objfmt_dbg *objfmt_dbg = (yasm_objfmt_dbg *)objfmt; + yasm_objfmt_dbg *objfmt_dbg = (yasm_objfmt_dbg *)object->objfmt; yasm_symrec *sym; assert(objfmt_dbg->dbgfile != NULL); @@ -205,17 +197,17 @@ dbg_objfmt_common_declare(yasm_objfmt *objfmt, const char *name, yasm_expr_destroy(size); - sym = yasm_symtab_declare(objfmt_dbg->symtab, name, YASM_SYM_COMMON, line); + sym = yasm_symtab_declare(object->symtab, name, YASM_SYM_COMMON, line); return sym; } static int -dbg_objfmt_directive(yasm_objfmt *objfmt, const char *name, +dbg_objfmt_directive(yasm_object *object, const char *name, /*@null@*/ yasm_valparamhead *valparams, /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line) { - yasm_objfmt_dbg *objfmt_dbg = (yasm_objfmt_dbg *)objfmt; + yasm_objfmt_dbg *objfmt_dbg = (yasm_objfmt_dbg *)object->objfmt; fprintf(objfmt_dbg->dbgfile, "directive(\"%s\", ", name); yasm_vps_print(valparams, objfmt_dbg->dbgfile); fprintf(objfmt_dbg->dbgfile, ", "); diff --git a/modules/objfmts/elf/elf-objfmt.c b/modules/objfmts/elf/elf-objfmt.c index d239f057..19dc5996 100644 --- a/modules/objfmts/elf/elf-objfmt.c +++ b/modules/objfmts/elf/elf-objfmt.c @@ -59,10 +59,6 @@ typedef struct yasm_objfmt_elf { elf_strtab_head* shstrtab; /* section name strtab */ elf_strtab_head* strtab; /* strtab entries */ - yasm_object *object; - yasm_symtab *symtab; - /*@dependent@*/ yasm_arch *arch; - elf_strtab_entry *file_strtab_entry;/* .file symbol associated string */ yasm_symrec *dotdotsym; /* ..sym symbol */ } yasm_objfmt_elf; @@ -164,8 +160,8 @@ elf_objfmt_append_local_sym(yasm_symrec *sym, /*@null@*/ void *d) } static yasm_objfmt * -elf_objfmt_create_common(yasm_object *object, yasm_arch *a, - yasm_objfmt_module *module, int bits_pref, +elf_objfmt_create_common(yasm_object *object, yasm_objfmt_module *module, + int bits_pref, const elf_machine_handler **elf_march_out) { yasm_objfmt_elf *objfmt_elf = yasm_xmalloc(sizeof(yasm_objfmt_elf)); @@ -174,10 +170,7 @@ elf_objfmt_create_common(yasm_object *object, yasm_arch *a, const elf_machine_handler *elf_march; objfmt_elf->objfmt.module = module; - objfmt_elf->object = object; - objfmt_elf->symtab = yasm_object_get_symtab(object); - objfmt_elf->arch = a; - elf_march = elf_set_arch(a, objfmt_elf->symtab, bits_pref); + elf_march = elf_set_arch(object->arch, object->symtab, bits_pref); if (!elf_march) { yasm_xfree(objfmt_elf); return NULL; @@ -190,12 +183,10 @@ elf_objfmt_create_common(yasm_object *object, yasm_arch *a, objfmt_elf->elf_symtab = elf_symtab_create(); /* FIXME: misuse of NULL bytecode here; it works, but only barely. */ - filesym = yasm_symtab_define_label(objfmt_elf->symtab, ".file", NULL, 0, - 0); + filesym = yasm_symtab_define_label(object->symtab, ".file", NULL, 0, 0); /* Put in current input filename; we'll replace it in output() */ objfmt_elf->file_strtab_entry = - elf_strtab_append_str(objfmt_elf->strtab, - yasm_object_get_source_fn(object)); + elf_strtab_append_str(objfmt_elf->strtab, object->src_filename); entry = elf_symtab_entry_create(objfmt_elf->file_strtab_entry, filesym); yasm_symrec_add_data(filesym, &elf_symrec_data, entry); elf_symtab_set_nonzero(entry, NULL, SHN_ABS, STB_LOCAL, STT_FILE, NULL, @@ -203,20 +194,20 @@ elf_objfmt_create_common(yasm_object *object, yasm_arch *a, elf_symtab_append_entry(objfmt_elf->elf_symtab, entry); /* FIXME: misuse of NULL bytecode */ - objfmt_elf->dotdotsym = yasm_symtab_define_label(objfmt_elf->symtab, - "..sym", NULL, 1, 0); + objfmt_elf->dotdotsym = + yasm_symtab_define_label(object->symtab, "..sym", NULL, 1, 0); return (yasm_objfmt *)objfmt_elf; } static yasm_objfmt * -elf_objfmt_create(yasm_object *object, yasm_arch *a) +elf_objfmt_create(yasm_object *object) { const elf_machine_handler *elf_march; yasm_objfmt *objfmt; yasm_objfmt_elf *objfmt_elf; - objfmt = elf_objfmt_create_common(object, a, &yasm_elf_LTX_objfmt, 0, + objfmt = elf_objfmt_create_common(object, &yasm_elf_LTX_objfmt, 0, &elf_march); if (objfmt) { objfmt_elf = (yasm_objfmt_elf *)objfmt; @@ -230,17 +221,15 @@ elf_objfmt_create(yasm_object *object, yasm_arch *a) } static yasm_objfmt * -elf32_objfmt_create(yasm_object *object, yasm_arch *a) +elf32_objfmt_create(yasm_object *object) { - return elf_objfmt_create_common(object, a, &yasm_elf32_LTX_objfmt, 32, - NULL); + return elf_objfmt_create_common(object, &yasm_elf32_LTX_objfmt, 32, NULL); } static yasm_objfmt * -elf64_objfmt_create(yasm_object *object, yasm_arch *a) +elf64_objfmt_create(yasm_object *object) { - return elf_objfmt_create_common(object, a, &yasm_elf64_LTX_objfmt, 64, - NULL); + return elf_objfmt_create_common(object, &yasm_elf64_LTX_objfmt, 64, NULL); } static long @@ -290,8 +279,8 @@ elf_objfmt_output_reloc(yasm_symrec *sym, yasm_bytecode *bc, zero = yasm_intnum_create_uint(0); elf_handle_reloc_addend(zero, reloc); - retval = yasm_arch_intnum_tobytes(info->objfmt_elf->arch, zero, buf, - destsize, valsize, 0, bc, warn); + retval = yasm_arch_intnum_tobytes(info->object->arch, zero, buf, destsize, + valsize, 0, bc, warn); yasm_intnum_destroy(zero); return retval; } @@ -319,7 +308,7 @@ elf_objfmt_output_value(yasm_value *value, unsigned char *buf, * cross-section, or non-PC-relative reference (those are handled below). */ switch (yasm_value_output_basic(value, buf, destsize, bc, warn, - info->objfmt_elf->arch)) { + info->object->arch)) { case -1: return 1; case 0: @@ -397,8 +386,8 @@ elf_objfmt_output_value(yasm_value *value, unsigned char *buf, if (reloc) elf_handle_reloc_addend(intn, reloc); - retval = yasm_arch_intnum_tobytes(info->objfmt_elf->arch, intn, buf, - destsize, valsize, 0, bc, warn); + retval = yasm_arch_intnum_tobytes(info->object->arch, intn, buf, destsize, + valsize, 0, bc, warn); yasm_intnum_destroy(intn); return retval; } @@ -485,9 +474,8 @@ elf_objfmt_create_dbg_secthead(yasm_section *sect, /*@null@*/ void *d) shead = elf_secthead_create(name, type, 0, 0, 0); elf_secthead_set_entsize(shead, entsize); - sym = yasm_symtab_define_label( - yasm_object_get_symtab(info->objfmt_elf->object), sectname, - yasm_section_bcs_first(sect), 1, 0); + sym = yasm_symtab_define_label(info->object->symtab, sectname, + yasm_section_bcs_first(sect), 1, 0); elf_secthead_set_sym(shead, sym); yasm_section_add_data(sect, &elf_section_data, shead); @@ -595,10 +583,10 @@ elf_objfmt_output_secthead(yasm_section *sect, /*@null@*/ void *d) } static void -elf_objfmt_output(yasm_objfmt *objfmt, FILE *f, int all_syms, yasm_dbgfmt *df, +elf_objfmt_output(yasm_object *object, FILE *f, int all_syms, yasm_errwarns *errwarns) { - yasm_objfmt_elf *objfmt_elf = (yasm_objfmt_elf *)objfmt; + yasm_objfmt_elf *objfmt_elf = (yasm_objfmt_elf *)object->objfmt; elf_objfmt_output_info info; append_local_sym_info localsym_info; long pos; @@ -609,13 +597,14 @@ elf_objfmt_output(yasm_objfmt *objfmt, FILE *f, int all_syms, yasm_dbgfmt *df, elf_strtab_entry *elf_strtab_name, *elf_shstrtab_name, *elf_symtab_name; unsigned long elf_symtab_nlocal; + info.object = object; info.objfmt_elf = objfmt_elf; info.errwarns = errwarns; info.f = f; /* Update filename strtab */ elf_strtab_entry_set_str(objfmt_elf->file_strtab_entry, - yasm_object_get_source_fn(objfmt_elf->object)); + object->src_filename); /* Allocate space for Ehdr by seeking forward */ if (fseek(f, (long)(elf_proghead_get_size()), SEEK_SET) < 0) { @@ -626,21 +615,21 @@ elf_objfmt_output(yasm_objfmt *objfmt, FILE *f, int all_syms, yasm_dbgfmt *df, /* Create missing section headers */ localsym_info.objfmt_elf = objfmt_elf; - if (yasm_object_sections_traverse(objfmt_elf->object, &info, + if (yasm_object_sections_traverse(object, &info, elf_objfmt_create_dbg_secthead)) return; /* add all (local) syms to symtab because relocation needs a symtab index * if all_syms, register them by name. if not, use strtab entry 0 */ localsym_info.local_names = all_syms; - yasm_symtab_traverse(yasm_object_get_symtab(objfmt_elf->object), - &localsym_info, elf_objfmt_append_local_sym); + yasm_symtab_traverse(object->symtab, &localsym_info, + elf_objfmt_append_local_sym); elf_symtab_nlocal = elf_symtab_assign_indices(objfmt_elf->elf_symtab); /* output known sections - includes reloc sections which aren't in yasm's * list. Assign indices as we go. */ info.sindex = 3; - if (yasm_object_sections_traverse(objfmt_elf->object, &info, + if (yasm_object_sections_traverse(object, &info, elf_objfmt_output_section)) return; @@ -683,11 +672,10 @@ elf_objfmt_output(yasm_objfmt *objfmt, FILE *f, int all_syms, yasm_dbgfmt *df, elf_shead_addr = (unsigned long) pos; /* stabs debugging support */ - if (strcmp(yasm_dbgfmt_keyword(df), "stabs")==0) { - yasm_section *stabsect = yasm_object_find_general(objfmt_elf->object, - ".stab"); + if (strcmp(yasm_dbgfmt_keyword(object->dbgfmt), "stabs")==0) { + yasm_section *stabsect = yasm_object_find_general(object, ".stab"); yasm_section *stabstrsect = - yasm_object_find_general(objfmt_elf->object, ".stabstr"); + yasm_object_find_general(object, ".stabstr"); if (stabsect && stabstrsect) { elf_secthead *stab = yasm_section_get_data(stabsect, &elf_section_data); @@ -731,8 +719,7 @@ elf_objfmt_output(yasm_objfmt *objfmt, FILE *f, int all_syms, yasm_dbgfmt *df, info.sindex = 3; /* output remaining section headers */ - yasm_object_sections_traverse(objfmt_elf->object, &info, - elf_objfmt_output_secthead); + yasm_object_sections_traverse(object, &info, elf_objfmt_output_secthead); /* output Ehdr */ if (fseek(f, 0, SEEK_SET) < 0) { @@ -755,10 +742,11 @@ elf_objfmt_destroy(yasm_objfmt *objfmt) } static elf_secthead * -elf_objfmt_init_new_section(yasm_objfmt_elf *objfmt_elf, yasm_section *sect, +elf_objfmt_init_new_section(yasm_object *object, yasm_section *sect, const char *sectname, unsigned long type, unsigned long flags, unsigned long line) { + yasm_objfmt_elf *objfmt_elf = (yasm_objfmt_elf *)object->objfmt; elf_secthead *esd; yasm_symrec *sym; elf_strtab_entry *name = elf_strtab_append_str(objfmt_elf->shstrtab, @@ -766,9 +754,8 @@ elf_objfmt_init_new_section(yasm_objfmt_elf *objfmt_elf, yasm_section *sect, esd = elf_secthead_create(name, type, flags, 0, 0); yasm_section_add_data(sect, &elf_section_data, esd); - sym = yasm_symtab_define_label( - yasm_object_get_symtab(objfmt_elf->object), sectname, - yasm_section_bcs_first(sect), 1, line); + sym = yasm_symtab_define_label(object->symtab, sectname, + yasm_section_bcs_first(sect), 1, line); elf_secthead_set_sym(esd, sym); @@ -776,27 +763,24 @@ elf_objfmt_init_new_section(yasm_objfmt_elf *objfmt_elf, yasm_section *sect, } static yasm_section * -elf_objfmt_add_default_section(yasm_objfmt *objfmt) +elf_objfmt_add_default_section(yasm_object *object) { - yasm_objfmt_elf *objfmt_elf = (yasm_objfmt_elf *)objfmt; yasm_section *retval; int isnew; elf_secthead *esd; - retval = yasm_object_get_general(objfmt_elf->object, ".text", 0, 16, 1, 0, - &isnew, 0); - esd = elf_objfmt_init_new_section(objfmt_elf, retval, ".text", SHT_PROGBITS, + retval = yasm_object_get_general(object, ".text", 0, 16, 1, 0, &isnew, 0); + esd = elf_objfmt_init_new_section(object, retval, ".text", SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR, 0); yasm_section_set_default(retval, 1); return retval; } static /*@observer@*/ /*@null@*/ yasm_section * -elf_objfmt_section_switch(yasm_objfmt *objfmt, yasm_valparamhead *valparams, +elf_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line) { - yasm_objfmt_elf *objfmt_elf = (yasm_objfmt_elf *)objfmt; yasm_valparam *vp = yasm_vps_first(valparams); yasm_section *retval; int isnew; @@ -953,12 +937,12 @@ elf_objfmt_section_switch(yasm_objfmt *objfmt, yasm_valparamhead *valparams, } } - retval = yasm_object_get_general(objfmt_elf->object, sectname, 0, align, + retval = yasm_object_get_general(object, sectname, 0, align, (flags & SHF_EXECINSTR) != 0, resonly, &isnew, line); if (isnew) - esd = elf_objfmt_init_new_section(objfmt_elf, retval, sectname, type, + esd = elf_objfmt_init_new_section(object, retval, sectname, type, flags, line); else esd = yasm_section_get_data(retval, &elf_section_data); @@ -976,14 +960,14 @@ elf_objfmt_section_switch(yasm_objfmt *objfmt, yasm_valparamhead *valparams, } static yasm_symrec * -elf_objfmt_extern_declare(yasm_objfmt *objfmt, const char *name, /*@unused@*/ +elf_objfmt_extern_declare(yasm_object *object, const char *name, /*@unused@*/ /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line) { - yasm_objfmt_elf *objfmt_elf = (yasm_objfmt_elf *)objfmt; + yasm_objfmt_elf *objfmt_elf = (yasm_objfmt_elf *)object->objfmt; yasm_symrec *sym; - sym = yasm_symtab_declare(objfmt_elf->symtab, name, YASM_SYM_EXTERN, line); + sym = yasm_symtab_declare(object->symtab, name, YASM_SYM_EXTERN, line); elf_objfmt_symtab_append(objfmt_elf, sym, SHN_UNDEF, STB_GLOBAL, 0, STV_DEFAULT, NULL, NULL); @@ -1000,18 +984,18 @@ elf_objfmt_extern_declare(yasm_objfmt *objfmt, const char *name, /*@unused@*/ } static yasm_symrec * -elf_objfmt_global_declare(yasm_objfmt *objfmt, const char *name, +elf_objfmt_global_declare(yasm_object *object, const char *name, /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line) { - yasm_objfmt_elf *objfmt_elf = (yasm_objfmt_elf *)objfmt; + yasm_objfmt_elf *objfmt_elf = (yasm_objfmt_elf *)object->objfmt; yasm_symrec *sym; elf_symbol_type type = 0; yasm_expr *size = NULL; elf_symbol_vis vis = STV_DEFAULT; unsigned int vis_overrides = 0; - sym = yasm_symtab_declare(objfmt_elf->symtab, name, YASM_SYM_GLOBAL, line); + sym = yasm_symtab_declare(object->symtab, name, YASM_SYM_GLOBAL, line); if (objext_valparams) { yasm_valparam *vp = yasm_vps_first(objext_valparams); @@ -1058,16 +1042,16 @@ elf_objfmt_global_declare(yasm_objfmt *objfmt, const char *name, } static yasm_symrec * -elf_objfmt_common_declare(yasm_objfmt *objfmt, const char *name, +elf_objfmt_common_declare(yasm_object *object, const char *name, /*@only@*/ yasm_expr *size, /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line) { - yasm_objfmt_elf *objfmt_elf = (yasm_objfmt_elf *)objfmt; + yasm_objfmt_elf *objfmt_elf = (yasm_objfmt_elf *)object->objfmt; yasm_symrec *sym; unsigned long addralign = 0; - sym = yasm_symtab_declare(objfmt_elf->symtab, name, YASM_SYM_COMMON, line); + sym = yasm_symtab_declare(object->symtab, name, YASM_SYM_COMMON, line); if (objext_valparams) { yasm_valparam *vp = yasm_vps_first(objext_valparams); @@ -1102,11 +1086,12 @@ elf_objfmt_common_declare(yasm_objfmt *objfmt, const char *name, } static void -dir_type(yasm_objfmt_elf *objfmt_elf, yasm_valparam *vp, unsigned long line) +dir_type(yasm_object *object, yasm_valparam *vp, unsigned long line) { + yasm_objfmt_elf *objfmt_elf = (yasm_objfmt_elf *)object->objfmt; char *symname = vp->val; /* Get symbol elf data */ - yasm_symrec *sym = yasm_symtab_use(objfmt_elf->symtab, symname, line); + yasm_symrec *sym = yasm_symtab_use(object->symtab, symname, line); elf_symtab_entry *entry = yasm_symrec_get_data(sym, &elf_symrec_data); /* Create entry if necessary */ @@ -1131,11 +1116,12 @@ dir_type(yasm_objfmt_elf *objfmt_elf, yasm_valparam *vp, unsigned long line) } static void -dir_size(yasm_objfmt_elf *objfmt_elf, yasm_valparam *vp, unsigned long line) +dir_size(yasm_object *object, yasm_valparam *vp, unsigned long line) { + yasm_objfmt_elf *objfmt_elf = (yasm_objfmt_elf *)object->objfmt; char *symname = vp->val; /* Get symbol elf data */ - yasm_symrec *sym = yasm_symtab_use(objfmt_elf->symtab, symname, line); + yasm_symrec *sym = yasm_symtab_use(object->symtab, symname, line); elf_symtab_entry *entry = yasm_symrec_get_data(sym, &elf_symrec_data); /* Create entry if necessary */ @@ -1152,25 +1138,25 @@ dir_size(yasm_objfmt_elf *objfmt_elf, yasm_valparam *vp, unsigned long line) vp->param = NULL; } else if (vp && vp->val) elf_sym_set_size(entry, yasm_expr_create_ident(yasm_expr_sym( - yasm_symtab_use(objfmt_elf->symtab, vp->val, line)), line)); + yasm_symtab_use(object->symtab, vp->val, line)), line)); else yasm_error_set(YASM_ERROR_SYNTAX, N_("no size specified")); } static void -dir_weak(yasm_objfmt_elf *objfmt_elf, yasm_valparam *vp, unsigned long line) +dir_weak(yasm_object *object, yasm_valparam *vp, unsigned long line) { + yasm_objfmt_elf *objfmt_elf = (yasm_objfmt_elf *)object->objfmt; char *symname = vp->val; - yasm_symrec *sym = yasm_symtab_declare(objfmt_elf->symtab, symname, + yasm_symrec *sym = yasm_symtab_declare(object->symtab, symname, YASM_SYM_GLOBAL, line); elf_objfmt_symtab_append(objfmt_elf, sym, SHN_UNDEF, STB_WEAK, 0, STV_DEFAULT, NULL, NULL); } static void -dir_ident(yasm_objfmt_elf *objfmt_elf, yasm_valparam *vp, unsigned long line) +dir_ident(yasm_object *object, yasm_valparam *vp, unsigned long line) { - char *symname = vp->val; yasm_valparamhead sect_vps; yasm_datavalhead dvs; yasm_section *comment; @@ -1180,8 +1166,7 @@ dir_ident(yasm_objfmt_elf *objfmt_elf, yasm_valparam *vp, unsigned long line) yasm_vps_initialize(§_vps); vp2 = yasm_vp_create(yasm__xstrdup(".comment"), NULL); yasm_vps_append(§_vps, vp2); - comment = elf_objfmt_section_switch((yasm_objfmt *)objfmt_elf, §_vps, - NULL, line); + comment = elf_objfmt_section_switch(object, §_vps, NULL, line); yasm_vps_delete(§_vps); /* To match GAS output, if the comment section is empty, put an @@ -1193,7 +1178,7 @@ dir_ident(yasm_objfmt_elf *objfmt_elf, yasm_valparam *vp, unsigned long line) yasm_expr_create_ident( yasm_expr_int(yasm_intnum_create_uint(0)), line))); yasm_section_bcs_append(comment, - yasm_bc_create_data(&dvs, 1, 0, objfmt_elf->arch, line)); + yasm_bc_create_data(&dvs, 1, 0, object->arch, line)); } yasm_dvs_initialize(&dvs); @@ -1203,20 +1188,19 @@ dir_ident(yasm_objfmt_elf *objfmt_elf, yasm_valparam *vp, unsigned long line) } while ((vp = yasm_vps_next(vp))); yasm_section_bcs_append(comment, - yasm_bc_create_data(&dvs, 1, 1, objfmt_elf->arch, line)); + yasm_bc_create_data(&dvs, 1, 1, object->arch, line)); } static int -elf_objfmt_directive(yasm_objfmt *objfmt, const char *name, +elf_objfmt_directive(yasm_object *object, const char *name, /*@null@*/ yasm_valparamhead *valparams, /*@unused@*/ /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line) { - yasm_objfmt_elf *objfmt_elf = (yasm_objfmt_elf *)objfmt; static const struct { const char *name; - void (*func) (yasm_objfmt_elf *, yasm_valparam *, unsigned long); + void (*func) (yasm_object *, yasm_valparam *, unsigned long); } dirs[] = { {"TYPE", dir_type}, {"SIZE", dir_size}, @@ -1233,7 +1217,7 @@ elf_objfmt_directive(yasm_objfmt *objfmt, const char *name, N_("Symbol name not specified")); return 0; } - dirs[i].func(objfmt_elf, vp, line); + dirs[i].func(object, vp, line); return 0; } } diff --git a/modules/objfmts/macho/macho-objfmt.c b/modules/objfmts/macho/macho-objfmt.c index 68db6adb..ac7eacce 100644 --- a/modules/objfmts/macho/macho-objfmt.c +++ b/modules/objfmts/macho/macho-objfmt.c @@ -306,14 +306,11 @@ typedef struct yasm_objfmt_macho { long parse_scnum; /* sect numbering in parser */ int bits; /* 32 / 64 */ - - yasm_object *object; - yasm_symtab *symtab; - /*@dependent@ */ yasm_arch *arch; } yasm_objfmt_macho; typedef struct macho_objfmt_output_info { + yasm_object *object; yasm_objfmt_macho *objfmt_macho; yasm_errwarns *errwarns; /*@dependent@ */ FILE *f; @@ -360,27 +357,25 @@ yasm_objfmt_module yasm_macho32_LTX_objfmt; yasm_objfmt_module yasm_macho64_LTX_objfmt; static yasm_objfmt * -macho_objfmt_create_common(yasm_object *object, yasm_arch *a, - yasm_objfmt_module *module, int bits_pref) +macho_objfmt_create_common(yasm_object *object, yasm_objfmt_module *module, + int bits_pref) { yasm_objfmt_macho *objfmt_macho = yasm_xmalloc(sizeof(yasm_objfmt_macho)); objfmt_macho->objfmt.module = module; - objfmt_macho->object = object; - objfmt_macho->symtab = yasm_object_get_symtab(object); - objfmt_macho->arch = a; /* Only support x86 arch for now */ - if (yasm__strcasecmp(yasm_arch_keyword(a), "x86") != 0) { + if (yasm__strcasecmp(yasm_arch_keyword(object->arch), "x86") != 0) { yasm_xfree(objfmt_macho); return NULL; } /* Support x86 and amd64 machines of x86 arch */ - if (yasm__strcasecmp(yasm_arch_get_machine(a), "x86") == 0 && + if (yasm__strcasecmp(yasm_arch_get_machine(object->arch), "x86") == 0 && (bits_pref == 0 || bits_pref == 32)) objfmt_macho->bits = 32; - else if (yasm__strcasecmp(yasm_arch_get_machine(a), "amd64") == 0 && + else if (yasm__strcasecmp(yasm_arch_get_machine(object->arch), + "amd64") == 0 && (bits_pref == 0 || bits_pref == 64)) objfmt_macho->bits = 64; else { @@ -393,12 +388,12 @@ macho_objfmt_create_common(yasm_object *object, yasm_arch *a, } static yasm_objfmt * -macho_objfmt_create(yasm_object *object, yasm_arch *a) +macho_objfmt_create(yasm_object *object) { yasm_objfmt *objfmt; yasm_objfmt_macho *objfmt_macho; - objfmt = macho_objfmt_create_common(object, a, &yasm_macho_LTX_objfmt, 0); + objfmt = macho_objfmt_create_common(object, &yasm_macho_LTX_objfmt, 0); if (objfmt) { objfmt_macho = (yasm_objfmt_macho *)objfmt; /* Figure out which bitness of object format to use */ @@ -411,15 +406,15 @@ macho_objfmt_create(yasm_object *object, yasm_arch *a) } static yasm_objfmt * -macho32_objfmt_create(yasm_object *object, yasm_arch *a) +macho32_objfmt_create(yasm_object *object) { - return macho_objfmt_create_common(object, a, &yasm_macho32_LTX_objfmt, 32); + return macho_objfmt_create_common(object, &yasm_macho32_LTX_objfmt, 32); } static yasm_objfmt * -macho64_objfmt_create(yasm_object *object, yasm_arch *a) +macho64_objfmt_create(yasm_object *object) { - return macho_objfmt_create_common(object, a, &yasm_macho64_LTX_objfmt, 64); + return macho_objfmt_create_common(object, &yasm_macho64_LTX_objfmt, 64); } static int @@ -446,7 +441,7 @@ macho_objfmt_output_value(yasm_value *value, unsigned char *buf, * cross-section, or non-PC-relative reference (those are handled below). */ switch (yasm_value_output_basic(value, buf, destsize, bc, warn, - info->objfmt_macho->arch)) { + info->object->arch)) { case -1: return 1; case 0: @@ -580,7 +575,7 @@ macho_objfmt_output_value(yasm_value *value, unsigned char *buf, yasm_intnum_calc(intn, YASM_EXPR_ADD, intn2); } - retval = yasm_arch_intnum_tobytes(objfmt_macho->arch, intn, buf, destsize, + retval = yasm_arch_intnum_tobytes(info->object->arch, intn, buf, destsize, valsize, 0, bc, warn); /*printf("val %ld\n",yasm_intnum_get_int(intn));*/ yasm_intnum_destroy(intn); @@ -1046,10 +1041,10 @@ macho_objfmt_calc_sectsize(yasm_section *sect, /*@null@ */ void *d) /* write object */ static void -macho_objfmt_output(yasm_objfmt *objfmt, FILE *f, int all_syms, - /*@unused@*/ yasm_dbgfmt *df, yasm_errwarns *errwarns) +macho_objfmt_output(yasm_object *object, FILE *f, int all_syms, + yasm_errwarns *errwarns) { - yasm_objfmt_macho *objfmt_macho = (yasm_objfmt_macho *) objfmt; + yasm_objfmt_macho *objfmt_macho = (yasm_objfmt_macho *)object->objfmt; macho_objfmt_output_info info; unsigned char *localbuf; unsigned long symtab_count = 0; @@ -1062,6 +1057,7 @@ macho_objfmt_output(yasm_objfmt *objfmt, FILE *f, int all_syms, unsigned long long_int_bytes; const char pad_data[3] = "\0\0\0"; + info.object = object; info.objfmt_macho = objfmt_macho; info.errwarns = errwarns; info.f = f; @@ -1110,7 +1106,7 @@ macho_objfmt_output(yasm_objfmt *objfmt, FILE *f, int all_syms, info.strlength = 1; /* string table starts with a zero byte */ info.all_syms = all_syms || info.is_64; /*info.all_syms = 1; * force all syms into symbol table */ - yasm_symtab_traverse(objfmt_macho->symtab, &info, macho_objfmt_count_sym); + yasm_symtab_traverse(object->symtab, &info, macho_objfmt_count_sym); symtab_count = info.indx; /* write raw section data first */ @@ -1126,12 +1122,10 @@ macho_objfmt_output(yasm_objfmt *objfmt, FILE *f, int all_syms, info.vmsize = 0; info.filesize = 0; info.offset = headsize; - yasm_object_sections_traverse(objfmt_macho->object, &info, - macho_objfmt_calc_sectsize); + yasm_object_sections_traverse(object, &info, macho_objfmt_calc_sectsize); /* output sections to file */ - yasm_object_sections_traverse(objfmt_macho->object, &info, - macho_objfmt_output_section); + yasm_object_sections_traverse(object, &info, macho_objfmt_output_section); fileoff_sections = ftell(f); @@ -1227,8 +1221,7 @@ macho_objfmt_output(yasm_objfmt *objfmt, FILE *f, int all_syms, /* offset to relocs for first section */ info.rel_base = align32((long)fileoffset + (long)info.filesize); info.s_reloff = 0; /* offset for relocs of following sections */ - yasm_object_sections_traverse(objfmt_macho->object, &info, - macho_objfmt_output_secthead); + yasm_object_sections_traverse(object, &info, macho_objfmt_output_secthead); localbuf = info.buf; /* write out symbol command */ @@ -1260,25 +1253,16 @@ macho_objfmt_output(yasm_objfmt *objfmt, FILE *f, int all_syms, } /* relocation data */ - yasm_object_sections_traverse(objfmt_macho->object, &info, - macho_objfmt_output_relocs); + yasm_object_sections_traverse(object, &info, macho_objfmt_output_relocs); /* symbol table (NLIST) */ info.indx = 1; /* restart symbol table indices */ - yasm_symtab_traverse(objfmt_macho->symtab, &info, - macho_objfmt_output_symtable); + yasm_symtab_traverse(object->symtab, &info, macho_objfmt_output_symtable); /* symbol strings */ fwrite(pad_data, 1, 1, f); - yasm_symtab_traverse(objfmt_macho->symtab, &info, - macho_objfmt_output_str); -#if 0 - /* relocation fixup: set internal symbol locations into byte code within - * file. - */ - yasm_object_sections_traverse(objfmt_macho->object, &info, - macho_objfmt_fixup_relocs); -#endif + yasm_symtab_traverse(object->symtab, &info, macho_objfmt_output_str); + yasm_intnum_destroy(val); yasm_xfree(info.buf); } @@ -1290,10 +1274,10 @@ macho_objfmt_destroy(yasm_objfmt *objfmt) } static macho_section_data * -macho_objfmt_init_new_section(yasm_objfmt_macho * objfmt_macho, - yasm_section *sect, const char *sectname, - unsigned long line) +macho_objfmt_init_new_section(yasm_object *object, yasm_section *sect, + const char *sectname, unsigned long line) { + yasm_objfmt_macho *objfmt_macho = (yasm_objfmt_macho *)object->objfmt; macho_section_data *data; yasm_symrec *sym; @@ -1307,25 +1291,22 @@ macho_objfmt_init_new_section(yasm_objfmt_macho * objfmt_macho, data->offset = 0; yasm_section_add_data(sect, &macho_section_data_cb, data); - sym = yasm_symtab_define_label(objfmt_macho->symtab, sectname, + sym = yasm_symtab_define_label(object->symtab, sectname, yasm_section_bcs_first(sect), 1, line); data->sym = sym; return data; } static yasm_section * -macho_objfmt_add_default_section(yasm_objfmt *objfmt) +macho_objfmt_add_default_section(yasm_object *object) { - yasm_objfmt_macho *objfmt_macho = (yasm_objfmt_macho *) objfmt; yasm_section *retval; macho_section_data *msd; int isnew; - retval = - yasm_object_get_general(objfmt_macho->object, ".text", 0, 0, 1, 0, - &isnew, 0); + retval = yasm_object_get_general(object, ".text", 0, 0, 1, 0, &isnew, 0); if (isnew) { - msd = macho_objfmt_init_new_section(objfmt_macho, retval, ".text", 0); + msd = macho_objfmt_init_new_section(object, retval, ".text", 0); msd->segname = "__TEXT"; msd->sectname = "__text"; msd->flags = S_ATTR_PURE_INSTRUCTIONS; @@ -1336,12 +1317,11 @@ macho_objfmt_add_default_section(yasm_objfmt *objfmt) } static /*@observer@*/ /*@null@*/ yasm_section * -macho_objfmt_section_switch(yasm_objfmt *objfmt, yasm_valparamhead *valparams, +macho_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, /*@unused@*/ /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line) { - yasm_objfmt_macho *objfmt_macho = (yasm_objfmt_macho *) objfmt; yasm_valparam *vp = yasm_vps_first(valparams); yasm_section *retval; int isnew; @@ -1480,13 +1460,11 @@ macho_objfmt_section_switch(yasm_objfmt *objfmt, yasm_valparamhead *valparams, N_("Unrecognized qualifier `%s'"), vp->val); } - retval = - yasm_object_get_general(objfmt_macho->object, sectname, 0, align, 1, - resonly, &isnew, line); + retval = yasm_object_get_general(object, sectname, 0, align, 1, resonly, + &isnew, line); if (isnew) - msd = macho_objfmt_init_new_section(objfmt_macho, retval, sectname, - line); + msd = macho_objfmt_init_new_section(object, retval, sectname, line); else msd = yasm_section_get_data(retval, &macho_section_data_cb); @@ -1523,40 +1501,32 @@ macho_section_data_print(void *data, FILE *f, int indent_level) } static yasm_symrec * -macho_objfmt_extern_declare(yasm_objfmt *objfmt, const char *name, /*@unused@*/ +macho_objfmt_extern_declare(yasm_object *object, const char *name, /*@unused@*/ /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line) { - yasm_objfmt_macho *objfmt_macho = (yasm_objfmt_macho *)objfmt; - - return yasm_symtab_declare(objfmt_macho->symtab, name, YASM_SYM_EXTERN, - line); + return yasm_symtab_declare(object->symtab, name, YASM_SYM_EXTERN, line); } static yasm_symrec * -macho_objfmt_global_declare(yasm_objfmt *objfmt, const char *name, /*@unused@*/ +macho_objfmt_global_declare(yasm_object *object, const char *name, /*@unused@*/ /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line) { - yasm_objfmt_macho *objfmt_macho = (yasm_objfmt_macho *)objfmt; - - return yasm_symtab_declare(objfmt_macho->symtab, name, YASM_SYM_GLOBAL, - line); + return yasm_symtab_declare(object->symtab, name, YASM_SYM_GLOBAL, line); } static yasm_symrec * -macho_objfmt_common_declare(yasm_objfmt *objfmt, const char *name, +macho_objfmt_common_declare(yasm_object *object, const char *name, /*@only@*/ yasm_expr *size, /*@unused@*/ /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line) { - yasm_objfmt_macho *objfmt_macho = (yasm_objfmt_macho *)objfmt; yasm_symrec *sym; macho_symrec_data *sym_data; - sym = yasm_symtab_declare(objfmt_macho->symtab, name, YASM_SYM_COMMON, - line); + sym = yasm_symtab_declare(object->symtab, name, YASM_SYM_COMMON, line); sym_data = yasm_xmalloc(sizeof(macho_symrec_data)); @@ -1596,7 +1566,7 @@ macho_symrec_data_print(void *data, FILE *f, int indent_level) static int -macho_objfmt_directive(/*@unused@*/ yasm_objfmt *objfmt, +macho_objfmt_directive(/*@unused@*/ yasm_object *object, /*@unused@*/ const char *name, /*@unused@*/ /*@null@*/ yasm_valparamhead *valparams, /*@unused@*/ /*@null@*/ diff --git a/modules/objfmts/rdf/rdf-objfmt.c b/modules/objfmts/rdf/rdf-objfmt.c index 7ff400bf..5d7eace7 100644 --- a/modules/objfmts/rdf/rdf-objfmt.c +++ b/modules/objfmts/rdf/rdf-objfmt.c @@ -118,15 +118,12 @@ typedef struct yasm_objfmt_rdf { long parse_scnum; /* sect numbering in parser */ - yasm_object *object; - yasm_symtab *symtab; - /*@dependent@*/ yasm_arch *arch; - /*@owned@*/ xdf_str_head module_names; /*@owned@*/ xdf_str_head library_names; } yasm_objfmt_rdf; typedef struct rdf_objfmt_output_info { + yasm_object *object; yasm_objfmt_rdf *objfmt_rdf; yasm_errwarns *errwarns; /*@dependent@*/ FILE *f; @@ -175,14 +172,10 @@ rdf_objfmt_sym_set_data(yasm_symrec *sym, } static yasm_objfmt * -rdf_objfmt_create(yasm_object *object, yasm_arch *a) +rdf_objfmt_create(yasm_object *object) { yasm_objfmt_rdf *objfmt_rdf = yasm_xmalloc(sizeof(yasm_objfmt_rdf)); - objfmt_rdf->object = object; - objfmt_rdf->symtab = yasm_object_get_symtab(object); - objfmt_rdf->arch = a; - /* We theoretically support all arches, so don't check. * Really we only support byte-addressable ones. */ @@ -221,7 +214,7 @@ rdf_objfmt_output_value(yasm_value *value, unsigned char *buf, * cross-section, or non-PC-relative reference (those are handled below). */ switch (yasm_value_output_basic(value, buf, destsize, bc, warn, - info->objfmt_rdf->arch)) { + info->object->arch)) { case -1: return 1; case 0: @@ -308,7 +301,7 @@ rdf_objfmt_output_value(yasm_value *value, unsigned char *buf, yasm_intnum_calc(intn, YASM_EXPR_ADD, intn2); } - retval = yasm_arch_intnum_tobytes(objfmt_rdf->arch, intn, buf, destsize, + retval = yasm_arch_intnum_tobytes(info->object->arch, intn, buf, destsize, valsize, 0, bc, warn); yasm_intnum_destroy(intn); return retval; @@ -612,16 +605,17 @@ rdf_objfmt_output_sym(yasm_symrec *sym, /*@null@*/ void *d) } static void -rdf_objfmt_output(yasm_objfmt *objfmt, FILE *f, int all_syms, - /*@unused@*/ yasm_dbgfmt *df, yasm_errwarns *errwarns) +rdf_objfmt_output(yasm_object *object, FILE *f, int all_syms, + yasm_errwarns *errwarns) { - yasm_objfmt_rdf *objfmt_rdf = (yasm_objfmt_rdf *)objfmt; + yasm_objfmt_rdf *objfmt_rdf = (yasm_objfmt_rdf *)object->objfmt; rdf_objfmt_output_info info; unsigned char *localbuf; long headerlen, filelen; xdf_str *cur; size_t len; + info.object = object; info.objfmt_rdf = objfmt_rdf; info.errwarns = errwarns; info.f = f; @@ -660,7 +654,7 @@ rdf_objfmt_output(yasm_objfmt *objfmt, FILE *f, int all_syms, /* Output symbol table */ info.indx = objfmt_rdf->parse_scnum; - yasm_symtab_traverse(objfmt_rdf->symtab, &info, rdf_objfmt_output_sym); + yasm_symtab_traverse(object->symtab, &info, rdf_objfmt_output_sym); /* UGH! Due to the fact the relocs go at the beginning of the file, and * we only know if we have relocs when we output the sections, we have @@ -674,12 +668,12 @@ rdf_objfmt_output(yasm_objfmt *objfmt, FILE *f, int all_syms, * * We also calculate the total size of all BSS sections here. */ - if (yasm_object_sections_traverse(objfmt_rdf->object, &info, + if (yasm_object_sections_traverse(object, &info, rdf_objfmt_output_section_mem)) return; /* Output all relocs */ - if (yasm_object_sections_traverse(objfmt_rdf->object, &info, + if (yasm_object_sections_traverse(object, &info, rdf_objfmt_output_section_reloc)) return; @@ -701,7 +695,7 @@ rdf_objfmt_output(yasm_objfmt *objfmt, FILE *f, int all_syms, } /* Section data (to file) */ - if (yasm_object_sections_traverse(objfmt_rdf->object, &info, + if (yasm_object_sections_traverse(object, &info, rdf_objfmt_output_section_file)) return; @@ -759,9 +753,10 @@ rdf_objfmt_destroy(yasm_objfmt *objfmt) } static rdf_section_data * -rdf_objfmt_init_new_section(yasm_objfmt_rdf *objfmt_rdf, yasm_section *sect, +rdf_objfmt_init_new_section(yasm_object *object, yasm_section *sect, const char *sectname, unsigned long line) { + yasm_objfmt_rdf *objfmt_rdf = (yasm_objfmt_rdf *)object->objfmt; rdf_section_data *data; yasm_symrec *sym; @@ -773,24 +768,22 @@ rdf_objfmt_init_new_section(yasm_objfmt_rdf *objfmt_rdf, yasm_section *sect, data->raw_data = NULL; yasm_section_add_data(sect, &rdf_section_data_cb, data); - sym = yasm_symtab_define_label(objfmt_rdf->symtab, sectname, + sym = yasm_symtab_define_label(object->symtab, sectname, yasm_section_bcs_first(sect), 1, line); data->sym = sym; return data; } static yasm_section * -rdf_objfmt_add_default_section(yasm_objfmt *objfmt) +rdf_objfmt_add_default_section(yasm_object *object) { - yasm_objfmt_rdf *objfmt_rdf = (yasm_objfmt_rdf *)objfmt; yasm_section *retval; rdf_section_data *rsd; int isnew; - retval = yasm_object_get_general(objfmt_rdf->object, ".text", 0, 0, 1, 0, - &isnew, 0); + retval = yasm_object_get_general(object, ".text", 0, 0, 1, 0, &isnew, 0); if (isnew) { - rsd = rdf_objfmt_init_new_section(objfmt_rdf, retval, ".text", 0); + rsd = rdf_objfmt_init_new_section(object, retval, ".text", 0); rsd->type = RDF_SECT_CODE; rsd->reserved = 0; yasm_section_set_default(retval, 1); @@ -799,12 +792,11 @@ rdf_objfmt_add_default_section(yasm_objfmt *objfmt) } static /*@observer@*/ /*@null@*/ yasm_section * -rdf_objfmt_section_switch(yasm_objfmt *objfmt, yasm_valparamhead *valparams, - /*@unused@*/ /*@null@*/ - yasm_valparamhead *objext_valparams, - unsigned long line) +rdf_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, + /*@unused@*/ /*@null@*/ + yasm_valparamhead *objext_valparams, + unsigned long line) { - yasm_objfmt_rdf *objfmt_rdf = (yasm_objfmt_rdf *)objfmt; yasm_valparam *vp = yasm_vps_first(valparams); yasm_section *retval; int isnew; @@ -885,11 +877,11 @@ rdf_objfmt_section_switch(yasm_objfmt *objfmt, yasm_valparamhead *valparams, vp->val); } - retval = yasm_object_get_general(objfmt_rdf->object, sectname, 0, 0, 1, + retval = yasm_object_get_general(object, sectname, 0, 0, 1, type == RDF_SECT_BSS, &isnew, line); if (isnew) - rsd = rdf_objfmt_init_new_section(objfmt_rdf, retval, sectname, line); + rsd = rdf_objfmt_init_new_section(object, retval, sectname, line); else rsd = yasm_section_get_data(retval, &rdf_section_data_cb); @@ -926,11 +918,10 @@ rdf_section_data_print(void *data, FILE *f, int indent_level) } static yasm_symrec * -rdf_objfmt_extern_declare(yasm_objfmt *objfmt, const char *name, /*@unused@*/ - /*@null@*/ yasm_valparamhead *objext_valparams, - unsigned long line) +rdf_objfmt_extern_declare(yasm_object *object, const char *name, /*@unused@*/ + /*@null@*/ yasm_valparamhead *objext_valparams, + unsigned long line) { - yasm_objfmt_rdf *objfmt_rdf = (yasm_objfmt_rdf *)objfmt; yasm_symrec *sym; unsigned int flags = 0; @@ -946,7 +937,7 @@ rdf_objfmt_extern_declare(yasm_objfmt *objfmt, const char *name, /*@unused@*/ { "far", SYM_FAR }, }; - sym = yasm_symtab_declare(objfmt_rdf->symtab, name, YASM_SYM_EXTERN, line); + sym = yasm_symtab_declare(object->symtab, name, YASM_SYM_EXTERN, line); if (objext_valparams) { yasm_valparam *vp = yasm_vps_first(objext_valparams); @@ -985,11 +976,10 @@ rdf_objfmt_extern_declare(yasm_objfmt *objfmt, const char *name, /*@unused@*/ } static yasm_symrec * -rdf_objfmt_global_declare(yasm_objfmt *objfmt, const char *name, /*@unused@*/ - /*@null@*/ yasm_valparamhead *objext_valparams, - unsigned long line) +rdf_objfmt_global_declare(yasm_object *object, const char *name, /*@unused@*/ + /*@null@*/ yasm_valparamhead *objext_valparams, + unsigned long line) { - yasm_objfmt_rdf *objfmt_rdf = (yasm_objfmt_rdf *)objfmt; yasm_symrec *sym; unsigned int flags = 0; @@ -1004,7 +994,7 @@ rdf_objfmt_global_declare(yasm_objfmt *objfmt, const char *name, /*@unused@*/ { "export", SYM_GLOBAL }, }; - sym = yasm_symtab_declare(objfmt_rdf->symtab, name, YASM_SYM_GLOBAL, line); + sym = yasm_symtab_declare(object->symtab, name, YASM_SYM_GLOBAL, line); if (objext_valparams) { yasm_valparam *vp = yasm_vps_first(objext_valparams); @@ -1037,16 +1027,15 @@ rdf_objfmt_global_declare(yasm_objfmt *objfmt, const char *name, /*@unused@*/ } static yasm_symrec * -rdf_objfmt_common_declare(yasm_objfmt *objfmt, const char *name, - /*@only@*/ yasm_expr *size, - yasm_valparamhead *objext_valparams, - unsigned long line) +rdf_objfmt_common_declare(yasm_object *object, const char *name, + /*@only@*/ yasm_expr *size, + yasm_valparamhead *objext_valparams, + unsigned long line) { - yasm_objfmt_rdf *objfmt_rdf = (yasm_objfmt_rdf *)objfmt; yasm_symrec *sym; unsigned long addralign = 0; - sym = yasm_symtab_declare(objfmt_rdf->symtab, name, YASM_SYM_COMMON, line); + sym = yasm_symtab_declare(object->symtab, name, YASM_SYM_COMMON, line); if (objext_valparams) { yasm_valparam *vp = yasm_vps_first(objext_valparams); @@ -1103,12 +1092,12 @@ rdf_symrec_data_print(void *data, FILE *f, int indent_level) } static int -rdf_objfmt_directive(yasm_objfmt *objfmt, const char *name, +rdf_objfmt_directive(yasm_object *object, const char *name, /*@null@*/ yasm_valparamhead *valparams, /*@unused@*/ /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line) { - yasm_objfmt_rdf *objfmt_rdf = (yasm_objfmt_rdf *)objfmt; + yasm_objfmt_rdf *objfmt_rdf = (yasm_objfmt_rdf *)object->objfmt; int lib; yasm_valparam *vp; xdf_str *str; diff --git a/modules/objfmts/xdf/xdf-objfmt.c b/modules/objfmts/xdf/xdf-objfmt.c index 5251d525..9e852216 100644 --- a/modules/objfmts/xdf/xdf-objfmt.c +++ b/modules/objfmts/xdf/xdf-objfmt.c @@ -87,13 +87,10 @@ typedef struct yasm_objfmt_xdf { yasm_objfmt_base objfmt; /* base structure */ long parse_scnum; /* sect numbering in parser */ - - yasm_object *object; - yasm_symtab *symtab; - /*@dependent@*/ yasm_arch *arch; } yasm_objfmt_xdf; typedef struct xdf_objfmt_output_info { + yasm_object *object; yasm_objfmt_xdf *objfmt_xdf; yasm_errwarns *errwarns; /*@dependent@*/ FILE *f; @@ -126,23 +123,19 @@ yasm_objfmt_module yasm_xdf_LTX_objfmt; static yasm_objfmt * -xdf_objfmt_create(yasm_object *object, yasm_arch *a) +xdf_objfmt_create(yasm_object *object) { yasm_objfmt_xdf *objfmt_xdf = yasm_xmalloc(sizeof(yasm_objfmt_xdf)); - objfmt_xdf->object = object; - objfmt_xdf->symtab = yasm_object_get_symtab(object); - objfmt_xdf->arch = a; - /* Only support x86 arch */ - if (yasm__strcasecmp(yasm_arch_keyword(a), "x86") != 0) { + if (yasm__strcasecmp(yasm_arch_keyword(object->arch), "x86") != 0) { yasm_xfree(objfmt_xdf); return NULL; } /* Support x86 and amd64 machines of x86 arch */ - if (yasm__strcasecmp(yasm_arch_get_machine(a), "x86") && - yasm__strcasecmp(yasm_arch_get_machine(a), "amd64")) { + if (yasm__strcasecmp(yasm_arch_get_machine(object->arch), "x86") && + yasm__strcasecmp(yasm_arch_get_machine(object->arch), "amd64")) { yasm_xfree(objfmt_xdf); return NULL; } @@ -177,7 +170,7 @@ xdf_objfmt_output_value(yasm_value *value, unsigned char *buf, * cross-section, or non-PC-relative reference (those are handled below). */ switch (yasm_value_output_basic(value, buf, destsize, bc, warn, - info->objfmt_xdf->arch)) { + info->object->arch)) { case -1: return 1; case 0: @@ -237,7 +230,7 @@ xdf_objfmt_output_value(yasm_value *value, unsigned char *buf, yasm_intnum_calc(intn, YASM_EXPR_ADD, intn2); } - retval = yasm_arch_intnum_tobytes(objfmt_xdf->arch, intn, buf, destsize, + retval = yasm_arch_intnum_tobytes(info->object->arch, intn, buf, destsize, valsize, 0, bc, warn); yasm_intnum_destroy(intn); return retval; @@ -560,14 +553,15 @@ xdf_objfmt_output_str(yasm_symrec *sym, /*@null@*/ void *d) } static void -xdf_objfmt_output(yasm_objfmt *objfmt, FILE *f, int all_syms, - /*@unused@*/ yasm_dbgfmt *df, yasm_errwarns *errwarns) +xdf_objfmt_output(yasm_object *object, FILE *f, int all_syms, + yasm_errwarns *errwarns) { - yasm_objfmt_xdf *objfmt_xdf = (yasm_objfmt_xdf *)objfmt; + yasm_objfmt_xdf *objfmt_xdf = (yasm_objfmt_xdf *)object->objfmt; xdf_objfmt_output_info info; unsigned char *localbuf; unsigned long symtab_count = 0; + info.object = object; info.objfmt_xdf = objfmt_xdf; info.errwarns = errwarns; info.f = f; @@ -583,20 +577,20 @@ xdf_objfmt_output(yasm_objfmt *objfmt, FILE *f, int all_syms, /* Get number of symbols */ info.indx = 0; info.all_syms = 1; /* force all syms into symbol table */ - yasm_symtab_traverse(objfmt_xdf->symtab, &info, xdf_objfmt_count_sym); + yasm_symtab_traverse(object->symtab, &info, xdf_objfmt_count_sym); symtab_count = info.indx; /* Get file offset of start of string table */ info.strtab_offset = 16+40*(objfmt_xdf->parse_scnum)+16*symtab_count; /* Output symbol table */ - yasm_symtab_traverse(objfmt_xdf->symtab, &info, xdf_objfmt_output_sym); + yasm_symtab_traverse(object->symtab, &info, xdf_objfmt_output_sym); /* Output string table */ - yasm_symtab_traverse(objfmt_xdf->symtab, &info, xdf_objfmt_output_str); + yasm_symtab_traverse(object->symtab, &info, xdf_objfmt_output_str); /* Section data/relocs */ - if (yasm_object_sections_traverse(objfmt_xdf->object, &info, + if (yasm_object_sections_traverse(object, &info, xdf_objfmt_output_section)) return; @@ -615,8 +609,7 @@ xdf_objfmt_output(yasm_objfmt *objfmt, FILE *f, int all_syms, YASM_WRITE_32_L(localbuf, info.strtab_offset-16); fwrite(info.buf, 16, 1, f); - yasm_object_sections_traverse(objfmt_xdf->object, &info, - xdf_objfmt_output_secthead); + yasm_object_sections_traverse(object, &info, xdf_objfmt_output_secthead); yasm_xfree(info.buf); } @@ -628,9 +621,10 @@ xdf_objfmt_destroy(yasm_objfmt *objfmt) } static xdf_section_data * -xdf_objfmt_init_new_section(yasm_objfmt_xdf *objfmt_xdf, yasm_section *sect, +xdf_objfmt_init_new_section(yasm_object *object, yasm_section *sect, const char *sectname, unsigned long line) { + yasm_objfmt_xdf *objfmt_xdf = (yasm_objfmt_xdf *)object->objfmt; xdf_section_data *data; yasm_symrec *sym; @@ -645,36 +639,33 @@ xdf_objfmt_init_new_section(yasm_objfmt_xdf *objfmt_xdf, yasm_section *sect, data->nreloc = 0; yasm_section_add_data(sect, &xdf_section_data_cb, data); - sym = yasm_symtab_define_label(objfmt_xdf->symtab, sectname, + sym = yasm_symtab_define_label(object->symtab, sectname, yasm_section_bcs_first(sect), 1, line); data->sym = sym; return data; } static yasm_section * -xdf_objfmt_add_default_section(yasm_objfmt *objfmt) +xdf_objfmt_add_default_section(yasm_object *object) { - yasm_objfmt_xdf *objfmt_xdf = (yasm_objfmt_xdf *)objfmt; yasm_section *retval; xdf_section_data *xsd; int isnew; - retval = yasm_object_get_general(objfmt_xdf->object, ".text", 0, 0, 1, 0, - &isnew, 0); + retval = yasm_object_get_general(object, ".text", 0, 0, 1, 0, &isnew, 0); if (isnew) { - xsd = xdf_objfmt_init_new_section(objfmt_xdf, retval, ".text", 0); + xsd = xdf_objfmt_init_new_section(object, retval, ".text", 0); yasm_section_set_default(retval, 1); } return retval; } static /*@observer@*/ /*@null@*/ yasm_section * -xdf_objfmt_section_switch(yasm_objfmt *objfmt, yasm_valparamhead *valparams, - /*@unused@*/ /*@null@*/ - yasm_valparamhead *objext_valparams, - unsigned long line) +xdf_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, + /*@unused@*/ /*@null@*/ + yasm_valparamhead *objext_valparams, + unsigned long line) { - yasm_objfmt_xdf *objfmt_xdf = (yasm_objfmt_xdf *)objfmt; yasm_valparam *vp = yasm_vps_first(valparams); yasm_section *retval; int isnew; @@ -703,15 +694,15 @@ xdf_objfmt_section_switch(yasm_objfmt *objfmt, yasm_valparamhead *valparams, if (yasm__strcasecmp(vp->val, "use16") == 0) { flags &= ~(XDF_SECT_USE_32|XDF_SECT_USE_64); flags |= XDF_SECT_USE_16; - yasm_arch_set_var(objfmt_xdf->arch, "mode_bits", 16); + yasm_arch_set_var(object->arch, "mode_bits", 16); } else if (yasm__strcasecmp(vp->val, "use32") == 0) { flags &= ~(XDF_SECT_USE_16|XDF_SECT_USE_64); flags |= XDF_SECT_USE_32; - yasm_arch_set_var(objfmt_xdf->arch, "mode_bits", 32); + yasm_arch_set_var(object->arch, "mode_bits", 32); } else if (yasm__strcasecmp(vp->val, "use64") == 0) { flags &= ~(XDF_SECT_USE_16|XDF_SECT_USE_32); flags |= XDF_SECT_USE_64; - yasm_arch_set_var(objfmt_xdf->arch, "mode_bits", 64); + yasm_arch_set_var(object->arch, "mode_bits", 64); } else if (yasm__strcasecmp(vp->val, "bss") == 0) { flags |= XDF_SECT_BSS; } else if (yasm__strcasecmp(vp->val, "flat") == 0) { @@ -764,11 +755,11 @@ xdf_objfmt_section_switch(yasm_objfmt *objfmt, yasm_valparamhead *valparams, vp->val); } - retval = yasm_object_get_general(objfmt_xdf->object, sectname, 0, align, 1, - resonly, &isnew, line); + retval = yasm_object_get_general(object, sectname, 0, align, 1, resonly, + &isnew, line); if (isnew) - xsd = xdf_objfmt_init_new_section(objfmt_xdf, retval, sectname, line); + xsd = xdf_objfmt_init_new_section(object, retval, sectname, line); else xsd = yasm_section_get_data(retval, &xdf_section_data_cb); @@ -823,41 +814,32 @@ xdf_section_data_print(void *data, FILE *f, int indent_level) } static yasm_symrec * -xdf_objfmt_extern_declare(yasm_objfmt *objfmt, const char *name, /*@unused@*/ - /*@null@*/ yasm_valparamhead *objext_valparams, - unsigned long line) +xdf_objfmt_extern_declare(yasm_object *object, const char *name, /*@unused@*/ + /*@null@*/ yasm_valparamhead *objext_valparams, + unsigned long line) { - yasm_objfmt_xdf *objfmt_xdf = (yasm_objfmt_xdf *)objfmt; - - return yasm_symtab_declare(objfmt_xdf->symtab, name, YASM_SYM_EXTERN, - line); + return yasm_symtab_declare(object->symtab, name, YASM_SYM_EXTERN, line); } static yasm_symrec * -xdf_objfmt_global_declare(yasm_objfmt *objfmt, const char *name, /*@unused@*/ - /*@null@*/ yasm_valparamhead *objext_valparams, - unsigned long line) +xdf_objfmt_global_declare(yasm_object *object, const char *name, /*@unused@*/ + /*@null@*/ yasm_valparamhead *objext_valparams, + unsigned long line) { - yasm_objfmt_xdf *objfmt_xdf = (yasm_objfmt_xdf *)objfmt; - - return yasm_symtab_declare(objfmt_xdf->symtab, name, YASM_SYM_GLOBAL, - line); + return yasm_symtab_declare(object->symtab, name, YASM_SYM_GLOBAL, line); } static yasm_symrec * -xdf_objfmt_common_declare(yasm_objfmt *objfmt, const char *name, - /*@only@*/ yasm_expr *size, /*@unused@*/ /*@null@*/ - yasm_valparamhead *objext_valparams, - unsigned long line) +xdf_objfmt_common_declare(yasm_object *object, const char *name, + /*@only@*/ yasm_expr *size, /*@unused@*/ /*@null@*/ + yasm_valparamhead *objext_valparams, + unsigned long line) { - yasm_objfmt_xdf *objfmt_xdf = (yasm_objfmt_xdf *)objfmt; - yasm_expr_destroy(size); yasm_error_set(YASM_ERROR_GENERAL, N_("XDF object format does not support common variables")); - return yasm_symtab_declare(objfmt_xdf->symtab, name, YASM_SYM_COMMON, - line); + return yasm_symtab_declare(object->symtab, name, YASM_SYM_COMMON, line); } static void @@ -875,7 +857,7 @@ xdf_symrec_data_print(void *data, FILE *f, int indent_level) } static int -xdf_objfmt_directive(/*@unused@*/ yasm_objfmt *objfmt, +xdf_objfmt_directive(/*@unused@*/ yasm_object *object, /*@unused@*/ const char *name, /*@unused@*/ /*@null@*/ yasm_valparamhead *valparams, /*@unused@*/ /*@null@*/ diff --git a/modules/parsers/gas/gas-parse.c b/modules/parsers/gas/gas-parse.c index 02774fd1..227acf76 100644 --- a/modules/parsers/gas/gas-parse.c +++ b/modules/parsers/gas/gas-parse.c @@ -72,10 +72,12 @@ static yasm_bytecode *gas_parser_dir_fill (yasm_parser_gas *parser_gas, /*@only@*/ yasm_expr *repeat, /*@only@*/ /*@null@*/ yasm_expr *size, /*@only@*/ /*@null@*/ yasm_expr *value); +#if 0 static void gas_parser_directive (yasm_parser_gas *parser_gas, const char *name, yasm_valparamhead *valparams, /*@null@*/ yasm_valparamhead *objext_valparams); +#endif #define is_eol_tok(tok) ((tok) == '\n' || (tok) == ';' || (tok) == 0) #define is_eol() is_eol_tok(curtok) @@ -215,7 +217,7 @@ gas_parser_parse(yasm_parser_gas *parser_gas) yasm_errwarn_propagate(parser_gas->errwarns, cur_line); - temp_bc = yasm_section_bcs_append(parser_gas->cur_section, bc); + temp_bc = yasm_section_bcs_append(cursect, bc); if (temp_bc) parser_gas->prev_bc = temp_bc; if (curtok == ';') @@ -377,8 +379,8 @@ parse_line(yasm_parser_gas *parser_gas) } } - return gas_parser_align(parser_gas, parser_gas->cur_section, bound, - fill, maxskip, (int)ival); + return gas_parser_align(parser_gas, cursect, bound, fill, maxskip, + (int)ival); } case DIR_ORG: get_next_token(); /* DIR_ORG */ @@ -393,16 +395,14 @@ parse_line(yasm_parser_gas *parser_gas) case DIR_LOCAL: get_next_token(); /* DIR_LOCAL */ if (!expect(ID)) return NULL; - yasm_symtab_declare(parser_gas->symtab, ID_val, YASM_SYM_DLOCAL, - cur_line); + yasm_symtab_declare(p_symtab, ID_val, YASM_SYM_DLOCAL, cur_line); yasm_xfree(ID_val); get_next_token(); /* ID */ return NULL; case DIR_GLOBAL: get_next_token(); /* DIR_GLOBAL */ if (!expect(ID)) return NULL; - yasm_objfmt_global_declare(parser_gas->objfmt, ID_val, NULL, - cur_line); + yasm_objfmt_global_declare(p_object, ID_val, NULL, cur_line); yasm_xfree(ID_val); get_next_token(); /* ID */ return NULL; @@ -436,7 +436,7 @@ parse_line(yasm_parser_gas *parser_gas) } /* If already explicitly declared local, treat like LCOMM */ if (is_lcomm - || ((sym = yasm_symtab_get(parser_gas->symtab, id)) + || ((sym = yasm_symtab_get(p_symtab, id)) && yasm_symrec_get_visibility(sym) == YASM_SYM_DLOCAL)) { define_lcomm(parser_gas, id, e, align); } else if (align) { @@ -445,14 +445,12 @@ parse_line(yasm_parser_gas *parser_gas) vp = yasm_vp_create(NULL, align); yasm_vps_append(&vps, vp); - yasm_objfmt_common_declare(parser_gas->objfmt, id, e, &vps, - cur_line); + yasm_objfmt_common_declare(p_object, id, e, &vps, cur_line); yasm_vps_delete(&vps); yasm_xfree(id); } else { - yasm_objfmt_common_declare(parser_gas->objfmt, id, e, NULL, - cur_line); + yasm_objfmt_common_declare(p_object, id, e, NULL, cur_line); yasm_xfree(id); } return NULL; @@ -461,8 +459,7 @@ parse_line(yasm_parser_gas *parser_gas) get_next_token(); /* DIR_EXTERN */ if (!expect(ID)) return NULL; /* Go ahead and do it, even though all undef become extern */ - yasm_objfmt_extern_declare(parser_gas->objfmt, ID_val, NULL, - cur_line); + yasm_objfmt_extern_declare(p_object, ID_val, NULL, cur_line); yasm_xfree(ID_val); get_next_token(); /* ID */ return NULL; @@ -475,8 +472,7 @@ parse_line(yasm_parser_gas *parser_gas) yasm_vps_append(&vps, vp); get_next_token(); /* ID */ - yasm_objfmt_directive(parser_gas->objfmt, "weak", &vps, NULL, - cur_line); + yasm_objfmt_directive(p_object, "weak", &vps, NULL, cur_line); yasm_vps_delete(&vps); return NULL; @@ -487,14 +483,14 @@ parse_line(yasm_parser_gas *parser_gas) get_next_token(); /* DIR_ASCII */ if (!parse_strvals(parser_gas, &dvs)) return NULL; - return yasm_bc_create_data(&dvs, 1, (int)ival, parser_gas->arch, + return yasm_bc_create_data(&dvs, 1, (int)ival, p_object->arch, cur_line); case DIR_DATA: ival = DIR_DATA_val; get_next_token(); /* DIR_DATA */ if (!parse_datavals(parser_gas, &dvs)) return NULL; - return yasm_bc_create_data(&dvs, ival, 0, parser_gas->arch, + return yasm_bc_create_data(&dvs, ival, 0, p_object->arch, cur_line); case DIR_LEB128: ival = DIR_LEB128_val; @@ -516,7 +512,7 @@ parse_line(yasm_parser_gas *parser_gas) yasm_dvs_initialize(&dvs); yasm_dvs_append(&dvs, yasm_dv_create_expr( p_expr_new_ident(yasm_expr_int(yasm_intnum_create_uint(0))))); - bc = yasm_bc_create_data(&dvs, 1, 0, parser_gas->arch, cur_line); + bc = yasm_bc_create_data(&dvs, 1, 0, p_object->arch, cur_line); yasm_bc_set_multiple(bc, e); return bc; case DIR_SKIP: @@ -536,7 +532,7 @@ parse_line(yasm_parser_gas *parser_gas) e_val = parse_expr(parser_gas); yasm_dvs_initialize(&dvs); yasm_dvs_append(&dvs, yasm_dv_create_expr(e_val)); - bc = yasm_bc_create_data(&dvs, 1, 0, parser_gas->arch, cur_line); + bc = yasm_bc_create_data(&dvs, 1, 0, p_object->arch, cur_line); yasm_bc_set_multiple(bc, e); return bc; @@ -628,8 +624,7 @@ parse_line(yasm_parser_gas *parser_gas) get_next_token(); /* DIR_IDENT */ if (!parse_dirstrvals(parser_gas, &vps)) return NULL; - yasm_objfmt_directive(parser_gas->objfmt, "ident", &vps, NULL, - cur_line); + yasm_objfmt_directive(p_object, "ident", &vps, NULL, cur_line); yasm_vps_delete(&vps); return NULL; case DIR_FILE: @@ -667,8 +662,7 @@ parse_line(yasm_parser_gas *parser_gas) vp = yasm_vp_create(filename, NULL); yasm_vps_append(&vps, vp); - yasm_dbgfmt_directive(parser_gas->dbgfmt, "file", - parser_gas->cur_section, &vps, cur_line); + yasm_dbgfmt_directive(p_object, "file", &vps, cur_line); yasm_vps_delete(&vps); return NULL; @@ -691,8 +685,7 @@ parse_line(yasm_parser_gas *parser_gas) yasm_vps_append(&vps, vp); get_next_token(); /* STRING */ - yasm_dbgfmt_directive(parser_gas->dbgfmt, "file", - parser_gas->cur_section, &vps, cur_line); + yasm_dbgfmt_directive(p_object, "file", &vps, cur_line); yasm_vps_delete(&vps); return NULL; @@ -725,8 +718,7 @@ parse_line(yasm_parser_gas *parser_gas) yasm_vps_append(&vps, vp); get_next_token(); /* INTNUM */ - yasm_dbgfmt_directive(parser_gas->dbgfmt, "loc", - parser_gas->cur_section, &vps, cur_line); + yasm_dbgfmt_directive(p_object, "loc", &vps, cur_line); yasm_vps_delete(&vps); return NULL; @@ -760,8 +752,7 @@ parse_line(yasm_parser_gas *parser_gas) yasm_vps_append(&vps, vp); get_next_token(); /* ID */ - yasm_objfmt_directive(parser_gas->objfmt, "type", &vps, NULL, - cur_line); + yasm_objfmt_directive(p_object, "type", &vps, NULL, cur_line); yasm_vps_delete(&vps); return NULL; @@ -791,8 +782,7 @@ parse_line(yasm_parser_gas *parser_gas) vp = yasm_vp_create(NULL, e); yasm_vps_append(&vps, vp); - yasm_objfmt_directive(parser_gas->objfmt, "size", &vps, NULL, - cur_line); + yasm_objfmt_directive(p_object, "size", &vps, NULL, cur_line); yasm_vps_delete(&vps); return NULL; @@ -818,7 +808,7 @@ parse_instr(yasm_parser_gas *parser_gas) get_next_token(); if (is_eol()) { /* no operands */ - return yasm_bc_create_insn(parser_gas->arch, insn.arch_data, + return yasm_bc_create_insn(p_object->arch, insn.arch_data, 0, NULL, cur_line); } @@ -843,7 +833,7 @@ parse_instr(yasm_parser_gas *parser_gas) } get_next_token(); } - return yasm_bc_create_insn(parser_gas->arch, insn.arch_data, + return yasm_bc_create_insn(p_object->arch, insn.arch_data, num_operands, &operands, cur_line); } case PREFIX: @@ -852,7 +842,7 @@ parse_instr(yasm_parser_gas *parser_gas) get_next_token(); /* PREFIX */ bc = parse_instr(parser_gas); if (!bc) - bc = yasm_bc_create_empty_insn(parser_gas->arch, cur_line); + bc = yasm_bc_create_empty_insn(p_object->arch, cur_line); yasm_bc_insn_add_prefix(bc, prefix.arch_data); return bc; } @@ -862,7 +852,7 @@ parse_instr(yasm_parser_gas *parser_gas) get_next_token(); /* SEGREG */ bc = parse_instr(parser_gas); if (!bc) - bc = yasm_bc_create_empty_insn(parser_gas->arch, cur_line); + bc = yasm_bc_create_empty_insn(p_object->arch, cur_line); yasm_bc_insn_add_seg_prefix(bc, segreg); } default: @@ -1084,7 +1074,7 @@ done: if (!e1) return NULL; - ea = yasm_arch_ea_create(parser_gas->arch, e1); + ea = yasm_arch_ea_create(p_object->arch, e1); if (strong) yasm_ea_set_strong(ea, 1); return ea; @@ -1135,7 +1125,7 @@ parse_operand(yasm_parser_gas *parser_gas) return NULL; } get_next_token(); /* ')' */ - reg = yasm_arch_reggroup_get_reg(parser_gas->arch, reg, regindex); + reg = yasm_arch_reggroup_get_reg(p_object->arch, reg, regindex); if (reg == 0) { yasm_error_set(YASM_ERROR_SYNTAX, N_("bad register index `%u'"), regindex); @@ -1414,8 +1404,8 @@ gas_get_section(yasm_parser_gas *parser_gas, char *name, } } - new_section = yasm_objfmt_section_switch(parser_gas->objfmt, &vps, - objext_valparams, cur_line); + new_section = yasm_objfmt_section_switch(p_object, &vps, objext_valparams, + cur_line); yasm_vps_delete(&vps); return new_section; @@ -1432,7 +1422,7 @@ gas_switch_section(yasm_parser_gas *parser_gas, char *name, new_section = gas_get_section(parser_gas, yasm__xstrdup(name), flags, type, objext_valparams, builtin); if (new_section) { - parser_gas->cur_section = new_section; + cursect = new_section; parser_gas->prev_bc = yasm_section_bcs_last(new_section); } else yasm_error_set(YASM_ERROR_GENERAL, N_("invalid section name `%s'"), @@ -1471,7 +1461,7 @@ gas_parser_align(yasm_parser_gas *parser_gas, yasm_section *sect, return yasm_bc_create_align(boundval, fillval, maxskipval, yasm_section_is_code(sect) ? - yasm_arch_get_fill(parser_gas->arch) : NULL, + yasm_arch_get_fill(p_object->arch) : NULL, cur_line); } @@ -1506,13 +1496,13 @@ gas_parser_dir_fill(yasm_parser_gas *parser_gas, /*@only@*/ yasm_expr *repeat, yasm_dvs_initialize(&dvs); yasm_dvs_append(&dvs, yasm_dv_create_expr(value)); - bc = yasm_bc_create_data(&dvs, ssize, 0, parser_gas->arch, cur_line); + bc = yasm_bc_create_data(&dvs, ssize, 0, p_object->arch, cur_line); yasm_bc_set_multiple(bc, repeat); return bc; } - +#if 0 static void gas_parser_directive(yasm_parser_gas *parser_gas, const char *name, yasm_valparamhead *valparams, @@ -1521,10 +1511,10 @@ gas_parser_directive(yasm_parser_gas *parser_gas, const char *name, unsigned long line = cur_line; /* Handle (mostly) output-format independent directives here */ - if (!yasm_arch_parse_directive(parser_gas->arch, name, valparams, + if (!yasm_arch_parse_directive(p_object->arch, name, valparams, objext_valparams, parser_gas->object, line)) { ; - } else if (yasm_objfmt_directive(parser_gas->objfmt, name, valparams, + } else if (yasm_objfmt_directive(p_object, name, valparams, objext_valparams, line)) { yasm_error_set(YASM_ERROR_GENERAL, N_("unrecognized directive [%s]"), name); @@ -1534,3 +1524,4 @@ gas_parser_directive(yasm_parser_gas *parser_gas, const char *name, if (objext_valparams) yasm_vps_delete(objext_valparams); } +#endif diff --git a/modules/parsers/gas/gas-parser.c b/modules/parsers/gas/gas-parser.c index bbc5c586..2b79db82 100644 --- a/modules/parsers/gas/gas-parser.c +++ b/modules/parsers/gas/gas-parser.c @@ -37,16 +37,14 @@ static void -gas_parser_do_parse(yasm_object *object, yasm_preproc *pp, yasm_arch *a, - yasm_objfmt *of, yasm_dbgfmt *df, FILE *f, - const char *in_filename, int save_input, - yasm_section *def_sect, yasm_errwarns *errwarns) +gas_parser_do_parse(yasm_object *object, yasm_preproc *pp, FILE *f, + int save_input, yasm_linemap *linemap, + yasm_errwarns *errwarns) { yasm_parser_gas parser_gas; parser_gas.object = object; - parser_gas.linemap = yasm_object_get_linemap(parser_gas.object); - parser_gas.symtab = yasm_object_get_symtab(parser_gas.object); + parser_gas.linemap = linemap; parser_gas.in = f; @@ -58,13 +56,9 @@ gas_parser_do_parse(yasm_object *object, yasm_preproc *pp, yasm_arch *a, parser_gas.dir_line = 0; parser_gas.preproc = pp; - parser_gas.arch = a; - parser_gas.objfmt = of; - parser_gas.dbgfmt = df; parser_gas.errwarns = errwarns; - parser_gas.cur_section = def_sect; - parser_gas.prev_bc = yasm_section_bcs_first(def_sect); + parser_gas.prev_bc = yasm_section_bcs_first(object->cur_section); parser_gas.save_input = save_input; parser_gas.save_last = 0; diff --git a/modules/parsers/gas/gas-parser.h b/modules/parsers/gas/gas-parser.h index 80a92cd3..71b293f2 100644 --- a/modules/parsers/gas/gas-parser.h +++ b/modules/parsers/gas/gas-parser.h @@ -115,7 +115,6 @@ typedef struct yasm_parser_gas { int debug; /*@only@*/ yasm_object *object; - /*@dependent@*/ yasm_section *cur_section; /* last "base" label for local (.) labels */ /*@null@*/ char *locallabel_base; @@ -127,13 +126,9 @@ typedef struct yasm_parser_gas { unsigned long dir_line; /*@dependent@*/ yasm_preproc *preproc; - /*@dependent@*/ yasm_arch *arch; - /*@dependent@*/ yasm_objfmt *objfmt; - /*@dependent@*/ yasm_dbgfmt *dbgfmt; /*@dependent@*/ yasm_errwarns *errwarns; /*@dependent@*/ yasm_linemap *linemap; - /*@dependent@*/ yasm_symtab *symtab; /*@null@*/ yasm_bytecode *prev_bc; yasm_bytecode *temp_bc; @@ -163,7 +158,9 @@ typedef struct yasm_parser_gas { } yasm_parser_gas; /* shorter access names to commonly used parser_gas fields */ -#define p_symtab (parser_gas->symtab) +#define p_object (parser_gas->object) +#define p_symtab (parser_gas->object->symtab) +#define cursect (parser_gas->object->cur_section) #define curtok (parser_gas->token) #define curval (parser_gas->tokval) diff --git a/modules/parsers/gas/gas-token.re b/modules/parsers/gas/gas-token.re index eca535bd..b1742bd5 100644 --- a/modules/parsers/gas/gas-token.re +++ b/modules/parsers/gas/gas-token.re @@ -126,13 +126,13 @@ rept_input(yasm_parser_gas *parser_gas, /*@out@*/ YYCTYPE *buf, return (max_size-numleft); } - +#if 0 static size_t fill_input(void *d, unsigned char *buf, size_t max) { return yasm_preproc_input((yasm_preproc *)d, (char *)buf, max); } - +#endif static YYCTYPE * fill(yasm_parser_gas *parser_gas, YYCTYPE *cursor) { @@ -406,7 +406,7 @@ scan: parser_gas->state = INSTDIR; RETURN(DIR_DATA); } '.word' { - lvalp->int_info = yasm_arch_wordsize(parser_gas->arch)/8; + lvalp->int_info = yasm_arch_wordsize(p_object->arch)/8; parser_gas->state = INSTDIR; RETURN(DIR_DATA); } '.quad' { @@ -487,15 +487,15 @@ scan: '.zero' { parser_gas->state = INSTDIR; RETURN(DIR_ZERO); } /* other directives */ '.code16' { - yasm_arch_set_var(parser_gas->arch, "mode_bits", 16); + yasm_arch_set_var(p_object->arch, "mode_bits", 16); goto scan; } '.code32' { - yasm_arch_set_var(parser_gas->arch, "mode_bits", 32); + yasm_arch_set_var(p_object->arch, "mode_bits", 32); goto scan; } '.code64' { - yasm_arch_set_var(parser_gas->arch, "mode_bits", 64); + yasm_arch_set_var(p_object->arch, "mode_bits", 64); goto scan; } '.equ' { parser_gas->state = INSTDIR; RETURN(DIR_EQU); } @@ -518,7 +518,7 @@ scan: savech = s->tok[TOKLEN]; s->tok[TOKLEN] = '\0'; switch (yasm_arch_parse_check_regtmod - (parser_gas->arch, lvalp->arch_data, TOK+1, TOKLEN-1)) { + (p_object->arch, lvalp->arch_data, TOK+1, TOKLEN-1)) { case YASM_ARCH_REG: s->tok[TOKLEN] = savech; RETURN(REG); @@ -562,7 +562,7 @@ scan: savech = s->tok[TOKLEN]; s->tok[TOKLEN] = '\0'; switch (yasm_arch_parse_check_insnprefix - (parser_gas->arch, lvalp->arch_data, TOK, TOKLEN)) { + (p_object->arch, lvalp->arch_data, TOK, TOKLEN)) { case YASM_ARCH_INSN: s->tok[TOKLEN] = savech; parser_gas->state = INSTDIR; diff --git a/modules/parsers/nasm/nasm-parse.c b/modules/parsers/nasm/nasm-parse.c index 9c2bc9bf..db115da4 100644 --- a/modules/parsers/nasm/nasm-parse.c +++ b/modules/parsers/nasm/nasm-parse.c @@ -199,7 +199,7 @@ nasm_parser_parse(yasm_parser_nasm *parser_nasm) yasm_errwarn_propagate(parser_nasm->errwarns, cur_line); - temp_bc = yasm_section_bcs_append(parser_nasm->cur_section, bc); + temp_bc = yasm_section_bcs_append(cursect, bc); if (temp_bc) parser_nasm->prev_bc = temp_bc; if (parser_nasm->save_input) @@ -506,7 +506,7 @@ dv_done: if (is_eol()) /* allow trailing , on list */ break; } - return yasm_bc_create_data(&dvs, size, 0, parser_nasm->arch, + return yasm_bc_create_data(&dvs, size, 0, p_object->arch, cur_line); } case RESERVE_SPACE: @@ -583,8 +583,8 @@ parse_instr(yasm_parser_nasm *parser_nasm) get_next_token(); if (is_eol()) { /* no operands */ - return yasm_bc_create_insn(parser_nasm->arch, insn.arch_data, - 0, NULL, cur_line); + return yasm_bc_create_insn(p_object->arch, insn.arch_data, 0, + NULL, cur_line); } /* parse operands */ @@ -608,7 +608,7 @@ parse_instr(yasm_parser_nasm *parser_nasm) } get_next_token(); } - return yasm_bc_create_insn(parser_nasm->arch, insn.arch_data, + return yasm_bc_create_insn(p_object->arch, insn.arch_data, num_operands, &operands, cur_line); } case PREFIX: { @@ -677,7 +677,7 @@ parse_operand(yasm_parser_nasm *parser_nasm) if (!op) return NULL; if (op->type == YASM_INSN__OPERAND_REG && - yasm_arch_get_reg_size(parser_nasm->arch, op->data.reg) != size) + yasm_arch_get_reg_size(p_object->arch, op->data.reg) != size) yasm_error_set(YASM_ERROR_TYPE, N_("cannot override register size")); else { @@ -761,7 +761,7 @@ parse_memaddr(yasm_parser_nasm *parser_nasm) yasm_expr *e = parse_expr(parser_nasm, NORM_EXPR); if (!e) return NULL; - return yasm_arch_ea_create(parser_nasm->arch, e); + return yasm_arch_ea_create(p_object->arch, e); } } } @@ -957,8 +957,7 @@ parse_expr6(yasm_parser_nasm *parser_nasm, expr_type type) case ID: e = p_expr_new_ident(yasm_expr_sym( yasm_symtab_define_label(p_symtab, ID_val, - yasm_section_bcs_first(parser_nasm->cur_section), 0, - cur_line))); + yasm_section_bcs_first(cursect), 0, cur_line))); yasm_xfree(ID_val); break; default: @@ -1032,7 +1031,7 @@ parse_expr6(yasm_parser_nasm *parser_nasm, expr_type type) case START_SECTION_ID: /* "$$" references the start of the current section */ sym = yasm_symtab_define_label(p_symtab, "$$", - yasm_section_bcs_first(parser_nasm->cur_section), 0, cur_line); + yasm_section_bcs_first(cursect), 0, cur_line); e = p_expr_new_ident(yasm_expr_sym(sym)); break; default: @@ -1079,8 +1078,7 @@ dir_extern(yasm_parser_nasm *parser_nasm, yasm_valparamhead *valparams, yasm_valparamhead *objext_valparams) { yasm_valparam *vp = yasm_vps_first(valparams); - yasm_objfmt_extern_declare(parser_nasm->objfmt, vp->val, objext_valparams, - cur_line); + yasm_objfmt_extern_declare(p_object, vp->val, objext_valparams, cur_line); } static void @@ -1088,8 +1086,7 @@ dir_global(yasm_parser_nasm *parser_nasm, yasm_valparamhead *valparams, yasm_valparamhead *objext_valparams) { yasm_valparam *vp = yasm_vps_first(valparams); - yasm_objfmt_global_declare(parser_nasm->objfmt, vp->val, objext_valparams, - cur_line); + yasm_objfmt_global_declare(p_object, vp->val, objext_valparams, cur_line); } static void @@ -1106,12 +1103,12 @@ dir_common(yasm_parser_nasm *parser_nasm, yasm_valparamhead *valparams, return; } if (vp2->val) { - yasm_objfmt_common_declare(parser_nasm->objfmt, vp->val, + yasm_objfmt_common_declare(p_object, vp->val, p_expr_new_ident(yasm_expr_sym( yasm_symtab_use(p_symtab, vp2->val, line))), objext_valparams, line); } else if (vp2->param) { - yasm_objfmt_common_declare(parser_nasm->objfmt, vp->val, vp2->param, + yasm_objfmt_common_declare(p_object, vp->val, vp2->param, objext_valparams, line); vp2->param = NULL; } @@ -1121,12 +1118,11 @@ static void dir_section(yasm_parser_nasm *parser_nasm, yasm_valparamhead *valparams, yasm_valparamhead *objext_valparams) { - yasm_valparam *vp = yasm_vps_first(valparams); yasm_section *new_section = - yasm_objfmt_section_switch(parser_nasm->objfmt, valparams, - objext_valparams, cur_line); + yasm_objfmt_section_switch(p_object, valparams, objext_valparams, + cur_line); if (new_section) { - parser_nasm->cur_section = new_section; + cursect = new_section; parser_nasm->prev_bc = yasm_section_bcs_last(new_section); } else yasm_error_set(YASM_ERROR_SYNTAX, N_("invalid argument to [%s]"), @@ -1141,16 +1137,16 @@ dir_absolute(yasm_parser_nasm *parser_nasm, yasm_valparamhead *valparams, unsigned long line = cur_line; /* it can be just an ID or a complete expression, so handle both. */ if (vp->val) - parser_nasm->cur_section = - yasm_object_create_absolute(parser_nasm->object, + cursect = + yasm_object_create_absolute(p_object, p_expr_new_ident(yasm_expr_sym( yasm_symtab_use(p_symtab, vp->val, line))), line); else if (vp->param) { - parser_nasm->cur_section = - yasm_object_create_absolute(parser_nasm->object, vp->param, line); + cursect = + yasm_object_create_absolute(p_object, vp->param, line); vp->param = NULL; } - parser_nasm->prev_bc = yasm_section_bcs_last(parser_nasm->cur_section); + parser_nasm->prev_bc = yasm_section_bcs_last(cursect); } static void @@ -1181,9 +1177,8 @@ dir_align(yasm_parser_nasm *parser_nasm, yasm_valparamhead *valparams, /* Alignments must be a power of two. */ if (is_exp2(boundint)) { - if (boundint > yasm_section_get_align(parser_nasm->cur_section)) - yasm_section_set_align(parser_nasm->cur_section, boundint, - cur_line); + if (boundint > yasm_section_get_align(cursect)) + yasm_section_set_align(cursect, boundint, cur_line); } } @@ -1191,10 +1186,10 @@ dir_align(yasm_parser_nasm *parser_nasm, yasm_valparamhead *valparams, * use arch (nop) fill. */ parser_nasm->prev_bc = - yasm_section_bcs_append(parser_nasm->cur_section, + yasm_section_bcs_append(cursect, yasm_bc_create_align(boundval, NULL, NULL, - /*yasm_section_is_code(parser_nasm->cur_section) ?*/ - yasm_arch_get_fill(parser_nasm->arch)/* : NULL*/, + /*yasm_section_is_code(cursect) ?*/ + yasm_arch_get_fill(p_object->arch)/* : NULL*/, cur_line)); } @@ -1205,7 +1200,7 @@ dir_cpu(yasm_parser_nasm *parser_nasm, yasm_valparamhead *valparams, yasm_valparam *vp; yasm_vps_foreach(vp, valparams) { if (vp->val) - yasm_arch_parse_cpu(parser_nasm->arch, vp->val, strlen(vp->val)); + yasm_arch_parse_cpu(p_object->arch, vp->val, strlen(vp->val)); else if (vp->param) { const yasm_intnum *intcpu; intcpu = yasm_expr_get_intnum(&vp->param, 0); @@ -1215,7 +1210,7 @@ dir_cpu(yasm_parser_nasm *parser_nasm, yasm_valparamhead *valparams, else { char strcpu[16]; sprintf(strcpu, "%lu", yasm_intnum_get_uint(intcpu)); - yasm_arch_parse_cpu(parser_nasm->arch, strcpu, strlen(strcpu)); + yasm_arch_parse_cpu(p_object->arch, strcpu, strlen(strcpu)); } } } @@ -1267,14 +1262,12 @@ nasm_parser_directive(yasm_parser_nasm *parser_nasm, const char *name, if (i != NELEMS(dirs)) { ; - } else if (!yasm_arch_parse_directive(parser_nasm->arch, name, valparams, - objext_valparams, parser_nasm->object, line)) { + } else if (!yasm_arch_parse_directive(p_object->arch, name, valparams, + objext_valparams, p_object, line)) { ; - } else if (!yasm_dbgfmt_directive(parser_nasm->dbgfmt, name, - parser_nasm->cur_section, valparams, - line)) { + } else if (!yasm_dbgfmt_directive(p_object, name, valparams, line)) { ; - } else if (yasm_objfmt_directive(parser_nasm->objfmt, name, valparams, + } else if (yasm_objfmt_directive(p_object, name, valparams, objext_valparams, line)) { yasm_error_set(YASM_ERROR_SYNTAX, N_("unrecognized directive [%s]"), name); diff --git a/modules/parsers/nasm/nasm-parser.c b/modules/parsers/nasm/nasm-parser.c index a5173bd5..9599e4a4 100644 --- a/modules/parsers/nasm/nasm-parser.c +++ b/modules/parsers/nasm/nasm-parser.c @@ -34,16 +34,14 @@ static void -nasm_parser_do_parse(yasm_object *object, yasm_preproc *pp, yasm_arch *a, - yasm_objfmt *of, yasm_dbgfmt *df, FILE *f, - const char *in_filename, int save_input, - yasm_section *def_sect, yasm_errwarns *errwarns) +nasm_parser_do_parse(yasm_object *object, yasm_preproc *pp, FILE *f, + int save_input, yasm_linemap *linemap, + yasm_errwarns *errwarns) { yasm_parser_nasm parser_nasm; parser_nasm.object = object; - parser_nasm.linemap = yasm_object_get_linemap(parser_nasm.object); - parser_nasm.symtab = yasm_object_get_symtab(parser_nasm.object); + parser_nasm.linemap = linemap; parser_nasm.in = f; @@ -51,13 +49,9 @@ nasm_parser_do_parse(yasm_object *object, yasm_preproc *pp, yasm_arch *a, parser_nasm.locallabel_base_len = 0; parser_nasm.preproc = pp; - parser_nasm.arch = a; - parser_nasm.objfmt = of; - parser_nasm.dbgfmt = df; parser_nasm.errwarns = errwarns; - parser_nasm.cur_section = def_sect; - parser_nasm.prev_bc = yasm_section_bcs_first(def_sect); + parser_nasm.prev_bc = yasm_section_bcs_first(object->cur_section); parser_nasm.save_input = save_input; parser_nasm.save_last = 0; diff --git a/modules/parsers/nasm/nasm-parser.h b/modules/parsers/nasm/nasm-parser.h index 3eff7b9d..949b7c00 100644 --- a/modules/parsers/nasm/nasm-parser.h +++ b/modules/parsers/nasm/nasm-parser.h @@ -82,20 +82,15 @@ typedef struct yasm_parser_nasm { int debug; /*@only@*/ yasm_object *object; - /*@dependent@*/ yasm_section *cur_section; /* last "base" label for local (.) labels */ /*@null@*/ char *locallabel_base; size_t locallabel_base_len; /*@dependent@*/ yasm_preproc *preproc; - /*@dependent@*/ yasm_arch *arch; - /*@dependent@*/ yasm_objfmt *objfmt; - /*@dependent@*/ yasm_dbgfmt *dbgfmt; /*@dependent@*/ yasm_errwarns *errwarns; /*@dependent@*/ yasm_linemap *linemap; - /*@dependent@*/ yasm_symtab *symtab; /*@null@*/ yasm_bytecode *prev_bc; @@ -125,7 +120,9 @@ typedef struct yasm_parser_nasm { } yasm_parser_nasm; /* shorter access names to commonly used parser_nasm fields */ -#define p_symtab (parser_nasm->symtab) +#define p_object (parser_nasm->object) +#define p_symtab (parser_nasm->object->symtab) +#define cursect (parser_nasm->object->cur_section) #define curtok (parser_nasm->token) #define curval (parser_nasm->tokval) diff --git a/modules/parsers/nasm/nasm-token.re b/modules/parsers/nasm/nasm-token.re index e75e3d31..b72883d9 100644 --- a/modules/parsers/nasm/nasm-token.re +++ b/modules/parsers/nasm/nasm-token.re @@ -227,71 +227,71 @@ scan: /* size specifiers */ 'byte' { lvalp->int_info = 8; RETURN(SIZE_OVERRIDE); } 'hword' { - lvalp->int_info = yasm_arch_wordsize(parser_nasm->arch)/2; + lvalp->int_info = yasm_arch_wordsize(p_object->arch)/2; RETURN(SIZE_OVERRIDE); } 'word' { - lvalp->int_info = yasm_arch_wordsize(parser_nasm->arch); + lvalp->int_info = yasm_arch_wordsize(p_object->arch); RETURN(SIZE_OVERRIDE); } 'dword' | 'long' { - lvalp->int_info = yasm_arch_wordsize(parser_nasm->arch)*2; + lvalp->int_info = yasm_arch_wordsize(p_object->arch)*2; RETURN(SIZE_OVERRIDE); } 'qword' { - lvalp->int_info = yasm_arch_wordsize(parser_nasm->arch)*4; + lvalp->int_info = yasm_arch_wordsize(p_object->arch)*4; RETURN(SIZE_OVERRIDE); } 'tword' { lvalp->int_info = 80; RETURN(SIZE_OVERRIDE); } 'dqword' { - lvalp->int_info = yasm_arch_wordsize(parser_nasm->arch)*8; + lvalp->int_info = yasm_arch_wordsize(p_object->arch)*8; RETURN(SIZE_OVERRIDE); } /* pseudo-instructions */ 'db' { lvalp->int_info = 8; RETURN(DECLARE_DATA); } 'dhw' { - lvalp->int_info = yasm_arch_wordsize(parser_nasm->arch)/2; + lvalp->int_info = yasm_arch_wordsize(p_object->arch)/2; RETURN(DECLARE_DATA); } 'dw' { - lvalp->int_info = yasm_arch_wordsize(parser_nasm->arch); + lvalp->int_info = yasm_arch_wordsize(p_object->arch); RETURN(DECLARE_DATA); } 'dd' { - lvalp->int_info = yasm_arch_wordsize(parser_nasm->arch)*2; + lvalp->int_info = yasm_arch_wordsize(p_object->arch)*2; RETURN(DECLARE_DATA); } 'dq' { - lvalp->int_info = yasm_arch_wordsize(parser_nasm->arch)*4; + lvalp->int_info = yasm_arch_wordsize(p_object->arch)*4; RETURN(DECLARE_DATA); } 'dt' { lvalp->int_info = 80; RETURN(DECLARE_DATA); } 'ddq' { - lvalp->int_info = yasm_arch_wordsize(parser_nasm->arch)*8; + lvalp->int_info = yasm_arch_wordsize(p_object->arch)*8; RETURN(DECLARE_DATA); } 'resb' { lvalp->int_info = 8; RETURN(RESERVE_SPACE); } 'reshw' { - lvalp->int_info = yasm_arch_wordsize(parser_nasm->arch)/2; + lvalp->int_info = yasm_arch_wordsize(p_object->arch)/2; RETURN(RESERVE_SPACE); } 'resw' { - lvalp->int_info = yasm_arch_wordsize(parser_nasm->arch); + lvalp->int_info = yasm_arch_wordsize(p_object->arch); RETURN(RESERVE_SPACE); } 'resd' { - lvalp->int_info = yasm_arch_wordsize(parser_nasm->arch)*2; + lvalp->int_info = yasm_arch_wordsize(p_object->arch)*2; RETURN(RESERVE_SPACE); } 'resq' { - lvalp->int_info = yasm_arch_wordsize(parser_nasm->arch)*4; + lvalp->int_info = yasm_arch_wordsize(p_object->arch)*4; RETURN(RESERVE_SPACE); } 'rest' { lvalp->int_info = 80; RETURN(RESERVE_SPACE); } 'resdq' { - lvalp->int_info = yasm_arch_wordsize(parser_nasm->arch)*8; + lvalp->int_info = yasm_arch_wordsize(p_object->arch)*8; RETURN(RESERVE_SPACE); } @@ -352,7 +352,7 @@ scan: s->tok[TOKLEN] = '\0'; if (parser_nasm->state != INSTRUCTION) switch (yasm_arch_parse_check_insnprefix - (parser_nasm->arch, lvalp->arch_data, TOK, TOKLEN)) { + (p_object->arch, lvalp->arch_data, TOK, TOKLEN)) { case YASM_ARCH_INSN: parser_nasm->state = INSTRUCTION; s->tok[TOKLEN] = savech; @@ -364,7 +364,7 @@ scan: break; } switch (yasm_arch_parse_check_regtmod - (parser_nasm->arch, lvalp->arch_data, TOK, TOKLEN)) { + (p_object->arch, lvalp->arch_data, TOK, TOKLEN)) { case YASM_ARCH_REG: s->tok[TOKLEN] = savech; RETURN(REG); @@ -616,7 +616,7 @@ directive2: savech = s->tok[TOKLEN]; s->tok[TOKLEN] = '\0'; switch (yasm_arch_parse_check_regtmod - (parser_nasm->arch, lvalp->arch_data, TOK, TOKLEN)) { + (p_object->arch, lvalp->arch_data, TOK, TOKLEN)) { case YASM_ARCH_REG: s->tok[TOKLEN] = savech; RETURN(REG); From 8174ecfa55562ccd17168a8511b710b13bb04522 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 19 May 2007 17:22:28 +0000 Subject: [PATCH 013/585] Merge [1819], [1820], [1821] from trunk: Massive update of directive handling. svn path=/branches/yasm-0.6.x/; revision=1847 --- frontends/yasm/yasm.c | 4 +- libyasm/arch.h | 50 +- libyasm/coretype.h | 16 +- libyasm/dbgfmt.h | 25 +- libyasm/hamt.c | 45 +- libyasm/hamt.h | 3 +- libyasm/linemap.c | 2 +- libyasm/objfmt.h | 96 +- libyasm/section.c | 162 + libyasm/section.h | 21 + libyasm/symrec.c | 139 +- libyasm/symrec.h | 59 +- libyasm/valparam.c | 44 + libyasm/valparam.h | 52 + libyasm/value.h | 2 +- modules/arch/x86/x86arch.c | 99 +- modules/arch/x86/x86arch.h | 3 +- modules/arch/x86/x86id.c | 4 +- modules/dbgfmts/codeview/cv-dbgfmt.c | 9 +- modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c | 15 +- modules/dbgfmts/dwarf2/dwarf2-dbgfmt.h | 9 +- modules/dbgfmts/dwarf2/dwarf2-line.c | 333 +- .../dwarf2/tests/pass32/dwarf32_testhd.hex | 188 +- .../dwarf2/tests/pass64/dwarf64_leb128.hex | 23024 ++++++++-------- .../tests/passwin64/dwarfwin64_testhd.errwarn | 2 + modules/dbgfmts/null/null-dbgfmt.c | 9 +- modules/dbgfmts/stabs/stabs-dbgfmt.c | 9 +- modules/objfmts/bin/bin-objfmt.c | 153 +- modules/objfmts/coff/coff-objfmt.c | 269 +- modules/objfmts/coff/win64-except.c | 4 +- modules/objfmts/dbg/dbg-objfmt.c | 80 +- modules/objfmts/elf/elf-objfmt.c | 422 +- modules/objfmts/elf/elf.c | 2 - modules/objfmts/elf/elf.h | 2 +- modules/objfmts/elf/tests/elfmanysym.hex | 96 +- modules/objfmts/elf/tests/elfvisibility.asm | 5 + modules/objfmts/elf/tests/elfvisibility.hex | 8 +- .../elf/tests/gas64/elf_gas64_reloc.hex | 12 +- modules/objfmts/macho/macho-objfmt.c | 86 +- modules/objfmts/rdf/rdf-objfmt.c | 368 +- modules/objfmts/rdf/tests/rdfabs.errwarn | 4 +- modules/objfmts/xdf/xdf-objfmt.c | 58 +- modules/parsers/gas/gas-parse.c | 236 +- modules/parsers/gas/gas-parser.h | 7 - modules/parsers/gas/gas-token.re | 20 - modules/parsers/nasm/nasm-parse.c | 188 +- 46 files changed, 13020 insertions(+), 13424 deletions(-) diff --git a/frontends/yasm/yasm.c b/frontends/yasm/yasm.c index 4a315bda..effe0e99 100644 --- a/frontends/yasm/yasm.c +++ b/frontends/yasm/yasm.c @@ -453,7 +453,7 @@ do_assemble(FILE *in) yasm_symtab_parser_finalize(object->symtab, strcmp(cur_parser_module->keyword, "gas")==0 || strcmp(cur_parser_module->keyword, "gnu")==0, - object, errwarns); + errwarns); check_errors(errwarns, object, linemap); /* Finalize parse */ @@ -604,7 +604,7 @@ main(int argc, char *argv[]) /* Check for arch help */ if (machine_name && strcmp(machine_name, "help") == 0) { - yasm_arch_machine *m = cur_arch_module->machines; + const yasm_arch_machine *m = cur_arch_module->machines; printf(_("Available %s for %s `%s':\n"), _("machines"), _("architecture"), cur_arch_module->keyword); while (m->keyword && m->name) { diff --git a/libyasm/arch.h b/libyasm/arch.h index 4a12884d..6ee9cdd9 100644 --- a/libyasm/arch.h +++ b/libyasm/arch.h @@ -106,6 +106,9 @@ typedef struct yasm_arch_module { */ const char *keyword; + /** NULL-terminated list of directives. NULL if none. */ + /*@null@*/ const yasm_directive *directives; + /** Create architecture. * Module-level implementation of yasm_arch_create(). * Call yasm_arch_create() instead of calling this function. @@ -133,11 +136,6 @@ typedef struct yasm_arch_module { */ int (*set_var) (yasm_arch *arch, const char *var, unsigned long val); - /** Module-level implementation of yasm_arch_parse_cpu(). - * Call yasm_arch_parse_cpu() instead of calling this function. - */ - void (*parse_cpu) (yasm_arch *arch, const char *cpuid, size_t cpuid_len); - /** Module-level implementation of yasm_arch_parse_check_insnprefix(). * Call yasm_arch_parse_check_insnprefix() instead of calling this function. */ @@ -152,14 +150,6 @@ typedef struct yasm_arch_module { (yasm_arch *arch, /*@out@*/ uintptr_t *data, const char *id, size_t id_len); - /** Module-level implementation of yasm_arch_parse_directive(). - * Call yasm_arch_parse_directive() instead of calling this function. - */ - int (*parse_directive) (yasm_arch *arch, const char *name, - /*@null@*/ yasm_valparamhead *valparams, - /*@null@*/ yasm_valparamhead *objext_valparams, - yasm_object *object, unsigned long line); - /** Module-level implementation of yasm_arch_get_fill(). * Call yasm_arch_get_fill() instead of calling this function. */ @@ -219,7 +209,7 @@ typedef struct yasm_arch_module { * Call yasm_arch_get_machine() to get the active machine of a particular * #yasm_arch. */ - yasm_arch_machine *machines; + const yasm_arch_machine *machines; /** Default machine keyword. * Call yasm_arch_get_machine() to get the active machine of a particular @@ -352,15 +342,6 @@ unsigned int yasm_arch_get_address_size(const yasm_arch *arch); */ int yasm_arch_set_var(yasm_arch *arch, const char *var, unsigned long val); -/** Switch available instructions/registers/etc based on a user-specified - * CPU identifier. Should modify behavior ONLY of parse_* functions! The - * bytecode and output functions should be able to handle any CPU. - * \param arch architecture - * \param cpuid cpu identifier as in the input file - * \param cpuid_len length of cpu identifier string - */ -void yasm_arch_parse_cpu(yasm_arch *arch, const char *cpuid, size_t cpuid_len); - /** Check an generic identifier to see if it matches architecture specific * names for instructions or instruction prefixes. Unrecognized identifiers * should return #YASM_ARCH_NOTINSNPREFIX so they can be treated as normal @@ -393,23 +374,6 @@ yasm_arch_regtmod yasm_arch_parse_check_regtmod (yasm_arch *arch, /*@out@*/ uintptr_t *data, const char *id, size_t id_len); -/** Handle architecture-specific directives. - * Should modify behavior ONLY of parse functions, much like parse_cpu(). - * \param arch architecture - * \param name directive name - * \param valparams value/parameters - * \param objext_valparams object format extensions - * value/parameters - * \param object object - * \param line virtual line (as from yasm_linemap) - * \return Nonzero if directive was not recognized; 0 if directive was - * recognized, even if it wasn't valid. - */ -int yasm_arch_parse_directive(yasm_arch *arch, const char *name, - /*@null@*/ yasm_valparamhead *valparams, - /*@null@*/ yasm_valparamhead *objext_valparams, - yasm_object *object, unsigned long line); - /** Get NOP fill patterns for 1-15 bytes of fill. * \param arch architecture * \return 16-entry array of arrays; [0] is unused, [1] - [15] point to arrays @@ -542,18 +506,12 @@ yasm_effaddr *yasm_arch_ea_create(yasm_arch *arch, /*@keep@*/ yasm_expr *e); ((yasm_arch_base *)arch)->module->get_address_size(arch) #define yasm_arch_set_var(arch, var, val) \ ((yasm_arch_base *)arch)->module->set_var(arch, var, val) -#define yasm_arch_parse_cpu(arch, cpuid, cpuid_len) \ - ((yasm_arch_base *)arch)->module->parse_cpu(arch, cpuid, cpuid_len) #define yasm_arch_parse_check_insnprefix(arch, data, id, id_len) \ ((yasm_arch_base *)arch)->module->parse_check_insnprefix(arch, data, id, \ id_len) #define yasm_arch_parse_check_regtmod(arch, data, id, id_len) \ ((yasm_arch_base *)arch)->module->parse_check_regtmod(arch, data, id, \ id_len) -#define yasm_arch_parse_directive(arch, name, valparams, objext_valparams, \ - object, line) \ - ((yasm_arch_base *)arch)->module->parse_directive \ - (arch, name, valparams, objext_valparams, object, line) #define yasm_arch_get_fill(arch) \ ((yasm_arch_base *)arch)->module->get_fill(arch) #define yasm_arch_finalize_insn(arch, bc, prev_bc, data, num_operands, \ diff --git a/libyasm/coretype.h b/libyasm/coretype.h index 3f5e3a79..b07d8d68 100644 --- a/libyasm/coretype.h +++ b/libyasm/coretype.h @@ -187,6 +187,10 @@ typedef struct yasm_valparam yasm_valparam; * \see valparam.h for related functions. */ typedef struct yasm_valparamhead yasm_valparamhead; +/** Directive list entry. + * \see valparam.h for details and related functions. + */ +typedef struct yasm_directive yasm_directive; /** A list of instruction operands (opaque type). * The list goes from left-to-right as parsed. @@ -232,18 +236,6 @@ typedef enum yasm_expr_op { YASM_EXPR_SEGOFF /**< The ':' in segment:offset. */ } yasm_expr_op; -/** Symbol record visibility. - * \see symrec.h for related functions. - * \note YASM_SYM_EXTERN and YASM_SYM_COMMON are mutually exclusive. - */ -typedef enum yasm_sym_vis { - YASM_SYM_LOCAL = 0, /**< Default, local only */ - YASM_SYM_GLOBAL = 1 << 0, /**< If symbol is declared GLOBAL */ - YASM_SYM_COMMON = 1 << 1, /**< If symbol is declared COMMON */ - YASM_SYM_EXTERN = 1 << 2, /**< If symbol is declared EXTERN */ - YASM_SYM_DLOCAL = 1 << 3 /**< If symbol is explicitly declared LOCAL */ -} yasm_sym_vis; - /** Convert yasm_value to its byte representation. Usually implemented by * object formats to keep track of relocations and verify legal expressions. * Must put the value into the least significant bits of the destination, diff --git a/libyasm/dbgfmt.h b/libyasm/dbgfmt.h index acf357a6..021127e7 100644 --- a/libyasm/dbgfmt.h +++ b/libyasm/dbgfmt.h @@ -52,6 +52,9 @@ struct yasm_dbgfmt_module { /** Keyword used to select debug format. */ const char *keyword; + /** NULL-terminated list of directives. NULL if none. */ + /*@null@*/ const yasm_directive *directives; + /** Create debug format. * Module-level implementation of yasm_dbgfmt_create(). * The filenames are provided solely for informational purposes. @@ -65,13 +68,6 @@ struct yasm_dbgfmt_module { */ void (*destroy) (/*@only@*/ yasm_dbgfmt *dbgfmt); - /** Module-level implementation of yasm_dbgfmt_directive(). - * Call yasm_dbgfmt_directive() instead of calling this function. - */ - int (*directive) (yasm_object *object, const char *name, - /*@null@*/ yasm_valparamhead *valparams, - unsigned long line); - /** Module-level implementation of yasm_dbgfmt_generate(). * Call yasm_dbgfmt_generate() instead of calling this function. */ @@ -100,18 +96,6 @@ const char *yasm_dbgfmt_keyword(const yasm_dbgfmt *dbgfmt); */ void yasm_dbgfmt_destroy(/*@only@*/ yasm_dbgfmt *dbgfmt); -/** DEBUG directive support. - * \param object object - * \param name directive name - * \param valparams value/parameters - * \param line virtual line (from yasm_linemap) - * \return Nonzero if directive was not recognized; 0 if directive was - * recognized even if it wasn't valid. - */ -int yasm_dbgfmt_directive(yasm_object *object, const char *name, - /*@null@*/ yasm_valparamhead *valparams, - unsigned long line); - /** Generate debugging information bytecodes. * \param object object * \param linemap virtual/physical line mapping @@ -133,9 +117,6 @@ void yasm_dbgfmt_generate(yasm_object *object, yasm_linemap *linemap, #define yasm_dbgfmt_destroy(dbgfmt) \ ((yasm_dbgfmt_base *)dbgfmt)->module->destroy(dbgfmt) -#define yasm_dbgfmt_directive(object, name, valparams, line) \ - ((yasm_dbgfmt_base *)((object)->dbgfmt))->module->directive \ - (object, name, valparams, line) #define yasm_dbgfmt_generate(object, linemap, ews) \ ((yasm_dbgfmt_base *)((object)->dbgfmt))->module->generate \ (object, linemap, ews) diff --git a/libyasm/hamt.c b/libyasm/hamt.c index 6eee0586..c6617b6d 100644 --- a/libyasm/hamt.c +++ b/libyasm/hamt.c @@ -33,6 +33,8 @@ #include "util.h" /*@unused@*/ RCSID("$Id$"); +#include + #include "libyasm-stdint.h" #include "coretype.h" #include "hamt.h" @@ -53,6 +55,8 @@ struct HAMT { HAMTNode *root; /*@exits@*/ void (*error_func) (const char *file, unsigned int line, const char *message); + unsigned long (*HashKey) (const char *key); + unsigned long (*ReHashKey) (const char *key, int Level); }; /* XXX make a portable version of this. This depends on the pointer being @@ -92,8 +96,26 @@ ReHashKey(const char *key, int Level) return vHash; } +static unsigned long +HashKey_nocase(const char *key) +{ + unsigned long a=31415, b=27183, vHash; + for (vHash=0; *key; key++, a*=b) + vHash = a*vHash + tolower(*key); + return vHash; +} + +static unsigned long +ReHashKey_nocase(const char *key, int Level) +{ + unsigned long a=31415, b=27183, vHash; + for (vHash=0; *key; key++, a*=b) + vHash = a*vHash*(unsigned long)Level + tolower(*key); + return vHash; +} + HAMT * -HAMT_create(/*@exits@*/ void (*error_func) +HAMT_create(int nocase, /*@exits@*/ void (*error_func) (const char *file, unsigned int line, const char *message)) { /*@out@*/ HAMT *hamt = yasm_xmalloc(sizeof(HAMT)); @@ -108,6 +130,13 @@ HAMT_create(/*@exits@*/ void (*error_func) } hamt->error_func = error_func; + if (nocase) { + hamt->HashKey = HashKey_nocase; + hamt->ReHashKey = ReHashKey_nocase; + } else { + hamt->HashKey = HashKey; + hamt->ReHashKey = ReHashKey; + } return hamt; } @@ -195,7 +224,7 @@ HAMT_insert(HAMT *hamt, const char *str, void *data, int *replace, int keypartbits = 0; int level = 0; - key = HashKey(str); + key = hamt->HashKey(str); keypart = key & 0x1F; node = &hamt->root[keypart]; @@ -236,9 +265,9 @@ HAMT_insert(HAMT *hamt, const char *str, void *data, int *replace, keypartbits += 5; if (keypartbits > 30) { /* Exceeded 32 bits: rehash */ - key = ReHashKey(str, level); - key2 = ReHashKey(((HAMTEntry *)(node->BaseValue))->str, - level); + key = hamt->ReHashKey(str, level); + key2 = hamt->ReHashKey( + ((HAMTEntry *)(node->BaseValue))->str, level); keypartbits = 0; } keypart = (key >> keypartbits) & 0x1F; @@ -288,7 +317,7 @@ HAMT_insert(HAMT *hamt, const char *str, void *data, int *replace, keypartbits += 5; if (keypartbits > 30) { /* Exceeded 32 bits of current key: rehash */ - key = ReHashKey(str, level); + key = hamt->ReHashKey(str, level); keypartbits = 0; } keypart = (key >> keypartbits) & 0x1F; @@ -347,7 +376,7 @@ HAMT_search(HAMT *hamt, const char *str) int keypartbits = 0; int level = 0; - key = HashKey(str); + key = hamt->HashKey(str); keypart = key & 0x1F; node = &hamt->root[keypart]; @@ -366,7 +395,7 @@ HAMT_search(HAMT *hamt, const char *str) keypartbits += 5; if (keypartbits > 30) { /* Exceeded 32 bits of current key: rehash */ - key = ReHashKey(str, level); + key = hamt->ReHashKey(str, level); keypartbits = 0; } keypart = (key >> keypartbits) & 0x1F; diff --git a/libyasm/hamt.h b/libyasm/hamt.h index 865844ca..88204eda 100644 --- a/libyasm/hamt.h +++ b/libyasm/hamt.h @@ -41,10 +41,11 @@ typedef struct HAMTEntry HAMTEntry; /** Create new, empty, HAMT. error_func() is called when an internal error is * encountered--it should NOT return to the calling function. + * \param nocase nonzero if HAMT should be case-insensitive * \param error_func function called on internal error * \return New, empty, hash array mapped trie. */ -HAMT *HAMT_create(/*@exits@*/ void (*error_func) +HAMT *HAMT_create(int nocase, /*@exits@*/ void (*error_func) (const char *file, unsigned int line, const char *message)); /** Delete HAMT and all data associated with it. Uses deletefunc() to delete diff --git a/libyasm/linemap.c b/libyasm/linemap.c index 08ad385b..bf28cb49 100644 --- a/libyasm/linemap.c +++ b/libyasm/linemap.c @@ -151,7 +151,7 @@ yasm_linemap_create(void) size_t i; yasm_linemap *linemap = yasm_xmalloc(sizeof(yasm_linemap)); - linemap->filenames = HAMT_create(yasm_internal_error_); + linemap->filenames = HAMT_create(0, yasm_internal_error_); linemap->current = 1; diff --git a/libyasm/objfmt.h b/libyasm/objfmt.h index 9ada7d2c..ce610b06 100644 --- a/libyasm/objfmt.h +++ b/libyasm/objfmt.h @@ -74,6 +74,9 @@ struct yasm_objfmt_module { */ const char *default_dbgfmt_keyword; + /** NULL-terminated list of directives. NULL if none. */ + /*@null@*/ const yasm_directive *directives; + /** Create object format. * Module-level implementation of yasm_objfmt_create(). * Call yasm_objfmt_create() instead of calling this function. @@ -106,35 +109,6 @@ struct yasm_objfmt_module { (*section_switch)(yasm_object *object, yasm_valparamhead *valparams, /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line); - - /** Module-level implementation of yasm_objfmt_extern_declare(). - * Call yasm_objfmt_extern_declare() instead of calling this function. - */ - yasm_symrec * (*extern_declare) - (yasm_object *object, const char *name, - /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line); - - /** Module-level implementation of yasm_objfmt_global_declare(). - * Call yasm_objfmt_global_declare() instead of calling this function. - */ - yasm_symrec * (*global_declare) - (yasm_object *object, const char *name, - /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line); - - /** Module-level implementation of yasm_objfmt_common_declare(). - * Call yasm_objfmt_common_declare() instead of calling this function. - */ - yasm_symrec * (*common_declare) - (yasm_object *object, const char *name, /*@only@*/ yasm_expr *size, - /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line); - - /** Module-level implementation of yasm_objfmt_directive(). - * Call yasm_objfmt_directive() instead of calling this function. - */ - int (*directive) (yasm_object *object, const char *name, - /*@null@*/ yasm_valparamhead *valparams, - /*@null@*/ yasm_valparamhead *objext_valparams, - unsigned long line); }; /** Create object format. @@ -182,58 +156,6 @@ yasm_section *yasm_objfmt_add_default_section(yasm_object *object); (yasm_object *object, yasm_valparamhead *valparams, /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line); -/** Declare an "extern" (importing from another module) symbol. Should - * call yasm_symtab_declare(). - * \param object object - * \param name symbol name - * \param objext_valparams object format-specific value/paramaters - * \param line virtual line (from yasm_linemap) - * \return Declared symbol. - */ -yasm_symrec *yasm_objfmt_extern_declare - (yasm_object *object, const char *name, - /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line); - -/** Declare a "global" (exporting to other modules) symbol. Should call - * yasm_symtab_declare(). - * \param object object - * \param name symbol name - * \param objext_valparams object format-specific value/paramaters - * \param line virtual line (from yasm_linemap) - * \return Declared symbol. - */ -yasm_symrec *yasm_objfmt_global_declare - (yasm_object *object, const char *name, - /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line); - -/** Declare a "common" (shared space with other modules) symbol. Should - * call yasm_symtab_declare(). - * declaration. - * \param object object - * \param name symbol name - * \param size common data size - * \param objext_valparams object format-specific value/paramaters - * \param line virtual line (from yasm_linemap) - * \return Declared symbol. - */ -yasm_symrec *yasm_objfmt_common_declare - (yasm_object *object, const char *name, /*@only@*/ yasm_expr *size, - /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line); - -/** Handle object format-specific directives. - * \param object object - * \param name directive name - * \param valparams value/parameters - * \param objext_valparams object format-specific value/parameters - * \param line virtual line (from yasm_linemap) - * \return Nonzero if directive was not recognized; 0 if directive was - * recognized, even if it wasn't valid. - */ -int yasm_objfmt_directive(yasm_object *object, const char *name, - /*@null@*/ yasm_valparamhead *valparams, - /*@null@*/ yasm_valparamhead *objext_valparams, - unsigned long line); - #ifndef YASM_DOXYGEN /* Inline macro implementations for objfmt functions */ @@ -248,18 +170,6 @@ int yasm_objfmt_directive(yasm_object *object, const char *name, #define yasm_objfmt_section_switch(object, vpms, oe_vpms, line) \ ((yasm_objfmt_base *)((object)->objfmt))->module->section_switch \ (object, vpms, oe_vpms, line) -#define yasm_objfmt_extern_declare(object, name, oe_vpms, line) \ - ((yasm_objfmt_base *)((object)->objfmt))->module->extern_declare \ - (object, name, oe_vpms, line) -#define yasm_objfmt_global_declare(object, name, oe_vpms, line) \ - ((yasm_objfmt_base *)((object)->objfmt))->module->global_declare \ - (object, name, oe_vpms, line) -#define yasm_objfmt_common_declare(object, name, size, oe_vpms, line) \ - ((yasm_objfmt_base *)((object)->objfmt))->module->common_declare \ - (object, name, size, oe_vpms, line) -#define yasm_objfmt_directive(object, name, vpms, oe_vpms, line) \ - ((yasm_objfmt_base *)((object)->objfmt))->module->directive \ - (object, name, vpms, oe_vpms, line) #define yasm_objfmt_add_default_section(object) \ ((yasm_objfmt_base *)((object)->objfmt))->module->add_default_section \ (object) diff --git a/libyasm/section.c b/libyasm/section.c index 812218ac..02b6741d 100644 --- a/libyasm/section.c +++ b/libyasm/section.c @@ -32,6 +32,7 @@ #include "libyasm-stdint.h" #include "coretype.h" +#include "hamt.h" #include "valparam.h" #include "assocdat.h" @@ -101,6 +102,130 @@ struct yasm_section { static void yasm_section_destroy(/*@only@*/ yasm_section *sect); +/* Wrapper around directive for HAMT insertion */ +typedef struct yasm_directive_wrap { + const yasm_directive *directive; +} yasm_directive_wrap; + +/* + * Standard "builtin" object directives. + */ + +static void +dir_extern(yasm_object *object, yasm_valparamhead *valparams, + yasm_valparamhead *objext_valparams, unsigned long line) +{ + yasm_valparam *vp = yasm_vps_first(valparams); + yasm_symrec *sym; + sym = yasm_symtab_declare(object->symtab, vp->val, YASM_SYM_EXTERN, line); + if (objext_valparams) { + yasm_valparamhead *vps = yasm_vps_create(); + *vps = *objext_valparams; /* structure copy */ + yasm_vps_initialize(objext_valparams); /* don't double-free */ + yasm_symrec_set_objext_valparams(sym, vps); + } +} + +static void +dir_global(yasm_object *object, yasm_valparamhead *valparams, + yasm_valparamhead *objext_valparams, unsigned long line) +{ + yasm_valparam *vp = yasm_vps_first(valparams); + yasm_symrec *sym; + sym = yasm_symtab_declare(object->symtab, vp->val, YASM_SYM_GLOBAL, line); + if (objext_valparams) { + yasm_valparamhead *vps = yasm_vps_create(); + *vps = *objext_valparams; /* structure copy */ + yasm_vps_initialize(objext_valparams); /* don't double-free */ + yasm_symrec_set_objext_valparams(sym, vps); + } +} + +static void +dir_common(yasm_object *object, yasm_valparamhead *valparams, + yasm_valparamhead *objext_valparams, unsigned long line) +{ + yasm_valparam *vp = yasm_vps_first(valparams); + yasm_valparam *vp2 = yasm_vps_next(vp); + yasm_expr *size = yasm_vp_expr(vp2, object->symtab, line); + yasm_symrec *sym; + + if (!size) { + yasm_error_set(YASM_ERROR_SYNTAX, + N_("no size specified in %s declaration"), "COMMON"); + return; + } + sym = yasm_symtab_declare(object->symtab, vp->val, YASM_SYM_COMMON, line); + yasm_symrec_set_common_size(sym, size); + if (objext_valparams) { + yasm_valparamhead *vps = yasm_vps_create(); + *vps = *objext_valparams; /* structure copy */ + yasm_vps_initialize(objext_valparams); /* don't double-free */ + yasm_symrec_set_objext_valparams(sym, vps); + } +} + +static void +dir_section(yasm_object *object, yasm_valparamhead *valparams, + yasm_valparamhead *objext_valparams, unsigned long line) +{ + yasm_section *new_section = + yasm_objfmt_section_switch(object, valparams, objext_valparams, line); + if (new_section) + object->cur_section = new_section; + else + yasm_error_set(YASM_ERROR_SYNTAX, + N_("invalid argument to directive `%s'"), "SECTION"); +} + +static const yasm_directive object_directives[] = { + { ".extern", "gas", dir_extern, YASM_DIR_ID_REQUIRED }, + { ".global", "gas", dir_global, YASM_DIR_ID_REQUIRED }, + { ".globl", "gas", dir_global, YASM_DIR_ID_REQUIRED }, + { "extern", "nasm", dir_extern, YASM_DIR_ID_REQUIRED }, + { "global", "nasm", dir_global, YASM_DIR_ID_REQUIRED }, + { "common", "nasm", dir_common, YASM_DIR_ID_REQUIRED }, + { "section", "nasm", dir_section, YASM_DIR_ARG_REQUIRED }, + { "segment", "nasm", dir_section, YASM_DIR_ARG_REQUIRED }, + { NULL, NULL, NULL, 0 } +}; + +static void +directive_level2_delete(/*@only@*/ void *data) +{ + yasm_xfree(data); +} + +static void +directive_level1_delete(/*@only@*/ void *data) +{ + HAMT_destroy(data, directive_level2_delete); +} + +static void +directives_add(yasm_object *object, /*@null@*/ const yasm_directive *dir) +{ + if (!dir) + return; + + while (dir->name) { + HAMT *level2 = HAMT_search(object->directives, dir->parser); + int replace; + yasm_directive_wrap *wrap = yasm_xmalloc(sizeof(yasm_directive_wrap)); + + if (!level2) { + replace = 0; + level2 = HAMT_insert(object->directives, dir->parser, + HAMT_create(1, yasm_internal_error_), + &replace, directive_level1_delete); + } + replace = 0; + wrap->directive = dir; + HAMT_insert(level2, dir->name, wrap, &replace, + directive_level2_delete); + dir++; + } +} /*@-compdestroy@*/ yasm_object * @@ -121,6 +246,9 @@ yasm_object_create(const char *src_filename, const char *obj_filename, /* Initialize sections linked list */ STAILQ_INIT(&object->sections); + /* Create directives HAMT */ + object->directives = HAMT_create(1, yasm_internal_error_); + /* Initialize the target architecture */ object->arch = arch; @@ -167,6 +295,15 @@ yasm_object_create(const char *src_filename, const char *obj_filename, goto error; } + /* Add directives to HAMT. Note ordering here determines priority. */ + directives_add(object, + ((yasm_objfmt_base *)object->objfmt)->module->directives); + directives_add(object, + ((yasm_dbgfmt_base *)object->dbgfmt)->module->directives); + directives_add(object, + ((yasm_arch_base *)object->arch)->module->directives); + directives_add(object, object_directives); + return object; error: @@ -274,6 +411,28 @@ yasm_object_create_absolute(yasm_object *object, yasm_expr *start, } /*@=onlytrans@*/ +int +yasm_object_directive(yasm_object *object, const char *name, + const char *parser, yasm_valparamhead *valparams, + yasm_valparamhead *objext_valparams, + unsigned long line) +{ + HAMT *level2; + yasm_directive_wrap *wrap; + + level2 = HAMT_search(object->directives, parser); + if (!level2) + return 1; + + wrap = HAMT_search(level2, name); + if (!wrap) + return 1; + + yasm_call_directive(wrap->directive, object, valparams, objext_valparams, + line); + return 0; +} + void yasm_object_set_source_fn(yasm_object *object, const char *src_filename) { @@ -358,6 +517,9 @@ yasm_object_destroy(yasm_object *object) cur = next; } + /* Delete directives HAMT */ + HAMT_destroy(object->directives, directive_level1_delete); + /* Delete associated filenames */ yasm_xfree(object->src_filename); yasm_xfree(object->obj_filename); diff --git a/libyasm/section.h b/libyasm/section.h index 07db95ff..1b1b18f3 100644 --- a/libyasm/section.h +++ b/libyasm/section.h @@ -61,7 +61,13 @@ struct yasm_object { /*@dependent@*/ yasm_section *cur_section; #ifdef YASM_LIB_INTERNAL + /** Linked list of sections. */ /*@reldef@*/ STAILQ_HEAD(yasm_sectionhead, yasm_section) sections; + + /** Directives, organized as two level HAMT; first level is parser, + * second level is directive name. + */ + /*@owned@*/ struct HAMT *directives; #endif }; @@ -112,6 +118,21 @@ struct yasm_object { /*@dependent@*/ yasm_section *yasm_object_create_absolute (yasm_object *object, /*@keep@*/ yasm_expr *start, unsigned long line); +/** Handle a directive. Passed down to object format, debug format, or + * architecture as appropriate. + * \param object object + * \param name directive name + * \param parser parser keyword + * \param valparams value/parameters + * \param objext_valparams "object format-specific" value/parameters + * \param line virtual line (from yasm_linemap) + * \return 0 if directive recognized, nonzero if unrecognized. + */ +int yasm_object_directive(yasm_object *object, const char *name, + const char *parser, yasm_valparamhead *valparams, + yasm_valparamhead *objext_valparams, + unsigned long line); + /** Delete (free allocated memory for) an object. All sections in the * object and all bytecodes within those sections are also deleted. * \param object object diff --git a/libyasm/symrec.c b/libyasm/symrec.c index 1b8e7219..30b6c91f 100644 --- a/libyasm/symrec.c +++ b/libyasm/symrec.c @@ -34,6 +34,7 @@ #include "libyasm-stdint.h" #include "coretype.h" +#include "valparam.h" #include "hamt.h" #include "assocdat.h" @@ -64,7 +65,9 @@ struct yasm_symrec { sym_type type; yasm_sym_status status; yasm_sym_vis visibility; - unsigned long line; /* symbol was first declared or used on */ + unsigned long def_line; /* line where symbol was first defined */ + unsigned long decl_line; /* line where symbol was first declared */ + unsigned long use_line; /* line where symbol was first used */ union { yasm_expr *expn; /* equ value */ @@ -89,12 +92,48 @@ struct yasm_symtab { SLIST_HEAD(nontablesymhead_s, non_table_symrec_s) non_table_syms; }; +static void +objext_valparams_destroy(void *data) +{ + yasm_vps_destroy((yasm_valparamhead *)data); +} + +static void +objext_valparams_print(void *data, FILE *f, int indent_level) +{ + yasm_vps_print((yasm_valparamhead *)data, f); +} + +static yasm_assoc_data_callback objext_valparams_cb = { + objext_valparams_destroy, + objext_valparams_print +}; + +static void +common_size_destroy(void *data) +{ + yasm_expr **e = (yasm_expr **)data; + yasm_expr_destroy(*e); + yasm_xfree(data); +} + +static void +common_size_print(void *data, FILE *f, int indent_level) +{ + yasm_expr **e = (yasm_expr **)data; + yasm_expr_print(*e, f); +} + +static yasm_assoc_data_callback common_size_cb = { + common_size_destroy, + common_size_print +}; yasm_symtab * yasm_symtab_create(void) { yasm_symtab *symtab = yasm_xmalloc(sizeof(yasm_symtab)); - symtab->sym_table = HAMT_create(yasm_internal_error_); + symtab->sym_table = HAMT_create(0, yasm_internal_error_); SLIST_INIT(&symtab->non_table_syms); return symtab; } @@ -116,7 +155,9 @@ symrec_new_common(/*@keep@*/ char *name) yasm_symrec *rec = yasm_xmalloc(sizeof(yasm_symrec)); rec->name = name; rec->type = SYM_UNKNOWN; - rec->line = 0; + rec->def_line = 0; + rec->decl_line = 0; + rec->use_line = 0; rec->visibility = YASM_SYM_LOCAL; rec->assoc_data = NULL; return rec; @@ -190,7 +231,9 @@ yasm_symrec * yasm_symtab_abs_sym(yasm_symtab *symtab) { yasm_symrec *rec = symtab_get_or_new(symtab, "", 1); - rec->line = 0; + rec->def_line = 0; + rec->decl_line = 0; + rec->use_line = 0; rec->type = SYM_EQU; rec->value.expn = yasm_expr_create_ident(yasm_expr_int(yasm_intnum_create_uint(0)), 0); @@ -202,8 +245,8 @@ yasm_symrec * yasm_symtab_use(yasm_symtab *symtab, const char *name, unsigned long line) { yasm_symrec *rec = symtab_get_or_new(symtab, name, 1); - if (rec->line == 0) - rec->line = line; /* set line number of first use */ + if (rec->use_line == 0) + rec->use_line = line; /* set line number of first use */ rec->status |= YASM_SYM_USED; return rec; } @@ -222,15 +265,15 @@ symtab_define(yasm_symtab *symtab, const char *name, sym_type type, /* Has it been defined before (either by DEFINED or COMMON/EXTERN)? */ if (rec->status & YASM_SYM_DEFINED) { - yasm_error_set_xref(rec->line, N_("`%s' previously defined here"), - name); + yasm_error_set_xref(rec->def_line!=0 ? rec->def_line : rec->decl_line, + N_("`%s' previously defined here"), name); yasm_error_set(YASM_ERROR_GENERAL, N_("redefinition of `%s'"), name); } else { if (rec->visibility & YASM_SYM_EXTERN) yasm_warn_set(YASM_WARN_GENERAL, N_("`%s' both defined and declared extern"), name); - rec->line = line; /* set line number of definition */ + rec->def_line = line; /* set line number of definition */ rec->type = type; rec->status |= YASM_SYM_DEFINED; } @@ -313,18 +356,18 @@ yasm_symrec_declare(yasm_symrec *rec, yasm_sym_vis vis, unsigned long line) (!(rec->status & YASM_SYM_DEFINED) && (!(rec->visibility & (YASM_SYM_COMMON | YASM_SYM_EXTERN)) || ((rec->visibility & YASM_SYM_COMMON) && (vis == YASM_SYM_COMMON)) || - ((rec->visibility & YASM_SYM_EXTERN) && (vis == YASM_SYM_EXTERN))))) + ((rec->visibility & YASM_SYM_EXTERN) && (vis == YASM_SYM_EXTERN))))) { + rec->decl_line = line; rec->visibility |= vis; - else + } else yasm_error_set(YASM_ERROR_GENERAL, N_("duplicate definition of `%s'; first defined on line %lu"), - rec->name, rec->line); + rec->name, rec->def_line!=0 ? rec->def_line : rec->decl_line); } typedef struct symtab_finalize_info { unsigned long firstundef_line; int undef_extern; - /*@null@*/ yasm_object *object; yasm_errwarns *errwarns; } symtab_finalize_info; @@ -337,14 +380,14 @@ symtab_parser_finalize_checksym(yasm_symrec *sym, /*@null@*/ void *d) /* error if a symbol is used but never defined or extern/common declared */ if ((sym->status & YASM_SYM_USED) && !(sym->status & YASM_SYM_DEFINED) && !(sym->visibility & (YASM_SYM_EXTERN | YASM_SYM_COMMON))) { - if (info->undef_extern && info->object) - yasm_objfmt_extern_declare(info->object, sym->name, NULL, 1); + if (info->undef_extern) + sym->visibility |= YASM_SYM_EXTERN; else { yasm_error_set(YASM_ERROR_GENERAL, N_("undefined symbol `%s' (first use)"), sym->name); - yasm_errwarn_propagate(info->errwarns, sym->line); - if (sym->line < info->firstundef_line) - info->firstundef_line = sym->line; + yasm_errwarn_propagate(info->errwarns, sym->use_line); + if (sym->use_line < info->firstundef_line) + info->firstundef_line = sym->use_line; } } @@ -361,10 +404,10 @@ symtab_parser_finalize_checksym(yasm_symrec *sym, /*@null@*/ void *d) yasm_expr_create(YASM_EXPR_SUB, yasm_expr_precbc(sym->value.precbc), yasm_expr_precbc(yasm_section_bcs_first(sect)), - sym->line), + sym->def_line), YASM_EXPR_ADD, yasm_expr_copy(yasm_section_get_start(sect)), - sym->line); + sym->def_line); sym->status |= YASM_SYM_VALUED; } @@ -373,12 +416,11 @@ symtab_parser_finalize_checksym(yasm_symrec *sym, /*@null@*/ void *d) void yasm_symtab_parser_finalize(yasm_symtab *symtab, int undef_extern, - yasm_object *object, yasm_errwarns *errwarns) + yasm_errwarns *errwarns) { symtab_finalize_info info; info.firstundef_line = ULONG_MAX; info.undef_extern = undef_extern; - info.object = object; info.errwarns = errwarns; yasm_symtab_traverse(symtab, &info, symtab_parser_finalize_checksym); if (info.firstundef_line < ULONG_MAX) { @@ -448,9 +490,21 @@ yasm_symrec_get_status(const yasm_symrec *sym) } unsigned long -yasm_symrec_get_line(const yasm_symrec *sym) +yasm_symrec_get_def_line(const yasm_symrec *sym) { - return sym->line; + return sym->def_line; +} + +unsigned long +yasm_symrec_get_decl_line(const yasm_symrec *sym) +{ + return sym->decl_line; +} + +unsigned long +yasm_symrec_get_use_line(const yasm_symrec *sym) +{ + return sym->use_line; } const yasm_expr * @@ -477,7 +531,8 @@ yasm_symrec_get_label(const yasm_symrec *sym, int yasm_symrec_is_abs(const yasm_symrec *sym) { - return (sym->line == 0 && sym->type == SYM_EQU && sym->name[0] == '\0'); + return (sym->def_line == 0 && sym->type == SYM_EQU && + sym->name[0] == '\0'); } int @@ -492,6 +547,34 @@ yasm_symrec_is_curpos(const yasm_symrec *sym) return (sym->type == SYM_CURPOS); } +void +yasm_symrec_set_objext_valparams(yasm_symrec *sym, + /*@only@*/ yasm_valparamhead *objext_valparams) +{ + yasm_symrec_add_data(sym, &objext_valparams_cb, objext_valparams); +} + +yasm_valparamhead * +yasm_symrec_get_objext_valparams(yasm_symrec *sym) +{ + return yasm_symrec_get_data(sym, &objext_valparams_cb); +} + +void +yasm_symrec_set_common_size(yasm_symrec *sym, + /*@only@*/ yasm_expr *common_size) +{ + yasm_expr **ep = yasm_xmalloc(sizeof(yasm_expr *)); + *ep = common_size; + yasm_symrec_add_data(sym, &common_size_cb, ep); +} + +yasm_expr ** +yasm_symrec_get_common_size(yasm_symrec *sym) +{ + return (yasm_expr **)yasm_symrec_get_data(sym, &common_size_cb); +} + void * yasm_symrec_get_data(yasm_symrec *sym, const yasm_assoc_data_callback *callback) @@ -570,5 +653,9 @@ yasm_symrec_print(const yasm_symrec *sym, FILE *f, int indent_level) yasm__assoc_data_print(sym->assoc_data, f, indent_level+1); } - fprintf(f, "%*sLine Index=%lu\n", indent_level, "", sym->line); + fprintf(f, "%*sLine Index (Defined)=%lu\n", indent_level, "", + sym->def_line); + fprintf(f, "%*sLine Index (Declared)=%lu\n", indent_level, "", + sym->decl_line); + fprintf(f, "%*sLine Index (Used)=%lu\n", indent_level, "", sym->use_line); } diff --git a/libyasm/symrec.h b/libyasm/symrec.h index 6cf97559..624a3e98 100644 --- a/libyasm/symrec.h +++ b/libyasm/symrec.h @@ -46,6 +46,16 @@ typedef enum yasm_sym_status { YASM_SYM_NOTINTABLE = 1 << 3 /**< if it's not in sym_table (ex. '$') */ } yasm_sym_status; +/** Symbol record visibility. + * \note YASM_SYM_EXTERN and YASM_SYM_COMMON are mutually exclusive. + */ +typedef enum yasm_sym_vis { + YASM_SYM_LOCAL = 0, /**< Default, local only */ + YASM_SYM_GLOBAL = 1 << 0, /**< If symbol is declared GLOBAL */ + YASM_SYM_COMMON = 1 << 1, /**< If symbol is declared COMMON */ + YASM_SYM_EXTERN = 1 << 2, /**< If symbol is declared EXTERN */ + YASM_SYM_DLOCAL = 1 << 3 /**< If symbol is explicitly declared LOCAL */ +} yasm_sym_vis; /** Create a new symbol table. */ yasm_symtab *yasm_symtab_create(void); @@ -202,13 +212,10 @@ yasm_symrec *yasm_symtab_iter_value(const yasm_symtab_iter *cur); * used but never defined or declared #YASM_SYM_EXTERN or #YASM_SYM_COMMON. * \param symtab symbol table * \param undef_extern if nonzero, all undef syms should be declared extern - * \param object object to notify about new extern decls - * (may be NULL if undef_extern is 0) * \param errwarns error/warning set * \note Errors/warnings are stored into errwarns. */ void yasm_symtab_parser_finalize(yasm_symtab *symtab, int undef_extern, - /*@null@*/ yasm_object *object, yasm_errwarns *errwarns); /** Print the symbol table. For debugging purposes. @@ -236,11 +243,23 @@ yasm_sym_vis yasm_symrec_get_visibility(const yasm_symrec *sym); */ yasm_sym_status yasm_symrec_get_status(const yasm_symrec *sym); -/** Get the virtual line of a symbol (where it was first declared or used). +/** Get the virtual line of where a symbol was first defined. * \param sym symbol * \return line virtual line */ -unsigned long yasm_symrec_get_line(const yasm_symrec *sym); +unsigned long yasm_symrec_get_def_line(const yasm_symrec *sym); + +/** Get the virtual line of where a symbol was first declared. + * \param sym symbol + * \return line virtual line + */ +unsigned long yasm_symrec_get_decl_line(const yasm_symrec *sym); + +/** Get the virtual line of where a symbol was first used. + * \param sym symbol + * \return line virtual line + */ +unsigned long yasm_symrec_get_use_line(const yasm_symrec *sym); /** Get EQU value of a symbol. * \param sym symbol @@ -280,6 +299,36 @@ int yasm_symrec_is_special(const yasm_symrec *sym); */ int yasm_symrec_is_curpos(const yasm_symrec *sym); +/** Set object-extended valparams. + * \param sym symbol + * \param objext_valparams object-extended valparams + */ +void yasm_symrec_set_objext_valparams + (yasm_symrec *sym, /*@only@*/ yasm_valparamhead *objext_valparams); + +/** Get object-extended valparams, if any, associated with symbol's + * declaration. + * \param sym symbol + * \return Object-extended valparams (NULL if none). + */ +/*@null@*/ /*@dependent@*/ yasm_valparamhead *yasm_symrec_get_objext_valparams + (yasm_symrec *sym); + +/** Set common size of symbol. + * \param sym symbol + * \param common_size common size expression + */ +void yasm_symrec_set_common_size + (yasm_symrec *sym, /*@only@*/ yasm_expr *common_size); + +/** Get common size of symbol, if symbol is declared COMMON and a size was set + * for it. + * \param sym symbol + * \return Common size (NULL if none). + */ +/*@dependent@*/ /*@null@*/ yasm_expr **yasm_symrec_get_common_size + (yasm_symrec *sym); + /** Get associated data for a symbol and data callback. * \param sym symbol * \param callback callback used when adding data diff --git a/libyasm/valparam.c b/libyasm/valparam.c index 7513b148..ee3acd54 100644 --- a/libyasm/valparam.c +++ b/libyasm/valparam.c @@ -32,9 +32,37 @@ #include "coretype.h" #include "valparam.h" +#include "errwarn.h" #include "expr.h" +#include "symrec.h" +void +yasm_call_directive(const yasm_directive *directive, yasm_object *object, + yasm_valparamhead *valparams, + yasm_valparamhead *objext_valparams, unsigned long line) +{ + yasm_valparam *vp; + + if ((directive->flags & (YASM_DIR_ARG_REQUIRED|YASM_DIR_ID_REQUIRED)) && + (!valparams || !yasm_vps_first(valparams))) { + yasm_error_set(YASM_ERROR_SYNTAX, + N_("directive `%s' requires an argument"), + directive->name); + return; + } + if (valparams) { + vp = yasm_vps_first(valparams); + if ((directive->flags & YASM_DIR_ID_REQUIRED) && !vp->val) { + yasm_error_set(YASM_ERROR_SYNTAX, + N_("directive `%s' requires an identifier parameter"), + directive->name); + return; + } + } + directive->handler(object, valparams, objext_valparams, line); +} + yasm_valparam * yasm_vp_create(/*@keep@*/ char *v, /*@keep@*/ yasm_expr *p) { @@ -44,6 +72,22 @@ yasm_vp_create(/*@keep@*/ char *v, /*@keep@*/ yasm_expr *p) return r; } +/*@null@*/ /*@only@*/ yasm_expr * +yasm_vp_expr(yasm_valparam *vp, yasm_symtab *symtab, unsigned long line) +{ + if (!vp) + return NULL; + if (vp->val) { + return yasm_expr_create_ident(yasm_expr_sym( + yasm_symtab_use(symtab, vp->val, line)), line); + } else if (vp->param) { + yasm_expr *e = vp->param; + vp->param = NULL; /* to avoid double-free */ + return e; + } else + return NULL; +} + void yasm_vps_delete(yasm_valparamhead *headp) { diff --git a/libyasm/valparam.h b/libyasm/valparam.h index eef1989a..8c0dcf88 100644 --- a/libyasm/valparam.h +++ b/libyasm/valparam.h @@ -46,6 +46,47 @@ struct yasm_valparam { /*@reldef@*/ STAILQ_HEAD(yasm_valparamhead, yasm_valparam); #endif +/** Directive list entry structure. */ +struct yasm_directive { + /** Directive name. GAS directives should include the ".", NASM + * directives should just be the raw name (not including the []). + * NULL entry required to terminate list of directives. + */ + /*@null@*/ const char *name; + + const char *parser; /**< Parser keyword */ + + /** Handler callback function for the directive. + * \param object object + * \param valparams value/parameters + * \param objext_valparams object format-specific value/parameters + * \param line virtual line (from yasm_linemap) + */ + void (*handler) (yasm_object *object, yasm_valparamhead *valparams, + yasm_valparamhead *objext_valparams, unsigned long line); + + /** Flags for pre-handler parameter checking. */ + enum yasm_directive_flags { + YASM_DIR_ANY = 0, /**< Any valparams accepted */ + YASM_DIR_ARG_REQUIRED = 1, /**< Require at least 1 valparam */ + YASM_DIR_ID_REQUIRED = 2 /**< First valparam must be ID */ + } flags; +}; + +/** Call a directive. Performs any valparam checks asked for by the + * directive prior to call. Note that for a variety of reasons, a directive + * can generate an error. + * \param directive directive + * \param object object + * \param valparams value/parameters + * \param objext_valparams object format-specific value/parameters + * \param line virtual line (from yasm_linemap) + */ +void yasm_call_directive(const yasm_directive *directive, yasm_object *object, + yasm_valparamhead *valparams, + yasm_valparamhead *objext_valparams, + unsigned long line); + /** Create a new valparam. * \param v value * \param p parameter @@ -53,6 +94,17 @@ struct yasm_valparam { */ yasm_valparam *yasm_vp_create(/*@keep@*/ char *v, /*@keep@*/ yasm_expr *p); +/** Get a valparam as an expr. If the valparam is a value, it's treated + * as a symbol (yasm_symtab_use() is called to convert it). The valparam + * is modified as necessary to avoid double-frees. + * \param vp valparam + * \param symtab symbol table + * \param line virtual line + * \return Expression, or NULL if vp is NULL or if val and param are both NULL. + */ +/*@null@*/ /*@only@*/ yasm_expr *yasm_vp_expr + (yasm_valparam *vp, yasm_symtab *symtab, unsigned long line); + /** Create a new linked list of valparams. * \return Newly allocated valparam list. */ diff --git a/libyasm/value.h b/libyasm/value.h index 5669f48c..043c4651 100644 --- a/libyasm/value.h +++ b/libyasm/value.h @@ -105,7 +105,7 @@ int yasm_value_finalize(yasm_value *value, /*@null@*/ yasm_bytecode *precbc); * \return Nonzero if the expr could not be split into a value for some * reason (e.g. the relative portion was not added, but multiplied, * etc). - * \caution Do not use e after this call. Even if an error is returned, e + * \warning Do not use e after this call. Even if an error is returned, e * is stored into value. * \note This should only be called after the parse is complete. Calling * before the parse is complete will usually result in an error return. diff --git a/modules/arch/x86/x86arch.c b/modules/arch/x86/x86arch.c index 645c0b98..387c7e5d 100644 --- a/modules/arch/x86/x86arch.c +++ b/modules/arch/x86/x86arch.c @@ -118,35 +118,72 @@ x86_set_var(yasm_arch *arch, const char *var, unsigned long val) return 0; } -static int -x86_parse_directive(yasm_arch *arch, const char *name, - /*@null@*/ yasm_valparamhead *valparams, - /*@unused@*/ /*@null@*/ - yasm_valparamhead *objext_valparams, - /*@unused@*/ yasm_object *object, - /*@unused@*/ unsigned long line) +static void +x86_dir_cpu(yasm_object *object, yasm_valparamhead *valparams, + yasm_valparamhead *objext_valparams, unsigned long line) { - yasm_arch_x86 *arch_x86 = (yasm_arch_x86 *)arch; + yasm_arch_x86 *arch_x86 = (yasm_arch_x86 *)object->arch; + + yasm_valparam *vp; + yasm_vps_foreach(vp, valparams) { + if (vp->val) + yasm_x86__parse_cpu(arch_x86, vp->val, strlen(vp->val)); + else if (vp->param) { + const yasm_intnum *intcpu; + intcpu = yasm_expr_get_intnum(&vp->param, 0); + if (!intcpu) + yasm_error_set(YASM_ERROR_SYNTAX, + N_("invalid argument to [%s]"), "CPU"); + else { + char strcpu[16]; + sprintf(strcpu, "%lu", yasm_intnum_get_uint(intcpu)); + yasm_x86__parse_cpu(arch_x86, strcpu, strlen(strcpu)); + } + } + } +} + +static void +x86_dir_bits(yasm_object *object, yasm_valparamhead *valparams, + yasm_valparamhead *objext_valparams, unsigned long line) +{ + yasm_arch_x86 *arch_x86 = (yasm_arch_x86 *)object->arch; yasm_valparam *vp; const yasm_intnum *intn; long lval; - if (yasm__strcasecmp(name, "bits") == 0) { - if (!valparams) - yasm_error_set(YASM_ERROR_VALUE, N_("[%s] requires an argument"), - "BITS"); - else if ((vp = yasm_vps_first(valparams)) && !vp->val && - vp->param != NULL && - (intn = yasm_expr_get_intnum(&vp->param, 0)) != NULL && - (lval = yasm_intnum_get_int(intn)) && - (lval == 16 || lval == 32 || lval == 64)) - arch_x86->mode_bits = (unsigned char)lval; - else - yasm_error_set(YASM_ERROR_VALUE, N_("invalid argument to [%s]"), - "BITS"); - return 0; - } else - return 1; + if ((vp = yasm_vps_first(valparams)) && !vp->val && vp->param != NULL && + (intn = yasm_expr_get_intnum(&vp->param, 0)) != NULL && + (lval = yasm_intnum_get_int(intn)) && + (lval == 16 || lval == 32 || lval == 64)) + arch_x86->mode_bits = (unsigned char)lval; + else + yasm_error_set(YASM_ERROR_VALUE, N_("invalid argument to [%s]"), + "BITS"); +} + +static void +x86_dir_code16(yasm_object *object, yasm_valparamhead *valparams, + yasm_valparamhead *objext_valparams, unsigned long line) +{ + yasm_arch_x86 *arch_x86 = (yasm_arch_x86 *)object->arch; + arch_x86->mode_bits = 16; +} + +static void +x86_dir_code32(yasm_object *object, yasm_valparamhead *valparams, + yasm_valparamhead *objext_valparams, unsigned long line) +{ + yasm_arch_x86 *arch_x86 = (yasm_arch_x86 *)object->arch; + arch_x86->mode_bits = 32; +} + +static void +x86_dir_code64(yasm_object *object, yasm_valparamhead *valparams, + yasm_valparamhead *objext_valparams, unsigned long line) +{ + yasm_arch_x86 *arch_x86 = (yasm_arch_x86 *)object->arch; + arch_x86->mode_bits = 64; } static const unsigned char ** @@ -438,25 +475,33 @@ x86_segreg_print(yasm_arch *arch, uintptr_t segreg, FILE *f) } /* Define x86 machines -- see arch.h for details */ -static yasm_arch_machine x86_machines[] = { +static const yasm_arch_machine x86_machines[] = { { "IA-32 and derivatives", "x86" }, { "AMD64", "amd64" }, { NULL, NULL } }; +static const yasm_directive x86_directives[] = { + { "cpu", "nasm", x86_dir_cpu, YASM_DIR_ARG_REQUIRED }, + { "bits", "nasm", x86_dir_bits, YASM_DIR_ARG_REQUIRED }, + { ".code16", "gas", x86_dir_code16, YASM_DIR_ANY }, + { ".code32", "gas", x86_dir_code32, YASM_DIR_ANY }, + { ".code64", "gas", x86_dir_code64, YASM_DIR_ANY }, + { NULL, NULL, NULL, 0 } +}; + /* Define arch structure -- see arch.h for details */ yasm_arch_module yasm_x86_LTX_arch = { "x86 (IA-32 and derivatives), AMD64", "x86", + x86_directives, x86_create, x86_destroy, x86_get_machine, x86_get_address_size, x86_set_var, - yasm_x86__parse_cpu, yasm_x86__parse_check_insnprefix, yasm_x86__parse_check_regtmod, - x86_parse_directive, x86_get_fill, yasm_x86__finalize_insn, yasm_x86__floatnum_tobytes, diff --git a/modules/arch/x86/x86arch.h b/modules/arch/x86/x86arch.h index b89af682..d7aea71c 100644 --- a/modules/arch/x86/x86arch.h +++ b/modules/arch/x86/x86arch.h @@ -262,7 +262,8 @@ int yasm_x86__expr_checkea (x86_effaddr *x86_ea, unsigned char *addrsize, unsigned int bits, int address16_op, unsigned char *rex, yasm_bytecode *bc); -void yasm_x86__parse_cpu(yasm_arch *arch, const char *cpuid, size_t cpuid_len); +void yasm_x86__parse_cpu(yasm_arch_x86 *arch_x86, const char *cpuid, + size_t cpuid_len); yasm_arch_insnprefix yasm_x86__parse_check_insnprefix (yasm_arch *arch, /*@out@*/ uintptr_t data[4], const char *id, diff --git a/modules/arch/x86/x86id.c b/modules/arch/x86/x86id.c index 6011ce76..24647b83 100644 --- a/modules/arch/x86/x86id.c +++ b/modules/arch/x86/x86id.c @@ -3530,9 +3530,9 @@ yasm_x86__parse_check_insnprefix(yasm_arch *arch, uintptr_t data[4], } void -yasm_x86__parse_cpu(yasm_arch *arch, const char *cpuid, size_t cpuid_len) +yasm_x86__parse_cpu(yasm_arch_x86 *arch_x86, const char *cpuid, + size_t cpuid_len) { - yasm_arch_x86 *arch_x86 = (yasm_arch_x86 *)arch; /*@null@*/ const cpu_parse_data *pdata; size_t i; static char lcaseid[16]; diff --git a/modules/dbgfmts/codeview/cv-dbgfmt.c b/modules/dbgfmts/codeview/cv-dbgfmt.c index 1b045fcf..6ec6407d 100644 --- a/modules/dbgfmts/codeview/cv-dbgfmt.c +++ b/modules/dbgfmts/codeview/cv-dbgfmt.c @@ -99,19 +99,12 @@ cv_dbgfmt_generate(yasm_object *object, yasm_linemap *linemap, yasm_cv__generate_type(object); } -static int -cv_dbgfmt_directive(yasm_object *object, const char *name, - yasm_valparamhead *valparams, unsigned long line) -{ - return 1; /* TODO */ -} - /* Define dbgfmt structure -- see dbgfmt.h for details */ yasm_dbgfmt_module yasm_cv8_LTX_dbgfmt = { "CodeView debugging format for VC8", "cv8", + NULL, /* no directives */ cv8_dbgfmt_create, cv_dbgfmt_destroy, - cv_dbgfmt_directive, cv_dbgfmt_generate }; diff --git a/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c b/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c index eb76fa30..e498f0d1 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c +++ b/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c @@ -330,19 +330,20 @@ dwarf2_section_data_print(void *data, FILE *f, int indent_level) /* TODO */ } -static int -dwarf2_dbgfmt_directive(yasm_object *object, const char *name, - yasm_valparamhead *valparams, unsigned long line) -{ - return yasm_dwarf2__line_directive(object, name, valparams, line); -} +static const yasm_directive dwarf2_directives[] = { + { ".loc", "gas", yasm_dwarf2__dir_loc, YASM_DIR_ARG_REQUIRED }, + { ".file", "gas", yasm_dwarf2__dir_file, YASM_DIR_ARG_REQUIRED }, + { "loc", "nasm", yasm_dwarf2__dir_loc, YASM_DIR_ARG_REQUIRED }, + { "file", "nasm", yasm_dwarf2__dir_file, YASM_DIR_ARG_REQUIRED }, + { NULL, NULL, NULL, 0 } +}; /* Define dbgfmt structure -- see dbgfmt.h for details */ yasm_dbgfmt_module yasm_dwarf2_LTX_dbgfmt = { "DWARF2 debugging format", "dwarf2", + dwarf2_directives, dwarf2_dbgfmt_create, dwarf2_dbgfmt_destroy, - dwarf2_dbgfmt_directive, dwarf2_dbgfmt_generate }; diff --git a/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.h b/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.h index 1c361b0c..eeba0a19 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.h +++ b/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.h @@ -107,9 +107,12 @@ yasm_section *yasm_dwarf2__generate_line (yasm_object *object, yasm_linemap *linemap, yasm_errwarns *errwarns, int asm_source, /*@out@*/ yasm_section **main_code, /*@out@*/ size_t *num_line_sections); -int yasm_dwarf2__line_directive - (yasm_object *object, const char *name, yasm_valparamhead *valparams, - unsigned long line); +void yasm_dwarf2__dir_loc(yasm_object *object, yasm_valparamhead *valparams, + yasm_valparamhead *objext_valparams, + unsigned long line); +void yasm_dwarf2__dir_file(yasm_object *object, yasm_valparamhead *valparams, + yasm_valparamhead *objext_valparams, + unsigned long line); /* Address range table functions */ yasm_section *yasm_dwarf2__generate_aranges(yasm_object *object, diff --git a/modules/dbgfmts/dwarf2/dwarf2-line.c b/modules/dbgfmts/dwarf2/dwarf2-line.c index c38fda4c..6b80ac31 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-line.c +++ b/modules/dbgfmts/dwarf2/dwarf2-line.c @@ -826,188 +826,187 @@ dwarf2_line_op_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, return 0; } -int -yasm_dwarf2__line_directive(yasm_object *object, const char *name, - yasm_valparamhead *valparams, unsigned long line) +void +yasm_dwarf2__dir_loc(yasm_object *object, yasm_valparamhead *valparams, + yasm_valparamhead *objext_valparams, unsigned long line) { - yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2 = (yasm_dbgfmt_dwarf2 *)object->dbgfmt; yasm_valparam *vp; - if (yasm__strcasecmp(name, "loc") == 0) { - /*@dependent@*/ /*@null@*/ const yasm_intnum *intn; - dwarf2_section_data *dsd; - dwarf2_loc *loc = yasm_xmalloc(sizeof(dwarf2_loc)); - /* File number (required) */ - if (!valparams || !(vp = yasm_vps_first(valparams)) || !vp->param) { - yasm_error_set(YASM_ERROR_SYNTAX, N_("file number required")); - yasm_xfree(loc); - return 0; - } + /*@dependent@*/ /*@null@*/ const yasm_intnum *intn; + dwarf2_section_data *dsd; + dwarf2_loc *loc = yasm_xmalloc(sizeof(dwarf2_loc)); + + /* File number (required) */ + if (!valparams || !(vp = yasm_vps_first(valparams)) || !vp->param) { + yasm_error_set(YASM_ERROR_SYNTAX, N_("file number required")); + yasm_xfree(loc); + return; + } + intn = yasm_expr_get_intnum(&vp->param, 0); + if (!intn) { + yasm_error_set(YASM_ERROR_NOT_CONSTANT, + N_("file number is not a constant")); + yasm_xfree(loc); + return; + } + if (yasm_intnum_sign(intn) != 1) { + yasm_error_set(YASM_ERROR_VALUE, N_("file number less than one")); + yasm_xfree(loc); + return; + } + loc->file = yasm_intnum_get_uint(intn); + + /* Line number (required) */ + vp = yasm_vps_next(vp); + if (!vp || !vp->param) { + yasm_error_set(YASM_ERROR_SYNTAX, N_("line number required")); + yasm_xfree(loc); + return; + } + intn = yasm_expr_get_intnum(&vp->param, 0); + if (!intn) { + yasm_error_set(YASM_ERROR_NOT_CONSTANT, + N_("file number is not a constant")); + yasm_xfree(loc); + return; + } + loc->line = yasm_intnum_get_uint(intn); + + /* Generate new section data if it doesn't already exist */ + dsd = yasm_section_get_data(object->cur_section, + &yasm_dwarf2__section_data_cb); + if (!dsd) { + dsd = yasm_xmalloc(sizeof(dwarf2_section_data)); + STAILQ_INIT(&dsd->locs); + yasm_section_add_data(object->cur_section, + &yasm_dwarf2__section_data_cb, dsd); + } + + /* Defaults for optional settings */ + loc->column = 0; + loc->isa_change = 0; + loc->isa = 0; + loc->is_stmt = IS_STMT_NOCHANGE; + loc->basic_block = 0; + loc->prologue_end = 0; + loc->epilogue_begin = 0; + + /* Optional column number */ + vp = yasm_vps_next(vp); + if (vp && vp->param) { intn = yasm_expr_get_intnum(&vp->param, 0); if (!intn) { yasm_error_set(YASM_ERROR_NOT_CONSTANT, - N_("file number is not a constant")); + N_("column number is not a constant")); yasm_xfree(loc); - return 0; + return; } - if (yasm_intnum_sign(intn) != 1) { - yasm_error_set(YASM_ERROR_VALUE, - N_("file number less than one")); - yasm_xfree(loc); - return 0; - } - loc->file = yasm_intnum_get_uint(intn); - - /* Line number (required) */ + loc->column = yasm_intnum_get_uint(intn); vp = yasm_vps_next(vp); - if (!vp || !vp->param) { - yasm_error_set(YASM_ERROR_SYNTAX, N_("line number required")); - yasm_xfree(loc); - return 0; - } - intn = yasm_expr_get_intnum(&vp->param, 0); - if (!intn) { - yasm_error_set(YASM_ERROR_NOT_CONSTANT, - N_("file number is not a constant")); - yasm_xfree(loc); - return 0; - } - loc->line = yasm_intnum_get_uint(intn); + } - /* Generate new section data if it doesn't already exist */ - dsd = yasm_section_get_data(object->cur_section, - &yasm_dwarf2__section_data_cb); - if (!dsd) { - dsd = yasm_xmalloc(sizeof(dwarf2_section_data)); - STAILQ_INIT(&dsd->locs); - yasm_section_add_data(object->cur_section, - &yasm_dwarf2__section_data_cb, dsd); - } - - /* Defaults for optional settings */ - loc->column = 0; - loc->isa_change = 0; - loc->isa = 0; - loc->is_stmt = IS_STMT_NOCHANGE; - loc->basic_block = 0; - loc->prologue_end = 0; - loc->epilogue_begin = 0; - - /* Optional column number */ - vp = yasm_vps_next(vp); - if (vp && vp->param) { + /* Other options */ + while (vp && vp->val) { + if (yasm__strcasecmp(vp->val, "basic_block") == 0) + loc->basic_block = 1; + else if (yasm__strcasecmp(vp->val, "prologue_end") == 0) + loc->prologue_end = 1; + else if (yasm__strcasecmp(vp->val, "epilogue_begin") == 0) + loc->epilogue_begin = 1; + else if (yasm__strcasecmp(vp->val, "is_stmt") == 0) { + if (!vp->param) { + yasm_error_set(YASM_ERROR_SYNTAX, + N_("is_stmt requires value")); + yasm_xfree(loc); + return; + } intn = yasm_expr_get_intnum(&vp->param, 0); if (!intn) { yasm_error_set(YASM_ERROR_NOT_CONSTANT, - N_("column number is not a constant")); + N_("is_stmt value is not a constant")); yasm_xfree(loc); - return 0; + return; } - loc->column = yasm_intnum_get_uint(intn); - vp = yasm_vps_next(vp); - } - - /* Other options */ - while (vp && vp->val) { - if (yasm__strcasecmp(vp->val, "basic_block") == 0) - loc->basic_block = 1; - else if (yasm__strcasecmp(vp->val, "prologue_end") == 0) - loc->prologue_end = 1; - else if (yasm__strcasecmp(vp->val, "epilogue_begin") == 0) - loc->epilogue_begin = 1; - else if (yasm__strcasecmp(vp->val, "is_stmt") == 0) { - if (!vp->param) { - yasm_error_set(YASM_ERROR_SYNTAX, - N_("is_stmt requires value")); - yasm_xfree(loc); - return 0; - } - intn = yasm_expr_get_intnum(&vp->param, 0); - if (!intn) { - yasm_error_set(YASM_ERROR_NOT_CONSTANT, - N_("is_stmt value is not a constant")); - yasm_xfree(loc); - return 0; - } - if (yasm_intnum_is_zero(intn)) - loc->is_stmt = IS_STMT_SET; - else if (yasm_intnum_is_pos1(intn)) - loc->is_stmt = IS_STMT_CLEAR; - else { - yasm_error_set(YASM_ERROR_VALUE, - N_("is_stmt value not 0 or 1")); - yasm_xfree(loc); - return 0; - } - } else if (yasm__strcasecmp(vp->val, "isa") == 0) { - if (!vp->param) { - yasm_error_set(YASM_ERROR_SYNTAX, N_("isa requires value")); - yasm_xfree(loc); - return 0; - } - intn = yasm_expr_get_intnum(&vp->param, 0); - if (!intn) { - yasm_error_set(YASM_ERROR_NOT_CONSTANT, - N_("isa value is not a constant")); - yasm_xfree(loc); - return 0; - } - if (yasm_intnum_sign(intn) < 0) { - yasm_error_set(YASM_ERROR_VALUE, - N_("isa value less than zero")); - yasm_xfree(loc); - return 0; - } - loc->isa_change = 1; - loc->isa = yasm_intnum_get_uint(intn); - } else - yasm_warn_set(YASM_WARN_GENERAL, - N_("unrecognized loc option `%s'"), vp->val); - } - - /* Append new location */ - loc->vline = line; - loc->bc = NULL; - loc->sym = NULL; - STAILQ_INSERT_TAIL(&dsd->locs, loc, link); - - return 0; - } else if (yasm__strcasecmp(name, "file") == 0) { - /*@dependent@*/ /*@null@*/ const yasm_intnum *file_intn; - unsigned long filenum; - - if (!valparams) { - yasm_error_set(YASM_ERROR_SYNTAX, N_("[%s] requires an argument"), - "FILE"); - return 0; - } - - vp = yasm_vps_first(valparams); - if (vp->val) { - /* Just a bare filename */ - yasm_object_set_source_fn(object, vp->val); - return 0; - } - - /* Otherwise.. first vp is the file number */ - file_intn = yasm_expr_get_intnum(&vp->param, 0); - if (!file_intn) { - yasm_error_set(YASM_ERROR_NOT_CONSTANT, - N_("file number is not a constant")); - return 0; - } - filenum = yasm_intnum_get_uint(file_intn); - - vp = yasm_vps_next(vp); - if (!vp || !vp->val) { - yasm_error_set(YASM_ERROR_SYNTAX, - N_("file number given but no filename")); - return 0; - } - - dwarf2_dbgfmt_add_file(dbgfmt_dwarf2, filenum, vp->val); - return 0; + if (yasm_intnum_is_zero(intn)) + loc->is_stmt = IS_STMT_SET; + else if (yasm_intnum_is_pos1(intn)) + loc->is_stmt = IS_STMT_CLEAR; + else { + yasm_error_set(YASM_ERROR_VALUE, + N_("is_stmt value not 0 or 1")); + yasm_xfree(loc); + return; + } + } else if (yasm__strcasecmp(vp->val, "isa") == 0) { + if (!vp->param) { + yasm_error_set(YASM_ERROR_SYNTAX, N_("isa requires value")); + yasm_xfree(loc); + return; + } + intn = yasm_expr_get_intnum(&vp->param, 0); + if (!intn) { + yasm_error_set(YASM_ERROR_NOT_CONSTANT, + N_("isa value is not a constant")); + yasm_xfree(loc); + return; + } + if (yasm_intnum_sign(intn) < 0) { + yasm_error_set(YASM_ERROR_VALUE, + N_("isa value less than zero")); + yasm_xfree(loc); + return; + } + loc->isa_change = 1; + loc->isa = yasm_intnum_get_uint(intn); + } else + yasm_warn_set(YASM_WARN_GENERAL, + N_("unrecognized loc option `%s'"), vp->val); } - return 1; + + /* Append new location */ + loc->vline = line; + loc->bc = NULL; + loc->sym = NULL; + STAILQ_INSERT_TAIL(&dsd->locs, loc, link); } +void +yasm_dwarf2__dir_file(yasm_object *object, yasm_valparamhead *valparams, + yasm_valparamhead *objext_valparams, unsigned long line) +{ + yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2 = (yasm_dbgfmt_dwarf2 *)object->dbgfmt; + yasm_valparam *vp; + /*@dependent@*/ /*@null@*/ const yasm_intnum *file_intn; + unsigned long filenum; + + if (!valparams) { + yasm_error_set(YASM_ERROR_SYNTAX, N_("[%s] requires an argument"), + "FILE"); + return; + } + + vp = yasm_vps_first(valparams); + if (vp->val) { + /* Just a bare filename */ + yasm_object_set_source_fn(object, vp->val); + return; + } + + /* Otherwise.. first vp is the file number */ + file_intn = yasm_expr_get_intnum(&vp->param, 0); + if (!file_intn) { + yasm_error_set(YASM_ERROR_NOT_CONSTANT, + N_("file number is not a constant")); + return; + } + filenum = yasm_intnum_get_uint(file_intn); + + vp = yasm_vps_next(vp); + if (!vp || !vp->val) { + yasm_error_set(YASM_ERROR_SYNTAX, + N_("file number given but no filename")); + return; + } + + dwarf2_dbgfmt_add_file(dbgfmt_dwarf2, filenum, vp->val); +} diff --git a/modules/dbgfmts/dwarf2/tests/pass32/dwarf32_testhd.hex b/modules/dbgfmts/dwarf2/tests/pass32/dwarf32_testhd.hex index c145c87f..e73e882a 100644 --- a/modules/dbgfmts/dwarf2/tests/pass32/dwarf32_testhd.hex +++ b/modules/dbgfmts/dwarf2/tests/pass32/dwarf32_testhd.hex @@ -3038,70 +3038,6 @@ e3 69 6e 00 -5f -5f -73 -74 -64 -65 -72 -72 -70 -00 -66 -70 -72 -69 -6e -74 -66 -00 -66 -6f -70 -65 -6e -00 -70 -72 -69 -6e -74 -66 -00 -66 -67 -65 -74 -63 -00 -5f -5f -69 -73 -74 -68 -72 -65 -61 -64 -65 -64 -00 -66 -65 -72 -72 -6f -72 -00 -66 -63 -6c -6f -73 -65 -00 2e 4c 64 @@ -3217,6 +3153,16 @@ e3 4c 32 00 +5f +5f +73 +74 +64 +65 +72 +72 +70 +00 2e 4c 43 @@ -3224,10 +3170,24 @@ e3 49 34 00 +66 +70 +72 +69 +6e +74 +66 +00 2e 4c 31 00 +66 +6f +70 +65 +6e +00 2e 4c 34 @@ -3236,6 +3196,32 @@ e3 4c 36 00 +70 +72 +69 +6e +74 +66 +00 +66 +67 +65 +74 +63 +00 +5f +5f +69 +73 +74 +68 +72 +65 +61 +64 +65 +64 +00 2e 4c 38 @@ -3248,6 +3234,20 @@ e3 4c 37 00 +66 +65 +72 +72 +6f +72 +00 +66 +63 +6c +6f +73 +65 +00 2e 4c 46 @@ -4554,7 +4554,7 @@ e3 00 04 00 -de +d0 00 00 00 @@ -4570,7 +4570,7 @@ cc 00 04 00 -da +cc 00 00 00 @@ -4586,7 +4586,7 @@ af 00 04 00 -d6 +c8 00 00 00 @@ -4602,7 +4602,7 @@ d6 00 04 00 -d2 +aa 00 00 00 @@ -4618,7 +4618,7 @@ d2 00 04 00 -ce +a6 00 00 00 @@ -4634,7 +4634,7 @@ ce 00 04 00 -ca +9c 00 00 00 @@ -4650,7 +4650,7 @@ dc 00 04 00 -c3 +8d 00 00 00 @@ -4666,7 +4666,7 @@ c3 00 04 00 -bf +7f 00 00 00 @@ -4682,7 +4682,7 @@ bf 00 04 00 -b8 +78 00 00 00 @@ -4698,7 +4698,7 @@ b8 00 04 00 -b1 +71 00 00 00 @@ -4714,7 +4714,7 @@ b1 00 04 00 -aa +6a 00 00 00 @@ -4730,7 +4730,7 @@ aa 00 04 00 -a3 +63 00 00 00 @@ -4746,7 +4746,7 @@ a3 00 04 00 -9d +5d 00 00 00 @@ -4762,7 +4762,7 @@ a3 00 04 00 -98 +58 00 00 00 @@ -4778,7 +4778,7 @@ a3 00 0b 00 -93 +53 00 00 00 @@ -4794,7 +4794,7 @@ a3 00 0b 00 -8e +4e 00 00 00 @@ -4810,7 +4810,7 @@ a3 00 0b 00 -89 +49 00 00 00 @@ -4826,7 +4826,7 @@ a3 00 0b 00 -84 +44 00 00 00 @@ -4858,7 +4858,7 @@ a3 00 0b 00 -7c +3c 00 00 00 @@ -4874,7 +4874,7 @@ a3 00 04 00 -6e +2e 00 00 00 @@ -4906,7 +4906,7 @@ a3 00 09 00 -60 +20 00 00 00 @@ -4938,7 +4938,7 @@ a3 00 07 00 -50 +10 00 00 00 @@ -5002,7 +5002,7 @@ e3 00 04 00 -10 +83 00 00 00 @@ -5018,7 +5018,7 @@ e3 00 00 00 -1a +94 00 00 00 @@ -5034,7 +5034,7 @@ e3 00 00 00 -22 +a0 00 00 00 @@ -5050,7 +5050,7 @@ e3 00 00 00 -28 +ae 00 00 00 @@ -5066,7 +5066,7 @@ e3 00 00 00 -2f +b5 00 00 00 @@ -5082,7 +5082,7 @@ e3 00 00 00 -35 +bb 00 00 00 @@ -5098,7 +5098,7 @@ e3 00 00 00 -42 +d4 00 00 00 @@ -5114,7 +5114,7 @@ e3 00 00 00 -49 +db 00 00 00 diff --git a/modules/dbgfmts/dwarf2/tests/pass64/dwarf64_leb128.hex b/modules/dbgfmts/dwarf2/tests/pass64/dwarf64_leb128.hex index 178ae19f..af09833c 100644 --- a/modules/dbgfmts/dwarf2/tests/pass64/dwarf64_leb128.hex +++ b/modules/dbgfmts/dwarf2/tests/pass64/dwarf64_leb128.hex @@ -6246,7 +6246,7 @@ ff 00 00 00 -b6 +9e 04 00 00 @@ -6294,7 +6294,7 @@ ff 00 00 00 -b6 +9e 04 00 00 @@ -6342,7 +6342,7 @@ ff 00 00 00 -b6 +9e 04 00 00 @@ -6390,7 +6390,7 @@ ff 00 00 00 -b6 +9e 04 00 00 @@ -6438,7 +6438,7 @@ ff 00 00 00 -b6 +9e 04 00 00 @@ -6486,7 +6486,7 @@ ff 00 00 00 -b7 +9f 04 00 00 @@ -6558,7 +6558,7 @@ ff 00 00 00 -b8 +a1 04 00 00 @@ -6606,7 +6606,7 @@ ff 00 00 00 -b9 +a2 04 00 00 @@ -6654,7 +6654,7 @@ a4 00 00 00 -b9 +a2 04 00 00 @@ -6702,7 +6702,7 @@ b0 00 00 00 -b9 +a2 04 00 00 @@ -6750,7 +6750,7 @@ bc 00 00 00 -b9 +a2 04 00 00 @@ -6798,7 +6798,7 @@ cc 00 00 00 -b9 +a2 04 00 00 @@ -6822,7 +6822,7 @@ f0 00 00 00 -ba +a4 04 00 00 @@ -6894,7 +6894,7 @@ ff 00 00 00 -bb +a5 04 00 00 @@ -6942,7 +6942,7 @@ ff 00 00 00 -bc +a6 04 00 00 @@ -6990,7 +6990,7 @@ ff 00 00 00 -bd +a7 04 00 00 @@ -7038,7 +7038,7 @@ ff 00 00 00 -be +a8 04 00 00 @@ -7086,7 +7086,7 @@ ff 00 00 00 -bf +a9 04 00 00 @@ -7110,7 +7110,7 @@ d0 00 00 00 -ba +a4 04 00 00 @@ -7134,7 +7134,7 @@ db 00 00 00 -c0 +ab 04 00 00 @@ -7182,7 +7182,7 @@ f5 00 00 00 -c1 +ac 04 00 00 @@ -7230,7 +7230,7 @@ ff 00 00 00 -bc +a6 04 00 00 @@ -7278,7 +7278,7 @@ ff 00 00 00 -bd +a7 04 00 00 @@ -7326,7 +7326,7 @@ ff 00 00 00 -be +a8 04 00 00 @@ -7374,7 +7374,7 @@ ff 00 00 00 -bf +a9 04 00 00 @@ -7398,7 +7398,7 @@ b0 00 00 00 -ba +a4 04 00 00 @@ -7422,7 +7422,7 @@ bb 00 00 00 -c0 +ab 04 00 00 @@ -7470,7 +7470,7 @@ d9 00 00 00 -c2 +ae 04 00 00 @@ -7518,7 +7518,7 @@ e5 00 00 00 -bc +a6 04 00 00 @@ -7566,7 +7566,7 @@ ff 00 00 00 -bd +a7 04 00 00 @@ -7614,7 +7614,7 @@ ff 00 00 00 -be +a8 04 00 00 @@ -7662,7 +7662,7 @@ ff 00 00 00 -bf +a9 04 00 00 @@ -7686,7 +7686,7 @@ ff 00 00 00 -ba +a4 04 00 00 @@ -7710,7 +7710,7 @@ ff 00 00 00 -c0 +ab 04 00 00 @@ -7758,7 +7758,7 @@ b9 00 00 00 -c3 +b0 04 00 00 @@ -7806,7 +7806,7 @@ c5 00 00 00 -bc +a6 04 00 00 @@ -7854,7 +7854,7 @@ e5 00 00 00 -bd +a7 04 00 00 @@ -7902,7 +7902,7 @@ ff 00 00 00 -be +a8 04 00 00 @@ -7950,7 +7950,7 @@ ff 00 00 00 -bf +a9 04 00 00 @@ -7974,7 +7974,7 @@ ff 00 00 00 -ba +a4 04 00 00 @@ -7998,7 +7998,7 @@ ff 00 00 00 -c0 +ab 04 00 00 @@ -8070,7 +8070,7 @@ ff 00 00 00 -be +a8 04 00 00 @@ -8118,7 +8118,7 @@ ff 00 00 00 -c4 +b2 04 00 00 @@ -8166,7 +8166,7 @@ ff 00 00 00 -bf +a9 04 00 00 @@ -8214,7 +8214,7 @@ ff 00 00 00 -c5 +b3 04 00 00 @@ -8262,7 +8262,7 @@ ff 00 00 00 -c6 +b4 04 00 00 @@ -8310,7 +8310,7 @@ ac 00 00 00 -be +a8 04 00 00 @@ -8334,7 +8334,7 @@ eb 00 00 00 -ba +a4 04 00 00 @@ -8382,7 +8382,7 @@ ff 00 00 00 -c4 +b2 04 00 00 @@ -8430,7 +8430,7 @@ ff 00 00 00 -c6 +b4 04 00 00 @@ -8478,7 +8478,7 @@ ff 00 00 00 -c7 +b7 04 00 00 @@ -8502,7 +8502,7 @@ ff 00 00 00 -ba +a4 04 00 00 @@ -8550,7 +8550,7 @@ ff 00 00 00 -be +a8 04 00 00 @@ -8574,7 +8574,7 @@ ff 00 00 00 -ba +a4 04 00 00 @@ -8598,7 +8598,7 @@ f5 00 00 00 -be +a8 04 00 00 @@ -8622,7 +8622,7 @@ ff 00 00 00 -c8 +ba 04 00 00 @@ -8646,7 +8646,7 @@ ff 00 00 00 -b9 +a2 04 00 00 @@ -8670,7 +8670,7 @@ ff 00 00 00 -c8 +ba 04 00 00 @@ -8718,7 +8718,7 @@ ff 00 00 00 -c4 +b2 04 00 00 @@ -8742,7 +8742,7 @@ ac 00 00 00 -c6 +b4 04 00 00 @@ -8790,7 +8790,7 @@ cd 00 00 00 -c4 +b2 04 00 00 @@ -8814,7 +8814,7 @@ df 00 00 00 -c6 +b4 04 00 00 @@ -8910,7 +8910,7 @@ ff 00 00 00 -c9 +bc 04 00 00 @@ -8958,7 +8958,7 @@ ff 00 00 00 -bc +a6 04 00 00 @@ -9006,7 +9006,7 @@ ff 00 00 00 -bd +a7 04 00 00 @@ -9054,7 +9054,7 @@ ff 00 00 00 -be +a8 04 00 00 @@ -9126,7 +9126,7 @@ c6 00 00 00 -c9 +bc 04 00 00 @@ -9174,7 +9174,7 @@ db 00 00 00 -ca +bd 04 00 00 @@ -9198,7 +9198,7 @@ e8 00 00 00 -b9 +a2 04 00 00 @@ -9270,7 +9270,7 @@ ff 00 00 00 -cb +be 04 00 00 @@ -9342,7 +9342,7 @@ ff 00 00 00 -cb +be 04 00 00 @@ -9390,7 +9390,7 @@ ff 00 00 00 -c4 +b2 04 00 00 @@ -9414,7 +9414,7 @@ ff 00 00 00 -cc +bf 04 00 00 @@ -9462,7 +9462,7 @@ ff 00 00 00 -cd +c0 04 00 00 @@ -9510,7 +9510,7 @@ ff 00 00 00 -c4 +b2 04 00 00 @@ -9534,7 +9534,7 @@ ff 00 00 00 -ce +c1 04 00 00 @@ -9582,7 +9582,7 @@ ff 00 00 00 -cd +c0 04 00 00 @@ -9630,7 +9630,7 @@ ff 00 00 00 -c4 +b2 04 00 00 @@ -9654,7 +9654,7 @@ ff 00 00 00 -ce +c1 04 00 00 @@ -9702,7 +9702,7 @@ b0 00 00 00 -cd +c0 04 00 00 @@ -9750,7 +9750,7 @@ c1 00 00 00 -c4 +b2 04 00 00 @@ -9774,7 +9774,7 @@ cc 00 00 00 -cf +c2 04 00 00 @@ -9846,7 +9846,7 @@ e7 00 00 00 -d0 +c3 04 00 00 @@ -9918,7 +9918,7 @@ f6 00 00 00 -d0 +c3 04 00 00 @@ -9966,7 +9966,7 @@ ff 00 00 00 -c7 +b7 04 00 00 @@ -10014,7 +10014,7 @@ ff 00 00 00 -ca +bd 04 00 00 @@ -10062,7 +10062,7 @@ ff 00 00 00 -c4 +b2 04 00 00 @@ -10086,7 +10086,7 @@ ff 00 00 00 -cc +bf 04 00 00 @@ -10134,7 +10134,7 @@ ff 00 00 00 -d1 +c4 04 00 00 @@ -10182,7 +10182,7 @@ ff 00 00 00 -d2 +c5 04 00 00 @@ -10230,7 +10230,7 @@ a3 00 00 00 -d3 +c6 04 00 00 @@ -10278,7 +10278,7 @@ ba 00 00 00 -d4 +c7 04 00 00 @@ -10326,7 +10326,7 @@ d1 00 00 00 -d5 +c8 04 00 00 @@ -10374,7 +10374,7 @@ e8 00 00 00 -d6 +c9 04 00 00 @@ -10422,7 +10422,7 @@ ff 00 00 00 -d4 +c7 04 00 00 @@ -10470,7 +10470,7 @@ ff 00 00 00 -d7 +ca 04 00 00 @@ -10518,7 +10518,7 @@ ff 00 00 00 -ca +bd 04 00 00 @@ -10566,7 +10566,7 @@ ff 00 00 00 -c5 +b3 04 00 00 @@ -10614,7 +10614,7 @@ ff 00 00 00 -ca +bd 04 00 00 @@ -10662,7 +10662,7 @@ ff 00 00 00 -d8 +cb 04 00 00 @@ -10710,7 +10710,7 @@ ff 00 00 00 -c4 +b2 04 00 00 @@ -10734,7 +10734,7 @@ ff 00 00 00 -cc +bf 04 00 00 @@ -10782,7 +10782,7 @@ a5 00 00 00 -c4 +b2 04 00 00 @@ -10806,7 +10806,7 @@ b0 00 00 00 -ce +c1 04 00 00 @@ -10854,7 +10854,7 @@ c4 00 00 00 -cd +c0 04 00 00 @@ -10902,7 +10902,7 @@ d5 00 00 00 -c4 +b2 04 00 00 @@ -10926,7 +10926,7 @@ e0 00 00 00 -ce +c1 04 00 00 @@ -10974,7 +10974,7 @@ f3 00 00 00 -cd +c0 04 00 00 @@ -11022,7 +11022,7 @@ ff 00 00 00 -c4 +b2 04 00 00 @@ -11046,7 +11046,7 @@ ff 00 00 00 -cf +c2 04 00 00 @@ -11094,7 +11094,7 @@ ff 00 00 00 -cd +c0 04 00 00 @@ -11166,7 +11166,7 @@ ff 00 00 00 -d0 +c3 04 00 00 @@ -11214,7 +11214,7 @@ ff 00 00 00 -d7 +ca 04 00 00 @@ -11238,7 +11238,7 @@ ff 00 00 00 -cc +bf 04 00 00 @@ -11262,7 +11262,7 @@ ff 00 00 00 -cc +bf 04 00 00 @@ -11310,7 +11310,7 @@ ff 00 00 00 -c4 +b2 04 00 00 @@ -11334,7 +11334,7 @@ c7 00 00 00 -b9 +a2 04 00 00 @@ -11358,7 +11358,7 @@ ff 00 00 00 -d9 +d0 04 00 00 @@ -11382,7 +11382,7 @@ ff 00 00 00 -da +d2 04 00 00 @@ -11454,7 +11454,7 @@ ff 00 00 00 -c9 +bc 04 00 00 @@ -11478,7 +11478,7 @@ b7 00 00 00 -bd +a7 04 00 00 @@ -11550,7 +11550,7 @@ e0 00 00 00 -c9 +bc 04 00 00 @@ -11574,7 +11574,7 @@ ff 00 00 00 -db +d5 04 00 00 @@ -11622,7 +11622,7 @@ ff 00 00 00 -c7 +b7 04 00 00 @@ -11670,7 +11670,7 @@ ff 00 00 00 -bc +a6 04 00 00 @@ -11718,7 +11718,7 @@ ff 00 00 00 -bd +a7 04 00 00 @@ -11766,7 +11766,7 @@ a3 00 00 00 -c4 +b2 04 00 00 @@ -11790,7 +11790,7 @@ b5 00 00 00 -c6 +b4 04 00 00 @@ -11814,7 +11814,7 @@ d2 00 00 00 -db +d5 04 00 00 @@ -11838,7 +11838,7 @@ ea 00 00 00 -bc +a6 04 00 00 @@ -11862,7 +11862,7 @@ ff 00 00 00 -db +d5 04 00 00 @@ -11886,7 +11886,7 @@ ff 00 00 00 -dc +d7 04 00 00 @@ -11934,7 +11934,7 @@ ff 00 00 00 -c7 +b7 04 00 00 @@ -11982,7 +11982,7 @@ ff 00 00 00 -dd +d8 04 00 00 @@ -12030,7 +12030,7 @@ ff 00 00 00 -bc +a6 04 00 00 @@ -12078,7 +12078,7 @@ ff 00 00 00 -ca +bd 04 00 00 @@ -12174,7 +12174,7 @@ a6 00 00 00 -c9 +bc 04 00 00 @@ -12222,7 +12222,7 @@ ff 00 00 00 -c4 +b2 04 00 00 @@ -12246,7 +12246,7 @@ ff 00 00 00 -c6 +b4 04 00 00 @@ -12270,7 +12270,7 @@ ff 00 00 00 -de +da 04 00 00 @@ -12294,7 +12294,7 @@ aa 00 00 00 -df +db 04 00 00 @@ -12366,7 +12366,7 @@ d0 00 00 00 -c9 +bc 04 00 00 @@ -12390,7 +12390,7 @@ d9 00 00 00 -c8 +ba 04 00 00 @@ -12414,7 +12414,7 @@ ff 00 00 00 -e0 +dc 04 00 00 @@ -12462,7 +12462,7 @@ ff 00 00 00 -ca +bd 04 00 00 @@ -12510,7 +12510,7 @@ ff 00 00 00 -c5 +b3 04 00 00 @@ -12558,7 +12558,7 @@ ff 00 00 00 -cc +bf 04 00 00 @@ -12606,7 +12606,7 @@ b8 00 00 00 -bf +a9 04 00 00 @@ -12630,7 +12630,7 @@ ff 00 00 00 -e1 +dd 04 00 00 @@ -12678,7 +12678,7 @@ c7 00 00 00 -bf +a9 04 00 00 @@ -12750,7 +12750,7 @@ e1 00 00 00 -c9 +bc 04 00 00 @@ -12774,7 +12774,7 @@ f4 00 00 00 -db +d5 04 00 00 @@ -12798,7 +12798,7 @@ ff 00 00 00 -dc +d7 04 00 00 @@ -12846,7 +12846,7 @@ ff 00 00 00 -c4 +b2 04 00 00 @@ -12870,7 +12870,7 @@ ff 00 00 00 -c6 +b4 04 00 00 @@ -12894,7 +12894,7 @@ ff 00 00 00 -bc +a6 04 00 00 @@ -12918,7 +12918,7 @@ d4 00 00 00 -db +d5 04 00 00 @@ -12942,7 +12942,7 @@ e3 00 00 00 -bc +a6 04 00 00 @@ -12966,7 +12966,7 @@ ff 00 00 00 -bd +a7 04 00 00 @@ -13014,7 +13014,7 @@ ff 00 00 00 -c7 +b7 04 00 00 @@ -13062,7 +13062,7 @@ ff 00 00 00 -bc +a6 04 00 00 @@ -13110,7 +13110,7 @@ ff 00 00 00 -c4 +b2 04 00 00 @@ -13134,7 +13134,7 @@ ac 00 00 00 -c6 +b4 04 00 00 @@ -13158,7 +13158,7 @@ b9 00 00 00 -db +d5 04 00 00 @@ -13206,7 +13206,7 @@ cd 00 00 00 -c7 +b7 04 00 00 @@ -13254,7 +13254,7 @@ d9 00 00 00 -bc +a6 04 00 00 @@ -13278,7 +13278,7 @@ ff 00 00 00 -bc +a6 04 00 00 @@ -13302,7 +13302,7 @@ ff 00 00 00 -bc +a6 04 00 00 @@ -13350,7 +13350,7 @@ ab 00 00 00 -e2 +e1 04 00 00 @@ -13374,7 +13374,7 @@ b4 00 00 00 -e3 +e2 04 00 00 @@ -13422,7 +13422,7 @@ cd 00 00 00 -e2 +e1 04 00 00 @@ -13446,7 +13446,7 @@ d7 00 00 00 -c8 +ba 04 00 00 @@ -13902,7 +13902,7 @@ ff 00 00 00 -c8 +ba 04 00 00 @@ -49347,6 +49347,188 @@ d6 69 6e 00 +2e +4c +64 +65 +62 +75 +67 +5f +61 +62 +62 +72 +65 +76 +30 +00 +2e +4c +64 +65 +62 +75 +67 +5f +69 +6e +66 +6f +30 +00 +2e +4c +64 +65 +62 +75 +67 +5f +6c +69 +6e +65 +30 +00 +2e +4c +74 +65 +78 +74 +30 +00 +2e +4c +43 +30 +00 +2e +4c +43 +31 +00 +2e +4c +43 +32 +00 +2e +4c +43 +33 +00 +2e +4c +43 +34 +00 +2e +4c +43 +35 +00 +2e +4c +43 +36 +00 +2e +4c +43 +37 +00 +2e +4c +43 +38 +00 +2e +4c +43 +39 +00 +2e +4c +43 +31 +30 +00 +2e +4c +43 +31 +31 +00 +2e +4c +43 +31 +32 +00 +2e +4c +43 +31 +33 +00 +2e +4c +43 +31 +34 +00 +2e +4c +43 +31 +35 +00 +2e +4c +43 +31 +36 +00 +2e +4c +43 +31 +37 +00 +2e +4c +43 +31 +38 +00 +2e +4c +46 +42 +32 +35 +00 +2e +4c +56 +4c +30 +00 +2e +4c +43 +46 +49 +30 +00 +2e +4c +56 +4c +31 +00 42 69 74 @@ -49364,6 +49546,47 @@ d6 74 65 00 +63 +6f +6e +76 +5f +62 +76 +00 +72 +65 +73 +75 +6c +74 +00 +73 +70 +61 +72 +65 +00 +6f +70 +31 +73 +74 +61 +74 +69 +63 +00 +6f +70 +32 +73 +74 +61 +74 +69 +63 +00 42 69 74 @@ -49395,6 +49618,59 @@ d6 6f 74 00 +66 +72 +6f +6d +5f +64 +65 +63 +5f +64 +61 +74 +61 +00 +2e +4c +56 +4c +32 +00 +2e +4c +46 +45 +32 +35 +00 +2e +4c +46 +42 +32 +36 +00 +2e +4c +56 +4c +33 +00 +2e +4c +43 +46 +49 +31 +00 +2e +4c +56 +4c +34 +00 42 69 74 @@ -49448,6 +49724,78 @@ d6 6f 79 00 +2e +4c +56 +4c +35 +00 +2e +4c +46 +45 +32 +36 +00 +2e +4c +43 +31 +39 +00 +2e +4c +46 +42 +32 +37 +00 +2e +4c +56 +4c +36 +00 +2e +4c +43 +46 +49 +32 +00 +2e +4c +43 +46 +49 +33 +00 +2e +4c +43 +46 +49 +34 +00 +2e +4c +56 +4c +37 +00 +2e +4c +43 +46 +49 +35 +00 +2e +4c +56 +4c +38 +00 79 61 73 @@ -49461,6 +49809,33 @@ d6 6f 63 00 +2e +4c +56 +4c +39 +00 +2e +4c +56 +4c +31 +30 +00 +2e +4c +56 +4c +31 +31 +00 +2e +4c +56 +4c +31 +32 +00 42 69 74 @@ -49487,6 +49862,15 @@ d6 69 63 00 +2e +4c +31 +33 +00 +2e +4c +36 +00 53 65 74 @@ -49495,6 +49879,10 @@ d6 61 78 00 +2e +4c +38 +00 42 69 74 @@ -49516,6 +49904,41 @@ d6 61 64 00 +2e +4c +56 +4c +31 +33 +00 +2e +4c +56 +4c +31 +34 +00 +2e +4c +56 +4c +31 +35 +00 +2e +4c +56 +4c +31 +36 +00 +2e +4c +56 +4c +31 +37 +00 42 69 74 @@ -49532,6 +49955,41 @@ d6 6e 65 00 +2e +4c +56 +4c +31 +38 +00 +2e +4c +56 +4c +31 +39 +00 +2e +4c +56 +4c +32 +30 +00 +2e +4c +56 +4c +32 +31 +00 +2e +4c +56 +4c +32 +32 +00 79 61 73 @@ -49546,6 +50004,83 @@ d6 6e 67 00 +2e +4c +46 +45 +32 +37 +00 +2e +4c +46 +42 +32 +38 +00 +2e +4c +56 +4c +32 +33 +00 +2e +4c +43 +46 +49 +36 +00 +2e +4c +43 +46 +49 +37 +00 +2e +4c +43 +46 +49 +38 +00 +2e +4c +56 +4c +32 +34 +00 +2e +4c +43 +46 +49 +39 +00 +2e +4c +56 +4c +32 +35 +00 +2e +4c +56 +4c +32 +36 +00 +2e +4c +56 +4c +32 +37 +00 73 74 72 @@ -49553,6 +50088,16 @@ d6 65 6e 00 +2e +4c +32 +31 +00 +2e +4c +31 +35 +00 42 69 74 @@ -49572,6 +50117,172 @@ d6 69 6e 00 +2e +4c +31 +37 +00 +2e +4c +56 +4c +32 +38 +00 +2e +4c +56 +4c +32 +39 +00 +2e +4c +56 +4c +33 +30 +00 +2e +4c +56 +4c +33 +31 +00 +2e +4c +56 +4c +33 +32 +00 +2e +4c +56 +4c +33 +33 +00 +2e +4c +56 +4c +33 +34 +00 +2e +4c +56 +4c +33 +35 +00 +2e +4c +56 +4c +33 +36 +00 +2e +4c +56 +4c +33 +37 +00 +2e +4c +46 +45 +32 +38 +00 +2e +4c +46 +42 +32 +39 +00 +2e +4c +56 +4c +33 +38 +00 +2e +4c +43 +46 +49 +31 +30 +00 +2e +4c +43 +46 +49 +31 +31 +00 +2e +4c +43 +46 +49 +31 +32 +00 +2e +4c +56 +4c +33 +39 +00 +2e +4c +43 +46 +49 +31 +33 +00 +2e +4c +56 +4c +34 +30 +00 +2e +4c +56 +4c +34 +31 +00 +2e +4c +56 +4c +34 +32 +00 +2e +4c +32 +39 +00 +2e +4c +32 +33 +00 42 69 74 @@ -49591,6 +50302,172 @@ d6 63 74 00 +2e +4c +32 +35 +00 +2e +4c +56 +4c +34 +33 +00 +2e +4c +56 +4c +34 +34 +00 +2e +4c +56 +4c +34 +35 +00 +2e +4c +56 +4c +34 +36 +00 +2e +4c +56 +4c +34 +37 +00 +2e +4c +56 +4c +34 +38 +00 +2e +4c +56 +4c +34 +39 +00 +2e +4c +56 +4c +35 +30 +00 +2e +4c +56 +4c +35 +31 +00 +2e +4c +56 +4c +35 +32 +00 +2e +4c +46 +45 +32 +39 +00 +2e +4c +46 +42 +33 +30 +00 +2e +4c +56 +4c +35 +33 +00 +2e +4c +43 +46 +49 +31 +34 +00 +2e +4c +43 +46 +49 +31 +35 +00 +2e +4c +43 +46 +49 +31 +36 +00 +2e +4c +56 +4c +35 +34 +00 +2e +4c +43 +46 +49 +31 +37 +00 +2e +4c +56 +4c +35 +35 +00 +2e +4c +56 +4c +35 +36 +00 +2e +4c +56 +4c +35 +37 +00 +2e +4c +33 +37 +00 +2e +4c +33 +31 +00 42 69 74 @@ -49610,6 +50487,342 @@ d6 65 78 00 +2e +4c +33 +33 +00 +2e +4c +56 +4c +35 +38 +00 +2e +4c +56 +4c +35 +39 +00 +2e +4c +56 +4c +36 +30 +00 +2e +4c +56 +4c +36 +31 +00 +2e +4c +56 +4c +36 +32 +00 +2e +4c +56 +4c +36 +33 +00 +2e +4c +56 +4c +36 +34 +00 +2e +4c +56 +4c +36 +35 +00 +2e +4c +56 +4c +36 +36 +00 +2e +4c +56 +4c +36 +37 +00 +2e +4c +46 +45 +33 +30 +00 +2e +4c +43 +32 +30 +00 +2e +4c +46 +42 +33 +31 +00 +2e +4c +56 +4c +36 +38 +00 +2e +4c +43 +46 +49 +31 +38 +00 +2e +4c +43 +46 +49 +31 +39 +00 +2e +4c +43 +46 +49 +32 +30 +00 +2e +4c +43 +46 +49 +32 +31 +00 +2e +4c +43 +46 +49 +32 +32 +00 +2e +4c +56 +4c +36 +39 +00 +2e +4c +56 +4c +37 +30 +00 +2e +4c +56 +4c +37 +31 +00 +2e +4c +56 +4c +37 +32 +00 +2e +4c +35 +39 +00 +2e +4c +33 +39 +00 +2e +4c +36 +30 +00 +2e +4c +34 +33 +00 +2e +4c +34 +34 +00 +2e +4c +56 +4c +37 +33 +00 +2e +4c +35 +30 +00 +2e +4c +34 +35 +00 +2e +4c +35 +35 +00 +2e +4c +35 +36 +00 +2e +4c +35 +37 +00 +2e +4c +34 +39 +00 +2e +4c +34 +38 +00 +2e +4c +56 +4c +37 +34 +00 +2e +4c +56 +4c +37 +35 +00 +2e +4c +34 +37 +00 +2e +4c +56 +4c +37 +36 +00 +2e +4c +56 +4c +37 +37 +00 +2e +4c +34 +36 +00 +2e +4c +56 +4c +37 +38 +00 +2e +4c +56 +4c +37 +39 +00 +2e +4c +56 +4c +38 +30 +00 +2e +4c +56 +4c +38 +31 +00 +2e +4c +56 +4c +38 +32 +00 +2e +4c +56 +4c +38 +33 +00 +2e +4c +56 +4c +38 +34 +00 +2e +4c +56 +4c +38 +35 +00 +2e +4c +36 +31 +00 42 69 74 @@ -49626,6 +50839,25 @@ d6 74 79 00 +2e +4c +56 +4c +38 +36 +00 +2e +4c +56 +4c +38 +37 +00 +2e +4c +35 +31 +00 42 69 74 @@ -49668,6 +50900,125 @@ d6 72 65 00 +2e +4c +56 +4c +38 +38 +00 +2e +4c +46 +45 +33 +31 +00 +2e +4c +46 +42 +33 +32 +00 +2e +4c +56 +4c +38 +39 +00 +2e +4c +43 +46 +49 +32 +33 +00 +2e +4c +56 +4c +39 +30 +00 +2e +4c +56 +4c +39 +31 +00 +2e +4c +56 +4c +39 +32 +00 +2e +4c +46 +45 +33 +32 +00 +2e +4c +46 +42 +33 +33 +00 +2e +4c +56 +4c +39 +33 +00 +2e +4c +43 +46 +49 +32 +34 +00 +2e +4c +56 +4c +39 +34 +00 +2e +4c +36 +35 +00 +2e +4c +56 +4c +39 +35 +00 +2e +4c +56 +4c +39 +36 +00 +2e +4c +56 +4c +39 +37 +00 42 69 74 @@ -49685,6 +51036,239 @@ d6 74 65 00 +2e +4c +56 +4c +39 +38 +00 +2e +4c +56 +4c +39 +39 +00 +2e +4c +46 +45 +33 +33 +00 +2e +4c +46 +42 +33 +34 +00 +2e +4c +56 +4c +31 +30 +30 +00 +2e +4c +43 +46 +49 +32 +35 +00 +2e +4c +43 +46 +49 +32 +36 +00 +2e +4c +56 +4c +31 +30 +31 +00 +2e +4c +43 +46 +49 +32 +37 +00 +2e +4c +56 +4c +31 +30 +32 +00 +2e +4c +56 +4c +31 +30 +33 +00 +2e +4c +37 +31 +00 +2e +4c +37 +34 +00 +2e +4c +56 +4c +31 +30 +34 +00 +2e +4c +56 +4c +31 +30 +35 +00 +2e +4c +56 +4c +31 +30 +36 +00 +2e +4c +56 +4c +31 +30 +37 +00 +2e +4c +56 +4c +31 +30 +38 +00 +2e +4c +56 +4c +31 +30 +39 +00 +2e +4c +56 +4c +31 +31 +30 +00 +2e +4c +56 +4c +31 +31 +31 +00 +2e +4c +56 +4c +31 +31 +32 +00 +2e +4c +56 +4c +31 +31 +33 +00 +2e +4c +56 +4c +31 +31 +34 +00 +2e +4c +46 +45 +33 +34 +00 +2e +4c +46 +42 +33 +35 +00 +2e +4c +56 +4c +31 +31 +35 +00 +2e +4c +43 +46 +49 +32 +38 +00 +2e +4c +56 +4c +31 +31 +36 +00 +2e +4c +37 +39 +00 +2e +4c +56 +4c +31 +31 +37 +00 79 61 73 @@ -49696,6 +51280,425 @@ d6 65 65 00 +2e +4c +56 +4c +31 +31 +38 +00 +2e +4c +56 +4c +31 +31 +39 +00 +2e +4c +56 +4c +31 +32 +30 +00 +2e +4c +56 +4c +31 +32 +31 +00 +2e +4c +56 +4c +31 +32 +32 +00 +2e +4c +46 +45 +33 +35 +00 +2e +4c +43 +32 +31 +00 +2e +4c +43 +32 +32 +00 +2e +4c +43 +32 +33 +00 +2e +4c +43 +32 +34 +00 +2e +4c +43 +32 +35 +00 +2e +4c +43 +32 +36 +00 +2e +4c +43 +32 +37 +00 +2e +4c +46 +42 +33 +36 +00 +2e +4c +56 +4c +31 +32 +33 +00 +2e +4c +43 +46 +49 +32 +39 +00 +2e +4c +43 +46 +49 +33 +30 +00 +2e +4c +43 +46 +49 +33 +31 +00 +2e +4c +43 +46 +49 +33 +32 +00 +2e +4c +43 +46 +49 +33 +33 +00 +2e +4c +43 +46 +49 +33 +34 +00 +2e +4c +43 +46 +49 +33 +35 +00 +2e +4c +56 +4c +31 +32 +34 +00 +2e +4c +56 +4c +31 +32 +35 +00 +2e +4c +31 +34 +36 +00 +2e +4c +56 +4c +31 +32 +36 +00 +2e +4c +56 +4c +31 +32 +37 +00 +2e +4c +56 +4c +31 +32 +38 +00 +2e +4c +56 +4c +31 +32 +39 +00 +2e +4c +38 +33 +00 +2e +4c +56 +4c +31 +33 +30 +00 +2e +4c +38 +36 +00 +2e +4c +31 +34 +37 +00 +2e +4c +56 +4c +31 +33 +31 +00 +2e +4c +38 +39 +00 +2e +4c +31 +34 +38 +00 +2e +4c +39 +32 +00 +2e +4c +31 +32 +31 +00 +2e +4c +39 +33 +00 +2e +4c +39 +34 +00 +2e +4c +39 +35 +00 +2e +4c +39 +36 +00 +2e +4c +39 +38 +00 +2e +4c +31 +30 +30 +00 +2e +4c +31 +30 +31 +00 +2e +4c +31 +30 +32 +00 +2e +4c +31 +30 +33 +00 +2e +4c +31 +30 +34 +00 +2e +4c +31 +30 +35 +00 +2e +4c +31 +30 +36 +00 +2e +4c +31 +30 +37 +00 +2e +4c +31 +30 +38 +00 +2e +4c +31 +30 +39 +00 +2e +4c +31 +31 +30 +00 +2e +4c +31 +31 +31 +00 +2e +4c +31 +31 +32 +00 +2e +4c +31 +31 +33 +00 +2e +4c +31 +31 +34 +00 +2e +4c +31 +31 +35 +00 +2e +4c +31 +31 +36 +00 +2e +4c +31 +31 +37 +00 +2e +4c +31 +31 +38 +00 +2e +4c +31 +31 +39 +00 +2e +4c +31 +32 +30 +00 79 61 73 @@ -49717,6 +51720,146 @@ d6 72 5f 00 +2e +4c +56 +4c +31 +33 +32 +00 +2e +4c +31 +32 +32 +00 +2e +4c +31 +33 +36 +00 +2e +4c +31 +34 +39 +00 +2e +4c +31 +33 +38 +00 +2e +4c +31 +34 +33 +00 +2e +4c +56 +4c +31 +33 +33 +00 +2e +4c +56 +4c +31 +33 +34 +00 +2e +4c +56 +4c +31 +33 +35 +00 +2e +4c +56 +4c +31 +33 +36 +00 +2e +4c +56 +4c +31 +33 +37 +00 +2e +4c +56 +4c +31 +33 +38 +00 +2e +4c +56 +4c +31 +33 +39 +00 +2e +4c +56 +4c +31 +34 +30 +00 +2e +4c +31 +35 +30 +00 +2e +4c +56 +4c +31 +34 +31 +00 +2e +4c +56 +4c +31 +34 +32 +00 +2e +4c +56 +4c +31 +34 +33 +00 +2e +4c +56 +4c +31 +34 +34 +00 42 69 74 @@ -49732,6 +51875,14 @@ d6 70 79 00 +2e +4c +56 +4c +31 +34 +35 +00 42 69 74 @@ -49749,6 +51900,46 @@ d6 64 65 00 +2e +4c +56 +4c +31 +34 +36 +00 +2e +4c +56 +4c +31 +34 +37 +00 +2e +4c +56 +4c +31 +34 +38 +00 +2e +4c +56 +4c +31 +34 +39 +00 +2e +4c +56 +4c +31 +35 +30 +00 42 69 74 @@ -49768,6 +51959,12 @@ d6 74 79 00 +2e +4c +31 +34 +35 +00 42 69 74 @@ -49782,6 +51979,22 @@ d6 53 42 00 +2e +4c +56 +4c +31 +35 +31 +00 +2e +4c +56 +4c +31 +35 +32 +00 42 69 74 @@ -49804,6 +52017,38 @@ d6 72 65 00 +2e +4c +56 +4c +31 +35 +33 +00 +2e +4c +56 +4c +31 +35 +34 +00 +2e +4c +56 +4c +31 +35 +35 +00 +2e +4c +56 +4c +31 +35 +36 +00 42 69 74 @@ -49820,6 +52065,22 @@ d6 61 6c 00 +2e +4c +56 +4c +31 +35 +37 +00 +2e +4c +56 +4c +31 +35 +38 +00 79 61 73 @@ -49832,6 +52093,84 @@ d6 6f 72 00 +2e +4c +56 +4c +31 +35 +39 +00 +2e +4c +56 +4c +31 +36 +30 +00 +2e +4c +56 +4c +31 +36 +31 +00 +2e +4c +56 +4c +31 +36 +32 +00 +2e +4c +56 +4c +31 +36 +33 +00 +2e +4c +56 +4c +31 +36 +34 +00 +2e +4c +56 +4c +31 +36 +35 +00 +2e +4c +56 +4c +31 +36 +36 +00 +2e +4c +31 +35 +31 +00 +2e +4c +56 +4c +31 +36 +37 +00 42 69 74 @@ -49851,6 +52190,22 @@ d6 6c 79 00 +2e +4c +56 +4c +31 +36 +38 +00 +2e +4c +56 +4c +31 +36 +39 +00 42 69 74 @@ -49865,6 +52220,22 @@ d6 64 64 00 +2e +4c +56 +4c +31 +37 +30 +00 +2e +4c +56 +4c +31 +37 +31 +00 42 69 74 @@ -49879,6 +52250,22 @@ d6 75 62 00 +2e +4c +56 +4c +31 +37 +32 +00 +2e +4c +56 +4c +31 +37 +33 +00 53 65 74 @@ -49889,6 +52276,22 @@ d6 6f 6e 00 +2e +4c +56 +4c +31 +37 +34 +00 +2e +4c +56 +4c +31 +37 +35 +00 53 65 74 @@ -49906,6 +52309,22 @@ d6 6f 6e 00 +2e +4c +56 +4c +31 +37 +36 +00 +2e +4c +56 +4c +31 +37 +37 +00 53 65 74 @@ -49922,6 +52341,30 @@ d6 4f 72 00 +2e +4c +56 +4c +31 +37 +38 +00 +2e +4c +56 +4c +31 +37 +39 +00 +2e +4c +56 +4c +31 +38 +30 +00 53 65 74 @@ -49937,6 +52380,44 @@ d6 6e 74 00 +2e +4c +56 +4c +31 +38 +31 +00 +2e +4c +31 +32 +35 +00 +2e +4c +56 +4c +31 +38 +32 +00 +2e +4c +56 +4c +31 +38 +33 +00 +2e +4c +56 +4c +31 +38 +34 +00 42 69 74 @@ -49958,6 +52439,328 @@ d6 68 74 00 +2e +4c +56 +4c +31 +38 +35 +00 +2e +4c +56 +4c +31 +38 +36 +00 +2e +4c +31 +35 +32 +00 +2e +4c +56 +4c +31 +38 +37 +00 +2e +4c +56 +4c +31 +38 +38 +00 +2e +4c +56 +4c +31 +38 +39 +00 +2e +4c +56 +4c +31 +39 +30 +00 +2e +4c +56 +4c +31 +39 +31 +00 +2e +4c +56 +4c +31 +39 +32 +00 +2e +4c +56 +4c +31 +39 +33 +00 +2e +4c +56 +4c +31 +39 +34 +00 +2e +4c +56 +4c +31 +39 +35 +00 +2e +4c +56 +4c +31 +39 +36 +00 +2e +4c +56 +4c +31 +39 +37 +00 +2e +4c +46 +45 +33 +36 +00 +2e +4c +46 +42 +33 +37 +00 +2e +4c +56 +4c +31 +39 +38 +00 +2e +4c +43 +46 +49 +33 +36 +00 +2e +4c +56 +4c +31 +39 +39 +00 +2e +4c +31 +35 +37 +00 +2e +4c +56 +4c +32 +30 +30 +00 +2e +4c +56 +4c +32 +30 +31 +00 +2e +4c +56 +4c +32 +30 +32 +00 +2e +4c +56 +4c +32 +30 +33 +00 +2e +4c +46 +45 +33 +37 +00 +2e +4c +46 +42 +33 +38 +00 +2e +4c +56 +4c +32 +30 +34 +00 +2e +4c +31 +35 +39 +00 +2e +4c +46 +45 +33 +38 +00 +2e +4c +46 +42 +33 +39 +00 +2e +4c +56 +4c +32 +30 +35 +00 +2e +4c +31 +36 +35 +00 +2e +4c +31 +36 +38 +00 +2e +4c +46 +45 +33 +39 +00 +2e +4c +46 +42 +34 +30 +00 +2e +4c +56 +4c +32 +30 +36 +00 +2e +4c +43 +46 +49 +33 +37 +00 +2e +4c +56 +4c +32 +30 +37 +00 +2e +4c +31 +37 +37 +00 +2e +4c +31 +37 +31 +00 +2e +4c +56 +4c +32 +30 +38 +00 +2e +4c +56 +4c +32 +30 +39 +00 +2e +4c +56 +4c +32 +31 +30 +00 42 69 74 @@ -49976,6 +52779,50 @@ d6 6c 6c 00 +2e +4c +56 +4c +32 +31 +31 +00 +2e +4c +46 +45 +34 +30 +00 +2e +4c +46 +42 +34 +31 +00 +2e +4c +56 +4c +32 +31 +32 +00 +2e +4c +31 +38 +36 +00 +2e +4c +56 +4c +32 +31 +33 +00 42 69 74 @@ -49991,6 +52838,228 @@ d6 67 6e 00 +2e +4c +46 +45 +34 +31 +00 +2e +4c +43 +32 +38 +00 +2e +4c +46 +42 +34 +32 +00 +2e +4c +56 +4c +32 +31 +34 +00 +2e +4c +43 +46 +49 +33 +38 +00 +2e +4c +56 +4c +32 +31 +35 +00 +2e +4c +31 +38 +39 +00 +2e +4c +31 +39 +34 +00 +2e +4c +56 +4c +32 +31 +36 +00 +2e +4c +56 +4c +32 +31 +37 +00 +2e +4c +56 +4c +32 +31 +38 +00 +2e +4c +56 +4c +32 +31 +39 +00 +2e +4c +56 +4c +32 +32 +30 +00 +2e +4c +56 +4c +32 +32 +31 +00 +2e +4c +56 +4c +32 +32 +32 +00 +2e +4c +46 +45 +34 +32 +00 +2e +4c +46 +42 +34 +33 +00 +2e +4c +56 +4c +32 +32 +33 +00 +2e +4c +43 +46 +49 +33 +39 +00 +2e +4c +56 +4c +32 +32 +34 +00 +2e +4c +31 +39 +37 +00 +2e +4c +56 +4c +32 +32 +35 +00 +2e +4c +32 +30 +38 +00 +2e +4c +56 +4c +32 +32 +36 +00 +2e +4c +32 +30 +31 +00 +2e +4c +56 +4c +32 +32 +37 +00 +2e +4c +56 +4c +32 +32 +38 +00 +2e +4c +31 +39 +39 +00 +2e +4c +56 +4c +32 +32 +39 +00 +2e +4c +56 +4c +32 +33 +30 +00 42 69 74 @@ -50006,6 +53075,394 @@ d6 62 5f 00 +2e +4c +42 +42 +32 +00 +2e +4c +32 +30 +39 +00 +2e +4c +56 +4c +32 +33 +31 +00 +2e +4c +32 +30 +33 +00 +2e +4c +42 +45 +32 +00 +2e +4c +56 +4c +32 +33 +32 +00 +2e +4c +56 +4c +32 +33 +33 +00 +2e +4c +56 +4c +32 +33 +34 +00 +2e +4c +42 +42 +33 +00 +2e +4c +56 +4c +32 +33 +35 +00 +2e +4c +42 +45 +33 +00 +2e +4c +56 +4c +32 +33 +36 +00 +2e +4c +42 +42 +34 +00 +2e +4c +56 +4c +32 +33 +37 +00 +2e +4c +42 +45 +34 +00 +2e +4c +46 +45 +34 +33 +00 +2e +4c +46 +42 +34 +35 +00 +2e +4c +56 +4c +32 +33 +38 +00 +2e +4c +43 +46 +49 +34 +30 +00 +2e +4c +43 +46 +49 +34 +31 +00 +2e +4c +43 +46 +49 +34 +32 +00 +2e +4c +43 +46 +49 +34 +33 +00 +2e +4c +43 +46 +49 +34 +34 +00 +2e +4c +43 +46 +49 +34 +35 +00 +2e +4c +43 +46 +49 +34 +36 +00 +2e +4c +56 +4c +32 +33 +39 +00 +2e +4c +32 +33 +30 +00 +2e +4c +56 +4c +32 +34 +30 +00 +2e +4c +56 +4c +32 +34 +31 +00 +2e +4c +56 +4c +32 +34 +32 +00 +2e +4c +56 +4c +32 +34 +33 +00 +2e +4c +32 +31 +35 +00 +2e +4c +56 +4c +32 +34 +34 +00 +2e +4c +32 +31 +38 +00 +2e +4c +32 +33 +31 +00 +2e +4c +32 +31 +39 +00 +2e +4c +32 +32 +33 +00 +2e +4c +56 +4c +32 +34 +35 +00 +2e +4c +32 +33 +32 +00 +2e +4c +56 +4c +32 +34 +36 +00 +2e +4c +56 +4c +32 +34 +37 +00 +2e +4c +56 +4c +32 +34 +38 +00 +2e +4c +56 +4c +32 +34 +39 +00 +2e +4c +56 +4c +32 +35 +30 +00 +2e +4c +56 +4c +32 +35 +31 +00 +2e +4c +56 +4c +32 +35 +32 +00 +2e +4c +56 +4c +32 +35 +33 +00 +2e +4c +56 +4c +32 +35 +34 +00 +2e +4c +56 +4c +32 +35 +35 +00 +2e +4c +42 +42 +35 +00 +2e +4c +56 +4c +32 +35 +36 +00 +2e +4c +56 +4c +32 +35 +37 +00 +2e +4c +32 +32 +32 +00 42 69 74 @@ -50028,6 +53485,56 @@ d6 68 74 00 +2e +4c +56 +4c +32 +35 +38 +00 +2e +4c +42 +45 +35 +00 +2e +4c +32 +33 +33 +00 +2e +4c +56 +4c +32 +35 +39 +00 +2e +4c +56 +4c +32 +36 +30 +00 +2e +4c +56 +4c +32 +36 +31 +00 +2e +4c +42 +42 +36 +00 42 69 74 @@ -50042,6 +53549,288 @@ d6 65 63 00 +2e +4c +56 +4c +32 +36 +32 +00 +2e +4c +56 +4c +32 +36 +33 +00 +2e +4c +42 +45 +36 +00 +2e +4c +56 +4c +32 +36 +34 +00 +2e +4c +56 +4c +32 +36 +35 +00 +2e +4c +56 +4c +32 +36 +36 +00 +2e +4c +46 +45 +34 +35 +00 +2e +4c +43 +32 +39 +00 +2e +4c +43 +33 +30 +00 +2e +4c +43 +33 +31 +00 +2e +4c +43 +33 +32 +00 +2e +4c +46 +42 +34 +34 +00 +2e +4c +56 +4c +32 +36 +37 +00 +2e +4c +43 +46 +49 +34 +37 +00 +2e +4c +43 +46 +49 +34 +38 +00 +2e +4c +43 +46 +49 +34 +39 +00 +2e +4c +43 +46 +49 +35 +30 +00 +2e +4c +43 +46 +49 +35 +31 +00 +2e +4c +43 +46 +49 +35 +32 +00 +2e +4c +56 +4c +32 +36 +38 +00 +2e +4c +43 +46 +49 +35 +33 +00 +2e +4c +56 +4c +32 +36 +39 +00 +2e +4c +56 +4c +32 +37 +30 +00 +2e +4c +32 +36 +33 +00 +2e +4c +56 +4c +32 +37 +31 +00 +2e +4c +32 +33 +37 +00 +2e +4c +32 +36 +34 +00 +2e +4c +56 +4c +32 +37 +32 +00 +2e +4c +32 +33 +38 +00 +2e +4c +32 +36 +35 +00 +2e +4c +32 +34 +30 +00 +2e +4c +32 +34 +33 +00 +2e +4c +32 +36 +36 +00 +2e +4c +32 +34 +36 +00 +2e +4c +56 +4c +32 +37 +33 +00 +2e +4c +56 +4c +32 +37 +34 +00 +2e +4c +32 +36 +37 +00 +2e +4c +32 +34 +39 +00 +2e +4c +32 +36 +38 +00 +2e +4c +32 +35 +34 +00 42 69 74 @@ -50087,6 +53876,98 @@ d6 61 64 00 +2e +4c +56 +4c +32 +37 +35 +00 +2e +4c +32 +35 +38 +00 +2e +4c +56 +4c +32 +37 +36 +00 +2e +4c +32 +36 +30 +00 +2e +4c +56 +4c +32 +37 +37 +00 +2e +4c +56 +4c +32 +37 +38 +00 +2e +4c +56 +4c +32 +37 +39 +00 +2e +4c +56 +4c +32 +38 +30 +00 +2e +4c +56 +4c +32 +38 +31 +00 +2e +4c +56 +4c +32 +38 +32 +00 +2e +4c +56 +4c +32 +38 +33 +00 +2e +4c +56 +4c +32 +38 +34 +00 42 69 74 @@ -50109,6 +53990,30 @@ d6 72 65 00 +2e +4c +56 +4c +32 +38 +35 +00 +2e +4c +56 +4c +32 +38 +36 +00 +2e +4c +56 +4c +32 +38 +37 +00 6d 65 6d @@ -50116,6 +54021,728 @@ d6 70 79 00 +2e +4c +56 +4c +32 +38 +38 +00 +2e +4c +56 +4c +32 +38 +39 +00 +2e +4c +56 +4c +32 +39 +30 +00 +2e +4c +56 +4c +32 +39 +31 +00 +2e +4c +56 +4c +32 +39 +32 +00 +2e +4c +32 +35 +35 +00 +2e +4c +32 +35 +37 +00 +2e +4c +56 +4c +32 +39 +33 +00 +2e +4c +46 +45 +34 +34 +00 +2e +4c +46 +42 +34 +36 +00 +2e +4c +56 +4c +32 +39 +34 +00 +2e +4c +43 +46 +49 +35 +34 +00 +2e +4c +43 +46 +49 +35 +35 +00 +2e +4c +43 +46 +49 +35 +36 +00 +2e +4c +43 +46 +49 +35 +37 +00 +2e +4c +43 +46 +49 +35 +38 +00 +2e +4c +43 +46 +49 +35 +39 +00 +2e +4c +56 +4c +32 +39 +35 +00 +2e +4c +56 +4c +32 +39 +36 +00 +2e +4c +32 +37 +30 +00 +2e +4c +56 +4c +32 +39 +37 +00 +2e +4c +32 +39 +30 +00 +2e +4c +32 +37 +32 +00 +2e +4c +56 +4c +32 +39 +38 +00 +2e +4c +32 +39 +31 +00 +2e +4c +56 +4c +32 +39 +39 +00 +2e +4c +32 +37 +37 +00 +2e +4c +56 +4c +33 +30 +30 +00 +2e +4c +32 +38 +31 +00 +2e +4c +56 +4c +33 +30 +31 +00 +2e +4c +32 +39 +32 +00 +2e +4c +56 +4c +33 +30 +32 +00 +2e +4c +32 +38 +34 +00 +2e +4c +56 +4c +33 +30 +33 +00 +2e +4c +32 +37 +34 +00 +2e +4c +56 +4c +33 +30 +34 +00 +2e +4c +56 +4c +33 +30 +35 +00 +2e +4c +56 +4c +33 +30 +36 +00 +2e +4c +56 +4c +33 +30 +37 +00 +2e +4c +56 +4c +33 +30 +38 +00 +2e +4c +56 +4c +33 +30 +39 +00 +2e +4c +56 +4c +33 +31 +30 +00 +2e +4c +56 +4c +33 +31 +31 +00 +2e +4c +32 +39 +33 +00 +2e +4c +56 +4c +33 +31 +32 +00 +2e +4c +56 +4c +33 +31 +33 +00 +2e +4c +56 +4c +33 +31 +34 +00 +2e +4c +32 +38 +35 +00 +2e +4c +56 +4c +33 +31 +35 +00 +2e +4c +56 +4c +33 +31 +36 +00 +2e +4c +56 +4c +33 +31 +37 +00 +2e +4c +46 +45 +34 +36 +00 +2e +4c +46 +42 +34 +37 +00 +2e +4c +56 +4c +33 +31 +38 +00 +2e +4c +43 +46 +49 +36 +30 +00 +2e +4c +43 +46 +49 +36 +31 +00 +2e +4c +43 +46 +49 +36 +32 +00 +2e +4c +43 +46 +49 +36 +33 +00 +2e +4c +56 +4c +33 +31 +39 +00 +2e +4c +56 +4c +33 +32 +30 +00 +2e +4c +32 +39 +35 +00 +2e +4c +56 +4c +33 +32 +31 +00 +2e +4c +32 +39 +39 +00 +2e +4c +32 +39 +37 +00 +2e +4c +56 +4c +33 +32 +32 +00 +2e +4c +33 +30 +32 +00 +2e +4c +56 +4c +33 +32 +33 +00 +2e +4c +33 +30 +38 +00 +2e +4c +33 +30 +34 +00 +2e +4c +33 +30 +37 +00 +2e +4c +56 +4c +33 +32 +34 +00 +2e +4c +56 +4c +33 +32 +35 +00 +2e +4c +56 +4c +33 +32 +36 +00 +2e +4c +56 +4c +33 +32 +37 +00 +2e +4c +56 +4c +33 +32 +38 +00 +2e +4c +56 +4c +33 +32 +39 +00 +2e +4c +56 +4c +33 +33 +30 +00 +2e +4c +46 +45 +34 +37 +00 +2e +4c +43 +33 +33 +00 +2e +4c +43 +33 +34 +00 +2e +4c +46 +42 +34 +38 +00 +2e +4c +56 +4c +33 +33 +31 +00 +2e +4c +43 +46 +49 +36 +34 +00 +2e +4c +43 +46 +49 +36 +35 +00 +2e +4c +43 +46 +49 +36 +36 +00 +2e +4c +43 +46 +49 +36 +37 +00 +2e +4c +56 +4c +33 +33 +32 +00 +2e +4c +33 +31 +31 +00 +2e +4c +56 +4c +33 +33 +33 +00 +2e +4c +33 +31 +35 +00 +2e +4c +56 +4c +33 +33 +34 +00 +2e +4c +56 +4c +33 +33 +35 +00 +2e +4c +56 +4c +33 +33 +36 +00 +2e +4c +56 +4c +33 +33 +37 +00 +2e +4c +56 +4c +33 +33 +38 +00 +2e +4c +56 +4c +33 +33 +39 +00 +2e +4c +56 +4c +33 +34 +30 +00 66 70 72 @@ -50124,6 +54751,22 @@ d6 74 66 00 +2e +4c +56 +4c +33 +34 +31 +00 +2e +4c +56 +4c +33 +34 +32 +00 42 69 74 @@ -50141,6 +54784,242 @@ d6 65 78 00 +2e +4c +56 +4c +33 +34 +33 +00 +2e +4c +56 +4c +33 +34 +34 +00 +2e +4c +56 +4c +33 +34 +35 +00 +2e +4c +56 +4c +33 +34 +36 +00 +2e +4c +56 +4c +33 +34 +37 +00 +2e +4c +56 +4c +33 +34 +38 +00 +2e +4c +46 +45 +34 +38 +00 +2e +4c +43 +33 +35 +00 +2e +4c +43 +33 +36 +00 +2e +4c +43 +33 +37 +00 +2e +4c +43 +33 +38 +00 +2e +4c +43 +33 +39 +00 +2e +4c +43 +34 +30 +00 +2e +4c +43 +34 +31 +00 +2e +4c +43 +34 +32 +00 +2e +4c +43 +34 +33 +00 +2e +4c +46 +42 +35 +30 +00 +2e +4c +56 +4c +33 +34 +39 +00 +2e +4c +43 +46 +49 +36 +38 +00 +2e +4c +56 +4c +33 +35 +30 +00 +2e +4c +43 +46 +49 +36 +39 +00 +2e +4c +56 +4c +33 +35 +31 +00 +2e +4c +43 +46 +49 +37 +30 +00 +2e +4c +56 +4c +33 +35 +32 +00 +2e +4c +43 +46 +49 +37 +31 +00 +2e +4c +56 +4c +33 +35 +33 +00 +2e +4c +43 +46 +49 +37 +32 +00 +2e +4c +56 +4c +33 +35 +34 +00 +2e +4c +43 +46 +49 +37 +33 +00 +2e +4c +56 +4c +33 +35 +35 +00 +2e +4c +43 +46 +49 +37 +34 +00 +2e +4c +56 +4c +33 +35 +36 +00 42 69 74 @@ -50156,6 +55035,91 @@ d6 6f 74 00 +2e +4c +33 +36 +36 +00 +2e +4c +56 +4c +33 +35 +37 +00 +2e +4c +56 +4c +33 +35 +38 +00 +2e +4c +56 +4c +33 +35 +39 +00 +2e +4c +56 +4c +33 +36 +30 +00 +2e +4c +56 +4c +33 +36 +31 +00 +2e +4c +56 +4c +33 +36 +32 +00 +2e +4c +56 +4c +33 +36 +33 +00 +2e +4c +56 +4c +33 +36 +34 +00 +2e +4c +56 +4c +33 +36 +35 +00 +66 +61 +69 +6c +65 +64 +00 70 72 69 @@ -50163,6 +55127,82 @@ d6 74 66 00 +2e +4c +56 +4c +33 +36 +36 +00 +2e +4c +33 +32 +30 +00 +2e +4c +56 +4c +33 +36 +37 +00 +2e +4c +33 +37 +30 +00 +2e +4c +42 +42 +37 +00 +2e +4c +42 +42 +38 +00 +2e +4c +42 +42 +39 +00 +2e +4c +56 +4c +33 +36 +38 +00 +2e +4c +33 +36 +35 +00 +66 +61 +69 +6c +6d +73 +67 +00 +2e +4c +56 +4c +33 +36 +39 +00 73 70 72 @@ -50171,6 +55211,24 @@ d6 74 66 00 +2e +4c +33 +33 +31 +00 +2e +4c +42 +45 +39 +00 +2e +4c +42 +45 +38 +00 70 75 74 @@ -50193,6 +55251,59 @@ d6 73 68 00 +2e +4c +33 +36 +37 +00 +2e +4c +42 +45 +37 +00 +2e +4c +42 +42 +31 +30 +00 +2e +4c +42 +45 +31 +30 +00 +2e +4c +33 +36 +38 +00 +2e +4c +42 +42 +31 +31 +00 +2e +4c +42 +42 +31 +32 +00 +2e +4c +42 +42 +31 +33 +00 79 61 73 @@ -50209,5117 +55320,6 @@ d6 00 2e 4c -64 -65 -62 -75 -67 -5f -61 -62 -62 -72 -65 -76 -30 -00 -2e -4c -64 -65 -62 -75 -67 -5f -69 -6e -66 -6f -30 -00 -2e -4c -64 -65 -62 -75 -67 -5f -6c -69 -6e -65 -30 -00 -2e -4c -74 -65 -78 -74 -30 -00 -2e -4c -43 -30 -00 -2e -4c -43 -31 -00 -2e -4c -43 -32 -00 -2e -4c -43 -33 -00 -2e -4c -43 -34 -00 -2e -4c -43 -35 -00 -2e -4c -43 -36 -00 -2e -4c -43 -37 -00 -2e -4c -43 -38 -00 -2e -4c -43 -39 -00 -2e -4c -43 -31 -30 -00 -2e -4c -43 -31 -31 -00 -2e -4c -43 -31 -32 -00 -2e -4c -43 -31 -33 -00 -2e -4c -43 -31 -34 -00 -2e -4c -43 -31 -35 -00 -2e -4c -43 -31 -36 -00 -2e -4c -43 -31 -37 -00 -2e -4c -43 -31 -38 -00 -2e -4c -46 -42 -32 -35 -00 -2e -4c -56 -4c -30 -00 -2e -4c -43 -46 -49 -30 -00 -2e -4c -56 -4c -31 -00 -63 -6f -6e -76 -5f -62 -76 -00 -72 -65 -73 -75 -6c -74 -00 -73 -70 -61 -72 -65 -00 -6f -70 -31 -73 -74 -61 -74 -69 -63 -00 -6f -70 -32 -73 -74 -61 -74 -69 -63 -00 -66 -72 -6f -6d -5f -64 -65 -63 -5f -64 -61 -74 -61 -00 -2e -4c -56 -4c -32 -00 -2e -4c -46 -45 -32 -35 -00 -2e -4c -46 -42 -32 -36 -00 -2e -4c -56 -4c -33 -00 -2e -4c -43 -46 -49 -31 -00 -2e -4c -56 -4c -34 -00 -2e -4c -56 -4c -35 -00 -2e -4c -46 -45 -32 -36 -00 -2e -4c -43 -31 -39 -00 -2e -4c -46 -42 -32 -37 -00 -2e -4c -56 -4c -36 -00 -2e -4c -43 -46 -49 -32 -00 -2e -4c -43 -46 -49 -33 -00 -2e -4c -43 -46 -49 -34 -00 -2e -4c -56 -4c -37 -00 -2e -4c -43 -46 -49 -35 -00 -2e -4c -56 -4c -38 -00 -2e -4c -56 -4c -39 -00 -2e -4c -56 -4c -31 -30 -00 -2e -4c -56 -4c -31 -31 -00 -2e -4c -56 -4c -31 -32 -00 -2e -4c -31 -33 -00 -2e -4c -36 -00 -2e -4c -38 -00 -2e -4c -56 -4c -31 -33 -00 -2e -4c -56 -4c -31 -34 -00 -2e -4c -56 -4c -31 -35 -00 -2e -4c -56 -4c -31 -36 -00 -2e -4c -56 -4c -31 -37 -00 -2e -4c -56 -4c -31 -38 -00 -2e -4c -56 -4c -31 -39 -00 -2e -4c -56 -4c -32 -30 -00 -2e -4c -56 -4c -32 -31 -00 -2e -4c -56 -4c -32 -32 -00 -2e -4c -46 -45 -32 -37 -00 -2e -4c -46 -42 -32 -38 -00 -2e -4c -56 -4c -32 -33 -00 -2e -4c -43 -46 -49 -36 -00 -2e -4c -43 -46 -49 -37 -00 -2e -4c -43 -46 -49 -38 -00 -2e -4c -56 -4c -32 -34 -00 -2e -4c -43 -46 -49 -39 -00 -2e -4c -56 -4c -32 -35 -00 -2e -4c -56 -4c -32 -36 -00 -2e -4c -56 -4c -32 -37 -00 -2e -4c -32 -31 -00 -2e -4c -31 -35 -00 -2e -4c -31 -37 -00 -2e -4c -56 -4c -32 -38 -00 -2e -4c -56 -4c -32 -39 -00 -2e -4c -56 -4c -33 -30 -00 -2e -4c -56 -4c -33 -31 -00 -2e -4c -56 -4c -33 -32 -00 -2e -4c -56 -4c -33 -33 -00 -2e -4c -56 -4c -33 -34 -00 -2e -4c -56 -4c -33 -35 -00 -2e -4c -56 -4c -33 -36 -00 -2e -4c -56 -4c -33 -37 -00 -2e -4c -46 -45 -32 -38 -00 -2e -4c -46 -42 -32 -39 -00 -2e -4c -56 -4c -33 -38 -00 -2e -4c -43 -46 -49 -31 -30 -00 -2e -4c -43 -46 -49 -31 -31 -00 -2e -4c -43 -46 -49 -31 -32 -00 -2e -4c -56 -4c -33 -39 -00 -2e -4c -43 -46 -49 -31 -33 -00 -2e -4c -56 -4c -34 -30 -00 -2e -4c -56 -4c -34 -31 -00 -2e -4c -56 -4c -34 -32 -00 -2e -4c -32 -39 -00 -2e -4c -32 -33 -00 -2e -4c -32 -35 -00 -2e -4c -56 -4c -34 -33 -00 -2e -4c -56 -4c -34 -34 -00 -2e -4c -56 -4c -34 -35 -00 -2e -4c -56 -4c -34 -36 -00 -2e -4c -56 -4c -34 -37 -00 -2e -4c -56 -4c -34 -38 -00 -2e -4c -56 -4c -34 -39 -00 -2e -4c -56 -4c -35 -30 -00 -2e -4c -56 -4c -35 -31 -00 -2e -4c -56 -4c -35 -32 -00 -2e -4c -46 -45 -32 -39 -00 -2e -4c -46 -42 -33 -30 -00 -2e -4c -56 -4c -35 -33 -00 -2e -4c -43 -46 -49 -31 -34 -00 -2e -4c -43 -46 -49 -31 -35 -00 -2e -4c -43 -46 -49 -31 -36 -00 -2e -4c -56 -4c -35 -34 -00 -2e -4c -43 -46 -49 -31 -37 -00 -2e -4c -56 -4c -35 -35 -00 -2e -4c -56 -4c -35 -36 -00 -2e -4c -56 -4c -35 -37 -00 -2e -4c -33 -37 -00 -2e -4c -33 -31 -00 -2e -4c -33 -33 -00 -2e -4c -56 -4c -35 -38 -00 -2e -4c -56 -4c -35 -39 -00 -2e -4c -56 -4c -36 -30 -00 -2e -4c -56 -4c -36 -31 -00 -2e -4c -56 -4c -36 -32 -00 -2e -4c -56 -4c -36 -33 -00 -2e -4c -56 -4c -36 -34 -00 -2e -4c -56 -4c -36 -35 -00 -2e -4c -56 -4c -36 -36 -00 -2e -4c -56 -4c -36 -37 -00 -2e -4c -46 -45 -33 -30 -00 -2e -4c -43 -32 -30 -00 -2e -4c -46 -42 -33 -31 -00 -2e -4c -56 -4c -36 -38 -00 -2e -4c -43 -46 -49 -31 -38 -00 -2e -4c -43 -46 -49 -31 -39 -00 -2e -4c -43 -46 -49 -32 -30 -00 -2e -4c -43 -46 -49 -32 -31 -00 -2e -4c -43 -46 -49 -32 -32 -00 -2e -4c -56 -4c -36 -39 -00 -2e -4c -56 -4c -37 -30 -00 -2e -4c -56 -4c -37 -31 -00 -2e -4c -56 -4c -37 -32 -00 -2e -4c -35 -39 -00 -2e -4c -33 -39 -00 -2e -4c -36 -30 -00 -2e -4c -34 -33 -00 -2e -4c -34 -34 -00 -2e -4c -56 -4c -37 -33 -00 -2e -4c -35 -30 -00 -2e -4c -34 -35 -00 -2e -4c -35 -35 -00 -2e -4c -35 -36 -00 -2e -4c -35 -37 -00 -2e -4c -34 -39 -00 -2e -4c -34 -38 -00 -2e -4c -56 -4c -37 -34 -00 -2e -4c -56 -4c -37 -35 -00 -2e -4c -34 -37 -00 -2e -4c -56 -4c -37 -36 -00 -2e -4c -56 -4c -37 -37 -00 -2e -4c -34 -36 -00 -2e -4c -56 -4c -37 -38 -00 -2e -4c -56 -4c -37 -39 -00 -2e -4c -56 -4c -38 -30 -00 -2e -4c -56 -4c -38 -31 -00 -2e -4c -56 -4c -38 -32 -00 -2e -4c -56 -4c -38 -33 -00 -2e -4c -56 -4c -38 -34 -00 -2e -4c -56 -4c -38 -35 -00 -2e -4c -36 -31 -00 -2e -4c -56 -4c -38 -36 -00 -2e -4c -56 -4c -38 -37 -00 -2e -4c -35 -31 -00 -2e -4c -56 -4c -38 -38 -00 -2e -4c -46 -45 -33 -31 -00 -2e -4c -46 -42 -33 -32 -00 -2e -4c -56 -4c -38 -39 -00 -2e -4c -43 -46 -49 -32 -33 -00 -2e -4c -56 -4c -39 -30 -00 -2e -4c -56 -4c -39 -31 -00 -2e -4c -56 -4c -39 -32 -00 -2e -4c -46 -45 -33 -32 -00 -2e -4c -46 -42 -33 -33 -00 -2e -4c -56 -4c -39 -33 -00 -2e -4c -43 -46 -49 -32 -34 -00 -2e -4c -56 -4c -39 -34 -00 -2e -4c -36 -35 -00 -2e -4c -56 -4c -39 -35 -00 -2e -4c -56 -4c -39 -36 -00 -2e -4c -56 -4c -39 -37 -00 -2e -4c -56 -4c -39 -38 -00 -2e -4c -56 -4c -39 -39 -00 -2e -4c -46 -45 -33 -33 -00 -2e -4c -46 -42 -33 -34 -00 -2e -4c -56 -4c -31 -30 -30 -00 -2e -4c -43 -46 -49 -32 -35 -00 -2e -4c -43 -46 -49 -32 -36 -00 -2e -4c -56 -4c -31 -30 -31 -00 -2e -4c -43 -46 -49 -32 -37 -00 -2e -4c -56 -4c -31 -30 -32 -00 -2e -4c -56 -4c -31 -30 -33 -00 -2e -4c -37 -31 -00 -2e -4c -37 -34 -00 -2e -4c -56 -4c -31 -30 -34 -00 -2e -4c -56 -4c -31 -30 -35 -00 -2e -4c -56 -4c -31 -30 -36 -00 -2e -4c -56 -4c -31 -30 -37 -00 -2e -4c -56 -4c -31 -30 -38 -00 -2e -4c -56 -4c -31 -30 -39 -00 -2e -4c -56 -4c -31 -31 -30 -00 -2e -4c -56 -4c -31 -31 -31 -00 -2e -4c -56 -4c -31 -31 -32 -00 -2e -4c -56 -4c -31 -31 -33 -00 -2e -4c -56 -4c -31 -31 -34 -00 -2e -4c -46 -45 -33 -34 -00 -2e -4c -46 -42 -33 -35 -00 -2e -4c -56 -4c -31 -31 -35 -00 -2e -4c -43 -46 -49 -32 -38 -00 -2e -4c -56 -4c -31 -31 -36 -00 -2e -4c -37 -39 -00 -2e -4c -56 -4c -31 -31 -37 -00 -2e -4c -56 -4c -31 -31 -38 -00 -2e -4c -56 -4c -31 -31 -39 -00 -2e -4c -56 -4c -31 -32 -30 -00 -2e -4c -56 -4c -31 -32 -31 -00 -2e -4c -56 -4c -31 -32 -32 -00 -2e -4c -46 -45 -33 -35 -00 -2e -4c -43 -32 -31 -00 -2e -4c -43 -32 -32 -00 -2e -4c -43 -32 -33 -00 -2e -4c -43 -32 -34 -00 -2e -4c -43 -32 -35 -00 -2e -4c -43 -32 -36 -00 -2e -4c -43 -32 -37 -00 -2e -4c -46 -42 -33 -36 -00 -2e -4c -56 -4c -31 -32 -33 -00 -2e -4c -43 -46 -49 -32 -39 -00 -2e -4c -43 -46 -49 -33 -30 -00 -2e -4c -43 -46 -49 -33 -31 -00 -2e -4c -43 -46 -49 -33 -32 -00 -2e -4c -43 -46 -49 -33 -33 -00 -2e -4c -43 -46 -49 -33 -34 -00 -2e -4c -43 -46 -49 -33 -35 -00 -2e -4c -56 -4c -31 -32 -34 -00 -2e -4c -56 -4c -31 -32 -35 -00 -2e -4c -31 -34 -36 -00 -2e -4c -56 -4c -31 -32 -36 -00 -2e -4c -56 -4c -31 -32 -37 -00 -2e -4c -56 -4c -31 -32 -38 -00 -2e -4c -56 -4c -31 -32 -39 -00 -2e -4c -38 -33 -00 -2e -4c -56 -4c -31 -33 -30 -00 -2e -4c -38 -36 -00 -2e -4c -31 -34 -37 -00 -2e -4c -56 -4c -31 -33 -31 -00 -2e -4c -38 -39 -00 -2e -4c -31 -34 -38 -00 -2e -4c -39 -32 -00 -2e -4c -31 -32 -31 -00 -2e -4c -39 -33 -00 -2e -4c -39 -34 -00 -2e -4c -39 -35 -00 -2e -4c -39 -36 -00 -2e -4c -39 -38 -00 -2e -4c -31 -30 -30 -00 -2e -4c -31 -30 -31 -00 -2e -4c -31 -30 -32 -00 -2e -4c -31 -30 -33 -00 -2e -4c -31 -30 -34 -00 -2e -4c -31 -30 -35 -00 -2e -4c -31 -30 -36 -00 -2e -4c -31 -30 -37 -00 -2e -4c -31 -30 -38 -00 -2e -4c -31 -30 -39 -00 -2e -4c -31 -31 -30 -00 -2e -4c -31 -31 -31 -00 -2e -4c -31 -31 -32 -00 -2e -4c -31 -31 -33 -00 -2e -4c -31 -31 -34 -00 -2e -4c -31 -31 -35 -00 -2e -4c -31 -31 -36 -00 -2e -4c -31 -31 -37 -00 -2e -4c -31 -31 -38 -00 -2e -4c -31 -31 -39 -00 -2e -4c -31 -32 -30 -00 -2e -4c -56 -4c -31 -33 -32 -00 -2e -4c -31 -32 -32 -00 -2e -4c -31 -33 -36 -00 -2e -4c -31 -34 -39 -00 -2e -4c -31 -33 -38 -00 -2e -4c -31 -34 -33 -00 -2e -4c -56 -4c -31 -33 -33 -00 -2e -4c -56 -4c -31 -33 -34 -00 -2e -4c -56 -4c -31 -33 -35 -00 -2e -4c -56 -4c -31 -33 -36 -00 -2e -4c -56 -4c -31 -33 -37 -00 -2e -4c -56 -4c -31 -33 -38 -00 -2e -4c -56 -4c -31 -33 -39 -00 -2e -4c -56 -4c -31 -34 -30 -00 -2e -4c -31 -35 -30 -00 -2e -4c -56 -4c -31 -34 -31 -00 -2e -4c -56 -4c -31 -34 -32 -00 -2e -4c -56 -4c -31 -34 -33 -00 -2e -4c -56 -4c -31 -34 -34 -00 -2e -4c -56 -4c -31 -34 -35 -00 -2e -4c -56 -4c -31 -34 -36 -00 -2e -4c -56 -4c -31 -34 -37 -00 -2e -4c -56 -4c -31 -34 -38 -00 -2e -4c -56 -4c -31 -34 -39 -00 -2e -4c -56 -4c -31 -35 -30 -00 -2e -4c -31 -34 -35 -00 -2e -4c -56 -4c -31 -35 -31 -00 -2e -4c -56 -4c -31 -35 -32 -00 -2e -4c -56 -4c -31 -35 -33 -00 -2e -4c -56 -4c -31 -35 -34 -00 -2e -4c -56 -4c -31 -35 -35 -00 -2e -4c -56 -4c -31 -35 -36 -00 -2e -4c -56 -4c -31 -35 -37 -00 -2e -4c -56 -4c -31 -35 -38 -00 -2e -4c -56 -4c -31 -35 -39 -00 -2e -4c -56 -4c -31 -36 -30 -00 -2e -4c -56 -4c -31 -36 -31 -00 -2e -4c -56 -4c -31 -36 -32 -00 -2e -4c -56 -4c -31 -36 -33 -00 -2e -4c -56 -4c -31 -36 -34 -00 -2e -4c -56 -4c -31 -36 -35 -00 -2e -4c -56 -4c -31 -36 -36 -00 -2e -4c -31 -35 -31 -00 -2e -4c -56 -4c -31 -36 -37 -00 -2e -4c -56 -4c -31 -36 -38 -00 -2e -4c -56 -4c -31 -36 -39 -00 -2e -4c -56 -4c -31 -37 -30 -00 -2e -4c -56 -4c -31 -37 -31 -00 -2e -4c -56 -4c -31 -37 -32 -00 -2e -4c -56 -4c -31 -37 -33 -00 -2e -4c -56 -4c -31 -37 -34 -00 -2e -4c -56 -4c -31 -37 -35 -00 -2e -4c -56 -4c -31 -37 -36 -00 -2e -4c -56 -4c -31 -37 -37 -00 -2e -4c -56 -4c -31 -37 -38 -00 -2e -4c -56 -4c -31 -37 -39 -00 -2e -4c -56 -4c -31 -38 -30 -00 -2e -4c -56 -4c -31 -38 -31 -00 -2e -4c -31 -32 -35 -00 -2e -4c -56 -4c -31 -38 -32 -00 -2e -4c -56 -4c -31 -38 -33 -00 -2e -4c -56 -4c -31 -38 -34 -00 -2e -4c -56 -4c -31 -38 -35 -00 -2e -4c -56 -4c -31 -38 -36 -00 -2e -4c -31 -35 -32 -00 -2e -4c -56 -4c -31 -38 -37 -00 -2e -4c -56 -4c -31 -38 -38 -00 -2e -4c -56 -4c -31 -38 -39 -00 -2e -4c -56 -4c -31 -39 -30 -00 -2e -4c -56 -4c -31 -39 -31 -00 -2e -4c -56 -4c -31 -39 -32 -00 -2e -4c -56 -4c -31 -39 -33 -00 -2e -4c -56 -4c -31 -39 -34 -00 -2e -4c -56 -4c -31 -39 -35 -00 -2e -4c -56 -4c -31 -39 -36 -00 -2e -4c -56 -4c -31 -39 -37 -00 -2e -4c -46 -45 -33 -36 -00 -2e -4c -46 -42 -33 -37 -00 -2e -4c -56 -4c -31 -39 -38 -00 -2e -4c -43 -46 -49 -33 -36 -00 -2e -4c -56 -4c -31 -39 -39 -00 -2e -4c -31 -35 -37 -00 -2e -4c -56 -4c -32 -30 -30 -00 -2e -4c -56 -4c -32 -30 -31 -00 -2e -4c -56 -4c -32 -30 -32 -00 -2e -4c -56 -4c -32 -30 -33 -00 -2e -4c -46 -45 -33 -37 -00 -2e -4c -46 -42 -33 -38 -00 -2e -4c -56 -4c -32 -30 -34 -00 -2e -4c -31 -35 -39 -00 -2e -4c -46 -45 -33 -38 -00 -2e -4c -46 -42 -33 -39 -00 -2e -4c -56 -4c -32 -30 -35 -00 -2e -4c -31 -36 -35 -00 -2e -4c -31 -36 -38 -00 -2e -4c -46 -45 -33 -39 -00 -2e -4c -46 -42 -34 -30 -00 -2e -4c -56 -4c -32 -30 -36 -00 -2e -4c -43 -46 -49 -33 -37 -00 -2e -4c -56 -4c -32 -30 -37 -00 -2e -4c -31 -37 -37 -00 -2e -4c -31 -37 -31 -00 -2e -4c -56 -4c -32 -30 -38 -00 -2e -4c -56 -4c -32 -30 -39 -00 -2e -4c -56 -4c -32 -31 -30 -00 -2e -4c -56 -4c -32 -31 -31 -00 -2e -4c -46 -45 -34 -30 -00 -2e -4c -46 -42 -34 -31 -00 -2e -4c -56 -4c -32 -31 -32 -00 -2e -4c -31 -38 -36 -00 -2e -4c -56 -4c -32 -31 -33 -00 -2e -4c -46 -45 -34 -31 -00 -2e -4c -43 -32 -38 -00 -2e -4c -46 -42 -34 -32 -00 -2e -4c -56 -4c -32 -31 -34 -00 -2e -4c -43 -46 -49 -33 -38 -00 -2e -4c -56 -4c -32 -31 -35 -00 -2e -4c -31 -38 -39 -00 -2e -4c -31 -39 -34 -00 -2e -4c -56 -4c -32 -31 -36 -00 -2e -4c -56 -4c -32 -31 -37 -00 -2e -4c -56 -4c -32 -31 -38 -00 -2e -4c -56 -4c -32 -31 -39 -00 -2e -4c -56 -4c -32 -32 -30 -00 -2e -4c -56 -4c -32 -32 -31 -00 -2e -4c -56 -4c -32 -32 -32 -00 -2e -4c -46 -45 -34 -32 -00 -2e -4c -46 -42 -34 -33 -00 -2e -4c -56 -4c -32 -32 -33 -00 -2e -4c -43 -46 -49 -33 -39 -00 -2e -4c -56 -4c -32 -32 -34 -00 -2e -4c -31 -39 -37 -00 -2e -4c -56 -4c -32 -32 -35 -00 -2e -4c -32 -30 -38 -00 -2e -4c -56 -4c -32 -32 -36 -00 -2e -4c -32 -30 -31 -00 -2e -4c -56 -4c -32 -32 -37 -00 -2e -4c -56 -4c -32 -32 -38 -00 -2e -4c -31 -39 -39 -00 -2e -4c -56 -4c -32 -32 -39 -00 -2e -4c -56 -4c -32 -33 -30 -00 -2e -4c -42 -42 -32 -00 -2e -4c -32 -30 -39 -00 -2e -4c -56 -4c -32 -33 -31 -00 -2e -4c -32 -30 -33 -00 -2e -4c -42 -45 -32 -00 -2e -4c -56 -4c -32 -33 -32 -00 -2e -4c -56 -4c -32 -33 -33 -00 -2e -4c -56 -4c -32 -33 -34 -00 -2e -4c -42 -42 -33 -00 -2e -4c -56 -4c -32 -33 -35 -00 -2e -4c -42 -45 -33 -00 -2e -4c -56 -4c -32 -33 -36 -00 -2e -4c -42 -42 -34 -00 -2e -4c -56 -4c -32 -33 -37 -00 -2e -4c -42 -45 -34 -00 -2e -4c -46 -45 -34 -33 -00 -2e -4c -46 -42 -34 -35 -00 -2e -4c -56 -4c -32 -33 -38 -00 -2e -4c -43 -46 -49 -34 -30 -00 -2e -4c -43 -46 -49 -34 -31 -00 -2e -4c -43 -46 -49 -34 -32 -00 -2e -4c -43 -46 -49 -34 -33 -00 -2e -4c -43 -46 -49 -34 -34 -00 -2e -4c -43 -46 -49 -34 -35 -00 -2e -4c -43 -46 -49 -34 -36 -00 -2e -4c -56 -4c -32 -33 -39 -00 -2e -4c -32 -33 -30 -00 -2e -4c -56 -4c -32 -34 -30 -00 -2e -4c -56 -4c -32 -34 -31 -00 -2e -4c -56 -4c -32 -34 -32 -00 -2e -4c -56 -4c -32 -34 -33 -00 -2e -4c -32 -31 -35 -00 -2e -4c -56 -4c -32 -34 -34 -00 -2e -4c -32 -31 -38 -00 -2e -4c -32 -33 -31 -00 -2e -4c -32 -31 -39 -00 -2e -4c -32 -32 -33 -00 -2e -4c -56 -4c -32 -34 -35 -00 -2e -4c -32 -33 -32 -00 -2e -4c -56 -4c -32 -34 -36 -00 -2e -4c -56 -4c -32 -34 -37 -00 -2e -4c -56 -4c -32 -34 -38 -00 -2e -4c -56 -4c -32 -34 -39 -00 -2e -4c -56 -4c -32 -35 -30 -00 -2e -4c -56 -4c -32 -35 -31 -00 -2e -4c -56 -4c -32 -35 -32 -00 -2e -4c -56 -4c -32 -35 -33 -00 -2e -4c -56 -4c -32 -35 -34 -00 -2e -4c -56 -4c -32 -35 -35 -00 -2e -4c -42 -42 -35 -00 -2e -4c -56 -4c -32 -35 -36 -00 -2e -4c -56 -4c -32 -35 -37 -00 -2e -4c -32 -32 -32 -00 -2e -4c -56 -4c -32 -35 -38 -00 -2e -4c -42 -45 -35 -00 -2e -4c -32 -33 -33 -00 -2e -4c -56 -4c -32 -35 -39 -00 -2e -4c -56 -4c -32 -36 -30 -00 -2e -4c -56 -4c -32 -36 -31 -00 -2e -4c -42 -42 -36 -00 -2e -4c -56 -4c -32 -36 -32 -00 -2e -4c -56 -4c -32 -36 -33 -00 -2e -4c -42 -45 -36 -00 -2e -4c -56 -4c -32 -36 -34 -00 -2e -4c -56 -4c -32 -36 -35 -00 -2e -4c -56 -4c -32 -36 -36 -00 -2e -4c -46 -45 -34 -35 -00 -2e -4c -43 -32 -39 -00 -2e -4c -43 -33 -30 -00 -2e -4c -43 -33 -31 -00 -2e -4c -43 -33 -32 -00 -2e -4c -46 -42 -34 -34 -00 -2e -4c -56 -4c -32 -36 -37 -00 -2e -4c -43 -46 -49 -34 -37 -00 -2e -4c -43 -46 -49 -34 -38 -00 -2e -4c -43 -46 -49 -34 -39 -00 -2e -4c -43 -46 -49 -35 -30 -00 -2e -4c -43 -46 -49 -35 -31 -00 -2e -4c -43 -46 -49 -35 -32 -00 -2e -4c -56 -4c -32 -36 -38 -00 -2e -4c -43 -46 -49 -35 -33 -00 -2e -4c -56 -4c -32 -36 -39 -00 -2e -4c -56 -4c -32 -37 -30 -00 -2e -4c -32 -36 -33 -00 -2e -4c -56 -4c -32 -37 -31 -00 -2e -4c -32 -33 -37 -00 -2e -4c -32 -36 -34 -00 -2e -4c -56 -4c -32 -37 -32 -00 -2e -4c -32 -33 -38 -00 -2e -4c -32 -36 -35 -00 -2e -4c -32 -34 -30 -00 -2e -4c -32 -34 -33 -00 -2e -4c -32 -36 -36 -00 -2e -4c -32 -34 -36 -00 -2e -4c -56 -4c -32 -37 -33 -00 -2e -4c -56 -4c -32 -37 -34 -00 -2e -4c -32 -36 -37 -00 -2e -4c -32 -34 -39 -00 -2e -4c -32 -36 -38 -00 -2e -4c -32 -35 -34 -00 -2e -4c -56 -4c -32 -37 -35 -00 -2e -4c -32 -35 -38 -00 -2e -4c -56 -4c -32 -37 -36 -00 -2e -4c -32 -36 -30 -00 -2e -4c -56 -4c -32 -37 -37 -00 -2e -4c -56 -4c -32 -37 -38 -00 -2e -4c -56 -4c -32 -37 -39 -00 -2e -4c -56 -4c -32 -38 -30 -00 -2e -4c -56 -4c -32 -38 -31 -00 -2e -4c -56 -4c -32 -38 -32 -00 -2e -4c -56 -4c -32 -38 -33 -00 -2e -4c -56 -4c -32 -38 -34 -00 -2e -4c -56 -4c -32 -38 -35 -00 -2e -4c -56 -4c -32 -38 -36 -00 -2e -4c -56 -4c -32 -38 -37 -00 -2e -4c -56 -4c -32 -38 -38 -00 -2e -4c -56 -4c -32 -38 -39 -00 -2e -4c -56 -4c -32 -39 -30 -00 -2e -4c -56 -4c -32 -39 -31 -00 -2e -4c -56 -4c -32 -39 -32 -00 -2e -4c -32 -35 -35 -00 -2e -4c -32 -35 -37 -00 -2e -4c -56 -4c -32 -39 -33 -00 -2e -4c -46 -45 -34 -34 -00 -2e -4c -46 -42 -34 -36 -00 -2e -4c -56 -4c -32 -39 -34 -00 -2e -4c -43 -46 -49 -35 -34 -00 -2e -4c -43 -46 -49 -35 -35 -00 -2e -4c -43 -46 -49 -35 -36 -00 -2e -4c -43 -46 -49 -35 -37 -00 -2e -4c -43 -46 -49 -35 -38 -00 -2e -4c -43 -46 -49 -35 -39 -00 -2e -4c -56 -4c -32 -39 -35 -00 -2e -4c -56 -4c -32 -39 -36 -00 -2e -4c -32 -37 -30 -00 -2e -4c -56 -4c -32 -39 -37 -00 -2e -4c -32 -39 -30 -00 -2e -4c -32 -37 -32 -00 -2e -4c -56 -4c -32 -39 -38 -00 -2e -4c -32 -39 -31 -00 -2e -4c -56 -4c -32 -39 -39 -00 -2e -4c -32 -37 -37 -00 -2e -4c -56 -4c -33 -30 -30 -00 -2e -4c -32 -38 -31 -00 -2e -4c -56 -4c -33 -30 -31 -00 -2e -4c -32 -39 -32 -00 -2e -4c -56 -4c -33 -30 -32 -00 -2e -4c -32 -38 -34 -00 -2e -4c -56 -4c -33 -30 -33 -00 -2e -4c -32 -37 -34 -00 -2e -4c -56 -4c -33 -30 -34 -00 -2e -4c -56 -4c -33 -30 -35 -00 -2e -4c -56 -4c -33 -30 -36 -00 -2e -4c -56 -4c -33 -30 -37 -00 -2e -4c -56 -4c -33 -30 -38 -00 -2e -4c -56 -4c -33 -30 -39 -00 -2e -4c -56 -4c -33 -31 -30 -00 -2e -4c -56 -4c -33 -31 -31 -00 -2e -4c -32 -39 -33 -00 -2e -4c -56 -4c -33 -31 -32 -00 -2e -4c -56 -4c -33 -31 -33 -00 -2e -4c -56 -4c -33 -31 -34 -00 -2e -4c -32 -38 -35 -00 -2e -4c -56 -4c -33 -31 -35 -00 -2e -4c -56 -4c -33 -31 -36 -00 -2e -4c -56 -4c -33 -31 -37 -00 -2e -4c -46 -45 -34 -36 -00 -2e -4c -46 -42 -34 -37 -00 -2e -4c -56 -4c -33 -31 -38 -00 -2e -4c -43 -46 -49 -36 -30 -00 -2e -4c -43 -46 -49 -36 -31 -00 -2e -4c -43 -46 -49 -36 -32 -00 -2e -4c -43 -46 -49 -36 -33 -00 -2e -4c -56 -4c -33 -31 -39 -00 -2e -4c -56 -4c -33 -32 -30 -00 -2e -4c -32 -39 -35 -00 -2e -4c -56 -4c -33 -32 -31 -00 -2e -4c -32 -39 -39 -00 -2e -4c -32 -39 -37 -00 -2e -4c -56 -4c -33 -32 -32 -00 -2e -4c -33 -30 -32 -00 -2e -4c -56 -4c -33 -32 -33 -00 -2e -4c -33 -30 -38 -00 -2e -4c -33 -30 -34 -00 -2e -4c -33 -30 -37 -00 -2e -4c -56 -4c -33 -32 -34 -00 -2e -4c -56 -4c -33 -32 -35 -00 -2e -4c -56 -4c -33 -32 -36 -00 -2e -4c -56 -4c -33 -32 -37 -00 -2e -4c -56 -4c -33 -32 -38 -00 -2e -4c -56 -4c -33 -32 -39 -00 -2e -4c -56 -4c -33 -33 -30 -00 -2e -4c -46 -45 -34 -37 -00 -2e -4c -43 -33 -33 -00 -2e -4c -43 -33 -34 -00 -2e -4c -46 -42 -34 -38 -00 -2e -4c -56 -4c -33 -33 -31 -00 -2e -4c -43 -46 -49 -36 -34 -00 -2e -4c -43 -46 -49 -36 -35 -00 -2e -4c -43 -46 -49 -36 -36 -00 -2e -4c -43 -46 -49 -36 -37 -00 -2e -4c -56 -4c -33 -33 -32 -00 -2e -4c -33 -31 -31 -00 -2e -4c -56 -4c -33 -33 -33 -00 -2e -4c -33 -31 -35 -00 -2e -4c -56 -4c -33 -33 -34 -00 -2e -4c -56 -4c -33 -33 -35 -00 -2e -4c -56 -4c -33 -33 -36 -00 -2e -4c -56 -4c -33 -33 -37 -00 -2e -4c -56 -4c -33 -33 -38 -00 -2e -4c -56 -4c -33 -33 -39 -00 -2e -4c -56 -4c -33 -34 -30 -00 -2e -4c -56 -4c -33 -34 -31 -00 -2e -4c -56 -4c -33 -34 -32 -00 -2e -4c -56 -4c -33 -34 -33 -00 -2e -4c -56 -4c -33 -34 -34 -00 -2e -4c -56 -4c -33 -34 -35 -00 -2e -4c -56 -4c -33 -34 -36 -00 -2e -4c -56 -4c -33 -34 -37 -00 -2e -4c -56 -4c -33 -34 -38 -00 -2e -4c -46 -45 -34 -38 -00 -2e -4c -43 -33 -35 -00 -2e -4c -43 -33 -36 -00 -2e -4c -43 -33 -37 -00 -2e -4c -43 -33 -38 -00 -2e -4c -43 -33 -39 -00 -2e -4c -43 -34 -30 -00 -2e -4c -43 -34 -31 -00 -2e -4c -43 -34 -32 -00 -2e -4c -43 -34 -33 -00 -2e -4c -46 -42 -35 -30 -00 -2e -4c -56 -4c -33 -34 -39 -00 -2e -4c -43 -46 -49 -36 -38 -00 -2e -4c -56 -4c -33 -35 -30 -00 -2e -4c -43 -46 -49 -36 -39 -00 -2e -4c -56 -4c -33 -35 -31 -00 -2e -4c -43 -46 -49 -37 -30 -00 -2e -4c -56 -4c -33 -35 -32 -00 -2e -4c -43 -46 -49 -37 -31 -00 -2e -4c -56 -4c -33 -35 -33 -00 -2e -4c -43 -46 -49 -37 -32 -00 -2e -4c -56 -4c -33 -35 -34 -00 -2e -4c -43 -46 -49 -37 -33 -00 -2e -4c -56 -4c -33 -35 -35 -00 -2e -4c -43 -46 -49 -37 -34 -00 -2e -4c -56 -4c -33 -35 -36 -00 -2e -4c -33 -36 -36 -00 -2e -4c -56 -4c -33 -35 -37 -00 -2e -4c -56 -4c -33 -35 -38 -00 -2e -4c -56 -4c -33 -35 -39 -00 -2e -4c -56 -4c -33 -36 -30 -00 -2e -4c -56 -4c -33 -36 -31 -00 -2e -4c -56 -4c -33 -36 -32 -00 -2e -4c -56 -4c -33 -36 -33 -00 -2e -4c -56 -4c -33 -36 -34 -00 -2e -4c -56 -4c -33 -36 -35 -00 -66 -61 -69 -6c -65 -64 -00 -2e -4c -56 -4c -33 -36 -36 -00 -2e -4c -33 -32 -30 -00 -2e -4c -56 -4c -33 -36 -37 -00 -2e -4c -33 -37 -30 -00 -2e -4c -42 -42 -37 -00 -2e -4c -42 -42 -38 -00 -2e -4c -42 -42 -39 -00 -2e -4c -56 -4c -33 -36 -38 -00 -2e -4c -33 -36 -35 -00 -66 -61 -69 -6c -6d -73 -67 -00 -2e -4c -56 -4c -33 -36 -39 -00 -2e -4c -33 -33 -31 -00 -2e -4c -42 -45 -39 -00 -2e -4c -42 -45 -38 -00 -2e -4c -33 -36 -37 -00 -2e -4c -42 -45 -37 -00 -2e -4c -42 -42 -31 -30 -00 -2e -4c -42 -45 -31 -30 -00 -2e -4c -33 -36 -38 -00 -2e -4c -42 -42 -31 -31 -00 -2e -4c -42 -42 -31 -32 -00 -2e -4c -42 -42 -31 -33 -00 -2e -4c 56 4c 33 @@ -70014,54 +70014,6 @@ c0 00 00 00 -69 -19 -00 -00 -00 -00 -04 -00 -fd -15 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -62 -19 -00 -00 -00 -00 -04 -00 -fd -15 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 5b 19 00 @@ -70086,7 +70038,7 @@ fd 00 00 00 -55 +54 19 00 00 @@ -70094,8 +70046,8 @@ fd 00 04 00 -16 -17 +fd +15 00 00 00 @@ -70110,7 +70062,7 @@ fd 00 00 00 -4e +4d 19 00 00 @@ -70118,7 +70070,7 @@ fd 00 04 00 -df +fd 15 00 00 @@ -70142,6 +70094,54 @@ df 00 04 00 +16 +17 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +40 +19 +00 +00 +00 +00 +04 +00 +df +15 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +39 +19 +00 +00 +00 +00 +04 +00 db 15 00 @@ -70158,7 +70158,7 @@ db 00 00 00 -41 +33 19 00 00 @@ -70182,7 +70182,7 @@ d8 00 00 00 -3b +2d 19 00 00 @@ -70206,7 +70206,7 @@ d6 00 00 00 -35 +11 19 00 00 @@ -70230,126 +70230,6 @@ bf 00 00 00 -2f -19 -00 -00 -00 -00 -04 -00 -bf -15 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -29 -19 -00 -00 -00 -00 -04 -00 -bf -15 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -21 -19 -00 -00 -00 -00 -04 -00 -b5 -15 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -19 -19 -00 -00 -00 -00 -12 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -13 -19 -00 -00 -00 -00 -04 -00 -a9 -15 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 0b 19 00 @@ -70358,7 +70238,7 @@ a9 00 04 00 -a9 +bf 15 00 00 @@ -70382,7 +70262,7 @@ a9 00 04 00 -6e +bf 15 00 00 @@ -70398,7 +70278,103 @@ a9 00 00 00 -ff +f5 +18 +00 +00 +00 +00 +04 +00 +b5 +15 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +ed +18 +00 +00 +00 +00 +12 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +e7 +18 +00 +00 +00 +00 +04 +00 +a9 +15 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +df +18 +00 +00 +00 +00 +04 +00 +a9 +15 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +d9 18 00 00 @@ -70422,7 +70398,7 @@ ff 00 00 00 -f9 +d3 18 00 00 @@ -70446,7 +70422,7 @@ f9 00 00 00 -f3 +cd 18 00 00 @@ -70470,7 +70446,7 @@ f3 00 00 00 -eb +c7 18 00 00 @@ -70494,7 +70470,31 @@ eb 00 00 00 -e5 +bf +18 +00 +00 +00 +00 +04 +00 +6e +15 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +b9 18 00 00 @@ -70518,7 +70518,7 @@ fd 00 00 00 -dd +b1 18 00 00 @@ -70542,7 +70542,7 @@ dd 00 00 00 -d6 +a3 18 00 00 @@ -70566,7 +70566,7 @@ d6 00 00 00 -ce +9b 18 00 00 @@ -70590,7 +70590,7 @@ ce 00 00 00 -c6 +93 18 00 00 @@ -70614,7 +70614,7 @@ c6 00 00 00 -be +8b 18 00 00 @@ -70638,7 +70638,7 @@ be 00 00 00 -b6 +83 18 00 00 @@ -70662,7 +70662,7 @@ b6 00 00 00 -ae +7b 18 00 00 @@ -70686,7 +70686,7 @@ ae 00 00 00 -a6 +73 18 00 00 @@ -70710,7 +70710,7 @@ a6 00 00 00 -9e +6b 18 00 00 @@ -70734,7 +70734,7 @@ a6 00 00 00 -96 +63 18 00 00 @@ -70758,7 +70758,7 @@ a6 00 00 00 -8e +5b 18 00 00 @@ -70782,7 +70782,7 @@ a6 00 00 00 -88 +55 18 00 00 @@ -70806,7 +70806,7 @@ a6 00 00 00 -80 +3e 18 00 00 @@ -70830,7 +70830,7 @@ a6 00 00 00 -78 +36 18 00 00 @@ -70854,7 +70854,7 @@ a6 00 00 00 -70 +2e 18 00 00 @@ -70878,7 +70878,7 @@ fa 00 00 00 -68 +26 18 00 00 @@ -70902,7 +70902,7 @@ fa 00 00 00 -60 +1e 18 00 00 @@ -70926,7 +70926,7 @@ f9 00 00 00 -58 +16 18 00 00 @@ -70950,7 +70950,7 @@ f9 00 00 00 -50 +0e 18 00 00 @@ -70974,7 +70974,7 @@ f8 00 00 00 -48 +06 18 00 00 @@ -70998,8 +70998,8 @@ f8 00 00 00 -40 -18 +fe +17 00 00 00 @@ -71022,8 +71022,8 @@ f6 00 00 00 -38 -18 +f6 +17 00 00 00 @@ -71046,8 +71046,8 @@ f6 00 00 00 -30 -18 +ee +17 00 00 00 @@ -71070,8 +71070,8 @@ f4 00 00 00 -28 -18 +e6 +17 00 00 00 @@ -71094,8 +71094,8 @@ f4 00 00 00 -20 -18 +de +17 00 00 00 @@ -71118,8 +71118,8 @@ f2 00 00 00 -18 -18 +d6 +17 00 00 00 @@ -71142,8 +71142,8 @@ f2 00 00 00 -10 -18 +ce +17 00 00 00 @@ -71166,8 +71166,8 @@ f0 00 00 00 -09 -18 +c7 +17 00 00 00 @@ -71190,8 +71190,8 @@ f0 00 00 00 -03 -18 +c1 +17 00 00 00 @@ -71214,7 +71214,7 @@ f8 00 00 00 -fd +bb 17 00 00 @@ -71238,7 +71238,7 @@ eb 00 00 00 -f7 +b5 17 00 00 @@ -71262,7 +71262,7 @@ f7 00 00 00 -f1 +af 17 00 00 @@ -71286,7 +71286,7 @@ f1 00 00 00 -eb +a9 17 00 00 @@ -71310,7 +71310,7 @@ e8 00 00 00 -e5 +a3 17 00 00 @@ -71334,7 +71334,7 @@ e8 00 00 00 -df +9d 17 00 00 @@ -71358,7 +71358,7 @@ e7 00 00 00 -d9 +97 17 00 00 @@ -71382,7 +71382,7 @@ e5 00 00 00 -d3 +91 17 00 00 @@ -71406,7 +71406,7 @@ d2 00 00 00 -cc +8a 17 00 00 @@ -71430,7 +71430,7 @@ f0 00 00 00 -c4 +82 17 00 00 @@ -71454,7 +71454,7 @@ f0 00 00 00 -bc +7a 17 00 00 @@ -71478,7 +71478,7 @@ ed 00 00 00 -b4 +72 17 00 00 @@ -71502,7 +71502,7 @@ e9 00 00 00 -ac +6a 17 00 00 @@ -71526,7 +71526,7 @@ e4 00 00 00 -a4 +62 17 00 00 @@ -71550,7 +71550,7 @@ df 00 00 00 -9c +5a 17 00 00 @@ -71574,7 +71574,7 @@ bf 00 00 00 -94 +41 17 00 00 @@ -71598,7 +71598,7 @@ b3 00 00 00 -8c +39 17 00 00 @@ -71622,7 +71622,7 @@ af 00 00 00 -84 +29 17 00 00 @@ -71646,7 +71646,7 @@ aa 00 00 00 -7c +21 17 00 00 @@ -71670,7 +71670,7 @@ a4 00 00 00 -74 +19 17 00 00 @@ -71694,7 +71694,7 @@ a4 00 00 00 -6c +11 17 00 00 @@ -71718,294 +71718,6 @@ a4 00 00 00 -64 -17 -00 -00 -00 -00 -04 -00 -87 -14 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -5c -17 -00 -00 -00 -00 -04 -00 -86 -14 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -54 -17 -00 -00 -00 -00 -04 -00 -82 -14 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -4e -17 -00 -00 -00 -00 -04 -00 -b0 -14 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -46 -17 -00 -00 -00 -00 -04 -00 -70 -14 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -40 -17 -00 -00 -00 -00 -04 -00 -87 -14 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -38 -17 -00 -00 -00 -00 -04 -00 -66 -14 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -30 -17 -00 -00 -00 -00 -04 -00 -66 -14 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -28 -17 -00 -00 -00 -00 -04 -00 -62 -14 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -20 -17 -00 -00 -00 -00 -04 -00 -5a -14 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -18 -17 -00 -00 -00 -00 -04 -00 -55 -14 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -10 -17 -00 -00 -00 -00 -04 -00 -50 -14 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 09 17 00 @@ -72014,6 +71726,270 @@ b0 00 04 00 +87 +14 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +17 +00 +00 +00 +00 +04 +00 +86 +14 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +f9 +16 +00 +00 +00 +00 +04 +00 +82 +14 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +f3 +16 +00 +00 +00 +00 +04 +00 +b0 +14 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +eb +16 +00 +00 +00 +00 +04 +00 +70 +14 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +e5 +16 +00 +00 +00 +00 +04 +00 +87 +14 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +dd +16 +00 +00 +00 +00 +04 +00 +66 +14 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +d5 +16 +00 +00 +00 +00 +04 +00 +66 +14 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +cd +16 +00 +00 +00 +00 +04 +00 +62 +14 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +c5 +16 +00 +00 +00 +00 +04 +00 +5a +14 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +bd +16 +00 +00 +00 +00 +04 +00 +55 +14 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +b5 +16 +00 +00 +00 +00 +04 +00 50 14 00 @@ -72030,8 +72006,32 @@ b0 00 00 00 -03 -17 +ae +16 +00 +00 +00 +00 +04 +00 +50 +14 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +a8 +16 00 00 00 @@ -72054,7 +72054,7 @@ ca 00 00 00 -fd +a2 16 00 00 @@ -72078,7 +72078,7 @@ c1 00 00 00 -f6 +9b 16 00 00 @@ -72102,7 +72102,7 @@ f6 00 00 00 -ee +93 16 00 00 @@ -72126,7 +72126,7 @@ ee 00 00 00 -e6 +8b 16 00 00 @@ -72150,7 +72150,7 @@ e6 00 00 00 -de +83 16 00 00 @@ -72174,7 +72174,7 @@ de 00 00 00 -d6 +7b 16 00 00 @@ -72198,7 +72198,7 @@ d6 00 00 00 -ce +73 16 00 00 @@ -72222,7 +72222,7 @@ ce 00 00 00 -c6 +6b 16 00 00 @@ -72246,7 +72246,7 @@ c6 00 00 00 -be +63 16 00 00 @@ -72270,7 +72270,7 @@ fe 00 00 00 -b8 +5d 16 00 00 @@ -72294,7 +72294,7 @@ e1 00 00 00 -b2 +57 16 00 00 @@ -72318,7 +72318,7 @@ b2 00 00 00 -ac +51 16 00 00 @@ -72342,7 +72342,7 @@ b5 00 00 00 -a4 +49 16 00 00 @@ -72366,7 +72366,7 @@ b5 00 00 00 -9e +43 16 00 00 @@ -72390,7 +72390,7 @@ b5 00 00 00 -96 +3b 16 00 00 @@ -72414,7 +72414,7 @@ b5 00 00 00 -90 +35 16 00 00 @@ -72438,7 +72438,7 @@ b5 00 00 00 -8a +2f 16 00 00 @@ -72462,7 +72462,7 @@ fe 00 00 00 -82 +27 16 00 00 @@ -72486,7 +72486,7 @@ fe 00 00 00 -7c +21 16 00 00 @@ -72510,7 +72510,7 @@ fe 00 00 00 -74 +19 16 00 00 @@ -72534,7 +72534,7 @@ fe 00 00 00 -6c +11 16 00 00 @@ -72558,7 +72558,7 @@ fe 00 00 00 -64 +09 16 00 00 @@ -72582,7 +72582,7 @@ fe 00 00 00 -5c +01 16 00 00 @@ -72606,8 +72606,8 @@ fe 00 00 00 -54 -16 +f9 +15 00 00 00 @@ -72630,8 +72630,8 @@ fe 00 00 00 -4c -16 +f1 +15 00 00 00 @@ -72654,8 +72654,8 @@ fe 00 00 00 -44 -16 +e9 +15 00 00 00 @@ -72678,8 +72678,8 @@ fe 00 00 00 -3d -16 +e2 +15 00 00 00 @@ -72702,8 +72702,8 @@ fe 00 00 00 -36 -16 +db +15 00 00 00 @@ -72726,8 +72726,8 @@ fe 00 00 00 -2e -16 +d3 +15 00 00 00 @@ -72750,151 +72750,7 @@ fe 00 00 00 -26 -16 -00 -00 -00 -00 -04 -00 -2d -13 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -1e -16 -00 -00 -00 -00 -04 -00 -1c -13 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -18 -16 -00 -00 -00 -00 -04 -00 -f4 -12 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -10 -16 -00 -00 -00 -00 -04 -00 -f4 -12 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -08 -16 -00 -00 -00 -00 -04 -00 -eb -12 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -16 -00 -00 -00 -00 -04 -00 -e2 -12 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -fa +cb 15 00 00 @@ -72918,7 +72774,151 @@ fa 00 00 00 -f2 +c3 +15 +00 +00 +00 +00 +04 +00 +1c +13 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +bd +15 +00 +00 +00 +00 +04 +00 +f4 +12 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +b5 +15 +00 +00 +00 +00 +04 +00 +f4 +12 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +ad +15 +00 +00 +00 +00 +04 +00 +eb +12 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +a5 +15 +00 +00 +00 +00 +04 +00 +e2 +12 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +9f +15 +00 +00 +00 +00 +04 +00 +2d +13 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +97 15 00 00 @@ -72942,7 +72942,7 @@ cd 00 00 00 -ea +8f 15 00 00 @@ -72966,7 +72966,7 @@ c2 00 00 00 -e2 +87 15 00 00 @@ -72990,7 +72990,7 @@ c1 00 00 00 -da +7f 15 00 00 @@ -73014,7 +73014,7 @@ bd 00 00 00 -d2 +77 15 00 00 @@ -73038,7 +73038,7 @@ b8 00 00 00 -ca +6f 15 00 00 @@ -73062,7 +73062,7 @@ b3 00 00 00 -c2 +67 15 00 00 @@ -73086,7 +73086,7 @@ ae 00 00 00 -ba +5f 15 00 00 @@ -73110,7 +73110,7 @@ a9 00 00 00 -b4 +59 15 00 00 @@ -73134,7 +73134,7 @@ a5 00 00 00 -ac +51 15 00 00 @@ -73158,7 +73158,7 @@ a5 00 00 00 -a6 +4b 15 00 00 @@ -73182,7 +73182,7 @@ a1 00 00 00 -9e +43 15 00 00 @@ -73206,7 +73206,7 @@ a1 00 00 00 -98 +3d 15 00 00 @@ -73230,7 +73230,7 @@ f2 00 00 00 -90 +35 15 00 00 @@ -73254,7 +73254,7 @@ f2 00 00 00 -8a +2f 15 00 00 @@ -73278,7 +73278,7 @@ f2 00 00 00 -82 +27 15 00 00 @@ -73302,7 +73302,7 @@ f2 00 00 00 -7c +21 15 00 00 @@ -73326,7 +73326,7 @@ f2 00 00 00 -74 +19 15 00 00 @@ -73350,7 +73350,7 @@ f2 00 00 00 -6e +13 15 00 00 @@ -73374,7 +73374,7 @@ d0 00 00 00 -66 +0b 15 00 00 @@ -73398,7 +73398,7 @@ d0 00 00 00 -60 +05 15 00 00 @@ -73422,8 +73422,8 @@ d0 00 00 00 -5a -15 +ff +14 00 00 00 @@ -73446,8 +73446,8 @@ d0 00 00 00 -52 -15 +f7 +14 00 00 00 @@ -73470,8 +73470,8 @@ d0 00 00 00 -4c -15 +f1 +14 00 00 00 @@ -73494,8 +73494,8 @@ c2 00 00 00 -44 -15 +e9 +14 00 00 00 @@ -73518,8 +73518,8 @@ c2 00 00 00 -3c -15 +e1 +14 00 00 00 @@ -73542,8 +73542,8 @@ c2 00 00 00 -34 -15 +d9 +14 00 00 00 @@ -73566,8 +73566,8 @@ c2 00 00 00 -2c -15 +d1 +14 00 00 00 @@ -73590,8 +73590,8 @@ c2 00 00 00 -24 -15 +c9 +14 00 00 00 @@ -73614,8 +73614,8 @@ c2 00 00 00 -1c -15 +c1 +14 00 00 00 @@ -73638,8 +73638,8 @@ c2 00 00 00 +b9 14 -15 00 00 00 @@ -73662,8 +73662,8 @@ c2 00 00 00 -0c -15 +b1 +14 00 00 00 @@ -73686,31 +73686,7 @@ c2 00 00 00 -04 -15 -00 -00 -00 -00 -04 -00 -30 -12 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -fd +a9 14 00 00 @@ -73734,7 +73710,31 @@ fd 00 00 00 -f6 +a2 +14 +00 +00 +00 +00 +04 +00 +30 +12 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +9b 14 00 00 @@ -73758,7 +73758,7 @@ f6 00 00 00 -ee +93 14 00 00 @@ -73782,7 +73782,7 @@ ee 00 00 00 -e8 +8d 14 00 00 @@ -73806,7 +73806,7 @@ e8 00 00 00 -e2 +87 14 00 00 @@ -73830,7 +73830,7 @@ e2 00 00 00 -da +7f 14 00 00 @@ -73854,7 +73854,7 @@ fe 00 00 00 -d2 +77 14 00 00 @@ -73878,7 +73878,7 @@ ea 00 00 00 -ca +6f 14 00 00 @@ -73902,7 +73902,7 @@ e5 00 00 00 -c2 +67 14 00 00 @@ -73926,7 +73926,7 @@ d0 00 00 00 -ba +5f 14 00 00 @@ -73950,7 +73950,7 @@ ba 00 00 00 -b2 +50 14 00 00 @@ -73974,7 +73974,7 @@ b2 00 00 00 -aa +48 14 00 00 @@ -73998,7 +73998,7 @@ aa 00 00 00 -a2 +40 14 00 00 @@ -74022,7 +74022,7 @@ a2 00 00 00 -9a +22 14 00 00 @@ -74046,7 +74046,7 @@ a2 00 00 00 -92 +1a 14 00 00 @@ -74070,7 +74070,7 @@ ff 00 00 00 -8a +12 14 00 00 @@ -74094,7 +74094,7 @@ fb 00 00 00 -82 +0a 14 00 00 @@ -74118,7 +74118,7 @@ f6 00 00 00 -7a +02 14 00 00 @@ -74142,438 +74142,6 @@ f1 00 00 00 -72 -14 -00 -00 -00 -00 -04 -00 -ec -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -6a -14 -00 -00 -00 -00 -04 -00 -e7 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -62 -14 -00 -00 -00 -00 -04 -00 -e2 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -5c -14 -00 -00 -00 -00 -04 -00 -d4 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -54 -14 -00 -00 -00 -00 -04 -00 -bf -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -4e -14 -00 -00 -00 -00 -04 -00 -83 -11 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -46 -14 -00 -00 -00 -00 -04 -00 -b6 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -40 -14 -00 -00 -00 -00 -04 -00 -8f -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -3a -14 -00 -00 -00 -00 -04 -00 -f0 -11 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -34 -14 -00 -00 -00 -00 -04 -00 -84 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -2e -14 -00 -00 -00 -00 -04 -00 -36 -11 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -26 -14 -00 -00 -00 -00 -04 -00 -76 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -1e -14 -00 -00 -00 -00 -04 -00 -51 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -18 -14 -00 -00 -00 -00 -04 -00 -4a -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -12 -14 -00 -00 -00 -00 -04 -00 -1a -11 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -0c -14 -00 -00 -00 -00 -04 -00 -00 -11 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -06 -14 -00 -00 -00 -00 -04 -00 -1d -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -14 -00 -00 -00 -00 -04 -00 -98 -11 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 fa 13 00 @@ -74582,7 +74150,7 @@ fa 00 04 00 -11 +ec 10 00 00 @@ -74606,6 +74174,414 @@ f2 00 04 00 +e7 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +ea +13 +00 +00 +00 +00 +04 +00 +e2 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +e4 +13 +00 +00 +00 +00 +04 +00 +d4 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +dc +13 +00 +00 +00 +00 +04 +00 +bf +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +d6 +13 +00 +00 +00 +00 +04 +00 +83 +11 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +ce +13 +00 +00 +00 +00 +04 +00 +b6 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +9b +13 +00 +00 +00 +00 +04 +00 +8f +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +95 +13 +00 +00 +00 +00 +04 +00 +f0 +11 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +8f +13 +00 +00 +00 +00 +04 +00 +84 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +89 +13 +00 +00 +00 +00 +04 +00 +36 +11 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +81 +13 +00 +00 +00 +00 +04 +00 +76 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +79 +13 +00 +00 +00 +00 +04 +00 +51 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +73 +13 +00 +00 +00 +00 +04 +00 +4a +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +6d +13 +00 +00 +00 +00 +04 +00 +1a +11 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +67 +13 +00 +00 +00 +00 +04 +00 +00 +11 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +61 +13 +00 +00 +00 +00 +04 +00 +1d +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +5b +13 +00 +00 +00 +00 +04 +00 +98 +11 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +55 +13 +00 +00 +00 +00 +04 +00 11 10 00 @@ -74622,7 +74598,31 @@ f2 00 00 00 -ec +4d +13 +00 +00 +00 +00 +04 +00 +11 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +47 13 00 00 @@ -74646,7 +74646,7 @@ d0 00 00 00 -e6 +41 13 00 00 @@ -74670,7 +74670,7 @@ fd 00 00 00 -de +39 13 00 00 @@ -74694,7 +74694,7 @@ fd 00 00 00 -d8 +33 13 00 00 @@ -74718,7 +74718,7 @@ d8 00 00 00 -d0 +2b 13 00 00 @@ -74742,7 +74742,7 @@ f7 00 00 00 -c8 +23 13 00 00 @@ -74766,7 +74766,7 @@ db 00 00 00 -c0 +1b 13 00 00 @@ -74790,7 +74790,7 @@ db 00 00 00 -b8 +13 13 00 00 @@ -74814,7 +74814,7 @@ d7 00 00 00 -b0 +0b 13 00 00 @@ -74838,7 +74838,7 @@ d4 00 00 00 -a8 +03 13 00 00 @@ -74862,8 +74862,8 @@ cf 00 00 00 -a0 -13 +fb +12 00 00 00 @@ -74886,8 +74886,8 @@ c7 00 00 00 -98 -13 +f3 +12 00 00 00 @@ -74910,8 +74910,8 @@ c2 00 00 00 -90 -13 +eb +12 00 00 00 @@ -74934,8 +74934,8 @@ ba 00 00 00 -88 -13 +e3 +12 00 00 00 @@ -74958,8 +74958,8 @@ b5 00 00 00 -80 -13 +db +12 00 00 00 @@ -74982,8 +74982,8 @@ b0 00 00 00 -79 -13 +d4 +12 00 00 00 @@ -75006,8 +75006,8 @@ b0 00 00 00 -73 -13 +ce +12 00 00 00 @@ -75030,8 +75030,8 @@ b8 00 00 00 -6d -13 +c8 +12 00 00 00 @@ -75054,8 +75054,8 @@ a6 00 00 00 -67 -13 +c2 +12 00 00 00 @@ -75078,8 +75078,8 @@ a6 00 00 00 -61 -13 +bc +12 00 00 00 @@ -75102,8 +75102,8 @@ a6 00 00 00 -5a -13 +b5 +12 00 00 00 @@ -75126,8 +75126,8 @@ a8 00 00 00 -52 -13 +ad +12 00 00 00 @@ -75150,8 +75150,8 @@ a3 00 00 00 -4a -13 +a5 +12 00 00 00 @@ -75174,8 +75174,8 @@ a3 00 00 00 -42 -13 +9d +12 00 00 00 @@ -75198,8 +75198,8 @@ a3 00 00 00 -3c -13 +97 +12 00 00 00 @@ -75222,8 +75222,8 @@ a3 00 00 00 -34 -13 +8f +12 00 00 00 @@ -75246,8 +75246,8 @@ a3 00 00 00 -2c -13 +87 +12 00 00 00 @@ -75270,8 +75270,8 @@ a3 00 00 00 -26 -13 +73 +12 00 00 00 @@ -75294,8 +75294,8 @@ a3 00 00 00 -1e -13 +6b +12 00 00 00 @@ -75318,8 +75318,8 @@ a3 00 00 00 -16 -13 +63 +12 00 00 00 @@ -75342,8 +75342,8 @@ a3 00 00 00 -0e -13 +5b +12 00 00 00 @@ -75366,8 +75366,8 @@ a3 00 00 00 -08 -13 +55 +12 00 00 00 @@ -75390,31 +75390,7 @@ a3 00 00 00 -02 -13 -00 -00 -00 -00 -04 -00 -45 -0f -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -fa +4f 12 00 00 @@ -75438,7 +75414,31 @@ fa 00 00 00 -f4 +47 +12 +00 +00 +00 +00 +04 +00 +45 +0f +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +2b 12 00 00 @@ -75462,7 +75462,7 @@ f4 00 00 00 -ec +23 12 00 00 @@ -75486,7 +75486,7 @@ ec 00 00 00 -e4 +1b 12 00 00 @@ -75510,7 +75510,7 @@ e4 00 00 00 -de +15 12 00 00 @@ -75534,7 +75534,7 @@ de 00 00 00 -d6 +0d 12 00 00 @@ -75558,7 +75558,7 @@ d6 00 00 00 -ce +05 12 00 00 @@ -75582,8 +75582,8 @@ ce 00 00 00 -c6 -12 +fd +11 00 00 00 @@ -75606,8 +75606,8 @@ c6 00 00 00 -be -12 +f5 +11 00 00 00 @@ -75630,8 +75630,8 @@ be 00 00 00 -b6 -12 +ed +11 00 00 00 @@ -75654,8 +75654,8 @@ b6 00 00 00 -ae -12 +e5 +11 00 00 00 @@ -75678,8 +75678,8 @@ ae 00 00 00 -a6 -12 +dd +11 00 00 00 @@ -75702,8 +75702,8 @@ fc 00 00 00 -9e -12 +d5 +11 00 00 00 @@ -75726,8 +75726,8 @@ f7 00 00 00 -96 -12 +cd +11 00 00 00 @@ -75750,8 +75750,8 @@ ee 00 00 00 -8e -12 +c5 +11 00 00 00 @@ -75774,8 +75774,8 @@ e6 00 00 00 -88 -12 +bf +11 00 00 00 @@ -75798,8 +75798,8 @@ e6 00 00 00 -80 -12 +b7 +11 00 00 00 @@ -75822,8 +75822,8 @@ d6 00 00 00 -7a -12 +b1 +11 00 00 00 @@ -75846,8 +75846,8 @@ e6 00 00 00 -74 -12 +ab +11 00 00 00 @@ -75870,8 +75870,8 @@ c9 00 00 00 -6e -12 +a5 +11 00 00 00 @@ -75894,8 +75894,8 @@ c9 00 00 00 -68 -12 +9f +11 00 00 00 @@ -75918,8 +75918,8 @@ f7 00 00 00 -60 -12 +97 +11 00 00 00 @@ -75942,8 +75942,8 @@ c2 00 00 00 -5a -12 +91 +11 00 00 00 @@ -75966,8 +75966,8 @@ b9 00 00 00 -52 -12 +89 +11 00 00 00 @@ -75990,8 +75990,8 @@ b9 00 00 00 -4a -12 +81 +11 00 00 00 @@ -76014,8 +76014,8 @@ a2 00 00 00 -42 -12 +79 +11 00 00 00 @@ -76038,8 +76038,8 @@ a2 00 00 00 -3a -12 +71 +11 00 00 00 @@ -76062,8 +76062,8 @@ a2 00 00 00 -34 -12 +6b +11 00 00 00 @@ -76086,8 +76086,8 @@ a2 00 00 00 -2c -12 +63 +11 00 00 00 @@ -76110,8 +76110,8 @@ a2 00 00 00 -24 -12 +5b +11 00 00 00 @@ -76134,8 +76134,8 @@ a2 00 00 00 -1c -12 +53 +11 00 00 00 @@ -76158,8 +76158,8 @@ a2 00 00 00 -14 -12 +4b +11 00 00 00 @@ -76182,8 +76182,8 @@ a2 00 00 00 -0c -12 +43 +11 00 00 00 @@ -76206,8 +76206,8 @@ a2 00 00 00 -04 -12 +3b +11 00 00 00 @@ -76230,7 +76230,7 @@ a2 00 00 00 -fc +33 11 00 00 @@ -76254,7 +76254,7 @@ fc 00 00 00 -f4 +2b 11 00 00 @@ -76278,7 +76278,7 @@ f4 00 00 00 -ec +23 11 00 00 @@ -76302,7 +76302,7 @@ ec 00 00 00 -e5 +1c 11 00 00 @@ -76326,7 +76326,7 @@ e5 00 00 00 -de +15 11 00 00 @@ -76350,7 +76350,7 @@ de 00 00 00 -d8 +0f 11 00 00 @@ -76374,7 +76374,7 @@ d8 00 00 00 -d0 +07 11 00 00 @@ -76398,7 +76398,7 @@ d0 00 00 00 -ca +01 11 00 00 @@ -76422,8 +76422,8 @@ ca 00 00 00 -c2 -11 +f9 +10 00 00 00 @@ -76446,8 +76446,8 @@ c2 00 00 00 -bc -11 +f3 +10 00 00 00 @@ -76470,8 +76470,8 @@ bc 00 00 00 -b4 -11 +eb +10 00 00 00 @@ -76494,8 +76494,8 @@ b4 00 00 00 -ae -11 +e5 +10 00 00 00 @@ -76518,8 +76518,8 @@ ae 00 00 00 -a6 -11 +dd +10 00 00 00 @@ -76542,8 +76542,8 @@ a6 00 00 00 -9e -11 +d5 +10 00 00 00 @@ -76566,8 +76566,8 @@ a6 00 00 00 -96 -11 +cd +10 00 00 00 @@ -76590,8 +76590,8 @@ a6 00 00 00 -90 -11 +c7 +10 00 00 00 @@ -76614,8 +76614,8 @@ a6 00 00 00 -8a -11 +c1 +10 00 00 00 @@ -76638,8 +76638,8 @@ a6 00 00 00 -82 -11 +b9 +10 00 00 00 @@ -76662,8 +76662,8 @@ a6 00 00 00 -7c -11 +b3 +10 00 00 00 @@ -76686,8 +76686,8 @@ a6 00 00 00 -76 -11 +ad +10 00 00 00 @@ -76710,8 +76710,8 @@ a6 00 00 00 -6e -11 +96 +10 00 00 00 @@ -76734,8 +76734,8 @@ fb 00 00 00 -66 -11 +8e +10 00 00 00 @@ -76758,8 +76758,8 @@ f0 00 00 00 -60 -11 +88 +10 00 00 00 @@ -76782,8 +76782,8 @@ ef 00 00 00 -58 -11 +80 +10 00 00 00 @@ -76806,8 +76806,8 @@ e8 00 00 00 -50 -11 +78 +10 00 00 00 @@ -76830,8 +76830,8 @@ e7 00 00 00 -4a -11 +72 +10 00 00 00 @@ -76854,8 +76854,8 @@ e6 00 00 00 -42 -11 +6a +10 00 00 00 @@ -76878,8 +76878,8 @@ e6 00 00 00 -3c -11 +64 +10 00 00 00 @@ -76902,8 +76902,8 @@ e6 00 00 00 -34 -11 +5c +10 00 00 00 @@ -76926,8 +76926,8 @@ cb 00 00 00 -2e -11 +56 +10 00 00 00 @@ -76950,8 +76950,8 @@ e8 00 00 00 -26 -11 +4e +10 00 00 00 @@ -76974,8 +76974,8 @@ c1 00 00 00 -1e -11 +46 +10 00 00 00 @@ -76998,8 +76998,8 @@ c1 00 00 00 -16 -11 +3e +10 00 00 00 @@ -77022,8 +77022,8 @@ c0 00 00 00 -0f -11 +37 +10 00 00 00 @@ -77046,8 +77046,8 @@ c0 00 00 00 -08 -11 +30 +10 00 00 00 @@ -77070,8 +77070,8 @@ bb 00 00 00 -00 -11 +28 +10 00 00 00 @@ -77094,7 +77094,7 @@ b6 00 00 00 -f8 +20 10 00 00 @@ -77118,7 +77118,7 @@ ab 00 00 00 -f0 +18 10 00 00 @@ -77142,7 +77142,7 @@ a8 00 00 00 -e8 +10 10 00 00 @@ -77166,7 +77166,7 @@ a7 00 00 00 -e0 +08 10 00 00 @@ -77190,7 +77190,7 @@ e0 00 00 00 -d8 +00 10 00 00 @@ -77214,8 +77214,8 @@ d8 00 00 00 -d0 -10 +f8 +0f 00 00 00 @@ -77238,8 +77238,8 @@ d0 00 00 00 -ca -10 +f2 +0f 00 00 00 @@ -77262,8 +77262,8 @@ a8 00 00 00 -c4 -10 +ec +0f 00 00 00 @@ -77286,8 +77286,8 @@ a0 00 00 00 -bc -10 +e4 +0f 00 00 00 @@ -77310,8 +77310,8 @@ bc 00 00 00 -b4 -10 +dc +0f 00 00 00 @@ -77334,8 +77334,8 @@ b4 00 00 00 -ac -10 +d4 +0f 00 00 00 @@ -77358,8 +77358,8 @@ ac 00 00 00 -a5 -10 +cd +0f 00 00 00 @@ -77382,8 +77382,8 @@ a5 00 00 00 -9f -10 +c7 +0f 00 00 00 @@ -77406,8 +77406,8 @@ a5 00 00 00 -98 -10 +c0 +0f 00 00 00 @@ -77430,8 +77430,8 @@ a5 00 00 00 -90 -10 +a9 +0f 00 00 00 @@ -77454,8 +77454,8 @@ a5 00 00 00 -8a -10 +a3 +0f 00 00 00 @@ -77478,8 +77478,8 @@ a5 00 00 00 -82 -10 +9b +0f 00 00 00 @@ -77502,8 +77502,8 @@ a5 00 00 00 -7b -10 +94 +0f 00 00 00 @@ -77526,8 +77526,8 @@ a5 00 00 00 -74 -10 +8d +0f 00 00 00 @@ -77550,8 +77550,8 @@ a5 00 00 00 -6c -10 +85 +0f 00 00 00 @@ -77574,8 +77574,8 @@ a5 00 00 00 -64 -10 +6b +0f 00 00 00 @@ -77598,8 +77598,8 @@ a5 00 00 00 -5c -10 +63 +0f 00 00 00 @@ -77622,8 +77622,8 @@ a5 00 00 00 -54 -10 +5b +0f 00 00 00 @@ -77646,8 +77646,8 @@ a5 00 00 00 -4e -10 +55 +0f 00 00 00 @@ -77670,8 +77670,8 @@ a5 00 00 00 -48 -10 +4f +0f 00 00 00 @@ -77694,8 +77694,8 @@ a5 00 00 00 -40 -10 +47 +0f 00 00 00 @@ -77718,8 +77718,8 @@ a5 00 00 00 -38 -10 +3f +0f 00 00 00 @@ -77742,8 +77742,32 @@ a5 00 00 00 +37 +0f +00 +00 +00 +00 +04 +00 +20 +0d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 30 -10 +0f 00 00 00 @@ -77767,31 +77791,7 @@ a5 00 00 29 -10 -00 -00 -00 -00 -04 -00 -20 -0d -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -22 -10 +0f 00 00 00 @@ -77814,8 +77814,8 @@ a5 00 00 00 -1c -10 +23 +0f 00 00 00 @@ -77838,8 +77838,8 @@ a5 00 00 00 -16 -10 +1d +0f 00 00 00 @@ -77862,8 +77862,32 @@ a5 00 00 00 +15 +0f +00 +00 +00 +00 +04 +00 +00 +0d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 0e -10 +0f 00 00 00 @@ -77887,31 +77911,7 @@ a5 00 00 07 -10 -00 -00 -00 -00 -04 -00 -00 -0d -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -10 +0f 00 00 00 @@ -77934,7 +77934,7 @@ f7 00 00 00 -fa +01 0f 00 00 @@ -77958,8 +77958,32 @@ f4 00 00 00 +f9 +0e +00 +00 +00 +00 +04 +00 +e0 +0c +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 f2 -0f +0e 00 00 00 @@ -77983,31 +78007,7 @@ e0 00 00 eb -0f -00 -00 -00 -00 -04 -00 -e0 -0c -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -e4 -0f +0e 00 00 00 @@ -78030,8 +78030,8 @@ db 00 00 00 -dc -0f +e3 +0e 00 00 00 @@ -78054,8 +78054,8 @@ da 00 00 00 -d4 -0f +db +0e 00 00 00 @@ -78078,8 +78078,8 @@ c3 00 00 00 -cc -0f +d3 +0e 00 00 00 @@ -78102,8 +78102,8 @@ c2 00 00 00 -c4 -0f +cb +0e 00 00 00 @@ -78126,8 +78126,8 @@ ba 00 00 00 -be -0f +c5 +0e 00 00 00 @@ -78150,8 +78150,8 @@ c3 00 00 00 -b6 -0f +bd +0e 00 00 00 @@ -78174,8 +78174,8 @@ b1 00 00 00 -ae -0f +b5 +0e 00 00 00 @@ -78198,8 +78198,32 @@ b1 00 00 00 +ad +0e +00 +00 +00 +00 +04 +00 +b0 +0c +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 a6 -0f +0e 00 00 00 @@ -78223,31 +78247,7 @@ b0 00 00 9f -0f -00 -00 -00 -00 -04 -00 -b0 -0c -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -98 -0f +0e 00 00 00 @@ -78270,8 +78270,8 @@ a2 00 00 00 -90 -0f +97 +0e 00 00 00 @@ -78294,8 +78294,8 @@ a2 00 00 00 -88 -0f +8f +0e 00 00 00 @@ -78318,8 +78318,8 @@ a2 00 00 00 -80 -0f +87 +0e 00 00 00 @@ -78342,8 +78342,8 @@ a2 00 00 00 -78 -0f +7f +0e 00 00 00 @@ -78366,8 +78366,8 @@ a2 00 00 00 -70 -0f +77 +0e 00 00 00 @@ -78390,8 +78390,8 @@ a2 00 00 00 -68 -0f +6f +0e 00 00 00 @@ -78414,8 +78414,8 @@ a2 00 00 00 -60 -0f +67 +0e 00 00 00 @@ -78438,8 +78438,8 @@ fc 00 00 00 -58 -0f +5f +0e 00 00 00 @@ -78462,8 +78462,8 @@ d9 00 00 00 -50 -0f +57 +0e 00 00 00 @@ -78486,8 +78486,8 @@ cd 00 00 00 -48 -0f +4f +0e 00 00 00 @@ -78510,8 +78510,8 @@ a9 00 00 00 -40 -0f +47 +0e 00 00 00 @@ -78534,8 +78534,8 @@ a9 00 00 00 -3a -0f +41 +0e 00 00 00 @@ -78558,8 +78558,8 @@ a9 00 00 00 -32 -0f +39 +0e 00 00 00 @@ -78582,8 +78582,8 @@ a9 00 00 00 -2a -0f +31 +0e 00 00 00 @@ -78606,8 +78606,8 @@ a9 00 00 00 -22 -0f +14 +0e 00 00 00 @@ -78630,8 +78630,8 @@ a9 00 00 00 -1a -0f +0c +0e 00 00 00 @@ -78654,8 +78654,8 @@ a9 00 00 00 -12 -0f +04 +0e 00 00 00 @@ -78678,8 +78678,8 @@ a9 00 00 00 -0c -0f +fe +0d 00 00 00 @@ -78702,8 +78702,8 @@ a9 00 00 00 -04 -0f +f6 +0d 00 00 00 @@ -78726,8 +78726,8 @@ a9 00 00 00 -fc -0e +df +0d 00 00 00 @@ -78750,8 +78750,8 @@ fc 00 00 00 -f4 -0e +d7 +0d 00 00 00 @@ -78774,8 +78774,8 @@ f1 00 00 00 -ec -0e +cf +0d 00 00 00 @@ -78798,8 +78798,8 @@ ec 00 00 00 -e4 -0e +b7 +0d 00 00 00 @@ -78822,8 +78822,8 @@ da 00 00 00 -dc -0e +af +0d 00 00 00 @@ -78846,8 +78846,8 @@ d5 00 00 00 -d4 -0e +96 +0d 00 00 00 @@ -78870,8 +78870,8 @@ c3 00 00 00 -cc -0e +8e +0d 00 00 00 @@ -78894,8 +78894,8 @@ be 00 00 00 -c4 -0e +7c +0d 00 00 00 @@ -78918,8 +78918,8 @@ ac 00 00 00 -bc -0e +74 +0d 00 00 00 @@ -78942,8 +78942,8 @@ a7 00 00 00 -b4 -0e +5e +0d 00 00 00 @@ -78966,8 +78966,8 @@ b4 00 00 00 -ac -0e +56 +0d 00 00 00 @@ -78990,8 +78990,8 @@ ac 00 00 00 -a4 -0e +40 +0d 00 00 00 @@ -79014,8 +79014,8 @@ a4 00 00 00 -9c -0e +38 +0d 00 00 00 @@ -79038,8 +79038,8 @@ a4 00 00 00 -94 -0e +1d +0d 00 00 00 @@ -79062,8 +79062,8 @@ a4 00 00 00 -8e -0e +17 +0d 00 00 00 @@ -79086,8 +79086,8 @@ a4 00 00 00 -86 -0e +0f +0d 00 00 00 @@ -79110,8 +79110,8 @@ a4 00 00 00 -7e -0e +07 +0d 00 00 00 @@ -79134,8 +79134,8 @@ a4 00 00 00 -76 -0e +ff +0c 00 00 00 @@ -79158,8 +79158,8 @@ a4 00 00 00 -6e -0e +f7 +0c 00 00 00 @@ -79182,8 +79182,8 @@ a4 00 00 00 -66 -0e +ef +0c 00 00 00 @@ -79206,8 +79206,8 @@ a4 00 00 00 -5e -0e +e7 +0c 00 00 00 @@ -79230,8 +79230,8 @@ a4 00 00 00 -56 -0e +df +0c 00 00 00 @@ -79254,8 +79254,8 @@ ff 00 00 00 -4e -0e +d7 +0c 00 00 00 @@ -79278,8 +79278,8 @@ f0 00 00 00 -46 -0e +c3 +0c 00 00 00 @@ -79302,8 +79302,8 @@ e6 00 00 00 -3e -0e +bb +0c 00 00 00 @@ -79326,8 +79326,8 @@ d7 00 00 00 -36 -0e +a3 +0c 00 00 00 @@ -79350,8 +79350,8 @@ c5 00 00 00 -2e -0e +9b +0c 00 00 00 @@ -79374,8 +79374,8 @@ b9 00 00 00 -26 -0e +93 +0c 00 00 00 @@ -79398,8 +79398,8 @@ b9 00 00 00 -1e -0e +8b +0c 00 00 00 @@ -79422,8 +79422,8 @@ b9 00 00 00 -16 -0e +6d +0c 00 00 00 @@ -79446,8 +79446,8 @@ b9 00 00 00 -0e -0e +65 +0c 00 00 00 @@ -79470,8 +79470,8 @@ b9 00 00 00 -08 -0e +51 +0c 00 00 00 @@ -79494,8 +79494,8 @@ b9 00 00 00 -00 -0e +36 +0c 00 00 00 @@ -79518,8 +79518,8 @@ b9 00 00 00 -f8 -0d +2e +0c 00 00 00 @@ -79542,8 +79542,8 @@ f8 00 00 00 -f0 -0d +26 +0c 00 00 00 @@ -79566,8 +79566,8 @@ f0 00 00 00 -e8 -0d +1e +0c 00 00 00 @@ -79590,8 +79590,8 @@ e8 00 00 00 -e0 -0d +16 +0c 00 00 00 @@ -79614,8 +79614,8 @@ e0 00 00 00 -d8 -0d +fd +0b 00 00 00 @@ -79638,8 +79638,8 @@ f9 00 00 00 -d0 -0d +e6 +0b 00 00 00 @@ -79662,8 +79662,8 @@ b5 00 00 00 -c8 -0d +de +0b 00 00 00 @@ -79686,8 +79686,8 @@ ab 00 00 00 -c0 -0d +d6 +0b 00 00 00 @@ -79710,8 +79710,8 @@ a8 00 00 00 -b8 -0d +ce +0b 00 00 00 @@ -79734,8 +79734,8 @@ a0 00 00 00 -b2 -0d +c8 +0b 00 00 00 @@ -79758,8 +79758,8 @@ d0 00 00 00 -aa -0d +c0 +0b 00 00 00 @@ -79782,8 +79782,8 @@ aa 00 00 00 -a2 -0d +b8 +0b 00 00 00 @@ -79806,8 +79806,8 @@ a2 00 00 00 -9a -0d +b0 +0b 00 00 00 @@ -79830,8 +79830,8 @@ a2 00 00 00 -92 -0d +a8 +0b 00 00 00 @@ -79854,8 +79854,8 @@ a2 00 00 00 -8a -0d +a0 +0b 00 00 00 @@ -79878,8 +79878,8 @@ a2 00 00 00 -82 -0d +98 +0b 00 00 00 @@ -79902,8 +79902,8 @@ a2 00 00 00 -7a -0d +90 +0b 00 00 00 @@ -79926,8 +79926,8 @@ a2 00 00 00 -72 -0d +88 +0b 00 00 00 @@ -79950,8 +79950,8 @@ a2 00 00 00 -6c -0d +82 +0b 00 00 00 @@ -79974,8 +79974,8 @@ a2 00 00 00 -66 -0d +7c +0b 00 00 00 @@ -79998,8 +79998,8 @@ a2 00 00 00 -60 -0d +76 +0b 00 00 00 @@ -80022,8 +80022,8 @@ e4 00 00 00 -5a -0d +70 +0b 00 00 00 @@ -80046,8 +80046,8 @@ e4 00 00 00 -54 -0d +6a +0b 00 00 00 @@ -80070,8 +80070,8 @@ e4 00 00 00 -4c -0d +62 +0b 00 00 00 @@ -80094,8 +80094,8 @@ e4 00 00 00 -46 -0d +47 +0b 00 00 00 @@ -80118,8 +80118,8 @@ f0 00 00 00 -40 -0d +41 +0b 00 00 00 @@ -80142,8 +80142,8 @@ d7 00 00 00 -3a -0d +3b +0b 00 00 00 @@ -80166,8 +80166,8 @@ d7 00 00 00 -34 -0d +35 +0b 00 00 00 @@ -80190,8 +80190,8 @@ fc 00 00 00 -2e -0d +2f +0b 00 00 00 @@ -80214,8 +80214,8 @@ cd 00 00 00 -28 -0d +29 +0b 00 00 00 @@ -80238,8 +80238,8 @@ cd 00 00 00 -22 -0d +23 +0b 00 00 00 @@ -80262,8 +80262,8 @@ b9 00 00 00 -1c -0d +1d +0b 00 00 00 @@ -80286,8 +80286,8 @@ b9 00 00 00 -16 -0d +17 +0b 00 00 00 @@ -80310,8 +80310,8 @@ b9 00 00 00 -10 -0d +11 +0b 00 00 00 @@ -80334,8 +80334,8 @@ b9 00 00 00 -0a -0d +0b +0b 00 00 00 @@ -80358,8 +80358,8 @@ b9 00 00 00 -04 -0d +05 +0b 00 00 00 @@ -80382,8 +80382,8 @@ b9 00 00 00 -fe -0c +ff +0a 00 00 00 @@ -80406,8 +80406,8 @@ fe 00 00 00 -f8 -0c +f9 +0a 00 00 00 @@ -80430,8 +80430,8 @@ f8 00 00 00 -f2 -0c +f3 +0a 00 00 00 @@ -80454,8 +80454,8 @@ f1 00 00 00 -ec -0c +ed +0a 00 00 00 @@ -80478,8 +80478,8 @@ da 00 00 00 -e6 -0c +e7 +0a 00 00 00 @@ -80502,8 +80502,8 @@ c3 00 00 00 -e0 -0c +e1 +0a 00 00 00 @@ -80526,8 +80526,8 @@ ac 00 00 00 -da -0c +db +0a 00 00 00 @@ -80550,8 +80550,8 @@ da 00 00 00 -d4 -0c +d5 +0a 00 00 00 @@ -80574,8 +80574,8 @@ d4 00 00 00 -ce -0c +cf +0a 00 00 00 @@ -80598,8 +80598,8 @@ f9 00 00 00 -c9 -0c +ca +0a 00 00 00 @@ -80622,8 +80622,8 @@ c9 00 00 00 -c4 -0c +c5 +0a 00 00 00 @@ -80646,8 +80646,8 @@ c4 00 00 00 -bf -0c +c0 +0a 00 00 00 @@ -80670,8 +80670,8 @@ bf 00 00 00 -ba -0c +bb +0a 00 00 00 @@ -80694,8 +80694,8 @@ ba 00 00 00 -b5 -0c +b6 +0a 00 00 00 @@ -80718,8 +80718,8 @@ b5 00 00 00 -af -0c +b0 +0a 00 00 00 @@ -80742,8 +80742,8 @@ af 00 00 00 -aa -0c +ab +0a 00 00 00 @@ -80766,8 +80766,8 @@ aa 00 00 00 -a4 -0c +a5 +0a 00 00 00 @@ -80790,8 +80790,8 @@ b5 00 00 00 -9f -0c +a0 +0a 00 00 00 @@ -80814,8 +80814,8 @@ b5 00 00 00 -97 -0c +98 +0a 00 00 00 @@ -80838,8 +80838,8 @@ e3 00 00 00 -91 -0c +92 +0a 00 00 00 @@ -80862,8 +80862,8 @@ a0 00 00 00 -8c -0c +8d +0a 00 00 00 @@ -80886,8 +80886,8 @@ e3 00 00 00 -84 -0c +85 +0a 00 00 00 @@ -80910,8 +80910,8 @@ b3 00 00 00 -7f -0c +80 +0a 00 00 00 @@ -80934,8 +80934,8 @@ b0 00 00 00 -77 -0c +78 +0a 00 00 00 @@ -80958,8 +80958,8 @@ b0 00 00 00 -6f -0c +70 +0a 00 00 00 @@ -80982,8 +80982,8 @@ b0 00 00 00 -67 -0c +68 +0a 00 00 00 @@ -81006,8 +81006,8 @@ b0 00 00 00 -5f -0c +60 +0a 00 00 00 @@ -81030,8 +81030,8 @@ b0 00 00 00 -59 -0c +5a +0a 00 00 00 @@ -81054,8 +81054,8 @@ a8 00 00 00 -51 -0c +52 +0a 00 00 00 @@ -81078,8 +81078,8 @@ a8 00 00 00 -49 -0c +4a +0a 00 00 00 @@ -81102,8 +81102,8 @@ a8 00 00 00 -41 -0c +42 +0a 00 00 00 @@ -81126,8 +81126,8 @@ a8 00 00 00 -39 -0c +3a +0a 00 00 00 @@ -81150,8 +81150,8 @@ a8 00 00 00 -31 -0c +32 +0a 00 00 00 @@ -81174,8 +81174,8 @@ a8 00 00 00 -29 -0c +2a +0a 00 00 00 @@ -81198,8 +81198,8 @@ a8 00 00 00 -21 -0c +22 +0a 00 00 00 @@ -81222,8 +81222,8 @@ a8 00 00 00 -19 -0c +1a +0a 00 00 00 @@ -81246,8 +81246,8 @@ a8 00 00 00 -11 -0c +12 +0a 00 00 00 @@ -81270,56 +81270,56 @@ a8 00 00 00 +0a +0a +00 +00 +00 +00 +04 +00 +50 +07 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +0a +00 +00 +00 +00 +04 +00 +50 +07 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +fd 09 -0c -00 -00 -00 -00 -04 -00 -50 -07 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -02 -0c -00 -00 -00 -00 -04 -00 -50 -07 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -fc -0b 00 00 00 @@ -81342,8 +81342,8 @@ fc 00 00 00 -f6 -0b +f7 +09 00 00 00 @@ -81366,8 +81366,8 @@ f6 00 00 00 -f0 -0b +f1 +09 00 00 00 @@ -81390,8 +81390,8 @@ f0 00 00 00 -ea -0b +eb +09 00 00 00 @@ -81414,8 +81414,8 @@ ea 00 00 00 -e4 -0b +e5 +09 00 00 00 @@ -81438,8 +81438,8 @@ e4 00 00 00 -de -0b +df +09 00 00 00 @@ -81462,8 +81462,8 @@ de 00 00 00 -d8 -0b +d9 +09 00 00 00 @@ -81486,8 +81486,8 @@ d8 00 00 00 -d1 -0b +d2 +09 00 00 00 @@ -81510,8 +81510,8 @@ d1 00 00 00 -c9 -0b +ca +09 00 00 00 @@ -81534,8 +81534,8 @@ c9 00 00 00 -c1 -0b +c2 +09 00 00 00 @@ -81558,8 +81558,8 @@ c1 00 00 00 -b9 -0b +ba +09 00 00 00 @@ -81582,8 +81582,8 @@ b9 00 00 00 -b1 -0b +b2 +09 00 00 00 @@ -81606,8 +81606,8 @@ b1 00 00 00 -a9 -0b +aa +09 00 00 00 @@ -81630,8 +81630,8 @@ a9 00 00 00 -a1 -0b +97 +09 00 00 00 @@ -81654,8 +81654,8 @@ a1 00 00 00 -9c -0b +92 +09 00 00 00 @@ -81678,8 +81678,8 @@ a1 00 00 00 -94 -0b +8a +09 00 00 00 @@ -81702,8 +81702,8 @@ a1 00 00 00 -8c -0b +82 +09 00 00 00 @@ -81726,8 +81726,8 @@ a1 00 00 00 -84 -0b +7a +09 00 00 00 @@ -81750,8 +81750,8 @@ a1 00 00 00 -7d -0b +73 +09 00 00 00 @@ -81774,8 +81774,8 @@ a1 00 00 00 -76 -0b +6c +09 00 00 00 @@ -81798,8 +81798,8 @@ a1 00 00 00 -6e -0b +64 +09 00 00 00 @@ -81822,1854 +81822,6 @@ a1 00 00 00 -66 -0b -00 -00 -00 -00 -04 -00 -16 -07 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -5e -0b -00 -00 -00 -00 -04 -00 -11 -07 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -56 -0b -00 -00 -00 -00 -04 -00 -ea -06 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -4e -0b -00 -00 -00 -00 -04 -00 -e9 -06 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -46 -0b -00 -00 -00 -00 -04 -00 -e5 -06 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -3e -0b -00 -00 -00 -00 -04 -00 -e0 -06 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -36 -0b -00 -00 -00 -00 -04 -00 -c7 -06 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -2e -0b -00 -00 -00 -00 -04 -00 -c6 -06 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -26 -0b -00 -00 -00 -00 -04 -00 -c2 -06 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -1e -0b -00 -00 -00 -00 -04 -00 -bd -06 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -19 -0b -00 -00 -00 -00 -04 -00 -f0 -06 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -14 -0b -00 -00 -00 -00 -04 -00 -c7 -06 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -0c -0b -00 -00 -00 -00 -04 -00 -a2 -06 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -04 -0b -00 -00 -00 -00 -04 -00 -96 -06 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -fc -0a -00 -00 -00 -00 -04 -00 -96 -06 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -f4 -0a -00 -00 -00 -00 -04 -00 -92 -06 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -ec -0a -00 -00 -00 -00 -04 -00 -8d -06 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -e4 -0a -00 -00 -00 -00 -04 -00 -85 -06 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -dc -0a -00 -00 -00 -00 -04 -00 -80 -06 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -d5 -0a -00 -00 -00 -00 -04 -00 -80 -06 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -ce -0a -00 -00 -00 -00 -04 -00 -71 -06 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -c7 -0a -00 -00 -00 -00 -04 -00 -70 -06 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -c0 -0a -00 -00 -00 -00 -04 -00 -59 -06 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -b9 -0a -00 -00 -00 -00 -04 -00 -0c -06 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -b2 -0a -00 -00 -00 -00 -04 -00 -0a -06 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -ab -0a -00 -00 -00 -00 -04 -00 -09 -06 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -a6 -0a -00 -00 -00 -00 -04 -00 -10 -06 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -9f -0a -00 -00 -00 -00 -04 -00 -04 -06 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -97 -0a -00 -00 -00 -00 -04 -00 -04 -06 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -90 -0a -00 -00 -00 -00 -04 -00 -00 -06 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -89 -0a -00 -00 -00 -00 -04 -00 -00 -06 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -82 -0a -00 -00 -00 -00 -04 -00 -ff -05 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -7b -0a -00 -00 -00 -00 -04 -00 -fe -05 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -74 -0a -00 -00 -00 -00 -04 -00 -e9 -05 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -6d -0a -00 -00 -00 -00 -04 -00 -e1 -05 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -65 -0a -00 -00 -00 -00 -04 -00 -e1 -05 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -5e -0a -00 -00 -00 -00 -04 -00 -e0 -05 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -57 -0a -00 -00 -00 -00 -04 -00 -e0 -05 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -50 -0a -00 -00 -00 -00 -04 -00 -d5 -05 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -49 -0a -00 -00 -00 -00 -04 -00 -b9 -05 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -44 -0a -00 -00 -00 -00 -04 -00 -70 -05 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -3d -0a -00 -00 -00 -00 -04 -00 -6c -05 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -36 -0a -00 -00 -00 -00 -04 -00 -6a -05 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -31 -0a -00 -00 -00 -00 -04 -00 -66 -05 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -2a -0a -00 -00 -00 -00 -04 -00 -1d -05 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -23 -0a -00 -00 -00 -00 -04 -00 -1c -05 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -1c -0a -00 -00 -00 -00 -04 -00 -18 -05 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -15 -0a -00 -00 -00 -00 -04 -00 -0e -05 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -0e -0a -00 -00 -00 -00 -04 -00 -09 -05 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -07 -0a -00 -00 -00 -00 -04 -00 -04 -05 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -0a -00 -00 -00 -00 -04 -00 -01 -05 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -f9 -09 -00 -00 -00 -00 -04 -00 -fa -04 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -f4 -09 -00 -00 -00 -00 -04 -00 -f6 -04 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -ed -09 -00 -00 -00 -00 -04 -00 -f6 -04 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -e6 -09 -00 -00 -00 -00 -04 -00 -eb -04 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -e1 -09 -00 -00 -00 -00 -04 -00 -e6 -04 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -da -09 -00 -00 -00 -00 -04 -00 -e6 -04 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -d3 -09 -00 -00 -00 -00 -04 -00 -db -04 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -ce -09 -00 -00 -00 -00 -04 -00 -d6 -04 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -c9 -09 -00 -00 -00 -00 -04 -00 -c5 -04 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -c4 -09 -00 -00 -00 -00 -04 -00 -b9 -05 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -bf -09 -00 -00 -00 -00 -04 -00 -c2 -05 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -ba -09 -00 -00 -00 -00 -04 -00 -cb -05 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -b5 -09 -00 -00 -00 -00 -04 -00 -01 -05 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -b0 -09 -00 -00 -00 -00 -0d -00 -08 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -a9 -09 -00 -00 -00 -00 -04 -00 -be -04 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -a4 -09 -00 -00 -00 -00 -04 -00 -20 -05 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -9f -09 -00 -00 -00 -00 -04 -00 -b5 -04 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -9a -09 -00 -00 -00 -00 -04 -00 -37 -05 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -95 -09 -00 -00 -00 -00 -04 -00 -9b -04 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -90 -09 -00 -00 -00 -00 -04 -00 -50 -05 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -89 -09 -00 -00 -00 -00 -04 -00 -7f -04 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -82 -09 -00 -00 -00 -00 -04 -00 -79 -04 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -7b -09 -00 -00 -00 -00 -04 -00 -73 -04 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -74 -09 -00 -00 -00 -00 -04 -00 -6e -04 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -6c -09 -00 -00 -00 -00 -04 -00 -6e -04 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -64 -09 -00 -00 -00 -00 -04 -00 -67 -04 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 5c 09 00 @@ -83678,8 +81830,8 @@ b5 00 04 00 -62 -04 +16 +07 00 00 00 @@ -83702,8 +81854,8 @@ b5 00 04 00 -5d -04 +11 +07 00 00 00 @@ -83726,8 +81878,8 @@ b5 00 04 00 -55 -04 +ea +06 00 00 00 @@ -83742,7 +81894,7 @@ b5 00 00 00 -45 +44 09 00 00 @@ -83750,8 +81902,8 @@ b5 00 04 00 -50 -04 +e9 +06 00 00 00 @@ -83766,7 +81918,7 @@ b5 00 00 00 -3e +3c 09 00 00 @@ -83774,8 +81926,8 @@ b5 00 04 00 -50 -04 +e5 +06 00 00 00 @@ -83790,31 +81942,7 @@ b5 00 00 00 -38 -09 -00 -00 -00 -00 -11 -00 -30 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -31 +34 09 00 00 @@ -83822,8 +81950,8 @@ b5 00 04 00 -46 -04 +e0 +06 00 00 00 @@ -83838,7 +81966,7 @@ b5 00 00 00 -2a +2c 09 00 00 @@ -83846,8 +81974,8 @@ b5 00 04 00 -2e -04 +c7 +06 00 00 00 @@ -83862,7 +81990,7 @@ b5 00 00 00 -23 +24 09 00 00 @@ -83870,8 +81998,8 @@ b5 00 04 00 -2d -04 +c6 +06 00 00 00 @@ -83894,8 +82022,8 @@ b5 00 04 00 -29 -04 +c2 +06 00 00 00 @@ -83910,7 +82038,7 @@ b5 00 00 00 -15 +14 09 00 00 @@ -83918,8 +82046,8 @@ b5 00 04 00 -24 -04 +bd +06 00 00 00 @@ -83934,7 +82062,7 @@ b5 00 00 00 -0e +0f 09 00 00 @@ -83942,8 +82070,8 @@ b5 00 04 00 -20 -04 +f0 +06 00 00 00 @@ -83958,7 +82086,7 @@ b5 00 00 00 -07 +0a 09 00 00 @@ -83966,23 +82094,23 @@ b5 00 04 00 +c7 +06 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 02 -04 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 09 00 00 @@ -83990,8 +82118,8 @@ b5 00 04 00 -01 -04 +a2 +06 00 00 00 @@ -84006,7 +82134,7 @@ b5 00 00 00 -f9 +fa 08 00 00 @@ -84014,8 +82142,8 @@ f9 00 04 00 -fd -03 +96 +06 00 00 00 @@ -84038,8 +82166,8 @@ f2 00 04 00 -f8 -03 +96 +06 00 00 00 @@ -84054,7 +82182,7 @@ f8 00 00 00 -eb +ea 08 00 00 @@ -84062,311 +82190,143 @@ eb 00 04 00 -f4 -03 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -e6 -08 -00 -00 -00 -00 -04 -00 -02 -04 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -e1 -08 -00 -00 -00 -00 -04 -00 -ae -03 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -dc -08 -00 -00 -00 -00 -04 -00 -30 -04 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -d5 -08 -00 -00 -00 -00 -04 -00 -9a -03 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -ce -08 -00 -00 -00 -00 -04 -00 -94 -03 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -c7 -08 -00 -00 -00 -00 -04 -00 -8b -03 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -bf -08 -00 -00 -00 -00 -04 -00 -8b -03 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -b8 -08 -00 -00 -00 -00 -04 -00 -87 -03 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -b0 -08 -00 -00 -00 -00 -04 -00 -82 -03 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -a8 -08 -00 -00 -00 -00 -04 -00 -7d -03 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -a0 -08 -00 -00 -00 -00 -04 -00 -75 -03 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -99 -08 -00 -00 -00 -00 -04 -00 -70 -03 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 92 +06 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +e2 +08 +00 +00 +00 +00 +04 +00 +8d +06 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +da +08 +00 +00 +00 +00 +04 +00 +85 +06 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +d2 +08 +00 +00 +00 +00 +04 +00 +80 +06 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +cb +08 +00 +00 +00 +00 +04 +00 +80 +06 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +c4 +08 +00 +00 +00 +00 +04 +00 +71 +06 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +bd 08 00 00 @@ -84375,7 +82335,103 @@ a0 04 00 70 -03 +06 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +b6 +08 +00 +00 +00 +00 +04 +00 +59 +06 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +9e +08 +00 +00 +00 +00 +04 +00 +0c +06 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +97 +08 +00 +00 +00 +00 +04 +00 +0a +06 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +90 +08 +00 +00 +00 +00 +04 +00 +09 +06 00 00 00 @@ -84398,8 +82454,8 @@ a0 00 04 00 -66 -03 +10 +06 00 00 00 @@ -84422,8 +82478,8 @@ a0 00 04 00 -4e -03 +04 +06 00 00 00 @@ -84438,7 +82494,7 @@ a0 00 00 00 -7d +7c 08 00 00 @@ -84446,8 +82502,8 @@ a0 00 04 00 -4d -03 +04 +06 00 00 00 @@ -84462,7 +82518,7 @@ a0 00 00 00 -76 +75 08 00 00 @@ -84470,8 +82526,8 @@ a0 00 04 00 -49 -03 +00 +06 00 00 00 @@ -84486,7 +82542,7 @@ a0 00 00 00 -6f +6e 08 00 00 @@ -84494,8 +82550,8 @@ a0 00 04 00 -44 -03 +00 +06 00 00 00 @@ -84510,7 +82566,7 @@ a0 00 00 00 -68 +67 08 00 00 @@ -84518,8 +82574,8 @@ a0 00 04 00 -40 -03 +ff +05 00 00 00 @@ -84534,7 +82590,7 @@ a0 00 00 00 -61 +60 08 00 00 @@ -84542,8 +82598,8 @@ a0 00 04 00 -22 -03 +fe +05 00 00 00 @@ -84558,7 +82614,7 @@ a0 00 00 00 -5a +59 08 00 00 @@ -84566,8 +82622,8 @@ a0 00 04 00 -21 -03 +e9 +05 00 00 00 @@ -84582,7 +82638,7 @@ a0 00 00 00 -53 +52 08 00 00 @@ -84590,8 +82646,8 @@ a0 00 04 00 -1d -03 +e1 +05 00 00 00 @@ -84606,7 +82662,7 @@ a0 00 00 00 -4c +4a 08 00 00 @@ -84614,8 +82670,8 @@ a0 00 04 00 -18 -03 +e1 +05 00 00 00 @@ -84630,7 +82686,7 @@ a0 00 00 00 -45 +43 08 00 00 @@ -84638,8 +82694,8 @@ a0 00 04 00 -14 -03 +e0 +05 00 00 00 @@ -84654,7 +82710,7 @@ a0 00 00 00 -40 +3c 08 00 00 @@ -84662,8 +82718,8 @@ a0 00 04 00 -22 -03 +e0 +05 00 00 00 @@ -84678,7 +82734,7 @@ a0 00 00 00 -3b +35 08 00 00 @@ -84686,8 +82742,8 @@ a0 00 04 00 -ce -02 +d5 +05 00 00 00 @@ -84702,7 +82758,7 @@ ce 00 00 00 -36 +2e 08 00 00 @@ -84710,8 +82766,8 @@ ce 00 04 00 -50 -03 +b9 +05 00 00 00 @@ -84726,175 +82782,7 @@ ce 00 00 00 -2f -08 -00 -00 -00 -00 -04 -00 -ba -02 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -28 -08 -00 -00 -00 -00 -04 -00 -b4 -02 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -21 -08 -00 -00 -00 -00 -04 -00 -ab -02 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -19 -08 -00 -00 -00 -00 -04 -00 -ab -02 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -12 -08 -00 -00 -00 -00 -04 -00 -a7 -02 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -0a -08 -00 -00 -00 -00 -04 -00 -a2 -02 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -02 -08 -00 -00 -00 -00 -04 -00 -9d -02 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -fa +ff 07 00 00 @@ -84902,8 +82790,8 @@ fa 00 04 00 -95 -02 +70 +05 00 00 00 @@ -84918,79 +82806,7 @@ fa 00 00 00 -f3 -07 -00 -00 -00 -00 -04 -00 -90 -02 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -ec -07 -00 -00 -00 -00 -04 -00 -90 -02 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -e5 -07 -00 -00 -00 -00 -04 -00 -86 -02 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -de +f8 07 00 00 @@ -84999,7 +82815,7 @@ de 04 00 6c -02 +05 00 00 00 @@ -85014,7 +82830,7 @@ de 00 00 00 -d7 +f1 07 00 00 @@ -85022,8 +82838,8 @@ d7 00 04 00 -6b -02 +6a +05 00 00 00 @@ -85038,7 +82854,7 @@ d7 00 00 00 -d0 +dc 07 00 00 @@ -85046,8 +82862,8 @@ d0 00 04 00 -67 -02 +66 +05 00 00 00 @@ -85062,7 +82878,7 @@ d0 00 00 00 -c9 +d5 07 00 00 @@ -85070,8 +82886,8 @@ c9 00 04 00 -62 -02 +1d +05 00 00 00 @@ -85086,7 +82902,7 @@ c9 00 00 00 -c2 +ce 07 00 00 @@ -85094,8 +82910,8 @@ c2 00 04 00 -5e -02 +1c +05 00 00 00 @@ -85110,7 +82926,7 @@ c2 00 00 00 -bb +c7 07 00 00 @@ -85118,8 +82934,8 @@ bb 00 04 00 -3e -02 +18 +05 00 00 00 @@ -85134,7 +82950,7 @@ bb 00 00 00 -b4 +c0 07 00 00 @@ -85142,8 +82958,8 @@ b4 00 04 00 -3d -02 +0e +05 00 00 00 @@ -85158,7 +82974,7 @@ b4 00 00 00 -ad +b9 07 00 00 @@ -85166,8 +82982,8 @@ ad 00 04 00 -39 -02 +09 +05 00 00 00 @@ -85182,7 +82998,7 @@ ad 00 00 00 -a6 +b2 07 00 00 @@ -85190,8 +83006,56 @@ a6 00 04 00 -34 -02 +04 +05 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +ab +07 +00 +00 +00 +00 +04 +00 +01 +05 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +a4 +07 +00 +00 +00 +00 +04 +00 +fa +04 00 00 00 @@ -85214,8 +83078,8 @@ a6 00 04 00 -30 -02 +f6 +04 00 00 00 @@ -85230,7 +83094,7 @@ a6 00 00 00 -9a +98 07 00 00 @@ -85238,8 +83102,8 @@ a6 00 04 00 -40 -02 +f6 +04 00 00 00 @@ -85254,7 +83118,7 @@ a6 00 00 00 -95 +91 07 00 00 @@ -85262,8 +83126,8 @@ a6 00 04 00 -ea -01 +eb +04 00 00 00 @@ -85278,7 +83142,7 @@ ea 00 00 00 -90 +8c 07 00 00 @@ -85286,8 +83150,8 @@ ea 00 04 00 -70 -02 +e6 +04 00 00 00 @@ -85302,7 +83166,7 @@ ea 00 00 00 -89 +85 07 00 00 @@ -85310,8 +83174,8 @@ ea 00 04 00 -da -01 +e6 +04 00 00 00 @@ -85326,7 +83190,7 @@ da 00 00 00 -82 +7e 07 00 00 @@ -85334,8 +83198,8 @@ da 00 04 00 -d4 -01 +db +04 00 00 00 @@ -85350,7 +83214,7 @@ d4 00 00 00 -7b +79 07 00 00 @@ -85358,8 +83222,8 @@ d4 00 04 00 -cb -01 +d6 +04 00 00 00 @@ -85382,8 +83246,8 @@ cb 00 04 00 -cb -01 +c5 +04 00 00 00 @@ -85398,7 +83262,7 @@ cb 00 00 00 -6d +6f 07 00 00 @@ -85406,8 +83270,8 @@ cb 00 04 00 -c7 -01 +b9 +05 00 00 00 @@ -85422,7 +83286,7 @@ c7 00 00 00 -66 +6a 07 00 00 @@ -85431,7 +83295,7 @@ c7 04 00 c2 -01 +05 00 00 00 @@ -85446,7 +83310,7 @@ c2 00 00 00 -5f +65 07 00 00 @@ -85454,8 +83318,8 @@ c2 00 04 00 -bd -01 +cb +05 00 00 00 @@ -85470,7 +83334,7 @@ bd 00 00 00 -58 +60 07 00 00 @@ -85478,8 +83342,8 @@ bd 00 04 00 -b5 01 +05 00 00 00 @@ -85494,7 +83358,31 @@ b5 00 00 00 -51 +5b +07 +00 +00 +00 +00 +0d +00 +08 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +54 07 00 00 @@ -85502,8 +83390,32 @@ b5 00 04 00 -b0 -01 +be +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +4f +07 +00 +00 +00 +00 +04 +00 +20 +05 00 00 00 @@ -85526,8 +83438,8 @@ b0 00 04 00 -b0 -01 +b5 +04 00 00 00 @@ -85542,7 +83454,7 @@ b0 00 00 00 -43 +45 07 00 00 @@ -85550,8 +83462,8 @@ b0 00 04 00 -a6 -01 +37 +05 00 00 00 @@ -85566,7 +83478,7 @@ a6 00 00 00 -3c +40 07 00 00 @@ -85574,8 +83486,8 @@ a6 00 04 00 -8d -01 +9b +04 00 00 00 @@ -85590,7 +83502,7 @@ a6 00 00 00 -35 +3b 07 00 00 @@ -85598,8 +83510,8 @@ a6 00 04 00 -8c -01 +50 +05 00 00 00 @@ -85614,7 +83526,7 @@ a6 00 00 00 -2e +34 07 00 00 @@ -85622,8 +83534,8 @@ a6 00 04 00 -88 -01 +7f +04 00 00 00 @@ -85638,7 +83550,7 @@ a6 00 00 00 -27 +2d 07 00 00 @@ -85646,8 +83558,8 @@ a6 00 04 00 -83 -01 +79 +04 00 00 00 @@ -85662,7 +83574,7 @@ a6 00 00 00 -20 +26 07 00 00 @@ -85670,8 +83582,8 @@ a6 00 04 00 -7e -01 +73 +04 00 00 00 @@ -85686,7 +83598,7 @@ a6 00 00 00 -19 +1f 07 00 00 @@ -85694,8 +83606,8 @@ a6 00 04 00 -5c -01 +6e +04 00 00 00 @@ -85710,7 +83622,7 @@ a6 00 00 00 -12 +17 07 00 00 @@ -85718,8 +83630,8 @@ a6 00 04 00 -5b -01 +6e +04 00 00 00 @@ -85734,7 +83646,7 @@ a6 00 00 00 -0b +0f 07 00 00 @@ -85742,23 +83654,23 @@ a6 00 04 00 -57 -01 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 +67 04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +07 07 00 00 @@ -85766,8 +83678,8 @@ a6 00 04 00 -52 -01 +62 +04 00 00 00 @@ -85782,7 +83694,7 @@ a6 00 00 00 -fd +ff 06 00 00 @@ -85790,8 +83702,8 @@ fd 00 04 00 -4d -01 +5d +04 00 00 00 @@ -85806,7 +83718,7 @@ fd 00 00 00 -f9 +f7 06 00 00 @@ -85814,33 +83726,9 @@ f9 00 04 00 -60 -01 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -f5 -06 -00 -00 -00 -00 +55 04 00 -16 -01 -00 00 00 00 @@ -85862,8 +83750,8 @@ f0 00 04 00 -90 -01 +50 +04 00 00 00 @@ -85886,32 +83774,9 @@ e9 00 04 00 -0c -01 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -e2 -06 -00 -00 -00 -00 +50 04 00 -09 -01 00 00 00 @@ -85925,248 +83790,7 @@ e2 00 00 00 -00 -db -06 -00 -00 -00 -00 -04 -00 -f4 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -d5 -06 -00 -00 -00 -00 -04 -00 -f4 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -cf -06 -00 -00 -00 -00 -04 -00 -eb -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -c8 -06 -00 -00 -00 -00 -04 -00 -eb -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -c2 -06 -00 -00 -00 -00 -04 -00 -e7 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -bb -06 -00 -00 -00 -00 -04 -00 -e2 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -b4 -06 -00 -00 -00 -00 -04 -00 -da -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -ad -06 -00 -00 -00 -00 -04 -00 -d5 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -a7 -06 -00 -00 -00 -00 -04 -00 -d0 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -a0 -06 -00 -00 -00 -00 -04 -00 -d0 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -9a +e3 06 00 00 @@ -86174,6 +83798,7 @@ d0 00 11 00 +30 00 00 00 @@ -86189,14 +83814,209 @@ d0 00 00 00 +dc +06 +00 +00 +00 +00 +04 +00 +46 +04 00 00 00 00 00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +d5 +06 +00 +00 +00 +00 +04 +00 +2e +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +ce +06 +00 +00 +00 +00 +04 +00 +2d +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +c7 +06 +00 +00 +00 +00 +04 +00 +29 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +c0 +06 +00 +00 +00 +00 +04 +00 +24 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +b9 +06 +00 +00 +00 +00 +04 +00 +20 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +b2 +06 +00 +00 +00 +00 +04 +00 +02 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +ab +06 +00 +00 +00 +00 +04 +00 +01 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +a4 +06 +00 +00 +00 +00 +04 +00 +fd 03 00 -11 00 00 00 @@ -86210,11 +84030,7 @@ d0 00 00 00 -00 -00 -00 -00 -93 +9d 06 00 00 @@ -86222,7 +84038,8 @@ d0 00 04 00 -d0 +f8 +03 00 00 00 @@ -86237,8 +84054,7 @@ d0 00 00 00 -00 -8d +96 06 00 00 @@ -86246,7 +84062,8 @@ d0 00 04 00 -cb +f4 +03 00 00 00 @@ -86261,8 +84078,7 @@ cb 00 00 00 -00 -87 +91 06 00 00 @@ -86270,31 +84086,9 @@ cb 00 04 00 -84 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -80 -06 -00 -00 -00 -00 +02 04 00 -84 00 00 00 @@ -86308,69 +84102,67 @@ cb 00 00 00 -00 -00 -7a -06 -00 -00 -00 -00 -04 -00 -80 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -73 -06 -00 -00 -00 -00 -04 -00 -80 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -6c -06 -00 -00 -00 -00 -04 -00 79 +06 00 00 00 00 +04 +00 +ae +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +74 +06 +00 +00 +00 +00 +04 +00 +30 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +6d +06 +00 +00 +00 +00 +04 +00 +9a +03 +00 +00 +00 00 00 00 @@ -86390,7 +84182,8 @@ cb 00 04 00 -78 +94 +03 00 00 00 @@ -86405,18 +84198,16 @@ cb 00 00 00 -00 -58 +5f 06 00 00 00 00 -12 -00 -68 04 00 +8b +03 00 00 00 @@ -86430,16 +84221,137 @@ cb 00 00 00 -4e +00 +57 06 00 00 00 00 -12 +04 +00 +8b +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +50 +06 +00 +00 +00 +00 +04 +00 +87 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +48 +06 +00 +00 +00 +00 +04 +00 +82 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +40 +06 +00 +00 +00 +00 +04 +00 +7d +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +38 +06 +00 +00 +00 +00 +04 +00 +75 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +31 +06 +00 +00 +00 +00 +04 00 70 -04 +03 00 00 00 @@ -86454,103 +84366,7 @@ cb 00 00 00 -44 -06 -00 -00 -00 -00 -12 -00 -78 -04 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -3e -06 -00 -00 -00 -00 -12 -00 -80 -04 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -37 -06 -00 -00 -00 -00 -12 -00 -88 -04 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -2f -06 -00 -00 -00 -00 -12 -00 -90 -04 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -29 +2a 06 00 00 @@ -86558,7 +84374,8 @@ cb 00 04 00 -04 +70 +03 00 00 00 @@ -86573,8 +84390,7 @@ cb 00 00 00 -00 -22 +23 06 00 00 @@ -86582,8 +84398,8 @@ cb 00 04 00 -04 -00 +66 +03 00 00 00 @@ -86606,8 +84422,8 @@ cb 00 04 00 -00 -00 +4e +03 00 00 00 @@ -86630,6 +84446,2190 @@ cb 00 04 00 +4d +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +0e +06 +00 +00 +00 +00 +04 +00 +49 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +07 +06 +00 +00 +00 +00 +04 +00 +44 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +06 +00 +00 +00 +00 +04 +00 +40 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +f9 +05 +00 +00 +00 +00 +04 +00 +22 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +f2 +05 +00 +00 +00 +00 +04 +00 +21 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +eb +05 +00 +00 +00 +00 +04 +00 +1d +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +e4 +05 +00 +00 +00 +00 +04 +00 +18 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +dd +05 +00 +00 +00 +00 +04 +00 +14 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +d8 +05 +00 +00 +00 +00 +04 +00 +22 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +c0 +05 +00 +00 +00 +00 +04 +00 +ce +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +bb +05 +00 +00 +00 +00 +04 +00 +50 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +b4 +05 +00 +00 +00 +00 +04 +00 +ba +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +ad +05 +00 +00 +00 +00 +04 +00 +b4 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +a6 +05 +00 +00 +00 +00 +04 +00 +ab +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +9e +05 +00 +00 +00 +00 +04 +00 +ab +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +97 +05 +00 +00 +00 +00 +04 +00 +a7 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +8f +05 +00 +00 +00 +00 +04 +00 +a2 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +87 +05 +00 +00 +00 +00 +04 +00 +9d +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +7f +05 +00 +00 +00 +00 +04 +00 +95 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +78 +05 +00 +00 +00 +00 +04 +00 +90 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +71 +05 +00 +00 +00 +00 +04 +00 +90 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +6a +05 +00 +00 +00 +00 +04 +00 +86 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +63 +05 +00 +00 +00 +00 +04 +00 +6c +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +5c +05 +00 +00 +00 +00 +04 +00 +6b +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +55 +05 +00 +00 +00 +00 +04 +00 +67 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +4e +05 +00 +00 +00 +00 +04 +00 +62 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +47 +05 +00 +00 +00 +00 +04 +00 +5e +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +40 +05 +00 +00 +00 +00 +04 +00 +3e +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +39 +05 +00 +00 +00 +00 +04 +00 +3d +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +32 +05 +00 +00 +00 +00 +04 +00 +39 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +2b +05 +00 +00 +00 +00 +04 +00 +34 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +24 +05 +00 +00 +00 +00 +04 +00 +30 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +1f +05 +00 +00 +00 +00 +04 +00 +40 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +07 +05 +00 +00 +00 +00 +04 +00 +ea +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +02 +05 +00 +00 +00 +00 +04 +00 +70 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +f4 +04 +00 +00 +00 +00 +04 +00 +da +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +ed +04 +00 +00 +00 +00 +04 +00 +d4 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +e6 +04 +00 +00 +00 +00 +04 +00 +cb +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +df +04 +00 +00 +00 +00 +04 +00 +cb +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +d8 +04 +00 +00 +00 +00 +04 +00 +c7 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +d1 +04 +00 +00 +00 +00 +04 +00 +c2 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +ca +04 +00 +00 +00 +00 +04 +00 +bd +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +c3 +04 +00 +00 +00 +00 +04 +00 +b5 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +bc +04 +00 +00 +00 +00 +04 +00 +b0 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +b5 +04 +00 +00 +00 +00 +04 +00 +b0 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +ae +04 +00 +00 +00 +00 +04 +00 +a6 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +99 +04 +00 +00 +00 +00 +04 +00 +8d +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +92 +04 +00 +00 +00 +00 +04 +00 +8c +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +8b +04 +00 +00 +00 +00 +04 +00 +88 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +84 +04 +00 +00 +00 +00 +04 +00 +83 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +7d +04 +00 +00 +00 +00 +04 +00 +7e +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +66 +04 +00 +00 +00 +00 +04 +00 +5c +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +5f +04 +00 +00 +00 +00 +04 +00 +5b +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +58 +04 +00 +00 +00 +00 +04 +00 +57 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +51 +04 +00 +00 +00 +00 +04 +00 +52 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +4a +04 +00 +00 +00 +00 +04 +00 +4d +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +31 +04 +00 +00 +00 +00 +04 +00 +60 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +25 +04 +00 +00 +00 +00 +04 +00 +16 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +20 +04 +00 +00 +00 +00 +04 +00 +90 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +ff +03 +00 +00 +00 +00 +04 +00 +0c +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +f8 +03 +00 +00 +00 +00 +04 +00 +09 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +f1 +03 +00 +00 +00 +00 +04 +00 +f4 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +eb +03 +00 +00 +00 +00 +04 +00 +f4 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +d8 +03 +00 +00 +00 +00 +04 +00 +eb +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +d1 +03 +00 +00 +00 +00 +04 +00 +eb +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +cb +03 +00 +00 +00 +00 +04 +00 +e7 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +c4 +03 +00 +00 +00 +00 +04 +00 +e2 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +bd +03 +00 +00 +00 +00 +04 +00 +da +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +b6 +03 +00 +00 +00 +00 +04 +00 +d5 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +b0 +03 +00 +00 +00 +00 +04 +00 +d0 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +a9 +03 +00 +00 +00 +00 +04 +00 +d0 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +a3 +03 +00 +00 +00 +00 +11 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +00 +11 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +9c +03 +00 +00 +00 +00 +04 +00 +d0 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +96 +03 +00 +00 +00 +00 +04 +00 +cb +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +5b +03 +00 +00 +00 +00 +04 +00 +84 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +54 +03 +00 +00 +00 +00 +04 +00 +84 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +4e +03 +00 +00 +00 +00 +04 +00 +80 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +47 +03 +00 +00 +00 +00 +04 +00 +80 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +40 +03 +00 +00 +00 +00 +04 +00 +79 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +3a +03 +00 +00 +00 +00 +04 +00 +78 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +2c +03 +00 +00 +00 +00 +12 +00 +68 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +03 +00 +00 +00 +00 +12 +00 +70 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +f9 +02 +00 +00 +00 +00 +12 +00 +78 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +f3 +02 +00 +00 +00 +00 +12 +00 +80 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +ec +02 +00 +00 +00 +00 +12 +00 +88 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +e4 +02 +00 +00 +00 +00 +12 +00 +90 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +cd +02 +00 +00 +00 +00 +04 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +c6 +02 +00 +00 +00 +00 +04 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +c0 +02 +00 +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +b9 +02 +00 +00 +00 +00 +04 +00 00 00 00 @@ -86694,8 +86694,8 @@ cb 00 00 00 -0f -06 +b3 +02 00 00 00 @@ -86718,8 +86718,8 @@ cb 00 00 00 -09 -06 +ad +02 00 00 00 @@ -86742,8 +86742,8 @@ cb 00 00 00 -03 -06 +a7 +02 00 00 00 @@ -86766,8 +86766,8 @@ cb 00 00 00 -fd -05 +a1 +02 00 00 00 @@ -86790,8 +86790,8 @@ fd 00 00 00 -f7 -05 +9b +02 00 00 00 @@ -86814,8 +86814,8 @@ f7 00 00 00 -f1 -05 +95 +02 00 00 00 @@ -86838,8 +86838,8 @@ f1 00 00 00 -eb -05 +8f +02 00 00 00 @@ -86862,8 +86862,8 @@ eb 00 00 00 -e5 -05 +89 +02 00 00 00 @@ -86886,8 +86886,8 @@ e5 00 00 00 -df -05 +83 +02 00 00 00 @@ -86910,8 +86910,8 @@ df 00 00 00 -da -05 +7e +02 00 00 00 @@ -86934,8 +86934,8 @@ da 00 00 00 -d5 -05 +79 +02 00 00 00 @@ -86958,8 +86958,8 @@ d5 00 00 00 -d0 -05 +74 +02 00 00 00 @@ -86982,8 +86982,8 @@ d0 00 00 00 -cb -05 +6f +02 00 00 00 @@ -87006,8 +87006,8 @@ cb 00 00 00 -c6 -05 +6a +02 00 00 00 @@ -87030,8 +87030,8 @@ c6 00 00 00 -c1 -05 +65 +02 00 00 00 @@ -87054,8 +87054,8 @@ c1 00 00 00 -bc -05 +60 +02 00 00 00 @@ -87078,8 +87078,8 @@ bc 00 00 00 -b7 -05 +5b +02 00 00 00 @@ -87102,8 +87102,8 @@ b7 00 00 00 -b2 -05 +56 +02 00 00 00 @@ -87150,8 +87150,8 @@ b2 00 00 00 -ad -05 +51 +02 00 00 00 @@ -87222,8 +87222,8 @@ ad 00 00 00 -a5 -05 +49 +02 00 00 00 @@ -87246,8 +87246,8 @@ a5 00 00 00 -97 -05 +3b +02 00 00 00 @@ -87294,8 +87294,8 @@ a5 00 00 00 -89 -05 +2d +02 00 00 00 @@ -87342,8 +87342,8 @@ a5 00 00 00 -79 -05 +1d +02 00 00 00 @@ -87438,6 +87438,54 @@ a5 00 00 00 +d3 +02 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +0d +03 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 2c 00 00 @@ -87462,6 +87510,54 @@ a5 00 00 00 +61 +03 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +84 +03 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 40 00 00 @@ -87486,6 +87582,150 @@ d6 00 00 00 +de +03 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +06 +04 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +29 +04 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +35 +04 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +6d +04 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +a0 +04 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 57 00 00 @@ -87510,6 +87750,54 @@ d6 00 00 00 +fb +04 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +0c +05 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 6e 00 00 @@ -87534,6 +87822,30 @@ d6 00 00 00 +c5 +05 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 85 00 00 @@ -87558,6 +87870,30 @@ d6 00 00 00 +7e +06 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 9c 00 00 @@ -87582,6 +87918,78 @@ d6 00 00 00 +e1 +07 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +08 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +18 +08 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 be 00 00 @@ -87630,6 +88038,30 @@ d6 00 00 00 +a5 +08 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 ed 00 00 @@ -87678,6 +88110,30 @@ fe 00 00 00 +9f +09 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 12 01 00 @@ -87702,6 +88158,390 @@ fe 00 00 00 +4d +0b +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +ee +0b +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +05 +0c +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +3e +0c +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +57 +0c +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +75 +0c +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +ab +0c +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +cb +0c +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +25 +0d +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +48 +0d +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +66 +0d +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +84 +0d +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +9e +0d +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +bf +0d +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +e7 +0d +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +1c +0e +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 23 01 00 @@ -87798,6 +88638,30 @@ e0 00 00 00 +73 +0f +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 70 01 00 @@ -87822,6 +88686,30 @@ e0 00 00 00 +b1 +0f +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 81 01 00 @@ -87870,6 +88758,30 @@ c0 00 00 00 +9e +10 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 aa 01 00 @@ -87894,6 +88806,54 @@ aa 00 00 00 +31 +12 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +79 +12 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 c1 01 00 @@ -87918,6 +88878,102 @@ b0 00 00 00 +a1 +13 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +b9 +13 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +2a +14 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +58 +14 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 d7 01 00 @@ -87990,6 +89046,54 @@ a0 00 00 00 +31 +17 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +49 +17 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 18 02 00 @@ -88014,8 +89118,8 @@ f0 00 00 00 -1d -02 +46 +18 00 00 10 @@ -88038,8 +89142,8 @@ f0 00 00 00 -2e -02 +aa +18 00 00 10 @@ -88062,968 +89166,8 @@ f0 00 00 00 -4d -02 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -70 -02 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -82 -02 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -8f -02 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -a9 -02 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -b1 -02 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -c6 -02 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -d6 -02 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -e4 -02 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -eb -02 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -fe -02 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -11 -03 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -24 -03 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -34 -03 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -48 -03 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -5e -03 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -6f -03 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -7a -03 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -8f -03 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -9e -03 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -af -03 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -c2 -03 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -d0 -03 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -e6 -03 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -f6 -03 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -02 -04 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -15 -04 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -23 -04 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -31 -04 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -3b -04 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -4c -04 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -5c -04 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -6b -04 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -80 -04 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -92 -04 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -a1 -04 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -b0 -04 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -c6 -04 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -d4 -04 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -ec -04 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -01 -05 +fd +18 00 00 10 @@ -89047,7 +89191,7 @@ ec 00 00 17 -05 +19 00 00 10 @@ -89070,8 +89214,8 @@ ec 00 00 00 -1e -05 +1f +19 00 00 10 @@ -89095,7 +89239,7 @@ ec 00 00 26 -05 +19 00 00 10 @@ -89118,152 +89262,8 @@ ec 00 00 00 -37 -05 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -46 -05 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -4d -05 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -55 -05 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -5d -05 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -64 -05 -00 -00 -10 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -6b -05 +62 +19 00 00 10 diff --git a/modules/dbgfmts/dwarf2/tests/passwin64/dwarfwin64_testhd.errwarn b/modules/dbgfmts/dwarf2/tests/passwin64/dwarfwin64_testhd.errwarn index c00bbe1e..d383da2a 100644 --- a/modules/dbgfmts/dwarf2/tests/passwin64/dwarfwin64_testhd.errwarn +++ b/modules/dbgfmts/dwarf2/tests/passwin64/dwarfwin64_testhd.errwarn @@ -4,6 +4,8 @@ -:10: warning: unrecognized section attribute: `M' -:10: warning: unrecognized section attribute: `S' -:10: warning: Unrecognized qualifier `progbits' +-:24: warning: directive `.type' not recognized +-:152: warning: directive `.size' not recognized -:153: warning: Unrecognized qualifier `progbits' -:190: warning: Unrecognized qualifier `progbits' -:232: warning: Unrecognized qualifier `progbits' diff --git a/modules/dbgfmts/null/null-dbgfmt.c b/modules/dbgfmts/null/null-dbgfmt.c index 9ddf776d..44766934 100644 --- a/modules/dbgfmts/null/null-dbgfmt.c +++ b/modules/dbgfmts/null/null-dbgfmt.c @@ -48,13 +48,6 @@ null_dbgfmt_destroy(/*@only@*/ yasm_dbgfmt *dbgfmt) yasm_xfree(dbgfmt); } -static int -null_dbgfmt_directive(yasm_object *object, const char *name, - yasm_valparamhead *valparams, unsigned long line) -{ - return 1; -} - static void null_dbgfmt_generate(yasm_object *object, yasm_linemap *linemap, yasm_errwarns *errwarns) @@ -66,8 +59,8 @@ null_dbgfmt_generate(yasm_object *object, yasm_linemap *linemap, yasm_dbgfmt_module yasm_null_LTX_dbgfmt = { "No debugging info", "null", + NULL, /* no directives */ null_dbgfmt_create, null_dbgfmt_destroy, - null_dbgfmt_directive, null_dbgfmt_generate }; diff --git a/modules/dbgfmts/stabs/stabs-dbgfmt.c b/modules/dbgfmts/stabs/stabs-dbgfmt.c index 5bf6b8ad..1942d4b1 100644 --- a/modules/dbgfmts/stabs/stabs-dbgfmt.c +++ b/modules/dbgfmts/stabs/stabs-dbgfmt.c @@ -499,19 +499,12 @@ stabs_bc_str_calc_len(yasm_bytecode *bc, yasm_bc_add_span_func add_span, return 0; } -static int -stabs_dbgfmt_directive(yasm_object *object, const char *name, - yasm_valparamhead *valparams, unsigned long line) -{ - return 1; -} - /* Define dbgfmt structure -- see dbgfmt.h for details */ yasm_dbgfmt_module yasm_stabs_LTX_dbgfmt = { "Stabs debugging format", "stabs", + NULL, /* no directives */ stabs_dbgfmt_create, stabs_dbgfmt_destroy, - stabs_dbgfmt_directive, stabs_dbgfmt_generate }; diff --git a/modules/objfmts/bin/bin-objfmt.c b/modules/objfmts/bin/bin-objfmt.c index b98ac63a..b3b12628 100644 --- a/modules/objfmts/bin/bin-objfmt.c +++ b/modules/objfmts/bin/bin-objfmt.c @@ -85,6 +85,7 @@ bin_objfmt_align_section(yasm_section *sect, yasm_section *prevsect, typedef struct bin_objfmt_output_info { yasm_object *object; + yasm_errwarns *errwarns; /*@dependent@*/ FILE *f; /*@only@*/ unsigned char *buf; /*@observer@*/ const yasm_section *sect; @@ -252,6 +253,29 @@ bin_objfmt_output_bytecode(yasm_bytecode *bc, /*@null@*/ void *d) return 0; } +static int +bin_objfmt_check_sym(yasm_symrec *sym, /*@null@*/ void *d) +{ + /*@null@*/ bin_objfmt_output_info *info = (bin_objfmt_output_info *)d; + yasm_sym_vis vis = yasm_symrec_get_visibility(sym); + assert(info != NULL); + + if (vis & YASM_SYM_EXTERN) { + yasm_warn_set(YASM_WARN_GENERAL, + N_("binary object format does not support extern variables")); + yasm_errwarn_propagate(info->errwarns, yasm_symrec_get_decl_line(sym)); + } else if (vis & YASM_SYM_GLOBAL) { + yasm_warn_set(YASM_WARN_GENERAL, + N_("binary object format does not support global variables")); + yasm_errwarn_propagate(info->errwarns, yasm_symrec_get_decl_line(sym)); + } else if (vis & YASM_SYM_COMMON) { + yasm_error_set(YASM_ERROR_TYPE, + N_("binary object format does not support common variables")); + yasm_errwarn_propagate(info->errwarns, yasm_symrec_get_decl_line(sym)); + } + return 0; +} + static void bin_objfmt_output(yasm_object *object, FILE *f, /*@unused@*/ int all_syms, yasm_errwarns *errwarns) @@ -266,9 +290,13 @@ bin_objfmt_output(yasm_object *object, FILE *f, /*@unused@*/ int all_syms, bin_objfmt_output_info info; info.object = object; + info.errwarns = errwarns; info.f = f; info.buf = yasm_xmalloc(REGULAR_OUTBUF_SIZE); + /* Check symbol table */ + yasm_symtab_traverse(object->symtab, &info, bin_objfmt_check_sym); + text = yasm_object_find_general(object, ".text"); data = yasm_object_find_general(object, ".data"); bss = yasm_object_find_general(object, ".bss"); @@ -467,96 +495,45 @@ bin_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, return NULL; } -static yasm_symrec * -bin_objfmt_extern_declare(yasm_object *object, const char *name, - /*@unused@*/ /*@null@*/ - yasm_valparamhead *objext_valparams, - unsigned long line) -{ - yasm_symrec *sym; - - yasm_warn_set(YASM_WARN_GENERAL, - N_("binary object format does not support extern variables")); - - sym = yasm_symtab_declare(object->symtab, name, YASM_SYM_EXTERN, line); - return sym; -} - -static yasm_symrec * -bin_objfmt_global_declare(yasm_object *object, const char *name, - /*@unused@*/ /*@null@*/ - yasm_valparamhead *objext_valparams, - unsigned long line) -{ - yasm_symrec *sym; - - yasm_warn_set(YASM_WARN_GENERAL, - N_("binary object format does not support global variables")); - - sym = yasm_symtab_declare(object->symtab, name, YASM_SYM_GLOBAL, line); - return sym; -} - -static yasm_symrec * -bin_objfmt_common_declare(yasm_object *object, const char *name, - /*@only@*/ yasm_expr *size, /*@unused@*/ /*@null@*/ - yasm_valparamhead *objext_valparams, - unsigned long line) -{ - yasm_symrec *sym; - - yasm_expr_destroy(size); - yasm_error_set(YASM_ERROR_TYPE, - N_("binary object format does not support common variables")); - - sym = yasm_symtab_declare(object->symtab, name, YASM_SYM_COMMON, line); - return sym; -} - -static int -bin_objfmt_directive(yasm_object *object, const char *name, - /*@null@*/ yasm_valparamhead *valparams, - /*@unused@*/ /*@null@*/ - yasm_valparamhead *objext_valparams, unsigned long line) +static void +bin_objfmt_dir_org(yasm_object *object, + /*@null@*/ yasm_valparamhead *valparams, + /*@unused@*/ /*@null@*/ + yasm_valparamhead *objext_valparams, unsigned long line) { yasm_section *sect; yasm_valparam *vp; - if (yasm__strcasecmp(name, "org") == 0) { - /*@null@*/ yasm_expr *start = NULL; + /*@null@*/ yasm_expr *start = NULL; - if (!valparams) { - yasm_error_set(YASM_ERROR_SYNTAX, N_("[%s] requires an argument"), - "ORG"); - return 0; - } + if (!valparams) { + yasm_error_set(YASM_ERROR_SYNTAX, N_("[%s] requires an argument"), + "ORG"); + return; + } - /* ORG takes just a simple integer as param */ - vp = yasm_vps_first(valparams); - if (vp->val) - start = yasm_expr_create_ident(yasm_expr_sym(yasm_symtab_use( - object->symtab, vp->val, line)), line); - else if (vp->param) { - start = vp->param; - vp->param = NULL; /* Don't let valparams delete it */ - } + /* ORG takes just a simple integer as param */ + vp = yasm_vps_first(valparams); + if (vp->val) + start = yasm_expr_create_ident(yasm_expr_sym(yasm_symtab_use( + object->symtab, vp->val, line)), line); + else if (vp->param) { + start = vp->param; + vp->param = NULL; /* Don't let valparams delete it */ + } - if (!start) { - yasm_error_set(YASM_ERROR_SYNTAX, - N_("argument to ORG must be expression")); - return 0; - } + if (!start) { + yasm_error_set(YASM_ERROR_SYNTAX, + N_("argument to ORG must be expression")); + return; + } - /* ORG changes the start of the .text section */ - sect = yasm_object_find_general(object, ".text"); - if (!sect) - yasm_internal_error( - N_("bin objfmt: .text section does not exist before ORG is called?")); - yasm_section_set_start(sect, start, line); - - return 0; /* directive recognized */ - } else - return 1; /* directive unrecognized */ + /* ORG changes the start of the .text section */ + sect = yasm_object_find_general(object, ".text"); + if (!sect) + yasm_internal_error( + N_("bin objfmt: .text section does not exist before ORG is called?")); + yasm_section_set_start(sect, start, line); } @@ -566,6 +543,11 @@ static const char *bin_objfmt_dbgfmt_keywords[] = { NULL }; +static const yasm_directive bin_objfmt_directives[] = { + { "org", "nasm", bin_objfmt_dir_org, YASM_DIR_ARG_REQUIRED }, + { NULL, NULL, NULL, 0 } +}; + /* Define objfmt structure -- see objfmt.h for details */ yasm_objfmt_module yasm_bin_LTX_objfmt = { "Flat format binary", @@ -574,13 +556,10 @@ yasm_objfmt_module yasm_bin_LTX_objfmt = { 16, bin_objfmt_dbgfmt_keywords, "null", + bin_objfmt_directives, bin_objfmt_create, bin_objfmt_output, bin_objfmt_destroy, bin_objfmt_add_default_section, - bin_objfmt_section_switch, - bin_objfmt_extern_declare, - bin_objfmt_global_declare, - bin_objfmt_common_declare, - bin_objfmt_directive + bin_objfmt_section_switch }; diff --git a/modules/objfmts/coff/coff-objfmt.c b/modules/objfmts/coff/coff-objfmt.c index feb790af..c93e8eaf 100644 --- a/modules/objfmts/coff/coff-objfmt.c +++ b/modules/objfmts/coff/coff-objfmt.c @@ -168,8 +168,6 @@ typedef struct coff_symrec_data { unsigned long index; /* assigned COFF symbol table index */ coff_symrec_sclass sclass; /* storage class */ - /*@owned@*/ /*@null@*/ yasm_expr *size; /* size if COMMON declaration */ - int numaux; /* number of auxiliary entries */ coff_symtab_auxtype auxtype; /* type of aux entries */ coff_symtab_auxent aux[1]; /* actually may be any size (including 0) */ @@ -230,8 +228,7 @@ yasm_objfmt_module yasm_win64_LTX_objfmt; static /*@dependent@*/ coff_symrec_data * coff_objfmt_sym_set_data(yasm_symrec *sym, coff_symrec_sclass sclass, - /*@only@*/ /*@null@*/ yasm_expr *size, int numaux, - coff_symtab_auxtype auxtype) + int numaux, coff_symtab_auxtype auxtype) { coff_symrec_data *sym_data; @@ -239,7 +236,6 @@ coff_objfmt_sym_set_data(yasm_symrec *sym, coff_symrec_sclass sclass, (numaux-1)*sizeof(coff_symtab_auxent)); sym_data->index = 0; sym_data->sclass = sclass; - sym_data->size = size; sym_data->numaux = numaux; sym_data->auxtype = auxtype; @@ -266,7 +262,7 @@ coff_common_create(yasm_object *object) filesym = yasm_symtab_define_special(object->symtab, ".file", YASM_SYM_GLOBAL); objfmt_coff->filesym_data = - coff_objfmt_sym_set_data(filesym, COFF_SCL_FILE, NULL, 1, + coff_objfmt_sym_set_data(filesym, COFF_SCL_FILE, 1, COFF_SYMTAB_AUX_FILE); /* Filename is set in coff_objfmt_output */ objfmt_coff->filesym_data->aux[0].fname = NULL; @@ -376,8 +372,7 @@ coff_objfmt_init_new_section(yasm_object *object, yasm_section *sect, sym = yasm_symtab_define_label(object->symtab, sectname, yasm_section_bcs_first(sect), 1, line); yasm_symrec_declare(sym, YASM_SYM_GLOBAL, line); - coff_objfmt_sym_set_data(sym, COFF_SCL_STAT, NULL, 1, - COFF_SYMTAB_AUX_SECT); + coff_objfmt_sym_set_data(sym, COFF_SCL_STAT, 1, COFF_SYMTAB_AUX_SECT); data->sym = sym; return data; } @@ -506,11 +501,14 @@ coff_objfmt_output_value(yasm_value *value, unsigned char *buf, /* In standard COFF, COMMON symbols have their length added in */ if (!objfmt_coff->win32) { /*@dependent@*/ /*@null@*/ coff_symrec_data *csymd; + /*@dependent@*/ /*@null@*/ yasm_expr **csize_expr; /*@dependent@*/ /*@null@*/ yasm_intnum *common_size; csymd = yasm_symrec_get_data(sym, &coff_symrec_data_cb); assert(csymd != NULL); - common_size = yasm_expr_get_intnum(&csymd->size, 1); + csize_expr = yasm_symrec_get_common_size(sym); + assert(csize_expr != NULL); + common_size = yasm_expr_get_intnum(csize_expr, 1); if (!common_size) { yasm_error_set(YASM_ERROR_TOO_COMPLEX, N_("coff: common size too complex")); @@ -942,13 +940,20 @@ static int coff_objfmt_count_sym(yasm_symrec *sym, /*@null@*/ void *d) { /*@null@*/ coff_objfmt_output_info *info = (coff_objfmt_output_info *)d; + yasm_sym_vis vis = yasm_symrec_get_visibility(sym); + coff_symrec_data *sym_data; + assert(info != NULL); - if (info->all_syms || yasm_symrec_get_visibility(sym) != YASM_SYM_LOCAL) { + + sym_data = yasm_symrec_get_data(sym, &coff_symrec_data_cb); + if ((vis & (YASM_SYM_EXTERN|YASM_SYM_GLOBAL|YASM_SYM_COMMON)) && !sym_data) + sym_data = coff_objfmt_sym_set_data(sym, COFF_SCL_EXT, 0, + COFF_SYMTAB_AUX_NONE); + + if (info->all_syms || vis != YASM_SYM_LOCAL) { /* Save index in symrec data */ - coff_symrec_data *sym_data = - yasm_symrec_get_data(sym, &coff_symrec_data_cb); if (!sym_data) { - sym_data = coff_objfmt_sym_set_data(sym, COFF_SCL_STAT, NULL, 0, + sym_data = coff_objfmt_sym_set_data(sym, COFF_SCL_STAT, 0, COFF_SYMTAB_AUX_NONE); } sym_data->index = info->indx; @@ -1042,11 +1047,15 @@ coff_objfmt_output_sym(yasm_symrec *sym, /*@null@*/ void *d) scnum = 0xffff; /* -1 = absolute symbol */ } else { if (vis & YASM_SYM_COMMON) { - intn = yasm_expr_get_intnum(&csymd->size, 1); + /*@dependent@*/ /*@null@*/ yasm_expr **csize_expr; + csize_expr = yasm_symrec_get_common_size(sym); + assert(csize_expr != NULL); + intn = yasm_expr_get_intnum(csize_expr, 1); if (!intn) { yasm_error_set(YASM_ERROR_NOT_CONSTANT, N_("COMMON data size not an integer expression")); - yasm_errwarn_propagate(info->errwarns, csymd->size->line); + yasm_errwarn_propagate(info->errwarns, + (*csize_expr)->line); } else value = yasm_intnum_get_uint(intn); scnum = 0; @@ -1630,55 +1639,9 @@ coff_section_data_print(void *data, FILE *f, int indent_level) fprintf(f, "%*srelocs:\n", indent_level, ""); } -static yasm_symrec * -coff_objfmt_extern_declare(yasm_object *object, const char *name, /*@unused@*/ - /*@null@*/ yasm_valparamhead *objext_valparams, - unsigned long line) -{ - yasm_symrec *sym; - - sym = yasm_symtab_declare(object->symtab, name, YASM_SYM_EXTERN, line); - coff_objfmt_sym_set_data(sym, COFF_SCL_EXT, NULL, 0, - COFF_SYMTAB_AUX_NONE); - - return sym; -} - -static yasm_symrec * -coff_objfmt_global_declare(yasm_object *object, const char *name, /*@unused@*/ - /*@null@*/ yasm_valparamhead *objext_valparams, - unsigned long line) -{ - yasm_symrec *sym; - - sym = yasm_symtab_declare(object->symtab, name, YASM_SYM_GLOBAL, line); - coff_objfmt_sym_set_data(sym, COFF_SCL_EXT, NULL, 0, - COFF_SYMTAB_AUX_NONE); - - return sym; -} - -static yasm_symrec * -coff_objfmt_common_declare(yasm_object *object, const char *name, - /*@only@*/ yasm_expr *size, /*@unused@*/ /*@null@*/ - yasm_valparamhead *objext_valparams, - unsigned long line) -{ - yasm_symrec *sym; - - sym = yasm_symtab_declare(object->symtab, name, YASM_SYM_COMMON, line); - coff_objfmt_sym_set_data(sym, COFF_SCL_EXT, size, 0, - COFF_SYMTAB_AUX_NONE); - - return sym; -} - static void coff_symrec_data_destroy(void *data) { - coff_symrec_data *csymd = (coff_symrec_data *)data; - if (csymd->size) - yasm_expr_destroy(csymd->size); yasm_xfree(data); } @@ -1689,17 +1652,11 @@ coff_symrec_data_print(void *data, FILE *f, int indent_level) fprintf(f, "%*ssymtab index=%lu\n", indent_level, "", csd->index); fprintf(f, "%*ssclass=%d\n", indent_level, "", csd->sclass); - fprintf(f, "%*ssize=", indent_level, ""); - if (csd->size) - yasm_expr_print(csd->size, f); - else - fprintf(f, "nil"); - fprintf(f, "\n"); } static void dir_export(yasm_object *object, yasm_valparamhead *valparams, - unsigned long line) + yasm_valparamhead *objext_valparams, unsigned long line) { yasm_valparam *vp; int isnew; @@ -1740,7 +1697,7 @@ dir_export(yasm_object *object, yasm_valparamhead *valparams, static void dir_ident(yasm_object *object, yasm_valparamhead *valparams, - unsigned long line) + yasm_valparamhead *objext_valparams, unsigned long line) { yasm_objfmt_coff *objfmt_coff = (yasm_objfmt_coff *)object->objfmt; yasm_valparamhead sect_vps; @@ -1749,7 +1706,13 @@ dir_ident(yasm_object *object, yasm_valparamhead *valparams, const char *sectname; yasm_valparam *vp, *vp2; + /* Accept, but do nothing with empty ident */ + if (!valparams) + return; + vp = yasm_vps_first(valparams); + if (!vp) + return; if (objfmt_coff->win32) { /* Put ident data into .comment section for COFF, or .rdata$zzz @@ -1788,59 +1751,9 @@ dir_ident(yasm_object *object, yasm_valparamhead *valparams, yasm_bc_create_data(&dvs, 1, 1, object->arch, line)); } -static int -coff_objfmt_directive(yasm_object *object, const char *name, - /*@null@*/ yasm_valparamhead *valparams, - /*@unused@*/ /*@null@*/ - yasm_valparamhead *objext_valparams, - unsigned long line) -{ - if (yasm__strcasecmp(name, "IDENT") == 0) { - if (!valparams) { - yasm_error_set(YASM_ERROR_SYNTAX, N_("[%s] requires an argument"), - "IDENT"); - return 0; - } - dir_ident(object, valparams, line); - return 0; - } - return 1; -} - -static int -win32_objfmt_directive(yasm_object *object, const char *name, - /*@null@*/ yasm_valparamhead *valparams, - /*@unused@*/ /*@null@*/ - yasm_valparamhead *objext_valparams, - unsigned long line) -{ - static const struct { - const char *name; - int required_arg; - void (*func) (yasm_object *, yasm_valparamhead *, unsigned long); - } dirs[] = { - {"EXPORT", 1, dir_export}, - {"IDENT", 1, dir_ident} - }; - size_t i; - - for (i=0; iobjfmt; yasm_valparam *vp = yasm_vps_first(valparams); @@ -1902,7 +1815,7 @@ get_curpos(yasm_object *object, unsigned long line) static void dir_pushreg(yasm_object *object, yasm_valparamhead *valparams, - unsigned long line) + yasm_valparamhead *objext_valparams, unsigned long line) { yasm_objfmt_coff *objfmt_coff = (yasm_objfmt_coff *)object->objfmt; yasm_valparam *vp = yasm_vps_first(valparams); @@ -1931,7 +1844,7 @@ dir_pushreg(yasm_object *object, yasm_valparamhead *valparams, static void dir_setframe(yasm_object *object, yasm_valparamhead *valparams, - unsigned long line) + yasm_valparamhead *objext_valparams, unsigned long line) { yasm_objfmt_coff *objfmt_coff = (yasm_objfmt_coff *)object->objfmt; yasm_valparam *vp = yasm_vps_first(valparams); @@ -1971,7 +1884,7 @@ dir_setframe(yasm_object *object, yasm_valparamhead *valparams, static void dir_allocstack(yasm_object *object, yasm_valparamhead *valparams, - unsigned long line) + yasm_valparamhead *objext_valparams, unsigned long line) { yasm_objfmt_coff *objfmt_coff = (yasm_objfmt_coff *)object->objfmt; yasm_valparam *vp = yasm_vps_first(valparams); @@ -2054,21 +1967,21 @@ dir_save_common(yasm_object *object, yasm_valparamhead *valparams, static void dir_savereg(yasm_object *object, yasm_valparamhead *valparams, - unsigned long line) + yasm_valparamhead *objext_valparams, unsigned long line) { dir_save_common(object, valparams, line, "SAVEREG", UWOP_SAVE_NONVOL); } static void dir_savexmm128(yasm_object *object, yasm_valparamhead *valparams, - unsigned long line) + yasm_valparamhead *objext_valparams, unsigned long line) { dir_save_common(object, valparams, line, "SAVEXMM128", UWOP_SAVE_XMM128); } static void dir_pushframe(yasm_object *object, /*@null@*/ yasm_valparamhead *valparams, - unsigned long line) + yasm_valparamhead *objext_valparams, unsigned long line) { yasm_objfmt_coff *objfmt_coff = (yasm_objfmt_coff *)object->objfmt; yasm_valparam *vp = yasm_vps_first(valparams); @@ -2091,7 +2004,7 @@ dir_pushframe(yasm_object *object, /*@null@*/ yasm_valparamhead *valparams, static void dir_endprolog(yasm_object *object, /*@null@*/ yasm_valparamhead *valparams, - unsigned long line) + yasm_valparamhead *objext_valparams, unsigned long line) { yasm_objfmt_coff *objfmt_coff = (yasm_objfmt_coff *)object->objfmt; if (!procframe_checkstate(objfmt_coff, "ENDPROLOG")) @@ -2103,7 +2016,7 @@ dir_endprolog(yasm_object *object, /*@null@*/ yasm_valparamhead *valparams, static void dir_endproc_frame(yasm_object *object, /*@null@*/ yasm_valparamhead *valparams, - unsigned long line) + yasm_valparamhead *objext_valparams, unsigned long line) { yasm_objfmt_coff *objfmt_coff = (yasm_objfmt_coff *)object->objfmt; yasm_section *sect; @@ -2191,47 +2104,6 @@ dir_endproc_frame(yasm_object *object, /*@null@*/ yasm_valparamhead *valparams, objfmt_coff->done_prolog = 0; } -static int -win64_objfmt_directive(yasm_object *object, const char *name, - /*@null@*/ yasm_valparamhead *valparams, - /*@unused@*/ /*@null@*/ - yasm_valparamhead *objext_valparams, - unsigned long line) -{ - static const struct { - const char *name; - int required_arg; - void (*func) (yasm_object *, yasm_valparamhead *, unsigned long); - } dirs[] = { - {"EXPORT", 1, dir_export}, - {"IDENT", 1, dir_ident}, - {"PROC_FRAME", 0, dir_proc_frame}, - {"PUSHREG", 1, dir_pushreg}, - {"SETFRAME", 1, dir_setframe}, - {"ALLOCSTACK", 1, dir_allocstack}, - {"SAVEREG", 1, dir_savereg}, - {"SAVEXMM128", 1, dir_savexmm128}, - {"PUSHFRAME", 0, dir_pushframe}, - {"ENDPROLOG", 0, dir_endprolog}, - {"ENDPROC_FRAME", 0, dir_endproc_frame} - }; - size_t i; - - for (i=0; icodes, link) { codebc = yasm_bc_create_common(&win64_uwcode_bc_callback, code, - yasm_symrec_get_line(code->loc)); + yasm_symrec_get_def_line(code->loc)); yasm_section_bcs_append(xdata, codebc); } @@ -259,7 +259,7 @@ win64_uwinfo_bc_expand(yasm_bytecode *bc, int span, long old_val, long new_val, coff_unwind_info *info = (coff_unwind_info *)bc->contents; switch (span) { case 1: - yasm_error_set_xref(yasm_symrec_get_line(info->prolog), + yasm_error_set_xref(yasm_symrec_get_def_line(info->prolog), N_("prologue ended here")); yasm_error_set(YASM_ERROR_VALUE, N_("prologue %ld bytes, must be <256"), new_val); diff --git a/modules/objfmts/dbg/dbg-objfmt.c b/modules/objfmts/dbg/dbg-objfmt.c index e65c2510..5017cb85 100644 --- a/modules/objfmts/dbg/dbg-objfmt.c +++ b/modules/objfmts/dbg/dbg-objfmt.c @@ -144,79 +144,6 @@ dbg_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, } } -static yasm_symrec * -dbg_objfmt_extern_declare(yasm_object *object, const char *name, - /*@unused@*/ /*@null@*/ - yasm_valparamhead *objext_valparams, - unsigned long line) -{ - yasm_objfmt_dbg *objfmt_dbg = (yasm_objfmt_dbg *)object->objfmt; - yasm_symrec *sym; - - fprintf(objfmt_dbg->dbgfile, "extern_declare(\"%s\", ", name); - yasm_vps_print(objext_valparams, objfmt_dbg->dbgfile); - fprintf(objfmt_dbg->dbgfile, ", %lu), returning sym\n", line); - - sym = yasm_symtab_declare(object->symtab, name, YASM_SYM_EXTERN, line); - return sym; -} - -static yasm_symrec * -dbg_objfmt_global_declare(yasm_object *object, const char *name, - /*@unused@*/ /*@null@*/ - yasm_valparamhead *objext_valparams, - unsigned long line) -{ - yasm_objfmt_dbg *objfmt_dbg = (yasm_objfmt_dbg *)object->objfmt; - yasm_symrec *sym; - - fprintf(objfmt_dbg->dbgfile, "global_declare(\"%s\", ", name); - yasm_vps_print(objext_valparams, objfmt_dbg->dbgfile); - fprintf(objfmt_dbg->dbgfile, ", %lu), returning sym\n", line); - - sym = yasm_symtab_declare(object->symtab, name, YASM_SYM_GLOBAL, line); - return sym; -} - -static yasm_symrec * -dbg_objfmt_common_declare(yasm_object *object, const char *name, - /*@only@*/ yasm_expr *size, - /*@unused@*/ /*@null@*/ - yasm_valparamhead *objext_valparams, - unsigned long line) -{ - yasm_objfmt_dbg *objfmt_dbg = (yasm_objfmt_dbg *)object->objfmt; - yasm_symrec *sym; - - assert(objfmt_dbg->dbgfile != NULL); - fprintf(objfmt_dbg->dbgfile, "common_declare(\"%s\", ", name); - yasm_expr_print(size, objfmt_dbg->dbgfile); - fprintf(objfmt_dbg->dbgfile, ", "); - yasm_vps_print(objext_valparams, objfmt_dbg->dbgfile); - fprintf(objfmt_dbg->dbgfile, ", %lu), returning sym\n", line); - yasm_expr_destroy(size); - - - sym = yasm_symtab_declare(object->symtab, name, YASM_SYM_COMMON, line); - return sym; -} - -static int -dbg_objfmt_directive(yasm_object *object, const char *name, - /*@null@*/ yasm_valparamhead *valparams, - /*@null@*/ yasm_valparamhead *objext_valparams, - unsigned long line) -{ - yasm_objfmt_dbg *objfmt_dbg = (yasm_objfmt_dbg *)object->objfmt; - fprintf(objfmt_dbg->dbgfile, "directive(\"%s\", ", name); - yasm_vps_print(valparams, objfmt_dbg->dbgfile); - fprintf(objfmt_dbg->dbgfile, ", "); - yasm_vps_print(objext_valparams, objfmt_dbg->dbgfile); - fprintf(objfmt_dbg->dbgfile, ", %lu), returning 0 (recognized)\n", line); - return 0; /* dbg format "recognizes" all directives */ -} - - /* Define valid debug formats to use with this object format */ static const char *dbg_objfmt_dbgfmt_keywords[] = { "null", @@ -231,13 +158,10 @@ yasm_objfmt_module yasm_dbg_LTX_objfmt = { 32, dbg_objfmt_dbgfmt_keywords, "null", + NULL, /* no directives */ dbg_objfmt_create, dbg_objfmt_output, dbg_objfmt_destroy, dbg_objfmt_add_default_section, - dbg_objfmt_section_switch, - dbg_objfmt_extern_declare, - dbg_objfmt_global_declare, - dbg_objfmt_common_declare, - dbg_objfmt_directive + dbg_objfmt_section_switch }; diff --git a/modules/objfmts/elf/elf-objfmt.c b/modules/objfmts/elf/elf-objfmt.c index 19dc5996..70b0f835 100644 --- a/modules/objfmts/elf/elf-objfmt.c +++ b/modules/objfmts/elf/elf-objfmt.c @@ -75,8 +75,9 @@ typedef struct { typedef struct { yasm_objfmt_elf *objfmt_elf; + yasm_errwarns *errwarns; int local_names; -} append_local_sym_info; +} build_symtab_info; yasm_objfmt_module yasm_elf_LTX_objfmt; yasm_objfmt_module yasm_elf32_LTX_objfmt; @@ -89,38 +90,170 @@ elf_objfmt_symtab_append(yasm_objfmt_elf *objfmt_elf, yasm_symrec *sym, elf_symbol_type type, elf_symbol_vis vis, yasm_expr *size, elf_address *value) { - /* Only append to table if not already appended */ elf_symtab_entry *entry = yasm_symrec_get_data(sym, &elf_symrec_data); - if (!entry || !elf_sym_in_table(entry)) { - if (!entry) { - elf_strtab_entry *name = - elf_strtab_append_str(objfmt_elf->strtab, - yasm_symrec_get_name(sym)); - entry = elf_symtab_entry_create(name, sym); - } - elf_symtab_append_entry(objfmt_elf->elf_symtab, entry); + + if (!entry) { + elf_strtab_entry *name = + elf_strtab_append_str(objfmt_elf->strtab, + yasm_symrec_get_name(sym)); + entry = elf_symtab_entry_create(name, sym); yasm_symrec_add_data(sym, &elf_symrec_data, entry); } + /* Only append to table if not already appended */ + if (!elf_sym_in_table(entry)) + elf_symtab_append_entry(objfmt_elf->elf_symtab, entry); + elf_symtab_set_nonzero(entry, NULL, sectidx, bind, type, size, value); elf_sym_set_visibility(entry, vis); return entry; } -static int -elf_objfmt_append_local_sym(yasm_symrec *sym, /*@null@*/ void *d) +static elf_symtab_entry * +build_extern(yasm_objfmt_elf *objfmt_elf, yasm_symrec *sym) { - append_local_sym_info *info = (append_local_sym_info *)d; - elf_symtab_entry *entry; + yasm_valparamhead *objext_valparams = + yasm_symrec_get_objext_valparams(sym); + + if (objext_valparams) { + yasm_valparam *vp = yasm_vps_first(objext_valparams); + for (; vp; vp = yasm_vps_next(vp)) { + if (vp->val) + yasm_error_set(YASM_ERROR_TYPE, + N_("unrecognized symbol type `%s'"), vp->val); + } + } + + return elf_objfmt_symtab_append(objfmt_elf, sym, SHN_UNDEF, STB_GLOBAL, 0, + STV_DEFAULT, NULL, NULL); +} + +static elf_symtab_entry * +build_global(yasm_objfmt_elf *objfmt_elf, yasm_symrec *sym) +{ + yasm_valparamhead *objext_valparams = + yasm_symrec_get_objext_valparams(sym); + elf_symbol_type type = 0; + yasm_expr *size = NULL; + elf_symbol_vis vis = STV_DEFAULT; + unsigned int vis_overrides = 0; + + if (objext_valparams) { + yasm_valparam *vp = yasm_vps_first(objext_valparams); + for (; vp; vp = yasm_vps_next(vp)) + { + if (vp->val) { + if (yasm__strcasecmp(vp->val, "function") == 0) + type = STT_FUNC; + else if (yasm__strcasecmp(vp->val, "data") == 0 || + yasm__strcasecmp(vp->val, "object") == 0) + type = STT_OBJECT; + else if (yasm__strcasecmp(vp->val, "internal") == 0) { + vis = STV_INTERNAL; + vis_overrides++; + } + else if (yasm__strcasecmp(vp->val, "hidden") == 0) { + vis = STV_HIDDEN; + vis_overrides++; + } + else if (yasm__strcasecmp(vp->val, "protected") == 0) { + vis = STV_PROTECTED; + vis_overrides++; + } + else + yasm_error_set(YASM_ERROR_TYPE, + N_("unrecognized symbol type `%s'"), + vp->val); + } + else if (vp->param && !size) { + size = vp->param; + vp->param = NULL; /* to avoid double-free of expr */ + } + } + if (vis_overrides > 1) { + yasm_warn_set(YASM_WARN_GENERAL, + N_("More than one symbol visibility provided; using last")); + } + } + + return elf_objfmt_symtab_append(objfmt_elf, sym, SHN_UNDEF, STB_GLOBAL, + type, vis, size, NULL); +} + +static /*@null@*/ elf_symtab_entry * +build_common(yasm_objfmt_elf *objfmt_elf, yasm_symrec *sym) +{ + yasm_expr **size = yasm_symrec_get_common_size(sym); + yasm_valparamhead *objext_valparams = + yasm_symrec_get_objext_valparams(sym); + unsigned long addralign = 0; + + if (objext_valparams) { + yasm_valparam *vp = yasm_vps_first(objext_valparams); + for (; vp; vp = yasm_vps_next(vp)) { + if (!vp->val && vp->param) { + /*@dependent@*/ /*@null@*/ const yasm_intnum *align_expr; + + align_expr = yasm_expr_get_intnum(&vp->param, 0); + if (!align_expr) { + yasm_error_set(YASM_ERROR_VALUE, + N_("alignment constraint is not an integer")); + return NULL; + } + addralign = yasm_intnum_get_uint(align_expr); + + /* Alignments must be a power of two. */ + if (!is_exp2(addralign)) { + yasm_error_set(YASM_ERROR_VALUE, + N_("alignment constraint is not a power of two")); + return NULL; + } + } else if (vp->val) + yasm_warn_set(YASM_WARN_GENERAL, + N_("Unrecognized qualifier `%s'"), vp->val); + } + } + + return elf_objfmt_symtab_append(objfmt_elf, sym, SHN_COMMON, STB_GLOBAL, + 0, STV_DEFAULT, *size, &addralign); +} + +static int +elf_objfmt_build_symtab(yasm_symrec *sym, /*@null@*/ void *d) +{ + build_symtab_info *info = (build_symtab_info *)d; + yasm_sym_vis vis = yasm_symrec_get_visibility(sym); + yasm_sym_status status = yasm_symrec_get_status(sym); + elf_symtab_entry *entry = yasm_symrec_get_data(sym, &elf_symrec_data); elf_address value=0; yasm_section *sect=NULL; yasm_bytecode *precbc=NULL; assert(info != NULL); + if (vis & YASM_SYM_EXTERN) { + entry = build_extern(info->objfmt_elf, sym); + yasm_errwarn_propagate(info->errwarns, + yasm_symrec_get_decl_line(sym)); + return 0; + } + + if (vis & YASM_SYM_COMMON) { + entry = build_common(info->objfmt_elf, sym); + yasm_errwarn_propagate(info->errwarns, + yasm_symrec_get_decl_line(sym)); + /* If the COMMON variable was actually defined, fall through. */ + if (!(status & YASM_SYM_DEFINED)) + return 0; + } + + /* Ignore any undefined at this point. */ + if (!(status & YASM_SYM_DEFINED)) + return 0; + if (!yasm_symrec_get_label(sym, &precbc)) { - if (!yasm_symrec_is_abs(sym)) /* let absolute symbol into output */ + if (!yasm_symrec_get_equ(sym) && !yasm_symrec_is_abs(sym)) return 0; precbc = NULL; } @@ -128,25 +261,44 @@ elf_objfmt_append_local_sym(yasm_symrec *sym, /*@null@*/ void *d) if (precbc) sect = yasm_bc_get_section(precbc); - entry = yasm_symrec_get_data(sym, &elf_symrec_data); - if (!entry || !elf_sym_in_table(entry)) { + if (entry && elf_sym_in_table(entry)) + ; + else if (vis & YASM_SYM_GLOBAL) { + entry = build_global(info->objfmt_elf, sym); + yasm_errwarn_propagate(info->errwarns, yasm_symrec_get_decl_line(sym)); + } else { int is_sect = 0; + + /* Locals (except when debugging) do not need to be + * in the symbol table, unless they're a section. + */ if (sect && !yasm_section_is_absolute(sect) && strcmp(yasm_symrec_get_name(sym), yasm_section_get_name(sect))==0) is_sect = 1; - - /* neither sections nor locals (except when debugging) need names */ +#if 0 + /* FIXME: to enable this we must have handling in place for special + * symbols. + */ + if (!info->local_names && !is_sect) + return 0; +#else + if (yasm_symrec_get_equ(sym) && !yasm_symrec_is_abs(sym)) + return 0; +#endif + entry = yasm_symrec_get_data(sym, &elf_symrec_data); if (!entry) { - elf_strtab_entry *name = info->local_names && !is_sect - ? elf_strtab_append_str(info->objfmt_elf->strtab, - yasm_symrec_get_name(sym)) - : NULL; + elf_strtab_entry *name = !info->local_names || is_sect ? NULL : + elf_strtab_append_str(info->objfmt_elf->strtab, + yasm_symrec_get_name(sym)); entry = elf_symtab_entry_create(name, sym); + yasm_symrec_add_data(sym, &elf_symrec_data, entry); } - elf_symtab_insert_local_sym(info->objfmt_elf->elf_symtab, entry); + + if (!elf_sym_in_table(entry)) + elf_symtab_insert_local_sym(info->objfmt_elf->elf_symtab, entry); + elf_symtab_set_nonzero(entry, sect, 0, STB_LOCAL, is_sect ? STT_SECTION : 0, NULL, 0); - yasm_symrec_add_data(sym, &elf_symrec_data, entry); if (is_sect) return 0; @@ -588,7 +740,7 @@ elf_objfmt_output(yasm_object *object, FILE *f, int all_syms, { yasm_objfmt_elf *objfmt_elf = (yasm_objfmt_elf *)object->objfmt; elf_objfmt_output_info info; - append_local_sym_info localsym_info; + build_symtab_info buildsym_info; long pos; unsigned long elf_shead_addr; elf_secthead *esdn; @@ -614,16 +766,17 @@ elf_objfmt_output(yasm_object *object, FILE *f, int all_syms, } /* Create missing section headers */ - localsym_info.objfmt_elf = objfmt_elf; if (yasm_object_sections_traverse(object, &info, elf_objfmt_create_dbg_secthead)) return; /* add all (local) syms to symtab because relocation needs a symtab index * if all_syms, register them by name. if not, use strtab entry 0 */ - localsym_info.local_names = all_syms; - yasm_symtab_traverse(object->symtab, &localsym_info, - elf_objfmt_append_local_sym); + buildsym_info.objfmt_elf = objfmt_elf; + buildsym_info.errwarns = errwarns; + buildsym_info.local_names = all_syms; + yasm_symtab_traverse(object->symtab, &buildsym_info, + elf_objfmt_build_symtab); elf_symtab_nlocal = elf_symtab_assign_indices(objfmt_elf->elf_symtab); /* output known sections - includes reloc sections which aren't in yasm's @@ -959,135 +1112,11 @@ elf_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, return retval; } -static yasm_symrec * -elf_objfmt_extern_declare(yasm_object *object, const char *name, /*@unused@*/ - /*@null@*/ yasm_valparamhead *objext_valparams, - unsigned long line) -{ - yasm_objfmt_elf *objfmt_elf = (yasm_objfmt_elf *)object->objfmt; - yasm_symrec *sym; - - sym = yasm_symtab_declare(object->symtab, name, YASM_SYM_EXTERN, line); - elf_objfmt_symtab_append(objfmt_elf, sym, SHN_UNDEF, STB_GLOBAL, - 0, STV_DEFAULT, NULL, NULL); - - if (objext_valparams) { - yasm_valparam *vp = yasm_vps_first(objext_valparams); - for (; vp; vp = yasm_vps_next(vp)) - { - if (vp->val) - yasm_error_set(YASM_ERROR_TYPE, - N_("unrecognized symbol type `%s'"), vp->val); - } - } - return sym; -} - -static yasm_symrec * -elf_objfmt_global_declare(yasm_object *object, const char *name, - /*@null@*/ yasm_valparamhead *objext_valparams, - unsigned long line) -{ - yasm_objfmt_elf *objfmt_elf = (yasm_objfmt_elf *)object->objfmt; - yasm_symrec *sym; - elf_symbol_type type = 0; - yasm_expr *size = NULL; - elf_symbol_vis vis = STV_DEFAULT; - unsigned int vis_overrides = 0; - - sym = yasm_symtab_declare(object->symtab, name, YASM_SYM_GLOBAL, line); - - if (objext_valparams) { - yasm_valparam *vp = yasm_vps_first(objext_valparams); - for (; vp; vp = yasm_vps_next(vp)) - { - if (vp->val) { - if (yasm__strcasecmp(vp->val, "function") == 0) - type = STT_FUNC; - else if (yasm__strcasecmp(vp->val, "data") == 0 || - yasm__strcasecmp(vp->val, "object") == 0) - type = STT_OBJECT; - else if (yasm__strcasecmp(vp->val, "internal") == 0) { - vis = STV_INTERNAL; - vis_overrides++; - } - else if (yasm__strcasecmp(vp->val, "hidden") == 0) { - vis = STV_HIDDEN; - vis_overrides++; - } - else if (yasm__strcasecmp(vp->val, "protected") == 0) { - vis = STV_PROTECTED; - vis_overrides++; - } - else - yasm_error_set(YASM_ERROR_TYPE, - N_("unrecognized symbol type `%s'"), - vp->val); - } - else if (vp->param && !size) { - size = vp->param; - vp->param = NULL; /* to avoid deleting the expr */ - } - } - if (vis_overrides > 1) { - yasm_warn_set(YASM_WARN_GENERAL, - N_("More than one symbol visibility provided; using last")); - } - } - - elf_objfmt_symtab_append(objfmt_elf, sym, SHN_UNDEF, STB_GLOBAL, - type, vis, size, NULL); - - return sym; -} - -static yasm_symrec * -elf_objfmt_common_declare(yasm_object *object, const char *name, - /*@only@*/ yasm_expr *size, /*@null@*/ - yasm_valparamhead *objext_valparams, - unsigned long line) -{ - yasm_objfmt_elf *objfmt_elf = (yasm_objfmt_elf *)object->objfmt; - yasm_symrec *sym; - unsigned long addralign = 0; - - sym = yasm_symtab_declare(object->symtab, name, YASM_SYM_COMMON, line); - - if (objext_valparams) { - yasm_valparam *vp = yasm_vps_first(objext_valparams); - for (; vp; vp = yasm_vps_next(vp)) { - if (!vp->val && vp->param) { - /*@dependent@*/ /*@null@*/ const yasm_intnum *align_expr; - - align_expr = yasm_expr_get_intnum(&vp->param, 0); - if (!align_expr) { - yasm_error_set(YASM_ERROR_VALUE, - N_("alignment constraint is not an integer")); - return sym; - } - addralign = yasm_intnum_get_uint(align_expr); - - /* Alignments must be a power of two. */ - if (!is_exp2(addralign)) { - yasm_error_set(YASM_ERROR_VALUE, - N_("alignment constraint is not a power of two")); - return sym; - } - } else if (vp->val) - yasm_warn_set(YASM_WARN_GENERAL, - N_("Unrecognized qualifier `%s'"), vp->val); - } - } - - elf_objfmt_symtab_append(objfmt_elf, sym, SHN_COMMON, STB_GLOBAL, - 0, STV_DEFAULT, size, &addralign); - - return sym; -} - static void -dir_type(yasm_object *object, yasm_valparam *vp, unsigned long line) +dir_type(yasm_object *object, yasm_valparamhead *valparams, + yasm_valparamhead *objext_valparams, unsigned long line) { + yasm_valparam *vp = yasm_vps_first(valparams); yasm_objfmt_elf *objfmt_elf = (yasm_objfmt_elf *)object->objfmt; char *symname = vp->val; /* Get symbol elf data */ @@ -1116,8 +1145,10 @@ dir_type(yasm_object *object, yasm_valparam *vp, unsigned long line) } static void -dir_size(yasm_object *object, yasm_valparam *vp, unsigned long line) +dir_size(yasm_object *object, yasm_valparamhead *valparams, + yasm_valparamhead *objext_valparams, unsigned long line) { + yasm_valparam *vp = yasm_vps_first(valparams); yasm_objfmt_elf *objfmt_elf = (yasm_objfmt_elf *)object->objfmt; char *symname = vp->val; /* Get symbol elf data */ @@ -1144,8 +1175,10 @@ dir_size(yasm_object *object, yasm_valparam *vp, unsigned long line) } static void -dir_weak(yasm_object *object, yasm_valparam *vp, unsigned long line) +dir_weak(yasm_object *object, yasm_valparamhead *valparams, + yasm_valparamhead *objext_valparams, unsigned long line) { + yasm_valparam *vp = yasm_vps_first(valparams); yasm_objfmt_elf *objfmt_elf = (yasm_objfmt_elf *)object->objfmt; char *symname = vp->val; yasm_symrec *sym = yasm_symtab_declare(object->symtab, symname, @@ -1155,11 +1188,13 @@ dir_weak(yasm_object *object, yasm_valparam *vp, unsigned long line) } static void -dir_ident(yasm_object *object, yasm_valparam *vp, unsigned long line) +dir_ident(yasm_object *object, yasm_valparamhead *valparams, + yasm_valparamhead *objext_valparams, unsigned long line) { yasm_valparamhead sect_vps; yasm_datavalhead dvs; yasm_section *comment; + yasm_valparam *vp = yasm_vps_first(valparams); yasm_valparam *vp2; /* Put ident data into .comment section */ @@ -1191,40 +1226,6 @@ dir_ident(yasm_object *object, yasm_valparam *vp, unsigned long line) yasm_bc_create_data(&dvs, 1, 1, object->arch, line)); } -static int -elf_objfmt_directive(yasm_object *object, const char *name, - /*@null@*/ yasm_valparamhead *valparams, - /*@unused@*/ /*@null@*/ - yasm_valparamhead *objext_valparams, - unsigned long line) -{ - static const struct { - const char *name; - void (*func) (yasm_object *, yasm_valparam *, unsigned long); - } dirs[] = { - {"TYPE", dir_type}, - {"SIZE", dir_size}, - {"WEAK", dir_weak}, - {"IDENT", dir_ident} - }; - size_t i; - - for (i=0; ival) { - yasm_error_set(YASM_ERROR_SYNTAX, - N_("Symbol name not specified")); - return 0; - } - dirs[i].func(object, vp, line); - return 0; - } - } - return 1; /* unrecognized */ -} - - /* Define valid debug formats to use with this object format */ static const char *elf_objfmt_dbgfmt_keywords[] = { "null", @@ -1233,6 +1234,18 @@ static const char *elf_objfmt_dbgfmt_keywords[] = { NULL }; +static const yasm_directive elf_objfmt_directives[] = { + { ".type", "gas", dir_type, YASM_DIR_ID_REQUIRED }, + { ".size", "gas", dir_size, YASM_DIR_ID_REQUIRED }, + { ".weak", "gas", dir_weak, YASM_DIR_ID_REQUIRED }, + { ".ident", "gas", dir_ident, YASM_DIR_ARG_REQUIRED }, + { "type", "nasm", dir_type, YASM_DIR_ID_REQUIRED }, + { "size", "nasm", dir_size, YASM_DIR_ID_REQUIRED }, + { "weak", "nasm", dir_weak, YASM_DIR_ID_REQUIRED }, + { "ident", "nasm", dir_ident, YASM_DIR_ARG_REQUIRED }, + { NULL, NULL, NULL, 0 } +}; + /* Define objfmt structure -- see objfmt.h for details */ yasm_objfmt_module yasm_elf_LTX_objfmt = { "ELF", @@ -1241,15 +1254,12 @@ yasm_objfmt_module yasm_elf_LTX_objfmt = { 32, elf_objfmt_dbgfmt_keywords, "null", + elf_objfmt_directives, elf_objfmt_create, elf_objfmt_output, elf_objfmt_destroy, elf_objfmt_add_default_section, - elf_objfmt_section_switch, - elf_objfmt_extern_declare, - elf_objfmt_global_declare, - elf_objfmt_common_declare, - elf_objfmt_directive + elf_objfmt_section_switch }; yasm_objfmt_module yasm_elf32_LTX_objfmt = { @@ -1259,15 +1269,12 @@ yasm_objfmt_module yasm_elf32_LTX_objfmt = { 32, elf_objfmt_dbgfmt_keywords, "null", + elf_objfmt_directives, elf32_objfmt_create, elf_objfmt_output, elf_objfmt_destroy, elf_objfmt_add_default_section, - elf_objfmt_section_switch, - elf_objfmt_extern_declare, - elf_objfmt_global_declare, - elf_objfmt_common_declare, - elf_objfmt_directive + elf_objfmt_section_switch }; yasm_objfmt_module yasm_elf64_LTX_objfmt = { @@ -1277,13 +1284,10 @@ yasm_objfmt_module yasm_elf64_LTX_objfmt = { 64, elf_objfmt_dbgfmt_keywords, "null", + elf_objfmt_directives, elf64_objfmt_create, elf_objfmt_output, elf_objfmt_destroy, elf_objfmt_add_default_section, - elf_objfmt_section_switch, - elf_objfmt_extern_declare, - elf_objfmt_global_declare, - elf_objfmt_common_declare, - elf_objfmt_directive + elf_objfmt_section_switch }; diff --git a/modules/objfmts/elf/elf.c b/modules/objfmts/elf/elf.c index 12fc58a9..52b69ec8 100644 --- a/modules/objfmts/elf/elf.c +++ b/modules/objfmts/elf/elf.c @@ -283,8 +283,6 @@ elf_symtab_entry_destroy(elf_symtab_entry *entry) if (entry == NULL) yasm_internal_error("symtab entry is null"); - if (entry->xsize) - yasm_expr_destroy(entry->xsize); yasm_xfree(entry); } diff --git a/modules/objfmts/elf/elf.h b/modules/objfmts/elf/elf.h index 1a75f91a..c78c5f9b 100644 --- a/modules/objfmts/elf/elf.h +++ b/modules/objfmts/elf/elf.h @@ -391,7 +391,7 @@ struct elf_symtab_entry { yasm_section *sect; elf_strtab_entry *name; elf_address value; - yasm_expr *xsize; + /*@dependent@*/ yasm_expr *xsize; elf_size size; elf_section_index index; elf_symbol_binding bind; diff --git a/modules/objfmts/elf/tests/elfmanysym.hex b/modules/objfmts/elf/tests/elfmanysym.hex index a5f6e1ad..f185d3d0 100644 --- a/modules/objfmts/elf/tests/elfmanysym.hex +++ b/modules/objfmts/elf/tests/elfmanysym.hex @@ -30,7 +30,7 @@ 00 00 00 -b0 +80 10 00 00 @@ -445,37 +445,6 @@ aa 70 63 5f -65 -66 -66 -65 -63 -74 -69 -76 -65 -5f -74 -6f -5f -70 -68 -79 -73 -69 -63 -61 -6c -5f -64 -61 -74 -61 -00 -70 -70 -63 -5f 77 72 69 @@ -993,7 +962,6 @@ aa 00 00 00 -00 01 00 00 @@ -3958,7 +3926,7 @@ e9 01 00 00 -00 +05 00 00 00 @@ -3968,9 +3936,9 @@ e9 00 10 00 +04 00 -00 -5e +5c 01 00 00 @@ -3986,7 +3954,7 @@ e9 00 04 00 -7b +79 01 00 00 @@ -4002,7 +3970,7 @@ e9 00 04 00 -98 +96 01 00 00 @@ -4018,7 +3986,7 @@ e9 00 04 00 -b5 +b4 01 00 00 @@ -4034,7 +4002,7 @@ b5 00 04 00 -d3 +d2 01 00 00 @@ -4050,7 +4018,7 @@ d3 00 04 00 -f1 +f4 01 00 00 @@ -4066,7 +4034,7 @@ f1 00 04 00 -13 +10 02 00 00 @@ -4082,7 +4050,7 @@ f1 00 04 00 -2f +2e 02 00 00 @@ -4098,7 +4066,7 @@ f1 00 04 00 -4d +4c 02 00 00 @@ -4114,7 +4082,7 @@ f1 00 04 00 -6b +68 02 00 00 @@ -4130,7 +4098,7 @@ f1 00 04 00 -87 +85 02 00 00 @@ -4146,7 +4114,7 @@ f1 00 04 00 -a4 +a2 02 00 00 @@ -4162,11 +4130,11 @@ a4 00 04 00 -c1 +c3 02 00 00 -05 +00 00 00 00 @@ -4182,7 +4150,7 @@ e2 02 00 00 -00 +05 00 00 00 @@ -4194,7 +4162,7 @@ e2 00 04 00 -01 +03 03 00 00 @@ -4210,7 +4178,7 @@ e2 00 04 00 -22 +14 03 00 00 @@ -4226,23 +4194,7 @@ e2 00 04 00 -33 -03 -00 -00 -05 -00 -00 -00 -00 -00 -00 -00 -10 -00 -04 -00 -45 +26 03 00 00 @@ -4370,7 +4322,7 @@ e2 00 00 00 -56 +37 03 00 00 @@ -4406,11 +4358,11 @@ e2 00 00 00 -d4 +b4 03 00 00 -d0 +c0 0c 00 00 diff --git a/modules/objfmts/elf/tests/elfvisibility.asm b/modules/objfmts/elf/tests/elfvisibility.asm index 13203106..32d20722 100644 --- a/modules/objfmts/elf/tests/elfvisibility.asm +++ b/modules/objfmts/elf/tests/elfvisibility.asm @@ -4,3 +4,8 @@ global ghidden:hidden global ginternal:internal global gprotected:protected global gtoomany:hidden internal + +ghidden: +ginternal: +gprotected: +gtoomany: diff --git a/modules/objfmts/elf/tests/elfvisibility.hex b/modules/objfmts/elf/tests/elfvisibility.hex index c4ace91f..8da06880 100644 --- a/modules/objfmts/elf/tests/elfvisibility.hex +++ b/modules/objfmts/elf/tests/elfvisibility.hex @@ -204,7 +204,7 @@ ff 00 10 02 -00 +04 00 0b 00 @@ -220,7 +220,7 @@ ff 00 10 01 -00 +04 00 15 00 @@ -236,7 +236,7 @@ ff 00 10 03 -00 +04 00 20 00 @@ -252,7 +252,7 @@ ff 00 10 01 -00 +04 00 00 00 diff --git a/modules/objfmts/elf/tests/gas64/elf_gas64_reloc.hex b/modules/objfmts/elf/tests/gas64/elf_gas64_reloc.hex index c4dc66fb..906cce87 100644 --- a/modules/objfmts/elf/tests/gas64/elf_gas64_reloc.hex +++ b/modules/objfmts/elf/tests/gas64/elf_gas64_reloc.hex @@ -730,15 +730,15 @@ ff 2d 00 5f -5a -45 -52 -4f 56 41 52 00 5f +5a +45 +52 +4f 56 41 52 @@ -870,7 +870,7 @@ c0 00 00 00 -03 +08 00 00 00 @@ -894,7 +894,7 @@ c0 00 00 00 -0c +03 00 00 00 diff --git a/modules/objfmts/macho/macho-objfmt.c b/modules/objfmts/macho/macho-objfmt.c index ac7eacce..b07bbe0b 100644 --- a/modules/objfmts/macho/macho-objfmt.c +++ b/modules/objfmts/macho/macho-objfmt.c @@ -293,7 +293,6 @@ typedef struct macho_section_data { typedef struct macho_symrec_data { - /*@owned@*/ /*@null@*/ yasm_expr *size; /* size if COMMON declaration */ unsigned long index; /* index in output order */ yasm_intnum *value; /* valid after writing symtable to file */ unsigned long length; /* length + 1 (plus auto underscore) */ @@ -948,13 +947,14 @@ macho_objfmt_output_symtable(yasm_symrec *sym, /*@null@*/ void *d) scnum = -1; /*n_desc = REFERENCE_FLAG_UNDEFINED_LAZY; * FIXME: see definition of REFERENCE_FLAG_* above */ } else if (vis & YASM_SYM_COMMON) { + yasm_expr **csize = yasm_symrec_get_common_size(sym); n_type = N_UNDF | N_EXT; - if (symd) { - intn = yasm_expr_get_intnum(&symd->size, 1); + if (csize) { + intn = yasm_expr_get_intnum(csize, 1); if (!intn) { yasm_error_set(YASM_ERROR_NOT_CONSTANT, N_("COMMON data size not an integer expression")); - yasm_errwarn_propagate(info->errwarns, symd->size->line); + yasm_errwarn_propagate(info->errwarns, (*csize)->line); } else yasm_intnum_set_uint(val, yasm_intnum_get_uint(intn)); } @@ -1500,48 +1500,9 @@ macho_section_data_print(void *data, FILE *f, int indent_level) fprintf(f, "%*soffset=%ld\n", indent_level, "", msd->offset); } -static yasm_symrec * -macho_objfmt_extern_declare(yasm_object *object, const char *name, /*@unused@*/ - /*@null@*/ yasm_valparamhead *objext_valparams, - unsigned long line) -{ - return yasm_symtab_declare(object->symtab, name, YASM_SYM_EXTERN, line); -} - -static yasm_symrec * -macho_objfmt_global_declare(yasm_object *object, const char *name, /*@unused@*/ - /*@null@*/ yasm_valparamhead *objext_valparams, - unsigned long line) -{ - return yasm_symtab_declare(object->symtab, name, YASM_SYM_GLOBAL, line); -} - -static yasm_symrec * -macho_objfmt_common_declare(yasm_object *object, const char *name, - /*@only@*/ yasm_expr *size, - /*@unused@*/ /*@null@*/ - yasm_valparamhead *objext_valparams, - unsigned long line) -{ - yasm_symrec *sym; - macho_symrec_data *sym_data; - - sym = yasm_symtab_declare(object->symtab, name, YASM_SYM_COMMON, line); - - sym_data = yasm_xmalloc(sizeof(macho_symrec_data)); - - sym_data->size = size; - yasm_symrec_add_data(sym, &macho_symrec_data_cb, sym_data); - return sym; -} - static void macho_symrec_data_destroy(void *data) { - macho_symrec_data *csymd = (macho_symrec_data *)data; - - if (csymd->size) - yasm_expr_destroy(csymd->size); yasm_xfree(data); } @@ -1550,12 +1511,6 @@ macho_symrec_data_print(void *data, FILE *f, int indent_level) { macho_symrec_data *msd = (macho_symrec_data *)data; - fprintf(f, "%*ssize=", indent_level, ""); - if (msd->size) - yasm_expr_print(msd->size, f); - else - fprintf(f, "nil"); - fprintf(f, "\n"); fprintf(f, "%*sindex=%ld\n", indent_level, "", msd->index); fprintf(f, "%*svalue=", indent_level, ""); if (msd->value) @@ -1565,18 +1520,6 @@ macho_symrec_data_print(void *data, FILE *f, int indent_level) } -static int -macho_objfmt_directive(/*@unused@*/ yasm_object *object, - /*@unused@*/ const char *name, - /*@unused@*/ /*@null@*/ yasm_valparamhead *valparams, - /*@unused@*/ /*@null@*/ - yasm_valparamhead *objext_valparams, - /*@unused@*/ unsigned long line) -{ - return 1; /* no objfmt directives */ -} - - /* Define valid debug formats to use with this object format */ static const char *macho_objfmt_dbgfmt_keywords[] = { "null", @@ -1591,15 +1534,12 @@ yasm_objfmt_module yasm_macho_LTX_objfmt = { 32, macho_objfmt_dbgfmt_keywords, "null", + NULL, /* no directives */ macho_objfmt_create, macho_objfmt_output, macho_objfmt_destroy, macho_objfmt_add_default_section, - macho_objfmt_section_switch, - macho_objfmt_extern_declare, - macho_objfmt_global_declare, - macho_objfmt_common_declare, - macho_objfmt_directive + macho_objfmt_section_switch }; yasm_objfmt_module yasm_macho32_LTX_objfmt = { @@ -1609,15 +1549,12 @@ yasm_objfmt_module yasm_macho32_LTX_objfmt = { 32, macho_objfmt_dbgfmt_keywords, "null", + NULL, /* no directives */ macho32_objfmt_create, macho_objfmt_output, macho_objfmt_destroy, macho_objfmt_add_default_section, - macho_objfmt_section_switch, - macho_objfmt_extern_declare, - macho_objfmt_global_declare, - macho_objfmt_common_declare, - macho_objfmt_directive + macho_objfmt_section_switch }; yasm_objfmt_module yasm_macho64_LTX_objfmt = { @@ -1627,13 +1564,10 @@ yasm_objfmt_module yasm_macho64_LTX_objfmt = { 64, macho_objfmt_dbgfmt_keywords, "null", + NULL, /* no directives */ macho64_objfmt_create, macho_objfmt_output, macho_objfmt_destroy, macho_objfmt_add_default_section, - macho_objfmt_section_switch, - macho_objfmt_extern_declare, - macho_objfmt_global_declare, - macho_objfmt_common_declare, - macho_objfmt_directive + macho_objfmt_section_switch }; diff --git a/modules/objfmts/rdf/rdf-objfmt.c b/modules/objfmts/rdf/rdf-objfmt.c index 5d7eace7..541935de 100644 --- a/modules/objfmts/rdf/rdf-objfmt.c +++ b/modules/objfmts/rdf/rdf-objfmt.c @@ -100,10 +100,6 @@ typedef struct rdf_section_data { } rdf_section_data; typedef struct rdf_symrec_data { - /*@owned@*/ /*@null@*/ yasm_expr *size; /* size if COMMON declaration */ - unsigned long align; /* alignment if COMMON declaration */ - - unsigned int flags; /* import/export/type flags */ unsigned int segment; /* assigned RDF "segment" index */ } rdf_symrec_data; @@ -156,16 +152,11 @@ yasm_objfmt_module yasm_rdf_LTX_objfmt; static /*@dependent@*/ rdf_symrec_data * -rdf_objfmt_sym_set_data(yasm_symrec *sym, - /*@only@*/ /*@null@*/ yasm_expr *size, - unsigned long align, unsigned int flags) +rdf_objfmt_sym_set_data(yasm_symrec *sym, unsigned int segment) { rdf_symrec_data *rsymd = yasm_xmalloc(sizeof(rdf_symrec_data)); - rsymd->size = size; - rsymd->align = align; - rsymd->flags = flags; - rsymd->segment = 0; + rsymd->segment = segment; yasm_symrec_add_data(sym, &rdf_symrec_data_cb, rsymd); return rsymd; @@ -484,6 +475,72 @@ rdf_objfmt_output_section_file(yasm_section *sect, /*@null@*/ void *d) return 0; } +static unsigned int +rdf_parse_flags(yasm_symrec *sym) +{ + yasm_sym_vis vis = yasm_symrec_get_visibility(sym); + /*@dependent@*/ /*@null@*/ yasm_valparamhead *objext_valparams = + yasm_symrec_get_objext_valparams(sym); + yasm_valparam *vp; + unsigned int flags = 0; + + static const struct { + enum { + FLAG_EXT = 1, + FLAG_GLOB = 2 + } type; + enum { + FLAG_SET = 1, + FLAG_CLR = 2 + } action; + const char *name; + unsigned int flags; + } flagtbl[] = { + { FLAG_EXT|FLAG_GLOB, FLAG_SET, "data", SYM_DATA }, + { FLAG_EXT|FLAG_GLOB, FLAG_SET, "object", SYM_DATA }, + { FLAG_EXT|FLAG_GLOB, FLAG_SET, "proc", SYM_FUNCTION }, + { FLAG_EXT|FLAG_GLOB, FLAG_SET, "function", SYM_FUNCTION }, + { FLAG_EXT, FLAG_SET, "import", SYM_IMPORT }, + { FLAG_GLOB, FLAG_SET, "export", SYM_GLOBAL }, + { FLAG_EXT, FLAG_SET, "far", SYM_FAR }, + { FLAG_EXT, FLAG_CLR, "near", SYM_FAR }, + }; + + if (!objext_valparams) + return 0; + + vp = yasm_vps_first(objext_valparams); + for (; vp; vp = yasm_vps_next(vp)) { + size_t i; + int match; + + if (!vp->val) { + yasm_warn_set(YASM_WARN_GENERAL, + N_("Unrecognized numeric qualifier")); + continue; + } + + match = 0; + for (i=0; ival, flagtbl[i].name) == 0) { + if (flagtbl[i].action == FLAG_SET) + flags |= flagtbl[i].flags; + else if (flagtbl[i].action == FLAG_CLR) + flags &= ~flagtbl[i].flags; + match = 1; + } + } + + if (!match) + yasm_warn_set(YASM_WARN_GENERAL, N_("Unrecognized qualifier `%s'"), + vp->val); + } + + return flags; +} + static int rdf_objfmt_output_sym(yasm_symrec *sym, /*@null@*/ void *d) { @@ -496,7 +553,6 @@ rdf_objfmt_output_sym(yasm_symrec *sym, /*@null@*/ void *d) /*@dependent@*/ /*@null@*/ yasm_section *sect; /*@dependent@*/ /*@null@*/ yasm_bytecode *precbc; unsigned char *localbuf; - rdf_symrec_data *rsymd; assert(info != NULL); @@ -521,15 +577,16 @@ rdf_objfmt_output_sym(yasm_symrec *sym, /*@null@*/ void *d) } else if (yasm_section_is_absolute(sect)) { yasm_warn_set(YASM_WARN_GENERAL, N_("rdf does not support exporting absolutes")); - yasm_errwarn_propagate(info->errwarns, yasm_symrec_get_line(sym)); + yasm_errwarn_propagate(info->errwarns, + yasm_symrec_get_decl_line(sym)); return 0; } else yasm_internal_error(N_("didn't understand section")); value = yasm_bc_next_offset(precbc); } else if (yasm_symrec_get_equ(sym)) { yasm_warn_set(YASM_WARN_GENERAL, - N_("rdf does not support exporting EQU/absolute values")); - yasm_errwarn_propagate(info->errwarns, yasm_symrec_get_line(sym)); + N_("rdf does not support exporting EQU/absolute values")); + yasm_errwarn_propagate(info->errwarns, yasm_symrec_get_decl_line(sym)); return 0; } @@ -540,50 +597,72 @@ rdf_objfmt_output_sym(yasm_symrec *sym, /*@null@*/ void *d) yasm_warn_set(YASM_WARN_GENERAL, N_("label name too long, truncating to %d bytes"), EXIM_LABEL_MAX); - yasm_errwarn_propagate(info->errwarns, yasm_symrec_get_line(sym)); len = EXIM_LABEL_MAX-1; } localbuf = info->buf; if (vis & YASM_SYM_GLOBAL) { - rsymd = yasm_symrec_get_data(sym, &rdf_symrec_data_cb); - if (!rsymd) - yasm_internal_error(N_("rdf: no symbol data for global symbol")); YASM_WRITE_8(localbuf, RDFREC_GLOBAL); YASM_WRITE_8(localbuf, 6+len+1); /* record length */ - YASM_WRITE_8(localbuf, rsymd->flags); /* flags */ + YASM_WRITE_8(localbuf, rdf_parse_flags(sym)); /* flags */ YASM_WRITE_8(localbuf, scnum); /* segment referred to */ YASM_WRITE_32_L(localbuf, value); /* offset */ } else { - /* Create new symrec data if it doesn't already exist */ - rsymd = yasm_symrec_get_data(sym, &rdf_symrec_data_cb); - if (!rsymd) - rsymd = rdf_objfmt_sym_set_data(sym, NULL, 0, 0); - /* Save symbol segment in symrec data (for later reloc gen) */ - rsymd->segment = info->indx++; - scnum = rsymd->segment; + scnum = info->indx++; + rdf_objfmt_sym_set_data(sym, scnum); if (vis & YASM_SYM_COMMON) { + /*@dependent@*/ /*@null@*/ yasm_expr **csize_expr; const yasm_intnum *intn; + /*@dependent@*/ /*@null@*/ yasm_valparamhead *objext_valparams = + yasm_symrec_get_objext_valparams(sym); + unsigned long addralign = 0; YASM_WRITE_8(localbuf, RDFREC_COMMON); YASM_WRITE_8(localbuf, 8+len+1); /* record length */ YASM_WRITE_16_L(localbuf, scnum); /* segment allocated */ /* size */ - intn = yasm_expr_get_intnum(&rsymd->size, 1); + csize_expr = yasm_symrec_get_common_size(sym); + assert(csize_expr != NULL); + intn = yasm_expr_get_intnum(csize_expr, 1); if (!intn) { yasm_error_set(YASM_ERROR_NOT_CONSTANT, N_("COMMON data size not an integer expression")); - yasm_errwarn_propagate(info->errwarns, - yasm_symrec_get_line(sym)); } else value = yasm_intnum_get_uint(intn); YASM_WRITE_32_L(localbuf, value); - YASM_WRITE_16_L(localbuf, rsymd->align); /* alignment */ + + /* alignment */ + if (objext_valparams) { + yasm_valparam *vp = yasm_vps_first(objext_valparams); + for (; vp; vp = yasm_vps_next(vp)) { + if (!vp->val && vp->param) { + /*@null@*/ const yasm_intnum *align_expr; + + align_expr = yasm_expr_get_intnum(&vp->param, 0); + if (!align_expr) { + yasm_error_set(YASM_ERROR_VALUE, + N_("alignment constraint is not an integer")); + continue; + } + addralign = yasm_intnum_get_uint(align_expr); + + /* Alignments must be a power of two. */ + if (!is_exp2(addralign)) { + yasm_error_set(YASM_ERROR_VALUE, + N_("alignment constraint is not a power of two")); + continue; + } + } else if (vp->val) + yasm_warn_set(YASM_WARN_GENERAL, + N_("Unrecognized qualifier `%s'"), vp->val); + } + } + YASM_WRITE_16_L(localbuf, addralign); } else if (vis & YASM_SYM_EXTERN) { - unsigned int flags = rsymd->flags; + unsigned int flags = rdf_parse_flags(sym); if (flags & SYM_FAR) { YASM_WRITE_8(localbuf, RDFREC_FARIMPORT); flags &= ~SYM_FAR; @@ -601,6 +680,8 @@ rdf_objfmt_output_sym(yasm_symrec *sym, /*@null@*/ void *d) YASM_WRITE_8(localbuf, 0); /* 0-terminated name */ fwrite(info->buf, (unsigned long)(localbuf-info->buf), 1, info->f); + + yasm_errwarn_propagate(info->errwarns, yasm_symrec_get_decl_line(sym)); return 0; } @@ -917,163 +998,9 @@ rdf_section_data_print(void *data, FILE *f, int indent_level) fprintf(f, "%*ssize=%ld\n", indent_level, "", rsd->size); } -static yasm_symrec * -rdf_objfmt_extern_declare(yasm_object *object, const char *name, /*@unused@*/ - /*@null@*/ yasm_valparamhead *objext_valparams, - unsigned long line) -{ - yasm_symrec *sym; - unsigned int flags = 0; - - static const struct { - const char *name; - unsigned int flags; - } flagnames[] = { - { "data", SYM_DATA }, - { "object", SYM_DATA }, - { "proc", SYM_FUNCTION }, - { "function", SYM_FUNCTION }, - { "import", SYM_IMPORT }, - { "far", SYM_FAR }, - }; - - sym = yasm_symtab_declare(object->symtab, name, YASM_SYM_EXTERN, line); - - if (objext_valparams) { - yasm_valparam *vp = yasm_vps_first(objext_valparams); - for (; vp; vp = yasm_vps_next(vp)) { - size_t i; - int match; - - if (!vp->val) { - yasm_warn_set(YASM_WARN_GENERAL, - N_("Unrecognized numeric qualifier")); - continue; - } - - match = 0; - for (i=0; ival, flagnames[i].name) == 0) { - flags |= flagnames[i].flags; - match = 1; - } - } - - if (yasm__strcasecmp(vp->val, "near") == 0) { - flags &= ~SYM_FAR; - match = 1; - } - - if (!match) - yasm_warn_set(YASM_WARN_GENERAL, - N_("Unrecognized qualifier `%s'"), vp->val); - } - } - - /* Remember flags */ - rdf_objfmt_sym_set_data(sym, NULL, 0, flags); - return sym; -} - -static yasm_symrec * -rdf_objfmt_global_declare(yasm_object *object, const char *name, /*@unused@*/ - /*@null@*/ yasm_valparamhead *objext_valparams, - unsigned long line) -{ - yasm_symrec *sym; - unsigned int flags = 0; - - static const struct { - const char *name; - unsigned int flags; - } flagnames[] = { - { "data", SYM_DATA }, - { "object", SYM_DATA }, - { "proc", SYM_FUNCTION }, - { "function", SYM_FUNCTION }, - { "export", SYM_GLOBAL }, - }; - - sym = yasm_symtab_declare(object->symtab, name, YASM_SYM_GLOBAL, line); - - if (objext_valparams) { - yasm_valparam *vp = yasm_vps_first(objext_valparams); - for (; vp; vp = yasm_vps_next(vp)) { - size_t i; - int match; - - if (!vp->val) { - yasm_warn_set(YASM_WARN_GENERAL, - N_("Unrecognized numeric qualifier")); - continue; - } - - match = 0; - for (i=0; ival, flagnames[i].name) == 0) { - flags |= flagnames[i].flags; - match = 1; - } - } - if (!match) - yasm_warn_set(YASM_WARN_GENERAL, - N_("Unrecognized qualifier `%s'"), vp->val); - } - } - - /* Remember flags */ - rdf_objfmt_sym_set_data(sym, NULL, 0, flags); - return sym; -} - -static yasm_symrec * -rdf_objfmt_common_declare(yasm_object *object, const char *name, - /*@only@*/ yasm_expr *size, - yasm_valparamhead *objext_valparams, - unsigned long line) -{ - yasm_symrec *sym; - unsigned long addralign = 0; - - sym = yasm_symtab_declare(object->symtab, name, YASM_SYM_COMMON, line); - - if (objext_valparams) { - yasm_valparam *vp = yasm_vps_first(objext_valparams); - for (; vp; vp = yasm_vps_next(vp)) { - if (!vp->val && vp->param) { - /*@dependent@*/ /*@null@*/ const yasm_intnum *align_expr; - - align_expr = yasm_expr_get_intnum(&vp->param, 0); - if (!align_expr) { - yasm_error_set(YASM_ERROR_VALUE, - N_("alignment constraint is not an integer")); - return sym; - } - addralign = yasm_intnum_get_uint(align_expr); - - /* Alignments must be a power of two. */ - if (!is_exp2(addralign)) { - yasm_error_set(YASM_ERROR_VALUE, - N_("alignment constraint is not a power of two")); - return sym; - } - } else if (vp->val) - yasm_warn_set(YASM_WARN_GENERAL, - N_("Unrecognized qualifier `%s'"), vp->val); - } - } - - /* Remember size and alignment */ - rdf_objfmt_sym_set_data(sym, size, addralign, 0); - return sym; -} - static void rdf_symrec_data_destroy(void *data) { - rdf_symrec_data *rsymd = (rdf_symrec_data *)data; - if (rsymd->size) - yasm_expr_destroy(rsymd->size); yasm_xfree(data); } @@ -1083,47 +1010,17 @@ rdf_symrec_data_print(void *data, FILE *f, int indent_level) rdf_symrec_data *rsymd = (rdf_symrec_data *)data; fprintf(f, "%*ssymtab segment=%u\n", indent_level, "", rsymd->segment); - fprintf(f, "%*ssize=", indent_level, ""); - if (rsymd->size) - yasm_expr_print(rsymd->size, f); - else - fprintf(f, "nil"); - fprintf(f, "%*salign=%lu\n", indent_level, "", rsymd->align); } -static int -rdf_objfmt_directive(yasm_object *object, const char *name, - /*@null@*/ yasm_valparamhead *valparams, - /*@unused@*/ /*@null@*/ - yasm_valparamhead *objext_valparams, unsigned long line) +static void +rdf_objfmt_add_libmodule(yasm_object *object, char *name, int lib) { yasm_objfmt_rdf *objfmt_rdf = (yasm_objfmt_rdf *)object->objfmt; - int lib; - yasm_valparam *vp; xdf_str *str; - if (yasm__strcasecmp(name, "library") == 0) - lib = 1; - else if (yasm__strcasecmp(name, "module") == 0) - lib = 0; - else - return 1; - - if (!valparams) { - yasm_error_set(YASM_ERROR_SYNTAX, N_("[%s] requires an argument"), - name); - return 0; - } - vp = yasm_vps_first(valparams); - if (!vp->val) { - yasm_error_set(YASM_ERROR_SYNTAX, N_("argument to [%s] must be name"), - name); - return 0; - } - /* Add to list */ str = yasm_xmalloc(sizeof(xdf_str)); - str->str = vp->val; + str->str = name; if (lib) STAILQ_INSERT_TAIL(&objfmt_rdf->library_names, str, link); else @@ -1135,11 +1032,25 @@ rdf_objfmt_directive(yasm_object *object, const char *name, MODLIB_NAME_MAX); str->str[MODLIB_NAME_MAX-1] = '\0'; } - - vp->val = NULL; /* don't free it */ - return 0; } +static void +dir_library(yasm_object *object, yasm_valparamhead *valparams, + yasm_valparamhead *objext_valparams, unsigned long line) +{ + yasm_valparam *vp = yasm_vps_first(valparams); + rdf_objfmt_add_libmodule(object, vp->val, 1); + vp->val = NULL; /* don't free it */ +} + +static void +dir_module(yasm_object *object, yasm_valparamhead *valparams, + yasm_valparamhead *objext_valparams, unsigned long line) +{ + yasm_valparam *vp = yasm_vps_first(valparams); + rdf_objfmt_add_libmodule(object, vp->val, 0); + vp->val = NULL; /* don't free it */ +} /* Define valid debug formats to use with this object format */ static const char *rdf_objfmt_dbgfmt_keywords[] = { @@ -1147,6 +1058,12 @@ static const char *rdf_objfmt_dbgfmt_keywords[] = { NULL }; +static const yasm_directive rdf_objfmt_directives[] = { + { "library", "nasm", dir_library, YASM_DIR_ID_REQUIRED }, + { "module", "nasm", dir_module, YASM_DIR_ID_REQUIRED }, + { NULL, NULL, NULL, 0 } +}; + /* Define objfmt structure -- see objfmt.h for details */ yasm_objfmt_module yasm_rdf_LTX_objfmt = { "Relocatable Dynamic Object File Format (RDOFF) v2.0", @@ -1155,13 +1072,10 @@ yasm_objfmt_module yasm_rdf_LTX_objfmt = { 32, rdf_objfmt_dbgfmt_keywords, "null", + rdf_objfmt_directives, rdf_objfmt_create, rdf_objfmt_output, rdf_objfmt_destroy, rdf_objfmt_add_default_section, - rdf_objfmt_section_switch, - rdf_objfmt_extern_declare, - rdf_objfmt_global_declare, - rdf_objfmt_common_declare, - rdf_objfmt_directive + rdf_objfmt_section_switch }; diff --git a/modules/objfmts/rdf/tests/rdfabs.errwarn b/modules/objfmts/rdf/tests/rdfabs.errwarn index 19ecde39..ecaaa3b5 100644 --- a/modules/objfmts/rdf/tests/rdfabs.errwarn +++ b/modules/objfmts/rdf/tests/rdfabs.errwarn @@ -1,2 +1,2 @@ --:2: warning: rdf does not support exporting EQU/absolute values --:4: warning: rdf does not support exporting EQU/absolute values +-:6: warning: rdf does not support exporting EQU/absolute values +-:7: warning: rdf does not support exporting EQU/absolute values diff --git a/modules/objfmts/xdf/xdf-objfmt.c b/modules/objfmts/xdf/xdf-objfmt.c index 9e852216..48bcae38 100644 --- a/modules/objfmts/xdf/xdf-objfmt.c +++ b/modules/objfmts/xdf/xdf-objfmt.c @@ -434,8 +434,16 @@ static int xdf_objfmt_count_sym(yasm_symrec *sym, /*@null@*/ void *d) { /*@null@*/ xdf_objfmt_output_info *info = (xdf_objfmt_output_info *)d; + yasm_sym_vis vis = yasm_symrec_get_visibility(sym); assert(info != NULL); - if (info->all_syms || yasm_symrec_get_visibility(sym) != YASM_SYM_LOCAL) { + if (vis & YASM_SYM_COMMON) { + yasm_error_set(YASM_ERROR_GENERAL, + N_("XDF object format does not support common variables")); + yasm_errwarn_propagate(info->errwarns, yasm_symrec_get_decl_line(sym)); + return 0; + } + if (info->all_syms || + (vis != YASM_SYM_LOCAL && !(vis & YASM_SYM_DLOCAL))) { /* Save index in symrec data */ xdf_symrec_data *sym_data = yasm_xmalloc(sizeof(xdf_symrec_data)); sym_data->index = info->indx; @@ -813,35 +821,6 @@ xdf_section_data_print(void *data, FILE *f, int indent_level) fprintf(f, "%*snreloc=%ld\n", indent_level, "", xsd->nreloc); } -static yasm_symrec * -xdf_objfmt_extern_declare(yasm_object *object, const char *name, /*@unused@*/ - /*@null@*/ yasm_valparamhead *objext_valparams, - unsigned long line) -{ - return yasm_symtab_declare(object->symtab, name, YASM_SYM_EXTERN, line); -} - -static yasm_symrec * -xdf_objfmt_global_declare(yasm_object *object, const char *name, /*@unused@*/ - /*@null@*/ yasm_valparamhead *objext_valparams, - unsigned long line) -{ - return yasm_symtab_declare(object->symtab, name, YASM_SYM_GLOBAL, line); -} - -static yasm_symrec * -xdf_objfmt_common_declare(yasm_object *object, const char *name, - /*@only@*/ yasm_expr *size, /*@unused@*/ /*@null@*/ - yasm_valparamhead *objext_valparams, - unsigned long line) -{ - yasm_expr_destroy(size); - yasm_error_set(YASM_ERROR_GENERAL, - N_("XDF object format does not support common variables")); - - return yasm_symtab_declare(object->symtab, name, YASM_SYM_COMMON, line); -} - static void xdf_symrec_data_destroy(void *data) { @@ -856,18 +835,6 @@ xdf_symrec_data_print(void *data, FILE *f, int indent_level) fprintf(f, "%*ssymtab index=%lu\n", indent_level, "", xsd->index); } -static int -xdf_objfmt_directive(/*@unused@*/ yasm_object *object, - /*@unused@*/ const char *name, - /*@unused@*/ /*@null@*/ yasm_valparamhead *valparams, - /*@unused@*/ /*@null@*/ - yasm_valparamhead *objext_valparams, - /*@unused@*/ unsigned long line) -{ - return 1; /* no objfmt directives */ -} - - /* Define valid debug formats to use with this object format */ static const char *xdf_objfmt_dbgfmt_keywords[] = { "null", @@ -882,13 +849,10 @@ yasm_objfmt_module yasm_xdf_LTX_objfmt = { 32, xdf_objfmt_dbgfmt_keywords, "null", + NULL, /* no directives */ xdf_objfmt_create, xdf_objfmt_output, xdf_objfmt_destroy, xdf_objfmt_add_default_section, - xdf_objfmt_section_switch, - xdf_objfmt_extern_declare, - xdf_objfmt_global_declare, - xdf_objfmt_common_declare, - xdf_objfmt_directive + xdf_objfmt_section_switch }; diff --git a/modules/parsers/gas/gas-parse.c b/modules/parsers/gas/gas-parse.c index 227acf76..2fb0a138 100644 --- a/modules/parsers/gas/gas-parse.c +++ b/modules/parsers/gas/gas-parse.c @@ -42,8 +42,6 @@ RCSID("$Id$"); static yasm_bytecode *parse_line(yasm_parser_gas *parser_gas); static yasm_bytecode *parse_instr(yasm_parser_gas *parser_gas); static int parse_dirvals(yasm_parser_gas *parser_gas, yasm_valparamhead *vps); -static int parse_dirstrvals(yasm_parser_gas *parser_gas, - yasm_valparamhead *vps); static int parse_datavals(yasm_parser_gas *parser_gas, yasm_datavalhead *dvs); static int parse_strvals(yasm_parser_gas *parser_gas, yasm_datavalhead *dvs); static yasm_effaddr *parse_memaddr(yasm_parser_gas *parser_gas); @@ -171,25 +169,18 @@ expect_(yasm_parser_gas *parser_gas, int token) case DIR_COMM: case DIR_DATA: case DIR_ENDR: - case DIR_EXTERN: case DIR_EQU: case DIR_FILE: case DIR_FILL: - case DIR_GLOBAL: - case DIR_IDENT: case DIR_LEB128: case DIR_LINE: - case DIR_LOC: case DIR_LOCAL: case DIR_LCOMM: case DIR_ORG: case DIR_REPT: case DIR_SECTION: case DIR_SECTNAME: - case DIR_SIZE: case DIR_SKIP: - case DIR_TYPE: - case DIR_WEAK: case DIR_ZERO: str = "directive"; break; @@ -253,14 +244,18 @@ parse_line(yasm_parser_gas *parser_gas) switch (curtok) { case ID: id = ID_val; + parser_gas->state = INSTDIR; get_next_token(); /* ID */ if (curtok == ':') { /* Label */ + parser_gas->state = INITIAL; get_next_token(); /* : */ define_label(parser_gas, id, 0); return parse_line(parser_gas); } else if (curtok == '=') { /* EQU */ + /* TODO: allow redefinition, assigning to . (same as .org) */ + parser_gas->state = INITIAL; get_next_token(); /* = */ e = parse_expr(parser_gas); if (e) @@ -271,7 +266,16 @@ parse_line(yasm_parser_gas *parser_gas) yasm_xfree(id); return NULL; } - /* must be an error at this point */ + + /* possibly a directive; try to parse it */ + parse_dirvals(parser_gas, &vps); + if (!yasm_object_directive(p_object, id, "gas", &vps, NULL, + cur_line)) { + yasm_vps_delete(&vps); + yasm_xfree(id); + return NULL; + } + yasm_vps_delete(&vps); if (id[0] == '.') yasm_warn_set(YASM_WARN_GENERAL, N_("directive `%s' not recognized"), id); @@ -399,13 +403,6 @@ parse_line(yasm_parser_gas *parser_gas) yasm_xfree(ID_val); get_next_token(); /* ID */ return NULL; - case DIR_GLOBAL: - get_next_token(); /* DIR_GLOBAL */ - if (!expect(ID)) return NULL; - yasm_objfmt_global_declare(p_object, ID_val, NULL, cur_line); - yasm_xfree(ID_val); - get_next_token(); /* ID */ - return NULL; case DIR_COMM: case DIR_LCOMM: { @@ -441,41 +438,24 @@ parse_line(yasm_parser_gas *parser_gas) define_lcomm(parser_gas, id, e, align); } else if (align) { /* Give third parameter as objext valparam */ - yasm_vps_initialize(&vps); + yasm_valparamhead *extvps = yasm_vps_create(); vp = yasm_vp_create(NULL, align); - yasm_vps_append(&vps, vp); + yasm_vps_append(extvps, vp); - yasm_objfmt_common_declare(p_object, id, e, &vps, cur_line); + sym = yasm_symtab_declare(p_symtab, id, YASM_SYM_COMMON, + cur_line); + yasm_symrec_set_common_size(sym, e); + yasm_symrec_set_objext_valparams(sym, extvps); - yasm_vps_delete(&vps); yasm_xfree(id); } else { - yasm_objfmt_common_declare(p_object, id, e, NULL, cur_line); + sym = yasm_symtab_declare(p_symtab, id, YASM_SYM_COMMON, + cur_line); + yasm_symrec_set_common_size(sym, e); yasm_xfree(id); } return NULL; } - case DIR_EXTERN: - get_next_token(); /* DIR_EXTERN */ - if (!expect(ID)) return NULL; - /* Go ahead and do it, even though all undef become extern */ - yasm_objfmt_extern_declare(p_object, ID_val, NULL, cur_line); - yasm_xfree(ID_val); - get_next_token(); /* ID */ - return NULL; - case DIR_WEAK: - get_next_token(); /* DIR_EXTERN */ - if (!expect(ID)) return NULL; - - yasm_vps_initialize(&vps); - vp = yasm_vp_create(ID_val, NULL); - yasm_vps_append(&vps, vp); - get_next_token(); /* ID */ - - yasm_objfmt_directive(p_object, "weak", &vps, NULL, cur_line); - - yasm_vps_delete(&vps); - return NULL; /* Integer data definition directives */ case DIR_ASCII: @@ -620,13 +600,6 @@ parse_line(yasm_parser_gas *parser_gas) } /* Other directives */ - case DIR_IDENT: - get_next_token(); /* DIR_IDENT */ - if (!parse_dirstrvals(parser_gas, &vps)) - return NULL; - yasm_objfmt_directive(p_object, "ident", &vps, NULL, cur_line); - yasm_vps_delete(&vps); - return NULL; case DIR_FILE: get_next_token(); /* DIR_FILE */ if (curtok == STRING) { @@ -662,7 +635,8 @@ parse_line(yasm_parser_gas *parser_gas) vp = yasm_vp_create(filename, NULL); yasm_vps_append(&vps, vp); - yasm_dbgfmt_directive(p_object, "file", &vps, cur_line); + yasm_object_directive(p_object, ".file", "gas", &vps, NULL, + cur_line); yasm_vps_delete(&vps); return NULL; @@ -685,104 +659,8 @@ parse_line(yasm_parser_gas *parser_gas) yasm_vps_append(&vps, vp); get_next_token(); /* STRING */ - yasm_dbgfmt_directive(p_object, "file", &vps, cur_line); - - yasm_vps_delete(&vps); - return NULL; - case DIR_LOC: - /* INTNUM INTNUM INTNUM */ - get_next_token(); /* DIR_LOC */ - yasm_vps_initialize(&vps); - - if (!expect(INTNUM)) return NULL; - vp = yasm_vp_create(NULL, - p_expr_new_ident(yasm_expr_int(INTNUM_val))); - yasm_vps_append(&vps, vp); - get_next_token(); /* INTNUM */ - - if (!expect(INTNUM)) { - yasm_vps_delete(&vps); - return NULL; - } - vp = yasm_vp_create(NULL, - p_expr_new_ident(yasm_expr_int(INTNUM_val))); - yasm_vps_append(&vps, vp); - get_next_token(); /* INTNUM */ - - if (!expect(INTNUM)) { - yasm_vps_delete(&vps); - return NULL; - } - vp = yasm_vp_create(NULL, - p_expr_new_ident(yasm_expr_int(INTNUM_val))); - yasm_vps_append(&vps, vp); - get_next_token(); /* INTNUM */ - - yasm_dbgfmt_directive(p_object, "loc", &vps, cur_line); - - yasm_vps_delete(&vps); - return NULL; - case DIR_TYPE: - /* ID ',' '@' ID */ - get_next_token(); /* DIR_TYPE */ - yasm_vps_initialize(&vps); - - if (!expect(ID)) return NULL; - vp = yasm_vp_create(ID_val, NULL); - yasm_vps_append(&vps, vp); - get_next_token(); /* ID */ - - if (!expect(',')) { - yasm_vps_delete(&vps); - return NULL; - } - get_next_token(); /* ',' */ - - if (!expect('@')) { - yasm_vps_delete(&vps); - return NULL; - } - get_next_token(); /* '@' */ - - if (!expect(ID)) { - yasm_vps_delete(&vps); - return NULL; - } - vp = yasm_vp_create(ID_val, NULL); - yasm_vps_append(&vps, vp); - get_next_token(); /* ID */ - - yasm_objfmt_directive(p_object, "type", &vps, NULL, cur_line); - - yasm_vps_delete(&vps); - return NULL; - case DIR_SIZE: - /* ID ',' expr */ - get_next_token(); /* DIR_SIZE */ - yasm_vps_initialize(&vps); - - if (!expect(ID)) return NULL; - vp = yasm_vp_create(ID_val, NULL); - yasm_vps_append(&vps, vp); - get_next_token(); /* ID */ - - if (!expect(',')) { - yasm_vps_delete(&vps); - return NULL; - } - get_next_token(); /* ',' */ - - e = parse_expr(parser_gas); - if (!e) { - yasm_error_set(YASM_ERROR_SYNTAX, - N_("expression expected for `.size'")); - yasm_vps_delete(&vps); - return NULL; - } - vp = yasm_vp_create(NULL, e); - yasm_vps_append(&vps, vp); - - yasm_objfmt_directive(p_object, "size", &vps, NULL, cur_line); + yasm_object_directive(p_object, ".file", "gas", &vps, NULL, + cur_line); yasm_vps_delete(&vps); return NULL; @@ -863,45 +741,45 @@ parse_instr(yasm_parser_gas *parser_gas) static int parse_dirvals(yasm_parser_gas *parser_gas, yasm_valparamhead *vps) { + yasm_valparam *vp; yasm_expr *e; - yasm_valparam *vp; int num = 0; yasm_vps_initialize(vps); for (;;) { - e = parse_expr(parser_gas); - vp = yasm_vp_create(NULL, e); - yasm_vps_append(vps, vp); - num++; - if (curtok != ',') - break; - get_next_token(); /* ',' */ - } - return num; -} - -static int -parse_dirstrvals(yasm_parser_gas *parser_gas, yasm_valparamhead *vps) -{ - yasm_valparam *vp; - int num = 0; - - yasm_vps_initialize(vps); - - for (;;) { - if (!expect(STRING)) { - yasm_vps_delete(vps); - yasm_vps_initialize(vps); - return 0; + switch (curtok) { + case ID: + get_peek_token(parser_gas); + if (parser_gas->peek_token == ',' || + is_eol_tok(parser_gas->peek_token)) { + /* Just an ID */ + vp = yasm_vp_create(ID_val, NULL); + get_next_token(); /* ID */ + } else { + e = parse_expr(parser_gas); + vp = yasm_vp_create(NULL, e); + } + break; + case STRING: + vp = yasm_vp_create(STRING_val.contents, NULL); + get_next_token(); /* STRING */ + break; + case '@': + /* XXX: is throwing it away *really* the right thing? */ + get_next_token(); /* @ */ + continue; + default: + e = parse_expr(parser_gas); + if (!e) + return num; + vp = yasm_vp_create(NULL, e); + break; } - vp = yasm_vp_create(STRING_val.contents, NULL); yasm_vps_append(vps, vp); - get_next_token(); /* STRING */ num++; - if (curtok != ',') - break; - get_next_token(); /* ',' */ + if (curtok == ',') + get_next_token(); /* ',' */ } return num; } diff --git a/modules/parsers/gas/gas-parser.h b/modules/parsers/gas/gas-parser.h index 71b293f2..b9661689 100644 --- a/modules/parsers/gas/gas-parser.h +++ b/modules/parsers/gas/gas-parser.h @@ -54,25 +54,18 @@ enum tokentype { DIR_COMM, DIR_DATA, DIR_ENDR, - DIR_EXTERN, DIR_EQU, DIR_FILE, DIR_FILL, - DIR_GLOBAL, - DIR_IDENT, DIR_LEB128, DIR_LINE, - DIR_LOC, DIR_LOCAL, DIR_LCOMM, DIR_ORG, DIR_REPT, DIR_SECTION, DIR_SECTNAME, - DIR_SIZE, DIR_SKIP, - DIR_TYPE, - DIR_WEAK, DIR_ZERO, NONE }; diff --git a/modules/parsers/gas/gas-token.re b/modules/parsers/gas/gas-token.re index b1742bd5..52b331c3 100644 --- a/modules/parsers/gas/gas-token.re +++ b/modules/parsers/gas/gas-token.re @@ -362,12 +362,8 @@ scan: '.org' { parser_gas->state = INSTDIR; RETURN(DIR_ORG); } /* data visibility directives */ '.local' { parser_gas->state = INSTDIR; RETURN(DIR_LOCAL); } - '.global' { parser_gas->state = INSTDIR; RETURN(DIR_GLOBAL); } - '.globl' { parser_gas->state = INSTDIR; RETURN(DIR_GLOBAL); } '.comm' { parser_gas->state = INSTDIR; RETURN(DIR_COMM); } '.lcomm' { parser_gas->state = INSTDIR; RETURN(DIR_LCOMM); } - '.extern' { parser_gas->state = INSTDIR; RETURN(DIR_EXTERN); } - '.weak' { parser_gas->state = INSTDIR; RETURN(DIR_WEAK); } /* integer data declaration directives */ '.byte' { lvalp->int_info = 1; @@ -486,26 +482,10 @@ scan: '.fill' { parser_gas->state = INSTDIR; RETURN(DIR_FILL); } '.zero' { parser_gas->state = INSTDIR; RETURN(DIR_ZERO); } /* other directives */ - '.code16' { - yasm_arch_set_var(p_object->arch, "mode_bits", 16); - goto scan; - } - '.code32' { - yasm_arch_set_var(p_object->arch, "mode_bits", 32); - goto scan; - } - '.code64' { - yasm_arch_set_var(p_object->arch, "mode_bits", 64); - goto scan; - } '.equ' { parser_gas->state = INSTDIR; RETURN(DIR_EQU); } '.file' { parser_gas->state = INSTDIR; RETURN(DIR_FILE); } - '.ident' { parser_gas->state = INSTDIR; RETURN(DIR_IDENT); } '.line' { parser_gas->state = INSTDIR; RETURN(DIR_LINE); } - '.loc' { parser_gas->state = INSTDIR; RETURN(DIR_LOC); } '.set' { parser_gas->state = INSTDIR; RETURN(DIR_EQU); } - '.size' { parser_gas->state = INSTDIR; RETURN(DIR_SIZE); } - '.type' { parser_gas->state = INSTDIR; RETURN(DIR_TYPE); } /* label or maybe directive */ [_.][a-zA-Z0-9_$.]* { diff --git a/modules/parsers/nasm/nasm-parse.c b/modules/parsers/nasm/nasm-parse.c index db115da4..2800efec 100644 --- a/modules/parsers/nasm/nasm-parse.c +++ b/modules/parsers/nasm/nasm-parse.c @@ -1074,98 +1074,22 @@ fix_directive_symrec(yasm_expr__item *ei, void *d) } static void -dir_extern(yasm_parser_nasm *parser_nasm, yasm_valparamhead *valparams, - yasm_valparamhead *objext_valparams) +dir_absolute(yasm_object *object, yasm_valparamhead *valparams, + yasm_valparamhead *objext_valparams, unsigned long line) { yasm_valparam *vp = yasm_vps_first(valparams); - yasm_objfmt_extern_declare(p_object, vp->val, objext_valparams, cur_line); + yasm_expr *start = yasm_vp_expr(vp, object->symtab, line); + + object->cur_section = yasm_object_create_absolute(object, start, line); } static void -dir_global(yasm_parser_nasm *parser_nasm, yasm_valparamhead *valparams, - yasm_valparamhead *objext_valparams) +dir_align(yasm_object *object, yasm_valparamhead *valparams, + yasm_valparamhead *objext_valparams, unsigned long line) { yasm_valparam *vp = yasm_vps_first(valparams); - yasm_objfmt_global_declare(p_object, vp->val, objext_valparams, cur_line); -} - -static void -dir_common(yasm_parser_nasm *parser_nasm, yasm_valparamhead *valparams, - yasm_valparamhead *objext_valparams) -{ - yasm_valparam *vp = yasm_vps_first(valparams); - yasm_valparam *vp2 = yasm_vps_next(vp); - unsigned long line = cur_line; - - if (!vp2 || (!vp2->val && !vp2->param)) { - yasm_error_set(YASM_ERROR_SYNTAX, - N_("no size specified in %s declaration"), "COMMON"); - return; - } - if (vp2->val) { - yasm_objfmt_common_declare(p_object, vp->val, - p_expr_new_ident(yasm_expr_sym( - yasm_symtab_use(p_symtab, vp2->val, line))), - objext_valparams, line); - } else if (vp2->param) { - yasm_objfmt_common_declare(p_object, vp->val, vp2->param, - objext_valparams, line); - vp2->param = NULL; - } -} - -static void -dir_section(yasm_parser_nasm *parser_nasm, yasm_valparamhead *valparams, - yasm_valparamhead *objext_valparams) -{ - yasm_section *new_section = - yasm_objfmt_section_switch(p_object, valparams, objext_valparams, - cur_line); - if (new_section) { - cursect = new_section; - parser_nasm->prev_bc = yasm_section_bcs_last(new_section); - } else - yasm_error_set(YASM_ERROR_SYNTAX, N_("invalid argument to [%s]"), - "SECTION"); -} - -static void -dir_absolute(yasm_parser_nasm *parser_nasm, yasm_valparamhead *valparams, - yasm_valparamhead *objext_valparams) -{ - yasm_valparam *vp = yasm_vps_first(valparams); - unsigned long line = cur_line; - /* it can be just an ID or a complete expression, so handle both. */ - if (vp->val) - cursect = - yasm_object_create_absolute(p_object, - p_expr_new_ident(yasm_expr_sym( - yasm_symtab_use(p_symtab, vp->val, line))), line); - else if (vp->param) { - cursect = - yasm_object_create_absolute(p_object, vp->param, line); - vp->param = NULL; - } - parser_nasm->prev_bc = yasm_section_bcs_last(cursect); -} - -static void -dir_align(yasm_parser_nasm *parser_nasm, yasm_valparamhead *valparams, - yasm_valparamhead *objext_valparams) -{ - /*@only@*/ yasm_expr *boundval; + yasm_expr *boundval = yasm_vp_expr(vp, object->symtab, line); /*@depedent@*/ yasm_intnum *boundintn; - yasm_valparam *vp = yasm_vps_first(valparams); - - /* it can be just an ID or a complete expression, so handle both. */ - vp = yasm_vps_first(valparams); - if (vp->val) - boundval = p_expr_new_ident(yasm_expr_sym( - yasm_symtab_use(p_symtab, vp->val, cur_line))); - else if (vp->param) { - boundval = vp->param; - vp->param = NULL; - } /* Largest .align in the section specifies section alignment. * Note: this doesn't match NASM behavior, but is a lot more @@ -1177,43 +1101,19 @@ dir_align(yasm_parser_nasm *parser_nasm, yasm_valparamhead *valparams, /* Alignments must be a power of two. */ if (is_exp2(boundint)) { - if (boundint > yasm_section_get_align(cursect)) - yasm_section_set_align(cursect, boundint, cur_line); + if (boundint > yasm_section_get_align(object->cur_section)) + yasm_section_set_align(object->cur_section, boundint, line); } } /* As this directive is called only when nop is used as fill, always * use arch (nop) fill. */ - parser_nasm->prev_bc = - yasm_section_bcs_append(cursect, - yasm_bc_create_align(boundval, NULL, NULL, - /*yasm_section_is_code(cursect) ?*/ - yasm_arch_get_fill(p_object->arch)/* : NULL*/, - cur_line)); -} - -static void -dir_cpu(yasm_parser_nasm *parser_nasm, yasm_valparamhead *valparams, - yasm_valparamhead *objext_valparams) -{ - yasm_valparam *vp; - yasm_vps_foreach(vp, valparams) { - if (vp->val) - yasm_arch_parse_cpu(p_object->arch, vp->val, strlen(vp->val)); - else if (vp->param) { - const yasm_intnum *intcpu; - intcpu = yasm_expr_get_intnum(&vp->param, 0); - if (!intcpu) - yasm_error_set(YASM_ERROR_SYNTAX, - N_("invalid argument to [%s]"), "CPU"); - else { - char strcpu[16]; - sprintf(strcpu, "%lu", yasm_intnum_get_uint(intcpu)); - yasm_arch_parse_cpu(p_object->arch, strcpu, strlen(strcpu)); - } - } - } + yasm_section_bcs_append(object->cur_section, + yasm_bc_create_align(boundval, NULL, NULL, + /*yasm_section_is_code(object->cur_section) ?*/ + yasm_arch_get_fill(object->arch)/* : NULL*/, + line)); } static void @@ -1221,57 +1121,21 @@ nasm_parser_directive(yasm_parser_nasm *parser_nasm, const char *name, yasm_valparamhead *valparams, yasm_valparamhead *objext_valparams) { - yasm_valparam *vp; unsigned long line = cur_line; - static const struct { - const char *name; - unsigned int required_arg:1; - unsigned int id_only:1; - void (*func) (yasm_parser_nasm *, yasm_valparamhead *, - yasm_valparamhead *); - } dirs[] = { - {"EXTERN", 1, 1, dir_extern}, - {"GLOBAL", 1, 1, dir_global}, - {"COMMON", 1, 1, dir_common}, - {"SECTION", 1, 0, dir_section}, - {"SEGMENT", 1, 0, dir_section}, - {"ABSOLUTE", 1, 0, dir_absolute}, - {"ALIGN", 1, 0, dir_align}, - {"CPU", 1, 0, dir_cpu} - }; - size_t i; - /* Handle (mostly) output-format independent directives here */ - for (i=0; ival) { - yasm_error_set(YASM_ERROR_SYNTAX, - N_("invalid argument to [%s]"), dirs[i].name); - break; - } - dirs[i].func(parser_nasm, valparams, objext_valparams); - break; - } - } - - if (i != NELEMS(dirs)) { + if (!yasm_object_directive(p_object, name, "nasm", valparams, + objext_valparams, line)) ; - } else if (!yasm_arch_parse_directive(p_object->arch, name, valparams, - objext_valparams, p_object, line)) { - ; - } else if (!yasm_dbgfmt_directive(p_object, name, valparams, line)) { - ; - } else if (yasm_objfmt_directive(p_object, name, valparams, - objext_valparams, line)) { - yasm_error_set(YASM_ERROR_SYNTAX, N_("unrecognized directive [%s]"), + else if (yasm__strcasecmp(name, "absolute") == 0) + dir_absolute(p_object, valparams, objext_valparams, line); + else if (yasm__strcasecmp(name, "align") == 0) + dir_align(p_object, valparams, objext_valparams, line); + else + yasm_error_set(YASM_ERROR_SYNTAX, N_("unrecognized directive `%s'"), name); - } + + /* In case cursect changed or a bytecode was added, update prev_bc. */ + parser_nasm->prev_bc = yasm_section_bcs_last(cursect); if (valparams) yasm_vps_delete(valparams); From 118d3d8fe3acf550c0811f009341379246e5ac3e Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 31 May 2007 06:20:32 +0000 Subject: [PATCH 014/585] Merge [1843] and [1849] from trunk: yasm__strdup() fixes. svn path=/branches/yasm-0.6.x/; revision=1855 --- libyasm/coretype.h | 6 +++--- libyasm/xstrdup.c | 15 +++++++++------ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/libyasm/coretype.h b/libyasm/coretype.h index b07d8d68..7f21b371 100644 --- a/libyasm/coretype.h +++ b/libyasm/coretype.h @@ -325,11 +325,11 @@ int yasm__strncasecmp(const char *s1, const char *s2, size_t n); /** strndup() implementation using yasm_xmalloc(). * \internal - * \param str string - * \param len maximum number of characters to copy + * \param str string + * \param max maximum number of characters to copy * \return Newly allocated duplicate string. */ -/*@only@*/ char *yasm__xstrndup(const char *str, size_t len); +/*@only@*/ char *yasm__xstrndup(const char *str, size_t max); /** Error-checking memory allocation. A default implementation is provided * that calls yasm_fatal() on allocation errors. diff --git a/libyasm/xstrdup.c b/libyasm/xstrdup.c index c52c12cc..cf15ef50 100644 --- a/libyasm/xstrdup.c +++ b/libyasm/xstrdup.c @@ -56,12 +56,15 @@ yasm__xstrdup(const char *str) } char * -yasm__xstrndup(const char *str, size_t len) +yasm__xstrndup(const char *str, size_t max) { - char *copy; + size_t len = 0; + char *copy; - copy = yasm_xmalloc(len+1); - memcpy(copy, str, len); - copy[len] = '\0'; - return (copy); + while (len < max && str[len] != '\0') + len++; + copy = yasm_xmalloc(len+1); + memcpy(copy, str, len); + copy[len] = '\0'; + return (copy); } From f8cd58ab363156ccaad07141be42dae14a61cc89 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 2 Jun 2007 21:48:49 +0000 Subject: [PATCH 015/585] Merge from trunk: [1870]: Correct CPU definitions for Prescott, Conroe, Penryn, and Nehalem. [1854]: Typo correction in [1852]. [1865], [1866], [1867], [1872], [1873]: Bugfixes. svn path=/branches/yasm-0.6.x/; revision=1875 --- libyasm/linemap.c | 4 +++- modules/arch/x86/x86parse.gap | 10 +++++----- modules/objfmts/coff/coff-objfmt.c | 3 ++- modules/objfmts/macho/macho-objfmt.c | 15 +++++++++------ modules/objfmts/macho/tests/nasm32/Makefile.inc | 6 +++--- modules/parsers/nasm/nasm-parse.c | 12 +++++++++--- 6 files changed, 31 insertions(+), 19 deletions(-) diff --git a/libyasm/linemap.c b/libyasm/linemap.c index bf28cb49..c41813b2 100644 --- a/libyasm/linemap.c +++ b/libyasm/linemap.c @@ -131,11 +131,13 @@ yasm_linemap_poke(yasm_linemap *linemap, const char *filename, unsigned long file_line) { unsigned long line; - line_mapping *mapping = &linemap->map->vector[linemap->map->size-1]; + line_mapping *mapping; linemap->current++; yasm_linemap_set(linemap, filename, file_line, 0); + mapping = &linemap->map->vector[linemap->map->size-1]; + line = linemap->current; linemap->current++; diff --git a/modules/arch/x86/x86parse.gap b/modules/arch/x86/x86parse.gap index b94006dd..c9d71411 100644 --- a/modules/arch/x86/x86parse.gap +++ b/modules/arch/x86/x86parse.gap @@ -984,19 +984,19 @@ CPU_ALIAS opteron hammer CPU_ALIAS athlon64 hammer CPU_ALIAS athlon-64 hammer CPU prescott CPU_186|CPU_286|CPU_386|CPU_486|CPU_586|CPU_686|\ - CPU_K6|CPU_Athlon|CPU_Hammer|CPU_EM64T|CPU_FPU|CPU_MMX|\ - CPU_SSE|CPU_SSE2|CPU_SSE3|CPU_3DNow|CPU_SMM|\ + CPU_Hammer|CPU_EM64T|CPU_FPU|CPU_MMX|\ + CPU_SSE|CPU_SSE2|CPU_SSE3|CPU_SMM|\ CPU_Prot|CPU_Priv CPU conroe CPU_186|CPU_286|CPU_386|CPU_486|CPU_586|CPU_686|\ - CPU_EM64T|CPU_FPU|CPU_MMX|\ + CPU_Hammer|CPU_EM64T|CPU_FPU|CPU_MMX|\ CPU_SSE|CPU_SSE2|CPU_SSE3|CPU_SSSE3|CPU_SMM|\ CPU_Prot|CPU_Priv CPU penryn CPU_186|CPU_286|CPU_386|CPU_486|CPU_586|CPU_686|\ - CPU_EM64T|CPU_FPU|CPU_MMX|\ + CPU_Hammer|CPU_EM64T|CPU_FPU|CPU_MMX|\ CPU_SSE|CPU_SSE2|CPU_SSE3|CPU_SSSE3|CPU_SSE41|CPU_SMM|\ CPU_Prot|CPU_Priv CPU nehalem CPU_186|CPU_286|CPU_386|CPU_486|CPU_586|CPU_686|\ - CPU_EM64T|CPU_FPU|CPU_MMX|\ + CPU_Hammer|CPU_EM64T|CPU_FPU|CPU_MMX|\ CPU_SSE|CPU_SSE2|CPU_SSE3|CPU_SSSE3|CPU_SSE41|\ CPU_SSE42|CPU_SMM|CPU_Prot|CPU_Priv diff --git a/modules/objfmts/coff/coff-objfmt.c b/modules/objfmts/coff/coff-objfmt.c index 8c293487..4487f70b 100644 --- a/modules/objfmts/coff/coff-objfmt.c +++ b/modules/objfmts/coff/coff-objfmt.c @@ -311,6 +311,7 @@ win32_objfmt_create(yasm_object *object) "x86") == 0) { objfmt_coff->machine = COFF_MACHINE_I386; objfmt_coff->objfmt.module = &yasm_win32_LTX_objfmt; + objfmt_coff->win64 = 0; } else if (yasm__strcasecmp(yasm_arch_get_machine(object->arch), "amd64") == 0) { objfmt_coff->machine = COFF_MACHINE_AMD64; @@ -1844,7 +1845,7 @@ dir_setframe(yasm_object *object, yasm_valparamhead *valparams, code->loc = get_curpos(object, "SETFRAME", line); code->opcode = UWOP_SET_FPREG; code->info = (unsigned int)(*reg & 0xF); - yasm_value_initialize(&code->off, yasm_expr_copy(off), 8); + yasm_value_initialize(&code->off, off ? yasm_expr_copy(off) : NULL, 8); SLIST_INSERT_HEAD(&objfmt_coff->unwind->codes, code, link); } diff --git a/modules/objfmts/macho/macho-objfmt.c b/modules/objfmts/macho/macho-objfmt.c index 8d174c4e..5a988b91 100644 --- a/modules/objfmts/macho/macho-objfmt.c +++ b/modules/objfmts/macho/macho-objfmt.c @@ -1252,12 +1252,14 @@ macho_objfmt_init_new_section(yasm_object *object, yasm_section *sect, data = yasm_xmalloc(sizeof(macho_section_data)); data->scnum = objfmt_macho->parse_scnum++; - data->segname = yasm__xstrdup(""); - data->sectname = yasm__xstrdup(""); + data->segname = NULL; + data->sectname = NULL; data->flags = S_REGULAR; data->size = 0; - data->nreloc = 0; data->offset = 0; + data->vmoff = 0; + data->nreloc = 0; + data->extreloc = 0; yasm_section_add_data(sect, &macho_section_data_cb, data); sym = yasm_symtab_define_label(object->symtab, sectname, @@ -1504,9 +1506,10 @@ macho_section_data_print(void *data, FILE *f, int indent_level) yasm_symrec_print(msd->sym, f, indent_level + 1); fprintf(f, "%*sscnum=%ld\n", indent_level, "", msd->scnum); fprintf(f, "%*sflags=0x%lx\n", indent_level, "", msd->flags); - fprintf(f, "%*ssize=%ld\n", indent_level, "", msd->size); - fprintf(f, "%*snreloc=%ld\n", indent_level, "", msd->nreloc); - fprintf(f, "%*soffset=%ld\n", indent_level, "", msd->offset); + fprintf(f, "%*ssize=%lu\n", indent_level, "", msd->size); + fprintf(f, "%*snreloc=%lu\n", indent_level, "", msd->nreloc); + fprintf(f, "%*soffset=%lu\n", indent_level, "", msd->offset); + fprintf(f, "%*sextreloc=%u\n", indent_level, "", msd->extreloc); } static void diff --git a/modules/objfmts/macho/tests/nasm32/Makefile.inc b/modules/objfmts/macho/tests/nasm32/Makefile.inc index 0b3a3c5b..1ee18be1 100644 --- a/modules/objfmts/macho/tests/nasm32/Makefile.inc +++ b/modules/objfmts/macho/tests/nasm32/Makefile.inc @@ -8,6 +8,6 @@ EXTRA_DIST += modules/objfmts/macho/tests/nasm32/machotest.asm EXTRA_DIST += modules/objfmts/macho/tests/nasm32/machotest.hex EXTRA_DIST += modules/objfmts/macho/tests/nasm32/macho-reloc.asm EXTRA_DIST += modules/objfmts/macho/tests/nasm32/macho-reloc.hex -EXTRA_DIST += modules/objfmts/macho/tests/nasm32/macho-sect.asm -EXTRA_DIST += modules/objfmts/macho/tests/nasm32/macho-sect.errwarn -EXTRA_DIST += modules/objfmts/macho/tests/nasm32/macho-sect.hex +EXTRA_DIST += modules/objfmts/macho/tests/nasm32/macho32-sect.asm +EXTRA_DIST += modules/objfmts/macho/tests/nasm32/macho32-sect.errwarn +EXTRA_DIST += modules/objfmts/macho/tests/nasm32/macho32-sect.hex diff --git a/modules/parsers/nasm/nasm-parse.c b/modules/parsers/nasm/nasm-parse.c index e11a672b..4d1ae201 100644 --- a/modules/parsers/nasm/nasm-parse.c +++ b/modules/parsers/nasm/nasm-parse.c @@ -436,6 +436,10 @@ parse_directive_valparams(yasm_parser_nasm *parser_nasm, /*@fallthrough@*/ default: e = parse_expr(parser_nasm, DIR_EXPR); + if (!e) { + yasm_vps_delete(vps); + return 0; + } vp = yasm_vp_create_expr(id, e); break; } @@ -1100,8 +1104,7 @@ dir_align(yasm_object *object, yasm_valparamhead *valparams, * Note: this doesn't match NASM behavior, but is a lot more * intelligent! */ - boundintn = yasm_expr_get_intnum(&boundval, 0); - if (boundintn) { + if (boundval && (boundintn = yasm_expr_get_intnum(&boundval, 0))) { unsigned long boundint = yasm_intnum_get_uint(boundintn); /* Alignments must be a power of two. */ @@ -1144,7 +1147,7 @@ nasm_parser_directive(yasm_parser_nasm *parser_nasm, const char *name, parser_nasm->prev_bc = NULL; } else if (yasm__strcasecmp(name, "align") == 0) { /* Really, we shouldn't end up with an align directive in an absolute - * section (as it's supposed to be only used for nop fill, but handle + * section (as it's supposed to be only used for nop fill), but handle * it gracefully anyway. */ if (parser_nasm->abspos) { @@ -1163,6 +1166,9 @@ nasm_parser_directive(yasm_parser_nasm *parser_nasm, const char *name, cur_line); parser_nasm->abspos = yasm_expr_create_tree( parser_nasm->abspos, YASM_EXPR_ADD, e, cur_line); + } else if (!valparams) { + yasm_error_set(YASM_ERROR_SYNTAX, + N_("directive `%s' requires an argument"), "align"); } else dir_align(p_object, valparams, objext_valparams, line); } else From 3935d48ade52a45558f7b01e202f7fcce601713f Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 2 Jun 2007 21:50:51 +0000 Subject: [PATCH 016/585] Merge [1827] from trunk: Update all copyright dates. This brings 0.6.x branch up-to-date with trunk except for whitespace conversion. svn path=/branches/yasm-0.6.x/; revision=1876 --- frontends/yasm/yasm.c | 2 +- genstring.c | 2 +- libyasm.h | 2 +- libyasm/arch.c | 2 +- libyasm/arch.h | 2 +- libyasm/assocdat.c | 2 +- libyasm/assocdat.h | 2 +- libyasm/bc-align.c | 2 +- libyasm/bc-data.c | 2 +- libyasm/bc-incbin.c | 2 +- libyasm/bc-insn.c | 2 +- libyasm/bc-int.h | 2 +- libyasm/bc-org.c | 2 +- libyasm/bc-reserve.c | 2 +- libyasm/bytecode.c | 2 +- libyasm/bytecode.h | 2 +- libyasm/coretype.h | 2 +- libyasm/dbgfmt.h | 2 +- libyasm/errwarn.c | 2 +- libyasm/errwarn.h | 2 +- libyasm/expr-int.h | 2 +- libyasm/expr.c | 2 +- libyasm/expr.h | 2 +- libyasm/file.c | 2 +- libyasm/file.h | 2 +- libyasm/floatnum.c | 2 +- libyasm/floatnum.h | 2 +- libyasm/genmodule.c | 2 +- libyasm/hamt.c | 2 +- libyasm/hamt.h | 2 +- libyasm/intnum.c | 2 +- libyasm/intnum.h | 2 +- libyasm/linemap.c | 2 +- libyasm/linemap.h | 2 +- libyasm/listfmt.h | 2 +- libyasm/module.h | 2 +- libyasm/module.in | 2 +- libyasm/objfmt.h | 2 +- libyasm/parser.h | 2 +- libyasm/preproc.h | 2 +- libyasm/section.c | 2 +- libyasm/section.h | 2 +- libyasm/symrec.c | 2 +- libyasm/symrec.h | 2 +- libyasm/tests/bitvect_test.c | 2 +- libyasm/tests/combpath_test.c | 2 +- libyasm/tests/floatnum_test.c | 2 +- libyasm/tests/leb128_test.c | 2 +- libyasm/tests/splitpath_test.c | 2 +- libyasm/tests/uncstring_test.c | 2 +- libyasm/valparam.c | 2 +- libyasm/valparam.h | 2 +- libyasm/value.c | 2 +- libyasm/value.h | 2 +- libyasm/xmalloc.c | 2 +- modules/arch/lc3b/lc3barch.c | 2 +- modules/arch/lc3b/lc3barch.h | 2 +- modules/arch/lc3b/lc3bbc.c | 2 +- modules/arch/lc3b/lc3bid.re | 2 +- modules/arch/x86/x86arch.c | 2 +- modules/arch/x86/x86arch.h | 2 +- modules/arch/x86/x86bc.c | 2 +- modules/arch/x86/x86expr.c | 2 +- modules/arch/x86/x86id.c | 2 +- modules/dbgfmts/codeview/cv-dbgfmt.c | 2 +- modules/dbgfmts/codeview/cv-dbgfmt.h | 2 +- modules/dbgfmts/codeview/cv-symline.c | 2 +- modules/dbgfmts/codeview/cv-type.c | 2 +- modules/dbgfmts/dwarf2/dwarf2-aranges.c | 2 +- modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c | 2 +- modules/dbgfmts/dwarf2/dwarf2-dbgfmt.h | 2 +- modules/dbgfmts/dwarf2/dwarf2-info.c | 2 +- modules/dbgfmts/dwarf2/dwarf2-line.c | 2 +- modules/dbgfmts/null/null-dbgfmt.c | 2 +- modules/dbgfmts/stabs/stabs-dbgfmt.c | 2 +- modules/listfmts/nasm/nasm-listfmt.c | 2 +- modules/objfmts/bin/bin-objfmt.c | 2 +- modules/objfmts/coff/coff-objfmt.c | 2 +- modules/objfmts/dbg/dbg-objfmt.c | 2 +- modules/objfmts/elf/elf-machine.h | 2 +- modules/objfmts/elf/elf-objfmt.c | 2 +- modules/objfmts/elf/elf-x86-amd64.c | 2 +- modules/objfmts/elf/elf-x86-x86.c | 2 +- modules/objfmts/elf/elf.c | 2 +- modules/objfmts/elf/elf.h | 2 +- modules/objfmts/rdf/rdf-objfmt.c | 2 +- modules/objfmts/xdf/xdf-objfmt.c | 2 +- modules/parsers/gas/gas-parse.c | 2 +- modules/parsers/gas/gas-parser.c | 2 +- modules/parsers/gas/gas-parser.h | 2 +- modules/parsers/gas/gas-token.re | 2 +- modules/parsers/nasm/nasm-parse.c | 2 +- modules/parsers/nasm/nasm-parser.c | 2 +- modules/parsers/nasm/nasm-parser.h | 2 +- modules/parsers/nasm/nasm-token.re | 2 +- modules/preprocs/nasm/genmacro.c | 2 +- modules/preprocs/nasm/genversion.c | 2 +- modules/preprocs/nasm/nasm-preproc.c | 2 +- modules/preprocs/raw/raw-preproc.c | 2 +- test_hd.c | 2 +- tools/gap/gap.c | 2 +- tools/xdf/xdfdump.c | 2 +- util.h | 2 +- 103 files changed, 103 insertions(+), 103 deletions(-) diff --git a/frontends/yasm/yasm.c b/frontends/yasm/yasm.c index 58bf2c02..268ddec0 100644 --- a/frontends/yasm/yasm.c +++ b/frontends/yasm/yasm.c @@ -1,7 +1,7 @@ /* * Program entry point, command line parsing * - * Copyright (C) 2001 Peter Johnson + * Copyright (C) 2001-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/genstring.c b/genstring.c index 78f7c451..df87d7b8 100644 --- a/genstring.c +++ b/genstring.c @@ -2,7 +2,7 @@ * * Generate array-of-const-string from text file. * - * Copyright (C) 2006 Peter Johnson + * Copyright (C) 2006-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm.h b/libyasm.h index b13abc28..ec92aa53 100644 --- a/libyasm.h +++ b/libyasm.h @@ -7,7 +7,7 @@ * \endrcs * * \license - * Copyright (C) 2003 Peter Johnson + * Copyright (C) 2003-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/arch.c b/libyasm/arch.c index dd849ebc..c0527f41 100644 --- a/libyasm/arch.c +++ b/libyasm/arch.c @@ -1,7 +1,7 @@ /* * Architecture interface * - * Copyright (C) 2001 Peter Johnson + * Copyright (C) 2001-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/arch.h b/libyasm/arch.h index 6ee9cdd9..9c4557cb 100644 --- a/libyasm/arch.h +++ b/libyasm/arch.h @@ -7,7 +7,7 @@ * \endrcs * * \license - * Copyright (C) 2002 Peter Johnson + * Copyright (C) 2002-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/assocdat.c b/libyasm/assocdat.c index 83d12b88..4e58269f 100644 --- a/libyasm/assocdat.c +++ b/libyasm/assocdat.c @@ -1,7 +1,7 @@ /* * YASM associated data storage (libyasm internal use) * - * Copyright (C) 2003 Peter Johnson + * Copyright (C) 2003-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/assocdat.h b/libyasm/assocdat.h index 5cce0e73..49f6b4e6 100644 --- a/libyasm/assocdat.h +++ b/libyasm/assocdat.h @@ -7,7 +7,7 @@ * \endrcs * * \license - * Copyright (C) 2003 Peter Johnson + * Copyright (C) 2003-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/bc-align.c b/libyasm/bc-align.c index 0a3a3a78..3c077aaa 100644 --- a/libyasm/bc-align.c +++ b/libyasm/bc-align.c @@ -1,7 +1,7 @@ /* * Align bytecode * - * Copyright (C) 2005-2006 Peter Johnson + * Copyright (C) 2005-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/bc-data.c b/libyasm/bc-data.c index 8a32f72a..f1a71720 100644 --- a/libyasm/bc-data.c +++ b/libyasm/bc-data.c @@ -1,7 +1,7 @@ /* * Data (and LEB128) bytecode * - * Copyright (C) 2001-2006 Peter Johnson + * Copyright (C) 2001-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/bc-incbin.c b/libyasm/bc-incbin.c index 79c1a9fb..0f8c776d 100644 --- a/libyasm/bc-incbin.c +++ b/libyasm/bc-incbin.c @@ -1,7 +1,7 @@ /* * Incbin bytecode * - * Copyright (C) 2001-2006 Peter Johnson + * Copyright (C) 2001-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/bc-insn.c b/libyasm/bc-insn.c index b4d9ce1b..f163a74e 100644 --- a/libyasm/bc-insn.c +++ b/libyasm/bc-insn.c @@ -1,7 +1,7 @@ /* * Insn bytecode * - * Copyright (C) 2005-2006 Peter Johnson + * Copyright (C) 2005-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/bc-int.h b/libyasm/bc-int.h index 5bcd22e3..e162b227 100644 --- a/libyasm/bc-int.h +++ b/libyasm/bc-int.h @@ -1,7 +1,7 @@ /* $Id$ * Bytecode internal structures header file * - * Copyright (C) 2001 Peter Johnson + * Copyright (C) 2001-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/bc-org.c b/libyasm/bc-org.c index 67b278e8..70056e50 100644 --- a/libyasm/bc-org.c +++ b/libyasm/bc-org.c @@ -1,7 +1,7 @@ /* * ORG bytecode * - * Copyright (C) 2005-2006 Peter Johnson + * Copyright (C) 2005-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/bc-reserve.c b/libyasm/bc-reserve.c index 1a442758..5b680365 100644 --- a/libyasm/bc-reserve.c +++ b/libyasm/bc-reserve.c @@ -1,7 +1,7 @@ /* * Bytecode utility functions * - * Copyright (C) 2001 Peter Johnson + * Copyright (C) 2001-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/bytecode.c b/libyasm/bytecode.c index 8812ff27..6881e6c6 100644 --- a/libyasm/bytecode.c +++ b/libyasm/bytecode.c @@ -1,7 +1,7 @@ /* * Bytecode utility functions * - * Copyright (C) 2001 Peter Johnson + * Copyright (C) 2001-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/bytecode.h b/libyasm/bytecode.h index 3e9325ac..2861becf 100644 --- a/libyasm/bytecode.h +++ b/libyasm/bytecode.h @@ -7,7 +7,7 @@ * \endrcs * * \license - * Copyright (C) 2001 Peter Johnson + * Copyright (C) 2001-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/coretype.h b/libyasm/coretype.h index 7f21b371..d0007a67 100644 --- a/libyasm/coretype.h +++ b/libyasm/coretype.h @@ -7,7 +7,7 @@ * \endrcs * * \license - * Copyright (C) 2001 Peter Johnson + * Copyright (C) 2001-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/dbgfmt.h b/libyasm/dbgfmt.h index 021127e7..41d4eac8 100644 --- a/libyasm/dbgfmt.h +++ b/libyasm/dbgfmt.h @@ -7,7 +7,7 @@ * \endrcs * * \license - * Copyright (C) 2002 Peter Johnson + * Copyright (C) 2002-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/errwarn.c b/libyasm/errwarn.c index 17fef16b..04d8420f 100644 --- a/libyasm/errwarn.c +++ b/libyasm/errwarn.c @@ -1,7 +1,7 @@ /* * Error and warning reporting and related functions. * - * Copyright (C) 2001 Peter Johnson + * Copyright (C) 2001-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/errwarn.h b/libyasm/errwarn.h index 64b73b59..c83626ea 100644 --- a/libyasm/errwarn.h +++ b/libyasm/errwarn.h @@ -7,7 +7,7 @@ * \endrcs * * \license - * Copyright (C) 2001 Peter Johnson + * Copyright (C) 2001-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/expr-int.h b/libyasm/expr-int.h index c5e0689e..4a3abd9b 100644 --- a/libyasm/expr-int.h +++ b/libyasm/expr-int.h @@ -1,7 +1,7 @@ /* $Id$ * Expressions internal structures header file * - * Copyright (C) 2001 Peter Johnson + * Copyright (C) 2001-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/expr.c b/libyasm/expr.c index 4495b28f..42ab312f 100644 --- a/libyasm/expr.c +++ b/libyasm/expr.c @@ -1,7 +1,7 @@ /* * Expression handling * - * Copyright (C) 2001 Michael Urman, Peter Johnson + * Copyright (C) 2001-2007 Michael Urman, Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/expr.h b/libyasm/expr.h index 59f0cd00..86723db5 100644 --- a/libyasm/expr.h +++ b/libyasm/expr.h @@ -7,7 +7,7 @@ * \endrcs * * \license - * Copyright (C) 2001 Michael Urman, Peter Johnson + * Copyright (C) 2001-2007 Michael Urman, Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/file.c b/libyasm/file.c index 403be057..9e158ea9 100644 --- a/libyasm/file.c +++ b/libyasm/file.c @@ -1,7 +1,7 @@ /* * File helper functions. * - * Copyright (C) 2001-2006 Peter Johnson + * Copyright (C) 2001-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/file.h b/libyasm/file.h index e739cfd1..215d0f22 100644 --- a/libyasm/file.h +++ b/libyasm/file.h @@ -7,7 +7,7 @@ * \endrcs * * \license - * Copyright (C) 2001-2006 Peter Johnson + * Copyright (C) 2001-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/floatnum.c b/libyasm/floatnum.c index 0436b612..3f50dda5 100644 --- a/libyasm/floatnum.c +++ b/libyasm/floatnum.c @@ -1,7 +1,7 @@ /* * Floating point number functions. * - * Copyright (C) 2001 Peter Johnson + * Copyright (C) 2001-2007 Peter Johnson * * Based on public-domain x86 assembly code by Randall Hyde (8/28/91). * diff --git a/libyasm/floatnum.h b/libyasm/floatnum.h index 3e488f10..f855aaa6 100644 --- a/libyasm/floatnum.h +++ b/libyasm/floatnum.h @@ -7,7 +7,7 @@ * \endrcs * * \license - * Copyright (C) 2001 Peter Johnson + * Copyright (C) 2001-2007 Peter Johnson * * Based on public-domain x86 assembly code by Randall Hyde (8/28/91). * diff --git a/libyasm/genmodule.c b/libyasm/genmodule.c index ee35c830..d15d2d8b 100644 --- a/libyasm/genmodule.c +++ b/libyasm/genmodule.c @@ -2,7 +2,7 @@ * * Generate module.c from module.in and Makefile.am or Makefile. * - * Copyright (C) 2004 Peter Johnson + * Copyright (C) 2004-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/hamt.c b/libyasm/hamt.c index c6617b6d..57e6378b 100644 --- a/libyasm/hamt.c +++ b/libyasm/hamt.c @@ -1,7 +1,7 @@ /* * Hash Array Mapped Trie (HAMT) implementation * - * Copyright (C) 2001 Peter Johnson + * Copyright (C) 2001-2007 Peter Johnson * * Based on the paper "Ideal Hash Tries" by Phil Bagwell [2000]. * One algorithmic change from that described in the paper: we use the LSB's diff --git a/libyasm/hamt.h b/libyasm/hamt.h index 88204eda..8b01ce8d 100644 --- a/libyasm/hamt.h +++ b/libyasm/hamt.h @@ -7,7 +7,7 @@ * \endrcs * * \license - * Copyright (C) 2001 Peter Johnson + * Copyright (C) 2001-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/intnum.c b/libyasm/intnum.c index 3b3ad374..5e157e69 100644 --- a/libyasm/intnum.c +++ b/libyasm/intnum.c @@ -1,7 +1,7 @@ /* * Integer number functions. * - * Copyright (C) 2001 Peter Johnson + * Copyright (C) 2001-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/intnum.h b/libyasm/intnum.h index f6c44c6e..69caf88b 100644 --- a/libyasm/intnum.h +++ b/libyasm/intnum.h @@ -7,7 +7,7 @@ * \endrcs * * \license - * Copyright (C) 2001 Peter Johnson + * Copyright (C) 2001-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/linemap.c b/libyasm/linemap.c index c41813b2..5fb14520 100644 --- a/libyasm/linemap.c +++ b/libyasm/linemap.c @@ -1,7 +1,7 @@ /* * YASM assembler virtual line mapping handling (for parse stage) * - * Copyright (C) 2002 Peter Johnson + * Copyright (C) 2002-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/linemap.h b/libyasm/linemap.h index 411d995e..310da195 100644 --- a/libyasm/linemap.h +++ b/libyasm/linemap.h @@ -7,7 +7,7 @@ * \endrcs * * \license - * Copyright (C) 2002 Peter Johnson + * Copyright (C) 2002-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/listfmt.h b/libyasm/listfmt.h index 3d3a72a4..f410bbc6 100644 --- a/libyasm/listfmt.h +++ b/libyasm/listfmt.h @@ -7,7 +7,7 @@ * \endrcs * * \license - * Copyright (C) 2004 Peter Johnson + * Copyright (C) 2004-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/module.h b/libyasm/module.h index 4606057f..11e6c527 100644 --- a/libyasm/module.h +++ b/libyasm/module.h @@ -1,7 +1,7 @@ /* $Id$ * YASM module loader header file * - * Copyright (C) 2002 Peter Johnson + * Copyright (C) 2002-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/module.in b/libyasm/module.in index 09fefbec..f3b69420 100644 --- a/libyasm/module.in +++ b/libyasm/module.in @@ -1,7 +1,7 @@ /* * YASM module loader * - * Copyright (C) 2004 Peter Johnson + * Copyright (C) 2004-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/objfmt.h b/libyasm/objfmt.h index ce610b06..b9981759 100644 --- a/libyasm/objfmt.h +++ b/libyasm/objfmt.h @@ -7,7 +7,7 @@ * \endrcs * * \license - * Copyright (C) 2001 Peter Johnson + * Copyright (C) 2001-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/parser.h b/libyasm/parser.h index e85b217e..14c2d409 100644 --- a/libyasm/parser.h +++ b/libyasm/parser.h @@ -7,7 +7,7 @@ * \endrcs * * \license - * Copyright (C) 2001 Peter Johnson + * Copyright (C) 2001-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/preproc.h b/libyasm/preproc.h index 96b13173..7d16b735 100644 --- a/libyasm/preproc.h +++ b/libyasm/preproc.h @@ -7,7 +7,7 @@ * \endrcs * * \license - * Copyright (C) 2001 Peter Johnson + * Copyright (C) 2001-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/section.c b/libyasm/section.c index 5338e109..d1299729 100644 --- a/libyasm/section.c +++ b/libyasm/section.c @@ -1,7 +1,7 @@ /* * Section utility functions * - * Copyright (C) 2001-2005 Peter Johnson + * Copyright (C) 2001-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/section.h b/libyasm/section.h index d0ad4db5..04c5f33c 100644 --- a/libyasm/section.h +++ b/libyasm/section.h @@ -7,7 +7,7 @@ * \endrcs * * \license - * Copyright (C) 2001 Peter Johnson + * Copyright (C) 2001-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/symrec.c b/libyasm/symrec.c index e2ecf7f9..9f51afd2 100644 --- a/libyasm/symrec.c +++ b/libyasm/symrec.c @@ -1,7 +1,7 @@ /* * Symbol table handling * - * Copyright (C) 2001 Michael Urman, Peter Johnson + * Copyright (C) 2001-2007 Michael Urman, Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/symrec.h b/libyasm/symrec.h index 624a3e98..0426bc82 100644 --- a/libyasm/symrec.h +++ b/libyasm/symrec.h @@ -7,7 +7,7 @@ * \endrcs * * \license - * Copyright (C) 2001 Michael Urman, Peter Johnson + * Copyright (C) 2001-2007 Michael Urman, Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/tests/bitvect_test.c b/libyasm/tests/bitvect_test.c index 3887046c..d000b515 100644 --- a/libyasm/tests/bitvect_test.c +++ b/libyasm/tests/bitvect_test.c @@ -1,6 +1,6 @@ /* $Id$ * - * Copyright (C) 2001 Peter Johnson + * Copyright (C) 2001-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/tests/combpath_test.c b/libyasm/tests/combpath_test.c index 5667cc7d..55f3d498 100644 --- a/libyasm/tests/combpath_test.c +++ b/libyasm/tests/combpath_test.c @@ -1,6 +1,6 @@ /* $Id$ * - * Copyright (C) 2006 Peter Johnson + * Copyright (C) 2006-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/tests/floatnum_test.c b/libyasm/tests/floatnum_test.c index a08ee9d6..69b27c18 100644 --- a/libyasm/tests/floatnum_test.c +++ b/libyasm/tests/floatnum_test.c @@ -1,6 +1,6 @@ /* $Id$ * - * Copyright (C) 2001 Peter Johnson + * Copyright (C) 2001-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/tests/leb128_test.c b/libyasm/tests/leb128_test.c index f2e45852..7699152b 100644 --- a/libyasm/tests/leb128_test.c +++ b/libyasm/tests/leb128_test.c @@ -1,6 +1,6 @@ /* $Id$ * - * Copyright (C) 2005 Peter Johnson + * Copyright (C) 2005-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/tests/splitpath_test.c b/libyasm/tests/splitpath_test.c index c96d907a..b24ab23f 100644 --- a/libyasm/tests/splitpath_test.c +++ b/libyasm/tests/splitpath_test.c @@ -1,6 +1,6 @@ /* $Id$ * - * Copyright (C) 2006 Peter Johnson + * Copyright (C) 2006-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/tests/uncstring_test.c b/libyasm/tests/uncstring_test.c index 22ca3fc3..351d3cc5 100644 --- a/libyasm/tests/uncstring_test.c +++ b/libyasm/tests/uncstring_test.c @@ -1,6 +1,6 @@ /* $Id$ * - * Copyright (C) 2006 Peter Johnson + * Copyright (C) 2006-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/valparam.c b/libyasm/valparam.c index 33a65fa5..b142f22e 100644 --- a/libyasm/valparam.c +++ b/libyasm/valparam.c @@ -1,7 +1,7 @@ /* * Value/Parameter type functions * - * Copyright (C) 2001 Peter Johnson + * Copyright (C) 2001-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/valparam.h b/libyasm/valparam.h index bcdbf40c..b3023a6d 100644 --- a/libyasm/valparam.h +++ b/libyasm/valparam.h @@ -7,7 +7,7 @@ * \endrcs * * \license - * Copyright (C) 2001 Peter Johnson + * Copyright (C) 2001-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/value.c b/libyasm/value.c index 90cfeeb3..dc8d6f42 100644 --- a/libyasm/value.c +++ b/libyasm/value.c @@ -1,7 +1,7 @@ /* * Value handling * - * Copyright (C) 2006 Peter Johnson + * Copyright (C) 2006-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/value.h b/libyasm/value.h index 043c4651..787b3e49 100644 --- a/libyasm/value.h +++ b/libyasm/value.h @@ -7,7 +7,7 @@ * \endrcs * * \license - * Copyright (C) 2006 Peter Johnson + * Copyright (C) 2006-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/libyasm/xmalloc.c b/libyasm/xmalloc.c index 5f947d97..261f593b 100644 --- a/libyasm/xmalloc.c +++ b/libyasm/xmalloc.c @@ -1,7 +1,7 @@ /* * Memory allocation routines with error checking. Idea from GNU libiberty. * - * Copyright (C) 2001 Peter Johnson + * Copyright (C) 2001-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modules/arch/lc3b/lc3barch.c b/modules/arch/lc3b/lc3barch.c index bbf28956..a691ffbf 100644 --- a/modules/arch/lc3b/lc3barch.c +++ b/modules/arch/lc3b/lc3barch.c @@ -1,7 +1,7 @@ /* * LC-3b architecture description * - * Copyright (C) 2003 Peter Johnson + * Copyright (C) 2003-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modules/arch/lc3b/lc3barch.h b/modules/arch/lc3b/lc3barch.h index 7d199bb9..e4c5ab2e 100644 --- a/modules/arch/lc3b/lc3barch.h +++ b/modules/arch/lc3b/lc3barch.h @@ -1,7 +1,7 @@ /* $Id$ * LC-3b Architecture header file * - * Copyright (C) 2003 Peter Johnson + * Copyright (C) 2003-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modules/arch/lc3b/lc3bbc.c b/modules/arch/lc3b/lc3bbc.c index 59e607fa..4d7496f6 100644 --- a/modules/arch/lc3b/lc3bbc.c +++ b/modules/arch/lc3b/lc3bbc.c @@ -1,7 +1,7 @@ /* * LC-3b bytecode utility functions * - * Copyright (C) 2003 Peter Johnson + * Copyright (C) 2003-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modules/arch/lc3b/lc3bid.re b/modules/arch/lc3b/lc3bid.re index 0c7e82a4..2dce1a4b 100644 --- a/modules/arch/lc3b/lc3bid.re +++ b/modules/arch/lc3b/lc3bid.re @@ -1,7 +1,7 @@ /* * LC-3b identifier recognition and instruction handling * - * Copyright (C) 2003 Peter Johnson + * Copyright (C) 2003-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modules/arch/x86/x86arch.c b/modules/arch/x86/x86arch.c index d6319bfb..1f41503c 100644 --- a/modules/arch/x86/x86arch.c +++ b/modules/arch/x86/x86arch.c @@ -1,7 +1,7 @@ /* * x86 architecture description * - * Copyright (C) 2002 Peter Johnson + * Copyright (C) 2002-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modules/arch/x86/x86arch.h b/modules/arch/x86/x86arch.h index d7aea71c..52f9f7b0 100644 --- a/modules/arch/x86/x86arch.h +++ b/modules/arch/x86/x86arch.h @@ -1,7 +1,7 @@ /* $Id$ * x86 Architecture header file * - * Copyright (C) 2001 Peter Johnson + * Copyright (C) 2001-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modules/arch/x86/x86bc.c b/modules/arch/x86/x86bc.c index 4dbe3089..b41b356b 100644 --- a/modules/arch/x86/x86bc.c +++ b/modules/arch/x86/x86bc.c @@ -1,7 +1,7 @@ /* * x86 bytecode utility functions * - * Copyright (C) 2001 Peter Johnson + * Copyright (C) 2001-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modules/arch/x86/x86expr.c b/modules/arch/x86/x86expr.c index 33d246e0..de73b204 100644 --- a/modules/arch/x86/x86expr.c +++ b/modules/arch/x86/x86expr.c @@ -1,7 +1,7 @@ /* * x86 expression handling * - * Copyright (C) 2001 Peter Johnson + * Copyright (C) 2001-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modules/arch/x86/x86id.c b/modules/arch/x86/x86id.c index 24647b83..a121e1d3 100644 --- a/modules/arch/x86/x86id.c +++ b/modules/arch/x86/x86id.c @@ -1,7 +1,7 @@ /* * x86 identifier recognition and instruction handling * - * Copyright (C) 2002 Peter Johnson + * Copyright (C) 2002-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modules/dbgfmts/codeview/cv-dbgfmt.c b/modules/dbgfmts/codeview/cv-dbgfmt.c index 6ec6407d..0c69afbe 100644 --- a/modules/dbgfmts/codeview/cv-dbgfmt.c +++ b/modules/dbgfmts/codeview/cv-dbgfmt.c @@ -1,7 +1,7 @@ /* * CodeView debugging formats implementation for Yasm * - * Copyright (C) 2006 Peter Johnson + * Copyright (C) 2006-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modules/dbgfmts/codeview/cv-dbgfmt.h b/modules/dbgfmts/codeview/cv-dbgfmt.h index 3e8db324..1e146e22 100644 --- a/modules/dbgfmts/codeview/cv-dbgfmt.h +++ b/modules/dbgfmts/codeview/cv-dbgfmt.h @@ -1,7 +1,7 @@ /* $Id$ * CodeView debugging formats implementation for Yasm * - * Copyright (C) 2006 Peter Johnson + * Copyright (C) 2006-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modules/dbgfmts/codeview/cv-symline.c b/modules/dbgfmts/codeview/cv-symline.c index 068ac566..94cf1ef9 100644 --- a/modules/dbgfmts/codeview/cv-symline.c +++ b/modules/dbgfmts/codeview/cv-symline.c @@ -1,7 +1,7 @@ /* * CodeView debugging format - symbol and line information * - * Copyright (C) 2006 Peter Johnson + * Copyright (C) 2006-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modules/dbgfmts/codeview/cv-type.c b/modules/dbgfmts/codeview/cv-type.c index ecec7f9b..f92f1884 100644 --- a/modules/dbgfmts/codeview/cv-type.c +++ b/modules/dbgfmts/codeview/cv-type.c @@ -1,7 +1,7 @@ /* * CodeView debugging format - type information * - * Copyright (C) 2006 Peter Johnson + * Copyright (C) 2006-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modules/dbgfmts/dwarf2/dwarf2-aranges.c b/modules/dbgfmts/dwarf2/dwarf2-aranges.c index e277cdaa..8e93d3f6 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-aranges.c +++ b/modules/dbgfmts/dwarf2/dwarf2-aranges.c @@ -1,7 +1,7 @@ /* * DWARF2 debugging format - address range table * - * Copyright (C) 2006 Peter Johnson + * Copyright (C) 2006-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c b/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c index e498f0d1..9836fd54 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c +++ b/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c @@ -1,7 +1,7 @@ /* * DWARF2 debugging format * - * Copyright (C) 2006 Peter Johnson + * Copyright (C) 2006-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.h b/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.h index eeba0a19..6ed9d1e2 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.h +++ b/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.h @@ -1,7 +1,7 @@ /* $Id$ * DWARF2 debugging format * - * Copyright (C) 2006 Peter Johnson + * Copyright (C) 2006-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modules/dbgfmts/dwarf2/dwarf2-info.c b/modules/dbgfmts/dwarf2/dwarf2-info.c index f17db488..5ae66479 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-info.c +++ b/modules/dbgfmts/dwarf2/dwarf2-info.c @@ -1,7 +1,7 @@ /* * DWARF2 debugging format - info and abbreviation tables * - * Copyright (C) 2006 Peter Johnson + * Copyright (C) 2006-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modules/dbgfmts/dwarf2/dwarf2-line.c b/modules/dbgfmts/dwarf2/dwarf2-line.c index bba7f409..0ebd0ef3 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-line.c +++ b/modules/dbgfmts/dwarf2/dwarf2-line.c @@ -1,7 +1,7 @@ /* * DWARF2 debugging format - line information * - * Copyright (C) 2006 Peter Johnson + * Copyright (C) 2006-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modules/dbgfmts/null/null-dbgfmt.c b/modules/dbgfmts/null/null-dbgfmt.c index 44766934..6baac617 100644 --- a/modules/dbgfmts/null/null-dbgfmt.c +++ b/modules/dbgfmts/null/null-dbgfmt.c @@ -1,7 +1,7 @@ /* * Null debugging format (creates NO debugging information) * - * Copyright (C) 2002 Peter Johnson + * Copyright (C) 2002-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modules/dbgfmts/stabs/stabs-dbgfmt.c b/modules/dbgfmts/stabs/stabs-dbgfmt.c index 1942d4b1..c7409e52 100644 --- a/modules/dbgfmts/stabs/stabs-dbgfmt.c +++ b/modules/dbgfmts/stabs/stabs-dbgfmt.c @@ -1,7 +1,7 @@ /* * Stabs debugging format * - * Copyright (C) 2003 Michael Urman + * Copyright (C) 2003-2007 Michael Urman * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modules/listfmts/nasm/nasm-listfmt.c b/modules/listfmts/nasm/nasm-listfmt.c index 0e0f24b2..1d76f82a 100644 --- a/modules/listfmts/nasm/nasm-listfmt.c +++ b/modules/listfmts/nasm/nasm-listfmt.c @@ -1,7 +1,7 @@ /* * NASM-style list format * - * Copyright (C) 2004 Peter Johnson + * Copyright (C) 2004-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modules/objfmts/bin/bin-objfmt.c b/modules/objfmts/bin/bin-objfmt.c index 1d93c3b8..cdbefe20 100644 --- a/modules/objfmts/bin/bin-objfmt.c +++ b/modules/objfmts/bin/bin-objfmt.c @@ -1,7 +1,7 @@ /* * Flat-format binary object format * - * Copyright (C) 2002 Peter Johnson + * Copyright (C) 2002-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modules/objfmts/coff/coff-objfmt.c b/modules/objfmts/coff/coff-objfmt.c index 4487f70b..e6cd735e 100644 --- a/modules/objfmts/coff/coff-objfmt.c +++ b/modules/objfmts/coff/coff-objfmt.c @@ -1,7 +1,7 @@ /* * COFF (DJGPP) object format * - * Copyright (C) 2002 Peter Johnson + * Copyright (C) 2002-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modules/objfmts/dbg/dbg-objfmt.c b/modules/objfmts/dbg/dbg-objfmt.c index f3f7cba1..74d7a572 100644 --- a/modules/objfmts/dbg/dbg-objfmt.c +++ b/modules/objfmts/dbg/dbg-objfmt.c @@ -1,7 +1,7 @@ /* * Debugging object format (used to debug object format module interface) * - * Copyright (C) 2001 Peter Johnson + * Copyright (C) 2001-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modules/objfmts/elf/elf-machine.h b/modules/objfmts/elf/elf-machine.h index bec98dbf..8b8a8dd6 100644 --- a/modules/objfmts/elf/elf-machine.h +++ b/modules/objfmts/elf/elf-machine.h @@ -1,7 +1,7 @@ /* $Id:$ * ELF object machine specific format helpers * - * Copyright (C) 2004 Michael Urman + * Copyright (C) 2004-2007 Michael Urman * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modules/objfmts/elf/elf-objfmt.c b/modules/objfmts/elf/elf-objfmt.c index 0642ac52..bca3efd5 100644 --- a/modules/objfmts/elf/elf-objfmt.c +++ b/modules/objfmts/elf/elf-objfmt.c @@ -1,7 +1,7 @@ /* * ELF object format * - * Copyright (C) 2003 Michael Urman + * Copyright (C) 2003-2007 Michael Urman * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modules/objfmts/elf/elf-x86-amd64.c b/modules/objfmts/elf/elf-x86-amd64.c index 2d0f1fd6..9459beb5 100644 --- a/modules/objfmts/elf/elf-x86-amd64.c +++ b/modules/objfmts/elf/elf-x86-amd64.c @@ -1,7 +1,7 @@ /* * ELF object format helpers - x86:amd64 * - * Copyright (C) 2004 Michael Urman + * Copyright (C) 2004-2007 Michael Urman * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modules/objfmts/elf/elf-x86-x86.c b/modules/objfmts/elf/elf-x86-x86.c index f49e7e04..0e006b4c 100644 --- a/modules/objfmts/elf/elf-x86-x86.c +++ b/modules/objfmts/elf/elf-x86-x86.c @@ -1,7 +1,7 @@ /* * ELF object format helpers - x86:x86 * - * Copyright (C) 2004 Michael Urman + * Copyright (C) 2004-2007 Michael Urman * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modules/objfmts/elf/elf.c b/modules/objfmts/elf/elf.c index 52b69ec8..39e06950 100644 --- a/modules/objfmts/elf/elf.c +++ b/modules/objfmts/elf/elf.c @@ -1,7 +1,7 @@ /* * ELF object format helpers * - * Copyright (C) 2003 Michael Urman + * Copyright (C) 2003-2007 Michael Urman * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modules/objfmts/elf/elf.h b/modules/objfmts/elf/elf.h index c78c5f9b..5efe859e 100644 --- a/modules/objfmts/elf/elf.h +++ b/modules/objfmts/elf/elf.h @@ -1,7 +1,7 @@ /* $Id$ * ELF object format helpers * - * Copyright (C) 2003 Michael Urman + * Copyright (C) 2003-2007 Michael Urman * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modules/objfmts/rdf/rdf-objfmt.c b/modules/objfmts/rdf/rdf-objfmt.c index fc5d1af5..4a788b81 100644 --- a/modules/objfmts/rdf/rdf-objfmt.c +++ b/modules/objfmts/rdf/rdf-objfmt.c @@ -1,7 +1,7 @@ /* * Relocatable Dynamic Object File Format (RDOFF) version 2 format * - * Copyright (C) 2006 Peter Johnson + * Copyright (C) 2006-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modules/objfmts/xdf/xdf-objfmt.c b/modules/objfmts/xdf/xdf-objfmt.c index aacd6417..4fd9a97c 100644 --- a/modules/objfmts/xdf/xdf-objfmt.c +++ b/modules/objfmts/xdf/xdf-objfmt.c @@ -1,7 +1,7 @@ /* * Extended Dynamic Object format * - * Copyright (C) 2004 Peter Johnson + * Copyright (C) 2004-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modules/parsers/gas/gas-parse.c b/modules/parsers/gas/gas-parse.c index 4a6030d6..0439ce33 100644 --- a/modules/parsers/gas/gas-parse.c +++ b/modules/parsers/gas/gas-parse.c @@ -1,7 +1,7 @@ /* * GAS-compatible parser * - * Copyright (C) 2005 Peter Johnson + * Copyright (C) 2005-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modules/parsers/gas/gas-parser.c b/modules/parsers/gas/gas-parser.c index f929cb90..a4a6ebda 100644 --- a/modules/parsers/gas/gas-parser.c +++ b/modules/parsers/gas/gas-parser.c @@ -1,7 +1,7 @@ /* * GAS-compatible parser * - * Copyright (C) 2005 Peter Johnson + * Copyright (C) 2005-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modules/parsers/gas/gas-parser.h b/modules/parsers/gas/gas-parser.h index b9661689..23f17412 100644 --- a/modules/parsers/gas/gas-parser.h +++ b/modules/parsers/gas/gas-parser.h @@ -1,7 +1,7 @@ /* $Id$ * GAS-compatible parser header file * - * Copyright (C) 2005 Peter Johnson + * Copyright (C) 2005-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modules/parsers/gas/gas-token.re b/modules/parsers/gas/gas-token.re index 52b331c3..e2073183 100644 --- a/modules/parsers/gas/gas-token.re +++ b/modules/parsers/gas/gas-token.re @@ -1,7 +1,7 @@ /* * GAS-compatible re2c lexer * - * Copyright (C) 2005 Peter Johnson + * Copyright (C) 2005-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modules/parsers/nasm/nasm-parse.c b/modules/parsers/nasm/nasm-parse.c index 4d1ae201..14ad8d09 100644 --- a/modules/parsers/nasm/nasm-parse.c +++ b/modules/parsers/nasm/nasm-parse.c @@ -1,7 +1,7 @@ /* * NASM-compatible parser * - * Copyright (C) 2001 Peter Johnson, Michael Urman + * Copyright (C) 2001-2007 Peter Johnson, Michael Urman * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modules/parsers/nasm/nasm-parser.c b/modules/parsers/nasm/nasm-parser.c index d395fc3e..5ca7dcb9 100644 --- a/modules/parsers/nasm/nasm-parser.c +++ b/modules/parsers/nasm/nasm-parser.c @@ -1,7 +1,7 @@ /* * NASM-compatible parser * - * Copyright (C) 2001 Peter Johnson + * Copyright (C) 2001-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modules/parsers/nasm/nasm-parser.h b/modules/parsers/nasm/nasm-parser.h index 65eae204..d2b078e2 100644 --- a/modules/parsers/nasm/nasm-parser.h +++ b/modules/parsers/nasm/nasm-parser.h @@ -1,7 +1,7 @@ /* $Id$ * NASM-compatible parser header file * - * Copyright (C) 2002 Peter Johnson + * Copyright (C) 2002-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modules/parsers/nasm/nasm-token.re b/modules/parsers/nasm/nasm-token.re index 008fe953..a534442a 100644 --- a/modules/parsers/nasm/nasm-token.re +++ b/modules/parsers/nasm/nasm-token.re @@ -1,7 +1,7 @@ /* * NASM-compatible re2c lexer * - * Copyright (C) 2001 Peter Johnson + * Copyright (C) 2001-2007 Peter Johnson * * Portions based on re2c's example code. * diff --git a/modules/preprocs/nasm/genmacro.c b/modules/preprocs/nasm/genmacro.c index 47d3ff37..ff56976f 100644 --- a/modules/preprocs/nasm/genmacro.c +++ b/modules/preprocs/nasm/genmacro.c @@ -2,7 +2,7 @@ * * C version of NASM's macros.pl * - * Copyright (C) 2004 Peter Johnson + * Copyright (C) 2004-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modules/preprocs/nasm/genversion.c b/modules/preprocs/nasm/genversion.c index 30b7fccb..d654ca19 100644 --- a/modules/preprocs/nasm/genversion.c +++ b/modules/preprocs/nasm/genversion.c @@ -2,7 +2,7 @@ * * Generate version.mac * - * Copyright (C) 2006 Peter Johnson + * Copyright (C) 2006-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modules/preprocs/nasm/nasm-preproc.c b/modules/preprocs/nasm/nasm-preproc.c index 5702a1d1..9db354dc 100644 --- a/modules/preprocs/nasm/nasm-preproc.c +++ b/modules/preprocs/nasm/nasm-preproc.c @@ -1,7 +1,7 @@ /* * Imported NASM preprocessor - glue code * - * Copyright (C) 2002 Peter Johnson + * Copyright (C) 2002-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modules/preprocs/raw/raw-preproc.c b/modules/preprocs/raw/raw-preproc.c index fa318caa..aaf04afe 100644 --- a/modules/preprocs/raw/raw-preproc.c +++ b/modules/preprocs/raw/raw-preproc.c @@ -1,7 +1,7 @@ /* * Raw preprocessor (preforms NO preprocessing) * - * Copyright (C) 2001 Peter Johnson + * Copyright (C) 2001-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/test_hd.c b/test_hd.c index d3c5e9ea..54838e6a 100644 --- a/test_hd.c +++ b/test_hd.c @@ -2,7 +2,7 @@ * * Simple hexidecimal dump, two hex digits per line. * - * Copyright (C) 2004 Peter Johnson + * Copyright (C) 2004-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/tools/gap/gap.c b/tools/gap/gap.c index b9069f20..c4aaf807 100644 --- a/tools/gap/gap.c +++ b/tools/gap/gap.c @@ -2,7 +2,7 @@ * * Generate Arch Parser (GAP): generates ARCHparse.c from ARCHparse.gap. * - * Copyright (C) 2006 Peter Johnson + * Copyright (C) 2006-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/tools/xdf/xdfdump.c b/tools/xdf/xdfdump.c index c970d7a1..e1ee2510 100644 --- a/tools/xdf/xdfdump.c +++ b/tools/xdf/xdfdump.c @@ -1,7 +1,7 @@ /* $Id$ * Extended Dynamic Object format dumper * - * Copyright (C) 2004 Peter Johnson + * Copyright (C) 2004-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/util.h b/util.h index 842f0211..c820c716 100644 --- a/util.h +++ b/util.h @@ -4,7 +4,7 @@ * Includes standard headers and defines prototypes for replacement functions * if needed. * - * Copyright (C) 2001 Peter Johnson + * Copyright (C) 2001-2007 Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions From f901c76f6caf9bae9e692c98bb80890917d003d2 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 6 Jun 2007 03:24:02 +0000 Subject: [PATCH 017/585] Bump version numbers for release. svn path=/tags/yasm-0.6.1/; revision=1881 --- Mkfiles/dj/config.h | 8 ++++---- Mkfiles/vc/config.h | 6 +++--- Mkfiles/vc8/config.h | 6 +++--- configure.ac | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Mkfiles/dj/config.h b/Mkfiles/dj/config.h index c5f7a8e3..dfc7ddda 100644 --- a/Mkfiles/dj/config.h +++ b/Mkfiles/dj/config.h @@ -120,7 +120,7 @@ #define PACKAGE_BUGREPORT "bug-yasm@tortall.net" /* Define to build version of this package. */ -#define PACKAGE_BUILD "BRANCH" +#define PACKAGE_BUILD "1880" /* Define to internal version of this package. */ #define PACKAGE_INTVER "0.6.1" @@ -129,13 +129,13 @@ #define PACKAGE_NAME "yasm" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "yasm 0.6.x" +#define PACKAGE_STRING "yasm 0.6.1" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "yasm" /* Define to the version of this package. */ -#define PACKAGE_VERSION "0.6.x" +#define PACKAGE_VERSION "0.6.1" /* Define if the C compiler supports function prototypes. */ #define PROTOTYPES 1 @@ -159,7 +159,7 @@ #define STDC_HEADERS 1 /* Version number of package */ -#define VERSION "0.6.x" +#define VERSION "0.6.1" /* Define if using the dmalloc debugging malloc package */ /* #undef WITH_DMALLOC */ diff --git a/Mkfiles/vc/config.h b/Mkfiles/vc/config.h index ec7329ac..f1c55405 100644 --- a/Mkfiles/vc/config.h +++ b/Mkfiles/vc/config.h @@ -130,13 +130,13 @@ #define PACKAGE_NAME "yasm" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "yasm 0.6.x" +#define PACKAGE_STRING "yasm 0.6.1" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "yasm" /* Define to the version of this package. */ -#define PACKAGE_VERSION "0.6.x" +#define PACKAGE_VERSION "0.6.1" /* Define if the C compiler supports function prototypes. */ #define PROTOTYPES 1 @@ -160,7 +160,7 @@ #define STDC_HEADERS 1 /* Version number of package */ -#define VERSION "0.6.x" +#define VERSION "0.6.1" /* Define if using the dmalloc debugging malloc package */ /* #undef WITH_DMALLOC */ diff --git a/Mkfiles/vc8/config.h b/Mkfiles/vc8/config.h index f8483f71..75c731de 100644 --- a/Mkfiles/vc8/config.h +++ b/Mkfiles/vc8/config.h @@ -130,13 +130,13 @@ #define PACKAGE_NAME "yasm" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "yasm 0.6.x" +#define PACKAGE_STRING "yasm 0.6.1" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "yasm" /* Define to the version of this package. */ -#define PACKAGE_VERSION "0.6.x" +#define PACKAGE_VERSION "0.6.1" /* Define if the C compiler supports function prototypes. */ #define PROTOTYPES 1 @@ -160,7 +160,7 @@ #define STDC_HEADERS 1 /* Version number of package */ -#define VERSION "0.6.x" +#define VERSION "0.6.1" /* Define if using the dmalloc debugging malloc package */ /* #undef WITH_DMALLOC */ diff --git a/configure.ac b/configure.ac index 324746ab..a6616c8f 100644 --- a/configure.ac +++ b/configure.ac @@ -5,17 +5,17 @@ # autoconf setup # AC_PREREQ(2.53) -AC_INIT([yasm], [0.6.x], [bug-yasm@tortall.net]) +AC_INIT([yasm], [0.6.1], [bug-yasm@tortall.net]) #AC_CONFIG_SRCDIR([src/main.c]) AC_CONFIG_AUX_DIR(config) AM_CONFIG_HEADER([config.h]) -AM_INIT_AUTOMAKE(yasm, [0.6.x]) +AM_INIT_AUTOMAKE(yasm, [0.6.1]) AM_MAINTAINER_MODE AC_DEFINE(PACKAGE_INTVER, ["0.6.1"], [Define to internal version of this package.]) -AC_DEFINE(PACKAGE_BUILD, ["BRANCH"], [Define to build version of this package.]) +AC_DEFINE(PACKAGE_BUILD, ["1880"], [Define to build version of this package.]) # # autoconf command-line options From 9d14c17d5e47f272167f2aeef9228b8ff4fba449 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 10 Jun 2007 03:44:27 +0000 Subject: [PATCH 018/585] 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 --- modules/objfmts/bin/bin-objfmt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/objfmts/bin/bin-objfmt.c b/modules/objfmts/bin/bin-objfmt.c index 2e7fd727..496c412b 100644 --- a/modules/objfmts/bin/bin-objfmt.c +++ b/modules/objfmts/bin/bin-objfmt.c @@ -160,7 +160,7 @@ bin_objfmt_output_value(yasm_value *value, unsigned char *buf, yasm_expr_expr(sube), bc->line); value->curpos_rel = 0; value->ip_rel = 0; - } else + } if (value->rshift > 0) syme = yasm_expr_create(YASM_EXPR_SHR, yasm_expr_expr(syme), From 0a3b9a84629d7be4f1104452d1757b9f039b1124 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 23 Jun 2007 00:19:57 +0000 Subject: [PATCH 019/585] Fix default filename buffer overflow. Note: this is not a security issue. Noticed by: Mike Frysinger svn path=/trunk/yasm/; revision=1884 --- frontends/yasm/yasm.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/frontends/yasm/yasm.c b/frontends/yasm/yasm.c index 2aaa90e1..77571742 100644 --- a/frontends/yasm/yasm.c +++ b/frontends/yasm/yasm.c @@ -1135,9 +1135,17 @@ replace_extension(const char *orig, /*@null@*/ const char *ext, const char *def) { char *out, *outext; + size_t deflen, outlen; /* allocate enough space for full existing name + extension */ - out = yasm_xmalloc(strlen(orig)+(ext ? (strlen(ext)+2) : 1)); + outlen = strlen(orig) + 2; + if (ext) + outlen += strlen(ext) + 1; + deflen = strlen(def) + 1; + if (outlen < deflen) + outlen = deflen; + out = yasm_xmalloc(outlen); + strcpy(out, orig); outext = strrchr(out, '.'); if (outext) { From 81ef8abfe5aa9924aa0594ac99e977c98030a82f Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Mon, 25 Jun 2007 01:05:04 +0000 Subject: [PATCH 020/585] 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 --- libyasm/expr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libyasm/expr.c b/libyasm/expr.c index e32b4776..c392cdf3 100644 --- a/libyasm/expr.c +++ b/libyasm/expr.c @@ -869,7 +869,8 @@ expr_level_tree(yasm_expr *e, int fold_const, int simplify_ident, e->op = YASM_EXPR_IDENT; e->terms[0].data.expn->op = YASM_EXPR_IDENT; /* Destroy the second (offset) term */ - expr_delete_term(&e->terms[1], 1); + e->terms[0].data.expn->numterms = 1; + expr_delete_term(&e->terms[0].data.expn->terms[1], 1); } /* do callback */ From 7949bdf4e08a9e0003eb28e9ae2d70e48e4426af Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 30 Jun 2007 19:46:36 +0000 Subject: [PATCH 021/585] Optimize negating a simple intnum. svn path=/trunk/yasm/; revision=1886 --- libyasm/expr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libyasm/expr.c b/libyasm/expr.c index c392cdf3..470184df 100644 --- a/libyasm/expr.c +++ b/libyasm/expr.c @@ -420,6 +420,8 @@ expr_xform_neg_helper(/*@returned@*/ /*@only@*/ yasm_expr *e) */ if (e->terms[0].type == YASM_EXPR_FLOAT) yasm_floatnum_calc(e->terms[0].data.flt, YASM_EXPR_NEG, NULL); + else if (e->terms[0].type == YASM_EXPR_INT) + yasm_intnum_calc(e->terms[0].data.intn, YASM_EXPR_NEG, NULL); else if (e->terms[0].type == YASM_EXPR_EXPR && yasm_expr__contains(e->terms[0].data.expn, YASM_EXPR_FLOAT)) expr_xform_neg_helper(e->terms[0].data.expn); From 685920384f54e991ad61e7fd232fd28e35a0fb60 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 30 Jun 2007 20:18:50 +0000 Subject: [PATCH 022/585] Update splint script. svn path=/trunk/yasm/; revision=1887 --- splint.sh | 95 ++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 69 insertions(+), 26 deletions(-) diff --git a/splint.sh b/splint.sh index 03d1867f..0a119281 100755 --- a/splint.sh +++ b/splint.sh @@ -11,33 +11,76 @@ splint \ -retvalother \ -shiftimplementation \ -shiftnegative \ + -fixedformalarray \ +ansi89limits \ - -I/usr/local/include \ - -Isrc \ - -Isrc/arch/x86 \ + +ansistrictlib \ + +trytorecover \ + -globs \ -I. \ + -I/usr/local/include \ -DHAVE_CONFIG_H \ - -DHAVE_BOGUS_SYS_QUEUE_H \ -Dlint \ - src/main.c \ - src/options.c \ - src/arch.c \ - src/bytecode.c \ - src/errwarn.c \ - src/expr.c \ - src/file.c \ - src/floatnum.c \ - src/globals.c \ - src/intnum.c \ - src/parser.c \ - src/section.c \ - src/arch/x86/x86arch.c \ - src/arch/x86/x86bc.c \ - src/arch/x86/x86expr.c \ - src/objfmts/dbg/dbg-objfmt.c \ - src/objfmts/bin/bin-objfmt.c \ - src/parsers/nasm/nasm-parser.c \ - src/preprocs/raw/raw-preproc.c \ - src/optimizers/basic/basic-optimizer.c \ - src/symrec.c \ - src/hamt.c + frontends/yasm/yasm-options.c \ + frontends/yasm/yasm.c \ + libyasm/arch.c \ + libyasm/assocdat.c \ + libyasm/bc-align.c \ + libyasm/bc-data.c \ + libyasm/bc-incbin.c \ + libyasm/bc-insn.c \ + libyasm/bc-org.c \ + libyasm/bc-reserve.c \ + libyasm/bytecode.c \ + libyasm/errwarn.c \ + libyasm/expr.c \ + libyasm/file.c \ + libyasm/floatnum.c \ + libyasm/hamt.c \ + libyasm/intnum.c \ + libyasm/inttree.c \ + libyasm/linemap.c \ + libyasm/md5.c \ + libyasm/mergesort.c \ + libyasm/phash.c \ + libyasm/section.c \ + libyasm/strcasecmp.c \ + libyasm/strsep.c \ + libyasm/symrec.c \ + libyasm/valparam.c \ + libyasm/value.c \ + libyasm/xmalloc.c \ + libyasm/xstrdup.c \ + modules/arch/lc3b/lc3barch.c \ + modules/arch/lc3b/lc3bbc.c \ + modules/arch/x86/x86arch.c \ + modules/arch/x86/x86bc.c \ + modules/arch/x86/x86expr.c \ + modules/arch/x86/x86id.c \ + modules/dbgfmts/codeview/cv-dbgfmt.c \ + modules/dbgfmts/codeview/cv-symline.c \ + modules/dbgfmts/codeview/cv-type.c \ + modules/dbgfmts/dwarf2/dwarf2-aranges.c \ + modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c \ + modules/dbgfmts/dwarf2/dwarf2-info.c \ + modules/dbgfmts/dwarf2/dwarf2-line.c \ + modules/dbgfmts/null/null-dbgfmt.c \ + modules/dbgfmts/stabs/stabs-dbgfmt.c \ + modules/listfmts/nasm/nasm-listfmt.c \ + modules/objfmts/bin/bin-objfmt.c \ + modules/objfmts/coff/coff-objfmt.c \ + modules/objfmts/coff/win64-except.c \ + modules/objfmts/dbg/dbg-objfmt.c \ + modules/objfmts/elf/elf-objfmt.c \ + modules/objfmts/elf/elf-x86-amd64.c \ + modules/objfmts/elf/elf-x86-x86.c \ + modules/objfmts/elf/elf.c \ + modules/objfmts/macho/macho-objfmt.c \ + modules/objfmts/rdf/rdf-objfmt.c \ + modules/objfmts/xdf/xdf-objfmt.c \ + modules/parsers/gas/gas-parse.c \ + modules/parsers/gas/gas-parser.c \ + modules/parsers/nasm/nasm-parse.c \ + modules/parsers/nasm/nasm-parser.c \ + modules/preprocs/nasm/nasm-preproc.c \ + modules/preprocs/raw/raw-preproc.c + From 608d246f9379b34adda82254035585d667f2a3c4 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 30 Jun 2007 20:19:20 +0000 Subject: [PATCH 023/585] Properly mark yasm_arch->create() error parameter as an output param. svn path=/trunk/yasm/; revision=1888 --- libyasm/arch.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libyasm/arch.h b/libyasm/arch.h index f6e23ae3..1daa4f37 100644 --- a/libyasm/arch.h +++ b/libyasm/arch.h @@ -114,7 +114,7 @@ typedef struct yasm_arch_module { * Call yasm_arch_create() instead of calling this function. */ /*@only@*/ yasm_arch * (*create) (const char *machine, const char *parser, - yasm_arch_create_error *error); + /*@out@*/ yasm_arch_create_error *error); /** Module-level implementation of yasm_arch_destroy(). * Call yasm_arch_destroy() instead of calling this function. From fb8b8b893614301b3a81cc02fc112213228833a1 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 8 Jul 2007 05:31:59 +0000 Subject: [PATCH 024/585] 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 --- libyasm.h | 1 + libyasm/Makefile.inc | 4 +- libyasm/arch.c | 217 ------------------- libyasm/arch.h | 270 ++++++----------------- libyasm/bc-insn.c | 334 ----------------------------- libyasm/bc-int.h | 17 +- libyasm/bytecode.c | 27 +++ libyasm/bytecode.h | 135 +----------- libyasm/coretype.h | 12 +- libyasm/insn.c | 310 ++++++++++++++++++++++++++ libyasm/insn.h | 248 +++++++++++++++++++++ modules/arch/x86/x86arch.c | 18 +- modules/arch/x86/x86arch.h | 42 ++-- modules/arch/x86/x86bc.c | 50 ++--- modules/arch/x86/x86id.c | 317 +++++++++++++++++---------- modules/parsers/gas/gas-parse.c | 55 +++-- modules/parsers/gas/gas-parser.h | 5 +- modules/parsers/gas/gas-token.re | 12 +- modules/parsers/nasm/nasm-parse.c | 69 +++--- modules/parsers/nasm/nasm-parser.h | 5 +- modules/parsers/nasm/nasm-token.re | 12 +- 21 files changed, 1027 insertions(+), 1133 deletions(-) delete mode 100644 libyasm/arch.c delete mode 100644 libyasm/bc-insn.c create mode 100644 libyasm/insn.c create mode 100644 libyasm/insn.h diff --git a/libyasm.h b/libyasm.h index ec92aa53..8fb7aca7 100644 --- a/libyasm.h +++ b/libyasm.h @@ -73,6 +73,7 @@ typedef unsigned long uintptr_t; #include #include +#include #include #include diff --git a/libyasm/Makefile.inc b/libyasm/Makefile.inc index 2fc87633..98dbfa68 100644 --- a/libyasm/Makefile.inc +++ b/libyasm/Makefile.inc @@ -1,12 +1,10 @@ # $Id$ -libyasm_a_SOURCES += libyasm/arch.c libyasm_a_SOURCES += libyasm/assocdat.c libyasm_a_SOURCES += libyasm/bitvect.c libyasm_a_SOURCES += libyasm/bc-align.c libyasm_a_SOURCES += libyasm/bc-data.c libyasm_a_SOURCES += libyasm/bc-incbin.c -libyasm_a_SOURCES += libyasm/bc-insn.c libyasm_a_SOURCES += libyasm/bc-org.c libyasm_a_SOURCES += libyasm/bc-reserve.c libyasm_a_SOURCES += libyasm/bytecode.c @@ -15,6 +13,7 @@ libyasm_a_SOURCES += libyasm/expr.c libyasm_a_SOURCES += libyasm/file.c libyasm_a_SOURCES += libyasm/floatnum.c libyasm_a_SOURCES += libyasm/hamt.c +libyasm_a_SOURCES += libyasm/insn.c libyasm_a_SOURCES += libyasm/intnum.c libyasm_a_SOURCES += libyasm/inttree.c libyasm_a_SOURCES += libyasm/linemap.c @@ -65,6 +64,7 @@ modinclude_HEADERS += libyasm/expr-int.h modinclude_HEADERS += libyasm/file.h modinclude_HEADERS += libyasm/floatnum.h modinclude_HEADERS += libyasm/hamt.h +modinclude_HEADERS += libyasm/insn.h modinclude_HEADERS += libyasm/intnum.h modinclude_HEADERS += libyasm/inttree.h modinclude_HEADERS += libyasm/linemap.h diff --git a/libyasm/arch.c b/libyasm/arch.c deleted file mode 100644 index e16f6ca7..00000000 --- a/libyasm/arch.c +++ /dev/null @@ -1,217 +0,0 @@ -/* - * Architecture interface - * - * Copyright (C) 2001-2007 Peter Johnson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ -#define YASM_LIB_INTERNAL -#define YASM_ARCH_INTERNAL -#include "util.h" -/*@unused@*/ RCSID("$Id$"); - -#include "libyasm-stdint.h" -#include "coretype.h" - -#include "expr.h" - -#include "bytecode.h" - -#include "arch.h" - - -yasm_insn_operand * -yasm_operand_create_reg(uintptr_t reg) -{ - yasm_insn_operand *retval = yasm_xmalloc(sizeof(yasm_insn_operand)); - - retval->type = YASM_INSN__OPERAND_REG; - retval->data.reg = reg; - retval->targetmod = 0; - retval->size = 0; - retval->deref = 0; - retval->strict = 0; - - return retval; -} - -yasm_insn_operand * -yasm_operand_create_segreg(uintptr_t segreg) -{ - yasm_insn_operand *retval = yasm_xmalloc(sizeof(yasm_insn_operand)); - - retval->type = YASM_INSN__OPERAND_SEGREG; - retval->data.reg = segreg; - retval->targetmod = 0; - retval->size = 0; - retval->deref = 0; - retval->strict = 0; - - return retval; -} - -yasm_insn_operand * -yasm_operand_create_mem(/*@only@*/ yasm_effaddr *ea) -{ - yasm_insn_operand *retval = yasm_xmalloc(sizeof(yasm_insn_operand)); - - retval->type = YASM_INSN__OPERAND_MEMORY; - retval->data.ea = ea; - retval->targetmod = 0; - retval->size = 0; - retval->deref = 0; - retval->strict = 0; - - return retval; -} - -yasm_insn_operand * -yasm_operand_create_imm(/*@only@*/ yasm_expr *val) -{ - yasm_insn_operand *retval; - const uintptr_t *reg; - - reg = yasm_expr_get_reg(&val, 0); - if (reg) { - retval = yasm_operand_create_reg(*reg); - yasm_expr_destroy(val); - } else { - retval = yasm_xmalloc(sizeof(yasm_insn_operand)); - retval->type = YASM_INSN__OPERAND_IMM; - retval->data.val = val; - retval->targetmod = 0; - retval->size = 0; - retval->deref = 0; - retval->strict = 0; - } - - return retval; -} - -void -yasm_operand_print(const yasm_insn_operand *op, FILE *f, int indent_level, - yasm_arch *arch) -{ - switch (op->type) { - case YASM_INSN__OPERAND_REG: - fprintf(f, "%*sReg=", indent_level, ""); - yasm_arch_reg_print(arch, op->data.reg, f); - fprintf(f, "\n"); - break; - case YASM_INSN__OPERAND_SEGREG: - fprintf(f, "%*sSegReg=", indent_level, ""); - yasm_arch_segreg_print(arch, op->data.reg, f); - fprintf(f, "\n"); - break; - case YASM_INSN__OPERAND_MEMORY: - fprintf(f, "%*sMemory=\n", indent_level, ""); - yasm_ea_print(op->data.ea, f, indent_level); - break; - case YASM_INSN__OPERAND_IMM: - fprintf(f, "%*sImm=", indent_level, ""); - yasm_expr_print(op->data.val, f); - fprintf(f, "\n"); - break; - } - fprintf(f, "%*sTargetMod=%lx\n", indent_level+1, "", - (unsigned long)op->targetmod); - fprintf(f, "%*sSize=%u\n", indent_level+1, "", op->size); - fprintf(f, "%*sDeref=%d, Strict=%d\n", indent_level+1, "", (int)op->deref, - (int)op->strict); -} - -void -yasm_ops_delete(yasm_insn_operands *headp, int content) -{ - yasm_insn_operand *cur, *next; - - cur = STAILQ_FIRST(headp); - while (cur) { - next = STAILQ_NEXT(cur, link); - if (content) - switch (cur->type) { - case YASM_INSN__OPERAND_MEMORY: - yasm_ea_destroy(cur->data.ea); - break; - case YASM_INSN__OPERAND_IMM: - yasm_expr_destroy(cur->data.val); - break; - default: - break; - } - yasm_xfree(cur); - cur = next; - } - STAILQ_INIT(headp); -} - -/*@null@*/ yasm_insn_operand * -yasm_ops_append(yasm_insn_operands *headp, - /*@returned@*/ /*@null@*/ yasm_insn_operand *op) -{ - if (op) { - STAILQ_INSERT_TAIL(headp, op, link); - return op; - } - return (yasm_insn_operand *)NULL; -} - -void -yasm_ops_print(const yasm_insn_operands *headp, FILE *f, int indent_level, - yasm_arch *arch) -{ - yasm_insn_operand *cur; - - STAILQ_FOREACH (cur, headp, link) - yasm_operand_print(cur, f, indent_level, arch); -} - -yasm_insn_operands * -yasm_ops_create(void) -{ - yasm_insn_operands *headp = yasm_xmalloc(sizeof(yasm_insn_operands)); - yasm_ops_initialize(headp); - return headp; -} - -void -yasm_ops_destroy(yasm_insn_operands *headp, int content) -{ - yasm_ops_delete(headp, content); - yasm_xfree(headp); -} - -/* Non-macro yasm_ops_first() for non-YASM_LIB_INTERNAL users. */ -#undef yasm_ops_first -yasm_insn_operand * -yasm_ops_first(yasm_insn_operands *headp) -{ - return STAILQ_FIRST(headp); -} - -/* Non-macro yasm_operand_next() for non-YASM_LIB_INTERNAL users. */ -#undef yasm_operand_next -yasm_insn_operand * -yasm_operand_next(yasm_insn_operand *cur) -{ - return STAILQ_NEXT(cur, link); -} diff --git a/libyasm/arch.h b/libyasm/arch.h index 1daa4f37..eed31765 100644 --- a/libyasm/arch.h +++ b/libyasm/arch.h @@ -59,12 +59,6 @@ typedef enum yasm_arch_regtmod { YASM_ARCH_TARGETMOD /**< A target modifier (for jumps) */ } yasm_arch_regtmod; -/** An instruction operand (opaque type). */ -typedef struct yasm_insn_operand yasm_insn_operand; -#ifdef YASM_LIB_INTERNAL -/*@reldef@*/ STAILQ_HEAD(yasm_insn_operands, yasm_insn_operand); -#endif - #ifndef YASM_DOXYGEN /** Base #yasm_arch structure. Must be present as the first element in any * #yasm_arch implementation. @@ -140,30 +134,21 @@ typedef struct yasm_arch_module { * Call yasm_arch_parse_check_insnprefix() instead of calling this function. */ yasm_arch_insnprefix (*parse_check_insnprefix) - (yasm_arch *arch, /*@out@*/ uintptr_t data[4], const char *id, - size_t id_len); + (yasm_arch *arch, const char *id, size_t id_len, unsigned long line, + /*@out@*/ /*@only@*/ yasm_bytecode **bc, /*@out@*/ uintptr_t *prefix); /** Module-level implementation of yasm_arch_parse_check_regtmod(). * Call yasm_arch_parse_check_regtmod() instead of calling this function. */ yasm_arch_regtmod (*parse_check_regtmod) - (yasm_arch *arch, /*@out@*/ uintptr_t *data, const char *id, - size_t id_len); + (yasm_arch *arch, const char *id, size_t id_len, + /*@out@*/ uintptr_t *data); /** Module-level implementation of yasm_arch_get_fill(). * Call yasm_arch_get_fill() instead of calling this function. */ const unsigned char ** (*get_fill) (const yasm_arch *arch); - /** Module-level implementation of yasm_arch_finalize_insn(). - * Call yasm_arch_finalize_insn() instead of calling this function. - */ - void (*finalize_insn) - (yasm_arch *arch, yasm_bytecode *bc, yasm_bytecode *prev_bc, - const uintptr_t data[4], int num_operands, - /*@null@*/ yasm_insn_operands *operands, int num_prefixes, - uintptr_t **prefixes, int num_segregs, const uintptr_t *segregs); - /** Module-level implementation of yasm_arch_floatnum_tobytes(). * Call yasm_arch_floatnum_tobytes() instead of calling this function. */ @@ -205,6 +190,22 @@ typedef struct yasm_arch_module { */ yasm_effaddr * (*ea_create) (yasm_arch *arch, /*@keep@*/ yasm_expr *e); + /** Module-level implementation of yasm_arch_ea_destroy(). + * Call yasm_arch_ea_destroy() instead of calling this function. + */ + void (*ea_destroy) (/*@only@*/ yasm_effaddr *ea); + + /** Module-level implementation of yasm_arch_ea_print(). + * Call yasm_arch_ea_print() instead of calling this function. + */ + void (*ea_print) (const yasm_effaddr *ea, FILE *f, int indent_level); + + /** Module-level implementation of yasm_arch_create_empty_insn(). + * Call yasm_arch_create_empty_insn() instead of calling this function. + */ + /*@only@*/ yasm_bytecode * (*create_empty_insn) (yasm_arch *arch, + unsigned long line); + /** NULL-terminated list of machines for this architecture. * Call yasm_arch_get_machine() to get the active machine of a particular * #yasm_arch. @@ -230,56 +231,6 @@ typedef struct yasm_arch_module { unsigned int min_insn_len; } yasm_arch_module; -#ifdef YASM_LIB_INTERNAL -/** An instruction operand. \internal */ -struct yasm_insn_operand { - /** Link for building linked list of operands. \internal */ - /*@reldef@*/ STAILQ_ENTRY(yasm_insn_operand) link; - - /** Operand type. */ - enum yasm_insn_operand_type { - YASM_INSN__OPERAND_REG = 1, /**< A register. */ - YASM_INSN__OPERAND_SEGREG, /**< A segment register. */ - YASM_INSN__OPERAND_MEMORY, /**< An effective address - * (memory reference). */ - YASM_INSN__OPERAND_IMM /**< An immediate or jump target. */ - } type; - - /** Operand data. */ - union { - uintptr_t reg; /**< Arch data for reg/segreg. */ - yasm_effaddr *ea; /**< Effective address for memory references. */ - yasm_expr *val; /**< Value of immediate or jump target. */ - } data; - - uintptr_t targetmod; /**< Arch target modifier, 0 if none. */ - - /** Specified size of the operand, in bits. 0 if not user-specified. */ - unsigned int size:8; - - /** Nonzero if dereference. Used for "*foo" in GAS. - * The reason for this is that by default in GAS, an unprefixed value - * is a memory address, except for jumps/calls, in which case it needs a - * "*" prefix to become a memory address (otherwise it's an immediate). - * This isn't knowable in the parser stage, so the parser sets this flag - * to indicate the "*" prefix has been used, and the arch needs to adjust - * the operand type appropriately depending on the instruction type. - */ - unsigned int deref:1; - - /** Nonzero if strict. Used for "strict foo" in NASM. - * This is used to inhibit optimization on otherwise "sized" values. - * For example, the user may just want to be explicit with the size on - * "push dword 4", but not actually want to force the immediate size to - * 4 bytes (rather wanting the optimizer to optimize it down to 1 byte as - * though "dword" was not specified). To indicate the immediate should - * actually be forced to 4 bytes, the user needs to write - * "push strict dword 4", which sets this flag. - */ - unsigned int strict:1; -}; -#endif - /** Get the one-line description of an architecture. * \param arch architecture * \return One-line description of architecture. @@ -348,15 +299,18 @@ int yasm_arch_set_var(yasm_arch *arch, const char *var, unsigned long val); * symbols. Any additional data beyond just the type (almost always necessary) * should be returned into the space provided by the data parameter. * \param arch architecture - * \param data extra identification information (yasm_arch-specific) - * [output] * \param id identifier as in the input file * \param id_len length of id string + * \param line virtual line + * \param bc for instructions, yasm_insn-based bytecode is returned + * (and NULL otherwise) + * \param prefix for prefixes, yasm_arch-specific value is returned + * (and 0 otherwise) * \return Identifier type (#YASM_ARCH_NOTINSNPREFIX if unrecognized) */ yasm_arch_insnprefix yasm_arch_parse_check_insnprefix - (yasm_arch *arch, /*@out@*/ uintptr_t data[4], const char *id, - size_t id_len); + (yasm_arch *arch, const char *id, size_t id_len, unsigned long line, + /*@out@*/ /*@only@*/ yasm_bytecode **bc, /*@out@*/ uintptr_t *prefix); /** Check an generic identifier to see if it matches architecture specific * names for registers or target modifiers. Unrecognized identifiers should @@ -364,15 +318,15 @@ yasm_arch_insnprefix yasm_arch_parse_check_insnprefix * (almost always necessary) should be returned into the space provided by the * data parameter. * \param arch architecture - * \param data extra identification information (yasm_arch-specific) - * [output] * \param id identifier as in the input file * \param id_len length of id string + * \param data extra identification information (yasm_arch-specific) + * [output] * \return Identifier type (#YASM_ARCH_NOTREGTMOD if unrecognized) */ yasm_arch_regtmod yasm_arch_parse_check_regtmod - (yasm_arch *arch, /*@out@*/ uintptr_t *data, const char *id, - size_t id_len); + (yasm_arch *arch, const char *id, size_t id_len, + /*@out@*/ uintptr_t *data); /** Get NOP fill patterns for 1-15 bytes of fill. * \param arch architecture @@ -381,28 +335,6 @@ yasm_arch_regtmod yasm_arch_parse_check_regtmod */ const unsigned char **yasm_arch_get_fill(const yasm_arch *arch); -/** Finalize an instruction from a semi-generic insn description. Note an - * existing bytecode is required. - * \param arch architecture - * \param bc bytecode to finalize - * \param prev_bc previous bytecode in section - * \param data instruction data (from parse_check_id()); all - * zero indicates an empty instruction - * \param num_operands number of operands - * \param operands list of operands (in parse order) - * \param num_prefixes number of prefixes - * \param prefixes array of 4-element prefix data - * \param num_segregs number of segment register prefixes - * \param segregs array of segment register data - * \return If no match is found (the instruction is invalid), no action is - * performed and an error is recorded. - */ -void yasm_arch_finalize_insn - (yasm_arch *arch, yasm_bytecode *bc, yasm_bytecode *prev_bc, - const uintptr_t data[4], int num_operands, - /*@null@*/ yasm_insn_operands *operands, int num_prefixes, - const uintptr_t **prefixes, int num_segregs, const uintptr_t *segregs); - /** Output #yasm_floatnum to buffer. Puts the value into the least * significant bits of the destination, or may be shifted into more * significant bits by the shift parameter. The destination bits are @@ -481,6 +413,29 @@ void yasm_arch_segreg_print(yasm_arch *arch, uintptr_t segreg, FILE *f); */ yasm_effaddr *yasm_arch_ea_create(yasm_arch *arch, /*@keep@*/ yasm_expr *e); +/** Delete (free allocated memory for) an effective address. + * \param arch architecture + * \param ea effective address (only pointer to it). + */ +void yasm_arch_ea_destroy(yasm_arch *arch, /*@only@*/ yasm_effaddr *ea); + +/** Print an effective address. For debugging purposes. + * \param arch architecture + * \param ea effective address + * \param f file + * \param indent_level indentation level + */ +void yasm_arch_ea_print(const yasm_arch *arch, const yasm_effaddr *ea, + FILE *f, int indent_level); + +/** Create a bytecode that represents a single empty (0 length) instruction. + * This is used for handling solitary prefixes. + * \param arch architecture + * \param line virtual line (from yasm_linemap) + * \return Newly allocated bytecode. + */ +/*@only@*/ yasm_bytecode *yasm_arch_create_empty_insn(yasm_arch *arch, + unsigned long line); #ifndef YASM_DOXYGEN @@ -506,20 +461,14 @@ yasm_effaddr *yasm_arch_ea_create(yasm_arch *arch, /*@keep@*/ yasm_expr *e); ((yasm_arch_base *)arch)->module->get_address_size(arch) #define yasm_arch_set_var(arch, var, val) \ ((yasm_arch_base *)arch)->module->set_var(arch, var, val) -#define yasm_arch_parse_check_insnprefix(arch, data, id, id_len) \ - ((yasm_arch_base *)arch)->module->parse_check_insnprefix(arch, data, id, \ - id_len) -#define yasm_arch_parse_check_regtmod(arch, data, id, id_len) \ - ((yasm_arch_base *)arch)->module->parse_check_regtmod(arch, data, id, \ - id_len) +#define yasm_arch_parse_check_insnprefix(arch, id, id_len, line, bc, prefix) \ + ((yasm_arch_base *)arch)->module->parse_check_insnprefix \ + (arch, id, id_len, line, bc, prefix) +#define yasm_arch_parse_check_regtmod(arch, id, id_len, data) \ + ((yasm_arch_base *)arch)->module->parse_check_regtmod \ + (arch, id, id_len, data) #define yasm_arch_get_fill(arch) \ ((yasm_arch_base *)arch)->module->get_fill(arch) -#define yasm_arch_finalize_insn(arch, bc, prev_bc, data, num_operands, \ - operands, num_prefixes, prefixes, \ - num_segregs, segregs) \ - ((yasm_arch_base *)arch)->module->finalize_insn \ - (arch, bc, prev_bc, data, num_operands, operands, num_prefixes, \ - prefixes, num_segregs, segregs) #define yasm_arch_floatnum_tobytes(arch, flt, buf, destsize, valsize, shift, \ warn) \ ((yasm_arch_base *)arch)->module->floatnum_tobytes \ @@ -538,100 +487,13 @@ yasm_effaddr *yasm_arch_ea_create(yasm_arch *arch, /*@keep@*/ yasm_expr *e); ((yasm_arch_base *)arch)->module->segreg_print(arch, segreg, f) #define yasm_arch_ea_create(arch, e) \ ((yasm_arch_base *)arch)->module->ea_create(arch, e) +#define yasm_arch_ea_destroy(arch, ea) \ + ((yasm_arch_base *)arch)->module->ea_destroy(ea) +#define yasm_arch_ea_print(arch, ea, f, i) \ + ((yasm_arch_base *)arch)->module->ea_print(ea, f, i) +#define yasm_arch_create_empty_insn(arch, line) \ + ((yasm_arch_base *)arch)->module->create_empty_insn(arch, line) #endif -/** Create an instruction operand from a register. - * \param reg register - * \return Newly allocated operand. - */ -yasm_insn_operand *yasm_operand_create_reg(uintptr_t reg); - -/** Create an instruction operand from a segment register. - * \param segreg segment register - * \return Newly allocated operand. - */ -yasm_insn_operand *yasm_operand_create_segreg(uintptr_t segreg); - -/** Create an instruction operand from an effective address. - * \param ea effective address - * \return Newly allocated operand. - */ -yasm_insn_operand *yasm_operand_create_mem(/*@only@*/ yasm_effaddr *ea); - -/** Create an instruction operand from an immediate expression. - * Looks for cases of a single register and creates a register variant of - * #yasm_insn_operand. - * \param val immediate expression - * \return Newly allocated operand. - */ -yasm_insn_operand *yasm_operand_create_imm(/*@only@*/ yasm_expr *val); - -/** Print an instruction operand. For debugging purposes. - * \param arch architecture - * \param f file - * \param indent_level indentation level - * \param op instruction operand - */ -void yasm_operand_print(const yasm_insn_operand *op, FILE *f, int indent_level, - yasm_arch *arch); - -/** Create a new list of instruction operands. - * \return Newly allocated list. - */ -yasm_insn_operands *yasm_ops_create(void); - -/** Destroy a list of instruction operands (created with yasm_ops_create()). - * \param headp list of instruction operands - * \param content if nonzero, deletes content of each operand - */ -void yasm_ops_destroy(yasm_insn_operands *headp, int content); - -/** Get the first operand in a list of instruction operands. - * \param headp list of instruction operands - * \return First operand in list (NULL if list is empty). - */ -yasm_insn_operand *yasm_ops_first(yasm_insn_operands *headp); - -/** Get the next operand in a list of instruction operands. - * \param cur previous operand - * \return Next operand in list (NULL if cur was the last operand). - */ -yasm_insn_operand *yasm_operand_next(yasm_insn_operand *cur); - -#ifdef YASM_LIB_INTERNAL -#define yasm_ops_initialize(headp) STAILQ_INIT(headp) -#define yasm_ops_first(headp) STAILQ_FIRST(headp) -#define yasm_operand_next(cur) STAILQ_NEXT(cur, link) - -/** Delete (free allocated memory for) a list of instruction operands (created - * with yasm_ops_initialize()). - * \param headp list of instruction operands - * \param content if nonzero, deletes content of each operand - */ -void yasm_ops_delete(yasm_insn_operands *headp, int content); -#endif - -/** Add data value to the end of a list of instruction operands. - * \note Does not make a copy of the operand; so don't pass this function - * static or local variables, and discard the op pointer after calling - * this function. - * \param headp list of instruction operands - * \param op operand (may be NULL) - * \return If operand was actually appended (it wasn't NULL), the operand; - * otherwise NULL. - */ -/*@null@*/ yasm_insn_operand *yasm_ops_append - (yasm_insn_operands *headp, - /*@returned@*/ /*@null@*/ yasm_insn_operand *op); - -/** Print a list of instruction operands. For debugging purposes. - * \param arch architecture - * \param f file - * \param indent_level indentation level - * \param headp list of instruction operands - */ -void yasm_ops_print(const yasm_insn_operands *headp, FILE *f, int indent_level, - yasm_arch *arch); - #endif diff --git a/libyasm/bc-insn.c b/libyasm/bc-insn.c deleted file mode 100644 index de8f5143..00000000 --- a/libyasm/bc-insn.c +++ /dev/null @@ -1,334 +0,0 @@ -/* - * Insn bytecode - * - * Copyright (C) 2005-2007 Peter Johnson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ -#define YASM_LIB_INTERNAL -#include "util.h" -/*@unused@*/ RCSID("$Id$"); - -#include "libyasm-stdint.h" -#include "coretype.h" - -#include "errwarn.h" -#include "expr.h" -#include "value.h" - -#include "bytecode.h" -#include "arch.h" - -#include "bc-int.h" - - -typedef struct bytecode_insn { - /*@dependent@*/ yasm_arch *arch; - uintptr_t insn_data[4]; - - int num_operands; - /*@null@*/ yasm_insn_operands operands; - - /* array of 4-element prefix_data arrays */ - int num_prefixes; - /*@null@*/ uintptr_t **prefixes; - - /* array of segment prefixes */ - int num_segregs; - /*@null@*/ uintptr_t *segregs; -} bytecode_insn; - -static void bc_insn_destroy(void *contents); -static void bc_insn_print(const void *contents, FILE *f, int indent_level); -static void bc_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc); -static int bc_insn_calc_len(yasm_bytecode *bc, yasm_bc_add_span_func add_span, - void *add_span_data); -static int bc_insn_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, - yasm_output_value_func output_value, - /*@null@*/ yasm_output_reloc_func output_reloc); - -static const yasm_bytecode_callback bc_insn_callback = { - bc_insn_destroy, - bc_insn_print, - bc_insn_finalize, - bc_insn_calc_len, - yasm_bc_expand_common, - bc_insn_tobytes, - 0 -}; - - -const yasm_expr * -yasm_ea_get_disp(const yasm_effaddr *ea) -{ - return ea->disp.abs; -} - -void -yasm_ea_set_len(yasm_effaddr *ptr, unsigned int len) -{ - if (!ptr) - return; - - /* Currently don't warn if length truncated, as this is called only from - * an explicit override, where we expect the user knows what they're doing. - */ - - ptr->disp.size = (unsigned char)len; -} - -void -yasm_ea_set_nosplit(yasm_effaddr *ptr, unsigned int nosplit) -{ - if (!ptr) - return; - - ptr->nosplit = (unsigned char)nosplit; -} - -void -yasm_ea_set_strong(yasm_effaddr *ptr, unsigned int strong) -{ - if (!ptr) - return; - - ptr->strong = (unsigned char)strong; -} - -void -yasm_ea_set_segreg(yasm_effaddr *ea, uintptr_t segreg) -{ - if (!ea) - return; - - if (segreg != 0 && ea->segreg != 0) - yasm_warn_set(YASM_WARN_GENERAL, - N_("multiple segment overrides, using leftmost")); - - ea->segreg = segreg; -} - -/*@-nullstate@*/ -void -yasm_ea_destroy(yasm_effaddr *ea) -{ - ea->callback->destroy(ea); - yasm_value_delete(&ea->disp); - yasm_xfree(ea); -} -/*@=nullstate@*/ - -/*@-nullstate@*/ -void -yasm_ea_print(const yasm_effaddr *ea, FILE *f, int indent_level) -{ - fprintf(f, "%*sDisp:\n", indent_level, ""); - yasm_value_print(&ea->disp, f, indent_level+1); - fprintf(f, "%*sNoSplit=%u\n", indent_level, "", (unsigned int)ea->nosplit); - ea->callback->print(ea, f, indent_level); -} -/*@=nullstate@*/ - -static void -bc_insn_destroy(void *contents) -{ - bytecode_insn *insn = (bytecode_insn *)contents; - if (insn->num_operands > 0) - yasm_ops_delete(&insn->operands, 0); - if (insn->num_prefixes > 0) { - int i; - for (i=0; inum_prefixes; i++) - yasm_xfree(insn->prefixes[i]); - yasm_xfree(insn->prefixes); - } - if (insn->num_segregs > 0) - yasm_xfree(insn->segregs); - yasm_xfree(contents); -} - -static void -bc_insn_print(const void *contents, FILE *f, int indent_level) -{ -} - -static void -bc_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) -{ - bytecode_insn *insn = (bytecode_insn *)bc->contents; - int i; - yasm_insn_operand *op; - yasm_error_class eclass; - char *str, *xrefstr; - unsigned long xrefline; - - /* Simplify the operands' expressions first. */ - for (i = 0, op = yasm_ops_first(&insn->operands); - op && inum_operands; op = yasm_operand_next(op), i++) { - /* Check operand type */ - switch (op->type) { - case YASM_INSN__OPERAND_MEMORY: - /* Don't get over-ambitious here; some archs' memory expr - * parser are sensitive to the presence of *1, etc, so don't - * simplify reg*1 identities. - */ - if (op->data.ea) - op->data.ea->disp.abs = - yasm_expr__level_tree(op->data.ea->disp.abs, 1, 1, 0, - 0, NULL, NULL); - if (yasm_error_occurred()) { - /* Add a pointer to where it was used to the error */ - yasm_error_fetch(&eclass, &str, &xrefline, &xrefstr); - if (xrefstr) { - yasm_error_set_xref(xrefline, "%s", xrefstr); - yasm_xfree(xrefstr); - } - if (str) { - yasm_error_set(eclass, "%s in memory expression", str); - yasm_xfree(str); - } - return; - } - break; - case YASM_INSN__OPERAND_IMM: - op->data.val = - yasm_expr__level_tree(op->data.val, 1, 1, 1, 0, NULL, - NULL); - if (yasm_error_occurred()) { - /* Add a pointer to where it was used to the error */ - yasm_error_fetch(&eclass, &str, &xrefline, &xrefstr); - if (xrefstr) { - yasm_error_set_xref(xrefline, "%s", xrefstr); - yasm_xfree(xrefstr); - } - if (str) { - yasm_error_set(eclass, "%s in immediate expression", - str); - yasm_xfree(str); - } - return; - } - break; - default: - break; - } - } - - yasm_arch_finalize_insn(insn->arch, bc, prev_bc, insn->insn_data, - insn->num_operands, &insn->operands, - insn->num_prefixes, insn->prefixes, - insn->num_segregs, insn->segregs); -} - -static int -bc_insn_calc_len(yasm_bytecode *bc, yasm_bc_add_span_func add_span, - void *add_span_data) -{ - yasm_internal_error(N_("bc_insn_calc_len() is not implemented")); - /*@notreached@*/ - return 0; -} - -static int -bc_insn_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, - yasm_output_value_func output_value, - /*@unused@*/ yasm_output_reloc_func output_reloc) -{ - yasm_internal_error(N_("bc_insn_tobytes() is not implemented")); - /*@notreached@*/ - return 1; -} - -yasm_bytecode * -yasm_bc_create_insn(yasm_arch *arch, const uintptr_t insn_data[4], - int num_operands, /*@null@*/ yasm_insn_operands *operands, - unsigned long line) -{ - bytecode_insn *insn = yasm_xmalloc(sizeof(bytecode_insn)); - - insn->arch = arch; - insn->insn_data[0] = insn_data[0]; - insn->insn_data[1] = insn_data[1]; - insn->insn_data[2] = insn_data[2]; - insn->insn_data[3] = insn_data[3]; - insn->num_operands = num_operands; - if (operands) - insn->operands = *operands; /* structure copy */ - else - yasm_ops_initialize(&insn->operands); - insn->num_prefixes = 0; - insn->prefixes = NULL; - insn->num_segregs = 0; - insn->segregs = NULL; - - return yasm_bc_create_common(&bc_insn_callback, insn, line); -} - -yasm_bytecode * -yasm_bc_create_empty_insn(yasm_arch *arch, unsigned long line) -{ - bytecode_insn *insn = yasm_xmalloc(sizeof(bytecode_insn)); - - insn->arch = arch; - insn->insn_data[0] = 0; - insn->insn_data[1] = 0; - insn->insn_data[2] = 0; - insn->insn_data[3] = 0; - insn->num_operands = 0; - yasm_ops_initialize(&insn->operands); - insn->num_prefixes = 0; - insn->prefixes = NULL; - insn->num_segregs = 0; - insn->segregs = NULL; - - return yasm_bc_create_common(&bc_insn_callback, insn, line); -} - -void -yasm_bc_insn_add_prefix(yasm_bytecode *bc, const uintptr_t prefix_data[4]) -{ - bytecode_insn *insn = (bytecode_insn *)bc->contents; - - assert(bc->callback == bc_insn_callback); - - insn->prefixes = - yasm_xrealloc(insn->prefixes, - (insn->num_prefixes+1)*sizeof(uintptr_t *)); - insn->prefixes[insn->num_prefixes] = yasm_xmalloc(4*sizeof(uintptr_t)); - insn->prefixes[insn->num_prefixes][0] = prefix_data[0]; - insn->prefixes[insn->num_prefixes][1] = prefix_data[1]; - insn->prefixes[insn->num_prefixes][2] = prefix_data[2]; - insn->prefixes[insn->num_prefixes][3] = prefix_data[3]; - insn->num_prefixes++; -} - -void -yasm_bc_insn_add_seg_prefix(yasm_bytecode *bc, uintptr_t segreg) -{ - bytecode_insn *insn = (bytecode_insn *)bc->contents; - - assert(bc->callback == bc_insn_callback); - - insn->segregs = - yasm_xrealloc(insn->segregs, (insn->num_segregs+1)*sizeof(uintptr_t)); - insn->segregs[insn->num_segregs] = segreg; - insn->num_segregs++; -} diff --git a/libyasm/bc-int.h b/libyasm/bc-int.h index 76338509..d941ad6a 100644 --- a/libyasm/bc-int.h +++ b/libyasm/bc-int.h @@ -41,7 +41,8 @@ typedef struct yasm_bytecode_callback { enum yasm_bytecode_special_type { YASM_BC_SPECIAL_NONE = 0, YASM_BC_SPECIAL_RESERVE,/* Reserves space instead of outputting data */ - YASM_BC_SPECIAL_OFFSET /* Adjusts offset instead of calculating len */ + YASM_BC_SPECIAL_OFFSET, /* Adjusts offset instead of calculating len */ + YASM_BC_SPECIAL_INSN /* Instruction bytecode */ } special; } yasm_bytecode_callback; @@ -100,6 +101,12 @@ void yasm_bc_transform(yasm_bytecode *bc, */ void yasm_bc_finalize_common(yasm_bytecode *bc, yasm_bytecode *prev_bc); +/** Common bytecode callback calc_len function, for where the bytecode has + * no calculatable length. Causes an internal error if called. + */ +int yasm_bc_calc_len_common(yasm_bytecode *bc, yasm_bc_add_span_func add_span, + void *add_span_data); + /** Common bytecode callback expand function, for where the bytecode is * always short (calc_len never calls add_span). Causes an internal * error if called. @@ -108,6 +115,14 @@ int yasm_bc_expand_common (yasm_bytecode *bc, int span, long old_val, long new_val, /*@out@*/ long *neg_thres, /*@out@*/ long *pos_thres); +/** Common bytecode callback tobytes function, for where the bytecode + * cannot be converted to bytes. Causes an internal error if called. + */ +int yasm_bc_tobytes_common + (yasm_bytecode *bc, unsigned char **bufp, void *d, + yasm_output_value_func output_value, + /*@null@*/ yasm_output_reloc_func output_reloc); + #define yasm_bc__next(x) STAILQ_NEXT(x, link) #endif diff --git a/libyasm/bytecode.c b/libyasm/bytecode.c index 41fe3ca2..d9c89282 100644 --- a/libyasm/bytecode.c +++ b/libyasm/bytecode.c @@ -58,6 +58,15 @@ yasm_bc_finalize_common(yasm_bytecode *bc, yasm_bytecode *prev_bc) { } +int +yasm_bc_calc_len_common(yasm_bytecode *bc, yasm_bc_add_span_func add_span, + void *add_span_data) +{ + yasm_internal_error(N_("bytecode length cannot be calculated")); + /*@unreached@*/ + return 0; +} + int yasm_bc_expand_common(yasm_bytecode *bc, int span, long old_val, long new_val, /*@out@*/ long *neg_thres, /*@out@*/ long *pos_thres) @@ -67,6 +76,16 @@ yasm_bc_expand_common(yasm_bytecode *bc, int span, long old_val, long new_val, return 0; } +int +yasm_bc_tobytes_common(yasm_bytecode *bc, unsigned char **bufp, void *d, + yasm_output_value_func output_value, + /*@null@*/ yasm_output_reloc_func output_reloc) +{ + yasm_internal_error(N_("bytecode cannot be converted to bytes")); + /*@unreached@*/ + return 0; +} + void yasm_bc_transform(yasm_bytecode *bc, const yasm_bytecode_callback *callback, void *contents) @@ -345,3 +364,11 @@ yasm_bc_get_multiple_expr(const yasm_bytecode *bc) { return bc->multiple; } + +yasm_insn * +yasm_bc_get_insn(yasm_bytecode *bc) +{ + if (bc->callback->special != YASM_BC_SPECIAL_INSN) + return NULL; + return (yasm_insn *)bc->contents; +} diff --git a/libyasm/bytecode.h b/libyasm/bytecode.h index 86c3c7e5..ef693ed3 100644 --- a/libyasm/bytecode.h +++ b/libyasm/bytecode.h @@ -34,45 +34,6 @@ #ifndef YASM_BYTECODE_H #define YASM_BYTECODE_H -/** An effective address. */ -typedef struct yasm_effaddr yasm_effaddr; - -/** Callbacks for effective address implementations. */ -typedef struct yasm_effaddr_callback { - /** Destroy the effective address (freeing it). - * \param ea effective address - */ - void (*destroy) (/*@only@*/ yasm_effaddr *ea); - - /** Print the effective address. - * \param ea effective address - * \param f file to output to - * \param indent_level indentation level - */ - void (*print) (const yasm_effaddr *ea, FILE *f, int indent_level); -} yasm_effaddr_callback; - -/** An effective address. */ -struct yasm_effaddr { - const yasm_effaddr_callback *callback; /**< callback functions */ - - yasm_value disp; /**< address displacement */ - - uintptr_t segreg; /**< segment register override (0 if none) */ - - unsigned char need_nonzero_len; /**< 1 if length of disp must be >0. */ - unsigned char need_disp; /**< 1 if a displacement should be present - * in the output. - */ - unsigned char nosplit; /**< 1 if reg*2 should not be split into - * reg+reg. (0 if not) - */ - unsigned char strong; /**< 1 if effective address is *definitely* - * an effective address, e.g. in GAS if - * expr(,1) form is used vs. just expr. - */ -}; - /** A data value (opaque type). */ typedef struct yasm_dataval yasm_dataval; /** A list of data values (opaque type). */ @@ -82,59 +43,6 @@ typedef struct yasm_datavalhead yasm_datavalhead; /*@reldef@*/ STAILQ_HEAD(yasm_datavalhead, yasm_dataval); #endif -/** Get the displacement portion of an effective address. - * \param ea effective address - * \return Expression representing the displacement (read-only). - */ -/*@observer@*/ const yasm_expr *yasm_ea_get_disp(const yasm_effaddr *ea); - -/** Set the length of the displacement portion of an effective address. - * The length is specified in bits. - * \param ea effective address - * \param len length in bits - */ -void yasm_ea_set_len(yasm_effaddr *ea, unsigned int len); - -/** Set/clear nosplit flag of an effective address. - * The nosplit flag indicates (for architectures that support complex effective - * addresses such as x86) if various types of complex effective addresses can - * be split into different forms in order to minimize instruction length. - * \param ea effective address - * \param nosplit nosplit flag setting (0=splits allowed, nonzero=splits - * not allowed) - */ -void yasm_ea_set_nosplit(yasm_effaddr *ea, unsigned int nosplit); - -/** Set/clear strong flag of an effective address. - * The strong flag indicates if an effective address is *definitely* an - * effective address. This is used in e.g. the GAS parser to differentiate - * between "expr" (which might or might not be an effective address) and - * "expr(,1)" (which is definitely an effective address). - * \param ea effective address - * \param strong strong flag setting (0=not strong, nonzero=strong) - */ -void yasm_ea_set_strong(yasm_effaddr *ea, unsigned int strong); - -/** Set segment override for an effective address. - * Some architectures (such as x86) support segment overrides on effective - * addresses. A override of an override will result in a warning. - * \param ea effective address - * \param segreg segment register (0 if none) - */ -void yasm_ea_set_segreg(yasm_effaddr *ea, uintptr_t segreg); - -/** Delete (free allocated memory for) an effective address. - * \param ea effective address (only pointer to it). - */ -void yasm_ea_destroy(/*@only@*/ yasm_effaddr *ea); - -/** Print an effective address. For debugging purposes. - * \param f file - * \param indent_level indentation level - * \param ea effective address - */ -void yasm_ea_print(const yasm_effaddr *ea, FILE *f, int indent_level); - /** Set multiple field of a bytecode. * A bytecode can be repeated a number of times when output. This function * sets that multiple. @@ -227,42 +135,6 @@ void yasm_bc_set_multiple(yasm_bytecode *bc, /*@keep@*/ yasm_expr *e); /*@only@*/ yasm_bytecode *yasm_bc_create_org (unsigned long start, unsigned long line); -/** Create a bytecode that represents a single instruction. - * \param arch instruction's architecture - * \param insn_data data that identifies the type of instruction - * \param num_operands number of operands - * \param operands instruction operands (may be NULL if no operands) - * \param line virtual line (from yasm_linemap) - * \return Newly allocated bytecode. - * \note Keeps the list of operands; do not call yasm_ops_delete() after - * giving operands to this function. - */ -/*@only@*/ yasm_bytecode *yasm_bc_create_insn - (yasm_arch *arch, const uintptr_t insn_data[4], int num_operands, - /*@null@*/ yasm_insn_operands *operands, unsigned long line); - -/** Create a bytecode that represents a single empty (0 length) instruction. - * This is used for handling solitary prefixes. - * \param arch instruction's architecture - * \param line virtual line (from yasm_linemap) - * \return Newly allocated bytecode. - */ -/*@only@*/ yasm_bytecode *yasm_bc_create_empty_insn(yasm_arch *arch, - unsigned long line); - -/** Associate a prefix with an instruction bytecode. - * \param bc instruction bytecode - * \param prefix_data data the identifies the prefix - */ -void yasm_bc_insn_add_prefix(yasm_bytecode *bc, - const uintptr_t prefix_data[4]); - -/** Associate a segment prefix with an instruction bytecode. - * \param bc instruction bytecode - * \param segreg data the identifies the segment register - */ -void yasm_bc_insn_add_seg_prefix(yasm_bytecode *bc, uintptr_t segreg); - /** Get the section that contains a particular bytecode. * \param bc bytecode * \return Section containing bc (can be NULL if bytecode is not part of a @@ -404,6 +276,13 @@ int yasm_bc_get_multiple(yasm_bytecode *bc, /*@out@*/ long *multiple, */ const yasm_expr *yasm_bc_get_multiple_expr(const yasm_bytecode *bc); +/** Get a #yasm_insn structure from an instruction bytecode (if possible). + * \param bc bytecode + * \return Instruction details if bytecode is an instruction bytecode, + * otherwise NULL. + */ +/*@dependent@*/ /*@null@*/ yasm_insn *yasm_bc_get_insn(yasm_bytecode *bc); + /** Create a new data value from an expression. * \param expn expression * \return Newly allocated data value. diff --git a/libyasm/coretype.h b/libyasm/coretype.h index 3fb4ec1a..dd4eeec4 100644 --- a/libyasm/coretype.h +++ b/libyasm/coretype.h @@ -192,11 +192,15 @@ typedef struct yasm_valparamhead yasm_valparamhead; */ typedef struct yasm_directive yasm_directive; -/** A list of instruction operands (opaque type). - * The list goes from left-to-right as parsed. - * \see arch.h for related functions. +/** An effective address. + * \see insn.h for related functions. */ -typedef struct yasm_insn_operands yasm_insn_operands; +typedef struct yasm_effaddr yasm_effaddr; + +/** An instruction. + * \see insn.h for related functions. + */ +typedef struct yasm_insn yasm_insn; /** Expression operators usable in #yasm_expr expressions. */ typedef enum yasm_expr_op { diff --git a/libyasm/insn.c b/libyasm/insn.c new file mode 100644 index 00000000..7fc21c38 --- /dev/null +++ b/libyasm/insn.c @@ -0,0 +1,310 @@ +/* + * Mnemonic instruction bytecode + * + * Copyright (C) 2005-2007 Peter Johnson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#define YASM_LIB_INTERNAL +#include "util.h" +/*@unused@*/ RCSID("$Id$"); + +#include "libyasm-stdint.h" +#include "coretype.h" + +#include "errwarn.h" +#include "expr.h" +#include "value.h" + +#include "bytecode.h" +#include "insn.h" +#include "arch.h" + +#include "bc-int.h" + + +void +yasm_ea_set_segreg(yasm_effaddr *ea, uintptr_t segreg) +{ + if (!ea) + return; + + if (segreg != 0 && ea->segreg != 0) + yasm_warn_set(YASM_WARN_GENERAL, + N_("multiple segment overrides, using leftmost")); + + ea->segreg = segreg; +} + +yasm_insn_operand * +yasm_operand_create_reg(uintptr_t reg) +{ + yasm_insn_operand *retval = yasm_xmalloc(sizeof(yasm_insn_operand)); + + retval->type = YASM_INSN__OPERAND_REG; + retval->data.reg = reg; + retval->targetmod = 0; + retval->size = 0; + retval->deref = 0; + retval->strict = 0; + + return retval; +} + +yasm_insn_operand * +yasm_operand_create_segreg(uintptr_t segreg) +{ + yasm_insn_operand *retval = yasm_xmalloc(sizeof(yasm_insn_operand)); + + retval->type = YASM_INSN__OPERAND_SEGREG; + retval->data.reg = segreg; + retval->targetmod = 0; + retval->size = 0; + retval->deref = 0; + retval->strict = 0; + + return retval; +} + +yasm_insn_operand * +yasm_operand_create_mem(/*@only@*/ yasm_effaddr *ea) +{ + yasm_insn_operand *retval = yasm_xmalloc(sizeof(yasm_insn_operand)); + + retval->type = YASM_INSN__OPERAND_MEMORY; + retval->data.ea = ea; + retval->targetmod = 0; + retval->size = 0; + retval->deref = 0; + retval->strict = 0; + + return retval; +} + +yasm_insn_operand * +yasm_operand_create_imm(/*@only@*/ yasm_expr *val) +{ + yasm_insn_operand *retval; + const uintptr_t *reg; + + reg = yasm_expr_get_reg(&val, 0); + if (reg) { + retval = yasm_operand_create_reg(*reg); + yasm_expr_destroy(val); + } else { + retval = yasm_xmalloc(sizeof(yasm_insn_operand)); + retval->type = YASM_INSN__OPERAND_IMM; + retval->data.val = val; + retval->targetmod = 0; + retval->size = 0; + retval->deref = 0; + retval->strict = 0; + } + + return retval; +} + +yasm_insn_operand * +yasm_insn_ops_append(yasm_insn *insn, yasm_insn_operand *op) +{ + if (op) { + insn->num_operands++; + STAILQ_INSERT_TAIL(&insn->operands, op, link); + return op; + } + return (yasm_insn_operand *)NULL; +} + +void +yasm_insn_add_prefix(yasm_insn *insn, uintptr_t prefix) +{ + insn->prefixes = + yasm_xrealloc(insn->prefixes, + (insn->num_prefixes+1)*sizeof(uintptr_t)); + insn->prefixes[insn->num_prefixes] = prefix; + insn->num_prefixes++; +} + +void +yasm_insn_add_seg_prefix(yasm_insn *insn, uintptr_t segreg) +{ + insn->segregs = + yasm_xrealloc(insn->segregs, (insn->num_segregs+1)*sizeof(uintptr_t)); + insn->segregs[insn->num_segregs] = segreg; + insn->num_segregs++; +} + +void +yasm_insn_initialize(yasm_insn *insn) +{ + STAILQ_INIT(&insn->operands); + + insn->prefixes = NULL; + insn->segregs = NULL; + + insn->num_operands = 0; + insn->num_prefixes = 0; + insn->num_segregs = 0; +} + +void +yasm_insn_delete(yasm_insn *insn, + void (*ea_destroy) (/*@only@*/ yasm_effaddr *)) +{ + if (insn->num_operands > 0) { + yasm_insn_operand *cur, *next; + + cur = STAILQ_FIRST(&insn->operands); + while (cur) { + next = STAILQ_NEXT(cur, link); + switch (cur->type) { + case YASM_INSN__OPERAND_MEMORY: + ea_destroy(cur->data.ea); + break; + case YASM_INSN__OPERAND_IMM: + yasm_expr_destroy(cur->data.val); + break; + default: + break; + } + yasm_xfree(cur); + cur = next; + } + } + if (insn->num_prefixes > 0) + yasm_xfree(insn->prefixes); + if (insn->num_segregs > 0) + yasm_xfree(insn->segregs); +} + +void +yasm_insn_print(const yasm_insn *insn, FILE *f, int indent_level) +{ + const yasm_insn_operand *op; + + STAILQ_FOREACH (op, &insn->operands, link) { + switch (op->type) { + case YASM_INSN__OPERAND_REG: + fprintf(f, "%*sReg=", indent_level, ""); + /*yasm_arch_reg_print(arch, op->data.reg, f);*/ + fprintf(f, "\n"); + break; + case YASM_INSN__OPERAND_SEGREG: + fprintf(f, "%*sSegReg=", indent_level, ""); + /*yasm_arch_segreg_print(arch, op->data.reg, f);*/ + fprintf(f, "\n"); + break; + case YASM_INSN__OPERAND_MEMORY: + fprintf(f, "%*sMemory=\n", indent_level, ""); + /*yasm_arch_ea_print(arch, op->data.ea, f, indent_level);*/ + break; + case YASM_INSN__OPERAND_IMM: + fprintf(f, "%*sImm=", indent_level, ""); + yasm_expr_print(op->data.val, f); + fprintf(f, "\n"); + break; + } + fprintf(f, "%*sTargetMod=%lx\n", indent_level+1, "", + (unsigned long)op->targetmod); + fprintf(f, "%*sSize=%u\n", indent_level+1, "", op->size); + fprintf(f, "%*sDeref=%d, Strict=%d\n", indent_level+1, "", + (int)op->deref, (int)op->strict); + } +} + +void +yasm_insn_finalize(yasm_insn *insn) +{ + unsigned int i; + yasm_insn_operand *op; + yasm_error_class eclass; + char *str, *xrefstr; + unsigned long xrefline; + + /* Simplify the operands' expressions first. */ + for (i = 0, op = yasm_insn_ops_first(insn); + op && inum_operands; op = yasm_insn_op_next(op), i++) { + /* Check operand type */ + switch (op->type) { + case YASM_INSN__OPERAND_MEMORY: + /* Don't get over-ambitious here; some archs' memory expr + * parser are sensitive to the presence of *1, etc, so don't + * simplify reg*1 identities. + */ + if (op->data.ea) + op->data.ea->disp.abs = + yasm_expr__level_tree(op->data.ea->disp.abs, 1, 1, 0, + 0, NULL, NULL); + if (yasm_error_occurred()) { + /* Add a pointer to where it was used to the error */ + yasm_error_fetch(&eclass, &str, &xrefline, &xrefstr); + if (xrefstr) { + yasm_error_set_xref(xrefline, "%s", xrefstr); + yasm_xfree(xrefstr); + } + if (str) { + yasm_error_set(eclass, "%s in memory expression", str); + yasm_xfree(str); + } + return; + } + break; + case YASM_INSN__OPERAND_IMM: + op->data.val = + yasm_expr__level_tree(op->data.val, 1, 1, 1, 0, NULL, + NULL); + if (yasm_error_occurred()) { + /* Add a pointer to where it was used to the error */ + yasm_error_fetch(&eclass, &str, &xrefline, &xrefstr); + if (xrefstr) { + yasm_error_set_xref(xrefline, "%s", xrefstr); + yasm_xfree(xrefstr); + } + if (str) { + yasm_error_set(eclass, "%s in immediate expression", + str); + yasm_xfree(str); + } + return; + } + break; + default: + break; + } + } +} + +/* Non-macro yasm_insn_ops_first() for non-YASM_LIB_INTERNAL users. */ +#undef yasm_insn_ops_first +yasm_insn_operand * +yasm_insn_ops_first(yasm_insn *insn) +{ + return STAILQ_FIRST(&insn->operands); +} + +/* Non-macro yasm_insn_op_next() for non-YASM_LIB_INTERNAL users. */ +#undef yasm_insn_op_next +yasm_insn_operand * +yasm_insn_op_next(yasm_insn_operand *cur) +{ + return STAILQ_NEXT(cur, link); +} diff --git a/libyasm/insn.h b/libyasm/insn.h new file mode 100644 index 00000000..a12e1eff --- /dev/null +++ b/libyasm/insn.h @@ -0,0 +1,248 @@ +/** + * \file libyasm/insn.h + * \brief YASM mnenomic instruction. + * + * \rcs + * $Id$ + * \endrcs + * + * \license + * Copyright (C) 2002-2007 Peter Johnson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * \endlicense + */ +#ifndef YASM_INSN_H +#define YASM_INSN_H + +/** Base structure for an effective address. As with all base + * structures, must be present as the first element in any + * #yasm_arch implementation of an effective address. + */ +struct yasm_effaddr { + yasm_value disp; /**< address displacement */ + + /** Segment register override (0 if none). */ + uintptr_t segreg; + + /** 1 if length of disp must be >0. */ + unsigned int need_nonzero_len:1; + + /** 1 if a displacement should be present in the output. */ + unsigned int need_disp:1; + + /** 1 if reg*2 should not be split into reg+reg. (0 if not). + * This flag indicates (for architectures that support complex effective + * addresses such as x86) if various types of complex effective addresses + * can be split into different forms in order to minimize instruction + * length. + */ + unsigned int nosplit:1; + + /** 1 if effective address is /definitely/ an effective address. + * This is used in e.g. the GAS parser to differentiate + * between "expr" (which might or might not be an effective address) and + * "expr(,1)" (which is definitely an effective address). + */ + unsigned int strong:1; +}; + +/** An instruction operand (opaque type). */ +typedef struct yasm_insn_operand yasm_insn_operand; + +#ifdef YASM_LIB_INTERNAL +/** An instruction operand. */ +struct yasm_insn_operand { + /** Link for building linked list of operands. \internal */ + /*@reldef@*/ STAILQ_ENTRY(yasm_insn_operand) link; + + /** Operand type. */ + enum yasm_insn_operand_type { + YASM_INSN__OPERAND_REG = 1, /**< A register. */ + YASM_INSN__OPERAND_SEGREG, /**< A segment register. */ + YASM_INSN__OPERAND_MEMORY, /**< An effective address + * (memory reference). */ + YASM_INSN__OPERAND_IMM /**< An immediate or jump target. */ + } type; + + /** Operand data. */ + union { + uintptr_t reg; /**< Arch data for reg/segreg. */ + yasm_effaddr *ea; /**< Effective address for memory references. */ + yasm_expr *val; /**< Value of immediate or jump target. */ + } data; + + uintptr_t targetmod; /**< Arch target modifier, 0 if none. */ + + /** Specified size of the operand, in bits. 0 if not user-specified. */ + unsigned int size:16; + + /** Nonzero if dereference. Used for "*foo" in GAS. + * The reason for this is that by default in GAS, an unprefixed value + * is a memory address, except for jumps/calls, in which case it needs a + * "*" prefix to become a memory address (otherwise it's an immediate). + * This isn't knowable in the parser stage, so the parser sets this flag + * to indicate the "*" prefix has been used, and the arch needs to adjust + * the operand type appropriately depending on the instruction type. + */ + unsigned int deref:1; + + /** Nonzero if strict. Used for "strict foo" in NASM. + * This is used to inhibit optimization on otherwise "sized" values. + * For example, the user may just want to be explicit with the size on + * "push dword 4", but not actually want to force the immediate size to + * 4 bytes (rather wanting the optimizer to optimize it down to 1 byte as + * though "dword" was not specified). To indicate the immediate should + * actually be forced to 4 bytes, the user needs to write + * "push strict dword 4", which sets this flag. + */ + unsigned int strict:1; +}; + +/** Base structure for "instruction" bytecodes. These are the mnenomic + * (rather than raw) representation of instructions. As with all base + * structures, must be present as the first element in any + * #yasm_arch implementation of mnenomic instruction bytecodes. + */ +struct yasm_insn { + /** Linked list of operands. */ + /*@reldef@*/ STAILQ_HEAD(yasm_insn_operands, yasm_insn_operand) operands; + + /** Array of prefixes. */ + /*@null@*/ uintptr_t *prefixes; + + /** Array of segment prefixes. */ + /*@null@*/ uintptr_t *segregs; + + unsigned int num_operands; /**< Number of operands. */ + unsigned int num_prefixes; /**< Number of prefixes. */ + unsigned int num_segregs; /**< Number of segment prefixes. */ +}; +#endif + +/** Set segment override for an effective address. + * Some architectures (such as x86) support segment overrides on effective + * addresses. A override of an override will result in a warning. + * \param ea effective address + * \param segreg segment register (0 if none) + */ +void yasm_ea_set_segreg(yasm_effaddr *ea, uintptr_t segreg); + +/** Create an instruction operand from a register. + * \param reg register + * \return Newly allocated operand. + */ +yasm_insn_operand *yasm_operand_create_reg(uintptr_t reg); + +/** Create an instruction operand from a segment register. + * \param segreg segment register + * \return Newly allocated operand. + */ +yasm_insn_operand *yasm_operand_create_segreg(uintptr_t segreg); + +/** Create an instruction operand from an effective address. + * \param ea effective address + * \return Newly allocated operand. + */ +yasm_insn_operand *yasm_operand_create_mem(/*@only@*/ yasm_effaddr *ea); + +/** Create an instruction operand from an immediate expression. + * Looks for cases of a single register and creates a register variant of + * #yasm_insn_operand. + * \param val immediate expression + * \return Newly allocated operand. + */ +yasm_insn_operand *yasm_operand_create_imm(/*@only@*/ yasm_expr *val); + +/** Get the first operand in an instruction. + * \param insn instruction + * \return First operand (NULL if no operands). + */ +yasm_insn_operand *yasm_insn_ops_first(yasm_insn *insn); + +/** Get the next operand in an instruction. + * \param op previous operand + * \return Next operand (NULL if op was the last operand). + */ +yasm_insn_operand *yasm_insn_op_next(yasm_insn_operand *op); + +#if defined(YASM_LIB_INTERNAL) && !defined(YASM_DOXYGEN) +#define yasm_insn_ops_first(insn) STAILQ_FIRST(&(insn)->operands) +#define yasm_insn_op_next(cur) STAILQ_NEXT(cur, link) +#endif + +/** Add operand to the end of an instruction. + * \note Does not make a copy of the operand; so don't pass this function + * static or local variables, and discard the op pointer after calling + * this function. + * \param insn instruction + * \param op operand (may be NULL) + * \return If operand was actually appended (it wasn't NULL), the operand; + * otherwise NULL. + */ +/*@null@*/ yasm_insn_operand *yasm_insn_ops_append + (yasm_insn *insn, + /*@returned@*/ /*@null@*/ yasm_insn_operand *op); + +/** Associate a prefix with an instruction. + * \param insn instruction + * \param prefix data that identifies the prefix + */ +void yasm_insn_add_prefix(yasm_insn *insn, uintptr_t prefix); + +/** Associate a segment prefix with an instruction. + * \param insn instruction + * \param segreg data that identifies the segment register + */ +void yasm_insn_add_seg_prefix(yasm_insn *insn, uintptr_t segreg); + +/** Initialize the common parts of an instruction. + * \internal For use by yasm_arch implementations only. + * \param insn instruction + */ +void yasm_insn_initialize(/*@out@*/ yasm_insn *insn); + +/** Delete the common parts of an instruction. + * \internal For use by yasm_arch implementations only. + * \param insn instruction + * \param content if nonzero, deletes content of each operand + * \param arch architecture + */ +void yasm_insn_delete(yasm_insn *insn, + void (*ea_destroy) (/*@only@*/ yasm_effaddr *)); + +/** Print a list of instruction operands. For debugging purposes. + * \internal For use by yasm_arch implementations only. + * \param insn instruction + * \param f file + * \param indent_level indentation level + * \param arch architecture + */ +void yasm_insn_print(const yasm_insn *insn, FILE *f, int indent_level); + +/** Finalize the common parts of an instruction. + * \internal For use by yasm_arch implementations only. + * \param insn instruction + */ +void yasm_insn_finalize(yasm_insn *insn); + +#endif diff --git a/modules/arch/x86/x86arch.c b/modules/arch/x86/x86arch.c index 42a95389..ba323185 100644 --- a/modules/arch/x86/x86arch.c +++ b/modules/arch/x86/x86arch.c @@ -110,9 +110,9 @@ x86_set_var(yasm_arch *arch, const char *var, unsigned long val) { yasm_arch_x86 *arch_x86 = (yasm_arch_x86 *)arch; if (yasm__strcasecmp(var, "mode_bits") == 0) - arch_x86->mode_bits = (unsigned char)val; + arch_x86->mode_bits = (unsigned int)val; else if (yasm__strcasecmp(var, "force_strict") == 0) - arch_x86->force_strict = (unsigned char)val; + arch_x86->force_strict = (unsigned int)val; else return 1; return 0; @@ -364,7 +364,7 @@ x86_get_fill(const yasm_arch *arch) } unsigned int -yasm_x86__get_reg_size(yasm_arch *arch, uintptr_t reg) +yasm_x86__get_reg_size(uintptr_t reg) { switch ((x86_expritem_reg_size)(reg & ~0xFUL)) { case X86_REG8: @@ -390,6 +390,12 @@ yasm_x86__get_reg_size(yasm_arch *arch, uintptr_t reg) return 0; } +static unsigned int +x86_get_reg_size(yasm_arch *arch, uintptr_t reg) +{ + return yasm_x86__get_reg_size(reg); +} + static uintptr_t x86_reggroup_get_reg(yasm_arch *arch, uintptr_t reggroup, unsigned long regindex) @@ -510,14 +516,16 @@ yasm_arch_module yasm_x86_LTX_arch = { yasm_x86__parse_check_insnprefix, yasm_x86__parse_check_regtmod, x86_get_fill, - yasm_x86__finalize_insn, yasm_x86__floatnum_tobytes, yasm_x86__intnum_tobytes, - yasm_x86__get_reg_size, + x86_get_reg_size, x86_reggroup_get_reg, x86_reg_print, x86_segreg_print, yasm_x86__ea_create_expr, + yasm_x86__ea_destroy, + yasm_x86__ea_print, + yasm_x86__create_empty_insn, x86_machines, "x86", 16, diff --git a/modules/arch/x86/x86arch.h b/modules/arch/x86/x86arch.h index 5659ba5f..6d2fa050 100644 --- a/modules/arch/x86/x86arch.h +++ b/modules/arch/x86/x86arch.h @@ -76,11 +76,11 @@ typedef struct yasm_arch_x86 { unsigned long cpu_enabled; unsigned int amd64_machine; enum { - X86_PARSER_NASM, - X86_PARSER_GAS + X86_PARSER_NASM = 0, + X86_PARSER_GAS = 1 } parser; - unsigned char mode_bits; - unsigned char force_strict; + unsigned int mode_bits; + unsigned int force_strict; } yasm_arch_x86; /* 0-15 (low 4 bits) used for register number, stored in same data area. @@ -101,12 +101,13 @@ typedef enum { X86_RIP = 0xC<<4 /* 64-bit mode only, always RIP (regnum ignored) */ } x86_expritem_reg_size; +/* Low 8 bits are used for the prefix value, stored in same data area. */ typedef enum { - X86_LOCKREP = 1, - X86_ADDRSIZE, - X86_OPERSIZE, - X86_SEGREG, - X86_REX + X86_LOCKREP = 1<<8, + X86_ADDRSIZE = 2<<8, + X86_OPERSIZE = 3<<8, + X86_SEGREG = 4<<8, + X86_REX = 5<<8 } x86_parse_insn_prefix; typedef enum { @@ -168,6 +169,8 @@ x86_effaddr *yasm_x86__ea_create_imm (/*@keep@*/ yasm_expr *imm, unsigned int im_len); yasm_effaddr *yasm_x86__ea_create_expr(yasm_arch *arch, /*@keep@*/ yasm_expr *e); +void yasm_x86__ea_destroy(yasm_effaddr *ea); +void yasm_x86__ea_print(const yasm_effaddr *ea, FILE *f, int indent_level); void yasm_x86__bc_insn_opersize_override(yasm_bytecode *bc, unsigned int opersize); @@ -253,7 +256,7 @@ void yasm_x86__bc_transform_jmpfar(yasm_bytecode *bc, x86_jmpfar *jmpfar); void yasm_x86__bc_apply_prefixes (x86_common *common, unsigned char *rex, unsigned int def_opersize_64, - int num_prefixes, uintptr_t **prefixes); + unsigned int num_prefixes, uintptr_t *prefixes); /* Check an effective address. Returns 0 if EA was successfully determined, * 1 if invalid EA, or 2 if indeterminate EA. @@ -266,17 +269,11 @@ void yasm_x86__parse_cpu(yasm_arch_x86 *arch_x86, const char *cpuid, size_t cpuid_len); yasm_arch_insnprefix yasm_x86__parse_check_insnprefix - (yasm_arch *arch, /*@out@*/ uintptr_t data[4], const char *id, - size_t id_len); + (yasm_arch *arch, const char *id, size_t id_len, unsigned long line, + /*@out@*/ yasm_bytecode **bc, /*@out@*/ uintptr_t *prefix); yasm_arch_regtmod yasm_x86__parse_check_regtmod - (yasm_arch *arch, /*@out@*/ uintptr_t *data, const char *id, - size_t id_len); - -void yasm_x86__finalize_insn - (yasm_arch *arch, yasm_bytecode *bc, yasm_bytecode *prev_bc, - const uintptr_t data[4], int num_operands, - /*@null@*/ yasm_insn_operands *operands, int num_prefixes, - uintptr_t **prefixes, int num_segregs, const uintptr_t *segregs); + (yasm_arch *arch, const char *id, size_t id_len, + /*@out@*/ uintptr_t *data); int yasm_x86__floatnum_tobytes (yasm_arch *arch, const yasm_floatnum *flt, unsigned char *buf, @@ -286,5 +283,8 @@ int yasm_x86__intnum_tobytes size_t destsize, size_t valsize, int shift, const yasm_bytecode *bc, int warn); -unsigned int yasm_x86__get_reg_size(yasm_arch *arch, uintptr_t reg); +unsigned int yasm_x86__get_reg_size(uintptr_t reg); + +/*@only@*/ yasm_bytecode *yasm_x86__create_empty_insn(yasm_arch *arch, + unsigned long line); #endif diff --git a/modules/arch/x86/x86bc.c b/modules/arch/x86/x86bc.c index b1fa1a28..ade330e2 100644 --- a/modules/arch/x86/x86bc.c +++ b/modules/arch/x86/x86bc.c @@ -35,11 +35,6 @@ #include "x86arch.h" -/* Effective address callback function prototypes */ - -static void x86_ea_destroy(yasm_effaddr *ea); -static void x86_ea_print(const yasm_effaddr *ea, FILE *f, int indent_level); - /* Bytecode callback function prototypes */ static void x86_bc_insn_destroy(void *contents); @@ -78,13 +73,6 @@ static int x86_bc_jmpfar_tobytes yasm_output_value_func output_value, /*@null@*/ yasm_output_reloc_func output_reloc); -/* Effective address callback structures */ - -static const yasm_effaddr_callback x86_ea_callback = { - x86_ea_destroy, - x86_ea_print -}; - /* Bytecode callback structures */ static const yasm_bytecode_callback x86_bc_callback_insn = { @@ -199,7 +187,6 @@ yasm_x86__ea_create_reg(unsigned long reg, unsigned char *rex, x86_ea = yasm_xmalloc(sizeof(x86_effaddr)); - x86_ea->ea.callback = &x86_ea_callback; yasm_value_initialize(&x86_ea->ea.disp, NULL, 0); x86_ea->ea.need_nonzero_len = 0; x86_ea->ea.need_disp = 0; @@ -224,7 +211,6 @@ yasm_x86__ea_create_expr(yasm_arch *arch, yasm_expr *e) x86_ea = yasm_xmalloc(sizeof(x86_effaddr)); - x86_ea->ea.callback = &x86_ea_callback; if (arch_x86->parser == X86_PARSER_GAS) { /* Need to change foo+rip into foo wrt rip. * Note this assumes a particular ordering coming from the parser @@ -267,7 +253,6 @@ yasm_x86__ea_create_imm(yasm_expr *imm, unsigned int im_len) x86_ea = yasm_xmalloc(sizeof(x86_effaddr)); - x86_ea->ea.callback = &x86_ea_callback; yasm_value_initialize(&x86_ea->ea.disp, imm, im_len); x86_ea->ea.need_disp = 1; x86_ea->ea.nosplit = 0; @@ -286,25 +271,25 @@ yasm_x86__ea_create_imm(yasm_expr *imm, unsigned int im_len) void yasm_x86__bc_apply_prefixes(x86_common *common, unsigned char *rex, - unsigned int def_opersize_64, int num_prefixes, - uintptr_t **prefixes) + unsigned int def_opersize_64, + unsigned int num_prefixes, uintptr_t *prefixes) { - int i; + unsigned int i; int first = 1; for (i=0; ilockrep_pre != 0) yasm_warn_set(YASM_WARN_GENERAL, N_("multiple LOCK or REP prefixes, using leftmost")); - common->lockrep_pre = (unsigned char)prefixes[i][1]; + common->lockrep_pre = (unsigned char)prefixes[i] & 0xff; break; case X86_ADDRSIZE: - common->addrsize = (unsigned char)prefixes[i][1]; + common->addrsize = (unsigned char)prefixes[i] & 0xff; break; case X86_OPERSIZE: - common->opersize = (unsigned char)prefixes[i][1]; + common->opersize = (unsigned char)prefixes[i] & 0xff; if (common->mode_bits == 64 && common->opersize == 64 && def_opersize_64 != 64) { if (*rex == 0xff) @@ -318,7 +303,7 @@ yasm_x86__bc_apply_prefixes(x86_common *common, unsigned char *rex, /* This is a hack.. we should really be putting this in the * the effective address! */ - common->lockrep_pre = (unsigned char)prefixes[i][1]; + common->lockrep_pre = (unsigned char)prefixes[i] & 0xff; break; case X86_REX: if (!rex) @@ -340,7 +325,7 @@ yasm_x86__bc_apply_prefixes(x86_common *common, unsigned char *rex, * 64 bit mode due to checks in parse_check_prefix(). */ common->mode_bits = 64; - *rex = (unsigned char)prefixes[i][1]; + *rex = (unsigned char)prefixes[i] & 0xff; } first = 0; break; @@ -353,7 +338,7 @@ x86_bc_insn_destroy(void *contents) { x86_insn *insn = (x86_insn *)contents; if (insn->x86_ea) - yasm_ea_destroy((yasm_effaddr *)insn->x86_ea); + yasm_x86__ea_destroy((yasm_effaddr *)insn->x86_ea); if (insn->imm) { yasm_value_delete(insn->imm); yasm_xfree(insn->imm); @@ -378,15 +363,20 @@ x86_bc_jmpfar_destroy(void *contents) yasm_xfree(contents); } -static void -x86_ea_destroy(yasm_effaddr *ea) +void +yasm_x86__ea_destroy(yasm_effaddr *ea) { + yasm_value_delete(&ea->disp); + yasm_xfree(ea); } -static void -x86_ea_print(const yasm_effaddr *ea, FILE *f, int indent_level) +void +yasm_x86__ea_print(const yasm_effaddr *ea, FILE *f, int indent_level) { const x86_effaddr *x86_ea = (const x86_effaddr *)ea; + fprintf(f, "%*sDisp:\n", indent_level, ""); + yasm_value_print(&ea->disp, f, indent_level+1); + fprintf(f, "%*sNoSplit=%u\n", indent_level, "", (unsigned int)ea->nosplit); fprintf(f, "%*sSegmentOv=%02x\n", indent_level, "", (unsigned int)x86_ea->ea.segreg); fprintf(f, "%*sModRM=%03o ValidRM=%u NeedRM=%u\n", indent_level, "", @@ -427,7 +417,7 @@ x86_bc_insn_print(const void *contents, FILE *f, int indent_level) fprintf(f, "%*sEffective Address:", indent_level, ""); if (insn->x86_ea) { fprintf(f, "\n"); - yasm_ea_print((yasm_effaddr *)insn->x86_ea, f, indent_level+1); + yasm_x86__ea_print((yasm_effaddr *)insn->x86_ea, f, indent_level+1); } else fprintf(f, " (nil)\n"); fprintf(f, "%*sImmediate Value:", indent_level, ""); diff --git a/modules/arch/x86/x86id.c b/modules/arch/x86/x86id.c index 7e27273d..76b621be 100644 --- a/modules/arch/x86/x86id.c +++ b/modules/arch/x86/x86id.c @@ -279,6 +279,48 @@ typedef struct x86_insn_info { unsigned long operands[3]; } x86_insn_info; +typedef struct x86_id_insn { + yasm_insn insn; /* base structure */ + + /* instruction parse group - NULL if empty instruction (just prefixes) */ + /*@null@*/ const x86_insn_info *group; + + /* CPU feature flags enabled at the time of parsing the instruction */ + unsigned long cpu_enabled; + + /* Modifier data */ + unsigned long mod_data; + + /* Number of elements in the instruction parse group */ + unsigned int num_info:8; + + /* BITS setting active at the time of parsing the instruction */ + unsigned int mode_bits:8; + + /* Suffix flags */ + unsigned int suffix:8; + + /* Parser enabled at the time of parsing the instruction */ + unsigned int parser:2; + + /* Strict forced setting at the time of parsing the instruction */ + unsigned int force_strict:1; +} x86_id_insn; + +static void x86_id_insn_destroy(void *contents); +static void x86_id_insn_print(const void *contents, FILE *f, int indent_level); +static void x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc); + +static const yasm_bytecode_callback x86_id_insn_callback = { + x86_id_insn_destroy, + x86_id_insn_print, + x86_id_insn_finalize, + yasm_bc_calc_len_common, + yasm_bc_expand_common, + yasm_bc_tobytes_common, + YASM_BC_SPECIAL_INSN +}; + /* * General instruction groupings */ @@ -2275,7 +2317,7 @@ static const x86_insn_info xbts_insn[] = { static void x86_finalize_common(x86_common *common, const x86_insn_info *info, - uintptr_t mode_bits) + unsigned int mode_bits) { common->addrsize = 0; common->opersize = info->opersize; @@ -2292,21 +2334,32 @@ x86_finalize_opcode(x86_opcode *opcode, const x86_insn_info *info) opcode->opcode[2] = info->opcode[2]; } +/* Clear operands so they don't get destroyed after we've copied references. */ static void -x86_finalize_jmpfar(yasm_arch *arch, yasm_bytecode *bc, yasm_bytecode *prev_bc, - const uintptr_t data[4], int num_operands, - yasm_insn_operands *operands, int num_prefixes, - uintptr_t **prefixes, const x86_insn_info *info) +x86_id_insn_clear_operands(x86_id_insn *id_insn) { + yasm_insn_operand *op = yasm_insn_ops_first(&id_insn->insn); + while (op) { + op->type = YASM_INSN__OPERAND_REG; + op = yasm_insn_op_next(op); + } +} + +static void +x86_finalize_jmpfar(yasm_bytecode *bc, yasm_bytecode *prev_bc, + const x86_insn_info *info) +{ + x86_id_insn *id_insn = (x86_id_insn *)bc->contents; + unsigned int mode_bits = id_insn->mode_bits; x86_jmpfar *jmpfar; yasm_insn_operand *op; /*@only@*/ yasm_expr *segment; jmpfar = yasm_xmalloc(sizeof(x86_jmpfar)); - x86_finalize_common(&jmpfar->common, info, data[3]); + x86_finalize_common(&jmpfar->common, info, mode_bits); x86_finalize_opcode(&jmpfar->opcode, info); - op = yasm_ops_first(operands); + op = yasm_insn_ops_first(&id_insn->insn); if (op->type == YASM_INSN__OPERAND_IMM && yasm_expr_is_op(op->data.val, YASM_EXPR_SEGOFF)) { @@ -2334,30 +2387,32 @@ x86_finalize_jmpfar(yasm_arch *arch, yasm_bytecode *bc, yasm_bytecode *prev_bc, yasm_internal_error(N_("didn't get FAR expression in jmpfar")); yasm_x86__bc_apply_prefixes((x86_common *)jmpfar, NULL, - info->def_opersize_64, num_prefixes, - prefixes); + info->def_opersize_64, + id_insn->insn.num_prefixes, + id_insn->insn.prefixes); + + x86_id_insn_clear_operands(id_insn); /* Transform the bytecode */ yasm_x86__bc_transform_jmpfar(bc, jmpfar); } static void -x86_finalize_jmp(yasm_arch *arch, yasm_bytecode *bc, yasm_bytecode *prev_bc, - const uintptr_t data[4], int num_operands, - yasm_insn_operands *operands, int num_prefixes, - uintptr_t **prefixes, const x86_insn_info *jinfo) +x86_finalize_jmp(yasm_bytecode *bc, yasm_bytecode *prev_bc, + const x86_insn_info *jinfo) { + x86_id_insn *id_insn = (x86_id_insn *)bc->contents; x86_jmp *jmp; - int num_info = (int)(data[1]&0xFF); - x86_insn_info *info = (x86_insn_info *)data[0]; - unsigned long mod_data = (unsigned long)(data[1] >> 8); - unsigned int mode_bits = (unsigned int)(data[3] & 0xFF); - /*unsigned char suffix = (unsigned char)((data[3]>>8) & 0xFF);*/ + int num_info = id_insn->num_info; + const x86_insn_info *info = id_insn->group; + unsigned long mod_data = id_insn->mod_data; + unsigned int mode_bits = id_insn->mode_bits; + /*unsigned char suffix = id_insn->suffix;*/ yasm_insn_operand *op; static const unsigned char size_lookup[] = {0, 8, 16, 32, 64, 80, 128, 0}; /* We know the target is in operand 0, but sanity check for Imm. */ - op = yasm_ops_first(operands); + op = yasm_insn_ops_first(&id_insn->insn); if (op->type != YASM_INSN__OPERAND_IMM) yasm_internal_error(N_("invalid operand conversion")); @@ -2408,7 +2463,7 @@ x86_finalize_jmp(yasm_arch *arch, yasm_bytecode *bc, yasm_bytecode *prev_bc, continue; cpu &= ~(CPU_64 | CPU_Not64); - if ((data[2] & cpu) != cpu) + if ((id_insn->cpu_enabled & cpu) != cpu) continue; if (info->num_operands == 0) @@ -2449,20 +2504,23 @@ x86_finalize_jmp(yasm_arch *arch, yasm_bytecode *bc, yasm_bytecode *prev_bc, } yasm_x86__bc_apply_prefixes((x86_common *)jmp, NULL, info->def_opersize_64, - num_prefixes, prefixes); + id_insn->insn.num_prefixes, + id_insn->insn.prefixes); + + x86_id_insn_clear_operands(id_insn); /* Transform the bytecode */ yasm_x86__bc_transform_jmp(bc, jmp); } static const x86_insn_info * -x86_find_match(yasm_arch *arch, int num_info, const x86_insn_info *info, - uintptr_t cpu, unsigned int mode_bits, unsigned int suffix, - int num_operands, yasm_insn_operand **ops, +x86_find_match(x86_id_insn *id_insn, yasm_insn_operand **ops, yasm_insn_operand **rev_ops, const unsigned int *size_lookup, int bypass) { - yasm_arch_x86 *arch_x86 = (yasm_arch_x86 *)arch; + const x86_insn_info *info = id_insn->group; + unsigned int num_info = id_insn->num_info; + unsigned int suffix = id_insn->suffix; int found = 0; /* Just do a simple linear search through the info array for a match. @@ -2478,25 +2536,25 @@ x86_find_match(yasm_arch *arch, int num_info, const x86_insn_info *info, /* Match CPU */ icpu = info->cpu; - if ((icpu & CPU_64) && mode_bits != 64) + if ((icpu & CPU_64) && id_insn->mode_bits != 64) continue; - if ((icpu & CPU_Not64) && mode_bits == 64) + if ((icpu & CPU_Not64) && id_insn->mode_bits == 64) continue; icpu &= ~(CPU_64 | CPU_Not64); - if (bypass != 7 && (cpu & icpu) != icpu) + if (bypass != 7 && (id_insn->cpu_enabled & icpu) != icpu) continue; /* Match # of operands */ - if (num_operands != info->num_operands) + if (id_insn->insn.num_operands != info->num_operands) continue; /* Match parser mode */ if ((info->modifiers & MOD_GasOnly) - && arch_x86->parser != X86_PARSER_GAS) + && id_insn->parser != X86_PARSER_GAS) continue; if ((info->modifiers & MOD_GasIllegal) - && arch_x86->parser == X86_PARSER_GAS) + && id_insn->parser == X86_PARSER_GAS) continue; /* Match suffix (if required) */ @@ -2506,11 +2564,11 @@ x86_find_match(yasm_arch *arch, int num_info, const x86_insn_info *info, /* Use reversed operands in GAS mode if not otherwise specified */ use_ops = ops; - if (arch_x86->parser == X86_PARSER_GAS + if (id_insn->parser == X86_PARSER_GAS && !(info->modifiers & MOD_GasNoRev)) use_ops = rev_ops; - if (num_operands == 0) { + if (id_insn->insn.num_operands == 0) { found = 1; /* no operands -> must have a match here. */ break; } @@ -2668,7 +2726,7 @@ x86_find_match(yasm_arch *arch, int num_info, const x86_insn_info *info, break; case OPT_MemOffs: if (op->type != YASM_INSN__OPERAND_MEMORY || - yasm_expr__contains(yasm_ea_get_disp(op->data.ea), + yasm_expr__contains(op->data.ea->disp.abs, YASM_EXPR_REG)) mismatch = 1; break; @@ -2725,7 +2783,7 @@ x86_find_match(yasm_arch *arch, int num_info, const x86_insn_info *info, */ if (op->type == YASM_INSN__OPERAND_REG && op->size == 0) { /* Register size must exactly match */ - if (yasm_x86__get_reg_size(arch, op->data.reg) != size) + if (yasm_x86__get_reg_size(op->data.reg) != size) mismatch = 1; } else if (((info->operands[i] & OPT_MASK) == OPT_Imm || (info->operands[i] & OPT_MASK) == OPT_ImmNotSegOff @@ -2739,8 +2797,7 @@ x86_find_match(yasm_arch *arch, int num_info, const x86_insn_info *info, if ((bypass == 4 && i == 0) || (bypass == 5 && i == 1) || (bypass == 6 && i == 3)) ; - else if (yasm_x86__get_reg_size(arch, - op->data.reg) != size) + else if (yasm_x86__get_reg_size(op->data.reg) != size) mismatch = 1; } else { if ((bypass == 1 && i == 0) || (bypass == 2 && i == 1) @@ -2812,9 +2869,7 @@ x86_find_match(yasm_arch *arch, int num_info, const x86_insn_info *info, } static void -x86_match_error(yasm_arch *arch, int num_info, const x86_insn_info *info, - uintptr_t cpu, unsigned int mode_bits, unsigned int suffix, - int num_operands, yasm_insn_operand **ops, +x86_match_error(x86_id_insn *id_insn, yasm_insn_operand **ops, yasm_insn_operand **rev_ops, const unsigned int *size_lookup) { const x86_insn_info *i; @@ -2824,8 +2879,8 @@ x86_match_error(yasm_arch *arch, int num_info, const x86_insn_info *info, /* Check for matching # of operands */ found = 0; - for (ni=num_info, i=info; ni>0; ni--, i++) { - if (num_operands == i->num_operands) { + for (ni=id_insn->num_info, i=id_insn->group; ni>0; ni--, i++) { + if (id_insn->insn.num_operands == i->num_operands) { found = 1; break; } @@ -2836,8 +2891,7 @@ x86_match_error(yasm_arch *arch, int num_info, const x86_insn_info *info, } for (bypass=1; bypass<8; bypass++) { - i = x86_find_match(arch, num_info, info, cpu, mode_bits, suffix, - num_operands, ops, rev_ops, size_lookup, bypass); + i = x86_find_match(id_insn, ops, rev_ops, size_lookup, bypass); if (i) break; } @@ -2869,56 +2923,48 @@ x86_match_error(yasm_arch *arch, int num_info, const x86_insn_info *info, } } -void -yasm_x86__finalize_insn(yasm_arch *arch, yasm_bytecode *bc, - yasm_bytecode *prev_bc, const uintptr_t data[4], - int num_operands, - /*@null@*/ yasm_insn_operands *operands, - int num_prefixes, uintptr_t **prefixes, - int num_segregs, const uintptr_t *segregs) +static void +x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) { - yasm_arch_x86 *arch_x86 = (yasm_arch_x86 *)arch; + x86_id_insn *id_insn = (x86_id_insn *)bc->contents; x86_insn *insn; - int num_info = (int)(data[1]&0xFF); - const x86_insn_info *info = (const x86_insn_info *)data[0]; - unsigned long mod_data = (unsigned long)(data[1] >> 8); - unsigned int mode_bits = (unsigned int)(data[3] & 0xFF); - unsigned int suffix = (unsigned int)((data[3]>>8) & 0xFF); + const x86_insn_info *info = id_insn->group; + unsigned long mod_data = id_insn->mod_data; + unsigned int mode_bits = id_insn->mode_bits; yasm_insn_operand *op, *ops[4], *rev_ops[4]; /*@null@*/ yasm_expr *imm; unsigned char im_len; unsigned char im_sign; unsigned char spare; - int i; + unsigned int i; unsigned int size_lookup[] = {0, 8, 16, 32, 64, 80, 128, 0}; unsigned long do_postop = 0; size_lookup[7] = mode_bits; - if (!info) { - num_info = 1; - info = empty_insn; - } + yasm_insn_finalize(&id_insn->insn); /* Build local array of operands from list, since we know we have a max * of 3 operands. */ - if (num_operands > 3) { + if (id_insn->insn.num_operands > 3) { yasm_error_set(YASM_ERROR_TYPE, N_("too many operands")); return; } ops[0] = ops[1] = ops[2] = ops[3] = NULL; - for (i = 0, op = yasm_ops_first(operands); op && i < num_operands; - op = yasm_operand_next(op), i++) + for (i = 0, op = yasm_insn_ops_first(&id_insn->insn); + op && i < id_insn->insn.num_operands; + op = yasm_insn_op_next(op), i++) ops[i] = op; /* If we're running in GAS mode, build a reverse array of the operands * as most GAS instructions have reversed operands from Intel style. */ - if (arch_x86->parser == X86_PARSER_GAS) { + if (id_insn->parser == X86_PARSER_GAS) { rev_ops[0] = rev_ops[1] = rev_ops[2] = rev_ops[3] = NULL; - for (i = num_operands-1, op = yasm_ops_first(operands); op && i >= 0; - op = yasm_operand_next(op), i--) + for (i = id_insn->insn.num_operands-1, + op = yasm_insn_ops_first(&id_insn->insn); + op; op = yasm_insn_op_next(op), i--) rev_ops[i] = op; } @@ -2926,7 +2972,7 @@ yasm_x86__finalize_insn(yasm_arch *arch, yasm_bytecode *bc, * if this is a relative jump (OPA_JmpRel). If so, run through the * operands and adjust for dereferences / lack thereof. */ - if (arch_x86->parser == X86_PARSER_GAS + if (id_insn->parser == X86_PARSER_GAS && (info->operands[0] & OPA_MASK) == OPA_JmpRel) { for (i = 0, op = ops[0]; op; op = ops[++i]) { if (!op->deref && (op->type == YASM_INSN__OPERAND_REG @@ -2944,37 +2990,30 @@ yasm_x86__finalize_insn(yasm_arch *arch, yasm_bytecode *bc, N_("skipping prefixes on this instruction")); imm = op->data.ea->disp.abs; op->data.ea->disp.abs = NULL; - yasm_ea_destroy(op->data.ea); + yasm_x86__ea_destroy(op->data.ea); op->type = YASM_INSN__OPERAND_IMM; op->data.val = imm; } } } - info = x86_find_match(arch, num_info, info, data[2], mode_bits, suffix, - num_operands, ops, rev_ops, size_lookup, 0); + info = x86_find_match(id_insn, ops, rev_ops, size_lookup, 0); if (!info) { /* Didn't find a match */ - info = (const x86_insn_info *)data[0]; - if (!info) - info = empty_insn; - x86_match_error(arch, num_info, info, data[2], mode_bits, suffix, - num_operands, ops, rev_ops, size_lookup); + x86_match_error(id_insn, ops, rev_ops, size_lookup); return; } - if (operands) { + if (id_insn->insn.num_operands > 0) { switch (info->operands[0] & OPA_MASK) { case OPA_JmpRel: /* Shortcut to JmpRel */ - x86_finalize_jmp(arch, bc, prev_bc, data, num_operands, - operands, num_prefixes, prefixes, info); + x86_finalize_jmp(bc, prev_bc, info); return; case OPA_JmpFar: /* Shortcut to JmpFar */ - x86_finalize_jmpfar(arch, bc, prev_bc, data, num_operands, - operands, num_prefixes, prefixes, info); + x86_finalize_jmpfar(bc, prev_bc, info); return; } } @@ -3039,17 +3078,19 @@ yasm_x86__finalize_insn(yasm_arch *arch, yasm_bytecode *bc, /*mod_data >>= 8;*/ } - /* In 64-bit mode, if opersize is 64 and default is not 64, force REX byte */ + /* In 64-bit mode, if opersize is 64 and default is not 64, + * force REX byte. + */ if (mode_bits == 64 && insn->common.opersize == 64 && insn->def_opersize_64 != 64) insn->rex = 0x48; /* Go through operands and assign */ - if (operands) { + if (id_insn->insn.num_operands > 0) { yasm_insn_operand **use_ops = ops; /* Use reversed operands in GAS mode if not otherwise specified */ - if (arch_x86->parser == X86_PARSER_GAS + if (id_insn->parser == X86_PARSER_GAS && !(info->modifiers & MOD_GasNoRev)) use_ops = rev_ops; @@ -3063,7 +3104,7 @@ yasm_x86__finalize_insn(yasm_arch *arch, yasm_bytecode *bc, case YASM_INSN__OPERAND_SEGREG: break; case YASM_INSN__OPERAND_MEMORY: - yasm_ea_destroy(op->data.ea); + yasm_x86__ea_destroy(op->data.ea); break; case YASM_INSN__OPERAND_IMM: yasm_expr_destroy(op->data.val); @@ -3178,7 +3219,7 @@ yasm_x86__finalize_insn(yasm_arch *arch, yasm_bytecode *bc, else yasm_error_set(YASM_ERROR_TYPE, N_("unsupported address size")); - yasm_ea_destroy(op->data.ea); + yasm_x86__ea_destroy(op->data.ea); break; } default: @@ -3196,7 +3237,7 @@ yasm_x86__finalize_insn(yasm_arch *arch, yasm_bytecode *bc, * pre-emptively expand to full size. * For unspecified size case, still optimize. */ - if (!(arch_x86->force_strict || op->strict) + if (!(id_insn->force_strict || op->strict) || op->size == 0) insn->postop = X86_POSTOP_SIGNEXT_IMM8; else if (op->size != 8) { @@ -3223,14 +3264,15 @@ yasm_x86__finalize_insn(yasm_arch *arch, yasm_bytecode *bc, if (insn->x86_ea) { yasm_x86__ea_init(insn->x86_ea, spare, prev_bc); - for (i=0; ix86_ea->ea, segregs[i]); - } else if (num_segregs > 0 && insn->special_prefix == 0) { - if (num_segregs > 1) + for (i=0; iinsn.num_segregs; i++) + yasm_ea_set_segreg(&insn->x86_ea->ea, id_insn->insn.segregs[i]); + } else if (id_insn->insn.num_segregs > 0 && insn->special_prefix == 0) { + if (id_insn->insn.num_segregs > 1) yasm_warn_set(YASM_WARN_GENERAL, N_("multiple segment overrides, using leftmost")); - insn->special_prefix = (unsigned char)(segregs[num_segregs-1]>>8); - } else if (num_segregs > 0) + insn->special_prefix = (unsigned char) + (id_insn->insn.segregs[id_insn->insn.num_segregs-1]>>8); + } else if (id_insn->insn.num_segregs > 0) yasm_internal_error(N_("unhandled segment prefix")); if (imm) { @@ -3244,7 +3286,9 @@ yasm_x86__finalize_insn(yasm_arch *arch, yasm_bytecode *bc, insn->imm = NULL; yasm_x86__bc_apply_prefixes((x86_common *)insn, &insn->rex, - insn->def_opersize_64, num_prefixes, prefixes); + insn->def_opersize_64, + id_insn->insn.num_prefixes, + id_insn->insn.prefixes); if (insn->postop == X86_POSTOP_ADDRESS16 && insn->common.addrsize) { yasm_warn_set(YASM_WARN_GENERAL, N_("address size override ignored")); @@ -3298,6 +3342,8 @@ yasm_x86__finalize_insn(yasm_arch *arch, yasm_bytecode *bc, break; } + x86_id_insn_clear_operands(id_insn); + /* Transform the bytecode */ yasm_x86__bc_transform_insn(bc, insn); } @@ -3442,14 +3488,18 @@ cpu_find_reverse(unsigned long cpu) } yasm_arch_insnprefix -yasm_x86__parse_check_insnprefix(yasm_arch *arch, uintptr_t data[4], - const char *id, size_t id_len) +yasm_x86__parse_check_insnprefix(yasm_arch *arch, const char *id, + size_t id_len, unsigned long line, + yasm_bytecode **bc, uintptr_t *prefix) { yasm_arch_x86 *arch_x86 = (yasm_arch_x86 *)arch; /*@null@*/ const insnprefix_parse_data *pdata; size_t i; static char lcaseid[16]; + *bc = (yasm_bytecode *)NULL; + *prefix = 0; + if (id_len > 15) return YASM_ARCH_NOTINSNPREFIX; for (i=0; igroup) { unsigned long cpu = pdata->data2; + x86_id_insn *id_insn; if ((cpu & CPU_64) && arch_x86->mode_bits != 64) { yasm_warn_set(YASM_WARN_GENERAL, @@ -3480,10 +3531,17 @@ yasm_x86__parse_check_insnprefix(yasm_arch *arch, uintptr_t data[4], if ((cpu & CPU_Not64) && arch_x86->mode_bits == 64) { yasm_error_set(YASM_ERROR_GENERAL, N_("`%s' invalid in 64-bit mode"), id); - data[0] = (uintptr_t)not64_insn; - data[1] = NELEMS(not64_insn); - data[2] = CPU_Not64; - data[3] = arch_x86->mode_bits; + id_insn = yasm_xmalloc(sizeof(x86_id_insn)); + yasm_insn_initialize(&id_insn->insn); + id_insn->group = not64_insn; + id_insn->cpu_enabled = CPU_Not64; + id_insn->mod_data = 0; + id_insn->num_info = NELEMS(not64_insn); + id_insn->mode_bits = arch_x86->mode_bits; + id_insn->suffix = 0; + id_insn->parser = arch_x86->parser; + id_insn->force_strict = arch_x86->force_strict != 0; + *bc = yasm_bc_create_common(&x86_id_insn_callback, id_insn, line); return YASM_ARCH_INSN; } @@ -3495,10 +3553,17 @@ yasm_x86__parse_check_insnprefix(yasm_arch *arch, uintptr_t data[4], return YASM_ARCH_NOTINSNPREFIX; } - data[0] = (uintptr_t)pdata->group; - data[1] = pdata->data1; - data[2] = arch_x86->cpu_enabled; - data[3] = (((unsigned long)pdata->flags)<<8) | arch_x86->mode_bits; + id_insn = yasm_xmalloc(sizeof(x86_id_insn)); + yasm_insn_initialize(&id_insn->insn); + id_insn->group = pdata->group; + id_insn->cpu_enabled = arch_x86->cpu_enabled; + id_insn->mod_data = pdata->data1 >> 8; + id_insn->num_info = pdata->data1 & 0xff; + id_insn->mode_bits = arch_x86->mode_bits; + id_insn->suffix = pdata->flags; + id_insn->parser = arch_x86->parser; + id_insn->force_strict = arch_x86->force_strict != 0; + *bc = yasm_bc_create_common(&x86_id_insn_callback, id_insn, line); return YASM_ARCH_INSN; } else { unsigned long type = pdata->data1; @@ -3523,8 +3588,7 @@ yasm_x86__parse_check_insnprefix(yasm_arch *arch, uintptr_t data[4], N_("`%s' is a prefix in 64-bit mode"), id); return YASM_ARCH_NOTINSNPREFIX; } - data[0] = type; - data[1] = value; + *prefix = type|value; return YASM_ARCH_PREFIX; } } @@ -3564,8 +3628,8 @@ yasm_x86__parse_cpu(yasm_arch_x86 *arch_x86, const char *cpuid, } yasm_arch_regtmod -yasm_x86__parse_check_regtmod(yasm_arch *arch, uintptr_t *data, - const char *id, size_t id_len) +yasm_x86__parse_check_regtmod(yasm_arch *arch, const char *id, size_t id_len, + uintptr_t *data) { yasm_arch_x86 *arch_x86 = (yasm_arch_x86 *)arch; /*@null@*/ const regtmod_parse_data *pdata; @@ -3603,3 +3667,38 @@ yasm_x86__parse_check_regtmod(yasm_arch *arch, uintptr_t *data, return type; } +static void +x86_id_insn_destroy(void *contents) +{ + x86_id_insn *id_insn = (x86_id_insn *)contents; + yasm_insn_delete(&id_insn->insn, yasm_x86__ea_destroy); + yasm_xfree(contents); +} + +static void +x86_id_insn_print(const void *contents, FILE *f, int indent_level) +{ + const x86_id_insn *id_insn = (const x86_id_insn *)contents; + yasm_insn_print(&id_insn->insn, f, indent_level); + /*TODO*/ +} + +/*@only@*/ yasm_bytecode * +yasm_x86__create_empty_insn(yasm_arch *arch, unsigned long line) +{ + yasm_arch_x86 *arch_x86 = (yasm_arch_x86 *)arch; + x86_id_insn *id_insn = yasm_xmalloc(sizeof(x86_id_insn)); + + yasm_insn_initialize(&id_insn->insn); + id_insn->group = empty_insn; + id_insn->cpu_enabled = arch_x86->cpu_enabled; + id_insn->mod_data = 0; + id_insn->num_info = NELEMS(empty_insn); + id_insn->mode_bits = arch_x86->mode_bits; + id_insn->suffix = 0; + id_insn->parser = arch_x86->parser; + id_insn->force_strict = arch_x86->force_strict != 0; + + return yasm_bc_create_common(&x86_id_insn_callback, id_insn, line); +} + diff --git a/modules/parsers/gas/gas-parse.c b/modules/parsers/gas/gas-parse.c index 702b47dd..8cbe4350 100644 --- a/modules/parsers/gas/gas-parse.c +++ b/modules/parsers/gas/gas-parse.c @@ -113,6 +113,9 @@ destroy_curtok_(yasm_parser_gas *parser_gas) case STRING: yasm_xfree(curval.str.contents); break; + case INSN: + yasm_bc_destroy(curval.bc); + break; default: break; } @@ -699,59 +702,53 @@ parse_instr(yasm_parser_gas *parser_gas) switch (curtok) { case INSN: { - yystype insn = curval; /* structure copy */ - yasm_insn_operands operands; - int num_operands = 0; + yasm_insn *insn; + bc = INSN_val; + insn = yasm_bc_get_insn(bc); get_next_token(); - if (is_eol()) { - /* no operands */ - return yasm_bc_create_insn(p_object->arch, insn.arch_data, - 0, NULL, cur_line); - } + if (is_eol()) + return bc; /* no operands */ /* parse operands */ - yasm_ops_initialize(&operands); for (;;) { yasm_insn_operand *op = parse_operand(parser_gas); if (!op) { yasm_error_set(YASM_ERROR_SYNTAX, N_("expression syntax error")); - yasm_ops_delete(&operands, 1); + yasm_bc_destroy(bc); return NULL; } - yasm_ops_append(&operands, op); - num_operands++; + yasm_insn_ops_append(insn, op); if (is_eol()) break; if (!expect(',')) { - yasm_ops_delete(&operands, 1); + yasm_bc_destroy(bc); return NULL; } get_next_token(); } - return yasm_bc_create_insn(p_object->arch, insn.arch_data, - num_operands, &operands, cur_line); + return bc; } case PREFIX: { - yystype prefix = curval; /* structure copy */ + uintptr_t prefix = PREFIX_val; get_next_token(); /* PREFIX */ bc = parse_instr(parser_gas); if (!bc) - bc = yasm_bc_create_empty_insn(p_object->arch, cur_line); - yasm_bc_insn_add_prefix(bc, prefix.arch_data); + bc = yasm_arch_create_empty_insn(p_object->arch, cur_line); + yasm_insn_add_prefix(yasm_bc_get_insn(bc), prefix); return bc; } case SEGREG: { - uintptr_t segreg = SEGREG_val[0]; + uintptr_t segreg = SEGREG_val; get_next_token(); /* SEGREG */ bc = parse_instr(parser_gas); if (!bc) - bc = yasm_bc_create_empty_insn(p_object->arch, cur_line); - yasm_bc_insn_add_seg_prefix(bc, segreg); + bc = yasm_arch_create_empty_insn(p_object->arch, cur_line); + yasm_insn_add_seg_prefix(yasm_bc_get_insn(bc), segreg); } default: return NULL; @@ -869,7 +866,7 @@ parse_memaddr(yasm_parser_gas *parser_gas) int strong = 0; if (curtok == SEGREG) { - uintptr_t segreg = SEGREG_val[0]; + uintptr_t segreg = SEGREG_val; get_next_token(); /* SEGREG */ if (!expect(':')) return NULL; get_next_token(); /* ':' */ @@ -900,7 +897,7 @@ parse_memaddr(yasm_parser_gas *parser_gas) /* base register */ if (curtok == REG) { - e2 = p_expr_new_ident(yasm_expr_reg(REG_val[0])); + e2 = p_expr_new_ident(yasm_expr_reg(REG_val)); get_next_token(); /* REG */ } else e2 = p_expr_new_ident(yasm_expr_int(yasm_intnum_create_uint(0))); @@ -921,7 +918,7 @@ parse_memaddr(yasm_parser_gas *parser_gas) /* index register */ if (curtok == REG) { - reg = REG_val[0]; + reg = REG_val; havereg = 1; get_next_token(); /* REG */ if (curtok != ',') { @@ -978,7 +975,7 @@ done: return NULL; ea = yasm_arch_ea_create(p_object->arch, e1); if (strong) - yasm_ea_set_strong(ea, 1); + ea->strong = 1; return ea; } @@ -991,7 +988,7 @@ parse_operand(yasm_parser_gas *parser_gas) switch (curtok) { case REG: - reg = REG_val[0]; + reg = REG_val; get_next_token(); /* REG */ return yasm_operand_create_reg(reg); case SEGREG: @@ -1003,13 +1000,13 @@ parse_operand(yasm_parser_gas *parser_gas) return NULL; return yasm_operand_create_mem(ea); } - reg = SEGREG_val[0]; + reg = SEGREG_val; get_next_token(); /* SEGREG */ return yasm_operand_create_segreg(reg); case REGGROUP: { unsigned long regindex; - reg = REGGROUP_val[0]; + reg = REGGROUP_val; get_next_token(); /* REGGROUP */ if (curtok != '(') return yasm_operand_create_reg(reg); @@ -1050,7 +1047,7 @@ parse_operand(yasm_parser_gas *parser_gas) case '*': get_next_token(); /* '*' */ if (curtok == REG) { - op = yasm_operand_create_reg(REG_val[0]); + op = yasm_operand_create_reg(REG_val); get_next_token(); /* REG */ } else { ea = parse_memaddr(parser_gas); diff --git a/modules/parsers/gas/gas-parser.h b/modules/parsers/gas/gas-parser.h index 214048e0..94ceff19 100644 --- a/modules/parsers/gas/gas-parser.h +++ b/modules/parsers/gas/gas-parser.h @@ -75,7 +75,8 @@ typedef union { char *str_val; yasm_intnum *intn; yasm_floatnum *flt; - uintptr_t arch_data[4]; + yasm_bytecode *bc; + uintptr_t arch_data; struct { char *contents; size_t len; @@ -160,7 +161,7 @@ typedef struct yasm_parser_gas { #define INTNUM_val (curval.intn) #define FLTNUM_val (curval.flt) #define STRING_val (curval.str) -#define INSN_val (curval.arch_data) +#define INSN_val (curval.bc) #define PREFIX_val (curval.arch_data) #define REG_val (curval.arch_data) #define REGGROUP_val (curval.arch_data) diff --git a/modules/parsers/gas/gas-token.re b/modules/parsers/gas/gas-token.re index 69d816b1..6cd6cd02 100644 --- a/modules/parsers/gas/gas-token.re +++ b/modules/parsers/gas/gas-token.re @@ -498,7 +498,7 @@ scan: savech = s->tok[TOKLEN]; s->tok[TOKLEN] = '\0'; switch (yasm_arch_parse_check_regtmod - (p_object->arch, lvalp->arch_data, TOK+1, TOKLEN-1)) { + (p_object->arch, TOK+1, TOKLEN-1, &lvalp->arch_data)) { case YASM_ARCH_REG: s->tok[TOKLEN] = savech; RETURN(REG); @@ -514,10 +514,7 @@ scan: yasm_error_set(YASM_ERROR_GENERAL, N_("Unrecognized register name `%s'"), s->tok); s->tok[TOKLEN] = savech; - lvalp->arch_data[0] = 0; - lvalp->arch_data[1] = 0; - lvalp->arch_data[2] = 0; - lvalp->arch_data[3] = 0; + lvalp->arch_data = 0; RETURN(REG); } @@ -539,15 +536,18 @@ scan: * instruction or directive. */ if (parser_gas->state != INSTDIR) { + uintptr_t prefix; savech = s->tok[TOKLEN]; s->tok[TOKLEN] = '\0'; switch (yasm_arch_parse_check_insnprefix - (p_object->arch, lvalp->arch_data, TOK, TOKLEN)) { + (p_object->arch, TOK, TOKLEN, cur_line, &lvalp->bc, + &prefix)) { case YASM_ARCH_INSN: s->tok[TOKLEN] = savech; parser_gas->state = INSTDIR; RETURN(INSN); case YASM_ARCH_PREFIX: + lvalp->arch_data = prefix; s->tok[TOKLEN] = savech; RETURN(PREFIX); default: diff --git a/modules/parsers/nasm/nasm-parse.c b/modules/parsers/nasm/nasm-parse.c index 7866cffe..d710a61a 100644 --- a/modules/parsers/nasm/nasm-parse.c +++ b/modules/parsers/nasm/nasm-parse.c @@ -107,6 +107,9 @@ destroy_curtok_(yasm_parser_nasm *parser_nasm) case STRING: yasm_xfree(curval.str.contents); break; + case INSN: + yasm_bc_destroy(curval.bc); + break; default: break; } @@ -596,60 +599,56 @@ incbin_done: static yasm_bytecode * parse_instr(yasm_parser_nasm *parser_nasm) { + yasm_bytecode *bc; + switch (curtok) { case INSN: { - yystype insn = curval; /* structure copy */ - yasm_insn_operands operands; - int num_operands = 0; + yasm_insn *insn; + bc = INSN_val; + insn = yasm_bc_get_insn(bc); get_next_token(); - if (is_eol()) { - /* no operands */ - return yasm_bc_create_insn(p_object->arch, insn.arch_data, 0, - NULL, cur_line); - } + if (is_eol()) + return bc; /* no operands */ /* parse operands */ - yasm_ops_initialize(&operands); for (;;) { yasm_insn_operand *op = parse_operand(parser_nasm); if (!op) { yasm_error_set(YASM_ERROR_SYNTAX, N_("expression syntax error")); - yasm_ops_delete(&operands, 1); + yasm_bc_destroy(bc); return NULL; } - yasm_ops_append(&operands, op); - num_operands++; + yasm_insn_ops_append(insn, op); if (is_eol()) break; if (!expect(',')) { - yasm_ops_delete(&operands, 1); + yasm_bc_destroy(bc); return NULL; } get_next_token(); } - return yasm_bc_create_insn(p_object->arch, insn.arch_data, - num_operands, &operands, cur_line); - } - case PREFIX: { - yystype prefix = curval; /* structure copy */ - yasm_bytecode *bc; - get_next_token(); - bc = parse_instr(parser_nasm); - if (bc) - yasm_bc_insn_add_prefix(bc, prefix.arch_data); return bc; } - case SEGREG: { - uintptr_t segreg = SEGREG_val[0]; - yasm_bytecode *bc; + case PREFIX: + { + uintptr_t prefix = PREFIX_val; get_next_token(); bc = parse_instr(parser_nasm); if (bc) - yasm_bc_insn_add_seg_prefix(bc, segreg); + yasm_insn_add_prefix(yasm_bc_get_insn(bc), prefix); + return bc; + } + case SEGREG: + { + uintptr_t segreg = SEGREG_val; + get_next_token(); + bc = parse_instr(parser_nasm); + if (bc) + yasm_insn_add_seg_prefix(yasm_bc_get_insn(bc), segreg); return bc; } default: @@ -679,11 +678,11 @@ parse_operand(yasm_parser_nasm *parser_nasm) return yasm_operand_create_mem(ea); } case SEGREG: - op = yasm_operand_create_segreg(SEGREG_val[0]); + op = yasm_operand_create_segreg(SEGREG_val); get_next_token(); return op; case REG: - op = yasm_operand_create_reg(REG_val[0]); + op = yasm_operand_create_reg(REG_val); get_next_token(); return op; case STRICT: @@ -726,7 +725,7 @@ parse_operand(yasm_parser_nasm *parser_nasm) } case TARGETMOD: { - uintptr_t tmod = TARGETMOD_val[0]; + uintptr_t tmod = TARGETMOD_val; get_next_token(); op = parse_operand(parser_nasm); if (op) @@ -751,7 +750,7 @@ parse_memaddr(yasm_parser_nasm *parser_nasm) switch (curtok) { case SEGREG: { - uintptr_t segreg = SEGREG_val[0]; + uintptr_t segreg = SEGREG_val; get_next_token(); if (!expect(':')) { yasm_error_set(YASM_ERROR_SYNTAX, @@ -770,14 +769,14 @@ parse_memaddr(yasm_parser_nasm *parser_nasm) get_next_token(); ea = parse_memaddr(parser_nasm); if (ea) - yasm_ea_set_len(ea, size); + ea->disp.size = size; return ea; } case NOSPLIT: get_next_token(); ea = parse_memaddr(parser_nasm); if (ea) - yasm_ea_set_nosplit(ea, 1); + ea->nosplit = 1; return ea; default: { @@ -975,7 +974,7 @@ parse_expr6(yasm_parser_nasm *parser_nasm, expr_type type) e = p_expr_new_ident(yasm_expr_int(INTNUM_val)); break; case REG: - e = p_expr_new_ident(yasm_expr_reg(REG_val[0])); + e = p_expr_new_ident(yasm_expr_reg(REG_val)); break; case ID: sym = yasm_symtab_use(p_symtab, ID_val, cur_line); @@ -1030,7 +1029,7 @@ parse_expr6(yasm_parser_nasm *parser_nasm, expr_type type) N_("data values can't have registers")); return NULL; } - e = p_expr_new_ident(yasm_expr_reg(REG_val[0])); + e = p_expr_new_ident(yasm_expr_reg(REG_val)); break; case STRING: e = p_expr_new_ident(yasm_expr_int( diff --git a/modules/parsers/nasm/nasm-parser.h b/modules/parsers/nasm/nasm-parser.h index de0824b5..a2671559 100644 --- a/modules/parsers/nasm/nasm-parser.h +++ b/modules/parsers/nasm/nasm-parser.h @@ -69,7 +69,8 @@ typedef union { char *str_val; yasm_intnum *intn; yasm_floatnum *flt; - uintptr_t arch_data[4]; + yasm_bytecode *bc; + uintptr_t arch_data; struct { char *contents; size_t len; @@ -144,7 +145,7 @@ typedef struct yasm_parser_nasm { #define SIZE_OVERRIDE_val (curval.int_info) #define DECLARE_DATA_val (curval.int_info) #define RESERVE_SPACE_val (curval.int_info) -#define INSN_val (curval.arch_data) +#define INSN_val (curval.bc) #define PREFIX_val (curval.arch_data) #define REG_val (curval.arch_data) #define SEGREG_val (curval.arch_data) diff --git a/modules/parsers/nasm/nasm-token.re b/modules/parsers/nasm/nasm-token.re index 56bd8dfc..0a56073a 100644 --- a/modules/parsers/nasm/nasm-token.re +++ b/modules/parsers/nasm/nasm-token.re @@ -350,21 +350,25 @@ scan: [a-zA-Z_?][a-zA-Z0-9_$#@~.?]* { savech = s->tok[TOKLEN]; s->tok[TOKLEN] = '\0'; - if (parser_nasm->state != INSTRUCTION) + if (parser_nasm->state != INSTRUCTION) { + uintptr_t prefix; switch (yasm_arch_parse_check_insnprefix - (p_object->arch, lvalp->arch_data, TOK, TOKLEN)) { + (p_object->arch, TOK, TOKLEN, cur_line, &lvalp->bc, + &prefix)) { case YASM_ARCH_INSN: parser_nasm->state = INSTRUCTION; s->tok[TOKLEN] = savech; RETURN(INSN); case YASM_ARCH_PREFIX: + lvalp->arch_data = prefix; s->tok[TOKLEN] = savech; RETURN(PREFIX); default: break; } + } switch (yasm_arch_parse_check_regtmod - (p_object->arch, lvalp->arch_data, TOK, TOKLEN)) { + (p_object->arch, TOK, TOKLEN, &lvalp->arch_data)) { case YASM_ARCH_REG: s->tok[TOKLEN] = savech; RETURN(REG); @@ -618,7 +622,7 @@ directive2: savech = s->tok[TOKLEN]; s->tok[TOKLEN] = '\0'; switch (yasm_arch_parse_check_regtmod - (p_object->arch, lvalp->arch_data, TOK, TOKLEN)) { + (p_object->arch, TOK, TOKLEN, &lvalp->arch_data)) { case YASM_ARCH_REG: s->tok[TOKLEN] = savech; RETURN(REG); From bab3f8f48a849dbed0b508bf103fc0e986e429cf Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 13 Jul 2007 17:29:59 +0000 Subject: [PATCH 025/585] Bring POTFILES.in up to date. svn path=/trunk/yasm/; revision=1890 --- po/POTFILES.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/POTFILES.in b/po/POTFILES.in index 987b022c..4dc46a98 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -10,7 +10,6 @@ frontends/yasm/yasm.c libyasm/bc-align.c libyasm/bc-data.c libyasm/bc-incbin.c -libyasm/bc-insn.c libyasm/bc-org.c libyasm/bc-reserve.c libyasm/bitvect.c @@ -20,6 +19,7 @@ libyasm/expr.c libyasm/file.c libyasm/floatnum.c libyasm/hamt.c +libyasm/insn.c libyasm/intnum.c libyasm/section.c libyasm/symrec.c From bc7a333720ad9f065459a9348a76746efd109798 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 13 Jul 2007 17:34:21 +0000 Subject: [PATCH 026/585] Bring Mkfiles up-to-date with [1889]. svn path=/trunk/yasm/; revision=1891 --- Mkfiles/Makefile.dj | 3 +-- Mkfiles/Makefile.flat | 3 +-- Mkfiles/vc/libyasm/libyasm.vcproj | 12 ++++++------ Mkfiles/vc8/libyasm/libyasm.vcproj | 16 ++++++++-------- 4 files changed, 16 insertions(+), 18 deletions(-) diff --git a/Mkfiles/Makefile.dj b/Mkfiles/Makefile.dj index dab4a5ff..aac7dc8c 100644 --- a/Mkfiles/Makefile.dj +++ b/Mkfiles/Makefile.dj @@ -16,13 +16,11 @@ BUILDCC?=$(CC) all: yasm LIBYASM_OBJS= \ - libyasm/arch.o \ libyasm/assocdat.o \ libyasm/bitvect.o \ libyasm/bc-align.o \ libyasm/bc-data.o \ libyasm/bc-incbin.o \ - libyasm/bc-insn.o \ libyasm/bc-org.o \ libyasm/bc-reserve.o \ libyasm/bytecode.o \ @@ -31,6 +29,7 @@ LIBYASM_OBJS= \ libyasm/file.o \ libyasm/floatnum.o \ libyasm/hamt.o \ + libyasm/insn.o \ libyasm/intnum.o \ libyasm/inttree.o \ libyasm/linemap.o \ diff --git a/Mkfiles/Makefile.flat b/Mkfiles/Makefile.flat index 9160a245..29e2a197 100644 --- a/Mkfiles/Makefile.flat +++ b/Mkfiles/Makefile.flat @@ -19,13 +19,11 @@ BUILDCC?=$(CC) all: yasm LIBYASM_OBJS= \ - libyasm/arch.o \ libyasm/assocdat.o \ libyasm/bitvect.o \ libyasm/bc-align.o \ libyasm/bc-data.o \ libyasm/bc-incbin.o \ - libyasm/bc-insn.o \ libyasm/bc-org.o \ libyasm/bc-reserve.o \ libyasm/bytecode.o \ @@ -34,6 +32,7 @@ LIBYASM_OBJS= \ libyasm/file.o \ libyasm/floatnum.o \ libyasm/hamt.o \ + libyasm/insn.o \ libyasm/intnum.o \ libyasm/inttree.o \ libyasm/linemap.o \ diff --git a/Mkfiles/vc/libyasm/libyasm.vcproj b/Mkfiles/vc/libyasm/libyasm.vcproj index 375f3397..43ab409c 100644 --- a/Mkfiles/vc/libyasm/libyasm.vcproj +++ b/Mkfiles/vc/libyasm/libyasm.vcproj @@ -120,9 +120,6 @@ - - @@ -138,9 +135,6 @@ - - @@ -165,6 +159,9 @@ + + @@ -259,6 +256,9 @@ + + diff --git a/Mkfiles/vc8/libyasm/libyasm.vcproj b/Mkfiles/vc8/libyasm/libyasm.vcproj index 287c988f..efbcf4c4 100644 --- a/Mkfiles/vc8/libyasm/libyasm.vcproj +++ b/Mkfiles/vc8/libyasm/libyasm.vcproj @@ -323,10 +323,6 @@ Name="Source Files" Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" > - - @@ -343,10 +339,6 @@ RelativePath="..\..\..\libyasm\bc-incbin.c" > - - @@ -387,6 +379,10 @@ RelativePath="..\..\..\libyasm\hamt.c" > + + @@ -508,6 +504,10 @@ RelativePath="..\..\..\libyasm\hamt.h" > + + From 69fc913eec98e7767ddca60ab42d96a7ddf63537 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 13 Jul 2007 20:56:28 +0000 Subject: [PATCH 027/585] Clean up a number of obsolete autoconf-detected standard C things. svn path=/trunk/yasm/; revision=1892 --- Mkfiles/dj/config.h | 36 ++++++++++---------------- Mkfiles/vc/config.h | 38 ++++++++++------------------ Mkfiles/vc8/config.h | 38 ++++++++++------------------ configure.ac | 10 +++----- libyasm/bitvect.c | 2 -- libyasm/errwarn.c | 5 +--- libyasm/file.c | 4 +-- libyasm/mergesort.c | 6 ++--- libyasm/symrec.c | 4 +-- libyasm/tests/bitvect_test.c | 11 ++------ libyasm/tests/combpath_test.c | 11 ++------ libyasm/tests/floatnum_test.c | 11 ++------ libyasm/tests/leb128_test.c | 11 ++------ libyasm/tests/splitpath_test.c | 11 ++------ libyasm/tests/uncstring_test.c | 11 ++------ modules/dbgfmts/dwarf2/dwarf2-info.c | 4 +-- modules/parsers/nasm/nasm-parse.c | 4 +-- util.h | 4 +++ 18 files changed, 70 insertions(+), 151 deletions(-) diff --git a/Mkfiles/dj/config.h b/Mkfiles/dj/config.h index 759ced57..1c834263 100644 --- a/Mkfiles/dj/config.h +++ b/Mkfiles/dj/config.h @@ -13,12 +13,20 @@ /* */ /* #undef HAVE_CATGETS */ +/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYCURRENT */ + +/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ + /* Define if the GNU dcgettext() function is already present or preinstalled. */ /* #undef HAVE_DCGETTEXT */ -/* Define if you don't have `vprintf' but do have `_doprnt'. */ -/* #undef HAVE_DOPRNT */ +/* Define to 1 if you have the header file. */ +/* #undef HAVE_DIRECT_H */ /* Define to 1 if you have the `getcwd' function. */ #define HAVE_GETCWD 1 @@ -41,15 +49,6 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_LIBGEN_H */ -/* Define if you have the header file. */ -#define HAVE_LIMITS_H 1 - -/* Define if you have the `memcpy' function. */ -#define HAVE_MEMCPY 1 - -/* Define if you have the `memmove' function. */ -#define HAVE_MEMMOVE 1 - /* Define if you have the header file. */ #define HAVE_MEMORY_H 1 @@ -83,36 +82,27 @@ /* Define if you have the `strncasecmp' function. */ #define HAVE_STRNCASECMP 1 -/* Define if you have the `strrchr' function. */ -#define HAVE_STRRCHR 1 - /* Define if you have the `strsep' function. */ #define HAVE_STRSEP 1 -/* Define if you have the header file. */ -#define HAVE_SYS_PARAM_H 1 - /* Define if you have the header file. */ #define HAVE_SYS_STAT_H 1 /* Define if you have the header file. */ #define HAVE_SYS_TYPES_H 1 -/* Define if you have that is POSIX.1 compatible. */ -#define HAVE_SYS_WAIT_H 1 - /* Define if you have the `toascii' function. */ #define HAVE_TOASCII 1 /* Define if you have the header file. */ #define HAVE_UNISTD_H 1 -/* Define if you have the vprintf function. */ -#define HAVE_VPRINTF 1 - /* Define to 1 if you have the `vsnprintf' function. */ /* #undef HAVE_VSNPRINTF */ +/* Define to 1 if you have the `_stricmp' function. */ +/* #undef HAVE__STRICMP */ + /* Name of package */ #define PACKAGE "yasm" diff --git a/Mkfiles/vc/config.h b/Mkfiles/vc/config.h index 942f3224..d217c544 100644 --- a/Mkfiles/vc/config.h +++ b/Mkfiles/vc/config.h @@ -13,12 +13,20 @@ /* */ /* #undef HAVE_CATGETS */ +/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYCURRENT */ + +/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ + /* Define if the GNU dcgettext() function is already present or preinstalled. */ /* #undef HAVE_DCGETTEXT */ -/* Define if you don't have `vprintf' but do have `_doprnt'. */ -/* #undef HAVE_DOPRNT */ +/* Define to 1 if you have the header file. */ +#define HAVE_DIRECT_H 1 /* Define to 1 if you have the `getcwd' function. */ #define HAVE_GETCWD 1 @@ -41,15 +49,6 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_LIBGEN_H */ -/* Define if you have the header file. */ -#define HAVE_LIMITS_H 1 - -/* Define if you have the `memcpy' function. */ -#define HAVE_MEMCPY 1 - -/* Define if you have the `memmove' function. */ -#define HAVE_MEMMOVE 1 - /* Define if you have the header file. */ /* #undef HAVE_MEMORY_H */ @@ -72,7 +71,7 @@ /* #undefine HAVE_STRCMPI */ /* Define if you have the `stricmp' function. */ -#define HAVE__STRICMP 1 +/* #undefine HAVE_STRICMP */ /* Define if you have the header file. */ /* #undef HAVE_STRINGS_H */ @@ -83,24 +82,15 @@ /* Define if you have the `strncasecmp' function. */ /* #undef HAVE_STRNCASECMP */ -/* Define if you have the `strrchr' function. */ -/* #undef HAVE_STRRCHR */ - /* Define if you have the `strsep' function. */ /* #undef HAVE_STRSEP */ -/* Define if you have the header file. */ -/* #undef HAVE_SYS_PARAM_H */ - /* Define if you have the header file. */ /* #undef HAVE_SYS_STAT_H */ /* Define if you have the header file. */ #define HAVE_SYS_TYPES_H 1 -/* Define if you have that is POSIX.1 compatible. */ -/* #undef HAVE_SYS_WAIT_H */ - /* Define if you have the `toascii' function. */ #define HAVE_TOASCII 1 #define toascii __toascii @@ -108,12 +98,12 @@ /* Define if you have the header file. */ /* #undef HAVE_UNISTD_H */ -/* Define if you have the vprintf function. */ -#define HAVE_VPRINTF 1 - /* Define to 1 if you have the `vsnprintf' function. */ /* #undef HAVE_VSNPRINTF */ +/* Define to 1 if you have the `_stricmp' function. */ +#undef HAVE__STRICMP 1 + /* Name of package */ #define PACKAGE "yasm" diff --git a/Mkfiles/vc8/config.h b/Mkfiles/vc8/config.h index 91168c61..62f2e7ce 100644 --- a/Mkfiles/vc8/config.h +++ b/Mkfiles/vc8/config.h @@ -13,12 +13,20 @@ /* */ /* #undef HAVE_CATGETS */ +/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYCURRENT */ + +/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ + /* Define if the GNU dcgettext() function is already present or preinstalled. */ /* #undef HAVE_DCGETTEXT */ -/* Define if you don't have `vprintf' but do have `_doprnt'. */ -/* #undef HAVE_DOPRNT */ +/* Define to 1 if you have the header file. */ +#define HAVE_DIRECT_H 1 /* Define to 1 if you have the `getcwd' function. */ #define HAVE_GETCWD 1 @@ -41,15 +49,6 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_LIBGEN_H */ -/* Define if you have the header file. */ -#define HAVE_LIMITS_H 1 - -/* Define if you have the `memcpy' function. */ -#define HAVE_MEMCPY 1 - -/* Define if you have the `memmove' function. */ -#define HAVE_MEMMOVE 1 - /* Define if you have the header file. */ /* #undef HAVE_MEMORY_H */ @@ -72,7 +71,7 @@ /* #undef HAVE_STRCMPI */ /* Define if you have the `stricmp' function. */ -#define HAVE__STRICMP 1 +/* #undefine HAVE_STRICMP */ /* Define if you have the header file. */ /* #undef HAVE_STRINGS_H */ @@ -83,24 +82,15 @@ /* Define if you have the `strncasecmp' function. */ /* #undef HAVE_STRNCASECMP */ -/* Define if you have the `strrchr' function. */ -/* #undef HAVE_STRRCHR */ - /* Define if you have the `strsep' function. */ /* #undef HAVE_STRSEP */ -/* Define if you have the header file. */ -/* #undef HAVE_SYS_PARAM_H */ - /* Define if you have the header file. */ /* #undef HAVE_SYS_STAT_H */ /* Define if you have the header file. */ #define HAVE_SYS_TYPES_H 1 -/* Define if you have that is POSIX.1 compatible. */ -/* #undef HAVE_SYS_WAIT_H */ - /* Define if you have the `toascii' function. */ #define HAVE_TOASCII 1 #define toascii __toascii @@ -108,12 +98,12 @@ /* Define if you have the header file. */ /* #undef HAVE_UNISTD_H */ -/* Define if you have the vprintf function. */ -#define HAVE_VPRINTF 1 - /* Define to 1 if you have the `vsnprintf' function. */ /* #undef HAVE_VSNPRINTF */ +/* Define to 1 if you have the `_stricmp' function. */ +#undef HAVE__STRICMP 1 + /* Name of package */ #define PACKAGE "yasm" diff --git a/configure.ac b/configure.ac index 7e44b42b..5aef29b8 100644 --- a/configure.ac +++ b/configure.ac @@ -94,8 +94,7 @@ AM_WITH_DMALLOC # Checks for header files. # AC_HEADER_STDC -AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS([limits.h sys/param.h libgen.h unistd.h]) +AC_CHECK_HEADERS([strings.h libgen.h unistd.h direct.h]) # REQUIRE standard C headers if test "$ac_cv_header_stdc" != yes; then @@ -114,11 +113,10 @@ AX_CREATE_STDINT_H([libyasm-stdint.h]) # # Checks for library functions. # -AC_FUNC_VPRINTF -AC_CHECK_FUNCS([abort memcpy memmove strrchr toascii vsnprintf]) +AC_CHECK_FUNCS([abort toascii vsnprintf]) AC_CHECK_FUNCS([strsep mergesort getcwd]) # Look for the case-insensitive comparison functions -AC_CHECK_FUNCS([strcasecmp strncasecmp stricmp strcmpi]) +AC_CHECK_FUNCS([strcasecmp strncasecmp stricmp _stricmp strcmpi]) # # Check for gettext() and other i18n/l10n things. @@ -133,7 +131,7 @@ AH_TEMPLATE([HAVE_LC_MESSAGES], []) AH_TEMPLATE([HAVE_STPCPY], []) # Check for GNU C Library -AH_TEMPLATE([HAVE_GNU_C_LIBRARY], [Define if you have the GNU C Library]) +AH_TEMPLATE([HAVE_GNU_C_LIBRARY], [Define to 1 if you have the GNU C Library]) AC_CACHE_CHECK([for GNU C Library], yasm_cv_header_gnulib, AC_EGREP_CPP(gnulib, [#include diff --git a/libyasm/bitvect.c b/libyasm/bitvect.c index dad4826b..3fbe0b95 100644 --- a/libyasm/bitvect.c +++ b/libyasm/bitvect.c @@ -10,10 +10,8 @@ RCSID("$Id$"); /* MODULE IMPORTS: */ /*****************************************************************************/ #include /* MODULE TYPE: (sys) */ -#ifdef STDC_HEADERS #include /* MODULE TYPE: (sys) */ #include /* MODULE TYPE: (sys) */ -#endif /*****************************************************************************/ /* MODULE INTERFACE: */ /*****************************************************************************/ diff --git a/libyasm/errwarn.c b/libyasm/errwarn.c index 626ecbee..b3a59c05 100644 --- a/libyasm/errwarn.c +++ b/libyasm/errwarn.c @@ -29,10 +29,7 @@ /*@unused@*/ RCSID("$Id$"); #include - -#ifdef STDC_HEADERS -# include -#endif +#include #include "coretype.h" diff --git a/libyasm/file.c b/libyasm/file.c index 2ee3ee6f..cd2e002f 100644 --- a/libyasm/file.c +++ b/libyasm/file.c @@ -28,9 +28,9 @@ /*@unused@*/ RCSID("$Id$"); /* Need either unistd.h or direct.h (on Windows) to prototype getcwd() */ -#ifdef HAVE_UNISTD_H +#if defined(HAVE_UNISTD_H) #include -#elif defined(WIN32) || defined(_WIN32) +#elif defined(HAVE_DIRECT_H) #include #endif diff --git a/libyasm/mergesort.c b/libyasm/mergesort.c index 82fe52a0..bde5242e 100644 --- a/libyasm/mergesort.c +++ b/libyasm/mergesort.c @@ -58,10 +58,8 @@ static char sccsid[] = "@(#)merge.c 8.2 (Berkeley) 2/14/94"; * (The default is pairwise merging.) */ -#ifdef STDC_HEADERS -# include -# include -#endif +#include +#include static void setup(unsigned char *, unsigned char *, size_t, size_t, int (*)(const void *, const void *)); diff --git a/libyasm/symrec.c b/libyasm/symrec.c index bef0eaa9..a28de475 100644 --- a/libyasm/symrec.c +++ b/libyasm/symrec.c @@ -28,9 +28,7 @@ #include "util.h" /*@unused@*/ RCSID("$Id$"); -#ifdef STDC_HEADERS -# include -#endif +#include #include "libyasm-stdint.h" #include "coretype.h" diff --git a/libyasm/tests/bitvect_test.c b/libyasm/tests/bitvect_test.c index 40485262..ea8f561e 100644 --- a/libyasm/tests/bitvect_test.c +++ b/libyasm/tests/bitvect_test.c @@ -23,16 +23,9 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -#ifdef HAVE_CONFIG_H -# include -#endif - -#ifdef STDC_HEADERS -# include -# include -#endif - #include +#include +#include #include "libyasm/bitvect.h" diff --git a/libyasm/tests/combpath_test.c b/libyasm/tests/combpath_test.c index e0edf8eb..35a5b454 100644 --- a/libyasm/tests/combpath_test.c +++ b/libyasm/tests/combpath_test.c @@ -23,16 +23,9 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -#ifdef HAVE_CONFIG_H -# include -#endif - -#ifdef STDC_HEADERS -# include -# include -#endif - #include +#include +#include #include "libyasm/file.h" #include "libyasm/coretype.h" diff --git a/libyasm/tests/floatnum_test.c b/libyasm/tests/floatnum_test.c index 907aac98..b0526ea5 100644 --- a/libyasm/tests/floatnum_test.c +++ b/libyasm/tests/floatnum_test.c @@ -23,16 +23,9 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -#ifdef HAVE_CONFIG_H -# include -#endif - -#ifdef STDC_HEADERS -# include -# include -#endif - #include +#include +#include #include "libyasm/floatnum.c" diff --git a/libyasm/tests/leb128_test.c b/libyasm/tests/leb128_test.c index 18ae9958..aca537b4 100644 --- a/libyasm/tests/leb128_test.c +++ b/libyasm/tests/leb128_test.c @@ -23,16 +23,9 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -#ifdef HAVE_CONFIG_H -# include -#endif - -#ifdef STDC_HEADERS -# include -# include -#endif - #include +#include +#include #include "libyasm/intnum.c" diff --git a/libyasm/tests/splitpath_test.c b/libyasm/tests/splitpath_test.c index aada6a5d..74792636 100644 --- a/libyasm/tests/splitpath_test.c +++ b/libyasm/tests/splitpath_test.c @@ -23,16 +23,9 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -#ifdef HAVE_CONFIG_H -# include -#endif - -#ifdef STDC_HEADERS -# include -# include -#endif - #include +#include +#include #include "libyasm/file.h" diff --git a/libyasm/tests/uncstring_test.c b/libyasm/tests/uncstring_test.c index a067858e..819c06f5 100644 --- a/libyasm/tests/uncstring_test.c +++ b/libyasm/tests/uncstring_test.c @@ -23,16 +23,9 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -#ifdef HAVE_CONFIG_H -# include -#endif - -#ifdef STDC_HEADERS -# include -# include -#endif - #include +#include +#include #include "util.h" #include "libyasm/errwarn.h" diff --git a/modules/dbgfmts/dwarf2/dwarf2-info.c b/modules/dbgfmts/dwarf2/dwarf2-info.c index f6d2643e..433b93ef 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-info.c +++ b/modules/dbgfmts/dwarf2/dwarf2-info.c @@ -28,9 +28,9 @@ /*@unused@*/ RCSID("$Id$"); /* Need either unistd.h or direct.h (on Windows) to prototype getcwd() */ -#ifdef HAVE_UNISTD_H +#if defined(HAVE_UNISTD_H) #include -#elif defined(WIN32) || defined(_WIN32) +#elif defined(HAVE_DIRECT_H) #include #endif diff --git a/modules/parsers/nasm/nasm-parse.c b/modules/parsers/nasm/nasm-parse.c index d710a61a..2943cf9c 100644 --- a/modules/parsers/nasm/nasm-parse.c +++ b/modules/parsers/nasm/nasm-parse.c @@ -31,9 +31,7 @@ RCSID("$Id$"); #define YASM_EXPR_INTERNAL #include -#ifdef STDC_HEADERS -# include -#endif +#include #include "modules/parsers/nasm/nasm-parser.h" diff --git a/util.h b/util.h index 18937812..f19792e8 100644 --- a/util.h +++ b/util.h @@ -60,6 +60,10 @@ #include #include +#ifdef HAVE_STRINGS_H +#include +#endif + #include #ifdef lint From ab13bd719e5dc229fc37ded795d4a8e4fb8a9a54 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 14 Jul 2007 03:11:32 +0000 Subject: [PATCH 028/585] 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 --- libyasm.h | 11 +---------- libyasm/assocdat.c | 1 - libyasm/bc-align.c | 1 - libyasm/bc-data.c | 9 --------- libyasm/bc-incbin.c | 1 - libyasm/bc-org.c | 1 - libyasm/bc-reserve.c | 1 - libyasm/bitvect.c | 1 - libyasm/bytecode.c | 1 - libyasm/bytecode.h | 8 +------- libyasm/errwarn.c | 1 - libyasm/expr.c | 1 - libyasm/floatnum.c | 1 - libyasm/hamt.c | 1 - libyasm/insn.c | 17 ---------------- libyasm/insn.h | 7 +------ libyasm/intnum.c | 1 - libyasm/inttree.c | 1 - libyasm/linemap.c | 1 - libyasm/mergesort.c | 1 - libyasm/phash.c | 1 - libyasm/section.c | 1 - libyasm/section.h | 7 ------- libyasm/strcasecmp.c | 1 - libyasm/strsep.c | 1 - libyasm/symrec.c | 1 - libyasm/valparam.c | 26 ------------------------- libyasm/valparam.h | 11 +---------- libyasm/value.c | 1 - libyasm/xmalloc.c | 1 - libyasm/xstrdup.c | 1 - modules/arch/lc3b/lc3barch.c | 1 - modules/arch/lc3b/lc3bbc.c | 1 - modules/arch/lc3b/lc3bid.re | 1 - modules/arch/x86/x86arch.c | 1 - modules/arch/x86/x86bc.c | 1 - modules/arch/x86/x86expr.c | 1 - modules/arch/x86/x86id.c | 1 - modules/dbgfmts/codeview/cv-dbgfmt.c | 1 - modules/dbgfmts/codeview/cv-symline.c | 1 - modules/dbgfmts/codeview/cv-type.c | 1 - modules/dbgfmts/dwarf2/dwarf2-aranges.c | 1 - modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c | 1 - modules/dbgfmts/dwarf2/dwarf2-info.c | 1 - modules/dbgfmts/dwarf2/dwarf2-line.c | 1 - modules/dbgfmts/null/null-dbgfmt.c | 1 - modules/dbgfmts/stabs/stabs-dbgfmt.c | 1 - modules/listfmts/nasm/nasm-listfmt.c | 1 - modules/objfmts/bin/bin-objfmt.c | 1 - modules/objfmts/coff/coff-objfmt.c | 1 - modules/objfmts/coff/win64-except.c | 1 - modules/objfmts/dbg/dbg-objfmt.c | 1 - modules/objfmts/elf/elf-objfmt.c | 1 - modules/objfmts/elf/elf-x86-amd64.c | 1 - modules/objfmts/elf/elf-x86-x86.c | 1 - modules/objfmts/elf/elf.c | 1 - modules/objfmts/macho/macho-objfmt.c | 1 - modules/objfmts/rdf/rdf-objfmt.c | 1 - modules/objfmts/xdf/xdf-objfmt.c | 1 - modules/parsers/gas/gas-parse.c | 1 - modules/parsers/gas/gas-parser.c | 1 - modules/parsers/gas/gas-token.re | 1 - modules/parsers/nasm/nasm-parse.c | 1 - modules/parsers/nasm/nasm-parser.c | 1 - modules/parsers/nasm/nasm-token.re | 1 - modules/preprocs/nasm/nasm-preproc.c | 1 - modules/preprocs/raw/raw-preproc.c | 1 - modules/preprocs/yapp/yapp-preproc.c | 1 - 68 files changed, 4 insertions(+), 152 deletions(-) diff --git a/libyasm.h b/libyasm.h index 8fb7aca7..91596b7f 100644 --- a/libyasm.h +++ b/libyasm.h @@ -31,10 +31,6 @@ * POSSIBILITY OF SUCH DAMAGE. * \endlicense * - * Define YASM_LIB_INTERNAL to include many internal function and variable - * definitions that violate the yasm_* namespace. This includes - * compat-queue.h, bitvect.h, and hamt.h. - * * Additional parts may be included via: * - YASM_BC_INTERNAL: reveal bytecode internal structures via bc-int.h * inclusion @@ -55,9 +51,7 @@ typedef unsigned long uintptr_t; #include #endif -#ifdef YASM_LIB_INTERNAL -# include -#endif +#include #include #include @@ -85,7 +79,6 @@ typedef unsigned long uintptr_t; #include #include -#ifdef YASM_LIB_INTERNAL #ifdef YASM_BC_INTERNAL #include #endif @@ -93,8 +86,6 @@ typedef unsigned long uintptr_t; #include #endif #include -#include #include -#endif #endif diff --git a/libyasm/assocdat.c b/libyasm/assocdat.c index f27b2b41..8364d6c3 100644 --- a/libyasm/assocdat.c +++ b/libyasm/assocdat.c @@ -24,7 +24,6 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -#define YASM_LIB_INTERNAL #include "util.h" /*@unused@*/ RCSID("$Id$"); diff --git a/libyasm/bc-align.c b/libyasm/bc-align.c index dec63a2b..52474e71 100644 --- a/libyasm/bc-align.c +++ b/libyasm/bc-align.c @@ -24,7 +24,6 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -#define YASM_LIB_INTERNAL #include "util.h" /*@unused@*/ RCSID("$Id$"); diff --git a/libyasm/bc-data.c b/libyasm/bc-data.c index 50851eb1..cb7dc310 100644 --- a/libyasm/bc-data.c +++ b/libyasm/bc-data.c @@ -24,7 +24,6 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -#define YASM_LIB_INTERNAL #include "util.h" /*@unused@*/ RCSID("$Id$"); @@ -451,11 +450,3 @@ yasm_dvs_print(const yasm_datavalhead *head, FILE *f, int indent_level) } } } - -/* Non-macro yasm_dvs_initialize() for non-YASM_LIB_INTERNAL users. */ -#undef yasm_dvs_initialize -void -yasm_dvs_initialize(yasm_datavalhead *headp) -{ - STAILQ_INIT(headp); -} diff --git a/libyasm/bc-incbin.c b/libyasm/bc-incbin.c index f97f6901..13703105 100644 --- a/libyasm/bc-incbin.c +++ b/libyasm/bc-incbin.c @@ -24,7 +24,6 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -#define YASM_LIB_INTERNAL #include "util.h" /*@unused@*/ RCSID("$Id$"); diff --git a/libyasm/bc-org.c b/libyasm/bc-org.c index 0b73c79f..da1f743d 100644 --- a/libyasm/bc-org.c +++ b/libyasm/bc-org.c @@ -24,7 +24,6 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -#define YASM_LIB_INTERNAL #include "util.h" /*@unused@*/ RCSID("$Id$"); diff --git a/libyasm/bc-reserve.c b/libyasm/bc-reserve.c index 9acde378..66224dcf 100644 --- a/libyasm/bc-reserve.c +++ b/libyasm/bc-reserve.c @@ -24,7 +24,6 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -#define YASM_LIB_INTERNAL #include "util.h" /*@unused@*/ RCSID("$Id$"); diff --git a/libyasm/bitvect.c b/libyasm/bitvect.c index 3fbe0b95..49f19b26 100644 --- a/libyasm/bitvect.c +++ b/libyasm/bitvect.c @@ -1,4 +1,3 @@ -#define YASM_LIB_INTERNAL #include "util.h" RCSID("$Id$"); diff --git a/libyasm/bytecode.c b/libyasm/bytecode.c index d9c89282..e8ea9872 100644 --- a/libyasm/bytecode.c +++ b/libyasm/bytecode.c @@ -24,7 +24,6 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -#define YASM_LIB_INTERNAL #include "util.h" /*@unused@*/ RCSID("$Id$"); diff --git a/libyasm/bytecode.h b/libyasm/bytecode.h index ef693ed3..8fa273bd 100644 --- a/libyasm/bytecode.h +++ b/libyasm/bytecode.h @@ -39,9 +39,7 @@ typedef struct yasm_dataval yasm_dataval; /** A list of data values (opaque type). */ typedef struct yasm_datavalhead yasm_datavalhead; -#ifdef YASM_LIB_INTERNAL /*@reldef@*/ STAILQ_HEAD(yasm_datavalhead, yasm_dataval); -#endif /** Set multiple field of a bytecode. * A bytecode can be repeated a number of times when output. This function @@ -143,15 +141,13 @@ void yasm_bc_set_multiple(yasm_bytecode *bc, /*@keep@*/ yasm_expr *e); /*@dependent@*/ /*@null@*/ yasm_section *yasm_bc_get_section (yasm_bytecode *bc); -#ifdef YASM_LIB_INTERNAL /** Add to the list of symrecs that reference a bytecode. For symrec use * only. * \param bc bytecode * \param sym symbol */ void yasm_bc__add_symrec(yasm_bytecode *bc, /*@dependent@*/ yasm_symrec *sym); -#endif - + /** Delete (free allocated memory for) a bytecode. * \param bc bytecode (only pointer to it); may be NULL */ @@ -313,9 +309,7 @@ yasm_dataval *yasm_dv_create_raw(/*@keep@*/ unsigned char *contents, * \param headp list of data values */ void yasm_dvs_initialize(yasm_datavalhead *headp); -#ifdef YASM_LIB_INTERNAL #define yasm_dvs_initialize(headp) STAILQ_INIT(headp) -#endif /** Delete (free allocated memory for) a list of data values. * \param headp list of data values diff --git a/libyasm/errwarn.c b/libyasm/errwarn.c index b3a59c05..64b2f9eb 100644 --- a/libyasm/errwarn.c +++ b/libyasm/errwarn.c @@ -24,7 +24,6 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -#define YASM_LIB_INTERNAL #include "util.h" /*@unused@*/ RCSID("$Id$"); diff --git a/libyasm/expr.c b/libyasm/expr.c index 470184df..34800935 100644 --- a/libyasm/expr.c +++ b/libyasm/expr.c @@ -24,7 +24,6 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -#define YASM_LIB_INTERNAL #include "util.h" /*@unused@*/ RCSID("$Id$"); diff --git a/libyasm/floatnum.c b/libyasm/floatnum.c index cb0435fe..951e17ca 100644 --- a/libyasm/floatnum.c +++ b/libyasm/floatnum.c @@ -26,7 +26,6 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -#define YASM_LIB_INTERNAL #include "util.h" /*@unused@*/ RCSID("$Id$"); diff --git a/libyasm/hamt.c b/libyasm/hamt.c index 32e13035..dd28c544 100644 --- a/libyasm/hamt.c +++ b/libyasm/hamt.c @@ -29,7 +29,6 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -#define YASM_LIB_INTERNAL #include "util.h" /*@unused@*/ RCSID("$Id$"); diff --git a/libyasm/insn.c b/libyasm/insn.c index 7fc21c38..219a56c0 100644 --- a/libyasm/insn.c +++ b/libyasm/insn.c @@ -24,7 +24,6 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -#define YASM_LIB_INTERNAL #include "util.h" /*@unused@*/ RCSID("$Id$"); @@ -292,19 +291,3 @@ yasm_insn_finalize(yasm_insn *insn) } } } - -/* Non-macro yasm_insn_ops_first() for non-YASM_LIB_INTERNAL users. */ -#undef yasm_insn_ops_first -yasm_insn_operand * -yasm_insn_ops_first(yasm_insn *insn) -{ - return STAILQ_FIRST(&insn->operands); -} - -/* Non-macro yasm_insn_op_next() for non-YASM_LIB_INTERNAL users. */ -#undef yasm_insn_op_next -yasm_insn_operand * -yasm_insn_op_next(yasm_insn_operand *cur) -{ - return STAILQ_NEXT(cur, link); -} diff --git a/libyasm/insn.h b/libyasm/insn.h index a12e1eff..20977b2c 100644 --- a/libyasm/insn.h +++ b/libyasm/insn.h @@ -69,7 +69,6 @@ struct yasm_effaddr { /** An instruction operand (opaque type). */ typedef struct yasm_insn_operand yasm_insn_operand; -#ifdef YASM_LIB_INTERNAL /** An instruction operand. */ struct yasm_insn_operand { /** Link for building linked list of operands. \internal */ @@ -137,7 +136,6 @@ struct yasm_insn { unsigned int num_prefixes; /**< Number of prefixes. */ unsigned int num_segregs; /**< Number of segment prefixes. */ }; -#endif /** Set segment override for an effective address. * Some architectures (such as x86) support segment overrides on effective @@ -178,17 +176,14 @@ yasm_insn_operand *yasm_operand_create_imm(/*@only@*/ yasm_expr *val); * \return First operand (NULL if no operands). */ yasm_insn_operand *yasm_insn_ops_first(yasm_insn *insn); +#define yasm_insn_ops_first(insn) STAILQ_FIRST(&((insn)->operands)) /** Get the next operand in an instruction. * \param op previous operand * \return Next operand (NULL if op was the last operand). */ yasm_insn_operand *yasm_insn_op_next(yasm_insn_operand *op); - -#if defined(YASM_LIB_INTERNAL) && !defined(YASM_DOXYGEN) -#define yasm_insn_ops_first(insn) STAILQ_FIRST(&(insn)->operands) #define yasm_insn_op_next(cur) STAILQ_NEXT(cur, link) -#endif /** Add operand to the end of an instruction. * \note Does not make a copy of the operand; so don't pass this function diff --git a/libyasm/intnum.c b/libyasm/intnum.c index 2132733f..0e3411f6 100644 --- a/libyasm/intnum.c +++ b/libyasm/intnum.c @@ -24,7 +24,6 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -#define YASM_LIB_INTERNAL #include "util.h" /*@unused@*/ RCSID("$Id$"); diff --git a/libyasm/inttree.c b/libyasm/inttree.c index 2c408f1c..382a5981 100644 --- a/libyasm/inttree.c +++ b/libyasm/inttree.c @@ -1,4 +1,3 @@ -#define YASM_LIB_INTERNAL #include "util.h" /*@unused@*/ RCSID("$Id$"); diff --git a/libyasm/linemap.c b/libyasm/linemap.c index e2ff9300..b2c2d992 100644 --- a/libyasm/linemap.c +++ b/libyasm/linemap.c @@ -24,7 +24,6 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -#define YASM_LIB_INTERNAL #include "util.h" /*@unused@*/ RCSID("$Id$"); diff --git a/libyasm/mergesort.c b/libyasm/mergesort.c index bde5242e..a5b33da4 100644 --- a/libyasm/mergesort.c +++ b/libyasm/mergesort.c @@ -31,7 +31,6 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ -#define YASM_LIB_INTERNAL #include "util.h" /*@unused@*/ RCSID("$Id$"); diff --git a/libyasm/phash.c b/libyasm/phash.c index 2ce1938d..21a8ad1c 100644 --- a/libyasm/phash.c +++ b/libyasm/phash.c @@ -1,5 +1,4 @@ /* Modified for use with yasm by Peter Johnson. */ -#define YASM_LIB_INTERNAL #include "util.h" /*@unused@*/ RCSID("$Id$"); diff --git a/libyasm/section.c b/libyasm/section.c index 2b5d4342..b5fc6aed 100644 --- a/libyasm/section.c +++ b/libyasm/section.c @@ -24,7 +24,6 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -#define YASM_LIB_INTERNAL #include "util.h" /*@unused@*/ RCSID("$Id$"); diff --git a/libyasm/section.h b/libyasm/section.h index 27ccb298..ff18e331 100644 --- a/libyasm/section.h +++ b/libyasm/section.h @@ -39,13 +39,11 @@ */ typedef struct yasm_reloc yasm_reloc; -#ifdef YASM_LIB_INTERNAL struct yasm_reloc { /*@reldef@*/ STAILQ_ENTRY(yasm_reloc) link; yasm_intnum *addr; /**< Offset (address) within section */ /*@dependent@*/ yasm_symrec *sym; /**< Relocated symbol */ }; -#endif /** An object. This is the internal representation of an object file. */ struct yasm_object { @@ -62,7 +60,6 @@ struct yasm_object { */ /*@dependent@*/ /*@null@*/ yasm_section *cur_section; -#ifdef YASM_LIB_INTERNAL /** Linked list of sections. */ /*@reldef@*/ STAILQ_HEAD(yasm_sectionhead, yasm_section) sections; @@ -70,7 +67,6 @@ struct yasm_object { * second level is directive name. */ /*@owned@*/ struct HAMT *directives; -#endif }; /** Create a new object. A default section is created as the first section. @@ -256,10 +252,7 @@ void yasm_section_add_reloc(yasm_section *sect, yasm_reloc *reloc, * \return Next relocation for section. NULL if no more relocations. */ /*@null@*/ yasm_reloc *yasm_section_reloc_next(yasm_reloc *reloc); - -#ifdef YASM_LIB_INTERNAL #define yasm_section_reloc_next(x) STAILQ_NEXT((x), link) -#endif /** Get the basic relocation information for a relocation. * \param reloc relocation diff --git a/libyasm/strcasecmp.c b/libyasm/strcasecmp.c index 66424c6b..69d87113 100644 --- a/libyasm/strcasecmp.c +++ b/libyasm/strcasecmp.c @@ -29,7 +29,6 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ -#define YASM_LIB_INTERNAL #include "util.h" /*@unused@*/ RCSID("$Id$"); diff --git a/libyasm/strsep.c b/libyasm/strsep.c index f57c1b0a..7f538797 100644 --- a/libyasm/strsep.c +++ b/libyasm/strsep.c @@ -28,7 +28,6 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ -#define YASM_LIB_INTERNAL #define NO_STRING_INLINES #include "util.h" /*@unused@*/ RCSID("$Id$"); diff --git a/libyasm/symrec.c b/libyasm/symrec.c index a28de475..91807eb4 100644 --- a/libyasm/symrec.c +++ b/libyasm/symrec.c @@ -24,7 +24,6 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -#define YASM_LIB_INTERNAL #include "util.h" /*@unused@*/ RCSID("$Id$"); diff --git a/libyasm/valparam.c b/libyasm/valparam.c index 752ab7e3..4a8a8183 100644 --- a/libyasm/valparam.c +++ b/libyasm/valparam.c @@ -24,7 +24,6 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -#define YASM_LIB_INTERNAL #include "util.h" /*@unused@*/ RCSID("$Id$"); @@ -218,31 +217,6 @@ yasm_vps_destroy(yasm_valparamhead *headp) yasm_xfree(headp); } -/* Non-macro yasm_vps_append() for non-YASM_LIB_INTERNAL users. */ -#undef yasm_vps_append -void -yasm_vps_append(yasm_valparamhead *headp, /*@keep@*/ yasm_valparam *vp) -{ - if (vp) - STAILQ_INSERT_TAIL(headp, vp, link); -} - -/* Non-macro yasm_vps_first() for non-YASM_LIB_INTERNAL users. */ -#undef yasm_vps_first -/*@null@*/ /*@dependent@*/ yasm_valparam * -yasm_vps_first(yasm_valparamhead *headp) -{ - return STAILQ_FIRST(headp); -} - -/* Non-macro yasm_vps_next() for non-YASM_LIB_INTERNAL users. */ -#undef yasm_vps_next -/*@null@*/ /*@dependent@*/ yasm_valparam * -yasm_vps_next(yasm_valparam *cur) -{ - return STAILQ_NEXT(cur, link); -} - int yasm_dir_helper(void *obj, yasm_valparam *vp_first, unsigned long line, const yasm_dir_help *help, size_t nhelp, void *data, diff --git a/libyasm/valparam.h b/libyasm/valparam.h index 4a64a66f..d33a3cf6 100644 --- a/libyasm/valparam.h +++ b/libyasm/valparam.h @@ -34,7 +34,6 @@ #ifndef YASM_VALPARAM_H #define YASM_VALPARAM_H -#ifdef YASM_LIB_INTERNAL /** Value/parameter pair. \internal */ struct yasm_valparam { /*@reldef@*/ STAILQ_ENTRY(yasm_valparam) link; /**< Next pair in list */ @@ -63,7 +62,6 @@ struct yasm_valparam { /** Linked list of value/parameter pairs. \internal */ /*@reldef@*/ STAILQ_HEAD(yasm_valparamhead, yasm_valparam); -#endif /** Directive list entry structure. */ struct yasm_directive { @@ -166,10 +164,10 @@ yasm_valparamhead *yasm_vps_create(void); */ void yasm_vps_destroy(yasm_valparamhead *headp); -#ifdef YASM_LIB_INTERNAL /** Initialize linked list of valparams. * \param headp linked list */ +void yasm_vps_initialize(/*@out@*/ yasm_valparamhead *headp); #define yasm_vps_initialize(headp) STAILQ_INIT(headp) /** Destroy (free allocated memory for) linked list of valparams (created with @@ -178,19 +176,16 @@ void yasm_vps_destroy(yasm_valparamhead *headp); * \param headp linked list */ void yasm_vps_delete(yasm_valparamhead *headp); -#endif /** Append valparam to tail of linked list. * \param headp linked list * \param vp valparam */ void yasm_vps_append(yasm_valparamhead *headp, /*@keep@*/ yasm_valparam *vp); -#ifdef YASM_LIB_INTERNAL #define yasm_vps_append(headp, vp) do { \ if (vp) \ STAILQ_INSERT_TAIL(headp, vp, link); \ } while(0) -#endif /** Get first valparam in linked list. * \param headp linked list @@ -198,16 +193,13 @@ void yasm_vps_append(yasm_valparamhead *headp, /*@keep@*/ yasm_valparam *vp); */ /*@null@*/ /*@dependent@*/ yasm_valparam *yasm_vps_first (yasm_valparamhead *headp); -#ifdef YASM_LIB_INTERNAL #define yasm_vps_first(headp) STAILQ_FIRST(headp) -#endif /** Get next valparam in linked list. * \param cur previous valparam in linked list * \return Next valparam in linked list. */ /*@null@*/ /*@dependent@*/ yasm_valparam *yasm_vps_next(yasm_valparam *cur); -#ifdef YASM_LIB_INTERNAL #define yasm_vps_next(cur) STAILQ_NEXT(cur, link) /** Iterate through linked list of valparams. @@ -216,7 +208,6 @@ void yasm_vps_append(yasm_valparamhead *headp, /*@keep@*/ yasm_valparam *vp); * \param headp linked list */ #define yasm_vps_foreach(iter, headp) STAILQ_FOREACH(iter, headp, link) -#endif /** Print linked list of valparams. For debugging purposes. * \param f file diff --git a/libyasm/value.c b/libyasm/value.c index decaaff8..0a5936c7 100644 --- a/libyasm/value.c +++ b/libyasm/value.c @@ -24,7 +24,6 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -#define YASM_LIB_INTERNAL #include "util.h" /*@unused@*/ RCSID("$Id$"); diff --git a/libyasm/xmalloc.c b/libyasm/xmalloc.c index 5430ddd5..d2cd2380 100644 --- a/libyasm/xmalloc.c +++ b/libyasm/xmalloc.c @@ -24,7 +24,6 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -#define YASM_LIB_INTERNAL #include "util.h" RCSID("$Id$"); diff --git a/libyasm/xstrdup.c b/libyasm/xstrdup.c index 83ac3955..b0bbdfd3 100644 --- a/libyasm/xstrdup.c +++ b/libyasm/xstrdup.c @@ -28,7 +28,6 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ -#define YASM_LIB_INTERNAL #include "util.h" RCSID("$Id$"); diff --git a/modules/arch/lc3b/lc3barch.c b/modules/arch/lc3b/lc3barch.c index aad37108..152f6f1f 100644 --- a/modules/arch/lc3b/lc3barch.c +++ b/modules/arch/lc3b/lc3barch.c @@ -27,7 +27,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_LIB_INTERNAL #include #include "lc3barch.h" diff --git a/modules/arch/lc3b/lc3bbc.c b/modules/arch/lc3b/lc3bbc.c index 95478897..f864b328 100644 --- a/modules/arch/lc3b/lc3bbc.c +++ b/modules/arch/lc3b/lc3bbc.c @@ -27,7 +27,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_LIB_INTERNAL #define YASM_BC_INTERNAL #include diff --git a/modules/arch/lc3b/lc3bid.re b/modules/arch/lc3b/lc3bid.re index dcd6599d..47c94644 100644 --- a/modules/arch/lc3b/lc3bid.re +++ b/modules/arch/lc3b/lc3bid.re @@ -27,7 +27,6 @@ #include RCSID("$Id$"); -#define YASM_LIB_INTERNAL #define YASM_BC_INTERNAL #define YASM_EXPR_INTERNAL #include diff --git a/modules/arch/x86/x86arch.c b/modules/arch/x86/x86arch.c index ba323185..0f8c9527 100644 --- a/modules/arch/x86/x86arch.c +++ b/modules/arch/x86/x86arch.c @@ -27,7 +27,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_LIB_INTERNAL #include #include "x86arch.h" diff --git a/modules/arch/x86/x86bc.c b/modules/arch/x86/x86bc.c index ade330e2..cff6e583 100644 --- a/modules/arch/x86/x86bc.c +++ b/modules/arch/x86/x86bc.c @@ -27,7 +27,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_LIB_INTERNAL #define YASM_BC_INTERNAL #define YASM_EXPR_INTERNAL #include diff --git a/modules/arch/x86/x86expr.c b/modules/arch/x86/x86expr.c index 2ad101c0..ae99f7d2 100644 --- a/modules/arch/x86/x86expr.c +++ b/modules/arch/x86/x86expr.c @@ -27,7 +27,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_LIB_INTERNAL #define YASM_EXPR_INTERNAL #include diff --git a/modules/arch/x86/x86id.c b/modules/arch/x86/x86id.c index 76b621be..ce26da38 100644 --- a/modules/arch/x86/x86id.c +++ b/modules/arch/x86/x86id.c @@ -28,7 +28,6 @@ #include RCSID("$Id$"); -#define YASM_LIB_INTERNAL #define YASM_BC_INTERNAL #define YASM_EXPR_INTERNAL #include diff --git a/modules/dbgfmts/codeview/cv-dbgfmt.c b/modules/dbgfmts/codeview/cv-dbgfmt.c index 75dc2f1e..2cb23255 100644 --- a/modules/dbgfmts/codeview/cv-dbgfmt.c +++ b/modules/dbgfmts/codeview/cv-dbgfmt.c @@ -27,7 +27,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_LIB_INTERNAL #define YASM_BC_INTERNAL #include diff --git a/modules/dbgfmts/codeview/cv-symline.c b/modules/dbgfmts/codeview/cv-symline.c index f9ddd992..6ad141a1 100644 --- a/modules/dbgfmts/codeview/cv-symline.c +++ b/modules/dbgfmts/codeview/cv-symline.c @@ -30,7 +30,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_LIB_INTERNAL #define YASM_BC_INTERNAL #include diff --git a/modules/dbgfmts/codeview/cv-type.c b/modules/dbgfmts/codeview/cv-type.c index 9722a414..433013ea 100644 --- a/modules/dbgfmts/codeview/cv-type.c +++ b/modules/dbgfmts/codeview/cv-type.c @@ -30,7 +30,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_LIB_INTERNAL #define YASM_BC_INTERNAL #include diff --git a/modules/dbgfmts/dwarf2/dwarf2-aranges.c b/modules/dbgfmts/dwarf2/dwarf2-aranges.c index 34ff80e1..0df37b56 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-aranges.c +++ b/modules/dbgfmts/dwarf2/dwarf2-aranges.c @@ -27,7 +27,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_LIB_INTERNAL #include #include "dwarf2-dbgfmt.h" diff --git a/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c b/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c index b0469c32..e889f51f 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c +++ b/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c @@ -27,7 +27,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_LIB_INTERNAL #define YASM_BC_INTERNAL #include diff --git a/modules/dbgfmts/dwarf2/dwarf2-info.c b/modules/dbgfmts/dwarf2/dwarf2-info.c index 433b93ef..be6cf605 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-info.c +++ b/modules/dbgfmts/dwarf2/dwarf2-info.c @@ -34,7 +34,6 @@ #include #endif -#define YASM_LIB_INTERNAL #define YASM_BC_INTERNAL #include diff --git a/modules/dbgfmts/dwarf2/dwarf2-line.c b/modules/dbgfmts/dwarf2/dwarf2-line.c index 6e77ceb4..90dc7ea9 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-line.c +++ b/modules/dbgfmts/dwarf2/dwarf2-line.c @@ -30,7 +30,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_LIB_INTERNAL #define YASM_BC_INTERNAL #include diff --git a/modules/dbgfmts/null/null-dbgfmt.c b/modules/dbgfmts/null/null-dbgfmt.c index d3f5fd13..1cf5f642 100644 --- a/modules/dbgfmts/null/null-dbgfmt.c +++ b/modules/dbgfmts/null/null-dbgfmt.c @@ -27,7 +27,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_LIB_INTERNAL #include diff --git a/modules/dbgfmts/stabs/stabs-dbgfmt.c b/modules/dbgfmts/stabs/stabs-dbgfmt.c index a3fe8277..ad25581a 100644 --- a/modules/dbgfmts/stabs/stabs-dbgfmt.c +++ b/modules/dbgfmts/stabs/stabs-dbgfmt.c @@ -27,7 +27,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_LIB_INTERNAL #define YASM_BC_INTERNAL #include diff --git a/modules/listfmts/nasm/nasm-listfmt.c b/modules/listfmts/nasm/nasm-listfmt.c index 21ce4330..8b550435 100644 --- a/modules/listfmts/nasm/nasm-listfmt.c +++ b/modules/listfmts/nasm/nasm-listfmt.c @@ -27,7 +27,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_LIB_INTERNAL #define YASM_BC_INTERNAL #include diff --git a/modules/objfmts/bin/bin-objfmt.c b/modules/objfmts/bin/bin-objfmt.c index 496c412b..cf06d50b 100644 --- a/modules/objfmts/bin/bin-objfmt.c +++ b/modules/objfmts/bin/bin-objfmt.c @@ -27,7 +27,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_LIB_INTERNAL #define YASM_BC_INTERNAL #define YASM_EXPR_INTERNAL #include diff --git a/modules/objfmts/coff/coff-objfmt.c b/modules/objfmts/coff/coff-objfmt.c index bd856140..cb4719de 100644 --- a/modules/objfmts/coff/coff-objfmt.c +++ b/modules/objfmts/coff/coff-objfmt.c @@ -28,7 +28,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_LIB_INTERNAL #define YASM_BC_INTERNAL #define YASM_EXPR_INTERNAL #include diff --git a/modules/objfmts/coff/win64-except.c b/modules/objfmts/coff/win64-except.c index 99c14376..82b5f616 100644 --- a/modules/objfmts/coff/win64-except.c +++ b/modules/objfmts/coff/win64-except.c @@ -27,7 +27,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_LIB_INTERNAL #define YASM_BC_INTERNAL #define YASM_EXPR_INTERNAL #include diff --git a/modules/objfmts/dbg/dbg-objfmt.c b/modules/objfmts/dbg/dbg-objfmt.c index e1aad7ad..8452a810 100644 --- a/modules/objfmts/dbg/dbg-objfmt.c +++ b/modules/objfmts/dbg/dbg-objfmt.c @@ -27,7 +27,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_LIB_INTERNAL #include diff --git a/modules/objfmts/elf/elf-objfmt.c b/modules/objfmts/elf/elf-objfmt.c index d53e2430..ecf13f40 100644 --- a/modules/objfmts/elf/elf-objfmt.c +++ b/modules/objfmts/elf/elf-objfmt.c @@ -44,7 +44,6 @@ * Each Section is spatially disjoint, and has exactly one SHT entry. */ -#define YASM_LIB_INTERNAL #define YASM_BC_INTERNAL #define YASM_EXPR_INTERNAL #include diff --git a/modules/objfmts/elf/elf-x86-amd64.c b/modules/objfmts/elf/elf-x86-amd64.c index c1318d64..559fb50c 100644 --- a/modules/objfmts/elf/elf-x86-amd64.c +++ b/modules/objfmts/elf/elf-x86-amd64.c @@ -28,7 +28,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_LIB_INTERNAL #define YASM_EXPR_INTERNAL #include #define YASM_OBJFMT_ELF_INTERNAL diff --git a/modules/objfmts/elf/elf-x86-x86.c b/modules/objfmts/elf/elf-x86-x86.c index 00d7a047..d639b599 100644 --- a/modules/objfmts/elf/elf-x86-x86.c +++ b/modules/objfmts/elf/elf-x86-x86.c @@ -28,7 +28,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_LIB_INTERNAL #define YASM_EXPR_INTERNAL #include #define YASM_OBJFMT_ELF_INTERNAL diff --git a/modules/objfmts/elf/elf.c b/modules/objfmts/elf/elf.c index 3bcbffb5..e3b23276 100644 --- a/modules/objfmts/elf/elf.c +++ b/modules/objfmts/elf/elf.c @@ -28,7 +28,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_LIB_INTERNAL #define YASM_EXPR_INTERNAL #include #define YASM_OBJFMT_ELF_INTERNAL diff --git a/modules/objfmts/macho/macho-objfmt.c b/modules/objfmts/macho/macho-objfmt.c index ceddbf98..507279e0 100644 --- a/modules/objfmts/macho/macho-objfmt.c +++ b/modules/objfmts/macho/macho-objfmt.c @@ -108,7 +108,6 @@ /* optional: automatically prefix underscores to global exported symbols */ /*#define AUTO_UNDERSCORE*/ -#define YASM_LIB_INTERNAL #define YASM_BC_INTERNAL #define YASM_EXPR_INTERNAL #include diff --git a/modules/objfmts/rdf/rdf-objfmt.c b/modules/objfmts/rdf/rdf-objfmt.c index 124f2560..64047915 100644 --- a/modules/objfmts/rdf/rdf-objfmt.c +++ b/modules/objfmts/rdf/rdf-objfmt.c @@ -27,7 +27,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_LIB_INTERNAL #define YASM_BC_INTERNAL #define YASM_EXPR_INTERNAL #include diff --git a/modules/objfmts/xdf/xdf-objfmt.c b/modules/objfmts/xdf/xdf-objfmt.c index 84e0e314..a0c58848 100644 --- a/modules/objfmts/xdf/xdf-objfmt.c +++ b/modules/objfmts/xdf/xdf-objfmt.c @@ -27,7 +27,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_LIB_INTERNAL #define YASM_BC_INTERNAL #define YASM_EXPR_INTERNAL #include diff --git a/modules/parsers/gas/gas-parse.c b/modules/parsers/gas/gas-parse.c index 8cbe4350..6e79ec1c 100644 --- a/modules/parsers/gas/gas-parse.c +++ b/modules/parsers/gas/gas-parse.c @@ -30,7 +30,6 @@ #include RCSID("$Id$"); -#define YASM_LIB_INTERNAL #define YASM_EXPR_INTERNAL #include diff --git a/modules/parsers/gas/gas-parser.c b/modules/parsers/gas/gas-parser.c index e2515341..16c792bd 100644 --- a/modules/parsers/gas/gas-parser.c +++ b/modules/parsers/gas/gas-parser.c @@ -30,7 +30,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_LIB_INTERNAL #include #include "gas-parser.h" diff --git a/modules/parsers/gas/gas-token.re b/modules/parsers/gas/gas-token.re index 6cd6cd02..457eee0e 100644 --- a/modules/parsers/gas/gas-token.re +++ b/modules/parsers/gas/gas-token.re @@ -30,7 +30,6 @@ #include RCSID("$Id$"); -#define YASM_LIB_INTERNAL #include #include "modules/parsers/gas/gas-parser.h" diff --git a/modules/parsers/nasm/nasm-parse.c b/modules/parsers/nasm/nasm-parse.c index 2943cf9c..5ef7c11f 100644 --- a/modules/parsers/nasm/nasm-parse.c +++ b/modules/parsers/nasm/nasm-parse.c @@ -27,7 +27,6 @@ #include RCSID("$Id$"); -#define YASM_LIB_INTERNAL #define YASM_EXPR_INTERNAL #include diff --git a/modules/parsers/nasm/nasm-parser.c b/modules/parsers/nasm/nasm-parser.c index 2fa1934b..8cdc63a0 100644 --- a/modules/parsers/nasm/nasm-parser.c +++ b/modules/parsers/nasm/nasm-parser.c @@ -27,7 +27,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_LIB_INTERNAL #include #include "nasm-parser.h" diff --git a/modules/parsers/nasm/nasm-token.re b/modules/parsers/nasm/nasm-token.re index 0a56073a..de58cf0e 100644 --- a/modules/parsers/nasm/nasm-token.re +++ b/modules/parsers/nasm/nasm-token.re @@ -29,7 +29,6 @@ #include RCSID("$Id$"); -#define YASM_LIB_INTERNAL #include #include "modules/parsers/nasm/nasm-parser.h" diff --git a/modules/preprocs/nasm/nasm-preproc.c b/modules/preprocs/nasm/nasm-preproc.c index 58f5a2f5..96700267 100644 --- a/modules/preprocs/nasm/nasm-preproc.c +++ b/modules/preprocs/nasm/nasm-preproc.c @@ -27,7 +27,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_LIB_INTERNAL #include #include "nasm.h" diff --git a/modules/preprocs/raw/raw-preproc.c b/modules/preprocs/raw/raw-preproc.c index f58856c3..4e80cfff 100644 --- a/modules/preprocs/raw/raw-preproc.c +++ b/modules/preprocs/raw/raw-preproc.c @@ -27,7 +27,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_LIB_INTERNAL #include diff --git a/modules/preprocs/yapp/yapp-preproc.c b/modules/preprocs/yapp/yapp-preproc.c index 4f7767ac..c7756442 100644 --- a/modules/preprocs/yapp/yapp-preproc.c +++ b/modules/preprocs/yapp/yapp-preproc.c @@ -27,7 +27,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_LIB_INTERNAL #include #include "yapp-preproc.h" From a958ef6df8d9b4140e1e8445e34a7773dcf6b14b Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 14 Jul 2007 04:34:41 +0000 Subject: [PATCH 029/585] Merge bc-int.h into bytecode.h, removing YASM_BC_INTERNAL in the process. svn path=/trunk/yasm/; revision=1894 --- libyasm.h | 5 - libyasm/Makefile.inc | 1 - libyasm/bc-align.c | 2 - libyasm/bc-data.c | 2 - libyasm/bc-incbin.c | 2 - libyasm/bc-int.h | 128 ------------- libyasm/bc-org.c | 2 - libyasm/bc-reserve.c | 1 - libyasm/bytecode.c | 1 - libyasm/bytecode.h | 241 +++++++++++++++++++++++-- libyasm/coretype.h | 5 +- libyasm/insn.c | 2 - libyasm/section.c | 1 - libyasm/value.c | 1 - modules/arch/lc3b/lc3bbc.c | 1 - modules/arch/lc3b/lc3bid.re | 1 - modules/arch/x86/x86bc.c | 1 - modules/arch/x86/x86id.c | 1 - modules/dbgfmts/codeview/cv-dbgfmt.c | 1 - modules/dbgfmts/codeview/cv-symline.c | 1 - modules/dbgfmts/codeview/cv-type.c | 1 - modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c | 1 - modules/dbgfmts/dwarf2/dwarf2-info.c | 1 - modules/dbgfmts/dwarf2/dwarf2-line.c | 1 - modules/dbgfmts/stabs/stabs-dbgfmt.c | 1 - modules/listfmts/nasm/nasm-listfmt.c | 1 - modules/objfmts/bin/bin-objfmt.c | 1 - modules/objfmts/coff/coff-objfmt.c | 1 - modules/objfmts/coff/win64-except.c | 1 - modules/objfmts/elf/elf-objfmt.c | 1 - modules/objfmts/macho/macho-objfmt.c | 1 - modules/objfmts/rdf/rdf-objfmt.c | 1 - modules/objfmts/xdf/xdf-objfmt.c | 1 - 33 files changed, 227 insertions(+), 186 deletions(-) delete mode 100644 libyasm/bc-int.h diff --git a/libyasm.h b/libyasm.h index 91596b7f..bd38c646 100644 --- a/libyasm.h +++ b/libyasm.h @@ -32,8 +32,6 @@ * \endlicense * * Additional parts may be included via: - * - YASM_BC_INTERNAL: reveal bytecode internal structures via bc-int.h - * inclusion * - YASM_EXPR_INTERNAL: reveal expr internal structures via expr-int.h * inclusion */ @@ -79,9 +77,6 @@ typedef unsigned long uintptr_t; #include #include -#ifdef YASM_BC_INTERNAL -#include -#endif #ifdef YASM_EXPR_INTERNAL #include #endif diff --git a/libyasm/Makefile.inc b/libyasm/Makefile.inc index 98dbfa68..ee84ac48 100644 --- a/libyasm/Makefile.inc +++ b/libyasm/Makefile.inc @@ -52,7 +52,6 @@ modincludedir = $(includedir)/libyasm modinclude_HEADERS = libyasm/arch.h modinclude_HEADERS += libyasm/assocdat.h -modinclude_HEADERS += libyasm/bc-int.h modinclude_HEADERS += libyasm/bitvect.h modinclude_HEADERS += libyasm/bytecode.h modinclude_HEADERS += libyasm/compat-queue.h diff --git a/libyasm/bc-align.c b/libyasm/bc-align.c index 52474e71..e4e6b648 100644 --- a/libyasm/bc-align.c +++ b/libyasm/bc-align.c @@ -36,8 +36,6 @@ #include "bytecode.h" -#include "bc-int.h" - typedef struct bytecode_align { /*@only@*/ yasm_expr *boundary; /* alignment boundary */ diff --git a/libyasm/bc-data.c b/libyasm/bc-data.c index cb7dc310..8560da31 100644 --- a/libyasm/bc-data.c +++ b/libyasm/bc-data.c @@ -38,8 +38,6 @@ #include "bytecode.h" #include "arch.h" -#include "bc-int.h" - struct yasm_dataval { /*@reldef@*/ STAILQ_ENTRY(yasm_dataval) link; diff --git a/libyasm/bc-incbin.c b/libyasm/bc-incbin.c index 13703105..55634468 100644 --- a/libyasm/bc-incbin.c +++ b/libyasm/bc-incbin.c @@ -41,8 +41,6 @@ #include "file.h" -#include "bc-int.h" - typedef struct bytecode_incbin { /*@only@*/ char *filename; /* file to include data from */ diff --git a/libyasm/bc-int.h b/libyasm/bc-int.h deleted file mode 100644 index d941ad6a..00000000 --- a/libyasm/bc-int.h +++ /dev/null @@ -1,128 +0,0 @@ -/* $Id$ - * Bytecode internal structures header file - * - * Copyright (C) 2001-2007 Peter Johnson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ -#ifndef YASM_BC_INT_H -#define YASM_BC_INT_H - -typedef struct yasm_bytecode_callback { - void (*destroy) (/*@only@*/ void *contents); - void (*print) (const void *contents, FILE *f, int indent_level); - void (*finalize) (yasm_bytecode *bc, yasm_bytecode *prev_bc); - int (*calc_len) (yasm_bytecode *bc, yasm_bc_add_span_func add_span, - void *add_span_data); - int (*expand) (yasm_bytecode *bc, int span, long old_val, long new_val, - /*@out@*/ long *neg_thres, /*@out@*/ long *pos_thres); - int (*tobytes) (yasm_bytecode *bc, unsigned char **bufp, void *d, - yasm_output_value_func output_value, - /*@null@*/ yasm_output_reloc_func output_reloc); - enum yasm_bytecode_special_type { - YASM_BC_SPECIAL_NONE = 0, - YASM_BC_SPECIAL_RESERVE,/* Reserves space instead of outputting data */ - YASM_BC_SPECIAL_OFFSET, /* Adjusts offset instead of calculating len */ - YASM_BC_SPECIAL_INSN /* Instruction bytecode */ - } special; -} yasm_bytecode_callback; - -struct yasm_bytecode { - /*@reldef@*/ STAILQ_ENTRY(yasm_bytecode) link; - - /*@null@*/ const yasm_bytecode_callback *callback; - - /* Pointer to section containing bytecode; NULL if not part of a section. */ - /*@dependent@*/ /*@null@*/ yasm_section *section; - - /* number of times bytecode is repeated, NULL=1. */ - /*@only@*/ /*@null@*/ yasm_expr *multiple; - - unsigned long len; /* total length of entire bytecode - (not including multiple copies) */ - long mult_int; /* number of copies: integer version */ - - /* where it came from */ - unsigned long line; - - /* other assembler state info */ - unsigned long offset; /* ~0UL if unknown */ - unsigned long bc_index; - - /* NULL-terminated array of labels that point to this bytecode (as the - * bytecode previous to the label). NULL if no labels point here. */ - /*@null@*/ yasm_symrec **symrecs; - - /* bytecode-type-specific data (type identified by callback) */ - void *contents; -}; - -/** Create a bytecode of any specified type. - * \param callback bytecode callback functions, if NULL, creates empty - * bytecode (may not be resolved or output) - * \param contents type-specific data - * \param line virtual line (from yasm_linemap) - * \return Newly allocated bytecode of the specified type. - */ -/*@only@*/ yasm_bytecode *yasm_bc_create_common - (/*@null@*/ const yasm_bytecode_callback *callback, - /*@only@*/ /*@null@*/ void *contents, unsigned long line); - -/** Transform a bytecode of any type into a different type. - * \param bc bytecode to transform - * \param callback new bytecode callback function - * \param contents new type-specific data - */ -void yasm_bc_transform(yasm_bytecode *bc, - const yasm_bytecode_callback *callback, - void *contents); - -/** Common bytecode callback finalize function, for where no finalization - * is ever required for this type of bytecode. - */ -void yasm_bc_finalize_common(yasm_bytecode *bc, yasm_bytecode *prev_bc); - -/** Common bytecode callback calc_len function, for where the bytecode has - * no calculatable length. Causes an internal error if called. - */ -int yasm_bc_calc_len_common(yasm_bytecode *bc, yasm_bc_add_span_func add_span, - void *add_span_data); - -/** Common bytecode callback expand function, for where the bytecode is - * always short (calc_len never calls add_span). Causes an internal - * error if called. - */ -int yasm_bc_expand_common - (yasm_bytecode *bc, int span, long old_val, long new_val, - /*@out@*/ long *neg_thres, /*@out@*/ long *pos_thres); - -/** Common bytecode callback tobytes function, for where the bytecode - * cannot be converted to bytes. Causes an internal error if called. - */ -int yasm_bc_tobytes_common - (yasm_bytecode *bc, unsigned char **bufp, void *d, - yasm_output_value_func output_value, - /*@null@*/ yasm_output_reloc_func output_reloc); - -#define yasm_bc__next(x) STAILQ_NEXT(x, link) - -#endif diff --git a/libyasm/bc-org.c b/libyasm/bc-org.c index da1f743d..e354f23e 100644 --- a/libyasm/bc-org.c +++ b/libyasm/bc-org.c @@ -38,8 +38,6 @@ #include "bytecode.h" -#include "bc-int.h" - typedef struct bytecode_org { unsigned long start; /* target starting offset within section */ diff --git a/libyasm/bc-reserve.c b/libyasm/bc-reserve.c index 66224dcf..1bc0c888 100644 --- a/libyasm/bc-reserve.c +++ b/libyasm/bc-reserve.c @@ -37,7 +37,6 @@ #include "bytecode.h" -#include "bc-int.h" #include "expr-int.h" diff --git a/libyasm/bytecode.c b/libyasm/bytecode.c index e8ea9872..3828795c 100644 --- a/libyasm/bytecode.c +++ b/libyasm/bytecode.c @@ -38,7 +38,6 @@ #include "bytecode.h" -#include "bc-int.h" #include "expr-int.h" diff --git a/libyasm/bytecode.h b/libyasm/bytecode.h index 8fa273bd..0cf1888a 100644 --- a/libyasm/bytecode.h +++ b/libyasm/bytecode.h @@ -41,6 +41,231 @@ typedef struct yasm_datavalhead yasm_datavalhead; /*@reldef@*/ STAILQ_HEAD(yasm_datavalhead, yasm_dataval); +/** Add a dependent span for a bytecode. + * \param add_span_data add_span_data passed into bc_calc_len() + * \param bc bytecode containing span + * \param id non-zero identifier for span; may be any non-zero value + * if <0, expand is called for any change; + * if >0, expand is only called when exceeds threshold + * \param value dependent value for bytecode expansion + * \param neg_thres negative threshold for long/short decision + * \param pos_thres positive threshold for long/short decision + */ +typedef void (*yasm_bc_add_span_func) + (void *add_span_data, yasm_bytecode *bc, int id, const yasm_value *value, + long neg_thres, long pos_thres); + +/** Bytecode callback structure. Any implementation of a specific bytecode + * must implement these functions and this callback structure. The bytecode + * implementation-specific data is stored in #yasm_bytecode.contents. + */ +typedef struct yasm_bytecode_callback { + /** Destroys the implementation-specific data. + * Called from yasm_bc_destroy(). + * \param contents #yasm_bytecode.contents + */ + void (*destroy) (/*@only@*/ void *contents); + + /** Prints the implementation-specific data (for debugging purposes). + * Called from yasm_bc_print(). + * \param contents #yasm_bytecode.contents + * \param f file + * \param indent_level indentation level + */ + void (*print) (const void *contents, FILE *f, int indent_level); + + /** Finalizes the bytecode after parsing. Called from yasm_bc_finalize(). + * A generic fill-in for this is yasm_bc_finalize_common(). + * \param bc bytecode + * \param prev_bc bytecode directly preceding bc + */ + void (*finalize) (yasm_bytecode *bc, yasm_bytecode *prev_bc); + + /** Calculates the minimum size of a bytecode. + * Called from yasm_bc_calc_len(). + * A generic fill-in for this is yasm_bc_calc_len_common(), but as this + * function internal errors when called, be very careful when using it! + * This function should simply add to bc->len and not set it directly + * (it's initialized by yasm_bc_calc_len() prior to passing control to + * this function). + * + * \param bc bytecode + * \param add_span function to call to add a span + * \param add_span_data extra data to be passed to add_span function + * \return 0 if no error occurred, nonzero if there was an error + * recognized (and output) during execution. + * \note May store to bytecode updated expressions. + */ + int (*calc_len) (yasm_bytecode *bc, yasm_bc_add_span_func add_span, + void *add_span_data); + + /** Recalculates the bytecode's length based on an expanded span length. + * Called from yasm_bc_expand(). + * A generic fill-in for this is yasm_bc_expand_common(), but as this + * function internal errors when called, if used, ensure that calc_len() + * never adds a span. + * This function should simply add to bc->len to increase the length by + * a delta amount. + * \param bc bytecode + * \param span span ID (as given to add_span in calc_len) + * \param old_val previous span value + * \param new_val new span value + * \param neg_thres negative threshold for long/short decision + * (returned) + * \param pos_thres positive threshold for long/short decision + * (returned) + * \return 0 if bc no longer dependent on this span's length, negative if + * there was an error recognized (and output) during execution, + * and positive if bc size may increase for this span further + * based on the new negative and positive thresholds returned. + * \note May store to bytecode updated expressions. + */ + int (*expand) (yasm_bytecode *bc, int span, long old_val, long new_val, + /*@out@*/ long *neg_thres, /*@out@*/ long *pos_thres); + + /** Convert a bytecode into its byte representation. + * Called from yasm_bc_tobytes(). + * A generic fill-in for this is yasm_bc_tobytes_common(), but as this + * function internal errors when called, be very careful when using it! + * \param bc bytecode + * \param buf byte representation destination buffer + * \param bufsize size of buf (in bytes) prior to call; size of the + * generated data after call + * \param gap if nonzero, indicates the data does not really + * need to exist in the object file; if nonzero, + * contents of buf are undefined [output] + * \param d data to pass to each call to + * output_value/output_reloc + * \param output_value function to call to convert values into their byte + * representation + * \param output_reloc function to call to output relocation entries + * for a single sym + * \return Newly allocated buffer that should be used instead of buf for + * reading the byte representation, or NULL if buf was big enough + * to hold the entire byte representation. + * \note May result in non-reversible changes to the bytecode, but it's + * preferable if calling this function twice would result in the + * same output. + */ + int (*tobytes) (yasm_bytecode *bc, unsigned char **bufp, void *d, + yasm_output_value_func output_value, + /*@null@*/ yasm_output_reloc_func output_reloc); + + /** Special bytecode classifications. Most bytecode types should use + * #YASM_BC_SPECIAL_NONE. Others cause special handling to kick in + * in various parts of yasm. + */ + enum yasm_bytecode_special_type { + YASM_BC_SPECIAL_NONE = 0, + + /** Bytecode reserves space instead of outputting data. */ + YASM_BC_SPECIAL_RESERVE, + + /** Adjusts offset instead of calculating len. */ + YASM_BC_SPECIAL_OFFSET, + + /** Instruction bytecode. */ + YASM_BC_SPECIAL_INSN + } special; +} yasm_bytecode_callback; + +/** A bytecode. */ +struct yasm_bytecode { + /** Bytecodes are stored as a singly linked list, with tail insertion. + * \see section.h (#yasm_section). + */ + /*@reldef@*/ STAILQ_ENTRY(yasm_bytecode) link; + + /** The bytecode callback structure for this bytecode. May be NULL + * during partial initialization. + */ + /*@null@*/ const yasm_bytecode_callback *callback; + + /** Pointer to section containing bytecode; NULL if not part of a + * section. + */ + /*@dependent@*/ /*@null@*/ yasm_section *section; + + /** Number of times bytecode is repeated. + * NULL=1 (to save space in the common case). + */ + /*@only@*/ /*@null@*/ yasm_expr *multiple; + + /** Total length of entire bytecode (not including multiple copies). */ + unsigned long len; + + /** Number of copies, integer version. */ + long mult_int; + + /** Line number where bytecode was defined. */ + unsigned long line; + + /** Offset of bytecode from beginning of its section. + * 0-based, ~0UL (e.g. all 1 bits) if unknown. + */ + unsigned long offset; + + /** Unique integer index of bytecode. Used during optimization. */ + unsigned long bc_index; + + /** NULL-terminated array of labels that point to this bytecode (as the + * bytecode previous to the label). NULL if no labels point here. + */ + /*@null@*/ yasm_symrec **symrecs; + + /** Implementation-specific data (type identified by callback). */ + void *contents; +}; + +/** Create a bytecode of any specified type. + * \param callback bytecode callback functions, if NULL, creates empty + * bytecode (may not be resolved or output) + * \param contents type-specific data + * \param line virtual line (from yasm_linemap) + * \return Newly allocated bytecode of the specified type. + */ +/*@only@*/ yasm_bytecode *yasm_bc_create_common + (/*@null@*/ const yasm_bytecode_callback *callback, + /*@only@*/ /*@null@*/ void *contents, unsigned long line); + +/** Transform a bytecode of any type into a different type. + * \param bc bytecode to transform + * \param callback new bytecode callback function + * \param contents new type-specific data + */ +void yasm_bc_transform(yasm_bytecode *bc, + const yasm_bytecode_callback *callback, + void *contents); + +/** Common bytecode callback finalize function, for where no finalization + * is ever required for this type of bytecode. + */ +void yasm_bc_finalize_common(yasm_bytecode *bc, yasm_bytecode *prev_bc); + +/** Common bytecode callback calc_len function, for where the bytecode has + * no calculatable length. Causes an internal error if called. + */ +int yasm_bc_calc_len_common(yasm_bytecode *bc, yasm_bc_add_span_func add_span, + void *add_span_data); + +/** Common bytecode callback expand function, for where the bytecode is + * always short (calc_len never calls add_span). Causes an internal + * error if called. + */ +int yasm_bc_expand_common + (yasm_bytecode *bc, int span, long old_val, long new_val, + /*@out@*/ long *neg_thres, /*@out@*/ long *pos_thres); + +/** Common bytecode callback tobytes function, for where the bytecode + * cannot be converted to bytes. Causes an internal error if called. + */ +int yasm_bc_tobytes_common + (yasm_bytecode *bc, unsigned char **bufp, void *d, + yasm_output_value_func output_value, + /*@null@*/ yasm_output_reloc_func output_reloc); + +#define yasm_bc__next(x) STAILQ_NEXT(x, link) + /** Set multiple field of a bytecode. * A bytecode can be repeated a number of times when output. This function * sets that multiple. @@ -184,20 +409,6 @@ void yasm_bc_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc); */ unsigned long yasm_bc_next_offset(yasm_bytecode *precbc); -/** Add a dependent span for a bytecode. - * \param add_span_data add_span_data passed into bc_calc_len() - * \param bc bytecode containing span - * \param id non-zero identifier for span; may be any non-zero value - * if <0, expand is called for any change; - * if >0, expand is only called when exceeds threshold - * \param value dependent value for bytecode expansion - * \param neg_thres negative threshold for long/short decision - * \param pos_thres positive threshold for long/short decision - */ -typedef void (*yasm_bc_add_span_func) - (void *add_span_data, yasm_bytecode *bc, int id, const yasm_value *value, - long neg_thres, long pos_thres); - /** Resolve EQUs in a bytecode and calculate its minimum size. * Generates dependent bytecode spans for cases where, if the length spanned * increases, it could cause the bytecode size to increase. @@ -220,7 +431,7 @@ int yasm_bc_calc_len(yasm_bytecode *bc, yasm_bc_add_span_func add_span, * \param old_val previous span value * \param new_val new span value * \param neg_thres negative threshold for long/short decision (returned) - * \param pos_thres postivie threshold for long/short decision (returned) + * \param pos_thres positive threshold for long/short decision (returned) * \return 0 if bc no longer dependent on this span's length, negative if * there was an error recognized (and output) during execution, and * positive if bc size may increase for this span further based on the diff --git a/libyasm/coretype.h b/libyasm/coretype.h index dd4eeec4..395a9c43 100644 --- a/libyasm/coretype.h +++ b/libyasm/coretype.h @@ -74,10 +74,7 @@ typedef struct yasm_assoc_data_callback { */ typedef struct yasm_errwarns yasm_errwarns; -/** Bytecode (opaque type). - * \see bytecode.h for related functions. - * Define YASM_BC_INTERNAL to get visible internals. - */ +/** Bytecode. \see bytecode.h for defails and related functions. */ typedef struct yasm_bytecode yasm_bytecode; /** Object. \see section.h for details and related functions. */ diff --git a/libyasm/insn.c b/libyasm/insn.c index 219a56c0..7127b410 100644 --- a/libyasm/insn.c +++ b/libyasm/insn.c @@ -38,8 +38,6 @@ #include "insn.h" #include "arch.h" -#include "bc-int.h" - void yasm_ea_set_segreg(yasm_effaddr *ea, uintptr_t segreg) diff --git a/libyasm/section.c b/libyasm/section.c index b5fc6aed..21ea56a9 100644 --- a/libyasm/section.c +++ b/libyasm/section.c @@ -50,7 +50,6 @@ #include "objfmt.h" #include "expr-int.h" -#include "bc-int.h" #include "inttree.h" diff --git a/libyasm/value.c b/libyasm/value.c index 0a5936c7..2fcabf49 100644 --- a/libyasm/value.c +++ b/libyasm/value.c @@ -44,7 +44,6 @@ #include "arch.h" #include "expr-int.h" -#include "bc-int.h" void yasm_value_initialize(/*@out@*/ yasm_value *value, diff --git a/modules/arch/lc3b/lc3bbc.c b/modules/arch/lc3b/lc3bbc.c index f864b328..e87aa8f5 100644 --- a/modules/arch/lc3b/lc3bbc.c +++ b/modules/arch/lc3b/lc3bbc.c @@ -27,7 +27,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_BC_INTERNAL #include #include "lc3barch.h" diff --git a/modules/arch/lc3b/lc3bid.re b/modules/arch/lc3b/lc3bid.re index 47c94644..bfdb4c0b 100644 --- a/modules/arch/lc3b/lc3bid.re +++ b/modules/arch/lc3b/lc3bid.re @@ -27,7 +27,6 @@ #include RCSID("$Id$"); -#define YASM_BC_INTERNAL #define YASM_EXPR_INTERNAL #include diff --git a/modules/arch/x86/x86bc.c b/modules/arch/x86/x86bc.c index cff6e583..5a73e5de 100644 --- a/modules/arch/x86/x86bc.c +++ b/modules/arch/x86/x86bc.c @@ -27,7 +27,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_BC_INTERNAL #define YASM_EXPR_INTERNAL #include diff --git a/modules/arch/x86/x86id.c b/modules/arch/x86/x86id.c index ce26da38..69e609a5 100644 --- a/modules/arch/x86/x86id.c +++ b/modules/arch/x86/x86id.c @@ -28,7 +28,6 @@ #include RCSID("$Id$"); -#define YASM_BC_INTERNAL #define YASM_EXPR_INTERNAL #include #include diff --git a/modules/dbgfmts/codeview/cv-dbgfmt.c b/modules/dbgfmts/codeview/cv-dbgfmt.c index 2cb23255..65ce493e 100644 --- a/modules/dbgfmts/codeview/cv-dbgfmt.c +++ b/modules/dbgfmts/codeview/cv-dbgfmt.c @@ -27,7 +27,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_BC_INTERNAL #include #include "cv-dbgfmt.h" diff --git a/modules/dbgfmts/codeview/cv-symline.c b/modules/dbgfmts/codeview/cv-symline.c index 6ad141a1..6d0874f8 100644 --- a/modules/dbgfmts/codeview/cv-symline.c +++ b/modules/dbgfmts/codeview/cv-symline.c @@ -30,7 +30,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_BC_INTERNAL #include #include "cv-dbgfmt.h" diff --git a/modules/dbgfmts/codeview/cv-type.c b/modules/dbgfmts/codeview/cv-type.c index 433013ea..47adc234 100644 --- a/modules/dbgfmts/codeview/cv-type.c +++ b/modules/dbgfmts/codeview/cv-type.c @@ -30,7 +30,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_BC_INTERNAL #include #include "cv-dbgfmt.h" diff --git a/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c b/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c index e889f51f..6e89a13d 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c +++ b/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c @@ -27,7 +27,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_BC_INTERNAL #include #include "dwarf2-dbgfmt.h" diff --git a/modules/dbgfmts/dwarf2/dwarf2-info.c b/modules/dbgfmts/dwarf2/dwarf2-info.c index be6cf605..9c3d52a5 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-info.c +++ b/modules/dbgfmts/dwarf2/dwarf2-info.c @@ -34,7 +34,6 @@ #include #endif -#define YASM_BC_INTERNAL #include #include "dwarf2-dbgfmt.h" diff --git a/modules/dbgfmts/dwarf2/dwarf2-line.c b/modules/dbgfmts/dwarf2/dwarf2-line.c index 90dc7ea9..e8d84d8c 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-line.c +++ b/modules/dbgfmts/dwarf2/dwarf2-line.c @@ -30,7 +30,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_BC_INTERNAL #include #include "dwarf2-dbgfmt.h" diff --git a/modules/dbgfmts/stabs/stabs-dbgfmt.c b/modules/dbgfmts/stabs/stabs-dbgfmt.c index ad25581a..5e908308 100644 --- a/modules/dbgfmts/stabs/stabs-dbgfmt.c +++ b/modules/dbgfmts/stabs/stabs-dbgfmt.c @@ -27,7 +27,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_BC_INTERNAL #include typedef enum { diff --git a/modules/listfmts/nasm/nasm-listfmt.c b/modules/listfmts/nasm/nasm-listfmt.c index 8b550435..ef5adde1 100644 --- a/modules/listfmts/nasm/nasm-listfmt.c +++ b/modules/listfmts/nasm/nasm-listfmt.c @@ -27,7 +27,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_BC_INTERNAL #include /* NOTE: For this code to generate relocation information, the relocations diff --git a/modules/objfmts/bin/bin-objfmt.c b/modules/objfmts/bin/bin-objfmt.c index cf06d50b..56515726 100644 --- a/modules/objfmts/bin/bin-objfmt.c +++ b/modules/objfmts/bin/bin-objfmt.c @@ -27,7 +27,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_BC_INTERNAL #define YASM_EXPR_INTERNAL #include diff --git a/modules/objfmts/coff/coff-objfmt.c b/modules/objfmts/coff/coff-objfmt.c index cb4719de..de31df71 100644 --- a/modules/objfmts/coff/coff-objfmt.c +++ b/modules/objfmts/coff/coff-objfmt.c @@ -28,7 +28,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_BC_INTERNAL #define YASM_EXPR_INTERNAL #include diff --git a/modules/objfmts/coff/win64-except.c b/modules/objfmts/coff/win64-except.c index 82b5f616..cbda39d3 100644 --- a/modules/objfmts/coff/win64-except.c +++ b/modules/objfmts/coff/win64-except.c @@ -27,7 +27,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_BC_INTERNAL #define YASM_EXPR_INTERNAL #include diff --git a/modules/objfmts/elf/elf-objfmt.c b/modules/objfmts/elf/elf-objfmt.c index ecf13f40..5f726eac 100644 --- a/modules/objfmts/elf/elf-objfmt.c +++ b/modules/objfmts/elf/elf-objfmt.c @@ -44,7 +44,6 @@ * Each Section is spatially disjoint, and has exactly one SHT entry. */ -#define YASM_BC_INTERNAL #define YASM_EXPR_INTERNAL #include diff --git a/modules/objfmts/macho/macho-objfmt.c b/modules/objfmts/macho/macho-objfmt.c index 507279e0..d1462829 100644 --- a/modules/objfmts/macho/macho-objfmt.c +++ b/modules/objfmts/macho/macho-objfmt.c @@ -108,7 +108,6 @@ /* optional: automatically prefix underscores to global exported symbols */ /*#define AUTO_UNDERSCORE*/ -#define YASM_BC_INTERNAL #define YASM_EXPR_INTERNAL #include diff --git a/modules/objfmts/rdf/rdf-objfmt.c b/modules/objfmts/rdf/rdf-objfmt.c index 64047915..6a0f6923 100644 --- a/modules/objfmts/rdf/rdf-objfmt.c +++ b/modules/objfmts/rdf/rdf-objfmt.c @@ -27,7 +27,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_BC_INTERNAL #define YASM_EXPR_INTERNAL #include diff --git a/modules/objfmts/xdf/xdf-objfmt.c b/modules/objfmts/xdf/xdf-objfmt.c index a0c58848..f68237e6 100644 --- a/modules/objfmts/xdf/xdf-objfmt.c +++ b/modules/objfmts/xdf/xdf-objfmt.c @@ -27,7 +27,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_BC_INTERNAL #define YASM_EXPR_INTERNAL #include From 2bb74148c18a8821c95571ea30294a39ac5b903a Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 14 Jul 2007 05:31:08 +0000 Subject: [PATCH 030/585] Merge expr-int.h into expr.h, removing YASM_EXPR_INTERNAL in the process. svn path=/trunk/yasm/; revision=1895 --- libyasm.h | 7 -- libyasm/Makefile.inc | 1 - libyasm/bc-reserve.c | 2 - libyasm/bytecode.c | 2 - libyasm/coretype.h | 7 +- libyasm/expr-int.h | 118 -------------------------- libyasm/expr.c | 8 -- libyasm/expr.h | 120 ++++++++++++++++++++++++++- libyasm/section.c | 2 - libyasm/value.c | 1 - modules/arch/lc3b/lc3bid.re | 1 - modules/arch/x86/x86bc.c | 1 - modules/arch/x86/x86expr.c | 1 - modules/arch/x86/x86id.c | 1 - modules/objfmts/bin/bin-objfmt.c | 1 - modules/objfmts/coff/coff-objfmt.c | 1 - modules/objfmts/coff/win64-except.c | 1 - modules/objfmts/elf/elf-objfmt.c | 1 - modules/objfmts/elf/elf-x86-amd64.c | 1 - modules/objfmts/elf/elf-x86-x86.c | 1 - modules/objfmts/elf/elf.c | 1 - modules/objfmts/macho/macho-objfmt.c | 1 - modules/objfmts/rdf/rdf-objfmt.c | 1 - modules/objfmts/xdf/xdf-objfmt.c | 1 - modules/parsers/gas/gas-parse.c | 1 - modules/parsers/nasm/nasm-parse.c | 1 - 26 files changed, 120 insertions(+), 164 deletions(-) delete mode 100644 libyasm/expr-int.h diff --git a/libyasm.h b/libyasm.h index bd38c646..6d7778e9 100644 --- a/libyasm.h +++ b/libyasm.h @@ -30,10 +30,6 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * \endlicense - * - * Additional parts may be included via: - * - YASM_EXPR_INTERNAL: reveal expr internal structures via expr-int.h - * inclusion */ #ifndef YASM_LIB_H #define YASM_LIB_H @@ -77,9 +73,6 @@ typedef unsigned long uintptr_t; #include #include -#ifdef YASM_EXPR_INTERNAL -#include -#endif #include #include diff --git a/libyasm/Makefile.inc b/libyasm/Makefile.inc index ee84ac48..9e82a0e3 100644 --- a/libyasm/Makefile.inc +++ b/libyasm/Makefile.inc @@ -59,7 +59,6 @@ modinclude_HEADERS += libyasm/coretype.h modinclude_HEADERS += libyasm/dbgfmt.h modinclude_HEADERS += libyasm/errwarn.h modinclude_HEADERS += libyasm/expr.h -modinclude_HEADERS += libyasm/expr-int.h modinclude_HEADERS += libyasm/file.h modinclude_HEADERS += libyasm/floatnum.h modinclude_HEADERS += libyasm/hamt.h diff --git a/libyasm/bc-reserve.c b/libyasm/bc-reserve.c index 1bc0c888..32f524f9 100644 --- a/libyasm/bc-reserve.c +++ b/libyasm/bc-reserve.c @@ -37,8 +37,6 @@ #include "bytecode.h" -#include "expr-int.h" - typedef struct bytecode_reserve { /*@only@*/ /*@null@*/ yasm_expr *numitems; /* number of items to reserve */ diff --git a/libyasm/bytecode.c b/libyasm/bytecode.c index 3828795c..b8386f79 100644 --- a/libyasm/bytecode.c +++ b/libyasm/bytecode.c @@ -38,8 +38,6 @@ #include "bytecode.h" -#include "expr-int.h" - void yasm_bc_set_multiple(yasm_bytecode *bc, yasm_expr *e) diff --git a/libyasm/coretype.h b/libyasm/coretype.h index 395a9c43..18dab291 100644 --- a/libyasm/coretype.h +++ b/libyasm/coretype.h @@ -74,7 +74,7 @@ typedef struct yasm_assoc_data_callback { */ typedef struct yasm_errwarns yasm_errwarns; -/** Bytecode. \see bytecode.h for defails and related functions. */ +/** Bytecode. \see bytecode.h for details and related functions. */ typedef struct yasm_bytecode yasm_bytecode; /** Object. \see section.h for details and related functions. */ @@ -89,10 +89,7 @@ typedef struct yasm_symtab yasm_symtab; /** Symbol record (opaque type). \see symrec.h for related functions. */ typedef struct yasm_symrec yasm_symrec; -/** Expression (opaque type). - * \see expr.h for related functions. - * Define YASM_EXPR_INTERNAL to get visible internals. - */ +/** Expression. \see expr.h for details and related functions. */ typedef struct yasm_expr yasm_expr; /** Integer value (opaque type). \see intnum.h for related functions. */ typedef struct yasm_intnum yasm_intnum; diff --git a/libyasm/expr-int.h b/libyasm/expr-int.h deleted file mode 100644 index 6946adc5..00000000 --- a/libyasm/expr-int.h +++ /dev/null @@ -1,118 +0,0 @@ -/* $Id$ - * Expressions internal structures header file - * - * Copyright (C) 2001-2007 Peter Johnson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ -#ifndef YASM_EXPR_INT_H -#define YASM_EXPR_INT_H - -/* Types listed in canonical sorting order. See expr_order_terms(). - * Note precbc must be used carefully (in a-b pairs), as only symrecs can - * become the relative term in a #yasm_value. - */ -typedef enum yasm_expr__type { - YASM_EXPR_NONE = 0, - YASM_EXPR_REG = 1<<0, - YASM_EXPR_INT = 1<<1, - YASM_EXPR_SUBST = 1<<2, - YASM_EXPR_FLOAT = 1<<3, - YASM_EXPR_SYM = 1<<4, - YASM_EXPR_PRECBC = 1<<5, /* direct bytecode ref (rather than via symrec) */ - YASM_EXPR_EXPR = 1<<6 -} yasm_expr__type; - -struct yasm_expr__item { - yasm_expr__type type; - union { - yasm_bytecode *precbc; - yasm_symrec *sym; - yasm_expr *expn; - yasm_intnum *intn; - yasm_floatnum *flt; - uintptr_t reg; - unsigned int subst; - } data; -}; - -/* Some operations may allow more than two operand terms: - * ADD, MUL, OR, AND, XOR - */ -struct yasm_expr { - yasm_expr_op op; - unsigned long line; - int numterms; - yasm_expr__item terms[2]; /* structure may be extended to include more */ -}; - -/* Traverse over expression tree in order, calling func for each leaf - * (non-operation). The data pointer d is passed to each func call. - * - * Stops early (and returns 1) if func returns 1. Otherwise returns 0. - */ -int yasm_expr__traverse_leaves_in_const - (const yasm_expr *e, /*@null@*/ void *d, - int (*func) (/*@null@*/ const yasm_expr__item *ei, /*@null@*/ void *d)); -int yasm_expr__traverse_leaves_in - (yasm_expr *e, /*@null@*/ void *d, - int (*func) (/*@null@*/ yasm_expr__item *ei, /*@null@*/ void *d)); - -/* Reorder terms of e into canonical order. Only reorders if reordering - * doesn't change meaning of expression. (eg, doesn't reorder SUB). - * Canonical order: REG, INT, FLOAT, SYM, EXPR. - * Multiple terms of a single type are kept in the same order as in - * the original expression. - * NOTE: Only performs reordering on *one* level (no recursion). - */ -void yasm_expr__order_terms(yasm_expr *e); - -/* Copy entire expression EXCEPT for index "except" at *top level only*. */ -yasm_expr *yasm_expr__copy_except(const yasm_expr *e, int except); - -int yasm_expr__contains(const yasm_expr *e, yasm_expr__type t); - -/** Transform symrec-symrec terms in expression into YASM_EXPR_SUBST items. - * Calls the callback function for each symrec-symrec term. - * \param ep expression (pointer to) - * \param cbd callback data passed to callback function - * \param callback callback function: given subst index for bytecode - * pair, bytecode pair (bc2-bc1), and cbd (callback data) - * \return Number of transformations made. - */ -int yasm_expr__bc_dist_subst(yasm_expr **ep, void *cbd, - void (*callback) (unsigned int subst, - yasm_bytecode *precbc, - yasm_bytecode *precbc2, - void *cbd)); - -/** Substitute items into expr YASM_EXPR_SUBST items (by index). Items are - * copied, so caller is responsible for freeing array of items. - * \param e expression - * \param num_items number of items in items array - * \param items items array - * \return 1 on error (index out of range). - */ -int yasm_expr__subst(yasm_expr *e, unsigned int num_items, - const yasm_expr__item *items); - -#endif diff --git a/libyasm/expr.c b/libyasm/expr.c index 34800935..fe7cb9a9 100644 --- a/libyasm/expr.c +++ b/libyasm/expr.c @@ -42,8 +42,6 @@ #include "arch.h" -#include "expr-int.h" - static int expr_traverse_nodes_post(/*@null@*/ yasm_expr *e, /*@null@*/ void *d, @@ -1007,12 +1005,6 @@ yasm_expr__copy_except(const yasm_expr *e, int except) return n; } -yasm_expr * -yasm_expr_copy(const yasm_expr *e) -{ - return yasm_expr__copy_except(e, -1); -} - static void expr_delete_term(yasm_expr__item *term, int recurse) { diff --git a/libyasm/expr.h b/libyasm/expr.h index ca189d0a..694ba72e 100644 --- a/libyasm/expr.h +++ b/libyasm/expr.h @@ -34,8 +34,50 @@ #ifndef YASM_EXPR_H #define YASM_EXPR_H -/** Expression item (opaque type). \internal */ -typedef struct yasm_expr__item yasm_expr__item; +/** Type of an expression item. Types are listed in canonical sorting order. + * See expr_order_terms(). + * Note #YASM_EXPR_PRECBC must be used carefully (in a-b pairs), as only + * symrecs can become the relative term in a #yasm_value. + */ +typedef enum yasm_expr__type { + YASM_EXPR_NONE = 0, /**< Nothing */ + YASM_EXPR_REG = 1<<0, /**< Register */ + YASM_EXPR_INT = 1<<1, /**< Integer value */ + YASM_EXPR_SUBST = 1<<2, /**< Substitution placeholder */ + YASM_EXPR_FLOAT = 1<<3, /**< Floating point value */ + YASM_EXPR_SYM = 1<<4, /**< Symbol */ + YASM_EXPR_PRECBC = 1<<5,/**< Direct bytecode ref (rather than via sym) */ + YASM_EXPR_EXPR = 1<<6 /**< Subexpression */ +} yasm_expr__type; + +/** Expression item. */ +typedef struct yasm_expr__item { + yasm_expr__type type; /**< Type */ + + /** Expression item data. Correct value depends on type. */ + union { + yasm_bytecode *precbc; /**< Direct bytecode ref (#YASM_EXPR_PRECBC) */ + yasm_symrec *sym; /**< Symbol (#YASM_EXPR_SYM) */ + yasm_expr *expn; /**< Subexpression (#YASM_EXPR_EXPR) */ + yasm_intnum *intn; /**< Integer value (#YASM_EXPR_INT) */ + yasm_floatnum *flt; /**< Floating point value (#YASM_EXPR_FLOAT) */ + uintptr_t reg; /**< Register (#YASM_EXPR_REG) */ + unsigned int subst; /**< Subst placeholder (#YASM_EXPR_SUBST) */ + } data; +} yasm_expr__item; + +/** Expression. */ +struct yasm_expr { + yasm_expr_op op; /**< Operation. */ + unsigned long line; /**< Line number where expression was defined. */ + int numterms; /**< Number of terms in the expression. */ + + /** Terms of the expression. Structure may be extended to include more + * terms, as some operations may allow more than two operand terms + * (ADD, MUL, OR, AND, XOR). + */ + yasm_expr__item terms[2]; +}; /** Create a new expression e=a op b. * \param op operation @@ -116,6 +158,7 @@ typedef struct yasm_expr__item yasm_expr__item; * \return Newly allocated expression identical to e. */ yasm_expr *yasm_expr_copy(const yasm_expr *e); +#define yasm_expr_copy(e) yasm_expr__copy_except(e, -1) /** Destroy (free allocated memory for) an expression. * \param e expression @@ -231,4 +274,77 @@ typedef /*@only@*/ yasm_expr * (*yasm_expr_xform_func) */ void yasm_expr_print(/*@null@*/ const yasm_expr *e, FILE *f); +/** Traverse over expression tree in order (const version). + * Calls func for each leaf (non-operation). + * \param e expression + * \param d data passed to each call to func + * \param func callback function + * \return Stops early (and returns 1) if func returns 1. + * Otherwise returns 0. + */ +int yasm_expr__traverse_leaves_in_const + (const yasm_expr *e, /*@null@*/ void *d, + int (*func) (/*@null@*/ const yasm_expr__item *ei, /*@null@*/ void *d)); + +/** Traverse over expression tree in order. + * Calls func for each leaf (non-operation). + * \param e expression + * \param d data passed to each call to func + * \param func callback function + * \return Stops early (and returns 1) if func returns 1. + * Otherwise returns 0. + */ +int yasm_expr__traverse_leaves_in + (yasm_expr *e, /*@null@*/ void *d, + int (*func) (/*@null@*/ yasm_expr__item *ei, /*@null@*/ void *d)); + +/** Reorder terms of e into canonical order. Only reorders if reordering + * doesn't change meaning of expression. (eg, doesn't reorder SUB). + * Canonical order: REG, INT, FLOAT, SYM, EXPR. + * Multiple terms of a single type are kept in the same order as in + * the original expression. + * \param e expression + * \note Only performs reordering on *one* level (no recursion). + */ +void yasm_expr__order_terms(yasm_expr *e); + +/** Copy entire expression EXCEPT for index "except" at *top level only*. + * \param e expression + * \param except term index not to copy; -1 to copy all terms + * \return Newly allocated copy of expression. + */ +yasm_expr *yasm_expr__copy_except(const yasm_expr *e, int except); + +/** Test if expression contains an item. Searches recursively into + * subexpressions. + * \param e expression + * \param t type of item to look for + * \return Nonzero if expression contains an item of type t, zero if not. + */ +int yasm_expr__contains(const yasm_expr *e, yasm_expr__type t); + +/** Transform symrec-symrec terms in expression into #YASM_EXPR_SUBST items. + * Calls the callback function for each symrec-symrec term. + * \param ep expression (pointer to) + * \param cbd callback data passed to callback function + * \param callback callback function: given subst index for bytecode + * pair, bytecode pair (bc2-bc1), and cbd (callback data) + * \return Number of transformations made. + */ +int yasm_expr__bc_dist_subst(yasm_expr **ep, void *cbd, + void (*callback) (unsigned int subst, + yasm_bytecode *precbc, + yasm_bytecode *precbc2, + void *cbd)); + +/** Substitute items into expr YASM_EXPR_SUBST items (by index). Items are + * copied, so caller is responsible for freeing array of items. + * \param e expression + * \param num_items number of items in items array + * \param items items array + * \return 1 on error (index out of range). + */ +int yasm_expr__subst(yasm_expr *e, unsigned int num_items, + const yasm_expr__item *items); + #endif diff --git a/libyasm/section.c b/libyasm/section.c index 21ea56a9..c5b83cb8 100644 --- a/libyasm/section.c +++ b/libyasm/section.c @@ -49,8 +49,6 @@ #include "dbgfmt.h" #include "objfmt.h" -#include "expr-int.h" - #include "inttree.h" diff --git a/libyasm/value.c b/libyasm/value.c index 2fcabf49..e3eda5fd 100644 --- a/libyasm/value.c +++ b/libyasm/value.c @@ -43,7 +43,6 @@ #include "arch.h" -#include "expr-int.h" void yasm_value_initialize(/*@out@*/ yasm_value *value, diff --git a/modules/arch/lc3b/lc3bid.re b/modules/arch/lc3b/lc3bid.re index bfdb4c0b..2529664a 100644 --- a/modules/arch/lc3b/lc3bid.re +++ b/modules/arch/lc3b/lc3bid.re @@ -27,7 +27,6 @@ #include RCSID("$Id$"); -#define YASM_EXPR_INTERNAL #include #include "modules/arch/lc3b/lc3barch.h" diff --git a/modules/arch/x86/x86bc.c b/modules/arch/x86/x86bc.c index 5a73e5de..6dd31110 100644 --- a/modules/arch/x86/x86bc.c +++ b/modules/arch/x86/x86bc.c @@ -27,7 +27,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_EXPR_INTERNAL #include #include "x86arch.h" diff --git a/modules/arch/x86/x86expr.c b/modules/arch/x86/x86expr.c index ae99f7d2..8d11b1ab 100644 --- a/modules/arch/x86/x86expr.c +++ b/modules/arch/x86/x86expr.c @@ -27,7 +27,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_EXPR_INTERNAL #include #include "x86arch.h" diff --git a/modules/arch/x86/x86id.c b/modules/arch/x86/x86id.c index 69e609a5..278cb2df 100644 --- a/modules/arch/x86/x86id.c +++ b/modules/arch/x86/x86id.c @@ -28,7 +28,6 @@ #include RCSID("$Id$"); -#define YASM_EXPR_INTERNAL #include #include diff --git a/modules/objfmts/bin/bin-objfmt.c b/modules/objfmts/bin/bin-objfmt.c index 56515726..7056f97a 100644 --- a/modules/objfmts/bin/bin-objfmt.c +++ b/modules/objfmts/bin/bin-objfmt.c @@ -27,7 +27,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_EXPR_INTERNAL #include diff --git a/modules/objfmts/coff/coff-objfmt.c b/modules/objfmts/coff/coff-objfmt.c index de31df71..52f1e4aa 100644 --- a/modules/objfmts/coff/coff-objfmt.c +++ b/modules/objfmts/coff/coff-objfmt.c @@ -28,7 +28,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_EXPR_INTERNAL #include #include "coff-objfmt.h" diff --git a/modules/objfmts/coff/win64-except.c b/modules/objfmts/coff/win64-except.c index cbda39d3..ea703812 100644 --- a/modules/objfmts/coff/win64-except.c +++ b/modules/objfmts/coff/win64-except.c @@ -27,7 +27,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_EXPR_INTERNAL #include #include "coff-objfmt.h" diff --git a/modules/objfmts/elf/elf-objfmt.c b/modules/objfmts/elf/elf-objfmt.c index 5f726eac..664d1351 100644 --- a/modules/objfmts/elf/elf-objfmt.c +++ b/modules/objfmts/elf/elf-objfmt.c @@ -44,7 +44,6 @@ * Each Section is spatially disjoint, and has exactly one SHT entry. */ -#define YASM_EXPR_INTERNAL #include #include "elf.h" diff --git a/modules/objfmts/elf/elf-x86-amd64.c b/modules/objfmts/elf/elf-x86-amd64.c index 559fb50c..ce0cdda1 100644 --- a/modules/objfmts/elf/elf-x86-amd64.c +++ b/modules/objfmts/elf/elf-x86-amd64.c @@ -28,7 +28,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_EXPR_INTERNAL #include #define YASM_OBJFMT_ELF_INTERNAL #include "elf.h" diff --git a/modules/objfmts/elf/elf-x86-x86.c b/modules/objfmts/elf/elf-x86-x86.c index d639b599..827c861e 100644 --- a/modules/objfmts/elf/elf-x86-x86.c +++ b/modules/objfmts/elf/elf-x86-x86.c @@ -28,7 +28,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_EXPR_INTERNAL #include #define YASM_OBJFMT_ELF_INTERNAL #include "elf.h" diff --git a/modules/objfmts/elf/elf.c b/modules/objfmts/elf/elf.c index e3b23276..f187b9e7 100644 --- a/modules/objfmts/elf/elf.c +++ b/modules/objfmts/elf/elf.c @@ -28,7 +28,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_EXPR_INTERNAL #include #define YASM_OBJFMT_ELF_INTERNAL #include "elf.h" diff --git a/modules/objfmts/macho/macho-objfmt.c b/modules/objfmts/macho/macho-objfmt.c index d1462829..3f13948f 100644 --- a/modules/objfmts/macho/macho-objfmt.c +++ b/modules/objfmts/macho/macho-objfmt.c @@ -108,7 +108,6 @@ /* optional: automatically prefix underscores to global exported symbols */ /*#define AUTO_UNDERSCORE*/ -#define YASM_EXPR_INTERNAL #include /* MACH-O DEFINES */ diff --git a/modules/objfmts/rdf/rdf-objfmt.c b/modules/objfmts/rdf/rdf-objfmt.c index 6a0f6923..2b96bed3 100644 --- a/modules/objfmts/rdf/rdf-objfmt.c +++ b/modules/objfmts/rdf/rdf-objfmt.c @@ -27,7 +27,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_EXPR_INTERNAL #include diff --git a/modules/objfmts/xdf/xdf-objfmt.c b/modules/objfmts/xdf/xdf-objfmt.c index f68237e6..4ce2f3ef 100644 --- a/modules/objfmts/xdf/xdf-objfmt.c +++ b/modules/objfmts/xdf/xdf-objfmt.c @@ -27,7 +27,6 @@ #include /*@unused@*/ RCSID("$Id$"); -#define YASM_EXPR_INTERNAL #include diff --git a/modules/parsers/gas/gas-parse.c b/modules/parsers/gas/gas-parse.c index 6e79ec1c..6f92ebb2 100644 --- a/modules/parsers/gas/gas-parse.c +++ b/modules/parsers/gas/gas-parse.c @@ -30,7 +30,6 @@ #include RCSID("$Id$"); -#define YASM_EXPR_INTERNAL #include #include diff --git a/modules/parsers/nasm/nasm-parse.c b/modules/parsers/nasm/nasm-parse.c index 5ef7c11f..b449dd1c 100644 --- a/modules/parsers/nasm/nasm-parse.c +++ b/modules/parsers/nasm/nasm-parse.c @@ -27,7 +27,6 @@ #include RCSID("$Id$"); -#define YASM_EXPR_INTERNAL #include #include From 4fab0318c51870912d3c4c6d6375b91252fbecce Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 15 Jul 2007 21:54:11 +0000 Subject: [PATCH 031/585] 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 --- libyasm/linemap.c | 54 ++++++++++++++++++++--------------------------- 1 file changed, 23 insertions(+), 31 deletions(-) diff --git a/libyasm/linemap.c b/libyasm/linemap.c index b2c2d992..926c3102 100644 --- a/libyasm/linemap.c +++ b/libyasm/linemap.c @@ -34,13 +34,6 @@ #include "linemap.h" -/* Source lines tracking */ -typedef struct { - struct line_mapping *vector; - unsigned long size; - unsigned long allocated; -} line_mapping_head; - typedef struct line_mapping { /* monotonically increasing virtual line */ unsigned long line; @@ -70,7 +63,9 @@ struct yasm_linemap { unsigned long current; /* Mappings from virtual to physical line numbers */ - /*@only@*/ /*@null@*/ line_mapping_head *map; + struct line_mapping *map_vector; + unsigned long map_size; + unsigned long map_allocated; /* Bytecode and source line information */ /*@only@*/ line_source_info *source_info; @@ -92,22 +87,22 @@ yasm_linemap_set(yasm_linemap *linemap, const char *filename, line_mapping *mapping; /* Create a new mapping in the map */ - if (linemap->map->size >= linemap->map->allocated) { + if (linemap->map_size >= linemap->map_allocated) { /* allocate another size bins when full for 2x space */ - linemap->map->vector = - yasm_xrealloc(linemap->map->vector, 2*linemap->map->allocated + linemap->map_vector = + yasm_xrealloc(linemap->map_vector, 2*linemap->map_allocated *sizeof(line_mapping)); - linemap->map->allocated *= 2; + linemap->map_allocated *= 2; } - mapping = &linemap->map->vector[linemap->map->size]; - linemap->map->size++; + mapping = &linemap->map_vector[linemap->map_size]; + linemap->map_size++; /* Fill it */ if (!filename) { - if (linemap->map->size >= 2) + if (linemap->map_size >= 2) mapping->filename = - linemap->map->vector[linemap->map->size-2].filename; + linemap->map_vector[linemap->map_size-2].filename; else filename = "unknown"; } @@ -135,12 +130,14 @@ yasm_linemap_poke(yasm_linemap *linemap, const char *filename, linemap->current++; yasm_linemap_set(linemap, filename, file_line, 0); - mapping = &linemap->map->vector[linemap->map->size-1]; + mapping = &linemap->map_vector[linemap->map_size-1]; line = linemap->current; linemap->current++; - yasm_linemap_set(linemap, mapping->filename, mapping->file_line, + yasm_linemap_set(linemap, mapping->filename, + mapping->file_line + + mapping->line_inc*(linemap->current-2-mapping->line), mapping->line_inc); return line; @@ -157,10 +154,9 @@ yasm_linemap_create(void) linemap->current = 1; /* initialize mapping vector */ - linemap->map = yasm_xmalloc(sizeof(line_mapping_head)); - linemap->map->vector = yasm_xmalloc(8*sizeof(line_mapping)); - linemap->map->size = 0; - linemap->map->allocated = 8; + linemap->map_vector = yasm_xmalloc(8*sizeof(line_mapping)); + linemap->map_size = 0; + linemap->map_allocated = 8; /* initialize source line information array */ linemap->source_info_size = 2; @@ -184,10 +180,7 @@ yasm_linemap_destroy(yasm_linemap *linemap) } yasm_xfree(linemap->source_info); - if (linemap->map) { - yasm_xfree(linemap->map->vector); - yasm_xfree(linemap->map); - } + yasm_xfree(linemap->map_vector); if (linemap->filenames) HAMT_destroy(linemap->filenames, filename_delete_one); @@ -242,19 +235,18 @@ yasm_linemap_lookup(yasm_linemap *linemap, unsigned long line, assert(line <= linemap->current); /* Binary search through map to find highest line_index <= index */ - assert(linemap->map != NULL); vindex = 0; /* start step as the greatest power of 2 <= size */ step = 1; - while (step*2<=linemap->map->size) + while (step*2<=linemap->map_size) step*=2; while (step>0) { - if (vindex+step < linemap->map->size - && linemap->map->vector[vindex+step].line <= line) + if (vindex+step < linemap->map_size + && linemap->map_vector[vindex+step].line <= line) vindex += step; step /= 2; } - mapping = &linemap->map->vector[vindex]; + mapping = &linemap->map_vector[vindex]; *filename = mapping->filename; *file_line = mapping->file_line + mapping->line_inc*(line-mapping->line); From a310410911641fd846d668e91aa14abc0f00e404 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Mon, 16 Jul 2007 04:42:02 +0000 Subject: [PATCH 032/585] Doxygen documentation fixes. svn path=/trunk/yasm/; revision=1897 --- libyasm/bytecode.h | 21 +++++++++++---------- libyasm/expr.h | 2 ++ libyasm/section.h | 4 +++- libyasm/valparam.h | 22 +++++++++++++++++----- 4 files changed, 33 insertions(+), 16 deletions(-) diff --git a/libyasm/bytecode.h b/libyasm/bytecode.h index 0cf1888a..afe8b147 100644 --- a/libyasm/bytecode.h +++ b/libyasm/bytecode.h @@ -36,9 +36,10 @@ /** A data value (opaque type). */ typedef struct yasm_dataval yasm_dataval; -/** A list of data values (opaque type). */ +/** A list of data values. */ typedef struct yasm_datavalhead yasm_datavalhead; +/** Linked list of data values. */ /*@reldef@*/ STAILQ_HEAD(yasm_datavalhead, yasm_dataval); /** Add a dependent span for a bytecode. @@ -128,21 +129,19 @@ typedef struct yasm_bytecode_callback { * A generic fill-in for this is yasm_bc_tobytes_common(), but as this * function internal errors when called, be very careful when using it! * \param bc bytecode - * \param buf byte representation destination buffer - * \param bufsize size of buf (in bytes) prior to call; size of the - * generated data after call - * \param gap if nonzero, indicates the data does not really - * need to exist in the object file; if nonzero, - * contents of buf are undefined [output] + * \param bufp byte representation destination buffer; + * should be incremented as it's written to, + * so that on return its delta from the + * passed-in buf matches the bytecode length + * (it's okay not to do this if an error + * indication is returned) * \param d data to pass to each call to * output_value/output_reloc * \param output_value function to call to convert values into their byte * representation * \param output_reloc function to call to output relocation entries * for a single sym - * \return Newly allocated buffer that should be used instead of buf for - * reading the byte representation, or NULL if buf was big enough - * to hold the entire byte representation. + * \return Nonzero on error, 0 on success. * \note May result in non-reversible changes to the bytecode, but it's * preferable if calling this function twice would result in the * same output. @@ -520,7 +519,9 @@ yasm_dataval *yasm_dv_create_raw(/*@keep@*/ unsigned char *contents, * \param headp list of data values */ void yasm_dvs_initialize(yasm_datavalhead *headp); +#ifndef YASM_DOXYGEN #define yasm_dvs_initialize(headp) STAILQ_INIT(headp) +#endif /** Delete (free allocated memory for) a list of data values. * \param headp list of data values diff --git a/libyasm/expr.h b/libyasm/expr.h index 694ba72e..61975674 100644 --- a/libyasm/expr.h +++ b/libyasm/expr.h @@ -158,7 +158,9 @@ struct yasm_expr { * \return Newly allocated expression identical to e. */ yasm_expr *yasm_expr_copy(const yasm_expr *e); +#ifndef YASM_DOXYGEN #define yasm_expr_copy(e) yasm_expr__copy_except(e, -1) +#endif /** Destroy (free allocated memory for) an expression. * \param e expression diff --git a/libyasm/section.h b/libyasm/section.h index ff18e331..bb7d3c13 100644 --- a/libyasm/section.h +++ b/libyasm/section.h @@ -40,7 +40,7 @@ typedef struct yasm_reloc yasm_reloc; struct yasm_reloc { - /*@reldef@*/ STAILQ_ENTRY(yasm_reloc) link; + /*@reldef@*/ STAILQ_ENTRY(yasm_reloc) link; /**< Link to next reloc */ yasm_intnum *addr; /**< Offset (address) within section */ /*@dependent@*/ yasm_symrec *sym; /**< Relocated symbol */ }; @@ -252,7 +252,9 @@ void yasm_section_add_reloc(yasm_section *sect, yasm_reloc *reloc, * \return Next relocation for section. NULL if no more relocations. */ /*@null@*/ yasm_reloc *yasm_section_reloc_next(yasm_reloc *reloc); +#ifndef YASM_DOXYGEN #define yasm_section_reloc_next(x) STAILQ_NEXT((x), link) +#endif /** Get the basic relocation information for a relocation. * \param reloc relocation diff --git a/libyasm/valparam.h b/libyasm/valparam.h index d33a3cf6..9646718a 100644 --- a/libyasm/valparam.h +++ b/libyasm/valparam.h @@ -39,23 +39,25 @@ struct yasm_valparam { /*@reldef@*/ STAILQ_ENTRY(yasm_valparam) link; /**< Next pair in list */ /*@owned@*/ /*@null@*/ char *val; /**< Value */ + /** Parameter type. */ enum yasm_param_type { YASM_PARAM_ID, /**< Identifier */ YASM_PARAM_STRING, /**< String */ YASM_PARAM_EXPR /**< Expression */ } type; /**< Parameter type */ + /** Parameter value. */ union yasm_param { /*@owned@*/ char *id; /**< Identifier */ /*@owned@*/ char *str; /**< String */ /*@owned@*/ yasm_expr *e; /**< Expression */ } param; /**< Parameter */ - /* Prefix character that indicates a raw identifier. When yasm_vp_string() - * is called on a #YASM_PARAM_ID, all characters are returned. When - * yasm_vp_id() is called on a #YASM_PARAM_ID, if the identifier begins - * with this character, this character is stripped from the returned - * value. + /** Prefix character that indicates a raw identifier. When + * yasm_vp_string() is called on a #YASM_PARAM_ID, all characters are + * returned. When yasm_vp_id() is called on a #YASM_PARAM_ID, if the + * identifier begins with this character, this character is stripped + * from the returned value. */ char id_prefix; }; @@ -168,7 +170,9 @@ void yasm_vps_destroy(yasm_valparamhead *headp); * \param headp linked list */ void yasm_vps_initialize(/*@out@*/ yasm_valparamhead *headp); +#ifndef YASM_DOXYGEN #define yasm_vps_initialize(headp) STAILQ_INIT(headp) +#endif /** Destroy (free allocated memory for) linked list of valparams (created with * yasm_vps_initialize). @@ -182,10 +186,12 @@ void yasm_vps_delete(yasm_valparamhead *headp); * \param vp valparam */ void yasm_vps_append(yasm_valparamhead *headp, /*@keep@*/ yasm_valparam *vp); +#ifndef YASM_DOXYGEN #define yasm_vps_append(headp, vp) do { \ if (vp) \ STAILQ_INSERT_TAIL(headp, vp, link); \ } while(0) +#endif /** Get first valparam in linked list. * \param headp linked list @@ -193,21 +199,27 @@ void yasm_vps_append(yasm_valparamhead *headp, /*@keep@*/ yasm_valparam *vp); */ /*@null@*/ /*@dependent@*/ yasm_valparam *yasm_vps_first (yasm_valparamhead *headp); +#ifndef YASM_DOXYGEN #define yasm_vps_first(headp) STAILQ_FIRST(headp) +#endif /** Get next valparam in linked list. * \param cur previous valparam in linked list * \return Next valparam in linked list. */ /*@null@*/ /*@dependent@*/ yasm_valparam *yasm_vps_next(yasm_valparam *cur); +#ifndef YASM_DOXYGEN #define yasm_vps_next(cur) STAILQ_NEXT(cur, link) +#endif /** Iterate through linked list of valparams. * \internal * \param iter iterator variable * \param headp linked list */ +#ifndef YASM_DOXYGEN #define yasm_vps_foreach(iter, headp) STAILQ_FOREACH(iter, headp, link) +#endif /** Print linked list of valparams. For debugging purposes. * \param f file From 328320cc2b038a4f486655b9244a8c0b3facc56b Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 20 Jul 2007 03:28:24 +0000 Subject: [PATCH 033/585] Add support for GAS local labels (1:, 1f, 1b). Noticed by: Jung Lee svn path=/trunk/yasm/; revision=1898 --- modules/parsers/gas/gas-parser.c | 4 ++++ modules/parsers/gas/gas-parser.h | 5 +++++ modules/parsers/gas/gas-token.re | 29 +++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+) diff --git a/modules/parsers/gas/gas-parser.c b/modules/parsers/gas/gas-parser.c index 16c792bd..9cc61382 100644 --- a/modules/parsers/gas/gas-parser.c +++ b/modules/parsers/gas/gas-parser.c @@ -41,6 +41,7 @@ gas_parser_do_parse(yasm_object *object, yasm_preproc *pp, FILE *f, yasm_errwarns *errwarns) { yasm_parser_gas parser_gas; + int i; parser_gas.object = object; parser_gas.linemap = linemap; @@ -71,6 +72,9 @@ gas_parser_do_parse(yasm_object *object, yasm_preproc *pp, FILE *f, parser_gas.rept = NULL; + for (i=0; i<10; i++) + parser_gas.local[i] = 0; + /* yacc debugging, needs YYDEBUG set in bison.y.in to work */ parser_gas.debug = 1; diff --git a/modules/parsers/gas/gas-parser.h b/modules/parsers/gas/gas-parser.h index 94ceff19..213e4696 100644 --- a/modules/parsers/gas/gas-parser.h +++ b/modules/parsers/gas/gas-parser.h @@ -149,6 +149,11 @@ typedef struct yasm_parser_gas { char peek_tokch; /*@null@*/ gas_rept *rept; + + /* Index of local labels; what's stored here is the /next/ index, + * so these are all 0 at start. + */ + unsigned long local[10]; } yasm_parser_gas; /* shorter access names to commonly used parser_gas fields */ diff --git a/modules/parsers/gas/gas-token.re b/modules/parsers/gas/gas-token.re index 457eee0e..efa400d0 100644 --- a/modules/parsers/gas/gas-token.re +++ b/modules/parsers/gas/gas-token.re @@ -529,6 +529,35 @@ scan: RETURN(LABEL); } + /* local label */ + [0-9] ':' { + /* increment label index */ + parser_gas->local[s->tok[0]-'0']++; + /* build local label name */ + lvalp->str_val = yasm_xmalloc(30); + sprintf(lvalp->str_val, "L%c\001%lu", s->tok[0], + parser_gas->local[s->tok[0]-'0']); + RETURN(LABEL); + } + + /* local label forward reference */ + [0-9] 'f' { + /* build local label name */ + lvalp->str_val = yasm_xmalloc(30); + sprintf(lvalp->str_val, "L%c\001%lu", s->tok[0], + parser_gas->local[s->tok[0]-'0']+1); + RETURN(ID); + } + + /* local label backward reference */ + [0-9] 'b' { + /* build local label name */ + lvalp->str_val = yasm_xmalloc(30); + sprintf(lvalp->str_val, "L%c\001%lu", s->tok[0], + parser_gas->local[s->tok[0]-'0']); + RETURN(ID); + } + /* identifier that may be an instruction, etc. */ [a-zA-Z][a-zA-Z0-9_$.]* { /* Can only be an instruction/prefix when not inside an From 36cdd57be284e60685a03c6016b3268711a21eb8 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 20 Jul 2007 03:40:59 +0000 Subject: [PATCH 034/585] 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 Testcase from: Xiaoming Mo svn path=/trunk/yasm/; revision=1899 --- libyasm/bc-org.c | 6 +- libyasm/bytecode.h | 3 +- modules/parsers/gas/gas-parse.c | 26 +- modules/parsers/gas/tests/bin/Makefile.inc | 2 + modules/parsers/gas/tests/bin/gas-llabel.asm | 29 ++ modules/parsers/gas/tests/bin/gas-llabel.hex | 512 +++++++++++++++++++ tools/python-yasm/bytecode.pxi | 4 +- 7 files changed, 573 insertions(+), 9 deletions(-) create mode 100644 modules/parsers/gas/tests/bin/gas-llabel.asm create mode 100644 modules/parsers/gas/tests/bin/gas-llabel.hex diff --git a/libyasm/bc-org.c b/libyasm/bc-org.c index e354f23e..ae0497a2 100644 --- a/libyasm/bc-org.c +++ b/libyasm/bc-org.c @@ -41,6 +41,7 @@ typedef struct bytecode_org { unsigned long start; /* target starting offset within section */ + unsigned long fill; /* fill value */ } bytecode_org; static void bc_org_destroy(void *contents); @@ -133,16 +134,17 @@ bc_org_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, } len = org->start - bc->offset; for (i=0; ifill); /* XXX: handle more than 8 bit? */ return 0; } yasm_bytecode * -yasm_bc_create_org(unsigned long start, unsigned long line) +yasm_bc_create_org(unsigned long start, unsigned long fill, unsigned long line) { bytecode_org *org = yasm_xmalloc(sizeof(bytecode_org)); org->start = start; + org->fill = fill; return yasm_bc_create_common(&bc_org_callback, org, line); } diff --git a/libyasm/bytecode.h b/libyasm/bytecode.h index afe8b147..e53dc542 100644 --- a/libyasm/bytecode.h +++ b/libyasm/bytecode.h @@ -351,11 +351,12 @@ void yasm_bc_set_multiple(yasm_bytecode *bc, /*@keep@*/ yasm_expr *e); /** Create a bytecode that puts the following bytecode at a fixed section * offset. * \param start section offset of following bytecode + * \param fill fill value * \param line virtual line (from yasm_linemap) * \return Newly allocated bytecode. */ /*@only@*/ yasm_bytecode *yasm_bc_create_org - (unsigned long start, unsigned long line); + (unsigned long start, unsigned long fill, unsigned long line); /** Get the section that contains a particular bytecode. * \param bc bytecode diff --git a/modules/parsers/gas/gas-parse.c b/modules/parsers/gas/gas-parse.c index 6f92ebb2..f45b35f8 100644 --- a/modules/parsers/gas/gas-parse.c +++ b/modules/parsers/gas/gas-parse.c @@ -388,14 +388,32 @@ parse_line(yasm_parser_gas *parser_gas) (int)ival); } case DIR_ORG: + { + yasm_intnum *start, *value=NULL; get_next_token(); /* DIR_ORG */ - if (!expect(INTNUM)) return NULL; + /* TODO: support expr instead of intnum */ - bc = yasm_bc_create_org(yasm_intnum_get_uint(INTNUM_val), cur_line); - yasm_intnum_destroy(INTNUM_val); + if (!expect(INTNUM)) return NULL; + start = INTNUM_val; get_next_token(); /* INTNUM */ + + if (curtok == ',') { + get_next_token(); /* ',' */ + /* TODO: support expr instead of intnum */ + if (!expect(INTNUM)) return NULL; + value = INTNUM_val; + get_next_token(); /* INTNUM */ + } + if (value) { + bc = yasm_bc_create_org(yasm_intnum_get_uint(start), + yasm_intnum_get_uint(value), cur_line); + yasm_intnum_destroy(value); + } else + bc = yasm_bc_create_org(yasm_intnum_get_uint(start), 0, + cur_line); + yasm_intnum_destroy(start); return bc; - + } /* Data visibility directives */ case DIR_LOCAL: get_next_token(); /* DIR_LOCAL */ diff --git a/modules/parsers/gas/tests/bin/Makefile.inc b/modules/parsers/gas/tests/bin/Makefile.inc index 8132e69c..196b82aa 100644 --- a/modules/parsers/gas/tests/bin/Makefile.inc +++ b/modules/parsers/gas/tests/bin/Makefile.inc @@ -6,6 +6,8 @@ EXTRA_DIST += modules/parsers/gas/tests/bin/gas_bin_test.sh EXTRA_DIST += modules/parsers/gas/tests/bin/gas-comment.asm EXTRA_DIST += modules/parsers/gas/tests/bin/gas-comment.errwarn EXTRA_DIST += modules/parsers/gas/tests/bin/gas-comment.hex +EXTRA_DIST += modules/parsers/gas/tests/bin/gas-llabel.asm +EXTRA_DIST += modules/parsers/gas/tests/bin/gas-llabel.hex EXTRA_DIST += modules/parsers/gas/tests/bin/gas-set.asm EXTRA_DIST += modules/parsers/gas/tests/bin/gas-set.hex EXTRA_DIST += modules/parsers/gas/tests/bin/rept-err.asm diff --git a/modules/parsers/gas/tests/bin/gas-llabel.asm b/modules/parsers/gas/tests/bin/gas-llabel.asm new file mode 100644 index 00000000..11f3f545 --- /dev/null +++ b/modules/parsers/gas/tests/bin/gas-llabel.asm @@ -0,0 +1,29 @@ +# Skelix by Xiaoming Mo (xiaoming.mo@skelix.org) +# Licence: GPLv2 + .text + #.globl start + .code16 +start: + jmp code +msg: + .string "Hello World!\x0" +code: + movw $0xb800,%ax + movw %ax, %es + xorw %ax, %ax + movw %ax, %ds + + movw $msg, %si + xorw %di, %di + cld + movb $0x07, %al +1: + cmpw $0, (%si) + je 1f + movsb + stosb + jmp 1b +1: jmp 1b +.org 0x1fe, 0x90 +.word 0xaa55 + diff --git a/modules/parsers/gas/tests/bin/gas-llabel.hex b/modules/parsers/gas/tests/bin/gas-llabel.hex new file mode 100644 index 00000000..4bef5c77 --- /dev/null +++ b/modules/parsers/gas/tests/bin/gas-llabel.hex @@ -0,0 +1,512 @@ +eb +0e +48 +65 +6c +6c +6f +20 +57 +6f +72 +6c +64 +21 +00 +00 +b8 +00 +b8 +8e +c0 +31 +c0 +8e +d8 +be +02 +00 +31 +ff +fc +b0 +07 +83 +3c +00 +74 +04 +a4 +aa +eb +f7 +eb +fe +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +55 +aa diff --git a/tools/python-yasm/bytecode.pxi b/tools/python-yasm/bytecode.pxi index 8a077b0d..193e3a6c 100644 --- a/tools/python-yasm/bytecode.pxi +++ b/tools/python-yasm/bytecode.pxi @@ -93,9 +93,9 @@ cdef object __make_bytecode(yasm_bytecode *bc): return bcobj # Org bytecode -def __org__new__(cls, start, line=0): +def __org__new__(cls, start, value=0, line=0): cdef yasm_bytecode *bc - bc = yasm_bc_create_org(start, line) + bc = yasm_bc_create_org(start, line, value) obj = Bytecode.__new__(cls, __pass_voidp(bc, Bytecode)) __bytecode_map[PyCObject_FromVoidPtr(bc, NULL)] = obj return obj From 326303113c615717b9fb399162874279225e23b8 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 26 Jul 2007 06:55:27 +0000 Subject: [PATCH 035/585] 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 --- libyasm/intnum.c | 322 ++++++++++++++++++++++------------------------- 1 file changed, 147 insertions(+), 175 deletions(-) diff --git a/libyasm/intnum.c b/libyasm/intnum.c index 0e3411f6..ef29893f 100644 --- a/libyasm/intnum.c +++ b/libyasm/intnum.c @@ -43,10 +43,10 @@ struct yasm_intnum { union val { - unsigned long ul; /* integer value (for integers <=32 bits) */ - wordptr bv; /* bit vector (for integers >32 bits) */ + long l; /* integer value (for integers <32 bits) */ + wordptr bv; /* bit vector (for integers >=32 bits) */ } val; - enum { INTNUM_UL, INTNUM_BV } type; + enum { INTNUM_L, INTNUM_BV } type; }; /* static bitvect used for conversions */ @@ -80,6 +80,55 @@ yasm_intnum_cleanup(void) BitVector_Destroy(conv_bv); } +/* Compress a bitvector into intnum storage. + * If saved as a bitvector, clones the passed bitvector. + * Can modify the passed bitvector. + */ +static void +intnum_frombv(/*@out@*/ yasm_intnum *intn, wordptr bv) +{ + if (Set_Max(bv) < 31) { + intn->type = INTNUM_L; + intn->val.l = (long)BitVector_Chunk_Read(bv, 31, 0); + } else if (BitVector_msb_(bv)) { + /* Negative, negate and see if we'll fit into a long. */ + unsigned long ul; + BitVector_Negate(bv, bv); + if (Set_Max(bv) >= 32 || + ((ul = BitVector_Chunk_Read(bv, 32, 0)) & 0x80000000)) { + /* too negative */ + BitVector_Negate(bv, bv); + intn->type = INTNUM_BV; + intn->val.bv = BitVector_Clone(bv); + } else { + intn->type = INTNUM_L; + intn->val.l = -((long)ul); + } + } else { + intn->type = INTNUM_BV; + intn->val.bv = BitVector_Clone(bv); + } +} + +/* If intnum is a BV, returns its bitvector directly. + * If not, converts into passed bv and returns that instead. + */ +static wordptr +intnum_tobv(/*@returned@*/ wordptr bv, const yasm_intnum *intn) +{ + if (intn->type == INTNUM_BV) + return intn->val.bv; + + BitVector_Empty(bv); + if (intn->val.l >= 0) + BitVector_Chunk_Store(bv, 32, 0, (unsigned long)intn->val.l); + else { + BitVector_Chunk_Store(bv, 32, 0, (unsigned long)-intn->val.l); + BitVector_Negate(bv, bv); + } + return bv; +} + yasm_intnum * yasm_intnum_create_dec(char *str) { @@ -97,14 +146,7 @@ yasm_intnum_create_dec(char *str) default: break; } - if (Set_Max(conv_bv) < 32) { - intn->type = INTNUM_UL; - intn->val.ul = BitVector_Chunk_Read(conv_bv, 32, 0); - } else { - intn->type = INTNUM_BV; - intn->val.bv = BitVector_Clone(conv_bv); - } - + intnum_frombv(intn, conv_bv); return intn; } @@ -124,14 +166,7 @@ yasm_intnum_create_bin(char *str) default: break; } - if (Set_Max(conv_bv) < 32) { - intn->type = INTNUM_UL; - intn->val.ul = BitVector_Chunk_Read(conv_bv, 32, 0); - } else { - intn->type = INTNUM_BV; - intn->val.bv = BitVector_Clone(conv_bv); - } - + intnum_frombv(intn, conv_bv); return intn; } @@ -151,14 +186,7 @@ yasm_intnum_create_oct(char *str) default: break; } - if (Set_Max(conv_bv) < 32) { - intn->type = INTNUM_UL; - intn->val.ul = BitVector_Chunk_Read(conv_bv, 32, 0); - } else { - intn->type = INTNUM_BV; - intn->val.bv = BitVector_Clone(conv_bv); - } - + intnum_frombv(intn, conv_bv); return intn; } @@ -178,14 +206,7 @@ yasm_intnum_create_hex(char *str) default: break; } - if (Set_Max(conv_bv) < 32) { - intn->type = INTNUM_UL; - intn->val.ul = BitVector_Chunk_Read(conv_bv, 32, 0); - } else { - intn->type = INTNUM_BV; - intn->val.bv = BitVector_Clone(conv_bv); - } - + intnum_frombv(intn, conv_bv); return intn; } @@ -200,29 +221,26 @@ yasm_intnum_create_charconst_nasm(const char *str) yasm_error_set(YASM_ERROR_OVERFLOW, N_("Character constant too large for internal format")); - if (len > 4) { + /* be conservative in choosing bitvect in case MSB is set */ + if (len > 3) { BitVector_Empty(conv_bv); intn->type = INTNUM_BV; } else { - intn->val.ul = 0; - intn->type = INTNUM_UL; + intn->val.l = 0; + intn->type = INTNUM_L; } switch (len) { - case 4: - intn->val.ul |= ((unsigned long)str[3]) & 0xff; - intn->val.ul <<= 8; - /*@fallthrough@*/ case 3: - intn->val.ul |= ((unsigned long)str[2]) & 0xff; - intn->val.ul <<= 8; + intn->val.l |= ((unsigned long)str[2]) & 0xff; + intn->val.l <<= 8; /*@fallthrough@*/ case 2: - intn->val.ul |= ((unsigned long)str[1]) & 0xff; - intn->val.ul <<= 8; + intn->val.l |= ((unsigned long)str[1]) & 0xff; + intn->val.l <<= 8; /*@fallthrough@*/ case 1: - intn->val.ul |= ((unsigned long)str[0]) & 0xff; + intn->val.l |= ((unsigned long)str[0]) & 0xff; case 0: break; default: @@ -244,8 +262,15 @@ yasm_intnum_create_uint(unsigned long i) { yasm_intnum *intn = yasm_xmalloc(sizeof(yasm_intnum)); - intn->val.ul = i; - intn->type = INTNUM_UL; + if (i > LONG_MAX) { + /* Too big, store as bitvector */ + intn->val.bv = BitVector_Create(BITVECT_NATIVE_SIZE, TRUE); + intn->type = INTNUM_BV; + BitVector_Chunk_Store(intn->val.bv, 32, 0, i); + } else { + intn->val.l = (long)i; + intn->type = INTNUM_L; + } return intn; } @@ -253,19 +278,10 @@ yasm_intnum_create_uint(unsigned long i) yasm_intnum * yasm_intnum_create_int(long i) { - yasm_intnum *intn; + yasm_intnum *intn = yasm_xmalloc(sizeof(yasm_intnum)); - /* positive numbers can go through the uint() function */ - if (i >= 0) - return yasm_intnum_create_uint((unsigned long)i); - - BitVector_Empty(conv_bv); - BitVector_Chunk_Store(conv_bv, 32, 0, (unsigned long)(-i)); - BitVector_Negate(conv_bv, conv_bv); - - intn = yasm_xmalloc(sizeof(yasm_intnum)); - intn->val.bv = BitVector_Clone(conv_bv); - intn->type = INTNUM_BV; + intn->val.l = i; + intn->type = INTNUM_L; return intn; } @@ -295,14 +311,7 @@ yasm_intnum_create_leb128(const unsigned char *ptr, int sign, else if (sign && (*ptr & 0x40) == 0x40) BitVector_Interval_Fill(conv_bv, i, BITVECT_NATIVE_SIZE-1); - if (Set_Max(conv_bv) < 32) { - intn->type = INTNUM_UL; - intn->val.ul = BitVector_Chunk_Read(conv_bv, 32, 0); - } else { - intn->type = INTNUM_BV; - intn->val.bv = BitVector_Clone(conv_bv); - } - + intnum_frombv(intn, conv_bv); return intn; } @@ -331,14 +340,7 @@ yasm_intnum_create_sized(unsigned char *ptr, int sign, size_t srcsize, if (srcsize*8 < BITVECT_NATIVE_SIZE && sign && (ptr[i] & 0x80) == 0x80) BitVector_Interval_Fill(conv_bv, i*8, BITVECT_NATIVE_SIZE-1); - if (Set_Max(conv_bv) < 32) { - intn->type = INTNUM_UL; - intn->val.ul = BitVector_Chunk_Read(conv_bv, 32, 0); - } else { - intn->type = INTNUM_BV; - intn->val.bv = BitVector_Clone(conv_bv); - } - + intnum_frombv(intn, conv_bv); return intn; } @@ -348,8 +350,8 @@ yasm_intnum_copy(const yasm_intnum *intn) yasm_intnum *n = yasm_xmalloc(sizeof(yasm_intnum)); switch (intn->type) { - case INTNUM_UL: - n->val.ul = intn->val.ul; + case INTNUM_L: + n->val.l = intn->val.l; break; case INTNUM_BV: n->val.bv = BitVector_Clone(intn->val.bv); @@ -379,23 +381,9 @@ yasm_intnum_calc(yasm_intnum *acc, yasm_expr_op op, yasm_intnum *operand) /* Always do computations with in full bit vector. * Bit vector results must be calculated through intermediate storage. */ - if (acc->type == INTNUM_BV) - op1 = acc->val.bv; - else { - op1 = op1static; - BitVector_Empty(op1); - BitVector_Chunk_Store(op1, 32, 0, acc->val.ul); - } - - if (operand) { - if (operand->type == INTNUM_BV) - op2 = operand->val.bv; - else { - op2 = op2static; - BitVector_Empty(op2); - BitVector_Chunk_Store(op2, 32, 0, operand->val.ul); - } - } + op1 = intnum_tobv(op1static, acc); + if (operand) + op2 = intnum_tobv(op2static, operand); if (!operand && op != YASM_EXPR_NEG && op != YASM_EXPR_NOT && op != YASM_EXPR_LNOT) { @@ -474,17 +462,17 @@ yasm_intnum_calc(yasm_intnum *acc, yasm_expr_op op, yasm_intnum *operand) Set_Complement(result, result); break; case YASM_EXPR_SHL: - if (operand->type == INTNUM_UL) { + if (operand->type == INTNUM_L && operand->val.l > 0) { BitVector_Copy(result, op1); - BitVector_Move_Left(result, (N_int)operand->val.ul); + BitVector_Move_Left(result, (N_int)operand->val.l); } else /* don't even bother, just zero result */ BitVector_Empty(result); break; case YASM_EXPR_SHR: - if (operand->type == INTNUM_UL) { + if (operand->type == INTNUM_L && operand->val.l > 0) { BitVector_Copy(result, op1); carry = BitVector_msb_(op1); - count = (N_int)operand->val.ul; + count = (N_int)operand->val.l; while (count-- > 0) BitVector_shift_right(result, carry); } else /* don't even bother, just zero result */ @@ -567,20 +555,9 @@ yasm_intnum_calc(yasm_intnum *acc, yasm_expr_op op, yasm_intnum *operand) } /* Try to fit the result into 32 bits if possible */ - if (Set_Max(result) < 32) { - if (acc->type == INTNUM_BV) { - BitVector_Destroy(acc->val.bv); - acc->type = INTNUM_UL; - } - acc->val.ul = BitVector_Chunk_Read(result, 32, 0); - } else { - if (acc->type == INTNUM_BV) { - BitVector_Copy(acc->val.bv, result); - } else { - acc->type = INTNUM_BV; - acc->val.bv = BitVector_Clone(result); - } - } + if (acc->type == INTNUM_BV) + BitVector_Destroy(acc->val.bv); + intnum_frombv(acc, result); return 0; } /*@=nullderef =nullpass =branchstate@*/ @@ -588,64 +565,62 @@ yasm_intnum_calc(yasm_intnum *acc, yasm_expr_op op, yasm_intnum *operand) void yasm_intnum_zero(yasm_intnum *intn) { - yasm_intnum_set_uint(intn, 0); + yasm_intnum_set_int(intn, 0); } void yasm_intnum_set_uint(yasm_intnum *intn, unsigned long val) { - if (intn->type == INTNUM_BV) { - BitVector_Destroy(intn->val.bv); - intn->type = INTNUM_UL; + if (val > LONG_MAX) { + if (intn->type != INTNUM_BV) { + intn->val.bv = BitVector_Create(BITVECT_NATIVE_SIZE, TRUE); + intn->type = INTNUM_BV; + } + BitVector_Chunk_Store(intn->val.bv, 32, 0, val); + } else { + if (intn->type == INTNUM_BV) { + BitVector_Destroy(intn->val.bv); + intn->type = INTNUM_L; + } + intn->val.l = (long)val; } - intn->val.ul = val; } void yasm_intnum_set_int(yasm_intnum *intn, long val) { - /* positive numbers can go through the uint() function */ - if (val >= 0) { - yasm_intnum_set_uint(intn, (unsigned long)val); - return; - } - - BitVector_Empty(conv_bv); - BitVector_Chunk_Store(conv_bv, 32, 0, (unsigned long)(-val)); - BitVector_Negate(conv_bv, conv_bv); - if (intn->type == INTNUM_BV) - BitVector_Copy(intn->val.bv, conv_bv); - else { - intn->val.bv = BitVector_Clone(conv_bv); - intn->type = INTNUM_BV; - } + BitVector_Destroy(intn->val.bv); + intn->type = INTNUM_L; + intn->val.l = val; } int yasm_intnum_is_zero(const yasm_intnum *intn) { - return (intn->type == INTNUM_UL && intn->val.ul == 0); + return (intn->type == INTNUM_L && intn->val.l == 0); } int yasm_intnum_is_pos1(const yasm_intnum *intn) { - return (intn->type == INTNUM_UL && intn->val.ul == 1); + return (intn->type == INTNUM_L && intn->val.l == 1); } int yasm_intnum_is_neg1(const yasm_intnum *intn) { - return (intn->type == INTNUM_BV && BitVector_is_full(intn->val.bv)); + return (intn->type == INTNUM_L && intn->val.l == -1); } int yasm_intnum_sign(const yasm_intnum *intn) { - if (intn->type == INTNUM_UL) { - if (intn->val.ul == 0) + if (intn->type == INTNUM_L) { + if (intn->val.l == 0) return 0; + else if (intn->val.l < 0) + return -1; else return 1; } else @@ -656,9 +631,15 @@ unsigned long yasm_intnum_get_uint(const yasm_intnum *intn) { switch (intn->type) { - case INTNUM_UL: - return intn->val.ul; + case INTNUM_L: + if (intn->val.l < 0) + return 0; + return (unsigned long)intn->val.l; case INTNUM_BV: + if (BitVector_msb_(intn->val.bv)) + return 0; + if (Set_Max(intn->val.bv) > 32) + return ULONG_MAX; return BitVector_Chunk_Read(intn->val.bv, 32, 0); default: yasm_internal_error(N_("unknown intnum type")); @@ -671,9 +652,8 @@ long yasm_intnum_get_int(const yasm_intnum *intn) { switch (intn->type) { - case INTNUM_UL: - /* unsigned long values are always positive; max out if needed */ - return (intn->val.ul & 0x80000000) ? LONG_MAX : (long)intn->val.ul; + case INTNUM_L: + return intn->val.l; case INTNUM_BV: if (BitVector_msb_(intn->val.bv)) { /* it's negative: negate the bitvector to get a positive @@ -737,7 +717,12 @@ yasm_intnum_get_sized(const yasm_intnum *intn, unsigned char *ptr, else { op2 = op2static; BitVector_Empty(op2); - BitVector_Chunk_Store(op2, 32, 0, intn->val.ul); + if (intn->val.l < 0) { + BitVector_Chunk_Store(op2, 32, 0, (unsigned long)-intn->val.l); + BitVector_Negate(op2, op2); + } else { + BitVector_Chunk_Store(op2, 32, 0, (unsigned long)intn->val.l); + } } /* Check low bits if right shifting and warnings enabled */ @@ -787,7 +772,12 @@ yasm_intnum_check_size(const yasm_intnum *intn, size_t size, size_t rshift, } else { val = conv_bv; BitVector_Empty(val); - BitVector_Chunk_Store(val, 32, 0, intn->val.ul); + if (intn->val.l < 0) { + BitVector_Chunk_Store(val, 32, 0, (unsigned long)-intn->val.l); + BitVector_Negate(val, val); + } else { + BitVector_Chunk_Store(val, 32, 0, (unsigned long)intn->val.l); + } } if (size >= BITVECT_NATIVE_SIZE) @@ -820,18 +810,10 @@ yasm_intnum_check_size(const yasm_intnum *intn, size_t size, size_t rshift, int yasm_intnum_in_range(const yasm_intnum *intn, long low, long high) { - wordptr val = result; + wordptr val = intnum_tobv(result, intn); wordptr lval = op1static; wordptr hval = op2static; - /* If not already a bitvect, convert value to be written to a bitvect */ - if (intn->type == INTNUM_BV) - val = intn->val.bv; - else { - BitVector_Empty(val); - BitVector_Chunk_Store(val, 32, 0, intn->val.ul); - } - /* Convert high and low to bitvects */ BitVector_Empty(lval); if (low >= 0) @@ -907,21 +889,16 @@ size_leb128(wordptr val, int sign) unsigned long yasm_intnum_get_leb128(const yasm_intnum *intn, unsigned char *ptr, int sign) { - wordptr val = op1static; + wordptr val; /* Shortcut 0 */ - if (intn->type == INTNUM_UL && intn->val.ul == 0) { + if (intn->type == INTNUM_L && intn->val.l == 0) { *ptr = 0; return 1; } /* If not already a bitvect, convert value to be written to a bitvect */ - if (intn->type == INTNUM_BV) - val = intn->val.bv; - else { - BitVector_Empty(val); - BitVector_Chunk_Store(val, 32, 0, intn->val.ul); - } + val = intnum_tobv(op1static, intn); return get_leb128(val, ptr, sign); } @@ -929,20 +906,15 @@ yasm_intnum_get_leb128(const yasm_intnum *intn, unsigned char *ptr, int sign) unsigned long yasm_intnum_size_leb128(const yasm_intnum *intn, int sign) { - wordptr val = op1static; + wordptr val; /* Shortcut 0 */ - if (intn->type == INTNUM_UL && intn->val.ul == 0) { + if (intn->type == INTNUM_L && intn->val.l == 0) { return 1; } /* If not already a bitvect, convert value to a bitvect */ - if (intn->type == INTNUM_BV) - val = intn->val.bv; - else { - BitVector_Empty(val); - BitVector_Chunk_Store(val, 32, 0, intn->val.ul); - } + val = intnum_tobv(op1static, intn); return size_leb128(val, sign); } @@ -1021,9 +993,9 @@ yasm_intnum_get_str(const yasm_intnum *intn) unsigned char *s; switch (intn->type) { - case INTNUM_UL: + case INTNUM_L: s = yasm_xmalloc(16); - sprintf((char *)s, "%lu", intn->val.ul); + sprintf((char *)s, "%ld", intn->val.l); return (char *)s; break; case INTNUM_BV: @@ -1040,8 +1012,8 @@ yasm_intnum_print(const yasm_intnum *intn, FILE *f) unsigned char *s; switch (intn->type) { - case INTNUM_UL: - fprintf(f, "0x%lx", intn->val.ul); + case INTNUM_L: + fprintf(f, "0x%lx", intn->val.l); break; case INTNUM_BV: s = BitVector_to_Hex(intn->val.bv); From 2a61dbc3c5e7a74404a7083458e88b9deffac8c0 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 26 Jul 2007 07:36:05 +0000 Subject: [PATCH 036/585] Use intnum_tobv() in a couple more places. svn path=/trunk/yasm/; revision=1901 --- libyasm/intnum.c | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/libyasm/intnum.c b/libyasm/intnum.c index ef29893f..5fc177b1 100644 --- a/libyasm/intnum.c +++ b/libyasm/intnum.c @@ -712,18 +712,7 @@ yasm_intnum_get_sized(const yasm_intnum *intn, unsigned char *ptr, BitVector_Block_Store(op1, ptr, (N_int)destsize); /* If not already a bitvect, convert value to be written to a bitvect */ - if (intn->type == INTNUM_BV) - op2 = intn->val.bv; - else { - op2 = op2static; - BitVector_Empty(op2); - if (intn->val.l < 0) { - BitVector_Chunk_Store(op2, 32, 0, (unsigned long)-intn->val.l); - BitVector_Negate(op2, op2); - } else { - BitVector_Chunk_Store(op2, 32, 0, (unsigned long)intn->val.l); - } - } + op2 = intnum_tobv(op2static, intn); /* Check low bits if right shifting and warnings enabled */ if (warn && rshift > 0) { @@ -769,16 +758,8 @@ yasm_intnum_check_size(const yasm_intnum *intn, size_t size, size_t rshift, BitVector_Copy(val, intn->val.bv); } else val = intn->val.bv; - } else { - val = conv_bv; - BitVector_Empty(val); - if (intn->val.l < 0) { - BitVector_Chunk_Store(val, 32, 0, (unsigned long)-intn->val.l); - BitVector_Negate(val, val); - } else { - BitVector_Chunk_Store(val, 32, 0, (unsigned long)intn->val.l); - } - } + } else + val = intnum_tobv(conv_bv, intn); if (size >= BITVECT_NATIVE_SIZE) return 1; From 3e1f0390e24ca56099cc66889d99541f0431a201 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 29 Jul 2007 06:11:47 +0000 Subject: [PATCH 037/585] Add command line option aliases for -d (to -D) and -u (to -U) for compatibility with NASM command line. Requested by: Mike Frysinger svn path=/trunk/yasm/; revision=1902 --- frontends/yasm/yasm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontends/yasm/yasm.c b/frontends/yasm/yasm.c index 77571742..acbf6abc 100644 --- a/frontends/yasm/yasm.c +++ b/frontends/yasm/yasm.c @@ -175,8 +175,12 @@ static opt_option options[] = N_("add include path"), N_("path") }, { 'P', NULL, 1, opt_preproc_option, 0, N_("pre-include file"), N_("filename") }, + { 'd', NULL, 1, opt_preproc_option, 1, + N_("pre-define a macro, optionally to value"), N_("macro[=value]") }, { 'D', NULL, 1, opt_preproc_option, 1, N_("pre-define a macro, optionally to value"), N_("macro[=value]") }, + { 'u', NULL, 1, opt_preproc_option, 2, + N_("undefine a macro"), N_("macro") }, { 'U', NULL, 1, opt_preproc_option, 2, N_("undefine a macro"), N_("macro") }, { 'X', NULL, 1, opt_ewmsg_handler, 0, From dfa51bf88822a3e16e6c888cdd3a3a3196905d77 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 31 Jul 2007 04:53:22 +0000 Subject: [PATCH 038/585] 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 --- libyasm/hamt.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libyasm/hamt.c b/libyasm/hamt.c index dd28c544..033a48ac 100644 --- a/libyasm/hamt.c +++ b/libyasm/hamt.c @@ -56,6 +56,7 @@ struct HAMT { const char *message); unsigned long (*HashKey) (const char *key); unsigned long (*ReHashKey) (const char *key, int Level); + int (*CmpKey) (const char *s1, const char *s2); }; /* XXX make a portable version of this. This depends on the pointer being @@ -132,9 +133,11 @@ HAMT_create(int nocase, /*@exits@*/ void (*error_func) if (nocase) { hamt->HashKey = HashKey_nocase; hamt->ReHashKey = ReHashKey_nocase; + hamt->CmpKey = strcasecmp; } else { hamt->HashKey = HashKey; hamt->ReHashKey = ReHashKey; + hamt->CmpKey = strcmp; } return hamt; @@ -244,7 +247,8 @@ HAMT_insert(HAMT *hamt, const char *str, void *data, int *replace, for (;;) { if (!(IsSubTrie(node))) { if (node->BitMapKey == key - && strcmp(((HAMTEntry *)(node->BaseValue))->str, str) == 0) { + && hamt->CmpKey(((HAMTEntry *)(node->BaseValue))->str, + str) == 0) { /*@-branchstate@*/ if (*replace) { deletefunc(((HAMTEntry *)(node->BaseValue))->data); @@ -384,7 +388,9 @@ HAMT_search(HAMT *hamt, const char *str) for (;;) { if (!(IsSubTrie(node))) { - if (node->BitMapKey == key) + if (node->BitMapKey == key + && hamt->CmpKey(((HAMTEntry *)(node->BaseValue))->str, + str) == 0) return ((HAMTEntry *)(node->BaseValue))->data; else return NULL; From 739b155741a1ec7326f2ef92f5b6fc173e593627 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 1 Aug 2007 04:08:04 +0000 Subject: [PATCH 039/585] Fix #111: Correctly #define HAVE__STRICMP for vc and vc8. Reported by: Brian Gladman svn path=/trunk/yasm/; revision=1904 --- Mkfiles/vc/config.h | 2 +- Mkfiles/vc8/config.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Mkfiles/vc/config.h b/Mkfiles/vc/config.h index d217c544..43a580ee 100644 --- a/Mkfiles/vc/config.h +++ b/Mkfiles/vc/config.h @@ -102,7 +102,7 @@ /* #undef HAVE_VSNPRINTF */ /* Define to 1 if you have the `_stricmp' function. */ -#undef HAVE__STRICMP 1 +#define HAVE__STRICMP 1 /* Name of package */ #define PACKAGE "yasm" diff --git a/Mkfiles/vc8/config.h b/Mkfiles/vc8/config.h index 62f2e7ce..759683d0 100644 --- a/Mkfiles/vc8/config.h +++ b/Mkfiles/vc8/config.h @@ -102,7 +102,7 @@ /* #undef HAVE_VSNPRINTF */ /* Define to 1 if you have the `_stricmp' function. */ -#undef HAVE__STRICMP 1 +#define HAVE__STRICMP 1 /* Name of package */ #define PACKAGE "yasm" From d7b386bababb50dd54b649cdcd61324e3472e636 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 1 Aug 2007 05:14:53 +0000 Subject: [PATCH 040/585] 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 svn path=/trunk/yasm/; revision=1905 --- libyasm/hamt.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libyasm/hamt.c b/libyasm/hamt.c index 033a48ac..ceee28f7 100644 --- a/libyasm/hamt.c +++ b/libyasm/hamt.c @@ -281,7 +281,8 @@ HAMT_insert(HAMT *hamt, const char *str, void *data, int *replace, * downward. */ newnodes = yasm_xmalloc(sizeof(HAMTNode)); - newnodes[0] = *node; /* structure copy */ + newnodes[0].BitMapKey = key2; + newnodes[0].BaseValue = node->BaseValue; node->BitMapKey = 1<BaseValue; newnodes[1].BitMapKey = key; SetValue(hamt, &newnodes[1], entry); } else { newnodes[0].BitMapKey = key; SetValue(hamt, &newnodes[0], entry); - newnodes[1] = *node; /* structure copy */ + newnodes[1].BitMapKey = key2; + newnodes[1].BaseValue = node->BaseValue; } /* Set bits in bitmap corresponding to keys */ From 49a1a9681373738331843329a6042311fc3dcb1e Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 2 Aug 2007 02:55:13 +0000 Subject: [PATCH 041/585] Fix typo in VC7 modules.vcproj. Reported by: Stefan Sellmer svn path=/trunk/yasm/; revision=1906 --- Mkfiles/vc/modules/modules.vcproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mkfiles/vc/modules/modules.vcproj b/Mkfiles/vc/modules/modules.vcproj index fee60184..3879cd1a 100644 --- a/Mkfiles/vc/modules/modules.vcproj +++ b/Mkfiles/vc/modules/modules.vcproj @@ -47,7 +47,7 @@ Date: Sun, 5 Aug 2007 16:44:07 +0000 Subject: [PATCH 042/585] Fix #112: Use yasm__strcasecmp instead of strcasecmp. svn path=/trunk/yasm/; revision=1907 --- libyasm/hamt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libyasm/hamt.c b/libyasm/hamt.c index ceee28f7..33ab83bb 100644 --- a/libyasm/hamt.c +++ b/libyasm/hamt.c @@ -133,7 +133,7 @@ HAMT_create(int nocase, /*@exits@*/ void (*error_func) if (nocase) { hamt->HashKey = HashKey_nocase; hamt->ReHashKey = ReHashKey_nocase; - hamt->CmpKey = strcasecmp; + hamt->CmpKey = yasm__strcasecmp; } else { hamt->HashKey = HashKey; hamt->ReHashKey = ReHashKey; From 589c25b4514af60703bae2f53686fde1c43dfe8f Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 10 Aug 2007 16:56:13 +0000 Subject: [PATCH 043/585] Update yasm.rules so that it's compatible with the Intel compiler. Contributed by: Brian Gladman svn path=/trunk/yasm/; revision=1908 --- Mkfiles/vc8/yasm.rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mkfiles/vc8/yasm.rules b/Mkfiles/vc8/yasm.rules index 3001425e..f2e2eccc 100644 --- a/Mkfiles/vc8/yasm.rules +++ b/Mkfiles/vc8/yasm.rules @@ -7,7 +7,7 @@ Date: Thu, 16 Aug 2007 05:50:59 +0000 Subject: [PATCH 044/585] 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 --- modules/arch/x86/tests/Makefile.inc | 2 + modules/arch/x86/tests/amd200707.asm | 31 ++++ modules/arch/x86/tests/amd200707.hex | 212 +++++++++++++++++++++++++++ modules/arch/x86/x86arch.h | 6 +- modules/arch/x86/x86bc.c | 65 ++++---- modules/arch/x86/x86id.c | 123 +++++++++++----- modules/arch/x86/x86parse.gap | 8 +- 7 files changed, 367 insertions(+), 80 deletions(-) create mode 100644 modules/arch/x86/tests/amd200707.asm create mode 100644 modules/arch/x86/tests/amd200707.hex diff --git a/modules/arch/x86/tests/Makefile.inc b/modules/arch/x86/tests/Makefile.inc index ad735995..3fc08dab 100644 --- a/modules/arch/x86/tests/Makefile.inc +++ b/modules/arch/x86/tests/Makefile.inc @@ -11,6 +11,8 @@ EXTRA_DIST += modules/arch/x86/tests/addrop.errwarn EXTRA_DIST += modules/arch/x86/tests/addrop.hex EXTRA_DIST += modules/arch/x86/tests/addrop-err.asm EXTRA_DIST += modules/arch/x86/tests/addrop-err.errwarn +EXTRA_DIST += modules/arch/x86/tests/amd200707.asm +EXTRA_DIST += modules/arch/x86/tests/amd200707.hex EXTRA_DIST += modules/arch/x86/tests/arithsmall.asm EXTRA_DIST += modules/arch/x86/tests/arithsmall.errwarn EXTRA_DIST += modules/arch/x86/tests/arithsmall.hex diff --git a/modules/arch/x86/tests/amd200707.asm b/modules/arch/x86/tests/amd200707.asm new file mode 100644 index 00000000..42c26a3c --- /dev/null +++ b/modules/arch/x86/tests/amd200707.asm @@ -0,0 +1,31 @@ +bits 64 +extrq xmm0, 5, 4 +extrq xmm6, 0, 7 +extrq xmm2, xmm3 +insertq xmm0, xmm1, 5, 4 +insertq xmm5, xmm6, 0, 7 +insertq xmm2, xmm3 +movntsd [0], xmm1 +movntsd qword [0], xmm5 +movntss [0], xmm3 +movntss dword [0], xmm7 + +lzcnt ax, bx +lzcnt cx, word [0] +lzcnt dx, [0] +lzcnt eax, ebx +lzcnt ecx, dword [0] +lzcnt edx, [0] +lzcnt rax, rbx +lzcnt rcx, qword [0] +lzcnt rdx, [0] + +popcnt ax, bx +popcnt cx, word [0] +popcnt dx, [0] +popcnt eax, ebx +popcnt ecx, dword [0] +popcnt edx, [0] +popcnt rax, rbx +popcnt rcx, qword [0] +popcnt rdx, [0] diff --git a/modules/arch/x86/tests/amd200707.hex b/modules/arch/x86/tests/amd200707.hex new file mode 100644 index 00000000..28b58a12 --- /dev/null +++ b/modules/arch/x86/tests/amd200707.hex @@ -0,0 +1,212 @@ +66 +0f +78 +c0 +05 +04 +66 +0f +78 +c6 +00 +07 +66 +0f +79 +d3 +f2 +0f +78 +c1 +05 +04 +f2 +0f +78 +ee +00 +07 +f2 +0f +79 +d3 +f2 +0f +2b +0c +25 +00 +00 +00 +00 +f2 +0f +2b +2c +25 +00 +00 +00 +00 +f3 +0f +2b +1c +25 +00 +00 +00 +00 +f3 +0f +2b +3c +25 +00 +00 +00 +00 +66 +f3 +0f +bd +c3 +66 +f3 +0f +bd +0c +25 +00 +00 +00 +00 +66 +f3 +0f +bd +14 +25 +00 +00 +00 +00 +f3 +0f +bd +c3 +f3 +0f +bd +0c +25 +00 +00 +00 +00 +f3 +0f +bd +14 +25 +00 +00 +00 +00 +f3 +48 +0f +bd +c3 +f3 +48 +0f +bd +0c +25 +00 +00 +00 +00 +f3 +48 +0f +bd +14 +25 +00 +00 +00 +00 +66 +f3 +0f +b8 +c3 +66 +f3 +0f +b8 +0c +25 +00 +00 +00 +00 +66 +f3 +0f +b8 +14 +25 +00 +00 +00 +00 +f3 +0f +b8 +c3 +f3 +0f +b8 +0c +25 +00 +00 +00 +00 +f3 +0f +b8 +14 +25 +00 +00 +00 +00 +f3 +48 +0f +b8 +c3 +f3 +48 +0f +b8 +0c +25 +00 +00 +00 +00 +f3 +48 +0f +b8 +14 +25 +00 +00 +00 +00 diff --git a/modules/arch/x86/x86arch.h b/modules/arch/x86/x86arch.h index 6d2fa050..cbe26f48 100644 --- a/modules/arch/x86/x86arch.h +++ b/modules/arch/x86/x86arch.h @@ -163,10 +163,10 @@ void yasm_x86__ea_init(x86_effaddr *x86_ea, unsigned int spare, yasm_bytecode *precbc); void yasm_x86__ea_set_disponly(x86_effaddr *x86_ea); -x86_effaddr *yasm_x86__ea_create_reg(unsigned long reg, unsigned char *rex, - unsigned int bits); +x86_effaddr *yasm_x86__ea_create_reg(x86_effaddr *x86_ea, unsigned long reg, + unsigned char *rex, unsigned int bits); x86_effaddr *yasm_x86__ea_create_imm - (/*@keep@*/ yasm_expr *imm, unsigned int im_len); + (x86_effaddr *x86_ea, /*@keep@*/ yasm_expr *imm, unsigned int im_len); yasm_effaddr *yasm_x86__ea_create_expr(yasm_arch *arch, /*@keep@*/ yasm_expr *e); void yasm_x86__ea_destroy(yasm_effaddr *ea); diff --git a/modules/arch/x86/x86bc.c b/modules/arch/x86/x86bc.c index 6dd31110..e574f935 100644 --- a/modules/arch/x86/x86bc.c +++ b/modules/arch/x86/x86bc.c @@ -172,17 +172,10 @@ yasm_x86__ea_set_disponly(x86_effaddr *x86_ea) x86_ea->need_sib = 0; } -x86_effaddr * -yasm_x86__ea_create_reg(unsigned long reg, unsigned char *rex, - unsigned int bits) +static x86_effaddr * +ea_create(void) { - x86_effaddr *x86_ea; - unsigned char rm; - - if (yasm_x86__set_rex_from_reg(rex, &rm, reg, bits, X86_REX_B)) - return NULL; - - x86_ea = yasm_xmalloc(sizeof(x86_effaddr)); + x86_effaddr *x86_ea = yasm_xmalloc(sizeof(x86_effaddr)); yasm_value_initialize(&x86_ea->ea.disp, NULL, 0); x86_ea->ea.need_nonzero_len = 0; @@ -190,9 +183,9 @@ yasm_x86__ea_create_reg(unsigned long reg, unsigned char *rex, x86_ea->ea.nosplit = 0; x86_ea->ea.strong = 0; x86_ea->ea.segreg = 0; - x86_ea->modrm = 0xC0 | rm; /* Mod=11, R/M=Reg, Reg=0 */ - x86_ea->valid_modrm = 1; - x86_ea->need_modrm = 1; + x86_ea->modrm = 0; + x86_ea->valid_modrm = 0; + x86_ea->need_modrm = 0; x86_ea->sib = 0; x86_ea->valid_sib = 0; x86_ea->need_sib = 0; @@ -200,13 +193,31 @@ yasm_x86__ea_create_reg(unsigned long reg, unsigned char *rex, return x86_ea; } +x86_effaddr * +yasm_x86__ea_create_reg(x86_effaddr *x86_ea, unsigned long reg, + unsigned char *rex, unsigned int bits) +{ + unsigned char rm; + + if (yasm_x86__set_rex_from_reg(rex, &rm, reg, bits, X86_REX_B)) + return NULL; + + if (!x86_ea) + x86_ea = ea_create(); + x86_ea->modrm = 0xC0 | rm; /* Mod=11, R/M=Reg, Reg=0 */ + x86_ea->valid_modrm = 1; + x86_ea->need_modrm = 1; + + return x86_ea; +} + yasm_effaddr * yasm_x86__ea_create_expr(yasm_arch *arch, yasm_expr *e) { yasm_arch_x86 *arch_x86 = (yasm_arch_x86 *)arch; x86_effaddr *x86_ea; - x86_ea = yasm_xmalloc(sizeof(x86_effaddr)); + x86_ea = ea_create(); if (arch_x86->parser == X86_PARSER_GAS) { /* Need to change foo+rip into foo wrt rip. @@ -224,16 +235,8 @@ yasm_x86__ea_create_expr(yasm_arch *arch, yasm_expr *e) } } yasm_value_initialize(&x86_ea->ea.disp, e, 0); - x86_ea->ea.need_nonzero_len = 0; x86_ea->ea.need_disp = 1; - x86_ea->ea.nosplit = 0; - x86_ea->ea.strong = 0; - x86_ea->ea.segreg = 0; - x86_ea->modrm = 0; - x86_ea->valid_modrm = 0; x86_ea->need_modrm = 1; - x86_ea->sib = 0; - x86_ea->valid_sib = 0; /* We won't know whether we need an SIB until we know more about expr and * the BITS/address override setting. */ @@ -244,23 +247,13 @@ yasm_x86__ea_create_expr(yasm_arch *arch, yasm_expr *e) /*@-compmempass@*/ x86_effaddr * -yasm_x86__ea_create_imm(yasm_expr *imm, unsigned int im_len) +yasm_x86__ea_create_imm(x86_effaddr *x86_ea, yasm_expr *imm, + unsigned int im_len) { - x86_effaddr *x86_ea; - - x86_ea = yasm_xmalloc(sizeof(x86_effaddr)); - + if (!x86_ea) + x86_ea = ea_create(); yasm_value_initialize(&x86_ea->ea.disp, imm, im_len); x86_ea->ea.need_disp = 1; - x86_ea->ea.nosplit = 0; - x86_ea->ea.strong = 0; - x86_ea->ea.segreg = 0; - x86_ea->modrm = 0; - x86_ea->valid_modrm = 0; - x86_ea->need_modrm = 0; - x86_ea->sib = 0; - x86_ea->valid_sib = 0; - x86_ea->need_sib = 0; return x86_ea; } diff --git a/modules/arch/x86/x86id.c b/modules/arch/x86/x86id.c index 278cb2df..807e9d45 100644 --- a/modules/arch/x86/x86id.c +++ b/modules/arch/x86/x86id.c @@ -2210,15 +2210,43 @@ static const x86_insn_info sse4m16_insn[] = { {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} } }; -static const x86_insn_info popcnt_insn[] = { - { CPU_SSE42, MOD_GasSufW, 16, 0, 0xF3, 2, {0x0F, 0xB8, 0}, 0, 2, +static const x86_insn_info cnt_insn[] = { + { CPU_SSE42, MOD_Op1Add|MOD_GasSufW, 16, 0, 0xF3, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_Reg|OPS_16|OPA_Spare, OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, 0} }, - { CPU_SSE42, MOD_GasSufL, 32, 0, 0xF3, 2, {0x0F, 0xB8, 0}, 0, 2, + { CPU_SSE42, MOD_Op1Add|MOD_GasSufL, 32, 0, 0xF3, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} }, - { CPU_SSE42|CPU_64, MOD_GasSufQ, 64, 0, 0xF3, 2, {0x0F, 0xB8, 0}, 0, 2, + { CPU_SSE42|CPU_64, MOD_Op1Add|MOD_GasSufQ, 64, 0, 0xF3, 2, + {0x0F, 0x00, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} } }; +static const x86_insn_info extrq_insn[] = { + { CPU_SSE41, 0, 0, 0, 0x66, 2, {0x0F, 0x78, 0}, 0, 3, + {OPT_SIMDReg|OPS_128|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_EA, + OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, + { CPU_SSE41, 0, 0, 0, 0x66, 2, {0x0F, 0x79, 0}, 0, 2, + {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} } +}; + +static const unsigned long insertq_4operands[] = + {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, + OPT_Imm|OPS_8|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm}; +static const x86_insn_info insertq_insn[] = { + { CPU_SSE41, 0, 0, 0, 0xF2, 2, {0x0F, 0x78, 0}, 0, 4, {0, 0, 0} }, + { CPU_SSE41, 0, 0, 0, 0xF2, 2, {0x0F, 0x79, 0}, 0, 2, + {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} } +}; + +static const x86_insn_info movntsd_insn[] = { + { CPU_SSE41, 0, 0, 0, 0xF2, 2, {0x0F, 0x2B, 0}, 0, 2, + {OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} } +}; + +static const x86_insn_info movntss_insn[] = { + { CPU_SSE41, 0, 0, 0, 0xF3, 2, {0x0F, 0x2B, 0}, 0, 2, + {OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} } +}; + /* AMD 3DNow! instructions */ static const x86_insn_info now3d_insn[] = { { CPU_3DNow, MOD_Imm8, 0, 0, 0, 2, {0x0F, 0x0F, 0}, 0, 2, @@ -2525,6 +2553,7 @@ x86_find_match(x86_id_insn *id_insn, yasm_insn_operand **ops, */ for (; num_info>0 && !found; num_info--, info++) { yasm_insn_operand *op, **use_ops; + const unsigned long *info_ops = info->operands; unsigned long icpu; unsigned int size; int mismatch = 0; @@ -2570,11 +2599,15 @@ x86_find_match(x86_id_insn *id_insn, yasm_insn_operand **ops, break; } + /* 4-operand special case for insertq */ + if (info->num_operands > 3) + info_ops = insertq_4operands; + /* Match each operand type and size */ for (i = 0, op = use_ops[0]; op && inum_operands && !mismatch; op = use_ops[++i]) { /* Check operand type */ - switch ((int)(info->operands[i] & OPT_MASK)) { + switch ((int)(info_ops[i] & OPT_MASK)) { case OPT_Imm: if (op->type != YASM_INSN__OPERAND_IMM) mismatch = 1; @@ -2649,40 +2682,40 @@ x86_find_match(x86_id_insn *id_insn, yasm_insn_operand **ops, break; case OPT_Areg: if (op->type != YASM_INSN__OPERAND_REG || - ((info->operands[i] & OPS_MASK) == OPS_8 && + ((info_ops[i] & OPS_MASK) == OPS_8 && op->data.reg != (X86_REG8 | 0) && op->data.reg != (X86_REG8X | 0)) || - ((info->operands[i] & OPS_MASK) == OPS_16 && + ((info_ops[i] & OPS_MASK) == OPS_16 && op->data.reg != (X86_REG16 | 0)) || - ((info->operands[i] & OPS_MASK) == OPS_32 && + ((info_ops[i] & OPS_MASK) == OPS_32 && op->data.reg != (X86_REG32 | 0)) || - ((info->operands[i] & OPS_MASK) == OPS_64 && + ((info_ops[i] & OPS_MASK) == OPS_64 && op->data.reg != (X86_REG64 | 0))) mismatch = 1; break; case OPT_Creg: if (op->type != YASM_INSN__OPERAND_REG || - ((info->operands[i] & OPS_MASK) == OPS_8 && + ((info_ops[i] & OPS_MASK) == OPS_8 && op->data.reg != (X86_REG8 | 1) && op->data.reg != (X86_REG8X | 1)) || - ((info->operands[i] & OPS_MASK) == OPS_16 && + ((info_ops[i] & OPS_MASK) == OPS_16 && op->data.reg != (X86_REG16 | 1)) || - ((info->operands[i] & OPS_MASK) == OPS_32 && + ((info_ops[i] & OPS_MASK) == OPS_32 && op->data.reg != (X86_REG32 | 1)) || - ((info->operands[i] & OPS_MASK) == OPS_64 && + ((info_ops[i] & OPS_MASK) == OPS_64 && op->data.reg != (X86_REG64 | 1))) mismatch = 1; break; case OPT_Dreg: if (op->type != YASM_INSN__OPERAND_REG || - ((info->operands[i] & OPS_MASK) == OPS_8 && + ((info_ops[i] & OPS_MASK) == OPS_8 && op->data.reg != (X86_REG8 | 2) && op->data.reg != (X86_REG8X | 2)) || - ((info->operands[i] & OPS_MASK) == OPS_16 && + ((info_ops[i] & OPS_MASK) == OPS_16 && op->data.reg != (X86_REG16 | 2)) || - ((info->operands[i] & OPS_MASK) == OPS_32 && + ((info_ops[i] & OPS_MASK) == OPS_32 && op->data.reg != (X86_REG32 | 2)) || - ((info->operands[i] & OPS_MASK) == OPS_64 && + ((info_ops[i] & OPS_MASK) == OPS_64 && op->data.reg != (X86_REG64 | 2))) mismatch = 1; break; @@ -2773,7 +2806,7 @@ x86_find_match(x86_id_insn *id_insn, yasm_insn_operand **ops, break; /* Check operand size */ - size = size_lookup[(info->operands[i] & OPS_MASK)>>OPS_SHIFT]; + size = size_lookup[(info_ops[i] & OPS_MASK)>>OPS_SHIFT]; if (suffix != 0) { /* Require relaxed operands for GAS mode (don't allow * per-operand sizing). @@ -2782,11 +2815,11 @@ x86_find_match(x86_id_insn *id_insn, yasm_insn_operand **ops, /* Register size must exactly match */ if (yasm_x86__get_reg_size(op->data.reg) != size) mismatch = 1; - } else if (((info->operands[i] & OPT_MASK) == OPT_Imm - || (info->operands[i] & OPT_MASK) == OPT_ImmNotSegOff - || (info->operands[i] & OPT_MASK) == OPT_Imm1) - && (info->operands[i] & OPS_RMASK) != OPS_Relaxed - && (info->operands[i] & OPA_MASK) != OPA_JmpRel) + } else if (((info_ops[i] & OPT_MASK) == OPT_Imm + || (info_ops[i] & OPT_MASK) == OPT_ImmNotSegOff + || (info_ops[i] & OPT_MASK) == OPT_Imm1) + && (info_ops[i] & OPS_RMASK) != OPS_Relaxed + && (info_ops[i] & OPA_MASK) != OPA_JmpRel) mismatch = 1; } else { if (op->type == YASM_INSN__OPERAND_REG && op->size == 0) { @@ -2800,7 +2833,7 @@ x86_find_match(x86_id_insn *id_insn, yasm_insn_operand **ops, if ((bypass == 1 && i == 0) || (bypass == 2 && i == 1) || (bypass == 3 && i == 3)) ; - else if ((info->operands[i] & OPS_RMASK) == OPS_Relaxed) { + else if ((info_ops[i] & OPS_RMASK) == OPS_Relaxed) { /* Relaxed checking */ if (size != 0 && op->size != size && op->size != 0) mismatch = 1; @@ -2817,7 +2850,7 @@ x86_find_match(x86_id_insn *id_insn, yasm_insn_operand **ops, /* Check for 64-bit effective address size in NASM mode */ if (suffix == 0 && op->type == YASM_INSN__OPERAND_MEMORY) { - if ((info->operands[i] & OPEAS_MASK) == OPEAS_64) { + if ((info_ops[i] & OPEAS_MASK) == OPEAS_64) { if (op->data.ea->disp.size != 64) mismatch = 1; } else if (op->data.ea->disp.size == 64) @@ -2828,7 +2861,7 @@ x86_find_match(x86_id_insn *id_insn, yasm_insn_operand **ops, break; /* Check target modifier */ - switch ((int)(info->operands[i] & OPTM_MASK)) { + switch ((int)(info_ops[i] & OPTM_MASK)) { case OPTM_None: if (op->targetmod != 0) mismatch = 1; @@ -2944,7 +2977,9 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) /* Build local array of operands from list, since we know we have a max * of 3 operands. */ - if (id_insn->insn.num_operands > 3) { + if (id_insn->insn.num_operands == 4 && info == insertq_insn) + ; + else if (id_insn->insn.num_operands > 3) { yasm_error_set(YASM_ERROR_TYPE, N_("too many operands")); return; } @@ -3085,15 +3120,20 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) /* Go through operands and assign */ if (id_insn->insn.num_operands > 0) { yasm_insn_operand **use_ops = ops; + const unsigned long *info_ops = info->operands; /* Use reversed operands in GAS mode if not otherwise specified */ if (id_insn->parser == X86_PARSER_GAS && !(info->modifiers & MOD_GasNoRev)) use_ops = rev_ops; + /* 4-operand special case for insertq */ + if (info->num_operands > 3) + info_ops = insertq_4operands; + for (i = 0, op = use_ops[0]; op && inum_operands; op = use_ops[++i]) { - switch ((int)(info->operands[i] & OPA_MASK)) { + switch ((int)(info_ops[i] & OPA_MASK)) { case OPA_None: /* Throw away the operand contents */ switch (op->type) { @@ -3111,23 +3151,25 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) case OPA_EA: switch (op->type) { case YASM_INSN__OPERAND_REG: - insn->x86_ea = yasm_x86__ea_create_reg( - (unsigned long)op->data.reg, &insn->rex, - mode_bits); + insn->x86_ea = + yasm_x86__ea_create_reg(insn->x86_ea, + (unsigned long)op->data.reg, &insn->rex, + mode_bits); break; case YASM_INSN__OPERAND_SEGREG: yasm_internal_error( N_("invalid operand conversion")); case YASM_INSN__OPERAND_MEMORY: insn->x86_ea = (x86_effaddr *)op->data.ea; - if ((info->operands[i] & OPT_MASK) == OPT_MemOffs) + if ((info_ops[i] & OPT_MASK) == OPT_MemOffs) /* Special-case for MOV MemOffs instruction */ yasm_x86__ea_set_disponly(insn->x86_ea); break; case YASM_INSN__OPERAND_IMM: insn->x86_ea = - yasm_x86__ea_create_imm(op->data.val, - size_lookup[(info->operands[i] & + yasm_x86__ea_create_imm(insn->x86_ea, + op->data.val, + size_lookup[(info_ops[i] & OPS_MASK)>>OPS_SHIFT]); break; } @@ -3135,7 +3177,7 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) case OPA_Imm: if (op->type == YASM_INSN__OPERAND_IMM) { imm = op->data.val; - im_len = size_lookup[(info->operands[i] & + im_len = size_lookup[(info_ops[i] & OPS_MASK)>>OPS_SHIFT]; } else yasm_internal_error(N_("invalid operand conversion")); @@ -3143,7 +3185,7 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) case OPA_SImm: if (op->type == YASM_INSN__OPERAND_IMM) { imm = op->data.val; - im_len = size_lookup[(info->operands[i] & + im_len = size_lookup[(info_ops[i] & OPS_MASK)>>OPS_SHIFT]; im_sign = 1; } else @@ -3182,7 +3224,8 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) case OPA_SpareEA: if (op->type == YASM_INSN__OPERAND_REG) { insn->x86_ea = - yasm_x86__ea_create_reg((unsigned long)op->data.reg, + yasm_x86__ea_create_reg(insn->x86_ea, + (unsigned long)op->data.reg, &insn->rex, mode_bits); if (!insn->x86_ea || yasm_x86__set_rex_from_reg(&insn->rex, &spare, @@ -3223,10 +3266,10 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) yasm_internal_error(N_("unknown operand action")); } - if ((info->operands[i] & OPS_MASK) == OPS_BITS) + if ((info_ops[i] & OPS_MASK) == OPS_BITS) insn->common.opersize = (unsigned char)mode_bits; - switch ((int)(info->operands[i] & OPAP_MASK)) { + switch ((int)(info_ops[i] & OPAP_MASK)) { case OPAP_None: break; case OPAP_SImm8: @@ -3326,7 +3369,7 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) /* Build ModRM EA - CAUTION: this depends on * opcode 0 being a mov instruction! */ - insn->x86_ea = yasm_x86__ea_create_reg( + insn->x86_ea = yasm_x86__ea_create_reg(insn->x86_ea, (unsigned long)insn->opcode.opcode[0]-0xB8, &rex_temp, 64); /* Make the imm32s form permanent. */ diff --git a/modules/arch/x86/x86parse.gap b/modules/arch/x86/x86parse.gap index c9d71411..b06a930d 100644 --- a/modules/arch/x86/x86parse.gap +++ b/modules/arch/x86/x86parse.gap @@ -809,12 +809,17 @@ INSN - pmovzxwq NONE sse4m32 0x34 CPU_SSE41 INSN - pmovzxdq NONE sse4m64 0x35 CPU_SSE41 INSN - pmuldq NONE sse4 0x28 CPU_SSE41 INSN - pmulld NONE sse4 0x40 CPU_SSE41 -INSN - popcnt "wlq" popcnt 0 CPU_SSE42 +INSN - popcnt "wlq" cnt 0xB8 CPU_SSE42 INSN - ptest NONE sse4 0x17 CPU_SSE41 INSN - roundpd NONE sse4imm 0x09 CPU_SSE41 INSN - roundps NONE sse4imm 0x08 CPU_SSE41 INSN - roundsd NONE sse4imm 0x0B CPU_SSE41 INSN - roundss NONE sse4imm 0x0A CPU_SSE41 +# AMD SSE4.1 instructions +INSN - extrq NONE extrq 0 CPU_SSE41 +INSN - insertq NONE insertq 0 CPU_SSE41 +INSN - movntsd NONE movntsd 0 CPU_SSE41 +INSN - movntss NONE movntss 0 CPU_SSE41 # AMD 3DNow! instructions INSN - prefetch NONE twobytemem 0x000F0D CPU_3DNow INSN - prefetchw NONE twobytemem 0x010F0D CPU_3DNow @@ -846,6 +851,7 @@ INSN - pswapd NONE now3d 0xBB CPU_Athlon|CPU_3DNow # AMD extensions INSN - syscall NONE twobyte 0x0F05 CPU_686|CPU_AMD INSN - sysret "lq" twobyte 0x0F07 CPU_686|CPU_AMD|CPU_Priv +INSN - lzcnt "wlq" cnt 0xBD CPU_686|CPU_AMD # AMD x86-64 extensions INSN - swapgs NONE threebyte 0x0F01F8 CPU_Hammer|CPU_64 INSN - rdtscp NONE threebyte 0x0F01F9 CPU_686|CPU_AMD|CPU_Priv From 4b142ea112dbf076060c12fb79610d9a1f79d599 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 19 Aug 2007 23:59:08 +0000 Subject: [PATCH 045/585] GAS parser: Push down directive lookup to parser to simplify tokenizer. svn path=/trunk/yasm/; revision=1910 --- modules/parsers/gas/gas-parse.c | 1099 ++++++++++++++++-------------- modules/parsers/gas/gas-parser.h | 41 +- modules/parsers/gas/gas-token.re | 145 ---- 3 files changed, 611 insertions(+), 674 deletions(-) diff --git a/modules/parsers/gas/gas-parse.c b/modules/parsers/gas/gas-parse.c index f45b35f8..ef64c162 100644 --- a/modules/parsers/gas/gas-parse.c +++ b/modules/parsers/gas/gas-parse.c @@ -37,7 +37,13 @@ RCSID("$Id$"); #include "modules/parsers/gas/gas-parser.h" -static yasm_bytecode *parse_line(yasm_parser_gas *parser_gas); +typedef struct dir_lookup { + const char *name; + yasm_bytecode * (*handler) (yasm_parser_gas *, unsigned int); + unsigned int param; + enum gas_parser_state newstate; +} dir_lookup; + static yasm_bytecode *parse_instr(yasm_parser_gas *parser_gas); static int parse_dirvals(yasm_parser_gas *parser_gas, yasm_valparamhead *vps); static int parse_datavals(yasm_parser_gas *parser_gas, yasm_datavalhead *dvs); @@ -57,9 +63,9 @@ static yasm_section *gas_get_section /*@null@*/ char *type, /*@null@*/ yasm_valparamhead *objext_valparams, int builtin); static void gas_switch_section - (yasm_parser_gas *parser_gas, /*@only@*/ char *name, /*@null@*/ char *flags, - /*@null@*/ char *type, /*@null@*/ yasm_valparamhead *objext_valparams, - int builtin); + (yasm_parser_gas *parser_gas, /*@only@*/ const char *name, + /*@null@*/ char *flags, /*@null@*/ char *type, + /*@null@*/ yasm_valparamhead *objext_valparams, int builtin); static yasm_bytecode *gas_parser_align (yasm_parser_gas *parser_gas, yasm_section *sect, yasm_expr *boundval, /*@null@*/ yasm_expr *fillval, /*@null@*/ yasm_expr *maxskipval, @@ -68,12 +74,6 @@ static yasm_bytecode *gas_parser_dir_fill (yasm_parser_gas *parser_gas, /*@only@*/ yasm_expr *repeat, /*@only@*/ /*@null@*/ yasm_expr *size, /*@only@*/ /*@null@*/ yasm_expr *value); -#if 0 -static void gas_parser_directive - (yasm_parser_gas *parser_gas, const char *name, - yasm_valparamhead *valparams, - /*@null@*/ yasm_valparamhead *objext_valparams); -#endif #define is_eol_tok(tok) ((tok) == '\n' || (tok) == ';' || (tok) == 0) #define is_eol() is_eol_tok(curtok) @@ -164,27 +164,6 @@ expect_(yasm_parser_gas *parser_gas, int token) case RIGHT_OP: str = ">>"; break; case ID: str = "identifier"; break; case LABEL: str = "label"; break; - case LINE: - case DIR_ALIGN: - case DIR_ASCII: - case DIR_COMM: - case DIR_DATA: - case DIR_ENDR: - case DIR_EQU: - case DIR_FILE: - case DIR_FILL: - case DIR_LEB128: - case DIR_LINE: - case DIR_LOCAL: - case DIR_LCOMM: - case DIR_ORG: - case DIR_REPT: - case DIR_SECTION: - case DIR_SECTNAME: - case DIR_SKIP: - case DIR_ZERO: - str = "directive"; - break; default: strch[1] = token; str = strch; @@ -196,44 +175,14 @@ expect_(yasm_parser_gas *parser_gas, int token) } #define expect(token) expect_(parser_gas, token) -void -gas_parser_parse(yasm_parser_gas *parser_gas) -{ - while (get_next_token() != 0) { - yasm_bytecode *bc = NULL, *temp_bc; - - if (!is_eol()) { - bc = parse_line(parser_gas); - demand_eol(); - } - - yasm_errwarn_propagate(parser_gas->errwarns, cur_line); - - temp_bc = yasm_section_bcs_append(cursect, bc); - if (temp_bc) - parser_gas->prev_bc = temp_bc; - if (curtok == ';') - continue; /* don't advance line number until \n */ - if (parser_gas->save_input) - yasm_linemap_add_source(parser_gas->linemap, - temp_bc, - (char *)parser_gas->save_line[parser_gas->save_last ^ 1]); - yasm_linemap_goto_next(parser_gas->linemap); - parser_gas->dir_line++; /* keep track for .line followed by .file */ - } -} - static yasm_bytecode * parse_line(yasm_parser_gas *parser_gas) { yasm_bytecode *bc; yasm_expr *e; - yasm_intnum *intn; - yasm_datavalhead dvs; yasm_valparamhead vps; - yasm_valparam *vp; - unsigned int ival; char *id; + const dir_lookup *dir; if (is_eol()) return NULL; @@ -245,6 +194,15 @@ parse_line(yasm_parser_gas *parser_gas) switch (curtok) { case ID: id = ID_val; + + /* See if it's a gas-specific directive */ + dir = (const dir_lookup *)HAMT_search(parser_gas->dirs, id); + if (dir) { + parser_gas->state = dir->newstate; + get_next_token(); /* ID */ + return dir->handler(parser_gas, dir->param); + } + parser_gas->state = INSTDIR; get_next_token(); /* ID */ if (curtok == ':') { @@ -289,420 +247,6 @@ parse_line(yasm_parser_gas *parser_gas) define_label(parser_gas, LABEL_val, 0); get_next_token(); /* LABEL */ return parse_line(parser_gas); - - /* Line directive */ - case DIR_LINE: - get_next_token(); /* DIR_LINE */ - - if (!expect(INTNUM)) return NULL; - if (yasm_intnum_sign(INTNUM_val) < 0) { - get_next_token(); /* INTNUM */ - yasm_error_set(YASM_ERROR_SYNTAX, - N_("line number is negative")); - return NULL; - } - - parser_gas->dir_line = yasm_intnum_get_uint(INTNUM_val); - yasm_intnum_destroy(INTNUM_val); - get_next_token(); /* INTNUM */ - - if (parser_gas->dir_fileline == 3) { - /* Have both file and line */ - yasm_linemap_set(parser_gas->linemap, NULL, - parser_gas->dir_line, 1); - } else if (parser_gas->dir_fileline == 1) { - /* Had previous file directive only */ - parser_gas->dir_fileline = 3; - yasm_linemap_set(parser_gas->linemap, parser_gas->dir_file, - parser_gas->dir_line, 1); - } else { - /* Didn't see file yet */ - parser_gas->dir_fileline = 2; - } - return NULL; - - /* Macro directives */ - case DIR_REPT: - get_next_token(); /* DIR_REPT */ - e = parse_expr(parser_gas); - if (!e) { - yasm_error_set(YASM_ERROR_SYNTAX, - N_("expression expected after `%s'"), - ".rept"); - return NULL; - } - intn = yasm_expr_get_intnum(&e, 0); - - if (!intn) { - yasm_error_set(YASM_ERROR_NOT_ABSOLUTE, - N_("rept expression not absolute")); - } else if (yasm_intnum_sign(intn) < 0) { - yasm_error_set(YASM_ERROR_VALUE, - N_("rept expression is negative")); - } else { - gas_rept *rept = yasm_xmalloc(sizeof(gas_rept)); - STAILQ_INIT(&rept->lines); - rept->startline = cur_line; - rept->numrept = yasm_intnum_get_uint(intn); - rept->numdone = 0; - rept->line = NULL; - rept->linepos = 0; - rept->ended = 0; - rept->oldbuf = NULL; - rept->oldbuflen = 0; - rept->oldbufpos = 0; - parser_gas->rept = rept; - } - return NULL; - case DIR_ENDR: - get_next_token(); /* DIR_ENDR */ - /* Shouldn't ever get here unless we didn't get a DIR_REPT first */ - yasm_error_set(YASM_ERROR_SYNTAX, N_("endr without matching rept")); - return NULL; - - /* Alignment directives */ - case DIR_ALIGN: - { - yasm_expr *bound, *fill=NULL, *maxskip=NULL; - - ival = DIR_ALIGN_val; - get_next_token(); /* DIR_ALIGN */ - - bound = parse_expr(parser_gas); - if (!bound) { - yasm_error_set(YASM_ERROR_SYNTAX, - N_(".align directive must specify alignment")); - return NULL; - } - - if (curtok == ',') { - get_next_token(); /* ',' */ - fill = parse_expr(parser_gas); - if (curtok == ',') { - get_next_token(); /* ',' */ - maxskip = parse_expr(parser_gas); - } - } - - return gas_parser_align(parser_gas, cursect, bound, fill, maxskip, - (int)ival); - } - case DIR_ORG: - { - yasm_intnum *start, *value=NULL; - get_next_token(); /* DIR_ORG */ - - /* TODO: support expr instead of intnum */ - if (!expect(INTNUM)) return NULL; - start = INTNUM_val; - get_next_token(); /* INTNUM */ - - if (curtok == ',') { - get_next_token(); /* ',' */ - /* TODO: support expr instead of intnum */ - if (!expect(INTNUM)) return NULL; - value = INTNUM_val; - get_next_token(); /* INTNUM */ - } - if (value) { - bc = yasm_bc_create_org(yasm_intnum_get_uint(start), - yasm_intnum_get_uint(value), cur_line); - yasm_intnum_destroy(value); - } else - bc = yasm_bc_create_org(yasm_intnum_get_uint(start), 0, - cur_line); - yasm_intnum_destroy(start); - return bc; - } - /* Data visibility directives */ - case DIR_LOCAL: - get_next_token(); /* DIR_LOCAL */ - if (!expect(ID)) return NULL; - yasm_symtab_declare(p_symtab, ID_val, YASM_SYM_DLOCAL, cur_line); - yasm_xfree(ID_val); - get_next_token(); /* ID */ - return NULL; - case DIR_COMM: - case DIR_LCOMM: - { - yasm_expr *align = NULL; - /*@null@*/ /*@dependent@*/ yasm_symrec *sym; - int is_lcomm = curtok == DIR_LCOMM; - - get_next_token(); /* DIR_LOCAL */ - - if (!expect(ID)) return NULL; - id = ID_val; - get_next_token(); /* ID */ - if (!expect(',')) { - yasm_xfree(id); - return NULL; - } - get_next_token(); /* , */ - e = parse_expr(parser_gas); - if (!e) { - yasm_error_set(YASM_ERROR_SYNTAX, N_("size expected for `%s'"), - ".COMM"); - return NULL; - } - if (curtok == ',') { - /* Optional alignment expression */ - get_next_token(); /* ',' */ - align = parse_expr(parser_gas); - } - /* If already explicitly declared local, treat like LCOMM */ - if (is_lcomm - || ((sym = yasm_symtab_get(p_symtab, id)) - && yasm_symrec_get_visibility(sym) == YASM_SYM_DLOCAL)) { - define_lcomm(parser_gas, id, e, align); - } else if (align) { - /* Give third parameter as objext valparam */ - yasm_valparamhead *extvps = yasm_vps_create(); - vp = yasm_vp_create_expr(NULL, align); - yasm_vps_append(extvps, vp); - - sym = yasm_symtab_declare(p_symtab, id, YASM_SYM_COMMON, - cur_line); - yasm_symrec_set_common_size(sym, e); - yasm_symrec_set_objext_valparams(sym, extvps); - - yasm_xfree(id); - } else { - sym = yasm_symtab_declare(p_symtab, id, YASM_SYM_COMMON, - cur_line); - yasm_symrec_set_common_size(sym, e); - yasm_xfree(id); - } - return NULL; - } - - /* Integer data definition directives */ - case DIR_ASCII: - ival = DIR_ASCII_val; - get_next_token(); /* DIR_ASCII */ - if (!parse_strvals(parser_gas, &dvs)) - return NULL; - return yasm_bc_create_data(&dvs, 1, (int)ival, p_object->arch, - cur_line); - case DIR_DATA: - ival = DIR_DATA_val; - get_next_token(); /* DIR_DATA */ - if (!parse_datavals(parser_gas, &dvs)) - return NULL; - return yasm_bc_create_data(&dvs, ival, 0, p_object->arch, - cur_line); - case DIR_LEB128: - ival = DIR_LEB128_val; - get_next_token(); /* DIR_LEB128 */ - if (!parse_datavals(parser_gas, &dvs)) - return NULL; - return yasm_bc_create_leb128(&dvs, (int)ival, cur_line); - - /* Empty space / fill data definition directives */ - case DIR_ZERO: - get_next_token(); /* DIR_ZERO */ - e = parse_expr(parser_gas); - if (!e) { - yasm_error_set(YASM_ERROR_SYNTAX, - N_("expression expected after `%s'"), ".ZERO"); - return NULL; - } - - yasm_dvs_initialize(&dvs); - yasm_dvs_append(&dvs, yasm_dv_create_expr( - p_expr_new_ident(yasm_expr_int(yasm_intnum_create_uint(0))))); - bc = yasm_bc_create_data(&dvs, 1, 0, p_object->arch, cur_line); - yasm_bc_set_multiple(bc, e); - return bc; - case DIR_SKIP: - { - yasm_expr *e_val; - - get_next_token(); /* DIR_SKIP */ - e = parse_expr(parser_gas); - if (!e) { - yasm_error_set(YASM_ERROR_SYNTAX, - N_("expression expected after `%s'"), ".SKIP"); - return NULL; - } - if (curtok != ',') - return yasm_bc_create_reserve(e, 1, cur_line); - get_next_token(); /* ',' */ - e_val = parse_expr(parser_gas); - yasm_dvs_initialize(&dvs); - yasm_dvs_append(&dvs, yasm_dv_create_expr(e_val)); - bc = yasm_bc_create_data(&dvs, 1, 0, p_object->arch, cur_line); - - yasm_bc_set_multiple(bc, e); - return bc; - } - - /* fill data definition directive */ - case DIR_FILL: - { - yasm_expr *sz=NULL, *val=NULL; - get_next_token(); /* DIR_FILL */ - e = parse_expr(parser_gas); - if (!e) { - yasm_error_set(YASM_ERROR_SYNTAX, - N_("expression expected after `%s'"), ".FILL"); - return NULL; - } - if (curtok == ',') { - get_next_token(); /* ',' */ - sz = parse_expr(parser_gas); - if (curtok == ',') { - get_next_token(); /* ',' */ - val = parse_expr(parser_gas); - } - } - return gas_parser_dir_fill(parser_gas, e, sz, val); - } - - /* Section directives */ - case DIR_SECTNAME: - gas_switch_section(parser_gas, DIR_SECTNAME_val, NULL, NULL, NULL, - 1); - get_next_token(); /* DIR_SECTNAME */ - return NULL; - case DIR_SECTION: - { - /* DIR_SECTION ID ',' STRING ',' '@' ID ',' dirvals */ - char *sectname, *flags = NULL, *type = NULL; - int have_vps = 0; - - get_next_token(); /* DIR_SECTION */ - - if (!expect(ID)) return NULL; - sectname = ID_val; - get_next_token(); /* ID */ - - if (curtok == ',') { - get_next_token(); /* ',' */ - if (!expect(STRING)) { - yasm_error_set(YASM_ERROR_SYNTAX, - N_("flag string expected")); - yasm_xfree(sectname); - return NULL; - } - flags = STRING_val.contents; - get_next_token(); /* STRING */ - } - - if (curtok == ',') { - get_next_token(); /* ',' */ - if (!expect('@')) { - yasm_xfree(sectname); - yasm_xfree(flags); - return NULL; - } - get_next_token(); /* '@' */ - if (!expect(ID)) { - yasm_xfree(sectname); - yasm_xfree(flags); - return NULL; - } - type = ID_val; - get_next_token(); /* ID */ - } - - if (curtok == ',') { - get_next_token(); /* ',' */ - if (parse_dirvals(parser_gas, &vps)) - have_vps = 1; - } - - gas_switch_section(parser_gas, sectname, flags, type, - have_vps ? &vps : NULL, 0); - yasm_xfree(flags); - return NULL; - } - - /* Other directives */ - case DIR_EQU: - /* ID ',' expr */ - get_next_token(); /* DIR_EQU */ - if (!expect(ID)) return NULL; - id = ID_val; - get_next_token(); /* ID */ - if (!expect(',')) { - yasm_xfree(id); - return NULL; - } - get_next_token(); /* ',' */ - e = parse_expr(parser_gas); - if (e) - yasm_symtab_define_equ(p_symtab, id, e, cur_line); - else - yasm_error_set(YASM_ERROR_SYNTAX, - N_("expression expected after `%s'"), ","); - yasm_xfree(id); - return NULL; - - case DIR_FILE: - get_next_token(); /* DIR_FILE */ - if (curtok == STRING) { - /* No file number; this form also sets the assembler's - * internal line number. - */ - char *filename = STRING_val.contents; - get_next_token(); /* STRING */ - if (parser_gas->dir_fileline == 3) { - /* Have both file and line */ - const char *old_fn; - unsigned long old_line; - - yasm_linemap_lookup(parser_gas->linemap, cur_line, &old_fn, - &old_line); - yasm_linemap_set(parser_gas->linemap, filename, old_line, - 1); - } else if (parser_gas->dir_fileline == 2) { - /* Had previous line directive only */ - parser_gas->dir_fileline = 3; - yasm_linemap_set(parser_gas->linemap, filename, - parser_gas->dir_line, 1); - } else { - /* Didn't see line yet, save file */ - parser_gas->dir_fileline = 1; - if (parser_gas->dir_file) - yasm_xfree(parser_gas->dir_file); - parser_gas->dir_file = yasm__xstrdup(filename); - } - - /* Pass change along to debug format */ - yasm_vps_initialize(&vps); - vp = yasm_vp_create_string(NULL, filename); - yasm_vps_append(&vps, vp); - - yasm_object_directive(p_object, ".file", "gas", &vps, NULL, - cur_line); - - yasm_vps_delete(&vps); - return NULL; - } - - /* fileno filename form */ - yasm_vps_initialize(&vps); - - if (!expect(INTNUM)) return NULL; - vp = yasm_vp_create_expr(NULL, - p_expr_new_ident(yasm_expr_int(INTNUM_val))); - yasm_vps_append(&vps, vp); - get_next_token(); /* INTNUM */ - - if (!expect(STRING)) { - yasm_vps_delete(&vps); - return NULL; - } - vp = yasm_vp_create_string(NULL, STRING_val.contents); - yasm_vps_append(&vps, vp); - get_next_token(); /* STRING */ - - yasm_object_directive(p_object, ".file", "gas", &vps, NULL, - cur_line); - - yasm_vps_delete(&vps); - return NULL; default: yasm_error_set(YASM_ERROR_SYNTAX, N_("label or instruction expected at start of line")); @@ -710,6 +254,480 @@ parse_line(yasm_parser_gas *parser_gas) } } +/* Line directive */ +static yasm_bytecode * +dir_line(yasm_parser_gas *parser_gas, unsigned int param) +{ + if (!expect(INTNUM)) return NULL; + if (yasm_intnum_sign(INTNUM_val) < 0) { + get_next_token(); /* INTNUM */ + yasm_error_set(YASM_ERROR_SYNTAX, + N_("line number is negative")); + return NULL; + } + + parser_gas->dir_line = yasm_intnum_get_uint(INTNUM_val); + yasm_intnum_destroy(INTNUM_val); + get_next_token(); /* INTNUM */ + + if (parser_gas->dir_fileline == 3) { + /* Have both file and line */ + yasm_linemap_set(parser_gas->linemap, NULL, + parser_gas->dir_line, 1); + } else if (parser_gas->dir_fileline == 1) { + /* Had previous file directive only */ + parser_gas->dir_fileline = 3; + yasm_linemap_set(parser_gas->linemap, parser_gas->dir_file, + parser_gas->dir_line, 1); + } else { + /* Didn't see file yet */ + parser_gas->dir_fileline = 2; + } + return NULL; +} + +/* Macro directives */ + +static yasm_bytecode * +dir_rept(yasm_parser_gas *parser_gas, unsigned int param) +{ + yasm_intnum *intn; + yasm_expr *e = parse_expr(parser_gas); + + if (!e) { + yasm_error_set(YASM_ERROR_SYNTAX, + N_("expression expected after `%s'"), + ".rept"); + return NULL; + } + intn = yasm_expr_get_intnum(&e, 0); + + if (!intn) { + yasm_error_set(YASM_ERROR_NOT_ABSOLUTE, + N_("rept expression not absolute")); + } else if (yasm_intnum_sign(intn) < 0) { + yasm_error_set(YASM_ERROR_VALUE, + N_("rept expression is negative")); + } else { + gas_rept *rept = yasm_xmalloc(sizeof(gas_rept)); + STAILQ_INIT(&rept->lines); + rept->startline = cur_line; + rept->numrept = yasm_intnum_get_uint(intn); + rept->numdone = 0; + rept->line = NULL; + rept->linepos = 0; + rept->ended = 0; + rept->oldbuf = NULL; + rept->oldbuflen = 0; + rept->oldbufpos = 0; + parser_gas->rept = rept; + } + return NULL; +} + +static yasm_bytecode * +dir_endr(yasm_parser_gas *parser_gas, unsigned int param) +{ + /* Shouldn't ever get here unless we didn't get a DIR_REPT first */ + yasm_error_set(YASM_ERROR_SYNTAX, N_("endr without matching rept")); + return NULL; +} + +/* Alignment directives */ + +static yasm_bytecode * +dir_align(yasm_parser_gas *parser_gas, unsigned int param) +{ + yasm_expr *bound, *fill=NULL, *maxskip=NULL; + + bound = parse_expr(parser_gas); + if (!bound) { + yasm_error_set(YASM_ERROR_SYNTAX, + N_(".align directive must specify alignment")); + return NULL; + } + + if (curtok == ',') { + get_next_token(); /* ',' */ + fill = parse_expr(parser_gas); + if (curtok == ',') { + get_next_token(); /* ',' */ + maxskip = parse_expr(parser_gas); + } + } + + return gas_parser_align(parser_gas, cursect, bound, fill, maxskip, + (int)param); +} + +static yasm_bytecode * +dir_org(yasm_parser_gas *parser_gas, unsigned int param) +{ + yasm_intnum *start, *value=NULL; + yasm_bytecode *bc; + + /* TODO: support expr instead of intnum */ + if (!expect(INTNUM)) return NULL; + start = INTNUM_val; + get_next_token(); /* INTNUM */ + + if (curtok == ',') { + get_next_token(); /* ',' */ + /* TODO: support expr instead of intnum */ + if (!expect(INTNUM)) return NULL; + value = INTNUM_val; + get_next_token(); /* INTNUM */ + } + if (value) { + bc = yasm_bc_create_org(yasm_intnum_get_uint(start), + yasm_intnum_get_uint(value), cur_line); + yasm_intnum_destroy(value); + } else + bc = yasm_bc_create_org(yasm_intnum_get_uint(start), 0, + cur_line); + yasm_intnum_destroy(start); + return bc; +} + +/* Data visibility directives */ + +static yasm_bytecode * +dir_local(yasm_parser_gas *parser_gas, unsigned int param) +{ + if (!expect(ID)) return NULL; + yasm_symtab_declare(p_symtab, ID_val, YASM_SYM_DLOCAL, cur_line); + yasm_xfree(ID_val); + get_next_token(); /* ID */ + return NULL; +} + +static yasm_bytecode * +dir_comm(yasm_parser_gas *parser_gas, unsigned int is_lcomm) +{ + yasm_expr *align = NULL; + /*@null@*/ /*@dependent@*/ yasm_symrec *sym; + char *id; + yasm_expr *e; + + if (!expect(ID)) return NULL; + id = ID_val; + get_next_token(); /* ID */ + if (!expect(',')) { + yasm_xfree(id); + return NULL; + } + get_next_token(); /* , */ + e = parse_expr(parser_gas); + if (!e) { + yasm_error_set(YASM_ERROR_SYNTAX, N_("size expected for `%s'"), + ".COMM"); + return NULL; + } + if (curtok == ',') { + /* Optional alignment expression */ + get_next_token(); /* ',' */ + align = parse_expr(parser_gas); + } + /* If already explicitly declared local, treat like LCOMM */ + if (is_lcomm + || ((sym = yasm_symtab_get(p_symtab, id)) + && yasm_symrec_get_visibility(sym) == YASM_SYM_DLOCAL)) { + define_lcomm(parser_gas, id, e, align); + } else if (align) { + /* Give third parameter as objext valparam */ + yasm_valparamhead *extvps = yasm_vps_create(); + yasm_valparam *vp = yasm_vp_create_expr(NULL, align); + yasm_vps_append(extvps, vp); + + sym = yasm_symtab_declare(p_symtab, id, YASM_SYM_COMMON, + cur_line); + yasm_symrec_set_common_size(sym, e); + yasm_symrec_set_objext_valparams(sym, extvps); + + yasm_xfree(id); + } else { + sym = yasm_symtab_declare(p_symtab, id, YASM_SYM_COMMON, + cur_line); + yasm_symrec_set_common_size(sym, e); + yasm_xfree(id); + } + return NULL; +} + +/* Integer data definition directives */ + +static yasm_bytecode * +dir_ascii(yasm_parser_gas *parser_gas, unsigned int withzero) +{ + yasm_datavalhead dvs; + if (!parse_strvals(parser_gas, &dvs)) + return NULL; + return yasm_bc_create_data(&dvs, 1, (int)withzero, p_object->arch, + cur_line); +} + +static yasm_bytecode * +dir_data(yasm_parser_gas *parser_gas, unsigned int size) +{ + yasm_datavalhead dvs; + if (!parse_datavals(parser_gas, &dvs)) + return NULL; + return yasm_bc_create_data(&dvs, size, 0, p_object->arch, cur_line); +} + +static yasm_bytecode * +dir_leb128(yasm_parser_gas *parser_gas, unsigned int sign) +{ + yasm_datavalhead dvs; + if (!parse_datavals(parser_gas, &dvs)) + return NULL; + return yasm_bc_create_leb128(&dvs, (int)sign, cur_line); +} + +/* Empty space / fill data definition directives */ + +static yasm_bytecode * +dir_zero(yasm_parser_gas *parser_gas, unsigned int param) +{ + yasm_bytecode *bc; + yasm_datavalhead dvs; + yasm_expr *e = parse_expr(parser_gas); + if (!e) { + yasm_error_set(YASM_ERROR_SYNTAX, + N_("expression expected after `%s'"), ".ZERO"); + return NULL; + } + + yasm_dvs_initialize(&dvs); + yasm_dvs_append(&dvs, yasm_dv_create_expr( + p_expr_new_ident(yasm_expr_int(yasm_intnum_create_uint(0))))); + bc = yasm_bc_create_data(&dvs, 1, 0, p_object->arch, cur_line); + yasm_bc_set_multiple(bc, e); + return bc; +} + +static yasm_bytecode * +dir_skip(yasm_parser_gas *parser_gas, unsigned int param) +{ + yasm_expr *e, *e_val; + yasm_bytecode *bc; + yasm_datavalhead dvs; + + e = parse_expr(parser_gas); + if (!e) { + yasm_error_set(YASM_ERROR_SYNTAX, + N_("expression expected after `%s'"), ".SKIP"); + return NULL; + } + if (curtok != ',') + return yasm_bc_create_reserve(e, 1, cur_line); + get_next_token(); /* ',' */ + e_val = parse_expr(parser_gas); + yasm_dvs_initialize(&dvs); + yasm_dvs_append(&dvs, yasm_dv_create_expr(e_val)); + bc = yasm_bc_create_data(&dvs, 1, 0, p_object->arch, cur_line); + + yasm_bc_set_multiple(bc, e); + return bc; +} + +/* fill data definition directive */ +static yasm_bytecode * +dir_fill(yasm_parser_gas *parser_gas, unsigned int param) +{ + yasm_expr *sz=NULL, *val=NULL; + yasm_expr *e = parse_expr(parser_gas); + if (!e) { + yasm_error_set(YASM_ERROR_SYNTAX, + N_("expression expected after `%s'"), ".FILL"); + return NULL; + } + if (curtok == ',') { + get_next_token(); /* ',' */ + sz = parse_expr(parser_gas); + if (curtok == ',') { + get_next_token(); /* ',' */ + val = parse_expr(parser_gas); + } + } + return gas_parser_dir_fill(parser_gas, e, sz, val); +} + +/* Section directives */ + +static yasm_bytecode * +dir_bss_section(yasm_parser_gas *parser_gas, unsigned int param) +{ + gas_switch_section(parser_gas, ".bss", NULL, NULL, NULL, 1); + return NULL; +} + +static yasm_bytecode * +dir_data_section(yasm_parser_gas *parser_gas, unsigned int param) +{ + gas_switch_section(parser_gas, ".data", NULL, NULL, NULL, 1); + return NULL; +} + +static yasm_bytecode * +dir_text_section(yasm_parser_gas *parser_gas, unsigned int param) +{ + gas_switch_section(parser_gas, ".text", NULL, NULL, NULL, 1); + return NULL; +} + +static yasm_bytecode * +dir_section(yasm_parser_gas *parser_gas, unsigned int param) +{ + /* DIR_SECTION ID ',' STRING ',' '@' ID ',' dirvals */ + char *sectname, *flags = NULL, *type = NULL; + yasm_valparamhead vps; + int have_vps = 0; + + if (!expect(ID)) return NULL; + sectname = ID_val; + get_next_token(); /* ID */ + + if (curtok == ',') { + get_next_token(); /* ',' */ + if (!expect(STRING)) { + yasm_error_set(YASM_ERROR_SYNTAX, + N_("flag string expected")); + yasm_xfree(sectname); + return NULL; + } + flags = STRING_val.contents; + get_next_token(); /* STRING */ + } + + if (curtok == ',') { + get_next_token(); /* ',' */ + if (!expect('@')) { + yasm_xfree(sectname); + yasm_xfree(flags); + return NULL; + } + get_next_token(); /* '@' */ + if (!expect(ID)) { + yasm_xfree(sectname); + yasm_xfree(flags); + return NULL; + } + type = ID_val; + get_next_token(); /* ID */ + } + + if (curtok == ',') { + get_next_token(); /* ',' */ + if (parse_dirvals(parser_gas, &vps)) + have_vps = 1; + } + + gas_switch_section(parser_gas, sectname, flags, type, + have_vps ? &vps : NULL, 0); + yasm_xfree(sectname); + yasm_xfree(flags); + return NULL; +} + +/* Other directives */ + +static yasm_bytecode * +dir_equ(yasm_parser_gas *parser_gas, unsigned int param) +{ + yasm_expr *e; + char *id; + + /* ID ',' expr */ + if (!expect(ID)) return NULL; + id = ID_val; + get_next_token(); /* ID */ + if (!expect(',')) { + yasm_xfree(id); + return NULL; + } + get_next_token(); /* ',' */ + e = parse_expr(parser_gas); + if (e) + yasm_symtab_define_equ(p_symtab, id, e, cur_line); + else + yasm_error_set(YASM_ERROR_SYNTAX, + N_("expression expected after `%s'"), ","); + yasm_xfree(id); + return NULL; +} + +static yasm_bytecode * +dir_file(yasm_parser_gas *parser_gas, unsigned int param) +{ + yasm_valparamhead vps; + yasm_valparam *vp; + + if (curtok == STRING) { + /* No file number; this form also sets the assembler's + * internal line number. + */ + char *filename = STRING_val.contents; + + get_next_token(); /* STRING */ + if (parser_gas->dir_fileline == 3) { + /* Have both file and line */ + const char *old_fn; + unsigned long old_line; + + yasm_linemap_lookup(parser_gas->linemap, cur_line, &old_fn, + &old_line); + yasm_linemap_set(parser_gas->linemap, filename, old_line, + 1); + } else if (parser_gas->dir_fileline == 2) { + /* Had previous line directive only */ + parser_gas->dir_fileline = 3; + yasm_linemap_set(parser_gas->linemap, filename, + parser_gas->dir_line, 1); + } else { + /* Didn't see line yet, save file */ + parser_gas->dir_fileline = 1; + if (parser_gas->dir_file) + yasm_xfree(parser_gas->dir_file); + parser_gas->dir_file = yasm__xstrdup(filename); + } + + /* Pass change along to debug format */ + yasm_vps_initialize(&vps); + vp = yasm_vp_create_string(NULL, filename); + yasm_vps_append(&vps, vp); + + yasm_object_directive(p_object, ".file", "gas", &vps, NULL, + cur_line); + + yasm_vps_delete(&vps); + return NULL; + } + + /* fileno filename form */ + yasm_vps_initialize(&vps); + + if (!expect(INTNUM)) return NULL; + vp = yasm_vp_create_expr(NULL, + p_expr_new_ident(yasm_expr_int(INTNUM_val))); + yasm_vps_append(&vps, vp); + get_next_token(); /* INTNUM */ + + if (!expect(STRING)) { + yasm_vps_delete(&vps); + return NULL; + } + vp = yasm_vp_create_string(NULL, STRING_val.contents); + yasm_vps_append(&vps, vp); + get_next_token(); /* STRING */ + + yasm_object_directive(p_object, ".file", "gas", &vps, NULL, + cur_line); + + yasm_vps_delete(&vps); + return NULL; +} + static yasm_bytecode * parse_instr(yasm_parser_gas *parser_gas) { @@ -1218,7 +1236,6 @@ parse_expr2(yasm_parser_gas *parser_gas) get_next_token(); return e; case ID: - case DIR_SECTNAME: { char *name = ID_val; get_next_token(); /* ID */ @@ -1325,7 +1342,7 @@ gas_get_section(yasm_parser_gas *parser_gas, char *name, } static void -gas_switch_section(yasm_parser_gas *parser_gas, char *name, +gas_switch_section(yasm_parser_gas *parser_gas, const char *name, /*@null@*/ char *flags, /*@null@*/ char *type, /*@null@*/ yasm_valparamhead *objext_valparams, int builtin) @@ -1341,8 +1358,6 @@ gas_switch_section(yasm_parser_gas *parser_gas, char *name, yasm_error_set(YASM_ERROR_GENERAL, N_("invalid section name `%s'"), name); - yasm_xfree(name); - if (objext_valparams) yasm_vps_delete(objext_valparams); } @@ -1415,26 +1430,112 @@ gas_parser_dir_fill(yasm_parser_gas *parser_gas, /*@only@*/ yasm_expr *repeat, return bc; } -#if 0 -static void -gas_parser_directive(yasm_parser_gas *parser_gas, const char *name, - yasm_valparamhead *valparams, - yasm_valparamhead *objext_valparams) -{ - unsigned long line = cur_line; - /* Handle (mostly) output-format independent directives here */ - if (!yasm_arch_parse_directive(p_object->arch, name, valparams, - objext_valparams, parser_gas->object, line)) { - ; - } else if (yasm_objfmt_directive(p_object, name, valparams, - objext_valparams, line)) { - yasm_error_set(YASM_ERROR_GENERAL, N_("unrecognized directive [%s]"), - name); +static dir_lookup dirs_static[] = { + /* FIXME: Whether this is power-of-two or not depends on arch and objfmt. */ + {".align", dir_align, 0, INSTDIR}, + {".p2align", dir_align, 1, INSTDIR}, + {".balign", dir_align, 0, INSTDIR}, + {".org", dir_org, 0, INSTDIR}, + /* data visibility directives */ + {".local", dir_local, 0, INSTDIR}, + {".comm", dir_comm, 0, INSTDIR}, + {".lcomm", dir_comm, 1, INSTDIR}, + /* integer data declaration directives */ + {".byte", dir_data, 1, INSTDIR}, + {".2byte", dir_data, 2, INSTDIR}, + {".4byte", dir_data, 4, INSTDIR}, + {".8byte", dir_data, 8, INSTDIR}, + {".16byte", dir_data, 16, INSTDIR}, + /* TODO: These should depend on arch */ + {".short", dir_data, 2, INSTDIR}, + {".int", dir_data, 4, INSTDIR}, + {".long", dir_data, 4, INSTDIR}, + {".hword", dir_data, 2, INSTDIR}, + {".quad", dir_data, 8, INSTDIR}, + {".octa", dir_data, 16, INSTDIR}, + /* XXX: At least on x86, this is 2 bytes */ + {".value", dir_data, 2, INSTDIR}, + /* ASCII data declaration directives */ + {".ascii", dir_ascii, 0, INSTDIR}, /* no terminating zero */ + {".asciz", dir_ascii, 1, INSTDIR}, /* add terminating zero */ + {".string", dir_ascii, 1, INSTDIR}, /* add terminating zero */ + /* LEB128 integer data declaration directives */ + {".sleb128", dir_leb128, 1, INSTDIR}, /* signed */ + {".uleb128", dir_leb128, 0, INSTDIR}, /* unsigned */ + /* floating point data declaration directives */ + {".float", dir_data, 4, INSTDIR}, + {".single", dir_data, 4, INSTDIR}, + {".double", dir_data, 8, INSTDIR}, + {".tfloat", dir_data, 10, INSTDIR}, + /* section directives */ + {".bss", dir_bss_section, 0, INITIAL}, + {".data", dir_data_section, 0, INITIAL}, + {".text", dir_text_section, 0, INITIAL}, + {".section", dir_section, 0, SECTION_DIRECTIVE}, + /* macro directives */ + {".rept", dir_rept, 0, INSTDIR}, + {".endr", dir_endr, 0, INSTDIR}, + /* empty space/fill directives */ + {".skip", dir_skip, 0, INSTDIR}, + {".space", dir_skip, 0, INSTDIR}, + {".fill", dir_fill, 0, INSTDIR}, + {".zero", dir_zero, 0, INSTDIR}, + /* other directives */ + {".equ", dir_equ, 0, INSTDIR}, + {".file", dir_file, 0, INSTDIR}, + {".line", dir_line, 0, INSTDIR}, + {".set", dir_equ, 0, INSTDIR} +}; + +static void +no_delete(void *data) +{ +} + +void +gas_parser_parse(yasm_parser_gas *parser_gas) +{ + dir_lookup word; + unsigned int i; + int replace = 1; + + word.name = ".word"; + word.handler = dir_data; + word.param = yasm_arch_wordsize(p_object->arch)/8; + word.newstate = INSTDIR; + + /* Create directive lookup */ + parser_gas->dirs = HAMT_create(1, yasm_internal_error_); + HAMT_insert(parser_gas->dirs, word.name, &word, &replace, no_delete); + for (i=0; idirs, dirs_static[i].name, + &dirs_static[i], &replace, no_delete); } - yasm_vps_delete(valparams); - if (objext_valparams) - yasm_vps_delete(objext_valparams); + while (get_next_token() != 0) { + yasm_bytecode *bc = NULL, *temp_bc; + + if (!is_eol()) { + bc = parse_line(parser_gas); + demand_eol(); + } + + yasm_errwarn_propagate(parser_gas->errwarns, cur_line); + + temp_bc = yasm_section_bcs_append(cursect, bc); + if (temp_bc) + parser_gas->prev_bc = temp_bc; + if (curtok == ';') + continue; /* don't advance line number until \n */ + if (parser_gas->save_input) + yasm_linemap_add_source(parser_gas->linemap, + temp_bc, + (char *)parser_gas->save_line[parser_gas->save_last ^ 1]); + yasm_linemap_goto_next(parser_gas->linemap); + parser_gas->dir_line++; /* keep track for .line followed by .file */ + } + + HAMT_destroy(parser_gas->dirs, no_delete); } -#endif diff --git a/modules/parsers/gas/gas-parser.h b/modules/parsers/gas/gas-parser.h index 213e4696..8d683e09 100644 --- a/modules/parsers/gas/gas-parser.h +++ b/modules/parsers/gas/gas-parser.h @@ -48,25 +48,6 @@ enum tokentype { RIGHT_OP, ID, LABEL, - LINE, - DIR_ALIGN, - DIR_ASCII, - DIR_COMM, - DIR_DATA, - DIR_ENDR, - DIR_EQU, - DIR_FILE, - DIR_FILL, - DIR_LEB128, - DIR_LINE, - DIR_LOCAL, - DIR_LCOMM, - DIR_ORG, - DIR_REPT, - DIR_SECTION, - DIR_SECTNAME, - DIR_SKIP, - DIR_ZERO, NONE }; @@ -104,6 +85,13 @@ typedef struct gas_rept { size_t oldbufpos; /* position in previous fill buffer */ } gas_rept; +enum gas_parser_state { + INITIAL, + COMMENT, + SECTION_DIRECTIVE, + INSTDIR +}; + typedef struct yasm_parser_gas { FILE *in; int debug; @@ -132,12 +120,7 @@ typedef struct yasm_parser_gas { int save_last; yasm_scanner s; - enum { - INITIAL, - COMMENT, - SECTION_DIRECTIVE, - INSTDIR - } state; + enum gas_parser_state state; int token; /* enum tokentype or any character */ yystype tokval; @@ -154,6 +137,9 @@ typedef struct yasm_parser_gas { * so these are all 0 at start. */ unsigned long local[10]; + + /* Parser-handled directives HAMT lookup */ + HAMT *dirs; } yasm_parser_gas; /* shorter access names to commonly used parser_gas fields */ @@ -174,11 +160,6 @@ typedef struct yasm_parser_gas { #define TARGETMOD_val (curval.arch_data) #define ID_val (curval.str_val) #define LABEL_val (curval.str_val) -#define DIR_ALIGN_val (curval.int_info) -#define DIR_ASCII_val (curval.int_info) -#define DIR_DATA_val (curval.int_info) -#define DIR_LEB128_val (curval.int_info) -#define DIR_SECTNAME_val (curval.str_val) #define cur_line (yasm_linemap_get_current(parser_gas->linemap)) diff --git a/modules/parsers/gas/gas-token.re b/modules/parsers/gas/gas-token.re index efa400d0..c3b19e99 100644 --- a/modules/parsers/gas/gas-token.re +++ b/modules/parsers/gas/gas-token.re @@ -341,151 +341,6 @@ scan: RETURN(s->tok[0]); } - /* arch-independent directives */ - /* alignment directives */ - '.align' { - /* FIXME: Whether this is power-of-two or not depends on arch and - * objfmt. - */ - lvalp->int_info = 0; - parser_gas->state = INSTDIR; RETURN(DIR_ALIGN); - } - '.p2align' { - lvalp->int_info = 1; - parser_gas->state = INSTDIR; RETURN(DIR_ALIGN); - } - '.balign' { - lvalp->int_info = 0; - parser_gas->state = INSTDIR; RETURN(DIR_ALIGN); - } - '.org' { parser_gas->state = INSTDIR; RETURN(DIR_ORG); } - /* data visibility directives */ - '.local' { parser_gas->state = INSTDIR; RETURN(DIR_LOCAL); } - '.comm' { parser_gas->state = INSTDIR; RETURN(DIR_COMM); } - '.lcomm' { parser_gas->state = INSTDIR; RETURN(DIR_LCOMM); } - /* integer data declaration directives */ - '.byte' { - lvalp->int_info = 1; - parser_gas->state = INSTDIR; RETURN(DIR_DATA); - } - '.2byte' { - lvalp->int_info = 2; - parser_gas->state = INSTDIR; RETURN(DIR_DATA); - } - '.4byte' { - lvalp->int_info = 4; - parser_gas->state = INSTDIR; RETURN(DIR_DATA); - } - '.8byte' { - lvalp->int_info = 8; - parser_gas->state = INSTDIR; RETURN(DIR_DATA); - } - '.16byte' { - lvalp->int_info = 16; - parser_gas->state = INSTDIR; RETURN(DIR_DATA); - } - '.short' { - lvalp->int_info = 2; /* TODO: This should depend on arch */ - parser_gas->state = INSTDIR; RETURN(DIR_DATA); - } - '.int' { - lvalp->int_info = 4; /* TODO: This should depend on arch */ - parser_gas->state = INSTDIR; RETURN(DIR_DATA); - } - '.long' { - lvalp->int_info = 4; /* TODO: This should depend on arch */ - parser_gas->state = INSTDIR; RETURN(DIR_DATA); - } - '.hword' { - lvalp->int_info = 2; /* TODO: This should depend on arch */ - parser_gas->state = INSTDIR; RETURN(DIR_DATA); - } - '.word' { - lvalp->int_info = yasm_arch_wordsize(p_object->arch)/8; - parser_gas->state = INSTDIR; RETURN(DIR_DATA); - } - '.quad' { - lvalp->int_info = 8; - parser_gas->state = INSTDIR; RETURN(DIR_DATA); - } - '.octa' { - lvalp->int_info = 16; - parser_gas->state = INSTDIR; RETURN(DIR_DATA); - } - '.value' { - lvalp->int_info = 2; /* XXX: At least on x86, this is 2 bytes */ - parser_gas->state = INSTDIR; RETURN(DIR_DATA); - } - /* ASCII data declaration directives */ - '.ascii' { - lvalp->int_info = 0; /* do not add terminating zero */ - parser_gas->state = INSTDIR; RETURN(DIR_ASCII); - } - '.asciz' { - lvalp->int_info = 1; /* add terminating zero */ - parser_gas->state = INSTDIR; RETURN(DIR_ASCII); - } - '.string' { - lvalp->int_info = 1; /* add terminating zero */ - parser_gas->state = INSTDIR; RETURN(DIR_ASCII); - } - /* LEB128 integer data declaration directives */ - '.sleb128' { - lvalp->int_info = 1; /* signed */ - parser_gas->state = INSTDIR; RETURN(DIR_LEB128); - } - '.uleb128' { - lvalp->int_info = 0; /* unsigned */ - parser_gas->state = INSTDIR; RETURN(DIR_LEB128); - } - /* floating point data declaration directives */ - '.float' { - lvalp->int_info = 4; - parser_gas->state = INSTDIR; RETURN(DIR_DATA); - } - '.single' { - lvalp->int_info = 4; - parser_gas->state = INSTDIR; RETURN(DIR_DATA); - } - '.double' { - lvalp->int_info = 8; - parser_gas->state = INSTDIR; RETURN(DIR_DATA); - } - '.tfloat' { - lvalp->int_info = 10; - parser_gas->state = INSTDIR; RETURN(DIR_DATA); - } - /* section directives */ - '.bss' { - lvalp->str_val = yasm__xstrdup(".bss"); - RETURN(DIR_SECTNAME); - } - '.data' { - lvalp->str_val = yasm__xstrdup(".data"); - RETURN(DIR_SECTNAME); - } - '.text' { - lvalp->str_val = yasm__xstrdup(".text"); - RETURN(DIR_SECTNAME); - } - '.section' { - parser_gas->state = SECTION_DIRECTIVE; - RETURN(DIR_SECTION); - } - /* macro directives */ - '.rept' { parser_gas->state = INSTDIR; RETURN(DIR_REPT); } - '.endr' { parser_gas->state = INSTDIR; RETURN(DIR_ENDR); } - /* empty space/fill directives */ - '.skip' { parser_gas->state = INSTDIR; RETURN(DIR_SKIP); } - '.space' { parser_gas->state = INSTDIR; RETURN(DIR_SKIP); } - '.fill' { parser_gas->state = INSTDIR; RETURN(DIR_FILL); } - '.zero' { parser_gas->state = INSTDIR; RETURN(DIR_ZERO); } - /* other directives */ - '.equ' { parser_gas->state = INSTDIR; RETURN(DIR_EQU); } - '.file' { parser_gas->state = INSTDIR; RETURN(DIR_FILE); } - '.line' { parser_gas->state = INSTDIR; RETURN(DIR_LINE); } - '.set' { parser_gas->state = INSTDIR; RETURN(DIR_EQU); } - /* label or maybe directive */ [_.][a-zA-Z0-9_$.]* { lvalp->str_val = yasm__xstrndup(TOK, TOKLEN); From 20dcf2190c6928dca35d54042e435e5cf60bdca5 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Mon, 20 Aug 2007 05:10:26 +0000 Subject: [PATCH 046/585] Fix warning documentation to match behavior of yasm_value_output_basic(). svn path=/trunk/yasm/; revision=1912 --- libyasm/coretype.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libyasm/coretype.h b/libyasm/coretype.h index 18dab291..60114e91 100644 --- a/libyasm/coretype.h +++ b/libyasm/coretype.h @@ -247,9 +247,7 @@ typedef enum yasm_expr_op { * \param bc current bytecode (usually passed into higher-level * calling function) * \param warn enables standard warnings: zero for none; - * nonzero for overflow/underflow floating point warnings; - * negative for signed integer warnings, - * positive for unsigned integer warnings + * nonzero for overflow/underflow floating point warnings * \param d objfmt-specific data (passed into higher-level calling * function) * \return Nonzero if an error occurred, 0 otherwise. From 35f8e2b1fcdd566bf15ac19893ab750e84b6ba09 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Mon, 20 Aug 2007 05:11:11 +0000 Subject: [PATCH 047/585] Set value->sign appropriately instead of ineffective passing of -1 to output_value(). svn path=/trunk/yasm/; revision=1913 --- modules/arch/x86/x86bc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/arch/x86/x86bc.c b/modules/arch/x86/x86bc.c index e574f935..a01031d9 100644 --- a/modules/arch/x86/x86bc.c +++ b/modules/arch/x86/x86bc.c @@ -892,8 +892,9 @@ x86_bc_jmp_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, yasm_expr_int(delta), bc->line); jmp->target.size = 8; + jmp->target.sign = 1; if (output_value(&jmp->target, *bufp, 1, - (unsigned long)(*bufp-bufp_orig), bc, -1, d)) + (unsigned long)(*bufp-bufp_orig), bc, 1, d)) return 1; *bufp += 1; break; @@ -923,8 +924,9 @@ x86_bc_jmp_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, yasm_expr_int(delta), bc->line); jmp->target.size = i*8; + jmp->target.sign = 1; if (output_value(&jmp->target, *bufp, i, - (unsigned long)(*bufp-bufp_orig), bc, -1, d)) + (unsigned long)(*bufp-bufp_orig), bc, 1, d)) return 1; *bufp += i; break; From e510b205cb522a7bb90e50cf8ff14c122a1dcc7e Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Mon, 20 Aug 2007 05:13:35 +0000 Subject: [PATCH 048/585] Unbitrot lc3b architecture. Requested by: Paul Barker svn path=/trunk/yasm/; revision=1914 --- modules/arch/Makefile.inc | 2 +- modules/arch/lc3b/lc3barch.c | 52 +++++++----- modules/arch/lc3b/lc3barch.h | 23 +++--- modules/arch/lc3b/lc3bbc.c | 81 +++++++++---------- modules/arch/lc3b/lc3bid.re | 150 +++++++++++++++++++++++++---------- 5 files changed, 187 insertions(+), 121 deletions(-) diff --git a/modules/arch/Makefile.inc b/modules/arch/Makefile.inc index 7dc98dfc..1a9f9055 100644 --- a/modules/arch/Makefile.inc +++ b/modules/arch/Makefile.inc @@ -4,7 +4,7 @@ EXTRA_DIST += modules/arch/x86/Makefile.inc EXTRA_DIST += modules/arch/lc3b/Makefile.inc include modules/arch/x86/Makefile.inc -#include modules/arch/lc3b/Makefile.inc +include modules/arch/lc3b/Makefile.inc dist_man_MANS += yasm_arch.7 diff --git a/modules/arch/lc3b/lc3barch.c b/modules/arch/lc3b/lc3barch.c index 152f6f1f..e1835d0a 100644 --- a/modules/arch/lc3b/lc3barch.c +++ b/modules/arch/lc3b/lc3barch.c @@ -82,18 +82,6 @@ lc3b_set_var(yasm_arch *arch, const char *var, unsigned long val) return 1; } -static int -lc3b_parse_directive(/*@unused@*/ yasm_arch *arch, - /*@unused@*/ const char *name, - /*@unused@*/ /*@null@*/ yasm_valparamhead *valparams, - /*@unused@*/ /*@null@*/ - yasm_valparamhead *objext_valparams, - /*@unused@*/ yasm_object *object, - /*@unused@*/ unsigned long line) -{ - return 1; -} - static const unsigned char ** lc3b_get_fill(const yasm_arch *arch) { @@ -131,21 +119,21 @@ lc3b_get_fill(const yasm_arch *arch) } static unsigned int -lc3b_get_reg_size(/*@unused@*/ yasm_arch *arch, /*@unused@*/ unsigned long reg) +lc3b_get_reg_size(/*@unused@*/ yasm_arch *arch, /*@unused@*/ uintptr_t reg) { return 16; } -static unsigned long +static uintptr_t lc3b_reggroup_get_reg(/*@unused@*/ yasm_arch *arch, - /*@unused@*/ unsigned long reggroup, + /*@unused@*/ uintptr_t reggroup, /*@unused@*/ unsigned long regindex) { return 0; } static void -lc3b_reg_print(/*@unused@*/ yasm_arch *arch, unsigned long reg, FILE *f) +lc3b_reg_print(/*@unused@*/ yasm_arch *arch, uintptr_t reg, FILE *f) { fprintf(f, "r%u", (unsigned int)(reg&7)); } @@ -163,8 +151,28 @@ lc3b_floatnum_tobytes(yasm_arch *arch, const yasm_floatnum *flt, static yasm_effaddr * lc3b_ea_create_expr(yasm_arch *arch, yasm_expr *e) { - yasm_expr_destroy(e); - return NULL; + yasm_effaddr *ea = yasm_xmalloc(sizeof(yasm_effaddr)); + yasm_value_initialize(&ea->disp, e, 0); + ea->need_nonzero_len = 0; + ea->need_disp = 1; + ea->nosplit = 0; + ea->strong = 0; + ea->segreg = 0; + return ea; +} + +void +yasm_lc3b__ea_destroy(/*@only@*/ yasm_effaddr *ea) +{ + yasm_value_delete(&ea->disp); + yasm_xfree(ea); +} + +static void +lc3b_ea_print(const yasm_effaddr *ea, FILE *f, int indent_level) +{ + fprintf(f, "%*sDisp:\n", indent_level, ""); + yasm_value_print(&ea->disp, f, indent_level+1); } /* Define lc3b machines -- see arch.h for details */ @@ -177,17 +185,15 @@ static yasm_arch_machine lc3b_machines[] = { yasm_arch_module yasm_lc3b_LTX_arch = { "LC-3b", "lc3b", + NULL, lc3b_create, lc3b_destroy, lc3b_get_machine, lc3b_get_address_size, lc3b_set_var, - yasm_lc3b__parse_cpu, yasm_lc3b__parse_check_insnprefix, yasm_lc3b__parse_check_regtmod, - lc3b_parse_directive, lc3b_get_fill, - yasm_lc3b__finalize_insn, lc3b_floatnum_tobytes, yasm_lc3b__intnum_tobytes, lc3b_get_reg_size, @@ -195,9 +201,11 @@ yasm_arch_module yasm_lc3b_LTX_arch = { lc3b_reg_print, NULL, /*yasm_lc3b__segreg_print*/ lc3b_ea_create_expr, + yasm_lc3b__ea_destroy, + lc3b_ea_print, + yasm_lc3b__create_empty_insn, lc3b_machines, "lc3b", 16, - 512, 2 }; diff --git a/modules/arch/lc3b/lc3barch.h b/modules/arch/lc3b/lc3barch.h index ff7d97e4..4de0c45d 100644 --- a/modules/arch/lc3b/lc3barch.h +++ b/modules/arch/lc3b/lc3barch.h @@ -45,29 +45,26 @@ typedef struct lc3b_insn { yasm_value imm; /* immediate or relative value */ lc3b_imm_type imm_type; /* size of the immediate */ - /* PC origin if needed */ - /*@null@*/ /*@dependent@*/ yasm_bytecode *origin_prevbc; - unsigned int opcode; /* opcode */ } lc3b_insn; void yasm_lc3b__bc_transform_insn(yasm_bytecode *bc, lc3b_insn *insn); -void yasm_lc3b__parse_cpu(yasm_arch *arch, const char *cpuid, size_t cpuid_len); - yasm_arch_insnprefix yasm_lc3b__parse_check_insnprefix - (yasm_arch *arch, unsigned long data[4], const char *id, size_t id_len); + (yasm_arch *arch, const char *id, size_t id_len, unsigned long line, + /*@out@*/ /*@only@*/ yasm_bytecode **bc, /*@out@*/ uintptr_t *prefix); yasm_arch_regtmod yasm_lc3b__parse_check_regtmod - (yasm_arch *arch, unsigned long *data, const char *id, size_t id_len); - -void yasm_lc3b__finalize_insn - (yasm_arch *arch, yasm_bytecode *bc, yasm_bytecode *prev_bc, - const unsigned long data[4], int num_operands, - /*@null@*/ yasm_insn_operands *operands, int num_prefixes, - unsigned long **prefixes, int num_segregs, const unsigned long *segregs); + (yasm_arch *arch, const char *id, size_t id_len, + /*@out@*/ uintptr_t *data); int yasm_lc3b__intnum_tobytes (yasm_arch *arch, const yasm_intnum *intn, unsigned char *buf, size_t destsize, size_t valsize, int shift, const yasm_bytecode *bc, int warn); + +/*@only@*/ yasm_bytecode *yasm_lc3b__create_empty_insn(yasm_arch *arch, + unsigned long line); + +void yasm_lc3b__ea_destroy(/*@only@*/ yasm_effaddr *ea); + #endif diff --git a/modules/arch/lc3b/lc3bbc.c b/modules/arch/lc3b/lc3bbc.c index e87aa8f5..35965248 100644 --- a/modules/arch/lc3b/lc3bbc.c +++ b/modules/arch/lc3b/lc3bbc.c @@ -37,8 +37,12 @@ static void lc3b_bc_insn_destroy(void *contents); static void lc3b_bc_insn_print(const void *contents, FILE *f, int indent_level); -static yasm_bc_resolve_flags lc3b_bc_insn_resolve - (yasm_bytecode *bc, int save, yasm_calc_bc_dist_func calc_bc_dist); +static int lc3b_bc_insn_calc_len(yasm_bytecode *bc, + yasm_bc_add_span_func add_span, + void *add_span_data); +static int lc3b_bc_insn_expand(yasm_bytecode *bc, int span, long old_val, + long new_val, /*@out@*/ long *neg_thres, + /*@out@*/ long *pos_thres); static int lc3b_bc_insn_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, yasm_output_value_func output_value, /*@null@*/ yasm_output_reloc_func output_reloc); @@ -49,7 +53,8 @@ static const yasm_bytecode_callback lc3b_bc_callback_insn = { lc3b_bc_insn_destroy, lc3b_bc_insn_print, yasm_bc_finalize_common, - lc3b_bc_insn_resolve, + lc3b_bc_insn_calc_len, + lc3b_bc_insn_expand, lc3b_bc_insn_tobytes, 0 }; @@ -123,56 +128,39 @@ lc3b_bc_insn_print(const void *contents, FILE *f, int indent_level) (unsigned int)insn->opcode); } -static yasm_bc_resolve_flags -lc3b_bc_insn_resolve(yasm_bytecode *bc, int save, - yasm_calc_bc_dist_func calc_bc_dist) +static int +lc3b_bc_insn_calc_len(yasm_bytecode *bc, yasm_bc_add_span_func add_span, + void *add_span_data) { lc3b_insn *insn = (lc3b_insn *)bc->contents; yasm_bytecode *target_prevbc; - /*@only@*/ yasm_intnum *num; - long rel; /* Fixed size instruction length */ - bc->len = 2; + bc->len += 2; - /* Only need to worry about out-of-range to PC-relative, and only if we're - * saving. - */ - if (insn->imm_type != LC3B_IMM_9_PC || !save) - return YASM_BC_RESOLVE_MIN_LEN; + /* Only need to worry about out-of-range to PC-relative */ + if (insn->imm_type != LC3B_IMM_9_PC) + return 0; - if (!insn->imm.rel) - num = yasm_intnum_create_uint(0); - else if (!yasm_symrec_get_label(insn->imm.rel, &target_prevbc) - || target_prevbc->section != insn->origin_prevbc->section - || !(num = calc_bc_dist(insn->origin_prevbc, target_prevbc))) { + if (insn->imm.rel + && (!yasm_symrec_get_label(insn->imm.rel, &target_prevbc) + || target_prevbc->section != bc->section)) { /* External or out of segment, so we can't check distance. */ - return YASM_BC_RESOLVE_MIN_LEN; + return 0; } - if (insn->imm.abs) { - /*@only@*/ yasm_expr *temp = yasm_expr_copy(insn->imm.abs); - /*@dependent@*/ /*@null@*/ yasm_intnum *num2; - num2 = yasm_expr_get_intnum(&temp, calc_bc_dist); - if (!num2) { - yasm_error_set(YASM_ERROR_TOO_COMPLEX, - N_("jump target too complex")); - yasm_expr_destroy(temp); - return YASM_BC_RESOLVE_ERROR | YASM_BC_RESOLVE_UNKNOWN_LEN; - } - yasm_intnum_calc(num, YASM_EXPR_ADD, num2); - yasm_expr_destroy(temp); - } - - rel = yasm_intnum_get_int(num); - yasm_intnum_destroy(num); - rel -= 2; /* 9-bit signed, word-multiple displacement */ - if (rel < -512 || rel > 511) { - yasm_error_set(YASM_ERROR_OVERFLOW, N_("target out of range")); - return YASM_BC_RESOLVE_ERROR | YASM_BC_RESOLVE_UNKNOWN_LEN; - } - return YASM_BC_RESOLVE_MIN_LEN; + add_span(add_span_data, bc, 1, &insn->imm, -512+(long)bc->len, + 511+(long)bc->len); + return 0; +} + +static int +lc3b_bc_insn_expand(yasm_bytecode *bc, int span, long old_val, long new_val, + /*@out@*/ long *neg_thres, /*@out@*/ long *pos_thres) +{ + yasm_error_set(YASM_ERROR_VALUE, N_("jump target out of range")); + return -1; } static int @@ -197,7 +185,8 @@ lc3b_bc_insn_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, break; case LC3B_IMM_5: insn->imm.size = 5; - if (output_value(&insn->imm, *bufp, 2, 0, bc, -1, d)) + insn->imm.sign = 1; + if (output_value(&insn->imm, *bufp, 2, 0, bc, 1, d)) return 1; break; case LC3B_IMM_6_WORD: @@ -207,7 +196,8 @@ lc3b_bc_insn_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, break; case LC3B_IMM_6_BYTE: insn->imm.size = 6; - if (output_value(&insn->imm, *bufp, 2, 0, bc, -1, d)) + insn->imm.sign = 1; + if (output_value(&insn->imm, *bufp, 2, 0, bc, 1, d)) return 1; break; case LC3B_IMM_8: @@ -228,7 +218,8 @@ lc3b_bc_insn_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, yasm_expr_int(delta), bc->line); insn->imm.size = 9; - if (output_value(&insn->imm, *bufp, 2, 0, bc, -1, d)) + insn->imm.sign = 1; + if (output_value(&insn->imm, *bufp, 2, 0, bc, 1, d)) return 1; break; case LC3B_IMM_9: diff --git a/modules/arch/lc3b/lc3bid.re b/modules/arch/lc3b/lc3bid.re index 2529664a..bfbf78b2 100644 --- a/modules/arch/lc3b/lc3bid.re +++ b/modules/arch/lc3b/lc3bid.re @@ -107,22 +107,41 @@ typedef struct lc3b_insn_info { unsigned int operands[3]; } lc3b_insn_info; -/* Define lexer arch-specific data with 0-3 modifiers. */ -#define DEF_INSN_DATA(group, mod) do { \ - data[0] = (unsigned long)group##_insn; \ - data[1] = ((mod)<<8) | \ - ((unsigned char)(sizeof(group##_insn)/sizeof(lc3b_insn_info))); \ - } while (0) +typedef struct lc3b_id_insn { + yasm_insn insn; /* base structure */ -#define RET_INSN(group, mod) do { \ - DEF_INSN_DATA(group, mod); \ - return YASM_ARCH_INSN; \ - } while (0) + /* instruction parse group - NULL if empty instruction (just prefixes) */ + /*@null@*/ const lc3b_insn_info *group; + + /* Modifier data */ + unsigned long mod_data; + + /* Number of elements in the instruction parse group */ + unsigned int num_info:8; +} lc3b_id_insn; + +static void lc3b_id_insn_destroy(void *contents); +static void lc3b_id_insn_print(const void *contents, FILE *f, int indent_level); +static void lc3b_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc); + +static const yasm_bytecode_callback lc3b_id_insn_callback = { + lc3b_id_insn_destroy, + lc3b_id_insn_print, + lc3b_id_insn_finalize, + yasm_bc_calc_len_common, + yasm_bc_expand_common, + yasm_bc_tobytes_common, + YASM_BC_SPECIAL_INSN +}; /* * Instruction groupings */ +static const lc3b_insn_info empty_insn[] = { + { 0, 0, 0, {0, 0, 0} } +}; + static const lc3b_insn_info addand_insn[] = { { MOD_OpHAdd, 0x1000, 3, {OPT_Reg|OPA_DR, OPT_Reg|OPA_SR, OPT_Reg|OPA_Imm|OPI_5} }, @@ -169,22 +188,20 @@ static const lc3b_insn_info trap_insn[] = { { 0, 0xF000, 1, {OPT_Imm|OPA_Imm|OPI_8, 0, 0} } }; -void -yasm_lc3b__finalize_insn(yasm_arch *arch, yasm_bytecode *bc, - yasm_bytecode *prev_bc, const unsigned long data[4], - int num_operands, - /*@null@*/ yasm_insn_operands *operands, - int num_prefixes, unsigned long **prefixes, - int num_segregs, const unsigned long *segregs) +static void +lc3b_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) { + lc3b_id_insn *id_insn = (lc3b_id_insn *)bc->contents; lc3b_insn *insn; - int num_info = (int)(data[1]&0xFF); - lc3b_insn_info *info = (lc3b_insn_info *)data[0]; - unsigned long mod_data = data[1] >> 8; + int num_info = id_insn->num_info; + const lc3b_insn_info *info = id_insn->group; + unsigned long mod_data = id_insn->mod_data; int found = 0; yasm_insn_operand *op; int i; + yasm_insn_finalize(&id_insn->insn); + /* Just do a simple linear search through the info array for a match. * First match wins. */ @@ -192,17 +209,18 @@ yasm_lc3b__finalize_insn(yasm_arch *arch, yasm_bytecode *bc, int mismatch = 0; /* Match # of operands */ - if (num_operands != info->num_operands) + if (id_insn->insn.num_operands != info->num_operands) continue; - if (!operands) { + if (id_insn->insn.num_operands == 0) { found = 1; /* no operands -> must have a match here. */ break; } /* Match each operand type and size */ - for(i = 0, op = yasm_ops_first(operands); op && inum_operands && - !mismatch; op = yasm_operand_next(op), i++) { + for(i = 0, op = yasm_insn_ops_first(&id_insn->insn); + op && inum_operands && !mismatch; + op = yasm_insn_op_next(op), i++) { /* Check operand type */ switch ((int)(info->operands[i] & OPT_MASK)) { case OPT_Imm: @@ -238,7 +256,6 @@ yasm_lc3b__finalize_insn(yasm_arch *arch, yasm_bytecode *bc, insn = yasm_xmalloc(sizeof(lc3b_insn)); yasm_value_initialize(&insn->imm, NULL, 0); insn->imm_type = LC3B_IMM_NONE; - insn->origin_prevbc = NULL; insn->opcode = info->opcode; /* Apply modifiers */ @@ -252,9 +269,9 @@ yasm_lc3b__finalize_insn(yasm_arch *arch, yasm_bytecode *bc, } /* Go through operands and assign */ - if (operands) { - for(i = 0, op = yasm_ops_first(operands); op && inum_operands; - op = yasm_operand_next(op), i++) { + if (id_insn->insn.num_operands > 0) { + for(i = 0, op = yasm_insn_ops_first(&id_insn->insn); + op && inum_operands; op = yasm_insn_op_next(op), i++) { switch ((int)(info->operands[i] & OPA_MASK)) { case OPA_None: @@ -285,7 +302,8 @@ yasm_lc3b__finalize_insn(yasm_arch *arch, yasm_bytecode *bc, yasm_expr_int(yasm_intnum_create_uint(1)), op->data.val->line); if (yasm_value_finalize_expr(&insn->imm, - op->data.val, 0)) + op->data.val, + prev_bc, 0)) yasm_error_set(YASM_ERROR_TOO_COMPLEX, N_("immediate expression too complex")); break; @@ -293,7 +311,7 @@ yasm_lc3b__finalize_insn(yasm_arch *arch, yasm_bytecode *bc, if (yasm_value_finalize_expr(&insn->imm, yasm_expr_create_ident(yasm_expr_int( yasm_intnum_create_uint(op->data.reg & 0x7)), - bc->line), 0)) + bc->line), prev_bc, 0)) yasm_internal_error(N_("reg expr too complex?")); break; default: @@ -303,10 +321,12 @@ yasm_lc3b__finalize_insn(yasm_arch *arch, yasm_bytecode *bc, default: yasm_internal_error(N_("unknown operand action")); } + + /* Clear so it doesn't get destroyed */ + op->type = YASM_INSN__OPERAND_REG; } if (insn->imm_type == LC3B_IMM_9_PC) { - insn->origin_prevbc = prev_bc; if (insn->imm.seg_of || insn->imm.rshift > 1 || insn->imm.curpos_rel) yasm_error_set(YASM_ERROR_VALUE, N_("invalid jump target")); @@ -325,14 +345,9 @@ yasm_lc3b__finalize_insn(yasm_arch *arch, yasm_bytecode *bc, #define YYMARKER marker #define YYFILL(n) (void)(n) -void -yasm_lc3b__parse_cpu(yasm_arch *arch, const char *cpuid, size_t cpuid_len) -{ -} - yasm_arch_regtmod -yasm_lc3b__parse_check_regtmod(yasm_arch *arch, unsigned long *data, - const char *oid, size_t id_len) +yasm_lc3b__parse_check_regtmod(yasm_arch *arch, const char *oid, size_t id_len, + uintptr_t *data) { const YYCTYPE *id = (const YYCTYPE *)oid; /*const char *marker;*/ @@ -353,11 +368,28 @@ yasm_lc3b__parse_check_regtmod(yasm_arch *arch, unsigned long *data, */ } +#define RET_INSN(g, m) \ + do { \ + group = g##_insn; \ + mod = m; \ + nelems = NELEMS(g##_insn); \ + goto done; \ + } while(0) + yasm_arch_insnprefix -yasm_lc3b__parse_check_insnprefix(yasm_arch *arch, unsigned long data[4], - const char *oid, size_t id_len) +yasm_lc3b__parse_check_insnprefix(yasm_arch *arch, const char *oid, + size_t id_len, unsigned long line, + yasm_bytecode **bc, uintptr_t *prefix) { const YYCTYPE *id = (const YYCTYPE *)oid; + const lc3b_insn_info *group = empty_insn; + unsigned long mod = 0; + unsigned int nelems = NELEMS(empty_insn); + lc3b_id_insn *id_insn; + + *bc = (yasm_bytecode *)NULL; + *prefix = 0; + /*const char *marker;*/ /*!re2c /* instructions */ @@ -407,4 +439,42 @@ yasm_lc3b__parse_check_insnprefix(yasm_arch *arch, unsigned long data[4], return YASM_ARCH_NOTINSNPREFIX; } */ + +done: + id_insn = yasm_xmalloc(sizeof(lc3b_id_insn)); + yasm_insn_initialize(&id_insn->insn); + id_insn->group = group; + id_insn->mod_data = mod; + id_insn->num_info = nelems; + *bc = yasm_bc_create_common(&lc3b_id_insn_callback, id_insn, line); + return YASM_ARCH_INSN; +} + +static void +lc3b_id_insn_destroy(void *contents) +{ + lc3b_id_insn *id_insn = (lc3b_id_insn *)contents; + yasm_insn_delete(&id_insn->insn, yasm_lc3b__ea_destroy); + yasm_xfree(contents); +} + +static void +lc3b_id_insn_print(const void *contents, FILE *f, int indent_level) +{ + const lc3b_id_insn *id_insn = (const lc3b_id_insn *)contents; + yasm_insn_print(&id_insn->insn, f, indent_level); + /*TODO*/ +} + +/*@only@*/ yasm_bytecode * +yasm_lc3b__create_empty_insn(yasm_arch *arch, unsigned long line) +{ + lc3b_id_insn *id_insn = yasm_xmalloc(sizeof(lc3b_id_insn)); + + yasm_insn_initialize(&id_insn->insn); + id_insn->group = empty_insn; + id_insn->mod_data = 0; + id_insn->num_info = NELEMS(empty_insn); + + return yasm_bc_create_common(&lc3b_id_insn_callback, id_insn, line); } From d88cc901967db6c3dd058faa7dc5c1b6364b717e Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Mon, 20 Aug 2007 05:16:33 +0000 Subject: [PATCH 049/585] Merge [1912], [1913], [1914] into multiarch branch. svn path=/branches/multiarch/; revision=1915 --- libyasm/coretype.h | 4 +- modules/arch/Makefile.inc | 2 +- modules/arch/lc3b/lc3barch.c | 52 +++++++----- modules/arch/lc3b/lc3barch.h | 23 +++--- modules/arch/lc3b/lc3bbc.c | 81 +++++++++---------- modules/arch/lc3b/lc3bid.re | 150 +++++++++++++++++++++++++---------- modules/arch/x86/x86bc.c | 6 +- 7 files changed, 192 insertions(+), 126 deletions(-) diff --git a/libyasm/coretype.h b/libyasm/coretype.h index 18dab291..60114e91 100644 --- a/libyasm/coretype.h +++ b/libyasm/coretype.h @@ -247,9 +247,7 @@ typedef enum yasm_expr_op { * \param bc current bytecode (usually passed into higher-level * calling function) * \param warn enables standard warnings: zero for none; - * nonzero for overflow/underflow floating point warnings; - * negative for signed integer warnings, - * positive for unsigned integer warnings + * nonzero for overflow/underflow floating point warnings * \param d objfmt-specific data (passed into higher-level calling * function) * \return Nonzero if an error occurred, 0 otherwise. diff --git a/modules/arch/Makefile.inc b/modules/arch/Makefile.inc index 7dc98dfc..1a9f9055 100644 --- a/modules/arch/Makefile.inc +++ b/modules/arch/Makefile.inc @@ -4,7 +4,7 @@ EXTRA_DIST += modules/arch/x86/Makefile.inc EXTRA_DIST += modules/arch/lc3b/Makefile.inc include modules/arch/x86/Makefile.inc -#include modules/arch/lc3b/Makefile.inc +include modules/arch/lc3b/Makefile.inc dist_man_MANS += yasm_arch.7 diff --git a/modules/arch/lc3b/lc3barch.c b/modules/arch/lc3b/lc3barch.c index 152f6f1f..e1835d0a 100644 --- a/modules/arch/lc3b/lc3barch.c +++ b/modules/arch/lc3b/lc3barch.c @@ -82,18 +82,6 @@ lc3b_set_var(yasm_arch *arch, const char *var, unsigned long val) return 1; } -static int -lc3b_parse_directive(/*@unused@*/ yasm_arch *arch, - /*@unused@*/ const char *name, - /*@unused@*/ /*@null@*/ yasm_valparamhead *valparams, - /*@unused@*/ /*@null@*/ - yasm_valparamhead *objext_valparams, - /*@unused@*/ yasm_object *object, - /*@unused@*/ unsigned long line) -{ - return 1; -} - static const unsigned char ** lc3b_get_fill(const yasm_arch *arch) { @@ -131,21 +119,21 @@ lc3b_get_fill(const yasm_arch *arch) } static unsigned int -lc3b_get_reg_size(/*@unused@*/ yasm_arch *arch, /*@unused@*/ unsigned long reg) +lc3b_get_reg_size(/*@unused@*/ yasm_arch *arch, /*@unused@*/ uintptr_t reg) { return 16; } -static unsigned long +static uintptr_t lc3b_reggroup_get_reg(/*@unused@*/ yasm_arch *arch, - /*@unused@*/ unsigned long reggroup, + /*@unused@*/ uintptr_t reggroup, /*@unused@*/ unsigned long regindex) { return 0; } static void -lc3b_reg_print(/*@unused@*/ yasm_arch *arch, unsigned long reg, FILE *f) +lc3b_reg_print(/*@unused@*/ yasm_arch *arch, uintptr_t reg, FILE *f) { fprintf(f, "r%u", (unsigned int)(reg&7)); } @@ -163,8 +151,28 @@ lc3b_floatnum_tobytes(yasm_arch *arch, const yasm_floatnum *flt, static yasm_effaddr * lc3b_ea_create_expr(yasm_arch *arch, yasm_expr *e) { - yasm_expr_destroy(e); - return NULL; + yasm_effaddr *ea = yasm_xmalloc(sizeof(yasm_effaddr)); + yasm_value_initialize(&ea->disp, e, 0); + ea->need_nonzero_len = 0; + ea->need_disp = 1; + ea->nosplit = 0; + ea->strong = 0; + ea->segreg = 0; + return ea; +} + +void +yasm_lc3b__ea_destroy(/*@only@*/ yasm_effaddr *ea) +{ + yasm_value_delete(&ea->disp); + yasm_xfree(ea); +} + +static void +lc3b_ea_print(const yasm_effaddr *ea, FILE *f, int indent_level) +{ + fprintf(f, "%*sDisp:\n", indent_level, ""); + yasm_value_print(&ea->disp, f, indent_level+1); } /* Define lc3b machines -- see arch.h for details */ @@ -177,17 +185,15 @@ static yasm_arch_machine lc3b_machines[] = { yasm_arch_module yasm_lc3b_LTX_arch = { "LC-3b", "lc3b", + NULL, lc3b_create, lc3b_destroy, lc3b_get_machine, lc3b_get_address_size, lc3b_set_var, - yasm_lc3b__parse_cpu, yasm_lc3b__parse_check_insnprefix, yasm_lc3b__parse_check_regtmod, - lc3b_parse_directive, lc3b_get_fill, - yasm_lc3b__finalize_insn, lc3b_floatnum_tobytes, yasm_lc3b__intnum_tobytes, lc3b_get_reg_size, @@ -195,9 +201,11 @@ yasm_arch_module yasm_lc3b_LTX_arch = { lc3b_reg_print, NULL, /*yasm_lc3b__segreg_print*/ lc3b_ea_create_expr, + yasm_lc3b__ea_destroy, + lc3b_ea_print, + yasm_lc3b__create_empty_insn, lc3b_machines, "lc3b", 16, - 512, 2 }; diff --git a/modules/arch/lc3b/lc3barch.h b/modules/arch/lc3b/lc3barch.h index ff7d97e4..4de0c45d 100644 --- a/modules/arch/lc3b/lc3barch.h +++ b/modules/arch/lc3b/lc3barch.h @@ -45,29 +45,26 @@ typedef struct lc3b_insn { yasm_value imm; /* immediate or relative value */ lc3b_imm_type imm_type; /* size of the immediate */ - /* PC origin if needed */ - /*@null@*/ /*@dependent@*/ yasm_bytecode *origin_prevbc; - unsigned int opcode; /* opcode */ } lc3b_insn; void yasm_lc3b__bc_transform_insn(yasm_bytecode *bc, lc3b_insn *insn); -void yasm_lc3b__parse_cpu(yasm_arch *arch, const char *cpuid, size_t cpuid_len); - yasm_arch_insnprefix yasm_lc3b__parse_check_insnprefix - (yasm_arch *arch, unsigned long data[4], const char *id, size_t id_len); + (yasm_arch *arch, const char *id, size_t id_len, unsigned long line, + /*@out@*/ /*@only@*/ yasm_bytecode **bc, /*@out@*/ uintptr_t *prefix); yasm_arch_regtmod yasm_lc3b__parse_check_regtmod - (yasm_arch *arch, unsigned long *data, const char *id, size_t id_len); - -void yasm_lc3b__finalize_insn - (yasm_arch *arch, yasm_bytecode *bc, yasm_bytecode *prev_bc, - const unsigned long data[4], int num_operands, - /*@null@*/ yasm_insn_operands *operands, int num_prefixes, - unsigned long **prefixes, int num_segregs, const unsigned long *segregs); + (yasm_arch *arch, const char *id, size_t id_len, + /*@out@*/ uintptr_t *data); int yasm_lc3b__intnum_tobytes (yasm_arch *arch, const yasm_intnum *intn, unsigned char *buf, size_t destsize, size_t valsize, int shift, const yasm_bytecode *bc, int warn); + +/*@only@*/ yasm_bytecode *yasm_lc3b__create_empty_insn(yasm_arch *arch, + unsigned long line); + +void yasm_lc3b__ea_destroy(/*@only@*/ yasm_effaddr *ea); + #endif diff --git a/modules/arch/lc3b/lc3bbc.c b/modules/arch/lc3b/lc3bbc.c index e87aa8f5..35965248 100644 --- a/modules/arch/lc3b/lc3bbc.c +++ b/modules/arch/lc3b/lc3bbc.c @@ -37,8 +37,12 @@ static void lc3b_bc_insn_destroy(void *contents); static void lc3b_bc_insn_print(const void *contents, FILE *f, int indent_level); -static yasm_bc_resolve_flags lc3b_bc_insn_resolve - (yasm_bytecode *bc, int save, yasm_calc_bc_dist_func calc_bc_dist); +static int lc3b_bc_insn_calc_len(yasm_bytecode *bc, + yasm_bc_add_span_func add_span, + void *add_span_data); +static int lc3b_bc_insn_expand(yasm_bytecode *bc, int span, long old_val, + long new_val, /*@out@*/ long *neg_thres, + /*@out@*/ long *pos_thres); static int lc3b_bc_insn_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, yasm_output_value_func output_value, /*@null@*/ yasm_output_reloc_func output_reloc); @@ -49,7 +53,8 @@ static const yasm_bytecode_callback lc3b_bc_callback_insn = { lc3b_bc_insn_destroy, lc3b_bc_insn_print, yasm_bc_finalize_common, - lc3b_bc_insn_resolve, + lc3b_bc_insn_calc_len, + lc3b_bc_insn_expand, lc3b_bc_insn_tobytes, 0 }; @@ -123,56 +128,39 @@ lc3b_bc_insn_print(const void *contents, FILE *f, int indent_level) (unsigned int)insn->opcode); } -static yasm_bc_resolve_flags -lc3b_bc_insn_resolve(yasm_bytecode *bc, int save, - yasm_calc_bc_dist_func calc_bc_dist) +static int +lc3b_bc_insn_calc_len(yasm_bytecode *bc, yasm_bc_add_span_func add_span, + void *add_span_data) { lc3b_insn *insn = (lc3b_insn *)bc->contents; yasm_bytecode *target_prevbc; - /*@only@*/ yasm_intnum *num; - long rel; /* Fixed size instruction length */ - bc->len = 2; + bc->len += 2; - /* Only need to worry about out-of-range to PC-relative, and only if we're - * saving. - */ - if (insn->imm_type != LC3B_IMM_9_PC || !save) - return YASM_BC_RESOLVE_MIN_LEN; + /* Only need to worry about out-of-range to PC-relative */ + if (insn->imm_type != LC3B_IMM_9_PC) + return 0; - if (!insn->imm.rel) - num = yasm_intnum_create_uint(0); - else if (!yasm_symrec_get_label(insn->imm.rel, &target_prevbc) - || target_prevbc->section != insn->origin_prevbc->section - || !(num = calc_bc_dist(insn->origin_prevbc, target_prevbc))) { + if (insn->imm.rel + && (!yasm_symrec_get_label(insn->imm.rel, &target_prevbc) + || target_prevbc->section != bc->section)) { /* External or out of segment, so we can't check distance. */ - return YASM_BC_RESOLVE_MIN_LEN; + return 0; } - if (insn->imm.abs) { - /*@only@*/ yasm_expr *temp = yasm_expr_copy(insn->imm.abs); - /*@dependent@*/ /*@null@*/ yasm_intnum *num2; - num2 = yasm_expr_get_intnum(&temp, calc_bc_dist); - if (!num2) { - yasm_error_set(YASM_ERROR_TOO_COMPLEX, - N_("jump target too complex")); - yasm_expr_destroy(temp); - return YASM_BC_RESOLVE_ERROR | YASM_BC_RESOLVE_UNKNOWN_LEN; - } - yasm_intnum_calc(num, YASM_EXPR_ADD, num2); - yasm_expr_destroy(temp); - } - - rel = yasm_intnum_get_int(num); - yasm_intnum_destroy(num); - rel -= 2; /* 9-bit signed, word-multiple displacement */ - if (rel < -512 || rel > 511) { - yasm_error_set(YASM_ERROR_OVERFLOW, N_("target out of range")); - return YASM_BC_RESOLVE_ERROR | YASM_BC_RESOLVE_UNKNOWN_LEN; - } - return YASM_BC_RESOLVE_MIN_LEN; + add_span(add_span_data, bc, 1, &insn->imm, -512+(long)bc->len, + 511+(long)bc->len); + return 0; +} + +static int +lc3b_bc_insn_expand(yasm_bytecode *bc, int span, long old_val, long new_val, + /*@out@*/ long *neg_thres, /*@out@*/ long *pos_thres) +{ + yasm_error_set(YASM_ERROR_VALUE, N_("jump target out of range")); + return -1; } static int @@ -197,7 +185,8 @@ lc3b_bc_insn_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, break; case LC3B_IMM_5: insn->imm.size = 5; - if (output_value(&insn->imm, *bufp, 2, 0, bc, -1, d)) + insn->imm.sign = 1; + if (output_value(&insn->imm, *bufp, 2, 0, bc, 1, d)) return 1; break; case LC3B_IMM_6_WORD: @@ -207,7 +196,8 @@ lc3b_bc_insn_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, break; case LC3B_IMM_6_BYTE: insn->imm.size = 6; - if (output_value(&insn->imm, *bufp, 2, 0, bc, -1, d)) + insn->imm.sign = 1; + if (output_value(&insn->imm, *bufp, 2, 0, bc, 1, d)) return 1; break; case LC3B_IMM_8: @@ -228,7 +218,8 @@ lc3b_bc_insn_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, yasm_expr_int(delta), bc->line); insn->imm.size = 9; - if (output_value(&insn->imm, *bufp, 2, 0, bc, -1, d)) + insn->imm.sign = 1; + if (output_value(&insn->imm, *bufp, 2, 0, bc, 1, d)) return 1; break; case LC3B_IMM_9: diff --git a/modules/arch/lc3b/lc3bid.re b/modules/arch/lc3b/lc3bid.re index 2529664a..bfbf78b2 100644 --- a/modules/arch/lc3b/lc3bid.re +++ b/modules/arch/lc3b/lc3bid.re @@ -107,22 +107,41 @@ typedef struct lc3b_insn_info { unsigned int operands[3]; } lc3b_insn_info; -/* Define lexer arch-specific data with 0-3 modifiers. */ -#define DEF_INSN_DATA(group, mod) do { \ - data[0] = (unsigned long)group##_insn; \ - data[1] = ((mod)<<8) | \ - ((unsigned char)(sizeof(group##_insn)/sizeof(lc3b_insn_info))); \ - } while (0) +typedef struct lc3b_id_insn { + yasm_insn insn; /* base structure */ -#define RET_INSN(group, mod) do { \ - DEF_INSN_DATA(group, mod); \ - return YASM_ARCH_INSN; \ - } while (0) + /* instruction parse group - NULL if empty instruction (just prefixes) */ + /*@null@*/ const lc3b_insn_info *group; + + /* Modifier data */ + unsigned long mod_data; + + /* Number of elements in the instruction parse group */ + unsigned int num_info:8; +} lc3b_id_insn; + +static void lc3b_id_insn_destroy(void *contents); +static void lc3b_id_insn_print(const void *contents, FILE *f, int indent_level); +static void lc3b_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc); + +static const yasm_bytecode_callback lc3b_id_insn_callback = { + lc3b_id_insn_destroy, + lc3b_id_insn_print, + lc3b_id_insn_finalize, + yasm_bc_calc_len_common, + yasm_bc_expand_common, + yasm_bc_tobytes_common, + YASM_BC_SPECIAL_INSN +}; /* * Instruction groupings */ +static const lc3b_insn_info empty_insn[] = { + { 0, 0, 0, {0, 0, 0} } +}; + static const lc3b_insn_info addand_insn[] = { { MOD_OpHAdd, 0x1000, 3, {OPT_Reg|OPA_DR, OPT_Reg|OPA_SR, OPT_Reg|OPA_Imm|OPI_5} }, @@ -169,22 +188,20 @@ static const lc3b_insn_info trap_insn[] = { { 0, 0xF000, 1, {OPT_Imm|OPA_Imm|OPI_8, 0, 0} } }; -void -yasm_lc3b__finalize_insn(yasm_arch *arch, yasm_bytecode *bc, - yasm_bytecode *prev_bc, const unsigned long data[4], - int num_operands, - /*@null@*/ yasm_insn_operands *operands, - int num_prefixes, unsigned long **prefixes, - int num_segregs, const unsigned long *segregs) +static void +lc3b_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) { + lc3b_id_insn *id_insn = (lc3b_id_insn *)bc->contents; lc3b_insn *insn; - int num_info = (int)(data[1]&0xFF); - lc3b_insn_info *info = (lc3b_insn_info *)data[0]; - unsigned long mod_data = data[1] >> 8; + int num_info = id_insn->num_info; + const lc3b_insn_info *info = id_insn->group; + unsigned long mod_data = id_insn->mod_data; int found = 0; yasm_insn_operand *op; int i; + yasm_insn_finalize(&id_insn->insn); + /* Just do a simple linear search through the info array for a match. * First match wins. */ @@ -192,17 +209,18 @@ yasm_lc3b__finalize_insn(yasm_arch *arch, yasm_bytecode *bc, int mismatch = 0; /* Match # of operands */ - if (num_operands != info->num_operands) + if (id_insn->insn.num_operands != info->num_operands) continue; - if (!operands) { + if (id_insn->insn.num_operands == 0) { found = 1; /* no operands -> must have a match here. */ break; } /* Match each operand type and size */ - for(i = 0, op = yasm_ops_first(operands); op && inum_operands && - !mismatch; op = yasm_operand_next(op), i++) { + for(i = 0, op = yasm_insn_ops_first(&id_insn->insn); + op && inum_operands && !mismatch; + op = yasm_insn_op_next(op), i++) { /* Check operand type */ switch ((int)(info->operands[i] & OPT_MASK)) { case OPT_Imm: @@ -238,7 +256,6 @@ yasm_lc3b__finalize_insn(yasm_arch *arch, yasm_bytecode *bc, insn = yasm_xmalloc(sizeof(lc3b_insn)); yasm_value_initialize(&insn->imm, NULL, 0); insn->imm_type = LC3B_IMM_NONE; - insn->origin_prevbc = NULL; insn->opcode = info->opcode; /* Apply modifiers */ @@ -252,9 +269,9 @@ yasm_lc3b__finalize_insn(yasm_arch *arch, yasm_bytecode *bc, } /* Go through operands and assign */ - if (operands) { - for(i = 0, op = yasm_ops_first(operands); op && inum_operands; - op = yasm_operand_next(op), i++) { + if (id_insn->insn.num_operands > 0) { + for(i = 0, op = yasm_insn_ops_first(&id_insn->insn); + op && inum_operands; op = yasm_insn_op_next(op), i++) { switch ((int)(info->operands[i] & OPA_MASK)) { case OPA_None: @@ -285,7 +302,8 @@ yasm_lc3b__finalize_insn(yasm_arch *arch, yasm_bytecode *bc, yasm_expr_int(yasm_intnum_create_uint(1)), op->data.val->line); if (yasm_value_finalize_expr(&insn->imm, - op->data.val, 0)) + op->data.val, + prev_bc, 0)) yasm_error_set(YASM_ERROR_TOO_COMPLEX, N_("immediate expression too complex")); break; @@ -293,7 +311,7 @@ yasm_lc3b__finalize_insn(yasm_arch *arch, yasm_bytecode *bc, if (yasm_value_finalize_expr(&insn->imm, yasm_expr_create_ident(yasm_expr_int( yasm_intnum_create_uint(op->data.reg & 0x7)), - bc->line), 0)) + bc->line), prev_bc, 0)) yasm_internal_error(N_("reg expr too complex?")); break; default: @@ -303,10 +321,12 @@ yasm_lc3b__finalize_insn(yasm_arch *arch, yasm_bytecode *bc, default: yasm_internal_error(N_("unknown operand action")); } + + /* Clear so it doesn't get destroyed */ + op->type = YASM_INSN__OPERAND_REG; } if (insn->imm_type == LC3B_IMM_9_PC) { - insn->origin_prevbc = prev_bc; if (insn->imm.seg_of || insn->imm.rshift > 1 || insn->imm.curpos_rel) yasm_error_set(YASM_ERROR_VALUE, N_("invalid jump target")); @@ -325,14 +345,9 @@ yasm_lc3b__finalize_insn(yasm_arch *arch, yasm_bytecode *bc, #define YYMARKER marker #define YYFILL(n) (void)(n) -void -yasm_lc3b__parse_cpu(yasm_arch *arch, const char *cpuid, size_t cpuid_len) -{ -} - yasm_arch_regtmod -yasm_lc3b__parse_check_regtmod(yasm_arch *arch, unsigned long *data, - const char *oid, size_t id_len) +yasm_lc3b__parse_check_regtmod(yasm_arch *arch, const char *oid, size_t id_len, + uintptr_t *data) { const YYCTYPE *id = (const YYCTYPE *)oid; /*const char *marker;*/ @@ -353,11 +368,28 @@ yasm_lc3b__parse_check_regtmod(yasm_arch *arch, unsigned long *data, */ } +#define RET_INSN(g, m) \ + do { \ + group = g##_insn; \ + mod = m; \ + nelems = NELEMS(g##_insn); \ + goto done; \ + } while(0) + yasm_arch_insnprefix -yasm_lc3b__parse_check_insnprefix(yasm_arch *arch, unsigned long data[4], - const char *oid, size_t id_len) +yasm_lc3b__parse_check_insnprefix(yasm_arch *arch, const char *oid, + size_t id_len, unsigned long line, + yasm_bytecode **bc, uintptr_t *prefix) { const YYCTYPE *id = (const YYCTYPE *)oid; + const lc3b_insn_info *group = empty_insn; + unsigned long mod = 0; + unsigned int nelems = NELEMS(empty_insn); + lc3b_id_insn *id_insn; + + *bc = (yasm_bytecode *)NULL; + *prefix = 0; + /*const char *marker;*/ /*!re2c /* instructions */ @@ -407,4 +439,42 @@ yasm_lc3b__parse_check_insnprefix(yasm_arch *arch, unsigned long data[4], return YASM_ARCH_NOTINSNPREFIX; } */ + +done: + id_insn = yasm_xmalloc(sizeof(lc3b_id_insn)); + yasm_insn_initialize(&id_insn->insn); + id_insn->group = group; + id_insn->mod_data = mod; + id_insn->num_info = nelems; + *bc = yasm_bc_create_common(&lc3b_id_insn_callback, id_insn, line); + return YASM_ARCH_INSN; +} + +static void +lc3b_id_insn_destroy(void *contents) +{ + lc3b_id_insn *id_insn = (lc3b_id_insn *)contents; + yasm_insn_delete(&id_insn->insn, yasm_lc3b__ea_destroy); + yasm_xfree(contents); +} + +static void +lc3b_id_insn_print(const void *contents, FILE *f, int indent_level) +{ + const lc3b_id_insn *id_insn = (const lc3b_id_insn *)contents; + yasm_insn_print(&id_insn->insn, f, indent_level); + /*TODO*/ +} + +/*@only@*/ yasm_bytecode * +yasm_lc3b__create_empty_insn(yasm_arch *arch, unsigned long line) +{ + lc3b_id_insn *id_insn = yasm_xmalloc(sizeof(lc3b_id_insn)); + + yasm_insn_initialize(&id_insn->insn); + id_insn->group = empty_insn; + id_insn->mod_data = 0; + id_insn->num_info = NELEMS(empty_insn); + + return yasm_bc_create_common(&lc3b_id_insn_callback, id_insn, line); } diff --git a/modules/arch/x86/x86bc.c b/modules/arch/x86/x86bc.c index e574f935..a01031d9 100644 --- a/modules/arch/x86/x86bc.c +++ b/modules/arch/x86/x86bc.c @@ -892,8 +892,9 @@ x86_bc_jmp_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, yasm_expr_int(delta), bc->line); jmp->target.size = 8; + jmp->target.sign = 1; if (output_value(&jmp->target, *bufp, 1, - (unsigned long)(*bufp-bufp_orig), bc, -1, d)) + (unsigned long)(*bufp-bufp_orig), bc, 1, d)) return 1; *bufp += 1; break; @@ -923,8 +924,9 @@ x86_bc_jmp_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, yasm_expr_int(delta), bc->line); jmp->target.size = i*8; + jmp->target.sign = 1; if (output_value(&jmp->target, *bufp, i, - (unsigned long)(*bufp-bufp_orig), bc, -1, d)) + (unsigned long)(*bufp-bufp_orig), bc, 1, d)) return 1; *bufp += i; break; From 4f95e619614701b82e5c820e3521c048db30a5ba Mon Sep 17 00:00:00 2001 From: paulbarker Date: Wed, 29 Aug 2007 11:33:05 +0000 Subject: [PATCH 050/585] Initial version of cpp module (on multiarch branch). svn path=/branches/multiarch/; revision=1916 --- modules/parsers/gas/gas-parser.c | 1 + modules/preprocs/Makefile.inc | 2 + modules/preprocs/cpp/Makefile.inc | 6 + modules/preprocs/cpp/cpp-preproc.c | 296 +++++++++++++++++++++++++++++ 4 files changed, 305 insertions(+) create mode 100644 modules/preprocs/cpp/Makefile.inc create mode 100644 modules/preprocs/cpp/cpp-preproc.c diff --git a/modules/parsers/gas/gas-parser.c b/modules/parsers/gas/gas-parser.c index 9cc61382..df51dc59 100644 --- a/modules/parsers/gas/gas-parser.c +++ b/modules/parsers/gas/gas-parser.c @@ -112,6 +112,7 @@ gas_parser_do_parse(yasm_object *object, yasm_preproc *pp, FILE *f, /* Define valid preprocessors to use with this parser */ static const char *gas_parser_preproc_keywords[] = { "raw", + "cpp", NULL }; diff --git a/modules/preprocs/Makefile.inc b/modules/preprocs/Makefile.inc index 04145581..8d3f7cfd 100644 --- a/modules/preprocs/Makefile.inc +++ b/modules/preprocs/Makefile.inc @@ -2,6 +2,8 @@ EXTRA_DIST += modules/preprocs/nasm/Makefile.inc EXTRA_DIST += modules/preprocs/raw/Makefile.inc +EXTRA_DIST += modules/preprocs/cpp/Makefile.inc include modules/preprocs/nasm/Makefile.inc include modules/preprocs/raw/Makefile.inc +include modules/preprocs/cpp/Makefile.inc diff --git a/modules/preprocs/cpp/Makefile.inc b/modules/preprocs/cpp/Makefile.inc new file mode 100644 index 00000000..30bd24b3 --- /dev/null +++ b/modules/preprocs/cpp/Makefile.inc @@ -0,0 +1,6 @@ +# Makefile for cpp module. +# Copied from raw preprocessor module. + +libyasm_a_SOURCES += modules/preprocs/cpp/cpp-preproc.c + +YASM_MODULES += preproc_cpp diff --git a/modules/preprocs/cpp/cpp-preproc.c b/modules/preprocs/cpp/cpp-preproc.c new file mode 100644 index 00000000..bd0f4a46 --- /dev/null +++ b/modules/preprocs/cpp/cpp-preproc.c @@ -0,0 +1,296 @@ +/* + * Invoke an external C preprocessor + * + * Copyright (C) 2007 Paul Barker + * Copyright (C) 2001-2007 Peter Johnson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include + +/* TODO: Find some non-arbitrary values for these constants. */ +#define TMP_BUF_SIZE 4096 +#define CMDLINE_SIZE 32770 + +extern int isatty(int); + +/* Flags. */ +#define CPP_HAS_BEEN_INVOKED 0x01 + +typedef struct cpp_arg_entry { + TAILQ_ENTRY(cpp_arg_entry) entry; + + char *op; + char *param; +} cpp_arg_entry; + +typedef struct yasm_preproc_cpp { + yasm_preproc_base preproc; /* base structure */ + + TAILQ_HEAD(, cpp_arg_entry) cpp_args; + cpp_arg_entry *pos; + + FILE *f_in, *f_out; + yasm_linemap *cur_lm; + yasm_errwarns *errwarns; + + int flags; +} yasm_preproc_cpp; + +yasm_preproc_module yasm_cpp_LTX_preproc; + +/* TODO: Make these filenames safer and more portable, maybe using tmpnam()? */ +static const char *in_filename = ".cpp.in"; +static const char *out_filename = ".cpp.out"; + +/* Invoke the c preprocessor. */ +static void +cpp_invoke(yasm_preproc_cpp *pp) +{ + int r; + char *cmdline, *p, *limit, *tmp; + cpp_arg_entry *arg; + size_t op_len, param_len, sz; + + /* Initialize command line. */ + cmdline = p = yasm_xmalloc(CMDLINE_SIZE); + limit = p + CMDLINE_SIZE; + strcpy(p, "cpp"); + p += 3; + + /* Append arguments from the list. */ + TAILQ_FOREACH(arg, (&pp->cpp_args), entry) { + /* + We need a space before arg->op and a space before arg->param, so + 2 extra characters. + */ + op_len = strlen(arg->op); + param_len = strlen(arg->param); + sz = op_len + param_len + 2; + + if (p + sz >= limit) + yasm__fatal("command line too long"); + + *p++ = ' '; + strcpy(p, arg->op); + p += op_len; + *p++ = ' '; + strcpy(p, arg->param); + p += param_len; + + yasm_xfree(arg->param); + } + + /* Append final arguments. */ + r = asprintf(&tmp, " -x assembler-with-cpp -o %s %s", + out_filename, in_filename); + if (r == -1) + yasm__fatal("failed to construct command line for cpp"); + + /* r is the length of the string stored in tmp. */ + if (p + r + 1 >= limit) + yasm__fatal("command line too long"); + + strcpy(p, tmp); + yasm_xfree(tmp); + p += r; + *p = '\0'; + +#if 0 + /* Print the command line before executing. */ + printf("%s\n", cmdline); +#endif + r = system(cmdline); + if (r) + yasm__fatal("C preprocessor failed"); + + yasm_xfree(cmdline); +} + +static yasm_preproc * +cpp_preproc_create(FILE *f, const char *in, yasm_linemap *lm, + yasm_errwarns *errwarns) +{ + yasm_preproc_cpp *pp = yasm_xmalloc(sizeof(yasm_preproc_cpp)); + + pp->preproc.module = &yasm_cpp_LTX_preproc; + pp->f_in = f; + pp->f_out = NULL; + pp->cur_lm = lm; + pp->errwarns = errwarns; + pp->flags = 0; + + pp->pos = NULL; + TAILQ_INIT(&pp->cpp_args); + + return (yasm_preproc *)pp; +} + +static void +cpp_preproc_destroy(yasm_preproc *preproc) +{ + yasm_preproc_cpp *pp = (yasm_preproc_cpp *)preproc; + + if (pp->f_out) { + fclose(pp->f_out); + } + + /* Remove both temporary files. */ + remove(in_filename); + remove(out_filename); + + yasm_xfree(preproc); +} + +static size_t +cpp_preproc_input(yasm_preproc *preproc, char *buf, size_t max_size) +{ + size_t n; + FILE *f_tmp; + int tty; + char *tmp_buf; + yasm_preproc_cpp *pp = (yasm_preproc_cpp *)preproc; + + if (! (pp->flags & CPP_HAS_BEEN_INVOKED) ) { + pp->flags |= CPP_HAS_BEEN_INVOKED; + + tmp_buf = (char *)yasm_xmalloc(TMP_BUF_SIZE); + + f_tmp = fopen(in_filename, "w"); + + tty = (isatty(fileno(f_tmp)) > 0); + while (!feof(pp->f_in)) { + if (tty) { + /* TODO: Handle reading from tty into tmp_buf. */ + yasm__fatal("incapable of reading from a tty"); + } else { + if (((n = fread(tmp_buf, 1, TMP_BUF_SIZE, pp->f_in)) == 0) && + ferror(pp->f_in)) { + yasm_error_set(YASM_ERROR_IO, + N_("error when reading from input file")); + yasm_errwarn_propagate(pp->errwarns, + yasm_linemap_get_current(pp->cur_lm)); + } + } + + if (fwrite(tmp_buf, 1, n, f_tmp) != n) { + yasm__fatal("error writing to temporary file"); + } + } + + yasm_xfree(tmp_buf); + fclose(f_tmp); + + cpp_invoke(pp); + + pp->f_out = fopen(out_filename, "r"); + + if (!pp->f_out) { + yasm__fatal("Could not open preprocessed file \"%s\"", out_filename); + } + } + + /* + Once the preprocessor has been run, we're just dealing with a normal + file. + */ + if (((n = fread(buf, 1, max_size, pp->f_out)) == 0) && + ferror(pp->f_out)) { + yasm_error_set(YASM_ERROR_IO, N_("error when reading from preprocessed file")); + yasm_errwarn_propagate(pp->errwarns, + yasm_linemap_get_current(pp->cur_lm)); + } + + return n; +} + +static size_t +cpp_preproc_get_included_file(yasm_preproc *preproc, char *buf, + size_t max_size) +{ + /* TODO */ + + return 0; +} + +static void +cpp_preproc_add_include_file(yasm_preproc *preproc, const char *filename) +{ + yasm_preproc_cpp *pp = (yasm_preproc_cpp *)preproc; + + cpp_arg_entry *arg = yasm_xmalloc(sizeof(cpp_arg_entry)); + arg->op = "-include"; + arg->param = yasm__xstrdup(filename); + + TAILQ_INSERT_TAIL(&pp->cpp_args, arg, entry); +} + +static void +cpp_preproc_predefine_macro(yasm_preproc *preproc, const char *macronameval) +{ + yasm_preproc_cpp *pp = (yasm_preproc_cpp *)preproc; + + cpp_arg_entry *arg = yasm_xmalloc(sizeof(cpp_arg_entry)); + arg->op = "-D"; + arg->param = yasm__xstrdup(macronameval); + + TAILQ_INSERT_TAIL(&pp->cpp_args, arg, entry); +} + +static void +cpp_preproc_undefine_macro(yasm_preproc *preproc, const char *macroname) +{ + yasm_preproc_cpp *pp = (yasm_preproc_cpp *)preproc; + + cpp_arg_entry *arg = yasm_xmalloc(sizeof(cpp_arg_entry)); + arg->op = "-U"; + arg->param = yasm__xstrdup(macroname); + + TAILQ_INSERT_TAIL(&pp->cpp_args, arg, entry); +} + +static void +cpp_preproc_define_builtin(yasm_preproc *preproc, const char *macronameval) +{ + /* Handle a builtin as if it were a predefine. */ + cpp_preproc_predefine_macro(preproc, macronameval); +} + +yasm_preproc_module yasm_cpp_LTX_preproc = { + "Run input through enternal C preprocessor", + "cpp", + cpp_preproc_create, + cpp_preproc_destroy, + cpp_preproc_input, + cpp_preproc_get_included_file, + cpp_preproc_add_include_file, + cpp_preproc_predefine_macro, + cpp_preproc_undefine_macro, + cpp_preproc_define_builtin +}; + +/* + TODO: We will need to pass the list of include directories to the external + preprocessor. +*/ From 09403aea2a2b3d81371cb804f25a164f059613d3 Mon Sep 17 00:00:00 2001 From: paulbarker Date: Wed, 29 Aug 2007 12:23:39 +0000 Subject: [PATCH 051/585] Cleaned up cpp_invoke() function and removed call to asprintf(). svn path=/branches/multiarch/; revision=1917 --- modules/preprocs/cpp/cpp-preproc.c | 55 +++++++++++++----------------- 1 file changed, 24 insertions(+), 31 deletions(-) diff --git a/modules/preprocs/cpp/cpp-preproc.c b/modules/preprocs/cpp/cpp-preproc.c index bd0f4a46..e22e3404 100644 --- a/modules/preprocs/cpp/cpp-preproc.c +++ b/modules/preprocs/cpp/cpp-preproc.c @@ -64,6 +64,18 @@ yasm_preproc_module yasm_cpp_LTX_preproc; static const char *in_filename = ".cpp.in"; static const char *out_filename = ".cpp.out"; +/* + Append a string to the command line, ensuring that we don't overflow the + buffer. +*/ +#define APPEND(s) do { \ + size_t _len = strlen(s); \ + if (p + _len >= limit) \ + yasm__fatal("command line too long!"); \ + strcpy(p, s); \ + p += _len; \ +} while (0) + /* Invoke the c preprocessor. */ static void cpp_invoke(yasm_preproc_cpp *pp) @@ -73,7 +85,10 @@ cpp_invoke(yasm_preproc_cpp *pp) cpp_arg_entry *arg; size_t op_len, param_len, sz; - /* Initialize command line. */ + /* + Initialize command line. We can assume there will be enough space to + store "cpp". + */ cmdline = p = yasm_xmalloc(CMDLINE_SIZE); limit = p + CMDLINE_SIZE; strcpy(p, "cpp"); @@ -81,41 +96,19 @@ cpp_invoke(yasm_preproc_cpp *pp) /* Append arguments from the list. */ TAILQ_FOREACH(arg, (&pp->cpp_args), entry) { - /* - We need a space before arg->op and a space before arg->param, so - 2 extra characters. - */ - op_len = strlen(arg->op); - param_len = strlen(arg->param); - sz = op_len + param_len + 2; - - if (p + sz >= limit) - yasm__fatal("command line too long"); - - *p++ = ' '; - strcpy(p, arg->op); - p += op_len; - *p++ = ' '; - strcpy(p, arg->param); - p += param_len; + APPEND(" "); + APPEND(arg->op); + APPEND(" "); + APPEND(arg->param); yasm_xfree(arg->param); } /* Append final arguments. */ - r = asprintf(&tmp, " -x assembler-with-cpp -o %s %s", - out_filename, in_filename); - if (r == -1) - yasm__fatal("failed to construct command line for cpp"); - - /* r is the length of the string stored in tmp. */ - if (p + r + 1 >= limit) - yasm__fatal("command line too long"); - - strcpy(p, tmp); - yasm_xfree(tmp); - p += r; - *p = '\0'; + APPEND(" -x assembler-with-cpp -o "); + APPEND(out_filename); + APPEND(" "); + APPEND(in_filename); #if 0 /* Print the command line before executing. */ From 0157febba06c6cf6428a5e1f85c2e57a05247ed4 Mon Sep 17 00:00:00 2001 From: paulbarker Date: Wed, 29 Aug 2007 14:08:19 +0000 Subject: [PATCH 052/585] Fixed yasm frontend to call the correct wrappers (yasm_preproc_create and yasm_arch_create) rather than directly calling members of the preproc and arch modules. svn path=/branches/multiarch/; revision=1918 --- frontends/yasm/yasm.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/frontends/yasm/yasm.c b/frontends/yasm/yasm.c index acbf6abc..510a6425 100644 --- a/frontends/yasm/yasm.c +++ b/frontends/yasm/yasm.c @@ -366,9 +366,8 @@ do_assemble(FILE *in) yasm__xstrdup(cur_arch_module->default_machine_keyword); } - cur_arch = cur_arch_module->create(machine_name, - cur_parser_module->keyword, - &arch_error); + cur_arch = yasm_arch_create(cur_arch_module, machine_name, + cur_parser_module->keyword, &arch_error); if (!cur_arch) { switch (arch_error) { case YASM_ARCH_CREATE_BAD_MACHINE: @@ -429,8 +428,8 @@ do_assemble(FILE *in) return EXIT_FAILURE; } - cur_preproc = cur_preproc_module->create(in, in_filename, linemap, - errwarns); + cur_preproc = yasm_preproc_create(cur_preproc_module, in, in_filename, + linemap, errwarns); apply_preproc_builtins(); apply_preproc_saved_options(); @@ -576,7 +575,7 @@ main(int argc, char *argv[]) /* Initialize intnum and floatnum */ yasm_intnum_initialize(); yasm_floatnum_initialize(); - + /* If not already specified, default to bin as the object format. */ if (!cur_objfmt_module) { if (!objfmt_keyword) @@ -1086,7 +1085,7 @@ opt_makedep_handler(/*@unused@*/ char *cmd, /*@unused@*/ char *param, /* Also set preproc_only to 1, we don't want to generate code */ preproc_only = 1; generate_make_dependencies = 1; - + return 0; } From dc23b3730873856c03f5e20ea2ca6835d4ac0503 Mon Sep 17 00:00:00 2001 From: paulbarker Date: Wed, 29 Aug 2007 15:40:09 +0000 Subject: [PATCH 053/585] Simplified cpp module, re-structuring much of the code and improving comments. svn path=/branches/multiarch/; revision=1919 --- modules/preprocs/cpp/cpp-preproc.c | 153 +++++++++++++++++------------ 1 file changed, 88 insertions(+), 65 deletions(-) diff --git a/modules/preprocs/cpp/cpp-preproc.c b/modules/preprocs/cpp/cpp-preproc.c index e22e3404..4f13992d 100644 --- a/modules/preprocs/cpp/cpp-preproc.c +++ b/modules/preprocs/cpp/cpp-preproc.c @@ -29,40 +29,61 @@ #include #include -/* TODO: Find some non-arbitrary values for these constants. */ -#define TMP_BUF_SIZE 4096 +/* TODO: Use autoconf to get the limit on the command line length. */ #define CMDLINE_SIZE 32770 extern int isatty(int); -/* Flags. */ -#define CPP_HAS_BEEN_INVOKED 0x01 +/* Pre-declare the preprocessor module object. */ +yasm_preproc_module yasm_cpp_LTX_preproc; +/* TODO: Use a pipe rather than a temporary file? */ +static const char *out_filename = ".cpp.out"; + +/******************************************************************************* + Structures. +*******************************************************************************/ + +/* An entry in a list of arguments to pass to cpp. */ typedef struct cpp_arg_entry { TAILQ_ENTRY(cpp_arg_entry) entry; - char *op; + /* + The operator (eg "-I") and the parameter (eg "include/"). op is expected + to point to a string literal, whereas param is expected to be a copy of + the parameter which is free'd when no-longer needed (in + cpp_build_cmdline()). + */ + const char *op; char *param; } cpp_arg_entry; typedef struct yasm_preproc_cpp { yasm_preproc_base preproc; /* base structure */ - TAILQ_HEAD(, cpp_arg_entry) cpp_args; - cpp_arg_entry *pos; + /* + List of arguments to pass to cpp. - FILE *f_in, *f_out; + TODO: We should properly destroy this list and free all memory + associated with it once we have finished with it (ie. at the end of + cpp_build_cmdline()). + */ + TAILQ_HEAD(, cpp_arg_entry) cpp_args; + + char *filename; + FILE *f; yasm_linemap *cur_lm; yasm_errwarns *errwarns; int flags; } yasm_preproc_cpp; -yasm_preproc_module yasm_cpp_LTX_preproc; +/* Flag values for yasm_preproc_cpp->flags. */ +#define CPP_HAS_BEEN_INVOKED 0x01 -/* TODO: Make these filenames safer and more portable, maybe using tmpnam()? */ -static const char *in_filename = ".cpp.in"; -static const char *out_filename = ".cpp.out"; +/******************************************************************************* + Internal functions and helpers. +*******************************************************************************/ /* Append a string to the command line, ensuring that we don't overflow the @@ -76,14 +97,15 @@ static const char *out_filename = ".cpp.out"; p += _len; \ } while (0) -/* Invoke the c preprocessor. */ -static void -cpp_invoke(yasm_preproc_cpp *pp) +/* + Put all the options together into a command line that can be used to invoke + cpp. +*/ +static char * +cpp_build_cmdline(yasm_preproc_cpp *pp) { - int r; - char *cmdline, *p, *limit, *tmp; + char *cmdline, *p, *limit; cpp_arg_entry *arg; - size_t op_len, param_len, sz; /* Initialize command line. We can assume there will be enough space to @@ -108,19 +130,42 @@ cpp_invoke(yasm_preproc_cpp *pp) APPEND(" -x assembler-with-cpp -o "); APPEND(out_filename); APPEND(" "); - APPEND(in_filename); + APPEND(pp->filename); + + return cmdline; +} + +/* Invoke the c preprocessor. */ +static void +cpp_invoke(yasm_preproc_cpp *pp) +{ + int r; + char *cmdline; + + cmdline = cpp_build_cmdline(pp); #if 0 /* Print the command line before executing. */ printf("%s\n", cmdline); #endif + r = system(cmdline); if (r) yasm__fatal("C preprocessor failed"); yasm_xfree(cmdline); + + /* Open the preprocessed file. */ + pp->f = fopen(out_filename, "r"); + + if (!pp->f) { + yasm__fatal("Could not open preprocessed file \"%s\"", out_filename); + } } +/******************************************************************************* + Interface functions. +*******************************************************************************/ static yasm_preproc * cpp_preproc_create(FILE *f, const char *in, yasm_linemap *lm, yasm_errwarns *errwarns) @@ -128,15 +173,25 @@ cpp_preproc_create(FILE *f, const char *in, yasm_linemap *lm, yasm_preproc_cpp *pp = yasm_xmalloc(sizeof(yasm_preproc_cpp)); pp->preproc.module = &yasm_cpp_LTX_preproc; - pp->f_in = f; - pp->f_out = NULL; + pp->f = NULL; pp->cur_lm = lm; pp->errwarns = errwarns; pp->flags = 0; + pp->filename = yasm__xstrdup(in); - pp->pos = NULL; TAILQ_INIT(&pp->cpp_args); + /* We can't handle reading from a tty yet. */ + if (isatty(fileno(f)) > 0) + yasm__fatal("incapable of reading from a tty"); + + /* + We don't need the FILE* given by yasm since we will simply pass the + filename to cpp, but closing it causes a segfault. + + TODO: Change the preprocessor interface, so no FILE* is given. + */ + return (yasm_preproc *)pp; } @@ -145,71 +200,35 @@ cpp_preproc_destroy(yasm_preproc *preproc) { yasm_preproc_cpp *pp = (yasm_preproc_cpp *)preproc; - if (pp->f_out) { - fclose(pp->f_out); + if (pp->f) { + fclose(pp->f); } - /* Remove both temporary files. */ - remove(in_filename); + /* Remove temporary file. */ remove(out_filename); - yasm_xfree(preproc); + yasm_xfree(pp->filename); + yasm_xfree(pp); } static size_t cpp_preproc_input(yasm_preproc *preproc, char *buf, size_t max_size) { size_t n; - FILE *f_tmp; - int tty; - char *tmp_buf; yasm_preproc_cpp *pp = (yasm_preproc_cpp *)preproc; if (! (pp->flags & CPP_HAS_BEEN_INVOKED) ) { pp->flags |= CPP_HAS_BEEN_INVOKED; - tmp_buf = (char *)yasm_xmalloc(TMP_BUF_SIZE); - - f_tmp = fopen(in_filename, "w"); - - tty = (isatty(fileno(f_tmp)) > 0); - while (!feof(pp->f_in)) { - if (tty) { - /* TODO: Handle reading from tty into tmp_buf. */ - yasm__fatal("incapable of reading from a tty"); - } else { - if (((n = fread(tmp_buf, 1, TMP_BUF_SIZE, pp->f_in)) == 0) && - ferror(pp->f_in)) { - yasm_error_set(YASM_ERROR_IO, - N_("error when reading from input file")); - yasm_errwarn_propagate(pp->errwarns, - yasm_linemap_get_current(pp->cur_lm)); - } - } - - if (fwrite(tmp_buf, 1, n, f_tmp) != n) { - yasm__fatal("error writing to temporary file"); - } - } - - yasm_xfree(tmp_buf); - fclose(f_tmp); - cpp_invoke(pp); - - pp->f_out = fopen(out_filename, "r"); - - if (!pp->f_out) { - yasm__fatal("Could not open preprocessed file \"%s\"", out_filename); - } } /* Once the preprocessor has been run, we're just dealing with a normal file. */ - if (((n = fread(buf, 1, max_size, pp->f_out)) == 0) && - ferror(pp->f_out)) { + if (((n = fread(buf, 1, max_size, pp->f)) == 0) && + ferror(pp->f)) { yasm_error_set(YASM_ERROR_IO, N_("error when reading from preprocessed file")); yasm_errwarn_propagate(pp->errwarns, yasm_linemap_get_current(pp->cur_lm)); @@ -270,6 +289,10 @@ cpp_preproc_define_builtin(yasm_preproc *preproc, const char *macronameval) cpp_preproc_predefine_macro(preproc, macronameval); } +/******************************************************************************* + Preprocessor module object. +*******************************************************************************/ + yasm_preproc_module yasm_cpp_LTX_preproc = { "Run input through enternal C preprocessor", "cpp", From 1069d0fce36faab8da6af2de4efb7b51d6bc5daf Mon Sep 17 00:00:00 2001 From: paulbarker Date: Thu, 30 Aug 2007 11:39:15 +0000 Subject: [PATCH 054/585] Modified cpp module to read directly from the preprocessor using a pipe, rather than storing the output in a temporary file. svn path=/branches/multiarch/; revision=1920 --- modules/preprocs/cpp/cpp-preproc.c | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/modules/preprocs/cpp/cpp-preproc.c b/modules/preprocs/cpp/cpp-preproc.c index 4f13992d..ecd10d38 100644 --- a/modules/preprocs/cpp/cpp-preproc.c +++ b/modules/preprocs/cpp/cpp-preproc.c @@ -37,9 +37,6 @@ extern int isatty(int); /* Pre-declare the preprocessor module object. */ yasm_preproc_module yasm_cpp_LTX_preproc; -/* TODO: Use a pipe rather than a temporary file? */ -static const char *out_filename = ".cpp.out"; - /******************************************************************************* Structures. *******************************************************************************/ @@ -127,9 +124,7 @@ cpp_build_cmdline(yasm_preproc_cpp *pp) } /* Append final arguments. */ - APPEND(" -x assembler-with-cpp -o "); - APPEND(out_filename); - APPEND(" "); + APPEND(" -x assembler-with-cpp "); APPEND(pp->filename); return cmdline; @@ -149,18 +144,11 @@ cpp_invoke(yasm_preproc_cpp *pp) printf("%s\n", cmdline); #endif - r = system(cmdline); - if (r) - yasm__fatal("C preprocessor failed"); + pp->f = popen(cmdline, "r"); + if (!pp->f) + yasm__fatal("Failed to execute preprocessor"); yasm_xfree(cmdline); - - /* Open the preprocessed file. */ - pp->f = fopen(out_filename, "r"); - - if (!pp->f) { - yasm__fatal("Could not open preprocessed file \"%s\"", out_filename); - } } /******************************************************************************* @@ -201,12 +189,10 @@ cpp_preproc_destroy(yasm_preproc *preproc) yasm_preproc_cpp *pp = (yasm_preproc_cpp *)preproc; if (pp->f) { - fclose(pp->f); + if (pclose(pp->f) != 0) + yasm__fatal("Preprocessor exited with failure"); } - /* Remove temporary file. */ - remove(out_filename); - yasm_xfree(pp->filename); yasm_xfree(pp); } @@ -229,7 +215,7 @@ cpp_preproc_input(yasm_preproc *preproc, char *buf, size_t max_size) */ if (((n = fread(buf, 1, max_size, pp->f)) == 0) && ferror(pp->f)) { - yasm_error_set(YASM_ERROR_IO, N_("error when reading from preprocessed file")); + yasm_error_set(YASM_ERROR_IO, N_("error reading from pipe")); yasm_errwarn_propagate(pp->errwarns, yasm_linemap_get_current(pp->cur_lm)); } From c88fd9dd7efce4bad2a4863e3a56c50db6d44568 Mon Sep 17 00:00:00 2001 From: paulbarker Date: Thu, 30 Aug 2007 19:36:57 +0000 Subject: [PATCH 055/585] Changed cpp module to destroy the argument list and free the memory it uses. svn path=/branches/multiarch/; revision=1921 --- modules/preprocs/cpp/cpp-preproc.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/modules/preprocs/cpp/cpp-preproc.c b/modules/preprocs/cpp/cpp-preproc.c index ecd10d38..10bbcf6a 100644 --- a/modules/preprocs/cpp/cpp-preproc.c +++ b/modules/preprocs/cpp/cpp-preproc.c @@ -58,13 +58,7 @@ typedef struct cpp_arg_entry { typedef struct yasm_preproc_cpp { yasm_preproc_base preproc; /* base structure */ - /* - List of arguments to pass to cpp. - - TODO: We should properly destroy this list and free all memory - associated with it once we have finished with it (ie. at the end of - cpp_build_cmdline()). - */ + /* List of arguments to pass to cpp. */ TAILQ_HEAD(, cpp_arg_entry) cpp_args; char *filename; @@ -114,13 +108,16 @@ cpp_build_cmdline(yasm_preproc_cpp *pp) p += 3; /* Append arguments from the list. */ - TAILQ_FOREACH(arg, (&pp->cpp_args), entry) { + while ( (arg = TAILQ_FIRST(&pp->cpp_args)) ) { APPEND(" "); APPEND(arg->op); APPEND(" "); APPEND(arg->param); + /* Remove this element from the list and free it. */ + TAILQ_REMOVE(&pp->cpp_args, arg, entry); yasm_xfree(arg->param); + yasm_xfree(arg); } /* Append final arguments. */ @@ -134,7 +131,6 @@ cpp_build_cmdline(yasm_preproc_cpp *pp) static void cpp_invoke(yasm_preproc_cpp *pp) { - int r; char *cmdline; cmdline = cpp_build_cmdline(pp); From 76d60df7b8706904361b94d8b6d68c64a2ea8b1d Mon Sep 17 00:00:00 2001 From: paulbarker Date: Thu, 30 Aug 2007 21:00:38 +0000 Subject: [PATCH 056/585] Removed FILE* argument from parser interface. The FILE* given was simply stored and never used. svn path=/branches/multiarch/; revision=1922 --- frontends/yasm/yasm.c | 2 +- libyasm/parser.h | 3 +-- modules/parsers/gas/gas-parser.c | 4 +--- modules/parsers/gas/gas-parser.h | 1 - modules/parsers/nasm/nasm-parser.c | 4 +--- modules/parsers/nasm/nasm-parser.h | 1 - 6 files changed, 4 insertions(+), 11 deletions(-) diff --git a/frontends/yasm/yasm.c b/frontends/yasm/yasm.c index 510a6425..4a855721 100644 --- a/frontends/yasm/yasm.c +++ b/frontends/yasm/yasm.c @@ -443,7 +443,7 @@ do_assemble(FILE *in) yasm_arch_set_var(cur_arch, "force_strict", force_strict); /* Parse! */ - cur_parser_module->do_parse(object, cur_preproc, in, list_filename != NULL, + cur_parser_module->do_parse(object, cur_preproc, list_filename != NULL, linemap, errwarns); /* Close input file */ diff --git a/libyasm/parser.h b/libyasm/parser.h index 2ed5ce1c..fcbb20c4 100644 --- a/libyasm/parser.h +++ b/libyasm/parser.h @@ -54,7 +54,6 @@ typedef struct yasm_parser_module { /** Parse a source file into an object. * \param object object to parse into (already created) * \param pp preprocessor - * \param f initial starting file * \param save_input nonzero if the parser should save the original * lines of source into the object's linemap (via * yasm_linemap_add_data()). @@ -62,7 +61,7 @@ typedef struct yasm_parser_module { * \note Parse errors and warnings are stored into errwarns. */ void (*do_parse) - (yasm_object *object, yasm_preproc *pp, FILE *f, int save_input, + (yasm_object *object, yasm_preproc *pp, int save_input, yasm_linemap *linemap, yasm_errwarns *errwarns); } yasm_parser_module; diff --git a/modules/parsers/gas/gas-parser.c b/modules/parsers/gas/gas-parser.c index df51dc59..6d8aa998 100644 --- a/modules/parsers/gas/gas-parser.c +++ b/modules/parsers/gas/gas-parser.c @@ -36,7 +36,7 @@ static void -gas_parser_do_parse(yasm_object *object, yasm_preproc *pp, FILE *f, +gas_parser_do_parse(yasm_object *object, yasm_preproc *pp, int save_input, yasm_linemap *linemap, yasm_errwarns *errwarns) { @@ -46,8 +46,6 @@ gas_parser_do_parse(yasm_object *object, yasm_preproc *pp, FILE *f, parser_gas.object = object; parser_gas.linemap = linemap; - parser_gas.in = f; - parser_gas.locallabel_base = (char *)NULL; parser_gas.locallabel_base_len = 0; diff --git a/modules/parsers/gas/gas-parser.h b/modules/parsers/gas/gas-parser.h index 8d683e09..7147a4fd 100644 --- a/modules/parsers/gas/gas-parser.h +++ b/modules/parsers/gas/gas-parser.h @@ -93,7 +93,6 @@ enum gas_parser_state { }; typedef struct yasm_parser_gas { - FILE *in; int debug; /*@only@*/ yasm_object *object; diff --git a/modules/parsers/nasm/nasm-parser.c b/modules/parsers/nasm/nasm-parser.c index 8cdc63a0..7138c9d2 100644 --- a/modules/parsers/nasm/nasm-parser.c +++ b/modules/parsers/nasm/nasm-parser.c @@ -33,7 +33,7 @@ static void -nasm_parser_do_parse(yasm_object *object, yasm_preproc *pp, FILE *f, +nasm_parser_do_parse(yasm_object *object, yasm_preproc *pp, int save_input, yasm_linemap *linemap, yasm_errwarns *errwarns) { @@ -42,8 +42,6 @@ nasm_parser_do_parse(yasm_object *object, yasm_preproc *pp, FILE *f, parser_nasm.object = object; parser_nasm.linemap = linemap; - parser_nasm.in = f; - parser_nasm.locallabel_base = (char *)NULL; parser_nasm.locallabel_base_len = 0; diff --git a/modules/parsers/nasm/nasm-parser.h b/modules/parsers/nasm/nasm-parser.h index a2671559..72e4c6a2 100644 --- a/modules/parsers/nasm/nasm-parser.h +++ b/modules/parsers/nasm/nasm-parser.h @@ -79,7 +79,6 @@ typedef union { #define YYSTYPE yystype typedef struct yasm_parser_nasm { - FILE *in; int debug; /*@only@*/ yasm_object *object; From a956b0e1db0b4ed14e5da118ab35852d7179fc9b Mon Sep 17 00:00:00 2001 From: paulbarker Date: Thu, 30 Aug 2007 21:08:33 +0000 Subject: [PATCH 057/585] Removed FILE* argument from preprocessor create() interface. The preprocessor now opens the input file itself. svn path=/branches/multiarch/; revision=1923 --- frontends/yasm/yasm.c | 37 +++++----------------------- libyasm/preproc.h | 15 ++++++----- modules/preprocs/cpp/cpp-preproc.c | 16 +----------- modules/preprocs/nasm/nasm-preproc.c | 11 ++++++++- modules/preprocs/raw/raw-preproc.c | 11 ++++++++- modules/preprocs/yapp/yapp-preproc.c | 13 ++++++++-- 6 files changed, 45 insertions(+), 58 deletions(-) diff --git a/frontends/yasm/yasm.c b/frontends/yasm/yasm.c index 4a855721..93976152 100644 --- a/frontends/yasm/yasm.c +++ b/frontends/yasm/yasm.c @@ -220,7 +220,7 @@ typedef struct constcharparam { static constcharparam_head preproc_options; static int -do_preproc_only(FILE *in) +do_preproc_only() { yasm_linemap *linemap; char *preproc_buf = yasm_xmalloc(PREPROC_BUF_SIZE); @@ -241,7 +241,7 @@ do_preproc_only(FILE *in) /* determine the object filename if not specified, but we need a file name for the makefile rule */ if (generate_make_dependencies && !obj_filename) { - if (in == stdin) + if (in_filename == NULL) /* Default to yasm.out if no obj filename specified */ obj_filename = yasm__xstrdup("yasm.out"); else { @@ -264,7 +264,7 @@ do_preproc_only(FILE *in) } /* Pre-process until done */ - cur_preproc = yasm_preproc_create(cur_preproc_module, in, in_filename, + cur_preproc = yasm_preproc_create(cur_preproc_module, in_filename, linemap, errwarns); apply_preproc_builtins(); @@ -293,9 +293,6 @@ do_preproc_only(FILE *in) fwrite(preproc_buf, got, 1, out); } - if (in != stdin) - fclose(in); - if (out != stdout) fclose(out); @@ -321,7 +318,7 @@ do_preproc_only(FILE *in) } static int -do_assemble(FILE *in) +do_assemble() { yasm_object *object; const char *base_filename; @@ -337,7 +334,7 @@ do_assemble(FILE *in) /* determine the object filename if not specified */ if (!obj_filename) { - if (in == stdin) + if (in_filename == NULL) /* Default to yasm.out if no obj filename specified */ obj_filename = yasm__xstrdup("yasm.out"); else { @@ -401,8 +398,6 @@ do_assemble(FILE *in) yasm_xfree(estr); yasm_xfree(xrefstr); - if (in != stdin) - fclose(in); cleanup(object); return EXIT_FAILURE; } @@ -422,13 +417,11 @@ do_assemble(FILE *in) print_error(_("%s: `%s' is not a valid %s for %s `%s'"), _("FATAL"), cur_preproc_module->keyword, _("preprocessor"), _("parser"), cur_parser_module->keyword); - if (in != stdin) - fclose(in); cleanup(object); return EXIT_FAILURE; } - cur_preproc = yasm_preproc_create(cur_preproc_module, in, in_filename, + cur_preproc = yasm_preproc_create(cur_preproc_module, in_filename, linemap, errwarns); apply_preproc_builtins(); @@ -446,10 +439,6 @@ do_assemble(FILE *in) cur_parser_module->do_parse(object, cur_preproc, list_filename != NULL, linemap, errwarns); - /* Close input file */ - if (in != stdin) - fclose(in); - check_errors(errwarns, object, linemap); /* Finalize parse */ @@ -637,20 +626,6 @@ main(int argc, char *argv[]) if (!in_filename) { print_error(_("No input files specified")); return EXIT_FAILURE; - } else if (strcmp(in_filename, "-") != 0) { - /* Open the input file (if not standard input) */ - in = fopen(in_filename, "rt"); - if (!in) { - print_error(_("%s: could not open file `%s'"), _("FATAL"), - in_filename); - yasm_xfree(in_filename); - if (obj_filename) - yasm_xfree(obj_filename); - return EXIT_FAILURE; - } - } else { - /* Filename was "-", read stdin */ - in = stdin; } /* handle preproc-only case here */ diff --git a/libyasm/preproc.h b/libyasm/preproc.h index f93a838c..7a161af6 100644 --- a/libyasm/preproc.h +++ b/libyasm/preproc.h @@ -56,15 +56,15 @@ typedef struct yasm_preproc_module { * Module-level implementation of yasm_preproc_create(). * Call yasm_preproc_create() instead of calling this function. * - * \param f initial starting file - * \param in_filename initial starting filename + * \param in_filename initial starting filename, or NULL to read from + * stdin * \param lm line mapping repository * \param errwarns error/warnning set. * \return New preprocessor. * * \note Any preprocessor errors and warnings are stored into errwarns. */ - /*@only@*/ yasm_preproc * (*create) (FILE *f, const char *in_filename, + /*@only@*/ yasm_preproc * (*create) (const char *in_filename, yasm_linemap *lm, yasm_errwarns *errwarns); @@ -110,15 +110,14 @@ typedef struct yasm_preproc_module { * The preprocessor needs access to the object format module to find out * any output format specific macros. * \param module preprocessor module - * \param f initial starting file - * \param in_filename initial starting file filename + * \param in_filename initial starting filename, or NULL to read from stdin * \param lm line mapping repository * \param errwarns error/warning set * \return New preprocessor. * \note Errors/warnings are stored into errwarns. */ /*@only@*/ yasm_preproc *yasm_preproc_create - (yasm_preproc_module *module, FILE *f, const char *in_filename, + (yasm_preproc_module *module, const char *in_filename, yasm_linemap *lm, yasm_errwarns *errwarns); /** Cleans up any allocated preproc memory. @@ -176,8 +175,8 @@ void yasm_preproc_define_builtin(yasm_preproc *preproc, /* Inline macro implementations for preproc functions */ -#define yasm_preproc_create(module, f, in_filename, lm, ews) \ - module->create(f, in_filename, lm, ews) +#define yasm_preproc_create(module, in_filename, lm, ews) \ + module->create(in_filename, lm, ews) #define yasm_preproc_destroy(preproc) \ ((yasm_preproc_base *)preproc)->module->destroy(preproc) diff --git a/modules/preprocs/cpp/cpp-preproc.c b/modules/preprocs/cpp/cpp-preproc.c index 10bbcf6a..794766b6 100644 --- a/modules/preprocs/cpp/cpp-preproc.c +++ b/modules/preprocs/cpp/cpp-preproc.c @@ -32,8 +32,6 @@ /* TODO: Use autoconf to get the limit on the command line length. */ #define CMDLINE_SIZE 32770 -extern int isatty(int); - /* Pre-declare the preprocessor module object. */ yasm_preproc_module yasm_cpp_LTX_preproc; @@ -151,8 +149,7 @@ cpp_invoke(yasm_preproc_cpp *pp) Interface functions. *******************************************************************************/ static yasm_preproc * -cpp_preproc_create(FILE *f, const char *in, yasm_linemap *lm, - yasm_errwarns *errwarns) +cpp_preproc_create(const char *in, yasm_linemap *lm, yasm_errwarns *errwarns) { yasm_preproc_cpp *pp = yasm_xmalloc(sizeof(yasm_preproc_cpp)); @@ -165,17 +162,6 @@ cpp_preproc_create(FILE *f, const char *in, yasm_linemap *lm, TAILQ_INIT(&pp->cpp_args); - /* We can't handle reading from a tty yet. */ - if (isatty(fileno(f)) > 0) - yasm__fatal("incapable of reading from a tty"); - - /* - We don't need the FILE* given by yasm since we will simply pass the - filename to cpp, but closing it causes a segfault. - - TODO: Change the preprocessor interface, so no FILE* is given. - */ - return (yasm_preproc *)pp; } diff --git a/modules/preprocs/nasm/nasm-preproc.c b/modules/preprocs/nasm/nasm-preproc.c index 96700267..22a4096e 100644 --- a/modules/preprocs/nasm/nasm-preproc.c +++ b/modules/preprocs/nasm/nasm-preproc.c @@ -128,13 +128,22 @@ nasm_efunc(int severity, const char *fmt, ...) } static yasm_preproc * -nasm_preproc_create(FILE *f, const char *in_filename, yasm_linemap *lm, +nasm_preproc_create(const char *in_filename, yasm_linemap *lm, yasm_errwarns *errwarns) { + FILE *f; yasm_preproc_nasm *preproc_nasm = yasm_xmalloc(sizeof(yasm_preproc_nasm)); preproc_nasm->preproc.module = &yasm_nasm_LTX_preproc; + if (strcmp(in_filename, "-") != 0) { + f = fopen(in_filename, "r"); + if (!f) + yasm__fatal("Could not open input file"); + } + else + f = stdin; + preproc_nasm->in = f; cur_lm = lm; cur_errwarns = errwarns; diff --git a/modules/preprocs/raw/raw-preproc.c b/modules/preprocs/raw/raw-preproc.c index 4e80cfff..27880d3a 100644 --- a/modules/preprocs/raw/raw-preproc.c +++ b/modules/preprocs/raw/raw-preproc.c @@ -44,11 +44,20 @@ yasm_preproc_module yasm_raw_LTX_preproc; int isatty(int); static yasm_preproc * -raw_preproc_create(FILE *f, const char *in_filename, yasm_linemap *lm, +raw_preproc_create(const char *in_filename, yasm_linemap *lm, yasm_errwarns *errwarns) { + FILE *f; yasm_preproc_raw *preproc_raw = yasm_xmalloc(sizeof(yasm_preproc_raw)); + if (strcmp(in_filename, "-") != 0) { + f = fopen(in_filename, "r"); + if (!f) + yasm__fatal("Could not open input file"); + } + else + f = stdin; + preproc_raw->preproc.module = &yasm_raw_LTX_preproc; preproc_raw->in = f; preproc_raw->cur_lm = lm; diff --git a/modules/preprocs/yapp/yapp-preproc.c b/modules/preprocs/yapp/yapp-preproc.c index c7756442..ed16ad57 100644 --- a/modules/preprocs/yapp/yapp-preproc.c +++ b/modules/preprocs/yapp/yapp-preproc.c @@ -241,11 +241,20 @@ void expand_token_list(struct source_head *paramexp, struct source_head *to_head, source **to_tail); static yasm_preproc * -yapp_preproc_create(FILE *f, const char *in_filename, yasm_linemap *lm, +yapp_preproc_create(const char *in_filename, yasm_linemap *lm, yasm_errwarns *errwarns) { + FILE *f; yasm_preproc_yapp *preproc_yapp = yasm_xmalloc(sizeof(yasm_preproc_yapp)); + if (strcmp(in_filename, "-") != 0) { + f = fopen(in_filename, "r"); + if (!f) + yasm__fatal("Could not open input file"); + } + else + f = stdin; + preproc_yapp->preproc.module = &yasm_yapp_LTX_preproc; yapp_preproc_linemap = lm; @@ -468,7 +477,7 @@ append_to_return(struct source_head *to_head, source **to_tail) return 0; append_token(token, to_head, to_tail); token = yapp_preproc_lex(); - } + } return '\n'; } From 2a1230f14e59392db5292888a70913b7a7a4d682 Mon Sep 17 00:00:00 2001 From: paulbarker Date: Thu, 30 Aug 2007 21:27:10 +0000 Subject: [PATCH 058/585] Tiny documentation fix for recent changes in the preprocessor create() inteface. svn path=/branches/multiarch/; revision=1924 --- libyasm/preproc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libyasm/preproc.h b/libyasm/preproc.h index 7a161af6..98f56e8f 100644 --- a/libyasm/preproc.h +++ b/libyasm/preproc.h @@ -56,7 +56,7 @@ typedef struct yasm_preproc_module { * Module-level implementation of yasm_preproc_create(). * Call yasm_preproc_create() instead of calling this function. * - * \param in_filename initial starting filename, or NULL to read from + * \param in_filename initial starting filename, or "-" to read from * stdin * \param lm line mapping repository * \param errwarns error/warnning set. @@ -110,7 +110,7 @@ typedef struct yasm_preproc_module { * The preprocessor needs access to the object format module to find out * any output format specific macros. * \param module preprocessor module - * \param in_filename initial starting filename, or NULL to read from stdin + * \param in_filename initial starting filename, or "-" to read from stdin * \param lm line mapping repository * \param errwarns error/warning set * \return New preprocessor. From d628c6a3154161806a45d90c9c4609535045aba9 Mon Sep 17 00:00:00 2001 From: paulbarker Date: Sat, 1 Sep 2007 20:11:11 +0000 Subject: [PATCH 059/585] * Marked message strings so gettext can find them. * Updated POTFILES.in svn path=/branches/multiarch/; revision=1925 --- modules/preprocs/cpp/cpp-preproc.c | 4 ++-- modules/preprocs/nasm/nasm-preproc.c | 2 +- modules/preprocs/raw/raw-preproc.c | 2 +- modules/preprocs/yapp/yapp-preproc.c | 2 +- po/POTFILES.in | 9 ++++++--- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/modules/preprocs/cpp/cpp-preproc.c b/modules/preprocs/cpp/cpp-preproc.c index 794766b6..a35b2544 100644 --- a/modules/preprocs/cpp/cpp-preproc.c +++ b/modules/preprocs/cpp/cpp-preproc.c @@ -140,7 +140,7 @@ cpp_invoke(yasm_preproc_cpp *pp) pp->f = popen(cmdline, "r"); if (!pp->f) - yasm__fatal("Failed to execute preprocessor"); + yasm__fatal( N_("Failed to execute preprocessor") ); yasm_xfree(cmdline); } @@ -172,7 +172,7 @@ cpp_preproc_destroy(yasm_preproc *preproc) if (pp->f) { if (pclose(pp->f) != 0) - yasm__fatal("Preprocessor exited with failure"); + yasm__fatal( N_("Preprocessor exited with failure") ); } yasm_xfree(pp->filename); diff --git a/modules/preprocs/nasm/nasm-preproc.c b/modules/preprocs/nasm/nasm-preproc.c index 22a4096e..78993b57 100644 --- a/modules/preprocs/nasm/nasm-preproc.c +++ b/modules/preprocs/nasm/nasm-preproc.c @@ -139,7 +139,7 @@ nasm_preproc_create(const char *in_filename, yasm_linemap *lm, if (strcmp(in_filename, "-") != 0) { f = fopen(in_filename, "r"); if (!f) - yasm__fatal("Could not open input file"); + yasm__fatal( N_("Could not open input file") ); } else f = stdin; diff --git a/modules/preprocs/raw/raw-preproc.c b/modules/preprocs/raw/raw-preproc.c index 27880d3a..869cbec4 100644 --- a/modules/preprocs/raw/raw-preproc.c +++ b/modules/preprocs/raw/raw-preproc.c @@ -53,7 +53,7 @@ raw_preproc_create(const char *in_filename, yasm_linemap *lm, if (strcmp(in_filename, "-") != 0) { f = fopen(in_filename, "r"); if (!f) - yasm__fatal("Could not open input file"); + yasm__fatal( N_("Could not open input file") ); } else f = stdin; diff --git a/modules/preprocs/yapp/yapp-preproc.c b/modules/preprocs/yapp/yapp-preproc.c index ed16ad57..e1215a75 100644 --- a/modules/preprocs/yapp/yapp-preproc.c +++ b/modules/preprocs/yapp/yapp-preproc.c @@ -250,7 +250,7 @@ yapp_preproc_create(const char *in_filename, yasm_linemap *lm, if (strcmp(in_filename, "-") != 0) { f = fopen(in_filename, "r"); if (!f) - yasm__fatal("Could not open input file"); + yasm__fatal( N_("Could not open input file") ); } else f = stdin; diff --git a/po/POTFILES.in b/po/POTFILES.in index 4dc46a98..34438fa8 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -6,7 +6,6 @@ frontends/yasm/yasm-options.c frontends/yasm/yasm.c -#lc3bid.c libyasm/bc-align.c libyasm/bc-data.c libyasm/bc-incbin.c @@ -23,10 +22,11 @@ libyasm/insn.c libyasm/intnum.c libyasm/section.c libyasm/symrec.c +libyasm/valparam.c libyasm/value.c libyasm/xmalloc.c -#modules/arch/lc3b/lc3barch.c -#modules/arch/lc3b/lc3bbc.c +modules/arch/lc3b/lc3barch.c +modules/arch/lc3b/lc3bbc.c modules/arch/x86/x86arch.c modules/arch/x86/x86bc.c modules/arch/x86/x86expr.c @@ -54,5 +54,8 @@ modules/parsers/gas/gas-parser.c modules/parsers/gas/gas-token.re modules/parsers/nasm/nasm-parse.c modules/parsers/nasm/nasm-token.re +modules/preprocs/cpp/cpp-preproc.c +modules/preprocs/yapp/yapp-preproc.c +modules/preprocs/nasm/nasm-preproc.c modules/preprocs/nasm/nasm-pp.c modules/preprocs/raw/raw-preproc.c From 5e9f538bb32508d21f3df75bd20e1a6c4d83a5c0 Mon Sep 17 00:00:00 2001 From: paulbarker Date: Mon, 3 Sep 2007 20:20:40 +0000 Subject: [PATCH 060/585] Added code to gas parser to handle line markers produced by cpp. svn path=/branches/multiarch/; revision=1926 --- modules/parsers/gas/gas-parse.c | 102 ++++++++++++++++++++++++++++++- modules/parsers/gas/gas-parser.h | 1 + modules/parsers/gas/gas-token.re | 19 +++++- 3 files changed, 118 insertions(+), 4 deletions(-) diff --git a/modules/parsers/gas/gas-parse.c b/modules/parsers/gas/gas-parse.c index ef64c162..027de7db 100644 --- a/modules/parsers/gas/gas-parse.c +++ b/modules/parsers/gas/gas-parse.c @@ -44,6 +44,7 @@ typedef struct dir_lookup { enum gas_parser_state newstate; } dir_lookup; +static yasm_bytecode * cpp_line_marker(yasm_parser_gas *parser_gas); static yasm_bytecode *parse_instr(yasm_parser_gas *parser_gas); static int parse_dirvals(yasm_parser_gas *parser_gas, yasm_valparamhead *vps); static int parse_datavals(yasm_parser_gas *parser_gas, yasm_datavalhead *dvs); @@ -247,6 +248,9 @@ parse_line(yasm_parser_gas *parser_gas) define_label(parser_gas, LABEL_val, 0); get_next_token(); /* LABEL */ return parse_line(parser_gas); + case LINE_MARKER: + get_next_token(); + return cpp_line_marker(parser_gas); default: yasm_error_set(YASM_ERROR_SYNTAX, N_("label or instruction expected at start of line")); @@ -254,6 +258,102 @@ parse_line(yasm_parser_gas *parser_gas) } } +/* + Handle line markers generated by cpp. + + We expect a positive integer (line) followed by a string (filename). If we + fail to find either of these, we treat the line as a comment. There is a + possibility of false positives (mistaking a comment for a line marker, when + the comment is not intended as a line marker) but this cannot be avoided + without adding a filter to the input before passing it to cpp. + + This function is only called if the preprocessor was 'cpp', since the + LINE_MARKER token isn't generated for any other preprocessor. With any other + preprocessor, anything after a '#' is always treated as a comment. +*/ +static yasm_bytecode * +cpp_line_marker(yasm_parser_gas *parser_gas) +{ + yasm_valparamhead vps; + yasm_valparam *vp; + unsigned long line; + char *filename; + + /* Line number. */ + if (curtok != INTNUM) { + /* Skip over a comment. */ + while (curtok != '\n') + get_next_token(); + + return NULL; + } + + if (yasm_intnum_sign(INTNUM_val) < 0) { + get_next_token(); /* INTNUM */ + yasm_error_set(YASM_ERROR_SYNTAX, + N_("line number is negative")); + return NULL; + } + + line = yasm_intnum_get_uint(INTNUM_val); + + /* + Set to (line - 1) since the directive indicates that the *next* line + will have the number given. + + cpp should never produce line=0, but the if keeps us safe just incase. + */ + if (line != 0) + line--; + + yasm_intnum_destroy(INTNUM_val); + get_next_token(); /* INTNUM */ + + /* File name, in quotes. */ + if (curtok != STRING) { + /* Skip over a comment. */ + while (curtok != '\n') + get_next_token(); + + return NULL; + } + + filename = STRING_val.contents; + get_next_token(); + + /* Set linemap. */ + yasm_linemap_set(parser_gas->linemap, filename, line, 1); + + /* Pass change along to debug format */ + yasm_vps_initialize(&vps); + vp = yasm_vp_create_string(NULL, filename); + yasm_vps_append(&vps, vp); + + yasm_object_directive(p_object, ".file", "gas", &vps, NULL, cur_line); + + yasm_vps_delete(&vps); + + /* Skip flags. */ + while (1) { + switch (curtok) { + case INTNUM: + break; + + case '\n': + return NULL; + + default: + yasm_error_set(YASM_ERROR_SYNTAX, + N_("junk at end of cpp line marker")); + return NULL; + } + get_next_token(); + } + + /* Never reached. */ + return NULL; +} + /* Line directive */ static yasm_bytecode * dir_line(yasm_parser_gas *parser_gas, unsigned int param) @@ -1516,7 +1616,7 @@ gas_parser_parse(yasm_parser_gas *parser_gas) while (get_next_token() != 0) { yasm_bytecode *bc = NULL, *temp_bc; - + if (!is_eol()) { bc = parse_line(parser_gas); demand_eol(); diff --git a/modules/parsers/gas/gas-parser.h b/modules/parsers/gas/gas-parser.h index 7147a4fd..bfae0a9d 100644 --- a/modules/parsers/gas/gas-parser.h +++ b/modules/parsers/gas/gas-parser.h @@ -48,6 +48,7 @@ enum tokentype { RIGHT_OP, ID, LABEL, + LINE_MARKER, NONE }; diff --git a/modules/parsers/gas/gas-token.re b/modules/parsers/gas/gas-token.re index c3b19e99..1251225d 100644 --- a/modules/parsers/gas/gas-token.re +++ b/modules/parsers/gas/gas-token.re @@ -42,8 +42,8 @@ RCSID("$Id$"); #define YYMARKER (s->ptr) #define YYFILL(n) {cursor = fill(parser_gas, cursor);} -#define RETURN(i) {s->cur = cursor; parser_gas->tokch = s->tok[0]; \ - return i;} +#define RETURN(i) do {s->cur = cursor; parser_gas->tokch = s->tok[0]; \ + return i;} while (0) #define SCANINIT() {s->tok = cursor;} @@ -445,7 +445,14 @@ scan: } "/*" { parser_gas->state = COMMENT; goto comment; } - "#" (any \ [\n])* { goto scan; } + "#" { + if (strcmp(((yasm_preproc_base*)parser_gas->preproc)->module->keyword, + "cpp") == 0) + { + RETURN(LINE_MARKER); + } else + goto line_comment; + } ws+ { goto scan; } @@ -485,6 +492,12 @@ comment: } */ + /* Single line comment. */ +line_comment: + /*!re2c + (any \ [\n])* { goto scan; } + */ + /* .section directive (the section name portion thereof) */ section_directive: SCANINIT(); From 23c19a1d52033b9eed1510f47852246e442f0417 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 7 Sep 2007 21:49:35 +0000 Subject: [PATCH 061/585] Unbreak distcheck when Python is available by pulling in bitvect.h. svn path=/trunk/yasm/; revision=1927 --- tools/python-yasm/pyxelator/wrap_yasm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/python-yasm/pyxelator/wrap_yasm.py b/tools/python-yasm/pyxelator/wrap_yasm.py index 45ee6237..58553ab2 100755 --- a/tools/python-yasm/pyxelator/wrap_yasm.py +++ b/tools/python-yasm/pyxelator/wrap_yasm.py @@ -25,7 +25,7 @@ def mk_tao(CPPFLAGS = "", CPP = "gcc -E", modname = '_yasm', oname = None, YASM_ CPPFLAGS += " -DYASM_LIB_INTERNAL" CPPFLAGS += " -DYASM_BC_INTERNAL" CPPFLAGS += " -DYASM_EXPR_INTERNAL" - files = [ 'libyasm.h', 'libyasm/assocdat.h' ] + files = [ 'libyasm.h', 'libyasm/assocdat.h', 'libyasm/bitvect.h' ] syms = get_syms( ['yasm'], [YASM_DIR] ) def cb(trans_unit, node, *args): From 32921a0d12a9971bea1d1673ecd8ad1bfa204a6a Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 7 Sep 2007 22:03:34 +0000 Subject: [PATCH 062/585] Unbreak distcheck in lc3b tests. svn path=/trunk/yasm/; revision=1928 --- modules/arch/lc3b/tests/Makefile.inc | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/arch/lc3b/tests/Makefile.inc b/modules/arch/lc3b/tests/Makefile.inc index 43ffb70b..43b861ee 100644 --- a/modules/arch/lc3b/tests/Makefile.inc +++ b/modules/arch/lc3b/tests/Makefile.inc @@ -7,10 +7,8 @@ EXTRA_DIST += modules/arch/lc3b/tests/lc3b-basic.asm EXTRA_DIST += modules/arch/lc3b/tests/lc3b-basic.errwarn EXTRA_DIST += modules/arch/lc3b/tests/lc3b-basic.hex EXTRA_DIST += modules/arch/lc3b/tests/lc3b-br.asm -EXTRA_DIST += modules/arch/lc3b/tests/lc3b-br.errwarn EXTRA_DIST += modules/arch/lc3b/tests/lc3b-br.hex EXTRA_DIST += modules/arch/lc3b/tests/lc3b-ea-err.asm EXTRA_DIST += modules/arch/lc3b/tests/lc3b-ea-err.errwarn EXTRA_DIST += modules/arch/lc3b/tests/lc3b-mp22NC.asm -EXTRA_DIST += modules/arch/lc3b/tests/lc3b-mp22NC.errwarn EXTRA_DIST += modules/arch/lc3b/tests/lc3b-mp22NC.hex From 00e958bcf6cbe4551d16e43307647ced8e80dc16 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 7 Sep 2007 22:05:33 +0000 Subject: [PATCH 063/585] 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 --- modules/arch/x86/Makefile.inc | 52 +- modules/arch/x86/x86cpu.gperf | 240 +++++ modules/arch/x86/x86geninsn.c | 197 ++++ modules/arch/x86/x86id.c | 107 +-- modules/arch/x86/{x86parse.gap => x86insn.in} | 311 +------ modules/arch/x86/x86regtmod.gperf | 274 ++++++ tools/Makefile.inc | 4 +- tools/gap/Makefile.inc | 34 - tools/gap/gap.c | 854 ------------------ tools/genperf/Makefile.inc | 34 + tools/genperf/genperf.c | 519 +++++++++++ tools/{gap => genperf}/perfect.c | 20 +- tools/{gap => genperf}/perfect.h | 0 tools/{gap => genperf}/standard.h | 0 14 files changed, 1325 insertions(+), 1321 deletions(-) create mode 100644 modules/arch/x86/x86cpu.gperf create mode 100644 modules/arch/x86/x86geninsn.c rename modules/arch/x86/{x86parse.gap => x86insn.in} (83%) create mode 100644 modules/arch/x86/x86regtmod.gperf delete mode 100644 tools/gap/Makefile.inc delete mode 100644 tools/gap/gap.c create mode 100644 tools/genperf/Makefile.inc create mode 100644 tools/genperf/genperf.c rename tools/{gap => genperf}/perfect.c (98%) rename tools/{gap => genperf}/perfect.h (100%) rename tools/{gap => genperf}/standard.h (100%) diff --git a/modules/arch/x86/Makefile.inc b/modules/arch/x86/Makefile.inc index 24e90fa7..aa201df8 100644 --- a/modules/arch/x86/Makefile.inc +++ b/modules/arch/x86/Makefile.inc @@ -5,18 +5,58 @@ libyasm_a_SOURCES += modules/arch/x86/x86arch.h libyasm_a_SOURCES += modules/arch/x86/x86bc.c libyasm_a_SOURCES += modules/arch/x86/x86expr.c libyasm_a_SOURCES += modules/arch/x86/x86id.c +libyasm_a_SOURCES += x86cpu.c +libyasm_a_SOURCES += x86regtmod.c YASM_MODULES += arch_x86 -modules/arch/x86/x86id.c: x86parse.c +modules/arch/x86/x86id.c: x86insn_nasm.c x86insn_gas.c -EXTRA_DIST += modules/arch/x86/x86parse.gap +noinst_PROGRAMS += x86geninsn -x86parse.c: $(srcdir)/modules/arch/x86/x86parse.gap gap$(EXEEXT) - $(top_builddir)/gap$(EXEEXT) $(srcdir)/modules/arch/x86/x86parse.gap $@ +x86geninsn_SOURCES = +EXTRA_DIST += modules/arch/x86/x86geninsn.c +x86geninsn_LDADD = x86geninsn.$(OBJEXT) +x86geninsn_LINK = $(CCLD_FOR_BUILD) -o $@ -BUILT_SOURCES += x86parse.c -CLEANFILES += x86parse.c +x86geninsn.$(OBJEXT): modules/arch/x86/x86geninsn.c + $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f modules/arch/x86/x86geninsn.c || echo '$(srcdir)/'`modules/arch/x86/x86geninsn.c + +EXTRA_DIST += modules/arch/x86/x86insn.in + +x86insn_nasm.gperf x86insn_gas.gperf: $(srcdir)/modules/arch/x86/x86insn.in x86geninsn$(EXEEXT) + $(top_builddir)/x86geninsn$(EXEEXT) $(srcdir)/modules/arch/x86/x86insn.in x86insn_nasm.gperf x86insn_gas.gperf + + +BUILT_SOURCES += x86insn_nasm.gperf +BUILT_SOURCES += x86insn_gas.gperf +CLEANFILES += x86insn_nasm.gperf +CLEANFILES += x86insn_gas.gperf + +EXTRA_DIST += modules/arch/x86/x86cpu.gperf +EXTRA_DIST += modules/arch/x86/x86regtmod.gperf + +x86insn_nasm.c: x86insn_nasm.gperf genperf$(EXEEXT) + $(top_builddir)/genperf$(EXEEXT) x86insn_nasm.gperf > $@ + +x86insn_gas.c: x86insn_gas.gperf genperf$(EXEEXT) + $(top_builddir)/genperf$(EXEEXT) x86insn_gas.gperf > $@ + +x86cpu.c: $(srcdir)/modules/arch/x86/x86cpu.gperf genperf$(EXEEXT) + $(top_builddir)/genperf$(EXEEXT) $(srcdir)/modules/arch/x86/x86cpu.gperf > $@ + +x86regtmod.c: $(srcdir)/modules/arch/x86/x86regtmod.gperf genperf$(EXEEXT) + $(top_builddir)/genperf$(EXEEXT) $(srcdir)/modules/arch/x86/x86regtmod.gperf > $@ + +BUILT_SOURCES += x86insn_nasm.c +BUILT_SOURCES += x86insn_gas.c +BUILT_SOURCES += x86cpu.c +BUILT_SOURCES += x86regtmod.c +CLEANFILES += x86insn_nasm.c +CLEANFILES += x86insn_gas.c +CLEANFILES += x86cpu.c +CLEANFILES += x86cpu.c +CLEANFILES += x86regtmod.c EXTRA_DIST += modules/arch/x86/tests/Makefile.inc diff --git a/modules/arch/x86/x86cpu.gperf b/modules/arch/x86/x86cpu.gperf new file mode 100644 index 00000000..84f4d9fb --- /dev/null +++ b/modules/arch/x86/x86cpu.gperf @@ -0,0 +1,240 @@ +# +# x86 CPU recognition +# +# Copyright (C) 2002-2007 Peter Johnson +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +%{ +#include +RCSID("$Id$"); + +#include +#include + +#include "modules/arch/x86/x86arch.h" + +enum cpu_mode { + CPU_MODE_VERBATIM = 1, + CPU_MODE_SET, + CPU_MODE_CLEAR +}; + +#define PROC_186 CPU_186|CPU_Priv +#define PROC_286 CPU_186|CPU_286|CPU_Priv +#define PROC_386 CPU_186|CPU_286|CPU_386|CPU_SMM|CPU_Prot|CPU_Priv +#define PROC_486 CPU_186|CPU_286|CPU_386|CPU_486|CPU_FPU|CPU_SMM|\ + CPU_Prot|CPU_Priv +#define PROC_586 CPU_186|CPU_286|CPU_386|CPU_486|CPU_586|CPU_FPU|\ + CPU_SMM|CPU_Prot|CPU_Priv +#define PROC_686 CPU_186|CPU_286|CPU_386|CPU_486|CPU_586|CPU_686|\ + CPU_FPU|CPU_SMM|CPU_Prot|CPU_Priv +#define PROC_p2 CPU_186|CPU_286|CPU_386|CPU_486|CPU_586|CPU_686|\ + CPU_FPU|CPU_MMX|CPU_SMM|CPU_Prot|CPU_Priv +#define PROC_p3 CPU_186|CPU_286|CPU_386|CPU_486|CPU_586|CPU_686|\ + CPU_P3|CPU_FPU|CPU_MMX|CPU_SSE|CPU_SMM|CPU_Prot|\ + CPU_Priv +#define PROC_p4 CPU_186|CPU_286|CPU_386|CPU_486|CPU_586|CPU_686|\ + CPU_P3|CPU_P4|CPU_FPU|CPU_MMX|CPU_SSE|CPU_SSE2|\ + CPU_SMM|CPU_Prot|CPU_Priv +#define PROC_ia64 CPU_186|CPU_286|CPU_386|CPU_486|CPU_586|CPU_686|\ + CPU_P3|CPU_P4|CPU_IA64|CPU_FPU|CPU_MMX|CPU_SSE|\ + CPU_SSE2|CPU_SMM|CPU_Prot|CPU_Priv +#define PROC_k6 CPU_186|CPU_286|CPU_386|CPU_486|CPU_586|CPU_686|\ + CPU_K6|CPU_FPU|CPU_MMX|CPU_3DNow|CPU_SMM|CPU_Prot|\ + CPU_Priv +#define PROC_k7 CPU_186|CPU_286|CPU_386|CPU_486|CPU_586|CPU_686|\ + CPU_K6|CPU_Athlon|CPU_FPU|CPU_MMX|CPU_SSE|CPU_3DNow|\ + CPU_SMM|CPU_Prot|CPU_Priv +#define PROC_hammer CPU_186|CPU_286|CPU_386|CPU_486|CPU_586|CPU_686|\ + CPU_K6|CPU_Athlon|CPU_Hammer|CPU_FPU|CPU_MMX|\ + CPU_SSE|CPU_SSE2|CPU_3DNow|CPU_SMM|CPU_Prot|\ + CPU_Priv +#define PROC_prescott CPU_186|CPU_286|CPU_386|CPU_486|CPU_586|CPU_686|\ + CPU_Hammer|CPU_EM64T|CPU_FPU|CPU_MMX|\ + CPU_SSE|CPU_SSE2|CPU_SSE3|CPU_SMM|\ + CPU_Prot|CPU_Priv +#define PROC_conroe CPU_186|CPU_286|CPU_386|CPU_486|CPU_586|CPU_686|\ + CPU_Hammer|CPU_EM64T|CPU_FPU|CPU_MMX|\ + CPU_SSE|CPU_SSE2|CPU_SSE3|CPU_SSSE3|CPU_SMM|\ + CPU_Prot|CPU_Priv +#define PROC_penryn CPU_186|CPU_286|CPU_386|CPU_486|CPU_586|CPU_686|\ + CPU_Hammer|CPU_EM64T|CPU_FPU|CPU_MMX|\ + CPU_SSE|CPU_SSE2|CPU_SSE3|CPU_SSSE3|CPU_SSE41|CPU_SMM|\ + CPU_Prot|CPU_Priv +#define PROC_nehalem CPU_186|CPU_286|CPU_386|CPU_486|CPU_586|CPU_686|\ + CPU_Hammer|CPU_EM64T|CPU_FPU|CPU_MMX|\ + CPU_SSE|CPU_SSE2|CPU_SSE3|CPU_SSSE3|CPU_SSE41|\ + CPU_SSE42|CPU_SMM|CPU_Prot|CPU_Priv + +%} +%ignore-case +%language=ANSI-C +%compare-strncmp +%readonly-tables +%enum +%struct-type +%define hash-function-name cpu_hash +%define lookup-function-name cpu_find +struct cpu_parse_data { + const char *name; + enum cpu_mode mode; + unsigned long cpu; +}; +%% +8086, CPU_MODE_VERBATIM, CPU_Priv +186, CPU_MODE_VERBATIM, PROC_186 +80186, CPU_MODE_VERBATIM, PROC_186 +i186, CPU_MODE_VERBATIM, PROC_186 +286, CPU_MODE_VERBATIM, PROC_286 +80286, CPU_MODE_VERBATIM, PROC_286 +i286, CPU_MODE_VERBATIM, PROC_286 +386, CPU_MODE_VERBATIM, PROC_386 +80386, CPU_MODE_VERBATIM, PROC_386 +i386, CPU_MODE_VERBATIM, PROC_386 +486, CPU_MODE_VERBATIM, PROC_486 +80486, CPU_MODE_VERBATIM, PROC_486 +i486, CPU_MODE_VERBATIM, PROC_486 +586, CPU_MODE_VERBATIM, PROC_586 +i586, CPU_MODE_VERBATIM, PROC_586 +pentium, CPU_MODE_VERBATIM, PROC_586 +p5, CPU_MODE_VERBATIM, PROC_586 +686, CPU_MODE_VERBATIM, PROC_686 +i686, CPU_MODE_VERBATIM, PROC_686 +p6, CPU_MODE_VERBATIM, PROC_686 +ppro, CPU_MODE_VERBATIM, PROC_686 +pentiumpro, CPU_MODE_VERBATIM, PROC_686 +p2, CPU_MODE_VERBATIM, PROC_p2 +pentium2, CPU_MODE_VERBATIM, PROC_p2 +pentium-2, CPU_MODE_VERBATIM, PROC_p2 +pentiumii, CPU_MODE_VERBATIM, PROC_p2 +pentium-ii, CPU_MODE_VERBATIM, PROC_p2 +p3, CPU_MODE_VERBATIM, PROC_p3 +pentium3, CPU_MODE_VERBATIM, PROC_p3 +pentium-3, CPU_MODE_VERBATIM, PROC_p3 +pentiumiii, CPU_MODE_VERBATIM, PROC_p3 +pentium-iii, CPU_MODE_VERBATIM, PROC_p3 +katmai, CPU_MODE_VERBATIM, PROC_p3 +p4, CPU_MODE_VERBATIM, PROC_p4 +pentium4, CPU_MODE_VERBATIM, PROC_p4 +pentium-4, CPU_MODE_VERBATIM, PROC_p4 +pentiumiv, CPU_MODE_VERBATIM, PROC_p4 +pentium-iv, CPU_MODE_VERBATIM, PROC_p4 +williamette, CPU_MODE_VERBATIM, PROC_p4 +ia64, CPU_MODE_VERBATIM, PROC_ia64 +ia-64, CPU_MODE_VERBATIM, PROC_ia64 +itanium, CPU_MODE_VERBATIM, PROC_ia64 +k6, CPU_MODE_VERBATIM, PROC_k6 +k7, CPU_MODE_VERBATIM, PROC_k7 +athlon, CPU_MODE_VERBATIM, PROC_k7 +hammer, CPU_MODE_VERBATIM, PROC_hammer +sledgehammer, CPU_MODE_VERBATIM, PROC_hammer +opteron, CPU_MODE_VERBATIM, PROC_hammer +athlon64, CPU_MODE_VERBATIM, PROC_hammer +athlon-64, CPU_MODE_VERBATIM, PROC_hammer +prescott, CPU_MODE_VERBATIM, PROC_prescott +conroe, CPU_MODE_VERBATIM, PROC_conroe +penryn, CPU_MODE_VERBATIM, PROC_penryn +nehalem, CPU_MODE_VERBATIM, PROC_nehalem +# +# Features have "no" versions to disable them, and only set/reset the +# specific feature being changed. All other bits are left alone. +# +fpu, CPU_MODE_SET, CPU_FPU +nofpu, CPU_MODE_CLEAR, CPU_FPU +mmx, CPU_MODE_SET, CPU_MMX +nommx, CPU_MODE_CLEAR, CPU_MMX +sse, CPU_MODE_SET, CPU_SSE +nosse, CPU_MODE_CLEAR, CPU_SSE +sse2, CPU_MODE_SET, CPU_SSE2 +nosse2, CPU_MODE_CLEAR, CPU_SSE2 +sse3, CPU_MODE_SET, CPU_SSE3 +nosse3, CPU_MODE_CLEAR, CPU_SSE3 +#pni, CPU_MODE_SET, CPU_PNI +#nopni, CPU_MODE_CLEAR, CPU_PNI +3dnow, CPU_MODE_SET, CPU_3DNow +no3dnow, CPU_MODE_CLEAR, CPU_3DNow +cyrix, CPU_MODE_SET, CPU_Cyrix +nocyrix, CPU_MODE_CLEAR, CPU_Cyrix +amd, CPU_MODE_SET, CPU_AMD +noamd, CPU_MODE_CLEAR, CPU_AMD +smm, CPU_MODE_SET, CPU_SMM +nosmm, CPU_MODE_CLEAR, CPU_SMM +prot, CPU_MODE_SET, CPU_Prot +noprot, CPU_MODE_CLEAR, CPU_Prot +protected, CPU_MODE_SET, CPU_Prot +noprotected, CPU_MODE_CLEAR, CPU_Prot +undoc, CPU_MODE_SET, CPU_Undoc +noundoc, CPU_MODE_CLEAR, CPU_Undoc +undocumented, CPU_MODE_SET, CPU_Undoc +noundocumented, CPU_MODE_CLEAR, CPU_Undoc +obs, CPU_MODE_SET, CPU_Obs +noobs, CPU_MODE_CLEAR, CPU_Obs +obsolete, CPU_MODE_SET, CPU_Obs +noobsolete, CPU_MODE_CLEAR, CPU_Obs +priv, CPU_MODE_SET, CPU_Priv +nopriv, CPU_MODE_CLEAR, CPU_Priv +privileged, CPU_MODE_SET, CPU_Priv +noprivileged, CPU_MODE_CLEAR, CPU_Priv +svm, CPU_MODE_SET, CPU_SVM +nosvm, CPU_MODE_CLEAR, CPU_SVM +padlock, CPU_MODE_SET, CPU_PadLock +nopadlock, CPU_MODE_CLEAR, CPU_PadLock +em64t, CPU_MODE_SET, CPU_EM64T +noem64t, CPU_MODE_CLEAR, CPU_EM64T +ssse3, CPU_MODE_SET, CPU_SSSE3 +nossse3, CPU_MODE_CLEAR, CPU_SSSE3 +sse4.1, CPU_MODE_SET, CPU_SSE41 +nosse4.1, CPU_MODE_CLEAR, CPU_SSE41 +sse4.2, CPU_MODE_SET, CPU_SSE42 +nosse4.2, CPU_MODE_CLEAR, CPU_SSE42 +sse4, CPU_MODE_SET, CPU_SSE4 +nosse4, CPU_MODE_CLEAR, CPU_SSE4 +%% + +void +yasm_x86__parse_cpu(yasm_arch_x86 *arch_x86, const char *cpuid, + size_t cpuid_len) +{ + /*@null@*/ const struct cpu_parse_data *pdata; + + if (cpuid_len > 15) + return; + + pdata = cpu_find(cpuid, cpuid_len); + if (!pdata) { + yasm_warn_set(YASM_WARN_GENERAL, + N_("unrecognized CPU identifier `%s'"), cpuid); + return; + } + + switch (pdata->mode) { + case CPU_MODE_VERBATIM: + arch_x86->cpu_enabled = pdata->cpu; + break; + case CPU_MODE_SET: + arch_x86->cpu_enabled |= pdata->cpu; + break; + case CPU_MODE_CLEAR: + arch_x86->cpu_enabled &= ~pdata->cpu; + break; + } +} diff --git a/modules/arch/x86/x86geninsn.c b/modules/arch/x86/x86geninsn.c new file mode 100644 index 00000000..1d2aa48c --- /dev/null +++ b/modules/arch/x86/x86geninsn.c @@ -0,0 +1,197 @@ +/* $Id$ + * + * Generate x86 instructions gperf files + * + * Copyright (C) 2006-2007 Peter Johnson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include +#include +#include +#include +#include + +static char line[1024]; +static unsigned int cur_line = 1; +unsigned int num_errors = 0; + +static void +report_error(const char *fmt, ...) +{ + va_list ap; + + fprintf(stderr, "%u: ", cur_line); + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + va_end(ap); + fputc('\n', stderr); + num_errors++; +} + +static void +parse_insn(FILE *out_nasm, FILE *out_gas) +{ + char *parser = strtok(NULL, " \t\n"); + char *bname = strtok(NULL, " \t\n"); + char *suffix = strtok(NULL, " \t\n"); + char *group = strtok(NULL, " \t\n"); + char *mod = strtok(NULL, " \t\n"); + char *cpu = strtok(NULL, " \t\n"); + + if (!suffix) { + report_error("INSN requires suffix"); + return; + } + + if (suffix[0] != '"') { + /* Just one instruction to generate */ + if (parser[0] == '-' || strcmp(parser, "gas") == 0) + fprintf(out_gas, + "%s,\t%s_insn,\t(%sUL<<8)|NELEMS(%s_insn),\t%s,\t%s\n", + bname, group, mod, group, cpu, suffix); + if (parser[0] == '-' || strcmp(parser, "nasm") == 0) + fprintf(out_nasm, + "%s,\t%s_insn,\t(%sUL<<8)|NELEMS(%s_insn),\t%s,\t%s\n", + bname, group, mod, group, cpu, suffix); + } else { + /* Need to generate with suffixes for gas */ + char *p; + char sufstr[6]; + size_t bnamelen = strlen(bname); + char *name = malloc(bnamelen+2); + + strcpy(name, bname); + strcpy(sufstr, "SUF_X"); + + for (p = &suffix[1]; *p != '"'; p++) { + sufstr[4] = toupper(*p); + + name[bnamelen] = tolower(*p); + name[bnamelen+1] = '\0'; + + fprintf(out_gas, + "%s,\t%s_insn,\t(%sUL<<8)|NELEMS(%s_insn),\t%s,\t%s\n", + name, group, mod, group, cpu, sufstr); + } + free(name); + + /* And finally the version sans suffix */ + if (parser[0] == '-' || strcmp(parser, "gas") == 0) + fprintf(out_gas, + "%s,\t%s_insn,\t(%sUL<<8)|NELEMS(%s_insn),\t%s,\t%s\n", + bname, group, mod, group, cpu, "NONE"); + if (parser[0] == '-' || strcmp(parser, "nasm") == 0) + fprintf(out_nasm, + "%s,\t%s_insn,\t(%sUL<<8)|NELEMS(%s_insn),\t%s,\t%s\n", + bname, group, mod, group, cpu, "NONE"); + } +} + +static void +parse_prefix(FILE *out_nasm, FILE *out_gas) +{ + char *parser = strtok(NULL, " \t\n"); + char *name = strtok(NULL, " \t\n"); + char *type = strtok(NULL, " \t\n"); + char *value = strtok(NULL, " \t\n"); + + if (parser[0] == '-' || strcmp(parser, "gas") == 0) + fprintf(out_gas, "%s,\tNULL,\t%s,\t%s,\tNONE\n", name, type, value); + if (parser[0] == '-' || strcmp(parser, "nasm") == 0) + fprintf(out_nasm, "%s,\tNULL,\t%s,\t%s,\tNONE\n", name, type, value); +} + +void +output_base(FILE *out, const char *parser) +{ + fputs("%ignore-case\n", out); + fputs("%language=ANSI-C\n", out); + fputs("%compare-strncmp\n", out); + fputs("%readonly-tables\n", out); + fputs("%enum\n", out); + fputs("%struct-type\n", out); + fprintf(out, "%%define hash-function-name insnprefix_%s_hash\n", parser); + fprintf(out, "%%define lookup-function-name insnprefix_%s_find\n", parser); + fputs("struct insnprefix_parse_data;\n", out); + fputs("%%\n", out); +} + +int +main(int argc, char *argv[]) +{ + FILE *in, *out_nasm, *out_gas; + size_t i; + char *tok; + + if (argc != 4) { + fprintf(stderr, "Usage: x86geninsn \n"); + return EXIT_FAILURE; + } + + in = fopen(argv[1], "rt"); + if (!in) { + fprintf(stderr, "Could not open `%s' for reading\n", argv[1]); + return EXIT_FAILURE; + } + + out_nasm = fopen(argv[2], "wt"); + if (!out_nasm) { + fprintf(stderr, "Could not open `%s' for writing\n", argv[2]); + return EXIT_FAILURE; + } + out_gas = fopen(argv[3], "wt"); + if (!out_gas) { + fprintf(stderr, "Could not open `%s' for writing\n", argv[2]); + return EXIT_FAILURE; + } + + output_base(out_nasm, "nasm"); + output_base(out_gas, "gas"); + + /* Parse input file */ + while (fgets(line, 1024, in)) { + int found; + /*printf("%s\n", line);*/ + tok = strtok(line, " \t\n"); + if (!tok) + continue; + + /* Comments start with # as the first thing on a line */ + if (tok[0] == '#') + continue; + + if (strcmp(tok, "INSN") == 0) + parse_insn(out_nasm, out_gas); + else if (strcmp(tok, "PREFIX") == 0) + parse_prefix(out_nasm, out_gas); + else + report_error("unknown directive `%s'\n", tok); + cur_line++; + } + + if (num_errors > 0) + return EXIT_FAILURE; + + return EXIT_SUCCESS; +} + diff --git a/modules/arch/x86/x86id.c b/modules/arch/x86/x86id.c index 807e9d45..d1257be4 100644 --- a/modules/arch/x86/x86id.c +++ b/modules/arch/x86/x86id.c @@ -3417,41 +3417,12 @@ typedef struct insnprefix_parse_data { WEAK = 0x80 /* Relaxed operand mode for GAS */ } flags; } insnprefix_parse_data; -#define INSN(name, flags, group, mod, cpu) \ - { name, group##_insn, (mod##UL<<8)|NELEMS(group##_insn), cpu, flags } #define PREFIX(name, type, value) \ { name, NULL, type, value, NONE } -/* Static parse data structure for CPU feature flags */ -typedef struct cpu_parse_data { - const char *name; - - unsigned long cpu; - enum { - CPU_MODE_VERBATIM, - CPU_MODE_SET, - CPU_MODE_CLEAR - } mode; -} cpu_parse_data; - -typedef struct regtmod_parse_data { - const char *name; - - unsigned long regtmod; -} regtmod_parse_data; -#define REG(name, type, index, bits) \ - { name, (((unsigned long)YASM_ARCH_REG) << 24) | \ - (((unsigned long)bits) << 16) | (type | index) } -#define REGGROUP(name, group) \ - { name, (((unsigned long)YASM_ARCH_REGGROUP) << 24) | (group) } -#define SEGREG(name, prefix, num, bits) \ - { name, (((unsigned long)YASM_ARCH_SEGREG) << 24) | \ - (((unsigned long)bits) << 16) | (prefix << 8) | (num) } -#define TARGETMOD(name, mod) \ - { name, (((unsigned long)YASM_ARCH_TARGETMOD) << 24) | (mod) } - /* Pull in all parse data */ -#include "x86parse.c" +#include "x86insn_nasm.c" +#include "x86insn_gas.c" static const char * cpu_find_reverse(unsigned long cpu) @@ -3633,80 +3604,6 @@ yasm_x86__parse_check_insnprefix(yasm_arch *arch, const char *id, } } -void -yasm_x86__parse_cpu(yasm_arch_x86 *arch_x86, const char *cpuid, - size_t cpuid_len) -{ - /*@null@*/ const cpu_parse_data *pdata; - size_t i; - static char lcaseid[16]; - - if (cpuid_len > 15) - return; - for (i=0; imode) { - case CPU_MODE_VERBATIM: - arch_x86->cpu_enabled = pdata->cpu; - break; - case CPU_MODE_SET: - arch_x86->cpu_enabled |= pdata->cpu; - break; - case CPU_MODE_CLEAR: - arch_x86->cpu_enabled &= ~pdata->cpu; - break; - } -} - -yasm_arch_regtmod -yasm_x86__parse_check_regtmod(yasm_arch *arch, const char *id, size_t id_len, - uintptr_t *data) -{ - yasm_arch_x86 *arch_x86 = (yasm_arch_x86 *)arch; - /*@null@*/ const regtmod_parse_data *pdata; - size_t i; - static char lcaseid[8]; - unsigned int bits; - yasm_arch_regtmod type; - - if (id_len > 7) - return YASM_ARCH_NOTREGTMOD; - for (i=0; iregtmod >> 24); - bits = (pdata->regtmod >> 16) & 0xFF; - - if (type == YASM_ARCH_REG && bits != 0 && arch_x86->mode_bits != bits) { - yasm_warn_set(YASM_WARN_GENERAL, - N_("`%s' is a register in %u-bit mode"), id, bits); - return YASM_ARCH_NOTREGTMOD; - } - - if (type == YASM_ARCH_SEGREG && bits != 0 && arch_x86->mode_bits == bits) { - yasm_warn_set(YASM_WARN_GENERAL, - N_("`%s' segment register ignored in %u-bit mode"), id, - bits); - } - - *data = pdata->regtmod & 0x0000FFFFUL; - return type; -} - static void x86_id_insn_destroy(void *contents) { diff --git a/modules/arch/x86/x86parse.gap b/modules/arch/x86/x86insn.in similarity index 83% rename from modules/arch/x86/x86parse.gap rename to modules/arch/x86/x86insn.in index b06a930d..6fd0fc95 100644 --- a/modules/arch/x86/x86parse.gap +++ b/modules/arch/x86/x86insn.in @@ -1,4 +1,4 @@ -# GAP (gen_arch_parse) input file for x86 architecture +# x86 instruction and prefix recognition # $Id$ # # Copyright (C) 2001-2007 Peter Johnson @@ -24,12 +24,6 @@ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. -# Configure GAP for x86 generation mode -ARCH x86 - -# Supported x86 parsers -PARSERS nasm gas - # INSN parameters: # - parser (- if any) # - base name of instruction @@ -910,142 +904,6 @@ INSN - smi NONE onebyte 0x00F1 CPU_386|CPU_Undoc INSN - umov NONE umov 0 CPU_386|CPU_Undoc INSN - xbts NONE xbts 0 CPU_386|CPU_Undoc|CPU_Obs - -# DEF_CPU parameters: -# - CPU name -# - CPU flags to set -# DEF_CPU_ALIAS parameters: -# - CPU alias name -# - CPU base name -# DEF_CPU_FEATURE parameters: -# - CPU feature name -# - CPU flag to set feature name alone or unset ("no" + feature name) - -# The standard CPU names /set/ cpu_enabled. -CPU 8086 CPU_Priv -CPU 186 CPU_186|CPU_Priv -CPU_ALIAS 80186 186 -CPU_ALIAS i186 186 -CPU 286 CPU_186|CPU_286|CPU_Priv -CPU_ALIAS 80286 286 -CPU_ALIAS i286 286 -CPU 386 CPU_186|CPU_286|CPU_386|CPU_SMM|CPU_Prot|CPU_Priv -CPU_ALIAS 80386 386 -CPU_ALIAS i386 386 -CPU 486 CPU_186|CPU_286|CPU_386|CPU_486|CPU_FPU|CPU_SMM|\ - CPU_Prot|CPU_Priv -CPU_ALIAS 80486 486 -CPU_ALIAS i486 486 -CPU 586 CPU_186|CPU_286|CPU_386|CPU_486|CPU_586|CPU_FPU|\ - CPU_SMM|CPU_Prot|CPU_Priv -CPU_ALIAS i586 586 -CPU_ALIAS pentium 586 -CPU_ALIAS p5 586 -CPU 686 CPU_186|CPU_286|CPU_386|CPU_486|CPU_586|CPU_686|\ - CPU_FPU|CPU_SMM|CPU_Prot|CPU_Priv -CPU_ALIAS i686 686 -CPU_ALIAS p6 686 -CPU_ALIAS ppro 686 -CPU_ALIAS pentiumpro 686 -CPU p2 CPU_186|CPU_286|CPU_386|CPU_486|CPU_586|CPU_686|\ - CPU_FPU|CPU_MMX|CPU_SMM|CPU_Prot|CPU_Priv -CPU_ALIAS pentium2 p2 -CPU_ALIAS pentium-2 p2 -CPU_ALIAS pentiumii p2 -CPU_ALIAS pentium-ii p2 -CPU p3 CPU_186|CPU_286|CPU_386|CPU_486|CPU_586|CPU_686|\ - CPU_P3|CPU_FPU|CPU_MMX|CPU_SSE|CPU_SMM|CPU_Prot|\ - CPU_Priv -CPU_ALIAS pentium3 p3 -CPU_ALIAS pentium-3 p3 -CPU_ALIAS pentiumiii p3 -CPU_ALIAS pentium-iii p3 -CPU_ALIAS katmai p3 -CPU p4 CPU_186|CPU_286|CPU_386|CPU_486|CPU_586|CPU_686|\ - CPU_P3|CPU_P4|CPU_FPU|CPU_MMX|CPU_SSE|CPU_SSE2|\ - CPU_SMM|CPU_Prot|CPU_Priv -CPU_ALIAS pentium4 p4 -CPU_ALIAS pentium-4 p4 -CPU_ALIAS pentiumiv p4 -CPU_ALIAS pentium-iv p4 -CPU_ALIAS williamette p4 -CPU ia64 CPU_186|CPU_286|CPU_386|CPU_486|CPU_586|CPU_686|\ - CPU_P3|CPU_P4|CPU_IA64|CPU_FPU|CPU_MMX|CPU_SSE|\ - CPU_SSE2|CPU_SMM|CPU_Prot|CPU_Priv -CPU_ALIAS ia-64 ia64 -CPU_ALIAS itanium ia64 -CPU k6 CPU_186|CPU_286|CPU_386|CPU_486|CPU_586|CPU_686|\ - CPU_K6|CPU_FPU|CPU_MMX|CPU_3DNow|CPU_SMM|CPU_Prot|\ - CPU_Priv -CPU k7 CPU_186|CPU_286|CPU_386|CPU_486|CPU_586|CPU_686|\ - CPU_K6|CPU_Athlon|CPU_FPU|CPU_MMX|CPU_SSE|CPU_3DNow|\ - CPU_SMM|CPU_Prot|CPU_Priv -CPU_ALIAS athlon k7 -CPU hammer CPU_186|CPU_286|CPU_386|CPU_486|CPU_586|CPU_686|\ - CPU_K6|CPU_Athlon|CPU_Hammer|CPU_FPU|CPU_MMX|\ - CPU_SSE|CPU_SSE2|CPU_3DNow|CPU_SMM|CPU_Prot|\ - CPU_Priv -CPU_ALIAS sledgehammer hammer -CPU_ALIAS opteron hammer -CPU_ALIAS athlon64 hammer -CPU_ALIAS athlon-64 hammer -CPU prescott CPU_186|CPU_286|CPU_386|CPU_486|CPU_586|CPU_686|\ - CPU_Hammer|CPU_EM64T|CPU_FPU|CPU_MMX|\ - CPU_SSE|CPU_SSE2|CPU_SSE3|CPU_SMM|\ - CPU_Prot|CPU_Priv -CPU conroe CPU_186|CPU_286|CPU_386|CPU_486|CPU_586|CPU_686|\ - CPU_Hammer|CPU_EM64T|CPU_FPU|CPU_MMX|\ - CPU_SSE|CPU_SSE2|CPU_SSE3|CPU_SSSE3|CPU_SMM|\ - CPU_Prot|CPU_Priv -CPU penryn CPU_186|CPU_286|CPU_386|CPU_486|CPU_586|CPU_686|\ - CPU_Hammer|CPU_EM64T|CPU_FPU|CPU_MMX|\ - CPU_SSE|CPU_SSE2|CPU_SSE3|CPU_SSSE3|CPU_SSE41|CPU_SMM|\ - CPU_Prot|CPU_Priv -CPU nehalem CPU_186|CPU_286|CPU_386|CPU_486|CPU_586|CPU_686|\ - CPU_Hammer|CPU_EM64T|CPU_FPU|CPU_MMX|\ - CPU_SSE|CPU_SSE2|CPU_SSE3|CPU_SSSE3|CPU_SSE41|\ - CPU_SSE42|CPU_SMM|CPU_Prot|CPU_Priv - -# Features have "no" versions to disable them, and only set/reset the -# specific feature being changed. All other bits are left alone. - -CPU_FEATURE fpu CPU_FPU -CPU_FEATURE mmx CPU_MMX -CPU_FEATURE sse CPU_SSE -CPU_FEATURE sse2 CPU_SSE2 -CPU_FEATURE sse3 CPU_SSE3 -#CPU_FEATURE pni CPU_PNI -CPU_FEATURE 3dnow CPU_3DNow -CPU_FEATURE cyrix CPU_Cyrix -CPU_FEATURE amd CPU_AMD -CPU_FEATURE smm CPU_SMM -CPU_FEATURE prot CPU_Prot -CPU_FEATURE protected CPU_Prot -CPU_FEATURE undoc CPU_Undoc -CPU_FEATURE undocumented CPU_Undoc -CPU_FEATURE obs CPU_Obs -CPU_FEATURE obsolete CPU_Obs -CPU_FEATURE priv CPU_Priv -CPU_FEATURE privileged CPU_Priv -CPU_FEATURE svm CPU_SVM -CPU_FEATURE padlock CPU_PadLock -CPU_FEATURE em64t CPU_EM64T -CPU_FEATURE ssse3 CPU_SSSE3 -CPU_FEATURE sse4.1 CPU_SSE41 -CPU_FEATURE sse4.2 CPU_SSE42 -CPU_FEATURE sse4 CPU_SSE4 - - -# TARGETMOD parameters: -# - target modifier name -# - modifier to return - -TARGETMOD near X86_NEAR -TARGETMOD short X86_SHORT -TARGETMOD far X86_FAR -TARGETMOD to X86_TO - - # PREFIX parameters: # - parser # - prefix name @@ -1105,170 +963,3 @@ PREFIX gas rex64xz X86_REX 0x4D PREFIX gas rex64xy X86_REX 0x4E PREFIX gas rex64xyz X86_REX 0x4F - -# REG parameters: -# - register name -# - register type -# - register index -# - required BITS setting (0 for any) -# -# REGGROUP parameters: -# - register group name -# - register group type -# -# SEGREG parameters: -# - segment register name -# - prefix encoding -# - register encoding -# - BITS in which the segment is ignored - -# control, debug, and test registers -REG cr0 X86_CRREG 0 0 -REG cr2 X86_CRREG 2 0 -REG cr3 X86_CRREG 3 0 -REG cr4 X86_CRREG 4 0 -REG cr8 X86_CRREG 8 64 - -REG dr0 X86_DRREG 0 0 -REG dr1 X86_DRREG 1 0 -REG dr2 X86_DRREG 2 0 -REG dr3 X86_DRREG 3 0 -REG dr4 X86_DRREG 4 0 -REG dr5 X86_DRREG 5 0 -REG dr6 X86_DRREG 6 0 -REG dr7 X86_DRREG 7 0 - -REG tr0 X86_TRREG 0 0 -REG tr1 X86_TRREG 1 0 -REG tr2 X86_TRREG 2 0 -REG tr3 X86_TRREG 3 0 -REG tr4 X86_TRREG 4 0 -REG tr5 X86_TRREG 5 0 -REG tr6 X86_TRREG 6 0 -REG tr7 X86_TRREG 7 0 - -# floating point, MMX, and SSE/SSE2 registers -REG st0 X86_FPUREG 0 0 -REG st1 X86_FPUREG 1 0 -REG st2 X86_FPUREG 2 0 -REG st3 X86_FPUREG 3 0 -REG st4 X86_FPUREG 4 0 -REG st5 X86_FPUREG 5 0 -REG st6 X86_FPUREG 6 0 -REG st7 X86_FPUREG 7 0 - -REG mm0 X86_MMXREG 0 0 -REG mm1 X86_MMXREG 1 0 -REG mm2 X86_MMXREG 2 0 -REG mm3 X86_MMXREG 3 0 -REG mm4 X86_MMXREG 4 0 -REG mm5 X86_MMXREG 5 0 -REG mm6 X86_MMXREG 6 0 -REG mm7 X86_MMXREG 7 0 - -REG xmm0 X86_XMMREG 0 0 -REG xmm1 X86_XMMREG 1 0 -REG xmm2 X86_XMMREG 2 0 -REG xmm3 X86_XMMREG 3 0 -REG xmm4 X86_XMMREG 4 0 -REG xmm5 X86_XMMREG 5 0 -REG xmm6 X86_XMMREG 6 0 -REG xmm7 X86_XMMREG 7 0 -REG xmm8 X86_XMMREG 8 64 -REG xmm9 X86_XMMREG 9 64 -REG xmm10 X86_XMMREG 10 64 -REG xmm11 X86_XMMREG 11 64 -REG xmm12 X86_XMMREG 12 64 -REG xmm13 X86_XMMREG 13 64 -REG xmm14 X86_XMMREG 14 64 -REG xmm15 X86_XMMREG 15 64 - -# integer registers -REG rax X86_REG64 0 64 -REG rcx X86_REG64 1 64 -REG rdx X86_REG64 2 64 -REG rbx X86_REG64 3 64 -REG rsp X86_REG64 4 64 -REG rbp X86_REG64 5 64 -REG rsi X86_REG64 6 64 -REG rdi X86_REG64 7 64 -REG r8 X86_REG64 8 64 -REG r9 X86_REG64 9 64 -REG r10 X86_REG64 10 64 -REG r11 X86_REG64 11 64 -REG r12 X86_REG64 12 64 -REG r13 X86_REG64 13 64 -REG r14 X86_REG64 14 64 -REG r15 X86_REG64 15 64 - -REG eax X86_REG32 0 0 -REG ecx X86_REG32 1 0 -REG edx X86_REG32 2 0 -REG ebx X86_REG32 3 0 -REG esp X86_REG32 4 0 -REG ebp X86_REG32 5 0 -REG esi X86_REG32 6 0 -REG edi X86_REG32 7 0 -REG r8d X86_REG32 8 64 -REG r9d X86_REG32 9 64 -REG r10d X86_REG32 10 64 -REG r11d X86_REG32 11 64 -REG r12d X86_REG32 12 64 -REG r13d X86_REG32 13 64 -REG r14d X86_REG32 14 64 -REG r15d X86_REG32 15 64 - -REG ax X86_REG16 0 0 -REG cx X86_REG16 1 0 -REG dx X86_REG16 2 0 -REG bx X86_REG16 3 0 -REG sp X86_REG16 4 0 -REG bp X86_REG16 5 0 -REG si X86_REG16 6 0 -REG di X86_REG16 7 0 -REG r8w X86_REG16 8 64 -REG r9w X86_REG16 9 64 -REG r10w X86_REG16 10 64 -REG r11w X86_REG16 11 64 -REG r12w X86_REG16 12 64 -REG r13w X86_REG16 13 64 -REG r14w X86_REG16 14 64 -REG r15w X86_REG16 15 64 - -REG al X86_REG8 0 0 -REG cl X86_REG8 1 0 -REG dl X86_REG8 2 0 -REG bl X86_REG8 3 0 -REG ah X86_REG8 4 0 -REG ch X86_REG8 5 0 -REG dh X86_REG8 6 0 -REG bh X86_REG8 7 0 -REG r8b X86_REG8 8 64 -REG r9b X86_REG8 9 64 -REG r10b X86_REG8 10 64 -REG r11b X86_REG8 11 64 -REG r12b X86_REG8 12 64 -REG r13b X86_REG8 13 64 -REG r14b X86_REG8 14 64 -REG r15b X86_REG8 15 64 - -REG spl X86_REG8X 4 64 -REG bpl X86_REG8X 5 64 -REG sil X86_REG8X 6 64 -REG dil X86_REG8X 7 64 - -REG rip X86_RIP 0 64 - -# floating point, MMX, and SSE/SSE2 registers -REGGROUP st X86_FPUREG -REGGROUP mm X86_MMXREG -REGGROUP xmm X86_XMMREG - -# segment registers -SEGREG es 0x26 0x00 64 -SEGREG cs 0x2e 0x01 0 -SEGREG ss 0x36 0x02 64 -SEGREG ds 0x3e 0x03 64 -SEGREG fs 0x64 0x04 0 -SEGREG gs 0x65 0x05 0 - diff --git a/modules/arch/x86/x86regtmod.gperf b/modules/arch/x86/x86regtmod.gperf new file mode 100644 index 00000000..e9d2ac9c --- /dev/null +++ b/modules/arch/x86/x86regtmod.gperf @@ -0,0 +1,274 @@ +# +# x86 register and target modifier recognition +# +# Copyright (C) 2002-2007 Peter Johnson +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +%{ +#include +RCSID("$Id$"); + +#include +#include + +#include "modules/arch/x86/x86arch.h" + +enum regtmod_type { + REG = 1, + REGGROUP, + SEGREG, + TARGETMOD +}; +%} +%ignore-case +%language=ANSI-C +%compare-strncmp +%readonly-tables +%enum +%struct-type +%define hash-function-name regtmod_hash +%define lookup-function-name regtmod_find +struct regtmod_parse_data { + const char *name; + unsigned int type:8; /* regtmod_type */ + + /* REG: register size + * SEGREG: prefix encoding + * Others: 0 + */ + unsigned int size_prefix:8; + + /* REG: register index + * REGGROUP: register group type + * SEGREG: register encoding + * TARGETMOD: target modifier + */ + unsigned int data:8; + + /* REG: required bits setting + * SEGREG: BITS in which the segment is ignored + * Others: 0 + */ + unsigned int bits:8; +}; +%% +# +# control, debug, and test registers +# +cr0, REG, X86_CRREG, 0, 0 +cr2, REG, X86_CRREG, 2, 0 +cr3, REG, X86_CRREG, 3, 0 +cr4, REG, X86_CRREG, 4, 0 +cr8, REG, X86_CRREG, 8, 64 +# +dr0, REG, X86_DRREG, 0, 0 +dr1, REG, X86_DRREG, 1, 0 +dr2, REG, X86_DRREG, 2, 0 +dr3, REG, X86_DRREG, 3, 0 +dr4, REG, X86_DRREG, 4, 0 +dr5, REG, X86_DRREG, 5, 0 +dr6, REG, X86_DRREG, 6, 0 +dr7, REG, X86_DRREG, 7, 0 +# +tr0, REG, X86_TRREG, 0, 0 +tr1, REG, X86_TRREG, 1, 0 +tr2, REG, X86_TRREG, 2, 0 +tr3, REG, X86_TRREG, 3, 0 +tr4, REG, X86_TRREG, 4, 0 +tr5, REG, X86_TRREG, 5, 0 +tr6, REG, X86_TRREG, 6, 0 +tr7, REG, X86_TRREG, 7, 0 +# +# floating point, MMX, and SSE/SSE2 registers +# +st0, REG, X86_FPUREG, 0, 0 +st1, REG, X86_FPUREG, 1, 0 +st2, REG, X86_FPUREG, 2, 0 +st3, REG, X86_FPUREG, 3, 0 +st4, REG, X86_FPUREG, 4, 0 +st5, REG, X86_FPUREG, 5, 0 +st6, REG, X86_FPUREG, 6, 0 +st7, REG, X86_FPUREG, 7, 0 +# +mm0, REG, X86_MMXREG, 0, 0 +mm1, REG, X86_MMXREG, 1, 0 +mm2, REG, X86_MMXREG, 2, 0 +mm3, REG, X86_MMXREG, 3, 0 +mm4, REG, X86_MMXREG, 4, 0 +mm5, REG, X86_MMXREG, 5, 0 +mm6, REG, X86_MMXREG, 6, 0 +mm7, REG, X86_MMXREG, 7, 0 +# +xmm0, REG, X86_XMMREG, 0, 0 +xmm1, REG, X86_XMMREG, 1, 0 +xmm2, REG, X86_XMMREG, 2, 0 +xmm3, REG, X86_XMMREG, 3, 0 +xmm4, REG, X86_XMMREG, 4, 0 +xmm5, REG, X86_XMMREG, 5, 0 +xmm6, REG, X86_XMMREG, 6, 0 +xmm7, REG, X86_XMMREG, 7, 0 +xmm8, REG, X86_XMMREG, 8, 64 +xmm9, REG, X86_XMMREG, 9, 64 +xmm10, REG, X86_XMMREG, 10, 64 +xmm11, REG, X86_XMMREG, 11, 64 +xmm12, REG, X86_XMMREG, 12, 64 +xmm13, REG, X86_XMMREG, 13, 64 +xmm14, REG, X86_XMMREG, 14, 64 +xmm15, REG, X86_XMMREG, 15, 64 +# +# integer registers +# +rax, REG, X86_REG64, 0, 64 +rcx, REG, X86_REG64, 1, 64 +rdx, REG, X86_REG64, 2, 64 +rbx, REG, X86_REG64, 3, 64 +rsp, REG, X86_REG64, 4, 64 +rbp, REG, X86_REG64, 5, 64 +rsi, REG, X86_REG64, 6, 64 +rdi, REG, X86_REG64, 7, 64 +r8, REG, X86_REG64, 8, 64 +r9, REG, X86_REG64, 9, 64 +r10, REG, X86_REG64, 10, 64 +r11, REG, X86_REG64, 11, 64 +r12, REG, X86_REG64, 12, 64 +r13, REG, X86_REG64, 13, 64 +r14, REG, X86_REG64, 14, 64 +r15, REG, X86_REG64, 15, 64 +# +eax, REG, X86_REG32, 0, 0 +ecx, REG, X86_REG32, 1, 0 +edx, REG, X86_REG32, 2, 0 +ebx, REG, X86_REG32, 3, 0 +esp, REG, X86_REG32, 4, 0 +ebp, REG, X86_REG32, 5, 0 +esi, REG, X86_REG32, 6, 0 +edi, REG, X86_REG32, 7, 0 +r8d, REG, X86_REG32, 8, 64 +r9d, REG, X86_REG32, 9, 64 +r10d, REG, X86_REG32, 10, 64 +r11d, REG, X86_REG32, 11, 64 +r12d, REG, X86_REG32, 12, 64 +r13d, REG, X86_REG32, 13, 64 +r14d, REG, X86_REG32, 14, 64 +r15d, REG, X86_REG32, 15, 64 +# +ax, REG, X86_REG16, 0, 0 +cx, REG, X86_REG16, 1, 0 +dx, REG, X86_REG16, 2, 0 +bx, REG, X86_REG16, 3, 0 +sp, REG, X86_REG16, 4, 0 +bp, REG, X86_REG16, 5, 0 +si, REG, X86_REG16, 6, 0 +di, REG, X86_REG16, 7, 0 +r8w, REG, X86_REG16, 8, 64 +r9w, REG, X86_REG16, 9, 64 +r10w, REG, X86_REG16, 10, 64 +r11w, REG, X86_REG16, 11, 64 +r12w, REG, X86_REG16, 12, 64 +r13w, REG, X86_REG16, 13, 64 +r14w, REG, X86_REG16, 14, 64 +r15w, REG, X86_REG16, 15, 64 +# +al, REG, X86_REG8, 0, 0 +cl, REG, X86_REG8, 1, 0 +dl, REG, X86_REG8, 2, 0 +bl, REG, X86_REG8, 3, 0 +ah, REG, X86_REG8, 4, 0 +ch, REG, X86_REG8, 5, 0 +dh, REG, X86_REG8, 6, 0 +bh, REG, X86_REG8, 7, 0 +r8b, REG, X86_REG8, 8, 64 +r9b, REG, X86_REG8, 9, 64 +r10b, REG, X86_REG8, 10, 64 +r11b, REG, X86_REG8, 11, 64 +r12b, REG, X86_REG8, 12, 64 +r13b, REG, X86_REG8, 13, 64 +r14b, REG, X86_REG8, 14, 64 +r15b, REG, X86_REG8, 15, 64 +# +spl, REG, X86_REG8X, 4, 64 +bpl, REG, X86_REG8X, 5, 64 +sil, REG, X86_REG8X, 6, 64 +dil, REG, X86_REG8X, 7, 64 +# +rip, REG, X86_RIP, 0, 64 +# +# floating point, MMX, and SSE/SSE2 registers +# +st, REGGROUP, 0, X86_FPUREG, 0 +mm, REGGROUP, 0, X86_MMXREG, 0 +xmm, REGGROUP, 0, X86_XMMREG, 0 +# +# segment registers +# +es, SEGREG, 0x26, 0x00, 64 +cs, SEGREG, 0x2e, 0x01, 0 +ss, SEGREG, 0x36, 0x02, 64 +ds, SEGREG, 0x3e, 0x03, 64 +fs, SEGREG, 0x64, 0x04, 0 +gs, SEGREG, 0x65, 0x05, 0 +# +# target modifiers +# +near, TARGETMOD, 0, X86_NEAR, 0 +short, TARGETMOD, 0, X86_SHORT, 0 +far, TARGETMOD, 0, X86_FAR, 0 +to, TARGETMOD, 0, X86_TO, 0 +%% + +yasm_arch_regtmod +yasm_x86__parse_check_regtmod(yasm_arch *arch, const char *id, size_t id_len, + uintptr_t *data) +{ + yasm_arch_x86 *arch_x86 = (yasm_arch_x86 *)arch; + /*@null@*/ const struct regtmod_parse_data *pdata; + unsigned int bits; + yasm_arch_regtmod type; + + if (id_len > 7) + return YASM_ARCH_NOTREGTMOD; + + pdata = regtmod_find(id, id_len); + if (!pdata) + return YASM_ARCH_NOTREGTMOD; + + type = (yasm_arch_regtmod)pdata->type; + bits = pdata->bits; + + if (type == YASM_ARCH_REG && bits != 0 && arch_x86->mode_bits != bits) { + yasm_warn_set(YASM_WARN_GENERAL, + N_("`%s' is a register in %u-bit mode"), id, bits); + return YASM_ARCH_NOTREGTMOD; + } + + if (type == YASM_ARCH_SEGREG && bits != 0 && arch_x86->mode_bits == bits) { + yasm_warn_set(YASM_WARN_GENERAL, + N_("`%s' segment register ignored in %u-bit mode"), id, + bits); + } + + if (type == YASM_ARCH_SEGREG) + *data = (pdata->size_prefix<<8) | pdata->data; + else + *data = pdata->size_prefix | pdata->data; + return type; +} diff --git a/tools/Makefile.inc b/tools/Makefile.inc index 56a4697f..984578b9 100644 --- a/tools/Makefile.inc +++ b/tools/Makefile.inc @@ -1,9 +1,9 @@ # $Id$ EXTRA_DIST += tools/re2c/Makefile.inc -EXTRA_DIST += tools/gap/Makefile.inc +EXTRA_DIST += tools/genperf/Makefile.inc EXTRA_DIST += tools/python-yasm/Makefile.inc include tools/re2c/Makefile.inc -include tools/gap/Makefile.inc +include tools/genperf/Makefile.inc include tools/python-yasm/Makefile.inc diff --git a/tools/gap/Makefile.inc b/tools/gap/Makefile.inc deleted file mode 100644 index 4457af76..00000000 --- a/tools/gap/Makefile.inc +++ /dev/null @@ -1,34 +0,0 @@ -# $Id$ - -# These utility programs have to be built for BUILD host in cross-build. -# This makes things rather non-standard automake - -noinst_PROGRAMS += gap - -gap_SOURCES = -EXTRA_DIST += tools/gap/gap.c -EXTRA_DIST += tools/gap/perfect.c -EXTRA_DIST += tools/gap/perfect.h -EXTRA_DIST += tools/gap/standard.h -gap_LDADD = gap.$(OBJEXT) -gap_LDADD += gap-perfect.$(OBJEXT) -gap_LDADD += gap-phash.$(OBJEXT) -gap_LDADD += gap-xmalloc.$(OBJEXT) -gap_LDADD += gap-xstrdup.$(OBJEXT) -gap_LINK = $(CCLD_FOR_BUILD) -o $@ - -gap.$(OBJEXT): tools/gap/gap.c - $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f tools/gap/gap.c || echo '$(srcdir)/'`tools/gap/gap.c - -gap-perfect.$(OBJEXT): tools/gap/perfect.c - $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f tools/gap/perfect.c || echo '$(srcdir)/'`tools/gap/perfect.c - -gap-phash.$(OBJEXT): libyasm/phash.c - $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f libyasm/phash.c || echo '$(srcdir)/'`libyasm/phash.c - -gap-xmalloc.$(OBJEXT): libyasm/xmalloc.c - $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f libyasm/xmalloc.c || echo '$(srcdir)/'`libyasm/xmalloc.c - -gap-xstrdup.$(OBJEXT): libyasm/xstrdup.c - $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f libyasm/xstrdup.c || echo '$(srcdir)/'`libyasm/xstrdup.c - diff --git a/tools/gap/gap.c b/tools/gap/gap.c deleted file mode 100644 index 0f135bf7..00000000 --- a/tools/gap/gap.c +++ /dev/null @@ -1,854 +0,0 @@ -/* $Id$ - * - * Generate Arch Parser (GAP): generates ARCHparse.c from ARCHparse.gap. - * - * Copyright (C) 2006-2007 Peter Johnson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ -#include -#include -#include -#include -#include "tools/gap/perfect.h" -#include "libyasm/compat-queue.h" -#include "libyasm/coretype.h" -#include "libyasm/errwarn.h" - -typedef STAILQ_HEAD(slist, sval) slist; -typedef struct sval { - STAILQ_ENTRY(sval) link; - char *str; -} sval; - -typedef STAILQ_HEAD(dir_list, dir) dir_list; -typedef struct dir { - STAILQ_ENTRY(dir) link; - char *name; - const char *func; - slist args; -} dir; - -typedef STAILQ_HEAD(dir_byp_list, dir_byp) dir_byp_list; -typedef struct dir_byp { - STAILQ_ENTRY(dir_byp) link; - /*@null@*/ char *parser; - dir_list dirs; -} dir_byp; - -typedef enum { - ARCH = 0, - PARSERS, - INSN, - CPU, - CPU_ALIAS, - CPU_FEATURE, - TARGETMOD, - PREFIX, - REG, - REGGROUP, - SEGREG, - NUM_DIRS -} dir_type; - -typedef struct { - void (*parse_insn) (void); /* arch-specific parse_insn */ - int multi_parser[NUM_DIRS]; /* whether it has an initial parser field */ -} arch_handler; - -static void x86_parse_insn(void); -static const arch_handler arch_x86 = { - x86_parse_insn, - {0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0} -}; - -static struct { - const char *name; - const arch_handler *arch; -} archs[] = { - {"x86", &arch_x86}, -}; - -static char line[1024]; -static unsigned int cur_line = 0, next_line = 1; -static int errors = 0; -static const arch_handler *arch = NULL; - -/* Lists of directives, keyed by parser name */ -static dir_byp_list insnprefix_byp; -static dir_byp_list cpu_byp; -static dir_byp_list regtmod_byp; - -static void -report_error(const char *fmt, ...) -{ - va_list ap; - - fprintf(stderr, "%u: ", cur_line); - va_start(ap, fmt); - vfprintf(stderr, fmt, ap); - va_end(ap); - fputc('\n', stderr); - errors++; -} - -void -yasm__fatal(const char *message, ...) -{ - abort(); -} - -static void -dup_slist(slist *out, slist *in) -{ - sval *sv; - - STAILQ_INIT(out); - STAILQ_FOREACH(sv, in, link) { - sval *nsv = yasm_xmalloc(sizeof(sval)); - nsv->str = yasm__xstrdup(sv->str); - STAILQ_INSERT_TAIL(out, nsv, link); - } -} - -static dir * -dup_dir(dir *in) -{ - dir *out = yasm_xmalloc(sizeof(dir)); - out->name = yasm__xstrdup(in->name); - out->func = in->func; - dup_slist(&out->args, &in->args); - return out; -} - -static dir_list * -get_dirs(dir_byp_list *byp, /*@null@*/ const char *parser) -{ - dir_list *found = NULL; - dir_byp *db; - - if (STAILQ_EMPTY(byp)) { - report_error("PARSERS not yet specified"); - return NULL; - } - - STAILQ_FOREACH(db, byp, link) { - if ((!parser && !db->parser) || - (parser && db->parser && strcmp(parser, db->parser) == 0)) { - found = &db->dirs; - break; - } - } - - return found; -} - -/* Add a keyword/data to a slist of slist keyed by parser name. - * Returns nonzero on error. - */ -static int -add_dir(dir_byp_list *byp, /*@null@*/ const char *parser, dir *d) -{ - dir_list *found = get_dirs(byp, parser); - - if (found) { - STAILQ_INSERT_TAIL(found, d, link); - return 0; - } else if (!parser) { - /* Add separately to all */ - dir_byp *db; - int first = 1; - STAILQ_FOREACH(db, byp, link) { - if (!first) - d = dup_dir(d); - first = 0; - STAILQ_INSERT_TAIL(&db->dirs, d, link); - } - return 0; - } else { - report_error("parser not found"); - return 1; - } -} - -static char * -check_parser(dir_type type) -{ - char *parser = NULL; - - if (arch->multi_parser[type]) { - parser = strtok(NULL, " \t\n"); - if (strcmp(parser, "-") == 0) - parser = NULL; - } - - return parser; -} - -static void -parse_args(slist *args) -{ - char *tok; - sval *sv; - - STAILQ_INIT(args); - - tok = strtok(NULL, " \t\n"); - if (!tok) { - report_error("no args"); - return; - } - - while (tok) { - sv = yasm_xmalloc(sizeof(sval)); - sv->str = yasm__xstrdup(tok); - STAILQ_INSERT_TAIL(args, sv, link); - tok = strtok(NULL, " \t\n"); - } -} - -static dir * -parse_generic(dir_type type, const char *func, dir_byp_list *byp) -{ - char *parser = check_parser(type); - char *name = strtok(NULL, " \t\n"); - dir *d = yasm_xmalloc(sizeof(dir)); - - d->name = yasm__xstrdup(name); - d->func = func; - parse_args(&d->args); - - add_dir(byp, parser, d); - return d; -} - -static void -parse_arch(void) -{ - size_t i; - int found = 0; - char *tok = strtok(NULL, " \t\n"); - - if (!tok) { - report_error("ARCH requires an operand"); - return; - } - for (i=0; imulti_parser[INSN] || arch->multi_parser[PREFIX]) { - db = yasm_xmalloc(sizeof(dir_byp)); - db->parser = yasm__xstrdup(tok); - STAILQ_INIT(&db->dirs); - - STAILQ_INSERT_TAIL(&insnprefix_byp, db, link); - } - if (arch->multi_parser[CPU] || arch->multi_parser[CPU_ALIAS] || - arch->multi_parser[CPU_FEATURE]) { - db = yasm_xmalloc(sizeof(dir_byp)); - db->parser = yasm__xstrdup(tok); - STAILQ_INIT(&db->dirs); - - STAILQ_INSERT_TAIL(&cpu_byp, db, link); - } - if (arch->multi_parser[TARGETMOD] || arch->multi_parser[REG] || - arch->multi_parser[REGGROUP] || arch->multi_parser[SEGREG]) { - db = yasm_xmalloc(sizeof(dir_byp)); - db->parser = yasm__xstrdup(tok); - STAILQ_INIT(&db->dirs); - - STAILQ_INSERT_TAIL(®tmod_byp, db, link); - } - tok = strtok(NULL, " \t\n"); - } - - /* Add NULL (global) versions if not already created */ - if (STAILQ_EMPTY(&insnprefix_byp)) { - db = yasm_xmalloc(sizeof(dir_byp)); - db->parser = NULL; - STAILQ_INIT(&db->dirs); - - STAILQ_INSERT_TAIL(&insnprefix_byp, db, link); - } - if (STAILQ_EMPTY(&cpu_byp)) { - db = yasm_xmalloc(sizeof(dir_byp)); - db->parser = NULL; - STAILQ_INIT(&db->dirs); - - STAILQ_INSERT_TAIL(&cpu_byp, db, link); - } - if (STAILQ_EMPTY(®tmod_byp)) { - db = yasm_xmalloc(sizeof(dir_byp)); - db->parser = NULL; - STAILQ_INIT(&db->dirs); - - STAILQ_INSERT_TAIL(®tmod_byp, db, link); - } -} - -static void -x86_parse_insn(void) -{ - char *parser = check_parser(INSN); - char *bname = strtok(NULL, " \t\n"); - char *suffix = strtok(NULL, " \t\n"); - dir *d; - slist args; - sval *sv; - - if (!suffix) { - report_error("INSN requires suffix"); - return; - } - - /* save the remainder of args */ - parse_args(&args); - - if (suffix[0] != '"') { - /* Just one instruction to generate */ - sv = yasm_xmalloc(sizeof(sval)); - sv->str = yasm__xstrdup(suffix); - STAILQ_INSERT_HEAD(&args, sv, link); - - d = yasm_xmalloc(sizeof(dir)); - d->name = yasm__xstrdup(bname); - d->func = "INSN"; - d->args = args; - add_dir(&insnprefix_byp, parser, d); - } else { - /* Need to generate with suffixes for gas */ - char *p; - char sufstr[6]; - size_t bnamelen = strlen(bname); - - strcpy(sufstr, "SUF_X"); - - for (p = &suffix[1]; *p != '"'; p++) { - sufstr[4] = toupper(*p); - - d = yasm_xmalloc(sizeof(dir)); - - d->name = yasm_xmalloc(bnamelen+2); - strcpy(d->name, bname); - d->name[bnamelen] = tolower(*p); - d->name[bnamelen+1] = '\0'; - - d->func = "INSN"; - dup_slist(&d->args, &args); - - sv = yasm_xmalloc(sizeof(sval)); - sv->str = yasm__xstrdup(sufstr); - STAILQ_INSERT_HEAD(&d->args, sv, link); - - add_dir(&insnprefix_byp, "gas", d); - } - - /* And finally the version sans suffix */ - sv = yasm_xmalloc(sizeof(sval)); - sv->str = yasm__xstrdup("NONE"); - STAILQ_INSERT_HEAD(&args, sv, link); - - d = yasm_xmalloc(sizeof(dir)); - d->name = yasm__xstrdup(bname); - d->func = "INSN"; - d->args = args; - add_dir(&insnprefix_byp, parser, d); - } -} - -static void -parse_insn(void) -{ - if (!arch) { - report_error("ARCH not defined prior to INSN"); - return; - } - arch->parse_insn(); -} - -static void -parse_cpu(void) -{ - dir *d = parse_generic(CPU, "CPU", &cpu_byp); - sval *sv = yasm_xmalloc(sizeof(sval)); - sv->str = yasm__xstrdup("CPU_MODE_VERBATIM"); - STAILQ_INSERT_TAIL(&d->args, sv, link); -} - -static void -parse_cpu_alias(void) -{ - char *parser = check_parser(CPU_ALIAS); - char *name = strtok(NULL, " \t\n"); - char *alias = strtok(NULL, " \t\n"); - dir_list *dirs = get_dirs(&cpu_byp, parser); - dir *aliasd, *d; - - if (!alias) { - report_error("CPU_ALIAS requires an operand"); - return; - } - - STAILQ_FOREACH(aliasd, dirs, link) { - if (strcmp(aliasd->name, alias) == 0) - break; - } - if (!aliasd) { - report_error("could not find `%s'", alias); - return; - } - - d = yasm_xmalloc(sizeof(dir)); - d->name = yasm__xstrdup(name); - d->func = "CPU"; - dup_slist(&d->args, &aliasd->args); - - add_dir(&cpu_byp, parser, d); -} - -static void -parse_cpu_feature(void) -{ - char *parser = check_parser(CPU_FEATURE); - char *name = strtok(NULL, " \t\n"); - dir *name_dir = yasm_xmalloc(sizeof(dir)); - dir *noname_dir = yasm_xmalloc(sizeof(dir)); - sval *sv; - - name_dir->name = yasm__xstrdup(name); - name_dir->func = "CPU_FEATURE"; - parse_args(&name_dir->args); - - noname_dir->name = yasm_xmalloc(strlen(name)+3); - strcpy(noname_dir->name, "no"); - strcat(noname_dir->name, name); - noname_dir->func = name_dir->func; - dup_slist(&noname_dir->args, &name_dir->args); - - sv = yasm_xmalloc(sizeof(sval)); - sv->str = yasm__xstrdup("CPU_MODE_SET"); - STAILQ_INSERT_TAIL(&name_dir->args, sv, link); - - sv = yasm_xmalloc(sizeof(sval)); - sv->str = yasm__xstrdup("CPU_MODE_CLEAR"); - STAILQ_INSERT_TAIL(&noname_dir->args, sv, link); - - add_dir(&cpu_byp, parser, name_dir); - add_dir(&cpu_byp, parser, noname_dir); -} - -static void -parse_targetmod(void) -{ - parse_generic(TARGETMOD, "TARGETMOD", ®tmod_byp); -} - -static void -parse_prefix(void) -{ - parse_generic(PREFIX, "PREFIX", &insnprefix_byp); -} - -static void -parse_reg(void) -{ - parse_generic(REG, "REG", ®tmod_byp); -} - -static void -parse_reggroup(void) -{ - parse_generic(REGGROUP, "REGGROUP", ®tmod_byp); -} - -static void -parse_segreg(void) -{ - parse_generic(SEGREG, "SEGREG", ®tmod_byp); -} - -/* make the c output for the perfect hash tab array */ -static void -make_c_tab( - FILE *f, - const char *which, - const char *parser, - bstuff *tab, /* table indexed by b */ - ub4 smax, /* range of scramble[] */ - ub4 blen, /* b in 0..blen-1, power of 2 */ - ub4 *scramble) /* used in final hash */ -{ - ub4 i; - /* table for the mapping for the perfect hash */ - if (blen >= USE_SCRAMBLE) { - /* A way to make the 1-byte values in tab bigger */ - if (smax > UB2MAXVAL+1) { - fprintf(f, "static const unsigned long %s_", which); - if (parser) - fprintf(f, "%s_", parser); - fprintf(f, "scramble[] = {\n"); - for (i=0; i<=UB1MAXVAL; i+=4) - fprintf(f, "0x%.8lx, 0x%.8lx, 0x%.8lx, 0x%.8lx,\n", - scramble[i+0], scramble[i+1], scramble[i+2], scramble[i+3]); - } else { - fprintf(f, "static const unsigned short %s_", which); - if (parser) - fprintf(f, "%s_", parser); - fprintf(f, "scramble[] = {\n"); - for (i=0; i<=UB1MAXVAL; i+=8) - fprintf(f, -"0x%.4lx, 0x%.4lx, 0x%.4lx, 0x%.4lx, 0x%.4lx, 0x%.4lx, 0x%.4lx, 0x%.4lx,\n", - scramble[i+0], scramble[i+1], scramble[i+2], scramble[i+3], - scramble[i+4], scramble[i+5], scramble[i+6], scramble[i+7]); - } - fprintf(f, "};\n"); - fprintf(f, "\n"); - } - - if (blen > 0) { - /* small adjustments to _a_ to make values distinct */ - if (smax <= UB1MAXVAL+1 || blen >= USE_SCRAMBLE) - fprintf(f, "static const unsigned char %s_", which); - else - fprintf(f, "static const unsigned short %s_", which); - if (parser) - fprintf(f, "%s_", parser); - fprintf(f, "tab[] = {\n"); - - if (blen < 16) { - for (i=0; iname_k = yasm__xstrdup(d->name); - k->len_k = (ub4)strlen(d->name); - k->next_k = keys; - keys = k; - nkeys++; - } - - /* find the hash */ - findhash(&tab, &tabh, &alen, &blen, &salt, &final, - scramble, &smax, keys, nkeys, &form); - - /* output the dir table: this should loop up to smax for NORMAL_HP, - * or up to pakd.nkeys for MINIMAL_HP. - */ - fprintf(out, "static const %s_parse_data %s_", which, which); - if (parser) - fprintf(out, "%s_", parser); - fprintf(out, "pd[%lu] = {\n", nkeys); - for (i=0; iname, tabh[i].key_h->name_k) == 0) - break; - } - if (!d) { - report_error("internal error: could not find `%s'", - tabh[i].key_h->name_k); - break; - } - if (cpumode) - fprintf(out, "{\"%s\",", d->name); - else - fprintf(out, "%s(\"%s\",", d->func, d->name); - STAILQ_FOREACH(sv, &d->args, link) { - fprintf(out, " %s", sv->str); - if (STAILQ_NEXT(sv, link)) - fprintf(out, ","); - } - fprintf(out, cpumode ? "}" : ")"); - } else - fprintf(out, " { NULL }"); - - if (i < nkeys-1) - fprintf(out, ","); - fprintf(out, "\n"); - } - fprintf(out, "};\n"); - - /* output the hash tab[] array */ - make_c_tab(out, which, parser, tab, smax, blen, scramble); - - /* The hash function */ - fprintf(out, "#define tab %s_", which); - if (parser) - fprintf(out, "%s_", parser); - fprintf(out, "tab\n"); - fprintf(out, "static const %s_parse_data *\n%s_", which, which); - if (parser) - fprintf(out, "%s_", parser); - fprintf(out, "find(const char *key, size_t len)\n"); - fprintf(out, "{\n"); - fprintf(out, " const %s_parse_data *ret;\n", which); - for (i=0; i= %lu) return NULL;\n", nkeys); - fprintf(out, " ret = &%s_", which); - if (parser) - fprintf(out, "%s_", parser); - fprintf(out, "pd[rsl];\n"); - fprintf(out, " if (strcmp(key, ret->name) != 0) return NULL;\n"); - fprintf(out, " return ret;\n"); - fprintf(out, "}\n"); - fprintf(out, "#undef tab\n\n"); - - free(tab); - free(tabh); -} - -/* Get an entire "real" line from the input file by combining any - * \\\n continuations. - */ -static int get_line(FILE *in) -{ - char *p = line; - cur_line = next_line; - - if (feof(in)) - return 0; - - while (p < &line[1023-128]) { - if (!fgets(p, 128, in)) - return 1; - next_line++; - /* if continuation, strip out leading whitespace */ - if (p > line) { - char *p2 = p; - while (isspace(*p2)) p2++; - if (p2 > p) - memmove(p, p2, strlen(p2)+1); - } - while (*p) p++; - if (p[-2] != '\\' || p[-1] != '\n') { - if (p[-1] == '\n') - p[-1] = '\0'; - return 1; - } - p -= 2; - } - return 0; -} - -static struct { - const char *name; - int indx; - void (*handler) (void); -} directives[] = { - {"ARCH", ARCH, parse_arch}, - {"PARSERS", PARSERS, parse_parsers}, - {"INSN", INSN, parse_insn}, - {"CPU", CPU, parse_cpu}, - {"CPU_ALIAS", CPU_ALIAS, parse_cpu_alias}, - {"CPU_FEATURE", CPU_FEATURE, parse_cpu_feature}, - {"TARGETMOD", TARGETMOD, parse_targetmod}, - {"PREFIX", PREFIX, parse_prefix}, - {"REG", REG, parse_reg}, - {"REGGROUP", REGGROUP, parse_reggroup}, - {"SEGREG", SEGREG, parse_segreg}, -}; - -int -main(int argc, char *argv[]) -{ - FILE *in, *out; - size_t i; - char *tok; - int count[NUM_DIRS]; - dir_byp *db; - - for (i=0; i \n"); - return EXIT_FAILURE; - } - - in = fopen(argv[1], "rt"); - if (!in) { - fprintf(stderr, "Could not open `%s' for reading\n", argv[1]); - return EXIT_FAILURE; - } - - STAILQ_INIT(&insnprefix_byp); - STAILQ_INIT(&cpu_byp); - STAILQ_INIT(®tmod_byp); - - /* Parse input file */ - while (get_line(in)) { - int found; - /*printf("%s\n", line);*/ - tok = strtok(line, " \t\n"); - if (!tok) - continue; - - /* Comments start with # as the first thing on a line */ - if (tok[0] == '#') - continue; - - /* Look for directive */ - found = 0; - for (i=0; i 0) - return EXIT_FAILURE; - - out = fopen(argv[2], "wt"); - if (!out) { - fprintf(stderr, "Could not open `%s' for writing\n", argv[2]); - return EXIT_FAILURE; - } - - /* Get perfect hashes for the three lists of directives */ - STAILQ_FOREACH(db, &insnprefix_byp, link) - perfect_dir(out, "insnprefix", db->parser, &db->dirs); - STAILQ_FOREACH(db, &cpu_byp, link) - perfect_dir(out, "cpu", db->parser, &db->dirs); - STAILQ_FOREACH(db, ®tmod_byp, link) - perfect_dir(out, "regtmod", db->parser, &db->dirs); - - if (errors > 0) - return EXIT_FAILURE; - - return EXIT_SUCCESS; -} - diff --git a/tools/genperf/Makefile.inc b/tools/genperf/Makefile.inc new file mode 100644 index 00000000..b6bedff4 --- /dev/null +++ b/tools/genperf/Makefile.inc @@ -0,0 +1,34 @@ +# $Id$ + +# These utility programs have to be built for BUILD host in cross-build. +# This makes things rather non-standard automake + +noinst_PROGRAMS += genperf + +genperf_SOURCES = +EXTRA_DIST += tools/genperf/genperf.c +EXTRA_DIST += tools/genperf/perfect.c +EXTRA_DIST += tools/genperf/perfect.h +EXTRA_DIST += tools/genperf/standard.h +genperf_LDADD = genperf.$(OBJEXT) +genperf_LDADD += gp-perfect.$(OBJEXT) +genperf_LDADD += gp-phash.$(OBJEXT) +genperf_LDADD += gp-xmalloc.$(OBJEXT) +genperf_LDADD += gp-xstrdup.$(OBJEXT) +genperf_LINK = $(CCLD_FOR_BUILD) -o $@ + +genperf.$(OBJEXT): tools/genperf/genperf.c + $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f tools/genperf/genperf.c || echo '$(srcdir)/'`tools/genperf/genperf.c + +gp-perfect.$(OBJEXT): tools/genperf/perfect.c + $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f tools/genperf/perfect.c || echo '$(srcdir)/'`tools/genperf/perfect.c + +gp-phash.$(OBJEXT): libyasm/phash.c + $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f libyasm/phash.c || echo '$(srcdir)/'`libyasm/phash.c + +gp-xmalloc.$(OBJEXT): libyasm/xmalloc.c + $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f libyasm/xmalloc.c || echo '$(srcdir)/'`libyasm/xmalloc.c + +gp-xstrdup.$(OBJEXT): libyasm/xstrdup.c + $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f libyasm/xstrdup.c || echo '$(srcdir)/'`libyasm/xstrdup.c + diff --git a/tools/genperf/genperf.c b/tools/genperf/genperf.c new file mode 100644 index 00000000..7a9c766d --- /dev/null +++ b/tools/genperf/genperf.c @@ -0,0 +1,519 @@ +/* $Id$ + * + * Generate Minimal Perfect Hash (genperf) + * + * Copyright (C) 2006-2007 Peter Johnson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include +#include +#include +#include +#include "tools/genperf/perfect.h" +#include "libyasm/compat-queue.h" +#include "libyasm/coretype.h" +#include "libyasm/errwarn.h" + +typedef STAILQ_HEAD(slist, sval) slist; +typedef struct sval { + STAILQ_ENTRY(sval) link; + char *str; +} sval; + +typedef STAILQ_HEAD(keyword_list, keyword) keyword_list; +typedef struct keyword { + STAILQ_ENTRY(keyword) link; + char *name; + char *args; + unsigned int line; +} keyword; + +static unsigned int cur_line = 1; +static int errors = 0; + +static void +report_error(const char *fmt, ...) +{ + va_list ap; + + fprintf(stderr, "%u: ", cur_line); + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + va_end(ap); + fputc('\n', stderr); + errors++; +} + +void +yasm__fatal(const char *message, ...) +{ + abort(); +} + +/* make the c output for the perfect hash tab array */ +static void +make_c_tab( + FILE *f, + bstuff *tab, /* table indexed by b */ + ub4 smax, /* range of scramble[] */ + ub4 blen, /* b in 0..blen-1, power of 2 */ + ub4 *scramble) /* used in final hash */ +{ + ub4 i; + /* table for the mapping for the perfect hash */ + if (blen >= USE_SCRAMBLE) { + /* A way to make the 1-byte values in tab bigger */ + if (smax > UB2MAXVAL+1) { + fprintf(f, " static const unsigned long scramble[] = {\n"); + for (i=0; i<=UB1MAXVAL; i+=4) + fprintf(f, " 0x%.8lx, 0x%.8lx, 0x%.8lx, 0x%.8lx,\n", + scramble[i+0], scramble[i+1], scramble[i+2], scramble[i+3]); + } else { + fprintf(f, " static const unsigned short scramble[] = {\n"); + for (i=0; i<=UB1MAXVAL; i+=8) + fprintf(f, +" 0x%.4lx, 0x%.4lx, 0x%.4lx, 0x%.4lx, 0x%.4lx, 0x%.4lx, 0x%.4lx, 0x%.4lx,\n", + scramble[i+0], scramble[i+1], scramble[i+2], scramble[i+3], + scramble[i+4], scramble[i+5], scramble[i+6], scramble[i+7]); + } + fprintf(f, " };\n"); + fprintf(f, "\n"); + } + + if (blen > 0) { + /* small adjustments to _a_ to make values distinct */ + if (smax <= UB1MAXVAL+1 || blen >= USE_SCRAMBLE) + fprintf(f, " static const unsigned char "); + else + fprintf(f, " static const unsigned short "); + fprintf(f, "tab[] = {\n"); + + if (blen < 16) { + for (i=0; iname_k = yasm__xstrdup(kw->name); + k->len_k = (ub4)strlen(kw->name); + k->next_k = keys; + keys = k; + nkeys++; + } + + /* find the hash */ + findhash(&tab, &tabh, &alen, &blen, &salt, &final, + scramble, &smax, keys, nkeys, &form); + + /* The hash function beginning */ + fprintf(out, "static const struct %s *\n", struct_name); + fprintf(out, "%s(const char *key, size_t len)\n", lookup_function_name); + fprintf(out, "{\n"); + + /* output the dir table: this should loop up to smax for NORMAL_HP, + * or up to pakd.nkeys for MINIMAL_HP. + */ + fprintf(out, " static const struct %s pd[%lu] = {\n", struct_name, nkeys); + for (i=0; iname, tabh[i].key_h->name_k) == 0) + break; + } + if (!kw) { + report_error("internal error: could not find `%s'", + tabh[i].key_h->name_k); + break; + } + fprintf(out, "#line %u \"%s\"\n", kw->line, filename); + fprintf(out, " {\"%s\"%s}", kw->name, kw->args); + } else + fprintf(out, " { NULL }"); + + if (i < nkeys-1) + fprintf(out, ","); + fprintf(out, "\n"); + } + fprintf(out, " };\n"); + + /* output the hash tab[] array */ + make_c_tab(out, tab, smax, blen, scramble); + + /* The hash function body */ + fprintf(out, " const struct %s *ret;\n", struct_name); + for (i=0; i= %lu) return NULL;\n", nkeys); + fprintf(out, " ret = &pd[rsl];\n"); + fprintf(out, " if (strcmp(key, ret->name) != 0) return NULL;\n"); + fprintf(out, " return ret;\n"); + fprintf(out, "}\n"); + fprintf(out, "\n"); + + free(tab); + free(tabh); +} + +int +main(int argc, char *argv[]) +{ + FILE *in; + size_t i; + char *ch; + static char line[1024], tmp[1024]; + static char struct_name[128] = ""; + static char lookup_function_name[128] = "in_word_set"; + static char language[16] = ""; + static char delimiters[16] = ",\r\n"; + static char name[128]; + int need_struct = 0; + int have_struct = 0; + int go_keywords = 0; + int ignore_case = 0; + int compare_strncmp = 0; + int readonly_tables = 0; + slist usercode, usercode2; + keyword_list keywords; + sval *sv; + keyword *kw; + + if (argc != 2) { + fprintf(stderr, "Usage: genperf \n"); + return EXIT_FAILURE; + } + + in = fopen(argv[1], "rt"); + if (!in) { + fprintf(stderr, "Could not open `%s' for reading\n", argv[1]); + return EXIT_FAILURE; + } + + STAILQ_INIT(&usercode); + STAILQ_INIT(&usercode2); + STAILQ_INIT(&keywords); + + /* Parse declarations section */ + while (fgets(line, 1024, in)) { + /* Comments start with # as the first thing on a line */ + if (line[0] == '#') { + cur_line++; + continue; + } + + /* Handle structure declaration */ + if (strncmp(line, "struct", 6) == 0) { + int braces; + + if (!need_struct) { + report_error("struct without %%struct-type declaration"); + return EXIT_FAILURE; + } + if (have_struct) { + report_error("more than one struct declaration"); + return EXIT_FAILURE; + } + have_struct = 1; + + /* copy struct name */ + ch = &line[6]; + while (isspace(*ch)) + ch++; + i = 0; + while ((isalnum(*ch) || *ch == '_') && i < 127) + struct_name[i++] = *ch++; + if (i == 127) { + report_error("struct name too long"); + return EXIT_FAILURE; + } + struct_name[i] = '\0'; + + sv = yasm_xmalloc(sizeof(sval)); + snprintf(tmp, 1024, "#line %u \"%s\"\n", cur_line, argv[1]); + sv->str = yasm__xstrdup(tmp); + STAILQ_INSERT_TAIL(&usercode, sv, link); + + braces = 0; + do { + /* count braces to determine when we're done */ + ch = line; + while (*ch != '\0') { + if (*ch == '{') + braces++; + if (*ch == '}') + braces--; + ch++; + } + sv = yasm_xmalloc(sizeof(sval)); + sv->str = yasm__xstrdup(line); + STAILQ_INSERT_TAIL(&usercode, sv, link); + cur_line++; + if (braces <= 0) + break; + } while (fgets(line, 1024, in)); + cur_line++; + continue; + } + + /* Ignore non-declaration lines */ + if (line[0] != '%') { + cur_line++; + continue; + } + + /* %% terminates declarations section */ + if (line[1] == '%') { + if (need_struct && !have_struct) { + report_error("%%struct-type declaration, but no struct found"); + return EXIT_FAILURE; + } + go_keywords = 1; + break; /* move on to keywords section */ + } + + /* %{ begins a verbatim code section that ends with %} */ + if (line[1] == '{') { + sv = yasm_xmalloc(sizeof(sval)); + snprintf(tmp, 1024, "#line %u \"%s\"\n\n", cur_line, argv[1]); + sv->str = yasm__xstrdup(tmp); + STAILQ_INSERT_TAIL(&usercode, sv, link); + + while (fgets(line, 1024, in)) { + cur_line++; + if (line[0] == '%' && line[1] == '}') + break; + sv = yasm_xmalloc(sizeof(sval)); + sv->str = yasm__xstrdup(line); + STAILQ_INSERT_TAIL(&usercode, sv, link); + } + cur_line++; + continue; + } + + if (strncmp(&line[1], "ignore-case", 11) == 0) { + ignore_case = 1; + } else if (strncmp(&line[1], "compare-strncmp", 15) == 0) { + compare_strncmp = 1; + } else if (strncmp(&line[1], "readonly-tables", 15) == 0) { + readonly_tables = 1; + } else if (strncmp(&line[1], "language=", 9) == 0) { + ch = &line[10]; + i = 0; + while (*ch != '\n' && i<15) + language[i++] = *ch++; + language[i] = '\0'; + } else if (strncmp(&line[1], "delimiters=", 11) == 0) { + ch = &line[12]; + i = 0; + while (i<15) + delimiters[i++] = *ch++; + delimiters[i] = '\0'; + } else if (strncmp(&line[1], "enum", 4) == 0) { + /* unused */ + } else if (strncmp(&line[1], "struct-type", 11) == 0) { + need_struct = 1; + } else if (strncmp(&line[1], "define", 6) == 0) { + /* Several different defines we need to handle */ + ch = &line[7]; + while (isspace(*ch)) + ch++; + + if (strncmp(ch, "hash-function-name", 18) == 0) { + /* unused */ + } else if (strncmp(ch, "lookup-function-name", 20) == 0) { + ch = &line[7+20+1]; + while (isspace(*ch)) + ch++; + i = 0; + while ((isalnum(*ch) || *ch == '_') && i < 127) + lookup_function_name[i++] = *ch++; + if (i == 127) { + report_error("struct name too long"); + return EXIT_FAILURE; + } + lookup_function_name[i] = '\0'; + } else { + fprintf(stderr, "%u: unrecognized define `%s'\n", cur_line, + line); + } + } else { + fprintf(stderr, "%u: unrecognized declaration `%s'\n", cur_line, + line); + } + + cur_line++; + } + + if (!go_keywords) { + report_error("no keywords section found"); + return EXIT_FAILURE; + } + + /* Parse keywords section */ + while (fgets(line, 1024, in)) { + char *d; + + /* Comments start with # as the first thing on a line */ + if (line[0] == '#') { + cur_line++; + continue; + } + + /* Keywords section terminated with %% */ + if (line[0] == '%' && line[1] == '%') + break; + + /* Look for name */ + ch = &line[0]; + i = 0; + while (strchr(delimiters, *ch) == NULL && i < 127) + name[i++] = *ch++; + if (i == 127) { + report_error("keyword name too long"); + return EXIT_FAILURE; + } + name[i] = '\0'; + + /* Strip EOL */ + d = strrchr(ch, '\n'); + if (d) + *d = '\0'; + d = strrchr(ch, '\r'); + if (d) + *d = '\0'; + kw = yasm_xmalloc(sizeof(keyword)); + kw->name = yasm__xstrdup(name); + kw->args = yasm__xstrdup(ch); + kw->line = cur_line; + STAILQ_INSERT_TAIL(&keywords, kw, link); + cur_line++; + } + + if (errors > 0) + return EXIT_FAILURE; + + /* Pull in any end code */ + if (!feof(in)) { + sv = yasm_xmalloc(sizeof(sval)); + snprintf(tmp, 1024, "#line %u \"%s\"\n\n", cur_line, argv[1]); + sv->str = yasm__xstrdup(tmp); + STAILQ_INSERT_TAIL(&usercode2, sv, link); + + while (fgets(line, 1024, in)) { + sv = yasm_xmalloc(sizeof(sval)); + sv->str = yasm__xstrdup(line); + STAILQ_INSERT_TAIL(&usercode2, sv, link); + } + } + + /* output code */ + printf("/* %s code produced by genperf */\n", language); + printf("/* Command-line: genperf %s */\n", argv[1]); + + STAILQ_FOREACH(sv, &usercode, link) + printf("%s", sv->str); + + /* Get perfect hash */ + perfect_gen(stdout, lookup_function_name, struct_name, &keywords, argv[1]); + + STAILQ_FOREACH(sv, &usercode2, link) + printf("%s", sv->str); + + if (errors > 0) + return EXIT_FAILURE; + + return EXIT_SUCCESS; +} + diff --git a/tools/gap/perfect.c b/tools/genperf/perfect.c similarity index 98% rename from tools/gap/perfect.c rename to tools/genperf/perfect.c index d1218040..26d59be4 100644 --- a/tools/gap/perfect.c +++ b/tools/genperf/perfect.c @@ -50,10 +50,10 @@ determined a perfect hash for the whole set of keys. */ #include -#include "tools/gap/standard.h" +#include "tools/genperf/standard.h" #include "libyasm/coretype.h" #include "libyasm/phash.h" -#include "tools/gap/perfect.h" +#include "tools/genperf/perfect.h" #define CHECKSTATE 8 @@ -565,7 +565,7 @@ static int perfect( if (!augment(tabb, tabh, tabq, blen, scramble, smax, &tabb[i], nkeys, i+1, form)) { - printf("fail to map group of size %ld for tab size %ld\n", j, blen); + fprintf(stderr, "fail to map group of size %ld for tab size %ld\n", j, blen); return FALSE; } @@ -631,7 +631,7 @@ static void hash_ab( { if (form->perfect == MINIMAL_HP) { - printf("fatal error: Cannot find perfect hash for user (A,B) pairs\n"); + fprintf(stderr, "fatal error: Cannot find perfect hash for user (A,B) pairs\n"); exit(EXIT_FAILURE); } else @@ -644,7 +644,7 @@ static void hash_ab( nkeys : *smax)); if (!perfect(*tabb, tabh, tabq, *blen, *smax, scramble, nkeys, form)) { - printf("fatal error: Cannot find perfect hash for user (A,B) pairs\n"); + fprintf(stderr, "fatal error: Cannot find perfect hash for user (A,B) pairs\n"); exit(EXIT_FAILURE); } } @@ -673,7 +673,7 @@ static void hash_ab( sprintf(final->line[0], " unsigned long rsl = (a ^ scramble[tab[b]]);\n"); } - printf("success, found a perfect hash\n"); + fprintf(stderr, "success, found a perfect hash\n"); free((void *)tabq); free((void *)tabh); @@ -894,7 +894,7 @@ void findhash( else { duplicates(*tabb, *blen, keys, form); /* check for duplicates */ - printf("fatal error: Cannot perfect hash: cannot find distinct (A,B)\n"); + fprintf(stderr, "fatal error: Cannot perfect hash: cannot find distinct (A,B)\n"); exit(EXIT_FAILURE); } bad_initkey = 0; @@ -903,7 +903,7 @@ void findhash( continue; /* two keys have same (a,b) pair */ } - printf("found distinct (A,B) on attempt %ld\n", trysalt); + fprintf(stderr, "found distinct (A,B) on attempt %ld\n", trysalt); /* Given distinct (A,B) for all keys, build a perfect hash */ if (!perfect(*tabb, *tabh, tabq, *blen, *smax, scramble, nkeys, form)) @@ -922,7 +922,7 @@ void findhash( } else { - printf("fatal error: Cannot perfect hash: cannot build tab[]\n"); + fprintf(stderr, "fatal error: Cannot perfect hash: cannot build tab[]\n"); exit(EXIT_FAILURE); } bad_perfect = 0; @@ -934,7 +934,7 @@ void findhash( break; } - printf("built perfect hash table of size %ld\n", *blen); + fprintf(stderr, "built perfect hash table of size %ld\n", *blen); /* free working memory */ free((void *)tabq); diff --git a/tools/gap/perfect.h b/tools/genperf/perfect.h similarity index 100% rename from tools/gap/perfect.h rename to tools/genperf/perfect.h diff --git a/tools/gap/standard.h b/tools/genperf/standard.h similarity index 100% rename from tools/gap/standard.h rename to tools/genperf/standard.h From 303c2867de81e52bd0f6edcefa4d1204b88ad5bb Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 8 Sep 2007 00:04:08 +0000 Subject: [PATCH 064/585] Bring Mkfiles up to date with [1929]. svn path=/trunk/yasm/; revision=1930 --- Makefile.am | 12 +- Mkfiles/Makefile.dj | 35 ++- Mkfiles/Makefile.flat | 37 +++- Mkfiles/vc/gap/run.bat | 2 - .../gap.vcproj => genperf/genperf.vcproj} | 26 +-- Mkfiles/vc/genperf/run.bat | 5 + Mkfiles/vc/x86geninsn/run.bat | 2 + Mkfiles/vc/x86geninsn/x86geninsn.vcproj | 128 +++++++++++ Mkfiles/vc/yasm.sln | 19 +- Mkfiles/vc8/gap/run.bat | 2 - .../gap.vcproj => genperf/genperf.vcproj} | 22 +- Mkfiles/vc8/genperf/run.bat | 5 + Mkfiles/vc8/x86geninsn/run.bat | 2 + Mkfiles/vc8/x86geninsn/x86geninsn.vcproj | 201 ++++++++++++++++++ Mkfiles/vc8/yasm.sln | 31 ++- 15 files changed, 464 insertions(+), 65 deletions(-) delete mode 100644 Mkfiles/vc/gap/run.bat rename Mkfiles/vc/{gap/gap.vcproj => genperf/genperf.vcproj} (81%) create mode 100644 Mkfiles/vc/genperf/run.bat create mode 100644 Mkfiles/vc/x86geninsn/run.bat create mode 100644 Mkfiles/vc/x86geninsn/x86geninsn.vcproj delete mode 100644 Mkfiles/vc8/gap/run.bat rename Mkfiles/vc8/{gap/gap.vcproj => genperf/genperf.vcproj} (85%) create mode 100644 Mkfiles/vc8/genperf/run.bat create mode 100644 Mkfiles/vc8/x86geninsn/run.bat create mode 100644 Mkfiles/vc8/x86geninsn/x86geninsn.vcproj diff --git a/Makefile.am b/Makefile.am index 31af44d8..d669d003 100644 --- a/Makefile.am +++ b/Makefile.am @@ -75,8 +75,10 @@ EXTRA_DIST += Mkfiles/vc/libyasm/libyasm.vcproj EXTRA_DIST += Mkfiles/vc/modules/modules.vcproj EXTRA_DIST += Mkfiles/vc/re2c/re2c.vcproj EXTRA_DIST += Mkfiles/vc/re2c/run.bat -EXTRA_DIST += Mkfiles/vc/gap/gap.vcproj -EXTRA_DIST += Mkfiles/vc/gap/run.bat +EXTRA_DIST += Mkfiles/vc/genperf/genperf.vcproj +EXTRA_DIST += Mkfiles/vc/genperf/run.bat +EXTRA_DIST += Mkfiles/vc/x86geninsn/x86geninsn.vcproj +EXTRA_DIST += Mkfiles/vc/x86geninsn/run.bat EXTRA_DIST += Mkfiles/vc8/crt_secure_no_deprecate.vsprops EXTRA_DIST += Mkfiles/vc8/yasm.sln EXTRA_DIST += Mkfiles/vc8/yasm.vcproj @@ -96,8 +98,10 @@ EXTRA_DIST += Mkfiles/vc8/libyasm/libyasm.vcproj EXTRA_DIST += Mkfiles/vc8/modules/modules.vcproj EXTRA_DIST += Mkfiles/vc8/re2c/re2c.vcproj EXTRA_DIST += Mkfiles/vc8/re2c/run.bat -EXTRA_DIST += Mkfiles/vc8/gap/gap.vcproj -EXTRA_DIST += Mkfiles/vc8/gap/run.bat +EXTRA_DIST += Mkfiles/vc8/genperf/genperf.vcproj +EXTRA_DIST += Mkfiles/vc8/genperf/run.bat +EXTRA_DIST += Mkfiles/vc8/x86geninsn/x86geninsn.vcproj +EXTRA_DIST += Mkfiles/vc8/x86geninsn/run.bat # Until this gets fixed in automake DISTCLEANFILES = libyasm/stamp-h libyasm/stamp-h[0-9]* diff --git a/Mkfiles/Makefile.dj b/Mkfiles/Makefile.dj index aac7dc8c..619fed4d 100644 --- a/Mkfiles/Makefile.dj +++ b/Mkfiles/Makefile.dj @@ -50,7 +50,9 @@ MODULES_ARCH_X86_OBJS= \ modules/arch/x86/x86arch.o \ modules/arch/x86/x86bc.o \ modules/arch/x86/x86expr.o \ - modules/arch/x86/x86id.o + modules/arch/x86/x86id.o \ + x86cpu.o \ + x86regtmod.o YASM_MODULES=arch_x86 #MODULES_ARCH_LC3B_OBJS= \ @@ -170,10 +172,25 @@ genmodule: libyasm/genmodule.c module.c: libyasm/module.in genmodule ./genmodule libyasm/module.in Mkfiles/Makefile.dj -x86parse.c: modules/arch/x86/x86parse.gap gap - ./gap modules/arch/x86/x86parse.gap $@ +x86geninsn: modules/arch/x86/x86geninsn.c + $(BUILDCC) -o $@ $< -modules/arch/x86/x86id.c: x86parse.c +x86insn_nasm.gperf x86insn_gas.gperf: modules/arch/x86/x86insn.in x86geninsn + ./x86geninsn modules/arch/x86/x86insn.in x86insn_nasm.gperf x86insn_gas.gperf + +x86insn_nasm.c: x86insn_nasm.gperf genperf + ./genperf x86insn_nasm.gperf > $@ + +x86insn_gas.c: x86insn_gas.gperf genperf + ./genperf x86insn_gas.gperf > $@ + +x86cpu.c: modules/arch/x86/x86cpu.gperf genperf + ./genperf modules/arch/x86/x86cpu.gperf > $@ + +x86regtmod.c: modules/arch/x86/x86regtmod.gperf genperf + ./genperf modules/arch/x86/x86regtmod.gperf > $@ + +modules/arch/x86/x86id.c: x86insn_nasm.c x86insn_gas.c lc3bid.c: modules/arch/lc3b/lc3bid.re re2c ./re2c -s -o $@ modules/arch/lc3b/lc3bid.re @@ -198,15 +215,15 @@ RE2C_SRCS= \ re2c: $(RE2C_SRCS) $(BUILDCC) -I. -o re2c $(RE2C_SRCS) -GAP_SRCS= \ - tools/gap/gap.c \ - tools/gap/perfect.c \ +GENPERF_SRCS= \ + tools/genperf/genperf.c \ + tools/genperf/perfect.c \ libyasm/phash.c \ libyasm/xmalloc.c \ libyasm/xstrdup.c -gap: $(GAP_SRCS) - $(BUILDCC) -I. -o gap $(GAP_SRCS) +genperf: $(GENPERF_SRCS) + $(BUILDCC) -I. -o genperf $(GENPERF_SRCS) yasm: $(YASM_OBJS) $(CC) -o yasm $(YASM_OBJS) diff --git a/Mkfiles/Makefile.flat b/Mkfiles/Makefile.flat index 29e2a197..3859451d 100644 --- a/Mkfiles/Makefile.flat +++ b/Mkfiles/Makefile.flat @@ -53,7 +53,9 @@ MODULES_ARCH_X86_OBJS= \ modules/arch/x86/x86arch.o \ modules/arch/x86/x86bc.o \ modules/arch/x86/x86expr.o \ - modules/arch/x86/x86id.o + modules/arch/x86/x86id.o \ + x86cpu.o \ + x86regtmod.o YASM_MODULES=arch_x86 #MODULES_ARCH_LC3B_OBJS= \ @@ -162,7 +164,7 @@ nasm-macros.c: modules/preprocs/nasm/standard.mac version.mac genmacro modules/preprocs/nasm/nasm-pp.c: nasm-macros.c genversion: modules/preprocs/nasm/genversion.c - $(BUILDCC) -IMkfiles -o $@ $< + $(BUILDCC) -IMkfiles -I. -o $@ $< version.mac: genversion ./genversion $@ @@ -173,10 +175,25 @@ genmodule: libyasm/genmodule.c module.c: libyasm/module.in genmodule ./genmodule libyasm/module.in Mkfiles/Makefile.flat -x86parse.c: modules/arch/x86/x86parse.gap gap - ./gap modules/arch/x86/x86parse.gap $@ +x86geninsn: modules/arch/x86/x86geninsn.c + $(BUILDCC) -o $@ $< -modules/arch/x86/x86id.c: x86parse.c +x86insn_nasm.gperf x86insn_gas.gperf: modules/arch/x86/x86insn.in x86geninsn + ./x86geninsn modules/arch/x86/x86insn.in x86insn_nasm.gperf x86insn_gas.gperf + +x86insn_nasm.c: x86insn_nasm.gperf genperf + ./genperf x86insn_nasm.gperf > $@ + +x86insn_gas.c: x86insn_gas.gperf genperf + ./genperf x86insn_gas.gperf > $@ + +x86cpu.c: modules/arch/x86/x86cpu.gperf genperf + ./genperf modules/arch/x86/x86cpu.gperf > $@ + +x86regtmod.c: modules/arch/x86/x86regtmod.gperf genperf + ./genperf modules/arch/x86/x86regtmod.gperf > $@ + +modules/arch/x86/x86id.c: x86insn_nasm.c x86insn_gas.c lc3bid.c: modules/arch/lc3b/lc3bid.re re2c ./re2c -s -o $@ modules/arch/lc3b/lc3bid.re @@ -201,15 +218,15 @@ RE2C_SRCS= \ re2c: $(RE2C_SRCS) $(BUILDCC) -I. -o re2c $(RE2C_SRCS) -GAP_SRCS= \ - tools/gap/gap.c \ - tools/gap/perfect.c \ +GENPERF_SRCS= \ + tools/genperf/genperf.c \ + tools/genperf/perfect.c \ libyasm/phash.c \ libyasm/xmalloc.c \ libyasm/xstrdup.c -gap: $(GAP_SRCS) - $(BUILDCC) -I. -o gap $(GAP_SRCS) +genperf: $(GENPERF_SRCS) + $(BUILDCC) -I. -o genperf $(GENPERF_SRCS) yasm: $(YASM_OBJS) $(CC) -o yasm $(YASM_OBJS) diff --git a/Mkfiles/vc/gap/run.bat b/Mkfiles/vc/gap/run.bat deleted file mode 100644 index d5060801..00000000 --- a/Mkfiles/vc/gap/run.bat +++ /dev/null @@ -1,2 +0,0 @@ -cd ..\..\..\ -%1 modules\arch\x86\x86parse.gap x86parse.c diff --git a/Mkfiles/vc/gap/gap.vcproj b/Mkfiles/vc/genperf/genperf.vcproj similarity index 81% rename from Mkfiles/vc/gap/gap.vcproj rename to Mkfiles/vc/genperf/genperf.vcproj index ee7c8770..a0d9f4d4 100644 --- a/Mkfiles/vc/gap/gap.vcproj +++ b/Mkfiles/vc/genperf/genperf.vcproj @@ -2,9 +2,9 @@ + UniqueIdentifier="{1062695D-1C50-4068-8313-73A409885BC1}"> + RelativePath="..\..\..\tools\genperf\genperf.c"> + RelativePath="..\..\..\tools\genperf\perfect.c"> @@ -136,18 +136,18 @@ + UniqueIdentifier="{3C1E9AA8-6338-4CED-99F1-BEBA80607BD5}"> + RelativePath="..\..\..\tools\genperf\perfect.h"> + RelativePath="..\..\..\tools\genperf\standard.h"> + UniqueIdentifier="{005ED203-AC60-4E97-A0A2-8239D00786FE}"> diff --git a/Mkfiles/vc/genperf/run.bat b/Mkfiles/vc/genperf/run.bat new file mode 100644 index 00000000..1cf44bfc --- /dev/null +++ b/Mkfiles/vc/genperf/run.bat @@ -0,0 +1,5 @@ +cd ..\..\..\ +%1 x86insn_nasm.gperf > x86insn_nasm.c +%1 x86insn_gas.gperf > x86insn_gas.c +%1 modules\arch\x86\x86cpu.gperf > x86cpu.c +%1 modules\arch\x86\x86regtmod.gperf > x86regtmod.c diff --git a/Mkfiles/vc/x86geninsn/run.bat b/Mkfiles/vc/x86geninsn/run.bat new file mode 100644 index 00000000..ca29214a --- /dev/null +++ b/Mkfiles/vc/x86geninsn/run.bat @@ -0,0 +1,2 @@ +cd ..\..\.. +%1 modules\arch\x86\x86insn.in x86insn_nasm.gperf x86insn_gas.gperf diff --git a/Mkfiles/vc/x86geninsn/x86geninsn.vcproj b/Mkfiles/vc/x86geninsn/x86geninsn.vcproj new file mode 100644 index 00000000..b69f6f89 --- /dev/null +++ b/Mkfiles/vc/x86geninsn/x86geninsn.vcproj @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Mkfiles/vc/yasm.sln b/Mkfiles/vc/yasm.sln index 8921a59d..d41527ed 100644 --- a/Mkfiles/vc/yasm.sln +++ b/Mkfiles/vc/yasm.sln @@ -32,8 +32,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "re2c", "re2c\re2c.vcproj", ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gap", "gap\gap.vcproj", "{5758BF4E-ABC4-11DA-B012-B622A1EF5492}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genperf", "genperf\genperf.vcproj", "{C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}" ProjectSection(ProjectDependencies) = postProject + {22294DC7-C6DF-4C34-A178-8751B43867B7} = {22294DC7-C6DF-4C34-A178-8751B43867B7} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genmodule", "genmodule\genmodule.vcproj", "{F0E8B707-00C5-4FF2-B8EF-7C39817132A0}" @@ -44,6 +45,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genstring", "genstring\gens ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x86geninsn", "x86geninsn\x86geninsn.vcproj", "{22294DC7-C6DF-4C34-A178-8751B43867B7}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject Global GlobalSection(SolutionConfiguration) = preSolution Debug = Debug @@ -74,10 +79,10 @@ Global {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug.Build.0 = Debug|Win32 {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release.ActiveCfg = Release|Win32 {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release.Build.0 = Release|Win32 - {5758BF4E-ABC4-11DA-B012-B622A1EF5492}.Debug.ActiveCfg = Debug|Win32 - {5758BF4E-ABC4-11DA-B012-B622A1EF5492}.Debug.Build.0 = Debug|Win32 - {5758BF4E-ABC4-11DA-B012-B622A1EF5492}.Release.ActiveCfg = Release|Win32 - {5758BF4E-ABC4-11DA-B012-B622A1EF5492}.Release.Build.0 = Release|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug.ActiveCfg = Debug|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug.Build.0 = Debug|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release.ActiveCfg = Release|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release.Build.0 = Release|Win32 {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug.ActiveCfg = Debug|Win32 {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug.Build.0 = Debug|Win32 {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release.ActiveCfg = Release|Win32 @@ -86,6 +91,10 @@ Global {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug.Build.0 = Debug|Win32 {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release.ActiveCfg = Release|Win32 {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release.Build.0 = Release|Win32 + {22294DC7-C6DF-4C34-A178-8751B43867B7}.Debug.ActiveCfg = Debug|Win32 + {22294DC7-C6DF-4C34-A178-8751B43867B7}.Debug.Build.0 = Debug|Win32 + {22294DC7-C6DF-4C34-A178-8751B43867B7}.Release.ActiveCfg = Release|Win32 + {22294DC7-C6DF-4C34-A178-8751B43867B7}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection diff --git a/Mkfiles/vc8/gap/run.bat b/Mkfiles/vc8/gap/run.bat deleted file mode 100644 index d5060801..00000000 --- a/Mkfiles/vc8/gap/run.bat +++ /dev/null @@ -1,2 +0,0 @@ -cd ..\..\..\ -%1 modules\arch\x86\x86parse.gap x86parse.c diff --git a/Mkfiles/vc8/gap/gap.vcproj b/Mkfiles/vc8/genperf/genperf.vcproj similarity index 85% rename from Mkfiles/vc8/gap/gap.vcproj rename to Mkfiles/vc8/genperf/genperf.vcproj index 9ba90035..0bb6bd67 100644 --- a/Mkfiles/vc8/gap/gap.vcproj +++ b/Mkfiles/vc8/genperf/genperf.vcproj @@ -2,9 +2,9 @@ @@ -64,7 +64,7 @@ /> diff --git a/Mkfiles/vc8/genperf/run.bat b/Mkfiles/vc8/genperf/run.bat new file mode 100644 index 00000000..1cf44bfc --- /dev/null +++ b/Mkfiles/vc8/genperf/run.bat @@ -0,0 +1,5 @@ +cd ..\..\..\ +%1 x86insn_nasm.gperf > x86insn_nasm.c +%1 x86insn_gas.gperf > x86insn_gas.c +%1 modules\arch\x86\x86cpu.gperf > x86cpu.c +%1 modules\arch\x86\x86regtmod.gperf > x86regtmod.c diff --git a/Mkfiles/vc8/x86geninsn/run.bat b/Mkfiles/vc8/x86geninsn/run.bat new file mode 100644 index 00000000..ca29214a --- /dev/null +++ b/Mkfiles/vc8/x86geninsn/run.bat @@ -0,0 +1,2 @@ +cd ..\..\.. +%1 modules\arch\x86\x86insn.in x86insn_nasm.gperf x86insn_gas.gperf diff --git a/Mkfiles/vc8/x86geninsn/x86geninsn.vcproj b/Mkfiles/vc8/x86geninsn/x86geninsn.vcproj new file mode 100644 index 00000000..381f556d --- /dev/null +++ b/Mkfiles/vc8/x86geninsn/x86geninsn.vcproj @@ -0,0 +1,201 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Mkfiles/vc8/yasm.sln b/Mkfiles/vc8/yasm.sln index 6717facf..44f78719 100644 --- a/Mkfiles/vc8/yasm.sln +++ b/Mkfiles/vc8/yasm.sln @@ -29,12 +29,17 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genversion", "genversion\ge EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "re2c", "re2c\re2c.vcproj", "{3C58BE13-50A3-4583-984D-D8902B3D7713}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gap", "gap\gap.vcproj", "{5758BF4E-ABC4-11DA-B012-B622A1EF5492}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genperf", "genperf\genperf.vcproj", "{C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}" + ProjectSection(ProjectDependencies) = postProject + {22294DC7-C6DF-4C34-A178-8751B43867B7} = {22294DC7-C6DF-4C34-A178-8751B43867B7} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genmodule", "genmodule\genmodule.vcproj", "{F0E8B707-00C5-4FF2-B8EF-7C39817132A0}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genstring", "genstring\genstring.vcproj", "{021CEB0A-F721-4F59-B349-9CEEAF244459}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x86geninsn", "x86geninsn\x86geninsn.vcproj", "{22294DC7-C6DF-4C34-A178-8751B43867B7}" +EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{825AC694-358C-4D8D-92DE-33A2691978CE}" ProjectSection(SolutionItems) = preProject crt_secure_no_deprecate.vsprops = crt_secure_no_deprecate.vsprops @@ -97,14 +102,14 @@ Global {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|Win32.Build.0 = Release|Win32 {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|x64.ActiveCfg = Release|Win32 {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|x64.Build.0 = Release|Win32 - {5758BF4E-ABC4-11DA-B012-B622A1EF5492}.Debug|Win32.ActiveCfg = Debug|Win32 - {5758BF4E-ABC4-11DA-B012-B622A1EF5492}.Debug|Win32.Build.0 = Debug|Win32 - {5758BF4E-ABC4-11DA-B012-B622A1EF5492}.Debug|x64.ActiveCfg = Debug|Win32 - {5758BF4E-ABC4-11DA-B012-B622A1EF5492}.Debug|x64.Build.0 = Debug|Win32 - {5758BF4E-ABC4-11DA-B012-B622A1EF5492}.Release|Win32.ActiveCfg = Release|Win32 - {5758BF4E-ABC4-11DA-B012-B622A1EF5492}.Release|Win32.Build.0 = Release|Win32 - {5758BF4E-ABC4-11DA-B012-B622A1EF5492}.Release|x64.ActiveCfg = Release|Win32 - {5758BF4E-ABC4-11DA-B012-B622A1EF5492}.Release|x64.Build.0 = Release|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|Win32.ActiveCfg = Debug|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|Win32.Build.0 = Debug|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|x64.ActiveCfg = Debug|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|x64.Build.0 = Debug|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|Win32.ActiveCfg = Release|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|Win32.Build.0 = Release|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|x64.ActiveCfg = Release|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|x64.Build.0 = Release|Win32 {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|Win32.ActiveCfg = Debug|Win32 {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|Win32.Build.0 = Debug|Win32 {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|x64.ActiveCfg = Debug|Win32 @@ -121,6 +126,14 @@ Global {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|Win32.Build.0 = Release|Win32 {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|x64.ActiveCfg = Release|Win32 {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|x64.Build.0 = Release|Win32 + {22294DC7-C6DF-4C34-A178-8751B43867B7}.Debug|Win32.ActiveCfg = Debug|Win32 + {22294DC7-C6DF-4C34-A178-8751B43867B7}.Debug|Win32.Build.0 = Debug|Win32 + {22294DC7-C6DF-4C34-A178-8751B43867B7}.Debug|x64.ActiveCfg = Debug|Win32 + {22294DC7-C6DF-4C34-A178-8751B43867B7}.Debug|x64.Build.0 = Debug|Win32 + {22294DC7-C6DF-4C34-A178-8751B43867B7}.Release|Win32.ActiveCfg = Release|Win32 + {22294DC7-C6DF-4C34-A178-8751B43867B7}.Release|Win32.Build.0 = Release|Win32 + {22294DC7-C6DF-4C34-A178-8751B43867B7}.Release|x64.ActiveCfg = Release|Win32 + {22294DC7-C6DF-4C34-A178-8751B43867B7}.Release|x64.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From 1afb23f689413aed8655cbe9d0d11bf90805254b Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 8 Sep 2007 01:34:51 +0000 Subject: [PATCH 065/585] Fix a couple of Doxygen nits. svn path=/trunk/yasm/; revision=1931 --- libyasm/bytecode.h | 6 +++++- libyasm/expr.h | 14 +++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/libyasm/bytecode.h b/libyasm/bytecode.h index e53dc542..741aabb6 100644 --- a/libyasm/bytecode.h +++ b/libyasm/bytecode.h @@ -263,7 +263,11 @@ int yasm_bc_tobytes_common yasm_output_value_func output_value, /*@null@*/ yasm_output_reloc_func output_reloc); -#define yasm_bc__next(x) STAILQ_NEXT(x, link) +/** Get the next bytecode in a linked list of bytecodes. + * \param bc bytecode + * \return Next bytecode. + */ +#define yasm_bc__next(bc) STAILQ_NEXT(bc, link) /** Set multiple field of a bytecode. * A bytecode can be repeated a number of times when output. This function diff --git a/libyasm/expr.h b/libyasm/expr.h index 61975674..990452f2 100644 --- a/libyasm/expr.h +++ b/libyasm/expr.h @@ -56,13 +56,13 @@ typedef struct yasm_expr__item { /** Expression item data. Correct value depends on type. */ union { - yasm_bytecode *precbc; /**< Direct bytecode ref (#YASM_EXPR_PRECBC) */ - yasm_symrec *sym; /**< Symbol (#YASM_EXPR_SYM) */ - yasm_expr *expn; /**< Subexpression (#YASM_EXPR_EXPR) */ - yasm_intnum *intn; /**< Integer value (#YASM_EXPR_INT) */ - yasm_floatnum *flt; /**< Floating point value (#YASM_EXPR_FLOAT) */ - uintptr_t reg; /**< Register (#YASM_EXPR_REG) */ - unsigned int subst; /**< Subst placeholder (#YASM_EXPR_SUBST) */ + yasm_bytecode *precbc; /**< Direct bytecode ref (YASM_EXPR_PRECBC) */ + yasm_symrec *sym; /**< Symbol (YASM_EXPR_SYM) */ + yasm_expr *expn; /**< Subexpression (YASM_EXPR_EXPR) */ + yasm_intnum *intn; /**< Integer value (YASM_EXPR_INT) */ + yasm_floatnum *flt; /**< Floating point value (YASM_EXPR_FLOAT) */ + uintptr_t reg; /**< Register (YASM_EXPR_REG) */ + unsigned int subst; /**< Subst placeholder (YASM_EXPR_SUBST) */ } data; } yasm_expr__item; From 1387e29705d5ce24584b8846a5c4e197ed55ad5a Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 8 Sep 2007 02:13:25 +0000 Subject: [PATCH 066/585] 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 --- Mkfiles/vc/modules/modules.vcproj | 18 ++++++++++++++++++ Mkfiles/vc8/modules/modules.vcproj | 24 ++++++++++++++++++++++++ modules/arch/x86/x86geninsn.c | 3 --- tools/genperf/genperf.c | 20 ++++++++++++++++---- 4 files changed, 58 insertions(+), 7 deletions(-) diff --git a/Mkfiles/vc/modules/modules.vcproj b/Mkfiles/vc/modules/modules.vcproj index 3879cd1a..6d043ed0 100644 --- a/Mkfiles/vc/modules/modules.vcproj +++ b/Mkfiles/vc/modules/modules.vcproj @@ -124,6 +124,18 @@ + + + + + + + + @@ -139,6 +151,12 @@ + + + + + + + + + + + + @@ -349,6 +365,14 @@ RelativePath="..\..\..\modules\arch\x86\x86id.c" > + + + + str = yasm__xstrdup(tmp); STAILQ_INSERT_TAIL(&usercode, sv, link); @@ -366,7 +378,7 @@ main(int argc, char *argv[]) /* %{ begins a verbatim code section that ends with %} */ if (line[1] == '{') { sv = yasm_xmalloc(sizeof(sval)); - snprintf(tmp, 1024, "#line %u \"%s\"\n\n", cur_line, argv[1]); + sprintf(tmp, "#line %u \"%s\"\n\n", cur_line, filename); sv->str = yasm__xstrdup(tmp); STAILQ_INSERT_TAIL(&usercode, sv, link); @@ -487,7 +499,7 @@ main(int argc, char *argv[]) /* Pull in any end code */ if (!feof(in)) { sv = yasm_xmalloc(sizeof(sval)); - snprintf(tmp, 1024, "#line %u \"%s\"\n\n", cur_line, argv[1]); + sprintf(tmp, "#line %u \"%s\"\n\n", cur_line, filename); sv->str = yasm__xstrdup(tmp); STAILQ_INSERT_TAIL(&usercode2, sv, link); @@ -506,7 +518,7 @@ main(int argc, char *argv[]) printf("%s", sv->str); /* Get perfect hash */ - perfect_gen(stdout, lookup_function_name, struct_name, &keywords, argv[1]); + perfect_gen(stdout, lookup_function_name, struct_name, &keywords, filename); STAILQ_FOREACH(sv, &usercode2, link) printf("%s", sv->str); From 502f5a1c4de42e4f53510159bc873b6b0fc1920a Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 8 Sep 2007 02:19:33 +0000 Subject: [PATCH 067/585] Re-enable lc3b in flat Mkfiles. svn path=/trunk/yasm/; revision=1933 --- Mkfiles/Makefile.dj | 12 ++++++------ Mkfiles/Makefile.flat | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Mkfiles/Makefile.dj b/Mkfiles/Makefile.dj index 619fed4d..0fbe56b5 100644 --- a/Mkfiles/Makefile.dj +++ b/Mkfiles/Makefile.dj @@ -55,15 +55,15 @@ MODULES_ARCH_X86_OBJS= \ x86regtmod.o YASM_MODULES=arch_x86 -#MODULES_ARCH_LC3B_OBJS= \ -# modules/arch/lc3b/lc3barch.o \ -# modules/arch/lc3b/lc3bbc.o \ -# lc3bid.o -#YASM_MODULES+=arch_lc3b +MODULES_ARCH_LC3B_OBJS= \ + modules/arch/lc3b/lc3barch.o \ + modules/arch/lc3b/lc3bbc.o \ + lc3bid.o +YASM_MODULES+=arch_lc3b MODULES_ARCH_OBJS= \ $(MODULES_ARCH_X86_OBJS) \ -# $(MODULES_ARCH_LC3B_OBJS) + $(MODULES_ARCH_LC3B_OBJS) MODULES_DBGFMTS_OBJS= \ modules/dbgfmts/null/null-dbgfmt.o \ diff --git a/Mkfiles/Makefile.flat b/Mkfiles/Makefile.flat index 3859451d..977d00fa 100644 --- a/Mkfiles/Makefile.flat +++ b/Mkfiles/Makefile.flat @@ -58,15 +58,15 @@ MODULES_ARCH_X86_OBJS= \ x86regtmod.o YASM_MODULES=arch_x86 -#MODULES_ARCH_LC3B_OBJS= \ -# modules/arch/lc3b/lc3barch.o \ -# modules/arch/lc3b/lc3bbc.o \ -# lc3bid.o -#YASM_MODULES+=arch_lc3b +MODULES_ARCH_LC3B_OBJS= \ + modules/arch/lc3b/lc3barch.o \ + modules/arch/lc3b/lc3bbc.o \ + lc3bid.o +YASM_MODULES+=arch_lc3b MODULES_ARCH_OBJS= \ $(MODULES_ARCH_X86_OBJS) \ -# $(MODULES_ARCH_LC3B_OBJS) + $(MODULES_ARCH_LC3B_OBJS) MODULES_DBGFMTS_OBJS= \ modules/dbgfmts/null/null-dbgfmt.o \ From 44a777ca7c4bfe74ca2c582c0964937baeecfb9f Mon Sep 17 00:00:00 2001 From: paulbarker Date: Sun, 9 Sep 2007 11:49:25 +0000 Subject: [PATCH 068/585] Added yasm_get_include_dir() function. svn path=/branches/multiarch/; revision=1934 --- libyasm/file.c | 17 +++++++++++++++++ libyasm/file.h | 4 ++++ 2 files changed, 21 insertions(+) diff --git a/libyasm/file.c b/libyasm/file.c index cd2e002f..48cb6f25 100644 --- a/libyasm/file.c +++ b/libyasm/file.c @@ -518,6 +518,23 @@ yasm_delete_include_paths(void) STAILQ_INIT(&incpaths); } +const char * +yasm_get_include_dir(void **iter) +{ + incpath *p = (incpath *)*iter; + + if (!p) + p = STAILQ_FIRST(&incpaths); + else + p = STAILQ_NEXT(p, link); + + *iter = p; + if (p) + return p->path; + else + return NULL; +} + void yasm_add_include_path(const char *path) { diff --git a/libyasm/file.h b/libyasm/file.h index c7069949..0dd5e2e0 100644 --- a/libyasm/file.h +++ b/libyasm/file.h @@ -210,6 +210,10 @@ char *yasm__combpath_win(const char *from, const char *to); */ void yasm_delete_include_paths(void); +/** Iterate through include paths. +*/ +const char * yasm_get_include_dir(void **iter) + /** Add an include path for use by yasm_fopen_include(). * If path is relative, it is treated by yasm_fopen_include() as relative to * the current working directory. From ac75ded37955b0a571d8577092db8eff4639e3ba Mon Sep 17 00:00:00 2001 From: paulbarker Date: Sun, 9 Sep 2007 11:51:08 +0000 Subject: [PATCH 069/585] Changed gas parser to only pass the first cpp line marker onto the debugging module. svn path=/branches/multiarch/; revision=1935 --- modules/parsers/gas/gas-parse.c | 22 +++++++++++++++------- modules/parsers/gas/gas-parser.c | 1 + modules/parsers/gas/gas-parser.h | 3 +++ 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/modules/parsers/gas/gas-parse.c b/modules/parsers/gas/gas-parse.c index 027de7db..2c402f15 100644 --- a/modules/parsers/gas/gas-parse.c +++ b/modules/parsers/gas/gas-parse.c @@ -86,7 +86,7 @@ get_peek_token(yasm_parser_gas *parser_gas) { char savech = parser_gas->tokch; if (parser_gas->peek_token != NONE) - yasm_internal_error(N_("only can have one token of lookahead")); + yasm_internal_error(N_("can only have one token of lookahead")); parser_gas->peek_token = gas_parser_lex(&parser_gas->peek_tokval, parser_gas); parser_gas->peek_tokch = parser_gas->tokch; @@ -324,14 +324,22 @@ cpp_line_marker(yasm_parser_gas *parser_gas) /* Set linemap. */ yasm_linemap_set(parser_gas->linemap, filename, line, 1); - /* Pass change along to debug format */ - yasm_vps_initialize(&vps); - vp = yasm_vp_create_string(NULL, filename); - yasm_vps_append(&vps, vp); + /* + The first line marker in the file (which should be on the first line + of the file) will give us the name of the source file. This information + needs to be passed on to the debug format module. + */ + if (parser_gas->seen_line_marker == 0) { + parser_gas->seen_line_marker = 1; - yasm_object_directive(p_object, ".file", "gas", &vps, NULL, cur_line); + yasm_vps_initialize(&vps); + vp = yasm_vp_create_string(NULL, filename); + yasm_vps_append(&vps, vp); - yasm_vps_delete(&vps); + yasm_object_directive(p_object, ".file", "gas", &vps, NULL, cur_line); + + yasm_vps_delete(&vps); + } /* Skip flags. */ while (1) { diff --git a/modules/parsers/gas/gas-parser.c b/modules/parsers/gas/gas-parser.c index 6d8aa998..521851cd 100644 --- a/modules/parsers/gas/gas-parser.c +++ b/modules/parsers/gas/gas-parser.c @@ -52,6 +52,7 @@ gas_parser_do_parse(yasm_object *object, yasm_preproc *pp, parser_gas.dir_fileline = 0; parser_gas.dir_file = NULL; parser_gas.dir_line = 0; + parser_gas.seen_line_marker = 0; parser_gas.preproc = pp; parser_gas.errwarns = errwarns; diff --git a/modules/parsers/gas/gas-parser.h b/modules/parsers/gas/gas-parser.h index bfae0a9d..eece2a23 100644 --- a/modules/parsers/gas/gas-parser.h +++ b/modules/parsers/gas/gas-parser.h @@ -107,6 +107,9 @@ typedef struct yasm_parser_gas { /*@null@*/ char *dir_file; unsigned long dir_line; + /* Have we seen a line marker? */ + int seen_line_marker; + /*@dependent@*/ yasm_preproc *preproc; /*@dependent@*/ yasm_errwarns *errwarns; From 37b2042a79b0eef54da451222e03f26ca61b4234 Mon Sep 17 00:00:00 2001 From: paulbarker Date: Sun, 9 Sep 2007 17:09:38 +0000 Subject: [PATCH 070/585] Fixed missing semicolon in file.h due to mistake when committing r1935. svn path=/branches/multiarch/; revision=1936 --- libyasm/file.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libyasm/file.h b/libyasm/file.h index 0dd5e2e0..21676cdd 100644 --- a/libyasm/file.h +++ b/libyasm/file.h @@ -212,7 +212,7 @@ void yasm_delete_include_paths(void); /** Iterate through include paths. */ -const char * yasm_get_include_dir(void **iter) +const char * yasm_get_include_dir(void **iter); /** Add an include path for use by yasm_fopen_include(). * If path is relative, it is treated by yasm_fopen_include() as relative to From f150e45913345aa753dc3307a0266043f199b25b Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Mon, 10 Sep 2007 06:59:47 +0000 Subject: [PATCH 071/585] 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 --- Makefile.am | 11 +- Mkfiles/Makefile.dj | 10 +- Mkfiles/Makefile.flat | 10 +- Mkfiles/vc/x86geninsn/run.bat | 2 - Mkfiles/vc/x86geninsn/x86geninsn.vcproj | 128 - Mkfiles/vc/yasm.sln | 9 - Mkfiles/vc8/x86geninsn/run.bat | 2 - Mkfiles/vc8/x86geninsn/x86geninsn.vcproj | 201 - Mkfiles/vc8/yasm.sln | 13 - modules/arch/x86/Makefile.inc | 44 +- modules/arch/x86/gen_x86_insn.py | 5284 ++++++++++++++++++++++ modules/arch/x86/x86geninsn.c | 194 - modules/arch/x86/x86id.c | 2008 +------- modules/arch/x86/x86insn.in | 965 ---- tools/genperf/Makefile.inc | 5 + 15 files changed, 5324 insertions(+), 3562 deletions(-) delete mode 100644 Mkfiles/vc/x86geninsn/run.bat delete mode 100644 Mkfiles/vc/x86geninsn/x86geninsn.vcproj delete mode 100644 Mkfiles/vc8/x86geninsn/run.bat delete mode 100644 Mkfiles/vc8/x86geninsn/x86geninsn.vcproj create mode 100755 modules/arch/x86/gen_x86_insn.py delete mode 100644 modules/arch/x86/x86geninsn.c delete mode 100644 modules/arch/x86/x86insn.in diff --git a/Makefile.am b/Makefile.am index d669d003..3eae0cb8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -21,6 +21,9 @@ nodist_include_HEADERS = libyasm-stdint.h noinst_HEADERS = util.h BUILT_SOURCES = +MAINTAINERCLEANFILES = +DISTCLEANFILES = +SUFFIXES = # configure.lineno doesn't clean up after itself? CLEANFILES = configure.lineno @@ -77,8 +80,6 @@ EXTRA_DIST += Mkfiles/vc/re2c/re2c.vcproj EXTRA_DIST += Mkfiles/vc/re2c/run.bat EXTRA_DIST += Mkfiles/vc/genperf/genperf.vcproj EXTRA_DIST += Mkfiles/vc/genperf/run.bat -EXTRA_DIST += Mkfiles/vc/x86geninsn/x86geninsn.vcproj -EXTRA_DIST += Mkfiles/vc/x86geninsn/run.bat EXTRA_DIST += Mkfiles/vc8/crt_secure_no_deprecate.vsprops EXTRA_DIST += Mkfiles/vc8/yasm.sln EXTRA_DIST += Mkfiles/vc8/yasm.vcproj @@ -100,11 +101,9 @@ EXTRA_DIST += Mkfiles/vc8/re2c/re2c.vcproj EXTRA_DIST += Mkfiles/vc8/re2c/run.bat EXTRA_DIST += Mkfiles/vc8/genperf/genperf.vcproj EXTRA_DIST += Mkfiles/vc8/genperf/run.bat -EXTRA_DIST += Mkfiles/vc8/x86geninsn/x86geninsn.vcproj -EXTRA_DIST += Mkfiles/vc8/x86geninsn/run.bat # Until this gets fixed in automake -DISTCLEANFILES = libyasm/stamp-h libyasm/stamp-h[0-9]* +DISTCLEANFILES += libyasm/stamp-h libyasm/stamp-h[0-9]* ACLOCAL_AMFLAGS = -I m4 @@ -119,7 +118,7 @@ install-exec-hook: python-install uninstall-hook: python-uninstall if BUILD_MAN -MAINTAINERCLEANFILES = $(dist_man_MANS) +MAINTAINERCLEANFILES += $(dist_man_MANS) endif # genstring build diff --git a/Mkfiles/Makefile.dj b/Mkfiles/Makefile.dj index 0fbe56b5..dff9b6d4 100644 --- a/Mkfiles/Makefile.dj +++ b/Mkfiles/Makefile.dj @@ -172,11 +172,9 @@ genmodule: libyasm/genmodule.c module.c: libyasm/module.in genmodule ./genmodule libyasm/module.in Mkfiles/Makefile.dj -x86geninsn: modules/arch/x86/x86geninsn.c - $(BUILDCC) -o $@ $< - -x86insn_nasm.gperf x86insn_gas.gperf: modules/arch/x86/x86insn.in x86geninsn - ./x86geninsn modules/arch/x86/x86insn.in x86insn_nasm.gperf x86insn_gas.gperf +x86insn_nasm.gperf x86insn_gas.gperf x86insns.c: modules/arch/x86/gen_x86_insn.py + # ignore error in case python is not installed + -python modules/arch/x86/gen_x86_insn.py x86insn_nasm.c: x86insn_nasm.gperf genperf ./genperf x86insn_nasm.gperf > $@ @@ -190,7 +188,7 @@ x86cpu.c: modules/arch/x86/x86cpu.gperf genperf x86regtmod.c: modules/arch/x86/x86regtmod.gperf genperf ./genperf modules/arch/x86/x86regtmod.gperf > $@ -modules/arch/x86/x86id.c: x86insn_nasm.c x86insn_gas.c +modules/arch/x86/x86id.c: x86insn_nasm.c x86insn_gas.c x86insns.c lc3bid.c: modules/arch/lc3b/lc3bid.re re2c ./re2c -s -o $@ modules/arch/lc3b/lc3bid.re diff --git a/Mkfiles/Makefile.flat b/Mkfiles/Makefile.flat index 977d00fa..42ddd691 100644 --- a/Mkfiles/Makefile.flat +++ b/Mkfiles/Makefile.flat @@ -175,11 +175,9 @@ genmodule: libyasm/genmodule.c module.c: libyasm/module.in genmodule ./genmodule libyasm/module.in Mkfiles/Makefile.flat -x86geninsn: modules/arch/x86/x86geninsn.c - $(BUILDCC) -o $@ $< - -x86insn_nasm.gperf x86insn_gas.gperf: modules/arch/x86/x86insn.in x86geninsn - ./x86geninsn modules/arch/x86/x86insn.in x86insn_nasm.gperf x86insn_gas.gperf +x86insn_nasm.gperf x86insn_gas.gperf x86insns.c: modules/arch/x86/gen_x86_insn.py + # ignore error in case python is not installed + -python modules/arch/x86/gen_x86_insn.py x86insn_nasm.c: x86insn_nasm.gperf genperf ./genperf x86insn_nasm.gperf > $@ @@ -193,7 +191,7 @@ x86cpu.c: modules/arch/x86/x86cpu.gperf genperf x86regtmod.c: modules/arch/x86/x86regtmod.gperf genperf ./genperf modules/arch/x86/x86regtmod.gperf > $@ -modules/arch/x86/x86id.c: x86insn_nasm.c x86insn_gas.c +modules/arch/x86/x86id.c: x86insn_nasm.c x86insn_gas.c x86insns.c lc3bid.c: modules/arch/lc3b/lc3bid.re re2c ./re2c -s -o $@ modules/arch/lc3b/lc3bid.re diff --git a/Mkfiles/vc/x86geninsn/run.bat b/Mkfiles/vc/x86geninsn/run.bat deleted file mode 100644 index ca29214a..00000000 --- a/Mkfiles/vc/x86geninsn/run.bat +++ /dev/null @@ -1,2 +0,0 @@ -cd ..\..\.. -%1 modules\arch\x86\x86insn.in x86insn_nasm.gperf x86insn_gas.gperf diff --git a/Mkfiles/vc/x86geninsn/x86geninsn.vcproj b/Mkfiles/vc/x86geninsn/x86geninsn.vcproj deleted file mode 100644 index b69f6f89..00000000 --- a/Mkfiles/vc/x86geninsn/x86geninsn.vcproj +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Mkfiles/vc/yasm.sln b/Mkfiles/vc/yasm.sln index d41527ed..c454326b 100644 --- a/Mkfiles/vc/yasm.sln +++ b/Mkfiles/vc/yasm.sln @@ -34,7 +34,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "re2c", "re2c\re2c.vcproj", EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genperf", "genperf\genperf.vcproj", "{C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}" ProjectSection(ProjectDependencies) = postProject - {22294DC7-C6DF-4C34-A178-8751B43867B7} = {22294DC7-C6DF-4C34-A178-8751B43867B7} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genmodule", "genmodule\genmodule.vcproj", "{F0E8B707-00C5-4FF2-B8EF-7C39817132A0}" @@ -45,10 +44,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genstring", "genstring\gens ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x86geninsn", "x86geninsn\x86geninsn.vcproj", "{22294DC7-C6DF-4C34-A178-8751B43867B7}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject Global GlobalSection(SolutionConfiguration) = preSolution Debug = Debug @@ -91,10 +86,6 @@ Global {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug.Build.0 = Debug|Win32 {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release.ActiveCfg = Release|Win32 {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release.Build.0 = Release|Win32 - {22294DC7-C6DF-4C34-A178-8751B43867B7}.Debug.ActiveCfg = Debug|Win32 - {22294DC7-C6DF-4C34-A178-8751B43867B7}.Debug.Build.0 = Debug|Win32 - {22294DC7-C6DF-4C34-A178-8751B43867B7}.Release.ActiveCfg = Release|Win32 - {22294DC7-C6DF-4C34-A178-8751B43867B7}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection diff --git a/Mkfiles/vc8/x86geninsn/run.bat b/Mkfiles/vc8/x86geninsn/run.bat deleted file mode 100644 index ca29214a..00000000 --- a/Mkfiles/vc8/x86geninsn/run.bat +++ /dev/null @@ -1,2 +0,0 @@ -cd ..\..\.. -%1 modules\arch\x86\x86insn.in x86insn_nasm.gperf x86insn_gas.gperf diff --git a/Mkfiles/vc8/x86geninsn/x86geninsn.vcproj b/Mkfiles/vc8/x86geninsn/x86geninsn.vcproj deleted file mode 100644 index 381f556d..00000000 --- a/Mkfiles/vc8/x86geninsn/x86geninsn.vcproj +++ /dev/null @@ -1,201 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Mkfiles/vc8/yasm.sln b/Mkfiles/vc8/yasm.sln index 44f78719..4d553885 100644 --- a/Mkfiles/vc8/yasm.sln +++ b/Mkfiles/vc8/yasm.sln @@ -30,16 +30,11 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "re2c", "re2c\re2c.vcproj", "{3C58BE13-50A3-4583-984D-D8902B3D7713}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genperf", "genperf\genperf.vcproj", "{C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}" - ProjectSection(ProjectDependencies) = postProject - {22294DC7-C6DF-4C34-A178-8751B43867B7} = {22294DC7-C6DF-4C34-A178-8751B43867B7} - EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genmodule", "genmodule\genmodule.vcproj", "{F0E8B707-00C5-4FF2-B8EF-7C39817132A0}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genstring", "genstring\genstring.vcproj", "{021CEB0A-F721-4F59-B349-9CEEAF244459}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x86geninsn", "x86geninsn\x86geninsn.vcproj", "{22294DC7-C6DF-4C34-A178-8751B43867B7}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{825AC694-358C-4D8D-92DE-33A2691978CE}" ProjectSection(SolutionItems) = preProject crt_secure_no_deprecate.vsprops = crt_secure_no_deprecate.vsprops @@ -126,14 +121,6 @@ Global {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|Win32.Build.0 = Release|Win32 {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|x64.ActiveCfg = Release|Win32 {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|x64.Build.0 = Release|Win32 - {22294DC7-C6DF-4C34-A178-8751B43867B7}.Debug|Win32.ActiveCfg = Debug|Win32 - {22294DC7-C6DF-4C34-A178-8751B43867B7}.Debug|Win32.Build.0 = Debug|Win32 - {22294DC7-C6DF-4C34-A178-8751B43867B7}.Debug|x64.ActiveCfg = Debug|Win32 - {22294DC7-C6DF-4C34-A178-8751B43867B7}.Debug|x64.Build.0 = Debug|Win32 - {22294DC7-C6DF-4C34-A178-8751B43867B7}.Release|Win32.ActiveCfg = Release|Win32 - {22294DC7-C6DF-4C34-A178-8751B43867B7}.Release|Win32.Build.0 = Release|Win32 - {22294DC7-C6DF-4C34-A178-8751B43867B7}.Release|x64.ActiveCfg = Release|Win32 - {22294DC7-C6DF-4C34-A178-8751B43867B7}.Release|x64.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/modules/arch/x86/Makefile.inc b/modules/arch/x86/Makefile.inc index aa201df8..3ac4f623 100644 --- a/modules/arch/x86/Makefile.inc +++ b/modules/arch/x86/Makefile.inc @@ -10,41 +10,40 @@ libyasm_a_SOURCES += x86regtmod.c YASM_MODULES += arch_x86 -modules/arch/x86/x86id.c: x86insn_nasm.c x86insn_gas.c +modules/arch/x86/x86id.c: x86insn_nasm.c x86insn_gas.c x86insns.c -noinst_PROGRAMS += x86geninsn - -x86geninsn_SOURCES = -EXTRA_DIST += modules/arch/x86/x86geninsn.c -x86geninsn_LDADD = x86geninsn.$(OBJEXT) -x86geninsn_LINK = $(CCLD_FOR_BUILD) -o $@ - -x86geninsn.$(OBJEXT): modules/arch/x86/x86geninsn.c - $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f modules/arch/x86/x86geninsn.c || echo '$(srcdir)/'`modules/arch/x86/x86geninsn.c - -EXTRA_DIST += modules/arch/x86/x86insn.in - -x86insn_nasm.gperf x86insn_gas.gperf: $(srcdir)/modules/arch/x86/x86insn.in x86geninsn$(EXEEXT) - $(top_builddir)/x86geninsn$(EXEEXT) $(srcdir)/modules/arch/x86/x86insn.in x86insn_nasm.gperf x86insn_gas.gperf +EXTRA_DIST += modules/arch/x86/gen_x86_insn.py +if HAVE_PYTHON +x86insn_nasm.gperf x86insn_gas.gperf x86insns.c: $(srcdir)/modules/arch/x86/gen_x86_insn.py + $(PYTHON) $(srcdir)/modules/arch/x86/gen_x86_insn.py +else +x86insn_nasm.gperf: $(srcdir)/x86insn_nasm.gperf + @echo Python must be installed to regenerate x86 instructions files + cp $(srcdir)/x86insn_nasm.gperf $@ +x86insn_gas.gperf: $(srcdir)/x86insn_gas.gperf + @echo Python must be installed to regenerate x86 instructions files + cp $(srcdir)/x86insn_gas.gperf $@ +endif +BUILT_SOURCES += x86insns.c BUILT_SOURCES += x86insn_nasm.gperf BUILT_SOURCES += x86insn_gas.gperf -CLEANFILES += x86insn_nasm.gperf -CLEANFILES += x86insn_gas.gperf +EXTRA_DIST += x86insns.c +EXTRA_DIST += x86insn_nasm.gperf +EXTRA_DIST += x86insn_gas.gperf +MAINTAINERCLEANFILES += x86insns.c +MAINTAINERCLEANFILES += x86insn_nasm.gperf +MAINTAINERCLEANFILES += x86insn_gas.gperf EXTRA_DIST += modules/arch/x86/x86cpu.gperf EXTRA_DIST += modules/arch/x86/x86regtmod.gperf +# Use suffix rules for gperf files x86insn_nasm.c: x86insn_nasm.gperf genperf$(EXEEXT) - $(top_builddir)/genperf$(EXEEXT) x86insn_nasm.gperf > $@ - x86insn_gas.c: x86insn_gas.gperf genperf$(EXEEXT) - $(top_builddir)/genperf$(EXEEXT) x86insn_gas.gperf > $@ - x86cpu.c: $(srcdir)/modules/arch/x86/x86cpu.gperf genperf$(EXEEXT) $(top_builddir)/genperf$(EXEEXT) $(srcdir)/modules/arch/x86/x86cpu.gperf > $@ - x86regtmod.c: $(srcdir)/modules/arch/x86/x86regtmod.gperf genperf$(EXEEXT) $(top_builddir)/genperf$(EXEEXT) $(srcdir)/modules/arch/x86/x86regtmod.gperf > $@ @@ -55,7 +54,6 @@ BUILT_SOURCES += x86regtmod.c CLEANFILES += x86insn_nasm.c CLEANFILES += x86insn_gas.c CLEANFILES += x86cpu.c -CLEANFILES += x86cpu.c CLEANFILES += x86regtmod.c EXTRA_DIST += modules/arch/x86/tests/Makefile.inc diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py new file mode 100755 index 00000000..b0bd99f3 --- /dev/null +++ b/modules/arch/x86/gen_x86_insn.py @@ -0,0 +1,5284 @@ +#! /usr/bin/env python +# +# x86 instructions and prefixes data and code generation +# +# Copyright (C) 2002-2007 Peter Johnson +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +# NOTE: operands are arranged in NASM / Intel order (e.g. dest, src) + +ordered_cpus = [ + "086", "186", "286", "386", "486", "586", "686", "K6", "Athlon", "P3", + "P4", "IA64", "Hammer"] +ordered_cpu_features = [ + "FPU", "Cyrix", "AMD", "MMX", "3DNow", "SMM", "SSE", "SSE2", + "SSE3", "SVM", "PadLock", "SSSE3", "SSE41", "SSE42"] +unordered_cpu_features = ["Priv", "Prot", "Undoc", "Obs"] + +def cpu_lcd(cpu1, cpu2): + """Find the lowest common denominator of two CPU sets.""" + retval = set() + + # CPU + cpu1cpus = set(ordered_cpus) & set(cpu1) + if not cpu1cpus: + cpu1cpus.add("086") + cpu1mincpu = min(ordered_cpus.index(x) for x in cpu1cpus) + cpu2cpus = set(ordered_cpus) & set(cpu2) + if not cpu2cpus: + cpu2cpus.add("086") + cpu2mincpu = min(ordered_cpus.index(x) for x in cpu1cpus) + cpumin = ordered_cpus[min(cpu1mincpu, cpu2mincpu)] + if cpumin == "086": + cpumin = "Any" + + if cpumin != "Any": + retval.add(cpumin) + + # Feature + cpu1features = set(ordered_cpu_features) & set(cpu1) + if not cpu1features: + cpu1minfeature = -1 + else: + cpu1minfeature = min(ordered_cpu_features.index(x) + for x in cpu1features) + + cpu2features = set(ordered_cpu_features) & set(cpu2) + if not cpu2features: + cpu2minfeature = -1 + else: + cpu2minfeature = min(ordered_cpu_features.index(x) + for x in cpu2features) + + if cpu1minfeature != -1 and cpu2minfeature != -1: + featuremin = ordered_cpu_features[min(cpu1minfeature, cpu2minfeature)] + retval.add(featuremin) + + # Unordered features + for feature in set(unordered_cpu_features) & set(cpu1) & set(cpu2): + retval.add(feature) + + # 64-bitness + if "64" in cpu1 and "64" in cpu2: + retval.add("64") + if "Not64" in cpu1 and "Not64" in cpu2: + retval.add("Not64") + + return retval + +class Operand(object): + def __init__(self, **kwargs): + self.type = kwargs.pop("type") + self.size = kwargs.pop("size", "Any") + self.relaxed = kwargs.pop("relaxed", False) + self.dest = kwargs.pop("dest", None) + self.tmod = kwargs.pop("tmod", None) + self.opt = kwargs.pop("opt", None) + + if kwargs: + for arg in kwargs: + print "Warning: unrecognized arg %s" % arg + + def __str__(self): + op_str = [] + + op_str.append("OPT_%s" % self.type) + op_str.append("OPS_%s" % self.size) + + if self.relaxed: + op_str.append("OPS_Relaxed") + + if self.tmod is not None: + op_str.append("OPTM_%s" % self.tmod) + + if self.dest == "EA64": + op_str.append("OPEAS_64") + op_str.append("OPA_EA") + else: + op_str.append("OPA_%s" % self.dest) + + if self.opt is not None: + op_str.append("OPAP_%s" % self.opt) + + return '|'.join(op_str) + +class GroupForm(object): + def __init__(self, **kwargs): + # Parsers + self.parsers = set(kwargs.pop("parsers", ["gas", "nasm"])) + + # CPU feature flags initialization + self.cpu = set(kwargs.pop("cpu", [])) + if kwargs.pop("only64", False): + self.cpu.add("64") + if kwargs.pop("not64", False): + self.cpu.add("Not64") + + # Operation size + self.opersize = kwargs.pop("opersize", 0) + if self.opersize == 8: + self.opersize = 0 + + if self.opersize == 64: + self.cpu.add("64") + elif self.opersize == 32 and "64" not in self.cpu: + self.cpu.add("386") + + # Default operation size in 64-bit mode + self.def_opersize_64 = kwargs.pop("def_opersize_64", 0) + + # GAS suffix + self.gen_suffix = kwargs.pop("gen_suffix", True) + self.suffixes = kwargs.pop("suffixes", None) + suffix = kwargs.pop("suffix", None) + if suffix is not None: + self.suffixes = [suffix] + if self.suffixes is not None: + self.suffixes = set(x.upper() for x in self.suffixes) + + # Special instruction prefix + self.special_prefix = "0" + if "prefix" in kwargs: + self.special_prefix = "0x%02X" % kwargs.pop("prefix") + + # Spare value + self.spare = kwargs.pop("spare", 0) + + # Build opcodes string (C array initializer) + if "opcode" in kwargs: + # Usual case, just a single opcode + self.opcode = kwargs.pop("opcode") + self.opcode_len = len(self.opcode) + elif "opcode1" in kwargs and "opcode2" in kwargs: + # Two opcode case; the first opcode is the "optimized" opcode, + # the second is the "relaxed" opcode. For this to work, an + # opt="foo" must be set for one of the operands. + self.opcode1 = kwargs.pop("opcode1") + self.opcode2 = kwargs.pop("opcode2") + self.opcode_len = len(self.opcode1) + else: + raise KeyError("missing opcode") + + # Build operands string (C array initializer) + self.operands = kwargs.pop("operands") + for op in self.operands: + if op.type in ["Reg", "RM", "Areg", "Creg", "Dreg"]: + if op.size == 64: + self.cpu.add("64") + elif op.size == 32 and "64" not in self.cpu: + self.cpu.add("386") + if op.type in ["Imm", "ImmNotSegOff"]: + if op.size == 64: + self.cpu.add("64") + elif op.size == 32 and "64" not in self.cpu: + self.cpu.add("386") + if op.type in ["FS", "GS"] and "64" not in self.cpu: + self.cpu.add("386") + if op.type in ["CR4"] and "64" not in self.cpu: + self.cpu.add("586") + if op.dest == "EA64": + self.cpu.add("64") + + # Modifiers + self.modifiers = kwargs.pop("modifiers", []) + + # GAS flags + self.gas_only = ("nasm" not in self.parsers) + self.gas_illegal = ("gas" not in self.parsers) + self.gas_no_rev = (kwargs.pop("gas_no_reverse", False) or + kwargs.pop("gas_no_rev", False)) + + # CPU feature flags finalization + # Remove redundancies + maxcpu = -1 + if "64" in self.cpu: + pass #maxcpu = ordered_cpus.index("Hammer") + else: + maxcpu_set = self.cpu & set(ordered_cpus) + if maxcpu_set: + maxcpu = max(ordered_cpus.index(x) for x in maxcpu_set) + if maxcpu != -1: + for cpu in ordered_cpus[0:maxcpu]: + self.cpu.discard(cpu) + + if kwargs: + for arg in kwargs: + print "Warning: unrecognized arg %s" % arg + + def __str__(self): + if hasattr(self, "opcode"): + opcodes_str = ["0x%02X" % x for x in self.opcode] + elif hasattr(self, "opcode1") and hasattr(self, "opcode2"): + opcodes_str = ["0x%02X" % x for x in self.opcode1] + opcodes_str.extend("0x%02X" % x for x in self.opcode2) + # Ensure opcodes initializer string is 3 long + opcodes_str.extend(["0", "0", "0"]) + opcodes_str = "{" + ', '.join(opcodes_str[0:3]) + "}" + + operands_str = [str(x) for x in self.operands] + # Ensure operands initializer string is 3 long + operands_str.extend(["0", "0", "0"]) + operands_str = "{" + ', '.join(operands_str[0:3]) + "}" + + cpus_str = "|".join("CPU_%s" % x for x in sorted(self.cpu)) + + if len(self.modifiers) > 3: + raise ValueError("too many modifiers: %s" % (self.modifiers,)) + + # Number gap elements as we copy + modnames = [] + n = 0 + for mod in self.modifiers: + if mod == "Gap": + modnames.append("Gap%d" % n) + n += 1 + else: + modnames.append(mod) + + # Order by priority + mods = [x for x in ["Gap0", "Op2Add", "Gap1", "Op1Add", "Gap2", + "Op0Add", "PreAdd", "SpAdd", "OpSizeR", "Imm8", + "AdSizeR", "DOpS64R", "Op1AddSp"] + if x in modnames] + + if self.gas_only: + mods.append("GasOnly") + if self.gas_illegal: + mods.append("GasIllegal") + if self.gas_no_rev: + mods.append("GasNoRev") + if self.suffixes: + mods.extend("GasSuf%s" % x for x in sorted(self.suffixes)) + mod_str = "|".join("MOD_%s" % x for x in mods) + + # Build instruction info structure initializer + return "{ "+ ", ".join([cpus_str or "CPU_Any", + mod_str or "0", + "%d" % (self.opersize or 0), + "%d" % (self.def_opersize_64 or 0), + self.special_prefix or "0", + "%d" % self.opcode_len, + opcodes_str, + "%d" % (self.spare or 0), + "%d" % len(self.operands), + operands_str]) + " }" + +groups = {} +groupnames_ordered = [] +def add_group(name, **kwargs): + forms = groups.setdefault(name, []) + forms.append(GroupForm(**kwargs)) + groupnames_ordered.append(name) + +class Insn(object): + def __init__(self, groupname, suffix=None, parser=None, modifiers=None, + cpu=None, only64=False, not64=False): + self.groupname = groupname + if suffix is None: + self.suffix = None + else: + self.suffix = suffix.upper() + + self.parsers = None + if suffix is not None: + self.parsers = set(["gas"]) + if parser is not None: + self.parsers = set([parser]) + + if modifiers is None: + self.modifiers = [] + else: + self.modifiers = modifiers + if cpu is None: + self.cpu = None + else: + self.cpu = set(cpu) + + if only64: + if self.cpu is None: + self.cpu = set() + self.cpu.add("64") + if not64: + if self.cpu is None: + self.cpu = set() + self.cpu.add("Not64") + + def auto_cpu(self, parser): + if self.cpu is not None: + return + """Determine lowest common denominator CPU from group and suffix. + Does nothing if CPU is already set.""" + # Scan through group, matching parser and suffix + for form in groups[self.groupname]: + if parser not in form.parsers: + continue + if (self.suffix is not None and len(self.suffix) == 1 and + (form.suffixes is None or self.suffix not in form.suffixes)): + continue + if self.cpu is None: + self.cpu = form.cpu + else: + self.cpu = cpu_lcd(self.cpu, form.cpu) + + def copy(self): + """Return a shallow copy.""" + return Insn(self.groupname, + suffix=self.suffix, + modifiers=self.modifiers, + cpu=self.cpu) + + def __str__(self): + if self.suffix is None: + suffix_str = "NONE" + elif len(self.suffix) == 1: + suffix_str = "SUF_" + self.suffix + else: + suffix_str = self.suffix + + if self.cpu is None: + cpu_str = "" + else: + cpu_str = "|".join("CPU_%s" % x for x in sorted(self.cpu)) + + if len(self.modifiers) > 3: + raise ValueError("too many modifiers") + + # Ensure modifiers is at least 3 long + modifiers = [x for x in self.modifiers] + modifiers.extend([0, 0, 0]) + + # Find longest list of modifiers in groups + modnames = [] + for group in groups[self.groupname]: + if group.modifiers is not None and len(group.modifiers) > len(modnames): + # Number gap elements as we copy + modnames = [] + n = 0 + for mod in group.modifiers: + if mod == "Gap": + modnames.append("Gap%d" % n) + n += 1 + else: + modnames.append(mod) + + # Match up and order by priority + mods = dict(zip(modnames, modifiers)) + + modifier_str = "".join(reversed(["%02X" % mods[x] for x in + ["Gap0", "Op2Add", "Gap1", "Op1Add", + "Gap2", "Op0Add", "PreAdd", "SpAdd", + "OpSizeR", "Imm8", "AdSizeR", "DOpS64R", + "Op1AddSp"] if x in mods])) + if modifier_str: + modifier_str = "0x" + modifier_str + else: + modifier_str = "0" + + return ",\t".join(["%s_insn" % self.groupname, + "(%sUL<<8)|NELEMS(%s_insn)" % \ + (modifier_str, self.groupname), + cpu_str or "CPU_Any", + suffix_str]) + +insns = {} +def add_insn(name, groupname, **kwargs): + opts = insns.setdefault(name, []) + opts.append(Insn(groupname, **kwargs)) + +class Prefix(object): + def __init__(self, groupname, value, only64=False): + self.groupname = groupname + self.value = value + self.only64 = only64 + + def __str__(self): + return ",\t".join(["NULL", + "X86_" + self.groupname, + "0x%02X" % self.value, + "NONE"]) + +gas_insns = {} +nasm_insns = {} + +def add_prefix(name, groupname, value, parser=None, **kwargs): + prefix = Prefix(groupname, value, **kwargs) + if parser is None or parser == "gas": + gas_insns[name] = prefix + if parser is None or parser == "nasm": + nasm_insns[name] = prefix + +def finalize_insns(): + for name, opts in insns.iteritems(): + for insn in opts: + group = groups[insn.groupname] + + parsers = set() + for form in group: + parsers |= form.parsers + if insn.parsers is not None: + parsers &= insn.parsers + + if "gas" in parsers: + keyword = name + if keyword in gas_insns: + raise ValueError("duplicate gas instruction %s" % keyword) + newinsn = insn.copy() + newinsn.auto_cpu("gas") + gas_insns[keyword] = newinsn + + if insn.suffix is None: + suffixes = set() + for form in group: + if form.gen_suffix and form.suffixes is not None: + suffixes |= form.suffixes + + for suffix in suffixes: + keyword = name+suffix + if keyword in gas_insns: + raise ValueError("duplicate gas instruction %s" % + keyword) + newinsn = insn.copy() + newinsn.suffix = suffix + newinsn.auto_cpu("gas") + gas_insns[keyword] = newinsn + + if "nasm" in parsers: + keyword = name + if keyword in nasm_insns: + raise ValueError("duplicate nasm instruction %s" % keyword) + newinsn = insn.copy() + newinsn.auto_cpu("nasm") + nasm_insns[keyword] = newinsn + +def output_insns(f, parser, insns): + print >>f, """%%ignore-case +%%language=ANSI-C +%%compare-strncmp +%%readonly-tables +%%enum +%%struct-type +%%define hash-function-name insnprefix_%s_hash +%%define lookup-function-name insnprefix_%s_find +struct insnprefix_parse_data; +%%%%""" % (parser, parser) + for keyword in sorted(insns): + print >>f, "%s,\t%s" % (keyword.lower(), insns[keyword]) + +def output_gas_insns(f): + output_insns(f, "gas", gas_insns) + +def output_nasm_insns(f): + output_insns(f, "nasm", nasm_insns) + +def output_groups(f): + seen = set() + for name in groupnames_ordered: + if name in seen: + continue + seen.add(name) + print >>f, "static const x86_insn_info %s_insn[] = {" % name + print >>f, " ", + print >>f, ",\n ".join(str(x) for x in groups[name]) + print >>f, "};\n" + +##################################################################### +# General instruction groupings +##################################################################### + +# +# One byte opcode instructions with no operands +# +add_group("onebyte", + modifiers=["Op0Add", "OpSizeR", "DOpS64R"], + opcode=[0x00], + operands=[]) + +# +# One byte opcode instructions with "special" prefix with no operands +# +add_group("onebyte_prefix", + modifiers=["PreAdd", "Op0Add"], + prefix=0x00, + opcode=[0x00], + operands=[]) + +# +# Two byte opcode instructions with no operands +# +add_group("twobyte", + gen_suffix=False, + suffixes=["l", "q"], + modifiers=["Op0Add", "Op1Add"], + opcode=[0x00, 0x00], + operands=[]) + +# +# Three byte opcode instructions with no operands +# +add_group("threebyte", + modifiers=["Op0Add", "Op1Add", "Op2Add"], + opcode=[0x00, 0x00, 0x00], + operands=[]) + +# +# One byte opcode instructions with general memory operand +# +add_group("onebytemem", + gen_suffix=False, + suffixes=["l", "q", "s"], + modifiers=["SpAdd", "Op0Add"], + opcode=[0x00], + spare=0, + operands=[Operand(type="Mem", dest="EA")]) + +# +# Two byte opcode instructions with general memory operand +# +add_group("twobytemem", + gen_suffix=False, + suffixes=["w", "l", "q", "s"], + modifiers=["SpAdd", "Op0Add", "Op1Add"], + opcode=[0x00, 0x00], + spare=0, + operands=[Operand(type="Mem", dest="EA")]) + +# +# mov +# + +# Absolute forms for non-64-bit mode +for sfx, sz in zip("bwl", [8, 16, 32]): + add_group("mov", + suffix=sfx, + not64=True, + opersize=sz, + opcode=[0xA0+(sz!=8)], + operands=[Operand(type="Areg", size=sz, dest=None), + Operand(type="MemOffs", size=sz, relaxed=True, dest="EA")]) + +for sfx, sz in zip("bwl", [8, 16, 32]): + add_group("mov", + suffix=sfx, + not64=True, + opersize=sz, + opcode=[0xA2+(sz!=8)], + operands=[Operand(type="MemOffs", size=sz, relaxed=True, dest="EA"), + Operand(type="Areg", size=sz, dest=None)]) + +# 64-bit absolute forms for 64-bit mode. Disabled for GAS, see movabs +for sz in (8, 16, 32, 64): + add_group("mov", + opersize=sz, + opcode=[0xA0+(sz!=8)], + only64=True, + operands=[Operand(type="Areg", size=sz, dest=None), + Operand(type="MemOffs", size=sz, relaxed=True, dest="EA64")]) + +for sz in (8, 16, 32, 64): + add_group("mov", + only64=True, + opersize=sz, + opcode=[0xA2+(sz!=8)], + operands=[Operand(type="MemOffs", size=sz, relaxed=True, dest="EA64"), + Operand(type="Areg", size=sz, dest=None)]) + +# General 32-bit forms using Areg / short absolute option +for sfx, sz in zip("bwlq", [8, 16, 32, 64]): + add_group("mov", + suffix=sfx, + opersize=sz, + opcode1=[0x88+(sz!=8)], + opcode2=[0xA2+(sz!=8)], + operands=[ + Operand(type="RM", size=sz, relaxed=True, dest="EA", opt="ShortMov"), + Operand(type="Areg", size=sz, dest="Spare")]) + +# General 32-bit forms +for sfx, sz in zip("bwlq", [8, 16, 32, 64]): + add_group("mov", + suffix=sfx, + opersize=sz, + opcode=[0x88+(sz!=8)], + operands=[Operand(type="RM", size=sz, relaxed=True, dest="EA"), + Operand(type="Reg", size=sz, dest="Spare")]) + +# General 32-bit forms using Areg / short absolute option +for sfx, sz in zip("bwlq", [8, 16, 32, 64]): + add_group("mov", + suffix=sfx, + opersize=sz, + opcode1=[0x8A+(sz!=8)], + opcode2=[0xA0+(sz!=8)], + operands=[Operand(type="Areg", size=sz, dest="Spare"), + Operand(type="RM", size=sz, relaxed=True, dest="EA", + opt="ShortMov")]) + +# General 32-bit forms +for sfx, sz in zip("bwlq", [8, 16, 32, 64]): + add_group("mov", + suffix=sfx, + opersize=sz, + opcode=[0x8A+(sz!=8)], + operands=[Operand(type="Reg", size=sz, dest="Spare"), + Operand(type="RM", size=sz, relaxed=True, dest="EA")]) + +# Segment register forms +add_group("mov", + suffix="w", + opcode=[0x8C], + operands=[Operand(type="Mem", size=16, relaxed=True, dest="EA"), + Operand(type="SegReg", size=16, relaxed=True, dest="Spare")]) +for sfx, sz in zip("wlq", [16, 32, 64]): + add_group("mov", + suffix=sfx, + opersize=sz, + opcode=[0x8C], + operands=[ + Operand(type="Reg", size=sz, dest="EA"), + Operand(type="SegReg", size=16, relaxed=True, dest="Spare")]) +add_group("mov", + suffix="w", + opcode=[0x8E], + operands=[Operand(type="SegReg", size=16, relaxed=True, dest="Spare"), + Operand(type="RM", size=16, relaxed=True, dest="EA")]) +for sfx, sz in zip("lq", [32, 64]): + add_group("mov", + suffix=sfx, + opcode=[0x8E], + operands=[ + Operand(type="SegReg", size=16, relaxed=True, dest="Spare"), + Operand(type="Reg", size=sz, dest="EA")]) + +# Immediate forms +add_group("mov", + suffix="b", + opcode=[0xB0], + operands=[Operand(type="Reg", size=8, dest="Op0Add"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +for sfx, sz in zip("wl", [16, 32]): + add_group("mov", + suffix=sfx, + opersize=sz, + opcode=[0xB8], + operands=[Operand(type="Reg", size=sz, dest="Op0Add"), + Operand(type="Imm", size=sz, relaxed=True, dest="Imm")]) +# 64-bit forced size form +add_group("mov", + parsers=["nasm"], + opersize=64, + opcode=[0xB8], + operands=[Operand(type="Reg", size=64, dest="Op0Add"), + Operand(type="Imm", size=64, dest="Imm")]) +add_group("mov", + suffix="q", + opersize=64, + opcode1=[0xB8], + opcode2=[0xC7], + operands=[Operand(type="Reg", size=64, dest="Op0Add"), + Operand(type="Imm", size=64, relaxed=True, dest="Imm", + opt="SImm32Avail")]) +# Need two sets here, one for strictness on left side, one for right. +for sfx, sz, immsz in zip("bwlq", [8, 16, 32, 64], [8, 16, 32, 32]): + add_group("mov", + suffix=sfx, + opersize=sz, + opcode=[0xC6+(sz!=8)], + operands=[Operand(type="RM", size=sz, relaxed=True, dest="EA"), + Operand(type="Imm", size=immsz, dest="Imm")]) +for sfx, sz, immsz in zip("bwlq", [8, 16, 32, 64], [8, 16, 32, 32]): + add_group("mov", + suffix=sfx, + opersize=sz, + opcode=[0xC6+(sz!=8)], + operands=[Operand(type="RM", size=sz, dest="EA"), + Operand(type="Imm", size=immsz, relaxed=True, dest="Imm")]) + +# CR forms +add_group("mov", + suffix="l", + not64=True, + cpu=["Priv"], + opcode=[0x0F, 0x22], + operands=[Operand(type="CR4", size=32, dest="Spare"), + Operand(type="Reg", size=32, dest="EA")]) +add_group("mov", + suffix="l", + not64=True, + cpu=["Priv"], + opcode=[0x0F, 0x22], + operands=[Operand(type="CRReg", size=32, dest="Spare"), + Operand(type="Reg", size=32, dest="EA")]) +add_group("mov", + suffix="q", + cpu=["Priv"], + opcode=[0x0F, 0x22], + operands=[Operand(type="CRReg", size=32, dest="Spare"), + Operand(type="Reg", size=64, dest="EA")]) +add_group("mov", + suffix="l", + not64=True, + cpu=["Priv"], + opcode=[0x0F, 0x20], + operands=[Operand(type="Reg", size=32, dest="EA"), + Operand(type="CR4", size=32, dest="Spare")]) +add_group("mov", + suffix="l", + cpu=["Priv"], + not64=True, + opcode=[0x0F, 0x20], + operands=[Operand(type="Reg", size=32, dest="EA"), + Operand(type="CRReg", size=32, dest="Spare")]) +add_group("mov", + suffix="q", + cpu=["Priv"], + opcode=[0x0F, 0x20], + operands=[Operand(type="Reg", size=64, dest="EA"), + Operand(type="CRReg", size=32, dest="Spare")]) + +# DR forms +add_group("mov", + suffix="l", + not64=True, + cpu=["Priv"], + opcode=[0x0F, 0x23], + operands=[Operand(type="DRReg", size=32, dest="Spare"), + Operand(type="Reg", size=32, dest="EA")]) +add_group("mov", + suffix="q", + cpu=["Priv"], + opcode=[0x0F, 0x23], + operands=[Operand(type="DRReg", size=32, dest="Spare"), + Operand(type="Reg", size=64, dest="EA")]) +add_group("mov", + suffix="l", + not64=True, + cpu=["Priv"], + opcode=[0x0F, 0x21], + operands=[Operand(type="Reg", size=32, dest="EA"), + Operand(type="DRReg", size=32, dest="Spare")]) +add_group("mov", + suffix="q", + cpu=["Priv"], + opcode=[0x0F, 0x21], + operands=[Operand(type="Reg", size=64, dest="EA"), + Operand(type="DRReg", size=32, dest="Spare")]) + +# MMX forms for GAS parser (copied from movq) +add_group("mov", + suffix="q", + cpu=["MMX"], + parsers=["gas"], + opcode=[0x0F, 0x6F], + operands=[Operand(type="SIMDReg", size=64, dest="Spare"), + Operand(type="SIMDRM", size=64, relaxed=True, dest="EA")]) +add_group("mov", + suffix="q", + cpu=["MMX"], + parsers=["gas"], + opersize=64, + opcode=[0x0F, 0x6E], + operands=[Operand(type="SIMDReg", size=64, dest="Spare"), + Operand(type="RM", size=64, relaxed=True, dest="EA")]) +add_group("mov", + suffix="q", + cpu=["MMX"], + parsers=["gas"], + opcode=[0x0F, 0x7F], + operands=[Operand(type="SIMDRM", size=64, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=64, dest="Spare")]) +add_group("mov", + suffix="q", + cpu=["MMX"], + parsers=["gas"], + opersize=64, + opcode=[0x0F, 0x7E], + operands=[Operand(type="RM", size=64, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=64, dest="Spare")]) + +# SSE2 forms for GAS parser (copied from movq) +add_group("mov", + suffix="q", + cpu=["SSE2"], + parsers=["gas"], + prefix=0xF3, + opcode=[0x0F, 0x7E], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA")]) +add_group("mov", + suffix="q", + cpu=["SSE2"], + parsers=["gas"], + prefix=0xF3, + opcode=[0x0F, 0x7E], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=64, relaxed=True, dest="EA")]) +add_group("mov", + suffix="q", + cpu=["SSE2"], + parsers=["gas"], + opersize=64, + prefix=0x66, + opcode=[0x0F, 0x6E], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="RM", size=64, relaxed=True, dest="EA")]) +add_group("mov", + suffix="q", + cpu=["SSE2"], + parsers=["gas"], + prefix=0x66, + opcode=[0x0F, 0xD6], + operands=[Operand(type="SIMDRM", size=64, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="Spare")]) +add_group("mov", + suffix="q", + cpu=["SSE2"], + parsers=["gas"], + opersize=64, + prefix=0x66, + opcode=[0x0F, 0x7E], + operands=[Operand(type="RM", size=64, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="Spare")]) + +add_insn("mov", "mov") + +# +# 64-bit absolute move (for GAS). +# These are disabled for GAS for normal mov above. +# +add_group("movabs", + suffix="b", + only64=True, + opcode=[0xA0], + operands=[Operand(type="Areg", size=8, dest=None), + Operand(type="MemOffs", size=8, relaxed=True, dest="EA64")]) +for sfx, sz in zip("wlq", [16, 32, 64]): + add_group("movabs", + only64=True, + suffix=sfx, + opersize=sz, + opcode=[0xA1], + operands=[Operand(type="Areg", size=sz, dest=None), + Operand(type="MemOffs", size=sz, relaxed=True, + dest="EA64")]) + +add_group("movabs", + suffix="b", + only64=True, + opcode=[0xA2], + operands=[Operand(type="MemOffs", size=8, relaxed=True, dest="EA64"), + Operand(type="Areg", size=8, dest=None)]) +for sfx, sz in zip("wlq", [16, 32, 64]): + add_group("movabs", + suffix=sfx, + only64=True, + opersize=sz, + opcode=[0xA3], + operands=[Operand(type="MemOffs", size=sz, relaxed=True, + dest="EA64"), + Operand(type="Areg", size=sz, dest=None)]) + +# 64-bit immediate form +add_group("movabs", + suffix="q", + opersize=64, + opcode=[0xB8], + operands=[Operand(type="Reg", size=64, dest="Op0Add"), + Operand(type="Imm", size=64, relaxed=True, dest="Imm")]) + +add_insn("movabs", "movabs", parser="gas") + +# +# Move with sign/zero extend +# +add_group("movszx", + suffix="b", + cpu=["386"], + modifiers=["Op1Add"], + opersize=16, + opcode=[0x0F, 0x00], + operands=[Operand(type="Reg", size=16, dest="Spare"), + Operand(type="RM", size=8, relaxed=True, dest="EA")]) +add_group("movszx", + suffix="b", + cpu=["386"], + modifiers=["Op1Add"], + opersize=32, + opcode=[0x0F, 0x00], + operands=[Operand(type="Reg", size=32, dest="Spare"), + Operand(type="RM", size=8, dest="EA")]) +add_group("movszx", + suffix="b", + modifiers=["Op1Add"], + opersize=64, + opcode=[0x0F, 0x00], + operands=[Operand(type="Reg", size=64, dest="Spare"), + Operand(type="RM", size=8, dest="EA")]) +add_group("movszx", + suffix="w", + cpu=["386"], + modifiers=["Op1Add"], + opersize=32, + opcode=[0x0F, 0x01], + operands=[Operand(type="Reg", size=32, dest="Spare"), + Operand(type="RM", size=16, dest="EA")]) +add_group("movszx", + suffix="w", + modifiers=["Op1Add"], + opersize=64, + opcode=[0x0F, 0x01], + operands=[Operand(type="Reg", size=64, dest="Spare"), + Operand(type="RM", size=16, dest="EA")]) + +add_insn("movsbw", "movszx", suffix="b", modifiers=[0xBE]) +add_insn("movsbl", "movszx", suffix="b", modifiers=[0xBE]) +add_insn("movswl", "movszx", suffix="w", modifiers=[0xBE]) +add_insn("movsbq", "movszx", suffix="b", modifiers=[0xBE], only64=True) +add_insn("movswq", "movszx", suffix="w", modifiers=[0xBE], only64=True) +add_insn("movsx", "movszx", modifiers=[0xBE]) +add_insn("movzbw", "movszx", suffix="b", modifiers=[0xB6]) +add_insn("movzbl", "movszx", suffix="b", modifiers=[0xB6]) +add_insn("movzwl", "movszx", suffix="w", modifiers=[0xB6]) +add_insn("movzbq", "movszx", suffix="b", modifiers=[0xB6], only64=True) +add_insn("movzwq", "movszx", suffix="w", modifiers=[0xB6], only64=True) +add_insn("movzx", "movszx", modifiers=[0xB6]) + +# +# Move with sign-extend doubleword (64-bit mode only) +# +add_group("movsxd", + suffix="l", + opersize=64, + opcode=[0x63], + operands=[Operand(type="Reg", size=64, dest="Spare"), + Operand(type="RM", size=32, dest="EA")]) + +add_insn("movslq", "movsxd", suffix="l") +add_insn("movsxd", "movsxd", parser="nasm") + +# +# Push instructions +# +add_group("push", + suffix="w", + opersize=16, + def_opersize_64=64, + opcode=[0x50], + operands=[Operand(type="Reg", size=16, dest="Op0Add")]) +add_group("push", + suffix="l", + not64=True, + opersize=32, + opcode=[0x50], + operands=[Operand(type="Reg", size=32, dest="Op0Add")]) +add_group("push", + suffix="q", + def_opersize_64=64, + opcode=[0x50], + operands=[Operand(type="Reg", size=64, dest="Op0Add")]) +add_group("push", + suffix="w", + opersize=16, + def_opersize_64=64, + opcode=[0xFF], + spare=6, + operands=[Operand(type="RM", size=16, dest="EA")]) +add_group("push", + suffix="l", + not64=True, + opersize=32, + opcode=[0xFF], + spare=6, + operands=[Operand(type="RM", size=32, dest="EA")]) +add_group("push", + suffix="q", + def_opersize_64=64, + opcode=[0xFF], + spare=6, + operands=[Operand(type="RM", size=64, dest="EA")]) +add_group("push", + cpu=["186"], + parsers=["nasm"], + def_opersize_64=64, + opcode=[0x6A], + operands=[Operand(type="Imm", size=8, dest="SImm")]) +add_group("push", + cpu=["186"], + parsers=["gas"], + def_opersize_64=64, + opcode=[0x6A], + operands=[Operand(type="Imm", size=8, relaxed=True, dest="SImm")]) +add_group("push", + suffix="w", + cpu=["186"], + parsers=["gas"], + opersize=16, + def_opersize_64=64, + opcode1=[0x6A], + opcode2=[0x68], + operands=[Operand(type="Imm", size=16, relaxed=True, dest="Imm", + opt="SImm8")]) +add_group("push", + suffix="l", + not64=True, + parsers=["gas"], + opersize=32, + opcode1=[0x6A], + opcode2=[0x68], + operands=[Operand(type="Imm", size=32, relaxed=True, dest="Imm", + opt="SImm8")]) +add_group("push", + suffix="q", + only64=True, + opersize=64, + def_opersize_64=64, + opcode1=[0x6A], + opcode2=[0x68], + operands=[Operand(type="Imm", size=32, relaxed=True, dest="SImm", + opt="SImm8")]) +add_group("push", + not64=True, + cpu=["186"], + parsers=["nasm"], + opcode1=[0x6A], + opcode2=[0x68], + operands=[Operand(type="Imm", size="BITS", relaxed=True, dest="Imm", + opt="SImm8")]) +# Need these when we don't match the BITS size, but they need to be +# below the above line so the optimizer can kick in by default. +add_group("push", + cpu=["186"], + parsers=["nasm"], + opersize=16, + def_opersize_64=64, + opcode=[0x68], + operands=[Operand(type="Imm", size=16, dest="Imm")]) +add_group("push", + not64=True, + parsers=["nasm"], + opersize=32, + opcode=[0x68], + operands=[Operand(type="Imm", size=32, dest="Imm")]) +add_group("push", + only64=True, + parsers=["nasm"], + opersize=64, + def_opersize_64=64, + opcode=[0x68], + operands=[Operand(type="Imm", size=32, dest="SImm")]) +add_group("push", + not64=True, + opcode=[0x0E], + operands=[Operand(type="CS", dest=None)]) +add_group("push", + suffix="w", + not64=True, + opersize=16, + opcode=[0x0E], + operands=[Operand(type="CS", size=16, dest=None)]) +add_group("push", + suffix="l", + not64=True, + opersize=32, + opcode=[0x0E], + operands=[Operand(type="CS", size=32, dest=None)]) +add_group("push", + not64=True, + opcode=[0x16], + operands=[Operand(type="SS", dest=None)]) +add_group("push", + suffix="w", + not64=True, + opersize=16, + opcode=[0x16], + operands=[Operand(type="SS", size=16, dest=None)]) +add_group("push", + suffix="l", + not64=True, + opersize=32, + opcode=[0x16], + operands=[Operand(type="SS", size=32, dest=None)]) +add_group("push", + not64=True, + opcode=[0x1E], + operands=[Operand(type="DS", dest=None)]) +add_group("push", + suffix="w", + not64=True, + opersize=16, + opcode=[0x1E], + operands=[Operand(type="DS", size=16, dest=None)]) +add_group("push", + suffix="l", + not64=True, + opersize=32, + opcode=[0x1E], + operands=[Operand(type="DS", size=32, dest=None)]) +add_group("push", + not64=True, + opcode=[0x06], + operands=[Operand(type="ES", dest=None)]) +add_group("push", + suffix="w", + not64=True, + opersize=16, + opcode=[0x06], + operands=[Operand(type="ES", size=16, dest=None)]) +add_group("push", + suffix="l", + not64=True, + opersize=32, + opcode=[0x06], + operands=[Operand(type="ES", size=32, dest=None)]) +add_group("push", + opcode=[0x0F, 0xA0], + operands=[Operand(type="FS", dest=None)]) +add_group("push", + suffix="w", + opersize=16, + opcode=[0x0F, 0xA0], + operands=[Operand(type="FS", size=16, dest=None)]) +add_group("push", + suffix="l", + opersize=32, + opcode=[0x0F, 0xA0], + operands=[Operand(type="FS", size=32, dest=None)]) +add_group("push", + opcode=[0x0F, 0xA8], + operands=[Operand(type="GS", dest=None)]) +add_group("push", + suffix="w", + opersize=16, + opcode=[0x0F, 0xA8], + operands=[Operand(type="GS", size=16, dest=None)]) +add_group("push", + suffix="l", + opersize=32, + opcode=[0x0F, 0xA8], + operands=[Operand(type="GS", size=32, dest=None)]) + +add_insn("push", "push") +add_insn("pusha", "onebyte", modifiers=[0x60, 0], cpu=["186"], not64=True) +add_insn("pushad", "onebyte", parser="nasm", modifiers=[0x60, 32], + cpu=["386"], not64=True) +add_insn("pushal", "onebyte", parser="gas", modifiers=[0x60, 32], + cpu=["386"], not64=True) +add_insn("pushaw", "onebyte", modifiers=[0x60, 16], cpu=["186"], not64=True) + +# +# Pop instructions +# +add_group("pop", + suffix="w", + opersize=16, + def_opersize_64=64, + opcode=[0x58], + operands=[Operand(type="Reg", size=16, dest="Op0Add")]) +add_group("pop", + suffix="l", + not64=True, + opersize=32, + opcode=[0x58], + operands=[Operand(type="Reg", size=32, dest="Op0Add")]) +add_group("pop", + suffix="q", + def_opersize_64=64, + opcode=[0x58], + operands=[Operand(type="Reg", size=64, dest="Op0Add")]) +add_group("pop", + suffix="w", + opersize=16, + def_opersize_64=64, + opcode=[0x8F], + operands=[Operand(type="RM", size=16, dest="EA")]) +add_group("pop", + suffix="l", + not64=True, + opersize=32, + opcode=[0x8F], + operands=[Operand(type="RM", size=32, dest="EA")]) +add_group("pop", + suffix="q", + def_opersize_64=64, + opcode=[0x8F], + operands=[Operand(type="RM", size=64, dest="EA")]) +# POP CS is debateably valid on the 8086, if obsolete and undocumented. +# We don't include it because it's VERY unlikely it will ever be used +# anywhere. If someone really wants it they can db 0x0F it. +#add_group("pop", +# cpu=["Undoc", "Obs"], +# opcode=[0x0F], +# operands=[Operand(type="CS", dest=None)]) +add_group("pop", + not64=True, + opcode=[0x17], + operands=[Operand(type="SS", dest=None)]) +add_group("pop", + not64=True, + opersize=16, + opcode=[0x17], + operands=[Operand(type="SS", size=16, dest=None)]) +add_group("pop", + not64=True, + opersize=32, + opcode=[0x17], + operands=[Operand(type="SS", size=32, dest=None)]) +add_group("pop", + not64=True, + opcode=[0x1F], + operands=[Operand(type="DS", dest=None)]) +add_group("pop", + not64=True, + opersize=16, + opcode=[0x1F], + operands=[Operand(type="DS", size=16, dest=None)]) +add_group("pop", + not64=True, + opersize=32, + opcode=[0x1F], + operands=[Operand(type="DS", size=32, dest=None)]) +add_group("pop", + not64=True, + opcode=[0x07], + operands=[Operand(type="ES", dest=None)]) +add_group("pop", + not64=True, + opersize=16, + opcode=[0x07], + operands=[Operand(type="ES", size=16, dest=None)]) +add_group("pop", + not64=True, + opersize=32, + opcode=[0x07], + operands=[Operand(type="ES", size=32, dest=None)]) +add_group("pop", + opcode=[0x0F, 0xA1], + operands=[Operand(type="FS", dest=None)]) +add_group("pop", + opersize=16, + opcode=[0x0F, 0xA1], + operands=[Operand(type="FS", size=16, dest=None)]) +add_group("pop", + opersize=32, + opcode=[0x0F, 0xA1], + operands=[Operand(type="FS", size=32, dest=None)]) +add_group("pop", + opcode=[0x0F, 0xA9], + operands=[Operand(type="GS", dest=None)]) +add_group("pop", + opersize=16, + opcode=[0x0F, 0xA9], + operands=[Operand(type="GS", size=16, dest=None)]) +add_group("pop", + opersize=32, + opcode=[0x0F, 0xA9], + operands=[Operand(type="GS", size=32, dest=None)]) + +add_insn("pop", "pop") +add_insn("popa", "onebyte", modifiers=[0x61, 0], cpu=["186"], not64=True) +add_insn("popad", "onebyte", parser="nasm", modifiers=[0x61, 32], + cpu=["386"], not64=True) +add_insn("popal", "onebyte", parser="gas", modifiers=[0x61, 32], + cpu=["386"], not64=True) +add_insn("popaw", "onebyte", modifiers=[0x61, 16], cpu=["186"], not64=True) + +# +# Exchange instructions +# +add_group("xchg", + suffix="b", + opcode=[0x86], + operands=[Operand(type="RM", size=8, relaxed=True, dest="EA"), + Operand(type="Reg", size=8, dest="Spare")]) +add_group("xchg", + suffix="b", + opcode=[0x86], + operands=[Operand(type="Reg", size=8, dest="Spare"), + Operand(type="RM", size=8, relaxed=True, dest="EA")]) +# We could be extra-efficient in the 64-bit mode case here. +# XCHG AX, AX in 64-bit mode is a NOP, as it doesn't clear the +# high 48 bits of RAX. Thus we don't need the operand-size prefix. +# But this feels too clever, and probably not what the user really +# expects in the generated code, so we don't do it. +#add_group("xchg", +# suffix="w", +# only64=True, +# opcode=[0x90], +# operands=[Operand(type="Areg", size=16, dest=None), +# Operand(type="AReg", size=16, dest="Op0Add")]) +add_group("xchg", + suffix="w", + opersize=16, + opcode=[0x90], + operands=[Operand(type="Areg", size=16, dest=None), + Operand(type="Reg", size=16, dest="Op0Add")]) +add_group("xchg", + suffix="w", + opersize=16, + opcode=[0x90], + operands=[Operand(type="Reg", size=16, dest="Op0Add"), + Operand(type="Areg", size=16, dest=None)]) +add_group("xchg", + suffix="w", + opersize=16, + opcode=[0x87], + operands=[Operand(type="RM", size=16, relaxed=True, dest="EA"), + Operand(type="Reg", size=16, dest="Spare")]) +add_group("xchg", + suffix="w", + opersize=16, + opcode=[0x87], + operands=[Operand(type="Reg", size=16, dest="Spare"), + Operand(type="RM", size=16, relaxed=True, dest="EA")]) +# Be careful with XCHG EAX, EAX in 64-bit mode. This needs to use +# the long form rather than the NOP form, as the long form clears +# the high 32 bits of RAX. This makes all 32-bit forms in 64-bit +# mode have consistent operation. +# +# FIXME: due to a hard-to-fix bug in how we handle generating gas suffix CPU +# rules, this causes xchgl to be CPU_Any instead of CPU_386. A hacky patch +# could fix it, but it's doubtful anyone will ever notice, so leave it. +add_group("xchg", + suffix="l", + only64=True, + opersize=32, + opcode=[0x87], + operands=[Operand(type="Areg", size=32, dest="EA"), + Operand(type="Areg", size=32, dest="Spare")]) +add_group("xchg", + suffix="l", + opersize=32, + opcode=[0x90], + operands=[Operand(type="Areg", size=32, dest=None), + Operand(type="Reg", size=32, dest="Op0Add")]) +add_group("xchg", + suffix="l", + opersize=32, + opcode=[0x90], + operands=[Operand(type="Reg", size=32, dest="Op0Add"), + Operand(type="Areg", size=32, dest=None)]) +add_group("xchg", + suffix="l", + opersize=32, + opcode=[0x87], + operands=[Operand(type="RM", size=32, relaxed=True, dest="EA"), + Operand(type="Reg", size=32, dest="Spare")]) +add_group("xchg", + suffix="l", + opersize=32, + opcode=[0x87], + operands=[Operand(type="Reg", size=32, dest="Spare"), + Operand(type="RM", size=32, relaxed=True, dest="EA")]) +# Be efficient with XCHG RAX, RAX. +# This is a NOP and thus doesn't need the REX prefix. +add_group("xchg", + suffix="q", + only64=True, + opcode=[0x90], + operands=[Operand(type="Areg", size=64, dest=None), + Operand(type="Areg", size=64, dest="Op0Add")]) +add_group("xchg", + suffix="q", + opersize=64, + opcode=[0x90], + operands=[Operand(type="Areg", size=64, dest=None), + Operand(type="Reg", size=64, dest="Op0Add")]) +add_group("xchg", + suffix="q", + opersize=64, + opcode=[0x90], + operands=[Operand(type="Reg", size=64, dest="Op0Add"), + Operand(type="Areg", size=64, dest=None)]) +add_group("xchg", + suffix="q", + opersize=64, + opcode=[0x87], + operands=[Operand(type="RM", size=64, relaxed=True, dest="EA"), + Operand(type="Reg", size=64, dest="Spare")]) +add_group("xchg", + suffix="q", + opersize=64, + opcode=[0x87], + operands=[Operand(type="Reg", size=64, dest="Spare"), + Operand(type="RM", size=64, relaxed=True, dest="EA")]) + +add_insn("xchg", "xchg") + +##################################################################### +# In/out from ports +##################################################################### +add_group("in", + suffix="b", + opcode=[0xE4], + operands=[Operand(type="Areg", size=8, dest=None), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +for sfx, sz in zip("wl", [16, 32]): + add_group("in", + suffix=sfx, + opersize=sz, + opcode=[0xE5], + operands=[Operand(type="Areg", size=sz, dest=None), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("in", + suffix="b", + opcode=[0xEC], + operands=[Operand(type="Areg", size=8, dest=None), + Operand(type="Dreg", size=16, dest=None)]) +for sfx, sz in zip("wl", [16, 32]): + add_group("in", + suffix=sfx, + opersize=sz, + opcode=[0xED], + operands=[Operand(type="Areg", size=sz, dest=None), + Operand(type="Dreg", size=16, dest=None)]) +# GAS-only variants (implicit accumulator register) +add_group("in", + suffix="b", + parsers=["gas"], + opcode=[0xE4], + operands=[Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +for sfx, sz in zip("wl", [16, 32]): + add_group("in", + suffix=sfx, + parsers=["gas"], + opersize=sz, + opcode=[0xE5], + operands=[Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("in", + suffix="b", + parsers=["gas"], + opcode=[0xEC], + operands=[Operand(type="Dreg", size=16, dest=None)]) +add_group("in", + suffix="w", + parsers=["gas"], + opersize=16, + opcode=[0xED], + operands=[Operand(type="Dreg", size=16, dest=None)]) +add_group("in", + suffix="l", + cpu=["386"], + parsers=["gas"], + opersize=32, + opcode=[0xED], + operands=[Operand(type="Dreg", size=16, dest=None)]) + +add_insn("in", "in") + +add_group("out", + suffix="b", + opcode=[0xE6], + operands=[Operand(type="Imm", size=8, relaxed=True, dest="Imm"), + Operand(type="Areg", size=8, dest=None)]) +for sfx, sz in zip("wl", [16, 32]): + add_group("out", + suffix=sfx, + opersize=sz, + opcode=[0xE7], + operands=[Operand(type="Imm", size=8, relaxed=True, dest="Imm"), + Operand(type="Areg", size=sz, dest=None)]) +add_group("out", + suffix="b", + opcode=[0xEE], + operands=[Operand(type="Dreg", size=16, dest=None), + Operand(type="Areg", size=8, dest=None)]) +for sfx, sz in zip("wl", [16, 32]): + add_group("out", + suffix=sfx, + opersize=sz, + opcode=[0xEF], + operands=[Operand(type="Dreg", size=16, dest=None), + Operand(type="Areg", size=sz, dest=None)]) +# GAS-only variants (implicit accumulator register) +add_group("out", + suffix="b", + parsers=["gas"], + opcode=[0xE6], + operands=[Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("out", + suffix="w", + parsers=["gas"], + opersize=16, + opcode=[0xE7], + operands=[Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("out", + suffix="l", + cpu=["386"], + parsers=["gas"], + opersize=32, + opcode=[0xE7], + operands=[Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("out", + suffix="b", + parsers=["gas"], + opcode=[0xEE], + operands=[Operand(type="Dreg", size=16, dest=None)]) +add_group("out", + suffix="w", + parsers=["gas"], + opersize=16, + opcode=[0xEF], + operands=[Operand(type="Dreg", size=16, dest=None)]) +add_group("out", + suffix="l", + cpu=["386"], + parsers=["gas"], + opersize=32, + opcode=[0xEF], + operands=[Operand(type="Dreg", size=16, dest=None)]) + +add_insn("out", "out") + +# +# Load effective address +# +for sfx, sz in zip("wlq", [16, 32, 64]): + add_group("lea", + suffix=sfx, + opersize=sz, + opcode=[0x8D], + operands=[Operand(type="Reg", size=sz, dest="Spare"), + Operand(type="Mem", size=sz, relaxed=True, dest="EA")]) + +add_insn("lea", "lea") + +# +# Load segment registers from memory +# +for sfx, sz in zip("wl", [16, 32]): + add_group("ldes", + suffix=sfx, + not64=True, + modifiers=["Op0Add"], + opersize=sz, + opcode=[0x00], + operands=[Operand(type="Reg", size=sz, dest="Spare"), + Operand(type="Mem", dest="EA")]) + +add_insn("lds", "ldes", modifiers=[0xC5]) +add_insn("les", "ldes", modifiers=[0xC4]) + +for sfx, sz in zip("wl", [16, 32]): + add_group("lfgss", + suffix=sfx, + cpu=["386"], + modifiers=["Op1Add"], + opersize=sz, + opcode=[0x0F, 0x00], + operands=[Operand(type="Reg", size=sz, dest="Spare"), + Operand(type="Mem", dest="EA")]) + +add_insn("lfs", "lfgss", modifiers=[0xB4]) +add_insn("lgs", "lfgss", modifiers=[0xB5]) +add_insn("lss", "lfgss", modifiers=[0xB2]) + +# +# Flags registers instructions +# +add_insn("clc", "onebyte", modifiers=[0xF8]) +add_insn("cld", "onebyte", modifiers=[0xFC]) +add_insn("cli", "onebyte", modifiers=[0xFA]) +add_insn("clts", "twobyte", modifiers=[0x0F, 0x06], cpu=["286", "Priv"]) +add_insn("cmc", "onebyte", modifiers=[0xF5]) +add_insn("lahf", "onebyte", modifiers=[0x9F]) +add_insn("sahf", "onebyte", modifiers=[0x9E]) +add_insn("pushf", "onebyte", modifiers=[0x9C, 0, 64]) +add_insn("pushfd", "onebyte", parser="nasm", modifiers=[0x9C, 32], + cpu=["386"], not64=True) +add_insn("pushfl", "onebyte", parser="gas", modifiers=[0x9C, 32], + cpu=["386"], not64=True) +add_insn("pushfw", "onebyte", modifiers=[0x9C, 16, 64]) +add_insn("pushfq", "onebyte", modifiers=[0x9C, 64, 64], only64=True) +add_insn("popf", "onebyte", modifiers=[0x9D, 0, 64]) +add_insn("popfd", "onebyte", parser="nasm", modifiers=[0x9D, 32], + cpu=["386"], not64=True) +add_insn("popfl", "onebyte", parser="gas", modifiers=[0x9D, 32], + cpu=["386"], not64=True) +add_insn("popfw", "onebyte", modifiers=[0x9D, 16, 64]) +add_insn("popfq", "onebyte", modifiers=[0x9D, 64, 64], only64=True) +add_insn("stc", "onebyte", modifiers=[0xF9]) +add_insn("std", "onebyte", modifiers=[0xFD]) +add_insn("sti", "onebyte", modifiers=[0xFB]) + +# +# Arithmetic - general +# +add_group("arith", + suffix="b", + modifiers=["Op0Add"], + opcode=[0x04], + operands=[Operand(type="Areg", size=8, dest=None), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +for sfx, sz, immsz in zip("wlq", [16, 32, 64], [16, 32, 32]): + add_group("arith", + suffix=sfx, + modifiers=["Op2Add", "Op1AddSp"], + opersize=sz, + opcode1=[0x83, 0xC0], + opcode2=[0x05], + operands=[Operand(type="Areg", size=sz, dest=None), + Operand(type="Imm", size=immsz, relaxed=True, dest="Imm", + opt="SImm8")]) + +add_group("arith", + suffix="b", + modifiers=["Gap", "SpAdd"], + opcode=[0x80], + spare=0, + operands=[Operand(type="RM", size=8, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("arith", + suffix="b", + modifiers=["Gap", "SpAdd"], + opcode=[0x80], + spare=0, + operands=[Operand(type="RM", size=8, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, dest="Imm")]) + +add_group("arith", + suffix="w", + modifiers=["Gap", "SpAdd"], + opersize=16, + opcode=[0x83], + spare=0, + operands=[Operand(type="RM", size=16, dest="EA"), + Operand(type="Imm", size=8, dest="SImm")]) +add_group("arith", + parsers=["nasm"], + modifiers=["Gap", "SpAdd"], + opersize=16, + opcode1=[0x83], + opcode2=[0x81], + spare=0, + operands=[Operand(type="RM", size=16, relaxed=True, dest="EA"), + Operand(type="Imm", size=16, dest="Imm", opt="SImm8")]) +add_group("arith", + suffix="w", + modifiers=["Gap", "SpAdd"], + opersize=16, + opcode1=[0x83], + opcode2=[0x81], + spare=0, + operands=[ + Operand(type="RM", size=16, dest="EA"), + Operand(type="Imm", size=16, relaxed=True, dest="Imm", opt="SImm8")]) + +add_group("arith", + suffix="l", + modifiers=["Gap", "SpAdd"], + opersize=32, + opcode=[0x83], + spare=0, + operands=[Operand(type="RM", size=32, dest="EA"), + Operand(type="Imm", size=8, dest="SImm")]) +# Not64 because we can't tell if add [], dword in 64-bit mode is supposed +# to be a qword destination or a dword destination. +add_group("arith", + not64=True, + parsers=["nasm"], + modifiers=["Gap", "SpAdd"], + opersize=32, + opcode1=[0x83], + opcode2=[0x81], + spare=0, + operands=[Operand(type="RM", size=32, relaxed=True, dest="EA"), + Operand(type="Imm", size=32, dest="Imm", opt="SImm8")]) +add_group("arith", + suffix="l", + modifiers=["Gap", "SpAdd"], + opersize=32, + opcode1=[0x83], + opcode2=[0x81], + spare=0, + operands=[ + Operand(type="RM", size=32, dest="EA"), + Operand(type="Imm", size=32, relaxed=True, dest="Imm", opt="SImm8")]) + +# No relaxed-RM mode for 64-bit destinations; see above Not64 comment. +add_group("arith", + suffix="q", + modifiers=["Gap", "SpAdd"], + opersize=64, + opcode=[0x83], + spare=0, + operands=[Operand(type="RM", size=64, dest="EA"), + Operand(type="Imm", size=8, dest="SImm")]) +add_group("arith", + suffix="q", + modifiers=["Gap", "SpAdd"], + opersize=64, + opcode1=[0x83], + opcode2=[0x81], + spare=0, + operands=[ + Operand(type="RM", size=64, dest="EA"), + Operand(type="Imm", size=32, relaxed=True, dest="Imm", opt="SImm8")]) + +for sfx, sz in zip("bwlq", [8, 16, 32, 64]): + add_group("arith", + suffix=sfx, + modifiers=["Op0Add"], + opersize=sz, + opcode=[0x00+(sz!=8)], + operands=[Operand(type="RM", size=sz, relaxed=True, dest="EA"), + Operand(type="Reg", size=sz, dest="Spare")]) +for sfx, sz in zip("bwlq", [8, 16, 32, 64]): + add_group("arith", + suffix=sfx, + modifiers=["Op0Add"], + opersize=sz, + opcode=[0x02+(sz!=8)], + operands=[Operand(type="Reg", size=sz, dest="Spare"), + Operand(type="RM", size=sz, relaxed=True, dest="EA")]) + +add_insn("add", "arith", modifiers=[0x00, 0]) +add_insn("or", "arith", modifiers=[0x08, 1]) +add_insn("adc", "arith", modifiers=[0x10, 2]) +add_insn("sbb", "arith", modifiers=[0x18, 3]) +add_insn("and", "arith", modifiers=[0x20, 4]) +add_insn("sub", "arith", modifiers=[0x28, 5]) +add_insn("xor", "arith", modifiers=[0x30, 6]) +add_insn("cmp", "arith", modifiers=[0x38, 7]) + +# +# Arithmetic - inc/dec +# +add_group("incdec", + suffix="b", + modifiers=["Gap", "SpAdd"], + opcode=[0xFE], + spare=0, + operands=[Operand(type="RM", size=8, dest="EA")]) +for sfx, sz in zip("wl", [16, 32]): + add_group("incdec", + suffix=sfx, + not64=True, + modifiers=["Op0Add"], + opersize=sz, + opcode=[0x00], + operands=[Operand(type="Reg", size=sz, dest="Op0Add")]) + add_group("incdec", + suffix=sfx, + modifiers=["Gap", "SpAdd"], + opersize=sz, + opcode=[0xFF], + spare=0, + operands=[Operand(type="RM", size=sz, dest="EA")]) +add_group("incdec", + suffix="q", + modifiers=["Gap", "SpAdd"], + opersize=64, + opcode=[0xFF], + spare=0, + operands=[Operand(type="RM", size=64, dest="EA")]) + +add_insn("inc", "incdec", modifiers=[0x40, 0]) +add_insn("dec", "incdec", modifiers=[0x48, 1]) + +# +# Arithmetic - mul/neg/not F6 opcodes +# +for sfx, sz in zip("bwlq", [8, 16, 32, 64]): + add_group("f6", + suffix=sfx, + modifiers=["SpAdd"], + opersize=sz, + opcode=[0xF6+(sz!=8)], + spare=0, + operands=[Operand(type="RM", size=sz, dest="EA")]) + +add_insn("not", "f6", modifiers=[2]) +add_insn("neg", "f6", modifiers=[3]) +add_insn("mul", "f6", modifiers=[4]) + +# +# Arithmetic - div/idiv F6 opcodes +# These allow explicit accumulator in GAS mode. +# +for sfx, sz in zip("bwlq", [8, 16, 32, 64]): + add_group("div", + suffix=sfx, + modifiers=["SpAdd"], + opersize=sz, + opcode=[0xF6+(sz!=8)], + spare=0, + operands=[Operand(type="RM", size=sz, dest="EA")]) +# Versions with explicit accumulator +for sfx, sz in zip("bwlq", [8, 16, 32, 64]): + add_group("div", + suffix=sfx, + modifiers=["SpAdd"], + opersize=sz, + opcode=[0xF6+(sz!=8)], + spare=0, + operands=[Operand(type="Areg", size=sz, dest=None), + Operand(type="RM", size=sz, dest="EA")]) + +add_insn("div", "div", modifiers=[6]) +add_insn("idiv", "div", modifiers=[7]) + +# +# Arithmetic - test instruction +# +for sfx, sz, immsz in zip("bwlq", [8, 16, 32, 64], [8, 16, 32, 32]): + add_group("test", + suffix=sfx, + opersize=sz, + opcode=[0xA8+(sz!=8)], + operands=[Operand(type="Areg", size=sz, dest=None), + Operand(type="Imm", size=immsz, relaxed=True, dest="Imm")]) + +for sfx, sz, immsz in zip("bwlq", [8, 16, 32, 64], [8, 16, 32, 32]): + add_group("test", + suffix=sfx, + opersize=sz, + opcode=[0xF6+(sz!=8)], + operands=[Operand(type="RM", size=sz, dest="EA"), + Operand(type="Imm", size=immsz, relaxed=True, dest="Imm")]) + add_group("test", + suffix=sfx, + opersize=sz, + opcode=[0xF6+(sz!=8)], + operands=[Operand(type="RM", size=sz, relaxed=True, dest="EA"), + Operand(type="Imm", size=immsz, dest="Imm")]) + +for sfx, sz in zip("bwlq", [8, 16, 32, 64]): + add_group("test", + suffix=sfx, + opersize=sz, + opcode=[0x84+(sz!=8)], + operands=[Operand(type="RM", size=sz, relaxed=True, dest="EA"), + Operand(type="Reg", size=sz, dest="Spare")]) +for sfx, sz in zip("bwlq", [8, 16, 32, 64]): + add_group("test", + suffix=sfx, + opersize=sz, + opcode=[0x84+(sz!=8)], + operands=[Operand(type="Reg", size=sz, dest="Spare"), + Operand(type="RM", size=sz, relaxed=True, dest="EA")]) + +add_insn("test", "test") + +# +# Arithmetic - aad/aam +# +add_group("aadm", + modifiers=["Op0Add"], + opcode=[0xD4, 0x0A], + operands=[]) +add_group("aadm", + modifiers=["Op0Add"], + opcode=[0xD4], + operands=[Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + +add_insn("aaa", "onebyte", modifiers=[0x37], not64=True) +add_insn("aas", "onebyte", modifiers=[0x3F], not64=True) +add_insn("daa", "onebyte", modifiers=[0x27], not64=True) +add_insn("das", "onebyte", modifiers=[0x2F], not64=True) +add_insn("aad", "aadm", modifiers=[0x01], not64=True) +add_insn("aam", "aadm", modifiers=[0x00], not64=True) + +# +# Conversion instructions +# +add_insn("cbw", "onebyte", modifiers=[0x98, 16]) +add_insn("cwde", "onebyte", modifiers=[0x98, 32], cpu=["386"]) +add_insn("cdqe", "onebyte", modifiers=[0x98, 64], only64=True) +add_insn("cwd", "onebyte", modifiers=[0x99, 16]) +add_insn("cdq", "onebyte", modifiers=[0x99, 32], cpu=["386"]) +add_insn("cqo", "onebyte", modifiers=[0x99, 64], only64=True) + +# +# Conversion instructions - GAS / AT&T naming +# +add_insn("cbtw", "onebyte", parser="gas", modifiers=[0x98, 16]) +add_insn("cwtl", "onebyte", parser="gas", modifiers=[0x98, 32], cpu=["386"]) +add_insn("cltq", "onebyte", parser="gas", modifiers=[0x98, 64], only64=True) +add_insn("cwtd", "onebyte", parser="gas", modifiers=[0x99, 16]) +add_insn("cltd", "onebyte", parser="gas", modifiers=[0x99, 32], cpu=["386"]) +add_insn("cqto", "onebyte", parser="gas", modifiers=[0x99, 64], only64=True) + +# +# Arithmetic - imul +# +for sfx, sz in zip("bwlq", [8, 16, 32, 64]): + add_group("imul", + suffix=sfx, + opersize=sz, + opcode=[0xF6+(sz!=8)], + spare=5, + operands=[Operand(type="RM", size=sz, dest="EA")]) +for sfx, sz in zip("wlq", [16, 32, 64]): + add_group("imul", + suffix=sfx, + cpu=["386"], + opersize=sz, + opcode=[0x0F, 0xAF], + operands=[Operand(type="Reg", size=sz, dest="Spare"), + Operand(type="RM", size=sz, relaxed=True, dest="EA")]) +for sfx, sz in zip("wlq", [16, 32, 64]): + add_group("imul", + suffix=sfx, + cpu=["186"], + opersize=sz, + opcode=[0x6B], + operands=[Operand(type="Reg", size=sz, dest="Spare"), + Operand(type="RM", size=sz, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, dest="SImm")]) +for sfx, sz in zip("wlq", [16, 32, 64]): + add_group("imul", + suffix=sfx, + cpu=["186"], + opersize=sz, + opcode=[0x6B], + operands=[Operand(type="Reg", size=sz, dest="SpareEA"), + Operand(type="Imm", size=8, dest="SImm")]) +for sfx, sz, immsz in zip("wlq", [16, 32, 64], [16, 32, 32]): + add_group("imul", + suffix=sfx, + cpu=["186"], + opersize=sz, + opcode1=[0x6B], + opcode2=[0x69], + operands=[Operand(type="Reg", size=sz, dest="Spare"), + Operand(type="RM", size=sz, relaxed=True, dest="EA"), + Operand(type="Imm", size=immsz, relaxed=True, dest="SImm", + opt="SImm8")]) +for sfx, sz, immsz in zip("wlq", [16, 32, 64], [16, 32, 32]): + add_group("imul", + suffix=sfx, + cpu=["186"], + opersize=sz, + opcode1=[0x6B], + opcode2=[0x69], + operands=[Operand(type="Reg", size=sz, dest="SpareEA"), + Operand(type="Imm", size=immsz, relaxed=True, dest="SImm", + opt="SImm8")]) + +add_insn("imul", "imul") + +# +# Shifts - standard +# +for sfx, sz in zip("bwlq", [8, 16, 32, 64]): + add_group("shift", + suffix=sfx, + modifiers=["SpAdd"], + opersize=sz, + opcode=[0xD2+(sz!=8)], + spare=0, + operands=[Operand(type="RM", size=sz, dest="EA"), + Operand(type="Creg", size=8, dest=None)]) + add_group("shift", + suffix=sfx, + modifiers=["SpAdd"], + opersize=sz, + opcode=[0xD0+(sz!=8)], + spare=0, + operands=[Operand(type="RM", size=sz, dest="EA"), + Operand(type="Imm1", size=8, relaxed=True, dest=None)]) + add_group("shift", + suffix=sfx, + cpu=["186"], + modifiers=["SpAdd"], + opersize=sz, + opcode=[0xC0+(sz!=8)], + spare=0, + operands=[Operand(type="RM", size=sz, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +# In GAS mode, single operands are equivalent to shifting by 1 forms +for sfx, sz in zip("bwlq", [8, 16, 32, 64]): + add_group("shift", + suffix=sfx, + parsers=["gas"], + modifiers=["SpAdd"], + opersize=sz, + opcode=[0xD0+(sz!=8)], + spare=0, + operands=[Operand(type="RM", size=sz, dest="EA")]) + +add_insn("rol", "shift", modifiers=[0]) +add_insn("ror", "shift", modifiers=[1]) +add_insn("rcl", "shift", modifiers=[2]) +add_insn("rcr", "shift", modifiers=[3]) +add_insn("sal", "shift", modifiers=[4]) +add_insn("shl", "shift", modifiers=[4]) +add_insn("shr", "shift", modifiers=[5]) +add_insn("sar", "shift", modifiers=[7]) + +# +# Shifts - doubleword +# +for sfx, sz in zip("wlq", [16, 32, 64]): + add_group("shlrd", + suffix=sfx, + cpu=["386"], + modifiers=["Op1Add"], + opersize=sz, + opcode=[0x0F, 0x00], + operands=[Operand(type="RM", size=sz, relaxed=True, dest="EA"), + Operand(type="Reg", size=sz, dest="Spare"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + add_group("shlrd", + suffix=sfx, + cpu=["386"], + modifiers=["Op1Add"], + opersize=sz, + opcode=[0x0F, 0x01], + operands=[Operand(type="RM", size=sz, relaxed=True, dest="EA"), + Operand(type="Reg", size=sz, dest="Spare"), + Operand(type="Creg", size=8, dest=None)]) +# GAS parser supports two-operand form for shift with CL count +for sfx, sz in zip("wlq", [16, 32, 64]): + add_group("shlrd", + suffix=sfx, + cpu=["386"], + parsers=["gas"], + modifiers=["Op1Add"], + opersize=sz, + opcode=[0x0F, 0x01], + operands=[Operand(type="RM", size=sz, relaxed=True, dest="EA"), + Operand(type="Reg", size=sz, dest="Spare")]) + +add_insn("shld", "shlrd", modifiers=[0xA4]) +add_insn("shrd", "shlrd", modifiers=[0xAC]) + +##################################################################### +# Control transfer instructions (unconditional) +##################################################################### +# +# call +# +add_group("call", + opcode=[], + operands=[Operand(type="ImmNotSegOff", dest="JmpRel")]) +add_group("call", + opersize=16, + opcode=[], + operands=[Operand(type="ImmNotSegOff", size=16, dest="JmpRel")]) +add_group("call", + not64=True, + opersize=32, + opcode=[], + operands=[Operand(type="ImmNotSegOff", size=32, dest="JmpRel")]) +add_group("call", + only64=True, + opersize=64, + opcode=[], + operands=[Operand(type="ImmNotSegOff", size=32, dest="JmpRel")]) + +add_group("call", + opersize=16, + def_opersize_64=64, + opcode=[0xE8], + operands=[Operand(type="Imm", size=16, tmod="Near", dest="JmpRel")]) +add_group("call", + not64=True, + opersize=32, + opcode=[0xE8], + operands=[Operand(type="Imm", size=32, tmod="Near", dest="JmpRel")]) +add_group("call", + only64=True, + opersize=64, + def_opersize_64=64, + opcode=[0xE8], + operands=[Operand(type="Imm", size=32, tmod="Near", dest="JmpRel")]) +add_group("call", + def_opersize_64=64, + opcode=[0xE8], + operands=[Operand(type="Imm", tmod="Near", dest="JmpRel")]) + +add_group("call", + opersize=16, + opcode=[0xFF], + spare=2, + operands=[Operand(type="RM", size=16, dest="EA")]) +add_group("call", + not64=True, + opersize=32, + opcode=[0xFF], + spare=2, + operands=[Operand(type="RM", size=32, dest="EA")]) +add_group("call", + opersize=64, + def_opersize_64=64, + opcode=[0xFF], + spare=2, + operands=[Operand(type="RM", size=64, dest="EA")]) +add_group("call", + def_opersize_64=64, + opcode=[0xFF], + spare=2, + operands=[Operand(type="Mem", dest="EA")]) +add_group("call", + opersize=16, + def_opersize_64=64, + opcode=[0xFF], + spare=2, + operands=[Operand(type="RM", size=16, tmod="Near", dest="EA")]) +add_group("call", + not64=True, + opersize=32, + opcode=[0xFF], + spare=2, + operands=[Operand(type="RM", size=32, tmod="Near", dest="EA")]) +add_group("call", + opersize=64, + def_opersize_64=64, + opcode=[0xFF], + spare=2, + operands=[Operand(type="RM", size=64, tmod="Near", dest="EA")]) +add_group("call", + def_opersize_64=64, + opcode=[0xFF], + spare=2, + operands=[Operand(type="Mem", tmod="Near", dest="EA")]) + +# Far indirect (through memory). Needs explicit FAR override. +for sz in [16, 32, 64]: + add_group("call", + opersize=sz, + opcode=[0xFF], + spare=3, + operands=[Operand(type="Mem", size=sz, tmod="Far", dest="EA")]) +add_group("call", + opcode=[0xFF], + spare=3, + operands=[Operand(type="Mem", tmod="Far", dest="EA")]) + +# With explicit FAR override +for sz in [16, 32]: + add_group("call", + not64=True, + opersize=sz, + opcode=[0x9A], + spare=3, + operands=[Operand(type="Imm", size=sz, tmod="Far", dest="JmpFar")]) +add_group("call", + not64=True, + opcode=[0x9A], + spare=3, + operands=[Operand(type="Imm", tmod="Far", dest="JmpFar")]) + +# Since not caught by first ImmNotSegOff group, implicitly FAR. +for sz in [16, 32]: + add_group("call", + not64=True, + opersize=sz, + opcode=[0x9A], + spare=3, + operands=[Operand(type="Imm", size=sz, dest="JmpFar")]) +add_group("call", + not64=True, + opcode=[0x9A], + spare=3, + operands=[Operand(type="Imm", dest="JmpFar")]) + +add_insn("call", "call") +add_insn("calll", "call", parser="gas", not64=True) +add_insn("callq", "call", parser="gas", only64=True) + +# +# jmp +# +add_group("jmp", + opcode=[], + operands=[Operand(type="ImmNotSegOff", dest="JmpRel")]) +add_group("jmp", + opersize=16, + opcode=[], + operands=[Operand(type="ImmNotSegOff", size=16, dest="JmpRel")]) +add_group("jmp", + not64=True, + opersize=32, + opcode=[0x00], + operands=[Operand(type="ImmNotSegOff", size=32, dest="JmpRel")]) +add_group("jmp", + only64=True, + opersize=64, + opcode=[0x00], + operands=[Operand(type="ImmNotSegOff", size=32, dest="JmpRel")]) + +add_group("jmp", + def_opersize_64=64, + opcode=[0xEB], + operands=[Operand(type="Imm", tmod="Short", dest="JmpRel")]) +add_group("jmp", + opersize=16, + def_opersize_64=64, + opcode=[0xE9], + operands=[Operand(type="Imm", size=16, tmod="Near", dest="JmpRel")]) +add_group("jmp", + not64=True, + cpu=["386"], + opersize=32, + opcode=[0xE9], + operands=[Operand(type="Imm", size=32, tmod="Near", dest="JmpRel")]) +add_group("jmp", + only64=True, + opersize=64, + def_opersize_64=64, + opcode=[0xE9], + operands=[Operand(type="Imm", size=32, tmod="Near", dest="JmpRel")]) +add_group("jmp", + def_opersize_64=64, + opcode=[0xE9], + operands=[Operand(type="Imm", tmod="Near", dest="JmpRel")]) + +add_group("jmp", + opersize=16, + def_opersize_64=64, + opcode=[0xFF], + spare=4, + operands=[Operand(type="RM", size=16, dest="EA")]) +add_group("jmp", + not64=True, + opersize=32, + opcode=[0xFF], + spare=4, + operands=[Operand(type="RM", size=32, dest="EA")]) +add_group("jmp", + opersize=64, + def_opersize_64=64, + opcode=[0xFF], + spare=4, + operands=[Operand(type="RM", size=64, dest="EA")]) +add_group("jmp", + def_opersize_64=64, + opcode=[0xFF], + spare=4, + operands=[Operand(type="Mem", dest="EA")]) +add_group("jmp", + opersize=16, + def_opersize_64=64, + opcode=[0xFF], + spare=4, + operands=[Operand(type="RM", size=16, tmod="Near", dest="EA")]) +add_group("jmp", + not64=True, + cpu=["386"], + opersize=32, + opcode=[0xFF], + spare=4, + operands=[Operand(type="RM", size=32, tmod="Near", dest="EA")]) +add_group("jmp", + opersize=64, + def_opersize_64=64, + opcode=[0xFF], + spare=4, + operands=[Operand(type="RM", size=64, tmod="Near", dest="EA")]) +add_group("jmp", + def_opersize_64=64, + opcode=[0xFF], + spare=4, + operands=[Operand(type="Mem", tmod="Near", dest="EA")]) + +# Far indirect (through memory). Needs explicit FAR override. +for sz in [16, 32, 64]: + add_group("jmp", + opersize=sz, + opcode=[0xFF], + spare=5, + operands=[Operand(type="Mem", size=sz, tmod="Far", dest="EA")]) +add_group("jmp", + opcode=[0xFF], + spare=5, + operands=[Operand(type="Mem", tmod="Far", dest="EA")]) + +# With explicit FAR override +for sz in [16, 32]: + add_group("jmp", + not64=True, + opersize=sz, + opcode=[0xEA], + spare=3, + operands=[Operand(type="Imm", size=sz, tmod="Far", dest="JmpFar")]) +add_group("jmp", + not64=True, + opcode=[0xEA], + spare=3, + operands=[Operand(type="Imm", tmod="Far", dest="JmpFar")]) + +# Since not caught by first ImmNotSegOff group, implicitly FAR. +for sz in [16, 32]: + add_group("jmp", + not64=True, + opersize=sz, + opcode=[0xEA], + spare=3, + operands=[Operand(type="Imm", size=sz, dest="JmpFar")]) +add_group("jmp", + not64=True, + opcode=[0xEA], + spare=3, + operands=[Operand(type="Imm", dest="JmpFar")]) + +add_insn("jmp", "jmp") + +# +# ret +# +add_group("retnf", + not64=True, + modifiers=["Op0Add"], + opcode=[0x01], + operands=[]) +add_group("retnf", + not64=True, + modifiers=["Op0Add"], + opcode=[0x00], + operands=[Operand(type="Imm", size=16, relaxed=True, dest="Imm")]) +add_group("retnf", + only64=True, + modifiers=["Op0Add", "OpSizeR"], + opcode=[0x01], + operands=[]) +add_group("retnf", + only64=True, + modifiers=["Op0Add", "OpSizeR"], + opcode=[0x00], + operands=[Operand(type="Imm", size=16, relaxed=True, dest="Imm")]) +add_group("retnf", + gen_suffix=False, + suffixes=["w", "l", "q"], + modifiers=["Op0Add", "OpSizeR"], + opcode=[0x01], + operands=[]) +# GAS suffix versions +add_group("retnf", + gen_suffix=False, + suffixes=["w", "l", "q"], + modifiers=["Op0Add", "OpSizeR"], + opcode=[0x00], + operands=[Operand(type="Imm", size=16, relaxed=True, dest="Imm")]) + +add_insn("ret", "retnf", modifiers=[0xC2]) +add_insn("retw", "retnf", parser="gas", modifiers=[0xC2, 16]) +add_insn("retl", "retnf", parser="gas", modifiers=[0xC2], not64=True) +add_insn("retq", "retnf", parser="gas", modifiers=[0xC2], only64=True) +add_insn("retn", "retnf", parser="nasm", modifiers=[0xC2]) +add_insn("retf", "retnf", parser="nasm", modifiers=[0xCA, 64]) +add_insn("lretw", "retnf", parser="gas", modifiers=[0xCA, 16], suffix="NONE") +add_insn("lretl", "retnf", parser="gas", modifiers=[0xCA], suffix="NONE") +add_insn("lretq", "retnf", parser="gas", modifiers=[0xCA, 64], only64=True, + suffix="NONE") + +# +# enter +# +add_group("enter", + suffix="l", + not64=True, + cpu=["186"], + gas_no_reverse=True, + opcode=[0xC8], + operands=[ + Operand(type="Imm", size=16, relaxed=True, dest="EA", opt="A16"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("enter", + suffix="q", + only64=True, + cpu=["186"], + gas_no_reverse=True, + opersize=64, + def_opersize_64=64, + opcode=[0xC8], + operands=[ + Operand(type="Imm", size=16, relaxed=True, dest="EA", opt="A16"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +# GAS suffix version +add_group("enter", + suffix="w", + cpu=["186"], + parsers=["gas"], + gas_no_reverse=True, + opersize=16, + opcode=[0xC8], + operands=[ + Operand(type="Imm", size=16, relaxed=True, dest="EA", opt="A16"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + +add_insn("enter", "enter") + +# +# leave +# +add_insn("leave", "onebyte", modifiers=[0xC9, 0, 64], cpu=["186"]) +add_insn("leavew", "onebyte", parser="gas", modifiers=[0xC9, 16, 0], + cpu=["186"]) +add_insn("leavel", "onebyte", parser="gas", modifiers=[0xC9, 0, 64], + cpu=["186"]) +add_insn("leaveq", "onebyte", parser="gas", modifiers=[0xC9, 0, 64], + only64=True) + +##################################################################### +# Conditional jumps +##################################################################### +add_group("jcc", + opcode=[], + operands=[Operand(type="Imm", dest="JmpRel")]) +add_group("jcc", + opersize=16, + opcode=[], + operands=[Operand(type="Imm", size=16, dest="JmpRel")]) +add_group("jcc", + not64=True, + opersize=32, + opcode=[], + operands=[Operand(type="Imm", size=32, dest="JmpRel")]) +add_group("jcc", + only64=True, + opersize=64, + opcode=[], + operands=[Operand(type="Imm", size=32, dest="JmpRel")]) + +add_group("jcc", + modifiers=["Op0Add"], + def_opersize_64=64, + opcode=[0x70], + operands=[Operand(type="Imm", tmod="Short", dest="JmpRel")]) +add_group("jcc", + cpu=["186"], + modifiers=["Op1Add"], + opersize=16, + def_opersize_64=64, + opcode=[0x0F, 0x80], + operands=[Operand(type="Imm", size=16, tmod="Near", dest="JmpRel")]) +add_group("jcc", + not64=True, + cpu=["386"], + modifiers=["Op1Add"], + opersize=32, + opcode=[0x0F, 0x80], + operands=[Operand(type="Imm", size=32, tmod="Near", dest="JmpRel")]) +add_group("jcc", + only64=True, + modifiers=["Op1Add"], + opersize=64, + def_opersize_64=64, + opcode=[0x0F, 0x80], + operands=[Operand(type="Imm", size=32, tmod="Near", dest="JmpRel")]) +add_group("jcc", + cpu=["186"], + modifiers=["Op1Add"], + def_opersize_64=64, + opcode=[0x0F, 0x80], + operands=[Operand(type="Imm", tmod="Near", dest="JmpRel")]) + +add_insn("jo", "jcc", modifiers=[0x00]) +add_insn("jno", "jcc", modifiers=[0x01]) +add_insn("jb", "jcc", modifiers=[0x02]) +add_insn("jc", "jcc", modifiers=[0x02]) +add_insn("jnae", "jcc", modifiers=[0x02]) +add_insn("jnb", "jcc", modifiers=[0x03]) +add_insn("jnc", "jcc", modifiers=[0x03]) +add_insn("jae", "jcc", modifiers=[0x03]) +add_insn("je", "jcc", modifiers=[0x04]) +add_insn("jz", "jcc", modifiers=[0x04]) +add_insn("jne", "jcc", modifiers=[0x05]) +add_insn("jnz", "jcc", modifiers=[0x05]) +add_insn("jbe", "jcc", modifiers=[0x06]) +add_insn("jna", "jcc", modifiers=[0x06]) +add_insn("jnbe", "jcc", modifiers=[0x07]) +add_insn("ja", "jcc", modifiers=[0x07]) +add_insn("js", "jcc", modifiers=[0x08]) +add_insn("jns", "jcc", modifiers=[0x09]) +add_insn("jp", "jcc", modifiers=[0x0A]) +add_insn("jpe", "jcc", modifiers=[0x0A]) +add_insn("jnp", "jcc", modifiers=[0x0B]) +add_insn("jpo", "jcc", modifiers=[0x0B]) +add_insn("jl", "jcc", modifiers=[0x0C]) +add_insn("jnge", "jcc", modifiers=[0x0C]) +add_insn("jnl", "jcc", modifiers=[0x0D]) +add_insn("jge", "jcc", modifiers=[0x0D]) +add_insn("jle", "jcc", modifiers=[0x0E]) +add_insn("jng", "jcc", modifiers=[0x0E]) +add_insn("jnle", "jcc", modifiers=[0x0F]) +add_insn("jg", "jcc", modifiers=[0x0F]) + +# +# jcxz +# +add_group("jcxz", + modifiers=["AdSizeR"], + opcode=[], + operands=[Operand(type="Imm", dest="JmpRel")]) +add_group("jcxz", + modifiers=["AdSizeR"], + def_opersize_64=64, + opcode=[0xE3], + operands=[Operand(type="Imm", tmod="Short", dest="JmpRel")]) + +add_insn("jcxz", "jcxz", modifiers=[16]) +add_insn("jecxz", "jcxz", modifiers=[32], cpu=["386"]) +add_insn("jrcxz", "jcxz", modifiers=[64], only64=True) + +##################################################################### +# Loop instructions +##################################################################### +add_group("loop", + opcode=[], + operands=[Operand(type="Imm", dest="JmpRel")]) +add_group("loop", + not64=True, + opcode=[], + operands=[Operand(type="Imm", dest="JmpRel"), + Operand(type="Creg", size=16, dest="AdSizeR")]) +add_group("loop", + def_opersize_64=64, + opcode=[], + operands=[Operand(type="Imm", dest="JmpRel"), + Operand(type="Creg", size=32, dest="AdSizeR")]) +add_group("loop", + def_opersize_64=64, + opcode=[], + operands=[Operand(type="Imm", dest="JmpRel"), + Operand(type="Creg", size=64, dest="AdSizeR")]) + +add_group("loop", + not64=True, + modifiers=["Op0Add"], + opcode=[0xE0], + operands=[Operand(type="Imm", tmod="Short", dest="JmpRel")]) +for sz in [16, 32, 64]: + add_group("loop", + modifiers=["Op0Add"], + def_opersize_64=64, + opcode=[0xE0], + operands=[Operand(type="Imm", tmod="Short", dest="JmpRel"), + Operand(type="Creg", size=sz, dest="AdSizeR")]) + +add_insn("loop", "loop", modifiers=[2]) +add_insn("loopz", "loop", modifiers=[1]) +add_insn("loope", "loop", modifiers=[1]) +add_insn("loopnz", "loop", modifiers=[0]) +add_insn("loopne", "loop", modifiers=[0]) + +##################################################################### +# Set byte on flag instructions +##################################################################### +add_group("setcc", + suffix="b", + cpu=["386"], + modifiers=["Op1Add"], + opcode=[0x0F, 0x90], + spare=2, + operands=[Operand(type="RM", size=8, relaxed=True, dest="EA")]) + +add_insn("seto", "setcc", modifiers=[0x00]) +add_insn("setno", "setcc", modifiers=[0x01]) +add_insn("setb", "setcc", modifiers=[0x02]) +add_insn("setc", "setcc", modifiers=[0x02]) +add_insn("setnae", "setcc", modifiers=[0x02]) +add_insn("setnb", "setcc", modifiers=[0x03]) +add_insn("setnc", "setcc", modifiers=[0x03]) +add_insn("setae", "setcc", modifiers=[0x03]) +add_insn("sete", "setcc", modifiers=[0x04]) +add_insn("setz", "setcc", modifiers=[0x04]) +add_insn("setne", "setcc", modifiers=[0x05]) +add_insn("setnz", "setcc", modifiers=[0x05]) +add_insn("setbe", "setcc", modifiers=[0x06]) +add_insn("setna", "setcc", modifiers=[0x06]) +add_insn("setnbe", "setcc", modifiers=[0x07]) +add_insn("seta", "setcc", modifiers=[0x07]) +add_insn("sets", "setcc", modifiers=[0x08]) +add_insn("setns", "setcc", modifiers=[0x09]) +add_insn("setp", "setcc", modifiers=[0x0A]) +add_insn("setpe", "setcc", modifiers=[0x0A]) +add_insn("setnp", "setcc", modifiers=[0x0B]) +add_insn("setpo", "setcc", modifiers=[0x0B]) +add_insn("setl", "setcc", modifiers=[0x0C]) +add_insn("setnge", "setcc", modifiers=[0x0C]) +add_insn("setnl", "setcc", modifiers=[0x0D]) +add_insn("setge", "setcc", modifiers=[0x0D]) +add_insn("setle", "setcc", modifiers=[0x0E]) +add_insn("setng", "setcc", modifiers=[0x0E]) +add_insn("setnle", "setcc", modifiers=[0x0F]) +add_insn("setg", "setcc", modifiers=[0x0F]) + +##################################################################### +# String instructions +##################################################################### +add_insn("cmpsb", "onebyte", modifiers=[0xA6, 0]) +add_insn("cmpsw", "onebyte", modifiers=[0xA7, 16]) + +# cmpsd has to be non-onebyte for SSE2 forms below +add_group("cmpsd", + parsers=["nasm"], + opersize=32, + opcode=[0xA7], + operands=[]) + +add_insn("cmpsd", "cmpsd", cpu=[]) + +add_insn("cmpsl", "onebyte", parser="gas", modifiers=[0xA7, 32], cpu=["386"]) +add_insn("cmpsq", "onebyte", modifiers=[0xA7, 64], only64=True) +add_insn("insb", "onebyte", modifiers=[0x6C, 0]) +add_insn("insw", "onebyte", modifiers=[0x6D, 16]) +add_insn("insd", "onebyte", parser="nasm", modifiers=[0x6D, 32], cpu=["386"]) +add_insn("insl", "onebyte", parser="gas", modifiers=[0x6D, 32], cpu=["386"]) +add_insn("outsb", "onebyte", modifiers=[0x6E, 0]) +add_insn("outsw", "onebyte", modifiers=[0x6F, 16]) +add_insn("outsd", "onebyte", parser="nasm", modifiers=[0x6F, 32], + cpu=["386"]) +add_insn("outsl", "onebyte", parser="gas", modifiers=[0x6F, 32], cpu=["386"]) +add_insn("lodsb", "onebyte", modifiers=[0xAC, 0]) +add_insn("lodsw", "onebyte", modifiers=[0xAD, 16]) +add_insn("lodsd", "onebyte", parser="nasm", modifiers=[0xAD, 32], + cpu=["386"]) +add_insn("lodsl", "onebyte", parser="gas", modifiers=[0xAD, 32], cpu=["386"]) +add_insn("lodsq", "onebyte", modifiers=[0xAD, 64], only64=True) +add_insn("movsb", "onebyte", modifiers=[0xA4, 0]) +add_insn("movsw", "onebyte", modifiers=[0xA5, 16]) + +# movsd has to be non-onebyte for SSE2 forms below +add_group("movsd", + parsers=["nasm"], + opersize=32, + opcode=[0xA5], + operands=[]) + +add_insn("movsd", "movsd", cpu=["386"]) + +add_insn("movsl", "onebyte", parser="gas", modifiers=[0xA5, 32], cpu=["386"]) +add_insn("movsq", "onebyte", modifiers=[0xA5, 64], only64=True) +# smov alias for movs in GAS mode +add_insn("smovb", "onebyte", parser="gas", modifiers=[0xA4, 0]) +add_insn("smovw", "onebyte", parser="gas", modifiers=[0xA5, 16]) +add_insn("smovl", "onebyte", parser="gas", modifiers=[0xA5, 32], cpu=["386"]) +add_insn("smovq", "onebyte", parser="gas", modifiers=[0xA5, 64], only64=True) +add_insn("scasb", "onebyte", modifiers=[0xAE, 0]) +add_insn("scasw", "onebyte", modifiers=[0xAF, 16]) +add_insn("scasd", "onebyte", parser="nasm", modifiers=[0xAF, 32], + cpu=["386"]) +add_insn("scasl", "onebyte", parser="gas", modifiers=[0xAF, 32], cpu=["386"]) +add_insn("scasq", "onebyte", modifiers=[0xAF, 64], only64=True) +# ssca alias for scas in GAS mode +add_insn("sscab", "onebyte", parser="gas", modifiers=[0xAE, 0]) +add_insn("sscaw", "onebyte", parser="gas", modifiers=[0xAF, 16]) +add_insn("sscal", "onebyte", parser="gas", modifiers=[0xAF, 32], cpu=["386"]) +add_insn("sscaq", "onebyte", parser="gas", modifiers=[0xAF, 64], only64=True) +add_insn("stosb", "onebyte", modifiers=[0xAA, 0]) +add_insn("stosw", "onebyte", modifiers=[0xAB, 16]) +add_insn("stosd", "onebyte", parser="nasm", modifiers=[0xAB, 32], + cpu=["386"]) +add_insn("stosl", "onebyte", parser="gas", modifiers=[0xAB, 32], cpu=["386"]) +add_insn("stosq", "onebyte", modifiers=[0xAB, 64], only64=True) +add_insn("xlatb", "onebyte", modifiers=[0xD7, 0]) + +##################################################################### +# Bit manipulation +##################################################################### + +# +# bit tests +# +for sfx, sz in zip("wlq", [16, 32, 64]): + add_group("bittest", + suffix=sfx, + cpu=["386"], + modifiers=["Op1Add"], + opersize=sz, + opcode=[0x0F, 0x00], + operands=[Operand(type="RM", size=sz, relaxed=True, dest="EA"), + Operand(type="Reg", size=sz, dest="Spare")]) +for sfx, sz in zip("wlq", [16, 32, 64]): + add_group("bittest", + suffix=sfx, + cpu=["386"], + modifiers=["Gap", "SpAdd"], + opersize=sz, + opcode=[0x0F, 0xBA], + spare=0, + operands=[Operand(type="RM", size=sz, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + +add_insn("bt", "bittest", modifiers=[0xA3, 4]) +add_insn("bts", "bittest", modifiers=[0xAB, 5]) +add_insn("btr", "bittest", modifiers=[0xB3, 6]) +add_insn("btc", "bittest", modifiers=[0xBB, 7]) + +# +# bit scans - also used for lar/lsl +# +for sfx, sz in zip("wlq", [16, 32, 64]): + add_group("bsfr", + suffix=sfx, + cpu=["386"], + modifiers=["Op1Add"], + opersize=sz, + opcode=[0x0F, 0x00], + operands=[Operand(type="Reg", size=sz, dest="Spare"), + Operand(type="RM", size=sz, relaxed=True, dest="EA")]) + +add_insn("bsf", "bsfr", modifiers=[0xBC]) +add_insn("bsr", "bsfr", modifiers=[0xBD]) + +##################################################################### +# Interrupts and operating system instructions +##################################################################### +add_group("int", + opcode=[0xCD], + operands=[Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + +add_insn("int", "int") +add_insn("int3", "onebyte", modifiers=[0xCC]) +add_insn("int03", "onebyte", parser="nasm", modifiers=[0xCC]) +add_insn("into", "onebyte", modifiers=[0xCE], not64=True) +add_insn("iret", "onebyte", modifiers=[0xCF]) +add_insn("iretw", "onebyte", modifiers=[0xCF, 16]) +add_insn("iretd", "onebyte", parser="nasm", modifiers=[0xCF, 32], + cpu=["386"]) +add_insn("iretl", "onebyte", parser="gas", modifiers=[0xCF, 32], cpu=["386"]) +add_insn("iretq", "onebyte", modifiers=[0xCF, 64], only64=True) +add_insn("rsm", "twobyte", modifiers=[0x0F, 0xAA], cpu=["586", "SMM"]) + +for sfx, sz in zip("wl", [16, 32]): + add_group("bound", + suffix=sfx, + cpu=["186"], + not64=True, + opersize=sz, + opcode=[0x62], + operands=[Operand(type="Reg", size=sz, dest="Spare"), + Operand(type="Mem", size=sz, relaxed=True, dest="EA")]) + +add_insn("bound", "bound") +add_insn("hlt", "onebyte", modifiers=[0xF4], cpu=["Priv"]) +add_insn("nop", "onebyte", modifiers=[0x90]) + +# +# Protection control +# +add_insn("lar", "bsfr", modifiers=[0x02], cpu=["286", "Prot"]) +add_insn("lsl", "bsfr", modifiers=[0x03], cpu=["286", "Prot"]) + +add_group("arpl", + suffix="w", + cpu=["Prot", "286"], + not64=True, + opcode=[0x63], + operands=[Operand(type="RM", size=16, relaxed=True, dest="EA"), + Operand(type="Reg", size=16, dest="Spare")]) + +add_insn("arpl", "arpl") + +for sfx in [None, "w", "l", "q"]: + add_insn("lgdt"+(sfx or ""), "twobytemem", suffix=sfx, + modifiers=[2, 0x0F, 0x01], cpu=["286", "Priv"]) + add_insn("lidt"+(sfx or ""), "twobytemem", suffix=sfx, + modifiers=[3, 0x0F, 0x01], cpu=["286", "Priv"]) + add_insn("sgdt"+(sfx or ""), "twobytemem", suffix=sfx, + modifiers=[0, 0x0F, 0x01], cpu=["286", "Priv"]) + add_insn("sidt"+(sfx or ""), "twobytemem", suffix=sfx, + modifiers=[1, 0x0F, 0x01], cpu=["286", "Priv"]) + +for sfx, sz in zip("wlq", [16, 32, 64]): + add_group("str", + suffix=sfx, + cpu=["Prot", "286"], + opersize=sz, + opcode=[0x0F, 0x00], + spare=1, + operands=[Operand(type="Reg", size=sz, dest="EA")]) +add_group("str", + suffixes=["w", "l"], + cpu=["Prot", "286"], + opcode=[0x0F, 0x00], + spare=1, + operands=[Operand(type="RM", size=16, relaxed=True, dest="EA")]) + +add_insn("str", "str") + +add_group("prot286", + suffix="w", + cpu=["286"], + modifiers=["SpAdd", "Op1Add"], + opcode=[0x0F, 0x00], + spare=0, + operands=[Operand(type="RM", size=16, relaxed=True, dest="EA")]) + +add_insn("lldt", "prot286", modifiers=[2, 0], cpu=["286", "Prot", "Priv"]) +add_insn("ltr", "prot286", modifiers=[3, 0], cpu=["286", "Prot", "Priv"]) +add_insn("verr", "prot286", modifiers=[4, 0], cpu=["286", "Prot"]) +add_insn("verw", "prot286", modifiers=[5, 0], cpu=["286", "Prot"]) +add_insn("lmsw", "prot286", modifiers=[6, 1], cpu=["286", "Priv"]) + +for sfx, sz in zip("wlq", [16, 32, 64]): + add_group("sldtmsw", + suffix=sfx, + only64=(sz==64), + cpu=[(sz==32) and "386" or "286"], + modifiers=["SpAdd", "Op1Add"], + opcode=[0x0F, 0x00], + spare=0, + operands=[Operand(type="Mem", size=sz, relaxed=True, dest="EA")]) +for sfx, sz in zip("wlq", [16, 32, 64]): + add_group("sldtmsw", + suffix=sfx, + cpu=["286"], + modifiers=["SpAdd", "Op1Add"], + opersize=sz, + opcode=[0x0F, 0x00], + spare=0, + operands=[Operand(type="Reg", size=sz, dest="EA")]) + +add_insn("sldt", "sldtmsw", modifiers=[0, 0]) +add_insn("smsw", "sldtmsw", modifiers=[4, 1]) + +##################################################################### +# Floating point instructions +##################################################################### +add_insn("fcompp", "twobyte", modifiers=[0xDE, 0xD9], cpu=["FPU"]) +add_insn("fucompp", "twobyte", modifiers=[0xDA, 0xE9], cpu=["286", "FPU"]) +add_insn("ftst", "twobyte", modifiers=[0xD9, 0xE4], cpu=["FPU"]) +add_insn("fxam", "twobyte", modifiers=[0xD9, 0xE5], cpu=["FPU"]) +add_insn("fld1", "twobyte", modifiers=[0xD9, 0xE8], cpu=["FPU"]) +add_insn("fldl2t", "twobyte", modifiers=[0xD9, 0xE9], cpu=["FPU"]) +add_insn("fldl2e", "twobyte", modifiers=[0xD9, 0xEA], cpu=["FPU"]) +add_insn("fldpi", "twobyte", modifiers=[0xD9, 0xEB], cpu=["FPU"]) +add_insn("fldlg2", "twobyte", modifiers=[0xD9, 0xEC], cpu=["FPU"]) +add_insn("fldln2", "twobyte", modifiers=[0xD9, 0xED], cpu=["FPU"]) +add_insn("fldz", "twobyte", modifiers=[0xD9, 0xEE], cpu=["FPU"]) +add_insn("f2xm1", "twobyte", modifiers=[0xD9, 0xF0], cpu=["FPU"]) +add_insn("fyl2x", "twobyte", modifiers=[0xD9, 0xF1], cpu=["FPU"]) +add_insn("fptan", "twobyte", modifiers=[0xD9, 0xF2], cpu=["FPU"]) +add_insn("fpatan", "twobyte", modifiers=[0xD9, 0xF3], cpu=["FPU"]) +add_insn("fxtract", "twobyte", modifiers=[0xD9, 0xF4], cpu=["FPU"]) +add_insn("fprem1", "twobyte", modifiers=[0xD9, 0xF5], cpu=["286", "FPU"]) +add_insn("fdecstp", "twobyte", modifiers=[0xD9, 0xF6], cpu=["FPU"]) +add_insn("fincstp", "twobyte", modifiers=[0xD9, 0xF7], cpu=["FPU"]) +add_insn("fprem", "twobyte", modifiers=[0xD9, 0xF8], cpu=["FPU"]) +add_insn("fyl2xp1", "twobyte", modifiers=[0xD9, 0xF9], cpu=["FPU"]) +add_insn("fsqrt", "twobyte", modifiers=[0xD9, 0xFA], cpu=["FPU"]) +add_insn("fsincos", "twobyte", modifiers=[0xD9, 0xFB], cpu=["286", "FPU"]) +add_insn("frndint", "twobyte", modifiers=[0xD9, 0xFC], cpu=["FPU"]) +add_insn("fscale", "twobyte", modifiers=[0xD9, 0xFD], cpu=["FPU"]) +add_insn("fsin", "twobyte", modifiers=[0xD9, 0xFE], cpu=["286", "FPU"]) +add_insn("fcos", "twobyte", modifiers=[0xD9, 0xFF], cpu=["286", "FPU"]) +add_insn("fchs", "twobyte", modifiers=[0xD9, 0xE0], cpu=["FPU"]) +add_insn("fabs", "twobyte", modifiers=[0xD9, 0xE1], cpu=["FPU"]) +add_insn("fninit", "twobyte", modifiers=[0xDB, 0xE3], cpu=["FPU"]) +add_insn("finit", "threebyte", modifiers=[0x9B, 0xDB, 0xE3], cpu=["FPU"]) +add_insn("fnclex", "twobyte", modifiers=[0xDB, 0xE2], cpu=["FPU"]) +add_insn("fclex", "threebyte", modifiers=[0x9B, 0xDB, 0xE2], cpu=["FPU"]) +for sfx in [None, "l", "s"]: + add_insn("fnstenv"+(sfx or ""), "onebytemem", suffix=sfx, + modifiers=[6, 0xD9], cpu=["FPU"]) + add_insn("fstenv"+(sfx or ""), "twobytemem", suffix=sfx, + modifiers=[6, 0x9B, 0xD9], cpu=["FPU"]) + add_insn("fldenv"+(sfx or ""), "onebytemem", suffix=sfx, + modifiers=[4, 0xD9], cpu=["FPU"]) + add_insn("fnsave"+(sfx or ""), "onebytemem", suffix=sfx, + modifiers=[6, 0xDD], cpu=["FPU"]) + add_insn("fsave"+(sfx or ""), "twobytemem", suffix=sfx, + modifiers=[6, 0x9B, 0xDD], cpu=["FPU"]) + add_insn("frstor"+(sfx or ""), "onebytemem", suffix=sfx, + modifiers=[4, 0xDD], cpu=["FPU"]) +add_insn("fnop", "twobyte", modifiers=[0xD9, 0xD0], cpu=["FPU"]) +add_insn("fwait", "onebyte", modifiers=[0x9B], cpu=["FPU"]) +# Prefixes; should the others be here too? should wait be a prefix? +add_insn("wait", "onebyte", modifiers=[0x9B]) + +# +# load/store with pop (integer and normal) +# +add_group("fld", + suffix="s", + cpu=["FPU"], + opcode=[0xD9], + operands=[Operand(type="Mem", size=32, dest="EA")]) +add_group("fld", + suffix="l", + cpu=["FPU"], + opcode=[0xDD], + operands=[Operand(type="Mem", size=64, dest="EA")]) +add_group("fld", + cpu=["FPU"], + opcode=[0xDB], + spare=5, + operands=[Operand(type="Mem", size=80, dest="EA")]) +add_group("fld", + cpu=["FPU"], + opcode=[0xD9, 0xC0], + operands=[Operand(type="Reg", size=80, dest="Op1Add")]) + +add_insn("fld", "fld") + +add_group("fstp", + suffix="s", + cpu=["FPU"], + opcode=[0xD9], + spare=3, + operands=[Operand(type="Mem", size=32, dest="EA")]) +add_group("fstp", + suffix="l", + cpu=["FPU"], + opcode=[0xDD], + spare=3, + operands=[Operand(type="Mem", size=64, dest="EA")]) +add_group("fstp", + cpu=["FPU"], + opcode=[0xDB], + spare=7, + operands=[Operand(type="Mem", size=80, dest="EA")]) +add_group("fstp", + cpu=["FPU"], + opcode=[0xDD, 0xD8], + operands=[Operand(type="Reg", size=80, dest="Op1Add")]) + +add_insn("fstp", "fstp") + +# +# Long memory version of floating point load/store for GAS +# +add_group("fldstpt", + cpu=["FPU"], + modifiers=["SpAdd"], + opcode=[0xDB], + spare=0, + operands=[Operand(type="Mem", size=80, dest="EA")]) + +add_insn("fldt", "fldstpt", suffix="WEAK", modifiers=[5]) +add_insn("fstpt", "fldstpt", suffix="WEAK", modifiers=[7]) + +add_group("fildstp", + suffix="s", + cpu=["FPU"], + modifiers=["SpAdd"], + opcode=[0xDF], + spare=0, + operands=[Operand(type="Mem", size=16, dest="EA")]) +add_group("fildstp", + suffix="l", + cpu=["FPU"], + modifiers=["SpAdd"], + opcode=[0xDB], + spare=0, + operands=[Operand(type="Mem", size=32, dest="EA")]) +add_group("fildstp", + suffix="q", + cpu=["FPU"], + modifiers=["Gap", "Op0Add", "SpAdd"], + opcode=[0xDD], + spare=0, + operands=[Operand(type="Mem", size=64, dest="EA")]) + +add_insn("fild", "fildstp", modifiers=[0, 2, 5]) +add_insn("fistp", "fildstp", modifiers=[3, 2, 7]) + +add_group("fbldstp", + cpu=["FPU"], + modifiers=["SpAdd"], + opcode=[0xDF], + spare=0, + operands=[Operand(type="Mem", size=80, relaxed=True, dest="EA")]) + +add_insn("fbld", "fbldstp", modifiers=[4]) +add_insn("fildll", "fbldstp", parser="gas", modifiers=[5]) +add_insn("fbstp", "fbldstp", modifiers=[6]) +add_insn("fistpll", "fbldstp", parser="gas", modifiers=[7]) + +# +# store (normal) +# +add_group("fst", + suffix="s", + cpu=["FPU"], + opcode=[0xD9], + spare=2, + operands=[Operand(type="Mem", size=32, dest="EA")]) +add_group("fst", + suffix="l", + cpu=["FPU"], + opcode=[0xDD], + spare=2, + operands=[Operand(type="Mem", size=64, dest="EA")]) +add_group("fst", + cpu=["FPU"], + opcode=[0xDD, 0xD0], + operands=[Operand(type="Reg", size=80, dest="Op1Add")]) + +add_insn("fst", "fst") + +# +# exchange (with ST0) +# +add_group("fxch", + cpu=["FPU"], + opcode=[0xD9, 0xC8], + operands=[Operand(type="Reg", size=80, dest="Op1Add")]) +add_group("fxch", + cpu=["FPU"], + opcode=[0xD9, 0xC8], + operands=[Operand(type="ST0", size=80, dest=None), + Operand(type="Reg", size=80, dest="Op1Add")]) +add_group("fxch", + cpu=["FPU"], + opcode=[0xD9, 0xC8], + operands=[Operand(type="Reg", size=80, dest="Op1Add"), + Operand(type="ST0", size=80, dest=None)]) +add_group("fxch", + cpu=["FPU"], + opcode=[0xD9, 0xC9], + operands=[]) + +add_insn("fxch", "fxch") + +# +# comparisons +# +add_group("fcom", + suffix="s", + cpu=["FPU"], + modifiers=["Gap", "SpAdd"], + opcode=[0xD8], + spare=0, + operands=[Operand(type="Mem", size=32, dest="EA")]) +add_group("fcom", + suffix="l", + cpu=["FPU"], + modifiers=["Gap", "SpAdd"], + opcode=[0xDC], + spare=0, + operands=[Operand(type="Mem", size=64, dest="EA")]) +add_group("fcom", + cpu=["FPU"], + modifiers=["Op1Add"], + opcode=[0xD8, 0x00], + operands=[Operand(type="Reg", size=80, dest="Op1Add")]) +# Alias for fcom %st(1) for GAS compat +add_group("fcom", + cpu=["FPU"], + parsers=["gas"], + modifiers=["Op1Add"], + opcode=[0xD8, 0x01], + operands=[]) +add_group("fcom", + cpu=["FPU"], + parsers=["nasm"], + modifiers=["Op1Add"], + opcode=[0xD8, 0x00], + operands=[Operand(type="ST0", size=80, dest=None), + Operand(type="Reg", size=80, dest="Op1Add")]) + +add_insn("fcom", "fcom", modifiers=[0xD0, 2]) +add_insn("fcomp", "fcom", modifiers=[0xD8, 3]) + +# +# extended comparisons +# +add_group("fcom2", + cpu=["FPU", "286"], + modifiers=["Op0Add", "Op1Add"], + opcode=[0x00, 0x00], + operands=[Operand(type="Reg", size=80, dest="Op1Add")]) +add_group("fcom2", + cpu=["FPU", "286"], + modifiers=["Op0Add", "Op1Add"], + opcode=[0x00, 0x00], + operands=[Operand(type="ST0", size=80, dest=None), + Operand(type="Reg", size=80, dest="Op1Add")]) + +add_insn("fucom", "fcom2", modifiers=[0xDD, 0xE0]) +add_insn("fucomp", "fcom2", modifiers=[0xDD, 0xE8]) + +# +# arithmetic +# +add_group("farith", + suffix="s", + cpu=["FPU"], + modifiers=["Gap", "Gap", "SpAdd"], + opcode=[0xD8], + spare=0, + operands=[Operand(type="Mem", size=32, dest="EA")]) +add_group("farith", + suffix="l", + cpu=["FPU"], + modifiers=["Gap", "Gap", "SpAdd"], + opcode=[0xDC], + spare=0, + operands=[Operand(type="Mem", size=64, dest="EA")]) +add_group("farith", + cpu=["FPU"], + modifiers=["Gap", "Op1Add"], + opcode=[0xD8, 0x00], + operands=[Operand(type="Reg", size=80, dest="Op1Add")]) +add_group("farith", + cpu=["FPU"], + modifiers=["Gap", "Op1Add"], + opcode=[0xD8, 0x00], + operands=[Operand(type="ST0", size=80, dest=None), + Operand(type="Reg", size=80, dest="Op1Add")]) +add_group("farith", + cpu=["FPU"], + modifiers=["Op1Add"], + opcode=[0xDC, 0x00], + operands=[Operand(type="Reg", size=80, tmod="To", dest="Op1Add")]) +add_group("farith", + cpu=["FPU"], + parsers=["nasm"], + modifiers=["Op1Add"], + opcode=[0xDC, 0x00], + operands=[Operand(type="Reg", size=80, dest="Op1Add"), + Operand(type="ST0", size=80, dest=None)]) +add_group("farith", + cpu=["FPU"], + parsers=["gas"], + modifiers=["Gap", "Op1Add"], + opcode=[0xDC, 0x00], + operands=[Operand(type="Reg", size=80, dest="Op1Add"), + Operand(type="ST0", size=80, dest=None)]) + +add_insn("fadd", "farith", modifiers=[0xC0, 0xC0, 0]) +add_insn("fsub", "farith", modifiers=[0xE8, 0xE0, 4]) +add_insn("fsubr", "farith", modifiers=[0xE0, 0xE8, 5]) +add_insn("fmul", "farith", modifiers=[0xC8, 0xC8, 1]) +add_insn("fdiv", "farith", modifiers=[0xF8, 0xF0, 6]) +add_insn("fdivr", "farith", modifiers=[0xF0, 0xF8, 7]) + +add_group("farithp", + cpu=["FPU"], + modifiers=["Op1Add"], + opcode=[0xDE, 0x01], + operands=[]) +add_group("farithp", + cpu=["FPU"], + modifiers=["Op1Add"], + opcode=[0xDE, 0x00], + operands=[Operand(type="Reg", size=80, dest="Op1Add")]) +add_group("farithp", + cpu=["FPU"], + modifiers=["Op1Add"], + opcode=[0xDE, 0x00], + operands=[Operand(type="Reg", size=80, dest="Op1Add"), + Operand(type="ST0", size=80, dest=None)]) + +add_insn("faddp", "farithp", modifiers=[0xC0]) +add_insn("fsubp", "farithp", parser="nasm", modifiers=[0xE8]) +add_insn("fsubp", "farithp", parser="gas", modifiers=[0xE0]) +add_insn("fsubrp", "farithp", parser="nasm", modifiers=[0xE0]) +add_insn("fsubrp", "farithp", parser="gas", modifiers=[0xE8]) +add_insn("fmulp", "farithp", modifiers=[0xC8]) +add_insn("fdivp", "farithp", parser="nasm", modifiers=[0xF8]) +add_insn("fdivp", "farithp", parser="gas", modifiers=[0xF0]) +add_insn("fdivrp", "farithp", parser="nasm", modifiers=[0xF0]) +add_insn("fdivrp", "farithp", parser="gas", modifiers=[0xF8]) + +# +# integer arith/store wo pop/compare +# +add_group("fiarith", + suffix="s", + cpu=["FPU"], + modifiers=["SpAdd", "Op0Add"], + opcode=[0x04], + spare=0, + operands=[Operand(type="Mem", size=16, dest="EA")]) +add_group("fiarith", + suffix="l", + cpu=["FPU"], + modifiers=["SpAdd", "Op0Add"], + opcode=[0x00], + spare=0, + operands=[Operand(type="Mem", size=32, dest="EA")]) + +add_insn("fist", "fiarith", modifiers=[2, 0xDB]) +add_insn("ficom", "fiarith", modifiers=[2, 0xDA]) +add_insn("ficomp", "fiarith", modifiers=[3, 0xDA]) +add_insn("fiadd", "fiarith", modifiers=[0, 0xDA]) +add_insn("fisub", "fiarith", modifiers=[4, 0xDA]) +add_insn("fisubr", "fiarith", modifiers=[5, 0xDA]) +add_insn("fimul", "fiarith", modifiers=[1, 0xDA]) +add_insn("fidiv", "fiarith", modifiers=[6, 0xDA]) +add_insn("fidivr", "fiarith", modifiers=[7, 0xDA]) + +# +# processor control +# +add_group("fldnstcw", + suffix="w", + cpu=["FPU"], + modifiers=["SpAdd"], + opcode=[0xD9], + spare=0, + operands=[Operand(type="Mem", size=16, relaxed=True, dest="EA")]) + +add_insn("fldcw", "fldnstcw", modifiers=[5]) +add_insn("fnstcw", "fldnstcw", modifiers=[7]) + +add_group("fstcw", + suffix="w", + cpu=["FPU"], + opcode=[0x9B, 0xD9], + spare=7, + operands=[Operand(type="Mem", size=16, relaxed=True, dest="EA")]) + +add_insn("fstcw", "fstcw") + +add_group("fnstsw", + suffix="w", + cpu=["FPU"], + opcode=[0xDD], + spare=7, + operands=[Operand(type="Mem", size=16, relaxed=True, dest="EA")]) +add_group("fnstsw", + suffix="w", + cpu=["FPU"], + opcode=[0xDF, 0xE0], + operands=[Operand(type="Areg", size=16, dest=None)]) + +add_insn("fnstsw", "fnstsw") + +add_group("fstsw", + suffix="w", + cpu=["FPU"], + opcode=[0x9B, 0xDD], + spare=7, + operands=[Operand(type="Mem", size=16, relaxed=True, dest="EA")]) +add_group("fstsw", + suffix="w", + cpu=["FPU"], + opcode=[0x9B, 0xDF, 0xE0], + operands=[Operand(type="Areg", size=16, dest=None)]) + +add_insn("fstsw", "fstsw") + +add_group("ffree", + cpu=["FPU"], + modifiers=["Op0Add"], + opcode=[0x00, 0xC0], + operands=[Operand(type="Reg", size=80, dest="Op1Add")]) + +add_insn("ffree", "ffree", modifiers=[0xDD]) +add_insn("ffreep", "ffree", modifiers=[0xDF], cpu=["686", "FPU", "Undoc"]) + +##################################################################### +# 486 extensions +##################################################################### +add_group("bswap", + suffix="l", + cpu=["486"], + opersize=32, + opcode=[0x0F, 0xC8], + operands=[Operand(type="Reg", size=32, dest="Op1Add")]) +add_group("bswap", + suffix="q", + opersize=64, + opcode=[0x0F, 0xC8], + operands=[Operand(type="Reg", size=64, dest="Op1Add")]) + +add_insn("bswap", "bswap") + +for sfx, sz in zip("bwlq", [8, 16, 32, 64]): + add_group("cmpxchgxadd", + suffix=sfx, + cpu=["486"], + modifiers=["Op1Add"], + opersize=sz, + opcode=[0x0F, 0x00+(sz!=8)], + operands=[Operand(type="RM", size=sz, relaxed=True, dest="EA"), + Operand(type="Reg", size=sz, dest="Spare")]) + +add_insn("xadd", "cmpxchgxadd", modifiers=[0xC0]) +add_insn("cmpxchg", "cmpxchgxadd", modifiers=[0xB0]) +add_insn("cmpxchg486", "cmpxchgxadd", parser="nasm", modifiers=[0xA6], + cpu=["486", "Undoc"]) + +add_insn("invd", "twobyte", modifiers=[0x0F, 0x08], cpu=["486", "Priv"]) +add_insn("wbinvd", "twobyte", modifiers=[0x0F, 0x09], cpu=["486", "Priv"]) +add_insn("invlpg", "twobytemem", modifiers=[7, 0x0F, 0x01], + cpu=["486", "Priv"]) + +##################################################################### +# 586+ and late 486 extensions +##################################################################### +add_insn("cpuid", "twobyte", modifiers=[0x0F, 0xA2], cpu=["486"]) + +##################################################################### +# Pentium extensions +##################################################################### +add_insn("wrmsr", "twobyte", modifiers=[0x0F, 0x30], cpu=["586", "Priv"]) +add_insn("rdtsc", "twobyte", modifiers=[0x0F, 0x31], cpu=["586"]) +add_insn("rdmsr", "twobyte", modifiers=[0x0F, 0x32], cpu=["586", "Priv"]) + +add_group("cmpxchg8b", + suffix="q", + cpu=["586"], + opcode=[0x0F, 0xC7], + spare=1, + operands=[Operand(type="Mem", size=64, relaxed=True, dest="EA")]) + +add_insn("cmpxchg8b", "cmpxchg8b") + +##################################################################### +# Pentium II/Pentium Pro extensions +##################################################################### +add_insn("sysenter", "twobyte", modifiers=[0x0F, 0x34], cpu=["686"], + not64=True) +add_insn("sysexit", "twobyte", modifiers=[0x0F, 0x35], cpu=["686", "Priv"], + not64=True) +for sfx in [None, "q"]: + add_insn("fxsave"+(sfx or ""), "twobytemem", suffix=sfx, + modifiers=[0, 0x0F, 0xAE], cpu=["686", "FPU"]) + add_insn("fxrstor"+(sfx or ""), "twobytemem", suffix=sfx, + modifiers=[1, 0x0F, 0xAE], cpu=["686", "FPU"]) +add_insn("rdpmc", "twobyte", modifiers=[0x0F, 0x33], cpu=["686"]) +add_insn("ud2", "twobyte", modifiers=[0x0F, 0x0B], cpu=["286"]) +add_insn("ud1", "twobyte", modifiers=[0x0F, 0xB9], cpu=["286", "Undoc"]) + +for sfx, sz in zip("wlq", [16, 32, 64]): + add_group("cmovcc", + suffix=sfx, + cpu=["686"], + modifiers=["Op1Add"], + opersize=sz, + opcode=[0x0F, 0x40], + operands=[Operand(type="Reg", size=sz, dest="Spare"), + Operand(type="RM", size=sz, relaxed=True, dest="EA")]) + +add_insn("cmovo", "cmovcc", modifiers=[0x00]) +add_insn("cmovno", "cmovcc", modifiers=[0x01]) +add_insn("cmovb", "cmovcc", modifiers=[0x02]) +add_insn("cmovc", "cmovcc", modifiers=[0x02]) +add_insn("cmovnae", "cmovcc", modifiers=[0x02]) +add_insn("cmovnb", "cmovcc", modifiers=[0x03]) +add_insn("cmovnc", "cmovcc", modifiers=[0x03]) +add_insn("cmovae", "cmovcc", modifiers=[0x03]) +add_insn("cmove", "cmovcc", modifiers=[0x04]) +add_insn("cmovz", "cmovcc", modifiers=[0x04]) +add_insn("cmovne", "cmovcc", modifiers=[0x05]) +add_insn("cmovnz", "cmovcc", modifiers=[0x05]) +add_insn("cmovbe", "cmovcc", modifiers=[0x06]) +add_insn("cmovna", "cmovcc", modifiers=[0x06]) +add_insn("cmovnbe", "cmovcc", modifiers=[0x07]) +add_insn("cmova", "cmovcc", modifiers=[0x07]) +add_insn("cmovs", "cmovcc", modifiers=[0x08]) +add_insn("cmovns", "cmovcc", modifiers=[0x09]) +add_insn("cmovp", "cmovcc", modifiers=[0x0A]) +add_insn("cmovpe", "cmovcc", modifiers=[0x0A]) +add_insn("cmovnp", "cmovcc", modifiers=[0x0B]) +add_insn("cmovpo", "cmovcc", modifiers=[0x0B]) +add_insn("cmovl", "cmovcc", modifiers=[0x0C]) +add_insn("cmovnge", "cmovcc", modifiers=[0x0C]) +add_insn("cmovnl", "cmovcc", modifiers=[0x0D]) +add_insn("cmovge", "cmovcc", modifiers=[0x0D]) +add_insn("cmovle", "cmovcc", modifiers=[0x0E]) +add_insn("cmovng", "cmovcc", modifiers=[0x0E]) +add_insn("cmovnle", "cmovcc", modifiers=[0x0F]) +add_insn("cmovg", "cmovcc", modifiers=[0x0F]) + +add_group("fcmovcc", + cpu=["FPU", "686"], + modifiers=["Op0Add", "Op1Add"], + opcode=[0x00, 0x00], + operands=[Operand(type="ST0", size=80, dest=None), + Operand(type="Reg", size=80, dest="Op1Add")]) + +add_insn("fcmovb", "fcmovcc", modifiers=[0xDA, 0xC0]) +add_insn("fcmove", "fcmovcc", modifiers=[0xDA, 0xC8]) +add_insn("fcmovbe", "fcmovcc", modifiers=[0xDA, 0xD0]) +add_insn("fcmovu", "fcmovcc", modifiers=[0xDA, 0xD8]) +add_insn("fcmovnb", "fcmovcc", modifiers=[0xDB, 0xC0]) +add_insn("fcmovne", "fcmovcc", modifiers=[0xDB, 0xC8]) +add_insn("fcmovnbe", "fcmovcc", modifiers=[0xDB, 0xD0]) +add_insn("fcmovnu", "fcmovcc", modifiers=[0xDB, 0xD8]) + +add_insn("fcomi", "fcom2", modifiers=[0xDB, 0xF0], cpu=["686", "FPU"]) +add_insn("fucomi", "fcom2", modifiers=[0xDB, 0xE8], cpu=["686", "FPU"]) +add_insn("fcomip", "fcom2", modifiers=[0xDF, 0xF0], cpu=["686", "FPU"]) +add_insn("fucomip", "fcom2", modifiers=[0xDF, 0xE8], cpu=["686", "FPU"]) + +##################################################################### +# Pentium4 extensions +##################################################################### +add_group("movnti", + suffix="l", + cpu=["P4"], + opcode=[0x0F, 0xC3], + operands=[Operand(type="Mem", size=32, relaxed=True, dest="EA"), + Operand(type="Reg", size=32, dest="Spare")]) +add_group("movnti", + suffix="q", + cpu=["P4"], + opersize=64, + opcode=[0x0F, 0xC3], + operands=[Operand(type="Mem", size=64, relaxed=True, dest="EA"), + Operand(type="Reg", size=64, dest="Spare")]) + +add_insn("movnti", "movnti") + +add_group("clflush", + cpu=["P3"], + opcode=[0x0F, 0xAE], + spare=7, + operands=[Operand(type="Mem", size=8, relaxed=True, dest="EA")]) + +add_insn("clflush", "clflush") + +add_insn("lfence", "threebyte", modifiers=[0x0F, 0xAE, 0xE8], cpu=["P3"]) +add_insn("mfence", "threebyte", modifiers=[0x0F, 0xAE, 0xF0], cpu=["P3"]) +add_insn("pause", "onebyte_prefix", modifiers=[0xF3, 0x90], cpu=["P4"]) + +##################################################################### +# MMX/SSE2 instructions +##################################################################### + +add_insn("emms", "twobyte", modifiers=[0x0F, 0x77], cpu=["MMX"]) + +# +# movd +# +add_group("movd", + cpu=["MMX"], + opcode=[0x0F, 0x6E], + operands=[Operand(type="SIMDReg", size=64, dest="Spare"), + Operand(type="RM", size=32, relaxed=True, dest="EA")]) +add_group("movd", + cpu=["MMX"], + opersize=64, + opcode=[0x0F, 0x6E], + operands=[Operand(type="SIMDReg", size=64, dest="Spare"), + Operand(type="RM", size=64, relaxed=True, dest="EA")]) +add_group("movd", + cpu=["MMX"], + opcode=[0x0F, 0x7E], + operands=[Operand(type="RM", size=32, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=64, dest="Spare")]) +add_group("movd", + cpu=["MMX"], + opersize=64, + opcode=[0x0F, 0x7E], + operands=[Operand(type="RM", size=64, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=64, dest="Spare")]) +add_group("movd", + cpu=["SSE2"], + prefix=0x66, + opcode=[0x0F, 0x6E], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="RM", size=32, relaxed=True, dest="EA")]) +add_group("movd", + cpu=["SSE2"], + opersize=64, + prefix=0x66, + opcode=[0x0F, 0x6E], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="RM", size=64, relaxed=True, dest="EA")]) +add_group("movd", + cpu=["SSE2"], + prefix=0x66, + opcode=[0x0F, 0x7E], + operands=[Operand(type="RM", size=32, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="Spare")]) +add_group("movd", + cpu=["SSE2"], + opersize=64, + prefix=0x66, + opcode=[0x0F, 0x7E], + operands=[Operand(type="RM", size=64, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="Spare")]) + +add_insn("movd", "movd") + +# +# movq +# + +# MMX forms +add_group("movq", + cpu=["MMX"], + parsers=["nasm"], + opcode=[0x0F, 0x6F], + operands=[Operand(type="SIMDReg", size=64, dest="Spare"), + Operand(type="SIMDRM", size=64, relaxed=True, dest="EA")]) +add_group("movq", + cpu=["MMX"], + parsers=["nasm"], + opersize=64, + opcode=[0x0F, 0x6E], + operands=[Operand(type="SIMDReg", size=64, dest="Spare"), + Operand(type="RM", size=64, relaxed=True, dest="EA")]) +add_group("movq", + cpu=["MMX"], + parsers=["nasm"], + opcode=[0x0F, 0x7F], + operands=[Operand(type="SIMDRM", size=64, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=64, dest="Spare")]) +add_group("movq", + cpu=["MMX"], + parsers=["nasm"], + opersize=64, + opcode=[0x0F, 0x7E], + operands=[Operand(type="RM", size=64, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=64, dest="Spare")]) + +# SSE2 forms +add_group("movq", + cpu=["SSE2"], + parsers=["nasm"], + prefix=0xF3, + opcode=[0x0F, 0x7E], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA")]) +add_group("movq", + cpu=["SSE2"], + parsers=["nasm"], + prefix=0xF3, + opcode=[0x0F, 0x7E], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=64, relaxed=True, dest="EA")]) +add_group("movq", + cpu=["SSE2"], + parsers=["nasm"], + opersize=64, + prefix=0x66, + opcode=[0x0F, 0x6E], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="RM", size=64, relaxed=True, dest="EA")]) +add_group("movq", + cpu=["SSE2"], + parsers=["nasm"], + prefix=0x66, + opcode=[0x0F, 0xD6], + operands=[Operand(type="SIMDRM", size=64, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="Spare")]) +add_group("movq", + cpu=["SSE2"], + parsers=["nasm"], + opersize=64, + prefix=0x66, + opcode=[0x0F, 0x7E], + operands=[Operand(type="RM", size=64, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="Spare")]) + +add_insn("movq", "movq") + +add_group("mmxsse2", + cpu=["MMX"], + modifiers=["Op1Add"], + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=64, dest="Spare"), + Operand(type="SIMDRM", size=64, relaxed=True, dest="EA")]) +add_group("mmxsse2", + cpu=["SSE2"], + modifiers=["Op1Add"], + prefix=0x66, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) + +add_insn("packssdw", "mmxsse2", modifiers=[0x6B]) +add_insn("packsswb", "mmxsse2", modifiers=[0x63]) +add_insn("packuswb", "mmxsse2", modifiers=[0x67]) +add_insn("paddb", "mmxsse2", modifiers=[0xFC]) +add_insn("paddw", "mmxsse2", modifiers=[0xFD]) +add_insn("paddd", "mmxsse2", modifiers=[0xFE]) +add_insn("paddq", "mmxsse2", modifiers=[0xD4]) +add_insn("paddsb", "mmxsse2", modifiers=[0xEC]) +add_insn("paddsw", "mmxsse2", modifiers=[0xED]) +add_insn("paddusb", "mmxsse2", modifiers=[0xDC]) +add_insn("paddusw", "mmxsse2", modifiers=[0xDD]) +add_insn("pand", "mmxsse2", modifiers=[0xDB]) +add_insn("pandn", "mmxsse2", modifiers=[0xDF]) +add_insn("pcmpeqb", "mmxsse2", modifiers=[0x74]) +add_insn("pcmpeqw", "mmxsse2", modifiers=[0x75]) +add_insn("pcmpeqd", "mmxsse2", modifiers=[0x76]) +add_insn("pcmpgtb", "mmxsse2", modifiers=[0x64]) +add_insn("pcmpgtw", "mmxsse2", modifiers=[0x65]) +add_insn("pcmpgtd", "mmxsse2", modifiers=[0x66]) +add_insn("pmaddwd", "mmxsse2", modifiers=[0xF5]) +add_insn("pmulhw", "mmxsse2", modifiers=[0xE5]) +add_insn("pmullw", "mmxsse2", modifiers=[0xD5]) +add_insn("por", "mmxsse2", modifiers=[0xEB]) +add_insn("psubb", "mmxsse2", modifiers=[0xF8]) +add_insn("psubw", "mmxsse2", modifiers=[0xF9]) +add_insn("psubd", "mmxsse2", modifiers=[0xFA]) +add_insn("psubq", "mmxsse2", modifiers=[0xFB]) +add_insn("psubsb", "mmxsse2", modifiers=[0xE8]) +add_insn("psubsw", "mmxsse2", modifiers=[0xE9]) +add_insn("psubusb", "mmxsse2", modifiers=[0xD8]) +add_insn("psubusw", "mmxsse2", modifiers=[0xD9]) +add_insn("punpckhbw", "mmxsse2", modifiers=[0x68]) +add_insn("punpckhwd", "mmxsse2", modifiers=[0x69]) +add_insn("punpckhdq", "mmxsse2", modifiers=[0x6A]) +add_insn("punpcklbw", "mmxsse2", modifiers=[0x60]) +add_insn("punpcklwd", "mmxsse2", modifiers=[0x61]) +add_insn("punpckldq", "mmxsse2", modifiers=[0x62]) +add_insn("pxor", "mmxsse2", modifiers=[0xEF]) + +add_group("pshift", + cpu=["MMX"], + modifiers=["Op1Add"], + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=64, dest="Spare"), + Operand(type="SIMDRM", size=64, relaxed=True, dest="EA")]) +add_group("pshift", + cpu=["MMX"], + modifiers=["Gap", "Op1Add", "SpAdd"], + opcode=[0x0F, 0x00], + spare=0, + operands=[Operand(type="SIMDReg", size=64, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("pshift", + cpu=["SSE2"], + modifiers=["Op1Add"], + prefix=0x66, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) +add_group("pshift", + cpu=["SSE2"], + modifiers=["Gap", "Op1Add", "SpAdd"], + prefix=0x66, + opcode=[0x0F, 0x00], + spare=0, + operands=[Operand(type="SIMDReg", size=128, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + +add_insn("psllw", "pshift", modifiers=[0xF1, 0x71, 6]) +add_insn("pslld", "pshift", modifiers=[0xF2, 0x72, 6]) +add_insn("psllq", "pshift", modifiers=[0xF3, 0x73, 6]) +add_insn("psraw", "pshift", modifiers=[0xE1, 0x71, 4]) +add_insn("psrad", "pshift", modifiers=[0xE2, 0x72, 4]) +add_insn("psrlw", "pshift", modifiers=[0xD1, 0x71, 2]) +add_insn("psrld", "pshift", modifiers=[0xD2, 0x72, 2]) +add_insn("psrlq", "pshift", modifiers=[0xD3, 0x73, 2]) + +# +# PIII (Katmai) new instructions / SIMD instructions +# +add_insn("pavgb", "mmxsse2", modifiers=[0xE0], cpu=["P3", "MMX"]) +add_insn("pavgw", "mmxsse2", modifiers=[0xE3], cpu=["P3", "MMX"]) +add_insn("pmaxsw", "mmxsse2", modifiers=[0xEE], cpu=["P3", "MMX"]) +add_insn("pmaxub", "mmxsse2", modifiers=[0xDE], cpu=["P3", "MMX"]) +add_insn("pminsw", "mmxsse2", modifiers=[0xEA], cpu=["P3", "MMX"]) +add_insn("pminub", "mmxsse2", modifiers=[0xDA], cpu=["P3", "MMX"]) +add_insn("pmulhuw", "mmxsse2", modifiers=[0xE4], cpu=["P3", "MMX"]) +add_insn("psadbw", "mmxsse2", modifiers=[0xF6], cpu=["P3", "MMX"]) + +add_insn("prefetchnta", "twobytemem", modifiers=[0, 0x0F, 0x18], cpu=["P3"]) +add_insn("prefetcht0", "twobytemem", modifiers=[1, 0x0F, 0x18], cpu=["P3"]) +add_insn("prefetcht1", "twobytemem", modifiers=[2, 0x0F, 0x18], cpu=["P3"]) +add_insn("prefetcht2", "twobytemem", modifiers=[3, 0x0F, 0x18], cpu=["P3"]) + +add_insn("sfence", "threebyte", modifiers=[0x0F, 0xAE, 0xF8], cpu=["P3"]) + +add_group("sseps", + cpu=["SSE"], + modifiers=["Op1Add"], + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) + +add_insn("addps", "sseps", modifiers=[0x58]) +add_insn("andnps", "sseps", modifiers=[0x55]) +add_insn("andps", "sseps", modifiers=[0x54]) +add_insn("comiss", "sseps", modifiers=[0x2F]) +add_insn("divps", "sseps", modifiers=[0x5E]) +add_insn("maxps", "sseps", modifiers=[0x5F]) +add_insn("minps", "sseps", modifiers=[0x5D]) +add_insn("mulps", "sseps", modifiers=[0x59]) +add_insn("orps", "sseps", modifiers=[0x56]) +add_insn("rcpps", "sseps", modifiers=[0x53]) +add_insn("rsqrtps", "sseps", modifiers=[0x52]) +add_insn("sqrtps", "sseps", modifiers=[0x51]) +add_insn("subps", "sseps", modifiers=[0x5C]) +add_insn("unpckhps", "sseps", modifiers=[0x15]) +add_insn("unpcklps", "sseps", modifiers=[0x14]) +add_insn("xorps", "sseps", modifiers=[0x57]) + +add_group("cvt_rx_xmm32", + suffix="l", + cpu=["SSE"], + modifiers=["PreAdd", "Op1Add"], + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="Reg", size=32, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA")]) +add_group("cvt_rx_xmm32", + suffix="l", + cpu=["SSE"], + modifiers=["PreAdd", "Op1Add"], + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="Reg", size=32, dest="Spare"), + Operand(type="Mem", size=32, relaxed=True, dest="EA")]) +# REX +add_group("cvt_rx_xmm32", + suffix="q", + cpu=["SSE"], + modifiers=["PreAdd", "Op1Add"], + opersize=64, + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="Reg", size=64, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA")]) +add_group("cvt_rx_xmm32", + suffix="q", + cpu=["SSE"], + modifiers=["PreAdd", "Op1Add"], + opersize=64, + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="Reg", size=64, dest="Spare"), + Operand(type="Mem", size=32, relaxed=True, dest="EA")]) + +add_insn("cvtss2si", "cvt_rx_xmm32", modifiers=[0xF3, 0x2D]) +add_insn("cvttss2si", "cvt_rx_xmm32", modifiers=[0xF3, 0x2C]) + +add_group("cvt_mm_xmm64", + cpu=["SSE"], + modifiers=["Op1Add"], + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=64, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA")]) +add_group("cvt_mm_xmm64", + cpu=["SSE"], + modifiers=["Op1Add"], + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=64, dest="Spare"), + Operand(type="Mem", size=64, relaxed=True, dest="EA")]) + +add_insn("cvtps2pi", "cvt_mm_xmm64", modifiers=[0x2D]) +add_insn("cvttps2pi", "cvt_mm_xmm64", modifiers=[0x2C]) + +add_group("cvt_xmm_mm_ps", + cpu=["SSE"], + modifiers=["Op1Add"], + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=64, relaxed=True, dest="EA")]) + +add_insn("cvtpi2ps", "cvt_xmm_mm_ps", modifiers=[0x2A]) + +add_group("cvt_xmm_rmx", + suffix="l", + cpu=["SSE"], + modifiers=["PreAdd", "Op1Add"], + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="RM", size=32, relaxed=True, dest="EA")]) +# REX +add_group("cvt_xmm_rmx", + suffix="q", + cpu=["SSE"], + modifiers=["PreAdd", "Op1Add"], + opersize=64, + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="RM", size=64, relaxed=True, dest="EA")]) + +add_insn("cvtsi2ss", "cvt_xmm_rmx", modifiers=[0xF3, 0x2A]) + +add_group("ssess", + cpu=["SSE"], + modifiers=["PreAdd", "Op1Add"], + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) + +add_insn("addss", "ssess", modifiers=[0xF3, 0x58]) +add_insn("divss", "ssess", modifiers=[0xF3, 0x5E]) +add_insn("maxss", "ssess", modifiers=[0xF3, 0x5F]) +add_insn("minss", "ssess", modifiers=[0xF3, 0x5D]) +add_insn("mulss", "ssess", modifiers=[0xF3, 0x59]) +add_insn("rcpss", "ssess", modifiers=[0xF3, 0x53]) +add_insn("rsqrtss", "ssess", modifiers=[0xF3, 0x52]) +add_insn("sqrtss", "ssess", modifiers=[0xF3, 0x51]) +add_insn("subss", "ssess", modifiers=[0xF3, 0x5C]) +add_insn("ucomiss", "ssess", modifiers=[0, 0x2E]) + +add_group("ssecmpps", + cpu=["SSE"], + modifiers=["Imm8"], + opcode=[0x0F, 0xC2], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) + +add_insn("cmpeqps", "ssecmpps", modifiers=[0x00]) +add_insn("cmpleps", "ssecmpps", modifiers=[0x02]) +add_insn("cmpltps", "ssecmpps", modifiers=[0x01]) +add_insn("cmpneqps", "ssecmpps", modifiers=[0x04]) +add_insn("cmpnleps", "ssecmpps", modifiers=[0x06]) +add_insn("cmpnltps", "ssecmpps", modifiers=[0x05]) +add_insn("cmpordps", "ssecmpps", modifiers=[0x07]) +add_insn("cmpunordps", "ssecmpps", modifiers=[0x03]) + +add_group("ssecmpss", + cpu=["SSE"], + modifiers=["Imm8", "PreAdd"], + prefix=0x00, + opcode=[0x0F, 0xC2], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) + +add_insn("cmpeqss", "ssecmpss", modifiers=[0, 0xF3]) +add_insn("cmpless", "ssecmpss", modifiers=[2, 0xF3]) +add_insn("cmpltss", "ssecmpss", modifiers=[1, 0xF3]) +add_insn("cmpneqss", "ssecmpss", modifiers=[4, 0xF3]) +add_insn("cmpnless", "ssecmpss", modifiers=[6, 0xF3]) +add_insn("cmpnltss", "ssecmpss", modifiers=[5, 0xF3]) +add_insn("cmpordss", "ssecmpss", modifiers=[7, 0xF3]) +add_insn("cmpunordss", "ssecmpss", modifiers=[3, 0xF3]) + +add_group("ssepsimm", + cpu=["SSE"], + modifiers=["Op1Add"], + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + +add_insn("cmpps", "ssepsimm", modifiers=[0xC2]) +add_insn("shufps", "ssepsimm", modifiers=[0xC6]) + +add_group("ssessimm", + cpu=["SSE"], + modifiers=["PreAdd", "Op1Add"], + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + +add_insn("cmpss", "ssessimm", modifiers=[0xF3, 0xC2]) + +add_group("ldstmxcsr", + cpu=["SSE"], + modifiers=["SpAdd"], + opcode=[0x0F, 0xAE], + spare=0, + operands=[Operand(type="Mem", size=32, relaxed=True, dest="EA")]) + +add_insn("ldmxcsr", "ldstmxcsr", modifiers=[2]) +add_insn("stmxcsr", "ldstmxcsr", modifiers=[3]) + +add_group("maskmovq", + cpu=["MMX", "P3"], + opcode=[0x0F, 0xF7], + operands=[Operand(type="SIMDReg", size=64, dest="Spare"), + Operand(type="SIMDReg", size=64, dest="EA")]) + +add_insn("maskmovq", "maskmovq") + +add_group("movaups", + cpu=["SSE"], + modifiers=["Op1Add"], + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) +add_group("movaups", + cpu=["SSE"], + modifiers=["Op1Add"], + opcode=[0x0F, 0x01], + operands=[Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="Spare")]) + +add_insn("movaps", "movaups", modifiers=[0x28]) +add_insn("movups", "movaups", modifiers=[0x10]) + +add_group("movhllhps", + cpu=["SSE"], + modifiers=["Op1Add"], + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA")]) + +add_insn("movhlps", "movhllhps", modifiers=[0x12]) +add_insn("movlhps", "movhllhps", modifiers=[0x16]) + +add_group("movhlps", + cpu=["SSE"], + modifiers=["Op1Add"], + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Mem", size=64, relaxed=True, dest="EA")]) +add_group("movhlps", + cpu=["SSE"], + modifiers=["Op1Add"], + opcode=[0x0F, 0x01], + operands=[Operand(type="Mem", size=64, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="Spare")]) + +add_insn("movhps", "movhlps", modifiers=[0x16]) +add_insn("movlps", "movhlps", modifiers=[0x12]) + +add_group("movmskps", + suffix="l", + cpu=["SSE"], + opcode=[0x0F, 0x50], + operands=[Operand(type="Reg", size=32, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA")]) +add_group("movmskps", + suffix="q", + cpu=["SSE"], + opersize=64, + opcode=[0x0F, 0x50], + operands=[Operand(type="Reg", size=64, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA")]) + +add_insn("movmskps", "movmskps") + +add_group("movntps", + cpu=["SSE"], + opcode=[0x0F, 0x2B], + operands=[Operand(type="Mem", size=128, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="Spare")]) + +add_insn("movntps", "movntps") + +add_group("movntq", + cpu=["SSE"], + opcode=[0x0F, 0xE7], + operands=[Operand(type="Mem", size=64, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=64, dest="Spare")]) + +add_insn("movntq", "movntq") + +add_group("movss", + cpu=["SSE"], + prefix=0xF3, + opcode=[0x0F, 0x10], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA")]) +add_group("movss", + cpu=["SSE"], + prefix=0xF3, + opcode=[0x0F, 0x10], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Mem", size=32, relaxed=True, dest="EA")]) +add_group("movss", + cpu=["SSE"], + prefix=0xF3, + opcode=[0x0F, 0x11], + operands=[Operand(type="Mem", size=32, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="Spare")]) + +add_insn("movss", "movss") + +add_group("pextrw", + suffix="l", + cpu=["MMX", "P3"], + opcode=[0x0F, 0xC5], + operands=[Operand(type="Reg", size=32, dest="Spare"), + Operand(type="SIMDReg", size=64, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("pextrw", + suffix="l", + cpu=["SSE2"], + prefix=0x66, + opcode=[0x0F, 0xC5], + operands=[Operand(type="Reg", size=32, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("pextrw", + suffix="q", + cpu=["MMX", "P3"], + opersize=64, + opcode=[0x0F, 0xC5], + operands=[Operand(type="Reg", size=64, dest="Spare"), + Operand(type="SIMDReg", size=64, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("pextrw", + suffix="q", + cpu=["SSE2"], + opersize=64, + prefix=0x66, + opcode=[0x0F, 0xC5], + operands=[Operand(type="Reg", size=64, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +# SSE41 instructions +add_group("pextrw", + cpu=["SSE41"], + prefix=0x66, + opcode=[0x0F, 0x3A, 0x15], + operands=[Operand(type="Mem", size=16, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("pextrw", + cpu=["SSE41"], + opersize=32, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x15], + operands=[Operand(type="Reg", size=32, dest="EA"), + Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("pextrw", + cpu=["SSE41"], + opersize=64, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x15], + operands=[Operand(type="Reg", size=64, dest="EA"), + Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + +add_insn("pextrw", "pextrw") + +add_group("pinsrw", + suffix="l", + cpu=["MMX", "P3"], + opcode=[0x0F, 0xC4], + operands=[Operand(type="SIMDReg", size=64, dest="Spare"), + Operand(type="Reg", size=32, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("pinsrw", + suffix="q", + cpu=["MMX", "P3"], + opersize=64, + opcode=[0x0F, 0xC4], + operands=[Operand(type="SIMDReg", size=64, dest="Spare"), + Operand(type="Reg", size=64, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("pinsrw", + suffix="l", + cpu=["MMX", "P3"], + opcode=[0x0F, 0xC4], + operands=[Operand(type="SIMDReg", size=64, dest="Spare"), + Operand(type="Mem", size=16, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("pinsrw", + suffix="l", + cpu=["SSE2"], + prefix=0x66, + opcode=[0x0F, 0xC4], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Reg", size=32, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("pinsrw", + suffix="q", + cpu=["SSE2"], + opersize=64, + prefix=0x66, + opcode=[0x0F, 0xC4], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Reg", size=64, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("pinsrw", + suffix="l", + cpu=["SSE2"], + prefix=0x66, + opcode=[0x0F, 0xC4], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Mem", size=16, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + +add_insn("pinsrw", "pinsrw") + +add_group("pmovmskb", + suffix="l", + cpu=["MMX", "P3"], + opcode=[0x0F, 0xD7], + operands=[Operand(type="Reg", size=32, dest="Spare"), + Operand(type="SIMDReg", size=64, dest="EA")]) +add_group("pmovmskb", + suffix="l", + cpu=["SSE2"], + prefix=0x66, + opcode=[0x0F, 0xD7], + operands=[Operand(type="Reg", size=32, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA")]) +add_group("pmovmskb", + suffix="q", + cpu=["MMX", "P3"], + opersize=64, + opcode=[0x0F, 0xD7], + operands=[Operand(type="Reg", size=64, dest="Spare"), + Operand(type="SIMDReg", size=64, dest="EA")]) +add_group("pmovmskb", + suffix="q", + cpu=["SSE2"], + opersize=64, + prefix=0x66, + opcode=[0x0F, 0xD7], + operands=[Operand(type="Reg", size=64, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA")]) + +add_insn("pmovmskb", "pmovmskb") + +add_group("pshufw", + cpu=["MMX", "P3"], + opcode=[0x0F, 0x70], + operands=[Operand(type="SIMDReg", size=64, dest="Spare"), + Operand(type="SIMDRM", size=64, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + +add_insn("pshufw", "pshufw") + +##################################################################### +# SSE2 instructions +##################################################################### +add_insn("addpd", "ssess", modifiers=[0x66, 0x58], cpu=["SSE2"]) +add_insn("addsd", "ssess", modifiers=[0xF2, 0x58], cpu=["SSE2"]) +add_insn("andnpd", "ssess", modifiers=[0x66, 0x55], cpu=["SSE2"]) +add_insn("andpd", "ssess", modifiers=[0x66, 0x54], cpu=["SSE2"]) +add_insn("comisd", "ssess", modifiers=[0x66, 0x2F], cpu=["SSE2"]) +add_insn("divpd", "ssess", modifiers=[0x66, 0x5E], cpu=["SSE2"]) +add_insn("divsd", "ssess", modifiers=[0xF2, 0x5E], cpu=["SSE2"]) +add_insn("maxpd", "ssess", modifiers=[0x66, 0x5F], cpu=["SSE2"]) +add_insn("maxsd", "ssess", modifiers=[0xF2, 0x5F], cpu=["SSE2"]) +add_insn("minpd", "ssess", modifiers=[0x66, 0x5D], cpu=["SSE2"]) +add_insn("minsd", "ssess", modifiers=[0xF2, 0x5D], cpu=["SSE2"]) +add_insn("mulpd", "ssess", modifiers=[0x66, 0x59], cpu=["SSE2"]) +add_insn("mulsd", "ssess", modifiers=[0xF2, 0x59], cpu=["SSE2"]) +add_insn("orpd", "ssess", modifiers=[0x66, 0x56], cpu=["SSE2"]) +add_insn("sqrtpd", "ssess", modifiers=[0x66, 0x51], cpu=["SSE2"]) +add_insn("sqrtsd", "ssess", modifiers=[0xF2, 0x51], cpu=["SSE2"]) +add_insn("subpd", "ssess", modifiers=[0x66, 0x5C], cpu=["SSE2"]) +add_insn("subsd", "ssess", modifiers=[0xF2, 0x5C], cpu=["SSE2"]) +add_insn("ucomisd", "ssess", modifiers=[0x66, 0x2E], cpu=["SSE2"]) +add_insn("unpckhpd", "ssess", modifiers=[0x66, 0x15], cpu=["SSE2"]) +add_insn("unpcklpd", "ssess", modifiers=[0x66, 0x14], cpu=["SSE2"]) +add_insn("xorpd", "ssess", modifiers=[0x66, 0x57], cpu=["SSE2"]) +add_insn("cvtpd2dq", "ssess", modifiers=[0xF2, 0xE6], cpu=["SSE2"]) +add_insn("cvtpd2ps", "ssess", modifiers=[0x66, 0x5A], cpu=["SSE2"]) +add_insn("cvtps2dq", "ssess", modifiers=[0x66, 0x5B], cpu=["SSE2"]) + +add_insn("cvtdq2ps", "sseps", modifiers=[0x5B], cpu=["SSE2"]) + +add_insn("cmpeqpd", "ssecmpss", modifiers=[0x00, 0x66], cpu=["SSE2"]) +add_insn("cmpeqsd", "ssecmpss", modifiers=[0x00, 0xF2], cpu=["SSE2"]) +add_insn("cmplepd", "ssecmpss", modifiers=[0x02, 0x66], cpu=["SSE2"]) +add_insn("cmplesd", "ssecmpss", modifiers=[0x02, 0xF2], cpu=["SSE2"]) +add_insn("cmpltpd", "ssecmpss", modifiers=[0x01, 0x66], cpu=["SSE2"]) +add_insn("cmpltsd", "ssecmpss", modifiers=[0x01, 0xF2], cpu=["SSE2"]) +add_insn("cmpneqpd", "ssecmpss", modifiers=[0x04, 0x66], cpu=["SSE2"]) +add_insn("cmpneqsd", "ssecmpss", modifiers=[0x04, 0xF2], cpu=["SSE2"]) +add_insn("cmpnlepd", "ssecmpss", modifiers=[0x06, 0x66], cpu=["SSE2"]) +add_insn("cmpnlesd", "ssecmpss", modifiers=[0x06, 0xF2], cpu=["SSE2"]) +add_insn("cmpnltpd", "ssecmpss", modifiers=[0x05, 0x66], cpu=["SSE2"]) +add_insn("cmpnltsd", "ssecmpss", modifiers=[0x05, 0xF2], cpu=["SSE2"]) +add_insn("cmpordpd", "ssecmpss", modifiers=[0x07, 0x66], cpu=["SSE2"]) +add_insn("cmpordsd", "ssecmpss", modifiers=[0x07, 0xF2], cpu=["SSE2"]) +add_insn("cmpunordpd", "ssecmpss", modifiers=[0x03, 0x66], cpu=["SSE2"]) +add_insn("cmpunordsd", "ssecmpss", modifiers=[0x03, 0xF2], cpu=["SSE2"]) + +add_insn("cmppd", "ssessimm", modifiers=[0x66, 0xC2], cpu=["SSE2"]) +add_insn("shufpd", "ssessimm", modifiers=[0x66, 0xC6], cpu=["SSE2"]) + +add_insn("cvtsi2sd", "cvt_xmm_rmx", modifiers=[0xF2, 0x2A], cpu=["SSE2"]) + +add_group("cvt_xmm_xmm64_ss", + cpu=["SSE2"], + modifiers=["PreAdd", "Op1Add"], + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA")]) +add_group("cvt_xmm_xmm64_ss", + cpu=["SSE2"], + modifiers=["PreAdd", "Op1Add"], + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Mem", size=64, relaxed=True, dest="EA")]) + +add_insn("cvtdq2pd", "cvt_xmm_xmm64_ss", modifiers=[0xF3, 0xE6]) +add_insn("cvtsd2ss", "cvt_xmm_xmm64_ss", modifiers=[0xF2, 0x5A]) + +add_group("cvt_xmm_xmm64_ps", + cpu=["SSE2"], + modifiers=["Op1Add"], + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA")]) +add_group("cvt_xmm_xmm64_ps", + cpu=["SSE2"], + modifiers=["Op1Add"], + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Mem", size=64, relaxed=True, dest="EA")]) + +add_insn("cvtps2pd", "cvt_xmm_xmm64_ps", modifiers=[0x5A]) + +add_group("cvt_rx_xmm64", + suffix="l", + cpu=["SSE2"], + modifiers=["PreAdd", "Op1Add"], + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="Reg", size=32, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA")]) +add_group("cvt_rx_xmm64", + suffix="l", + cpu=["SSE2"], + modifiers=["PreAdd", "Op1Add"], + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="Reg", size=32, dest="Spare"), + Operand(type="Mem", size=64, relaxed=True, dest="EA")]) +# REX +add_group("cvt_rx_xmm64", + suffix="q", + cpu=["SSE2"], + modifiers=["PreAdd", "Op1Add"], + opersize=64, + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="Reg", size=64, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA")]) +add_group("cvt_rx_xmm64", + suffix="q", + cpu=["SSE2"], + modifiers=["PreAdd", "Op1Add"], + opersize=64, + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="Reg", size=64, dest="Spare"), + Operand(type="Mem", size=64, relaxed=True, dest="EA")]) + +add_insn("cvtsd2si", "cvt_rx_xmm64", modifiers=[0xF2, 0x2D]) + +add_group("cvt_mm_xmm", + cpu=["SSE2"], + modifiers=["PreAdd", "Op1Add"], + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=64, dest="Spare"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) + +add_insn("cvtpd2pi", "cvt_mm_xmm", modifiers=[0x66, 0x2D], cpu=["SSE2"]) + +add_group("cvt_xmm_mm_ss", + cpu=["SSE"], + modifiers=["PreAdd", "Op1Add"], + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=64, relaxed=True, dest="EA")]) + +add_insn("cvtpi2pd", "cvt_xmm_mm_ss", modifiers=[0x66, 0x2A], cpu=["SSE2"]) + +# cmpsd SSE2 form +add_group("cmpsd", + cpu=["SSE2"], + prefix=0xF2, + opcode=[0x0F, 0xC2], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +# cmpsd is added in string instructions above, so don't re-add_insn() + +add_group("movaupd", + cpu=["SSE2"], + modifiers=["Op1Add"], + prefix=0x66, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) +add_group("movaupd", + cpu=["SSE2"], + modifiers=["Op1Add"], + prefix=0x66, + opcode=[0x0F, 0x01], + operands=[Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="Spare")]) + +add_insn("movapd", "movaupd", modifiers=[0x28]) +add_insn("movupd", "movaupd", modifiers=[0x10]) + +add_group("movhlpd", + cpu=["SSE2"], + modifiers=["Op1Add"], + prefix=0x66, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Mem", size=64, relaxed=True, dest="EA")]) +add_group("movhlpd", + cpu=["SSE2"], + modifiers=["Op1Add"], + prefix=0x66, + opcode=[0x0F, 0x01], + operands=[Operand(type="Mem", size=64, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="Spare")]) + +add_insn("movhpd", "movhlpd", modifiers=[0x16]) +add_insn("movlpd", "movhlpd", modifiers=[0x12]) + +add_group("movmskpd", + suffix="l", + cpu=["SSE2"], + prefix=0x66, + opcode=[0x0F, 0x50], + operands=[Operand(type="Reg", size=32, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA")]) +add_group("movmskpd", + suffix="q", + cpu=["SSE2"], + prefix=0x66, + opcode=[0x0F, 0x50], + operands=[Operand(type="Reg", size=64, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA")]) + +add_insn("movmskpd", "movmskpd") + +add_group("movntpddq", + cpu=["SSE2"], + modifiers=["Op1Add"], + prefix=0x66, + opcode=[0x0F, 0x00], + operands=[Operand(type="Mem", size=128, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="Spare")]) + +add_insn("movntpd", "movntpddq", modifiers=[0x2B]) +add_insn("movntdq", "movntpddq", modifiers=[0xE7]) + +# movsd SSE2 forms +add_group("movsd", + cpu=["SSE2"], + prefix=0xF2, + opcode=[0x0F, 0x10], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA")]) +add_group("movsd", + cpu=["SSE2"], + prefix=0xF2, + opcode=[0x0F, 0x10], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Mem", size=64, relaxed=True, dest="EA")]) +add_group("movsd", + cpu=["SSE2"], + prefix=0xF2, + opcode=[0x0F, 0x11], + operands=[Operand(type="Mem", size=64, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="Spare")]) +# movsd is added in string instructions above, so don't re-add_insn() + +##################################################################### +# P4 VMX Instructions +##################################################################### + +add_insn("vmcall", "threebyte", modifiers=[0x0F, 0x01, 0xC1], cpu=["P4"]) +add_insn("vmlaunch", "threebyte", modifiers=[0x0F, 0x01, 0xC2], cpu=["P4"]) +add_insn("vmresume", "threebyte", modifiers=[0x0F, 0x01, 0xC3], cpu=["P4"]) +add_insn("vmxoff", "threebyte", modifiers=[0x0F, 0x01, 0xC4], cpu=["P4"]) + +add_group("vmxmemrd", + suffix="l", + not64=True, + cpu=["P4"], + opersize=32, + opcode=[0x0F, 0x78], + operands=[Operand(type="RM", size=32, relaxed=True, dest="EA"), + Operand(type="Reg", size=32, dest="Spare")]) +add_group("vmxmemrd", + suffix="q", + cpu=["P4"], + opersize=64, + def_opersize_64=64, + opcode=[0x0F, 0x78], + operands=[Operand(type="RM", size=64, relaxed=True, dest="EA"), + Operand(type="Reg", size=64, dest="Spare")]) +add_insn("vmread", "vmxmemrd") + +add_group("vmxmemwr", + suffix="l", + not64=True, + cpu=["P4"], + opersize=32, + opcode=[0x0F, 0x79], + operands=[Operand(type="Reg", size=32, dest="Spare"), + Operand(type="RM", size=32, relaxed=True, dest="EA")]) +add_group("vmxmemwr", + suffix="q", + cpu=["P4"], + opersize=64, + def_opersize_64=64, + opcode=[0x0F, 0x79], + operands=[Operand(type="Reg", size=64, dest="Spare"), + Operand(type="RM", size=64, relaxed=True, dest="EA")]) +add_insn("vmwrite", "vmxmemwr") + +add_group("vmxtwobytemem", + modifiers=["SpAdd"], + cpu=["P4"], + opcode=[0x0F, 0xC7], + spare=0, + operands=[Operand(type="Mem", size=64, relaxed=True, dest="EA")]) +add_insn("vmptrld", "vmxtwobytemem", modifiers=[6]) +add_insn("vmptrst", "vmxtwobytemem", modifiers=[7]) + +add_group("vmxthreebytemem", + modifiers=["PreAdd"], + cpu=["P4"], + prefix=0x00, + opcode=[0x0F, 0xC7], + spare=6, + operands=[Operand(type="Mem", size=64, relaxed=True, dest="EA")]) +add_insn("vmclear", "vmxthreebytemem", modifiers=[0x66]) +add_insn("vmxon", "vmxthreebytemem", modifiers=[0xF3]) + +add_insn("cvttpd2pi", "cvt_mm_xmm", modifiers=[0x66, 0x2C], cpu=["SSE2"]) +add_insn("cvttsd2si", "cvt_rx_xmm64", modifiers=[0xF2, 0x2C], cpu=["SSE2"]) +add_insn("cvttpd2dq", "ssess", modifiers=[0x66, 0xE6], cpu=["SSE2"]) +add_insn("cvttps2dq", "ssess", modifiers=[0xF3, 0x5B], cpu=["SSE2"]) +add_insn("pmuludq", "mmxsse2", modifiers=[0xF4], cpu=["SSE2"]) +add_insn("pshufd", "ssessimm", modifiers=[0x66, 0x70], cpu=["SSE2"]) +add_insn("pshufhw", "ssessimm", modifiers=[0xF3, 0x70], cpu=["SSE2"]) +add_insn("pshuflw", "ssessimm", modifiers=[0xF2, 0x70], cpu=["SSE2"]) +add_insn("punpckhqdq", "ssess", modifiers=[0x66, 0x6D], cpu=["SSE2"]) +add_insn("punpcklqdq", "ssess", modifiers=[0x66, 0x6C], cpu=["SSE2"]) + +add_group("cvt_xmm_xmm32", + cpu=["SSE2"], + modifiers=["PreAdd", "Op1Add"], + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA")]) +add_group("cvt_xmm_xmm32", + cpu=["SSE2"], + modifiers=["PreAdd", "Op1Add"], + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Mem", size=32, relaxed=True, dest="EA")]) + +add_insn("cvtss2sd", "cvt_xmm_xmm32", modifiers=[0xF3, 0x5A]) + +add_group("maskmovdqu", + cpu=["SSE2"], + prefix=0x66, + opcode=[0x0F, 0xF7], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA")]) + +add_insn("maskmovdqu", "maskmovdqu") + +add_group("movdqau", + cpu=["SSE2"], + modifiers=["PreAdd"], + prefix=0x00, + opcode=[0x0F, 0x6F], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) +add_group("movdqau", + cpu=["SSE2"], + modifiers=["PreAdd"], + prefix=0x00, + opcode=[0x0F, 0x7F], + operands=[Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="Spare")]) + +add_insn("movdqa", "movdqau", modifiers=[0x66]) +add_insn("movdqu", "movdqau", modifiers=[0xF3]) + +add_group("movdq2q", + cpu=["SSE2"], + prefix=0xF2, + opcode=[0x0F, 0xD6], + operands=[Operand(type="SIMDReg", size=64, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA")]) + +add_insn("movdq2q", "movdq2q") + +add_group("movq2dq", + cpu=["SSE2"], + prefix=0xF3, + opcode=[0x0F, 0xD6], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=64, dest="EA")]) + +add_insn("movq2dq", "movq2dq") + +add_group("pslrldq", + cpu=["SSE2"], + modifiers=["SpAdd"], + prefix=0x66, + opcode=[0x0F, 0x73], + spare=0, + operands=[Operand(type="SIMDReg", size=128, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + +add_insn("pslldq", "pslrldq", modifiers=[7]) +add_insn("psrldq", "pslrldq", modifiers=[3]) + +##################################################################### +# SSE3 / PNI Prescott New Instructions instructions +##################################################################### +add_insn("addsubpd", "ssess", modifiers=[0x66, 0xD0], cpu=["SSE3"]) +add_insn("addsubps", "ssess", modifiers=[0xF2, 0xD0], cpu=["SSE3"]) +add_insn("haddpd", "ssess", modifiers=[0x66, 0x7C], cpu=["SSE3"]) +add_insn("haddps", "ssess", modifiers=[0xF2, 0x7C], cpu=["SSE3"]) +add_insn("hsubpd", "ssess", modifiers=[0x66, 0x7D], cpu=["SSE3"]) +add_insn("hsubps", "ssess", modifiers=[0xF2, 0x7D], cpu=["SSE3"]) +add_insn("movshdup", "ssess", modifiers=[0xF3, 0x16], cpu=["SSE3"]) +add_insn("movsldup", "ssess", modifiers=[0xF3, 0x12], cpu=["SSE3"]) +add_insn("fisttp", "fildstp", modifiers=[1, 0, 1], cpu=["SSE3"]) +add_insn("fisttpll", "fildstp", suffix="q", modifiers=[7], cpu=["SSE3"]) +add_insn("movddup", "cvt_xmm_xmm64_ss", modifiers=[0xF2, 0x12], cpu=["SSE3"]) +add_insn("monitor", "threebyte", modifiers=[0x0F, 0x01, 0xC8], cpu=["SSE3"]) +add_insn("mwait", "threebyte", modifiers=[0x0F, 0x01, 0xC9], cpu=["SSE3"]) + +add_group("lddqu", + cpu=["SSE3"], + prefix=0xF2, + opcode=[0x0F, 0xF0], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Mem", dest="EA")]) + +add_insn("lddqu", "lddqu") + +##################################################################### +# SSSE3 / TNI Tejas New Intructions instructions +##################################################################### + +add_group("ssse3", + cpu=["SSSE3"], + modifiers=["Op2Add"], + opcode=[0x0F, 0x38, 0x00], + operands=[Operand(type="SIMDReg", size=64, dest="Spare"), + Operand(type="SIMDRM", size=64, relaxed=True, dest="EA")]) +add_group("ssse3", + cpu=["SSSE3"], + modifiers=["Op2Add"], + prefix=0x66, + opcode=[0x0F, 0x38, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) + +add_insn("pshufb", "ssse3", modifiers=[0x00]) +add_insn("phaddw", "ssse3", modifiers=[0x01]) +add_insn("phaddd", "ssse3", modifiers=[0x02]) +add_insn("phaddsw", "ssse3", modifiers=[0x03]) +add_insn("pmaddubsw", "ssse3", modifiers=[0x04]) +add_insn("phsubw", "ssse3", modifiers=[0x05]) +add_insn("phsubd", "ssse3", modifiers=[0x06]) +add_insn("phsubsw", "ssse3", modifiers=[0x07]) +add_insn("psignb", "ssse3", modifiers=[0x08]) +add_insn("psignw", "ssse3", modifiers=[0x09]) +add_insn("psignd", "ssse3", modifiers=[0x0A]) +add_insn("pmulhrsw", "ssse3", modifiers=[0x0B]) +add_insn("pabsb", "ssse3", modifiers=[0x1C]) +add_insn("pabsw", "ssse3", modifiers=[0x1D]) +add_insn("pabsd", "ssse3", modifiers=[0x1E]) + +add_group("ssse3imm", + cpu=["SSSE3"], + modifiers=["Op2Add"], + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=64, dest="Spare"), + Operand(type="SIMDRM", size=64, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("ssse3imm", + cpu=["SSSE3"], + modifiers=["Op2Add"], + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + +add_insn("palignr", "ssse3imm", modifiers=[0x0F]) + +##################################################################### +# SSE4.1 / SSE4.2 instructions +##################################################################### + +add_group("sse4", + cpu=["SSE41"], + modifiers=["Op2Add"], + prefix=0x66, + opcode=[0x0F, 0x38, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) + +add_insn("packusdw", "sse4", modifiers=[0x2B]) +add_insn("pcmpeqq", "sse4", modifiers=[0x29]) +add_insn("pcmpgtq", "sse4", modifiers=[0x37]) +add_insn("phminposuw", "sse4", modifiers=[0x41]) +add_insn("pmaxsb", "sse4", modifiers=[0x3C]) +add_insn("pmaxsd", "sse4", modifiers=[0x3D]) +add_insn("pmaxud", "sse4", modifiers=[0x3F]) +add_insn("pmaxuw", "sse4", modifiers=[0x3E]) +add_insn("pminsb", "sse4", modifiers=[0x38]) +add_insn("pminsd", "sse4", modifiers=[0x39]) +add_insn("pminud", "sse4", modifiers=[0x3B]) +add_insn("pminuw", "sse4", modifiers=[0x3A]) +add_insn("pmuldq", "sse4", modifiers=[0x28]) +add_insn("pmulld", "sse4", modifiers=[0x40]) +add_insn("ptest", "sse4", modifiers=[0x17]) + +add_group("sse4imm", + cpu=["SSE41"], + modifiers=["Op2Add"], + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + +add_insn("blendpd", "sse4imm", modifiers=[0x0D]) +add_insn("blendps", "sse4imm", modifiers=[0x0C]) +add_insn("dppd", "sse4imm", modifiers=[0x41]) +add_insn("dpps", "sse4imm", modifiers=[0x40]) +add_insn("mpsadbw", "sse4imm", modifiers=[0x42]) +add_insn("pblendw", "sse4imm", modifiers=[0x0E]) +add_insn("roundpd", "sse4imm", modifiers=[0x09]) +add_insn("roundps", "sse4imm", modifiers=[0x08]) +add_insn("roundsd", "sse4imm", modifiers=[0x0B]) +add_insn("roundss", "sse4imm", modifiers=[0x0A]) + +add_group("sse4xmm0", + cpu=["SSE41"], + modifiers=["Op2Add"], + prefix=0x66, + opcode=[0x0F, 0x38, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) +add_group("sse4xmm0", + cpu=["SSE41"], + modifiers=["Op2Add"], + prefix=0x66, + opcode=[0x0F, 0x38, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="XMM0", size=128, dest=None)]) + +add_insn("blendvpd", "sse4xmm0", modifiers=[0x15]) +add_insn("blendvps", "sse4xmm0", modifiers=[0x14]) +add_insn("pblendvb", "sse4xmm0", modifiers=[0x10]) + +for sfx, sz in zip("bwl", [8, 16, 32]): + add_group("crc32", + suffix=sfx, + cpu=["SSE42"], + opersize=sz, + prefix=0xF2, + opcode=[0x0F, 0x38, 0xF0+(sz!=8)], + operands=[Operand(type="Reg", size=32, dest="Spare"), + Operand(type="RM", size=sz, relaxed=(sz==32), dest="EA")]) +for sfx, sz in zip("bq", [8, 64]): + add_group("crc32", + suffix=sfx, + cpu=["SSE42"], + opersize=64, + prefix=0xF2, + opcode=[0x0F, 0x38, 0xF0+(sz!=8)], + operands=[Operand(type="Reg", size=64, dest="Spare"), + Operand(type="RM", size=sz, relaxed=(sz==64), dest="EA")]) + +add_insn("crc32", "crc32") + +add_group("extractps", + cpu=["SSE41"], + opersize=32, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x17], + operands=[Operand(type="RM", size=32, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("extractps", + cpu=["SSE41"], + opersize=64, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x17], + operands=[Operand(type="Reg", size=64, dest="EA"), + Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + +add_insn("extractps", "extractps") + +add_group("insertps", + cpu=["SSE41"], + prefix=0x66, + opcode=[0x0F, 0x3A, 0x21], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Mem", size=32, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("insertps", + cpu=["SSE41"], + prefix=0x66, + opcode=[0x0F, 0x3A, 0x21], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + +add_insn("insertps", "insertps") + +add_group("movntdqa", + cpu=["SSE41"], + prefix=0x66, + opcode=[0x0F, 0x38, 0x2A], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Mem", size=128, relaxed=True, dest="EA")]) + +add_insn("movntdqa", "movntdqa") + +add_group("sse4pcmpstr", + cpu=["SSE42"], + modifiers=["Op2Add"], + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + +add_insn("pcmpestri", "sse4pcmpstr", modifiers=[0x61]) +add_insn("pcmpestrm", "sse4pcmpstr", modifiers=[0x60]) +add_insn("pcmpistri", "sse4pcmpstr", modifiers=[0x63]) +add_insn("pcmpistrm", "sse4pcmpstr", modifiers=[0x62]) + +add_group("pextrb", + cpu=["SSE41"], + prefix=0x66, + opcode=[0x0F, 0x3A, 0x14], + operands=[Operand(type="Mem", size=8, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +for sz in [32, 64]: + add_group("pextrb", + cpu=["SSE41"], + opersize=sz, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x14], + operands=[Operand(type="Reg", size=sz, dest="EA"), + Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + +add_insn("pextrb", "pextrb") + +add_group("pextrd", + cpu=["SSE41"], + opersize=32, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x16], + operands=[Operand(type="RM", size=32, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + +add_insn("pextrd", "pextrd") + +add_group("pextrq", + cpu=["SSE41"], + opersize=64, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x16], + operands=[Operand(type="RM", size=64, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + +add_insn("pextrq", "pextrq") + +add_group("pinsrb", + cpu=["SSE41"], + prefix=0x66, + opcode=[0x0F, 0x3A, 0x20], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Mem", size=8, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("pinsrb", + cpu=["SSE41"], + opersize=32, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x20], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Reg", size=32, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + +add_insn("pinsrb", "pinsrb") + +add_group("pinsrd", + cpu=["SSE41"], + opersize=32, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x22], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="RM", size=32, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + +add_insn("pinsrd", "pinsrd") + +add_group("pinsrq", + cpu=["SSE41"], + opersize=64, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x22], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="RM", size=64, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + +add_insn("pinsrq", "pinsrq") + +add_group("sse4m64", + cpu=["SSE41"], + modifiers=["Op2Add"], + prefix=0x66, + opcode=[0x0F, 0x38, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Mem", size=64, relaxed=True, dest="EA")]) +add_group("sse4m64", + cpu=["SSE41"], + modifiers=["Op2Add"], + prefix=0x66, + opcode=[0x0F, 0x38, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA")]) + +add_insn("pmovsxbw", "sse4m64", modifiers=[0x20]) +add_insn("pmovsxwd", "sse4m64", modifiers=[0x23]) +add_insn("pmovsxdq", "sse4m64", modifiers=[0x25]) +add_insn("pmovzxbw", "sse4m64", modifiers=[0x30]) +add_insn("pmovzxwd", "sse4m64", modifiers=[0x33]) +add_insn("pmovzxdq", "sse4m64", modifiers=[0x35]) + +add_group("sse4m32", + cpu=["SSE41"], + modifiers=["Op2Add"], + prefix=0x66, + opcode=[0x0F, 0x38, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Mem", size=32, relaxed=True, dest="EA")]) +add_group("sse4m32", + cpu=["SSE41"], + modifiers=["Op2Add"], + prefix=0x66, + opcode=[0x0F, 0x38, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA")]) + +add_insn("pmovsxbd", "sse4m32", modifiers=[0x21]) +add_insn("pmovsxwq", "sse4m32", modifiers=[0x24]) +add_insn("pmovzxbd", "sse4m32", modifiers=[0x31]) +add_insn("pmovzxwq", "sse4m32", modifiers=[0x34]) + +add_group("sse4m16", + cpu=["SSE41"], + modifiers=["Op2Add"], + prefix=0x66, + opcode=[0x0F, 0x38, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Mem", size=16, relaxed=True, dest="EA")]) +add_group("sse4m16", + cpu=["SSE41"], + modifiers=["Op2Add"], + prefix=0x66, + opcode=[0x0F, 0x38, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA")]) + +add_insn("pmovsxbq", "sse4m16", modifiers=[0x22]) +add_insn("pmovzxbq", "sse4m16", modifiers=[0x32]) + +for sfx, sz in zip("wlq", [16, 32, 64]): + add_group("cnt", + suffix=sfx, + modifiers=["Op1Add"], + opersize=sz, + prefix=0xF3, + opcode=[0x0F, 0x00], + operands=[Operand(type="Reg", size=sz, dest="Spare"), + Operand(type="RM", size=sz, relaxed=True, dest="EA")]) + +add_insn("popcnt", "cnt", modifiers=[0xB8], cpu=["SSE42"]) + +##################################################################### +# AMD SSE4.1 instructions +##################################################################### + +add_group("extrq", + cpu=["SSE41"], + prefix=0x66, + opcode=[0x0F, 0x78], + operands=[Operand(type="SIMDReg", size=128, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("extrq", + cpu=["SSE41"], + prefix=0x66, + opcode=[0x0F, 0x79], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA")]) + +add_insn("extrq", "extrq") + +add_group("insertq", + cpu=["SSE41"], + prefix=0xF2, + opcode=[0x0F, 0x78], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("insertq", + cpu=["SSE41"], + prefix=0xF2, + opcode=[0x0F, 0x79], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA")]) + +add_insn("insertq", "insertq") + +add_group("movntsd", + cpu=["SSE41"], + prefix=0xF2, + opcode=[0x0F, 0x2B], + operands=[Operand(type="Mem", size=64, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="Spare")]) + +add_insn("movntsd", "movntsd") + +add_group("movntss", + cpu=["SSE41"], + prefix=0xF3, + opcode=[0x0F, 0x2B], + operands=[Operand(type="Mem", size=32, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="Spare")]) + +add_insn("movntss", "movntss") + +##################################################################### +# AMD 3DNow! instructions +##################################################################### + +add_insn("prefetch", "twobytemem", modifiers=[0x00, 0x0F, 0x0D], cpu=["3DNow"]) +add_insn("prefetchw", "twobytemem", modifiers=[0x01, 0x0F, 0x0D], cpu=["3DNow"]) +add_insn("femms", "twobyte", modifiers=[0x0F, 0x0E], cpu=["3DNow"]) + +add_group("now3d", + cpu=["3DNow"], + modifiers=["Imm8"], + opcode=[0x0F, 0x0F], + operands=[Operand(type="SIMDReg", size=64, dest="Spare"), + Operand(type="SIMDRM", size=64, relaxed=True, dest="EA")]) + +add_insn("pavgusb", "now3d", modifiers=[0xBF]) +add_insn("pf2id", "now3d", modifiers=[0x1D]) +add_insn("pf2iw", "now3d", modifiers=[0x1C], cpu=["Athlon", "3DNow"]) +add_insn("pfacc", "now3d", modifiers=[0xAE]) +add_insn("pfadd", "now3d", modifiers=[0x9E]) +add_insn("pfcmpeq", "now3d", modifiers=[0xB0]) +add_insn("pfcmpge", "now3d", modifiers=[0x90]) +add_insn("pfcmpgt", "now3d", modifiers=[0xA0]) +add_insn("pfmax", "now3d", modifiers=[0xA4]) +add_insn("pfmin", "now3d", modifiers=[0x94]) +add_insn("pfmul", "now3d", modifiers=[0xB4]) +add_insn("pfnacc", "now3d", modifiers=[0x8A], cpu=["Athlon", "3DNow"]) +add_insn("pfpnacc", "now3d", modifiers=[0x8E], cpu=["Athlon", "3DNow"]) +add_insn("pfrcp", "now3d", modifiers=[0x96]) +add_insn("pfrcpit1", "now3d", modifiers=[0xA6]) +add_insn("pfrcpit2", "now3d", modifiers=[0xB6]) +add_insn("pfrsqit1", "now3d", modifiers=[0xA7]) +add_insn("pfrsqrt", "now3d", modifiers=[0x97]) +add_insn("pfsub", "now3d", modifiers=[0x9A]) +add_insn("pfsubr", "now3d", modifiers=[0xAA]) +add_insn("pi2fd", "now3d", modifiers=[0x0D]) +add_insn("pi2fw", "now3d", modifiers=[0x0C], cpu=["Athlon", "3DNow"]) +add_insn("pmulhrwa", "now3d", modifiers=[0xB7]) +add_insn("pswapd", "now3d", modifiers=[0xBB], cpu=["Athlon", "3DNow"]) + +##################################################################### +# AMD extensions +##################################################################### + +add_insn("syscall", "twobyte", modifiers=[0x0F, 0x05], cpu=["686", "AMD"]) +for sfx in [None, "l", "q"]: + add_insn("sysret"+(sfx or ""), "twobyte", suffix=sfx, modifiers=[0x0F, 0x07], + cpu=["686", "AMD", "Priv"]) +add_insn("lzcnt", "cnt", modifiers=[0xBD], cpu=["686", "AMD"]) + +##################################################################### +# AMD x86-64 extensions +##################################################################### + +add_insn("swapgs", "threebyte", modifiers=[0x0F, 0x01, 0xF8], only64=True) +add_insn("rdtscp", "threebyte", modifiers=[0x0F, 0x01, 0xF9], + cpu=["686", "AMD", "Priv"]) + +add_group("cmpxchg16b", + only64=True, + opersize=64, + opcode=[0x0F, 0xC7], + spare=1, + operands=[Operand(type="Mem", size=128, relaxed=True, dest="EA")]) + +add_insn("cmpxchg16b", "cmpxchg16b") + +##################################################################### +# AMD Pacifica SVM instructions +##################################################################### + +add_insn("clgi", "threebyte", modifiers=[0x0F, 0x01, 0xDD], cpu=["SVM"]) +add_insn("stgi", "threebyte", modifiers=[0x0F, 0x01, 0xDC], cpu=["SVM"]) +add_insn("vmmcall", "threebyte", modifiers=[0x0F, 0x01, 0xD9], cpu=["SVM"]) + +add_group("invlpga", + cpu=["SVM"], + opcode=[0x0F, 0x01, 0xDF], + operands=[]) +add_group("invlpga", + cpu=["SVM"], + opcode=[0x0F, 0x01, 0xDF], + operands=[Operand(type="MemrAX", dest="AdSizeEA"), + Operand(type="Creg", size=32, dest=None)]) + +add_insn("invlpga", "invlpga") + +add_group("skinit", + cpu=["SVM"], + opcode=[0x0F, 0x01, 0xDE], + operands=[]) +add_group("skinit", + cpu=["SVM"], + opcode=[0x0F, 0x01, 0xDE], + operands=[Operand(type="MemEAX", dest=None)]) + +add_insn("skinit", "skinit") + +add_group("svm_rax", + cpu=["SVM"], + modifiers=["Op2Add"], + opcode=[0x0F, 0x01, 0x00], + operands=[]) +add_group("svm_rax", + cpu=["SVM"], + modifiers=["Op2Add"], + opcode=[0x0F, 0x01, 0x00], + operands=[Operand(type="MemrAX", dest="AdSizeEA")]) + +add_insn("vmload", "svm_rax", modifiers=[0xDA]) +add_insn("vmrun", "svm_rax", modifiers=[0xD8]) +add_insn("vmsave", "svm_rax", modifiers=[0xDB]) + +##################################################################### +# VIA PadLock instructions +##################################################################### + +add_group("padlock", + cpu=["PadLock"], + modifiers=["Imm8", "PreAdd", "Op1Add"], + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[]) + +add_insn("xstore", "padlock", modifiers=[0xC0, 0x00, 0xA7]) +add_insn("xstorerng", "padlock", modifiers=[0xC0, 0x00, 0xA7]) +add_insn("xcryptecb", "padlock", modifiers=[0xC8, 0xF3, 0xA7]) +add_insn("xcryptcbc", "padlock", modifiers=[0xD0, 0xF3, 0xA7]) +add_insn("xcryptctr", "padlock", modifiers=[0xD8, 0xF3, 0xA7]) +add_insn("xcryptcfb", "padlock", modifiers=[0xE0, 0xF3, 0xA7]) +add_insn("xcryptofb", "padlock", modifiers=[0xE8, 0xF3, 0xA7]) +add_insn("montmul", "padlock", modifiers=[0xC0, 0xF3, 0xA6]) +add_insn("xsha1", "padlock", modifiers=[0xC8, 0xF3, 0xA6]) +add_insn("xsha256", "padlock", modifiers=[0xD0, 0xF3, 0xA6]) + +##################################################################### +# Cyrix MMX instructions +##################################################################### + +add_group("cyrixmmx", + cpu=["MMX", "Cyrix"], + modifiers=["Op1Add"], + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=64, dest="Spare"), + Operand(type="SIMDRM", size=64, relaxed=True, dest="EA")]) + +add_insn("paddsiw", "cyrixmmx", modifiers=[0x51]) +add_insn("paveb", "cyrixmmx", modifiers=[0x50]) +add_insn("pdistib", "cyrixmmx", modifiers=[0x54]) +add_insn("pmagw", "cyrixmmx", modifiers=[0x52]) +add_insn("pmulhriw", "cyrixmmx", modifiers=[0x5D]) +add_insn("pmulhrwc", "cyrixmmx", modifiers=[0x59]) +add_insn("pmvgezb", "cyrixmmx", modifiers=[0x5C]) +add_insn("pmvlzb", "cyrixmmx", modifiers=[0x5B]) +add_insn("pmvnzb", "cyrixmmx", modifiers=[0x5A]) +add_insn("pmvzb", "cyrixmmx", modifiers=[0x58]) +add_insn("psubsiw", "cyrixmmx", modifiers=[0x55]) + +add_group("pmachriw", + cpu=["MMX", "Cyrix"], + opcode=[0x0F, 0x5E], + operands=[Operand(type="SIMDReg", size=64, dest="Spare"), + Operand(type="Mem", size=64, relaxed=True, dest="EA")]) + +add_insn("pmachriw", "pmachriw") + +##################################################################### +# Cyrix extensions +##################################################################### + +add_insn("smint", "twobyte", modifiers=[0x0F, 0x38], cpu=["686", "Cyrix"]) +add_insn("smintold", "twobyte", modifiers=[0x0F, 0x7E], cpu=["486", "Cyrix", "Obs"]) + +add_group("rdwrshr", + cpu=["Cyrix", "SMM", "686"], + modifiers=["Op1Add"], + opcode=[0x0F, 0x36], + operands=[Operand(type="RM", size=32, relaxed=True, dest="EA")]) + +add_insn("rdshr", "rdwrshr", modifiers=[0x00]) +add_insn("wrshr", "rdwrshr", modifiers=[0x01]) + +add_group("rsdc", + cpu=["Cyrix", "SMM", "486"], + opcode=[0x0F, 0x79], + operands=[Operand(type="SegReg", size=16, relaxed=True, dest="Spare"), + Operand(type="Mem", size=80, relaxed=True, dest="EA")]) + +add_insn("rsdc", "rsdc") + +add_group("cyrixsmm", + cpu=["Cyrix", "SMM", "486"], + modifiers=["Op1Add"], + opcode=[0x0F, 0x00], + operands=[Operand(type="Mem", size=80, relaxed=True, dest="EA")]) + +add_insn("rsldt", "cyrixsmm", modifiers=[0x7B]) +add_insn("rsts", "cyrixsmm", modifiers=[0x7D]) +add_insn("svldt", "cyrixsmm", modifiers=[0x7A]) +add_insn("svts", "cyrixsmm", modifiers=[0x7C]) + +add_group("svdc", + cpu=["Cyrix", "SMM", "486"], + opcode=[0x0F, 0x78], + operands=[Operand(type="Mem", size=80, relaxed=True, dest="EA"), + Operand(type="SegReg", size=16, relaxed=True, dest="Spare")]) + +add_insn("svdc", "svdc") + +##################################################################### +# Obsolete/undocumented instructions +##################################################################### + +add_insn("fsetpm", "twobyte", modifiers=[0xDB, 0xE4], cpu=["286", "FPU", "Obs"]) +add_insn("loadall", "twobyte", modifiers=[0x0F, 0x07], cpu=["386", "Undoc"]) +add_insn("loadall286", "twobyte", modifiers=[0x0F, 0x05], cpu=["286", "Undoc"]) +add_insn("salc", "onebyte", modifiers=[0xD6], cpu=["Undoc", "Not64"]) +add_insn("smi", "onebyte", modifiers=[0xF1], cpu=["386", "Undoc"]) + +add_group("ibts", + cpu=["Undoc", "Obs", "386"], + opersize=16, + opcode=[0x0F, 0xA7], + operands=[Operand(type="RM", size=16, relaxed=True, dest="EA"), + Operand(type="Reg", size=16, dest="Spare")]) +add_group("ibts", + cpu=["Undoc", "Obs", "386"], + opersize=32, + opcode=[0x0F, 0xA7], + operands=[Operand(type="RM", size=32, relaxed=True, dest="EA"), + Operand(type="Reg", size=32, dest="Spare")]) + +add_insn("ibts", "ibts") + +add_group("umov", + cpu=["Undoc", "386"], + opcode=[0x0F, 0x10], + operands=[Operand(type="RM", size=8, relaxed=True, dest="EA"), + Operand(type="Reg", size=8, dest="Spare")]) +add_group("umov", + cpu=["Undoc", "386"], + opersize=16, + opcode=[0x0F, 0x11], + operands=[Operand(type="RM", size=16, relaxed=True, dest="EA"), + Operand(type="Reg", size=16, dest="Spare")]) +add_group("umov", + cpu=["Undoc", "386"], + opersize=32, + opcode=[0x0F, 0x11], + operands=[Operand(type="RM", size=32, relaxed=True, dest="EA"), + Operand(type="Reg", size=32, dest="Spare")]) +add_group("umov", + cpu=["Undoc", "386"], + opcode=[0x0F, 0x12], + operands=[Operand(type="Reg", size=8, dest="Spare"), + Operand(type="RM", size=8, relaxed=True, dest="EA")]) +add_group("umov", + cpu=["Undoc", "386"], + opersize=16, + opcode=[0x0F, 0x13], + operands=[Operand(type="Reg", size=16, dest="Spare"), + Operand(type="RM", size=16, relaxed=True, dest="EA")]) +add_group("umov", + cpu=["Undoc", "386"], + opersize=32, + opcode=[0x0F, 0x13], + operands=[Operand(type="Reg", size=32, dest="Spare"), + Operand(type="RM", size=32, relaxed=True, dest="EA")]) + +add_insn("umov", "umov") + +add_group("xbts", + cpu=["Undoc", "Obs", "386"], + opersize=16, + opcode=[0x0F, 0xA6], + operands=[Operand(type="Reg", size=16, dest="Spare"), + Operand(type="Mem", size=16, relaxed=True, dest="EA")]) +add_group("xbts", + cpu=["Undoc", "Obs", "386"], + opersize=32, + opcode=[0x0F, 0xA6], + operands=[Operand(type="Reg", size=32, dest="Spare"), + Operand(type="Mem", size=32, relaxed=True, dest="EA")]) + +add_insn("xbts", "xbts") + +finalize_insns() + +##################################################################### +# Prefixes +##################################################################### +# operand size overrides +for sz in [16, 32, 64]: + add_prefix("o%d" % sz, "OPERSIZE", sz, parser="nasm", only64=(sz==64)) + add_prefix("data%d" % sz, "OPERSIZE", sz, parser="gas", only64=(sz==64)) +add_prefix("word", "OPERSIZE", 16, parser="gas") +add_prefix("dword", "OPERSIZE", 32, parser="gas") +add_prefix("qword", "OPERSIZE", 64, parser="gas", only64=True) + +# address size overrides +for sz in [16, 32, 64]: + add_prefix("a%d" % sz, "ADDRSIZE", sz, parser="nasm", only64=(sz==64)) + add_prefix("addr%d" % sz, "ADDRSIZE", sz, parser="gas", only64=(sz==64)) +add_prefix("aword", "ADDRSIZE", 16, parser="gas") +add_prefix("adword", "ADDRSIZE", 32, parser="gas") +add_prefix("aqword", "ADDRSIZE", 64, parser="gas", only64=True) + +# instruction prefixes +add_prefix("lock", "LOCKREP", 0xF0) +add_prefix("repne", "LOCKREP", 0xF2) +add_prefix("repnz", "LOCKREP", 0xF2) +add_prefix("rep", "LOCKREP", 0xF3) +add_prefix("repe", "LOCKREP", 0xF3) +add_prefix("repz", "LOCKREP", 0xF3) + +# other prefixes, limited to GAS-only at the moment +# Hint taken/not taken for jumps +add_prefix("ht", "SEGREG", 0x3E, parser="gas") +add_prefix("hnt", "SEGREG", 0x2E, parser="gas") + +# REX byte explicit prefixes +for val, suf in enumerate(["", "z", "y", "yz", "x", "xz", "xy", "xyz"]): + add_prefix("rex" + suf, "REX", 0x40+val, parser="gas", only64=True) + add_prefix("rex64" + suf, "REX", 0x48+val, parser="gas", only64=True) + +##################################################################### +# Output generation +##################################################################### + +output_groups(file("x86insns.c", "wt")) +output_gas_insns(file("x86insn_gas.gperf", "wt")) +output_nasm_insns(file("x86insn_nasm.gperf", "wt")) diff --git a/modules/arch/x86/x86geninsn.c b/modules/arch/x86/x86geninsn.c deleted file mode 100644 index 320e24d7..00000000 --- a/modules/arch/x86/x86geninsn.c +++ /dev/null @@ -1,194 +0,0 @@ -/* $Id$ - * - * Generate x86 instructions gperf files - * - * Copyright (C) 2006-2007 Peter Johnson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ -#include -#include -#include -#include -#include - -static char line[1024]; -static unsigned int cur_line = 1; -unsigned int num_errors = 0; - -static void -report_error(const char *fmt, ...) -{ - va_list ap; - - fprintf(stderr, "%u: ", cur_line); - va_start(ap, fmt); - vfprintf(stderr, fmt, ap); - va_end(ap); - fputc('\n', stderr); - num_errors++; -} - -static void -parse_insn(FILE *out_nasm, FILE *out_gas) -{ - char *parser = strtok(NULL, " \t\n"); - char *bname = strtok(NULL, " \t\n"); - char *suffix = strtok(NULL, " \t\n"); - char *group = strtok(NULL, " \t\n"); - char *mod = strtok(NULL, " \t\n"); - char *cpu = strtok(NULL, " \t\n"); - - if (!suffix) { - report_error("INSN requires suffix"); - return; - } - - if (suffix[0] != '"') { - /* Just one instruction to generate */ - if (parser[0] == '-' || strcmp(parser, "gas") == 0) - fprintf(out_gas, - "%s,\t%s_insn,\t(%sUL<<8)|NELEMS(%s_insn),\t%s,\t%s\n", - bname, group, mod, group, cpu, suffix); - if (parser[0] == '-' || strcmp(parser, "nasm") == 0) - fprintf(out_nasm, - "%s,\t%s_insn,\t(%sUL<<8)|NELEMS(%s_insn),\t%s,\t%s\n", - bname, group, mod, group, cpu, suffix); - } else { - /* Need to generate with suffixes for gas */ - char *p; - char sufstr[6]; - size_t bnamelen = strlen(bname); - char *name = malloc(bnamelen+2); - - strcpy(name, bname); - strcpy(sufstr, "SUF_X"); - - for (p = &suffix[1]; *p != '"'; p++) { - sufstr[4] = toupper(*p); - - name[bnamelen] = tolower(*p); - name[bnamelen+1] = '\0'; - - fprintf(out_gas, - "%s,\t%s_insn,\t(%sUL<<8)|NELEMS(%s_insn),\t%s,\t%s\n", - name, group, mod, group, cpu, sufstr); - } - free(name); - - /* And finally the version sans suffix */ - if (parser[0] == '-' || strcmp(parser, "gas") == 0) - fprintf(out_gas, - "%s,\t%s_insn,\t(%sUL<<8)|NELEMS(%s_insn),\t%s,\t%s\n", - bname, group, mod, group, cpu, "NONE"); - if (parser[0] == '-' || strcmp(parser, "nasm") == 0) - fprintf(out_nasm, - "%s,\t%s_insn,\t(%sUL<<8)|NELEMS(%s_insn),\t%s,\t%s\n", - bname, group, mod, group, cpu, "NONE"); - } -} - -static void -parse_prefix(FILE *out_nasm, FILE *out_gas) -{ - char *parser = strtok(NULL, " \t\n"); - char *name = strtok(NULL, " \t\n"); - char *type = strtok(NULL, " \t\n"); - char *value = strtok(NULL, " \t\n"); - - if (parser[0] == '-' || strcmp(parser, "gas") == 0) - fprintf(out_gas, "%s,\tNULL,\t%s,\t%s,\tNONE\n", name, type, value); - if (parser[0] == '-' || strcmp(parser, "nasm") == 0) - fprintf(out_nasm, "%s,\tNULL,\t%s,\t%s,\tNONE\n", name, type, value); -} - -void -output_base(FILE *out, const char *parser) -{ - fputs("%ignore-case\n", out); - fputs("%language=ANSI-C\n", out); - fputs("%compare-strncmp\n", out); - fputs("%readonly-tables\n", out); - fputs("%enum\n", out); - fputs("%struct-type\n", out); - fprintf(out, "%%define hash-function-name insnprefix_%s_hash\n", parser); - fprintf(out, "%%define lookup-function-name insnprefix_%s_find\n", parser); - fputs("struct insnprefix_parse_data;\n", out); - fputs("%%\n", out); -} - -int -main(int argc, char *argv[]) -{ - FILE *in, *out_nasm, *out_gas; - char *tok; - - if (argc != 4) { - fprintf(stderr, "Usage: x86geninsn \n"); - return EXIT_FAILURE; - } - - in = fopen(argv[1], "rt"); - if (!in) { - fprintf(stderr, "Could not open `%s' for reading\n", argv[1]); - return EXIT_FAILURE; - } - - out_nasm = fopen(argv[2], "wt"); - if (!out_nasm) { - fprintf(stderr, "Could not open `%s' for writing\n", argv[2]); - return EXIT_FAILURE; - } - out_gas = fopen(argv[3], "wt"); - if (!out_gas) { - fprintf(stderr, "Could not open `%s' for writing\n", argv[2]); - return EXIT_FAILURE; - } - - output_base(out_nasm, "nasm"); - output_base(out_gas, "gas"); - - /* Parse input file */ - while (fgets(line, 1024, in)) { - tok = strtok(line, " \t\n"); - if (!tok) - continue; - - /* Comments start with # as the first thing on a line */ - if (tok[0] == '#') - continue; - - if (strcmp(tok, "INSN") == 0) - parse_insn(out_nasm, out_gas); - else if (strcmp(tok, "PREFIX") == 0) - parse_prefix(out_nasm, out_gas); - else - report_error("unknown directive `%s'\n", tok); - cur_line++; - } - - if (num_errors > 0) - return EXIT_FAILURE; - - return EXIT_SUCCESS; -} - diff --git a/modules/arch/x86/x86id.c b/modules/arch/x86/x86id.c index d1257be4..67810b86 100644 --- a/modules/arch/x86/x86id.c +++ b/modules/arch/x86/x86id.c @@ -318,10 +318,6 @@ static const yasm_bytecode_callback x86_id_insn_callback = { YASM_BC_SPECIAL_INSN }; -/* - * General instruction groupings - */ - /* Empty instruction */ static const x86_insn_info empty_insn[] = { { CPU_Any, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 0, {0, 0, 0} } @@ -332,2013 +328,11 @@ static const x86_insn_info not64_insn[] = { { CPU_Not64, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 0, {0, 0, 0} } }; -/* One byte opcode instructions with no operands */ -static const x86_insn_info onebyte_insn[] = { - { CPU_Any, MOD_Op0Add|MOD_OpSizeR|MOD_DOpS64R, 0, 0, 0, 1, {0, 0, 0}, 0, 0, - {0, 0, 0} } -}; - -/* One byte opcode instructions with "special" prefix with no operands */ -static const x86_insn_info onebyte_prefix_insn[] = { - { CPU_Any, MOD_Op0Add|MOD_PreAdd, 0, 0, 0x00, 1, {0x00, 0, 0}, 0, 0, - {0, 0, 0} } -}; - -/* Two byte opcode instructions with no operands */ -static const x86_insn_info twobyte_insn[] = { - { CPU_Any, MOD_Op1Add|MOD_Op0Add|MOD_GasSufL|MOD_GasSufQ, 0, 0, 0, 2, - {0, 0, 0}, 0, 0, {0, 0, 0} } -}; - -/* Three byte opcode instructions with no operands */ -static const x86_insn_info threebyte_insn[] = { - { CPU_Any, MOD_Op2Add|MOD_Op1Add|MOD_Op0Add, 0, 0, 0, 3, {0, 0, 0}, 0, 0, - {0, 0, 0} } -}; - -/* One byte opcode instructions with general memory operand */ -static const x86_insn_info onebytemem_insn[] = { - { CPU_Any, MOD_Op0Add|MOD_SpAdd|MOD_GasSufL|MOD_GasSufQ|MOD_GasSufS, - 0, 0, 0, 1, {0, 0, 0}, 0, 1, {OPT_Mem|OPS_Any|OPA_EA, 0, 0} } -}; - -/* Two byte opcode instructions with general memory operand */ -static const x86_insn_info twobytemem_insn[] = { - { CPU_Any, - MOD_Op1Add|MOD_Op0Add|MOD_SpAdd|MOD_GasSufL|MOD_GasSufQ|MOD_GasSufS, - 0, 0, 0, 2, {0, 0, 0}, 0, 1, {OPT_Mem|OPS_Any|OPA_EA, 0, 0} } -}; - -/* P4 VMX Instructions */ -static const x86_insn_info vmxmemrd_insn[] = { - { CPU_Not64, MOD_Op1Add|MOD_Op0Add|MOD_GasSufL, 32, 0, 0, 2, {0, 0, 0}, 0, - 2, {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_32|OPA_Spare, 0} }, - { CPU_64, MOD_Op1Add|MOD_Op0Add|MOD_GasSufQ, 64, 64, 0, 2, {0, 0, 0}, 0, - 2, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_64|OPA_Spare, 0} } -}; -static const x86_insn_info vmxmemwr_insn[] = { - { CPU_Not64, MOD_Op1Add|MOD_Op0Add|MOD_GasSufL, 32, 0, 0, 2, {0, 0, 0}, 0, - 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} }, - { CPU_64, MOD_Op1Add|MOD_Op0Add|MOD_GasSufQ, 64, 64, 0, 2, {0, 0, 0}, 0, - 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} } -}; -static const x86_insn_info vmxtwobytemem_insn[] = { - { CPU_Any, MOD_SpAdd|MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0, 0}, 0, 1, - {OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0, 0} } -}; -static const x86_insn_info vmxthreebytemem_insn[] = { - { CPU_Any, MOD_SpAdd|MOD_PreAdd|MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0, 0}, 0, 1, - {OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0, 0} } -}; - -/* Move instructions */ -static const x86_insn_info mov_insn[] = { - /* Absolute forms for non-64-bit mode */ - { CPU_Not64, MOD_GasSufB, 0, 0, 0, 1, {0xA0, 0, 0}, 0, 2, - {OPT_Areg|OPS_8|OPA_None, OPT_MemOffs|OPS_8|OPS_Relaxed|OPA_EA, 0} }, - { CPU_Not64, MOD_GasSufW, 16, 0, 0, 1, {0xA1, 0, 0}, 0, 2, - {OPT_Areg|OPS_16|OPA_None, OPT_MemOffs|OPS_16|OPS_Relaxed|OPA_EA, 0} }, - { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0xA1, 0, 0}, 0, 2, - {OPT_Areg|OPS_32|OPA_None, OPT_MemOffs|OPS_32|OPS_Relaxed|OPA_EA, 0} }, - - { CPU_Not64, MOD_GasSufB, 0, 0, 0, 1, {0xA2, 0, 0}, 0, 2, - {OPT_MemOffs|OPS_8|OPS_Relaxed|OPA_EA, OPT_Areg|OPS_8|OPA_None, 0} }, - { CPU_Not64, MOD_GasSufW, 16, 0, 0, 1, {0xA3, 0, 0}, 0, 2, - {OPT_MemOffs|OPS_16|OPS_Relaxed|OPA_EA, OPT_Areg|OPS_16|OPA_None, 0} }, - { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0xA3, 0, 0}, 0, 2, - {OPT_MemOffs|OPS_32|OPS_Relaxed|OPA_EA, OPT_Areg|OPS_32|OPA_None, 0} }, - - /* 64-bit absolute forms for 64-bit mode. Disabled for GAS, see movabs */ - { CPU_Hammer|CPU_64, 0, 0, 0, 0, 1, {0xA0, 0, 0}, 0, 2, - {OPT_Areg|OPS_8|OPA_None, - OPT_MemOffs|OPS_8|OPS_Relaxed|OPEAS_64|OPA_EA, 0} }, - { CPU_Hammer|CPU_64, 0, 16, 0, 0, 1, {0xA1, 0, 0}, 0, 2, - {OPT_Areg|OPS_16|OPA_None, - OPT_MemOffs|OPS_16|OPS_Relaxed|OPEAS_64|OPA_EA, 0} }, - { CPU_Hammer|CPU_64, 0, 32, 0, 0, 1, {0xA1, 0, 0}, 0, 2, - {OPT_Areg|OPS_32|OPA_None, - OPT_MemOffs|OPS_32|OPS_Relaxed|OPEAS_64|OPA_EA, 0} }, - { CPU_Hammer|CPU_64, 0, 64, 0, 0, 1, {0xA1, 0, 0}, 0, 2, - {OPT_Areg|OPS_64|OPA_None, - OPT_MemOffs|OPS_64|OPS_Relaxed|OPEAS_64|OPA_EA, 0} }, - - { CPU_Hammer|CPU_64, 0, 0, 0, 0, 1, {0xA2, 0, 0}, 0, 2, - {OPT_MemOffs|OPS_8|OPS_Relaxed|OPEAS_64|OPA_EA, - OPT_Areg|OPS_8|OPA_None, 0} }, - { CPU_Hammer|CPU_64, 0, 16, 0, 0, 1, {0xA3, 0, 0}, 0, 2, - {OPT_MemOffs|OPS_16|OPS_Relaxed|OPEAS_64|OPA_EA, - OPT_Areg|OPS_16|OPA_None, 0} }, - { CPU_Hammer|CPU_64, 0, 32, 0, 0, 1, {0xA3, 0, 0}, 0, 2, - {OPT_MemOffs|OPS_32|OPS_Relaxed|OPEAS_64|OPA_EA, - OPT_Areg|OPS_32|OPA_None, 0} }, - { CPU_Hammer|CPU_64, 0, 64, 0, 0, 1, {0xA3, 0, 0}, 0, 2, - {OPT_MemOffs|OPS_64|OPS_Relaxed|OPEAS_64|OPA_EA, - OPT_Areg|OPS_64|OPA_None, 0} }, - - /* General 32-bit forms using Areg / short absolute option */ - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0x88, 0xA2, 0}, 0, 2, - {OPT_RM|OPS_8|OPS_Relaxed|OPA_EA|OPAP_ShortMov, OPT_Areg|OPS_8|OPA_Spare, - 0} }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x89, 0xA3, 0}, 0, 2, - {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA|OPAP_ShortMov, - OPT_Areg|OPS_16|OPA_Spare, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x89, 0xA3, 0}, 0, 2, - {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA|OPAP_ShortMov, - OPT_Areg|OPS_32|OPA_Spare, 0} }, - { CPU_Hammer|CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x89, 0xA3, 0}, 0, 2, - {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA|OPAP_ShortMov, - OPT_Areg|OPS_64|OPA_Spare, 0} }, - - /* General 32-bit forms */ - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0x88, 0, 0}, 0, 2, - {OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_8|OPA_Spare, 0} }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x89, 0, 0}, 0, 2, - {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_16|OPA_Spare, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x89, 0, 0}, 0, 2, - {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_32|OPA_Spare, 0} }, - { CPU_Hammer|CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x89, 0, 0}, 0, 2, - {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_64|OPA_Spare, 0} }, - - /* General 32-bit forms using Areg / short absolute option */ - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0x8A, 0xA0, 0}, 0, 2, - {OPT_Areg|OPS_8|OPA_Spare, OPT_RM|OPS_8|OPS_Relaxed|OPA_EA|OPAP_ShortMov, - 0} }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x8B, 0xA1, 0}, 0, 2, - {OPT_Areg|OPS_16|OPA_Spare, - OPT_RM|OPS_16|OPS_Relaxed|OPA_EA|OPAP_ShortMov, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x8B, 0xA1, 0}, 0, 2, - {OPT_Areg|OPS_32|OPA_Spare, - OPT_RM|OPS_32|OPS_Relaxed|OPA_EA|OPAP_ShortMov, 0} }, - { CPU_Hammer|CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x8B, 0xA1, 0}, 0, 2, - {OPT_Areg|OPS_64|OPA_Spare, - OPT_RM|OPS_64|OPS_Relaxed|OPA_EA|OPAP_ShortMov, 0} }, - - /* General 32-bit forms */ - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0x8A, 0, 0}, 0, 2, - {OPT_Reg|OPS_8|OPA_Spare, OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, 0} }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x8B, 0, 0}, 0, 2, - {OPT_Reg|OPS_16|OPA_Spare, OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x8B, 0, 0}, 0, 2, - {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} }, - { CPU_Hammer|CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x8B, 0, 0}, 0, 2, - {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} }, - - /* Segment register forms */ - { CPU_Any, MOD_GasSufW, 0, 0, 0, 1, {0x8C, 0, 0}, 0, 2, - {OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, - OPT_SegReg|OPS_16|OPS_Relaxed|OPA_Spare, 0} }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x8C, 0, 0}, 0, 2, - {OPT_Reg|OPS_16|OPA_EA, OPT_SegReg|OPS_16|OPS_Relaxed|OPA_Spare, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x8C, 0, 0}, 0, 2, - {OPT_Reg|OPS_32|OPA_EA, OPT_SegReg|OPS_16|OPS_Relaxed|OPA_Spare, 0} }, - { CPU_Hammer|CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x8C, 0, 0}, 0, 2, - {OPT_Reg|OPS_64|OPA_EA, OPT_SegReg|OPS_16|OPS_Relaxed|OPA_Spare, 0} }, - - { CPU_Any, MOD_GasSufW, 0, 0, 0, 1, {0x8E, 0, 0}, 0, 2, - {OPT_SegReg|OPS_16|OPS_Relaxed|OPA_Spare, - OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, 0} }, - { CPU_386, MOD_GasSufL, 0, 0, 0, 1, {0x8E, 0, 0}, 0, 2, - {OPT_SegReg|OPS_16|OPS_Relaxed|OPA_Spare, OPT_Reg|OPS_32|OPA_EA, 0} }, - { CPU_Hammer|CPU_64, MOD_GasSufQ, 0, 0, 0, 1, {0x8E, 0, 0}, 0, 2, - {OPT_SegReg|OPS_16|OPS_Relaxed|OPA_Spare, OPT_Reg|OPS_64|OPA_EA, 0} }, - - /* Immediate forms */ - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xB0, 0, 0}, 0, 2, - {OPT_Reg|OPS_8|OPA_Op0Add, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xB8, 0, 0}, 0, 2, - {OPT_Reg|OPS_16|OPA_Op0Add, OPT_Imm|OPS_16|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xB8, 0, 0}, 0, 2, - {OPT_Reg|OPS_32|OPA_Op0Add, OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm, 0} }, - /* 64-bit forced size form */ - { CPU_Hammer|CPU_64, MOD_GasIllegal, 64, 0, 0, 1, {0xB8, 0, 0}, 0, 2, - {OPT_Reg|OPS_64|OPA_Op0Add, OPT_Imm|OPS_64|OPA_Imm, 0} }, - { CPU_Hammer|CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xB8, 0xC7, 0}, 0, 2, - {OPT_Reg|OPS_64|OPA_Op0Add, - OPT_Imm|OPS_64|OPS_Relaxed|OPA_Imm|OPAP_SImm32Avail, 0} }, - /* Need two sets here, one for strictness on left side, one for right. */ - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xC6, 0, 0}, 0, 2, - {OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPA_Imm, 0} }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xC7, 0, 0}, 0, 2, - {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_16|OPA_Imm, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xC7, 0, 0}, 0, 2, - {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_32|OPA_Imm, 0} }, - { CPU_Hammer|CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xC7, 0, 0}, 0, 2, - {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_32|OPA_Imm, 0} }, - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xC6, 0, 0}, 0, 2, - {OPT_RM|OPS_8|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xC7, 0, 0}, 0, 2, - {OPT_RM|OPS_16|OPA_EA, OPT_Imm|OPS_16|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xC7, 0, 0}, 0, 2, - {OPT_RM|OPS_32|OPA_EA, OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_Hammer|CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xC7, 0, 0}, 0, 2, - {OPT_RM|OPS_64|OPA_EA, OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm, 0} }, - - /* CR/DR forms */ - { CPU_586|CPU_Priv|CPU_Not64, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0x22, 0}, 0, - 2, {OPT_CR4|OPS_32|OPA_Spare, OPT_Reg|OPS_32|OPA_EA, 0} }, - { CPU_386|CPU_Priv|CPU_Not64, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0x22, 0}, 0, - 2, {OPT_CRReg|OPS_32|OPA_Spare, OPT_Reg|OPS_32|OPA_EA, 0} }, - { CPU_Hammer|CPU_Priv|CPU_64, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0x22, 0}, 0, - 2, {OPT_CRReg|OPS_32|OPA_Spare, OPT_Reg|OPS_64|OPA_EA, 0} }, - { CPU_586|CPU_Priv|CPU_Not64, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0x20, 0}, 0, - 2, {OPT_Reg|OPS_32|OPA_EA, OPT_CR4|OPS_32|OPA_Spare, 0} }, - { CPU_386|CPU_Priv|CPU_Not64, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0x20, 0}, 0, - 2, {OPT_Reg|OPS_32|OPA_EA, OPT_CRReg|OPS_32|OPA_Spare, 0} }, - { CPU_Hammer|CPU_Priv|CPU_64, MOD_GasSufQ, 0, 0, 0, 2, {0x0F, 0x20, 0}, 0, - 2, {OPT_Reg|OPS_64|OPA_EA, OPT_CRReg|OPS_32|OPA_Spare, 0} }, - - { CPU_386|CPU_Priv|CPU_Not64, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0x23, 0}, 0, - 2, {OPT_DRReg|OPS_32|OPA_Spare, OPT_Reg|OPS_32|OPA_EA, 0} }, - { CPU_Hammer|CPU_Priv|CPU_64, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0x23, 0}, 0, - 2, {OPT_DRReg|OPS_32|OPA_Spare, OPT_Reg|OPS_64|OPA_EA, 0} }, - { CPU_386|CPU_Priv|CPU_Not64, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0x21, 0}, 0, - 2, {OPT_Reg|OPS_32|OPA_EA, OPT_DRReg|OPS_32|OPA_Spare, 0} }, - { CPU_Hammer|CPU_Priv|CPU_64, MOD_GasSufQ, 0, 0, 0, 2, {0x0F, 0x21, 0}, 0, - 2, {OPT_Reg|OPS_64|OPA_EA, OPT_DRReg|OPS_32|OPA_Spare, 0} }, - - /* MMX/SSE2 forms for GAS parser (copied from movq_insn) */ - { CPU_MMX, MOD_GasOnly|MOD_GasSufQ, 0, 0, 0, 2, {0x0F, 0x6F, 0}, 0, 2, - {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, 0} - }, - { CPU_MMX|CPU_Hammer|CPU_64, MOD_GasOnly|MOD_GasSufQ, 64, 0, 0, 2, - {0x0F, 0x6E, 0}, 0, 2, - {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} }, - { CPU_MMX, MOD_GasOnly|MOD_GasSufQ, 0, 0, 0, 2, {0x0F, 0x7F, 0}, 0, 2, - {OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_64|OPA_Spare, 0} - }, - { CPU_MMX|CPU_Hammer|CPU_64, MOD_GasOnly|MOD_GasSufQ, 64, 0, 0, 2, - {0x0F, 0x7E, 0}, 0, 2, - {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_64|OPA_Spare, 0} }, - { CPU_SSE2, MOD_GasOnly|MOD_GasSufQ, 0, 0, 0xF3, 2, {0x0F, 0x7E, 0}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} }, - { CPU_SSE2, MOD_GasOnly|MOD_GasSufQ, 0, 0, 0xF3, 2, {0x0F, 0x7E, 0}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, 0} - }, - { CPU_SSE2|CPU_Hammer|CPU_64, MOD_GasOnly|MOD_GasSufQ, 64, 0, 0x66, 2, - {0x0F, 0x6E, 0}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} }, - { CPU_SSE2, MOD_GasOnly|MOD_GasSufQ, 0, 0, 0x66, 2, {0x0F, 0xD6, 0}, 0, 2, - {OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} - }, - { CPU_SSE2|CPU_Hammer|CPU_64, MOD_GasOnly|MOD_GasSufQ, 64, 0, 0x66, 2, - {0x0F, 0x7E, 0}, 0, 2, - {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} } -}; - -/* 64-bit absolute move (for GAS). - * These are disabled for GAS for normal mov above. - */ -static const x86_insn_info movabs_insn[] = { - { CPU_Hammer|CPU_64, MOD_GasSufB, 0, 0, 0, 1, {0xA0, 0, 0}, 0, 2, - {OPT_Areg|OPS_8|OPA_None, - OPT_MemOffs|OPS_8|OPS_Relaxed|OPEAS_64|OPA_EA, 0} }, - { CPU_Hammer|CPU_64, MOD_GasSufW, 16, 0, 0, 1, {0xA1, 0, 0}, 0, 2, - {OPT_Areg|OPS_16|OPA_None, - OPT_MemOffs|OPS_16|OPS_Relaxed|OPEAS_64|OPA_EA, 0} }, - { CPU_Hammer|CPU_64, MOD_GasSufL, 32, 0, 0, 1, {0xA1, 0, 0}, 0, 2, - {OPT_Areg|OPS_32|OPA_None, - OPT_MemOffs|OPS_32|OPS_Relaxed|OPEAS_64|OPA_EA, 0} }, - { CPU_Hammer|CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xA1, 0, 0}, 0, 2, - {OPT_Areg|OPS_64|OPA_None, - OPT_MemOffs|OPS_64|OPS_Relaxed|OPEAS_64|OPA_EA, 0} }, - - { CPU_Hammer|CPU_64, MOD_GasSufB, 0, 0, 0, 1, {0xA2, 0, 0}, 0, 2, - {OPT_MemOffs|OPS_8|OPS_Relaxed|OPEAS_64|OPA_EA, - OPT_Areg|OPS_8|OPA_None, 0} }, - { CPU_Hammer|CPU_64, MOD_GasSufW, 16, 0, 0, 1, {0xA3, 0, 0}, 0, 2, - {OPT_MemOffs|OPS_16|OPS_Relaxed|OPEAS_64|OPA_EA, - OPT_Areg|OPS_16|OPA_None, 0} }, - { CPU_Hammer|CPU_64, MOD_GasSufL, 32, 0, 0, 1, {0xA3, 0, 0}, 0, 2, - {OPT_MemOffs|OPS_32|OPS_Relaxed|OPEAS_64|OPA_EA, - OPT_Areg|OPS_32|OPA_None, 0} }, - { CPU_Hammer|CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xA3, 0, 0}, 0, 2, - {OPT_MemOffs|OPS_64|OPS_Relaxed|OPEAS_64|OPA_EA, - OPT_Areg|OPS_64|OPA_None, 0} }, - - /* 64-bit immediate form */ - { CPU_Hammer|CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xB8, 0, 0}, 0, 2, - {OPT_Reg|OPS_64|OPA_Op0Add, OPT_Imm|OPS_64|OPS_Relaxed|OPA_Imm, 0} }, -}; - -/* Move with sign/zero extend */ -static const x86_insn_info movszx_insn[] = { - { CPU_386, MOD_Op1Add|MOD_GasSufB, 16, 0, 0, 2, {0x0F, 0, 0}, 0, 2, - {OPT_Reg|OPS_16|OPA_Spare, OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, 0} }, - { CPU_386, MOD_Op1Add|MOD_GasSufB, 32, 0, 0, 2, {0x0F, 0, 0}, 0, 2, - {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_8|OPA_EA, 0} }, - { CPU_Hammer|CPU_64, MOD_Op1Add|MOD_GasSufB, 64, 0, 0, 2, {0x0F, 0, 0}, 0, - 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_8|OPA_EA, 0} }, - { CPU_386, MOD_Op1Add|MOD_GasSufW, 32, 0, 0, 2, {0x0F, 1, 0}, 0, 2, - {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_16|OPA_EA, 0} }, - { CPU_Hammer|CPU_64, MOD_Op1Add|MOD_GasSufW, 64, 0, 0, 2, {0x0F, 1, 0}, 0, - 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_16|OPA_EA, 0} } -}; - -/* Move with sign-extend doubleword (64-bit mode only) */ -static const x86_insn_info movsxd_insn[] = { - { CPU_Hammer|CPU_64, MOD_GasSufL, 64, 0, 0, 1, {0x63, 0, 0}, 0, 2, - {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_32|OPA_EA, 0} } -}; - -/* Push instructions */ -static const x86_insn_info push_insn[] = { - { CPU_Any, MOD_GasSufW, 16, 64, 0, 1, {0x50, 0, 0}, 0, 1, - {OPT_Reg|OPS_16|OPA_Op0Add, 0, 0} }, - { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0x50, 0, 0}, 0, 1, - {OPT_Reg|OPS_32|OPA_Op0Add, 0, 0} }, - { CPU_Hammer|CPU_64, MOD_GasSufQ, 0, 64, 0, 1, {0x50, 0, 0}, 0, 1, - {OPT_Reg|OPS_64|OPA_Op0Add, 0, 0} }, - { CPU_Any, MOD_GasSufW, 16, 64, 0, 1, {0xFF, 0, 0}, 6, 1, - {OPT_RM|OPS_16|OPA_EA, 0, 0} }, - { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0xFF, 0, 0}, 6, 1, - {OPT_RM|OPS_32|OPA_EA, 0, 0} }, - { CPU_Hammer|CPU_64, MOD_GasSufQ, 0, 64, 0, 1, {0xFF, 0, 0}, 6, 1, - {OPT_RM|OPS_64|OPA_EA, 0, 0} }, - { CPU_186, MOD_GasIllegal, 0, 64, 0, 1, {0x6A, 0, 0}, 0, 1, - {OPT_Imm|OPS_8|OPA_SImm, 0, 0} }, - { CPU_186, MOD_GasOnly|MOD_GasSufB, 0, 64, 0, 1, {0x6A, 0, 0}, 0, 1, - {OPT_Imm|OPS_8|OPS_Relaxed|OPA_SImm, 0, 0} }, - { CPU_186, MOD_GasOnly|MOD_GasSufW, 16, 64, 0, 1, {0x6A, 0x68, 0}, 0, 1, - {OPT_Imm|OPS_16|OPS_Relaxed|OPA_Imm|OPAP_SImm8, 0, 0} }, - { CPU_386|CPU_Not64, MOD_GasOnly|MOD_GasSufL, 32, 0, 0, 1, - {0x6A, 0x68, 0}, 0, 1, - {OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm|OPAP_SImm8, 0, 0} }, - { CPU_Hammer|CPU_64, MOD_GasSufQ, 64, 64, 0, 1, - {0x6A, 0x68, 0}, 0, 1, - {OPT_Imm|OPS_32|OPS_Relaxed|OPA_SImm|OPAP_SImm8, 0, 0} }, - { CPU_186|CPU_Not64, MOD_GasIllegal, 0, 0, 0, 1, - {0x6A, 0x68, 0}, 0, 1, - {OPT_Imm|OPS_BITS|OPS_Relaxed|OPA_Imm|OPAP_SImm8, 0, 0} }, - /* Need these when we don't match the BITS size, but they need to be - * below the above line so the optimizer can kick in by default. - */ - { CPU_186, MOD_GasIllegal, 16, 64, 0, 1, {0x68, 0, 0}, 0, 1, - {OPT_Imm|OPS_16|OPA_Imm, 0, 0} }, - { CPU_386|CPU_Not64, MOD_GasIllegal, 32, 0, 0, 1, {0x68, 0, 0}, 0, 1, - {OPT_Imm|OPS_32|OPA_Imm, 0, 0} }, - { CPU_Hammer|CPU_64, MOD_GasIllegal, 64, 64, 0, 1, {0x68, 0, 0}, 0, 1, - {OPT_Imm|OPS_32|OPA_SImm, 0, 0} }, - { CPU_Not64, 0, 0, 0, 0, 1, {0x0E, 0, 0}, 0, 1, - {OPT_CS|OPS_Any|OPA_None, 0, 0} }, - { CPU_Not64, MOD_GasSufW, 16, 0, 0, 1, {0x0E, 0, 0}, 0, 1, - {OPT_CS|OPS_16|OPA_None, 0, 0} }, - { CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0x0E, 0, 0}, 0, 1, - {OPT_CS|OPS_32|OPA_None, 0, 0} }, - { CPU_Not64, 0, 0, 0, 0, 1, {0x16, 0, 0}, 0, 1, - {OPT_SS|OPS_Any|OPA_None, 0, 0} }, - { CPU_Not64, MOD_GasSufW, 16, 0, 0, 1, {0x16, 0, 0}, 0, 1, - {OPT_SS|OPS_16|OPA_None, 0, 0} }, - { CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0x16, 0, 0}, 0, 1, - {OPT_SS|OPS_32|OPA_None, 0, 0} }, - { CPU_Not64, 0, 0, 0, 0, 1, {0x1E, 0, 0}, 0, 1, - {OPT_DS|OPS_Any|OPA_None, 0, 0} }, - { CPU_Not64, MOD_GasSufW, 16, 0, 0, 1, {0x1E, 0, 0}, 0, 1, - {OPT_DS|OPS_16|OPA_None, 0, 0} }, - { CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0x1E, 0, 0}, 0, 1, - {OPT_DS|OPS_32|OPA_None, 0, 0} }, - { CPU_Not64, 0, 0, 0, 0, 1, {0x06, 0, 0}, 0, 1, - {OPT_ES|OPS_Any|OPA_None, 0, 0} }, - { CPU_Not64, MOD_GasSufW, 16, 0, 0, 1, {0x06, 0, 0}, 0, 1, - {OPT_ES|OPS_16|OPA_None, 0, 0} }, - { CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0x06, 0, 0}, 0, 1, - {OPT_ES|OPS_32|OPA_None, 0, 0} }, - { CPU_386, 0, 0, 0, 0, 2, {0x0F, 0xA0, 0}, 0, 1, - {OPT_FS|OPS_Any|OPA_None, 0, 0} }, - { CPU_386, MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0xA0, 0}, 0, 1, - {OPT_FS|OPS_16|OPA_None, 0, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0xA0, 0}, 0, 1, - {OPT_FS|OPS_32|OPA_None, 0, 0} }, - { CPU_386, 0, 0, 0, 0, 2, {0x0F, 0xA8, 0}, 0, 1, - {OPT_GS|OPS_Any|OPA_None, 0, 0} }, - { CPU_386, MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0xA8, 0}, 0, 1, - {OPT_GS|OPS_16|OPA_None, 0, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0xA8, 0}, 0, 1, - {OPT_GS|OPS_32|OPA_None, 0, 0} } -}; - -/* Pop instructions */ -static const x86_insn_info pop_insn[] = { - { CPU_Any, MOD_GasSufW, 16, 64, 0, 1, {0x58, 0, 0}, 0, 1, - {OPT_Reg|OPS_16|OPA_Op0Add, 0, 0} }, - { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0x58, 0, 0}, 0, 1, - {OPT_Reg|OPS_32|OPA_Op0Add, 0, 0} }, - { CPU_Hammer|CPU_64, MOD_GasSufQ, 0, 64, 0, 1, {0x58, 0, 0}, 0, 1, - {OPT_Reg|OPS_64|OPA_Op0Add, 0, 0} }, - { CPU_Any, MOD_GasSufW, 16, 64, 0, 1, {0x8F, 0, 0}, 0, 1, - {OPT_RM|OPS_16|OPA_EA, 0, 0} }, - { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0x8F, 0, 0}, 0, 1, - {OPT_RM|OPS_32|OPA_EA, 0, 0} }, - { CPU_Hammer|CPU_64, MOD_GasSufQ, 0, 64, 0, 1, {0x8F, 0, 0}, 0, 1, - {OPT_RM|OPS_64|OPA_EA, 0, 0} }, - /* POP CS is debateably valid on the 8086, if obsolete and undocumented. - * We don't include it because it's VERY unlikely it will ever be used - * anywhere. If someone really wants it they can db 0x0F it. - */ - /*{ CPU_Any|CPU_Undoc|CPU_Obs, 0, 0, 1, {0x0F, 0, 0}, 0, 1, - {OPT_CS|OPS_Any|OPA_None, 0, 0} },*/ - { CPU_Not64, 0, 0, 0, 0, 1, {0x17, 0, 0}, 0, 1, - {OPT_SS|OPS_Any|OPA_None, 0, 0} }, - { CPU_Not64, 0, 16, 0, 0, 1, {0x17, 0, 0}, 0, 1, - {OPT_SS|OPS_16|OPA_None, 0, 0} }, - { CPU_Not64, 0, 32, 0, 0, 1, {0x17, 0, 0}, 0, 1, - {OPT_SS|OPS_32|OPA_None, 0, 0} }, - { CPU_Not64, 0, 0, 0, 0, 1, {0x1F, 0, 0}, 0, 1, - {OPT_DS|OPS_Any|OPA_None, 0, 0} }, - { CPU_Not64, 0, 16, 0, 0, 1, {0x1F, 0, 0}, 0, 1, - {OPT_DS|OPS_16|OPA_None, 0, 0} }, - { CPU_Not64, 0, 32, 0, 0, 1, {0x1F, 0, 0}, 0, 1, - {OPT_DS|OPS_32|OPA_None, 0, 0} }, - { CPU_Not64, 0, 0, 0, 0, 1, {0x07, 0, 0}, 0, 1, - {OPT_ES|OPS_Any|OPA_None, 0, 0} }, - { CPU_Not64, 0, 16, 0, 0, 1, {0x07, 0, 0}, 0, 1, - {OPT_ES|OPS_16|OPA_None, 0, 0} }, - { CPU_Not64, 0, 32, 0, 0, 1, {0x07, 0, 0}, 0, 1, - {OPT_ES|OPS_32|OPA_None, 0, 0} }, - { CPU_386, 0, 0, 0, 0, 2, {0x0F, 0xA1, 0}, 0, 1, - {OPT_FS|OPS_Any|OPA_None, 0, 0} }, - { CPU_386, 0, 16, 0, 0, 2, {0x0F, 0xA1, 0}, 0, 1, - {OPT_FS|OPS_16|OPA_None, 0, 0} }, - { CPU_386, 0, 32, 0, 0, 2, {0x0F, 0xA1, 0}, 0, 1, - {OPT_FS|OPS_32|OPA_None, 0, 0} }, - { CPU_386, 0, 0, 0, 0, 2, {0x0F, 0xA9, 0}, 0, 1, - {OPT_GS|OPS_Any|OPA_None, 0, 0} }, - { CPU_386, 0, 16, 0, 0, 2, {0x0F, 0xA9, 0}, 0, 1, - {OPT_GS|OPS_16|OPA_None, 0, 0} }, - { CPU_386, 0, 32, 0, 0, 2, {0x0F, 0xA9, 0}, 0, 1, - {OPT_GS|OPS_32|OPA_None, 0, 0} } -}; - -/* Exchange instructions */ -static const x86_insn_info xchg_insn[] = { - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0x86, 0, 0}, 0, 2, - {OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_8|OPA_Spare, 0} }, - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0x86, 0, 0}, 0, 2, - {OPT_Reg|OPS_8|OPA_Spare, OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, 0} }, - /* We could be extra-efficient in the 64-bit mode case here. - * XCHG AX, AX in 64-bit mode is a NOP, as it doesn't clear the - * high 48 bits of RAX. Thus we don't need the operand-size prefix. - * But this feels too clever, and probably not what the user really - * expects in the generated code, so we don't do it. - * - * { CPU_Any|CPU_64, MOD_GasSufW, 0, 0, 0, 1, {0x90, 0, 0}, 0, 2, - * {OPT_Areg|OPS_16|OPA_None, OPT_Areg|OPS_16|OPA_Op0Add, 0} }, - */ - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x90, 0, 0}, 0, 2, - {OPT_Areg|OPS_16|OPA_None, OPT_Reg|OPS_16|OPA_Op0Add, 0} }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x90, 0, 0}, 0, 2, - {OPT_Reg|OPS_16|OPA_Op0Add, OPT_Areg|OPS_16|OPA_None, 0} }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x87, 0, 0}, 0, 2, - {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_16|OPA_Spare, 0} }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x87, 0, 0}, 0, 2, - {OPT_Reg|OPS_16|OPA_Spare, OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, 0} }, - /* Be careful with XCHG EAX, EAX in 64-bit mode. This needs to use - * the long form rather than the NOP form, as the long form clears - * the high 32 bits of RAX. This makes all 32-bit forms in 64-bit - * mode have consistent operation. - */ - { CPU_386|CPU_64, MOD_GasSufL, 32, 0, 0, 1, {0x87, 0, 0}, 0, 2, - {OPT_Areg|OPS_32|OPA_EA, OPT_Areg|OPS_32|OPA_Spare, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x90, 0, 0}, 0, 2, - {OPT_Areg|OPS_32|OPA_None, OPT_Reg|OPS_32|OPA_Op0Add, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x90, 0, 0}, 0, 2, - {OPT_Reg|OPS_32|OPA_Op0Add, OPT_Areg|OPS_32|OPA_None, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x87, 0, 0}, 0, 2, - {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_32|OPA_Spare, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x87, 0, 0}, 0, 2, - {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} }, - /* Be efficient with XCHG RAX, RAX. - * This is a NOP and thus doesn't need the REX prefix. - */ - { CPU_Hammer|CPU_64, MOD_GasSufQ, 0, 0, 0, 1, {0x90, 0, 0}, 0, 2, - {OPT_Areg|OPS_64|OPA_None, OPT_Areg|OPS_64|OPA_Op0Add, 0} }, - { CPU_Hammer|CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x90, 0, 0}, 0, 2, - {OPT_Areg|OPS_64|OPA_None, OPT_Reg|OPS_64|OPA_Op0Add, 0} }, - { CPU_Hammer|CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x90, 0, 0}, 0, 2, - {OPT_Reg|OPS_64|OPA_Op0Add, OPT_Areg|OPS_64|OPA_None, 0} }, - { CPU_Hammer|CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x87, 0, 0}, 0, 2, - {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_64|OPA_Spare, 0} }, - { CPU_Hammer|CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x87, 0, 0}, 0, 2, - {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} } -}; - -/* In/out from ports */ -static const x86_insn_info in_insn[] = { - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xE4, 0, 0}, 0, 2, - {OPT_Areg|OPS_8|OPA_None, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xE5, 0, 0}, 0, 2, - {OPT_Areg|OPS_16|OPA_None, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xE5, 0, 0}, 0, 2, - {OPT_Areg|OPS_32|OPA_None, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xEC, 0, 0}, 0, 2, - {OPT_Areg|OPS_8|OPA_None, OPT_Dreg|OPS_16|OPA_None, 0} }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xED, 0, 0}, 0, 2, - {OPT_Areg|OPS_16|OPA_None, OPT_Dreg|OPS_16|OPA_None, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xED, 0, 0}, 0, 2, - {OPT_Areg|OPS_32|OPA_None, OPT_Dreg|OPS_16|OPA_None, 0} }, - /* GAS-only variants (implict accumulator register) */ - { CPU_Any, MOD_GasOnly|MOD_GasSufB, 0, 0, 0, 1, {0xE4, 0, 0}, 0, 1, - {OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0, 0} }, - { CPU_Any, MOD_GasOnly|MOD_GasSufW, 16, 0, 0, 1, {0xE5, 0, 0}, 0, 1, - {OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0, 0} }, - { CPU_386, MOD_GasOnly|MOD_GasSufL, 32, 0, 0, 1, {0xE5, 0, 0}, 0, 1, - {OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0, 0} }, - { CPU_Any, MOD_GasOnly|MOD_GasSufB, 0, 0, 0, 1, {0xEC, 0, 0}, 0, 1, - {OPT_Dreg|OPS_16|OPA_None, 0, 0} }, - { CPU_Any, MOD_GasOnly|MOD_GasSufW, 16, 0, 0, 1, {0xED, 0, 0}, 0, 1, - {OPT_Dreg|OPS_16|OPA_None, 0, 0} }, - { CPU_386, MOD_GasOnly|MOD_GasSufL, 32, 0, 0, 1, {0xED, 0, 0}, 0, 1, - {OPT_Dreg|OPS_16|OPA_None, 0, 0} } -}; -static const x86_insn_info out_insn[] = { - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xE6, 0, 0}, 0, 2, - {OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, OPT_Areg|OPS_8|OPA_None, 0} }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xE7, 0, 0}, 0, 2, - {OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, OPT_Areg|OPS_16|OPA_None, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xE7, 0, 0}, 0, 2, - {OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, OPT_Areg|OPS_32|OPA_None, 0} }, - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xEE, 0, 0}, 0, 2, - {OPT_Dreg|OPS_16|OPA_None, OPT_Areg|OPS_8|OPA_None, 0} }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xEF, 0, 0}, 0, 2, - {OPT_Dreg|OPS_16|OPA_None, OPT_Areg|OPS_16|OPA_None, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xEF, 0, 0}, 0, 2, - {OPT_Dreg|OPS_16|OPA_None, OPT_Areg|OPS_32|OPA_None, 0} }, - /* GAS-only variants (implict accumulator register) */ - { CPU_Any, MOD_GasOnly|MOD_GasSufB, 0, 0, 0, 1, {0xE6, 0, 0}, 0, 1, - {OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0, 0} }, - { CPU_Any, MOD_GasOnly|MOD_GasSufW, 16, 0, 0, 1, {0xE7, 0, 0}, 0, 1, - {OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0, 0} }, - { CPU_386, MOD_GasOnly|MOD_GasSufL, 32, 0, 0, 1, {0xE7, 0, 0}, 0, 1, - {OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0, 0} }, - { CPU_Any, MOD_GasOnly|MOD_GasSufB, 0, 0, 0, 1, {0xEE, 0, 0}, 0, 1, - {OPT_Dreg|OPS_16|OPA_None, 0, 0} }, - { CPU_Any, MOD_GasOnly|MOD_GasSufW, 16, 0, 0, 1, {0xEF, 0, 0}, 0, 1, - {OPT_Dreg|OPS_16|OPA_None, 0, 0} }, - { CPU_386, MOD_GasOnly|MOD_GasSufL, 32, 0, 0, 1, {0xEF, 0, 0}, 0, 1, - {OPT_Dreg|OPS_16|OPA_None, 0, 0} } -}; - -/* Load effective address */ -static const x86_insn_info lea_insn[] = { - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x8D, 0, 0}, 0, 2, - {OPT_Reg|OPS_16|OPA_Spare, OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x8D, 0, 0}, 0, 2, - {OPT_Reg|OPS_32|OPA_Spare, OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, 0} }, - { CPU_Hammer|CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x8D, 0, 0}, 0, 2, - {OPT_Reg|OPS_64|OPA_Spare, OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0} } -}; - -/* Load segment registers from memory */ -static const x86_insn_info ldes_insn[] = { - { CPU_Not64, MOD_Op0Add|MOD_GasSufW, 16, 0, 0, 1, {0, 0, 0}, 0, 2, - {OPT_Reg|OPS_16|OPA_Spare, OPT_Mem|OPS_Any|OPA_EA, 0} }, - { CPU_386|CPU_Not64, MOD_Op0Add|MOD_GasSufL, 32, 0, 0, 1, {0, 0, 0}, 0, 2, - {OPT_Reg|OPS_32|OPA_Spare, OPT_Mem|OPS_Any|OPA_EA, 0} } -}; -static const x86_insn_info lfgss_insn[] = { - { CPU_386, MOD_Op1Add|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, - {OPT_Reg|OPS_16|OPA_Spare, OPT_Mem|OPS_Any|OPA_EA, 0} }, - { CPU_386, MOD_Op1Add|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, - {OPT_Reg|OPS_32|OPA_Spare, OPT_Mem|OPS_Any|OPA_EA, 0} } -}; - -/* Arithmetic - general */ -static const x86_insn_info arith_insn[] = { - { CPU_Any, MOD_Op0Add|MOD_GasSufB, 0, 0, 0, 1, {0x04, 0, 0}, 0, 2, - {OPT_Areg|OPS_8|OPA_None, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_Any, MOD_Op2Add|MOD_Op1AddSp|MOD_GasSufW, 16, 0, 0, 2, - {0x83, 0xC0, 0x05}, 0, 2, - {OPT_Areg|OPS_16|OPA_None, - OPT_Imm|OPS_16|OPS_Relaxed|OPA_Imm|OPAP_SImm8, 0} }, - { CPU_386, MOD_Op2Add|MOD_Op1AddSp|MOD_GasSufL, 32, 0, 0, 2, - {0x83, 0xC0, 0x05}, 0, 2, - {OPT_Areg|OPS_32|OPA_None, - OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm|OPAP_SImm8, 0} }, - { CPU_Hammer|CPU_64, MOD_Op2Add|MOD_Op1AddSp|MOD_GasSufQ, 64, 0, 0, 2, - {0x83, 0xC0, 0x05}, 0, - 2, {OPT_Areg|OPS_64|OPA_None, - OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm|OPAP_SImm8, 0} }, - - { CPU_Any, MOD_Gap0|MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0x80, 0, 0}, 0, 2, - {OPT_RM|OPS_8|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_Any, MOD_Gap0|MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0x80, 0, 0}, 0, 2, - {OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPA_Imm, 0} }, - - { CPU_Any, MOD_Gap0|MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0x83, 0, 0}, 0, 2, - {OPT_RM|OPS_16|OPA_EA, OPT_Imm|OPS_8|OPA_SImm, 0} }, - { CPU_Any, MOD_Gap0|MOD_SpAdd|MOD_GasIllegal, 16, 0, 0, 1, {0x83, 0x81, 0}, - 0, 2, {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_16|OPA_Imm|OPAP_SImm8, 0} }, - { CPU_Any, MOD_Gap0|MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0x83, 0x81, 0}, 0, - 2, {OPT_RM|OPS_16|OPA_EA, - OPT_Imm|OPS_16|OPS_Relaxed|OPA_Imm|OPAP_SImm8, 0} }, - - { CPU_386, MOD_Gap0|MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0x83, 0, 0}, 0, 2, - {OPT_RM|OPS_32|OPA_EA, OPT_Imm|OPS_8|OPA_SImm, 0} }, - /* Not64 because we can't tell if add [], dword in 64-bit mode is supposed - * to be a qword destination or a dword destination. - */ - { CPU_386|CPU_Not64, MOD_Gap0|MOD_SpAdd|MOD_GasIllegal, 32, 0, 0, 1, - {0x83, 0x81, 0}, 0, 2, - {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_32|OPA_Imm|OPAP_SImm8, 0} }, - { CPU_386, MOD_Gap0|MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0x83, 0x81, 0}, 0, - 2, {OPT_RM|OPS_32|OPA_EA, - OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm|OPAP_SImm8, 0} }, - - /* No relaxed-RM mode for 64-bit destinations; see above Not64 comment. */ - { CPU_Hammer|CPU_64, MOD_Gap0|MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, - {0x83, 0, 0}, 0, 2, - {OPT_RM|OPS_64|OPA_EA, OPT_Imm|OPS_8|OPA_SImm, 0} }, - { CPU_Hammer|CPU_64, MOD_Gap0|MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, - {0x83, 0x81, 0}, 0, 2, - {OPT_RM|OPS_64|OPA_EA, - OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm|OPAP_SImm8, 0} }, - - { CPU_Any, MOD_Op0Add|MOD_GasSufB, 0, 0, 0, 1, {0x00, 0, 0}, 0, 2, - {OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_8|OPA_Spare, 0} }, - { CPU_Any, MOD_Op0Add|MOD_GasSufW, 16, 0, 0, 1, {0x01, 0, 0}, 0, 2, - {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_16|OPA_Spare, 0} }, - { CPU_386, MOD_Op0Add|MOD_GasSufL, 32, 0, 0, 1, {0x01, 0, 0}, 0, 2, - {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_32|OPA_Spare, 0} }, - { CPU_Hammer|CPU_64, MOD_Op0Add|MOD_GasSufQ, 64, 0, 0, 1, {0x01, 0, 0}, 0, - 2, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_64|OPA_Spare, 0} }, - { CPU_Any, MOD_Op0Add|MOD_GasSufB, 0, 0, 0, 1, {0x02, 0, 0}, 0, 2, - {OPT_Reg|OPS_8|OPA_Spare, OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, 0} }, - { CPU_Any, MOD_Op0Add|MOD_GasSufW, 16, 0, 0, 1, {0x03, 0, 0}, 0, 2, - {OPT_Reg|OPS_16|OPA_Spare, OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, 0} }, - { CPU_386, MOD_Op0Add|MOD_GasSufL, 32, 0, 0, 1, {0x03, 0, 0}, 0, 2, - {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} }, - { CPU_Hammer|CPU_64, MOD_Op0Add|MOD_GasSufQ, 64, 0, 0, 1, {0x03, 0, 0}, 0, - 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} } -}; - -/* Arithmetic - inc/dec */ -static const x86_insn_info incdec_insn[] = { - { CPU_Any, MOD_Gap0|MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0xFE, 0, 0}, 0, 1, - {OPT_RM|OPS_8|OPA_EA, 0, 0} }, - { CPU_Not64, MOD_Op0Add|MOD_GasSufW, 16, 0, 0, 1, {0, 0, 0}, 0, 1, - {OPT_Reg|OPS_16|OPA_Op0Add, 0, 0} }, - { CPU_Any, MOD_Gap0|MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0xFF, 0, 0}, 0, - 1, {OPT_RM|OPS_16|OPA_EA, 0, 0} }, - { CPU_386|CPU_Not64, MOD_Op0Add|MOD_GasSufL, 32, 0, 0, 1, {0, 0, 0}, 0, 1, - {OPT_Reg|OPS_32|OPA_Op0Add, 0, 0} }, - { CPU_386, MOD_Gap0|MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0xFF, 0, 0}, 0, 1, - {OPT_RM|OPS_32|OPA_EA, 0, 0} }, - { CPU_Hammer|CPU_64, MOD_Gap0|MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, - {0xFF, 0, 0}, 0, 1, {OPT_RM|OPS_64|OPA_EA, 0, 0} }, -}; - -/* Arithmetic - mul/neg/not F6 opcodes */ -static const x86_insn_info f6_insn[] = { - { CPU_Any, MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0xF6, 0, 0}, 0, 1, - {OPT_RM|OPS_8|OPA_EA, 0, 0} }, - { CPU_Any, MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0xF7, 0, 0}, 0, 1, - {OPT_RM|OPS_16|OPA_EA, 0, 0} }, - { CPU_386, MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0xF7, 0, 0}, 0, 1, - {OPT_RM|OPS_32|OPA_EA, 0, 0} }, - { CPU_Hammer|CPU_64, MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, {0xF7, 0, 0}, 0, - 1, {OPT_RM|OPS_64|OPA_EA, 0, 0} }, -}; - -/* Arithmetic - div/idiv F6 opcodes - * These allow explicit accumulator in GAS mode. - */ -static const x86_insn_info div_insn[] = { - { CPU_Any, MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0xF6, 0, 0}, 0, 1, - {OPT_RM|OPS_8|OPA_EA, 0, 0} }, - { CPU_Any, MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0xF7, 0, 0}, 0, 1, - {OPT_RM|OPS_16|OPA_EA, 0, 0} }, - { CPU_386, MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0xF7, 0, 0}, 0, 1, - {OPT_RM|OPS_32|OPA_EA, 0, 0} }, - { CPU_Hammer|CPU_64, MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, {0xF7, 0, 0}, 0, - 1, {OPT_RM|OPS_64|OPA_EA, 0, 0} }, - /* Versions with explicit accumulator */ - { CPU_Any, MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0xF6, 0, 0}, 0, 2, - {OPT_Areg|OPS_8|OPA_None, OPT_RM|OPS_8|OPA_EA, 0} }, - { CPU_Any, MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0xF7, 0, 0}, 0, 2, - {OPT_Areg|OPS_16|OPA_None, OPT_RM|OPS_16|OPA_EA, 0} }, - { CPU_386, MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0xF7, 0, 0}, 0, 2, - {OPT_Areg|OPS_32|OPA_None, OPT_RM|OPS_32|OPA_EA, 0} }, - { CPU_Hammer|CPU_64, MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, {0xF7, 0, 0}, 0, - 2, {OPT_Areg|OPS_64|OPA_None, OPT_RM|OPS_64|OPA_EA, 0} }, -}; - -/* Arithmetic - test instruction */ -static const x86_insn_info test_insn[] = { - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xA8, 0, 0}, 0, 2, - {OPT_Areg|OPS_8|OPA_None, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xA9, 0, 0}, 0, 2, - {OPT_Areg|OPS_16|OPA_None, OPT_Imm|OPS_16|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xA9, 0, 0}, 0, 2, - {OPT_Areg|OPS_32|OPA_None, OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_Hammer|CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xA9, 0, 0}, 0, 2, - {OPT_Areg|OPS_64|OPA_None, OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm, 0} }, - - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xF6, 0, 0}, 0, 2, - {OPT_RM|OPS_8|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xF6, 0, 0}, 0, 2, - {OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPA_Imm, 0} }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xF7, 0, 0}, 0, 2, - {OPT_RM|OPS_16|OPA_EA, OPT_Imm|OPS_16|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xF7, 0, 0}, 0, 2, - {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_16|OPA_Imm, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xF7, 0, 0}, 0, 2, - {OPT_RM|OPS_32|OPA_EA, OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xF7, 0, 0}, 0, 2, - {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_32|OPA_Imm, 0} }, - { CPU_Hammer|CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xF7, 0, 0}, 0, 2, - {OPT_RM|OPS_64|OPA_EA, OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_Hammer|CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xF7, 0, 0}, 0, 2, - {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_32|OPA_Imm, 0} }, - - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0x84, 0, 0}, 0, 2, - {OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_8|OPA_Spare, 0} }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x85, 0, 0}, 0, 2, - {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_16|OPA_Spare, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x85, 0, 0}, 0, 2, - {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_32|OPA_Spare, 0} }, - { CPU_Hammer|CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x85, 0, 0}, 0, 2, - {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_64|OPA_Spare, 0} }, - - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0x84, 0, 0}, 0, 2, - {OPT_Reg|OPS_8|OPA_Spare, OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, 0} }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x85, 0, 0}, 0, 2, - {OPT_Reg|OPS_16|OPA_Spare, OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x85, 0, 0}, 0, 2, - {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} }, - { CPU_Hammer|CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x85, 0, 0}, 0, 2, - {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} } -}; - -/* Arithmetic - aad/aam */ -static const x86_insn_info aadm_insn[] = { - { CPU_Any, MOD_Op0Add, 0, 0, 0, 2, {0xD4, 0x0A, 0}, 0, 0, {0, 0, 0} }, - { CPU_Any, MOD_Op0Add, 0, 0, 0, 1, {0xD4, 0, 0}, 0, 1, - {OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0, 0} } -}; - -/* Arithmetic - imul */ -static const x86_insn_info imul_insn[] = { - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xF6, 0, 0}, 5, 1, - {OPT_RM|OPS_8|OPA_EA, 0, 0} }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xF7, 0, 0}, 5, 1, - {OPT_RM|OPS_16|OPA_EA, 0, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xF7, 0, 0}, 5, 1, - {OPT_RM|OPS_32|OPA_EA, 0, 0} }, - { CPU_Hammer|CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xF7, 0, 0}, 5, 1, - {OPT_RM|OPS_64|OPA_EA, 0, 0} }, - - { CPU_386, MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0xAF, 0}, 0, 2, - {OPT_Reg|OPS_16|OPA_Spare, OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0xAF, 0}, 0, 2, - {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} }, - { CPU_Hammer|CPU_64, MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0xAF, 0}, 0, 2, - {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} }, - - { CPU_186, MOD_GasSufW, 16, 0, 0, 1, {0x6B, 0, 0}, 0, 3, - {OPT_Reg|OPS_16|OPA_Spare, OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_8|OPA_SImm} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x6B, 0, 0}, 0, 3, - {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_8|OPA_SImm} }, - { CPU_Hammer|CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x6B, 0, 0}, 0, 3, - {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_8|OPA_SImm} }, - - { CPU_186, MOD_GasSufW, 16, 0, 0, 1, {0x6B, 0, 0}, 0, 2, - {OPT_Reg|OPS_16|OPA_SpareEA, OPT_Imm|OPS_8|OPA_SImm, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x6B, 0, 0}, 0, 2, - {OPT_Reg|OPS_32|OPA_SpareEA, OPT_Imm|OPS_8|OPA_SImm, 0} }, - { CPU_Hammer|CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x6B, 0, 0}, 0, 2, - {OPT_Reg|OPS_64|OPA_SpareEA, OPT_Imm|OPS_8|OPA_SImm, 0} }, - - { CPU_186, MOD_GasSufW, 16, 0, 0, 1, {0x6B, 0x69, 0}, 0, 3, - {OPT_Reg|OPS_16|OPA_Spare, OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_16|OPS_Relaxed|OPA_SImm|OPAP_SImm8} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x6B, 0x69, 0}, 0, 3, - {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_32|OPS_Relaxed|OPA_SImm|OPAP_SImm8} }, - { CPU_Hammer|CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x6B, 0x69, 0}, 0, 3, - {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_32|OPS_Relaxed|OPA_SImm|OPAP_SImm8} }, - - { CPU_186, MOD_GasSufW, 16, 0, 0, 1, {0x6B, 0x69, 0}, 0, 2, - {OPT_Reg|OPS_16|OPA_SpareEA, - OPT_Imm|OPS_16|OPS_Relaxed|OPA_SImm|OPAP_SImm8, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x6B, 0x69, 0}, 0, 2, - {OPT_Reg|OPS_32|OPA_SpareEA, - OPT_Imm|OPS_32|OPS_Relaxed|OPA_SImm|OPAP_SImm8, 0} }, - { CPU_Hammer|CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x6B, 0x69, 0}, 0, 2, - {OPT_Reg|OPS_64|OPA_SpareEA, - OPT_Imm|OPS_32|OPS_Relaxed|OPA_SImm|OPAP_SImm8, 0} } -}; - -/* Shifts - standard */ -static const x86_insn_info shift_insn[] = { - { CPU_Any, MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0xD2, 0, 0}, 0, 2, - {OPT_RM|OPS_8|OPA_EA, OPT_Creg|OPS_8|OPA_None, 0} }, - { CPU_Any, MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0xD0, 0, 0}, 0, 2, - {OPT_RM|OPS_8|OPA_EA, OPT_Imm1|OPS_8|OPS_Relaxed|OPA_None, 0} }, - { CPU_186, MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0xC0, 0, 0}, 0, 2, - {OPT_RM|OPS_8|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_Any, MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0xD3, 0, 0}, 0, 2, - {OPT_RM|OPS_16|OPA_EA, OPT_Creg|OPS_8|OPA_None, 0} }, - { CPU_Any, MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0xD1, 0, 0}, 0, 2, - {OPT_RM|OPS_16|OPA_EA, OPT_Imm1|OPS_8|OPS_Relaxed|OPA_None, 0} }, - { CPU_186, MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0xC1, 0, 0}, 0, 2, - {OPT_RM|OPS_16|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_Any, MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0xD3, 0, 0}, 0, 2, - {OPT_RM|OPS_32|OPA_EA, OPT_Creg|OPS_8|OPA_None, 0} }, - { CPU_386, MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0xD1, 0, 0}, 0, 2, - {OPT_RM|OPS_32|OPA_EA, OPT_Imm1|OPS_8|OPS_Relaxed|OPA_None, 0} }, - { CPU_386, MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0xC1, 0, 0}, 0, 2, - {OPT_RM|OPS_32|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_Hammer|CPU_64, MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, {0xD3, 0, 0}, 0, - 2, {OPT_RM|OPS_64|OPA_EA, OPT_Creg|OPS_8|OPA_None, 0} }, - { CPU_Hammer|CPU_64, MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, {0xD1, 0, 0}, - 0, 2, {OPT_RM|OPS_64|OPA_EA, OPT_Imm1|OPS_8|OPS_Relaxed|OPA_None, 0} }, - { CPU_Hammer|CPU_64, MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, {0xC1, 0, 0}, - 0, 2, {OPT_RM|OPS_64|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, - /* In GAS mode, single operands are equivalent to shifting by 1 forms */ - { CPU_Any, MOD_SpAdd|MOD_GasOnly|MOD_GasSufB, 0, 0, 0, 1, {0xD0, 0, 0}, - 0, 1, {OPT_RM|OPS_8|OPA_EA, 0, 0} }, - { CPU_Any, MOD_SpAdd|MOD_GasOnly|MOD_GasSufW, 16, 0, 0, 1, {0xD1, 0, 0}, - 0, 1, {OPT_RM|OPS_16|OPA_EA, 0, 0} }, - { CPU_Any, MOD_SpAdd|MOD_GasOnly|MOD_GasSufL, 32, 0, 0, 1, {0xD1, 0, 0}, - 0, 1, {OPT_RM|OPS_32|OPA_EA, 0, 0} }, - { CPU_Hammer|CPU_64, MOD_SpAdd|MOD_GasOnly|MOD_GasSufQ, 64, 0, 0, 1, - {0xD1, 0, 0}, 0, 1, {OPT_RM|OPS_64|OPA_EA, 0, 0} } -}; - -/* Shifts - doubleword */ -static const x86_insn_info shlrd_insn[] = { - { CPU_386, MOD_Op1Add|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x00, 0}, 0, 3, - {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_16|OPA_Spare, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, - { CPU_386, MOD_Op1Add|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x01, 0}, 0, 3, - {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_16|OPA_Spare, - OPT_Creg|OPS_8|OPA_None} }, - { CPU_386, MOD_Op1Add|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x00, 0}, 0, 3, - {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_32|OPA_Spare, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, - { CPU_386, MOD_Op1Add|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x01, 0}, 0, 3, - {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_32|OPA_Spare, - OPT_Creg|OPS_8|OPA_None} }, - { CPU_Hammer|CPU_64, MOD_Op1Add|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x00, 0}, - 0, 3, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_64|OPA_Spare, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, - { CPU_Hammer|CPU_64, MOD_Op1Add|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x01, 0}, - 0, 3, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_64|OPA_Spare, - OPT_Creg|OPS_8|OPA_None} }, - /* GAS parser supports two-operand form for shift with CL count */ - { CPU_386, MOD_Op1Add|MOD_GasOnly|MOD_GasSufW, 16, 0, 0, 2, - {0x0F, 0x01, 0}, 0, 2, - {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_16|OPA_Spare, 0} }, - { CPU_386, MOD_Op1Add|MOD_GasOnly|MOD_GasSufL, 32, 0, 0, 2, - {0x0F, 0x01, 0}, 0, 2, - {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_32|OPA_Spare, 0} }, - { CPU_Hammer|CPU_64, MOD_Op1Add|MOD_GasOnly|MOD_GasSufQ, 64, 0, 0, 2, - {0x0F, 0x01, 0}, 0, 2, - {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_64|OPA_Spare, 0} } -}; - -/* Control transfer instructions (unconditional) */ -static const x86_insn_info call_insn[] = { - { CPU_Any, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 1, - {OPT_ImmNotSegOff|OPS_Any|OPA_JmpRel, 0, 0} }, - { CPU_Any, 0, 16, 0, 0, 0, {0, 0, 0}, 0, 1, - {OPT_ImmNotSegOff|OPS_16|OPA_JmpRel, 0, 0} }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 0, {0, 0, 0}, 0, 1, - {OPT_ImmNotSegOff|OPS_32|OPA_JmpRel, 0, 0} }, - { CPU_Hammer|CPU_64, 0, 64, 0, 0, 0, {0, 0, 0}, 0, 1, - {OPT_ImmNotSegOff|OPS_32|OPA_JmpRel, 0, 0} }, - - { CPU_Any, 0, 16, 64, 0, 1, {0xE8, 0, 0}, 0, 1, - {OPT_Imm|OPS_16|OPTM_Near|OPA_JmpRel, 0, 0} }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0xE8, 0, 0}, 0, 1, - {OPT_Imm|OPS_32|OPTM_Near|OPA_JmpRel, 0, 0} }, - { CPU_Hammer|CPU_64, 0, 64, 64, 0, 1, {0xE8, 0, 0}, 0, 1, - {OPT_Imm|OPS_32|OPTM_Near|OPA_JmpRel, 0, 0} }, - { CPU_Any, 0, 0, 64, 0, 1, {0xE8, 0, 0}, 0, 1, - {OPT_Imm|OPS_Any|OPTM_Near|OPA_JmpRel, 0, 0} }, - - { CPU_Any, 0, 16, 0, 0, 1, {0xFF, 0, 0}, 2, 1, - {OPT_RM|OPS_16|OPA_EA, 0, 0} }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0xFF, 0, 0}, 2, 1, - {OPT_RM|OPS_32|OPA_EA, 0, 0} }, - { CPU_Hammer|CPU_64, 0, 64, 64, 0, 1, {0xFF, 0, 0}, 2, 1, - {OPT_RM|OPS_64|OPA_EA, 0, 0} }, - { CPU_Any, 0, 0, 64, 0, 1, {0xFF, 0, 0}, 2, 1, - {OPT_Mem|OPS_Any|OPA_EA, 0, 0} }, - { CPU_Any, 0, 16, 64, 0, 1, {0xFF, 0, 0}, 2, 1, - {OPT_RM|OPS_16|OPTM_Near|OPA_EA, 0, 0} }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0xFF, 0, 0}, 2, 1, - {OPT_RM|OPS_32|OPTM_Near|OPA_EA, 0, 0} }, - { CPU_Hammer|CPU_64, 0, 64, 64, 0, 1, {0xFF, 0, 0}, 2, 1, - {OPT_RM|OPS_64|OPTM_Near|OPA_EA, 0, 0} }, - { CPU_Any, 0, 0, 64, 0, 1, {0xFF, 0, 0}, 2, 1, - {OPT_Mem|OPS_Any|OPTM_Near|OPA_EA, 0, 0} }, - - /* Far indirect (through memory). Needs explicit FAR override. */ - { CPU_Any, 0, 16, 0, 0, 1, {0xFF, 0, 0}, 3, 1, - {OPT_Mem|OPS_16|OPTM_Far|OPA_EA, 0, 0} }, - { CPU_386, 0, 32, 0, 0, 1, {0xFF, 0, 0}, 3, 1, - {OPT_Mem|OPS_32|OPTM_Far|OPA_EA, 0, 0} }, - { CPU_EM64T|CPU_64, 0, 64, 0, 0, 1, {0xFF, 0, 0}, 3, 1, - {OPT_Mem|OPS_64|OPTM_Far|OPA_EA, 0, 0} }, - { CPU_Any, 0, 0, 0, 0, 1, {0xFF, 0, 0}, 3, 1, - {OPT_Mem|OPS_Any|OPTM_Far|OPA_EA, 0, 0} }, - - /* With explicit FAR override */ - { CPU_Not64, 0, 16, 0, 0, 1, {0x9A, 0, 0}, 3, 1, - {OPT_Imm|OPS_16|OPTM_Far|OPA_JmpFar, 0, 0} }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0x9A, 0, 0}, 3, 1, - {OPT_Imm|OPS_32|OPTM_Far|OPA_JmpFar, 0, 0} }, - { CPU_Not64, 0, 0, 0, 0, 1, {0x9A, 0, 0}, 3, 1, - {OPT_Imm|OPS_Any|OPTM_Far|OPA_JmpFar, 0, 0} }, - - /* Since not caught by first ImmNotSegOff group, implicitly FAR. */ - { CPU_Not64, 0, 16, 0, 0, 1, {0x9A, 0, 0}, 3, 1, - {OPT_Imm|OPS_16|OPA_JmpFar, 0, 0} }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0x9A, 0, 0}, 3, 1, - {OPT_Imm|OPS_32|OPA_JmpFar, 0, 0} }, - { CPU_Not64, 0, 0, 0, 0, 1, {0x9A, 0, 0}, 3, 1, - {OPT_Imm|OPS_Any|OPA_JmpFar, 0, 0} } -}; -static const x86_insn_info jmp_insn[] = { - { CPU_Any, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 1, - {OPT_ImmNotSegOff|OPS_Any|OPA_JmpRel, 0, 0} }, - { CPU_Any, 0, 16, 0, 0, 0, {0, 0, 0}, 0, 1, - {OPT_ImmNotSegOff|OPS_16|OPA_JmpRel, 0, 0} }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0, 0, 0}, 0, 1, - {OPT_ImmNotSegOff|OPS_32|OPA_JmpRel, 0, 0} }, - { CPU_Hammer|CPU_64, 0, 64, 0, 0, 1, {0, 0, 0}, 0, 1, - {OPT_ImmNotSegOff|OPS_32|OPA_JmpRel, 0, 0} }, - - { CPU_Any, 0, 0, 64, 0, 1, {0xEB, 0, 0}, 0, 1, - {OPT_Imm|OPS_Any|OPTM_Short|OPA_JmpRel, 0, 0} }, - { CPU_Any, 0, 16, 64, 0, 1, {0xE9, 0, 0}, 0, 1, - {OPT_Imm|OPS_16|OPTM_Near|OPA_JmpRel, 0, 0} }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0xE9, 0, 0}, 0, 1, - {OPT_Imm|OPS_32|OPTM_Near|OPA_JmpRel, 0, 0} }, - { CPU_Hammer|CPU_64, 0, 64, 64, 0, 1, {0xE9, 0, 0}, 0, 1, - {OPT_Imm|OPS_32|OPTM_Near|OPA_JmpRel, 0, 0} }, - { CPU_Any, 0, 0, 64, 0, 1, {0xE9, 0, 0}, 0, 1, - {OPT_Imm|OPS_Any|OPTM_Near|OPA_JmpRel, 0, 0} }, - - { CPU_Any, 0, 16, 64, 0, 1, {0xFF, 0, 0}, 4, 1, - {OPT_RM|OPS_16|OPA_EA, 0, 0} }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0xFF, 0, 0}, 4, 1, - {OPT_RM|OPS_32|OPA_EA, 0, 0} }, - { CPU_Hammer|CPU_64, 0, 64, 64, 0, 1, {0xFF, 0, 0}, 4, 1, - {OPT_RM|OPS_64|OPA_EA, 0, 0} }, - { CPU_Any, 0, 0, 64, 0, 1, {0xFF, 0, 0}, 4, 1, - {OPT_Mem|OPS_Any|OPA_EA, 0, 0} }, - { CPU_Any, 0, 16, 64, 0, 1, {0xFF, 0, 0}, 4, 1, - {OPT_RM|OPS_16|OPTM_Near|OPA_EA, 0, 0} }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0xFF, 0, 0}, 4, 1, - {OPT_RM|OPS_32|OPTM_Near|OPA_EA, 0, 0} }, - { CPU_Hammer|CPU_64, 0, 64, 64, 0, 1, {0xFF, 0, 0}, 4, 1, - {OPT_RM|OPS_64|OPTM_Near|OPA_EA, 0, 0} }, - { CPU_Any, 0, 0, 64, 0, 1, {0xFF, 0, 0}, 4, 1, - {OPT_Mem|OPS_Any|OPTM_Near|OPA_EA, 0, 0} }, - - /* Far indirect (through memory). Needs explicit FAR override. */ - { CPU_Any, 0, 16, 0, 0, 1, {0xFF, 0, 0}, 5, 1, - {OPT_Mem|OPS_16|OPTM_Far|OPA_EA, 0, 0} }, - { CPU_386, 0, 32, 0, 0, 1, {0xFF, 0, 0}, 5, 1, - {OPT_Mem|OPS_32|OPTM_Far|OPA_EA, 0, 0} }, - { CPU_EM64T|CPU_64, 0, 64, 0, 0, 1, {0xFF, 0, 0}, 5, 1, - {OPT_Mem|OPS_64|OPTM_Far|OPA_EA, 0, 0} }, - { CPU_Any, 0, 0, 0, 0, 1, {0xFF, 0, 0}, 5, 1, - {OPT_Mem|OPS_Any|OPTM_Far|OPA_EA, 0, 0} }, - - /* With explicit FAR override */ - { CPU_Not64, 0, 16, 0, 0, 1, {0xEA, 0, 0}, 3, 1, - {OPT_Imm|OPS_16|OPTM_Far|OPA_JmpFar, 0, 0} }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0xEA, 0, 0}, 3, 1, - {OPT_Imm|OPS_32|OPTM_Far|OPA_JmpFar, 0, 0} }, - { CPU_Not64, 0, 0, 0, 0, 1, {0xEA, 0, 0}, 3, 1, - {OPT_Imm|OPS_Any|OPTM_Far|OPA_JmpFar, 0, 0} }, - - /* Since not caught by first ImmNotSegOff group, implicitly FAR. */ - { CPU_Not64, 0, 16, 0, 0, 1, {0xEA, 0, 0}, 3, 1, - {OPT_Imm|OPS_16|OPA_JmpFar, 0, 0} }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0xEA, 0, 0}, 3, 1, - {OPT_Imm|OPS_32|OPA_JmpFar, 0, 0} }, - { CPU_Not64, 0, 0, 0, 0, 1, {0xEA, 0, 0}, 3, 1, - {OPT_Imm|OPS_Any|OPA_JmpFar, 0, 0} } -}; -static const x86_insn_info retnf_insn[] = { - { CPU_Not64, MOD_Op0Add, 0, 0, 0, 1, - {0x01, 0, 0}, 0, 0, {0, 0, 0} }, - { CPU_Not64, MOD_Op0Add, 0, 0, 0, 1, - {0x00, 0, 0}, 0, 1, {OPT_Imm|OPS_16|OPS_Relaxed|OPA_Imm, 0, 0} }, - { CPU_64, MOD_Op0Add|MOD_OpSizeR, 0, 0, 0, 1, - {0x01, 0, 0}, 0, 0, {0, 0, 0} }, - { CPU_64, MOD_Op0Add|MOD_OpSizeR, 0, 0, 0, 1, - {0x00, 0, 0}, 0, 1, {OPT_Imm|OPS_16|OPS_Relaxed|OPA_Imm, 0, 0} }, - /* GAS suffix versions */ - { CPU_Any, MOD_Op0Add|MOD_OpSizeR|MOD_GasSufW|MOD_GasSufL|MOD_GasSufQ, 0, - 0, 0, 1, {0x01, 0, 0}, 0, 0, {0, 0, 0} }, - { CPU_Any, MOD_Op0Add|MOD_OpSizeR|MOD_GasSufW|MOD_GasSufL|MOD_GasSufQ, 0, - 0, 0, 1, {0x00, 0, 0}, 0, 1, {OPT_Imm|OPS_16|OPS_Relaxed|OPA_Imm, 0, 0} } -}; -static const x86_insn_info enter_insn[] = { - { CPU_186|CPU_Not64, MOD_GasNoRev|MOD_GasSufL, 0, 0, 0, 1, {0xC8, 0, 0}, 0, - 2, {OPT_Imm|OPS_16|OPS_Relaxed|OPA_EA|OPAP_A16, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_Hammer|CPU_64, MOD_GasNoRev|MOD_GasSufQ, 64, 64, 0, 1, {0xC8, 0, 0}, - 0, 2, {OPT_Imm|OPS_16|OPS_Relaxed|OPA_EA|OPAP_A16, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, - /* GAS suffix version */ - { CPU_186, MOD_GasOnly|MOD_GasNoRev|MOD_GasSufW, 16, 0, 0, 1, - {0xC8, 0, 0}, 0, 2, {OPT_Imm|OPS_16|OPS_Relaxed|OPA_EA|OPAP_A16, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, -}; - -/* Conditional jumps */ -static const x86_insn_info jcc_insn[] = { - { CPU_Any, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 1, - {OPT_Imm|OPS_Any|OPA_JmpRel, 0, 0} }, - { CPU_Any, 0, 16, 0, 0, 0, {0, 0, 0}, 0, 1, - {OPT_Imm|OPS_16|OPA_JmpRel, 0, 0} }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 0, {0, 0, 0}, 0, 1, - {OPT_Imm|OPS_32|OPA_JmpRel, 0, 0} }, - { CPU_Hammer|CPU_64, 0, 64, 0, 0, 0, {0, 0, 0}, 0, 1, - {OPT_Imm|OPS_32|OPA_JmpRel, 0, 0} }, - - { CPU_Any, MOD_Op0Add, 0, 64, 0, 1, {0x70, 0, 0}, 0, 1, - {OPT_Imm|OPS_Any|OPTM_Short|OPA_JmpRel, 0, 0} }, - { CPU_386, MOD_Op1Add, 16, 64, 0, 2, {0x0F, 0x80, 0}, 0, 1, - {OPT_Imm|OPS_16|OPTM_Near|OPA_JmpRel, 0, 0} }, - { CPU_386|CPU_Not64, MOD_Op1Add, 32, 0, 0, 2, {0x0F, 0x80, 0}, 0, 1, - {OPT_Imm|OPS_32|OPTM_Near|OPA_JmpRel, 0, 0} }, - { CPU_Hammer|CPU_64, MOD_Op1Add, 64, 64, 0, 2, {0x0F, 0x80, 0}, 0, 1, - {OPT_Imm|OPS_32|OPTM_Near|OPA_JmpRel, 0, 0} }, - { CPU_386, MOD_Op1Add, 0, 64, 0, 2, {0x0F, 0x80, 0}, 0, 1, - {OPT_Imm|OPS_Any|OPTM_Near|OPA_JmpRel, 0, 0} } -}; -static const x86_insn_info jcxz_insn[] = { - { CPU_Any, MOD_AdSizeR, 0, 0, 0, 0, {0, 0, 0}, 0, 1, - {OPT_Imm|OPS_Any|OPA_JmpRel, 0, 0} }, - { CPU_Any, MOD_AdSizeR, 0, 64, 0, 1, {0xE3, 0, 0}, 0, 1, - {OPT_Imm|OPS_Any|OPTM_Short|OPA_JmpRel, 0, 0} } -}; - -/* Loop instructions */ -static const x86_insn_info loop_insn[] = { - { CPU_Any, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 1, - {OPT_Imm|OPS_Any|OPA_JmpRel, 0, 0} }, - { CPU_Not64, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 2, - {OPT_Imm|OPS_Any|OPA_JmpRel, OPT_Creg|OPS_16|OPA_AdSizeR, 0} }, - { CPU_386, 0, 0, 64, 0, 0, {0, 0, 0}, 0, 2, - {OPT_Imm|OPS_Any|OPA_JmpRel, OPT_Creg|OPS_32|OPA_AdSizeR, 0} }, - { CPU_Hammer|CPU_64, 0, 0, 64, 0, 0, {0, 0, 0}, 0, 2, - {OPT_Imm|OPS_Any|OPA_JmpRel, OPT_Creg|OPS_64|OPA_AdSizeR, 0} }, - - { CPU_Not64, MOD_Op0Add, 0, 0, 0, 1, {0xE0, 0, 0}, 0, 1, - {OPT_Imm|OPS_Any|OPTM_Short|OPA_JmpRel, 0, 0} }, - { CPU_Any, MOD_Op0Add, 0, 64, 0, 1, {0xE0, 0, 0}, 0, 2, - {OPT_Imm|OPS_Any|OPTM_Short|OPA_JmpRel, OPT_Creg|OPS_16|OPA_AdSizeR, 0} - }, - { CPU_386, MOD_Op0Add, 0, 64, 0, 1, {0xE0, 0, 0}, 0, 2, - {OPT_Imm|OPS_Any|OPTM_Short|OPA_JmpRel, OPT_Creg|OPS_32|OPA_AdSizeR, 0} - }, - { CPU_Hammer|CPU_64, MOD_Op0Add, 0, 64, 0, 1, {0xE0, 0, 0}, 0, 2, - {OPT_Imm|OPS_Any|OPTM_Short|OPA_JmpRel, OPT_Creg|OPS_64|OPA_AdSizeR, 0} } -}; - -/* Set byte on flag instructions */ -static const x86_insn_info setcc_insn[] = { - { CPU_386, MOD_Op1Add|MOD_GasSufB, 0, 0, 0, 2, {0x0F, 0x90, 0}, 2, 1, - {OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, 0, 0} } -}; - -/* Bit manipulation - bit tests */ -static const x86_insn_info bittest_insn[] = { - { CPU_386, MOD_Op1Add|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, - {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_16|OPA_Spare, 0} }, - { CPU_386, MOD_Op1Add|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, - {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_32|OPA_Spare, 0} }, - { CPU_Hammer|CPU_64, MOD_Op1Add|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x00, 0}, - 0, 2, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_64|OPA_Spare, 0} }, - { CPU_386, MOD_Gap0|MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0xBA, 0}, - 0, 2, {OPT_RM|OPS_16|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_386, MOD_Gap0|MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0xBA, 0}, - 0, 2, {OPT_RM|OPS_32|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_Hammer|CPU_64, MOD_Gap0|MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 2, - {0x0F, 0xBA, 0}, 0, 2, - {OPT_RM|OPS_64|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} } -}; - -/* Bit manipulation - bit scans - also used for lar/lsl */ -static const x86_insn_info bsfr_insn[] = { - { CPU_286, MOD_Op1Add|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, - {OPT_Reg|OPS_16|OPA_Spare, OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, 0} }, - { CPU_386, MOD_Op1Add|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, - {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} }, - { CPU_Hammer|CPU_64, MOD_Op1Add|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x00, 0}, - 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} } -}; - -/* Interrupts and operating system instructions */ -static const x86_insn_info int_insn[] = { - { CPU_Any, 0, 0, 0, 0, 1, {0xCD, 0, 0}, 0, 1, - {OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0, 0} } -}; -static const x86_insn_info bound_insn[] = { - { CPU_186, MOD_GasSufW, 16, 0, 0, 1, {0x62, 0, 0}, 0, 2, - {OPT_Reg|OPS_16|OPA_Spare, OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x62, 0, 0}, 0, 2, - {OPT_Reg|OPS_32|OPA_Spare, OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, 0} } -}; - -/* Protection control */ -static const x86_insn_info arpl_insn[] = { - { CPU_286|CPU_Prot, MOD_GasSufW, 0, 0, 0, 1, {0x63, 0, 0}, 0, 2, - {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_16|OPA_Spare, 0} } -}; -static const x86_insn_info str_insn[] = { - { CPU_286|CPU_Prot, MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x00, 0}, 1, 1, - {OPT_Reg|OPS_16|OPA_EA, 0, 0} }, - { CPU_386|CPU_Prot, MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x00, 0}, 1, 1, - {OPT_Reg|OPS_32|OPA_EA, 0, 0} }, - { CPU_Hammer|CPU_64|CPU_Prot, MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x00, 0}, 1, - 1, {OPT_Reg|OPS_64|OPA_EA, 0, 0} }, - { CPU_286|CPU_Prot, MOD_GasSufW|MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0x00, 0}, - 1, 1, {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, 0, 0} } -}; -static const x86_insn_info prot286_insn[] = { - { CPU_286, MOD_Op1Add|MOD_SpAdd|MOD_GasSufW, 0, 0, 0, 2, {0x0F, 0x00, 0}, - 0, 1, {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, 0, 0} } -}; -static const x86_insn_info sldtmsw_insn[] = { - { CPU_286, MOD_Op1Add|MOD_SpAdd|MOD_GasSufW, 0, 0, 0, 2, {0x0F, 0x00, 0}, - 0, 1, {OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, 0, 0} }, - { CPU_386, MOD_Op1Add|MOD_SpAdd|MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0x00, 0}, - 0, 1, {OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, 0, 0} }, - { CPU_Hammer|CPU_64, MOD_Op1Add|MOD_SpAdd|MOD_GasSufQ, 0, 0, 0, 2, - {0x0F, 0x00, 0}, 0, 1, {OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0, 0} }, - { CPU_286, MOD_Op1Add|MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x00, 0}, - 0, 1, {OPT_Reg|OPS_16|OPA_EA, 0, 0} }, - { CPU_386, MOD_Op1Add|MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x00, 0}, - 0, 1, {OPT_Reg|OPS_32|OPA_EA, 0, 0} }, - { CPU_Hammer|CPU_64, MOD_Op1Add|MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 2, - {0x0F, 0x00, 0}, 0, 1, {OPT_Reg|OPS_64|OPA_EA, 0, 0} } -}; - -/* Floating point instructions - load/store with pop (integer and normal) */ -static const x86_insn_info fld_insn[] = { - { CPU_FPU, MOD_GasSufS, 0, 0, 0, 1, {0xD9, 0, 0}, 0, 1, - {OPT_Mem|OPS_32|OPA_EA, 0, 0} }, - { CPU_FPU, MOD_GasSufL, 0, 0, 0, 1, {0xDD, 0, 0}, 0, 1, - {OPT_Mem|OPS_64|OPA_EA, 0, 0} }, - { CPU_FPU, 0, 0, 0, 0, 1, {0xDB, 0, 0}, 5, 1, - {OPT_Mem|OPS_80|OPA_EA, 0, 0} }, - { CPU_FPU, 0, 0, 0, 0, 2, {0xD9, 0xC0, 0}, 0, 1, - {OPT_Reg|OPS_80|OPA_Op1Add, 0, 0} } -}; -static const x86_insn_info fstp_insn[] = { - { CPU_FPU, MOD_GasSufS, 0, 0, 0, 1, {0xD9, 0, 0}, 3, 1, - {OPT_Mem|OPS_32|OPA_EA, 0, 0} }, - { CPU_FPU, MOD_GasSufL, 0, 0, 0, 1, {0xDD, 0, 0}, 3, 1, - {OPT_Mem|OPS_64|OPA_EA, 0, 0} }, - { CPU_FPU, 0, 0, 0, 0, 1, {0xDB, 0, 0}, 7, 1, - {OPT_Mem|OPS_80|OPA_EA, 0, 0} }, - { CPU_FPU, 0, 0, 0, 0, 2, {0xDD, 0xD8, 0}, 0, 1, - {OPT_Reg|OPS_80|OPA_Op1Add, 0, 0} } -}; -/* Long memory version of floating point load/store for GAS */ -static const x86_insn_info fldstpt_insn[] = { - { CPU_FPU, MOD_SpAdd, 0, 0, 0, 1, {0xDB, 0, 0}, 0, 1, - {OPT_Mem|OPS_80|OPA_EA, 0, 0} } -}; -static const x86_insn_info fildstp_insn[] = { - { CPU_FPU, MOD_SpAdd|MOD_GasSufS, 0, 0, 0, 1, {0xDF, 0, 0}, 0, 1, - {OPT_Mem|OPS_16|OPA_EA, 0, 0} }, - { CPU_FPU, MOD_SpAdd|MOD_GasSufL, 0, 0, 0, 1, {0xDB, 0, 0}, 0, 1, - {OPT_Mem|OPS_32|OPA_EA, 0, 0} }, - { CPU_FPU, MOD_Gap0|MOD_Op0Add|MOD_SpAdd|MOD_GasSufQ, 0, 0, 0, 1, - {0xDD, 0, 0}, 0, 1, {OPT_Mem|OPS_64|OPA_EA, 0, 0} } -}; -static const x86_insn_info fbldstp_insn[] = { - { CPU_FPU, MOD_SpAdd, 0, 0, 0, 1, {0xDF, 0, 0}, 0, 1, - {OPT_Mem|OPS_80|OPS_Relaxed|OPA_EA, 0, 0} } -}; -/* Floating point instructions - store (normal) */ -static const x86_insn_info fst_insn[] = { - { CPU_FPU, MOD_GasSufS, 0, 0, 0, 1, {0xD9, 0, 0}, 2, 1, - {OPT_Mem|OPS_32|OPA_EA, 0, 0} }, - { CPU_FPU, MOD_GasSufL, 0, 0, 0, 1, {0xDD, 0, 0}, 2, 1, - {OPT_Mem|OPS_64|OPA_EA, 0, 0} }, - { CPU_FPU, 0, 0, 0, 0, 2, {0xDD, 0xD0, 0}, 0, 1, - {OPT_Reg|OPS_80|OPA_Op1Add, 0, 0} } -}; -/* Floating point instructions - exchange (with ST0) */ -static const x86_insn_info fxch_insn[] = { - { CPU_FPU, 0, 0, 0, 0, 2, {0xD9, 0xC8, 0}, 0, 1, - {OPT_Reg|OPS_80|OPA_Op1Add, 0, 0} }, - { CPU_FPU, 0, 0, 0, 0, 2, {0xD9, 0xC8, 0}, 0, 2, - {OPT_ST0|OPS_80|OPA_None, OPT_Reg|OPS_80|OPA_Op1Add, 0} }, - { CPU_FPU, 0, 0, 0, 0, 2, {0xD9, 0xC8, 0}, 0, 2, - {OPT_Reg|OPS_80|OPA_Op1Add, OPT_ST0|OPS_80|OPA_None, 0} }, - { CPU_FPU, 0, 0, 0, 0, 2, {0xD9, 0xC9, 0}, 0, 0, {0, 0, 0} } -}; -/* Floating point instructions - comparisons */ -static const x86_insn_info fcom_insn[] = { - { CPU_FPU, MOD_Gap0|MOD_SpAdd|MOD_GasSufS, 0, 0, 0, 1, {0xD8, 0, 0}, 0, 1, - {OPT_Mem|OPS_32|OPA_EA, 0, 0} }, - { CPU_FPU, MOD_Gap0|MOD_SpAdd|MOD_GasSufL, 0, 0, 0, 1, {0xDC, 0, 0}, 0, 1, - {OPT_Mem|OPS_64|OPA_EA, 0, 0} }, - { CPU_FPU, MOD_Op1Add, 0, 0, 0, 2, {0xD8, 0x00, 0}, 0, 1, - {OPT_Reg|OPS_80|OPA_Op1Add, 0, 0} }, - /* Alias for fcom %st(1) for GAS compat */ - { CPU_FPU, MOD_Op1Add|MOD_GasOnly, 0, 0, 0, 2, {0xD8, 0x01, 0}, 0, 0, - {0, 0, 0} }, - { CPU_FPU, MOD_Op1Add|MOD_GasIllegal, 0, 0, 0, 2, {0xD8, 0x00, 0}, 0, 2, - {OPT_ST0|OPS_80|OPA_None, OPT_Reg|OPS_80|OPA_Op1Add, 0} } -}; -/* Floating point instructions - extended comparisons */ -static const x86_insn_info fcom2_insn[] = { - { CPU_286|CPU_FPU, MOD_Op0Add|MOD_Op1Add, 0, 0, 0, 2, {0x00, 0x00, 0}, - 0, 1, {OPT_Reg|OPS_80|OPA_Op1Add, 0, 0} }, - { CPU_286|CPU_FPU, MOD_Op0Add|MOD_Op1Add, 0, 0, 0, 2, {0x00, 0x00, 0}, - 0, 2, {OPT_ST0|OPS_80|OPA_None, OPT_Reg|OPS_80|OPA_Op1Add, 0} } -}; -/* Floating point instructions - arithmetic */ -static const x86_insn_info farith_insn[] = { - { CPU_FPU, MOD_Gap0|MOD_Gap1|MOD_SpAdd|MOD_GasSufS, 0, 0, 0, 1, - {0xD8, 0, 0}, 0, 1, {OPT_Mem|OPS_32|OPA_EA, 0, 0} }, - { CPU_FPU, MOD_Gap0|MOD_Gap1|MOD_SpAdd|MOD_GasSufL, 0, 0, 0, 1, - {0xDC, 0, 0}, 0, 1, {OPT_Mem|OPS_64|OPA_EA, 0, 0} }, - { CPU_FPU, MOD_Gap0|MOD_Op1Add, 0, 0, 0, 2, {0xD8, 0x00, 0}, 0, 1, - {OPT_Reg|OPS_80|OPA_Op1Add, 0, 0} }, - { CPU_FPU, MOD_Gap0|MOD_Op1Add, 0, 0, 0, 2, {0xD8, 0x00, 0}, 0, 2, - {OPT_ST0|OPS_80|OPA_None, OPT_Reg|OPS_80|OPA_Op1Add, 0} }, - { CPU_FPU, MOD_Op1Add, 0, 0, 0, 2, {0xDC, 0x00, 0}, 0, 1, - {OPT_Reg|OPS_80|OPTM_To|OPA_Op1Add, 0, 0} }, - { CPU_FPU, MOD_Op1Add|MOD_GasIllegal, 0, 0, 0, 2, {0xDC, 0x00, 0}, 0, 2, - {OPT_Reg|OPS_80|OPA_Op1Add, OPT_ST0|OPS_80|OPA_None, 0} }, - { CPU_FPU, MOD_Gap0|MOD_Op1Add|MOD_GasOnly, 0, 0, 0, 2, {0xDC, 0x00, 0}, - 0, 2, {OPT_Reg|OPS_80|OPA_Op1Add, OPT_ST0|OPS_80|OPA_None, 0} } -}; -static const x86_insn_info farithp_insn[] = { - { CPU_FPU, MOD_Op1Add, 0, 0, 0, 2, {0xDE, 0x01, 0}, 0, 0, {0, 0, 0} }, - { CPU_FPU, MOD_Op1Add, 0, 0, 0, 2, {0xDE, 0x00, 0}, 0, 1, - {OPT_Reg|OPS_80|OPA_Op1Add, 0, 0} }, - { CPU_FPU, MOD_Op1Add, 0, 0, 0, 2, {0xDE, 0x00, 0}, 0, 2, - {OPT_Reg|OPS_80|OPA_Op1Add, OPT_ST0|OPS_80|OPA_None, 0} } -}; -/* Floating point instructions - integer arith/store wo pop/compare */ -static const x86_insn_info fiarith_insn[] = { - { CPU_FPU, MOD_Op0Add|MOD_SpAdd|MOD_GasSufS, 0, 0, 0, 1, {0x04, 0, 0}, 0, - 1, {OPT_Mem|OPS_16|OPA_EA, 0, 0} }, - { CPU_FPU, MOD_Op0Add|MOD_SpAdd|MOD_GasSufL, 0, 0, 0, 1, {0x00, 0, 0}, 0, - 1, {OPT_Mem|OPS_32|OPA_EA, 0, 0} } -}; -/* Floating point instructions - processor control */ -static const x86_insn_info fldnstcw_insn[] = { - { CPU_FPU, MOD_SpAdd|MOD_GasSufW, 0, 0, 0, 1, {0xD9, 0, 0}, 0, 1, - {OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, 0, 0} } -}; -static const x86_insn_info fstcw_insn[] = { - { CPU_FPU, MOD_GasSufW, 0, 0, 0, 2, {0x9B, 0xD9, 0}, 7, 1, - {OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, 0, 0} } -}; -static const x86_insn_info fnstsw_insn[] = { - { CPU_FPU, MOD_GasSufW, 0, 0, 0, 1, {0xDD, 0, 0}, 7, 1, - {OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, 0, 0} }, - { CPU_FPU, MOD_GasSufW, 0, 0, 0, 2, {0xDF, 0xE0, 0}, 0, 1, - {OPT_Areg|OPS_16|OPA_None, 0, 0} } -}; -static const x86_insn_info fstsw_insn[] = { - { CPU_FPU, MOD_GasSufW, 0, 0, 0, 2, {0x9B, 0xDD, 0}, 7, 1, - {OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, 0, 0} }, - { CPU_FPU, MOD_GasSufW, 0, 0, 0, 3, {0x9B, 0xDF, 0xE0}, 0, 1, - {OPT_Areg|OPS_16|OPA_None, 0, 0} } -}; -static const x86_insn_info ffree_insn[] = { - { CPU_FPU, MOD_Op0Add, 0, 0, 0, 2, {0x00, 0xC0, 0}, 0, 1, - {OPT_Reg|OPS_80|OPA_Op1Add, 0, 0} } -}; - -/* 486 extensions */ -static const x86_insn_info bswap_insn[] = { - { CPU_486, MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0xC8, 0}, 0, 1, - {OPT_Reg|OPS_32|OPA_Op1Add, 0, 0} }, - { CPU_Hammer|CPU_64, MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0xC8, 0}, 0, 1, - {OPT_Reg|OPS_64|OPA_Op1Add, 0, 0} } -}; -static const x86_insn_info cmpxchgxadd_insn[] = { - { CPU_486, MOD_Op1Add|MOD_GasSufB, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, - {OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_8|OPA_Spare, 0} }, - { CPU_486, MOD_Op1Add|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x01, 0}, 0, 2, - {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_16|OPA_Spare, 0} }, - { CPU_486, MOD_Op1Add|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x01, 0}, 0, 2, - {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_32|OPA_Spare, 0} }, - { CPU_Hammer|CPU_64, MOD_Op1Add|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x01, 0}, - 0, 2, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_64|OPA_Spare, 0} } -}; - -/* Pentium extensions */ -static const x86_insn_info cmpxchg8b_insn[] = { - { CPU_586, MOD_GasSufQ, 0, 0, 0, 2, {0x0F, 0xC7, 0}, 1, 1, - {OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0, 0} } -}; - -/* Pentium II/Pentium Pro extensions */ -static const x86_insn_info cmovcc_insn[] = { - { CPU_686, MOD_Op1Add|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x40, 0}, 0, 2, - {OPT_Reg|OPS_16|OPA_Spare, OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, 0} }, - { CPU_686, MOD_Op1Add|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x40, 0}, 0, 2, - {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} }, - { CPU_Hammer|CPU_64, MOD_Op1Add|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x40, 0}, - 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} } -}; -static const x86_insn_info fcmovcc_insn[] = { - { CPU_686|CPU_FPU, MOD_Op0Add|MOD_Op1Add, 0, 0, 0, 2, {0x00, 0x00, 0}, - 0, 2, {OPT_ST0|OPS_80|OPA_None, OPT_Reg|OPS_80|OPA_Op1Add, 0} } -}; - -/* Pentium4 extensions */ -static const x86_insn_info movnti_insn[] = { - { CPU_P4, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0xC3, 0}, 0, 2, - {OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_32|OPA_Spare, 0} }, - { CPU_Hammer|CPU_64, MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0xC3, 0}, 0, 2, - {OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_64|OPA_Spare, 0} } -}; -static const x86_insn_info clflush_insn[] = { - { CPU_P3, 0, 0, 0, 0, 2, {0x0F, 0xAE, 0}, 7, 1, - {OPT_Mem|OPS_8|OPS_Relaxed|OPA_EA, 0, 0} } -}; - -/* MMX/SSE2 instructions */ -static const x86_insn_info movd_insn[] = { - { CPU_MMX, 0, 0, 0, 0, 2, {0x0F, 0x6E, 0}, 0, 2, - {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} }, - { CPU_MMX|CPU_Hammer|CPU_64, 0, 64, 0, 0, 2, {0x0F, 0x6E, 0}, 0, 2, - {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} }, - { CPU_MMX, 0, 0, 0, 0, 2, {0x0F, 0x7E, 0}, 0, 2, - {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_64|OPA_Spare, 0} }, - { CPU_MMX|CPU_Hammer|CPU_64, 0, 64, 0, 0, 2, {0x0F, 0x7E, 0}, 0, 2, - {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_64|OPA_Spare, 0} }, - { CPU_SSE2, 0, 0, 0, 0x66, 2, {0x0F, 0x6E, 0}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} }, - { CPU_SSE2|CPU_Hammer|CPU_64, 0, 64, 0, 0x66, 2, {0x0F, 0x6E, 0}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} }, - { CPU_SSE2, 0, 0, 0, 0x66, 2, {0x0F, 0x7E, 0}, 0, 2, - {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} }, - { CPU_SSE2|CPU_Hammer|CPU_64, 0, 64, 0, 0x66, 2, {0x0F, 0x7E, 0}, 0, 2, - {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} } -}; -static const x86_insn_info movq_insn[] = { - { CPU_MMX, 0, 0, 0, 0, 2, {0x0F, 0x6F, 0}, 0, 2, - {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, 0} - }, - { CPU_MMX|CPU_Hammer|CPU_64, 0, 64, 0, 0, 2, {0x0F, 0x6E, 0}, 0, 2, - {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} }, - { CPU_MMX, 0, 0, 0, 0, 2, {0x0F, 0x7F, 0}, 0, 2, - {OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_64|OPA_Spare, 0} - }, - { CPU_MMX|CPU_Hammer|CPU_64, 0, 64, 0, 0, 2, {0x0F, 0x7E, 0}, 0, 2, - {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_64|OPA_Spare, 0} }, - { CPU_SSE2, 0, 0, 0, 0xF3, 2, {0x0F, 0x7E, 0}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} }, - { CPU_SSE2, 0, 0, 0, 0xF3, 2, {0x0F, 0x7E, 0}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, 0} - }, - { CPU_SSE2|CPU_Hammer|CPU_64, 0, 64, 0, 0x66, 2, {0x0F, 0x6E, 0}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} }, - { CPU_SSE2, 0, 0, 0, 0x66, 2, {0x0F, 0xD6, 0}, 0, 2, - {OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} - }, - { CPU_SSE2|CPU_Hammer|CPU_64, 0, 64, 0, 0x66, 2, {0x0F, 0x7E, 0}, 0, 2, - {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} } -}; -static const x86_insn_info mmxsse2_insn[] = { - { CPU_MMX, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, - {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, 0} - }, - { CPU_SSE2, MOD_Op1Add, 0, 0, 0x66, 2, {0x0F, 0x00, 0}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, 0} - } -}; -static const x86_insn_info pshift_insn[] = { - { CPU_MMX, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, - {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, 0} - }, - { CPU_MMX, MOD_Gap0|MOD_Op1Add|MOD_SpAdd, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, - 2, {OPT_SIMDReg|OPS_64|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_SSE2, MOD_Op1Add, 0, 0, 0x66, 2, {0x0F, 0x00, 0}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, 0} - }, - { CPU_SSE2, MOD_Gap0|MOD_Op1Add|MOD_SpAdd, 0, 0, 0x66, 2, {0x0F, 0x00, 0}, - 0, 2, - {OPT_SIMDReg|OPS_128|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} } -}; - -/* PIII (Katmai) new instructions / SIMD instructiosn */ -static const x86_insn_info sseps_insn[] = { - { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, 0} - } -}; -static const x86_insn_info cvt_xmm_xmm64_ss_insn[] = { - { CPU_SSE, MOD_PreAdd|MOD_Op1Add, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} - }, - { CPU_SSE, MOD_PreAdd|MOD_Op1Add, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0} - } -}; -static const x86_insn_info cvt_xmm_xmm64_ps_insn[] = { - { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0x00}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} - }, - { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0x00}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0} - } -}; -static const x86_insn_info cvt_xmm_xmm32_insn[] = { - { CPU_SSE, MOD_PreAdd|MOD_Op1Add, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} - }, - { CPU_SSE, MOD_PreAdd|MOD_Op1Add, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, 0} - } -}; -static const x86_insn_info cvt_rx_xmm64_insn[] = { - { CPU_SSE, MOD_PreAdd|MOD_Op1Add|MOD_GasSufL, 0, 0, 0x00, 2, - {0x0F, 0x00, 0}, 0, 2, - {OPT_Reg|OPS_32|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} - }, - { CPU_SSE, MOD_PreAdd|MOD_Op1Add|MOD_GasSufL, 0, 0, 0x00, 2, - {0x0F, 0x00, 0}, 0, 2, - {OPT_Reg|OPS_32|OPA_Spare, OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0} - }, - /* REX */ - { CPU_SSE|CPU_Hammer|CPU_64, MOD_PreAdd|MOD_Op1Add|MOD_GasSufQ, 64, 0, - 0x00, 2, {0x0F, 0x00, 0}, 0, 2, - {OPT_Reg|OPS_64|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} - }, - { CPU_SSE|CPU_Hammer|CPU_64, MOD_PreAdd|MOD_Op1Add|MOD_GasSufQ, 64, 0, - 0x00, 2, {0x0F, 0x00, 0}, 0, 2, - {OPT_Reg|OPS_64|OPA_Spare, OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0} - } -}; -static const x86_insn_info cvt_rx_xmm32_insn[] = { - { CPU_SSE, MOD_PreAdd|MOD_Op1Add|MOD_GasSufL, 0, 0, 0x00, 2, - {0x0F, 0x00, 0}, 0, 2, - {OPT_Reg|OPS_32|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} - }, - { CPU_SSE, MOD_PreAdd|MOD_Op1Add|MOD_GasSufL, 0, 0, 0x00, 2, - {0x0F, 0x00, 0}, 0, 2, - {OPT_Reg|OPS_32|OPA_Spare, OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, 0} - }, - /* REX */ - { CPU_SSE|CPU_Hammer|CPU_64, MOD_PreAdd|MOD_Op1Add|MOD_GasSufQ, 64, 0, - 0x00, 2, {0x0F, 0x00, 0}, 0, 2, - {OPT_Reg|OPS_64|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} - }, - { CPU_SSE|CPU_Hammer|CPU_64, MOD_PreAdd|MOD_Op1Add|MOD_GasSufQ, 64, 0, - 0x00, 2, {0x0F, 0x00, 0}, 0, 2, - {OPT_Reg|OPS_64|OPA_Spare, OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, 0} - } -}; -static const x86_insn_info cvt_mm_xmm64_insn[] = { - { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0x00}, 0, 2, - {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} - }, - { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0x00}, 0, 2, - {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0} - } -}; -static const x86_insn_info cvt_mm_xmm_insn[] = { - { CPU_SSE, MOD_PreAdd|MOD_Op1Add, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, - {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, 0} - } -}; -static const x86_insn_info cvt_xmm_mm_ss_insn[] = { - { CPU_SSE, MOD_PreAdd|MOD_Op1Add, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, 0} - } -}; -static const x86_insn_info cvt_xmm_mm_ps_insn[] = { - { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0x00}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, 0} - } -}; -static const x86_insn_info cvt_xmm_rmx_insn[] = { - { CPU_SSE, MOD_PreAdd|MOD_Op1Add|MOD_GasSufL, 0, 0, 0x00, 2, - {0x0F, 0x00, 0}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} - }, - /* REX */ - { CPU_Hammer|CPU_64, MOD_PreAdd|MOD_Op1Add|MOD_GasSufQ, 64, 0, 0x00, 2, - {0x0F, 0x00, 0}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} - } -}; -static const x86_insn_info ssess_insn[] = { - { CPU_SSE, MOD_PreAdd|MOD_Op1Add, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, 0} - } -}; -static const x86_insn_info ssecmpps_insn[] = { - { CPU_SSE, MOD_Imm8, 0, 0, 0, 2, {0x0F, 0xC2, 0}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, 0} - } -}; -static const x86_insn_info ssecmpss_insn[] = { - { CPU_SSE, MOD_PreAdd|MOD_Imm8, 0, 0, 0x00, 2, {0x0F, 0xC2, 0}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, 0} - } -}; -static const x86_insn_info ssepsimm_insn[] = { - { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 3, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } -}; -static const x86_insn_info ssessimm_insn[] = { - { CPU_SSE, MOD_PreAdd|MOD_Op1Add, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 3, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } -}; -static const x86_insn_info ldstmxcsr_insn[] = { - { CPU_SSE, MOD_SpAdd, 0, 0, 0, 2, {0x0F, 0xAE, 0}, 0, 1, - {OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, 0, 0} } -}; -static const x86_insn_info maskmovq_insn[] = { - { CPU_P3|CPU_MMX, 0, 0, 0, 0, 2, {0x0F, 0xF7, 0}, 0, 2, - {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_SIMDReg|OPS_64|OPA_EA, 0} } -}; -static const x86_insn_info movaups_insn[] = { - { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, 0} - }, - { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x01, 0}, 0, 2, - {OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} - } -}; -static const x86_insn_info movhllhps_insn[] = { - { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} } -}; -static const x86_insn_info movhlps_insn[] = { - { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0} }, - { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x01, 0}, 0, 2, - {OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} } -}; -static const x86_insn_info movmskps_insn[] = { - { CPU_SSE, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0x50, 0}, 0, 2, - {OPT_Reg|OPS_32|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} }, - { CPU_Hammer|CPU_64, MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x50, 0}, 0, 2, - {OPT_Reg|OPS_64|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} } -}; -static const x86_insn_info movntps_insn[] = { - { CPU_SSE, 0, 0, 0, 0, 2, {0x0F, 0x2B, 0}, 0, 2, - {OPT_Mem|OPS_128|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} } -}; -static const x86_insn_info movntq_insn[] = { - { CPU_SSE, 0, 0, 0, 0, 2, {0x0F, 0xE7, 0}, 0, 2, - {OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_64|OPA_Spare, 0} } -}; -static const x86_insn_info movss_insn[] = { - { CPU_SSE, 0, 0, 0, 0xF3, 2, {0x0F, 0x10, 0}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} }, - { CPU_SSE, 0, 0, 0, 0xF3, 2, {0x0F, 0x10, 0}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, 0} }, - { CPU_SSE, 0, 0, 0, 0xF3, 2, {0x0F, 0x11, 0}, 0, 2, - {OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} } -}; -static const x86_insn_info pextrw_insn[] = { - { CPU_P3|CPU_MMX, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0xC5, 0}, 0, 3, - {OPT_Reg|OPS_32|OPA_Spare, OPT_SIMDReg|OPS_64|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, - { CPU_SSE2, MOD_GasSufL, 0, 0, 0x66, 2, {0x0F, 0xC5, 0}, 0, 3, - {OPT_Reg|OPS_32|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, - { CPU_SSE2|CPU_Hammer|CPU_64, MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0xC5, 0}, - 0, 3, - {OPT_Reg|OPS_64|OPA_Spare, OPT_SIMDReg|OPS_64|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, - { CPU_SSE2|CPU_Hammer|CPU_64, MOD_GasSufQ, 64, 0, 0x66, 2, {0x0F, 0xC5, 0}, - 0, 3, - {OPT_Reg|OPS_64|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, - /* SSE4.1 instructions */ - { CPU_SSE41, 0, 0, 0, 0x66, 3, {0x0F, 0x3A, 0x15}, 0, 3, - {OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, - { CPU_SSE41, 0, 32, 0, 0x66, 3, {0x0F, 0x3A, 0x15}, 0, 3, - {OPT_Reg|OPS_32|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, - { CPU_SSE41|CPU_64, 0, 64, 0, 0x66, 3, {0x0F, 0x3A, 0x15}, 0, 3, - {OPT_Reg|OPS_64|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } -}; -static const x86_insn_info pinsrw_insn[] = { - { CPU_P3|CPU_MMX, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0xC4, 0}, 0, 3, - {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_Reg|OPS_32|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, - { CPU_Hammer|CPU_64, MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0xC4, 0}, 0, 3, - {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_Reg|OPS_64|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, - { CPU_P3|CPU_MMX, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0xC4, 0}, 0, 3, - {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, - { CPU_SSE2, MOD_GasSufL, 0, 0, 0x66, 2, {0x0F, 0xC4, 0}, 0, 3, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Reg|OPS_32|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, - { CPU_Hammer|CPU_64, MOD_GasSufQ, 64, 0, 0x66, 2, {0x0F, 0xC4, 0}, 0, 3, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Reg|OPS_64|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, - { CPU_SSE2, MOD_GasSufL, 0, 0, 0x66, 2, {0x0F, 0xC4, 0}, 0, 3, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } -}; -static const x86_insn_info pmovmskb_insn[] = { - { CPU_P3|CPU_MMX, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0xD7, 0}, 0, 2, - {OPT_Reg|OPS_32|OPA_Spare, OPT_SIMDReg|OPS_64|OPA_EA, 0} }, - { CPU_SSE2, MOD_GasSufL, 0, 0, 0x66, 2, {0x0F, 0xD7, 0}, 0, 2, - {OPT_Reg|OPS_32|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} }, - { CPU_Hammer|CPU_64, MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0xD7, 0}, 0, 2, - {OPT_Reg|OPS_64|OPA_Spare, OPT_SIMDReg|OPS_64|OPA_EA, 0} }, - { CPU_Hammer|CPU_64, MOD_GasSufQ, 64, 0, 0x66, 2, {0x0F, 0xD7, 0}, 0, 2, - {OPT_Reg|OPS_64|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} } -}; -static const x86_insn_info pshufw_insn[] = { - { CPU_P3|CPU_MMX, 0, 0, 0, 0, 2, {0x0F, 0x70, 0}, 0, 3, - {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } -}; - -/* SSE2 instructions */ -static const x86_insn_info cmpsd_insn[] = { - { CPU_Any, MOD_GasIllegal, 32, 0, 0, 1, {0xA7, 0, 0}, 0, 0, {0, 0, 0} }, - { CPU_SSE2, 0, 0, 0, 0xF2, 2, {0x0F, 0xC2, 0}, 0, 3, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } -}; -static const x86_insn_info movaupd_insn[] = { - { CPU_SSE2, MOD_Op1Add, 0, 0, 0x66, 2, {0x0F, 0x00, 0}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, 0} - }, - { CPU_SSE2, MOD_Op1Add, 0, 0, 0x66, 2, {0x0F, 0x01, 0}, 0, 2, - {OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} - } -}; -static const x86_insn_info movhlpd_insn[] = { - { CPU_SSE2, MOD_Op1Add, 0, 0, 0x66, 2, {0x0F, 0x00, 0}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0} }, - { CPU_SSE2, MOD_Op1Add, 0, 0, 0x66, 2, {0x0F, 0x01, 0}, 0, 2, - {OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} } -}; -static const x86_insn_info movmskpd_insn[] = { - { CPU_SSE2, MOD_GasSufL, 0, 0, 0x66, 2, {0x0F, 0x50, 0}, 0, 2, - {OPT_Reg|OPS_32|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} } -}; -static const x86_insn_info movntpddq_insn[] = { - { CPU_SSE2, MOD_Op1Add, 0, 0, 0x66, 2, {0x0F, 0x00, 0}, 0, 2, - {OPT_Mem|OPS_128|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} } -}; -static const x86_insn_info movsd_insn[] = { - { CPU_Any, MOD_GasIllegal, 32, 0, 0, 1, {0xA5, 0, 0}, 0, 0, {0, 0, 0} }, - { CPU_SSE2, 0, 0, 0, 0xF2, 2, {0x0F, 0x10, 0}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} }, - { CPU_SSE2, 0, 0, 0, 0xF2, 2, {0x0F, 0x10, 0}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0} }, - { CPU_SSE2, 0, 0, 0, 0xF2, 2, {0x0F, 0x11, 0}, 0, 2, - {OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} } -}; -static const x86_insn_info maskmovdqu_insn[] = { - { CPU_SSE2, 0, 0, 0, 0x66, 2, {0x0F, 0xF7, 0}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} } -}; -static const x86_insn_info movdqau_insn[] = { - { CPU_SSE2, MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0x6F, 0}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, 0} - }, - { CPU_SSE2, MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0x7F, 0}, 0, 2, - {OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} - } -}; -static const x86_insn_info movdq2q_insn[] = { - { CPU_SSE2, 0, 0, 0, 0xF2, 2, {0x0F, 0xD6, 0}, 0, 2, - {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} } -}; -static const x86_insn_info movq2dq_insn[] = { - { CPU_SSE2, 0, 0, 0, 0xF3, 2, {0x0F, 0xD6, 0}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_64|OPA_EA, 0} } -}; -static const x86_insn_info pslrldq_insn[] = { - { CPU_SSE2, MOD_SpAdd, 0, 0, 0x66, 2, {0x0F, 0x73, 0}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} } -}; - -/* SSE3 instructions */ -static const x86_insn_info lddqu_insn[] = { - { CPU_SSE3, 0, 0, 0, 0xF2, 2, {0x0F, 0xF0, 0}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_Any|OPA_EA, 0} } -}; - -/* SSSE3 instructions */ -static const x86_insn_info ssse3_insn[] = { - { CPU_SSSE3, MOD_Op2Add, 0, 0, 0, 3, {0x0F, 0x38, 0x00}, 0, 2, - {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, 0} - }, - { CPU_SSSE3, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, 0} - } -}; - -static const x86_insn_info ssse3imm_insn[] = { - { CPU_SSSE3, MOD_Op2Add, 0, 0, 0, 3, {0x0F, 0x3A, 0x00}, 0, 3, - {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} - }, - { CPU_SSSE3, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x3A, 0x00}, 0, 3, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} - } -}; - -/* SSE4 instructions */ - -static const x86_insn_info sse4_insn[] = { - { CPU_Any, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, 0} - } -}; - -static const x86_insn_info sse4imm_insn[] = { - { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x3A, 0x00}, 0, 3, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } -}; - -static const x86_insn_info sse4xmm0_insn[] = { - { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, 0} - }, - { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 3, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, - OPT_XMM0|OPS_128|OPA_None} - } -}; - -static const x86_insn_info crc32_insn[] = { - { CPU_SSE42, MOD_GasSufB, 0, 0, 0xF2, 3, {0x0F, 0x38, 0xF0}, 0, 2, - {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_8|OPA_EA, 0} }, - { CPU_SSE42, MOD_GasSufW, 16, 0, 0xF2, 3, {0x0F, 0x38, 0xF1}, 0, 2, - {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_16|OPA_EA, 0} }, - { CPU_SSE42, MOD_GasSufL, 32, 0, 0xF2, 3, {0x0F, 0x38, 0xF1}, 0, 2, - {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} }, - { CPU_SSE42|CPU_64, MOD_GasSufB, 64, 0, 0xF2, 3, {0x0F, 0x38, 0xF0}, 0, 2, - {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_8|OPA_EA, 0} }, - { CPU_SSE42|CPU_64, MOD_GasSufQ, 64, 0, 0xF2, 3, {0x0F, 0x38, 0xF1}, 0, 2, - {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} } -}; - -static const x86_insn_info extractps_insn[] = { - { CPU_SSE41, 0, 32, 0, 0x66, 3, {0x0F, 0x3A, 0x17}, 0, 3, - {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, - { CPU_SSE41|CPU_64, 0, 64, 0, 0x66, 3, {0x0F, 0x3A, 0x17}, 0, 3, - {OPT_Reg|OPS_64|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } -}; - -static const x86_insn_info insertps_insn[] = { - { CPU_SSE41, 0, 0, 0, 0x66, 3, {0x0F, 0x3A, 0x21}, 0, 3, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, - { CPU_SSE41, 0, 0, 0, 0x66, 3, {0x0F, 0x3A, 0x21}, 0, 3, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } -}; - -static const x86_insn_info movntdqa_insn[] = { - { CPU_SSE41, 0, 0, 0, 0x66, 3, {0x0F, 0x38, 0x2A}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_128|OPS_Relaxed|OPA_EA, 0} } -}; - -static const x86_insn_info sse4pcmpstr_insn[] = { - { CPU_SSE42, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x3A, 0x00}, 0, 3, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, - { CPU_SSE42, MOD_Op2Add|MOD_GasOnly|MOD_GasSufW, 16, 0, 0x66, 3, - {0x0F, 0x3A, 0x00}, 0, 3, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} - }, - { CPU_SSE42, MOD_Op2Add|MOD_GasOnly|MOD_GasSufL, 32, 0, 0x66, 3, - {0x0F, 0x3A, 0x00}, 0, 3, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} - }, - { CPU_SSE42, MOD_Op2Add|MOD_GasOnly|MOD_GasSufQ, 64, 0, 0x66, 3, - {0x0F, 0x3A, 0x00}, 0, 3, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} - } -}; - -static const x86_insn_info pextrb_insn[] = { - { CPU_SSE41, 0, 0, 0, 0x66, 3, {0x0F, 0x3A, 0x14}, 0, 3, - {OPT_Mem|OPS_8|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, - { CPU_SSE41, 0, 32, 0, 0x66, 3, {0x0F, 0x3A, 0x14}, 0, 3, - {OPT_Reg|OPS_32|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, - { CPU_SSE41|CPU_64, 0, 64, 0, 0x66, 3, {0x0F, 0x3A, 0x14}, 0, 3, - {OPT_Reg|OPS_64|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } -}; - -static const x86_insn_info pextrd_insn[] = { - { CPU_SSE41, 0, 32, 0, 0x66, 3, {0x0F, 0x3A, 0x16}, 0, 3, - {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } -}; - -static const x86_insn_info pextrq_insn[] = { - { CPU_SSE41|CPU_64, 0, 64, 0, 0x66, 3, {0x0F, 0x3A, 0x16}, 0, 3, - {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } -}; - -static const x86_insn_info pinsrb_insn[] = { - { CPU_SSE41, 0, 0, 0, 0x66, 3, {0x0F, 0x3A, 0x20}, 0, 3, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_8|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, - { CPU_SSE41, 0, 32, 0, 0x66, 3, {0x0F, 0x3A, 0x20}, 0, 3, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Reg|OPS_32|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } -}; - -static const x86_insn_info pinsrd_insn[] = { - { CPU_SSE41, 0, 32, 0, 0x66, 3, {0x0F, 0x3A, 0x22}, 0, 3, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } -}; - -static const x86_insn_info pinsrq_insn[] = { - { CPU_SSE41|CPU_64, 0, 64, 0, 0x66, 3, {0x0F, 0x3A, 0x22}, 0, 3, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } -}; - -static const x86_insn_info sse4m64_insn[] = { - { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0} }, - { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} } -}; - -static const x86_insn_info sse4m32_insn[] = { - { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, 0} }, - { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} } -}; - -static const x86_insn_info sse4m16_insn[] = { - { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, 0} }, - { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} } -}; - -static const x86_insn_info cnt_insn[] = { - { CPU_SSE42, MOD_Op1Add|MOD_GasSufW, 16, 0, 0xF3, 2, {0x0F, 0x00, 0}, 0, 2, - {OPT_Reg|OPS_16|OPA_Spare, OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, 0} }, - { CPU_SSE42, MOD_Op1Add|MOD_GasSufL, 32, 0, 0xF3, 2, {0x0F, 0x00, 0}, 0, 2, - {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} }, - { CPU_SSE42|CPU_64, MOD_Op1Add|MOD_GasSufQ, 64, 0, 0xF3, 2, - {0x0F, 0x00, 0}, 0, 2, - {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} } -}; - -static const x86_insn_info extrq_insn[] = { - { CPU_SSE41, 0, 0, 0, 0x66, 2, {0x0F, 0x78, 0}, 0, 3, - {OPT_SIMDReg|OPS_128|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, - { CPU_SSE41, 0, 0, 0, 0x66, 2, {0x0F, 0x79, 0}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} } -}; - static const unsigned long insertq_4operands[] = {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm}; -static const x86_insn_info insertq_insn[] = { - { CPU_SSE41, 0, 0, 0, 0xF2, 2, {0x0F, 0x78, 0}, 0, 4, {0, 0, 0} }, - { CPU_SSE41, 0, 0, 0, 0xF2, 2, {0x0F, 0x79, 0}, 0, 2, - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} } -}; - -static const x86_insn_info movntsd_insn[] = { - { CPU_SSE41, 0, 0, 0, 0xF2, 2, {0x0F, 0x2B, 0}, 0, 2, - {OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} } -}; - -static const x86_insn_info movntss_insn[] = { - { CPU_SSE41, 0, 0, 0, 0xF3, 2, {0x0F, 0x2B, 0}, 0, 2, - {OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} } -}; - -/* AMD 3DNow! instructions */ -static const x86_insn_info now3d_insn[] = { - { CPU_3DNow, MOD_Imm8, 0, 0, 0, 2, {0x0F, 0x0F, 0}, 0, 2, - {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, 0} } -}; - -/* AMD x86-64 extensions */ -static const x86_insn_info cmpxchg16b_insn[] = { - { CPU_64|CPU_Hammer, 0, 64, 0, 0, 2, {0x0F, 0xC7, 0}, 1, 1, - {OPT_Mem|OPS_128|OPS_Relaxed|OPA_EA, 0, 0} } -}; - -/* AMD Pacifica (SVM) instructions */ -static const x86_insn_info invlpga_insn[] = { - { CPU_SVM, 0, 0, 0, 0, 3, {0x0F, 0x01, 0xDF}, 0, 0, {0, 0, 0} }, - { CPU_SVM, 0, 0, 0, 0, 3, {0x0F, 0x01, 0xDF}, 0, 2, - {OPT_MemrAX|OPS_Any|OPA_AdSizeEA, OPT_Creg|OPS_32|OPA_None, 0} } -}; -static const x86_insn_info skinit_insn[] = { - { CPU_SVM, 0, 0, 0, 0, 3, {0x0F, 0x01, 0xDE}, 0, 0, {0, 0, 0} }, - { CPU_SVM, 0, 0, 0, 0, 3, {0x0F, 0x01, 0xDE}, 0, 1, - {OPT_MemEAX|OPS_Any|OPA_None, 0, 0} } -}; -static const x86_insn_info svm_rax_insn[] = { - { CPU_SVM, MOD_Op2Add, 0, 0, 0, 3, {0x0F, 0x01, 0x00}, 0, 0, {0, 0, 0} }, - { CPU_SVM, MOD_Op2Add, 0, 0, 0, 3, {0x0F, 0x01, 0x00}, 0, 1, - {OPT_MemrAX|OPS_Any|OPA_AdSizeEA, 0, 0} } -}; -/* VIA PadLock instructions */ -static const x86_insn_info padlock_insn[] = { - { CPU_Any, MOD_Imm8|MOD_PreAdd|MOD_Op1Add, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, - 0, 0, {0, 0, 0} } -}; - -/* Cyrix MMX instructions */ -static const x86_insn_info cyrixmmx_insn[] = { - { CPU_Cyrix|CPU_MMX, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, - {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, 0} } -}; -static const x86_insn_info pmachriw_insn[] = { - { CPU_Cyrix|CPU_MMX, 0, 0, 0, 0, 2, {0x0F, 0x5E, 0}, 0, 2, - {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0} } -}; - -/* Cyrix extensions */ -static const x86_insn_info rdwrshr_insn[] = { - { CPU_486|CPU_Cyrix|CPU_SMM, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x36, 0}, 0, 1, - {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} } -}; -static const x86_insn_info rsdc_insn[] = { - { CPU_486|CPU_Cyrix|CPU_SMM, 0, 0, 0, 0, 2, {0x0F, 0x79, 0}, 0, 2, - {OPT_SegReg|OPS_16|OPS_Relaxed|OPA_Spare, - OPT_Mem|OPS_80|OPS_Relaxed|OPA_EA, 0} } -}; -static const x86_insn_info cyrixsmm_insn[] = { - { CPU_486|CPU_Cyrix|CPU_SMM, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 1, - {OPT_Mem|OPS_80|OPS_Relaxed|OPA_EA, 0, 0} } -}; -static const x86_insn_info svdc_insn[] = { - { CPU_486|CPU_Cyrix|CPU_SMM, 0, 0, 0, 0, 2, {0x0F, 0x78, 0}, 0, 2, - {OPT_Mem|OPS_80|OPS_Relaxed|OPA_EA, - OPT_SegReg|OPS_16|OPS_Relaxed|OPA_Spare, 0} } -}; - -/* Obsolete/undocumented instructions */ -static const x86_insn_info ibts_insn[] = { - { CPU_386|CPU_Undoc|CPU_Obs, 0, 16, 0, 0, 2, {0x0F, 0xA7, 0}, 0, 2, - {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_16|OPA_Spare, 0} }, - { CPU_386|CPU_Undoc|CPU_Obs, 0, 32, 0, 0, 2, {0x0F, 0xA7, 0}, 0, 2, - {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_32|OPA_Spare, 0} } -}; -static const x86_insn_info umov_insn[] = { - { CPU_386|CPU_Undoc, 0, 0, 0, 0, 2, {0x0F, 0x10, 0}, 0, 2, - {OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_8|OPA_Spare, 0} }, - { CPU_386|CPU_Undoc, 0, 16, 0, 0, 2, {0x0F, 0x11, 0}, 0, 2, - {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_16|OPA_Spare, 0} }, - { CPU_386|CPU_Undoc, 0, 32, 0, 0, 2, {0x0F, 0x11, 0}, 0, 2, - {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_32|OPA_Spare, 0} }, - { CPU_386|CPU_Undoc, 0, 0, 0, 0, 2, {0x0F, 0x12, 0}, 0, 2, - {OPT_Reg|OPS_8|OPA_Spare, OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, 0} }, - { CPU_386|CPU_Undoc, 0, 16, 0, 0, 2, {0x0F, 0x13, 0}, 0, 2, - {OPT_Reg|OPS_16|OPA_Spare, OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, 0} }, - { CPU_386|CPU_Undoc, 0, 32, 0, 0, 2, {0x0F, 0x13, 0}, 0, 2, - {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} } -}; -static const x86_insn_info xbts_insn[] = { - { CPU_386|CPU_Undoc|CPU_Obs, 0, 16, 0, 0, 2, {0x0F, 0xA6, 0}, 0, 2, - {OPT_Reg|OPS_16|OPA_Spare, OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, 0} }, - { CPU_386|CPU_Undoc|CPU_Obs, 0, 32, 0, 0, 2, {0x0F, 0xA6, 0}, 0, 2, - {OPT_Reg|OPS_32|OPA_Spare, OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, 0} } -}; +#include "x86insns.c" static void x86_finalize_common(x86_common *common, const x86_insn_info *info, diff --git a/modules/arch/x86/x86insn.in b/modules/arch/x86/x86insn.in deleted file mode 100644 index 6fd0fc95..00000000 --- a/modules/arch/x86/x86insn.in +++ /dev/null @@ -1,965 +0,0 @@ -# x86 instruction and prefix recognition -# $Id$ -# -# Copyright (C) 2001-2007 Peter Johnson -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. - -# INSN parameters: -# - parser (- if any) -# - base name of instruction -# - if string, each character is an allowed GAS suffix -# if defined name, value is GAS suffix mode set (no character suffix reqd) -# - instruction group (sans _insn suffix) -# - modifiers (up to 3 bytes) -# - CPU flags -# -# The string mode of the second parameter is a shortcut for GAS forms, e.g.: -# INSN - mov "bwl" mov 0 CPU_Any -# is equivalent to: -# INSN - mov NONE mov 0 CPU_Any -# INSN gas movb SUF_B mov 0 CPU_Any -# INSN gas movw SUF_W mov 0 CPU_Any -# INSN gas movl SUF_L mov 0 CPU_Any - -# Move -INSN - mov "bwl" mov 0 CPU_Any -INSN gas movabs "bwlq" movabs 0 CPU_Hammer|CPU_64 - -# Move with sign/zero extend -INSN gas movsbw SUF_B movszx 0xBE CPU_386 -INSN gas movsbl SUF_B movszx 0xBE CPU_386 -INSN gas movswl SUF_W movszx 0xBE CPU_386 -INSN gas movsbq SUF_B movszx 0xBE CPU_Hammer|CPU_64 -INSN gas movswq SUF_W movszx 0xBE CPU_Hammer|CPU_64 -INSN - movsx "bw" movszx 0xBE CPU_386 -INSN gas movslq SUF_L movsxd 0 CPU_Hammer|CPU_64 -INSN nasm movsxd NONE movsxd 0 CPU_Hammer|CPU_64 -INSN gas movzbw SUF_B movszx 0xB6 CPU_386 -INSN gas movzbl SUF_B movszx 0xB6 CPU_386 -INSN gas movzwl SUF_W movszx 0xB6 CPU_386 -INSN gas movzbq SUF_B movszx 0xB6 CPU_Hammer|CPU_64 -INSN gas movzwq SUF_W movszx 0xB6 CPU_Hammer|CPU_64 -INSN - movzx NONE movszx 0xB6 CPU_386 - -# Push instructions -INSN - push "wlq" push 0 CPU_Any -INSN - pusha NONE onebyte 0x0060 CPU_186|CPU_Not64 -INSN nasm pushad NONE onebyte 0x2060 CPU_386|CPU_Not64 -INSN gas pushal NONE onebyte 0x2060 CPU_386|CPU_Not64 -INSN - pushaw NONE onebyte 0x1060 CPU_186|CPU_Not64 - -# Pop instructions -INSN - pop "wlq" pop 0 CPU_Any -INSN - popa NONE onebyte 0x0061 CPU_186|CPU_Not64 -INSN nasm popad NONE onebyte 0x2061 CPU_386|CPU_Not64 -INSN gas popal NONE onebyte 0x2061 CPU_386|CPU_Not64 -INSN - popaw NONE onebyte 0x1061 CPU_186|CPU_Not64 - -# Exchange -INSN - xchg "bwlq" xchg 0 CPU_Any - -# In/out from ports -INSN - in "bwl" in 0 CPU_Any -INSN - out "bwl" out 0 CPU_Any -# Load effective address -INSN - lea "wlq" lea 0 CPU_Any -# Load segment registers from memory -INSN - lds "wl" ldes 0xC5 CPU_Not64 -INSN - les "wl" ldes 0xC4 CPU_Not64 -INSN - lfs "wl" lfgss 0xB4 CPU_386 -INSN - lgs "wl" lfgss 0xB5 CPU_386 -INSN - lss "wl" lfgss 0xB2 CPU_386 -# Flags register instructions -INSN - clc NONE onebyte 0x00F8 CPU_Any -INSN - cld NONE onebyte 0x00FC CPU_Any -INSN - cli NONE onebyte 0x00FA CPU_Any -INSN - clts NONE twobyte 0x0F06 CPU_286|CPU_Priv -INSN - cmc NONE onebyte 0x00F5 CPU_Any -INSN - lahf NONE onebyte 0x009F CPU_Any -INSN - sahf NONE onebyte 0x009E CPU_Any -INSN - pushf NONE onebyte 0x40009C CPU_Any -INSN nasm pushfd NONE onebyte 0x00209C CPU_386|CPU_Not64 -INSN gas pushfl NONE onebyte 0x00209C CPU_386|CPU_Not64 -INSN - pushfw NONE onebyte 0x40109C CPU_Any -INSN - pushfq NONE onebyte 0x40409C CPU_Hammer|CPU_64 -INSN - popf NONE onebyte 0x40009D CPU_Any -INSN nasm popfd NONE onebyte 0x00209D CPU_386|CPU_Not64 -INSN gas popfl NONE onebyte 0x00209D CPU_386|CPU_Not64 -INSN - popfw NONE onebyte 0x40109D CPU_Any -INSN - popfq NONE onebyte 0x40409D CPU_Hammer|CPU_64 -INSN - stc NONE onebyte 0x00F9 CPU_Any -INSN - std NONE onebyte 0x00FD CPU_Any -INSN - sti NONE onebyte 0x00FB CPU_Any -# Arithmetic -INSN - add "bwlq" arith 0x0000 CPU_Any -INSN - inc "bwlq" incdec 0x0040 CPU_Any -INSN - sub "bwlq" arith 0x0528 CPU_Any -INSN - dec "bwlq" incdec 0x0148 CPU_Any -INSN - sbb "bwlq" arith 0x0318 CPU_Any -INSN - cmp "bwlq" arith 0x0738 CPU_Any -INSN - test "bwlq" test 0 CPU_Any -INSN - and "bwlq" arith 0x0420 CPU_Any -INSN - or "bwlq" arith 0x0108 CPU_Any -INSN - xor "bwlq" arith 0x0630 CPU_Any -INSN - adc "bwlq" arith 0x0210 CPU_Any -INSN - neg "bwlq" f6 0x03 CPU_Any -INSN - not "bwlq" f6 0x02 CPU_Any -INSN - aaa NONE onebyte 0x0037 CPU_Not64 -INSN - aas NONE onebyte 0x003F CPU_Not64 -INSN - daa NONE onebyte 0x0027 CPU_Not64 -INSN - das NONE onebyte 0x002F CPU_Not64 -INSN - aad NONE aadm 0x01 CPU_Not64 -INSN - aam NONE aadm 0x00 CPU_Not64 -# Conversion instructions -INSN - cbw NONE onebyte 0x1098 CPU_Any -INSN - cwde NONE onebyte 0x2098 CPU_386 -INSN - cdqe NONE onebyte 0x4098 CPU_Hammer|CPU_64 -INSN - cwd NONE onebyte 0x1099 CPU_Any -INSN - cdq NONE onebyte 0x2099 CPU_386 -INSN - cqo NONE onebyte 0x4099 CPU_Hammer|CPU_64 -# Conversion instructions - GAS / AT&T naming -INSN gas cbtw NONE onebyte 0x1098 CPU_Any -INSN gas cwtl NONE onebyte 0x2098 CPU_386 -INSN gas cltq NONE onebyte 0x4098 CPU_Hammer|CPU_64 -INSN gas cwtd NONE onebyte 0x1099 CPU_Any -INSN gas cltd NONE onebyte 0x2099 CPU_386 -INSN gas cqto NONE onebyte 0x4099 CPU_Hammer|CPU_64 -# Multiplication and division -INSN - mul "bwlq" f6 0x04 CPU_Any -INSN - imul "bwlq" imul 0 CPU_Any -INSN - div "bwlq" div 0x06 CPU_Any -INSN - idiv "bwlq" div 0x07 CPU_Any -# Shifts -INSN - rol "bwlq" shift 0x00 CPU_Any -INSN - ror "bwlq" shift 0x01 CPU_Any -INSN - rcl "bwlq" shift 0x02 CPU_Any -INSN - rcr "bwlq" shift 0x03 CPU_Any -INSN - sal "bwlq" shift 0x04 CPU_Any -INSN - shl "bwlq" shift 0x04 CPU_Any -INSN - shr "bwlq" shift 0x05 CPU_Any -INSN - sar "bwlq" shift 0x07 CPU_Any -INSN - shld "wlq" shlrd 0xA4 CPU_386 -INSN - shrd "wlq" shlrd 0xAC CPU_386 -# Control transfer instructions unconditional) -INSN - call NONE call 0 CPU_Any -INSN gas calll NONE call 0 CPU_Not64 -INSN gas callq NONE call 0 CPU_Hammer|CPU_64 -INSN - jmp NONE jmp 0 CPU_Any -INSN - ret NONE retnf 0x00C2 CPU_Any -INSN gas retw NONE retnf 0x10C2 CPU_Any -INSN gas retl NONE retnf 0x00C2 CPU_Not64 -INSN gas retq NONE retnf 0x00C2 CPU_Hammer|CPU_64 -INSN nasm retn NONE retnf 0x00C2 CPU_Any -INSN nasm retf NONE retnf 0x40CA CPU_Any -INSN gas lretw NONE retnf 0x10CA CPU_Any -INSN gas lretl NONE retnf 0x00CA CPU_Any -INSN gas lretq NONE retnf 0x40CA CPU_Hammer|CPU_64 -INSN - enter "wlq" enter 0 CPU_186 -INSN - leave NONE onebyte 0x4000C9 CPU_186 -INSN gas leavew NONE onebyte 0x0010C9 CPU_186 -INSN gas leavel NONE onebyte 0x4000C9 CPU_186 -INSN gas leaveq NONE onebyte 0x4000C9 CPU_Hammer|CPU_64 -# Conditional jumps -INSN - jo NONE jcc 0x00 CPU_Any -INSN - jno NONE jcc 0x01 CPU_Any -INSN - jb NONE jcc 0x02 CPU_Any -INSN - jc NONE jcc 0x02 CPU_Any -INSN - jnae NONE jcc 0x02 CPU_Any -INSN - jnb NONE jcc 0x03 CPU_Any -INSN - jnc NONE jcc 0x03 CPU_Any -INSN - jae NONE jcc 0x03 CPU_Any -INSN - je NONE jcc 0x04 CPU_Any -INSN - jz NONE jcc 0x04 CPU_Any -INSN - jne NONE jcc 0x05 CPU_Any -INSN - jnz NONE jcc 0x05 CPU_Any -INSN - jbe NONE jcc 0x06 CPU_Any -INSN - jna NONE jcc 0x06 CPU_Any -INSN - jnbe NONE jcc 0x07 CPU_Any -INSN - ja NONE jcc 0x07 CPU_Any -INSN - js NONE jcc 0x08 CPU_Any -INSN - jns NONE jcc 0x09 CPU_Any -INSN - jp NONE jcc 0x0A CPU_Any -INSN - jpe NONE jcc 0x0A CPU_Any -INSN - jnp NONE jcc 0x0B CPU_Any -INSN - jpo NONE jcc 0x0B CPU_Any -INSN - jl NONE jcc 0x0C CPU_Any -INSN - jnge NONE jcc 0x0C CPU_Any -INSN - jnl NONE jcc 0x0D CPU_Any -INSN - jge NONE jcc 0x0D CPU_Any -INSN - jle NONE jcc 0x0E CPU_Any -INSN - jng NONE jcc 0x0E CPU_Any -INSN - jnle NONE jcc 0x0F CPU_Any -INSN - jg NONE jcc 0x0F CPU_Any -INSN - jcxz NONE jcxz 0x10 CPU_Any -INSN - jecxz NONE jcxz 0x20 CPU_386 -INSN - jrcxz NONE jcxz 0x40 CPU_Hammer|CPU_64 -# Loop instructions -INSN - loop NONE loop 0x02 CPU_Any -INSN - loopz NONE loop 0x01 CPU_Any -INSN - loope NONE loop 0x01 CPU_Any -INSN - loopnz NONE loop 0x00 CPU_Any -INSN - loopne NONE loop 0x00 CPU_Any -# Set byte on flag instructions -INSN - seto "b" setcc 0x00 CPU_386 -INSN - setno "b" setcc 0x01 CPU_386 -INSN - setb "b" setcc 0x02 CPU_386 -INSN - setc "b" setcc 0x02 CPU_386 -INSN - setnae "b" setcc 0x02 CPU_386 -INSN - setnb "b" setcc 0x03 CPU_386 -INSN - setnc "b" setcc 0x03 CPU_386 -INSN - setae "b" setcc 0x03 CPU_386 -INSN - sete "b" setcc 0x04 CPU_386 -INSN - setz "b" setcc 0x04 CPU_386 -INSN - setne "b" setcc 0x05 CPU_386 -INSN - setnz "b" setcc 0x05 CPU_386 -INSN - setbe "b" setcc 0x06 CPU_386 -INSN - setna "b" setcc 0x06 CPU_386 -INSN - setnbe "b" setcc 0x07 CPU_386 -INSN - seta "b" setcc 0x07 CPU_386 -INSN - sets "b" setcc 0x08 CPU_386 -INSN - setns "b" setcc 0x09 CPU_386 -INSN - setp "b" setcc 0x0A CPU_386 -INSN - setpe "b" setcc 0x0A CPU_386 -INSN - setnp "b" setcc 0x0B CPU_386 -INSN - setpo "b" setcc 0x0B CPU_386 -INSN - setl "b" setcc 0x0C CPU_386 -INSN - setnge "b" setcc 0x0C CPU_386 -INSN - setnl "b" setcc 0x0D CPU_386 -INSN - setge "b" setcc 0x0D CPU_386 -INSN - setle "b" setcc 0x0E CPU_386 -INSN - setng "b" setcc 0x0E CPU_386 -INSN - setnle "b" setcc 0x0F CPU_386 -INSN - setg "b" setcc 0x0F CPU_386 -# String instructions -INSN - cmpsb NONE onebyte 0x00A6 CPU_Any -INSN - cmpsw NONE onebyte 0x10A7 CPU_Any -INSN - cmpsd NONE cmpsd 0 CPU_Any -INSN gas cmpsl NONE onebyte 0x20A7 CPU_386 -INSN - cmpsq NONE onebyte 0x40A7 CPU_Hammer|CPU_64 -INSN - insb NONE onebyte 0x006C CPU_Any -INSN - insw NONE onebyte 0x106D CPU_Any -INSN nasm insd NONE onebyte 0x206D CPU_386 -INSN gas insl NONE onebyte 0x206D CPU_386 -INSN - outsb NONE onebyte 0x006E CPU_Any -INSN - outsw NONE onebyte 0x106F CPU_Any -INSN nasm outsd NONE onebyte 0x206F CPU_386 -INSN gas outsl NONE onebyte 0x206F CPU_386 -INSN - lodsb NONE onebyte 0x00AC CPU_Any -INSN - lodsw NONE onebyte 0x10AD CPU_Any -INSN nasm lodsd NONE onebyte 0x20AD CPU_386 -INSN gas lodsl NONE onebyte 0x20AD CPU_386 -INSN - lodsq NONE onebyte 0x40AD CPU_Hammer|CPU_64 -INSN - movsb NONE onebyte 0x00A4 CPU_Any -INSN - movsw NONE onebyte 0x10A5 CPU_Any -INSN - movsd NONE movsd 0 CPU_386 -INSN gas movsl NONE onebyte 0x20A5 CPU_386 -INSN - movsq NONE onebyte 0x40A5 CPU_Hammer|CPU_64 -# smov alias for movs in GAS mode -INSN gas smovb NONE onebyte 0x00A4 CPU_Any -INSN gas smovw NONE onebyte 0x10A5 CPU_Any -INSN gas smovl NONE onebyte 0x20A5 CPU_386 -INSN gas smovq NONE onebyte 0x40A5 CPU_Hammer|CPU_64 -INSN - scasb NONE onebyte 0x00AE CPU_Any -INSN - scasw NONE onebyte 0x10AF CPU_Any -INSN nasm scasd NONE onebyte 0x20AF CPU_386 -INSN gas scasl NONE onebyte 0x20AF CPU_386 -INSN - scasq NONE onebyte 0x40AF CPU_Hammer|CPU_64 -# ssca alias for scas in GAS mode -INSN gas sscab NONE onebyte 0x00AE CPU_Any -INSN gas sscaw NONE onebyte 0x10AF CPU_Any -INSN gas sscal NONE onebyte 0x20AF CPU_386 -INSN gas sscaq NONE onebyte 0x40AF CPU_Hammer|CPU_64 -INSN - stosb NONE onebyte 0x00AA CPU_Any -INSN - stosw NONE onebyte 0x10AB CPU_Any -INSN nasm stosd NONE onebyte 0x20AB CPU_386 -INSN gas stosl NONE onebyte 0x20AB CPU_386 -INSN - stosq NONE onebyte 0x40AB CPU_Hammer|CPU_64 -INSN - xlatb NONE onebyte 0x00D7 CPU_Any -# Bit manipulation -INSN - bsf "wlq" bsfr 0xBC CPU_386 -INSN - bsr "wlq" bsfr 0xBD CPU_386 -INSN - bt "wlq" bittest 0x04A3 CPU_386 -INSN - btc "wlq" bittest 0x07BB CPU_386 -INSN - btr "wlq" bittest 0x06B3 CPU_386 -INSN - bts "wlq" bittest 0x05AB CPU_386 -# Interrupts and operating system instructions -INSN - int NONE int 0 CPU_Any -INSN - int3 NONE onebyte 0x00CC CPU_Any -INSN nasm int03 NONE onebyte 0x00CC CPU_Any -INSN - into NONE onebyte 0x00CE CPU_Not64 -INSN - iret NONE onebyte 0x00CF CPU_Any -INSN - iretw NONE onebyte 0x10CF CPU_Any -INSN nasm iretd NONE onebyte 0x20CF CPU_386 -INSN gas iretl NONE onebyte 0x20CF CPU_386 -INSN - iretq NONE onebyte 0x40CF CPU_Hammer|CPU_64 -INSN - rsm NONE twobyte 0x0FAA CPU_586|CPU_SMM -INSN - bound "wl" bound 0 CPU_186|CPU_Not64 -INSN - hlt NONE onebyte 0x00F4 CPU_Priv -INSN - nop NONE onebyte 0x0090 CPU_Any -# Protection control -INSN - arpl "w" arpl 0 CPU_286|CPU_Prot|CPU_Not64 -INSN - lar "wlq" bsfr 0x02 CPU_286|CPU_Prot -INSN - lgdt "wlq" twobytemem 0x020F01 CPU_286|CPU_Priv -INSN - lidt "wlq" twobytemem 0x030F01 CPU_286|CPU_Priv -INSN - lldt "w" prot286 0x0200 CPU_286|CPU_Prot|CPU_Priv -INSN - lmsw "w" prot286 0x0601 CPU_286|CPU_Priv -INSN - lsl "wlq" bsfr 0x03 CPU_286|CPU_Prot -INSN - ltr "w" prot286 0x0300 CPU_286|CPU_Prot|CPU_Priv -INSN - sgdt "wlq" twobytemem 0x000F01 CPU_286|CPU_Priv -INSN - sidt "wlq" twobytemem 0x010F01 CPU_286|CPU_Priv -INSN - sldt "wlq" sldtmsw 0x0000 CPU_286 -INSN - smsw "wlq" sldtmsw 0x0401 CPU_286 -INSN - str "wlq" str 0 CPU_286|CPU_Prot -INSN - verr "w" prot286 0x0400 CPU_286|CPU_Prot -INSN - verw "w" prot286 0x0500 CPU_286|CPU_Prot -# Floating point instructions -INSN - fld "ls" fld 0 CPU_FPU -INSN gas fldt WEAK fldstpt 0x05 CPU_FPU -INSN - fild "lqs" fildstp 0x050200 CPU_FPU -INSN gas fildll NONE fbldstp 0x05 CPU_FPU -INSN - fbld NONE fbldstp 0x04 CPU_FPU -INSN - fst "ls" fst 0 CPU_FPU -INSN - fist "ls" fiarith 0x02DB CPU_FPU -INSN - fstp "ls" fstp 0 CPU_FPU -INSN gas fstpt WEAK fldstpt 0x07 CPU_FPU -INSN - fistp "lqs" fildstp 0x070203 CPU_FPU -INSN gas fistpll NONE fbldstp 0x07 CPU_FPU -INSN - fbstp NONE fbldstp 0x06 CPU_FPU -INSN - fxch NONE fxch 0 CPU_FPU -INSN - fcom "ls" fcom 0x02D0 CPU_FPU -INSN - ficom "ls" fiarith 0x02DA CPU_FPU -INSN - fcomp "ls" fcom 0x03D8 CPU_FPU -INSN - ficomp "ls" fiarith 0x03DA CPU_FPU -INSN - fcompp NONE twobyte 0xDED9 CPU_FPU -INSN - fucom NONE fcom2 0xDDE0 CPU_286|CPU_FPU -INSN - fucomp NONE fcom2 0xDDE8 CPU_286|CPU_FPU -INSN - fucompp NONE twobyte 0xDAE9 CPU_286|CPU_FPU -INSN - ftst NONE twobyte 0xD9E4 CPU_FPU -INSN - fxam NONE twobyte 0xD9E5 CPU_FPU -INSN - fld1 NONE twobyte 0xD9E8 CPU_FPU -INSN - fldl2t NONE twobyte 0xD9E9 CPU_FPU -INSN - fldl2e NONE twobyte 0xD9EA CPU_FPU -INSN - fldpi NONE twobyte 0xD9EB CPU_FPU -INSN - fldlg2 NONE twobyte 0xD9EC CPU_FPU -INSN - fldln2 NONE twobyte 0xD9ED CPU_FPU -INSN - fldz NONE twobyte 0xD9EE CPU_FPU -INSN - fadd "ls" farith 0x00C0C0 CPU_FPU -INSN - faddp NONE farithp 0xC0 CPU_FPU -INSN - fiadd "ls" fiarith 0x00DA CPU_FPU -INSN - fsub "ls" farith 0x04E0E8 CPU_FPU -INSN - fisub "ls" fiarith 0x04DA CPU_FPU -INSN nasm fsubp NONE farithp 0xE8 CPU_FPU -INSN gas fsubp NONE farithp 0xE0 CPU_FPU -INSN - fsubr "ls" farith 0x05E8E0 CPU_FPU -INSN - fisubr "ls" fiarith 0x05DA CPU_FPU -INSN nasm fsubrp NONE farithp 0xE0 CPU_FPU -INSN gas fsubrp NONE farithp 0xE8 CPU_FPU -INSN - fmul "ls" farith 0x01C8C8 CPU_FPU -INSN - fimul "ls" fiarith 0x01DA CPU_FPU -INSN - fmulp NONE farithp 0xC8 CPU_FPU -INSN - fdiv "ls" farith 0x06F0F8 CPU_FPU -INSN - fidiv "ls" fiarith 0x06DA CPU_FPU -INSN nasm fdivp NONE farithp 0xF8 CPU_FPU -INSN gas fdivp NONE farithp 0xF0 CPU_FPU -INSN - fdivr "ls" farith 0x07F8F0 CPU_FPU -INSN - fidivr "ls" fiarith 0x07DA CPU_FPU -INSN nasm fdivrp NONE farithp 0xF0 CPU_FPU -INSN gas fdivrp NONE farithp 0xF8 CPU_FPU -INSN - f2xm1 NONE twobyte 0xD9F0 CPU_FPU -INSN - fyl2x NONE twobyte 0xD9F1 CPU_FPU -INSN - fptan NONE twobyte 0xD9F2 CPU_FPU -INSN - fpatan NONE twobyte 0xD9F3 CPU_FPU -INSN - fxtract NONE twobyte 0xD9F4 CPU_FPU -INSN - fprem1 NONE twobyte 0xD9F5 CPU_286|CPU_FPU -INSN - fdecstp NONE twobyte 0xD9F6 CPU_FPU -INSN - fincstp NONE twobyte 0xD9F7 CPU_FPU -INSN - fprem NONE twobyte 0xD9F8 CPU_FPU -INSN - fyl2xp1 NONE twobyte 0xD9F9 CPU_FPU -INSN - fsqrt NONE twobyte 0xD9FA CPU_FPU -INSN - fsincos NONE twobyte 0xD9FB CPU_286|CPU_FPU -INSN - frndint NONE twobyte 0xD9FC CPU_FPU -INSN - fscale NONE twobyte 0xD9FD CPU_FPU -INSN - fsin NONE twobyte 0xD9FE CPU_286|CPU_FPU -INSN - fcos NONE twobyte 0xD9FF CPU_286|CPU_FPU -INSN - fchs NONE twobyte 0xD9E0 CPU_FPU -INSN - fabs NONE twobyte 0xD9E1 CPU_FPU -INSN - fninit NONE twobyte 0xDBE3 CPU_FPU -INSN - finit NONE threebyte 0x9BDBE3 CPU_FPU -INSN - fldcw "w" fldnstcw 0x05 CPU_FPU -INSN - fnstcw "w" fldnstcw 0x07 CPU_FPU -INSN - fstcw "w" fstcw 0 CPU_FPU -INSN - fnstsw "w" fnstsw 0 CPU_FPU -INSN - fstsw "w" fstsw 0 CPU_FPU -INSN - fnclex NONE twobyte 0xDBE2 CPU_FPU -INSN - fclex NONE threebyte 0x9BDBE2 CPU_FPU -INSN - fnstenv "ls" onebytemem 0x06D9 CPU_FPU -INSN - fstenv "ls" twobytemem 0x069BD9 CPU_FPU -INSN - fldenv "ls" onebytemem 0x04D9 CPU_FPU -INSN - fnsave "ls" onebytemem 0x06DD CPU_FPU -INSN - fsave "ls" twobytemem 0x069BDD CPU_FPU -INSN - frstor "ls" onebytemem 0x04DD CPU_FPU -INSN - ffree NONE ffree 0xDD CPU_FPU -INSN - ffreep NONE ffree 0xDF CPU_686|CPU_FPU|CPU_Undoc -INSN - fnop NONE twobyte 0xD9D0 CPU_FPU -INSN - fwait NONE onebyte 0x009B CPU_FPU -# Prefixes should the others be here too? should wait be a prefix? -INSN - wait NONE onebyte 0x009B CPU_Any -# 486 extensions -INSN - bswap "lq" bswap 0 CPU_486 -INSN - xadd "bwlq" cmpxchgxadd 0xC0 CPU_486 -INSN - cmpxchg "bwlq" cmpxchgxadd 0xB0 CPU_486 -INSN nasm cmpxchg486 NONE cmpxchgxadd 0xA6 CPU_486|CPU_Undoc -INSN - invd NONE twobyte 0x0F08 CPU_486|CPU_Priv -INSN - wbinvd NONE twobyte 0x0F09 CPU_486|CPU_Priv -INSN - invlpg NONE twobytemem 0x070F01 CPU_486|CPU_Priv -# 586+ and late 486 extensions -INSN - cpuid NONE twobyte 0x0FA2 CPU_486 -# Pentium extensions -INSN - wrmsr NONE twobyte 0x0F30 CPU_586|CPU_Priv -INSN - rdtsc NONE twobyte 0x0F31 CPU_586 -INSN - rdmsr NONE twobyte 0x0F32 CPU_586|CPU_Priv -INSN - cmpxchg8b "q" cmpxchg8b 0 CPU_586 -# Pentium II/Pentium Pro extensions -INSN - sysenter NONE twobyte 0x0F34 CPU_686|CPU_Not64 -INSN - sysexit NONE twobyte 0x0F35 CPU_686|CPU_Priv|CPU_Not64 -INSN - fxsave "q" twobytemem 0x000FAE CPU_686|CPU_FPU -INSN - fxrstor "q" twobytemem 0x010FAE CPU_686|CPU_FPU -INSN - rdpmc NONE twobyte 0x0F33 CPU_686 -INSN - ud2 NONE twobyte 0x0F0B CPU_286 -INSN - ud1 NONE twobyte 0x0FB9 CPU_286|CPU_Undoc -INSN - cmovo "wlq" cmovcc 0x00 CPU_686 -INSN - cmovno "wlq" cmovcc 0x01 CPU_686 -INSN - cmovb "wlq" cmovcc 0x02 CPU_686 -INSN - cmovc "wlq" cmovcc 0x02 CPU_686 -INSN - cmovnae "wlq" cmovcc 0x02 CPU_686 -INSN - cmovnb "wlq" cmovcc 0x03 CPU_686 -INSN - cmovnc "wlq" cmovcc 0x03 CPU_686 -INSN - cmovae "wlq" cmovcc 0x03 CPU_686 -INSN - cmove "wlq" cmovcc 0x04 CPU_686 -INSN - cmovz "wlq" cmovcc 0x04 CPU_686 -INSN - cmovne "wlq" cmovcc 0x05 CPU_686 -INSN - cmovnz "wlq" cmovcc 0x05 CPU_686 -INSN - cmovbe "wlq" cmovcc 0x06 CPU_686 -INSN - cmovna "wlq" cmovcc 0x06 CPU_686 -INSN - cmovnbe "wlq" cmovcc 0x07 CPU_686 -INSN - cmova "wlq" cmovcc 0x07 CPU_686 -INSN - cmovs "wlq" cmovcc 0x08 CPU_686 -INSN - cmovns "wlq" cmovcc 0x09 CPU_686 -INSN - cmovp "wlq" cmovcc 0x0A CPU_686 -INSN - cmovpe "wlq" cmovcc 0x0A CPU_686 -INSN - cmovnp "wlq" cmovcc 0x0B CPU_686 -INSN - cmovpo "wlq" cmovcc 0x0B CPU_686 -INSN - cmovl "wlq" cmovcc 0x0C CPU_686 -INSN - cmovnge "wlq" cmovcc 0x0C CPU_686 -INSN - cmovnl "wlq" cmovcc 0x0D CPU_686 -INSN - cmovge "wlq" cmovcc 0x0D CPU_686 -INSN - cmovle "wlq" cmovcc 0x0E CPU_686 -INSN - cmovng "wlq" cmovcc 0x0E CPU_686 -INSN - cmovnle "wlq" cmovcc 0x0F CPU_686 -INSN - cmovg "wlq" cmovcc 0x0F CPU_686 -INSN - fcmovb NONE fcmovcc 0xDAC0 CPU_686|CPU_FPU -INSN - fcmove NONE fcmovcc 0xDAC8 CPU_686|CPU_FPU -INSN - fcmovbe NONE fcmovcc 0xDAD0 CPU_686|CPU_FPU -INSN - fcmovu NONE fcmovcc 0xDAD8 CPU_686|CPU_FPU -INSN - fcmovnb NONE fcmovcc 0xDBC0 CPU_686|CPU_FPU -INSN - fcmovne NONE fcmovcc 0xDBC8 CPU_686|CPU_FPU -INSN - fcmovnbe NONE fcmovcc 0xDBD0 CPU_686|CPU_FPU -INSN - fcmovnu NONE fcmovcc 0xDBD8 CPU_686|CPU_FPU -INSN - fcomi NONE fcom2 0xDBF0 CPU_686|CPU_FPU -INSN - fucomi NONE fcom2 0xDBE8 CPU_686|CPU_FPU -INSN - fcomip NONE fcom2 0xDFF0 CPU_686|CPU_FPU -INSN - fucomip NONE fcom2 0xDFE8 CPU_686|CPU_FPU -# Pentium4 extensions -INSN - movnti "lq" movnti 0 CPU_P4 -INSN - clflush NONE clflush 0 CPU_P3 -INSN - lfence NONE threebyte 0x0FAEE8 CPU_P3 -INSN - mfence NONE threebyte 0x0FAEF0 CPU_P3 -INSN - pause NONE onebyte_prefix 0xF390 CPU_P4 -# MMX/SSE2 instructions -INSN - emms NONE twobyte 0x0F77 CPU_MMX -INSN - movd NONE movd 0 CPU_MMX -# For GAS movq must use standard mov instruction. -# For NASM it can use a dedicated instruction. -INSN gas movq SUF_Q mov 0 CPU_Any -INSN nasm movq NONE movq 0 CPU_MMX -INSN - packssdw NONE mmxsse2 0x6B CPU_MMX -INSN - packsswb NONE mmxsse2 0x63 CPU_MMX -INSN - packuswb NONE mmxsse2 0x67 CPU_MMX -INSN - paddb NONE mmxsse2 0xFC CPU_MMX -INSN - paddw NONE mmxsse2 0xFD CPU_MMX -INSN - paddd NONE mmxsse2 0xFE CPU_MMX -INSN - paddq NONE mmxsse2 0xD4 CPU_MMX -INSN - paddsb NONE mmxsse2 0xEC CPU_MMX -INSN - paddsw NONE mmxsse2 0xED CPU_MMX -INSN - paddusb NONE mmxsse2 0xDC CPU_MMX -INSN - paddusw NONE mmxsse2 0xDD CPU_MMX -INSN - pand NONE mmxsse2 0xDB CPU_MMX -INSN - pandn NONE mmxsse2 0xDF CPU_MMX -INSN - pcmpeqb NONE mmxsse2 0x74 CPU_MMX -INSN - pcmpeqw NONE mmxsse2 0x75 CPU_MMX -INSN - pcmpeqd NONE mmxsse2 0x76 CPU_MMX -INSN - pcmpgtb NONE mmxsse2 0x64 CPU_MMX -INSN - pcmpgtw NONE mmxsse2 0x65 CPU_MMX -INSN - pcmpgtd NONE mmxsse2 0x66 CPU_MMX -INSN - pmaddwd NONE mmxsse2 0xF5 CPU_MMX -INSN - pmulhw NONE mmxsse2 0xE5 CPU_MMX -INSN - pmullw NONE mmxsse2 0xD5 CPU_MMX -INSN - por NONE mmxsse2 0xEB CPU_MMX -INSN - psllw NONE pshift 0x0671F1 CPU_MMX -INSN - pslld NONE pshift 0x0672F2 CPU_MMX -INSN - psllq NONE pshift 0x0673F3 CPU_MMX -INSN - psraw NONE pshift 0x0471E1 CPU_MMX -INSN - psrad NONE pshift 0x0472E2 CPU_MMX -INSN - psrlw NONE pshift 0x0271D1 CPU_MMX -INSN - psrld NONE pshift 0x0272D2 CPU_MMX -INSN - psrlq NONE pshift 0x0273D3 CPU_MMX -INSN - psubb NONE mmxsse2 0xF8 CPU_MMX -INSN - psubw NONE mmxsse2 0xF9 CPU_MMX -INSN - psubd NONE mmxsse2 0xFA CPU_MMX -INSN - psubq NONE mmxsse2 0xFB CPU_MMX -INSN - psubsb NONE mmxsse2 0xE8 CPU_MMX -INSN - psubsw NONE mmxsse2 0xE9 CPU_MMX -INSN - psubusb NONE mmxsse2 0xD8 CPU_MMX -INSN - psubusw NONE mmxsse2 0xD9 CPU_MMX -INSN - punpckhbw NONE mmxsse2 0x68 CPU_MMX -INSN - punpckhwd NONE mmxsse2 0x69 CPU_MMX -INSN - punpckhdq NONE mmxsse2 0x6A CPU_MMX -INSN - punpcklbw NONE mmxsse2 0x60 CPU_MMX -INSN - punpcklwd NONE mmxsse2 0x61 CPU_MMX -INSN - punpckldq NONE mmxsse2 0x62 CPU_MMX -INSN - pxor NONE mmxsse2 0xEF CPU_MMX -# PIII Katmai new instructions / SIMD instructions -INSN - addps NONE sseps 0x58 CPU_SSE -INSN - addss NONE ssess 0xF358 CPU_SSE -INSN - andnps NONE sseps 0x55 CPU_SSE -INSN - andps NONE sseps 0x54 CPU_SSE -INSN - cmpeqps NONE ssecmpps 0x00 CPU_SSE -INSN - cmpeqss NONE ssecmpss 0x00F3 CPU_SSE -INSN - cmpleps NONE ssecmpps 0x02 CPU_SSE -INSN - cmpless NONE ssecmpss 0x02F3 CPU_SSE -INSN - cmpltps NONE ssecmpps 0x01 CPU_SSE -INSN - cmpltss NONE ssecmpss 0x01F3 CPU_SSE -INSN - cmpneqps NONE ssecmpps 0x04 CPU_SSE -INSN - cmpneqss NONE ssecmpss 0x04F3 CPU_SSE -INSN - cmpnleps NONE ssecmpps 0x06 CPU_SSE -INSN - cmpnless NONE ssecmpss 0x06F3 CPU_SSE -INSN - cmpnltps NONE ssecmpps 0x05 CPU_SSE -INSN - cmpnltss NONE ssecmpss 0x05F3 CPU_SSE -INSN - cmpordps NONE ssecmpps 0x07 CPU_SSE -INSN - cmpordss NONE ssecmpss 0x07F3 CPU_SSE -INSN - cmpunordps NONE ssecmpps 0x03 CPU_SSE -INSN - cmpunordss NONE ssecmpss 0x03F3 CPU_SSE -INSN - cmpps NONE ssepsimm 0xC2 CPU_SSE -INSN - cmpss NONE ssessimm 0xF3C2 CPU_SSE -INSN - comiss NONE sseps 0x2F CPU_SSE -INSN - cvtpi2ps NONE cvt_xmm_mm_ps 0x2A CPU_SSE -INSN - cvtps2pi NONE cvt_mm_xmm64 0x2D CPU_SSE -INSN - cvtsi2ss "lq" cvt_xmm_rmx 0xF32A CPU_SSE -INSN - cvtss2si "lq" cvt_rx_xmm32 0xF32D CPU_SSE -INSN - cvttps2pi NONE cvt_mm_xmm64 0x2C CPU_SSE -INSN - cvttss2si "lq" cvt_rx_xmm32 0xF32C CPU_SSE -INSN - divps NONE sseps 0x5E CPU_SSE -INSN - divss NONE ssess 0xF35E CPU_SSE -INSN - ldmxcsr NONE ldstmxcsr 0x02 CPU_SSE -INSN - maskmovq NONE maskmovq 0 CPU_P3|CPU_MMX -INSN - maxps NONE sseps 0x5F CPU_SSE -INSN - maxss NONE ssess 0xF35F CPU_SSE -INSN - minps NONE sseps 0x5D CPU_SSE -INSN - minss NONE ssess 0xF35D CPU_SSE -INSN - movaps NONE movaups 0x28 CPU_SSE -INSN - movhlps NONE movhllhps 0x12 CPU_SSE -INSN - movhps NONE movhlps 0x16 CPU_SSE -INSN - movlhps NONE movhllhps 0x16 CPU_SSE -INSN - movlps NONE movhlps 0x12 CPU_SSE -INSN - movmskps "lq" movmskps 0 CPU_SSE -INSN - movntps NONE movntps 0 CPU_SSE -INSN - movntq NONE movntq 0 CPU_SSE -INSN - movss NONE movss 0 CPU_SSE -INSN - movups NONE movaups 0x10 CPU_SSE -INSN - mulps NONE sseps 0x59 CPU_SSE -INSN - mulss NONE ssess 0xF359 CPU_SSE -INSN - orps NONE sseps 0x56 CPU_SSE -INSN - pavgb NONE mmxsse2 0xE0 CPU_P3|CPU_MMX -INSN - pavgw NONE mmxsse2 0xE3 CPU_P3|CPU_MMX -INSN - pextrw "lq" pextrw 0 CPU_P3|CPU_MMX -INSN - pinsrw "lq" pinsrw 0 CPU_P3|CPU_MMX -INSN - pmaxsw NONE mmxsse2 0xEE CPU_P3|CPU_MMX -INSN - pmaxub NONE mmxsse2 0xDE CPU_P3|CPU_MMX -INSN - pminsw NONE mmxsse2 0xEA CPU_P3|CPU_MMX -INSN - pminub NONE mmxsse2 0xDA CPU_P3|CPU_MMX -INSN - pmovmskb "lq" pmovmskb 0 CPU_SSE -INSN - pmulhuw NONE mmxsse2 0xE4 CPU_P3|CPU_MMX -INSN - prefetchnta NONE twobytemem 0x000F18 CPU_P3 -INSN - prefetcht0 NONE twobytemem 0x010F18 CPU_P3 -INSN - prefetcht1 NONE twobytemem 0x020F18 CPU_P3 -INSN - prefetcht2 NONE twobytemem 0x030F18 CPU_P3 -INSN - psadbw NONE mmxsse2 0xF6 CPU_P3|CPU_MMX -INSN - pshufw NONE pshufw 0 CPU_P3|CPU_MMX -INSN - rcpps NONE sseps 0x53 CPU_SSE -INSN - rcpss NONE ssess 0xF353 CPU_SSE -INSN - rsqrtps NONE sseps 0x52 CPU_SSE -INSN - rsqrtss NONE ssess 0xF352 CPU_SSE -INSN - sfence NONE threebyte 0x0FAEF8 CPU_P3 -INSN - shufps NONE ssepsimm 0xC6 CPU_SSE -INSN - sqrtps NONE sseps 0x51 CPU_SSE -INSN - sqrtss NONE ssess 0xF351 CPU_SSE -INSN - stmxcsr NONE ldstmxcsr 0x03 CPU_SSE -INSN - subps NONE sseps 0x5C CPU_SSE -INSN - subss NONE ssess 0xF35C CPU_SSE -INSN - ucomiss NONE ssess 0x2E CPU_SSE -INSN - unpckhps NONE sseps 0x15 CPU_SSE -INSN - unpcklps NONE sseps 0x14 CPU_SSE -INSN - xorps NONE sseps 0x57 CPU_SSE -# SSE2 instructions -INSN - addpd NONE ssess 0x6658 CPU_SSE2 -INSN - addsd NONE ssess 0xF258 CPU_SSE2 -INSN - andnpd NONE ssess 0x6655 CPU_SSE2 -INSN - andpd NONE ssess 0x6654 CPU_SSE2 -INSN - cmpeqpd NONE ssecmpss 0x0066 CPU_SSE2 -INSN - cmpeqsd NONE ssecmpss 0x00F2 CPU_SSE2 -INSN - cmplepd NONE ssecmpss 0x0266 CPU_SSE2 -INSN - cmplesd NONE ssecmpss 0x02F2 CPU_SSE2 -INSN - cmpltpd NONE ssecmpss 0x0166 CPU_SSE2 -INSN - cmpltsd NONE ssecmpss 0x01F2 CPU_SSE2 -INSN - cmpneqpd NONE ssecmpss 0x0466 CPU_SSE2 -INSN - cmpneqsd NONE ssecmpss 0x04F2 CPU_SSE2 -INSN - cmpnlepd NONE ssecmpss 0x0666 CPU_SSE2 -INSN - cmpnlesd NONE ssecmpss 0x06F2 CPU_SSE2 -INSN - cmpnltpd NONE ssecmpss 0x0566 CPU_SSE2 -INSN - cmpnltsd NONE ssecmpss 0x05F2 CPU_SSE2 -INSN - cmpordpd NONE ssecmpss 0x0766 CPU_SSE2 -INSN - cmpordsd NONE ssecmpss 0x07F2 CPU_SSE2 -INSN - cmpunordpd NONE ssecmpss 0x0366 CPU_SSE2 -INSN - cmpunordsd NONE ssecmpss 0x03F2 CPU_SSE2 -INSN - cmppd NONE ssessimm 0x66C2 CPU_SSE2 -# cmpsd is in string instructions above -INSN - comisd NONE ssess 0x662F CPU_SSE2 -INSN - cvtpi2pd NONE cvt_xmm_mm_ss 0x662A CPU_SSE2 -INSN - cvtsi2sd "lq" cvt_xmm_rmx 0xF22A CPU_SSE2 -INSN - divpd NONE ssess 0x665E CPU_SSE2 -INSN - divsd NONE ssess 0xF25E CPU_SSE2 -INSN - maxpd NONE ssess 0x665F CPU_SSE2 -INSN - maxsd NONE ssess 0xF25F CPU_SSE2 -INSN - minpd NONE ssess 0x665D CPU_SSE2 -INSN - minsd NONE ssess 0xF25D CPU_SSE2 -INSN - movapd NONE movaupd 0x28 CPU_SSE2 -INSN - movhpd NONE movhlpd 0x16 CPU_SSE2 -INSN - movlpd NONE movhlpd 0x12 CPU_SSE2 -INSN - movmskpd "lq" movmskpd 0 CPU_SSE2 -INSN - movntpd NONE movntpddq 0x2B CPU_SSE2 -INSN - movntdq NONE movntpddq 0xE7 CPU_SSE2 -# movsd is in string instructions above -INSN - movupd NONE movaupd 0x10 CPU_SSE2 -INSN - mulpd NONE ssess 0x6659 CPU_SSE2 -INSN - mulsd NONE ssess 0xF259 CPU_SSE2 -INSN - orpd NONE ssess 0x6656 CPU_SSE2 -INSN - shufpd NONE ssessimm 0x66C6 CPU_SSE2 -INSN - sqrtpd NONE ssess 0x6651 CPU_SSE2 -INSN - sqrtsd NONE ssess 0xF251 CPU_SSE2 -INSN - subpd NONE ssess 0x665C CPU_SSE2 -INSN - subsd NONE ssess 0xF25C CPU_SSE2 -INSN - ucomisd NONE ssess 0x662E CPU_SSE2 -INSN - unpckhpd NONE ssess 0x6615 CPU_SSE2 -INSN - unpcklpd NONE ssess 0x6614 CPU_SSE2 -INSN - xorpd NONE ssess 0x6657 CPU_SSE2 -INSN - cvtdq2pd NONE cvt_xmm_xmm64_ss 0xF3E6 CPU_SSE2 -INSN - cvtpd2dq NONE ssess 0xF2E6 CPU_SSE2 -INSN - cvtdq2ps NONE sseps 0x5B CPU_SSE2 -INSN - cvtpd2pi NONE cvt_mm_xmm 0x662D CPU_SSE2 -INSN - cvtpd2ps NONE ssess 0x665A CPU_SSE2 -INSN - cvtps2pd NONE cvt_xmm_xmm64_ps 0x5A CPU_SSE2 -INSN - cvtps2dq NONE ssess 0x665B CPU_SSE2 -INSN - cvtsd2si "lq" cvt_rx_xmm64 0xF22D CPU_SSE2 -INSN - cvtsd2ss NONE cvt_xmm_xmm64_ss 0xF25A CPU_SSE2 -# P4 VMX Instructions -INSN - vmcall NONE threebyte 0x0F01C1 CPU_P4 -INSN - vmlaunch NONE threebyte 0x0F01C2 CPU_P4 -INSN - vmresume NONE threebyte 0x0F01C3 CPU_P4 -INSN - vmxoff NONE threebyte 0x0F01C4 CPU_P4 -INSN - vmread "lq" vmxmemrd 0x0F78 CPU_P4 -INSN - vmwrite "lq" vmxmemwr 0x0F79 CPU_P4 -INSN - vmptrld NONE vmxtwobytemem 0x06C7 CPU_P4 -INSN - vmptrst NONE vmxtwobytemem 0x07C7 CPU_P4 -INSN - vmclear NONE vmxthreebytemem 0x0666C7 CPU_P4 -INSN - vmxon NONE vmxthreebytemem 0x06F3C7 CPU_P4 -INSN - cvtss2sd NONE cvt_xmm_xmm32 0xF35A CPU_SSE2 -INSN - cvttpd2pi NONE cvt_mm_xmm 0x662C CPU_SSE2 -INSN - cvttsd2si "lq" cvt_rx_xmm64 0xF22C CPU_SSE2 -INSN - cvttpd2dq NONE ssess 0x66E6 CPU_SSE2 -INSN - cvttps2dq NONE ssess 0xF35B CPU_SSE2 -INSN - maskmovdqu NONE maskmovdqu 0 CPU_SSE2 -INSN - movdqa NONE movdqau 0x66 CPU_SSE2 -INSN - movdqu NONE movdqau 0xF3 CPU_SSE2 -INSN - movdq2q NONE movdq2q 0 CPU_SSE2 -INSN - movq2dq NONE movq2dq 0 CPU_SSE2 -INSN - pmuludq NONE mmxsse2 0xF4 CPU_SSE2 -INSN - pshufd NONE ssessimm 0x6670 CPU_SSE2 -INSN - pshufhw NONE ssessimm 0xF370 CPU_SSE2 -INSN - pshuflw NONE ssessimm 0xF270 CPU_SSE2 -INSN - pslldq NONE pslrldq 0x07 CPU_SSE2 -INSN - psrldq NONE pslrldq 0x03 CPU_SSE2 -INSN - punpckhqdq NONE ssess 0x666D CPU_SSE2 -INSN - punpcklqdq NONE ssess 0x666C CPU_SSE2 -# SSE3 / PNI Prescott New Instructions instructions -INSN - addsubpd NONE ssess 0x66D0 CPU_SSE3 -INSN - addsubps NONE ssess 0xF2D0 CPU_SSE3 -INSN - fisttp "lqs" fildstp 0x010001 CPU_SSE3 -INSN gas fisttpll SUF_Q fildstp 0x07 CPU_FPU -INSN - haddpd NONE ssess 0x667C CPU_SSE3 -INSN - haddps NONE ssess 0xF27C CPU_SSE3 -INSN - hsubpd NONE ssess 0x667D CPU_SSE3 -INSN - hsubps NONE ssess 0xF27D CPU_SSE3 -INSN - lddqu NONE lddqu 0 CPU_SSE3 -INSN - monitor NONE threebyte 0x0F01C8 CPU_SSE3 -INSN - movddup NONE cvt_xmm_xmm64_ss 0xF212 CPU_SSE3 -INSN - movshdup NONE ssess 0xF316 CPU_SSE3 -INSN - movsldup NONE ssess 0xF312 CPU_SSE3 -INSN - mwait NONE threebyte 0x0F01C9 CPU_SSE3 -# SSSE3 / TNI Tejas New Intructions instructions -INSN - pshufb NONE ssse3 0x00 CPU_SSSE3 -INSN - phaddw NONE ssse3 0x01 CPU_SSSE3 -INSN - phaddd NONE ssse3 0x02 CPU_SSSE3 -INSN - phaddsw NONE ssse3 0x03 CPU_SSSE3 -INSN - pmaddubsw NONE ssse3 0x04 CPU_SSSE3 -INSN - phsubw NONE ssse3 0x05 CPU_SSSE3 -INSN - phsubd NONE ssse3 0x06 CPU_SSSE3 -INSN - phsubsw NONE ssse3 0x07 CPU_SSSE3 -INSN - psignb NONE ssse3 0x08 CPU_SSSE3 -INSN - psignw NONE ssse3 0x09 CPU_SSSE3 -INSN - psignd NONE ssse3 0x0A CPU_SSSE3 -INSN - pmulhrsw NONE ssse3 0x0B CPU_SSSE3 -INSN - pabsb NONE ssse3 0x1C CPU_SSSE3 -INSN - pabsw NONE ssse3 0x1D CPU_SSSE3 -INSN - pabsd NONE ssse3 0x1E CPU_SSSE3 -INSN - palignr NONE ssse3imm 0x0F CPU_SSSE3 -# SSE4.1 / SSE4.2 instructions -INSN - blendpd NONE sse4imm 0x0D CPU_SSE41 -INSN - blendps NONE sse4imm 0x0C CPU_SSE41 -INSN - blendvpd NONE sse4xmm0 0x15 CPU_SSE41 -INSN - blendvps NONE sse4xmm0 0x14 CPU_SSE41 -INSN - crc32 "bwlq" crc32 0 CPU_SSE42 -INSN - dppd NONE sse4imm 0x41 CPU_SSE41 -INSN - dpps NONE sse4imm 0x40 CPU_SSE41 -INSN - extractps NONE extractps 0 CPU_SSE41 -INSN - insertps NONE insertps 0 CPU_SSE41 -INSN - movntdqa NONE movntdqa 0 CPU_SSE41 -INSN - mpsadbw NONE sse4imm 0x42 CPU_SSE41 -INSN - packusdw NONE sse4 0x2B CPU_SSE41 -INSN - pblendvb NONE sse4xmm0 0x10 CPU_SSE41 -INSN - pblendw NONE sse4imm 0x0E CPU_SSE41 -INSN - pcmpeqq NONE sse4 0x29 CPU_SSE41 -INSN - pcmpestri "wlq" sse4pcmpstr 0x61 CPU_SSE42 -INSN - pcmpestrm "wlq" sse4pcmpstr 0x60 CPU_SSE42 -INSN - pcmpistri "wlq" sse4pcmpstr 0x63 CPU_SSE42 -INSN - pcmpistrm "wlq" sse4pcmpstr 0x62 CPU_SSE42 -INSN - pcmpgtq NONE sse4 0x37 CPU_SSE42 -INSN - pextrb NONE pextrb 0 CPU_SSE41 -INSN - pextrd NONE pextrd 0 CPU_SSE41 -INSN - pextrq NONE pextrq 0 CPU_SSE41 -#INSN - pextrw NONE pextrw 0 CPU_SSE41 -INSN - phminposuw NONE sse4 0x41 CPU_SSE41 -INSN - pinsrb NONE pinsrb 0 CPU_SSE41 -INSN - pinsrd NONE pinsrd 0 CPU_SSE41 -INSN - pinsrq NONE pinsrq 0 CPU_SSE41 -INSN - pmaxsb NONE sse4 0x3C CPU_SSE41 -INSN - pmaxsd NONE sse4 0x3D CPU_SSE41 -INSN - pmaxud NONE sse4 0x3F CPU_SSE41 -INSN - pmaxuw NONE sse4 0x3E CPU_SSE41 -INSN - pminsb NONE sse4 0x38 CPU_SSE41 -INSN - pminsd NONE sse4 0x39 CPU_SSE41 -INSN - pminud NONE sse4 0x3B CPU_SSE41 -INSN - pminuw NONE sse4 0x3A CPU_SSE41 -INSN - pmovsxbw NONE sse4m64 0x20 CPU_SSE41 -INSN - pmovsxbd NONE sse4m32 0x21 CPU_SSE41 -INSN - pmovsxbq NONE sse4m16 0x22 CPU_SSE41 -INSN - pmovsxwd NONE sse4m64 0x23 CPU_SSE41 -INSN - pmovsxwq NONE sse4m32 0x24 CPU_SSE41 -INSN - pmovsxdq NONE sse4m64 0x25 CPU_SSE41 -INSN - pmovzxbw NONE sse4m64 0x30 CPU_SSE41 -INSN - pmovzxbd NONE sse4m32 0x31 CPU_SSE41 -INSN - pmovzxbq NONE sse4m16 0x32 CPU_SSE41 -INSN - pmovzxwd NONE sse4m64 0x33 CPU_SSE41 -INSN - pmovzxwq NONE sse4m32 0x34 CPU_SSE41 -INSN - pmovzxdq NONE sse4m64 0x35 CPU_SSE41 -INSN - pmuldq NONE sse4 0x28 CPU_SSE41 -INSN - pmulld NONE sse4 0x40 CPU_SSE41 -INSN - popcnt "wlq" cnt 0xB8 CPU_SSE42 -INSN - ptest NONE sse4 0x17 CPU_SSE41 -INSN - roundpd NONE sse4imm 0x09 CPU_SSE41 -INSN - roundps NONE sse4imm 0x08 CPU_SSE41 -INSN - roundsd NONE sse4imm 0x0B CPU_SSE41 -INSN - roundss NONE sse4imm 0x0A CPU_SSE41 -# AMD SSE4.1 instructions -INSN - extrq NONE extrq 0 CPU_SSE41 -INSN - insertq NONE insertq 0 CPU_SSE41 -INSN - movntsd NONE movntsd 0 CPU_SSE41 -INSN - movntss NONE movntss 0 CPU_SSE41 -# AMD 3DNow! instructions -INSN - prefetch NONE twobytemem 0x000F0D CPU_3DNow -INSN - prefetchw NONE twobytemem 0x010F0D CPU_3DNow -INSN - femms NONE twobyte 0x0F0E CPU_3DNow -INSN - pavgusb NONE now3d 0xBF CPU_3DNow -INSN - pf2id NONE now3d 0x1D CPU_3DNow -INSN - pf2iw NONE now3d 0x1C CPU_Athlon|CPU_3DNow -INSN - pfacc NONE now3d 0xAE CPU_3DNow -INSN - pfadd NONE now3d 0x9E CPU_3DNow -INSN - pfcmpeq NONE now3d 0xB0 CPU_3DNow -INSN - pfcmpge NONE now3d 0x90 CPU_3DNow -INSN - pfcmpgt NONE now3d 0xA0 CPU_3DNow -INSN - pfmax NONE now3d 0xA4 CPU_3DNow -INSN - pfmin NONE now3d 0x94 CPU_3DNow -INSN - pfmul NONE now3d 0xB4 CPU_3DNow -INSN - pfnacc NONE now3d 0x8A CPU_Athlon|CPU_3DNow -INSN - pfpnacc NONE now3d 0x8E CPU_Athlon|CPU_3DNow -INSN - pfrcp NONE now3d 0x96 CPU_3DNow -INSN - pfrcpit1 NONE now3d 0xA6 CPU_3DNow -INSN - pfrcpit2 NONE now3d 0xB6 CPU_3DNow -INSN - pfrsqit1 NONE now3d 0xA7 CPU_3DNow -INSN - pfrsqrt NONE now3d 0x97 CPU_3DNow -INSN - pfsub NONE now3d 0x9A CPU_3DNow -INSN - pfsubr NONE now3d 0xAA CPU_3DNow -INSN - pi2fd NONE now3d 0x0D CPU_3DNow -INSN - pi2fw NONE now3d 0x0C CPU_Athlon|CPU_3DNow -INSN - pmulhrwa NONE now3d 0xB7 CPU_3DNow -INSN - pswapd NONE now3d 0xBB CPU_Athlon|CPU_3DNow -# AMD extensions -INSN - syscall NONE twobyte 0x0F05 CPU_686|CPU_AMD -INSN - sysret "lq" twobyte 0x0F07 CPU_686|CPU_AMD|CPU_Priv -INSN - lzcnt "wlq" cnt 0xBD CPU_686|CPU_AMD -# AMD x86-64 extensions -INSN - swapgs NONE threebyte 0x0F01F8 CPU_Hammer|CPU_64 -INSN - rdtscp NONE threebyte 0x0F01F9 CPU_686|CPU_AMD|CPU_Priv -INSN - cmpxchg16b NONE cmpxchg16b 0 CPU_Hammer|CPU_64 -# AMD Pacifica SVM instructions -INSN - clgi NONE threebyte 0x0F01DD CPU_SVM -INSN - invlpga NONE invlpga 0 CPU_SVM -INSN - skinit NONE skinit 0 CPU_SVM -INSN - stgi NONE threebyte 0x0F01DC CPU_SVM -INSN - vmload NONE svm_rax 0xDA CPU_SVM -INSN - vmmcall NONE threebyte 0x0F01D9 CPU_SVM -INSN - vmrun NONE svm_rax 0xD8 CPU_SVM -INSN - vmsave NONE svm_rax 0xDB CPU_SVM -# VIA PadLock instructions -INSN - xstore NONE padlock 0xC000A7 CPU_PadLock -INSN - xstorerng NONE padlock 0xC000A7 CPU_PadLock -INSN - xcryptecb NONE padlock 0xC8F3A7 CPU_PadLock -INSN - xcryptcbc NONE padlock 0xD0F3A7 CPU_PadLock -INSN - xcryptctr NONE padlock 0xD8F3A7 CPU_PadLock -INSN - xcryptcfb NONE padlock 0xE0F3A7 CPU_PadLock -INSN - xcryptofb NONE padlock 0xE8F3A7 CPU_PadLock -INSN - montmul NONE padlock 0xC0F3A6 CPU_PadLock -INSN - xsha1 NONE padlock 0xC8F3A6 CPU_PadLock -INSN - xsha256 NONE padlock 0xD0F3A6 CPU_PadLock -# Cyrix MMX instructions -INSN - paddsiw NONE cyrixmmx 0x51 CPU_Cyrix|CPU_MMX -INSN - paveb NONE cyrixmmx 0x50 CPU_Cyrix|CPU_MMX -INSN - pdistib NONE cyrixmmx 0x54 CPU_Cyrix|CPU_MMX -INSN - pmachriw NONE pmachriw 0 CPU_Cyrix|CPU_MMX -INSN - pmagw NONE cyrixmmx 0x52 CPU_Cyrix|CPU_MMX -INSN - pmulhriw NONE cyrixmmx 0x5D CPU_Cyrix|CPU_MMX -INSN - pmulhrwc NONE cyrixmmx 0x59 CPU_Cyrix|CPU_MMX -INSN - pmvgezb NONE cyrixmmx 0x5C CPU_Cyrix|CPU_MMX -INSN - pmvlzb NONE cyrixmmx 0x5B CPU_Cyrix|CPU_MMX -INSN - pmvnzb NONE cyrixmmx 0x5A CPU_Cyrix|CPU_MMX -INSN - pmvzb NONE cyrixmmx 0x58 CPU_Cyrix|CPU_MMX -INSN - psubsiw NONE cyrixmmx 0x55 CPU_Cyrix|CPU_MMX -# Cyrix extensions -INSN - rdshr NONE rdwrshr 0x00 CPU_686|CPU_Cyrix|CPU_SMM -INSN - rsdc NONE rsdc 0 CPU_486|CPU_Cyrix|CPU_SMM -INSN - rsldt NONE cyrixsmm 0x7B CPU_486|CPU_Cyrix|CPU_SMM -INSN - rsts NONE cyrixsmm 0x7D CPU_486|CPU_Cyrix|CPU_SMM -INSN - svdc NONE svdc 0 CPU_486|CPU_Cyrix|CPU_SMM -INSN - svldt NONE cyrixsmm 0x7A CPU_486|CPU_Cyrix|CPU_SMM -INSN - svts NONE cyrixsmm 0x7C CPU_486|CPU_Cyrix|CPU_SMM -INSN - smint NONE twobyte 0x0F38 CPU_686|CPU_Cyrix -INSN - smintold NONE twobyte 0x0F7E CPU_486|CPU_Cyrix|CPU_Obs -INSN - wrshr NONE rdwrshr 0x01 CPU_686|CPU_Cyrix|CPU_SMM -# Obsolete/undocumented instructions -INSN - fsetpm NONE twobyte 0xDBE4 CPU_286|CPU_FPU|CPU_Obs -INSN - ibts NONE ibts 0 CPU_386|CPU_Undoc|CPU_Obs -INSN - loadall NONE twobyte 0x0F07 CPU_386|CPU_Undoc -INSN - loadall286 NONE twobyte 0x0F05 CPU_286|CPU_Undoc -INSN - salc NONE onebyte 0x00D6 CPU_Undoc|CPU_Not64 -INSN - smi NONE onebyte 0x00F1 CPU_386|CPU_Undoc -INSN - umov NONE umov 0 CPU_386|CPU_Undoc -INSN - xbts NONE xbts 0 CPU_386|CPU_Undoc|CPU_Obs - -# PREFIX parameters: -# - parser -# - prefix name -# - prefix type -# - prefix value - -# operand size overrides -PREFIX nasm o16 X86_OPERSIZE 16 -PREFIX gas data16 X86_OPERSIZE 16 -PREFIX gas word X86_OPERSIZE 16 -PREFIX nasm o32 X86_OPERSIZE 32 -PREFIX gas data32 X86_OPERSIZE 32 -PREFIX gas dword X86_OPERSIZE 32 -PREFIX nasm o64 X86_OPERSIZE 64 -PREFIX gas data64 X86_OPERSIZE 64 -PREFIX gas qword X86_OPERSIZE 64 - -# address size overrides -PREFIX nasm a16 X86_ADDRSIZE 16 -PREFIX gas addr16 X86_ADDRSIZE 16 -PREFIX gas aword X86_ADDRSIZE 16 -PREFIX nasm a32 X86_ADDRSIZE 32 -PREFIX gas addr32 X86_ADDRSIZE 32 -PREFIX gas adword X86_ADDRSIZE 32 -PREFIX nasm a64 X86_ADDRSIZE 64 -PREFIX gas addr64 X86_ADDRSIZE 64 -PREFIX gas aqword X86_ADDRSIZE 64 - -# instruction prefixes -PREFIX - lock X86_LOCKREP 0xF0 -PREFIX - repne X86_LOCKREP 0xF2 -PREFIX - repnz X86_LOCKREP 0xF2 -PREFIX - rep X86_LOCKREP 0xF3 -PREFIX - repe X86_LOCKREP 0xF3 -PREFIX - repz X86_LOCKREP 0xF3 - -# other prefixes, limited to GAS-only at the moment -# Hint taken/not taken for jumps -PREFIX gas ht X86_SEGREG 0x3E -PREFIX gas hnt X86_SEGREG 0x2E - -# REX byte explicit prefixes -PREFIX gas rex X86_REX 0x40 -PREFIX gas rexz X86_REX 0x41 -PREFIX gas rexy X86_REX 0x42 -PREFIX gas rexyz X86_REX 0x43 -PREFIX gas rexx X86_REX 0x44 -PREFIX gas rexxz X86_REX 0x45 -PREFIX gas rexxy X86_REX 0x46 -PREFIX gas rexxyz X86_REX 0x47 -PREFIX gas rex64 X86_REX 0x48 -PREFIX gas rex64z X86_REX 0x49 -PREFIX gas rex64y X86_REX 0x4A -PREFIX gas rex64yz X86_REX 0x4B -PREFIX gas rex64x X86_REX 0x4C -PREFIX gas rex64xz X86_REX 0x4D -PREFIX gas rex64xy X86_REX 0x4E -PREFIX gas rex64xyz X86_REX 0x4F - diff --git a/tools/genperf/Makefile.inc b/tools/genperf/Makefile.inc index b6bedff4..600c93cb 100644 --- a/tools/genperf/Makefile.inc +++ b/tools/genperf/Makefile.inc @@ -5,6 +5,11 @@ noinst_PROGRAMS += genperf +# Suffix rule for genperf +SUFFIXES += .gperf +.gperf.c: genperf$(EXEEXT) + $(top_builddir)/genperf$(EXEEXT) $< > $@ + genperf_SOURCES = EXTRA_DIST += tools/genperf/genperf.c EXTRA_DIST += tools/genperf/perfect.c From 0e349f552d3f7008ea28bb0fc67767b594537777 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Mon, 10 Sep 2007 07:03:53 +0000 Subject: [PATCH 072/585] 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 --- x86insn_gas.gperf | 1272 ++++++++++++++++++++++++++++++++++++++++++++ x86insn_nasm.gperf | 768 ++++++++++++++++++++++++++ x86insns.c | 1104 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 3144 insertions(+) create mode 100644 x86insn_gas.gperf create mode 100644 x86insn_nasm.gperf create mode 100644 x86insns.c diff --git a/x86insn_gas.gperf b/x86insn_gas.gperf new file mode 100644 index 00000000..84e65247 --- /dev/null +++ b/x86insn_gas.gperf @@ -0,0 +1,1272 @@ +%ignore-case +%language=ANSI-C +%compare-strncmp +%readonly-tables +%enum +%struct-type +%define hash-function-name insnprefix_gas_hash +%define lookup-function-name insnprefix_gas_find +struct insnprefix_parse_data; +%% +aaa, onebyte_insn, (0x000037UL<<8)|NELEMS(onebyte_insn), CPU_Not64, NONE +aad, aadm_insn, (0x01UL<<8)|NELEMS(aadm_insn), CPU_Not64, NONE +aam, aadm_insn, (0x00UL<<8)|NELEMS(aadm_insn), CPU_Not64, NONE +aas, onebyte_insn, (0x00003FUL<<8)|NELEMS(onebyte_insn), CPU_Not64, NONE +adc, arith_insn, (0x0210UL<<8)|NELEMS(arith_insn), CPU_Any, NONE +adcb, arith_insn, (0x0210UL<<8)|NELEMS(arith_insn), CPU_Any, SUF_B +adcl, arith_insn, (0x0210UL<<8)|NELEMS(arith_insn), CPU_386, SUF_L +adcq, arith_insn, (0x0210UL<<8)|NELEMS(arith_insn), CPU_64, SUF_Q +adcw, arith_insn, (0x0210UL<<8)|NELEMS(arith_insn), CPU_Any, SUF_W +add, arith_insn, (0x0000UL<<8)|NELEMS(arith_insn), CPU_Any, NONE +addb, arith_insn, (0x0000UL<<8)|NELEMS(arith_insn), CPU_Any, SUF_B +addl, arith_insn, (0x0000UL<<8)|NELEMS(arith_insn), CPU_386, SUF_L +addq, arith_insn, (0x0000UL<<8)|NELEMS(arith_insn), CPU_64, SUF_Q +addw, arith_insn, (0x0000UL<<8)|NELEMS(arith_insn), CPU_Any, SUF_W +addpd, ssess_insn, (0x6658UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +addps, sseps_insn, (0x58UL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE +addr16, NULL, X86_ADDRSIZE, 0x10, NONE +addr32, NULL, X86_ADDRSIZE, 0x20, NONE +addr64, NULL, X86_ADDRSIZE, 0x40, NONE +addsd, ssess_insn, (0xF258UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +addss, ssess_insn, (0xF358UL<<8)|NELEMS(ssess_insn), CPU_SSE, NONE +addsubpd, ssess_insn, (0x66D0UL<<8)|NELEMS(ssess_insn), CPU_SSE3, NONE +addsubps, ssess_insn, (0xF2D0UL<<8)|NELEMS(ssess_insn), CPU_SSE3, NONE +adword, NULL, X86_ADDRSIZE, 0x20, NONE +and, arith_insn, (0x0420UL<<8)|NELEMS(arith_insn), CPU_Any, NONE +andb, arith_insn, (0x0420UL<<8)|NELEMS(arith_insn), CPU_Any, SUF_B +andl, arith_insn, (0x0420UL<<8)|NELEMS(arith_insn), CPU_386, SUF_L +andq, arith_insn, (0x0420UL<<8)|NELEMS(arith_insn), CPU_64, SUF_Q +andw, arith_insn, (0x0420UL<<8)|NELEMS(arith_insn), CPU_Any, SUF_W +andnpd, ssess_insn, (0x6655UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +andnps, sseps_insn, (0x55UL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE +andpd, ssess_insn, (0x6654UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +andps, sseps_insn, (0x54UL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE +aqword, NULL, X86_ADDRSIZE, 0x40, NONE +arpl, arpl_insn, (0UL<<8)|NELEMS(arpl_insn), CPU_286|CPU_Not64|CPU_Prot, NONE +arplw, arpl_insn, (0UL<<8)|NELEMS(arpl_insn), CPU_286|CPU_Not64|CPU_Prot, SUF_W +aword, NULL, X86_ADDRSIZE, 0x10, NONE +blendpd, sse4imm_insn, (0x0DUL<<8)|NELEMS(sse4imm_insn), CPU_SSE41, NONE +blendps, sse4imm_insn, (0x0CUL<<8)|NELEMS(sse4imm_insn), CPU_SSE41, NONE +blendvpd, sse4xmm0_insn, (0x15UL<<8)|NELEMS(sse4xmm0_insn), CPU_SSE41, NONE +blendvps, sse4xmm0_insn, (0x14UL<<8)|NELEMS(sse4xmm0_insn), CPU_SSE41, NONE +bound, bound_insn, (0UL<<8)|NELEMS(bound_insn), CPU_186|CPU_Not64, NONE +boundl, bound_insn, (0UL<<8)|NELEMS(bound_insn), CPU_386|CPU_Not64, SUF_L +boundw, bound_insn, (0UL<<8)|NELEMS(bound_insn), CPU_186|CPU_Not64, SUF_W +bsf, bsfr_insn, (0xBCUL<<8)|NELEMS(bsfr_insn), CPU_386, NONE +bsfl, bsfr_insn, (0xBCUL<<8)|NELEMS(bsfr_insn), CPU_386, SUF_L +bsfq, bsfr_insn, (0xBCUL<<8)|NELEMS(bsfr_insn), CPU_386|CPU_64, SUF_Q +bsfw, bsfr_insn, (0xBCUL<<8)|NELEMS(bsfr_insn), CPU_386, SUF_W +bsr, bsfr_insn, (0xBDUL<<8)|NELEMS(bsfr_insn), CPU_386, NONE +bsrl, bsfr_insn, (0xBDUL<<8)|NELEMS(bsfr_insn), CPU_386, SUF_L +bsrq, bsfr_insn, (0xBDUL<<8)|NELEMS(bsfr_insn), CPU_386|CPU_64, SUF_Q +bsrw, bsfr_insn, (0xBDUL<<8)|NELEMS(bsfr_insn), CPU_386, SUF_W +bswap, bswap_insn, (0UL<<8)|NELEMS(bswap_insn), CPU_486, NONE +bswapl, bswap_insn, (0UL<<8)|NELEMS(bswap_insn), CPU_486, SUF_L +bswapq, bswap_insn, (0UL<<8)|NELEMS(bswap_insn), CPU_64, SUF_Q +bt, bittest_insn, (0x04A3UL<<8)|NELEMS(bittest_insn), CPU_386, NONE +btl, bittest_insn, (0x04A3UL<<8)|NELEMS(bittest_insn), CPU_386, SUF_L +btq, bittest_insn, (0x04A3UL<<8)|NELEMS(bittest_insn), CPU_386|CPU_64, SUF_Q +btw, bittest_insn, (0x04A3UL<<8)|NELEMS(bittest_insn), CPU_386, SUF_W +btc, bittest_insn, (0x07BBUL<<8)|NELEMS(bittest_insn), CPU_386, NONE +btcl, bittest_insn, (0x07BBUL<<8)|NELEMS(bittest_insn), CPU_386, SUF_L +btcq, bittest_insn, (0x07BBUL<<8)|NELEMS(bittest_insn), CPU_386|CPU_64, SUF_Q +btcw, bittest_insn, (0x07BBUL<<8)|NELEMS(bittest_insn), CPU_386, SUF_W +btr, bittest_insn, (0x06B3UL<<8)|NELEMS(bittest_insn), CPU_386, NONE +btrl, bittest_insn, (0x06B3UL<<8)|NELEMS(bittest_insn), CPU_386, SUF_L +btrq, bittest_insn, (0x06B3UL<<8)|NELEMS(bittest_insn), CPU_386|CPU_64, SUF_Q +btrw, bittest_insn, (0x06B3UL<<8)|NELEMS(bittest_insn), CPU_386, SUF_W +bts, bittest_insn, (0x05ABUL<<8)|NELEMS(bittest_insn), CPU_386, NONE +btsl, bittest_insn, (0x05ABUL<<8)|NELEMS(bittest_insn), CPU_386, SUF_L +btsq, bittest_insn, (0x05ABUL<<8)|NELEMS(bittest_insn), CPU_386|CPU_64, SUF_Q +btsw, bittest_insn, (0x05ABUL<<8)|NELEMS(bittest_insn), CPU_386, SUF_W +call, call_insn, (0UL<<8)|NELEMS(call_insn), CPU_Any, NONE +calll, call_insn, (0UL<<8)|NELEMS(call_insn), CPU_Not64, NONE +callq, call_insn, (0UL<<8)|NELEMS(call_insn), CPU_64, NONE +cbtw, onebyte_insn, (0x001098UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +cbw, onebyte_insn, (0x001098UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +cdq, onebyte_insn, (0x002099UL<<8)|NELEMS(onebyte_insn), CPU_386, NONE +cdqe, onebyte_insn, (0x004098UL<<8)|NELEMS(onebyte_insn), CPU_64, NONE +clc, onebyte_insn, (0x0000F8UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +cld, onebyte_insn, (0x0000FCUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +clflush, clflush_insn, (0UL<<8)|NELEMS(clflush_insn), CPU_P3, NONE +clgi, threebyte_insn, (0x0F01DDUL<<8)|NELEMS(threebyte_insn), CPU_SVM, NONE +cli, onebyte_insn, (0x0000FAUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +cltd, onebyte_insn, (0x002099UL<<8)|NELEMS(onebyte_insn), CPU_386, NONE +cltq, onebyte_insn, (0x004098UL<<8)|NELEMS(onebyte_insn), CPU_64, NONE +clts, twobyte_insn, (0x0F06UL<<8)|NELEMS(twobyte_insn), CPU_286|CPU_Priv, NONE +cmc, onebyte_insn, (0x0000F5UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +cmova, cmovcc_insn, (0x07UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmoval, cmovcc_insn, (0x07UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L +cmovaq, cmovcc_insn, (0x07UL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q +cmovaw, cmovcc_insn, (0x07UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W +cmovae, cmovcc_insn, (0x03UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovael, cmovcc_insn, (0x03UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L +cmovaeq, cmovcc_insn, (0x03UL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q +cmovaew, cmovcc_insn, (0x03UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W +cmovb, cmovcc_insn, (0x02UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovbl, cmovcc_insn, (0x02UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L +cmovbq, cmovcc_insn, (0x02UL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q +cmovbw, cmovcc_insn, (0x02UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W +cmovbe, cmovcc_insn, (0x06UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovbel, cmovcc_insn, (0x06UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L +cmovbeq, cmovcc_insn, (0x06UL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q +cmovbew, cmovcc_insn, (0x06UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W +cmovc, cmovcc_insn, (0x02UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovcl, cmovcc_insn, (0x02UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L +cmovcq, cmovcc_insn, (0x02UL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q +cmovcw, cmovcc_insn, (0x02UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W +cmove, cmovcc_insn, (0x04UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovel, cmovcc_insn, (0x04UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L +cmoveq, cmovcc_insn, (0x04UL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q +cmovew, cmovcc_insn, (0x04UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W +cmovg, cmovcc_insn, (0x0FUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovgl, cmovcc_insn, (0x0FUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L +cmovgq, cmovcc_insn, (0x0FUL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q +cmovgw, cmovcc_insn, (0x0FUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W +cmovge, cmovcc_insn, (0x0DUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovgel, cmovcc_insn, (0x0DUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L +cmovgeq, cmovcc_insn, (0x0DUL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q +cmovgew, cmovcc_insn, (0x0DUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W +cmovl, cmovcc_insn, (0x0CUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovll, cmovcc_insn, (0x0CUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L +cmovlq, cmovcc_insn, (0x0CUL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q +cmovlw, cmovcc_insn, (0x0CUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W +cmovle, cmovcc_insn, (0x0EUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovlel, cmovcc_insn, (0x0EUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L +cmovleq, cmovcc_insn, (0x0EUL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q +cmovlew, cmovcc_insn, (0x0EUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W +cmovna, cmovcc_insn, (0x06UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovnal, cmovcc_insn, (0x06UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L +cmovnaq, cmovcc_insn, (0x06UL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q +cmovnaw, cmovcc_insn, (0x06UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W +cmovnae, cmovcc_insn, (0x02UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovnael, cmovcc_insn, (0x02UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L +cmovnaeq, cmovcc_insn, (0x02UL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q +cmovnaew, cmovcc_insn, (0x02UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W +cmovnb, cmovcc_insn, (0x03UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovnbl, cmovcc_insn, (0x03UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L +cmovnbq, cmovcc_insn, (0x03UL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q +cmovnbw, cmovcc_insn, (0x03UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W +cmovnbe, cmovcc_insn, (0x07UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovnbel, cmovcc_insn, (0x07UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L +cmovnbeq, cmovcc_insn, (0x07UL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q +cmovnbew, cmovcc_insn, (0x07UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W +cmovnc, cmovcc_insn, (0x03UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovncl, cmovcc_insn, (0x03UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L +cmovncq, cmovcc_insn, (0x03UL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q +cmovncw, cmovcc_insn, (0x03UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W +cmovne, cmovcc_insn, (0x05UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovnel, cmovcc_insn, (0x05UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L +cmovneq, cmovcc_insn, (0x05UL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q +cmovnew, cmovcc_insn, (0x05UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W +cmovng, cmovcc_insn, (0x0EUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovngl, cmovcc_insn, (0x0EUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L +cmovngq, cmovcc_insn, (0x0EUL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q +cmovngw, cmovcc_insn, (0x0EUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W +cmovnge, cmovcc_insn, (0x0CUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovngel, cmovcc_insn, (0x0CUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L +cmovngeq, cmovcc_insn, (0x0CUL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q +cmovngew, cmovcc_insn, (0x0CUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W +cmovnl, cmovcc_insn, (0x0DUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovnll, cmovcc_insn, (0x0DUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L +cmovnlq, cmovcc_insn, (0x0DUL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q +cmovnlw, cmovcc_insn, (0x0DUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W +cmovnle, cmovcc_insn, (0x0FUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovnlel, cmovcc_insn, (0x0FUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L +cmovnleq, cmovcc_insn, (0x0FUL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q +cmovnlew, cmovcc_insn, (0x0FUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W +cmovno, cmovcc_insn, (0x01UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovnol, cmovcc_insn, (0x01UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L +cmovnoq, cmovcc_insn, (0x01UL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q +cmovnow, cmovcc_insn, (0x01UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W +cmovnp, cmovcc_insn, (0x0BUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovnpl, cmovcc_insn, (0x0BUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L +cmovnpq, cmovcc_insn, (0x0BUL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q +cmovnpw, cmovcc_insn, (0x0BUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W +cmovns, cmovcc_insn, (0x09UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovnsl, cmovcc_insn, (0x09UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L +cmovnsq, cmovcc_insn, (0x09UL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q +cmovnsw, cmovcc_insn, (0x09UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W +cmovnz, cmovcc_insn, (0x05UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovnzl, cmovcc_insn, (0x05UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L +cmovnzq, cmovcc_insn, (0x05UL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q +cmovnzw, cmovcc_insn, (0x05UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W +cmovo, cmovcc_insn, (0x00UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovol, cmovcc_insn, (0x00UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L +cmovoq, cmovcc_insn, (0x00UL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q +cmovow, cmovcc_insn, (0x00UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W +cmovp, cmovcc_insn, (0x0AUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovpl, cmovcc_insn, (0x0AUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L +cmovpq, cmovcc_insn, (0x0AUL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q +cmovpw, cmovcc_insn, (0x0AUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W +cmovpe, cmovcc_insn, (0x0AUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovpel, cmovcc_insn, (0x0AUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L +cmovpeq, cmovcc_insn, (0x0AUL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q +cmovpew, cmovcc_insn, (0x0AUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W +cmovpo, cmovcc_insn, (0x0BUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovpol, cmovcc_insn, (0x0BUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L +cmovpoq, cmovcc_insn, (0x0BUL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q +cmovpow, cmovcc_insn, (0x0BUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W +cmovs, cmovcc_insn, (0x08UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovsl, cmovcc_insn, (0x08UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L +cmovsq, cmovcc_insn, (0x08UL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q +cmovsw, cmovcc_insn, (0x08UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W +cmovz, cmovcc_insn, (0x04UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovzl, cmovcc_insn, (0x04UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L +cmovzq, cmovcc_insn, (0x04UL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q +cmovzw, cmovcc_insn, (0x04UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W +cmp, arith_insn, (0x0738UL<<8)|NELEMS(arith_insn), CPU_Any, NONE +cmpb, arith_insn, (0x0738UL<<8)|NELEMS(arith_insn), CPU_Any, SUF_B +cmpl, arith_insn, (0x0738UL<<8)|NELEMS(arith_insn), CPU_386, SUF_L +cmpq, arith_insn, (0x0738UL<<8)|NELEMS(arith_insn), CPU_64, SUF_Q +cmpw, arith_insn, (0x0738UL<<8)|NELEMS(arith_insn), CPU_Any, SUF_W +cmpeqpd, ssecmpss_insn, (0x0066UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE +cmpeqps, ssecmpps_insn, (0x00UL<<8)|NELEMS(ssecmpps_insn), CPU_SSE, NONE +cmpeqsd, ssecmpss_insn, (0x00F2UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE +cmpeqss, ssecmpss_insn, (0x00F3UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE, NONE +cmplepd, ssecmpss_insn, (0x0266UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE +cmpleps, ssecmpps_insn, (0x02UL<<8)|NELEMS(ssecmpps_insn), CPU_SSE, NONE +cmplesd, ssecmpss_insn, (0x02F2UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE +cmpless, ssecmpss_insn, (0x02F3UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE, NONE +cmpltpd, ssecmpss_insn, (0x0166UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE +cmpltps, ssecmpps_insn, (0x01UL<<8)|NELEMS(ssecmpps_insn), CPU_SSE, NONE +cmpltsd, ssecmpss_insn, (0x01F2UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE +cmpltss, ssecmpss_insn, (0x01F3UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE, NONE +cmpneqpd, ssecmpss_insn, (0x0466UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE +cmpneqps, ssecmpps_insn, (0x04UL<<8)|NELEMS(ssecmpps_insn), CPU_SSE, NONE +cmpneqsd, ssecmpss_insn, (0x04F2UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE +cmpneqss, ssecmpss_insn, (0x04F3UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE, NONE +cmpnlepd, ssecmpss_insn, (0x0666UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE +cmpnleps, ssecmpps_insn, (0x06UL<<8)|NELEMS(ssecmpps_insn), CPU_SSE, NONE +cmpnlesd, ssecmpss_insn, (0x06F2UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE +cmpnless, ssecmpss_insn, (0x06F3UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE, NONE +cmpnltpd, ssecmpss_insn, (0x0566UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE +cmpnltps, ssecmpps_insn, (0x05UL<<8)|NELEMS(ssecmpps_insn), CPU_SSE, NONE +cmpnltsd, ssecmpss_insn, (0x05F2UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE +cmpnltss, ssecmpss_insn, (0x05F3UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE, NONE +cmpordpd, ssecmpss_insn, (0x0766UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE +cmpordps, ssecmpps_insn, (0x07UL<<8)|NELEMS(ssecmpps_insn), CPU_SSE, NONE +cmpordsd, ssecmpss_insn, (0x07F2UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE +cmpordss, ssecmpss_insn, (0x07F3UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE, NONE +cmppd, ssessimm_insn, (0x66C2UL<<8)|NELEMS(ssessimm_insn), CPU_SSE2, NONE +cmpps, ssepsimm_insn, (0xC2UL<<8)|NELEMS(ssepsimm_insn), CPU_SSE, NONE +cmpsb, onebyte_insn, (0x0000A6UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +cmpsd, cmpsd_insn, (0UL<<8)|NELEMS(cmpsd_insn), CPU_Any, NONE +cmpsl, onebyte_insn, (0x0020A7UL<<8)|NELEMS(onebyte_insn), CPU_386, NONE +cmpsq, onebyte_insn, (0x0040A7UL<<8)|NELEMS(onebyte_insn), CPU_64, NONE +cmpss, ssessimm_insn, (0xF3C2UL<<8)|NELEMS(ssessimm_insn), CPU_SSE, NONE +cmpsw, onebyte_insn, (0x0010A7UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +cmpunordpd, ssecmpss_insn, (0x0366UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE +cmpunordps, ssecmpps_insn, (0x03UL<<8)|NELEMS(ssecmpps_insn), CPU_SSE, NONE +cmpunordsd, ssecmpss_insn, (0x03F2UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE +cmpunordss, ssecmpss_insn, (0x03F3UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE, NONE +cmpxchg, cmpxchgxadd_insn, (0xB0UL<<8)|NELEMS(cmpxchgxadd_insn), CPU_486, NONE +cmpxchg16b, cmpxchg16b_insn, (0UL<<8)|NELEMS(cmpxchg16b_insn), CPU_64, NONE +cmpxchg8b, cmpxchg8b_insn, (0UL<<8)|NELEMS(cmpxchg8b_insn), CPU_586, NONE +cmpxchg8bq, cmpxchg8b_insn, (0UL<<8)|NELEMS(cmpxchg8b_insn), CPU_586, SUF_Q +cmpxchgb, cmpxchgxadd_insn, (0xB0UL<<8)|NELEMS(cmpxchgxadd_insn), CPU_486, SUF_B +cmpxchgl, cmpxchgxadd_insn, (0xB0UL<<8)|NELEMS(cmpxchgxadd_insn), CPU_486, SUF_L +cmpxchgq, cmpxchgxadd_insn, (0xB0UL<<8)|NELEMS(cmpxchgxadd_insn), CPU_486|CPU_64, SUF_Q +cmpxchgw, cmpxchgxadd_insn, (0xB0UL<<8)|NELEMS(cmpxchgxadd_insn), CPU_486, SUF_W +comisd, ssess_insn, (0x662FUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +comiss, sseps_insn, (0x2FUL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE +cpuid, twobyte_insn, (0x0FA2UL<<8)|NELEMS(twobyte_insn), CPU_486, NONE +cqo, onebyte_insn, (0x004099UL<<8)|NELEMS(onebyte_insn), CPU_64, NONE +cqto, onebyte_insn, (0x004099UL<<8)|NELEMS(onebyte_insn), CPU_64, NONE +crc32, crc32_insn, (0UL<<8)|NELEMS(crc32_insn), CPU_386|CPU_SSE42, NONE +crc32b, crc32_insn, (0UL<<8)|NELEMS(crc32_insn), CPU_386|CPU_SSE42, SUF_B +crc32l, crc32_insn, (0UL<<8)|NELEMS(crc32_insn), CPU_386|CPU_SSE42, SUF_L +crc32q, crc32_insn, (0UL<<8)|NELEMS(crc32_insn), CPU_64|CPU_SSE42, SUF_Q +crc32w, crc32_insn, (0UL<<8)|NELEMS(crc32_insn), CPU_386|CPU_SSE42, SUF_W +cvtdq2pd, cvt_xmm_xmm64_ss_insn, (0xF3E6UL<<8)|NELEMS(cvt_xmm_xmm64_ss_insn), CPU_SSE2, NONE +cvtdq2ps, sseps_insn, (0x5BUL<<8)|NELEMS(sseps_insn), CPU_SSE2, NONE +cvtpd2dq, ssess_insn, (0xF2E6UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +cvtpd2pi, cvt_mm_xmm_insn, (0x662DUL<<8)|NELEMS(cvt_mm_xmm_insn), CPU_SSE2, NONE +cvtpd2ps, ssess_insn, (0x665AUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +cvtpi2pd, cvt_xmm_mm_ss_insn, (0x662AUL<<8)|NELEMS(cvt_xmm_mm_ss_insn), CPU_SSE2, NONE +cvtpi2ps, cvt_xmm_mm_ps_insn, (0x2AUL<<8)|NELEMS(cvt_xmm_mm_ps_insn), CPU_SSE, NONE +cvtps2dq, ssess_insn, (0x665BUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +cvtps2pd, cvt_xmm_xmm64_ps_insn, (0x5AUL<<8)|NELEMS(cvt_xmm_xmm64_ps_insn), CPU_SSE2, NONE +cvtps2pi, cvt_mm_xmm64_insn, (0x2DUL<<8)|NELEMS(cvt_mm_xmm64_insn), CPU_SSE, NONE +cvtsd2si, cvt_rx_xmm64_insn, (0xF22DUL<<8)|NELEMS(cvt_rx_xmm64_insn), CPU_386|CPU_SSE2, NONE +cvtsd2sil, cvt_rx_xmm64_insn, (0xF22DUL<<8)|NELEMS(cvt_rx_xmm64_insn), CPU_386|CPU_SSE2, SUF_L +cvtsd2siq, cvt_rx_xmm64_insn, (0xF22DUL<<8)|NELEMS(cvt_rx_xmm64_insn), CPU_64|CPU_SSE2, SUF_Q +cvtsd2ss, cvt_xmm_xmm64_ss_insn, (0xF25AUL<<8)|NELEMS(cvt_xmm_xmm64_ss_insn), CPU_SSE2, NONE +cvtsi2sd, cvt_xmm_rmx_insn, (0xF22AUL<<8)|NELEMS(cvt_xmm_rmx_insn), CPU_SSE2, NONE +cvtsi2sdl, cvt_xmm_rmx_insn, (0xF22AUL<<8)|NELEMS(cvt_xmm_rmx_insn), CPU_SSE2, SUF_L +cvtsi2sdq, cvt_xmm_rmx_insn, (0xF22AUL<<8)|NELEMS(cvt_xmm_rmx_insn), CPU_SSE2, SUF_Q +cvtsi2ss, cvt_xmm_rmx_insn, (0xF32AUL<<8)|NELEMS(cvt_xmm_rmx_insn), CPU_386|CPU_SSE, NONE +cvtsi2ssl, cvt_xmm_rmx_insn, (0xF32AUL<<8)|NELEMS(cvt_xmm_rmx_insn), CPU_386|CPU_SSE, SUF_L +cvtsi2ssq, cvt_xmm_rmx_insn, (0xF32AUL<<8)|NELEMS(cvt_xmm_rmx_insn), CPU_64|CPU_SSE, SUF_Q +cvtss2sd, cvt_xmm_xmm32_insn, (0xF35AUL<<8)|NELEMS(cvt_xmm_xmm32_insn), CPU_SSE2, NONE +cvtss2si, cvt_rx_xmm32_insn, (0xF32DUL<<8)|NELEMS(cvt_rx_xmm32_insn), CPU_386|CPU_SSE, NONE +cvtss2sil, cvt_rx_xmm32_insn, (0xF32DUL<<8)|NELEMS(cvt_rx_xmm32_insn), CPU_386|CPU_SSE, SUF_L +cvtss2siq, cvt_rx_xmm32_insn, (0xF32DUL<<8)|NELEMS(cvt_rx_xmm32_insn), CPU_64|CPU_SSE, SUF_Q +cvttpd2dq, ssess_insn, (0x66E6UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +cvttpd2pi, cvt_mm_xmm_insn, (0x662CUL<<8)|NELEMS(cvt_mm_xmm_insn), CPU_SSE2, NONE +cvttps2dq, ssess_insn, (0xF35BUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +cvttps2pi, cvt_mm_xmm64_insn, (0x2CUL<<8)|NELEMS(cvt_mm_xmm64_insn), CPU_SSE, NONE +cvttsd2si, cvt_rx_xmm64_insn, (0xF22CUL<<8)|NELEMS(cvt_rx_xmm64_insn), CPU_SSE2, NONE +cvttsd2sil, cvt_rx_xmm64_insn, (0xF22CUL<<8)|NELEMS(cvt_rx_xmm64_insn), CPU_SSE2, SUF_L +cvttsd2siq, cvt_rx_xmm64_insn, (0xF22CUL<<8)|NELEMS(cvt_rx_xmm64_insn), CPU_SSE2, SUF_Q +cvttss2si, cvt_rx_xmm32_insn, (0xF32CUL<<8)|NELEMS(cvt_rx_xmm32_insn), CPU_386|CPU_SSE, NONE +cvttss2sil, cvt_rx_xmm32_insn, (0xF32CUL<<8)|NELEMS(cvt_rx_xmm32_insn), CPU_386|CPU_SSE, SUF_L +cvttss2siq, cvt_rx_xmm32_insn, (0xF32CUL<<8)|NELEMS(cvt_rx_xmm32_insn), CPU_64|CPU_SSE, SUF_Q +cwd, onebyte_insn, (0x001099UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +cwde, onebyte_insn, (0x002098UL<<8)|NELEMS(onebyte_insn), CPU_386, NONE +cwtd, onebyte_insn, (0x001099UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +cwtl, onebyte_insn, (0x002098UL<<8)|NELEMS(onebyte_insn), CPU_386, NONE +daa, onebyte_insn, (0x000027UL<<8)|NELEMS(onebyte_insn), CPU_Not64, NONE +das, onebyte_insn, (0x00002FUL<<8)|NELEMS(onebyte_insn), CPU_Not64, NONE +data16, NULL, X86_OPERSIZE, 0x10, NONE +data32, NULL, X86_OPERSIZE, 0x20, NONE +data64, NULL, X86_OPERSIZE, 0x40, NONE +dec, incdec_insn, (0x0148UL<<8)|NELEMS(incdec_insn), CPU_Any, NONE +decb, incdec_insn, (0x0148UL<<8)|NELEMS(incdec_insn), CPU_Any, SUF_B +decl, incdec_insn, (0x0148UL<<8)|NELEMS(incdec_insn), CPU_386, SUF_L +decq, incdec_insn, (0x0148UL<<8)|NELEMS(incdec_insn), CPU_64, SUF_Q +decw, incdec_insn, (0x0148UL<<8)|NELEMS(incdec_insn), CPU_Any, SUF_W +div, div_insn, (0x06UL<<8)|NELEMS(div_insn), CPU_Any, NONE +divb, div_insn, (0x06UL<<8)|NELEMS(div_insn), CPU_Any, SUF_B +divl, div_insn, (0x06UL<<8)|NELEMS(div_insn), CPU_386, SUF_L +divq, div_insn, (0x06UL<<8)|NELEMS(div_insn), CPU_64, SUF_Q +divw, div_insn, (0x06UL<<8)|NELEMS(div_insn), CPU_Any, SUF_W +divpd, ssess_insn, (0x665EUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +divps, sseps_insn, (0x5EUL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE +divsd, ssess_insn, (0xF25EUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +divss, ssess_insn, (0xF35EUL<<8)|NELEMS(ssess_insn), CPU_SSE, NONE +dppd, sse4imm_insn, (0x41UL<<8)|NELEMS(sse4imm_insn), CPU_SSE41, NONE +dpps, sse4imm_insn, (0x40UL<<8)|NELEMS(sse4imm_insn), CPU_SSE41, NONE +dword, NULL, X86_OPERSIZE, 0x20, NONE +emms, twobyte_insn, (0x0F77UL<<8)|NELEMS(twobyte_insn), CPU_MMX, NONE +enter, enter_insn, (0UL<<8)|NELEMS(enter_insn), CPU_186, NONE +enterl, enter_insn, (0UL<<8)|NELEMS(enter_insn), CPU_186|CPU_Not64, SUF_L +enterq, enter_insn, (0UL<<8)|NELEMS(enter_insn), CPU_186|CPU_64, SUF_Q +enterw, enter_insn, (0UL<<8)|NELEMS(enter_insn), CPU_186, SUF_W +extractps, extractps_insn, (0UL<<8)|NELEMS(extractps_insn), CPU_386|CPU_SSE41, NONE +extrq, extrq_insn, (0UL<<8)|NELEMS(extrq_insn), CPU_SSE41, NONE +f2xm1, twobyte_insn, (0xD9F0UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fabs, twobyte_insn, (0xD9E1UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fadd, farith_insn, (0x00C0C0UL<<8)|NELEMS(farith_insn), CPU_FPU, NONE +faddl, farith_insn, (0x00C0C0UL<<8)|NELEMS(farith_insn), CPU_FPU, SUF_L +fadds, farith_insn, (0x00C0C0UL<<8)|NELEMS(farith_insn), CPU_FPU, SUF_S +faddp, farithp_insn, (0xC0UL<<8)|NELEMS(farithp_insn), CPU_FPU, NONE +fbld, fbldstp_insn, (0x04UL<<8)|NELEMS(fbldstp_insn), CPU_FPU, NONE +fbstp, fbldstp_insn, (0x06UL<<8)|NELEMS(fbldstp_insn), CPU_FPU, NONE +fchs, twobyte_insn, (0xD9E0UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fclex, threebyte_insn, (0x9BDBE2UL<<8)|NELEMS(threebyte_insn), CPU_FPU, NONE +fcmovb, fcmovcc_insn, (0xDAC0UL<<8)|NELEMS(fcmovcc_insn), CPU_686|CPU_FPU, NONE +fcmovbe, fcmovcc_insn, (0xDAD0UL<<8)|NELEMS(fcmovcc_insn), CPU_686|CPU_FPU, NONE +fcmove, fcmovcc_insn, (0xDAC8UL<<8)|NELEMS(fcmovcc_insn), CPU_686|CPU_FPU, NONE +fcmovnb, fcmovcc_insn, (0xDBC0UL<<8)|NELEMS(fcmovcc_insn), CPU_686|CPU_FPU, NONE +fcmovnbe, fcmovcc_insn, (0xDBD0UL<<8)|NELEMS(fcmovcc_insn), CPU_686|CPU_FPU, NONE +fcmovne, fcmovcc_insn, (0xDBC8UL<<8)|NELEMS(fcmovcc_insn), CPU_686|CPU_FPU, NONE +fcmovnu, fcmovcc_insn, (0xDBD8UL<<8)|NELEMS(fcmovcc_insn), CPU_686|CPU_FPU, NONE +fcmovu, fcmovcc_insn, (0xDAD8UL<<8)|NELEMS(fcmovcc_insn), CPU_686|CPU_FPU, NONE +fcom, fcom_insn, (0x02D0UL<<8)|NELEMS(fcom_insn), CPU_FPU, NONE +fcoml, fcom_insn, (0x02D0UL<<8)|NELEMS(fcom_insn), CPU_FPU, SUF_L +fcoms, fcom_insn, (0x02D0UL<<8)|NELEMS(fcom_insn), CPU_FPU, SUF_S +fcomi, fcom2_insn, (0xDBF0UL<<8)|NELEMS(fcom2_insn), CPU_686|CPU_FPU, NONE +fcomip, fcom2_insn, (0xDFF0UL<<8)|NELEMS(fcom2_insn), CPU_686|CPU_FPU, NONE +fcomp, fcom_insn, (0x03D8UL<<8)|NELEMS(fcom_insn), CPU_FPU, NONE +fcompl, fcom_insn, (0x03D8UL<<8)|NELEMS(fcom_insn), CPU_FPU, SUF_L +fcomps, fcom_insn, (0x03D8UL<<8)|NELEMS(fcom_insn), CPU_FPU, SUF_S +fcompp, twobyte_insn, (0xDED9UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fcos, twobyte_insn, (0xD9FFUL<<8)|NELEMS(twobyte_insn), CPU_286|CPU_FPU, NONE +fdecstp, twobyte_insn, (0xD9F6UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fdiv, farith_insn, (0x06F0F8UL<<8)|NELEMS(farith_insn), CPU_FPU, NONE +fdivl, farith_insn, (0x06F0F8UL<<8)|NELEMS(farith_insn), CPU_FPU, SUF_L +fdivs, farith_insn, (0x06F0F8UL<<8)|NELEMS(farith_insn), CPU_FPU, SUF_S +fdivp, farithp_insn, (0xF0UL<<8)|NELEMS(farithp_insn), CPU_FPU, NONE +fdivr, farith_insn, (0x07F8F0UL<<8)|NELEMS(farith_insn), CPU_FPU, NONE +fdivrl, farith_insn, (0x07F8F0UL<<8)|NELEMS(farith_insn), CPU_FPU, SUF_L +fdivrs, farith_insn, (0x07F8F0UL<<8)|NELEMS(farith_insn), CPU_FPU, SUF_S +fdivrp, farithp_insn, (0xF8UL<<8)|NELEMS(farithp_insn), CPU_FPU, NONE +femms, twobyte_insn, (0x0F0EUL<<8)|NELEMS(twobyte_insn), CPU_3DNow, NONE +ffree, ffree_insn, (0xDDUL<<8)|NELEMS(ffree_insn), CPU_FPU, NONE +ffreep, ffree_insn, (0xDFUL<<8)|NELEMS(ffree_insn), CPU_686|CPU_FPU|CPU_Undoc, NONE +fiadd, fiarith_insn, (0x00DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, NONE +fiaddl, fiarith_insn, (0x00DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, SUF_L +fiadds, fiarith_insn, (0x00DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, SUF_S +ficom, fiarith_insn, (0x02DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, NONE +ficoml, fiarith_insn, (0x02DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, SUF_L +ficoms, fiarith_insn, (0x02DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, SUF_S +ficomp, fiarith_insn, (0x03DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, NONE +ficompl, fiarith_insn, (0x03DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, SUF_L +ficomps, fiarith_insn, (0x03DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, SUF_S +fidiv, fiarith_insn, (0x06DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, NONE +fidivl, fiarith_insn, (0x06DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, SUF_L +fidivs, fiarith_insn, (0x06DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, SUF_S +fidivr, fiarith_insn, (0x07DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, NONE +fidivrl, fiarith_insn, (0x07DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, SUF_L +fidivrs, fiarith_insn, (0x07DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, SUF_S +fild, fildstp_insn, (0x050200UL<<8)|NELEMS(fildstp_insn), CPU_FPU, NONE +fildl, fildstp_insn, (0x050200UL<<8)|NELEMS(fildstp_insn), CPU_FPU, SUF_L +fildq, fildstp_insn, (0x050200UL<<8)|NELEMS(fildstp_insn), CPU_FPU, SUF_Q +filds, fildstp_insn, (0x050200UL<<8)|NELEMS(fildstp_insn), CPU_FPU, SUF_S +fildll, fbldstp_insn, (0x05UL<<8)|NELEMS(fbldstp_insn), CPU_FPU, NONE +fimul, fiarith_insn, (0x01DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, NONE +fimull, fiarith_insn, (0x01DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, SUF_L +fimuls, fiarith_insn, (0x01DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, SUF_S +fincstp, twobyte_insn, (0xD9F7UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +finit, threebyte_insn, (0x9BDBE3UL<<8)|NELEMS(threebyte_insn), CPU_FPU, NONE +fist, fiarith_insn, (0x02DBUL<<8)|NELEMS(fiarith_insn), CPU_FPU, NONE +fistl, fiarith_insn, (0x02DBUL<<8)|NELEMS(fiarith_insn), CPU_FPU, SUF_L +fists, fiarith_insn, (0x02DBUL<<8)|NELEMS(fiarith_insn), CPU_FPU, SUF_S +fistp, fildstp_insn, (0x070203UL<<8)|NELEMS(fildstp_insn), CPU_FPU, NONE +fistpl, fildstp_insn, (0x070203UL<<8)|NELEMS(fildstp_insn), CPU_FPU, SUF_L +fistpq, fildstp_insn, (0x070203UL<<8)|NELEMS(fildstp_insn), CPU_FPU, SUF_Q +fistps, fildstp_insn, (0x070203UL<<8)|NELEMS(fildstp_insn), CPU_FPU, SUF_S +fistpll, fbldstp_insn, (0x07UL<<8)|NELEMS(fbldstp_insn), CPU_FPU, NONE +fisttp, fildstp_insn, (0x010001UL<<8)|NELEMS(fildstp_insn), CPU_SSE3, NONE +fisttpl, fildstp_insn, (0x010001UL<<8)|NELEMS(fildstp_insn), CPU_SSE3, SUF_L +fisttpq, fildstp_insn, (0x010001UL<<8)|NELEMS(fildstp_insn), CPU_SSE3, SUF_Q +fisttps, fildstp_insn, (0x010001UL<<8)|NELEMS(fildstp_insn), CPU_SSE3, SUF_S +fisttpll, fildstp_insn, (0x000007UL<<8)|NELEMS(fildstp_insn), CPU_SSE3, SUF_Q +fisub, fiarith_insn, (0x04DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, NONE +fisubl, fiarith_insn, (0x04DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, SUF_L +fisubs, fiarith_insn, (0x04DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, SUF_S +fisubr, fiarith_insn, (0x05DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, NONE +fisubrl, fiarith_insn, (0x05DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, SUF_L +fisubrs, fiarith_insn, (0x05DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, SUF_S +fld, fld_insn, (0UL<<8)|NELEMS(fld_insn), CPU_FPU, NONE +fld1, twobyte_insn, (0xD9E8UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fldl, fld_insn, (0UL<<8)|NELEMS(fld_insn), CPU_FPU, SUF_L +flds, fld_insn, (0UL<<8)|NELEMS(fld_insn), CPU_FPU, SUF_S +fldcw, fldnstcw_insn, (0x05UL<<8)|NELEMS(fldnstcw_insn), CPU_FPU, NONE +fldcww, fldnstcw_insn, (0x05UL<<8)|NELEMS(fldnstcw_insn), CPU_FPU, SUF_W +fldenv, onebytemem_insn, (0x04D9UL<<8)|NELEMS(onebytemem_insn), CPU_FPU, NONE +fldenvl, onebytemem_insn, (0x04D9UL<<8)|NELEMS(onebytemem_insn), CPU_FPU, SUF_L +fldenvs, onebytemem_insn, (0x04D9UL<<8)|NELEMS(onebytemem_insn), CPU_FPU, SUF_S +fldl2e, twobyte_insn, (0xD9EAUL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fldl2t, twobyte_insn, (0xD9E9UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fldlg2, twobyte_insn, (0xD9ECUL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fldln2, twobyte_insn, (0xD9EDUL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fldpi, twobyte_insn, (0xD9EBUL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fldt, fldstpt_insn, (0x05UL<<8)|NELEMS(fldstpt_insn), CPU_FPU, WEAK +fldz, twobyte_insn, (0xD9EEUL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fmul, farith_insn, (0x01C8C8UL<<8)|NELEMS(farith_insn), CPU_FPU, NONE +fmull, farith_insn, (0x01C8C8UL<<8)|NELEMS(farith_insn), CPU_FPU, SUF_L +fmuls, farith_insn, (0x01C8C8UL<<8)|NELEMS(farith_insn), CPU_FPU, SUF_S +fmulp, farithp_insn, (0xC8UL<<8)|NELEMS(farithp_insn), CPU_FPU, NONE +fnclex, twobyte_insn, (0xDBE2UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fninit, twobyte_insn, (0xDBE3UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fnop, twobyte_insn, (0xD9D0UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fnsave, onebytemem_insn, (0x06DDUL<<8)|NELEMS(onebytemem_insn), CPU_FPU, NONE +fnsavel, onebytemem_insn, (0x06DDUL<<8)|NELEMS(onebytemem_insn), CPU_FPU, SUF_L +fnsaves, onebytemem_insn, (0x06DDUL<<8)|NELEMS(onebytemem_insn), CPU_FPU, SUF_S +fnstcw, fldnstcw_insn, (0x07UL<<8)|NELEMS(fldnstcw_insn), CPU_FPU, NONE +fnstcww, fldnstcw_insn, (0x07UL<<8)|NELEMS(fldnstcw_insn), CPU_FPU, SUF_W +fnstenv, onebytemem_insn, (0x06D9UL<<8)|NELEMS(onebytemem_insn), CPU_FPU, NONE +fnstenvl, onebytemem_insn, (0x06D9UL<<8)|NELEMS(onebytemem_insn), CPU_FPU, SUF_L +fnstenvs, onebytemem_insn, (0x06D9UL<<8)|NELEMS(onebytemem_insn), CPU_FPU, SUF_S +fnstsw, fnstsw_insn, (0UL<<8)|NELEMS(fnstsw_insn), CPU_FPU, NONE +fnstsww, fnstsw_insn, (0UL<<8)|NELEMS(fnstsw_insn), CPU_FPU, SUF_W +fpatan, twobyte_insn, (0xD9F3UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fprem, twobyte_insn, (0xD9F8UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fprem1, twobyte_insn, (0xD9F5UL<<8)|NELEMS(twobyte_insn), CPU_286|CPU_FPU, NONE +fptan, twobyte_insn, (0xD9F2UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +frndint, twobyte_insn, (0xD9FCUL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +frstor, onebytemem_insn, (0x04DDUL<<8)|NELEMS(onebytemem_insn), CPU_FPU, NONE +frstorl, onebytemem_insn, (0x04DDUL<<8)|NELEMS(onebytemem_insn), CPU_FPU, SUF_L +frstors, onebytemem_insn, (0x04DDUL<<8)|NELEMS(onebytemem_insn), CPU_FPU, SUF_S +fsave, twobytemem_insn, (0x069BDDUL<<8)|NELEMS(twobytemem_insn), CPU_FPU, NONE +fsavel, twobytemem_insn, (0x069BDDUL<<8)|NELEMS(twobytemem_insn), CPU_FPU, SUF_L +fsaves, twobytemem_insn, (0x069BDDUL<<8)|NELEMS(twobytemem_insn), CPU_FPU, SUF_S +fscale, twobyte_insn, (0xD9FDUL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fsetpm, twobyte_insn, (0xDBE4UL<<8)|NELEMS(twobyte_insn), CPU_286|CPU_FPU|CPU_Obs, NONE +fsin, twobyte_insn, (0xD9FEUL<<8)|NELEMS(twobyte_insn), CPU_286|CPU_FPU, NONE +fsincos, twobyte_insn, (0xD9FBUL<<8)|NELEMS(twobyte_insn), CPU_286|CPU_FPU, NONE +fsqrt, twobyte_insn, (0xD9FAUL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fst, fst_insn, (0UL<<8)|NELEMS(fst_insn), CPU_FPU, NONE +fstl, fst_insn, (0UL<<8)|NELEMS(fst_insn), CPU_FPU, SUF_L +fsts, fst_insn, (0UL<<8)|NELEMS(fst_insn), CPU_FPU, SUF_S +fstcw, fstcw_insn, (0UL<<8)|NELEMS(fstcw_insn), CPU_FPU, NONE +fstcww, fstcw_insn, (0UL<<8)|NELEMS(fstcw_insn), CPU_FPU, SUF_W +fstenv, twobytemem_insn, (0x069BD9UL<<8)|NELEMS(twobytemem_insn), CPU_FPU, NONE +fstenvl, twobytemem_insn, (0x069BD9UL<<8)|NELEMS(twobytemem_insn), CPU_FPU, SUF_L +fstenvs, twobytemem_insn, (0x069BD9UL<<8)|NELEMS(twobytemem_insn), CPU_FPU, SUF_S +fstp, fstp_insn, (0UL<<8)|NELEMS(fstp_insn), CPU_FPU, NONE +fstpl, fstp_insn, (0UL<<8)|NELEMS(fstp_insn), CPU_FPU, SUF_L +fstps, fstp_insn, (0UL<<8)|NELEMS(fstp_insn), CPU_FPU, SUF_S +fstpt, fldstpt_insn, (0x07UL<<8)|NELEMS(fldstpt_insn), CPU_FPU, WEAK +fstsw, fstsw_insn, (0UL<<8)|NELEMS(fstsw_insn), CPU_FPU, NONE +fstsww, fstsw_insn, (0UL<<8)|NELEMS(fstsw_insn), CPU_FPU, SUF_W +fsub, farith_insn, (0x04E0E8UL<<8)|NELEMS(farith_insn), CPU_FPU, NONE +fsubl, farith_insn, (0x04E0E8UL<<8)|NELEMS(farith_insn), CPU_FPU, SUF_L +fsubs, farith_insn, (0x04E0E8UL<<8)|NELEMS(farith_insn), CPU_FPU, SUF_S +fsubp, farithp_insn, (0xE0UL<<8)|NELEMS(farithp_insn), CPU_FPU, NONE +fsubr, farith_insn, (0x05E8E0UL<<8)|NELEMS(farith_insn), CPU_FPU, NONE +fsubrl, farith_insn, (0x05E8E0UL<<8)|NELEMS(farith_insn), CPU_FPU, SUF_L +fsubrs, farith_insn, (0x05E8E0UL<<8)|NELEMS(farith_insn), CPU_FPU, SUF_S +fsubrp, farithp_insn, (0xE8UL<<8)|NELEMS(farithp_insn), CPU_FPU, NONE +ftst, twobyte_insn, (0xD9E4UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fucom, fcom2_insn, (0xDDE0UL<<8)|NELEMS(fcom2_insn), CPU_286|CPU_FPU, NONE +fucomi, fcom2_insn, (0xDBE8UL<<8)|NELEMS(fcom2_insn), CPU_686|CPU_FPU, NONE +fucomip, fcom2_insn, (0xDFE8UL<<8)|NELEMS(fcom2_insn), CPU_686|CPU_FPU, NONE +fucomp, fcom2_insn, (0xDDE8UL<<8)|NELEMS(fcom2_insn), CPU_286|CPU_FPU, NONE +fucompp, twobyte_insn, (0xDAE9UL<<8)|NELEMS(twobyte_insn), CPU_286|CPU_FPU, NONE +fwait, onebyte_insn, (0x00009BUL<<8)|NELEMS(onebyte_insn), CPU_FPU, NONE +fxam, twobyte_insn, (0xD9E5UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fxch, fxch_insn, (0UL<<8)|NELEMS(fxch_insn), CPU_FPU, NONE +fxrstor, twobytemem_insn, (0x010FAEUL<<8)|NELEMS(twobytemem_insn), CPU_686|CPU_FPU, NONE +fxrstorq, twobytemem_insn, (0x010FAEUL<<8)|NELEMS(twobytemem_insn), CPU_686|CPU_FPU, SUF_Q +fxsave, twobytemem_insn, (0x000FAEUL<<8)|NELEMS(twobytemem_insn), CPU_686|CPU_FPU, NONE +fxsaveq, twobytemem_insn, (0x000FAEUL<<8)|NELEMS(twobytemem_insn), CPU_686|CPU_FPU, SUF_Q +fxtract, twobyte_insn, (0xD9F4UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fyl2x, twobyte_insn, (0xD9F1UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fyl2xp1, twobyte_insn, (0xD9F9UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +haddpd, ssess_insn, (0x667CUL<<8)|NELEMS(ssess_insn), CPU_SSE3, NONE +haddps, ssess_insn, (0xF27CUL<<8)|NELEMS(ssess_insn), CPU_SSE3, NONE +hlt, onebyte_insn, (0x0000F4UL<<8)|NELEMS(onebyte_insn), CPU_Priv, NONE +hnt, NULL, X86_SEGREG, 0x2E, NONE +hsubpd, ssess_insn, (0x667DUL<<8)|NELEMS(ssess_insn), CPU_SSE3, NONE +hsubps, ssess_insn, (0xF27DUL<<8)|NELEMS(ssess_insn), CPU_SSE3, NONE +ht, NULL, X86_SEGREG, 0x3E, NONE +ibts, ibts_insn, (0UL<<8)|NELEMS(ibts_insn), CPU_386|CPU_Obs|CPU_Undoc, NONE +idiv, div_insn, (0x07UL<<8)|NELEMS(div_insn), CPU_Any, NONE +idivb, div_insn, (0x07UL<<8)|NELEMS(div_insn), CPU_Any, SUF_B +idivl, div_insn, (0x07UL<<8)|NELEMS(div_insn), CPU_386, SUF_L +idivq, div_insn, (0x07UL<<8)|NELEMS(div_insn), CPU_64, SUF_Q +idivw, div_insn, (0x07UL<<8)|NELEMS(div_insn), CPU_Any, SUF_W +imul, imul_insn, (0UL<<8)|NELEMS(imul_insn), CPU_Any, NONE +imulb, imul_insn, (0UL<<8)|NELEMS(imul_insn), CPU_Any, SUF_B +imull, imul_insn, (0UL<<8)|NELEMS(imul_insn), CPU_386, SUF_L +imulq, imul_insn, (0UL<<8)|NELEMS(imul_insn), CPU_64, SUF_Q +imulw, imul_insn, (0UL<<8)|NELEMS(imul_insn), CPU_Any, SUF_W +in, in_insn, (0UL<<8)|NELEMS(in_insn), CPU_Any, NONE +inb, in_insn, (0UL<<8)|NELEMS(in_insn), CPU_Any, SUF_B +inl, in_insn, (0UL<<8)|NELEMS(in_insn), CPU_386, SUF_L +inw, in_insn, (0UL<<8)|NELEMS(in_insn), CPU_Any, SUF_W +inc, incdec_insn, (0x0040UL<<8)|NELEMS(incdec_insn), CPU_Any, NONE +incb, incdec_insn, (0x0040UL<<8)|NELEMS(incdec_insn), CPU_Any, SUF_B +incl, incdec_insn, (0x0040UL<<8)|NELEMS(incdec_insn), CPU_386, SUF_L +incq, incdec_insn, (0x0040UL<<8)|NELEMS(incdec_insn), CPU_64, SUF_Q +incw, incdec_insn, (0x0040UL<<8)|NELEMS(incdec_insn), CPU_Any, SUF_W +insb, onebyte_insn, (0x00006CUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +insertps, insertps_insn, (0UL<<8)|NELEMS(insertps_insn), CPU_SSE41, NONE +insertq, insertq_insn, (0UL<<8)|NELEMS(insertq_insn), CPU_SSE41, NONE +insl, onebyte_insn, (0x00206DUL<<8)|NELEMS(onebyte_insn), CPU_386, NONE +insw, onebyte_insn, (0x00106DUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +int, int_insn, (0UL<<8)|NELEMS(int_insn), CPU_Any, NONE +int3, onebyte_insn, (0x0000CCUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +into, onebyte_insn, (0x0000CEUL<<8)|NELEMS(onebyte_insn), CPU_Not64, NONE +invd, twobyte_insn, (0x0F08UL<<8)|NELEMS(twobyte_insn), CPU_486|CPU_Priv, NONE +invlpg, twobytemem_insn, (0x070F01UL<<8)|NELEMS(twobytemem_insn), CPU_486|CPU_Priv, NONE +invlpga, invlpga_insn, (0UL<<8)|NELEMS(invlpga_insn), CPU_SVM, NONE +iret, onebyte_insn, (0x0000CFUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +iretl, onebyte_insn, (0x0020CFUL<<8)|NELEMS(onebyte_insn), CPU_386, NONE +iretq, onebyte_insn, (0x0040CFUL<<8)|NELEMS(onebyte_insn), CPU_64, NONE +iretw, onebyte_insn, (0x0010CFUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +ja, jcc_insn, (0x07UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jae, jcc_insn, (0x03UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jb, jcc_insn, (0x02UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jbe, jcc_insn, (0x06UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jc, jcc_insn, (0x02UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jcxz, jcxz_insn, (0x10UL<<8)|NELEMS(jcxz_insn), CPU_Any, NONE +je, jcc_insn, (0x04UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jecxz, jcxz_insn, (0x20UL<<8)|NELEMS(jcxz_insn), CPU_386, NONE +jg, jcc_insn, (0x0FUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jge, jcc_insn, (0x0DUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jl, jcc_insn, (0x0CUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jle, jcc_insn, (0x0EUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jmp, jmp_insn, (0UL<<8)|NELEMS(jmp_insn), CPU_Any, NONE +jna, jcc_insn, (0x06UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jnae, jcc_insn, (0x02UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jnb, jcc_insn, (0x03UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jnbe, jcc_insn, (0x07UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jnc, jcc_insn, (0x03UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jne, jcc_insn, (0x05UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jng, jcc_insn, (0x0EUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jnge, jcc_insn, (0x0CUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jnl, jcc_insn, (0x0DUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jnle, jcc_insn, (0x0FUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jno, jcc_insn, (0x01UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jnp, jcc_insn, (0x0BUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jns, jcc_insn, (0x09UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jnz, jcc_insn, (0x05UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jo, jcc_insn, (0x00UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jp, jcc_insn, (0x0AUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jpe, jcc_insn, (0x0AUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jpo, jcc_insn, (0x0BUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jrcxz, jcxz_insn, (0x40UL<<8)|NELEMS(jcxz_insn), CPU_64, NONE +js, jcc_insn, (0x08UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jz, jcc_insn, (0x04UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +lahf, onebyte_insn, (0x00009FUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +lar, bsfr_insn, (0x02UL<<8)|NELEMS(bsfr_insn), CPU_286|CPU_Prot, NONE +larl, bsfr_insn, (0x02UL<<8)|NELEMS(bsfr_insn), CPU_286|CPU_Prot, SUF_L +larq, bsfr_insn, (0x02UL<<8)|NELEMS(bsfr_insn), CPU_286|CPU_Prot, SUF_Q +larw, bsfr_insn, (0x02UL<<8)|NELEMS(bsfr_insn), CPU_286|CPU_Prot, SUF_W +lddqu, lddqu_insn, (0UL<<8)|NELEMS(lddqu_insn), CPU_SSE3, NONE +ldmxcsr, ldstmxcsr_insn, (0x02UL<<8)|NELEMS(ldstmxcsr_insn), CPU_SSE, NONE +lds, ldes_insn, (0xC5UL<<8)|NELEMS(ldes_insn), CPU_Not64, NONE +ldsl, ldes_insn, (0xC5UL<<8)|NELEMS(ldes_insn), CPU_386|CPU_Not64, SUF_L +ldsw, ldes_insn, (0xC5UL<<8)|NELEMS(ldes_insn), CPU_Not64, SUF_W +lea, lea_insn, (0UL<<8)|NELEMS(lea_insn), CPU_Any, NONE +leal, lea_insn, (0UL<<8)|NELEMS(lea_insn), CPU_386, SUF_L +leaq, lea_insn, (0UL<<8)|NELEMS(lea_insn), CPU_64, SUF_Q +leaw, lea_insn, (0UL<<8)|NELEMS(lea_insn), CPU_Any, SUF_W +leave, onebyte_insn, (0x4000C9UL<<8)|NELEMS(onebyte_insn), CPU_186, NONE +leavel, onebyte_insn, (0x4000C9UL<<8)|NELEMS(onebyte_insn), CPU_186, NONE +leaveq, onebyte_insn, (0x4000C9UL<<8)|NELEMS(onebyte_insn), CPU_64, NONE +leavew, onebyte_insn, (0x0010C9UL<<8)|NELEMS(onebyte_insn), CPU_186, NONE +les, ldes_insn, (0xC4UL<<8)|NELEMS(ldes_insn), CPU_Not64, NONE +lesl, ldes_insn, (0xC4UL<<8)|NELEMS(ldes_insn), CPU_386|CPU_Not64, SUF_L +lesw, ldes_insn, (0xC4UL<<8)|NELEMS(ldes_insn), CPU_Not64, SUF_W +lfence, threebyte_insn, (0x0FAEE8UL<<8)|NELEMS(threebyte_insn), CPU_P3, NONE +lfs, lfgss_insn, (0xB4UL<<8)|NELEMS(lfgss_insn), CPU_386, NONE +lfsl, lfgss_insn, (0xB4UL<<8)|NELEMS(lfgss_insn), CPU_386, SUF_L +lfsw, lfgss_insn, (0xB4UL<<8)|NELEMS(lfgss_insn), CPU_386, SUF_W +lgdt, twobytemem_insn, (0x020F01UL<<8)|NELEMS(twobytemem_insn), CPU_286|CPU_Priv, NONE +lgdtl, twobytemem_insn, (0x020F01UL<<8)|NELEMS(twobytemem_insn), CPU_286|CPU_Priv, SUF_L +lgdtq, twobytemem_insn, (0x020F01UL<<8)|NELEMS(twobytemem_insn), CPU_286|CPU_Priv, SUF_Q +lgdtw, twobytemem_insn, (0x020F01UL<<8)|NELEMS(twobytemem_insn), CPU_286|CPU_Priv, SUF_W +lgs, lfgss_insn, (0xB5UL<<8)|NELEMS(lfgss_insn), CPU_386, NONE +lgsl, lfgss_insn, (0xB5UL<<8)|NELEMS(lfgss_insn), CPU_386, SUF_L +lgsw, lfgss_insn, (0xB5UL<<8)|NELEMS(lfgss_insn), CPU_386, SUF_W +lidt, twobytemem_insn, (0x030F01UL<<8)|NELEMS(twobytemem_insn), CPU_286|CPU_Priv, NONE +lidtl, twobytemem_insn, (0x030F01UL<<8)|NELEMS(twobytemem_insn), CPU_286|CPU_Priv, SUF_L +lidtq, twobytemem_insn, (0x030F01UL<<8)|NELEMS(twobytemem_insn), CPU_286|CPU_Priv, SUF_Q +lidtw, twobytemem_insn, (0x030F01UL<<8)|NELEMS(twobytemem_insn), CPU_286|CPU_Priv, SUF_W +lldt, prot286_insn, (0x0200UL<<8)|NELEMS(prot286_insn), CPU_286|CPU_Priv|CPU_Prot, NONE +lldtw, prot286_insn, (0x0200UL<<8)|NELEMS(prot286_insn), CPU_286|CPU_Priv|CPU_Prot, SUF_W +lmsw, prot286_insn, (0x0601UL<<8)|NELEMS(prot286_insn), CPU_286|CPU_Priv, NONE +lmsww, prot286_insn, (0x0601UL<<8)|NELEMS(prot286_insn), CPU_286|CPU_Priv, SUF_W +loadall, twobyte_insn, (0x0F07UL<<8)|NELEMS(twobyte_insn), CPU_386|CPU_Undoc, NONE +loadall286, twobyte_insn, (0x0F05UL<<8)|NELEMS(twobyte_insn), CPU_286|CPU_Undoc, NONE +lock, NULL, X86_LOCKREP, 0xF0, NONE +lodsb, onebyte_insn, (0x0000ACUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +lodsl, onebyte_insn, (0x0020ADUL<<8)|NELEMS(onebyte_insn), CPU_386, NONE +lodsq, onebyte_insn, (0x0040ADUL<<8)|NELEMS(onebyte_insn), CPU_64, NONE +lodsw, onebyte_insn, (0x0010ADUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +loop, loop_insn, (0x02UL<<8)|NELEMS(loop_insn), CPU_Any, NONE +loope, loop_insn, (0x01UL<<8)|NELEMS(loop_insn), CPU_Any, NONE +loopne, loop_insn, (0x00UL<<8)|NELEMS(loop_insn), CPU_Any, NONE +loopnz, loop_insn, (0x00UL<<8)|NELEMS(loop_insn), CPU_Any, NONE +loopz, loop_insn, (0x01UL<<8)|NELEMS(loop_insn), CPU_Any, NONE +lretl, retnf_insn, (0x00CAUL<<8)|NELEMS(retnf_insn), CPU_Any, NONE +lretq, retnf_insn, (0x40CAUL<<8)|NELEMS(retnf_insn), CPU_64, NONE +lretw, retnf_insn, (0x10CAUL<<8)|NELEMS(retnf_insn), CPU_Any, NONE +lsl, bsfr_insn, (0x03UL<<8)|NELEMS(bsfr_insn), CPU_286|CPU_Prot, NONE +lsll, bsfr_insn, (0x03UL<<8)|NELEMS(bsfr_insn), CPU_286|CPU_Prot, SUF_L +lslq, bsfr_insn, (0x03UL<<8)|NELEMS(bsfr_insn), CPU_286|CPU_Prot, SUF_Q +lslw, bsfr_insn, (0x03UL<<8)|NELEMS(bsfr_insn), CPU_286|CPU_Prot, SUF_W +lss, lfgss_insn, (0xB2UL<<8)|NELEMS(lfgss_insn), CPU_386, NONE +lssl, lfgss_insn, (0xB2UL<<8)|NELEMS(lfgss_insn), CPU_386, SUF_L +lssw, lfgss_insn, (0xB2UL<<8)|NELEMS(lfgss_insn), CPU_386, SUF_W +ltr, prot286_insn, (0x0300UL<<8)|NELEMS(prot286_insn), CPU_286|CPU_Priv|CPU_Prot, NONE +ltrw, prot286_insn, (0x0300UL<<8)|NELEMS(prot286_insn), CPU_286|CPU_Priv|CPU_Prot, SUF_W +lzcnt, cnt_insn, (0xBDUL<<8)|NELEMS(cnt_insn), CPU_686|CPU_AMD, NONE +lzcntl, cnt_insn, (0xBDUL<<8)|NELEMS(cnt_insn), CPU_686|CPU_AMD, SUF_L +lzcntq, cnt_insn, (0xBDUL<<8)|NELEMS(cnt_insn), CPU_686|CPU_AMD, SUF_Q +lzcntw, cnt_insn, (0xBDUL<<8)|NELEMS(cnt_insn), CPU_686|CPU_AMD, SUF_W +maskmovdqu, maskmovdqu_insn, (0UL<<8)|NELEMS(maskmovdqu_insn), CPU_SSE2, NONE +maskmovq, maskmovq_insn, (0UL<<8)|NELEMS(maskmovq_insn), CPU_MMX|CPU_P3, NONE +maxpd, ssess_insn, (0x665FUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +maxps, sseps_insn, (0x5FUL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE +maxsd, ssess_insn, (0xF25FUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +maxss, ssess_insn, (0xF35FUL<<8)|NELEMS(ssess_insn), CPU_SSE, NONE +mfence, threebyte_insn, (0x0FAEF0UL<<8)|NELEMS(threebyte_insn), CPU_P3, NONE +minpd, ssess_insn, (0x665DUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +minps, sseps_insn, (0x5DUL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE +minsd, ssess_insn, (0xF25DUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +minss, ssess_insn, (0xF35DUL<<8)|NELEMS(ssess_insn), CPU_SSE, NONE +monitor, threebyte_insn, (0x0F01C8UL<<8)|NELEMS(threebyte_insn), CPU_SSE3, NONE +montmul, padlock_insn, (0xC0F3A6UL<<8)|NELEMS(padlock_insn), CPU_PadLock, NONE +mov, mov_insn, (0UL<<8)|NELEMS(mov_insn), CPU_Any, NONE +movb, mov_insn, (0UL<<8)|NELEMS(mov_insn), CPU_Any, SUF_B +movl, mov_insn, (0UL<<8)|NELEMS(mov_insn), CPU_386, SUF_L +movq, mov_insn, (0UL<<8)|NELEMS(mov_insn), CPU_Any, SUF_Q +movw, mov_insn, (0UL<<8)|NELEMS(mov_insn), CPU_Any, SUF_W +movabs, movabs_insn, (0UL<<8)|NELEMS(movabs_insn), CPU_64, NONE +movabsb, movabs_insn, (0UL<<8)|NELEMS(movabs_insn), CPU_64, SUF_B +movabsl, movabs_insn, (0UL<<8)|NELEMS(movabs_insn), CPU_64, SUF_L +movabsq, movabs_insn, (0UL<<8)|NELEMS(movabs_insn), CPU_64, SUF_Q +movabsw, movabs_insn, (0UL<<8)|NELEMS(movabs_insn), CPU_64, SUF_W +movapd, movaupd_insn, (0x28UL<<8)|NELEMS(movaupd_insn), CPU_SSE2, NONE +movaps, movaups_insn, (0x28UL<<8)|NELEMS(movaups_insn), CPU_SSE, NONE +movd, movd_insn, (0UL<<8)|NELEMS(movd_insn), CPU_386|CPU_MMX, NONE +movddup, cvt_xmm_xmm64_ss_insn, (0xF212UL<<8)|NELEMS(cvt_xmm_xmm64_ss_insn), CPU_SSE3, NONE +movdq2q, movdq2q_insn, (0UL<<8)|NELEMS(movdq2q_insn), CPU_SSE2, NONE +movdqa, movdqau_insn, (0x66UL<<8)|NELEMS(movdqau_insn), CPU_SSE2, NONE +movdqu, movdqau_insn, (0xF3UL<<8)|NELEMS(movdqau_insn), CPU_SSE2, NONE +movhlps, movhllhps_insn, (0x12UL<<8)|NELEMS(movhllhps_insn), CPU_SSE, NONE +movhpd, movhlpd_insn, (0x16UL<<8)|NELEMS(movhlpd_insn), CPU_SSE2, NONE +movhps, movhlps_insn, (0x16UL<<8)|NELEMS(movhlps_insn), CPU_SSE, NONE +movlhps, movhllhps_insn, (0x16UL<<8)|NELEMS(movhllhps_insn), CPU_SSE, NONE +movlpd, movhlpd_insn, (0x12UL<<8)|NELEMS(movhlpd_insn), CPU_SSE2, NONE +movlps, movhlps_insn, (0x12UL<<8)|NELEMS(movhlps_insn), CPU_SSE, NONE +movmskpd, movmskpd_insn, (0UL<<8)|NELEMS(movmskpd_insn), CPU_386|CPU_SSE2, NONE +movmskpdl, movmskpd_insn, (0UL<<8)|NELEMS(movmskpd_insn), CPU_386|CPU_SSE2, SUF_L +movmskpdq, movmskpd_insn, (0UL<<8)|NELEMS(movmskpd_insn), CPU_64|CPU_SSE2, SUF_Q +movmskps, movmskps_insn, (0UL<<8)|NELEMS(movmskps_insn), CPU_386|CPU_SSE, NONE +movmskpsl, movmskps_insn, (0UL<<8)|NELEMS(movmskps_insn), CPU_386|CPU_SSE, SUF_L +movmskpsq, movmskps_insn, (0UL<<8)|NELEMS(movmskps_insn), CPU_64|CPU_SSE, SUF_Q +movntdq, movntpddq_insn, (0xE7UL<<8)|NELEMS(movntpddq_insn), CPU_SSE2, NONE +movntdqa, movntdqa_insn, (0UL<<8)|NELEMS(movntdqa_insn), CPU_SSE41, NONE +movnti, movnti_insn, (0UL<<8)|NELEMS(movnti_insn), CPU_P4, NONE +movntil, movnti_insn, (0UL<<8)|NELEMS(movnti_insn), CPU_P4, SUF_L +movntiq, movnti_insn, (0UL<<8)|NELEMS(movnti_insn), CPU_64|CPU_P4, SUF_Q +movntpd, movntpddq_insn, (0x2BUL<<8)|NELEMS(movntpddq_insn), CPU_SSE2, NONE +movntps, movntps_insn, (0UL<<8)|NELEMS(movntps_insn), CPU_SSE, NONE +movntq, movntq_insn, (0UL<<8)|NELEMS(movntq_insn), CPU_SSE, NONE +movntsd, movntsd_insn, (0UL<<8)|NELEMS(movntsd_insn), CPU_SSE41, NONE +movntss, movntss_insn, (0UL<<8)|NELEMS(movntss_insn), CPU_SSE41, NONE +movq2dq, movq2dq_insn, (0UL<<8)|NELEMS(movq2dq_insn), CPU_SSE2, NONE +movsb, onebyte_insn, (0x0000A4UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +movsbl, movszx_insn, (0xBEUL<<8)|NELEMS(movszx_insn), CPU_386, SUF_B +movsbq, movszx_insn, (0xBEUL<<8)|NELEMS(movszx_insn), CPU_64, SUF_B +movsbw, movszx_insn, (0xBEUL<<8)|NELEMS(movszx_insn), CPU_386, SUF_B +movsd, movsd_insn, (0UL<<8)|NELEMS(movsd_insn), CPU_386, NONE +movshdup, ssess_insn, (0xF316UL<<8)|NELEMS(ssess_insn), CPU_SSE3, NONE +movsl, onebyte_insn, (0x0020A5UL<<8)|NELEMS(onebyte_insn), CPU_386, NONE +movsldup, ssess_insn, (0xF312UL<<8)|NELEMS(ssess_insn), CPU_SSE3, NONE +movslq, movsxd_insn, (0UL<<8)|NELEMS(movsxd_insn), CPU_64, SUF_L +movsq, onebyte_insn, (0x0040A5UL<<8)|NELEMS(onebyte_insn), CPU_64, NONE +movss, movss_insn, (0UL<<8)|NELEMS(movss_insn), CPU_SSE, NONE +movsw, onebyte_insn, (0x0010A5UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +movswl, movszx_insn, (0xBEUL<<8)|NELEMS(movszx_insn), CPU_386, SUF_W +movswq, movszx_insn, (0xBEUL<<8)|NELEMS(movszx_insn), CPU_64, SUF_W +movsx, movszx_insn, (0xBEUL<<8)|NELEMS(movszx_insn), CPU_386, NONE +movsxb, movszx_insn, (0xBEUL<<8)|NELEMS(movszx_insn), CPU_386, SUF_B +movsxw, movszx_insn, (0xBEUL<<8)|NELEMS(movszx_insn), CPU_386, SUF_W +movupd, movaupd_insn, (0x10UL<<8)|NELEMS(movaupd_insn), CPU_SSE2, NONE +movups, movaups_insn, (0x10UL<<8)|NELEMS(movaups_insn), CPU_SSE, NONE +movzbl, movszx_insn, (0xB6UL<<8)|NELEMS(movszx_insn), CPU_386, SUF_B +movzbq, movszx_insn, (0xB6UL<<8)|NELEMS(movszx_insn), CPU_64, SUF_B +movzbw, movszx_insn, (0xB6UL<<8)|NELEMS(movszx_insn), CPU_386, SUF_B +movzwl, movszx_insn, (0xB6UL<<8)|NELEMS(movszx_insn), CPU_386, SUF_W +movzwq, movszx_insn, (0xB6UL<<8)|NELEMS(movszx_insn), CPU_64, SUF_W +movzx, movszx_insn, (0xB6UL<<8)|NELEMS(movszx_insn), CPU_386, NONE +movzxb, movszx_insn, (0xB6UL<<8)|NELEMS(movszx_insn), CPU_386, SUF_B +movzxw, movszx_insn, (0xB6UL<<8)|NELEMS(movszx_insn), CPU_386, SUF_W +mpsadbw, sse4imm_insn, (0x42UL<<8)|NELEMS(sse4imm_insn), CPU_SSE41, NONE +mul, f6_insn, (0x04UL<<8)|NELEMS(f6_insn), CPU_Any, NONE +mulb, f6_insn, (0x04UL<<8)|NELEMS(f6_insn), CPU_Any, SUF_B +mull, f6_insn, (0x04UL<<8)|NELEMS(f6_insn), CPU_386, SUF_L +mulq, f6_insn, (0x04UL<<8)|NELEMS(f6_insn), CPU_64, SUF_Q +mulw, f6_insn, (0x04UL<<8)|NELEMS(f6_insn), CPU_Any, SUF_W +mulpd, ssess_insn, (0x6659UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +mulps, sseps_insn, (0x59UL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE +mulsd, ssess_insn, (0xF259UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +mulss, ssess_insn, (0xF359UL<<8)|NELEMS(ssess_insn), CPU_SSE, NONE +mwait, threebyte_insn, (0x0F01C9UL<<8)|NELEMS(threebyte_insn), CPU_SSE3, NONE +neg, f6_insn, (0x03UL<<8)|NELEMS(f6_insn), CPU_Any, NONE +negb, f6_insn, (0x03UL<<8)|NELEMS(f6_insn), CPU_Any, SUF_B +negl, f6_insn, (0x03UL<<8)|NELEMS(f6_insn), CPU_386, SUF_L +negq, f6_insn, (0x03UL<<8)|NELEMS(f6_insn), CPU_64, SUF_Q +negw, f6_insn, (0x03UL<<8)|NELEMS(f6_insn), CPU_Any, SUF_W +nop, onebyte_insn, (0x000090UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +not, f6_insn, (0x02UL<<8)|NELEMS(f6_insn), CPU_Any, NONE +notb, f6_insn, (0x02UL<<8)|NELEMS(f6_insn), CPU_Any, SUF_B +notl, f6_insn, (0x02UL<<8)|NELEMS(f6_insn), CPU_386, SUF_L +notq, f6_insn, (0x02UL<<8)|NELEMS(f6_insn), CPU_64, SUF_Q +notw, f6_insn, (0x02UL<<8)|NELEMS(f6_insn), CPU_Any, SUF_W +or, arith_insn, (0x0108UL<<8)|NELEMS(arith_insn), CPU_Any, NONE +orb, arith_insn, (0x0108UL<<8)|NELEMS(arith_insn), CPU_Any, SUF_B +orl, arith_insn, (0x0108UL<<8)|NELEMS(arith_insn), CPU_386, SUF_L +orq, arith_insn, (0x0108UL<<8)|NELEMS(arith_insn), CPU_64, SUF_Q +orw, arith_insn, (0x0108UL<<8)|NELEMS(arith_insn), CPU_Any, SUF_W +orpd, ssess_insn, (0x6656UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +orps, sseps_insn, (0x56UL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE +out, out_insn, (0UL<<8)|NELEMS(out_insn), CPU_Any, NONE +outb, out_insn, (0UL<<8)|NELEMS(out_insn), CPU_Any, SUF_B +outl, out_insn, (0UL<<8)|NELEMS(out_insn), CPU_386, SUF_L +outw, out_insn, (0UL<<8)|NELEMS(out_insn), CPU_Any, SUF_W +outsb, onebyte_insn, (0x00006EUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +outsl, onebyte_insn, (0x00206FUL<<8)|NELEMS(onebyte_insn), CPU_386, NONE +outsw, onebyte_insn, (0x00106FUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +pabsb, ssse3_insn, (0x1CUL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE +pabsd, ssse3_insn, (0x1EUL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE +pabsw, ssse3_insn, (0x1DUL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE +packssdw, mmxsse2_insn, (0x6BUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +packsswb, mmxsse2_insn, (0x63UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +packusdw, sse4_insn, (0x2BUL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE +packuswb, mmxsse2_insn, (0x67UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +paddb, mmxsse2_insn, (0xFCUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +paddd, mmxsse2_insn, (0xFEUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +paddq, mmxsse2_insn, (0xD4UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +paddsb, mmxsse2_insn, (0xECUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +paddsiw, cyrixmmx_insn, (0x51UL<<8)|NELEMS(cyrixmmx_insn), CPU_Cyrix|CPU_MMX, NONE +paddsw, mmxsse2_insn, (0xEDUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +paddusb, mmxsse2_insn, (0xDCUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +paddusw, mmxsse2_insn, (0xDDUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +paddw, mmxsse2_insn, (0xFDUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +palignr, ssse3imm_insn, (0x0FUL<<8)|NELEMS(ssse3imm_insn), CPU_SSSE3, NONE +pand, mmxsse2_insn, (0xDBUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +pandn, mmxsse2_insn, (0xDFUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +pause, onebyte_prefix_insn, (0xF390UL<<8)|NELEMS(onebyte_prefix_insn), CPU_P4, NONE +paveb, cyrixmmx_insn, (0x50UL<<8)|NELEMS(cyrixmmx_insn), CPU_Cyrix|CPU_MMX, NONE +pavgb, mmxsse2_insn, (0xE0UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX|CPU_P3, NONE +pavgusb, now3d_insn, (0xBFUL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE +pavgw, mmxsse2_insn, (0xE3UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX|CPU_P3, NONE +pblendvb, sse4xmm0_insn, (0x10UL<<8)|NELEMS(sse4xmm0_insn), CPU_SSE41, NONE +pblendw, sse4imm_insn, (0x0EUL<<8)|NELEMS(sse4imm_insn), CPU_SSE41, NONE +pcmpeqb, mmxsse2_insn, (0x74UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +pcmpeqd, mmxsse2_insn, (0x76UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +pcmpeqq, sse4_insn, (0x29UL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE +pcmpeqw, mmxsse2_insn, (0x75UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +pcmpestri, sse4pcmpstr_insn, (0x61UL<<8)|NELEMS(sse4pcmpstr_insn), CPU_SSE42, NONE +pcmpestrm, sse4pcmpstr_insn, (0x60UL<<8)|NELEMS(sse4pcmpstr_insn), CPU_SSE42, NONE +pcmpgtb, mmxsse2_insn, (0x64UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +pcmpgtd, mmxsse2_insn, (0x66UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +pcmpgtq, sse4_insn, (0x37UL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE +pcmpgtw, mmxsse2_insn, (0x65UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +pcmpistri, sse4pcmpstr_insn, (0x63UL<<8)|NELEMS(sse4pcmpstr_insn), CPU_SSE42, NONE +pcmpistrm, sse4pcmpstr_insn, (0x62UL<<8)|NELEMS(sse4pcmpstr_insn), CPU_SSE42, NONE +pdistib, cyrixmmx_insn, (0x54UL<<8)|NELEMS(cyrixmmx_insn), CPU_Cyrix|CPU_MMX, NONE +pextrb, pextrb_insn, (0UL<<8)|NELEMS(pextrb_insn), CPU_SSE41, NONE +pextrd, pextrd_insn, (0UL<<8)|NELEMS(pextrd_insn), CPU_386|CPU_SSE41, NONE +pextrq, pextrq_insn, (0UL<<8)|NELEMS(pextrq_insn), CPU_64|CPU_SSE41, NONE +pextrw, pextrw_insn, (0UL<<8)|NELEMS(pextrw_insn), CPU_MMX|CPU_P3, NONE +pextrwl, pextrw_insn, (0UL<<8)|NELEMS(pextrw_insn), CPU_MMX|CPU_P3, SUF_L +pextrwq, pextrw_insn, (0UL<<8)|NELEMS(pextrw_insn), CPU_64|CPU_MMX|CPU_P3, SUF_Q +pf2id, now3d_insn, (0x1DUL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE +pf2iw, now3d_insn, (0x1CUL<<8)|NELEMS(now3d_insn), CPU_3DNow|CPU_Athlon, NONE +pfacc, now3d_insn, (0xAEUL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE +pfadd, now3d_insn, (0x9EUL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE +pfcmpeq, now3d_insn, (0xB0UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE +pfcmpge, now3d_insn, (0x90UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE +pfcmpgt, now3d_insn, (0xA0UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE +pfmax, now3d_insn, (0xA4UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE +pfmin, now3d_insn, (0x94UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE +pfmul, now3d_insn, (0xB4UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE +pfnacc, now3d_insn, (0x8AUL<<8)|NELEMS(now3d_insn), CPU_3DNow|CPU_Athlon, NONE +pfpnacc, now3d_insn, (0x8EUL<<8)|NELEMS(now3d_insn), CPU_3DNow|CPU_Athlon, NONE +pfrcp, now3d_insn, (0x96UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE +pfrcpit1, now3d_insn, (0xA6UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE +pfrcpit2, now3d_insn, (0xB6UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE +pfrsqit1, now3d_insn, (0xA7UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE +pfrsqrt, now3d_insn, (0x97UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE +pfsub, now3d_insn, (0x9AUL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE +pfsubr, now3d_insn, (0xAAUL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE +phaddd, ssse3_insn, (0x02UL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE +phaddsw, ssse3_insn, (0x03UL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE +phaddw, ssse3_insn, (0x01UL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE +phminposuw, sse4_insn, (0x41UL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE +phsubd, ssse3_insn, (0x06UL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE +phsubsw, ssse3_insn, (0x07UL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE +phsubw, ssse3_insn, (0x05UL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE +pi2fd, now3d_insn, (0x0DUL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE +pi2fw, now3d_insn, (0x0CUL<<8)|NELEMS(now3d_insn), CPU_3DNow|CPU_Athlon, NONE +pinsrb, pinsrb_insn, (0UL<<8)|NELEMS(pinsrb_insn), CPU_SSE41, NONE +pinsrd, pinsrd_insn, (0UL<<8)|NELEMS(pinsrd_insn), CPU_386|CPU_SSE41, NONE +pinsrq, pinsrq_insn, (0UL<<8)|NELEMS(pinsrq_insn), CPU_64|CPU_SSE41, NONE +pinsrw, pinsrw_insn, (0UL<<8)|NELEMS(pinsrw_insn), CPU_MMX|CPU_P3, NONE +pinsrwl, pinsrw_insn, (0UL<<8)|NELEMS(pinsrw_insn), CPU_MMX|CPU_P3, SUF_L +pinsrwq, pinsrw_insn, (0UL<<8)|NELEMS(pinsrw_insn), CPU_64|CPU_MMX|CPU_P3, SUF_Q +pmachriw, pmachriw_insn, (0UL<<8)|NELEMS(pmachriw_insn), CPU_Cyrix|CPU_MMX, NONE +pmaddubsw, ssse3_insn, (0x04UL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE +pmaddwd, mmxsse2_insn, (0xF5UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +pmagw, cyrixmmx_insn, (0x52UL<<8)|NELEMS(cyrixmmx_insn), CPU_Cyrix|CPU_MMX, NONE +pmaxsb, sse4_insn, (0x3CUL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE +pmaxsd, sse4_insn, (0x3DUL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE +pmaxsw, mmxsse2_insn, (0xEEUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX|CPU_P3, NONE +pmaxub, mmxsse2_insn, (0xDEUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX|CPU_P3, NONE +pmaxud, sse4_insn, (0x3FUL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE +pmaxuw, sse4_insn, (0x3EUL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE +pminsb, sse4_insn, (0x38UL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE +pminsd, sse4_insn, (0x39UL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE +pminsw, mmxsse2_insn, (0xEAUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX|CPU_P3, NONE +pminub, mmxsse2_insn, (0xDAUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX|CPU_P3, NONE +pminud, sse4_insn, (0x3BUL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE +pminuw, sse4_insn, (0x3AUL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE +pmovmskb, pmovmskb_insn, (0UL<<8)|NELEMS(pmovmskb_insn), CPU_MMX|CPU_P3, NONE +pmovmskbl, pmovmskb_insn, (0UL<<8)|NELEMS(pmovmskb_insn), CPU_MMX|CPU_P3, SUF_L +pmovmskbq, pmovmskb_insn, (0UL<<8)|NELEMS(pmovmskb_insn), CPU_64|CPU_MMX|CPU_P3, SUF_Q +pmovsxbd, sse4m32_insn, (0x21UL<<8)|NELEMS(sse4m32_insn), CPU_SSE41, NONE +pmovsxbq, sse4m16_insn, (0x22UL<<8)|NELEMS(sse4m16_insn), CPU_SSE41, NONE +pmovsxbw, sse4m64_insn, (0x20UL<<8)|NELEMS(sse4m64_insn), CPU_SSE41, NONE +pmovsxdq, sse4m64_insn, (0x25UL<<8)|NELEMS(sse4m64_insn), CPU_SSE41, NONE +pmovsxwd, sse4m64_insn, (0x23UL<<8)|NELEMS(sse4m64_insn), CPU_SSE41, NONE +pmovsxwq, sse4m32_insn, (0x24UL<<8)|NELEMS(sse4m32_insn), CPU_SSE41, NONE +pmovzxbd, sse4m32_insn, (0x31UL<<8)|NELEMS(sse4m32_insn), CPU_SSE41, NONE +pmovzxbq, sse4m16_insn, (0x32UL<<8)|NELEMS(sse4m16_insn), CPU_SSE41, NONE +pmovzxbw, sse4m64_insn, (0x30UL<<8)|NELEMS(sse4m64_insn), CPU_SSE41, NONE +pmovzxdq, sse4m64_insn, (0x35UL<<8)|NELEMS(sse4m64_insn), CPU_SSE41, NONE +pmovzxwd, sse4m64_insn, (0x33UL<<8)|NELEMS(sse4m64_insn), CPU_SSE41, NONE +pmovzxwq, sse4m32_insn, (0x34UL<<8)|NELEMS(sse4m32_insn), CPU_SSE41, NONE +pmuldq, sse4_insn, (0x28UL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE +pmulhriw, cyrixmmx_insn, (0x5DUL<<8)|NELEMS(cyrixmmx_insn), CPU_Cyrix|CPU_MMX, NONE +pmulhrsw, ssse3_insn, (0x0BUL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE +pmulhrwa, now3d_insn, (0xB7UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE +pmulhrwc, cyrixmmx_insn, (0x59UL<<8)|NELEMS(cyrixmmx_insn), CPU_Cyrix|CPU_MMX, NONE +pmulhuw, mmxsse2_insn, (0xE4UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX|CPU_P3, NONE +pmulhw, mmxsse2_insn, (0xE5UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +pmulld, sse4_insn, (0x40UL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE +pmullw, mmxsse2_insn, (0xD5UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +pmuludq, mmxsse2_insn, (0xF4UL<<8)|NELEMS(mmxsse2_insn), CPU_SSE2, NONE +pmvgezb, cyrixmmx_insn, (0x5CUL<<8)|NELEMS(cyrixmmx_insn), CPU_Cyrix|CPU_MMX, NONE +pmvlzb, cyrixmmx_insn, (0x5BUL<<8)|NELEMS(cyrixmmx_insn), CPU_Cyrix|CPU_MMX, NONE +pmvnzb, cyrixmmx_insn, (0x5AUL<<8)|NELEMS(cyrixmmx_insn), CPU_Cyrix|CPU_MMX, NONE +pmvzb, cyrixmmx_insn, (0x58UL<<8)|NELEMS(cyrixmmx_insn), CPU_Cyrix|CPU_MMX, NONE +pop, pop_insn, (0UL<<8)|NELEMS(pop_insn), CPU_Any, NONE +popl, pop_insn, (0UL<<8)|NELEMS(pop_insn), CPU_386|CPU_Not64, SUF_L +popq, pop_insn, (0UL<<8)|NELEMS(pop_insn), CPU_64, SUF_Q +popw, pop_insn, (0UL<<8)|NELEMS(pop_insn), CPU_Any, SUF_W +popa, onebyte_insn, (0x000061UL<<8)|NELEMS(onebyte_insn), CPU_186|CPU_Not64, NONE +popal, onebyte_insn, (0x002061UL<<8)|NELEMS(onebyte_insn), CPU_386|CPU_Not64, NONE +popaw, onebyte_insn, (0x001061UL<<8)|NELEMS(onebyte_insn), CPU_186|CPU_Not64, NONE +popcnt, cnt_insn, (0xB8UL<<8)|NELEMS(cnt_insn), CPU_SSE42, NONE +popcntl, cnt_insn, (0xB8UL<<8)|NELEMS(cnt_insn), CPU_SSE42, SUF_L +popcntq, cnt_insn, (0xB8UL<<8)|NELEMS(cnt_insn), CPU_SSE42, SUF_Q +popcntw, cnt_insn, (0xB8UL<<8)|NELEMS(cnt_insn), CPU_SSE42, SUF_W +popf, onebyte_insn, (0x40009DUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +popfl, onebyte_insn, (0x00209DUL<<8)|NELEMS(onebyte_insn), CPU_386|CPU_Not64, NONE +popfq, onebyte_insn, (0x40409DUL<<8)|NELEMS(onebyte_insn), CPU_64, NONE +popfw, onebyte_insn, (0x40109DUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +por, mmxsse2_insn, (0xEBUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +prefetch, twobytemem_insn, (0x000F0DUL<<8)|NELEMS(twobytemem_insn), CPU_3DNow, NONE +prefetchnta, twobytemem_insn, (0x000F18UL<<8)|NELEMS(twobytemem_insn), CPU_P3, NONE +prefetcht0, twobytemem_insn, (0x010F18UL<<8)|NELEMS(twobytemem_insn), CPU_P3, NONE +prefetcht1, twobytemem_insn, (0x020F18UL<<8)|NELEMS(twobytemem_insn), CPU_P3, NONE +prefetcht2, twobytemem_insn, (0x030F18UL<<8)|NELEMS(twobytemem_insn), CPU_P3, NONE +prefetchw, twobytemem_insn, (0x010F0DUL<<8)|NELEMS(twobytemem_insn), CPU_3DNow, NONE +psadbw, mmxsse2_insn, (0xF6UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX|CPU_P3, NONE +pshufb, ssse3_insn, (0x00UL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE +pshufd, ssessimm_insn, (0x6670UL<<8)|NELEMS(ssessimm_insn), CPU_SSE2, NONE +pshufhw, ssessimm_insn, (0xF370UL<<8)|NELEMS(ssessimm_insn), CPU_SSE2, NONE +pshuflw, ssessimm_insn, (0xF270UL<<8)|NELEMS(ssessimm_insn), CPU_SSE2, NONE +pshufw, pshufw_insn, (0UL<<8)|NELEMS(pshufw_insn), CPU_MMX|CPU_P3, NONE +psignb, ssse3_insn, (0x08UL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE +psignd, ssse3_insn, (0x0AUL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE +psignw, ssse3_insn, (0x09UL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE +pslld, pshift_insn, (0x0672F2UL<<8)|NELEMS(pshift_insn), CPU_MMX, NONE +pslldq, pslrldq_insn, (0x07UL<<8)|NELEMS(pslrldq_insn), CPU_SSE2, NONE +psllq, pshift_insn, (0x0673F3UL<<8)|NELEMS(pshift_insn), CPU_MMX, NONE +psllw, pshift_insn, (0x0671F1UL<<8)|NELEMS(pshift_insn), CPU_MMX, NONE +psrad, pshift_insn, (0x0472E2UL<<8)|NELEMS(pshift_insn), CPU_MMX, NONE +psraw, pshift_insn, (0x0471E1UL<<8)|NELEMS(pshift_insn), CPU_MMX, NONE +psrld, pshift_insn, (0x0272D2UL<<8)|NELEMS(pshift_insn), CPU_MMX, NONE +psrldq, pslrldq_insn, (0x03UL<<8)|NELEMS(pslrldq_insn), CPU_SSE2, NONE +psrlq, pshift_insn, (0x0273D3UL<<8)|NELEMS(pshift_insn), CPU_MMX, NONE +psrlw, pshift_insn, (0x0271D1UL<<8)|NELEMS(pshift_insn), CPU_MMX, NONE +psubb, mmxsse2_insn, (0xF8UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +psubd, mmxsse2_insn, (0xFAUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +psubq, mmxsse2_insn, (0xFBUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +psubsb, mmxsse2_insn, (0xE8UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +psubsiw, cyrixmmx_insn, (0x55UL<<8)|NELEMS(cyrixmmx_insn), CPU_Cyrix|CPU_MMX, NONE +psubsw, mmxsse2_insn, (0xE9UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +psubusb, mmxsse2_insn, (0xD8UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +psubusw, mmxsse2_insn, (0xD9UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +psubw, mmxsse2_insn, (0xF9UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +pswapd, now3d_insn, (0xBBUL<<8)|NELEMS(now3d_insn), CPU_3DNow|CPU_Athlon, NONE +ptest, sse4_insn, (0x17UL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE +punpckhbw, mmxsse2_insn, (0x68UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +punpckhdq, mmxsse2_insn, (0x6AUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +punpckhqdq, ssess_insn, (0x666DUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +punpckhwd, mmxsse2_insn, (0x69UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +punpcklbw, mmxsse2_insn, (0x60UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +punpckldq, mmxsse2_insn, (0x62UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +punpcklqdq, ssess_insn, (0x666CUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +punpcklwd, mmxsse2_insn, (0x61UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +push, push_insn, (0UL<<8)|NELEMS(push_insn), CPU_Any, NONE +pushl, push_insn, (0UL<<8)|NELEMS(push_insn), CPU_386, SUF_L +pushq, push_insn, (0UL<<8)|NELEMS(push_insn), CPU_64, SUF_Q +pushw, push_insn, (0UL<<8)|NELEMS(push_insn), CPU_Any, SUF_W +pusha, onebyte_insn, (0x000060UL<<8)|NELEMS(onebyte_insn), CPU_186|CPU_Not64, NONE +pushal, onebyte_insn, (0x002060UL<<8)|NELEMS(onebyte_insn), CPU_386|CPU_Not64, NONE +pushaw, onebyte_insn, (0x001060UL<<8)|NELEMS(onebyte_insn), CPU_186|CPU_Not64, NONE +pushf, onebyte_insn, (0x40009CUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +pushfl, onebyte_insn, (0x00209CUL<<8)|NELEMS(onebyte_insn), CPU_386|CPU_Not64, NONE +pushfq, onebyte_insn, (0x40409CUL<<8)|NELEMS(onebyte_insn), CPU_64, NONE +pushfw, onebyte_insn, (0x40109CUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +pxor, mmxsse2_insn, (0xEFUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +qword, NULL, X86_OPERSIZE, 0x40, NONE +rcl, shift_insn, (0x02UL<<8)|NELEMS(shift_insn), CPU_Any, NONE +rclb, shift_insn, (0x02UL<<8)|NELEMS(shift_insn), CPU_Any, SUF_B +rcll, shift_insn, (0x02UL<<8)|NELEMS(shift_insn), CPU_386, SUF_L +rclq, shift_insn, (0x02UL<<8)|NELEMS(shift_insn), CPU_64, SUF_Q +rclw, shift_insn, (0x02UL<<8)|NELEMS(shift_insn), CPU_Any, SUF_W +rcpps, sseps_insn, (0x53UL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE +rcpss, ssess_insn, (0xF353UL<<8)|NELEMS(ssess_insn), CPU_SSE, NONE +rcr, shift_insn, (0x03UL<<8)|NELEMS(shift_insn), CPU_Any, NONE +rcrb, shift_insn, (0x03UL<<8)|NELEMS(shift_insn), CPU_Any, SUF_B +rcrl, shift_insn, (0x03UL<<8)|NELEMS(shift_insn), CPU_386, SUF_L +rcrq, shift_insn, (0x03UL<<8)|NELEMS(shift_insn), CPU_64, SUF_Q +rcrw, shift_insn, (0x03UL<<8)|NELEMS(shift_insn), CPU_Any, SUF_W +rdmsr, twobyte_insn, (0x0F32UL<<8)|NELEMS(twobyte_insn), CPU_586|CPU_Priv, NONE +rdpmc, twobyte_insn, (0x0F33UL<<8)|NELEMS(twobyte_insn), CPU_686, NONE +rdshr, rdwrshr_insn, (0x00UL<<8)|NELEMS(rdwrshr_insn), CPU_686|CPU_Cyrix|CPU_SMM, NONE +rdtsc, twobyte_insn, (0x0F31UL<<8)|NELEMS(twobyte_insn), CPU_586, NONE +rdtscp, threebyte_insn, (0x0F01F9UL<<8)|NELEMS(threebyte_insn), CPU_686|CPU_AMD|CPU_Priv, NONE +rep, NULL, X86_LOCKREP, 0xF3, NONE +repe, NULL, X86_LOCKREP, 0xF3, NONE +repne, NULL, X86_LOCKREP, 0xF2, NONE +repnz, NULL, X86_LOCKREP, 0xF2, NONE +repz, NULL, X86_LOCKREP, 0xF3, NONE +ret, retnf_insn, (0x00C2UL<<8)|NELEMS(retnf_insn), CPU_Any, NONE +retl, retnf_insn, (0x00C2UL<<8)|NELEMS(retnf_insn), CPU_Not64, NONE +retq, retnf_insn, (0x00C2UL<<8)|NELEMS(retnf_insn), CPU_64, NONE +retw, retnf_insn, (0x10C2UL<<8)|NELEMS(retnf_insn), CPU_Any, NONE +rex, NULL, X86_REX, 0x40, NONE +rex64, NULL, X86_REX, 0x48, NONE +rex64x, NULL, X86_REX, 0x4C, NONE +rex64xy, NULL, X86_REX, 0x4E, NONE +rex64xyz, NULL, X86_REX, 0x4F, NONE +rex64xz, NULL, X86_REX, 0x4D, NONE +rex64y, NULL, X86_REX, 0x4A, NONE +rex64yz, NULL, X86_REX, 0x4B, NONE +rex64z, NULL, X86_REX, 0x49, NONE +rexx, NULL, X86_REX, 0x44, NONE +rexxy, NULL, X86_REX, 0x46, NONE +rexxyz, NULL, X86_REX, 0x47, NONE +rexxz, NULL, X86_REX, 0x45, NONE +rexy, NULL, X86_REX, 0x42, NONE +rexyz, NULL, X86_REX, 0x43, NONE +rexz, NULL, X86_REX, 0x41, NONE +rol, shift_insn, (0x00UL<<8)|NELEMS(shift_insn), CPU_Any, NONE +rolb, shift_insn, (0x00UL<<8)|NELEMS(shift_insn), CPU_Any, SUF_B +roll, shift_insn, (0x00UL<<8)|NELEMS(shift_insn), CPU_386, SUF_L +rolq, shift_insn, (0x00UL<<8)|NELEMS(shift_insn), CPU_64, SUF_Q +rolw, shift_insn, (0x00UL<<8)|NELEMS(shift_insn), CPU_Any, SUF_W +ror, shift_insn, (0x01UL<<8)|NELEMS(shift_insn), CPU_Any, NONE +rorb, shift_insn, (0x01UL<<8)|NELEMS(shift_insn), CPU_Any, SUF_B +rorl, shift_insn, (0x01UL<<8)|NELEMS(shift_insn), CPU_386, SUF_L +rorq, shift_insn, (0x01UL<<8)|NELEMS(shift_insn), CPU_64, SUF_Q +rorw, shift_insn, (0x01UL<<8)|NELEMS(shift_insn), CPU_Any, SUF_W +roundpd, sse4imm_insn, (0x09UL<<8)|NELEMS(sse4imm_insn), CPU_SSE41, NONE +roundps, sse4imm_insn, (0x08UL<<8)|NELEMS(sse4imm_insn), CPU_SSE41, NONE +roundsd, sse4imm_insn, (0x0BUL<<8)|NELEMS(sse4imm_insn), CPU_SSE41, NONE +roundss, sse4imm_insn, (0x0AUL<<8)|NELEMS(sse4imm_insn), CPU_SSE41, NONE +rsdc, rsdc_insn, (0UL<<8)|NELEMS(rsdc_insn), CPU_486|CPU_Cyrix|CPU_SMM, NONE +rsldt, cyrixsmm_insn, (0x7BUL<<8)|NELEMS(cyrixsmm_insn), CPU_486|CPU_Cyrix|CPU_SMM, NONE +rsm, twobyte_insn, (0x0FAAUL<<8)|NELEMS(twobyte_insn), CPU_586|CPU_SMM, NONE +rsqrtps, sseps_insn, (0x52UL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE +rsqrtss, ssess_insn, (0xF352UL<<8)|NELEMS(ssess_insn), CPU_SSE, NONE +rsts, cyrixsmm_insn, (0x7DUL<<8)|NELEMS(cyrixsmm_insn), CPU_486|CPU_Cyrix|CPU_SMM, NONE +sahf, onebyte_insn, (0x00009EUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +sal, shift_insn, (0x04UL<<8)|NELEMS(shift_insn), CPU_Any, NONE +salb, shift_insn, (0x04UL<<8)|NELEMS(shift_insn), CPU_Any, SUF_B +sall, shift_insn, (0x04UL<<8)|NELEMS(shift_insn), CPU_386, SUF_L +salq, shift_insn, (0x04UL<<8)|NELEMS(shift_insn), CPU_64, SUF_Q +salw, shift_insn, (0x04UL<<8)|NELEMS(shift_insn), CPU_Any, SUF_W +salc, onebyte_insn, (0x0000D6UL<<8)|NELEMS(onebyte_insn), CPU_Not64|CPU_Undoc, NONE +sar, shift_insn, (0x07UL<<8)|NELEMS(shift_insn), CPU_Any, NONE +sarb, shift_insn, (0x07UL<<8)|NELEMS(shift_insn), CPU_Any, SUF_B +sarl, shift_insn, (0x07UL<<8)|NELEMS(shift_insn), CPU_386, SUF_L +sarq, shift_insn, (0x07UL<<8)|NELEMS(shift_insn), CPU_64, SUF_Q +sarw, shift_insn, (0x07UL<<8)|NELEMS(shift_insn), CPU_Any, SUF_W +sbb, arith_insn, (0x0318UL<<8)|NELEMS(arith_insn), CPU_Any, NONE +sbbb, arith_insn, (0x0318UL<<8)|NELEMS(arith_insn), CPU_Any, SUF_B +sbbl, arith_insn, (0x0318UL<<8)|NELEMS(arith_insn), CPU_386, SUF_L +sbbq, arith_insn, (0x0318UL<<8)|NELEMS(arith_insn), CPU_64, SUF_Q +sbbw, arith_insn, (0x0318UL<<8)|NELEMS(arith_insn), CPU_Any, SUF_W +scasb, onebyte_insn, (0x0000AEUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +scasl, onebyte_insn, (0x0020AFUL<<8)|NELEMS(onebyte_insn), CPU_386, NONE +scasq, onebyte_insn, (0x0040AFUL<<8)|NELEMS(onebyte_insn), CPU_64, NONE +scasw, onebyte_insn, (0x0010AFUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +seta, setcc_insn, (0x07UL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setab, setcc_insn, (0x07UL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B +setae, setcc_insn, (0x03UL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setaeb, setcc_insn, (0x03UL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B +setb, setcc_insn, (0x02UL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setbb, setcc_insn, (0x02UL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B +setbe, setcc_insn, (0x06UL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setbeb, setcc_insn, (0x06UL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B +setc, setcc_insn, (0x02UL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setcb, setcc_insn, (0x02UL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B +sete, setcc_insn, (0x04UL<<8)|NELEMS(setcc_insn), CPU_386, NONE +seteb, setcc_insn, (0x04UL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B +setg, setcc_insn, (0x0FUL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setgb, setcc_insn, (0x0FUL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B +setge, setcc_insn, (0x0DUL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setgeb, setcc_insn, (0x0DUL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B +setl, setcc_insn, (0x0CUL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setlb, setcc_insn, (0x0CUL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B +setle, setcc_insn, (0x0EUL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setleb, setcc_insn, (0x0EUL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B +setna, setcc_insn, (0x06UL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setnab, setcc_insn, (0x06UL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B +setnae, setcc_insn, (0x02UL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setnaeb, setcc_insn, (0x02UL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B +setnb, setcc_insn, (0x03UL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setnbb, setcc_insn, (0x03UL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B +setnbe, setcc_insn, (0x07UL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setnbeb, setcc_insn, (0x07UL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B +setnc, setcc_insn, (0x03UL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setncb, setcc_insn, (0x03UL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B +setne, setcc_insn, (0x05UL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setneb, setcc_insn, (0x05UL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B +setng, setcc_insn, (0x0EUL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setngb, setcc_insn, (0x0EUL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B +setnge, setcc_insn, (0x0CUL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setngeb, setcc_insn, (0x0CUL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B +setnl, setcc_insn, (0x0DUL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setnlb, setcc_insn, (0x0DUL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B +setnle, setcc_insn, (0x0FUL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setnleb, setcc_insn, (0x0FUL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B +setno, setcc_insn, (0x01UL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setnob, setcc_insn, (0x01UL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B +setnp, setcc_insn, (0x0BUL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setnpb, setcc_insn, (0x0BUL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B +setns, setcc_insn, (0x09UL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setnsb, setcc_insn, (0x09UL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B +setnz, setcc_insn, (0x05UL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setnzb, setcc_insn, (0x05UL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B +seto, setcc_insn, (0x00UL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setob, setcc_insn, (0x00UL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B +setp, setcc_insn, (0x0AUL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setpb, setcc_insn, (0x0AUL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B +setpe, setcc_insn, (0x0AUL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setpeb, setcc_insn, (0x0AUL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B +setpo, setcc_insn, (0x0BUL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setpob, setcc_insn, (0x0BUL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B +sets, setcc_insn, (0x08UL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setsb, setcc_insn, (0x08UL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B +setz, setcc_insn, (0x04UL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setzb, setcc_insn, (0x04UL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B +sfence, threebyte_insn, (0x0FAEF8UL<<8)|NELEMS(threebyte_insn), CPU_P3, NONE +sgdt, twobytemem_insn, (0x000F01UL<<8)|NELEMS(twobytemem_insn), CPU_286|CPU_Priv, NONE +sgdtl, twobytemem_insn, (0x000F01UL<<8)|NELEMS(twobytemem_insn), CPU_286|CPU_Priv, SUF_L +sgdtq, twobytemem_insn, (0x000F01UL<<8)|NELEMS(twobytemem_insn), CPU_286|CPU_Priv, SUF_Q +sgdtw, twobytemem_insn, (0x000F01UL<<8)|NELEMS(twobytemem_insn), CPU_286|CPU_Priv, SUF_W +shl, shift_insn, (0x04UL<<8)|NELEMS(shift_insn), CPU_Any, NONE +shlb, shift_insn, (0x04UL<<8)|NELEMS(shift_insn), CPU_Any, SUF_B +shll, shift_insn, (0x04UL<<8)|NELEMS(shift_insn), CPU_386, SUF_L +shlq, shift_insn, (0x04UL<<8)|NELEMS(shift_insn), CPU_64, SUF_Q +shlw, shift_insn, (0x04UL<<8)|NELEMS(shift_insn), CPU_Any, SUF_W +shld, shlrd_insn, (0xA4UL<<8)|NELEMS(shlrd_insn), CPU_386, NONE +shldl, shlrd_insn, (0xA4UL<<8)|NELEMS(shlrd_insn), CPU_386, SUF_L +shldq, shlrd_insn, (0xA4UL<<8)|NELEMS(shlrd_insn), CPU_386|CPU_64, SUF_Q +shldw, shlrd_insn, (0xA4UL<<8)|NELEMS(shlrd_insn), CPU_386, SUF_W +shr, shift_insn, (0x05UL<<8)|NELEMS(shift_insn), CPU_Any, NONE +shrb, shift_insn, (0x05UL<<8)|NELEMS(shift_insn), CPU_Any, SUF_B +shrl, shift_insn, (0x05UL<<8)|NELEMS(shift_insn), CPU_386, SUF_L +shrq, shift_insn, (0x05UL<<8)|NELEMS(shift_insn), CPU_64, SUF_Q +shrw, shift_insn, (0x05UL<<8)|NELEMS(shift_insn), CPU_Any, SUF_W +shrd, shlrd_insn, (0xACUL<<8)|NELEMS(shlrd_insn), CPU_386, NONE +shrdl, shlrd_insn, (0xACUL<<8)|NELEMS(shlrd_insn), CPU_386, SUF_L +shrdq, shlrd_insn, (0xACUL<<8)|NELEMS(shlrd_insn), CPU_386|CPU_64, SUF_Q +shrdw, shlrd_insn, (0xACUL<<8)|NELEMS(shlrd_insn), CPU_386, SUF_W +shufpd, ssessimm_insn, (0x66C6UL<<8)|NELEMS(ssessimm_insn), CPU_SSE2, NONE +shufps, ssepsimm_insn, (0xC6UL<<8)|NELEMS(ssepsimm_insn), CPU_SSE, NONE +sidt, twobytemem_insn, (0x010F01UL<<8)|NELEMS(twobytemem_insn), CPU_286|CPU_Priv, NONE +sidtl, twobytemem_insn, (0x010F01UL<<8)|NELEMS(twobytemem_insn), CPU_286|CPU_Priv, SUF_L +sidtq, twobytemem_insn, (0x010F01UL<<8)|NELEMS(twobytemem_insn), CPU_286|CPU_Priv, SUF_Q +sidtw, twobytemem_insn, (0x010F01UL<<8)|NELEMS(twobytemem_insn), CPU_286|CPU_Priv, SUF_W +skinit, skinit_insn, (0UL<<8)|NELEMS(skinit_insn), CPU_SVM, NONE +sldt, sldtmsw_insn, (0x0000UL<<8)|NELEMS(sldtmsw_insn), CPU_286, NONE +sldtl, sldtmsw_insn, (0x0000UL<<8)|NELEMS(sldtmsw_insn), CPU_386, SUF_L +sldtq, sldtmsw_insn, (0x0000UL<<8)|NELEMS(sldtmsw_insn), CPU_286|CPU_64, SUF_Q +sldtw, sldtmsw_insn, (0x0000UL<<8)|NELEMS(sldtmsw_insn), CPU_286, SUF_W +smi, onebyte_insn, (0x0000F1UL<<8)|NELEMS(onebyte_insn), CPU_386|CPU_Undoc, NONE +smint, twobyte_insn, (0x0F38UL<<8)|NELEMS(twobyte_insn), CPU_686|CPU_Cyrix, NONE +smintold, twobyte_insn, (0x0F7EUL<<8)|NELEMS(twobyte_insn), CPU_486|CPU_Cyrix|CPU_Obs, NONE +smovb, onebyte_insn, (0x0000A4UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +smovl, onebyte_insn, (0x0020A5UL<<8)|NELEMS(onebyte_insn), CPU_386, NONE +smovq, onebyte_insn, (0x0040A5UL<<8)|NELEMS(onebyte_insn), CPU_64, NONE +smovw, onebyte_insn, (0x0010A5UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +smsw, sldtmsw_insn, (0x0401UL<<8)|NELEMS(sldtmsw_insn), CPU_286, NONE +smswl, sldtmsw_insn, (0x0401UL<<8)|NELEMS(sldtmsw_insn), CPU_386, SUF_L +smswq, sldtmsw_insn, (0x0401UL<<8)|NELEMS(sldtmsw_insn), CPU_286|CPU_64, SUF_Q +smsww, sldtmsw_insn, (0x0401UL<<8)|NELEMS(sldtmsw_insn), CPU_286, SUF_W +sqrtpd, ssess_insn, (0x6651UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +sqrtps, sseps_insn, (0x51UL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE +sqrtsd, ssess_insn, (0xF251UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +sqrtss, ssess_insn, (0xF351UL<<8)|NELEMS(ssess_insn), CPU_SSE, NONE +sscab, onebyte_insn, (0x0000AEUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +sscal, onebyte_insn, (0x0020AFUL<<8)|NELEMS(onebyte_insn), CPU_386, NONE +sscaq, onebyte_insn, (0x0040AFUL<<8)|NELEMS(onebyte_insn), CPU_64, NONE +sscaw, onebyte_insn, (0x0010AFUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +stc, onebyte_insn, (0x0000F9UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +std, onebyte_insn, (0x0000FDUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +stgi, threebyte_insn, (0x0F01DCUL<<8)|NELEMS(threebyte_insn), CPU_SVM, NONE +sti, onebyte_insn, (0x0000FBUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +stmxcsr, ldstmxcsr_insn, (0x03UL<<8)|NELEMS(ldstmxcsr_insn), CPU_SSE, NONE +stosb, onebyte_insn, (0x0000AAUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +stosl, onebyte_insn, (0x0020ABUL<<8)|NELEMS(onebyte_insn), CPU_386, NONE +stosq, onebyte_insn, (0x0040ABUL<<8)|NELEMS(onebyte_insn), CPU_64, NONE +stosw, onebyte_insn, (0x0010ABUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +str, str_insn, (0UL<<8)|NELEMS(str_insn), CPU_286|CPU_Prot, NONE +strl, str_insn, (0UL<<8)|NELEMS(str_insn), CPU_386|CPU_Prot, SUF_L +strq, str_insn, (0UL<<8)|NELEMS(str_insn), CPU_286|CPU_64|CPU_Prot, SUF_Q +strw, str_insn, (0UL<<8)|NELEMS(str_insn), CPU_286|CPU_Prot, SUF_W +sub, arith_insn, (0x0528UL<<8)|NELEMS(arith_insn), CPU_Any, NONE +subb, arith_insn, (0x0528UL<<8)|NELEMS(arith_insn), CPU_Any, SUF_B +subl, arith_insn, (0x0528UL<<8)|NELEMS(arith_insn), CPU_386, SUF_L +subq, arith_insn, (0x0528UL<<8)|NELEMS(arith_insn), CPU_64, SUF_Q +subw, arith_insn, (0x0528UL<<8)|NELEMS(arith_insn), CPU_Any, SUF_W +subpd, ssess_insn, (0x665CUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +subps, sseps_insn, (0x5CUL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE +subsd, ssess_insn, (0xF25CUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +subss, ssess_insn, (0xF35CUL<<8)|NELEMS(ssess_insn), CPU_SSE, NONE +svdc, svdc_insn, (0UL<<8)|NELEMS(svdc_insn), CPU_486|CPU_Cyrix|CPU_SMM, NONE +svldt, cyrixsmm_insn, (0x7AUL<<8)|NELEMS(cyrixsmm_insn), CPU_486|CPU_Cyrix|CPU_SMM, NONE +svts, cyrixsmm_insn, (0x7CUL<<8)|NELEMS(cyrixsmm_insn), CPU_486|CPU_Cyrix|CPU_SMM, NONE +swapgs, threebyte_insn, (0x0F01F8UL<<8)|NELEMS(threebyte_insn), CPU_64, NONE +syscall, twobyte_insn, (0x0F05UL<<8)|NELEMS(twobyte_insn), CPU_686|CPU_AMD, NONE +sysenter, twobyte_insn, (0x0F34UL<<8)|NELEMS(twobyte_insn), CPU_686|CPU_Not64, NONE +sysexit, twobyte_insn, (0x0F35UL<<8)|NELEMS(twobyte_insn), CPU_686|CPU_Not64|CPU_Priv, NONE +sysret, twobyte_insn, (0x0F07UL<<8)|NELEMS(twobyte_insn), CPU_686|CPU_AMD|CPU_Priv, NONE +sysretl, twobyte_insn, (0x0F07UL<<8)|NELEMS(twobyte_insn), CPU_686|CPU_AMD|CPU_Priv, SUF_L +sysretq, twobyte_insn, (0x0F07UL<<8)|NELEMS(twobyte_insn), CPU_686|CPU_AMD|CPU_Priv, SUF_Q +test, test_insn, (0UL<<8)|NELEMS(test_insn), CPU_Any, NONE +testb, test_insn, (0UL<<8)|NELEMS(test_insn), CPU_Any, SUF_B +testl, test_insn, (0UL<<8)|NELEMS(test_insn), CPU_386, SUF_L +testq, test_insn, (0UL<<8)|NELEMS(test_insn), CPU_64, SUF_Q +testw, test_insn, (0UL<<8)|NELEMS(test_insn), CPU_Any, SUF_W +ucomisd, ssess_insn, (0x662EUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +ucomiss, ssess_insn, (0x002EUL<<8)|NELEMS(ssess_insn), CPU_SSE, NONE +ud1, twobyte_insn, (0x0FB9UL<<8)|NELEMS(twobyte_insn), CPU_286|CPU_Undoc, NONE +ud2, twobyte_insn, (0x0F0BUL<<8)|NELEMS(twobyte_insn), CPU_286, NONE +umov, umov_insn, (0UL<<8)|NELEMS(umov_insn), CPU_386|CPU_Undoc, NONE +unpckhpd, ssess_insn, (0x6615UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +unpckhps, sseps_insn, (0x15UL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE +unpcklpd, ssess_insn, (0x6614UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +unpcklps, sseps_insn, (0x14UL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE +verr, prot286_insn, (0x0400UL<<8)|NELEMS(prot286_insn), CPU_286|CPU_Prot, NONE +verrw, prot286_insn, (0x0400UL<<8)|NELEMS(prot286_insn), CPU_286|CPU_Prot, SUF_W +verw, prot286_insn, (0x0500UL<<8)|NELEMS(prot286_insn), CPU_286|CPU_Prot, NONE +verww, prot286_insn, (0x0500UL<<8)|NELEMS(prot286_insn), CPU_286|CPU_Prot, SUF_W +vmcall, threebyte_insn, (0x0F01C1UL<<8)|NELEMS(threebyte_insn), CPU_P4, NONE +vmclear, vmxthreebytemem_insn, (0x66UL<<8)|NELEMS(vmxthreebytemem_insn), CPU_P4, NONE +vmlaunch, threebyte_insn, (0x0F01C2UL<<8)|NELEMS(threebyte_insn), CPU_P4, NONE +vmload, svm_rax_insn, (0xDAUL<<8)|NELEMS(svm_rax_insn), CPU_SVM, NONE +vmmcall, threebyte_insn, (0x0F01D9UL<<8)|NELEMS(threebyte_insn), CPU_SVM, NONE +vmptrld, vmxtwobytemem_insn, (0x06UL<<8)|NELEMS(vmxtwobytemem_insn), CPU_P4, NONE +vmptrst, vmxtwobytemem_insn, (0x07UL<<8)|NELEMS(vmxtwobytemem_insn), CPU_P4, NONE +vmread, vmxmemrd_insn, (0UL<<8)|NELEMS(vmxmemrd_insn), CPU_P4, NONE +vmreadl, vmxmemrd_insn, (0UL<<8)|NELEMS(vmxmemrd_insn), CPU_Not64|CPU_P4, SUF_L +vmreadq, vmxmemrd_insn, (0UL<<8)|NELEMS(vmxmemrd_insn), CPU_64|CPU_P4, SUF_Q +vmresume, threebyte_insn, (0x0F01C3UL<<8)|NELEMS(threebyte_insn), CPU_P4, NONE +vmrun, svm_rax_insn, (0xD8UL<<8)|NELEMS(svm_rax_insn), CPU_SVM, NONE +vmsave, svm_rax_insn, (0xDBUL<<8)|NELEMS(svm_rax_insn), CPU_SVM, NONE +vmwrite, vmxmemwr_insn, (0UL<<8)|NELEMS(vmxmemwr_insn), CPU_P4, NONE +vmwritel, vmxmemwr_insn, (0UL<<8)|NELEMS(vmxmemwr_insn), CPU_Not64|CPU_P4, SUF_L +vmwriteq, vmxmemwr_insn, (0UL<<8)|NELEMS(vmxmemwr_insn), CPU_64|CPU_P4, SUF_Q +vmxoff, threebyte_insn, (0x0F01C4UL<<8)|NELEMS(threebyte_insn), CPU_P4, NONE +vmxon, vmxthreebytemem_insn, (0xF3UL<<8)|NELEMS(vmxthreebytemem_insn), CPU_P4, NONE +wait, onebyte_insn, (0x00009BUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +wbinvd, twobyte_insn, (0x0F09UL<<8)|NELEMS(twobyte_insn), CPU_486|CPU_Priv, NONE +word, NULL, X86_OPERSIZE, 0x10, NONE +wrmsr, twobyte_insn, (0x0F30UL<<8)|NELEMS(twobyte_insn), CPU_586|CPU_Priv, NONE +wrshr, rdwrshr_insn, (0x01UL<<8)|NELEMS(rdwrshr_insn), CPU_686|CPU_Cyrix|CPU_SMM, NONE +xadd, cmpxchgxadd_insn, (0xC0UL<<8)|NELEMS(cmpxchgxadd_insn), CPU_486, NONE +xaddb, cmpxchgxadd_insn, (0xC0UL<<8)|NELEMS(cmpxchgxadd_insn), CPU_486, SUF_B +xaddl, cmpxchgxadd_insn, (0xC0UL<<8)|NELEMS(cmpxchgxadd_insn), CPU_486, SUF_L +xaddq, cmpxchgxadd_insn, (0xC0UL<<8)|NELEMS(cmpxchgxadd_insn), CPU_486|CPU_64, SUF_Q +xaddw, cmpxchgxadd_insn, (0xC0UL<<8)|NELEMS(cmpxchgxadd_insn), CPU_486, SUF_W +xbts, xbts_insn, (0UL<<8)|NELEMS(xbts_insn), CPU_386|CPU_Obs|CPU_Undoc, NONE +xchg, xchg_insn, (0UL<<8)|NELEMS(xchg_insn), CPU_Any, NONE +xchgb, xchg_insn, (0UL<<8)|NELEMS(xchg_insn), CPU_Any, SUF_B +xchgl, xchg_insn, (0UL<<8)|NELEMS(xchg_insn), CPU_Any, SUF_L +xchgq, xchg_insn, (0UL<<8)|NELEMS(xchg_insn), CPU_64, SUF_Q +xchgw, xchg_insn, (0UL<<8)|NELEMS(xchg_insn), CPU_Any, SUF_W +xcryptcbc, padlock_insn, (0xD0F3A7UL<<8)|NELEMS(padlock_insn), CPU_PadLock, NONE +xcryptcfb, padlock_insn, (0xE0F3A7UL<<8)|NELEMS(padlock_insn), CPU_PadLock, NONE +xcryptctr, padlock_insn, (0xD8F3A7UL<<8)|NELEMS(padlock_insn), CPU_PadLock, NONE +xcryptecb, padlock_insn, (0xC8F3A7UL<<8)|NELEMS(padlock_insn), CPU_PadLock, NONE +xcryptofb, padlock_insn, (0xE8F3A7UL<<8)|NELEMS(padlock_insn), CPU_PadLock, NONE +xlatb, onebyte_insn, (0x0000D7UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +xor, arith_insn, (0x0630UL<<8)|NELEMS(arith_insn), CPU_Any, NONE +xorb, arith_insn, (0x0630UL<<8)|NELEMS(arith_insn), CPU_Any, SUF_B +xorl, arith_insn, (0x0630UL<<8)|NELEMS(arith_insn), CPU_386, SUF_L +xorq, arith_insn, (0x0630UL<<8)|NELEMS(arith_insn), CPU_64, SUF_Q +xorw, arith_insn, (0x0630UL<<8)|NELEMS(arith_insn), CPU_Any, SUF_W +xorpd, ssess_insn, (0x6657UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +xorps, sseps_insn, (0x57UL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE +xsha1, padlock_insn, (0xC8F3A6UL<<8)|NELEMS(padlock_insn), CPU_PadLock, NONE +xsha256, padlock_insn, (0xD0F3A6UL<<8)|NELEMS(padlock_insn), CPU_PadLock, NONE +xstore, padlock_insn, (0xC000A7UL<<8)|NELEMS(padlock_insn), CPU_PadLock, NONE +xstorerng, padlock_insn, (0xC000A7UL<<8)|NELEMS(padlock_insn), CPU_PadLock, NONE diff --git a/x86insn_nasm.gperf b/x86insn_nasm.gperf new file mode 100644 index 00000000..6ee3d265 --- /dev/null +++ b/x86insn_nasm.gperf @@ -0,0 +1,768 @@ +%ignore-case +%language=ANSI-C +%compare-strncmp +%readonly-tables +%enum +%struct-type +%define hash-function-name insnprefix_nasm_hash +%define lookup-function-name insnprefix_nasm_find +struct insnprefix_parse_data; +%% +a16, NULL, X86_ADDRSIZE, 0x10, NONE +a32, NULL, X86_ADDRSIZE, 0x20, NONE +a64, NULL, X86_ADDRSIZE, 0x40, NONE +aaa, onebyte_insn, (0x000037UL<<8)|NELEMS(onebyte_insn), CPU_Not64, NONE +aad, aadm_insn, (0x01UL<<8)|NELEMS(aadm_insn), CPU_Not64, NONE +aam, aadm_insn, (0x00UL<<8)|NELEMS(aadm_insn), CPU_Not64, NONE +aas, onebyte_insn, (0x00003FUL<<8)|NELEMS(onebyte_insn), CPU_Not64, NONE +adc, arith_insn, (0x0210UL<<8)|NELEMS(arith_insn), CPU_Any, NONE +add, arith_insn, (0x0000UL<<8)|NELEMS(arith_insn), CPU_Any, NONE +addpd, ssess_insn, (0x6658UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +addps, sseps_insn, (0x58UL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE +addsd, ssess_insn, (0xF258UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +addss, ssess_insn, (0xF358UL<<8)|NELEMS(ssess_insn), CPU_SSE, NONE +addsubpd, ssess_insn, (0x66D0UL<<8)|NELEMS(ssess_insn), CPU_SSE3, NONE +addsubps, ssess_insn, (0xF2D0UL<<8)|NELEMS(ssess_insn), CPU_SSE3, NONE +and, arith_insn, (0x0420UL<<8)|NELEMS(arith_insn), CPU_Any, NONE +andnpd, ssess_insn, (0x6655UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +andnps, sseps_insn, (0x55UL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE +andpd, ssess_insn, (0x6654UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +andps, sseps_insn, (0x54UL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE +arpl, arpl_insn, (0UL<<8)|NELEMS(arpl_insn), CPU_286|CPU_Not64|CPU_Prot, NONE +blendpd, sse4imm_insn, (0x0DUL<<8)|NELEMS(sse4imm_insn), CPU_SSE41, NONE +blendps, sse4imm_insn, (0x0CUL<<8)|NELEMS(sse4imm_insn), CPU_SSE41, NONE +blendvpd, sse4xmm0_insn, (0x15UL<<8)|NELEMS(sse4xmm0_insn), CPU_SSE41, NONE +blendvps, sse4xmm0_insn, (0x14UL<<8)|NELEMS(sse4xmm0_insn), CPU_SSE41, NONE +bound, bound_insn, (0UL<<8)|NELEMS(bound_insn), CPU_186|CPU_Not64, NONE +bsf, bsfr_insn, (0xBCUL<<8)|NELEMS(bsfr_insn), CPU_386, NONE +bsr, bsfr_insn, (0xBDUL<<8)|NELEMS(bsfr_insn), CPU_386, NONE +bswap, bswap_insn, (0UL<<8)|NELEMS(bswap_insn), CPU_486, NONE +bt, bittest_insn, (0x04A3UL<<8)|NELEMS(bittest_insn), CPU_386, NONE +btc, bittest_insn, (0x07BBUL<<8)|NELEMS(bittest_insn), CPU_386, NONE +btr, bittest_insn, (0x06B3UL<<8)|NELEMS(bittest_insn), CPU_386, NONE +bts, bittest_insn, (0x05ABUL<<8)|NELEMS(bittest_insn), CPU_386, NONE +call, call_insn, (0UL<<8)|NELEMS(call_insn), CPU_Any, NONE +cbw, onebyte_insn, (0x001098UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +cdq, onebyte_insn, (0x002099UL<<8)|NELEMS(onebyte_insn), CPU_386, NONE +cdqe, onebyte_insn, (0x004098UL<<8)|NELEMS(onebyte_insn), CPU_64, NONE +clc, onebyte_insn, (0x0000F8UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +cld, onebyte_insn, (0x0000FCUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +clflush, clflush_insn, (0UL<<8)|NELEMS(clflush_insn), CPU_P3, NONE +clgi, threebyte_insn, (0x0F01DDUL<<8)|NELEMS(threebyte_insn), CPU_SVM, NONE +cli, onebyte_insn, (0x0000FAUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +clts, twobyte_insn, (0x0F06UL<<8)|NELEMS(twobyte_insn), CPU_286|CPU_Priv, NONE +cmc, onebyte_insn, (0x0000F5UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +cmova, cmovcc_insn, (0x07UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovae, cmovcc_insn, (0x03UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovb, cmovcc_insn, (0x02UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovbe, cmovcc_insn, (0x06UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovc, cmovcc_insn, (0x02UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmove, cmovcc_insn, (0x04UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovg, cmovcc_insn, (0x0FUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovge, cmovcc_insn, (0x0DUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovl, cmovcc_insn, (0x0CUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovle, cmovcc_insn, (0x0EUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovna, cmovcc_insn, (0x06UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovnae, cmovcc_insn, (0x02UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovnb, cmovcc_insn, (0x03UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovnbe, cmovcc_insn, (0x07UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovnc, cmovcc_insn, (0x03UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovne, cmovcc_insn, (0x05UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovng, cmovcc_insn, (0x0EUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovnge, cmovcc_insn, (0x0CUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovnl, cmovcc_insn, (0x0DUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovnle, cmovcc_insn, (0x0FUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovno, cmovcc_insn, (0x01UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovnp, cmovcc_insn, (0x0BUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovns, cmovcc_insn, (0x09UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovnz, cmovcc_insn, (0x05UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovo, cmovcc_insn, (0x00UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovp, cmovcc_insn, (0x0AUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovpe, cmovcc_insn, (0x0AUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovpo, cmovcc_insn, (0x0BUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovs, cmovcc_insn, (0x08UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmovz, cmovcc_insn, (0x04UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE +cmp, arith_insn, (0x0738UL<<8)|NELEMS(arith_insn), CPU_Any, NONE +cmpeqpd, ssecmpss_insn, (0x0066UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE +cmpeqps, ssecmpps_insn, (0x00UL<<8)|NELEMS(ssecmpps_insn), CPU_SSE, NONE +cmpeqsd, ssecmpss_insn, (0x00F2UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE +cmpeqss, ssecmpss_insn, (0x00F3UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE, NONE +cmplepd, ssecmpss_insn, (0x0266UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE +cmpleps, ssecmpps_insn, (0x02UL<<8)|NELEMS(ssecmpps_insn), CPU_SSE, NONE +cmplesd, ssecmpss_insn, (0x02F2UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE +cmpless, ssecmpss_insn, (0x02F3UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE, NONE +cmpltpd, ssecmpss_insn, (0x0166UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE +cmpltps, ssecmpps_insn, (0x01UL<<8)|NELEMS(ssecmpps_insn), CPU_SSE, NONE +cmpltsd, ssecmpss_insn, (0x01F2UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE +cmpltss, ssecmpss_insn, (0x01F3UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE, NONE +cmpneqpd, ssecmpss_insn, (0x0466UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE +cmpneqps, ssecmpps_insn, (0x04UL<<8)|NELEMS(ssecmpps_insn), CPU_SSE, NONE +cmpneqsd, ssecmpss_insn, (0x04F2UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE +cmpneqss, ssecmpss_insn, (0x04F3UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE, NONE +cmpnlepd, ssecmpss_insn, (0x0666UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE +cmpnleps, ssecmpps_insn, (0x06UL<<8)|NELEMS(ssecmpps_insn), CPU_SSE, NONE +cmpnlesd, ssecmpss_insn, (0x06F2UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE +cmpnless, ssecmpss_insn, (0x06F3UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE, NONE +cmpnltpd, ssecmpss_insn, (0x0566UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE +cmpnltps, ssecmpps_insn, (0x05UL<<8)|NELEMS(ssecmpps_insn), CPU_SSE, NONE +cmpnltsd, ssecmpss_insn, (0x05F2UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE +cmpnltss, ssecmpss_insn, (0x05F3UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE, NONE +cmpordpd, ssecmpss_insn, (0x0766UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE +cmpordps, ssecmpps_insn, (0x07UL<<8)|NELEMS(ssecmpps_insn), CPU_SSE, NONE +cmpordsd, ssecmpss_insn, (0x07F2UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE +cmpordss, ssecmpss_insn, (0x07F3UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE, NONE +cmppd, ssessimm_insn, (0x66C2UL<<8)|NELEMS(ssessimm_insn), CPU_SSE2, NONE +cmpps, ssepsimm_insn, (0xC2UL<<8)|NELEMS(ssepsimm_insn), CPU_SSE, NONE +cmpsb, onebyte_insn, (0x0000A6UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +cmpsd, cmpsd_insn, (0UL<<8)|NELEMS(cmpsd_insn), CPU_Any, NONE +cmpsq, onebyte_insn, (0x0040A7UL<<8)|NELEMS(onebyte_insn), CPU_64, NONE +cmpss, ssessimm_insn, (0xF3C2UL<<8)|NELEMS(ssessimm_insn), CPU_SSE, NONE +cmpsw, onebyte_insn, (0x0010A7UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +cmpunordpd, ssecmpss_insn, (0x0366UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE +cmpunordps, ssecmpps_insn, (0x03UL<<8)|NELEMS(ssecmpps_insn), CPU_SSE, NONE +cmpunordsd, ssecmpss_insn, (0x03F2UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE +cmpunordss, ssecmpss_insn, (0x03F3UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE, NONE +cmpxchg, cmpxchgxadd_insn, (0xB0UL<<8)|NELEMS(cmpxchgxadd_insn), CPU_486, NONE +cmpxchg16b, cmpxchg16b_insn, (0UL<<8)|NELEMS(cmpxchg16b_insn), CPU_64, NONE +cmpxchg486, cmpxchgxadd_insn, (0xA6UL<<8)|NELEMS(cmpxchgxadd_insn), CPU_486|CPU_Undoc, NONE +cmpxchg8b, cmpxchg8b_insn, (0UL<<8)|NELEMS(cmpxchg8b_insn), CPU_586, NONE +comisd, ssess_insn, (0x662FUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +comiss, sseps_insn, (0x2FUL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE +cpuid, twobyte_insn, (0x0FA2UL<<8)|NELEMS(twobyte_insn), CPU_486, NONE +cqo, onebyte_insn, (0x004099UL<<8)|NELEMS(onebyte_insn), CPU_64, NONE +crc32, crc32_insn, (0UL<<8)|NELEMS(crc32_insn), CPU_386|CPU_SSE42, NONE +cvtdq2pd, cvt_xmm_xmm64_ss_insn, (0xF3E6UL<<8)|NELEMS(cvt_xmm_xmm64_ss_insn), CPU_SSE2, NONE +cvtdq2ps, sseps_insn, (0x5BUL<<8)|NELEMS(sseps_insn), CPU_SSE2, NONE +cvtpd2dq, ssess_insn, (0xF2E6UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +cvtpd2pi, cvt_mm_xmm_insn, (0x662DUL<<8)|NELEMS(cvt_mm_xmm_insn), CPU_SSE2, NONE +cvtpd2ps, ssess_insn, (0x665AUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +cvtpi2pd, cvt_xmm_mm_ss_insn, (0x662AUL<<8)|NELEMS(cvt_xmm_mm_ss_insn), CPU_SSE2, NONE +cvtpi2ps, cvt_xmm_mm_ps_insn, (0x2AUL<<8)|NELEMS(cvt_xmm_mm_ps_insn), CPU_SSE, NONE +cvtps2dq, ssess_insn, (0x665BUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +cvtps2pd, cvt_xmm_xmm64_ps_insn, (0x5AUL<<8)|NELEMS(cvt_xmm_xmm64_ps_insn), CPU_SSE2, NONE +cvtps2pi, cvt_mm_xmm64_insn, (0x2DUL<<8)|NELEMS(cvt_mm_xmm64_insn), CPU_SSE, NONE +cvtsd2si, cvt_rx_xmm64_insn, (0xF22DUL<<8)|NELEMS(cvt_rx_xmm64_insn), CPU_386|CPU_SSE2, NONE +cvtsd2ss, cvt_xmm_xmm64_ss_insn, (0xF25AUL<<8)|NELEMS(cvt_xmm_xmm64_ss_insn), CPU_SSE2, NONE +cvtsi2sd, cvt_xmm_rmx_insn, (0xF22AUL<<8)|NELEMS(cvt_xmm_rmx_insn), CPU_SSE2, NONE +cvtsi2ss, cvt_xmm_rmx_insn, (0xF32AUL<<8)|NELEMS(cvt_xmm_rmx_insn), CPU_386|CPU_SSE, NONE +cvtss2sd, cvt_xmm_xmm32_insn, (0xF35AUL<<8)|NELEMS(cvt_xmm_xmm32_insn), CPU_SSE2, NONE +cvtss2si, cvt_rx_xmm32_insn, (0xF32DUL<<8)|NELEMS(cvt_rx_xmm32_insn), CPU_386|CPU_SSE, NONE +cvttpd2dq, ssess_insn, (0x66E6UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +cvttpd2pi, cvt_mm_xmm_insn, (0x662CUL<<8)|NELEMS(cvt_mm_xmm_insn), CPU_SSE2, NONE +cvttps2dq, ssess_insn, (0xF35BUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +cvttps2pi, cvt_mm_xmm64_insn, (0x2CUL<<8)|NELEMS(cvt_mm_xmm64_insn), CPU_SSE, NONE +cvttsd2si, cvt_rx_xmm64_insn, (0xF22CUL<<8)|NELEMS(cvt_rx_xmm64_insn), CPU_SSE2, NONE +cvttss2si, cvt_rx_xmm32_insn, (0xF32CUL<<8)|NELEMS(cvt_rx_xmm32_insn), CPU_386|CPU_SSE, NONE +cwd, onebyte_insn, (0x001099UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +cwde, onebyte_insn, (0x002098UL<<8)|NELEMS(onebyte_insn), CPU_386, NONE +daa, onebyte_insn, (0x000027UL<<8)|NELEMS(onebyte_insn), CPU_Not64, NONE +das, onebyte_insn, (0x00002FUL<<8)|NELEMS(onebyte_insn), CPU_Not64, NONE +dec, incdec_insn, (0x0148UL<<8)|NELEMS(incdec_insn), CPU_Any, NONE +div, div_insn, (0x06UL<<8)|NELEMS(div_insn), CPU_Any, NONE +divpd, ssess_insn, (0x665EUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +divps, sseps_insn, (0x5EUL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE +divsd, ssess_insn, (0xF25EUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +divss, ssess_insn, (0xF35EUL<<8)|NELEMS(ssess_insn), CPU_SSE, NONE +dppd, sse4imm_insn, (0x41UL<<8)|NELEMS(sse4imm_insn), CPU_SSE41, NONE +dpps, sse4imm_insn, (0x40UL<<8)|NELEMS(sse4imm_insn), CPU_SSE41, NONE +emms, twobyte_insn, (0x0F77UL<<8)|NELEMS(twobyte_insn), CPU_MMX, NONE +enter, enter_insn, (0UL<<8)|NELEMS(enter_insn), CPU_186, NONE +extractps, extractps_insn, (0UL<<8)|NELEMS(extractps_insn), CPU_386|CPU_SSE41, NONE +extrq, extrq_insn, (0UL<<8)|NELEMS(extrq_insn), CPU_SSE41, NONE +f2xm1, twobyte_insn, (0xD9F0UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fabs, twobyte_insn, (0xD9E1UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fadd, farith_insn, (0x00C0C0UL<<8)|NELEMS(farith_insn), CPU_FPU, NONE +faddp, farithp_insn, (0xC0UL<<8)|NELEMS(farithp_insn), CPU_FPU, NONE +fbld, fbldstp_insn, (0x04UL<<8)|NELEMS(fbldstp_insn), CPU_FPU, NONE +fbstp, fbldstp_insn, (0x06UL<<8)|NELEMS(fbldstp_insn), CPU_FPU, NONE +fchs, twobyte_insn, (0xD9E0UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fclex, threebyte_insn, (0x9BDBE2UL<<8)|NELEMS(threebyte_insn), CPU_FPU, NONE +fcmovb, fcmovcc_insn, (0xDAC0UL<<8)|NELEMS(fcmovcc_insn), CPU_686|CPU_FPU, NONE +fcmovbe, fcmovcc_insn, (0xDAD0UL<<8)|NELEMS(fcmovcc_insn), CPU_686|CPU_FPU, NONE +fcmove, fcmovcc_insn, (0xDAC8UL<<8)|NELEMS(fcmovcc_insn), CPU_686|CPU_FPU, NONE +fcmovnb, fcmovcc_insn, (0xDBC0UL<<8)|NELEMS(fcmovcc_insn), CPU_686|CPU_FPU, NONE +fcmovnbe, fcmovcc_insn, (0xDBD0UL<<8)|NELEMS(fcmovcc_insn), CPU_686|CPU_FPU, NONE +fcmovne, fcmovcc_insn, (0xDBC8UL<<8)|NELEMS(fcmovcc_insn), CPU_686|CPU_FPU, NONE +fcmovnu, fcmovcc_insn, (0xDBD8UL<<8)|NELEMS(fcmovcc_insn), CPU_686|CPU_FPU, NONE +fcmovu, fcmovcc_insn, (0xDAD8UL<<8)|NELEMS(fcmovcc_insn), CPU_686|CPU_FPU, NONE +fcom, fcom_insn, (0x02D0UL<<8)|NELEMS(fcom_insn), CPU_FPU, NONE +fcomi, fcom2_insn, (0xDBF0UL<<8)|NELEMS(fcom2_insn), CPU_686|CPU_FPU, NONE +fcomip, fcom2_insn, (0xDFF0UL<<8)|NELEMS(fcom2_insn), CPU_686|CPU_FPU, NONE +fcomp, fcom_insn, (0x03D8UL<<8)|NELEMS(fcom_insn), CPU_FPU, NONE +fcompp, twobyte_insn, (0xDED9UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fcos, twobyte_insn, (0xD9FFUL<<8)|NELEMS(twobyte_insn), CPU_286|CPU_FPU, NONE +fdecstp, twobyte_insn, (0xD9F6UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fdiv, farith_insn, (0x06F0F8UL<<8)|NELEMS(farith_insn), CPU_FPU, NONE +fdivp, farithp_insn, (0xF8UL<<8)|NELEMS(farithp_insn), CPU_FPU, NONE +fdivr, farith_insn, (0x07F8F0UL<<8)|NELEMS(farith_insn), CPU_FPU, NONE +fdivrp, farithp_insn, (0xF0UL<<8)|NELEMS(farithp_insn), CPU_FPU, NONE +femms, twobyte_insn, (0x0F0EUL<<8)|NELEMS(twobyte_insn), CPU_3DNow, NONE +ffree, ffree_insn, (0xDDUL<<8)|NELEMS(ffree_insn), CPU_FPU, NONE +ffreep, ffree_insn, (0xDFUL<<8)|NELEMS(ffree_insn), CPU_686|CPU_FPU|CPU_Undoc, NONE +fiadd, fiarith_insn, (0x00DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, NONE +ficom, fiarith_insn, (0x02DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, NONE +ficomp, fiarith_insn, (0x03DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, NONE +fidiv, fiarith_insn, (0x06DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, NONE +fidivr, fiarith_insn, (0x07DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, NONE +fild, fildstp_insn, (0x050200UL<<8)|NELEMS(fildstp_insn), CPU_FPU, NONE +fimul, fiarith_insn, (0x01DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, NONE +fincstp, twobyte_insn, (0xD9F7UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +finit, threebyte_insn, (0x9BDBE3UL<<8)|NELEMS(threebyte_insn), CPU_FPU, NONE +fist, fiarith_insn, (0x02DBUL<<8)|NELEMS(fiarith_insn), CPU_FPU, NONE +fistp, fildstp_insn, (0x070203UL<<8)|NELEMS(fildstp_insn), CPU_FPU, NONE +fisttp, fildstp_insn, (0x010001UL<<8)|NELEMS(fildstp_insn), CPU_SSE3, NONE +fisub, fiarith_insn, (0x04DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, NONE +fisubr, fiarith_insn, (0x05DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, NONE +fld, fld_insn, (0UL<<8)|NELEMS(fld_insn), CPU_FPU, NONE +fld1, twobyte_insn, (0xD9E8UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fldcw, fldnstcw_insn, (0x05UL<<8)|NELEMS(fldnstcw_insn), CPU_FPU, NONE +fldenv, onebytemem_insn, (0x04D9UL<<8)|NELEMS(onebytemem_insn), CPU_FPU, NONE +fldl2e, twobyte_insn, (0xD9EAUL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fldl2t, twobyte_insn, (0xD9E9UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fldlg2, twobyte_insn, (0xD9ECUL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fldln2, twobyte_insn, (0xD9EDUL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fldpi, twobyte_insn, (0xD9EBUL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fldz, twobyte_insn, (0xD9EEUL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fmul, farith_insn, (0x01C8C8UL<<8)|NELEMS(farith_insn), CPU_FPU, NONE +fmulp, farithp_insn, (0xC8UL<<8)|NELEMS(farithp_insn), CPU_FPU, NONE +fnclex, twobyte_insn, (0xDBE2UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fninit, twobyte_insn, (0xDBE3UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fnop, twobyte_insn, (0xD9D0UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fnsave, onebytemem_insn, (0x06DDUL<<8)|NELEMS(onebytemem_insn), CPU_FPU, NONE +fnstcw, fldnstcw_insn, (0x07UL<<8)|NELEMS(fldnstcw_insn), CPU_FPU, NONE +fnstenv, onebytemem_insn, (0x06D9UL<<8)|NELEMS(onebytemem_insn), CPU_FPU, NONE +fnstsw, fnstsw_insn, (0UL<<8)|NELEMS(fnstsw_insn), CPU_FPU, NONE +fpatan, twobyte_insn, (0xD9F3UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fprem, twobyte_insn, (0xD9F8UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fprem1, twobyte_insn, (0xD9F5UL<<8)|NELEMS(twobyte_insn), CPU_286|CPU_FPU, NONE +fptan, twobyte_insn, (0xD9F2UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +frndint, twobyte_insn, (0xD9FCUL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +frstor, onebytemem_insn, (0x04DDUL<<8)|NELEMS(onebytemem_insn), CPU_FPU, NONE +fsave, twobytemem_insn, (0x069BDDUL<<8)|NELEMS(twobytemem_insn), CPU_FPU, NONE +fscale, twobyte_insn, (0xD9FDUL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fsetpm, twobyte_insn, (0xDBE4UL<<8)|NELEMS(twobyte_insn), CPU_286|CPU_FPU|CPU_Obs, NONE +fsin, twobyte_insn, (0xD9FEUL<<8)|NELEMS(twobyte_insn), CPU_286|CPU_FPU, NONE +fsincos, twobyte_insn, (0xD9FBUL<<8)|NELEMS(twobyte_insn), CPU_286|CPU_FPU, NONE +fsqrt, twobyte_insn, (0xD9FAUL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fst, fst_insn, (0UL<<8)|NELEMS(fst_insn), CPU_FPU, NONE +fstcw, fstcw_insn, (0UL<<8)|NELEMS(fstcw_insn), CPU_FPU, NONE +fstenv, twobytemem_insn, (0x069BD9UL<<8)|NELEMS(twobytemem_insn), CPU_FPU, NONE +fstp, fstp_insn, (0UL<<8)|NELEMS(fstp_insn), CPU_FPU, NONE +fstsw, fstsw_insn, (0UL<<8)|NELEMS(fstsw_insn), CPU_FPU, NONE +fsub, farith_insn, (0x04E0E8UL<<8)|NELEMS(farith_insn), CPU_FPU, NONE +fsubp, farithp_insn, (0xE8UL<<8)|NELEMS(farithp_insn), CPU_FPU, NONE +fsubr, farith_insn, (0x05E8E0UL<<8)|NELEMS(farith_insn), CPU_FPU, NONE +fsubrp, farithp_insn, (0xE0UL<<8)|NELEMS(farithp_insn), CPU_FPU, NONE +ftst, twobyte_insn, (0xD9E4UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fucom, fcom2_insn, (0xDDE0UL<<8)|NELEMS(fcom2_insn), CPU_286|CPU_FPU, NONE +fucomi, fcom2_insn, (0xDBE8UL<<8)|NELEMS(fcom2_insn), CPU_686|CPU_FPU, NONE +fucomip, fcom2_insn, (0xDFE8UL<<8)|NELEMS(fcom2_insn), CPU_686|CPU_FPU, NONE +fucomp, fcom2_insn, (0xDDE8UL<<8)|NELEMS(fcom2_insn), CPU_286|CPU_FPU, NONE +fucompp, twobyte_insn, (0xDAE9UL<<8)|NELEMS(twobyte_insn), CPU_286|CPU_FPU, NONE +fwait, onebyte_insn, (0x00009BUL<<8)|NELEMS(onebyte_insn), CPU_FPU, NONE +fxam, twobyte_insn, (0xD9E5UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fxch, fxch_insn, (0UL<<8)|NELEMS(fxch_insn), CPU_FPU, NONE +fxrstor, twobytemem_insn, (0x010FAEUL<<8)|NELEMS(twobytemem_insn), CPU_686|CPU_FPU, NONE +fxsave, twobytemem_insn, (0x000FAEUL<<8)|NELEMS(twobytemem_insn), CPU_686|CPU_FPU, NONE +fxtract, twobyte_insn, (0xD9F4UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fyl2x, twobyte_insn, (0xD9F1UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +fyl2xp1, twobyte_insn, (0xD9F9UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE +haddpd, ssess_insn, (0x667CUL<<8)|NELEMS(ssess_insn), CPU_SSE3, NONE +haddps, ssess_insn, (0xF27CUL<<8)|NELEMS(ssess_insn), CPU_SSE3, NONE +hlt, onebyte_insn, (0x0000F4UL<<8)|NELEMS(onebyte_insn), CPU_Priv, NONE +hsubpd, ssess_insn, (0x667DUL<<8)|NELEMS(ssess_insn), CPU_SSE3, NONE +hsubps, ssess_insn, (0xF27DUL<<8)|NELEMS(ssess_insn), CPU_SSE3, NONE +ibts, ibts_insn, (0UL<<8)|NELEMS(ibts_insn), CPU_386|CPU_Obs|CPU_Undoc, NONE +idiv, div_insn, (0x07UL<<8)|NELEMS(div_insn), CPU_Any, NONE +imul, imul_insn, (0UL<<8)|NELEMS(imul_insn), CPU_Any, NONE +in, in_insn, (0UL<<8)|NELEMS(in_insn), CPU_Any, NONE +inc, incdec_insn, (0x0040UL<<8)|NELEMS(incdec_insn), CPU_Any, NONE +insb, onebyte_insn, (0x00006CUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +insd, onebyte_insn, (0x00206DUL<<8)|NELEMS(onebyte_insn), CPU_386, NONE +insertps, insertps_insn, (0UL<<8)|NELEMS(insertps_insn), CPU_SSE41, NONE +insertq, insertq_insn, (0UL<<8)|NELEMS(insertq_insn), CPU_SSE41, NONE +insw, onebyte_insn, (0x00106DUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +int, int_insn, (0UL<<8)|NELEMS(int_insn), CPU_Any, NONE +int03, onebyte_insn, (0x0000CCUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +int3, onebyte_insn, (0x0000CCUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +into, onebyte_insn, (0x0000CEUL<<8)|NELEMS(onebyte_insn), CPU_Not64, NONE +invd, twobyte_insn, (0x0F08UL<<8)|NELEMS(twobyte_insn), CPU_486|CPU_Priv, NONE +invlpg, twobytemem_insn, (0x070F01UL<<8)|NELEMS(twobytemem_insn), CPU_486|CPU_Priv, NONE +invlpga, invlpga_insn, (0UL<<8)|NELEMS(invlpga_insn), CPU_SVM, NONE +iret, onebyte_insn, (0x0000CFUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +iretd, onebyte_insn, (0x0020CFUL<<8)|NELEMS(onebyte_insn), CPU_386, NONE +iretq, onebyte_insn, (0x0040CFUL<<8)|NELEMS(onebyte_insn), CPU_64, NONE +iretw, onebyte_insn, (0x0010CFUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +ja, jcc_insn, (0x07UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jae, jcc_insn, (0x03UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jb, jcc_insn, (0x02UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jbe, jcc_insn, (0x06UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jc, jcc_insn, (0x02UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jcxz, jcxz_insn, (0x10UL<<8)|NELEMS(jcxz_insn), CPU_Any, NONE +je, jcc_insn, (0x04UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jecxz, jcxz_insn, (0x20UL<<8)|NELEMS(jcxz_insn), CPU_386, NONE +jg, jcc_insn, (0x0FUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jge, jcc_insn, (0x0DUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jl, jcc_insn, (0x0CUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jle, jcc_insn, (0x0EUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jmp, jmp_insn, (0UL<<8)|NELEMS(jmp_insn), CPU_Any, NONE +jna, jcc_insn, (0x06UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jnae, jcc_insn, (0x02UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jnb, jcc_insn, (0x03UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jnbe, jcc_insn, (0x07UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jnc, jcc_insn, (0x03UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jne, jcc_insn, (0x05UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jng, jcc_insn, (0x0EUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jnge, jcc_insn, (0x0CUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jnl, jcc_insn, (0x0DUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jnle, jcc_insn, (0x0FUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jno, jcc_insn, (0x01UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jnp, jcc_insn, (0x0BUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jns, jcc_insn, (0x09UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jnz, jcc_insn, (0x05UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jo, jcc_insn, (0x00UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jp, jcc_insn, (0x0AUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jpe, jcc_insn, (0x0AUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jpo, jcc_insn, (0x0BUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jrcxz, jcxz_insn, (0x40UL<<8)|NELEMS(jcxz_insn), CPU_64, NONE +js, jcc_insn, (0x08UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +jz, jcc_insn, (0x04UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE +lahf, onebyte_insn, (0x00009FUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +lar, bsfr_insn, (0x02UL<<8)|NELEMS(bsfr_insn), CPU_286|CPU_Prot, NONE +lddqu, lddqu_insn, (0UL<<8)|NELEMS(lddqu_insn), CPU_SSE3, NONE +ldmxcsr, ldstmxcsr_insn, (0x02UL<<8)|NELEMS(ldstmxcsr_insn), CPU_SSE, NONE +lds, ldes_insn, (0xC5UL<<8)|NELEMS(ldes_insn), CPU_Not64, NONE +lea, lea_insn, (0UL<<8)|NELEMS(lea_insn), CPU_Any, NONE +leave, onebyte_insn, (0x4000C9UL<<8)|NELEMS(onebyte_insn), CPU_186, NONE +les, ldes_insn, (0xC4UL<<8)|NELEMS(ldes_insn), CPU_Not64, NONE +lfence, threebyte_insn, (0x0FAEE8UL<<8)|NELEMS(threebyte_insn), CPU_P3, NONE +lfs, lfgss_insn, (0xB4UL<<8)|NELEMS(lfgss_insn), CPU_386, NONE +lgdt, twobytemem_insn, (0x020F01UL<<8)|NELEMS(twobytemem_insn), CPU_286|CPU_Priv, NONE +lgs, lfgss_insn, (0xB5UL<<8)|NELEMS(lfgss_insn), CPU_386, NONE +lidt, twobytemem_insn, (0x030F01UL<<8)|NELEMS(twobytemem_insn), CPU_286|CPU_Priv, NONE +lldt, prot286_insn, (0x0200UL<<8)|NELEMS(prot286_insn), CPU_286|CPU_Priv|CPU_Prot, NONE +lmsw, prot286_insn, (0x0601UL<<8)|NELEMS(prot286_insn), CPU_286|CPU_Priv, NONE +loadall, twobyte_insn, (0x0F07UL<<8)|NELEMS(twobyte_insn), CPU_386|CPU_Undoc, NONE +loadall286, twobyte_insn, (0x0F05UL<<8)|NELEMS(twobyte_insn), CPU_286|CPU_Undoc, NONE +lock, NULL, X86_LOCKREP, 0xF0, NONE +lodsb, onebyte_insn, (0x0000ACUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +lodsd, onebyte_insn, (0x0020ADUL<<8)|NELEMS(onebyte_insn), CPU_386, NONE +lodsq, onebyte_insn, (0x0040ADUL<<8)|NELEMS(onebyte_insn), CPU_64, NONE +lodsw, onebyte_insn, (0x0010ADUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +loop, loop_insn, (0x02UL<<8)|NELEMS(loop_insn), CPU_Any, NONE +loope, loop_insn, (0x01UL<<8)|NELEMS(loop_insn), CPU_Any, NONE +loopne, loop_insn, (0x00UL<<8)|NELEMS(loop_insn), CPU_Any, NONE +loopnz, loop_insn, (0x00UL<<8)|NELEMS(loop_insn), CPU_Any, NONE +loopz, loop_insn, (0x01UL<<8)|NELEMS(loop_insn), CPU_Any, NONE +lsl, bsfr_insn, (0x03UL<<8)|NELEMS(bsfr_insn), CPU_286|CPU_Prot, NONE +lss, lfgss_insn, (0xB2UL<<8)|NELEMS(lfgss_insn), CPU_386, NONE +ltr, prot286_insn, (0x0300UL<<8)|NELEMS(prot286_insn), CPU_286|CPU_Priv|CPU_Prot, NONE +lzcnt, cnt_insn, (0xBDUL<<8)|NELEMS(cnt_insn), CPU_686|CPU_AMD, NONE +maskmovdqu, maskmovdqu_insn, (0UL<<8)|NELEMS(maskmovdqu_insn), CPU_SSE2, NONE +maskmovq, maskmovq_insn, (0UL<<8)|NELEMS(maskmovq_insn), CPU_MMX|CPU_P3, NONE +maxpd, ssess_insn, (0x665FUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +maxps, sseps_insn, (0x5FUL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE +maxsd, ssess_insn, (0xF25FUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +maxss, ssess_insn, (0xF35FUL<<8)|NELEMS(ssess_insn), CPU_SSE, NONE +mfence, threebyte_insn, (0x0FAEF0UL<<8)|NELEMS(threebyte_insn), CPU_P3, NONE +minpd, ssess_insn, (0x665DUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +minps, sseps_insn, (0x5DUL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE +minsd, ssess_insn, (0xF25DUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +minss, ssess_insn, (0xF35DUL<<8)|NELEMS(ssess_insn), CPU_SSE, NONE +monitor, threebyte_insn, (0x0F01C8UL<<8)|NELEMS(threebyte_insn), CPU_SSE3, NONE +montmul, padlock_insn, (0xC0F3A6UL<<8)|NELEMS(padlock_insn), CPU_PadLock, NONE +mov, mov_insn, (0UL<<8)|NELEMS(mov_insn), CPU_Any, NONE +movapd, movaupd_insn, (0x28UL<<8)|NELEMS(movaupd_insn), CPU_SSE2, NONE +movaps, movaups_insn, (0x28UL<<8)|NELEMS(movaups_insn), CPU_SSE, NONE +movd, movd_insn, (0UL<<8)|NELEMS(movd_insn), CPU_386|CPU_MMX, NONE +movddup, cvt_xmm_xmm64_ss_insn, (0xF212UL<<8)|NELEMS(cvt_xmm_xmm64_ss_insn), CPU_SSE3, NONE +movdq2q, movdq2q_insn, (0UL<<8)|NELEMS(movdq2q_insn), CPU_SSE2, NONE +movdqa, movdqau_insn, (0x66UL<<8)|NELEMS(movdqau_insn), CPU_SSE2, NONE +movdqu, movdqau_insn, (0xF3UL<<8)|NELEMS(movdqau_insn), CPU_SSE2, NONE +movhlps, movhllhps_insn, (0x12UL<<8)|NELEMS(movhllhps_insn), CPU_SSE, NONE +movhpd, movhlpd_insn, (0x16UL<<8)|NELEMS(movhlpd_insn), CPU_SSE2, NONE +movhps, movhlps_insn, (0x16UL<<8)|NELEMS(movhlps_insn), CPU_SSE, NONE +movlhps, movhllhps_insn, (0x16UL<<8)|NELEMS(movhllhps_insn), CPU_SSE, NONE +movlpd, movhlpd_insn, (0x12UL<<8)|NELEMS(movhlpd_insn), CPU_SSE2, NONE +movlps, movhlps_insn, (0x12UL<<8)|NELEMS(movhlps_insn), CPU_SSE, NONE +movmskpd, movmskpd_insn, (0UL<<8)|NELEMS(movmskpd_insn), CPU_386|CPU_SSE2, NONE +movmskps, movmskps_insn, (0UL<<8)|NELEMS(movmskps_insn), CPU_386|CPU_SSE, NONE +movntdq, movntpddq_insn, (0xE7UL<<8)|NELEMS(movntpddq_insn), CPU_SSE2, NONE +movntdqa, movntdqa_insn, (0UL<<8)|NELEMS(movntdqa_insn), CPU_SSE41, NONE +movnti, movnti_insn, (0UL<<8)|NELEMS(movnti_insn), CPU_P4, NONE +movntpd, movntpddq_insn, (0x2BUL<<8)|NELEMS(movntpddq_insn), CPU_SSE2, NONE +movntps, movntps_insn, (0UL<<8)|NELEMS(movntps_insn), CPU_SSE, NONE +movntq, movntq_insn, (0UL<<8)|NELEMS(movntq_insn), CPU_SSE, NONE +movntsd, movntsd_insn, (0UL<<8)|NELEMS(movntsd_insn), CPU_SSE41, NONE +movntss, movntss_insn, (0UL<<8)|NELEMS(movntss_insn), CPU_SSE41, NONE +movq, movq_insn, (0UL<<8)|NELEMS(movq_insn), CPU_MMX, NONE +movq2dq, movq2dq_insn, (0UL<<8)|NELEMS(movq2dq_insn), CPU_SSE2, NONE +movsb, onebyte_insn, (0x0000A4UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +movsd, movsd_insn, (0UL<<8)|NELEMS(movsd_insn), CPU_386, NONE +movshdup, ssess_insn, (0xF316UL<<8)|NELEMS(ssess_insn), CPU_SSE3, NONE +movsldup, ssess_insn, (0xF312UL<<8)|NELEMS(ssess_insn), CPU_SSE3, NONE +movsq, onebyte_insn, (0x0040A5UL<<8)|NELEMS(onebyte_insn), CPU_64, NONE +movss, movss_insn, (0UL<<8)|NELEMS(movss_insn), CPU_SSE, NONE +movsw, onebyte_insn, (0x0010A5UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +movsx, movszx_insn, (0xBEUL<<8)|NELEMS(movszx_insn), CPU_386, NONE +movsxd, movsxd_insn, (0UL<<8)|NELEMS(movsxd_insn), CPU_64, NONE +movupd, movaupd_insn, (0x10UL<<8)|NELEMS(movaupd_insn), CPU_SSE2, NONE +movups, movaups_insn, (0x10UL<<8)|NELEMS(movaups_insn), CPU_SSE, NONE +movzx, movszx_insn, (0xB6UL<<8)|NELEMS(movszx_insn), CPU_386, NONE +mpsadbw, sse4imm_insn, (0x42UL<<8)|NELEMS(sse4imm_insn), CPU_SSE41, NONE +mul, f6_insn, (0x04UL<<8)|NELEMS(f6_insn), CPU_Any, NONE +mulpd, ssess_insn, (0x6659UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +mulps, sseps_insn, (0x59UL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE +mulsd, ssess_insn, (0xF259UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +mulss, ssess_insn, (0xF359UL<<8)|NELEMS(ssess_insn), CPU_SSE, NONE +mwait, threebyte_insn, (0x0F01C9UL<<8)|NELEMS(threebyte_insn), CPU_SSE3, NONE +neg, f6_insn, (0x03UL<<8)|NELEMS(f6_insn), CPU_Any, NONE +nop, onebyte_insn, (0x000090UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +not, f6_insn, (0x02UL<<8)|NELEMS(f6_insn), CPU_Any, NONE +o16, NULL, X86_OPERSIZE, 0x10, NONE +o32, NULL, X86_OPERSIZE, 0x20, NONE +o64, NULL, X86_OPERSIZE, 0x40, NONE +or, arith_insn, (0x0108UL<<8)|NELEMS(arith_insn), CPU_Any, NONE +orpd, ssess_insn, (0x6656UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +orps, sseps_insn, (0x56UL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE +out, out_insn, (0UL<<8)|NELEMS(out_insn), CPU_Any, NONE +outsb, onebyte_insn, (0x00006EUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +outsd, onebyte_insn, (0x00206FUL<<8)|NELEMS(onebyte_insn), CPU_386, NONE +outsw, onebyte_insn, (0x00106FUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +pabsb, ssse3_insn, (0x1CUL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE +pabsd, ssse3_insn, (0x1EUL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE +pabsw, ssse3_insn, (0x1DUL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE +packssdw, mmxsse2_insn, (0x6BUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +packsswb, mmxsse2_insn, (0x63UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +packusdw, sse4_insn, (0x2BUL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE +packuswb, mmxsse2_insn, (0x67UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +paddb, mmxsse2_insn, (0xFCUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +paddd, mmxsse2_insn, (0xFEUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +paddq, mmxsse2_insn, (0xD4UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +paddsb, mmxsse2_insn, (0xECUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +paddsiw, cyrixmmx_insn, (0x51UL<<8)|NELEMS(cyrixmmx_insn), CPU_Cyrix|CPU_MMX, NONE +paddsw, mmxsse2_insn, (0xEDUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +paddusb, mmxsse2_insn, (0xDCUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +paddusw, mmxsse2_insn, (0xDDUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +paddw, mmxsse2_insn, (0xFDUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +palignr, ssse3imm_insn, (0x0FUL<<8)|NELEMS(ssse3imm_insn), CPU_SSSE3, NONE +pand, mmxsse2_insn, (0xDBUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +pandn, mmxsse2_insn, (0xDFUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +pause, onebyte_prefix_insn, (0xF390UL<<8)|NELEMS(onebyte_prefix_insn), CPU_P4, NONE +paveb, cyrixmmx_insn, (0x50UL<<8)|NELEMS(cyrixmmx_insn), CPU_Cyrix|CPU_MMX, NONE +pavgb, mmxsse2_insn, (0xE0UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX|CPU_P3, NONE +pavgusb, now3d_insn, (0xBFUL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE +pavgw, mmxsse2_insn, (0xE3UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX|CPU_P3, NONE +pblendvb, sse4xmm0_insn, (0x10UL<<8)|NELEMS(sse4xmm0_insn), CPU_SSE41, NONE +pblendw, sse4imm_insn, (0x0EUL<<8)|NELEMS(sse4imm_insn), CPU_SSE41, NONE +pcmpeqb, mmxsse2_insn, (0x74UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +pcmpeqd, mmxsse2_insn, (0x76UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +pcmpeqq, sse4_insn, (0x29UL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE +pcmpeqw, mmxsse2_insn, (0x75UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +pcmpestri, sse4pcmpstr_insn, (0x61UL<<8)|NELEMS(sse4pcmpstr_insn), CPU_SSE42, NONE +pcmpestrm, sse4pcmpstr_insn, (0x60UL<<8)|NELEMS(sse4pcmpstr_insn), CPU_SSE42, NONE +pcmpgtb, mmxsse2_insn, (0x64UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +pcmpgtd, mmxsse2_insn, (0x66UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +pcmpgtq, sse4_insn, (0x37UL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE +pcmpgtw, mmxsse2_insn, (0x65UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +pcmpistri, sse4pcmpstr_insn, (0x63UL<<8)|NELEMS(sse4pcmpstr_insn), CPU_SSE42, NONE +pcmpistrm, sse4pcmpstr_insn, (0x62UL<<8)|NELEMS(sse4pcmpstr_insn), CPU_SSE42, NONE +pdistib, cyrixmmx_insn, (0x54UL<<8)|NELEMS(cyrixmmx_insn), CPU_Cyrix|CPU_MMX, NONE +pextrb, pextrb_insn, (0UL<<8)|NELEMS(pextrb_insn), CPU_SSE41, NONE +pextrd, pextrd_insn, (0UL<<8)|NELEMS(pextrd_insn), CPU_386|CPU_SSE41, NONE +pextrq, pextrq_insn, (0UL<<8)|NELEMS(pextrq_insn), CPU_64|CPU_SSE41, NONE +pextrw, pextrw_insn, (0UL<<8)|NELEMS(pextrw_insn), CPU_MMX|CPU_P3, NONE +pf2id, now3d_insn, (0x1DUL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE +pf2iw, now3d_insn, (0x1CUL<<8)|NELEMS(now3d_insn), CPU_3DNow|CPU_Athlon, NONE +pfacc, now3d_insn, (0xAEUL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE +pfadd, now3d_insn, (0x9EUL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE +pfcmpeq, now3d_insn, (0xB0UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE +pfcmpge, now3d_insn, (0x90UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE +pfcmpgt, now3d_insn, (0xA0UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE +pfmax, now3d_insn, (0xA4UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE +pfmin, now3d_insn, (0x94UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE +pfmul, now3d_insn, (0xB4UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE +pfnacc, now3d_insn, (0x8AUL<<8)|NELEMS(now3d_insn), CPU_3DNow|CPU_Athlon, NONE +pfpnacc, now3d_insn, (0x8EUL<<8)|NELEMS(now3d_insn), CPU_3DNow|CPU_Athlon, NONE +pfrcp, now3d_insn, (0x96UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE +pfrcpit1, now3d_insn, (0xA6UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE +pfrcpit2, now3d_insn, (0xB6UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE +pfrsqit1, now3d_insn, (0xA7UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE +pfrsqrt, now3d_insn, (0x97UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE +pfsub, now3d_insn, (0x9AUL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE +pfsubr, now3d_insn, (0xAAUL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE +phaddd, ssse3_insn, (0x02UL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE +phaddsw, ssse3_insn, (0x03UL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE +phaddw, ssse3_insn, (0x01UL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE +phminposuw, sse4_insn, (0x41UL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE +phsubd, ssse3_insn, (0x06UL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE +phsubsw, ssse3_insn, (0x07UL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE +phsubw, ssse3_insn, (0x05UL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE +pi2fd, now3d_insn, (0x0DUL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE +pi2fw, now3d_insn, (0x0CUL<<8)|NELEMS(now3d_insn), CPU_3DNow|CPU_Athlon, NONE +pinsrb, pinsrb_insn, (0UL<<8)|NELEMS(pinsrb_insn), CPU_SSE41, NONE +pinsrd, pinsrd_insn, (0UL<<8)|NELEMS(pinsrd_insn), CPU_386|CPU_SSE41, NONE +pinsrq, pinsrq_insn, (0UL<<8)|NELEMS(pinsrq_insn), CPU_64|CPU_SSE41, NONE +pinsrw, pinsrw_insn, (0UL<<8)|NELEMS(pinsrw_insn), CPU_MMX|CPU_P3, NONE +pmachriw, pmachriw_insn, (0UL<<8)|NELEMS(pmachriw_insn), CPU_Cyrix|CPU_MMX, NONE +pmaddubsw, ssse3_insn, (0x04UL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE +pmaddwd, mmxsse2_insn, (0xF5UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +pmagw, cyrixmmx_insn, (0x52UL<<8)|NELEMS(cyrixmmx_insn), CPU_Cyrix|CPU_MMX, NONE +pmaxsb, sse4_insn, (0x3CUL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE +pmaxsd, sse4_insn, (0x3DUL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE +pmaxsw, mmxsse2_insn, (0xEEUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX|CPU_P3, NONE +pmaxub, mmxsse2_insn, (0xDEUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX|CPU_P3, NONE +pmaxud, sse4_insn, (0x3FUL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE +pmaxuw, sse4_insn, (0x3EUL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE +pminsb, sse4_insn, (0x38UL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE +pminsd, sse4_insn, (0x39UL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE +pminsw, mmxsse2_insn, (0xEAUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX|CPU_P3, NONE +pminub, mmxsse2_insn, (0xDAUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX|CPU_P3, NONE +pminud, sse4_insn, (0x3BUL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE +pminuw, sse4_insn, (0x3AUL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE +pmovmskb, pmovmskb_insn, (0UL<<8)|NELEMS(pmovmskb_insn), CPU_MMX|CPU_P3, NONE +pmovsxbd, sse4m32_insn, (0x21UL<<8)|NELEMS(sse4m32_insn), CPU_SSE41, NONE +pmovsxbq, sse4m16_insn, (0x22UL<<8)|NELEMS(sse4m16_insn), CPU_SSE41, NONE +pmovsxbw, sse4m64_insn, (0x20UL<<8)|NELEMS(sse4m64_insn), CPU_SSE41, NONE +pmovsxdq, sse4m64_insn, (0x25UL<<8)|NELEMS(sse4m64_insn), CPU_SSE41, NONE +pmovsxwd, sse4m64_insn, (0x23UL<<8)|NELEMS(sse4m64_insn), CPU_SSE41, NONE +pmovsxwq, sse4m32_insn, (0x24UL<<8)|NELEMS(sse4m32_insn), CPU_SSE41, NONE +pmovzxbd, sse4m32_insn, (0x31UL<<8)|NELEMS(sse4m32_insn), CPU_SSE41, NONE +pmovzxbq, sse4m16_insn, (0x32UL<<8)|NELEMS(sse4m16_insn), CPU_SSE41, NONE +pmovzxbw, sse4m64_insn, (0x30UL<<8)|NELEMS(sse4m64_insn), CPU_SSE41, NONE +pmovzxdq, sse4m64_insn, (0x35UL<<8)|NELEMS(sse4m64_insn), CPU_SSE41, NONE +pmovzxwd, sse4m64_insn, (0x33UL<<8)|NELEMS(sse4m64_insn), CPU_SSE41, NONE +pmovzxwq, sse4m32_insn, (0x34UL<<8)|NELEMS(sse4m32_insn), CPU_SSE41, NONE +pmuldq, sse4_insn, (0x28UL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE +pmulhriw, cyrixmmx_insn, (0x5DUL<<8)|NELEMS(cyrixmmx_insn), CPU_Cyrix|CPU_MMX, NONE +pmulhrsw, ssse3_insn, (0x0BUL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE +pmulhrwa, now3d_insn, (0xB7UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE +pmulhrwc, cyrixmmx_insn, (0x59UL<<8)|NELEMS(cyrixmmx_insn), CPU_Cyrix|CPU_MMX, NONE +pmulhuw, mmxsse2_insn, (0xE4UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX|CPU_P3, NONE +pmulhw, mmxsse2_insn, (0xE5UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +pmulld, sse4_insn, (0x40UL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE +pmullw, mmxsse2_insn, (0xD5UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +pmuludq, mmxsse2_insn, (0xF4UL<<8)|NELEMS(mmxsse2_insn), CPU_SSE2, NONE +pmvgezb, cyrixmmx_insn, (0x5CUL<<8)|NELEMS(cyrixmmx_insn), CPU_Cyrix|CPU_MMX, NONE +pmvlzb, cyrixmmx_insn, (0x5BUL<<8)|NELEMS(cyrixmmx_insn), CPU_Cyrix|CPU_MMX, NONE +pmvnzb, cyrixmmx_insn, (0x5AUL<<8)|NELEMS(cyrixmmx_insn), CPU_Cyrix|CPU_MMX, NONE +pmvzb, cyrixmmx_insn, (0x58UL<<8)|NELEMS(cyrixmmx_insn), CPU_Cyrix|CPU_MMX, NONE +pop, pop_insn, (0UL<<8)|NELEMS(pop_insn), CPU_Any, NONE +popa, onebyte_insn, (0x000061UL<<8)|NELEMS(onebyte_insn), CPU_186|CPU_Not64, NONE +popad, onebyte_insn, (0x002061UL<<8)|NELEMS(onebyte_insn), CPU_386|CPU_Not64, NONE +popaw, onebyte_insn, (0x001061UL<<8)|NELEMS(onebyte_insn), CPU_186|CPU_Not64, NONE +popcnt, cnt_insn, (0xB8UL<<8)|NELEMS(cnt_insn), CPU_SSE42, NONE +popf, onebyte_insn, (0x40009DUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +popfd, onebyte_insn, (0x00209DUL<<8)|NELEMS(onebyte_insn), CPU_386|CPU_Not64, NONE +popfq, onebyte_insn, (0x40409DUL<<8)|NELEMS(onebyte_insn), CPU_64, NONE +popfw, onebyte_insn, (0x40109DUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +por, mmxsse2_insn, (0xEBUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +prefetch, twobytemem_insn, (0x000F0DUL<<8)|NELEMS(twobytemem_insn), CPU_3DNow, NONE +prefetchnta, twobytemem_insn, (0x000F18UL<<8)|NELEMS(twobytemem_insn), CPU_P3, NONE +prefetcht0, twobytemem_insn, (0x010F18UL<<8)|NELEMS(twobytemem_insn), CPU_P3, NONE +prefetcht1, twobytemem_insn, (0x020F18UL<<8)|NELEMS(twobytemem_insn), CPU_P3, NONE +prefetcht2, twobytemem_insn, (0x030F18UL<<8)|NELEMS(twobytemem_insn), CPU_P3, NONE +prefetchw, twobytemem_insn, (0x010F0DUL<<8)|NELEMS(twobytemem_insn), CPU_3DNow, NONE +psadbw, mmxsse2_insn, (0xF6UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX|CPU_P3, NONE +pshufb, ssse3_insn, (0x00UL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE +pshufd, ssessimm_insn, (0x6670UL<<8)|NELEMS(ssessimm_insn), CPU_SSE2, NONE +pshufhw, ssessimm_insn, (0xF370UL<<8)|NELEMS(ssessimm_insn), CPU_SSE2, NONE +pshuflw, ssessimm_insn, (0xF270UL<<8)|NELEMS(ssessimm_insn), CPU_SSE2, NONE +pshufw, pshufw_insn, (0UL<<8)|NELEMS(pshufw_insn), CPU_MMX|CPU_P3, NONE +psignb, ssse3_insn, (0x08UL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE +psignd, ssse3_insn, (0x0AUL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE +psignw, ssse3_insn, (0x09UL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE +pslld, pshift_insn, (0x0672F2UL<<8)|NELEMS(pshift_insn), CPU_MMX, NONE +pslldq, pslrldq_insn, (0x07UL<<8)|NELEMS(pslrldq_insn), CPU_SSE2, NONE +psllq, pshift_insn, (0x0673F3UL<<8)|NELEMS(pshift_insn), CPU_MMX, NONE +psllw, pshift_insn, (0x0671F1UL<<8)|NELEMS(pshift_insn), CPU_MMX, NONE +psrad, pshift_insn, (0x0472E2UL<<8)|NELEMS(pshift_insn), CPU_MMX, NONE +psraw, pshift_insn, (0x0471E1UL<<8)|NELEMS(pshift_insn), CPU_MMX, NONE +psrld, pshift_insn, (0x0272D2UL<<8)|NELEMS(pshift_insn), CPU_MMX, NONE +psrldq, pslrldq_insn, (0x03UL<<8)|NELEMS(pslrldq_insn), CPU_SSE2, NONE +psrlq, pshift_insn, (0x0273D3UL<<8)|NELEMS(pshift_insn), CPU_MMX, NONE +psrlw, pshift_insn, (0x0271D1UL<<8)|NELEMS(pshift_insn), CPU_MMX, NONE +psubb, mmxsse2_insn, (0xF8UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +psubd, mmxsse2_insn, (0xFAUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +psubq, mmxsse2_insn, (0xFBUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +psubsb, mmxsse2_insn, (0xE8UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +psubsiw, cyrixmmx_insn, (0x55UL<<8)|NELEMS(cyrixmmx_insn), CPU_Cyrix|CPU_MMX, NONE +psubsw, mmxsse2_insn, (0xE9UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +psubusb, mmxsse2_insn, (0xD8UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +psubusw, mmxsse2_insn, (0xD9UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +psubw, mmxsse2_insn, (0xF9UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +pswapd, now3d_insn, (0xBBUL<<8)|NELEMS(now3d_insn), CPU_3DNow|CPU_Athlon, NONE +ptest, sse4_insn, (0x17UL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE +punpckhbw, mmxsse2_insn, (0x68UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +punpckhdq, mmxsse2_insn, (0x6AUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +punpckhqdq, ssess_insn, (0x666DUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +punpckhwd, mmxsse2_insn, (0x69UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +punpcklbw, mmxsse2_insn, (0x60UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +punpckldq, mmxsse2_insn, (0x62UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +punpcklqdq, ssess_insn, (0x666CUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +punpcklwd, mmxsse2_insn, (0x61UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +push, push_insn, (0UL<<8)|NELEMS(push_insn), CPU_Any, NONE +pusha, onebyte_insn, (0x000060UL<<8)|NELEMS(onebyte_insn), CPU_186|CPU_Not64, NONE +pushad, onebyte_insn, (0x002060UL<<8)|NELEMS(onebyte_insn), CPU_386|CPU_Not64, NONE +pushaw, onebyte_insn, (0x001060UL<<8)|NELEMS(onebyte_insn), CPU_186|CPU_Not64, NONE +pushf, onebyte_insn, (0x40009CUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +pushfd, onebyte_insn, (0x00209CUL<<8)|NELEMS(onebyte_insn), CPU_386|CPU_Not64, NONE +pushfq, onebyte_insn, (0x40409CUL<<8)|NELEMS(onebyte_insn), CPU_64, NONE +pushfw, onebyte_insn, (0x40109CUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +pxor, mmxsse2_insn, (0xEFUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +rcl, shift_insn, (0x02UL<<8)|NELEMS(shift_insn), CPU_Any, NONE +rcpps, sseps_insn, (0x53UL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE +rcpss, ssess_insn, (0xF353UL<<8)|NELEMS(ssess_insn), CPU_SSE, NONE +rcr, shift_insn, (0x03UL<<8)|NELEMS(shift_insn), CPU_Any, NONE +rdmsr, twobyte_insn, (0x0F32UL<<8)|NELEMS(twobyte_insn), CPU_586|CPU_Priv, NONE +rdpmc, twobyte_insn, (0x0F33UL<<8)|NELEMS(twobyte_insn), CPU_686, NONE +rdshr, rdwrshr_insn, (0x00UL<<8)|NELEMS(rdwrshr_insn), CPU_686|CPU_Cyrix|CPU_SMM, NONE +rdtsc, twobyte_insn, (0x0F31UL<<8)|NELEMS(twobyte_insn), CPU_586, NONE +rdtscp, threebyte_insn, (0x0F01F9UL<<8)|NELEMS(threebyte_insn), CPU_686|CPU_AMD|CPU_Priv, NONE +rep, NULL, X86_LOCKREP, 0xF3, NONE +repe, NULL, X86_LOCKREP, 0xF3, NONE +repne, NULL, X86_LOCKREP, 0xF2, NONE +repnz, NULL, X86_LOCKREP, 0xF2, NONE +repz, NULL, X86_LOCKREP, 0xF3, NONE +ret, retnf_insn, (0x00C2UL<<8)|NELEMS(retnf_insn), CPU_Any, NONE +retf, retnf_insn, (0x40CAUL<<8)|NELEMS(retnf_insn), CPU_Any, NONE +retn, retnf_insn, (0x00C2UL<<8)|NELEMS(retnf_insn), CPU_Any, NONE +rol, shift_insn, (0x00UL<<8)|NELEMS(shift_insn), CPU_Any, NONE +ror, shift_insn, (0x01UL<<8)|NELEMS(shift_insn), CPU_Any, NONE +roundpd, sse4imm_insn, (0x09UL<<8)|NELEMS(sse4imm_insn), CPU_SSE41, NONE +roundps, sse4imm_insn, (0x08UL<<8)|NELEMS(sse4imm_insn), CPU_SSE41, NONE +roundsd, sse4imm_insn, (0x0BUL<<8)|NELEMS(sse4imm_insn), CPU_SSE41, NONE +roundss, sse4imm_insn, (0x0AUL<<8)|NELEMS(sse4imm_insn), CPU_SSE41, NONE +rsdc, rsdc_insn, (0UL<<8)|NELEMS(rsdc_insn), CPU_486|CPU_Cyrix|CPU_SMM, NONE +rsldt, cyrixsmm_insn, (0x7BUL<<8)|NELEMS(cyrixsmm_insn), CPU_486|CPU_Cyrix|CPU_SMM, NONE +rsm, twobyte_insn, (0x0FAAUL<<8)|NELEMS(twobyte_insn), CPU_586|CPU_SMM, NONE +rsqrtps, sseps_insn, (0x52UL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE +rsqrtss, ssess_insn, (0xF352UL<<8)|NELEMS(ssess_insn), CPU_SSE, NONE +rsts, cyrixsmm_insn, (0x7DUL<<8)|NELEMS(cyrixsmm_insn), CPU_486|CPU_Cyrix|CPU_SMM, NONE +sahf, onebyte_insn, (0x00009EUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +sal, shift_insn, (0x04UL<<8)|NELEMS(shift_insn), CPU_Any, NONE +salc, onebyte_insn, (0x0000D6UL<<8)|NELEMS(onebyte_insn), CPU_Not64|CPU_Undoc, NONE +sar, shift_insn, (0x07UL<<8)|NELEMS(shift_insn), CPU_Any, NONE +sbb, arith_insn, (0x0318UL<<8)|NELEMS(arith_insn), CPU_Any, NONE +scasb, onebyte_insn, (0x0000AEUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +scasd, onebyte_insn, (0x0020AFUL<<8)|NELEMS(onebyte_insn), CPU_386, NONE +scasq, onebyte_insn, (0x0040AFUL<<8)|NELEMS(onebyte_insn), CPU_64, NONE +scasw, onebyte_insn, (0x0010AFUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +seta, setcc_insn, (0x07UL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setae, setcc_insn, (0x03UL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setb, setcc_insn, (0x02UL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setbe, setcc_insn, (0x06UL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setc, setcc_insn, (0x02UL<<8)|NELEMS(setcc_insn), CPU_386, NONE +sete, setcc_insn, (0x04UL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setg, setcc_insn, (0x0FUL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setge, setcc_insn, (0x0DUL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setl, setcc_insn, (0x0CUL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setle, setcc_insn, (0x0EUL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setna, setcc_insn, (0x06UL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setnae, setcc_insn, (0x02UL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setnb, setcc_insn, (0x03UL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setnbe, setcc_insn, (0x07UL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setnc, setcc_insn, (0x03UL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setne, setcc_insn, (0x05UL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setng, setcc_insn, (0x0EUL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setnge, setcc_insn, (0x0CUL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setnl, setcc_insn, (0x0DUL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setnle, setcc_insn, (0x0FUL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setno, setcc_insn, (0x01UL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setnp, setcc_insn, (0x0BUL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setns, setcc_insn, (0x09UL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setnz, setcc_insn, (0x05UL<<8)|NELEMS(setcc_insn), CPU_386, NONE +seto, setcc_insn, (0x00UL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setp, setcc_insn, (0x0AUL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setpe, setcc_insn, (0x0AUL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setpo, setcc_insn, (0x0BUL<<8)|NELEMS(setcc_insn), CPU_386, NONE +sets, setcc_insn, (0x08UL<<8)|NELEMS(setcc_insn), CPU_386, NONE +setz, setcc_insn, (0x04UL<<8)|NELEMS(setcc_insn), CPU_386, NONE +sfence, threebyte_insn, (0x0FAEF8UL<<8)|NELEMS(threebyte_insn), CPU_P3, NONE +sgdt, twobytemem_insn, (0x000F01UL<<8)|NELEMS(twobytemem_insn), CPU_286|CPU_Priv, NONE +shl, shift_insn, (0x04UL<<8)|NELEMS(shift_insn), CPU_Any, NONE +shld, shlrd_insn, (0xA4UL<<8)|NELEMS(shlrd_insn), CPU_386, NONE +shr, shift_insn, (0x05UL<<8)|NELEMS(shift_insn), CPU_Any, NONE +shrd, shlrd_insn, (0xACUL<<8)|NELEMS(shlrd_insn), CPU_386, NONE +shufpd, ssessimm_insn, (0x66C6UL<<8)|NELEMS(ssessimm_insn), CPU_SSE2, NONE +shufps, ssepsimm_insn, (0xC6UL<<8)|NELEMS(ssepsimm_insn), CPU_SSE, NONE +sidt, twobytemem_insn, (0x010F01UL<<8)|NELEMS(twobytemem_insn), CPU_286|CPU_Priv, NONE +skinit, skinit_insn, (0UL<<8)|NELEMS(skinit_insn), CPU_SVM, NONE +sldt, sldtmsw_insn, (0x0000UL<<8)|NELEMS(sldtmsw_insn), CPU_286, NONE +smi, onebyte_insn, (0x0000F1UL<<8)|NELEMS(onebyte_insn), CPU_386|CPU_Undoc, NONE +smint, twobyte_insn, (0x0F38UL<<8)|NELEMS(twobyte_insn), CPU_686|CPU_Cyrix, NONE +smintold, twobyte_insn, (0x0F7EUL<<8)|NELEMS(twobyte_insn), CPU_486|CPU_Cyrix|CPU_Obs, NONE +smsw, sldtmsw_insn, (0x0401UL<<8)|NELEMS(sldtmsw_insn), CPU_286, NONE +sqrtpd, ssess_insn, (0x6651UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +sqrtps, sseps_insn, (0x51UL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE +sqrtsd, ssess_insn, (0xF251UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +sqrtss, ssess_insn, (0xF351UL<<8)|NELEMS(ssess_insn), CPU_SSE, NONE +stc, onebyte_insn, (0x0000F9UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +std, onebyte_insn, (0x0000FDUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +stgi, threebyte_insn, (0x0F01DCUL<<8)|NELEMS(threebyte_insn), CPU_SVM, NONE +sti, onebyte_insn, (0x0000FBUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +stmxcsr, ldstmxcsr_insn, (0x03UL<<8)|NELEMS(ldstmxcsr_insn), CPU_SSE, NONE +stosb, onebyte_insn, (0x0000AAUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +stosd, onebyte_insn, (0x0020ABUL<<8)|NELEMS(onebyte_insn), CPU_386, NONE +stosq, onebyte_insn, (0x0040ABUL<<8)|NELEMS(onebyte_insn), CPU_64, NONE +stosw, onebyte_insn, (0x0010ABUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +str, str_insn, (0UL<<8)|NELEMS(str_insn), CPU_286|CPU_Prot, NONE +sub, arith_insn, (0x0528UL<<8)|NELEMS(arith_insn), CPU_Any, NONE +subpd, ssess_insn, (0x665CUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +subps, sseps_insn, (0x5CUL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE +subsd, ssess_insn, (0xF25CUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +subss, ssess_insn, (0xF35CUL<<8)|NELEMS(ssess_insn), CPU_SSE, NONE +svdc, svdc_insn, (0UL<<8)|NELEMS(svdc_insn), CPU_486|CPU_Cyrix|CPU_SMM, NONE +svldt, cyrixsmm_insn, (0x7AUL<<8)|NELEMS(cyrixsmm_insn), CPU_486|CPU_Cyrix|CPU_SMM, NONE +svts, cyrixsmm_insn, (0x7CUL<<8)|NELEMS(cyrixsmm_insn), CPU_486|CPU_Cyrix|CPU_SMM, NONE +swapgs, threebyte_insn, (0x0F01F8UL<<8)|NELEMS(threebyte_insn), CPU_64, NONE +syscall, twobyte_insn, (0x0F05UL<<8)|NELEMS(twobyte_insn), CPU_686|CPU_AMD, NONE +sysenter, twobyte_insn, (0x0F34UL<<8)|NELEMS(twobyte_insn), CPU_686|CPU_Not64, NONE +sysexit, twobyte_insn, (0x0F35UL<<8)|NELEMS(twobyte_insn), CPU_686|CPU_Not64|CPU_Priv, NONE +sysret, twobyte_insn, (0x0F07UL<<8)|NELEMS(twobyte_insn), CPU_686|CPU_AMD|CPU_Priv, NONE +test, test_insn, (0UL<<8)|NELEMS(test_insn), CPU_Any, NONE +ucomisd, ssess_insn, (0x662EUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +ucomiss, ssess_insn, (0x002EUL<<8)|NELEMS(ssess_insn), CPU_SSE, NONE +ud1, twobyte_insn, (0x0FB9UL<<8)|NELEMS(twobyte_insn), CPU_286|CPU_Undoc, NONE +ud2, twobyte_insn, (0x0F0BUL<<8)|NELEMS(twobyte_insn), CPU_286, NONE +umov, umov_insn, (0UL<<8)|NELEMS(umov_insn), CPU_386|CPU_Undoc, NONE +unpckhpd, ssess_insn, (0x6615UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +unpckhps, sseps_insn, (0x15UL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE +unpcklpd, ssess_insn, (0x6614UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +unpcklps, sseps_insn, (0x14UL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE +verr, prot286_insn, (0x0400UL<<8)|NELEMS(prot286_insn), CPU_286|CPU_Prot, NONE +verw, prot286_insn, (0x0500UL<<8)|NELEMS(prot286_insn), CPU_286|CPU_Prot, NONE +vmcall, threebyte_insn, (0x0F01C1UL<<8)|NELEMS(threebyte_insn), CPU_P4, NONE +vmclear, vmxthreebytemem_insn, (0x66UL<<8)|NELEMS(vmxthreebytemem_insn), CPU_P4, NONE +vmlaunch, threebyte_insn, (0x0F01C2UL<<8)|NELEMS(threebyte_insn), CPU_P4, NONE +vmload, svm_rax_insn, (0xDAUL<<8)|NELEMS(svm_rax_insn), CPU_SVM, NONE +vmmcall, threebyte_insn, (0x0F01D9UL<<8)|NELEMS(threebyte_insn), CPU_SVM, NONE +vmptrld, vmxtwobytemem_insn, (0x06UL<<8)|NELEMS(vmxtwobytemem_insn), CPU_P4, NONE +vmptrst, vmxtwobytemem_insn, (0x07UL<<8)|NELEMS(vmxtwobytemem_insn), CPU_P4, NONE +vmread, vmxmemrd_insn, (0UL<<8)|NELEMS(vmxmemrd_insn), CPU_P4, NONE +vmresume, threebyte_insn, (0x0F01C3UL<<8)|NELEMS(threebyte_insn), CPU_P4, NONE +vmrun, svm_rax_insn, (0xD8UL<<8)|NELEMS(svm_rax_insn), CPU_SVM, NONE +vmsave, svm_rax_insn, (0xDBUL<<8)|NELEMS(svm_rax_insn), CPU_SVM, NONE +vmwrite, vmxmemwr_insn, (0UL<<8)|NELEMS(vmxmemwr_insn), CPU_P4, NONE +vmxoff, threebyte_insn, (0x0F01C4UL<<8)|NELEMS(threebyte_insn), CPU_P4, NONE +vmxon, vmxthreebytemem_insn, (0xF3UL<<8)|NELEMS(vmxthreebytemem_insn), CPU_P4, NONE +wait, onebyte_insn, (0x00009BUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +wbinvd, twobyte_insn, (0x0F09UL<<8)|NELEMS(twobyte_insn), CPU_486|CPU_Priv, NONE +wrmsr, twobyte_insn, (0x0F30UL<<8)|NELEMS(twobyte_insn), CPU_586|CPU_Priv, NONE +wrshr, rdwrshr_insn, (0x01UL<<8)|NELEMS(rdwrshr_insn), CPU_686|CPU_Cyrix|CPU_SMM, NONE +xadd, cmpxchgxadd_insn, (0xC0UL<<8)|NELEMS(cmpxchgxadd_insn), CPU_486, NONE +xbts, xbts_insn, (0UL<<8)|NELEMS(xbts_insn), CPU_386|CPU_Obs|CPU_Undoc, NONE +xchg, xchg_insn, (0UL<<8)|NELEMS(xchg_insn), CPU_Any, NONE +xcryptcbc, padlock_insn, (0xD0F3A7UL<<8)|NELEMS(padlock_insn), CPU_PadLock, NONE +xcryptcfb, padlock_insn, (0xE0F3A7UL<<8)|NELEMS(padlock_insn), CPU_PadLock, NONE +xcryptctr, padlock_insn, (0xD8F3A7UL<<8)|NELEMS(padlock_insn), CPU_PadLock, NONE +xcryptecb, padlock_insn, (0xC8F3A7UL<<8)|NELEMS(padlock_insn), CPU_PadLock, NONE +xcryptofb, padlock_insn, (0xE8F3A7UL<<8)|NELEMS(padlock_insn), CPU_PadLock, NONE +xlatb, onebyte_insn, (0x0000D7UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE +xor, arith_insn, (0x0630UL<<8)|NELEMS(arith_insn), CPU_Any, NONE +xorpd, ssess_insn, (0x6657UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE +xorps, sseps_insn, (0x57UL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE +xsha1, padlock_insn, (0xC8F3A6UL<<8)|NELEMS(padlock_insn), CPU_PadLock, NONE +xsha256, padlock_insn, (0xD0F3A6UL<<8)|NELEMS(padlock_insn), CPU_PadLock, NONE +xstore, padlock_insn, (0xC000A7UL<<8)|NELEMS(padlock_insn), CPU_PadLock, NONE +xstorerng, padlock_insn, (0xC000A7UL<<8)|NELEMS(padlock_insn), CPU_PadLock, NONE diff --git a/x86insns.c b/x86insns.c new file mode 100644 index 00000000..240e4a0e --- /dev/null +++ b/x86insns.c @@ -0,0 +1,1104 @@ +static const x86_insn_info onebyte_insn[] = { + { CPU_Any, MOD_Op0Add|MOD_OpSizeR|MOD_DOpS64R, 0, 0, 0, 1, {0x00, 0, 0}, 0, 0, {0, 0, 0} } +}; + +static const x86_insn_info onebyte_prefix_insn[] = { + { CPU_Any, MOD_Op0Add|MOD_PreAdd, 0, 0, 0x00, 1, {0x00, 0, 0}, 0, 0, {0, 0, 0} } +}; + +static const x86_insn_info twobyte_insn[] = { + { CPU_Any, MOD_Op1Add|MOD_Op0Add|MOD_GasSufL|MOD_GasSufQ, 0, 0, 0, 2, {0x00, 0x00, 0}, 0, 0, {0, 0, 0} } +}; + +static const x86_insn_info threebyte_insn[] = { + { CPU_Any, MOD_Op2Add|MOD_Op1Add|MOD_Op0Add, 0, 0, 0, 3, {0x00, 0x00, 0x00}, 0, 0, {0, 0, 0} } +}; + +static const x86_insn_info onebytemem_insn[] = { + { CPU_Any, MOD_Op0Add|MOD_SpAdd|MOD_GasSufL|MOD_GasSufQ|MOD_GasSufS, 0, 0, 0, 1, {0x00, 0, 0}, 0, 1, {OPT_Mem|OPS_Any|OPA_EA, 0, 0} } +}; + +static const x86_insn_info twobytemem_insn[] = { + { CPU_Any, MOD_Op1Add|MOD_Op0Add|MOD_SpAdd|MOD_GasSufL|MOD_GasSufQ|MOD_GasSufS|MOD_GasSufW, 0, 0, 0, 2, {0x00, 0x00, 0}, 0, 1, {OPT_Mem|OPS_Any|OPA_EA, 0, 0} } +}; + +static const x86_insn_info mov_insn[] = { + { CPU_Not64, MOD_GasSufB, 0, 0, 0, 1, {0xA0, 0, 0}, 0, 2, {OPT_Areg|OPS_8|OPA_None, OPT_MemOffs|OPS_8|OPS_Relaxed|OPA_EA, 0} }, + { CPU_Not64, MOD_GasSufW, 16, 0, 0, 1, {0xA1, 0, 0}, 0, 2, {OPT_Areg|OPS_16|OPA_None, OPT_MemOffs|OPS_16|OPS_Relaxed|OPA_EA, 0} }, + { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0xA1, 0, 0}, 0, 2, {OPT_Areg|OPS_32|OPA_None, OPT_MemOffs|OPS_32|OPS_Relaxed|OPA_EA, 0} }, + { CPU_Not64, MOD_GasSufB, 0, 0, 0, 1, {0xA2, 0, 0}, 0, 2, {OPT_MemOffs|OPS_8|OPS_Relaxed|OPA_EA, OPT_Areg|OPS_8|OPA_None, 0} }, + { CPU_Not64, MOD_GasSufW, 16, 0, 0, 1, {0xA3, 0, 0}, 0, 2, {OPT_MemOffs|OPS_16|OPS_Relaxed|OPA_EA, OPT_Areg|OPS_16|OPA_None, 0} }, + { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0xA3, 0, 0}, 0, 2, {OPT_MemOffs|OPS_32|OPS_Relaxed|OPA_EA, OPT_Areg|OPS_32|OPA_None, 0} }, + { CPU_64, 0, 0, 0, 0, 1, {0xA0, 0, 0}, 0, 2, {OPT_Areg|OPS_8|OPA_None, OPT_MemOffs|OPS_8|OPS_Relaxed|OPEAS_64|OPA_EA, 0} }, + { CPU_64, 0, 16, 0, 0, 1, {0xA1, 0, 0}, 0, 2, {OPT_Areg|OPS_16|OPA_None, OPT_MemOffs|OPS_16|OPS_Relaxed|OPEAS_64|OPA_EA, 0} }, + { CPU_64, 0, 32, 0, 0, 1, {0xA1, 0, 0}, 0, 2, {OPT_Areg|OPS_32|OPA_None, OPT_MemOffs|OPS_32|OPS_Relaxed|OPEAS_64|OPA_EA, 0} }, + { CPU_64, 0, 64, 0, 0, 1, {0xA1, 0, 0}, 0, 2, {OPT_Areg|OPS_64|OPA_None, OPT_MemOffs|OPS_64|OPS_Relaxed|OPEAS_64|OPA_EA, 0} }, + { CPU_64, 0, 0, 0, 0, 1, {0xA2, 0, 0}, 0, 2, {OPT_MemOffs|OPS_8|OPS_Relaxed|OPEAS_64|OPA_EA, OPT_Areg|OPS_8|OPA_None, 0} }, + { CPU_64, 0, 16, 0, 0, 1, {0xA3, 0, 0}, 0, 2, {OPT_MemOffs|OPS_16|OPS_Relaxed|OPEAS_64|OPA_EA, OPT_Areg|OPS_16|OPA_None, 0} }, + { CPU_64, 0, 32, 0, 0, 1, {0xA3, 0, 0}, 0, 2, {OPT_MemOffs|OPS_32|OPS_Relaxed|OPEAS_64|OPA_EA, OPT_Areg|OPS_32|OPA_None, 0} }, + { CPU_64, 0, 64, 0, 0, 1, {0xA3, 0, 0}, 0, 2, {OPT_MemOffs|OPS_64|OPS_Relaxed|OPEAS_64|OPA_EA, OPT_Areg|OPS_64|OPA_None, 0} }, + { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0x88, 0xA2, 0}, 0, 2, {OPT_RM|OPS_8|OPS_Relaxed|OPA_EA|OPAP_ShortMov, OPT_Areg|OPS_8|OPA_Spare, 0} }, + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x89, 0xA3, 0}, 0, 2, {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA|OPAP_ShortMov, OPT_Areg|OPS_16|OPA_Spare, 0} }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x89, 0xA3, 0}, 0, 2, {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA|OPAP_ShortMov, OPT_Areg|OPS_32|OPA_Spare, 0} }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x89, 0xA3, 0}, 0, 2, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA|OPAP_ShortMov, OPT_Areg|OPS_64|OPA_Spare, 0} }, + { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0x88, 0, 0}, 0, 2, {OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_8|OPA_Spare, 0} }, + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x89, 0, 0}, 0, 2, {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_16|OPA_Spare, 0} }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x89, 0, 0}, 0, 2, {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_32|OPA_Spare, 0} }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x89, 0, 0}, 0, 2, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_64|OPA_Spare, 0} }, + { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0x8A, 0xA0, 0}, 0, 2, {OPT_Areg|OPS_8|OPA_Spare, OPT_RM|OPS_8|OPS_Relaxed|OPA_EA|OPAP_ShortMov, 0} }, + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x8B, 0xA1, 0}, 0, 2, {OPT_Areg|OPS_16|OPA_Spare, OPT_RM|OPS_16|OPS_Relaxed|OPA_EA|OPAP_ShortMov, 0} }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x8B, 0xA1, 0}, 0, 2, {OPT_Areg|OPS_32|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA|OPAP_ShortMov, 0} }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x8B, 0xA1, 0}, 0, 2, {OPT_Areg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA|OPAP_ShortMov, 0} }, + { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0x8A, 0, 0}, 0, 2, {OPT_Reg|OPS_8|OPA_Spare, OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, 0} }, + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x8B, 0, 0}, 0, 2, {OPT_Reg|OPS_16|OPA_Spare, OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, 0} }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x8B, 0, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x8B, 0, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} }, + { CPU_Any, MOD_GasSufW, 0, 0, 0, 1, {0x8C, 0, 0}, 0, 2, {OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, OPT_SegReg|OPS_16|OPS_Relaxed|OPA_Spare, 0} }, + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x8C, 0, 0}, 0, 2, {OPT_Reg|OPS_16|OPA_EA, OPT_SegReg|OPS_16|OPS_Relaxed|OPA_Spare, 0} }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x8C, 0, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_EA, OPT_SegReg|OPS_16|OPS_Relaxed|OPA_Spare, 0} }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x8C, 0, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_EA, OPT_SegReg|OPS_16|OPS_Relaxed|OPA_Spare, 0} }, + { CPU_Any, MOD_GasSufW, 0, 0, 0, 1, {0x8E, 0, 0}, 0, 2, {OPT_SegReg|OPS_16|OPS_Relaxed|OPA_Spare, OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, 0} }, + { CPU_386, MOD_GasSufL, 0, 0, 0, 1, {0x8E, 0, 0}, 0, 2, {OPT_SegReg|OPS_16|OPS_Relaxed|OPA_Spare, OPT_Reg|OPS_32|OPA_EA, 0} }, + { CPU_64, MOD_GasSufQ, 0, 0, 0, 1, {0x8E, 0, 0}, 0, 2, {OPT_SegReg|OPS_16|OPS_Relaxed|OPA_Spare, OPT_Reg|OPS_64|OPA_EA, 0} }, + { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xB0, 0, 0}, 0, 2, {OPT_Reg|OPS_8|OPA_Op0Add, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xB8, 0, 0}, 0, 2, {OPT_Reg|OPS_16|OPA_Op0Add, OPT_Imm|OPS_16|OPS_Relaxed|OPA_Imm, 0} }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xB8, 0, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Op0Add, OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm, 0} }, + { CPU_64, MOD_GasIllegal, 64, 0, 0, 1, {0xB8, 0, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Op0Add, OPT_Imm|OPS_64|OPA_Imm, 0} }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xB8, 0xC7, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Op0Add, OPT_Imm|OPS_64|OPS_Relaxed|OPA_Imm|OPAP_SImm32Avail, 0} }, + { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xC6, 0, 0}, 0, 2, {OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPA_Imm, 0} }, + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xC7, 0, 0}, 0, 2, {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_16|OPA_Imm, 0} }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xC7, 0, 0}, 0, 2, {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_32|OPA_Imm, 0} }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xC7, 0, 0}, 0, 2, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_32|OPA_Imm, 0} }, + { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xC6, 0, 0}, 0, 2, {OPT_RM|OPS_8|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xC7, 0, 0}, 0, 2, {OPT_RM|OPS_16|OPA_EA, OPT_Imm|OPS_16|OPS_Relaxed|OPA_Imm, 0} }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xC7, 0, 0}, 0, 2, {OPT_RM|OPS_32|OPA_EA, OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm, 0} }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xC7, 0, 0}, 0, 2, {OPT_RM|OPS_64|OPA_EA, OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm, 0} }, + { CPU_586|CPU_Not64|CPU_Priv, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0x22, 0}, 0, 2, {OPT_CR4|OPS_32|OPA_Spare, OPT_Reg|OPS_32|OPA_EA, 0} }, + { CPU_386|CPU_Not64|CPU_Priv, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0x22, 0}, 0, 2, {OPT_CRReg|OPS_32|OPA_Spare, OPT_Reg|OPS_32|OPA_EA, 0} }, + { CPU_64|CPU_Priv, MOD_GasSufQ, 0, 0, 0, 2, {0x0F, 0x22, 0}, 0, 2, {OPT_CRReg|OPS_32|OPA_Spare, OPT_Reg|OPS_64|OPA_EA, 0} }, + { CPU_586|CPU_Not64|CPU_Priv, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0x20, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_EA, OPT_CR4|OPS_32|OPA_Spare, 0} }, + { CPU_386|CPU_Not64|CPU_Priv, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0x20, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_EA, OPT_CRReg|OPS_32|OPA_Spare, 0} }, + { CPU_64|CPU_Priv, MOD_GasSufQ, 0, 0, 0, 2, {0x0F, 0x20, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_EA, OPT_CRReg|OPS_32|OPA_Spare, 0} }, + { CPU_386|CPU_Not64|CPU_Priv, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0x23, 0}, 0, 2, {OPT_DRReg|OPS_32|OPA_Spare, OPT_Reg|OPS_32|OPA_EA, 0} }, + { CPU_64|CPU_Priv, MOD_GasSufQ, 0, 0, 0, 2, {0x0F, 0x23, 0}, 0, 2, {OPT_DRReg|OPS_32|OPA_Spare, OPT_Reg|OPS_64|OPA_EA, 0} }, + { CPU_386|CPU_Not64|CPU_Priv, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0x21, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_EA, OPT_DRReg|OPS_32|OPA_Spare, 0} }, + { CPU_64|CPU_Priv, MOD_GasSufQ, 0, 0, 0, 2, {0x0F, 0x21, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_EA, OPT_DRReg|OPS_32|OPA_Spare, 0} }, + { CPU_MMX, MOD_GasOnly|MOD_GasSufQ, 0, 0, 0, 2, {0x0F, 0x6F, 0}, 0, 2, {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, 0} }, + { CPU_64|CPU_MMX, MOD_GasOnly|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x6E, 0}, 0, 2, {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} }, + { CPU_MMX, MOD_GasOnly|MOD_GasSufQ, 0, 0, 0, 2, {0x0F, 0x7F, 0}, 0, 2, {OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_64|OPA_Spare, 0} }, + { CPU_64|CPU_MMX, MOD_GasOnly|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x7E, 0}, 0, 2, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_64|OPA_Spare, 0} }, + { CPU_SSE2, MOD_GasOnly|MOD_GasSufQ, 0, 0, 0xF3, 2, {0x0F, 0x7E, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} }, + { CPU_SSE2, MOD_GasOnly|MOD_GasSufQ, 0, 0, 0xF3, 2, {0x0F, 0x7E, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, 0} }, + { CPU_64|CPU_SSE2, MOD_GasOnly|MOD_GasSufQ, 64, 0, 0x66, 2, {0x0F, 0x6E, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} }, + { CPU_SSE2, MOD_GasOnly|MOD_GasSufQ, 0, 0, 0x66, 2, {0x0F, 0xD6, 0}, 0, 2, {OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} }, + { CPU_64|CPU_SSE2, MOD_GasOnly|MOD_GasSufQ, 64, 0, 0x66, 2, {0x0F, 0x7E, 0}, 0, 2, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} } +}; + +static const x86_insn_info movabs_insn[] = { + { CPU_64, MOD_GasSufB, 0, 0, 0, 1, {0xA0, 0, 0}, 0, 2, {OPT_Areg|OPS_8|OPA_None, OPT_MemOffs|OPS_8|OPS_Relaxed|OPEAS_64|OPA_EA, 0} }, + { CPU_64, MOD_GasSufW, 16, 0, 0, 1, {0xA1, 0, 0}, 0, 2, {OPT_Areg|OPS_16|OPA_None, OPT_MemOffs|OPS_16|OPS_Relaxed|OPEAS_64|OPA_EA, 0} }, + { CPU_64, MOD_GasSufL, 32, 0, 0, 1, {0xA1, 0, 0}, 0, 2, {OPT_Areg|OPS_32|OPA_None, OPT_MemOffs|OPS_32|OPS_Relaxed|OPEAS_64|OPA_EA, 0} }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xA1, 0, 0}, 0, 2, {OPT_Areg|OPS_64|OPA_None, OPT_MemOffs|OPS_64|OPS_Relaxed|OPEAS_64|OPA_EA, 0} }, + { CPU_64, MOD_GasSufB, 0, 0, 0, 1, {0xA2, 0, 0}, 0, 2, {OPT_MemOffs|OPS_8|OPS_Relaxed|OPEAS_64|OPA_EA, OPT_Areg|OPS_8|OPA_None, 0} }, + { CPU_64, MOD_GasSufW, 16, 0, 0, 1, {0xA3, 0, 0}, 0, 2, {OPT_MemOffs|OPS_16|OPS_Relaxed|OPEAS_64|OPA_EA, OPT_Areg|OPS_16|OPA_None, 0} }, + { CPU_64, MOD_GasSufL, 32, 0, 0, 1, {0xA3, 0, 0}, 0, 2, {OPT_MemOffs|OPS_32|OPS_Relaxed|OPEAS_64|OPA_EA, OPT_Areg|OPS_32|OPA_None, 0} }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xA3, 0, 0}, 0, 2, {OPT_MemOffs|OPS_64|OPS_Relaxed|OPEAS_64|OPA_EA, OPT_Areg|OPS_64|OPA_None, 0} }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xB8, 0, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Op0Add, OPT_Imm|OPS_64|OPS_Relaxed|OPA_Imm, 0} } +}; + +static const x86_insn_info movszx_insn[] = { + { CPU_386, MOD_Op1Add|MOD_GasSufB, 16, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_Reg|OPS_16|OPA_Spare, OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, 0} }, + { CPU_386, MOD_Op1Add|MOD_GasSufB, 32, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_8|OPA_EA, 0} }, + { CPU_64, MOD_Op1Add|MOD_GasSufB, 64, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_8|OPA_EA, 0} }, + { CPU_386, MOD_Op1Add|MOD_GasSufW, 32, 0, 0, 2, {0x0F, 0x01, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_16|OPA_EA, 0} }, + { CPU_64, MOD_Op1Add|MOD_GasSufW, 64, 0, 0, 2, {0x0F, 0x01, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_16|OPA_EA, 0} } +}; + +static const x86_insn_info movsxd_insn[] = { + { CPU_64, MOD_GasSufL, 64, 0, 0, 1, {0x63, 0, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_32|OPA_EA, 0} } +}; + +static const x86_insn_info push_insn[] = { + { CPU_Any, MOD_GasSufW, 16, 64, 0, 1, {0x50, 0, 0}, 0, 1, {OPT_Reg|OPS_16|OPA_Op0Add, 0, 0} }, + { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0x50, 0, 0}, 0, 1, {OPT_Reg|OPS_32|OPA_Op0Add, 0, 0} }, + { CPU_64, MOD_GasSufQ, 0, 64, 0, 1, {0x50, 0, 0}, 0, 1, {OPT_Reg|OPS_64|OPA_Op0Add, 0, 0} }, + { CPU_Any, MOD_GasSufW, 16, 64, 0, 1, {0xFF, 0, 0}, 6, 1, {OPT_RM|OPS_16|OPA_EA, 0, 0} }, + { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0xFF, 0, 0}, 6, 1, {OPT_RM|OPS_32|OPA_EA, 0, 0} }, + { CPU_64, MOD_GasSufQ, 0, 64, 0, 1, {0xFF, 0, 0}, 6, 1, {OPT_RM|OPS_64|OPA_EA, 0, 0} }, + { CPU_186, MOD_GasIllegal, 0, 64, 0, 1, {0x6A, 0, 0}, 0, 1, {OPT_Imm|OPS_8|OPA_SImm, 0, 0} }, + { CPU_186, MOD_GasOnly, 0, 64, 0, 1, {0x6A, 0, 0}, 0, 1, {OPT_Imm|OPS_8|OPS_Relaxed|OPA_SImm, 0, 0} }, + { CPU_186, MOD_GasOnly|MOD_GasSufW, 16, 64, 0, 1, {0x6A, 0x68, 0}, 0, 1, {OPT_Imm|OPS_16|OPS_Relaxed|OPA_Imm|OPAP_SImm8, 0, 0} }, + { CPU_386|CPU_Not64, MOD_GasOnly|MOD_GasSufL, 32, 0, 0, 1, {0x6A, 0x68, 0}, 0, 1, {OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm|OPAP_SImm8, 0, 0} }, + { CPU_64, MOD_GasSufQ, 64, 64, 0, 1, {0x6A, 0x68, 0}, 0, 1, {OPT_Imm|OPS_32|OPS_Relaxed|OPA_SImm|OPAP_SImm8, 0, 0} }, + { CPU_186|CPU_Not64, MOD_GasIllegal, 0, 0, 0, 1, {0x6A, 0x68, 0}, 0, 1, {OPT_Imm|OPS_BITS|OPS_Relaxed|OPA_Imm|OPAP_SImm8, 0, 0} }, + { CPU_186, MOD_GasIllegal, 16, 64, 0, 1, {0x68, 0, 0}, 0, 1, {OPT_Imm|OPS_16|OPA_Imm, 0, 0} }, + { CPU_386|CPU_Not64, MOD_GasIllegal, 32, 0, 0, 1, {0x68, 0, 0}, 0, 1, {OPT_Imm|OPS_32|OPA_Imm, 0, 0} }, + { CPU_64, MOD_GasIllegal, 64, 64, 0, 1, {0x68, 0, 0}, 0, 1, {OPT_Imm|OPS_32|OPA_SImm, 0, 0} }, + { CPU_Not64, 0, 0, 0, 0, 1, {0x0E, 0, 0}, 0, 1, {OPT_CS|OPS_Any|OPA_None, 0, 0} }, + { CPU_Not64, MOD_GasSufW, 16, 0, 0, 1, {0x0E, 0, 0}, 0, 1, {OPT_CS|OPS_16|OPA_None, 0, 0} }, + { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0x0E, 0, 0}, 0, 1, {OPT_CS|OPS_32|OPA_None, 0, 0} }, + { CPU_Not64, 0, 0, 0, 0, 1, {0x16, 0, 0}, 0, 1, {OPT_SS|OPS_Any|OPA_None, 0, 0} }, + { CPU_Not64, MOD_GasSufW, 16, 0, 0, 1, {0x16, 0, 0}, 0, 1, {OPT_SS|OPS_16|OPA_None, 0, 0} }, + { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0x16, 0, 0}, 0, 1, {OPT_SS|OPS_32|OPA_None, 0, 0} }, + { CPU_Not64, 0, 0, 0, 0, 1, {0x1E, 0, 0}, 0, 1, {OPT_DS|OPS_Any|OPA_None, 0, 0} }, + { CPU_Not64, MOD_GasSufW, 16, 0, 0, 1, {0x1E, 0, 0}, 0, 1, {OPT_DS|OPS_16|OPA_None, 0, 0} }, + { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0x1E, 0, 0}, 0, 1, {OPT_DS|OPS_32|OPA_None, 0, 0} }, + { CPU_Not64, 0, 0, 0, 0, 1, {0x06, 0, 0}, 0, 1, {OPT_ES|OPS_Any|OPA_None, 0, 0} }, + { CPU_Not64, MOD_GasSufW, 16, 0, 0, 1, {0x06, 0, 0}, 0, 1, {OPT_ES|OPS_16|OPA_None, 0, 0} }, + { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0x06, 0, 0}, 0, 1, {OPT_ES|OPS_32|OPA_None, 0, 0} }, + { CPU_386, 0, 0, 0, 0, 2, {0x0F, 0xA0, 0}, 0, 1, {OPT_FS|OPS_Any|OPA_None, 0, 0} }, + { CPU_386, MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0xA0, 0}, 0, 1, {OPT_FS|OPS_16|OPA_None, 0, 0} }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0xA0, 0}, 0, 1, {OPT_FS|OPS_32|OPA_None, 0, 0} }, + { CPU_386, 0, 0, 0, 0, 2, {0x0F, 0xA8, 0}, 0, 1, {OPT_GS|OPS_Any|OPA_None, 0, 0} }, + { CPU_386, MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0xA8, 0}, 0, 1, {OPT_GS|OPS_16|OPA_None, 0, 0} }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0xA8, 0}, 0, 1, {OPT_GS|OPS_32|OPA_None, 0, 0} } +}; + +static const x86_insn_info pop_insn[] = { + { CPU_Any, MOD_GasSufW, 16, 64, 0, 1, {0x58, 0, 0}, 0, 1, {OPT_Reg|OPS_16|OPA_Op0Add, 0, 0} }, + { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0x58, 0, 0}, 0, 1, {OPT_Reg|OPS_32|OPA_Op0Add, 0, 0} }, + { CPU_64, MOD_GasSufQ, 0, 64, 0, 1, {0x58, 0, 0}, 0, 1, {OPT_Reg|OPS_64|OPA_Op0Add, 0, 0} }, + { CPU_Any, MOD_GasSufW, 16, 64, 0, 1, {0x8F, 0, 0}, 0, 1, {OPT_RM|OPS_16|OPA_EA, 0, 0} }, + { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0x8F, 0, 0}, 0, 1, {OPT_RM|OPS_32|OPA_EA, 0, 0} }, + { CPU_64, MOD_GasSufQ, 0, 64, 0, 1, {0x8F, 0, 0}, 0, 1, {OPT_RM|OPS_64|OPA_EA, 0, 0} }, + { CPU_Not64, 0, 0, 0, 0, 1, {0x17, 0, 0}, 0, 1, {OPT_SS|OPS_Any|OPA_None, 0, 0} }, + { CPU_Not64, 0, 16, 0, 0, 1, {0x17, 0, 0}, 0, 1, {OPT_SS|OPS_16|OPA_None, 0, 0} }, + { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0x17, 0, 0}, 0, 1, {OPT_SS|OPS_32|OPA_None, 0, 0} }, + { CPU_Not64, 0, 0, 0, 0, 1, {0x1F, 0, 0}, 0, 1, {OPT_DS|OPS_Any|OPA_None, 0, 0} }, + { CPU_Not64, 0, 16, 0, 0, 1, {0x1F, 0, 0}, 0, 1, {OPT_DS|OPS_16|OPA_None, 0, 0} }, + { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0x1F, 0, 0}, 0, 1, {OPT_DS|OPS_32|OPA_None, 0, 0} }, + { CPU_Not64, 0, 0, 0, 0, 1, {0x07, 0, 0}, 0, 1, {OPT_ES|OPS_Any|OPA_None, 0, 0} }, + { CPU_Not64, 0, 16, 0, 0, 1, {0x07, 0, 0}, 0, 1, {OPT_ES|OPS_16|OPA_None, 0, 0} }, + { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0x07, 0, 0}, 0, 1, {OPT_ES|OPS_32|OPA_None, 0, 0} }, + { CPU_386, 0, 0, 0, 0, 2, {0x0F, 0xA1, 0}, 0, 1, {OPT_FS|OPS_Any|OPA_None, 0, 0} }, + { CPU_386, 0, 16, 0, 0, 2, {0x0F, 0xA1, 0}, 0, 1, {OPT_FS|OPS_16|OPA_None, 0, 0} }, + { CPU_386, 0, 32, 0, 0, 2, {0x0F, 0xA1, 0}, 0, 1, {OPT_FS|OPS_32|OPA_None, 0, 0} }, + { CPU_386, 0, 0, 0, 0, 2, {0x0F, 0xA9, 0}, 0, 1, {OPT_GS|OPS_Any|OPA_None, 0, 0} }, + { CPU_386, 0, 16, 0, 0, 2, {0x0F, 0xA9, 0}, 0, 1, {OPT_GS|OPS_16|OPA_None, 0, 0} }, + { CPU_386, 0, 32, 0, 0, 2, {0x0F, 0xA9, 0}, 0, 1, {OPT_GS|OPS_32|OPA_None, 0, 0} } +}; + +static const x86_insn_info xchg_insn[] = { + { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0x86, 0, 0}, 0, 2, {OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_8|OPA_Spare, 0} }, + { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0x86, 0, 0}, 0, 2, {OPT_Reg|OPS_8|OPA_Spare, OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, 0} }, + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x90, 0, 0}, 0, 2, {OPT_Areg|OPS_16|OPA_None, OPT_Reg|OPS_16|OPA_Op0Add, 0} }, + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x90, 0, 0}, 0, 2, {OPT_Reg|OPS_16|OPA_Op0Add, OPT_Areg|OPS_16|OPA_None, 0} }, + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x87, 0, 0}, 0, 2, {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_16|OPA_Spare, 0} }, + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x87, 0, 0}, 0, 2, {OPT_Reg|OPS_16|OPA_Spare, OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, 0} }, + { CPU_64, MOD_GasSufL, 32, 0, 0, 1, {0x87, 0, 0}, 0, 2, {OPT_Areg|OPS_32|OPA_EA, OPT_Areg|OPS_32|OPA_Spare, 0} }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x90, 0, 0}, 0, 2, {OPT_Areg|OPS_32|OPA_None, OPT_Reg|OPS_32|OPA_Op0Add, 0} }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x90, 0, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Op0Add, OPT_Areg|OPS_32|OPA_None, 0} }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x87, 0, 0}, 0, 2, {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_32|OPA_Spare, 0} }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x87, 0, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} }, + { CPU_64, MOD_GasSufQ, 0, 0, 0, 1, {0x90, 0, 0}, 0, 2, {OPT_Areg|OPS_64|OPA_None, OPT_Areg|OPS_64|OPA_Op0Add, 0} }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x90, 0, 0}, 0, 2, {OPT_Areg|OPS_64|OPA_None, OPT_Reg|OPS_64|OPA_Op0Add, 0} }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x90, 0, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Op0Add, OPT_Areg|OPS_64|OPA_None, 0} }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x87, 0, 0}, 0, 2, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_64|OPA_Spare, 0} }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x87, 0, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} } +}; + +static const x86_insn_info in_insn[] = { + { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xE4, 0, 0}, 0, 2, {OPT_Areg|OPS_8|OPA_None, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xE5, 0, 0}, 0, 2, {OPT_Areg|OPS_16|OPA_None, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xE5, 0, 0}, 0, 2, {OPT_Areg|OPS_32|OPA_None, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, + { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xEC, 0, 0}, 0, 2, {OPT_Areg|OPS_8|OPA_None, OPT_Dreg|OPS_16|OPA_None, 0} }, + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xED, 0, 0}, 0, 2, {OPT_Areg|OPS_16|OPA_None, OPT_Dreg|OPS_16|OPA_None, 0} }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xED, 0, 0}, 0, 2, {OPT_Areg|OPS_32|OPA_None, OPT_Dreg|OPS_16|OPA_None, 0} }, + { CPU_Any, MOD_GasOnly|MOD_GasSufB, 0, 0, 0, 1, {0xE4, 0, 0}, 0, 1, {OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0, 0} }, + { CPU_Any, MOD_GasOnly|MOD_GasSufW, 16, 0, 0, 1, {0xE5, 0, 0}, 0, 1, {OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0, 0} }, + { CPU_386, MOD_GasOnly|MOD_GasSufL, 32, 0, 0, 1, {0xE5, 0, 0}, 0, 1, {OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0, 0} }, + { CPU_Any, MOD_GasOnly|MOD_GasSufB, 0, 0, 0, 1, {0xEC, 0, 0}, 0, 1, {OPT_Dreg|OPS_16|OPA_None, 0, 0} }, + { CPU_Any, MOD_GasOnly|MOD_GasSufW, 16, 0, 0, 1, {0xED, 0, 0}, 0, 1, {OPT_Dreg|OPS_16|OPA_None, 0, 0} }, + { CPU_386, MOD_GasOnly|MOD_GasSufL, 32, 0, 0, 1, {0xED, 0, 0}, 0, 1, {OPT_Dreg|OPS_16|OPA_None, 0, 0} } +}; + +static const x86_insn_info out_insn[] = { + { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xE6, 0, 0}, 0, 2, {OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, OPT_Areg|OPS_8|OPA_None, 0} }, + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xE7, 0, 0}, 0, 2, {OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, OPT_Areg|OPS_16|OPA_None, 0} }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xE7, 0, 0}, 0, 2, {OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, OPT_Areg|OPS_32|OPA_None, 0} }, + { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xEE, 0, 0}, 0, 2, {OPT_Dreg|OPS_16|OPA_None, OPT_Areg|OPS_8|OPA_None, 0} }, + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xEF, 0, 0}, 0, 2, {OPT_Dreg|OPS_16|OPA_None, OPT_Areg|OPS_16|OPA_None, 0} }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xEF, 0, 0}, 0, 2, {OPT_Dreg|OPS_16|OPA_None, OPT_Areg|OPS_32|OPA_None, 0} }, + { CPU_Any, MOD_GasOnly|MOD_GasSufB, 0, 0, 0, 1, {0xE6, 0, 0}, 0, 1, {OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0, 0} }, + { CPU_Any, MOD_GasOnly|MOD_GasSufW, 16, 0, 0, 1, {0xE7, 0, 0}, 0, 1, {OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0, 0} }, + { CPU_386, MOD_GasOnly|MOD_GasSufL, 32, 0, 0, 1, {0xE7, 0, 0}, 0, 1, {OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0, 0} }, + { CPU_Any, MOD_GasOnly|MOD_GasSufB, 0, 0, 0, 1, {0xEE, 0, 0}, 0, 1, {OPT_Dreg|OPS_16|OPA_None, 0, 0} }, + { CPU_Any, MOD_GasOnly|MOD_GasSufW, 16, 0, 0, 1, {0xEF, 0, 0}, 0, 1, {OPT_Dreg|OPS_16|OPA_None, 0, 0} }, + { CPU_386, MOD_GasOnly|MOD_GasSufL, 32, 0, 0, 1, {0xEF, 0, 0}, 0, 1, {OPT_Dreg|OPS_16|OPA_None, 0, 0} } +}; + +static const x86_insn_info lea_insn[] = { + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x8D, 0, 0}, 0, 2, {OPT_Reg|OPS_16|OPA_Spare, OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, 0} }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x8D, 0, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, 0} }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x8D, 0, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0} } +}; + +static const x86_insn_info ldes_insn[] = { + { CPU_Not64, MOD_Op0Add|MOD_GasSufW, 16, 0, 0, 1, {0x00, 0, 0}, 0, 2, {OPT_Reg|OPS_16|OPA_Spare, OPT_Mem|OPS_Any|OPA_EA, 0} }, + { CPU_386|CPU_Not64, MOD_Op0Add|MOD_GasSufL, 32, 0, 0, 1, {0x00, 0, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_Mem|OPS_Any|OPA_EA, 0} } +}; + +static const x86_insn_info lfgss_insn[] = { + { CPU_386, MOD_Op1Add|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_Reg|OPS_16|OPA_Spare, OPT_Mem|OPS_Any|OPA_EA, 0} }, + { CPU_386, MOD_Op1Add|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_Mem|OPS_Any|OPA_EA, 0} } +}; + +static const x86_insn_info arith_insn[] = { + { CPU_Any, MOD_Op0Add|MOD_GasSufB, 0, 0, 0, 1, {0x04, 0, 0}, 0, 2, {OPT_Areg|OPS_8|OPA_None, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, + { CPU_Any, MOD_Op2Add|MOD_Op1AddSp|MOD_GasSufW, 16, 0, 0, 2, {0x83, 0xC0, 0x05}, 0, 2, {OPT_Areg|OPS_16|OPA_None, OPT_Imm|OPS_16|OPS_Relaxed|OPA_Imm|OPAP_SImm8, 0} }, + { CPU_386, MOD_Op2Add|MOD_Op1AddSp|MOD_GasSufL, 32, 0, 0, 2, {0x83, 0xC0, 0x05}, 0, 2, {OPT_Areg|OPS_32|OPA_None, OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm|OPAP_SImm8, 0} }, + { CPU_64, MOD_Op2Add|MOD_Op1AddSp|MOD_GasSufQ, 64, 0, 0, 2, {0x83, 0xC0, 0x05}, 0, 2, {OPT_Areg|OPS_64|OPA_None, OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm|OPAP_SImm8, 0} }, + { CPU_Any, MOD_Gap0|MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0x80, 0, 0}, 0, 2, {OPT_RM|OPS_8|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, + { CPU_Any, MOD_Gap0|MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0x80, 0, 0}, 0, 2, {OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPA_Imm, 0} }, + { CPU_Any, MOD_Gap0|MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0x83, 0, 0}, 0, 2, {OPT_RM|OPS_16|OPA_EA, OPT_Imm|OPS_8|OPA_SImm, 0} }, + { CPU_Any, MOD_Gap0|MOD_SpAdd|MOD_GasIllegal, 16, 0, 0, 1, {0x83, 0x81, 0}, 0, 2, {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_16|OPA_Imm|OPAP_SImm8, 0} }, + { CPU_Any, MOD_Gap0|MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0x83, 0x81, 0}, 0, 2, {OPT_RM|OPS_16|OPA_EA, OPT_Imm|OPS_16|OPS_Relaxed|OPA_Imm|OPAP_SImm8, 0} }, + { CPU_386, MOD_Gap0|MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0x83, 0, 0}, 0, 2, {OPT_RM|OPS_32|OPA_EA, OPT_Imm|OPS_8|OPA_SImm, 0} }, + { CPU_386|CPU_Not64, MOD_Gap0|MOD_SpAdd|MOD_GasIllegal, 32, 0, 0, 1, {0x83, 0x81, 0}, 0, 2, {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_32|OPA_Imm|OPAP_SImm8, 0} }, + { CPU_386, MOD_Gap0|MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0x83, 0x81, 0}, 0, 2, {OPT_RM|OPS_32|OPA_EA, OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm|OPAP_SImm8, 0} }, + { CPU_64, MOD_Gap0|MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, {0x83, 0, 0}, 0, 2, {OPT_RM|OPS_64|OPA_EA, OPT_Imm|OPS_8|OPA_SImm, 0} }, + { CPU_64, MOD_Gap0|MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, {0x83, 0x81, 0}, 0, 2, {OPT_RM|OPS_64|OPA_EA, OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm|OPAP_SImm8, 0} }, + { CPU_Any, MOD_Op0Add|MOD_GasSufB, 0, 0, 0, 1, {0x00, 0, 0}, 0, 2, {OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_8|OPA_Spare, 0} }, + { CPU_Any, MOD_Op0Add|MOD_GasSufW, 16, 0, 0, 1, {0x01, 0, 0}, 0, 2, {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_16|OPA_Spare, 0} }, + { CPU_386, MOD_Op0Add|MOD_GasSufL, 32, 0, 0, 1, {0x01, 0, 0}, 0, 2, {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_32|OPA_Spare, 0} }, + { CPU_64, MOD_Op0Add|MOD_GasSufQ, 64, 0, 0, 1, {0x01, 0, 0}, 0, 2, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_64|OPA_Spare, 0} }, + { CPU_Any, MOD_Op0Add|MOD_GasSufB, 0, 0, 0, 1, {0x02, 0, 0}, 0, 2, {OPT_Reg|OPS_8|OPA_Spare, OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, 0} }, + { CPU_Any, MOD_Op0Add|MOD_GasSufW, 16, 0, 0, 1, {0x03, 0, 0}, 0, 2, {OPT_Reg|OPS_16|OPA_Spare, OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, 0} }, + { CPU_386, MOD_Op0Add|MOD_GasSufL, 32, 0, 0, 1, {0x03, 0, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} }, + { CPU_64, MOD_Op0Add|MOD_GasSufQ, 64, 0, 0, 1, {0x03, 0, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} } +}; + +static const x86_insn_info incdec_insn[] = { + { CPU_Any, MOD_Gap0|MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0xFE, 0, 0}, 0, 1, {OPT_RM|OPS_8|OPA_EA, 0, 0} }, + { CPU_Not64, MOD_Op0Add|MOD_GasSufW, 16, 0, 0, 1, {0x00, 0, 0}, 0, 1, {OPT_Reg|OPS_16|OPA_Op0Add, 0, 0} }, + { CPU_Any, MOD_Gap0|MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0xFF, 0, 0}, 0, 1, {OPT_RM|OPS_16|OPA_EA, 0, 0} }, + { CPU_386|CPU_Not64, MOD_Op0Add|MOD_GasSufL, 32, 0, 0, 1, {0x00, 0, 0}, 0, 1, {OPT_Reg|OPS_32|OPA_Op0Add, 0, 0} }, + { CPU_386, MOD_Gap0|MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0xFF, 0, 0}, 0, 1, {OPT_RM|OPS_32|OPA_EA, 0, 0} }, + { CPU_64, MOD_Gap0|MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, {0xFF, 0, 0}, 0, 1, {OPT_RM|OPS_64|OPA_EA, 0, 0} } +}; + +static const x86_insn_info f6_insn[] = { + { CPU_Any, MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0xF6, 0, 0}, 0, 1, {OPT_RM|OPS_8|OPA_EA, 0, 0} }, + { CPU_Any, MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0xF7, 0, 0}, 0, 1, {OPT_RM|OPS_16|OPA_EA, 0, 0} }, + { CPU_386, MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0xF7, 0, 0}, 0, 1, {OPT_RM|OPS_32|OPA_EA, 0, 0} }, + { CPU_64, MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, {0xF7, 0, 0}, 0, 1, {OPT_RM|OPS_64|OPA_EA, 0, 0} } +}; + +static const x86_insn_info div_insn[] = { + { CPU_Any, MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0xF6, 0, 0}, 0, 1, {OPT_RM|OPS_8|OPA_EA, 0, 0} }, + { CPU_Any, MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0xF7, 0, 0}, 0, 1, {OPT_RM|OPS_16|OPA_EA, 0, 0} }, + { CPU_386, MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0xF7, 0, 0}, 0, 1, {OPT_RM|OPS_32|OPA_EA, 0, 0} }, + { CPU_64, MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, {0xF7, 0, 0}, 0, 1, {OPT_RM|OPS_64|OPA_EA, 0, 0} }, + { CPU_Any, MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0xF6, 0, 0}, 0, 2, {OPT_Areg|OPS_8|OPA_None, OPT_RM|OPS_8|OPA_EA, 0} }, + { CPU_Any, MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0xF7, 0, 0}, 0, 2, {OPT_Areg|OPS_16|OPA_None, OPT_RM|OPS_16|OPA_EA, 0} }, + { CPU_386, MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0xF7, 0, 0}, 0, 2, {OPT_Areg|OPS_32|OPA_None, OPT_RM|OPS_32|OPA_EA, 0} }, + { CPU_64, MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, {0xF7, 0, 0}, 0, 2, {OPT_Areg|OPS_64|OPA_None, OPT_RM|OPS_64|OPA_EA, 0} } +}; + +static const x86_insn_info test_insn[] = { + { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xA8, 0, 0}, 0, 2, {OPT_Areg|OPS_8|OPA_None, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xA9, 0, 0}, 0, 2, {OPT_Areg|OPS_16|OPA_None, OPT_Imm|OPS_16|OPS_Relaxed|OPA_Imm, 0} }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xA9, 0, 0}, 0, 2, {OPT_Areg|OPS_32|OPA_None, OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm, 0} }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xA9, 0, 0}, 0, 2, {OPT_Areg|OPS_64|OPA_None, OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm, 0} }, + { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xF6, 0, 0}, 0, 2, {OPT_RM|OPS_8|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, + { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xF6, 0, 0}, 0, 2, {OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPA_Imm, 0} }, + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xF7, 0, 0}, 0, 2, {OPT_RM|OPS_16|OPA_EA, OPT_Imm|OPS_16|OPS_Relaxed|OPA_Imm, 0} }, + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xF7, 0, 0}, 0, 2, {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_16|OPA_Imm, 0} }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xF7, 0, 0}, 0, 2, {OPT_RM|OPS_32|OPA_EA, OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm, 0} }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xF7, 0, 0}, 0, 2, {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_32|OPA_Imm, 0} }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xF7, 0, 0}, 0, 2, {OPT_RM|OPS_64|OPA_EA, OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm, 0} }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xF7, 0, 0}, 0, 2, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_32|OPA_Imm, 0} }, + { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0x84, 0, 0}, 0, 2, {OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_8|OPA_Spare, 0} }, + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x85, 0, 0}, 0, 2, {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_16|OPA_Spare, 0} }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x85, 0, 0}, 0, 2, {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_32|OPA_Spare, 0} }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x85, 0, 0}, 0, 2, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_64|OPA_Spare, 0} }, + { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0x84, 0, 0}, 0, 2, {OPT_Reg|OPS_8|OPA_Spare, OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, 0} }, + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x85, 0, 0}, 0, 2, {OPT_Reg|OPS_16|OPA_Spare, OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, 0} }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x85, 0, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x85, 0, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} } +}; + +static const x86_insn_info aadm_insn[] = { + { CPU_Any, MOD_Op0Add, 0, 0, 0, 2, {0xD4, 0x0A, 0}, 0, 0, {0, 0, 0} }, + { CPU_Any, MOD_Op0Add, 0, 0, 0, 1, {0xD4, 0, 0}, 0, 1, {OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0, 0} } +}; + +static const x86_insn_info imul_insn[] = { + { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xF6, 0, 0}, 5, 1, {OPT_RM|OPS_8|OPA_EA, 0, 0} }, + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xF7, 0, 0}, 5, 1, {OPT_RM|OPS_16|OPA_EA, 0, 0} }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xF7, 0, 0}, 5, 1, {OPT_RM|OPS_32|OPA_EA, 0, 0} }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xF7, 0, 0}, 5, 1, {OPT_RM|OPS_64|OPA_EA, 0, 0} }, + { CPU_386, MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0xAF, 0}, 0, 2, {OPT_Reg|OPS_16|OPA_Spare, OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, 0} }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0xAF, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} }, + { CPU_386|CPU_64, MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0xAF, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} }, + { CPU_186, MOD_GasSufW, 16, 0, 0, 1, {0x6B, 0, 0}, 0, 3, {OPT_Reg|OPS_16|OPA_Spare, OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPA_SImm} }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x6B, 0, 0}, 0, 3, {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPA_SImm} }, + { CPU_186|CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x6B, 0, 0}, 0, 3, {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPA_SImm} }, + { CPU_186, MOD_GasSufW, 16, 0, 0, 1, {0x6B, 0, 0}, 0, 2, {OPT_Reg|OPS_16|OPA_SpareEA, OPT_Imm|OPS_8|OPA_SImm, 0} }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x6B, 0, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_SpareEA, OPT_Imm|OPS_8|OPA_SImm, 0} }, + { CPU_186|CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x6B, 0, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_SpareEA, OPT_Imm|OPS_8|OPA_SImm, 0} }, + { CPU_186, MOD_GasSufW, 16, 0, 0, 1, {0x6B, 0x69, 0}, 0, 3, {OPT_Reg|OPS_16|OPA_Spare, OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_16|OPS_Relaxed|OPA_SImm|OPAP_SImm8} }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x6B, 0x69, 0}, 0, 3, {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_32|OPS_Relaxed|OPA_SImm|OPAP_SImm8} }, + { CPU_186|CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x6B, 0x69, 0}, 0, 3, {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_32|OPS_Relaxed|OPA_SImm|OPAP_SImm8} }, + { CPU_186, MOD_GasSufW, 16, 0, 0, 1, {0x6B, 0x69, 0}, 0, 2, {OPT_Reg|OPS_16|OPA_SpareEA, OPT_Imm|OPS_16|OPS_Relaxed|OPA_SImm|OPAP_SImm8, 0} }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x6B, 0x69, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_SpareEA, OPT_Imm|OPS_32|OPS_Relaxed|OPA_SImm|OPAP_SImm8, 0} }, + { CPU_186|CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x6B, 0x69, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_SpareEA, OPT_Imm|OPS_32|OPS_Relaxed|OPA_SImm|OPAP_SImm8, 0} } +}; + +static const x86_insn_info shift_insn[] = { + { CPU_Any, MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0xD2, 0, 0}, 0, 2, {OPT_RM|OPS_8|OPA_EA, OPT_Creg|OPS_8|OPA_None, 0} }, + { CPU_Any, MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0xD0, 0, 0}, 0, 2, {OPT_RM|OPS_8|OPA_EA, OPT_Imm1|OPS_8|OPS_Relaxed|OPA_None, 0} }, + { CPU_186, MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0xC0, 0, 0}, 0, 2, {OPT_RM|OPS_8|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, + { CPU_Any, MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0xD3, 0, 0}, 0, 2, {OPT_RM|OPS_16|OPA_EA, OPT_Creg|OPS_8|OPA_None, 0} }, + { CPU_Any, MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0xD1, 0, 0}, 0, 2, {OPT_RM|OPS_16|OPA_EA, OPT_Imm1|OPS_8|OPS_Relaxed|OPA_None, 0} }, + { CPU_186, MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0xC1, 0, 0}, 0, 2, {OPT_RM|OPS_16|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, + { CPU_386, MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0xD3, 0, 0}, 0, 2, {OPT_RM|OPS_32|OPA_EA, OPT_Creg|OPS_8|OPA_None, 0} }, + { CPU_386, MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0xD1, 0, 0}, 0, 2, {OPT_RM|OPS_32|OPA_EA, OPT_Imm1|OPS_8|OPS_Relaxed|OPA_None, 0} }, + { CPU_386, MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0xC1, 0, 0}, 0, 2, {OPT_RM|OPS_32|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, + { CPU_64, MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, {0xD3, 0, 0}, 0, 2, {OPT_RM|OPS_64|OPA_EA, OPT_Creg|OPS_8|OPA_None, 0} }, + { CPU_64, MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, {0xD1, 0, 0}, 0, 2, {OPT_RM|OPS_64|OPA_EA, OPT_Imm1|OPS_8|OPS_Relaxed|OPA_None, 0} }, + { CPU_186|CPU_64, MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, {0xC1, 0, 0}, 0, 2, {OPT_RM|OPS_64|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, + { CPU_Any, MOD_SpAdd|MOD_GasOnly|MOD_GasSufB, 0, 0, 0, 1, {0xD0, 0, 0}, 0, 1, {OPT_RM|OPS_8|OPA_EA, 0, 0} }, + { CPU_Any, MOD_SpAdd|MOD_GasOnly|MOD_GasSufW, 16, 0, 0, 1, {0xD1, 0, 0}, 0, 1, {OPT_RM|OPS_16|OPA_EA, 0, 0} }, + { CPU_386, MOD_SpAdd|MOD_GasOnly|MOD_GasSufL, 32, 0, 0, 1, {0xD1, 0, 0}, 0, 1, {OPT_RM|OPS_32|OPA_EA, 0, 0} }, + { CPU_64, MOD_SpAdd|MOD_GasOnly|MOD_GasSufQ, 64, 0, 0, 1, {0xD1, 0, 0}, 0, 1, {OPT_RM|OPS_64|OPA_EA, 0, 0} } +}; + +static const x86_insn_info shlrd_insn[] = { + { CPU_386, MOD_Op1Add|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x00, 0}, 0, 3, {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_16|OPA_Spare, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, + { CPU_386, MOD_Op1Add|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x01, 0}, 0, 3, {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_16|OPA_Spare, OPT_Creg|OPS_8|OPA_None} }, + { CPU_386, MOD_Op1Add|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x00, 0}, 0, 3, {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_32|OPA_Spare, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, + { CPU_386, MOD_Op1Add|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x01, 0}, 0, 3, {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_32|OPA_Spare, OPT_Creg|OPS_8|OPA_None} }, + { CPU_386|CPU_64, MOD_Op1Add|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x00, 0}, 0, 3, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_64|OPA_Spare, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, + { CPU_386|CPU_64, MOD_Op1Add|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x01, 0}, 0, 3, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_64|OPA_Spare, OPT_Creg|OPS_8|OPA_None} }, + { CPU_386, MOD_Op1Add|MOD_GasOnly|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x01, 0}, 0, 2, {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_16|OPA_Spare, 0} }, + { CPU_386, MOD_Op1Add|MOD_GasOnly|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x01, 0}, 0, 2, {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_32|OPA_Spare, 0} }, + { CPU_386|CPU_64, MOD_Op1Add|MOD_GasOnly|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x01, 0}, 0, 2, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_64|OPA_Spare, 0} } +}; + +static const x86_insn_info call_insn[] = { + { CPU_Any, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 1, {OPT_ImmNotSegOff|OPS_Any|OPA_JmpRel, 0, 0} }, + { CPU_Any, 0, 16, 0, 0, 0, {0, 0, 0}, 0, 1, {OPT_ImmNotSegOff|OPS_16|OPA_JmpRel, 0, 0} }, + { CPU_386|CPU_Not64, 0, 32, 0, 0, 0, {0, 0, 0}, 0, 1, {OPT_ImmNotSegOff|OPS_32|OPA_JmpRel, 0, 0} }, + { CPU_64, 0, 64, 0, 0, 0, {0, 0, 0}, 0, 1, {OPT_ImmNotSegOff|OPS_32|OPA_JmpRel, 0, 0} }, + { CPU_Any, 0, 16, 64, 0, 1, {0xE8, 0, 0}, 0, 1, {OPT_Imm|OPS_16|OPTM_Near|OPA_JmpRel, 0, 0} }, + { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0xE8, 0, 0}, 0, 1, {OPT_Imm|OPS_32|OPTM_Near|OPA_JmpRel, 0, 0} }, + { CPU_64, 0, 64, 64, 0, 1, {0xE8, 0, 0}, 0, 1, {OPT_Imm|OPS_32|OPTM_Near|OPA_JmpRel, 0, 0} }, + { CPU_Any, 0, 0, 64, 0, 1, {0xE8, 0, 0}, 0, 1, {OPT_Imm|OPS_Any|OPTM_Near|OPA_JmpRel, 0, 0} }, + { CPU_Any, 0, 16, 0, 0, 1, {0xFF, 0, 0}, 2, 1, {OPT_RM|OPS_16|OPA_EA, 0, 0} }, + { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0xFF, 0, 0}, 2, 1, {OPT_RM|OPS_32|OPA_EA, 0, 0} }, + { CPU_64, 0, 64, 64, 0, 1, {0xFF, 0, 0}, 2, 1, {OPT_RM|OPS_64|OPA_EA, 0, 0} }, + { CPU_Any, 0, 0, 64, 0, 1, {0xFF, 0, 0}, 2, 1, {OPT_Mem|OPS_Any|OPA_EA, 0, 0} }, + { CPU_Any, 0, 16, 64, 0, 1, {0xFF, 0, 0}, 2, 1, {OPT_RM|OPS_16|OPTM_Near|OPA_EA, 0, 0} }, + { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0xFF, 0, 0}, 2, 1, {OPT_RM|OPS_32|OPTM_Near|OPA_EA, 0, 0} }, + { CPU_64, 0, 64, 64, 0, 1, {0xFF, 0, 0}, 2, 1, {OPT_RM|OPS_64|OPTM_Near|OPA_EA, 0, 0} }, + { CPU_Any, 0, 0, 64, 0, 1, {0xFF, 0, 0}, 2, 1, {OPT_Mem|OPS_Any|OPTM_Near|OPA_EA, 0, 0} }, + { CPU_Any, 0, 16, 0, 0, 1, {0xFF, 0, 0}, 3, 1, {OPT_Mem|OPS_16|OPTM_Far|OPA_EA, 0, 0} }, + { CPU_386, 0, 32, 0, 0, 1, {0xFF, 0, 0}, 3, 1, {OPT_Mem|OPS_32|OPTM_Far|OPA_EA, 0, 0} }, + { CPU_64, 0, 64, 0, 0, 1, {0xFF, 0, 0}, 3, 1, {OPT_Mem|OPS_64|OPTM_Far|OPA_EA, 0, 0} }, + { CPU_Any, 0, 0, 0, 0, 1, {0xFF, 0, 0}, 3, 1, {OPT_Mem|OPS_Any|OPTM_Far|OPA_EA, 0, 0} }, + { CPU_Not64, 0, 16, 0, 0, 1, {0x9A, 0, 0}, 3, 1, {OPT_Imm|OPS_16|OPTM_Far|OPA_JmpFar, 0, 0} }, + { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0x9A, 0, 0}, 3, 1, {OPT_Imm|OPS_32|OPTM_Far|OPA_JmpFar, 0, 0} }, + { CPU_Not64, 0, 0, 0, 0, 1, {0x9A, 0, 0}, 3, 1, {OPT_Imm|OPS_Any|OPTM_Far|OPA_JmpFar, 0, 0} }, + { CPU_Not64, 0, 16, 0, 0, 1, {0x9A, 0, 0}, 3, 1, {OPT_Imm|OPS_16|OPA_JmpFar, 0, 0} }, + { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0x9A, 0, 0}, 3, 1, {OPT_Imm|OPS_32|OPA_JmpFar, 0, 0} }, + { CPU_Not64, 0, 0, 0, 0, 1, {0x9A, 0, 0}, 3, 1, {OPT_Imm|OPS_Any|OPA_JmpFar, 0, 0} } +}; + +static const x86_insn_info jmp_insn[] = { + { CPU_Any, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 1, {OPT_ImmNotSegOff|OPS_Any|OPA_JmpRel, 0, 0} }, + { CPU_Any, 0, 16, 0, 0, 0, {0, 0, 0}, 0, 1, {OPT_ImmNotSegOff|OPS_16|OPA_JmpRel, 0, 0} }, + { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0x00, 0, 0}, 0, 1, {OPT_ImmNotSegOff|OPS_32|OPA_JmpRel, 0, 0} }, + { CPU_64, 0, 64, 0, 0, 1, {0x00, 0, 0}, 0, 1, {OPT_ImmNotSegOff|OPS_32|OPA_JmpRel, 0, 0} }, + { CPU_Any, 0, 0, 64, 0, 1, {0xEB, 0, 0}, 0, 1, {OPT_Imm|OPS_Any|OPTM_Short|OPA_JmpRel, 0, 0} }, + { CPU_Any, 0, 16, 64, 0, 1, {0xE9, 0, 0}, 0, 1, {OPT_Imm|OPS_16|OPTM_Near|OPA_JmpRel, 0, 0} }, + { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0xE9, 0, 0}, 0, 1, {OPT_Imm|OPS_32|OPTM_Near|OPA_JmpRel, 0, 0} }, + { CPU_64, 0, 64, 64, 0, 1, {0xE9, 0, 0}, 0, 1, {OPT_Imm|OPS_32|OPTM_Near|OPA_JmpRel, 0, 0} }, + { CPU_Any, 0, 0, 64, 0, 1, {0xE9, 0, 0}, 0, 1, {OPT_Imm|OPS_Any|OPTM_Near|OPA_JmpRel, 0, 0} }, + { CPU_Any, 0, 16, 64, 0, 1, {0xFF, 0, 0}, 4, 1, {OPT_RM|OPS_16|OPA_EA, 0, 0} }, + { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0xFF, 0, 0}, 4, 1, {OPT_RM|OPS_32|OPA_EA, 0, 0} }, + { CPU_64, 0, 64, 64, 0, 1, {0xFF, 0, 0}, 4, 1, {OPT_RM|OPS_64|OPA_EA, 0, 0} }, + { CPU_Any, 0, 0, 64, 0, 1, {0xFF, 0, 0}, 4, 1, {OPT_Mem|OPS_Any|OPA_EA, 0, 0} }, + { CPU_Any, 0, 16, 64, 0, 1, {0xFF, 0, 0}, 4, 1, {OPT_RM|OPS_16|OPTM_Near|OPA_EA, 0, 0} }, + { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0xFF, 0, 0}, 4, 1, {OPT_RM|OPS_32|OPTM_Near|OPA_EA, 0, 0} }, + { CPU_64, 0, 64, 64, 0, 1, {0xFF, 0, 0}, 4, 1, {OPT_RM|OPS_64|OPTM_Near|OPA_EA, 0, 0} }, + { CPU_Any, 0, 0, 64, 0, 1, {0xFF, 0, 0}, 4, 1, {OPT_Mem|OPS_Any|OPTM_Near|OPA_EA, 0, 0} }, + { CPU_Any, 0, 16, 0, 0, 1, {0xFF, 0, 0}, 5, 1, {OPT_Mem|OPS_16|OPTM_Far|OPA_EA, 0, 0} }, + { CPU_386, 0, 32, 0, 0, 1, {0xFF, 0, 0}, 5, 1, {OPT_Mem|OPS_32|OPTM_Far|OPA_EA, 0, 0} }, + { CPU_64, 0, 64, 0, 0, 1, {0xFF, 0, 0}, 5, 1, {OPT_Mem|OPS_64|OPTM_Far|OPA_EA, 0, 0} }, + { CPU_Any, 0, 0, 0, 0, 1, {0xFF, 0, 0}, 5, 1, {OPT_Mem|OPS_Any|OPTM_Far|OPA_EA, 0, 0} }, + { CPU_Not64, 0, 16, 0, 0, 1, {0xEA, 0, 0}, 3, 1, {OPT_Imm|OPS_16|OPTM_Far|OPA_JmpFar, 0, 0} }, + { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0xEA, 0, 0}, 3, 1, {OPT_Imm|OPS_32|OPTM_Far|OPA_JmpFar, 0, 0} }, + { CPU_Not64, 0, 0, 0, 0, 1, {0xEA, 0, 0}, 3, 1, {OPT_Imm|OPS_Any|OPTM_Far|OPA_JmpFar, 0, 0} }, + { CPU_Not64, 0, 16, 0, 0, 1, {0xEA, 0, 0}, 3, 1, {OPT_Imm|OPS_16|OPA_JmpFar, 0, 0} }, + { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0xEA, 0, 0}, 3, 1, {OPT_Imm|OPS_32|OPA_JmpFar, 0, 0} }, + { CPU_Not64, 0, 0, 0, 0, 1, {0xEA, 0, 0}, 3, 1, {OPT_Imm|OPS_Any|OPA_JmpFar, 0, 0} } +}; + +static const x86_insn_info retnf_insn[] = { + { CPU_Not64, MOD_Op0Add, 0, 0, 0, 1, {0x01, 0, 0}, 0, 0, {0, 0, 0} }, + { CPU_Not64, MOD_Op0Add, 0, 0, 0, 1, {0x00, 0, 0}, 0, 1, {OPT_Imm|OPS_16|OPS_Relaxed|OPA_Imm, 0, 0} }, + { CPU_64, MOD_Op0Add|MOD_OpSizeR, 0, 0, 0, 1, {0x01, 0, 0}, 0, 0, {0, 0, 0} }, + { CPU_64, MOD_Op0Add|MOD_OpSizeR, 0, 0, 0, 1, {0x00, 0, 0}, 0, 1, {OPT_Imm|OPS_16|OPS_Relaxed|OPA_Imm, 0, 0} }, + { CPU_Any, MOD_Op0Add|MOD_OpSizeR|MOD_GasSufL|MOD_GasSufQ|MOD_GasSufW, 0, 0, 0, 1, {0x01, 0, 0}, 0, 0, {0, 0, 0} }, + { CPU_Any, MOD_Op0Add|MOD_OpSizeR|MOD_GasSufL|MOD_GasSufQ|MOD_GasSufW, 0, 0, 0, 1, {0x00, 0, 0}, 0, 1, {OPT_Imm|OPS_16|OPS_Relaxed|OPA_Imm, 0, 0} } +}; + +static const x86_insn_info enter_insn[] = { + { CPU_186|CPU_Not64, MOD_GasNoRev|MOD_GasSufL, 0, 0, 0, 1, {0xC8, 0, 0}, 0, 2, {OPT_Imm|OPS_16|OPS_Relaxed|OPA_EA|OPAP_A16, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, + { CPU_186|CPU_64, MOD_GasNoRev|MOD_GasSufQ, 64, 64, 0, 1, {0xC8, 0, 0}, 0, 2, {OPT_Imm|OPS_16|OPS_Relaxed|OPA_EA|OPAP_A16, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, + { CPU_186, MOD_GasOnly|MOD_GasNoRev|MOD_GasSufW, 16, 0, 0, 1, {0xC8, 0, 0}, 0, 2, {OPT_Imm|OPS_16|OPS_Relaxed|OPA_EA|OPAP_A16, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} } +}; + +static const x86_insn_info jcc_insn[] = { + { CPU_Any, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 1, {OPT_Imm|OPS_Any|OPA_JmpRel, 0, 0} }, + { CPU_Any, 0, 16, 0, 0, 0, {0, 0, 0}, 0, 1, {OPT_Imm|OPS_16|OPA_JmpRel, 0, 0} }, + { CPU_386|CPU_Not64, 0, 32, 0, 0, 0, {0, 0, 0}, 0, 1, {OPT_Imm|OPS_32|OPA_JmpRel, 0, 0} }, + { CPU_64, 0, 64, 0, 0, 0, {0, 0, 0}, 0, 1, {OPT_Imm|OPS_32|OPA_JmpRel, 0, 0} }, + { CPU_Any, MOD_Op0Add, 0, 64, 0, 1, {0x70, 0, 0}, 0, 1, {OPT_Imm|OPS_Any|OPTM_Short|OPA_JmpRel, 0, 0} }, + { CPU_186, MOD_Op1Add, 16, 64, 0, 2, {0x0F, 0x80, 0}, 0, 1, {OPT_Imm|OPS_16|OPTM_Near|OPA_JmpRel, 0, 0} }, + { CPU_386|CPU_Not64, MOD_Op1Add, 32, 0, 0, 2, {0x0F, 0x80, 0}, 0, 1, {OPT_Imm|OPS_32|OPTM_Near|OPA_JmpRel, 0, 0} }, + { CPU_64, MOD_Op1Add, 64, 64, 0, 2, {0x0F, 0x80, 0}, 0, 1, {OPT_Imm|OPS_32|OPTM_Near|OPA_JmpRel, 0, 0} }, + { CPU_186, MOD_Op1Add, 0, 64, 0, 2, {0x0F, 0x80, 0}, 0, 1, {OPT_Imm|OPS_Any|OPTM_Near|OPA_JmpRel, 0, 0} } +}; + +static const x86_insn_info jcxz_insn[] = { + { CPU_Any, MOD_AdSizeR, 0, 0, 0, 0, {0, 0, 0}, 0, 1, {OPT_Imm|OPS_Any|OPA_JmpRel, 0, 0} }, + { CPU_Any, MOD_AdSizeR, 0, 64, 0, 1, {0xE3, 0, 0}, 0, 1, {OPT_Imm|OPS_Any|OPTM_Short|OPA_JmpRel, 0, 0} } +}; + +static const x86_insn_info loop_insn[] = { + { CPU_Any, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 1, {OPT_Imm|OPS_Any|OPA_JmpRel, 0, 0} }, + { CPU_Not64, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 2, {OPT_Imm|OPS_Any|OPA_JmpRel, OPT_Creg|OPS_16|OPA_AdSizeR, 0} }, + { CPU_386, 0, 0, 64, 0, 0, {0, 0, 0}, 0, 2, {OPT_Imm|OPS_Any|OPA_JmpRel, OPT_Creg|OPS_32|OPA_AdSizeR, 0} }, + { CPU_64, 0, 0, 64, 0, 0, {0, 0, 0}, 0, 2, {OPT_Imm|OPS_Any|OPA_JmpRel, OPT_Creg|OPS_64|OPA_AdSizeR, 0} }, + { CPU_Not64, MOD_Op0Add, 0, 0, 0, 1, {0xE0, 0, 0}, 0, 1, {OPT_Imm|OPS_Any|OPTM_Short|OPA_JmpRel, 0, 0} }, + { CPU_Any, MOD_Op0Add, 0, 64, 0, 1, {0xE0, 0, 0}, 0, 2, {OPT_Imm|OPS_Any|OPTM_Short|OPA_JmpRel, OPT_Creg|OPS_16|OPA_AdSizeR, 0} }, + { CPU_386, MOD_Op0Add, 0, 64, 0, 1, {0xE0, 0, 0}, 0, 2, {OPT_Imm|OPS_Any|OPTM_Short|OPA_JmpRel, OPT_Creg|OPS_32|OPA_AdSizeR, 0} }, + { CPU_64, MOD_Op0Add, 0, 64, 0, 1, {0xE0, 0, 0}, 0, 2, {OPT_Imm|OPS_Any|OPTM_Short|OPA_JmpRel, OPT_Creg|OPS_64|OPA_AdSizeR, 0} } +}; + +static const x86_insn_info setcc_insn[] = { + { CPU_386, MOD_Op1Add|MOD_GasSufB, 0, 0, 0, 2, {0x0F, 0x90, 0}, 2, 1, {OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, 0, 0} } +}; + +static const x86_insn_info cmpsd_insn[] = { + { CPU_386, MOD_GasIllegal, 32, 0, 0, 1, {0xA7, 0, 0}, 0, 0, {0, 0, 0} }, + { CPU_SSE2, 0, 0, 0, 0xF2, 2, {0x0F, 0xC2, 0}, 0, 3, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } +}; + +static const x86_insn_info movsd_insn[] = { + { CPU_386, MOD_GasIllegal, 32, 0, 0, 1, {0xA5, 0, 0}, 0, 0, {0, 0, 0} }, + { CPU_SSE2, 0, 0, 0, 0xF2, 2, {0x0F, 0x10, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} }, + { CPU_SSE2, 0, 0, 0, 0xF2, 2, {0x0F, 0x10, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0} }, + { CPU_SSE2, 0, 0, 0, 0xF2, 2, {0x0F, 0x11, 0}, 0, 2, {OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} } +}; + +static const x86_insn_info bittest_insn[] = { + { CPU_386, MOD_Op1Add|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_16|OPA_Spare, 0} }, + { CPU_386, MOD_Op1Add|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_32|OPA_Spare, 0} }, + { CPU_386|CPU_64, MOD_Op1Add|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_64|OPA_Spare, 0} }, + { CPU_386, MOD_Gap0|MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0xBA, 0}, 0, 2, {OPT_RM|OPS_16|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, + { CPU_386, MOD_Gap0|MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0xBA, 0}, 0, 2, {OPT_RM|OPS_32|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, + { CPU_386|CPU_64, MOD_Gap0|MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0xBA, 0}, 0, 2, {OPT_RM|OPS_64|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} } +}; + +static const x86_insn_info bsfr_insn[] = { + { CPU_386, MOD_Op1Add|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_Reg|OPS_16|OPA_Spare, OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, 0} }, + { CPU_386, MOD_Op1Add|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} }, + { CPU_386|CPU_64, MOD_Op1Add|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} } +}; + +static const x86_insn_info int_insn[] = { + { CPU_Any, 0, 0, 0, 0, 1, {0xCD, 0, 0}, 0, 1, {OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0, 0} } +}; + +static const x86_insn_info bound_insn[] = { + { CPU_186|CPU_Not64, MOD_GasSufW, 16, 0, 0, 1, {0x62, 0, 0}, 0, 2, {OPT_Reg|OPS_16|OPA_Spare, OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, 0} }, + { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0x62, 0, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, 0} } +}; + +static const x86_insn_info arpl_insn[] = { + { CPU_286|CPU_Not64|CPU_Prot, MOD_GasSufW, 0, 0, 0, 1, {0x63, 0, 0}, 0, 2, {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_16|OPA_Spare, 0} } +}; + +static const x86_insn_info str_insn[] = { + { CPU_286|CPU_Prot, MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x00, 0}, 1, 1, {OPT_Reg|OPS_16|OPA_EA, 0, 0} }, + { CPU_386|CPU_Prot, MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x00, 0}, 1, 1, {OPT_Reg|OPS_32|OPA_EA, 0, 0} }, + { CPU_286|CPU_64|CPU_Prot, MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x00, 0}, 1, 1, {OPT_Reg|OPS_64|OPA_EA, 0, 0} }, + { CPU_286|CPU_Prot, MOD_GasSufL|MOD_GasSufW, 0, 0, 0, 2, {0x0F, 0x00, 0}, 1, 1, {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, 0, 0} } +}; + +static const x86_insn_info prot286_insn[] = { + { CPU_286, MOD_Op1Add|MOD_SpAdd|MOD_GasSufW, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 1, {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, 0, 0} } +}; + +static const x86_insn_info sldtmsw_insn[] = { + { CPU_286, MOD_Op1Add|MOD_SpAdd|MOD_GasSufW, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 1, {OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, 0, 0} }, + { CPU_386, MOD_Op1Add|MOD_SpAdd|MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 1, {OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, 0, 0} }, + { CPU_286|CPU_64, MOD_Op1Add|MOD_SpAdd|MOD_GasSufQ, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 1, {OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0, 0} }, + { CPU_286, MOD_Op1Add|MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x00, 0}, 0, 1, {OPT_Reg|OPS_16|OPA_EA, 0, 0} }, + { CPU_386, MOD_Op1Add|MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x00, 0}, 0, 1, {OPT_Reg|OPS_32|OPA_EA, 0, 0} }, + { CPU_286|CPU_64, MOD_Op1Add|MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x00, 0}, 0, 1, {OPT_Reg|OPS_64|OPA_EA, 0, 0} } +}; + +static const x86_insn_info fld_insn[] = { + { CPU_FPU, MOD_GasSufS, 0, 0, 0, 1, {0xD9, 0, 0}, 0, 1, {OPT_Mem|OPS_32|OPA_EA, 0, 0} }, + { CPU_FPU, MOD_GasSufL, 0, 0, 0, 1, {0xDD, 0, 0}, 0, 1, {OPT_Mem|OPS_64|OPA_EA, 0, 0} }, + { CPU_FPU, 0, 0, 0, 0, 1, {0xDB, 0, 0}, 5, 1, {OPT_Mem|OPS_80|OPA_EA, 0, 0} }, + { CPU_FPU, 0, 0, 0, 0, 2, {0xD9, 0xC0, 0}, 0, 1, {OPT_Reg|OPS_80|OPA_Op1Add, 0, 0} } +}; + +static const x86_insn_info fstp_insn[] = { + { CPU_FPU, MOD_GasSufS, 0, 0, 0, 1, {0xD9, 0, 0}, 3, 1, {OPT_Mem|OPS_32|OPA_EA, 0, 0} }, + { CPU_FPU, MOD_GasSufL, 0, 0, 0, 1, {0xDD, 0, 0}, 3, 1, {OPT_Mem|OPS_64|OPA_EA, 0, 0} }, + { CPU_FPU, 0, 0, 0, 0, 1, {0xDB, 0, 0}, 7, 1, {OPT_Mem|OPS_80|OPA_EA, 0, 0} }, + { CPU_FPU, 0, 0, 0, 0, 2, {0xDD, 0xD8, 0}, 0, 1, {OPT_Reg|OPS_80|OPA_Op1Add, 0, 0} } +}; + +static const x86_insn_info fldstpt_insn[] = { + { CPU_FPU, MOD_SpAdd, 0, 0, 0, 1, {0xDB, 0, 0}, 0, 1, {OPT_Mem|OPS_80|OPA_EA, 0, 0} } +}; + +static const x86_insn_info fildstp_insn[] = { + { CPU_FPU, MOD_SpAdd|MOD_GasSufS, 0, 0, 0, 1, {0xDF, 0, 0}, 0, 1, {OPT_Mem|OPS_16|OPA_EA, 0, 0} }, + { CPU_FPU, MOD_SpAdd|MOD_GasSufL, 0, 0, 0, 1, {0xDB, 0, 0}, 0, 1, {OPT_Mem|OPS_32|OPA_EA, 0, 0} }, + { CPU_FPU, MOD_Gap0|MOD_Op0Add|MOD_SpAdd|MOD_GasSufQ, 0, 0, 0, 1, {0xDD, 0, 0}, 0, 1, {OPT_Mem|OPS_64|OPA_EA, 0, 0} } +}; + +static const x86_insn_info fbldstp_insn[] = { + { CPU_FPU, MOD_SpAdd, 0, 0, 0, 1, {0xDF, 0, 0}, 0, 1, {OPT_Mem|OPS_80|OPS_Relaxed|OPA_EA, 0, 0} } +}; + +static const x86_insn_info fst_insn[] = { + { CPU_FPU, MOD_GasSufS, 0, 0, 0, 1, {0xD9, 0, 0}, 2, 1, {OPT_Mem|OPS_32|OPA_EA, 0, 0} }, + { CPU_FPU, MOD_GasSufL, 0, 0, 0, 1, {0xDD, 0, 0}, 2, 1, {OPT_Mem|OPS_64|OPA_EA, 0, 0} }, + { CPU_FPU, 0, 0, 0, 0, 2, {0xDD, 0xD0, 0}, 0, 1, {OPT_Reg|OPS_80|OPA_Op1Add, 0, 0} } +}; + +static const x86_insn_info fxch_insn[] = { + { CPU_FPU, 0, 0, 0, 0, 2, {0xD9, 0xC8, 0}, 0, 1, {OPT_Reg|OPS_80|OPA_Op1Add, 0, 0} }, + { CPU_FPU, 0, 0, 0, 0, 2, {0xD9, 0xC8, 0}, 0, 2, {OPT_ST0|OPS_80|OPA_None, OPT_Reg|OPS_80|OPA_Op1Add, 0} }, + { CPU_FPU, 0, 0, 0, 0, 2, {0xD9, 0xC8, 0}, 0, 2, {OPT_Reg|OPS_80|OPA_Op1Add, OPT_ST0|OPS_80|OPA_None, 0} }, + { CPU_FPU, 0, 0, 0, 0, 2, {0xD9, 0xC9, 0}, 0, 0, {0, 0, 0} } +}; + +static const x86_insn_info fcom_insn[] = { + { CPU_FPU, MOD_Gap0|MOD_SpAdd|MOD_GasSufS, 0, 0, 0, 1, {0xD8, 0, 0}, 0, 1, {OPT_Mem|OPS_32|OPA_EA, 0, 0} }, + { CPU_FPU, MOD_Gap0|MOD_SpAdd|MOD_GasSufL, 0, 0, 0, 1, {0xDC, 0, 0}, 0, 1, {OPT_Mem|OPS_64|OPA_EA, 0, 0} }, + { CPU_FPU, MOD_Op1Add, 0, 0, 0, 2, {0xD8, 0x00, 0}, 0, 1, {OPT_Reg|OPS_80|OPA_Op1Add, 0, 0} }, + { CPU_FPU, MOD_Op1Add|MOD_GasOnly, 0, 0, 0, 2, {0xD8, 0x01, 0}, 0, 0, {0, 0, 0} }, + { CPU_FPU, MOD_Op1Add|MOD_GasIllegal, 0, 0, 0, 2, {0xD8, 0x00, 0}, 0, 2, {OPT_ST0|OPS_80|OPA_None, OPT_Reg|OPS_80|OPA_Op1Add, 0} } +}; + +static const x86_insn_info fcom2_insn[] = { + { CPU_286|CPU_FPU, MOD_Op1Add|MOD_Op0Add, 0, 0, 0, 2, {0x00, 0x00, 0}, 0, 1, {OPT_Reg|OPS_80|OPA_Op1Add, 0, 0} }, + { CPU_286|CPU_FPU, MOD_Op1Add|MOD_Op0Add, 0, 0, 0, 2, {0x00, 0x00, 0}, 0, 2, {OPT_ST0|OPS_80|OPA_None, OPT_Reg|OPS_80|OPA_Op1Add, 0} } +}; + +static const x86_insn_info farith_insn[] = { + { CPU_FPU, MOD_Gap0|MOD_Gap1|MOD_SpAdd|MOD_GasSufS, 0, 0, 0, 1, {0xD8, 0, 0}, 0, 1, {OPT_Mem|OPS_32|OPA_EA, 0, 0} }, + { CPU_FPU, MOD_Gap0|MOD_Gap1|MOD_SpAdd|MOD_GasSufL, 0, 0, 0, 1, {0xDC, 0, 0}, 0, 1, {OPT_Mem|OPS_64|OPA_EA, 0, 0} }, + { CPU_FPU, MOD_Gap0|MOD_Op1Add, 0, 0, 0, 2, {0xD8, 0x00, 0}, 0, 1, {OPT_Reg|OPS_80|OPA_Op1Add, 0, 0} }, + { CPU_FPU, MOD_Gap0|MOD_Op1Add, 0, 0, 0, 2, {0xD8, 0x00, 0}, 0, 2, {OPT_ST0|OPS_80|OPA_None, OPT_Reg|OPS_80|OPA_Op1Add, 0} }, + { CPU_FPU, MOD_Op1Add, 0, 0, 0, 2, {0xDC, 0x00, 0}, 0, 1, {OPT_Reg|OPS_80|OPTM_To|OPA_Op1Add, 0, 0} }, + { CPU_FPU, MOD_Op1Add|MOD_GasIllegal, 0, 0, 0, 2, {0xDC, 0x00, 0}, 0, 2, {OPT_Reg|OPS_80|OPA_Op1Add, OPT_ST0|OPS_80|OPA_None, 0} }, + { CPU_FPU, MOD_Gap0|MOD_Op1Add|MOD_GasOnly, 0, 0, 0, 2, {0xDC, 0x00, 0}, 0, 2, {OPT_Reg|OPS_80|OPA_Op1Add, OPT_ST0|OPS_80|OPA_None, 0} } +}; + +static const x86_insn_info farithp_insn[] = { + { CPU_FPU, MOD_Op1Add, 0, 0, 0, 2, {0xDE, 0x01, 0}, 0, 0, {0, 0, 0} }, + { CPU_FPU, MOD_Op1Add, 0, 0, 0, 2, {0xDE, 0x00, 0}, 0, 1, {OPT_Reg|OPS_80|OPA_Op1Add, 0, 0} }, + { CPU_FPU, MOD_Op1Add, 0, 0, 0, 2, {0xDE, 0x00, 0}, 0, 2, {OPT_Reg|OPS_80|OPA_Op1Add, OPT_ST0|OPS_80|OPA_None, 0} } +}; + +static const x86_insn_info fiarith_insn[] = { + { CPU_FPU, MOD_Op0Add|MOD_SpAdd|MOD_GasSufS, 0, 0, 0, 1, {0x04, 0, 0}, 0, 1, {OPT_Mem|OPS_16|OPA_EA, 0, 0} }, + { CPU_FPU, MOD_Op0Add|MOD_SpAdd|MOD_GasSufL, 0, 0, 0, 1, {0x00, 0, 0}, 0, 1, {OPT_Mem|OPS_32|OPA_EA, 0, 0} } +}; + +static const x86_insn_info fldnstcw_insn[] = { + { CPU_FPU, MOD_SpAdd|MOD_GasSufW, 0, 0, 0, 1, {0xD9, 0, 0}, 0, 1, {OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, 0, 0} } +}; + +static const x86_insn_info fstcw_insn[] = { + { CPU_FPU, MOD_GasSufW, 0, 0, 0, 2, {0x9B, 0xD9, 0}, 7, 1, {OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, 0, 0} } +}; + +static const x86_insn_info fnstsw_insn[] = { + { CPU_FPU, MOD_GasSufW, 0, 0, 0, 1, {0xDD, 0, 0}, 7, 1, {OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, 0, 0} }, + { CPU_FPU, MOD_GasSufW, 0, 0, 0, 2, {0xDF, 0xE0, 0}, 0, 1, {OPT_Areg|OPS_16|OPA_None, 0, 0} } +}; + +static const x86_insn_info fstsw_insn[] = { + { CPU_FPU, MOD_GasSufW, 0, 0, 0, 2, {0x9B, 0xDD, 0}, 7, 1, {OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, 0, 0} }, + { CPU_FPU, MOD_GasSufW, 0, 0, 0, 3, {0x9B, 0xDF, 0xE0}, 0, 1, {OPT_Areg|OPS_16|OPA_None, 0, 0} } +}; + +static const x86_insn_info ffree_insn[] = { + { CPU_FPU, MOD_Op0Add, 0, 0, 0, 2, {0x00, 0xC0, 0}, 0, 1, {OPT_Reg|OPS_80|OPA_Op1Add, 0, 0} } +}; + +static const x86_insn_info bswap_insn[] = { + { CPU_486, MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0xC8, 0}, 0, 1, {OPT_Reg|OPS_32|OPA_Op1Add, 0, 0} }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0xC8, 0}, 0, 1, {OPT_Reg|OPS_64|OPA_Op1Add, 0, 0} } +}; + +static const x86_insn_info cmpxchgxadd_insn[] = { + { CPU_486, MOD_Op1Add|MOD_GasSufB, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_8|OPA_Spare, 0} }, + { CPU_486, MOD_Op1Add|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x01, 0}, 0, 2, {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_16|OPA_Spare, 0} }, + { CPU_486, MOD_Op1Add|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x01, 0}, 0, 2, {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_32|OPA_Spare, 0} }, + { CPU_486|CPU_64, MOD_Op1Add|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x01, 0}, 0, 2, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_64|OPA_Spare, 0} } +}; + +static const x86_insn_info cmpxchg8b_insn[] = { + { CPU_586, MOD_GasSufQ, 0, 0, 0, 2, {0x0F, 0xC7, 0}, 1, 1, {OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0, 0} } +}; + +static const x86_insn_info cmovcc_insn[] = { + { CPU_686, MOD_Op1Add|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x40, 0}, 0, 2, {OPT_Reg|OPS_16|OPA_Spare, OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, 0} }, + { CPU_686, MOD_Op1Add|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x40, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} }, + { CPU_64|CPU_686, MOD_Op1Add|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x40, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} } +}; + +static const x86_insn_info fcmovcc_insn[] = { + { CPU_686|CPU_FPU, MOD_Op1Add|MOD_Op0Add, 0, 0, 0, 2, {0x00, 0x00, 0}, 0, 2, {OPT_ST0|OPS_80|OPA_None, OPT_Reg|OPS_80|OPA_Op1Add, 0} } +}; + +static const x86_insn_info movnti_insn[] = { + { CPU_P4, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0xC3, 0}, 0, 2, {OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_32|OPA_Spare, 0} }, + { CPU_64|CPU_P4, MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0xC3, 0}, 0, 2, {OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_64|OPA_Spare, 0} } +}; + +static const x86_insn_info clflush_insn[] = { + { CPU_P3, 0, 0, 0, 0, 2, {0x0F, 0xAE, 0}, 7, 1, {OPT_Mem|OPS_8|OPS_Relaxed|OPA_EA, 0, 0} } +}; + +static const x86_insn_info movd_insn[] = { + { CPU_386|CPU_MMX, 0, 0, 0, 0, 2, {0x0F, 0x6E, 0}, 0, 2, {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} }, + { CPU_64|CPU_MMX, 0, 64, 0, 0, 2, {0x0F, 0x6E, 0}, 0, 2, {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} }, + { CPU_386|CPU_MMX, 0, 0, 0, 0, 2, {0x0F, 0x7E, 0}, 0, 2, {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_64|OPA_Spare, 0} }, + { CPU_64|CPU_MMX, 0, 64, 0, 0, 2, {0x0F, 0x7E, 0}, 0, 2, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_64|OPA_Spare, 0} }, + { CPU_386|CPU_SSE2, 0, 0, 0, 0x66, 2, {0x0F, 0x6E, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} }, + { CPU_64|CPU_SSE2, 0, 64, 0, 0x66, 2, {0x0F, 0x6E, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} }, + { CPU_386|CPU_SSE2, 0, 0, 0, 0x66, 2, {0x0F, 0x7E, 0}, 0, 2, {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} }, + { CPU_64|CPU_SSE2, 0, 64, 0, 0x66, 2, {0x0F, 0x7E, 0}, 0, 2, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} } +}; + +static const x86_insn_info movq_insn[] = { + { CPU_MMX, MOD_GasIllegal, 0, 0, 0, 2, {0x0F, 0x6F, 0}, 0, 2, {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, 0} }, + { CPU_64|CPU_MMX, MOD_GasIllegal, 64, 0, 0, 2, {0x0F, 0x6E, 0}, 0, 2, {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} }, + { CPU_MMX, MOD_GasIllegal, 0, 0, 0, 2, {0x0F, 0x7F, 0}, 0, 2, {OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_64|OPA_Spare, 0} }, + { CPU_64|CPU_MMX, MOD_GasIllegal, 64, 0, 0, 2, {0x0F, 0x7E, 0}, 0, 2, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_64|OPA_Spare, 0} }, + { CPU_SSE2, MOD_GasIllegal, 0, 0, 0xF3, 2, {0x0F, 0x7E, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} }, + { CPU_SSE2, MOD_GasIllegal, 0, 0, 0xF3, 2, {0x0F, 0x7E, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, 0} }, + { CPU_64|CPU_SSE2, MOD_GasIllegal, 64, 0, 0x66, 2, {0x0F, 0x6E, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} }, + { CPU_SSE2, MOD_GasIllegal, 0, 0, 0x66, 2, {0x0F, 0xD6, 0}, 0, 2, {OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} }, + { CPU_64|CPU_SSE2, MOD_GasIllegal, 64, 0, 0x66, 2, {0x0F, 0x7E, 0}, 0, 2, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} } +}; + +static const x86_insn_info mmxsse2_insn[] = { + { CPU_MMX, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, 0} }, + { CPU_SSE2, MOD_Op1Add, 0, 0, 0x66, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, 0} } +}; + +static const x86_insn_info pshift_insn[] = { + { CPU_MMX, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, 0} }, + { CPU_MMX, MOD_Gap0|MOD_Op1Add|MOD_SpAdd, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_64|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, + { CPU_SSE2, MOD_Op1Add, 0, 0, 0x66, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, 0} }, + { CPU_SSE2, MOD_Gap0|MOD_Op1Add|MOD_SpAdd, 0, 0, 0x66, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} } +}; + +static const x86_insn_info sseps_insn[] = { + { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, 0} } +}; + +static const x86_insn_info cvt_rx_xmm32_insn[] = { + { CPU_386|CPU_SSE, MOD_Op1Add|MOD_PreAdd|MOD_GasSufL, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} }, + { CPU_386|CPU_SSE, MOD_Op1Add|MOD_PreAdd|MOD_GasSufL, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, 0} }, + { CPU_64|CPU_SSE, MOD_Op1Add|MOD_PreAdd|MOD_GasSufQ, 64, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} }, + { CPU_64|CPU_SSE, MOD_Op1Add|MOD_PreAdd|MOD_GasSufQ, 64, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, 0} } +}; + +static const x86_insn_info cvt_mm_xmm64_insn[] = { + { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} }, + { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0} } +}; + +static const x86_insn_info cvt_xmm_mm_ps_insn[] = { + { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, 0} } +}; + +static const x86_insn_info cvt_xmm_rmx_insn[] = { + { CPU_386|CPU_SSE, MOD_Op1Add|MOD_PreAdd|MOD_GasSufL, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} }, + { CPU_64|CPU_SSE, MOD_Op1Add|MOD_PreAdd|MOD_GasSufQ, 64, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} } +}; + +static const x86_insn_info ssess_insn[] = { + { CPU_SSE, MOD_Op1Add|MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, 0} } +}; + +static const x86_insn_info ssecmpps_insn[] = { + { CPU_SSE, MOD_Imm8, 0, 0, 0, 2, {0x0F, 0xC2, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, 0} } +}; + +static const x86_insn_info ssecmpss_insn[] = { + { CPU_SSE, MOD_PreAdd|MOD_Imm8, 0, 0, 0x00, 2, {0x0F, 0xC2, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, 0} } +}; + +static const x86_insn_info ssepsimm_insn[] = { + { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 3, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } +}; + +static const x86_insn_info ssessimm_insn[] = { + { CPU_SSE, MOD_Op1Add|MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 3, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } +}; + +static const x86_insn_info ldstmxcsr_insn[] = { + { CPU_SSE, MOD_SpAdd, 0, 0, 0, 2, {0x0F, 0xAE, 0}, 0, 1, {OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, 0, 0} } +}; + +static const x86_insn_info maskmovq_insn[] = { + { CPU_MMX|CPU_P3, 0, 0, 0, 0, 2, {0x0F, 0xF7, 0}, 0, 2, {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_SIMDReg|OPS_64|OPA_EA, 0} } +}; + +static const x86_insn_info movaups_insn[] = { + { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, 0} }, + { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x01, 0}, 0, 2, {OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} } +}; + +static const x86_insn_info movhllhps_insn[] = { + { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} } +}; + +static const x86_insn_info movhlps_insn[] = { + { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0} }, + { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x01, 0}, 0, 2, {OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} } +}; + +static const x86_insn_info movmskps_insn[] = { + { CPU_386|CPU_SSE, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0x50, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} }, + { CPU_64|CPU_SSE, MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x50, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} } +}; + +static const x86_insn_info movntps_insn[] = { + { CPU_SSE, 0, 0, 0, 0, 2, {0x0F, 0x2B, 0}, 0, 2, {OPT_Mem|OPS_128|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} } +}; + +static const x86_insn_info movntq_insn[] = { + { CPU_SSE, 0, 0, 0, 0, 2, {0x0F, 0xE7, 0}, 0, 2, {OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_64|OPA_Spare, 0} } +}; + +static const x86_insn_info movss_insn[] = { + { CPU_SSE, 0, 0, 0, 0xF3, 2, {0x0F, 0x10, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} }, + { CPU_SSE, 0, 0, 0, 0xF3, 2, {0x0F, 0x10, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, 0} }, + { CPU_SSE, 0, 0, 0, 0xF3, 2, {0x0F, 0x11, 0}, 0, 2, {OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} } +}; + +static const x86_insn_info pextrw_insn[] = { + { CPU_MMX|CPU_P3, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0xC5, 0}, 0, 3, {OPT_Reg|OPS_32|OPA_Spare, OPT_SIMDReg|OPS_64|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, + { CPU_386|CPU_SSE2, MOD_GasSufL, 0, 0, 0x66, 2, {0x0F, 0xC5, 0}, 0, 3, {OPT_Reg|OPS_32|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, + { CPU_64|CPU_MMX|CPU_P3, MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0xC5, 0}, 0, 3, {OPT_Reg|OPS_64|OPA_Spare, OPT_SIMDReg|OPS_64|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, + { CPU_64|CPU_SSE2, MOD_GasSufQ, 64, 0, 0x66, 2, {0x0F, 0xC5, 0}, 0, 3, {OPT_Reg|OPS_64|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, + { CPU_SSE41, 0, 0, 0, 0x66, 3, {0x0F, 0x3A, 0x15}, 0, 3, {OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, + { CPU_386|CPU_SSE41, 0, 32, 0, 0x66, 3, {0x0F, 0x3A, 0x15}, 0, 3, {OPT_Reg|OPS_32|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, + { CPU_64|CPU_SSE41, 0, 64, 0, 0x66, 3, {0x0F, 0x3A, 0x15}, 0, 3, {OPT_Reg|OPS_64|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } +}; + +static const x86_insn_info pinsrw_insn[] = { + { CPU_MMX|CPU_P3, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0xC4, 0}, 0, 3, {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_Reg|OPS_32|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, + { CPU_64|CPU_MMX|CPU_P3, MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0xC4, 0}, 0, 3, {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_Reg|OPS_64|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, + { CPU_MMX|CPU_P3, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0xC4, 0}, 0, 3, {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, + { CPU_386|CPU_SSE2, MOD_GasSufL, 0, 0, 0x66, 2, {0x0F, 0xC4, 0}, 0, 3, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Reg|OPS_32|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, + { CPU_64|CPU_SSE2, MOD_GasSufQ, 64, 0, 0x66, 2, {0x0F, 0xC4, 0}, 0, 3, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Reg|OPS_64|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, + { CPU_SSE2, MOD_GasSufL, 0, 0, 0x66, 2, {0x0F, 0xC4, 0}, 0, 3, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } +}; + +static const x86_insn_info pmovmskb_insn[] = { + { CPU_MMX|CPU_P3, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0xD7, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_SIMDReg|OPS_64|OPA_EA, 0} }, + { CPU_386|CPU_SSE2, MOD_GasSufL, 0, 0, 0x66, 2, {0x0F, 0xD7, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} }, + { CPU_64|CPU_MMX|CPU_P3, MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0xD7, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_SIMDReg|OPS_64|OPA_EA, 0} }, + { CPU_64|CPU_SSE2, MOD_GasSufQ, 64, 0, 0x66, 2, {0x0F, 0xD7, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} } +}; + +static const x86_insn_info pshufw_insn[] = { + { CPU_MMX|CPU_P3, 0, 0, 0, 0, 2, {0x0F, 0x70, 0}, 0, 3, {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } +}; + +static const x86_insn_info cvt_xmm_xmm64_ss_insn[] = { + { CPU_SSE2, MOD_Op1Add|MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} }, + { CPU_SSE2, MOD_Op1Add|MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0} } +}; + +static const x86_insn_info cvt_xmm_xmm64_ps_insn[] = { + { CPU_SSE2, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} }, + { CPU_SSE2, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0} } +}; + +static const x86_insn_info cvt_rx_xmm64_insn[] = { + { CPU_386|CPU_SSE2, MOD_Op1Add|MOD_PreAdd|MOD_GasSufL, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} }, + { CPU_386|CPU_SSE2, MOD_Op1Add|MOD_PreAdd|MOD_GasSufL, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0} }, + { CPU_64|CPU_SSE2, MOD_Op1Add|MOD_PreAdd|MOD_GasSufQ, 64, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} }, + { CPU_64|CPU_SSE2, MOD_Op1Add|MOD_PreAdd|MOD_GasSufQ, 64, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0} } +}; + +static const x86_insn_info cvt_mm_xmm_insn[] = { + { CPU_SSE2, MOD_Op1Add|MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, 0} } +}; + +static const x86_insn_info cvt_xmm_mm_ss_insn[] = { + { CPU_SSE, MOD_Op1Add|MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, 0} } +}; + +static const x86_insn_info movaupd_insn[] = { + { CPU_SSE2, MOD_Op1Add, 0, 0, 0x66, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, 0} }, + { CPU_SSE2, MOD_Op1Add, 0, 0, 0x66, 2, {0x0F, 0x01, 0}, 0, 2, {OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} } +}; + +static const x86_insn_info movhlpd_insn[] = { + { CPU_SSE2, MOD_Op1Add, 0, 0, 0x66, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0} }, + { CPU_SSE2, MOD_Op1Add, 0, 0, 0x66, 2, {0x0F, 0x01, 0}, 0, 2, {OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} } +}; + +static const x86_insn_info movmskpd_insn[] = { + { CPU_386|CPU_SSE2, MOD_GasSufL, 0, 0, 0x66, 2, {0x0F, 0x50, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} }, + { CPU_64|CPU_SSE2, MOD_GasSufQ, 0, 0, 0x66, 2, {0x0F, 0x50, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} } +}; + +static const x86_insn_info movntpddq_insn[] = { + { CPU_SSE2, MOD_Op1Add, 0, 0, 0x66, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_Mem|OPS_128|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} } +}; + +static const x86_insn_info vmxmemrd_insn[] = { + { CPU_Not64|CPU_P4, MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x78, 0}, 0, 2, {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_32|OPA_Spare, 0} }, + { CPU_64|CPU_P4, MOD_GasSufQ, 64, 64, 0, 2, {0x0F, 0x78, 0}, 0, 2, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_64|OPA_Spare, 0} } +}; + +static const x86_insn_info vmxmemwr_insn[] = { + { CPU_Not64|CPU_P4, MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x79, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} }, + { CPU_64|CPU_P4, MOD_GasSufQ, 64, 64, 0, 2, {0x0F, 0x79, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} } +}; + +static const x86_insn_info vmxtwobytemem_insn[] = { + { CPU_P4, MOD_SpAdd, 0, 0, 0, 2, {0x0F, 0xC7, 0}, 0, 1, {OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0, 0} } +}; + +static const x86_insn_info vmxthreebytemem_insn[] = { + { CPU_P4, MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0xC7, 0}, 6, 1, {OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0, 0} } +}; + +static const x86_insn_info cvt_xmm_xmm32_insn[] = { + { CPU_SSE2, MOD_Op1Add|MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} }, + { CPU_SSE2, MOD_Op1Add|MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, 0} } +}; + +static const x86_insn_info maskmovdqu_insn[] = { + { CPU_SSE2, 0, 0, 0, 0x66, 2, {0x0F, 0xF7, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} } +}; + +static const x86_insn_info movdqau_insn[] = { + { CPU_SSE2, MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0x6F, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, 0} }, + { CPU_SSE2, MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0x7F, 0}, 0, 2, {OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} } +}; + +static const x86_insn_info movdq2q_insn[] = { + { CPU_SSE2, 0, 0, 0, 0xF2, 2, {0x0F, 0xD6, 0}, 0, 2, {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} } +}; + +static const x86_insn_info movq2dq_insn[] = { + { CPU_SSE2, 0, 0, 0, 0xF3, 2, {0x0F, 0xD6, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_64|OPA_EA, 0} } +}; + +static const x86_insn_info pslrldq_insn[] = { + { CPU_SSE2, MOD_SpAdd, 0, 0, 0x66, 2, {0x0F, 0x73, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} } +}; + +static const x86_insn_info lddqu_insn[] = { + { CPU_SSE3, 0, 0, 0, 0xF2, 2, {0x0F, 0xF0, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_Any|OPA_EA, 0} } +}; + +static const x86_insn_info ssse3_insn[] = { + { CPU_SSSE3, MOD_Op2Add, 0, 0, 0, 3, {0x0F, 0x38, 0x00}, 0, 2, {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, 0} }, + { CPU_SSSE3, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, 0} } +}; + +static const x86_insn_info ssse3imm_insn[] = { + { CPU_SSSE3, MOD_Op2Add, 0, 0, 0, 3, {0x0F, 0x3A, 0x00}, 0, 3, {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, + { CPU_SSSE3, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x3A, 0x00}, 0, 3, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } +}; + +static const x86_insn_info sse4_insn[] = { + { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, 0} } +}; + +static const x86_insn_info sse4imm_insn[] = { + { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x3A, 0x00}, 0, 3, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } +}; + +static const x86_insn_info sse4xmm0_insn[] = { + { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, 0} }, + { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 3, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, OPT_XMM0|OPS_128|OPA_None} } +}; + +static const x86_insn_info crc32_insn[] = { + { CPU_386|CPU_SSE42, MOD_GasSufB, 0, 0, 0xF2, 3, {0x0F, 0x38, 0xF0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_8|OPA_EA, 0} }, + { CPU_386|CPU_SSE42, MOD_GasSufW, 16, 0, 0xF2, 3, {0x0F, 0x38, 0xF1}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_16|OPA_EA, 0} }, + { CPU_386|CPU_SSE42, MOD_GasSufL, 32, 0, 0xF2, 3, {0x0F, 0x38, 0xF1}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} }, + { CPU_64|CPU_SSE42, MOD_GasSufB, 64, 0, 0xF2, 3, {0x0F, 0x38, 0xF0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_8|OPA_EA, 0} }, + { CPU_64|CPU_SSE42, MOD_GasSufQ, 64, 0, 0xF2, 3, {0x0F, 0x38, 0xF1}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} } +}; + +static const x86_insn_info extractps_insn[] = { + { CPU_386|CPU_SSE41, 0, 32, 0, 0x66, 3, {0x0F, 0x3A, 0x17}, 0, 3, {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, + { CPU_64|CPU_SSE41, 0, 64, 0, 0x66, 3, {0x0F, 0x3A, 0x17}, 0, 3, {OPT_Reg|OPS_64|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } +}; + +static const x86_insn_info insertps_insn[] = { + { CPU_SSE41, 0, 0, 0, 0x66, 3, {0x0F, 0x3A, 0x21}, 0, 3, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, + { CPU_SSE41, 0, 0, 0, 0x66, 3, {0x0F, 0x3A, 0x21}, 0, 3, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } +}; + +static const x86_insn_info movntdqa_insn[] = { + { CPU_SSE41, 0, 0, 0, 0x66, 3, {0x0F, 0x38, 0x2A}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_128|OPS_Relaxed|OPA_EA, 0} } +}; + +static const x86_insn_info sse4pcmpstr_insn[] = { + { CPU_SSE42, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x3A, 0x00}, 0, 3, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } +}; + +static const x86_insn_info pextrb_insn[] = { + { CPU_SSE41, 0, 0, 0, 0x66, 3, {0x0F, 0x3A, 0x14}, 0, 3, {OPT_Mem|OPS_8|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, + { CPU_386|CPU_SSE41, 0, 32, 0, 0x66, 3, {0x0F, 0x3A, 0x14}, 0, 3, {OPT_Reg|OPS_32|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, + { CPU_64|CPU_SSE41, 0, 64, 0, 0x66, 3, {0x0F, 0x3A, 0x14}, 0, 3, {OPT_Reg|OPS_64|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } +}; + +static const x86_insn_info pextrd_insn[] = { + { CPU_386|CPU_SSE41, 0, 32, 0, 0x66, 3, {0x0F, 0x3A, 0x16}, 0, 3, {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } +}; + +static const x86_insn_info pextrq_insn[] = { + { CPU_64|CPU_SSE41, 0, 64, 0, 0x66, 3, {0x0F, 0x3A, 0x16}, 0, 3, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } +}; + +static const x86_insn_info pinsrb_insn[] = { + { CPU_SSE41, 0, 0, 0, 0x66, 3, {0x0F, 0x3A, 0x20}, 0, 3, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_8|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, + { CPU_386|CPU_SSE41, 0, 32, 0, 0x66, 3, {0x0F, 0x3A, 0x20}, 0, 3, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Reg|OPS_32|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } +}; + +static const x86_insn_info pinsrd_insn[] = { + { CPU_386|CPU_SSE41, 0, 32, 0, 0x66, 3, {0x0F, 0x3A, 0x22}, 0, 3, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } +}; + +static const x86_insn_info pinsrq_insn[] = { + { CPU_64|CPU_SSE41, 0, 64, 0, 0x66, 3, {0x0F, 0x3A, 0x22}, 0, 3, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } +}; + +static const x86_insn_info sse4m64_insn[] = { + { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0} }, + { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} } +}; + +static const x86_insn_info sse4m32_insn[] = { + { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, 0} }, + { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} } +}; + +static const x86_insn_info sse4m16_insn[] = { + { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, 0} }, + { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} } +}; + +static const x86_insn_info cnt_insn[] = { + { CPU_Any, MOD_Op1Add|MOD_GasSufW, 16, 0, 0xF3, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_Reg|OPS_16|OPA_Spare, OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, 0} }, + { CPU_386, MOD_Op1Add|MOD_GasSufL, 32, 0, 0xF3, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} }, + { CPU_64, MOD_Op1Add|MOD_GasSufQ, 64, 0, 0xF3, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} } +}; + +static const x86_insn_info extrq_insn[] = { + { CPU_SSE41, 0, 0, 0, 0x66, 2, {0x0F, 0x78, 0}, 0, 3, {OPT_SIMDReg|OPS_128|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, + { CPU_SSE41, 0, 0, 0, 0x66, 2, {0x0F, 0x79, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} } +}; + +static const x86_insn_info insertq_insn[] = { + { CPU_SSE41, 0, 0, 0, 0xF2, 2, {0x0F, 0x78, 0}, 0, 4, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_EA} }, + { CPU_SSE41, 0, 0, 0, 0xF2, 2, {0x0F, 0x79, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} } +}; + +static const x86_insn_info movntsd_insn[] = { + { CPU_SSE41, 0, 0, 0, 0xF2, 2, {0x0F, 0x2B, 0}, 0, 2, {OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} } +}; + +static const x86_insn_info movntss_insn[] = { + { CPU_SSE41, 0, 0, 0, 0xF3, 2, {0x0F, 0x2B, 0}, 0, 2, {OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} } +}; + +static const x86_insn_info now3d_insn[] = { + { CPU_3DNow, MOD_Imm8, 0, 0, 0, 2, {0x0F, 0x0F, 0}, 0, 2, {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, 0} } +}; + +static const x86_insn_info cmpxchg16b_insn[] = { + { CPU_64, 0, 64, 0, 0, 2, {0x0F, 0xC7, 0}, 1, 1, {OPT_Mem|OPS_128|OPS_Relaxed|OPA_EA, 0, 0} } +}; + +static const x86_insn_info invlpga_insn[] = { + { CPU_SVM, 0, 0, 0, 0, 3, {0x0F, 0x01, 0xDF}, 0, 0, {0, 0, 0} }, + { CPU_386|CPU_SVM, 0, 0, 0, 0, 3, {0x0F, 0x01, 0xDF}, 0, 2, {OPT_MemrAX|OPS_Any|OPA_AdSizeEA, OPT_Creg|OPS_32|OPA_None, 0} } +}; + +static const x86_insn_info skinit_insn[] = { + { CPU_SVM, 0, 0, 0, 0, 3, {0x0F, 0x01, 0xDE}, 0, 0, {0, 0, 0} }, + { CPU_SVM, 0, 0, 0, 0, 3, {0x0F, 0x01, 0xDE}, 0, 1, {OPT_MemEAX|OPS_Any|OPA_None, 0, 0} } +}; + +static const x86_insn_info svm_rax_insn[] = { + { CPU_SVM, MOD_Op2Add, 0, 0, 0, 3, {0x0F, 0x01, 0x00}, 0, 0, {0, 0, 0} }, + { CPU_SVM, MOD_Op2Add, 0, 0, 0, 3, {0x0F, 0x01, 0x00}, 0, 1, {OPT_MemrAX|OPS_Any|OPA_AdSizeEA, 0, 0} } +}; + +static const x86_insn_info padlock_insn[] = { + { CPU_PadLock, MOD_Op1Add|MOD_PreAdd|MOD_Imm8, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 0, {0, 0, 0} } +}; + +static const x86_insn_info cyrixmmx_insn[] = { + { CPU_Cyrix|CPU_MMX, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, 0} } +}; + +static const x86_insn_info pmachriw_insn[] = { + { CPU_Cyrix|CPU_MMX, 0, 0, 0, 0, 2, {0x0F, 0x5E, 0}, 0, 2, {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0} } +}; + +static const x86_insn_info rdwrshr_insn[] = { + { CPU_686|CPU_Cyrix|CPU_SMM, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x36, 0}, 0, 1, {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0, 0} } +}; + +static const x86_insn_info rsdc_insn[] = { + { CPU_486|CPU_Cyrix|CPU_SMM, 0, 0, 0, 0, 2, {0x0F, 0x79, 0}, 0, 2, {OPT_SegReg|OPS_16|OPS_Relaxed|OPA_Spare, OPT_Mem|OPS_80|OPS_Relaxed|OPA_EA, 0} } +}; + +static const x86_insn_info cyrixsmm_insn[] = { + { CPU_486|CPU_Cyrix|CPU_SMM, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 1, {OPT_Mem|OPS_80|OPS_Relaxed|OPA_EA, 0, 0} } +}; + +static const x86_insn_info svdc_insn[] = { + { CPU_486|CPU_Cyrix|CPU_SMM, 0, 0, 0, 0, 2, {0x0F, 0x78, 0}, 0, 2, {OPT_Mem|OPS_80|OPS_Relaxed|OPA_EA, OPT_SegReg|OPS_16|OPS_Relaxed|OPA_Spare, 0} } +}; + +static const x86_insn_info ibts_insn[] = { + { CPU_386|CPU_Obs|CPU_Undoc, 0, 16, 0, 0, 2, {0x0F, 0xA7, 0}, 0, 2, {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_16|OPA_Spare, 0} }, + { CPU_386|CPU_Obs|CPU_Undoc, 0, 32, 0, 0, 2, {0x0F, 0xA7, 0}, 0, 2, {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_32|OPA_Spare, 0} } +}; + +static const x86_insn_info umov_insn[] = { + { CPU_386|CPU_Undoc, 0, 0, 0, 0, 2, {0x0F, 0x10, 0}, 0, 2, {OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_8|OPA_Spare, 0} }, + { CPU_386|CPU_Undoc, 0, 16, 0, 0, 2, {0x0F, 0x11, 0}, 0, 2, {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_16|OPA_Spare, 0} }, + { CPU_386|CPU_Undoc, 0, 32, 0, 0, 2, {0x0F, 0x11, 0}, 0, 2, {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_32|OPA_Spare, 0} }, + { CPU_386|CPU_Undoc, 0, 0, 0, 0, 2, {0x0F, 0x12, 0}, 0, 2, {OPT_Reg|OPS_8|OPA_Spare, OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, 0} }, + { CPU_386|CPU_Undoc, 0, 16, 0, 0, 2, {0x0F, 0x13, 0}, 0, 2, {OPT_Reg|OPS_16|OPA_Spare, OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, 0} }, + { CPU_386|CPU_Undoc, 0, 32, 0, 0, 2, {0x0F, 0x13, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} } +}; + +static const x86_insn_info xbts_insn[] = { + { CPU_386|CPU_Obs|CPU_Undoc, 0, 16, 0, 0, 2, {0x0F, 0xA6, 0}, 0, 2, {OPT_Reg|OPS_16|OPA_Spare, OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, 0} }, + { CPU_386|CPU_Obs|CPU_Undoc, 0, 32, 0, 0, 2, {0x0F, 0xA6, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, 0} } +}; + From d0033b06c510a3b4d67092e384fb40f052323b7e Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Mon, 10 Sep 2007 07:15:50 +0000 Subject: [PATCH 073/585] 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 --- Mkfiles/vc/genperf/run.bat | 8 ++++---- Mkfiles/vc8/genperf/run.bat | 8 ++++---- modules/arch/x86/Makefile.inc | 4 ++-- tools/genperf/Makefile.inc | 2 +- tools/genperf/genperf.c | 28 +++++++++++++++++++--------- 5 files changed, 30 insertions(+), 20 deletions(-) diff --git a/Mkfiles/vc/genperf/run.bat b/Mkfiles/vc/genperf/run.bat index 1cf44bfc..4364ead0 100644 --- a/Mkfiles/vc/genperf/run.bat +++ b/Mkfiles/vc/genperf/run.bat @@ -1,5 +1,5 @@ cd ..\..\..\ -%1 x86insn_nasm.gperf > x86insn_nasm.c -%1 x86insn_gas.gperf > x86insn_gas.c -%1 modules\arch\x86\x86cpu.gperf > x86cpu.c -%1 modules\arch\x86\x86regtmod.gperf > x86regtmod.c +%1 x86insn_nasm.gperf x86insn_nasm.c +%1 x86insn_gas.gperf x86insn_gas.c +%1 modules\arch\x86\x86cpu.gperf x86cpu.c +%1 modules\arch\x86\x86regtmod.gperf x86regtmod.c diff --git a/Mkfiles/vc8/genperf/run.bat b/Mkfiles/vc8/genperf/run.bat index 1cf44bfc..4364ead0 100644 --- a/Mkfiles/vc8/genperf/run.bat +++ b/Mkfiles/vc8/genperf/run.bat @@ -1,5 +1,5 @@ cd ..\..\..\ -%1 x86insn_nasm.gperf > x86insn_nasm.c -%1 x86insn_gas.gperf > x86insn_gas.c -%1 modules\arch\x86\x86cpu.gperf > x86cpu.c -%1 modules\arch\x86\x86regtmod.gperf > x86regtmod.c +%1 x86insn_nasm.gperf x86insn_nasm.c +%1 x86insn_gas.gperf x86insn_gas.c +%1 modules\arch\x86\x86cpu.gperf x86cpu.c +%1 modules\arch\x86\x86regtmod.gperf x86regtmod.c diff --git a/modules/arch/x86/Makefile.inc b/modules/arch/x86/Makefile.inc index 3ac4f623..0f682381 100644 --- a/modules/arch/x86/Makefile.inc +++ b/modules/arch/x86/Makefile.inc @@ -43,9 +43,9 @@ EXTRA_DIST += modules/arch/x86/x86regtmod.gperf x86insn_nasm.c: x86insn_nasm.gperf genperf$(EXEEXT) x86insn_gas.c: x86insn_gas.gperf genperf$(EXEEXT) x86cpu.c: $(srcdir)/modules/arch/x86/x86cpu.gperf genperf$(EXEEXT) - $(top_builddir)/genperf$(EXEEXT) $(srcdir)/modules/arch/x86/x86cpu.gperf > $@ + $(top_builddir)/genperf$(EXEEXT) $(srcdir)/modules/arch/x86/x86cpu.gperf $@ x86regtmod.c: $(srcdir)/modules/arch/x86/x86regtmod.gperf genperf$(EXEEXT) - $(top_builddir)/genperf$(EXEEXT) $(srcdir)/modules/arch/x86/x86regtmod.gperf > $@ + $(top_builddir)/genperf$(EXEEXT) $(srcdir)/modules/arch/x86/x86regtmod.gperf $@ BUILT_SOURCES += x86insn_nasm.c BUILT_SOURCES += x86insn_gas.c diff --git a/tools/genperf/Makefile.inc b/tools/genperf/Makefile.inc index 600c93cb..b7e80ed8 100644 --- a/tools/genperf/Makefile.inc +++ b/tools/genperf/Makefile.inc @@ -8,7 +8,7 @@ noinst_PROGRAMS += genperf # Suffix rule for genperf SUFFIXES += .gperf .gperf.c: genperf$(EXEEXT) - $(top_builddir)/genperf$(EXEEXT) $< > $@ + $(top_builddir)/genperf$(EXEEXT) $< $@ genperf_SOURCES = EXTRA_DIST += tools/genperf/genperf.c diff --git a/tools/genperf/genperf.c b/tools/genperf/genperf.c index 1020ee14..ef01b818 100644 --- a/tools/genperf/genperf.c +++ b/tools/genperf/genperf.c @@ -250,7 +250,7 @@ perfect_gen(FILE *out, const char *lookup_function_name, int main(int argc, char *argv[]) { - FILE *in; + FILE *in, *out; size_t i; char *ch; static char line[1024], tmp[1024]; @@ -271,8 +271,8 @@ main(int argc, char *argv[]) sval *sv; keyword *kw; - if (argc != 2) { - fprintf(stderr, "Usage: genperf \n"); + if (argc != 3) { + fprintf(stderr, "Usage: genperf \n"); return EXIT_FAILURE; } @@ -511,20 +511,30 @@ main(int argc, char *argv[]) } /* output code */ - printf("/* %s code produced by genperf */\n", language); - printf("/* Command-line: genperf %s */\n", argv[1]); + out = fopen(argv[2], "wt"); + if (!out) { + fprintf(stderr, "Could not open `%s' for writing\n", argv[2]); + return EXIT_FAILURE; + } + + fprintf(out, "/* %s code produced by genperf */\n", language); + fprintf(out, "/* Command-line: genperf %s %s */\n", argv[1], argv[2]); STAILQ_FOREACH(sv, &usercode, link) - printf("%s", sv->str); + fprintf(out, "%s", sv->str); /* Get perfect hash */ - perfect_gen(stdout, lookup_function_name, struct_name, &keywords, filename); + perfect_gen(out, lookup_function_name, struct_name, &keywords, filename); STAILQ_FOREACH(sv, &usercode2, link) - printf("%s", sv->str); + fprintf(out, "%s", sv->str); - if (errors > 0) + fclose(out); + + if (errors > 0) { + remove(argv[2]); return EXIT_FAILURE; + } return EXIT_SUCCESS; } From ca7439276ed7b1258734b1329194e35d8ff03c4c Mon Sep 17 00:00:00 2001 From: paulbarker Date: Mon, 10 Sep 2007 10:17:19 +0000 Subject: [PATCH 074/585] Delayed destruction of arguments list until cpp_preproc_destroy() in cpp module. svn path=/branches/multiarch/; revision=1940 --- modules/preprocs/cpp/cpp-preproc.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/modules/preprocs/cpp/cpp-preproc.c b/modules/preprocs/cpp/cpp-preproc.c index a35b2544..ec0a3d6d 100644 --- a/modules/preprocs/cpp/cpp-preproc.c +++ b/modules/preprocs/cpp/cpp-preproc.c @@ -111,11 +111,6 @@ cpp_build_cmdline(yasm_preproc_cpp *pp) APPEND(arg->op); APPEND(" "); APPEND(arg->param); - - /* Remove this element from the list and free it. */ - TAILQ_REMOVE(&pp->cpp_args, arg, entry); - yasm_xfree(arg->param); - yasm_xfree(arg); } /* Append final arguments. */ @@ -133,11 +128,6 @@ cpp_invoke(yasm_preproc_cpp *pp) cmdline = cpp_build_cmdline(pp); -#if 0 - /* Print the command line before executing. */ - printf("%s\n", cmdline); -#endif - pp->f = popen(cmdline, "r"); if (!pp->f) yasm__fatal( N_("Failed to execute preprocessor") ); @@ -145,6 +135,19 @@ cpp_invoke(yasm_preproc_cpp *pp) yasm_xfree(cmdline); } +/* Free memory used by the list of arguments. */ +static void +cpp_destroy_args(yasm_preproc_cpp *pp) +{ + cpp_arg_entry *arg; + + while ( (arg = TAILQ_FIRST(&pp->cpp_args)) ) { + TAILQ_REMOVE(&pp->cpp_args, arg, entry); + yasm_xfree(arg->param); + yasm_xfree(arg); + } +} + /******************************************************************************* Interface functions. *******************************************************************************/ @@ -175,6 +178,8 @@ cpp_preproc_destroy(yasm_preproc *preproc) yasm__fatal( N_("Preprocessor exited with failure") ); } + cpp_destroy_args(pp); + yasm_xfree(pp->filename); yasm_xfree(pp); } From 11543884ff4c987af1b23ab12adc561c49fa2ffc Mon Sep 17 00:00:00 2001 From: paulbarker Date: Mon, 10 Sep 2007 10:46:31 +0000 Subject: [PATCH 075/585] Added dependency generation to cpp module. svn path=/branches/multiarch/; revision=1941 --- modules/preprocs/cpp/cpp-preproc.c | 80 +++++++++++++++++++++++++++--- 1 file changed, 72 insertions(+), 8 deletions(-) diff --git a/modules/preprocs/cpp/cpp-preproc.c b/modules/preprocs/cpp/cpp-preproc.c index ec0a3d6d..9b8f3054 100644 --- a/modules/preprocs/cpp/cpp-preproc.c +++ b/modules/preprocs/cpp/cpp-preproc.c @@ -60,7 +60,7 @@ typedef struct yasm_preproc_cpp { TAILQ_HEAD(, cpp_arg_entry) cpp_args; char *filename; - FILE *f; + FILE *f, *f_deps; yasm_linemap *cur_lm; yasm_errwarns *errwarns; @@ -68,7 +68,8 @@ typedef struct yasm_preproc_cpp { } yasm_preproc_cpp; /* Flag values for yasm_preproc_cpp->flags. */ -#define CPP_HAS_BEEN_INVOKED 0x01 +#define CPP_HAS_BEEN_INVOKED 0x01 +#define CPP_HAS_GENERATED_DEPS 0x02 /******************************************************************************* Internal functions and helpers. @@ -91,7 +92,7 @@ typedef struct yasm_preproc_cpp { cpp. */ static char * -cpp_build_cmdline(yasm_preproc_cpp *pp) +cpp_build_cmdline(yasm_preproc_cpp *pp, const char *extra) { char *cmdline, *p, *limit; cpp_arg_entry *arg; @@ -105,14 +106,23 @@ cpp_build_cmdline(yasm_preproc_cpp *pp) strcpy(p, "cpp"); p += 3; + arg = TAILQ_FIRST(&pp->cpp_args); + /* Append arguments from the list. */ - while ( (arg = TAILQ_FIRST(&pp->cpp_args)) ) { + while ( arg ) { APPEND(" "); APPEND(arg->op); APPEND(" "); APPEND(arg->param); + + arg = TAILQ_NEXT(arg, entry); } + /* Append extra arguments. */ + if (extra) { + APPEND(" "); + APPEND(extra); + } /* Append final arguments. */ APPEND(" -x assembler-with-cpp "); APPEND(pp->filename); @@ -126,7 +136,7 @@ cpp_invoke(yasm_preproc_cpp *pp) { char *cmdline; - cmdline = cpp_build_cmdline(pp); + cmdline = cpp_build_cmdline(pp, NULL); pp->f = popen(cmdline, "r"); if (!pp->f) @@ -148,6 +158,21 @@ cpp_destroy_args(yasm_preproc_cpp *pp) } } +/* Invoke the c preprocessor to generate dependency info. */ +static void +cpp_generate_deps(yasm_preproc_cpp *pp) +{ + char *cmdline; + + cmdline = cpp_build_cmdline(pp, "-M"); + + pp->f_deps = popen(cmdline, "r"); + if (!pp->f_deps) + yasm__fatal( N_("Failed to execute preprocessor") ); + + yasm_xfree(cmdline); +} + /******************************************************************************* Interface functions. *******************************************************************************/ @@ -157,7 +182,7 @@ cpp_preproc_create(const char *in, yasm_linemap *lm, yasm_errwarns *errwarns) yasm_preproc_cpp *pp = yasm_xmalloc(sizeof(yasm_preproc_cpp)); pp->preproc.module = &yasm_cpp_LTX_preproc; - pp->f = NULL; + pp->f = pp->f_deps = NULL; pp->cur_lm = lm; pp->errwarns = errwarns; pp->flags = 0; @@ -214,9 +239,48 @@ static size_t cpp_preproc_get_included_file(yasm_preproc *preproc, char *buf, size_t max_size) { - /* TODO */ + char *p = buf; + int ch = '\0'; + size_t n = 0; + yasm_preproc_cpp *pp = (yasm_preproc_cpp *)preproc; - return 0; + if (! (pp->flags & CPP_HAS_GENERATED_DEPS) ) { + pp->flags |= CPP_HAS_GENERATED_DEPS; + + cpp_generate_deps(pp); + + /* Skip target name and first dependency. */ + while (ch != ':') + ch = fgetc(pp->f_deps); + + fgetc(pp->f_deps); /* Discard space after colon. */ + + while (ch != ' ' && ch != EOF) + ch = fgetc(pp->f_deps); + + if (ch == EOF) + return 0; + } + + while (n < max_size) { + ch = fgetc(pp->f_deps); + + if (ch == ' ' || ch == EOF) { + *p = '\0'; + return n; + } + + /* Eat any silly characters. */ + if (ch < ' ') + continue; + + *p++ = ch; + n++; + } + + /* Ensure the buffer is null-terminated. */ + *(p - 1) = '\0'; + return n; } static void From cfcad025c5adb928f5f0cd8794344f7bb3de5852 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 11 Sep 2007 02:11:19 +0000 Subject: [PATCH 076/585] Now that genperf takes an output filename, change informational outputs to stdout instead of stderr. svn path=/trunk/yasm/; revision=1942 --- tools/genperf/perfect.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/genperf/perfect.c b/tools/genperf/perfect.c index 26d59be4..579d3606 100644 --- a/tools/genperf/perfect.c +++ b/tools/genperf/perfect.c @@ -673,7 +673,7 @@ static void hash_ab( sprintf(final->line[0], " unsigned long rsl = (a ^ scramble[tab[b]]);\n"); } - fprintf(stderr, "success, found a perfect hash\n"); + printf("success, found a perfect hash\n"); free((void *)tabq); free((void *)tabh); @@ -903,7 +903,7 @@ void findhash( continue; /* two keys have same (a,b) pair */ } - fprintf(stderr, "found distinct (A,B) on attempt %ld\n", trysalt); + printf("found distinct (A,B) on attempt %ld\n", trysalt); /* Given distinct (A,B) for all keys, build a perfect hash */ if (!perfect(*tabb, *tabh, tabq, *blen, *smax, scramble, nkeys, form)) @@ -934,7 +934,7 @@ void findhash( break; } - fprintf(stderr, "built perfect hash table of size %ld\n", *blen); + printf("built perfect hash table of size %ld\n", *blen); /* free working memory */ free((void *)tabq); From a7f73e3a6c0fcb3c2e796d71210a5ddd8061215d Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 11 Sep 2007 04:49:53 +0000 Subject: [PATCH 077/585] 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 --- modules/arch/x86/gen_x86_insn.py | 48 +- modules/arch/x86/x86id.c | 49 +- x86insn_gas.gperf | 2452 +++++++++++++++--------------- x86insn_nasm.gperf | 1492 +++++++++--------- x86insns.c | 1734 +++++++++++++-------- 5 files changed, 3126 insertions(+), 2649 deletions(-) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index b0bd99f3..f862f8ed 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -122,6 +122,22 @@ class Operand(object): return '|'.join(op_str) + def __eq__(self, other): + return (self.type == other.type and + self.size == other.size and + self.relaxed == other.relaxed and + self.dest == other.dest and + self.tmod == other.tmod and + self.opt == other.opt) + + def __ne__(self, other): + return (self.type != other.type or + self.size != other.size or + self.relaxed != other.relaxed or + self.dest != other.dest or + self.tmod != other.tmod or + self.opt != other.opt) + class GroupForm(object): def __init__(self, **kwargs): # Parsers @@ -235,11 +251,6 @@ class GroupForm(object): opcodes_str.extend(["0", "0", "0"]) opcodes_str = "{" + ', '.join(opcodes_str[0:3]) + "}" - operands_str = [str(x) for x in self.operands] - # Ensure operands initializer string is 3 long - operands_str.extend(["0", "0", "0"]) - operands_str = "{" + ', '.join(operands_str[0:3]) + "}" - cpus_str = "|".join("CPU_%s" % x for x in sorted(self.cpu)) if len(self.modifiers) > 3: @@ -281,7 +292,7 @@ class GroupForm(object): opcodes_str, "%d" % (self.spare or 0), "%d" % len(self.operands), - operands_str]) + " }" + "%d" % self.all_operands_index]) + " }" groups = {} groupnames_ordered = [] @@ -395,8 +406,8 @@ class Insn(object): modifier_str = "0" return ",\t".join(["%s_insn" % self.groupname, - "(%sUL<<8)|NELEMS(%s_insn)" % \ - (modifier_str, self.groupname), + "(%sUL<<8)|%d" % \ + (modifier_str, len(groups[self.groupname])), cpu_str or "CPU_Any", suffix_str]) @@ -491,6 +502,27 @@ def output_nasm_insns(f): output_insns(f, "nasm", nasm_insns) def output_groups(f): + # Merge all operand lists into single list + # Sort by number of operands to shorten output + all_operands = [] + for form in sorted((form for g in groups.itervalues() for form in g), + key=lambda x:len(x.operands), reverse=True): + num_operands = len(form.operands) + for i in xrange(len(all_operands)): + if all_operands[i:i+num_operands] == form.operands: + form.all_operands_index = i + break + else: + form.all_operands_index = len(all_operands) + all_operands.extend(form.operands) + + # Output operands list + print >>f, "static const unsigned long insn_operands[] = {" + print >>f, " ", + print >>f, ",\n ".join(str(x) for x in all_operands) + print >>f, "};\n" + + # Output groups seen = set() for name in groupnames_ordered: if name in seen: diff --git a/modules/arch/x86/x86id.c b/modules/arch/x86/x86id.c index 67810b86..67b80a61 100644 --- a/modules/arch/x86/x86id.c +++ b/modules/arch/x86/x86id.c @@ -270,10 +270,12 @@ typedef struct x86_insn_info { unsigned char spare; /* The number of operands this form of the instruction takes */ - unsigned char num_operands; + unsigned int num_operands:4; - /* The types of each operand, see above */ - unsigned long operands[3]; + /* The index into the insn_operands array which contains the type of each + * operand, see above + */ + unsigned int operands_index:12; } x86_insn_info; typedef struct x86_id_insn { @@ -320,18 +322,14 @@ static const yasm_bytecode_callback x86_id_insn_callback = { /* Empty instruction */ static const x86_insn_info empty_insn[] = { - { CPU_Any, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 0, {0, 0, 0} } + { CPU_Any, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 0, 0 } }; /* Placeholder for instructions invalid in 64-bit mode */ static const x86_insn_info not64_insn[] = { - { CPU_Not64, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 0, {0, 0, 0} } + { CPU_Not64, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 0, 0 } }; -static const unsigned long insertq_4operands[] = - {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm}; - #include "x86insns.c" static void @@ -446,7 +444,7 @@ x86_finalize_jmp(yasm_bytecode *bc, yasm_bytecode *prev_bc, jmp->target.jump_target = 1; /* See if the user explicitly specified short/near/far. */ - switch ((int)(jinfo->operands[0] & OPTM_MASK)) { + switch ((int)(insn_operands[jinfo->operands_index+0] & OPTM_MASK)) { case OPTM_Short: jmp->op_sel = JMP_SHORT_FORCED; break; @@ -459,9 +457,10 @@ x86_finalize_jmp(yasm_bytecode *bc, yasm_bytecode *prev_bc, /* Check for address size setting in second operand, if present */ if (jinfo->num_operands > 1 && - (jinfo->operands[1] & OPA_MASK) == OPA_AdSizeR) + (insn_operands[jinfo->operands_index+1] & OPA_MASK) == OPA_AdSizeR) jmp->common.addrsize = (unsigned char) - size_lookup[(jinfo->operands[1] & OPS_MASK)>>OPS_SHIFT]; + size_lookup[(insn_operands[jinfo->operands_index+1] + & OPS_MASK)>>OPS_SHIFT]; /* Check for address size override */ if (jinfo->modifiers & MOD_AdSizeR) @@ -488,13 +487,13 @@ x86_finalize_jmp(yasm_bytecode *bc, yasm_bytecode *prev_bc, if (info->num_operands == 0) continue; - if ((info->operands[0] & OPA_MASK) != OPA_JmpRel) + if ((insn_operands[info->operands_index+0] & OPA_MASK) != OPA_JmpRel) continue; if (info->opersize != jmp->common.opersize) continue; - switch ((int)(info->operands[0] & OPTM_MASK)) { + switch ((int)(insn_operands[info->operands_index+0] & OPTM_MASK)) { case OPTM_Short: x86_finalize_opcode(&jmp->shortop, info); if (info->modifiers & MOD_Op0Add) @@ -547,7 +546,7 @@ x86_find_match(x86_id_insn *id_insn, yasm_insn_operand **ops, */ for (; num_info>0 && !found; num_info--, info++) { yasm_insn_operand *op, **use_ops; - const unsigned long *info_ops = info->operands; + const unsigned long *info_ops = &insn_operands[info->operands_index]; unsigned long icpu; unsigned int size; int mismatch = 0; @@ -593,10 +592,6 @@ x86_find_match(x86_id_insn *id_insn, yasm_insn_operand **ops, break; } - /* 4-operand special case for insertq */ - if (info->num_operands > 3) - info_ops = insertq_4operands; - /* Match each operand type and size */ for (i = 0, op = use_ops[0]; op && inum_operands && !mismatch; op = use_ops[++i]) { @@ -969,11 +964,9 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) yasm_insn_finalize(&id_insn->insn); /* Build local array of operands from list, since we know we have a max - * of 3 operands. + * of 4 operands. */ - if (id_insn->insn.num_operands == 4 && info == insertq_insn) - ; - else if (id_insn->insn.num_operands > 3) { + if (id_insn->insn.num_operands > 4) { yasm_error_set(YASM_ERROR_TYPE, N_("too many operands")); return; } @@ -999,7 +992,7 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) * operands and adjust for dereferences / lack thereof. */ if (id_insn->parser == X86_PARSER_GAS - && (info->operands[0] & OPA_MASK) == OPA_JmpRel) { + && (insn_operands[info->operands_index+0] & OPA_MASK) == OPA_JmpRel) { for (i = 0, op = ops[0]; op; op = ops[++i]) { if (!op->deref && (op->type == YASM_INSN__OPERAND_REG || (op->type == YASM_INSN__OPERAND_MEMORY @@ -1032,7 +1025,7 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) } if (id_insn->insn.num_operands > 0) { - switch (info->operands[0] & OPA_MASK) { + switch (insn_operands[info->operands_index+0] & OPA_MASK) { case OPA_JmpRel: /* Shortcut to JmpRel */ x86_finalize_jmp(bc, prev_bc, info); @@ -1114,17 +1107,13 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) /* Go through operands and assign */ if (id_insn->insn.num_operands > 0) { yasm_insn_operand **use_ops = ops; - const unsigned long *info_ops = info->operands; + const unsigned long *info_ops = &insn_operands[info->operands_index]; /* Use reversed operands in GAS mode if not otherwise specified */ if (id_insn->parser == X86_PARSER_GAS && !(info->modifiers & MOD_GasNoRev)) use_ops = rev_ops; - /* 4-operand special case for insertq */ - if (info->num_operands > 3) - info_ops = insertq_4operands; - for (i = 0, op = use_ops[0]; op && inum_operands; op = use_ops[++i]) { switch ((int)(info_ops[i] & OPA_MASK)) { diff --git a/x86insn_gas.gperf b/x86insn_gas.gperf index 84e65247..ef6b85aa 100644 --- a/x86insn_gas.gperf +++ b/x86insn_gas.gperf @@ -8,997 +8,997 @@ %define lookup-function-name insnprefix_gas_find struct insnprefix_parse_data; %% -aaa, onebyte_insn, (0x000037UL<<8)|NELEMS(onebyte_insn), CPU_Not64, NONE -aad, aadm_insn, (0x01UL<<8)|NELEMS(aadm_insn), CPU_Not64, NONE -aam, aadm_insn, (0x00UL<<8)|NELEMS(aadm_insn), CPU_Not64, NONE -aas, onebyte_insn, (0x00003FUL<<8)|NELEMS(onebyte_insn), CPU_Not64, NONE -adc, arith_insn, (0x0210UL<<8)|NELEMS(arith_insn), CPU_Any, NONE -adcb, arith_insn, (0x0210UL<<8)|NELEMS(arith_insn), CPU_Any, SUF_B -adcl, arith_insn, (0x0210UL<<8)|NELEMS(arith_insn), CPU_386, SUF_L -adcq, arith_insn, (0x0210UL<<8)|NELEMS(arith_insn), CPU_64, SUF_Q -adcw, arith_insn, (0x0210UL<<8)|NELEMS(arith_insn), CPU_Any, SUF_W -add, arith_insn, (0x0000UL<<8)|NELEMS(arith_insn), CPU_Any, NONE -addb, arith_insn, (0x0000UL<<8)|NELEMS(arith_insn), CPU_Any, SUF_B -addl, arith_insn, (0x0000UL<<8)|NELEMS(arith_insn), CPU_386, SUF_L -addq, arith_insn, (0x0000UL<<8)|NELEMS(arith_insn), CPU_64, SUF_Q -addw, arith_insn, (0x0000UL<<8)|NELEMS(arith_insn), CPU_Any, SUF_W -addpd, ssess_insn, (0x6658UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -addps, sseps_insn, (0x58UL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE +aaa, onebyte_insn, (0x000037UL<<8)|1, CPU_Not64, NONE +aad, aadm_insn, (0x01UL<<8)|2, CPU_Not64, NONE +aam, aadm_insn, (0x00UL<<8)|2, CPU_Not64, NONE +aas, onebyte_insn, (0x00003FUL<<8)|1, CPU_Not64, NONE +adc, arith_insn, (0x0210UL<<8)|22, CPU_Any, NONE +adcb, arith_insn, (0x0210UL<<8)|22, CPU_Any, SUF_B +adcl, arith_insn, (0x0210UL<<8)|22, CPU_386, SUF_L +adcq, arith_insn, (0x0210UL<<8)|22, CPU_64, SUF_Q +adcw, arith_insn, (0x0210UL<<8)|22, CPU_Any, SUF_W +add, arith_insn, (0x0000UL<<8)|22, CPU_Any, NONE +addb, arith_insn, (0x0000UL<<8)|22, CPU_Any, SUF_B +addl, arith_insn, (0x0000UL<<8)|22, CPU_386, SUF_L +addq, arith_insn, (0x0000UL<<8)|22, CPU_64, SUF_Q +addw, arith_insn, (0x0000UL<<8)|22, CPU_Any, SUF_W +addpd, ssess_insn, (0x6658UL<<8)|1, CPU_SSE2, NONE +addps, sseps_insn, (0x58UL<<8)|1, CPU_SSE, NONE addr16, NULL, X86_ADDRSIZE, 0x10, NONE addr32, NULL, X86_ADDRSIZE, 0x20, NONE addr64, NULL, X86_ADDRSIZE, 0x40, NONE -addsd, ssess_insn, (0xF258UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -addss, ssess_insn, (0xF358UL<<8)|NELEMS(ssess_insn), CPU_SSE, NONE -addsubpd, ssess_insn, (0x66D0UL<<8)|NELEMS(ssess_insn), CPU_SSE3, NONE -addsubps, ssess_insn, (0xF2D0UL<<8)|NELEMS(ssess_insn), CPU_SSE3, NONE +addsd, ssess_insn, (0xF258UL<<8)|1, CPU_SSE2, NONE +addss, ssess_insn, (0xF358UL<<8)|1, CPU_SSE, NONE +addsubpd, ssess_insn, (0x66D0UL<<8)|1, CPU_SSE3, NONE +addsubps, ssess_insn, (0xF2D0UL<<8)|1, CPU_SSE3, NONE adword, NULL, X86_ADDRSIZE, 0x20, NONE -and, arith_insn, (0x0420UL<<8)|NELEMS(arith_insn), CPU_Any, NONE -andb, arith_insn, (0x0420UL<<8)|NELEMS(arith_insn), CPU_Any, SUF_B -andl, arith_insn, (0x0420UL<<8)|NELEMS(arith_insn), CPU_386, SUF_L -andq, arith_insn, (0x0420UL<<8)|NELEMS(arith_insn), CPU_64, SUF_Q -andw, arith_insn, (0x0420UL<<8)|NELEMS(arith_insn), CPU_Any, SUF_W -andnpd, ssess_insn, (0x6655UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -andnps, sseps_insn, (0x55UL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE -andpd, ssess_insn, (0x6654UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -andps, sseps_insn, (0x54UL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE +and, arith_insn, (0x0420UL<<8)|22, CPU_Any, NONE +andb, arith_insn, (0x0420UL<<8)|22, CPU_Any, SUF_B +andl, arith_insn, (0x0420UL<<8)|22, CPU_386, SUF_L +andq, arith_insn, (0x0420UL<<8)|22, CPU_64, SUF_Q +andw, arith_insn, (0x0420UL<<8)|22, CPU_Any, SUF_W +andnpd, ssess_insn, (0x6655UL<<8)|1, CPU_SSE2, NONE +andnps, sseps_insn, (0x55UL<<8)|1, CPU_SSE, NONE +andpd, ssess_insn, (0x6654UL<<8)|1, CPU_SSE2, NONE +andps, sseps_insn, (0x54UL<<8)|1, CPU_SSE, NONE aqword, NULL, X86_ADDRSIZE, 0x40, NONE -arpl, arpl_insn, (0UL<<8)|NELEMS(arpl_insn), CPU_286|CPU_Not64|CPU_Prot, NONE -arplw, arpl_insn, (0UL<<8)|NELEMS(arpl_insn), CPU_286|CPU_Not64|CPU_Prot, SUF_W +arpl, arpl_insn, (0UL<<8)|1, CPU_286|CPU_Not64|CPU_Prot, NONE +arplw, arpl_insn, (0UL<<8)|1, CPU_286|CPU_Not64|CPU_Prot, SUF_W aword, NULL, X86_ADDRSIZE, 0x10, NONE -blendpd, sse4imm_insn, (0x0DUL<<8)|NELEMS(sse4imm_insn), CPU_SSE41, NONE -blendps, sse4imm_insn, (0x0CUL<<8)|NELEMS(sse4imm_insn), CPU_SSE41, NONE -blendvpd, sse4xmm0_insn, (0x15UL<<8)|NELEMS(sse4xmm0_insn), CPU_SSE41, NONE -blendvps, sse4xmm0_insn, (0x14UL<<8)|NELEMS(sse4xmm0_insn), CPU_SSE41, NONE -bound, bound_insn, (0UL<<8)|NELEMS(bound_insn), CPU_186|CPU_Not64, NONE -boundl, bound_insn, (0UL<<8)|NELEMS(bound_insn), CPU_386|CPU_Not64, SUF_L -boundw, bound_insn, (0UL<<8)|NELEMS(bound_insn), CPU_186|CPU_Not64, SUF_W -bsf, bsfr_insn, (0xBCUL<<8)|NELEMS(bsfr_insn), CPU_386, NONE -bsfl, bsfr_insn, (0xBCUL<<8)|NELEMS(bsfr_insn), CPU_386, SUF_L -bsfq, bsfr_insn, (0xBCUL<<8)|NELEMS(bsfr_insn), CPU_386|CPU_64, SUF_Q -bsfw, bsfr_insn, (0xBCUL<<8)|NELEMS(bsfr_insn), CPU_386, SUF_W -bsr, bsfr_insn, (0xBDUL<<8)|NELEMS(bsfr_insn), CPU_386, NONE -bsrl, bsfr_insn, (0xBDUL<<8)|NELEMS(bsfr_insn), CPU_386, SUF_L -bsrq, bsfr_insn, (0xBDUL<<8)|NELEMS(bsfr_insn), CPU_386|CPU_64, SUF_Q -bsrw, bsfr_insn, (0xBDUL<<8)|NELEMS(bsfr_insn), CPU_386, SUF_W -bswap, bswap_insn, (0UL<<8)|NELEMS(bswap_insn), CPU_486, NONE -bswapl, bswap_insn, (0UL<<8)|NELEMS(bswap_insn), CPU_486, SUF_L -bswapq, bswap_insn, (0UL<<8)|NELEMS(bswap_insn), CPU_64, SUF_Q -bt, bittest_insn, (0x04A3UL<<8)|NELEMS(bittest_insn), CPU_386, NONE -btl, bittest_insn, (0x04A3UL<<8)|NELEMS(bittest_insn), CPU_386, SUF_L -btq, bittest_insn, (0x04A3UL<<8)|NELEMS(bittest_insn), CPU_386|CPU_64, SUF_Q -btw, bittest_insn, (0x04A3UL<<8)|NELEMS(bittest_insn), CPU_386, SUF_W -btc, bittest_insn, (0x07BBUL<<8)|NELEMS(bittest_insn), CPU_386, NONE -btcl, bittest_insn, (0x07BBUL<<8)|NELEMS(bittest_insn), CPU_386, SUF_L -btcq, bittest_insn, (0x07BBUL<<8)|NELEMS(bittest_insn), CPU_386|CPU_64, SUF_Q -btcw, bittest_insn, (0x07BBUL<<8)|NELEMS(bittest_insn), CPU_386, SUF_W -btr, bittest_insn, (0x06B3UL<<8)|NELEMS(bittest_insn), CPU_386, NONE -btrl, bittest_insn, (0x06B3UL<<8)|NELEMS(bittest_insn), CPU_386, SUF_L -btrq, bittest_insn, (0x06B3UL<<8)|NELEMS(bittest_insn), CPU_386|CPU_64, SUF_Q -btrw, bittest_insn, (0x06B3UL<<8)|NELEMS(bittest_insn), CPU_386, SUF_W -bts, bittest_insn, (0x05ABUL<<8)|NELEMS(bittest_insn), CPU_386, NONE -btsl, bittest_insn, (0x05ABUL<<8)|NELEMS(bittest_insn), CPU_386, SUF_L -btsq, bittest_insn, (0x05ABUL<<8)|NELEMS(bittest_insn), CPU_386|CPU_64, SUF_Q -btsw, bittest_insn, (0x05ABUL<<8)|NELEMS(bittest_insn), CPU_386, SUF_W -call, call_insn, (0UL<<8)|NELEMS(call_insn), CPU_Any, NONE -calll, call_insn, (0UL<<8)|NELEMS(call_insn), CPU_Not64, NONE -callq, call_insn, (0UL<<8)|NELEMS(call_insn), CPU_64, NONE -cbtw, onebyte_insn, (0x001098UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -cbw, onebyte_insn, (0x001098UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -cdq, onebyte_insn, (0x002099UL<<8)|NELEMS(onebyte_insn), CPU_386, NONE -cdqe, onebyte_insn, (0x004098UL<<8)|NELEMS(onebyte_insn), CPU_64, NONE -clc, onebyte_insn, (0x0000F8UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -cld, onebyte_insn, (0x0000FCUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -clflush, clflush_insn, (0UL<<8)|NELEMS(clflush_insn), CPU_P3, NONE -clgi, threebyte_insn, (0x0F01DDUL<<8)|NELEMS(threebyte_insn), CPU_SVM, NONE -cli, onebyte_insn, (0x0000FAUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -cltd, onebyte_insn, (0x002099UL<<8)|NELEMS(onebyte_insn), CPU_386, NONE -cltq, onebyte_insn, (0x004098UL<<8)|NELEMS(onebyte_insn), CPU_64, NONE -clts, twobyte_insn, (0x0F06UL<<8)|NELEMS(twobyte_insn), CPU_286|CPU_Priv, NONE -cmc, onebyte_insn, (0x0000F5UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -cmova, cmovcc_insn, (0x07UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmoval, cmovcc_insn, (0x07UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L -cmovaq, cmovcc_insn, (0x07UL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q -cmovaw, cmovcc_insn, (0x07UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W -cmovae, cmovcc_insn, (0x03UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovael, cmovcc_insn, (0x03UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L -cmovaeq, cmovcc_insn, (0x03UL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q -cmovaew, cmovcc_insn, (0x03UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W -cmovb, cmovcc_insn, (0x02UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovbl, cmovcc_insn, (0x02UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L -cmovbq, cmovcc_insn, (0x02UL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q -cmovbw, cmovcc_insn, (0x02UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W -cmovbe, cmovcc_insn, (0x06UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovbel, cmovcc_insn, (0x06UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L -cmovbeq, cmovcc_insn, (0x06UL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q -cmovbew, cmovcc_insn, (0x06UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W -cmovc, cmovcc_insn, (0x02UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovcl, cmovcc_insn, (0x02UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L -cmovcq, cmovcc_insn, (0x02UL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q -cmovcw, cmovcc_insn, (0x02UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W -cmove, cmovcc_insn, (0x04UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovel, cmovcc_insn, (0x04UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L -cmoveq, cmovcc_insn, (0x04UL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q -cmovew, cmovcc_insn, (0x04UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W -cmovg, cmovcc_insn, (0x0FUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovgl, cmovcc_insn, (0x0FUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L -cmovgq, cmovcc_insn, (0x0FUL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q -cmovgw, cmovcc_insn, (0x0FUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W -cmovge, cmovcc_insn, (0x0DUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovgel, cmovcc_insn, (0x0DUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L -cmovgeq, cmovcc_insn, (0x0DUL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q -cmovgew, cmovcc_insn, (0x0DUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W -cmovl, cmovcc_insn, (0x0CUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovll, cmovcc_insn, (0x0CUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L -cmovlq, cmovcc_insn, (0x0CUL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q -cmovlw, cmovcc_insn, (0x0CUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W -cmovle, cmovcc_insn, (0x0EUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovlel, cmovcc_insn, (0x0EUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L -cmovleq, cmovcc_insn, (0x0EUL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q -cmovlew, cmovcc_insn, (0x0EUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W -cmovna, cmovcc_insn, (0x06UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovnal, cmovcc_insn, (0x06UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L -cmovnaq, cmovcc_insn, (0x06UL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q -cmovnaw, cmovcc_insn, (0x06UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W -cmovnae, cmovcc_insn, (0x02UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovnael, cmovcc_insn, (0x02UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L -cmovnaeq, cmovcc_insn, (0x02UL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q -cmovnaew, cmovcc_insn, (0x02UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W -cmovnb, cmovcc_insn, (0x03UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovnbl, cmovcc_insn, (0x03UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L -cmovnbq, cmovcc_insn, (0x03UL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q -cmovnbw, cmovcc_insn, (0x03UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W -cmovnbe, cmovcc_insn, (0x07UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovnbel, cmovcc_insn, (0x07UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L -cmovnbeq, cmovcc_insn, (0x07UL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q -cmovnbew, cmovcc_insn, (0x07UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W -cmovnc, cmovcc_insn, (0x03UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovncl, cmovcc_insn, (0x03UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L -cmovncq, cmovcc_insn, (0x03UL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q -cmovncw, cmovcc_insn, (0x03UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W -cmovne, cmovcc_insn, (0x05UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovnel, cmovcc_insn, (0x05UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L -cmovneq, cmovcc_insn, (0x05UL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q -cmovnew, cmovcc_insn, (0x05UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W -cmovng, cmovcc_insn, (0x0EUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovngl, cmovcc_insn, (0x0EUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L -cmovngq, cmovcc_insn, (0x0EUL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q -cmovngw, cmovcc_insn, (0x0EUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W -cmovnge, cmovcc_insn, (0x0CUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovngel, cmovcc_insn, (0x0CUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L -cmovngeq, cmovcc_insn, (0x0CUL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q -cmovngew, cmovcc_insn, (0x0CUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W -cmovnl, cmovcc_insn, (0x0DUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovnll, cmovcc_insn, (0x0DUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L -cmovnlq, cmovcc_insn, (0x0DUL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q -cmovnlw, cmovcc_insn, (0x0DUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W -cmovnle, cmovcc_insn, (0x0FUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovnlel, cmovcc_insn, (0x0FUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L -cmovnleq, cmovcc_insn, (0x0FUL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q -cmovnlew, cmovcc_insn, (0x0FUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W -cmovno, cmovcc_insn, (0x01UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovnol, cmovcc_insn, (0x01UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L -cmovnoq, cmovcc_insn, (0x01UL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q -cmovnow, cmovcc_insn, (0x01UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W -cmovnp, cmovcc_insn, (0x0BUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovnpl, cmovcc_insn, (0x0BUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L -cmovnpq, cmovcc_insn, (0x0BUL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q -cmovnpw, cmovcc_insn, (0x0BUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W -cmovns, cmovcc_insn, (0x09UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovnsl, cmovcc_insn, (0x09UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L -cmovnsq, cmovcc_insn, (0x09UL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q -cmovnsw, cmovcc_insn, (0x09UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W -cmovnz, cmovcc_insn, (0x05UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovnzl, cmovcc_insn, (0x05UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L -cmovnzq, cmovcc_insn, (0x05UL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q -cmovnzw, cmovcc_insn, (0x05UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W -cmovo, cmovcc_insn, (0x00UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovol, cmovcc_insn, (0x00UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L -cmovoq, cmovcc_insn, (0x00UL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q -cmovow, cmovcc_insn, (0x00UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W -cmovp, cmovcc_insn, (0x0AUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovpl, cmovcc_insn, (0x0AUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L -cmovpq, cmovcc_insn, (0x0AUL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q -cmovpw, cmovcc_insn, (0x0AUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W -cmovpe, cmovcc_insn, (0x0AUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovpel, cmovcc_insn, (0x0AUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L -cmovpeq, cmovcc_insn, (0x0AUL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q -cmovpew, cmovcc_insn, (0x0AUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W -cmovpo, cmovcc_insn, (0x0BUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovpol, cmovcc_insn, (0x0BUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L -cmovpoq, cmovcc_insn, (0x0BUL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q -cmovpow, cmovcc_insn, (0x0BUL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W -cmovs, cmovcc_insn, (0x08UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovsl, cmovcc_insn, (0x08UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L -cmovsq, cmovcc_insn, (0x08UL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q -cmovsw, cmovcc_insn, (0x08UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W -cmovz, cmovcc_insn, (0x04UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovzl, cmovcc_insn, (0x04UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_L -cmovzq, cmovcc_insn, (0x04UL<<8)|NELEMS(cmovcc_insn), CPU_64|CPU_686, SUF_Q -cmovzw, cmovcc_insn, (0x04UL<<8)|NELEMS(cmovcc_insn), CPU_686, SUF_W -cmp, arith_insn, (0x0738UL<<8)|NELEMS(arith_insn), CPU_Any, NONE -cmpb, arith_insn, (0x0738UL<<8)|NELEMS(arith_insn), CPU_Any, SUF_B -cmpl, arith_insn, (0x0738UL<<8)|NELEMS(arith_insn), CPU_386, SUF_L -cmpq, arith_insn, (0x0738UL<<8)|NELEMS(arith_insn), CPU_64, SUF_Q -cmpw, arith_insn, (0x0738UL<<8)|NELEMS(arith_insn), CPU_Any, SUF_W -cmpeqpd, ssecmpss_insn, (0x0066UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE -cmpeqps, ssecmpps_insn, (0x00UL<<8)|NELEMS(ssecmpps_insn), CPU_SSE, NONE -cmpeqsd, ssecmpss_insn, (0x00F2UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE -cmpeqss, ssecmpss_insn, (0x00F3UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE, NONE -cmplepd, ssecmpss_insn, (0x0266UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE -cmpleps, ssecmpps_insn, (0x02UL<<8)|NELEMS(ssecmpps_insn), CPU_SSE, NONE -cmplesd, ssecmpss_insn, (0x02F2UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE -cmpless, ssecmpss_insn, (0x02F3UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE, NONE -cmpltpd, ssecmpss_insn, (0x0166UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE -cmpltps, ssecmpps_insn, (0x01UL<<8)|NELEMS(ssecmpps_insn), CPU_SSE, NONE -cmpltsd, ssecmpss_insn, (0x01F2UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE -cmpltss, ssecmpss_insn, (0x01F3UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE, NONE -cmpneqpd, ssecmpss_insn, (0x0466UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE -cmpneqps, ssecmpps_insn, (0x04UL<<8)|NELEMS(ssecmpps_insn), CPU_SSE, NONE -cmpneqsd, ssecmpss_insn, (0x04F2UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE -cmpneqss, ssecmpss_insn, (0x04F3UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE, NONE -cmpnlepd, ssecmpss_insn, (0x0666UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE -cmpnleps, ssecmpps_insn, (0x06UL<<8)|NELEMS(ssecmpps_insn), CPU_SSE, NONE -cmpnlesd, ssecmpss_insn, (0x06F2UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE -cmpnless, ssecmpss_insn, (0x06F3UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE, NONE -cmpnltpd, ssecmpss_insn, (0x0566UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE -cmpnltps, ssecmpps_insn, (0x05UL<<8)|NELEMS(ssecmpps_insn), CPU_SSE, NONE -cmpnltsd, ssecmpss_insn, (0x05F2UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE -cmpnltss, ssecmpss_insn, (0x05F3UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE, NONE -cmpordpd, ssecmpss_insn, (0x0766UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE -cmpordps, ssecmpps_insn, (0x07UL<<8)|NELEMS(ssecmpps_insn), CPU_SSE, NONE -cmpordsd, ssecmpss_insn, (0x07F2UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE -cmpordss, ssecmpss_insn, (0x07F3UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE, NONE -cmppd, ssessimm_insn, (0x66C2UL<<8)|NELEMS(ssessimm_insn), CPU_SSE2, NONE -cmpps, ssepsimm_insn, (0xC2UL<<8)|NELEMS(ssepsimm_insn), CPU_SSE, NONE -cmpsb, onebyte_insn, (0x0000A6UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -cmpsd, cmpsd_insn, (0UL<<8)|NELEMS(cmpsd_insn), CPU_Any, NONE -cmpsl, onebyte_insn, (0x0020A7UL<<8)|NELEMS(onebyte_insn), CPU_386, NONE -cmpsq, onebyte_insn, (0x0040A7UL<<8)|NELEMS(onebyte_insn), CPU_64, NONE -cmpss, ssessimm_insn, (0xF3C2UL<<8)|NELEMS(ssessimm_insn), CPU_SSE, NONE -cmpsw, onebyte_insn, (0x0010A7UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -cmpunordpd, ssecmpss_insn, (0x0366UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE -cmpunordps, ssecmpps_insn, (0x03UL<<8)|NELEMS(ssecmpps_insn), CPU_SSE, NONE -cmpunordsd, ssecmpss_insn, (0x03F2UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE -cmpunordss, ssecmpss_insn, (0x03F3UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE, NONE -cmpxchg, cmpxchgxadd_insn, (0xB0UL<<8)|NELEMS(cmpxchgxadd_insn), CPU_486, NONE -cmpxchg16b, cmpxchg16b_insn, (0UL<<8)|NELEMS(cmpxchg16b_insn), CPU_64, NONE -cmpxchg8b, cmpxchg8b_insn, (0UL<<8)|NELEMS(cmpxchg8b_insn), CPU_586, NONE -cmpxchg8bq, cmpxchg8b_insn, (0UL<<8)|NELEMS(cmpxchg8b_insn), CPU_586, SUF_Q -cmpxchgb, cmpxchgxadd_insn, (0xB0UL<<8)|NELEMS(cmpxchgxadd_insn), CPU_486, SUF_B -cmpxchgl, cmpxchgxadd_insn, (0xB0UL<<8)|NELEMS(cmpxchgxadd_insn), CPU_486, SUF_L -cmpxchgq, cmpxchgxadd_insn, (0xB0UL<<8)|NELEMS(cmpxchgxadd_insn), CPU_486|CPU_64, SUF_Q -cmpxchgw, cmpxchgxadd_insn, (0xB0UL<<8)|NELEMS(cmpxchgxadd_insn), CPU_486, SUF_W -comisd, ssess_insn, (0x662FUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -comiss, sseps_insn, (0x2FUL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE -cpuid, twobyte_insn, (0x0FA2UL<<8)|NELEMS(twobyte_insn), CPU_486, NONE -cqo, onebyte_insn, (0x004099UL<<8)|NELEMS(onebyte_insn), CPU_64, NONE -cqto, onebyte_insn, (0x004099UL<<8)|NELEMS(onebyte_insn), CPU_64, NONE -crc32, crc32_insn, (0UL<<8)|NELEMS(crc32_insn), CPU_386|CPU_SSE42, NONE -crc32b, crc32_insn, (0UL<<8)|NELEMS(crc32_insn), CPU_386|CPU_SSE42, SUF_B -crc32l, crc32_insn, (0UL<<8)|NELEMS(crc32_insn), CPU_386|CPU_SSE42, SUF_L -crc32q, crc32_insn, (0UL<<8)|NELEMS(crc32_insn), CPU_64|CPU_SSE42, SUF_Q -crc32w, crc32_insn, (0UL<<8)|NELEMS(crc32_insn), CPU_386|CPU_SSE42, SUF_W -cvtdq2pd, cvt_xmm_xmm64_ss_insn, (0xF3E6UL<<8)|NELEMS(cvt_xmm_xmm64_ss_insn), CPU_SSE2, NONE -cvtdq2ps, sseps_insn, (0x5BUL<<8)|NELEMS(sseps_insn), CPU_SSE2, NONE -cvtpd2dq, ssess_insn, (0xF2E6UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -cvtpd2pi, cvt_mm_xmm_insn, (0x662DUL<<8)|NELEMS(cvt_mm_xmm_insn), CPU_SSE2, NONE -cvtpd2ps, ssess_insn, (0x665AUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -cvtpi2pd, cvt_xmm_mm_ss_insn, (0x662AUL<<8)|NELEMS(cvt_xmm_mm_ss_insn), CPU_SSE2, NONE -cvtpi2ps, cvt_xmm_mm_ps_insn, (0x2AUL<<8)|NELEMS(cvt_xmm_mm_ps_insn), CPU_SSE, NONE -cvtps2dq, ssess_insn, (0x665BUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -cvtps2pd, cvt_xmm_xmm64_ps_insn, (0x5AUL<<8)|NELEMS(cvt_xmm_xmm64_ps_insn), CPU_SSE2, NONE -cvtps2pi, cvt_mm_xmm64_insn, (0x2DUL<<8)|NELEMS(cvt_mm_xmm64_insn), CPU_SSE, NONE -cvtsd2si, cvt_rx_xmm64_insn, (0xF22DUL<<8)|NELEMS(cvt_rx_xmm64_insn), CPU_386|CPU_SSE2, NONE -cvtsd2sil, cvt_rx_xmm64_insn, (0xF22DUL<<8)|NELEMS(cvt_rx_xmm64_insn), CPU_386|CPU_SSE2, SUF_L -cvtsd2siq, cvt_rx_xmm64_insn, (0xF22DUL<<8)|NELEMS(cvt_rx_xmm64_insn), CPU_64|CPU_SSE2, SUF_Q -cvtsd2ss, cvt_xmm_xmm64_ss_insn, (0xF25AUL<<8)|NELEMS(cvt_xmm_xmm64_ss_insn), CPU_SSE2, NONE -cvtsi2sd, cvt_xmm_rmx_insn, (0xF22AUL<<8)|NELEMS(cvt_xmm_rmx_insn), CPU_SSE2, NONE -cvtsi2sdl, cvt_xmm_rmx_insn, (0xF22AUL<<8)|NELEMS(cvt_xmm_rmx_insn), CPU_SSE2, SUF_L -cvtsi2sdq, cvt_xmm_rmx_insn, (0xF22AUL<<8)|NELEMS(cvt_xmm_rmx_insn), CPU_SSE2, SUF_Q -cvtsi2ss, cvt_xmm_rmx_insn, (0xF32AUL<<8)|NELEMS(cvt_xmm_rmx_insn), CPU_386|CPU_SSE, NONE -cvtsi2ssl, cvt_xmm_rmx_insn, (0xF32AUL<<8)|NELEMS(cvt_xmm_rmx_insn), CPU_386|CPU_SSE, SUF_L -cvtsi2ssq, cvt_xmm_rmx_insn, (0xF32AUL<<8)|NELEMS(cvt_xmm_rmx_insn), CPU_64|CPU_SSE, SUF_Q -cvtss2sd, cvt_xmm_xmm32_insn, (0xF35AUL<<8)|NELEMS(cvt_xmm_xmm32_insn), CPU_SSE2, NONE -cvtss2si, cvt_rx_xmm32_insn, (0xF32DUL<<8)|NELEMS(cvt_rx_xmm32_insn), CPU_386|CPU_SSE, NONE -cvtss2sil, cvt_rx_xmm32_insn, (0xF32DUL<<8)|NELEMS(cvt_rx_xmm32_insn), CPU_386|CPU_SSE, SUF_L -cvtss2siq, cvt_rx_xmm32_insn, (0xF32DUL<<8)|NELEMS(cvt_rx_xmm32_insn), CPU_64|CPU_SSE, SUF_Q -cvttpd2dq, ssess_insn, (0x66E6UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -cvttpd2pi, cvt_mm_xmm_insn, (0x662CUL<<8)|NELEMS(cvt_mm_xmm_insn), CPU_SSE2, NONE -cvttps2dq, ssess_insn, (0xF35BUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -cvttps2pi, cvt_mm_xmm64_insn, (0x2CUL<<8)|NELEMS(cvt_mm_xmm64_insn), CPU_SSE, NONE -cvttsd2si, cvt_rx_xmm64_insn, (0xF22CUL<<8)|NELEMS(cvt_rx_xmm64_insn), CPU_SSE2, NONE -cvttsd2sil, cvt_rx_xmm64_insn, (0xF22CUL<<8)|NELEMS(cvt_rx_xmm64_insn), CPU_SSE2, SUF_L -cvttsd2siq, cvt_rx_xmm64_insn, (0xF22CUL<<8)|NELEMS(cvt_rx_xmm64_insn), CPU_SSE2, SUF_Q -cvttss2si, cvt_rx_xmm32_insn, (0xF32CUL<<8)|NELEMS(cvt_rx_xmm32_insn), CPU_386|CPU_SSE, NONE -cvttss2sil, cvt_rx_xmm32_insn, (0xF32CUL<<8)|NELEMS(cvt_rx_xmm32_insn), CPU_386|CPU_SSE, SUF_L -cvttss2siq, cvt_rx_xmm32_insn, (0xF32CUL<<8)|NELEMS(cvt_rx_xmm32_insn), CPU_64|CPU_SSE, SUF_Q -cwd, onebyte_insn, (0x001099UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -cwde, onebyte_insn, (0x002098UL<<8)|NELEMS(onebyte_insn), CPU_386, NONE -cwtd, onebyte_insn, (0x001099UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -cwtl, onebyte_insn, (0x002098UL<<8)|NELEMS(onebyte_insn), CPU_386, NONE -daa, onebyte_insn, (0x000027UL<<8)|NELEMS(onebyte_insn), CPU_Not64, NONE -das, onebyte_insn, (0x00002FUL<<8)|NELEMS(onebyte_insn), CPU_Not64, NONE +blendpd, sse4imm_insn, (0x0DUL<<8)|1, CPU_SSE41, NONE +blendps, sse4imm_insn, (0x0CUL<<8)|1, CPU_SSE41, NONE +blendvpd, sse4xmm0_insn, (0x15UL<<8)|2, CPU_SSE41, NONE +blendvps, sse4xmm0_insn, (0x14UL<<8)|2, CPU_SSE41, NONE +bound, bound_insn, (0UL<<8)|2, CPU_186|CPU_Not64, NONE +boundl, bound_insn, (0UL<<8)|2, CPU_386|CPU_Not64, SUF_L +boundw, bound_insn, (0UL<<8)|2, CPU_186|CPU_Not64, SUF_W +bsf, bsfr_insn, (0xBCUL<<8)|3, CPU_386, NONE +bsfl, bsfr_insn, (0xBCUL<<8)|3, CPU_386, SUF_L +bsfq, bsfr_insn, (0xBCUL<<8)|3, CPU_386|CPU_64, SUF_Q +bsfw, bsfr_insn, (0xBCUL<<8)|3, CPU_386, SUF_W +bsr, bsfr_insn, (0xBDUL<<8)|3, CPU_386, NONE +bsrl, bsfr_insn, (0xBDUL<<8)|3, CPU_386, SUF_L +bsrq, bsfr_insn, (0xBDUL<<8)|3, CPU_386|CPU_64, SUF_Q +bsrw, bsfr_insn, (0xBDUL<<8)|3, CPU_386, SUF_W +bswap, bswap_insn, (0UL<<8)|2, CPU_486, NONE +bswapl, bswap_insn, (0UL<<8)|2, CPU_486, SUF_L +bswapq, bswap_insn, (0UL<<8)|2, CPU_64, SUF_Q +bt, bittest_insn, (0x04A3UL<<8)|6, CPU_386, NONE +btl, bittest_insn, (0x04A3UL<<8)|6, CPU_386, SUF_L +btq, bittest_insn, (0x04A3UL<<8)|6, CPU_386|CPU_64, SUF_Q +btw, bittest_insn, (0x04A3UL<<8)|6, CPU_386, SUF_W +btc, bittest_insn, (0x07BBUL<<8)|6, CPU_386, NONE +btcl, bittest_insn, (0x07BBUL<<8)|6, CPU_386, SUF_L +btcq, bittest_insn, (0x07BBUL<<8)|6, CPU_386|CPU_64, SUF_Q +btcw, bittest_insn, (0x07BBUL<<8)|6, CPU_386, SUF_W +btr, bittest_insn, (0x06B3UL<<8)|6, CPU_386, NONE +btrl, bittest_insn, (0x06B3UL<<8)|6, CPU_386, SUF_L +btrq, bittest_insn, (0x06B3UL<<8)|6, CPU_386|CPU_64, SUF_Q +btrw, bittest_insn, (0x06B3UL<<8)|6, CPU_386, SUF_W +bts, bittest_insn, (0x05ABUL<<8)|6, CPU_386, NONE +btsl, bittest_insn, (0x05ABUL<<8)|6, CPU_386, SUF_L +btsq, bittest_insn, (0x05ABUL<<8)|6, CPU_386|CPU_64, SUF_Q +btsw, bittest_insn, (0x05ABUL<<8)|6, CPU_386, SUF_W +call, call_insn, (0UL<<8)|26, CPU_Any, NONE +calll, call_insn, (0UL<<8)|26, CPU_Not64, NONE +callq, call_insn, (0UL<<8)|26, CPU_64, NONE +cbtw, onebyte_insn, (0x001098UL<<8)|1, CPU_Any, NONE +cbw, onebyte_insn, (0x001098UL<<8)|1, CPU_Any, NONE +cdq, onebyte_insn, (0x002099UL<<8)|1, CPU_386, NONE +cdqe, onebyte_insn, (0x004098UL<<8)|1, CPU_64, NONE +clc, onebyte_insn, (0x0000F8UL<<8)|1, CPU_Any, NONE +cld, onebyte_insn, (0x0000FCUL<<8)|1, CPU_Any, NONE +clflush, clflush_insn, (0UL<<8)|1, CPU_P3, NONE +clgi, threebyte_insn, (0x0F01DDUL<<8)|1, CPU_SVM, NONE +cli, onebyte_insn, (0x0000FAUL<<8)|1, CPU_Any, NONE +cltd, onebyte_insn, (0x002099UL<<8)|1, CPU_386, NONE +cltq, onebyte_insn, (0x004098UL<<8)|1, CPU_64, NONE +clts, twobyte_insn, (0x0F06UL<<8)|1, CPU_286|CPU_Priv, NONE +cmc, onebyte_insn, (0x0000F5UL<<8)|1, CPU_Any, NONE +cmova, cmovcc_insn, (0x07UL<<8)|3, CPU_686, NONE +cmoval, cmovcc_insn, (0x07UL<<8)|3, CPU_686, SUF_L +cmovaq, cmovcc_insn, (0x07UL<<8)|3, CPU_64|CPU_686, SUF_Q +cmovaw, cmovcc_insn, (0x07UL<<8)|3, CPU_686, SUF_W +cmovae, cmovcc_insn, (0x03UL<<8)|3, CPU_686, NONE +cmovael, cmovcc_insn, (0x03UL<<8)|3, CPU_686, SUF_L +cmovaeq, cmovcc_insn, (0x03UL<<8)|3, CPU_64|CPU_686, SUF_Q +cmovaew, cmovcc_insn, (0x03UL<<8)|3, CPU_686, SUF_W +cmovb, cmovcc_insn, (0x02UL<<8)|3, CPU_686, NONE +cmovbl, cmovcc_insn, (0x02UL<<8)|3, CPU_686, SUF_L +cmovbq, cmovcc_insn, (0x02UL<<8)|3, CPU_64|CPU_686, SUF_Q +cmovbw, cmovcc_insn, (0x02UL<<8)|3, CPU_686, SUF_W +cmovbe, cmovcc_insn, (0x06UL<<8)|3, CPU_686, NONE +cmovbel, cmovcc_insn, (0x06UL<<8)|3, CPU_686, SUF_L +cmovbeq, cmovcc_insn, (0x06UL<<8)|3, CPU_64|CPU_686, SUF_Q +cmovbew, cmovcc_insn, (0x06UL<<8)|3, CPU_686, SUF_W +cmovc, cmovcc_insn, (0x02UL<<8)|3, CPU_686, NONE +cmovcl, cmovcc_insn, (0x02UL<<8)|3, CPU_686, SUF_L +cmovcq, cmovcc_insn, (0x02UL<<8)|3, CPU_64|CPU_686, SUF_Q +cmovcw, cmovcc_insn, (0x02UL<<8)|3, CPU_686, SUF_W +cmove, cmovcc_insn, (0x04UL<<8)|3, CPU_686, NONE +cmovel, cmovcc_insn, (0x04UL<<8)|3, CPU_686, SUF_L +cmoveq, cmovcc_insn, (0x04UL<<8)|3, CPU_64|CPU_686, SUF_Q +cmovew, cmovcc_insn, (0x04UL<<8)|3, CPU_686, SUF_W +cmovg, cmovcc_insn, (0x0FUL<<8)|3, CPU_686, NONE +cmovgl, cmovcc_insn, (0x0FUL<<8)|3, CPU_686, SUF_L +cmovgq, cmovcc_insn, (0x0FUL<<8)|3, CPU_64|CPU_686, SUF_Q +cmovgw, cmovcc_insn, (0x0FUL<<8)|3, CPU_686, SUF_W +cmovge, cmovcc_insn, (0x0DUL<<8)|3, CPU_686, NONE +cmovgel, cmovcc_insn, (0x0DUL<<8)|3, CPU_686, SUF_L +cmovgeq, cmovcc_insn, (0x0DUL<<8)|3, CPU_64|CPU_686, SUF_Q +cmovgew, cmovcc_insn, (0x0DUL<<8)|3, CPU_686, SUF_W +cmovl, cmovcc_insn, (0x0CUL<<8)|3, CPU_686, NONE +cmovll, cmovcc_insn, (0x0CUL<<8)|3, CPU_686, SUF_L +cmovlq, cmovcc_insn, (0x0CUL<<8)|3, CPU_64|CPU_686, SUF_Q +cmovlw, cmovcc_insn, (0x0CUL<<8)|3, CPU_686, SUF_W +cmovle, cmovcc_insn, (0x0EUL<<8)|3, CPU_686, NONE +cmovlel, cmovcc_insn, (0x0EUL<<8)|3, CPU_686, SUF_L +cmovleq, cmovcc_insn, (0x0EUL<<8)|3, CPU_64|CPU_686, SUF_Q +cmovlew, cmovcc_insn, (0x0EUL<<8)|3, CPU_686, SUF_W +cmovna, cmovcc_insn, (0x06UL<<8)|3, CPU_686, NONE +cmovnal, cmovcc_insn, (0x06UL<<8)|3, CPU_686, SUF_L +cmovnaq, cmovcc_insn, (0x06UL<<8)|3, CPU_64|CPU_686, SUF_Q +cmovnaw, cmovcc_insn, (0x06UL<<8)|3, CPU_686, SUF_W +cmovnae, cmovcc_insn, (0x02UL<<8)|3, CPU_686, NONE +cmovnael, cmovcc_insn, (0x02UL<<8)|3, CPU_686, SUF_L +cmovnaeq, cmovcc_insn, (0x02UL<<8)|3, CPU_64|CPU_686, SUF_Q +cmovnaew, cmovcc_insn, (0x02UL<<8)|3, CPU_686, SUF_W +cmovnb, cmovcc_insn, (0x03UL<<8)|3, CPU_686, NONE +cmovnbl, cmovcc_insn, (0x03UL<<8)|3, CPU_686, SUF_L +cmovnbq, cmovcc_insn, (0x03UL<<8)|3, CPU_64|CPU_686, SUF_Q +cmovnbw, cmovcc_insn, (0x03UL<<8)|3, CPU_686, SUF_W +cmovnbe, cmovcc_insn, (0x07UL<<8)|3, CPU_686, NONE +cmovnbel, cmovcc_insn, (0x07UL<<8)|3, CPU_686, SUF_L +cmovnbeq, cmovcc_insn, (0x07UL<<8)|3, CPU_64|CPU_686, SUF_Q +cmovnbew, cmovcc_insn, (0x07UL<<8)|3, CPU_686, SUF_W +cmovnc, cmovcc_insn, (0x03UL<<8)|3, CPU_686, NONE +cmovncl, cmovcc_insn, (0x03UL<<8)|3, CPU_686, SUF_L +cmovncq, cmovcc_insn, (0x03UL<<8)|3, CPU_64|CPU_686, SUF_Q +cmovncw, cmovcc_insn, (0x03UL<<8)|3, CPU_686, SUF_W +cmovne, cmovcc_insn, (0x05UL<<8)|3, CPU_686, NONE +cmovnel, cmovcc_insn, (0x05UL<<8)|3, CPU_686, SUF_L +cmovneq, cmovcc_insn, (0x05UL<<8)|3, CPU_64|CPU_686, SUF_Q +cmovnew, cmovcc_insn, (0x05UL<<8)|3, CPU_686, SUF_W +cmovng, cmovcc_insn, (0x0EUL<<8)|3, CPU_686, NONE +cmovngl, cmovcc_insn, (0x0EUL<<8)|3, CPU_686, SUF_L +cmovngq, cmovcc_insn, (0x0EUL<<8)|3, CPU_64|CPU_686, SUF_Q +cmovngw, cmovcc_insn, (0x0EUL<<8)|3, CPU_686, SUF_W +cmovnge, cmovcc_insn, (0x0CUL<<8)|3, CPU_686, NONE +cmovngel, cmovcc_insn, (0x0CUL<<8)|3, CPU_686, SUF_L +cmovngeq, cmovcc_insn, (0x0CUL<<8)|3, CPU_64|CPU_686, SUF_Q +cmovngew, cmovcc_insn, (0x0CUL<<8)|3, CPU_686, SUF_W +cmovnl, cmovcc_insn, (0x0DUL<<8)|3, CPU_686, NONE +cmovnll, cmovcc_insn, (0x0DUL<<8)|3, CPU_686, SUF_L +cmovnlq, cmovcc_insn, (0x0DUL<<8)|3, CPU_64|CPU_686, SUF_Q +cmovnlw, cmovcc_insn, (0x0DUL<<8)|3, CPU_686, SUF_W +cmovnle, cmovcc_insn, (0x0FUL<<8)|3, CPU_686, NONE +cmovnlel, cmovcc_insn, (0x0FUL<<8)|3, CPU_686, SUF_L +cmovnleq, cmovcc_insn, (0x0FUL<<8)|3, CPU_64|CPU_686, SUF_Q +cmovnlew, cmovcc_insn, (0x0FUL<<8)|3, CPU_686, SUF_W +cmovno, cmovcc_insn, (0x01UL<<8)|3, CPU_686, NONE +cmovnol, cmovcc_insn, (0x01UL<<8)|3, CPU_686, SUF_L +cmovnoq, cmovcc_insn, (0x01UL<<8)|3, CPU_64|CPU_686, SUF_Q +cmovnow, cmovcc_insn, (0x01UL<<8)|3, CPU_686, SUF_W +cmovnp, cmovcc_insn, (0x0BUL<<8)|3, CPU_686, NONE +cmovnpl, cmovcc_insn, (0x0BUL<<8)|3, CPU_686, SUF_L +cmovnpq, cmovcc_insn, (0x0BUL<<8)|3, CPU_64|CPU_686, SUF_Q +cmovnpw, cmovcc_insn, (0x0BUL<<8)|3, CPU_686, SUF_W +cmovns, cmovcc_insn, (0x09UL<<8)|3, CPU_686, NONE +cmovnsl, cmovcc_insn, (0x09UL<<8)|3, CPU_686, SUF_L +cmovnsq, cmovcc_insn, (0x09UL<<8)|3, CPU_64|CPU_686, SUF_Q +cmovnsw, cmovcc_insn, (0x09UL<<8)|3, CPU_686, SUF_W +cmovnz, cmovcc_insn, (0x05UL<<8)|3, CPU_686, NONE +cmovnzl, cmovcc_insn, (0x05UL<<8)|3, CPU_686, SUF_L +cmovnzq, cmovcc_insn, (0x05UL<<8)|3, CPU_64|CPU_686, SUF_Q +cmovnzw, cmovcc_insn, (0x05UL<<8)|3, CPU_686, SUF_W +cmovo, cmovcc_insn, (0x00UL<<8)|3, CPU_686, NONE +cmovol, cmovcc_insn, (0x00UL<<8)|3, CPU_686, SUF_L +cmovoq, cmovcc_insn, (0x00UL<<8)|3, CPU_64|CPU_686, SUF_Q +cmovow, cmovcc_insn, (0x00UL<<8)|3, CPU_686, SUF_W +cmovp, cmovcc_insn, (0x0AUL<<8)|3, CPU_686, NONE +cmovpl, cmovcc_insn, (0x0AUL<<8)|3, CPU_686, SUF_L +cmovpq, cmovcc_insn, (0x0AUL<<8)|3, CPU_64|CPU_686, SUF_Q +cmovpw, cmovcc_insn, (0x0AUL<<8)|3, CPU_686, SUF_W +cmovpe, cmovcc_insn, (0x0AUL<<8)|3, CPU_686, NONE +cmovpel, cmovcc_insn, (0x0AUL<<8)|3, CPU_686, SUF_L +cmovpeq, cmovcc_insn, (0x0AUL<<8)|3, CPU_64|CPU_686, SUF_Q +cmovpew, cmovcc_insn, (0x0AUL<<8)|3, CPU_686, SUF_W +cmovpo, cmovcc_insn, (0x0BUL<<8)|3, CPU_686, NONE +cmovpol, cmovcc_insn, (0x0BUL<<8)|3, CPU_686, SUF_L +cmovpoq, cmovcc_insn, (0x0BUL<<8)|3, CPU_64|CPU_686, SUF_Q +cmovpow, cmovcc_insn, (0x0BUL<<8)|3, CPU_686, SUF_W +cmovs, cmovcc_insn, (0x08UL<<8)|3, CPU_686, NONE +cmovsl, cmovcc_insn, (0x08UL<<8)|3, CPU_686, SUF_L +cmovsq, cmovcc_insn, (0x08UL<<8)|3, CPU_64|CPU_686, SUF_Q +cmovsw, cmovcc_insn, (0x08UL<<8)|3, CPU_686, SUF_W +cmovz, cmovcc_insn, (0x04UL<<8)|3, CPU_686, NONE +cmovzl, cmovcc_insn, (0x04UL<<8)|3, CPU_686, SUF_L +cmovzq, cmovcc_insn, (0x04UL<<8)|3, CPU_64|CPU_686, SUF_Q +cmovzw, cmovcc_insn, (0x04UL<<8)|3, CPU_686, SUF_W +cmp, arith_insn, (0x0738UL<<8)|22, CPU_Any, NONE +cmpb, arith_insn, (0x0738UL<<8)|22, CPU_Any, SUF_B +cmpl, arith_insn, (0x0738UL<<8)|22, CPU_386, SUF_L +cmpq, arith_insn, (0x0738UL<<8)|22, CPU_64, SUF_Q +cmpw, arith_insn, (0x0738UL<<8)|22, CPU_Any, SUF_W +cmpeqpd, ssecmpss_insn, (0x0066UL<<8)|1, CPU_SSE2, NONE +cmpeqps, ssecmpps_insn, (0x00UL<<8)|1, CPU_SSE, NONE +cmpeqsd, ssecmpss_insn, (0x00F2UL<<8)|1, CPU_SSE2, NONE +cmpeqss, ssecmpss_insn, (0x00F3UL<<8)|1, CPU_SSE, NONE +cmplepd, ssecmpss_insn, (0x0266UL<<8)|1, CPU_SSE2, NONE +cmpleps, ssecmpps_insn, (0x02UL<<8)|1, CPU_SSE, NONE +cmplesd, ssecmpss_insn, (0x02F2UL<<8)|1, CPU_SSE2, NONE +cmpless, ssecmpss_insn, (0x02F3UL<<8)|1, CPU_SSE, NONE +cmpltpd, ssecmpss_insn, (0x0166UL<<8)|1, CPU_SSE2, NONE +cmpltps, ssecmpps_insn, (0x01UL<<8)|1, CPU_SSE, NONE +cmpltsd, ssecmpss_insn, (0x01F2UL<<8)|1, CPU_SSE2, NONE +cmpltss, ssecmpss_insn, (0x01F3UL<<8)|1, CPU_SSE, NONE +cmpneqpd, ssecmpss_insn, (0x0466UL<<8)|1, CPU_SSE2, NONE +cmpneqps, ssecmpps_insn, (0x04UL<<8)|1, CPU_SSE, NONE +cmpneqsd, ssecmpss_insn, (0x04F2UL<<8)|1, CPU_SSE2, NONE +cmpneqss, ssecmpss_insn, (0x04F3UL<<8)|1, CPU_SSE, NONE +cmpnlepd, ssecmpss_insn, (0x0666UL<<8)|1, CPU_SSE2, NONE +cmpnleps, ssecmpps_insn, (0x06UL<<8)|1, CPU_SSE, NONE +cmpnlesd, ssecmpss_insn, (0x06F2UL<<8)|1, CPU_SSE2, NONE +cmpnless, ssecmpss_insn, (0x06F3UL<<8)|1, CPU_SSE, NONE +cmpnltpd, ssecmpss_insn, (0x0566UL<<8)|1, CPU_SSE2, NONE +cmpnltps, ssecmpps_insn, (0x05UL<<8)|1, CPU_SSE, NONE +cmpnltsd, ssecmpss_insn, (0x05F2UL<<8)|1, CPU_SSE2, NONE +cmpnltss, ssecmpss_insn, (0x05F3UL<<8)|1, CPU_SSE, NONE +cmpordpd, ssecmpss_insn, (0x0766UL<<8)|1, CPU_SSE2, NONE +cmpordps, ssecmpps_insn, (0x07UL<<8)|1, CPU_SSE, NONE +cmpordsd, ssecmpss_insn, (0x07F2UL<<8)|1, CPU_SSE2, NONE +cmpordss, ssecmpss_insn, (0x07F3UL<<8)|1, CPU_SSE, NONE +cmppd, ssessimm_insn, (0x66C2UL<<8)|1, CPU_SSE2, NONE +cmpps, ssepsimm_insn, (0xC2UL<<8)|1, CPU_SSE, NONE +cmpsb, onebyte_insn, (0x0000A6UL<<8)|1, CPU_Any, NONE +cmpsd, cmpsd_insn, (0UL<<8)|2, CPU_Any, NONE +cmpsl, onebyte_insn, (0x0020A7UL<<8)|1, CPU_386, NONE +cmpsq, onebyte_insn, (0x0040A7UL<<8)|1, CPU_64, NONE +cmpss, ssessimm_insn, (0xF3C2UL<<8)|1, CPU_SSE, NONE +cmpsw, onebyte_insn, (0x0010A7UL<<8)|1, CPU_Any, NONE +cmpunordpd, ssecmpss_insn, (0x0366UL<<8)|1, CPU_SSE2, NONE +cmpunordps, ssecmpps_insn, (0x03UL<<8)|1, CPU_SSE, NONE +cmpunordsd, ssecmpss_insn, (0x03F2UL<<8)|1, CPU_SSE2, NONE +cmpunordss, ssecmpss_insn, (0x03F3UL<<8)|1, CPU_SSE, NONE +cmpxchg, cmpxchgxadd_insn, (0xB0UL<<8)|4, CPU_486, NONE +cmpxchg16b, cmpxchg16b_insn, (0UL<<8)|1, CPU_64, NONE +cmpxchg8b, cmpxchg8b_insn, (0UL<<8)|1, CPU_586, NONE +cmpxchg8bq, cmpxchg8b_insn, (0UL<<8)|1, CPU_586, SUF_Q +cmpxchgb, cmpxchgxadd_insn, (0xB0UL<<8)|4, CPU_486, SUF_B +cmpxchgl, cmpxchgxadd_insn, (0xB0UL<<8)|4, CPU_486, SUF_L +cmpxchgq, cmpxchgxadd_insn, (0xB0UL<<8)|4, CPU_486|CPU_64, SUF_Q +cmpxchgw, cmpxchgxadd_insn, (0xB0UL<<8)|4, CPU_486, SUF_W +comisd, ssess_insn, (0x662FUL<<8)|1, CPU_SSE2, NONE +comiss, sseps_insn, (0x2FUL<<8)|1, CPU_SSE, NONE +cpuid, twobyte_insn, (0x0FA2UL<<8)|1, CPU_486, NONE +cqo, onebyte_insn, (0x004099UL<<8)|1, CPU_64, NONE +cqto, onebyte_insn, (0x004099UL<<8)|1, CPU_64, NONE +crc32, crc32_insn, (0UL<<8)|5, CPU_386|CPU_SSE42, NONE +crc32b, crc32_insn, (0UL<<8)|5, CPU_386|CPU_SSE42, SUF_B +crc32l, crc32_insn, (0UL<<8)|5, CPU_386|CPU_SSE42, SUF_L +crc32q, crc32_insn, (0UL<<8)|5, CPU_64|CPU_SSE42, SUF_Q +crc32w, crc32_insn, (0UL<<8)|5, CPU_386|CPU_SSE42, SUF_W +cvtdq2pd, cvt_xmm_xmm64_ss_insn, (0xF3E6UL<<8)|2, CPU_SSE2, NONE +cvtdq2ps, sseps_insn, (0x5BUL<<8)|1, CPU_SSE2, NONE +cvtpd2dq, ssess_insn, (0xF2E6UL<<8)|1, CPU_SSE2, NONE +cvtpd2pi, cvt_mm_xmm_insn, (0x662DUL<<8)|1, CPU_SSE2, NONE +cvtpd2ps, ssess_insn, (0x665AUL<<8)|1, CPU_SSE2, NONE +cvtpi2pd, cvt_xmm_mm_ss_insn, (0x662AUL<<8)|1, CPU_SSE2, NONE +cvtpi2ps, cvt_xmm_mm_ps_insn, (0x2AUL<<8)|1, CPU_SSE, NONE +cvtps2dq, ssess_insn, (0x665BUL<<8)|1, CPU_SSE2, NONE +cvtps2pd, cvt_xmm_xmm64_ps_insn, (0x5AUL<<8)|2, CPU_SSE2, NONE +cvtps2pi, cvt_mm_xmm64_insn, (0x2DUL<<8)|2, CPU_SSE, NONE +cvtsd2si, cvt_rx_xmm64_insn, (0xF22DUL<<8)|4, CPU_386|CPU_SSE2, NONE +cvtsd2sil, cvt_rx_xmm64_insn, (0xF22DUL<<8)|4, CPU_386|CPU_SSE2, SUF_L +cvtsd2siq, cvt_rx_xmm64_insn, (0xF22DUL<<8)|4, CPU_64|CPU_SSE2, SUF_Q +cvtsd2ss, cvt_xmm_xmm64_ss_insn, (0xF25AUL<<8)|2, CPU_SSE2, NONE +cvtsi2sd, cvt_xmm_rmx_insn, (0xF22AUL<<8)|2, CPU_SSE2, NONE +cvtsi2sdl, cvt_xmm_rmx_insn, (0xF22AUL<<8)|2, CPU_SSE2, SUF_L +cvtsi2sdq, cvt_xmm_rmx_insn, (0xF22AUL<<8)|2, CPU_SSE2, SUF_Q +cvtsi2ss, cvt_xmm_rmx_insn, (0xF32AUL<<8)|2, CPU_386|CPU_SSE, NONE +cvtsi2ssl, cvt_xmm_rmx_insn, (0xF32AUL<<8)|2, CPU_386|CPU_SSE, SUF_L +cvtsi2ssq, cvt_xmm_rmx_insn, (0xF32AUL<<8)|2, CPU_64|CPU_SSE, SUF_Q +cvtss2sd, cvt_xmm_xmm32_insn, (0xF35AUL<<8)|2, CPU_SSE2, NONE +cvtss2si, cvt_rx_xmm32_insn, (0xF32DUL<<8)|4, CPU_386|CPU_SSE, NONE +cvtss2sil, cvt_rx_xmm32_insn, (0xF32DUL<<8)|4, CPU_386|CPU_SSE, SUF_L +cvtss2siq, cvt_rx_xmm32_insn, (0xF32DUL<<8)|4, CPU_64|CPU_SSE, SUF_Q +cvttpd2dq, ssess_insn, (0x66E6UL<<8)|1, CPU_SSE2, NONE +cvttpd2pi, cvt_mm_xmm_insn, (0x662CUL<<8)|1, CPU_SSE2, NONE +cvttps2dq, ssess_insn, (0xF35BUL<<8)|1, CPU_SSE2, NONE +cvttps2pi, cvt_mm_xmm64_insn, (0x2CUL<<8)|2, CPU_SSE, NONE +cvttsd2si, cvt_rx_xmm64_insn, (0xF22CUL<<8)|4, CPU_SSE2, NONE +cvttsd2sil, cvt_rx_xmm64_insn, (0xF22CUL<<8)|4, CPU_SSE2, SUF_L +cvttsd2siq, cvt_rx_xmm64_insn, (0xF22CUL<<8)|4, CPU_SSE2, SUF_Q +cvttss2si, cvt_rx_xmm32_insn, (0xF32CUL<<8)|4, CPU_386|CPU_SSE, NONE +cvttss2sil, cvt_rx_xmm32_insn, (0xF32CUL<<8)|4, CPU_386|CPU_SSE, SUF_L +cvttss2siq, cvt_rx_xmm32_insn, (0xF32CUL<<8)|4, CPU_64|CPU_SSE, SUF_Q +cwd, onebyte_insn, (0x001099UL<<8)|1, CPU_Any, NONE +cwde, onebyte_insn, (0x002098UL<<8)|1, CPU_386, NONE +cwtd, onebyte_insn, (0x001099UL<<8)|1, CPU_Any, NONE +cwtl, onebyte_insn, (0x002098UL<<8)|1, CPU_386, NONE +daa, onebyte_insn, (0x000027UL<<8)|1, CPU_Not64, NONE +das, onebyte_insn, (0x00002FUL<<8)|1, CPU_Not64, NONE data16, NULL, X86_OPERSIZE, 0x10, NONE data32, NULL, X86_OPERSIZE, 0x20, NONE data64, NULL, X86_OPERSIZE, 0x40, NONE -dec, incdec_insn, (0x0148UL<<8)|NELEMS(incdec_insn), CPU_Any, NONE -decb, incdec_insn, (0x0148UL<<8)|NELEMS(incdec_insn), CPU_Any, SUF_B -decl, incdec_insn, (0x0148UL<<8)|NELEMS(incdec_insn), CPU_386, SUF_L -decq, incdec_insn, (0x0148UL<<8)|NELEMS(incdec_insn), CPU_64, SUF_Q -decw, incdec_insn, (0x0148UL<<8)|NELEMS(incdec_insn), CPU_Any, SUF_W -div, div_insn, (0x06UL<<8)|NELEMS(div_insn), CPU_Any, NONE -divb, div_insn, (0x06UL<<8)|NELEMS(div_insn), CPU_Any, SUF_B -divl, div_insn, (0x06UL<<8)|NELEMS(div_insn), CPU_386, SUF_L -divq, div_insn, (0x06UL<<8)|NELEMS(div_insn), CPU_64, SUF_Q -divw, div_insn, (0x06UL<<8)|NELEMS(div_insn), CPU_Any, SUF_W -divpd, ssess_insn, (0x665EUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -divps, sseps_insn, (0x5EUL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE -divsd, ssess_insn, (0xF25EUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -divss, ssess_insn, (0xF35EUL<<8)|NELEMS(ssess_insn), CPU_SSE, NONE -dppd, sse4imm_insn, (0x41UL<<8)|NELEMS(sse4imm_insn), CPU_SSE41, NONE -dpps, sse4imm_insn, (0x40UL<<8)|NELEMS(sse4imm_insn), CPU_SSE41, NONE +dec, incdec_insn, (0x0148UL<<8)|6, CPU_Any, NONE +decb, incdec_insn, (0x0148UL<<8)|6, CPU_Any, SUF_B +decl, incdec_insn, (0x0148UL<<8)|6, CPU_386, SUF_L +decq, incdec_insn, (0x0148UL<<8)|6, CPU_64, SUF_Q +decw, incdec_insn, (0x0148UL<<8)|6, CPU_Any, SUF_W +div, div_insn, (0x06UL<<8)|8, CPU_Any, NONE +divb, div_insn, (0x06UL<<8)|8, CPU_Any, SUF_B +divl, div_insn, (0x06UL<<8)|8, CPU_386, SUF_L +divq, div_insn, (0x06UL<<8)|8, CPU_64, SUF_Q +divw, div_insn, (0x06UL<<8)|8, CPU_Any, SUF_W +divpd, ssess_insn, (0x665EUL<<8)|1, CPU_SSE2, NONE +divps, sseps_insn, (0x5EUL<<8)|1, CPU_SSE, NONE +divsd, ssess_insn, (0xF25EUL<<8)|1, CPU_SSE2, NONE +divss, ssess_insn, (0xF35EUL<<8)|1, CPU_SSE, NONE +dppd, sse4imm_insn, (0x41UL<<8)|1, CPU_SSE41, NONE +dpps, sse4imm_insn, (0x40UL<<8)|1, CPU_SSE41, NONE dword, NULL, X86_OPERSIZE, 0x20, NONE -emms, twobyte_insn, (0x0F77UL<<8)|NELEMS(twobyte_insn), CPU_MMX, NONE -enter, enter_insn, (0UL<<8)|NELEMS(enter_insn), CPU_186, NONE -enterl, enter_insn, (0UL<<8)|NELEMS(enter_insn), CPU_186|CPU_Not64, SUF_L -enterq, enter_insn, (0UL<<8)|NELEMS(enter_insn), CPU_186|CPU_64, SUF_Q -enterw, enter_insn, (0UL<<8)|NELEMS(enter_insn), CPU_186, SUF_W -extractps, extractps_insn, (0UL<<8)|NELEMS(extractps_insn), CPU_386|CPU_SSE41, NONE -extrq, extrq_insn, (0UL<<8)|NELEMS(extrq_insn), CPU_SSE41, NONE -f2xm1, twobyte_insn, (0xD9F0UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fabs, twobyte_insn, (0xD9E1UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fadd, farith_insn, (0x00C0C0UL<<8)|NELEMS(farith_insn), CPU_FPU, NONE -faddl, farith_insn, (0x00C0C0UL<<8)|NELEMS(farith_insn), CPU_FPU, SUF_L -fadds, farith_insn, (0x00C0C0UL<<8)|NELEMS(farith_insn), CPU_FPU, SUF_S -faddp, farithp_insn, (0xC0UL<<8)|NELEMS(farithp_insn), CPU_FPU, NONE -fbld, fbldstp_insn, (0x04UL<<8)|NELEMS(fbldstp_insn), CPU_FPU, NONE -fbstp, fbldstp_insn, (0x06UL<<8)|NELEMS(fbldstp_insn), CPU_FPU, NONE -fchs, twobyte_insn, (0xD9E0UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fclex, threebyte_insn, (0x9BDBE2UL<<8)|NELEMS(threebyte_insn), CPU_FPU, NONE -fcmovb, fcmovcc_insn, (0xDAC0UL<<8)|NELEMS(fcmovcc_insn), CPU_686|CPU_FPU, NONE -fcmovbe, fcmovcc_insn, (0xDAD0UL<<8)|NELEMS(fcmovcc_insn), CPU_686|CPU_FPU, NONE -fcmove, fcmovcc_insn, (0xDAC8UL<<8)|NELEMS(fcmovcc_insn), CPU_686|CPU_FPU, NONE -fcmovnb, fcmovcc_insn, (0xDBC0UL<<8)|NELEMS(fcmovcc_insn), CPU_686|CPU_FPU, NONE -fcmovnbe, fcmovcc_insn, (0xDBD0UL<<8)|NELEMS(fcmovcc_insn), CPU_686|CPU_FPU, NONE -fcmovne, fcmovcc_insn, (0xDBC8UL<<8)|NELEMS(fcmovcc_insn), CPU_686|CPU_FPU, NONE -fcmovnu, fcmovcc_insn, (0xDBD8UL<<8)|NELEMS(fcmovcc_insn), CPU_686|CPU_FPU, NONE -fcmovu, fcmovcc_insn, (0xDAD8UL<<8)|NELEMS(fcmovcc_insn), CPU_686|CPU_FPU, NONE -fcom, fcom_insn, (0x02D0UL<<8)|NELEMS(fcom_insn), CPU_FPU, NONE -fcoml, fcom_insn, (0x02D0UL<<8)|NELEMS(fcom_insn), CPU_FPU, SUF_L -fcoms, fcom_insn, (0x02D0UL<<8)|NELEMS(fcom_insn), CPU_FPU, SUF_S -fcomi, fcom2_insn, (0xDBF0UL<<8)|NELEMS(fcom2_insn), CPU_686|CPU_FPU, NONE -fcomip, fcom2_insn, (0xDFF0UL<<8)|NELEMS(fcom2_insn), CPU_686|CPU_FPU, NONE -fcomp, fcom_insn, (0x03D8UL<<8)|NELEMS(fcom_insn), CPU_FPU, NONE -fcompl, fcom_insn, (0x03D8UL<<8)|NELEMS(fcom_insn), CPU_FPU, SUF_L -fcomps, fcom_insn, (0x03D8UL<<8)|NELEMS(fcom_insn), CPU_FPU, SUF_S -fcompp, twobyte_insn, (0xDED9UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fcos, twobyte_insn, (0xD9FFUL<<8)|NELEMS(twobyte_insn), CPU_286|CPU_FPU, NONE -fdecstp, twobyte_insn, (0xD9F6UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fdiv, farith_insn, (0x06F0F8UL<<8)|NELEMS(farith_insn), CPU_FPU, NONE -fdivl, farith_insn, (0x06F0F8UL<<8)|NELEMS(farith_insn), CPU_FPU, SUF_L -fdivs, farith_insn, (0x06F0F8UL<<8)|NELEMS(farith_insn), CPU_FPU, SUF_S -fdivp, farithp_insn, (0xF0UL<<8)|NELEMS(farithp_insn), CPU_FPU, NONE -fdivr, farith_insn, (0x07F8F0UL<<8)|NELEMS(farith_insn), CPU_FPU, NONE -fdivrl, farith_insn, (0x07F8F0UL<<8)|NELEMS(farith_insn), CPU_FPU, SUF_L -fdivrs, farith_insn, (0x07F8F0UL<<8)|NELEMS(farith_insn), CPU_FPU, SUF_S -fdivrp, farithp_insn, (0xF8UL<<8)|NELEMS(farithp_insn), CPU_FPU, NONE -femms, twobyte_insn, (0x0F0EUL<<8)|NELEMS(twobyte_insn), CPU_3DNow, NONE -ffree, ffree_insn, (0xDDUL<<8)|NELEMS(ffree_insn), CPU_FPU, NONE -ffreep, ffree_insn, (0xDFUL<<8)|NELEMS(ffree_insn), CPU_686|CPU_FPU|CPU_Undoc, NONE -fiadd, fiarith_insn, (0x00DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, NONE -fiaddl, fiarith_insn, (0x00DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, SUF_L -fiadds, fiarith_insn, (0x00DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, SUF_S -ficom, fiarith_insn, (0x02DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, NONE -ficoml, fiarith_insn, (0x02DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, SUF_L -ficoms, fiarith_insn, (0x02DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, SUF_S -ficomp, fiarith_insn, (0x03DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, NONE -ficompl, fiarith_insn, (0x03DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, SUF_L -ficomps, fiarith_insn, (0x03DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, SUF_S -fidiv, fiarith_insn, (0x06DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, NONE -fidivl, fiarith_insn, (0x06DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, SUF_L -fidivs, fiarith_insn, (0x06DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, SUF_S -fidivr, fiarith_insn, (0x07DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, NONE -fidivrl, fiarith_insn, (0x07DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, SUF_L -fidivrs, fiarith_insn, (0x07DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, SUF_S -fild, fildstp_insn, (0x050200UL<<8)|NELEMS(fildstp_insn), CPU_FPU, NONE -fildl, fildstp_insn, (0x050200UL<<8)|NELEMS(fildstp_insn), CPU_FPU, SUF_L -fildq, fildstp_insn, (0x050200UL<<8)|NELEMS(fildstp_insn), CPU_FPU, SUF_Q -filds, fildstp_insn, (0x050200UL<<8)|NELEMS(fildstp_insn), CPU_FPU, SUF_S -fildll, fbldstp_insn, (0x05UL<<8)|NELEMS(fbldstp_insn), CPU_FPU, NONE -fimul, fiarith_insn, (0x01DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, NONE -fimull, fiarith_insn, (0x01DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, SUF_L -fimuls, fiarith_insn, (0x01DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, SUF_S -fincstp, twobyte_insn, (0xD9F7UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -finit, threebyte_insn, (0x9BDBE3UL<<8)|NELEMS(threebyte_insn), CPU_FPU, NONE -fist, fiarith_insn, (0x02DBUL<<8)|NELEMS(fiarith_insn), CPU_FPU, NONE -fistl, fiarith_insn, (0x02DBUL<<8)|NELEMS(fiarith_insn), CPU_FPU, SUF_L -fists, fiarith_insn, (0x02DBUL<<8)|NELEMS(fiarith_insn), CPU_FPU, SUF_S -fistp, fildstp_insn, (0x070203UL<<8)|NELEMS(fildstp_insn), CPU_FPU, NONE -fistpl, fildstp_insn, (0x070203UL<<8)|NELEMS(fildstp_insn), CPU_FPU, SUF_L -fistpq, fildstp_insn, (0x070203UL<<8)|NELEMS(fildstp_insn), CPU_FPU, SUF_Q -fistps, fildstp_insn, (0x070203UL<<8)|NELEMS(fildstp_insn), CPU_FPU, SUF_S -fistpll, fbldstp_insn, (0x07UL<<8)|NELEMS(fbldstp_insn), CPU_FPU, NONE -fisttp, fildstp_insn, (0x010001UL<<8)|NELEMS(fildstp_insn), CPU_SSE3, NONE -fisttpl, fildstp_insn, (0x010001UL<<8)|NELEMS(fildstp_insn), CPU_SSE3, SUF_L -fisttpq, fildstp_insn, (0x010001UL<<8)|NELEMS(fildstp_insn), CPU_SSE3, SUF_Q -fisttps, fildstp_insn, (0x010001UL<<8)|NELEMS(fildstp_insn), CPU_SSE3, SUF_S -fisttpll, fildstp_insn, (0x000007UL<<8)|NELEMS(fildstp_insn), CPU_SSE3, SUF_Q -fisub, fiarith_insn, (0x04DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, NONE -fisubl, fiarith_insn, (0x04DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, SUF_L -fisubs, fiarith_insn, (0x04DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, SUF_S -fisubr, fiarith_insn, (0x05DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, NONE -fisubrl, fiarith_insn, (0x05DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, SUF_L -fisubrs, fiarith_insn, (0x05DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, SUF_S -fld, fld_insn, (0UL<<8)|NELEMS(fld_insn), CPU_FPU, NONE -fld1, twobyte_insn, (0xD9E8UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fldl, fld_insn, (0UL<<8)|NELEMS(fld_insn), CPU_FPU, SUF_L -flds, fld_insn, (0UL<<8)|NELEMS(fld_insn), CPU_FPU, SUF_S -fldcw, fldnstcw_insn, (0x05UL<<8)|NELEMS(fldnstcw_insn), CPU_FPU, NONE -fldcww, fldnstcw_insn, (0x05UL<<8)|NELEMS(fldnstcw_insn), CPU_FPU, SUF_W -fldenv, onebytemem_insn, (0x04D9UL<<8)|NELEMS(onebytemem_insn), CPU_FPU, NONE -fldenvl, onebytemem_insn, (0x04D9UL<<8)|NELEMS(onebytemem_insn), CPU_FPU, SUF_L -fldenvs, onebytemem_insn, (0x04D9UL<<8)|NELEMS(onebytemem_insn), CPU_FPU, SUF_S -fldl2e, twobyte_insn, (0xD9EAUL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fldl2t, twobyte_insn, (0xD9E9UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fldlg2, twobyte_insn, (0xD9ECUL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fldln2, twobyte_insn, (0xD9EDUL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fldpi, twobyte_insn, (0xD9EBUL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fldt, fldstpt_insn, (0x05UL<<8)|NELEMS(fldstpt_insn), CPU_FPU, WEAK -fldz, twobyte_insn, (0xD9EEUL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fmul, farith_insn, (0x01C8C8UL<<8)|NELEMS(farith_insn), CPU_FPU, NONE -fmull, farith_insn, (0x01C8C8UL<<8)|NELEMS(farith_insn), CPU_FPU, SUF_L -fmuls, farith_insn, (0x01C8C8UL<<8)|NELEMS(farith_insn), CPU_FPU, SUF_S -fmulp, farithp_insn, (0xC8UL<<8)|NELEMS(farithp_insn), CPU_FPU, NONE -fnclex, twobyte_insn, (0xDBE2UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fninit, twobyte_insn, (0xDBE3UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fnop, twobyte_insn, (0xD9D0UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fnsave, onebytemem_insn, (0x06DDUL<<8)|NELEMS(onebytemem_insn), CPU_FPU, NONE -fnsavel, onebytemem_insn, (0x06DDUL<<8)|NELEMS(onebytemem_insn), CPU_FPU, SUF_L -fnsaves, onebytemem_insn, (0x06DDUL<<8)|NELEMS(onebytemem_insn), CPU_FPU, SUF_S -fnstcw, fldnstcw_insn, (0x07UL<<8)|NELEMS(fldnstcw_insn), CPU_FPU, NONE -fnstcww, fldnstcw_insn, (0x07UL<<8)|NELEMS(fldnstcw_insn), CPU_FPU, SUF_W -fnstenv, onebytemem_insn, (0x06D9UL<<8)|NELEMS(onebytemem_insn), CPU_FPU, NONE -fnstenvl, onebytemem_insn, (0x06D9UL<<8)|NELEMS(onebytemem_insn), CPU_FPU, SUF_L -fnstenvs, onebytemem_insn, (0x06D9UL<<8)|NELEMS(onebytemem_insn), CPU_FPU, SUF_S -fnstsw, fnstsw_insn, (0UL<<8)|NELEMS(fnstsw_insn), CPU_FPU, NONE -fnstsww, fnstsw_insn, (0UL<<8)|NELEMS(fnstsw_insn), CPU_FPU, SUF_W -fpatan, twobyte_insn, (0xD9F3UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fprem, twobyte_insn, (0xD9F8UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fprem1, twobyte_insn, (0xD9F5UL<<8)|NELEMS(twobyte_insn), CPU_286|CPU_FPU, NONE -fptan, twobyte_insn, (0xD9F2UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -frndint, twobyte_insn, (0xD9FCUL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -frstor, onebytemem_insn, (0x04DDUL<<8)|NELEMS(onebytemem_insn), CPU_FPU, NONE -frstorl, onebytemem_insn, (0x04DDUL<<8)|NELEMS(onebytemem_insn), CPU_FPU, SUF_L -frstors, onebytemem_insn, (0x04DDUL<<8)|NELEMS(onebytemem_insn), CPU_FPU, SUF_S -fsave, twobytemem_insn, (0x069BDDUL<<8)|NELEMS(twobytemem_insn), CPU_FPU, NONE -fsavel, twobytemem_insn, (0x069BDDUL<<8)|NELEMS(twobytemem_insn), CPU_FPU, SUF_L -fsaves, twobytemem_insn, (0x069BDDUL<<8)|NELEMS(twobytemem_insn), CPU_FPU, SUF_S -fscale, twobyte_insn, (0xD9FDUL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fsetpm, twobyte_insn, (0xDBE4UL<<8)|NELEMS(twobyte_insn), CPU_286|CPU_FPU|CPU_Obs, NONE -fsin, twobyte_insn, (0xD9FEUL<<8)|NELEMS(twobyte_insn), CPU_286|CPU_FPU, NONE -fsincos, twobyte_insn, (0xD9FBUL<<8)|NELEMS(twobyte_insn), CPU_286|CPU_FPU, NONE -fsqrt, twobyte_insn, (0xD9FAUL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fst, fst_insn, (0UL<<8)|NELEMS(fst_insn), CPU_FPU, NONE -fstl, fst_insn, (0UL<<8)|NELEMS(fst_insn), CPU_FPU, SUF_L -fsts, fst_insn, (0UL<<8)|NELEMS(fst_insn), CPU_FPU, SUF_S -fstcw, fstcw_insn, (0UL<<8)|NELEMS(fstcw_insn), CPU_FPU, NONE -fstcww, fstcw_insn, (0UL<<8)|NELEMS(fstcw_insn), CPU_FPU, SUF_W -fstenv, twobytemem_insn, (0x069BD9UL<<8)|NELEMS(twobytemem_insn), CPU_FPU, NONE -fstenvl, twobytemem_insn, (0x069BD9UL<<8)|NELEMS(twobytemem_insn), CPU_FPU, SUF_L -fstenvs, twobytemem_insn, (0x069BD9UL<<8)|NELEMS(twobytemem_insn), CPU_FPU, SUF_S -fstp, fstp_insn, (0UL<<8)|NELEMS(fstp_insn), CPU_FPU, NONE -fstpl, fstp_insn, (0UL<<8)|NELEMS(fstp_insn), CPU_FPU, SUF_L -fstps, fstp_insn, (0UL<<8)|NELEMS(fstp_insn), CPU_FPU, SUF_S -fstpt, fldstpt_insn, (0x07UL<<8)|NELEMS(fldstpt_insn), CPU_FPU, WEAK -fstsw, fstsw_insn, (0UL<<8)|NELEMS(fstsw_insn), CPU_FPU, NONE -fstsww, fstsw_insn, (0UL<<8)|NELEMS(fstsw_insn), CPU_FPU, SUF_W -fsub, farith_insn, (0x04E0E8UL<<8)|NELEMS(farith_insn), CPU_FPU, NONE -fsubl, farith_insn, (0x04E0E8UL<<8)|NELEMS(farith_insn), CPU_FPU, SUF_L -fsubs, farith_insn, (0x04E0E8UL<<8)|NELEMS(farith_insn), CPU_FPU, SUF_S -fsubp, farithp_insn, (0xE0UL<<8)|NELEMS(farithp_insn), CPU_FPU, NONE -fsubr, farith_insn, (0x05E8E0UL<<8)|NELEMS(farith_insn), CPU_FPU, NONE -fsubrl, farith_insn, (0x05E8E0UL<<8)|NELEMS(farith_insn), CPU_FPU, SUF_L -fsubrs, farith_insn, (0x05E8E0UL<<8)|NELEMS(farith_insn), CPU_FPU, SUF_S -fsubrp, farithp_insn, (0xE8UL<<8)|NELEMS(farithp_insn), CPU_FPU, NONE -ftst, twobyte_insn, (0xD9E4UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fucom, fcom2_insn, (0xDDE0UL<<8)|NELEMS(fcom2_insn), CPU_286|CPU_FPU, NONE -fucomi, fcom2_insn, (0xDBE8UL<<8)|NELEMS(fcom2_insn), CPU_686|CPU_FPU, NONE -fucomip, fcom2_insn, (0xDFE8UL<<8)|NELEMS(fcom2_insn), CPU_686|CPU_FPU, NONE -fucomp, fcom2_insn, (0xDDE8UL<<8)|NELEMS(fcom2_insn), CPU_286|CPU_FPU, NONE -fucompp, twobyte_insn, (0xDAE9UL<<8)|NELEMS(twobyte_insn), CPU_286|CPU_FPU, NONE -fwait, onebyte_insn, (0x00009BUL<<8)|NELEMS(onebyte_insn), CPU_FPU, NONE -fxam, twobyte_insn, (0xD9E5UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fxch, fxch_insn, (0UL<<8)|NELEMS(fxch_insn), CPU_FPU, NONE -fxrstor, twobytemem_insn, (0x010FAEUL<<8)|NELEMS(twobytemem_insn), CPU_686|CPU_FPU, NONE -fxrstorq, twobytemem_insn, (0x010FAEUL<<8)|NELEMS(twobytemem_insn), CPU_686|CPU_FPU, SUF_Q -fxsave, twobytemem_insn, (0x000FAEUL<<8)|NELEMS(twobytemem_insn), CPU_686|CPU_FPU, NONE -fxsaveq, twobytemem_insn, (0x000FAEUL<<8)|NELEMS(twobytemem_insn), CPU_686|CPU_FPU, SUF_Q -fxtract, twobyte_insn, (0xD9F4UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fyl2x, twobyte_insn, (0xD9F1UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fyl2xp1, twobyte_insn, (0xD9F9UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -haddpd, ssess_insn, (0x667CUL<<8)|NELEMS(ssess_insn), CPU_SSE3, NONE -haddps, ssess_insn, (0xF27CUL<<8)|NELEMS(ssess_insn), CPU_SSE3, NONE -hlt, onebyte_insn, (0x0000F4UL<<8)|NELEMS(onebyte_insn), CPU_Priv, NONE +emms, twobyte_insn, (0x0F77UL<<8)|1, CPU_MMX, NONE +enter, enter_insn, (0UL<<8)|3, CPU_186, NONE +enterl, enter_insn, (0UL<<8)|3, CPU_186|CPU_Not64, SUF_L +enterq, enter_insn, (0UL<<8)|3, CPU_186|CPU_64, SUF_Q +enterw, enter_insn, (0UL<<8)|3, CPU_186, SUF_W +extractps, extractps_insn, (0UL<<8)|2, CPU_386|CPU_SSE41, NONE +extrq, extrq_insn, (0UL<<8)|2, CPU_SSE41, NONE +f2xm1, twobyte_insn, (0xD9F0UL<<8)|1, CPU_FPU, NONE +fabs, twobyte_insn, (0xD9E1UL<<8)|1, CPU_FPU, NONE +fadd, farith_insn, (0x00C0C0UL<<8)|7, CPU_FPU, NONE +faddl, farith_insn, (0x00C0C0UL<<8)|7, CPU_FPU, SUF_L +fadds, farith_insn, (0x00C0C0UL<<8)|7, CPU_FPU, SUF_S +faddp, farithp_insn, (0xC0UL<<8)|3, CPU_FPU, NONE +fbld, fbldstp_insn, (0x04UL<<8)|1, CPU_FPU, NONE +fbstp, fbldstp_insn, (0x06UL<<8)|1, CPU_FPU, NONE +fchs, twobyte_insn, (0xD9E0UL<<8)|1, CPU_FPU, NONE +fclex, threebyte_insn, (0x9BDBE2UL<<8)|1, CPU_FPU, NONE +fcmovb, fcmovcc_insn, (0xDAC0UL<<8)|1, CPU_686|CPU_FPU, NONE +fcmovbe, fcmovcc_insn, (0xDAD0UL<<8)|1, CPU_686|CPU_FPU, NONE +fcmove, fcmovcc_insn, (0xDAC8UL<<8)|1, CPU_686|CPU_FPU, NONE +fcmovnb, fcmovcc_insn, (0xDBC0UL<<8)|1, CPU_686|CPU_FPU, NONE +fcmovnbe, fcmovcc_insn, (0xDBD0UL<<8)|1, CPU_686|CPU_FPU, NONE +fcmovne, fcmovcc_insn, (0xDBC8UL<<8)|1, CPU_686|CPU_FPU, NONE +fcmovnu, fcmovcc_insn, (0xDBD8UL<<8)|1, CPU_686|CPU_FPU, NONE +fcmovu, fcmovcc_insn, (0xDAD8UL<<8)|1, CPU_686|CPU_FPU, NONE +fcom, fcom_insn, (0x02D0UL<<8)|5, CPU_FPU, NONE +fcoml, fcom_insn, (0x02D0UL<<8)|5, CPU_FPU, SUF_L +fcoms, fcom_insn, (0x02D0UL<<8)|5, CPU_FPU, SUF_S +fcomi, fcom2_insn, (0xDBF0UL<<8)|2, CPU_686|CPU_FPU, NONE +fcomip, fcom2_insn, (0xDFF0UL<<8)|2, CPU_686|CPU_FPU, NONE +fcomp, fcom_insn, (0x03D8UL<<8)|5, CPU_FPU, NONE +fcompl, fcom_insn, (0x03D8UL<<8)|5, CPU_FPU, SUF_L +fcomps, fcom_insn, (0x03D8UL<<8)|5, CPU_FPU, SUF_S +fcompp, twobyte_insn, (0xDED9UL<<8)|1, CPU_FPU, NONE +fcos, twobyte_insn, (0xD9FFUL<<8)|1, CPU_286|CPU_FPU, NONE +fdecstp, twobyte_insn, (0xD9F6UL<<8)|1, CPU_FPU, NONE +fdiv, farith_insn, (0x06F0F8UL<<8)|7, CPU_FPU, NONE +fdivl, farith_insn, (0x06F0F8UL<<8)|7, CPU_FPU, SUF_L +fdivs, farith_insn, (0x06F0F8UL<<8)|7, CPU_FPU, SUF_S +fdivp, farithp_insn, (0xF0UL<<8)|3, CPU_FPU, NONE +fdivr, farith_insn, (0x07F8F0UL<<8)|7, CPU_FPU, NONE +fdivrl, farith_insn, (0x07F8F0UL<<8)|7, CPU_FPU, SUF_L +fdivrs, farith_insn, (0x07F8F0UL<<8)|7, CPU_FPU, SUF_S +fdivrp, farithp_insn, (0xF8UL<<8)|3, CPU_FPU, NONE +femms, twobyte_insn, (0x0F0EUL<<8)|1, CPU_3DNow, NONE +ffree, ffree_insn, (0xDDUL<<8)|1, CPU_FPU, NONE +ffreep, ffree_insn, (0xDFUL<<8)|1, CPU_686|CPU_FPU|CPU_Undoc, NONE +fiadd, fiarith_insn, (0x00DAUL<<8)|2, CPU_FPU, NONE +fiaddl, fiarith_insn, (0x00DAUL<<8)|2, CPU_FPU, SUF_L +fiadds, fiarith_insn, (0x00DAUL<<8)|2, CPU_FPU, SUF_S +ficom, fiarith_insn, (0x02DAUL<<8)|2, CPU_FPU, NONE +ficoml, fiarith_insn, (0x02DAUL<<8)|2, CPU_FPU, SUF_L +ficoms, fiarith_insn, (0x02DAUL<<8)|2, CPU_FPU, SUF_S +ficomp, fiarith_insn, (0x03DAUL<<8)|2, CPU_FPU, NONE +ficompl, fiarith_insn, (0x03DAUL<<8)|2, CPU_FPU, SUF_L +ficomps, fiarith_insn, (0x03DAUL<<8)|2, CPU_FPU, SUF_S +fidiv, fiarith_insn, (0x06DAUL<<8)|2, CPU_FPU, NONE +fidivl, fiarith_insn, (0x06DAUL<<8)|2, CPU_FPU, SUF_L +fidivs, fiarith_insn, (0x06DAUL<<8)|2, CPU_FPU, SUF_S +fidivr, fiarith_insn, (0x07DAUL<<8)|2, CPU_FPU, NONE +fidivrl, fiarith_insn, (0x07DAUL<<8)|2, CPU_FPU, SUF_L +fidivrs, fiarith_insn, (0x07DAUL<<8)|2, CPU_FPU, SUF_S +fild, fildstp_insn, (0x050200UL<<8)|3, CPU_FPU, NONE +fildl, fildstp_insn, (0x050200UL<<8)|3, CPU_FPU, SUF_L +fildq, fildstp_insn, (0x050200UL<<8)|3, CPU_FPU, SUF_Q +filds, fildstp_insn, (0x050200UL<<8)|3, CPU_FPU, SUF_S +fildll, fbldstp_insn, (0x05UL<<8)|1, CPU_FPU, NONE +fimul, fiarith_insn, (0x01DAUL<<8)|2, CPU_FPU, NONE +fimull, fiarith_insn, (0x01DAUL<<8)|2, CPU_FPU, SUF_L +fimuls, fiarith_insn, (0x01DAUL<<8)|2, CPU_FPU, SUF_S +fincstp, twobyte_insn, (0xD9F7UL<<8)|1, CPU_FPU, NONE +finit, threebyte_insn, (0x9BDBE3UL<<8)|1, CPU_FPU, NONE +fist, fiarith_insn, (0x02DBUL<<8)|2, CPU_FPU, NONE +fistl, fiarith_insn, (0x02DBUL<<8)|2, CPU_FPU, SUF_L +fists, fiarith_insn, (0x02DBUL<<8)|2, CPU_FPU, SUF_S +fistp, fildstp_insn, (0x070203UL<<8)|3, CPU_FPU, NONE +fistpl, fildstp_insn, (0x070203UL<<8)|3, CPU_FPU, SUF_L +fistpq, fildstp_insn, (0x070203UL<<8)|3, CPU_FPU, SUF_Q +fistps, fildstp_insn, (0x070203UL<<8)|3, CPU_FPU, SUF_S +fistpll, fbldstp_insn, (0x07UL<<8)|1, CPU_FPU, NONE +fisttp, fildstp_insn, (0x010001UL<<8)|3, CPU_SSE3, NONE +fisttpl, fildstp_insn, (0x010001UL<<8)|3, CPU_SSE3, SUF_L +fisttpq, fildstp_insn, (0x010001UL<<8)|3, CPU_SSE3, SUF_Q +fisttps, fildstp_insn, (0x010001UL<<8)|3, CPU_SSE3, SUF_S +fisttpll, fildstp_insn, (0x000007UL<<8)|3, CPU_SSE3, SUF_Q +fisub, fiarith_insn, (0x04DAUL<<8)|2, CPU_FPU, NONE +fisubl, fiarith_insn, (0x04DAUL<<8)|2, CPU_FPU, SUF_L +fisubs, fiarith_insn, (0x04DAUL<<8)|2, CPU_FPU, SUF_S +fisubr, fiarith_insn, (0x05DAUL<<8)|2, CPU_FPU, NONE +fisubrl, fiarith_insn, (0x05DAUL<<8)|2, CPU_FPU, SUF_L +fisubrs, fiarith_insn, (0x05DAUL<<8)|2, CPU_FPU, SUF_S +fld, fld_insn, (0UL<<8)|4, CPU_FPU, NONE +fld1, twobyte_insn, (0xD9E8UL<<8)|1, CPU_FPU, NONE +fldl, fld_insn, (0UL<<8)|4, CPU_FPU, SUF_L +flds, fld_insn, (0UL<<8)|4, CPU_FPU, SUF_S +fldcw, fldnstcw_insn, (0x05UL<<8)|1, CPU_FPU, NONE +fldcww, fldnstcw_insn, (0x05UL<<8)|1, CPU_FPU, SUF_W +fldenv, onebytemem_insn, (0x04D9UL<<8)|1, CPU_FPU, NONE +fldenvl, onebytemem_insn, (0x04D9UL<<8)|1, CPU_FPU, SUF_L +fldenvs, onebytemem_insn, (0x04D9UL<<8)|1, CPU_FPU, SUF_S +fldl2e, twobyte_insn, (0xD9EAUL<<8)|1, CPU_FPU, NONE +fldl2t, twobyte_insn, (0xD9E9UL<<8)|1, CPU_FPU, NONE +fldlg2, twobyte_insn, (0xD9ECUL<<8)|1, CPU_FPU, NONE +fldln2, twobyte_insn, (0xD9EDUL<<8)|1, CPU_FPU, NONE +fldpi, twobyte_insn, (0xD9EBUL<<8)|1, CPU_FPU, NONE +fldt, fldstpt_insn, (0x05UL<<8)|1, CPU_FPU, WEAK +fldz, twobyte_insn, (0xD9EEUL<<8)|1, CPU_FPU, NONE +fmul, farith_insn, (0x01C8C8UL<<8)|7, CPU_FPU, NONE +fmull, farith_insn, (0x01C8C8UL<<8)|7, CPU_FPU, SUF_L +fmuls, farith_insn, (0x01C8C8UL<<8)|7, CPU_FPU, SUF_S +fmulp, farithp_insn, (0xC8UL<<8)|3, CPU_FPU, NONE +fnclex, twobyte_insn, (0xDBE2UL<<8)|1, CPU_FPU, NONE +fninit, twobyte_insn, (0xDBE3UL<<8)|1, CPU_FPU, NONE +fnop, twobyte_insn, (0xD9D0UL<<8)|1, CPU_FPU, NONE +fnsave, onebytemem_insn, (0x06DDUL<<8)|1, CPU_FPU, NONE +fnsavel, onebytemem_insn, (0x06DDUL<<8)|1, CPU_FPU, SUF_L +fnsaves, onebytemem_insn, (0x06DDUL<<8)|1, CPU_FPU, SUF_S +fnstcw, fldnstcw_insn, (0x07UL<<8)|1, CPU_FPU, NONE +fnstcww, fldnstcw_insn, (0x07UL<<8)|1, CPU_FPU, SUF_W +fnstenv, onebytemem_insn, (0x06D9UL<<8)|1, CPU_FPU, NONE +fnstenvl, onebytemem_insn, (0x06D9UL<<8)|1, CPU_FPU, SUF_L +fnstenvs, onebytemem_insn, (0x06D9UL<<8)|1, CPU_FPU, SUF_S +fnstsw, fnstsw_insn, (0UL<<8)|2, CPU_FPU, NONE +fnstsww, fnstsw_insn, (0UL<<8)|2, CPU_FPU, SUF_W +fpatan, twobyte_insn, (0xD9F3UL<<8)|1, CPU_FPU, NONE +fprem, twobyte_insn, (0xD9F8UL<<8)|1, CPU_FPU, NONE +fprem1, twobyte_insn, (0xD9F5UL<<8)|1, CPU_286|CPU_FPU, NONE +fptan, twobyte_insn, (0xD9F2UL<<8)|1, CPU_FPU, NONE +frndint, twobyte_insn, (0xD9FCUL<<8)|1, CPU_FPU, NONE +frstor, onebytemem_insn, (0x04DDUL<<8)|1, CPU_FPU, NONE +frstorl, onebytemem_insn, (0x04DDUL<<8)|1, CPU_FPU, SUF_L +frstors, onebytemem_insn, (0x04DDUL<<8)|1, CPU_FPU, SUF_S +fsave, twobytemem_insn, (0x069BDDUL<<8)|1, CPU_FPU, NONE +fsavel, twobytemem_insn, (0x069BDDUL<<8)|1, CPU_FPU, SUF_L +fsaves, twobytemem_insn, (0x069BDDUL<<8)|1, CPU_FPU, SUF_S +fscale, twobyte_insn, (0xD9FDUL<<8)|1, CPU_FPU, NONE +fsetpm, twobyte_insn, (0xDBE4UL<<8)|1, CPU_286|CPU_FPU|CPU_Obs, NONE +fsin, twobyte_insn, (0xD9FEUL<<8)|1, CPU_286|CPU_FPU, NONE +fsincos, twobyte_insn, (0xD9FBUL<<8)|1, CPU_286|CPU_FPU, NONE +fsqrt, twobyte_insn, (0xD9FAUL<<8)|1, CPU_FPU, NONE +fst, fst_insn, (0UL<<8)|3, CPU_FPU, NONE +fstl, fst_insn, (0UL<<8)|3, CPU_FPU, SUF_L +fsts, fst_insn, (0UL<<8)|3, CPU_FPU, SUF_S +fstcw, fstcw_insn, (0UL<<8)|1, CPU_FPU, NONE +fstcww, fstcw_insn, (0UL<<8)|1, CPU_FPU, SUF_W +fstenv, twobytemem_insn, (0x069BD9UL<<8)|1, CPU_FPU, NONE +fstenvl, twobytemem_insn, (0x069BD9UL<<8)|1, CPU_FPU, SUF_L +fstenvs, twobytemem_insn, (0x069BD9UL<<8)|1, CPU_FPU, SUF_S +fstp, fstp_insn, (0UL<<8)|4, CPU_FPU, NONE +fstpl, fstp_insn, (0UL<<8)|4, CPU_FPU, SUF_L +fstps, fstp_insn, (0UL<<8)|4, CPU_FPU, SUF_S +fstpt, fldstpt_insn, (0x07UL<<8)|1, CPU_FPU, WEAK +fstsw, fstsw_insn, (0UL<<8)|2, CPU_FPU, NONE +fstsww, fstsw_insn, (0UL<<8)|2, CPU_FPU, SUF_W +fsub, farith_insn, (0x04E0E8UL<<8)|7, CPU_FPU, NONE +fsubl, farith_insn, (0x04E0E8UL<<8)|7, CPU_FPU, SUF_L +fsubs, farith_insn, (0x04E0E8UL<<8)|7, CPU_FPU, SUF_S +fsubp, farithp_insn, (0xE0UL<<8)|3, CPU_FPU, NONE +fsubr, farith_insn, (0x05E8E0UL<<8)|7, CPU_FPU, NONE +fsubrl, farith_insn, (0x05E8E0UL<<8)|7, CPU_FPU, SUF_L +fsubrs, farith_insn, (0x05E8E0UL<<8)|7, CPU_FPU, SUF_S +fsubrp, farithp_insn, (0xE8UL<<8)|3, CPU_FPU, NONE +ftst, twobyte_insn, (0xD9E4UL<<8)|1, CPU_FPU, NONE +fucom, fcom2_insn, (0xDDE0UL<<8)|2, CPU_286|CPU_FPU, NONE +fucomi, fcom2_insn, (0xDBE8UL<<8)|2, CPU_686|CPU_FPU, NONE +fucomip, fcom2_insn, (0xDFE8UL<<8)|2, CPU_686|CPU_FPU, NONE +fucomp, fcom2_insn, (0xDDE8UL<<8)|2, CPU_286|CPU_FPU, NONE +fucompp, twobyte_insn, (0xDAE9UL<<8)|1, CPU_286|CPU_FPU, NONE +fwait, onebyte_insn, (0x00009BUL<<8)|1, CPU_FPU, NONE +fxam, twobyte_insn, (0xD9E5UL<<8)|1, CPU_FPU, NONE +fxch, fxch_insn, (0UL<<8)|4, CPU_FPU, NONE +fxrstor, twobytemem_insn, (0x010FAEUL<<8)|1, CPU_686|CPU_FPU, NONE +fxrstorq, twobytemem_insn, (0x010FAEUL<<8)|1, CPU_686|CPU_FPU, SUF_Q +fxsave, twobytemem_insn, (0x000FAEUL<<8)|1, CPU_686|CPU_FPU, NONE +fxsaveq, twobytemem_insn, (0x000FAEUL<<8)|1, CPU_686|CPU_FPU, SUF_Q +fxtract, twobyte_insn, (0xD9F4UL<<8)|1, CPU_FPU, NONE +fyl2x, twobyte_insn, (0xD9F1UL<<8)|1, CPU_FPU, NONE +fyl2xp1, twobyte_insn, (0xD9F9UL<<8)|1, CPU_FPU, NONE +haddpd, ssess_insn, (0x667CUL<<8)|1, CPU_SSE3, NONE +haddps, ssess_insn, (0xF27CUL<<8)|1, CPU_SSE3, NONE +hlt, onebyte_insn, (0x0000F4UL<<8)|1, CPU_Priv, NONE hnt, NULL, X86_SEGREG, 0x2E, NONE -hsubpd, ssess_insn, (0x667DUL<<8)|NELEMS(ssess_insn), CPU_SSE3, NONE -hsubps, ssess_insn, (0xF27DUL<<8)|NELEMS(ssess_insn), CPU_SSE3, NONE +hsubpd, ssess_insn, (0x667DUL<<8)|1, CPU_SSE3, NONE +hsubps, ssess_insn, (0xF27DUL<<8)|1, CPU_SSE3, NONE ht, NULL, X86_SEGREG, 0x3E, NONE -ibts, ibts_insn, (0UL<<8)|NELEMS(ibts_insn), CPU_386|CPU_Obs|CPU_Undoc, NONE -idiv, div_insn, (0x07UL<<8)|NELEMS(div_insn), CPU_Any, NONE -idivb, div_insn, (0x07UL<<8)|NELEMS(div_insn), CPU_Any, SUF_B -idivl, div_insn, (0x07UL<<8)|NELEMS(div_insn), CPU_386, SUF_L -idivq, div_insn, (0x07UL<<8)|NELEMS(div_insn), CPU_64, SUF_Q -idivw, div_insn, (0x07UL<<8)|NELEMS(div_insn), CPU_Any, SUF_W -imul, imul_insn, (0UL<<8)|NELEMS(imul_insn), CPU_Any, NONE -imulb, imul_insn, (0UL<<8)|NELEMS(imul_insn), CPU_Any, SUF_B -imull, imul_insn, (0UL<<8)|NELEMS(imul_insn), CPU_386, SUF_L -imulq, imul_insn, (0UL<<8)|NELEMS(imul_insn), CPU_64, SUF_Q -imulw, imul_insn, (0UL<<8)|NELEMS(imul_insn), CPU_Any, SUF_W -in, in_insn, (0UL<<8)|NELEMS(in_insn), CPU_Any, NONE -inb, in_insn, (0UL<<8)|NELEMS(in_insn), CPU_Any, SUF_B -inl, in_insn, (0UL<<8)|NELEMS(in_insn), CPU_386, SUF_L -inw, in_insn, (0UL<<8)|NELEMS(in_insn), CPU_Any, SUF_W -inc, incdec_insn, (0x0040UL<<8)|NELEMS(incdec_insn), CPU_Any, NONE -incb, incdec_insn, (0x0040UL<<8)|NELEMS(incdec_insn), CPU_Any, SUF_B -incl, incdec_insn, (0x0040UL<<8)|NELEMS(incdec_insn), CPU_386, SUF_L -incq, incdec_insn, (0x0040UL<<8)|NELEMS(incdec_insn), CPU_64, SUF_Q -incw, incdec_insn, (0x0040UL<<8)|NELEMS(incdec_insn), CPU_Any, SUF_W -insb, onebyte_insn, (0x00006CUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -insertps, insertps_insn, (0UL<<8)|NELEMS(insertps_insn), CPU_SSE41, NONE -insertq, insertq_insn, (0UL<<8)|NELEMS(insertq_insn), CPU_SSE41, NONE -insl, onebyte_insn, (0x00206DUL<<8)|NELEMS(onebyte_insn), CPU_386, NONE -insw, onebyte_insn, (0x00106DUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -int, int_insn, (0UL<<8)|NELEMS(int_insn), CPU_Any, NONE -int3, onebyte_insn, (0x0000CCUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -into, onebyte_insn, (0x0000CEUL<<8)|NELEMS(onebyte_insn), CPU_Not64, NONE -invd, twobyte_insn, (0x0F08UL<<8)|NELEMS(twobyte_insn), CPU_486|CPU_Priv, NONE -invlpg, twobytemem_insn, (0x070F01UL<<8)|NELEMS(twobytemem_insn), CPU_486|CPU_Priv, NONE -invlpga, invlpga_insn, (0UL<<8)|NELEMS(invlpga_insn), CPU_SVM, NONE -iret, onebyte_insn, (0x0000CFUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -iretl, onebyte_insn, (0x0020CFUL<<8)|NELEMS(onebyte_insn), CPU_386, NONE -iretq, onebyte_insn, (0x0040CFUL<<8)|NELEMS(onebyte_insn), CPU_64, NONE -iretw, onebyte_insn, (0x0010CFUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -ja, jcc_insn, (0x07UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jae, jcc_insn, (0x03UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jb, jcc_insn, (0x02UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jbe, jcc_insn, (0x06UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jc, jcc_insn, (0x02UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jcxz, jcxz_insn, (0x10UL<<8)|NELEMS(jcxz_insn), CPU_Any, NONE -je, jcc_insn, (0x04UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jecxz, jcxz_insn, (0x20UL<<8)|NELEMS(jcxz_insn), CPU_386, NONE -jg, jcc_insn, (0x0FUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jge, jcc_insn, (0x0DUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jl, jcc_insn, (0x0CUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jle, jcc_insn, (0x0EUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jmp, jmp_insn, (0UL<<8)|NELEMS(jmp_insn), CPU_Any, NONE -jna, jcc_insn, (0x06UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jnae, jcc_insn, (0x02UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jnb, jcc_insn, (0x03UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jnbe, jcc_insn, (0x07UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jnc, jcc_insn, (0x03UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jne, jcc_insn, (0x05UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jng, jcc_insn, (0x0EUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jnge, jcc_insn, (0x0CUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jnl, jcc_insn, (0x0DUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jnle, jcc_insn, (0x0FUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jno, jcc_insn, (0x01UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jnp, jcc_insn, (0x0BUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jns, jcc_insn, (0x09UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jnz, jcc_insn, (0x05UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jo, jcc_insn, (0x00UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jp, jcc_insn, (0x0AUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jpe, jcc_insn, (0x0AUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jpo, jcc_insn, (0x0BUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jrcxz, jcxz_insn, (0x40UL<<8)|NELEMS(jcxz_insn), CPU_64, NONE -js, jcc_insn, (0x08UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jz, jcc_insn, (0x04UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -lahf, onebyte_insn, (0x00009FUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -lar, bsfr_insn, (0x02UL<<8)|NELEMS(bsfr_insn), CPU_286|CPU_Prot, NONE -larl, bsfr_insn, (0x02UL<<8)|NELEMS(bsfr_insn), CPU_286|CPU_Prot, SUF_L -larq, bsfr_insn, (0x02UL<<8)|NELEMS(bsfr_insn), CPU_286|CPU_Prot, SUF_Q -larw, bsfr_insn, (0x02UL<<8)|NELEMS(bsfr_insn), CPU_286|CPU_Prot, SUF_W -lddqu, lddqu_insn, (0UL<<8)|NELEMS(lddqu_insn), CPU_SSE3, NONE -ldmxcsr, ldstmxcsr_insn, (0x02UL<<8)|NELEMS(ldstmxcsr_insn), CPU_SSE, NONE -lds, ldes_insn, (0xC5UL<<8)|NELEMS(ldes_insn), CPU_Not64, NONE -ldsl, ldes_insn, (0xC5UL<<8)|NELEMS(ldes_insn), CPU_386|CPU_Not64, SUF_L -ldsw, ldes_insn, (0xC5UL<<8)|NELEMS(ldes_insn), CPU_Not64, SUF_W -lea, lea_insn, (0UL<<8)|NELEMS(lea_insn), CPU_Any, NONE -leal, lea_insn, (0UL<<8)|NELEMS(lea_insn), CPU_386, SUF_L -leaq, lea_insn, (0UL<<8)|NELEMS(lea_insn), CPU_64, SUF_Q -leaw, lea_insn, (0UL<<8)|NELEMS(lea_insn), CPU_Any, SUF_W -leave, onebyte_insn, (0x4000C9UL<<8)|NELEMS(onebyte_insn), CPU_186, NONE -leavel, onebyte_insn, (0x4000C9UL<<8)|NELEMS(onebyte_insn), CPU_186, NONE -leaveq, onebyte_insn, (0x4000C9UL<<8)|NELEMS(onebyte_insn), CPU_64, NONE -leavew, onebyte_insn, (0x0010C9UL<<8)|NELEMS(onebyte_insn), CPU_186, NONE -les, ldes_insn, (0xC4UL<<8)|NELEMS(ldes_insn), CPU_Not64, NONE -lesl, ldes_insn, (0xC4UL<<8)|NELEMS(ldes_insn), CPU_386|CPU_Not64, SUF_L -lesw, ldes_insn, (0xC4UL<<8)|NELEMS(ldes_insn), CPU_Not64, SUF_W -lfence, threebyte_insn, (0x0FAEE8UL<<8)|NELEMS(threebyte_insn), CPU_P3, NONE -lfs, lfgss_insn, (0xB4UL<<8)|NELEMS(lfgss_insn), CPU_386, NONE -lfsl, lfgss_insn, (0xB4UL<<8)|NELEMS(lfgss_insn), CPU_386, SUF_L -lfsw, lfgss_insn, (0xB4UL<<8)|NELEMS(lfgss_insn), CPU_386, SUF_W -lgdt, twobytemem_insn, (0x020F01UL<<8)|NELEMS(twobytemem_insn), CPU_286|CPU_Priv, NONE -lgdtl, twobytemem_insn, (0x020F01UL<<8)|NELEMS(twobytemem_insn), CPU_286|CPU_Priv, SUF_L -lgdtq, twobytemem_insn, (0x020F01UL<<8)|NELEMS(twobytemem_insn), CPU_286|CPU_Priv, SUF_Q -lgdtw, twobytemem_insn, (0x020F01UL<<8)|NELEMS(twobytemem_insn), CPU_286|CPU_Priv, SUF_W -lgs, lfgss_insn, (0xB5UL<<8)|NELEMS(lfgss_insn), CPU_386, NONE -lgsl, lfgss_insn, (0xB5UL<<8)|NELEMS(lfgss_insn), CPU_386, SUF_L -lgsw, lfgss_insn, (0xB5UL<<8)|NELEMS(lfgss_insn), CPU_386, SUF_W -lidt, twobytemem_insn, (0x030F01UL<<8)|NELEMS(twobytemem_insn), CPU_286|CPU_Priv, NONE -lidtl, twobytemem_insn, (0x030F01UL<<8)|NELEMS(twobytemem_insn), CPU_286|CPU_Priv, SUF_L -lidtq, twobytemem_insn, (0x030F01UL<<8)|NELEMS(twobytemem_insn), CPU_286|CPU_Priv, SUF_Q -lidtw, twobytemem_insn, (0x030F01UL<<8)|NELEMS(twobytemem_insn), CPU_286|CPU_Priv, SUF_W -lldt, prot286_insn, (0x0200UL<<8)|NELEMS(prot286_insn), CPU_286|CPU_Priv|CPU_Prot, NONE -lldtw, prot286_insn, (0x0200UL<<8)|NELEMS(prot286_insn), CPU_286|CPU_Priv|CPU_Prot, SUF_W -lmsw, prot286_insn, (0x0601UL<<8)|NELEMS(prot286_insn), CPU_286|CPU_Priv, NONE -lmsww, prot286_insn, (0x0601UL<<8)|NELEMS(prot286_insn), CPU_286|CPU_Priv, SUF_W -loadall, twobyte_insn, (0x0F07UL<<8)|NELEMS(twobyte_insn), CPU_386|CPU_Undoc, NONE -loadall286, twobyte_insn, (0x0F05UL<<8)|NELEMS(twobyte_insn), CPU_286|CPU_Undoc, NONE +ibts, ibts_insn, (0UL<<8)|2, CPU_386|CPU_Obs|CPU_Undoc, NONE +idiv, div_insn, (0x07UL<<8)|8, CPU_Any, NONE +idivb, div_insn, (0x07UL<<8)|8, CPU_Any, SUF_B +idivl, div_insn, (0x07UL<<8)|8, CPU_386, SUF_L +idivq, div_insn, (0x07UL<<8)|8, CPU_64, SUF_Q +idivw, div_insn, (0x07UL<<8)|8, CPU_Any, SUF_W +imul, imul_insn, (0UL<<8)|19, CPU_Any, NONE +imulb, imul_insn, (0UL<<8)|19, CPU_Any, SUF_B +imull, imul_insn, (0UL<<8)|19, CPU_386, SUF_L +imulq, imul_insn, (0UL<<8)|19, CPU_64, SUF_Q +imulw, imul_insn, (0UL<<8)|19, CPU_Any, SUF_W +in, in_insn, (0UL<<8)|12, CPU_Any, NONE +inb, in_insn, (0UL<<8)|12, CPU_Any, SUF_B +inl, in_insn, (0UL<<8)|12, CPU_386, SUF_L +inw, in_insn, (0UL<<8)|12, CPU_Any, SUF_W +inc, incdec_insn, (0x0040UL<<8)|6, CPU_Any, NONE +incb, incdec_insn, (0x0040UL<<8)|6, CPU_Any, SUF_B +incl, incdec_insn, (0x0040UL<<8)|6, CPU_386, SUF_L +incq, incdec_insn, (0x0040UL<<8)|6, CPU_64, SUF_Q +incw, incdec_insn, (0x0040UL<<8)|6, CPU_Any, SUF_W +insb, onebyte_insn, (0x00006CUL<<8)|1, CPU_Any, NONE +insertps, insertps_insn, (0UL<<8)|2, CPU_SSE41, NONE +insertq, insertq_insn, (0UL<<8)|2, CPU_SSE41, NONE +insl, onebyte_insn, (0x00206DUL<<8)|1, CPU_386, NONE +insw, onebyte_insn, (0x00106DUL<<8)|1, CPU_Any, NONE +int, int_insn, (0UL<<8)|1, CPU_Any, NONE +int3, onebyte_insn, (0x0000CCUL<<8)|1, CPU_Any, NONE +into, onebyte_insn, (0x0000CEUL<<8)|1, CPU_Not64, NONE +invd, twobyte_insn, (0x0F08UL<<8)|1, CPU_486|CPU_Priv, NONE +invlpg, twobytemem_insn, (0x070F01UL<<8)|1, CPU_486|CPU_Priv, NONE +invlpga, invlpga_insn, (0UL<<8)|2, CPU_SVM, NONE +iret, onebyte_insn, (0x0000CFUL<<8)|1, CPU_Any, NONE +iretl, onebyte_insn, (0x0020CFUL<<8)|1, CPU_386, NONE +iretq, onebyte_insn, (0x0040CFUL<<8)|1, CPU_64, NONE +iretw, onebyte_insn, (0x0010CFUL<<8)|1, CPU_Any, NONE +ja, jcc_insn, (0x07UL<<8)|9, CPU_Any, NONE +jae, jcc_insn, (0x03UL<<8)|9, CPU_Any, NONE +jb, jcc_insn, (0x02UL<<8)|9, CPU_Any, NONE +jbe, jcc_insn, (0x06UL<<8)|9, CPU_Any, NONE +jc, jcc_insn, (0x02UL<<8)|9, CPU_Any, NONE +jcxz, jcxz_insn, (0x10UL<<8)|2, CPU_Any, NONE +je, jcc_insn, (0x04UL<<8)|9, CPU_Any, NONE +jecxz, jcxz_insn, (0x20UL<<8)|2, CPU_386, NONE +jg, jcc_insn, (0x0FUL<<8)|9, CPU_Any, NONE +jge, jcc_insn, (0x0DUL<<8)|9, CPU_Any, NONE +jl, jcc_insn, (0x0CUL<<8)|9, CPU_Any, NONE +jle, jcc_insn, (0x0EUL<<8)|9, CPU_Any, NONE +jmp, jmp_insn, (0UL<<8)|27, CPU_Any, NONE +jna, jcc_insn, (0x06UL<<8)|9, CPU_Any, NONE +jnae, jcc_insn, (0x02UL<<8)|9, CPU_Any, NONE +jnb, jcc_insn, (0x03UL<<8)|9, CPU_Any, NONE +jnbe, jcc_insn, (0x07UL<<8)|9, CPU_Any, NONE +jnc, jcc_insn, (0x03UL<<8)|9, CPU_Any, NONE +jne, jcc_insn, (0x05UL<<8)|9, CPU_Any, NONE +jng, jcc_insn, (0x0EUL<<8)|9, CPU_Any, NONE +jnge, jcc_insn, (0x0CUL<<8)|9, CPU_Any, NONE +jnl, jcc_insn, (0x0DUL<<8)|9, CPU_Any, NONE +jnle, jcc_insn, (0x0FUL<<8)|9, CPU_Any, NONE +jno, jcc_insn, (0x01UL<<8)|9, CPU_Any, NONE +jnp, jcc_insn, (0x0BUL<<8)|9, CPU_Any, NONE +jns, jcc_insn, (0x09UL<<8)|9, CPU_Any, NONE +jnz, jcc_insn, (0x05UL<<8)|9, CPU_Any, NONE +jo, jcc_insn, (0x00UL<<8)|9, CPU_Any, NONE +jp, jcc_insn, (0x0AUL<<8)|9, CPU_Any, NONE +jpe, jcc_insn, (0x0AUL<<8)|9, CPU_Any, NONE +jpo, jcc_insn, (0x0BUL<<8)|9, CPU_Any, NONE +jrcxz, jcxz_insn, (0x40UL<<8)|2, CPU_64, NONE +js, jcc_insn, (0x08UL<<8)|9, CPU_Any, NONE +jz, jcc_insn, (0x04UL<<8)|9, CPU_Any, NONE +lahf, onebyte_insn, (0x00009FUL<<8)|1, CPU_Any, NONE +lar, bsfr_insn, (0x02UL<<8)|3, CPU_286|CPU_Prot, NONE +larl, bsfr_insn, (0x02UL<<8)|3, CPU_286|CPU_Prot, SUF_L +larq, bsfr_insn, (0x02UL<<8)|3, CPU_286|CPU_Prot, SUF_Q +larw, bsfr_insn, (0x02UL<<8)|3, CPU_286|CPU_Prot, SUF_W +lddqu, lddqu_insn, (0UL<<8)|1, CPU_SSE3, NONE +ldmxcsr, ldstmxcsr_insn, (0x02UL<<8)|1, CPU_SSE, NONE +lds, ldes_insn, (0xC5UL<<8)|2, CPU_Not64, NONE +ldsl, ldes_insn, (0xC5UL<<8)|2, CPU_386|CPU_Not64, SUF_L +ldsw, ldes_insn, (0xC5UL<<8)|2, CPU_Not64, SUF_W +lea, lea_insn, (0UL<<8)|3, CPU_Any, NONE +leal, lea_insn, (0UL<<8)|3, CPU_386, SUF_L +leaq, lea_insn, (0UL<<8)|3, CPU_64, SUF_Q +leaw, lea_insn, (0UL<<8)|3, CPU_Any, SUF_W +leave, onebyte_insn, (0x4000C9UL<<8)|1, CPU_186, NONE +leavel, onebyte_insn, (0x4000C9UL<<8)|1, CPU_186, NONE +leaveq, onebyte_insn, (0x4000C9UL<<8)|1, CPU_64, NONE +leavew, onebyte_insn, (0x0010C9UL<<8)|1, CPU_186, NONE +les, ldes_insn, (0xC4UL<<8)|2, CPU_Not64, NONE +lesl, ldes_insn, (0xC4UL<<8)|2, CPU_386|CPU_Not64, SUF_L +lesw, ldes_insn, (0xC4UL<<8)|2, CPU_Not64, SUF_W +lfence, threebyte_insn, (0x0FAEE8UL<<8)|1, CPU_P3, NONE +lfs, lfgss_insn, (0xB4UL<<8)|2, CPU_386, NONE +lfsl, lfgss_insn, (0xB4UL<<8)|2, CPU_386, SUF_L +lfsw, lfgss_insn, (0xB4UL<<8)|2, CPU_386, SUF_W +lgdt, twobytemem_insn, (0x020F01UL<<8)|1, CPU_286|CPU_Priv, NONE +lgdtl, twobytemem_insn, (0x020F01UL<<8)|1, CPU_286|CPU_Priv, SUF_L +lgdtq, twobytemem_insn, (0x020F01UL<<8)|1, CPU_286|CPU_Priv, SUF_Q +lgdtw, twobytemem_insn, (0x020F01UL<<8)|1, CPU_286|CPU_Priv, SUF_W +lgs, lfgss_insn, (0xB5UL<<8)|2, CPU_386, NONE +lgsl, lfgss_insn, (0xB5UL<<8)|2, CPU_386, SUF_L +lgsw, lfgss_insn, (0xB5UL<<8)|2, CPU_386, SUF_W +lidt, twobytemem_insn, (0x030F01UL<<8)|1, CPU_286|CPU_Priv, NONE +lidtl, twobytemem_insn, (0x030F01UL<<8)|1, CPU_286|CPU_Priv, SUF_L +lidtq, twobytemem_insn, (0x030F01UL<<8)|1, CPU_286|CPU_Priv, SUF_Q +lidtw, twobytemem_insn, (0x030F01UL<<8)|1, CPU_286|CPU_Priv, SUF_W +lldt, prot286_insn, (0x0200UL<<8)|1, CPU_286|CPU_Priv|CPU_Prot, NONE +lldtw, prot286_insn, (0x0200UL<<8)|1, CPU_286|CPU_Priv|CPU_Prot, SUF_W +lmsw, prot286_insn, (0x0601UL<<8)|1, CPU_286|CPU_Priv, NONE +lmsww, prot286_insn, (0x0601UL<<8)|1, CPU_286|CPU_Priv, SUF_W +loadall, twobyte_insn, (0x0F07UL<<8)|1, CPU_386|CPU_Undoc, NONE +loadall286, twobyte_insn, (0x0F05UL<<8)|1, CPU_286|CPU_Undoc, NONE lock, NULL, X86_LOCKREP, 0xF0, NONE -lodsb, onebyte_insn, (0x0000ACUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -lodsl, onebyte_insn, (0x0020ADUL<<8)|NELEMS(onebyte_insn), CPU_386, NONE -lodsq, onebyte_insn, (0x0040ADUL<<8)|NELEMS(onebyte_insn), CPU_64, NONE -lodsw, onebyte_insn, (0x0010ADUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -loop, loop_insn, (0x02UL<<8)|NELEMS(loop_insn), CPU_Any, NONE -loope, loop_insn, (0x01UL<<8)|NELEMS(loop_insn), CPU_Any, NONE -loopne, loop_insn, (0x00UL<<8)|NELEMS(loop_insn), CPU_Any, NONE -loopnz, loop_insn, (0x00UL<<8)|NELEMS(loop_insn), CPU_Any, NONE -loopz, loop_insn, (0x01UL<<8)|NELEMS(loop_insn), CPU_Any, NONE -lretl, retnf_insn, (0x00CAUL<<8)|NELEMS(retnf_insn), CPU_Any, NONE -lretq, retnf_insn, (0x40CAUL<<8)|NELEMS(retnf_insn), CPU_64, NONE -lretw, retnf_insn, (0x10CAUL<<8)|NELEMS(retnf_insn), CPU_Any, NONE -lsl, bsfr_insn, (0x03UL<<8)|NELEMS(bsfr_insn), CPU_286|CPU_Prot, NONE -lsll, bsfr_insn, (0x03UL<<8)|NELEMS(bsfr_insn), CPU_286|CPU_Prot, SUF_L -lslq, bsfr_insn, (0x03UL<<8)|NELEMS(bsfr_insn), CPU_286|CPU_Prot, SUF_Q -lslw, bsfr_insn, (0x03UL<<8)|NELEMS(bsfr_insn), CPU_286|CPU_Prot, SUF_W -lss, lfgss_insn, (0xB2UL<<8)|NELEMS(lfgss_insn), CPU_386, NONE -lssl, lfgss_insn, (0xB2UL<<8)|NELEMS(lfgss_insn), CPU_386, SUF_L -lssw, lfgss_insn, (0xB2UL<<8)|NELEMS(lfgss_insn), CPU_386, SUF_W -ltr, prot286_insn, (0x0300UL<<8)|NELEMS(prot286_insn), CPU_286|CPU_Priv|CPU_Prot, NONE -ltrw, prot286_insn, (0x0300UL<<8)|NELEMS(prot286_insn), CPU_286|CPU_Priv|CPU_Prot, SUF_W -lzcnt, cnt_insn, (0xBDUL<<8)|NELEMS(cnt_insn), CPU_686|CPU_AMD, NONE -lzcntl, cnt_insn, (0xBDUL<<8)|NELEMS(cnt_insn), CPU_686|CPU_AMD, SUF_L -lzcntq, cnt_insn, (0xBDUL<<8)|NELEMS(cnt_insn), CPU_686|CPU_AMD, SUF_Q -lzcntw, cnt_insn, (0xBDUL<<8)|NELEMS(cnt_insn), CPU_686|CPU_AMD, SUF_W -maskmovdqu, maskmovdqu_insn, (0UL<<8)|NELEMS(maskmovdqu_insn), CPU_SSE2, NONE -maskmovq, maskmovq_insn, (0UL<<8)|NELEMS(maskmovq_insn), CPU_MMX|CPU_P3, NONE -maxpd, ssess_insn, (0x665FUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -maxps, sseps_insn, (0x5FUL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE -maxsd, ssess_insn, (0xF25FUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -maxss, ssess_insn, (0xF35FUL<<8)|NELEMS(ssess_insn), CPU_SSE, NONE -mfence, threebyte_insn, (0x0FAEF0UL<<8)|NELEMS(threebyte_insn), CPU_P3, NONE -minpd, ssess_insn, (0x665DUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -minps, sseps_insn, (0x5DUL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE -minsd, ssess_insn, (0xF25DUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -minss, ssess_insn, (0xF35DUL<<8)|NELEMS(ssess_insn), CPU_SSE, NONE -monitor, threebyte_insn, (0x0F01C8UL<<8)|NELEMS(threebyte_insn), CPU_SSE3, NONE -montmul, padlock_insn, (0xC0F3A6UL<<8)|NELEMS(padlock_insn), CPU_PadLock, NONE -mov, mov_insn, (0UL<<8)|NELEMS(mov_insn), CPU_Any, NONE -movb, mov_insn, (0UL<<8)|NELEMS(mov_insn), CPU_Any, SUF_B -movl, mov_insn, (0UL<<8)|NELEMS(mov_insn), CPU_386, SUF_L -movq, mov_insn, (0UL<<8)|NELEMS(mov_insn), CPU_Any, SUF_Q -movw, mov_insn, (0UL<<8)|NELEMS(mov_insn), CPU_Any, SUF_W -movabs, movabs_insn, (0UL<<8)|NELEMS(movabs_insn), CPU_64, NONE -movabsb, movabs_insn, (0UL<<8)|NELEMS(movabs_insn), CPU_64, SUF_B -movabsl, movabs_insn, (0UL<<8)|NELEMS(movabs_insn), CPU_64, SUF_L -movabsq, movabs_insn, (0UL<<8)|NELEMS(movabs_insn), CPU_64, SUF_Q -movabsw, movabs_insn, (0UL<<8)|NELEMS(movabs_insn), CPU_64, SUF_W -movapd, movaupd_insn, (0x28UL<<8)|NELEMS(movaupd_insn), CPU_SSE2, NONE -movaps, movaups_insn, (0x28UL<<8)|NELEMS(movaups_insn), CPU_SSE, NONE -movd, movd_insn, (0UL<<8)|NELEMS(movd_insn), CPU_386|CPU_MMX, NONE -movddup, cvt_xmm_xmm64_ss_insn, (0xF212UL<<8)|NELEMS(cvt_xmm_xmm64_ss_insn), CPU_SSE3, NONE -movdq2q, movdq2q_insn, (0UL<<8)|NELEMS(movdq2q_insn), CPU_SSE2, NONE -movdqa, movdqau_insn, (0x66UL<<8)|NELEMS(movdqau_insn), CPU_SSE2, NONE -movdqu, movdqau_insn, (0xF3UL<<8)|NELEMS(movdqau_insn), CPU_SSE2, NONE -movhlps, movhllhps_insn, (0x12UL<<8)|NELEMS(movhllhps_insn), CPU_SSE, NONE -movhpd, movhlpd_insn, (0x16UL<<8)|NELEMS(movhlpd_insn), CPU_SSE2, NONE -movhps, movhlps_insn, (0x16UL<<8)|NELEMS(movhlps_insn), CPU_SSE, NONE -movlhps, movhllhps_insn, (0x16UL<<8)|NELEMS(movhllhps_insn), CPU_SSE, NONE -movlpd, movhlpd_insn, (0x12UL<<8)|NELEMS(movhlpd_insn), CPU_SSE2, NONE -movlps, movhlps_insn, (0x12UL<<8)|NELEMS(movhlps_insn), CPU_SSE, NONE -movmskpd, movmskpd_insn, (0UL<<8)|NELEMS(movmskpd_insn), CPU_386|CPU_SSE2, NONE -movmskpdl, movmskpd_insn, (0UL<<8)|NELEMS(movmskpd_insn), CPU_386|CPU_SSE2, SUF_L -movmskpdq, movmskpd_insn, (0UL<<8)|NELEMS(movmskpd_insn), CPU_64|CPU_SSE2, SUF_Q -movmskps, movmskps_insn, (0UL<<8)|NELEMS(movmskps_insn), CPU_386|CPU_SSE, NONE -movmskpsl, movmskps_insn, (0UL<<8)|NELEMS(movmskps_insn), CPU_386|CPU_SSE, SUF_L -movmskpsq, movmskps_insn, (0UL<<8)|NELEMS(movmskps_insn), CPU_64|CPU_SSE, SUF_Q -movntdq, movntpddq_insn, (0xE7UL<<8)|NELEMS(movntpddq_insn), CPU_SSE2, NONE -movntdqa, movntdqa_insn, (0UL<<8)|NELEMS(movntdqa_insn), CPU_SSE41, NONE -movnti, movnti_insn, (0UL<<8)|NELEMS(movnti_insn), CPU_P4, NONE -movntil, movnti_insn, (0UL<<8)|NELEMS(movnti_insn), CPU_P4, SUF_L -movntiq, movnti_insn, (0UL<<8)|NELEMS(movnti_insn), CPU_64|CPU_P4, SUF_Q -movntpd, movntpddq_insn, (0x2BUL<<8)|NELEMS(movntpddq_insn), CPU_SSE2, NONE -movntps, movntps_insn, (0UL<<8)|NELEMS(movntps_insn), CPU_SSE, NONE -movntq, movntq_insn, (0UL<<8)|NELEMS(movntq_insn), CPU_SSE, NONE -movntsd, movntsd_insn, (0UL<<8)|NELEMS(movntsd_insn), CPU_SSE41, NONE -movntss, movntss_insn, (0UL<<8)|NELEMS(movntss_insn), CPU_SSE41, NONE -movq2dq, movq2dq_insn, (0UL<<8)|NELEMS(movq2dq_insn), CPU_SSE2, NONE -movsb, onebyte_insn, (0x0000A4UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -movsbl, movszx_insn, (0xBEUL<<8)|NELEMS(movszx_insn), CPU_386, SUF_B -movsbq, movszx_insn, (0xBEUL<<8)|NELEMS(movszx_insn), CPU_64, SUF_B -movsbw, movszx_insn, (0xBEUL<<8)|NELEMS(movszx_insn), CPU_386, SUF_B -movsd, movsd_insn, (0UL<<8)|NELEMS(movsd_insn), CPU_386, NONE -movshdup, ssess_insn, (0xF316UL<<8)|NELEMS(ssess_insn), CPU_SSE3, NONE -movsl, onebyte_insn, (0x0020A5UL<<8)|NELEMS(onebyte_insn), CPU_386, NONE -movsldup, ssess_insn, (0xF312UL<<8)|NELEMS(ssess_insn), CPU_SSE3, NONE -movslq, movsxd_insn, (0UL<<8)|NELEMS(movsxd_insn), CPU_64, SUF_L -movsq, onebyte_insn, (0x0040A5UL<<8)|NELEMS(onebyte_insn), CPU_64, NONE -movss, movss_insn, (0UL<<8)|NELEMS(movss_insn), CPU_SSE, NONE -movsw, onebyte_insn, (0x0010A5UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -movswl, movszx_insn, (0xBEUL<<8)|NELEMS(movszx_insn), CPU_386, SUF_W -movswq, movszx_insn, (0xBEUL<<8)|NELEMS(movszx_insn), CPU_64, SUF_W -movsx, movszx_insn, (0xBEUL<<8)|NELEMS(movszx_insn), CPU_386, NONE -movsxb, movszx_insn, (0xBEUL<<8)|NELEMS(movszx_insn), CPU_386, SUF_B -movsxw, movszx_insn, (0xBEUL<<8)|NELEMS(movszx_insn), CPU_386, SUF_W -movupd, movaupd_insn, (0x10UL<<8)|NELEMS(movaupd_insn), CPU_SSE2, NONE -movups, movaups_insn, (0x10UL<<8)|NELEMS(movaups_insn), CPU_SSE, NONE -movzbl, movszx_insn, (0xB6UL<<8)|NELEMS(movszx_insn), CPU_386, SUF_B -movzbq, movszx_insn, (0xB6UL<<8)|NELEMS(movszx_insn), CPU_64, SUF_B -movzbw, movszx_insn, (0xB6UL<<8)|NELEMS(movszx_insn), CPU_386, SUF_B -movzwl, movszx_insn, (0xB6UL<<8)|NELEMS(movszx_insn), CPU_386, SUF_W -movzwq, movszx_insn, (0xB6UL<<8)|NELEMS(movszx_insn), CPU_64, SUF_W -movzx, movszx_insn, (0xB6UL<<8)|NELEMS(movszx_insn), CPU_386, NONE -movzxb, movszx_insn, (0xB6UL<<8)|NELEMS(movszx_insn), CPU_386, SUF_B -movzxw, movszx_insn, (0xB6UL<<8)|NELEMS(movszx_insn), CPU_386, SUF_W -mpsadbw, sse4imm_insn, (0x42UL<<8)|NELEMS(sse4imm_insn), CPU_SSE41, NONE -mul, f6_insn, (0x04UL<<8)|NELEMS(f6_insn), CPU_Any, NONE -mulb, f6_insn, (0x04UL<<8)|NELEMS(f6_insn), CPU_Any, SUF_B -mull, f6_insn, (0x04UL<<8)|NELEMS(f6_insn), CPU_386, SUF_L -mulq, f6_insn, (0x04UL<<8)|NELEMS(f6_insn), CPU_64, SUF_Q -mulw, f6_insn, (0x04UL<<8)|NELEMS(f6_insn), CPU_Any, SUF_W -mulpd, ssess_insn, (0x6659UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -mulps, sseps_insn, (0x59UL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE -mulsd, ssess_insn, (0xF259UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -mulss, ssess_insn, (0xF359UL<<8)|NELEMS(ssess_insn), CPU_SSE, NONE -mwait, threebyte_insn, (0x0F01C9UL<<8)|NELEMS(threebyte_insn), CPU_SSE3, NONE -neg, f6_insn, (0x03UL<<8)|NELEMS(f6_insn), CPU_Any, NONE -negb, f6_insn, (0x03UL<<8)|NELEMS(f6_insn), CPU_Any, SUF_B -negl, f6_insn, (0x03UL<<8)|NELEMS(f6_insn), CPU_386, SUF_L -negq, f6_insn, (0x03UL<<8)|NELEMS(f6_insn), CPU_64, SUF_Q -negw, f6_insn, (0x03UL<<8)|NELEMS(f6_insn), CPU_Any, SUF_W -nop, onebyte_insn, (0x000090UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -not, f6_insn, (0x02UL<<8)|NELEMS(f6_insn), CPU_Any, NONE -notb, f6_insn, (0x02UL<<8)|NELEMS(f6_insn), CPU_Any, SUF_B -notl, f6_insn, (0x02UL<<8)|NELEMS(f6_insn), CPU_386, SUF_L -notq, f6_insn, (0x02UL<<8)|NELEMS(f6_insn), CPU_64, SUF_Q -notw, f6_insn, (0x02UL<<8)|NELEMS(f6_insn), CPU_Any, SUF_W -or, arith_insn, (0x0108UL<<8)|NELEMS(arith_insn), CPU_Any, NONE -orb, arith_insn, (0x0108UL<<8)|NELEMS(arith_insn), CPU_Any, SUF_B -orl, arith_insn, (0x0108UL<<8)|NELEMS(arith_insn), CPU_386, SUF_L -orq, arith_insn, (0x0108UL<<8)|NELEMS(arith_insn), CPU_64, SUF_Q -orw, arith_insn, (0x0108UL<<8)|NELEMS(arith_insn), CPU_Any, SUF_W -orpd, ssess_insn, (0x6656UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -orps, sseps_insn, (0x56UL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE -out, out_insn, (0UL<<8)|NELEMS(out_insn), CPU_Any, NONE -outb, out_insn, (0UL<<8)|NELEMS(out_insn), CPU_Any, SUF_B -outl, out_insn, (0UL<<8)|NELEMS(out_insn), CPU_386, SUF_L -outw, out_insn, (0UL<<8)|NELEMS(out_insn), CPU_Any, SUF_W -outsb, onebyte_insn, (0x00006EUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -outsl, onebyte_insn, (0x00206FUL<<8)|NELEMS(onebyte_insn), CPU_386, NONE -outsw, onebyte_insn, (0x00106FUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -pabsb, ssse3_insn, (0x1CUL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE -pabsd, ssse3_insn, (0x1EUL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE -pabsw, ssse3_insn, (0x1DUL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE -packssdw, mmxsse2_insn, (0x6BUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -packsswb, mmxsse2_insn, (0x63UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -packusdw, sse4_insn, (0x2BUL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE -packuswb, mmxsse2_insn, (0x67UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -paddb, mmxsse2_insn, (0xFCUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -paddd, mmxsse2_insn, (0xFEUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -paddq, mmxsse2_insn, (0xD4UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -paddsb, mmxsse2_insn, (0xECUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -paddsiw, cyrixmmx_insn, (0x51UL<<8)|NELEMS(cyrixmmx_insn), CPU_Cyrix|CPU_MMX, NONE -paddsw, mmxsse2_insn, (0xEDUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -paddusb, mmxsse2_insn, (0xDCUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -paddusw, mmxsse2_insn, (0xDDUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -paddw, mmxsse2_insn, (0xFDUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -palignr, ssse3imm_insn, (0x0FUL<<8)|NELEMS(ssse3imm_insn), CPU_SSSE3, NONE -pand, mmxsse2_insn, (0xDBUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -pandn, mmxsse2_insn, (0xDFUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -pause, onebyte_prefix_insn, (0xF390UL<<8)|NELEMS(onebyte_prefix_insn), CPU_P4, NONE -paveb, cyrixmmx_insn, (0x50UL<<8)|NELEMS(cyrixmmx_insn), CPU_Cyrix|CPU_MMX, NONE -pavgb, mmxsse2_insn, (0xE0UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX|CPU_P3, NONE -pavgusb, now3d_insn, (0xBFUL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE -pavgw, mmxsse2_insn, (0xE3UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX|CPU_P3, NONE -pblendvb, sse4xmm0_insn, (0x10UL<<8)|NELEMS(sse4xmm0_insn), CPU_SSE41, NONE -pblendw, sse4imm_insn, (0x0EUL<<8)|NELEMS(sse4imm_insn), CPU_SSE41, NONE -pcmpeqb, mmxsse2_insn, (0x74UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -pcmpeqd, mmxsse2_insn, (0x76UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -pcmpeqq, sse4_insn, (0x29UL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE -pcmpeqw, mmxsse2_insn, (0x75UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -pcmpestri, sse4pcmpstr_insn, (0x61UL<<8)|NELEMS(sse4pcmpstr_insn), CPU_SSE42, NONE -pcmpestrm, sse4pcmpstr_insn, (0x60UL<<8)|NELEMS(sse4pcmpstr_insn), CPU_SSE42, NONE -pcmpgtb, mmxsse2_insn, (0x64UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -pcmpgtd, mmxsse2_insn, (0x66UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -pcmpgtq, sse4_insn, (0x37UL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE -pcmpgtw, mmxsse2_insn, (0x65UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -pcmpistri, sse4pcmpstr_insn, (0x63UL<<8)|NELEMS(sse4pcmpstr_insn), CPU_SSE42, NONE -pcmpistrm, sse4pcmpstr_insn, (0x62UL<<8)|NELEMS(sse4pcmpstr_insn), CPU_SSE42, NONE -pdistib, cyrixmmx_insn, (0x54UL<<8)|NELEMS(cyrixmmx_insn), CPU_Cyrix|CPU_MMX, NONE -pextrb, pextrb_insn, (0UL<<8)|NELEMS(pextrb_insn), CPU_SSE41, NONE -pextrd, pextrd_insn, (0UL<<8)|NELEMS(pextrd_insn), CPU_386|CPU_SSE41, NONE -pextrq, pextrq_insn, (0UL<<8)|NELEMS(pextrq_insn), CPU_64|CPU_SSE41, NONE -pextrw, pextrw_insn, (0UL<<8)|NELEMS(pextrw_insn), CPU_MMX|CPU_P3, NONE -pextrwl, pextrw_insn, (0UL<<8)|NELEMS(pextrw_insn), CPU_MMX|CPU_P3, SUF_L -pextrwq, pextrw_insn, (0UL<<8)|NELEMS(pextrw_insn), CPU_64|CPU_MMX|CPU_P3, SUF_Q -pf2id, now3d_insn, (0x1DUL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE -pf2iw, now3d_insn, (0x1CUL<<8)|NELEMS(now3d_insn), CPU_3DNow|CPU_Athlon, NONE -pfacc, now3d_insn, (0xAEUL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE -pfadd, now3d_insn, (0x9EUL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE -pfcmpeq, now3d_insn, (0xB0UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE -pfcmpge, now3d_insn, (0x90UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE -pfcmpgt, now3d_insn, (0xA0UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE -pfmax, now3d_insn, (0xA4UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE -pfmin, now3d_insn, (0x94UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE -pfmul, now3d_insn, (0xB4UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE -pfnacc, now3d_insn, (0x8AUL<<8)|NELEMS(now3d_insn), CPU_3DNow|CPU_Athlon, NONE -pfpnacc, now3d_insn, (0x8EUL<<8)|NELEMS(now3d_insn), CPU_3DNow|CPU_Athlon, NONE -pfrcp, now3d_insn, (0x96UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE -pfrcpit1, now3d_insn, (0xA6UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE -pfrcpit2, now3d_insn, (0xB6UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE -pfrsqit1, now3d_insn, (0xA7UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE -pfrsqrt, now3d_insn, (0x97UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE -pfsub, now3d_insn, (0x9AUL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE -pfsubr, now3d_insn, (0xAAUL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE -phaddd, ssse3_insn, (0x02UL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE -phaddsw, ssse3_insn, (0x03UL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE -phaddw, ssse3_insn, (0x01UL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE -phminposuw, sse4_insn, (0x41UL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE -phsubd, ssse3_insn, (0x06UL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE -phsubsw, ssse3_insn, (0x07UL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE -phsubw, ssse3_insn, (0x05UL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE -pi2fd, now3d_insn, (0x0DUL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE -pi2fw, now3d_insn, (0x0CUL<<8)|NELEMS(now3d_insn), CPU_3DNow|CPU_Athlon, NONE -pinsrb, pinsrb_insn, (0UL<<8)|NELEMS(pinsrb_insn), CPU_SSE41, NONE -pinsrd, pinsrd_insn, (0UL<<8)|NELEMS(pinsrd_insn), CPU_386|CPU_SSE41, NONE -pinsrq, pinsrq_insn, (0UL<<8)|NELEMS(pinsrq_insn), CPU_64|CPU_SSE41, NONE -pinsrw, pinsrw_insn, (0UL<<8)|NELEMS(pinsrw_insn), CPU_MMX|CPU_P3, NONE -pinsrwl, pinsrw_insn, (0UL<<8)|NELEMS(pinsrw_insn), CPU_MMX|CPU_P3, SUF_L -pinsrwq, pinsrw_insn, (0UL<<8)|NELEMS(pinsrw_insn), CPU_64|CPU_MMX|CPU_P3, SUF_Q -pmachriw, pmachriw_insn, (0UL<<8)|NELEMS(pmachriw_insn), CPU_Cyrix|CPU_MMX, NONE -pmaddubsw, ssse3_insn, (0x04UL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE -pmaddwd, mmxsse2_insn, (0xF5UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -pmagw, cyrixmmx_insn, (0x52UL<<8)|NELEMS(cyrixmmx_insn), CPU_Cyrix|CPU_MMX, NONE -pmaxsb, sse4_insn, (0x3CUL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE -pmaxsd, sse4_insn, (0x3DUL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE -pmaxsw, mmxsse2_insn, (0xEEUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX|CPU_P3, NONE -pmaxub, mmxsse2_insn, (0xDEUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX|CPU_P3, NONE -pmaxud, sse4_insn, (0x3FUL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE -pmaxuw, sse4_insn, (0x3EUL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE -pminsb, sse4_insn, (0x38UL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE -pminsd, sse4_insn, (0x39UL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE -pminsw, mmxsse2_insn, (0xEAUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX|CPU_P3, NONE -pminub, mmxsse2_insn, (0xDAUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX|CPU_P3, NONE -pminud, sse4_insn, (0x3BUL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE -pminuw, sse4_insn, (0x3AUL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE -pmovmskb, pmovmskb_insn, (0UL<<8)|NELEMS(pmovmskb_insn), CPU_MMX|CPU_P3, NONE -pmovmskbl, pmovmskb_insn, (0UL<<8)|NELEMS(pmovmskb_insn), CPU_MMX|CPU_P3, SUF_L -pmovmskbq, pmovmskb_insn, (0UL<<8)|NELEMS(pmovmskb_insn), CPU_64|CPU_MMX|CPU_P3, SUF_Q -pmovsxbd, sse4m32_insn, (0x21UL<<8)|NELEMS(sse4m32_insn), CPU_SSE41, NONE -pmovsxbq, sse4m16_insn, (0x22UL<<8)|NELEMS(sse4m16_insn), CPU_SSE41, NONE -pmovsxbw, sse4m64_insn, (0x20UL<<8)|NELEMS(sse4m64_insn), CPU_SSE41, NONE -pmovsxdq, sse4m64_insn, (0x25UL<<8)|NELEMS(sse4m64_insn), CPU_SSE41, NONE -pmovsxwd, sse4m64_insn, (0x23UL<<8)|NELEMS(sse4m64_insn), CPU_SSE41, NONE -pmovsxwq, sse4m32_insn, (0x24UL<<8)|NELEMS(sse4m32_insn), CPU_SSE41, NONE -pmovzxbd, sse4m32_insn, (0x31UL<<8)|NELEMS(sse4m32_insn), CPU_SSE41, NONE -pmovzxbq, sse4m16_insn, (0x32UL<<8)|NELEMS(sse4m16_insn), CPU_SSE41, NONE -pmovzxbw, sse4m64_insn, (0x30UL<<8)|NELEMS(sse4m64_insn), CPU_SSE41, NONE -pmovzxdq, sse4m64_insn, (0x35UL<<8)|NELEMS(sse4m64_insn), CPU_SSE41, NONE -pmovzxwd, sse4m64_insn, (0x33UL<<8)|NELEMS(sse4m64_insn), CPU_SSE41, NONE -pmovzxwq, sse4m32_insn, (0x34UL<<8)|NELEMS(sse4m32_insn), CPU_SSE41, NONE -pmuldq, sse4_insn, (0x28UL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE -pmulhriw, cyrixmmx_insn, (0x5DUL<<8)|NELEMS(cyrixmmx_insn), CPU_Cyrix|CPU_MMX, NONE -pmulhrsw, ssse3_insn, (0x0BUL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE -pmulhrwa, now3d_insn, (0xB7UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE -pmulhrwc, cyrixmmx_insn, (0x59UL<<8)|NELEMS(cyrixmmx_insn), CPU_Cyrix|CPU_MMX, NONE -pmulhuw, mmxsse2_insn, (0xE4UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX|CPU_P3, NONE -pmulhw, mmxsse2_insn, (0xE5UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -pmulld, sse4_insn, (0x40UL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE -pmullw, mmxsse2_insn, (0xD5UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -pmuludq, mmxsse2_insn, (0xF4UL<<8)|NELEMS(mmxsse2_insn), CPU_SSE2, NONE -pmvgezb, cyrixmmx_insn, (0x5CUL<<8)|NELEMS(cyrixmmx_insn), CPU_Cyrix|CPU_MMX, NONE -pmvlzb, cyrixmmx_insn, (0x5BUL<<8)|NELEMS(cyrixmmx_insn), CPU_Cyrix|CPU_MMX, NONE -pmvnzb, cyrixmmx_insn, (0x5AUL<<8)|NELEMS(cyrixmmx_insn), CPU_Cyrix|CPU_MMX, NONE -pmvzb, cyrixmmx_insn, (0x58UL<<8)|NELEMS(cyrixmmx_insn), CPU_Cyrix|CPU_MMX, NONE -pop, pop_insn, (0UL<<8)|NELEMS(pop_insn), CPU_Any, NONE -popl, pop_insn, (0UL<<8)|NELEMS(pop_insn), CPU_386|CPU_Not64, SUF_L -popq, pop_insn, (0UL<<8)|NELEMS(pop_insn), CPU_64, SUF_Q -popw, pop_insn, (0UL<<8)|NELEMS(pop_insn), CPU_Any, SUF_W -popa, onebyte_insn, (0x000061UL<<8)|NELEMS(onebyte_insn), CPU_186|CPU_Not64, NONE -popal, onebyte_insn, (0x002061UL<<8)|NELEMS(onebyte_insn), CPU_386|CPU_Not64, NONE -popaw, onebyte_insn, (0x001061UL<<8)|NELEMS(onebyte_insn), CPU_186|CPU_Not64, NONE -popcnt, cnt_insn, (0xB8UL<<8)|NELEMS(cnt_insn), CPU_SSE42, NONE -popcntl, cnt_insn, (0xB8UL<<8)|NELEMS(cnt_insn), CPU_SSE42, SUF_L -popcntq, cnt_insn, (0xB8UL<<8)|NELEMS(cnt_insn), CPU_SSE42, SUF_Q -popcntw, cnt_insn, (0xB8UL<<8)|NELEMS(cnt_insn), CPU_SSE42, SUF_W -popf, onebyte_insn, (0x40009DUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -popfl, onebyte_insn, (0x00209DUL<<8)|NELEMS(onebyte_insn), CPU_386|CPU_Not64, NONE -popfq, onebyte_insn, (0x40409DUL<<8)|NELEMS(onebyte_insn), CPU_64, NONE -popfw, onebyte_insn, (0x40109DUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -por, mmxsse2_insn, (0xEBUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -prefetch, twobytemem_insn, (0x000F0DUL<<8)|NELEMS(twobytemem_insn), CPU_3DNow, NONE -prefetchnta, twobytemem_insn, (0x000F18UL<<8)|NELEMS(twobytemem_insn), CPU_P3, NONE -prefetcht0, twobytemem_insn, (0x010F18UL<<8)|NELEMS(twobytemem_insn), CPU_P3, NONE -prefetcht1, twobytemem_insn, (0x020F18UL<<8)|NELEMS(twobytemem_insn), CPU_P3, NONE -prefetcht2, twobytemem_insn, (0x030F18UL<<8)|NELEMS(twobytemem_insn), CPU_P3, NONE -prefetchw, twobytemem_insn, (0x010F0DUL<<8)|NELEMS(twobytemem_insn), CPU_3DNow, NONE -psadbw, mmxsse2_insn, (0xF6UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX|CPU_P3, NONE -pshufb, ssse3_insn, (0x00UL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE -pshufd, ssessimm_insn, (0x6670UL<<8)|NELEMS(ssessimm_insn), CPU_SSE2, NONE -pshufhw, ssessimm_insn, (0xF370UL<<8)|NELEMS(ssessimm_insn), CPU_SSE2, NONE -pshuflw, ssessimm_insn, (0xF270UL<<8)|NELEMS(ssessimm_insn), CPU_SSE2, NONE -pshufw, pshufw_insn, (0UL<<8)|NELEMS(pshufw_insn), CPU_MMX|CPU_P3, NONE -psignb, ssse3_insn, (0x08UL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE -psignd, ssse3_insn, (0x0AUL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE -psignw, ssse3_insn, (0x09UL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE -pslld, pshift_insn, (0x0672F2UL<<8)|NELEMS(pshift_insn), CPU_MMX, NONE -pslldq, pslrldq_insn, (0x07UL<<8)|NELEMS(pslrldq_insn), CPU_SSE2, NONE -psllq, pshift_insn, (0x0673F3UL<<8)|NELEMS(pshift_insn), CPU_MMX, NONE -psllw, pshift_insn, (0x0671F1UL<<8)|NELEMS(pshift_insn), CPU_MMX, NONE -psrad, pshift_insn, (0x0472E2UL<<8)|NELEMS(pshift_insn), CPU_MMX, NONE -psraw, pshift_insn, (0x0471E1UL<<8)|NELEMS(pshift_insn), CPU_MMX, NONE -psrld, pshift_insn, (0x0272D2UL<<8)|NELEMS(pshift_insn), CPU_MMX, NONE -psrldq, pslrldq_insn, (0x03UL<<8)|NELEMS(pslrldq_insn), CPU_SSE2, NONE -psrlq, pshift_insn, (0x0273D3UL<<8)|NELEMS(pshift_insn), CPU_MMX, NONE -psrlw, pshift_insn, (0x0271D1UL<<8)|NELEMS(pshift_insn), CPU_MMX, NONE -psubb, mmxsse2_insn, (0xF8UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -psubd, mmxsse2_insn, (0xFAUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -psubq, mmxsse2_insn, (0xFBUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -psubsb, mmxsse2_insn, (0xE8UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -psubsiw, cyrixmmx_insn, (0x55UL<<8)|NELEMS(cyrixmmx_insn), CPU_Cyrix|CPU_MMX, NONE -psubsw, mmxsse2_insn, (0xE9UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -psubusb, mmxsse2_insn, (0xD8UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -psubusw, mmxsse2_insn, (0xD9UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -psubw, mmxsse2_insn, (0xF9UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -pswapd, now3d_insn, (0xBBUL<<8)|NELEMS(now3d_insn), CPU_3DNow|CPU_Athlon, NONE -ptest, sse4_insn, (0x17UL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE -punpckhbw, mmxsse2_insn, (0x68UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -punpckhdq, mmxsse2_insn, (0x6AUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -punpckhqdq, ssess_insn, (0x666DUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -punpckhwd, mmxsse2_insn, (0x69UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -punpcklbw, mmxsse2_insn, (0x60UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -punpckldq, mmxsse2_insn, (0x62UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -punpcklqdq, ssess_insn, (0x666CUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -punpcklwd, mmxsse2_insn, (0x61UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -push, push_insn, (0UL<<8)|NELEMS(push_insn), CPU_Any, NONE -pushl, push_insn, (0UL<<8)|NELEMS(push_insn), CPU_386, SUF_L -pushq, push_insn, (0UL<<8)|NELEMS(push_insn), CPU_64, SUF_Q -pushw, push_insn, (0UL<<8)|NELEMS(push_insn), CPU_Any, SUF_W -pusha, onebyte_insn, (0x000060UL<<8)|NELEMS(onebyte_insn), CPU_186|CPU_Not64, NONE -pushal, onebyte_insn, (0x002060UL<<8)|NELEMS(onebyte_insn), CPU_386|CPU_Not64, NONE -pushaw, onebyte_insn, (0x001060UL<<8)|NELEMS(onebyte_insn), CPU_186|CPU_Not64, NONE -pushf, onebyte_insn, (0x40009CUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -pushfl, onebyte_insn, (0x00209CUL<<8)|NELEMS(onebyte_insn), CPU_386|CPU_Not64, NONE -pushfq, onebyte_insn, (0x40409CUL<<8)|NELEMS(onebyte_insn), CPU_64, NONE -pushfw, onebyte_insn, (0x40109CUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -pxor, mmxsse2_insn, (0xEFUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE +lodsb, onebyte_insn, (0x0000ACUL<<8)|1, CPU_Any, NONE +lodsl, onebyte_insn, (0x0020ADUL<<8)|1, CPU_386, NONE +lodsq, onebyte_insn, (0x0040ADUL<<8)|1, CPU_64, NONE +lodsw, onebyte_insn, (0x0010ADUL<<8)|1, CPU_Any, NONE +loop, loop_insn, (0x02UL<<8)|8, CPU_Any, NONE +loope, loop_insn, (0x01UL<<8)|8, CPU_Any, NONE +loopne, loop_insn, (0x00UL<<8)|8, CPU_Any, NONE +loopnz, loop_insn, (0x00UL<<8)|8, CPU_Any, NONE +loopz, loop_insn, (0x01UL<<8)|8, CPU_Any, NONE +lretl, retnf_insn, (0x00CAUL<<8)|6, CPU_Any, NONE +lretq, retnf_insn, (0x40CAUL<<8)|6, CPU_64, NONE +lretw, retnf_insn, (0x10CAUL<<8)|6, CPU_Any, NONE +lsl, bsfr_insn, (0x03UL<<8)|3, CPU_286|CPU_Prot, NONE +lsll, bsfr_insn, (0x03UL<<8)|3, CPU_286|CPU_Prot, SUF_L +lslq, bsfr_insn, (0x03UL<<8)|3, CPU_286|CPU_Prot, SUF_Q +lslw, bsfr_insn, (0x03UL<<8)|3, CPU_286|CPU_Prot, SUF_W +lss, lfgss_insn, (0xB2UL<<8)|2, CPU_386, NONE +lssl, lfgss_insn, (0xB2UL<<8)|2, CPU_386, SUF_L +lssw, lfgss_insn, (0xB2UL<<8)|2, CPU_386, SUF_W +ltr, prot286_insn, (0x0300UL<<8)|1, CPU_286|CPU_Priv|CPU_Prot, NONE +ltrw, prot286_insn, (0x0300UL<<8)|1, CPU_286|CPU_Priv|CPU_Prot, SUF_W +lzcnt, cnt_insn, (0xBDUL<<8)|3, CPU_686|CPU_AMD, NONE +lzcntl, cnt_insn, (0xBDUL<<8)|3, CPU_686|CPU_AMD, SUF_L +lzcntq, cnt_insn, (0xBDUL<<8)|3, CPU_686|CPU_AMD, SUF_Q +lzcntw, cnt_insn, (0xBDUL<<8)|3, CPU_686|CPU_AMD, SUF_W +maskmovdqu, maskmovdqu_insn, (0UL<<8)|1, CPU_SSE2, NONE +maskmovq, maskmovq_insn, (0UL<<8)|1, CPU_MMX|CPU_P3, NONE +maxpd, ssess_insn, (0x665FUL<<8)|1, CPU_SSE2, NONE +maxps, sseps_insn, (0x5FUL<<8)|1, CPU_SSE, NONE +maxsd, ssess_insn, (0xF25FUL<<8)|1, CPU_SSE2, NONE +maxss, ssess_insn, (0xF35FUL<<8)|1, CPU_SSE, NONE +mfence, threebyte_insn, (0x0FAEF0UL<<8)|1, CPU_P3, NONE +minpd, ssess_insn, (0x665DUL<<8)|1, CPU_SSE2, NONE +minps, sseps_insn, (0x5DUL<<8)|1, CPU_SSE, NONE +minsd, ssess_insn, (0xF25DUL<<8)|1, CPU_SSE2, NONE +minss, ssess_insn, (0xF35DUL<<8)|1, CPU_SSE, NONE +monitor, threebyte_insn, (0x0F01C8UL<<8)|1, CPU_SSE3, NONE +montmul, padlock_insn, (0xC0F3A6UL<<8)|1, CPU_PadLock, NONE +mov, mov_insn, (0UL<<8)|69, CPU_Any, NONE +movb, mov_insn, (0UL<<8)|69, CPU_Any, SUF_B +movl, mov_insn, (0UL<<8)|69, CPU_386, SUF_L +movq, mov_insn, (0UL<<8)|69, CPU_Any, SUF_Q +movw, mov_insn, (0UL<<8)|69, CPU_Any, SUF_W +movabs, movabs_insn, (0UL<<8)|9, CPU_64, NONE +movabsb, movabs_insn, (0UL<<8)|9, CPU_64, SUF_B +movabsl, movabs_insn, (0UL<<8)|9, CPU_64, SUF_L +movabsq, movabs_insn, (0UL<<8)|9, CPU_64, SUF_Q +movabsw, movabs_insn, (0UL<<8)|9, CPU_64, SUF_W +movapd, movaupd_insn, (0x28UL<<8)|2, CPU_SSE2, NONE +movaps, movaups_insn, (0x28UL<<8)|2, CPU_SSE, NONE +movd, movd_insn, (0UL<<8)|8, CPU_386|CPU_MMX, NONE +movddup, cvt_xmm_xmm64_ss_insn, (0xF212UL<<8)|2, CPU_SSE3, NONE +movdq2q, movdq2q_insn, (0UL<<8)|1, CPU_SSE2, NONE +movdqa, movdqau_insn, (0x66UL<<8)|2, CPU_SSE2, NONE +movdqu, movdqau_insn, (0xF3UL<<8)|2, CPU_SSE2, NONE +movhlps, movhllhps_insn, (0x12UL<<8)|1, CPU_SSE, NONE +movhpd, movhlpd_insn, (0x16UL<<8)|2, CPU_SSE2, NONE +movhps, movhlps_insn, (0x16UL<<8)|2, CPU_SSE, NONE +movlhps, movhllhps_insn, (0x16UL<<8)|1, CPU_SSE, NONE +movlpd, movhlpd_insn, (0x12UL<<8)|2, CPU_SSE2, NONE +movlps, movhlps_insn, (0x12UL<<8)|2, CPU_SSE, NONE +movmskpd, movmskpd_insn, (0UL<<8)|2, CPU_386|CPU_SSE2, NONE +movmskpdl, movmskpd_insn, (0UL<<8)|2, CPU_386|CPU_SSE2, SUF_L +movmskpdq, movmskpd_insn, (0UL<<8)|2, CPU_64|CPU_SSE2, SUF_Q +movmskps, movmskps_insn, (0UL<<8)|2, CPU_386|CPU_SSE, NONE +movmskpsl, movmskps_insn, (0UL<<8)|2, CPU_386|CPU_SSE, SUF_L +movmskpsq, movmskps_insn, (0UL<<8)|2, CPU_64|CPU_SSE, SUF_Q +movntdq, movntpddq_insn, (0xE7UL<<8)|1, CPU_SSE2, NONE +movntdqa, movntdqa_insn, (0UL<<8)|1, CPU_SSE41, NONE +movnti, movnti_insn, (0UL<<8)|2, CPU_P4, NONE +movntil, movnti_insn, (0UL<<8)|2, CPU_P4, SUF_L +movntiq, movnti_insn, (0UL<<8)|2, CPU_64|CPU_P4, SUF_Q +movntpd, movntpddq_insn, (0x2BUL<<8)|1, CPU_SSE2, NONE +movntps, movntps_insn, (0UL<<8)|1, CPU_SSE, NONE +movntq, movntq_insn, (0UL<<8)|1, CPU_SSE, NONE +movntsd, movntsd_insn, (0UL<<8)|1, CPU_SSE41, NONE +movntss, movntss_insn, (0UL<<8)|1, CPU_SSE41, NONE +movq2dq, movq2dq_insn, (0UL<<8)|1, CPU_SSE2, NONE +movsb, onebyte_insn, (0x0000A4UL<<8)|1, CPU_Any, NONE +movsbl, movszx_insn, (0xBEUL<<8)|5, CPU_386, SUF_B +movsbq, movszx_insn, (0xBEUL<<8)|5, CPU_64, SUF_B +movsbw, movszx_insn, (0xBEUL<<8)|5, CPU_386, SUF_B +movsd, movsd_insn, (0UL<<8)|4, CPU_386, NONE +movshdup, ssess_insn, (0xF316UL<<8)|1, CPU_SSE3, NONE +movsl, onebyte_insn, (0x0020A5UL<<8)|1, CPU_386, NONE +movsldup, ssess_insn, (0xF312UL<<8)|1, CPU_SSE3, NONE +movslq, movsxd_insn, (0UL<<8)|1, CPU_64, SUF_L +movsq, onebyte_insn, (0x0040A5UL<<8)|1, CPU_64, NONE +movss, movss_insn, (0UL<<8)|3, CPU_SSE, NONE +movsw, onebyte_insn, (0x0010A5UL<<8)|1, CPU_Any, NONE +movswl, movszx_insn, (0xBEUL<<8)|5, CPU_386, SUF_W +movswq, movszx_insn, (0xBEUL<<8)|5, CPU_64, SUF_W +movsx, movszx_insn, (0xBEUL<<8)|5, CPU_386, NONE +movsxb, movszx_insn, (0xBEUL<<8)|5, CPU_386, SUF_B +movsxw, movszx_insn, (0xBEUL<<8)|5, CPU_386, SUF_W +movupd, movaupd_insn, (0x10UL<<8)|2, CPU_SSE2, NONE +movups, movaups_insn, (0x10UL<<8)|2, CPU_SSE, NONE +movzbl, movszx_insn, (0xB6UL<<8)|5, CPU_386, SUF_B +movzbq, movszx_insn, (0xB6UL<<8)|5, CPU_64, SUF_B +movzbw, movszx_insn, (0xB6UL<<8)|5, CPU_386, SUF_B +movzwl, movszx_insn, (0xB6UL<<8)|5, CPU_386, SUF_W +movzwq, movszx_insn, (0xB6UL<<8)|5, CPU_64, SUF_W +movzx, movszx_insn, (0xB6UL<<8)|5, CPU_386, NONE +movzxb, movszx_insn, (0xB6UL<<8)|5, CPU_386, SUF_B +movzxw, movszx_insn, (0xB6UL<<8)|5, CPU_386, SUF_W +mpsadbw, sse4imm_insn, (0x42UL<<8)|1, CPU_SSE41, NONE +mul, f6_insn, (0x04UL<<8)|4, CPU_Any, NONE +mulb, f6_insn, (0x04UL<<8)|4, CPU_Any, SUF_B +mull, f6_insn, (0x04UL<<8)|4, CPU_386, SUF_L +mulq, f6_insn, (0x04UL<<8)|4, CPU_64, SUF_Q +mulw, f6_insn, (0x04UL<<8)|4, CPU_Any, SUF_W +mulpd, ssess_insn, (0x6659UL<<8)|1, CPU_SSE2, NONE +mulps, sseps_insn, (0x59UL<<8)|1, CPU_SSE, NONE +mulsd, ssess_insn, (0xF259UL<<8)|1, CPU_SSE2, NONE +mulss, ssess_insn, (0xF359UL<<8)|1, CPU_SSE, NONE +mwait, threebyte_insn, (0x0F01C9UL<<8)|1, CPU_SSE3, NONE +neg, f6_insn, (0x03UL<<8)|4, CPU_Any, NONE +negb, f6_insn, (0x03UL<<8)|4, CPU_Any, SUF_B +negl, f6_insn, (0x03UL<<8)|4, CPU_386, SUF_L +negq, f6_insn, (0x03UL<<8)|4, CPU_64, SUF_Q +negw, f6_insn, (0x03UL<<8)|4, CPU_Any, SUF_W +nop, onebyte_insn, (0x000090UL<<8)|1, CPU_Any, NONE +not, f6_insn, (0x02UL<<8)|4, CPU_Any, NONE +notb, f6_insn, (0x02UL<<8)|4, CPU_Any, SUF_B +notl, f6_insn, (0x02UL<<8)|4, CPU_386, SUF_L +notq, f6_insn, (0x02UL<<8)|4, CPU_64, SUF_Q +notw, f6_insn, (0x02UL<<8)|4, CPU_Any, SUF_W +or, arith_insn, (0x0108UL<<8)|22, CPU_Any, NONE +orb, arith_insn, (0x0108UL<<8)|22, CPU_Any, SUF_B +orl, arith_insn, (0x0108UL<<8)|22, CPU_386, SUF_L +orq, arith_insn, (0x0108UL<<8)|22, CPU_64, SUF_Q +orw, arith_insn, (0x0108UL<<8)|22, CPU_Any, SUF_W +orpd, ssess_insn, (0x6656UL<<8)|1, CPU_SSE2, NONE +orps, sseps_insn, (0x56UL<<8)|1, CPU_SSE, NONE +out, out_insn, (0UL<<8)|12, CPU_Any, NONE +outb, out_insn, (0UL<<8)|12, CPU_Any, SUF_B +outl, out_insn, (0UL<<8)|12, CPU_386, SUF_L +outw, out_insn, (0UL<<8)|12, CPU_Any, SUF_W +outsb, onebyte_insn, (0x00006EUL<<8)|1, CPU_Any, NONE +outsl, onebyte_insn, (0x00206FUL<<8)|1, CPU_386, NONE +outsw, onebyte_insn, (0x00106FUL<<8)|1, CPU_Any, NONE +pabsb, ssse3_insn, (0x1CUL<<8)|2, CPU_SSSE3, NONE +pabsd, ssse3_insn, (0x1EUL<<8)|2, CPU_SSSE3, NONE +pabsw, ssse3_insn, (0x1DUL<<8)|2, CPU_SSSE3, NONE +packssdw, mmxsse2_insn, (0x6BUL<<8)|2, CPU_MMX, NONE +packsswb, mmxsse2_insn, (0x63UL<<8)|2, CPU_MMX, NONE +packusdw, sse4_insn, (0x2BUL<<8)|1, CPU_SSE41, NONE +packuswb, mmxsse2_insn, (0x67UL<<8)|2, CPU_MMX, NONE +paddb, mmxsse2_insn, (0xFCUL<<8)|2, CPU_MMX, NONE +paddd, mmxsse2_insn, (0xFEUL<<8)|2, CPU_MMX, NONE +paddq, mmxsse2_insn, (0xD4UL<<8)|2, CPU_MMX, NONE +paddsb, mmxsse2_insn, (0xECUL<<8)|2, CPU_MMX, NONE +paddsiw, cyrixmmx_insn, (0x51UL<<8)|1, CPU_Cyrix|CPU_MMX, NONE +paddsw, mmxsse2_insn, (0xEDUL<<8)|2, CPU_MMX, NONE +paddusb, mmxsse2_insn, (0xDCUL<<8)|2, CPU_MMX, NONE +paddusw, mmxsse2_insn, (0xDDUL<<8)|2, CPU_MMX, NONE +paddw, mmxsse2_insn, (0xFDUL<<8)|2, CPU_MMX, NONE +palignr, ssse3imm_insn, (0x0FUL<<8)|2, CPU_SSSE3, NONE +pand, mmxsse2_insn, (0xDBUL<<8)|2, CPU_MMX, NONE +pandn, mmxsse2_insn, (0xDFUL<<8)|2, CPU_MMX, NONE +pause, onebyte_prefix_insn, (0xF390UL<<8)|1, CPU_P4, NONE +paveb, cyrixmmx_insn, (0x50UL<<8)|1, CPU_Cyrix|CPU_MMX, NONE +pavgb, mmxsse2_insn, (0xE0UL<<8)|2, CPU_MMX|CPU_P3, NONE +pavgusb, now3d_insn, (0xBFUL<<8)|1, CPU_3DNow, NONE +pavgw, mmxsse2_insn, (0xE3UL<<8)|2, CPU_MMX|CPU_P3, NONE +pblendvb, sse4xmm0_insn, (0x10UL<<8)|2, CPU_SSE41, NONE +pblendw, sse4imm_insn, (0x0EUL<<8)|1, CPU_SSE41, NONE +pcmpeqb, mmxsse2_insn, (0x74UL<<8)|2, CPU_MMX, NONE +pcmpeqd, mmxsse2_insn, (0x76UL<<8)|2, CPU_MMX, NONE +pcmpeqq, sse4_insn, (0x29UL<<8)|1, CPU_SSE41, NONE +pcmpeqw, mmxsse2_insn, (0x75UL<<8)|2, CPU_MMX, NONE +pcmpestri, sse4pcmpstr_insn, (0x61UL<<8)|1, CPU_SSE42, NONE +pcmpestrm, sse4pcmpstr_insn, (0x60UL<<8)|1, CPU_SSE42, NONE +pcmpgtb, mmxsse2_insn, (0x64UL<<8)|2, CPU_MMX, NONE +pcmpgtd, mmxsse2_insn, (0x66UL<<8)|2, CPU_MMX, NONE +pcmpgtq, sse4_insn, (0x37UL<<8)|1, CPU_SSE41, NONE +pcmpgtw, mmxsse2_insn, (0x65UL<<8)|2, CPU_MMX, NONE +pcmpistri, sse4pcmpstr_insn, (0x63UL<<8)|1, CPU_SSE42, NONE +pcmpistrm, sse4pcmpstr_insn, (0x62UL<<8)|1, CPU_SSE42, NONE +pdistib, cyrixmmx_insn, (0x54UL<<8)|1, CPU_Cyrix|CPU_MMX, NONE +pextrb, pextrb_insn, (0UL<<8)|3, CPU_SSE41, NONE +pextrd, pextrd_insn, (0UL<<8)|1, CPU_386|CPU_SSE41, NONE +pextrq, pextrq_insn, (0UL<<8)|1, CPU_64|CPU_SSE41, NONE +pextrw, pextrw_insn, (0UL<<8)|7, CPU_MMX|CPU_P3, NONE +pextrwl, pextrw_insn, (0UL<<8)|7, CPU_MMX|CPU_P3, SUF_L +pextrwq, pextrw_insn, (0UL<<8)|7, CPU_64|CPU_MMX|CPU_P3, SUF_Q +pf2id, now3d_insn, (0x1DUL<<8)|1, CPU_3DNow, NONE +pf2iw, now3d_insn, (0x1CUL<<8)|1, CPU_3DNow|CPU_Athlon, NONE +pfacc, now3d_insn, (0xAEUL<<8)|1, CPU_3DNow, NONE +pfadd, now3d_insn, (0x9EUL<<8)|1, CPU_3DNow, NONE +pfcmpeq, now3d_insn, (0xB0UL<<8)|1, CPU_3DNow, NONE +pfcmpge, now3d_insn, (0x90UL<<8)|1, CPU_3DNow, NONE +pfcmpgt, now3d_insn, (0xA0UL<<8)|1, CPU_3DNow, NONE +pfmax, now3d_insn, (0xA4UL<<8)|1, CPU_3DNow, NONE +pfmin, now3d_insn, (0x94UL<<8)|1, CPU_3DNow, NONE +pfmul, now3d_insn, (0xB4UL<<8)|1, CPU_3DNow, NONE +pfnacc, now3d_insn, (0x8AUL<<8)|1, CPU_3DNow|CPU_Athlon, NONE +pfpnacc, now3d_insn, (0x8EUL<<8)|1, CPU_3DNow|CPU_Athlon, NONE +pfrcp, now3d_insn, (0x96UL<<8)|1, CPU_3DNow, NONE +pfrcpit1, now3d_insn, (0xA6UL<<8)|1, CPU_3DNow, NONE +pfrcpit2, now3d_insn, (0xB6UL<<8)|1, CPU_3DNow, NONE +pfrsqit1, now3d_insn, (0xA7UL<<8)|1, CPU_3DNow, NONE +pfrsqrt, now3d_insn, (0x97UL<<8)|1, CPU_3DNow, NONE +pfsub, now3d_insn, (0x9AUL<<8)|1, CPU_3DNow, NONE +pfsubr, now3d_insn, (0xAAUL<<8)|1, CPU_3DNow, NONE +phaddd, ssse3_insn, (0x02UL<<8)|2, CPU_SSSE3, NONE +phaddsw, ssse3_insn, (0x03UL<<8)|2, CPU_SSSE3, NONE +phaddw, ssse3_insn, (0x01UL<<8)|2, CPU_SSSE3, NONE +phminposuw, sse4_insn, (0x41UL<<8)|1, CPU_SSE41, NONE +phsubd, ssse3_insn, (0x06UL<<8)|2, CPU_SSSE3, NONE +phsubsw, ssse3_insn, (0x07UL<<8)|2, CPU_SSSE3, NONE +phsubw, ssse3_insn, (0x05UL<<8)|2, CPU_SSSE3, NONE +pi2fd, now3d_insn, (0x0DUL<<8)|1, CPU_3DNow, NONE +pi2fw, now3d_insn, (0x0CUL<<8)|1, CPU_3DNow|CPU_Athlon, NONE +pinsrb, pinsrb_insn, (0UL<<8)|2, CPU_SSE41, NONE +pinsrd, pinsrd_insn, (0UL<<8)|1, CPU_386|CPU_SSE41, NONE +pinsrq, pinsrq_insn, (0UL<<8)|1, CPU_64|CPU_SSE41, NONE +pinsrw, pinsrw_insn, (0UL<<8)|6, CPU_MMX|CPU_P3, NONE +pinsrwl, pinsrw_insn, (0UL<<8)|6, CPU_MMX|CPU_P3, SUF_L +pinsrwq, pinsrw_insn, (0UL<<8)|6, CPU_64|CPU_MMX|CPU_P3, SUF_Q +pmachriw, pmachriw_insn, (0UL<<8)|1, CPU_Cyrix|CPU_MMX, NONE +pmaddubsw, ssse3_insn, (0x04UL<<8)|2, CPU_SSSE3, NONE +pmaddwd, mmxsse2_insn, (0xF5UL<<8)|2, CPU_MMX, NONE +pmagw, cyrixmmx_insn, (0x52UL<<8)|1, CPU_Cyrix|CPU_MMX, NONE +pmaxsb, sse4_insn, (0x3CUL<<8)|1, CPU_SSE41, NONE +pmaxsd, sse4_insn, (0x3DUL<<8)|1, CPU_SSE41, NONE +pmaxsw, mmxsse2_insn, (0xEEUL<<8)|2, CPU_MMX|CPU_P3, NONE +pmaxub, mmxsse2_insn, (0xDEUL<<8)|2, CPU_MMX|CPU_P3, NONE +pmaxud, sse4_insn, (0x3FUL<<8)|1, CPU_SSE41, NONE +pmaxuw, sse4_insn, (0x3EUL<<8)|1, CPU_SSE41, NONE +pminsb, sse4_insn, (0x38UL<<8)|1, CPU_SSE41, NONE +pminsd, sse4_insn, (0x39UL<<8)|1, CPU_SSE41, NONE +pminsw, mmxsse2_insn, (0xEAUL<<8)|2, CPU_MMX|CPU_P3, NONE +pminub, mmxsse2_insn, (0xDAUL<<8)|2, CPU_MMX|CPU_P3, NONE +pminud, sse4_insn, (0x3BUL<<8)|1, CPU_SSE41, NONE +pminuw, sse4_insn, (0x3AUL<<8)|1, CPU_SSE41, NONE +pmovmskb, pmovmskb_insn, (0UL<<8)|4, CPU_MMX|CPU_P3, NONE +pmovmskbl, pmovmskb_insn, (0UL<<8)|4, CPU_MMX|CPU_P3, SUF_L +pmovmskbq, pmovmskb_insn, (0UL<<8)|4, CPU_64|CPU_MMX|CPU_P3, SUF_Q +pmovsxbd, sse4m32_insn, (0x21UL<<8)|2, CPU_SSE41, NONE +pmovsxbq, sse4m16_insn, (0x22UL<<8)|2, CPU_SSE41, NONE +pmovsxbw, sse4m64_insn, (0x20UL<<8)|2, CPU_SSE41, NONE +pmovsxdq, sse4m64_insn, (0x25UL<<8)|2, CPU_SSE41, NONE +pmovsxwd, sse4m64_insn, (0x23UL<<8)|2, CPU_SSE41, NONE +pmovsxwq, sse4m32_insn, (0x24UL<<8)|2, CPU_SSE41, NONE +pmovzxbd, sse4m32_insn, (0x31UL<<8)|2, CPU_SSE41, NONE +pmovzxbq, sse4m16_insn, (0x32UL<<8)|2, CPU_SSE41, NONE +pmovzxbw, sse4m64_insn, (0x30UL<<8)|2, CPU_SSE41, NONE +pmovzxdq, sse4m64_insn, (0x35UL<<8)|2, CPU_SSE41, NONE +pmovzxwd, sse4m64_insn, (0x33UL<<8)|2, CPU_SSE41, NONE +pmovzxwq, sse4m32_insn, (0x34UL<<8)|2, CPU_SSE41, NONE +pmuldq, sse4_insn, (0x28UL<<8)|1, CPU_SSE41, NONE +pmulhriw, cyrixmmx_insn, (0x5DUL<<8)|1, CPU_Cyrix|CPU_MMX, NONE +pmulhrsw, ssse3_insn, (0x0BUL<<8)|2, CPU_SSSE3, NONE +pmulhrwa, now3d_insn, (0xB7UL<<8)|1, CPU_3DNow, NONE +pmulhrwc, cyrixmmx_insn, (0x59UL<<8)|1, CPU_Cyrix|CPU_MMX, NONE +pmulhuw, mmxsse2_insn, (0xE4UL<<8)|2, CPU_MMX|CPU_P3, NONE +pmulhw, mmxsse2_insn, (0xE5UL<<8)|2, CPU_MMX, NONE +pmulld, sse4_insn, (0x40UL<<8)|1, CPU_SSE41, NONE +pmullw, mmxsse2_insn, (0xD5UL<<8)|2, CPU_MMX, NONE +pmuludq, mmxsse2_insn, (0xF4UL<<8)|2, CPU_SSE2, NONE +pmvgezb, cyrixmmx_insn, (0x5CUL<<8)|1, CPU_Cyrix|CPU_MMX, NONE +pmvlzb, cyrixmmx_insn, (0x5BUL<<8)|1, CPU_Cyrix|CPU_MMX, NONE +pmvnzb, cyrixmmx_insn, (0x5AUL<<8)|1, CPU_Cyrix|CPU_MMX, NONE +pmvzb, cyrixmmx_insn, (0x58UL<<8)|1, CPU_Cyrix|CPU_MMX, NONE +pop, pop_insn, (0UL<<8)|21, CPU_Any, NONE +popl, pop_insn, (0UL<<8)|21, CPU_386|CPU_Not64, SUF_L +popq, pop_insn, (0UL<<8)|21, CPU_64, SUF_Q +popw, pop_insn, (0UL<<8)|21, CPU_Any, SUF_W +popa, onebyte_insn, (0x000061UL<<8)|1, CPU_186|CPU_Not64, NONE +popal, onebyte_insn, (0x002061UL<<8)|1, CPU_386|CPU_Not64, NONE +popaw, onebyte_insn, (0x001061UL<<8)|1, CPU_186|CPU_Not64, NONE +popcnt, cnt_insn, (0xB8UL<<8)|3, CPU_SSE42, NONE +popcntl, cnt_insn, (0xB8UL<<8)|3, CPU_SSE42, SUF_L +popcntq, cnt_insn, (0xB8UL<<8)|3, CPU_SSE42, SUF_Q +popcntw, cnt_insn, (0xB8UL<<8)|3, CPU_SSE42, SUF_W +popf, onebyte_insn, (0x40009DUL<<8)|1, CPU_Any, NONE +popfl, onebyte_insn, (0x00209DUL<<8)|1, CPU_386|CPU_Not64, NONE +popfq, onebyte_insn, (0x40409DUL<<8)|1, CPU_64, NONE +popfw, onebyte_insn, (0x40109DUL<<8)|1, CPU_Any, NONE +por, mmxsse2_insn, (0xEBUL<<8)|2, CPU_MMX, NONE +prefetch, twobytemem_insn, (0x000F0DUL<<8)|1, CPU_3DNow, NONE +prefetchnta, twobytemem_insn, (0x000F18UL<<8)|1, CPU_P3, NONE +prefetcht0, twobytemem_insn, (0x010F18UL<<8)|1, CPU_P3, NONE +prefetcht1, twobytemem_insn, (0x020F18UL<<8)|1, CPU_P3, NONE +prefetcht2, twobytemem_insn, (0x030F18UL<<8)|1, CPU_P3, NONE +prefetchw, twobytemem_insn, (0x010F0DUL<<8)|1, CPU_3DNow, NONE +psadbw, mmxsse2_insn, (0xF6UL<<8)|2, CPU_MMX|CPU_P3, NONE +pshufb, ssse3_insn, (0x00UL<<8)|2, CPU_SSSE3, NONE +pshufd, ssessimm_insn, (0x6670UL<<8)|1, CPU_SSE2, NONE +pshufhw, ssessimm_insn, (0xF370UL<<8)|1, CPU_SSE2, NONE +pshuflw, ssessimm_insn, (0xF270UL<<8)|1, CPU_SSE2, NONE +pshufw, pshufw_insn, (0UL<<8)|1, CPU_MMX|CPU_P3, NONE +psignb, ssse3_insn, (0x08UL<<8)|2, CPU_SSSE3, NONE +psignd, ssse3_insn, (0x0AUL<<8)|2, CPU_SSSE3, NONE +psignw, ssse3_insn, (0x09UL<<8)|2, CPU_SSSE3, NONE +pslld, pshift_insn, (0x0672F2UL<<8)|4, CPU_MMX, NONE +pslldq, pslrldq_insn, (0x07UL<<8)|1, CPU_SSE2, NONE +psllq, pshift_insn, (0x0673F3UL<<8)|4, CPU_MMX, NONE +psllw, pshift_insn, (0x0671F1UL<<8)|4, CPU_MMX, NONE +psrad, pshift_insn, (0x0472E2UL<<8)|4, CPU_MMX, NONE +psraw, pshift_insn, (0x0471E1UL<<8)|4, CPU_MMX, NONE +psrld, pshift_insn, (0x0272D2UL<<8)|4, CPU_MMX, NONE +psrldq, pslrldq_insn, (0x03UL<<8)|1, CPU_SSE2, NONE +psrlq, pshift_insn, (0x0273D3UL<<8)|4, CPU_MMX, NONE +psrlw, pshift_insn, (0x0271D1UL<<8)|4, CPU_MMX, NONE +psubb, mmxsse2_insn, (0xF8UL<<8)|2, CPU_MMX, NONE +psubd, mmxsse2_insn, (0xFAUL<<8)|2, CPU_MMX, NONE +psubq, mmxsse2_insn, (0xFBUL<<8)|2, CPU_MMX, NONE +psubsb, mmxsse2_insn, (0xE8UL<<8)|2, CPU_MMX, NONE +psubsiw, cyrixmmx_insn, (0x55UL<<8)|1, CPU_Cyrix|CPU_MMX, NONE +psubsw, mmxsse2_insn, (0xE9UL<<8)|2, CPU_MMX, NONE +psubusb, mmxsse2_insn, (0xD8UL<<8)|2, CPU_MMX, NONE +psubusw, mmxsse2_insn, (0xD9UL<<8)|2, CPU_MMX, NONE +psubw, mmxsse2_insn, (0xF9UL<<8)|2, CPU_MMX, NONE +pswapd, now3d_insn, (0xBBUL<<8)|1, CPU_3DNow|CPU_Athlon, NONE +ptest, sse4_insn, (0x17UL<<8)|1, CPU_SSE41, NONE +punpckhbw, mmxsse2_insn, (0x68UL<<8)|2, CPU_MMX, NONE +punpckhdq, mmxsse2_insn, (0x6AUL<<8)|2, CPU_MMX, NONE +punpckhqdq, ssess_insn, (0x666DUL<<8)|1, CPU_SSE2, NONE +punpckhwd, mmxsse2_insn, (0x69UL<<8)|2, CPU_MMX, NONE +punpcklbw, mmxsse2_insn, (0x60UL<<8)|2, CPU_MMX, NONE +punpckldq, mmxsse2_insn, (0x62UL<<8)|2, CPU_MMX, NONE +punpcklqdq, ssess_insn, (0x666CUL<<8)|1, CPU_SSE2, NONE +punpcklwd, mmxsse2_insn, (0x61UL<<8)|2, CPU_MMX, NONE +push, push_insn, (0UL<<8)|33, CPU_Any, NONE +pushl, push_insn, (0UL<<8)|33, CPU_386, SUF_L +pushq, push_insn, (0UL<<8)|33, CPU_64, SUF_Q +pushw, push_insn, (0UL<<8)|33, CPU_Any, SUF_W +pusha, onebyte_insn, (0x000060UL<<8)|1, CPU_186|CPU_Not64, NONE +pushal, onebyte_insn, (0x002060UL<<8)|1, CPU_386|CPU_Not64, NONE +pushaw, onebyte_insn, (0x001060UL<<8)|1, CPU_186|CPU_Not64, NONE +pushf, onebyte_insn, (0x40009CUL<<8)|1, CPU_Any, NONE +pushfl, onebyte_insn, (0x00209CUL<<8)|1, CPU_386|CPU_Not64, NONE +pushfq, onebyte_insn, (0x40409CUL<<8)|1, CPU_64, NONE +pushfw, onebyte_insn, (0x40109CUL<<8)|1, CPU_Any, NONE +pxor, mmxsse2_insn, (0xEFUL<<8)|2, CPU_MMX, NONE qword, NULL, X86_OPERSIZE, 0x40, NONE -rcl, shift_insn, (0x02UL<<8)|NELEMS(shift_insn), CPU_Any, NONE -rclb, shift_insn, (0x02UL<<8)|NELEMS(shift_insn), CPU_Any, SUF_B -rcll, shift_insn, (0x02UL<<8)|NELEMS(shift_insn), CPU_386, SUF_L -rclq, shift_insn, (0x02UL<<8)|NELEMS(shift_insn), CPU_64, SUF_Q -rclw, shift_insn, (0x02UL<<8)|NELEMS(shift_insn), CPU_Any, SUF_W -rcpps, sseps_insn, (0x53UL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE -rcpss, ssess_insn, (0xF353UL<<8)|NELEMS(ssess_insn), CPU_SSE, NONE -rcr, shift_insn, (0x03UL<<8)|NELEMS(shift_insn), CPU_Any, NONE -rcrb, shift_insn, (0x03UL<<8)|NELEMS(shift_insn), CPU_Any, SUF_B -rcrl, shift_insn, (0x03UL<<8)|NELEMS(shift_insn), CPU_386, SUF_L -rcrq, shift_insn, (0x03UL<<8)|NELEMS(shift_insn), CPU_64, SUF_Q -rcrw, shift_insn, (0x03UL<<8)|NELEMS(shift_insn), CPU_Any, SUF_W -rdmsr, twobyte_insn, (0x0F32UL<<8)|NELEMS(twobyte_insn), CPU_586|CPU_Priv, NONE -rdpmc, twobyte_insn, (0x0F33UL<<8)|NELEMS(twobyte_insn), CPU_686, NONE -rdshr, rdwrshr_insn, (0x00UL<<8)|NELEMS(rdwrshr_insn), CPU_686|CPU_Cyrix|CPU_SMM, NONE -rdtsc, twobyte_insn, (0x0F31UL<<8)|NELEMS(twobyte_insn), CPU_586, NONE -rdtscp, threebyte_insn, (0x0F01F9UL<<8)|NELEMS(threebyte_insn), CPU_686|CPU_AMD|CPU_Priv, NONE +rcl, shift_insn, (0x02UL<<8)|16, CPU_Any, NONE +rclb, shift_insn, (0x02UL<<8)|16, CPU_Any, SUF_B +rcll, shift_insn, (0x02UL<<8)|16, CPU_386, SUF_L +rclq, shift_insn, (0x02UL<<8)|16, CPU_64, SUF_Q +rclw, shift_insn, (0x02UL<<8)|16, CPU_Any, SUF_W +rcpps, sseps_insn, (0x53UL<<8)|1, CPU_SSE, NONE +rcpss, ssess_insn, (0xF353UL<<8)|1, CPU_SSE, NONE +rcr, shift_insn, (0x03UL<<8)|16, CPU_Any, NONE +rcrb, shift_insn, (0x03UL<<8)|16, CPU_Any, SUF_B +rcrl, shift_insn, (0x03UL<<8)|16, CPU_386, SUF_L +rcrq, shift_insn, (0x03UL<<8)|16, CPU_64, SUF_Q +rcrw, shift_insn, (0x03UL<<8)|16, CPU_Any, SUF_W +rdmsr, twobyte_insn, (0x0F32UL<<8)|1, CPU_586|CPU_Priv, NONE +rdpmc, twobyte_insn, (0x0F33UL<<8)|1, CPU_686, NONE +rdshr, rdwrshr_insn, (0x00UL<<8)|1, CPU_686|CPU_Cyrix|CPU_SMM, NONE +rdtsc, twobyte_insn, (0x0F31UL<<8)|1, CPU_586, NONE +rdtscp, threebyte_insn, (0x0F01F9UL<<8)|1, CPU_686|CPU_AMD|CPU_Priv, NONE rep, NULL, X86_LOCKREP, 0xF3, NONE repe, NULL, X86_LOCKREP, 0xF3, NONE repne, NULL, X86_LOCKREP, 0xF2, NONE repnz, NULL, X86_LOCKREP, 0xF2, NONE repz, NULL, X86_LOCKREP, 0xF3, NONE -ret, retnf_insn, (0x00C2UL<<8)|NELEMS(retnf_insn), CPU_Any, NONE -retl, retnf_insn, (0x00C2UL<<8)|NELEMS(retnf_insn), CPU_Not64, NONE -retq, retnf_insn, (0x00C2UL<<8)|NELEMS(retnf_insn), CPU_64, NONE -retw, retnf_insn, (0x10C2UL<<8)|NELEMS(retnf_insn), CPU_Any, NONE +ret, retnf_insn, (0x00C2UL<<8)|6, CPU_Any, NONE +retl, retnf_insn, (0x00C2UL<<8)|6, CPU_Not64, NONE +retq, retnf_insn, (0x00C2UL<<8)|6, CPU_64, NONE +retw, retnf_insn, (0x10C2UL<<8)|6, CPU_Any, NONE rex, NULL, X86_REX, 0x40, NONE rex64, NULL, X86_REX, 0x48, NONE rex64x, NULL, X86_REX, 0x4C, NONE @@ -1015,258 +1015,258 @@ rexxz, NULL, X86_REX, 0x45, NONE rexy, NULL, X86_REX, 0x42, NONE rexyz, NULL, X86_REX, 0x43, NONE rexz, NULL, X86_REX, 0x41, NONE -rol, shift_insn, (0x00UL<<8)|NELEMS(shift_insn), CPU_Any, NONE -rolb, shift_insn, (0x00UL<<8)|NELEMS(shift_insn), CPU_Any, SUF_B -roll, shift_insn, (0x00UL<<8)|NELEMS(shift_insn), CPU_386, SUF_L -rolq, shift_insn, (0x00UL<<8)|NELEMS(shift_insn), CPU_64, SUF_Q -rolw, shift_insn, (0x00UL<<8)|NELEMS(shift_insn), CPU_Any, SUF_W -ror, shift_insn, (0x01UL<<8)|NELEMS(shift_insn), CPU_Any, NONE -rorb, shift_insn, (0x01UL<<8)|NELEMS(shift_insn), CPU_Any, SUF_B -rorl, shift_insn, (0x01UL<<8)|NELEMS(shift_insn), CPU_386, SUF_L -rorq, shift_insn, (0x01UL<<8)|NELEMS(shift_insn), CPU_64, SUF_Q -rorw, shift_insn, (0x01UL<<8)|NELEMS(shift_insn), CPU_Any, SUF_W -roundpd, sse4imm_insn, (0x09UL<<8)|NELEMS(sse4imm_insn), CPU_SSE41, NONE -roundps, sse4imm_insn, (0x08UL<<8)|NELEMS(sse4imm_insn), CPU_SSE41, NONE -roundsd, sse4imm_insn, (0x0BUL<<8)|NELEMS(sse4imm_insn), CPU_SSE41, NONE -roundss, sse4imm_insn, (0x0AUL<<8)|NELEMS(sse4imm_insn), CPU_SSE41, NONE -rsdc, rsdc_insn, (0UL<<8)|NELEMS(rsdc_insn), CPU_486|CPU_Cyrix|CPU_SMM, NONE -rsldt, cyrixsmm_insn, (0x7BUL<<8)|NELEMS(cyrixsmm_insn), CPU_486|CPU_Cyrix|CPU_SMM, NONE -rsm, twobyte_insn, (0x0FAAUL<<8)|NELEMS(twobyte_insn), CPU_586|CPU_SMM, NONE -rsqrtps, sseps_insn, (0x52UL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE -rsqrtss, ssess_insn, (0xF352UL<<8)|NELEMS(ssess_insn), CPU_SSE, NONE -rsts, cyrixsmm_insn, (0x7DUL<<8)|NELEMS(cyrixsmm_insn), CPU_486|CPU_Cyrix|CPU_SMM, NONE -sahf, onebyte_insn, (0x00009EUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -sal, shift_insn, (0x04UL<<8)|NELEMS(shift_insn), CPU_Any, NONE -salb, shift_insn, (0x04UL<<8)|NELEMS(shift_insn), CPU_Any, SUF_B -sall, shift_insn, (0x04UL<<8)|NELEMS(shift_insn), CPU_386, SUF_L -salq, shift_insn, (0x04UL<<8)|NELEMS(shift_insn), CPU_64, SUF_Q -salw, shift_insn, (0x04UL<<8)|NELEMS(shift_insn), CPU_Any, SUF_W -salc, onebyte_insn, (0x0000D6UL<<8)|NELEMS(onebyte_insn), CPU_Not64|CPU_Undoc, NONE -sar, shift_insn, (0x07UL<<8)|NELEMS(shift_insn), CPU_Any, NONE -sarb, shift_insn, (0x07UL<<8)|NELEMS(shift_insn), CPU_Any, SUF_B -sarl, shift_insn, (0x07UL<<8)|NELEMS(shift_insn), CPU_386, SUF_L -sarq, shift_insn, (0x07UL<<8)|NELEMS(shift_insn), CPU_64, SUF_Q -sarw, shift_insn, (0x07UL<<8)|NELEMS(shift_insn), CPU_Any, SUF_W -sbb, arith_insn, (0x0318UL<<8)|NELEMS(arith_insn), CPU_Any, NONE -sbbb, arith_insn, (0x0318UL<<8)|NELEMS(arith_insn), CPU_Any, SUF_B -sbbl, arith_insn, (0x0318UL<<8)|NELEMS(arith_insn), CPU_386, SUF_L -sbbq, arith_insn, (0x0318UL<<8)|NELEMS(arith_insn), CPU_64, SUF_Q -sbbw, arith_insn, (0x0318UL<<8)|NELEMS(arith_insn), CPU_Any, SUF_W -scasb, onebyte_insn, (0x0000AEUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -scasl, onebyte_insn, (0x0020AFUL<<8)|NELEMS(onebyte_insn), CPU_386, NONE -scasq, onebyte_insn, (0x0040AFUL<<8)|NELEMS(onebyte_insn), CPU_64, NONE -scasw, onebyte_insn, (0x0010AFUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -seta, setcc_insn, (0x07UL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setab, setcc_insn, (0x07UL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B -setae, setcc_insn, (0x03UL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setaeb, setcc_insn, (0x03UL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B -setb, setcc_insn, (0x02UL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setbb, setcc_insn, (0x02UL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B -setbe, setcc_insn, (0x06UL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setbeb, setcc_insn, (0x06UL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B -setc, setcc_insn, (0x02UL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setcb, setcc_insn, (0x02UL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B -sete, setcc_insn, (0x04UL<<8)|NELEMS(setcc_insn), CPU_386, NONE -seteb, setcc_insn, (0x04UL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B -setg, setcc_insn, (0x0FUL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setgb, setcc_insn, (0x0FUL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B -setge, setcc_insn, (0x0DUL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setgeb, setcc_insn, (0x0DUL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B -setl, setcc_insn, (0x0CUL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setlb, setcc_insn, (0x0CUL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B -setle, setcc_insn, (0x0EUL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setleb, setcc_insn, (0x0EUL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B -setna, setcc_insn, (0x06UL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setnab, setcc_insn, (0x06UL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B -setnae, setcc_insn, (0x02UL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setnaeb, setcc_insn, (0x02UL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B -setnb, setcc_insn, (0x03UL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setnbb, setcc_insn, (0x03UL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B -setnbe, setcc_insn, (0x07UL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setnbeb, setcc_insn, (0x07UL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B -setnc, setcc_insn, (0x03UL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setncb, setcc_insn, (0x03UL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B -setne, setcc_insn, (0x05UL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setneb, setcc_insn, (0x05UL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B -setng, setcc_insn, (0x0EUL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setngb, setcc_insn, (0x0EUL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B -setnge, setcc_insn, (0x0CUL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setngeb, setcc_insn, (0x0CUL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B -setnl, setcc_insn, (0x0DUL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setnlb, setcc_insn, (0x0DUL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B -setnle, setcc_insn, (0x0FUL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setnleb, setcc_insn, (0x0FUL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B -setno, setcc_insn, (0x01UL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setnob, setcc_insn, (0x01UL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B -setnp, setcc_insn, (0x0BUL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setnpb, setcc_insn, (0x0BUL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B -setns, setcc_insn, (0x09UL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setnsb, setcc_insn, (0x09UL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B -setnz, setcc_insn, (0x05UL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setnzb, setcc_insn, (0x05UL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B -seto, setcc_insn, (0x00UL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setob, setcc_insn, (0x00UL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B -setp, setcc_insn, (0x0AUL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setpb, setcc_insn, (0x0AUL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B -setpe, setcc_insn, (0x0AUL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setpeb, setcc_insn, (0x0AUL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B -setpo, setcc_insn, (0x0BUL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setpob, setcc_insn, (0x0BUL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B -sets, setcc_insn, (0x08UL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setsb, setcc_insn, (0x08UL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B -setz, setcc_insn, (0x04UL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setzb, setcc_insn, (0x04UL<<8)|NELEMS(setcc_insn), CPU_386, SUF_B -sfence, threebyte_insn, (0x0FAEF8UL<<8)|NELEMS(threebyte_insn), CPU_P3, NONE -sgdt, twobytemem_insn, (0x000F01UL<<8)|NELEMS(twobytemem_insn), CPU_286|CPU_Priv, NONE -sgdtl, twobytemem_insn, (0x000F01UL<<8)|NELEMS(twobytemem_insn), CPU_286|CPU_Priv, SUF_L -sgdtq, twobytemem_insn, (0x000F01UL<<8)|NELEMS(twobytemem_insn), CPU_286|CPU_Priv, SUF_Q -sgdtw, twobytemem_insn, (0x000F01UL<<8)|NELEMS(twobytemem_insn), CPU_286|CPU_Priv, SUF_W -shl, shift_insn, (0x04UL<<8)|NELEMS(shift_insn), CPU_Any, NONE -shlb, shift_insn, (0x04UL<<8)|NELEMS(shift_insn), CPU_Any, SUF_B -shll, shift_insn, (0x04UL<<8)|NELEMS(shift_insn), CPU_386, SUF_L -shlq, shift_insn, (0x04UL<<8)|NELEMS(shift_insn), CPU_64, SUF_Q -shlw, shift_insn, (0x04UL<<8)|NELEMS(shift_insn), CPU_Any, SUF_W -shld, shlrd_insn, (0xA4UL<<8)|NELEMS(shlrd_insn), CPU_386, NONE -shldl, shlrd_insn, (0xA4UL<<8)|NELEMS(shlrd_insn), CPU_386, SUF_L -shldq, shlrd_insn, (0xA4UL<<8)|NELEMS(shlrd_insn), CPU_386|CPU_64, SUF_Q -shldw, shlrd_insn, (0xA4UL<<8)|NELEMS(shlrd_insn), CPU_386, SUF_W -shr, shift_insn, (0x05UL<<8)|NELEMS(shift_insn), CPU_Any, NONE -shrb, shift_insn, (0x05UL<<8)|NELEMS(shift_insn), CPU_Any, SUF_B -shrl, shift_insn, (0x05UL<<8)|NELEMS(shift_insn), CPU_386, SUF_L -shrq, shift_insn, (0x05UL<<8)|NELEMS(shift_insn), CPU_64, SUF_Q -shrw, shift_insn, (0x05UL<<8)|NELEMS(shift_insn), CPU_Any, SUF_W -shrd, shlrd_insn, (0xACUL<<8)|NELEMS(shlrd_insn), CPU_386, NONE -shrdl, shlrd_insn, (0xACUL<<8)|NELEMS(shlrd_insn), CPU_386, SUF_L -shrdq, shlrd_insn, (0xACUL<<8)|NELEMS(shlrd_insn), CPU_386|CPU_64, SUF_Q -shrdw, shlrd_insn, (0xACUL<<8)|NELEMS(shlrd_insn), CPU_386, SUF_W -shufpd, ssessimm_insn, (0x66C6UL<<8)|NELEMS(ssessimm_insn), CPU_SSE2, NONE -shufps, ssepsimm_insn, (0xC6UL<<8)|NELEMS(ssepsimm_insn), CPU_SSE, NONE -sidt, twobytemem_insn, (0x010F01UL<<8)|NELEMS(twobytemem_insn), CPU_286|CPU_Priv, NONE -sidtl, twobytemem_insn, (0x010F01UL<<8)|NELEMS(twobytemem_insn), CPU_286|CPU_Priv, SUF_L -sidtq, twobytemem_insn, (0x010F01UL<<8)|NELEMS(twobytemem_insn), CPU_286|CPU_Priv, SUF_Q -sidtw, twobytemem_insn, (0x010F01UL<<8)|NELEMS(twobytemem_insn), CPU_286|CPU_Priv, SUF_W -skinit, skinit_insn, (0UL<<8)|NELEMS(skinit_insn), CPU_SVM, NONE -sldt, sldtmsw_insn, (0x0000UL<<8)|NELEMS(sldtmsw_insn), CPU_286, NONE -sldtl, sldtmsw_insn, (0x0000UL<<8)|NELEMS(sldtmsw_insn), CPU_386, SUF_L -sldtq, sldtmsw_insn, (0x0000UL<<8)|NELEMS(sldtmsw_insn), CPU_286|CPU_64, SUF_Q -sldtw, sldtmsw_insn, (0x0000UL<<8)|NELEMS(sldtmsw_insn), CPU_286, SUF_W -smi, onebyte_insn, (0x0000F1UL<<8)|NELEMS(onebyte_insn), CPU_386|CPU_Undoc, NONE -smint, twobyte_insn, (0x0F38UL<<8)|NELEMS(twobyte_insn), CPU_686|CPU_Cyrix, NONE -smintold, twobyte_insn, (0x0F7EUL<<8)|NELEMS(twobyte_insn), CPU_486|CPU_Cyrix|CPU_Obs, NONE -smovb, onebyte_insn, (0x0000A4UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -smovl, onebyte_insn, (0x0020A5UL<<8)|NELEMS(onebyte_insn), CPU_386, NONE -smovq, onebyte_insn, (0x0040A5UL<<8)|NELEMS(onebyte_insn), CPU_64, NONE -smovw, onebyte_insn, (0x0010A5UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -smsw, sldtmsw_insn, (0x0401UL<<8)|NELEMS(sldtmsw_insn), CPU_286, NONE -smswl, sldtmsw_insn, (0x0401UL<<8)|NELEMS(sldtmsw_insn), CPU_386, SUF_L -smswq, sldtmsw_insn, (0x0401UL<<8)|NELEMS(sldtmsw_insn), CPU_286|CPU_64, SUF_Q -smsww, sldtmsw_insn, (0x0401UL<<8)|NELEMS(sldtmsw_insn), CPU_286, SUF_W -sqrtpd, ssess_insn, (0x6651UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -sqrtps, sseps_insn, (0x51UL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE -sqrtsd, ssess_insn, (0xF251UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -sqrtss, ssess_insn, (0xF351UL<<8)|NELEMS(ssess_insn), CPU_SSE, NONE -sscab, onebyte_insn, (0x0000AEUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -sscal, onebyte_insn, (0x0020AFUL<<8)|NELEMS(onebyte_insn), CPU_386, NONE -sscaq, onebyte_insn, (0x0040AFUL<<8)|NELEMS(onebyte_insn), CPU_64, NONE -sscaw, onebyte_insn, (0x0010AFUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -stc, onebyte_insn, (0x0000F9UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -std, onebyte_insn, (0x0000FDUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -stgi, threebyte_insn, (0x0F01DCUL<<8)|NELEMS(threebyte_insn), CPU_SVM, NONE -sti, onebyte_insn, (0x0000FBUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -stmxcsr, ldstmxcsr_insn, (0x03UL<<8)|NELEMS(ldstmxcsr_insn), CPU_SSE, NONE -stosb, onebyte_insn, (0x0000AAUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -stosl, onebyte_insn, (0x0020ABUL<<8)|NELEMS(onebyte_insn), CPU_386, NONE -stosq, onebyte_insn, (0x0040ABUL<<8)|NELEMS(onebyte_insn), CPU_64, NONE -stosw, onebyte_insn, (0x0010ABUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -str, str_insn, (0UL<<8)|NELEMS(str_insn), CPU_286|CPU_Prot, NONE -strl, str_insn, (0UL<<8)|NELEMS(str_insn), CPU_386|CPU_Prot, SUF_L -strq, str_insn, (0UL<<8)|NELEMS(str_insn), CPU_286|CPU_64|CPU_Prot, SUF_Q -strw, str_insn, (0UL<<8)|NELEMS(str_insn), CPU_286|CPU_Prot, SUF_W -sub, arith_insn, (0x0528UL<<8)|NELEMS(arith_insn), CPU_Any, NONE -subb, arith_insn, (0x0528UL<<8)|NELEMS(arith_insn), CPU_Any, SUF_B -subl, arith_insn, (0x0528UL<<8)|NELEMS(arith_insn), CPU_386, SUF_L -subq, arith_insn, (0x0528UL<<8)|NELEMS(arith_insn), CPU_64, SUF_Q -subw, arith_insn, (0x0528UL<<8)|NELEMS(arith_insn), CPU_Any, SUF_W -subpd, ssess_insn, (0x665CUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -subps, sseps_insn, (0x5CUL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE -subsd, ssess_insn, (0xF25CUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -subss, ssess_insn, (0xF35CUL<<8)|NELEMS(ssess_insn), CPU_SSE, NONE -svdc, svdc_insn, (0UL<<8)|NELEMS(svdc_insn), CPU_486|CPU_Cyrix|CPU_SMM, NONE -svldt, cyrixsmm_insn, (0x7AUL<<8)|NELEMS(cyrixsmm_insn), CPU_486|CPU_Cyrix|CPU_SMM, NONE -svts, cyrixsmm_insn, (0x7CUL<<8)|NELEMS(cyrixsmm_insn), CPU_486|CPU_Cyrix|CPU_SMM, NONE -swapgs, threebyte_insn, (0x0F01F8UL<<8)|NELEMS(threebyte_insn), CPU_64, NONE -syscall, twobyte_insn, (0x0F05UL<<8)|NELEMS(twobyte_insn), CPU_686|CPU_AMD, NONE -sysenter, twobyte_insn, (0x0F34UL<<8)|NELEMS(twobyte_insn), CPU_686|CPU_Not64, NONE -sysexit, twobyte_insn, (0x0F35UL<<8)|NELEMS(twobyte_insn), CPU_686|CPU_Not64|CPU_Priv, NONE -sysret, twobyte_insn, (0x0F07UL<<8)|NELEMS(twobyte_insn), CPU_686|CPU_AMD|CPU_Priv, NONE -sysretl, twobyte_insn, (0x0F07UL<<8)|NELEMS(twobyte_insn), CPU_686|CPU_AMD|CPU_Priv, SUF_L -sysretq, twobyte_insn, (0x0F07UL<<8)|NELEMS(twobyte_insn), CPU_686|CPU_AMD|CPU_Priv, SUF_Q -test, test_insn, (0UL<<8)|NELEMS(test_insn), CPU_Any, NONE -testb, test_insn, (0UL<<8)|NELEMS(test_insn), CPU_Any, SUF_B -testl, test_insn, (0UL<<8)|NELEMS(test_insn), CPU_386, SUF_L -testq, test_insn, (0UL<<8)|NELEMS(test_insn), CPU_64, SUF_Q -testw, test_insn, (0UL<<8)|NELEMS(test_insn), CPU_Any, SUF_W -ucomisd, ssess_insn, (0x662EUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -ucomiss, ssess_insn, (0x002EUL<<8)|NELEMS(ssess_insn), CPU_SSE, NONE -ud1, twobyte_insn, (0x0FB9UL<<8)|NELEMS(twobyte_insn), CPU_286|CPU_Undoc, NONE -ud2, twobyte_insn, (0x0F0BUL<<8)|NELEMS(twobyte_insn), CPU_286, NONE -umov, umov_insn, (0UL<<8)|NELEMS(umov_insn), CPU_386|CPU_Undoc, NONE -unpckhpd, ssess_insn, (0x6615UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -unpckhps, sseps_insn, (0x15UL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE -unpcklpd, ssess_insn, (0x6614UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -unpcklps, sseps_insn, (0x14UL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE -verr, prot286_insn, (0x0400UL<<8)|NELEMS(prot286_insn), CPU_286|CPU_Prot, NONE -verrw, prot286_insn, (0x0400UL<<8)|NELEMS(prot286_insn), CPU_286|CPU_Prot, SUF_W -verw, prot286_insn, (0x0500UL<<8)|NELEMS(prot286_insn), CPU_286|CPU_Prot, NONE -verww, prot286_insn, (0x0500UL<<8)|NELEMS(prot286_insn), CPU_286|CPU_Prot, SUF_W -vmcall, threebyte_insn, (0x0F01C1UL<<8)|NELEMS(threebyte_insn), CPU_P4, NONE -vmclear, vmxthreebytemem_insn, (0x66UL<<8)|NELEMS(vmxthreebytemem_insn), CPU_P4, NONE -vmlaunch, threebyte_insn, (0x0F01C2UL<<8)|NELEMS(threebyte_insn), CPU_P4, NONE -vmload, svm_rax_insn, (0xDAUL<<8)|NELEMS(svm_rax_insn), CPU_SVM, NONE -vmmcall, threebyte_insn, (0x0F01D9UL<<8)|NELEMS(threebyte_insn), CPU_SVM, NONE -vmptrld, vmxtwobytemem_insn, (0x06UL<<8)|NELEMS(vmxtwobytemem_insn), CPU_P4, NONE -vmptrst, vmxtwobytemem_insn, (0x07UL<<8)|NELEMS(vmxtwobytemem_insn), CPU_P4, NONE -vmread, vmxmemrd_insn, (0UL<<8)|NELEMS(vmxmemrd_insn), CPU_P4, NONE -vmreadl, vmxmemrd_insn, (0UL<<8)|NELEMS(vmxmemrd_insn), CPU_Not64|CPU_P4, SUF_L -vmreadq, vmxmemrd_insn, (0UL<<8)|NELEMS(vmxmemrd_insn), CPU_64|CPU_P4, SUF_Q -vmresume, threebyte_insn, (0x0F01C3UL<<8)|NELEMS(threebyte_insn), CPU_P4, NONE -vmrun, svm_rax_insn, (0xD8UL<<8)|NELEMS(svm_rax_insn), CPU_SVM, NONE -vmsave, svm_rax_insn, (0xDBUL<<8)|NELEMS(svm_rax_insn), CPU_SVM, NONE -vmwrite, vmxmemwr_insn, (0UL<<8)|NELEMS(vmxmemwr_insn), CPU_P4, NONE -vmwritel, vmxmemwr_insn, (0UL<<8)|NELEMS(vmxmemwr_insn), CPU_Not64|CPU_P4, SUF_L -vmwriteq, vmxmemwr_insn, (0UL<<8)|NELEMS(vmxmemwr_insn), CPU_64|CPU_P4, SUF_Q -vmxoff, threebyte_insn, (0x0F01C4UL<<8)|NELEMS(threebyte_insn), CPU_P4, NONE -vmxon, vmxthreebytemem_insn, (0xF3UL<<8)|NELEMS(vmxthreebytemem_insn), CPU_P4, NONE -wait, onebyte_insn, (0x00009BUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -wbinvd, twobyte_insn, (0x0F09UL<<8)|NELEMS(twobyte_insn), CPU_486|CPU_Priv, NONE +rol, shift_insn, (0x00UL<<8)|16, CPU_Any, NONE +rolb, shift_insn, (0x00UL<<8)|16, CPU_Any, SUF_B +roll, shift_insn, (0x00UL<<8)|16, CPU_386, SUF_L +rolq, shift_insn, (0x00UL<<8)|16, CPU_64, SUF_Q +rolw, shift_insn, (0x00UL<<8)|16, CPU_Any, SUF_W +ror, shift_insn, (0x01UL<<8)|16, CPU_Any, NONE +rorb, shift_insn, (0x01UL<<8)|16, CPU_Any, SUF_B +rorl, shift_insn, (0x01UL<<8)|16, CPU_386, SUF_L +rorq, shift_insn, (0x01UL<<8)|16, CPU_64, SUF_Q +rorw, shift_insn, (0x01UL<<8)|16, CPU_Any, SUF_W +roundpd, sse4imm_insn, (0x09UL<<8)|1, CPU_SSE41, NONE +roundps, sse4imm_insn, (0x08UL<<8)|1, CPU_SSE41, NONE +roundsd, sse4imm_insn, (0x0BUL<<8)|1, CPU_SSE41, NONE +roundss, sse4imm_insn, (0x0AUL<<8)|1, CPU_SSE41, NONE +rsdc, rsdc_insn, (0UL<<8)|1, CPU_486|CPU_Cyrix|CPU_SMM, NONE +rsldt, cyrixsmm_insn, (0x7BUL<<8)|1, CPU_486|CPU_Cyrix|CPU_SMM, NONE +rsm, twobyte_insn, (0x0FAAUL<<8)|1, CPU_586|CPU_SMM, NONE +rsqrtps, sseps_insn, (0x52UL<<8)|1, CPU_SSE, NONE +rsqrtss, ssess_insn, (0xF352UL<<8)|1, CPU_SSE, NONE +rsts, cyrixsmm_insn, (0x7DUL<<8)|1, CPU_486|CPU_Cyrix|CPU_SMM, NONE +sahf, onebyte_insn, (0x00009EUL<<8)|1, CPU_Any, NONE +sal, shift_insn, (0x04UL<<8)|16, CPU_Any, NONE +salb, shift_insn, (0x04UL<<8)|16, CPU_Any, SUF_B +sall, shift_insn, (0x04UL<<8)|16, CPU_386, SUF_L +salq, shift_insn, (0x04UL<<8)|16, CPU_64, SUF_Q +salw, shift_insn, (0x04UL<<8)|16, CPU_Any, SUF_W +salc, onebyte_insn, (0x0000D6UL<<8)|1, CPU_Not64|CPU_Undoc, NONE +sar, shift_insn, (0x07UL<<8)|16, CPU_Any, NONE +sarb, shift_insn, (0x07UL<<8)|16, CPU_Any, SUF_B +sarl, shift_insn, (0x07UL<<8)|16, CPU_386, SUF_L +sarq, shift_insn, (0x07UL<<8)|16, CPU_64, SUF_Q +sarw, shift_insn, (0x07UL<<8)|16, CPU_Any, SUF_W +sbb, arith_insn, (0x0318UL<<8)|22, CPU_Any, NONE +sbbb, arith_insn, (0x0318UL<<8)|22, CPU_Any, SUF_B +sbbl, arith_insn, (0x0318UL<<8)|22, CPU_386, SUF_L +sbbq, arith_insn, (0x0318UL<<8)|22, CPU_64, SUF_Q +sbbw, arith_insn, (0x0318UL<<8)|22, CPU_Any, SUF_W +scasb, onebyte_insn, (0x0000AEUL<<8)|1, CPU_Any, NONE +scasl, onebyte_insn, (0x0020AFUL<<8)|1, CPU_386, NONE +scasq, onebyte_insn, (0x0040AFUL<<8)|1, CPU_64, NONE +scasw, onebyte_insn, (0x0010AFUL<<8)|1, CPU_Any, NONE +seta, setcc_insn, (0x07UL<<8)|1, CPU_386, NONE +setab, setcc_insn, (0x07UL<<8)|1, CPU_386, SUF_B +setae, setcc_insn, (0x03UL<<8)|1, CPU_386, NONE +setaeb, setcc_insn, (0x03UL<<8)|1, CPU_386, SUF_B +setb, setcc_insn, (0x02UL<<8)|1, CPU_386, NONE +setbb, setcc_insn, (0x02UL<<8)|1, CPU_386, SUF_B +setbe, setcc_insn, (0x06UL<<8)|1, CPU_386, NONE +setbeb, setcc_insn, (0x06UL<<8)|1, CPU_386, SUF_B +setc, setcc_insn, (0x02UL<<8)|1, CPU_386, NONE +setcb, setcc_insn, (0x02UL<<8)|1, CPU_386, SUF_B +sete, setcc_insn, (0x04UL<<8)|1, CPU_386, NONE +seteb, setcc_insn, (0x04UL<<8)|1, CPU_386, SUF_B +setg, setcc_insn, (0x0FUL<<8)|1, CPU_386, NONE +setgb, setcc_insn, (0x0FUL<<8)|1, CPU_386, SUF_B +setge, setcc_insn, (0x0DUL<<8)|1, CPU_386, NONE +setgeb, setcc_insn, (0x0DUL<<8)|1, CPU_386, SUF_B +setl, setcc_insn, (0x0CUL<<8)|1, CPU_386, NONE +setlb, setcc_insn, (0x0CUL<<8)|1, CPU_386, SUF_B +setle, setcc_insn, (0x0EUL<<8)|1, CPU_386, NONE +setleb, setcc_insn, (0x0EUL<<8)|1, CPU_386, SUF_B +setna, setcc_insn, (0x06UL<<8)|1, CPU_386, NONE +setnab, setcc_insn, (0x06UL<<8)|1, CPU_386, SUF_B +setnae, setcc_insn, (0x02UL<<8)|1, CPU_386, NONE +setnaeb, setcc_insn, (0x02UL<<8)|1, CPU_386, SUF_B +setnb, setcc_insn, (0x03UL<<8)|1, CPU_386, NONE +setnbb, setcc_insn, (0x03UL<<8)|1, CPU_386, SUF_B +setnbe, setcc_insn, (0x07UL<<8)|1, CPU_386, NONE +setnbeb, setcc_insn, (0x07UL<<8)|1, CPU_386, SUF_B +setnc, setcc_insn, (0x03UL<<8)|1, CPU_386, NONE +setncb, setcc_insn, (0x03UL<<8)|1, CPU_386, SUF_B +setne, setcc_insn, (0x05UL<<8)|1, CPU_386, NONE +setneb, setcc_insn, (0x05UL<<8)|1, CPU_386, SUF_B +setng, setcc_insn, (0x0EUL<<8)|1, CPU_386, NONE +setngb, setcc_insn, (0x0EUL<<8)|1, CPU_386, SUF_B +setnge, setcc_insn, (0x0CUL<<8)|1, CPU_386, NONE +setngeb, setcc_insn, (0x0CUL<<8)|1, CPU_386, SUF_B +setnl, setcc_insn, (0x0DUL<<8)|1, CPU_386, NONE +setnlb, setcc_insn, (0x0DUL<<8)|1, CPU_386, SUF_B +setnle, setcc_insn, (0x0FUL<<8)|1, CPU_386, NONE +setnleb, setcc_insn, (0x0FUL<<8)|1, CPU_386, SUF_B +setno, setcc_insn, (0x01UL<<8)|1, CPU_386, NONE +setnob, setcc_insn, (0x01UL<<8)|1, CPU_386, SUF_B +setnp, setcc_insn, (0x0BUL<<8)|1, CPU_386, NONE +setnpb, setcc_insn, (0x0BUL<<8)|1, CPU_386, SUF_B +setns, setcc_insn, (0x09UL<<8)|1, CPU_386, NONE +setnsb, setcc_insn, (0x09UL<<8)|1, CPU_386, SUF_B +setnz, setcc_insn, (0x05UL<<8)|1, CPU_386, NONE +setnzb, setcc_insn, (0x05UL<<8)|1, CPU_386, SUF_B +seto, setcc_insn, (0x00UL<<8)|1, CPU_386, NONE +setob, setcc_insn, (0x00UL<<8)|1, CPU_386, SUF_B +setp, setcc_insn, (0x0AUL<<8)|1, CPU_386, NONE +setpb, setcc_insn, (0x0AUL<<8)|1, CPU_386, SUF_B +setpe, setcc_insn, (0x0AUL<<8)|1, CPU_386, NONE +setpeb, setcc_insn, (0x0AUL<<8)|1, CPU_386, SUF_B +setpo, setcc_insn, (0x0BUL<<8)|1, CPU_386, NONE +setpob, setcc_insn, (0x0BUL<<8)|1, CPU_386, SUF_B +sets, setcc_insn, (0x08UL<<8)|1, CPU_386, NONE +setsb, setcc_insn, (0x08UL<<8)|1, CPU_386, SUF_B +setz, setcc_insn, (0x04UL<<8)|1, CPU_386, NONE +setzb, setcc_insn, (0x04UL<<8)|1, CPU_386, SUF_B +sfence, threebyte_insn, (0x0FAEF8UL<<8)|1, CPU_P3, NONE +sgdt, twobytemem_insn, (0x000F01UL<<8)|1, CPU_286|CPU_Priv, NONE +sgdtl, twobytemem_insn, (0x000F01UL<<8)|1, CPU_286|CPU_Priv, SUF_L +sgdtq, twobytemem_insn, (0x000F01UL<<8)|1, CPU_286|CPU_Priv, SUF_Q +sgdtw, twobytemem_insn, (0x000F01UL<<8)|1, CPU_286|CPU_Priv, SUF_W +shl, shift_insn, (0x04UL<<8)|16, CPU_Any, NONE +shlb, shift_insn, (0x04UL<<8)|16, CPU_Any, SUF_B +shll, shift_insn, (0x04UL<<8)|16, CPU_386, SUF_L +shlq, shift_insn, (0x04UL<<8)|16, CPU_64, SUF_Q +shlw, shift_insn, (0x04UL<<8)|16, CPU_Any, SUF_W +shld, shlrd_insn, (0xA4UL<<8)|9, CPU_386, NONE +shldl, shlrd_insn, (0xA4UL<<8)|9, CPU_386, SUF_L +shldq, shlrd_insn, (0xA4UL<<8)|9, CPU_386|CPU_64, SUF_Q +shldw, shlrd_insn, (0xA4UL<<8)|9, CPU_386, SUF_W +shr, shift_insn, (0x05UL<<8)|16, CPU_Any, NONE +shrb, shift_insn, (0x05UL<<8)|16, CPU_Any, SUF_B +shrl, shift_insn, (0x05UL<<8)|16, CPU_386, SUF_L +shrq, shift_insn, (0x05UL<<8)|16, CPU_64, SUF_Q +shrw, shift_insn, (0x05UL<<8)|16, CPU_Any, SUF_W +shrd, shlrd_insn, (0xACUL<<8)|9, CPU_386, NONE +shrdl, shlrd_insn, (0xACUL<<8)|9, CPU_386, SUF_L +shrdq, shlrd_insn, (0xACUL<<8)|9, CPU_386|CPU_64, SUF_Q +shrdw, shlrd_insn, (0xACUL<<8)|9, CPU_386, SUF_W +shufpd, ssessimm_insn, (0x66C6UL<<8)|1, CPU_SSE2, NONE +shufps, ssepsimm_insn, (0xC6UL<<8)|1, CPU_SSE, NONE +sidt, twobytemem_insn, (0x010F01UL<<8)|1, CPU_286|CPU_Priv, NONE +sidtl, twobytemem_insn, (0x010F01UL<<8)|1, CPU_286|CPU_Priv, SUF_L +sidtq, twobytemem_insn, (0x010F01UL<<8)|1, CPU_286|CPU_Priv, SUF_Q +sidtw, twobytemem_insn, (0x010F01UL<<8)|1, CPU_286|CPU_Priv, SUF_W +skinit, skinit_insn, (0UL<<8)|2, CPU_SVM, NONE +sldt, sldtmsw_insn, (0x0000UL<<8)|6, CPU_286, NONE +sldtl, sldtmsw_insn, (0x0000UL<<8)|6, CPU_386, SUF_L +sldtq, sldtmsw_insn, (0x0000UL<<8)|6, CPU_286|CPU_64, SUF_Q +sldtw, sldtmsw_insn, (0x0000UL<<8)|6, CPU_286, SUF_W +smi, onebyte_insn, (0x0000F1UL<<8)|1, CPU_386|CPU_Undoc, NONE +smint, twobyte_insn, (0x0F38UL<<8)|1, CPU_686|CPU_Cyrix, NONE +smintold, twobyte_insn, (0x0F7EUL<<8)|1, CPU_486|CPU_Cyrix|CPU_Obs, NONE +smovb, onebyte_insn, (0x0000A4UL<<8)|1, CPU_Any, NONE +smovl, onebyte_insn, (0x0020A5UL<<8)|1, CPU_386, NONE +smovq, onebyte_insn, (0x0040A5UL<<8)|1, CPU_64, NONE +smovw, onebyte_insn, (0x0010A5UL<<8)|1, CPU_Any, NONE +smsw, sldtmsw_insn, (0x0401UL<<8)|6, CPU_286, NONE +smswl, sldtmsw_insn, (0x0401UL<<8)|6, CPU_386, SUF_L +smswq, sldtmsw_insn, (0x0401UL<<8)|6, CPU_286|CPU_64, SUF_Q +smsww, sldtmsw_insn, (0x0401UL<<8)|6, CPU_286, SUF_W +sqrtpd, ssess_insn, (0x6651UL<<8)|1, CPU_SSE2, NONE +sqrtps, sseps_insn, (0x51UL<<8)|1, CPU_SSE, NONE +sqrtsd, ssess_insn, (0xF251UL<<8)|1, CPU_SSE2, NONE +sqrtss, ssess_insn, (0xF351UL<<8)|1, CPU_SSE, NONE +sscab, onebyte_insn, (0x0000AEUL<<8)|1, CPU_Any, NONE +sscal, onebyte_insn, (0x0020AFUL<<8)|1, CPU_386, NONE +sscaq, onebyte_insn, (0x0040AFUL<<8)|1, CPU_64, NONE +sscaw, onebyte_insn, (0x0010AFUL<<8)|1, CPU_Any, NONE +stc, onebyte_insn, (0x0000F9UL<<8)|1, CPU_Any, NONE +std, onebyte_insn, (0x0000FDUL<<8)|1, CPU_Any, NONE +stgi, threebyte_insn, (0x0F01DCUL<<8)|1, CPU_SVM, NONE +sti, onebyte_insn, (0x0000FBUL<<8)|1, CPU_Any, NONE +stmxcsr, ldstmxcsr_insn, (0x03UL<<8)|1, CPU_SSE, NONE +stosb, onebyte_insn, (0x0000AAUL<<8)|1, CPU_Any, NONE +stosl, onebyte_insn, (0x0020ABUL<<8)|1, CPU_386, NONE +stosq, onebyte_insn, (0x0040ABUL<<8)|1, CPU_64, NONE +stosw, onebyte_insn, (0x0010ABUL<<8)|1, CPU_Any, NONE +str, str_insn, (0UL<<8)|4, CPU_286|CPU_Prot, NONE +strl, str_insn, (0UL<<8)|4, CPU_386|CPU_Prot, SUF_L +strq, str_insn, (0UL<<8)|4, CPU_286|CPU_64|CPU_Prot, SUF_Q +strw, str_insn, (0UL<<8)|4, CPU_286|CPU_Prot, SUF_W +sub, arith_insn, (0x0528UL<<8)|22, CPU_Any, NONE +subb, arith_insn, (0x0528UL<<8)|22, CPU_Any, SUF_B +subl, arith_insn, (0x0528UL<<8)|22, CPU_386, SUF_L +subq, arith_insn, (0x0528UL<<8)|22, CPU_64, SUF_Q +subw, arith_insn, (0x0528UL<<8)|22, CPU_Any, SUF_W +subpd, ssess_insn, (0x665CUL<<8)|1, CPU_SSE2, NONE +subps, sseps_insn, (0x5CUL<<8)|1, CPU_SSE, NONE +subsd, ssess_insn, (0xF25CUL<<8)|1, CPU_SSE2, NONE +subss, ssess_insn, (0xF35CUL<<8)|1, CPU_SSE, NONE +svdc, svdc_insn, (0UL<<8)|1, CPU_486|CPU_Cyrix|CPU_SMM, NONE +svldt, cyrixsmm_insn, (0x7AUL<<8)|1, CPU_486|CPU_Cyrix|CPU_SMM, NONE +svts, cyrixsmm_insn, (0x7CUL<<8)|1, CPU_486|CPU_Cyrix|CPU_SMM, NONE +swapgs, threebyte_insn, (0x0F01F8UL<<8)|1, CPU_64, NONE +syscall, twobyte_insn, (0x0F05UL<<8)|1, CPU_686|CPU_AMD, NONE +sysenter, twobyte_insn, (0x0F34UL<<8)|1, CPU_686|CPU_Not64, NONE +sysexit, twobyte_insn, (0x0F35UL<<8)|1, CPU_686|CPU_Not64|CPU_Priv, NONE +sysret, twobyte_insn, (0x0F07UL<<8)|1, CPU_686|CPU_AMD|CPU_Priv, NONE +sysretl, twobyte_insn, (0x0F07UL<<8)|1, CPU_686|CPU_AMD|CPU_Priv, SUF_L +sysretq, twobyte_insn, (0x0F07UL<<8)|1, CPU_686|CPU_AMD|CPU_Priv, SUF_Q +test, test_insn, (0UL<<8)|20, CPU_Any, NONE +testb, test_insn, (0UL<<8)|20, CPU_Any, SUF_B +testl, test_insn, (0UL<<8)|20, CPU_386, SUF_L +testq, test_insn, (0UL<<8)|20, CPU_64, SUF_Q +testw, test_insn, (0UL<<8)|20, CPU_Any, SUF_W +ucomisd, ssess_insn, (0x662EUL<<8)|1, CPU_SSE2, NONE +ucomiss, ssess_insn, (0x002EUL<<8)|1, CPU_SSE, NONE +ud1, twobyte_insn, (0x0FB9UL<<8)|1, CPU_286|CPU_Undoc, NONE +ud2, twobyte_insn, (0x0F0BUL<<8)|1, CPU_286, NONE +umov, umov_insn, (0UL<<8)|6, CPU_386|CPU_Undoc, NONE +unpckhpd, ssess_insn, (0x6615UL<<8)|1, CPU_SSE2, NONE +unpckhps, sseps_insn, (0x15UL<<8)|1, CPU_SSE, NONE +unpcklpd, ssess_insn, (0x6614UL<<8)|1, CPU_SSE2, NONE +unpcklps, sseps_insn, (0x14UL<<8)|1, CPU_SSE, NONE +verr, prot286_insn, (0x0400UL<<8)|1, CPU_286|CPU_Prot, NONE +verrw, prot286_insn, (0x0400UL<<8)|1, CPU_286|CPU_Prot, SUF_W +verw, prot286_insn, (0x0500UL<<8)|1, CPU_286|CPU_Prot, NONE +verww, prot286_insn, (0x0500UL<<8)|1, CPU_286|CPU_Prot, SUF_W +vmcall, threebyte_insn, (0x0F01C1UL<<8)|1, CPU_P4, NONE +vmclear, vmxthreebytemem_insn, (0x66UL<<8)|1, CPU_P4, NONE +vmlaunch, threebyte_insn, (0x0F01C2UL<<8)|1, CPU_P4, NONE +vmload, svm_rax_insn, (0xDAUL<<8)|2, CPU_SVM, NONE +vmmcall, threebyte_insn, (0x0F01D9UL<<8)|1, CPU_SVM, NONE +vmptrld, vmxtwobytemem_insn, (0x06UL<<8)|1, CPU_P4, NONE +vmptrst, vmxtwobytemem_insn, (0x07UL<<8)|1, CPU_P4, NONE +vmread, vmxmemrd_insn, (0UL<<8)|2, CPU_P4, NONE +vmreadl, vmxmemrd_insn, (0UL<<8)|2, CPU_Not64|CPU_P4, SUF_L +vmreadq, vmxmemrd_insn, (0UL<<8)|2, CPU_64|CPU_P4, SUF_Q +vmresume, threebyte_insn, (0x0F01C3UL<<8)|1, CPU_P4, NONE +vmrun, svm_rax_insn, (0xD8UL<<8)|2, CPU_SVM, NONE +vmsave, svm_rax_insn, (0xDBUL<<8)|2, CPU_SVM, NONE +vmwrite, vmxmemwr_insn, (0UL<<8)|2, CPU_P4, NONE +vmwritel, vmxmemwr_insn, (0UL<<8)|2, CPU_Not64|CPU_P4, SUF_L +vmwriteq, vmxmemwr_insn, (0UL<<8)|2, CPU_64|CPU_P4, SUF_Q +vmxoff, threebyte_insn, (0x0F01C4UL<<8)|1, CPU_P4, NONE +vmxon, vmxthreebytemem_insn, (0xF3UL<<8)|1, CPU_P4, NONE +wait, onebyte_insn, (0x00009BUL<<8)|1, CPU_Any, NONE +wbinvd, twobyte_insn, (0x0F09UL<<8)|1, CPU_486|CPU_Priv, NONE word, NULL, X86_OPERSIZE, 0x10, NONE -wrmsr, twobyte_insn, (0x0F30UL<<8)|NELEMS(twobyte_insn), CPU_586|CPU_Priv, NONE -wrshr, rdwrshr_insn, (0x01UL<<8)|NELEMS(rdwrshr_insn), CPU_686|CPU_Cyrix|CPU_SMM, NONE -xadd, cmpxchgxadd_insn, (0xC0UL<<8)|NELEMS(cmpxchgxadd_insn), CPU_486, NONE -xaddb, cmpxchgxadd_insn, (0xC0UL<<8)|NELEMS(cmpxchgxadd_insn), CPU_486, SUF_B -xaddl, cmpxchgxadd_insn, (0xC0UL<<8)|NELEMS(cmpxchgxadd_insn), CPU_486, SUF_L -xaddq, cmpxchgxadd_insn, (0xC0UL<<8)|NELEMS(cmpxchgxadd_insn), CPU_486|CPU_64, SUF_Q -xaddw, cmpxchgxadd_insn, (0xC0UL<<8)|NELEMS(cmpxchgxadd_insn), CPU_486, SUF_W -xbts, xbts_insn, (0UL<<8)|NELEMS(xbts_insn), CPU_386|CPU_Obs|CPU_Undoc, NONE -xchg, xchg_insn, (0UL<<8)|NELEMS(xchg_insn), CPU_Any, NONE -xchgb, xchg_insn, (0UL<<8)|NELEMS(xchg_insn), CPU_Any, SUF_B -xchgl, xchg_insn, (0UL<<8)|NELEMS(xchg_insn), CPU_Any, SUF_L -xchgq, xchg_insn, (0UL<<8)|NELEMS(xchg_insn), CPU_64, SUF_Q -xchgw, xchg_insn, (0UL<<8)|NELEMS(xchg_insn), CPU_Any, SUF_W -xcryptcbc, padlock_insn, (0xD0F3A7UL<<8)|NELEMS(padlock_insn), CPU_PadLock, NONE -xcryptcfb, padlock_insn, (0xE0F3A7UL<<8)|NELEMS(padlock_insn), CPU_PadLock, NONE -xcryptctr, padlock_insn, (0xD8F3A7UL<<8)|NELEMS(padlock_insn), CPU_PadLock, NONE -xcryptecb, padlock_insn, (0xC8F3A7UL<<8)|NELEMS(padlock_insn), CPU_PadLock, NONE -xcryptofb, padlock_insn, (0xE8F3A7UL<<8)|NELEMS(padlock_insn), CPU_PadLock, NONE -xlatb, onebyte_insn, (0x0000D7UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -xor, arith_insn, (0x0630UL<<8)|NELEMS(arith_insn), CPU_Any, NONE -xorb, arith_insn, (0x0630UL<<8)|NELEMS(arith_insn), CPU_Any, SUF_B -xorl, arith_insn, (0x0630UL<<8)|NELEMS(arith_insn), CPU_386, SUF_L -xorq, arith_insn, (0x0630UL<<8)|NELEMS(arith_insn), CPU_64, SUF_Q -xorw, arith_insn, (0x0630UL<<8)|NELEMS(arith_insn), CPU_Any, SUF_W -xorpd, ssess_insn, (0x6657UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -xorps, sseps_insn, (0x57UL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE -xsha1, padlock_insn, (0xC8F3A6UL<<8)|NELEMS(padlock_insn), CPU_PadLock, NONE -xsha256, padlock_insn, (0xD0F3A6UL<<8)|NELEMS(padlock_insn), CPU_PadLock, NONE -xstore, padlock_insn, (0xC000A7UL<<8)|NELEMS(padlock_insn), CPU_PadLock, NONE -xstorerng, padlock_insn, (0xC000A7UL<<8)|NELEMS(padlock_insn), CPU_PadLock, NONE +wrmsr, twobyte_insn, (0x0F30UL<<8)|1, CPU_586|CPU_Priv, NONE +wrshr, rdwrshr_insn, (0x01UL<<8)|1, CPU_686|CPU_Cyrix|CPU_SMM, NONE +xadd, cmpxchgxadd_insn, (0xC0UL<<8)|4, CPU_486, NONE +xaddb, cmpxchgxadd_insn, (0xC0UL<<8)|4, CPU_486, SUF_B +xaddl, cmpxchgxadd_insn, (0xC0UL<<8)|4, CPU_486, SUF_L +xaddq, cmpxchgxadd_insn, (0xC0UL<<8)|4, CPU_486|CPU_64, SUF_Q +xaddw, cmpxchgxadd_insn, (0xC0UL<<8)|4, CPU_486, SUF_W +xbts, xbts_insn, (0UL<<8)|2, CPU_386|CPU_Obs|CPU_Undoc, NONE +xchg, xchg_insn, (0UL<<8)|16, CPU_Any, NONE +xchgb, xchg_insn, (0UL<<8)|16, CPU_Any, SUF_B +xchgl, xchg_insn, (0UL<<8)|16, CPU_Any, SUF_L +xchgq, xchg_insn, (0UL<<8)|16, CPU_64, SUF_Q +xchgw, xchg_insn, (0UL<<8)|16, CPU_Any, SUF_W +xcryptcbc, padlock_insn, (0xD0F3A7UL<<8)|1, CPU_PadLock, NONE +xcryptcfb, padlock_insn, (0xE0F3A7UL<<8)|1, CPU_PadLock, NONE +xcryptctr, padlock_insn, (0xD8F3A7UL<<8)|1, CPU_PadLock, NONE +xcryptecb, padlock_insn, (0xC8F3A7UL<<8)|1, CPU_PadLock, NONE +xcryptofb, padlock_insn, (0xE8F3A7UL<<8)|1, CPU_PadLock, NONE +xlatb, onebyte_insn, (0x0000D7UL<<8)|1, CPU_Any, NONE +xor, arith_insn, (0x0630UL<<8)|22, CPU_Any, NONE +xorb, arith_insn, (0x0630UL<<8)|22, CPU_Any, SUF_B +xorl, arith_insn, (0x0630UL<<8)|22, CPU_386, SUF_L +xorq, arith_insn, (0x0630UL<<8)|22, CPU_64, SUF_Q +xorw, arith_insn, (0x0630UL<<8)|22, CPU_Any, SUF_W +xorpd, ssess_insn, (0x6657UL<<8)|1, CPU_SSE2, NONE +xorps, sseps_insn, (0x57UL<<8)|1, CPU_SSE, NONE +xsha1, padlock_insn, (0xC8F3A6UL<<8)|1, CPU_PadLock, NONE +xsha256, padlock_insn, (0xD0F3A6UL<<8)|1, CPU_PadLock, NONE +xstore, padlock_insn, (0xC000A7UL<<8)|1, CPU_PadLock, NONE +xstorerng, padlock_insn, (0xC000A7UL<<8)|1, CPU_PadLock, NONE diff --git a/x86insn_nasm.gperf b/x86insn_nasm.gperf index 6ee3d265..01d14fd3 100644 --- a/x86insn_nasm.gperf +++ b/x86insn_nasm.gperf @@ -11,758 +11,758 @@ struct insnprefix_parse_data; a16, NULL, X86_ADDRSIZE, 0x10, NONE a32, NULL, X86_ADDRSIZE, 0x20, NONE a64, NULL, X86_ADDRSIZE, 0x40, NONE -aaa, onebyte_insn, (0x000037UL<<8)|NELEMS(onebyte_insn), CPU_Not64, NONE -aad, aadm_insn, (0x01UL<<8)|NELEMS(aadm_insn), CPU_Not64, NONE -aam, aadm_insn, (0x00UL<<8)|NELEMS(aadm_insn), CPU_Not64, NONE -aas, onebyte_insn, (0x00003FUL<<8)|NELEMS(onebyte_insn), CPU_Not64, NONE -adc, arith_insn, (0x0210UL<<8)|NELEMS(arith_insn), CPU_Any, NONE -add, arith_insn, (0x0000UL<<8)|NELEMS(arith_insn), CPU_Any, NONE -addpd, ssess_insn, (0x6658UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -addps, sseps_insn, (0x58UL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE -addsd, ssess_insn, (0xF258UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -addss, ssess_insn, (0xF358UL<<8)|NELEMS(ssess_insn), CPU_SSE, NONE -addsubpd, ssess_insn, (0x66D0UL<<8)|NELEMS(ssess_insn), CPU_SSE3, NONE -addsubps, ssess_insn, (0xF2D0UL<<8)|NELEMS(ssess_insn), CPU_SSE3, NONE -and, arith_insn, (0x0420UL<<8)|NELEMS(arith_insn), CPU_Any, NONE -andnpd, ssess_insn, (0x6655UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -andnps, sseps_insn, (0x55UL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE -andpd, ssess_insn, (0x6654UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -andps, sseps_insn, (0x54UL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE -arpl, arpl_insn, (0UL<<8)|NELEMS(arpl_insn), CPU_286|CPU_Not64|CPU_Prot, NONE -blendpd, sse4imm_insn, (0x0DUL<<8)|NELEMS(sse4imm_insn), CPU_SSE41, NONE -blendps, sse4imm_insn, (0x0CUL<<8)|NELEMS(sse4imm_insn), CPU_SSE41, NONE -blendvpd, sse4xmm0_insn, (0x15UL<<8)|NELEMS(sse4xmm0_insn), CPU_SSE41, NONE -blendvps, sse4xmm0_insn, (0x14UL<<8)|NELEMS(sse4xmm0_insn), CPU_SSE41, NONE -bound, bound_insn, (0UL<<8)|NELEMS(bound_insn), CPU_186|CPU_Not64, NONE -bsf, bsfr_insn, (0xBCUL<<8)|NELEMS(bsfr_insn), CPU_386, NONE -bsr, bsfr_insn, (0xBDUL<<8)|NELEMS(bsfr_insn), CPU_386, NONE -bswap, bswap_insn, (0UL<<8)|NELEMS(bswap_insn), CPU_486, NONE -bt, bittest_insn, (0x04A3UL<<8)|NELEMS(bittest_insn), CPU_386, NONE -btc, bittest_insn, (0x07BBUL<<8)|NELEMS(bittest_insn), CPU_386, NONE -btr, bittest_insn, (0x06B3UL<<8)|NELEMS(bittest_insn), CPU_386, NONE -bts, bittest_insn, (0x05ABUL<<8)|NELEMS(bittest_insn), CPU_386, NONE -call, call_insn, (0UL<<8)|NELEMS(call_insn), CPU_Any, NONE -cbw, onebyte_insn, (0x001098UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -cdq, onebyte_insn, (0x002099UL<<8)|NELEMS(onebyte_insn), CPU_386, NONE -cdqe, onebyte_insn, (0x004098UL<<8)|NELEMS(onebyte_insn), CPU_64, NONE -clc, onebyte_insn, (0x0000F8UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -cld, onebyte_insn, (0x0000FCUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -clflush, clflush_insn, (0UL<<8)|NELEMS(clflush_insn), CPU_P3, NONE -clgi, threebyte_insn, (0x0F01DDUL<<8)|NELEMS(threebyte_insn), CPU_SVM, NONE -cli, onebyte_insn, (0x0000FAUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -clts, twobyte_insn, (0x0F06UL<<8)|NELEMS(twobyte_insn), CPU_286|CPU_Priv, NONE -cmc, onebyte_insn, (0x0000F5UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -cmova, cmovcc_insn, (0x07UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovae, cmovcc_insn, (0x03UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovb, cmovcc_insn, (0x02UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovbe, cmovcc_insn, (0x06UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovc, cmovcc_insn, (0x02UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmove, cmovcc_insn, (0x04UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovg, cmovcc_insn, (0x0FUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovge, cmovcc_insn, (0x0DUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovl, cmovcc_insn, (0x0CUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovle, cmovcc_insn, (0x0EUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovna, cmovcc_insn, (0x06UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovnae, cmovcc_insn, (0x02UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovnb, cmovcc_insn, (0x03UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovnbe, cmovcc_insn, (0x07UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovnc, cmovcc_insn, (0x03UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovne, cmovcc_insn, (0x05UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovng, cmovcc_insn, (0x0EUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovnge, cmovcc_insn, (0x0CUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovnl, cmovcc_insn, (0x0DUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovnle, cmovcc_insn, (0x0FUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovno, cmovcc_insn, (0x01UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovnp, cmovcc_insn, (0x0BUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovns, cmovcc_insn, (0x09UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovnz, cmovcc_insn, (0x05UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovo, cmovcc_insn, (0x00UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovp, cmovcc_insn, (0x0AUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovpe, cmovcc_insn, (0x0AUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovpo, cmovcc_insn, (0x0BUL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovs, cmovcc_insn, (0x08UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmovz, cmovcc_insn, (0x04UL<<8)|NELEMS(cmovcc_insn), CPU_686, NONE -cmp, arith_insn, (0x0738UL<<8)|NELEMS(arith_insn), CPU_Any, NONE -cmpeqpd, ssecmpss_insn, (0x0066UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE -cmpeqps, ssecmpps_insn, (0x00UL<<8)|NELEMS(ssecmpps_insn), CPU_SSE, NONE -cmpeqsd, ssecmpss_insn, (0x00F2UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE -cmpeqss, ssecmpss_insn, (0x00F3UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE, NONE -cmplepd, ssecmpss_insn, (0x0266UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE -cmpleps, ssecmpps_insn, (0x02UL<<8)|NELEMS(ssecmpps_insn), CPU_SSE, NONE -cmplesd, ssecmpss_insn, (0x02F2UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE -cmpless, ssecmpss_insn, (0x02F3UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE, NONE -cmpltpd, ssecmpss_insn, (0x0166UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE -cmpltps, ssecmpps_insn, (0x01UL<<8)|NELEMS(ssecmpps_insn), CPU_SSE, NONE -cmpltsd, ssecmpss_insn, (0x01F2UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE -cmpltss, ssecmpss_insn, (0x01F3UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE, NONE -cmpneqpd, ssecmpss_insn, (0x0466UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE -cmpneqps, ssecmpps_insn, (0x04UL<<8)|NELEMS(ssecmpps_insn), CPU_SSE, NONE -cmpneqsd, ssecmpss_insn, (0x04F2UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE -cmpneqss, ssecmpss_insn, (0x04F3UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE, NONE -cmpnlepd, ssecmpss_insn, (0x0666UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE -cmpnleps, ssecmpps_insn, (0x06UL<<8)|NELEMS(ssecmpps_insn), CPU_SSE, NONE -cmpnlesd, ssecmpss_insn, (0x06F2UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE -cmpnless, ssecmpss_insn, (0x06F3UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE, NONE -cmpnltpd, ssecmpss_insn, (0x0566UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE -cmpnltps, ssecmpps_insn, (0x05UL<<8)|NELEMS(ssecmpps_insn), CPU_SSE, NONE -cmpnltsd, ssecmpss_insn, (0x05F2UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE -cmpnltss, ssecmpss_insn, (0x05F3UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE, NONE -cmpordpd, ssecmpss_insn, (0x0766UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE -cmpordps, ssecmpps_insn, (0x07UL<<8)|NELEMS(ssecmpps_insn), CPU_SSE, NONE -cmpordsd, ssecmpss_insn, (0x07F2UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE -cmpordss, ssecmpss_insn, (0x07F3UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE, NONE -cmppd, ssessimm_insn, (0x66C2UL<<8)|NELEMS(ssessimm_insn), CPU_SSE2, NONE -cmpps, ssepsimm_insn, (0xC2UL<<8)|NELEMS(ssepsimm_insn), CPU_SSE, NONE -cmpsb, onebyte_insn, (0x0000A6UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -cmpsd, cmpsd_insn, (0UL<<8)|NELEMS(cmpsd_insn), CPU_Any, NONE -cmpsq, onebyte_insn, (0x0040A7UL<<8)|NELEMS(onebyte_insn), CPU_64, NONE -cmpss, ssessimm_insn, (0xF3C2UL<<8)|NELEMS(ssessimm_insn), CPU_SSE, NONE -cmpsw, onebyte_insn, (0x0010A7UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -cmpunordpd, ssecmpss_insn, (0x0366UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE -cmpunordps, ssecmpps_insn, (0x03UL<<8)|NELEMS(ssecmpps_insn), CPU_SSE, NONE -cmpunordsd, ssecmpss_insn, (0x03F2UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE2, NONE -cmpunordss, ssecmpss_insn, (0x03F3UL<<8)|NELEMS(ssecmpss_insn), CPU_SSE, NONE -cmpxchg, cmpxchgxadd_insn, (0xB0UL<<8)|NELEMS(cmpxchgxadd_insn), CPU_486, NONE -cmpxchg16b, cmpxchg16b_insn, (0UL<<8)|NELEMS(cmpxchg16b_insn), CPU_64, NONE -cmpxchg486, cmpxchgxadd_insn, (0xA6UL<<8)|NELEMS(cmpxchgxadd_insn), CPU_486|CPU_Undoc, NONE -cmpxchg8b, cmpxchg8b_insn, (0UL<<8)|NELEMS(cmpxchg8b_insn), CPU_586, NONE -comisd, ssess_insn, (0x662FUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -comiss, sseps_insn, (0x2FUL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE -cpuid, twobyte_insn, (0x0FA2UL<<8)|NELEMS(twobyte_insn), CPU_486, NONE -cqo, onebyte_insn, (0x004099UL<<8)|NELEMS(onebyte_insn), CPU_64, NONE -crc32, crc32_insn, (0UL<<8)|NELEMS(crc32_insn), CPU_386|CPU_SSE42, NONE -cvtdq2pd, cvt_xmm_xmm64_ss_insn, (0xF3E6UL<<8)|NELEMS(cvt_xmm_xmm64_ss_insn), CPU_SSE2, NONE -cvtdq2ps, sseps_insn, (0x5BUL<<8)|NELEMS(sseps_insn), CPU_SSE2, NONE -cvtpd2dq, ssess_insn, (0xF2E6UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -cvtpd2pi, cvt_mm_xmm_insn, (0x662DUL<<8)|NELEMS(cvt_mm_xmm_insn), CPU_SSE2, NONE -cvtpd2ps, ssess_insn, (0x665AUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -cvtpi2pd, cvt_xmm_mm_ss_insn, (0x662AUL<<8)|NELEMS(cvt_xmm_mm_ss_insn), CPU_SSE2, NONE -cvtpi2ps, cvt_xmm_mm_ps_insn, (0x2AUL<<8)|NELEMS(cvt_xmm_mm_ps_insn), CPU_SSE, NONE -cvtps2dq, ssess_insn, (0x665BUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -cvtps2pd, cvt_xmm_xmm64_ps_insn, (0x5AUL<<8)|NELEMS(cvt_xmm_xmm64_ps_insn), CPU_SSE2, NONE -cvtps2pi, cvt_mm_xmm64_insn, (0x2DUL<<8)|NELEMS(cvt_mm_xmm64_insn), CPU_SSE, NONE -cvtsd2si, cvt_rx_xmm64_insn, (0xF22DUL<<8)|NELEMS(cvt_rx_xmm64_insn), CPU_386|CPU_SSE2, NONE -cvtsd2ss, cvt_xmm_xmm64_ss_insn, (0xF25AUL<<8)|NELEMS(cvt_xmm_xmm64_ss_insn), CPU_SSE2, NONE -cvtsi2sd, cvt_xmm_rmx_insn, (0xF22AUL<<8)|NELEMS(cvt_xmm_rmx_insn), CPU_SSE2, NONE -cvtsi2ss, cvt_xmm_rmx_insn, (0xF32AUL<<8)|NELEMS(cvt_xmm_rmx_insn), CPU_386|CPU_SSE, NONE -cvtss2sd, cvt_xmm_xmm32_insn, (0xF35AUL<<8)|NELEMS(cvt_xmm_xmm32_insn), CPU_SSE2, NONE -cvtss2si, cvt_rx_xmm32_insn, (0xF32DUL<<8)|NELEMS(cvt_rx_xmm32_insn), CPU_386|CPU_SSE, NONE -cvttpd2dq, ssess_insn, (0x66E6UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -cvttpd2pi, cvt_mm_xmm_insn, (0x662CUL<<8)|NELEMS(cvt_mm_xmm_insn), CPU_SSE2, NONE -cvttps2dq, ssess_insn, (0xF35BUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -cvttps2pi, cvt_mm_xmm64_insn, (0x2CUL<<8)|NELEMS(cvt_mm_xmm64_insn), CPU_SSE, NONE -cvttsd2si, cvt_rx_xmm64_insn, (0xF22CUL<<8)|NELEMS(cvt_rx_xmm64_insn), CPU_SSE2, NONE -cvttss2si, cvt_rx_xmm32_insn, (0xF32CUL<<8)|NELEMS(cvt_rx_xmm32_insn), CPU_386|CPU_SSE, NONE -cwd, onebyte_insn, (0x001099UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -cwde, onebyte_insn, (0x002098UL<<8)|NELEMS(onebyte_insn), CPU_386, NONE -daa, onebyte_insn, (0x000027UL<<8)|NELEMS(onebyte_insn), CPU_Not64, NONE -das, onebyte_insn, (0x00002FUL<<8)|NELEMS(onebyte_insn), CPU_Not64, NONE -dec, incdec_insn, (0x0148UL<<8)|NELEMS(incdec_insn), CPU_Any, NONE -div, div_insn, (0x06UL<<8)|NELEMS(div_insn), CPU_Any, NONE -divpd, ssess_insn, (0x665EUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -divps, sseps_insn, (0x5EUL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE -divsd, ssess_insn, (0xF25EUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -divss, ssess_insn, (0xF35EUL<<8)|NELEMS(ssess_insn), CPU_SSE, NONE -dppd, sse4imm_insn, (0x41UL<<8)|NELEMS(sse4imm_insn), CPU_SSE41, NONE -dpps, sse4imm_insn, (0x40UL<<8)|NELEMS(sse4imm_insn), CPU_SSE41, NONE -emms, twobyte_insn, (0x0F77UL<<8)|NELEMS(twobyte_insn), CPU_MMX, NONE -enter, enter_insn, (0UL<<8)|NELEMS(enter_insn), CPU_186, NONE -extractps, extractps_insn, (0UL<<8)|NELEMS(extractps_insn), CPU_386|CPU_SSE41, NONE -extrq, extrq_insn, (0UL<<8)|NELEMS(extrq_insn), CPU_SSE41, NONE -f2xm1, twobyte_insn, (0xD9F0UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fabs, twobyte_insn, (0xD9E1UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fadd, farith_insn, (0x00C0C0UL<<8)|NELEMS(farith_insn), CPU_FPU, NONE -faddp, farithp_insn, (0xC0UL<<8)|NELEMS(farithp_insn), CPU_FPU, NONE -fbld, fbldstp_insn, (0x04UL<<8)|NELEMS(fbldstp_insn), CPU_FPU, NONE -fbstp, fbldstp_insn, (0x06UL<<8)|NELEMS(fbldstp_insn), CPU_FPU, NONE -fchs, twobyte_insn, (0xD9E0UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fclex, threebyte_insn, (0x9BDBE2UL<<8)|NELEMS(threebyte_insn), CPU_FPU, NONE -fcmovb, fcmovcc_insn, (0xDAC0UL<<8)|NELEMS(fcmovcc_insn), CPU_686|CPU_FPU, NONE -fcmovbe, fcmovcc_insn, (0xDAD0UL<<8)|NELEMS(fcmovcc_insn), CPU_686|CPU_FPU, NONE -fcmove, fcmovcc_insn, (0xDAC8UL<<8)|NELEMS(fcmovcc_insn), CPU_686|CPU_FPU, NONE -fcmovnb, fcmovcc_insn, (0xDBC0UL<<8)|NELEMS(fcmovcc_insn), CPU_686|CPU_FPU, NONE -fcmovnbe, fcmovcc_insn, (0xDBD0UL<<8)|NELEMS(fcmovcc_insn), CPU_686|CPU_FPU, NONE -fcmovne, fcmovcc_insn, (0xDBC8UL<<8)|NELEMS(fcmovcc_insn), CPU_686|CPU_FPU, NONE -fcmovnu, fcmovcc_insn, (0xDBD8UL<<8)|NELEMS(fcmovcc_insn), CPU_686|CPU_FPU, NONE -fcmovu, fcmovcc_insn, (0xDAD8UL<<8)|NELEMS(fcmovcc_insn), CPU_686|CPU_FPU, NONE -fcom, fcom_insn, (0x02D0UL<<8)|NELEMS(fcom_insn), CPU_FPU, NONE -fcomi, fcom2_insn, (0xDBF0UL<<8)|NELEMS(fcom2_insn), CPU_686|CPU_FPU, NONE -fcomip, fcom2_insn, (0xDFF0UL<<8)|NELEMS(fcom2_insn), CPU_686|CPU_FPU, NONE -fcomp, fcom_insn, (0x03D8UL<<8)|NELEMS(fcom_insn), CPU_FPU, NONE -fcompp, twobyte_insn, (0xDED9UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fcos, twobyte_insn, (0xD9FFUL<<8)|NELEMS(twobyte_insn), CPU_286|CPU_FPU, NONE -fdecstp, twobyte_insn, (0xD9F6UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fdiv, farith_insn, (0x06F0F8UL<<8)|NELEMS(farith_insn), CPU_FPU, NONE -fdivp, farithp_insn, (0xF8UL<<8)|NELEMS(farithp_insn), CPU_FPU, NONE -fdivr, farith_insn, (0x07F8F0UL<<8)|NELEMS(farith_insn), CPU_FPU, NONE -fdivrp, farithp_insn, (0xF0UL<<8)|NELEMS(farithp_insn), CPU_FPU, NONE -femms, twobyte_insn, (0x0F0EUL<<8)|NELEMS(twobyte_insn), CPU_3DNow, NONE -ffree, ffree_insn, (0xDDUL<<8)|NELEMS(ffree_insn), CPU_FPU, NONE -ffreep, ffree_insn, (0xDFUL<<8)|NELEMS(ffree_insn), CPU_686|CPU_FPU|CPU_Undoc, NONE -fiadd, fiarith_insn, (0x00DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, NONE -ficom, fiarith_insn, (0x02DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, NONE -ficomp, fiarith_insn, (0x03DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, NONE -fidiv, fiarith_insn, (0x06DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, NONE -fidivr, fiarith_insn, (0x07DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, NONE -fild, fildstp_insn, (0x050200UL<<8)|NELEMS(fildstp_insn), CPU_FPU, NONE -fimul, fiarith_insn, (0x01DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, NONE -fincstp, twobyte_insn, (0xD9F7UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -finit, threebyte_insn, (0x9BDBE3UL<<8)|NELEMS(threebyte_insn), CPU_FPU, NONE -fist, fiarith_insn, (0x02DBUL<<8)|NELEMS(fiarith_insn), CPU_FPU, NONE -fistp, fildstp_insn, (0x070203UL<<8)|NELEMS(fildstp_insn), CPU_FPU, NONE -fisttp, fildstp_insn, (0x010001UL<<8)|NELEMS(fildstp_insn), CPU_SSE3, NONE -fisub, fiarith_insn, (0x04DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, NONE -fisubr, fiarith_insn, (0x05DAUL<<8)|NELEMS(fiarith_insn), CPU_FPU, NONE -fld, fld_insn, (0UL<<8)|NELEMS(fld_insn), CPU_FPU, NONE -fld1, twobyte_insn, (0xD9E8UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fldcw, fldnstcw_insn, (0x05UL<<8)|NELEMS(fldnstcw_insn), CPU_FPU, NONE -fldenv, onebytemem_insn, (0x04D9UL<<8)|NELEMS(onebytemem_insn), CPU_FPU, NONE -fldl2e, twobyte_insn, (0xD9EAUL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fldl2t, twobyte_insn, (0xD9E9UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fldlg2, twobyte_insn, (0xD9ECUL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fldln2, twobyte_insn, (0xD9EDUL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fldpi, twobyte_insn, (0xD9EBUL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fldz, twobyte_insn, (0xD9EEUL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fmul, farith_insn, (0x01C8C8UL<<8)|NELEMS(farith_insn), CPU_FPU, NONE -fmulp, farithp_insn, (0xC8UL<<8)|NELEMS(farithp_insn), CPU_FPU, NONE -fnclex, twobyte_insn, (0xDBE2UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fninit, twobyte_insn, (0xDBE3UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fnop, twobyte_insn, (0xD9D0UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fnsave, onebytemem_insn, (0x06DDUL<<8)|NELEMS(onebytemem_insn), CPU_FPU, NONE -fnstcw, fldnstcw_insn, (0x07UL<<8)|NELEMS(fldnstcw_insn), CPU_FPU, NONE -fnstenv, onebytemem_insn, (0x06D9UL<<8)|NELEMS(onebytemem_insn), CPU_FPU, NONE -fnstsw, fnstsw_insn, (0UL<<8)|NELEMS(fnstsw_insn), CPU_FPU, NONE -fpatan, twobyte_insn, (0xD9F3UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fprem, twobyte_insn, (0xD9F8UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fprem1, twobyte_insn, (0xD9F5UL<<8)|NELEMS(twobyte_insn), CPU_286|CPU_FPU, NONE -fptan, twobyte_insn, (0xD9F2UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -frndint, twobyte_insn, (0xD9FCUL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -frstor, onebytemem_insn, (0x04DDUL<<8)|NELEMS(onebytemem_insn), CPU_FPU, NONE -fsave, twobytemem_insn, (0x069BDDUL<<8)|NELEMS(twobytemem_insn), CPU_FPU, NONE -fscale, twobyte_insn, (0xD9FDUL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fsetpm, twobyte_insn, (0xDBE4UL<<8)|NELEMS(twobyte_insn), CPU_286|CPU_FPU|CPU_Obs, NONE -fsin, twobyte_insn, (0xD9FEUL<<8)|NELEMS(twobyte_insn), CPU_286|CPU_FPU, NONE -fsincos, twobyte_insn, (0xD9FBUL<<8)|NELEMS(twobyte_insn), CPU_286|CPU_FPU, NONE -fsqrt, twobyte_insn, (0xD9FAUL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fst, fst_insn, (0UL<<8)|NELEMS(fst_insn), CPU_FPU, NONE -fstcw, fstcw_insn, (0UL<<8)|NELEMS(fstcw_insn), CPU_FPU, NONE -fstenv, twobytemem_insn, (0x069BD9UL<<8)|NELEMS(twobytemem_insn), CPU_FPU, NONE -fstp, fstp_insn, (0UL<<8)|NELEMS(fstp_insn), CPU_FPU, NONE -fstsw, fstsw_insn, (0UL<<8)|NELEMS(fstsw_insn), CPU_FPU, NONE -fsub, farith_insn, (0x04E0E8UL<<8)|NELEMS(farith_insn), CPU_FPU, NONE -fsubp, farithp_insn, (0xE8UL<<8)|NELEMS(farithp_insn), CPU_FPU, NONE -fsubr, farith_insn, (0x05E8E0UL<<8)|NELEMS(farith_insn), CPU_FPU, NONE -fsubrp, farithp_insn, (0xE0UL<<8)|NELEMS(farithp_insn), CPU_FPU, NONE -ftst, twobyte_insn, (0xD9E4UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fucom, fcom2_insn, (0xDDE0UL<<8)|NELEMS(fcom2_insn), CPU_286|CPU_FPU, NONE -fucomi, fcom2_insn, (0xDBE8UL<<8)|NELEMS(fcom2_insn), CPU_686|CPU_FPU, NONE -fucomip, fcom2_insn, (0xDFE8UL<<8)|NELEMS(fcom2_insn), CPU_686|CPU_FPU, NONE -fucomp, fcom2_insn, (0xDDE8UL<<8)|NELEMS(fcom2_insn), CPU_286|CPU_FPU, NONE -fucompp, twobyte_insn, (0xDAE9UL<<8)|NELEMS(twobyte_insn), CPU_286|CPU_FPU, NONE -fwait, onebyte_insn, (0x00009BUL<<8)|NELEMS(onebyte_insn), CPU_FPU, NONE -fxam, twobyte_insn, (0xD9E5UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fxch, fxch_insn, (0UL<<8)|NELEMS(fxch_insn), CPU_FPU, NONE -fxrstor, twobytemem_insn, (0x010FAEUL<<8)|NELEMS(twobytemem_insn), CPU_686|CPU_FPU, NONE -fxsave, twobytemem_insn, (0x000FAEUL<<8)|NELEMS(twobytemem_insn), CPU_686|CPU_FPU, NONE -fxtract, twobyte_insn, (0xD9F4UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fyl2x, twobyte_insn, (0xD9F1UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -fyl2xp1, twobyte_insn, (0xD9F9UL<<8)|NELEMS(twobyte_insn), CPU_FPU, NONE -haddpd, ssess_insn, (0x667CUL<<8)|NELEMS(ssess_insn), CPU_SSE3, NONE -haddps, ssess_insn, (0xF27CUL<<8)|NELEMS(ssess_insn), CPU_SSE3, NONE -hlt, onebyte_insn, (0x0000F4UL<<8)|NELEMS(onebyte_insn), CPU_Priv, NONE -hsubpd, ssess_insn, (0x667DUL<<8)|NELEMS(ssess_insn), CPU_SSE3, NONE -hsubps, ssess_insn, (0xF27DUL<<8)|NELEMS(ssess_insn), CPU_SSE3, NONE -ibts, ibts_insn, (0UL<<8)|NELEMS(ibts_insn), CPU_386|CPU_Obs|CPU_Undoc, NONE -idiv, div_insn, (0x07UL<<8)|NELEMS(div_insn), CPU_Any, NONE -imul, imul_insn, (0UL<<8)|NELEMS(imul_insn), CPU_Any, NONE -in, in_insn, (0UL<<8)|NELEMS(in_insn), CPU_Any, NONE -inc, incdec_insn, (0x0040UL<<8)|NELEMS(incdec_insn), CPU_Any, NONE -insb, onebyte_insn, (0x00006CUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -insd, onebyte_insn, (0x00206DUL<<8)|NELEMS(onebyte_insn), CPU_386, NONE -insertps, insertps_insn, (0UL<<8)|NELEMS(insertps_insn), CPU_SSE41, NONE -insertq, insertq_insn, (0UL<<8)|NELEMS(insertq_insn), CPU_SSE41, NONE -insw, onebyte_insn, (0x00106DUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -int, int_insn, (0UL<<8)|NELEMS(int_insn), CPU_Any, NONE -int03, onebyte_insn, (0x0000CCUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -int3, onebyte_insn, (0x0000CCUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -into, onebyte_insn, (0x0000CEUL<<8)|NELEMS(onebyte_insn), CPU_Not64, NONE -invd, twobyte_insn, (0x0F08UL<<8)|NELEMS(twobyte_insn), CPU_486|CPU_Priv, NONE -invlpg, twobytemem_insn, (0x070F01UL<<8)|NELEMS(twobytemem_insn), CPU_486|CPU_Priv, NONE -invlpga, invlpga_insn, (0UL<<8)|NELEMS(invlpga_insn), CPU_SVM, NONE -iret, onebyte_insn, (0x0000CFUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -iretd, onebyte_insn, (0x0020CFUL<<8)|NELEMS(onebyte_insn), CPU_386, NONE -iretq, onebyte_insn, (0x0040CFUL<<8)|NELEMS(onebyte_insn), CPU_64, NONE -iretw, onebyte_insn, (0x0010CFUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -ja, jcc_insn, (0x07UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jae, jcc_insn, (0x03UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jb, jcc_insn, (0x02UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jbe, jcc_insn, (0x06UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jc, jcc_insn, (0x02UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jcxz, jcxz_insn, (0x10UL<<8)|NELEMS(jcxz_insn), CPU_Any, NONE -je, jcc_insn, (0x04UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jecxz, jcxz_insn, (0x20UL<<8)|NELEMS(jcxz_insn), CPU_386, NONE -jg, jcc_insn, (0x0FUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jge, jcc_insn, (0x0DUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jl, jcc_insn, (0x0CUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jle, jcc_insn, (0x0EUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jmp, jmp_insn, (0UL<<8)|NELEMS(jmp_insn), CPU_Any, NONE -jna, jcc_insn, (0x06UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jnae, jcc_insn, (0x02UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jnb, jcc_insn, (0x03UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jnbe, jcc_insn, (0x07UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jnc, jcc_insn, (0x03UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jne, jcc_insn, (0x05UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jng, jcc_insn, (0x0EUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jnge, jcc_insn, (0x0CUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jnl, jcc_insn, (0x0DUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jnle, jcc_insn, (0x0FUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jno, jcc_insn, (0x01UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jnp, jcc_insn, (0x0BUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jns, jcc_insn, (0x09UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jnz, jcc_insn, (0x05UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jo, jcc_insn, (0x00UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jp, jcc_insn, (0x0AUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jpe, jcc_insn, (0x0AUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jpo, jcc_insn, (0x0BUL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jrcxz, jcxz_insn, (0x40UL<<8)|NELEMS(jcxz_insn), CPU_64, NONE -js, jcc_insn, (0x08UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -jz, jcc_insn, (0x04UL<<8)|NELEMS(jcc_insn), CPU_Any, NONE -lahf, onebyte_insn, (0x00009FUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -lar, bsfr_insn, (0x02UL<<8)|NELEMS(bsfr_insn), CPU_286|CPU_Prot, NONE -lddqu, lddqu_insn, (0UL<<8)|NELEMS(lddqu_insn), CPU_SSE3, NONE -ldmxcsr, ldstmxcsr_insn, (0x02UL<<8)|NELEMS(ldstmxcsr_insn), CPU_SSE, NONE -lds, ldes_insn, (0xC5UL<<8)|NELEMS(ldes_insn), CPU_Not64, NONE -lea, lea_insn, (0UL<<8)|NELEMS(lea_insn), CPU_Any, NONE -leave, onebyte_insn, (0x4000C9UL<<8)|NELEMS(onebyte_insn), CPU_186, NONE -les, ldes_insn, (0xC4UL<<8)|NELEMS(ldes_insn), CPU_Not64, NONE -lfence, threebyte_insn, (0x0FAEE8UL<<8)|NELEMS(threebyte_insn), CPU_P3, NONE -lfs, lfgss_insn, (0xB4UL<<8)|NELEMS(lfgss_insn), CPU_386, NONE -lgdt, twobytemem_insn, (0x020F01UL<<8)|NELEMS(twobytemem_insn), CPU_286|CPU_Priv, NONE -lgs, lfgss_insn, (0xB5UL<<8)|NELEMS(lfgss_insn), CPU_386, NONE -lidt, twobytemem_insn, (0x030F01UL<<8)|NELEMS(twobytemem_insn), CPU_286|CPU_Priv, NONE -lldt, prot286_insn, (0x0200UL<<8)|NELEMS(prot286_insn), CPU_286|CPU_Priv|CPU_Prot, NONE -lmsw, prot286_insn, (0x0601UL<<8)|NELEMS(prot286_insn), CPU_286|CPU_Priv, NONE -loadall, twobyte_insn, (0x0F07UL<<8)|NELEMS(twobyte_insn), CPU_386|CPU_Undoc, NONE -loadall286, twobyte_insn, (0x0F05UL<<8)|NELEMS(twobyte_insn), CPU_286|CPU_Undoc, NONE +aaa, onebyte_insn, (0x000037UL<<8)|1, CPU_Not64, NONE +aad, aadm_insn, (0x01UL<<8)|2, CPU_Not64, NONE +aam, aadm_insn, (0x00UL<<8)|2, CPU_Not64, NONE +aas, onebyte_insn, (0x00003FUL<<8)|1, CPU_Not64, NONE +adc, arith_insn, (0x0210UL<<8)|22, CPU_Any, NONE +add, arith_insn, (0x0000UL<<8)|22, CPU_Any, NONE +addpd, ssess_insn, (0x6658UL<<8)|1, CPU_SSE2, NONE +addps, sseps_insn, (0x58UL<<8)|1, CPU_SSE, NONE +addsd, ssess_insn, (0xF258UL<<8)|1, CPU_SSE2, NONE +addss, ssess_insn, (0xF358UL<<8)|1, CPU_SSE, NONE +addsubpd, ssess_insn, (0x66D0UL<<8)|1, CPU_SSE3, NONE +addsubps, ssess_insn, (0xF2D0UL<<8)|1, CPU_SSE3, NONE +and, arith_insn, (0x0420UL<<8)|22, CPU_Any, NONE +andnpd, ssess_insn, (0x6655UL<<8)|1, CPU_SSE2, NONE +andnps, sseps_insn, (0x55UL<<8)|1, CPU_SSE, NONE +andpd, ssess_insn, (0x6654UL<<8)|1, CPU_SSE2, NONE +andps, sseps_insn, (0x54UL<<8)|1, CPU_SSE, NONE +arpl, arpl_insn, (0UL<<8)|1, CPU_286|CPU_Not64|CPU_Prot, NONE +blendpd, sse4imm_insn, (0x0DUL<<8)|1, CPU_SSE41, NONE +blendps, sse4imm_insn, (0x0CUL<<8)|1, CPU_SSE41, NONE +blendvpd, sse4xmm0_insn, (0x15UL<<8)|2, CPU_SSE41, NONE +blendvps, sse4xmm0_insn, (0x14UL<<8)|2, CPU_SSE41, NONE +bound, bound_insn, (0UL<<8)|2, CPU_186|CPU_Not64, NONE +bsf, bsfr_insn, (0xBCUL<<8)|3, CPU_386, NONE +bsr, bsfr_insn, (0xBDUL<<8)|3, CPU_386, NONE +bswap, bswap_insn, (0UL<<8)|2, CPU_486, NONE +bt, bittest_insn, (0x04A3UL<<8)|6, CPU_386, NONE +btc, bittest_insn, (0x07BBUL<<8)|6, CPU_386, NONE +btr, bittest_insn, (0x06B3UL<<8)|6, CPU_386, NONE +bts, bittest_insn, (0x05ABUL<<8)|6, CPU_386, NONE +call, call_insn, (0UL<<8)|26, CPU_Any, NONE +cbw, onebyte_insn, (0x001098UL<<8)|1, CPU_Any, NONE +cdq, onebyte_insn, (0x002099UL<<8)|1, CPU_386, NONE +cdqe, onebyte_insn, (0x004098UL<<8)|1, CPU_64, NONE +clc, onebyte_insn, (0x0000F8UL<<8)|1, CPU_Any, NONE +cld, onebyte_insn, (0x0000FCUL<<8)|1, CPU_Any, NONE +clflush, clflush_insn, (0UL<<8)|1, CPU_P3, NONE +clgi, threebyte_insn, (0x0F01DDUL<<8)|1, CPU_SVM, NONE +cli, onebyte_insn, (0x0000FAUL<<8)|1, CPU_Any, NONE +clts, twobyte_insn, (0x0F06UL<<8)|1, CPU_286|CPU_Priv, NONE +cmc, onebyte_insn, (0x0000F5UL<<8)|1, CPU_Any, NONE +cmova, cmovcc_insn, (0x07UL<<8)|3, CPU_686, NONE +cmovae, cmovcc_insn, (0x03UL<<8)|3, CPU_686, NONE +cmovb, cmovcc_insn, (0x02UL<<8)|3, CPU_686, NONE +cmovbe, cmovcc_insn, (0x06UL<<8)|3, CPU_686, NONE +cmovc, cmovcc_insn, (0x02UL<<8)|3, CPU_686, NONE +cmove, cmovcc_insn, (0x04UL<<8)|3, CPU_686, NONE +cmovg, cmovcc_insn, (0x0FUL<<8)|3, CPU_686, NONE +cmovge, cmovcc_insn, (0x0DUL<<8)|3, CPU_686, NONE +cmovl, cmovcc_insn, (0x0CUL<<8)|3, CPU_686, NONE +cmovle, cmovcc_insn, (0x0EUL<<8)|3, CPU_686, NONE +cmovna, cmovcc_insn, (0x06UL<<8)|3, CPU_686, NONE +cmovnae, cmovcc_insn, (0x02UL<<8)|3, CPU_686, NONE +cmovnb, cmovcc_insn, (0x03UL<<8)|3, CPU_686, NONE +cmovnbe, cmovcc_insn, (0x07UL<<8)|3, CPU_686, NONE +cmovnc, cmovcc_insn, (0x03UL<<8)|3, CPU_686, NONE +cmovne, cmovcc_insn, (0x05UL<<8)|3, CPU_686, NONE +cmovng, cmovcc_insn, (0x0EUL<<8)|3, CPU_686, NONE +cmovnge, cmovcc_insn, (0x0CUL<<8)|3, CPU_686, NONE +cmovnl, cmovcc_insn, (0x0DUL<<8)|3, CPU_686, NONE +cmovnle, cmovcc_insn, (0x0FUL<<8)|3, CPU_686, NONE +cmovno, cmovcc_insn, (0x01UL<<8)|3, CPU_686, NONE +cmovnp, cmovcc_insn, (0x0BUL<<8)|3, CPU_686, NONE +cmovns, cmovcc_insn, (0x09UL<<8)|3, CPU_686, NONE +cmovnz, cmovcc_insn, (0x05UL<<8)|3, CPU_686, NONE +cmovo, cmovcc_insn, (0x00UL<<8)|3, CPU_686, NONE +cmovp, cmovcc_insn, (0x0AUL<<8)|3, CPU_686, NONE +cmovpe, cmovcc_insn, (0x0AUL<<8)|3, CPU_686, NONE +cmovpo, cmovcc_insn, (0x0BUL<<8)|3, CPU_686, NONE +cmovs, cmovcc_insn, (0x08UL<<8)|3, CPU_686, NONE +cmovz, cmovcc_insn, (0x04UL<<8)|3, CPU_686, NONE +cmp, arith_insn, (0x0738UL<<8)|22, CPU_Any, NONE +cmpeqpd, ssecmpss_insn, (0x0066UL<<8)|1, CPU_SSE2, NONE +cmpeqps, ssecmpps_insn, (0x00UL<<8)|1, CPU_SSE, NONE +cmpeqsd, ssecmpss_insn, (0x00F2UL<<8)|1, CPU_SSE2, NONE +cmpeqss, ssecmpss_insn, (0x00F3UL<<8)|1, CPU_SSE, NONE +cmplepd, ssecmpss_insn, (0x0266UL<<8)|1, CPU_SSE2, NONE +cmpleps, ssecmpps_insn, (0x02UL<<8)|1, CPU_SSE, NONE +cmplesd, ssecmpss_insn, (0x02F2UL<<8)|1, CPU_SSE2, NONE +cmpless, ssecmpss_insn, (0x02F3UL<<8)|1, CPU_SSE, NONE +cmpltpd, ssecmpss_insn, (0x0166UL<<8)|1, CPU_SSE2, NONE +cmpltps, ssecmpps_insn, (0x01UL<<8)|1, CPU_SSE, NONE +cmpltsd, ssecmpss_insn, (0x01F2UL<<8)|1, CPU_SSE2, NONE +cmpltss, ssecmpss_insn, (0x01F3UL<<8)|1, CPU_SSE, NONE +cmpneqpd, ssecmpss_insn, (0x0466UL<<8)|1, CPU_SSE2, NONE +cmpneqps, ssecmpps_insn, (0x04UL<<8)|1, CPU_SSE, NONE +cmpneqsd, ssecmpss_insn, (0x04F2UL<<8)|1, CPU_SSE2, NONE +cmpneqss, ssecmpss_insn, (0x04F3UL<<8)|1, CPU_SSE, NONE +cmpnlepd, ssecmpss_insn, (0x0666UL<<8)|1, CPU_SSE2, NONE +cmpnleps, ssecmpps_insn, (0x06UL<<8)|1, CPU_SSE, NONE +cmpnlesd, ssecmpss_insn, (0x06F2UL<<8)|1, CPU_SSE2, NONE +cmpnless, ssecmpss_insn, (0x06F3UL<<8)|1, CPU_SSE, NONE +cmpnltpd, ssecmpss_insn, (0x0566UL<<8)|1, CPU_SSE2, NONE +cmpnltps, ssecmpps_insn, (0x05UL<<8)|1, CPU_SSE, NONE +cmpnltsd, ssecmpss_insn, (0x05F2UL<<8)|1, CPU_SSE2, NONE +cmpnltss, ssecmpss_insn, (0x05F3UL<<8)|1, CPU_SSE, NONE +cmpordpd, ssecmpss_insn, (0x0766UL<<8)|1, CPU_SSE2, NONE +cmpordps, ssecmpps_insn, (0x07UL<<8)|1, CPU_SSE, NONE +cmpordsd, ssecmpss_insn, (0x07F2UL<<8)|1, CPU_SSE2, NONE +cmpordss, ssecmpss_insn, (0x07F3UL<<8)|1, CPU_SSE, NONE +cmppd, ssessimm_insn, (0x66C2UL<<8)|1, CPU_SSE2, NONE +cmpps, ssepsimm_insn, (0xC2UL<<8)|1, CPU_SSE, NONE +cmpsb, onebyte_insn, (0x0000A6UL<<8)|1, CPU_Any, NONE +cmpsd, cmpsd_insn, (0UL<<8)|2, CPU_Any, NONE +cmpsq, onebyte_insn, (0x0040A7UL<<8)|1, CPU_64, NONE +cmpss, ssessimm_insn, (0xF3C2UL<<8)|1, CPU_SSE, NONE +cmpsw, onebyte_insn, (0x0010A7UL<<8)|1, CPU_Any, NONE +cmpunordpd, ssecmpss_insn, (0x0366UL<<8)|1, CPU_SSE2, NONE +cmpunordps, ssecmpps_insn, (0x03UL<<8)|1, CPU_SSE, NONE +cmpunordsd, ssecmpss_insn, (0x03F2UL<<8)|1, CPU_SSE2, NONE +cmpunordss, ssecmpss_insn, (0x03F3UL<<8)|1, CPU_SSE, NONE +cmpxchg, cmpxchgxadd_insn, (0xB0UL<<8)|4, CPU_486, NONE +cmpxchg16b, cmpxchg16b_insn, (0UL<<8)|1, CPU_64, NONE +cmpxchg486, cmpxchgxadd_insn, (0xA6UL<<8)|4, CPU_486|CPU_Undoc, NONE +cmpxchg8b, cmpxchg8b_insn, (0UL<<8)|1, CPU_586, NONE +comisd, ssess_insn, (0x662FUL<<8)|1, CPU_SSE2, NONE +comiss, sseps_insn, (0x2FUL<<8)|1, CPU_SSE, NONE +cpuid, twobyte_insn, (0x0FA2UL<<8)|1, CPU_486, NONE +cqo, onebyte_insn, (0x004099UL<<8)|1, CPU_64, NONE +crc32, crc32_insn, (0UL<<8)|5, CPU_386|CPU_SSE42, NONE +cvtdq2pd, cvt_xmm_xmm64_ss_insn, (0xF3E6UL<<8)|2, CPU_SSE2, NONE +cvtdq2ps, sseps_insn, (0x5BUL<<8)|1, CPU_SSE2, NONE +cvtpd2dq, ssess_insn, (0xF2E6UL<<8)|1, CPU_SSE2, NONE +cvtpd2pi, cvt_mm_xmm_insn, (0x662DUL<<8)|1, CPU_SSE2, NONE +cvtpd2ps, ssess_insn, (0x665AUL<<8)|1, CPU_SSE2, NONE +cvtpi2pd, cvt_xmm_mm_ss_insn, (0x662AUL<<8)|1, CPU_SSE2, NONE +cvtpi2ps, cvt_xmm_mm_ps_insn, (0x2AUL<<8)|1, CPU_SSE, NONE +cvtps2dq, ssess_insn, (0x665BUL<<8)|1, CPU_SSE2, NONE +cvtps2pd, cvt_xmm_xmm64_ps_insn, (0x5AUL<<8)|2, CPU_SSE2, NONE +cvtps2pi, cvt_mm_xmm64_insn, (0x2DUL<<8)|2, CPU_SSE, NONE +cvtsd2si, cvt_rx_xmm64_insn, (0xF22DUL<<8)|4, CPU_386|CPU_SSE2, NONE +cvtsd2ss, cvt_xmm_xmm64_ss_insn, (0xF25AUL<<8)|2, CPU_SSE2, NONE +cvtsi2sd, cvt_xmm_rmx_insn, (0xF22AUL<<8)|2, CPU_SSE2, NONE +cvtsi2ss, cvt_xmm_rmx_insn, (0xF32AUL<<8)|2, CPU_386|CPU_SSE, NONE +cvtss2sd, cvt_xmm_xmm32_insn, (0xF35AUL<<8)|2, CPU_SSE2, NONE +cvtss2si, cvt_rx_xmm32_insn, (0xF32DUL<<8)|4, CPU_386|CPU_SSE, NONE +cvttpd2dq, ssess_insn, (0x66E6UL<<8)|1, CPU_SSE2, NONE +cvttpd2pi, cvt_mm_xmm_insn, (0x662CUL<<8)|1, CPU_SSE2, NONE +cvttps2dq, ssess_insn, (0xF35BUL<<8)|1, CPU_SSE2, NONE +cvttps2pi, cvt_mm_xmm64_insn, (0x2CUL<<8)|2, CPU_SSE, NONE +cvttsd2si, cvt_rx_xmm64_insn, (0xF22CUL<<8)|4, CPU_SSE2, NONE +cvttss2si, cvt_rx_xmm32_insn, (0xF32CUL<<8)|4, CPU_386|CPU_SSE, NONE +cwd, onebyte_insn, (0x001099UL<<8)|1, CPU_Any, NONE +cwde, onebyte_insn, (0x002098UL<<8)|1, CPU_386, NONE +daa, onebyte_insn, (0x000027UL<<8)|1, CPU_Not64, NONE +das, onebyte_insn, (0x00002FUL<<8)|1, CPU_Not64, NONE +dec, incdec_insn, (0x0148UL<<8)|6, CPU_Any, NONE +div, div_insn, (0x06UL<<8)|8, CPU_Any, NONE +divpd, ssess_insn, (0x665EUL<<8)|1, CPU_SSE2, NONE +divps, sseps_insn, (0x5EUL<<8)|1, CPU_SSE, NONE +divsd, ssess_insn, (0xF25EUL<<8)|1, CPU_SSE2, NONE +divss, ssess_insn, (0xF35EUL<<8)|1, CPU_SSE, NONE +dppd, sse4imm_insn, (0x41UL<<8)|1, CPU_SSE41, NONE +dpps, sse4imm_insn, (0x40UL<<8)|1, CPU_SSE41, NONE +emms, twobyte_insn, (0x0F77UL<<8)|1, CPU_MMX, NONE +enter, enter_insn, (0UL<<8)|3, CPU_186, NONE +extractps, extractps_insn, (0UL<<8)|2, CPU_386|CPU_SSE41, NONE +extrq, extrq_insn, (0UL<<8)|2, CPU_SSE41, NONE +f2xm1, twobyte_insn, (0xD9F0UL<<8)|1, CPU_FPU, NONE +fabs, twobyte_insn, (0xD9E1UL<<8)|1, CPU_FPU, NONE +fadd, farith_insn, (0x00C0C0UL<<8)|7, CPU_FPU, NONE +faddp, farithp_insn, (0xC0UL<<8)|3, CPU_FPU, NONE +fbld, fbldstp_insn, (0x04UL<<8)|1, CPU_FPU, NONE +fbstp, fbldstp_insn, (0x06UL<<8)|1, CPU_FPU, NONE +fchs, twobyte_insn, (0xD9E0UL<<8)|1, CPU_FPU, NONE +fclex, threebyte_insn, (0x9BDBE2UL<<8)|1, CPU_FPU, NONE +fcmovb, fcmovcc_insn, (0xDAC0UL<<8)|1, CPU_686|CPU_FPU, NONE +fcmovbe, fcmovcc_insn, (0xDAD0UL<<8)|1, CPU_686|CPU_FPU, NONE +fcmove, fcmovcc_insn, (0xDAC8UL<<8)|1, CPU_686|CPU_FPU, NONE +fcmovnb, fcmovcc_insn, (0xDBC0UL<<8)|1, CPU_686|CPU_FPU, NONE +fcmovnbe, fcmovcc_insn, (0xDBD0UL<<8)|1, CPU_686|CPU_FPU, NONE +fcmovne, fcmovcc_insn, (0xDBC8UL<<8)|1, CPU_686|CPU_FPU, NONE +fcmovnu, fcmovcc_insn, (0xDBD8UL<<8)|1, CPU_686|CPU_FPU, NONE +fcmovu, fcmovcc_insn, (0xDAD8UL<<8)|1, CPU_686|CPU_FPU, NONE +fcom, fcom_insn, (0x02D0UL<<8)|5, CPU_FPU, NONE +fcomi, fcom2_insn, (0xDBF0UL<<8)|2, CPU_686|CPU_FPU, NONE +fcomip, fcom2_insn, (0xDFF0UL<<8)|2, CPU_686|CPU_FPU, NONE +fcomp, fcom_insn, (0x03D8UL<<8)|5, CPU_FPU, NONE +fcompp, twobyte_insn, (0xDED9UL<<8)|1, CPU_FPU, NONE +fcos, twobyte_insn, (0xD9FFUL<<8)|1, CPU_286|CPU_FPU, NONE +fdecstp, twobyte_insn, (0xD9F6UL<<8)|1, CPU_FPU, NONE +fdiv, farith_insn, (0x06F0F8UL<<8)|7, CPU_FPU, NONE +fdivp, farithp_insn, (0xF8UL<<8)|3, CPU_FPU, NONE +fdivr, farith_insn, (0x07F8F0UL<<8)|7, CPU_FPU, NONE +fdivrp, farithp_insn, (0xF0UL<<8)|3, CPU_FPU, NONE +femms, twobyte_insn, (0x0F0EUL<<8)|1, CPU_3DNow, NONE +ffree, ffree_insn, (0xDDUL<<8)|1, CPU_FPU, NONE +ffreep, ffree_insn, (0xDFUL<<8)|1, CPU_686|CPU_FPU|CPU_Undoc, NONE +fiadd, fiarith_insn, (0x00DAUL<<8)|2, CPU_FPU, NONE +ficom, fiarith_insn, (0x02DAUL<<8)|2, CPU_FPU, NONE +ficomp, fiarith_insn, (0x03DAUL<<8)|2, CPU_FPU, NONE +fidiv, fiarith_insn, (0x06DAUL<<8)|2, CPU_FPU, NONE +fidivr, fiarith_insn, (0x07DAUL<<8)|2, CPU_FPU, NONE +fild, fildstp_insn, (0x050200UL<<8)|3, CPU_FPU, NONE +fimul, fiarith_insn, (0x01DAUL<<8)|2, CPU_FPU, NONE +fincstp, twobyte_insn, (0xD9F7UL<<8)|1, CPU_FPU, NONE +finit, threebyte_insn, (0x9BDBE3UL<<8)|1, CPU_FPU, NONE +fist, fiarith_insn, (0x02DBUL<<8)|2, CPU_FPU, NONE +fistp, fildstp_insn, (0x070203UL<<8)|3, CPU_FPU, NONE +fisttp, fildstp_insn, (0x010001UL<<8)|3, CPU_SSE3, NONE +fisub, fiarith_insn, (0x04DAUL<<8)|2, CPU_FPU, NONE +fisubr, fiarith_insn, (0x05DAUL<<8)|2, CPU_FPU, NONE +fld, fld_insn, (0UL<<8)|4, CPU_FPU, NONE +fld1, twobyte_insn, (0xD9E8UL<<8)|1, CPU_FPU, NONE +fldcw, fldnstcw_insn, (0x05UL<<8)|1, CPU_FPU, NONE +fldenv, onebytemem_insn, (0x04D9UL<<8)|1, CPU_FPU, NONE +fldl2e, twobyte_insn, (0xD9EAUL<<8)|1, CPU_FPU, NONE +fldl2t, twobyte_insn, (0xD9E9UL<<8)|1, CPU_FPU, NONE +fldlg2, twobyte_insn, (0xD9ECUL<<8)|1, CPU_FPU, NONE +fldln2, twobyte_insn, (0xD9EDUL<<8)|1, CPU_FPU, NONE +fldpi, twobyte_insn, (0xD9EBUL<<8)|1, CPU_FPU, NONE +fldz, twobyte_insn, (0xD9EEUL<<8)|1, CPU_FPU, NONE +fmul, farith_insn, (0x01C8C8UL<<8)|7, CPU_FPU, NONE +fmulp, farithp_insn, (0xC8UL<<8)|3, CPU_FPU, NONE +fnclex, twobyte_insn, (0xDBE2UL<<8)|1, CPU_FPU, NONE +fninit, twobyte_insn, (0xDBE3UL<<8)|1, CPU_FPU, NONE +fnop, twobyte_insn, (0xD9D0UL<<8)|1, CPU_FPU, NONE +fnsave, onebytemem_insn, (0x06DDUL<<8)|1, CPU_FPU, NONE +fnstcw, fldnstcw_insn, (0x07UL<<8)|1, CPU_FPU, NONE +fnstenv, onebytemem_insn, (0x06D9UL<<8)|1, CPU_FPU, NONE +fnstsw, fnstsw_insn, (0UL<<8)|2, CPU_FPU, NONE +fpatan, twobyte_insn, (0xD9F3UL<<8)|1, CPU_FPU, NONE +fprem, twobyte_insn, (0xD9F8UL<<8)|1, CPU_FPU, NONE +fprem1, twobyte_insn, (0xD9F5UL<<8)|1, CPU_286|CPU_FPU, NONE +fptan, twobyte_insn, (0xD9F2UL<<8)|1, CPU_FPU, NONE +frndint, twobyte_insn, (0xD9FCUL<<8)|1, CPU_FPU, NONE +frstor, onebytemem_insn, (0x04DDUL<<8)|1, CPU_FPU, NONE +fsave, twobytemem_insn, (0x069BDDUL<<8)|1, CPU_FPU, NONE +fscale, twobyte_insn, (0xD9FDUL<<8)|1, CPU_FPU, NONE +fsetpm, twobyte_insn, (0xDBE4UL<<8)|1, CPU_286|CPU_FPU|CPU_Obs, NONE +fsin, twobyte_insn, (0xD9FEUL<<8)|1, CPU_286|CPU_FPU, NONE +fsincos, twobyte_insn, (0xD9FBUL<<8)|1, CPU_286|CPU_FPU, NONE +fsqrt, twobyte_insn, (0xD9FAUL<<8)|1, CPU_FPU, NONE +fst, fst_insn, (0UL<<8)|3, CPU_FPU, NONE +fstcw, fstcw_insn, (0UL<<8)|1, CPU_FPU, NONE +fstenv, twobytemem_insn, (0x069BD9UL<<8)|1, CPU_FPU, NONE +fstp, fstp_insn, (0UL<<8)|4, CPU_FPU, NONE +fstsw, fstsw_insn, (0UL<<8)|2, CPU_FPU, NONE +fsub, farith_insn, (0x04E0E8UL<<8)|7, CPU_FPU, NONE +fsubp, farithp_insn, (0xE8UL<<8)|3, CPU_FPU, NONE +fsubr, farith_insn, (0x05E8E0UL<<8)|7, CPU_FPU, NONE +fsubrp, farithp_insn, (0xE0UL<<8)|3, CPU_FPU, NONE +ftst, twobyte_insn, (0xD9E4UL<<8)|1, CPU_FPU, NONE +fucom, fcom2_insn, (0xDDE0UL<<8)|2, CPU_286|CPU_FPU, NONE +fucomi, fcom2_insn, (0xDBE8UL<<8)|2, CPU_686|CPU_FPU, NONE +fucomip, fcom2_insn, (0xDFE8UL<<8)|2, CPU_686|CPU_FPU, NONE +fucomp, fcom2_insn, (0xDDE8UL<<8)|2, CPU_286|CPU_FPU, NONE +fucompp, twobyte_insn, (0xDAE9UL<<8)|1, CPU_286|CPU_FPU, NONE +fwait, onebyte_insn, (0x00009BUL<<8)|1, CPU_FPU, NONE +fxam, twobyte_insn, (0xD9E5UL<<8)|1, CPU_FPU, NONE +fxch, fxch_insn, (0UL<<8)|4, CPU_FPU, NONE +fxrstor, twobytemem_insn, (0x010FAEUL<<8)|1, CPU_686|CPU_FPU, NONE +fxsave, twobytemem_insn, (0x000FAEUL<<8)|1, CPU_686|CPU_FPU, NONE +fxtract, twobyte_insn, (0xD9F4UL<<8)|1, CPU_FPU, NONE +fyl2x, twobyte_insn, (0xD9F1UL<<8)|1, CPU_FPU, NONE +fyl2xp1, twobyte_insn, (0xD9F9UL<<8)|1, CPU_FPU, NONE +haddpd, ssess_insn, (0x667CUL<<8)|1, CPU_SSE3, NONE +haddps, ssess_insn, (0xF27CUL<<8)|1, CPU_SSE3, NONE +hlt, onebyte_insn, (0x0000F4UL<<8)|1, CPU_Priv, NONE +hsubpd, ssess_insn, (0x667DUL<<8)|1, CPU_SSE3, NONE +hsubps, ssess_insn, (0xF27DUL<<8)|1, CPU_SSE3, NONE +ibts, ibts_insn, (0UL<<8)|2, CPU_386|CPU_Obs|CPU_Undoc, NONE +idiv, div_insn, (0x07UL<<8)|8, CPU_Any, NONE +imul, imul_insn, (0UL<<8)|19, CPU_Any, NONE +in, in_insn, (0UL<<8)|12, CPU_Any, NONE +inc, incdec_insn, (0x0040UL<<8)|6, CPU_Any, NONE +insb, onebyte_insn, (0x00006CUL<<8)|1, CPU_Any, NONE +insd, onebyte_insn, (0x00206DUL<<8)|1, CPU_386, NONE +insertps, insertps_insn, (0UL<<8)|2, CPU_SSE41, NONE +insertq, insertq_insn, (0UL<<8)|2, CPU_SSE41, NONE +insw, onebyte_insn, (0x00106DUL<<8)|1, CPU_Any, NONE +int, int_insn, (0UL<<8)|1, CPU_Any, NONE +int03, onebyte_insn, (0x0000CCUL<<8)|1, CPU_Any, NONE +int3, onebyte_insn, (0x0000CCUL<<8)|1, CPU_Any, NONE +into, onebyte_insn, (0x0000CEUL<<8)|1, CPU_Not64, NONE +invd, twobyte_insn, (0x0F08UL<<8)|1, CPU_486|CPU_Priv, NONE +invlpg, twobytemem_insn, (0x070F01UL<<8)|1, CPU_486|CPU_Priv, NONE +invlpga, invlpga_insn, (0UL<<8)|2, CPU_SVM, NONE +iret, onebyte_insn, (0x0000CFUL<<8)|1, CPU_Any, NONE +iretd, onebyte_insn, (0x0020CFUL<<8)|1, CPU_386, NONE +iretq, onebyte_insn, (0x0040CFUL<<8)|1, CPU_64, NONE +iretw, onebyte_insn, (0x0010CFUL<<8)|1, CPU_Any, NONE +ja, jcc_insn, (0x07UL<<8)|9, CPU_Any, NONE +jae, jcc_insn, (0x03UL<<8)|9, CPU_Any, NONE +jb, jcc_insn, (0x02UL<<8)|9, CPU_Any, NONE +jbe, jcc_insn, (0x06UL<<8)|9, CPU_Any, NONE +jc, jcc_insn, (0x02UL<<8)|9, CPU_Any, NONE +jcxz, jcxz_insn, (0x10UL<<8)|2, CPU_Any, NONE +je, jcc_insn, (0x04UL<<8)|9, CPU_Any, NONE +jecxz, jcxz_insn, (0x20UL<<8)|2, CPU_386, NONE +jg, jcc_insn, (0x0FUL<<8)|9, CPU_Any, NONE +jge, jcc_insn, (0x0DUL<<8)|9, CPU_Any, NONE +jl, jcc_insn, (0x0CUL<<8)|9, CPU_Any, NONE +jle, jcc_insn, (0x0EUL<<8)|9, CPU_Any, NONE +jmp, jmp_insn, (0UL<<8)|27, CPU_Any, NONE +jna, jcc_insn, (0x06UL<<8)|9, CPU_Any, NONE +jnae, jcc_insn, (0x02UL<<8)|9, CPU_Any, NONE +jnb, jcc_insn, (0x03UL<<8)|9, CPU_Any, NONE +jnbe, jcc_insn, (0x07UL<<8)|9, CPU_Any, NONE +jnc, jcc_insn, (0x03UL<<8)|9, CPU_Any, NONE +jne, jcc_insn, (0x05UL<<8)|9, CPU_Any, NONE +jng, jcc_insn, (0x0EUL<<8)|9, CPU_Any, NONE +jnge, jcc_insn, (0x0CUL<<8)|9, CPU_Any, NONE +jnl, jcc_insn, (0x0DUL<<8)|9, CPU_Any, NONE +jnle, jcc_insn, (0x0FUL<<8)|9, CPU_Any, NONE +jno, jcc_insn, (0x01UL<<8)|9, CPU_Any, NONE +jnp, jcc_insn, (0x0BUL<<8)|9, CPU_Any, NONE +jns, jcc_insn, (0x09UL<<8)|9, CPU_Any, NONE +jnz, jcc_insn, (0x05UL<<8)|9, CPU_Any, NONE +jo, jcc_insn, (0x00UL<<8)|9, CPU_Any, NONE +jp, jcc_insn, (0x0AUL<<8)|9, CPU_Any, NONE +jpe, jcc_insn, (0x0AUL<<8)|9, CPU_Any, NONE +jpo, jcc_insn, (0x0BUL<<8)|9, CPU_Any, NONE +jrcxz, jcxz_insn, (0x40UL<<8)|2, CPU_64, NONE +js, jcc_insn, (0x08UL<<8)|9, CPU_Any, NONE +jz, jcc_insn, (0x04UL<<8)|9, CPU_Any, NONE +lahf, onebyte_insn, (0x00009FUL<<8)|1, CPU_Any, NONE +lar, bsfr_insn, (0x02UL<<8)|3, CPU_286|CPU_Prot, NONE +lddqu, lddqu_insn, (0UL<<8)|1, CPU_SSE3, NONE +ldmxcsr, ldstmxcsr_insn, (0x02UL<<8)|1, CPU_SSE, NONE +lds, ldes_insn, (0xC5UL<<8)|2, CPU_Not64, NONE +lea, lea_insn, (0UL<<8)|3, CPU_Any, NONE +leave, onebyte_insn, (0x4000C9UL<<8)|1, CPU_186, NONE +les, ldes_insn, (0xC4UL<<8)|2, CPU_Not64, NONE +lfence, threebyte_insn, (0x0FAEE8UL<<8)|1, CPU_P3, NONE +lfs, lfgss_insn, (0xB4UL<<8)|2, CPU_386, NONE +lgdt, twobytemem_insn, (0x020F01UL<<8)|1, CPU_286|CPU_Priv, NONE +lgs, lfgss_insn, (0xB5UL<<8)|2, CPU_386, NONE +lidt, twobytemem_insn, (0x030F01UL<<8)|1, CPU_286|CPU_Priv, NONE +lldt, prot286_insn, (0x0200UL<<8)|1, CPU_286|CPU_Priv|CPU_Prot, NONE +lmsw, prot286_insn, (0x0601UL<<8)|1, CPU_286|CPU_Priv, NONE +loadall, twobyte_insn, (0x0F07UL<<8)|1, CPU_386|CPU_Undoc, NONE +loadall286, twobyte_insn, (0x0F05UL<<8)|1, CPU_286|CPU_Undoc, NONE lock, NULL, X86_LOCKREP, 0xF0, NONE -lodsb, onebyte_insn, (0x0000ACUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -lodsd, onebyte_insn, (0x0020ADUL<<8)|NELEMS(onebyte_insn), CPU_386, NONE -lodsq, onebyte_insn, (0x0040ADUL<<8)|NELEMS(onebyte_insn), CPU_64, NONE -lodsw, onebyte_insn, (0x0010ADUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -loop, loop_insn, (0x02UL<<8)|NELEMS(loop_insn), CPU_Any, NONE -loope, loop_insn, (0x01UL<<8)|NELEMS(loop_insn), CPU_Any, NONE -loopne, loop_insn, (0x00UL<<8)|NELEMS(loop_insn), CPU_Any, NONE -loopnz, loop_insn, (0x00UL<<8)|NELEMS(loop_insn), CPU_Any, NONE -loopz, loop_insn, (0x01UL<<8)|NELEMS(loop_insn), CPU_Any, NONE -lsl, bsfr_insn, (0x03UL<<8)|NELEMS(bsfr_insn), CPU_286|CPU_Prot, NONE -lss, lfgss_insn, (0xB2UL<<8)|NELEMS(lfgss_insn), CPU_386, NONE -ltr, prot286_insn, (0x0300UL<<8)|NELEMS(prot286_insn), CPU_286|CPU_Priv|CPU_Prot, NONE -lzcnt, cnt_insn, (0xBDUL<<8)|NELEMS(cnt_insn), CPU_686|CPU_AMD, NONE -maskmovdqu, maskmovdqu_insn, (0UL<<8)|NELEMS(maskmovdqu_insn), CPU_SSE2, NONE -maskmovq, maskmovq_insn, (0UL<<8)|NELEMS(maskmovq_insn), CPU_MMX|CPU_P3, NONE -maxpd, ssess_insn, (0x665FUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -maxps, sseps_insn, (0x5FUL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE -maxsd, ssess_insn, (0xF25FUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -maxss, ssess_insn, (0xF35FUL<<8)|NELEMS(ssess_insn), CPU_SSE, NONE -mfence, threebyte_insn, (0x0FAEF0UL<<8)|NELEMS(threebyte_insn), CPU_P3, NONE -minpd, ssess_insn, (0x665DUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -minps, sseps_insn, (0x5DUL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE -minsd, ssess_insn, (0xF25DUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -minss, ssess_insn, (0xF35DUL<<8)|NELEMS(ssess_insn), CPU_SSE, NONE -monitor, threebyte_insn, (0x0F01C8UL<<8)|NELEMS(threebyte_insn), CPU_SSE3, NONE -montmul, padlock_insn, (0xC0F3A6UL<<8)|NELEMS(padlock_insn), CPU_PadLock, NONE -mov, mov_insn, (0UL<<8)|NELEMS(mov_insn), CPU_Any, NONE -movapd, movaupd_insn, (0x28UL<<8)|NELEMS(movaupd_insn), CPU_SSE2, NONE -movaps, movaups_insn, (0x28UL<<8)|NELEMS(movaups_insn), CPU_SSE, NONE -movd, movd_insn, (0UL<<8)|NELEMS(movd_insn), CPU_386|CPU_MMX, NONE -movddup, cvt_xmm_xmm64_ss_insn, (0xF212UL<<8)|NELEMS(cvt_xmm_xmm64_ss_insn), CPU_SSE3, NONE -movdq2q, movdq2q_insn, (0UL<<8)|NELEMS(movdq2q_insn), CPU_SSE2, NONE -movdqa, movdqau_insn, (0x66UL<<8)|NELEMS(movdqau_insn), CPU_SSE2, NONE -movdqu, movdqau_insn, (0xF3UL<<8)|NELEMS(movdqau_insn), CPU_SSE2, NONE -movhlps, movhllhps_insn, (0x12UL<<8)|NELEMS(movhllhps_insn), CPU_SSE, NONE -movhpd, movhlpd_insn, (0x16UL<<8)|NELEMS(movhlpd_insn), CPU_SSE2, NONE -movhps, movhlps_insn, (0x16UL<<8)|NELEMS(movhlps_insn), CPU_SSE, NONE -movlhps, movhllhps_insn, (0x16UL<<8)|NELEMS(movhllhps_insn), CPU_SSE, NONE -movlpd, movhlpd_insn, (0x12UL<<8)|NELEMS(movhlpd_insn), CPU_SSE2, NONE -movlps, movhlps_insn, (0x12UL<<8)|NELEMS(movhlps_insn), CPU_SSE, NONE -movmskpd, movmskpd_insn, (0UL<<8)|NELEMS(movmskpd_insn), CPU_386|CPU_SSE2, NONE -movmskps, movmskps_insn, (0UL<<8)|NELEMS(movmskps_insn), CPU_386|CPU_SSE, NONE -movntdq, movntpddq_insn, (0xE7UL<<8)|NELEMS(movntpddq_insn), CPU_SSE2, NONE -movntdqa, movntdqa_insn, (0UL<<8)|NELEMS(movntdqa_insn), CPU_SSE41, NONE -movnti, movnti_insn, (0UL<<8)|NELEMS(movnti_insn), CPU_P4, NONE -movntpd, movntpddq_insn, (0x2BUL<<8)|NELEMS(movntpddq_insn), CPU_SSE2, NONE -movntps, movntps_insn, (0UL<<8)|NELEMS(movntps_insn), CPU_SSE, NONE -movntq, movntq_insn, (0UL<<8)|NELEMS(movntq_insn), CPU_SSE, NONE -movntsd, movntsd_insn, (0UL<<8)|NELEMS(movntsd_insn), CPU_SSE41, NONE -movntss, movntss_insn, (0UL<<8)|NELEMS(movntss_insn), CPU_SSE41, NONE -movq, movq_insn, (0UL<<8)|NELEMS(movq_insn), CPU_MMX, NONE -movq2dq, movq2dq_insn, (0UL<<8)|NELEMS(movq2dq_insn), CPU_SSE2, NONE -movsb, onebyte_insn, (0x0000A4UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -movsd, movsd_insn, (0UL<<8)|NELEMS(movsd_insn), CPU_386, NONE -movshdup, ssess_insn, (0xF316UL<<8)|NELEMS(ssess_insn), CPU_SSE3, NONE -movsldup, ssess_insn, (0xF312UL<<8)|NELEMS(ssess_insn), CPU_SSE3, NONE -movsq, onebyte_insn, (0x0040A5UL<<8)|NELEMS(onebyte_insn), CPU_64, NONE -movss, movss_insn, (0UL<<8)|NELEMS(movss_insn), CPU_SSE, NONE -movsw, onebyte_insn, (0x0010A5UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -movsx, movszx_insn, (0xBEUL<<8)|NELEMS(movszx_insn), CPU_386, NONE -movsxd, movsxd_insn, (0UL<<8)|NELEMS(movsxd_insn), CPU_64, NONE -movupd, movaupd_insn, (0x10UL<<8)|NELEMS(movaupd_insn), CPU_SSE2, NONE -movups, movaups_insn, (0x10UL<<8)|NELEMS(movaups_insn), CPU_SSE, NONE -movzx, movszx_insn, (0xB6UL<<8)|NELEMS(movszx_insn), CPU_386, NONE -mpsadbw, sse4imm_insn, (0x42UL<<8)|NELEMS(sse4imm_insn), CPU_SSE41, NONE -mul, f6_insn, (0x04UL<<8)|NELEMS(f6_insn), CPU_Any, NONE -mulpd, ssess_insn, (0x6659UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -mulps, sseps_insn, (0x59UL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE -mulsd, ssess_insn, (0xF259UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -mulss, ssess_insn, (0xF359UL<<8)|NELEMS(ssess_insn), CPU_SSE, NONE -mwait, threebyte_insn, (0x0F01C9UL<<8)|NELEMS(threebyte_insn), CPU_SSE3, NONE -neg, f6_insn, (0x03UL<<8)|NELEMS(f6_insn), CPU_Any, NONE -nop, onebyte_insn, (0x000090UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -not, f6_insn, (0x02UL<<8)|NELEMS(f6_insn), CPU_Any, NONE +lodsb, onebyte_insn, (0x0000ACUL<<8)|1, CPU_Any, NONE +lodsd, onebyte_insn, (0x0020ADUL<<8)|1, CPU_386, NONE +lodsq, onebyte_insn, (0x0040ADUL<<8)|1, CPU_64, NONE +lodsw, onebyte_insn, (0x0010ADUL<<8)|1, CPU_Any, NONE +loop, loop_insn, (0x02UL<<8)|8, CPU_Any, NONE +loope, loop_insn, (0x01UL<<8)|8, CPU_Any, NONE +loopne, loop_insn, (0x00UL<<8)|8, CPU_Any, NONE +loopnz, loop_insn, (0x00UL<<8)|8, CPU_Any, NONE +loopz, loop_insn, (0x01UL<<8)|8, CPU_Any, NONE +lsl, bsfr_insn, (0x03UL<<8)|3, CPU_286|CPU_Prot, NONE +lss, lfgss_insn, (0xB2UL<<8)|2, CPU_386, NONE +ltr, prot286_insn, (0x0300UL<<8)|1, CPU_286|CPU_Priv|CPU_Prot, NONE +lzcnt, cnt_insn, (0xBDUL<<8)|3, CPU_686|CPU_AMD, NONE +maskmovdqu, maskmovdqu_insn, (0UL<<8)|1, CPU_SSE2, NONE +maskmovq, maskmovq_insn, (0UL<<8)|1, CPU_MMX|CPU_P3, NONE +maxpd, ssess_insn, (0x665FUL<<8)|1, CPU_SSE2, NONE +maxps, sseps_insn, (0x5FUL<<8)|1, CPU_SSE, NONE +maxsd, ssess_insn, (0xF25FUL<<8)|1, CPU_SSE2, NONE +maxss, ssess_insn, (0xF35FUL<<8)|1, CPU_SSE, NONE +mfence, threebyte_insn, (0x0FAEF0UL<<8)|1, CPU_P3, NONE +minpd, ssess_insn, (0x665DUL<<8)|1, CPU_SSE2, NONE +minps, sseps_insn, (0x5DUL<<8)|1, CPU_SSE, NONE +minsd, ssess_insn, (0xF25DUL<<8)|1, CPU_SSE2, NONE +minss, ssess_insn, (0xF35DUL<<8)|1, CPU_SSE, NONE +monitor, threebyte_insn, (0x0F01C8UL<<8)|1, CPU_SSE3, NONE +montmul, padlock_insn, (0xC0F3A6UL<<8)|1, CPU_PadLock, NONE +mov, mov_insn, (0UL<<8)|69, CPU_Any, NONE +movapd, movaupd_insn, (0x28UL<<8)|2, CPU_SSE2, NONE +movaps, movaups_insn, (0x28UL<<8)|2, CPU_SSE, NONE +movd, movd_insn, (0UL<<8)|8, CPU_386|CPU_MMX, NONE +movddup, cvt_xmm_xmm64_ss_insn, (0xF212UL<<8)|2, CPU_SSE3, NONE +movdq2q, movdq2q_insn, (0UL<<8)|1, CPU_SSE2, NONE +movdqa, movdqau_insn, (0x66UL<<8)|2, CPU_SSE2, NONE +movdqu, movdqau_insn, (0xF3UL<<8)|2, CPU_SSE2, NONE +movhlps, movhllhps_insn, (0x12UL<<8)|1, CPU_SSE, NONE +movhpd, movhlpd_insn, (0x16UL<<8)|2, CPU_SSE2, NONE +movhps, movhlps_insn, (0x16UL<<8)|2, CPU_SSE, NONE +movlhps, movhllhps_insn, (0x16UL<<8)|1, CPU_SSE, NONE +movlpd, movhlpd_insn, (0x12UL<<8)|2, CPU_SSE2, NONE +movlps, movhlps_insn, (0x12UL<<8)|2, CPU_SSE, NONE +movmskpd, movmskpd_insn, (0UL<<8)|2, CPU_386|CPU_SSE2, NONE +movmskps, movmskps_insn, (0UL<<8)|2, CPU_386|CPU_SSE, NONE +movntdq, movntpddq_insn, (0xE7UL<<8)|1, CPU_SSE2, NONE +movntdqa, movntdqa_insn, (0UL<<8)|1, CPU_SSE41, NONE +movnti, movnti_insn, (0UL<<8)|2, CPU_P4, NONE +movntpd, movntpddq_insn, (0x2BUL<<8)|1, CPU_SSE2, NONE +movntps, movntps_insn, (0UL<<8)|1, CPU_SSE, NONE +movntq, movntq_insn, (0UL<<8)|1, CPU_SSE, NONE +movntsd, movntsd_insn, (0UL<<8)|1, CPU_SSE41, NONE +movntss, movntss_insn, (0UL<<8)|1, CPU_SSE41, NONE +movq, movq_insn, (0UL<<8)|9, CPU_MMX, NONE +movq2dq, movq2dq_insn, (0UL<<8)|1, CPU_SSE2, NONE +movsb, onebyte_insn, (0x0000A4UL<<8)|1, CPU_Any, NONE +movsd, movsd_insn, (0UL<<8)|4, CPU_386, NONE +movshdup, ssess_insn, (0xF316UL<<8)|1, CPU_SSE3, NONE +movsldup, ssess_insn, (0xF312UL<<8)|1, CPU_SSE3, NONE +movsq, onebyte_insn, (0x0040A5UL<<8)|1, CPU_64, NONE +movss, movss_insn, (0UL<<8)|3, CPU_SSE, NONE +movsw, onebyte_insn, (0x0010A5UL<<8)|1, CPU_Any, NONE +movsx, movszx_insn, (0xBEUL<<8)|5, CPU_386, NONE +movsxd, movsxd_insn, (0UL<<8)|1, CPU_64, NONE +movupd, movaupd_insn, (0x10UL<<8)|2, CPU_SSE2, NONE +movups, movaups_insn, (0x10UL<<8)|2, CPU_SSE, NONE +movzx, movszx_insn, (0xB6UL<<8)|5, CPU_386, NONE +mpsadbw, sse4imm_insn, (0x42UL<<8)|1, CPU_SSE41, NONE +mul, f6_insn, (0x04UL<<8)|4, CPU_Any, NONE +mulpd, ssess_insn, (0x6659UL<<8)|1, CPU_SSE2, NONE +mulps, sseps_insn, (0x59UL<<8)|1, CPU_SSE, NONE +mulsd, ssess_insn, (0xF259UL<<8)|1, CPU_SSE2, NONE +mulss, ssess_insn, (0xF359UL<<8)|1, CPU_SSE, NONE +mwait, threebyte_insn, (0x0F01C9UL<<8)|1, CPU_SSE3, NONE +neg, f6_insn, (0x03UL<<8)|4, CPU_Any, NONE +nop, onebyte_insn, (0x000090UL<<8)|1, CPU_Any, NONE +not, f6_insn, (0x02UL<<8)|4, CPU_Any, NONE o16, NULL, X86_OPERSIZE, 0x10, NONE o32, NULL, X86_OPERSIZE, 0x20, NONE o64, NULL, X86_OPERSIZE, 0x40, NONE -or, arith_insn, (0x0108UL<<8)|NELEMS(arith_insn), CPU_Any, NONE -orpd, ssess_insn, (0x6656UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -orps, sseps_insn, (0x56UL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE -out, out_insn, (0UL<<8)|NELEMS(out_insn), CPU_Any, NONE -outsb, onebyte_insn, (0x00006EUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -outsd, onebyte_insn, (0x00206FUL<<8)|NELEMS(onebyte_insn), CPU_386, NONE -outsw, onebyte_insn, (0x00106FUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -pabsb, ssse3_insn, (0x1CUL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE -pabsd, ssse3_insn, (0x1EUL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE -pabsw, ssse3_insn, (0x1DUL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE -packssdw, mmxsse2_insn, (0x6BUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -packsswb, mmxsse2_insn, (0x63UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -packusdw, sse4_insn, (0x2BUL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE -packuswb, mmxsse2_insn, (0x67UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -paddb, mmxsse2_insn, (0xFCUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -paddd, mmxsse2_insn, (0xFEUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -paddq, mmxsse2_insn, (0xD4UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -paddsb, mmxsse2_insn, (0xECUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -paddsiw, cyrixmmx_insn, (0x51UL<<8)|NELEMS(cyrixmmx_insn), CPU_Cyrix|CPU_MMX, NONE -paddsw, mmxsse2_insn, (0xEDUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -paddusb, mmxsse2_insn, (0xDCUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -paddusw, mmxsse2_insn, (0xDDUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -paddw, mmxsse2_insn, (0xFDUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -palignr, ssse3imm_insn, (0x0FUL<<8)|NELEMS(ssse3imm_insn), CPU_SSSE3, NONE -pand, mmxsse2_insn, (0xDBUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -pandn, mmxsse2_insn, (0xDFUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -pause, onebyte_prefix_insn, (0xF390UL<<8)|NELEMS(onebyte_prefix_insn), CPU_P4, NONE -paveb, cyrixmmx_insn, (0x50UL<<8)|NELEMS(cyrixmmx_insn), CPU_Cyrix|CPU_MMX, NONE -pavgb, mmxsse2_insn, (0xE0UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX|CPU_P3, NONE -pavgusb, now3d_insn, (0xBFUL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE -pavgw, mmxsse2_insn, (0xE3UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX|CPU_P3, NONE -pblendvb, sse4xmm0_insn, (0x10UL<<8)|NELEMS(sse4xmm0_insn), CPU_SSE41, NONE -pblendw, sse4imm_insn, (0x0EUL<<8)|NELEMS(sse4imm_insn), CPU_SSE41, NONE -pcmpeqb, mmxsse2_insn, (0x74UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -pcmpeqd, mmxsse2_insn, (0x76UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -pcmpeqq, sse4_insn, (0x29UL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE -pcmpeqw, mmxsse2_insn, (0x75UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -pcmpestri, sse4pcmpstr_insn, (0x61UL<<8)|NELEMS(sse4pcmpstr_insn), CPU_SSE42, NONE -pcmpestrm, sse4pcmpstr_insn, (0x60UL<<8)|NELEMS(sse4pcmpstr_insn), CPU_SSE42, NONE -pcmpgtb, mmxsse2_insn, (0x64UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -pcmpgtd, mmxsse2_insn, (0x66UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -pcmpgtq, sse4_insn, (0x37UL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE -pcmpgtw, mmxsse2_insn, (0x65UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -pcmpistri, sse4pcmpstr_insn, (0x63UL<<8)|NELEMS(sse4pcmpstr_insn), CPU_SSE42, NONE -pcmpistrm, sse4pcmpstr_insn, (0x62UL<<8)|NELEMS(sse4pcmpstr_insn), CPU_SSE42, NONE -pdistib, cyrixmmx_insn, (0x54UL<<8)|NELEMS(cyrixmmx_insn), CPU_Cyrix|CPU_MMX, NONE -pextrb, pextrb_insn, (0UL<<8)|NELEMS(pextrb_insn), CPU_SSE41, NONE -pextrd, pextrd_insn, (0UL<<8)|NELEMS(pextrd_insn), CPU_386|CPU_SSE41, NONE -pextrq, pextrq_insn, (0UL<<8)|NELEMS(pextrq_insn), CPU_64|CPU_SSE41, NONE -pextrw, pextrw_insn, (0UL<<8)|NELEMS(pextrw_insn), CPU_MMX|CPU_P3, NONE -pf2id, now3d_insn, (0x1DUL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE -pf2iw, now3d_insn, (0x1CUL<<8)|NELEMS(now3d_insn), CPU_3DNow|CPU_Athlon, NONE -pfacc, now3d_insn, (0xAEUL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE -pfadd, now3d_insn, (0x9EUL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE -pfcmpeq, now3d_insn, (0xB0UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE -pfcmpge, now3d_insn, (0x90UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE -pfcmpgt, now3d_insn, (0xA0UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE -pfmax, now3d_insn, (0xA4UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE -pfmin, now3d_insn, (0x94UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE -pfmul, now3d_insn, (0xB4UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE -pfnacc, now3d_insn, (0x8AUL<<8)|NELEMS(now3d_insn), CPU_3DNow|CPU_Athlon, NONE -pfpnacc, now3d_insn, (0x8EUL<<8)|NELEMS(now3d_insn), CPU_3DNow|CPU_Athlon, NONE -pfrcp, now3d_insn, (0x96UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE -pfrcpit1, now3d_insn, (0xA6UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE -pfrcpit2, now3d_insn, (0xB6UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE -pfrsqit1, now3d_insn, (0xA7UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE -pfrsqrt, now3d_insn, (0x97UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE -pfsub, now3d_insn, (0x9AUL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE -pfsubr, now3d_insn, (0xAAUL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE -phaddd, ssse3_insn, (0x02UL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE -phaddsw, ssse3_insn, (0x03UL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE -phaddw, ssse3_insn, (0x01UL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE -phminposuw, sse4_insn, (0x41UL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE -phsubd, ssse3_insn, (0x06UL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE -phsubsw, ssse3_insn, (0x07UL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE -phsubw, ssse3_insn, (0x05UL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE -pi2fd, now3d_insn, (0x0DUL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE -pi2fw, now3d_insn, (0x0CUL<<8)|NELEMS(now3d_insn), CPU_3DNow|CPU_Athlon, NONE -pinsrb, pinsrb_insn, (0UL<<8)|NELEMS(pinsrb_insn), CPU_SSE41, NONE -pinsrd, pinsrd_insn, (0UL<<8)|NELEMS(pinsrd_insn), CPU_386|CPU_SSE41, NONE -pinsrq, pinsrq_insn, (0UL<<8)|NELEMS(pinsrq_insn), CPU_64|CPU_SSE41, NONE -pinsrw, pinsrw_insn, (0UL<<8)|NELEMS(pinsrw_insn), CPU_MMX|CPU_P3, NONE -pmachriw, pmachriw_insn, (0UL<<8)|NELEMS(pmachriw_insn), CPU_Cyrix|CPU_MMX, NONE -pmaddubsw, ssse3_insn, (0x04UL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE -pmaddwd, mmxsse2_insn, (0xF5UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -pmagw, cyrixmmx_insn, (0x52UL<<8)|NELEMS(cyrixmmx_insn), CPU_Cyrix|CPU_MMX, NONE -pmaxsb, sse4_insn, (0x3CUL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE -pmaxsd, sse4_insn, (0x3DUL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE -pmaxsw, mmxsse2_insn, (0xEEUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX|CPU_P3, NONE -pmaxub, mmxsse2_insn, (0xDEUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX|CPU_P3, NONE -pmaxud, sse4_insn, (0x3FUL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE -pmaxuw, sse4_insn, (0x3EUL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE -pminsb, sse4_insn, (0x38UL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE -pminsd, sse4_insn, (0x39UL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE -pminsw, mmxsse2_insn, (0xEAUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX|CPU_P3, NONE -pminub, mmxsse2_insn, (0xDAUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX|CPU_P3, NONE -pminud, sse4_insn, (0x3BUL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE -pminuw, sse4_insn, (0x3AUL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE -pmovmskb, pmovmskb_insn, (0UL<<8)|NELEMS(pmovmskb_insn), CPU_MMX|CPU_P3, NONE -pmovsxbd, sse4m32_insn, (0x21UL<<8)|NELEMS(sse4m32_insn), CPU_SSE41, NONE -pmovsxbq, sse4m16_insn, (0x22UL<<8)|NELEMS(sse4m16_insn), CPU_SSE41, NONE -pmovsxbw, sse4m64_insn, (0x20UL<<8)|NELEMS(sse4m64_insn), CPU_SSE41, NONE -pmovsxdq, sse4m64_insn, (0x25UL<<8)|NELEMS(sse4m64_insn), CPU_SSE41, NONE -pmovsxwd, sse4m64_insn, (0x23UL<<8)|NELEMS(sse4m64_insn), CPU_SSE41, NONE -pmovsxwq, sse4m32_insn, (0x24UL<<8)|NELEMS(sse4m32_insn), CPU_SSE41, NONE -pmovzxbd, sse4m32_insn, (0x31UL<<8)|NELEMS(sse4m32_insn), CPU_SSE41, NONE -pmovzxbq, sse4m16_insn, (0x32UL<<8)|NELEMS(sse4m16_insn), CPU_SSE41, NONE -pmovzxbw, sse4m64_insn, (0x30UL<<8)|NELEMS(sse4m64_insn), CPU_SSE41, NONE -pmovzxdq, sse4m64_insn, (0x35UL<<8)|NELEMS(sse4m64_insn), CPU_SSE41, NONE -pmovzxwd, sse4m64_insn, (0x33UL<<8)|NELEMS(sse4m64_insn), CPU_SSE41, NONE -pmovzxwq, sse4m32_insn, (0x34UL<<8)|NELEMS(sse4m32_insn), CPU_SSE41, NONE -pmuldq, sse4_insn, (0x28UL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE -pmulhriw, cyrixmmx_insn, (0x5DUL<<8)|NELEMS(cyrixmmx_insn), CPU_Cyrix|CPU_MMX, NONE -pmulhrsw, ssse3_insn, (0x0BUL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE -pmulhrwa, now3d_insn, (0xB7UL<<8)|NELEMS(now3d_insn), CPU_3DNow, NONE -pmulhrwc, cyrixmmx_insn, (0x59UL<<8)|NELEMS(cyrixmmx_insn), CPU_Cyrix|CPU_MMX, NONE -pmulhuw, mmxsse2_insn, (0xE4UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX|CPU_P3, NONE -pmulhw, mmxsse2_insn, (0xE5UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -pmulld, sse4_insn, (0x40UL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE -pmullw, mmxsse2_insn, (0xD5UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -pmuludq, mmxsse2_insn, (0xF4UL<<8)|NELEMS(mmxsse2_insn), CPU_SSE2, NONE -pmvgezb, cyrixmmx_insn, (0x5CUL<<8)|NELEMS(cyrixmmx_insn), CPU_Cyrix|CPU_MMX, NONE -pmvlzb, cyrixmmx_insn, (0x5BUL<<8)|NELEMS(cyrixmmx_insn), CPU_Cyrix|CPU_MMX, NONE -pmvnzb, cyrixmmx_insn, (0x5AUL<<8)|NELEMS(cyrixmmx_insn), CPU_Cyrix|CPU_MMX, NONE -pmvzb, cyrixmmx_insn, (0x58UL<<8)|NELEMS(cyrixmmx_insn), CPU_Cyrix|CPU_MMX, NONE -pop, pop_insn, (0UL<<8)|NELEMS(pop_insn), CPU_Any, NONE -popa, onebyte_insn, (0x000061UL<<8)|NELEMS(onebyte_insn), CPU_186|CPU_Not64, NONE -popad, onebyte_insn, (0x002061UL<<8)|NELEMS(onebyte_insn), CPU_386|CPU_Not64, NONE -popaw, onebyte_insn, (0x001061UL<<8)|NELEMS(onebyte_insn), CPU_186|CPU_Not64, NONE -popcnt, cnt_insn, (0xB8UL<<8)|NELEMS(cnt_insn), CPU_SSE42, NONE -popf, onebyte_insn, (0x40009DUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -popfd, onebyte_insn, (0x00209DUL<<8)|NELEMS(onebyte_insn), CPU_386|CPU_Not64, NONE -popfq, onebyte_insn, (0x40409DUL<<8)|NELEMS(onebyte_insn), CPU_64, NONE -popfw, onebyte_insn, (0x40109DUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -por, mmxsse2_insn, (0xEBUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -prefetch, twobytemem_insn, (0x000F0DUL<<8)|NELEMS(twobytemem_insn), CPU_3DNow, NONE -prefetchnta, twobytemem_insn, (0x000F18UL<<8)|NELEMS(twobytemem_insn), CPU_P3, NONE -prefetcht0, twobytemem_insn, (0x010F18UL<<8)|NELEMS(twobytemem_insn), CPU_P3, NONE -prefetcht1, twobytemem_insn, (0x020F18UL<<8)|NELEMS(twobytemem_insn), CPU_P3, NONE -prefetcht2, twobytemem_insn, (0x030F18UL<<8)|NELEMS(twobytemem_insn), CPU_P3, NONE -prefetchw, twobytemem_insn, (0x010F0DUL<<8)|NELEMS(twobytemem_insn), CPU_3DNow, NONE -psadbw, mmxsse2_insn, (0xF6UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX|CPU_P3, NONE -pshufb, ssse3_insn, (0x00UL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE -pshufd, ssessimm_insn, (0x6670UL<<8)|NELEMS(ssessimm_insn), CPU_SSE2, NONE -pshufhw, ssessimm_insn, (0xF370UL<<8)|NELEMS(ssessimm_insn), CPU_SSE2, NONE -pshuflw, ssessimm_insn, (0xF270UL<<8)|NELEMS(ssessimm_insn), CPU_SSE2, NONE -pshufw, pshufw_insn, (0UL<<8)|NELEMS(pshufw_insn), CPU_MMX|CPU_P3, NONE -psignb, ssse3_insn, (0x08UL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE -psignd, ssse3_insn, (0x0AUL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE -psignw, ssse3_insn, (0x09UL<<8)|NELEMS(ssse3_insn), CPU_SSSE3, NONE -pslld, pshift_insn, (0x0672F2UL<<8)|NELEMS(pshift_insn), CPU_MMX, NONE -pslldq, pslrldq_insn, (0x07UL<<8)|NELEMS(pslrldq_insn), CPU_SSE2, NONE -psllq, pshift_insn, (0x0673F3UL<<8)|NELEMS(pshift_insn), CPU_MMX, NONE -psllw, pshift_insn, (0x0671F1UL<<8)|NELEMS(pshift_insn), CPU_MMX, NONE -psrad, pshift_insn, (0x0472E2UL<<8)|NELEMS(pshift_insn), CPU_MMX, NONE -psraw, pshift_insn, (0x0471E1UL<<8)|NELEMS(pshift_insn), CPU_MMX, NONE -psrld, pshift_insn, (0x0272D2UL<<8)|NELEMS(pshift_insn), CPU_MMX, NONE -psrldq, pslrldq_insn, (0x03UL<<8)|NELEMS(pslrldq_insn), CPU_SSE2, NONE -psrlq, pshift_insn, (0x0273D3UL<<8)|NELEMS(pshift_insn), CPU_MMX, NONE -psrlw, pshift_insn, (0x0271D1UL<<8)|NELEMS(pshift_insn), CPU_MMX, NONE -psubb, mmxsse2_insn, (0xF8UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -psubd, mmxsse2_insn, (0xFAUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -psubq, mmxsse2_insn, (0xFBUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -psubsb, mmxsse2_insn, (0xE8UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -psubsiw, cyrixmmx_insn, (0x55UL<<8)|NELEMS(cyrixmmx_insn), CPU_Cyrix|CPU_MMX, NONE -psubsw, mmxsse2_insn, (0xE9UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -psubusb, mmxsse2_insn, (0xD8UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -psubusw, mmxsse2_insn, (0xD9UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -psubw, mmxsse2_insn, (0xF9UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -pswapd, now3d_insn, (0xBBUL<<8)|NELEMS(now3d_insn), CPU_3DNow|CPU_Athlon, NONE -ptest, sse4_insn, (0x17UL<<8)|NELEMS(sse4_insn), CPU_SSE41, NONE -punpckhbw, mmxsse2_insn, (0x68UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -punpckhdq, mmxsse2_insn, (0x6AUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -punpckhqdq, ssess_insn, (0x666DUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -punpckhwd, mmxsse2_insn, (0x69UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -punpcklbw, mmxsse2_insn, (0x60UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -punpckldq, mmxsse2_insn, (0x62UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -punpcklqdq, ssess_insn, (0x666CUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -punpcklwd, mmxsse2_insn, (0x61UL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -push, push_insn, (0UL<<8)|NELEMS(push_insn), CPU_Any, NONE -pusha, onebyte_insn, (0x000060UL<<8)|NELEMS(onebyte_insn), CPU_186|CPU_Not64, NONE -pushad, onebyte_insn, (0x002060UL<<8)|NELEMS(onebyte_insn), CPU_386|CPU_Not64, NONE -pushaw, onebyte_insn, (0x001060UL<<8)|NELEMS(onebyte_insn), CPU_186|CPU_Not64, NONE -pushf, onebyte_insn, (0x40009CUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -pushfd, onebyte_insn, (0x00209CUL<<8)|NELEMS(onebyte_insn), CPU_386|CPU_Not64, NONE -pushfq, onebyte_insn, (0x40409CUL<<8)|NELEMS(onebyte_insn), CPU_64, NONE -pushfw, onebyte_insn, (0x40109CUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -pxor, mmxsse2_insn, (0xEFUL<<8)|NELEMS(mmxsse2_insn), CPU_MMX, NONE -rcl, shift_insn, (0x02UL<<8)|NELEMS(shift_insn), CPU_Any, NONE -rcpps, sseps_insn, (0x53UL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE -rcpss, ssess_insn, (0xF353UL<<8)|NELEMS(ssess_insn), CPU_SSE, NONE -rcr, shift_insn, (0x03UL<<8)|NELEMS(shift_insn), CPU_Any, NONE -rdmsr, twobyte_insn, (0x0F32UL<<8)|NELEMS(twobyte_insn), CPU_586|CPU_Priv, NONE -rdpmc, twobyte_insn, (0x0F33UL<<8)|NELEMS(twobyte_insn), CPU_686, NONE -rdshr, rdwrshr_insn, (0x00UL<<8)|NELEMS(rdwrshr_insn), CPU_686|CPU_Cyrix|CPU_SMM, NONE -rdtsc, twobyte_insn, (0x0F31UL<<8)|NELEMS(twobyte_insn), CPU_586, NONE -rdtscp, threebyte_insn, (0x0F01F9UL<<8)|NELEMS(threebyte_insn), CPU_686|CPU_AMD|CPU_Priv, NONE +or, arith_insn, (0x0108UL<<8)|22, CPU_Any, NONE +orpd, ssess_insn, (0x6656UL<<8)|1, CPU_SSE2, NONE +orps, sseps_insn, (0x56UL<<8)|1, CPU_SSE, NONE +out, out_insn, (0UL<<8)|12, CPU_Any, NONE +outsb, onebyte_insn, (0x00006EUL<<8)|1, CPU_Any, NONE +outsd, onebyte_insn, (0x00206FUL<<8)|1, CPU_386, NONE +outsw, onebyte_insn, (0x00106FUL<<8)|1, CPU_Any, NONE +pabsb, ssse3_insn, (0x1CUL<<8)|2, CPU_SSSE3, NONE +pabsd, ssse3_insn, (0x1EUL<<8)|2, CPU_SSSE3, NONE +pabsw, ssse3_insn, (0x1DUL<<8)|2, CPU_SSSE3, NONE +packssdw, mmxsse2_insn, (0x6BUL<<8)|2, CPU_MMX, NONE +packsswb, mmxsse2_insn, (0x63UL<<8)|2, CPU_MMX, NONE +packusdw, sse4_insn, (0x2BUL<<8)|1, CPU_SSE41, NONE +packuswb, mmxsse2_insn, (0x67UL<<8)|2, CPU_MMX, NONE +paddb, mmxsse2_insn, (0xFCUL<<8)|2, CPU_MMX, NONE +paddd, mmxsse2_insn, (0xFEUL<<8)|2, CPU_MMX, NONE +paddq, mmxsse2_insn, (0xD4UL<<8)|2, CPU_MMX, NONE +paddsb, mmxsse2_insn, (0xECUL<<8)|2, CPU_MMX, NONE +paddsiw, cyrixmmx_insn, (0x51UL<<8)|1, CPU_Cyrix|CPU_MMX, NONE +paddsw, mmxsse2_insn, (0xEDUL<<8)|2, CPU_MMX, NONE +paddusb, mmxsse2_insn, (0xDCUL<<8)|2, CPU_MMX, NONE +paddusw, mmxsse2_insn, (0xDDUL<<8)|2, CPU_MMX, NONE +paddw, mmxsse2_insn, (0xFDUL<<8)|2, CPU_MMX, NONE +palignr, ssse3imm_insn, (0x0FUL<<8)|2, CPU_SSSE3, NONE +pand, mmxsse2_insn, (0xDBUL<<8)|2, CPU_MMX, NONE +pandn, mmxsse2_insn, (0xDFUL<<8)|2, CPU_MMX, NONE +pause, onebyte_prefix_insn, (0xF390UL<<8)|1, CPU_P4, NONE +paveb, cyrixmmx_insn, (0x50UL<<8)|1, CPU_Cyrix|CPU_MMX, NONE +pavgb, mmxsse2_insn, (0xE0UL<<8)|2, CPU_MMX|CPU_P3, NONE +pavgusb, now3d_insn, (0xBFUL<<8)|1, CPU_3DNow, NONE +pavgw, mmxsse2_insn, (0xE3UL<<8)|2, CPU_MMX|CPU_P3, NONE +pblendvb, sse4xmm0_insn, (0x10UL<<8)|2, CPU_SSE41, NONE +pblendw, sse4imm_insn, (0x0EUL<<8)|1, CPU_SSE41, NONE +pcmpeqb, mmxsse2_insn, (0x74UL<<8)|2, CPU_MMX, NONE +pcmpeqd, mmxsse2_insn, (0x76UL<<8)|2, CPU_MMX, NONE +pcmpeqq, sse4_insn, (0x29UL<<8)|1, CPU_SSE41, NONE +pcmpeqw, mmxsse2_insn, (0x75UL<<8)|2, CPU_MMX, NONE +pcmpestri, sse4pcmpstr_insn, (0x61UL<<8)|1, CPU_SSE42, NONE +pcmpestrm, sse4pcmpstr_insn, (0x60UL<<8)|1, CPU_SSE42, NONE +pcmpgtb, mmxsse2_insn, (0x64UL<<8)|2, CPU_MMX, NONE +pcmpgtd, mmxsse2_insn, (0x66UL<<8)|2, CPU_MMX, NONE +pcmpgtq, sse4_insn, (0x37UL<<8)|1, CPU_SSE41, NONE +pcmpgtw, mmxsse2_insn, (0x65UL<<8)|2, CPU_MMX, NONE +pcmpistri, sse4pcmpstr_insn, (0x63UL<<8)|1, CPU_SSE42, NONE +pcmpistrm, sse4pcmpstr_insn, (0x62UL<<8)|1, CPU_SSE42, NONE +pdistib, cyrixmmx_insn, (0x54UL<<8)|1, CPU_Cyrix|CPU_MMX, NONE +pextrb, pextrb_insn, (0UL<<8)|3, CPU_SSE41, NONE +pextrd, pextrd_insn, (0UL<<8)|1, CPU_386|CPU_SSE41, NONE +pextrq, pextrq_insn, (0UL<<8)|1, CPU_64|CPU_SSE41, NONE +pextrw, pextrw_insn, (0UL<<8)|7, CPU_MMX|CPU_P3, NONE +pf2id, now3d_insn, (0x1DUL<<8)|1, CPU_3DNow, NONE +pf2iw, now3d_insn, (0x1CUL<<8)|1, CPU_3DNow|CPU_Athlon, NONE +pfacc, now3d_insn, (0xAEUL<<8)|1, CPU_3DNow, NONE +pfadd, now3d_insn, (0x9EUL<<8)|1, CPU_3DNow, NONE +pfcmpeq, now3d_insn, (0xB0UL<<8)|1, CPU_3DNow, NONE +pfcmpge, now3d_insn, (0x90UL<<8)|1, CPU_3DNow, NONE +pfcmpgt, now3d_insn, (0xA0UL<<8)|1, CPU_3DNow, NONE +pfmax, now3d_insn, (0xA4UL<<8)|1, CPU_3DNow, NONE +pfmin, now3d_insn, (0x94UL<<8)|1, CPU_3DNow, NONE +pfmul, now3d_insn, (0xB4UL<<8)|1, CPU_3DNow, NONE +pfnacc, now3d_insn, (0x8AUL<<8)|1, CPU_3DNow|CPU_Athlon, NONE +pfpnacc, now3d_insn, (0x8EUL<<8)|1, CPU_3DNow|CPU_Athlon, NONE +pfrcp, now3d_insn, (0x96UL<<8)|1, CPU_3DNow, NONE +pfrcpit1, now3d_insn, (0xA6UL<<8)|1, CPU_3DNow, NONE +pfrcpit2, now3d_insn, (0xB6UL<<8)|1, CPU_3DNow, NONE +pfrsqit1, now3d_insn, (0xA7UL<<8)|1, CPU_3DNow, NONE +pfrsqrt, now3d_insn, (0x97UL<<8)|1, CPU_3DNow, NONE +pfsub, now3d_insn, (0x9AUL<<8)|1, CPU_3DNow, NONE +pfsubr, now3d_insn, (0xAAUL<<8)|1, CPU_3DNow, NONE +phaddd, ssse3_insn, (0x02UL<<8)|2, CPU_SSSE3, NONE +phaddsw, ssse3_insn, (0x03UL<<8)|2, CPU_SSSE3, NONE +phaddw, ssse3_insn, (0x01UL<<8)|2, CPU_SSSE3, NONE +phminposuw, sse4_insn, (0x41UL<<8)|1, CPU_SSE41, NONE +phsubd, ssse3_insn, (0x06UL<<8)|2, CPU_SSSE3, NONE +phsubsw, ssse3_insn, (0x07UL<<8)|2, CPU_SSSE3, NONE +phsubw, ssse3_insn, (0x05UL<<8)|2, CPU_SSSE3, NONE +pi2fd, now3d_insn, (0x0DUL<<8)|1, CPU_3DNow, NONE +pi2fw, now3d_insn, (0x0CUL<<8)|1, CPU_3DNow|CPU_Athlon, NONE +pinsrb, pinsrb_insn, (0UL<<8)|2, CPU_SSE41, NONE +pinsrd, pinsrd_insn, (0UL<<8)|1, CPU_386|CPU_SSE41, NONE +pinsrq, pinsrq_insn, (0UL<<8)|1, CPU_64|CPU_SSE41, NONE +pinsrw, pinsrw_insn, (0UL<<8)|6, CPU_MMX|CPU_P3, NONE +pmachriw, pmachriw_insn, (0UL<<8)|1, CPU_Cyrix|CPU_MMX, NONE +pmaddubsw, ssse3_insn, (0x04UL<<8)|2, CPU_SSSE3, NONE +pmaddwd, mmxsse2_insn, (0xF5UL<<8)|2, CPU_MMX, NONE +pmagw, cyrixmmx_insn, (0x52UL<<8)|1, CPU_Cyrix|CPU_MMX, NONE +pmaxsb, sse4_insn, (0x3CUL<<8)|1, CPU_SSE41, NONE +pmaxsd, sse4_insn, (0x3DUL<<8)|1, CPU_SSE41, NONE +pmaxsw, mmxsse2_insn, (0xEEUL<<8)|2, CPU_MMX|CPU_P3, NONE +pmaxub, mmxsse2_insn, (0xDEUL<<8)|2, CPU_MMX|CPU_P3, NONE +pmaxud, sse4_insn, (0x3FUL<<8)|1, CPU_SSE41, NONE +pmaxuw, sse4_insn, (0x3EUL<<8)|1, CPU_SSE41, NONE +pminsb, sse4_insn, (0x38UL<<8)|1, CPU_SSE41, NONE +pminsd, sse4_insn, (0x39UL<<8)|1, CPU_SSE41, NONE +pminsw, mmxsse2_insn, (0xEAUL<<8)|2, CPU_MMX|CPU_P3, NONE +pminub, mmxsse2_insn, (0xDAUL<<8)|2, CPU_MMX|CPU_P3, NONE +pminud, sse4_insn, (0x3BUL<<8)|1, CPU_SSE41, NONE +pminuw, sse4_insn, (0x3AUL<<8)|1, CPU_SSE41, NONE +pmovmskb, pmovmskb_insn, (0UL<<8)|4, CPU_MMX|CPU_P3, NONE +pmovsxbd, sse4m32_insn, (0x21UL<<8)|2, CPU_SSE41, NONE +pmovsxbq, sse4m16_insn, (0x22UL<<8)|2, CPU_SSE41, NONE +pmovsxbw, sse4m64_insn, (0x20UL<<8)|2, CPU_SSE41, NONE +pmovsxdq, sse4m64_insn, (0x25UL<<8)|2, CPU_SSE41, NONE +pmovsxwd, sse4m64_insn, (0x23UL<<8)|2, CPU_SSE41, NONE +pmovsxwq, sse4m32_insn, (0x24UL<<8)|2, CPU_SSE41, NONE +pmovzxbd, sse4m32_insn, (0x31UL<<8)|2, CPU_SSE41, NONE +pmovzxbq, sse4m16_insn, (0x32UL<<8)|2, CPU_SSE41, NONE +pmovzxbw, sse4m64_insn, (0x30UL<<8)|2, CPU_SSE41, NONE +pmovzxdq, sse4m64_insn, (0x35UL<<8)|2, CPU_SSE41, NONE +pmovzxwd, sse4m64_insn, (0x33UL<<8)|2, CPU_SSE41, NONE +pmovzxwq, sse4m32_insn, (0x34UL<<8)|2, CPU_SSE41, NONE +pmuldq, sse4_insn, (0x28UL<<8)|1, CPU_SSE41, NONE +pmulhriw, cyrixmmx_insn, (0x5DUL<<8)|1, CPU_Cyrix|CPU_MMX, NONE +pmulhrsw, ssse3_insn, (0x0BUL<<8)|2, CPU_SSSE3, NONE +pmulhrwa, now3d_insn, (0xB7UL<<8)|1, CPU_3DNow, NONE +pmulhrwc, cyrixmmx_insn, (0x59UL<<8)|1, CPU_Cyrix|CPU_MMX, NONE +pmulhuw, mmxsse2_insn, (0xE4UL<<8)|2, CPU_MMX|CPU_P3, NONE +pmulhw, mmxsse2_insn, (0xE5UL<<8)|2, CPU_MMX, NONE +pmulld, sse4_insn, (0x40UL<<8)|1, CPU_SSE41, NONE +pmullw, mmxsse2_insn, (0xD5UL<<8)|2, CPU_MMX, NONE +pmuludq, mmxsse2_insn, (0xF4UL<<8)|2, CPU_SSE2, NONE +pmvgezb, cyrixmmx_insn, (0x5CUL<<8)|1, CPU_Cyrix|CPU_MMX, NONE +pmvlzb, cyrixmmx_insn, (0x5BUL<<8)|1, CPU_Cyrix|CPU_MMX, NONE +pmvnzb, cyrixmmx_insn, (0x5AUL<<8)|1, CPU_Cyrix|CPU_MMX, NONE +pmvzb, cyrixmmx_insn, (0x58UL<<8)|1, CPU_Cyrix|CPU_MMX, NONE +pop, pop_insn, (0UL<<8)|21, CPU_Any, NONE +popa, onebyte_insn, (0x000061UL<<8)|1, CPU_186|CPU_Not64, NONE +popad, onebyte_insn, (0x002061UL<<8)|1, CPU_386|CPU_Not64, NONE +popaw, onebyte_insn, (0x001061UL<<8)|1, CPU_186|CPU_Not64, NONE +popcnt, cnt_insn, (0xB8UL<<8)|3, CPU_SSE42, NONE +popf, onebyte_insn, (0x40009DUL<<8)|1, CPU_Any, NONE +popfd, onebyte_insn, (0x00209DUL<<8)|1, CPU_386|CPU_Not64, NONE +popfq, onebyte_insn, (0x40409DUL<<8)|1, CPU_64, NONE +popfw, onebyte_insn, (0x40109DUL<<8)|1, CPU_Any, NONE +por, mmxsse2_insn, (0xEBUL<<8)|2, CPU_MMX, NONE +prefetch, twobytemem_insn, (0x000F0DUL<<8)|1, CPU_3DNow, NONE +prefetchnta, twobytemem_insn, (0x000F18UL<<8)|1, CPU_P3, NONE +prefetcht0, twobytemem_insn, (0x010F18UL<<8)|1, CPU_P3, NONE +prefetcht1, twobytemem_insn, (0x020F18UL<<8)|1, CPU_P3, NONE +prefetcht2, twobytemem_insn, (0x030F18UL<<8)|1, CPU_P3, NONE +prefetchw, twobytemem_insn, (0x010F0DUL<<8)|1, CPU_3DNow, NONE +psadbw, mmxsse2_insn, (0xF6UL<<8)|2, CPU_MMX|CPU_P3, NONE +pshufb, ssse3_insn, (0x00UL<<8)|2, CPU_SSSE3, NONE +pshufd, ssessimm_insn, (0x6670UL<<8)|1, CPU_SSE2, NONE +pshufhw, ssessimm_insn, (0xF370UL<<8)|1, CPU_SSE2, NONE +pshuflw, ssessimm_insn, (0xF270UL<<8)|1, CPU_SSE2, NONE +pshufw, pshufw_insn, (0UL<<8)|1, CPU_MMX|CPU_P3, NONE +psignb, ssse3_insn, (0x08UL<<8)|2, CPU_SSSE3, NONE +psignd, ssse3_insn, (0x0AUL<<8)|2, CPU_SSSE3, NONE +psignw, ssse3_insn, (0x09UL<<8)|2, CPU_SSSE3, NONE +pslld, pshift_insn, (0x0672F2UL<<8)|4, CPU_MMX, NONE +pslldq, pslrldq_insn, (0x07UL<<8)|1, CPU_SSE2, NONE +psllq, pshift_insn, (0x0673F3UL<<8)|4, CPU_MMX, NONE +psllw, pshift_insn, (0x0671F1UL<<8)|4, CPU_MMX, NONE +psrad, pshift_insn, (0x0472E2UL<<8)|4, CPU_MMX, NONE +psraw, pshift_insn, (0x0471E1UL<<8)|4, CPU_MMX, NONE +psrld, pshift_insn, (0x0272D2UL<<8)|4, CPU_MMX, NONE +psrldq, pslrldq_insn, (0x03UL<<8)|1, CPU_SSE2, NONE +psrlq, pshift_insn, (0x0273D3UL<<8)|4, CPU_MMX, NONE +psrlw, pshift_insn, (0x0271D1UL<<8)|4, CPU_MMX, NONE +psubb, mmxsse2_insn, (0xF8UL<<8)|2, CPU_MMX, NONE +psubd, mmxsse2_insn, (0xFAUL<<8)|2, CPU_MMX, NONE +psubq, mmxsse2_insn, (0xFBUL<<8)|2, CPU_MMX, NONE +psubsb, mmxsse2_insn, (0xE8UL<<8)|2, CPU_MMX, NONE +psubsiw, cyrixmmx_insn, (0x55UL<<8)|1, CPU_Cyrix|CPU_MMX, NONE +psubsw, mmxsse2_insn, (0xE9UL<<8)|2, CPU_MMX, NONE +psubusb, mmxsse2_insn, (0xD8UL<<8)|2, CPU_MMX, NONE +psubusw, mmxsse2_insn, (0xD9UL<<8)|2, CPU_MMX, NONE +psubw, mmxsse2_insn, (0xF9UL<<8)|2, CPU_MMX, NONE +pswapd, now3d_insn, (0xBBUL<<8)|1, CPU_3DNow|CPU_Athlon, NONE +ptest, sse4_insn, (0x17UL<<8)|1, CPU_SSE41, NONE +punpckhbw, mmxsse2_insn, (0x68UL<<8)|2, CPU_MMX, NONE +punpckhdq, mmxsse2_insn, (0x6AUL<<8)|2, CPU_MMX, NONE +punpckhqdq, ssess_insn, (0x666DUL<<8)|1, CPU_SSE2, NONE +punpckhwd, mmxsse2_insn, (0x69UL<<8)|2, CPU_MMX, NONE +punpcklbw, mmxsse2_insn, (0x60UL<<8)|2, CPU_MMX, NONE +punpckldq, mmxsse2_insn, (0x62UL<<8)|2, CPU_MMX, NONE +punpcklqdq, ssess_insn, (0x666CUL<<8)|1, CPU_SSE2, NONE +punpcklwd, mmxsse2_insn, (0x61UL<<8)|2, CPU_MMX, NONE +push, push_insn, (0UL<<8)|33, CPU_Any, NONE +pusha, onebyte_insn, (0x000060UL<<8)|1, CPU_186|CPU_Not64, NONE +pushad, onebyte_insn, (0x002060UL<<8)|1, CPU_386|CPU_Not64, NONE +pushaw, onebyte_insn, (0x001060UL<<8)|1, CPU_186|CPU_Not64, NONE +pushf, onebyte_insn, (0x40009CUL<<8)|1, CPU_Any, NONE +pushfd, onebyte_insn, (0x00209CUL<<8)|1, CPU_386|CPU_Not64, NONE +pushfq, onebyte_insn, (0x40409CUL<<8)|1, CPU_64, NONE +pushfw, onebyte_insn, (0x40109CUL<<8)|1, CPU_Any, NONE +pxor, mmxsse2_insn, (0xEFUL<<8)|2, CPU_MMX, NONE +rcl, shift_insn, (0x02UL<<8)|16, CPU_Any, NONE +rcpps, sseps_insn, (0x53UL<<8)|1, CPU_SSE, NONE +rcpss, ssess_insn, (0xF353UL<<8)|1, CPU_SSE, NONE +rcr, shift_insn, (0x03UL<<8)|16, CPU_Any, NONE +rdmsr, twobyte_insn, (0x0F32UL<<8)|1, CPU_586|CPU_Priv, NONE +rdpmc, twobyte_insn, (0x0F33UL<<8)|1, CPU_686, NONE +rdshr, rdwrshr_insn, (0x00UL<<8)|1, CPU_686|CPU_Cyrix|CPU_SMM, NONE +rdtsc, twobyte_insn, (0x0F31UL<<8)|1, CPU_586, NONE +rdtscp, threebyte_insn, (0x0F01F9UL<<8)|1, CPU_686|CPU_AMD|CPU_Priv, NONE rep, NULL, X86_LOCKREP, 0xF3, NONE repe, NULL, X86_LOCKREP, 0xF3, NONE repne, NULL, X86_LOCKREP, 0xF2, NONE repnz, NULL, X86_LOCKREP, 0xF2, NONE repz, NULL, X86_LOCKREP, 0xF3, NONE -ret, retnf_insn, (0x00C2UL<<8)|NELEMS(retnf_insn), CPU_Any, NONE -retf, retnf_insn, (0x40CAUL<<8)|NELEMS(retnf_insn), CPU_Any, NONE -retn, retnf_insn, (0x00C2UL<<8)|NELEMS(retnf_insn), CPU_Any, NONE -rol, shift_insn, (0x00UL<<8)|NELEMS(shift_insn), CPU_Any, NONE -ror, shift_insn, (0x01UL<<8)|NELEMS(shift_insn), CPU_Any, NONE -roundpd, sse4imm_insn, (0x09UL<<8)|NELEMS(sse4imm_insn), CPU_SSE41, NONE -roundps, sse4imm_insn, (0x08UL<<8)|NELEMS(sse4imm_insn), CPU_SSE41, NONE -roundsd, sse4imm_insn, (0x0BUL<<8)|NELEMS(sse4imm_insn), CPU_SSE41, NONE -roundss, sse4imm_insn, (0x0AUL<<8)|NELEMS(sse4imm_insn), CPU_SSE41, NONE -rsdc, rsdc_insn, (0UL<<8)|NELEMS(rsdc_insn), CPU_486|CPU_Cyrix|CPU_SMM, NONE -rsldt, cyrixsmm_insn, (0x7BUL<<8)|NELEMS(cyrixsmm_insn), CPU_486|CPU_Cyrix|CPU_SMM, NONE -rsm, twobyte_insn, (0x0FAAUL<<8)|NELEMS(twobyte_insn), CPU_586|CPU_SMM, NONE -rsqrtps, sseps_insn, (0x52UL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE -rsqrtss, ssess_insn, (0xF352UL<<8)|NELEMS(ssess_insn), CPU_SSE, NONE -rsts, cyrixsmm_insn, (0x7DUL<<8)|NELEMS(cyrixsmm_insn), CPU_486|CPU_Cyrix|CPU_SMM, NONE -sahf, onebyte_insn, (0x00009EUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -sal, shift_insn, (0x04UL<<8)|NELEMS(shift_insn), CPU_Any, NONE -salc, onebyte_insn, (0x0000D6UL<<8)|NELEMS(onebyte_insn), CPU_Not64|CPU_Undoc, NONE -sar, shift_insn, (0x07UL<<8)|NELEMS(shift_insn), CPU_Any, NONE -sbb, arith_insn, (0x0318UL<<8)|NELEMS(arith_insn), CPU_Any, NONE -scasb, onebyte_insn, (0x0000AEUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -scasd, onebyte_insn, (0x0020AFUL<<8)|NELEMS(onebyte_insn), CPU_386, NONE -scasq, onebyte_insn, (0x0040AFUL<<8)|NELEMS(onebyte_insn), CPU_64, NONE -scasw, onebyte_insn, (0x0010AFUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -seta, setcc_insn, (0x07UL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setae, setcc_insn, (0x03UL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setb, setcc_insn, (0x02UL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setbe, setcc_insn, (0x06UL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setc, setcc_insn, (0x02UL<<8)|NELEMS(setcc_insn), CPU_386, NONE -sete, setcc_insn, (0x04UL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setg, setcc_insn, (0x0FUL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setge, setcc_insn, (0x0DUL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setl, setcc_insn, (0x0CUL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setle, setcc_insn, (0x0EUL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setna, setcc_insn, (0x06UL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setnae, setcc_insn, (0x02UL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setnb, setcc_insn, (0x03UL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setnbe, setcc_insn, (0x07UL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setnc, setcc_insn, (0x03UL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setne, setcc_insn, (0x05UL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setng, setcc_insn, (0x0EUL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setnge, setcc_insn, (0x0CUL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setnl, setcc_insn, (0x0DUL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setnle, setcc_insn, (0x0FUL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setno, setcc_insn, (0x01UL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setnp, setcc_insn, (0x0BUL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setns, setcc_insn, (0x09UL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setnz, setcc_insn, (0x05UL<<8)|NELEMS(setcc_insn), CPU_386, NONE -seto, setcc_insn, (0x00UL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setp, setcc_insn, (0x0AUL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setpe, setcc_insn, (0x0AUL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setpo, setcc_insn, (0x0BUL<<8)|NELEMS(setcc_insn), CPU_386, NONE -sets, setcc_insn, (0x08UL<<8)|NELEMS(setcc_insn), CPU_386, NONE -setz, setcc_insn, (0x04UL<<8)|NELEMS(setcc_insn), CPU_386, NONE -sfence, threebyte_insn, (0x0FAEF8UL<<8)|NELEMS(threebyte_insn), CPU_P3, NONE -sgdt, twobytemem_insn, (0x000F01UL<<8)|NELEMS(twobytemem_insn), CPU_286|CPU_Priv, NONE -shl, shift_insn, (0x04UL<<8)|NELEMS(shift_insn), CPU_Any, NONE -shld, shlrd_insn, (0xA4UL<<8)|NELEMS(shlrd_insn), CPU_386, NONE -shr, shift_insn, (0x05UL<<8)|NELEMS(shift_insn), CPU_Any, NONE -shrd, shlrd_insn, (0xACUL<<8)|NELEMS(shlrd_insn), CPU_386, NONE -shufpd, ssessimm_insn, (0x66C6UL<<8)|NELEMS(ssessimm_insn), CPU_SSE2, NONE -shufps, ssepsimm_insn, (0xC6UL<<8)|NELEMS(ssepsimm_insn), CPU_SSE, NONE -sidt, twobytemem_insn, (0x010F01UL<<8)|NELEMS(twobytemem_insn), CPU_286|CPU_Priv, NONE -skinit, skinit_insn, (0UL<<8)|NELEMS(skinit_insn), CPU_SVM, NONE -sldt, sldtmsw_insn, (0x0000UL<<8)|NELEMS(sldtmsw_insn), CPU_286, NONE -smi, onebyte_insn, (0x0000F1UL<<8)|NELEMS(onebyte_insn), CPU_386|CPU_Undoc, NONE -smint, twobyte_insn, (0x0F38UL<<8)|NELEMS(twobyte_insn), CPU_686|CPU_Cyrix, NONE -smintold, twobyte_insn, (0x0F7EUL<<8)|NELEMS(twobyte_insn), CPU_486|CPU_Cyrix|CPU_Obs, NONE -smsw, sldtmsw_insn, (0x0401UL<<8)|NELEMS(sldtmsw_insn), CPU_286, NONE -sqrtpd, ssess_insn, (0x6651UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -sqrtps, sseps_insn, (0x51UL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE -sqrtsd, ssess_insn, (0xF251UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -sqrtss, ssess_insn, (0xF351UL<<8)|NELEMS(ssess_insn), CPU_SSE, NONE -stc, onebyte_insn, (0x0000F9UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -std, onebyte_insn, (0x0000FDUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -stgi, threebyte_insn, (0x0F01DCUL<<8)|NELEMS(threebyte_insn), CPU_SVM, NONE -sti, onebyte_insn, (0x0000FBUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -stmxcsr, ldstmxcsr_insn, (0x03UL<<8)|NELEMS(ldstmxcsr_insn), CPU_SSE, NONE -stosb, onebyte_insn, (0x0000AAUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -stosd, onebyte_insn, (0x0020ABUL<<8)|NELEMS(onebyte_insn), CPU_386, NONE -stosq, onebyte_insn, (0x0040ABUL<<8)|NELEMS(onebyte_insn), CPU_64, NONE -stosw, onebyte_insn, (0x0010ABUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -str, str_insn, (0UL<<8)|NELEMS(str_insn), CPU_286|CPU_Prot, NONE -sub, arith_insn, (0x0528UL<<8)|NELEMS(arith_insn), CPU_Any, NONE -subpd, ssess_insn, (0x665CUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -subps, sseps_insn, (0x5CUL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE -subsd, ssess_insn, (0xF25CUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -subss, ssess_insn, (0xF35CUL<<8)|NELEMS(ssess_insn), CPU_SSE, NONE -svdc, svdc_insn, (0UL<<8)|NELEMS(svdc_insn), CPU_486|CPU_Cyrix|CPU_SMM, NONE -svldt, cyrixsmm_insn, (0x7AUL<<8)|NELEMS(cyrixsmm_insn), CPU_486|CPU_Cyrix|CPU_SMM, NONE -svts, cyrixsmm_insn, (0x7CUL<<8)|NELEMS(cyrixsmm_insn), CPU_486|CPU_Cyrix|CPU_SMM, NONE -swapgs, threebyte_insn, (0x0F01F8UL<<8)|NELEMS(threebyte_insn), CPU_64, NONE -syscall, twobyte_insn, (0x0F05UL<<8)|NELEMS(twobyte_insn), CPU_686|CPU_AMD, NONE -sysenter, twobyte_insn, (0x0F34UL<<8)|NELEMS(twobyte_insn), CPU_686|CPU_Not64, NONE -sysexit, twobyte_insn, (0x0F35UL<<8)|NELEMS(twobyte_insn), CPU_686|CPU_Not64|CPU_Priv, NONE -sysret, twobyte_insn, (0x0F07UL<<8)|NELEMS(twobyte_insn), CPU_686|CPU_AMD|CPU_Priv, NONE -test, test_insn, (0UL<<8)|NELEMS(test_insn), CPU_Any, NONE -ucomisd, ssess_insn, (0x662EUL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -ucomiss, ssess_insn, (0x002EUL<<8)|NELEMS(ssess_insn), CPU_SSE, NONE -ud1, twobyte_insn, (0x0FB9UL<<8)|NELEMS(twobyte_insn), CPU_286|CPU_Undoc, NONE -ud2, twobyte_insn, (0x0F0BUL<<8)|NELEMS(twobyte_insn), CPU_286, NONE -umov, umov_insn, (0UL<<8)|NELEMS(umov_insn), CPU_386|CPU_Undoc, NONE -unpckhpd, ssess_insn, (0x6615UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -unpckhps, sseps_insn, (0x15UL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE -unpcklpd, ssess_insn, (0x6614UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -unpcklps, sseps_insn, (0x14UL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE -verr, prot286_insn, (0x0400UL<<8)|NELEMS(prot286_insn), CPU_286|CPU_Prot, NONE -verw, prot286_insn, (0x0500UL<<8)|NELEMS(prot286_insn), CPU_286|CPU_Prot, NONE -vmcall, threebyte_insn, (0x0F01C1UL<<8)|NELEMS(threebyte_insn), CPU_P4, NONE -vmclear, vmxthreebytemem_insn, (0x66UL<<8)|NELEMS(vmxthreebytemem_insn), CPU_P4, NONE -vmlaunch, threebyte_insn, (0x0F01C2UL<<8)|NELEMS(threebyte_insn), CPU_P4, NONE -vmload, svm_rax_insn, (0xDAUL<<8)|NELEMS(svm_rax_insn), CPU_SVM, NONE -vmmcall, threebyte_insn, (0x0F01D9UL<<8)|NELEMS(threebyte_insn), CPU_SVM, NONE -vmptrld, vmxtwobytemem_insn, (0x06UL<<8)|NELEMS(vmxtwobytemem_insn), CPU_P4, NONE -vmptrst, vmxtwobytemem_insn, (0x07UL<<8)|NELEMS(vmxtwobytemem_insn), CPU_P4, NONE -vmread, vmxmemrd_insn, (0UL<<8)|NELEMS(vmxmemrd_insn), CPU_P4, NONE -vmresume, threebyte_insn, (0x0F01C3UL<<8)|NELEMS(threebyte_insn), CPU_P4, NONE -vmrun, svm_rax_insn, (0xD8UL<<8)|NELEMS(svm_rax_insn), CPU_SVM, NONE -vmsave, svm_rax_insn, (0xDBUL<<8)|NELEMS(svm_rax_insn), CPU_SVM, NONE -vmwrite, vmxmemwr_insn, (0UL<<8)|NELEMS(vmxmemwr_insn), CPU_P4, NONE -vmxoff, threebyte_insn, (0x0F01C4UL<<8)|NELEMS(threebyte_insn), CPU_P4, NONE -vmxon, vmxthreebytemem_insn, (0xF3UL<<8)|NELEMS(vmxthreebytemem_insn), CPU_P4, NONE -wait, onebyte_insn, (0x00009BUL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -wbinvd, twobyte_insn, (0x0F09UL<<8)|NELEMS(twobyte_insn), CPU_486|CPU_Priv, NONE -wrmsr, twobyte_insn, (0x0F30UL<<8)|NELEMS(twobyte_insn), CPU_586|CPU_Priv, NONE -wrshr, rdwrshr_insn, (0x01UL<<8)|NELEMS(rdwrshr_insn), CPU_686|CPU_Cyrix|CPU_SMM, NONE -xadd, cmpxchgxadd_insn, (0xC0UL<<8)|NELEMS(cmpxchgxadd_insn), CPU_486, NONE -xbts, xbts_insn, (0UL<<8)|NELEMS(xbts_insn), CPU_386|CPU_Obs|CPU_Undoc, NONE -xchg, xchg_insn, (0UL<<8)|NELEMS(xchg_insn), CPU_Any, NONE -xcryptcbc, padlock_insn, (0xD0F3A7UL<<8)|NELEMS(padlock_insn), CPU_PadLock, NONE -xcryptcfb, padlock_insn, (0xE0F3A7UL<<8)|NELEMS(padlock_insn), CPU_PadLock, NONE -xcryptctr, padlock_insn, (0xD8F3A7UL<<8)|NELEMS(padlock_insn), CPU_PadLock, NONE -xcryptecb, padlock_insn, (0xC8F3A7UL<<8)|NELEMS(padlock_insn), CPU_PadLock, NONE -xcryptofb, padlock_insn, (0xE8F3A7UL<<8)|NELEMS(padlock_insn), CPU_PadLock, NONE -xlatb, onebyte_insn, (0x0000D7UL<<8)|NELEMS(onebyte_insn), CPU_Any, NONE -xor, arith_insn, (0x0630UL<<8)|NELEMS(arith_insn), CPU_Any, NONE -xorpd, ssess_insn, (0x6657UL<<8)|NELEMS(ssess_insn), CPU_SSE2, NONE -xorps, sseps_insn, (0x57UL<<8)|NELEMS(sseps_insn), CPU_SSE, NONE -xsha1, padlock_insn, (0xC8F3A6UL<<8)|NELEMS(padlock_insn), CPU_PadLock, NONE -xsha256, padlock_insn, (0xD0F3A6UL<<8)|NELEMS(padlock_insn), CPU_PadLock, NONE -xstore, padlock_insn, (0xC000A7UL<<8)|NELEMS(padlock_insn), CPU_PadLock, NONE -xstorerng, padlock_insn, (0xC000A7UL<<8)|NELEMS(padlock_insn), CPU_PadLock, NONE +ret, retnf_insn, (0x00C2UL<<8)|6, CPU_Any, NONE +retf, retnf_insn, (0x40CAUL<<8)|6, CPU_Any, NONE +retn, retnf_insn, (0x00C2UL<<8)|6, CPU_Any, NONE +rol, shift_insn, (0x00UL<<8)|16, CPU_Any, NONE +ror, shift_insn, (0x01UL<<8)|16, CPU_Any, NONE +roundpd, sse4imm_insn, (0x09UL<<8)|1, CPU_SSE41, NONE +roundps, sse4imm_insn, (0x08UL<<8)|1, CPU_SSE41, NONE +roundsd, sse4imm_insn, (0x0BUL<<8)|1, CPU_SSE41, NONE +roundss, sse4imm_insn, (0x0AUL<<8)|1, CPU_SSE41, NONE +rsdc, rsdc_insn, (0UL<<8)|1, CPU_486|CPU_Cyrix|CPU_SMM, NONE +rsldt, cyrixsmm_insn, (0x7BUL<<8)|1, CPU_486|CPU_Cyrix|CPU_SMM, NONE +rsm, twobyte_insn, (0x0FAAUL<<8)|1, CPU_586|CPU_SMM, NONE +rsqrtps, sseps_insn, (0x52UL<<8)|1, CPU_SSE, NONE +rsqrtss, ssess_insn, (0xF352UL<<8)|1, CPU_SSE, NONE +rsts, cyrixsmm_insn, (0x7DUL<<8)|1, CPU_486|CPU_Cyrix|CPU_SMM, NONE +sahf, onebyte_insn, (0x00009EUL<<8)|1, CPU_Any, NONE +sal, shift_insn, (0x04UL<<8)|16, CPU_Any, NONE +salc, onebyte_insn, (0x0000D6UL<<8)|1, CPU_Not64|CPU_Undoc, NONE +sar, shift_insn, (0x07UL<<8)|16, CPU_Any, NONE +sbb, arith_insn, (0x0318UL<<8)|22, CPU_Any, NONE +scasb, onebyte_insn, (0x0000AEUL<<8)|1, CPU_Any, NONE +scasd, onebyte_insn, (0x0020AFUL<<8)|1, CPU_386, NONE +scasq, onebyte_insn, (0x0040AFUL<<8)|1, CPU_64, NONE +scasw, onebyte_insn, (0x0010AFUL<<8)|1, CPU_Any, NONE +seta, setcc_insn, (0x07UL<<8)|1, CPU_386, NONE +setae, setcc_insn, (0x03UL<<8)|1, CPU_386, NONE +setb, setcc_insn, (0x02UL<<8)|1, CPU_386, NONE +setbe, setcc_insn, (0x06UL<<8)|1, CPU_386, NONE +setc, setcc_insn, (0x02UL<<8)|1, CPU_386, NONE +sete, setcc_insn, (0x04UL<<8)|1, CPU_386, NONE +setg, setcc_insn, (0x0FUL<<8)|1, CPU_386, NONE +setge, setcc_insn, (0x0DUL<<8)|1, CPU_386, NONE +setl, setcc_insn, (0x0CUL<<8)|1, CPU_386, NONE +setle, setcc_insn, (0x0EUL<<8)|1, CPU_386, NONE +setna, setcc_insn, (0x06UL<<8)|1, CPU_386, NONE +setnae, setcc_insn, (0x02UL<<8)|1, CPU_386, NONE +setnb, setcc_insn, (0x03UL<<8)|1, CPU_386, NONE +setnbe, setcc_insn, (0x07UL<<8)|1, CPU_386, NONE +setnc, setcc_insn, (0x03UL<<8)|1, CPU_386, NONE +setne, setcc_insn, (0x05UL<<8)|1, CPU_386, NONE +setng, setcc_insn, (0x0EUL<<8)|1, CPU_386, NONE +setnge, setcc_insn, (0x0CUL<<8)|1, CPU_386, NONE +setnl, setcc_insn, (0x0DUL<<8)|1, CPU_386, NONE +setnle, setcc_insn, (0x0FUL<<8)|1, CPU_386, NONE +setno, setcc_insn, (0x01UL<<8)|1, CPU_386, NONE +setnp, setcc_insn, (0x0BUL<<8)|1, CPU_386, NONE +setns, setcc_insn, (0x09UL<<8)|1, CPU_386, NONE +setnz, setcc_insn, (0x05UL<<8)|1, CPU_386, NONE +seto, setcc_insn, (0x00UL<<8)|1, CPU_386, NONE +setp, setcc_insn, (0x0AUL<<8)|1, CPU_386, NONE +setpe, setcc_insn, (0x0AUL<<8)|1, CPU_386, NONE +setpo, setcc_insn, (0x0BUL<<8)|1, CPU_386, NONE +sets, setcc_insn, (0x08UL<<8)|1, CPU_386, NONE +setz, setcc_insn, (0x04UL<<8)|1, CPU_386, NONE +sfence, threebyte_insn, (0x0FAEF8UL<<8)|1, CPU_P3, NONE +sgdt, twobytemem_insn, (0x000F01UL<<8)|1, CPU_286|CPU_Priv, NONE +shl, shift_insn, (0x04UL<<8)|16, CPU_Any, NONE +shld, shlrd_insn, (0xA4UL<<8)|9, CPU_386, NONE +shr, shift_insn, (0x05UL<<8)|16, CPU_Any, NONE +shrd, shlrd_insn, (0xACUL<<8)|9, CPU_386, NONE +shufpd, ssessimm_insn, (0x66C6UL<<8)|1, CPU_SSE2, NONE +shufps, ssepsimm_insn, (0xC6UL<<8)|1, CPU_SSE, NONE +sidt, twobytemem_insn, (0x010F01UL<<8)|1, CPU_286|CPU_Priv, NONE +skinit, skinit_insn, (0UL<<8)|2, CPU_SVM, NONE +sldt, sldtmsw_insn, (0x0000UL<<8)|6, CPU_286, NONE +smi, onebyte_insn, (0x0000F1UL<<8)|1, CPU_386|CPU_Undoc, NONE +smint, twobyte_insn, (0x0F38UL<<8)|1, CPU_686|CPU_Cyrix, NONE +smintold, twobyte_insn, (0x0F7EUL<<8)|1, CPU_486|CPU_Cyrix|CPU_Obs, NONE +smsw, sldtmsw_insn, (0x0401UL<<8)|6, CPU_286, NONE +sqrtpd, ssess_insn, (0x6651UL<<8)|1, CPU_SSE2, NONE +sqrtps, sseps_insn, (0x51UL<<8)|1, CPU_SSE, NONE +sqrtsd, ssess_insn, (0xF251UL<<8)|1, CPU_SSE2, NONE +sqrtss, ssess_insn, (0xF351UL<<8)|1, CPU_SSE, NONE +stc, onebyte_insn, (0x0000F9UL<<8)|1, CPU_Any, NONE +std, onebyte_insn, (0x0000FDUL<<8)|1, CPU_Any, NONE +stgi, threebyte_insn, (0x0F01DCUL<<8)|1, CPU_SVM, NONE +sti, onebyte_insn, (0x0000FBUL<<8)|1, CPU_Any, NONE +stmxcsr, ldstmxcsr_insn, (0x03UL<<8)|1, CPU_SSE, NONE +stosb, onebyte_insn, (0x0000AAUL<<8)|1, CPU_Any, NONE +stosd, onebyte_insn, (0x0020ABUL<<8)|1, CPU_386, NONE +stosq, onebyte_insn, (0x0040ABUL<<8)|1, CPU_64, NONE +stosw, onebyte_insn, (0x0010ABUL<<8)|1, CPU_Any, NONE +str, str_insn, (0UL<<8)|4, CPU_286|CPU_Prot, NONE +sub, arith_insn, (0x0528UL<<8)|22, CPU_Any, NONE +subpd, ssess_insn, (0x665CUL<<8)|1, CPU_SSE2, NONE +subps, sseps_insn, (0x5CUL<<8)|1, CPU_SSE, NONE +subsd, ssess_insn, (0xF25CUL<<8)|1, CPU_SSE2, NONE +subss, ssess_insn, (0xF35CUL<<8)|1, CPU_SSE, NONE +svdc, svdc_insn, (0UL<<8)|1, CPU_486|CPU_Cyrix|CPU_SMM, NONE +svldt, cyrixsmm_insn, (0x7AUL<<8)|1, CPU_486|CPU_Cyrix|CPU_SMM, NONE +svts, cyrixsmm_insn, (0x7CUL<<8)|1, CPU_486|CPU_Cyrix|CPU_SMM, NONE +swapgs, threebyte_insn, (0x0F01F8UL<<8)|1, CPU_64, NONE +syscall, twobyte_insn, (0x0F05UL<<8)|1, CPU_686|CPU_AMD, NONE +sysenter, twobyte_insn, (0x0F34UL<<8)|1, CPU_686|CPU_Not64, NONE +sysexit, twobyte_insn, (0x0F35UL<<8)|1, CPU_686|CPU_Not64|CPU_Priv, NONE +sysret, twobyte_insn, (0x0F07UL<<8)|1, CPU_686|CPU_AMD|CPU_Priv, NONE +test, test_insn, (0UL<<8)|20, CPU_Any, NONE +ucomisd, ssess_insn, (0x662EUL<<8)|1, CPU_SSE2, NONE +ucomiss, ssess_insn, (0x002EUL<<8)|1, CPU_SSE, NONE +ud1, twobyte_insn, (0x0FB9UL<<8)|1, CPU_286|CPU_Undoc, NONE +ud2, twobyte_insn, (0x0F0BUL<<8)|1, CPU_286, NONE +umov, umov_insn, (0UL<<8)|6, CPU_386|CPU_Undoc, NONE +unpckhpd, ssess_insn, (0x6615UL<<8)|1, CPU_SSE2, NONE +unpckhps, sseps_insn, (0x15UL<<8)|1, CPU_SSE, NONE +unpcklpd, ssess_insn, (0x6614UL<<8)|1, CPU_SSE2, NONE +unpcklps, sseps_insn, (0x14UL<<8)|1, CPU_SSE, NONE +verr, prot286_insn, (0x0400UL<<8)|1, CPU_286|CPU_Prot, NONE +verw, prot286_insn, (0x0500UL<<8)|1, CPU_286|CPU_Prot, NONE +vmcall, threebyte_insn, (0x0F01C1UL<<8)|1, CPU_P4, NONE +vmclear, vmxthreebytemem_insn, (0x66UL<<8)|1, CPU_P4, NONE +vmlaunch, threebyte_insn, (0x0F01C2UL<<8)|1, CPU_P4, NONE +vmload, svm_rax_insn, (0xDAUL<<8)|2, CPU_SVM, NONE +vmmcall, threebyte_insn, (0x0F01D9UL<<8)|1, CPU_SVM, NONE +vmptrld, vmxtwobytemem_insn, (0x06UL<<8)|1, CPU_P4, NONE +vmptrst, vmxtwobytemem_insn, (0x07UL<<8)|1, CPU_P4, NONE +vmread, vmxmemrd_insn, (0UL<<8)|2, CPU_P4, NONE +vmresume, threebyte_insn, (0x0F01C3UL<<8)|1, CPU_P4, NONE +vmrun, svm_rax_insn, (0xD8UL<<8)|2, CPU_SVM, NONE +vmsave, svm_rax_insn, (0xDBUL<<8)|2, CPU_SVM, NONE +vmwrite, vmxmemwr_insn, (0UL<<8)|2, CPU_P4, NONE +vmxoff, threebyte_insn, (0x0F01C4UL<<8)|1, CPU_P4, NONE +vmxon, vmxthreebytemem_insn, (0xF3UL<<8)|1, CPU_P4, NONE +wait, onebyte_insn, (0x00009BUL<<8)|1, CPU_Any, NONE +wbinvd, twobyte_insn, (0x0F09UL<<8)|1, CPU_486|CPU_Priv, NONE +wrmsr, twobyte_insn, (0x0F30UL<<8)|1, CPU_586|CPU_Priv, NONE +wrshr, rdwrshr_insn, (0x01UL<<8)|1, CPU_686|CPU_Cyrix|CPU_SMM, NONE +xadd, cmpxchgxadd_insn, (0xC0UL<<8)|4, CPU_486, NONE +xbts, xbts_insn, (0UL<<8)|2, CPU_386|CPU_Obs|CPU_Undoc, NONE +xchg, xchg_insn, (0UL<<8)|16, CPU_Any, NONE +xcryptcbc, padlock_insn, (0xD0F3A7UL<<8)|1, CPU_PadLock, NONE +xcryptcfb, padlock_insn, (0xE0F3A7UL<<8)|1, CPU_PadLock, NONE +xcryptctr, padlock_insn, (0xD8F3A7UL<<8)|1, CPU_PadLock, NONE +xcryptecb, padlock_insn, (0xC8F3A7UL<<8)|1, CPU_PadLock, NONE +xcryptofb, padlock_insn, (0xE8F3A7UL<<8)|1, CPU_PadLock, NONE +xlatb, onebyte_insn, (0x0000D7UL<<8)|1, CPU_Any, NONE +xor, arith_insn, (0x0630UL<<8)|22, CPU_Any, NONE +xorpd, ssess_insn, (0x6657UL<<8)|1, CPU_SSE2, NONE +xorps, sseps_insn, (0x57UL<<8)|1, CPU_SSE, NONE +xsha1, padlock_insn, (0xC8F3A6UL<<8)|1, CPU_PadLock, NONE +xsha256, padlock_insn, (0xD0F3A6UL<<8)|1, CPU_PadLock, NONE +xstore, padlock_insn, (0xC000A7UL<<8)|1, CPU_PadLock, NONE +xstorerng, padlock_insn, (0xC000A7UL<<8)|1, CPU_PadLock, NONE diff --git a/x86insns.c b/x86insns.c index 240e4a0e..ea70c478 100644 --- a/x86insns.c +++ b/x86insns.c @@ -1,1104 +1,1560 @@ +static const unsigned long insn_operands[] = { + OPT_SIMDReg|OPS_128|OPA_Spare, + OPT_SIMDReg|OPS_128|OPA_EA, + OPT_Imm|OPS_8|OPS_Relaxed|OPA_EA, + OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, + OPT_Reg|OPS_16|OPA_Spare, + OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, + OPT_Imm|OPS_8|OPA_SImm, + OPT_Reg|OPS_32|OPA_Spare, + OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, + OPT_Imm|OPS_8|OPA_SImm, + OPT_Reg|OPS_64|OPA_Spare, + OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, + OPT_Imm|OPS_8|OPA_SImm, + OPT_Reg|OPS_16|OPA_Spare, + OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, + OPT_Imm|OPS_16|OPS_Relaxed|OPA_SImm|OPAP_SImm8, + OPT_Reg|OPS_32|OPA_Spare, + OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, + OPT_Imm|OPS_32|OPS_Relaxed|OPA_SImm|OPAP_SImm8, + OPT_Reg|OPS_64|OPA_Spare, + OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, + OPT_Imm|OPS_32|OPS_Relaxed|OPA_SImm|OPAP_SImm8, + OPT_SIMDReg|OPS_64|OPA_Spare, + OPT_Reg|OPS_32|OPA_EA, + OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, + OPT_SIMDReg|OPS_64|OPA_Spare, + OPT_Reg|OPS_64|OPA_EA, + OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, + OPT_SIMDReg|OPS_64|OPA_Spare, + OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, + OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, + OPT_SIMDReg|OPS_128|OPA_Spare, + OPT_Reg|OPS_32|OPA_EA, + OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, + OPT_SIMDReg|OPS_128|OPA_Spare, + OPT_Reg|OPS_64|OPA_EA, + OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, + OPT_SIMDReg|OPS_128|OPA_Spare, + OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, + OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, + OPT_SIMDReg|OPS_128|OPA_Spare, + OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, + OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, + OPT_SIMDReg|OPS_128|OPA_Spare, + OPT_Mem|OPS_8|OPS_Relaxed|OPA_EA, + OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, + OPT_SIMDReg|OPS_128|OPA_Spare, + OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, + OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, + OPT_Reg|OPS_32|OPA_Spare, + OPT_SIMDReg|OPS_64|OPA_EA, + OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, + OPT_Reg|OPS_32|OPA_Spare, + OPT_SIMDReg|OPS_128|OPA_EA, + OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, + OPT_Reg|OPS_64|OPA_Spare, + OPT_SIMDReg|OPS_64|OPA_EA, + OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, + OPT_Reg|OPS_64|OPA_Spare, + OPT_SIMDReg|OPS_128|OPA_EA, + OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, + OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, + OPT_SIMDReg|OPS_128|OPA_Spare, + OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, + OPT_Reg|OPS_32|OPA_EA, + OPT_SIMDReg|OPS_128|OPA_Spare, + OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, + OPT_Reg|OPS_64|OPA_EA, + OPT_SIMDReg|OPS_128|OPA_Spare, + OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, + OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, + OPT_SIMDReg|OPS_128|OPA_Spare, + OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, + OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, + OPT_SIMDReg|OPS_128|OPA_Spare, + OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, + OPT_Mem|OPS_8|OPS_Relaxed|OPA_EA, + OPT_SIMDReg|OPS_128|OPA_Spare, + OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, + OPT_SIMDReg|OPS_128|OPA_Spare, + OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, + OPT_XMM0|OPS_128|OPA_None, + OPT_SIMDReg|OPS_64|OPA_Spare, + OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, + OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, + OPT_SIMDReg|OPS_128|OPA_Spare, + OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, + OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, + OPT_SIMDReg|OPS_128|OPA_Spare, + OPT_SIMDReg|OPS_128|OPA_EA, + OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, + OPT_SIMDReg|OPS_128|OPA_Spare, + OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, + OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, + OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, + OPT_Reg|OPS_16|OPA_Spare, + OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, + OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, + OPT_Reg|OPS_16|OPA_Spare, + OPT_Creg|OPS_8|OPA_None, + OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, + OPT_Reg|OPS_32|OPA_Spare, + OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, + OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, + OPT_Reg|OPS_32|OPA_Spare, + OPT_Creg|OPS_8|OPA_None, + OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, + OPT_Reg|OPS_64|OPA_Spare, + OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, + OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, + OPT_Reg|OPS_64|OPA_Spare, + OPT_Creg|OPS_8|OPA_None, + OPT_RM|OPS_16|OPA_EA, + OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, + OPT_RM|OPS_32|OPA_EA, + OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, + OPT_RM|OPS_64|OPA_EA, + OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, + OPT_SIMDReg|OPS_64|OPA_Spare, + OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, + OPT_SIMDReg|OPS_64|OPA_Spare, + OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, + OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, + OPT_SIMDReg|OPS_64|OPA_Spare, + OPT_Reg|OPS_16|OPA_SpareEA, + OPT_Imm|OPS_8|OPA_SImm, + OPT_Reg|OPS_32|OPA_SpareEA, + OPT_Imm|OPS_8|OPA_SImm, + OPT_Reg|OPS_64|OPA_SpareEA, + OPT_Imm|OPS_8|OPA_SImm, + OPT_Reg|OPS_16|OPA_SpareEA, + OPT_Imm|OPS_16|OPS_Relaxed|OPA_SImm|OPAP_SImm8, + OPT_Reg|OPS_32|OPA_SpareEA, + OPT_Imm|OPS_32|OPS_Relaxed|OPA_SImm|OPAP_SImm8, + OPT_Reg|OPS_64|OPA_SpareEA, + OPT_Imm|OPS_32|OPS_Relaxed|OPA_SImm|OPAP_SImm8, + OPT_SIMDReg|OPS_64|OPA_Spare, + OPT_SIMDReg|OPS_128|OPA_EA, + OPT_SIMDReg|OPS_64|OPA_Spare, + OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, + OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, + OPT_Reg|OPS_8|OPA_Spare, + OPT_Reg|OPS_8|OPA_Spare, + OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, + OPT_ST0|OPS_80|OPA_None, + OPT_Reg|OPS_80|OPA_Op1Add, + OPT_Reg|OPS_80|OPA_Op1Add, + OPT_ST0|OPS_80|OPA_None, + OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, + OPT_SIMDReg|OPS_64|OPA_Spare, + OPT_SIMDReg|OPS_128|OPA_Spare, + OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, + OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, + OPT_SIMDReg|OPS_128|OPA_Spare, + OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, + OPT_Reg|OPS_32|OPA_Spare, + OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, + OPT_Reg|OPS_64|OPA_Spare, + OPT_Areg|OPS_8|OPA_None, + OPT_MemOffs|OPS_8|OPS_Relaxed|OPEAS_64|OPA_EA, + OPT_Areg|OPS_16|OPA_None, + OPT_MemOffs|OPS_16|OPS_Relaxed|OPEAS_64|OPA_EA, + OPT_Areg|OPS_32|OPA_None, + OPT_MemOffs|OPS_32|OPS_Relaxed|OPEAS_64|OPA_EA, + OPT_Areg|OPS_64|OPA_None, + OPT_MemOffs|OPS_64|OPS_Relaxed|OPEAS_64|OPA_EA, + OPT_MemOffs|OPS_8|OPS_Relaxed|OPEAS_64|OPA_EA, + OPT_Areg|OPS_8|OPA_None, + OPT_MemOffs|OPS_16|OPS_Relaxed|OPEAS_64|OPA_EA, + OPT_Areg|OPS_16|OPA_None, + OPT_MemOffs|OPS_32|OPS_Relaxed|OPEAS_64|OPA_EA, + OPT_Areg|OPS_32|OPA_None, + OPT_MemOffs|OPS_64|OPS_Relaxed|OPEAS_64|OPA_EA, + OPT_Areg|OPS_64|OPA_None, + OPT_Reg|OPS_64|OPA_Op0Add, + OPT_Imm|OPS_64|OPS_Relaxed|OPA_Imm, + OPT_Reg|OPS_32|OPA_Spare, + OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, + OPT_Reg|OPS_64|OPA_Spare, + OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, + OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, + OPT_SIMDReg|OPS_64|OPA_Spare, + OPT_Areg|OPS_8|OPA_None, + OPT_MemOffs|OPS_8|OPS_Relaxed|OPA_EA, + OPT_Areg|OPS_16|OPA_None, + OPT_MemOffs|OPS_16|OPS_Relaxed|OPA_EA, + OPT_Areg|OPS_32|OPA_None, + OPT_MemOffs|OPS_32|OPS_Relaxed|OPA_EA, + OPT_MemOffs|OPS_8|OPS_Relaxed|OPA_EA, + OPT_Areg|OPS_8|OPA_None, + OPT_MemOffs|OPS_16|OPS_Relaxed|OPA_EA, + OPT_Areg|OPS_16|OPA_None, + OPT_MemOffs|OPS_32|OPS_Relaxed|OPA_EA, + OPT_Areg|OPS_32|OPA_None, + OPT_RM|OPS_8|OPS_Relaxed|OPA_EA|OPAP_ShortMov, + OPT_Areg|OPS_8|OPA_Spare, + OPT_RM|OPS_16|OPS_Relaxed|OPA_EA|OPAP_ShortMov, + OPT_Areg|OPS_16|OPA_Spare, + OPT_RM|OPS_32|OPS_Relaxed|OPA_EA|OPAP_ShortMov, + OPT_Areg|OPS_32|OPA_Spare, + OPT_RM|OPS_64|OPS_Relaxed|OPA_EA|OPAP_ShortMov, + OPT_Areg|OPS_64|OPA_Spare, + OPT_Areg|OPS_8|OPA_Spare, + OPT_RM|OPS_8|OPS_Relaxed|OPA_EA|OPAP_ShortMov, + OPT_Areg|OPS_16|OPA_Spare, + OPT_RM|OPS_16|OPS_Relaxed|OPA_EA|OPAP_ShortMov, + OPT_Areg|OPS_32|OPA_Spare, + OPT_RM|OPS_32|OPS_Relaxed|OPA_EA|OPAP_ShortMov, + OPT_Areg|OPS_64|OPA_Spare, + OPT_RM|OPS_64|OPS_Relaxed|OPA_EA|OPAP_ShortMov, + OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, + OPT_SegReg|OPS_16|OPS_Relaxed|OPA_Spare, + OPT_Reg|OPS_16|OPA_EA, + OPT_SegReg|OPS_16|OPS_Relaxed|OPA_Spare, + OPT_Reg|OPS_32|OPA_EA, + OPT_SegReg|OPS_16|OPS_Relaxed|OPA_Spare, + OPT_Reg|OPS_64|OPA_EA, + OPT_SegReg|OPS_16|OPS_Relaxed|OPA_Spare, + OPT_SegReg|OPS_16|OPS_Relaxed|OPA_Spare, + OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, + OPT_Reg|OPS_8|OPA_Op0Add, + OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, + OPT_Reg|OPS_16|OPA_Op0Add, + OPT_Imm|OPS_16|OPS_Relaxed|OPA_Imm, + OPT_Reg|OPS_32|OPA_Op0Add, + OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm, + OPT_Reg|OPS_64|OPA_Op0Add, + OPT_Imm|OPS_64|OPA_Imm, + OPT_Reg|OPS_64|OPA_Op0Add, + OPT_Imm|OPS_64|OPS_Relaxed|OPA_Imm|OPAP_SImm32Avail, + OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, + OPT_Imm|OPS_8|OPA_Imm, + OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, + OPT_Imm|OPS_16|OPA_Imm, + OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, + OPT_Imm|OPS_32|OPA_Imm, + OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, + OPT_Imm|OPS_32|OPA_Imm, + OPT_RM|OPS_8|OPA_EA, + OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, + OPT_RM|OPS_16|OPA_EA, + OPT_Imm|OPS_16|OPS_Relaxed|OPA_Imm, + OPT_RM|OPS_32|OPA_EA, + OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm, + OPT_RM|OPS_64|OPA_EA, + OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm, + OPT_CR4|OPS_32|OPA_Spare, + OPT_Reg|OPS_32|OPA_EA, + OPT_CRReg|OPS_32|OPA_Spare, + OPT_Reg|OPS_32|OPA_EA, + OPT_CRReg|OPS_32|OPA_Spare, + OPT_Reg|OPS_64|OPA_EA, + OPT_Reg|OPS_32|OPA_EA, + OPT_CR4|OPS_32|OPA_Spare, + OPT_Reg|OPS_64|OPA_EA, + OPT_CRReg|OPS_32|OPA_Spare, + OPT_DRReg|OPS_32|OPA_Spare, + OPT_Reg|OPS_32|OPA_EA, + OPT_DRReg|OPS_32|OPA_Spare, + OPT_Reg|OPS_64|OPA_EA, + OPT_Reg|OPS_64|OPA_EA, + OPT_DRReg|OPS_32|OPA_Spare, + OPT_SIMDReg|OPS_128|OPA_Spare, + OPT_SIMDReg|OPS_64|OPA_EA, + OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, + OPT_SIMDReg|OPS_128|OPA_Spare, + OPT_Areg|OPS_8|OPA_None, + OPT_RM|OPS_8|OPA_EA, + OPT_Areg|OPS_16|OPA_None, + OPT_RM|OPS_16|OPA_EA, + OPT_Areg|OPS_32|OPA_None, + OPT_RM|OPS_32|OPA_EA, + OPT_Areg|OPS_64|OPA_None, + OPT_RM|OPS_64|OPA_EA, + OPT_Mem|OPS_128|OPS_Relaxed|OPA_EA, + OPT_SIMDReg|OPS_128|OPA_Spare, + OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, + OPT_Areg|OPS_8|OPA_None, + OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, + OPT_Areg|OPS_16|OPA_None, + OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, + OPT_Areg|OPS_32|OPA_None, + OPT_Dreg|OPS_16|OPA_None, + OPT_Areg|OPS_8|OPA_None, + OPT_Dreg|OPS_16|OPA_None, + OPT_Areg|OPS_16|OPA_None, + OPT_Dreg|OPS_16|OPA_None, + OPT_Areg|OPS_32|OPA_None, + OPT_SIMDReg|OPS_128|OPA_Spare, + OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, + OPT_MemrAX|OPS_Any|OPA_AdSizeEA, + OPT_Creg|OPS_32|OPA_None, + OPT_Areg|OPS_16|OPA_None, + OPT_Reg|OPS_16|OPA_Op0Add, + OPT_Reg|OPS_16|OPA_Op0Add, + OPT_Areg|OPS_16|OPA_None, + OPT_Areg|OPS_32|OPA_EA, + OPT_Areg|OPS_32|OPA_Spare, + OPT_Areg|OPS_32|OPA_None, + OPT_Reg|OPS_32|OPA_Op0Add, + OPT_Reg|OPS_32|OPA_Op0Add, + OPT_Areg|OPS_32|OPA_None, + OPT_Areg|OPS_64|OPA_None, + OPT_Areg|OPS_64|OPA_Op0Add, + OPT_Reg|OPS_64|OPA_Op0Add, + OPT_Areg|OPS_64|OPA_None, + OPT_Reg|OPS_16|OPA_Spare, + OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, + OPT_Reg|OPS_64|OPA_Spare, + OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, + OPT_SegReg|OPS_16|OPS_Relaxed|OPA_Spare, + OPT_Mem|OPS_80|OPS_Relaxed|OPA_EA, + OPT_Reg|OPS_32|OPA_Spare, + OPT_RM|OPS_8|OPA_EA, + OPT_Reg|OPS_32|OPA_Spare, + OPT_RM|OPS_16|OPA_EA, + OPT_Reg|OPS_64|OPA_Spare, + OPT_RM|OPS_8|OPA_EA, + OPT_RM|OPS_8|OPA_EA, + OPT_Creg|OPS_8|OPA_None, + OPT_RM|OPS_8|OPA_EA, + OPT_Imm1|OPS_8|OPS_Relaxed|OPA_None, + OPT_RM|OPS_16|OPA_EA, + OPT_Creg|OPS_8|OPA_None, + OPT_RM|OPS_16|OPA_EA, + OPT_Imm1|OPS_8|OPS_Relaxed|OPA_None, + OPT_RM|OPS_32|OPA_EA, + OPT_Creg|OPS_8|OPA_None, + OPT_RM|OPS_32|OPA_EA, + OPT_Imm1|OPS_8|OPS_Relaxed|OPA_None, + OPT_RM|OPS_64|OPA_EA, + OPT_Creg|OPS_8|OPA_None, + OPT_RM|OPS_64|OPA_EA, + OPT_Imm1|OPS_8|OPS_Relaxed|OPA_None, + OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, + OPT_SIMDReg|OPS_128|OPA_Spare, + OPT_Reg|OPS_16|OPA_Spare, + OPT_Mem|OPS_Any|OPA_EA, + OPT_Reg|OPS_32|OPA_Spare, + OPT_Mem|OPS_Any|OPA_EA, + OPT_Areg|OPS_16|OPA_None, + OPT_Imm|OPS_16|OPS_Relaxed|OPA_Imm|OPAP_SImm8, + OPT_Areg|OPS_32|OPA_None, + OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm|OPAP_SImm8, + OPT_Areg|OPS_64|OPA_None, + OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm|OPAP_SImm8, + OPT_RM|OPS_16|OPA_EA, + OPT_Imm|OPS_8|OPA_SImm, + OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, + OPT_Imm|OPS_16|OPA_Imm|OPAP_SImm8, + OPT_RM|OPS_16|OPA_EA, + OPT_Imm|OPS_16|OPS_Relaxed|OPA_Imm|OPAP_SImm8, + OPT_RM|OPS_32|OPA_EA, + OPT_Imm|OPS_8|OPA_SImm, + OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, + OPT_Imm|OPS_32|OPA_Imm|OPAP_SImm8, + OPT_RM|OPS_32|OPA_EA, + OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm|OPAP_SImm8, + OPT_RM|OPS_64|OPA_EA, + OPT_Imm|OPS_8|OPA_SImm, + OPT_RM|OPS_64|OPA_EA, + OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm|OPAP_SImm8, + OPT_SIMDReg|OPS_128|OPA_Spare, + OPT_Mem|OPS_128|OPS_Relaxed|OPA_EA, + OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, + OPT_SIMDReg|OPS_128|OPA_Spare, + OPT_Reg|OPS_16|OPA_Spare, + OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, + OPT_Reg|OPS_64|OPA_Spare, + OPT_RM|OPS_16|OPA_EA, + OPT_Imm|OPS_Any|OPA_JmpRel, + OPT_Creg|OPS_16|OPA_AdSizeR, + OPT_Imm|OPS_Any|OPA_JmpRel, + OPT_Creg|OPS_32|OPA_AdSizeR, + OPT_Imm|OPS_Any|OPA_JmpRel, + OPT_Creg|OPS_64|OPA_AdSizeR, + OPT_Imm|OPS_Any|OPTM_Short|OPA_JmpRel, + OPT_Creg|OPS_16|OPA_AdSizeR, + OPT_Imm|OPS_Any|OPTM_Short|OPA_JmpRel, + OPT_Creg|OPS_32|OPA_AdSizeR, + OPT_Imm|OPS_Any|OPTM_Short|OPA_JmpRel, + OPT_Creg|OPS_64|OPA_AdSizeR, + OPT_SIMDReg|OPS_64|OPA_Spare, + OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, + OPT_Areg|OPS_32|OPA_None, + OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, + OPT_Mem|OPS_80|OPS_Relaxed|OPA_EA, + OPT_SegReg|OPS_16|OPS_Relaxed|OPA_Spare, + OPT_Areg|OPS_16|OPA_None, + OPT_Imm|OPS_16|OPS_Relaxed|OPA_Imm, + OPT_Areg|OPS_32|OPA_None, + OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm, + OPT_Areg|OPS_64|OPA_None, + OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm, + OPT_SIMDReg|OPS_128|OPA_Spare, + OPT_Mem|OPS_Any|OPA_EA, + OPT_SIMDReg|OPS_64|OPA_Spare, + OPT_SIMDReg|OPS_64|OPA_EA, + OPT_Imm|OPS_16|OPS_Relaxed|OPA_EA|OPAP_A16, + OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, + OPT_Reg|OPS_64|OPA_Spare, + OPT_RM|OPS_32|OPA_EA, + OPT_Mem|OPS_80|OPA_EA, + OPT_Mem|OPS_16|OPA_EA, + OPT_Mem|OPS_32|OPA_EA, + OPT_Mem|OPS_64|OPA_EA, + OPT_MemEAX|OPS_Any|OPA_None, + OPT_SS|OPS_Any|OPA_None, + OPT_SS|OPS_16|OPA_None, + OPT_SS|OPS_32|OPA_None, + OPT_DS|OPS_Any|OPA_None, + OPT_DS|OPS_16|OPA_None, + OPT_DS|OPS_32|OPA_None, + OPT_ES|OPS_Any|OPA_None, + OPT_ES|OPS_16|OPA_None, + OPT_ES|OPS_32|OPA_None, + OPT_FS|OPS_Any|OPA_None, + OPT_FS|OPS_16|OPA_None, + OPT_FS|OPS_32|OPA_None, + OPT_GS|OPS_Any|OPA_None, + OPT_GS|OPS_16|OPA_None, + OPT_GS|OPS_32|OPA_None, + OPT_ImmNotSegOff|OPS_Any|OPA_JmpRel, + OPT_ImmNotSegOff|OPS_16|OPA_JmpRel, + OPT_ImmNotSegOff|OPS_32|OPA_JmpRel, + OPT_Imm|OPS_16|OPTM_Near|OPA_JmpRel, + OPT_Imm|OPS_32|OPTM_Near|OPA_JmpRel, + OPT_Imm|OPS_Any|OPTM_Near|OPA_JmpRel, + OPT_RM|OPS_16|OPTM_Near|OPA_EA, + OPT_RM|OPS_32|OPTM_Near|OPA_EA, + OPT_RM|OPS_64|OPTM_Near|OPA_EA, + OPT_Mem|OPS_Any|OPTM_Near|OPA_EA, + OPT_Mem|OPS_16|OPTM_Far|OPA_EA, + OPT_Mem|OPS_32|OPTM_Far|OPA_EA, + OPT_Mem|OPS_64|OPTM_Far|OPA_EA, + OPT_Mem|OPS_Any|OPTM_Far|OPA_EA, + OPT_Imm|OPS_16|OPTM_Far|OPA_JmpFar, + OPT_Imm|OPS_32|OPTM_Far|OPA_JmpFar, + OPT_Imm|OPS_Any|OPTM_Far|OPA_JmpFar, + OPT_Imm|OPS_16|OPA_JmpFar, + OPT_Imm|OPS_32|OPA_JmpFar, + OPT_Imm|OPS_Any|OPA_JmpFar, + OPT_Reg|OPS_80|OPTM_To|OPA_Op1Add, + OPT_Reg|OPS_32|OPA_Op1Add, + OPT_Reg|OPS_64|OPA_Op1Add, + OPT_Imm|OPS_16|OPA_JmpRel, + OPT_Imm|OPS_32|OPA_JmpRel, + OPT_Imm|OPS_8|OPS_Relaxed|OPA_SImm, + OPT_Imm|OPS_BITS|OPS_Relaxed|OPA_Imm|OPAP_SImm8, + OPT_Imm|OPS_32|OPA_SImm, + OPT_CS|OPS_Any|OPA_None, + OPT_CS|OPS_16|OPA_None, + OPT_CS|OPS_32|OPA_None +}; + static const x86_insn_info onebyte_insn[] = { - { CPU_Any, MOD_Op0Add|MOD_OpSizeR|MOD_DOpS64R, 0, 0, 0, 1, {0x00, 0, 0}, 0, 0, {0, 0, 0} } + { CPU_Any, MOD_Op0Add|MOD_OpSizeR|MOD_DOpS64R, 0, 0, 0, 1, {0x00, 0, 0}, 0, 0, 0 } }; static const x86_insn_info onebyte_prefix_insn[] = { - { CPU_Any, MOD_Op0Add|MOD_PreAdd, 0, 0, 0x00, 1, {0x00, 0, 0}, 0, 0, {0, 0, 0} } + { CPU_Any, MOD_Op0Add|MOD_PreAdd, 0, 0, 0x00, 1, {0x00, 0, 0}, 0, 0, 0 } }; static const x86_insn_info twobyte_insn[] = { - { CPU_Any, MOD_Op1Add|MOD_Op0Add|MOD_GasSufL|MOD_GasSufQ, 0, 0, 0, 2, {0x00, 0x00, 0}, 0, 0, {0, 0, 0} } + { CPU_Any, MOD_Op1Add|MOD_Op0Add|MOD_GasSufL|MOD_GasSufQ, 0, 0, 0, 2, {0x00, 0x00, 0}, 0, 0, 0 } }; static const x86_insn_info threebyte_insn[] = { - { CPU_Any, MOD_Op2Add|MOD_Op1Add|MOD_Op0Add, 0, 0, 0, 3, {0x00, 0x00, 0x00}, 0, 0, {0, 0, 0} } + { CPU_Any, MOD_Op2Add|MOD_Op1Add|MOD_Op0Add, 0, 0, 0, 3, {0x00, 0x00, 0x00}, 0, 0, 0 } }; static const x86_insn_info onebytemem_insn[] = { - { CPU_Any, MOD_Op0Add|MOD_SpAdd|MOD_GasSufL|MOD_GasSufQ|MOD_GasSufS, 0, 0, 0, 1, {0x00, 0, 0}, 0, 1, {OPT_Mem|OPS_Any|OPA_EA, 0, 0} } + { CPU_Any, MOD_Op0Add|MOD_SpAdd|MOD_GasSufL|MOD_GasSufQ|MOD_GasSufS, 0, 0, 0, 1, {0x00, 0, 0}, 0, 1, 337 } }; static const x86_insn_info twobytemem_insn[] = { - { CPU_Any, MOD_Op1Add|MOD_Op0Add|MOD_SpAdd|MOD_GasSufL|MOD_GasSufQ|MOD_GasSufS|MOD_GasSufW, 0, 0, 0, 2, {0x00, 0x00, 0}, 0, 1, {OPT_Mem|OPS_Any|OPA_EA, 0, 0} } + { CPU_Any, MOD_Op1Add|MOD_Op0Add|MOD_SpAdd|MOD_GasSufL|MOD_GasSufQ|MOD_GasSufS|MOD_GasSufW, 0, 0, 0, 2, {0x00, 0x00, 0}, 0, 1, 337 } }; static const x86_insn_info mov_insn[] = { - { CPU_Not64, MOD_GasSufB, 0, 0, 0, 1, {0xA0, 0, 0}, 0, 2, {OPT_Areg|OPS_8|OPA_None, OPT_MemOffs|OPS_8|OPS_Relaxed|OPA_EA, 0} }, - { CPU_Not64, MOD_GasSufW, 16, 0, 0, 1, {0xA1, 0, 0}, 0, 2, {OPT_Areg|OPS_16|OPA_None, OPT_MemOffs|OPS_16|OPS_Relaxed|OPA_EA, 0} }, - { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0xA1, 0, 0}, 0, 2, {OPT_Areg|OPS_32|OPA_None, OPT_MemOffs|OPS_32|OPS_Relaxed|OPA_EA, 0} }, - { CPU_Not64, MOD_GasSufB, 0, 0, 0, 1, {0xA2, 0, 0}, 0, 2, {OPT_MemOffs|OPS_8|OPS_Relaxed|OPA_EA, OPT_Areg|OPS_8|OPA_None, 0} }, - { CPU_Not64, MOD_GasSufW, 16, 0, 0, 1, {0xA3, 0, 0}, 0, 2, {OPT_MemOffs|OPS_16|OPS_Relaxed|OPA_EA, OPT_Areg|OPS_16|OPA_None, 0} }, - { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0xA3, 0, 0}, 0, 2, {OPT_MemOffs|OPS_32|OPS_Relaxed|OPA_EA, OPT_Areg|OPS_32|OPA_None, 0} }, - { CPU_64, 0, 0, 0, 0, 1, {0xA0, 0, 0}, 0, 2, {OPT_Areg|OPS_8|OPA_None, OPT_MemOffs|OPS_8|OPS_Relaxed|OPEAS_64|OPA_EA, 0} }, - { CPU_64, 0, 16, 0, 0, 1, {0xA1, 0, 0}, 0, 2, {OPT_Areg|OPS_16|OPA_None, OPT_MemOffs|OPS_16|OPS_Relaxed|OPEAS_64|OPA_EA, 0} }, - { CPU_64, 0, 32, 0, 0, 1, {0xA1, 0, 0}, 0, 2, {OPT_Areg|OPS_32|OPA_None, OPT_MemOffs|OPS_32|OPS_Relaxed|OPEAS_64|OPA_EA, 0} }, - { CPU_64, 0, 64, 0, 0, 1, {0xA1, 0, 0}, 0, 2, {OPT_Areg|OPS_64|OPA_None, OPT_MemOffs|OPS_64|OPS_Relaxed|OPEAS_64|OPA_EA, 0} }, - { CPU_64, 0, 0, 0, 0, 1, {0xA2, 0, 0}, 0, 2, {OPT_MemOffs|OPS_8|OPS_Relaxed|OPEAS_64|OPA_EA, OPT_Areg|OPS_8|OPA_None, 0} }, - { CPU_64, 0, 16, 0, 0, 1, {0xA3, 0, 0}, 0, 2, {OPT_MemOffs|OPS_16|OPS_Relaxed|OPEAS_64|OPA_EA, OPT_Areg|OPS_16|OPA_None, 0} }, - { CPU_64, 0, 32, 0, 0, 1, {0xA3, 0, 0}, 0, 2, {OPT_MemOffs|OPS_32|OPS_Relaxed|OPEAS_64|OPA_EA, OPT_Areg|OPS_32|OPA_None, 0} }, - { CPU_64, 0, 64, 0, 0, 1, {0xA3, 0, 0}, 0, 2, {OPT_MemOffs|OPS_64|OPS_Relaxed|OPEAS_64|OPA_EA, OPT_Areg|OPS_64|OPA_None, 0} }, - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0x88, 0xA2, 0}, 0, 2, {OPT_RM|OPS_8|OPS_Relaxed|OPA_EA|OPAP_ShortMov, OPT_Areg|OPS_8|OPA_Spare, 0} }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x89, 0xA3, 0}, 0, 2, {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA|OPAP_ShortMov, OPT_Areg|OPS_16|OPA_Spare, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x89, 0xA3, 0}, 0, 2, {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA|OPAP_ShortMov, OPT_Areg|OPS_32|OPA_Spare, 0} }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x89, 0xA3, 0}, 0, 2, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA|OPAP_ShortMov, OPT_Areg|OPS_64|OPA_Spare, 0} }, - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0x88, 0, 0}, 0, 2, {OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_8|OPA_Spare, 0} }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x89, 0, 0}, 0, 2, {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_16|OPA_Spare, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x89, 0, 0}, 0, 2, {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_32|OPA_Spare, 0} }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x89, 0, 0}, 0, 2, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_64|OPA_Spare, 0} }, - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0x8A, 0xA0, 0}, 0, 2, {OPT_Areg|OPS_8|OPA_Spare, OPT_RM|OPS_8|OPS_Relaxed|OPA_EA|OPAP_ShortMov, 0} }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x8B, 0xA1, 0}, 0, 2, {OPT_Areg|OPS_16|OPA_Spare, OPT_RM|OPS_16|OPS_Relaxed|OPA_EA|OPAP_ShortMov, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x8B, 0xA1, 0}, 0, 2, {OPT_Areg|OPS_32|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA|OPAP_ShortMov, 0} }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x8B, 0xA1, 0}, 0, 2, {OPT_Areg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA|OPAP_ShortMov, 0} }, - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0x8A, 0, 0}, 0, 2, {OPT_Reg|OPS_8|OPA_Spare, OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, 0} }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x8B, 0, 0}, 0, 2, {OPT_Reg|OPS_16|OPA_Spare, OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x8B, 0, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x8B, 0, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} }, - { CPU_Any, MOD_GasSufW, 0, 0, 0, 1, {0x8C, 0, 0}, 0, 2, {OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, OPT_SegReg|OPS_16|OPS_Relaxed|OPA_Spare, 0} }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x8C, 0, 0}, 0, 2, {OPT_Reg|OPS_16|OPA_EA, OPT_SegReg|OPS_16|OPS_Relaxed|OPA_Spare, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x8C, 0, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_EA, OPT_SegReg|OPS_16|OPS_Relaxed|OPA_Spare, 0} }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x8C, 0, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_EA, OPT_SegReg|OPS_16|OPS_Relaxed|OPA_Spare, 0} }, - { CPU_Any, MOD_GasSufW, 0, 0, 0, 1, {0x8E, 0, 0}, 0, 2, {OPT_SegReg|OPS_16|OPS_Relaxed|OPA_Spare, OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, 0} }, - { CPU_386, MOD_GasSufL, 0, 0, 0, 1, {0x8E, 0, 0}, 0, 2, {OPT_SegReg|OPS_16|OPS_Relaxed|OPA_Spare, OPT_Reg|OPS_32|OPA_EA, 0} }, - { CPU_64, MOD_GasSufQ, 0, 0, 0, 1, {0x8E, 0, 0}, 0, 2, {OPT_SegReg|OPS_16|OPS_Relaxed|OPA_Spare, OPT_Reg|OPS_64|OPA_EA, 0} }, - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xB0, 0, 0}, 0, 2, {OPT_Reg|OPS_8|OPA_Op0Add, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xB8, 0, 0}, 0, 2, {OPT_Reg|OPS_16|OPA_Op0Add, OPT_Imm|OPS_16|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xB8, 0, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Op0Add, OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_64, MOD_GasIllegal, 64, 0, 0, 1, {0xB8, 0, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Op0Add, OPT_Imm|OPS_64|OPA_Imm, 0} }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xB8, 0xC7, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Op0Add, OPT_Imm|OPS_64|OPS_Relaxed|OPA_Imm|OPAP_SImm32Avail, 0} }, - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xC6, 0, 0}, 0, 2, {OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPA_Imm, 0} }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xC7, 0, 0}, 0, 2, {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_16|OPA_Imm, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xC7, 0, 0}, 0, 2, {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_32|OPA_Imm, 0} }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xC7, 0, 0}, 0, 2, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_32|OPA_Imm, 0} }, - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xC6, 0, 0}, 0, 2, {OPT_RM|OPS_8|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xC7, 0, 0}, 0, 2, {OPT_RM|OPS_16|OPA_EA, OPT_Imm|OPS_16|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xC7, 0, 0}, 0, 2, {OPT_RM|OPS_32|OPA_EA, OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xC7, 0, 0}, 0, 2, {OPT_RM|OPS_64|OPA_EA, OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_586|CPU_Not64|CPU_Priv, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0x22, 0}, 0, 2, {OPT_CR4|OPS_32|OPA_Spare, OPT_Reg|OPS_32|OPA_EA, 0} }, - { CPU_386|CPU_Not64|CPU_Priv, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0x22, 0}, 0, 2, {OPT_CRReg|OPS_32|OPA_Spare, OPT_Reg|OPS_32|OPA_EA, 0} }, - { CPU_64|CPU_Priv, MOD_GasSufQ, 0, 0, 0, 2, {0x0F, 0x22, 0}, 0, 2, {OPT_CRReg|OPS_32|OPA_Spare, OPT_Reg|OPS_64|OPA_EA, 0} }, - { CPU_586|CPU_Not64|CPU_Priv, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0x20, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_EA, OPT_CR4|OPS_32|OPA_Spare, 0} }, - { CPU_386|CPU_Not64|CPU_Priv, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0x20, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_EA, OPT_CRReg|OPS_32|OPA_Spare, 0} }, - { CPU_64|CPU_Priv, MOD_GasSufQ, 0, 0, 0, 2, {0x0F, 0x20, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_EA, OPT_CRReg|OPS_32|OPA_Spare, 0} }, - { CPU_386|CPU_Not64|CPU_Priv, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0x23, 0}, 0, 2, {OPT_DRReg|OPS_32|OPA_Spare, OPT_Reg|OPS_32|OPA_EA, 0} }, - { CPU_64|CPU_Priv, MOD_GasSufQ, 0, 0, 0, 2, {0x0F, 0x23, 0}, 0, 2, {OPT_DRReg|OPS_32|OPA_Spare, OPT_Reg|OPS_64|OPA_EA, 0} }, - { CPU_386|CPU_Not64|CPU_Priv, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0x21, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_EA, OPT_DRReg|OPS_32|OPA_Spare, 0} }, - { CPU_64|CPU_Priv, MOD_GasSufQ, 0, 0, 0, 2, {0x0F, 0x21, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_EA, OPT_DRReg|OPS_32|OPA_Spare, 0} }, - { CPU_MMX, MOD_GasOnly|MOD_GasSufQ, 0, 0, 0, 2, {0x0F, 0x6F, 0}, 0, 2, {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, 0} }, - { CPU_64|CPU_MMX, MOD_GasOnly|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x6E, 0}, 0, 2, {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} }, - { CPU_MMX, MOD_GasOnly|MOD_GasSufQ, 0, 0, 0, 2, {0x0F, 0x7F, 0}, 0, 2, {OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_64|OPA_Spare, 0} }, - { CPU_64|CPU_MMX, MOD_GasOnly|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x7E, 0}, 0, 2, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_64|OPA_Spare, 0} }, - { CPU_SSE2, MOD_GasOnly|MOD_GasSufQ, 0, 0, 0xF3, 2, {0x0F, 0x7E, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} }, - { CPU_SSE2, MOD_GasOnly|MOD_GasSufQ, 0, 0, 0xF3, 2, {0x0F, 0x7E, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, 0} }, - { CPU_64|CPU_SSE2, MOD_GasOnly|MOD_GasSufQ, 64, 0, 0x66, 2, {0x0F, 0x6E, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} }, - { CPU_SSE2, MOD_GasOnly|MOD_GasSufQ, 0, 0, 0x66, 2, {0x0F, 0xD6, 0}, 0, 2, {OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} }, - { CPU_64|CPU_SSE2, MOD_GasOnly|MOD_GasSufQ, 64, 0, 0x66, 2, {0x0F, 0x7E, 0}, 0, 2, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} } + { CPU_Not64, MOD_GasSufB, 0, 0, 0, 1, {0xA0, 0, 0}, 0, 2, 182 }, + { CPU_Not64, MOD_GasSufW, 16, 0, 0, 1, {0xA1, 0, 0}, 0, 2, 184 }, + { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0xA1, 0, 0}, 0, 2, 186 }, + { CPU_Not64, MOD_GasSufB, 0, 0, 0, 1, {0xA2, 0, 0}, 0, 2, 188 }, + { CPU_Not64, MOD_GasSufW, 16, 0, 0, 1, {0xA3, 0, 0}, 0, 2, 190 }, + { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0xA3, 0, 0}, 0, 2, 192 }, + { CPU_64, 0, 0, 0, 0, 1, {0xA0, 0, 0}, 0, 2, 158 }, + { CPU_64, 0, 16, 0, 0, 1, {0xA1, 0, 0}, 0, 2, 160 }, + { CPU_64, 0, 32, 0, 0, 1, {0xA1, 0, 0}, 0, 2, 162 }, + { CPU_64, 0, 64, 0, 0, 1, {0xA1, 0, 0}, 0, 2, 164 }, + { CPU_64, 0, 0, 0, 0, 1, {0xA2, 0, 0}, 0, 2, 166 }, + { CPU_64, 0, 16, 0, 0, 1, {0xA3, 0, 0}, 0, 2, 168 }, + { CPU_64, 0, 32, 0, 0, 1, {0xA3, 0, 0}, 0, 2, 170 }, + { CPU_64, 0, 64, 0, 0, 1, {0xA3, 0, 0}, 0, 2, 172 }, + { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0x88, 0xA2, 0}, 0, 2, 194 }, + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x89, 0xA3, 0}, 0, 2, 196 }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x89, 0xA3, 0}, 0, 2, 198 }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x89, 0xA3, 0}, 0, 2, 200 }, + { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0x88, 0, 0}, 0, 2, 140 }, + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x89, 0, 0}, 0, 2, 94 }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x89, 0, 0}, 0, 2, 100 }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x89, 0, 0}, 0, 2, 106 }, + { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0x8A, 0xA0, 0}, 0, 2, 202 }, + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x8B, 0xA1, 0}, 0, 2, 204 }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x8B, 0xA1, 0}, 0, 2, 206 }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x8B, 0xA1, 0}, 0, 2, 208 }, + { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0x8A, 0, 0}, 0, 2, 142 }, + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x8B, 0, 0}, 0, 2, 4 }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x8B, 0, 0}, 0, 2, 7 }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x8B, 0, 0}, 0, 2, 10 }, + { CPU_Any, MOD_GasSufW, 0, 0, 0, 1, {0x8C, 0, 0}, 0, 2, 210 }, + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x8C, 0, 0}, 0, 2, 212 }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x8C, 0, 0}, 0, 2, 214 }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x8C, 0, 0}, 0, 2, 216 }, + { CPU_Any, MOD_GasSufW, 0, 0, 0, 1, {0x8E, 0, 0}, 0, 2, 218 }, + { CPU_386, MOD_GasSufL, 0, 0, 0, 1, {0x8E, 0, 0}, 0, 2, 213 }, + { CPU_64, MOD_GasSufQ, 0, 0, 0, 1, {0x8E, 0, 0}, 0, 2, 215 }, + { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xB0, 0, 0}, 0, 2, 220 }, + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xB8, 0, 0}, 0, 2, 222 }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xB8, 0, 0}, 0, 2, 224 }, + { CPU_64, MOD_GasIllegal, 64, 0, 0, 1, {0xB8, 0, 0}, 0, 2, 226 }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xB8, 0xC7, 0}, 0, 2, 228 }, + { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xC6, 0, 0}, 0, 2, 230 }, + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xC7, 0, 0}, 0, 2, 232 }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xC7, 0, 0}, 0, 2, 234 }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xC7, 0, 0}, 0, 2, 236 }, + { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xC6, 0, 0}, 0, 2, 238 }, + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xC7, 0, 0}, 0, 2, 240 }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xC7, 0, 0}, 0, 2, 242 }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xC7, 0, 0}, 0, 2, 244 }, + { CPU_586|CPU_Not64|CPU_Priv, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0x22, 0}, 0, 2, 246 }, + { CPU_386|CPU_Not64|CPU_Priv, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0x22, 0}, 0, 2, 248 }, + { CPU_64|CPU_Priv, MOD_GasSufQ, 0, 0, 0, 2, {0x0F, 0x22, 0}, 0, 2, 250 }, + { CPU_586|CPU_Not64|CPU_Priv, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0x20, 0}, 0, 2, 252 }, + { CPU_386|CPU_Not64|CPU_Priv, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0x20, 0}, 0, 2, 247 }, + { CPU_64|CPU_Priv, MOD_GasSufQ, 0, 0, 0, 2, {0x0F, 0x20, 0}, 0, 2, 254 }, + { CPU_386|CPU_Not64|CPU_Priv, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0x23, 0}, 0, 2, 256 }, + { CPU_64|CPU_Priv, MOD_GasSufQ, 0, 0, 0, 2, {0x0F, 0x23, 0}, 0, 2, 258 }, + { CPU_386|CPU_Not64|CPU_Priv, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0x21, 0}, 0, 2, 257 }, + { CPU_64|CPU_Priv, MOD_GasSufQ, 0, 0, 0, 2, {0x0F, 0x21, 0}, 0, 2, 260 }, + { CPU_MMX, MOD_GasOnly|MOD_GasSufQ, 0, 0, 0, 2, {0x0F, 0x6F, 0}, 0, 2, 82 }, + { CPU_64|CPU_MMX, MOD_GasOnly|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x6E, 0}, 0, 2, 120 }, + { CPU_MMX, MOD_GasOnly|MOD_GasSufQ, 0, 0, 0, 2, {0x0F, 0x7F, 0}, 0, 2, 148 }, + { CPU_64|CPU_MMX, MOD_GasOnly|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x7E, 0}, 0, 2, 122 }, + { CPU_SSE2, MOD_GasOnly|MOD_GasSufQ, 0, 0, 0xF3, 2, {0x0F, 0x7E, 0}, 0, 2, 0 }, + { CPU_SSE2, MOD_GasOnly|MOD_GasSufQ, 0, 0, 0xF3, 2, {0x0F, 0x7E, 0}, 0, 2, 150 }, + { CPU_64|CPU_SSE2, MOD_GasOnly|MOD_GasSufQ, 64, 0, 0x66, 2, {0x0F, 0x6E, 0}, 0, 2, 91 }, + { CPU_SSE2, MOD_GasOnly|MOD_GasSufQ, 0, 0, 0x66, 2, {0x0F, 0xD6, 0}, 0, 2, 152 }, + { CPU_64|CPU_SSE2, MOD_GasOnly|MOD_GasSufQ, 64, 0, 0x66, 2, {0x0F, 0x7E, 0}, 0, 2, 70 } }; static const x86_insn_info movabs_insn[] = { - { CPU_64, MOD_GasSufB, 0, 0, 0, 1, {0xA0, 0, 0}, 0, 2, {OPT_Areg|OPS_8|OPA_None, OPT_MemOffs|OPS_8|OPS_Relaxed|OPEAS_64|OPA_EA, 0} }, - { CPU_64, MOD_GasSufW, 16, 0, 0, 1, {0xA1, 0, 0}, 0, 2, {OPT_Areg|OPS_16|OPA_None, OPT_MemOffs|OPS_16|OPS_Relaxed|OPEAS_64|OPA_EA, 0} }, - { CPU_64, MOD_GasSufL, 32, 0, 0, 1, {0xA1, 0, 0}, 0, 2, {OPT_Areg|OPS_32|OPA_None, OPT_MemOffs|OPS_32|OPS_Relaxed|OPEAS_64|OPA_EA, 0} }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xA1, 0, 0}, 0, 2, {OPT_Areg|OPS_64|OPA_None, OPT_MemOffs|OPS_64|OPS_Relaxed|OPEAS_64|OPA_EA, 0} }, - { CPU_64, MOD_GasSufB, 0, 0, 0, 1, {0xA2, 0, 0}, 0, 2, {OPT_MemOffs|OPS_8|OPS_Relaxed|OPEAS_64|OPA_EA, OPT_Areg|OPS_8|OPA_None, 0} }, - { CPU_64, MOD_GasSufW, 16, 0, 0, 1, {0xA3, 0, 0}, 0, 2, {OPT_MemOffs|OPS_16|OPS_Relaxed|OPEAS_64|OPA_EA, OPT_Areg|OPS_16|OPA_None, 0} }, - { CPU_64, MOD_GasSufL, 32, 0, 0, 1, {0xA3, 0, 0}, 0, 2, {OPT_MemOffs|OPS_32|OPS_Relaxed|OPEAS_64|OPA_EA, OPT_Areg|OPS_32|OPA_None, 0} }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xA3, 0, 0}, 0, 2, {OPT_MemOffs|OPS_64|OPS_Relaxed|OPEAS_64|OPA_EA, OPT_Areg|OPS_64|OPA_None, 0} }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xB8, 0, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Op0Add, OPT_Imm|OPS_64|OPS_Relaxed|OPA_Imm, 0} } + { CPU_64, MOD_GasSufB, 0, 0, 0, 1, {0xA0, 0, 0}, 0, 2, 158 }, + { CPU_64, MOD_GasSufW, 16, 0, 0, 1, {0xA1, 0, 0}, 0, 2, 160 }, + { CPU_64, MOD_GasSufL, 32, 0, 0, 1, {0xA1, 0, 0}, 0, 2, 162 }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xA1, 0, 0}, 0, 2, 164 }, + { CPU_64, MOD_GasSufB, 0, 0, 0, 1, {0xA2, 0, 0}, 0, 2, 166 }, + { CPU_64, MOD_GasSufW, 16, 0, 0, 1, {0xA3, 0, 0}, 0, 2, 168 }, + { CPU_64, MOD_GasSufL, 32, 0, 0, 1, {0xA3, 0, 0}, 0, 2, 170 }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xA3, 0, 0}, 0, 2, 172 }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xB8, 0, 0}, 0, 2, 174 } }; static const x86_insn_info movszx_insn[] = { - { CPU_386, MOD_Op1Add|MOD_GasSufB, 16, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_Reg|OPS_16|OPA_Spare, OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, 0} }, - { CPU_386, MOD_Op1Add|MOD_GasSufB, 32, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_8|OPA_EA, 0} }, - { CPU_64, MOD_Op1Add|MOD_GasSufB, 64, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_8|OPA_EA, 0} }, - { CPU_386, MOD_Op1Add|MOD_GasSufW, 32, 0, 0, 2, {0x0F, 0x01, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_16|OPA_EA, 0} }, - { CPU_64, MOD_Op1Add|MOD_GasSufW, 64, 0, 0, 2, {0x0F, 0x01, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_16|OPA_EA, 0} } + { CPU_386, MOD_Op1Add|MOD_GasSufB, 16, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 366 }, + { CPU_386, MOD_Op1Add|MOD_GasSufB, 32, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 312 }, + { CPU_64, MOD_Op1Add|MOD_GasSufB, 64, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 316 }, + { CPU_386, MOD_Op1Add|MOD_GasSufW, 32, 0, 0, 2, {0x0F, 0x01, 0}, 0, 2, 314 }, + { CPU_64, MOD_Op1Add|MOD_GasSufW, 64, 0, 0, 2, {0x0F, 0x01, 0}, 0, 2, 368 } }; static const x86_insn_info movsxd_insn[] = { - { CPU_64, MOD_GasSufL, 64, 0, 0, 1, {0x63, 0, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_32|OPA_EA, 0} } + { CPU_64, MOD_GasSufL, 64, 0, 0, 1, {0x63, 0, 0}, 0, 2, 400 } }; static const x86_insn_info push_insn[] = { - { CPU_Any, MOD_GasSufW, 16, 64, 0, 1, {0x50, 0, 0}, 0, 1, {OPT_Reg|OPS_16|OPA_Op0Add, 0, 0} }, - { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0x50, 0, 0}, 0, 1, {OPT_Reg|OPS_32|OPA_Op0Add, 0, 0} }, - { CPU_64, MOD_GasSufQ, 0, 64, 0, 1, {0x50, 0, 0}, 0, 1, {OPT_Reg|OPS_64|OPA_Op0Add, 0, 0} }, - { CPU_Any, MOD_GasSufW, 16, 64, 0, 1, {0xFF, 0, 0}, 6, 1, {OPT_RM|OPS_16|OPA_EA, 0, 0} }, - { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0xFF, 0, 0}, 6, 1, {OPT_RM|OPS_32|OPA_EA, 0, 0} }, - { CPU_64, MOD_GasSufQ, 0, 64, 0, 1, {0xFF, 0, 0}, 6, 1, {OPT_RM|OPS_64|OPA_EA, 0, 0} }, - { CPU_186, MOD_GasIllegal, 0, 64, 0, 1, {0x6A, 0, 0}, 0, 1, {OPT_Imm|OPS_8|OPA_SImm, 0, 0} }, - { CPU_186, MOD_GasOnly, 0, 64, 0, 1, {0x6A, 0, 0}, 0, 1, {OPT_Imm|OPS_8|OPS_Relaxed|OPA_SImm, 0, 0} }, - { CPU_186, MOD_GasOnly|MOD_GasSufW, 16, 64, 0, 1, {0x6A, 0x68, 0}, 0, 1, {OPT_Imm|OPS_16|OPS_Relaxed|OPA_Imm|OPAP_SImm8, 0, 0} }, - { CPU_386|CPU_Not64, MOD_GasOnly|MOD_GasSufL, 32, 0, 0, 1, {0x6A, 0x68, 0}, 0, 1, {OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm|OPAP_SImm8, 0, 0} }, - { CPU_64, MOD_GasSufQ, 64, 64, 0, 1, {0x6A, 0x68, 0}, 0, 1, {OPT_Imm|OPS_32|OPS_Relaxed|OPA_SImm|OPAP_SImm8, 0, 0} }, - { CPU_186|CPU_Not64, MOD_GasIllegal, 0, 0, 0, 1, {0x6A, 0x68, 0}, 0, 1, {OPT_Imm|OPS_BITS|OPS_Relaxed|OPA_Imm|OPAP_SImm8, 0, 0} }, - { CPU_186, MOD_GasIllegal, 16, 64, 0, 1, {0x68, 0, 0}, 0, 1, {OPT_Imm|OPS_16|OPA_Imm, 0, 0} }, - { CPU_386|CPU_Not64, MOD_GasIllegal, 32, 0, 0, 1, {0x68, 0, 0}, 0, 1, {OPT_Imm|OPS_32|OPA_Imm, 0, 0} }, - { CPU_64, MOD_GasIllegal, 64, 64, 0, 1, {0x68, 0, 0}, 0, 1, {OPT_Imm|OPS_32|OPA_SImm, 0, 0} }, - { CPU_Not64, 0, 0, 0, 0, 1, {0x0E, 0, 0}, 0, 1, {OPT_CS|OPS_Any|OPA_None, 0, 0} }, - { CPU_Not64, MOD_GasSufW, 16, 0, 0, 1, {0x0E, 0, 0}, 0, 1, {OPT_CS|OPS_16|OPA_None, 0, 0} }, - { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0x0E, 0, 0}, 0, 1, {OPT_CS|OPS_32|OPA_None, 0, 0} }, - { CPU_Not64, 0, 0, 0, 0, 1, {0x16, 0, 0}, 0, 1, {OPT_SS|OPS_Any|OPA_None, 0, 0} }, - { CPU_Not64, MOD_GasSufW, 16, 0, 0, 1, {0x16, 0, 0}, 0, 1, {OPT_SS|OPS_16|OPA_None, 0, 0} }, - { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0x16, 0, 0}, 0, 1, {OPT_SS|OPS_32|OPA_None, 0, 0} }, - { CPU_Not64, 0, 0, 0, 0, 1, {0x1E, 0, 0}, 0, 1, {OPT_DS|OPS_Any|OPA_None, 0, 0} }, - { CPU_Not64, MOD_GasSufW, 16, 0, 0, 1, {0x1E, 0, 0}, 0, 1, {OPT_DS|OPS_16|OPA_None, 0, 0} }, - { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0x1E, 0, 0}, 0, 1, {OPT_DS|OPS_32|OPA_None, 0, 0} }, - { CPU_Not64, 0, 0, 0, 0, 1, {0x06, 0, 0}, 0, 1, {OPT_ES|OPS_Any|OPA_None, 0, 0} }, - { CPU_Not64, MOD_GasSufW, 16, 0, 0, 1, {0x06, 0, 0}, 0, 1, {OPT_ES|OPS_16|OPA_None, 0, 0} }, - { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0x06, 0, 0}, 0, 1, {OPT_ES|OPS_32|OPA_None, 0, 0} }, - { CPU_386, 0, 0, 0, 0, 2, {0x0F, 0xA0, 0}, 0, 1, {OPT_FS|OPS_Any|OPA_None, 0, 0} }, - { CPU_386, MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0xA0, 0}, 0, 1, {OPT_FS|OPS_16|OPA_None, 0, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0xA0, 0}, 0, 1, {OPT_FS|OPS_32|OPA_None, 0, 0} }, - { CPU_386, 0, 0, 0, 0, 2, {0x0F, 0xA8, 0}, 0, 1, {OPT_GS|OPS_Any|OPA_None, 0, 0} }, - { CPU_386, MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0xA8, 0}, 0, 1, {OPT_GS|OPS_16|OPA_None, 0, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0xA8, 0}, 0, 1, {OPT_GS|OPS_32|OPA_None, 0, 0} } + { CPU_Any, MOD_GasSufW, 16, 64, 0, 1, {0x50, 0, 0}, 0, 1, 222 }, + { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0x50, 0, 0}, 0, 1, 224 }, + { CPU_64, MOD_GasSufQ, 0, 64, 0, 1, {0x50, 0, 0}, 0, 1, 174 }, + { CPU_Any, MOD_GasSufW, 16, 64, 0, 1, {0xFF, 0, 0}, 6, 1, 112 }, + { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0xFF, 0, 0}, 6, 1, 114 }, + { CPU_64, MOD_GasSufQ, 0, 64, 0, 1, {0xFF, 0, 0}, 6, 1, 116 }, + { CPU_186, MOD_GasIllegal, 0, 64, 0, 1, {0x6A, 0, 0}, 0, 1, 6 }, + { CPU_186, MOD_GasOnly, 0, 64, 0, 1, {0x6A, 0, 0}, 0, 1, 447 }, + { CPU_186, MOD_GasOnly|MOD_GasSufW, 16, 64, 0, 1, {0x6A, 0x68, 0}, 0, 1, 341 }, + { CPU_386|CPU_Not64, MOD_GasOnly|MOD_GasSufL, 32, 0, 0, 1, {0x6A, 0x68, 0}, 0, 1, 343 }, + { CPU_64, MOD_GasSufQ, 64, 64, 0, 1, {0x6A, 0x68, 0}, 0, 1, 18 }, + { CPU_186|CPU_Not64, MOD_GasIllegal, 0, 0, 0, 1, {0x6A, 0x68, 0}, 0, 1, 448 }, + { CPU_186, MOD_GasIllegal, 16, 64, 0, 1, {0x68, 0, 0}, 0, 1, 233 }, + { CPU_386|CPU_Not64, MOD_GasIllegal, 32, 0, 0, 1, {0x68, 0, 0}, 0, 1, 235 }, + { CPU_64, MOD_GasIllegal, 64, 64, 0, 1, {0x68, 0, 0}, 0, 1, 449 }, + { CPU_Not64, 0, 0, 0, 0, 1, {0x0E, 0, 0}, 0, 1, 450 }, + { CPU_Not64, MOD_GasSufW, 16, 0, 0, 1, {0x0E, 0, 0}, 0, 1, 451 }, + { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0x0E, 0, 0}, 0, 1, 452 }, + { CPU_Not64, 0, 0, 0, 0, 1, {0x16, 0, 0}, 0, 1, 407 }, + { CPU_Not64, MOD_GasSufW, 16, 0, 0, 1, {0x16, 0, 0}, 0, 1, 408 }, + { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0x16, 0, 0}, 0, 1, 409 }, + { CPU_Not64, 0, 0, 0, 0, 1, {0x1E, 0, 0}, 0, 1, 410 }, + { CPU_Not64, MOD_GasSufW, 16, 0, 0, 1, {0x1E, 0, 0}, 0, 1, 411 }, + { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0x1E, 0, 0}, 0, 1, 412 }, + { CPU_Not64, 0, 0, 0, 0, 1, {0x06, 0, 0}, 0, 1, 413 }, + { CPU_Not64, MOD_GasSufW, 16, 0, 0, 1, {0x06, 0, 0}, 0, 1, 414 }, + { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0x06, 0, 0}, 0, 1, 415 }, + { CPU_386, 0, 0, 0, 0, 2, {0x0F, 0xA0, 0}, 0, 1, 416 }, + { CPU_386, MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0xA0, 0}, 0, 1, 417 }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0xA0, 0}, 0, 1, 418 }, + { CPU_386, 0, 0, 0, 0, 2, {0x0F, 0xA8, 0}, 0, 1, 419 }, + { CPU_386, MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0xA8, 0}, 0, 1, 420 }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0xA8, 0}, 0, 1, 421 } }; static const x86_insn_info pop_insn[] = { - { CPU_Any, MOD_GasSufW, 16, 64, 0, 1, {0x58, 0, 0}, 0, 1, {OPT_Reg|OPS_16|OPA_Op0Add, 0, 0} }, - { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0x58, 0, 0}, 0, 1, {OPT_Reg|OPS_32|OPA_Op0Add, 0, 0} }, - { CPU_64, MOD_GasSufQ, 0, 64, 0, 1, {0x58, 0, 0}, 0, 1, {OPT_Reg|OPS_64|OPA_Op0Add, 0, 0} }, - { CPU_Any, MOD_GasSufW, 16, 64, 0, 1, {0x8F, 0, 0}, 0, 1, {OPT_RM|OPS_16|OPA_EA, 0, 0} }, - { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0x8F, 0, 0}, 0, 1, {OPT_RM|OPS_32|OPA_EA, 0, 0} }, - { CPU_64, MOD_GasSufQ, 0, 64, 0, 1, {0x8F, 0, 0}, 0, 1, {OPT_RM|OPS_64|OPA_EA, 0, 0} }, - { CPU_Not64, 0, 0, 0, 0, 1, {0x17, 0, 0}, 0, 1, {OPT_SS|OPS_Any|OPA_None, 0, 0} }, - { CPU_Not64, 0, 16, 0, 0, 1, {0x17, 0, 0}, 0, 1, {OPT_SS|OPS_16|OPA_None, 0, 0} }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0x17, 0, 0}, 0, 1, {OPT_SS|OPS_32|OPA_None, 0, 0} }, - { CPU_Not64, 0, 0, 0, 0, 1, {0x1F, 0, 0}, 0, 1, {OPT_DS|OPS_Any|OPA_None, 0, 0} }, - { CPU_Not64, 0, 16, 0, 0, 1, {0x1F, 0, 0}, 0, 1, {OPT_DS|OPS_16|OPA_None, 0, 0} }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0x1F, 0, 0}, 0, 1, {OPT_DS|OPS_32|OPA_None, 0, 0} }, - { CPU_Not64, 0, 0, 0, 0, 1, {0x07, 0, 0}, 0, 1, {OPT_ES|OPS_Any|OPA_None, 0, 0} }, - { CPU_Not64, 0, 16, 0, 0, 1, {0x07, 0, 0}, 0, 1, {OPT_ES|OPS_16|OPA_None, 0, 0} }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0x07, 0, 0}, 0, 1, {OPT_ES|OPS_32|OPA_None, 0, 0} }, - { CPU_386, 0, 0, 0, 0, 2, {0x0F, 0xA1, 0}, 0, 1, {OPT_FS|OPS_Any|OPA_None, 0, 0} }, - { CPU_386, 0, 16, 0, 0, 2, {0x0F, 0xA1, 0}, 0, 1, {OPT_FS|OPS_16|OPA_None, 0, 0} }, - { CPU_386, 0, 32, 0, 0, 2, {0x0F, 0xA1, 0}, 0, 1, {OPT_FS|OPS_32|OPA_None, 0, 0} }, - { CPU_386, 0, 0, 0, 0, 2, {0x0F, 0xA9, 0}, 0, 1, {OPT_GS|OPS_Any|OPA_None, 0, 0} }, - { CPU_386, 0, 16, 0, 0, 2, {0x0F, 0xA9, 0}, 0, 1, {OPT_GS|OPS_16|OPA_None, 0, 0} }, - { CPU_386, 0, 32, 0, 0, 2, {0x0F, 0xA9, 0}, 0, 1, {OPT_GS|OPS_32|OPA_None, 0, 0} } + { CPU_Any, MOD_GasSufW, 16, 64, 0, 1, {0x58, 0, 0}, 0, 1, 222 }, + { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0x58, 0, 0}, 0, 1, 224 }, + { CPU_64, MOD_GasSufQ, 0, 64, 0, 1, {0x58, 0, 0}, 0, 1, 174 }, + { CPU_Any, MOD_GasSufW, 16, 64, 0, 1, {0x8F, 0, 0}, 0, 1, 112 }, + { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0x8F, 0, 0}, 0, 1, 114 }, + { CPU_64, MOD_GasSufQ, 0, 64, 0, 1, {0x8F, 0, 0}, 0, 1, 116 }, + { CPU_Not64, 0, 0, 0, 0, 1, {0x17, 0, 0}, 0, 1, 407 }, + { CPU_Not64, 0, 16, 0, 0, 1, {0x17, 0, 0}, 0, 1, 408 }, + { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0x17, 0, 0}, 0, 1, 409 }, + { CPU_Not64, 0, 0, 0, 0, 1, {0x1F, 0, 0}, 0, 1, 410 }, + { CPU_Not64, 0, 16, 0, 0, 1, {0x1F, 0, 0}, 0, 1, 411 }, + { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0x1F, 0, 0}, 0, 1, 412 }, + { CPU_Not64, 0, 0, 0, 0, 1, {0x07, 0, 0}, 0, 1, 413 }, + { CPU_Not64, 0, 16, 0, 0, 1, {0x07, 0, 0}, 0, 1, 414 }, + { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0x07, 0, 0}, 0, 1, 415 }, + { CPU_386, 0, 0, 0, 0, 2, {0x0F, 0xA1, 0}, 0, 1, 416 }, + { CPU_386, 0, 16, 0, 0, 2, {0x0F, 0xA1, 0}, 0, 1, 417 }, + { CPU_386, 0, 32, 0, 0, 2, {0x0F, 0xA1, 0}, 0, 1, 418 }, + { CPU_386, 0, 0, 0, 0, 2, {0x0F, 0xA9, 0}, 0, 1, 419 }, + { CPU_386, 0, 16, 0, 0, 2, {0x0F, 0xA9, 0}, 0, 1, 420 }, + { CPU_386, 0, 32, 0, 0, 2, {0x0F, 0xA9, 0}, 0, 1, 421 } }; static const x86_insn_info xchg_insn[] = { - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0x86, 0, 0}, 0, 2, {OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_8|OPA_Spare, 0} }, - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0x86, 0, 0}, 0, 2, {OPT_Reg|OPS_8|OPA_Spare, OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, 0} }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x90, 0, 0}, 0, 2, {OPT_Areg|OPS_16|OPA_None, OPT_Reg|OPS_16|OPA_Op0Add, 0} }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x90, 0, 0}, 0, 2, {OPT_Reg|OPS_16|OPA_Op0Add, OPT_Areg|OPS_16|OPA_None, 0} }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x87, 0, 0}, 0, 2, {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_16|OPA_Spare, 0} }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x87, 0, 0}, 0, 2, {OPT_Reg|OPS_16|OPA_Spare, OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, 0} }, - { CPU_64, MOD_GasSufL, 32, 0, 0, 1, {0x87, 0, 0}, 0, 2, {OPT_Areg|OPS_32|OPA_EA, OPT_Areg|OPS_32|OPA_Spare, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x90, 0, 0}, 0, 2, {OPT_Areg|OPS_32|OPA_None, OPT_Reg|OPS_32|OPA_Op0Add, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x90, 0, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Op0Add, OPT_Areg|OPS_32|OPA_None, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x87, 0, 0}, 0, 2, {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_32|OPA_Spare, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x87, 0, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} }, - { CPU_64, MOD_GasSufQ, 0, 0, 0, 1, {0x90, 0, 0}, 0, 2, {OPT_Areg|OPS_64|OPA_None, OPT_Areg|OPS_64|OPA_Op0Add, 0} }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x90, 0, 0}, 0, 2, {OPT_Areg|OPS_64|OPA_None, OPT_Reg|OPS_64|OPA_Op0Add, 0} }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x90, 0, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Op0Add, OPT_Areg|OPS_64|OPA_None, 0} }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x87, 0, 0}, 0, 2, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_64|OPA_Spare, 0} }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x87, 0, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} } + { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0x86, 0, 0}, 0, 2, 140 }, + { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0x86, 0, 0}, 0, 2, 142 }, + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x90, 0, 0}, 0, 2, 292 }, + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x90, 0, 0}, 0, 2, 294 }, + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x87, 0, 0}, 0, 2, 94 }, + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x87, 0, 0}, 0, 2, 4 }, + { CPU_64, MOD_GasSufL, 32, 0, 0, 1, {0x87, 0, 0}, 0, 2, 296 }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x90, 0, 0}, 0, 2, 298 }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x90, 0, 0}, 0, 2, 300 }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x87, 0, 0}, 0, 2, 100 }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x87, 0, 0}, 0, 2, 7 }, + { CPU_64, MOD_GasSufQ, 0, 0, 0, 1, {0x90, 0, 0}, 0, 2, 302 }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x90, 0, 0}, 0, 2, 173 }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x90, 0, 0}, 0, 2, 304 }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x87, 0, 0}, 0, 2, 106 }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x87, 0, 0}, 0, 2, 10 } }; static const x86_insn_info in_insn[] = { - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xE4, 0, 0}, 0, 2, {OPT_Areg|OPS_8|OPA_None, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xE5, 0, 0}, 0, 2, {OPT_Areg|OPS_16|OPA_None, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xE5, 0, 0}, 0, 2, {OPT_Areg|OPS_32|OPA_None, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xEC, 0, 0}, 0, 2, {OPT_Areg|OPS_8|OPA_None, OPT_Dreg|OPS_16|OPA_None, 0} }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xED, 0, 0}, 0, 2, {OPT_Areg|OPS_16|OPA_None, OPT_Dreg|OPS_16|OPA_None, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xED, 0, 0}, 0, 2, {OPT_Areg|OPS_32|OPA_None, OPT_Dreg|OPS_16|OPA_None, 0} }, - { CPU_Any, MOD_GasOnly|MOD_GasSufB, 0, 0, 0, 1, {0xE4, 0, 0}, 0, 1, {OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0, 0} }, - { CPU_Any, MOD_GasOnly|MOD_GasSufW, 16, 0, 0, 1, {0xE5, 0, 0}, 0, 1, {OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0, 0} }, - { CPU_386, MOD_GasOnly|MOD_GasSufL, 32, 0, 0, 1, {0xE5, 0, 0}, 0, 1, {OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0, 0} }, - { CPU_Any, MOD_GasOnly|MOD_GasSufB, 0, 0, 0, 1, {0xEC, 0, 0}, 0, 1, {OPT_Dreg|OPS_16|OPA_None, 0, 0} }, - { CPU_Any, MOD_GasOnly|MOD_GasSufW, 16, 0, 0, 1, {0xED, 0, 0}, 0, 1, {OPT_Dreg|OPS_16|OPA_None, 0, 0} }, - { CPU_386, MOD_GasOnly|MOD_GasSufL, 32, 0, 0, 1, {0xED, 0, 0}, 0, 1, {OPT_Dreg|OPS_16|OPA_None, 0, 0} } + { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xE4, 0, 0}, 0, 2, 277 }, + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xE5, 0, 0}, 0, 2, 279 }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xE5, 0, 0}, 0, 2, 384 }, + { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xEC, 0, 0}, 0, 2, 283 }, + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xED, 0, 0}, 0, 2, 285 }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xED, 0, 0}, 0, 2, 281 }, + { CPU_Any, MOD_GasOnly|MOD_GasSufB, 0, 0, 0, 1, {0xE4, 0, 0}, 0, 1, 3 }, + { CPU_Any, MOD_GasOnly|MOD_GasSufW, 16, 0, 0, 1, {0xE5, 0, 0}, 0, 1, 3 }, + { CPU_386, MOD_GasOnly|MOD_GasSufL, 32, 0, 0, 1, {0xE5, 0, 0}, 0, 1, 3 }, + { CPU_Any, MOD_GasOnly|MOD_GasSufB, 0, 0, 0, 1, {0xEC, 0, 0}, 0, 1, 282 }, + { CPU_Any, MOD_GasOnly|MOD_GasSufW, 16, 0, 0, 1, {0xED, 0, 0}, 0, 1, 282 }, + { CPU_386, MOD_GasOnly|MOD_GasSufL, 32, 0, 0, 1, {0xED, 0, 0}, 0, 1, 282 } }; static const x86_insn_info out_insn[] = { - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xE6, 0, 0}, 0, 2, {OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, OPT_Areg|OPS_8|OPA_None, 0} }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xE7, 0, 0}, 0, 2, {OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, OPT_Areg|OPS_16|OPA_None, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xE7, 0, 0}, 0, 2, {OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, OPT_Areg|OPS_32|OPA_None, 0} }, - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xEE, 0, 0}, 0, 2, {OPT_Dreg|OPS_16|OPA_None, OPT_Areg|OPS_8|OPA_None, 0} }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xEF, 0, 0}, 0, 2, {OPT_Dreg|OPS_16|OPA_None, OPT_Areg|OPS_16|OPA_None, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xEF, 0, 0}, 0, 2, {OPT_Dreg|OPS_16|OPA_None, OPT_Areg|OPS_32|OPA_None, 0} }, - { CPU_Any, MOD_GasOnly|MOD_GasSufB, 0, 0, 0, 1, {0xE6, 0, 0}, 0, 1, {OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0, 0} }, - { CPU_Any, MOD_GasOnly|MOD_GasSufW, 16, 0, 0, 1, {0xE7, 0, 0}, 0, 1, {OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0, 0} }, - { CPU_386, MOD_GasOnly|MOD_GasSufL, 32, 0, 0, 1, {0xE7, 0, 0}, 0, 1, {OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0, 0} }, - { CPU_Any, MOD_GasOnly|MOD_GasSufB, 0, 0, 0, 1, {0xEE, 0, 0}, 0, 1, {OPT_Dreg|OPS_16|OPA_None, 0, 0} }, - { CPU_Any, MOD_GasOnly|MOD_GasSufW, 16, 0, 0, 1, {0xEF, 0, 0}, 0, 1, {OPT_Dreg|OPS_16|OPA_None, 0, 0} }, - { CPU_386, MOD_GasOnly|MOD_GasSufL, 32, 0, 0, 1, {0xEF, 0, 0}, 0, 1, {OPT_Dreg|OPS_16|OPA_None, 0, 0} } + { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xE6, 0, 0}, 0, 2, 276 }, + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xE7, 0, 0}, 0, 2, 278 }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xE7, 0, 0}, 0, 2, 280 }, + { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xEE, 0, 0}, 0, 2, 282 }, + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xEF, 0, 0}, 0, 2, 284 }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xEF, 0, 0}, 0, 2, 286 }, + { CPU_Any, MOD_GasOnly|MOD_GasSufB, 0, 0, 0, 1, {0xE6, 0, 0}, 0, 1, 3 }, + { CPU_Any, MOD_GasOnly|MOD_GasSufW, 16, 0, 0, 1, {0xE7, 0, 0}, 0, 1, 3 }, + { CPU_386, MOD_GasOnly|MOD_GasSufL, 32, 0, 0, 1, {0xE7, 0, 0}, 0, 1, 3 }, + { CPU_Any, MOD_GasOnly|MOD_GasSufB, 0, 0, 0, 1, {0xEE, 0, 0}, 0, 1, 282 }, + { CPU_Any, MOD_GasOnly|MOD_GasSufW, 16, 0, 0, 1, {0xEF, 0, 0}, 0, 1, 282 }, + { CPU_386, MOD_GasOnly|MOD_GasSufL, 32, 0, 0, 1, {0xEF, 0, 0}, 0, 1, 282 } }; static const x86_insn_info lea_insn[] = { - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x8D, 0, 0}, 0, 2, {OPT_Reg|OPS_16|OPA_Spare, OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x8D, 0, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, 0} }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x8D, 0, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0} } + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x8D, 0, 0}, 0, 2, 306 }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x8D, 0, 0}, 0, 2, 176 }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x8D, 0, 0}, 0, 2, 308 } }; static const x86_insn_info ldes_insn[] = { - { CPU_Not64, MOD_Op0Add|MOD_GasSufW, 16, 0, 0, 1, {0x00, 0, 0}, 0, 2, {OPT_Reg|OPS_16|OPA_Spare, OPT_Mem|OPS_Any|OPA_EA, 0} }, - { CPU_386|CPU_Not64, MOD_Op0Add|MOD_GasSufL, 32, 0, 0, 1, {0x00, 0, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_Mem|OPS_Any|OPA_EA, 0} } + { CPU_Not64, MOD_Op0Add|MOD_GasSufW, 16, 0, 0, 1, {0x00, 0, 0}, 0, 2, 336 }, + { CPU_386|CPU_Not64, MOD_Op0Add|MOD_GasSufL, 32, 0, 0, 1, {0x00, 0, 0}, 0, 2, 338 } }; static const x86_insn_info lfgss_insn[] = { - { CPU_386, MOD_Op1Add|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_Reg|OPS_16|OPA_Spare, OPT_Mem|OPS_Any|OPA_EA, 0} }, - { CPU_386, MOD_Op1Add|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_Mem|OPS_Any|OPA_EA, 0} } + { CPU_386, MOD_Op1Add|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 336 }, + { CPU_386, MOD_Op1Add|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 338 } }; static const x86_insn_info arith_insn[] = { - { CPU_Any, MOD_Op0Add|MOD_GasSufB, 0, 0, 0, 1, {0x04, 0, 0}, 0, 2, {OPT_Areg|OPS_8|OPA_None, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_Any, MOD_Op2Add|MOD_Op1AddSp|MOD_GasSufW, 16, 0, 0, 2, {0x83, 0xC0, 0x05}, 0, 2, {OPT_Areg|OPS_16|OPA_None, OPT_Imm|OPS_16|OPS_Relaxed|OPA_Imm|OPAP_SImm8, 0} }, - { CPU_386, MOD_Op2Add|MOD_Op1AddSp|MOD_GasSufL, 32, 0, 0, 2, {0x83, 0xC0, 0x05}, 0, 2, {OPT_Areg|OPS_32|OPA_None, OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm|OPAP_SImm8, 0} }, - { CPU_64, MOD_Op2Add|MOD_Op1AddSp|MOD_GasSufQ, 64, 0, 0, 2, {0x83, 0xC0, 0x05}, 0, 2, {OPT_Areg|OPS_64|OPA_None, OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm|OPAP_SImm8, 0} }, - { CPU_Any, MOD_Gap0|MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0x80, 0, 0}, 0, 2, {OPT_RM|OPS_8|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_Any, MOD_Gap0|MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0x80, 0, 0}, 0, 2, {OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPA_Imm, 0} }, - { CPU_Any, MOD_Gap0|MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0x83, 0, 0}, 0, 2, {OPT_RM|OPS_16|OPA_EA, OPT_Imm|OPS_8|OPA_SImm, 0} }, - { CPU_Any, MOD_Gap0|MOD_SpAdd|MOD_GasIllegal, 16, 0, 0, 1, {0x83, 0x81, 0}, 0, 2, {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_16|OPA_Imm|OPAP_SImm8, 0} }, - { CPU_Any, MOD_Gap0|MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0x83, 0x81, 0}, 0, 2, {OPT_RM|OPS_16|OPA_EA, OPT_Imm|OPS_16|OPS_Relaxed|OPA_Imm|OPAP_SImm8, 0} }, - { CPU_386, MOD_Gap0|MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0x83, 0, 0}, 0, 2, {OPT_RM|OPS_32|OPA_EA, OPT_Imm|OPS_8|OPA_SImm, 0} }, - { CPU_386|CPU_Not64, MOD_Gap0|MOD_SpAdd|MOD_GasIllegal, 32, 0, 0, 1, {0x83, 0x81, 0}, 0, 2, {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_32|OPA_Imm|OPAP_SImm8, 0} }, - { CPU_386, MOD_Gap0|MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0x83, 0x81, 0}, 0, 2, {OPT_RM|OPS_32|OPA_EA, OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm|OPAP_SImm8, 0} }, - { CPU_64, MOD_Gap0|MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, {0x83, 0, 0}, 0, 2, {OPT_RM|OPS_64|OPA_EA, OPT_Imm|OPS_8|OPA_SImm, 0} }, - { CPU_64, MOD_Gap0|MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, {0x83, 0x81, 0}, 0, 2, {OPT_RM|OPS_64|OPA_EA, OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm|OPAP_SImm8, 0} }, - { CPU_Any, MOD_Op0Add|MOD_GasSufB, 0, 0, 0, 1, {0x00, 0, 0}, 0, 2, {OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_8|OPA_Spare, 0} }, - { CPU_Any, MOD_Op0Add|MOD_GasSufW, 16, 0, 0, 1, {0x01, 0, 0}, 0, 2, {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_16|OPA_Spare, 0} }, - { CPU_386, MOD_Op0Add|MOD_GasSufL, 32, 0, 0, 1, {0x01, 0, 0}, 0, 2, {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_32|OPA_Spare, 0} }, - { CPU_64, MOD_Op0Add|MOD_GasSufQ, 64, 0, 0, 1, {0x01, 0, 0}, 0, 2, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_64|OPA_Spare, 0} }, - { CPU_Any, MOD_Op0Add|MOD_GasSufB, 0, 0, 0, 1, {0x02, 0, 0}, 0, 2, {OPT_Reg|OPS_8|OPA_Spare, OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, 0} }, - { CPU_Any, MOD_Op0Add|MOD_GasSufW, 16, 0, 0, 1, {0x03, 0, 0}, 0, 2, {OPT_Reg|OPS_16|OPA_Spare, OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, 0} }, - { CPU_386, MOD_Op0Add|MOD_GasSufL, 32, 0, 0, 1, {0x03, 0, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} }, - { CPU_64, MOD_Op0Add|MOD_GasSufQ, 64, 0, 0, 1, {0x03, 0, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} } + { CPU_Any, MOD_Op0Add|MOD_GasSufB, 0, 0, 0, 1, {0x04, 0, 0}, 0, 2, 277 }, + { CPU_Any, MOD_Op2Add|MOD_Op1AddSp|MOD_GasSufW, 16, 0, 0, 2, {0x83, 0xC0, 0x05}, 0, 2, 340 }, + { CPU_386, MOD_Op2Add|MOD_Op1AddSp|MOD_GasSufL, 32, 0, 0, 2, {0x83, 0xC0, 0x05}, 0, 2, 342 }, + { CPU_64, MOD_Op2Add|MOD_Op1AddSp|MOD_GasSufQ, 64, 0, 0, 2, {0x83, 0xC0, 0x05}, 0, 2, 344 }, + { CPU_Any, MOD_Gap0|MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0x80, 0, 0}, 0, 2, 238 }, + { CPU_Any, MOD_Gap0|MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0x80, 0, 0}, 0, 2, 230 }, + { CPU_Any, MOD_Gap0|MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0x83, 0, 0}, 0, 2, 346 }, + { CPU_Any, MOD_Gap0|MOD_SpAdd|MOD_GasIllegal, 16, 0, 0, 1, {0x83, 0x81, 0}, 0, 2, 348 }, + { CPU_Any, MOD_Gap0|MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0x83, 0x81, 0}, 0, 2, 350 }, + { CPU_386, MOD_Gap0|MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0x83, 0, 0}, 0, 2, 352 }, + { CPU_386|CPU_Not64, MOD_Gap0|MOD_SpAdd|MOD_GasIllegal, 32, 0, 0, 1, {0x83, 0x81, 0}, 0, 2, 354 }, + { CPU_386, MOD_Gap0|MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0x83, 0x81, 0}, 0, 2, 356 }, + { CPU_64, MOD_Gap0|MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, {0x83, 0, 0}, 0, 2, 358 }, + { CPU_64, MOD_Gap0|MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, {0x83, 0x81, 0}, 0, 2, 360 }, + { CPU_Any, MOD_Op0Add|MOD_GasSufB, 0, 0, 0, 1, {0x00, 0, 0}, 0, 2, 140 }, + { CPU_Any, MOD_Op0Add|MOD_GasSufW, 16, 0, 0, 1, {0x01, 0, 0}, 0, 2, 94 }, + { CPU_386, MOD_Op0Add|MOD_GasSufL, 32, 0, 0, 1, {0x01, 0, 0}, 0, 2, 100 }, + { CPU_64, MOD_Op0Add|MOD_GasSufQ, 64, 0, 0, 1, {0x01, 0, 0}, 0, 2, 106 }, + { CPU_Any, MOD_Op0Add|MOD_GasSufB, 0, 0, 0, 1, {0x02, 0, 0}, 0, 2, 142 }, + { CPU_Any, MOD_Op0Add|MOD_GasSufW, 16, 0, 0, 1, {0x03, 0, 0}, 0, 2, 4 }, + { CPU_386, MOD_Op0Add|MOD_GasSufL, 32, 0, 0, 1, {0x03, 0, 0}, 0, 2, 7 }, + { CPU_64, MOD_Op0Add|MOD_GasSufQ, 64, 0, 0, 1, {0x03, 0, 0}, 0, 2, 10 } }; static const x86_insn_info incdec_insn[] = { - { CPU_Any, MOD_Gap0|MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0xFE, 0, 0}, 0, 1, {OPT_RM|OPS_8|OPA_EA, 0, 0} }, - { CPU_Not64, MOD_Op0Add|MOD_GasSufW, 16, 0, 0, 1, {0x00, 0, 0}, 0, 1, {OPT_Reg|OPS_16|OPA_Op0Add, 0, 0} }, - { CPU_Any, MOD_Gap0|MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0xFF, 0, 0}, 0, 1, {OPT_RM|OPS_16|OPA_EA, 0, 0} }, - { CPU_386|CPU_Not64, MOD_Op0Add|MOD_GasSufL, 32, 0, 0, 1, {0x00, 0, 0}, 0, 1, {OPT_Reg|OPS_32|OPA_Op0Add, 0, 0} }, - { CPU_386, MOD_Gap0|MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0xFF, 0, 0}, 0, 1, {OPT_RM|OPS_32|OPA_EA, 0, 0} }, - { CPU_64, MOD_Gap0|MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, {0xFF, 0, 0}, 0, 1, {OPT_RM|OPS_64|OPA_EA, 0, 0} } + { CPU_Any, MOD_Gap0|MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0xFE, 0, 0}, 0, 1, 238 }, + { CPU_Not64, MOD_Op0Add|MOD_GasSufW, 16, 0, 0, 1, {0x00, 0, 0}, 0, 1, 222 }, + { CPU_Any, MOD_Gap0|MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0xFF, 0, 0}, 0, 1, 112 }, + { CPU_386|CPU_Not64, MOD_Op0Add|MOD_GasSufL, 32, 0, 0, 1, {0x00, 0, 0}, 0, 1, 224 }, + { CPU_386, MOD_Gap0|MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0xFF, 0, 0}, 0, 1, 114 }, + { CPU_64, MOD_Gap0|MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, {0xFF, 0, 0}, 0, 1, 116 } }; static const x86_insn_info f6_insn[] = { - { CPU_Any, MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0xF6, 0, 0}, 0, 1, {OPT_RM|OPS_8|OPA_EA, 0, 0} }, - { CPU_Any, MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0xF7, 0, 0}, 0, 1, {OPT_RM|OPS_16|OPA_EA, 0, 0} }, - { CPU_386, MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0xF7, 0, 0}, 0, 1, {OPT_RM|OPS_32|OPA_EA, 0, 0} }, - { CPU_64, MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, {0xF7, 0, 0}, 0, 1, {OPT_RM|OPS_64|OPA_EA, 0, 0} } + { CPU_Any, MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0xF6, 0, 0}, 0, 1, 238 }, + { CPU_Any, MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0xF7, 0, 0}, 0, 1, 112 }, + { CPU_386, MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0xF7, 0, 0}, 0, 1, 114 }, + { CPU_64, MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, {0xF7, 0, 0}, 0, 1, 116 } }; static const x86_insn_info div_insn[] = { - { CPU_Any, MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0xF6, 0, 0}, 0, 1, {OPT_RM|OPS_8|OPA_EA, 0, 0} }, - { CPU_Any, MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0xF7, 0, 0}, 0, 1, {OPT_RM|OPS_16|OPA_EA, 0, 0} }, - { CPU_386, MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0xF7, 0, 0}, 0, 1, {OPT_RM|OPS_32|OPA_EA, 0, 0} }, - { CPU_64, MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, {0xF7, 0, 0}, 0, 1, {OPT_RM|OPS_64|OPA_EA, 0, 0} }, - { CPU_Any, MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0xF6, 0, 0}, 0, 2, {OPT_Areg|OPS_8|OPA_None, OPT_RM|OPS_8|OPA_EA, 0} }, - { CPU_Any, MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0xF7, 0, 0}, 0, 2, {OPT_Areg|OPS_16|OPA_None, OPT_RM|OPS_16|OPA_EA, 0} }, - { CPU_386, MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0xF7, 0, 0}, 0, 2, {OPT_Areg|OPS_32|OPA_None, OPT_RM|OPS_32|OPA_EA, 0} }, - { CPU_64, MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, {0xF7, 0, 0}, 0, 2, {OPT_Areg|OPS_64|OPA_None, OPT_RM|OPS_64|OPA_EA, 0} } + { CPU_Any, MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0xF6, 0, 0}, 0, 1, 238 }, + { CPU_Any, MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0xF7, 0, 0}, 0, 1, 112 }, + { CPU_386, MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0xF7, 0, 0}, 0, 1, 114 }, + { CPU_64, MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, {0xF7, 0, 0}, 0, 1, 116 }, + { CPU_Any, MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0xF6, 0, 0}, 0, 2, 266 }, + { CPU_Any, MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0xF7, 0, 0}, 0, 2, 268 }, + { CPU_386, MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0xF7, 0, 0}, 0, 2, 270 }, + { CPU_64, MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, {0xF7, 0, 0}, 0, 2, 272 } }; static const x86_insn_info test_insn[] = { - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xA8, 0, 0}, 0, 2, {OPT_Areg|OPS_8|OPA_None, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xA9, 0, 0}, 0, 2, {OPT_Areg|OPS_16|OPA_None, OPT_Imm|OPS_16|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xA9, 0, 0}, 0, 2, {OPT_Areg|OPS_32|OPA_None, OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xA9, 0, 0}, 0, 2, {OPT_Areg|OPS_64|OPA_None, OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xF6, 0, 0}, 0, 2, {OPT_RM|OPS_8|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xF6, 0, 0}, 0, 2, {OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPA_Imm, 0} }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xF7, 0, 0}, 0, 2, {OPT_RM|OPS_16|OPA_EA, OPT_Imm|OPS_16|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xF7, 0, 0}, 0, 2, {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_16|OPA_Imm, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xF7, 0, 0}, 0, 2, {OPT_RM|OPS_32|OPA_EA, OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xF7, 0, 0}, 0, 2, {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_32|OPA_Imm, 0} }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xF7, 0, 0}, 0, 2, {OPT_RM|OPS_64|OPA_EA, OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xF7, 0, 0}, 0, 2, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_32|OPA_Imm, 0} }, - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0x84, 0, 0}, 0, 2, {OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_8|OPA_Spare, 0} }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x85, 0, 0}, 0, 2, {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_16|OPA_Spare, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x85, 0, 0}, 0, 2, {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_32|OPA_Spare, 0} }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x85, 0, 0}, 0, 2, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_64|OPA_Spare, 0} }, - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0x84, 0, 0}, 0, 2, {OPT_Reg|OPS_8|OPA_Spare, OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, 0} }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x85, 0, 0}, 0, 2, {OPT_Reg|OPS_16|OPA_Spare, OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x85, 0, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x85, 0, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} } + { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xA8, 0, 0}, 0, 2, 277 }, + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xA9, 0, 0}, 0, 2, 388 }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xA9, 0, 0}, 0, 2, 390 }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xA9, 0, 0}, 0, 2, 392 }, + { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xF6, 0, 0}, 0, 2, 238 }, + { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xF6, 0, 0}, 0, 2, 230 }, + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xF7, 0, 0}, 0, 2, 240 }, + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xF7, 0, 0}, 0, 2, 232 }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xF7, 0, 0}, 0, 2, 242 }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xF7, 0, 0}, 0, 2, 234 }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xF7, 0, 0}, 0, 2, 244 }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xF7, 0, 0}, 0, 2, 236 }, + { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0x84, 0, 0}, 0, 2, 140 }, + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x85, 0, 0}, 0, 2, 94 }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x85, 0, 0}, 0, 2, 100 }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x85, 0, 0}, 0, 2, 106 }, + { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0x84, 0, 0}, 0, 2, 142 }, + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x85, 0, 0}, 0, 2, 4 }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x85, 0, 0}, 0, 2, 7 }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x85, 0, 0}, 0, 2, 10 } }; static const x86_insn_info aadm_insn[] = { - { CPU_Any, MOD_Op0Add, 0, 0, 0, 2, {0xD4, 0x0A, 0}, 0, 0, {0, 0, 0} }, - { CPU_Any, MOD_Op0Add, 0, 0, 0, 1, {0xD4, 0, 0}, 0, 1, {OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0, 0} } + { CPU_Any, MOD_Op0Add, 0, 0, 0, 2, {0xD4, 0x0A, 0}, 0, 0, 0 }, + { CPU_Any, MOD_Op0Add, 0, 0, 0, 1, {0xD4, 0, 0}, 0, 1, 3 } }; static const x86_insn_info imul_insn[] = { - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xF6, 0, 0}, 5, 1, {OPT_RM|OPS_8|OPA_EA, 0, 0} }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xF7, 0, 0}, 5, 1, {OPT_RM|OPS_16|OPA_EA, 0, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xF7, 0, 0}, 5, 1, {OPT_RM|OPS_32|OPA_EA, 0, 0} }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xF7, 0, 0}, 5, 1, {OPT_RM|OPS_64|OPA_EA, 0, 0} }, - { CPU_386, MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0xAF, 0}, 0, 2, {OPT_Reg|OPS_16|OPA_Spare, OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0xAF, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} }, - { CPU_386|CPU_64, MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0xAF, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} }, - { CPU_186, MOD_GasSufW, 16, 0, 0, 1, {0x6B, 0, 0}, 0, 3, {OPT_Reg|OPS_16|OPA_Spare, OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPA_SImm} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x6B, 0, 0}, 0, 3, {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPA_SImm} }, - { CPU_186|CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x6B, 0, 0}, 0, 3, {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPA_SImm} }, - { CPU_186, MOD_GasSufW, 16, 0, 0, 1, {0x6B, 0, 0}, 0, 2, {OPT_Reg|OPS_16|OPA_SpareEA, OPT_Imm|OPS_8|OPA_SImm, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x6B, 0, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_SpareEA, OPT_Imm|OPS_8|OPA_SImm, 0} }, - { CPU_186|CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x6B, 0, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_SpareEA, OPT_Imm|OPS_8|OPA_SImm, 0} }, - { CPU_186, MOD_GasSufW, 16, 0, 0, 1, {0x6B, 0x69, 0}, 0, 3, {OPT_Reg|OPS_16|OPA_Spare, OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_16|OPS_Relaxed|OPA_SImm|OPAP_SImm8} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x6B, 0x69, 0}, 0, 3, {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_32|OPS_Relaxed|OPA_SImm|OPAP_SImm8} }, - { CPU_186|CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x6B, 0x69, 0}, 0, 3, {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_32|OPS_Relaxed|OPA_SImm|OPAP_SImm8} }, - { CPU_186, MOD_GasSufW, 16, 0, 0, 1, {0x6B, 0x69, 0}, 0, 2, {OPT_Reg|OPS_16|OPA_SpareEA, OPT_Imm|OPS_16|OPS_Relaxed|OPA_SImm|OPAP_SImm8, 0} }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x6B, 0x69, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_SpareEA, OPT_Imm|OPS_32|OPS_Relaxed|OPA_SImm|OPAP_SImm8, 0} }, - { CPU_186|CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x6B, 0x69, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_SpareEA, OPT_Imm|OPS_32|OPS_Relaxed|OPA_SImm|OPAP_SImm8, 0} } + { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xF6, 0, 0}, 5, 1, 238 }, + { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xF7, 0, 0}, 5, 1, 112 }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xF7, 0, 0}, 5, 1, 114 }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xF7, 0, 0}, 5, 1, 116 }, + { CPU_386, MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0xAF, 0}, 0, 2, 4 }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0xAF, 0}, 0, 2, 7 }, + { CPU_386|CPU_64, MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0xAF, 0}, 0, 2, 10 }, + { CPU_186, MOD_GasSufW, 16, 0, 0, 1, {0x6B, 0, 0}, 0, 3, 4 }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x6B, 0, 0}, 0, 3, 7 }, + { CPU_186|CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x6B, 0, 0}, 0, 3, 10 }, + { CPU_186, MOD_GasSufW, 16, 0, 0, 1, {0x6B, 0, 0}, 0, 2, 124 }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x6B, 0, 0}, 0, 2, 126 }, + { CPU_186|CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x6B, 0, 0}, 0, 2, 128 }, + { CPU_186, MOD_GasSufW, 16, 0, 0, 1, {0x6B, 0x69, 0}, 0, 3, 13 }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x6B, 0x69, 0}, 0, 3, 16 }, + { CPU_186|CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x6B, 0x69, 0}, 0, 3, 19 }, + { CPU_186, MOD_GasSufW, 16, 0, 0, 1, {0x6B, 0x69, 0}, 0, 2, 130 }, + { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x6B, 0x69, 0}, 0, 2, 132 }, + { CPU_186|CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x6B, 0x69, 0}, 0, 2, 134 } }; static const x86_insn_info shift_insn[] = { - { CPU_Any, MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0xD2, 0, 0}, 0, 2, {OPT_RM|OPS_8|OPA_EA, OPT_Creg|OPS_8|OPA_None, 0} }, - { CPU_Any, MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0xD0, 0, 0}, 0, 2, {OPT_RM|OPS_8|OPA_EA, OPT_Imm1|OPS_8|OPS_Relaxed|OPA_None, 0} }, - { CPU_186, MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0xC0, 0, 0}, 0, 2, {OPT_RM|OPS_8|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_Any, MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0xD3, 0, 0}, 0, 2, {OPT_RM|OPS_16|OPA_EA, OPT_Creg|OPS_8|OPA_None, 0} }, - { CPU_Any, MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0xD1, 0, 0}, 0, 2, {OPT_RM|OPS_16|OPA_EA, OPT_Imm1|OPS_8|OPS_Relaxed|OPA_None, 0} }, - { CPU_186, MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0xC1, 0, 0}, 0, 2, {OPT_RM|OPS_16|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_386, MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0xD3, 0, 0}, 0, 2, {OPT_RM|OPS_32|OPA_EA, OPT_Creg|OPS_8|OPA_None, 0} }, - { CPU_386, MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0xD1, 0, 0}, 0, 2, {OPT_RM|OPS_32|OPA_EA, OPT_Imm1|OPS_8|OPS_Relaxed|OPA_None, 0} }, - { CPU_386, MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0xC1, 0, 0}, 0, 2, {OPT_RM|OPS_32|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_64, MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, {0xD3, 0, 0}, 0, 2, {OPT_RM|OPS_64|OPA_EA, OPT_Creg|OPS_8|OPA_None, 0} }, - { CPU_64, MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, {0xD1, 0, 0}, 0, 2, {OPT_RM|OPS_64|OPA_EA, OPT_Imm1|OPS_8|OPS_Relaxed|OPA_None, 0} }, - { CPU_186|CPU_64, MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, {0xC1, 0, 0}, 0, 2, {OPT_RM|OPS_64|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_Any, MOD_SpAdd|MOD_GasOnly|MOD_GasSufB, 0, 0, 0, 1, {0xD0, 0, 0}, 0, 1, {OPT_RM|OPS_8|OPA_EA, 0, 0} }, - { CPU_Any, MOD_SpAdd|MOD_GasOnly|MOD_GasSufW, 16, 0, 0, 1, {0xD1, 0, 0}, 0, 1, {OPT_RM|OPS_16|OPA_EA, 0, 0} }, - { CPU_386, MOD_SpAdd|MOD_GasOnly|MOD_GasSufL, 32, 0, 0, 1, {0xD1, 0, 0}, 0, 1, {OPT_RM|OPS_32|OPA_EA, 0, 0} }, - { CPU_64, MOD_SpAdd|MOD_GasOnly|MOD_GasSufQ, 64, 0, 0, 1, {0xD1, 0, 0}, 0, 1, {OPT_RM|OPS_64|OPA_EA, 0, 0} } + { CPU_Any, MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0xD2, 0, 0}, 0, 2, 318 }, + { CPU_Any, MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0xD0, 0, 0}, 0, 2, 320 }, + { CPU_186, MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0xC0, 0, 0}, 0, 2, 238 }, + { CPU_Any, MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0xD3, 0, 0}, 0, 2, 322 }, + { CPU_Any, MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0xD1, 0, 0}, 0, 2, 324 }, + { CPU_186, MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0xC1, 0, 0}, 0, 2, 112 }, + { CPU_386, MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0xD3, 0, 0}, 0, 2, 326 }, + { CPU_386, MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0xD1, 0, 0}, 0, 2, 328 }, + { CPU_386, MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0xC1, 0, 0}, 0, 2, 114 }, + { CPU_64, MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, {0xD3, 0, 0}, 0, 2, 330 }, + { CPU_64, MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, {0xD1, 0, 0}, 0, 2, 332 }, + { CPU_186|CPU_64, MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, {0xC1, 0, 0}, 0, 2, 116 }, + { CPU_Any, MOD_SpAdd|MOD_GasOnly|MOD_GasSufB, 0, 0, 0, 1, {0xD0, 0, 0}, 0, 1, 238 }, + { CPU_Any, MOD_SpAdd|MOD_GasOnly|MOD_GasSufW, 16, 0, 0, 1, {0xD1, 0, 0}, 0, 1, 112 }, + { CPU_386, MOD_SpAdd|MOD_GasOnly|MOD_GasSufL, 32, 0, 0, 1, {0xD1, 0, 0}, 0, 1, 114 }, + { CPU_64, MOD_SpAdd|MOD_GasOnly|MOD_GasSufQ, 64, 0, 0, 1, {0xD1, 0, 0}, 0, 1, 116 } }; static const x86_insn_info shlrd_insn[] = { - { CPU_386, MOD_Op1Add|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x00, 0}, 0, 3, {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_16|OPA_Spare, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, - { CPU_386, MOD_Op1Add|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x01, 0}, 0, 3, {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_16|OPA_Spare, OPT_Creg|OPS_8|OPA_None} }, - { CPU_386, MOD_Op1Add|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x00, 0}, 0, 3, {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_32|OPA_Spare, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, - { CPU_386, MOD_Op1Add|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x01, 0}, 0, 3, {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_32|OPA_Spare, OPT_Creg|OPS_8|OPA_None} }, - { CPU_386|CPU_64, MOD_Op1Add|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x00, 0}, 0, 3, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_64|OPA_Spare, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, - { CPU_386|CPU_64, MOD_Op1Add|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x01, 0}, 0, 3, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_64|OPA_Spare, OPT_Creg|OPS_8|OPA_None} }, - { CPU_386, MOD_Op1Add|MOD_GasOnly|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x01, 0}, 0, 2, {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_16|OPA_Spare, 0} }, - { CPU_386, MOD_Op1Add|MOD_GasOnly|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x01, 0}, 0, 2, {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_32|OPA_Spare, 0} }, - { CPU_386|CPU_64, MOD_Op1Add|MOD_GasOnly|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x01, 0}, 0, 2, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_64|OPA_Spare, 0} } + { CPU_386, MOD_Op1Add|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x00, 0}, 0, 3, 94 }, + { CPU_386, MOD_Op1Add|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x01, 0}, 0, 3, 97 }, + { CPU_386, MOD_Op1Add|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x00, 0}, 0, 3, 100 }, + { CPU_386, MOD_Op1Add|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x01, 0}, 0, 3, 103 }, + { CPU_386|CPU_64, MOD_Op1Add|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x00, 0}, 0, 3, 106 }, + { CPU_386|CPU_64, MOD_Op1Add|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x01, 0}, 0, 3, 109 }, + { CPU_386, MOD_Op1Add|MOD_GasOnly|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x01, 0}, 0, 2, 94 }, + { CPU_386, MOD_Op1Add|MOD_GasOnly|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x01, 0}, 0, 2, 100 }, + { CPU_386|CPU_64, MOD_Op1Add|MOD_GasOnly|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x01, 0}, 0, 2, 106 } }; static const x86_insn_info call_insn[] = { - { CPU_Any, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 1, {OPT_ImmNotSegOff|OPS_Any|OPA_JmpRel, 0, 0} }, - { CPU_Any, 0, 16, 0, 0, 0, {0, 0, 0}, 0, 1, {OPT_ImmNotSegOff|OPS_16|OPA_JmpRel, 0, 0} }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 0, {0, 0, 0}, 0, 1, {OPT_ImmNotSegOff|OPS_32|OPA_JmpRel, 0, 0} }, - { CPU_64, 0, 64, 0, 0, 0, {0, 0, 0}, 0, 1, {OPT_ImmNotSegOff|OPS_32|OPA_JmpRel, 0, 0} }, - { CPU_Any, 0, 16, 64, 0, 1, {0xE8, 0, 0}, 0, 1, {OPT_Imm|OPS_16|OPTM_Near|OPA_JmpRel, 0, 0} }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0xE8, 0, 0}, 0, 1, {OPT_Imm|OPS_32|OPTM_Near|OPA_JmpRel, 0, 0} }, - { CPU_64, 0, 64, 64, 0, 1, {0xE8, 0, 0}, 0, 1, {OPT_Imm|OPS_32|OPTM_Near|OPA_JmpRel, 0, 0} }, - { CPU_Any, 0, 0, 64, 0, 1, {0xE8, 0, 0}, 0, 1, {OPT_Imm|OPS_Any|OPTM_Near|OPA_JmpRel, 0, 0} }, - { CPU_Any, 0, 16, 0, 0, 1, {0xFF, 0, 0}, 2, 1, {OPT_RM|OPS_16|OPA_EA, 0, 0} }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0xFF, 0, 0}, 2, 1, {OPT_RM|OPS_32|OPA_EA, 0, 0} }, - { CPU_64, 0, 64, 64, 0, 1, {0xFF, 0, 0}, 2, 1, {OPT_RM|OPS_64|OPA_EA, 0, 0} }, - { CPU_Any, 0, 0, 64, 0, 1, {0xFF, 0, 0}, 2, 1, {OPT_Mem|OPS_Any|OPA_EA, 0, 0} }, - { CPU_Any, 0, 16, 64, 0, 1, {0xFF, 0, 0}, 2, 1, {OPT_RM|OPS_16|OPTM_Near|OPA_EA, 0, 0} }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0xFF, 0, 0}, 2, 1, {OPT_RM|OPS_32|OPTM_Near|OPA_EA, 0, 0} }, - { CPU_64, 0, 64, 64, 0, 1, {0xFF, 0, 0}, 2, 1, {OPT_RM|OPS_64|OPTM_Near|OPA_EA, 0, 0} }, - { CPU_Any, 0, 0, 64, 0, 1, {0xFF, 0, 0}, 2, 1, {OPT_Mem|OPS_Any|OPTM_Near|OPA_EA, 0, 0} }, - { CPU_Any, 0, 16, 0, 0, 1, {0xFF, 0, 0}, 3, 1, {OPT_Mem|OPS_16|OPTM_Far|OPA_EA, 0, 0} }, - { CPU_386, 0, 32, 0, 0, 1, {0xFF, 0, 0}, 3, 1, {OPT_Mem|OPS_32|OPTM_Far|OPA_EA, 0, 0} }, - { CPU_64, 0, 64, 0, 0, 1, {0xFF, 0, 0}, 3, 1, {OPT_Mem|OPS_64|OPTM_Far|OPA_EA, 0, 0} }, - { CPU_Any, 0, 0, 0, 0, 1, {0xFF, 0, 0}, 3, 1, {OPT_Mem|OPS_Any|OPTM_Far|OPA_EA, 0, 0} }, - { CPU_Not64, 0, 16, 0, 0, 1, {0x9A, 0, 0}, 3, 1, {OPT_Imm|OPS_16|OPTM_Far|OPA_JmpFar, 0, 0} }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0x9A, 0, 0}, 3, 1, {OPT_Imm|OPS_32|OPTM_Far|OPA_JmpFar, 0, 0} }, - { CPU_Not64, 0, 0, 0, 0, 1, {0x9A, 0, 0}, 3, 1, {OPT_Imm|OPS_Any|OPTM_Far|OPA_JmpFar, 0, 0} }, - { CPU_Not64, 0, 16, 0, 0, 1, {0x9A, 0, 0}, 3, 1, {OPT_Imm|OPS_16|OPA_JmpFar, 0, 0} }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0x9A, 0, 0}, 3, 1, {OPT_Imm|OPS_32|OPA_JmpFar, 0, 0} }, - { CPU_Not64, 0, 0, 0, 0, 1, {0x9A, 0, 0}, 3, 1, {OPT_Imm|OPS_Any|OPA_JmpFar, 0, 0} } + { CPU_Any, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 1, 422 }, + { CPU_Any, 0, 16, 0, 0, 0, {0, 0, 0}, 0, 1, 423 }, + { CPU_386|CPU_Not64, 0, 32, 0, 0, 0, {0, 0, 0}, 0, 1, 424 }, + { CPU_64, 0, 64, 0, 0, 0, {0, 0, 0}, 0, 1, 424 }, + { CPU_Any, 0, 16, 64, 0, 1, {0xE8, 0, 0}, 0, 1, 425 }, + { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0xE8, 0, 0}, 0, 1, 426 }, + { CPU_64, 0, 64, 64, 0, 1, {0xE8, 0, 0}, 0, 1, 426 }, + { CPU_Any, 0, 0, 64, 0, 1, {0xE8, 0, 0}, 0, 1, 427 }, + { CPU_Any, 0, 16, 0, 0, 1, {0xFF, 0, 0}, 2, 1, 112 }, + { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0xFF, 0, 0}, 2, 1, 114 }, + { CPU_64, 0, 64, 64, 0, 1, {0xFF, 0, 0}, 2, 1, 116 }, + { CPU_Any, 0, 0, 64, 0, 1, {0xFF, 0, 0}, 2, 1, 337 }, + { CPU_Any, 0, 16, 64, 0, 1, {0xFF, 0, 0}, 2, 1, 428 }, + { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0xFF, 0, 0}, 2, 1, 429 }, + { CPU_64, 0, 64, 64, 0, 1, {0xFF, 0, 0}, 2, 1, 430 }, + { CPU_Any, 0, 0, 64, 0, 1, {0xFF, 0, 0}, 2, 1, 431 }, + { CPU_Any, 0, 16, 0, 0, 1, {0xFF, 0, 0}, 3, 1, 432 }, + { CPU_386, 0, 32, 0, 0, 1, {0xFF, 0, 0}, 3, 1, 433 }, + { CPU_64, 0, 64, 0, 0, 1, {0xFF, 0, 0}, 3, 1, 434 }, + { CPU_Any, 0, 0, 0, 0, 1, {0xFF, 0, 0}, 3, 1, 435 }, + { CPU_Not64, 0, 16, 0, 0, 1, {0x9A, 0, 0}, 3, 1, 436 }, + { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0x9A, 0, 0}, 3, 1, 437 }, + { CPU_Not64, 0, 0, 0, 0, 1, {0x9A, 0, 0}, 3, 1, 438 }, + { CPU_Not64, 0, 16, 0, 0, 1, {0x9A, 0, 0}, 3, 1, 439 }, + { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0x9A, 0, 0}, 3, 1, 440 }, + { CPU_Not64, 0, 0, 0, 0, 1, {0x9A, 0, 0}, 3, 1, 441 } }; static const x86_insn_info jmp_insn[] = { - { CPU_Any, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 1, {OPT_ImmNotSegOff|OPS_Any|OPA_JmpRel, 0, 0} }, - { CPU_Any, 0, 16, 0, 0, 0, {0, 0, 0}, 0, 1, {OPT_ImmNotSegOff|OPS_16|OPA_JmpRel, 0, 0} }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0x00, 0, 0}, 0, 1, {OPT_ImmNotSegOff|OPS_32|OPA_JmpRel, 0, 0} }, - { CPU_64, 0, 64, 0, 0, 1, {0x00, 0, 0}, 0, 1, {OPT_ImmNotSegOff|OPS_32|OPA_JmpRel, 0, 0} }, - { CPU_Any, 0, 0, 64, 0, 1, {0xEB, 0, 0}, 0, 1, {OPT_Imm|OPS_Any|OPTM_Short|OPA_JmpRel, 0, 0} }, - { CPU_Any, 0, 16, 64, 0, 1, {0xE9, 0, 0}, 0, 1, {OPT_Imm|OPS_16|OPTM_Near|OPA_JmpRel, 0, 0} }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0xE9, 0, 0}, 0, 1, {OPT_Imm|OPS_32|OPTM_Near|OPA_JmpRel, 0, 0} }, - { CPU_64, 0, 64, 64, 0, 1, {0xE9, 0, 0}, 0, 1, {OPT_Imm|OPS_32|OPTM_Near|OPA_JmpRel, 0, 0} }, - { CPU_Any, 0, 0, 64, 0, 1, {0xE9, 0, 0}, 0, 1, {OPT_Imm|OPS_Any|OPTM_Near|OPA_JmpRel, 0, 0} }, - { CPU_Any, 0, 16, 64, 0, 1, {0xFF, 0, 0}, 4, 1, {OPT_RM|OPS_16|OPA_EA, 0, 0} }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0xFF, 0, 0}, 4, 1, {OPT_RM|OPS_32|OPA_EA, 0, 0} }, - { CPU_64, 0, 64, 64, 0, 1, {0xFF, 0, 0}, 4, 1, {OPT_RM|OPS_64|OPA_EA, 0, 0} }, - { CPU_Any, 0, 0, 64, 0, 1, {0xFF, 0, 0}, 4, 1, {OPT_Mem|OPS_Any|OPA_EA, 0, 0} }, - { CPU_Any, 0, 16, 64, 0, 1, {0xFF, 0, 0}, 4, 1, {OPT_RM|OPS_16|OPTM_Near|OPA_EA, 0, 0} }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0xFF, 0, 0}, 4, 1, {OPT_RM|OPS_32|OPTM_Near|OPA_EA, 0, 0} }, - { CPU_64, 0, 64, 64, 0, 1, {0xFF, 0, 0}, 4, 1, {OPT_RM|OPS_64|OPTM_Near|OPA_EA, 0, 0} }, - { CPU_Any, 0, 0, 64, 0, 1, {0xFF, 0, 0}, 4, 1, {OPT_Mem|OPS_Any|OPTM_Near|OPA_EA, 0, 0} }, - { CPU_Any, 0, 16, 0, 0, 1, {0xFF, 0, 0}, 5, 1, {OPT_Mem|OPS_16|OPTM_Far|OPA_EA, 0, 0} }, - { CPU_386, 0, 32, 0, 0, 1, {0xFF, 0, 0}, 5, 1, {OPT_Mem|OPS_32|OPTM_Far|OPA_EA, 0, 0} }, - { CPU_64, 0, 64, 0, 0, 1, {0xFF, 0, 0}, 5, 1, {OPT_Mem|OPS_64|OPTM_Far|OPA_EA, 0, 0} }, - { CPU_Any, 0, 0, 0, 0, 1, {0xFF, 0, 0}, 5, 1, {OPT_Mem|OPS_Any|OPTM_Far|OPA_EA, 0, 0} }, - { CPU_Not64, 0, 16, 0, 0, 1, {0xEA, 0, 0}, 3, 1, {OPT_Imm|OPS_16|OPTM_Far|OPA_JmpFar, 0, 0} }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0xEA, 0, 0}, 3, 1, {OPT_Imm|OPS_32|OPTM_Far|OPA_JmpFar, 0, 0} }, - { CPU_Not64, 0, 0, 0, 0, 1, {0xEA, 0, 0}, 3, 1, {OPT_Imm|OPS_Any|OPTM_Far|OPA_JmpFar, 0, 0} }, - { CPU_Not64, 0, 16, 0, 0, 1, {0xEA, 0, 0}, 3, 1, {OPT_Imm|OPS_16|OPA_JmpFar, 0, 0} }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0xEA, 0, 0}, 3, 1, {OPT_Imm|OPS_32|OPA_JmpFar, 0, 0} }, - { CPU_Not64, 0, 0, 0, 0, 1, {0xEA, 0, 0}, 3, 1, {OPT_Imm|OPS_Any|OPA_JmpFar, 0, 0} } + { CPU_Any, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 1, 422 }, + { CPU_Any, 0, 16, 0, 0, 0, {0, 0, 0}, 0, 1, 423 }, + { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0x00, 0, 0}, 0, 1, 424 }, + { CPU_64, 0, 64, 0, 0, 1, {0x00, 0, 0}, 0, 1, 424 }, + { CPU_Any, 0, 0, 64, 0, 1, {0xEB, 0, 0}, 0, 1, 376 }, + { CPU_Any, 0, 16, 64, 0, 1, {0xE9, 0, 0}, 0, 1, 425 }, + { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0xE9, 0, 0}, 0, 1, 426 }, + { CPU_64, 0, 64, 64, 0, 1, {0xE9, 0, 0}, 0, 1, 426 }, + { CPU_Any, 0, 0, 64, 0, 1, {0xE9, 0, 0}, 0, 1, 427 }, + { CPU_Any, 0, 16, 64, 0, 1, {0xFF, 0, 0}, 4, 1, 112 }, + { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0xFF, 0, 0}, 4, 1, 114 }, + { CPU_64, 0, 64, 64, 0, 1, {0xFF, 0, 0}, 4, 1, 116 }, + { CPU_Any, 0, 0, 64, 0, 1, {0xFF, 0, 0}, 4, 1, 337 }, + { CPU_Any, 0, 16, 64, 0, 1, {0xFF, 0, 0}, 4, 1, 428 }, + { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0xFF, 0, 0}, 4, 1, 429 }, + { CPU_64, 0, 64, 64, 0, 1, {0xFF, 0, 0}, 4, 1, 430 }, + { CPU_Any, 0, 0, 64, 0, 1, {0xFF, 0, 0}, 4, 1, 431 }, + { CPU_Any, 0, 16, 0, 0, 1, {0xFF, 0, 0}, 5, 1, 432 }, + { CPU_386, 0, 32, 0, 0, 1, {0xFF, 0, 0}, 5, 1, 433 }, + { CPU_64, 0, 64, 0, 0, 1, {0xFF, 0, 0}, 5, 1, 434 }, + { CPU_Any, 0, 0, 0, 0, 1, {0xFF, 0, 0}, 5, 1, 435 }, + { CPU_Not64, 0, 16, 0, 0, 1, {0xEA, 0, 0}, 3, 1, 436 }, + { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0xEA, 0, 0}, 3, 1, 437 }, + { CPU_Not64, 0, 0, 0, 0, 1, {0xEA, 0, 0}, 3, 1, 438 }, + { CPU_Not64, 0, 16, 0, 0, 1, {0xEA, 0, 0}, 3, 1, 439 }, + { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0xEA, 0, 0}, 3, 1, 440 }, + { CPU_Not64, 0, 0, 0, 0, 1, {0xEA, 0, 0}, 3, 1, 441 } }; static const x86_insn_info retnf_insn[] = { - { CPU_Not64, MOD_Op0Add, 0, 0, 0, 1, {0x01, 0, 0}, 0, 0, {0, 0, 0} }, - { CPU_Not64, MOD_Op0Add, 0, 0, 0, 1, {0x00, 0, 0}, 0, 1, {OPT_Imm|OPS_16|OPS_Relaxed|OPA_Imm, 0, 0} }, - { CPU_64, MOD_Op0Add|MOD_OpSizeR, 0, 0, 0, 1, {0x01, 0, 0}, 0, 0, {0, 0, 0} }, - { CPU_64, MOD_Op0Add|MOD_OpSizeR, 0, 0, 0, 1, {0x00, 0, 0}, 0, 1, {OPT_Imm|OPS_16|OPS_Relaxed|OPA_Imm, 0, 0} }, - { CPU_Any, MOD_Op0Add|MOD_OpSizeR|MOD_GasSufL|MOD_GasSufQ|MOD_GasSufW, 0, 0, 0, 1, {0x01, 0, 0}, 0, 0, {0, 0, 0} }, - { CPU_Any, MOD_Op0Add|MOD_OpSizeR|MOD_GasSufL|MOD_GasSufQ|MOD_GasSufW, 0, 0, 0, 1, {0x00, 0, 0}, 0, 1, {OPT_Imm|OPS_16|OPS_Relaxed|OPA_Imm, 0, 0} } + { CPU_Not64, MOD_Op0Add, 0, 0, 0, 1, {0x01, 0, 0}, 0, 0, 0 }, + { CPU_Not64, MOD_Op0Add, 0, 0, 0, 1, {0x00, 0, 0}, 0, 1, 223 }, + { CPU_64, MOD_Op0Add|MOD_OpSizeR, 0, 0, 0, 1, {0x01, 0, 0}, 0, 0, 0 }, + { CPU_64, MOD_Op0Add|MOD_OpSizeR, 0, 0, 0, 1, {0x00, 0, 0}, 0, 1, 223 }, + { CPU_Any, MOD_Op0Add|MOD_OpSizeR|MOD_GasSufL|MOD_GasSufQ|MOD_GasSufW, 0, 0, 0, 1, {0x01, 0, 0}, 0, 0, 0 }, + { CPU_Any, MOD_Op0Add|MOD_OpSizeR|MOD_GasSufL|MOD_GasSufQ|MOD_GasSufW, 0, 0, 0, 1, {0x00, 0, 0}, 0, 1, 223 } }; static const x86_insn_info enter_insn[] = { - { CPU_186|CPU_Not64, MOD_GasNoRev|MOD_GasSufL, 0, 0, 0, 1, {0xC8, 0, 0}, 0, 2, {OPT_Imm|OPS_16|OPS_Relaxed|OPA_EA|OPAP_A16, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_186|CPU_64, MOD_GasNoRev|MOD_GasSufQ, 64, 64, 0, 1, {0xC8, 0, 0}, 0, 2, {OPT_Imm|OPS_16|OPS_Relaxed|OPA_EA|OPAP_A16, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_186, MOD_GasOnly|MOD_GasNoRev|MOD_GasSufW, 16, 0, 0, 1, {0xC8, 0, 0}, 0, 2, {OPT_Imm|OPS_16|OPS_Relaxed|OPA_EA|OPAP_A16, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} } + { CPU_186|CPU_Not64, MOD_GasNoRev|MOD_GasSufL, 0, 0, 0, 1, {0xC8, 0, 0}, 0, 2, 398 }, + { CPU_186|CPU_64, MOD_GasNoRev|MOD_GasSufQ, 64, 64, 0, 1, {0xC8, 0, 0}, 0, 2, 398 }, + { CPU_186, MOD_GasOnly|MOD_GasNoRev|MOD_GasSufW, 16, 0, 0, 1, {0xC8, 0, 0}, 0, 2, 398 } }; static const x86_insn_info jcc_insn[] = { - { CPU_Any, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 1, {OPT_Imm|OPS_Any|OPA_JmpRel, 0, 0} }, - { CPU_Any, 0, 16, 0, 0, 0, {0, 0, 0}, 0, 1, {OPT_Imm|OPS_16|OPA_JmpRel, 0, 0} }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 0, {0, 0, 0}, 0, 1, {OPT_Imm|OPS_32|OPA_JmpRel, 0, 0} }, - { CPU_64, 0, 64, 0, 0, 0, {0, 0, 0}, 0, 1, {OPT_Imm|OPS_32|OPA_JmpRel, 0, 0} }, - { CPU_Any, MOD_Op0Add, 0, 64, 0, 1, {0x70, 0, 0}, 0, 1, {OPT_Imm|OPS_Any|OPTM_Short|OPA_JmpRel, 0, 0} }, - { CPU_186, MOD_Op1Add, 16, 64, 0, 2, {0x0F, 0x80, 0}, 0, 1, {OPT_Imm|OPS_16|OPTM_Near|OPA_JmpRel, 0, 0} }, - { CPU_386|CPU_Not64, MOD_Op1Add, 32, 0, 0, 2, {0x0F, 0x80, 0}, 0, 1, {OPT_Imm|OPS_32|OPTM_Near|OPA_JmpRel, 0, 0} }, - { CPU_64, MOD_Op1Add, 64, 64, 0, 2, {0x0F, 0x80, 0}, 0, 1, {OPT_Imm|OPS_32|OPTM_Near|OPA_JmpRel, 0, 0} }, - { CPU_186, MOD_Op1Add, 0, 64, 0, 2, {0x0F, 0x80, 0}, 0, 1, {OPT_Imm|OPS_Any|OPTM_Near|OPA_JmpRel, 0, 0} } + { CPU_Any, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 1, 370 }, + { CPU_Any, 0, 16, 0, 0, 0, {0, 0, 0}, 0, 1, 445 }, + { CPU_386|CPU_Not64, 0, 32, 0, 0, 0, {0, 0, 0}, 0, 1, 446 }, + { CPU_64, 0, 64, 0, 0, 0, {0, 0, 0}, 0, 1, 446 }, + { CPU_Any, MOD_Op0Add, 0, 64, 0, 1, {0x70, 0, 0}, 0, 1, 376 }, + { CPU_186, MOD_Op1Add, 16, 64, 0, 2, {0x0F, 0x80, 0}, 0, 1, 425 }, + { CPU_386|CPU_Not64, MOD_Op1Add, 32, 0, 0, 2, {0x0F, 0x80, 0}, 0, 1, 426 }, + { CPU_64, MOD_Op1Add, 64, 64, 0, 2, {0x0F, 0x80, 0}, 0, 1, 426 }, + { CPU_186, MOD_Op1Add, 0, 64, 0, 2, {0x0F, 0x80, 0}, 0, 1, 427 } }; static const x86_insn_info jcxz_insn[] = { - { CPU_Any, MOD_AdSizeR, 0, 0, 0, 0, {0, 0, 0}, 0, 1, {OPT_Imm|OPS_Any|OPA_JmpRel, 0, 0} }, - { CPU_Any, MOD_AdSizeR, 0, 64, 0, 1, {0xE3, 0, 0}, 0, 1, {OPT_Imm|OPS_Any|OPTM_Short|OPA_JmpRel, 0, 0} } + { CPU_Any, MOD_AdSizeR, 0, 0, 0, 0, {0, 0, 0}, 0, 1, 370 }, + { CPU_Any, MOD_AdSizeR, 0, 64, 0, 1, {0xE3, 0, 0}, 0, 1, 376 } }; static const x86_insn_info loop_insn[] = { - { CPU_Any, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 1, {OPT_Imm|OPS_Any|OPA_JmpRel, 0, 0} }, - { CPU_Not64, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 2, {OPT_Imm|OPS_Any|OPA_JmpRel, OPT_Creg|OPS_16|OPA_AdSizeR, 0} }, - { CPU_386, 0, 0, 64, 0, 0, {0, 0, 0}, 0, 2, {OPT_Imm|OPS_Any|OPA_JmpRel, OPT_Creg|OPS_32|OPA_AdSizeR, 0} }, - { CPU_64, 0, 0, 64, 0, 0, {0, 0, 0}, 0, 2, {OPT_Imm|OPS_Any|OPA_JmpRel, OPT_Creg|OPS_64|OPA_AdSizeR, 0} }, - { CPU_Not64, MOD_Op0Add, 0, 0, 0, 1, {0xE0, 0, 0}, 0, 1, {OPT_Imm|OPS_Any|OPTM_Short|OPA_JmpRel, 0, 0} }, - { CPU_Any, MOD_Op0Add, 0, 64, 0, 1, {0xE0, 0, 0}, 0, 2, {OPT_Imm|OPS_Any|OPTM_Short|OPA_JmpRel, OPT_Creg|OPS_16|OPA_AdSizeR, 0} }, - { CPU_386, MOD_Op0Add, 0, 64, 0, 1, {0xE0, 0, 0}, 0, 2, {OPT_Imm|OPS_Any|OPTM_Short|OPA_JmpRel, OPT_Creg|OPS_32|OPA_AdSizeR, 0} }, - { CPU_64, MOD_Op0Add, 0, 64, 0, 1, {0xE0, 0, 0}, 0, 2, {OPT_Imm|OPS_Any|OPTM_Short|OPA_JmpRel, OPT_Creg|OPS_64|OPA_AdSizeR, 0} } + { CPU_Any, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 1, 370 }, + { CPU_Not64, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 2, 370 }, + { CPU_386, 0, 0, 64, 0, 0, {0, 0, 0}, 0, 2, 372 }, + { CPU_64, 0, 0, 64, 0, 0, {0, 0, 0}, 0, 2, 374 }, + { CPU_Not64, MOD_Op0Add, 0, 0, 0, 1, {0xE0, 0, 0}, 0, 1, 376 }, + { CPU_Any, MOD_Op0Add, 0, 64, 0, 1, {0xE0, 0, 0}, 0, 2, 376 }, + { CPU_386, MOD_Op0Add, 0, 64, 0, 1, {0xE0, 0, 0}, 0, 2, 378 }, + { CPU_64, MOD_Op0Add, 0, 64, 0, 1, {0xE0, 0, 0}, 0, 2, 380 } }; static const x86_insn_info setcc_insn[] = { - { CPU_386, MOD_Op1Add|MOD_GasSufB, 0, 0, 0, 2, {0x0F, 0x90, 0}, 2, 1, {OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, 0, 0} } + { CPU_386, MOD_Op1Add|MOD_GasSufB, 0, 0, 0, 2, {0x0F, 0x90, 0}, 2, 1, 140 } }; static const x86_insn_info cmpsd_insn[] = { - { CPU_386, MOD_GasIllegal, 32, 0, 0, 1, {0xA7, 0, 0}, 0, 0, {0, 0, 0} }, - { CPU_SSE2, 0, 0, 0, 0xF2, 2, {0x0F, 0xC2, 0}, 0, 3, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } + { CPU_386, MOD_GasIllegal, 32, 0, 0, 1, {0xA7, 0, 0}, 0, 0, 0 }, + { CPU_SSE2, 0, 0, 0, 0xF2, 2, {0x0F, 0xC2, 0}, 0, 3, 46 } }; static const x86_insn_info movsd_insn[] = { - { CPU_386, MOD_GasIllegal, 32, 0, 0, 1, {0xA5, 0, 0}, 0, 0, {0, 0, 0} }, - { CPU_SSE2, 0, 0, 0, 0xF2, 2, {0x0F, 0x10, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} }, - { CPU_SSE2, 0, 0, 0, 0xF2, 2, {0x0F, 0x10, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0} }, - { CPU_SSE2, 0, 0, 0, 0xF2, 2, {0x0F, 0x11, 0}, 0, 2, {OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} } + { CPU_386, MOD_GasIllegal, 32, 0, 0, 1, {0xA5, 0, 0}, 0, 0, 0 }, + { CPU_SSE2, 0, 0, 0, 0xF2, 2, {0x0F, 0x10, 0}, 0, 2, 0 }, + { CPU_SSE2, 0, 0, 0, 0xF2, 2, {0x0F, 0x10, 0}, 0, 2, 288 }, + { CPU_SSE2, 0, 0, 0, 0xF2, 2, {0x0F, 0x11, 0}, 0, 2, 334 } }; static const x86_insn_info bittest_insn[] = { - { CPU_386, MOD_Op1Add|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_16|OPA_Spare, 0} }, - { CPU_386, MOD_Op1Add|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_32|OPA_Spare, 0} }, - { CPU_386|CPU_64, MOD_Op1Add|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_64|OPA_Spare, 0} }, - { CPU_386, MOD_Gap0|MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0xBA, 0}, 0, 2, {OPT_RM|OPS_16|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_386, MOD_Gap0|MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0xBA, 0}, 0, 2, {OPT_RM|OPS_32|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_386|CPU_64, MOD_Gap0|MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0xBA, 0}, 0, 2, {OPT_RM|OPS_64|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} } + { CPU_386, MOD_Op1Add|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 94 }, + { CPU_386, MOD_Op1Add|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 100 }, + { CPU_386|CPU_64, MOD_Op1Add|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 106 }, + { CPU_386, MOD_Gap0|MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0xBA, 0}, 0, 2, 112 }, + { CPU_386, MOD_Gap0|MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0xBA, 0}, 0, 2, 114 }, + { CPU_386|CPU_64, MOD_Gap0|MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0xBA, 0}, 0, 2, 116 } }; static const x86_insn_info bsfr_insn[] = { - { CPU_386, MOD_Op1Add|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_Reg|OPS_16|OPA_Spare, OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, 0} }, - { CPU_386, MOD_Op1Add|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} }, - { CPU_386|CPU_64, MOD_Op1Add|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} } + { CPU_386, MOD_Op1Add|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 4 }, + { CPU_386, MOD_Op1Add|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 7 }, + { CPU_386|CPU_64, MOD_Op1Add|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 10 } }; static const x86_insn_info int_insn[] = { - { CPU_Any, 0, 0, 0, 0, 1, {0xCD, 0, 0}, 0, 1, {OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0, 0} } + { CPU_Any, 0, 0, 0, 0, 1, {0xCD, 0, 0}, 0, 1, 3 } }; static const x86_insn_info bound_insn[] = { - { CPU_186|CPU_Not64, MOD_GasSufW, 16, 0, 0, 1, {0x62, 0, 0}, 0, 2, {OPT_Reg|OPS_16|OPA_Spare, OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, 0} }, - { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0x62, 0, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, 0} } + { CPU_186|CPU_Not64, MOD_GasSufW, 16, 0, 0, 1, {0x62, 0, 0}, 0, 2, 306 }, + { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0x62, 0, 0}, 0, 2, 176 } }; static const x86_insn_info arpl_insn[] = { - { CPU_286|CPU_Not64|CPU_Prot, MOD_GasSufW, 0, 0, 0, 1, {0x63, 0, 0}, 0, 2, {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_16|OPA_Spare, 0} } + { CPU_286|CPU_Not64|CPU_Prot, MOD_GasSufW, 0, 0, 0, 1, {0x63, 0, 0}, 0, 2, 94 } }; static const x86_insn_info str_insn[] = { - { CPU_286|CPU_Prot, MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x00, 0}, 1, 1, {OPT_Reg|OPS_16|OPA_EA, 0, 0} }, - { CPU_386|CPU_Prot, MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x00, 0}, 1, 1, {OPT_Reg|OPS_32|OPA_EA, 0, 0} }, - { CPU_286|CPU_64|CPU_Prot, MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x00, 0}, 1, 1, {OPT_Reg|OPS_64|OPA_EA, 0, 0} }, - { CPU_286|CPU_Prot, MOD_GasSufL|MOD_GasSufW, 0, 0, 0, 2, {0x0F, 0x00, 0}, 1, 1, {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, 0, 0} } + { CPU_286|CPU_Prot, MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x00, 0}, 1, 1, 212 }, + { CPU_386|CPU_Prot, MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x00, 0}, 1, 1, 23 }, + { CPU_286|CPU_64|CPU_Prot, MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x00, 0}, 1, 1, 26 }, + { CPU_286|CPU_Prot, MOD_GasSufL|MOD_GasSufW, 0, 0, 0, 2, {0x0F, 0x00, 0}, 1, 1, 5 } }; static const x86_insn_info prot286_insn[] = { - { CPU_286, MOD_Op1Add|MOD_SpAdd|MOD_GasSufW, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 1, {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, 0, 0} } + { CPU_286, MOD_Op1Add|MOD_SpAdd|MOD_GasSufW, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 1, 5 } }; static const x86_insn_info sldtmsw_insn[] = { - { CPU_286, MOD_Op1Add|MOD_SpAdd|MOD_GasSufW, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 1, {OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, 0, 0} }, - { CPU_386, MOD_Op1Add|MOD_SpAdd|MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 1, {OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, 0, 0} }, - { CPU_286|CPU_64, MOD_Op1Add|MOD_SpAdd|MOD_GasSufQ, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 1, {OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0, 0} }, - { CPU_286, MOD_Op1Add|MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x00, 0}, 0, 1, {OPT_Reg|OPS_16|OPA_EA, 0, 0} }, - { CPU_386, MOD_Op1Add|MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x00, 0}, 0, 1, {OPT_Reg|OPS_32|OPA_EA, 0, 0} }, - { CPU_286|CPU_64, MOD_Op1Add|MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x00, 0}, 0, 1, {OPT_Reg|OPS_64|OPA_EA, 0, 0} } + { CPU_286, MOD_Op1Add|MOD_SpAdd|MOD_GasSufW, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 1, 29 }, + { CPU_386, MOD_Op1Add|MOD_SpAdd|MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 1, 86 }, + { CPU_286|CPU_64, MOD_Op1Add|MOD_SpAdd|MOD_GasSufQ, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 1, 139 }, + { CPU_286, MOD_Op1Add|MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x00, 0}, 0, 1, 212 }, + { CPU_386, MOD_Op1Add|MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x00, 0}, 0, 1, 23 }, + { CPU_286|CPU_64, MOD_Op1Add|MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x00, 0}, 0, 1, 26 } }; static const x86_insn_info fld_insn[] = { - { CPU_FPU, MOD_GasSufS, 0, 0, 0, 1, {0xD9, 0, 0}, 0, 1, {OPT_Mem|OPS_32|OPA_EA, 0, 0} }, - { CPU_FPU, MOD_GasSufL, 0, 0, 0, 1, {0xDD, 0, 0}, 0, 1, {OPT_Mem|OPS_64|OPA_EA, 0, 0} }, - { CPU_FPU, 0, 0, 0, 0, 1, {0xDB, 0, 0}, 5, 1, {OPT_Mem|OPS_80|OPA_EA, 0, 0} }, - { CPU_FPU, 0, 0, 0, 0, 2, {0xD9, 0xC0, 0}, 0, 1, {OPT_Reg|OPS_80|OPA_Op1Add, 0, 0} } + { CPU_FPU, MOD_GasSufS, 0, 0, 0, 1, {0xD9, 0, 0}, 0, 1, 404 }, + { CPU_FPU, MOD_GasSufL, 0, 0, 0, 1, {0xDD, 0, 0}, 0, 1, 405 }, + { CPU_FPU, 0, 0, 0, 0, 1, {0xDB, 0, 0}, 5, 1, 402 }, + { CPU_FPU, 0, 0, 0, 0, 2, {0xD9, 0xC0, 0}, 0, 1, 145 } }; static const x86_insn_info fstp_insn[] = { - { CPU_FPU, MOD_GasSufS, 0, 0, 0, 1, {0xD9, 0, 0}, 3, 1, {OPT_Mem|OPS_32|OPA_EA, 0, 0} }, - { CPU_FPU, MOD_GasSufL, 0, 0, 0, 1, {0xDD, 0, 0}, 3, 1, {OPT_Mem|OPS_64|OPA_EA, 0, 0} }, - { CPU_FPU, 0, 0, 0, 0, 1, {0xDB, 0, 0}, 7, 1, {OPT_Mem|OPS_80|OPA_EA, 0, 0} }, - { CPU_FPU, 0, 0, 0, 0, 2, {0xDD, 0xD8, 0}, 0, 1, {OPT_Reg|OPS_80|OPA_Op1Add, 0, 0} } + { CPU_FPU, MOD_GasSufS, 0, 0, 0, 1, {0xD9, 0, 0}, 3, 1, 404 }, + { CPU_FPU, MOD_GasSufL, 0, 0, 0, 1, {0xDD, 0, 0}, 3, 1, 405 }, + { CPU_FPU, 0, 0, 0, 0, 1, {0xDB, 0, 0}, 7, 1, 402 }, + { CPU_FPU, 0, 0, 0, 0, 2, {0xDD, 0xD8, 0}, 0, 1, 145 } }; static const x86_insn_info fldstpt_insn[] = { - { CPU_FPU, MOD_SpAdd, 0, 0, 0, 1, {0xDB, 0, 0}, 0, 1, {OPT_Mem|OPS_80|OPA_EA, 0, 0} } + { CPU_FPU, MOD_SpAdd, 0, 0, 0, 1, {0xDB, 0, 0}, 0, 1, 402 } }; static const x86_insn_info fildstp_insn[] = { - { CPU_FPU, MOD_SpAdd|MOD_GasSufS, 0, 0, 0, 1, {0xDF, 0, 0}, 0, 1, {OPT_Mem|OPS_16|OPA_EA, 0, 0} }, - { CPU_FPU, MOD_SpAdd|MOD_GasSufL, 0, 0, 0, 1, {0xDB, 0, 0}, 0, 1, {OPT_Mem|OPS_32|OPA_EA, 0, 0} }, - { CPU_FPU, MOD_Gap0|MOD_Op0Add|MOD_SpAdd|MOD_GasSufQ, 0, 0, 0, 1, {0xDD, 0, 0}, 0, 1, {OPT_Mem|OPS_64|OPA_EA, 0, 0} } + { CPU_FPU, MOD_SpAdd|MOD_GasSufS, 0, 0, 0, 1, {0xDF, 0, 0}, 0, 1, 403 }, + { CPU_FPU, MOD_SpAdd|MOD_GasSufL, 0, 0, 0, 1, {0xDB, 0, 0}, 0, 1, 404 }, + { CPU_FPU, MOD_Gap0|MOD_Op0Add|MOD_SpAdd|MOD_GasSufQ, 0, 0, 0, 1, {0xDD, 0, 0}, 0, 1, 405 } }; static const x86_insn_info fbldstp_insn[] = { - { CPU_FPU, MOD_SpAdd, 0, 0, 0, 1, {0xDF, 0, 0}, 0, 1, {OPT_Mem|OPS_80|OPS_Relaxed|OPA_EA, 0, 0} } + { CPU_FPU, MOD_SpAdd, 0, 0, 0, 1, {0xDF, 0, 0}, 0, 1, 311 } }; static const x86_insn_info fst_insn[] = { - { CPU_FPU, MOD_GasSufS, 0, 0, 0, 1, {0xD9, 0, 0}, 2, 1, {OPT_Mem|OPS_32|OPA_EA, 0, 0} }, - { CPU_FPU, MOD_GasSufL, 0, 0, 0, 1, {0xDD, 0, 0}, 2, 1, {OPT_Mem|OPS_64|OPA_EA, 0, 0} }, - { CPU_FPU, 0, 0, 0, 0, 2, {0xDD, 0xD0, 0}, 0, 1, {OPT_Reg|OPS_80|OPA_Op1Add, 0, 0} } + { CPU_FPU, MOD_GasSufS, 0, 0, 0, 1, {0xD9, 0, 0}, 2, 1, 404 }, + { CPU_FPU, MOD_GasSufL, 0, 0, 0, 1, {0xDD, 0, 0}, 2, 1, 405 }, + { CPU_FPU, 0, 0, 0, 0, 2, {0xDD, 0xD0, 0}, 0, 1, 145 } }; static const x86_insn_info fxch_insn[] = { - { CPU_FPU, 0, 0, 0, 0, 2, {0xD9, 0xC8, 0}, 0, 1, {OPT_Reg|OPS_80|OPA_Op1Add, 0, 0} }, - { CPU_FPU, 0, 0, 0, 0, 2, {0xD9, 0xC8, 0}, 0, 2, {OPT_ST0|OPS_80|OPA_None, OPT_Reg|OPS_80|OPA_Op1Add, 0} }, - { CPU_FPU, 0, 0, 0, 0, 2, {0xD9, 0xC8, 0}, 0, 2, {OPT_Reg|OPS_80|OPA_Op1Add, OPT_ST0|OPS_80|OPA_None, 0} }, - { CPU_FPU, 0, 0, 0, 0, 2, {0xD9, 0xC9, 0}, 0, 0, {0, 0, 0} } + { CPU_FPU, 0, 0, 0, 0, 2, {0xD9, 0xC8, 0}, 0, 1, 145 }, + { CPU_FPU, 0, 0, 0, 0, 2, {0xD9, 0xC8, 0}, 0, 2, 144 }, + { CPU_FPU, 0, 0, 0, 0, 2, {0xD9, 0xC8, 0}, 0, 2, 146 }, + { CPU_FPU, 0, 0, 0, 0, 2, {0xD9, 0xC9, 0}, 0, 0, 0 } }; static const x86_insn_info fcom_insn[] = { - { CPU_FPU, MOD_Gap0|MOD_SpAdd|MOD_GasSufS, 0, 0, 0, 1, {0xD8, 0, 0}, 0, 1, {OPT_Mem|OPS_32|OPA_EA, 0, 0} }, - { CPU_FPU, MOD_Gap0|MOD_SpAdd|MOD_GasSufL, 0, 0, 0, 1, {0xDC, 0, 0}, 0, 1, {OPT_Mem|OPS_64|OPA_EA, 0, 0} }, - { CPU_FPU, MOD_Op1Add, 0, 0, 0, 2, {0xD8, 0x00, 0}, 0, 1, {OPT_Reg|OPS_80|OPA_Op1Add, 0, 0} }, - { CPU_FPU, MOD_Op1Add|MOD_GasOnly, 0, 0, 0, 2, {0xD8, 0x01, 0}, 0, 0, {0, 0, 0} }, - { CPU_FPU, MOD_Op1Add|MOD_GasIllegal, 0, 0, 0, 2, {0xD8, 0x00, 0}, 0, 2, {OPT_ST0|OPS_80|OPA_None, OPT_Reg|OPS_80|OPA_Op1Add, 0} } + { CPU_FPU, MOD_Gap0|MOD_SpAdd|MOD_GasSufS, 0, 0, 0, 1, {0xD8, 0, 0}, 0, 1, 404 }, + { CPU_FPU, MOD_Gap0|MOD_SpAdd|MOD_GasSufL, 0, 0, 0, 1, {0xDC, 0, 0}, 0, 1, 405 }, + { CPU_FPU, MOD_Op1Add, 0, 0, 0, 2, {0xD8, 0x00, 0}, 0, 1, 145 }, + { CPU_FPU, MOD_Op1Add|MOD_GasOnly, 0, 0, 0, 2, {0xD8, 0x01, 0}, 0, 0, 0 }, + { CPU_FPU, MOD_Op1Add|MOD_GasIllegal, 0, 0, 0, 2, {0xD8, 0x00, 0}, 0, 2, 144 } }; static const x86_insn_info fcom2_insn[] = { - { CPU_286|CPU_FPU, MOD_Op1Add|MOD_Op0Add, 0, 0, 0, 2, {0x00, 0x00, 0}, 0, 1, {OPT_Reg|OPS_80|OPA_Op1Add, 0, 0} }, - { CPU_286|CPU_FPU, MOD_Op1Add|MOD_Op0Add, 0, 0, 0, 2, {0x00, 0x00, 0}, 0, 2, {OPT_ST0|OPS_80|OPA_None, OPT_Reg|OPS_80|OPA_Op1Add, 0} } + { CPU_286|CPU_FPU, MOD_Op1Add|MOD_Op0Add, 0, 0, 0, 2, {0x00, 0x00, 0}, 0, 1, 145 }, + { CPU_286|CPU_FPU, MOD_Op1Add|MOD_Op0Add, 0, 0, 0, 2, {0x00, 0x00, 0}, 0, 2, 144 } }; static const x86_insn_info farith_insn[] = { - { CPU_FPU, MOD_Gap0|MOD_Gap1|MOD_SpAdd|MOD_GasSufS, 0, 0, 0, 1, {0xD8, 0, 0}, 0, 1, {OPT_Mem|OPS_32|OPA_EA, 0, 0} }, - { CPU_FPU, MOD_Gap0|MOD_Gap1|MOD_SpAdd|MOD_GasSufL, 0, 0, 0, 1, {0xDC, 0, 0}, 0, 1, {OPT_Mem|OPS_64|OPA_EA, 0, 0} }, - { CPU_FPU, MOD_Gap0|MOD_Op1Add, 0, 0, 0, 2, {0xD8, 0x00, 0}, 0, 1, {OPT_Reg|OPS_80|OPA_Op1Add, 0, 0} }, - { CPU_FPU, MOD_Gap0|MOD_Op1Add, 0, 0, 0, 2, {0xD8, 0x00, 0}, 0, 2, {OPT_ST0|OPS_80|OPA_None, OPT_Reg|OPS_80|OPA_Op1Add, 0} }, - { CPU_FPU, MOD_Op1Add, 0, 0, 0, 2, {0xDC, 0x00, 0}, 0, 1, {OPT_Reg|OPS_80|OPTM_To|OPA_Op1Add, 0, 0} }, - { CPU_FPU, MOD_Op1Add|MOD_GasIllegal, 0, 0, 0, 2, {0xDC, 0x00, 0}, 0, 2, {OPT_Reg|OPS_80|OPA_Op1Add, OPT_ST0|OPS_80|OPA_None, 0} }, - { CPU_FPU, MOD_Gap0|MOD_Op1Add|MOD_GasOnly, 0, 0, 0, 2, {0xDC, 0x00, 0}, 0, 2, {OPT_Reg|OPS_80|OPA_Op1Add, OPT_ST0|OPS_80|OPA_None, 0} } + { CPU_FPU, MOD_Gap0|MOD_Gap1|MOD_SpAdd|MOD_GasSufS, 0, 0, 0, 1, {0xD8, 0, 0}, 0, 1, 404 }, + { CPU_FPU, MOD_Gap0|MOD_Gap1|MOD_SpAdd|MOD_GasSufL, 0, 0, 0, 1, {0xDC, 0, 0}, 0, 1, 405 }, + { CPU_FPU, MOD_Gap0|MOD_Op1Add, 0, 0, 0, 2, {0xD8, 0x00, 0}, 0, 1, 145 }, + { CPU_FPU, MOD_Gap0|MOD_Op1Add, 0, 0, 0, 2, {0xD8, 0x00, 0}, 0, 2, 144 }, + { CPU_FPU, MOD_Op1Add, 0, 0, 0, 2, {0xDC, 0x00, 0}, 0, 1, 442 }, + { CPU_FPU, MOD_Op1Add|MOD_GasIllegal, 0, 0, 0, 2, {0xDC, 0x00, 0}, 0, 2, 146 }, + { CPU_FPU, MOD_Gap0|MOD_Op1Add|MOD_GasOnly, 0, 0, 0, 2, {0xDC, 0x00, 0}, 0, 2, 146 } }; static const x86_insn_info farithp_insn[] = { - { CPU_FPU, MOD_Op1Add, 0, 0, 0, 2, {0xDE, 0x01, 0}, 0, 0, {0, 0, 0} }, - { CPU_FPU, MOD_Op1Add, 0, 0, 0, 2, {0xDE, 0x00, 0}, 0, 1, {OPT_Reg|OPS_80|OPA_Op1Add, 0, 0} }, - { CPU_FPU, MOD_Op1Add, 0, 0, 0, 2, {0xDE, 0x00, 0}, 0, 2, {OPT_Reg|OPS_80|OPA_Op1Add, OPT_ST0|OPS_80|OPA_None, 0} } + { CPU_FPU, MOD_Op1Add, 0, 0, 0, 2, {0xDE, 0x01, 0}, 0, 0, 0 }, + { CPU_FPU, MOD_Op1Add, 0, 0, 0, 2, {0xDE, 0x00, 0}, 0, 1, 145 }, + { CPU_FPU, MOD_Op1Add, 0, 0, 0, 2, {0xDE, 0x00, 0}, 0, 2, 146 } }; static const x86_insn_info fiarith_insn[] = { - { CPU_FPU, MOD_Op0Add|MOD_SpAdd|MOD_GasSufS, 0, 0, 0, 1, {0x04, 0, 0}, 0, 1, {OPT_Mem|OPS_16|OPA_EA, 0, 0} }, - { CPU_FPU, MOD_Op0Add|MOD_SpAdd|MOD_GasSufL, 0, 0, 0, 1, {0x00, 0, 0}, 0, 1, {OPT_Mem|OPS_32|OPA_EA, 0, 0} } + { CPU_FPU, MOD_Op0Add|MOD_SpAdd|MOD_GasSufS, 0, 0, 0, 1, {0x04, 0, 0}, 0, 1, 403 }, + { CPU_FPU, MOD_Op0Add|MOD_SpAdd|MOD_GasSufL, 0, 0, 0, 1, {0x00, 0, 0}, 0, 1, 404 } }; static const x86_insn_info fldnstcw_insn[] = { - { CPU_FPU, MOD_SpAdd|MOD_GasSufW, 0, 0, 0, 1, {0xD9, 0, 0}, 0, 1, {OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, 0, 0} } + { CPU_FPU, MOD_SpAdd|MOD_GasSufW, 0, 0, 0, 1, {0xD9, 0, 0}, 0, 1, 29 } }; static const x86_insn_info fstcw_insn[] = { - { CPU_FPU, MOD_GasSufW, 0, 0, 0, 2, {0x9B, 0xD9, 0}, 7, 1, {OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, 0, 0} } + { CPU_FPU, MOD_GasSufW, 0, 0, 0, 2, {0x9B, 0xD9, 0}, 7, 1, 29 } }; static const x86_insn_info fnstsw_insn[] = { - { CPU_FPU, MOD_GasSufW, 0, 0, 0, 1, {0xDD, 0, 0}, 7, 1, {OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, 0, 0} }, - { CPU_FPU, MOD_GasSufW, 0, 0, 0, 2, {0xDF, 0xE0, 0}, 0, 1, {OPT_Areg|OPS_16|OPA_None, 0, 0} } + { CPU_FPU, MOD_GasSufW, 0, 0, 0, 1, {0xDD, 0, 0}, 7, 1, 29 }, + { CPU_FPU, MOD_GasSufW, 0, 0, 0, 2, {0xDF, 0xE0, 0}, 0, 1, 160 } }; static const x86_insn_info fstsw_insn[] = { - { CPU_FPU, MOD_GasSufW, 0, 0, 0, 2, {0x9B, 0xDD, 0}, 7, 1, {OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, 0, 0} }, - { CPU_FPU, MOD_GasSufW, 0, 0, 0, 3, {0x9B, 0xDF, 0xE0}, 0, 1, {OPT_Areg|OPS_16|OPA_None, 0, 0} } + { CPU_FPU, MOD_GasSufW, 0, 0, 0, 2, {0x9B, 0xDD, 0}, 7, 1, 29 }, + { CPU_FPU, MOD_GasSufW, 0, 0, 0, 3, {0x9B, 0xDF, 0xE0}, 0, 1, 160 } }; static const x86_insn_info ffree_insn[] = { - { CPU_FPU, MOD_Op0Add, 0, 0, 0, 2, {0x00, 0xC0, 0}, 0, 1, {OPT_Reg|OPS_80|OPA_Op1Add, 0, 0} } + { CPU_FPU, MOD_Op0Add, 0, 0, 0, 2, {0x00, 0xC0, 0}, 0, 1, 145 } }; static const x86_insn_info bswap_insn[] = { - { CPU_486, MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0xC8, 0}, 0, 1, {OPT_Reg|OPS_32|OPA_Op1Add, 0, 0} }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0xC8, 0}, 0, 1, {OPT_Reg|OPS_64|OPA_Op1Add, 0, 0} } + { CPU_486, MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0xC8, 0}, 0, 1, 443 }, + { CPU_64, MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0xC8, 0}, 0, 1, 444 } }; static const x86_insn_info cmpxchgxadd_insn[] = { - { CPU_486, MOD_Op1Add|MOD_GasSufB, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_8|OPA_Spare, 0} }, - { CPU_486, MOD_Op1Add|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x01, 0}, 0, 2, {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_16|OPA_Spare, 0} }, - { CPU_486, MOD_Op1Add|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x01, 0}, 0, 2, {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_32|OPA_Spare, 0} }, - { CPU_486|CPU_64, MOD_Op1Add|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x01, 0}, 0, 2, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_64|OPA_Spare, 0} } + { CPU_486, MOD_Op1Add|MOD_GasSufB, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 140 }, + { CPU_486, MOD_Op1Add|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x01, 0}, 0, 2, 94 }, + { CPU_486, MOD_Op1Add|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x01, 0}, 0, 2, 100 }, + { CPU_486|CPU_64, MOD_Op1Add|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x01, 0}, 0, 2, 106 } }; static const x86_insn_info cmpxchg8b_insn[] = { - { CPU_586, MOD_GasSufQ, 0, 0, 0, 2, {0x0F, 0xC7, 0}, 1, 1, {OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0, 0} } + { CPU_586, MOD_GasSufQ, 0, 0, 0, 2, {0x0F, 0xC7, 0}, 1, 1, 139 } }; static const x86_insn_info cmovcc_insn[] = { - { CPU_686, MOD_Op1Add|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x40, 0}, 0, 2, {OPT_Reg|OPS_16|OPA_Spare, OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, 0} }, - { CPU_686, MOD_Op1Add|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x40, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} }, - { CPU_64|CPU_686, MOD_Op1Add|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x40, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} } + { CPU_686, MOD_Op1Add|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x40, 0}, 0, 2, 4 }, + { CPU_686, MOD_Op1Add|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x40, 0}, 0, 2, 7 }, + { CPU_64|CPU_686, MOD_Op1Add|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x40, 0}, 0, 2, 10 } }; static const x86_insn_info fcmovcc_insn[] = { - { CPU_686|CPU_FPU, MOD_Op1Add|MOD_Op0Add, 0, 0, 0, 2, {0x00, 0x00, 0}, 0, 2, {OPT_ST0|OPS_80|OPA_None, OPT_Reg|OPS_80|OPA_Op1Add, 0} } + { CPU_686|CPU_FPU, MOD_Op1Add|MOD_Op0Add, 0, 0, 0, 2, {0x00, 0x00, 0}, 0, 2, 144 } }; static const x86_insn_info movnti_insn[] = { - { CPU_P4, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0xC3, 0}, 0, 2, {OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_32|OPA_Spare, 0} }, - { CPU_64|CPU_P4, MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0xC3, 0}, 0, 2, {OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_64|OPA_Spare, 0} } + { CPU_P4, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0xC3, 0}, 0, 2, 154 }, + { CPU_64|CPU_P4, MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0xC3, 0}, 0, 2, 156 } }; static const x86_insn_info clflush_insn[] = { - { CPU_P3, 0, 0, 0, 0, 2, {0x0F, 0xAE, 0}, 7, 1, {OPT_Mem|OPS_8|OPS_Relaxed|OPA_EA, 0, 0} } + { CPU_P3, 0, 0, 0, 0, 2, {0x0F, 0xAE, 0}, 7, 1, 44 } }; static const x86_insn_info movd_insn[] = { - { CPU_386|CPU_MMX, 0, 0, 0, 0, 2, {0x0F, 0x6E, 0}, 0, 2, {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} }, - { CPU_64|CPU_MMX, 0, 64, 0, 0, 2, {0x0F, 0x6E, 0}, 0, 2, {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} }, - { CPU_386|CPU_MMX, 0, 0, 0, 0, 2, {0x0F, 0x7E, 0}, 0, 2, {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_64|OPA_Spare, 0} }, - { CPU_64|CPU_MMX, 0, 64, 0, 0, 2, {0x0F, 0x7E, 0}, 0, 2, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_64|OPA_Spare, 0} }, - { CPU_386|CPU_SSE2, 0, 0, 0, 0x66, 2, {0x0F, 0x6E, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} }, - { CPU_64|CPU_SSE2, 0, 64, 0, 0x66, 2, {0x0F, 0x6E, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} }, - { CPU_386|CPU_SSE2, 0, 0, 0, 0x66, 2, {0x0F, 0x7E, 0}, 0, 2, {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} }, - { CPU_64|CPU_SSE2, 0, 64, 0, 0x66, 2, {0x0F, 0x7E, 0}, 0, 2, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} } + { CPU_386|CPU_MMX, 0, 0, 0, 0, 2, {0x0F, 0x6E, 0}, 0, 2, 118 }, + { CPU_64|CPU_MMX, 0, 64, 0, 0, 2, {0x0F, 0x6E, 0}, 0, 2, 120 }, + { CPU_386|CPU_MMX, 0, 0, 0, 0, 2, {0x0F, 0x7E, 0}, 0, 2, 119 }, + { CPU_64|CPU_MMX, 0, 64, 0, 0, 2, {0x0F, 0x7E, 0}, 0, 2, 122 }, + { CPU_386|CPU_SSE2, 0, 0, 0, 0x66, 2, {0x0F, 0x6E, 0}, 0, 2, 40 }, + { CPU_64|CPU_SSE2, 0, 64, 0, 0x66, 2, {0x0F, 0x6E, 0}, 0, 2, 91 }, + { CPU_386|CPU_SSE2, 0, 0, 0, 0x66, 2, {0x0F, 0x7E, 0}, 0, 2, 73 }, + { CPU_64|CPU_SSE2, 0, 64, 0, 0x66, 2, {0x0F, 0x7E, 0}, 0, 2, 70 } }; static const x86_insn_info movq_insn[] = { - { CPU_MMX, MOD_GasIllegal, 0, 0, 0, 2, {0x0F, 0x6F, 0}, 0, 2, {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, 0} }, - { CPU_64|CPU_MMX, MOD_GasIllegal, 64, 0, 0, 2, {0x0F, 0x6E, 0}, 0, 2, {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} }, - { CPU_MMX, MOD_GasIllegal, 0, 0, 0, 2, {0x0F, 0x7F, 0}, 0, 2, {OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_64|OPA_Spare, 0} }, - { CPU_64|CPU_MMX, MOD_GasIllegal, 64, 0, 0, 2, {0x0F, 0x7E, 0}, 0, 2, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_64|OPA_Spare, 0} }, - { CPU_SSE2, MOD_GasIllegal, 0, 0, 0xF3, 2, {0x0F, 0x7E, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} }, - { CPU_SSE2, MOD_GasIllegal, 0, 0, 0xF3, 2, {0x0F, 0x7E, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, 0} }, - { CPU_64|CPU_SSE2, MOD_GasIllegal, 64, 0, 0x66, 2, {0x0F, 0x6E, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} }, - { CPU_SSE2, MOD_GasIllegal, 0, 0, 0x66, 2, {0x0F, 0xD6, 0}, 0, 2, {OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} }, - { CPU_64|CPU_SSE2, MOD_GasIllegal, 64, 0, 0x66, 2, {0x0F, 0x7E, 0}, 0, 2, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} } + { CPU_MMX, MOD_GasIllegal, 0, 0, 0, 2, {0x0F, 0x6F, 0}, 0, 2, 82 }, + { CPU_64|CPU_MMX, MOD_GasIllegal, 64, 0, 0, 2, {0x0F, 0x6E, 0}, 0, 2, 120 }, + { CPU_MMX, MOD_GasIllegal, 0, 0, 0, 2, {0x0F, 0x7F, 0}, 0, 2, 148 }, + { CPU_64|CPU_MMX, MOD_GasIllegal, 64, 0, 0, 2, {0x0F, 0x7E, 0}, 0, 2, 122 }, + { CPU_SSE2, MOD_GasIllegal, 0, 0, 0xF3, 2, {0x0F, 0x7E, 0}, 0, 2, 0 }, + { CPU_SSE2, MOD_GasIllegal, 0, 0, 0xF3, 2, {0x0F, 0x7E, 0}, 0, 2, 150 }, + { CPU_64|CPU_SSE2, MOD_GasIllegal, 64, 0, 0x66, 2, {0x0F, 0x6E, 0}, 0, 2, 91 }, + { CPU_SSE2, MOD_GasIllegal, 0, 0, 0x66, 2, {0x0F, 0xD6, 0}, 0, 2, 152 }, + { CPU_64|CPU_SSE2, MOD_GasIllegal, 64, 0, 0x66, 2, {0x0F, 0x7E, 0}, 0, 2, 70 } }; static const x86_insn_info mmxsse2_insn[] = { - { CPU_MMX, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, 0} }, - { CPU_SSE2, MOD_Op1Add, 0, 0, 0x66, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, 0} } + { CPU_MMX, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 82 }, + { CPU_SSE2, MOD_Op1Add, 0, 0, 0x66, 2, {0x0F, 0x00, 0}, 0, 2, 46 } }; static const x86_insn_info pshift_insn[] = { - { CPU_MMX, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, 0} }, - { CPU_MMX, MOD_Gap0|MOD_Op1Add|MOD_SpAdd, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_64|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} }, - { CPU_SSE2, MOD_Op1Add, 0, 0, 0x66, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, 0} }, - { CPU_SSE2, MOD_Gap0|MOD_Op1Add|MOD_SpAdd, 0, 0, 0x66, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} } + { CPU_MMX, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 82 }, + { CPU_MMX, MOD_Gap0|MOD_Op1Add|MOD_SpAdd, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 50 }, + { CPU_SSE2, MOD_Op1Add, 0, 0, 0x66, 2, {0x0F, 0x00, 0}, 0, 2, 46 }, + { CPU_SSE2, MOD_Gap0|MOD_Op1Add|MOD_SpAdd, 0, 0, 0x66, 2, {0x0F, 0x00, 0}, 0, 2, 53 } }; static const x86_insn_info sseps_insn[] = { - { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, 0} } + { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 46 } }; static const x86_insn_info cvt_rx_xmm32_insn[] = { - { CPU_386|CPU_SSE, MOD_Op1Add|MOD_PreAdd|MOD_GasSufL, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} }, - { CPU_386|CPU_SSE, MOD_Op1Add|MOD_PreAdd|MOD_GasSufL, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, 0} }, - { CPU_64|CPU_SSE, MOD_Op1Add|MOD_PreAdd|MOD_GasSufQ, 64, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} }, - { CPU_64|CPU_SSE, MOD_Op1Add|MOD_PreAdd|MOD_GasSufQ, 64, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, 0} } + { CPU_386|CPU_SSE, MOD_Op1Add|MOD_PreAdd|MOD_GasSufL, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, 52 }, + { CPU_386|CPU_SSE, MOD_Op1Add|MOD_PreAdd|MOD_GasSufL, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, 176 }, + { CPU_64|CPU_SSE, MOD_Op1Add|MOD_PreAdd|MOD_GasSufQ, 64, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, 58 }, + { CPU_64|CPU_SSE, MOD_Op1Add|MOD_PreAdd|MOD_GasSufQ, 64, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, 178 } }; static const x86_insn_info cvt_mm_xmm64_insn[] = { - { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} }, - { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0} } + { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 136 }, + { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 138 } }; static const x86_insn_info cvt_xmm_mm_ps_insn[] = { - { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, 0} } + { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 150 } }; static const x86_insn_info cvt_xmm_rmx_insn[] = { - { CPU_386|CPU_SSE, MOD_Op1Add|MOD_PreAdd|MOD_GasSufL, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} }, - { CPU_64|CPU_SSE, MOD_Op1Add|MOD_PreAdd|MOD_GasSufQ, 64, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} } + { CPU_386|CPU_SSE, MOD_Op1Add|MOD_PreAdd|MOD_GasSufL, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, 40 }, + { CPU_64|CPU_SSE, MOD_Op1Add|MOD_PreAdd|MOD_GasSufQ, 64, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, 91 } }; static const x86_insn_info ssess_insn[] = { - { CPU_SSE, MOD_Op1Add|MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, 0} } + { CPU_SSE, MOD_Op1Add|MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, 46 } }; static const x86_insn_info ssecmpps_insn[] = { - { CPU_SSE, MOD_Imm8, 0, 0, 0, 2, {0x0F, 0xC2, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, 0} } + { CPU_SSE, MOD_Imm8, 0, 0, 0, 2, {0x0F, 0xC2, 0}, 0, 2, 46 } }; static const x86_insn_info ssecmpss_insn[] = { - { CPU_SSE, MOD_PreAdd|MOD_Imm8, 0, 0, 0x00, 2, {0x0F, 0xC2, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, 0} } + { CPU_SSE, MOD_PreAdd|MOD_Imm8, 0, 0, 0x00, 2, {0x0F, 0xC2, 0}, 0, 2, 46 } }; static const x86_insn_info ssepsimm_insn[] = { - { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 3, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } + { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 3, 46 } }; static const x86_insn_info ssessimm_insn[] = { - { CPU_SSE, MOD_Op1Add|MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 3, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } + { CPU_SSE, MOD_Op1Add|MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 3, 46 } }; static const x86_insn_info ldstmxcsr_insn[] = { - { CPU_SSE, MOD_SpAdd, 0, 0, 0, 2, {0x0F, 0xAE, 0}, 0, 1, {OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, 0, 0} } + { CPU_SSE, MOD_SpAdd, 0, 0, 0, 2, {0x0F, 0xAE, 0}, 0, 1, 86 } }; static const x86_insn_info maskmovq_insn[] = { - { CPU_MMX|CPU_P3, 0, 0, 0, 0, 2, {0x0F, 0xF7, 0}, 0, 2, {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_SIMDReg|OPS_64|OPA_EA, 0} } + { CPU_MMX|CPU_P3, 0, 0, 0, 0, 2, {0x0F, 0xF7, 0}, 0, 2, 396 } }; static const x86_insn_info movaups_insn[] = { - { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, 0} }, - { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x01, 0}, 0, 2, {OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} } + { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 46 }, + { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x01, 0}, 0, 2, 264 } }; static const x86_insn_info movhllhps_insn[] = { - { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} } + { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 0 } }; static const x86_insn_info movhlps_insn[] = { - { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0} }, - { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x01, 0}, 0, 2, {OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} } + { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 288 }, + { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x01, 0}, 0, 2, 334 } }; static const x86_insn_info movmskps_insn[] = { - { CPU_386|CPU_SSE, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0x50, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} }, - { CPU_64|CPU_SSE, MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x50, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} } + { CPU_386|CPU_SSE, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0x50, 0}, 0, 2, 52 }, + { CPU_64|CPU_SSE, MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x50, 0}, 0, 2, 58 } }; static const x86_insn_info movntps_insn[] = { - { CPU_SSE, 0, 0, 0, 0, 2, {0x0F, 0x2B, 0}, 0, 2, {OPT_Mem|OPS_128|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} } + { CPU_SSE, 0, 0, 0, 0, 2, {0x0F, 0x2B, 0}, 0, 2, 274 } }; static const x86_insn_info movntq_insn[] = { - { CPU_SSE, 0, 0, 0, 0, 2, {0x0F, 0xE7, 0}, 0, 2, {OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_64|OPA_Spare, 0} } + { CPU_SSE, 0, 0, 0, 0, 2, {0x0F, 0xE7, 0}, 0, 2, 180 } }; static const x86_insn_info movss_insn[] = { - { CPU_SSE, 0, 0, 0, 0xF3, 2, {0x0F, 0x10, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} }, - { CPU_SSE, 0, 0, 0, 0xF3, 2, {0x0F, 0x10, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, 0} }, - { CPU_SSE, 0, 0, 0, 0xF3, 2, {0x0F, 0x11, 0}, 0, 2, {OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} } + { CPU_SSE, 0, 0, 0, 0xF3, 2, {0x0F, 0x10, 0}, 0, 2, 0 }, + { CPU_SSE, 0, 0, 0, 0xF3, 2, {0x0F, 0x10, 0}, 0, 2, 85 }, + { CPU_SSE, 0, 0, 0, 0xF3, 2, {0x0F, 0x11, 0}, 0, 2, 364 } }; static const x86_insn_info pextrw_insn[] = { - { CPU_MMX|CPU_P3, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0xC5, 0}, 0, 3, {OPT_Reg|OPS_32|OPA_Spare, OPT_SIMDReg|OPS_64|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, - { CPU_386|CPU_SSE2, MOD_GasSufL, 0, 0, 0x66, 2, {0x0F, 0xC5, 0}, 0, 3, {OPT_Reg|OPS_32|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, - { CPU_64|CPU_MMX|CPU_P3, MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0xC5, 0}, 0, 3, {OPT_Reg|OPS_64|OPA_Spare, OPT_SIMDReg|OPS_64|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, - { CPU_64|CPU_SSE2, MOD_GasSufQ, 64, 0, 0x66, 2, {0x0F, 0xC5, 0}, 0, 3, {OPT_Reg|OPS_64|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, - { CPU_SSE41, 0, 0, 0, 0x66, 3, {0x0F, 0x3A, 0x15}, 0, 3, {OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, - { CPU_386|CPU_SSE41, 0, 32, 0, 0x66, 3, {0x0F, 0x3A, 0x15}, 0, 3, {OPT_Reg|OPS_32|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, - { CPU_64|CPU_SSE41, 0, 64, 0, 0x66, 3, {0x0F, 0x3A, 0x15}, 0, 3, {OPT_Reg|OPS_64|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } + { CPU_MMX|CPU_P3, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0xC5, 0}, 0, 3, 49 }, + { CPU_386|CPU_SSE2, MOD_GasSufL, 0, 0, 0x66, 2, {0x0F, 0xC5, 0}, 0, 3, 52 }, + { CPU_64|CPU_MMX|CPU_P3, MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0xC5, 0}, 0, 3, 55 }, + { CPU_64|CPU_SSE2, MOD_GasSufQ, 64, 0, 0x66, 2, {0x0F, 0xC5, 0}, 0, 3, 58 }, + { CPU_SSE41, 0, 0, 0, 0x66, 3, {0x0F, 0x3A, 0x15}, 0, 3, 61 }, + { CPU_386|CPU_SSE41, 0, 32, 0, 0x66, 3, {0x0F, 0x3A, 0x15}, 0, 3, 64 }, + { CPU_64|CPU_SSE41, 0, 64, 0, 0x66, 3, {0x0F, 0x3A, 0x15}, 0, 3, 67 } }; static const x86_insn_info pinsrw_insn[] = { - { CPU_MMX|CPU_P3, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0xC4, 0}, 0, 3, {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_Reg|OPS_32|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, - { CPU_64|CPU_MMX|CPU_P3, MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0xC4, 0}, 0, 3, {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_Reg|OPS_64|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, - { CPU_MMX|CPU_P3, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0xC4, 0}, 0, 3, {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, - { CPU_386|CPU_SSE2, MOD_GasSufL, 0, 0, 0x66, 2, {0x0F, 0xC4, 0}, 0, 3, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Reg|OPS_32|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, - { CPU_64|CPU_SSE2, MOD_GasSufQ, 64, 0, 0x66, 2, {0x0F, 0xC4, 0}, 0, 3, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Reg|OPS_64|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, - { CPU_SSE2, MOD_GasSufL, 0, 0, 0x66, 2, {0x0F, 0xC4, 0}, 0, 3, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } + { CPU_MMX|CPU_P3, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0xC4, 0}, 0, 3, 22 }, + { CPU_64|CPU_MMX|CPU_P3, MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0xC4, 0}, 0, 3, 25 }, + { CPU_MMX|CPU_P3, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0xC4, 0}, 0, 3, 28 }, + { CPU_386|CPU_SSE2, MOD_GasSufL, 0, 0, 0x66, 2, {0x0F, 0xC4, 0}, 0, 3, 31 }, + { CPU_64|CPU_SSE2, MOD_GasSufQ, 64, 0, 0x66, 2, {0x0F, 0xC4, 0}, 0, 3, 34 }, + { CPU_SSE2, MOD_GasSufL, 0, 0, 0x66, 2, {0x0F, 0xC4, 0}, 0, 3, 37 } }; static const x86_insn_info pmovmskb_insn[] = { - { CPU_MMX|CPU_P3, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0xD7, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_SIMDReg|OPS_64|OPA_EA, 0} }, - { CPU_386|CPU_SSE2, MOD_GasSufL, 0, 0, 0x66, 2, {0x0F, 0xD7, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} }, - { CPU_64|CPU_MMX|CPU_P3, MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0xD7, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_SIMDReg|OPS_64|OPA_EA, 0} }, - { CPU_64|CPU_SSE2, MOD_GasSufQ, 64, 0, 0x66, 2, {0x0F, 0xD7, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} } + { CPU_MMX|CPU_P3, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0xD7, 0}, 0, 2, 49 }, + { CPU_386|CPU_SSE2, MOD_GasSufL, 0, 0, 0x66, 2, {0x0F, 0xD7, 0}, 0, 2, 52 }, + { CPU_64|CPU_MMX|CPU_P3, MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0xD7, 0}, 0, 2, 55 }, + { CPU_64|CPU_SSE2, MOD_GasSufQ, 64, 0, 0x66, 2, {0x0F, 0xD7, 0}, 0, 2, 58 } }; static const x86_insn_info pshufw_insn[] = { - { CPU_MMX|CPU_P3, 0, 0, 0, 0, 2, {0x0F, 0x70, 0}, 0, 3, {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } + { CPU_MMX|CPU_P3, 0, 0, 0, 0, 2, {0x0F, 0x70, 0}, 0, 3, 82 } }; static const x86_insn_info cvt_xmm_xmm64_ss_insn[] = { - { CPU_SSE2, MOD_Op1Add|MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} }, - { CPU_SSE2, MOD_Op1Add|MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0} } + { CPU_SSE2, MOD_Op1Add|MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, 0 }, + { CPU_SSE2, MOD_Op1Add|MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, 288 } }; static const x86_insn_info cvt_xmm_xmm64_ps_insn[] = { - { CPU_SSE2, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} }, - { CPU_SSE2, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0} } + { CPU_SSE2, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 0 }, + { CPU_SSE2, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 288 } }; static const x86_insn_info cvt_rx_xmm64_insn[] = { - { CPU_386|CPU_SSE2, MOD_Op1Add|MOD_PreAdd|MOD_GasSufL, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} }, - { CPU_386|CPU_SSE2, MOD_Op1Add|MOD_PreAdd|MOD_GasSufL, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0} }, - { CPU_64|CPU_SSE2, MOD_Op1Add|MOD_PreAdd|MOD_GasSufQ, 64, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} }, - { CPU_64|CPU_SSE2, MOD_Op1Add|MOD_PreAdd|MOD_GasSufQ, 64, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0} } + { CPU_386|CPU_SSE2, MOD_Op1Add|MOD_PreAdd|MOD_GasSufL, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, 52 }, + { CPU_386|CPU_SSE2, MOD_Op1Add|MOD_PreAdd|MOD_GasSufL, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, 155 }, + { CPU_64|CPU_SSE2, MOD_Op1Add|MOD_PreAdd|MOD_GasSufQ, 64, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, 58 }, + { CPU_64|CPU_SSE2, MOD_Op1Add|MOD_PreAdd|MOD_GasSufQ, 64, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, 308 } }; static const x86_insn_info cvt_mm_xmm_insn[] = { - { CPU_SSE2, MOD_Op1Add|MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, 0} } + { CPU_SSE2, MOD_Op1Add|MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, 382 } }; static const x86_insn_info cvt_xmm_mm_ss_insn[] = { - { CPU_SSE, MOD_Op1Add|MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, 0} } + { CPU_SSE, MOD_Op1Add|MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, 150 } }; static const x86_insn_info movaupd_insn[] = { - { CPU_SSE2, MOD_Op1Add, 0, 0, 0x66, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, 0} }, - { CPU_SSE2, MOD_Op1Add, 0, 0, 0x66, 2, {0x0F, 0x01, 0}, 0, 2, {OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} } + { CPU_SSE2, MOD_Op1Add, 0, 0, 0x66, 2, {0x0F, 0x00, 0}, 0, 2, 46 }, + { CPU_SSE2, MOD_Op1Add, 0, 0, 0x66, 2, {0x0F, 0x01, 0}, 0, 2, 264 } }; static const x86_insn_info movhlpd_insn[] = { - { CPU_SSE2, MOD_Op1Add, 0, 0, 0x66, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0} }, - { CPU_SSE2, MOD_Op1Add, 0, 0, 0x66, 2, {0x0F, 0x01, 0}, 0, 2, {OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} } + { CPU_SSE2, MOD_Op1Add, 0, 0, 0x66, 2, {0x0F, 0x00, 0}, 0, 2, 288 }, + { CPU_SSE2, MOD_Op1Add, 0, 0, 0x66, 2, {0x0F, 0x01, 0}, 0, 2, 334 } }; static const x86_insn_info movmskpd_insn[] = { - { CPU_386|CPU_SSE2, MOD_GasSufL, 0, 0, 0x66, 2, {0x0F, 0x50, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} }, - { CPU_64|CPU_SSE2, MOD_GasSufQ, 0, 0, 0x66, 2, {0x0F, 0x50, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} } + { CPU_386|CPU_SSE2, MOD_GasSufL, 0, 0, 0x66, 2, {0x0F, 0x50, 0}, 0, 2, 52 }, + { CPU_64|CPU_SSE2, MOD_GasSufQ, 0, 0, 0x66, 2, {0x0F, 0x50, 0}, 0, 2, 58 } }; static const x86_insn_info movntpddq_insn[] = { - { CPU_SSE2, MOD_Op1Add, 0, 0, 0x66, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_Mem|OPS_128|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} } + { CPU_SSE2, MOD_Op1Add, 0, 0, 0x66, 2, {0x0F, 0x00, 0}, 0, 2, 274 } }; static const x86_insn_info vmxmemrd_insn[] = { - { CPU_Not64|CPU_P4, MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x78, 0}, 0, 2, {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_32|OPA_Spare, 0} }, - { CPU_64|CPU_P4, MOD_GasSufQ, 64, 64, 0, 2, {0x0F, 0x78, 0}, 0, 2, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_64|OPA_Spare, 0} } + { CPU_Not64|CPU_P4, MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x78, 0}, 0, 2, 100 }, + { CPU_64|CPU_P4, MOD_GasSufQ, 64, 64, 0, 2, {0x0F, 0x78, 0}, 0, 2, 106 } }; static const x86_insn_info vmxmemwr_insn[] = { - { CPU_Not64|CPU_P4, MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x79, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} }, - { CPU_64|CPU_P4, MOD_GasSufQ, 64, 64, 0, 2, {0x0F, 0x79, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} } + { CPU_Not64|CPU_P4, MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x79, 0}, 0, 2, 7 }, + { CPU_64|CPU_P4, MOD_GasSufQ, 64, 64, 0, 2, {0x0F, 0x79, 0}, 0, 2, 10 } }; static const x86_insn_info vmxtwobytemem_insn[] = { - { CPU_P4, MOD_SpAdd, 0, 0, 0, 2, {0x0F, 0xC7, 0}, 0, 1, {OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0, 0} } + { CPU_P4, MOD_SpAdd, 0, 0, 0, 2, {0x0F, 0xC7, 0}, 0, 1, 139 } }; static const x86_insn_info vmxthreebytemem_insn[] = { - { CPU_P4, MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0xC7, 0}, 6, 1, {OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0, 0} } + { CPU_P4, MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0xC7, 0}, 6, 1, 139 } }; static const x86_insn_info cvt_xmm_xmm32_insn[] = { - { CPU_SSE2, MOD_Op1Add|MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} }, - { CPU_SSE2, MOD_Op1Add|MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, 0} } + { CPU_SSE2, MOD_Op1Add|MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, 0 }, + { CPU_SSE2, MOD_Op1Add|MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, 85 } }; static const x86_insn_info maskmovdqu_insn[] = { - { CPU_SSE2, 0, 0, 0, 0x66, 2, {0x0F, 0xF7, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} } + { CPU_SSE2, 0, 0, 0, 0x66, 2, {0x0F, 0xF7, 0}, 0, 2, 0 } }; static const x86_insn_info movdqau_insn[] = { - { CPU_SSE2, MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0x6F, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, 0} }, - { CPU_SSE2, MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0x7F, 0}, 0, 2, {OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} } + { CPU_SSE2, MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0x6F, 0}, 0, 2, 46 }, + { CPU_SSE2, MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0x7F, 0}, 0, 2, 264 } }; static const x86_insn_info movdq2q_insn[] = { - { CPU_SSE2, 0, 0, 0, 0xF2, 2, {0x0F, 0xD6, 0}, 0, 2, {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} } + { CPU_SSE2, 0, 0, 0, 0xF2, 2, {0x0F, 0xD6, 0}, 0, 2, 136 } }; static const x86_insn_info movq2dq_insn[] = { - { CPU_SSE2, 0, 0, 0, 0xF3, 2, {0x0F, 0xD6, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_64|OPA_EA, 0} } + { CPU_SSE2, 0, 0, 0, 0xF3, 2, {0x0F, 0xD6, 0}, 0, 2, 262 } }; static const x86_insn_info pslrldq_insn[] = { - { CPU_SSE2, MOD_SpAdd, 0, 0, 0x66, 2, {0x0F, 0x73, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, 0} } + { CPU_SSE2, MOD_SpAdd, 0, 0, 0x66, 2, {0x0F, 0x73, 0}, 0, 2, 53 } }; static const x86_insn_info lddqu_insn[] = { - { CPU_SSE3, 0, 0, 0, 0xF2, 2, {0x0F, 0xF0, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_Any|OPA_EA, 0} } + { CPU_SSE3, 0, 0, 0, 0xF2, 2, {0x0F, 0xF0, 0}, 0, 2, 394 } }; static const x86_insn_info ssse3_insn[] = { - { CPU_SSSE3, MOD_Op2Add, 0, 0, 0, 3, {0x0F, 0x38, 0x00}, 0, 2, {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, 0} }, - { CPU_SSSE3, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, 0} } + { CPU_SSSE3, MOD_Op2Add, 0, 0, 0, 3, {0x0F, 0x38, 0x00}, 0, 2, 82 }, + { CPU_SSSE3, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, 46 } }; static const x86_insn_info ssse3imm_insn[] = { - { CPU_SSSE3, MOD_Op2Add, 0, 0, 0, 3, {0x0F, 0x3A, 0x00}, 0, 3, {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, - { CPU_SSSE3, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x3A, 0x00}, 0, 3, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } + { CPU_SSSE3, MOD_Op2Add, 0, 0, 0, 3, {0x0F, 0x3A, 0x00}, 0, 3, 82 }, + { CPU_SSSE3, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x3A, 0x00}, 0, 3, 46 } }; static const x86_insn_info sse4_insn[] = { - { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, 0} } + { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, 46 } }; static const x86_insn_info sse4imm_insn[] = { - { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x3A, 0x00}, 0, 3, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } + { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x3A, 0x00}, 0, 3, 46 } }; static const x86_insn_info sse4xmm0_insn[] = { - { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, 0} }, - { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 3, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, OPT_XMM0|OPS_128|OPA_None} } + { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, 46 }, + { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 3, 79 } }; static const x86_insn_info crc32_insn[] = { - { CPU_386|CPU_SSE42, MOD_GasSufB, 0, 0, 0xF2, 3, {0x0F, 0x38, 0xF0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_8|OPA_EA, 0} }, - { CPU_386|CPU_SSE42, MOD_GasSufW, 16, 0, 0xF2, 3, {0x0F, 0x38, 0xF1}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_16|OPA_EA, 0} }, - { CPU_386|CPU_SSE42, MOD_GasSufL, 32, 0, 0xF2, 3, {0x0F, 0x38, 0xF1}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} }, - { CPU_64|CPU_SSE42, MOD_GasSufB, 64, 0, 0xF2, 3, {0x0F, 0x38, 0xF0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_8|OPA_EA, 0} }, - { CPU_64|CPU_SSE42, MOD_GasSufQ, 64, 0, 0xF2, 3, {0x0F, 0x38, 0xF1}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} } + { CPU_386|CPU_SSE42, MOD_GasSufB, 0, 0, 0xF2, 3, {0x0F, 0x38, 0xF0}, 0, 2, 312 }, + { CPU_386|CPU_SSE42, MOD_GasSufW, 16, 0, 0xF2, 3, {0x0F, 0x38, 0xF1}, 0, 2, 314 }, + { CPU_386|CPU_SSE42, MOD_GasSufL, 32, 0, 0xF2, 3, {0x0F, 0x38, 0xF1}, 0, 2, 7 }, + { CPU_64|CPU_SSE42, MOD_GasSufB, 64, 0, 0xF2, 3, {0x0F, 0x38, 0xF0}, 0, 2, 316 }, + { CPU_64|CPU_SSE42, MOD_GasSufQ, 64, 0, 0xF2, 3, {0x0F, 0x38, 0xF1}, 0, 2, 10 } }; static const x86_insn_info extractps_insn[] = { - { CPU_386|CPU_SSE41, 0, 32, 0, 0x66, 3, {0x0F, 0x3A, 0x17}, 0, 3, {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, - { CPU_64|CPU_SSE41, 0, 64, 0, 0x66, 3, {0x0F, 0x3A, 0x17}, 0, 3, {OPT_Reg|OPS_64|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } + { CPU_386|CPU_SSE41, 0, 32, 0, 0x66, 3, {0x0F, 0x3A, 0x17}, 0, 3, 73 }, + { CPU_64|CPU_SSE41, 0, 64, 0, 0x66, 3, {0x0F, 0x3A, 0x17}, 0, 3, 67 } }; static const x86_insn_info insertps_insn[] = { - { CPU_SSE41, 0, 0, 0, 0x66, 3, {0x0F, 0x3A, 0x21}, 0, 3, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, - { CPU_SSE41, 0, 0, 0, 0x66, 3, {0x0F, 0x3A, 0x21}, 0, 3, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } + { CPU_SSE41, 0, 0, 0, 0x66, 3, {0x0F, 0x3A, 0x21}, 0, 3, 85 }, + { CPU_SSE41, 0, 0, 0, 0x66, 3, {0x0F, 0x3A, 0x21}, 0, 3, 88 } }; static const x86_insn_info movntdqa_insn[] = { - { CPU_SSE41, 0, 0, 0, 0x66, 3, {0x0F, 0x38, 0x2A}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_128|OPS_Relaxed|OPA_EA, 0} } + { CPU_SSE41, 0, 0, 0, 0x66, 3, {0x0F, 0x38, 0x2A}, 0, 2, 362 } }; static const x86_insn_info sse4pcmpstr_insn[] = { - { CPU_SSE42, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x3A, 0x00}, 0, 3, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } + { CPU_SSE42, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x3A, 0x00}, 0, 3, 46 } }; static const x86_insn_info pextrb_insn[] = { - { CPU_SSE41, 0, 0, 0, 0x66, 3, {0x0F, 0x3A, 0x14}, 0, 3, {OPT_Mem|OPS_8|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, - { CPU_386|CPU_SSE41, 0, 32, 0, 0x66, 3, {0x0F, 0x3A, 0x14}, 0, 3, {OPT_Reg|OPS_32|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, - { CPU_64|CPU_SSE41, 0, 64, 0, 0x66, 3, {0x0F, 0x3A, 0x14}, 0, 3, {OPT_Reg|OPS_64|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } + { CPU_SSE41, 0, 0, 0, 0x66, 3, {0x0F, 0x3A, 0x14}, 0, 3, 76 }, + { CPU_386|CPU_SSE41, 0, 32, 0, 0x66, 3, {0x0F, 0x3A, 0x14}, 0, 3, 64 }, + { CPU_64|CPU_SSE41, 0, 64, 0, 0x66, 3, {0x0F, 0x3A, 0x14}, 0, 3, 67 } }; static const x86_insn_info pextrd_insn[] = { - { CPU_386|CPU_SSE41, 0, 32, 0, 0x66, 3, {0x0F, 0x3A, 0x16}, 0, 3, {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } + { CPU_386|CPU_SSE41, 0, 32, 0, 0x66, 3, {0x0F, 0x3A, 0x16}, 0, 3, 73 } }; static const x86_insn_info pextrq_insn[] = { - { CPU_64|CPU_SSE41, 0, 64, 0, 0x66, 3, {0x0F, 0x3A, 0x16}, 0, 3, {OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } + { CPU_64|CPU_SSE41, 0, 64, 0, 0x66, 3, {0x0F, 0x3A, 0x16}, 0, 3, 70 } }; static const x86_insn_info pinsrb_insn[] = { - { CPU_SSE41, 0, 0, 0, 0x66, 3, {0x0F, 0x3A, 0x20}, 0, 3, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_8|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, - { CPU_386|CPU_SSE41, 0, 32, 0, 0x66, 3, {0x0F, 0x3A, 0x20}, 0, 3, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Reg|OPS_32|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } + { CPU_SSE41, 0, 0, 0, 0x66, 3, {0x0F, 0x3A, 0x20}, 0, 3, 43 }, + { CPU_386|CPU_SSE41, 0, 32, 0, 0x66, 3, {0x0F, 0x3A, 0x20}, 0, 3, 31 } }; static const x86_insn_info pinsrd_insn[] = { - { CPU_386|CPU_SSE41, 0, 32, 0, 0x66, 3, {0x0F, 0x3A, 0x22}, 0, 3, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } + { CPU_386|CPU_SSE41, 0, 32, 0, 0x66, 3, {0x0F, 0x3A, 0x22}, 0, 3, 40 } }; static const x86_insn_info pinsrq_insn[] = { - { CPU_64|CPU_SSE41, 0, 64, 0, 0x66, 3, {0x0F, 0x3A, 0x22}, 0, 3, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} } + { CPU_64|CPU_SSE41, 0, 64, 0, 0x66, 3, {0x0F, 0x3A, 0x22}, 0, 3, 91 } }; static const x86_insn_info sse4m64_insn[] = { - { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0} }, - { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} } + { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, 288 }, + { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, 0 } }; static const x86_insn_info sse4m32_insn[] = { - { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, 0} }, - { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} } + { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, 85 }, + { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, 0 } }; static const x86_insn_info sse4m16_insn[] = { - { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, 0} }, - { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} } + { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, 37 }, + { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, 0 } }; static const x86_insn_info cnt_insn[] = { - { CPU_Any, MOD_Op1Add|MOD_GasSufW, 16, 0, 0xF3, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_Reg|OPS_16|OPA_Spare, OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, 0} }, - { CPU_386, MOD_Op1Add|MOD_GasSufL, 32, 0, 0xF3, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} }, - { CPU_64, MOD_Op1Add|MOD_GasSufQ, 64, 0, 0xF3, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_Reg|OPS_64|OPA_Spare, OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, 0} } + { CPU_Any, MOD_Op1Add|MOD_GasSufW, 16, 0, 0xF3, 2, {0x0F, 0x00, 0}, 0, 2, 4 }, + { CPU_386, MOD_Op1Add|MOD_GasSufL, 32, 0, 0xF3, 2, {0x0F, 0x00, 0}, 0, 2, 7 }, + { CPU_64, MOD_Op1Add|MOD_GasSufQ, 64, 0, 0xF3, 2, {0x0F, 0x00, 0}, 0, 2, 10 } }; static const x86_insn_info extrq_insn[] = { - { CPU_SSE41, 0, 0, 0, 0x66, 2, {0x0F, 0x78, 0}, 0, 3, {OPT_SIMDReg|OPS_128|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm} }, - { CPU_SSE41, 0, 0, 0, 0x66, 2, {0x0F, 0x79, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} } + { CPU_SSE41, 0, 0, 0, 0x66, 2, {0x0F, 0x78, 0}, 0, 3, 1 }, + { CPU_SSE41, 0, 0, 0, 0x66, 2, {0x0F, 0x79, 0}, 0, 2, 0 } }; static const x86_insn_info insertq_insn[] = { - { CPU_SSE41, 0, 0, 0, 0xF2, 2, {0x0F, 0x78, 0}, 0, 4, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, OPT_Imm|OPS_8|OPS_Relaxed|OPA_EA} }, - { CPU_SSE41, 0, 0, 0, 0xF2, 2, {0x0F, 0x79, 0}, 0, 2, {OPT_SIMDReg|OPS_128|OPA_Spare, OPT_SIMDReg|OPS_128|OPA_EA, 0} } + { CPU_SSE41, 0, 0, 0, 0xF2, 2, {0x0F, 0x78, 0}, 0, 4, 0 }, + { CPU_SSE41, 0, 0, 0, 0xF2, 2, {0x0F, 0x79, 0}, 0, 2, 0 } }; static const x86_insn_info movntsd_insn[] = { - { CPU_SSE41, 0, 0, 0, 0xF2, 2, {0x0F, 0x2B, 0}, 0, 2, {OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} } + { CPU_SSE41, 0, 0, 0, 0xF2, 2, {0x0F, 0x2B, 0}, 0, 2, 334 } }; static const x86_insn_info movntss_insn[] = { - { CPU_SSE41, 0, 0, 0, 0xF3, 2, {0x0F, 0x2B, 0}, 0, 2, {OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, OPT_SIMDReg|OPS_128|OPA_Spare, 0} } + { CPU_SSE41, 0, 0, 0, 0xF3, 2, {0x0F, 0x2B, 0}, 0, 2, 364 } }; static const x86_insn_info now3d_insn[] = { - { CPU_3DNow, MOD_Imm8, 0, 0, 0, 2, {0x0F, 0x0F, 0}, 0, 2, {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, 0} } + { CPU_3DNow, MOD_Imm8, 0, 0, 0, 2, {0x0F, 0x0F, 0}, 0, 2, 82 } }; static const x86_insn_info cmpxchg16b_insn[] = { - { CPU_64, 0, 64, 0, 0, 2, {0x0F, 0xC7, 0}, 1, 1, {OPT_Mem|OPS_128|OPS_Relaxed|OPA_EA, 0, 0} } + { CPU_64, 0, 64, 0, 0, 2, {0x0F, 0xC7, 0}, 1, 1, 274 } }; static const x86_insn_info invlpga_insn[] = { - { CPU_SVM, 0, 0, 0, 0, 3, {0x0F, 0x01, 0xDF}, 0, 0, {0, 0, 0} }, - { CPU_386|CPU_SVM, 0, 0, 0, 0, 3, {0x0F, 0x01, 0xDF}, 0, 2, {OPT_MemrAX|OPS_Any|OPA_AdSizeEA, OPT_Creg|OPS_32|OPA_None, 0} } + { CPU_SVM, 0, 0, 0, 0, 3, {0x0F, 0x01, 0xDF}, 0, 0, 0 }, + { CPU_386|CPU_SVM, 0, 0, 0, 0, 3, {0x0F, 0x01, 0xDF}, 0, 2, 290 } }; static const x86_insn_info skinit_insn[] = { - { CPU_SVM, 0, 0, 0, 0, 3, {0x0F, 0x01, 0xDE}, 0, 0, {0, 0, 0} }, - { CPU_SVM, 0, 0, 0, 0, 3, {0x0F, 0x01, 0xDE}, 0, 1, {OPT_MemEAX|OPS_Any|OPA_None, 0, 0} } + { CPU_SVM, 0, 0, 0, 0, 3, {0x0F, 0x01, 0xDE}, 0, 0, 0 }, + { CPU_SVM, 0, 0, 0, 0, 3, {0x0F, 0x01, 0xDE}, 0, 1, 406 } }; static const x86_insn_info svm_rax_insn[] = { - { CPU_SVM, MOD_Op2Add, 0, 0, 0, 3, {0x0F, 0x01, 0x00}, 0, 0, {0, 0, 0} }, - { CPU_SVM, MOD_Op2Add, 0, 0, 0, 3, {0x0F, 0x01, 0x00}, 0, 1, {OPT_MemrAX|OPS_Any|OPA_AdSizeEA, 0, 0} } + { CPU_SVM, MOD_Op2Add, 0, 0, 0, 3, {0x0F, 0x01, 0x00}, 0, 0, 0 }, + { CPU_SVM, MOD_Op2Add, 0, 0, 0, 3, {0x0F, 0x01, 0x00}, 0, 1, 290 } }; static const x86_insn_info padlock_insn[] = { - { CPU_PadLock, MOD_Op1Add|MOD_PreAdd|MOD_Imm8, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 0, {0, 0, 0} } + { CPU_PadLock, MOD_Op1Add|MOD_PreAdd|MOD_Imm8, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 0, 0 } }; static const x86_insn_info cyrixmmx_insn[] = { - { CPU_Cyrix|CPU_MMX, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, 0} } + { CPU_Cyrix|CPU_MMX, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 82 } }; static const x86_insn_info pmachriw_insn[] = { - { CPU_Cyrix|CPU_MMX, 0, 0, 0, 0, 2, {0x0F, 0x5E, 0}, 0, 2, {OPT_SIMDReg|OPS_64|OPA_Spare, OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, 0} } + { CPU_Cyrix|CPU_MMX, 0, 0, 0, 0, 2, {0x0F, 0x5E, 0}, 0, 2, 138 } }; static const x86_insn_info rdwrshr_insn[] = { - { CPU_686|CPU_Cyrix|CPU_SMM, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x36, 0}, 0, 1, {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0, 0} } + { CPU_686|CPU_Cyrix|CPU_SMM, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x36, 0}, 0, 1, 8 } }; static const x86_insn_info rsdc_insn[] = { - { CPU_486|CPU_Cyrix|CPU_SMM, 0, 0, 0, 0, 2, {0x0F, 0x79, 0}, 0, 2, {OPT_SegReg|OPS_16|OPS_Relaxed|OPA_Spare, OPT_Mem|OPS_80|OPS_Relaxed|OPA_EA, 0} } + { CPU_486|CPU_Cyrix|CPU_SMM, 0, 0, 0, 0, 2, {0x0F, 0x79, 0}, 0, 2, 310 } }; static const x86_insn_info cyrixsmm_insn[] = { - { CPU_486|CPU_Cyrix|CPU_SMM, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 1, {OPT_Mem|OPS_80|OPS_Relaxed|OPA_EA, 0, 0} } + { CPU_486|CPU_Cyrix|CPU_SMM, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 1, 311 } }; static const x86_insn_info svdc_insn[] = { - { CPU_486|CPU_Cyrix|CPU_SMM, 0, 0, 0, 0, 2, {0x0F, 0x78, 0}, 0, 2, {OPT_Mem|OPS_80|OPS_Relaxed|OPA_EA, OPT_SegReg|OPS_16|OPS_Relaxed|OPA_Spare, 0} } + { CPU_486|CPU_Cyrix|CPU_SMM, 0, 0, 0, 0, 2, {0x0F, 0x78, 0}, 0, 2, 386 } }; static const x86_insn_info ibts_insn[] = { - { CPU_386|CPU_Obs|CPU_Undoc, 0, 16, 0, 0, 2, {0x0F, 0xA7, 0}, 0, 2, {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_16|OPA_Spare, 0} }, - { CPU_386|CPU_Obs|CPU_Undoc, 0, 32, 0, 0, 2, {0x0F, 0xA7, 0}, 0, 2, {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_32|OPA_Spare, 0} } + { CPU_386|CPU_Obs|CPU_Undoc, 0, 16, 0, 0, 2, {0x0F, 0xA7, 0}, 0, 2, 94 }, + { CPU_386|CPU_Obs|CPU_Undoc, 0, 32, 0, 0, 2, {0x0F, 0xA7, 0}, 0, 2, 100 } }; static const x86_insn_info umov_insn[] = { - { CPU_386|CPU_Undoc, 0, 0, 0, 0, 2, {0x0F, 0x10, 0}, 0, 2, {OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_8|OPA_Spare, 0} }, - { CPU_386|CPU_Undoc, 0, 16, 0, 0, 2, {0x0F, 0x11, 0}, 0, 2, {OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_16|OPA_Spare, 0} }, - { CPU_386|CPU_Undoc, 0, 32, 0, 0, 2, {0x0F, 0x11, 0}, 0, 2, {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, OPT_Reg|OPS_32|OPA_Spare, 0} }, - { CPU_386|CPU_Undoc, 0, 0, 0, 0, 2, {0x0F, 0x12, 0}, 0, 2, {OPT_Reg|OPS_8|OPA_Spare, OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, 0} }, - { CPU_386|CPU_Undoc, 0, 16, 0, 0, 2, {0x0F, 0x13, 0}, 0, 2, {OPT_Reg|OPS_16|OPA_Spare, OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, 0} }, - { CPU_386|CPU_Undoc, 0, 32, 0, 0, 2, {0x0F, 0x13, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} } + { CPU_386|CPU_Undoc, 0, 0, 0, 0, 2, {0x0F, 0x10, 0}, 0, 2, 140 }, + { CPU_386|CPU_Undoc, 0, 16, 0, 0, 2, {0x0F, 0x11, 0}, 0, 2, 94 }, + { CPU_386|CPU_Undoc, 0, 32, 0, 0, 2, {0x0F, 0x11, 0}, 0, 2, 100 }, + { CPU_386|CPU_Undoc, 0, 0, 0, 0, 2, {0x0F, 0x12, 0}, 0, 2, 142 }, + { CPU_386|CPU_Undoc, 0, 16, 0, 0, 2, {0x0F, 0x13, 0}, 0, 2, 4 }, + { CPU_386|CPU_Undoc, 0, 32, 0, 0, 2, {0x0F, 0x13, 0}, 0, 2, 7 } }; static const x86_insn_info xbts_insn[] = { - { CPU_386|CPU_Obs|CPU_Undoc, 0, 16, 0, 0, 2, {0x0F, 0xA6, 0}, 0, 2, {OPT_Reg|OPS_16|OPA_Spare, OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, 0} }, - { CPU_386|CPU_Obs|CPU_Undoc, 0, 32, 0, 0, 2, {0x0F, 0xA6, 0}, 0, 2, {OPT_Reg|OPS_32|OPA_Spare, OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, 0} } + { CPU_386|CPU_Obs|CPU_Undoc, 0, 16, 0, 0, 2, {0x0F, 0xA6, 0}, 0, 2, 306 }, + { CPU_386|CPU_Obs|CPU_Undoc, 0, 32, 0, 0, 2, {0x0F, 0xA6, 0}, 0, 2, 176 } }; From 4c0289c7c7fdfb5a54a22d8d40ea7814f209c8ac Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 12 Sep 2007 04:15:33 +0000 Subject: [PATCH 078/585] 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 --- Mkfiles/vc/genperf/run.bat | 3 +- Mkfiles/vc8/genperf/run.bat | 3 +- x86insn_gas.gperf | 1272 ---------------------------- x86insn_nasm.gperf | 768 ----------------- x86insns.c | 1560 ----------------------------------- 5 files changed, 4 insertions(+), 3602 deletions(-) delete mode 100644 x86insn_gas.gperf delete mode 100644 x86insn_nasm.gperf delete mode 100644 x86insns.c diff --git a/Mkfiles/vc/genperf/run.bat b/Mkfiles/vc/genperf/run.bat index 4364ead0..b2991ffd 100644 --- a/Mkfiles/vc/genperf/run.bat +++ b/Mkfiles/vc/genperf/run.bat @@ -1,4 +1,5 @@ -cd ..\..\..\ +cd ..\..\.. +modules\arch\x86\gen_x86_insn.py %1 x86insn_nasm.gperf x86insn_nasm.c %1 x86insn_gas.gperf x86insn_gas.c %1 modules\arch\x86\x86cpu.gperf x86cpu.c diff --git a/Mkfiles/vc8/genperf/run.bat b/Mkfiles/vc8/genperf/run.bat index 4364ead0..b2991ffd 100644 --- a/Mkfiles/vc8/genperf/run.bat +++ b/Mkfiles/vc8/genperf/run.bat @@ -1,4 +1,5 @@ -cd ..\..\..\ +cd ..\..\.. +modules\arch\x86\gen_x86_insn.py %1 x86insn_nasm.gperf x86insn_nasm.c %1 x86insn_gas.gperf x86insn_gas.c %1 modules\arch\x86\x86cpu.gperf x86cpu.c diff --git a/x86insn_gas.gperf b/x86insn_gas.gperf deleted file mode 100644 index ef6b85aa..00000000 --- a/x86insn_gas.gperf +++ /dev/null @@ -1,1272 +0,0 @@ -%ignore-case -%language=ANSI-C -%compare-strncmp -%readonly-tables -%enum -%struct-type -%define hash-function-name insnprefix_gas_hash -%define lookup-function-name insnprefix_gas_find -struct insnprefix_parse_data; -%% -aaa, onebyte_insn, (0x000037UL<<8)|1, CPU_Not64, NONE -aad, aadm_insn, (0x01UL<<8)|2, CPU_Not64, NONE -aam, aadm_insn, (0x00UL<<8)|2, CPU_Not64, NONE -aas, onebyte_insn, (0x00003FUL<<8)|1, CPU_Not64, NONE -adc, arith_insn, (0x0210UL<<8)|22, CPU_Any, NONE -adcb, arith_insn, (0x0210UL<<8)|22, CPU_Any, SUF_B -adcl, arith_insn, (0x0210UL<<8)|22, CPU_386, SUF_L -adcq, arith_insn, (0x0210UL<<8)|22, CPU_64, SUF_Q -adcw, arith_insn, (0x0210UL<<8)|22, CPU_Any, SUF_W -add, arith_insn, (0x0000UL<<8)|22, CPU_Any, NONE -addb, arith_insn, (0x0000UL<<8)|22, CPU_Any, SUF_B -addl, arith_insn, (0x0000UL<<8)|22, CPU_386, SUF_L -addq, arith_insn, (0x0000UL<<8)|22, CPU_64, SUF_Q -addw, arith_insn, (0x0000UL<<8)|22, CPU_Any, SUF_W -addpd, ssess_insn, (0x6658UL<<8)|1, CPU_SSE2, NONE -addps, sseps_insn, (0x58UL<<8)|1, CPU_SSE, NONE -addr16, NULL, X86_ADDRSIZE, 0x10, NONE -addr32, NULL, X86_ADDRSIZE, 0x20, NONE -addr64, NULL, X86_ADDRSIZE, 0x40, NONE -addsd, ssess_insn, (0xF258UL<<8)|1, CPU_SSE2, NONE -addss, ssess_insn, (0xF358UL<<8)|1, CPU_SSE, NONE -addsubpd, ssess_insn, (0x66D0UL<<8)|1, CPU_SSE3, NONE -addsubps, ssess_insn, (0xF2D0UL<<8)|1, CPU_SSE3, NONE -adword, NULL, X86_ADDRSIZE, 0x20, NONE -and, arith_insn, (0x0420UL<<8)|22, CPU_Any, NONE -andb, arith_insn, (0x0420UL<<8)|22, CPU_Any, SUF_B -andl, arith_insn, (0x0420UL<<8)|22, CPU_386, SUF_L -andq, arith_insn, (0x0420UL<<8)|22, CPU_64, SUF_Q -andw, arith_insn, (0x0420UL<<8)|22, CPU_Any, SUF_W -andnpd, ssess_insn, (0x6655UL<<8)|1, CPU_SSE2, NONE -andnps, sseps_insn, (0x55UL<<8)|1, CPU_SSE, NONE -andpd, ssess_insn, (0x6654UL<<8)|1, CPU_SSE2, NONE -andps, sseps_insn, (0x54UL<<8)|1, CPU_SSE, NONE -aqword, NULL, X86_ADDRSIZE, 0x40, NONE -arpl, arpl_insn, (0UL<<8)|1, CPU_286|CPU_Not64|CPU_Prot, NONE -arplw, arpl_insn, (0UL<<8)|1, CPU_286|CPU_Not64|CPU_Prot, SUF_W -aword, NULL, X86_ADDRSIZE, 0x10, NONE -blendpd, sse4imm_insn, (0x0DUL<<8)|1, CPU_SSE41, NONE -blendps, sse4imm_insn, (0x0CUL<<8)|1, CPU_SSE41, NONE -blendvpd, sse4xmm0_insn, (0x15UL<<8)|2, CPU_SSE41, NONE -blendvps, sse4xmm0_insn, (0x14UL<<8)|2, CPU_SSE41, NONE -bound, bound_insn, (0UL<<8)|2, CPU_186|CPU_Not64, NONE -boundl, bound_insn, (0UL<<8)|2, CPU_386|CPU_Not64, SUF_L -boundw, bound_insn, (0UL<<8)|2, CPU_186|CPU_Not64, SUF_W -bsf, bsfr_insn, (0xBCUL<<8)|3, CPU_386, NONE -bsfl, bsfr_insn, (0xBCUL<<8)|3, CPU_386, SUF_L -bsfq, bsfr_insn, (0xBCUL<<8)|3, CPU_386|CPU_64, SUF_Q -bsfw, bsfr_insn, (0xBCUL<<8)|3, CPU_386, SUF_W -bsr, bsfr_insn, (0xBDUL<<8)|3, CPU_386, NONE -bsrl, bsfr_insn, (0xBDUL<<8)|3, CPU_386, SUF_L -bsrq, bsfr_insn, (0xBDUL<<8)|3, CPU_386|CPU_64, SUF_Q -bsrw, bsfr_insn, (0xBDUL<<8)|3, CPU_386, SUF_W -bswap, bswap_insn, (0UL<<8)|2, CPU_486, NONE -bswapl, bswap_insn, (0UL<<8)|2, CPU_486, SUF_L -bswapq, bswap_insn, (0UL<<8)|2, CPU_64, SUF_Q -bt, bittest_insn, (0x04A3UL<<8)|6, CPU_386, NONE -btl, bittest_insn, (0x04A3UL<<8)|6, CPU_386, SUF_L -btq, bittest_insn, (0x04A3UL<<8)|6, CPU_386|CPU_64, SUF_Q -btw, bittest_insn, (0x04A3UL<<8)|6, CPU_386, SUF_W -btc, bittest_insn, (0x07BBUL<<8)|6, CPU_386, NONE -btcl, bittest_insn, (0x07BBUL<<8)|6, CPU_386, SUF_L -btcq, bittest_insn, (0x07BBUL<<8)|6, CPU_386|CPU_64, SUF_Q -btcw, bittest_insn, (0x07BBUL<<8)|6, CPU_386, SUF_W -btr, bittest_insn, (0x06B3UL<<8)|6, CPU_386, NONE -btrl, bittest_insn, (0x06B3UL<<8)|6, CPU_386, SUF_L -btrq, bittest_insn, (0x06B3UL<<8)|6, CPU_386|CPU_64, SUF_Q -btrw, bittest_insn, (0x06B3UL<<8)|6, CPU_386, SUF_W -bts, bittest_insn, (0x05ABUL<<8)|6, CPU_386, NONE -btsl, bittest_insn, (0x05ABUL<<8)|6, CPU_386, SUF_L -btsq, bittest_insn, (0x05ABUL<<8)|6, CPU_386|CPU_64, SUF_Q -btsw, bittest_insn, (0x05ABUL<<8)|6, CPU_386, SUF_W -call, call_insn, (0UL<<8)|26, CPU_Any, NONE -calll, call_insn, (0UL<<8)|26, CPU_Not64, NONE -callq, call_insn, (0UL<<8)|26, CPU_64, NONE -cbtw, onebyte_insn, (0x001098UL<<8)|1, CPU_Any, NONE -cbw, onebyte_insn, (0x001098UL<<8)|1, CPU_Any, NONE -cdq, onebyte_insn, (0x002099UL<<8)|1, CPU_386, NONE -cdqe, onebyte_insn, (0x004098UL<<8)|1, CPU_64, NONE -clc, onebyte_insn, (0x0000F8UL<<8)|1, CPU_Any, NONE -cld, onebyte_insn, (0x0000FCUL<<8)|1, CPU_Any, NONE -clflush, clflush_insn, (0UL<<8)|1, CPU_P3, NONE -clgi, threebyte_insn, (0x0F01DDUL<<8)|1, CPU_SVM, NONE -cli, onebyte_insn, (0x0000FAUL<<8)|1, CPU_Any, NONE -cltd, onebyte_insn, (0x002099UL<<8)|1, CPU_386, NONE -cltq, onebyte_insn, (0x004098UL<<8)|1, CPU_64, NONE -clts, twobyte_insn, (0x0F06UL<<8)|1, CPU_286|CPU_Priv, NONE -cmc, onebyte_insn, (0x0000F5UL<<8)|1, CPU_Any, NONE -cmova, cmovcc_insn, (0x07UL<<8)|3, CPU_686, NONE -cmoval, cmovcc_insn, (0x07UL<<8)|3, CPU_686, SUF_L -cmovaq, cmovcc_insn, (0x07UL<<8)|3, CPU_64|CPU_686, SUF_Q -cmovaw, cmovcc_insn, (0x07UL<<8)|3, CPU_686, SUF_W -cmovae, cmovcc_insn, (0x03UL<<8)|3, CPU_686, NONE -cmovael, cmovcc_insn, (0x03UL<<8)|3, CPU_686, SUF_L -cmovaeq, cmovcc_insn, (0x03UL<<8)|3, CPU_64|CPU_686, SUF_Q -cmovaew, cmovcc_insn, (0x03UL<<8)|3, CPU_686, SUF_W -cmovb, cmovcc_insn, (0x02UL<<8)|3, CPU_686, NONE -cmovbl, cmovcc_insn, (0x02UL<<8)|3, CPU_686, SUF_L -cmovbq, cmovcc_insn, (0x02UL<<8)|3, CPU_64|CPU_686, SUF_Q -cmovbw, cmovcc_insn, (0x02UL<<8)|3, CPU_686, SUF_W -cmovbe, cmovcc_insn, (0x06UL<<8)|3, CPU_686, NONE -cmovbel, cmovcc_insn, (0x06UL<<8)|3, CPU_686, SUF_L -cmovbeq, cmovcc_insn, (0x06UL<<8)|3, CPU_64|CPU_686, SUF_Q -cmovbew, cmovcc_insn, (0x06UL<<8)|3, CPU_686, SUF_W -cmovc, cmovcc_insn, (0x02UL<<8)|3, CPU_686, NONE -cmovcl, cmovcc_insn, (0x02UL<<8)|3, CPU_686, SUF_L -cmovcq, cmovcc_insn, (0x02UL<<8)|3, CPU_64|CPU_686, SUF_Q -cmovcw, cmovcc_insn, (0x02UL<<8)|3, CPU_686, SUF_W -cmove, cmovcc_insn, (0x04UL<<8)|3, CPU_686, NONE -cmovel, cmovcc_insn, (0x04UL<<8)|3, CPU_686, SUF_L -cmoveq, cmovcc_insn, (0x04UL<<8)|3, CPU_64|CPU_686, SUF_Q -cmovew, cmovcc_insn, (0x04UL<<8)|3, CPU_686, SUF_W -cmovg, cmovcc_insn, (0x0FUL<<8)|3, CPU_686, NONE -cmovgl, cmovcc_insn, (0x0FUL<<8)|3, CPU_686, SUF_L -cmovgq, cmovcc_insn, (0x0FUL<<8)|3, CPU_64|CPU_686, SUF_Q -cmovgw, cmovcc_insn, (0x0FUL<<8)|3, CPU_686, SUF_W -cmovge, cmovcc_insn, (0x0DUL<<8)|3, CPU_686, NONE -cmovgel, cmovcc_insn, (0x0DUL<<8)|3, CPU_686, SUF_L -cmovgeq, cmovcc_insn, (0x0DUL<<8)|3, CPU_64|CPU_686, SUF_Q -cmovgew, cmovcc_insn, (0x0DUL<<8)|3, CPU_686, SUF_W -cmovl, cmovcc_insn, (0x0CUL<<8)|3, CPU_686, NONE -cmovll, cmovcc_insn, (0x0CUL<<8)|3, CPU_686, SUF_L -cmovlq, cmovcc_insn, (0x0CUL<<8)|3, CPU_64|CPU_686, SUF_Q -cmovlw, cmovcc_insn, (0x0CUL<<8)|3, CPU_686, SUF_W -cmovle, cmovcc_insn, (0x0EUL<<8)|3, CPU_686, NONE -cmovlel, cmovcc_insn, (0x0EUL<<8)|3, CPU_686, SUF_L -cmovleq, cmovcc_insn, (0x0EUL<<8)|3, CPU_64|CPU_686, SUF_Q -cmovlew, cmovcc_insn, (0x0EUL<<8)|3, CPU_686, SUF_W -cmovna, cmovcc_insn, (0x06UL<<8)|3, CPU_686, NONE -cmovnal, cmovcc_insn, (0x06UL<<8)|3, CPU_686, SUF_L -cmovnaq, cmovcc_insn, (0x06UL<<8)|3, CPU_64|CPU_686, SUF_Q -cmovnaw, cmovcc_insn, (0x06UL<<8)|3, CPU_686, SUF_W -cmovnae, cmovcc_insn, (0x02UL<<8)|3, CPU_686, NONE -cmovnael, cmovcc_insn, (0x02UL<<8)|3, CPU_686, SUF_L -cmovnaeq, cmovcc_insn, (0x02UL<<8)|3, CPU_64|CPU_686, SUF_Q -cmovnaew, cmovcc_insn, (0x02UL<<8)|3, CPU_686, SUF_W -cmovnb, cmovcc_insn, (0x03UL<<8)|3, CPU_686, NONE -cmovnbl, cmovcc_insn, (0x03UL<<8)|3, CPU_686, SUF_L -cmovnbq, cmovcc_insn, (0x03UL<<8)|3, CPU_64|CPU_686, SUF_Q -cmovnbw, cmovcc_insn, (0x03UL<<8)|3, CPU_686, SUF_W -cmovnbe, cmovcc_insn, (0x07UL<<8)|3, CPU_686, NONE -cmovnbel, cmovcc_insn, (0x07UL<<8)|3, CPU_686, SUF_L -cmovnbeq, cmovcc_insn, (0x07UL<<8)|3, CPU_64|CPU_686, SUF_Q -cmovnbew, cmovcc_insn, (0x07UL<<8)|3, CPU_686, SUF_W -cmovnc, cmovcc_insn, (0x03UL<<8)|3, CPU_686, NONE -cmovncl, cmovcc_insn, (0x03UL<<8)|3, CPU_686, SUF_L -cmovncq, cmovcc_insn, (0x03UL<<8)|3, CPU_64|CPU_686, SUF_Q -cmovncw, cmovcc_insn, (0x03UL<<8)|3, CPU_686, SUF_W -cmovne, cmovcc_insn, (0x05UL<<8)|3, CPU_686, NONE -cmovnel, cmovcc_insn, (0x05UL<<8)|3, CPU_686, SUF_L -cmovneq, cmovcc_insn, (0x05UL<<8)|3, CPU_64|CPU_686, SUF_Q -cmovnew, cmovcc_insn, (0x05UL<<8)|3, CPU_686, SUF_W -cmovng, cmovcc_insn, (0x0EUL<<8)|3, CPU_686, NONE -cmovngl, cmovcc_insn, (0x0EUL<<8)|3, CPU_686, SUF_L -cmovngq, cmovcc_insn, (0x0EUL<<8)|3, CPU_64|CPU_686, SUF_Q -cmovngw, cmovcc_insn, (0x0EUL<<8)|3, CPU_686, SUF_W -cmovnge, cmovcc_insn, (0x0CUL<<8)|3, CPU_686, NONE -cmovngel, cmovcc_insn, (0x0CUL<<8)|3, CPU_686, SUF_L -cmovngeq, cmovcc_insn, (0x0CUL<<8)|3, CPU_64|CPU_686, SUF_Q -cmovngew, cmovcc_insn, (0x0CUL<<8)|3, CPU_686, SUF_W -cmovnl, cmovcc_insn, (0x0DUL<<8)|3, CPU_686, NONE -cmovnll, cmovcc_insn, (0x0DUL<<8)|3, CPU_686, SUF_L -cmovnlq, cmovcc_insn, (0x0DUL<<8)|3, CPU_64|CPU_686, SUF_Q -cmovnlw, cmovcc_insn, (0x0DUL<<8)|3, CPU_686, SUF_W -cmovnle, cmovcc_insn, (0x0FUL<<8)|3, CPU_686, NONE -cmovnlel, cmovcc_insn, (0x0FUL<<8)|3, CPU_686, SUF_L -cmovnleq, cmovcc_insn, (0x0FUL<<8)|3, CPU_64|CPU_686, SUF_Q -cmovnlew, cmovcc_insn, (0x0FUL<<8)|3, CPU_686, SUF_W -cmovno, cmovcc_insn, (0x01UL<<8)|3, CPU_686, NONE -cmovnol, cmovcc_insn, (0x01UL<<8)|3, CPU_686, SUF_L -cmovnoq, cmovcc_insn, (0x01UL<<8)|3, CPU_64|CPU_686, SUF_Q -cmovnow, cmovcc_insn, (0x01UL<<8)|3, CPU_686, SUF_W -cmovnp, cmovcc_insn, (0x0BUL<<8)|3, CPU_686, NONE -cmovnpl, cmovcc_insn, (0x0BUL<<8)|3, CPU_686, SUF_L -cmovnpq, cmovcc_insn, (0x0BUL<<8)|3, CPU_64|CPU_686, SUF_Q -cmovnpw, cmovcc_insn, (0x0BUL<<8)|3, CPU_686, SUF_W -cmovns, cmovcc_insn, (0x09UL<<8)|3, CPU_686, NONE -cmovnsl, cmovcc_insn, (0x09UL<<8)|3, CPU_686, SUF_L -cmovnsq, cmovcc_insn, (0x09UL<<8)|3, CPU_64|CPU_686, SUF_Q -cmovnsw, cmovcc_insn, (0x09UL<<8)|3, CPU_686, SUF_W -cmovnz, cmovcc_insn, (0x05UL<<8)|3, CPU_686, NONE -cmovnzl, cmovcc_insn, (0x05UL<<8)|3, CPU_686, SUF_L -cmovnzq, cmovcc_insn, (0x05UL<<8)|3, CPU_64|CPU_686, SUF_Q -cmovnzw, cmovcc_insn, (0x05UL<<8)|3, CPU_686, SUF_W -cmovo, cmovcc_insn, (0x00UL<<8)|3, CPU_686, NONE -cmovol, cmovcc_insn, (0x00UL<<8)|3, CPU_686, SUF_L -cmovoq, cmovcc_insn, (0x00UL<<8)|3, CPU_64|CPU_686, SUF_Q -cmovow, cmovcc_insn, (0x00UL<<8)|3, CPU_686, SUF_W -cmovp, cmovcc_insn, (0x0AUL<<8)|3, CPU_686, NONE -cmovpl, cmovcc_insn, (0x0AUL<<8)|3, CPU_686, SUF_L -cmovpq, cmovcc_insn, (0x0AUL<<8)|3, CPU_64|CPU_686, SUF_Q -cmovpw, cmovcc_insn, (0x0AUL<<8)|3, CPU_686, SUF_W -cmovpe, cmovcc_insn, (0x0AUL<<8)|3, CPU_686, NONE -cmovpel, cmovcc_insn, (0x0AUL<<8)|3, CPU_686, SUF_L -cmovpeq, cmovcc_insn, (0x0AUL<<8)|3, CPU_64|CPU_686, SUF_Q -cmovpew, cmovcc_insn, (0x0AUL<<8)|3, CPU_686, SUF_W -cmovpo, cmovcc_insn, (0x0BUL<<8)|3, CPU_686, NONE -cmovpol, cmovcc_insn, (0x0BUL<<8)|3, CPU_686, SUF_L -cmovpoq, cmovcc_insn, (0x0BUL<<8)|3, CPU_64|CPU_686, SUF_Q -cmovpow, cmovcc_insn, (0x0BUL<<8)|3, CPU_686, SUF_W -cmovs, cmovcc_insn, (0x08UL<<8)|3, CPU_686, NONE -cmovsl, cmovcc_insn, (0x08UL<<8)|3, CPU_686, SUF_L -cmovsq, cmovcc_insn, (0x08UL<<8)|3, CPU_64|CPU_686, SUF_Q -cmovsw, cmovcc_insn, (0x08UL<<8)|3, CPU_686, SUF_W -cmovz, cmovcc_insn, (0x04UL<<8)|3, CPU_686, NONE -cmovzl, cmovcc_insn, (0x04UL<<8)|3, CPU_686, SUF_L -cmovzq, cmovcc_insn, (0x04UL<<8)|3, CPU_64|CPU_686, SUF_Q -cmovzw, cmovcc_insn, (0x04UL<<8)|3, CPU_686, SUF_W -cmp, arith_insn, (0x0738UL<<8)|22, CPU_Any, NONE -cmpb, arith_insn, (0x0738UL<<8)|22, CPU_Any, SUF_B -cmpl, arith_insn, (0x0738UL<<8)|22, CPU_386, SUF_L -cmpq, arith_insn, (0x0738UL<<8)|22, CPU_64, SUF_Q -cmpw, arith_insn, (0x0738UL<<8)|22, CPU_Any, SUF_W -cmpeqpd, ssecmpss_insn, (0x0066UL<<8)|1, CPU_SSE2, NONE -cmpeqps, ssecmpps_insn, (0x00UL<<8)|1, CPU_SSE, NONE -cmpeqsd, ssecmpss_insn, (0x00F2UL<<8)|1, CPU_SSE2, NONE -cmpeqss, ssecmpss_insn, (0x00F3UL<<8)|1, CPU_SSE, NONE -cmplepd, ssecmpss_insn, (0x0266UL<<8)|1, CPU_SSE2, NONE -cmpleps, ssecmpps_insn, (0x02UL<<8)|1, CPU_SSE, NONE -cmplesd, ssecmpss_insn, (0x02F2UL<<8)|1, CPU_SSE2, NONE -cmpless, ssecmpss_insn, (0x02F3UL<<8)|1, CPU_SSE, NONE -cmpltpd, ssecmpss_insn, (0x0166UL<<8)|1, CPU_SSE2, NONE -cmpltps, ssecmpps_insn, (0x01UL<<8)|1, CPU_SSE, NONE -cmpltsd, ssecmpss_insn, (0x01F2UL<<8)|1, CPU_SSE2, NONE -cmpltss, ssecmpss_insn, (0x01F3UL<<8)|1, CPU_SSE, NONE -cmpneqpd, ssecmpss_insn, (0x0466UL<<8)|1, CPU_SSE2, NONE -cmpneqps, ssecmpps_insn, (0x04UL<<8)|1, CPU_SSE, NONE -cmpneqsd, ssecmpss_insn, (0x04F2UL<<8)|1, CPU_SSE2, NONE -cmpneqss, ssecmpss_insn, (0x04F3UL<<8)|1, CPU_SSE, NONE -cmpnlepd, ssecmpss_insn, (0x0666UL<<8)|1, CPU_SSE2, NONE -cmpnleps, ssecmpps_insn, (0x06UL<<8)|1, CPU_SSE, NONE -cmpnlesd, ssecmpss_insn, (0x06F2UL<<8)|1, CPU_SSE2, NONE -cmpnless, ssecmpss_insn, (0x06F3UL<<8)|1, CPU_SSE, NONE -cmpnltpd, ssecmpss_insn, (0x0566UL<<8)|1, CPU_SSE2, NONE -cmpnltps, ssecmpps_insn, (0x05UL<<8)|1, CPU_SSE, NONE -cmpnltsd, ssecmpss_insn, (0x05F2UL<<8)|1, CPU_SSE2, NONE -cmpnltss, ssecmpss_insn, (0x05F3UL<<8)|1, CPU_SSE, NONE -cmpordpd, ssecmpss_insn, (0x0766UL<<8)|1, CPU_SSE2, NONE -cmpordps, ssecmpps_insn, (0x07UL<<8)|1, CPU_SSE, NONE -cmpordsd, ssecmpss_insn, (0x07F2UL<<8)|1, CPU_SSE2, NONE -cmpordss, ssecmpss_insn, (0x07F3UL<<8)|1, CPU_SSE, NONE -cmppd, ssessimm_insn, (0x66C2UL<<8)|1, CPU_SSE2, NONE -cmpps, ssepsimm_insn, (0xC2UL<<8)|1, CPU_SSE, NONE -cmpsb, onebyte_insn, (0x0000A6UL<<8)|1, CPU_Any, NONE -cmpsd, cmpsd_insn, (0UL<<8)|2, CPU_Any, NONE -cmpsl, onebyte_insn, (0x0020A7UL<<8)|1, CPU_386, NONE -cmpsq, onebyte_insn, (0x0040A7UL<<8)|1, CPU_64, NONE -cmpss, ssessimm_insn, (0xF3C2UL<<8)|1, CPU_SSE, NONE -cmpsw, onebyte_insn, (0x0010A7UL<<8)|1, CPU_Any, NONE -cmpunordpd, ssecmpss_insn, (0x0366UL<<8)|1, CPU_SSE2, NONE -cmpunordps, ssecmpps_insn, (0x03UL<<8)|1, CPU_SSE, NONE -cmpunordsd, ssecmpss_insn, (0x03F2UL<<8)|1, CPU_SSE2, NONE -cmpunordss, ssecmpss_insn, (0x03F3UL<<8)|1, CPU_SSE, NONE -cmpxchg, cmpxchgxadd_insn, (0xB0UL<<8)|4, CPU_486, NONE -cmpxchg16b, cmpxchg16b_insn, (0UL<<8)|1, CPU_64, NONE -cmpxchg8b, cmpxchg8b_insn, (0UL<<8)|1, CPU_586, NONE -cmpxchg8bq, cmpxchg8b_insn, (0UL<<8)|1, CPU_586, SUF_Q -cmpxchgb, cmpxchgxadd_insn, (0xB0UL<<8)|4, CPU_486, SUF_B -cmpxchgl, cmpxchgxadd_insn, (0xB0UL<<8)|4, CPU_486, SUF_L -cmpxchgq, cmpxchgxadd_insn, (0xB0UL<<8)|4, CPU_486|CPU_64, SUF_Q -cmpxchgw, cmpxchgxadd_insn, (0xB0UL<<8)|4, CPU_486, SUF_W -comisd, ssess_insn, (0x662FUL<<8)|1, CPU_SSE2, NONE -comiss, sseps_insn, (0x2FUL<<8)|1, CPU_SSE, NONE -cpuid, twobyte_insn, (0x0FA2UL<<8)|1, CPU_486, NONE -cqo, onebyte_insn, (0x004099UL<<8)|1, CPU_64, NONE -cqto, onebyte_insn, (0x004099UL<<8)|1, CPU_64, NONE -crc32, crc32_insn, (0UL<<8)|5, CPU_386|CPU_SSE42, NONE -crc32b, crc32_insn, (0UL<<8)|5, CPU_386|CPU_SSE42, SUF_B -crc32l, crc32_insn, (0UL<<8)|5, CPU_386|CPU_SSE42, SUF_L -crc32q, crc32_insn, (0UL<<8)|5, CPU_64|CPU_SSE42, SUF_Q -crc32w, crc32_insn, (0UL<<8)|5, CPU_386|CPU_SSE42, SUF_W -cvtdq2pd, cvt_xmm_xmm64_ss_insn, (0xF3E6UL<<8)|2, CPU_SSE2, NONE -cvtdq2ps, sseps_insn, (0x5BUL<<8)|1, CPU_SSE2, NONE -cvtpd2dq, ssess_insn, (0xF2E6UL<<8)|1, CPU_SSE2, NONE -cvtpd2pi, cvt_mm_xmm_insn, (0x662DUL<<8)|1, CPU_SSE2, NONE -cvtpd2ps, ssess_insn, (0x665AUL<<8)|1, CPU_SSE2, NONE -cvtpi2pd, cvt_xmm_mm_ss_insn, (0x662AUL<<8)|1, CPU_SSE2, NONE -cvtpi2ps, cvt_xmm_mm_ps_insn, (0x2AUL<<8)|1, CPU_SSE, NONE -cvtps2dq, ssess_insn, (0x665BUL<<8)|1, CPU_SSE2, NONE -cvtps2pd, cvt_xmm_xmm64_ps_insn, (0x5AUL<<8)|2, CPU_SSE2, NONE -cvtps2pi, cvt_mm_xmm64_insn, (0x2DUL<<8)|2, CPU_SSE, NONE -cvtsd2si, cvt_rx_xmm64_insn, (0xF22DUL<<8)|4, CPU_386|CPU_SSE2, NONE -cvtsd2sil, cvt_rx_xmm64_insn, (0xF22DUL<<8)|4, CPU_386|CPU_SSE2, SUF_L -cvtsd2siq, cvt_rx_xmm64_insn, (0xF22DUL<<8)|4, CPU_64|CPU_SSE2, SUF_Q -cvtsd2ss, cvt_xmm_xmm64_ss_insn, (0xF25AUL<<8)|2, CPU_SSE2, NONE -cvtsi2sd, cvt_xmm_rmx_insn, (0xF22AUL<<8)|2, CPU_SSE2, NONE -cvtsi2sdl, cvt_xmm_rmx_insn, (0xF22AUL<<8)|2, CPU_SSE2, SUF_L -cvtsi2sdq, cvt_xmm_rmx_insn, (0xF22AUL<<8)|2, CPU_SSE2, SUF_Q -cvtsi2ss, cvt_xmm_rmx_insn, (0xF32AUL<<8)|2, CPU_386|CPU_SSE, NONE -cvtsi2ssl, cvt_xmm_rmx_insn, (0xF32AUL<<8)|2, CPU_386|CPU_SSE, SUF_L -cvtsi2ssq, cvt_xmm_rmx_insn, (0xF32AUL<<8)|2, CPU_64|CPU_SSE, SUF_Q -cvtss2sd, cvt_xmm_xmm32_insn, (0xF35AUL<<8)|2, CPU_SSE2, NONE -cvtss2si, cvt_rx_xmm32_insn, (0xF32DUL<<8)|4, CPU_386|CPU_SSE, NONE -cvtss2sil, cvt_rx_xmm32_insn, (0xF32DUL<<8)|4, CPU_386|CPU_SSE, SUF_L -cvtss2siq, cvt_rx_xmm32_insn, (0xF32DUL<<8)|4, CPU_64|CPU_SSE, SUF_Q -cvttpd2dq, ssess_insn, (0x66E6UL<<8)|1, CPU_SSE2, NONE -cvttpd2pi, cvt_mm_xmm_insn, (0x662CUL<<8)|1, CPU_SSE2, NONE -cvttps2dq, ssess_insn, (0xF35BUL<<8)|1, CPU_SSE2, NONE -cvttps2pi, cvt_mm_xmm64_insn, (0x2CUL<<8)|2, CPU_SSE, NONE -cvttsd2si, cvt_rx_xmm64_insn, (0xF22CUL<<8)|4, CPU_SSE2, NONE -cvttsd2sil, cvt_rx_xmm64_insn, (0xF22CUL<<8)|4, CPU_SSE2, SUF_L -cvttsd2siq, cvt_rx_xmm64_insn, (0xF22CUL<<8)|4, CPU_SSE2, SUF_Q -cvttss2si, cvt_rx_xmm32_insn, (0xF32CUL<<8)|4, CPU_386|CPU_SSE, NONE -cvttss2sil, cvt_rx_xmm32_insn, (0xF32CUL<<8)|4, CPU_386|CPU_SSE, SUF_L -cvttss2siq, cvt_rx_xmm32_insn, (0xF32CUL<<8)|4, CPU_64|CPU_SSE, SUF_Q -cwd, onebyte_insn, (0x001099UL<<8)|1, CPU_Any, NONE -cwde, onebyte_insn, (0x002098UL<<8)|1, CPU_386, NONE -cwtd, onebyte_insn, (0x001099UL<<8)|1, CPU_Any, NONE -cwtl, onebyte_insn, (0x002098UL<<8)|1, CPU_386, NONE -daa, onebyte_insn, (0x000027UL<<8)|1, CPU_Not64, NONE -das, onebyte_insn, (0x00002FUL<<8)|1, CPU_Not64, NONE -data16, NULL, X86_OPERSIZE, 0x10, NONE -data32, NULL, X86_OPERSIZE, 0x20, NONE -data64, NULL, X86_OPERSIZE, 0x40, NONE -dec, incdec_insn, (0x0148UL<<8)|6, CPU_Any, NONE -decb, incdec_insn, (0x0148UL<<8)|6, CPU_Any, SUF_B -decl, incdec_insn, (0x0148UL<<8)|6, CPU_386, SUF_L -decq, incdec_insn, (0x0148UL<<8)|6, CPU_64, SUF_Q -decw, incdec_insn, (0x0148UL<<8)|6, CPU_Any, SUF_W -div, div_insn, (0x06UL<<8)|8, CPU_Any, NONE -divb, div_insn, (0x06UL<<8)|8, CPU_Any, SUF_B -divl, div_insn, (0x06UL<<8)|8, CPU_386, SUF_L -divq, div_insn, (0x06UL<<8)|8, CPU_64, SUF_Q -divw, div_insn, (0x06UL<<8)|8, CPU_Any, SUF_W -divpd, ssess_insn, (0x665EUL<<8)|1, CPU_SSE2, NONE -divps, sseps_insn, (0x5EUL<<8)|1, CPU_SSE, NONE -divsd, ssess_insn, (0xF25EUL<<8)|1, CPU_SSE2, NONE -divss, ssess_insn, (0xF35EUL<<8)|1, CPU_SSE, NONE -dppd, sse4imm_insn, (0x41UL<<8)|1, CPU_SSE41, NONE -dpps, sse4imm_insn, (0x40UL<<8)|1, CPU_SSE41, NONE -dword, NULL, X86_OPERSIZE, 0x20, NONE -emms, twobyte_insn, (0x0F77UL<<8)|1, CPU_MMX, NONE -enter, enter_insn, (0UL<<8)|3, CPU_186, NONE -enterl, enter_insn, (0UL<<8)|3, CPU_186|CPU_Not64, SUF_L -enterq, enter_insn, (0UL<<8)|3, CPU_186|CPU_64, SUF_Q -enterw, enter_insn, (0UL<<8)|3, CPU_186, SUF_W -extractps, extractps_insn, (0UL<<8)|2, CPU_386|CPU_SSE41, NONE -extrq, extrq_insn, (0UL<<8)|2, CPU_SSE41, NONE -f2xm1, twobyte_insn, (0xD9F0UL<<8)|1, CPU_FPU, NONE -fabs, twobyte_insn, (0xD9E1UL<<8)|1, CPU_FPU, NONE -fadd, farith_insn, (0x00C0C0UL<<8)|7, CPU_FPU, NONE -faddl, farith_insn, (0x00C0C0UL<<8)|7, CPU_FPU, SUF_L -fadds, farith_insn, (0x00C0C0UL<<8)|7, CPU_FPU, SUF_S -faddp, farithp_insn, (0xC0UL<<8)|3, CPU_FPU, NONE -fbld, fbldstp_insn, (0x04UL<<8)|1, CPU_FPU, NONE -fbstp, fbldstp_insn, (0x06UL<<8)|1, CPU_FPU, NONE -fchs, twobyte_insn, (0xD9E0UL<<8)|1, CPU_FPU, NONE -fclex, threebyte_insn, (0x9BDBE2UL<<8)|1, CPU_FPU, NONE -fcmovb, fcmovcc_insn, (0xDAC0UL<<8)|1, CPU_686|CPU_FPU, NONE -fcmovbe, fcmovcc_insn, (0xDAD0UL<<8)|1, CPU_686|CPU_FPU, NONE -fcmove, fcmovcc_insn, (0xDAC8UL<<8)|1, CPU_686|CPU_FPU, NONE -fcmovnb, fcmovcc_insn, (0xDBC0UL<<8)|1, CPU_686|CPU_FPU, NONE -fcmovnbe, fcmovcc_insn, (0xDBD0UL<<8)|1, CPU_686|CPU_FPU, NONE -fcmovne, fcmovcc_insn, (0xDBC8UL<<8)|1, CPU_686|CPU_FPU, NONE -fcmovnu, fcmovcc_insn, (0xDBD8UL<<8)|1, CPU_686|CPU_FPU, NONE -fcmovu, fcmovcc_insn, (0xDAD8UL<<8)|1, CPU_686|CPU_FPU, NONE -fcom, fcom_insn, (0x02D0UL<<8)|5, CPU_FPU, NONE -fcoml, fcom_insn, (0x02D0UL<<8)|5, CPU_FPU, SUF_L -fcoms, fcom_insn, (0x02D0UL<<8)|5, CPU_FPU, SUF_S -fcomi, fcom2_insn, (0xDBF0UL<<8)|2, CPU_686|CPU_FPU, NONE -fcomip, fcom2_insn, (0xDFF0UL<<8)|2, CPU_686|CPU_FPU, NONE -fcomp, fcom_insn, (0x03D8UL<<8)|5, CPU_FPU, NONE -fcompl, fcom_insn, (0x03D8UL<<8)|5, CPU_FPU, SUF_L -fcomps, fcom_insn, (0x03D8UL<<8)|5, CPU_FPU, SUF_S -fcompp, twobyte_insn, (0xDED9UL<<8)|1, CPU_FPU, NONE -fcos, twobyte_insn, (0xD9FFUL<<8)|1, CPU_286|CPU_FPU, NONE -fdecstp, twobyte_insn, (0xD9F6UL<<8)|1, CPU_FPU, NONE -fdiv, farith_insn, (0x06F0F8UL<<8)|7, CPU_FPU, NONE -fdivl, farith_insn, (0x06F0F8UL<<8)|7, CPU_FPU, SUF_L -fdivs, farith_insn, (0x06F0F8UL<<8)|7, CPU_FPU, SUF_S -fdivp, farithp_insn, (0xF0UL<<8)|3, CPU_FPU, NONE -fdivr, farith_insn, (0x07F8F0UL<<8)|7, CPU_FPU, NONE -fdivrl, farith_insn, (0x07F8F0UL<<8)|7, CPU_FPU, SUF_L -fdivrs, farith_insn, (0x07F8F0UL<<8)|7, CPU_FPU, SUF_S -fdivrp, farithp_insn, (0xF8UL<<8)|3, CPU_FPU, NONE -femms, twobyte_insn, (0x0F0EUL<<8)|1, CPU_3DNow, NONE -ffree, ffree_insn, (0xDDUL<<8)|1, CPU_FPU, NONE -ffreep, ffree_insn, (0xDFUL<<8)|1, CPU_686|CPU_FPU|CPU_Undoc, NONE -fiadd, fiarith_insn, (0x00DAUL<<8)|2, CPU_FPU, NONE -fiaddl, fiarith_insn, (0x00DAUL<<8)|2, CPU_FPU, SUF_L -fiadds, fiarith_insn, (0x00DAUL<<8)|2, CPU_FPU, SUF_S -ficom, fiarith_insn, (0x02DAUL<<8)|2, CPU_FPU, NONE -ficoml, fiarith_insn, (0x02DAUL<<8)|2, CPU_FPU, SUF_L -ficoms, fiarith_insn, (0x02DAUL<<8)|2, CPU_FPU, SUF_S -ficomp, fiarith_insn, (0x03DAUL<<8)|2, CPU_FPU, NONE -ficompl, fiarith_insn, (0x03DAUL<<8)|2, CPU_FPU, SUF_L -ficomps, fiarith_insn, (0x03DAUL<<8)|2, CPU_FPU, SUF_S -fidiv, fiarith_insn, (0x06DAUL<<8)|2, CPU_FPU, NONE -fidivl, fiarith_insn, (0x06DAUL<<8)|2, CPU_FPU, SUF_L -fidivs, fiarith_insn, (0x06DAUL<<8)|2, CPU_FPU, SUF_S -fidivr, fiarith_insn, (0x07DAUL<<8)|2, CPU_FPU, NONE -fidivrl, fiarith_insn, (0x07DAUL<<8)|2, CPU_FPU, SUF_L -fidivrs, fiarith_insn, (0x07DAUL<<8)|2, CPU_FPU, SUF_S -fild, fildstp_insn, (0x050200UL<<8)|3, CPU_FPU, NONE -fildl, fildstp_insn, (0x050200UL<<8)|3, CPU_FPU, SUF_L -fildq, fildstp_insn, (0x050200UL<<8)|3, CPU_FPU, SUF_Q -filds, fildstp_insn, (0x050200UL<<8)|3, CPU_FPU, SUF_S -fildll, fbldstp_insn, (0x05UL<<8)|1, CPU_FPU, NONE -fimul, fiarith_insn, (0x01DAUL<<8)|2, CPU_FPU, NONE -fimull, fiarith_insn, (0x01DAUL<<8)|2, CPU_FPU, SUF_L -fimuls, fiarith_insn, (0x01DAUL<<8)|2, CPU_FPU, SUF_S -fincstp, twobyte_insn, (0xD9F7UL<<8)|1, CPU_FPU, NONE -finit, threebyte_insn, (0x9BDBE3UL<<8)|1, CPU_FPU, NONE -fist, fiarith_insn, (0x02DBUL<<8)|2, CPU_FPU, NONE -fistl, fiarith_insn, (0x02DBUL<<8)|2, CPU_FPU, SUF_L -fists, fiarith_insn, (0x02DBUL<<8)|2, CPU_FPU, SUF_S -fistp, fildstp_insn, (0x070203UL<<8)|3, CPU_FPU, NONE -fistpl, fildstp_insn, (0x070203UL<<8)|3, CPU_FPU, SUF_L -fistpq, fildstp_insn, (0x070203UL<<8)|3, CPU_FPU, SUF_Q -fistps, fildstp_insn, (0x070203UL<<8)|3, CPU_FPU, SUF_S -fistpll, fbldstp_insn, (0x07UL<<8)|1, CPU_FPU, NONE -fisttp, fildstp_insn, (0x010001UL<<8)|3, CPU_SSE3, NONE -fisttpl, fildstp_insn, (0x010001UL<<8)|3, CPU_SSE3, SUF_L -fisttpq, fildstp_insn, (0x010001UL<<8)|3, CPU_SSE3, SUF_Q -fisttps, fildstp_insn, (0x010001UL<<8)|3, CPU_SSE3, SUF_S -fisttpll, fildstp_insn, (0x000007UL<<8)|3, CPU_SSE3, SUF_Q -fisub, fiarith_insn, (0x04DAUL<<8)|2, CPU_FPU, NONE -fisubl, fiarith_insn, (0x04DAUL<<8)|2, CPU_FPU, SUF_L -fisubs, fiarith_insn, (0x04DAUL<<8)|2, CPU_FPU, SUF_S -fisubr, fiarith_insn, (0x05DAUL<<8)|2, CPU_FPU, NONE -fisubrl, fiarith_insn, (0x05DAUL<<8)|2, CPU_FPU, SUF_L -fisubrs, fiarith_insn, (0x05DAUL<<8)|2, CPU_FPU, SUF_S -fld, fld_insn, (0UL<<8)|4, CPU_FPU, NONE -fld1, twobyte_insn, (0xD9E8UL<<8)|1, CPU_FPU, NONE -fldl, fld_insn, (0UL<<8)|4, CPU_FPU, SUF_L -flds, fld_insn, (0UL<<8)|4, CPU_FPU, SUF_S -fldcw, fldnstcw_insn, (0x05UL<<8)|1, CPU_FPU, NONE -fldcww, fldnstcw_insn, (0x05UL<<8)|1, CPU_FPU, SUF_W -fldenv, onebytemem_insn, (0x04D9UL<<8)|1, CPU_FPU, NONE -fldenvl, onebytemem_insn, (0x04D9UL<<8)|1, CPU_FPU, SUF_L -fldenvs, onebytemem_insn, (0x04D9UL<<8)|1, CPU_FPU, SUF_S -fldl2e, twobyte_insn, (0xD9EAUL<<8)|1, CPU_FPU, NONE -fldl2t, twobyte_insn, (0xD9E9UL<<8)|1, CPU_FPU, NONE -fldlg2, twobyte_insn, (0xD9ECUL<<8)|1, CPU_FPU, NONE -fldln2, twobyte_insn, (0xD9EDUL<<8)|1, CPU_FPU, NONE -fldpi, twobyte_insn, (0xD9EBUL<<8)|1, CPU_FPU, NONE -fldt, fldstpt_insn, (0x05UL<<8)|1, CPU_FPU, WEAK -fldz, twobyte_insn, (0xD9EEUL<<8)|1, CPU_FPU, NONE -fmul, farith_insn, (0x01C8C8UL<<8)|7, CPU_FPU, NONE -fmull, farith_insn, (0x01C8C8UL<<8)|7, CPU_FPU, SUF_L -fmuls, farith_insn, (0x01C8C8UL<<8)|7, CPU_FPU, SUF_S -fmulp, farithp_insn, (0xC8UL<<8)|3, CPU_FPU, NONE -fnclex, twobyte_insn, (0xDBE2UL<<8)|1, CPU_FPU, NONE -fninit, twobyte_insn, (0xDBE3UL<<8)|1, CPU_FPU, NONE -fnop, twobyte_insn, (0xD9D0UL<<8)|1, CPU_FPU, NONE -fnsave, onebytemem_insn, (0x06DDUL<<8)|1, CPU_FPU, NONE -fnsavel, onebytemem_insn, (0x06DDUL<<8)|1, CPU_FPU, SUF_L -fnsaves, onebytemem_insn, (0x06DDUL<<8)|1, CPU_FPU, SUF_S -fnstcw, fldnstcw_insn, (0x07UL<<8)|1, CPU_FPU, NONE -fnstcww, fldnstcw_insn, (0x07UL<<8)|1, CPU_FPU, SUF_W -fnstenv, onebytemem_insn, (0x06D9UL<<8)|1, CPU_FPU, NONE -fnstenvl, onebytemem_insn, (0x06D9UL<<8)|1, CPU_FPU, SUF_L -fnstenvs, onebytemem_insn, (0x06D9UL<<8)|1, CPU_FPU, SUF_S -fnstsw, fnstsw_insn, (0UL<<8)|2, CPU_FPU, NONE -fnstsww, fnstsw_insn, (0UL<<8)|2, CPU_FPU, SUF_W -fpatan, twobyte_insn, (0xD9F3UL<<8)|1, CPU_FPU, NONE -fprem, twobyte_insn, (0xD9F8UL<<8)|1, CPU_FPU, NONE -fprem1, twobyte_insn, (0xD9F5UL<<8)|1, CPU_286|CPU_FPU, NONE -fptan, twobyte_insn, (0xD9F2UL<<8)|1, CPU_FPU, NONE -frndint, twobyte_insn, (0xD9FCUL<<8)|1, CPU_FPU, NONE -frstor, onebytemem_insn, (0x04DDUL<<8)|1, CPU_FPU, NONE -frstorl, onebytemem_insn, (0x04DDUL<<8)|1, CPU_FPU, SUF_L -frstors, onebytemem_insn, (0x04DDUL<<8)|1, CPU_FPU, SUF_S -fsave, twobytemem_insn, (0x069BDDUL<<8)|1, CPU_FPU, NONE -fsavel, twobytemem_insn, (0x069BDDUL<<8)|1, CPU_FPU, SUF_L -fsaves, twobytemem_insn, (0x069BDDUL<<8)|1, CPU_FPU, SUF_S -fscale, twobyte_insn, (0xD9FDUL<<8)|1, CPU_FPU, NONE -fsetpm, twobyte_insn, (0xDBE4UL<<8)|1, CPU_286|CPU_FPU|CPU_Obs, NONE -fsin, twobyte_insn, (0xD9FEUL<<8)|1, CPU_286|CPU_FPU, NONE -fsincos, twobyte_insn, (0xD9FBUL<<8)|1, CPU_286|CPU_FPU, NONE -fsqrt, twobyte_insn, (0xD9FAUL<<8)|1, CPU_FPU, NONE -fst, fst_insn, (0UL<<8)|3, CPU_FPU, NONE -fstl, fst_insn, (0UL<<8)|3, CPU_FPU, SUF_L -fsts, fst_insn, (0UL<<8)|3, CPU_FPU, SUF_S -fstcw, fstcw_insn, (0UL<<8)|1, CPU_FPU, NONE -fstcww, fstcw_insn, (0UL<<8)|1, CPU_FPU, SUF_W -fstenv, twobytemem_insn, (0x069BD9UL<<8)|1, CPU_FPU, NONE -fstenvl, twobytemem_insn, (0x069BD9UL<<8)|1, CPU_FPU, SUF_L -fstenvs, twobytemem_insn, (0x069BD9UL<<8)|1, CPU_FPU, SUF_S -fstp, fstp_insn, (0UL<<8)|4, CPU_FPU, NONE -fstpl, fstp_insn, (0UL<<8)|4, CPU_FPU, SUF_L -fstps, fstp_insn, (0UL<<8)|4, CPU_FPU, SUF_S -fstpt, fldstpt_insn, (0x07UL<<8)|1, CPU_FPU, WEAK -fstsw, fstsw_insn, (0UL<<8)|2, CPU_FPU, NONE -fstsww, fstsw_insn, (0UL<<8)|2, CPU_FPU, SUF_W -fsub, farith_insn, (0x04E0E8UL<<8)|7, CPU_FPU, NONE -fsubl, farith_insn, (0x04E0E8UL<<8)|7, CPU_FPU, SUF_L -fsubs, farith_insn, (0x04E0E8UL<<8)|7, CPU_FPU, SUF_S -fsubp, farithp_insn, (0xE0UL<<8)|3, CPU_FPU, NONE -fsubr, farith_insn, (0x05E8E0UL<<8)|7, CPU_FPU, NONE -fsubrl, farith_insn, (0x05E8E0UL<<8)|7, CPU_FPU, SUF_L -fsubrs, farith_insn, (0x05E8E0UL<<8)|7, CPU_FPU, SUF_S -fsubrp, farithp_insn, (0xE8UL<<8)|3, CPU_FPU, NONE -ftst, twobyte_insn, (0xD9E4UL<<8)|1, CPU_FPU, NONE -fucom, fcom2_insn, (0xDDE0UL<<8)|2, CPU_286|CPU_FPU, NONE -fucomi, fcom2_insn, (0xDBE8UL<<8)|2, CPU_686|CPU_FPU, NONE -fucomip, fcom2_insn, (0xDFE8UL<<8)|2, CPU_686|CPU_FPU, NONE -fucomp, fcom2_insn, (0xDDE8UL<<8)|2, CPU_286|CPU_FPU, NONE -fucompp, twobyte_insn, (0xDAE9UL<<8)|1, CPU_286|CPU_FPU, NONE -fwait, onebyte_insn, (0x00009BUL<<8)|1, CPU_FPU, NONE -fxam, twobyte_insn, (0xD9E5UL<<8)|1, CPU_FPU, NONE -fxch, fxch_insn, (0UL<<8)|4, CPU_FPU, NONE -fxrstor, twobytemem_insn, (0x010FAEUL<<8)|1, CPU_686|CPU_FPU, NONE -fxrstorq, twobytemem_insn, (0x010FAEUL<<8)|1, CPU_686|CPU_FPU, SUF_Q -fxsave, twobytemem_insn, (0x000FAEUL<<8)|1, CPU_686|CPU_FPU, NONE -fxsaveq, twobytemem_insn, (0x000FAEUL<<8)|1, CPU_686|CPU_FPU, SUF_Q -fxtract, twobyte_insn, (0xD9F4UL<<8)|1, CPU_FPU, NONE -fyl2x, twobyte_insn, (0xD9F1UL<<8)|1, CPU_FPU, NONE -fyl2xp1, twobyte_insn, (0xD9F9UL<<8)|1, CPU_FPU, NONE -haddpd, ssess_insn, (0x667CUL<<8)|1, CPU_SSE3, NONE -haddps, ssess_insn, (0xF27CUL<<8)|1, CPU_SSE3, NONE -hlt, onebyte_insn, (0x0000F4UL<<8)|1, CPU_Priv, NONE -hnt, NULL, X86_SEGREG, 0x2E, NONE -hsubpd, ssess_insn, (0x667DUL<<8)|1, CPU_SSE3, NONE -hsubps, ssess_insn, (0xF27DUL<<8)|1, CPU_SSE3, NONE -ht, NULL, X86_SEGREG, 0x3E, NONE -ibts, ibts_insn, (0UL<<8)|2, CPU_386|CPU_Obs|CPU_Undoc, NONE -idiv, div_insn, (0x07UL<<8)|8, CPU_Any, NONE -idivb, div_insn, (0x07UL<<8)|8, CPU_Any, SUF_B -idivl, div_insn, (0x07UL<<8)|8, CPU_386, SUF_L -idivq, div_insn, (0x07UL<<8)|8, CPU_64, SUF_Q -idivw, div_insn, (0x07UL<<8)|8, CPU_Any, SUF_W -imul, imul_insn, (0UL<<8)|19, CPU_Any, NONE -imulb, imul_insn, (0UL<<8)|19, CPU_Any, SUF_B -imull, imul_insn, (0UL<<8)|19, CPU_386, SUF_L -imulq, imul_insn, (0UL<<8)|19, CPU_64, SUF_Q -imulw, imul_insn, (0UL<<8)|19, CPU_Any, SUF_W -in, in_insn, (0UL<<8)|12, CPU_Any, NONE -inb, in_insn, (0UL<<8)|12, CPU_Any, SUF_B -inl, in_insn, (0UL<<8)|12, CPU_386, SUF_L -inw, in_insn, (0UL<<8)|12, CPU_Any, SUF_W -inc, incdec_insn, (0x0040UL<<8)|6, CPU_Any, NONE -incb, incdec_insn, (0x0040UL<<8)|6, CPU_Any, SUF_B -incl, incdec_insn, (0x0040UL<<8)|6, CPU_386, SUF_L -incq, incdec_insn, (0x0040UL<<8)|6, CPU_64, SUF_Q -incw, incdec_insn, (0x0040UL<<8)|6, CPU_Any, SUF_W -insb, onebyte_insn, (0x00006CUL<<8)|1, CPU_Any, NONE -insertps, insertps_insn, (0UL<<8)|2, CPU_SSE41, NONE -insertq, insertq_insn, (0UL<<8)|2, CPU_SSE41, NONE -insl, onebyte_insn, (0x00206DUL<<8)|1, CPU_386, NONE -insw, onebyte_insn, (0x00106DUL<<8)|1, CPU_Any, NONE -int, int_insn, (0UL<<8)|1, CPU_Any, NONE -int3, onebyte_insn, (0x0000CCUL<<8)|1, CPU_Any, NONE -into, onebyte_insn, (0x0000CEUL<<8)|1, CPU_Not64, NONE -invd, twobyte_insn, (0x0F08UL<<8)|1, CPU_486|CPU_Priv, NONE -invlpg, twobytemem_insn, (0x070F01UL<<8)|1, CPU_486|CPU_Priv, NONE -invlpga, invlpga_insn, (0UL<<8)|2, CPU_SVM, NONE -iret, onebyte_insn, (0x0000CFUL<<8)|1, CPU_Any, NONE -iretl, onebyte_insn, (0x0020CFUL<<8)|1, CPU_386, NONE -iretq, onebyte_insn, (0x0040CFUL<<8)|1, CPU_64, NONE -iretw, onebyte_insn, (0x0010CFUL<<8)|1, CPU_Any, NONE -ja, jcc_insn, (0x07UL<<8)|9, CPU_Any, NONE -jae, jcc_insn, (0x03UL<<8)|9, CPU_Any, NONE -jb, jcc_insn, (0x02UL<<8)|9, CPU_Any, NONE -jbe, jcc_insn, (0x06UL<<8)|9, CPU_Any, NONE -jc, jcc_insn, (0x02UL<<8)|9, CPU_Any, NONE -jcxz, jcxz_insn, (0x10UL<<8)|2, CPU_Any, NONE -je, jcc_insn, (0x04UL<<8)|9, CPU_Any, NONE -jecxz, jcxz_insn, (0x20UL<<8)|2, CPU_386, NONE -jg, jcc_insn, (0x0FUL<<8)|9, CPU_Any, NONE -jge, jcc_insn, (0x0DUL<<8)|9, CPU_Any, NONE -jl, jcc_insn, (0x0CUL<<8)|9, CPU_Any, NONE -jle, jcc_insn, (0x0EUL<<8)|9, CPU_Any, NONE -jmp, jmp_insn, (0UL<<8)|27, CPU_Any, NONE -jna, jcc_insn, (0x06UL<<8)|9, CPU_Any, NONE -jnae, jcc_insn, (0x02UL<<8)|9, CPU_Any, NONE -jnb, jcc_insn, (0x03UL<<8)|9, CPU_Any, NONE -jnbe, jcc_insn, (0x07UL<<8)|9, CPU_Any, NONE -jnc, jcc_insn, (0x03UL<<8)|9, CPU_Any, NONE -jne, jcc_insn, (0x05UL<<8)|9, CPU_Any, NONE -jng, jcc_insn, (0x0EUL<<8)|9, CPU_Any, NONE -jnge, jcc_insn, (0x0CUL<<8)|9, CPU_Any, NONE -jnl, jcc_insn, (0x0DUL<<8)|9, CPU_Any, NONE -jnle, jcc_insn, (0x0FUL<<8)|9, CPU_Any, NONE -jno, jcc_insn, (0x01UL<<8)|9, CPU_Any, NONE -jnp, jcc_insn, (0x0BUL<<8)|9, CPU_Any, NONE -jns, jcc_insn, (0x09UL<<8)|9, CPU_Any, NONE -jnz, jcc_insn, (0x05UL<<8)|9, CPU_Any, NONE -jo, jcc_insn, (0x00UL<<8)|9, CPU_Any, NONE -jp, jcc_insn, (0x0AUL<<8)|9, CPU_Any, NONE -jpe, jcc_insn, (0x0AUL<<8)|9, CPU_Any, NONE -jpo, jcc_insn, (0x0BUL<<8)|9, CPU_Any, NONE -jrcxz, jcxz_insn, (0x40UL<<8)|2, CPU_64, NONE -js, jcc_insn, (0x08UL<<8)|9, CPU_Any, NONE -jz, jcc_insn, (0x04UL<<8)|9, CPU_Any, NONE -lahf, onebyte_insn, (0x00009FUL<<8)|1, CPU_Any, NONE -lar, bsfr_insn, (0x02UL<<8)|3, CPU_286|CPU_Prot, NONE -larl, bsfr_insn, (0x02UL<<8)|3, CPU_286|CPU_Prot, SUF_L -larq, bsfr_insn, (0x02UL<<8)|3, CPU_286|CPU_Prot, SUF_Q -larw, bsfr_insn, (0x02UL<<8)|3, CPU_286|CPU_Prot, SUF_W -lddqu, lddqu_insn, (0UL<<8)|1, CPU_SSE3, NONE -ldmxcsr, ldstmxcsr_insn, (0x02UL<<8)|1, CPU_SSE, NONE -lds, ldes_insn, (0xC5UL<<8)|2, CPU_Not64, NONE -ldsl, ldes_insn, (0xC5UL<<8)|2, CPU_386|CPU_Not64, SUF_L -ldsw, ldes_insn, (0xC5UL<<8)|2, CPU_Not64, SUF_W -lea, lea_insn, (0UL<<8)|3, CPU_Any, NONE -leal, lea_insn, (0UL<<8)|3, CPU_386, SUF_L -leaq, lea_insn, (0UL<<8)|3, CPU_64, SUF_Q -leaw, lea_insn, (0UL<<8)|3, CPU_Any, SUF_W -leave, onebyte_insn, (0x4000C9UL<<8)|1, CPU_186, NONE -leavel, onebyte_insn, (0x4000C9UL<<8)|1, CPU_186, NONE -leaveq, onebyte_insn, (0x4000C9UL<<8)|1, CPU_64, NONE -leavew, onebyte_insn, (0x0010C9UL<<8)|1, CPU_186, NONE -les, ldes_insn, (0xC4UL<<8)|2, CPU_Not64, NONE -lesl, ldes_insn, (0xC4UL<<8)|2, CPU_386|CPU_Not64, SUF_L -lesw, ldes_insn, (0xC4UL<<8)|2, CPU_Not64, SUF_W -lfence, threebyte_insn, (0x0FAEE8UL<<8)|1, CPU_P3, NONE -lfs, lfgss_insn, (0xB4UL<<8)|2, CPU_386, NONE -lfsl, lfgss_insn, (0xB4UL<<8)|2, CPU_386, SUF_L -lfsw, lfgss_insn, (0xB4UL<<8)|2, CPU_386, SUF_W -lgdt, twobytemem_insn, (0x020F01UL<<8)|1, CPU_286|CPU_Priv, NONE -lgdtl, twobytemem_insn, (0x020F01UL<<8)|1, CPU_286|CPU_Priv, SUF_L -lgdtq, twobytemem_insn, (0x020F01UL<<8)|1, CPU_286|CPU_Priv, SUF_Q -lgdtw, twobytemem_insn, (0x020F01UL<<8)|1, CPU_286|CPU_Priv, SUF_W -lgs, lfgss_insn, (0xB5UL<<8)|2, CPU_386, NONE -lgsl, lfgss_insn, (0xB5UL<<8)|2, CPU_386, SUF_L -lgsw, lfgss_insn, (0xB5UL<<8)|2, CPU_386, SUF_W -lidt, twobytemem_insn, (0x030F01UL<<8)|1, CPU_286|CPU_Priv, NONE -lidtl, twobytemem_insn, (0x030F01UL<<8)|1, CPU_286|CPU_Priv, SUF_L -lidtq, twobytemem_insn, (0x030F01UL<<8)|1, CPU_286|CPU_Priv, SUF_Q -lidtw, twobytemem_insn, (0x030F01UL<<8)|1, CPU_286|CPU_Priv, SUF_W -lldt, prot286_insn, (0x0200UL<<8)|1, CPU_286|CPU_Priv|CPU_Prot, NONE -lldtw, prot286_insn, (0x0200UL<<8)|1, CPU_286|CPU_Priv|CPU_Prot, SUF_W -lmsw, prot286_insn, (0x0601UL<<8)|1, CPU_286|CPU_Priv, NONE -lmsww, prot286_insn, (0x0601UL<<8)|1, CPU_286|CPU_Priv, SUF_W -loadall, twobyte_insn, (0x0F07UL<<8)|1, CPU_386|CPU_Undoc, NONE -loadall286, twobyte_insn, (0x0F05UL<<8)|1, CPU_286|CPU_Undoc, NONE -lock, NULL, X86_LOCKREP, 0xF0, NONE -lodsb, onebyte_insn, (0x0000ACUL<<8)|1, CPU_Any, NONE -lodsl, onebyte_insn, (0x0020ADUL<<8)|1, CPU_386, NONE -lodsq, onebyte_insn, (0x0040ADUL<<8)|1, CPU_64, NONE -lodsw, onebyte_insn, (0x0010ADUL<<8)|1, CPU_Any, NONE -loop, loop_insn, (0x02UL<<8)|8, CPU_Any, NONE -loope, loop_insn, (0x01UL<<8)|8, CPU_Any, NONE -loopne, loop_insn, (0x00UL<<8)|8, CPU_Any, NONE -loopnz, loop_insn, (0x00UL<<8)|8, CPU_Any, NONE -loopz, loop_insn, (0x01UL<<8)|8, CPU_Any, NONE -lretl, retnf_insn, (0x00CAUL<<8)|6, CPU_Any, NONE -lretq, retnf_insn, (0x40CAUL<<8)|6, CPU_64, NONE -lretw, retnf_insn, (0x10CAUL<<8)|6, CPU_Any, NONE -lsl, bsfr_insn, (0x03UL<<8)|3, CPU_286|CPU_Prot, NONE -lsll, bsfr_insn, (0x03UL<<8)|3, CPU_286|CPU_Prot, SUF_L -lslq, bsfr_insn, (0x03UL<<8)|3, CPU_286|CPU_Prot, SUF_Q -lslw, bsfr_insn, (0x03UL<<8)|3, CPU_286|CPU_Prot, SUF_W -lss, lfgss_insn, (0xB2UL<<8)|2, CPU_386, NONE -lssl, lfgss_insn, (0xB2UL<<8)|2, CPU_386, SUF_L -lssw, lfgss_insn, (0xB2UL<<8)|2, CPU_386, SUF_W -ltr, prot286_insn, (0x0300UL<<8)|1, CPU_286|CPU_Priv|CPU_Prot, NONE -ltrw, prot286_insn, (0x0300UL<<8)|1, CPU_286|CPU_Priv|CPU_Prot, SUF_W -lzcnt, cnt_insn, (0xBDUL<<8)|3, CPU_686|CPU_AMD, NONE -lzcntl, cnt_insn, (0xBDUL<<8)|3, CPU_686|CPU_AMD, SUF_L -lzcntq, cnt_insn, (0xBDUL<<8)|3, CPU_686|CPU_AMD, SUF_Q -lzcntw, cnt_insn, (0xBDUL<<8)|3, CPU_686|CPU_AMD, SUF_W -maskmovdqu, maskmovdqu_insn, (0UL<<8)|1, CPU_SSE2, NONE -maskmovq, maskmovq_insn, (0UL<<8)|1, CPU_MMX|CPU_P3, NONE -maxpd, ssess_insn, (0x665FUL<<8)|1, CPU_SSE2, NONE -maxps, sseps_insn, (0x5FUL<<8)|1, CPU_SSE, NONE -maxsd, ssess_insn, (0xF25FUL<<8)|1, CPU_SSE2, NONE -maxss, ssess_insn, (0xF35FUL<<8)|1, CPU_SSE, NONE -mfence, threebyte_insn, (0x0FAEF0UL<<8)|1, CPU_P3, NONE -minpd, ssess_insn, (0x665DUL<<8)|1, CPU_SSE2, NONE -minps, sseps_insn, (0x5DUL<<8)|1, CPU_SSE, NONE -minsd, ssess_insn, (0xF25DUL<<8)|1, CPU_SSE2, NONE -minss, ssess_insn, (0xF35DUL<<8)|1, CPU_SSE, NONE -monitor, threebyte_insn, (0x0F01C8UL<<8)|1, CPU_SSE3, NONE -montmul, padlock_insn, (0xC0F3A6UL<<8)|1, CPU_PadLock, NONE -mov, mov_insn, (0UL<<8)|69, CPU_Any, NONE -movb, mov_insn, (0UL<<8)|69, CPU_Any, SUF_B -movl, mov_insn, (0UL<<8)|69, CPU_386, SUF_L -movq, mov_insn, (0UL<<8)|69, CPU_Any, SUF_Q -movw, mov_insn, (0UL<<8)|69, CPU_Any, SUF_W -movabs, movabs_insn, (0UL<<8)|9, CPU_64, NONE -movabsb, movabs_insn, (0UL<<8)|9, CPU_64, SUF_B -movabsl, movabs_insn, (0UL<<8)|9, CPU_64, SUF_L -movabsq, movabs_insn, (0UL<<8)|9, CPU_64, SUF_Q -movabsw, movabs_insn, (0UL<<8)|9, CPU_64, SUF_W -movapd, movaupd_insn, (0x28UL<<8)|2, CPU_SSE2, NONE -movaps, movaups_insn, (0x28UL<<8)|2, CPU_SSE, NONE -movd, movd_insn, (0UL<<8)|8, CPU_386|CPU_MMX, NONE -movddup, cvt_xmm_xmm64_ss_insn, (0xF212UL<<8)|2, CPU_SSE3, NONE -movdq2q, movdq2q_insn, (0UL<<8)|1, CPU_SSE2, NONE -movdqa, movdqau_insn, (0x66UL<<8)|2, CPU_SSE2, NONE -movdqu, movdqau_insn, (0xF3UL<<8)|2, CPU_SSE2, NONE -movhlps, movhllhps_insn, (0x12UL<<8)|1, CPU_SSE, NONE -movhpd, movhlpd_insn, (0x16UL<<8)|2, CPU_SSE2, NONE -movhps, movhlps_insn, (0x16UL<<8)|2, CPU_SSE, NONE -movlhps, movhllhps_insn, (0x16UL<<8)|1, CPU_SSE, NONE -movlpd, movhlpd_insn, (0x12UL<<8)|2, CPU_SSE2, NONE -movlps, movhlps_insn, (0x12UL<<8)|2, CPU_SSE, NONE -movmskpd, movmskpd_insn, (0UL<<8)|2, CPU_386|CPU_SSE2, NONE -movmskpdl, movmskpd_insn, (0UL<<8)|2, CPU_386|CPU_SSE2, SUF_L -movmskpdq, movmskpd_insn, (0UL<<8)|2, CPU_64|CPU_SSE2, SUF_Q -movmskps, movmskps_insn, (0UL<<8)|2, CPU_386|CPU_SSE, NONE -movmskpsl, movmskps_insn, (0UL<<8)|2, CPU_386|CPU_SSE, SUF_L -movmskpsq, movmskps_insn, (0UL<<8)|2, CPU_64|CPU_SSE, SUF_Q -movntdq, movntpddq_insn, (0xE7UL<<8)|1, CPU_SSE2, NONE -movntdqa, movntdqa_insn, (0UL<<8)|1, CPU_SSE41, NONE -movnti, movnti_insn, (0UL<<8)|2, CPU_P4, NONE -movntil, movnti_insn, (0UL<<8)|2, CPU_P4, SUF_L -movntiq, movnti_insn, (0UL<<8)|2, CPU_64|CPU_P4, SUF_Q -movntpd, movntpddq_insn, (0x2BUL<<8)|1, CPU_SSE2, NONE -movntps, movntps_insn, (0UL<<8)|1, CPU_SSE, NONE -movntq, movntq_insn, (0UL<<8)|1, CPU_SSE, NONE -movntsd, movntsd_insn, (0UL<<8)|1, CPU_SSE41, NONE -movntss, movntss_insn, (0UL<<8)|1, CPU_SSE41, NONE -movq2dq, movq2dq_insn, (0UL<<8)|1, CPU_SSE2, NONE -movsb, onebyte_insn, (0x0000A4UL<<8)|1, CPU_Any, NONE -movsbl, movszx_insn, (0xBEUL<<8)|5, CPU_386, SUF_B -movsbq, movszx_insn, (0xBEUL<<8)|5, CPU_64, SUF_B -movsbw, movszx_insn, (0xBEUL<<8)|5, CPU_386, SUF_B -movsd, movsd_insn, (0UL<<8)|4, CPU_386, NONE -movshdup, ssess_insn, (0xF316UL<<8)|1, CPU_SSE3, NONE -movsl, onebyte_insn, (0x0020A5UL<<8)|1, CPU_386, NONE -movsldup, ssess_insn, (0xF312UL<<8)|1, CPU_SSE3, NONE -movslq, movsxd_insn, (0UL<<8)|1, CPU_64, SUF_L -movsq, onebyte_insn, (0x0040A5UL<<8)|1, CPU_64, NONE -movss, movss_insn, (0UL<<8)|3, CPU_SSE, NONE -movsw, onebyte_insn, (0x0010A5UL<<8)|1, CPU_Any, NONE -movswl, movszx_insn, (0xBEUL<<8)|5, CPU_386, SUF_W -movswq, movszx_insn, (0xBEUL<<8)|5, CPU_64, SUF_W -movsx, movszx_insn, (0xBEUL<<8)|5, CPU_386, NONE -movsxb, movszx_insn, (0xBEUL<<8)|5, CPU_386, SUF_B -movsxw, movszx_insn, (0xBEUL<<8)|5, CPU_386, SUF_W -movupd, movaupd_insn, (0x10UL<<8)|2, CPU_SSE2, NONE -movups, movaups_insn, (0x10UL<<8)|2, CPU_SSE, NONE -movzbl, movszx_insn, (0xB6UL<<8)|5, CPU_386, SUF_B -movzbq, movszx_insn, (0xB6UL<<8)|5, CPU_64, SUF_B -movzbw, movszx_insn, (0xB6UL<<8)|5, CPU_386, SUF_B -movzwl, movszx_insn, (0xB6UL<<8)|5, CPU_386, SUF_W -movzwq, movszx_insn, (0xB6UL<<8)|5, CPU_64, SUF_W -movzx, movszx_insn, (0xB6UL<<8)|5, CPU_386, NONE -movzxb, movszx_insn, (0xB6UL<<8)|5, CPU_386, SUF_B -movzxw, movszx_insn, (0xB6UL<<8)|5, CPU_386, SUF_W -mpsadbw, sse4imm_insn, (0x42UL<<8)|1, CPU_SSE41, NONE -mul, f6_insn, (0x04UL<<8)|4, CPU_Any, NONE -mulb, f6_insn, (0x04UL<<8)|4, CPU_Any, SUF_B -mull, f6_insn, (0x04UL<<8)|4, CPU_386, SUF_L -mulq, f6_insn, (0x04UL<<8)|4, CPU_64, SUF_Q -mulw, f6_insn, (0x04UL<<8)|4, CPU_Any, SUF_W -mulpd, ssess_insn, (0x6659UL<<8)|1, CPU_SSE2, NONE -mulps, sseps_insn, (0x59UL<<8)|1, CPU_SSE, NONE -mulsd, ssess_insn, (0xF259UL<<8)|1, CPU_SSE2, NONE -mulss, ssess_insn, (0xF359UL<<8)|1, CPU_SSE, NONE -mwait, threebyte_insn, (0x0F01C9UL<<8)|1, CPU_SSE3, NONE -neg, f6_insn, (0x03UL<<8)|4, CPU_Any, NONE -negb, f6_insn, (0x03UL<<8)|4, CPU_Any, SUF_B -negl, f6_insn, (0x03UL<<8)|4, CPU_386, SUF_L -negq, f6_insn, (0x03UL<<8)|4, CPU_64, SUF_Q -negw, f6_insn, (0x03UL<<8)|4, CPU_Any, SUF_W -nop, onebyte_insn, (0x000090UL<<8)|1, CPU_Any, NONE -not, f6_insn, (0x02UL<<8)|4, CPU_Any, NONE -notb, f6_insn, (0x02UL<<8)|4, CPU_Any, SUF_B -notl, f6_insn, (0x02UL<<8)|4, CPU_386, SUF_L -notq, f6_insn, (0x02UL<<8)|4, CPU_64, SUF_Q -notw, f6_insn, (0x02UL<<8)|4, CPU_Any, SUF_W -or, arith_insn, (0x0108UL<<8)|22, CPU_Any, NONE -orb, arith_insn, (0x0108UL<<8)|22, CPU_Any, SUF_B -orl, arith_insn, (0x0108UL<<8)|22, CPU_386, SUF_L -orq, arith_insn, (0x0108UL<<8)|22, CPU_64, SUF_Q -orw, arith_insn, (0x0108UL<<8)|22, CPU_Any, SUF_W -orpd, ssess_insn, (0x6656UL<<8)|1, CPU_SSE2, NONE -orps, sseps_insn, (0x56UL<<8)|1, CPU_SSE, NONE -out, out_insn, (0UL<<8)|12, CPU_Any, NONE -outb, out_insn, (0UL<<8)|12, CPU_Any, SUF_B -outl, out_insn, (0UL<<8)|12, CPU_386, SUF_L -outw, out_insn, (0UL<<8)|12, CPU_Any, SUF_W -outsb, onebyte_insn, (0x00006EUL<<8)|1, CPU_Any, NONE -outsl, onebyte_insn, (0x00206FUL<<8)|1, CPU_386, NONE -outsw, onebyte_insn, (0x00106FUL<<8)|1, CPU_Any, NONE -pabsb, ssse3_insn, (0x1CUL<<8)|2, CPU_SSSE3, NONE -pabsd, ssse3_insn, (0x1EUL<<8)|2, CPU_SSSE3, NONE -pabsw, ssse3_insn, (0x1DUL<<8)|2, CPU_SSSE3, NONE -packssdw, mmxsse2_insn, (0x6BUL<<8)|2, CPU_MMX, NONE -packsswb, mmxsse2_insn, (0x63UL<<8)|2, CPU_MMX, NONE -packusdw, sse4_insn, (0x2BUL<<8)|1, CPU_SSE41, NONE -packuswb, mmxsse2_insn, (0x67UL<<8)|2, CPU_MMX, NONE -paddb, mmxsse2_insn, (0xFCUL<<8)|2, CPU_MMX, NONE -paddd, mmxsse2_insn, (0xFEUL<<8)|2, CPU_MMX, NONE -paddq, mmxsse2_insn, (0xD4UL<<8)|2, CPU_MMX, NONE -paddsb, mmxsse2_insn, (0xECUL<<8)|2, CPU_MMX, NONE -paddsiw, cyrixmmx_insn, (0x51UL<<8)|1, CPU_Cyrix|CPU_MMX, NONE -paddsw, mmxsse2_insn, (0xEDUL<<8)|2, CPU_MMX, NONE -paddusb, mmxsse2_insn, (0xDCUL<<8)|2, CPU_MMX, NONE -paddusw, mmxsse2_insn, (0xDDUL<<8)|2, CPU_MMX, NONE -paddw, mmxsse2_insn, (0xFDUL<<8)|2, CPU_MMX, NONE -palignr, ssse3imm_insn, (0x0FUL<<8)|2, CPU_SSSE3, NONE -pand, mmxsse2_insn, (0xDBUL<<8)|2, CPU_MMX, NONE -pandn, mmxsse2_insn, (0xDFUL<<8)|2, CPU_MMX, NONE -pause, onebyte_prefix_insn, (0xF390UL<<8)|1, CPU_P4, NONE -paveb, cyrixmmx_insn, (0x50UL<<8)|1, CPU_Cyrix|CPU_MMX, NONE -pavgb, mmxsse2_insn, (0xE0UL<<8)|2, CPU_MMX|CPU_P3, NONE -pavgusb, now3d_insn, (0xBFUL<<8)|1, CPU_3DNow, NONE -pavgw, mmxsse2_insn, (0xE3UL<<8)|2, CPU_MMX|CPU_P3, NONE -pblendvb, sse4xmm0_insn, (0x10UL<<8)|2, CPU_SSE41, NONE -pblendw, sse4imm_insn, (0x0EUL<<8)|1, CPU_SSE41, NONE -pcmpeqb, mmxsse2_insn, (0x74UL<<8)|2, CPU_MMX, NONE -pcmpeqd, mmxsse2_insn, (0x76UL<<8)|2, CPU_MMX, NONE -pcmpeqq, sse4_insn, (0x29UL<<8)|1, CPU_SSE41, NONE -pcmpeqw, mmxsse2_insn, (0x75UL<<8)|2, CPU_MMX, NONE -pcmpestri, sse4pcmpstr_insn, (0x61UL<<8)|1, CPU_SSE42, NONE -pcmpestrm, sse4pcmpstr_insn, (0x60UL<<8)|1, CPU_SSE42, NONE -pcmpgtb, mmxsse2_insn, (0x64UL<<8)|2, CPU_MMX, NONE -pcmpgtd, mmxsse2_insn, (0x66UL<<8)|2, CPU_MMX, NONE -pcmpgtq, sse4_insn, (0x37UL<<8)|1, CPU_SSE41, NONE -pcmpgtw, mmxsse2_insn, (0x65UL<<8)|2, CPU_MMX, NONE -pcmpistri, sse4pcmpstr_insn, (0x63UL<<8)|1, CPU_SSE42, NONE -pcmpistrm, sse4pcmpstr_insn, (0x62UL<<8)|1, CPU_SSE42, NONE -pdistib, cyrixmmx_insn, (0x54UL<<8)|1, CPU_Cyrix|CPU_MMX, NONE -pextrb, pextrb_insn, (0UL<<8)|3, CPU_SSE41, NONE -pextrd, pextrd_insn, (0UL<<8)|1, CPU_386|CPU_SSE41, NONE -pextrq, pextrq_insn, (0UL<<8)|1, CPU_64|CPU_SSE41, NONE -pextrw, pextrw_insn, (0UL<<8)|7, CPU_MMX|CPU_P3, NONE -pextrwl, pextrw_insn, (0UL<<8)|7, CPU_MMX|CPU_P3, SUF_L -pextrwq, pextrw_insn, (0UL<<8)|7, CPU_64|CPU_MMX|CPU_P3, SUF_Q -pf2id, now3d_insn, (0x1DUL<<8)|1, CPU_3DNow, NONE -pf2iw, now3d_insn, (0x1CUL<<8)|1, CPU_3DNow|CPU_Athlon, NONE -pfacc, now3d_insn, (0xAEUL<<8)|1, CPU_3DNow, NONE -pfadd, now3d_insn, (0x9EUL<<8)|1, CPU_3DNow, NONE -pfcmpeq, now3d_insn, (0xB0UL<<8)|1, CPU_3DNow, NONE -pfcmpge, now3d_insn, (0x90UL<<8)|1, CPU_3DNow, NONE -pfcmpgt, now3d_insn, (0xA0UL<<8)|1, CPU_3DNow, NONE -pfmax, now3d_insn, (0xA4UL<<8)|1, CPU_3DNow, NONE -pfmin, now3d_insn, (0x94UL<<8)|1, CPU_3DNow, NONE -pfmul, now3d_insn, (0xB4UL<<8)|1, CPU_3DNow, NONE -pfnacc, now3d_insn, (0x8AUL<<8)|1, CPU_3DNow|CPU_Athlon, NONE -pfpnacc, now3d_insn, (0x8EUL<<8)|1, CPU_3DNow|CPU_Athlon, NONE -pfrcp, now3d_insn, (0x96UL<<8)|1, CPU_3DNow, NONE -pfrcpit1, now3d_insn, (0xA6UL<<8)|1, CPU_3DNow, NONE -pfrcpit2, now3d_insn, (0xB6UL<<8)|1, CPU_3DNow, NONE -pfrsqit1, now3d_insn, (0xA7UL<<8)|1, CPU_3DNow, NONE -pfrsqrt, now3d_insn, (0x97UL<<8)|1, CPU_3DNow, NONE -pfsub, now3d_insn, (0x9AUL<<8)|1, CPU_3DNow, NONE -pfsubr, now3d_insn, (0xAAUL<<8)|1, CPU_3DNow, NONE -phaddd, ssse3_insn, (0x02UL<<8)|2, CPU_SSSE3, NONE -phaddsw, ssse3_insn, (0x03UL<<8)|2, CPU_SSSE3, NONE -phaddw, ssse3_insn, (0x01UL<<8)|2, CPU_SSSE3, NONE -phminposuw, sse4_insn, (0x41UL<<8)|1, CPU_SSE41, NONE -phsubd, ssse3_insn, (0x06UL<<8)|2, CPU_SSSE3, NONE -phsubsw, ssse3_insn, (0x07UL<<8)|2, CPU_SSSE3, NONE -phsubw, ssse3_insn, (0x05UL<<8)|2, CPU_SSSE3, NONE -pi2fd, now3d_insn, (0x0DUL<<8)|1, CPU_3DNow, NONE -pi2fw, now3d_insn, (0x0CUL<<8)|1, CPU_3DNow|CPU_Athlon, NONE -pinsrb, pinsrb_insn, (0UL<<8)|2, CPU_SSE41, NONE -pinsrd, pinsrd_insn, (0UL<<8)|1, CPU_386|CPU_SSE41, NONE -pinsrq, pinsrq_insn, (0UL<<8)|1, CPU_64|CPU_SSE41, NONE -pinsrw, pinsrw_insn, (0UL<<8)|6, CPU_MMX|CPU_P3, NONE -pinsrwl, pinsrw_insn, (0UL<<8)|6, CPU_MMX|CPU_P3, SUF_L -pinsrwq, pinsrw_insn, (0UL<<8)|6, CPU_64|CPU_MMX|CPU_P3, SUF_Q -pmachriw, pmachriw_insn, (0UL<<8)|1, CPU_Cyrix|CPU_MMX, NONE -pmaddubsw, ssse3_insn, (0x04UL<<8)|2, CPU_SSSE3, NONE -pmaddwd, mmxsse2_insn, (0xF5UL<<8)|2, CPU_MMX, NONE -pmagw, cyrixmmx_insn, (0x52UL<<8)|1, CPU_Cyrix|CPU_MMX, NONE -pmaxsb, sse4_insn, (0x3CUL<<8)|1, CPU_SSE41, NONE -pmaxsd, sse4_insn, (0x3DUL<<8)|1, CPU_SSE41, NONE -pmaxsw, mmxsse2_insn, (0xEEUL<<8)|2, CPU_MMX|CPU_P3, NONE -pmaxub, mmxsse2_insn, (0xDEUL<<8)|2, CPU_MMX|CPU_P3, NONE -pmaxud, sse4_insn, (0x3FUL<<8)|1, CPU_SSE41, NONE -pmaxuw, sse4_insn, (0x3EUL<<8)|1, CPU_SSE41, NONE -pminsb, sse4_insn, (0x38UL<<8)|1, CPU_SSE41, NONE -pminsd, sse4_insn, (0x39UL<<8)|1, CPU_SSE41, NONE -pminsw, mmxsse2_insn, (0xEAUL<<8)|2, CPU_MMX|CPU_P3, NONE -pminub, mmxsse2_insn, (0xDAUL<<8)|2, CPU_MMX|CPU_P3, NONE -pminud, sse4_insn, (0x3BUL<<8)|1, CPU_SSE41, NONE -pminuw, sse4_insn, (0x3AUL<<8)|1, CPU_SSE41, NONE -pmovmskb, pmovmskb_insn, (0UL<<8)|4, CPU_MMX|CPU_P3, NONE -pmovmskbl, pmovmskb_insn, (0UL<<8)|4, CPU_MMX|CPU_P3, SUF_L -pmovmskbq, pmovmskb_insn, (0UL<<8)|4, CPU_64|CPU_MMX|CPU_P3, SUF_Q -pmovsxbd, sse4m32_insn, (0x21UL<<8)|2, CPU_SSE41, NONE -pmovsxbq, sse4m16_insn, (0x22UL<<8)|2, CPU_SSE41, NONE -pmovsxbw, sse4m64_insn, (0x20UL<<8)|2, CPU_SSE41, NONE -pmovsxdq, sse4m64_insn, (0x25UL<<8)|2, CPU_SSE41, NONE -pmovsxwd, sse4m64_insn, (0x23UL<<8)|2, CPU_SSE41, NONE -pmovsxwq, sse4m32_insn, (0x24UL<<8)|2, CPU_SSE41, NONE -pmovzxbd, sse4m32_insn, (0x31UL<<8)|2, CPU_SSE41, NONE -pmovzxbq, sse4m16_insn, (0x32UL<<8)|2, CPU_SSE41, NONE -pmovzxbw, sse4m64_insn, (0x30UL<<8)|2, CPU_SSE41, NONE -pmovzxdq, sse4m64_insn, (0x35UL<<8)|2, CPU_SSE41, NONE -pmovzxwd, sse4m64_insn, (0x33UL<<8)|2, CPU_SSE41, NONE -pmovzxwq, sse4m32_insn, (0x34UL<<8)|2, CPU_SSE41, NONE -pmuldq, sse4_insn, (0x28UL<<8)|1, CPU_SSE41, NONE -pmulhriw, cyrixmmx_insn, (0x5DUL<<8)|1, CPU_Cyrix|CPU_MMX, NONE -pmulhrsw, ssse3_insn, (0x0BUL<<8)|2, CPU_SSSE3, NONE -pmulhrwa, now3d_insn, (0xB7UL<<8)|1, CPU_3DNow, NONE -pmulhrwc, cyrixmmx_insn, (0x59UL<<8)|1, CPU_Cyrix|CPU_MMX, NONE -pmulhuw, mmxsse2_insn, (0xE4UL<<8)|2, CPU_MMX|CPU_P3, NONE -pmulhw, mmxsse2_insn, (0xE5UL<<8)|2, CPU_MMX, NONE -pmulld, sse4_insn, (0x40UL<<8)|1, CPU_SSE41, NONE -pmullw, mmxsse2_insn, (0xD5UL<<8)|2, CPU_MMX, NONE -pmuludq, mmxsse2_insn, (0xF4UL<<8)|2, CPU_SSE2, NONE -pmvgezb, cyrixmmx_insn, (0x5CUL<<8)|1, CPU_Cyrix|CPU_MMX, NONE -pmvlzb, cyrixmmx_insn, (0x5BUL<<8)|1, CPU_Cyrix|CPU_MMX, NONE -pmvnzb, cyrixmmx_insn, (0x5AUL<<8)|1, CPU_Cyrix|CPU_MMX, NONE -pmvzb, cyrixmmx_insn, (0x58UL<<8)|1, CPU_Cyrix|CPU_MMX, NONE -pop, pop_insn, (0UL<<8)|21, CPU_Any, NONE -popl, pop_insn, (0UL<<8)|21, CPU_386|CPU_Not64, SUF_L -popq, pop_insn, (0UL<<8)|21, CPU_64, SUF_Q -popw, pop_insn, (0UL<<8)|21, CPU_Any, SUF_W -popa, onebyte_insn, (0x000061UL<<8)|1, CPU_186|CPU_Not64, NONE -popal, onebyte_insn, (0x002061UL<<8)|1, CPU_386|CPU_Not64, NONE -popaw, onebyte_insn, (0x001061UL<<8)|1, CPU_186|CPU_Not64, NONE -popcnt, cnt_insn, (0xB8UL<<8)|3, CPU_SSE42, NONE -popcntl, cnt_insn, (0xB8UL<<8)|3, CPU_SSE42, SUF_L -popcntq, cnt_insn, (0xB8UL<<8)|3, CPU_SSE42, SUF_Q -popcntw, cnt_insn, (0xB8UL<<8)|3, CPU_SSE42, SUF_W -popf, onebyte_insn, (0x40009DUL<<8)|1, CPU_Any, NONE -popfl, onebyte_insn, (0x00209DUL<<8)|1, CPU_386|CPU_Not64, NONE -popfq, onebyte_insn, (0x40409DUL<<8)|1, CPU_64, NONE -popfw, onebyte_insn, (0x40109DUL<<8)|1, CPU_Any, NONE -por, mmxsse2_insn, (0xEBUL<<8)|2, CPU_MMX, NONE -prefetch, twobytemem_insn, (0x000F0DUL<<8)|1, CPU_3DNow, NONE -prefetchnta, twobytemem_insn, (0x000F18UL<<8)|1, CPU_P3, NONE -prefetcht0, twobytemem_insn, (0x010F18UL<<8)|1, CPU_P3, NONE -prefetcht1, twobytemem_insn, (0x020F18UL<<8)|1, CPU_P3, NONE -prefetcht2, twobytemem_insn, (0x030F18UL<<8)|1, CPU_P3, NONE -prefetchw, twobytemem_insn, (0x010F0DUL<<8)|1, CPU_3DNow, NONE -psadbw, mmxsse2_insn, (0xF6UL<<8)|2, CPU_MMX|CPU_P3, NONE -pshufb, ssse3_insn, (0x00UL<<8)|2, CPU_SSSE3, NONE -pshufd, ssessimm_insn, (0x6670UL<<8)|1, CPU_SSE2, NONE -pshufhw, ssessimm_insn, (0xF370UL<<8)|1, CPU_SSE2, NONE -pshuflw, ssessimm_insn, (0xF270UL<<8)|1, CPU_SSE2, NONE -pshufw, pshufw_insn, (0UL<<8)|1, CPU_MMX|CPU_P3, NONE -psignb, ssse3_insn, (0x08UL<<8)|2, CPU_SSSE3, NONE -psignd, ssse3_insn, (0x0AUL<<8)|2, CPU_SSSE3, NONE -psignw, ssse3_insn, (0x09UL<<8)|2, CPU_SSSE3, NONE -pslld, pshift_insn, (0x0672F2UL<<8)|4, CPU_MMX, NONE -pslldq, pslrldq_insn, (0x07UL<<8)|1, CPU_SSE2, NONE -psllq, pshift_insn, (0x0673F3UL<<8)|4, CPU_MMX, NONE -psllw, pshift_insn, (0x0671F1UL<<8)|4, CPU_MMX, NONE -psrad, pshift_insn, (0x0472E2UL<<8)|4, CPU_MMX, NONE -psraw, pshift_insn, (0x0471E1UL<<8)|4, CPU_MMX, NONE -psrld, pshift_insn, (0x0272D2UL<<8)|4, CPU_MMX, NONE -psrldq, pslrldq_insn, (0x03UL<<8)|1, CPU_SSE2, NONE -psrlq, pshift_insn, (0x0273D3UL<<8)|4, CPU_MMX, NONE -psrlw, pshift_insn, (0x0271D1UL<<8)|4, CPU_MMX, NONE -psubb, mmxsse2_insn, (0xF8UL<<8)|2, CPU_MMX, NONE -psubd, mmxsse2_insn, (0xFAUL<<8)|2, CPU_MMX, NONE -psubq, mmxsse2_insn, (0xFBUL<<8)|2, CPU_MMX, NONE -psubsb, mmxsse2_insn, (0xE8UL<<8)|2, CPU_MMX, NONE -psubsiw, cyrixmmx_insn, (0x55UL<<8)|1, CPU_Cyrix|CPU_MMX, NONE -psubsw, mmxsse2_insn, (0xE9UL<<8)|2, CPU_MMX, NONE -psubusb, mmxsse2_insn, (0xD8UL<<8)|2, CPU_MMX, NONE -psubusw, mmxsse2_insn, (0xD9UL<<8)|2, CPU_MMX, NONE -psubw, mmxsse2_insn, (0xF9UL<<8)|2, CPU_MMX, NONE -pswapd, now3d_insn, (0xBBUL<<8)|1, CPU_3DNow|CPU_Athlon, NONE -ptest, sse4_insn, (0x17UL<<8)|1, CPU_SSE41, NONE -punpckhbw, mmxsse2_insn, (0x68UL<<8)|2, CPU_MMX, NONE -punpckhdq, mmxsse2_insn, (0x6AUL<<8)|2, CPU_MMX, NONE -punpckhqdq, ssess_insn, (0x666DUL<<8)|1, CPU_SSE2, NONE -punpckhwd, mmxsse2_insn, (0x69UL<<8)|2, CPU_MMX, NONE -punpcklbw, mmxsse2_insn, (0x60UL<<8)|2, CPU_MMX, NONE -punpckldq, mmxsse2_insn, (0x62UL<<8)|2, CPU_MMX, NONE -punpcklqdq, ssess_insn, (0x666CUL<<8)|1, CPU_SSE2, NONE -punpcklwd, mmxsse2_insn, (0x61UL<<8)|2, CPU_MMX, NONE -push, push_insn, (0UL<<8)|33, CPU_Any, NONE -pushl, push_insn, (0UL<<8)|33, CPU_386, SUF_L -pushq, push_insn, (0UL<<8)|33, CPU_64, SUF_Q -pushw, push_insn, (0UL<<8)|33, CPU_Any, SUF_W -pusha, onebyte_insn, (0x000060UL<<8)|1, CPU_186|CPU_Not64, NONE -pushal, onebyte_insn, (0x002060UL<<8)|1, CPU_386|CPU_Not64, NONE -pushaw, onebyte_insn, (0x001060UL<<8)|1, CPU_186|CPU_Not64, NONE -pushf, onebyte_insn, (0x40009CUL<<8)|1, CPU_Any, NONE -pushfl, onebyte_insn, (0x00209CUL<<8)|1, CPU_386|CPU_Not64, NONE -pushfq, onebyte_insn, (0x40409CUL<<8)|1, CPU_64, NONE -pushfw, onebyte_insn, (0x40109CUL<<8)|1, CPU_Any, NONE -pxor, mmxsse2_insn, (0xEFUL<<8)|2, CPU_MMX, NONE -qword, NULL, X86_OPERSIZE, 0x40, NONE -rcl, shift_insn, (0x02UL<<8)|16, CPU_Any, NONE -rclb, shift_insn, (0x02UL<<8)|16, CPU_Any, SUF_B -rcll, shift_insn, (0x02UL<<8)|16, CPU_386, SUF_L -rclq, shift_insn, (0x02UL<<8)|16, CPU_64, SUF_Q -rclw, shift_insn, (0x02UL<<8)|16, CPU_Any, SUF_W -rcpps, sseps_insn, (0x53UL<<8)|1, CPU_SSE, NONE -rcpss, ssess_insn, (0xF353UL<<8)|1, CPU_SSE, NONE -rcr, shift_insn, (0x03UL<<8)|16, CPU_Any, NONE -rcrb, shift_insn, (0x03UL<<8)|16, CPU_Any, SUF_B -rcrl, shift_insn, (0x03UL<<8)|16, CPU_386, SUF_L -rcrq, shift_insn, (0x03UL<<8)|16, CPU_64, SUF_Q -rcrw, shift_insn, (0x03UL<<8)|16, CPU_Any, SUF_W -rdmsr, twobyte_insn, (0x0F32UL<<8)|1, CPU_586|CPU_Priv, NONE -rdpmc, twobyte_insn, (0x0F33UL<<8)|1, CPU_686, NONE -rdshr, rdwrshr_insn, (0x00UL<<8)|1, CPU_686|CPU_Cyrix|CPU_SMM, NONE -rdtsc, twobyte_insn, (0x0F31UL<<8)|1, CPU_586, NONE -rdtscp, threebyte_insn, (0x0F01F9UL<<8)|1, CPU_686|CPU_AMD|CPU_Priv, NONE -rep, NULL, X86_LOCKREP, 0xF3, NONE -repe, NULL, X86_LOCKREP, 0xF3, NONE -repne, NULL, X86_LOCKREP, 0xF2, NONE -repnz, NULL, X86_LOCKREP, 0xF2, NONE -repz, NULL, X86_LOCKREP, 0xF3, NONE -ret, retnf_insn, (0x00C2UL<<8)|6, CPU_Any, NONE -retl, retnf_insn, (0x00C2UL<<8)|6, CPU_Not64, NONE -retq, retnf_insn, (0x00C2UL<<8)|6, CPU_64, NONE -retw, retnf_insn, (0x10C2UL<<8)|6, CPU_Any, NONE -rex, NULL, X86_REX, 0x40, NONE -rex64, NULL, X86_REX, 0x48, NONE -rex64x, NULL, X86_REX, 0x4C, NONE -rex64xy, NULL, X86_REX, 0x4E, NONE -rex64xyz, NULL, X86_REX, 0x4F, NONE -rex64xz, NULL, X86_REX, 0x4D, NONE -rex64y, NULL, X86_REX, 0x4A, NONE -rex64yz, NULL, X86_REX, 0x4B, NONE -rex64z, NULL, X86_REX, 0x49, NONE -rexx, NULL, X86_REX, 0x44, NONE -rexxy, NULL, X86_REX, 0x46, NONE -rexxyz, NULL, X86_REX, 0x47, NONE -rexxz, NULL, X86_REX, 0x45, NONE -rexy, NULL, X86_REX, 0x42, NONE -rexyz, NULL, X86_REX, 0x43, NONE -rexz, NULL, X86_REX, 0x41, NONE -rol, shift_insn, (0x00UL<<8)|16, CPU_Any, NONE -rolb, shift_insn, (0x00UL<<8)|16, CPU_Any, SUF_B -roll, shift_insn, (0x00UL<<8)|16, CPU_386, SUF_L -rolq, shift_insn, (0x00UL<<8)|16, CPU_64, SUF_Q -rolw, shift_insn, (0x00UL<<8)|16, CPU_Any, SUF_W -ror, shift_insn, (0x01UL<<8)|16, CPU_Any, NONE -rorb, shift_insn, (0x01UL<<8)|16, CPU_Any, SUF_B -rorl, shift_insn, (0x01UL<<8)|16, CPU_386, SUF_L -rorq, shift_insn, (0x01UL<<8)|16, CPU_64, SUF_Q -rorw, shift_insn, (0x01UL<<8)|16, CPU_Any, SUF_W -roundpd, sse4imm_insn, (0x09UL<<8)|1, CPU_SSE41, NONE -roundps, sse4imm_insn, (0x08UL<<8)|1, CPU_SSE41, NONE -roundsd, sse4imm_insn, (0x0BUL<<8)|1, CPU_SSE41, NONE -roundss, sse4imm_insn, (0x0AUL<<8)|1, CPU_SSE41, NONE -rsdc, rsdc_insn, (0UL<<8)|1, CPU_486|CPU_Cyrix|CPU_SMM, NONE -rsldt, cyrixsmm_insn, (0x7BUL<<8)|1, CPU_486|CPU_Cyrix|CPU_SMM, NONE -rsm, twobyte_insn, (0x0FAAUL<<8)|1, CPU_586|CPU_SMM, NONE -rsqrtps, sseps_insn, (0x52UL<<8)|1, CPU_SSE, NONE -rsqrtss, ssess_insn, (0xF352UL<<8)|1, CPU_SSE, NONE -rsts, cyrixsmm_insn, (0x7DUL<<8)|1, CPU_486|CPU_Cyrix|CPU_SMM, NONE -sahf, onebyte_insn, (0x00009EUL<<8)|1, CPU_Any, NONE -sal, shift_insn, (0x04UL<<8)|16, CPU_Any, NONE -salb, shift_insn, (0x04UL<<8)|16, CPU_Any, SUF_B -sall, shift_insn, (0x04UL<<8)|16, CPU_386, SUF_L -salq, shift_insn, (0x04UL<<8)|16, CPU_64, SUF_Q -salw, shift_insn, (0x04UL<<8)|16, CPU_Any, SUF_W -salc, onebyte_insn, (0x0000D6UL<<8)|1, CPU_Not64|CPU_Undoc, NONE -sar, shift_insn, (0x07UL<<8)|16, CPU_Any, NONE -sarb, shift_insn, (0x07UL<<8)|16, CPU_Any, SUF_B -sarl, shift_insn, (0x07UL<<8)|16, CPU_386, SUF_L -sarq, shift_insn, (0x07UL<<8)|16, CPU_64, SUF_Q -sarw, shift_insn, (0x07UL<<8)|16, CPU_Any, SUF_W -sbb, arith_insn, (0x0318UL<<8)|22, CPU_Any, NONE -sbbb, arith_insn, (0x0318UL<<8)|22, CPU_Any, SUF_B -sbbl, arith_insn, (0x0318UL<<8)|22, CPU_386, SUF_L -sbbq, arith_insn, (0x0318UL<<8)|22, CPU_64, SUF_Q -sbbw, arith_insn, (0x0318UL<<8)|22, CPU_Any, SUF_W -scasb, onebyte_insn, (0x0000AEUL<<8)|1, CPU_Any, NONE -scasl, onebyte_insn, (0x0020AFUL<<8)|1, CPU_386, NONE -scasq, onebyte_insn, (0x0040AFUL<<8)|1, CPU_64, NONE -scasw, onebyte_insn, (0x0010AFUL<<8)|1, CPU_Any, NONE -seta, setcc_insn, (0x07UL<<8)|1, CPU_386, NONE -setab, setcc_insn, (0x07UL<<8)|1, CPU_386, SUF_B -setae, setcc_insn, (0x03UL<<8)|1, CPU_386, NONE -setaeb, setcc_insn, (0x03UL<<8)|1, CPU_386, SUF_B -setb, setcc_insn, (0x02UL<<8)|1, CPU_386, NONE -setbb, setcc_insn, (0x02UL<<8)|1, CPU_386, SUF_B -setbe, setcc_insn, (0x06UL<<8)|1, CPU_386, NONE -setbeb, setcc_insn, (0x06UL<<8)|1, CPU_386, SUF_B -setc, setcc_insn, (0x02UL<<8)|1, CPU_386, NONE -setcb, setcc_insn, (0x02UL<<8)|1, CPU_386, SUF_B -sete, setcc_insn, (0x04UL<<8)|1, CPU_386, NONE -seteb, setcc_insn, (0x04UL<<8)|1, CPU_386, SUF_B -setg, setcc_insn, (0x0FUL<<8)|1, CPU_386, NONE -setgb, setcc_insn, (0x0FUL<<8)|1, CPU_386, SUF_B -setge, setcc_insn, (0x0DUL<<8)|1, CPU_386, NONE -setgeb, setcc_insn, (0x0DUL<<8)|1, CPU_386, SUF_B -setl, setcc_insn, (0x0CUL<<8)|1, CPU_386, NONE -setlb, setcc_insn, (0x0CUL<<8)|1, CPU_386, SUF_B -setle, setcc_insn, (0x0EUL<<8)|1, CPU_386, NONE -setleb, setcc_insn, (0x0EUL<<8)|1, CPU_386, SUF_B -setna, setcc_insn, (0x06UL<<8)|1, CPU_386, NONE -setnab, setcc_insn, (0x06UL<<8)|1, CPU_386, SUF_B -setnae, setcc_insn, (0x02UL<<8)|1, CPU_386, NONE -setnaeb, setcc_insn, (0x02UL<<8)|1, CPU_386, SUF_B -setnb, setcc_insn, (0x03UL<<8)|1, CPU_386, NONE -setnbb, setcc_insn, (0x03UL<<8)|1, CPU_386, SUF_B -setnbe, setcc_insn, (0x07UL<<8)|1, CPU_386, NONE -setnbeb, setcc_insn, (0x07UL<<8)|1, CPU_386, SUF_B -setnc, setcc_insn, (0x03UL<<8)|1, CPU_386, NONE -setncb, setcc_insn, (0x03UL<<8)|1, CPU_386, SUF_B -setne, setcc_insn, (0x05UL<<8)|1, CPU_386, NONE -setneb, setcc_insn, (0x05UL<<8)|1, CPU_386, SUF_B -setng, setcc_insn, (0x0EUL<<8)|1, CPU_386, NONE -setngb, setcc_insn, (0x0EUL<<8)|1, CPU_386, SUF_B -setnge, setcc_insn, (0x0CUL<<8)|1, CPU_386, NONE -setngeb, setcc_insn, (0x0CUL<<8)|1, CPU_386, SUF_B -setnl, setcc_insn, (0x0DUL<<8)|1, CPU_386, NONE -setnlb, setcc_insn, (0x0DUL<<8)|1, CPU_386, SUF_B -setnle, setcc_insn, (0x0FUL<<8)|1, CPU_386, NONE -setnleb, setcc_insn, (0x0FUL<<8)|1, CPU_386, SUF_B -setno, setcc_insn, (0x01UL<<8)|1, CPU_386, NONE -setnob, setcc_insn, (0x01UL<<8)|1, CPU_386, SUF_B -setnp, setcc_insn, (0x0BUL<<8)|1, CPU_386, NONE -setnpb, setcc_insn, (0x0BUL<<8)|1, CPU_386, SUF_B -setns, setcc_insn, (0x09UL<<8)|1, CPU_386, NONE -setnsb, setcc_insn, (0x09UL<<8)|1, CPU_386, SUF_B -setnz, setcc_insn, (0x05UL<<8)|1, CPU_386, NONE -setnzb, setcc_insn, (0x05UL<<8)|1, CPU_386, SUF_B -seto, setcc_insn, (0x00UL<<8)|1, CPU_386, NONE -setob, setcc_insn, (0x00UL<<8)|1, CPU_386, SUF_B -setp, setcc_insn, (0x0AUL<<8)|1, CPU_386, NONE -setpb, setcc_insn, (0x0AUL<<8)|1, CPU_386, SUF_B -setpe, setcc_insn, (0x0AUL<<8)|1, CPU_386, NONE -setpeb, setcc_insn, (0x0AUL<<8)|1, CPU_386, SUF_B -setpo, setcc_insn, (0x0BUL<<8)|1, CPU_386, NONE -setpob, setcc_insn, (0x0BUL<<8)|1, CPU_386, SUF_B -sets, setcc_insn, (0x08UL<<8)|1, CPU_386, NONE -setsb, setcc_insn, (0x08UL<<8)|1, CPU_386, SUF_B -setz, setcc_insn, (0x04UL<<8)|1, CPU_386, NONE -setzb, setcc_insn, (0x04UL<<8)|1, CPU_386, SUF_B -sfence, threebyte_insn, (0x0FAEF8UL<<8)|1, CPU_P3, NONE -sgdt, twobytemem_insn, (0x000F01UL<<8)|1, CPU_286|CPU_Priv, NONE -sgdtl, twobytemem_insn, (0x000F01UL<<8)|1, CPU_286|CPU_Priv, SUF_L -sgdtq, twobytemem_insn, (0x000F01UL<<8)|1, CPU_286|CPU_Priv, SUF_Q -sgdtw, twobytemem_insn, (0x000F01UL<<8)|1, CPU_286|CPU_Priv, SUF_W -shl, shift_insn, (0x04UL<<8)|16, CPU_Any, NONE -shlb, shift_insn, (0x04UL<<8)|16, CPU_Any, SUF_B -shll, shift_insn, (0x04UL<<8)|16, CPU_386, SUF_L -shlq, shift_insn, (0x04UL<<8)|16, CPU_64, SUF_Q -shlw, shift_insn, (0x04UL<<8)|16, CPU_Any, SUF_W -shld, shlrd_insn, (0xA4UL<<8)|9, CPU_386, NONE -shldl, shlrd_insn, (0xA4UL<<8)|9, CPU_386, SUF_L -shldq, shlrd_insn, (0xA4UL<<8)|9, CPU_386|CPU_64, SUF_Q -shldw, shlrd_insn, (0xA4UL<<8)|9, CPU_386, SUF_W -shr, shift_insn, (0x05UL<<8)|16, CPU_Any, NONE -shrb, shift_insn, (0x05UL<<8)|16, CPU_Any, SUF_B -shrl, shift_insn, (0x05UL<<8)|16, CPU_386, SUF_L -shrq, shift_insn, (0x05UL<<8)|16, CPU_64, SUF_Q -shrw, shift_insn, (0x05UL<<8)|16, CPU_Any, SUF_W -shrd, shlrd_insn, (0xACUL<<8)|9, CPU_386, NONE -shrdl, shlrd_insn, (0xACUL<<8)|9, CPU_386, SUF_L -shrdq, shlrd_insn, (0xACUL<<8)|9, CPU_386|CPU_64, SUF_Q -shrdw, shlrd_insn, (0xACUL<<8)|9, CPU_386, SUF_W -shufpd, ssessimm_insn, (0x66C6UL<<8)|1, CPU_SSE2, NONE -shufps, ssepsimm_insn, (0xC6UL<<8)|1, CPU_SSE, NONE -sidt, twobytemem_insn, (0x010F01UL<<8)|1, CPU_286|CPU_Priv, NONE -sidtl, twobytemem_insn, (0x010F01UL<<8)|1, CPU_286|CPU_Priv, SUF_L -sidtq, twobytemem_insn, (0x010F01UL<<8)|1, CPU_286|CPU_Priv, SUF_Q -sidtw, twobytemem_insn, (0x010F01UL<<8)|1, CPU_286|CPU_Priv, SUF_W -skinit, skinit_insn, (0UL<<8)|2, CPU_SVM, NONE -sldt, sldtmsw_insn, (0x0000UL<<8)|6, CPU_286, NONE -sldtl, sldtmsw_insn, (0x0000UL<<8)|6, CPU_386, SUF_L -sldtq, sldtmsw_insn, (0x0000UL<<8)|6, CPU_286|CPU_64, SUF_Q -sldtw, sldtmsw_insn, (0x0000UL<<8)|6, CPU_286, SUF_W -smi, onebyte_insn, (0x0000F1UL<<8)|1, CPU_386|CPU_Undoc, NONE -smint, twobyte_insn, (0x0F38UL<<8)|1, CPU_686|CPU_Cyrix, NONE -smintold, twobyte_insn, (0x0F7EUL<<8)|1, CPU_486|CPU_Cyrix|CPU_Obs, NONE -smovb, onebyte_insn, (0x0000A4UL<<8)|1, CPU_Any, NONE -smovl, onebyte_insn, (0x0020A5UL<<8)|1, CPU_386, NONE -smovq, onebyte_insn, (0x0040A5UL<<8)|1, CPU_64, NONE -smovw, onebyte_insn, (0x0010A5UL<<8)|1, CPU_Any, NONE -smsw, sldtmsw_insn, (0x0401UL<<8)|6, CPU_286, NONE -smswl, sldtmsw_insn, (0x0401UL<<8)|6, CPU_386, SUF_L -smswq, sldtmsw_insn, (0x0401UL<<8)|6, CPU_286|CPU_64, SUF_Q -smsww, sldtmsw_insn, (0x0401UL<<8)|6, CPU_286, SUF_W -sqrtpd, ssess_insn, (0x6651UL<<8)|1, CPU_SSE2, NONE -sqrtps, sseps_insn, (0x51UL<<8)|1, CPU_SSE, NONE -sqrtsd, ssess_insn, (0xF251UL<<8)|1, CPU_SSE2, NONE -sqrtss, ssess_insn, (0xF351UL<<8)|1, CPU_SSE, NONE -sscab, onebyte_insn, (0x0000AEUL<<8)|1, CPU_Any, NONE -sscal, onebyte_insn, (0x0020AFUL<<8)|1, CPU_386, NONE -sscaq, onebyte_insn, (0x0040AFUL<<8)|1, CPU_64, NONE -sscaw, onebyte_insn, (0x0010AFUL<<8)|1, CPU_Any, NONE -stc, onebyte_insn, (0x0000F9UL<<8)|1, CPU_Any, NONE -std, onebyte_insn, (0x0000FDUL<<8)|1, CPU_Any, NONE -stgi, threebyte_insn, (0x0F01DCUL<<8)|1, CPU_SVM, NONE -sti, onebyte_insn, (0x0000FBUL<<8)|1, CPU_Any, NONE -stmxcsr, ldstmxcsr_insn, (0x03UL<<8)|1, CPU_SSE, NONE -stosb, onebyte_insn, (0x0000AAUL<<8)|1, CPU_Any, NONE -stosl, onebyte_insn, (0x0020ABUL<<8)|1, CPU_386, NONE -stosq, onebyte_insn, (0x0040ABUL<<8)|1, CPU_64, NONE -stosw, onebyte_insn, (0x0010ABUL<<8)|1, CPU_Any, NONE -str, str_insn, (0UL<<8)|4, CPU_286|CPU_Prot, NONE -strl, str_insn, (0UL<<8)|4, CPU_386|CPU_Prot, SUF_L -strq, str_insn, (0UL<<8)|4, CPU_286|CPU_64|CPU_Prot, SUF_Q -strw, str_insn, (0UL<<8)|4, CPU_286|CPU_Prot, SUF_W -sub, arith_insn, (0x0528UL<<8)|22, CPU_Any, NONE -subb, arith_insn, (0x0528UL<<8)|22, CPU_Any, SUF_B -subl, arith_insn, (0x0528UL<<8)|22, CPU_386, SUF_L -subq, arith_insn, (0x0528UL<<8)|22, CPU_64, SUF_Q -subw, arith_insn, (0x0528UL<<8)|22, CPU_Any, SUF_W -subpd, ssess_insn, (0x665CUL<<8)|1, CPU_SSE2, NONE -subps, sseps_insn, (0x5CUL<<8)|1, CPU_SSE, NONE -subsd, ssess_insn, (0xF25CUL<<8)|1, CPU_SSE2, NONE -subss, ssess_insn, (0xF35CUL<<8)|1, CPU_SSE, NONE -svdc, svdc_insn, (0UL<<8)|1, CPU_486|CPU_Cyrix|CPU_SMM, NONE -svldt, cyrixsmm_insn, (0x7AUL<<8)|1, CPU_486|CPU_Cyrix|CPU_SMM, NONE -svts, cyrixsmm_insn, (0x7CUL<<8)|1, CPU_486|CPU_Cyrix|CPU_SMM, NONE -swapgs, threebyte_insn, (0x0F01F8UL<<8)|1, CPU_64, NONE -syscall, twobyte_insn, (0x0F05UL<<8)|1, CPU_686|CPU_AMD, NONE -sysenter, twobyte_insn, (0x0F34UL<<8)|1, CPU_686|CPU_Not64, NONE -sysexit, twobyte_insn, (0x0F35UL<<8)|1, CPU_686|CPU_Not64|CPU_Priv, NONE -sysret, twobyte_insn, (0x0F07UL<<8)|1, CPU_686|CPU_AMD|CPU_Priv, NONE -sysretl, twobyte_insn, (0x0F07UL<<8)|1, CPU_686|CPU_AMD|CPU_Priv, SUF_L -sysretq, twobyte_insn, (0x0F07UL<<8)|1, CPU_686|CPU_AMD|CPU_Priv, SUF_Q -test, test_insn, (0UL<<8)|20, CPU_Any, NONE -testb, test_insn, (0UL<<8)|20, CPU_Any, SUF_B -testl, test_insn, (0UL<<8)|20, CPU_386, SUF_L -testq, test_insn, (0UL<<8)|20, CPU_64, SUF_Q -testw, test_insn, (0UL<<8)|20, CPU_Any, SUF_W -ucomisd, ssess_insn, (0x662EUL<<8)|1, CPU_SSE2, NONE -ucomiss, ssess_insn, (0x002EUL<<8)|1, CPU_SSE, NONE -ud1, twobyte_insn, (0x0FB9UL<<8)|1, CPU_286|CPU_Undoc, NONE -ud2, twobyte_insn, (0x0F0BUL<<8)|1, CPU_286, NONE -umov, umov_insn, (0UL<<8)|6, CPU_386|CPU_Undoc, NONE -unpckhpd, ssess_insn, (0x6615UL<<8)|1, CPU_SSE2, NONE -unpckhps, sseps_insn, (0x15UL<<8)|1, CPU_SSE, NONE -unpcklpd, ssess_insn, (0x6614UL<<8)|1, CPU_SSE2, NONE -unpcklps, sseps_insn, (0x14UL<<8)|1, CPU_SSE, NONE -verr, prot286_insn, (0x0400UL<<8)|1, CPU_286|CPU_Prot, NONE -verrw, prot286_insn, (0x0400UL<<8)|1, CPU_286|CPU_Prot, SUF_W -verw, prot286_insn, (0x0500UL<<8)|1, CPU_286|CPU_Prot, NONE -verww, prot286_insn, (0x0500UL<<8)|1, CPU_286|CPU_Prot, SUF_W -vmcall, threebyte_insn, (0x0F01C1UL<<8)|1, CPU_P4, NONE -vmclear, vmxthreebytemem_insn, (0x66UL<<8)|1, CPU_P4, NONE -vmlaunch, threebyte_insn, (0x0F01C2UL<<8)|1, CPU_P4, NONE -vmload, svm_rax_insn, (0xDAUL<<8)|2, CPU_SVM, NONE -vmmcall, threebyte_insn, (0x0F01D9UL<<8)|1, CPU_SVM, NONE -vmptrld, vmxtwobytemem_insn, (0x06UL<<8)|1, CPU_P4, NONE -vmptrst, vmxtwobytemem_insn, (0x07UL<<8)|1, CPU_P4, NONE -vmread, vmxmemrd_insn, (0UL<<8)|2, CPU_P4, NONE -vmreadl, vmxmemrd_insn, (0UL<<8)|2, CPU_Not64|CPU_P4, SUF_L -vmreadq, vmxmemrd_insn, (0UL<<8)|2, CPU_64|CPU_P4, SUF_Q -vmresume, threebyte_insn, (0x0F01C3UL<<8)|1, CPU_P4, NONE -vmrun, svm_rax_insn, (0xD8UL<<8)|2, CPU_SVM, NONE -vmsave, svm_rax_insn, (0xDBUL<<8)|2, CPU_SVM, NONE -vmwrite, vmxmemwr_insn, (0UL<<8)|2, CPU_P4, NONE -vmwritel, vmxmemwr_insn, (0UL<<8)|2, CPU_Not64|CPU_P4, SUF_L -vmwriteq, vmxmemwr_insn, (0UL<<8)|2, CPU_64|CPU_P4, SUF_Q -vmxoff, threebyte_insn, (0x0F01C4UL<<8)|1, CPU_P4, NONE -vmxon, vmxthreebytemem_insn, (0xF3UL<<8)|1, CPU_P4, NONE -wait, onebyte_insn, (0x00009BUL<<8)|1, CPU_Any, NONE -wbinvd, twobyte_insn, (0x0F09UL<<8)|1, CPU_486|CPU_Priv, NONE -word, NULL, X86_OPERSIZE, 0x10, NONE -wrmsr, twobyte_insn, (0x0F30UL<<8)|1, CPU_586|CPU_Priv, NONE -wrshr, rdwrshr_insn, (0x01UL<<8)|1, CPU_686|CPU_Cyrix|CPU_SMM, NONE -xadd, cmpxchgxadd_insn, (0xC0UL<<8)|4, CPU_486, NONE -xaddb, cmpxchgxadd_insn, (0xC0UL<<8)|4, CPU_486, SUF_B -xaddl, cmpxchgxadd_insn, (0xC0UL<<8)|4, CPU_486, SUF_L -xaddq, cmpxchgxadd_insn, (0xC0UL<<8)|4, CPU_486|CPU_64, SUF_Q -xaddw, cmpxchgxadd_insn, (0xC0UL<<8)|4, CPU_486, SUF_W -xbts, xbts_insn, (0UL<<8)|2, CPU_386|CPU_Obs|CPU_Undoc, NONE -xchg, xchg_insn, (0UL<<8)|16, CPU_Any, NONE -xchgb, xchg_insn, (0UL<<8)|16, CPU_Any, SUF_B -xchgl, xchg_insn, (0UL<<8)|16, CPU_Any, SUF_L -xchgq, xchg_insn, (0UL<<8)|16, CPU_64, SUF_Q -xchgw, xchg_insn, (0UL<<8)|16, CPU_Any, SUF_W -xcryptcbc, padlock_insn, (0xD0F3A7UL<<8)|1, CPU_PadLock, NONE -xcryptcfb, padlock_insn, (0xE0F3A7UL<<8)|1, CPU_PadLock, NONE -xcryptctr, padlock_insn, (0xD8F3A7UL<<8)|1, CPU_PadLock, NONE -xcryptecb, padlock_insn, (0xC8F3A7UL<<8)|1, CPU_PadLock, NONE -xcryptofb, padlock_insn, (0xE8F3A7UL<<8)|1, CPU_PadLock, NONE -xlatb, onebyte_insn, (0x0000D7UL<<8)|1, CPU_Any, NONE -xor, arith_insn, (0x0630UL<<8)|22, CPU_Any, NONE -xorb, arith_insn, (0x0630UL<<8)|22, CPU_Any, SUF_B -xorl, arith_insn, (0x0630UL<<8)|22, CPU_386, SUF_L -xorq, arith_insn, (0x0630UL<<8)|22, CPU_64, SUF_Q -xorw, arith_insn, (0x0630UL<<8)|22, CPU_Any, SUF_W -xorpd, ssess_insn, (0x6657UL<<8)|1, CPU_SSE2, NONE -xorps, sseps_insn, (0x57UL<<8)|1, CPU_SSE, NONE -xsha1, padlock_insn, (0xC8F3A6UL<<8)|1, CPU_PadLock, NONE -xsha256, padlock_insn, (0xD0F3A6UL<<8)|1, CPU_PadLock, NONE -xstore, padlock_insn, (0xC000A7UL<<8)|1, CPU_PadLock, NONE -xstorerng, padlock_insn, (0xC000A7UL<<8)|1, CPU_PadLock, NONE diff --git a/x86insn_nasm.gperf b/x86insn_nasm.gperf deleted file mode 100644 index 01d14fd3..00000000 --- a/x86insn_nasm.gperf +++ /dev/null @@ -1,768 +0,0 @@ -%ignore-case -%language=ANSI-C -%compare-strncmp -%readonly-tables -%enum -%struct-type -%define hash-function-name insnprefix_nasm_hash -%define lookup-function-name insnprefix_nasm_find -struct insnprefix_parse_data; -%% -a16, NULL, X86_ADDRSIZE, 0x10, NONE -a32, NULL, X86_ADDRSIZE, 0x20, NONE -a64, NULL, X86_ADDRSIZE, 0x40, NONE -aaa, onebyte_insn, (0x000037UL<<8)|1, CPU_Not64, NONE -aad, aadm_insn, (0x01UL<<8)|2, CPU_Not64, NONE -aam, aadm_insn, (0x00UL<<8)|2, CPU_Not64, NONE -aas, onebyte_insn, (0x00003FUL<<8)|1, CPU_Not64, NONE -adc, arith_insn, (0x0210UL<<8)|22, CPU_Any, NONE -add, arith_insn, (0x0000UL<<8)|22, CPU_Any, NONE -addpd, ssess_insn, (0x6658UL<<8)|1, CPU_SSE2, NONE -addps, sseps_insn, (0x58UL<<8)|1, CPU_SSE, NONE -addsd, ssess_insn, (0xF258UL<<8)|1, CPU_SSE2, NONE -addss, ssess_insn, (0xF358UL<<8)|1, CPU_SSE, NONE -addsubpd, ssess_insn, (0x66D0UL<<8)|1, CPU_SSE3, NONE -addsubps, ssess_insn, (0xF2D0UL<<8)|1, CPU_SSE3, NONE -and, arith_insn, (0x0420UL<<8)|22, CPU_Any, NONE -andnpd, ssess_insn, (0x6655UL<<8)|1, CPU_SSE2, NONE -andnps, sseps_insn, (0x55UL<<8)|1, CPU_SSE, NONE -andpd, ssess_insn, (0x6654UL<<8)|1, CPU_SSE2, NONE -andps, sseps_insn, (0x54UL<<8)|1, CPU_SSE, NONE -arpl, arpl_insn, (0UL<<8)|1, CPU_286|CPU_Not64|CPU_Prot, NONE -blendpd, sse4imm_insn, (0x0DUL<<8)|1, CPU_SSE41, NONE -blendps, sse4imm_insn, (0x0CUL<<8)|1, CPU_SSE41, NONE -blendvpd, sse4xmm0_insn, (0x15UL<<8)|2, CPU_SSE41, NONE -blendvps, sse4xmm0_insn, (0x14UL<<8)|2, CPU_SSE41, NONE -bound, bound_insn, (0UL<<8)|2, CPU_186|CPU_Not64, NONE -bsf, bsfr_insn, (0xBCUL<<8)|3, CPU_386, NONE -bsr, bsfr_insn, (0xBDUL<<8)|3, CPU_386, NONE -bswap, bswap_insn, (0UL<<8)|2, CPU_486, NONE -bt, bittest_insn, (0x04A3UL<<8)|6, CPU_386, NONE -btc, bittest_insn, (0x07BBUL<<8)|6, CPU_386, NONE -btr, bittest_insn, (0x06B3UL<<8)|6, CPU_386, NONE -bts, bittest_insn, (0x05ABUL<<8)|6, CPU_386, NONE -call, call_insn, (0UL<<8)|26, CPU_Any, NONE -cbw, onebyte_insn, (0x001098UL<<8)|1, CPU_Any, NONE -cdq, onebyte_insn, (0x002099UL<<8)|1, CPU_386, NONE -cdqe, onebyte_insn, (0x004098UL<<8)|1, CPU_64, NONE -clc, onebyte_insn, (0x0000F8UL<<8)|1, CPU_Any, NONE -cld, onebyte_insn, (0x0000FCUL<<8)|1, CPU_Any, NONE -clflush, clflush_insn, (0UL<<8)|1, CPU_P3, NONE -clgi, threebyte_insn, (0x0F01DDUL<<8)|1, CPU_SVM, NONE -cli, onebyte_insn, (0x0000FAUL<<8)|1, CPU_Any, NONE -clts, twobyte_insn, (0x0F06UL<<8)|1, CPU_286|CPU_Priv, NONE -cmc, onebyte_insn, (0x0000F5UL<<8)|1, CPU_Any, NONE -cmova, cmovcc_insn, (0x07UL<<8)|3, CPU_686, NONE -cmovae, cmovcc_insn, (0x03UL<<8)|3, CPU_686, NONE -cmovb, cmovcc_insn, (0x02UL<<8)|3, CPU_686, NONE -cmovbe, cmovcc_insn, (0x06UL<<8)|3, CPU_686, NONE -cmovc, cmovcc_insn, (0x02UL<<8)|3, CPU_686, NONE -cmove, cmovcc_insn, (0x04UL<<8)|3, CPU_686, NONE -cmovg, cmovcc_insn, (0x0FUL<<8)|3, CPU_686, NONE -cmovge, cmovcc_insn, (0x0DUL<<8)|3, CPU_686, NONE -cmovl, cmovcc_insn, (0x0CUL<<8)|3, CPU_686, NONE -cmovle, cmovcc_insn, (0x0EUL<<8)|3, CPU_686, NONE -cmovna, cmovcc_insn, (0x06UL<<8)|3, CPU_686, NONE -cmovnae, cmovcc_insn, (0x02UL<<8)|3, CPU_686, NONE -cmovnb, cmovcc_insn, (0x03UL<<8)|3, CPU_686, NONE -cmovnbe, cmovcc_insn, (0x07UL<<8)|3, CPU_686, NONE -cmovnc, cmovcc_insn, (0x03UL<<8)|3, CPU_686, NONE -cmovne, cmovcc_insn, (0x05UL<<8)|3, CPU_686, NONE -cmovng, cmovcc_insn, (0x0EUL<<8)|3, CPU_686, NONE -cmovnge, cmovcc_insn, (0x0CUL<<8)|3, CPU_686, NONE -cmovnl, cmovcc_insn, (0x0DUL<<8)|3, CPU_686, NONE -cmovnle, cmovcc_insn, (0x0FUL<<8)|3, CPU_686, NONE -cmovno, cmovcc_insn, (0x01UL<<8)|3, CPU_686, NONE -cmovnp, cmovcc_insn, (0x0BUL<<8)|3, CPU_686, NONE -cmovns, cmovcc_insn, (0x09UL<<8)|3, CPU_686, NONE -cmovnz, cmovcc_insn, (0x05UL<<8)|3, CPU_686, NONE -cmovo, cmovcc_insn, (0x00UL<<8)|3, CPU_686, NONE -cmovp, cmovcc_insn, (0x0AUL<<8)|3, CPU_686, NONE -cmovpe, cmovcc_insn, (0x0AUL<<8)|3, CPU_686, NONE -cmovpo, cmovcc_insn, (0x0BUL<<8)|3, CPU_686, NONE -cmovs, cmovcc_insn, (0x08UL<<8)|3, CPU_686, NONE -cmovz, cmovcc_insn, (0x04UL<<8)|3, CPU_686, NONE -cmp, arith_insn, (0x0738UL<<8)|22, CPU_Any, NONE -cmpeqpd, ssecmpss_insn, (0x0066UL<<8)|1, CPU_SSE2, NONE -cmpeqps, ssecmpps_insn, (0x00UL<<8)|1, CPU_SSE, NONE -cmpeqsd, ssecmpss_insn, (0x00F2UL<<8)|1, CPU_SSE2, NONE -cmpeqss, ssecmpss_insn, (0x00F3UL<<8)|1, CPU_SSE, NONE -cmplepd, ssecmpss_insn, (0x0266UL<<8)|1, CPU_SSE2, NONE -cmpleps, ssecmpps_insn, (0x02UL<<8)|1, CPU_SSE, NONE -cmplesd, ssecmpss_insn, (0x02F2UL<<8)|1, CPU_SSE2, NONE -cmpless, ssecmpss_insn, (0x02F3UL<<8)|1, CPU_SSE, NONE -cmpltpd, ssecmpss_insn, (0x0166UL<<8)|1, CPU_SSE2, NONE -cmpltps, ssecmpps_insn, (0x01UL<<8)|1, CPU_SSE, NONE -cmpltsd, ssecmpss_insn, (0x01F2UL<<8)|1, CPU_SSE2, NONE -cmpltss, ssecmpss_insn, (0x01F3UL<<8)|1, CPU_SSE, NONE -cmpneqpd, ssecmpss_insn, (0x0466UL<<8)|1, CPU_SSE2, NONE -cmpneqps, ssecmpps_insn, (0x04UL<<8)|1, CPU_SSE, NONE -cmpneqsd, ssecmpss_insn, (0x04F2UL<<8)|1, CPU_SSE2, NONE -cmpneqss, ssecmpss_insn, (0x04F3UL<<8)|1, CPU_SSE, NONE -cmpnlepd, ssecmpss_insn, (0x0666UL<<8)|1, CPU_SSE2, NONE -cmpnleps, ssecmpps_insn, (0x06UL<<8)|1, CPU_SSE, NONE -cmpnlesd, ssecmpss_insn, (0x06F2UL<<8)|1, CPU_SSE2, NONE -cmpnless, ssecmpss_insn, (0x06F3UL<<8)|1, CPU_SSE, NONE -cmpnltpd, ssecmpss_insn, (0x0566UL<<8)|1, CPU_SSE2, NONE -cmpnltps, ssecmpps_insn, (0x05UL<<8)|1, CPU_SSE, NONE -cmpnltsd, ssecmpss_insn, (0x05F2UL<<8)|1, CPU_SSE2, NONE -cmpnltss, ssecmpss_insn, (0x05F3UL<<8)|1, CPU_SSE, NONE -cmpordpd, ssecmpss_insn, (0x0766UL<<8)|1, CPU_SSE2, NONE -cmpordps, ssecmpps_insn, (0x07UL<<8)|1, CPU_SSE, NONE -cmpordsd, ssecmpss_insn, (0x07F2UL<<8)|1, CPU_SSE2, NONE -cmpordss, ssecmpss_insn, (0x07F3UL<<8)|1, CPU_SSE, NONE -cmppd, ssessimm_insn, (0x66C2UL<<8)|1, CPU_SSE2, NONE -cmpps, ssepsimm_insn, (0xC2UL<<8)|1, CPU_SSE, NONE -cmpsb, onebyte_insn, (0x0000A6UL<<8)|1, CPU_Any, NONE -cmpsd, cmpsd_insn, (0UL<<8)|2, CPU_Any, NONE -cmpsq, onebyte_insn, (0x0040A7UL<<8)|1, CPU_64, NONE -cmpss, ssessimm_insn, (0xF3C2UL<<8)|1, CPU_SSE, NONE -cmpsw, onebyte_insn, (0x0010A7UL<<8)|1, CPU_Any, NONE -cmpunordpd, ssecmpss_insn, (0x0366UL<<8)|1, CPU_SSE2, NONE -cmpunordps, ssecmpps_insn, (0x03UL<<8)|1, CPU_SSE, NONE -cmpunordsd, ssecmpss_insn, (0x03F2UL<<8)|1, CPU_SSE2, NONE -cmpunordss, ssecmpss_insn, (0x03F3UL<<8)|1, CPU_SSE, NONE -cmpxchg, cmpxchgxadd_insn, (0xB0UL<<8)|4, CPU_486, NONE -cmpxchg16b, cmpxchg16b_insn, (0UL<<8)|1, CPU_64, NONE -cmpxchg486, cmpxchgxadd_insn, (0xA6UL<<8)|4, CPU_486|CPU_Undoc, NONE -cmpxchg8b, cmpxchg8b_insn, (0UL<<8)|1, CPU_586, NONE -comisd, ssess_insn, (0x662FUL<<8)|1, CPU_SSE2, NONE -comiss, sseps_insn, (0x2FUL<<8)|1, CPU_SSE, NONE -cpuid, twobyte_insn, (0x0FA2UL<<8)|1, CPU_486, NONE -cqo, onebyte_insn, (0x004099UL<<8)|1, CPU_64, NONE -crc32, crc32_insn, (0UL<<8)|5, CPU_386|CPU_SSE42, NONE -cvtdq2pd, cvt_xmm_xmm64_ss_insn, (0xF3E6UL<<8)|2, CPU_SSE2, NONE -cvtdq2ps, sseps_insn, (0x5BUL<<8)|1, CPU_SSE2, NONE -cvtpd2dq, ssess_insn, (0xF2E6UL<<8)|1, CPU_SSE2, NONE -cvtpd2pi, cvt_mm_xmm_insn, (0x662DUL<<8)|1, CPU_SSE2, NONE -cvtpd2ps, ssess_insn, (0x665AUL<<8)|1, CPU_SSE2, NONE -cvtpi2pd, cvt_xmm_mm_ss_insn, (0x662AUL<<8)|1, CPU_SSE2, NONE -cvtpi2ps, cvt_xmm_mm_ps_insn, (0x2AUL<<8)|1, CPU_SSE, NONE -cvtps2dq, ssess_insn, (0x665BUL<<8)|1, CPU_SSE2, NONE -cvtps2pd, cvt_xmm_xmm64_ps_insn, (0x5AUL<<8)|2, CPU_SSE2, NONE -cvtps2pi, cvt_mm_xmm64_insn, (0x2DUL<<8)|2, CPU_SSE, NONE -cvtsd2si, cvt_rx_xmm64_insn, (0xF22DUL<<8)|4, CPU_386|CPU_SSE2, NONE -cvtsd2ss, cvt_xmm_xmm64_ss_insn, (0xF25AUL<<8)|2, CPU_SSE2, NONE -cvtsi2sd, cvt_xmm_rmx_insn, (0xF22AUL<<8)|2, CPU_SSE2, NONE -cvtsi2ss, cvt_xmm_rmx_insn, (0xF32AUL<<8)|2, CPU_386|CPU_SSE, NONE -cvtss2sd, cvt_xmm_xmm32_insn, (0xF35AUL<<8)|2, CPU_SSE2, NONE -cvtss2si, cvt_rx_xmm32_insn, (0xF32DUL<<8)|4, CPU_386|CPU_SSE, NONE -cvttpd2dq, ssess_insn, (0x66E6UL<<8)|1, CPU_SSE2, NONE -cvttpd2pi, cvt_mm_xmm_insn, (0x662CUL<<8)|1, CPU_SSE2, NONE -cvttps2dq, ssess_insn, (0xF35BUL<<8)|1, CPU_SSE2, NONE -cvttps2pi, cvt_mm_xmm64_insn, (0x2CUL<<8)|2, CPU_SSE, NONE -cvttsd2si, cvt_rx_xmm64_insn, (0xF22CUL<<8)|4, CPU_SSE2, NONE -cvttss2si, cvt_rx_xmm32_insn, (0xF32CUL<<8)|4, CPU_386|CPU_SSE, NONE -cwd, onebyte_insn, (0x001099UL<<8)|1, CPU_Any, NONE -cwde, onebyte_insn, (0x002098UL<<8)|1, CPU_386, NONE -daa, onebyte_insn, (0x000027UL<<8)|1, CPU_Not64, NONE -das, onebyte_insn, (0x00002FUL<<8)|1, CPU_Not64, NONE -dec, incdec_insn, (0x0148UL<<8)|6, CPU_Any, NONE -div, div_insn, (0x06UL<<8)|8, CPU_Any, NONE -divpd, ssess_insn, (0x665EUL<<8)|1, CPU_SSE2, NONE -divps, sseps_insn, (0x5EUL<<8)|1, CPU_SSE, NONE -divsd, ssess_insn, (0xF25EUL<<8)|1, CPU_SSE2, NONE -divss, ssess_insn, (0xF35EUL<<8)|1, CPU_SSE, NONE -dppd, sse4imm_insn, (0x41UL<<8)|1, CPU_SSE41, NONE -dpps, sse4imm_insn, (0x40UL<<8)|1, CPU_SSE41, NONE -emms, twobyte_insn, (0x0F77UL<<8)|1, CPU_MMX, NONE -enter, enter_insn, (0UL<<8)|3, CPU_186, NONE -extractps, extractps_insn, (0UL<<8)|2, CPU_386|CPU_SSE41, NONE -extrq, extrq_insn, (0UL<<8)|2, CPU_SSE41, NONE -f2xm1, twobyte_insn, (0xD9F0UL<<8)|1, CPU_FPU, NONE -fabs, twobyte_insn, (0xD9E1UL<<8)|1, CPU_FPU, NONE -fadd, farith_insn, (0x00C0C0UL<<8)|7, CPU_FPU, NONE -faddp, farithp_insn, (0xC0UL<<8)|3, CPU_FPU, NONE -fbld, fbldstp_insn, (0x04UL<<8)|1, CPU_FPU, NONE -fbstp, fbldstp_insn, (0x06UL<<8)|1, CPU_FPU, NONE -fchs, twobyte_insn, (0xD9E0UL<<8)|1, CPU_FPU, NONE -fclex, threebyte_insn, (0x9BDBE2UL<<8)|1, CPU_FPU, NONE -fcmovb, fcmovcc_insn, (0xDAC0UL<<8)|1, CPU_686|CPU_FPU, NONE -fcmovbe, fcmovcc_insn, (0xDAD0UL<<8)|1, CPU_686|CPU_FPU, NONE -fcmove, fcmovcc_insn, (0xDAC8UL<<8)|1, CPU_686|CPU_FPU, NONE -fcmovnb, fcmovcc_insn, (0xDBC0UL<<8)|1, CPU_686|CPU_FPU, NONE -fcmovnbe, fcmovcc_insn, (0xDBD0UL<<8)|1, CPU_686|CPU_FPU, NONE -fcmovne, fcmovcc_insn, (0xDBC8UL<<8)|1, CPU_686|CPU_FPU, NONE -fcmovnu, fcmovcc_insn, (0xDBD8UL<<8)|1, CPU_686|CPU_FPU, NONE -fcmovu, fcmovcc_insn, (0xDAD8UL<<8)|1, CPU_686|CPU_FPU, NONE -fcom, fcom_insn, (0x02D0UL<<8)|5, CPU_FPU, NONE -fcomi, fcom2_insn, (0xDBF0UL<<8)|2, CPU_686|CPU_FPU, NONE -fcomip, fcom2_insn, (0xDFF0UL<<8)|2, CPU_686|CPU_FPU, NONE -fcomp, fcom_insn, (0x03D8UL<<8)|5, CPU_FPU, NONE -fcompp, twobyte_insn, (0xDED9UL<<8)|1, CPU_FPU, NONE -fcos, twobyte_insn, (0xD9FFUL<<8)|1, CPU_286|CPU_FPU, NONE -fdecstp, twobyte_insn, (0xD9F6UL<<8)|1, CPU_FPU, NONE -fdiv, farith_insn, (0x06F0F8UL<<8)|7, CPU_FPU, NONE -fdivp, farithp_insn, (0xF8UL<<8)|3, CPU_FPU, NONE -fdivr, farith_insn, (0x07F8F0UL<<8)|7, CPU_FPU, NONE -fdivrp, farithp_insn, (0xF0UL<<8)|3, CPU_FPU, NONE -femms, twobyte_insn, (0x0F0EUL<<8)|1, CPU_3DNow, NONE -ffree, ffree_insn, (0xDDUL<<8)|1, CPU_FPU, NONE -ffreep, ffree_insn, (0xDFUL<<8)|1, CPU_686|CPU_FPU|CPU_Undoc, NONE -fiadd, fiarith_insn, (0x00DAUL<<8)|2, CPU_FPU, NONE -ficom, fiarith_insn, (0x02DAUL<<8)|2, CPU_FPU, NONE -ficomp, fiarith_insn, (0x03DAUL<<8)|2, CPU_FPU, NONE -fidiv, fiarith_insn, (0x06DAUL<<8)|2, CPU_FPU, NONE -fidivr, fiarith_insn, (0x07DAUL<<8)|2, CPU_FPU, NONE -fild, fildstp_insn, (0x050200UL<<8)|3, CPU_FPU, NONE -fimul, fiarith_insn, (0x01DAUL<<8)|2, CPU_FPU, NONE -fincstp, twobyte_insn, (0xD9F7UL<<8)|1, CPU_FPU, NONE -finit, threebyte_insn, (0x9BDBE3UL<<8)|1, CPU_FPU, NONE -fist, fiarith_insn, (0x02DBUL<<8)|2, CPU_FPU, NONE -fistp, fildstp_insn, (0x070203UL<<8)|3, CPU_FPU, NONE -fisttp, fildstp_insn, (0x010001UL<<8)|3, CPU_SSE3, NONE -fisub, fiarith_insn, (0x04DAUL<<8)|2, CPU_FPU, NONE -fisubr, fiarith_insn, (0x05DAUL<<8)|2, CPU_FPU, NONE -fld, fld_insn, (0UL<<8)|4, CPU_FPU, NONE -fld1, twobyte_insn, (0xD9E8UL<<8)|1, CPU_FPU, NONE -fldcw, fldnstcw_insn, (0x05UL<<8)|1, CPU_FPU, NONE -fldenv, onebytemem_insn, (0x04D9UL<<8)|1, CPU_FPU, NONE -fldl2e, twobyte_insn, (0xD9EAUL<<8)|1, CPU_FPU, NONE -fldl2t, twobyte_insn, (0xD9E9UL<<8)|1, CPU_FPU, NONE -fldlg2, twobyte_insn, (0xD9ECUL<<8)|1, CPU_FPU, NONE -fldln2, twobyte_insn, (0xD9EDUL<<8)|1, CPU_FPU, NONE -fldpi, twobyte_insn, (0xD9EBUL<<8)|1, CPU_FPU, NONE -fldz, twobyte_insn, (0xD9EEUL<<8)|1, CPU_FPU, NONE -fmul, farith_insn, (0x01C8C8UL<<8)|7, CPU_FPU, NONE -fmulp, farithp_insn, (0xC8UL<<8)|3, CPU_FPU, NONE -fnclex, twobyte_insn, (0xDBE2UL<<8)|1, CPU_FPU, NONE -fninit, twobyte_insn, (0xDBE3UL<<8)|1, CPU_FPU, NONE -fnop, twobyte_insn, (0xD9D0UL<<8)|1, CPU_FPU, NONE -fnsave, onebytemem_insn, (0x06DDUL<<8)|1, CPU_FPU, NONE -fnstcw, fldnstcw_insn, (0x07UL<<8)|1, CPU_FPU, NONE -fnstenv, onebytemem_insn, (0x06D9UL<<8)|1, CPU_FPU, NONE -fnstsw, fnstsw_insn, (0UL<<8)|2, CPU_FPU, NONE -fpatan, twobyte_insn, (0xD9F3UL<<8)|1, CPU_FPU, NONE -fprem, twobyte_insn, (0xD9F8UL<<8)|1, CPU_FPU, NONE -fprem1, twobyte_insn, (0xD9F5UL<<8)|1, CPU_286|CPU_FPU, NONE -fptan, twobyte_insn, (0xD9F2UL<<8)|1, CPU_FPU, NONE -frndint, twobyte_insn, (0xD9FCUL<<8)|1, CPU_FPU, NONE -frstor, onebytemem_insn, (0x04DDUL<<8)|1, CPU_FPU, NONE -fsave, twobytemem_insn, (0x069BDDUL<<8)|1, CPU_FPU, NONE -fscale, twobyte_insn, (0xD9FDUL<<8)|1, CPU_FPU, NONE -fsetpm, twobyte_insn, (0xDBE4UL<<8)|1, CPU_286|CPU_FPU|CPU_Obs, NONE -fsin, twobyte_insn, (0xD9FEUL<<8)|1, CPU_286|CPU_FPU, NONE -fsincos, twobyte_insn, (0xD9FBUL<<8)|1, CPU_286|CPU_FPU, NONE -fsqrt, twobyte_insn, (0xD9FAUL<<8)|1, CPU_FPU, NONE -fst, fst_insn, (0UL<<8)|3, CPU_FPU, NONE -fstcw, fstcw_insn, (0UL<<8)|1, CPU_FPU, NONE -fstenv, twobytemem_insn, (0x069BD9UL<<8)|1, CPU_FPU, NONE -fstp, fstp_insn, (0UL<<8)|4, CPU_FPU, NONE -fstsw, fstsw_insn, (0UL<<8)|2, CPU_FPU, NONE -fsub, farith_insn, (0x04E0E8UL<<8)|7, CPU_FPU, NONE -fsubp, farithp_insn, (0xE8UL<<8)|3, CPU_FPU, NONE -fsubr, farith_insn, (0x05E8E0UL<<8)|7, CPU_FPU, NONE -fsubrp, farithp_insn, (0xE0UL<<8)|3, CPU_FPU, NONE -ftst, twobyte_insn, (0xD9E4UL<<8)|1, CPU_FPU, NONE -fucom, fcom2_insn, (0xDDE0UL<<8)|2, CPU_286|CPU_FPU, NONE -fucomi, fcom2_insn, (0xDBE8UL<<8)|2, CPU_686|CPU_FPU, NONE -fucomip, fcom2_insn, (0xDFE8UL<<8)|2, CPU_686|CPU_FPU, NONE -fucomp, fcom2_insn, (0xDDE8UL<<8)|2, CPU_286|CPU_FPU, NONE -fucompp, twobyte_insn, (0xDAE9UL<<8)|1, CPU_286|CPU_FPU, NONE -fwait, onebyte_insn, (0x00009BUL<<8)|1, CPU_FPU, NONE -fxam, twobyte_insn, (0xD9E5UL<<8)|1, CPU_FPU, NONE -fxch, fxch_insn, (0UL<<8)|4, CPU_FPU, NONE -fxrstor, twobytemem_insn, (0x010FAEUL<<8)|1, CPU_686|CPU_FPU, NONE -fxsave, twobytemem_insn, (0x000FAEUL<<8)|1, CPU_686|CPU_FPU, NONE -fxtract, twobyte_insn, (0xD9F4UL<<8)|1, CPU_FPU, NONE -fyl2x, twobyte_insn, (0xD9F1UL<<8)|1, CPU_FPU, NONE -fyl2xp1, twobyte_insn, (0xD9F9UL<<8)|1, CPU_FPU, NONE -haddpd, ssess_insn, (0x667CUL<<8)|1, CPU_SSE3, NONE -haddps, ssess_insn, (0xF27CUL<<8)|1, CPU_SSE3, NONE -hlt, onebyte_insn, (0x0000F4UL<<8)|1, CPU_Priv, NONE -hsubpd, ssess_insn, (0x667DUL<<8)|1, CPU_SSE3, NONE -hsubps, ssess_insn, (0xF27DUL<<8)|1, CPU_SSE3, NONE -ibts, ibts_insn, (0UL<<8)|2, CPU_386|CPU_Obs|CPU_Undoc, NONE -idiv, div_insn, (0x07UL<<8)|8, CPU_Any, NONE -imul, imul_insn, (0UL<<8)|19, CPU_Any, NONE -in, in_insn, (0UL<<8)|12, CPU_Any, NONE -inc, incdec_insn, (0x0040UL<<8)|6, CPU_Any, NONE -insb, onebyte_insn, (0x00006CUL<<8)|1, CPU_Any, NONE -insd, onebyte_insn, (0x00206DUL<<8)|1, CPU_386, NONE -insertps, insertps_insn, (0UL<<8)|2, CPU_SSE41, NONE -insertq, insertq_insn, (0UL<<8)|2, CPU_SSE41, NONE -insw, onebyte_insn, (0x00106DUL<<8)|1, CPU_Any, NONE -int, int_insn, (0UL<<8)|1, CPU_Any, NONE -int03, onebyte_insn, (0x0000CCUL<<8)|1, CPU_Any, NONE -int3, onebyte_insn, (0x0000CCUL<<8)|1, CPU_Any, NONE -into, onebyte_insn, (0x0000CEUL<<8)|1, CPU_Not64, NONE -invd, twobyte_insn, (0x0F08UL<<8)|1, CPU_486|CPU_Priv, NONE -invlpg, twobytemem_insn, (0x070F01UL<<8)|1, CPU_486|CPU_Priv, NONE -invlpga, invlpga_insn, (0UL<<8)|2, CPU_SVM, NONE -iret, onebyte_insn, (0x0000CFUL<<8)|1, CPU_Any, NONE -iretd, onebyte_insn, (0x0020CFUL<<8)|1, CPU_386, NONE -iretq, onebyte_insn, (0x0040CFUL<<8)|1, CPU_64, NONE -iretw, onebyte_insn, (0x0010CFUL<<8)|1, CPU_Any, NONE -ja, jcc_insn, (0x07UL<<8)|9, CPU_Any, NONE -jae, jcc_insn, (0x03UL<<8)|9, CPU_Any, NONE -jb, jcc_insn, (0x02UL<<8)|9, CPU_Any, NONE -jbe, jcc_insn, (0x06UL<<8)|9, CPU_Any, NONE -jc, jcc_insn, (0x02UL<<8)|9, CPU_Any, NONE -jcxz, jcxz_insn, (0x10UL<<8)|2, CPU_Any, NONE -je, jcc_insn, (0x04UL<<8)|9, CPU_Any, NONE -jecxz, jcxz_insn, (0x20UL<<8)|2, CPU_386, NONE -jg, jcc_insn, (0x0FUL<<8)|9, CPU_Any, NONE -jge, jcc_insn, (0x0DUL<<8)|9, CPU_Any, NONE -jl, jcc_insn, (0x0CUL<<8)|9, CPU_Any, NONE -jle, jcc_insn, (0x0EUL<<8)|9, CPU_Any, NONE -jmp, jmp_insn, (0UL<<8)|27, CPU_Any, NONE -jna, jcc_insn, (0x06UL<<8)|9, CPU_Any, NONE -jnae, jcc_insn, (0x02UL<<8)|9, CPU_Any, NONE -jnb, jcc_insn, (0x03UL<<8)|9, CPU_Any, NONE -jnbe, jcc_insn, (0x07UL<<8)|9, CPU_Any, NONE -jnc, jcc_insn, (0x03UL<<8)|9, CPU_Any, NONE -jne, jcc_insn, (0x05UL<<8)|9, CPU_Any, NONE -jng, jcc_insn, (0x0EUL<<8)|9, CPU_Any, NONE -jnge, jcc_insn, (0x0CUL<<8)|9, CPU_Any, NONE -jnl, jcc_insn, (0x0DUL<<8)|9, CPU_Any, NONE -jnle, jcc_insn, (0x0FUL<<8)|9, CPU_Any, NONE -jno, jcc_insn, (0x01UL<<8)|9, CPU_Any, NONE -jnp, jcc_insn, (0x0BUL<<8)|9, CPU_Any, NONE -jns, jcc_insn, (0x09UL<<8)|9, CPU_Any, NONE -jnz, jcc_insn, (0x05UL<<8)|9, CPU_Any, NONE -jo, jcc_insn, (0x00UL<<8)|9, CPU_Any, NONE -jp, jcc_insn, (0x0AUL<<8)|9, CPU_Any, NONE -jpe, jcc_insn, (0x0AUL<<8)|9, CPU_Any, NONE -jpo, jcc_insn, (0x0BUL<<8)|9, CPU_Any, NONE -jrcxz, jcxz_insn, (0x40UL<<8)|2, CPU_64, NONE -js, jcc_insn, (0x08UL<<8)|9, CPU_Any, NONE -jz, jcc_insn, (0x04UL<<8)|9, CPU_Any, NONE -lahf, onebyte_insn, (0x00009FUL<<8)|1, CPU_Any, NONE -lar, bsfr_insn, (0x02UL<<8)|3, CPU_286|CPU_Prot, NONE -lddqu, lddqu_insn, (0UL<<8)|1, CPU_SSE3, NONE -ldmxcsr, ldstmxcsr_insn, (0x02UL<<8)|1, CPU_SSE, NONE -lds, ldes_insn, (0xC5UL<<8)|2, CPU_Not64, NONE -lea, lea_insn, (0UL<<8)|3, CPU_Any, NONE -leave, onebyte_insn, (0x4000C9UL<<8)|1, CPU_186, NONE -les, ldes_insn, (0xC4UL<<8)|2, CPU_Not64, NONE -lfence, threebyte_insn, (0x0FAEE8UL<<8)|1, CPU_P3, NONE -lfs, lfgss_insn, (0xB4UL<<8)|2, CPU_386, NONE -lgdt, twobytemem_insn, (0x020F01UL<<8)|1, CPU_286|CPU_Priv, NONE -lgs, lfgss_insn, (0xB5UL<<8)|2, CPU_386, NONE -lidt, twobytemem_insn, (0x030F01UL<<8)|1, CPU_286|CPU_Priv, NONE -lldt, prot286_insn, (0x0200UL<<8)|1, CPU_286|CPU_Priv|CPU_Prot, NONE -lmsw, prot286_insn, (0x0601UL<<8)|1, CPU_286|CPU_Priv, NONE -loadall, twobyte_insn, (0x0F07UL<<8)|1, CPU_386|CPU_Undoc, NONE -loadall286, twobyte_insn, (0x0F05UL<<8)|1, CPU_286|CPU_Undoc, NONE -lock, NULL, X86_LOCKREP, 0xF0, NONE -lodsb, onebyte_insn, (0x0000ACUL<<8)|1, CPU_Any, NONE -lodsd, onebyte_insn, (0x0020ADUL<<8)|1, CPU_386, NONE -lodsq, onebyte_insn, (0x0040ADUL<<8)|1, CPU_64, NONE -lodsw, onebyte_insn, (0x0010ADUL<<8)|1, CPU_Any, NONE -loop, loop_insn, (0x02UL<<8)|8, CPU_Any, NONE -loope, loop_insn, (0x01UL<<8)|8, CPU_Any, NONE -loopne, loop_insn, (0x00UL<<8)|8, CPU_Any, NONE -loopnz, loop_insn, (0x00UL<<8)|8, CPU_Any, NONE -loopz, loop_insn, (0x01UL<<8)|8, CPU_Any, NONE -lsl, bsfr_insn, (0x03UL<<8)|3, CPU_286|CPU_Prot, NONE -lss, lfgss_insn, (0xB2UL<<8)|2, CPU_386, NONE -ltr, prot286_insn, (0x0300UL<<8)|1, CPU_286|CPU_Priv|CPU_Prot, NONE -lzcnt, cnt_insn, (0xBDUL<<8)|3, CPU_686|CPU_AMD, NONE -maskmovdqu, maskmovdqu_insn, (0UL<<8)|1, CPU_SSE2, NONE -maskmovq, maskmovq_insn, (0UL<<8)|1, CPU_MMX|CPU_P3, NONE -maxpd, ssess_insn, (0x665FUL<<8)|1, CPU_SSE2, NONE -maxps, sseps_insn, (0x5FUL<<8)|1, CPU_SSE, NONE -maxsd, ssess_insn, (0xF25FUL<<8)|1, CPU_SSE2, NONE -maxss, ssess_insn, (0xF35FUL<<8)|1, CPU_SSE, NONE -mfence, threebyte_insn, (0x0FAEF0UL<<8)|1, CPU_P3, NONE -minpd, ssess_insn, (0x665DUL<<8)|1, CPU_SSE2, NONE -minps, sseps_insn, (0x5DUL<<8)|1, CPU_SSE, NONE -minsd, ssess_insn, (0xF25DUL<<8)|1, CPU_SSE2, NONE -minss, ssess_insn, (0xF35DUL<<8)|1, CPU_SSE, NONE -monitor, threebyte_insn, (0x0F01C8UL<<8)|1, CPU_SSE3, NONE -montmul, padlock_insn, (0xC0F3A6UL<<8)|1, CPU_PadLock, NONE -mov, mov_insn, (0UL<<8)|69, CPU_Any, NONE -movapd, movaupd_insn, (0x28UL<<8)|2, CPU_SSE2, NONE -movaps, movaups_insn, (0x28UL<<8)|2, CPU_SSE, NONE -movd, movd_insn, (0UL<<8)|8, CPU_386|CPU_MMX, NONE -movddup, cvt_xmm_xmm64_ss_insn, (0xF212UL<<8)|2, CPU_SSE3, NONE -movdq2q, movdq2q_insn, (0UL<<8)|1, CPU_SSE2, NONE -movdqa, movdqau_insn, (0x66UL<<8)|2, CPU_SSE2, NONE -movdqu, movdqau_insn, (0xF3UL<<8)|2, CPU_SSE2, NONE -movhlps, movhllhps_insn, (0x12UL<<8)|1, CPU_SSE, NONE -movhpd, movhlpd_insn, (0x16UL<<8)|2, CPU_SSE2, NONE -movhps, movhlps_insn, (0x16UL<<8)|2, CPU_SSE, NONE -movlhps, movhllhps_insn, (0x16UL<<8)|1, CPU_SSE, NONE -movlpd, movhlpd_insn, (0x12UL<<8)|2, CPU_SSE2, NONE -movlps, movhlps_insn, (0x12UL<<8)|2, CPU_SSE, NONE -movmskpd, movmskpd_insn, (0UL<<8)|2, CPU_386|CPU_SSE2, NONE -movmskps, movmskps_insn, (0UL<<8)|2, CPU_386|CPU_SSE, NONE -movntdq, movntpddq_insn, (0xE7UL<<8)|1, CPU_SSE2, NONE -movntdqa, movntdqa_insn, (0UL<<8)|1, CPU_SSE41, NONE -movnti, movnti_insn, (0UL<<8)|2, CPU_P4, NONE -movntpd, movntpddq_insn, (0x2BUL<<8)|1, CPU_SSE2, NONE -movntps, movntps_insn, (0UL<<8)|1, CPU_SSE, NONE -movntq, movntq_insn, (0UL<<8)|1, CPU_SSE, NONE -movntsd, movntsd_insn, (0UL<<8)|1, CPU_SSE41, NONE -movntss, movntss_insn, (0UL<<8)|1, CPU_SSE41, NONE -movq, movq_insn, (0UL<<8)|9, CPU_MMX, NONE -movq2dq, movq2dq_insn, (0UL<<8)|1, CPU_SSE2, NONE -movsb, onebyte_insn, (0x0000A4UL<<8)|1, CPU_Any, NONE -movsd, movsd_insn, (0UL<<8)|4, CPU_386, NONE -movshdup, ssess_insn, (0xF316UL<<8)|1, CPU_SSE3, NONE -movsldup, ssess_insn, (0xF312UL<<8)|1, CPU_SSE3, NONE -movsq, onebyte_insn, (0x0040A5UL<<8)|1, CPU_64, NONE -movss, movss_insn, (0UL<<8)|3, CPU_SSE, NONE -movsw, onebyte_insn, (0x0010A5UL<<8)|1, CPU_Any, NONE -movsx, movszx_insn, (0xBEUL<<8)|5, CPU_386, NONE -movsxd, movsxd_insn, (0UL<<8)|1, CPU_64, NONE -movupd, movaupd_insn, (0x10UL<<8)|2, CPU_SSE2, NONE -movups, movaups_insn, (0x10UL<<8)|2, CPU_SSE, NONE -movzx, movszx_insn, (0xB6UL<<8)|5, CPU_386, NONE -mpsadbw, sse4imm_insn, (0x42UL<<8)|1, CPU_SSE41, NONE -mul, f6_insn, (0x04UL<<8)|4, CPU_Any, NONE -mulpd, ssess_insn, (0x6659UL<<8)|1, CPU_SSE2, NONE -mulps, sseps_insn, (0x59UL<<8)|1, CPU_SSE, NONE -mulsd, ssess_insn, (0xF259UL<<8)|1, CPU_SSE2, NONE -mulss, ssess_insn, (0xF359UL<<8)|1, CPU_SSE, NONE -mwait, threebyte_insn, (0x0F01C9UL<<8)|1, CPU_SSE3, NONE -neg, f6_insn, (0x03UL<<8)|4, CPU_Any, NONE -nop, onebyte_insn, (0x000090UL<<8)|1, CPU_Any, NONE -not, f6_insn, (0x02UL<<8)|4, CPU_Any, NONE -o16, NULL, X86_OPERSIZE, 0x10, NONE -o32, NULL, X86_OPERSIZE, 0x20, NONE -o64, NULL, X86_OPERSIZE, 0x40, NONE -or, arith_insn, (0x0108UL<<8)|22, CPU_Any, NONE -orpd, ssess_insn, (0x6656UL<<8)|1, CPU_SSE2, NONE -orps, sseps_insn, (0x56UL<<8)|1, CPU_SSE, NONE -out, out_insn, (0UL<<8)|12, CPU_Any, NONE -outsb, onebyte_insn, (0x00006EUL<<8)|1, CPU_Any, NONE -outsd, onebyte_insn, (0x00206FUL<<8)|1, CPU_386, NONE -outsw, onebyte_insn, (0x00106FUL<<8)|1, CPU_Any, NONE -pabsb, ssse3_insn, (0x1CUL<<8)|2, CPU_SSSE3, NONE -pabsd, ssse3_insn, (0x1EUL<<8)|2, CPU_SSSE3, NONE -pabsw, ssse3_insn, (0x1DUL<<8)|2, CPU_SSSE3, NONE -packssdw, mmxsse2_insn, (0x6BUL<<8)|2, CPU_MMX, NONE -packsswb, mmxsse2_insn, (0x63UL<<8)|2, CPU_MMX, NONE -packusdw, sse4_insn, (0x2BUL<<8)|1, CPU_SSE41, NONE -packuswb, mmxsse2_insn, (0x67UL<<8)|2, CPU_MMX, NONE -paddb, mmxsse2_insn, (0xFCUL<<8)|2, CPU_MMX, NONE -paddd, mmxsse2_insn, (0xFEUL<<8)|2, CPU_MMX, NONE -paddq, mmxsse2_insn, (0xD4UL<<8)|2, CPU_MMX, NONE -paddsb, mmxsse2_insn, (0xECUL<<8)|2, CPU_MMX, NONE -paddsiw, cyrixmmx_insn, (0x51UL<<8)|1, CPU_Cyrix|CPU_MMX, NONE -paddsw, mmxsse2_insn, (0xEDUL<<8)|2, CPU_MMX, NONE -paddusb, mmxsse2_insn, (0xDCUL<<8)|2, CPU_MMX, NONE -paddusw, mmxsse2_insn, (0xDDUL<<8)|2, CPU_MMX, NONE -paddw, mmxsse2_insn, (0xFDUL<<8)|2, CPU_MMX, NONE -palignr, ssse3imm_insn, (0x0FUL<<8)|2, CPU_SSSE3, NONE -pand, mmxsse2_insn, (0xDBUL<<8)|2, CPU_MMX, NONE -pandn, mmxsse2_insn, (0xDFUL<<8)|2, CPU_MMX, NONE -pause, onebyte_prefix_insn, (0xF390UL<<8)|1, CPU_P4, NONE -paveb, cyrixmmx_insn, (0x50UL<<8)|1, CPU_Cyrix|CPU_MMX, NONE -pavgb, mmxsse2_insn, (0xE0UL<<8)|2, CPU_MMX|CPU_P3, NONE -pavgusb, now3d_insn, (0xBFUL<<8)|1, CPU_3DNow, NONE -pavgw, mmxsse2_insn, (0xE3UL<<8)|2, CPU_MMX|CPU_P3, NONE -pblendvb, sse4xmm0_insn, (0x10UL<<8)|2, CPU_SSE41, NONE -pblendw, sse4imm_insn, (0x0EUL<<8)|1, CPU_SSE41, NONE -pcmpeqb, mmxsse2_insn, (0x74UL<<8)|2, CPU_MMX, NONE -pcmpeqd, mmxsse2_insn, (0x76UL<<8)|2, CPU_MMX, NONE -pcmpeqq, sse4_insn, (0x29UL<<8)|1, CPU_SSE41, NONE -pcmpeqw, mmxsse2_insn, (0x75UL<<8)|2, CPU_MMX, NONE -pcmpestri, sse4pcmpstr_insn, (0x61UL<<8)|1, CPU_SSE42, NONE -pcmpestrm, sse4pcmpstr_insn, (0x60UL<<8)|1, CPU_SSE42, NONE -pcmpgtb, mmxsse2_insn, (0x64UL<<8)|2, CPU_MMX, NONE -pcmpgtd, mmxsse2_insn, (0x66UL<<8)|2, CPU_MMX, NONE -pcmpgtq, sse4_insn, (0x37UL<<8)|1, CPU_SSE41, NONE -pcmpgtw, mmxsse2_insn, (0x65UL<<8)|2, CPU_MMX, NONE -pcmpistri, sse4pcmpstr_insn, (0x63UL<<8)|1, CPU_SSE42, NONE -pcmpistrm, sse4pcmpstr_insn, (0x62UL<<8)|1, CPU_SSE42, NONE -pdistib, cyrixmmx_insn, (0x54UL<<8)|1, CPU_Cyrix|CPU_MMX, NONE -pextrb, pextrb_insn, (0UL<<8)|3, CPU_SSE41, NONE -pextrd, pextrd_insn, (0UL<<8)|1, CPU_386|CPU_SSE41, NONE -pextrq, pextrq_insn, (0UL<<8)|1, CPU_64|CPU_SSE41, NONE -pextrw, pextrw_insn, (0UL<<8)|7, CPU_MMX|CPU_P3, NONE -pf2id, now3d_insn, (0x1DUL<<8)|1, CPU_3DNow, NONE -pf2iw, now3d_insn, (0x1CUL<<8)|1, CPU_3DNow|CPU_Athlon, NONE -pfacc, now3d_insn, (0xAEUL<<8)|1, CPU_3DNow, NONE -pfadd, now3d_insn, (0x9EUL<<8)|1, CPU_3DNow, NONE -pfcmpeq, now3d_insn, (0xB0UL<<8)|1, CPU_3DNow, NONE -pfcmpge, now3d_insn, (0x90UL<<8)|1, CPU_3DNow, NONE -pfcmpgt, now3d_insn, (0xA0UL<<8)|1, CPU_3DNow, NONE -pfmax, now3d_insn, (0xA4UL<<8)|1, CPU_3DNow, NONE -pfmin, now3d_insn, (0x94UL<<8)|1, CPU_3DNow, NONE -pfmul, now3d_insn, (0xB4UL<<8)|1, CPU_3DNow, NONE -pfnacc, now3d_insn, (0x8AUL<<8)|1, CPU_3DNow|CPU_Athlon, NONE -pfpnacc, now3d_insn, (0x8EUL<<8)|1, CPU_3DNow|CPU_Athlon, NONE -pfrcp, now3d_insn, (0x96UL<<8)|1, CPU_3DNow, NONE -pfrcpit1, now3d_insn, (0xA6UL<<8)|1, CPU_3DNow, NONE -pfrcpit2, now3d_insn, (0xB6UL<<8)|1, CPU_3DNow, NONE -pfrsqit1, now3d_insn, (0xA7UL<<8)|1, CPU_3DNow, NONE -pfrsqrt, now3d_insn, (0x97UL<<8)|1, CPU_3DNow, NONE -pfsub, now3d_insn, (0x9AUL<<8)|1, CPU_3DNow, NONE -pfsubr, now3d_insn, (0xAAUL<<8)|1, CPU_3DNow, NONE -phaddd, ssse3_insn, (0x02UL<<8)|2, CPU_SSSE3, NONE -phaddsw, ssse3_insn, (0x03UL<<8)|2, CPU_SSSE3, NONE -phaddw, ssse3_insn, (0x01UL<<8)|2, CPU_SSSE3, NONE -phminposuw, sse4_insn, (0x41UL<<8)|1, CPU_SSE41, NONE -phsubd, ssse3_insn, (0x06UL<<8)|2, CPU_SSSE3, NONE -phsubsw, ssse3_insn, (0x07UL<<8)|2, CPU_SSSE3, NONE -phsubw, ssse3_insn, (0x05UL<<8)|2, CPU_SSSE3, NONE -pi2fd, now3d_insn, (0x0DUL<<8)|1, CPU_3DNow, NONE -pi2fw, now3d_insn, (0x0CUL<<8)|1, CPU_3DNow|CPU_Athlon, NONE -pinsrb, pinsrb_insn, (0UL<<8)|2, CPU_SSE41, NONE -pinsrd, pinsrd_insn, (0UL<<8)|1, CPU_386|CPU_SSE41, NONE -pinsrq, pinsrq_insn, (0UL<<8)|1, CPU_64|CPU_SSE41, NONE -pinsrw, pinsrw_insn, (0UL<<8)|6, CPU_MMX|CPU_P3, NONE -pmachriw, pmachriw_insn, (0UL<<8)|1, CPU_Cyrix|CPU_MMX, NONE -pmaddubsw, ssse3_insn, (0x04UL<<8)|2, CPU_SSSE3, NONE -pmaddwd, mmxsse2_insn, (0xF5UL<<8)|2, CPU_MMX, NONE -pmagw, cyrixmmx_insn, (0x52UL<<8)|1, CPU_Cyrix|CPU_MMX, NONE -pmaxsb, sse4_insn, (0x3CUL<<8)|1, CPU_SSE41, NONE -pmaxsd, sse4_insn, (0x3DUL<<8)|1, CPU_SSE41, NONE -pmaxsw, mmxsse2_insn, (0xEEUL<<8)|2, CPU_MMX|CPU_P3, NONE -pmaxub, mmxsse2_insn, (0xDEUL<<8)|2, CPU_MMX|CPU_P3, NONE -pmaxud, sse4_insn, (0x3FUL<<8)|1, CPU_SSE41, NONE -pmaxuw, sse4_insn, (0x3EUL<<8)|1, CPU_SSE41, NONE -pminsb, sse4_insn, (0x38UL<<8)|1, CPU_SSE41, NONE -pminsd, sse4_insn, (0x39UL<<8)|1, CPU_SSE41, NONE -pminsw, mmxsse2_insn, (0xEAUL<<8)|2, CPU_MMX|CPU_P3, NONE -pminub, mmxsse2_insn, (0xDAUL<<8)|2, CPU_MMX|CPU_P3, NONE -pminud, sse4_insn, (0x3BUL<<8)|1, CPU_SSE41, NONE -pminuw, sse4_insn, (0x3AUL<<8)|1, CPU_SSE41, NONE -pmovmskb, pmovmskb_insn, (0UL<<8)|4, CPU_MMX|CPU_P3, NONE -pmovsxbd, sse4m32_insn, (0x21UL<<8)|2, CPU_SSE41, NONE -pmovsxbq, sse4m16_insn, (0x22UL<<8)|2, CPU_SSE41, NONE -pmovsxbw, sse4m64_insn, (0x20UL<<8)|2, CPU_SSE41, NONE -pmovsxdq, sse4m64_insn, (0x25UL<<8)|2, CPU_SSE41, NONE -pmovsxwd, sse4m64_insn, (0x23UL<<8)|2, CPU_SSE41, NONE -pmovsxwq, sse4m32_insn, (0x24UL<<8)|2, CPU_SSE41, NONE -pmovzxbd, sse4m32_insn, (0x31UL<<8)|2, CPU_SSE41, NONE -pmovzxbq, sse4m16_insn, (0x32UL<<8)|2, CPU_SSE41, NONE -pmovzxbw, sse4m64_insn, (0x30UL<<8)|2, CPU_SSE41, NONE -pmovzxdq, sse4m64_insn, (0x35UL<<8)|2, CPU_SSE41, NONE -pmovzxwd, sse4m64_insn, (0x33UL<<8)|2, CPU_SSE41, NONE -pmovzxwq, sse4m32_insn, (0x34UL<<8)|2, CPU_SSE41, NONE -pmuldq, sse4_insn, (0x28UL<<8)|1, CPU_SSE41, NONE -pmulhriw, cyrixmmx_insn, (0x5DUL<<8)|1, CPU_Cyrix|CPU_MMX, NONE -pmulhrsw, ssse3_insn, (0x0BUL<<8)|2, CPU_SSSE3, NONE -pmulhrwa, now3d_insn, (0xB7UL<<8)|1, CPU_3DNow, NONE -pmulhrwc, cyrixmmx_insn, (0x59UL<<8)|1, CPU_Cyrix|CPU_MMX, NONE -pmulhuw, mmxsse2_insn, (0xE4UL<<8)|2, CPU_MMX|CPU_P3, NONE -pmulhw, mmxsse2_insn, (0xE5UL<<8)|2, CPU_MMX, NONE -pmulld, sse4_insn, (0x40UL<<8)|1, CPU_SSE41, NONE -pmullw, mmxsse2_insn, (0xD5UL<<8)|2, CPU_MMX, NONE -pmuludq, mmxsse2_insn, (0xF4UL<<8)|2, CPU_SSE2, NONE -pmvgezb, cyrixmmx_insn, (0x5CUL<<8)|1, CPU_Cyrix|CPU_MMX, NONE -pmvlzb, cyrixmmx_insn, (0x5BUL<<8)|1, CPU_Cyrix|CPU_MMX, NONE -pmvnzb, cyrixmmx_insn, (0x5AUL<<8)|1, CPU_Cyrix|CPU_MMX, NONE -pmvzb, cyrixmmx_insn, (0x58UL<<8)|1, CPU_Cyrix|CPU_MMX, NONE -pop, pop_insn, (0UL<<8)|21, CPU_Any, NONE -popa, onebyte_insn, (0x000061UL<<8)|1, CPU_186|CPU_Not64, NONE -popad, onebyte_insn, (0x002061UL<<8)|1, CPU_386|CPU_Not64, NONE -popaw, onebyte_insn, (0x001061UL<<8)|1, CPU_186|CPU_Not64, NONE -popcnt, cnt_insn, (0xB8UL<<8)|3, CPU_SSE42, NONE -popf, onebyte_insn, (0x40009DUL<<8)|1, CPU_Any, NONE -popfd, onebyte_insn, (0x00209DUL<<8)|1, CPU_386|CPU_Not64, NONE -popfq, onebyte_insn, (0x40409DUL<<8)|1, CPU_64, NONE -popfw, onebyte_insn, (0x40109DUL<<8)|1, CPU_Any, NONE -por, mmxsse2_insn, (0xEBUL<<8)|2, CPU_MMX, NONE -prefetch, twobytemem_insn, (0x000F0DUL<<8)|1, CPU_3DNow, NONE -prefetchnta, twobytemem_insn, (0x000F18UL<<8)|1, CPU_P3, NONE -prefetcht0, twobytemem_insn, (0x010F18UL<<8)|1, CPU_P3, NONE -prefetcht1, twobytemem_insn, (0x020F18UL<<8)|1, CPU_P3, NONE -prefetcht2, twobytemem_insn, (0x030F18UL<<8)|1, CPU_P3, NONE -prefetchw, twobytemem_insn, (0x010F0DUL<<8)|1, CPU_3DNow, NONE -psadbw, mmxsse2_insn, (0xF6UL<<8)|2, CPU_MMX|CPU_P3, NONE -pshufb, ssse3_insn, (0x00UL<<8)|2, CPU_SSSE3, NONE -pshufd, ssessimm_insn, (0x6670UL<<8)|1, CPU_SSE2, NONE -pshufhw, ssessimm_insn, (0xF370UL<<8)|1, CPU_SSE2, NONE -pshuflw, ssessimm_insn, (0xF270UL<<8)|1, CPU_SSE2, NONE -pshufw, pshufw_insn, (0UL<<8)|1, CPU_MMX|CPU_P3, NONE -psignb, ssse3_insn, (0x08UL<<8)|2, CPU_SSSE3, NONE -psignd, ssse3_insn, (0x0AUL<<8)|2, CPU_SSSE3, NONE -psignw, ssse3_insn, (0x09UL<<8)|2, CPU_SSSE3, NONE -pslld, pshift_insn, (0x0672F2UL<<8)|4, CPU_MMX, NONE -pslldq, pslrldq_insn, (0x07UL<<8)|1, CPU_SSE2, NONE -psllq, pshift_insn, (0x0673F3UL<<8)|4, CPU_MMX, NONE -psllw, pshift_insn, (0x0671F1UL<<8)|4, CPU_MMX, NONE -psrad, pshift_insn, (0x0472E2UL<<8)|4, CPU_MMX, NONE -psraw, pshift_insn, (0x0471E1UL<<8)|4, CPU_MMX, NONE -psrld, pshift_insn, (0x0272D2UL<<8)|4, CPU_MMX, NONE -psrldq, pslrldq_insn, (0x03UL<<8)|1, CPU_SSE2, NONE -psrlq, pshift_insn, (0x0273D3UL<<8)|4, CPU_MMX, NONE -psrlw, pshift_insn, (0x0271D1UL<<8)|4, CPU_MMX, NONE -psubb, mmxsse2_insn, (0xF8UL<<8)|2, CPU_MMX, NONE -psubd, mmxsse2_insn, (0xFAUL<<8)|2, CPU_MMX, NONE -psubq, mmxsse2_insn, (0xFBUL<<8)|2, CPU_MMX, NONE -psubsb, mmxsse2_insn, (0xE8UL<<8)|2, CPU_MMX, NONE -psubsiw, cyrixmmx_insn, (0x55UL<<8)|1, CPU_Cyrix|CPU_MMX, NONE -psubsw, mmxsse2_insn, (0xE9UL<<8)|2, CPU_MMX, NONE -psubusb, mmxsse2_insn, (0xD8UL<<8)|2, CPU_MMX, NONE -psubusw, mmxsse2_insn, (0xD9UL<<8)|2, CPU_MMX, NONE -psubw, mmxsse2_insn, (0xF9UL<<8)|2, CPU_MMX, NONE -pswapd, now3d_insn, (0xBBUL<<8)|1, CPU_3DNow|CPU_Athlon, NONE -ptest, sse4_insn, (0x17UL<<8)|1, CPU_SSE41, NONE -punpckhbw, mmxsse2_insn, (0x68UL<<8)|2, CPU_MMX, NONE -punpckhdq, mmxsse2_insn, (0x6AUL<<8)|2, CPU_MMX, NONE -punpckhqdq, ssess_insn, (0x666DUL<<8)|1, CPU_SSE2, NONE -punpckhwd, mmxsse2_insn, (0x69UL<<8)|2, CPU_MMX, NONE -punpcklbw, mmxsse2_insn, (0x60UL<<8)|2, CPU_MMX, NONE -punpckldq, mmxsse2_insn, (0x62UL<<8)|2, CPU_MMX, NONE -punpcklqdq, ssess_insn, (0x666CUL<<8)|1, CPU_SSE2, NONE -punpcklwd, mmxsse2_insn, (0x61UL<<8)|2, CPU_MMX, NONE -push, push_insn, (0UL<<8)|33, CPU_Any, NONE -pusha, onebyte_insn, (0x000060UL<<8)|1, CPU_186|CPU_Not64, NONE -pushad, onebyte_insn, (0x002060UL<<8)|1, CPU_386|CPU_Not64, NONE -pushaw, onebyte_insn, (0x001060UL<<8)|1, CPU_186|CPU_Not64, NONE -pushf, onebyte_insn, (0x40009CUL<<8)|1, CPU_Any, NONE -pushfd, onebyte_insn, (0x00209CUL<<8)|1, CPU_386|CPU_Not64, NONE -pushfq, onebyte_insn, (0x40409CUL<<8)|1, CPU_64, NONE -pushfw, onebyte_insn, (0x40109CUL<<8)|1, CPU_Any, NONE -pxor, mmxsse2_insn, (0xEFUL<<8)|2, CPU_MMX, NONE -rcl, shift_insn, (0x02UL<<8)|16, CPU_Any, NONE -rcpps, sseps_insn, (0x53UL<<8)|1, CPU_SSE, NONE -rcpss, ssess_insn, (0xF353UL<<8)|1, CPU_SSE, NONE -rcr, shift_insn, (0x03UL<<8)|16, CPU_Any, NONE -rdmsr, twobyte_insn, (0x0F32UL<<8)|1, CPU_586|CPU_Priv, NONE -rdpmc, twobyte_insn, (0x0F33UL<<8)|1, CPU_686, NONE -rdshr, rdwrshr_insn, (0x00UL<<8)|1, CPU_686|CPU_Cyrix|CPU_SMM, NONE -rdtsc, twobyte_insn, (0x0F31UL<<8)|1, CPU_586, NONE -rdtscp, threebyte_insn, (0x0F01F9UL<<8)|1, CPU_686|CPU_AMD|CPU_Priv, NONE -rep, NULL, X86_LOCKREP, 0xF3, NONE -repe, NULL, X86_LOCKREP, 0xF3, NONE -repne, NULL, X86_LOCKREP, 0xF2, NONE -repnz, NULL, X86_LOCKREP, 0xF2, NONE -repz, NULL, X86_LOCKREP, 0xF3, NONE -ret, retnf_insn, (0x00C2UL<<8)|6, CPU_Any, NONE -retf, retnf_insn, (0x40CAUL<<8)|6, CPU_Any, NONE -retn, retnf_insn, (0x00C2UL<<8)|6, CPU_Any, NONE -rol, shift_insn, (0x00UL<<8)|16, CPU_Any, NONE -ror, shift_insn, (0x01UL<<8)|16, CPU_Any, NONE -roundpd, sse4imm_insn, (0x09UL<<8)|1, CPU_SSE41, NONE -roundps, sse4imm_insn, (0x08UL<<8)|1, CPU_SSE41, NONE -roundsd, sse4imm_insn, (0x0BUL<<8)|1, CPU_SSE41, NONE -roundss, sse4imm_insn, (0x0AUL<<8)|1, CPU_SSE41, NONE -rsdc, rsdc_insn, (0UL<<8)|1, CPU_486|CPU_Cyrix|CPU_SMM, NONE -rsldt, cyrixsmm_insn, (0x7BUL<<8)|1, CPU_486|CPU_Cyrix|CPU_SMM, NONE -rsm, twobyte_insn, (0x0FAAUL<<8)|1, CPU_586|CPU_SMM, NONE -rsqrtps, sseps_insn, (0x52UL<<8)|1, CPU_SSE, NONE -rsqrtss, ssess_insn, (0xF352UL<<8)|1, CPU_SSE, NONE -rsts, cyrixsmm_insn, (0x7DUL<<8)|1, CPU_486|CPU_Cyrix|CPU_SMM, NONE -sahf, onebyte_insn, (0x00009EUL<<8)|1, CPU_Any, NONE -sal, shift_insn, (0x04UL<<8)|16, CPU_Any, NONE -salc, onebyte_insn, (0x0000D6UL<<8)|1, CPU_Not64|CPU_Undoc, NONE -sar, shift_insn, (0x07UL<<8)|16, CPU_Any, NONE -sbb, arith_insn, (0x0318UL<<8)|22, CPU_Any, NONE -scasb, onebyte_insn, (0x0000AEUL<<8)|1, CPU_Any, NONE -scasd, onebyte_insn, (0x0020AFUL<<8)|1, CPU_386, NONE -scasq, onebyte_insn, (0x0040AFUL<<8)|1, CPU_64, NONE -scasw, onebyte_insn, (0x0010AFUL<<8)|1, CPU_Any, NONE -seta, setcc_insn, (0x07UL<<8)|1, CPU_386, NONE -setae, setcc_insn, (0x03UL<<8)|1, CPU_386, NONE -setb, setcc_insn, (0x02UL<<8)|1, CPU_386, NONE -setbe, setcc_insn, (0x06UL<<8)|1, CPU_386, NONE -setc, setcc_insn, (0x02UL<<8)|1, CPU_386, NONE -sete, setcc_insn, (0x04UL<<8)|1, CPU_386, NONE -setg, setcc_insn, (0x0FUL<<8)|1, CPU_386, NONE -setge, setcc_insn, (0x0DUL<<8)|1, CPU_386, NONE -setl, setcc_insn, (0x0CUL<<8)|1, CPU_386, NONE -setle, setcc_insn, (0x0EUL<<8)|1, CPU_386, NONE -setna, setcc_insn, (0x06UL<<8)|1, CPU_386, NONE -setnae, setcc_insn, (0x02UL<<8)|1, CPU_386, NONE -setnb, setcc_insn, (0x03UL<<8)|1, CPU_386, NONE -setnbe, setcc_insn, (0x07UL<<8)|1, CPU_386, NONE -setnc, setcc_insn, (0x03UL<<8)|1, CPU_386, NONE -setne, setcc_insn, (0x05UL<<8)|1, CPU_386, NONE -setng, setcc_insn, (0x0EUL<<8)|1, CPU_386, NONE -setnge, setcc_insn, (0x0CUL<<8)|1, CPU_386, NONE -setnl, setcc_insn, (0x0DUL<<8)|1, CPU_386, NONE -setnle, setcc_insn, (0x0FUL<<8)|1, CPU_386, NONE -setno, setcc_insn, (0x01UL<<8)|1, CPU_386, NONE -setnp, setcc_insn, (0x0BUL<<8)|1, CPU_386, NONE -setns, setcc_insn, (0x09UL<<8)|1, CPU_386, NONE -setnz, setcc_insn, (0x05UL<<8)|1, CPU_386, NONE -seto, setcc_insn, (0x00UL<<8)|1, CPU_386, NONE -setp, setcc_insn, (0x0AUL<<8)|1, CPU_386, NONE -setpe, setcc_insn, (0x0AUL<<8)|1, CPU_386, NONE -setpo, setcc_insn, (0x0BUL<<8)|1, CPU_386, NONE -sets, setcc_insn, (0x08UL<<8)|1, CPU_386, NONE -setz, setcc_insn, (0x04UL<<8)|1, CPU_386, NONE -sfence, threebyte_insn, (0x0FAEF8UL<<8)|1, CPU_P3, NONE -sgdt, twobytemem_insn, (0x000F01UL<<8)|1, CPU_286|CPU_Priv, NONE -shl, shift_insn, (0x04UL<<8)|16, CPU_Any, NONE -shld, shlrd_insn, (0xA4UL<<8)|9, CPU_386, NONE -shr, shift_insn, (0x05UL<<8)|16, CPU_Any, NONE -shrd, shlrd_insn, (0xACUL<<8)|9, CPU_386, NONE -shufpd, ssessimm_insn, (0x66C6UL<<8)|1, CPU_SSE2, NONE -shufps, ssepsimm_insn, (0xC6UL<<8)|1, CPU_SSE, NONE -sidt, twobytemem_insn, (0x010F01UL<<8)|1, CPU_286|CPU_Priv, NONE -skinit, skinit_insn, (0UL<<8)|2, CPU_SVM, NONE -sldt, sldtmsw_insn, (0x0000UL<<8)|6, CPU_286, NONE -smi, onebyte_insn, (0x0000F1UL<<8)|1, CPU_386|CPU_Undoc, NONE -smint, twobyte_insn, (0x0F38UL<<8)|1, CPU_686|CPU_Cyrix, NONE -smintold, twobyte_insn, (0x0F7EUL<<8)|1, CPU_486|CPU_Cyrix|CPU_Obs, NONE -smsw, sldtmsw_insn, (0x0401UL<<8)|6, CPU_286, NONE -sqrtpd, ssess_insn, (0x6651UL<<8)|1, CPU_SSE2, NONE -sqrtps, sseps_insn, (0x51UL<<8)|1, CPU_SSE, NONE -sqrtsd, ssess_insn, (0xF251UL<<8)|1, CPU_SSE2, NONE -sqrtss, ssess_insn, (0xF351UL<<8)|1, CPU_SSE, NONE -stc, onebyte_insn, (0x0000F9UL<<8)|1, CPU_Any, NONE -std, onebyte_insn, (0x0000FDUL<<8)|1, CPU_Any, NONE -stgi, threebyte_insn, (0x0F01DCUL<<8)|1, CPU_SVM, NONE -sti, onebyte_insn, (0x0000FBUL<<8)|1, CPU_Any, NONE -stmxcsr, ldstmxcsr_insn, (0x03UL<<8)|1, CPU_SSE, NONE -stosb, onebyte_insn, (0x0000AAUL<<8)|1, CPU_Any, NONE -stosd, onebyte_insn, (0x0020ABUL<<8)|1, CPU_386, NONE -stosq, onebyte_insn, (0x0040ABUL<<8)|1, CPU_64, NONE -stosw, onebyte_insn, (0x0010ABUL<<8)|1, CPU_Any, NONE -str, str_insn, (0UL<<8)|4, CPU_286|CPU_Prot, NONE -sub, arith_insn, (0x0528UL<<8)|22, CPU_Any, NONE -subpd, ssess_insn, (0x665CUL<<8)|1, CPU_SSE2, NONE -subps, sseps_insn, (0x5CUL<<8)|1, CPU_SSE, NONE -subsd, ssess_insn, (0xF25CUL<<8)|1, CPU_SSE2, NONE -subss, ssess_insn, (0xF35CUL<<8)|1, CPU_SSE, NONE -svdc, svdc_insn, (0UL<<8)|1, CPU_486|CPU_Cyrix|CPU_SMM, NONE -svldt, cyrixsmm_insn, (0x7AUL<<8)|1, CPU_486|CPU_Cyrix|CPU_SMM, NONE -svts, cyrixsmm_insn, (0x7CUL<<8)|1, CPU_486|CPU_Cyrix|CPU_SMM, NONE -swapgs, threebyte_insn, (0x0F01F8UL<<8)|1, CPU_64, NONE -syscall, twobyte_insn, (0x0F05UL<<8)|1, CPU_686|CPU_AMD, NONE -sysenter, twobyte_insn, (0x0F34UL<<8)|1, CPU_686|CPU_Not64, NONE -sysexit, twobyte_insn, (0x0F35UL<<8)|1, CPU_686|CPU_Not64|CPU_Priv, NONE -sysret, twobyte_insn, (0x0F07UL<<8)|1, CPU_686|CPU_AMD|CPU_Priv, NONE -test, test_insn, (0UL<<8)|20, CPU_Any, NONE -ucomisd, ssess_insn, (0x662EUL<<8)|1, CPU_SSE2, NONE -ucomiss, ssess_insn, (0x002EUL<<8)|1, CPU_SSE, NONE -ud1, twobyte_insn, (0x0FB9UL<<8)|1, CPU_286|CPU_Undoc, NONE -ud2, twobyte_insn, (0x0F0BUL<<8)|1, CPU_286, NONE -umov, umov_insn, (0UL<<8)|6, CPU_386|CPU_Undoc, NONE -unpckhpd, ssess_insn, (0x6615UL<<8)|1, CPU_SSE2, NONE -unpckhps, sseps_insn, (0x15UL<<8)|1, CPU_SSE, NONE -unpcklpd, ssess_insn, (0x6614UL<<8)|1, CPU_SSE2, NONE -unpcklps, sseps_insn, (0x14UL<<8)|1, CPU_SSE, NONE -verr, prot286_insn, (0x0400UL<<8)|1, CPU_286|CPU_Prot, NONE -verw, prot286_insn, (0x0500UL<<8)|1, CPU_286|CPU_Prot, NONE -vmcall, threebyte_insn, (0x0F01C1UL<<8)|1, CPU_P4, NONE -vmclear, vmxthreebytemem_insn, (0x66UL<<8)|1, CPU_P4, NONE -vmlaunch, threebyte_insn, (0x0F01C2UL<<8)|1, CPU_P4, NONE -vmload, svm_rax_insn, (0xDAUL<<8)|2, CPU_SVM, NONE -vmmcall, threebyte_insn, (0x0F01D9UL<<8)|1, CPU_SVM, NONE -vmptrld, vmxtwobytemem_insn, (0x06UL<<8)|1, CPU_P4, NONE -vmptrst, vmxtwobytemem_insn, (0x07UL<<8)|1, CPU_P4, NONE -vmread, vmxmemrd_insn, (0UL<<8)|2, CPU_P4, NONE -vmresume, threebyte_insn, (0x0F01C3UL<<8)|1, CPU_P4, NONE -vmrun, svm_rax_insn, (0xD8UL<<8)|2, CPU_SVM, NONE -vmsave, svm_rax_insn, (0xDBUL<<8)|2, CPU_SVM, NONE -vmwrite, vmxmemwr_insn, (0UL<<8)|2, CPU_P4, NONE -vmxoff, threebyte_insn, (0x0F01C4UL<<8)|1, CPU_P4, NONE -vmxon, vmxthreebytemem_insn, (0xF3UL<<8)|1, CPU_P4, NONE -wait, onebyte_insn, (0x00009BUL<<8)|1, CPU_Any, NONE -wbinvd, twobyte_insn, (0x0F09UL<<8)|1, CPU_486|CPU_Priv, NONE -wrmsr, twobyte_insn, (0x0F30UL<<8)|1, CPU_586|CPU_Priv, NONE -wrshr, rdwrshr_insn, (0x01UL<<8)|1, CPU_686|CPU_Cyrix|CPU_SMM, NONE -xadd, cmpxchgxadd_insn, (0xC0UL<<8)|4, CPU_486, NONE -xbts, xbts_insn, (0UL<<8)|2, CPU_386|CPU_Obs|CPU_Undoc, NONE -xchg, xchg_insn, (0UL<<8)|16, CPU_Any, NONE -xcryptcbc, padlock_insn, (0xD0F3A7UL<<8)|1, CPU_PadLock, NONE -xcryptcfb, padlock_insn, (0xE0F3A7UL<<8)|1, CPU_PadLock, NONE -xcryptctr, padlock_insn, (0xD8F3A7UL<<8)|1, CPU_PadLock, NONE -xcryptecb, padlock_insn, (0xC8F3A7UL<<8)|1, CPU_PadLock, NONE -xcryptofb, padlock_insn, (0xE8F3A7UL<<8)|1, CPU_PadLock, NONE -xlatb, onebyte_insn, (0x0000D7UL<<8)|1, CPU_Any, NONE -xor, arith_insn, (0x0630UL<<8)|22, CPU_Any, NONE -xorpd, ssess_insn, (0x6657UL<<8)|1, CPU_SSE2, NONE -xorps, sseps_insn, (0x57UL<<8)|1, CPU_SSE, NONE -xsha1, padlock_insn, (0xC8F3A6UL<<8)|1, CPU_PadLock, NONE -xsha256, padlock_insn, (0xD0F3A6UL<<8)|1, CPU_PadLock, NONE -xstore, padlock_insn, (0xC000A7UL<<8)|1, CPU_PadLock, NONE -xstorerng, padlock_insn, (0xC000A7UL<<8)|1, CPU_PadLock, NONE diff --git a/x86insns.c b/x86insns.c deleted file mode 100644 index ea70c478..00000000 --- a/x86insns.c +++ /dev/null @@ -1,1560 +0,0 @@ -static const unsigned long insn_operands[] = { - OPT_SIMDReg|OPS_128|OPA_Spare, - OPT_SIMDReg|OPS_128|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, - OPT_Reg|OPS_16|OPA_Spare, - OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_8|OPA_SImm, - OPT_Reg|OPS_32|OPA_Spare, - OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_8|OPA_SImm, - OPT_Reg|OPS_64|OPA_Spare, - OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_8|OPA_SImm, - OPT_Reg|OPS_16|OPA_Spare, - OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_16|OPS_Relaxed|OPA_SImm|OPAP_SImm8, - OPT_Reg|OPS_32|OPA_Spare, - OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_32|OPS_Relaxed|OPA_SImm|OPAP_SImm8, - OPT_Reg|OPS_64|OPA_Spare, - OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_32|OPS_Relaxed|OPA_SImm|OPAP_SImm8, - OPT_SIMDReg|OPS_64|OPA_Spare, - OPT_Reg|OPS_32|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, - OPT_SIMDReg|OPS_64|OPA_Spare, - OPT_Reg|OPS_64|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, - OPT_SIMDReg|OPS_64|OPA_Spare, - OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, - OPT_SIMDReg|OPS_128|OPA_Spare, - OPT_Reg|OPS_32|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, - OPT_SIMDReg|OPS_128|OPA_Spare, - OPT_Reg|OPS_64|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, - OPT_SIMDReg|OPS_128|OPA_Spare, - OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, - OPT_SIMDReg|OPS_128|OPA_Spare, - OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, - OPT_SIMDReg|OPS_128|OPA_Spare, - OPT_Mem|OPS_8|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, - OPT_SIMDReg|OPS_128|OPA_Spare, - OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, - OPT_Reg|OPS_32|OPA_Spare, - OPT_SIMDReg|OPS_64|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, - OPT_Reg|OPS_32|OPA_Spare, - OPT_SIMDReg|OPS_128|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, - OPT_Reg|OPS_64|OPA_Spare, - OPT_SIMDReg|OPS_64|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, - OPT_Reg|OPS_64|OPA_Spare, - OPT_SIMDReg|OPS_128|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, - OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, - OPT_SIMDReg|OPS_128|OPA_Spare, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, - OPT_Reg|OPS_32|OPA_EA, - OPT_SIMDReg|OPS_128|OPA_Spare, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, - OPT_Reg|OPS_64|OPA_EA, - OPT_SIMDReg|OPS_128|OPA_Spare, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, - OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, - OPT_SIMDReg|OPS_128|OPA_Spare, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, - OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, - OPT_SIMDReg|OPS_128|OPA_Spare, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, - OPT_Mem|OPS_8|OPS_Relaxed|OPA_EA, - OPT_SIMDReg|OPS_128|OPA_Spare, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, - OPT_SIMDReg|OPS_128|OPA_Spare, - OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, - OPT_XMM0|OPS_128|OPA_None, - OPT_SIMDReg|OPS_64|OPA_Spare, - OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, - OPT_SIMDReg|OPS_128|OPA_Spare, - OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, - OPT_SIMDReg|OPS_128|OPA_Spare, - OPT_SIMDReg|OPS_128|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, - OPT_SIMDReg|OPS_128|OPA_Spare, - OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, - OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, - OPT_Reg|OPS_16|OPA_Spare, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, - OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, - OPT_Reg|OPS_16|OPA_Spare, - OPT_Creg|OPS_8|OPA_None, - OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, - OPT_Reg|OPS_32|OPA_Spare, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, - OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, - OPT_Reg|OPS_32|OPA_Spare, - OPT_Creg|OPS_8|OPA_None, - OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, - OPT_Reg|OPS_64|OPA_Spare, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, - OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, - OPT_Reg|OPS_64|OPA_Spare, - OPT_Creg|OPS_8|OPA_None, - OPT_RM|OPS_16|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, - OPT_RM|OPS_32|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, - OPT_RM|OPS_64|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, - OPT_SIMDReg|OPS_64|OPA_Spare, - OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, - OPT_SIMDReg|OPS_64|OPA_Spare, - OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, - OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, - OPT_SIMDReg|OPS_64|OPA_Spare, - OPT_Reg|OPS_16|OPA_SpareEA, - OPT_Imm|OPS_8|OPA_SImm, - OPT_Reg|OPS_32|OPA_SpareEA, - OPT_Imm|OPS_8|OPA_SImm, - OPT_Reg|OPS_64|OPA_SpareEA, - OPT_Imm|OPS_8|OPA_SImm, - OPT_Reg|OPS_16|OPA_SpareEA, - OPT_Imm|OPS_16|OPS_Relaxed|OPA_SImm|OPAP_SImm8, - OPT_Reg|OPS_32|OPA_SpareEA, - OPT_Imm|OPS_32|OPS_Relaxed|OPA_SImm|OPAP_SImm8, - OPT_Reg|OPS_64|OPA_SpareEA, - OPT_Imm|OPS_32|OPS_Relaxed|OPA_SImm|OPAP_SImm8, - OPT_SIMDReg|OPS_64|OPA_Spare, - OPT_SIMDReg|OPS_128|OPA_EA, - OPT_SIMDReg|OPS_64|OPA_Spare, - OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, - OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, - OPT_Reg|OPS_8|OPA_Spare, - OPT_Reg|OPS_8|OPA_Spare, - OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, - OPT_ST0|OPS_80|OPA_None, - OPT_Reg|OPS_80|OPA_Op1Add, - OPT_Reg|OPS_80|OPA_Op1Add, - OPT_ST0|OPS_80|OPA_None, - OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, - OPT_SIMDReg|OPS_64|OPA_Spare, - OPT_SIMDReg|OPS_128|OPA_Spare, - OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, - OPT_SIMDRM|OPS_64|OPS_Relaxed|OPA_EA, - OPT_SIMDReg|OPS_128|OPA_Spare, - OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, - OPT_Reg|OPS_32|OPA_Spare, - OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, - OPT_Reg|OPS_64|OPA_Spare, - OPT_Areg|OPS_8|OPA_None, - OPT_MemOffs|OPS_8|OPS_Relaxed|OPEAS_64|OPA_EA, - OPT_Areg|OPS_16|OPA_None, - OPT_MemOffs|OPS_16|OPS_Relaxed|OPEAS_64|OPA_EA, - OPT_Areg|OPS_32|OPA_None, - OPT_MemOffs|OPS_32|OPS_Relaxed|OPEAS_64|OPA_EA, - OPT_Areg|OPS_64|OPA_None, - OPT_MemOffs|OPS_64|OPS_Relaxed|OPEAS_64|OPA_EA, - OPT_MemOffs|OPS_8|OPS_Relaxed|OPEAS_64|OPA_EA, - OPT_Areg|OPS_8|OPA_None, - OPT_MemOffs|OPS_16|OPS_Relaxed|OPEAS_64|OPA_EA, - OPT_Areg|OPS_16|OPA_None, - OPT_MemOffs|OPS_32|OPS_Relaxed|OPEAS_64|OPA_EA, - OPT_Areg|OPS_32|OPA_None, - OPT_MemOffs|OPS_64|OPS_Relaxed|OPEAS_64|OPA_EA, - OPT_Areg|OPS_64|OPA_None, - OPT_Reg|OPS_64|OPA_Op0Add, - OPT_Imm|OPS_64|OPS_Relaxed|OPA_Imm, - OPT_Reg|OPS_32|OPA_Spare, - OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, - OPT_Reg|OPS_64|OPA_Spare, - OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, - OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, - OPT_SIMDReg|OPS_64|OPA_Spare, - OPT_Areg|OPS_8|OPA_None, - OPT_MemOffs|OPS_8|OPS_Relaxed|OPA_EA, - OPT_Areg|OPS_16|OPA_None, - OPT_MemOffs|OPS_16|OPS_Relaxed|OPA_EA, - OPT_Areg|OPS_32|OPA_None, - OPT_MemOffs|OPS_32|OPS_Relaxed|OPA_EA, - OPT_MemOffs|OPS_8|OPS_Relaxed|OPA_EA, - OPT_Areg|OPS_8|OPA_None, - OPT_MemOffs|OPS_16|OPS_Relaxed|OPA_EA, - OPT_Areg|OPS_16|OPA_None, - OPT_MemOffs|OPS_32|OPS_Relaxed|OPA_EA, - OPT_Areg|OPS_32|OPA_None, - OPT_RM|OPS_8|OPS_Relaxed|OPA_EA|OPAP_ShortMov, - OPT_Areg|OPS_8|OPA_Spare, - OPT_RM|OPS_16|OPS_Relaxed|OPA_EA|OPAP_ShortMov, - OPT_Areg|OPS_16|OPA_Spare, - OPT_RM|OPS_32|OPS_Relaxed|OPA_EA|OPAP_ShortMov, - OPT_Areg|OPS_32|OPA_Spare, - OPT_RM|OPS_64|OPS_Relaxed|OPA_EA|OPAP_ShortMov, - OPT_Areg|OPS_64|OPA_Spare, - OPT_Areg|OPS_8|OPA_Spare, - OPT_RM|OPS_8|OPS_Relaxed|OPA_EA|OPAP_ShortMov, - OPT_Areg|OPS_16|OPA_Spare, - OPT_RM|OPS_16|OPS_Relaxed|OPA_EA|OPAP_ShortMov, - OPT_Areg|OPS_32|OPA_Spare, - OPT_RM|OPS_32|OPS_Relaxed|OPA_EA|OPAP_ShortMov, - OPT_Areg|OPS_64|OPA_Spare, - OPT_RM|OPS_64|OPS_Relaxed|OPA_EA|OPAP_ShortMov, - OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, - OPT_SegReg|OPS_16|OPS_Relaxed|OPA_Spare, - OPT_Reg|OPS_16|OPA_EA, - OPT_SegReg|OPS_16|OPS_Relaxed|OPA_Spare, - OPT_Reg|OPS_32|OPA_EA, - OPT_SegReg|OPS_16|OPS_Relaxed|OPA_Spare, - OPT_Reg|OPS_64|OPA_EA, - OPT_SegReg|OPS_16|OPS_Relaxed|OPA_Spare, - OPT_SegReg|OPS_16|OPS_Relaxed|OPA_Spare, - OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, - OPT_Reg|OPS_8|OPA_Op0Add, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, - OPT_Reg|OPS_16|OPA_Op0Add, - OPT_Imm|OPS_16|OPS_Relaxed|OPA_Imm, - OPT_Reg|OPS_32|OPA_Op0Add, - OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm, - OPT_Reg|OPS_64|OPA_Op0Add, - OPT_Imm|OPS_64|OPA_Imm, - OPT_Reg|OPS_64|OPA_Op0Add, - OPT_Imm|OPS_64|OPS_Relaxed|OPA_Imm|OPAP_SImm32Avail, - OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_8|OPA_Imm, - OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_16|OPA_Imm, - OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_32|OPA_Imm, - OPT_RM|OPS_64|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_32|OPA_Imm, - OPT_RM|OPS_8|OPA_EA, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, - OPT_RM|OPS_16|OPA_EA, - OPT_Imm|OPS_16|OPS_Relaxed|OPA_Imm, - OPT_RM|OPS_32|OPA_EA, - OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm, - OPT_RM|OPS_64|OPA_EA, - OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm, - OPT_CR4|OPS_32|OPA_Spare, - OPT_Reg|OPS_32|OPA_EA, - OPT_CRReg|OPS_32|OPA_Spare, - OPT_Reg|OPS_32|OPA_EA, - OPT_CRReg|OPS_32|OPA_Spare, - OPT_Reg|OPS_64|OPA_EA, - OPT_Reg|OPS_32|OPA_EA, - OPT_CR4|OPS_32|OPA_Spare, - OPT_Reg|OPS_64|OPA_EA, - OPT_CRReg|OPS_32|OPA_Spare, - OPT_DRReg|OPS_32|OPA_Spare, - OPT_Reg|OPS_32|OPA_EA, - OPT_DRReg|OPS_32|OPA_Spare, - OPT_Reg|OPS_64|OPA_EA, - OPT_Reg|OPS_64|OPA_EA, - OPT_DRReg|OPS_32|OPA_Spare, - OPT_SIMDReg|OPS_128|OPA_Spare, - OPT_SIMDReg|OPS_64|OPA_EA, - OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, - OPT_SIMDReg|OPS_128|OPA_Spare, - OPT_Areg|OPS_8|OPA_None, - OPT_RM|OPS_8|OPA_EA, - OPT_Areg|OPS_16|OPA_None, - OPT_RM|OPS_16|OPA_EA, - OPT_Areg|OPS_32|OPA_None, - OPT_RM|OPS_32|OPA_EA, - OPT_Areg|OPS_64|OPA_None, - OPT_RM|OPS_64|OPA_EA, - OPT_Mem|OPS_128|OPS_Relaxed|OPA_EA, - OPT_SIMDReg|OPS_128|OPA_Spare, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, - OPT_Areg|OPS_8|OPA_None, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, - OPT_Areg|OPS_16|OPA_None, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, - OPT_Areg|OPS_32|OPA_None, - OPT_Dreg|OPS_16|OPA_None, - OPT_Areg|OPS_8|OPA_None, - OPT_Dreg|OPS_16|OPA_None, - OPT_Areg|OPS_16|OPA_None, - OPT_Dreg|OPS_16|OPA_None, - OPT_Areg|OPS_32|OPA_None, - OPT_SIMDReg|OPS_128|OPA_Spare, - OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, - OPT_MemrAX|OPS_Any|OPA_AdSizeEA, - OPT_Creg|OPS_32|OPA_None, - OPT_Areg|OPS_16|OPA_None, - OPT_Reg|OPS_16|OPA_Op0Add, - OPT_Reg|OPS_16|OPA_Op0Add, - OPT_Areg|OPS_16|OPA_None, - OPT_Areg|OPS_32|OPA_EA, - OPT_Areg|OPS_32|OPA_Spare, - OPT_Areg|OPS_32|OPA_None, - OPT_Reg|OPS_32|OPA_Op0Add, - OPT_Reg|OPS_32|OPA_Op0Add, - OPT_Areg|OPS_32|OPA_None, - OPT_Areg|OPS_64|OPA_None, - OPT_Areg|OPS_64|OPA_Op0Add, - OPT_Reg|OPS_64|OPA_Op0Add, - OPT_Areg|OPS_64|OPA_None, - OPT_Reg|OPS_16|OPA_Spare, - OPT_Mem|OPS_16|OPS_Relaxed|OPA_EA, - OPT_Reg|OPS_64|OPA_Spare, - OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, - OPT_SegReg|OPS_16|OPS_Relaxed|OPA_Spare, - OPT_Mem|OPS_80|OPS_Relaxed|OPA_EA, - OPT_Reg|OPS_32|OPA_Spare, - OPT_RM|OPS_8|OPA_EA, - OPT_Reg|OPS_32|OPA_Spare, - OPT_RM|OPS_16|OPA_EA, - OPT_Reg|OPS_64|OPA_Spare, - OPT_RM|OPS_8|OPA_EA, - OPT_RM|OPS_8|OPA_EA, - OPT_Creg|OPS_8|OPA_None, - OPT_RM|OPS_8|OPA_EA, - OPT_Imm1|OPS_8|OPS_Relaxed|OPA_None, - OPT_RM|OPS_16|OPA_EA, - OPT_Creg|OPS_8|OPA_None, - OPT_RM|OPS_16|OPA_EA, - OPT_Imm1|OPS_8|OPS_Relaxed|OPA_None, - OPT_RM|OPS_32|OPA_EA, - OPT_Creg|OPS_8|OPA_None, - OPT_RM|OPS_32|OPA_EA, - OPT_Imm1|OPS_8|OPS_Relaxed|OPA_None, - OPT_RM|OPS_64|OPA_EA, - OPT_Creg|OPS_8|OPA_None, - OPT_RM|OPS_64|OPA_EA, - OPT_Imm1|OPS_8|OPS_Relaxed|OPA_None, - OPT_Mem|OPS_64|OPS_Relaxed|OPA_EA, - OPT_SIMDReg|OPS_128|OPA_Spare, - OPT_Reg|OPS_16|OPA_Spare, - OPT_Mem|OPS_Any|OPA_EA, - OPT_Reg|OPS_32|OPA_Spare, - OPT_Mem|OPS_Any|OPA_EA, - OPT_Areg|OPS_16|OPA_None, - OPT_Imm|OPS_16|OPS_Relaxed|OPA_Imm|OPAP_SImm8, - OPT_Areg|OPS_32|OPA_None, - OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm|OPAP_SImm8, - OPT_Areg|OPS_64|OPA_None, - OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm|OPAP_SImm8, - OPT_RM|OPS_16|OPA_EA, - OPT_Imm|OPS_8|OPA_SImm, - OPT_RM|OPS_16|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_16|OPA_Imm|OPAP_SImm8, - OPT_RM|OPS_16|OPA_EA, - OPT_Imm|OPS_16|OPS_Relaxed|OPA_Imm|OPAP_SImm8, - OPT_RM|OPS_32|OPA_EA, - OPT_Imm|OPS_8|OPA_SImm, - OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, - OPT_Imm|OPS_32|OPA_Imm|OPAP_SImm8, - OPT_RM|OPS_32|OPA_EA, - OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm|OPAP_SImm8, - OPT_RM|OPS_64|OPA_EA, - OPT_Imm|OPS_8|OPA_SImm, - OPT_RM|OPS_64|OPA_EA, - OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm|OPAP_SImm8, - OPT_SIMDReg|OPS_128|OPA_Spare, - OPT_Mem|OPS_128|OPS_Relaxed|OPA_EA, - OPT_Mem|OPS_32|OPS_Relaxed|OPA_EA, - OPT_SIMDReg|OPS_128|OPA_Spare, - OPT_Reg|OPS_16|OPA_Spare, - OPT_RM|OPS_8|OPS_Relaxed|OPA_EA, - OPT_Reg|OPS_64|OPA_Spare, - OPT_RM|OPS_16|OPA_EA, - OPT_Imm|OPS_Any|OPA_JmpRel, - OPT_Creg|OPS_16|OPA_AdSizeR, - OPT_Imm|OPS_Any|OPA_JmpRel, - OPT_Creg|OPS_32|OPA_AdSizeR, - OPT_Imm|OPS_Any|OPA_JmpRel, - OPT_Creg|OPS_64|OPA_AdSizeR, - OPT_Imm|OPS_Any|OPTM_Short|OPA_JmpRel, - OPT_Creg|OPS_16|OPA_AdSizeR, - OPT_Imm|OPS_Any|OPTM_Short|OPA_JmpRel, - OPT_Creg|OPS_32|OPA_AdSizeR, - OPT_Imm|OPS_Any|OPTM_Short|OPA_JmpRel, - OPT_Creg|OPS_64|OPA_AdSizeR, - OPT_SIMDReg|OPS_64|OPA_Spare, - OPT_SIMDRM|OPS_128|OPS_Relaxed|OPA_EA, - OPT_Areg|OPS_32|OPA_None, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, - OPT_Mem|OPS_80|OPS_Relaxed|OPA_EA, - OPT_SegReg|OPS_16|OPS_Relaxed|OPA_Spare, - OPT_Areg|OPS_16|OPA_None, - OPT_Imm|OPS_16|OPS_Relaxed|OPA_Imm, - OPT_Areg|OPS_32|OPA_None, - OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm, - OPT_Areg|OPS_64|OPA_None, - OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm, - OPT_SIMDReg|OPS_128|OPA_Spare, - OPT_Mem|OPS_Any|OPA_EA, - OPT_SIMDReg|OPS_64|OPA_Spare, - OPT_SIMDReg|OPS_64|OPA_EA, - OPT_Imm|OPS_16|OPS_Relaxed|OPA_EA|OPAP_A16, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_Imm, - OPT_Reg|OPS_64|OPA_Spare, - OPT_RM|OPS_32|OPA_EA, - OPT_Mem|OPS_80|OPA_EA, - OPT_Mem|OPS_16|OPA_EA, - OPT_Mem|OPS_32|OPA_EA, - OPT_Mem|OPS_64|OPA_EA, - OPT_MemEAX|OPS_Any|OPA_None, - OPT_SS|OPS_Any|OPA_None, - OPT_SS|OPS_16|OPA_None, - OPT_SS|OPS_32|OPA_None, - OPT_DS|OPS_Any|OPA_None, - OPT_DS|OPS_16|OPA_None, - OPT_DS|OPS_32|OPA_None, - OPT_ES|OPS_Any|OPA_None, - OPT_ES|OPS_16|OPA_None, - OPT_ES|OPS_32|OPA_None, - OPT_FS|OPS_Any|OPA_None, - OPT_FS|OPS_16|OPA_None, - OPT_FS|OPS_32|OPA_None, - OPT_GS|OPS_Any|OPA_None, - OPT_GS|OPS_16|OPA_None, - OPT_GS|OPS_32|OPA_None, - OPT_ImmNotSegOff|OPS_Any|OPA_JmpRel, - OPT_ImmNotSegOff|OPS_16|OPA_JmpRel, - OPT_ImmNotSegOff|OPS_32|OPA_JmpRel, - OPT_Imm|OPS_16|OPTM_Near|OPA_JmpRel, - OPT_Imm|OPS_32|OPTM_Near|OPA_JmpRel, - OPT_Imm|OPS_Any|OPTM_Near|OPA_JmpRel, - OPT_RM|OPS_16|OPTM_Near|OPA_EA, - OPT_RM|OPS_32|OPTM_Near|OPA_EA, - OPT_RM|OPS_64|OPTM_Near|OPA_EA, - OPT_Mem|OPS_Any|OPTM_Near|OPA_EA, - OPT_Mem|OPS_16|OPTM_Far|OPA_EA, - OPT_Mem|OPS_32|OPTM_Far|OPA_EA, - OPT_Mem|OPS_64|OPTM_Far|OPA_EA, - OPT_Mem|OPS_Any|OPTM_Far|OPA_EA, - OPT_Imm|OPS_16|OPTM_Far|OPA_JmpFar, - OPT_Imm|OPS_32|OPTM_Far|OPA_JmpFar, - OPT_Imm|OPS_Any|OPTM_Far|OPA_JmpFar, - OPT_Imm|OPS_16|OPA_JmpFar, - OPT_Imm|OPS_32|OPA_JmpFar, - OPT_Imm|OPS_Any|OPA_JmpFar, - OPT_Reg|OPS_80|OPTM_To|OPA_Op1Add, - OPT_Reg|OPS_32|OPA_Op1Add, - OPT_Reg|OPS_64|OPA_Op1Add, - OPT_Imm|OPS_16|OPA_JmpRel, - OPT_Imm|OPS_32|OPA_JmpRel, - OPT_Imm|OPS_8|OPS_Relaxed|OPA_SImm, - OPT_Imm|OPS_BITS|OPS_Relaxed|OPA_Imm|OPAP_SImm8, - OPT_Imm|OPS_32|OPA_SImm, - OPT_CS|OPS_Any|OPA_None, - OPT_CS|OPS_16|OPA_None, - OPT_CS|OPS_32|OPA_None -}; - -static const x86_insn_info onebyte_insn[] = { - { CPU_Any, MOD_Op0Add|MOD_OpSizeR|MOD_DOpS64R, 0, 0, 0, 1, {0x00, 0, 0}, 0, 0, 0 } -}; - -static const x86_insn_info onebyte_prefix_insn[] = { - { CPU_Any, MOD_Op0Add|MOD_PreAdd, 0, 0, 0x00, 1, {0x00, 0, 0}, 0, 0, 0 } -}; - -static const x86_insn_info twobyte_insn[] = { - { CPU_Any, MOD_Op1Add|MOD_Op0Add|MOD_GasSufL|MOD_GasSufQ, 0, 0, 0, 2, {0x00, 0x00, 0}, 0, 0, 0 } -}; - -static const x86_insn_info threebyte_insn[] = { - { CPU_Any, MOD_Op2Add|MOD_Op1Add|MOD_Op0Add, 0, 0, 0, 3, {0x00, 0x00, 0x00}, 0, 0, 0 } -}; - -static const x86_insn_info onebytemem_insn[] = { - { CPU_Any, MOD_Op0Add|MOD_SpAdd|MOD_GasSufL|MOD_GasSufQ|MOD_GasSufS, 0, 0, 0, 1, {0x00, 0, 0}, 0, 1, 337 } -}; - -static const x86_insn_info twobytemem_insn[] = { - { CPU_Any, MOD_Op1Add|MOD_Op0Add|MOD_SpAdd|MOD_GasSufL|MOD_GasSufQ|MOD_GasSufS|MOD_GasSufW, 0, 0, 0, 2, {0x00, 0x00, 0}, 0, 1, 337 } -}; - -static const x86_insn_info mov_insn[] = { - { CPU_Not64, MOD_GasSufB, 0, 0, 0, 1, {0xA0, 0, 0}, 0, 2, 182 }, - { CPU_Not64, MOD_GasSufW, 16, 0, 0, 1, {0xA1, 0, 0}, 0, 2, 184 }, - { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0xA1, 0, 0}, 0, 2, 186 }, - { CPU_Not64, MOD_GasSufB, 0, 0, 0, 1, {0xA2, 0, 0}, 0, 2, 188 }, - { CPU_Not64, MOD_GasSufW, 16, 0, 0, 1, {0xA3, 0, 0}, 0, 2, 190 }, - { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0xA3, 0, 0}, 0, 2, 192 }, - { CPU_64, 0, 0, 0, 0, 1, {0xA0, 0, 0}, 0, 2, 158 }, - { CPU_64, 0, 16, 0, 0, 1, {0xA1, 0, 0}, 0, 2, 160 }, - { CPU_64, 0, 32, 0, 0, 1, {0xA1, 0, 0}, 0, 2, 162 }, - { CPU_64, 0, 64, 0, 0, 1, {0xA1, 0, 0}, 0, 2, 164 }, - { CPU_64, 0, 0, 0, 0, 1, {0xA2, 0, 0}, 0, 2, 166 }, - { CPU_64, 0, 16, 0, 0, 1, {0xA3, 0, 0}, 0, 2, 168 }, - { CPU_64, 0, 32, 0, 0, 1, {0xA3, 0, 0}, 0, 2, 170 }, - { CPU_64, 0, 64, 0, 0, 1, {0xA3, 0, 0}, 0, 2, 172 }, - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0x88, 0xA2, 0}, 0, 2, 194 }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x89, 0xA3, 0}, 0, 2, 196 }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x89, 0xA3, 0}, 0, 2, 198 }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x89, 0xA3, 0}, 0, 2, 200 }, - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0x88, 0, 0}, 0, 2, 140 }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x89, 0, 0}, 0, 2, 94 }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x89, 0, 0}, 0, 2, 100 }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x89, 0, 0}, 0, 2, 106 }, - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0x8A, 0xA0, 0}, 0, 2, 202 }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x8B, 0xA1, 0}, 0, 2, 204 }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x8B, 0xA1, 0}, 0, 2, 206 }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x8B, 0xA1, 0}, 0, 2, 208 }, - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0x8A, 0, 0}, 0, 2, 142 }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x8B, 0, 0}, 0, 2, 4 }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x8B, 0, 0}, 0, 2, 7 }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x8B, 0, 0}, 0, 2, 10 }, - { CPU_Any, MOD_GasSufW, 0, 0, 0, 1, {0x8C, 0, 0}, 0, 2, 210 }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x8C, 0, 0}, 0, 2, 212 }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x8C, 0, 0}, 0, 2, 214 }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x8C, 0, 0}, 0, 2, 216 }, - { CPU_Any, MOD_GasSufW, 0, 0, 0, 1, {0x8E, 0, 0}, 0, 2, 218 }, - { CPU_386, MOD_GasSufL, 0, 0, 0, 1, {0x8E, 0, 0}, 0, 2, 213 }, - { CPU_64, MOD_GasSufQ, 0, 0, 0, 1, {0x8E, 0, 0}, 0, 2, 215 }, - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xB0, 0, 0}, 0, 2, 220 }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xB8, 0, 0}, 0, 2, 222 }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xB8, 0, 0}, 0, 2, 224 }, - { CPU_64, MOD_GasIllegal, 64, 0, 0, 1, {0xB8, 0, 0}, 0, 2, 226 }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xB8, 0xC7, 0}, 0, 2, 228 }, - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xC6, 0, 0}, 0, 2, 230 }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xC7, 0, 0}, 0, 2, 232 }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xC7, 0, 0}, 0, 2, 234 }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xC7, 0, 0}, 0, 2, 236 }, - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xC6, 0, 0}, 0, 2, 238 }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xC7, 0, 0}, 0, 2, 240 }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xC7, 0, 0}, 0, 2, 242 }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xC7, 0, 0}, 0, 2, 244 }, - { CPU_586|CPU_Not64|CPU_Priv, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0x22, 0}, 0, 2, 246 }, - { CPU_386|CPU_Not64|CPU_Priv, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0x22, 0}, 0, 2, 248 }, - { CPU_64|CPU_Priv, MOD_GasSufQ, 0, 0, 0, 2, {0x0F, 0x22, 0}, 0, 2, 250 }, - { CPU_586|CPU_Not64|CPU_Priv, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0x20, 0}, 0, 2, 252 }, - { CPU_386|CPU_Not64|CPU_Priv, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0x20, 0}, 0, 2, 247 }, - { CPU_64|CPU_Priv, MOD_GasSufQ, 0, 0, 0, 2, {0x0F, 0x20, 0}, 0, 2, 254 }, - { CPU_386|CPU_Not64|CPU_Priv, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0x23, 0}, 0, 2, 256 }, - { CPU_64|CPU_Priv, MOD_GasSufQ, 0, 0, 0, 2, {0x0F, 0x23, 0}, 0, 2, 258 }, - { CPU_386|CPU_Not64|CPU_Priv, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0x21, 0}, 0, 2, 257 }, - { CPU_64|CPU_Priv, MOD_GasSufQ, 0, 0, 0, 2, {0x0F, 0x21, 0}, 0, 2, 260 }, - { CPU_MMX, MOD_GasOnly|MOD_GasSufQ, 0, 0, 0, 2, {0x0F, 0x6F, 0}, 0, 2, 82 }, - { CPU_64|CPU_MMX, MOD_GasOnly|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x6E, 0}, 0, 2, 120 }, - { CPU_MMX, MOD_GasOnly|MOD_GasSufQ, 0, 0, 0, 2, {0x0F, 0x7F, 0}, 0, 2, 148 }, - { CPU_64|CPU_MMX, MOD_GasOnly|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x7E, 0}, 0, 2, 122 }, - { CPU_SSE2, MOD_GasOnly|MOD_GasSufQ, 0, 0, 0xF3, 2, {0x0F, 0x7E, 0}, 0, 2, 0 }, - { CPU_SSE2, MOD_GasOnly|MOD_GasSufQ, 0, 0, 0xF3, 2, {0x0F, 0x7E, 0}, 0, 2, 150 }, - { CPU_64|CPU_SSE2, MOD_GasOnly|MOD_GasSufQ, 64, 0, 0x66, 2, {0x0F, 0x6E, 0}, 0, 2, 91 }, - { CPU_SSE2, MOD_GasOnly|MOD_GasSufQ, 0, 0, 0x66, 2, {0x0F, 0xD6, 0}, 0, 2, 152 }, - { CPU_64|CPU_SSE2, MOD_GasOnly|MOD_GasSufQ, 64, 0, 0x66, 2, {0x0F, 0x7E, 0}, 0, 2, 70 } -}; - -static const x86_insn_info movabs_insn[] = { - { CPU_64, MOD_GasSufB, 0, 0, 0, 1, {0xA0, 0, 0}, 0, 2, 158 }, - { CPU_64, MOD_GasSufW, 16, 0, 0, 1, {0xA1, 0, 0}, 0, 2, 160 }, - { CPU_64, MOD_GasSufL, 32, 0, 0, 1, {0xA1, 0, 0}, 0, 2, 162 }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xA1, 0, 0}, 0, 2, 164 }, - { CPU_64, MOD_GasSufB, 0, 0, 0, 1, {0xA2, 0, 0}, 0, 2, 166 }, - { CPU_64, MOD_GasSufW, 16, 0, 0, 1, {0xA3, 0, 0}, 0, 2, 168 }, - { CPU_64, MOD_GasSufL, 32, 0, 0, 1, {0xA3, 0, 0}, 0, 2, 170 }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xA3, 0, 0}, 0, 2, 172 }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xB8, 0, 0}, 0, 2, 174 } -}; - -static const x86_insn_info movszx_insn[] = { - { CPU_386, MOD_Op1Add|MOD_GasSufB, 16, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 366 }, - { CPU_386, MOD_Op1Add|MOD_GasSufB, 32, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 312 }, - { CPU_64, MOD_Op1Add|MOD_GasSufB, 64, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 316 }, - { CPU_386, MOD_Op1Add|MOD_GasSufW, 32, 0, 0, 2, {0x0F, 0x01, 0}, 0, 2, 314 }, - { CPU_64, MOD_Op1Add|MOD_GasSufW, 64, 0, 0, 2, {0x0F, 0x01, 0}, 0, 2, 368 } -}; - -static const x86_insn_info movsxd_insn[] = { - { CPU_64, MOD_GasSufL, 64, 0, 0, 1, {0x63, 0, 0}, 0, 2, 400 } -}; - -static const x86_insn_info push_insn[] = { - { CPU_Any, MOD_GasSufW, 16, 64, 0, 1, {0x50, 0, 0}, 0, 1, 222 }, - { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0x50, 0, 0}, 0, 1, 224 }, - { CPU_64, MOD_GasSufQ, 0, 64, 0, 1, {0x50, 0, 0}, 0, 1, 174 }, - { CPU_Any, MOD_GasSufW, 16, 64, 0, 1, {0xFF, 0, 0}, 6, 1, 112 }, - { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0xFF, 0, 0}, 6, 1, 114 }, - { CPU_64, MOD_GasSufQ, 0, 64, 0, 1, {0xFF, 0, 0}, 6, 1, 116 }, - { CPU_186, MOD_GasIllegal, 0, 64, 0, 1, {0x6A, 0, 0}, 0, 1, 6 }, - { CPU_186, MOD_GasOnly, 0, 64, 0, 1, {0x6A, 0, 0}, 0, 1, 447 }, - { CPU_186, MOD_GasOnly|MOD_GasSufW, 16, 64, 0, 1, {0x6A, 0x68, 0}, 0, 1, 341 }, - { CPU_386|CPU_Not64, MOD_GasOnly|MOD_GasSufL, 32, 0, 0, 1, {0x6A, 0x68, 0}, 0, 1, 343 }, - { CPU_64, MOD_GasSufQ, 64, 64, 0, 1, {0x6A, 0x68, 0}, 0, 1, 18 }, - { CPU_186|CPU_Not64, MOD_GasIllegal, 0, 0, 0, 1, {0x6A, 0x68, 0}, 0, 1, 448 }, - { CPU_186, MOD_GasIllegal, 16, 64, 0, 1, {0x68, 0, 0}, 0, 1, 233 }, - { CPU_386|CPU_Not64, MOD_GasIllegal, 32, 0, 0, 1, {0x68, 0, 0}, 0, 1, 235 }, - { CPU_64, MOD_GasIllegal, 64, 64, 0, 1, {0x68, 0, 0}, 0, 1, 449 }, - { CPU_Not64, 0, 0, 0, 0, 1, {0x0E, 0, 0}, 0, 1, 450 }, - { CPU_Not64, MOD_GasSufW, 16, 0, 0, 1, {0x0E, 0, 0}, 0, 1, 451 }, - { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0x0E, 0, 0}, 0, 1, 452 }, - { CPU_Not64, 0, 0, 0, 0, 1, {0x16, 0, 0}, 0, 1, 407 }, - { CPU_Not64, MOD_GasSufW, 16, 0, 0, 1, {0x16, 0, 0}, 0, 1, 408 }, - { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0x16, 0, 0}, 0, 1, 409 }, - { CPU_Not64, 0, 0, 0, 0, 1, {0x1E, 0, 0}, 0, 1, 410 }, - { CPU_Not64, MOD_GasSufW, 16, 0, 0, 1, {0x1E, 0, 0}, 0, 1, 411 }, - { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0x1E, 0, 0}, 0, 1, 412 }, - { CPU_Not64, 0, 0, 0, 0, 1, {0x06, 0, 0}, 0, 1, 413 }, - { CPU_Not64, MOD_GasSufW, 16, 0, 0, 1, {0x06, 0, 0}, 0, 1, 414 }, - { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0x06, 0, 0}, 0, 1, 415 }, - { CPU_386, 0, 0, 0, 0, 2, {0x0F, 0xA0, 0}, 0, 1, 416 }, - { CPU_386, MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0xA0, 0}, 0, 1, 417 }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0xA0, 0}, 0, 1, 418 }, - { CPU_386, 0, 0, 0, 0, 2, {0x0F, 0xA8, 0}, 0, 1, 419 }, - { CPU_386, MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0xA8, 0}, 0, 1, 420 }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0xA8, 0}, 0, 1, 421 } -}; - -static const x86_insn_info pop_insn[] = { - { CPU_Any, MOD_GasSufW, 16, 64, 0, 1, {0x58, 0, 0}, 0, 1, 222 }, - { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0x58, 0, 0}, 0, 1, 224 }, - { CPU_64, MOD_GasSufQ, 0, 64, 0, 1, {0x58, 0, 0}, 0, 1, 174 }, - { CPU_Any, MOD_GasSufW, 16, 64, 0, 1, {0x8F, 0, 0}, 0, 1, 112 }, - { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0x8F, 0, 0}, 0, 1, 114 }, - { CPU_64, MOD_GasSufQ, 0, 64, 0, 1, {0x8F, 0, 0}, 0, 1, 116 }, - { CPU_Not64, 0, 0, 0, 0, 1, {0x17, 0, 0}, 0, 1, 407 }, - { CPU_Not64, 0, 16, 0, 0, 1, {0x17, 0, 0}, 0, 1, 408 }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0x17, 0, 0}, 0, 1, 409 }, - { CPU_Not64, 0, 0, 0, 0, 1, {0x1F, 0, 0}, 0, 1, 410 }, - { CPU_Not64, 0, 16, 0, 0, 1, {0x1F, 0, 0}, 0, 1, 411 }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0x1F, 0, 0}, 0, 1, 412 }, - { CPU_Not64, 0, 0, 0, 0, 1, {0x07, 0, 0}, 0, 1, 413 }, - { CPU_Not64, 0, 16, 0, 0, 1, {0x07, 0, 0}, 0, 1, 414 }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0x07, 0, 0}, 0, 1, 415 }, - { CPU_386, 0, 0, 0, 0, 2, {0x0F, 0xA1, 0}, 0, 1, 416 }, - { CPU_386, 0, 16, 0, 0, 2, {0x0F, 0xA1, 0}, 0, 1, 417 }, - { CPU_386, 0, 32, 0, 0, 2, {0x0F, 0xA1, 0}, 0, 1, 418 }, - { CPU_386, 0, 0, 0, 0, 2, {0x0F, 0xA9, 0}, 0, 1, 419 }, - { CPU_386, 0, 16, 0, 0, 2, {0x0F, 0xA9, 0}, 0, 1, 420 }, - { CPU_386, 0, 32, 0, 0, 2, {0x0F, 0xA9, 0}, 0, 1, 421 } -}; - -static const x86_insn_info xchg_insn[] = { - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0x86, 0, 0}, 0, 2, 140 }, - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0x86, 0, 0}, 0, 2, 142 }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x90, 0, 0}, 0, 2, 292 }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x90, 0, 0}, 0, 2, 294 }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x87, 0, 0}, 0, 2, 94 }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x87, 0, 0}, 0, 2, 4 }, - { CPU_64, MOD_GasSufL, 32, 0, 0, 1, {0x87, 0, 0}, 0, 2, 296 }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x90, 0, 0}, 0, 2, 298 }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x90, 0, 0}, 0, 2, 300 }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x87, 0, 0}, 0, 2, 100 }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x87, 0, 0}, 0, 2, 7 }, - { CPU_64, MOD_GasSufQ, 0, 0, 0, 1, {0x90, 0, 0}, 0, 2, 302 }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x90, 0, 0}, 0, 2, 173 }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x90, 0, 0}, 0, 2, 304 }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x87, 0, 0}, 0, 2, 106 }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x87, 0, 0}, 0, 2, 10 } -}; - -static const x86_insn_info in_insn[] = { - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xE4, 0, 0}, 0, 2, 277 }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xE5, 0, 0}, 0, 2, 279 }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xE5, 0, 0}, 0, 2, 384 }, - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xEC, 0, 0}, 0, 2, 283 }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xED, 0, 0}, 0, 2, 285 }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xED, 0, 0}, 0, 2, 281 }, - { CPU_Any, MOD_GasOnly|MOD_GasSufB, 0, 0, 0, 1, {0xE4, 0, 0}, 0, 1, 3 }, - { CPU_Any, MOD_GasOnly|MOD_GasSufW, 16, 0, 0, 1, {0xE5, 0, 0}, 0, 1, 3 }, - { CPU_386, MOD_GasOnly|MOD_GasSufL, 32, 0, 0, 1, {0xE5, 0, 0}, 0, 1, 3 }, - { CPU_Any, MOD_GasOnly|MOD_GasSufB, 0, 0, 0, 1, {0xEC, 0, 0}, 0, 1, 282 }, - { CPU_Any, MOD_GasOnly|MOD_GasSufW, 16, 0, 0, 1, {0xED, 0, 0}, 0, 1, 282 }, - { CPU_386, MOD_GasOnly|MOD_GasSufL, 32, 0, 0, 1, {0xED, 0, 0}, 0, 1, 282 } -}; - -static const x86_insn_info out_insn[] = { - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xE6, 0, 0}, 0, 2, 276 }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xE7, 0, 0}, 0, 2, 278 }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xE7, 0, 0}, 0, 2, 280 }, - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xEE, 0, 0}, 0, 2, 282 }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xEF, 0, 0}, 0, 2, 284 }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xEF, 0, 0}, 0, 2, 286 }, - { CPU_Any, MOD_GasOnly|MOD_GasSufB, 0, 0, 0, 1, {0xE6, 0, 0}, 0, 1, 3 }, - { CPU_Any, MOD_GasOnly|MOD_GasSufW, 16, 0, 0, 1, {0xE7, 0, 0}, 0, 1, 3 }, - { CPU_386, MOD_GasOnly|MOD_GasSufL, 32, 0, 0, 1, {0xE7, 0, 0}, 0, 1, 3 }, - { CPU_Any, MOD_GasOnly|MOD_GasSufB, 0, 0, 0, 1, {0xEE, 0, 0}, 0, 1, 282 }, - { CPU_Any, MOD_GasOnly|MOD_GasSufW, 16, 0, 0, 1, {0xEF, 0, 0}, 0, 1, 282 }, - { CPU_386, MOD_GasOnly|MOD_GasSufL, 32, 0, 0, 1, {0xEF, 0, 0}, 0, 1, 282 } -}; - -static const x86_insn_info lea_insn[] = { - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x8D, 0, 0}, 0, 2, 306 }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x8D, 0, 0}, 0, 2, 176 }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x8D, 0, 0}, 0, 2, 308 } -}; - -static const x86_insn_info ldes_insn[] = { - { CPU_Not64, MOD_Op0Add|MOD_GasSufW, 16, 0, 0, 1, {0x00, 0, 0}, 0, 2, 336 }, - { CPU_386|CPU_Not64, MOD_Op0Add|MOD_GasSufL, 32, 0, 0, 1, {0x00, 0, 0}, 0, 2, 338 } -}; - -static const x86_insn_info lfgss_insn[] = { - { CPU_386, MOD_Op1Add|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 336 }, - { CPU_386, MOD_Op1Add|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 338 } -}; - -static const x86_insn_info arith_insn[] = { - { CPU_Any, MOD_Op0Add|MOD_GasSufB, 0, 0, 0, 1, {0x04, 0, 0}, 0, 2, 277 }, - { CPU_Any, MOD_Op2Add|MOD_Op1AddSp|MOD_GasSufW, 16, 0, 0, 2, {0x83, 0xC0, 0x05}, 0, 2, 340 }, - { CPU_386, MOD_Op2Add|MOD_Op1AddSp|MOD_GasSufL, 32, 0, 0, 2, {0x83, 0xC0, 0x05}, 0, 2, 342 }, - { CPU_64, MOD_Op2Add|MOD_Op1AddSp|MOD_GasSufQ, 64, 0, 0, 2, {0x83, 0xC0, 0x05}, 0, 2, 344 }, - { CPU_Any, MOD_Gap0|MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0x80, 0, 0}, 0, 2, 238 }, - { CPU_Any, MOD_Gap0|MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0x80, 0, 0}, 0, 2, 230 }, - { CPU_Any, MOD_Gap0|MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0x83, 0, 0}, 0, 2, 346 }, - { CPU_Any, MOD_Gap0|MOD_SpAdd|MOD_GasIllegal, 16, 0, 0, 1, {0x83, 0x81, 0}, 0, 2, 348 }, - { CPU_Any, MOD_Gap0|MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0x83, 0x81, 0}, 0, 2, 350 }, - { CPU_386, MOD_Gap0|MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0x83, 0, 0}, 0, 2, 352 }, - { CPU_386|CPU_Not64, MOD_Gap0|MOD_SpAdd|MOD_GasIllegal, 32, 0, 0, 1, {0x83, 0x81, 0}, 0, 2, 354 }, - { CPU_386, MOD_Gap0|MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0x83, 0x81, 0}, 0, 2, 356 }, - { CPU_64, MOD_Gap0|MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, {0x83, 0, 0}, 0, 2, 358 }, - { CPU_64, MOD_Gap0|MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, {0x83, 0x81, 0}, 0, 2, 360 }, - { CPU_Any, MOD_Op0Add|MOD_GasSufB, 0, 0, 0, 1, {0x00, 0, 0}, 0, 2, 140 }, - { CPU_Any, MOD_Op0Add|MOD_GasSufW, 16, 0, 0, 1, {0x01, 0, 0}, 0, 2, 94 }, - { CPU_386, MOD_Op0Add|MOD_GasSufL, 32, 0, 0, 1, {0x01, 0, 0}, 0, 2, 100 }, - { CPU_64, MOD_Op0Add|MOD_GasSufQ, 64, 0, 0, 1, {0x01, 0, 0}, 0, 2, 106 }, - { CPU_Any, MOD_Op0Add|MOD_GasSufB, 0, 0, 0, 1, {0x02, 0, 0}, 0, 2, 142 }, - { CPU_Any, MOD_Op0Add|MOD_GasSufW, 16, 0, 0, 1, {0x03, 0, 0}, 0, 2, 4 }, - { CPU_386, MOD_Op0Add|MOD_GasSufL, 32, 0, 0, 1, {0x03, 0, 0}, 0, 2, 7 }, - { CPU_64, MOD_Op0Add|MOD_GasSufQ, 64, 0, 0, 1, {0x03, 0, 0}, 0, 2, 10 } -}; - -static const x86_insn_info incdec_insn[] = { - { CPU_Any, MOD_Gap0|MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0xFE, 0, 0}, 0, 1, 238 }, - { CPU_Not64, MOD_Op0Add|MOD_GasSufW, 16, 0, 0, 1, {0x00, 0, 0}, 0, 1, 222 }, - { CPU_Any, MOD_Gap0|MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0xFF, 0, 0}, 0, 1, 112 }, - { CPU_386|CPU_Not64, MOD_Op0Add|MOD_GasSufL, 32, 0, 0, 1, {0x00, 0, 0}, 0, 1, 224 }, - { CPU_386, MOD_Gap0|MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0xFF, 0, 0}, 0, 1, 114 }, - { CPU_64, MOD_Gap0|MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, {0xFF, 0, 0}, 0, 1, 116 } -}; - -static const x86_insn_info f6_insn[] = { - { CPU_Any, MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0xF6, 0, 0}, 0, 1, 238 }, - { CPU_Any, MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0xF7, 0, 0}, 0, 1, 112 }, - { CPU_386, MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0xF7, 0, 0}, 0, 1, 114 }, - { CPU_64, MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, {0xF7, 0, 0}, 0, 1, 116 } -}; - -static const x86_insn_info div_insn[] = { - { CPU_Any, MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0xF6, 0, 0}, 0, 1, 238 }, - { CPU_Any, MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0xF7, 0, 0}, 0, 1, 112 }, - { CPU_386, MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0xF7, 0, 0}, 0, 1, 114 }, - { CPU_64, MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, {0xF7, 0, 0}, 0, 1, 116 }, - { CPU_Any, MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0xF6, 0, 0}, 0, 2, 266 }, - { CPU_Any, MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0xF7, 0, 0}, 0, 2, 268 }, - { CPU_386, MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0xF7, 0, 0}, 0, 2, 270 }, - { CPU_64, MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, {0xF7, 0, 0}, 0, 2, 272 } -}; - -static const x86_insn_info test_insn[] = { - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xA8, 0, 0}, 0, 2, 277 }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xA9, 0, 0}, 0, 2, 388 }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xA9, 0, 0}, 0, 2, 390 }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xA9, 0, 0}, 0, 2, 392 }, - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xF6, 0, 0}, 0, 2, 238 }, - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xF6, 0, 0}, 0, 2, 230 }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xF7, 0, 0}, 0, 2, 240 }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xF7, 0, 0}, 0, 2, 232 }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xF7, 0, 0}, 0, 2, 242 }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xF7, 0, 0}, 0, 2, 234 }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xF7, 0, 0}, 0, 2, 244 }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xF7, 0, 0}, 0, 2, 236 }, - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0x84, 0, 0}, 0, 2, 140 }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x85, 0, 0}, 0, 2, 94 }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x85, 0, 0}, 0, 2, 100 }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x85, 0, 0}, 0, 2, 106 }, - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0x84, 0, 0}, 0, 2, 142 }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0x85, 0, 0}, 0, 2, 4 }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x85, 0, 0}, 0, 2, 7 }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x85, 0, 0}, 0, 2, 10 } -}; - -static const x86_insn_info aadm_insn[] = { - { CPU_Any, MOD_Op0Add, 0, 0, 0, 2, {0xD4, 0x0A, 0}, 0, 0, 0 }, - { CPU_Any, MOD_Op0Add, 0, 0, 0, 1, {0xD4, 0, 0}, 0, 1, 3 } -}; - -static const x86_insn_info imul_insn[] = { - { CPU_Any, MOD_GasSufB, 0, 0, 0, 1, {0xF6, 0, 0}, 5, 1, 238 }, - { CPU_Any, MOD_GasSufW, 16, 0, 0, 1, {0xF7, 0, 0}, 5, 1, 112 }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0xF7, 0, 0}, 5, 1, 114 }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0xF7, 0, 0}, 5, 1, 116 }, - { CPU_386, MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0xAF, 0}, 0, 2, 4 }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0xAF, 0}, 0, 2, 7 }, - { CPU_386|CPU_64, MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0xAF, 0}, 0, 2, 10 }, - { CPU_186, MOD_GasSufW, 16, 0, 0, 1, {0x6B, 0, 0}, 0, 3, 4 }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x6B, 0, 0}, 0, 3, 7 }, - { CPU_186|CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x6B, 0, 0}, 0, 3, 10 }, - { CPU_186, MOD_GasSufW, 16, 0, 0, 1, {0x6B, 0, 0}, 0, 2, 124 }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x6B, 0, 0}, 0, 2, 126 }, - { CPU_186|CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x6B, 0, 0}, 0, 2, 128 }, - { CPU_186, MOD_GasSufW, 16, 0, 0, 1, {0x6B, 0x69, 0}, 0, 3, 13 }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x6B, 0x69, 0}, 0, 3, 16 }, - { CPU_186|CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x6B, 0x69, 0}, 0, 3, 19 }, - { CPU_186, MOD_GasSufW, 16, 0, 0, 1, {0x6B, 0x69, 0}, 0, 2, 130 }, - { CPU_386, MOD_GasSufL, 32, 0, 0, 1, {0x6B, 0x69, 0}, 0, 2, 132 }, - { CPU_186|CPU_64, MOD_GasSufQ, 64, 0, 0, 1, {0x6B, 0x69, 0}, 0, 2, 134 } -}; - -static const x86_insn_info shift_insn[] = { - { CPU_Any, MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0xD2, 0, 0}, 0, 2, 318 }, - { CPU_Any, MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0xD0, 0, 0}, 0, 2, 320 }, - { CPU_186, MOD_SpAdd|MOD_GasSufB, 0, 0, 0, 1, {0xC0, 0, 0}, 0, 2, 238 }, - { CPU_Any, MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0xD3, 0, 0}, 0, 2, 322 }, - { CPU_Any, MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0xD1, 0, 0}, 0, 2, 324 }, - { CPU_186, MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 1, {0xC1, 0, 0}, 0, 2, 112 }, - { CPU_386, MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0xD3, 0, 0}, 0, 2, 326 }, - { CPU_386, MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0xD1, 0, 0}, 0, 2, 328 }, - { CPU_386, MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 1, {0xC1, 0, 0}, 0, 2, 114 }, - { CPU_64, MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, {0xD3, 0, 0}, 0, 2, 330 }, - { CPU_64, MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, {0xD1, 0, 0}, 0, 2, 332 }, - { CPU_186|CPU_64, MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 1, {0xC1, 0, 0}, 0, 2, 116 }, - { CPU_Any, MOD_SpAdd|MOD_GasOnly|MOD_GasSufB, 0, 0, 0, 1, {0xD0, 0, 0}, 0, 1, 238 }, - { CPU_Any, MOD_SpAdd|MOD_GasOnly|MOD_GasSufW, 16, 0, 0, 1, {0xD1, 0, 0}, 0, 1, 112 }, - { CPU_386, MOD_SpAdd|MOD_GasOnly|MOD_GasSufL, 32, 0, 0, 1, {0xD1, 0, 0}, 0, 1, 114 }, - { CPU_64, MOD_SpAdd|MOD_GasOnly|MOD_GasSufQ, 64, 0, 0, 1, {0xD1, 0, 0}, 0, 1, 116 } -}; - -static const x86_insn_info shlrd_insn[] = { - { CPU_386, MOD_Op1Add|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x00, 0}, 0, 3, 94 }, - { CPU_386, MOD_Op1Add|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x01, 0}, 0, 3, 97 }, - { CPU_386, MOD_Op1Add|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x00, 0}, 0, 3, 100 }, - { CPU_386, MOD_Op1Add|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x01, 0}, 0, 3, 103 }, - { CPU_386|CPU_64, MOD_Op1Add|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x00, 0}, 0, 3, 106 }, - { CPU_386|CPU_64, MOD_Op1Add|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x01, 0}, 0, 3, 109 }, - { CPU_386, MOD_Op1Add|MOD_GasOnly|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x01, 0}, 0, 2, 94 }, - { CPU_386, MOD_Op1Add|MOD_GasOnly|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x01, 0}, 0, 2, 100 }, - { CPU_386|CPU_64, MOD_Op1Add|MOD_GasOnly|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x01, 0}, 0, 2, 106 } -}; - -static const x86_insn_info call_insn[] = { - { CPU_Any, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 1, 422 }, - { CPU_Any, 0, 16, 0, 0, 0, {0, 0, 0}, 0, 1, 423 }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 0, {0, 0, 0}, 0, 1, 424 }, - { CPU_64, 0, 64, 0, 0, 0, {0, 0, 0}, 0, 1, 424 }, - { CPU_Any, 0, 16, 64, 0, 1, {0xE8, 0, 0}, 0, 1, 425 }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0xE8, 0, 0}, 0, 1, 426 }, - { CPU_64, 0, 64, 64, 0, 1, {0xE8, 0, 0}, 0, 1, 426 }, - { CPU_Any, 0, 0, 64, 0, 1, {0xE8, 0, 0}, 0, 1, 427 }, - { CPU_Any, 0, 16, 0, 0, 1, {0xFF, 0, 0}, 2, 1, 112 }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0xFF, 0, 0}, 2, 1, 114 }, - { CPU_64, 0, 64, 64, 0, 1, {0xFF, 0, 0}, 2, 1, 116 }, - { CPU_Any, 0, 0, 64, 0, 1, {0xFF, 0, 0}, 2, 1, 337 }, - { CPU_Any, 0, 16, 64, 0, 1, {0xFF, 0, 0}, 2, 1, 428 }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0xFF, 0, 0}, 2, 1, 429 }, - { CPU_64, 0, 64, 64, 0, 1, {0xFF, 0, 0}, 2, 1, 430 }, - { CPU_Any, 0, 0, 64, 0, 1, {0xFF, 0, 0}, 2, 1, 431 }, - { CPU_Any, 0, 16, 0, 0, 1, {0xFF, 0, 0}, 3, 1, 432 }, - { CPU_386, 0, 32, 0, 0, 1, {0xFF, 0, 0}, 3, 1, 433 }, - { CPU_64, 0, 64, 0, 0, 1, {0xFF, 0, 0}, 3, 1, 434 }, - { CPU_Any, 0, 0, 0, 0, 1, {0xFF, 0, 0}, 3, 1, 435 }, - { CPU_Not64, 0, 16, 0, 0, 1, {0x9A, 0, 0}, 3, 1, 436 }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0x9A, 0, 0}, 3, 1, 437 }, - { CPU_Not64, 0, 0, 0, 0, 1, {0x9A, 0, 0}, 3, 1, 438 }, - { CPU_Not64, 0, 16, 0, 0, 1, {0x9A, 0, 0}, 3, 1, 439 }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0x9A, 0, 0}, 3, 1, 440 }, - { CPU_Not64, 0, 0, 0, 0, 1, {0x9A, 0, 0}, 3, 1, 441 } -}; - -static const x86_insn_info jmp_insn[] = { - { CPU_Any, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 1, 422 }, - { CPU_Any, 0, 16, 0, 0, 0, {0, 0, 0}, 0, 1, 423 }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0x00, 0, 0}, 0, 1, 424 }, - { CPU_64, 0, 64, 0, 0, 1, {0x00, 0, 0}, 0, 1, 424 }, - { CPU_Any, 0, 0, 64, 0, 1, {0xEB, 0, 0}, 0, 1, 376 }, - { CPU_Any, 0, 16, 64, 0, 1, {0xE9, 0, 0}, 0, 1, 425 }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0xE9, 0, 0}, 0, 1, 426 }, - { CPU_64, 0, 64, 64, 0, 1, {0xE9, 0, 0}, 0, 1, 426 }, - { CPU_Any, 0, 0, 64, 0, 1, {0xE9, 0, 0}, 0, 1, 427 }, - { CPU_Any, 0, 16, 64, 0, 1, {0xFF, 0, 0}, 4, 1, 112 }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0xFF, 0, 0}, 4, 1, 114 }, - { CPU_64, 0, 64, 64, 0, 1, {0xFF, 0, 0}, 4, 1, 116 }, - { CPU_Any, 0, 0, 64, 0, 1, {0xFF, 0, 0}, 4, 1, 337 }, - { CPU_Any, 0, 16, 64, 0, 1, {0xFF, 0, 0}, 4, 1, 428 }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0xFF, 0, 0}, 4, 1, 429 }, - { CPU_64, 0, 64, 64, 0, 1, {0xFF, 0, 0}, 4, 1, 430 }, - { CPU_Any, 0, 0, 64, 0, 1, {0xFF, 0, 0}, 4, 1, 431 }, - { CPU_Any, 0, 16, 0, 0, 1, {0xFF, 0, 0}, 5, 1, 432 }, - { CPU_386, 0, 32, 0, 0, 1, {0xFF, 0, 0}, 5, 1, 433 }, - { CPU_64, 0, 64, 0, 0, 1, {0xFF, 0, 0}, 5, 1, 434 }, - { CPU_Any, 0, 0, 0, 0, 1, {0xFF, 0, 0}, 5, 1, 435 }, - { CPU_Not64, 0, 16, 0, 0, 1, {0xEA, 0, 0}, 3, 1, 436 }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0xEA, 0, 0}, 3, 1, 437 }, - { CPU_Not64, 0, 0, 0, 0, 1, {0xEA, 0, 0}, 3, 1, 438 }, - { CPU_Not64, 0, 16, 0, 0, 1, {0xEA, 0, 0}, 3, 1, 439 }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0xEA, 0, 0}, 3, 1, 440 }, - { CPU_Not64, 0, 0, 0, 0, 1, {0xEA, 0, 0}, 3, 1, 441 } -}; - -static const x86_insn_info retnf_insn[] = { - { CPU_Not64, MOD_Op0Add, 0, 0, 0, 1, {0x01, 0, 0}, 0, 0, 0 }, - { CPU_Not64, MOD_Op0Add, 0, 0, 0, 1, {0x00, 0, 0}, 0, 1, 223 }, - { CPU_64, MOD_Op0Add|MOD_OpSizeR, 0, 0, 0, 1, {0x01, 0, 0}, 0, 0, 0 }, - { CPU_64, MOD_Op0Add|MOD_OpSizeR, 0, 0, 0, 1, {0x00, 0, 0}, 0, 1, 223 }, - { CPU_Any, MOD_Op0Add|MOD_OpSizeR|MOD_GasSufL|MOD_GasSufQ|MOD_GasSufW, 0, 0, 0, 1, {0x01, 0, 0}, 0, 0, 0 }, - { CPU_Any, MOD_Op0Add|MOD_OpSizeR|MOD_GasSufL|MOD_GasSufQ|MOD_GasSufW, 0, 0, 0, 1, {0x00, 0, 0}, 0, 1, 223 } -}; - -static const x86_insn_info enter_insn[] = { - { CPU_186|CPU_Not64, MOD_GasNoRev|MOD_GasSufL, 0, 0, 0, 1, {0xC8, 0, 0}, 0, 2, 398 }, - { CPU_186|CPU_64, MOD_GasNoRev|MOD_GasSufQ, 64, 64, 0, 1, {0xC8, 0, 0}, 0, 2, 398 }, - { CPU_186, MOD_GasOnly|MOD_GasNoRev|MOD_GasSufW, 16, 0, 0, 1, {0xC8, 0, 0}, 0, 2, 398 } -}; - -static const x86_insn_info jcc_insn[] = { - { CPU_Any, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 1, 370 }, - { CPU_Any, 0, 16, 0, 0, 0, {0, 0, 0}, 0, 1, 445 }, - { CPU_386|CPU_Not64, 0, 32, 0, 0, 0, {0, 0, 0}, 0, 1, 446 }, - { CPU_64, 0, 64, 0, 0, 0, {0, 0, 0}, 0, 1, 446 }, - { CPU_Any, MOD_Op0Add, 0, 64, 0, 1, {0x70, 0, 0}, 0, 1, 376 }, - { CPU_186, MOD_Op1Add, 16, 64, 0, 2, {0x0F, 0x80, 0}, 0, 1, 425 }, - { CPU_386|CPU_Not64, MOD_Op1Add, 32, 0, 0, 2, {0x0F, 0x80, 0}, 0, 1, 426 }, - { CPU_64, MOD_Op1Add, 64, 64, 0, 2, {0x0F, 0x80, 0}, 0, 1, 426 }, - { CPU_186, MOD_Op1Add, 0, 64, 0, 2, {0x0F, 0x80, 0}, 0, 1, 427 } -}; - -static const x86_insn_info jcxz_insn[] = { - { CPU_Any, MOD_AdSizeR, 0, 0, 0, 0, {0, 0, 0}, 0, 1, 370 }, - { CPU_Any, MOD_AdSizeR, 0, 64, 0, 1, {0xE3, 0, 0}, 0, 1, 376 } -}; - -static const x86_insn_info loop_insn[] = { - { CPU_Any, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 1, 370 }, - { CPU_Not64, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 2, 370 }, - { CPU_386, 0, 0, 64, 0, 0, {0, 0, 0}, 0, 2, 372 }, - { CPU_64, 0, 0, 64, 0, 0, {0, 0, 0}, 0, 2, 374 }, - { CPU_Not64, MOD_Op0Add, 0, 0, 0, 1, {0xE0, 0, 0}, 0, 1, 376 }, - { CPU_Any, MOD_Op0Add, 0, 64, 0, 1, {0xE0, 0, 0}, 0, 2, 376 }, - { CPU_386, MOD_Op0Add, 0, 64, 0, 1, {0xE0, 0, 0}, 0, 2, 378 }, - { CPU_64, MOD_Op0Add, 0, 64, 0, 1, {0xE0, 0, 0}, 0, 2, 380 } -}; - -static const x86_insn_info setcc_insn[] = { - { CPU_386, MOD_Op1Add|MOD_GasSufB, 0, 0, 0, 2, {0x0F, 0x90, 0}, 2, 1, 140 } -}; - -static const x86_insn_info cmpsd_insn[] = { - { CPU_386, MOD_GasIllegal, 32, 0, 0, 1, {0xA7, 0, 0}, 0, 0, 0 }, - { CPU_SSE2, 0, 0, 0, 0xF2, 2, {0x0F, 0xC2, 0}, 0, 3, 46 } -}; - -static const x86_insn_info movsd_insn[] = { - { CPU_386, MOD_GasIllegal, 32, 0, 0, 1, {0xA5, 0, 0}, 0, 0, 0 }, - { CPU_SSE2, 0, 0, 0, 0xF2, 2, {0x0F, 0x10, 0}, 0, 2, 0 }, - { CPU_SSE2, 0, 0, 0, 0xF2, 2, {0x0F, 0x10, 0}, 0, 2, 288 }, - { CPU_SSE2, 0, 0, 0, 0xF2, 2, {0x0F, 0x11, 0}, 0, 2, 334 } -}; - -static const x86_insn_info bittest_insn[] = { - { CPU_386, MOD_Op1Add|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 94 }, - { CPU_386, MOD_Op1Add|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 100 }, - { CPU_386|CPU_64, MOD_Op1Add|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 106 }, - { CPU_386, MOD_Gap0|MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0xBA, 0}, 0, 2, 112 }, - { CPU_386, MOD_Gap0|MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0xBA, 0}, 0, 2, 114 }, - { CPU_386|CPU_64, MOD_Gap0|MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0xBA, 0}, 0, 2, 116 } -}; - -static const x86_insn_info bsfr_insn[] = { - { CPU_386, MOD_Op1Add|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 4 }, - { CPU_386, MOD_Op1Add|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 7 }, - { CPU_386|CPU_64, MOD_Op1Add|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 10 } -}; - -static const x86_insn_info int_insn[] = { - { CPU_Any, 0, 0, 0, 0, 1, {0xCD, 0, 0}, 0, 1, 3 } -}; - -static const x86_insn_info bound_insn[] = { - { CPU_186|CPU_Not64, MOD_GasSufW, 16, 0, 0, 1, {0x62, 0, 0}, 0, 2, 306 }, - { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1, {0x62, 0, 0}, 0, 2, 176 } -}; - -static const x86_insn_info arpl_insn[] = { - { CPU_286|CPU_Not64|CPU_Prot, MOD_GasSufW, 0, 0, 0, 1, {0x63, 0, 0}, 0, 2, 94 } -}; - -static const x86_insn_info str_insn[] = { - { CPU_286|CPU_Prot, MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x00, 0}, 1, 1, 212 }, - { CPU_386|CPU_Prot, MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x00, 0}, 1, 1, 23 }, - { CPU_286|CPU_64|CPU_Prot, MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x00, 0}, 1, 1, 26 }, - { CPU_286|CPU_Prot, MOD_GasSufL|MOD_GasSufW, 0, 0, 0, 2, {0x0F, 0x00, 0}, 1, 1, 5 } -}; - -static const x86_insn_info prot286_insn[] = { - { CPU_286, MOD_Op1Add|MOD_SpAdd|MOD_GasSufW, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 1, 5 } -}; - -static const x86_insn_info sldtmsw_insn[] = { - { CPU_286, MOD_Op1Add|MOD_SpAdd|MOD_GasSufW, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 1, 29 }, - { CPU_386, MOD_Op1Add|MOD_SpAdd|MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 1, 86 }, - { CPU_286|CPU_64, MOD_Op1Add|MOD_SpAdd|MOD_GasSufQ, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 1, 139 }, - { CPU_286, MOD_Op1Add|MOD_SpAdd|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x00, 0}, 0, 1, 212 }, - { CPU_386, MOD_Op1Add|MOD_SpAdd|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x00, 0}, 0, 1, 23 }, - { CPU_286|CPU_64, MOD_Op1Add|MOD_SpAdd|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x00, 0}, 0, 1, 26 } -}; - -static const x86_insn_info fld_insn[] = { - { CPU_FPU, MOD_GasSufS, 0, 0, 0, 1, {0xD9, 0, 0}, 0, 1, 404 }, - { CPU_FPU, MOD_GasSufL, 0, 0, 0, 1, {0xDD, 0, 0}, 0, 1, 405 }, - { CPU_FPU, 0, 0, 0, 0, 1, {0xDB, 0, 0}, 5, 1, 402 }, - { CPU_FPU, 0, 0, 0, 0, 2, {0xD9, 0xC0, 0}, 0, 1, 145 } -}; - -static const x86_insn_info fstp_insn[] = { - { CPU_FPU, MOD_GasSufS, 0, 0, 0, 1, {0xD9, 0, 0}, 3, 1, 404 }, - { CPU_FPU, MOD_GasSufL, 0, 0, 0, 1, {0xDD, 0, 0}, 3, 1, 405 }, - { CPU_FPU, 0, 0, 0, 0, 1, {0xDB, 0, 0}, 7, 1, 402 }, - { CPU_FPU, 0, 0, 0, 0, 2, {0xDD, 0xD8, 0}, 0, 1, 145 } -}; - -static const x86_insn_info fldstpt_insn[] = { - { CPU_FPU, MOD_SpAdd, 0, 0, 0, 1, {0xDB, 0, 0}, 0, 1, 402 } -}; - -static const x86_insn_info fildstp_insn[] = { - { CPU_FPU, MOD_SpAdd|MOD_GasSufS, 0, 0, 0, 1, {0xDF, 0, 0}, 0, 1, 403 }, - { CPU_FPU, MOD_SpAdd|MOD_GasSufL, 0, 0, 0, 1, {0xDB, 0, 0}, 0, 1, 404 }, - { CPU_FPU, MOD_Gap0|MOD_Op0Add|MOD_SpAdd|MOD_GasSufQ, 0, 0, 0, 1, {0xDD, 0, 0}, 0, 1, 405 } -}; - -static const x86_insn_info fbldstp_insn[] = { - { CPU_FPU, MOD_SpAdd, 0, 0, 0, 1, {0xDF, 0, 0}, 0, 1, 311 } -}; - -static const x86_insn_info fst_insn[] = { - { CPU_FPU, MOD_GasSufS, 0, 0, 0, 1, {0xD9, 0, 0}, 2, 1, 404 }, - { CPU_FPU, MOD_GasSufL, 0, 0, 0, 1, {0xDD, 0, 0}, 2, 1, 405 }, - { CPU_FPU, 0, 0, 0, 0, 2, {0xDD, 0xD0, 0}, 0, 1, 145 } -}; - -static const x86_insn_info fxch_insn[] = { - { CPU_FPU, 0, 0, 0, 0, 2, {0xD9, 0xC8, 0}, 0, 1, 145 }, - { CPU_FPU, 0, 0, 0, 0, 2, {0xD9, 0xC8, 0}, 0, 2, 144 }, - { CPU_FPU, 0, 0, 0, 0, 2, {0xD9, 0xC8, 0}, 0, 2, 146 }, - { CPU_FPU, 0, 0, 0, 0, 2, {0xD9, 0xC9, 0}, 0, 0, 0 } -}; - -static const x86_insn_info fcom_insn[] = { - { CPU_FPU, MOD_Gap0|MOD_SpAdd|MOD_GasSufS, 0, 0, 0, 1, {0xD8, 0, 0}, 0, 1, 404 }, - { CPU_FPU, MOD_Gap0|MOD_SpAdd|MOD_GasSufL, 0, 0, 0, 1, {0xDC, 0, 0}, 0, 1, 405 }, - { CPU_FPU, MOD_Op1Add, 0, 0, 0, 2, {0xD8, 0x00, 0}, 0, 1, 145 }, - { CPU_FPU, MOD_Op1Add|MOD_GasOnly, 0, 0, 0, 2, {0xD8, 0x01, 0}, 0, 0, 0 }, - { CPU_FPU, MOD_Op1Add|MOD_GasIllegal, 0, 0, 0, 2, {0xD8, 0x00, 0}, 0, 2, 144 } -}; - -static const x86_insn_info fcom2_insn[] = { - { CPU_286|CPU_FPU, MOD_Op1Add|MOD_Op0Add, 0, 0, 0, 2, {0x00, 0x00, 0}, 0, 1, 145 }, - { CPU_286|CPU_FPU, MOD_Op1Add|MOD_Op0Add, 0, 0, 0, 2, {0x00, 0x00, 0}, 0, 2, 144 } -}; - -static const x86_insn_info farith_insn[] = { - { CPU_FPU, MOD_Gap0|MOD_Gap1|MOD_SpAdd|MOD_GasSufS, 0, 0, 0, 1, {0xD8, 0, 0}, 0, 1, 404 }, - { CPU_FPU, MOD_Gap0|MOD_Gap1|MOD_SpAdd|MOD_GasSufL, 0, 0, 0, 1, {0xDC, 0, 0}, 0, 1, 405 }, - { CPU_FPU, MOD_Gap0|MOD_Op1Add, 0, 0, 0, 2, {0xD8, 0x00, 0}, 0, 1, 145 }, - { CPU_FPU, MOD_Gap0|MOD_Op1Add, 0, 0, 0, 2, {0xD8, 0x00, 0}, 0, 2, 144 }, - { CPU_FPU, MOD_Op1Add, 0, 0, 0, 2, {0xDC, 0x00, 0}, 0, 1, 442 }, - { CPU_FPU, MOD_Op1Add|MOD_GasIllegal, 0, 0, 0, 2, {0xDC, 0x00, 0}, 0, 2, 146 }, - { CPU_FPU, MOD_Gap0|MOD_Op1Add|MOD_GasOnly, 0, 0, 0, 2, {0xDC, 0x00, 0}, 0, 2, 146 } -}; - -static const x86_insn_info farithp_insn[] = { - { CPU_FPU, MOD_Op1Add, 0, 0, 0, 2, {0xDE, 0x01, 0}, 0, 0, 0 }, - { CPU_FPU, MOD_Op1Add, 0, 0, 0, 2, {0xDE, 0x00, 0}, 0, 1, 145 }, - { CPU_FPU, MOD_Op1Add, 0, 0, 0, 2, {0xDE, 0x00, 0}, 0, 2, 146 } -}; - -static const x86_insn_info fiarith_insn[] = { - { CPU_FPU, MOD_Op0Add|MOD_SpAdd|MOD_GasSufS, 0, 0, 0, 1, {0x04, 0, 0}, 0, 1, 403 }, - { CPU_FPU, MOD_Op0Add|MOD_SpAdd|MOD_GasSufL, 0, 0, 0, 1, {0x00, 0, 0}, 0, 1, 404 } -}; - -static const x86_insn_info fldnstcw_insn[] = { - { CPU_FPU, MOD_SpAdd|MOD_GasSufW, 0, 0, 0, 1, {0xD9, 0, 0}, 0, 1, 29 } -}; - -static const x86_insn_info fstcw_insn[] = { - { CPU_FPU, MOD_GasSufW, 0, 0, 0, 2, {0x9B, 0xD9, 0}, 7, 1, 29 } -}; - -static const x86_insn_info fnstsw_insn[] = { - { CPU_FPU, MOD_GasSufW, 0, 0, 0, 1, {0xDD, 0, 0}, 7, 1, 29 }, - { CPU_FPU, MOD_GasSufW, 0, 0, 0, 2, {0xDF, 0xE0, 0}, 0, 1, 160 } -}; - -static const x86_insn_info fstsw_insn[] = { - { CPU_FPU, MOD_GasSufW, 0, 0, 0, 2, {0x9B, 0xDD, 0}, 7, 1, 29 }, - { CPU_FPU, MOD_GasSufW, 0, 0, 0, 3, {0x9B, 0xDF, 0xE0}, 0, 1, 160 } -}; - -static const x86_insn_info ffree_insn[] = { - { CPU_FPU, MOD_Op0Add, 0, 0, 0, 2, {0x00, 0xC0, 0}, 0, 1, 145 } -}; - -static const x86_insn_info bswap_insn[] = { - { CPU_486, MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0xC8, 0}, 0, 1, 443 }, - { CPU_64, MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0xC8, 0}, 0, 1, 444 } -}; - -static const x86_insn_info cmpxchgxadd_insn[] = { - { CPU_486, MOD_Op1Add|MOD_GasSufB, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 140 }, - { CPU_486, MOD_Op1Add|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x01, 0}, 0, 2, 94 }, - { CPU_486, MOD_Op1Add|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x01, 0}, 0, 2, 100 }, - { CPU_486|CPU_64, MOD_Op1Add|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x01, 0}, 0, 2, 106 } -}; - -static const x86_insn_info cmpxchg8b_insn[] = { - { CPU_586, MOD_GasSufQ, 0, 0, 0, 2, {0x0F, 0xC7, 0}, 1, 1, 139 } -}; - -static const x86_insn_info cmovcc_insn[] = { - { CPU_686, MOD_Op1Add|MOD_GasSufW, 16, 0, 0, 2, {0x0F, 0x40, 0}, 0, 2, 4 }, - { CPU_686, MOD_Op1Add|MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x40, 0}, 0, 2, 7 }, - { CPU_64|CPU_686, MOD_Op1Add|MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x40, 0}, 0, 2, 10 } -}; - -static const x86_insn_info fcmovcc_insn[] = { - { CPU_686|CPU_FPU, MOD_Op1Add|MOD_Op0Add, 0, 0, 0, 2, {0x00, 0x00, 0}, 0, 2, 144 } -}; - -static const x86_insn_info movnti_insn[] = { - { CPU_P4, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0xC3, 0}, 0, 2, 154 }, - { CPU_64|CPU_P4, MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0xC3, 0}, 0, 2, 156 } -}; - -static const x86_insn_info clflush_insn[] = { - { CPU_P3, 0, 0, 0, 0, 2, {0x0F, 0xAE, 0}, 7, 1, 44 } -}; - -static const x86_insn_info movd_insn[] = { - { CPU_386|CPU_MMX, 0, 0, 0, 0, 2, {0x0F, 0x6E, 0}, 0, 2, 118 }, - { CPU_64|CPU_MMX, 0, 64, 0, 0, 2, {0x0F, 0x6E, 0}, 0, 2, 120 }, - { CPU_386|CPU_MMX, 0, 0, 0, 0, 2, {0x0F, 0x7E, 0}, 0, 2, 119 }, - { CPU_64|CPU_MMX, 0, 64, 0, 0, 2, {0x0F, 0x7E, 0}, 0, 2, 122 }, - { CPU_386|CPU_SSE2, 0, 0, 0, 0x66, 2, {0x0F, 0x6E, 0}, 0, 2, 40 }, - { CPU_64|CPU_SSE2, 0, 64, 0, 0x66, 2, {0x0F, 0x6E, 0}, 0, 2, 91 }, - { CPU_386|CPU_SSE2, 0, 0, 0, 0x66, 2, {0x0F, 0x7E, 0}, 0, 2, 73 }, - { CPU_64|CPU_SSE2, 0, 64, 0, 0x66, 2, {0x0F, 0x7E, 0}, 0, 2, 70 } -}; - -static const x86_insn_info movq_insn[] = { - { CPU_MMX, MOD_GasIllegal, 0, 0, 0, 2, {0x0F, 0x6F, 0}, 0, 2, 82 }, - { CPU_64|CPU_MMX, MOD_GasIllegal, 64, 0, 0, 2, {0x0F, 0x6E, 0}, 0, 2, 120 }, - { CPU_MMX, MOD_GasIllegal, 0, 0, 0, 2, {0x0F, 0x7F, 0}, 0, 2, 148 }, - { CPU_64|CPU_MMX, MOD_GasIllegal, 64, 0, 0, 2, {0x0F, 0x7E, 0}, 0, 2, 122 }, - { CPU_SSE2, MOD_GasIllegal, 0, 0, 0xF3, 2, {0x0F, 0x7E, 0}, 0, 2, 0 }, - { CPU_SSE2, MOD_GasIllegal, 0, 0, 0xF3, 2, {0x0F, 0x7E, 0}, 0, 2, 150 }, - { CPU_64|CPU_SSE2, MOD_GasIllegal, 64, 0, 0x66, 2, {0x0F, 0x6E, 0}, 0, 2, 91 }, - { CPU_SSE2, MOD_GasIllegal, 0, 0, 0x66, 2, {0x0F, 0xD6, 0}, 0, 2, 152 }, - { CPU_64|CPU_SSE2, MOD_GasIllegal, 64, 0, 0x66, 2, {0x0F, 0x7E, 0}, 0, 2, 70 } -}; - -static const x86_insn_info mmxsse2_insn[] = { - { CPU_MMX, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 82 }, - { CPU_SSE2, MOD_Op1Add, 0, 0, 0x66, 2, {0x0F, 0x00, 0}, 0, 2, 46 } -}; - -static const x86_insn_info pshift_insn[] = { - { CPU_MMX, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 82 }, - { CPU_MMX, MOD_Gap0|MOD_Op1Add|MOD_SpAdd, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 50 }, - { CPU_SSE2, MOD_Op1Add, 0, 0, 0x66, 2, {0x0F, 0x00, 0}, 0, 2, 46 }, - { CPU_SSE2, MOD_Gap0|MOD_Op1Add|MOD_SpAdd, 0, 0, 0x66, 2, {0x0F, 0x00, 0}, 0, 2, 53 } -}; - -static const x86_insn_info sseps_insn[] = { - { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 46 } -}; - -static const x86_insn_info cvt_rx_xmm32_insn[] = { - { CPU_386|CPU_SSE, MOD_Op1Add|MOD_PreAdd|MOD_GasSufL, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, 52 }, - { CPU_386|CPU_SSE, MOD_Op1Add|MOD_PreAdd|MOD_GasSufL, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, 176 }, - { CPU_64|CPU_SSE, MOD_Op1Add|MOD_PreAdd|MOD_GasSufQ, 64, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, 58 }, - { CPU_64|CPU_SSE, MOD_Op1Add|MOD_PreAdd|MOD_GasSufQ, 64, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, 178 } -}; - -static const x86_insn_info cvt_mm_xmm64_insn[] = { - { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 136 }, - { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 138 } -}; - -static const x86_insn_info cvt_xmm_mm_ps_insn[] = { - { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 150 } -}; - -static const x86_insn_info cvt_xmm_rmx_insn[] = { - { CPU_386|CPU_SSE, MOD_Op1Add|MOD_PreAdd|MOD_GasSufL, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, 40 }, - { CPU_64|CPU_SSE, MOD_Op1Add|MOD_PreAdd|MOD_GasSufQ, 64, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, 91 } -}; - -static const x86_insn_info ssess_insn[] = { - { CPU_SSE, MOD_Op1Add|MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, 46 } -}; - -static const x86_insn_info ssecmpps_insn[] = { - { CPU_SSE, MOD_Imm8, 0, 0, 0, 2, {0x0F, 0xC2, 0}, 0, 2, 46 } -}; - -static const x86_insn_info ssecmpss_insn[] = { - { CPU_SSE, MOD_PreAdd|MOD_Imm8, 0, 0, 0x00, 2, {0x0F, 0xC2, 0}, 0, 2, 46 } -}; - -static const x86_insn_info ssepsimm_insn[] = { - { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 3, 46 } -}; - -static const x86_insn_info ssessimm_insn[] = { - { CPU_SSE, MOD_Op1Add|MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 3, 46 } -}; - -static const x86_insn_info ldstmxcsr_insn[] = { - { CPU_SSE, MOD_SpAdd, 0, 0, 0, 2, {0x0F, 0xAE, 0}, 0, 1, 86 } -}; - -static const x86_insn_info maskmovq_insn[] = { - { CPU_MMX|CPU_P3, 0, 0, 0, 0, 2, {0x0F, 0xF7, 0}, 0, 2, 396 } -}; - -static const x86_insn_info movaups_insn[] = { - { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 46 }, - { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x01, 0}, 0, 2, 264 } -}; - -static const x86_insn_info movhllhps_insn[] = { - { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 0 } -}; - -static const x86_insn_info movhlps_insn[] = { - { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 288 }, - { CPU_SSE, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x01, 0}, 0, 2, 334 } -}; - -static const x86_insn_info movmskps_insn[] = { - { CPU_386|CPU_SSE, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0x50, 0}, 0, 2, 52 }, - { CPU_64|CPU_SSE, MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0x50, 0}, 0, 2, 58 } -}; - -static const x86_insn_info movntps_insn[] = { - { CPU_SSE, 0, 0, 0, 0, 2, {0x0F, 0x2B, 0}, 0, 2, 274 } -}; - -static const x86_insn_info movntq_insn[] = { - { CPU_SSE, 0, 0, 0, 0, 2, {0x0F, 0xE7, 0}, 0, 2, 180 } -}; - -static const x86_insn_info movss_insn[] = { - { CPU_SSE, 0, 0, 0, 0xF3, 2, {0x0F, 0x10, 0}, 0, 2, 0 }, - { CPU_SSE, 0, 0, 0, 0xF3, 2, {0x0F, 0x10, 0}, 0, 2, 85 }, - { CPU_SSE, 0, 0, 0, 0xF3, 2, {0x0F, 0x11, 0}, 0, 2, 364 } -}; - -static const x86_insn_info pextrw_insn[] = { - { CPU_MMX|CPU_P3, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0xC5, 0}, 0, 3, 49 }, - { CPU_386|CPU_SSE2, MOD_GasSufL, 0, 0, 0x66, 2, {0x0F, 0xC5, 0}, 0, 3, 52 }, - { CPU_64|CPU_MMX|CPU_P3, MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0xC5, 0}, 0, 3, 55 }, - { CPU_64|CPU_SSE2, MOD_GasSufQ, 64, 0, 0x66, 2, {0x0F, 0xC5, 0}, 0, 3, 58 }, - { CPU_SSE41, 0, 0, 0, 0x66, 3, {0x0F, 0x3A, 0x15}, 0, 3, 61 }, - { CPU_386|CPU_SSE41, 0, 32, 0, 0x66, 3, {0x0F, 0x3A, 0x15}, 0, 3, 64 }, - { CPU_64|CPU_SSE41, 0, 64, 0, 0x66, 3, {0x0F, 0x3A, 0x15}, 0, 3, 67 } -}; - -static const x86_insn_info pinsrw_insn[] = { - { CPU_MMX|CPU_P3, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0xC4, 0}, 0, 3, 22 }, - { CPU_64|CPU_MMX|CPU_P3, MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0xC4, 0}, 0, 3, 25 }, - { CPU_MMX|CPU_P3, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0xC4, 0}, 0, 3, 28 }, - { CPU_386|CPU_SSE2, MOD_GasSufL, 0, 0, 0x66, 2, {0x0F, 0xC4, 0}, 0, 3, 31 }, - { CPU_64|CPU_SSE2, MOD_GasSufQ, 64, 0, 0x66, 2, {0x0F, 0xC4, 0}, 0, 3, 34 }, - { CPU_SSE2, MOD_GasSufL, 0, 0, 0x66, 2, {0x0F, 0xC4, 0}, 0, 3, 37 } -}; - -static const x86_insn_info pmovmskb_insn[] = { - { CPU_MMX|CPU_P3, MOD_GasSufL, 0, 0, 0, 2, {0x0F, 0xD7, 0}, 0, 2, 49 }, - { CPU_386|CPU_SSE2, MOD_GasSufL, 0, 0, 0x66, 2, {0x0F, 0xD7, 0}, 0, 2, 52 }, - { CPU_64|CPU_MMX|CPU_P3, MOD_GasSufQ, 64, 0, 0, 2, {0x0F, 0xD7, 0}, 0, 2, 55 }, - { CPU_64|CPU_SSE2, MOD_GasSufQ, 64, 0, 0x66, 2, {0x0F, 0xD7, 0}, 0, 2, 58 } -}; - -static const x86_insn_info pshufw_insn[] = { - { CPU_MMX|CPU_P3, 0, 0, 0, 0, 2, {0x0F, 0x70, 0}, 0, 3, 82 } -}; - -static const x86_insn_info cvt_xmm_xmm64_ss_insn[] = { - { CPU_SSE2, MOD_Op1Add|MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, 0 }, - { CPU_SSE2, MOD_Op1Add|MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, 288 } -}; - -static const x86_insn_info cvt_xmm_xmm64_ps_insn[] = { - { CPU_SSE2, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 0 }, - { CPU_SSE2, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 288 } -}; - -static const x86_insn_info cvt_rx_xmm64_insn[] = { - { CPU_386|CPU_SSE2, MOD_Op1Add|MOD_PreAdd|MOD_GasSufL, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, 52 }, - { CPU_386|CPU_SSE2, MOD_Op1Add|MOD_PreAdd|MOD_GasSufL, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, 155 }, - { CPU_64|CPU_SSE2, MOD_Op1Add|MOD_PreAdd|MOD_GasSufQ, 64, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, 58 }, - { CPU_64|CPU_SSE2, MOD_Op1Add|MOD_PreAdd|MOD_GasSufQ, 64, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, 308 } -}; - -static const x86_insn_info cvt_mm_xmm_insn[] = { - { CPU_SSE2, MOD_Op1Add|MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, 382 } -}; - -static const x86_insn_info cvt_xmm_mm_ss_insn[] = { - { CPU_SSE, MOD_Op1Add|MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, 150 } -}; - -static const x86_insn_info movaupd_insn[] = { - { CPU_SSE2, MOD_Op1Add, 0, 0, 0x66, 2, {0x0F, 0x00, 0}, 0, 2, 46 }, - { CPU_SSE2, MOD_Op1Add, 0, 0, 0x66, 2, {0x0F, 0x01, 0}, 0, 2, 264 } -}; - -static const x86_insn_info movhlpd_insn[] = { - { CPU_SSE2, MOD_Op1Add, 0, 0, 0x66, 2, {0x0F, 0x00, 0}, 0, 2, 288 }, - { CPU_SSE2, MOD_Op1Add, 0, 0, 0x66, 2, {0x0F, 0x01, 0}, 0, 2, 334 } -}; - -static const x86_insn_info movmskpd_insn[] = { - { CPU_386|CPU_SSE2, MOD_GasSufL, 0, 0, 0x66, 2, {0x0F, 0x50, 0}, 0, 2, 52 }, - { CPU_64|CPU_SSE2, MOD_GasSufQ, 0, 0, 0x66, 2, {0x0F, 0x50, 0}, 0, 2, 58 } -}; - -static const x86_insn_info movntpddq_insn[] = { - { CPU_SSE2, MOD_Op1Add, 0, 0, 0x66, 2, {0x0F, 0x00, 0}, 0, 2, 274 } -}; - -static const x86_insn_info vmxmemrd_insn[] = { - { CPU_Not64|CPU_P4, MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x78, 0}, 0, 2, 100 }, - { CPU_64|CPU_P4, MOD_GasSufQ, 64, 64, 0, 2, {0x0F, 0x78, 0}, 0, 2, 106 } -}; - -static const x86_insn_info vmxmemwr_insn[] = { - { CPU_Not64|CPU_P4, MOD_GasSufL, 32, 0, 0, 2, {0x0F, 0x79, 0}, 0, 2, 7 }, - { CPU_64|CPU_P4, MOD_GasSufQ, 64, 64, 0, 2, {0x0F, 0x79, 0}, 0, 2, 10 } -}; - -static const x86_insn_info vmxtwobytemem_insn[] = { - { CPU_P4, MOD_SpAdd, 0, 0, 0, 2, {0x0F, 0xC7, 0}, 0, 1, 139 } -}; - -static const x86_insn_info vmxthreebytemem_insn[] = { - { CPU_P4, MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0xC7, 0}, 6, 1, 139 } -}; - -static const x86_insn_info cvt_xmm_xmm32_insn[] = { - { CPU_SSE2, MOD_Op1Add|MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, 0 }, - { CPU_SSE2, MOD_Op1Add|MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 2, 85 } -}; - -static const x86_insn_info maskmovdqu_insn[] = { - { CPU_SSE2, 0, 0, 0, 0x66, 2, {0x0F, 0xF7, 0}, 0, 2, 0 } -}; - -static const x86_insn_info movdqau_insn[] = { - { CPU_SSE2, MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0x6F, 0}, 0, 2, 46 }, - { CPU_SSE2, MOD_PreAdd, 0, 0, 0x00, 2, {0x0F, 0x7F, 0}, 0, 2, 264 } -}; - -static const x86_insn_info movdq2q_insn[] = { - { CPU_SSE2, 0, 0, 0, 0xF2, 2, {0x0F, 0xD6, 0}, 0, 2, 136 } -}; - -static const x86_insn_info movq2dq_insn[] = { - { CPU_SSE2, 0, 0, 0, 0xF3, 2, {0x0F, 0xD6, 0}, 0, 2, 262 } -}; - -static const x86_insn_info pslrldq_insn[] = { - { CPU_SSE2, MOD_SpAdd, 0, 0, 0x66, 2, {0x0F, 0x73, 0}, 0, 2, 53 } -}; - -static const x86_insn_info lddqu_insn[] = { - { CPU_SSE3, 0, 0, 0, 0xF2, 2, {0x0F, 0xF0, 0}, 0, 2, 394 } -}; - -static const x86_insn_info ssse3_insn[] = { - { CPU_SSSE3, MOD_Op2Add, 0, 0, 0, 3, {0x0F, 0x38, 0x00}, 0, 2, 82 }, - { CPU_SSSE3, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, 46 } -}; - -static const x86_insn_info ssse3imm_insn[] = { - { CPU_SSSE3, MOD_Op2Add, 0, 0, 0, 3, {0x0F, 0x3A, 0x00}, 0, 3, 82 }, - { CPU_SSSE3, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x3A, 0x00}, 0, 3, 46 } -}; - -static const x86_insn_info sse4_insn[] = { - { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, 46 } -}; - -static const x86_insn_info sse4imm_insn[] = { - { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x3A, 0x00}, 0, 3, 46 } -}; - -static const x86_insn_info sse4xmm0_insn[] = { - { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, 46 }, - { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 3, 79 } -}; - -static const x86_insn_info crc32_insn[] = { - { CPU_386|CPU_SSE42, MOD_GasSufB, 0, 0, 0xF2, 3, {0x0F, 0x38, 0xF0}, 0, 2, 312 }, - { CPU_386|CPU_SSE42, MOD_GasSufW, 16, 0, 0xF2, 3, {0x0F, 0x38, 0xF1}, 0, 2, 314 }, - { CPU_386|CPU_SSE42, MOD_GasSufL, 32, 0, 0xF2, 3, {0x0F, 0x38, 0xF1}, 0, 2, 7 }, - { CPU_64|CPU_SSE42, MOD_GasSufB, 64, 0, 0xF2, 3, {0x0F, 0x38, 0xF0}, 0, 2, 316 }, - { CPU_64|CPU_SSE42, MOD_GasSufQ, 64, 0, 0xF2, 3, {0x0F, 0x38, 0xF1}, 0, 2, 10 } -}; - -static const x86_insn_info extractps_insn[] = { - { CPU_386|CPU_SSE41, 0, 32, 0, 0x66, 3, {0x0F, 0x3A, 0x17}, 0, 3, 73 }, - { CPU_64|CPU_SSE41, 0, 64, 0, 0x66, 3, {0x0F, 0x3A, 0x17}, 0, 3, 67 } -}; - -static const x86_insn_info insertps_insn[] = { - { CPU_SSE41, 0, 0, 0, 0x66, 3, {0x0F, 0x3A, 0x21}, 0, 3, 85 }, - { CPU_SSE41, 0, 0, 0, 0x66, 3, {0x0F, 0x3A, 0x21}, 0, 3, 88 } -}; - -static const x86_insn_info movntdqa_insn[] = { - { CPU_SSE41, 0, 0, 0, 0x66, 3, {0x0F, 0x38, 0x2A}, 0, 2, 362 } -}; - -static const x86_insn_info sse4pcmpstr_insn[] = { - { CPU_SSE42, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x3A, 0x00}, 0, 3, 46 } -}; - -static const x86_insn_info pextrb_insn[] = { - { CPU_SSE41, 0, 0, 0, 0x66, 3, {0x0F, 0x3A, 0x14}, 0, 3, 76 }, - { CPU_386|CPU_SSE41, 0, 32, 0, 0x66, 3, {0x0F, 0x3A, 0x14}, 0, 3, 64 }, - { CPU_64|CPU_SSE41, 0, 64, 0, 0x66, 3, {0x0F, 0x3A, 0x14}, 0, 3, 67 } -}; - -static const x86_insn_info pextrd_insn[] = { - { CPU_386|CPU_SSE41, 0, 32, 0, 0x66, 3, {0x0F, 0x3A, 0x16}, 0, 3, 73 } -}; - -static const x86_insn_info pextrq_insn[] = { - { CPU_64|CPU_SSE41, 0, 64, 0, 0x66, 3, {0x0F, 0x3A, 0x16}, 0, 3, 70 } -}; - -static const x86_insn_info pinsrb_insn[] = { - { CPU_SSE41, 0, 0, 0, 0x66, 3, {0x0F, 0x3A, 0x20}, 0, 3, 43 }, - { CPU_386|CPU_SSE41, 0, 32, 0, 0x66, 3, {0x0F, 0x3A, 0x20}, 0, 3, 31 } -}; - -static const x86_insn_info pinsrd_insn[] = { - { CPU_386|CPU_SSE41, 0, 32, 0, 0x66, 3, {0x0F, 0x3A, 0x22}, 0, 3, 40 } -}; - -static const x86_insn_info pinsrq_insn[] = { - { CPU_64|CPU_SSE41, 0, 64, 0, 0x66, 3, {0x0F, 0x3A, 0x22}, 0, 3, 91 } -}; - -static const x86_insn_info sse4m64_insn[] = { - { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, 288 }, - { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, 0 } -}; - -static const x86_insn_info sse4m32_insn[] = { - { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, 85 }, - { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, 0 } -}; - -static const x86_insn_info sse4m16_insn[] = { - { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, 37 }, - { CPU_SSE41, MOD_Op2Add, 0, 0, 0x66, 3, {0x0F, 0x38, 0x00}, 0, 2, 0 } -}; - -static const x86_insn_info cnt_insn[] = { - { CPU_Any, MOD_Op1Add|MOD_GasSufW, 16, 0, 0xF3, 2, {0x0F, 0x00, 0}, 0, 2, 4 }, - { CPU_386, MOD_Op1Add|MOD_GasSufL, 32, 0, 0xF3, 2, {0x0F, 0x00, 0}, 0, 2, 7 }, - { CPU_64, MOD_Op1Add|MOD_GasSufQ, 64, 0, 0xF3, 2, {0x0F, 0x00, 0}, 0, 2, 10 } -}; - -static const x86_insn_info extrq_insn[] = { - { CPU_SSE41, 0, 0, 0, 0x66, 2, {0x0F, 0x78, 0}, 0, 3, 1 }, - { CPU_SSE41, 0, 0, 0, 0x66, 2, {0x0F, 0x79, 0}, 0, 2, 0 } -}; - -static const x86_insn_info insertq_insn[] = { - { CPU_SSE41, 0, 0, 0, 0xF2, 2, {0x0F, 0x78, 0}, 0, 4, 0 }, - { CPU_SSE41, 0, 0, 0, 0xF2, 2, {0x0F, 0x79, 0}, 0, 2, 0 } -}; - -static const x86_insn_info movntsd_insn[] = { - { CPU_SSE41, 0, 0, 0, 0xF2, 2, {0x0F, 0x2B, 0}, 0, 2, 334 } -}; - -static const x86_insn_info movntss_insn[] = { - { CPU_SSE41, 0, 0, 0, 0xF3, 2, {0x0F, 0x2B, 0}, 0, 2, 364 } -}; - -static const x86_insn_info now3d_insn[] = { - { CPU_3DNow, MOD_Imm8, 0, 0, 0, 2, {0x0F, 0x0F, 0}, 0, 2, 82 } -}; - -static const x86_insn_info cmpxchg16b_insn[] = { - { CPU_64, 0, 64, 0, 0, 2, {0x0F, 0xC7, 0}, 1, 1, 274 } -}; - -static const x86_insn_info invlpga_insn[] = { - { CPU_SVM, 0, 0, 0, 0, 3, {0x0F, 0x01, 0xDF}, 0, 0, 0 }, - { CPU_386|CPU_SVM, 0, 0, 0, 0, 3, {0x0F, 0x01, 0xDF}, 0, 2, 290 } -}; - -static const x86_insn_info skinit_insn[] = { - { CPU_SVM, 0, 0, 0, 0, 3, {0x0F, 0x01, 0xDE}, 0, 0, 0 }, - { CPU_SVM, 0, 0, 0, 0, 3, {0x0F, 0x01, 0xDE}, 0, 1, 406 } -}; - -static const x86_insn_info svm_rax_insn[] = { - { CPU_SVM, MOD_Op2Add, 0, 0, 0, 3, {0x0F, 0x01, 0x00}, 0, 0, 0 }, - { CPU_SVM, MOD_Op2Add, 0, 0, 0, 3, {0x0F, 0x01, 0x00}, 0, 1, 290 } -}; - -static const x86_insn_info padlock_insn[] = { - { CPU_PadLock, MOD_Op1Add|MOD_PreAdd|MOD_Imm8, 0, 0, 0x00, 2, {0x0F, 0x00, 0}, 0, 0, 0 } -}; - -static const x86_insn_info cyrixmmx_insn[] = { - { CPU_Cyrix|CPU_MMX, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 2, 82 } -}; - -static const x86_insn_info pmachriw_insn[] = { - { CPU_Cyrix|CPU_MMX, 0, 0, 0, 0, 2, {0x0F, 0x5E, 0}, 0, 2, 138 } -}; - -static const x86_insn_info rdwrshr_insn[] = { - { CPU_686|CPU_Cyrix|CPU_SMM, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x36, 0}, 0, 1, 8 } -}; - -static const x86_insn_info rsdc_insn[] = { - { CPU_486|CPU_Cyrix|CPU_SMM, 0, 0, 0, 0, 2, {0x0F, 0x79, 0}, 0, 2, 310 } -}; - -static const x86_insn_info cyrixsmm_insn[] = { - { CPU_486|CPU_Cyrix|CPU_SMM, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 1, 311 } -}; - -static const x86_insn_info svdc_insn[] = { - { CPU_486|CPU_Cyrix|CPU_SMM, 0, 0, 0, 0, 2, {0x0F, 0x78, 0}, 0, 2, 386 } -}; - -static const x86_insn_info ibts_insn[] = { - { CPU_386|CPU_Obs|CPU_Undoc, 0, 16, 0, 0, 2, {0x0F, 0xA7, 0}, 0, 2, 94 }, - { CPU_386|CPU_Obs|CPU_Undoc, 0, 32, 0, 0, 2, {0x0F, 0xA7, 0}, 0, 2, 100 } -}; - -static const x86_insn_info umov_insn[] = { - { CPU_386|CPU_Undoc, 0, 0, 0, 0, 2, {0x0F, 0x10, 0}, 0, 2, 140 }, - { CPU_386|CPU_Undoc, 0, 16, 0, 0, 2, {0x0F, 0x11, 0}, 0, 2, 94 }, - { CPU_386|CPU_Undoc, 0, 32, 0, 0, 2, {0x0F, 0x11, 0}, 0, 2, 100 }, - { CPU_386|CPU_Undoc, 0, 0, 0, 0, 2, {0x0F, 0x12, 0}, 0, 2, 142 }, - { CPU_386|CPU_Undoc, 0, 16, 0, 0, 2, {0x0F, 0x13, 0}, 0, 2, 4 }, - { CPU_386|CPU_Undoc, 0, 32, 0, 0, 2, {0x0F, 0x13, 0}, 0, 2, 7 } -}; - -static const x86_insn_info xbts_insn[] = { - { CPU_386|CPU_Obs|CPU_Undoc, 0, 16, 0, 0, 2, {0x0F, 0xA6, 0}, 0, 2, 306 }, - { CPU_386|CPU_Obs|CPU_Undoc, 0, 32, 0, 0, 2, {0x0F, 0xA6, 0}, 0, 2, 176 } -}; - From f61ca1e37934ec87478520fb3c586028408e670a Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 12 Sep 2007 06:55:51 +0000 Subject: [PATCH 079/585] Restructure x86 CPU handling to allow for more than 30 CPU feature flags. svn path=/trunk/yasm/; revision=1945 --- modules/arch/x86/gen_x86_insn.py | 49 +++- modules/arch/x86/x86arch.c | 13 +- modules/arch/x86/x86arch.h | 76 +++--- modules/arch/x86/x86cpu.gperf | 438 +++++++++++++++++++------------ modules/arch/x86/x86id.c | 218 +++++++++------ 5 files changed, 495 insertions(+), 299 deletions(-) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index f862f8ed..41265967 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -256,6 +256,17 @@ class GroupForm(object): if len(self.modifiers) > 3: raise ValueError("too many modifiers: %s" % (self.modifiers,)) + cpus_str = [] + if self.cpu is not None: + if len(self.cpu) > 3: + raise ValueError("too many CPUs: %s" % (self.cpu,)) + + # Ensure CPUs initializer string is at least 3 long + cpus_str.extend("CPU_%s" % x for x in sorted(self.cpu)) + + # Ensure cpus initializer string is 3 long; 0=CPU_Any + cpus_str.extend(["0", "0", "0"]) + # Number gap elements as we copy modnames = [] n = 0 @@ -283,7 +294,9 @@ class GroupForm(object): mod_str = "|".join("MOD_%s" % x for x in mods) # Build instruction info structure initializer - return "{ "+ ", ".join([cpus_str or "CPU_Any", + return "{ "+ ", ".join([cpus_str[0], + cpus_str[1], + cpus_str[2], mod_str or "0", "%d" % (self.opersize or 0), "%d" % (self.def_opersize_64 or 0), @@ -366,10 +379,16 @@ class Insn(object): else: suffix_str = self.suffix - if self.cpu is None: - cpu_str = "" - else: - cpu_str = "|".join("CPU_%s" % x for x in sorted(self.cpu)) + cpus_str = [] + if self.cpu is not None: + if len(self.cpu) > 3: + raise ValueError("too many CPUs: %s" % (self.cpu,)) + + # Ensure CPUs initializer string is at least 3 long + cpus_str.extend("CPU_%s" % x for x in sorted(self.cpu)) + + # Ensure cpus initializer string is 3 long + cpus_str.extend(["0", "0", "0"]) if len(self.modifiers) > 3: raise ValueError("too many modifiers") @@ -408,8 +427,10 @@ class Insn(object): return ",\t".join(["%s_insn" % self.groupname, "(%sUL<<8)|%d" % \ (modifier_str, len(groups[self.groupname])), - cpu_str or "CPU_Any", - suffix_str]) + suffix_str, + cpus_str[0], + cpus_str[1], + cpus_str[2]]) insns = {} def add_insn(name, groupname, **kwargs): @@ -426,7 +447,9 @@ class Prefix(object): return ",\t".join(["NULL", "X86_" + self.groupname, "0x%02X" % self.value, - "NONE"]) + self.only64 and "CPU_64" or "0", + "0", + "0"]) gas_insns = {} nasm_insns = {} @@ -537,6 +560,16 @@ def output_groups(f): # General instruction groupings ##################################################################### +# +# Empty instruction +# +add_group("empty", opcode=[], operands=[]) + +# +# Placeholder for instructions invalid in 64-bit mode +# +add_group("not64", opcode=[], operands=[], not64=True) + # # One byte opcode instructions with no operands # diff --git a/modules/arch/x86/x86arch.c b/modules/arch/x86/x86arch.c index 0f8c9527..d410ac0e 100644 --- a/modules/arch/x86/x86arch.c +++ b/modules/arch/x86/x86arch.c @@ -57,7 +57,13 @@ x86_create(const char *machine, const char *parser, arch_x86->arch.module = &yasm_x86_LTX_arch; - arch_x86->cpu_enabled = ~CPU_Any; + /* default to all instructions/features enabled */ + arch_x86->active_cpu = 0; + arch_x86->cpu_enables_size = 1; + arch_x86->cpu_enables = yasm_xmalloc(sizeof(wordptr)); + arch_x86->cpu_enables[0] = BitVector_Create(64, FALSE); + BitVector_Fill(arch_x86->cpu_enables[0]); + arch_x86->amd64_machine = amd64_machine; arch_x86->mode_bits = 0; arch_x86->force_strict = 0; @@ -79,6 +85,11 @@ x86_create(const char *machine, const char *parser, static void x86_destroy(/*@only@*/ yasm_arch *arch) { + yasm_arch_x86 *arch_x86 = (yasm_arch_x86 *)arch; + unsigned int i; + for (i=0; icpu_enables_size; i++) + BitVector_Destroy(arch_x86->cpu_enables[i]); + yasm_xfree(arch_x86->cpu_enables); yasm_xfree(arch); } diff --git a/modules/arch/x86/x86arch.h b/modules/arch/x86/x86arch.h index cbe26f48..efd8e74f 100644 --- a/modules/arch/x86/x86arch.h +++ b/modules/arch/x86/x86arch.h @@ -27,53 +27,57 @@ #ifndef YASM_X86ARCH_H #define YASM_X86ARCH_H +#include + /* Available CPU feature flags */ -#define CPU_Any (0UL) /* Any old cpu will do */ +#define CPU_Any 0 /* Any old cpu will do */ #define CPU_086 CPU_Any -#define CPU_186 (1UL<<0) /* i186 or better required */ -#define CPU_286 (1UL<<1) /* i286 or better required */ -#define CPU_386 (1UL<<2) /* i386 or better required */ -#define CPU_486 (1UL<<3) /* i486 or better required */ -#define CPU_586 (1UL<<4) /* i585 or better required */ -#define CPU_686 (1UL<<5) /* i686 or better required */ -#define CPU_P3 (1UL<<6) /* Pentium3 or better required */ -#define CPU_P4 (1UL<<7) /* Pentium4 or better required */ -#define CPU_IA64 (1UL<<8) /* IA-64 or better required */ -#define CPU_K6 (1UL<<9) /* AMD K6 or better required */ -#define CPU_Athlon (1UL<<10) /* AMD Athlon or better required */ -#define CPU_Hammer (1UL<<11) /* AMD Sledgehammer or better required */ -#define CPU_FPU (1UL<<12) /* FPU support required */ -#define CPU_MMX (1UL<<13) /* MMX support required */ -#define CPU_SSE (1UL<<14) /* Streaming SIMD extensions required */ -#define CPU_SSE2 (1UL<<15) /* Streaming SIMD extensions 2 required */ -#define CPU_SSE3 (1UL<<16) /* Streaming SIMD extensions 3 required */ -#define CPU_3DNow (1UL<<17) /* 3DNow! support required */ -#define CPU_Cyrix (1UL<<18) /* Cyrix-specific instruction */ -#define CPU_AMD (1UL<<19) /* AMD-specific inst. (older than K6) */ -#define CPU_SMM (1UL<<20) /* System Management Mode instruction */ -#define CPU_Prot (1UL<<21) /* Protected mode only instruction */ -#define CPU_Undoc (1UL<<22) /* Undocumented instruction */ -#define CPU_Obs (1UL<<23) /* Obsolete instruction */ -#define CPU_Priv (1UL<<24) /* Priveleged instruction */ -#define CPU_SVM (1UL<<25) /* Secure Virtual Machine instruction */ -#define CPU_PadLock (1UL<<25) /* VIA PadLock instruction */ -#define CPU_EM64T (1UL<<26) /* Intel EM64T or better */ -#define CPU_SSSE3 (1UL<<27) /* Streaming SIMD extensions 3 required */ -#define CPU_SSE41 (1UL<<28) /* Streaming SIMD extensions 4.1 required */ -#define CPU_SSE42 (1UL<<29) /* Streaming SIMD extensions 4.2 required */ -#define CPU_SSE4 (CPU_SSE41|CPU_SSE42) +#define CPU_186 1 /* i186 or better required */ +#define CPU_286 2 /* i286 or better required */ +#define CPU_386 3 /* i386 or better required */ +#define CPU_486 4 /* i486 or better required */ +#define CPU_586 5 /* i585 or better required */ +#define CPU_686 6 /* i686 or better required */ +#define CPU_P3 7 /* Pentium3 or better required */ +#define CPU_P4 8 /* Pentium4 or better required */ +#define CPU_IA64 9 /* IA-64 or better required */ +#define CPU_K6 10 /* AMD K6 or better required */ +#define CPU_Athlon 11 /* AMD Athlon or better required */ +#define CPU_Hammer 12 /* AMD Sledgehammer or better required */ +#define CPU_FPU 13 /* FPU support required */ +#define CPU_MMX 14 /* MMX support required */ +#define CPU_SSE 15 /* Streaming SIMD extensions required */ +#define CPU_SSE2 16 /* Streaming SIMD extensions 2 required */ +#define CPU_SSE3 17 /* Streaming SIMD extensions 3 required */ +#define CPU_3DNow 18 /* 3DNow! support required */ +#define CPU_Cyrix 19 /* Cyrix-specific instruction */ +#define CPU_AMD 20 /* AMD-specific inst. (older than K6) */ +#define CPU_SMM 21 /* System Management Mode instruction */ +#define CPU_Prot 22 /* Protected mode only instruction */ +#define CPU_Undoc 23 /* Undocumented instruction */ +#define CPU_Obs 24 /* Obsolete instruction */ +#define CPU_Priv 25 /* Priveleged instruction */ +#define CPU_SVM 26 /* Secure Virtual Machine instruction */ +#define CPU_PadLock 27 /* VIA PadLock instruction */ +#define CPU_EM64T 28 /* Intel EM64T or better */ +#define CPU_SSSE3 29 /* Streaming SIMD extensions 3 required */ +#define CPU_SSE41 30 /* Streaming SIMD extensions 4.1 required */ +#define CPU_SSE42 31 /* Streaming SIMD extensions 4.2 required */ /* Technically not CPU capabilities, they do affect what instructions are * available. These are tested against BITS==64. */ -#define CPU_64 (1UL<<30) /* Only available in 64-bit mode */ -#define CPU_Not64 (1UL<<31) /* Not available (invalid) in 64-bit mode */ +#define CPU_64 120 /* Only available in 64-bit mode */ +#define CPU_Not64 121 /* Not available (invalid) in 64-bit mode */ typedef struct yasm_arch_x86 { yasm_arch_base arch; /* base structure */ /* What instructions/features are enabled? */ - unsigned long cpu_enabled; + unsigned int active_cpu; /* active index into cpu_enables table */ + unsigned int cpu_enables_size; /* size of cpu_enables table */ + wordptr *cpu_enables; + unsigned int amd64_machine; enum { X86_PARSER_NASM = 0, diff --git a/modules/arch/x86/x86cpu.gperf b/modules/arch/x86/x86cpu.gperf index 84f4d9fb..1feae1db 100644 --- a/modules/arch/x86/x86cpu.gperf +++ b/modules/arch/x86/x86cpu.gperf @@ -32,58 +32,153 @@ RCSID("$Id$"); #include "modules/arch/x86/x86arch.h" -enum cpu_mode { - CPU_MODE_VERBATIM = 1, - CPU_MODE_SET, - CPU_MODE_CLEAR -}; +#define PROC_8086 0 +#define PROC_186 1 +#define PROC_286 2 +#define PROC_386 3 +#define PROC_486 4 +#define PROC_586 5 +#define PROC_686 6 +#define PROC_p2 7 +#define PROC_p3 8 +#define PROC_p4 9 +#define PROC_prescott 10 +#define PROC_conroe 11 +#define PROC_penryn 12 +#define PROC_nehalem 13 -#define PROC_186 CPU_186|CPU_Priv -#define PROC_286 CPU_186|CPU_286|CPU_Priv -#define PROC_386 CPU_186|CPU_286|CPU_386|CPU_SMM|CPU_Prot|CPU_Priv -#define PROC_486 CPU_186|CPU_286|CPU_386|CPU_486|CPU_FPU|CPU_SMM|\ - CPU_Prot|CPU_Priv -#define PROC_586 CPU_186|CPU_286|CPU_386|CPU_486|CPU_586|CPU_FPU|\ - CPU_SMM|CPU_Prot|CPU_Priv -#define PROC_686 CPU_186|CPU_286|CPU_386|CPU_486|CPU_586|CPU_686|\ - CPU_FPU|CPU_SMM|CPU_Prot|CPU_Priv -#define PROC_p2 CPU_186|CPU_286|CPU_386|CPU_486|CPU_586|CPU_686|\ - CPU_FPU|CPU_MMX|CPU_SMM|CPU_Prot|CPU_Priv -#define PROC_p3 CPU_186|CPU_286|CPU_386|CPU_486|CPU_586|CPU_686|\ - CPU_P3|CPU_FPU|CPU_MMX|CPU_SSE|CPU_SMM|CPU_Prot|\ - CPU_Priv -#define PROC_p4 CPU_186|CPU_286|CPU_386|CPU_486|CPU_586|CPU_686|\ - CPU_P3|CPU_P4|CPU_FPU|CPU_MMX|CPU_SSE|CPU_SSE2|\ - CPU_SMM|CPU_Prot|CPU_Priv -#define PROC_ia64 CPU_186|CPU_286|CPU_386|CPU_486|CPU_586|CPU_686|\ - CPU_P3|CPU_P4|CPU_IA64|CPU_FPU|CPU_MMX|CPU_SSE|\ - CPU_SSE2|CPU_SMM|CPU_Prot|CPU_Priv -#define PROC_k6 CPU_186|CPU_286|CPU_386|CPU_486|CPU_586|CPU_686|\ - CPU_K6|CPU_FPU|CPU_MMX|CPU_3DNow|CPU_SMM|CPU_Prot|\ - CPU_Priv -#define PROC_k7 CPU_186|CPU_286|CPU_386|CPU_486|CPU_586|CPU_686|\ - CPU_K6|CPU_Athlon|CPU_FPU|CPU_MMX|CPU_SSE|CPU_3DNow|\ - CPU_SMM|CPU_Prot|CPU_Priv -#define PROC_hammer CPU_186|CPU_286|CPU_386|CPU_486|CPU_586|CPU_686|\ - CPU_K6|CPU_Athlon|CPU_Hammer|CPU_FPU|CPU_MMX|\ - CPU_SSE|CPU_SSE2|CPU_3DNow|CPU_SMM|CPU_Prot|\ - CPU_Priv -#define PROC_prescott CPU_186|CPU_286|CPU_386|CPU_486|CPU_586|CPU_686|\ - CPU_Hammer|CPU_EM64T|CPU_FPU|CPU_MMX|\ - CPU_SSE|CPU_SSE2|CPU_SSE3|CPU_SMM|\ - CPU_Prot|CPU_Priv -#define PROC_conroe CPU_186|CPU_286|CPU_386|CPU_486|CPU_586|CPU_686|\ - CPU_Hammer|CPU_EM64T|CPU_FPU|CPU_MMX|\ - CPU_SSE|CPU_SSE2|CPU_SSE3|CPU_SSSE3|CPU_SMM|\ - CPU_Prot|CPU_Priv -#define PROC_penryn CPU_186|CPU_286|CPU_386|CPU_486|CPU_586|CPU_686|\ - CPU_Hammer|CPU_EM64T|CPU_FPU|CPU_MMX|\ - CPU_SSE|CPU_SSE2|CPU_SSE3|CPU_SSSE3|CPU_SSE41|CPU_SMM|\ - CPU_Prot|CPU_Priv -#define PROC_nehalem CPU_186|CPU_286|CPU_386|CPU_486|CPU_586|CPU_686|\ - CPU_Hammer|CPU_EM64T|CPU_FPU|CPU_MMX|\ - CPU_SSE|CPU_SSE2|CPU_SSE3|CPU_SSSE3|CPU_SSE41|\ - CPU_SSE42|CPU_SMM|CPU_Prot|CPU_Priv +static void +x86_cpu_intel(wordptr cpu, unsigned int data) +{ + BitVector_Empty(cpu); + + BitVector_Bit_On(cpu, CPU_Priv); + if (data >= PROC_286) + BitVector_Bit_On(cpu, CPU_Prot); + if (data >= PROC_386) + BitVector_Bit_On(cpu, CPU_SMM); + if (data >= PROC_nehalem) + BitVector_Bit_On(cpu, CPU_SSE42); + if (data >= PROC_penryn) + BitVector_Bit_On(cpu, CPU_SSE41); + if (data >= PROC_conroe) + BitVector_Bit_On(cpu, CPU_SSSE3); + if (data >= PROC_prescott) + BitVector_Bit_On(cpu, CPU_SSE3); + if (data >= PROC_p4) + BitVector_Bit_On(cpu, CPU_SSE2); + if (data >= PROC_p3) + BitVector_Bit_On(cpu, CPU_SSE); + if (data >= PROC_p2) + BitVector_Bit_On(cpu, CPU_MMX); + if (data >= PROC_486) + BitVector_Bit_On(cpu, CPU_FPU); + if (data >= PROC_prescott) + BitVector_Bit_On(cpu, CPU_EM64T); + + if (data >= PROC_p4) + BitVector_Bit_On(cpu, CPU_P4); + if (data >= PROC_p3) + BitVector_Bit_On(cpu, CPU_P3); + if (data >= PROC_686) + BitVector_Bit_On(cpu, CPU_686); + if (data >= PROC_586) + BitVector_Bit_On(cpu, CPU_586); + if (data >= PROC_486) + BitVector_Bit_On(cpu, CPU_486); + if (data >= PROC_386) + BitVector_Bit_On(cpu, CPU_386); + if (data >= PROC_286) + BitVector_Bit_On(cpu, CPU_286); + if (data >= PROC_186) + BitVector_Bit_On(cpu, CPU_186); + BitVector_Bit_On(cpu, CPU_086); +} + +static void +x86_cpu_ia64(wordptr cpu, unsigned int data) +{ + BitVector_Empty(cpu); + BitVector_Bit_On(cpu, CPU_Priv); + BitVector_Bit_On(cpu, CPU_Prot); + BitVector_Bit_On(cpu, CPU_SMM); + BitVector_Bit_On(cpu, CPU_SSE2); + BitVector_Bit_On(cpu, CPU_SSE); + BitVector_Bit_On(cpu, CPU_MMX); + BitVector_Bit_On(cpu, CPU_FPU); + BitVector_Bit_On(cpu, CPU_IA64); + BitVector_Bit_On(cpu, CPU_P4); + BitVector_Bit_On(cpu, CPU_P3); + BitVector_Bit_On(cpu, CPU_686); + BitVector_Bit_On(cpu, CPU_586); + BitVector_Bit_On(cpu, CPU_486); + BitVector_Bit_On(cpu, CPU_386); + BitVector_Bit_On(cpu, CPU_286); + BitVector_Bit_On(cpu, CPU_186); + BitVector_Bit_On(cpu, CPU_086); +} + +#define PROC_hammer 8 +#define PROC_k7 7 +#define PROC_k6 6 + +static void +x86_cpu_amd(wordptr cpu, unsigned int data) +{ + BitVector_Empty(cpu); + + BitVector_Bit_On(cpu, CPU_Priv); + BitVector_Bit_On(cpu, CPU_Prot); + BitVector_Bit_On(cpu, CPU_SMM); + BitVector_Bit_On(cpu, CPU_3DNow); + if (data >= PROC_hammer) + BitVector_Bit_On(cpu, CPU_SSE2); + if (data >= PROC_k7) + BitVector_Bit_On(cpu, CPU_SSE); + if (data >= PROC_k6) + BitVector_Bit_On(cpu, CPU_MMX); + BitVector_Bit_On(cpu, CPU_FPU); + + if (data >= PROC_hammer) + BitVector_Bit_On(cpu, CPU_Hammer); + if (data >= PROC_k7) + BitVector_Bit_On(cpu, CPU_Athlon); + if (data >= PROC_k6) + BitVector_Bit_On(cpu, CPU_K6); + BitVector_Bit_On(cpu, CPU_686); + BitVector_Bit_On(cpu, CPU_586); + BitVector_Bit_On(cpu, CPU_486); + BitVector_Bit_On(cpu, CPU_386); + BitVector_Bit_On(cpu, CPU_286); + BitVector_Bit_On(cpu, CPU_186); + BitVector_Bit_On(cpu, CPU_086); +} + +static void +x86_cpu_set(wordptr cpu, unsigned int data) +{ + BitVector_Bit_On(cpu, data); +} + +static void +x86_cpu_clear(wordptr cpu, unsigned int data) +{ + BitVector_Bit_Off(cpu, data); +} + +static void +x86_cpu_set_sse4(wordptr cpu, unsigned int data) +{ + BitVector_Bit_On(cpu, CPU_SSE41); + BitVector_Bit_On(cpu, CPU_SSE42); +} + +static void +x86_cpu_clear_sse4(wordptr cpu, unsigned int data) +{ + BitVector_Bit_Off(cpu, CPU_SSE41); + BitVector_Bit_Off(cpu, CPU_SSE42); +} %} %ignore-case @@ -96,118 +191,118 @@ enum cpu_mode { %define lookup-function-name cpu_find struct cpu_parse_data { const char *name; - enum cpu_mode mode; - unsigned long cpu; + void (*handler) (wordptr cpu, unsigned int data); + unsigned int data; }; %% -8086, CPU_MODE_VERBATIM, CPU_Priv -186, CPU_MODE_VERBATIM, PROC_186 -80186, CPU_MODE_VERBATIM, PROC_186 -i186, CPU_MODE_VERBATIM, PROC_186 -286, CPU_MODE_VERBATIM, PROC_286 -80286, CPU_MODE_VERBATIM, PROC_286 -i286, CPU_MODE_VERBATIM, PROC_286 -386, CPU_MODE_VERBATIM, PROC_386 -80386, CPU_MODE_VERBATIM, PROC_386 -i386, CPU_MODE_VERBATIM, PROC_386 -486, CPU_MODE_VERBATIM, PROC_486 -80486, CPU_MODE_VERBATIM, PROC_486 -i486, CPU_MODE_VERBATIM, PROC_486 -586, CPU_MODE_VERBATIM, PROC_586 -i586, CPU_MODE_VERBATIM, PROC_586 -pentium, CPU_MODE_VERBATIM, PROC_586 -p5, CPU_MODE_VERBATIM, PROC_586 -686, CPU_MODE_VERBATIM, PROC_686 -i686, CPU_MODE_VERBATIM, PROC_686 -p6, CPU_MODE_VERBATIM, PROC_686 -ppro, CPU_MODE_VERBATIM, PROC_686 -pentiumpro, CPU_MODE_VERBATIM, PROC_686 -p2, CPU_MODE_VERBATIM, PROC_p2 -pentium2, CPU_MODE_VERBATIM, PROC_p2 -pentium-2, CPU_MODE_VERBATIM, PROC_p2 -pentiumii, CPU_MODE_VERBATIM, PROC_p2 -pentium-ii, CPU_MODE_VERBATIM, PROC_p2 -p3, CPU_MODE_VERBATIM, PROC_p3 -pentium3, CPU_MODE_VERBATIM, PROC_p3 -pentium-3, CPU_MODE_VERBATIM, PROC_p3 -pentiumiii, CPU_MODE_VERBATIM, PROC_p3 -pentium-iii, CPU_MODE_VERBATIM, PROC_p3 -katmai, CPU_MODE_VERBATIM, PROC_p3 -p4, CPU_MODE_VERBATIM, PROC_p4 -pentium4, CPU_MODE_VERBATIM, PROC_p4 -pentium-4, CPU_MODE_VERBATIM, PROC_p4 -pentiumiv, CPU_MODE_VERBATIM, PROC_p4 -pentium-iv, CPU_MODE_VERBATIM, PROC_p4 -williamette, CPU_MODE_VERBATIM, PROC_p4 -ia64, CPU_MODE_VERBATIM, PROC_ia64 -ia-64, CPU_MODE_VERBATIM, PROC_ia64 -itanium, CPU_MODE_VERBATIM, PROC_ia64 -k6, CPU_MODE_VERBATIM, PROC_k6 -k7, CPU_MODE_VERBATIM, PROC_k7 -athlon, CPU_MODE_VERBATIM, PROC_k7 -hammer, CPU_MODE_VERBATIM, PROC_hammer -sledgehammer, CPU_MODE_VERBATIM, PROC_hammer -opteron, CPU_MODE_VERBATIM, PROC_hammer -athlon64, CPU_MODE_VERBATIM, PROC_hammer -athlon-64, CPU_MODE_VERBATIM, PROC_hammer -prescott, CPU_MODE_VERBATIM, PROC_prescott -conroe, CPU_MODE_VERBATIM, PROC_conroe -penryn, CPU_MODE_VERBATIM, PROC_penryn -nehalem, CPU_MODE_VERBATIM, PROC_nehalem +8086, x86_cpu_intel, PROC_8086 +186, x86_cpu_intel, PROC_186 +80186, x86_cpu_intel, PROC_186 +i186, x86_cpu_intel, PROC_186 +286, x86_cpu_intel, PROC_286 +80286, x86_cpu_intel, PROC_286 +i286, x86_cpu_intel, PROC_286 +386, x86_cpu_intel, PROC_386 +80386, x86_cpu_intel, PROC_386 +i386, x86_cpu_intel, PROC_386 +486, x86_cpu_intel, PROC_486 +80486, x86_cpu_intel, PROC_486 +i486, x86_cpu_intel, PROC_486 +586, x86_cpu_intel, PROC_586 +i586, x86_cpu_intel, PROC_586 +pentium, x86_cpu_intel, PROC_586 +p5, x86_cpu_intel, PROC_586 +686, x86_cpu_intel, PROC_686 +i686, x86_cpu_intel, PROC_686 +p6, x86_cpu_intel, PROC_686 +ppro, x86_cpu_intel, PROC_686 +pentiumpro, x86_cpu_intel, PROC_686 +p2, x86_cpu_intel, PROC_p2 +pentium2, x86_cpu_intel, PROC_p2 +pentium-2, x86_cpu_intel, PROC_p2 +pentiumii, x86_cpu_intel, PROC_p2 +pentium-ii, x86_cpu_intel, PROC_p2 +p3, x86_cpu_intel, PROC_p3 +pentium3, x86_cpu_intel, PROC_p3 +pentium-3, x86_cpu_intel, PROC_p3 +pentiumiii, x86_cpu_intel, PROC_p3 +pentium-iii, x86_cpu_intel, PROC_p3 +katmai, x86_cpu_intel, PROC_p3 +p4, x86_cpu_intel, PROC_p4 +pentium4, x86_cpu_intel, PROC_p4 +pentium-4, x86_cpu_intel, PROC_p4 +pentiumiv, x86_cpu_intel, PROC_p4 +pentium-iv, x86_cpu_intel, PROC_p4 +williamette, x86_cpu_intel, PROC_p4 +ia64, x86_cpu_ia64, 0 +ia-64, x86_cpu_ia64, 0 +itanium, x86_cpu_ia64, 0 +k6, x86_cpu_amd, PROC_k6 +k7, x86_cpu_amd, PROC_k7 +athlon, x86_cpu_amd, PROC_k7 +hammer, x86_cpu_amd, PROC_hammer +sledgehammer, x86_cpu_amd, PROC_hammer +opteron, x86_cpu_amd, PROC_hammer +athlon64, x86_cpu_amd, PROC_hammer +athlon-64, x86_cpu_amd, PROC_hammer +prescott, x86_cpu_intel, PROC_prescott +conroe, x86_cpu_intel, PROC_conroe +penryn, x86_cpu_intel, PROC_penryn +nehalem, x86_cpu_intel, PROC_nehalem # # Features have "no" versions to disable them, and only set/reset the # specific feature being changed. All other bits are left alone. # -fpu, CPU_MODE_SET, CPU_FPU -nofpu, CPU_MODE_CLEAR, CPU_FPU -mmx, CPU_MODE_SET, CPU_MMX -nommx, CPU_MODE_CLEAR, CPU_MMX -sse, CPU_MODE_SET, CPU_SSE -nosse, CPU_MODE_CLEAR, CPU_SSE -sse2, CPU_MODE_SET, CPU_SSE2 -nosse2, CPU_MODE_CLEAR, CPU_SSE2 -sse3, CPU_MODE_SET, CPU_SSE3 -nosse3, CPU_MODE_CLEAR, CPU_SSE3 -#pni, CPU_MODE_SET, CPU_PNI -#nopni, CPU_MODE_CLEAR, CPU_PNI -3dnow, CPU_MODE_SET, CPU_3DNow -no3dnow, CPU_MODE_CLEAR, CPU_3DNow -cyrix, CPU_MODE_SET, CPU_Cyrix -nocyrix, CPU_MODE_CLEAR, CPU_Cyrix -amd, CPU_MODE_SET, CPU_AMD -noamd, CPU_MODE_CLEAR, CPU_AMD -smm, CPU_MODE_SET, CPU_SMM -nosmm, CPU_MODE_CLEAR, CPU_SMM -prot, CPU_MODE_SET, CPU_Prot -noprot, CPU_MODE_CLEAR, CPU_Prot -protected, CPU_MODE_SET, CPU_Prot -noprotected, CPU_MODE_CLEAR, CPU_Prot -undoc, CPU_MODE_SET, CPU_Undoc -noundoc, CPU_MODE_CLEAR, CPU_Undoc -undocumented, CPU_MODE_SET, CPU_Undoc -noundocumented, CPU_MODE_CLEAR, CPU_Undoc -obs, CPU_MODE_SET, CPU_Obs -noobs, CPU_MODE_CLEAR, CPU_Obs -obsolete, CPU_MODE_SET, CPU_Obs -noobsolete, CPU_MODE_CLEAR, CPU_Obs -priv, CPU_MODE_SET, CPU_Priv -nopriv, CPU_MODE_CLEAR, CPU_Priv -privileged, CPU_MODE_SET, CPU_Priv -noprivileged, CPU_MODE_CLEAR, CPU_Priv -svm, CPU_MODE_SET, CPU_SVM -nosvm, CPU_MODE_CLEAR, CPU_SVM -padlock, CPU_MODE_SET, CPU_PadLock -nopadlock, CPU_MODE_CLEAR, CPU_PadLock -em64t, CPU_MODE_SET, CPU_EM64T -noem64t, CPU_MODE_CLEAR, CPU_EM64T -ssse3, CPU_MODE_SET, CPU_SSSE3 -nossse3, CPU_MODE_CLEAR, CPU_SSSE3 -sse4.1, CPU_MODE_SET, CPU_SSE41 -nosse4.1, CPU_MODE_CLEAR, CPU_SSE41 -sse4.2, CPU_MODE_SET, CPU_SSE42 -nosse4.2, CPU_MODE_CLEAR, CPU_SSE42 -sse4, CPU_MODE_SET, CPU_SSE4 -nosse4, CPU_MODE_CLEAR, CPU_SSE4 +fpu, x86_cpu_set, CPU_FPU +nofpu, x86_cpu_clear, CPU_FPU +mmx, x86_cpu_set, CPU_MMX +nommx, x86_cpu_clear, CPU_MMX +sse, x86_cpu_set, CPU_SSE +nosse, x86_cpu_clear, CPU_SSE +sse2, x86_cpu_set, CPU_SSE2 +nosse2, x86_cpu_clear, CPU_SSE2 +sse3, x86_cpu_set, CPU_SSE3 +nosse3, x86_cpu_clear, CPU_SSE3 +#pni, x86_cpu_set, CPU_PNI +#nopni, x86_cpu_clear, CPU_PNI +3dnow, x86_cpu_set, CPU_3DNow +no3dnow, x86_cpu_clear, CPU_3DNow +cyrix, x86_cpu_set, CPU_Cyrix +nocyrix, x86_cpu_clear, CPU_Cyrix +amd, x86_cpu_set, CPU_AMD +noamd, x86_cpu_clear, CPU_AMD +smm, x86_cpu_set, CPU_SMM +nosmm, x86_cpu_clear, CPU_SMM +prot, x86_cpu_set, CPU_Prot +noprot, x86_cpu_clear, CPU_Prot +protected, x86_cpu_set, CPU_Prot +noprotected, x86_cpu_clear, CPU_Prot +undoc, x86_cpu_set, CPU_Undoc +noundoc, x86_cpu_clear, CPU_Undoc +undocumented, x86_cpu_set, CPU_Undoc +noundocumented, x86_cpu_clear, CPU_Undoc +obs, x86_cpu_set, CPU_Obs +noobs, x86_cpu_clear, CPU_Obs +obsolete, x86_cpu_set, CPU_Obs +noobsolete, x86_cpu_clear, CPU_Obs +priv, x86_cpu_set, CPU_Priv +nopriv, x86_cpu_clear, CPU_Priv +privileged, x86_cpu_set, CPU_Priv +noprivileged, x86_cpu_clear, CPU_Priv +svm, x86_cpu_set, CPU_SVM +nosvm, x86_cpu_clear, CPU_SVM +padlock, x86_cpu_set, CPU_PadLock +nopadlock, x86_cpu_clear, CPU_PadLock +em64t, x86_cpu_set, CPU_EM64T +noem64t, x86_cpu_clear, CPU_EM64T +ssse3, x86_cpu_set, CPU_SSSE3 +nossse3, x86_cpu_clear, CPU_SSSE3 +sse4.1, x86_cpu_set, CPU_SSE41 +nosse4.1, x86_cpu_clear, CPU_SSE41 +sse4.2, x86_cpu_set, CPU_SSE42 +nosse4.2, x86_cpu_clear, CPU_SSE42 +sse4, x86_cpu_set_sse4, 0 +nosse4, x86_cpu_clear_sse4, 0 %% void @@ -215,6 +310,8 @@ yasm_x86__parse_cpu(yasm_arch_x86 *arch_x86, const char *cpuid, size_t cpuid_len) { /*@null@*/ const struct cpu_parse_data *pdata; + wordptr new_cpu; + unsigned int i; if (cpuid_len > 15) return; @@ -226,15 +323,22 @@ yasm_x86__parse_cpu(yasm_arch_x86 *arch_x86, const char *cpuid, return; } - switch (pdata->mode) { - case CPU_MODE_VERBATIM: - arch_x86->cpu_enabled = pdata->cpu; - break; - case CPU_MODE_SET: - arch_x86->cpu_enabled |= pdata->cpu; - break; - case CPU_MODE_CLEAR: - arch_x86->cpu_enabled &= ~pdata->cpu; - break; + new_cpu = BitVector_Clone(arch_x86->cpu_enables[arch_x86->active_cpu]); + pdata->handler(new_cpu, pdata->data); + + /* try to find an existing match in the CPU table first */ + for (i=0; icpu_enables_size; i++) { + if (BitVector_equal(arch_x86->cpu_enables[i], new_cpu)) { + arch_x86->active_cpu = i; + BitVector_Destroy(new_cpu); + return; + } } + + /* not found, need to add a new entry */ + arch_x86->active_cpu = arch_x86->cpu_enables_size++; + arch_x86->cpu_enables = + yasm_xrealloc(arch_x86->cpu_enables, + arch_x86->cpu_enables_size*sizeof(wordptr)); + arch_x86->cpu_enables[arch_x86->active_cpu] = new_cpu; } diff --git a/modules/arch/x86/x86id.c b/modules/arch/x86/x86id.c index 67b80a61..9af6d0d7 100644 --- a/modules/arch/x86/x86id.c +++ b/modules/arch/x86/x86id.c @@ -34,7 +34,8 @@ RCSID("$Id$"); #include "modules/arch/x86/x86arch.h" -static const char *cpu_find_reverse(unsigned long cpu); +static const char *cpu_find_reverse(unsigned int cpu0, unsigned int cpu1, + unsigned int cpu2); /* Opcode modifiers. The opcode bytes are in "reverse" order because the * parameters are read from the arch-specific data in LSB->MSB order. @@ -234,7 +235,9 @@ typedef struct x86_insn_info { * cpu_enabled to see if all bits set here are set in cpu_enabled--if so, * the instruction is available on this CPU. */ - unsigned long cpu; + unsigned int cpu0:8; + unsigned int cpu1:8; + unsigned int cpu2:8; /* Opcode modifiers for variations of instruction. As each modifier reads * its parameter in LSB->MSB order from the arch-specific data[1] from the @@ -285,7 +288,7 @@ typedef struct x86_id_insn { /*@null@*/ const x86_insn_info *group; /* CPU feature flags enabled at the time of parsing the instruction */ - unsigned long cpu_enabled; + wordptr cpu_enabled; /* Modifier data */ unsigned long mod_data; @@ -320,16 +323,6 @@ static const yasm_bytecode_callback x86_id_insn_callback = { YASM_BC_SPECIAL_INSN }; -/* Empty instruction */ -static const x86_insn_info empty_insn[] = { - { CPU_Any, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 0, 0 } -}; - -/* Placeholder for instructions invalid in 64-bit mode */ -static const x86_insn_info not64_insn[] = { - { CPU_Not64, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 0, 0 } -}; - #include "x86insns.c" static void @@ -473,15 +466,27 @@ x86_finalize_jmp(yasm_bytecode *bc, yasm_bytecode *prev_bc, jmp->nearop.len = 0; for (; num_info>0 && (jmp->shortop.len == 0 || jmp->nearop.len == 0); num_info--, info++) { - unsigned long cpu = info->cpu; + unsigned int cpu0 = info->cpu0; + unsigned int cpu1 = info->cpu1; + unsigned int cpu2 = info->cpu2; - if ((cpu & CPU_64) && mode_bits != 64) + /* Match CPU */ + if (mode_bits != 64 && + (cpu0 == CPU_64 || cpu1 == CPU_64 || cpu2 == CPU_64)) continue; - if ((cpu & CPU_Not64) && mode_bits == 64) + if (mode_bits == 64 && + (cpu0 == CPU_Not64 || cpu1 == CPU_Not64 || cpu2 == CPU_Not64)) continue; - cpu &= ~(CPU_64 | CPU_Not64); - if ((id_insn->cpu_enabled & cpu) != cpu) + if (cpu0 == CPU_64 || cpu0 == CPU_Not64) + cpu0 = CPU_Any; + if (cpu1 == CPU_64 || cpu1 == CPU_Not64) + cpu1 = CPU_Any; + if (cpu2 == CPU_64 || cpu2 == CPU_Not64) + cpu2 = CPU_Any; + if (!BitVector_bit_test(id_insn->cpu_enabled, cpu0) || + !BitVector_bit_test(id_insn->cpu_enabled, cpu1) || + !BitVector_bit_test(id_insn->cpu_enabled, cpu2)) continue; if (info->num_operands == 0) @@ -539,6 +544,7 @@ x86_find_match(x86_id_insn *id_insn, yasm_insn_operand **ops, const x86_insn_info *info = id_insn->group; unsigned int num_info = id_insn->num_info; unsigned int suffix = id_insn->suffix; + unsigned int mode_bits = id_insn->mode_bits; int found = 0; /* Just do a simple linear search through the info array for a match. @@ -547,21 +553,30 @@ x86_find_match(x86_id_insn *id_insn, yasm_insn_operand **ops, for (; num_info>0 && !found; num_info--, info++) { yasm_insn_operand *op, **use_ops; const unsigned long *info_ops = &insn_operands[info->operands_index]; - unsigned long icpu; + unsigned int cpu0 = info->cpu0; + unsigned int cpu1 = info->cpu1; + unsigned int cpu2 = info->cpu2; unsigned int size; int mismatch = 0; int i; /* Match CPU */ - icpu = info->cpu; - - if ((icpu & CPU_64) && id_insn->mode_bits != 64) + if (mode_bits != 64 && + (cpu0 == CPU_64 || cpu1 == CPU_64 || cpu2 == CPU_64)) continue; - if ((icpu & CPU_Not64) && id_insn->mode_bits == 64) + if (mode_bits == 64 && + (cpu0 == CPU_Not64 || cpu1 == CPU_Not64 || cpu2 == CPU_Not64)) continue; - icpu &= ~(CPU_64 | CPU_Not64); - if (bypass != 7 && (id_insn->cpu_enabled & icpu) != icpu) + if (cpu0 == CPU_64 || cpu0 == CPU_Not64) + cpu0 = CPU_Any; + if (cpu1 == CPU_64 || cpu1 == CPU_Not64) + cpu1 = CPU_Any; + if (cpu2 == CPU_64 || cpu2 == CPU_Not64) + cpu2 = CPU_Any; + if (bypass != 7 && (!BitVector_bit_test(id_insn->cpu_enabled, cpu0) || + !BitVector_bit_test(id_insn->cpu_enabled, cpu1) || + !BitVector_bit_test(id_insn->cpu_enabled, cpu2))) continue; /* Match # of operands */ @@ -932,10 +947,13 @@ x86_match_error(x86_id_insn *id_insn, yasm_insn_operand **ops, N_("invalid size for operand %d"), 3); break; case 7: + { + unsigned int cpu0 = i->cpu0, cpu1 = i->cpu1, cpu2 = i->cpu2; yasm_error_set(YASM_ERROR_TYPE, N_("requires CPU%s"), - cpu_find_reverse(i->cpu & ~(CPU_64 | CPU_Not64))); + cpu_find_reverse(cpu0, cpu1, cpu2)); break; + } default: yasm_error_set(YASM_ERROR_TYPE, N_("invalid combination of opcode and operands")); @@ -1371,6 +1389,17 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) yasm_x86__bc_transform_insn(bc, insn); } +/* suffix flags for instructions */ +enum { + NONE = 0, + SUF_B = (MOD_GasSufB >> MOD_GasSuf_SHIFT), + SUF_W = (MOD_GasSufW >> MOD_GasSuf_SHIFT), + SUF_L = (MOD_GasSufL >> MOD_GasSuf_SHIFT), + SUF_Q = (MOD_GasSufQ >> MOD_GasSuf_SHIFT), + SUF_S = (MOD_GasSufS >> MOD_GasSuf_SHIFT), + WEAK = 0x80 /* Relaxed operand mode for GAS */ +} flags; + /* Static parse data structure for instructions */ typedef struct insnprefix_parse_data { const char *name; @@ -1384,100 +1413,102 @@ typedef struct insnprefix_parse_data { */ unsigned long data1; - /* For instruction, cpu flags. + /* For instruction, suffix flags. * For prefix, prefix value. */ - unsigned long data2; + unsigned int flags:8; - /* suffix flags for instructions */ - enum { - NONE = 0, - SUF_B = (MOD_GasSufB >> MOD_GasSuf_SHIFT), - SUF_W = (MOD_GasSufW >> MOD_GasSuf_SHIFT), - SUF_L = (MOD_GasSufL >> MOD_GasSuf_SHIFT), - SUF_Q = (MOD_GasSufQ >> MOD_GasSuf_SHIFT), - SUF_S = (MOD_GasSufS >> MOD_GasSuf_SHIFT), - WEAK = 0x80 /* Relaxed operand mode for GAS */ - } flags; + /* CPU flags */ + unsigned int cpu0:8; + unsigned int cpu1:8; + unsigned int cpu2:8; } insnprefix_parse_data; -#define PREFIX(name, type, value) \ - { name, NULL, type, value, NONE } /* Pull in all parse data */ #include "x86insn_nasm.c" #include "x86insn_gas.c" static const char * -cpu_find_reverse(unsigned long cpu) +cpu_find_reverse(unsigned int cpu0, unsigned int cpu1, unsigned int cpu2) { static char cpuname[200]; + wordptr cpu = BitVector_Create(128, TRUE); + + if (cpu0 != CPU_Any) + BitVector_Bit_On(cpu, cpu0); + if (cpu1 != CPU_Any) + BitVector_Bit_On(cpu, cpu1); + if (cpu2 != CPU_Any) + BitVector_Bit_On(cpu, cpu2); cpuname[0] = '\0'; - if (cpu & CPU_Prot) + if (BitVector_bit_test(cpu, CPU_Prot)) strcat(cpuname, " Protected"); - if (cpu & CPU_Undoc) + if (BitVector_bit_test(cpu, CPU_Undoc)) strcat(cpuname, " Undocumented"); - if (cpu & CPU_Obs) + if (BitVector_bit_test(cpu, CPU_Obs)) strcat(cpuname, " Obsolete"); - if (cpu & CPU_Priv) + if (BitVector_bit_test(cpu, CPU_Priv)) strcat(cpuname, " Privileged"); - if (cpu & CPU_FPU) + if (BitVector_bit_test(cpu, CPU_FPU)) strcat(cpuname, " FPU"); - if (cpu & CPU_MMX) + if (BitVector_bit_test(cpu, CPU_MMX)) strcat(cpuname, " MMX"); - if (cpu & CPU_SSE) + if (BitVector_bit_test(cpu, CPU_SSE)) strcat(cpuname, " SSE"); - if (cpu & CPU_SSE2) + if (BitVector_bit_test(cpu, CPU_SSE2)) strcat(cpuname, " SSE2"); - if (cpu & CPU_SSE3) + if (BitVector_bit_test(cpu, CPU_SSE3)) strcat(cpuname, " SSE3"); - if (cpu & CPU_3DNow) + if (BitVector_bit_test(cpu, CPU_3DNow)) strcat(cpuname, " 3DNow"); - if (cpu & CPU_Cyrix) + if (BitVector_bit_test(cpu, CPU_Cyrix)) strcat(cpuname, " Cyrix"); - if (cpu & CPU_AMD) + if (BitVector_bit_test(cpu, CPU_AMD)) strcat(cpuname, " AMD"); - if (cpu & CPU_SMM) + if (BitVector_bit_test(cpu, CPU_SMM)) strcat(cpuname, " SMM"); - if (cpu & CPU_SVM) + if (BitVector_bit_test(cpu, CPU_SVM)) strcat(cpuname, " SVM"); - if (cpu & CPU_PadLock) + if (BitVector_bit_test(cpu, CPU_PadLock)) strcat(cpuname, " PadLock"); - if (cpu & CPU_EM64T) + if (BitVector_bit_test(cpu, CPU_EM64T)) strcat(cpuname, " EM64T"); - if (cpu & CPU_SSSE3) + if (BitVector_bit_test(cpu, CPU_SSSE3)) strcat(cpuname, " SSSE3"); - if (cpu & CPU_SSE41) + if (BitVector_bit_test(cpu, CPU_SSE41)) strcat(cpuname, " SSE4.1"); - if (cpu & CPU_SSE42) + if (BitVector_bit_test(cpu, CPU_SSE42)) strcat(cpuname, " SSE4.2"); - if (cpu & CPU_186) + if (BitVector_bit_test(cpu, CPU_186)) strcat(cpuname, " 186"); - if (cpu & CPU_286) + if (BitVector_bit_test(cpu, CPU_286)) strcat(cpuname, " 286"); - if (cpu & CPU_386) + if (BitVector_bit_test(cpu, CPU_386)) strcat(cpuname, " 386"); - if (cpu & CPU_486) + if (BitVector_bit_test(cpu, CPU_486)) strcat(cpuname, " 486"); - if (cpu & CPU_586) + if (BitVector_bit_test(cpu, CPU_586)) strcat(cpuname, " 586"); - if (cpu & CPU_686) + if (BitVector_bit_test(cpu, CPU_686)) strcat(cpuname, " 686"); - if (cpu & CPU_P3) + if (BitVector_bit_test(cpu, CPU_P3)) strcat(cpuname, " P3"); - if (cpu & CPU_P4) + if (BitVector_bit_test(cpu, CPU_P4)) strcat(cpuname, " P4"); - if (cpu & CPU_IA64) + if (BitVector_bit_test(cpu, CPU_IA64)) strcat(cpuname, " IA64"); - if (cpu & CPU_K6) + if (BitVector_bit_test(cpu, CPU_K6)) strcat(cpuname, " K6"); - if (cpu & CPU_Athlon) + if (BitVector_bit_test(cpu, CPU_Athlon)) strcat(cpuname, " Athlon"); - if (cpu & CPU_Hammer) + if (BitVector_bit_test(cpu, CPU_Hammer)) strcat(cpuname, " Hammer"); + + BitVector_Destroy(cpu); return cpuname; } @@ -1488,6 +1519,7 @@ yasm_x86__parse_check_insnprefix(yasm_arch *arch, const char *id, { yasm_arch_x86 *arch_x86 = (yasm_arch_x86 *)arch; /*@null@*/ const insnprefix_parse_data *pdata; + unsigned int cpu0, cpu1, cpu2; size_t i; static char lcaseid[16]; @@ -1513,22 +1545,28 @@ yasm_x86__parse_check_insnprefix(yasm_arch *arch, const char *id, if (!pdata) return YASM_ARCH_NOTINSNPREFIX; - if (pdata->group) { - unsigned long cpu = pdata->data2; - x86_id_insn *id_insn; + cpu0 = pdata->cpu0; + cpu1 = pdata->cpu1; + cpu2 = pdata->cpu2; - if ((cpu & CPU_64) && arch_x86->mode_bits != 64) { + if (pdata->group) { + x86_id_insn *id_insn; + wordptr cpu_enabled = arch_x86->cpu_enables[arch_x86->active_cpu]; + + if (arch_x86->mode_bits != 64 && + (cpu0 == CPU_64 || cpu1 == CPU_64 || cpu2 == CPU_64)) { yasm_warn_set(YASM_WARN_GENERAL, N_("`%s' is an instruction in 64-bit mode"), id); return YASM_ARCH_NOTINSNPREFIX; } - if ((cpu & CPU_Not64) && arch_x86->mode_bits == 64) { + if (arch_x86->mode_bits == 64 && + (cpu0 == CPU_Not64 || cpu1 == CPU_Not64 || cpu2 == CPU_Not64)) { yasm_error_set(YASM_ERROR_GENERAL, N_("`%s' invalid in 64-bit mode"), id); id_insn = yasm_xmalloc(sizeof(x86_id_insn)); yasm_insn_initialize(&id_insn->insn); id_insn->group = not64_insn; - id_insn->cpu_enabled = CPU_Not64; + id_insn->cpu_enabled = cpu_enabled; id_insn->mod_data = 0; id_insn->num_info = NELEMS(not64_insn); id_insn->mode_bits = arch_x86->mode_bits; @@ -1539,18 +1577,25 @@ yasm_x86__parse_check_insnprefix(yasm_arch *arch, const char *id, return YASM_ARCH_INSN; } - cpu &= ~(CPU_64 | CPU_Not64); - if ((arch_x86->cpu_enabled & cpu) != cpu) { + if (cpu0 == CPU_64 || cpu0 == CPU_Not64) + cpu0 = CPU_Any; + if (cpu1 == CPU_64 || cpu1 == CPU_Not64) + cpu1 = CPU_Any; + if (cpu2 == CPU_64 || cpu2 == CPU_Not64) + cpu2 = CPU_Any; + if (!BitVector_bit_test(cpu_enabled, cpu0) || + !BitVector_bit_test(cpu_enabled, cpu1) || + !BitVector_bit_test(cpu_enabled, cpu2)) { yasm_warn_set(YASM_WARN_GENERAL, N_("`%s' is an instruction in CPU%s"), id, - cpu_find_reverse(cpu)); + cpu_find_reverse(cpu0, cpu1, cpu2)); return YASM_ARCH_NOTINSNPREFIX; } id_insn = yasm_xmalloc(sizeof(x86_id_insn)); yasm_insn_initialize(&id_insn->insn); id_insn->group = pdata->group; - id_insn->cpu_enabled = arch_x86->cpu_enabled; + id_insn->cpu_enabled = cpu_enabled; id_insn->mod_data = pdata->data1 >> 8; id_insn->num_info = pdata->data1 & 0xff; id_insn->mode_bits = arch_x86->mode_bits; @@ -1561,7 +1606,7 @@ yasm_x86__parse_check_insnprefix(yasm_arch *arch, const char *id, return YASM_ARCH_INSN; } else { unsigned long type = pdata->data1; - unsigned long value = pdata->data2; + unsigned long value = pdata->flags; if (arch_x86->mode_bits == 64 && type == X86_OPERSIZE && value == 32) { yasm_error_set(YASM_ERROR_GENERAL, @@ -1575,9 +1620,8 @@ yasm_x86__parse_check_insnprefix(yasm_arch *arch, const char *id, return YASM_ARCH_NOTINSNPREFIX; } - if ((type == X86_REX || - (value == 64 && (type == X86_OPERSIZE || type == X86_ADDRSIZE))) - && arch_x86->mode_bits != 64) { + if (arch_x86->mode_bits != 64 && + (cpu0 == CPU_64 || cpu1 == CPU_64 || cpu2 == CPU_64)) { yasm_warn_set(YASM_WARN_GENERAL, N_("`%s' is a prefix in 64-bit mode"), id); return YASM_ARCH_NOTINSNPREFIX; @@ -1611,7 +1655,7 @@ yasm_x86__create_empty_insn(yasm_arch *arch, unsigned long line) yasm_insn_initialize(&id_insn->insn); id_insn->group = empty_insn; - id_insn->cpu_enabled = arch_x86->cpu_enabled; + id_insn->cpu_enabled = arch_x86->cpu_enables[arch_x86->active_cpu]; id_insn->mod_data = 0; id_insn->num_info = NELEMS(empty_insn); id_insn->mode_bits = arch_x86->mode_bits; From f0e2e9a262fef648031da856e57254272613e460 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 12 Sep 2007 07:10:26 +0000 Subject: [PATCH 080/585] 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 --- modules/arch/x86/gen_x86_insn.py | 16 ++++++++-------- modules/arch/x86/x86arch.h | 1 + modules/arch/x86/x86cpu.gperf | 17 ++++++++++++++++- 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index 41265967..6d3127c3 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -32,7 +32,7 @@ ordered_cpus = [ "P4", "IA64", "Hammer"] ordered_cpu_features = [ "FPU", "Cyrix", "AMD", "MMX", "3DNow", "SMM", "SSE", "SSE2", - "SSE3", "SVM", "PadLock", "SSSE3", "SSE41", "SSE42"] + "SSE3", "SVM", "PadLock", "SSSE3", "SSE41", "SSE42", "SSE4a"] unordered_cpu_features = ["Priv", "Prot", "Undoc", "Obs"] def cpu_lcd(cpu1, cpu2): @@ -4961,18 +4961,18 @@ for sfx, sz in zip("wlq", [16, 32, 64]): add_insn("popcnt", "cnt", modifiers=[0xB8], cpu=["SSE42"]) ##################################################################### -# AMD SSE4.1 instructions +# AMD SSE4a instructions ##################################################################### add_group("extrq", - cpu=["SSE41"], + cpu=["SSE4a"], prefix=0x66, opcode=[0x0F, 0x78], operands=[Operand(type="SIMDReg", size=128, dest="EA"), Operand(type="Imm", size=8, relaxed=True, dest="EA"), Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) add_group("extrq", - cpu=["SSE41"], + cpu=["SSE4a"], prefix=0x66, opcode=[0x0F, 0x79], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), @@ -4981,7 +4981,7 @@ add_group("extrq", add_insn("extrq", "extrq") add_group("insertq", - cpu=["SSE41"], + cpu=["SSE4a"], prefix=0xF2, opcode=[0x0F, 0x78], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), @@ -4989,7 +4989,7 @@ add_group("insertq", Operand(type="Imm", size=8, relaxed=True, dest="EA"), Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) add_group("insertq", - cpu=["SSE41"], + cpu=["SSE4a"], prefix=0xF2, opcode=[0x0F, 0x79], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), @@ -4998,7 +4998,7 @@ add_group("insertq", add_insn("insertq", "insertq") add_group("movntsd", - cpu=["SSE41"], + cpu=["SSE4a"], prefix=0xF2, opcode=[0x0F, 0x2B], operands=[Operand(type="Mem", size=64, relaxed=True, dest="EA"), @@ -5007,7 +5007,7 @@ add_group("movntsd", add_insn("movntsd", "movntsd") add_group("movntss", - cpu=["SSE41"], + cpu=["SSE4a"], prefix=0xF3, opcode=[0x0F, 0x2B], operands=[Operand(type="Mem", size=32, relaxed=True, dest="EA"), diff --git a/modules/arch/x86/x86arch.h b/modules/arch/x86/x86arch.h index efd8e74f..5f5be1c0 100644 --- a/modules/arch/x86/x86arch.h +++ b/modules/arch/x86/x86arch.h @@ -63,6 +63,7 @@ #define CPU_SSSE3 29 /* Streaming SIMD extensions 3 required */ #define CPU_SSE41 30 /* Streaming SIMD extensions 4.1 required */ #define CPU_SSE42 31 /* Streaming SIMD extensions 4.2 required */ +#define CPU_SSE4a 32 /* AMD Streaming SIMD extensions 4a required */ /* Technically not CPU capabilities, they do affect what instructions are * available. These are tested against BITS==64. diff --git a/modules/arch/x86/x86cpu.gperf b/modules/arch/x86/x86cpu.gperf index 1feae1db..ed2b5232 100644 --- a/modules/arch/x86/x86cpu.gperf +++ b/modules/arch/x86/x86cpu.gperf @@ -118,6 +118,8 @@ x86_cpu_ia64(wordptr cpu, unsigned int data) BitVector_Bit_On(cpu, CPU_086); } +#define PROC_k10 10 +#define PROC_venice 9 #define PROC_hammer 8 #define PROC_k7 7 #define PROC_k6 6 @@ -131,6 +133,10 @@ x86_cpu_amd(wordptr cpu, unsigned int data) BitVector_Bit_On(cpu, CPU_Prot); BitVector_Bit_On(cpu, CPU_SMM); BitVector_Bit_On(cpu, CPU_3DNow); + if (data >= PROC_k10) + BitVector_Bit_On(cpu, CPU_SSE4a); + if (data >= PROC_venice) + BitVector_Bit_On(cpu, CPU_SSE3); if (data >= PROC_hammer) BitVector_Bit_On(cpu, CPU_SSE2); if (data >= PROC_k7) @@ -240,11 +246,14 @@ itanium, x86_cpu_ia64, 0 k6, x86_cpu_amd, PROC_k6 k7, x86_cpu_amd, PROC_k7 athlon, x86_cpu_amd, PROC_k7 +k8, x86_cpu_amd, PROC_hammer hammer, x86_cpu_amd, PROC_hammer -sledgehammer, x86_cpu_amd, PROC_hammer +clawhammer, x86_cpu_amd, PROC_hammer opteron, x86_cpu_amd, PROC_hammer athlon64, x86_cpu_amd, PROC_hammer athlon-64, x86_cpu_amd, PROC_hammer +venice, x86_cpu_amd, PROC_venice +k10, x86_cpu_amd, PROC_k10 prescott, x86_cpu_intel, PROC_prescott conroe, x86_cpu_intel, PROC_conroe penryn, x86_cpu_intel, PROC_penryn @@ -299,8 +308,14 @@ ssse3, x86_cpu_set, CPU_SSSE3 nossse3, x86_cpu_clear, CPU_SSSE3 sse4.1, x86_cpu_set, CPU_SSE41 nosse4.1, x86_cpu_clear, CPU_SSE41 +sse41, x86_cpu_set, CPU_SSE41 +nosse41, x86_cpu_clear, CPU_SSE41 sse4.2, x86_cpu_set, CPU_SSE42 nosse4.2, x86_cpu_clear, CPU_SSE42 +sse42, x86_cpu_set, CPU_SSE42 +nosse42, x86_cpu_clear, CPU_SSE42 +sse4a, x86_cpu_set, CPU_SSE4a +nosse4a, x86_cpu_clear, CPU_SSE4a sse4, x86_cpu_set_sse4, 0 nosse4, x86_cpu_clear_sse4, 0 %% From e19fd3ce2bdeb9ed0c7abf459f066af47e331dad Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 12 Sep 2007 07:11:42 +0000 Subject: [PATCH 081/585] Add Id tag. svn path=/trunk/yasm/; revision=1947 --- modules/arch/x86/gen_x86_insn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index 6d3127c3..01b45737 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -1,5 +1,5 @@ #! /usr/bin/env python -# +# $Id$ # x86 instructions and prefixes data and code generation # # Copyright (C) 2002-2007 Peter Johnson From 121de993202757ac3a5c2517f2aa80ec9816fd4d Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 13 Sep 2007 02:53:30 +0000 Subject: [PATCH 082/585] 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 --- configure.ac | 48 +++++++++++++++++++++++++++------- tools/python-yasm/Makefile.inc | 2 +- 2 files changed, 39 insertions(+), 11 deletions(-) diff --git a/configure.ac b/configure.ac index 5aef29b8..8fa4b4d2 100644 --- a/configure.ac +++ b/configure.ac @@ -54,13 +54,21 @@ AC_HELP_STRING([--enable-gcov],[Enable gcov code coverage (requires GCC)]), esac]) AC_ARG_ENABLE(python, -AC_HELP_STRING([--enable-python],[Build Python bindings]), +AC_HELP_STRING([--enable-python],[Enable Python-requiring portions of build]), [case "${enableval}" in yes) enable_python="yes" ;; no) enable_python="no" ;; *) AC_MSG_ERROR([bad value ${enableval} for --enable-python]) ;; esac], enable_python="auto") +AC_ARG_ENABLE(python-bindings, +AC_HELP_STRING([--enable-python-bindings],[Build Python bindings]), +[case "${enableval}" in + yes) enable_python_bindings="yes" ;; + no) enable_python_bindings="no" ;; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-python-bindings]) ;; +esac], enable_python_bindings="auto") + # # Checks for programs. # @@ -245,18 +253,37 @@ AC_SUBST(CCLD_FOR_BUILD) HOST_CC="$CC_FOR_BUILD" AC_SUBST(HOST_CC) -# Detect if we can build Python bindings -# (needs Python, Python headers, and Pyrex) +# Detect if we have Python if test x$enable_python = xno; then have_python=no else - AC_MSG_NOTICE([Checking to see if we can build Python bindings]) + AC_MSG_NOTICE([Checking for Python]) have_python=no AM_PATH_PYTHON(2.4,[],[AC_MSG_WARN([Python not found])]) if test -z "$PYTHON" || test "$PYTHON" = : ; then have_python=no else + have_python=yes + fi + + if test x$have_python = xno ; then + if test x$enable_python = xyes ; then + AC_MSG_ERROR([Python explicitly requested, but a suitable Python version was not found]) + else + AC_MSG_WARN([Could not find a suitable version of Python]) + fi + fi +fi + +# Detect if we can build Python bindings +# (needs Python, Python headers, and Pyrex) +if test x$enable_python_bindings = xno; then + have_python_bindings=no +else + AC_MSG_NOTICE([Checking to see if we can build Python bindings]) + have_python_bindings=no + if test x$have_python = xyes; then AC_MSG_CHECKING([for Pyrex >= 0.9.5.1]) PYREX_CHECK_VERSION(0.9.5.1, [AC_MSG_RESULT(yes) have_pyrex=yes], @@ -265,21 +292,22 @@ else AM_CHECK_PYTHON_HEADERS(have_python_headers=yes,have_python_headers=no) - if test x$have_pyrex = xyes -a x$have_python_headers = xyes ; then - have_python=yes + if test x$have_pyrex = xyes -a x$have_python_headers = xyes ; then + have_python_bindings=yes fi fi - if test x$have_python = xno ; then - if test x$enable_python = xyes ; then - AC_MSG_ERROR([Building Python explicitly requested, but can't build Python bindings because either Pyrex, Python headers or a suitable Python version was not found]) + if test x$have_python_bindings = xno ; then + if test x$enable_python_bindings = xyes ; then + AC_MSG_ERROR([Building Python bindings explicitly requested, but can't build Python bindings because either Pyrex, Python headers or a suitable Python version was not found]) else AC_MSG_WARN([Couldn't find either Pyrex, the Python headers or a suitable version of Python, not building Python bindings]) fi - fi + fi fi AM_CONDITIONAL(HAVE_PYTHON, test x$have_python = xyes) +AM_CONDITIONAL(HAVE_PYTHON_BINDINGS, test x$have_python_bindings = xyes) AC_CONFIG_FILES([Makefile po/Makefile.in diff --git a/tools/python-yasm/Makefile.inc b/tools/python-yasm/Makefile.inc index 9a1193c7..b4275586 100644 --- a/tools/python-yasm/Makefile.inc +++ b/tools/python-yasm/Makefile.inc @@ -20,7 +20,7 @@ EXTRA_DIST += tools/python-yasm/setup.py EXTRA_DIST += tools/python-yasm/yasm.pyx EXTRA_DIST += $(PYBINDING_DEPS) -if HAVE_PYTHON +if HAVE_PYTHON_BINDINGS # Use Pyxelator to generate Pyrex function headers. _yasm.pxi: ${HEADERS} From 42b841418b554703d0c13404e05c09e3d7b9fe83 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 13 Sep 2007 06:35:24 +0000 Subject: [PATCH 083/585] 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 --- modules/arch/x86/gen_x86_insn.py | 78 ++++------- modules/arch/x86/x86id.c | 226 +++++++++++++++---------------- 2 files changed, 136 insertions(+), 168 deletions(-) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index 01b45737..b45b04d8 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -267,37 +267,29 @@ class GroupForm(object): # Ensure cpus initializer string is 3 long; 0=CPU_Any cpus_str.extend(["0", "0", "0"]) - # Number gap elements as we copy - modnames = [] - n = 0 - for mod in self.modifiers: - if mod == "Gap": - modnames.append("Gap%d" % n) - n += 1 - else: - modnames.append(mod) - # Order by priority - mods = [x for x in ["Gap0", "Op2Add", "Gap1", "Op1Add", "Gap2", - "Op0Add", "PreAdd", "SpAdd", "OpSizeR", "Imm8", - "AdSizeR", "DOpS64R", "Op1AddSp"] - if x in modnames] + mods = ["MOD_%s" % x for x in self.modifiers] + # Ensure mods initializer string is 3 long + mods.extend(["0", "0", "0"]) + mod_str = "{" + ', '.join(mods[0:3]) + "}" + gas_flags = [] if self.gas_only: - mods.append("GasOnly") + gas_flags.append("GAS_ONLY") if self.gas_illegal: - mods.append("GasIllegal") + gas_flags.append("GAS_ILLEGAL") if self.gas_no_rev: - mods.append("GasNoRev") + gas_flags.append("GAS_NO_REV") if self.suffixes: - mods.extend("GasSuf%s" % x for x in sorted(self.suffixes)) - mod_str = "|".join("MOD_%s" % x for x in mods) + gas_flags.extend("SUF_%s" % x for x in sorted(self.suffixes)) + gas_flags = "|".join(gas_flags) # Build instruction info structure initializer - return "{ "+ ", ".join([cpus_str[0], + return "{ "+ ", ".join([gas_flags or "0", + cpus_str[0], cpus_str[1], cpus_str[2], - mod_str or "0", + mod_str, "%d" % (self.opersize or 0), "%d" % (self.def_opersize_64 or 0), self.special_prefix or "0", @@ -383,8 +375,6 @@ class Insn(object): if self.cpu is not None: if len(self.cpu) > 3: raise ValueError("too many CPUs: %s" % (self.cpu,)) - - # Ensure CPUs initializer string is at least 3 long cpus_str.extend("CPU_%s" % x for x in sorted(self.cpu)) # Ensure cpus initializer string is 3 long @@ -392,42 +382,17 @@ class Insn(object): if len(self.modifiers) > 3: raise ValueError("too many modifiers") + mods_str = ["0x%02X" % x for x in self.modifiers] # Ensure modifiers is at least 3 long - modifiers = [x for x in self.modifiers] - modifiers.extend([0, 0, 0]) - - # Find longest list of modifiers in groups - modnames = [] - for group in groups[self.groupname]: - if group.modifiers is not None and len(group.modifiers) > len(modnames): - # Number gap elements as we copy - modnames = [] - n = 0 - for mod in group.modifiers: - if mod == "Gap": - modnames.append("Gap%d" % n) - n += 1 - else: - modnames.append(mod) - - # Match up and order by priority - mods = dict(zip(modnames, modifiers)) - - modifier_str = "".join(reversed(["%02X" % mods[x] for x in - ["Gap0", "Op2Add", "Gap1", "Op1Add", - "Gap2", "Op0Add", "PreAdd", "SpAdd", - "OpSizeR", "Imm8", "AdSizeR", "DOpS64R", - "Op1AddSp"] if x in mods])) - if modifier_str: - modifier_str = "0x" + modifier_str - else: - modifier_str = "0" + mods_str.extend(["0", "0", "0"]) return ",\t".join(["%s_insn" % self.groupname, - "(%sUL<<8)|%d" % \ - (modifier_str, len(groups[self.groupname])), + "%d" % len(groups[self.groupname]), suffix_str, + mods_str[0], + mods_str[1], + mods_str[2], cpus_str[0], cpus_str[1], cpus_str[2]]) @@ -445,8 +410,11 @@ class Prefix(object): def __str__(self): return ",\t".join(["NULL", - "X86_" + self.groupname, + "X86_%s>>8" % self.groupname, "0x%02X" % self.value, + "0", + "0", + "0", self.only64 and "CPU_64" or "0", "0", "0"]) diff --git a/modules/arch/x86/x86id.c b/modules/arch/x86/x86id.c index 9af6d0d7..302ea8fd 100644 --- a/modules/arch/x86/x86id.c +++ b/modules/arch/x86/x86id.c @@ -37,37 +37,37 @@ RCSID("$Id$"); static const char *cpu_find_reverse(unsigned int cpu0, unsigned int cpu1, unsigned int cpu2); -/* Opcode modifiers. The opcode bytes are in "reverse" order because the - * parameters are read from the arch-specific data in LSB->MSB order. - * (only for asthetic reasons in the lexer code below, no practical reason). - */ -#define MOD_Gap0 (1UL<<0) /* Eats a parameter */ -#define MOD_Op2Add (1UL<<1) /* Parameter adds to opcode byte 2 */ -#define MOD_Gap1 (1UL<<2) /* Eats a parameter */ -#define MOD_Op1Add (1UL<<3) /* Parameter adds to opcode byte 1 */ -#define MOD_Gap2 (1UL<<4) /* Eats a parameter */ -#define MOD_Op0Add (1UL<<5) /* Parameter adds to opcode byte 0 */ -#define MOD_PreAdd (1UL<<6) /* Parameter adds to "special" prefix */ -#define MOD_SpAdd (1UL<<7) /* Parameter adds to "spare" value */ -#define MOD_OpSizeR (1UL<<8) /* Parameter replaces opersize */ -#define MOD_Imm8 (1UL<<9) /* Parameter is included as immediate byte */ -#define MOD_AdSizeR (1UL<<10) /* Parameter replaces addrsize (jmp only) */ -#define MOD_DOpS64R (1UL<<11) /* Parameter replaces default 64-bit opersize */ -#define MOD_Op1AddSp (1UL<<12) /* Parameter is added as "spare" to opcode byte 2 */ +/* Opcode modifiers. */ +#define MOD_Gap 0 /* Eats a parameter / does nothing */ +#define MOD_PreAdd 1 /* Parameter adds to "special" prefix */ +#define MOD_Op0Add 2 /* Parameter adds to opcode byte 0 */ +#define MOD_Op1Add 3 /* Parameter adds to opcode byte 1 */ +#define MOD_Op2Add 4 /* Parameter adds to opcode byte 2 */ +#define MOD_SpAdd 5 /* Parameter adds to "spare" value */ +#define MOD_OpSizeR 6 /* Parameter replaces opersize */ +#define MOD_Imm8 7 /* Parameter is included as immediate byte */ +#define MOD_AdSizeR 8 /* Parameter replaces addrsize (jmp only) */ +#define MOD_DOpS64R 9 /* Parameter replaces default 64-bit opersize */ +#define MOD_Op1AddSp 10 /* Parameter is added as "spare" to opcode byte 2 */ -/* Modifiers that aren't: these are used with the GAS parser to indicate - * special cases. - */ -#define MOD_GasOnly (1UL<<13) /* Only available in GAS mode */ -#define MOD_GasIllegal (1UL<<14) /* Illegal in GAS mode */ -#define MOD_GasNoRev (1UL<<15) /* Don't reverse operands */ -#define MOD_GasSufB (1UL<<16) /* GAS B suffix ok */ -#define MOD_GasSufW (1UL<<17) /* GAS W suffix ok */ -#define MOD_GasSufL (1UL<<18) /* GAS L suffix ok */ -#define MOD_GasSufQ (1UL<<19) /* GAS Q suffix ok */ -#define MOD_GasSufS (1UL<<20) /* GAS S suffix ok */ -#define MOD_GasSuf_SHIFT 16 -#define MOD_GasSuf_MASK (0x1FUL<<16) +/* GAS suffix flags for instructions */ +enum { + NONE = 0, + SUF_B = 1<<0, + SUF_W = 1<<1, + SUF_L = 1<<2, + SUF_Q = 1<<3, + SUF_S = 1<<4, + SUF_MASK = SUF_B|SUF_W|SUF_L|SUF_Q|SUF_S, + + /* Flags only used in x86_insn_info */ + GAS_ONLY = 1<<5, /* Only available in GAS mode */ + GAS_ILLEGAL = 1<<6, /* Illegal in GAS mode */ + GAS_NO_REV = 1<<7, /* Don't reverse operands in GAS mode */ + + /* Flags only used in insnprefix_parse_data */ + WEAK = 1<<5 /* Relaxed operand mode for GAS */ +} gas_suffix_flags; /* Operand types. These are more detailed than the "general" types for all * architectures, as they include the size, for instance. @@ -230,6 +230,9 @@ static const char *cpu_find_reverse(unsigned int cpu0, unsigned int cpu1, #define OPAP_MASK (7UL<<17) typedef struct x86_insn_info { + /* GAS suffix flags */ + unsigned int gas_flags:8; /* Enabled for these GAS suffixes */ + /* The CPU feature flags needed to execute this instruction. This is OR'ed * with arch-specific data[2]. This combined value is compared with * cpu_enabled to see if all bits set here are set in cpu_enabled--if so, @@ -245,7 +248,7 @@ typedef struct x86_insn_info { * count of insn_info structures in the instruction grouping, there can * only be a maximum of 3 modifiers. */ - unsigned long modifiers; + unsigned char modifiers[3]; /* Operand Size */ unsigned char opersize; @@ -291,7 +294,7 @@ typedef struct x86_id_insn { wordptr cpu_enabled; /* Modifier data */ - unsigned long mod_data; + unsigned char mod_data[3]; /* Number of elements in the instruction parse group */ unsigned int num_info:8; @@ -415,11 +418,12 @@ x86_finalize_jmp(yasm_bytecode *bc, yasm_bytecode *prev_bc, x86_jmp *jmp; int num_info = id_insn->num_info; const x86_insn_info *info = id_insn->group; - unsigned long mod_data = id_insn->mod_data; + unsigned char *mod_data = id_insn->mod_data; unsigned int mode_bits = id_insn->mode_bits; /*unsigned char suffix = id_insn->suffix;*/ yasm_insn_operand *op; static const unsigned char size_lookup[] = {0, 8, 16, 32, 64, 80, 128, 0}; + unsigned int i; /* We know the target is in operand 0, but sanity check for Imm. */ op = yasm_insn_ops_first(&id_insn->insn); @@ -456,8 +460,10 @@ x86_finalize_jmp(yasm_bytecode *bc, yasm_bytecode *prev_bc, & OPS_MASK)>>OPS_SHIFT]; /* Check for address size override */ - if (jinfo->modifiers & MOD_AdSizeR) - jmp->common.addrsize = (unsigned char)(mod_data & 0xFF); + for (i=0; imodifiers); i++) { + if (jinfo->modifiers[i] == MOD_AdSizeR) + jmp->common.addrsize = mod_data[i]; + } /* Scan through other infos for this insn looking for short/near versions. * Needs to match opersize and number of operands, also be within CPU. @@ -501,13 +507,17 @@ x86_finalize_jmp(yasm_bytecode *bc, yasm_bytecode *prev_bc, switch ((int)(insn_operands[info->operands_index+0] & OPTM_MASK)) { case OPTM_Short: x86_finalize_opcode(&jmp->shortop, info); - if (info->modifiers & MOD_Op0Add) - jmp->shortop.opcode[0] += (unsigned char)(mod_data & 0xFF); + for (i=0; imodifiers); i++) { + if (info->modifiers[i] == MOD_Op0Add) + jmp->shortop.opcode[0] += mod_data[i]; + } break; case OPTM_Near: x86_finalize_opcode(&jmp->nearop, info); - if (info->modifiers & MOD_Op1Add) - jmp->nearop.opcode[1] += (unsigned char)(mod_data & 0xFF); + for (i=0; imodifiers); i++) { + if (info->modifiers[i] == MOD_Op1Add) + jmp->nearop.opcode[1] += mod_data[i]; + } break; } } @@ -556,6 +566,7 @@ x86_find_match(x86_id_insn *id_insn, yasm_insn_operand **ops, unsigned int cpu0 = info->cpu0; unsigned int cpu1 = info->cpu1; unsigned int cpu2 = info->cpu2; + unsigned int gas_flags = info->gas_flags; unsigned int size; int mismatch = 0; int i; @@ -584,22 +595,19 @@ x86_find_match(x86_id_insn *id_insn, yasm_insn_operand **ops, continue; /* Match parser mode */ - if ((info->modifiers & MOD_GasOnly) - && id_insn->parser != X86_PARSER_GAS) + if ((gas_flags & GAS_ONLY) && id_insn->parser != X86_PARSER_GAS) continue; - if ((info->modifiers & MOD_GasIllegal) - && id_insn->parser == X86_PARSER_GAS) + if ((gas_flags & GAS_ILLEGAL) && id_insn->parser == X86_PARSER_GAS) continue; /* Match suffix (if required) */ - if (suffix != 0 && suffix != 0x80 - && ((suffix<modifiers) == 0) + if (suffix != 0 && suffix != WEAK + && ((suffix & SUF_MASK) & (gas_flags & SUF_MASK)) == 0) continue; /* Use reversed operands in GAS mode if not otherwise specified */ use_ops = ops; - if (id_insn->parser == X86_PARSER_GAS - && !(info->modifiers & MOD_GasNoRev)) + if (id_insn->parser == X86_PARSER_GAS && !(gas_flags & GAS_NO_REV)) use_ops = rev_ops; if (id_insn->insn.num_operands == 0) { @@ -966,8 +974,8 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) x86_id_insn *id_insn = (x86_id_insn *)bc->contents; x86_insn *insn; const x86_insn_info *info = id_insn->group; - unsigned long mod_data = id_insn->mod_data; unsigned int mode_bits = id_insn->mode_bits; + unsigned char *mod_data = id_insn->mod_data; yasm_insn_operand *op, *ops[4], *rev_ops[4]; /*@null@*/ yasm_expr *imm; unsigned char im_len; @@ -1070,49 +1078,42 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) insn->rex = 0; /* Apply modifiers */ - if (info->modifiers & MOD_Gap0) - mod_data >>= 8; - if (info->modifiers & MOD_Op2Add) { - insn->opcode.opcode[2] += (unsigned char)(mod_data & 0xFF); - mod_data >>= 8; - } - if (info->modifiers & MOD_Gap1) - mod_data >>= 8; - if (info->modifiers & MOD_Op1Add) { - insn->opcode.opcode[1] += (unsigned char)(mod_data & 0xFF); - mod_data >>= 8; - } - if (info->modifiers & MOD_Gap2) - mod_data >>= 8; - if (info->modifiers & MOD_Op0Add) { - insn->opcode.opcode[0] += (unsigned char)(mod_data & 0xFF); - mod_data >>= 8; - } - if (info->modifiers & MOD_PreAdd) { - insn->special_prefix += (unsigned char)(mod_data & 0xFF); - mod_data >>= 8; - } - if (info->modifiers & MOD_SpAdd) { - spare += (unsigned char)(mod_data & 0xFF); - mod_data >>= 8; - } - if (info->modifiers & MOD_OpSizeR) { - insn->common.opersize = (unsigned char)(mod_data & 0xFF); - mod_data >>= 8; - } - if (info->modifiers & MOD_Imm8) { - imm = yasm_expr_create_ident(yasm_expr_int( - yasm_intnum_create_uint(mod_data & 0xFF)), bc->line); - im_len = 8; - mod_data >>= 8; - } - if (info->modifiers & MOD_DOpS64R) { - insn->def_opersize_64 = (unsigned char)(mod_data & 0xFF); - mod_data >>= 8; - } - if (info->modifiers & MOD_Op1AddSp) { - insn->opcode.opcode[1] += (unsigned char)(mod_data & 0xFF)<<3; - /*mod_data >>= 8;*/ + for (i=0; imodifiers); i++) { + switch (info->modifiers[i]) { + case MOD_Gap: + break; + case MOD_PreAdd: + insn->special_prefix += mod_data[i]; + break; + case MOD_Op0Add: + insn->opcode.opcode[0] += mod_data[i]; + break; + case MOD_Op1Add: + insn->opcode.opcode[1] += mod_data[i]; + break; + case MOD_Op2Add: + insn->opcode.opcode[2] += mod_data[i]; + break; + case MOD_SpAdd: + spare += mod_data[i]; + break; + case MOD_OpSizeR: + insn->common.opersize = mod_data[i]; + break; + case MOD_Imm8: + imm = yasm_expr_create_ident(yasm_expr_int( + yasm_intnum_create_uint(mod_data[i])), bc->line); + im_len = 8; + break; + case MOD_DOpS64R: + insn->def_opersize_64 = mod_data[i]; + break; + case MOD_Op1AddSp: + insn->opcode.opcode[1] += mod_data[i]<<3; + break; + default: + break; + } } /* In 64-bit mode, if opersize is 64 and default is not 64, @@ -1129,7 +1130,7 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) /* Use reversed operands in GAS mode if not otherwise specified */ if (id_insn->parser == X86_PARSER_GAS - && !(info->modifiers & MOD_GasNoRev)) + && !(info->gas_flags & GAS_NO_REV)) use_ops = rev_ops; for (i = 0, op = use_ops[0]; op && inum_operands; @@ -1389,17 +1390,6 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) yasm_x86__bc_transform_insn(bc, insn); } -/* suffix flags for instructions */ -enum { - NONE = 0, - SUF_B = (MOD_GasSufB >> MOD_GasSuf_SHIFT), - SUF_W = (MOD_GasSufW >> MOD_GasSuf_SHIFT), - SUF_L = (MOD_GasSufL >> MOD_GasSuf_SHIFT), - SUF_Q = (MOD_GasSufQ >> MOD_GasSuf_SHIFT), - SUF_S = (MOD_GasSufS >> MOD_GasSuf_SHIFT), - WEAK = 0x80 /* Relaxed operand mode for GAS */ -} flags; - /* Static parse data structure for instructions */ typedef struct insnprefix_parse_data { const char *name; @@ -1407,17 +1397,21 @@ typedef struct insnprefix_parse_data { /* instruction parse group - NULL if prefix */ /*@null@*/ const x86_insn_info *group; - /* For instruction, modifier in upper 24 bits, number of elements in group - * in lower 8 bits. - * For prefix, prefix type. + /* For instruction, number of elements in group in lower 8 bits. + * For prefix, prefix type shifted right by 8. */ - unsigned long data1; + unsigned int num_info:8; - /* For instruction, suffix flags. + /* For instruction, GAS suffix flags. * For prefix, prefix value. */ unsigned int flags:8; + /* Instruction modifier data. */ + unsigned int mod_data0:8; + unsigned int mod_data1:8; + unsigned int mod_data2:8; + /* CPU flags */ unsigned int cpu0:8; unsigned int cpu1:8; @@ -1567,7 +1561,9 @@ yasm_x86__parse_check_insnprefix(yasm_arch *arch, const char *id, yasm_insn_initialize(&id_insn->insn); id_insn->group = not64_insn; id_insn->cpu_enabled = cpu_enabled; - id_insn->mod_data = 0; + id_insn->mod_data[0] = 0; + id_insn->mod_data[1] = 0; + id_insn->mod_data[2] = 0; id_insn->num_info = NELEMS(not64_insn); id_insn->mode_bits = arch_x86->mode_bits; id_insn->suffix = 0; @@ -1596,8 +1592,10 @@ yasm_x86__parse_check_insnprefix(yasm_arch *arch, const char *id, yasm_insn_initialize(&id_insn->insn); id_insn->group = pdata->group; id_insn->cpu_enabled = cpu_enabled; - id_insn->mod_data = pdata->data1 >> 8; - id_insn->num_info = pdata->data1 & 0xff; + id_insn->mod_data[0] = pdata->mod_data0; + id_insn->mod_data[1] = pdata->mod_data1; + id_insn->mod_data[2] = pdata->mod_data2; + id_insn->num_info = pdata->num_info; id_insn->mode_bits = arch_x86->mode_bits; id_insn->suffix = pdata->flags; id_insn->parser = arch_x86->parser; @@ -1605,7 +1603,7 @@ yasm_x86__parse_check_insnprefix(yasm_arch *arch, const char *id, *bc = yasm_bc_create_common(&x86_id_insn_callback, id_insn, line); return YASM_ARCH_INSN; } else { - unsigned long type = pdata->data1; + unsigned long type = pdata->num_info<<8; unsigned long value = pdata->flags; if (arch_x86->mode_bits == 64 && type == X86_OPERSIZE && value == 32) { @@ -1656,7 +1654,9 @@ yasm_x86__create_empty_insn(yasm_arch *arch, unsigned long line) yasm_insn_initialize(&id_insn->insn); id_insn->group = empty_insn; id_insn->cpu_enabled = arch_x86->cpu_enables[arch_x86->active_cpu]; - id_insn->mod_data = 0; + id_insn->mod_data[0] = 0; + id_insn->mod_data[1] = 0; + id_insn->mod_data[2] = 0; id_insn->num_info = NELEMS(empty_insn); id_insn->mode_bits = arch_x86->mode_bits; id_insn->suffix = 0; From cbb1bd2771a1a2a2c4bb4af6797fcff50a68b2fe Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 13 Sep 2007 07:26:17 +0000 Subject: [PATCH 084/585] Switch x86 operand storage from manual bitfields to C structure bitfields. svn path=/trunk/yasm/; revision=1950 --- modules/arch/x86/gen_x86_insn.py | 31 +-- modules/arch/x86/x86id.c | 372 +++++++++++++++---------------- 2 files changed, 184 insertions(+), 219 deletions(-) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index b45b04d8..26fbf650 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -100,27 +100,14 @@ class Operand(object): print "Warning: unrecognized arg %s" % arg def __str__(self): - op_str = [] - - op_str.append("OPT_%s" % self.type) - op_str.append("OPS_%s" % self.size) - - if self.relaxed: - op_str.append("OPS_Relaxed") - - if self.tmod is not None: - op_str.append("OPTM_%s" % self.tmod) - - if self.dest == "EA64": - op_str.append("OPEAS_64") - op_str.append("OPA_EA") - else: - op_str.append("OPA_%s" % self.dest) - - if self.opt is not None: - op_str.append("OPAP_%s" % self.opt) - - return '|'.join(op_str) + return "{"+ ", ".join(["OPT_%s" % self.type, + "OPS_%s" % self.size, + "%d" % self.relaxed, + self.dest == "EA64" and "1" or "0", + "OPTM_%s" % self.tmod, + "OPA_%s" % (self.dest == "EA64" + and "EA" or self.dest), + "OPAP_%s" % self.opt]) + "}" def __eq__(self, other): return (self.type == other.type and @@ -508,7 +495,7 @@ def output_groups(f): all_operands.extend(form.operands) # Output operands list - print >>f, "static const unsigned long insn_operands[] = {" + print >>f, "static const x86_info_operand insn_operands[] = {" print >>f, " ", print >>f, ",\n ".join(str(x) for x in all_operands) print >>f, "};\n" diff --git a/modules/arch/x86/x86id.c b/modules/arch/x86/x86id.c index 302ea8fd..fa01e8ca 100644 --- a/modules/arch/x86/x86id.c +++ b/modules/arch/x86/x86id.c @@ -51,7 +51,7 @@ static const char *cpu_find_reverse(unsigned int cpu0, unsigned int cpu1, #define MOD_Op1AddSp 10 /* Parameter is added as "spare" to opcode byte 2 */ /* GAS suffix flags for instructions */ -enum { +enum x86_gas_suffix_flags { NONE = 0, SUF_B = 1<<0, SUF_W = 1<<1, @@ -67,167 +67,147 @@ enum { /* Flags only used in insnprefix_parse_data */ WEAK = 1<<5 /* Relaxed operand mode for GAS */ -} gas_suffix_flags; +}; -/* Operand types. These are more detailed than the "general" types for all - * architectures, as they include the size, for instance. - * Bit Breakdown (from LSB to MSB): - * - 5 bits = general type (must be exact match, except for =3): - * 0 = immediate - * 1 = any general purpose or FPU register - * 2 = memory - * 3 = any general purpose or FPU register OR memory - * 4 = any MMX or XMM register - * 5 = any MMX or XMM register OR memory - * 6 = any segment register - * 7 = any CR register - * 8 = any DR register - * 9 = any TR register - * A = ST0 - * B = AL/AX/EAX/RAX (depending on size) - * C = CL/CX/ECX/RCX (depending on size) - * D = DL/DX/EDX/RDX (depending on size) - * E = CS - * F = DS - * 10 = ES - * 11 = FS - * 12 = GS - * 13 = SS - * 14 = CR4 - * 15 = memory offset (an EA, but with no registers allowed) - * [special case for MOV opcode] - * 16 = immediate, value=1 (for special-case shift) - * 17 = immediate, does not contain SEG:OFF (for jmp/call), - * 18 = XMM0 - * 19 = AX/EAX/RAX memory operand only (EA) - * [special case for SVM opcodes] - * 20 = EAX memory operand only (EA) - * [special case for SVM skinit opcode] - * - 3 bits = size (user-specified, or from register size): - * 0 = any size acceptable/no size spec acceptable (dep. on strict) - * 1/2/3/4 = 8/16/32/64 bits (from user or reg size) - * 5/6 = 80/128 bits (from user) - * 7 = current BITS setting; when this is used the size matched - * gets stored into the opersize as well. - * - 1 bit = size implicit or explicit ("strictness" of size matching on - * non-registers -- registers are always strictly matched): - * 0 = user size must exactly match size above. - * 1 = user size either unspecified or exactly match size above. - * - 3 bits = target modification. - * 0 = no target mod acceptable - * 1 = NEAR - * 2 = SHORT - * 3 = FAR (or SEG:OFF immediate) - * 4 = TO - * - 1 bit = effective address size - * 0 = any address size allowed except for 64-bit - * 1 = only 64-bit address size allowed - * - * MSBs than the above are actions: what to do with the operand if the - * instruction matches. Essentially describes what part of the output bytecode - * gets the operand. This may require conversion (e.g. a register going into - * an ea field). Naturally, only one of each of these may be contained in the - * operands of a single insn_info structure. - * - 4 bits = action: - * 0 = does nothing (operand data is discarded) - * 1 = operand data goes into ea field - * 2 = operand data goes into imm field - * 3 = operand data goes into sign-extended imm field - * 4 = operand data goes into "spare" field - * 5 = operand data is added to opcode byte 0 - * 6 = operand data is added to opcode byte 1 - * 7 = operand data goes into BOTH ea and spare - * [special case for imul opcode] - * 8 = relative jump (outputs a jmp instead of normal insn) - * 9 = operand size goes into address size (jmp only) - * A = far jump (outputs a farjmp instead of normal insn) - * B = ea operand only sets address size (no actual ea field) - * The below describes postponed actions: actions which can't be completed at - * parse-time due to possibly dependent expressions. For these, some - * additional data (stored in the second byte of the opcode with a one-byte - * opcode) is passed to later stages of the assembler with flags set to - * indicate postponed actions. - * - 3 bits = postponed action: - * 0 = none - * 1 = sign-extended imm8 that could expand to a large imm16/32 - * 2 = could become a short opcode mov with bits=64 and a32 prefix - * 3 = forced 16-bit address size (override ignored, no prefix) - * 4 = large imm64 that can become a sign-extended imm32. - */ -#define OPT_Imm 0x0 -#define OPT_Reg 0x1 -#define OPT_Mem 0x2 -#define OPT_RM 0x3 -#define OPT_SIMDReg 0x4 -#define OPT_SIMDRM 0x5 -#define OPT_SegReg 0x6 -#define OPT_CRReg 0x7 -#define OPT_DRReg 0x8 -#define OPT_TRReg 0x9 -#define OPT_ST0 0xA -#define OPT_Areg 0xB -#define OPT_Creg 0xC -#define OPT_Dreg 0xD -#define OPT_CS 0xE -#define OPT_DS 0xF -#define OPT_ES 0x10 -#define OPT_FS 0x11 -#define OPT_GS 0x12 -#define OPT_SS 0x13 -#define OPT_CR4 0x14 -#define OPT_MemOffs 0x15 -#define OPT_Imm1 0x16 -#define OPT_ImmNotSegOff 0x17 -#define OPT_XMM0 0x18 -#define OPT_MemrAX 0x19 -#define OPT_MemEAX 0x1A -#define OPT_MASK 0x1F +enum x86_operand_type { + OPT_Imm = 0, /* immediate */ + OPT_Reg = 1, /* any general purpose or FPU register */ + OPT_Mem = 2, /* memory */ + OPT_RM = 3, /* any general purpose or FPU register OR memory */ + OPT_SIMDReg = 4, /* any MMX or XMM register */ + OPT_SIMDRM = 5, /* any MMX or XMM register OR memory */ + OPT_SegReg = 6, /* any segment register */ + OPT_CRReg = 7, /* any CR register */ + OPT_DRReg = 8, /* any DR register */ + OPT_TRReg = 9, /* any TR register */ + OPT_ST0 = 10, /* ST0 */ + OPT_Areg = 11, /* AL/AX/EAX/RAX (depending on size) */ + OPT_Creg = 12, /* CL/CX/ECX/RCX (depending on size) */ + OPT_Dreg = 13, /* DL/DX/EDX/RDX (depending on size) */ + OPT_CS = 14, /* CS */ + OPT_DS = 15, /* DS */ + OPT_ES = 16, /* ES */ + OPT_FS = 17, /* FS */ + OPT_GS = 18, /* GS */ + OPT_SS = 19, /* SS */ + OPT_CR4 = 20, /* CR4 */ + /* memory offset (an EA, but with no registers allowed) + * [special case for MOV opcode] + */ + OPT_MemOffs = 21, + OPT_Imm1 = 22, /* immediate, value=1 (for special-case shift) */ + /* immediate, does not contain SEG:OFF (for jmp/call) */ + OPT_ImmNotSegOff = 23, + OPT_XMM0 = 24, /* XMM0 */ + /* AX/EAX/RAX memory operand only (EA) [special case for SVM opcodes] + */ + OPT_MemrAX = 25, + /* EAX memory operand only (EA) [special case for SVM skinit opcode] */ + OPT_MemEAX = 26 +}; -#define OPS_Any (0UL<<5) -#define OPS_8 (1UL<<5) -#define OPS_16 (2UL<<5) -#define OPS_32 (3UL<<5) -#define OPS_64 (4UL<<5) -#define OPS_80 (5UL<<5) -#define OPS_128 (6UL<<5) -#define OPS_BITS (7UL<<5) -#define OPS_MASK (7UL<<5) -#define OPS_SHIFT 5 +enum x86_operand_size { + /* any size acceptable/no size spec acceptable (dep. on strict) */ + OPS_Any = 0, + /* 8/16/32/64 bits (from user or reg size) */ + OPS_8 = 1, + OPS_16 = 2, + OPS_32 = 3, + OPS_64 = 4, + /* 80/128 bits (from user) */ + OPS_80 = 5, + OPS_128 = 6, + /* current BITS setting; when this is used the size matched + * gets stored into the opersize as well. + */ + OPS_BITS = 7 +}; -#define OPS_Relaxed (1UL<<8) -#define OPS_RMASK (1UL<<8) +enum x86_operand_targetmod { + OPTM_None = 0, /* no target mod acceptable */ + OPTM_Near = 1, /* NEAR */ + OPTM_Short = 2, /* SHORT */ + OPTM_Far = 3, /* FAR (or SEG:OFF immediate) */ + OPTM_To = 4 /* TO */ +}; -#define OPEAS_Not64 (0UL<<9) -#define OPEAS_64 (1UL<<9) -#define OPEAS_MASK (1UL<<9) +enum x86_operand_action { + OPA_None = 0, /* does nothing (operand data is discarded) */ + OPA_EA = 1, /* operand data goes into ea field */ + OPA_Imm = 2, /* operand data goes into imm field */ + OPA_SImm = 3, /* operand data goes into sign-extended imm field */ + OPA_Spare = 4, /* operand data goes into "spare" field */ + OPA_Op0Add = 5, /* operand data is added to opcode byte 0 */ + OPA_Op1Add = 6, /* operand data is added to opcode byte 1 */ + /* operand data goes into BOTH ea and spare + * (special case for imul opcode) + */ + OPA_SpareEA = 7, + /* relative jump (outputs a jmp instead of normal insn) */ + OPA_JmpRel = 8, + /* operand size goes into address size (jmp only) */ + OPA_AdSizeR = 9, + /* far jump (outputs a farjmp instead of normal insn) */ + OPA_JmpFar = 10, + /* ea operand only sets address size (no actual ea field) */ + OPA_AdSizeEA = 11 +}; -#define OPTM_None (0UL<<10) -#define OPTM_Near (1UL<<10) -#define OPTM_Short (2UL<<10) -#define OPTM_Far (3UL<<10) -#define OPTM_To (4UL<<10) -#define OPTM_MASK (7UL<<10) +enum x86_operand_post_action { + OPAP_None = 0, + /* sign-extended imm8 that could expand to a large imm16/32 */ + OPAP_SImm8 = 1, + /* could become a short opcode mov with bits=64 and a32 prefix */ + OPAP_ShortMov = 2, + /* forced 16-bit address size (override ignored, no prefix) */ + OPAP_A16 = 3, + /* large imm64 that can become a sign-extended imm32 */ + OPAP_SImm32Avail = 4 +}; -#define OPA_None (0UL<<13) -#define OPA_EA (1UL<<13) -#define OPA_Imm (2UL<<13) -#define OPA_SImm (3UL<<13) -#define OPA_Spare (4UL<<13) -#define OPA_Op0Add (5UL<<13) -#define OPA_Op1Add (6UL<<13) -#define OPA_SpareEA (7UL<<13) -#define OPA_JmpRel (8UL<<13) -#define OPA_AdSizeR (9UL<<13) -#define OPA_JmpFar (0xAUL<<13) -#define OPA_AdSizeEA (0xBUL<<13) -#define OPA_MASK (0xFUL<<13) +typedef struct x86_info_operand { + /* Operand types. These are more detailed than the "general" types for all + * architectures, as they include the size, for instance. + */ -#define OPAP_None (0UL<<17) -#define OPAP_SImm8 (1UL<<17) -#define OPAP_ShortMov (2UL<<17) -#define OPAP_A16 (3UL<<17) -#define OPAP_SImm32Avail (4UL<<17) -#define OPAP_MASK (7UL<<17) + /* general type (must be exact match, except for RM types): */ + unsigned int type:5; + + /* size (user-specified, or from register size) */ + unsigned int size:3; + + /* size implicit or explicit ("strictness" of size matching on + * non-registers -- registers are always strictly matched): + * 0 = user size must exactly match size above. + * 1 = user size either unspecified or exactly match size above. + */ + unsigned int relaxed:1; + + /* effective address size + * 0 = any address size allowed except for 64-bit + * 1 = only 64-bit address size allowed + */ + unsigned int eas64:1; + + /* target modification */ + unsigned int targetmod:3; + + /* Actions: what to do with the operand if the instruction matches. + * Essentially describes what part of the output bytecode gets the + * operand. This may require conversion (e.g. a register going into + * an ea field). Naturally, only one of each of these may be contained + * in the operands of a single insn_info structure. + */ + unsigned int action:4; + + /* Postponed actions: actions which can't be completed at + * parse-time due to possibly dependent expressions. For these, some + * additional data (stored in the second byte of the opcode with a + * one-byte opcode) is passed to later stages of the assembler with + * flags set to indicate postponed actions. + */ + unsigned int post_action:3; +} x86_info_operand; typedef struct x86_insn_info { /* GAS suffix flags */ @@ -441,7 +421,7 @@ x86_finalize_jmp(yasm_bytecode *bc, yasm_bytecode *prev_bc, jmp->target.jump_target = 1; /* See if the user explicitly specified short/near/far. */ - switch ((int)(insn_operands[jinfo->operands_index+0] & OPTM_MASK)) { + switch (insn_operands[jinfo->operands_index+0].targetmod) { case OPTM_Short: jmp->op_sel = JMP_SHORT_FORCED; break; @@ -454,10 +434,9 @@ x86_finalize_jmp(yasm_bytecode *bc, yasm_bytecode *prev_bc, /* Check for address size setting in second operand, if present */ if (jinfo->num_operands > 1 && - (insn_operands[jinfo->operands_index+1] & OPA_MASK) == OPA_AdSizeR) + insn_operands[jinfo->operands_index+1].action == OPA_AdSizeR) jmp->common.addrsize = (unsigned char) - size_lookup[(insn_operands[jinfo->operands_index+1] - & OPS_MASK)>>OPS_SHIFT]; + size_lookup[insn_operands[jinfo->operands_index+1].size]; /* Check for address size override */ for (i=0; imodifiers); i++) { @@ -498,13 +477,13 @@ x86_finalize_jmp(yasm_bytecode *bc, yasm_bytecode *prev_bc, if (info->num_operands == 0) continue; - if ((insn_operands[info->operands_index+0] & OPA_MASK) != OPA_JmpRel) + if (insn_operands[info->operands_index+0].action != OPA_JmpRel) continue; if (info->opersize != jmp->common.opersize) continue; - switch ((int)(insn_operands[info->operands_index+0] & OPTM_MASK)) { + switch (insn_operands[info->operands_index+0].targetmod) { case OPTM_Short: x86_finalize_opcode(&jmp->shortop, info); for (i=0; imodifiers); i++) { @@ -562,7 +541,8 @@ x86_find_match(x86_id_insn *id_insn, yasm_insn_operand **ops, */ for (; num_info>0 && !found; num_info--, info++) { yasm_insn_operand *op, **use_ops; - const unsigned long *info_ops = &insn_operands[info->operands_index]; + const x86_info_operand *info_ops = + &insn_operands[info->operands_index]; unsigned int cpu0 = info->cpu0; unsigned int cpu1 = info->cpu1; unsigned int cpu2 = info->cpu2; @@ -619,7 +599,7 @@ x86_find_match(x86_id_insn *id_insn, yasm_insn_operand **ops, for (i = 0, op = use_ops[0]; op && inum_operands && !mismatch; op = use_ops[++i]) { /* Check operand type */ - switch ((int)(info_ops[i] & OPT_MASK)) { + switch (info_ops[i].type) { case OPT_Imm: if (op->type != YASM_INSN__OPERAND_IMM) mismatch = 1; @@ -694,40 +674,40 @@ x86_find_match(x86_id_insn *id_insn, yasm_insn_operand **ops, break; case OPT_Areg: if (op->type != YASM_INSN__OPERAND_REG || - ((info_ops[i] & OPS_MASK) == OPS_8 && + (info_ops[i].size == OPS_8 && op->data.reg != (X86_REG8 | 0) && op->data.reg != (X86_REG8X | 0)) || - ((info_ops[i] & OPS_MASK) == OPS_16 && + (info_ops[i].size == OPS_16 && op->data.reg != (X86_REG16 | 0)) || - ((info_ops[i] & OPS_MASK) == OPS_32 && + (info_ops[i].size == OPS_32 && op->data.reg != (X86_REG32 | 0)) || - ((info_ops[i] & OPS_MASK) == OPS_64 && + (info_ops[i].size == OPS_64 && op->data.reg != (X86_REG64 | 0))) mismatch = 1; break; case OPT_Creg: if (op->type != YASM_INSN__OPERAND_REG || - ((info_ops[i] & OPS_MASK) == OPS_8 && + (info_ops[i].size == OPS_8 && op->data.reg != (X86_REG8 | 1) && op->data.reg != (X86_REG8X | 1)) || - ((info_ops[i] & OPS_MASK) == OPS_16 && + (info_ops[i].size == OPS_16 && op->data.reg != (X86_REG16 | 1)) || - ((info_ops[i] & OPS_MASK) == OPS_32 && + (info_ops[i].size == OPS_32 && op->data.reg != (X86_REG32 | 1)) || - ((info_ops[i] & OPS_MASK) == OPS_64 && + (info_ops[i].size == OPS_64 && op->data.reg != (X86_REG64 | 1))) mismatch = 1; break; case OPT_Dreg: if (op->type != YASM_INSN__OPERAND_REG || - ((info_ops[i] & OPS_MASK) == OPS_8 && + (info_ops[i].size == OPS_8 && op->data.reg != (X86_REG8 | 2) && op->data.reg != (X86_REG8X | 2)) || - ((info_ops[i] & OPS_MASK) == OPS_16 && + (info_ops[i].size == OPS_16 && op->data.reg != (X86_REG16 | 2)) || - ((info_ops[i] & OPS_MASK) == OPS_32 && + (info_ops[i].size == OPS_32 && op->data.reg != (X86_REG32 | 2)) || - ((info_ops[i] & OPS_MASK) == OPS_64 && + (info_ops[i].size == OPS_64 && op->data.reg != (X86_REG64 | 2))) mismatch = 1; break; @@ -818,7 +798,7 @@ x86_find_match(x86_id_insn *id_insn, yasm_insn_operand **ops, break; /* Check operand size */ - size = size_lookup[(info_ops[i] & OPS_MASK)>>OPS_SHIFT]; + size = size_lookup[info_ops[i].size]; if (suffix != 0) { /* Require relaxed operands for GAS mode (don't allow * per-operand sizing). @@ -827,11 +807,11 @@ x86_find_match(x86_id_insn *id_insn, yasm_insn_operand **ops, /* Register size must exactly match */ if (yasm_x86__get_reg_size(op->data.reg) != size) mismatch = 1; - } else if (((info_ops[i] & OPT_MASK) == OPT_Imm - || (info_ops[i] & OPT_MASK) == OPT_ImmNotSegOff - || (info_ops[i] & OPT_MASK) == OPT_Imm1) - && (info_ops[i] & OPS_RMASK) != OPS_Relaxed - && (info_ops[i] & OPA_MASK) != OPA_JmpRel) + } else if ((info_ops[i].type == OPT_Imm + || info_ops[i].type == OPT_ImmNotSegOff + || info_ops[i].type == OPT_Imm1) + && !info_ops[i].relaxed + && info_ops[i].action != OPA_JmpRel) mismatch = 1; } else { if (op->type == YASM_INSN__OPERAND_REG && op->size == 0) { @@ -845,7 +825,7 @@ x86_find_match(x86_id_insn *id_insn, yasm_insn_operand **ops, if ((bypass == 1 && i == 0) || (bypass == 2 && i == 1) || (bypass == 3 && i == 3)) ; - else if ((info_ops[i] & OPS_RMASK) == OPS_Relaxed) { + else if (info_ops[i].relaxed) { /* Relaxed checking */ if (size != 0 && op->size != size && op->size != 0) mismatch = 1; @@ -862,7 +842,7 @@ x86_find_match(x86_id_insn *id_insn, yasm_insn_operand **ops, /* Check for 64-bit effective address size in NASM mode */ if (suffix == 0 && op->type == YASM_INSN__OPERAND_MEMORY) { - if ((info_ops[i] & OPEAS_MASK) == OPEAS_64) { + if (info_ops[i].eas64) { if (op->data.ea->disp.size != 64) mismatch = 1; } else if (op->data.ea->disp.size == 64) @@ -873,7 +853,7 @@ x86_find_match(x86_id_insn *id_insn, yasm_insn_operand **ops, break; /* Check target modifier */ - switch ((int)(info_ops[i] & OPTM_MASK)) { + switch (info_ops[i].targetmod) { case OPTM_None: if (op->targetmod != 0) mismatch = 1; @@ -1018,7 +998,7 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) * operands and adjust for dereferences / lack thereof. */ if (id_insn->parser == X86_PARSER_GAS - && (insn_operands[info->operands_index+0] & OPA_MASK) == OPA_JmpRel) { + && insn_operands[info->operands_index+0].action == OPA_JmpRel) { for (i = 0, op = ops[0]; op; op = ops[++i]) { if (!op->deref && (op->type == YASM_INSN__OPERAND_REG || (op->type == YASM_INSN__OPERAND_MEMORY @@ -1051,7 +1031,7 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) } if (id_insn->insn.num_operands > 0) { - switch (insn_operands[info->operands_index+0] & OPA_MASK) { + switch (insn_operands[info->operands_index+0].action) { case OPA_JmpRel: /* Shortcut to JmpRel */ x86_finalize_jmp(bc, prev_bc, info); @@ -1126,7 +1106,8 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) /* Go through operands and assign */ if (id_insn->insn.num_operands > 0) { yasm_insn_operand **use_ops = ops; - const unsigned long *info_ops = &insn_operands[info->operands_index]; + const x86_info_operand *info_ops = + &insn_operands[info->operands_index]; /* Use reversed operands in GAS mode if not otherwise specified */ if (id_insn->parser == X86_PARSER_GAS @@ -1135,7 +1116,7 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) for (i = 0, op = use_ops[0]; op && inum_operands; op = use_ops[++i]) { - switch ((int)(info_ops[i] & OPA_MASK)) { + switch (info_ops[i].action) { case OPA_None: /* Throw away the operand contents */ switch (op->type) { @@ -1163,7 +1144,7 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) N_("invalid operand conversion")); case YASM_INSN__OPERAND_MEMORY: insn->x86_ea = (x86_effaddr *)op->data.ea; - if ((info_ops[i] & OPT_MASK) == OPT_MemOffs) + if (info_ops[i].type == OPT_MemOffs) /* Special-case for MOV MemOffs instruction */ yasm_x86__ea_set_disponly(insn->x86_ea); break; @@ -1171,24 +1152,21 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) insn->x86_ea = yasm_x86__ea_create_imm(insn->x86_ea, op->data.val, - size_lookup[(info_ops[i] & - OPS_MASK)>>OPS_SHIFT]); + size_lookup[info_ops[i].size]); break; } break; case OPA_Imm: if (op->type == YASM_INSN__OPERAND_IMM) { imm = op->data.val; - im_len = size_lookup[(info_ops[i] & - OPS_MASK)>>OPS_SHIFT]; + im_len = size_lookup[info_ops[i].size]; } else yasm_internal_error(N_("invalid operand conversion")); break; case OPA_SImm: if (op->type == YASM_INSN__OPERAND_IMM) { imm = op->data.val; - im_len = size_lookup[(info_ops[i] & - OPS_MASK)>>OPS_SHIFT]; + im_len = size_lookup[info_ops[i].size]; im_sign = 1; } else yasm_internal_error(N_("invalid operand conversion")); @@ -1268,10 +1246,10 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) yasm_internal_error(N_("unknown operand action")); } - if ((info_ops[i] & OPS_MASK) == OPS_BITS) + if (info_ops[i].size == OPS_BITS) insn->common.opersize = (unsigned char)mode_bits; - switch ((int)(info_ops[i] & OPAP_MASK)) { + switch (info_ops[i].post_action) { case OPAP_None: break; case OPAP_SImm8: From e774242fd1f86217192432df78f7ffc46fb792e2 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 14 Sep 2007 05:19:10 +0000 Subject: [PATCH 085/585] Finish cleanup made in [1948]. svn path=/trunk/yasm/; revision=1951 --- tools/python-yasm/tests/Makefile.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/python-yasm/tests/Makefile.inc b/tools/python-yasm/tests/Makefile.inc index 6bf72fdb..50c499d8 100644 --- a/tools/python-yasm/tests/Makefile.inc +++ b/tools/python-yasm/tests/Makefile.inc @@ -7,7 +7,7 @@ EXTRA_DIST += tools/python-yasm/tests/test_expr.py EXTRA_DIST += tools/python-yasm/tests/test_intnum.py EXTRA_DIST += tools/python-yasm/tests/test_symrec.py -if HAVE_PYTHON +if HAVE_PYTHON_BINDINGS TESTS_ENVIRONMENT += PYTHON=${PYTHON} TESTS += tools/python-yasm/tests/python_test.sh From 39913f32de3b9b7afe06cdf560ce42d1cc49be53 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 15 Sep 2007 06:40:27 +0000 Subject: [PATCH 086/585] 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 --- modules/objfmts/elf/elf-machine.h | 5 +++++ modules/objfmts/elf/elf-objfmt.c | 2 ++ modules/objfmts/elf/elf-x86-amd64.c | 4 ++-- modules/objfmts/elf/elf-x86-x86.c | 4 ++-- modules/objfmts/elf/elf.c | 16 +++++++++++++++- modules/objfmts/elf/elf.h | 1 + modules/objfmts/elf/tests/elfso.hex | 8 ++++---- 7 files changed, 31 insertions(+), 9 deletions(-) diff --git a/modules/objfmts/elf/elf-machine.h b/modules/objfmts/elf/elf-machine.h index 562e098c..f2bb8db7 100644 --- a/modules/objfmts/elf/elf-machine.h +++ b/modules/objfmts/elf/elf-machine.h @@ -69,6 +69,11 @@ typedef void (*func_write_proghead)(unsigned char **bufpp, unsigned long secthead_count, elf_section_index shstrtab_index); +enum { + ELF_SSYM_SYM_RELATIVE = 1 << 0, + ELF_SSYM_CURPOS_ADJUST = 1 << 1 +}; + typedef struct { const char *name; /* should be something like ..name */ const int sym_rel; /* symbol or section-relative? */ diff --git a/modules/objfmts/elf/elf-objfmt.c b/modules/objfmts/elf/elf-objfmt.c index 664d1351..5ec17b7c 100644 --- a/modules/objfmts/elf/elf-objfmt.c +++ b/modules/objfmts/elf/elf-objfmt.c @@ -514,6 +514,8 @@ elf_objfmt_output_value(yasm_value *value, unsigned char *buf, wrt = NULL; else if (wrt && elf_is_wrt_sym_relative(wrt)) ; + else if (wrt && elf_is_wrt_pos_adjusted(wrt)) + intn_val = offset + bc->offset; else if (vis == YASM_SYM_LOCAL) { yasm_bytecode *sym_precbc; /* Local symbols need relocation to their section's start, and diff --git a/modules/objfmts/elf/elf-x86-amd64.c b/modules/objfmts/elf/elf-x86-amd64.c index ce0cdda1..4bc53b21 100644 --- a/modules/objfmts/elf/elf-x86-amd64.c +++ b/modules/objfmts/elf/elf-x86-amd64.c @@ -209,8 +209,8 @@ elf_x86_amd64_write_proghead(unsigned char **bufpp, } static elf_machine_ssym elf_x86_amd64_ssyms[] = { - {"..gotpcrel", 1}, - {"..got", 1}, + {"..gotpcrel", ELF_SSYM_SYM_RELATIVE}, + {"..got", ELF_SSYM_SYM_RELATIVE}, {"..plt", 0} }; diff --git a/modules/objfmts/elf/elf-x86-x86.c b/modules/objfmts/elf/elf-x86-x86.c index 827c861e..67a23d0a 100644 --- a/modules/objfmts/elf/elf-x86-x86.c +++ b/modules/objfmts/elf/elf-x86-x86.c @@ -194,9 +194,9 @@ elf_x86_x86_write_proghead(unsigned char **bufpp, } static elf_machine_ssym elf_x86_x86_ssyms[] = { - {"..gotpc", 0}, + {"..gotpc", ELF_SSYM_CURPOS_ADJUST}, {"..gotoff", 0}, - {"..got", 1}, + {"..got", ELF_SSYM_SYM_RELATIVE}, {"..plt", 0} }; diff --git a/modules/objfmts/elf/elf.c b/modules/objfmts/elf/elf.c index f187b9e7..87ee9828 100644 --- a/modules/objfmts/elf/elf.c +++ b/modules/objfmts/elf/elf.c @@ -99,13 +99,27 @@ elf_set_arch(yasm_arch *arch, yasm_symtab *symtab, int bits_pref) } /* reloc functions */ +int elf_ssym_has_flag(yasm_symrec *wrt, int flag); + int elf_is_wrt_sym_relative(yasm_symrec *wrt) +{ + return elf_ssym_has_flag(wrt, ELF_SSYM_SYM_RELATIVE); +} + +int +elf_is_wrt_pos_adjusted(yasm_symrec *wrt) +{ + return elf_ssym_has_flag(wrt, ELF_SSYM_CURPOS_ADJUST); +} + +int +elf_ssym_has_flag(yasm_symrec *wrt, int flag) { int i; for (i=0; (unsigned int)inum_ssyms; i++) { if (elf_ssyms[i] == wrt) - return elf_march->ssyms[i].sym_rel; + return (elf_march->ssyms[i].sym_rel & flag) != 0; } return 0; } diff --git a/modules/objfmts/elf/elf.h b/modules/objfmts/elf/elf.h index b876a75e..954e052e 100644 --- a/modules/objfmts/elf/elf.h +++ b/modules/objfmts/elf/elf.h @@ -412,6 +412,7 @@ const elf_machine_handler *elf_set_arch(struct yasm_arch *arch, /* reloc functions */ int elf_is_wrt_sym_relative(yasm_symrec *wrt); +int elf_is_wrt_pos_adjusted(yasm_symrec *wrt); elf_reloc_entry *elf_reloc_entry_create(yasm_symrec *sym, /*@null@*/ yasm_symrec *wrt, yasm_intnum *addr, diff --git a/modules/objfmts/elf/tests/elfso.hex b/modules/objfmts/elf/tests/elfso.hex index 9d99c0f8..206cce9c 100644 --- a/modules/objfmts/elf/tests/elfso.hex +++ b/modules/objfmts/elf/tests/elfso.hex @@ -88,10 +88,10 @@ e8 5b 81 c3 -e9 -ff -ff -ff +03 +00 +00 +00 8b 83 00 From a1137cdf678f449d13969235fa611bc871a8589c Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 16 Sep 2007 20:29:59 +0000 Subject: [PATCH 087/585] Add SSE5 (new AMD SSE) instructions support. svn path=/trunk/yasm/; revision=1953 --- modules/arch/x86/gen_x86_insn.py | 427 +++- modules/arch/x86/tests/Makefile.inc | 6 + modules/arch/x86/tests/sse5-all.asm | 509 +++++ modules/arch/x86/tests/sse5-all.hex | 2727 +++++++++++++++++++++++ modules/arch/x86/tests/sse5-basic.asm | 12 + modules/arch/x86/tests/sse5-basic.hex | 59 + modules/arch/x86/tests/sse5-err.asm | 116 + modules/arch/x86/tests/sse5-err.errwarn | 84 + modules/arch/x86/x86arch.h | 14 +- modules/arch/x86/x86bc.c | 40 +- modules/arch/x86/x86cpu.gperf | 6 + modules/arch/x86/x86expr.c | 7 +- modules/arch/x86/x86id.c | 64 +- 13 files changed, 3987 insertions(+), 84 deletions(-) create mode 100644 modules/arch/x86/tests/sse5-all.asm create mode 100644 modules/arch/x86/tests/sse5-all.hex create mode 100644 modules/arch/x86/tests/sse5-basic.asm create mode 100644 modules/arch/x86/tests/sse5-basic.hex create mode 100644 modules/arch/x86/tests/sse5-err.asm create mode 100644 modules/arch/x86/tests/sse5-err.errwarn diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index 26fbf650..e891634e 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -32,7 +32,7 @@ ordered_cpus = [ "P4", "IA64", "Hammer"] ordered_cpu_features = [ "FPU", "Cyrix", "AMD", "MMX", "3DNow", "SMM", "SSE", "SSE2", - "SSE3", "SVM", "PadLock", "SSSE3", "SSE41", "SSE42", "SSE4a"] + "SSE3", "SVM", "PadLock", "SSSE3", "SSE41", "SSE42", "SSE4a", "SSE5"] unordered_cpu_features = ["Priv", "Prot", "Undoc", "Obs"] def cpu_lcd(cpu1, cpu2): @@ -182,6 +182,9 @@ class GroupForm(object): else: raise KeyError("missing opcode") + # DREX opcode0 field + self.drex_oc0 = kwargs.pop("drex_oc0", 0) and 0x08 or 0 + # Build operands string (C array initializer) self.operands = kwargs.pop("operands") for op in self.operands: @@ -201,6 +204,8 @@ class GroupForm(object): self.cpu.add("586") if op.dest == "EA64": self.cpu.add("64") + if op.dest == "DREX": + self.drex_oc0 |= 0x80 # Modifiers self.modifiers = kwargs.pop("modifiers", []) @@ -280,6 +285,8 @@ class GroupForm(object): "%d" % (self.opersize or 0), "%d" % (self.def_opersize_64 or 0), self.special_prefix or "0", + self.drex_oc0 and + ("0x%02X" % self.drex_oc0) or "0", "%d" % self.opcode_len, opcodes_str, "%d" % (self.spare or 0), @@ -4650,6 +4657,23 @@ add_group("sse4imm", operands=[Operand(type="SIMDReg", size=128, dest="Spare"), Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +for sz in [32, 64]: + add_group("sse4m%dimm" % sz, + cpu=["SSE41"], + modifiers=["Op2Add"], + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + add_group("sse4m%dimm" % sz, + cpu=["SSE41"], + modifiers=["Op2Add"], + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Mem", size=sz, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) add_insn("blendpd", "sse4imm", modifiers=[0x0D]) add_insn("blendps", "sse4imm", modifiers=[0x0C]) @@ -4659,8 +4683,8 @@ add_insn("mpsadbw", "sse4imm", modifiers=[0x42]) add_insn("pblendw", "sse4imm", modifiers=[0x0E]) add_insn("roundpd", "sse4imm", modifiers=[0x09]) add_insn("roundps", "sse4imm", modifiers=[0x08]) -add_insn("roundsd", "sse4imm", modifiers=[0x0B]) -add_insn("roundss", "sse4imm", modifiers=[0x0A]) +add_insn("roundsd", "sse4m64imm", modifiers=[0x0B]) +add_insn("roundss", "sse4m32imm", modifiers=[0x0A]) add_group("sse4xmm0", cpu=["SSE41"], @@ -4843,20 +4867,21 @@ add_group("pinsrq", add_insn("pinsrq", "pinsrq") -add_group("sse4m64", - cpu=["SSE41"], - modifiers=["Op2Add"], - prefix=0x66, - opcode=[0x0F, 0x38, 0x00], - operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="Mem", size=64, relaxed=True, dest="EA")]) -add_group("sse4m64", - cpu=["SSE41"], - modifiers=["Op2Add"], - prefix=0x66, - opcode=[0x0F, 0x38, 0x00], - operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDReg", size=128, dest="EA")]) +for sz in [16, 32, 64]: + add_group("sse4m%d" % sz, + cpu=["SSE41"], + modifiers=["Op2Add"], + prefix=0x66, + opcode=[0x0F, 0x38, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Mem", size=sz, relaxed=True, dest="EA")]) + add_group("sse4m%d" % sz, + cpu=["SSE41"], + modifiers=["Op2Add"], + prefix=0x66, + opcode=[0x0F, 0x38, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA")]) add_insn("pmovsxbw", "sse4m64", modifiers=[0x20]) add_insn("pmovsxwd", "sse4m64", modifiers=[0x23]) @@ -4865,41 +4890,11 @@ add_insn("pmovzxbw", "sse4m64", modifiers=[0x30]) add_insn("pmovzxwd", "sse4m64", modifiers=[0x33]) add_insn("pmovzxdq", "sse4m64", modifiers=[0x35]) -add_group("sse4m32", - cpu=["SSE41"], - modifiers=["Op2Add"], - prefix=0x66, - opcode=[0x0F, 0x38, 0x00], - operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="Mem", size=32, relaxed=True, dest="EA")]) -add_group("sse4m32", - cpu=["SSE41"], - modifiers=["Op2Add"], - prefix=0x66, - opcode=[0x0F, 0x38, 0x00], - operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDReg", size=128, dest="EA")]) - add_insn("pmovsxbd", "sse4m32", modifiers=[0x21]) add_insn("pmovsxwq", "sse4m32", modifiers=[0x24]) add_insn("pmovzxbd", "sse4m32", modifiers=[0x31]) add_insn("pmovzxwq", "sse4m32", modifiers=[0x34]) -add_group("sse4m16", - cpu=["SSE41"], - modifiers=["Op2Add"], - prefix=0x66, - opcode=[0x0F, 0x38, 0x00], - operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="Mem", size=16, relaxed=True, dest="EA")]) -add_group("sse4m16", - cpu=["SSE41"], - modifiers=["Op2Add"], - prefix=0x66, - opcode=[0x0F, 0x38, 0x00], - operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDReg", size=128, dest="EA")]) - add_insn("pmovsxbq", "sse4m16", modifiers=[0x22]) add_insn("pmovzxbq", "sse4m16", modifiers=[0x32]) @@ -4970,6 +4965,344 @@ add_group("movntss", add_insn("movntss", "movntss") +##################################################################### +# AMD SSE5 instructions +##################################################################### + +add_group("sse5com", + cpu=["SSE5"], + modifiers=["Op2Add"], + opcode=[0x0F, 0x25, 0x00], + drex_oc0=0, + operands=[Operand(type="SIMDReg", size=128, dest="DREX"), + Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + +for sz in [32, 64]: + add_group("sse5com%d" % sz, + cpu=["SSE5"], + modifiers=["Op2Add"], + opcode=[0x0F, 0x25, 0x00], + drex_oc0=0, + operands=[Operand(type="SIMDReg", size=128, dest="DREX"), + Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + add_group("sse5com%d" % sz, + cpu=["SSE5"], + modifiers=["Op2Add"], + opcode=[0x0F, 0x25, 0x00], + drex_oc0=0, + operands=[Operand(type="SIMDReg", size=128, dest="DREX"), + Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Mem", size=sz, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + +add_insn("comps", "sse5com", modifiers=[0x2C]) +add_insn("compd", "sse5com", modifiers=[0x2D]) +add_insn("comss", "sse5com32", modifiers=[0x2E]) +add_insn("comsd", "sse5com64", modifiers=[0x2F]) + +add_insn("pcomb", "sse5com", modifiers=[0x4C]) +add_insn("pcomw", "sse5com", modifiers=[0x4D]) +add_insn("pcomd", "sse5com", modifiers=[0x4E]) +add_insn("pcomq", "sse5com", modifiers=[0x4F]) + +add_insn("pcomub", "sse5com", modifiers=[0x6C]) +add_insn("pcomuw", "sse5com", modifiers=[0x6D]) +add_insn("pcomud", "sse5com", modifiers=[0x6E]) +add_insn("pcomuq", "sse5com", modifiers=[0x6F]) + +add_group("cvtph2ps", + cpu=["SSE5"], + opcode=[0x0F, 0x7A, 0x30], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA")]) +add_group("cvtph2ps", + cpu=["SSE5"], + opcode=[0x0F, 0x7A, 0x30], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Mem", size=64, relaxed=True, dest="EA")]) + +add_insn("cvtph2ps", "cvtph2ps") + +add_group("cvtps2ph", + cpu=["SSE5"], + opcode=[0x0F, 0x7A, 0x31], + operands=[Operand(type="SIMDReg", size=128, dest="EA"), + Operand(type="SIMDReg", size=128, dest="Spare")]) +add_group("cvtps2ph", + cpu=["SSE5"], + opcode=[0x0F, 0x7A, 0x31], + operands=[Operand(type="Mem", size=64, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="Spare")]) + +add_insn("cvtps2ph", "cvtps2ph") + +add_group("sse5arith", + cpu=["SSE5"], + modifiers=["Op2Add"], + opcode=[0x0F, 0x24, 0x00], + drex_oc0=0, + operands=[Operand(type="SIMDReg", size=128, dest="DREX"), + Operand(type="SIMDRegMatch0", size=128, dest=None), + Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) +add_group("sse5arith", + cpu=["SSE5"], + modifiers=["Op2Add"], + opcode=[0x0F, 0x24, 0x00], + drex_oc0=1, + operands=[Operand(type="SIMDReg", size=128, dest="DREX"), + Operand(type="SIMDRegMatch0", size=128, dest=None), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="Spare")]) +add_group("sse5arith", + cpu=["SSE5"], + modifiers=["Op2Add"], + opcode=[0x0F, 0x24, 0x04], + drex_oc0=0, + operands=[Operand(type="SIMDReg", size=128, dest="DREX"), + Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="SIMDRegMatch0", size=128, dest=None)]) +add_group("sse5arith", + cpu=["SSE5"], + modifiers=["Op2Add"], + opcode=[0x0F, 0x24, 0x04], + drex_oc0=1, + operands=[Operand(type="SIMDReg", size=128, dest="DREX"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRegMatch0", size=128, dest=None)]) + +for sz in [32, 64]: + add_group("sse5arith%d" % sz, + cpu=["SSE5"], + modifiers=["Op2Add"], + opcode=[0x0F, 0x24, 0x00], + drex_oc0=0, + operands=[Operand(type="SIMDReg", size=128, dest="DREX"), + Operand(type="SIMDRegMatch0", size=128, dest=None), + Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA")]) + add_group("sse5arith%d" % sz, + cpu=["SSE5"], + modifiers=["Op2Add"], + opcode=[0x0F, 0x24, 0x00], + drex_oc0=0, + operands=[Operand(type="SIMDReg", size=128, dest="DREX"), + Operand(type="SIMDRegMatch0", size=128, dest=None), + Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Mem", size=sz, relaxed=True, dest="EA")]) + add_group("sse5arith%d" % sz, + cpu=["SSE5"], + modifiers=["Op2Add"], + opcode=[0x0F, 0x24, 0x00], + drex_oc0=1, + operands=[Operand(type="SIMDReg", size=128, dest="DREX"), + Operand(type="SIMDRegMatch0", size=128, dest=None), + Operand(type="SIMDReg", size=128, dest="EA"), + Operand(type="SIMDReg", size=128, dest="Spare")]) + add_group("sse5arith%d" % sz, + cpu=["SSE5"], + modifiers=["Op2Add"], + opcode=[0x0F, 0x24, 0x00], + drex_oc0=1, + operands=[Operand(type="SIMDReg", size=128, dest="DREX"), + Operand(type="SIMDRegMatch0", size=128, dest=None), + Operand(type="Mem", size=sz, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="Spare")]) + add_group("sse5arith%d" % sz, + cpu=["SSE5"], + modifiers=["Op2Add"], + opcode=[0x0F, 0x24, 0x04], + drex_oc0=0, + operands=[Operand(type="SIMDReg", size=128, dest="DREX"), + Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA"), + Operand(type="SIMDRegMatch0", size=128, dest=None)]) + add_group("sse5arith%d" % sz, + cpu=["SSE5"], + modifiers=["Op2Add"], + opcode=[0x0F, 0x24, 0x04], + drex_oc0=0, + operands=[Operand(type="SIMDReg", size=128, dest="DREX"), + Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Mem", size=sz, relaxed=True, dest="EA"), + Operand(type="SIMDRegMatch0", size=128, dest=None)]) + add_group("sse5arith%d" % sz, + cpu=["SSE5"], + modifiers=["Op2Add"], + opcode=[0x0F, 0x24, 0x04], + drex_oc0=1, + operands=[Operand(type="SIMDReg", size=128, dest="DREX"), + Operand(type="SIMDReg", size=128, dest="EA"), + Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRegMatch0", size=128, dest=None)]) + add_group("sse5arith%d" % sz, + cpu=["SSE5"], + modifiers=["Op2Add"], + opcode=[0x0F, 0x24, 0x04], + drex_oc0=1, + operands=[Operand(type="SIMDReg", size=128, dest="DREX"), + Operand(type="Mem", size=sz, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRegMatch0", size=128, dest=None)]) + +add_insn("fmaddps", "sse5arith", modifiers=[0x00]) +add_insn("fmaddpd", "sse5arith", modifiers=[0x01]) +add_insn("fmaddss", "sse5arith32", modifiers=[0x02]) +add_insn("fmaddsd", "sse5arith64", modifiers=[0x03]) + +add_insn("fmsubps", "sse5arith", modifiers=[0x08]) +add_insn("fmsubpd", "sse5arith", modifiers=[0x09]) +add_insn("fmsubss", "sse5arith32", modifiers=[0x0A]) +add_insn("fmsubsd", "sse5arith64", modifiers=[0x0B]) + +add_insn("fnmaddps", "sse5arith", modifiers=[0x10]) +add_insn("fnmaddpd", "sse5arith", modifiers=[0x11]) +add_insn("fnmaddss", "sse5arith32", modifiers=[0x12]) +add_insn("fnmaddsd", "sse5arith64", modifiers=[0x13]) + +add_insn("fnmsubps", "sse5arith", modifiers=[0x18]) +add_insn("fnmsubpd", "sse5arith", modifiers=[0x19]) +add_insn("fnmsubss", "sse5arith32", modifiers=[0x1A]) +add_insn("fnmsubsd", "sse5arith64", modifiers=[0x1B]) + +add_insn("pcmov", "sse5arith", modifiers=[0x22]) + +add_insn("permps", "sse5arith", modifiers=[0x20]) +add_insn("permpd", "sse5arith", modifiers=[0x21]) +add_insn("pperm", "sse5arith", modifiers=[0x23]) + +add_group("sse5two", + cpu=["SSE5"], + modifiers=["Op2Add"], + opcode=[0x0F, 0x7A, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) +for sz in [32, 64]: + add_group("sse5two%d" % sz, + cpu=["SSE5"], + modifiers=["Op2Add"], + opcode=[0x0F, 0x7A, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA")]) + add_group("sse5two%d" % sz, + cpu=["SSE5"], + modifiers=["Op2Add"], + opcode=[0x0F, 0x7A, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Mem", size=sz, relaxed=True, dest="EA")]) + +add_insn("frczps", "sse5two", modifiers=[0x10]) +add_insn("frczpd", "sse5two", modifiers=[0x11]) +add_insn("frczss", "sse5two32", modifiers=[0x12]) +add_insn("frczsd", "sse5two64", modifiers=[0x13]) + +add_insn("phaddbw", "sse5two", modifiers=[0x41]) +add_insn("phaddbd", "sse5two", modifiers=[0x42]) +add_insn("phaddbq", "sse5two", modifiers=[0x43]) +add_insn("phaddwd", "sse5two", modifiers=[0x46]) +add_insn("phaddwq", "sse5two", modifiers=[0x47]) +add_insn("phadddq", "sse5two", modifiers=[0x4B]) + +add_insn("phaddubw", "sse5two", modifiers=[0x51]) +add_insn("phaddubd", "sse5two", modifiers=[0x52]) +add_insn("phaddubq", "sse5two", modifiers=[0x53]) +add_insn("phadduwd", "sse5two", modifiers=[0x56]) +add_insn("phadduwq", "sse5two", modifiers=[0x57]) +add_insn("phaddudq", "sse5two", modifiers=[0x5B]) + +add_insn("phsubbw", "sse5two", modifiers=[0x61]) +add_insn("phsubwd", "sse5two", modifiers=[0x62]) +add_insn("phsubdq", "sse5two", modifiers=[0x63]) + +add_group("sse5pmacs", + cpu=["SSE5"], + modifiers=["Op2Add"], + opcode=[0x0F, 0x24, 0x00], + drex_oc0=0, + operands=[Operand(type="SIMDReg", size=128, dest="DREX"), + Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="SIMDRegMatch0", size=128, dest=None)]) + +add_insn("pmacsww", "sse5pmacs", modifiers=[0x95]) +add_insn("pmacswd", "sse5pmacs", modifiers=[0x96]) +add_insn("pmacsdql", "sse5pmacs", modifiers=[0x97]) +add_insn("pmacsdd", "sse5pmacs", modifiers=[0x9E]) +add_insn("pmacsdqh", "sse5pmacs", modifiers=[0x9F]) + +add_insn("pmacssww", "sse5pmacs", modifiers=[0x85]) +add_insn("pmacsswd", "sse5pmacs", modifiers=[0x86]) +add_insn("pmacssdql", "sse5pmacs", modifiers=[0x87]) +add_insn("pmacssdd", "sse5pmacs", modifiers=[0x8E]) +add_insn("pmacssdqh", "sse5pmacs", modifiers=[0x8F]) + +add_insn("pmadcsswd", "sse5pmacs", modifiers=[0xA6]) +add_insn("pmadcswd", "sse5pmacs", modifiers=[0xB6]) + +add_group("sse5prot", + cpu=["SSE5"], + modifiers=["Op2Add"], + opcode=[0x0F, 0x24, 0x40], + drex_oc0=0, + operands=[Operand(type="SIMDReg", size=128, dest="DREX"), + Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) +add_group("sse5prot", + cpu=["SSE5"], + modifiers=["Op2Add"], + opcode=[0x0F, 0x24, 0x40], + drex_oc0=1, + operands=[Operand(type="SIMDReg", size=128, dest="DREX"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="Spare")]) +add_group("sse5prot", + cpu=["SSE5"], + modifiers=["Op2Add"], + opcode=[0x0F, 0x7B, 0x40], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + +add_insn("protb", "sse5prot", modifiers=[0x00]) +add_insn("protw", "sse5prot", modifiers=[0x01]) +add_insn("protd", "sse5prot", modifiers=[0x02]) +add_insn("protq", "sse5prot", modifiers=[0x03]) + +add_group("sse5psh", + cpu=["SSE5"], + modifiers=["Op2Add"], + opcode=[0x0F, 0x24, 0x44], + drex_oc0=0, + operands=[Operand(type="SIMDReg", size=128, dest="DREX"), + Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) +add_group("sse5psh", + cpu=["SSE5"], + modifiers=["Op2Add"], + opcode=[0x0F, 0x24, 0x44], + drex_oc0=1, + operands=[Operand(type="SIMDReg", size=128, dest="DREX"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="Spare")]) + +add_insn("pshlb", "sse5psh", modifiers=[0x00]) +add_insn("pshlw", "sse5psh", modifiers=[0x01]) +add_insn("pshld", "sse5psh", modifiers=[0x02]) +add_insn("pshlq", "sse5psh", modifiers=[0x03]) + +add_insn("pshab", "sse5psh", modifiers=[0x04]) +add_insn("pshaw", "sse5psh", modifiers=[0x05]) +add_insn("pshad", "sse5psh", modifiers=[0x06]) +add_insn("pshaq", "sse5psh", modifiers=[0x07]) + +# roundps, roundpd, roundss, roundsd, ptest are in SSE4.1 + ##################################################################### # AMD 3DNow! instructions ##################################################################### diff --git a/modules/arch/x86/tests/Makefile.inc b/modules/arch/x86/tests/Makefile.inc index 3fc08dab..60406bfc 100644 --- a/modules/arch/x86/tests/Makefile.inc +++ b/modules/arch/x86/tests/Makefile.inc @@ -144,6 +144,12 @@ EXTRA_DIST += modules/arch/x86/tests/sse4.asm EXTRA_DIST += modules/arch/x86/tests/sse4.hex EXTRA_DIST += modules/arch/x86/tests/sse4-err.asm EXTRA_DIST += modules/arch/x86/tests/sse4-err.errwarn +EXTRA_DIST += modules/arch/x86/tests/sse5-all.asm +EXTRA_DIST += modules/arch/x86/tests/sse5-all.hex +EXTRA_DIST += modules/arch/x86/tests/sse5-basic.asm +EXTRA_DIST += modules/arch/x86/tests/sse5-basic.hex +EXTRA_DIST += modules/arch/x86/tests/sse5-err.asm +EXTRA_DIST += modules/arch/x86/tests/sse5-err.errwarn EXTRA_DIST += modules/arch/x86/tests/ssse3.asm EXTRA_DIST += modules/arch/x86/tests/ssse3.c EXTRA_DIST += modules/arch/x86/tests/ssse3.hex diff --git a/modules/arch/x86/tests/sse5-all.asm b/modules/arch/x86/tests/sse5-all.asm new file mode 100644 index 00000000..c4fdd6dd --- /dev/null +++ b/modules/arch/x86/tests/sse5-all.asm @@ -0,0 +1,509 @@ +; Instructions are ordered in SSE5 databook order +; BITS=16 to minimize output length +[bits 16] +compd xmm1, xmm4, xmm7, 5 ; 0F 25 2D 347 10 05 +compd xmm2, xmm5, [0], byte 5 ; 0F 25 2D 056 20 00 00 05 +compd xmm3, xmm6, dqword [0], 5 ; 0F 25 2D 066 30 00 00 05 + +comps xmm1, xmm4, xmm7, 5 ; 0F 25 2C 347 10 05 +comps xmm2, xmm5, [0], byte 5 ; 0F 25 2C 056 20 00 00 05 +comps xmm3, xmm6, dqword [0], 5 ; 0F 25 2C 066 30 00 00 05 + +comsd xmm1, xmm4, xmm7, 5 ; 0F 25 2F 347 10 05 +comsd xmm2, xmm5, [0], byte 5 ; 0F 25 2F 056 20 00 00 05 +comsd xmm3, xmm6, qword [0], 5 ; 0F 25 2F 066 30 00 00 05 + +comss xmm1, xmm4, xmm7, 5 ; 0F 25 2E 347 10 05 +comss xmm2, xmm5, [0], byte 5 ; 0F 25 2E 056 20 00 00 05 +comss xmm3, xmm6, dword [0], 5 ; 0F 25 2E 066 30 00 00 05 + +cvtph2ps xmm1, xmm4 ; 0F 7A 30 314 +cvtph2ps xmm2, [0] ; 0F 7A 30 026 00 00 +cvtph2ps xmm3, qword [0] ; 0F 7A 30 036 00 00 + +cvtps2ph xmm1, xmm4 ; 0F 7A 31 341 +cvtps2ph [0], xmm2 ; 0F 7A 31 026 00 00 +cvtps2ph qword [0], xmm3 ; 0F 7A 31 036 00 00 + +fmaddpd xmm1, xmm1, xmm2, xmm3 ; 0F 24 01 323 10 /or/ 0F 24 01 332 18 +fmaddpd xmm1, xmm1, xmm2, [0] ; 0F 24 01 026 10 00 00 +fmaddpd xmm1, xmm1, xmm2, dqword [0] ; 0F 24 01 026 10 00 00 +fmaddpd xmm1, xmm1, [0], xmm3 ; 0F 24 01 036 18 00 00 +fmaddpd xmm1, xmm1, dqword [0], xmm3 ; 0F 24 01 036 18 00 00 +fmaddpd xmm1, xmm2, xmm3, xmm1 ; 0F 24 05 323 10 /or/ 0F 24 05 332 18 +fmaddpd xmm1, xmm2, [0], xmm1 ; 0F 24 05 026 10 00 00 +fmaddpd xmm1, xmm2, dqword [0], xmm1 ; 0F 24 05 026 10 00 00 +fmaddpd xmm1, [0], xmm3, xmm1 ; 0F 24 05 036 18 00 00 +fmaddpd xmm1, dqword [0], xmm3, xmm1 ; 0F 24 05 036 18 00 00 + +fmaddps xmm1, xmm1, xmm2, xmm3 ; 0F 24 00 323 10 /or/ 0F 24 00 332 18 +fmaddps xmm1, xmm1, xmm2, [0] ; 0F 24 00 026 10 00 00 +fmaddps xmm1, xmm1, xmm2, dqword [0] ; 0F 24 00 026 10 00 00 +fmaddps xmm1, xmm1, [0], xmm3 ; 0F 24 00 036 18 00 00 +fmaddps xmm1, xmm1, dqword [0], xmm3 ; 0F 24 00 036 18 00 00 +fmaddps xmm1, xmm2, xmm3, xmm1 ; 0F 24 04 323 10 /or/ 0F 24 04 332 18 +fmaddps xmm1, xmm2, [0], xmm1 ; 0F 24 04 026 10 00 00 +fmaddps xmm1, xmm2, dqword [0], xmm1 ; 0F 24 04 026 10 00 00 +fmaddps xmm1, [0], xmm3, xmm1 ; 0F 24 04 036 18 00 00 +fmaddps xmm1, dqword [0], xmm3, xmm1 ; 0F 24 04 036 18 00 00 + +fmaddsd xmm1, xmm1, xmm2, xmm3 ; 0F 24 03 323 10 /or/ 0F 24 03 332 18 +fmaddsd xmm1, xmm1, xmm2, [0] ; 0F 24 03 026 10 00 00 +fmaddsd xmm1, xmm1, xmm2, qword [0] ; 0F 24 03 026 10 00 00 +fmaddsd xmm1, xmm1, [0], xmm3 ; 0F 24 03 036 18 00 00 +fmaddsd xmm1, xmm1, qword [0], xmm3 ; 0F 24 03 036 18 00 00 +fmaddsd xmm1, xmm2, xmm3, xmm1 ; 0F 24 07 323 10 /or/ 0F 24 07 332 18 +fmaddsd xmm1, xmm2, [0], xmm1 ; 0F 24 07 026 10 00 00 +fmaddsd xmm1, xmm2, qword [0], xmm1 ; 0F 24 07 026 10 00 00 +fmaddsd xmm1, [0], xmm3, xmm1 ; 0F 24 07 036 18 00 00 +fmaddsd xmm1, qword [0], xmm3, xmm1 ; 0F 24 07 036 18 00 00 + +fmaddss xmm1, xmm1, xmm2, xmm3 ; 0F 24 02 323 10 /or/ 0F 24 02 332 18 +fmaddss xmm1, xmm1, xmm2, [0] ; 0F 24 02 026 10 00 00 +fmaddss xmm1, xmm1, xmm2, dword [0] ; 0F 24 02 026 10 00 00 +fmaddss xmm1, xmm1, [0], xmm3 ; 0F 24 02 036 18 00 00 +fmaddss xmm1, xmm1, dword [0], xmm3 ; 0F 24 02 036 18 00 00 +fmaddss xmm1, xmm2, xmm3, xmm1 ; 0F 24 06 323 10 /or/ 0F 24 06 332 18 +fmaddss xmm1, xmm2, [0], xmm1 ; 0F 24 06 026 10 00 00 +fmaddss xmm1, xmm2, dword [0], xmm1 ; 0F 24 06 026 10 00 00 +fmaddss xmm1, [0], xmm3, xmm1 ; 0F 24 06 036 18 00 00 +fmaddss xmm1, dword [0], xmm3, xmm1 ; 0F 24 06 036 18 00 00 + +fmsubpd xmm1, xmm1, xmm2, xmm3 ; 0F 24 09 323 10 /or/ 0F 24 09 332 18 +fmsubpd xmm1, xmm1, xmm2, [0] ; 0F 24 09 026 10 00 00 +fmsubpd xmm1, xmm1, xmm2, dqword [0] ; 0F 24 09 026 10 00 00 +fmsubpd xmm1, xmm1, [0], xmm3 ; 0F 24 09 036 18 00 00 +fmsubpd xmm1, xmm1, dqword [0], xmm3 ; 0F 24 09 036 18 00 00 +fmsubpd xmm1, xmm2, xmm3, xmm1 ; 0F 24 0D 323 10 /or/ 0F 24 0D 332 18 +fmsubpd xmm1, xmm2, [0], xmm1 ; 0F 24 0D 026 10 00 00 +fmsubpd xmm1, xmm2, dqword [0], xmm1 ; 0F 24 0D 026 10 00 00 +fmsubpd xmm1, [0], xmm3, xmm1 ; 0F 24 0D 036 18 00 00 +fmsubpd xmm1, dqword [0], xmm3, xmm1 ; 0F 24 0D 036 18 00 00 + +fmsubps xmm1, xmm1, xmm2, xmm3 ; 0F 24 08 323 10 /or/ 0F 24 08 332 18 +fmsubps xmm1, xmm1, xmm2, [0] ; 0F 24 08 026 10 00 00 +fmsubps xmm1, xmm1, xmm2, dqword [0] ; 0F 24 08 026 10 00 00 +fmsubps xmm1, xmm1, [0], xmm3 ; 0F 24 08 036 18 00 00 +fmsubps xmm1, xmm1, dqword [0], xmm3 ; 0F 24 08 036 18 00 00 +fmsubps xmm1, xmm2, xmm3, xmm1 ; 0F 24 0C 323 10 /or/ 0F 24 0C 332 18 +fmsubps xmm1, xmm2, [0], xmm1 ; 0F 24 0C 026 10 00 00 +fmsubps xmm1, xmm2, dqword [0], xmm1 ; 0F 24 0C 026 10 00 00 +fmsubps xmm1, [0], xmm3, xmm1 ; 0F 24 0C 036 18 00 00 +fmsubps xmm1, dqword [0], xmm3, xmm1 ; 0F 24 0C 036 18 00 00 + +fmsubsd xmm1, xmm1, xmm2, xmm3 ; 0F 24 0B 323 10 /or/ 0F 24 0B 332 18 +fmsubsd xmm1, xmm1, xmm2, [0] ; 0F 24 0B 026 10 00 00 +fmsubsd xmm1, xmm1, xmm2, qword [0] ; 0F 24 0B 026 10 00 00 +fmsubsd xmm1, xmm1, [0], xmm3 ; 0F 24 0B 036 18 00 00 +fmsubsd xmm1, xmm1, qword [0], xmm3 ; 0F 24 0B 036 18 00 00 +fmsubsd xmm1, xmm2, xmm3, xmm1 ; 0F 24 0F 323 10 /or/ 0F 24 0F 332 18 +fmsubsd xmm1, xmm2, [0], xmm1 ; 0F 24 0F 026 10 00 00 +fmsubsd xmm1, xmm2, qword [0], xmm1 ; 0F 24 0F 026 10 00 00 +fmsubsd xmm1, [0], xmm3, xmm1 ; 0F 24 0F 036 18 00 00 +fmsubsd xmm1, qword [0], xmm3, xmm1 ; 0F 24 0F 036 18 00 00 + +fmsubss xmm1, xmm1, xmm2, xmm3 ; 0F 24 0A 323 10 /or/ 0F 24 0A 332 18 +fmsubss xmm1, xmm1, xmm2, [0] ; 0F 24 0A 026 10 00 00 +fmsubss xmm1, xmm1, xmm2, dword [0] ; 0F 24 0A 026 10 00 00 +fmsubss xmm1, xmm1, [0], xmm3 ; 0F 24 0A 036 18 00 00 +fmsubss xmm1, xmm1, dword [0], xmm3 ; 0F 24 0A 036 18 00 00 +fmsubss xmm1, xmm2, xmm3, xmm1 ; 0F 24 0E 323 10 /or/ 0F 24 0E 332 18 +fmsubss xmm1, xmm2, [0], xmm1 ; 0F 24 0E 026 10 00 00 +fmsubss xmm1, xmm2, dword [0], xmm1 ; 0F 24 0E 026 10 00 00 +fmsubss xmm1, [0], xmm3, xmm1 ; 0F 24 0E 036 18 00 00 +fmsubss xmm1, dword [0], xmm3, xmm1 ; 0F 24 0E 036 18 00 00 + +fnmaddpd xmm1, xmm1, xmm2, xmm3 ; 0F 24 11 323 10 /or/ 0F 24 11 332 18 +fnmaddpd xmm1, xmm1, xmm2, [0] ; 0F 24 11 026 10 00 00 +fnmaddpd xmm1, xmm1, xmm2, dqword [0] ; 0F 24 11 026 10 00 00 +fnmaddpd xmm1, xmm1, [0], xmm3 ; 0F 24 11 036 18 00 00 +fnmaddpd xmm1, xmm1, dqword [0], xmm3 ; 0F 24 11 036 18 00 00 +fnmaddpd xmm1, xmm2, xmm3, xmm1 ; 0F 24 15 323 10 /or/ 0F 24 15 332 18 +fnmaddpd xmm1, xmm2, [0], xmm1 ; 0F 24 15 026 10 00 00 +fnmaddpd xmm1, xmm2, dqword [0], xmm1 ; 0F 24 15 026 10 00 00 +fnmaddpd xmm1, [0], xmm3, xmm1 ; 0F 24 15 036 18 00 00 +fnmaddpd xmm1, dqword [0], xmm3, xmm1 ; 0F 24 15 036 18 00 00 + +fnmaddps xmm1, xmm1, xmm2, xmm3 ; 0F 24 10 323 10 /or/ 0F 24 10 332 18 +fnmaddps xmm1, xmm1, xmm2, [0] ; 0F 24 10 026 10 00 00 +fnmaddps xmm1, xmm1, xmm2, dqword [0] ; 0F 24 10 026 10 00 00 +fnmaddps xmm1, xmm1, [0], xmm3 ; 0F 24 10 036 18 00 00 +fnmaddps xmm1, xmm1, dqword [0], xmm3 ; 0F 24 10 036 18 00 00 +fnmaddps xmm1, xmm2, xmm3, xmm1 ; 0F 24 14 323 10 /or/ 0F 24 14 332 18 +fnmaddps xmm1, xmm2, [0], xmm1 ; 0F 24 14 026 10 00 00 +fnmaddps xmm1, xmm2, dqword [0], xmm1 ; 0F 24 14 026 10 00 00 +fnmaddps xmm1, [0], xmm3, xmm1 ; 0F 24 14 036 18 00 00 +fnmaddps xmm1, dqword [0], xmm3, xmm1 ; 0F 24 14 036 18 00 00 + +fnmaddsd xmm1, xmm1, xmm2, xmm3 ; 0F 24 13 323 10 /or/ 0F 24 13 332 18 +fnmaddsd xmm1, xmm1, xmm2, [0] ; 0F 24 13 026 10 00 00 +fnmaddsd xmm1, xmm1, xmm2, qword [0] ; 0F 24 13 026 10 00 00 +fnmaddsd xmm1, xmm1, [0], xmm3 ; 0F 24 13 036 18 00 00 +fnmaddsd xmm1, xmm1, qword [0], xmm3 ; 0F 24 13 036 18 00 00 +fnmaddsd xmm1, xmm2, xmm3, xmm1 ; 0F 24 17 323 10 /or/ 0F 24 17 332 18 +fnmaddsd xmm1, xmm2, [0], xmm1 ; 0F 24 17 026 10 00 00 +fnmaddsd xmm1, xmm2, qword [0], xmm1 ; 0F 24 17 026 10 00 00 +fnmaddsd xmm1, [0], xmm3, xmm1 ; 0F 24 17 036 18 00 00 +fnmaddsd xmm1, qword [0], xmm3, xmm1 ; 0F 24 17 036 18 00 00 + +fnmaddss xmm1, xmm1, xmm2, xmm3 ; 0F 24 12 323 10 /or/ 0F 24 12 332 18 +fnmaddss xmm1, xmm1, xmm2, [0] ; 0F 24 12 026 10 00 00 +fnmaddss xmm1, xmm1, xmm2, dword [0] ; 0F 24 12 026 10 00 00 +fnmaddss xmm1, xmm1, [0], xmm3 ; 0F 24 12 036 18 00 00 +fnmaddss xmm1, xmm1, dword [0], xmm3 ; 0F 24 12 036 18 00 00 +fnmaddss xmm1, xmm2, xmm3, xmm1 ; 0F 24 16 323 10 /or/ 0F 24 16 332 18 +fnmaddss xmm1, xmm2, [0], xmm1 ; 0F 24 16 026 10 00 00 +fnmaddss xmm1, xmm2, dword [0], xmm1 ; 0F 24 16 026 10 00 00 +fnmaddss xmm1, [0], xmm3, xmm1 ; 0F 24 16 036 18 00 00 +fnmaddss xmm1, dword [0], xmm3, xmm1 ; 0F 24 16 036 18 00 00 + +fnmsubpd xmm1, xmm1, xmm2, xmm3 ; 0F 24 19 323 10 /or/ 0F 24 19 332 18 +fnmsubpd xmm1, xmm1, xmm2, [0] ; 0F 24 19 026 10 00 00 +fnmsubpd xmm1, xmm1, xmm2, dqword [0] ; 0F 24 19 026 10 00 00 +fnmsubpd xmm1, xmm1, [0], xmm3 ; 0F 24 19 036 18 00 00 +fnmsubpd xmm1, xmm1, dqword [0], xmm3 ; 0F 24 19 036 18 00 00 +fnmsubpd xmm1, xmm2, xmm3, xmm1 ; 0F 24 1D 323 10 /or/ 0F 24 1D 332 18 +fnmsubpd xmm1, xmm2, [0], xmm1 ; 0F 24 1D 026 10 00 00 +fnmsubpd xmm1, xmm2, dqword [0], xmm1 ; 0F 24 1D 026 10 00 00 +fnmsubpd xmm1, [0], xmm3, xmm1 ; 0F 24 1D 036 18 00 00 +fnmsubpd xmm1, dqword [0], xmm3, xmm1 ; 0F 24 1D 036 18 00 00 + +fnmsubps xmm1, xmm1, xmm2, xmm3 ; 0F 24 18 323 10 /or/ 0F 24 18 332 18 +fnmsubps xmm1, xmm1, xmm2, [0] ; 0F 24 18 026 10 00 00 +fnmsubps xmm1, xmm1, xmm2, dqword [0] ; 0F 24 18 026 10 00 00 +fnmsubps xmm1, xmm1, [0], xmm3 ; 0F 24 18 036 18 00 00 +fnmsubps xmm1, xmm1, dqword [0], xmm3 ; 0F 24 18 036 18 00 00 +fnmsubps xmm1, xmm2, xmm3, xmm1 ; 0F 24 1C 323 10 /or/ 0F 24 1C 332 18 +fnmsubps xmm1, xmm2, [0], xmm1 ; 0F 24 1C 026 10 00 00 +fnmsubps xmm1, xmm2, dqword [0], xmm1 ; 0F 24 1C 026 10 00 00 +fnmsubps xmm1, [0], xmm3, xmm1 ; 0F 24 1C 036 18 00 00 +fnmsubps xmm1, dqword [0], xmm3, xmm1 ; 0F 24 1C 036 18 00 00 + +fnmsubsd xmm1, xmm1, xmm2, xmm3 ; 0F 24 1B 323 10 /or/ 0F 24 1B 332 18 +fnmsubsd xmm1, xmm1, xmm2, [0] ; 0F 24 1B 026 10 00 00 +fnmsubsd xmm1, xmm1, xmm2, qword [0] ; 0F 24 1B 026 10 00 00 +fnmsubsd xmm1, xmm1, [0], xmm3 ; 0F 24 1B 036 18 00 00 +fnmsubsd xmm1, xmm1, qword [0], xmm3 ; 0F 24 1B 036 18 00 00 +fnmsubsd xmm1, xmm2, xmm3, xmm1 ; 0F 24 1F 323 10 /or/ 0F 24 1F 332 18 +fnmsubsd xmm1, xmm2, [0], xmm1 ; 0F 24 1F 026 10 00 00 +fnmsubsd xmm1, xmm2, qword [0], xmm1 ; 0F 24 1F 026 10 00 00 +fnmsubsd xmm1, [0], xmm3, xmm1 ; 0F 24 1F 036 18 00 00 +fnmsubsd xmm1, qword [0], xmm3, xmm1 ; 0F 24 1F 036 18 00 00 + +fnmsubss xmm1, xmm1, xmm2, xmm3 ; 0F 24 1A 323 10 /or/ 0F 24 1A 332 18 +fnmsubss xmm1, xmm1, xmm2, [0] ; 0F 24 1A 026 10 00 00 +fnmsubss xmm1, xmm1, xmm2, dword [0] ; 0F 24 1A 026 10 00 00 +fnmsubss xmm1, xmm1, [0], xmm3 ; 0F 24 1A 036 18 00 00 +fnmsubss xmm1, xmm1, dword [0], xmm3 ; 0F 24 1A 036 18 00 00 +fnmsubss xmm1, xmm2, xmm3, xmm1 ; 0F 24 1E 323 10 /or/ 0F 24 1E 332 18 +fnmsubss xmm1, xmm2, [0], xmm1 ; 0F 24 1E 026 10 00 00 +fnmsubss xmm1, xmm2, dword [0], xmm1 ; 0F 24 1E 026 10 00 00 +fnmsubss xmm1, [0], xmm3, xmm1 ; 0F 24 1E 036 18 00 00 +fnmsubss xmm1, dword [0], xmm3, xmm1 ; 0F 24 1E 036 18 00 00 + +frczpd xmm1, xmm2 ; 0F 7A 11 312 +frczpd xmm1, [0] ; 0F 7A 11 016 00 00 +frczpd xmm1, dqword [0] ; 0F 7A 11 016 00 00 + +frczps xmm1, xmm2 ; 0F 7A 10 312 +frczps xmm1, [0] ; 0F 7A 10 016 00 00 +frczps xmm1, dqword [0] ; 0F 7A 10 016 00 00 + +frczsd xmm1, xmm2 ; 0F 7A 13 312 +frczsd xmm1, [0] ; 0F 7A 13 016 00 00 +frczsd xmm1, qword [0] ; 0F 7A 13 016 00 00 + +frczss xmm1, xmm2 ; 0F 7A 12 312 +frczss xmm1, [0] ; 0F 7A 12 016 00 00 +frczss xmm1, dword [0] ; 0F 7A 12 016 00 00 + +pcmov xmm1, xmm1, xmm2, xmm3 ; 0F 24 22 323 10 /or/ 0F 24 22 332 18 +pcmov xmm1, xmm1, xmm2, [0] ; 0F 24 22 026 10 00 00 +pcmov xmm1, xmm1, xmm2, dqword [0] ; 0F 24 22 026 10 00 00 +pcmov xmm1, xmm1, [0], xmm3 ; 0F 24 22 036 18 00 00 +pcmov xmm1, xmm1, dqword [0], xmm3 ; 0F 24 22 036 18 00 00 +pcmov xmm1, xmm2, xmm3, xmm1 ; 0F 24 26 323 10 /or/ 0F 24 26 332 18 +pcmov xmm1, xmm2, [0], xmm1 ; 0F 24 26 026 10 00 00 +pcmov xmm1, xmm2, dqword [0], xmm1 ; 0F 24 26 026 10 00 00 +pcmov xmm1, [0], xmm3, xmm1 ; 0F 24 26 036 18 00 00 +pcmov xmm1, dqword [0], xmm3, xmm1 ; 0F 24 26 036 18 00 00 + +pcomb xmm1, xmm4, xmm7, 5 ; 0F 25 4C 347 10 05 +pcomb xmm2, xmm5, [0], byte 5 ; 0F 25 4C 056 20 00 00 05 +pcomb xmm3, xmm6, dqword [0], 5 ; 0F 25 4C 066 30 00 00 05 + +pcomd xmm1, xmm4, xmm7, 5 ; 0F 25 4E 347 10 05 +pcomd xmm2, xmm5, [0], byte 5 ; 0F 25 4E 056 20 00 00 05 +pcomd xmm3, xmm6, dqword [0], 5 ; 0F 25 4E 066 30 00 00 05 + +pcomq xmm1, xmm4, xmm7, 5 ; 0F 25 4F 347 10 05 +pcomq xmm2, xmm5, [0], byte 5 ; 0F 25 4F 056 20 00 00 05 +pcomq xmm3, xmm6, dqword [0], 5 ; 0F 25 4F 066 30 00 00 05 + +pcomub xmm1, xmm4, xmm7, 5 ; 0F 25 6C 347 10 05 +pcomub xmm2, xmm5, [0], byte 5 ; 0F 25 6C 056 20 00 00 05 +pcomub xmm3, xmm6, dqword [0], 5 ; 0F 25 6C 066 30 00 00 05 + +pcomud xmm1, xmm4, xmm7, 5 ; 0F 25 6E 347 10 05 +pcomud xmm2, xmm5, [0], byte 5 ; 0F 25 6E 056 20 00 00 05 +pcomud xmm3, xmm6, dqword [0], 5 ; 0F 25 6E 066 30 00 00 05 + +pcomuq xmm1, xmm4, xmm7, 5 ; 0F 25 6F 347 10 05 +pcomuq xmm2, xmm5, [0], byte 5 ; 0F 25 6F 056 20 00 00 05 +pcomuq xmm3, xmm6, dqword [0], 5 ; 0F 25 6F 066 30 00 00 05 + +pcomuw xmm1, xmm4, xmm7, 5 ; 0F 25 6D 347 10 05 +pcomuw xmm2, xmm5, [0], byte 5 ; 0F 25 6D 056 20 00 00 05 +pcomuw xmm3, xmm6, dqword [0], 5 ; 0F 25 6D 066 30 00 00 05 + +pcomw xmm1, xmm4, xmm7, 5 ; 0F 25 4D 347 10 05 +pcomw xmm2, xmm5, [0], byte 5 ; 0F 25 4D 056 20 00 00 05 +pcomw xmm3, xmm6, dqword [0], 5 ; 0F 25 4D 066 30 00 00 05 + +permpd xmm1, xmm1, xmm2, xmm3 ; 0F 24 21 323 10 /or/ 0F 24 21 332 18 +permpd xmm1, xmm1, xmm2, [0] ; 0F 24 21 026 10 00 00 +permpd xmm1, xmm1, xmm2, dqword [0] ; 0F 24 21 026 10 00 00 +permpd xmm1, xmm1, [0], xmm3 ; 0F 24 21 036 18 00 00 +permpd xmm1, xmm1, dqword [0], xmm3 ; 0F 24 21 036 18 00 00 +permpd xmm1, xmm2, xmm3, xmm1 ; 0F 24 25 323 10 /or/ 0F 24 25 332 18 +permpd xmm1, xmm2, [0], xmm1 ; 0F 24 25 026 10 00 00 +permpd xmm1, xmm2, dqword [0], xmm1 ; 0F 24 25 026 10 00 00 +permpd xmm1, [0], xmm3, xmm1 ; 0F 24 25 036 18 00 00 +permpd xmm1, dqword [0], xmm3, xmm1 ; 0F 24 25 036 18 00 00 + +permps xmm1, xmm1, xmm2, xmm3 ; 0F 24 20 323 10 /or/ 0F 24 20 332 18 +permps xmm1, xmm1, xmm2, [0] ; 0F 24 20 026 10 00 00 +permps xmm1, xmm1, xmm2, dqword [0] ; 0F 24 20 026 10 00 00 +permps xmm1, xmm1, [0], xmm3 ; 0F 24 20 036 18 00 00 +permps xmm1, xmm1, dqword [0], xmm3 ; 0F 24 20 036 18 00 00 +permps xmm1, xmm2, xmm3, xmm1 ; 0F 24 24 323 10 /or/ 0F 24 24 332 18 +permps xmm1, xmm2, [0], xmm1 ; 0F 24 24 026 10 00 00 +permps xmm1, xmm2, dqword [0], xmm1 ; 0F 24 24 026 10 00 00 +permps xmm1, [0], xmm3, xmm1 ; 0F 24 24 036 18 00 00 +permps xmm1, dqword [0], xmm3, xmm1 ; 0F 24 24 036 18 00 00 + +phaddbd xmm1, xmm2 ; 0F 7A 42 312 +phaddbd xmm1, [0] ; 0F 7A 42 016 00 00 +phaddbd xmm1, dqword [0] ; 0F 7A 42 016 00 00 + +phaddbq xmm1, xmm2 ; 0F 7A 43 312 +phaddbq xmm1, [0] ; 0F 7A 43 016 00 00 +phaddbq xmm1, dqword [0] ; 0F 7A 43 016 00 00 + +phaddbw xmm1, xmm2 ; 0F 7A 41 312 +phaddbw xmm1, [0] ; 0F 7A 41 016 00 00 +phaddbw xmm1, dqword [0] ; 0F 7A 41 016 00 00 + +phadddq xmm1, xmm2 ; 0F 7A 4B 312 +phadddq xmm1, [0] ; 0F 7A 4B 016 00 00 +phadddq xmm1, dqword [0] ; 0F 7A 4B 016 00 00 + +phaddubd xmm1, xmm2 ; 0F 7A 52 312 +phaddubd xmm1, [0] ; 0F 7A 52 016 00 00 +phaddubd xmm1, dqword [0] ; 0F 7A 52 016 00 00 + +phaddubq xmm1, xmm2 ; 0F 7A 53 312 +phaddubq xmm1, [0] ; 0F 7A 53 016 00 00 +phaddubq xmm1, dqword [0] ; 0F 7A 53 016 00 00 + +phaddubw xmm1, xmm2 ; 0F 7A 51 312 +phaddubw xmm1, [0] ; 0F 7A 51 016 00 00 +phaddubw xmm1, dqword [0] ; 0F 7A 51 016 00 00 + +phaddudq xmm1, xmm2 ; 0F 7A 5B 312 +phaddudq xmm1, [0] ; 0F 7A 5B 016 00 00 +phaddudq xmm1, dqword [0] ; 0F 7A 5B 016 00 00 + +phadduwd xmm1, xmm2 ; 0F 7A 56 312 +phadduwd xmm1, [0] ; 0F 7A 56 016 00 00 +phadduwd xmm1, dqword [0] ; 0F 7A 56 016 00 00 + +phadduwq xmm1, xmm2 ; 0F 7A 57 312 +phadduwq xmm1, [0] ; 0F 7A 57 016 00 00 +phadduwq xmm1, dqword [0] ; 0F 7A 57 016 00 00 + +phaddwd xmm1, xmm2 ; 0F 7A 46 312 +phaddwd xmm1, [0] ; 0F 7A 46 016 00 00 +phaddwd xmm1, dqword [0] ; 0F 7A 46 016 00 00 + +phaddwq xmm1, xmm2 ; 0F 7A 47 312 +phaddwq xmm1, [0] ; 0F 7A 47 016 00 00 +phaddwq xmm1, dqword [0] ; 0F 7A 47 016 00 00 + +phsubbw xmm1, xmm2 ; 0F 7A 61 312 +phsubbw xmm1, [0] ; 0F 7A 61 016 00 00 +phsubbw xmm1, dqword [0] ; 0F 7A 61 016 00 00 + +phsubdq xmm1, xmm2 ; 0F 7A 63 312 +phsubdq xmm1, [0] ; 0F 7A 63 016 00 00 +phsubdq xmm1, dqword [0] ; 0F 7A 63 016 00 00 + +phsubwd xmm1, xmm2 ; 0F 7A 62 312 +phsubwd xmm1, [0] ; 0F 7A 62 016 00 00 +phsubwd xmm1, dqword [0] ; 0F 7A 62 016 00 00 + +pmacsdd xmm1, xmm4, xmm7, xmm1 ; 0F 24 9E 347 10 +pmacsdd xmm2, xmm5, [0], xmm2 ; 0F 24 9E 056 20 00 00 +pmacsdd xmm3, xmm6, dqword [0], xmm3 ; 0F 24 9E 066 30 00 00 + +pmacsdqh xmm1, xmm4, xmm7, xmm1 ; 0F 24 9F 347 10 +pmacsdqh xmm2, xmm5, [0], xmm2 ; 0F 24 9F 056 20 00 00 +pmacsdqh xmm3, xmm6, dqword [0], xmm3 ; 0F 24 9F 066 30 00 00 + +pmacsdql xmm1, xmm4, xmm7, xmm1 ; 0F 24 97 347 10 +pmacsdql xmm2, xmm5, [0], xmm2 ; 0F 24 97 056 20 00 00 +pmacsdql xmm3, xmm6, dqword [0], xmm3 ; 0F 24 97 066 30 00 00 + +pmacssdd xmm1, xmm4, xmm7, xmm1 ; 0F 24 8E 347 10 +pmacssdd xmm2, xmm5, [0], xmm2 ; 0F 24 8E 056 20 00 00 +pmacssdd xmm3, xmm6, dqword [0], xmm3 ; 0F 24 8E 066 30 00 00 + +pmacssdqh xmm1, xmm4, xmm7, xmm1 ; 0F 24 8F 347 10 +pmacssdqh xmm2, xmm5, [0], xmm2 ; 0F 24 8F 056 20 00 00 +pmacssdqh xmm3, xmm6, dqword [0], xmm3 ; 0F 24 8F 066 30 00 00 + +pmacssdql xmm1, xmm4, xmm7, xmm1 ; 0F 24 87 347 10 +pmacssdql xmm2, xmm5, [0], xmm2 ; 0F 24 87 056 20 00 00 +pmacssdql xmm3, xmm6, dqword [0], xmm3 ; 0F 24 87 066 30 00 00 + +pmacsswd xmm1, xmm4, xmm7, xmm1 ; 0F 24 86 347 10 +pmacsswd xmm2, xmm5, [0], xmm2 ; 0F 24 86 056 20 00 00 +pmacsswd xmm3, xmm6, dqword [0], xmm3 ; 0F 24 86 066 30 00 00 + +pmacssww xmm1, xmm4, xmm7, xmm1 ; 0F 24 85 347 10 +pmacssww xmm2, xmm5, [0], xmm2 ; 0F 24 85 056 20 00 00 +pmacssww xmm3, xmm6, dqword [0], xmm3 ; 0F 24 85 066 30 00 00 + +pmacswd xmm1, xmm4, xmm7, xmm1 ; 0F 24 96 347 10 +pmacswd xmm2, xmm5, [0], xmm2 ; 0F 24 96 056 20 00 00 +pmacswd xmm3, xmm6, dqword [0], xmm3 ; 0F 24 96 066 30 00 00 + +pmacsww xmm1, xmm4, xmm7, xmm1 ; 0F 24 95 347 10 +pmacsww xmm2, xmm5, [0], xmm2 ; 0F 24 95 056 20 00 00 +pmacsww xmm3, xmm6, dqword [0], xmm3 ; 0F 24 95 066 30 00 00 + +pmadcsswd xmm1, xmm4, xmm7, xmm1 ; 0F 24 A6 347 10 +pmadcsswd xmm2, xmm5, [0], xmm2 ; 0F 24 A6 056 20 00 00 +pmadcsswd xmm3, xmm6, dqword [0], xmm3 ; 0F 24 A6 066 30 00 00 + +pmadcswd xmm1, xmm4, xmm7, xmm1 ; 0F 24 B6 347 10 +pmadcswd xmm2, xmm5, [0], xmm2 ; 0F 24 B6 056 20 00 00 +pmadcswd xmm3, xmm6, dqword [0], xmm3 ; 0F 24 B6 066 30 00 00 + +pperm xmm1, xmm1, xmm2, xmm3 ; 0F 24 23 323 10 /or/ 0F 24 23 332 18 +pperm xmm1, xmm1, xmm2, [0] ; 0F 24 23 026 10 00 00 +pperm xmm1, xmm1, xmm2, dqword [0] ; 0F 24 23 026 10 00 00 +pperm xmm1, xmm1, [0], xmm3 ; 0F 24 23 036 18 00 00 +pperm xmm1, xmm1, dqword [0], xmm3 ; 0F 24 23 036 18 00 00 +pperm xmm1, xmm2, xmm3, xmm1 ; 0F 24 27 323 10 /or/ 0F 24 27 332 18 +pperm xmm1, xmm2, [0], xmm1 ; 0F 24 27 026 10 00 00 +pperm xmm1, xmm2, dqword [0], xmm1 ; 0F 24 27 026 10 00 00 +pperm xmm1, [0], xmm3, xmm1 ; 0F 24 27 036 18 00 00 +pperm xmm1, dqword [0], xmm3, xmm1 ; 0F 24 27 036 18 00 00 + +protb xmm1, xmm2, xmm3 ; 0F 24 40 323 10 /or/ 0F 24 40 332 18 +protb xmm1, xmm2, [0] ; 0F 24 40 026 10 00 00 +protb xmm1, xmm2, dqword [0] ; 0F 24 40 026 10 00 00 +protb xmm1, [0], xmm3 ; 0F 24 40 036 18 00 00 +protb xmm1, dqword [0], xmm3 ; 0F 24 40 036 18 00 00 +protb xmm1, xmm2, byte 5 ; 0F 7B 40 312 05 +protb xmm1, [0], byte 5 ; 0F 7B 40 016 00 00 05 +protb xmm1, dqword [0], 5 ; 0F 7B 40 016 00 00 05 + +protd xmm1, xmm2, xmm3 ; 0F 24 42 323 10 /or/ 0F 24 42 332 18 +protd xmm1, xmm2, [0] ; 0F 24 42 026 10 00 00 +protd xmm1, xmm2, dqword [0] ; 0F 24 42 026 10 00 00 +protd xmm1, [0], xmm3 ; 0F 24 42 036 18 00 00 +protd xmm1, dqword [0], xmm3 ; 0F 24 42 036 18 00 00 +protd xmm1, xmm2, byte 5 ; 0F 7B 42 312 05 +protd xmm1, [0], byte 5 ; 0F 7B 42 016 00 00 05 +protd xmm1, dqword [0], 5 ; 0F 7B 42 016 00 00 05 + +protq xmm1, xmm2, xmm3 ; 0F 24 43 323 10 /or/ 0F 24 43 332 18 +protq xmm1, xmm2, [0] ; 0F 24 43 026 10 00 00 +protq xmm1, xmm2, dqword [0] ; 0F 24 43 026 10 00 00 +protq xmm1, [0], xmm3 ; 0F 24 43 036 18 00 00 +protq xmm1, dqword [0], xmm3 ; 0F 24 43 036 18 00 00 +protq xmm1, xmm2, byte 5 ; 0F 7B 43 312 05 +protq xmm1, [0], byte 5 ; 0F 7B 43 016 00 00 05 +protq xmm1, dqword [0], 5 ; 0F 7B 43 016 00 00 05 + +protw xmm1, xmm2, xmm3 ; 0F 24 41 323 10 /or/ 0F 24 41 332 18 +protw xmm1, xmm2, [0] ; 0F 24 41 026 10 00 00 +protw xmm1, xmm2, dqword [0] ; 0F 24 41 026 10 00 00 +protw xmm1, [0], xmm3 ; 0F 24 41 036 18 00 00 +protw xmm1, dqword [0], xmm3 ; 0F 24 41 036 18 00 00 +protw xmm1, xmm2, byte 5 ; 0F 7B 41 312 05 +protw xmm1, [0], byte 5 ; 0F 7B 41 016 00 00 05 +protw xmm1, dqword [0], 5 ; 0F 7B 41 016 00 00 05 + +pshab xmm1, xmm2, xmm3 ; 0F 24 48 323 10 /or/ 0F 24 48 332 18 +pshab xmm1, xmm2, [0] ; 0F 24 48 026 10 00 00 +pshab xmm1, xmm2, dqword [0] ; 0F 24 48 026 10 00 00 +pshab xmm1, [0], xmm3 ; 0F 24 48 036 18 00 00 +pshab xmm1, dqword [0], xmm3 ; 0F 24 48 036 18 00 00 + +pshad xmm1, xmm2, xmm3 ; 0F 24 4A 323 10 /or/ 0F 24 4A 332 18 +pshad xmm1, xmm2, [0] ; 0F 24 4A 026 10 00 00 +pshad xmm1, xmm2, dqword [0] ; 0F 24 4A 026 10 00 00 +pshad xmm1, [0], xmm3 ; 0F 24 4A 036 18 00 00 +pshad xmm1, dqword [0], xmm3 ; 0F 24 4A 036 18 00 00 + +pshaq xmm1, xmm2, xmm3 ; 0F 24 4B 323 10 /or/ 0F 24 4B 332 18 +pshaq xmm1, xmm2, [0] ; 0F 24 4B 026 10 00 00 +pshaq xmm1, xmm2, dqword [0] ; 0F 24 4B 026 10 00 00 +pshaq xmm1, [0], xmm3 ; 0F 24 4B 036 18 00 00 +pshaq xmm1, dqword [0], xmm3 ; 0F 24 4B 036 18 00 00 + +pshaw xmm1, xmm2, xmm3 ; 0F 24 49 323 10 /or/ 0F 24 49 332 18 +pshaw xmm1, xmm2, [0] ; 0F 24 49 026 10 00 00 +pshaw xmm1, xmm2, dqword [0] ; 0F 24 49 026 10 00 00 +pshaw xmm1, [0], xmm3 ; 0F 24 49 036 18 00 00 +pshaw xmm1, dqword [0], xmm3 ; 0F 24 49 036 18 00 00 + +pshlb xmm1, xmm2, xmm3 ; 0F 24 44 323 10 /or/ 0F 24 44 332 18 +pshlb xmm1, xmm2, [0] ; 0F 24 44 026 10 00 00 +pshlb xmm1, xmm2, dqword [0] ; 0F 24 44 026 10 00 00 +pshlb xmm1, [0], xmm3 ; 0F 24 44 036 18 00 00 +pshlb xmm1, dqword [0], xmm3 ; 0F 24 44 036 18 00 00 + +pshld xmm1, xmm2, xmm3 ; 0F 24 46 323 10 /or/ 0F 24 46 332 18 +pshld xmm1, xmm2, [0] ; 0F 24 46 026 10 00 00 +pshld xmm1, xmm2, dqword [0] ; 0F 24 46 026 10 00 00 +pshld xmm1, [0], xmm3 ; 0F 24 46 036 18 00 00 +pshld xmm1, dqword [0], xmm3 ; 0F 24 46 036 18 00 00 + +pshlq xmm1, xmm2, xmm3 ; 0F 24 47 323 10 /or/ 0F 24 47 332 18 +pshlq xmm1, xmm2, [0] ; 0F 24 47 026 10 00 00 +pshlq xmm1, xmm2, dqword [0] ; 0F 24 47 026 10 00 00 +pshlq xmm1, [0], xmm3 ; 0F 24 47 036 18 00 00 +pshlq xmm1, dqword [0], xmm3 ; 0F 24 47 036 18 00 00 + +pshlw xmm1, xmm2, xmm3 ; 0F 24 45 323 10 /or/ 0F 24 45 332 18 +pshlw xmm1, xmm2, [0] ; 0F 24 45 026 10 00 00 +pshlw xmm1, xmm2, dqword [0] ; 0F 24 45 026 10 00 00 +pshlw xmm1, [0], xmm3 ; 0F 24 45 036 18 00 00 +pshlw xmm1, dqword [0], xmm3 ; 0F 24 45 036 18 00 00 + +; SSE5 instructions that are also SSE4.1 instructions + +ptest xmm1, xmm2 ; 66 0F 38 17 312 +ptest xmm1, [0] ; 66 0F 38 17 016 00 00 +ptest xmm1, dqword [0] ; 66 0F 38 17 016 00 00 + +roundpd xmm1, xmm2, 5 ; 66 0F 3A 09 312 05 +roundpd xmm1, [0], byte 5 ; 66 0F 3A 09 016 00 00 05 +roundpd xmm1, dqword [0], 5 ; 66 0F 3A 09 016 00 00 05 + +roundps xmm1, xmm2, 5 ; 66 0F 3A 08 312 05 +roundps xmm1, [0], byte 5 ; 66 0F 3A 08 016 00 00 05 +roundps xmm1, dqword [0], 5 ; 66 0F 3A 08 016 00 00 05 + +roundsd xmm1, xmm2, 5 ; 66 0F 3A 0B 312 05 +roundsd xmm1, [0], byte 5 ; 66 0F 3A 0B 016 00 00 05 +roundsd xmm1, qword [0], 5 ; 66 0F 3A 0B 016 00 00 05 + +roundss xmm1, xmm2, 5 ; 66 0F 3A 0A 312 05 +roundss xmm1, [0], byte 5 ; 66 0F 3A 0A 016 00 00 05 +roundss xmm1, dword [0], 5 ; 66 0F 3A 0A 016 00 00 05 + diff --git a/modules/arch/x86/tests/sse5-all.hex b/modules/arch/x86/tests/sse5-all.hex new file mode 100644 index 00000000..1c9edacf --- /dev/null +++ b/modules/arch/x86/tests/sse5-all.hex @@ -0,0 +1,2727 @@ +0f +25 +2d +e7 +10 +05 +0f +25 +2d +2e +20 +00 +00 +05 +0f +25 +2d +36 +30 +00 +00 +05 +0f +25 +2c +e7 +10 +05 +0f +25 +2c +2e +20 +00 +00 +05 +0f +25 +2c +36 +30 +00 +00 +05 +0f +25 +2f +e7 +10 +05 +0f +25 +2f +2e +20 +00 +00 +05 +0f +25 +2f +36 +30 +00 +00 +05 +0f +25 +2e +e7 +10 +05 +0f +25 +2e +2e +20 +00 +00 +05 +0f +25 +2e +36 +30 +00 +00 +05 +0f +7a +30 +cc +0f +7a +30 +16 +00 +00 +0f +7a +30 +1e +00 +00 +0f +7a +31 +e1 +0f +7a +31 +16 +00 +00 +0f +7a +31 +1e +00 +00 +0f +24 +01 +d3 +10 +0f +24 +01 +16 +10 +00 +00 +0f +24 +01 +16 +10 +00 +00 +0f +24 +01 +1e +18 +00 +00 +0f +24 +01 +1e +18 +00 +00 +0f +24 +05 +d3 +10 +0f +24 +05 +16 +10 +00 +00 +0f +24 +05 +16 +10 +00 +00 +0f +24 +05 +1e +18 +00 +00 +0f +24 +05 +1e +18 +00 +00 +0f +24 +00 +d3 +10 +0f +24 +00 +16 +10 +00 +00 +0f +24 +00 +16 +10 +00 +00 +0f +24 +00 +1e +18 +00 +00 +0f +24 +00 +1e +18 +00 +00 +0f +24 +04 +d3 +10 +0f +24 +04 +16 +10 +00 +00 +0f +24 +04 +16 +10 +00 +00 +0f +24 +04 +1e +18 +00 +00 +0f +24 +04 +1e +18 +00 +00 +0f +24 +03 +d3 +10 +0f +24 +03 +16 +10 +00 +00 +0f +24 +03 +16 +10 +00 +00 +0f +24 +03 +1e +18 +00 +00 +0f +24 +03 +1e +18 +00 +00 +0f +24 +07 +d3 +10 +0f +24 +07 +16 +10 +00 +00 +0f +24 +07 +16 +10 +00 +00 +0f +24 +07 +1e +18 +00 +00 +0f +24 +07 +1e +18 +00 +00 +0f +24 +02 +d3 +10 +0f +24 +02 +16 +10 +00 +00 +0f +24 +02 +16 +10 +00 +00 +0f +24 +02 +1e +18 +00 +00 +0f +24 +02 +1e +18 +00 +00 +0f +24 +06 +d3 +10 +0f +24 +06 +16 +10 +00 +00 +0f +24 +06 +16 +10 +00 +00 +0f +24 +06 +1e +18 +00 +00 +0f +24 +06 +1e +18 +00 +00 +0f +24 +09 +d3 +10 +0f +24 +09 +16 +10 +00 +00 +0f +24 +09 +16 +10 +00 +00 +0f +24 +09 +1e +18 +00 +00 +0f +24 +09 +1e +18 +00 +00 +0f +24 +0d +d3 +10 +0f +24 +0d +16 +10 +00 +00 +0f +24 +0d +16 +10 +00 +00 +0f +24 +0d +1e +18 +00 +00 +0f +24 +0d +1e +18 +00 +00 +0f +24 +08 +d3 +10 +0f +24 +08 +16 +10 +00 +00 +0f +24 +08 +16 +10 +00 +00 +0f +24 +08 +1e +18 +00 +00 +0f +24 +08 +1e +18 +00 +00 +0f +24 +0c +d3 +10 +0f +24 +0c +16 +10 +00 +00 +0f +24 +0c +16 +10 +00 +00 +0f +24 +0c +1e +18 +00 +00 +0f +24 +0c +1e +18 +00 +00 +0f +24 +0b +d3 +10 +0f +24 +0b +16 +10 +00 +00 +0f +24 +0b +16 +10 +00 +00 +0f +24 +0b +1e +18 +00 +00 +0f +24 +0b +1e +18 +00 +00 +0f +24 +0f +d3 +10 +0f +24 +0f +16 +10 +00 +00 +0f +24 +0f +16 +10 +00 +00 +0f +24 +0f +1e +18 +00 +00 +0f +24 +0f +1e +18 +00 +00 +0f +24 +0a +d3 +10 +0f +24 +0a +16 +10 +00 +00 +0f +24 +0a +16 +10 +00 +00 +0f +24 +0a +1e +18 +00 +00 +0f +24 +0a +1e +18 +00 +00 +0f +24 +0e +d3 +10 +0f +24 +0e +16 +10 +00 +00 +0f +24 +0e +16 +10 +00 +00 +0f +24 +0e +1e +18 +00 +00 +0f +24 +0e +1e +18 +00 +00 +0f +24 +11 +d3 +10 +0f +24 +11 +16 +10 +00 +00 +0f +24 +11 +16 +10 +00 +00 +0f +24 +11 +1e +18 +00 +00 +0f +24 +11 +1e +18 +00 +00 +0f +24 +15 +d3 +10 +0f +24 +15 +16 +10 +00 +00 +0f +24 +15 +16 +10 +00 +00 +0f +24 +15 +1e +18 +00 +00 +0f +24 +15 +1e +18 +00 +00 +0f +24 +10 +d3 +10 +0f +24 +10 +16 +10 +00 +00 +0f +24 +10 +16 +10 +00 +00 +0f +24 +10 +1e +18 +00 +00 +0f +24 +10 +1e +18 +00 +00 +0f +24 +14 +d3 +10 +0f +24 +14 +16 +10 +00 +00 +0f +24 +14 +16 +10 +00 +00 +0f +24 +14 +1e +18 +00 +00 +0f +24 +14 +1e +18 +00 +00 +0f +24 +13 +d3 +10 +0f +24 +13 +16 +10 +00 +00 +0f +24 +13 +16 +10 +00 +00 +0f +24 +13 +1e +18 +00 +00 +0f +24 +13 +1e +18 +00 +00 +0f +24 +17 +d3 +10 +0f +24 +17 +16 +10 +00 +00 +0f +24 +17 +16 +10 +00 +00 +0f +24 +17 +1e +18 +00 +00 +0f +24 +17 +1e +18 +00 +00 +0f +24 +12 +d3 +10 +0f +24 +12 +16 +10 +00 +00 +0f +24 +12 +16 +10 +00 +00 +0f +24 +12 +1e +18 +00 +00 +0f +24 +12 +1e +18 +00 +00 +0f +24 +16 +d3 +10 +0f +24 +16 +16 +10 +00 +00 +0f +24 +16 +16 +10 +00 +00 +0f +24 +16 +1e +18 +00 +00 +0f +24 +16 +1e +18 +00 +00 +0f +24 +19 +d3 +10 +0f +24 +19 +16 +10 +00 +00 +0f +24 +19 +16 +10 +00 +00 +0f +24 +19 +1e +18 +00 +00 +0f +24 +19 +1e +18 +00 +00 +0f +24 +1d +d3 +10 +0f +24 +1d +16 +10 +00 +00 +0f +24 +1d +16 +10 +00 +00 +0f +24 +1d +1e +18 +00 +00 +0f +24 +1d +1e +18 +00 +00 +0f +24 +18 +d3 +10 +0f +24 +18 +16 +10 +00 +00 +0f +24 +18 +16 +10 +00 +00 +0f +24 +18 +1e +18 +00 +00 +0f +24 +18 +1e +18 +00 +00 +0f +24 +1c +d3 +10 +0f +24 +1c +16 +10 +00 +00 +0f +24 +1c +16 +10 +00 +00 +0f +24 +1c +1e +18 +00 +00 +0f +24 +1c +1e +18 +00 +00 +0f +24 +1b +d3 +10 +0f +24 +1b +16 +10 +00 +00 +0f +24 +1b +16 +10 +00 +00 +0f +24 +1b +1e +18 +00 +00 +0f +24 +1b +1e +18 +00 +00 +0f +24 +1f +d3 +10 +0f +24 +1f +16 +10 +00 +00 +0f +24 +1f +16 +10 +00 +00 +0f +24 +1f +1e +18 +00 +00 +0f +24 +1f +1e +18 +00 +00 +0f +24 +1a +d3 +10 +0f +24 +1a +16 +10 +00 +00 +0f +24 +1a +16 +10 +00 +00 +0f +24 +1a +1e +18 +00 +00 +0f +24 +1a +1e +18 +00 +00 +0f +24 +1e +d3 +10 +0f +24 +1e +16 +10 +00 +00 +0f +24 +1e +16 +10 +00 +00 +0f +24 +1e +1e +18 +00 +00 +0f +24 +1e +1e +18 +00 +00 +0f +7a +11 +ca +0f +7a +11 +0e +00 +00 +0f +7a +11 +0e +00 +00 +0f +7a +10 +ca +0f +7a +10 +0e +00 +00 +0f +7a +10 +0e +00 +00 +0f +7a +13 +ca +0f +7a +13 +0e +00 +00 +0f +7a +13 +0e +00 +00 +0f +7a +12 +ca +0f +7a +12 +0e +00 +00 +0f +7a +12 +0e +00 +00 +0f +24 +22 +d3 +10 +0f +24 +22 +16 +10 +00 +00 +0f +24 +22 +16 +10 +00 +00 +0f +24 +22 +1e +18 +00 +00 +0f +24 +22 +1e +18 +00 +00 +0f +24 +26 +d3 +10 +0f +24 +26 +16 +10 +00 +00 +0f +24 +26 +16 +10 +00 +00 +0f +24 +26 +1e +18 +00 +00 +0f +24 +26 +1e +18 +00 +00 +0f +25 +4c +e7 +10 +05 +0f +25 +4c +2e +20 +00 +00 +05 +0f +25 +4c +36 +30 +00 +00 +05 +0f +25 +4e +e7 +10 +05 +0f +25 +4e +2e +20 +00 +00 +05 +0f +25 +4e +36 +30 +00 +00 +05 +0f +25 +4f +e7 +10 +05 +0f +25 +4f +2e +20 +00 +00 +05 +0f +25 +4f +36 +30 +00 +00 +05 +0f +25 +6c +e7 +10 +05 +0f +25 +6c +2e +20 +00 +00 +05 +0f +25 +6c +36 +30 +00 +00 +05 +0f +25 +6e +e7 +10 +05 +0f +25 +6e +2e +20 +00 +00 +05 +0f +25 +6e +36 +30 +00 +00 +05 +0f +25 +6f +e7 +10 +05 +0f +25 +6f +2e +20 +00 +00 +05 +0f +25 +6f +36 +30 +00 +00 +05 +0f +25 +6d +e7 +10 +05 +0f +25 +6d +2e +20 +00 +00 +05 +0f +25 +6d +36 +30 +00 +00 +05 +0f +25 +4d +e7 +10 +05 +0f +25 +4d +2e +20 +00 +00 +05 +0f +25 +4d +36 +30 +00 +00 +05 +0f +24 +21 +d3 +10 +0f +24 +21 +16 +10 +00 +00 +0f +24 +21 +16 +10 +00 +00 +0f +24 +21 +1e +18 +00 +00 +0f +24 +21 +1e +18 +00 +00 +0f +24 +25 +d3 +10 +0f +24 +25 +16 +10 +00 +00 +0f +24 +25 +16 +10 +00 +00 +0f +24 +25 +1e +18 +00 +00 +0f +24 +25 +1e +18 +00 +00 +0f +24 +20 +d3 +10 +0f +24 +20 +16 +10 +00 +00 +0f +24 +20 +16 +10 +00 +00 +0f +24 +20 +1e +18 +00 +00 +0f +24 +20 +1e +18 +00 +00 +0f +24 +24 +d3 +10 +0f +24 +24 +16 +10 +00 +00 +0f +24 +24 +16 +10 +00 +00 +0f +24 +24 +1e +18 +00 +00 +0f +24 +24 +1e +18 +00 +00 +0f +7a +42 +ca +0f +7a +42 +0e +00 +00 +0f +7a +42 +0e +00 +00 +0f +7a +43 +ca +0f +7a +43 +0e +00 +00 +0f +7a +43 +0e +00 +00 +0f +7a +41 +ca +0f +7a +41 +0e +00 +00 +0f +7a +41 +0e +00 +00 +0f +7a +4b +ca +0f +7a +4b +0e +00 +00 +0f +7a +4b +0e +00 +00 +0f +7a +52 +ca +0f +7a +52 +0e +00 +00 +0f +7a +52 +0e +00 +00 +0f +7a +53 +ca +0f +7a +53 +0e +00 +00 +0f +7a +53 +0e +00 +00 +0f +7a +51 +ca +0f +7a +51 +0e +00 +00 +0f +7a +51 +0e +00 +00 +0f +7a +5b +ca +0f +7a +5b +0e +00 +00 +0f +7a +5b +0e +00 +00 +0f +7a +56 +ca +0f +7a +56 +0e +00 +00 +0f +7a +56 +0e +00 +00 +0f +7a +57 +ca +0f +7a +57 +0e +00 +00 +0f +7a +57 +0e +00 +00 +0f +7a +46 +ca +0f +7a +46 +0e +00 +00 +0f +7a +46 +0e +00 +00 +0f +7a +47 +ca +0f +7a +47 +0e +00 +00 +0f +7a +47 +0e +00 +00 +0f +7a +61 +ca +0f +7a +61 +0e +00 +00 +0f +7a +61 +0e +00 +00 +0f +7a +63 +ca +0f +7a +63 +0e +00 +00 +0f +7a +63 +0e +00 +00 +0f +7a +62 +ca +0f +7a +62 +0e +00 +00 +0f +7a +62 +0e +00 +00 +0f +24 +9e +e7 +10 +0f +24 +9e +2e +20 +00 +00 +0f +24 +9e +36 +30 +00 +00 +0f +24 +9f +e7 +10 +0f +24 +9f +2e +20 +00 +00 +0f +24 +9f +36 +30 +00 +00 +0f +24 +97 +e7 +10 +0f +24 +97 +2e +20 +00 +00 +0f +24 +97 +36 +30 +00 +00 +0f +24 +8e +e7 +10 +0f +24 +8e +2e +20 +00 +00 +0f +24 +8e +36 +30 +00 +00 +0f +24 +8f +e7 +10 +0f +24 +8f +2e +20 +00 +00 +0f +24 +8f +36 +30 +00 +00 +0f +24 +87 +e7 +10 +0f +24 +87 +2e +20 +00 +00 +0f +24 +87 +36 +30 +00 +00 +0f +24 +86 +e7 +10 +0f +24 +86 +2e +20 +00 +00 +0f +24 +86 +36 +30 +00 +00 +0f +24 +85 +e7 +10 +0f +24 +85 +2e +20 +00 +00 +0f +24 +85 +36 +30 +00 +00 +0f +24 +96 +e7 +10 +0f +24 +96 +2e +20 +00 +00 +0f +24 +96 +36 +30 +00 +00 +0f +24 +95 +e7 +10 +0f +24 +95 +2e +20 +00 +00 +0f +24 +95 +36 +30 +00 +00 +0f +24 +a6 +e7 +10 +0f +24 +a6 +2e +20 +00 +00 +0f +24 +a6 +36 +30 +00 +00 +0f +24 +b6 +e7 +10 +0f +24 +b6 +2e +20 +00 +00 +0f +24 +b6 +36 +30 +00 +00 +0f +24 +23 +d3 +10 +0f +24 +23 +16 +10 +00 +00 +0f +24 +23 +16 +10 +00 +00 +0f +24 +23 +1e +18 +00 +00 +0f +24 +23 +1e +18 +00 +00 +0f +24 +27 +d3 +10 +0f +24 +27 +16 +10 +00 +00 +0f +24 +27 +16 +10 +00 +00 +0f +24 +27 +1e +18 +00 +00 +0f +24 +27 +1e +18 +00 +00 +0f +24 +40 +d3 +10 +0f +24 +40 +16 +10 +00 +00 +0f +24 +40 +16 +10 +00 +00 +0f +24 +40 +1e +18 +00 +00 +0f +24 +40 +1e +18 +00 +00 +0f +7b +40 +ca +05 +0f +7b +40 +0e +00 +00 +05 +0f +7b +40 +0e +00 +00 +05 +0f +24 +42 +d3 +10 +0f +24 +42 +16 +10 +00 +00 +0f +24 +42 +16 +10 +00 +00 +0f +24 +42 +1e +18 +00 +00 +0f +24 +42 +1e +18 +00 +00 +0f +7b +42 +ca +05 +0f +7b +42 +0e +00 +00 +05 +0f +7b +42 +0e +00 +00 +05 +0f +24 +43 +d3 +10 +0f +24 +43 +16 +10 +00 +00 +0f +24 +43 +16 +10 +00 +00 +0f +24 +43 +1e +18 +00 +00 +0f +24 +43 +1e +18 +00 +00 +0f +7b +43 +ca +05 +0f +7b +43 +0e +00 +00 +05 +0f +7b +43 +0e +00 +00 +05 +0f +24 +41 +d3 +10 +0f +24 +41 +16 +10 +00 +00 +0f +24 +41 +16 +10 +00 +00 +0f +24 +41 +1e +18 +00 +00 +0f +24 +41 +1e +18 +00 +00 +0f +7b +41 +ca +05 +0f +7b +41 +0e +00 +00 +05 +0f +7b +41 +0e +00 +00 +05 +0f +24 +48 +d3 +10 +0f +24 +48 +16 +10 +00 +00 +0f +24 +48 +16 +10 +00 +00 +0f +24 +48 +1e +18 +00 +00 +0f +24 +48 +1e +18 +00 +00 +0f +24 +4a +d3 +10 +0f +24 +4a +16 +10 +00 +00 +0f +24 +4a +16 +10 +00 +00 +0f +24 +4a +1e +18 +00 +00 +0f +24 +4a +1e +18 +00 +00 +0f +24 +4b +d3 +10 +0f +24 +4b +16 +10 +00 +00 +0f +24 +4b +16 +10 +00 +00 +0f +24 +4b +1e +18 +00 +00 +0f +24 +4b +1e +18 +00 +00 +0f +24 +49 +d3 +10 +0f +24 +49 +16 +10 +00 +00 +0f +24 +49 +16 +10 +00 +00 +0f +24 +49 +1e +18 +00 +00 +0f +24 +49 +1e +18 +00 +00 +0f +24 +44 +d3 +10 +0f +24 +44 +16 +10 +00 +00 +0f +24 +44 +16 +10 +00 +00 +0f +24 +44 +1e +18 +00 +00 +0f +24 +44 +1e +18 +00 +00 +0f +24 +46 +d3 +10 +0f +24 +46 +16 +10 +00 +00 +0f +24 +46 +16 +10 +00 +00 +0f +24 +46 +1e +18 +00 +00 +0f +24 +46 +1e +18 +00 +00 +0f +24 +47 +d3 +10 +0f +24 +47 +16 +10 +00 +00 +0f +24 +47 +16 +10 +00 +00 +0f +24 +47 +1e +18 +00 +00 +0f +24 +47 +1e +18 +00 +00 +0f +24 +45 +d3 +10 +0f +24 +45 +16 +10 +00 +00 +0f +24 +45 +16 +10 +00 +00 +0f +24 +45 +1e +18 +00 +00 +0f +24 +45 +1e +18 +00 +00 +66 +0f +38 +17 +ca +66 +0f +38 +17 +0e +00 +00 +66 +0f +38 +17 +0e +00 +00 +66 +0f +3a +09 +ca +05 +66 +0f +3a +09 +0e +00 +00 +05 +66 +0f +3a +09 +0e +00 +00 +05 +66 +0f +3a +08 +ca +05 +66 +0f +3a +08 +0e +00 +00 +05 +66 +0f +3a +08 +0e +00 +00 +05 +66 +0f +3a +0b +ca +05 +66 +0f +3a +0b +0e +00 +00 +05 +66 +0f +3a +0b +0e +00 +00 +05 +66 +0f +3a +0a +ca +05 +66 +0f +3a +0a +0e +00 +00 +05 +66 +0f +3a +0a +0e +00 +00 +05 diff --git a/modules/arch/x86/tests/sse5-basic.asm b/modules/arch/x86/tests/sse5-basic.asm new file mode 100644 index 00000000..ed79e77e --- /dev/null +++ b/modules/arch/x86/tests/sse5-basic.asm @@ -0,0 +1,12 @@ +[bits 32] +compd xmm1, xmm4, xmm7, 5 ; 0F 25 2D 347 10 05 +compd xmm2, xmm5, [0], byte 5 ; 0F 25 2D 055 20 00 00 00 00 05 +compd xmm3, xmm6, dqword [ebx+ecx*4], byte 5 ; 0F 25 2D 064 213 30 05 + +[bits 64] +compd xmm8, xmm11, xmm3, 5 ; 0F 25 2D 333 84 05 +compd xmm12, xmm4, xmm14, 5 ; 0F 25 2D 346 C1 05 +compd xmm9, xmm12, [0], byte 5 ; 0F 25 2D 044 045 94 00 00 00 00 05 +compd xmm9, xmm12, [r8], byte 5 ; 0F 25 2D 040 95 05 +compd xmm10, xmm13, dqword [rbx+r9*4], 5 ; 0F 25 2D 054 213 A6 05 + diff --git a/modules/arch/x86/tests/sse5-basic.hex b/modules/arch/x86/tests/sse5-basic.hex new file mode 100644 index 00000000..2d6c87b6 --- /dev/null +++ b/modules/arch/x86/tests/sse5-basic.hex @@ -0,0 +1,59 @@ +0f +25 +2d +e7 +10 +05 +0f +25 +2d +2d +20 +00 +00 +00 +00 +05 +0f +25 +2d +34 +8b +30 +05 +0f +25 +2d +db +84 +05 +0f +25 +2d +e6 +c1 +05 +0f +25 +2d +24 +25 +94 +00 +00 +00 +00 +05 +0f +25 +2d +20 +95 +05 +0f +25 +2d +2c +8b +a6 +05 diff --git a/modules/arch/x86/tests/sse5-err.asm b/modules/arch/x86/tests/sse5-err.asm new file mode 100644 index 00000000..93b474fa --- /dev/null +++ b/modules/arch/x86/tests/sse5-err.asm @@ -0,0 +1,116 @@ +fmaddpd xmm1, xmm2, xmm1, xmm3 ; illegal +fmaddpd xmm1, xmm2, xmm3, xmm3 ; illegal +fmaddpd xmm1, xmm2, xmm2, xmm3 ; illegal + +fmaddps xmm1, xmm2, xmm1, xmm3 ; illegal +fmaddps xmm1, xmm2, xmm3, xmm3 ; illegal +fmaddps xmm1, xmm2, xmm2, xmm3 ; illegal + +fmaddsd xmm1, xmm2, xmm1, xmm3 ; illegal +fmaddsd xmm1, xmm2, xmm3, xmm3 ; illegal +fmaddsd xmm1, xmm2, xmm2, xmm3 ; illegal + +fmaddss xmm1, xmm2, xmm1, xmm3 ; illegal +fmaddss xmm1, xmm2, xmm3, xmm3 ; illegal +fmaddss xmm1, xmm2, xmm2, xmm3 ; illegal + +fmsubpd xmm1, xmm2, xmm1, xmm3 ; illegal +fmsubpd xmm1, xmm2, xmm3, xmm3 ; illegal +fmsubpd xmm1, xmm2, xmm2, xmm3 ; illegal + +fmsubps xmm1, xmm2, xmm1, xmm3 ; illegal +fmsubps xmm1, xmm2, xmm3, xmm3 ; illegal +fmsubps xmm1, xmm2, xmm2, xmm3 ; illegal + +fmsubsd xmm1, xmm2, xmm1, xmm3 ; illegal +fmsubsd xmm1, xmm2, xmm3, xmm3 ; illegal +fmsubsd xmm1, xmm2, xmm2, xmm3 ; illegal + +fmsubss xmm1, xmm2, xmm1, xmm3 ; illegal +fmsubss xmm1, xmm2, xmm3, xmm3 ; illegal +fmsubss xmm1, xmm2, xmm2, xmm3 ; illegal + +fnmaddpd xmm1, xmm2, xmm1, xmm3 ; illegal +fnmaddpd xmm1, xmm2, xmm3, xmm3 ; illegal +fnmaddpd xmm1, xmm2, xmm2, xmm3 ; illegal + +fnmaddps xmm1, xmm2, xmm1, xmm3 ; illegal +fnmaddps xmm1, xmm2, xmm3, xmm3 ; illegal +fnmaddps xmm1, xmm2, xmm2, xmm3 ; illegal + +fnmaddsd xmm1, xmm2, xmm1, xmm3 ; illegal +fnmaddsd xmm1, xmm2, xmm3, xmm3 ; illegal +fnmaddsd xmm1, xmm2, xmm2, xmm3 ; illegal + +fnmaddss xmm1, xmm2, xmm1, xmm3 ; illegal +fnmaddss xmm1, xmm2, xmm3, xmm3 ; illegal +fnmaddss xmm1, xmm2, xmm2, xmm3 ; illegal + +fnmsubpd xmm1, xmm2, xmm1, xmm3 ; illegal +fnmsubpd xmm1, xmm2, xmm3, xmm3 ; illegal +fnmsubpd xmm1, xmm2, xmm2, xmm3 ; illegal + +fnmsubps xmm1, xmm2, xmm1, xmm3 ; illegal +fnmsubps xmm1, xmm2, xmm3, xmm3 ; illegal +fnmsubps xmm1, xmm2, xmm2, xmm3 ; illegal + +fnmsubsd xmm1, xmm2, xmm1, xmm3 ; illegal +fnmsubsd xmm1, xmm2, xmm3, xmm3 ; illegal +fnmsubsd xmm1, xmm2, xmm2, xmm3 ; illegal + +fnmsubss xmm1, xmm2, xmm1, xmm3 ; illegal +fnmsubss xmm1, xmm2, xmm3, xmm3 ; illegal +fnmsubss xmm1, xmm2, xmm2, xmm3 ; illegal + +pcmov xmm1, xmm2, xmm1, xmm3 ; illegal +pcmov xmm1, xmm2, xmm3, xmm3 ; illegal +pcmov xmm1, xmm2, xmm2, xmm3 ; illegal + +permpd xmm1, xmm2, xmm1, xmm3 ; illegal +permpd xmm1, xmm2, xmm3, xmm3 ; illegal +permpd xmm1, xmm2, xmm2, xmm3 ; illegal + +permps xmm1, xmm2, xmm1, xmm3 ; illegal +permps xmm1, xmm2, xmm3, xmm3 ; illegal +permps xmm1, xmm2, xmm2, xmm3 ; illegal + +pmacsdd xmm1, xmm2, xmm1, xmm3 ; illegal +pmacsdd xmm1, xmm1, xmm2, xmm3 ; illegal - better message? + +pmacsdqh xmm1, xmm2, xmm1, xmm3 ; illegal +pmacsdqh xmm1, xmm1, xmm2, xmm3 ; illegal - better message? + +pmacsdql xmm1, xmm2, xmm1, xmm3 ; illegal +pmacsdql xmm1, xmm1, xmm2, xmm3 ; illegal - better message? + +pmacssdd xmm1, xmm2, xmm1, xmm3 ; illegal +pmacssdd xmm1, xmm1, xmm2, xmm3 ; illegal - better message? + +pmacssdqh xmm1, xmm2, xmm1, xmm3 ; illegal +pmacssdqh xmm1, xmm1, xmm2, xmm3 ; illegal - better message? + +pmacssdql xmm1, xmm2, xmm1, xmm3 ; illegal +pmacssdql xmm1, xmm1, xmm2, xmm3 ; illegal - better message? + +pmacsswd xmm1, xmm2, xmm1, xmm3 ; illegal +pmacsswd xmm1, xmm1, xmm2, xmm3 ; illegal - better message? + +pmacssww xmm1, xmm2, xmm1, xmm3 ; illegal +pmacssww xmm1, xmm1, xmm2, xmm3 ; illegal - better message? + +pmacswd xmm1, xmm2, xmm1, xmm3 ; illegal +pmacswd xmm1, xmm1, xmm2, xmm3 ; illegal - better message? + +pmacsww xmm1, xmm2, xmm1, xmm3 ; illegal +pmacsww xmm1, xmm1, xmm2, xmm3 ; illegal - better message? + +pmadcsswd xmm1, xmm2, xmm1, xmm3 ; illegal +pmadcsswd xmm1, xmm1, xmm2, xmm3 ; illegal - better message? + +pmadcswd xmm1, xmm2, xmm1, xmm3 ; illegal +pmadcswd xmm1, xmm1, xmm2, xmm3 ; illegal - better message? + +pperm xmm1, xmm2, xmm1, xmm3 ; illegal +pperm xmm1, xmm2, xmm3, xmm3 ; illegal +pperm xmm1, xmm2, xmm2, xmm3 ; illegal + diff --git a/modules/arch/x86/tests/sse5-err.errwarn b/modules/arch/x86/tests/sse5-err.errwarn new file mode 100644 index 00000000..19df6e09 --- /dev/null +++ b/modules/arch/x86/tests/sse5-err.errwarn @@ -0,0 +1,84 @@ +-:1: one of source operand 1 or 3 must match dest operand +-:2: one of source operand 1 or 3 must match dest operand +-:3: one of source operand 1 or 3 must match dest operand +-:5: one of source operand 1 or 3 must match dest operand +-:6: one of source operand 1 or 3 must match dest operand +-:7: one of source operand 1 or 3 must match dest operand +-:9: one of source operand 1 or 3 must match dest operand +-:10: one of source operand 1 or 3 must match dest operand +-:11: one of source operand 1 or 3 must match dest operand +-:13: one of source operand 1 or 3 must match dest operand +-:14: one of source operand 1 or 3 must match dest operand +-:15: one of source operand 1 or 3 must match dest operand +-:17: one of source operand 1 or 3 must match dest operand +-:18: one of source operand 1 or 3 must match dest operand +-:19: one of source operand 1 or 3 must match dest operand +-:21: one of source operand 1 or 3 must match dest operand +-:22: one of source operand 1 or 3 must match dest operand +-:23: one of source operand 1 or 3 must match dest operand +-:25: one of source operand 1 or 3 must match dest operand +-:26: one of source operand 1 or 3 must match dest operand +-:27: one of source operand 1 or 3 must match dest operand +-:29: one of source operand 1 or 3 must match dest operand +-:30: one of source operand 1 or 3 must match dest operand +-:31: one of source operand 1 or 3 must match dest operand +-:33: one of source operand 1 or 3 must match dest operand +-:34: one of source operand 1 or 3 must match dest operand +-:35: one of source operand 1 or 3 must match dest operand +-:37: one of source operand 1 or 3 must match dest operand +-:38: one of source operand 1 or 3 must match dest operand +-:39: one of source operand 1 or 3 must match dest operand +-:41: one of source operand 1 or 3 must match dest operand +-:42: one of source operand 1 or 3 must match dest operand +-:43: one of source operand 1 or 3 must match dest operand +-:45: one of source operand 1 or 3 must match dest operand +-:46: one of source operand 1 or 3 must match dest operand +-:47: one of source operand 1 or 3 must match dest operand +-:49: one of source operand 1 or 3 must match dest operand +-:50: one of source operand 1 or 3 must match dest operand +-:51: one of source operand 1 or 3 must match dest operand +-:53: one of source operand 1 or 3 must match dest operand +-:54: one of source operand 1 or 3 must match dest operand +-:55: one of source operand 1 or 3 must match dest operand +-:57: one of source operand 1 or 3 must match dest operand +-:58: one of source operand 1 or 3 must match dest operand +-:59: one of source operand 1 or 3 must match dest operand +-:61: one of source operand 1 or 3 must match dest operand +-:62: one of source operand 1 or 3 must match dest operand +-:63: one of source operand 1 or 3 must match dest operand +-:65: one of source operand 1 or 3 must match dest operand +-:66: one of source operand 1 or 3 must match dest operand +-:67: one of source operand 1 or 3 must match dest operand +-:69: one of source operand 1 or 3 must match dest operand +-:70: one of source operand 1 or 3 must match dest operand +-:71: one of source operand 1 or 3 must match dest operand +-:73: one of source operand 1 or 3 must match dest operand +-:74: one of source operand 1 or 3 must match dest operand +-:75: one of source operand 1 or 3 must match dest operand +-:77: one of source operand 1 or 3 must match dest operand +-:78: one of source operand 1 or 3 must match dest operand +-:80: one of source operand 1 or 3 must match dest operand +-:81: one of source operand 1 or 3 must match dest operand +-:83: one of source operand 1 or 3 must match dest operand +-:84: one of source operand 1 or 3 must match dest operand +-:86: one of source operand 1 or 3 must match dest operand +-:87: one of source operand 1 or 3 must match dest operand +-:89: one of source operand 1 or 3 must match dest operand +-:90: one of source operand 1 or 3 must match dest operand +-:92: one of source operand 1 or 3 must match dest operand +-:93: one of source operand 1 or 3 must match dest operand +-:95: one of source operand 1 or 3 must match dest operand +-:96: one of source operand 1 or 3 must match dest operand +-:98: one of source operand 1 or 3 must match dest operand +-:99: one of source operand 1 or 3 must match dest operand +-:101: one of source operand 1 or 3 must match dest operand +-:102: one of source operand 1 or 3 must match dest operand +-:104: one of source operand 1 or 3 must match dest operand +-:105: one of source operand 1 or 3 must match dest operand +-:107: one of source operand 1 or 3 must match dest operand +-:108: one of source operand 1 or 3 must match dest operand +-:110: one of source operand 1 or 3 must match dest operand +-:111: one of source operand 1 or 3 must match dest operand +-:113: one of source operand 1 or 3 must match dest operand +-:114: one of source operand 1 or 3 must match dest operand +-:115: one of source operand 1 or 3 must match dest operand diff --git a/modules/arch/x86/x86arch.h b/modules/arch/x86/x86arch.h index 5f5be1c0..705933c0 100644 --- a/modules/arch/x86/x86arch.h +++ b/modules/arch/x86/x86arch.h @@ -64,6 +64,7 @@ #define CPU_SSE41 30 /* Streaming SIMD extensions 4.1 required */ #define CPU_SSE42 31 /* Streaming SIMD extensions 4.2 required */ #define CPU_SSE4a 32 /* AMD Streaming SIMD extensions 4a required */ +#define CPU_SSE5 33 /* AMD Streaming SIMD extensions 5 required */ /* Technically not CPU capabilities, they do affect what instructions are * available. These are tested against BITS==64. @@ -142,9 +143,9 @@ typedef enum { * indicates bit of REX to use if REX is needed. Will not modify REX if not * in 64-bit mode or if it wasn't needed to express reg. */ -int yasm_x86__set_rex_from_reg(unsigned char *rex, unsigned char *low3, - uintptr_t reg, unsigned int bits, - x86_rex_bit_pos rexbit); +int yasm_x86__set_rex_from_reg(unsigned char *rex, unsigned char *drex, + unsigned char *low3, uintptr_t reg, + unsigned int bits, x86_rex_bit_pos rexbit); /* Effective address type */ typedef struct x86_effaddr { @@ -162,14 +163,19 @@ typedef struct x86_effaddr { unsigned char valid_sib; /* 1 if SIB byte currently valid, 0 if not */ unsigned char need_sib; /* 1 if SIB byte needed, 0 if not, 0xff if unknown */ + + unsigned char drex; /* DREX SSE5 extension byte */ + unsigned char need_drex; /* 1 if DREX byte needed, 0 if not */ } x86_effaddr; void yasm_x86__ea_init(x86_effaddr *x86_ea, unsigned int spare, + unsigned int drex, unsigned int need_drex, yasm_bytecode *precbc); void yasm_x86__ea_set_disponly(x86_effaddr *x86_ea); x86_effaddr *yasm_x86__ea_create_reg(x86_effaddr *x86_ea, unsigned long reg, - unsigned char *rex, unsigned int bits); + unsigned char *rex, unsigned char *drex, + unsigned int bits); x86_effaddr *yasm_x86__ea_create_imm (x86_effaddr *x86_ea, /*@keep@*/ yasm_expr *imm, unsigned int im_len); yasm_effaddr *yasm_x86__ea_create_expr(yasm_arch *arch, diff --git a/modules/arch/x86/x86bc.c b/modules/arch/x86/x86bc.c index a01031d9..4319318b 100644 --- a/modules/arch/x86/x86bc.c +++ b/modules/arch/x86/x86bc.c @@ -103,9 +103,9 @@ static const yasm_bytecode_callback x86_bc_callback_jmpfar = { }; int -yasm_x86__set_rex_from_reg(unsigned char *rex, unsigned char *low3, - uintptr_t reg, unsigned int bits, - x86_rex_bit_pos rexbit) +yasm_x86__set_rex_from_reg(unsigned char *rex, unsigned char *drex, + unsigned char *low3, uintptr_t reg, + unsigned int bits, x86_rex_bit_pos rexbit) { *low3 = (unsigned char)(reg&7); @@ -113,13 +113,17 @@ yasm_x86__set_rex_from_reg(unsigned char *rex, unsigned char *low3, x86_expritem_reg_size size = (x86_expritem_reg_size)(reg & ~0xFUL); if (size == X86_REG8X || (reg & 0xF) >= 8) { - /* Check to make sure we can set it */ - if (*rex == 0xff) { - yasm_error_set(YASM_ERROR_TYPE, - N_("cannot use A/B/C/DH with instruction needing REX")); - return 1; + if (drex) { + *drex |= ((reg & 8) >> 3) << rexbit; + } else { + /* Check to make sure we can set it */ + if (*rex == 0xff) { + yasm_error_set(YASM_ERROR_TYPE, + N_("cannot use A/B/C/DH with instruction needing REX")); + return 1; + } + *rex |= 0x40 | (((reg & 8) >> 3) << rexbit); } - *rex |= 0x40 | (((reg & 8) >> 3) << rexbit); } else if (size == X86_REG8 && (reg & 7) >= 4) { /* AH/BH/CH/DH, so no REX allowed */ if (*rex != 0 && *rex != 0xff) { @@ -153,14 +157,16 @@ yasm_x86__bc_transform_jmpfar(yasm_bytecode *bc, x86_jmpfar *jmpfar) } void -yasm_x86__ea_init(x86_effaddr *x86_ea, unsigned int spare, - yasm_bytecode *precbc) +yasm_x86__ea_init(x86_effaddr *x86_ea, unsigned int spare, unsigned int drex, + unsigned int need_drex, yasm_bytecode *precbc) { if (yasm_value_finalize(&x86_ea->ea.disp, precbc)) yasm_error_set(YASM_ERROR_TOO_COMPLEX, N_("effective address too complex")); x86_ea->modrm &= 0xC7; /* zero spare/reg bits */ x86_ea->modrm |= (spare << 3) & 0x38; /* plug in provided bits */ + x86_ea->drex = (unsigned char)drex; + x86_ea->need_drex = (unsigned char)need_drex; } void @@ -170,6 +176,7 @@ yasm_x86__ea_set_disponly(x86_effaddr *x86_ea) x86_ea->need_modrm = 0; x86_ea->valid_sib = 0; x86_ea->need_sib = 0; + x86_ea->need_drex = 0; } static x86_effaddr * @@ -189,17 +196,20 @@ ea_create(void) x86_ea->sib = 0; x86_ea->valid_sib = 0; x86_ea->need_sib = 0; + x86_ea->drex = 0; + x86_ea->need_drex = 0; return x86_ea; } x86_effaddr * yasm_x86__ea_create_reg(x86_effaddr *x86_ea, unsigned long reg, - unsigned char *rex, unsigned int bits) + unsigned char *rex, unsigned char *drex, + unsigned int bits) { unsigned char rm; - if (yasm_x86__set_rex_from_reg(rex, &rm, reg, bits, X86_REX_B)) + if (yasm_x86__set_rex_from_reg(rex, drex, &rm, reg, bits, X86_REX_B)) return NULL; if (!x86_ea) @@ -539,6 +549,7 @@ x86_bc_insn_calc_len(yasm_bytecode *bc, yasm_bc_add_span_func add_span, /* Compute length of ea and add to total */ bc->len += x86_ea->need_modrm + (x86_ea->need_sib ? 1:0); + bc->len += x86_ea->need_drex ? 1:0; bc->len += (x86_ea->ea.segreg != 0) ? 1 : 0; } @@ -807,6 +818,9 @@ x86_bc_insn_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, YASM_WRITE_8(*bufp, x86_ea->sib); } + if (x86_ea->need_drex) + YASM_WRITE_8(*bufp, x86_ea->drex); + if (x86_ea->ea.need_disp) { unsigned int disp_len = x86_ea->ea.disp.size/8; diff --git a/modules/arch/x86/x86cpu.gperf b/modules/arch/x86/x86cpu.gperf index ed2b5232..3597b535 100644 --- a/modules/arch/x86/x86cpu.gperf +++ b/modules/arch/x86/x86cpu.gperf @@ -118,6 +118,7 @@ x86_cpu_ia64(wordptr cpu, unsigned int data) BitVector_Bit_On(cpu, CPU_086); } +#define PROC_bulldozer 11 #define PROC_k10 10 #define PROC_venice 9 #define PROC_hammer 8 @@ -133,6 +134,8 @@ x86_cpu_amd(wordptr cpu, unsigned int data) BitVector_Bit_On(cpu, CPU_Prot); BitVector_Bit_On(cpu, CPU_SMM); BitVector_Bit_On(cpu, CPU_3DNow); + if (data >= PROC_bulldozer) + BitVector_Bit_On(cpu, CPU_SSE5); if (data >= PROC_k10) BitVector_Bit_On(cpu, CPU_SSE4a); if (data >= PROC_venice) @@ -254,6 +257,7 @@ athlon64, x86_cpu_amd, PROC_hammer athlon-64, x86_cpu_amd, PROC_hammer venice, x86_cpu_amd, PROC_venice k10, x86_cpu_amd, PROC_k10 +bulldozer, x86_cpu_amd, PROC_bulldozer prescott, x86_cpu_intel, PROC_prescott conroe, x86_cpu_intel, PROC_conroe penryn, x86_cpu_intel, PROC_penryn @@ -318,6 +322,8 @@ sse4a, x86_cpu_set, CPU_SSE4a nosse4a, x86_cpu_clear, CPU_SSE4a sse4, x86_cpu_set_sse4, 0 nosse4, x86_cpu_clear_sse4, 0 +sse5, x86_cpu_set, CPU_SSE5 +nosse5, x86_cpu_clear, CPU_SSE5 %% void diff --git a/modules/arch/x86/x86expr.c b/modules/arch/x86/x86expr.c index 8d11b1ab..eb145e7a 100644 --- a/modules/arch/x86/x86expr.c +++ b/modules/arch/x86/x86expr.c @@ -549,6 +549,7 @@ yasm_x86__expr_checkea(x86_effaddr *x86_ea, unsigned char *addrsize, yasm_bytecode *bc) { int retval; + unsigned char *drex = x86_ea->need_drex ? &x86_ea->drex : NULL; if (*addrsize == 0) { /* we need to figure out the address size from what we know about: @@ -784,7 +785,7 @@ yasm_x86__expr_checkea(x86_effaddr *x86_ea, unsigned char *addrsize, * of register basereg is, as x86_set_rex_from_reg doesn't pay * much attention. */ - if (yasm_x86__set_rex_from_reg(rex, &low3, + if (yasm_x86__set_rex_from_reg(rex, drex, &low3, (unsigned int)(X86_REG64 | basereg), bits, X86_REX_B)) return 1; @@ -811,7 +812,7 @@ yasm_x86__expr_checkea(x86_effaddr *x86_ea, unsigned char *addrsize, if (basereg == REG3264_NONE) x86_ea->sib |= 5; else { - if (yasm_x86__set_rex_from_reg(rex, &low3, (unsigned int) + if (yasm_x86__set_rex_from_reg(rex, drex, &low3, (unsigned int) (X86_REG64 | basereg), bits, X86_REX_B)) return 1; @@ -823,7 +824,7 @@ yasm_x86__expr_checkea(x86_effaddr *x86_ea, unsigned char *addrsize, x86_ea->sib |= 040; /* Any scale field is valid, just leave at 0. */ else { - if (yasm_x86__set_rex_from_reg(rex, &low3, (unsigned int) + if (yasm_x86__set_rex_from_reg(rex, drex, &low3, (unsigned int) (X86_REG64 | indexreg), bits, X86_REX_X)) return 1; diff --git a/modules/arch/x86/x86id.c b/modules/arch/x86/x86id.c index fa01e8ca..739c8679 100644 --- a/modules/arch/x86/x86id.c +++ b/modules/arch/x86/x86id.c @@ -103,7 +103,9 @@ enum x86_operand_type { */ OPT_MemrAX = 25, /* EAX memory operand only (EA) [special case for SVM skinit opcode] */ - OPT_MemEAX = 26 + OPT_MemEAX = 26, + /* SIMDReg with value equal to operand 0 SIMDReg */ + OPT_SIMDRegMatch0 = 27 }; enum x86_operand_size { @@ -150,7 +152,8 @@ enum x86_operand_action { /* far jump (outputs a farjmp instead of normal insn) */ OPA_JmpFar = 10, /* ea operand only sets address size (no actual ea field) */ - OPA_AdSizeEA = 11 + OPA_AdSizeEA = 11, + OPA_DREX = 12 /* operand data goes into DREX "dest" field */ }; enum x86_operand_post_action { @@ -244,6 +247,14 @@ typedef struct x86_insn_info { */ unsigned char special_prefix; + /* The DREX base byte value (almost). The only bit kept from this + * value is the OC0 bit (0x08). The MSB (0x80) of this value indicates + * if the DREX byte needs to be present in the instruction. + */ +#define NEED_DREX_MASK 0x80 +#define DREX_OC0_MASK 0x08 + unsigned char drex_oc0; + /* The length of the basic opcode */ unsigned char opcode_len; @@ -565,7 +576,7 @@ x86_find_match(x86_id_insn *id_insn, yasm_insn_operand **ops, cpu1 = CPU_Any; if (cpu2 == CPU_64 || cpu2 == CPU_Not64) cpu2 = CPU_Any; - if (bypass != 7 && (!BitVector_bit_test(id_insn->cpu_enabled, cpu0) || + if (bypass != 8 && (!BitVector_bit_test(id_insn->cpu_enabled, cpu0) || !BitVector_bit_test(id_insn->cpu_enabled, cpu1) || !BitVector_bit_test(id_insn->cpu_enabled, cpu2))) continue; @@ -634,6 +645,7 @@ x86_find_match(x86_id_insn *id_insn, yasm_insn_operand **ops, if (op->type == YASM_INSN__OPERAND_MEMORY) break; /*@fallthrough@*/ + case OPT_SIMDRegMatch0: case OPT_SIMDReg: if (op->type != YASM_INSN__OPERAND_REG) mismatch = 1; @@ -647,6 +659,9 @@ x86_find_match(x86_id_insn *id_insn, yasm_insn_operand **ops, break; } } + if (!mismatch && info_ops[i].type == OPT_SIMDRegMatch0 && + bypass != 7 && op->data.reg != use_ops[0]->data.reg) + mismatch = 1; break; case OPT_SegReg: if (op->type != YASM_INSN__OPERAND_SEGREG) @@ -912,7 +927,7 @@ x86_match_error(x86_id_insn *id_insn, yasm_insn_operand **ops, return; } - for (bypass=1; bypass<8; bypass++) { + for (bypass=1; bypass<9; bypass++) { i = x86_find_match(id_insn, ops, rev_ops, size_lookup, bypass); if (i) break; @@ -935,6 +950,10 @@ x86_match_error(x86_id_insn *id_insn, yasm_insn_operand **ops, N_("invalid size for operand %d"), 3); break; case 7: + yasm_error_set(YASM_ERROR_TYPE, + N_("one of source operand 1 or 3 must match dest operand")); + break; + case 8: { unsigned int cpu0 = i->cpu0, cpu1 = i->cpu1, cpu2 = i->cpu2; yasm_error_set(YASM_ERROR_TYPE, @@ -961,6 +980,8 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) unsigned char im_len; unsigned char im_sign; unsigned char spare; + unsigned char drex; + unsigned char *pdrex; unsigned int i; unsigned int size_lookup[] = {0, 8, 16, 32, 64, 80, 128, 0}; unsigned long do_postop = 0; @@ -1052,10 +1073,12 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) insn->def_opersize_64 = info->def_opersize_64; insn->special_prefix = info->special_prefix; spare = info->spare; + drex = info->drex_oc0 & DREX_OC0_MASK; im_len = 0; im_sign = 0; insn->postop = X86_POSTOP_NONE; insn->rex = 0; + pdrex = (info->drex_oc0 & NEED_DREX_MASK) ? &drex : NULL; /* Apply modifiers */ for (i=0; imodifiers); i++) { @@ -1137,7 +1160,7 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) insn->x86_ea = yasm_x86__ea_create_reg(insn->x86_ea, (unsigned long)op->data.reg, &insn->rex, - mode_bits); + pdrex, mode_bits); break; case YASM_INSN__OPERAND_SEGREG: yasm_internal_error( @@ -1175,8 +1198,8 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) if (op->type == YASM_INSN__OPERAND_SEGREG) spare = (unsigned char)(op->data.reg&7); else if (op->type == YASM_INSN__OPERAND_REG) { - if (yasm_x86__set_rex_from_reg(&insn->rex, &spare, - op->data.reg, mode_bits, X86_REX_R)) + if (yasm_x86__set_rex_from_reg(&insn->rex, pdrex, + &spare, op->data.reg, mode_bits, X86_REX_R)) return; } else yasm_internal_error(N_("invalid operand conversion")); @@ -1184,8 +1207,8 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) case OPA_Op0Add: if (op->type == YASM_INSN__OPERAND_REG) { unsigned char opadd; - if (yasm_x86__set_rex_from_reg(&insn->rex, &opadd, - op->data.reg, mode_bits, X86_REX_B)) + if (yasm_x86__set_rex_from_reg(&insn->rex, pdrex, + &opadd, op->data.reg, mode_bits, X86_REX_B)) return; insn->opcode.opcode[0] += opadd; } else @@ -1194,8 +1217,8 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) case OPA_Op1Add: if (op->type == YASM_INSN__OPERAND_REG) { unsigned char opadd; - if (yasm_x86__set_rex_from_reg(&insn->rex, &opadd, - op->data.reg, mode_bits, X86_REX_B)) + if (yasm_x86__set_rex_from_reg(&insn->rex, pdrex, + &opadd, op->data.reg, mode_bits, X86_REX_B)) return; insn->opcode.opcode[1] += opadd; } else @@ -1205,11 +1228,11 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) if (op->type == YASM_INSN__OPERAND_REG) { insn->x86_ea = yasm_x86__ea_create_reg(insn->x86_ea, - (unsigned long)op->data.reg, - &insn->rex, mode_bits); + (unsigned long)op->data.reg, &insn->rex, + pdrex, mode_bits); if (!insn->x86_ea || - yasm_x86__set_rex_from_reg(&insn->rex, &spare, - op->data.reg, mode_bits, X86_REX_R)) { + yasm_x86__set_rex_from_reg(&insn->rex, pdrex, + &spare, op->data.reg, mode_bits, X86_REX_R)) { if (insn->x86_ea) yasm_xfree(insn->x86_ea); yasm_xfree(insn); @@ -1242,6 +1265,10 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) yasm_x86__ea_destroy(op->data.ea); break; } + case OPA_DREX: + drex &= 0x0F; + drex |= (op->data.reg << 4) & 0xF0; + break; default: yasm_internal_error(N_("unknown operand action")); } @@ -1283,7 +1310,9 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) } if (insn->x86_ea) { - yasm_x86__ea_init(insn->x86_ea, spare, prev_bc); + yasm_x86__ea_init(insn->x86_ea, spare, drex, + (unsigned int)(info->drex_oc0 & NEED_DREX_MASK), + prev_bc); for (i=0; iinsn.num_segregs; i++) yasm_ea_set_segreg(&insn->x86_ea->ea, id_insn->insn.segregs[i]); } else if (id_insn->insn.num_segregs > 0 && insn->special_prefix == 0) { @@ -1350,7 +1379,8 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) * opcode 0 being a mov instruction! */ insn->x86_ea = yasm_x86__ea_create_reg(insn->x86_ea, - (unsigned long)insn->opcode.opcode[0]-0xB8, &rex_temp, 64); + (unsigned long)insn->opcode.opcode[0]-0xB8, &rex_temp, + NULL, 64); /* Make the imm32s form permanent. */ insn->opcode.opcode[0] = insn->opcode.opcode[1]; From 1f6c405d98e96d06fb16677c5d0c9ed2c992bcb6 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 16 Sep 2007 20:41:16 +0000 Subject: [PATCH 088/585] 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 --- libyasm/floatnum.c | 16 +++++++++++++++- modules/objfmts/bin/tests/float-err.asm | 2 +- modules/objfmts/bin/tests/float-err.errwarn | 4 ++-- modules/objfmts/bin/tests/float.asm | 2 ++ modules/objfmts/bin/tests/float.hex | 4 ++++ 5 files changed, 24 insertions(+), 4 deletions(-) diff --git a/libyasm/floatnum.c b/libyasm/floatnum.c index 951e17ca..a7cfcb7e 100644 --- a/libyasm/floatnum.c +++ b/libyasm/floatnum.c @@ -631,7 +631,17 @@ floatnum_get_common(const yasm_floatnum *flt, /*@out@*/ unsigned char *ptr, return retval; } -/* IEEE-754 (Intel) "single precision" format: +/* IEEE-754r "half precision" format: + * 16 bits: + * 15 9 Bit 0 + * | | | + * seee eemm mmmm mmmm + * + * e = bias 15 exponent + * s = sign bit + * m = mantissa bits, bit 10 is an implied one bit. + * + * IEEE-754 (Intel) "single precision" format: * 32 bits: * Bit 31 Bit 22 Bit 0 * | | | @@ -672,6 +682,9 @@ yasm_floatnum_get_sized(const yasm_floatnum *flt, unsigned char *ptr, yasm_internal_error(N_("unsupported floatnum functionality")); } switch (destsize) { + case 2: + retval = floatnum_get_common(flt, ptr, 2, 10, 1, 5); + break; case 4: retval = floatnum_get_common(flt, ptr, 4, 23, 1, 8); break; @@ -702,6 +715,7 @@ int yasm_floatnum_check_size(/*@unused@*/ const yasm_floatnum *flt, size_t size) { switch (size) { + case 16: case 32: case 64: case 80: diff --git a/modules/objfmts/bin/tests/float-err.asm b/modules/objfmts/bin/tests/float-err.asm index 56a766c2..7c608ba0 100644 --- a/modules/objfmts/bin/tests/float-err.asm +++ b/modules/objfmts/bin/tests/float-err.asm @@ -1,6 +1,6 @@ ; Tests illegal float handling db 1.2 -dw 3.14 +dw 3.14e500 dd 5.12e100000 dq 3.141592653589793e-158105 dt 5653894745.318293470142875104710284019245e-1999 diff --git a/modules/objfmts/bin/tests/float-err.errwarn b/modules/objfmts/bin/tests/float-err.errwarn index 3efe445d..33fcebec 100644 --- a/modules/objfmts/bin/tests/float-err.errwarn +++ b/modules/objfmts/bin/tests/float-err.errwarn @@ -1,8 +1,8 @@ -:2: invalid floating point constant size --:3: invalid floating point constant size +-:3: warning: overflow in floating point expression -:4: warning: overflow in floating point expression -:5: warning: underflow in floating point expression -:8: invalid floating point constant size --:9: invalid floating point constant size +-:9: warning: overflow in floating point expression -:11: warning: overflow in floating point expression -:12: warning: underflow in floating point expression diff --git a/modules/objfmts/bin/tests/float.asm b/modules/objfmts/bin/tests/float.asm index a2823f35..32d2777b 100644 --- a/modules/objfmts/bin/tests/float.asm +++ b/modules/objfmts/bin/tests/float.asm @@ -1,8 +1,10 @@ ; Tests float handling +dw 3.14 dd 5.12 dq 3.141592653589793 dt 5653894745.318293470142875104710284019245e335 +dw -62000.0 dd -47102940.467103581 dq -45102571092751092341095.5827509174509178450917845019 dt -1.e-1000 diff --git a/modules/objfmts/bin/tests/float.hex b/modules/objfmts/bin/tests/float.hex index 066fa76e..33b0d978 100644 --- a/modules/objfmts/bin/tests/float.hex +++ b/modules/objfmts/bin/tests/float.hex @@ -1,3 +1,5 @@ +48 +42 0a d7 a3 @@ -20,6 +22,8 @@ f1 97 78 44 +92 +fb f7 ae 33 From 4af823161d6b4275181bf560e41bca5dc274224d Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Mon, 17 Sep 2007 02:58:05 +0000 Subject: [PATCH 089/585] 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 --- modules/arch/x86/tests/Makefile.inc | 2 ++ modules/arch/x86/tests/mixcase.asm | 3 +++ modules/arch/x86/tests/mixcase.hex | 3 +++ modules/arch/x86/x86cpu.gperf | 8 ++++++-- modules/arch/x86/x86regtmod.gperf | 7 ++++++- 5 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 modules/arch/x86/tests/mixcase.asm create mode 100644 modules/arch/x86/tests/mixcase.hex diff --git a/modules/arch/x86/tests/Makefile.inc b/modules/arch/x86/tests/Makefile.inc index 60406bfc..c513ad17 100644 --- a/modules/arch/x86/tests/Makefile.inc +++ b/modules/arch/x86/tests/Makefile.inc @@ -84,6 +84,8 @@ EXTRA_DIST += modules/arch/x86/tests/mem64hi32.asm EXTRA_DIST += modules/arch/x86/tests/mem64hi32.hex EXTRA_DIST += modules/arch/x86/tests/mem64rip.asm EXTRA_DIST += modules/arch/x86/tests/mem64rip.hex +EXTRA_DIST += modules/arch/x86/tests/mixcase.asm +EXTRA_DIST += modules/arch/x86/tests/mixcase.hex EXTRA_DIST += modules/arch/x86/tests/movdq32.asm EXTRA_DIST += modules/arch/x86/tests/movdq32.hex EXTRA_DIST += modules/arch/x86/tests/movdq64.asm diff --git a/modules/arch/x86/tests/mixcase.asm b/modules/arch/x86/tests/mixcase.asm new file mode 100644 index 00000000..4964e721 --- /dev/null +++ b/modules/arch/x86/tests/mixcase.asm @@ -0,0 +1,3 @@ +CPU SSE5 +MOV AX,5 + diff --git a/modules/arch/x86/tests/mixcase.hex b/modules/arch/x86/tests/mixcase.hex new file mode 100644 index 00000000..76dc00b9 --- /dev/null +++ b/modules/arch/x86/tests/mixcase.hex @@ -0,0 +1,3 @@ +b8 +05 +00 diff --git a/modules/arch/x86/x86cpu.gperf b/modules/arch/x86/x86cpu.gperf index 3597b535..5878a917 100644 --- a/modules/arch/x86/x86cpu.gperf +++ b/modules/arch/x86/x86cpu.gperf @@ -332,12 +332,16 @@ yasm_x86__parse_cpu(yasm_arch_x86 *arch_x86, const char *cpuid, { /*@null@*/ const struct cpu_parse_data *pdata; wordptr new_cpu; - unsigned int i; + size_t i; + static char lcaseid[16]; if (cpuid_len > 15) return; + for (i=0; i 7) return YASM_ARCH_NOTREGTMOD; + for (i=0; i Date: Mon, 17 Sep 2007 03:42:01 +0000 Subject: [PATCH 090/585] Include ctype.h into files that now use tolower(). svn path=/trunk/yasm/; revision=1956 --- modules/arch/x86/x86cpu.gperf | 1 + modules/arch/x86/x86regtmod.gperf | 1 + 2 files changed, 2 insertions(+) diff --git a/modules/arch/x86/x86cpu.gperf b/modules/arch/x86/x86cpu.gperf index 5878a917..45edd071 100644 --- a/modules/arch/x86/x86cpu.gperf +++ b/modules/arch/x86/x86cpu.gperf @@ -27,6 +27,7 @@ #include RCSID("$Id$"); +#include #include #include diff --git a/modules/arch/x86/x86regtmod.gperf b/modules/arch/x86/x86regtmod.gperf index e3d0a89e..a5763432 100644 --- a/modules/arch/x86/x86regtmod.gperf +++ b/modules/arch/x86/x86regtmod.gperf @@ -27,6 +27,7 @@ #include RCSID("$Id$"); +#include #include #include From 75a28312f34c651abe1002d7c780becbafa5529d Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 18 Sep 2007 02:33:31 +0000 Subject: [PATCH 091/585] 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 svn path=/trunk/yasm/; revision=1957 --- Mkfiles/vc/genperf/run.bat | 13 +++++++++++++ Mkfiles/vc8/genperf/run.bat | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/Mkfiles/vc/genperf/run.bat b/Mkfiles/vc/genperf/run.bat index b2991ffd..d9afa3f4 100644 --- a/Mkfiles/vc/genperf/run.bat +++ b/Mkfiles/vc/genperf/run.bat @@ -1,5 +1,18 @@ cd ..\..\.. +@echo off +reg query HKCR\Python.File\shell\open\command >nul: 2>&1 +goto answer%errorlevel% +:answer0 +echo Python found! +@echo on modules\arch\x86\gen_x86_insn.py +@echo off +goto end +:answer1 +echo Python not found! +goto end +:end +@echo on %1 x86insn_nasm.gperf x86insn_nasm.c %1 x86insn_gas.gperf x86insn_gas.c %1 modules\arch\x86\x86cpu.gperf x86cpu.c diff --git a/Mkfiles/vc8/genperf/run.bat b/Mkfiles/vc8/genperf/run.bat index b2991ffd..d9afa3f4 100644 --- a/Mkfiles/vc8/genperf/run.bat +++ b/Mkfiles/vc8/genperf/run.bat @@ -1,5 +1,18 @@ cd ..\..\.. +@echo off +reg query HKCR\Python.File\shell\open\command >nul: 2>&1 +goto answer%errorlevel% +:answer0 +echo Python found! +@echo on modules\arch\x86\gen_x86_insn.py +@echo off +goto end +:answer1 +echo Python not found! +goto end +:end +@echo on %1 x86insn_nasm.gperf x86insn_nasm.c %1 x86insn_gas.gperf x86insn_gas.c %1 modules\arch\x86\x86cpu.gperf x86cpu.c From 0686569535960ffdfb995efe5587cc9d703ba132 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 18 Sep 2007 05:22:07 +0000 Subject: [PATCH 092/585] Fix VC++ build order dependencies. Patch by: mu@ svn path=/trunk/yasm/; revision=1958 --- Mkfiles/vc/yasm.sln | 7 ++++--- Mkfiles/vc8/yasm.sln | 10 +++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Mkfiles/vc/yasm.sln b/Mkfiles/vc/yasm.sln index c454326b..b0fd177f 100644 --- a/Mkfiles/vc/yasm.sln +++ b/Mkfiles/vc/yasm.sln @@ -6,16 +6,17 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libyasm", "libyasm\libyasm. EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "modules", "modules\modules.vcproj", "{D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}" ProjectSection(ProjectDependencies) = postProject + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619} = {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619} + {225700A5-07B8-434E-AD61-555278BF6733} = {225700A5-07B8-434E-AD61-555278BF6733} + {29FE7874-1256-4AD6-B889-68E399DC9608} = {29FE7874-1256-4AD6-B889-68E399DC9608} {3C58BE13-50A3-4583-984D-D8902B3D7713} = {3C58BE13-50A3-4583-984D-D8902B3D7713} {5758BF4E-ABC4-11DA-B012-B622A1EF5492} = {5758BF4E-ABC4-11DA-B012-B622A1EF5492} - {29FE7874-1256-4AD6-B889-68E399DC9608} = {29FE7874-1256-4AD6-B889-68E399DC9608} - {225700A5-07B8-434E-AD61-555278BF6733} = {225700A5-07B8-434E-AD61-555278BF6733} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yasm", "yasm.vcproj", "{34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}" ProjectSection(ProjectDependencies) = postProject - {29FE7874-1256-4AD6-B889-68E399DC9608} = {29FE7874-1256-4AD6-B889-68E399DC9608} {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6} = {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6} + {29FE7874-1256-4AD6-B889-68E399DC9608} = {29FE7874-1256-4AD6-B889-68E399DC9608} {021CEB0A-F721-4F59-B349-9CEEAF244459} = {021CEB0A-F721-4F59-B349-9CEEAF244459} EndProjectSection EndProject diff --git a/Mkfiles/vc8/yasm.sln b/Mkfiles/vc8/yasm.sln index 4d553885..03c56f63 100644 --- a/Mkfiles/vc8/yasm.sln +++ b/Mkfiles/vc8/yasm.sln @@ -7,17 +7,17 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libyasm", "libyasm\libyasm. EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "modules", "modules\modules.vcproj", "{D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}" ProjectSection(ProjectDependencies) = postProject - {3C58BE13-50A3-4583-984D-D8902B3D7713} = {3C58BE13-50A3-4583-984D-D8902B3D7713} - {5758BF4E-ABC4-11DA-B012-B622A1EF5492} = {5758BF4E-ABC4-11DA-B012-B622A1EF5492} - {29FE7874-1256-4AD6-B889-68E399DC9608} = {29FE7874-1256-4AD6-B889-68E399DC9608} + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619} = {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619} {225700A5-07B8-434E-AD61-555278BF6733} = {225700A5-07B8-434E-AD61-555278BF6733} + {29FE7874-1256-4AD6-B889-68E399DC9608} = {29FE7874-1256-4AD6-B889-68E399DC9608} + {3C58BE13-50A3-4583-984D-D8902B3D7713} = {3C58BE13-50A3-4583-984D-D8902B3D7713} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yasm", "yasm.vcproj", "{34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}" ProjectSection(ProjectDependencies) = postProject - {021CEB0A-F721-4F59-B349-9CEEAF244459} = {021CEB0A-F721-4F59-B349-9CEEAF244459} - {29FE7874-1256-4AD6-B889-68E399DC9608} = {29FE7874-1256-4AD6-B889-68E399DC9608} {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6} = {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6} + {29FE7874-1256-4AD6-B889-68E399DC9608} = {29FE7874-1256-4AD6-B889-68E399DC9608} + {021CEB0A-F721-4F59-B349-9CEEAF244459} = {021CEB0A-F721-4F59-B349-9CEEAF244459} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genmacro", "genmacro\genmacro.vcproj", "{225700A5-07B8-434E-AD61-555278BF6733}" From 75677dee864dfe6bf362f4cdf1517e1d301a7bd4 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 18 Sep 2007 05:38:06 +0000 Subject: [PATCH 093/585] Remove unused variable. svn path=/trunk/yasm/; revision=1959 --- tools/genperf/genperf.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/genperf/genperf.c b/tools/genperf/genperf.c index ef01b818..1fcf2da1 100644 --- a/tools/genperf/genperf.c +++ b/tools/genperf/genperf.c @@ -208,7 +208,6 @@ perfect_gen(FILE *out, const char *lookup_function_name, fprintf(out, " static const struct %s pd[%lu] = {\n", struct_name, nkeys); for (i=0; iname, tabh[i].key_h->name_k) == 0) break; From 933bf531fdb05775adb3f9698b1dd05be9785f11 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 18 Sep 2007 08:34:57 +0000 Subject: [PATCH 094/585] Make Python messages a little less threatening. Suggested by: Brian Gladman svn path=/trunk/yasm/; revision=1960 --- Mkfiles/vc/genperf/run.bat | 4 ++-- Mkfiles/vc8/genperf/run.bat | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Mkfiles/vc/genperf/run.bat b/Mkfiles/vc/genperf/run.bat index d9afa3f4..64ec1ae3 100644 --- a/Mkfiles/vc/genperf/run.bat +++ b/Mkfiles/vc/genperf/run.bat @@ -3,13 +3,13 @@ cd ..\..\.. reg query HKCR\Python.File\shell\open\command >nul: 2>&1 goto answer%errorlevel% :answer0 -echo Python found! +echo ... building with Python ... @echo on modules\arch\x86\gen_x86_insn.py @echo off goto end :answer1 -echo Python not found! +echo ... building without Python ... goto end :end @echo on diff --git a/Mkfiles/vc8/genperf/run.bat b/Mkfiles/vc8/genperf/run.bat index d9afa3f4..64ec1ae3 100644 --- a/Mkfiles/vc8/genperf/run.bat +++ b/Mkfiles/vc8/genperf/run.bat @@ -3,13 +3,13 @@ cd ..\..\.. reg query HKCR\Python.File\shell\open\command >nul: 2>&1 goto answer%errorlevel% :answer0 -echo Python found! +echo ... building with Python ... @echo on modules\arch\x86\gen_x86_insn.py @echo off goto end :answer1 -echo Python not found! +echo ... building without Python ... goto end :end @echo on From 5cbc876ef5a9ebe5d430d8616f049811d3ff3fbf Mon Sep 17 00:00:00 2001 From: paulbarker Date: Tue, 18 Sep 2007 12:41:57 +0000 Subject: [PATCH 095/585] * Added code to the cpp module to pass include directories to the cpp program. * Marked a string for gettext. * Fixed a comment error. svn path=/branches/multiarch/; revision=1961 --- modules/preprocs/cpp/cpp-preproc.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/modules/preprocs/cpp/cpp-preproc.c b/modules/preprocs/cpp/cpp-preproc.c index 9b8f3054..c28e6e6d 100644 --- a/modules/preprocs/cpp/cpp-preproc.c +++ b/modules/preprocs/cpp/cpp-preproc.c @@ -47,7 +47,7 @@ typedef struct cpp_arg_entry { The operator (eg "-I") and the parameter (eg "include/"). op is expected to point to a string literal, whereas param is expected to be a copy of the parameter which is free'd when no-longer needed (in - cpp_build_cmdline()). + cpp_preproc_destroy()). */ const char *op; char *param; @@ -82,7 +82,7 @@ typedef struct yasm_preproc_cpp { #define APPEND(s) do { \ size_t _len = strlen(s); \ if (p + _len >= limit) \ - yasm__fatal("command line too long!"); \ + yasm__fatal(N_("command line too long!")); \ strcpy(p, s); \ p += _len; \ } while (0) @@ -180,6 +180,8 @@ static yasm_preproc * cpp_preproc_create(const char *in, yasm_linemap *lm, yasm_errwarns *errwarns) { yasm_preproc_cpp *pp = yasm_xmalloc(sizeof(yasm_preproc_cpp)); + void * iter; + const char * inc_dir; pp->preproc.module = &yasm_cpp_LTX_preproc; pp->f = pp->f_deps = NULL; @@ -190,6 +192,16 @@ cpp_preproc_create(const char *in, yasm_linemap *lm, yasm_errwarns *errwarns) TAILQ_INIT(&pp->cpp_args); + /* Iterate through the list of include dirs. */ + iter = NULL; + while ((inc_dir = yasm_get_include_dir(&iter)) != NULL) { + cpp_arg_entry *arg = yasm_xmalloc(sizeof(cpp_arg_entry)); + arg->op = "-I"; + arg->param = yasm__xstrdup(inc_dir); + + TAILQ_INSERT_TAIL(&pp->cpp_args, arg, entry); + } + return (yasm_preproc *)pp; } @@ -342,8 +354,3 @@ yasm_preproc_module yasm_cpp_LTX_preproc = { cpp_preproc_undefine_macro, cpp_preproc_define_builtin }; - -/* - TODO: We will need to pass the list of include directories to the external - preprocessor. -*/ From 6dfe4b13fd4c4f971774325870e79da7f057bbfc Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 19 Sep 2007 02:52:33 +0000 Subject: [PATCH 096/585] Support "oword", "do", and "reso" as aliases for "dqword", "ddq", and "resdq" respectively, for compatibility with NASM (sigh). svn path=/trunk/yasm/; revision=1962 --- modules/parsers/nasm/nasm-token.re | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/parsers/nasm/nasm-token.re b/modules/parsers/nasm/nasm-token.re index de58cf0e..2e0f3076 100644 --- a/modules/parsers/nasm/nasm-token.re +++ b/modules/parsers/nasm/nasm-token.re @@ -246,6 +246,10 @@ scan: lvalp->int_info = yasm_arch_wordsize(p_object->arch)*8; RETURN(SIZE_OVERRIDE); } + 'oword' { + lvalp->int_info = yasm_arch_wordsize(p_object->arch)*8; + RETURN(SIZE_OVERRIDE); + } /* pseudo-instructions */ 'db' { lvalp->int_info = 8; RETURN(DECLARE_DATA); } @@ -270,6 +274,10 @@ scan: lvalp->int_info = yasm_arch_wordsize(p_object->arch)*8; RETURN(DECLARE_DATA); } + 'do' { + lvalp->int_info = yasm_arch_wordsize(p_object->arch)*8; + RETURN(DECLARE_DATA); + } 'resb' { lvalp->int_info = 8; RETURN(RESERVE_SPACE); } 'reshw' { @@ -293,6 +301,10 @@ scan: lvalp->int_info = yasm_arch_wordsize(p_object->arch)*8; RETURN(RESERVE_SPACE); } + 'reso' { + lvalp->int_info = yasm_arch_wordsize(p_object->arch)*8; + RETURN(RESERVE_SPACE); + } 'incbin' { RETURN(INCBIN); } From 31ef2e7a52647e34a37a94e7892be52f321dedf9 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 19 Sep 2007 07:47:10 +0000 Subject: [PATCH 097/585] Support NASM's upcoming RIP-relative syntax, with a few differences. This adds a "default" directive that takes either "rel" or "abs". This sets whether the default mode for simple displacements is RIP-relative (rel) or not (abs). The default without a directive is "abs". Also added is corresponding "rel" and "abs" effective address modifiers to override whatever default is set: [rel label] is RIP-relative [abs label] is not. In default rel mode, [label] defaults to the former, in default abs mode, the latter. Also, segment overrides (note difference from NASM below) are abs regardless of mode, unless explicitly overridden with rel: [fs:label] is always abs [rel fs:label] is always rel However, we have a number of differences from NASM in this handling due to what I feel to be yasm's more sane handling of [dword ...] and [qword ...]. In yasm, these set the displacement size, rather than the address size; the latter is set using a a32/a64 prefix. I feel this is more sane as in 64-bit mode the two can be different in the MovOffs (A0/A1 mov *ax) case. Also, yasm disables default-rel mode if any segment register is used, not just FS or GS as NASM currently does. See modules/arch/x86/tests/riprel1.asm and modules/arch/x86/tests/riprel2.asm for examples, as well as my recent posting to the nasm-devel mailing list on SF. svn path=/trunk/yasm/; revision=1963 --- libyasm/insn.h | 6 + modules/arch/lc3b/lc3barch.c | 2 + modules/arch/x86/tests/Makefile.inc | 5 + modules/arch/x86/tests/riprel1.asm | 66 +++ modules/arch/x86/tests/riprel1.hex | 334 ++++++++++++ modules/arch/x86/tests/riprel2.asm | 110 ++++ modules/arch/x86/tests/riprel2.errwarn | 26 + modules/arch/x86/tests/riprel2.hex | 708 +++++++++++++++++++++++++ modules/arch/x86/x86arch.c | 9 +- modules/arch/x86/x86arch.h | 1 + modules/arch/x86/x86bc.c | 2 + modules/arch/x86/x86expr.c | 15 + modules/arch/x86/x86id.c | 24 +- modules/parsers/nasm/nasm-parse.c | 66 ++- modules/parsers/nasm/nasm-parser.h | 2 + modules/parsers/nasm/nasm-token.re | 3 + modules/preprocs/nasm/standard.mac | 4 + 17 files changed, 1370 insertions(+), 13 deletions(-) create mode 100644 modules/arch/x86/tests/riprel1.asm create mode 100644 modules/arch/x86/tests/riprel1.hex create mode 100644 modules/arch/x86/tests/riprel2.asm create mode 100644 modules/arch/x86/tests/riprel2.errwarn create mode 100644 modules/arch/x86/tests/riprel2.hex diff --git a/libyasm/insn.h b/libyasm/insn.h index 20977b2c..ea3fe539 100644 --- a/libyasm/insn.h +++ b/libyasm/insn.h @@ -64,6 +64,12 @@ struct yasm_effaddr { * "expr(,1)" (which is definitely an effective address). */ unsigned int strong:1; + + /** 1 if effective address is forced PC-relative. */ + unsigned int pc_rel:1; + + /** 1 if effective address is forced non-PC-relative. */ + unsigned int not_pc_rel:1; }; /** An instruction operand (opaque type). */ diff --git a/modules/arch/lc3b/lc3barch.c b/modules/arch/lc3b/lc3barch.c index e1835d0a..84f188a8 100644 --- a/modules/arch/lc3b/lc3barch.c +++ b/modules/arch/lc3b/lc3barch.c @@ -158,6 +158,8 @@ lc3b_ea_create_expr(yasm_arch *arch, yasm_expr *e) ea->nosplit = 0; ea->strong = 0; ea->segreg = 0; + ea->pc_rel = 0; + ea->not_pc_rel = 0; return ea; } diff --git a/modules/arch/x86/tests/Makefile.inc b/modules/arch/x86/tests/Makefile.inc index c513ad17..67e8b5c6 100644 --- a/modules/arch/x86/tests/Makefile.inc +++ b/modules/arch/x86/tests/Makefile.inc @@ -126,6 +126,11 @@ EXTRA_DIST += modules/arch/x86/tests/rep.asm EXTRA_DIST += modules/arch/x86/tests/rep.hex EXTRA_DIST += modules/arch/x86/tests/ret.asm EXTRA_DIST += modules/arch/x86/tests/ret.hex +EXTRA_DIST += modules/arch/x86/tests/riprel1.asm +EXTRA_DIST += modules/arch/x86/tests/riprel1.hex +EXTRA_DIST += modules/arch/x86/tests/riprel2.asm +EXTRA_DIST += modules/arch/x86/tests/riprel2.errwarn +EXTRA_DIST += modules/arch/x86/tests/riprel2.hex EXTRA_DIST += modules/arch/x86/tests/segmov.asm EXTRA_DIST += modules/arch/x86/tests/segmov.hex EXTRA_DIST += modules/arch/x86/tests/shift.asm diff --git a/modules/arch/x86/tests/riprel1.asm b/modules/arch/x86/tests/riprel1.asm new file mode 100644 index 00000000..b1fdbecb --- /dev/null +++ b/modules/arch/x86/tests/riprel1.asm @@ -0,0 +1,66 @@ +bits 64 +val: +default abs + +mov rax, val ; 32-bit imm +mov rax, dword val ; 32-bit imm +mov rax, qword val ; 64-bit imm + +mov rbx, val ; 32-bit imm +mov rbx, dword val ; 32-bit imm +mov rbx, qword val ; 64-bit imm + +mov rax, [val] ; 48 8b ... (32-bit disp) +mov rax, [dword val] ; 48 8b ... (32-bit disp) +mov rax, [qword val] ; 48 a1 ... (64-bit disp) +a32 mov rax, [val] ; 67 48 a1 ... (32-bit disp) +a32 mov rax, [dword val] ; 67 48 a1 ... (32-bit disp) +a32 mov rax, [qword val] ; 67 48 a1 ... (32-bit disp) + ; [this one is debatable on correctness, + ; I chose in yasm to make a32 override] +a64 mov rax, [val] ; 48 8b ... (32-bit disp) +a64 mov rax, [dword val] ; 48 8b ... (32-bit disp) +a64 mov rax, [qword val] ; 48 a1 ... (64-bit disp) + +mov rbx, [val] ; 48 8b ... (32-bit disp) +mov rbx, [dword val] ; 48 8b ... (32-bit disp) +;mov rbx, [qword val] ; illegal (can't have 64-bit disp) +a32 mov rbx, [val] ; 67 48 8b ... (32-bit disp) +a32 mov rbx, [dword val] ; 67 48 8b ... (32-bit disp) +;a32 mov rbx, [qword val] ; illegal (can't have 64-bit disp) +a64 mov rbx, [val] ; 48 8b ... (32-bit disp) +a64 mov rbx, [dword val] ; 48 8b ... (32-bit disp) +;a64 mov rbx, [qword val] ; illegal (can't have 64-bit disp) + +default rel + +mov rax, val ; 32-bit imm +mov rax, dword val ; 32-bit imm +mov rax, qword val ; 64-bit imm + +mov rbx, val ; 32-bit imm +mov rbx, dword val ; 32-bit imm +mov rbx, qword val ; 64-bit imm + +mov rax, [val] ; 48 8b ... (32-bit disp, RIP-rel) +mov rax, [dword val] ; 48 8b ... (32-bit disp, RIP-rel) +mov rax, [qword val] ; 48 a1 ... (64-bit disp, ABS) +a32 mov rax, [val] ; 67 48 8b ... (32-bit disp, RIP-rel) +a32 mov rax, [dword val] ; 67 48 8b ... (32-bit disp, RIP-rel) +a32 mov rax, [qword val] ; 67 48 a1 ... (32-bit disp, ABS) + ; [this one is debatable on correctness, + ; I chose in yasm to make a32 override] +a64 mov rax, [val] ; 48 8b ... (32-bit disp, RIP-rel) +a64 mov rax, [dword val] ; 48 8b ... (32-bit disp, RIP-rel) +a64 mov rax, [qword val] ; 48 a1 ... (64-bit disp, ABS) + +mov rbx, [val] ; 48 8b ... (32-bit disp, RIP-rel) +mov rbx, [dword val] ; 48 8b ... (32-bit disp, RIP-rel) +;mov rbx, [qword val] ; illegal (can't have 64-bit disp) +a32 mov rbx, [val] ; 67 48 8b ... (32-bit disp, RIP-rel) +a32 mov rbx, [dword val] ; 67 48 8b ... (32-bit disp, RIP-rel) +;a32 mov rbx, [qword val] ; illegal (can't have 64-bit disp) +a64 mov rbx, [val] ; 48 8b ... (32-bit disp, RIP-rel) +a64 mov rbx, [dword val] ; 48 8b ... (32-bit disp, RIP-rel) +;a64 mov rbx, [qword val] ; illegal (can't have 64-bit disp) + diff --git a/modules/arch/x86/tests/riprel1.hex b/modules/arch/x86/tests/riprel1.hex new file mode 100644 index 00000000..78f28bff --- /dev/null +++ b/modules/arch/x86/tests/riprel1.hex @@ -0,0 +1,334 @@ +48 +c7 +c0 +00 +00 +00 +00 +48 +c7 +c0 +00 +00 +00 +00 +48 +b8 +00 +00 +00 +00 +00 +00 +00 +00 +48 +c7 +c3 +00 +00 +00 +00 +48 +c7 +c3 +00 +00 +00 +00 +48 +bb +00 +00 +00 +00 +00 +00 +00 +00 +48 +8b +04 +25 +00 +00 +00 +00 +48 +8b +04 +25 +00 +00 +00 +00 +48 +a1 +00 +00 +00 +00 +00 +00 +00 +00 +67 +48 +a1 +00 +00 +00 +00 +67 +48 +a1 +00 +00 +00 +00 +67 +48 +a1 +00 +00 +00 +00 +48 +8b +04 +25 +00 +00 +00 +00 +48 +8b +04 +25 +00 +00 +00 +00 +48 +a1 +00 +00 +00 +00 +00 +00 +00 +00 +48 +8b +1c +25 +00 +00 +00 +00 +48 +8b +1c +25 +00 +00 +00 +00 +67 +48 +8b +1c +25 +00 +00 +00 +00 +67 +48 +8b +1c +25 +00 +00 +00 +00 +48 +8b +1c +25 +00 +00 +00 +00 +48 +8b +1c +25 +00 +00 +00 +00 +48 +c7 +c0 +00 +00 +00 +00 +48 +c7 +c0 +00 +00 +00 +00 +48 +b8 +00 +00 +00 +00 +00 +00 +00 +00 +48 +c7 +c3 +00 +00 +00 +00 +48 +c7 +c3 +00 +00 +00 +00 +48 +bb +00 +00 +00 +00 +00 +00 +00 +00 +48 +8b +05 +1e +ff +ff +ff +48 +8b +05 +17 +ff +ff +ff +48 +a1 +00 +00 +00 +00 +00 +00 +00 +00 +67 +48 +8b +05 +05 +ff +ff +ff +67 +48 +8b +05 +fd +fe +ff +ff +67 +48 +a1 +00 +00 +00 +00 +48 +8b +05 +ef +fe +ff +ff +48 +8b +05 +e8 +fe +ff +ff +48 +a1 +00 +00 +00 +00 +00 +00 +00 +00 +48 +8b +1d +d7 +fe +ff +ff +48 +8b +1d +d0 +fe +ff +ff +67 +48 +8b +1d +c8 +fe +ff +ff +67 +48 +8b +1d +c0 +fe +ff +ff +48 +8b +1d +b9 +fe +ff +ff +48 +8b +1d +b2 +fe +ff +ff diff --git a/modules/arch/x86/tests/riprel2.asm b/modules/arch/x86/tests/riprel2.asm new file mode 100644 index 00000000..813d9e5a --- /dev/null +++ b/modules/arch/x86/tests/riprel2.asm @@ -0,0 +1,110 @@ + bits 64 + + default abs ; default abs, except for explicit rel + + mov rax,[foo] + mov rax,[qword 123456789abcdef0h] + mov rbx,[foo] + mov rax,[dword foo] + mov rbx,[dword foo] + mov rax,[qword foo] + mov rax,[rel foo] ; rel + mov rbx,[rel foo] ; rel + mov rax,[rel dword foo] ; rel + ;mov rax,[rel qword foo] ; illegal + mov rax,[abs foo] + mov rbx,[abs foo] + mov rax,[abs dword foo] + mov rax,[abs qword foo] + + mov rax,[es:foo] + mov rax,[qword es:123456789abcdef0h] + mov rbx,[es:foo] + mov rax,[dword es:foo] + mov rbx,[dword es:foo] + mov rax,[qword es:foo] + mov rax,[rel es:foo] ; rel + mov rbx,[rel es:foo] ; rel + mov rax,[rel dword es:foo] ; rel + ;mov rax,[rel qword es:foo] ; illegal + mov rax,[abs es:foo] + mov rbx,[abs es:foo] + mov rax,[abs dword es:foo] + mov rax,[abs qword es:foo] + + mov rax,[fs:foo] + mov rax,[qword fs:123456789abcdef0h] + mov rbx,[fs:foo] + mov rax,[dword fs:foo] + mov rbx,[dword fs:foo] + mov rax,[qword fs:foo] + mov rax,[rel fs:foo] ; rel + mov rbx,[rel fs:foo] ; rel + mov rax,[rel dword fs:foo] ; rel + ;mov rax,[rel qword fs:foo] ; illegal + mov rax,[abs fs:foo] + mov rbx,[abs fs:foo] + mov rax,[abs dword fs:foo] + mov rax,[abs qword fs:foo] + + mov rax,[rbx] + mov rax,[rel rbx] + mov rax,[abs rbx] + + default rel + + ; all of these are default rel, except for 64-bit displacements + mov rax,[foo] + mov rax,[qword 123456789abcdef0h] ; abs + mov rbx,[foo] + mov rax,[dword foo] + mov rbx,[dword foo] + mov rax,[qword foo] ; abs + mov rax,[rel foo] + mov rbx,[rel foo] + mov rax,[rel dword foo] + ;mov rax,[rel qword foo] ; illegal + mov rax,[abs foo] + mov rbx,[abs foo] + mov rax,[abs dword foo] + mov rax,[abs qword foo] + + ; all of these are abs due to es:, except for explicit rel + mov rax,[es:foo] + mov rax,[qword es:123456789abcdef0h] + mov rbx,[es:foo] + mov rax,[dword es:foo] + mov rbx,[dword es:foo] + mov rax,[qword es:foo] + mov rax,[rel es:foo] ; rel + mov rbx,[rel es:foo] ; rel + mov rax,[rel dword es:foo] ; rel + ;mov rax,[rel qword es:foo] ; illegal + mov rax,[abs es:foo] + mov rbx,[abs es:foo] + mov rax,[abs dword es:foo] + mov rax,[abs qword es:foo] + + ; all of these are abs due to fs:, except for explicit rel + mov rax,[fs:foo] + mov rax,[qword fs:123456789abcdef0h] + mov rbx,[fs:foo] + mov rax,[dword fs:foo] + mov rbx,[dword fs:foo] + mov rax,[qword fs:foo] + mov rax,[rel fs:foo] ; rel + mov rbx,[rel fs:foo] ; rel + mov rax,[rel dword fs:foo] ; rel + ;mov rax,[rel qword fs:foo] ; illegal + mov rax,[abs fs:foo] + mov rbx,[abs fs:foo] + mov rax,[abs dword fs:foo] + mov rax,[abs qword fs:foo] + + mov rax,[rbx] + mov rax,[rel rbx] + mov rax,[abs rbx] + + section .data +foo equ $ + diff --git a/modules/arch/x86/tests/riprel2.errwarn b/modules/arch/x86/tests/riprel2.errwarn new file mode 100644 index 00000000..b219dc7e --- /dev/null +++ b/modules/arch/x86/tests/riprel2.errwarn @@ -0,0 +1,26 @@ +-:20: warning: `es' segment register ignored in 64-bit mode +-:21: warning: `es' segment register ignored in 64-bit mode +-:22: warning: `es' segment register ignored in 64-bit mode +-:23: warning: `es' segment register ignored in 64-bit mode +-:24: warning: `es' segment register ignored in 64-bit mode +-:25: warning: `es' segment register ignored in 64-bit mode +-:26: warning: `es' segment register ignored in 64-bit mode +-:27: warning: `es' segment register ignored in 64-bit mode +-:28: warning: `es' segment register ignored in 64-bit mode +-:30: warning: `es' segment register ignored in 64-bit mode +-:31: warning: `es' segment register ignored in 64-bit mode +-:32: warning: `es' segment register ignored in 64-bit mode +-:33: warning: `es' segment register ignored in 64-bit mode +-:73: warning: `es' segment register ignored in 64-bit mode +-:74: warning: `es' segment register ignored in 64-bit mode +-:75: warning: `es' segment register ignored in 64-bit mode +-:76: warning: `es' segment register ignored in 64-bit mode +-:77: warning: `es' segment register ignored in 64-bit mode +-:78: warning: `es' segment register ignored in 64-bit mode +-:79: warning: `es' segment register ignored in 64-bit mode +-:80: warning: `es' segment register ignored in 64-bit mode +-:81: warning: `es' segment register ignored in 64-bit mode +-:83: warning: `es' segment register ignored in 64-bit mode +-:84: warning: `es' segment register ignored in 64-bit mode +-:85: warning: `es' segment register ignored in 64-bit mode +-:86: warning: `es' segment register ignored in 64-bit mode diff --git a/modules/arch/x86/tests/riprel2.hex b/modules/arch/x86/tests/riprel2.hex new file mode 100644 index 00000000..5d9a9183 --- /dev/null +++ b/modules/arch/x86/tests/riprel2.hex @@ -0,0 +1,708 @@ +48 +8b +04 +25 +c4 +02 +00 +00 +48 +a1 +f0 +de +bc +9a +78 +56 +34 +12 +48 +8b +1c +25 +c4 +02 +00 +00 +48 +8b +04 +25 +c4 +02 +00 +00 +48 +8b +1c +25 +c4 +02 +00 +00 +48 +a1 +c4 +02 +00 +00 +00 +00 +00 +00 +48 +8b +05 +89 +02 +00 +00 +48 +8b +1d +82 +02 +00 +00 +48 +8b +05 +7b +02 +00 +00 +48 +8b +04 +25 +c4 +02 +00 +00 +48 +8b +1c +25 +c4 +02 +00 +00 +48 +8b +04 +25 +c4 +02 +00 +00 +48 +a1 +c4 +02 +00 +00 +00 +00 +00 +00 +26 +48 +8b +04 +25 +c4 +02 +00 +00 +26 +48 +a1 +f0 +de +bc +9a +78 +56 +34 +12 +26 +48 +8b +1c +25 +c4 +02 +00 +00 +26 +48 +8b +04 +25 +c4 +02 +00 +00 +26 +48 +8b +1c +25 +c4 +02 +00 +00 +26 +48 +a1 +c4 +02 +00 +00 +00 +00 +00 +00 +26 +48 +8b +05 +17 +02 +00 +00 +26 +48 +8b +1d +0f +02 +00 +00 +26 +48 +8b +05 +07 +02 +00 +00 +26 +48 +8b +04 +25 +c4 +02 +00 +00 +26 +48 +8b +1c +25 +c4 +02 +00 +00 +26 +48 +8b +04 +25 +c4 +02 +00 +00 +26 +48 +a1 +c4 +02 +00 +00 +00 +00 +00 +00 +64 +48 +8b +04 +25 +c4 +02 +00 +00 +64 +48 +a1 +f0 +de +bc +9a +78 +56 +34 +12 +64 +48 +8b +1c +25 +c4 +02 +00 +00 +64 +48 +8b +04 +25 +c4 +02 +00 +00 +64 +48 +8b +1c +25 +c4 +02 +00 +00 +64 +48 +a1 +c4 +02 +00 +00 +00 +00 +00 +00 +64 +48 +8b +05 +9f +01 +00 +00 +64 +48 +8b +1d +97 +01 +00 +00 +64 +48 +8b +05 +8f +01 +00 +00 +64 +48 +8b +04 +25 +c4 +02 +00 +00 +64 +48 +8b +1c +25 +c4 +02 +00 +00 +64 +48 +8b +04 +25 +c4 +02 +00 +00 +64 +48 +a1 +c4 +02 +00 +00 +00 +00 +00 +00 +48 +8b +03 +48 +8b +03 +48 +8b +03 +48 +8b +05 +59 +01 +00 +00 +48 +a1 +f0 +de +bc +9a +78 +56 +34 +12 +48 +8b +1d +48 +01 +00 +00 +48 +8b +05 +41 +01 +00 +00 +48 +8b +1d +3a +01 +00 +00 +48 +a1 +c4 +02 +00 +00 +00 +00 +00 +00 +48 +8b +05 +29 +01 +00 +00 +48 +8b +1d +22 +01 +00 +00 +48 +8b +05 +1b +01 +00 +00 +48 +8b +04 +25 +c4 +02 +00 +00 +48 +8b +1c +25 +c4 +02 +00 +00 +48 +8b +04 +25 +c4 +02 +00 +00 +48 +a1 +c4 +02 +00 +00 +00 +00 +00 +00 +26 +48 +8b +04 +25 +c4 +02 +00 +00 +26 +48 +a1 +f0 +de +bc +9a +78 +56 +34 +12 +26 +48 +8b +1c +25 +c4 +02 +00 +00 +26 +48 +8b +04 +25 +c4 +02 +00 +00 +26 +48 +8b +1c +25 +c4 +02 +00 +00 +26 +48 +a1 +c4 +02 +00 +00 +00 +00 +00 +00 +26 +48 +8b +05 +b7 +00 +00 +00 +26 +48 +8b +1d +af +00 +00 +00 +26 +48 +8b +05 +a7 +00 +00 +00 +26 +48 +8b +04 +25 +c4 +02 +00 +00 +26 +48 +8b +1c +25 +c4 +02 +00 +00 +26 +48 +8b +04 +25 +c4 +02 +00 +00 +26 +48 +a1 +c4 +02 +00 +00 +00 +00 +00 +00 +64 +48 +8b +04 +25 +c4 +02 +00 +00 +64 +48 +a1 +f0 +de +bc +9a +78 +56 +34 +12 +64 +48 +8b +1c +25 +c4 +02 +00 +00 +64 +48 +8b +04 +25 +c4 +02 +00 +00 +64 +48 +8b +1c +25 +c4 +02 +00 +00 +64 +48 +a1 +c4 +02 +00 +00 +00 +00 +00 +00 +64 +48 +8b +05 +3f +00 +00 +00 +64 +48 +8b +1d +37 +00 +00 +00 +64 +48 +8b +05 +2f +00 +00 +00 +64 +48 +8b +04 +25 +c4 +02 +00 +00 +64 +48 +8b +1c +25 +c4 +02 +00 +00 +64 +48 +8b +04 +25 +c4 +02 +00 +00 +64 +48 +a1 +c4 +02 +00 +00 +00 +00 +00 +00 +48 +8b +03 +48 +8b +03 +48 +8b +03 diff --git a/modules/arch/x86/x86arch.c b/modules/arch/x86/x86arch.c index d410ac0e..5b8ad700 100644 --- a/modules/arch/x86/x86arch.c +++ b/modules/arch/x86/x86arch.c @@ -67,6 +67,7 @@ x86_create(const char *machine, const char *parser, arch_x86->amd64_machine = amd64_machine; arch_x86->mode_bits = 0; arch_x86->force_strict = 0; + arch_x86->default_rel = 0; if (yasm__strcasecmp(parser, "nasm") == 0) arch_x86->parser = X86_PARSER_NASM; @@ -123,7 +124,13 @@ x86_set_var(yasm_arch *arch, const char *var, unsigned long val) arch_x86->mode_bits = (unsigned int)val; else if (yasm__strcasecmp(var, "force_strict") == 0) arch_x86->force_strict = (unsigned int)val; - else + else if (yasm__strcasecmp(var, "default_rel") == 0) { + if (arch_x86->mode_bits != 64) + yasm_warn_set(YASM_WARN_GENERAL, + N_("ignoring default rel in non-64-bit mode")); + else + arch_x86->default_rel = (unsigned int)val; + } else return 1; return 0; } diff --git a/modules/arch/x86/x86arch.h b/modules/arch/x86/x86arch.h index 705933c0..b5c0f091 100644 --- a/modules/arch/x86/x86arch.h +++ b/modules/arch/x86/x86arch.h @@ -87,6 +87,7 @@ typedef struct yasm_arch_x86 { } parser; unsigned int mode_bits; unsigned int force_strict; + unsigned int default_rel; } yasm_arch_x86; /* 0-15 (low 4 bits) used for register number, stored in same data area. diff --git a/modules/arch/x86/x86bc.c b/modules/arch/x86/x86bc.c index 4319318b..f3717bf7 100644 --- a/modules/arch/x86/x86bc.c +++ b/modules/arch/x86/x86bc.c @@ -190,6 +190,8 @@ ea_create(void) x86_ea->ea.nosplit = 0; x86_ea->ea.strong = 0; x86_ea->ea.segreg = 0; + x86_ea->ea.pc_rel = 0; + x86_ea->ea.not_pc_rel = 0; x86_ea->modrm = 0; x86_ea->valid_modrm = 0; x86_ea->need_modrm = 0; diff --git a/modules/arch/x86/x86expr.c b/modules/arch/x86/x86expr.c index eb145e7a..6358bff1 100644 --- a/modules/arch/x86/x86expr.c +++ b/modules/arch/x86/x86expr.c @@ -636,6 +636,12 @@ yasm_x86__expr_checkea(x86_effaddr *x86_ea, unsigned char *addrsize, return 1; } + if (x86_ea->ea.pc_rel && bits != 64) { + yasm_warn_set(YASM_WARN_GENERAL, + N_("RIP-relative directive ignored in non-64-bit mode")); + x86_ea->ea.pc_rel = 0; + } + reg3264_data.regs = reg3264mult; reg3264_data.bits = bits; reg3264_data.addrsize = *addrsize; @@ -755,6 +761,15 @@ yasm_x86__expr_checkea(x86_effaddr *x86_ea, unsigned char *addrsize, * (optional) SIB bytes. */ + /* If we're supposed to be RIP-relative and there's no register + * usage, change to RIP-relative. + */ + if (basereg == REG3264_NONE && indexreg == REG3264_NONE && + x86_ea->ea.pc_rel) { + basereg = REG64_RIP; + yasm_value_set_curpos_rel(&x86_ea->ea.disp, bc, 1); + } + /* First determine R/M (Mod is later determined from disp size) */ x86_ea->need_modrm = 1; /* we always need ModRM */ if (basereg == REG3264_NONE && indexreg == REG3264_NONE) { diff --git a/modules/arch/x86/x86id.c b/modules/arch/x86/x86id.c index 739c8679..59e74aed 100644 --- a/modules/arch/x86/x86id.c +++ b/modules/arch/x86/x86id.c @@ -301,6 +301,9 @@ typedef struct x86_id_insn { /* Strict forced setting at the time of parsing the instruction */ unsigned int force_strict:1; + + /* Default rel setting at the time of parsing the instruction */ + unsigned int default_rel:1; } x86_id_insn; static void x86_id_insn_destroy(void *contents); @@ -764,7 +767,10 @@ x86_find_match(x86_id_insn *id_insn, yasm_insn_operand **ops, case OPT_MemOffs: if (op->type != YASM_INSN__OPERAND_MEMORY || yasm_expr__contains(op->data.ea->disp.abs, - YASM_EXPR_REG)) + YASM_EXPR_REG) || + op->data.ea->pc_rel || + (!op->data.ea->not_pc_rel && id_insn->default_rel && + op->data.ea->disp.size != 64)) mismatch = 1; break; case OPT_Imm1: @@ -1170,6 +1176,13 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) if (info_ops[i].type == OPT_MemOffs) /* Special-case for MOV MemOffs instruction */ yasm_x86__ea_set_disponly(insn->x86_ea); + else if (id_insn->default_rel && + !op->data.ea->not_pc_rel && + op->data.ea->segreg == 0 && + !yasm_expr__contains( + op->data.ea->disp.abs, YASM_EXPR_REG)) + /* Enable default PC-rel if no regs/segregs */ + insn->x86_ea->ea.pc_rel = 1; break; case YASM_INSN__OPERAND_IMM: insn->x86_ea = @@ -1351,8 +1364,12 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) * short mov instructions if a 32-bit address override is applied in * 64-bit mode to an EA of just an offset (no registers) and the * target register is al/ax/eax/rax. + * + * We don't want to do this if we're in default rel mode. */ - if (insn->common.mode_bits == 64 && insn->common.addrsize == 32 && + if (!id_insn->default_rel && + insn->common.mode_bits == 64 && + insn->common.addrsize == 32 && (!insn->x86_ea->ea.disp.abs || !yasm_expr__contains(insn->x86_ea->ea.disp.abs, YASM_EXPR_REG))) { @@ -1577,6 +1594,7 @@ yasm_x86__parse_check_insnprefix(yasm_arch *arch, const char *id, id_insn->suffix = 0; id_insn->parser = arch_x86->parser; id_insn->force_strict = arch_x86->force_strict != 0; + id_insn->default_rel = arch_x86->default_rel != 0; *bc = yasm_bc_create_common(&x86_id_insn_callback, id_insn, line); return YASM_ARCH_INSN; } @@ -1608,6 +1626,7 @@ yasm_x86__parse_check_insnprefix(yasm_arch *arch, const char *id, id_insn->suffix = pdata->flags; id_insn->parser = arch_x86->parser; id_insn->force_strict = arch_x86->force_strict != 0; + id_insn->default_rel = arch_x86->default_rel != 0; *bc = yasm_bc_create_common(&x86_id_insn_callback, id_insn, line); return YASM_ARCH_INSN; } else { @@ -1670,6 +1689,7 @@ yasm_x86__create_empty_insn(yasm_arch *arch, unsigned long line) id_insn->suffix = 0; id_insn->parser = arch_x86->parser; id_insn->force_strict = arch_x86->force_strict != 0; + id_insn->default_rel = arch_x86->default_rel != 0; return yasm_bc_create_common(&x86_id_insn_callback, id_insn, line); } diff --git a/modules/parsers/nasm/nasm-parse.c b/modules/parsers/nasm/nasm-parse.c index b449dd1c..b3927e03 100644 --- a/modules/parsers/nasm/nasm-parse.c +++ b/modules/parsers/nasm/nasm-parse.c @@ -755,8 +755,11 @@ parse_memaddr(yasm_parser_nasm *parser_nasm) } get_next_token(); ea = parse_memaddr(parser_nasm); - if (ea) + if (ea) { yasm_ea_set_segreg(ea, segreg); + ea->pc_rel = 0; + ea->not_pc_rel = 1; + } return ea; } case SIZE_OVERRIDE: @@ -774,6 +777,22 @@ parse_memaddr(yasm_parser_nasm *parser_nasm) if (ea) ea->nosplit = 1; return ea; + case REL: + get_next_token(); + ea = parse_memaddr(parser_nasm); + if (ea) { + ea->pc_rel = 1; + ea->not_pc_rel = 0; + } + return ea; + case ABS: + get_next_token(); + ea = parse_memaddr(parser_nasm); + if (ea) { + ea->pc_rel = 0; + ea->not_pc_rel = 1; + } + return ea; default: { yasm_expr *e = parse_expr(parser_nasm, NORM_EXPR); @@ -1131,15 +1150,21 @@ nasm_parser_directive(yasm_parser_nasm *parser_nasm, const char *name, objext_valparams, line)) ; else if (yasm__strcasecmp(name, "absolute") == 0) { - vp = yasm_vps_first(valparams); - if (parser_nasm->absstart) - yasm_expr_destroy(parser_nasm->absstart); - if (parser_nasm->abspos) - yasm_expr_destroy(parser_nasm->abspos); - parser_nasm->absstart = yasm_vp_expr(vp, p_object->symtab, line); - parser_nasm->abspos = yasm_expr_copy(parser_nasm->absstart); - cursect = NULL; - parser_nasm->prev_bc = NULL; + if (!valparams) { + yasm_error_set(YASM_ERROR_SYNTAX, + N_("directive `%s' requires an argument"), + "absolute"); + } else { + vp = yasm_vps_first(valparams); + if (parser_nasm->absstart) + yasm_expr_destroy(parser_nasm->absstart); + if (parser_nasm->abspos) + yasm_expr_destroy(parser_nasm->abspos); + parser_nasm->absstart = yasm_vp_expr(vp, p_object->symtab, line); + parser_nasm->abspos = yasm_expr_copy(parser_nasm->absstart); + cursect = NULL; + parser_nasm->prev_bc = NULL; + } } else if (yasm__strcasecmp(name, "align") == 0) { /* Really, we shouldn't end up with an align directive in an absolute * section (as it's supposed to be only used for nop fill), but handle @@ -1166,6 +1191,27 @@ nasm_parser_directive(yasm_parser_nasm *parser_nasm, const char *name, N_("directive `%s' requires an argument"), "align"); } else dir_align(p_object, valparams, objext_valparams, line); + } else if (yasm__strcasecmp(name, "default") == 0) { + if (!valparams) + ; + else { + vp = yasm_vps_first(valparams); + while (vp) { + const char *id = yasm_vp_id(vp); + if (id) { + if (yasm__strcasecmp(id, "rel") == 0) + yasm_arch_set_var(p_object->arch, "default_rel", 1); + else if (yasm__strcasecmp(id, "abs") == 0) + yasm_arch_set_var(p_object->arch, "default_rel", 0); + else + yasm_error_set(YASM_ERROR_SYNTAX, + N_("unrecognized default `%s'"), id); + } else + yasm_error_set(YASM_ERROR_SYNTAX, + N_("unrecognized default value")); + vp = yasm_vps_next(vp); + } + } } else yasm_error_set(YASM_ERROR_SYNTAX, N_("unrecognized directive `%s'"), name); diff --git a/modules/parsers/nasm/nasm-parser.h b/modules/parsers/nasm/nasm-parser.h index a2671559..4c8de413 100644 --- a/modules/parsers/nasm/nasm-parser.h +++ b/modules/parsers/nasm/nasm-parser.h @@ -45,6 +45,8 @@ enum tokentype { TIMES, SEG, WRT, + ABS, + REL, NOSPLIT, STRICT, INSN, diff --git a/modules/parsers/nasm/nasm-token.re b/modules/parsers/nasm/nasm-token.re index 2e0f3076..cfaad6d5 100644 --- a/modules/parsers/nasm/nasm-token.re +++ b/modules/parsers/nasm/nasm-token.re @@ -315,6 +315,9 @@ scan: 'seg' { RETURN(SEG); } 'wrt' { RETURN(WRT); } + 'abs' { RETURN(ABS); } + 'rel' { RETURN(REL); } + 'nosplit' { RETURN(NOSPLIT); } 'strict' { RETURN(STRICT); } diff --git a/modules/preprocs/nasm/standard.mac b/modules/preprocs/nasm/standard.mac index 6d285d9e..6efd3c84 100644 --- a/modules/preprocs/nasm/standard.mac +++ b/modules/preprocs/nasm/standard.mac @@ -114,6 +114,10 @@ __SECT__ [cpu %1] %endmacro +%imacro default 1+.nolist +[default %1] +%endmacro + ; NASM compatibility shim %define __OUTPUT_FORMAT__ __YASM_OBJFMT__ From bb67a2b08d716eb0c6fcc513a7256d6a7fcdde27 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 20 Sep 2007 03:55:17 +0000 Subject: [PATCH 098/585] Fix a couple of warnings (non-prototype functions). svn path=/trunk/yasm/; revision=1967 --- frontends/yasm/yasm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontends/yasm/yasm.c b/frontends/yasm/yasm.c index 93976152..8800d321 100644 --- a/frontends/yasm/yasm.c +++ b/frontends/yasm/yasm.c @@ -220,7 +220,7 @@ typedef struct constcharparam { static constcharparam_head preproc_options; static int -do_preproc_only() +do_preproc_only(void) { yasm_linemap *linemap; char *preproc_buf = yasm_xmalloc(PREPROC_BUF_SIZE); @@ -318,7 +318,7 @@ do_preproc_only() } static int -do_assemble() +do_assemble(void) { yasm_object *object; const char *base_filename; From b4b0a136da2f6fefa5ae335b67bfd3786840ff19 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 20 Sep 2007 03:58:31 +0000 Subject: [PATCH 099/585] Update Mkfiles to add new cpp module. svn path=/trunk/yasm/; revision=1968 --- Mkfiles/Makefile.dj | 7 ++++++- Mkfiles/Makefile.flat | 7 ++++++- Mkfiles/vc/modules/modules.vcproj | 7 +++++++ Mkfiles/vc8/modules/modules.vcproj | 8 ++++++++ 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/Mkfiles/Makefile.dj b/Mkfiles/Makefile.dj index dff9b6d4..ffb48fec 100644 --- a/Mkfiles/Makefile.dj +++ b/Mkfiles/Makefile.dj @@ -125,9 +125,14 @@ MODULES_PREPROCS_RAW_OBJS = \ modules/preprocs/raw/raw-preproc.o YASM_MODULES+=preproc_raw +MODULES_PREPROCS_CPP_OBJS = \ + modules/preprocs/cpp/cpp-preproc.o +YASM_MODULES+=preproc_cpp + MODULES_PREPROCS_OBJS = \ $(MODULES_PREPROCS_NASM_OBJS) \ - $(MODULES_PREPROCS_RAW_OBJS) + $(MODULES_PREPROCS_RAW_OBJS) \ + $(MODULES_PREPROCS_CPP_OBJS) MODULES_OBJS = \ $(MODULES_ARCH_OBJS) \ diff --git a/Mkfiles/Makefile.flat b/Mkfiles/Makefile.flat index 42ddd691..b138e4b6 100644 --- a/Mkfiles/Makefile.flat +++ b/Mkfiles/Makefile.flat @@ -128,9 +128,14 @@ MODULES_PREPROCS_RAW_OBJS = \ modules/preprocs/raw/raw-preproc.o YASM_MODULES+=preproc_raw +MODULES_PREPROCS_CPP_OBJS = \ + modules/preprocs/cpp/cpp-preproc.o +YASM_MODULES+=preproc_cpp + MODULES_PREPROCS_OBJS = \ $(MODULES_PREPROCS_NASM_OBJS) \ - $(MODULES_PREPROCS_RAW_OBJS) + $(MODULES_PREPROCS_RAW_OBJS) \ + $(MODULES_PREPROCS_CPP_OBJS) MODULES_OBJS = \ $(MODULES_ARCH_OBJS) \ diff --git a/Mkfiles/vc/modules/modules.vcproj b/Mkfiles/vc/modules/modules.vcproj index 6d043ed0..5fe66b20 100644 --- a/Mkfiles/vc/modules/modules.vcproj +++ b/Mkfiles/vc/modules/modules.vcproj @@ -310,6 +310,13 @@ RelativePath="..\..\..\modules\preprocs\raw\raw-preproc.c"> + + + + + + + + Date: Thu, 20 Sep 2007 04:23:48 +0000 Subject: [PATCH 100/585] Finish cleanups made in [1967]. svn path=/trunk/yasm/; revision=1969 --- frontends/yasm/yasm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/frontends/yasm/yasm.c b/frontends/yasm/yasm.c index 8800d321..31281874 100644 --- a/frontends/yasm/yasm.c +++ b/frontends/yasm/yasm.c @@ -505,7 +505,6 @@ do_assemble(void) int main(int argc, char *argv[]) { - /*@null@*/ FILE *in = NULL; size_t i; errfile = stderr; @@ -630,7 +629,7 @@ main(int argc, char *argv[]) /* handle preproc-only case here */ if (preproc_only) - return do_preproc_only(in); + return do_preproc_only(); /* If list file enabled, make sure we have a list format loaded. */ if (list_filename) { @@ -655,7 +654,7 @@ main(int argc, char *argv[]) } } - return do_assemble(in); + return do_assemble(); } /*@=globstate =unrecog@*/ From 4db86bc131a8b1551530020279d0ac68de31ed4c Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 20 Sep 2007 04:24:46 +0000 Subject: [PATCH 101/585] Autoconfize cpp program name and popen. This commit inactivates cpp in the VC build files, as there's no popen. svn path=/trunk/yasm/; revision=1970 --- Mkfiles/dj/config.h | 6 ++++++ Mkfiles/vc/config.h | 8 +++++++- Mkfiles/vc8/config.h | 8 +++++++- configure.ac | 3 +++ modules/preprocs/cpp/cpp-preproc.c | 19 +++++++++++++------ 5 files changed, 36 insertions(+), 8 deletions(-) diff --git a/Mkfiles/dj/config.h b/Mkfiles/dj/config.h index 1c834263..f9faf334 100644 --- a/Mkfiles/dj/config.h +++ b/Mkfiles/dj/config.h @@ -4,6 +4,9 @@ #define yasm__abspath(path) yasm__abspath_win(path) #define yasm__combpath(from, to) yasm__combpath_win(from, to) +/* Command name to run C preprocessor */ +#define CPP_PROG "gcc -E" + /* */ /* #undef ENABLE_NLS */ @@ -55,6 +58,9 @@ /* Define if you have the `mergesort function. */ /* #undef HAVE_MERGESORT */ +/* Define to 1 if you have the `popen' function. */ +#define HAVE_POPEN 1 + /* Define if you have the header file. */ #define HAVE_STDINT_H 1 diff --git a/Mkfiles/vc/config.h b/Mkfiles/vc/config.h index 43a580ee..e78ddf2e 100644 --- a/Mkfiles/vc/config.h +++ b/Mkfiles/vc/config.h @@ -4,6 +4,9 @@ #define yasm__abspath(path) yasm__abspath_win(path) #define yasm__combpath(from, to) yasm__combpath_win(from, to) +/* Command name to run C preprocessor */ +#define CPP_PROG "cpp" + /* */ /* #undef ENABLE_NLS */ @@ -52,9 +55,12 @@ /* Define if you have the header file. */ /* #undef HAVE_MEMORY_H */ -/* Define if you have the `mergesort function. */ +/* Define if you have the `mergesort' function. */ /* #undef HAVE_MERGESORT */ +/* Define to 1 if you have the `popen' function. */ +/* #undef HAVE_POPEN */ + /* Define if you have the header file. */ /* #undef HAVE_STDINT_H */ diff --git a/Mkfiles/vc8/config.h b/Mkfiles/vc8/config.h index 759683d0..50369a0c 100644 --- a/Mkfiles/vc8/config.h +++ b/Mkfiles/vc8/config.h @@ -4,6 +4,9 @@ #define yasm__abspath(path) yasm__abspath_win(path) #define yasm__combpath(from, to) yasm__combpath_win(from, to) +/* Command name to run C preprocessor */ +#define CPP_PROG "cpp" + /* */ /* #undef ENABLE_NLS */ @@ -52,9 +55,12 @@ /* Define if you have the header file. */ /* #undef HAVE_MEMORY_H */ -/* Define if you have the `mergesort function. */ +/* Define if you have the `mergesort' function. */ /* #undef HAVE_MERGESORT */ +/* Define to 1 if you have the `popen' function. */ +/* #undef HAVE_POPEN */ + /* Define if you have the header file. */ /* #undef HAVE_STDINT_H */ diff --git a/configure.ac b/configure.ac index 8fa4b4d2..f539d124 100644 --- a/configure.ac +++ b/configure.ac @@ -72,6 +72,8 @@ esac], enable_python_bindings="auto") # # Checks for programs. # +AC_PROG_CPP +AC_DEFINE_UNQUOTED([CPP_PROG], "${CPP}", [Command name to run C preprocessor]) AC_PROG_CC_STDC AC_PROG_INSTALL AC_PROG_LN_S @@ -123,6 +125,7 @@ AX_CREATE_STDINT_H([libyasm-stdint.h]) # AC_CHECK_FUNCS([abort toascii vsnprintf]) AC_CHECK_FUNCS([strsep mergesort getcwd]) +AC_CHECK_FUNCS([popen]) # Look for the case-insensitive comparison functions AC_CHECK_FUNCS([strcasecmp strncasecmp stricmp _stricmp strcmpi]) diff --git a/modules/preprocs/cpp/cpp-preproc.c b/modules/preprocs/cpp/cpp-preproc.c index c28e6e6d..2e1a856c 100644 --- a/modules/preprocs/cpp/cpp-preproc.c +++ b/modules/preprocs/cpp/cpp-preproc.c @@ -97,13 +97,10 @@ cpp_build_cmdline(yasm_preproc_cpp *pp, const char *extra) char *cmdline, *p, *limit; cpp_arg_entry *arg; - /* - Initialize command line. We can assume there will be enough space to - store "cpp". - */ - cmdline = p = yasm_xmalloc(CMDLINE_SIZE); + /* Initialize command line. */ + cmdline = p = yasm_xmalloc(strlen(CPP_PROG)+CMDLINE_SIZE); limit = p + CMDLINE_SIZE; - strcpy(p, "cpp"); + strcpy(p, CPP_PROG); p += 3; arg = TAILQ_FIRST(&pp->cpp_args); @@ -138,9 +135,13 @@ cpp_invoke(yasm_preproc_cpp *pp) cmdline = cpp_build_cmdline(pp, NULL); +#ifdef HAVE_POPEN pp->f = popen(cmdline, "r"); if (!pp->f) yasm__fatal( N_("Failed to execute preprocessor") ); +#else + yasm__fatal( N_("Cannot execute preprocessor, no popen available") ); +#endif yasm_xfree(cmdline); } @@ -166,9 +167,13 @@ cpp_generate_deps(yasm_preproc_cpp *pp) cmdline = cpp_build_cmdline(pp, "-M"); +#ifdef HAVE_POPEN pp->f_deps = popen(cmdline, "r"); if (!pp->f_deps) yasm__fatal( N_("Failed to execute preprocessor") ); +#else + yasm__fatal( N_("Cannot execute preprocessor, no popen available") ); +#endif yasm_xfree(cmdline); } @@ -211,8 +216,10 @@ cpp_preproc_destroy(yasm_preproc *preproc) yasm_preproc_cpp *pp = (yasm_preproc_cpp *)preproc; if (pp->f) { +#ifdef HAVE_POPEN if (pclose(pp->f) != 0) yasm__fatal( N_("Preprocessor exited with failure") ); +#endif } cpp_destroy_args(pp); From 314cbfd3efd311d6fef2d69150c19bc28cd86da7 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 20 Sep 2007 05:15:29 +0000 Subject: [PATCH 102/585] Follow NASM after all in only turning off default RIP-rel for FS and GS, not all segment registers. FS and GS are the only ones which can have a segment base != 0. svn path=/trunk/yasm/; revision=1971 --- modules/arch/x86/tests/Makefile.inc | 3 + modules/arch/x86/tests/riprel2.asm | 2 +- modules/arch/x86/tests/riprel2.hex | 602 +++++++++++++------------- modules/arch/x86/tests/ripseg.asm | 35 ++ modules/arch/x86/tests/ripseg.errwarn | 6 + modules/arch/x86/tests/ripseg.hex | 170 ++++++++ modules/arch/x86/x86id.c | 7 +- modules/parsers/nasm/nasm-parse.c | 5 +- 8 files changed, 520 insertions(+), 310 deletions(-) create mode 100644 modules/arch/x86/tests/ripseg.asm create mode 100644 modules/arch/x86/tests/ripseg.errwarn create mode 100644 modules/arch/x86/tests/ripseg.hex diff --git a/modules/arch/x86/tests/Makefile.inc b/modules/arch/x86/tests/Makefile.inc index 67e8b5c6..3bd57e0e 100644 --- a/modules/arch/x86/tests/Makefile.inc +++ b/modules/arch/x86/tests/Makefile.inc @@ -131,6 +131,9 @@ EXTRA_DIST += modules/arch/x86/tests/riprel1.hex EXTRA_DIST += modules/arch/x86/tests/riprel2.asm EXTRA_DIST += modules/arch/x86/tests/riprel2.errwarn EXTRA_DIST += modules/arch/x86/tests/riprel2.hex +EXTRA_DIST += modules/arch/x86/tests/ripseg.asm +EXTRA_DIST += modules/arch/x86/tests/ripseg.errwarn +EXTRA_DIST += modules/arch/x86/tests/ripseg.hex EXTRA_DIST += modules/arch/x86/tests/segmov.asm EXTRA_DIST += modules/arch/x86/tests/segmov.hex EXTRA_DIST += modules/arch/x86/tests/shift.asm diff --git a/modules/arch/x86/tests/riprel2.asm b/modules/arch/x86/tests/riprel2.asm index 813d9e5a..7f3be69a 100644 --- a/modules/arch/x86/tests/riprel2.asm +++ b/modules/arch/x86/tests/riprel2.asm @@ -69,7 +69,7 @@ mov rax,[abs dword foo] mov rax,[abs qword foo] - ; all of these are abs due to es:, except for explicit rel + ; all of these are default rel, except for 64-bit displacements mov rax,[es:foo] mov rax,[qword es:123456789abcdef0h] mov rbx,[es:foo] diff --git a/modules/arch/x86/tests/riprel2.hex b/modules/arch/x86/tests/riprel2.hex index 5d9a9183..a7b6f112 100644 --- a/modules/arch/x86/tests/riprel2.hex +++ b/modules/arch/x86/tests/riprel2.hex @@ -2,7 +2,7 @@ 8b 04 25 -c4 +c0 02 00 00 @@ -20,7 +20,7 @@ bc 8b 1c 25 -c4 +c0 02 00 00 @@ -28,7 +28,7 @@ c4 8b 04 25 -c4 +c0 02 00 00 @@ -36,13 +36,13 @@ c4 8b 1c 25 -c4 +c0 02 00 00 48 a1 -c4 +c0 02 00 00 @@ -53,21 +53,21 @@ c4 48 8b 05 -89 +85 02 00 00 48 8b 1d -82 +7e 02 00 00 48 8b 05 -7b +77 02 00 00 @@ -75,7 +75,7 @@ c4 8b 04 25 -c4 +c0 02 00 00 @@ -83,7 +83,7 @@ c4 8b 1c 25 -c4 +c0 02 00 00 @@ -91,13 +91,13 @@ c4 8b 04 25 -c4 +c0 02 00 00 48 a1 -c4 +c0 02 00 00 @@ -110,7 +110,7 @@ c4 8b 04 25 -c4 +c0 02 00 00 @@ -130,7 +130,7 @@ bc 8b 1c 25 -c4 +c0 02 00 00 @@ -139,7 +139,7 @@ c4 8b 04 25 -c4 +c0 02 00 00 @@ -148,14 +148,14 @@ c4 8b 1c 25 -c4 +c0 02 00 00 26 48 a1 -c4 +c0 02 00 00 @@ -167,259 +167,259 @@ c4 48 8b 05 +13 +02 +00 +00 +26 +48 +8b +1d +0b +02 +00 +00 +26 +48 +8b +05 +03 +02 +00 +00 +26 +48 +8b +04 +25 +c0 +02 +00 +00 +26 +48 +8b +1c +25 +c0 +02 +00 +00 +26 +48 +8b +04 +25 +c0 +02 +00 +00 +26 +48 +a1 +c0 +02 +00 +00 +00 +00 +00 +00 +64 +48 +8b +04 +25 +c0 +02 +00 +00 +64 +48 +a1 +f0 +de +bc +9a +78 +56 +34 +12 +64 +48 +8b +1c +25 +c0 +02 +00 +00 +64 +48 +8b +04 +25 +c0 +02 +00 +00 +64 +48 +8b +1c +25 +c0 +02 +00 +00 +64 +48 +a1 +c0 +02 +00 +00 +00 +00 +00 +00 +64 +48 +8b +05 +9b +01 +00 +00 +64 +48 +8b +1d +93 +01 +00 +00 +64 +48 +8b +05 +8b +01 +00 +00 +64 +48 +8b +04 +25 +c0 +02 +00 +00 +64 +48 +8b +1c +25 +c0 +02 +00 +00 +64 +48 +8b +04 +25 +c0 +02 +00 +00 +64 +48 +a1 +c0 +02 +00 +00 +00 +00 +00 +00 +48 +8b +03 +48 +8b +03 +48 +8b +03 +48 +8b +05 +55 +01 +00 +00 +48 +a1 +f0 +de +bc +9a +78 +56 +34 +12 +48 +8b +1d +44 +01 +00 +00 +48 +8b +05 +3d +01 +00 +00 +48 +8b +1d +36 +01 +00 +00 +48 +a1 +c0 +02 +00 +00 +00 +00 +00 +00 +48 +8b +05 +25 +01 +00 +00 +48 +8b +1d +1e +01 +00 +00 +48 +8b +05 17 -02 -00 -00 -26 -48 -8b -1d -0f -02 -00 -00 -26 -48 -8b -05 -07 -02 -00 -00 -26 -48 -8b -04 -25 -c4 -02 -00 -00 -26 -48 -8b -1c -25 -c4 -02 -00 -00 -26 -48 -8b -04 -25 -c4 -02 -00 -00 -26 -48 -a1 -c4 -02 -00 -00 -00 -00 -00 -00 -64 -48 -8b -04 -25 -c4 -02 -00 -00 -64 -48 -a1 -f0 -de -bc -9a -78 -56 -34 -12 -64 -48 -8b -1c -25 -c4 -02 -00 -00 -64 -48 -8b -04 -25 -c4 -02 -00 -00 -64 -48 -8b -1c -25 -c4 -02 -00 -00 -64 -48 -a1 -c4 -02 -00 -00 -00 -00 -00 -00 -64 -48 -8b -05 -9f -01 -00 -00 -64 -48 -8b -1d -97 -01 -00 -00 -64 -48 -8b -05 -8f -01 -00 -00 -64 -48 -8b -04 -25 -c4 -02 -00 -00 -64 -48 -8b -1c -25 -c4 -02 -00 -00 -64 -48 -8b -04 -25 -c4 -02 -00 -00 -64 -48 -a1 -c4 -02 -00 -00 -00 -00 -00 -00 -48 -8b -03 -48 -8b -03 -48 -8b -03 -48 -8b -05 -59 -01 -00 -00 -48 -a1 -f0 -de -bc -9a -78 -56 -34 -12 -48 -8b -1d -48 -01 -00 -00 -48 -8b -05 -41 -01 -00 -00 -48 -8b -1d -3a -01 -00 -00 -48 -a1 -c4 -02 -00 -00 -00 -00 -00 -00 -48 -8b -05 -29 -01 -00 -00 -48 -8b -1d -22 -01 -00 -00 -48 -8b -05 -1b 01 00 00 @@ -427,7 +427,7 @@ c4 8b 04 25 -c4 +c0 02 00 00 @@ -435,7 +435,7 @@ c4 8b 1c 25 -c4 +c0 02 00 00 @@ -443,13 +443,13 @@ c4 8b 04 25 -c4 +c0 02 00 00 48 a1 -c4 +c0 02 00 00 @@ -460,10 +460,9 @@ c4 26 48 8b -04 -25 -c4 -02 +05 +ed +00 00 00 26 @@ -480,34 +479,31 @@ bc 26 48 8b -1c -25 -c4 -02 +1d +da +00 00 00 26 48 8b -04 -25 -c4 -02 +05 +d2 +00 00 00 26 48 8b -1c -25 -c4 -02 +1d +ca +00 00 00 26 48 a1 -c4 +c0 02 00 00 @@ -544,7 +540,7 @@ a7 8b 04 25 -c4 +c0 02 00 00 @@ -553,7 +549,7 @@ c4 8b 1c 25 -c4 +c0 02 00 00 @@ -562,14 +558,14 @@ c4 8b 04 25 -c4 +c0 02 00 00 26 48 a1 -c4 +c0 02 00 00 @@ -582,7 +578,7 @@ c4 8b 04 25 -c4 +c0 02 00 00 @@ -602,7 +598,7 @@ bc 8b 1c 25 -c4 +c0 02 00 00 @@ -611,7 +607,7 @@ c4 8b 04 25 -c4 +c0 02 00 00 @@ -620,14 +616,14 @@ c4 8b 1c 25 -c4 +c0 02 00 00 64 48 a1 -c4 +c0 02 00 00 @@ -664,7 +660,7 @@ c4 8b 04 25 -c4 +c0 02 00 00 @@ -673,7 +669,7 @@ c4 8b 1c 25 -c4 +c0 02 00 00 @@ -682,14 +678,14 @@ c4 8b 04 25 -c4 +c0 02 00 00 64 48 a1 -c4 +c0 02 00 00 diff --git a/modules/arch/x86/tests/ripseg.asm b/modules/arch/x86/tests/ripseg.asm new file mode 100644 index 00000000..1779a1c9 --- /dev/null +++ b/modules/arch/x86/tests/ripseg.asm @@ -0,0 +1,35 @@ +bits 64 +foo: + +default abs +mov rbx, [foo] +mov rbx, [es:foo] +mov rbx, [fs:foo] +mov rbx, [gs:foo] +mov rbx, [rel es:foo] +mov rbx, [rel fs:foo] +mov rbx, [rel gs:foo] +mov rbx, [abs es:foo] +mov rbx, [abs fs:foo] +mov rbx, [abs gs:foo] +;mov rbx, [es:rel foo] +;mov rbx, [fs:rel foo] +;mov rbx, [es:abs foo] +;mov rbx, [fs:abs foo] + +default rel +mov rbx, [foo] +mov rbx, [es:foo] +mov rbx, [fs:foo] +mov rbx, [gs:foo] +mov rbx, [rel es:foo] +mov rbx, [rel fs:foo] +mov rbx, [rel gs:foo] +mov rbx, [abs es:foo] +mov rbx, [abs fs:foo] +mov rbx, [abs gs:foo] +;mov rbx, [es:rel foo] +;mov rbx, [fs:rel foo] +;mov rbx, [es:abs foo] +;mov rbx, [fs:abs foo] + diff --git a/modules/arch/x86/tests/ripseg.errwarn b/modules/arch/x86/tests/ripseg.errwarn new file mode 100644 index 00000000..19782ddd --- /dev/null +++ b/modules/arch/x86/tests/ripseg.errwarn @@ -0,0 +1,6 @@ +-:6: warning: `es' segment register ignored in 64-bit mode +-:9: warning: `es' segment register ignored in 64-bit mode +-:12: warning: `es' segment register ignored in 64-bit mode +-:22: warning: `es' segment register ignored in 64-bit mode +-:25: warning: `es' segment register ignored in 64-bit mode +-:28: warning: `es' segment register ignored in 64-bit mode diff --git a/modules/arch/x86/tests/ripseg.hex b/modules/arch/x86/tests/ripseg.hex new file mode 100644 index 00000000..5303fe94 --- /dev/null +++ b/modules/arch/x86/tests/ripseg.hex @@ -0,0 +1,170 @@ +48 +8b +1c +25 +00 +00 +00 +00 +26 +48 +8b +1c +25 +00 +00 +00 +00 +64 +48 +8b +1c +25 +00 +00 +00 +00 +65 +48 +8b +1c +25 +00 +00 +00 +00 +26 +48 +8b +1d +d5 +ff +ff +ff +64 +48 +8b +1d +cd +ff +ff +ff +65 +48 +8b +1d +c5 +ff +ff +ff +26 +48 +8b +1c +25 +00 +00 +00 +00 +64 +48 +8b +1c +25 +00 +00 +00 +00 +65 +48 +8b +1c +25 +00 +00 +00 +00 +48 +8b +1d +a3 +ff +ff +ff +26 +48 +8b +1d +9b +ff +ff +ff +64 +48 +8b +1c +25 +00 +00 +00 +00 +65 +48 +8b +1c +25 +00 +00 +00 +00 +26 +48 +8b +1d +81 +ff +ff +ff +64 +48 +8b +1d +79 +ff +ff +ff +65 +48 +8b +1d +71 +ff +ff +ff +26 +48 +8b +1c +25 +00 +00 +00 +00 +64 +48 +8b +1c +25 +00 +00 +00 +00 +65 +48 +8b +1c +25 +00 +00 +00 +00 diff --git a/modules/arch/x86/x86id.c b/modules/arch/x86/x86id.c index 59e74aed..7312913e 100644 --- a/modules/arch/x86/x86id.c +++ b/modules/arch/x86/x86id.c @@ -1178,10 +1178,13 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) yasm_x86__ea_set_disponly(insn->x86_ea); else if (id_insn->default_rel && !op->data.ea->not_pc_rel && - op->data.ea->segreg == 0 && + op->data.ea->segreg != 0x6404 && + op->data.ea->segreg != 0x6505 && !yasm_expr__contains( op->data.ea->disp.abs, YASM_EXPR_REG)) - /* Enable default PC-rel if no regs/segregs */ + /* Enable default PC-rel if no regs and segreg + * is not FS or GS. + */ insn->x86_ea->ea.pc_rel = 1; break; case YASM_INSN__OPERAND_IMM: diff --git a/modules/parsers/nasm/nasm-parse.c b/modules/parsers/nasm/nasm-parse.c index b3927e03..641de04e 100644 --- a/modules/parsers/nasm/nasm-parse.c +++ b/modules/parsers/nasm/nasm-parse.c @@ -755,11 +755,8 @@ parse_memaddr(yasm_parser_nasm *parser_nasm) } get_next_token(); ea = parse_memaddr(parser_nasm); - if (ea) { + if (ea) yasm_ea_set_segreg(ea, segreg); - ea->pc_rel = 0; - ea->not_pc_rel = 1; - } return ea; } case SIZE_OVERRIDE: From 1049719c7bc056ba912fbc3b9cf2d1012c34f2a1 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 21 Sep 2007 06:56:02 +0000 Subject: [PATCH 103/585] Remove yapp-preproc.c from list of files to scan for gettext. svn path=/trunk/yasm/; revision=1972 --- po/POTFILES.in | 1 - 1 file changed, 1 deletion(-) diff --git a/po/POTFILES.in b/po/POTFILES.in index 34438fa8..4cb66b12 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -55,7 +55,6 @@ modules/parsers/gas/gas-token.re modules/parsers/nasm/nasm-parse.c modules/parsers/nasm/nasm-token.re modules/preprocs/cpp/cpp-preproc.c -modules/preprocs/yapp/yapp-preproc.c modules/preprocs/nasm/nasm-preproc.c modules/preprocs/nasm/nasm-pp.c modules/preprocs/raw/raw-preproc.c From bd7c26d2a629330b51d2e6594c5f96063836436f Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 21 Sep 2007 17:48:17 +0000 Subject: [PATCH 104/585] Fix #115: 1<<0 resulted in 0 instead of 1 (broken in [1900]). svn path=/trunk/yasm/; revision=1979 --- libyasm/intnum.c | 4 ++-- libyasm/tests/Makefile.inc | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libyasm/intnum.c b/libyasm/intnum.c index 5fc177b1..2820fa2e 100644 --- a/libyasm/intnum.c +++ b/libyasm/intnum.c @@ -462,14 +462,14 @@ yasm_intnum_calc(yasm_intnum *acc, yasm_expr_op op, yasm_intnum *operand) Set_Complement(result, result); break; case YASM_EXPR_SHL: - if (operand->type == INTNUM_L && operand->val.l > 0) { + if (operand->type == INTNUM_L && operand->val.l >= 0) { BitVector_Copy(result, op1); BitVector_Move_Left(result, (N_int)operand->val.l); } else /* don't even bother, just zero result */ BitVector_Empty(result); break; case YASM_EXPR_SHR: - if (operand->type == INTNUM_L && operand->val.l > 0) { + if (operand->type == INTNUM_L && operand->val.l >= 0) { BitVector_Copy(result, op1); carry = BitVector_msb_(op1); count = (N_int)operand->val.l; diff --git a/libyasm/tests/Makefile.inc b/libyasm/tests/Makefile.inc index 1528ef68..e0e3d951 100644 --- a/libyasm/tests/Makefile.inc +++ b/libyasm/tests/Makefile.inc @@ -9,6 +9,8 @@ TESTS += uncstring_test TESTS += libyasm/tests/libyasm_test.sh EXTRA_DIST += libyasm/tests/libyasm_test.sh +EXTRA_DIST += libyasm/tests/1shl0.asm +EXTRA_DIST += libyasm/tests/1shl0.hex EXTRA_DIST += libyasm/tests/absloop-err.asm EXTRA_DIST += libyasm/tests/absloop-err.errwarn EXTRA_DIST += libyasm/tests/charconst64.asm From 358acf45974d436be0bcc5eff21fdcdcbd0c7d84 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 21 Sep 2007 18:04:47 +0000 Subject: [PATCH 105/585] Commit tests missed in [1979] commit. svn path=/trunk/yasm/; revision=1981 --- libyasm/tests/1shl0.asm | 1 + libyasm/tests/1shl0.hex | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 libyasm/tests/1shl0.asm create mode 100644 libyasm/tests/1shl0.hex diff --git a/libyasm/tests/1shl0.asm b/libyasm/tests/1shl0.asm new file mode 100644 index 00000000..d69930ad --- /dev/null +++ b/libyasm/tests/1shl0.asm @@ -0,0 +1 @@ +dd (1<<0) diff --git a/libyasm/tests/1shl0.hex b/libyasm/tests/1shl0.hex new file mode 100644 index 00000000..607fb55a --- /dev/null +++ b/libyasm/tests/1shl0.hex @@ -0,0 +1,4 @@ +01 +00 +00 +00 From ab9c1236195af96fb99ddcc3ab9330714eabf30e Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 21 Sep 2007 18:06:47 +0000 Subject: [PATCH 106/585] Add some imm64 tests. svn path=/trunk/yasm/; revision=1983 --- modules/arch/x86/tests/Makefile.inc | 3 + modules/arch/x86/tests/imm64.asm | 35 ++++++ modules/arch/x86/tests/imm64.errwarn | 3 + modules/arch/x86/tests/imm64.hex | 175 +++++++++++++++++++++++++++ 4 files changed, 216 insertions(+) create mode 100644 modules/arch/x86/tests/imm64.asm create mode 100644 modules/arch/x86/tests/imm64.errwarn create mode 100644 modules/arch/x86/tests/imm64.hex diff --git a/modules/arch/x86/tests/Makefile.inc b/modules/arch/x86/tests/Makefile.inc index 3bd57e0e..87761177 100644 --- a/modules/arch/x86/tests/Makefile.inc +++ b/modules/arch/x86/tests/Makefile.inc @@ -55,6 +55,9 @@ EXTRA_DIST += modules/arch/x86/tests/fwdequ64.asm EXTRA_DIST += modules/arch/x86/tests/fwdequ64.hex EXTRA_DIST += modules/arch/x86/tests/genopcode.asm EXTRA_DIST += modules/arch/x86/tests/genopcode.hex +EXTRA_DIST += modules/arch/x86/tests/imm64.asm +EXTRA_DIST += modules/arch/x86/tests/imm64.errwarn +EXTRA_DIST += modules/arch/x86/tests/imm64.hex EXTRA_DIST += modules/arch/x86/tests/iret.asm EXTRA_DIST += modules/arch/x86/tests/iret.hex EXTRA_DIST += modules/arch/x86/tests/jmp64-1.asm diff --git a/modules/arch/x86/tests/imm64.asm b/modules/arch/x86/tests/imm64.asm new file mode 100644 index 00000000..5b41bfae --- /dev/null +++ b/modules/arch/x86/tests/imm64.asm @@ -0,0 +1,35 @@ +bits 64 +default abs +;extern label1 +label1: +label2: + +mov rax, 0x1000 ; 32-bit imm +mov rax, 0x1122334455667788 ; 64-bit imm (larger than signed 32-bit) +;mov rax, 0x80000000 ; 64-bit imm (larger than signed 32-bit) +mov rax, label1 ; 32-bit imm <--- not 64-bit! +mov rax, label2 ; 32-bit imm <--- not 64-bit! +mov rax, qword 0x1000 ; 64-bit imm +mov rax, qword label1 ; 64-bit imm +mov rax, qword label2 ; 64-bit imm + +mov qword [rax], 0x1000 ; 32-bit imm +mov qword [rax], 0x1122334455667788 ; 32-bit imm, overflow warning +;mov qword [rax], 0x80000000 ; 32-bit imm, overflow warning +mov qword [rax], label1 ; 32-bit imm (matches default above) +mov qword [rax], label2 ; 32-bit imm (matches default above) + +add rax, 0x1000 ; 32-bit imm +add rax, 0x1122334455667788 ; 32-bit imm, overflow warning +;add rax, 0x80000000 ; 32-bit imm, overflow warning +add rax, label1 ; 32-bit imm (matches default above) +add rax, label2 ; 32-bit imm (matches default above) + +mov [0x1000], rax ; 32-bit disp +mov [abs 0x1122334455667788], rax ; 64-bit disp +mov [label1], rax ; 32-bit disp +mov [label2], rax ; 32-bit disp +mov [qword 0x1000], rax ; 64-bit disp +mov [qword label1], rax ; 64-bit disp +mov [qword label2], rax ; 64-bit disp + diff --git a/modules/arch/x86/tests/imm64.errwarn b/modules/arch/x86/tests/imm64.errwarn new file mode 100644 index 00000000..a0487353 --- /dev/null +++ b/modules/arch/x86/tests/imm64.errwarn @@ -0,0 +1,3 @@ +-:17: warning: value does not fit in 32 bit field +-:23: warning: value does not fit in 32 bit field +-:29: warning: value does not fit in 32 bit field diff --git a/modules/arch/x86/tests/imm64.hex b/modules/arch/x86/tests/imm64.hex new file mode 100644 index 00000000..af46a719 --- /dev/null +++ b/modules/arch/x86/tests/imm64.hex @@ -0,0 +1,175 @@ +48 +c7 +c0 +00 +10 +00 +00 +48 +b8 +88 +77 +66 +55 +44 +33 +22 +11 +48 +c7 +c0 +00 +00 +00 +00 +48 +c7 +c0 +00 +00 +00 +00 +48 +b8 +00 +10 +00 +00 +00 +00 +00 +00 +48 +b8 +00 +00 +00 +00 +00 +00 +00 +00 +48 +b8 +00 +00 +00 +00 +00 +00 +00 +00 +48 +c7 +00 +00 +10 +00 +00 +48 +c7 +00 +88 +77 +66 +55 +48 +c7 +00 +00 +00 +00 +00 +48 +c7 +00 +00 +00 +00 +00 +48 +05 +00 +10 +00 +00 +48 +05 +88 +77 +66 +55 +48 +05 +00 +00 +00 +00 +48 +05 +00 +00 +00 +00 +48 +89 +04 +25 +00 +10 +00 +00 +48 +89 +04 +25 +88 +77 +66 +55 +48 +89 +04 +25 +00 +00 +00 +00 +48 +89 +04 +25 +00 +00 +00 +00 +48 +a3 +00 +10 +00 +00 +00 +00 +00 +00 +48 +a3 +00 +00 +00 +00 +00 +00 +00 +00 +48 +a3 +00 +00 +00 +00 +00 +00 +00 +00 From c19c68ab7d232933be7ca9d1c2728d960eb35213 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 21 Sep 2007 19:15:48 +0000 Subject: [PATCH 107/585] Bring flat and DJGPP Mkfiles up to date with [1939]. svn path=/trunk/yasm/; revision=1988 --- Mkfiles/Makefile.dj | 8 ++++---- Mkfiles/Makefile.flat | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Mkfiles/Makefile.dj b/Mkfiles/Makefile.dj index ffb48fec..56afb281 100644 --- a/Mkfiles/Makefile.dj +++ b/Mkfiles/Makefile.dj @@ -182,16 +182,16 @@ x86insn_nasm.gperf x86insn_gas.gperf x86insns.c: modules/arch/x86/gen_x86_insn.p -python modules/arch/x86/gen_x86_insn.py x86insn_nasm.c: x86insn_nasm.gperf genperf - ./genperf x86insn_nasm.gperf > $@ + ./genperf x86insn_nasm.gperf $@ x86insn_gas.c: x86insn_gas.gperf genperf - ./genperf x86insn_gas.gperf > $@ + ./genperf x86insn_gas.gperf $@ x86cpu.c: modules/arch/x86/x86cpu.gperf genperf - ./genperf modules/arch/x86/x86cpu.gperf > $@ + ./genperf modules/arch/x86/x86cpu.gperf $@ x86regtmod.c: modules/arch/x86/x86regtmod.gperf genperf - ./genperf modules/arch/x86/x86regtmod.gperf > $@ + ./genperf modules/arch/x86/x86regtmod.gperf $@ modules/arch/x86/x86id.c: x86insn_nasm.c x86insn_gas.c x86insns.c diff --git a/Mkfiles/Makefile.flat b/Mkfiles/Makefile.flat index b138e4b6..2dd1b56b 100644 --- a/Mkfiles/Makefile.flat +++ b/Mkfiles/Makefile.flat @@ -185,16 +185,16 @@ x86insn_nasm.gperf x86insn_gas.gperf x86insns.c: modules/arch/x86/gen_x86_insn.p -python modules/arch/x86/gen_x86_insn.py x86insn_nasm.c: x86insn_nasm.gperf genperf - ./genperf x86insn_nasm.gperf > $@ + ./genperf x86insn_nasm.gperf $@ x86insn_gas.c: x86insn_gas.gperf genperf - ./genperf x86insn_gas.gperf > $@ + ./genperf x86insn_gas.gperf $@ x86cpu.c: modules/arch/x86/x86cpu.gperf genperf - ./genperf modules/arch/x86/x86cpu.gperf > $@ + ./genperf modules/arch/x86/x86cpu.gperf $@ x86regtmod.c: modules/arch/x86/x86regtmod.gperf genperf - ./genperf modules/arch/x86/x86regtmod.gperf > $@ + ./genperf modules/arch/x86/x86regtmod.gperf $@ modules/arch/x86/x86id.c: x86insn_nasm.c x86insn_gas.c x86insns.c From 900d862cf09556593a8c8c6be12163b07b120149 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 21 Sep 2007 21:16:33 +0000 Subject: [PATCH 108/585] Update yasm_arch(7) man page from AMD64 wiki page. svn path=/trunk/yasm/; revision=1992 --- modules/arch/yasm_arch.xml | 79 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/modules/arch/yasm_arch.xml b/modules/arch/yasm_arch.xml index 46002919..6ca9c9fd 100644 --- a/modules/arch/yasm_arch.xml +++ b/modules/arch/yasm_arch.xml @@ -22,6 +22,7 @@ 2004 2005 2006 + 2007 Peter Johnson @@ -229,6 +230,23 @@ mov ecx, -1 ; 5 byte, equivalent to above mov rcx, sym ; 5 byte, 32-bit size default for symbols mov rcx, qword sym ; 10 byte, override default size + + The handling of mov reg64, unsized immediate is different + between YASM and NASM 2.x; YASM follows the above behavior, while + NASM 2.x does the following: + + add rax, 0xffffffff ; sign-extended 32-bit immediate + add rax, -1 ; same as above + add rax, 0xffffffffffffffff ; truncated 32-bit (warning) + add rax, sym ; sign-extended 32-bit immediate + mov eax, 1 ; 5 byte (32-bit immediate) + mov rax, 1 ; 10 byte (64-bit immediate) + mov rbx, 0x1234567890abcdef ; 10 byte instruction + mov rcx, 0xffffffff ; 10 byte instruction + mov ecx, -1 ; 5 byte, equivalent to above + mov ecx, sym ; 5 byte (32-bit immediate) + mov rcx, sym ; 10 byte instruction + mov rcx, qword sym ; 10 byte (64-bit immediate) @@ -280,6 +298,67 @@ value 1 there. If symb is a variable, this will not store the value 1 into the symb variable! + + Yasm also supports the following syntax for RIP-relative + addressing: + + mov [rel sym], rax ; RIP-relative + mov [abs sym], rax ; not RIP-relative + + The behavior of: + + mov [sym], rax + + Depends on a mode set by the DEFAULT directive, as follows. + The default mode is always "abs", and in "rel" mode, use of + registers, an fs or gs segment override, or an explicit "abs" + override will result in a non-RIP-relative effective + address. + + default rel + mov [sym], rbx ; RIP-relative + mov [abs sym], rbx ; not RIP-relative (explicit override) + mov [rbx+1], rbx ; not RIP-relative (register use) + mov [fs:sym], rbx ; not RIP-relative (fs or gs use) + mov [ds:sym], rbx ; RIP-relative (segment, but not fs or gs) + mov [rel sym], rbx ; RIP-relative (redundant override) + + default abs + mov [sym], rbx ; not RIP-relative + mov [abs sym], rbx ; not RIP-relative + mov [rbx+1], rbx ; not RIP-relative + mov [fs:sym], rbx ; not RIP-relative + mov [ds:sym], rbx ; not RIP-relative + mov [rel sym], rbx ; RIP-relative (explicit override) + + + + Memory references + + Usually the size of a memory reference can be deduced by + which registers you're moving--for example, "mov [rax],ecx" is a + 32-bit move, because ecx is 32 bits. YASM currently gives the + non-obvious "invalid combination of opcode and operands" error if + it can't figure out how much memory you're moving. The fix in + this case is to add a memory size specifier: qword, dword, word, + or byte. + + Here's a 64-bit memory move, which sets 8 bytes starting at + rax: + + mov qword [rax], 1 + + Here's a 32-bit memory move, which sets 4 bytes: + + mov dword [rax], 1 + + Here's a 16-bit memory move, which sets 2 bytes: + + mov word [rax], 1 + + Here's an 8-bit memory move, which sets 1 byte: + + mov byte [rax], 1 From d37c3b61837c228ec6aecffa1e00d9e59c1a98df Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 21 Sep 2007 21:30:00 +0000 Subject: [PATCH 109/585] Add core2 as alias for conroe codename. svn path=/trunk/yasm/; revision=1993 --- modules/arch/x86/x86cpu.gperf | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/arch/x86/x86cpu.gperf b/modules/arch/x86/x86cpu.gperf index 45edd071..5487d320 100644 --- a/modules/arch/x86/x86cpu.gperf +++ b/modules/arch/x86/x86cpu.gperf @@ -261,6 +261,7 @@ k10, x86_cpu_amd, PROC_k10 bulldozer, x86_cpu_amd, PROC_bulldozer prescott, x86_cpu_intel, PROC_prescott conroe, x86_cpu_intel, PROC_conroe +core2, x86_cpu_intel, PROC_conroe penryn, x86_cpu_intel, PROC_penryn nehalem, x86_cpu_intel, PROC_nehalem # From df68b7ad76b0a7a11bb5ff461efb05e1bf22d5e9 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 11 Oct 2007 06:05:41 +0000 Subject: [PATCH 110/585] Fix explicitly-overridden short-only instructions such as "loop short label". These would incorrectly be treated as errors. svn path=/trunk/yasm/; revision=2001 --- modules/arch/x86/tests/genopcode.asm | 3 +++ modules/arch/x86/tests/genopcode.hex | 7 +++++++ modules/arch/x86/x86id.c | 4 ++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/modules/arch/x86/tests/genopcode.asm b/modules/arch/x86/tests/genopcode.asm index f37695d3..357c010e 100644 --- a/modules/arch/x86/tests/genopcode.asm +++ b/modules/arch/x86/tests/genopcode.asm @@ -168,6 +168,9 @@ jmp near label jmp far [label] jmp far dword [label] call far word [label] +loop short label +jcxz short label +jecxz short label [bits 16] push si push esi diff --git a/modules/arch/x86/tests/genopcode.hex b/modules/arch/x86/tests/genopcode.hex index d6a562d2..37b3cf94 100644 --- a/modules/arch/x86/tests/genopcode.hex +++ b/modules/arch/x86/tests/genopcode.hex @@ -482,6 +482,13 @@ ff 1e b9 01 +e2 +d3 +e3 +d1 +67 +e3 +ce 56 66 56 diff --git a/modules/arch/x86/x86id.c b/modules/arch/x86/x86id.c index 7312913e..0687ef15 100644 --- a/modules/arch/x86/x86id.c +++ b/modules/arch/x86/x86id.c @@ -515,10 +515,10 @@ x86_finalize_jmp(yasm_bytecode *bc, yasm_bytecode *prev_bc, } } - if ((jmp->op_sel == JMP_SHORT_FORCED) && (jmp->nearop.len == 0)) + if ((jmp->op_sel == JMP_SHORT_FORCED) && (jmp->shortop.len == 0)) yasm_error_set(YASM_ERROR_TYPE, N_("no SHORT form of that jump instruction exists")); - if ((jmp->op_sel == JMP_NEAR_FORCED) && (jmp->shortop.len == 0)) + if ((jmp->op_sel == JMP_NEAR_FORCED) && (jmp->nearop.len == 0)) yasm_error_set(YASM_ERROR_TYPE, N_("no NEAR form of that jump instruction exists")); From 50baffb3fd4139219e3374494d100a498af48770 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 11 Oct 2007 06:38:29 +0000 Subject: [PATCH 111/585] x86_finalize_jmp(): Fix two incorrect usages of info instead of jinfo. svn path=/trunk/yasm/; revision=2002 --- modules/arch/x86/x86id.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/arch/x86/x86id.c b/modules/arch/x86/x86id.c index 0687ef15..f16b3a10 100644 --- a/modules/arch/x86/x86id.c +++ b/modules/arch/x86/x86id.c @@ -453,7 +453,7 @@ x86_finalize_jmp(yasm_bytecode *bc, yasm_bytecode *prev_bc, size_lookup[insn_operands[jinfo->operands_index+1].size]; /* Check for address size override */ - for (i=0; imodifiers); i++) { + for (i=0; imodifiers); i++) { if (jinfo->modifiers[i] == MOD_AdSizeR) jmp->common.addrsize = mod_data[i]; } @@ -529,7 +529,8 @@ x86_finalize_jmp(yasm_bytecode *bc, yasm_bytecode *prev_bc, jmp->op_sel = JMP_NEAR_FORCED; } - yasm_x86__bc_apply_prefixes((x86_common *)jmp, NULL, info->def_opersize_64, + yasm_x86__bc_apply_prefixes((x86_common *)jmp, NULL, + jinfo->def_opersize_64, id_insn->insn.num_prefixes, id_insn->insn.prefixes); From 86206d60a80187d533b5fba85e0800a484c2a5ea Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 11 Oct 2007 07:29:41 +0000 Subject: [PATCH 112/585] x86_find_match(): Fix error reporting for operand 3 mismatches. svn path=/trunk/yasm/; revision=2003 --- modules/arch/x86/x86id.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/arch/x86/x86id.c b/modules/arch/x86/x86id.c index f16b3a10..13dcff60 100644 --- a/modules/arch/x86/x86id.c +++ b/modules/arch/x86/x86id.c @@ -839,13 +839,13 @@ x86_find_match(x86_id_insn *id_insn, yasm_insn_operand **ops, if (op->type == YASM_INSN__OPERAND_REG && op->size == 0) { /* Register size must exactly match */ if ((bypass == 4 && i == 0) || (bypass == 5 && i == 1) - || (bypass == 6 && i == 3)) + || (bypass == 6 && i == 2)) ; else if (yasm_x86__get_reg_size(op->data.reg) != size) mismatch = 1; } else { if ((bypass == 1 && i == 0) || (bypass == 2 && i == 1) - || (bypass == 3 && i == 3)) + || (bypass == 3 && i == 2)) ; else if (info_ops[i].relaxed) { /* Relaxed checking */ From 02378aa9e609ad147a334a958cc5a7d522e58901 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 16 Oct 2007 07:40:21 +0000 Subject: [PATCH 113/585] Fix #118: Don't use getcwd(NULL, 0), as it's platform-specific behavior. Instead write our own yasm__getcwd() which retries getcwd() with increasing buffer sizes until the path fits (as the initial size is 1024, in basically all cases it'll succeed on the first try). Reported by: bird-yasm@anduin.net svn path=/trunk/yasm/; revision=2004 --- libyasm/file.c | 29 ++++++++++++++++++++++++---- libyasm/file.h | 6 ++++++ modules/dbgfmts/dwarf2/dwarf2-info.c | 11 ++--------- 3 files changed, 33 insertions(+), 13 deletions(-) diff --git a/libyasm/file.c b/libyasm/file.c index 48cb6f25..a231d89d 100644 --- a/libyasm/file.c +++ b/libyasm/file.c @@ -35,6 +35,7 @@ #endif #include +#include #include "errwarn.h" #include "file.h" @@ -226,6 +227,26 @@ yasm__splitpath_win(const char *path, /*@out@*/ const char **tail) return s-path+1; } +char * +yasm__getcwd(void) +{ + char *buf; + size_t size; + + size = 1024; + buf = yasm_xmalloc(size); + while (getcwd(buf, size) == NULL) { + if (errno != ERANGE) { + yasm__fatal(N_("could not determine current working directory")); + yasm_xfree(buf); + return NULL; + } + size *= 2; + buf = yasm_xrealloc(buf, size); + } + return buf; +} + /* FIXME: dumb way for now */ char * yasm__abspath_unix(const char *path) @@ -233,14 +254,14 @@ yasm__abspath_unix(const char *path) char *curdir, *abspath; static const char pathsep[2] = "/"; - curdir = getcwd(NULL, 0); + curdir = yasm__getcwd(); abspath = yasm_xmalloc(strlen(curdir) + strlen(path) + 2); strcpy(abspath, curdir); strcat(abspath, pathsep); strcat(abspath, path); - free(curdir); + yasm_xfree(curdir); return abspath; } @@ -252,14 +273,14 @@ yasm__abspath_win(const char *path) char *curdir, *abspath, *ch; static const char pathsep[2] = "\\"; - curdir = getcwd(NULL, 0); + curdir = yasm__getcwd(); abspath = yasm_xmalloc(strlen(curdir) + strlen(path) + 2); strcpy(abspath, curdir); strcat(abspath, pathsep); strcat(abspath, path); - free(curdir); + yasm_xfree(curdir); /* Replace all / with \ */ ch = abspath; diff --git a/libyasm/file.h b/libyasm/file.h index 21676cdd..4a1cd005 100644 --- a/libyasm/file.h +++ b/libyasm/file.h @@ -115,6 +115,12 @@ size_t yasm__splitpath_win(const char *path, /*@out@*/ const char **tail); # endif #endif +/** Get the current working directory. + * \internal + * \return Current working directory pathname (newly allocated). + */ +/*@only@*/ char *yasm__getcwd(void); + /** Convert a UNIX relative or absolute pathname into an absolute pathname. * \internal * \param path pathname diff --git a/modules/dbgfmts/dwarf2/dwarf2-info.c b/modules/dbgfmts/dwarf2/dwarf2-info.c index 9c3d52a5..b6b45eaa 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-info.c +++ b/modules/dbgfmts/dwarf2/dwarf2-info.c @@ -27,13 +27,6 @@ #include /*@unused@*/ RCSID("$Id$"); -/* Need either unistd.h or direct.h (on Windows) to prototype getcwd() */ -#if defined(HAVE_UNISTD_H) -#include -#elif defined(HAVE_DIRECT_H) -#include -#endif - #include #include "dwarf2-dbgfmt.h" @@ -337,9 +330,9 @@ yasm_dwarf2__generate_info(yasm_object *object, yasm_section *debug_line, /* compile directory (current working directory) */ abc->len += dwarf2_add_abbrev_attr(abbrev, DW_AT_comp_dir, DW_FORM_string); - buf = getcwd(NULL, 0); + buf = yasm__getcwd(); dwarf2_append_str(debug_info, buf); - free(buf); + yasm_xfree(buf); /* producer - assembler name */ abc->len += dwarf2_add_abbrev_attr(abbrev, DW_AT_producer, DW_FORM_string); From c79ad07fae623caf5adc18ec07dfabbc1ce86cbf Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Mon, 22 Oct 2007 06:27:02 +0000 Subject: [PATCH 114/585] cpp-preproc.c: Fix typo in description (enternal -> external). svn path=/trunk/yasm/; revision=2005 --- modules/preprocs/cpp/cpp-preproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/preprocs/cpp/cpp-preproc.c b/modules/preprocs/cpp/cpp-preproc.c index 2e1a856c..6b87c427 100644 --- a/modules/preprocs/cpp/cpp-preproc.c +++ b/modules/preprocs/cpp/cpp-preproc.c @@ -350,7 +350,7 @@ cpp_preproc_define_builtin(yasm_preproc *preproc, const char *macronameval) *******************************************************************************/ yasm_preproc_module yasm_cpp_LTX_preproc = { - "Run input through enternal C preprocessor", + "Run input through external C preprocessor", "cpp", cpp_preproc_create, cpp_preproc_destroy, From ba01ca4261c84d236f6b59a3bb518b0b16acc3d2 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 2 Nov 2007 03:14:47 +0000 Subject: [PATCH 115/585] Check correct variable for badly parsed expression. svn path=/trunk/yasm/; revision=2006 --- modules/parsers/nasm/nasm-parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/parsers/nasm/nasm-parse.c b/modules/parsers/nasm/nasm-parse.c index 641de04e..c615ecea 100644 --- a/modules/parsers/nasm/nasm-parse.c +++ b/modules/parsers/nasm/nasm-parse.c @@ -577,7 +577,7 @@ dv_done: if (is_eol()) goto incbin_done; maxlen = parse_expr(parser_nasm, DV_EXPR); - if (!start) { + if (!maxlen) { yasm_error_set(YASM_ERROR_SYNTAX, N_("expression expected for INCBIN maximum length")); return NULL; From f9824d2cfc33f89034981f6faca81ff1f316e85d Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 3 Nov 2007 04:27:35 +0000 Subject: [PATCH 116/585] Change preprocessor interface from block-oriented to line-oriented. This will make certain types of parser-preprocessor synchronization easier for upcoming feature enhancements. Due to additional complexity in GAS (rept), internally GAS converts lines back into blocks. svn path=/trunk/yasm/; revision=2007 --- frontends/yasm/yasm.c | 19 ++++--- libyasm/preproc.h | 21 +++---- modules/parsers/gas/gas-parser.c | 2 + modules/parsers/gas/gas-parser.h | 4 ++ modules/parsers/gas/gas-token.re | 40 ++++++++++++- modules/parsers/nasm/nasm-parse.c | 22 ++++++-- modules/parsers/nasm/nasm-parser.c | 3 +- modules/parsers/nasm/nasm-parser.h | 2 - modules/parsers/nasm/nasm-token.re | 84 ++++------------------------ modules/preprocs/cpp/cpp-preproc.c | 51 +++++++++++++---- modules/preprocs/nasm/nasm-preproc.c | 74 ++++++++++-------------- modules/preprocs/raw/raw-preproc.c | 66 +++++++++++++--------- 12 files changed, 199 insertions(+), 189 deletions(-) diff --git a/frontends/yasm/yasm.c b/frontends/yasm/yasm.c index 31281874..b7bfd80c 100644 --- a/frontends/yasm/yasm.c +++ b/frontends/yasm/yasm.c @@ -223,7 +223,7 @@ static int do_preproc_only(void) { yasm_linemap *linemap; - char *preproc_buf = yasm_xmalloc(PREPROC_BUF_SIZE); + char *preproc_buf; size_t got; const char *base_filename; FILE *out = NULL; @@ -257,10 +257,8 @@ do_preproc_only(void) } else { /* Open output (object) file */ out = open_file(obj_filename, "wt"); - if (!out) { - yasm_xfree(preproc_buf); + if (!out) return EXIT_FAILURE; - } } /* Pre-process until done */ @@ -273,6 +271,8 @@ do_preproc_only(void) if (generate_make_dependencies) { size_t totlen; + preproc_buf = yasm_xmalloc(PREPROC_BUF_SIZE); + fprintf(stdout, "%s: %s", obj_filename, in_filename); totlen = strlen(obj_filename)+2+strlen(in_filename); @@ -287,10 +287,13 @@ do_preproc_only(void) fwrite(preproc_buf, got, 1, stdout); } fputc('\n', stdout); + yasm_xfree(preproc_buf); } else { - while ((got = yasm_preproc_input(cur_preproc, preproc_buf, - PREPROC_BUF_SIZE)) != 0) - fwrite(preproc_buf, got, 1, out); + while ((preproc_buf = yasm_preproc_get_line(cur_preproc)) != NULL) { + fputs(preproc_buf, out); + fputc('\n', out); + yasm_xfree(preproc_buf); + } } if (out != stdout) @@ -301,7 +304,6 @@ do_preproc_only(void) print_yasm_error, print_yasm_warning); if (out != stdout) remove(obj_filename); - yasm_xfree(preproc_buf); yasm_linemap_destroy(linemap); yasm_errwarns_destroy(errwarns); cleanup(NULL); @@ -310,7 +312,6 @@ do_preproc_only(void) yasm_errwarns_output_all(errwarns, linemap, warning_error, print_yasm_error, print_yasm_warning); - yasm_xfree(preproc_buf); yasm_linemap_destroy(linemap); yasm_errwarns_destroy(errwarns); cleanup(NULL); diff --git a/libyasm/preproc.h b/libyasm/preproc.h index 98f56e8f..0964c0e8 100644 --- a/libyasm/preproc.h +++ b/libyasm/preproc.h @@ -73,11 +73,10 @@ typedef struct yasm_preproc_module { */ void (*destroy) (/*@only@*/ yasm_preproc *preproc); - /** Module-level implementation of yasm_preproc_input(). - * Call yasm_preproc_input() instead of calling this function. + /** Module-level implementation of yasm_preproc_get_line(). + * Call yasm_preproc_get_line() instead of calling this function. */ - size_t (*input) (yasm_preproc *preproc, /*@out@*/ char *buf, - size_t max_size); + char * (*get_line) (yasm_preproc *preproc); /** Module-level implementation of yasm_preproc_get_included_file(). * Call yasm_preproc_get_included_file() instead of calling this function. @@ -125,15 +124,11 @@ typedef struct yasm_preproc_module { */ void yasm_preproc_destroy(/*@only@*/ yasm_preproc *preproc); -/** Gets more preprocessed source code (up to max_size bytes) into buf. - * More than a single line may be returned in buf. +/** Gets a single line of preprocessed source code. * \param preproc preprocessor - * \param buf destination buffer for preprocessed source - * \param max_size maximum number of bytes that can be returned in buf - * \return Actual number of bytes returned in buf. + * \return Allocated line of code, without the trailing \n. */ -size_t yasm_preproc_input(yasm_preproc *preproc, /*@out@*/ char *buf, - size_t max_size); +char *yasm_preproc_get_line(yasm_preproc *preproc); /** Get the next filename included by the source code. * \param preproc preprocessor @@ -180,8 +175,8 @@ void yasm_preproc_define_builtin(yasm_preproc *preproc, #define yasm_preproc_destroy(preproc) \ ((yasm_preproc_base *)preproc)->module->destroy(preproc) -#define yasm_preproc_input(preproc, buf, max_size) \ - ((yasm_preproc_base *)preproc)->module->input(preproc, buf, max_size) +#define yasm_preproc_get_line(preproc) \ + ((yasm_preproc_base *)preproc)->module->get_line(preproc) #define yasm_preproc_get_included_file(preproc, buf, max_size) \ ((yasm_preproc_base *)preproc)->module->get_included_file(preproc, buf, max_size) #define yasm_preproc_add_include_file(preproc, filename) \ diff --git a/modules/parsers/gas/gas-parser.c b/modules/parsers/gas/gas-parser.c index 521851cd..80bd5039 100644 --- a/modules/parsers/gas/gas-parser.c +++ b/modules/parsers/gas/gas-parser.c @@ -64,6 +64,8 @@ gas_parser_do_parse(yasm_object *object, yasm_preproc *pp, parser_gas.peek_token = NONE; + parser_gas.line = NULL; + /* initialize scanner structure */ yasm_scanner_initialize(&parser_gas.s); diff --git a/modules/parsers/gas/gas-parser.h b/modules/parsers/gas/gas-parser.h index eece2a23..0a22e3e4 100644 --- a/modules/parsers/gas/gas-parser.h +++ b/modules/parsers/gas/gas-parser.h @@ -122,6 +122,10 @@ typedef struct yasm_parser_gas { YYCTYPE save_line[2][MAX_SAVED_LINE_LEN]; int save_last; + /* Line data storage used in preproc_input(). */ + char *line, *linepos; + size_t lineleft; + yasm_scanner s; enum gas_parser_state state; diff --git a/modules/parsers/gas/gas-token.re b/modules/parsers/gas/gas-token.re index 1251225d..c72ce901 100644 --- a/modules/parsers/gas/gas-token.re +++ b/modules/parsers/gas/gas-token.re @@ -125,6 +125,43 @@ rept_input(yasm_parser_gas *parser_gas, /*@out@*/ YYCTYPE *buf, return (max_size-numleft); } + +/* Bridge function to convert byte-oriented parser with line-oriented + * preprocessor. + */ +static size_t +preproc_input(yasm_parser_gas *parser_gas, /*@out@*/ YYCTYPE *buf, + size_t max_size) +{ + size_t tot=0; + while (max_size > 0) { + size_t n; + + if (!parser_gas->line) { + parser_gas->line = yasm_preproc_get_line(parser_gas->preproc); + if (!parser_gas->line) + return tot; /* EOF */ + parser_gas->linepos = parser_gas->line; + parser_gas->lineleft = strlen(parser_gas->line) + 1; + parser_gas->line[parser_gas->lineleft-1] = '\n'; + } + + n = parser_gas->lineleftlineleft : max_size; + strncpy((char *)buf+tot, parser_gas->linepos, n); + + if (n == parser_gas->lineleft) { + yasm_xfree(parser_gas->line); + parser_gas->line = NULL; + } else { + parser_gas->lineleft -= n; + parser_gas->linepos += n; + } + + tot += n; + max_size -= n; + } + return tot; +} #if 0 static size_t fill_input(void *d, unsigned char *buf, size_t max) @@ -163,8 +200,7 @@ fill(yasm_parser_gas *parser_gas, YYCTYPE *cursor) if (parser_gas->rept && parser_gas->rept->ended) { /* Pull from rept lines instead of preproc */ cnt = rept_input(parser_gas, s->lim, BSIZE); - } else if((cnt = yasm_preproc_input(parser_gas->preproc, - (char *)s->lim, BSIZE)) == 0) { + } else if((cnt = preproc_input(parser_gas, s->lim, BSIZE)) == 0) { s->eof = &s->lim[cnt]; *s->eof++ = '\n'; } s->lim += cnt; diff --git a/modules/parsers/nasm/nasm-parse.c b/modules/parsers/nasm/nasm-parse.c index c615ecea..2f7f59ba 100644 --- a/modules/parsers/nasm/nasm-parse.c +++ b/modules/parsers/nasm/nasm-parse.c @@ -64,7 +64,7 @@ static void nasm_parser_directive static void define_label(yasm_parser_nasm *parser_nasm, /*@only@*/ char *name, int local); -#define is_eol_tok(tok) ((tok) == '\n' || (tok) == 0) +#define is_eol_tok(tok) ((tok) == 0) #define is_eol() is_eol_tok(curtok) #define get_next_token() (curtok = nasm_parser_lex(&curval, parser_nasm)) @@ -186,9 +186,19 @@ expect_(yasm_parser_nasm *parser_nasm, int token) void nasm_parser_parse(yasm_parser_nasm *parser_nasm) { - while (get_next_token() != 0) { + unsigned char *line; + while ((line = (unsigned char *) + yasm_preproc_get_line(parser_nasm->preproc)) != NULL) { yasm_bytecode *bc = NULL, *temp_bc; - + + parser_nasm->s.bot = line; + parser_nasm->s.tok = line; + parser_nasm->s.ptr = line; + parser_nasm->s.cur = line; + parser_nasm->s.lim = line + strlen((char *)line)+1; + parser_nasm->s.top = parser_nasm->s.lim; + + get_next_token(); if (!is_eol()) { bc = parse_line(parser_nasm); demand_eol(); @@ -230,10 +240,10 @@ nasm_parser_parse(yasm_parser_nasm *parser_nasm) yasm_errwarn_propagate(parser_nasm->errwarns, cur_line); if (parser_nasm->save_input) - yasm_linemap_add_source(parser_nasm->linemap, - temp_bc, - (char *)parser_nasm->save_line[parser_nasm->save_last ^ 1]); + yasm_linemap_add_source(parser_nasm->linemap, temp_bc, + (char *)line); yasm_linemap_goto_next(parser_nasm->linemap); + yasm_xfree(line); } } diff --git a/modules/parsers/nasm/nasm-parser.c b/modules/parsers/nasm/nasm-parser.c index 7138c9d2..dc46a717 100644 --- a/modules/parsers/nasm/nasm-parser.c +++ b/modules/parsers/nasm/nasm-parser.c @@ -51,7 +51,6 @@ nasm_parser_do_parse(yasm_object *object, yasm_preproc *pp, parser_nasm.prev_bc = yasm_section_bcs_first(object->cur_section); parser_nasm.save_input = save_input; - parser_nasm.save_last = 0; parser_nasm.peek_token = NONE; @@ -68,7 +67,7 @@ nasm_parser_do_parse(yasm_object *object, yasm_preproc *pp, nasm_parser_parse(&parser_nasm); - yasm_scanner_delete(&parser_nasm.s); + /*yasm_scanner_delete(&parser_nasm.s);*/ /* Free locallabel base if necessary */ if (parser_nasm.locallabel_base) diff --git a/modules/parsers/nasm/nasm-parser.h b/modules/parsers/nasm/nasm-parser.h index 2f145228..359761c3 100644 --- a/modules/parsers/nasm/nasm-parser.h +++ b/modules/parsers/nasm/nasm-parser.h @@ -97,8 +97,6 @@ typedef struct yasm_parser_nasm { /*@null@*/ yasm_bytecode *prev_bc; int save_input; - YYCTYPE save_line[2][MAX_SAVED_LINE_LEN]; - int save_last; yasm_scanner s; enum { diff --git a/modules/parsers/nasm/nasm-token.re b/modules/parsers/nasm/nasm-token.re index cfaad6d5..cbf9fb0f 100644 --- a/modules/parsers/nasm/nasm-token.re +++ b/modules/parsers/nasm/nasm-token.re @@ -34,12 +34,10 @@ RCSID("$Id$"); #include "modules/parsers/nasm/nasm-parser.h" -#define BSIZE 8192 - #define YYCURSOR cursor #define YYLIMIT (s->lim) #define YYMARKER (s->ptr) -#define YYFILL(n) {fill(parser_nasm, &cursor);} +#define YYFILL(n) {} #define RETURN(i) {s->cur = cursor; parser_nasm->tokch = s->tok[0]; \ return i;} @@ -50,48 +48,6 @@ RCSID("$Id$"); #define TOKLEN (size_t)(cursor-s->tok) -static size_t -fill_input(void *d, unsigned char *buf, size_t max) -{ - return yasm_preproc_input((yasm_preproc *)d, (char *)buf, max); -} - -static void -fill(yasm_parser_nasm *parser_nasm, YYCTYPE **cursor) -{ - yasm_scanner *s = &parser_nasm->s; - if (yasm_fill_helper(s, cursor, fill_input, parser_nasm->preproc) - && parser_nasm->save_input) { - int i; - YYCTYPE *saveline; - parser_nasm->save_last ^= 1; - saveline = parser_nasm->save_line[parser_nasm->save_last]; - /* save next line into cur_line */ - for (i=0; i<79 && &s->tok[i] < s->lim && s->tok[i] != '\n'; i++) - saveline[i] = s->tok[i]; - saveline[i] = '\0'; - } -} - -static YYCTYPE * -save_line(yasm_parser_nasm *parser_nasm, YYCTYPE *cursor) -{ - yasm_scanner *s = &parser_nasm->s; - int i = 0; - YYCTYPE *saveline; - - parser_nasm->save_last ^= 1; - saveline = parser_nasm->save_line[parser_nasm->save_last]; - - /* save next line into cur_line */ - if ((YYLIMIT - YYCURSOR) < 80) - YYFILL(80); - for (i=0; i<79 && &cursor[i] < s->lim && cursor[i] != '\n'; i++) - saveline[i] = cursor[i]; - saveline[i] = '\0'; - return cursor; -} - /* starting size of string buffer */ #define STRBUF_ALLOC_SIZE 128 @@ -104,7 +60,7 @@ static size_t strbuf_size = 0; static int linechg_numcount; /*!re2c - any = [\000-\377]; + any = [\001-\377]; digit = [0-9]; iletter = [a-zA-Z]; bindigit = [01]; @@ -133,7 +89,7 @@ nasm_parser_lex(YYSTYPE *lvalp, yasm_parser_nasm *parser_nasm) return tok; } - /* Catch EOF */ + /* Catch EOL (EOF from the scanner perspective) */ if (s->eof && cursor == s->eof) return 0; @@ -406,9 +362,7 @@ scan: ws+ { goto scan; } - "\n" { - if (parser_nasm->save_input) - cursor = save_line(parser_nasm, cursor); + [\000] { parser_nasm->state = INITIAL; RETURN(s->tok[0]); } @@ -435,9 +389,7 @@ linechg: RETURN(INTNUM); } - "\n" { - if (parser_nasm->save_input) - cursor = save_line(parser_nasm, cursor); + [\000] { parser_nasm->state = INITIAL; RETURN(s->tok[0]); } @@ -466,9 +418,7 @@ linechg2: SCANINIT(); /*!re2c - "\n" { - if (parser_nasm->save_input) - cursor = save_line(parser_nasm, cursor); + [\000] { parser_nasm->state = INITIAL; RETURN(s->tok[0]); } @@ -487,9 +437,7 @@ directive: SCANINIT(); /*!re2c - [\]\n] { - if (parser_nasm->save_input) - cursor = save_line(parser_nasm, cursor); + [\]\000] { parser_nasm->state = INITIAL; RETURN(s->tok[0]); } @@ -540,9 +488,7 @@ section_directive: RETURN(s->tok[0]); } - "\n" { - if (parser_nasm->save_input) - cursor = save_line(parser_nasm, cursor); + [\000] { parser_nasm->state = INITIAL; RETURN(s->tok[0]); } @@ -654,9 +600,7 @@ directive2: ws+ { goto directive2; } - "\n" { - if (parser_nasm->save_input) - cursor = save_line(parser_nasm, cursor); + [\000] { parser_nasm->state = INITIAL; RETURN(s->tok[0]); } @@ -679,17 +623,11 @@ stringconst_scan: SCANINIT(); /*!re2c - "\n" { - if (cursor == s->eof) - yasm_error_set(YASM_ERROR_SYNTAX, - N_("unexpected end of file in string")); - else - yasm_error_set(YASM_ERROR_SYNTAX, N_("unterminated string")); + [\000] { + yasm_error_set(YASM_ERROR_SYNTAX, N_("unterminated string")); strbuf[count] = '\0'; lvalp->str.contents = (char *)strbuf; lvalp->str.len = count; - if (parser_nasm->save_input) - cursor = save_line(parser_nasm, cursor); RETURN(STRING); } diff --git a/modules/preprocs/cpp/cpp-preproc.c b/modules/preprocs/cpp/cpp-preproc.c index 6b87c427..77f3107f 100644 --- a/modules/preprocs/cpp/cpp-preproc.c +++ b/modules/preprocs/cpp/cpp-preproc.c @@ -32,6 +32,8 @@ /* TODO: Use autoconf to get the limit on the command line length. */ #define CMDLINE_SIZE 32770 +#define BSIZE 512 + /* Pre-declare the preprocessor module object. */ yasm_preproc_module yasm_cpp_LTX_preproc; @@ -228,11 +230,12 @@ cpp_preproc_destroy(yasm_preproc *preproc) yasm_xfree(pp); } -static size_t -cpp_preproc_input(yasm_preproc *preproc, char *buf, size_t max_size) +static char * +cpp_preproc_get_line(yasm_preproc *preproc) { - size_t n; yasm_preproc_cpp *pp = (yasm_preproc_cpp *)preproc; + int bufsize = BSIZE; + char *buf, *p; if (! (pp->flags & CPP_HAS_BEEN_INVOKED) ) { pp->flags |= CPP_HAS_BEEN_INVOKED; @@ -244,14 +247,42 @@ cpp_preproc_input(yasm_preproc *preproc, char *buf, size_t max_size) Once the preprocessor has been run, we're just dealing with a normal file. */ - if (((n = fread(buf, 1, max_size, pp->f)) == 0) && - ferror(pp->f)) { - yasm_error_set(YASM_ERROR_IO, N_("error reading from pipe")); - yasm_errwarn_propagate(pp->errwarns, - yasm_linemap_get_current(pp->cur_lm)); + + /* Loop to ensure entire line is read (don't want to limit line length). */ + buf = yasm_xmalloc((size_t)bufsize); + p = buf; + for (;;) { + if (!fgets(p, bufsize-(p-buf), pp->f)) { + if (ferror(pp->f)) { + yasm_error_set(YASM_ERROR_IO, + N_("error when reading from file")); + yasm_errwarn_propagate(pp->errwarns, + yasm_linemap_get_current(pp->cur_lm)); + } + break; + } + p += strlen(p); + if (p > buf && p[-1] == '\n') + break; + if ((p-buf) >= bufsize) { + /* Increase size of buffer */ + char *oldbuf = buf; + bufsize *= 2; + buf = yasm_xrealloc(buf, (size_t)bufsize); + p = buf + (p-oldbuf); + } } - return n; + if (p == buf) { + /* No data; must be at EOF */ + yasm_xfree(buf); + return NULL; + } + + /* Strip the line ending */ + buf[strcspn(buf, "\r\n")] = '\0'; + + return buf; } static size_t @@ -354,7 +385,7 @@ yasm_preproc_module yasm_cpp_LTX_preproc = { "cpp", cpp_preproc_create, cpp_preproc_destroy, - cpp_preproc_input, + cpp_preproc_get_line, cpp_preproc_get_included_file, cpp_preproc_add_include_file, cpp_preproc_predefine_macro, diff --git a/modules/preprocs/nasm/nasm-preproc.c b/modules/preprocs/nasm/nasm-preproc.c index 78993b57..c1394a26 100644 --- a/modules/preprocs/nasm/nasm-preproc.c +++ b/modules/preprocs/nasm/nasm-preproc.c @@ -38,8 +38,7 @@ typedef struct yasm_preproc_nasm { yasm_preproc_base preproc; /* Base structure */ FILE *in; - char *line, *linepos; - size_t lineleft; + char *line; char *file_name; long prior_linnum; int lineinc; @@ -129,7 +128,7 @@ nasm_efunc(int severity, const char *fmt, ...) static yasm_preproc * nasm_preproc_create(const char *in_filename, yasm_linemap *lm, - yasm_errwarns *errwarns) + yasm_errwarns *errwarns) { FILE *f; yasm_preproc_nasm *preproc_nasm = yasm_xmalloc(sizeof(yasm_preproc_nasm)); @@ -163,6 +162,8 @@ nasm_preproc_destroy(yasm_preproc *preproc) { yasm_preproc_nasm *preproc_nasm = (yasm_preproc_nasm *)preproc; nasmpp.cleanup(0); + if (preproc_nasm->line) + yasm_xfree(preproc_nasm->line); if (preproc_nasm->file_name) yasm_xfree(preproc_nasm->file_name); yasm_xfree(preproc); @@ -170,54 +171,37 @@ nasm_preproc_destroy(yasm_preproc *preproc) yasm_xfree(preproc_deps); } -static size_t -nasm_preproc_input(yasm_preproc *preproc, char *buf, size_t max_size) +static char * +nasm_preproc_get_line(yasm_preproc *preproc) { yasm_preproc_nasm *preproc_nasm = (yasm_preproc_nasm *)preproc; - size_t tot = 0, n; - long linnum = preproc_nasm->prior_linnum += preproc_nasm->lineinc; + long linnum; int altline; + char *line; - if (!preproc_nasm->line) { - preproc_nasm->line = nasmpp.getline(); - if (!preproc_nasm->line) - return 0; - preproc_nasm->linepos = preproc_nasm->line; - preproc_nasm->lineleft = strlen(preproc_nasm->line) + 1; - preproc_nasm->line[preproc_nasm->lineleft-1] = '\n'; - - altline = nasm_src_get(&linnum, &preproc_nasm->file_name); - if (altline) { - if (altline == 1 && preproc_nasm->lineinc == 1) { - *buf++ = '\n'; - max_size--; - tot++; - } else { - preproc_nasm->lineinc = - (altline != -1 || preproc_nasm->lineinc != 1); - n = sprintf(buf, "%%line %ld+%d %s\n", linnum, - preproc_nasm->lineinc, preproc_nasm->file_name); - buf += n; - max_size -= n; - tot += n; - } - preproc_nasm->prior_linnum = linnum; - } - } - - n = preproc_nasm->lineleftlineleft:max_size; - strncpy(buf, preproc_nasm->linepos, n); - tot += n; - - if (n == preproc_nasm->lineleft) { - yasm_xfree(preproc_nasm->line); + if (preproc_nasm->line) { + char *retval = preproc_nasm->line; preproc_nasm->line = NULL; - } else { - preproc_nasm->lineleft -= n; - preproc_nasm->linepos += n; + return retval; } - return tot; + line = nasmpp.getline(); + if (!line) + return NULL; /* EOF */ + + linnum = preproc_nasm->prior_linnum += preproc_nasm->lineinc; + altline = nasm_src_get(&linnum, &preproc_nasm->file_name); + if (altline != 0) { + preproc_nasm->lineinc = + (altline != -1 || preproc_nasm->lineinc != 1); + preproc_nasm->line = line; + line = yasm_xmalloc(40+strlen(preproc_nasm->file_name)); + sprintf(line, "%%line %ld+%d %s", linnum, + preproc_nasm->lineinc, preproc_nasm->file_name); + preproc_nasm->prior_linnum = linnum; + } + + return line; } void @@ -310,7 +294,7 @@ yasm_preproc_module yasm_nasm_LTX_preproc = { "nasm", nasm_preproc_create, nasm_preproc_destroy, - nasm_preproc_input, + nasm_preproc_get_line, nasm_preproc_get_included_file, nasm_preproc_add_include_file, nasm_preproc_predefine_macro, diff --git a/modules/preprocs/raw/raw-preproc.c b/modules/preprocs/raw/raw-preproc.c index 869cbec4..87ec4e07 100644 --- a/modules/preprocs/raw/raw-preproc.c +++ b/modules/preprocs/raw/raw-preproc.c @@ -30,10 +30,11 @@ #include +#define BSIZE 512 + typedef struct yasm_preproc_raw { yasm_preproc_base preproc; /* base structure */ - int is_interactive; FILE *in; yasm_linemap *cur_lm; yasm_errwarns *errwarns; @@ -41,8 +42,6 @@ typedef struct yasm_preproc_raw { yasm_preproc_module yasm_raw_LTX_preproc; -int isatty(int); - static yasm_preproc * raw_preproc_create(const char *in_filename, yasm_linemap *lm, yasm_errwarns *errwarns) @@ -62,9 +61,6 @@ raw_preproc_create(const char *in_filename, yasm_linemap *lm, preproc_raw->in = f; preproc_raw->cur_lm = lm; preproc_raw->errwarns = errwarns; - /*@-unrecog@*/ - preproc_raw->is_interactive = f ? (isatty(fileno(f)) > 0) : 0; - /*@=unrecog@*/ return (yasm_preproc *)preproc_raw; } @@ -75,32 +71,48 @@ raw_preproc_destroy(yasm_preproc *preproc) yasm_xfree(preproc); } -static size_t -raw_preproc_input(yasm_preproc *preproc, char *buf, size_t max_size) +static char * +raw_preproc_get_line(yasm_preproc *preproc) { yasm_preproc_raw *preproc_raw = (yasm_preproc_raw *)preproc; - int c = '*'; - size_t n; + int bufsize = BSIZE; + char *buf = yasm_xmalloc((size_t)bufsize); + char *p; - if (preproc_raw->is_interactive) { - for (n = 0; n < max_size && (c = getc(preproc_raw->in)) != EOF && - c != '\n'; n++) - buf[n] = (char)c; - if (c == '\n') - buf[n++] = (char)c; - if (c == EOF && ferror(preproc_raw->in)) { - yasm_error_set(YASM_ERROR_IO, N_("error when reading from file")); - yasm_errwarn_propagate(preproc_raw->errwarns, - yasm_linemap_get_current(preproc_raw->cur_lm)); + /* Loop to ensure entire line is read (don't want to limit line length). */ + p = buf; + for (;;) { + if (!fgets(p, bufsize-(p-buf), preproc_raw->in)) { + if (ferror(preproc_raw->in)) { + yasm_error_set(YASM_ERROR_IO, + N_("error when reading from file")); + yasm_errwarn_propagate(preproc_raw->errwarns, + yasm_linemap_get_current(preproc_raw->cur_lm)); + } + break; + } + p += strlen(p); + if (p > buf && p[-1] == '\n') + break; + if ((p-buf) >= bufsize) { + /* Increase size of buffer */ + char *oldbuf = buf; + bufsize *= 2; + buf = yasm_xrealloc(buf, (size_t)bufsize); + p = buf + (p-oldbuf); } - } else if (((n = fread(buf, 1, max_size, preproc_raw->in)) == 0) && - ferror(preproc_raw->in)) { - yasm_error_set(YASM_ERROR_IO, N_("error when reading from file")); - yasm_errwarn_propagate(preproc_raw->errwarns, - yasm_linemap_get_current(preproc_raw->cur_lm)); } - return n; + if (p == buf) { + /* No data; must be at EOF */ + yasm_xfree(buf); + return NULL; + } + + /* Strip the line ending */ + buf[strcspn(buf, "\r\n")] = '\0'; + + return buf; } static size_t @@ -142,7 +154,7 @@ yasm_preproc_module yasm_raw_LTX_preproc = { "raw", raw_preproc_create, raw_preproc_destroy, - raw_preproc_input, + raw_preproc_get_line, raw_preproc_get_included_file, raw_preproc_add_include_file, raw_preproc_predefine_macro, From bd06f1aacea9e4d6a7a5de1686ac4a5bb9666d42 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 3 Nov 2007 04:37:44 +0000 Subject: [PATCH 117/585] Support use of EQU values within NASM preprocessor. Note: label values are still not supported, and probably never will be, as yasm is single-pass parsing, and only reads the source file once. Someday we may add specific support for relatively common %if-%error idioms. svn path=/trunk/yasm/; revision=2008 --- frontends/yasm/yasm.c | 4 ++-- libyasm/preproc.h | 9 ++++++--- modules/preprocs/cpp/cpp-preproc.c | 3 ++- modules/preprocs/nasm/nasm-eval.c | 19 +++++++++++++++++++ modules/preprocs/nasm/nasm-preproc.c | 6 ++++-- .../nasm/tests/ifcritical-err.errwarn | 2 +- modules/preprocs/raw/raw-preproc.c | 4 ++-- 7 files changed, 36 insertions(+), 11 deletions(-) diff --git a/frontends/yasm/yasm.c b/frontends/yasm/yasm.c index b7bfd80c..cde5fef8 100644 --- a/frontends/yasm/yasm.c +++ b/frontends/yasm/yasm.c @@ -262,7 +262,7 @@ do_preproc_only(void) } /* Pre-process until done */ - cur_preproc = yasm_preproc_create(cur_preproc_module, in_filename, + cur_preproc = yasm_preproc_create(cur_preproc_module, in_filename, NULL, linemap, errwarns); apply_preproc_builtins(); @@ -423,7 +423,7 @@ do_assemble(void) } cur_preproc = yasm_preproc_create(cur_preproc_module, in_filename, - linemap, errwarns); + object->symtab, linemap, errwarns); apply_preproc_builtins(); apply_preproc_saved_options(); diff --git a/libyasm/preproc.h b/libyasm/preproc.h index 0964c0e8..fff40daa 100644 --- a/libyasm/preproc.h +++ b/libyasm/preproc.h @@ -58,6 +58,7 @@ typedef struct yasm_preproc_module { * * \param in_filename initial starting filename, or "-" to read from * stdin + * \param symtab symbol table (may be NULL if none) * \param lm line mapping repository * \param errwarns error/warnning set. * \return New preprocessor. @@ -65,6 +66,7 @@ typedef struct yasm_preproc_module { * \note Any preprocessor errors and warnings are stored into errwarns. */ /*@only@*/ yasm_preproc * (*create) (const char *in_filename, + yasm_symtab *symtab, yasm_linemap *lm, yasm_errwarns *errwarns); @@ -110,6 +112,7 @@ typedef struct yasm_preproc_module { * any output format specific macros. * \param module preprocessor module * \param in_filename initial starting filename, or "-" to read from stdin + * \param symtab symbol table (may be NULL if none) * \param lm line mapping repository * \param errwarns error/warning set * \return New preprocessor. @@ -117,7 +120,7 @@ typedef struct yasm_preproc_module { */ /*@only@*/ yasm_preproc *yasm_preproc_create (yasm_preproc_module *module, const char *in_filename, - yasm_linemap *lm, yasm_errwarns *errwarns); + yasm_symtab *symtab, yasm_linemap *lm, yasm_errwarns *errwarns); /** Cleans up any allocated preproc memory. * \param preproc preprocessor @@ -170,8 +173,8 @@ void yasm_preproc_define_builtin(yasm_preproc *preproc, /* Inline macro implementations for preproc functions */ -#define yasm_preproc_create(module, in_filename, lm, ews) \ - module->create(in_filename, lm, ews) +#define yasm_preproc_create(module, in_filename, symtab, lm, ews) \ + module->create(in_filename, symtab, lm, ews) #define yasm_preproc_destroy(preproc) \ ((yasm_preproc_base *)preproc)->module->destroy(preproc) diff --git a/modules/preprocs/cpp/cpp-preproc.c b/modules/preprocs/cpp/cpp-preproc.c index 77f3107f..dae2e032 100644 --- a/modules/preprocs/cpp/cpp-preproc.c +++ b/modules/preprocs/cpp/cpp-preproc.c @@ -184,7 +184,8 @@ cpp_generate_deps(yasm_preproc_cpp *pp) Interface functions. *******************************************************************************/ static yasm_preproc * -cpp_preproc_create(const char *in, yasm_linemap *lm, yasm_errwarns *errwarns) +cpp_preproc_create(const char *in, yasm_symtab *symtab, yasm_linemap *lm, + yasm_errwarns *errwarns) { yasm_preproc_cpp *pp = yasm_xmalloc(sizeof(yasm_preproc_cpp)); void * iter; diff --git a/modules/preprocs/nasm/nasm-eval.c b/modules/preprocs/nasm/nasm-eval.c index c896a1cc..e249484c 100644 --- a/modules/preprocs/nasm/nasm-eval.c +++ b/modules/preprocs/nasm/nasm-eval.c @@ -12,12 +12,16 @@ #include #include #include +#include #include #include "nasm.h" #include "nasmlib.h" #include "nasm-eval.h" +/* The assembler symbol table. */ +extern yasm_symtab *nasm_symtab; + static scanner scan; /* Address of scanner routine */ static efunc error; /* Address of error reporting routine */ @@ -381,6 +385,21 @@ static yasm_expr *expr6(void) e = yasm_expr_create_ident(yasm_expr_int(tokval->t_integer), 0); break; case TOKEN_ID: + if (nasm_symtab) { + yasm_symrec *sym = + yasm_symtab_get(nasm_symtab, tokval->t_charptr); + if (sym) { + e = yasm_expr_create_ident(yasm_expr_sym(sym), 0); + } else { + error(ERR_NONFATAL, + "undefined symbol `%s' in preprocessor", + tokval->t_charptr); + e = yasm_expr_create_ident(yasm_expr_int( + yasm_intnum_create_int(1)), 0); + } + break; + } + /*fallthrough*/ case TOKEN_HERE: case TOKEN_BASE: error(ERR_NONFATAL, diff --git a/modules/preprocs/nasm/nasm-preproc.c b/modules/preprocs/nasm/nasm-preproc.c index c1394a26..a0d941cf 100644 --- a/modules/preprocs/nasm/nasm-preproc.c +++ b/modules/preprocs/nasm/nasm-preproc.c @@ -43,6 +43,7 @@ typedef struct yasm_preproc_nasm { long prior_linnum; int lineinc; } yasm_preproc_nasm; +yasm_symtab *nasm_symtab; static yasm_linemap *cur_lm; static yasm_errwarns *cur_errwarns; int tasm_compatible_mode = 0; @@ -127,8 +128,8 @@ nasm_efunc(int severity, const char *fmt, ...) } static yasm_preproc * -nasm_preproc_create(const char *in_filename, yasm_linemap *lm, - yasm_errwarns *errwarns) +nasm_preproc_create(const char *in_filename, yasm_symtab *symtab, + yasm_linemap *lm, yasm_errwarns *errwarns) { FILE *f; yasm_preproc_nasm *preproc_nasm = yasm_xmalloc(sizeof(yasm_preproc_nasm)); @@ -144,6 +145,7 @@ nasm_preproc_create(const char *in_filename, yasm_linemap *lm, f = stdin; preproc_nasm->in = f; + nasm_symtab = symtab; cur_lm = lm; cur_errwarns = errwarns; preproc_deps = NULL; diff --git a/modules/preprocs/nasm/tests/ifcritical-err.errwarn b/modules/preprocs/nasm/tests/ifcritical-err.errwarn index 9c617cf7..55b237a3 100644 --- a/modules/preprocs/nasm/tests/ifcritical-err.errwarn +++ b/modules/preprocs/nasm/tests/ifcritical-err.errwarn @@ -1 +1 @@ --:5: cannot reference symbol `teststringlen' in preprocessor +-:5: non-constant value given to `%if' diff --git a/modules/preprocs/raw/raw-preproc.c b/modules/preprocs/raw/raw-preproc.c index 87ec4e07..03f07559 100644 --- a/modules/preprocs/raw/raw-preproc.c +++ b/modules/preprocs/raw/raw-preproc.c @@ -43,8 +43,8 @@ typedef struct yasm_preproc_raw { yasm_preproc_module yasm_raw_LTX_preproc; static yasm_preproc * -raw_preproc_create(const char *in_filename, yasm_linemap *lm, - yasm_errwarns *errwarns) +raw_preproc_create(const char *in_filename, yasm_symtab *symtab, + yasm_linemap *lm, yasm_errwarns *errwarns) { FILE *f; yasm_preproc_raw *preproc_raw = yasm_xmalloc(sizeof(yasm_preproc_raw)); From 31f88dcd29c7788125029b26192f7b271af39960 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 3 Nov 2007 04:59:28 +0000 Subject: [PATCH 118/585] Update generated yasm_arch(7) man page. svn path=/trunk/yasm/; revision=2009 --- yasm_arch.7 | 298 +++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 258 insertions(+), 40 deletions(-) diff --git a/yasm_arch.7 b/yasm_arch.7 index dd329c5b..c47c4971 100644 --- a/yasm_arch.7 +++ b/yasm_arch.7 @@ -1,6 +1,6 @@ .\" Title: yasm_arch .\" Author: Peter Johnson -.\" Generator: DocBook XSL Stylesheets v1.70.1 +.\" Generator: DocBook XSL Stylesheets v1.71.1 .\" Date: October 2006 .\" Manual: Yasm Supported Architectures .\" Source: Yasm @@ -56,7 +56,6 @@ The x86 architecture BITS setting specifies to Yasm the processor mode in which The BITS setting can be changed in a variety of ways. When using the NASM\-compatible parser, the BITS setting can be changed directly via the use of the \fBBITS xx\fR assembler directive. The default BITS setting is determined by the object format in use. -.\" end of SS subsection "BITS Setting" .SS "BITS 64 Extensions" .PP The AMD64 architecture is a new 64\-bit architecture developed by AMD, based on the 32\-bit x86 architecture. It extends the original x86 architecture by doubling the number of general purpose and SIMD registers, extending the arithmetic operations and address space to 64 bits, as well as other features. @@ -84,7 +83,7 @@ The additional 64\-bit general purpose registers are named r8\-r15. There are al .PP New 8\-bit registers are also available that map to the 8 least significant bits of rsi, rdi, rsp, and rbp. These are called sil, dil, spl, and bpl respectively. Unfortunately, due to the way instructions are encoded, these new 8\-bit registers are encoded the same as the old 8\-bit registers ah, dh, ch, and bh. The processor tells which is being used by the presence of the new REX prefix that is used to specify the other extended registers. This means it is illegal to mix the use of ah, dh, ch, and bh with an instruction that requires the REX prefix for other reasons. For instance: .sp -.RS 3n +.RS 4 .nf add ah, [r10] .fi @@ -94,7 +93,6 @@ add ah, [r10] .PP In 64\-bit mode, an additional 8 SSE2 registers are also available. These are named xmm8\-xmm15. .RE -.\" end of subsection "Register Changes" .sp .it 1 an-trap .nr an-no-space-flag 1 @@ -107,13 +105,13 @@ By default, most operations in 64\-bit mode remain 32\-bit; operations that are \(lqfor free\(rq (as the REX prefix is already present). Examples in NASM syntax: .sp -.RS 3n +.RS 4 .nf mov eax, 1 ; 32\-bit instruction .fi .RE .sp -.RS 3n +.RS 4 .nf mov rcx, 1 ; 64\-bit instruction .fi @@ -121,25 +119,24 @@ mov rcx, 1 ; 64\-bit instruction .PP Instructions that modify the stack (push, pop, call, ret, enter, and leave) are implicitly 64\-bit. Their 32\-bit counterparts are not available, but their 16\-bit counterparts are. Examples in NASM syntax: .sp -.RS 3n +.RS 4 .nf push eax ; illegal instruction .fi .RE .sp -.RS 3n +.RS 4 .nf push rbx ; 1\-byte instruction .fi .RE .sp -.RS 3n +.RS 4 .nf push r11 ; 2\-byte instruction with REX prefix .fi .RE .RE -.\" end of subsection "64 Bit Instructions" .sp .it 1 an-trap .nr an-no-space-flag 1 @@ -150,19 +147,18 @@ push r11 ; 2\-byte instruction with REX prefix .PP Results of 32\-bit operations are implicitly zero\-extended to the upper 32 bits of the corresponding 64\-bit register. 16 and 8 bit operations, on the other hand, do not affect upper bits of the register (just as in 32\-bit and 16\-bit modes). This can be used to generate smaller code in some instances. Examples in NASM syntax: .sp -.RS 3n +.RS 4 .nf mov ecx, 1 ; 1 byte shorter than mov rcx, 1 .fi .RE .sp -.RS 3n +.RS 4 .nf and edx, 3 ; equivalent to and rdx, 3 .fi .RE .RE -.\" end of subsection "Implicit Zero Extension" .sp .it 1 an-trap .nr an-no-space-flag 1 @@ -173,85 +169,158 @@ and edx, 3 ; equivalent to and rdx, 3 .PP For most instructions in 64\-bit mode, immediate values remain 32 bits; their value is sign\-extended into the upper 32 bits of the target register prior to being used. The exception is the mov instruction, which can take a 64\-bit immediate when the destination is a 64\-bit register. Examples in NASM syntax: .sp -.RS 3n +.RS 4 .nf add rax, 1 ; optimized down to signed 8\-bit .fi .RE .sp -.RS 3n +.RS 4 .nf add rax, dword 1 ; force size to 32\-bit .fi .RE .sp -.RS 3n +.RS 4 .nf add rax, 0xffffffff ; sign\-extended 32\-bit .fi .RE .sp -.RS 3n +.RS 4 .nf add rax, \-1 ; same as above .fi .RE .sp -.RS 3n +.RS 4 .nf add rax, 0xffffffffffffffff ; truncated to 32\-bit (warning) .fi .RE .sp -.RS 3n +.RS 4 .nf mov eax, 1 ; 5 byte .fi .RE .sp -.RS 3n +.RS 4 .nf mov rax, 1 ; 5 byte (optimized to signed 32\-bit) .fi .RE .sp -.RS 3n +.RS 4 .nf mov rax, qword 1 ; 10 byte (forced 64\-bit) .fi .RE .sp -.RS 3n +.RS 4 .nf mov rbx, 0x1234567890abcdef ; 10 byte .fi .RE .sp -.RS 3n +.RS 4 .nf mov rcx, 0xffffffff ; 10 byte (does not fit in signed 32\-bit) .fi .RE .sp -.RS 3n +.RS 4 .nf mov ecx, \-1 ; 5 byte, equivalent to above .fi .RE .sp -.RS 3n +.RS 4 .nf mov rcx, sym ; 5 byte, 32\-bit size default for symbols .fi .RE .sp -.RS 3n +.RS 4 .nf mov rcx, qword sym ; 10 byte, override default size .fi .RE +.PP +The handling of mov reg64, unsized immediate is different between YASM and NASM 2.x; YASM follows the above behavior, while NASM 2.x does the following: +.sp +.RS 4 +.nf +add rax, 0xffffffff ; sign\-extended 32\-bit immediate +.fi +.RE +.sp +.RS 4 +.nf +add rax, \-1 ; same as above +.fi +.RE +.sp +.RS 4 +.nf +add rax, 0xffffffffffffffff ; truncated 32\-bit (warning) +.fi +.RE +.sp +.RS 4 +.nf +add rax, sym ; sign\-extended 32\-bit immediate +.fi +.RE +.sp +.RS 4 +.nf +mov eax, 1 ; 5 byte (32\-bit immediate) +.fi +.RE +.sp +.RS 4 +.nf +mov rax, 1 ; 10 byte (64\-bit immediate) +.fi +.RE +.sp +.RS 4 +.nf +mov rbx, 0x1234567890abcdef ; 10 byte instruction +.fi +.RE +.sp +.RS 4 +.nf +mov rcx, 0xffffffff ; 10 byte instruction +.fi +.RE +.sp +.RS 4 +.nf +mov ecx, \-1 ; 5 byte, equivalent to above +.fi +.RE +.sp +.RS 4 +.nf +mov ecx, sym ; 5 byte (32\-bit immediate) +.fi +.RE +.sp +.RS 4 +.nf +mov rcx, sym ; 10 byte instruction +.fi +.RE +.sp +.RS 4 +.nf +mov rcx, qword sym ; 10 byte (64\-bit immediate) +.fi +.RE .RE -.\" end of subsection "Immediates" .sp .it 1 an-trap .nr an-no-space-flag 1 @@ -263,31 +332,30 @@ mov rcx, qword sym ; 10 byte, override default size Just like immediates, displacements, for the most part, remain 32 bits and are sign extended prior to use. Again, the exception is one restricted form of the mov instruction: between the al/ax/eax/rax register and a 64\-bit absolute address (no registers allowed in the effective address). In NASM syntax, use of the 64\-bit absolute form requires \fB[qword]\fR. Examples in NASM syntax: .sp -.RS 3n +.RS 4 .nf mov eax, [1] ; 32 bit, with sign extension .fi .RE .sp -.RS 3n +.RS 4 .nf mov al, [rax\-1] ; 32 bit, with sign extension .fi .RE .sp -.RS 3n +.RS 4 .nf mov al, [qword 0x1122334455667788] ; 64\-bit absolute .fi .RE .sp -.RS 3n +.RS 4 .nf mov al, [0x1122334455667788] ; truncated to 32\-bit (warning) .fi .RE .RE -.\" end of subsection "Displacements" .sp .it 1 an-trap .nr an-no-space-flag 1 @@ -300,7 +368,7 @@ In 64\-bit mode, a new form of effective addressing is available to make it easi .PP In NASM syntax, there are two ways to specify RIP\-relative addressing: .sp -.RS 3n +.RS 4 .nf mov dword [rip+10], 1 .fi @@ -310,7 +378,7 @@ stores the value 1 ten bytes after the end of the instruction. \fB10\fR can also be a symbolic constant, and will be treated the same way. On the other hand, .sp -.RS 3n +.RS 4 .nf mov dword [symb wrt rip], 1 .fi @@ -319,7 +387,7 @@ mov dword [symb wrt rip], 1 stores the value 1 into the address of symbol \fBsymb\fR. This is distinctly different than the behavior of: .sp -.RS 3n +.RS 4 .nf mov dword [symb+rip], 1 .fi @@ -334,9 +402,157 @@ is a variable, this will store the value 1 into the \fBsymb\fR variable! +.PP +Yasm also supports the following syntax for RIP\-relative addressing: +.sp +.RS 4 +.nf +mov [rel sym], rax ; RIP\-relative +.fi +.RE +.sp +.RS 4 +.nf +mov [abs sym], rax ; not RIP\-relative +.fi +.RE +.PP +The behavior of: +.sp +.RS 4 +.nf +mov [sym], rax +.fi +.RE +.PP +Depends on a mode set by the DEFAULT directive, as follows. The default mode is always "abs", and in "rel" mode, use of registers, an fs or gs segment override, or an explicit "abs" override will result in a non\-RIP\-relative effective address. +.sp +.RS 4 +.nf +default rel +.fi +.RE +.sp +.RS 4 +.nf +mov [sym], rbx ; RIP\-relative +.fi +.RE +.sp +.RS 4 +.nf +mov [abs sym], rbx ; not RIP\-relative (explicit override) +.fi +.RE +.sp +.RS 4 +.nf +mov [rbx+1], rbx ; not RIP\-relative (register use) +.fi +.RE +.sp +.RS 4 +.nf +mov [fs:sym], rbx ; not RIP\-relative (fs or gs use) +.fi +.RE +.sp +.RS 4 +.nf +mov [ds:sym], rbx ; RIP\-relative (segment, but not fs or gs) +.fi +.RE +.sp +.RS 4 +.nf +mov [rel sym], rbx ; RIP\-relative (redundant override) +.fi +.RE +.sp +.RS 4 +.nf +default abs +.fi +.RE +.sp +.RS 4 +.nf +mov [sym], rbx ; not RIP\-relative +.fi +.RE +.sp +.RS 4 +.nf +mov [abs sym], rbx ; not RIP\-relative +.fi +.RE +.sp +.RS 4 +.nf +mov [rbx+1], rbx ; not RIP\-relative +.fi +.RE +.sp +.RS 4 +.nf +mov [fs:sym], rbx ; not RIP\-relative +.fi +.RE +.sp +.RS 4 +.nf +mov [ds:sym], rbx ; not RIP\-relative +.fi +.RE +.sp +.RS 4 +.nf +mov [rel sym], rbx ; RIP\-relative (explicit override) +.fi +.RE +.RE +.sp +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +\fBMemory references\fR +.RS +.PP +Usually the size of a memory reference can be deduced by which registers you're moving\-\-for example, "mov [rax],ecx" is a 32\-bit move, because ecx is 32 bits. YASM currently gives the non\-obvious "invalid combination of opcode and operands" error if it can't figure out how much memory you're moving. The fix in this case is to add a memory size specifier: qword, dword, word, or byte. +.PP +Here's a 64\-bit memory move, which sets 8 bytes starting at rax: +.sp +.RS 4 +.nf +mov qword [rax], 1 +.fi +.RE +.PP +Here's a 32\-bit memory move, which sets 4 bytes: +.sp +.RS 4 +.nf +mov dword [rax], 1 +.fi +.RE +.PP +Here's a 16\-bit memory move, which sets 2 bytes: +.sp +.RS 4 +.nf +mov word [rax], 1 +.fi +.RE +.PP +Here's an 8\-bit memory move, which sets 1 byte: +.sp +.RS 4 +.nf +mov byte [rax], 1 +.fi +.RE .RE -.\" end of subsection "RIP Relative Addressing" -.\" end of SS subsection "BITS 64 Extensions" .SH "LC3B ARCHITECTURE" .PP The @@ -364,9 +580,11 @@ does not default the BITS setting to 64. An easy way to avoid this is by directl \fB\-f elf64\fR. .SH "AUTHOR" .PP -\fBPeter\fR \fBJohnson\fR +\fBPeter Johnson\fR <\&peter@tortall.net\&> .sp -1n -.IP "" 3n +.IP "" 4 Author. .SH "COPYRIGHT" -Copyright \(co 2004, 2005, 2006 Peter Johnson +Copyright \(co 2004, 2005, 2006, 2007 Peter Johnson +.br + From 52affeb01a43d3a7931a559b154080eafaba8370 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 14 Nov 2007 08:33:32 +0000 Subject: [PATCH 119/585] Add NASM-compatible multi-section binary support to bin object format. This allows for arbitrary load (LMA) and execution (VMA) addresses. The following new section attributes are supported: - start (LMA start address) - follows (follow another section's last LMA) - align (LMA alignment) - vstart (VMA start address) - vfollows (follow another section's last VMA) - valign (VMA alignment) In addition, sections can be designed progbits or nobits. The following special symbols are generated for program use: - section..start (LMA start address) - section..vstart (VMA start address) - section..length (section length) The ORG directive adjusts the file offset relative to LMA, so that if ORG=0x100, a section with LMA=0x100 will be at file offset 0. VMA addresses are the same as LMA addresses unless otherwise specified. Full map file support is supported via the [MAP] directive. The map output filename can be set either as a parameter to the [MAP] directive or on the command line with --mapfile=. MAP options are BRIEF, SECTIONS, SEGMENTS, SYMBOLS, and ALL (all of the above). If no filename is specified either on the command line or in the source file, the map is output to standard output. Full documentation will be added to the Yasm manual in the near future. This implementation supports several configurations NASM does not, for instance http://osdir.com/ml/lang.nasm.devel/2004-12/msg00032.html . It is also fully 64-bit aware. Fixes: #71, #99. svn path=/trunk/yasm/; revision=2010 --- frontends/yasm/yasm.c | 49 +- libyasm/intnum.c | 44 + libyasm/intnum.h | 13 + libyasm/section.c | 30 +- libyasm/section.h | 20 +- libyasm/valparam.c | 17 + libyasm/valparam.h | 17 + modules/dbgfmts/codeview/cv-symline.c | 2 +- modules/dbgfmts/codeview/cv-type.c | 2 +- modules/dbgfmts/dwarf2/dwarf2-aranges.c | 2 +- modules/dbgfmts/dwarf2/dwarf2-info.c | 4 +- modules/dbgfmts/dwarf2/dwarf2-line.c | 4 +- modules/dbgfmts/stabs/stabs-dbgfmt.c | 4 +- modules/objfmts/bin/bin-objfmt.c | 1607 ++- modules/objfmts/bin/tests/Makefile.inc | 4 + .../objfmts/bin/tests/multisect/Makefile.inc | 53 + .../objfmts/bin/tests/multisect/bin-align.asm | 12 + .../bin/tests/multisect/bin-align.errwarn | 3 + .../objfmts/bin/tests/multisect/bin-align.hex | 17 + .../objfmts/bin/tests/multisect/bin-align.map | 66 + .../objfmts/bin/tests/multisect/bin-ssym.asm | 5 + .../objfmts/bin/tests/multisect/bin-ssym.hex | 25 + .../objfmts/bin/tests/multisect/bin-ssym.map | 16 + .../bin/tests/multisect/bin_multi_test.sh | 114 + .../bin/tests/multisect/follows-loop1-err.asm | 2 + .../tests/multisect/follows-loop1-err.errwarn | 1 + .../bin/tests/multisect/follows-loop2-err.asm | 1 + .../tests/multisect/follows-loop2-err.errwarn | 1 + .../tests/multisect/follows-notfound-err.asm | 2 + .../multisect/follows-notfound-err.errwarn | 1 + .../objfmts/bin/tests/multisect/initbss.asm | 5 + .../bin/tests/multisect/initbss.errwarn | 2 + .../objfmts/bin/tests/multisect/initbss.hex | 0 .../objfmts/bin/tests/multisect/initbss.map | 17 + .../bin/tests/multisect/ldlinux-sects.asm | 102 + .../bin/tests/multisect/ldlinux-sects.hex | 11363 ++++++++++++++++ .../bin/tests/multisect/ldlinux-sects.map | 148 + .../bin/tests/multisect/multisect1.asm | 31 + .../bin/tests/multisect/multisect1.hex | 20 + .../bin/tests/multisect/multisect1.map | 78 + .../bin/tests/multisect/multisect2.asm | 42 + .../bin/tests/multisect/multisect2.hex | 66 + .../bin/tests/multisect/multisect2.map | 74 + .../bin/tests/multisect/multisect3.asm | 9 + .../bin/tests/multisect/multisect3.hex | 2 + .../bin/tests/multisect/multisect3.map | 54 + .../bin/tests/multisect/multisect4.asm | 31 + .../bin/tests/multisect/multisect4.hex | 768 ++ .../bin/tests/multisect/multisect4.map | 97 + .../bin/tests/multisect/multisect5.asm | 22 + .../bin/tests/multisect/multisect5.hex | 1816 +++ .../bin/tests/multisect/multisect5.map | 138 + .../bin/tests/multisect/nomultisect1.asm | 10 + .../bin/tests/multisect/nomultisect1.hex | 512 + .../bin/tests/multisect/nomultisect1.map | 54 + .../bin/tests/multisect/nomultisect2.asm | 12 + .../bin/tests/multisect/nomultisect2.hex | 512 + .../bin/tests/multisect/nomultisect2.map | 54 + .../tests/multisect/vfollows-loop1-err.asm | 2 + .../multisect/vfollows-loop1-err.errwarn | 1 + .../tests/multisect/vfollows-loop2-err.asm | 1 + .../multisect/vfollows-loop2-err.errwarn | 1 + .../tests/multisect/vfollows-notfound-err.asm | 2 + .../multisect/vfollows-notfound-err.errwarn | 1 + modules/objfmts/coff/coff-objfmt.c | 11 +- modules/objfmts/dbg/dbg-objfmt.c | 9 +- modules/objfmts/elf/elf-objfmt.c | 4 +- modules/objfmts/macho/macho-objfmt.c | 6 +- modules/objfmts/rdf/rdf-objfmt.c | 4 +- modules/objfmts/xdf/xdf-objfmt.c | 4 +- 70 files changed, 17969 insertions(+), 254 deletions(-) create mode 100644 modules/objfmts/bin/tests/multisect/Makefile.inc create mode 100644 modules/objfmts/bin/tests/multisect/bin-align.asm create mode 100644 modules/objfmts/bin/tests/multisect/bin-align.errwarn create mode 100644 modules/objfmts/bin/tests/multisect/bin-align.hex create mode 100644 modules/objfmts/bin/tests/multisect/bin-align.map create mode 100644 modules/objfmts/bin/tests/multisect/bin-ssym.asm create mode 100644 modules/objfmts/bin/tests/multisect/bin-ssym.hex create mode 100644 modules/objfmts/bin/tests/multisect/bin-ssym.map create mode 100755 modules/objfmts/bin/tests/multisect/bin_multi_test.sh create mode 100644 modules/objfmts/bin/tests/multisect/follows-loop1-err.asm create mode 100644 modules/objfmts/bin/tests/multisect/follows-loop1-err.errwarn create mode 100644 modules/objfmts/bin/tests/multisect/follows-loop2-err.asm create mode 100644 modules/objfmts/bin/tests/multisect/follows-loop2-err.errwarn create mode 100644 modules/objfmts/bin/tests/multisect/follows-notfound-err.asm create mode 100644 modules/objfmts/bin/tests/multisect/follows-notfound-err.errwarn create mode 100644 modules/objfmts/bin/tests/multisect/initbss.asm create mode 100644 modules/objfmts/bin/tests/multisect/initbss.errwarn create mode 100644 modules/objfmts/bin/tests/multisect/initbss.hex create mode 100644 modules/objfmts/bin/tests/multisect/initbss.map create mode 100644 modules/objfmts/bin/tests/multisect/ldlinux-sects.asm create mode 100644 modules/objfmts/bin/tests/multisect/ldlinux-sects.hex create mode 100644 modules/objfmts/bin/tests/multisect/ldlinux-sects.map create mode 100644 modules/objfmts/bin/tests/multisect/multisect1.asm create mode 100644 modules/objfmts/bin/tests/multisect/multisect1.hex create mode 100644 modules/objfmts/bin/tests/multisect/multisect1.map create mode 100644 modules/objfmts/bin/tests/multisect/multisect2.asm create mode 100644 modules/objfmts/bin/tests/multisect/multisect2.hex create mode 100644 modules/objfmts/bin/tests/multisect/multisect2.map create mode 100644 modules/objfmts/bin/tests/multisect/multisect3.asm create mode 100644 modules/objfmts/bin/tests/multisect/multisect3.hex create mode 100644 modules/objfmts/bin/tests/multisect/multisect3.map create mode 100644 modules/objfmts/bin/tests/multisect/multisect4.asm create mode 100644 modules/objfmts/bin/tests/multisect/multisect4.hex create mode 100644 modules/objfmts/bin/tests/multisect/multisect4.map create mode 100644 modules/objfmts/bin/tests/multisect/multisect5.asm create mode 100644 modules/objfmts/bin/tests/multisect/multisect5.hex create mode 100644 modules/objfmts/bin/tests/multisect/multisect5.map create mode 100644 modules/objfmts/bin/tests/multisect/nomultisect1.asm create mode 100644 modules/objfmts/bin/tests/multisect/nomultisect1.hex create mode 100644 modules/objfmts/bin/tests/multisect/nomultisect1.map create mode 100644 modules/objfmts/bin/tests/multisect/nomultisect2.asm create mode 100644 modules/objfmts/bin/tests/multisect/nomultisect2.hex create mode 100644 modules/objfmts/bin/tests/multisect/nomultisect2.map create mode 100644 modules/objfmts/bin/tests/multisect/vfollows-loop1-err.asm create mode 100644 modules/objfmts/bin/tests/multisect/vfollows-loop1-err.errwarn create mode 100644 modules/objfmts/bin/tests/multisect/vfollows-loop2-err.asm create mode 100644 modules/objfmts/bin/tests/multisect/vfollows-loop2-err.errwarn create mode 100644 modules/objfmts/bin/tests/multisect/vfollows-notfound-err.asm create mode 100644 modules/objfmts/bin/tests/multisect/vfollows-notfound-err.errwarn diff --git a/frontends/yasm/yasm.c b/frontends/yasm/yasm.c index cde5fef8..117be48c 100644 --- a/frontends/yasm/yasm.c +++ b/frontends/yasm/yasm.c @@ -44,7 +44,7 @@ #define PREPROC_BUF_SIZE 16384 /*@null@*/ /*@only@*/ static char *obj_filename = NULL, *in_filename = NULL; -/*@null@*/ /*@only@*/ static char *list_filename = NULL; +/*@null@*/ /*@only@*/ static char *list_filename = NULL, *map_filename = NULL; /*@null@*/ /*@only@*/ static char *machine_name = NULL; static int special_options = 0; /*@null@*/ /*@dependent@*/ static yasm_arch *cur_arch = NULL; @@ -91,6 +91,7 @@ static int opt_dbgfmt_handler(char *cmd, /*@null@*/ char *param, int extra); static int opt_listfmt_handler(char *cmd, /*@null@*/ char *param, int extra); static int opt_listfile_handler(char *cmd, /*@null@*/ char *param, int extra); static int opt_objfile_handler(char *cmd, /*@null@*/ char *param, int extra); +static int opt_mapfile_handler(char *cmd, /*@null@*/ char *param, int extra); static int opt_machine_handler(char *cmd, /*@null@*/ char *param, int extra); static int opt_strict_handler(char *cmd, /*@null@*/ char *param, int extra); static int opt_warning_handler(char *cmd, /*@null@*/ char *param, int extra); @@ -153,6 +154,8 @@ static opt_option options[] = N_("name of list-file output"), N_("listfile") }, { 'o', "objfile", 1, opt_objfile_handler, 0, N_("name of object-file output"), N_("filename") }, + { 0, "mapfile", 1, opt_mapfile_handler, 0, + N_("name of map-file output"), N_("filename") }, { 'm', "machine", 1, opt_machine_handler, 0, N_("select machine (list with -m help)"), N_("machine") }, { 0, "force-strict", 0, opt_strict_handler, 0, @@ -436,6 +439,32 @@ do_assemble(void) yasm_arch_set_var(cur_arch, "force_strict", force_strict); + /* Try to enable the map file via a map NASM directive. This is + * somewhat of a hack. + */ + if (map_filename && cur_objfmt_module->directives) { + const yasm_directive *dir = &cur_objfmt_module->directives[0]; + matched = 0; + for (; dir->name; dir++) { + if (yasm__strcasecmp(dir->name, "map") == 0 && + yasm__strcasecmp(dir->parser, "nasm") == 0) { + yasm_valparamhead vps; + yasm_valparam *vp; + matched = 1; + yasm_vps_initialize(&vps); + vp = yasm_vp_create_string(NULL, yasm__xstrdup(map_filename)); + yasm_vps_append(&vps, vp); + dir->handler(object, &vps, NULL, 0); + yasm_vps_delete(&vps); + } + } + if (!matched) { + print_error( + _("warning: object format `%s' does not support map files"), + cur_objfmt_module->keyword); + } + } + /* Parse! */ cur_parser_module->do_parse(object, cur_preproc, list_filename != NULL, linemap, errwarns); @@ -718,6 +747,8 @@ cleanup(yasm_object *object) yasm_xfree(obj_filename); if (list_filename) yasm_xfree(list_filename); + if (map_filename) + yasm_xfree(map_filename); if (machine_name) yasm_xfree(machine_name); if (objfmt_keyword) @@ -923,6 +954,22 @@ opt_objfile_handler(/*@unused@*/ char *cmd, char *param, return 0; } +static int +opt_mapfile_handler(/*@unused@*/ char *cmd, char *param, + /*@unused@*/ int extra) +{ + if (map_filename) { + print_error( + _("warning: can output to only one map file, last specified used")); + yasm_xfree(map_filename); + } + + assert(param != NULL); + map_filename = yasm__xstrdup(param); + + return 0; +} + static int opt_machine_handler(/*@unused@*/ char *cmd, char *param, /*@unused@*/ int extra) diff --git a/libyasm/intnum.c b/libyasm/intnum.c index 2820fa2e..df32b8cb 100644 --- a/libyasm/intnum.c +++ b/libyasm/intnum.c @@ -562,12 +562,56 @@ yasm_intnum_calc(yasm_intnum *acc, yasm_expr_op op, yasm_intnum *operand) } /*@=nullderef =nullpass =branchstate@*/ +int +yasm_intnum_compare(const yasm_intnum *intn1, const yasm_intnum *intn2) +{ + wordptr op1, op2; + + if (intn1->type == INTNUM_L && intn2->type == INTNUM_L) { + if (intn1->val.l < intn2->val.l) + return -1; + if (intn1->val.l > intn2->val.l) + return 1; + return 0; + } + + op1 = intnum_tobv(op1static, intn1); + op2 = intnum_tobv(op2static, intn2); + return BitVector_Compare(op1, op2); +} + void yasm_intnum_zero(yasm_intnum *intn) { yasm_intnum_set_int(intn, 0); } +void +yasm_intnum_set(yasm_intnum *intn, const yasm_intnum *val) +{ + if (intn->type == val->type) { + switch (val->type) { + case INTNUM_L: + intn->val.l = val->val.l; + break; + case INTNUM_BV: + BitVector_Copy(intn->val.bv, val->val.bv); + break; + } + } else { + switch (val->type) { + case INTNUM_L: + BitVector_Destroy(intn->val.bv); + intn->val.l = val->val.l; + break; + case INTNUM_BV: + intn->val.bv = BitVector_Clone(val->val.bv); + break; + } + intn->type = val->type; + } +} + void yasm_intnum_set_uint(yasm_intnum *intn, unsigned long val) { diff --git a/libyasm/intnum.h b/libyasm/intnum.h index 36cb6fea..382f5fb1 100644 --- a/libyasm/intnum.h +++ b/libyasm/intnum.h @@ -125,11 +125,24 @@ void yasm_intnum_destroy(/*@only@*/ yasm_intnum *intn); */ int yasm_intnum_calc(yasm_intnum *acc, yasm_expr_op op, yasm_intnum *operand); +/** Compare two intnums. + * \param intn1 first intnum + * \param intn2 second intnum + * \return -1 if intn1 < intn2, 0 if intn1 == intn2, 1 if intn1 > intn2. + */ +int yasm_intnum_compare(const yasm_intnum *intn1, const yasm_intnum *intn2); + /** Zero an intnum. * \param intn intnum */ void yasm_intnum_zero(yasm_intnum *intn); +/** Set an intnum to the value of another intnum. + * \param intn intnum + * \param val intnum to get value from + */ +void yasm_intnum_set(yasm_intnum *intn, const yasm_intnum *val); + /** Set an intnum to an unsigned integer. * \param intn intnum * \param val integer value diff --git a/libyasm/section.c b/libyasm/section.c index c5b83cb8..a767e309 100644 --- a/libyasm/section.c +++ b/libyasm/section.c @@ -62,8 +62,6 @@ struct yasm_section { /* associated data; NULL if none */ /*@null@*/ /*@only@*/ yasm__assoc_data *assoc_data; - /*@owned@*/ yasm_expr *start; /* Starting address of section contents */ - unsigned long align; /* Section alignment */ unsigned long opt_flags; /* storage for optimizer flags */ @@ -300,8 +298,8 @@ error: /*@-onlytrans@*/ yasm_section * yasm_object_get_general(yasm_object *object, const char *name, - yasm_expr *start, unsigned long align, int code, - int res_only, int *isnew, unsigned long line) + unsigned long align, int code, int res_only, + int *isnew, unsigned long line) { yasm_section *s; yasm_bytecode *bc; @@ -325,12 +323,6 @@ yasm_object_get_general(yasm_object *object, const char *name, s->object = object; s->name = yasm__xstrdup(name); s->assoc_data = NULL; - if (start) - s->start = start; - else - s->start = - yasm_expr_create_ident(yasm_expr_int(yasm_intnum_create_uint(0)), - line); s->align = align; /* Initialize bytecodes with one empty bytecode (acts as "prior" for first @@ -630,20 +622,6 @@ yasm_section_get_name(const yasm_section *sect) return sect->name; } -void -yasm_section_set_start(yasm_section *sect, yasm_expr *start, - unsigned long line) -{ - yasm_expr_destroy(sect->start); - sect->start = start; -} - -const yasm_expr * -yasm_section_get_start(const yasm_section *sect) -{ - return sect->start; -} - void yasm_section_set_align(yasm_section *sect, unsigned long align, unsigned long line) @@ -668,7 +646,6 @@ yasm_section_destroy(yasm_section *sect) yasm_xfree(sect->name); yasm__assoc_data_destroy(sect->assoc_data); - yasm_expr_destroy(sect->start); /* Delete bytecodes */ cur = STAILQ_FIRST(§->bcs); @@ -700,9 +677,6 @@ yasm_section_print(const yasm_section *sect, FILE *f, int indent_level, } fprintf(f, "%*sname=%s\n", indent_level, "", sect->name); - fprintf(f, "%*sstart=", indent_level, ""); - yasm_expr_print(sect->start, f); - fprintf(f, "\n"); if (sect->assoc_data) { fprintf(f, "%*sAssociated data:\n", indent_level, ""); diff --git a/libyasm/section.h b/libyasm/section.h index bb7d3c13..d42040a6 100644 --- a/libyasm/section.h +++ b/libyasm/section.h @@ -89,8 +89,6 @@ struct yasm_object { * added to the object if there's not already a section by that name. * \param object object * \param name section name - * \param start starting address (ignored if section already exists), - * NULL if 0 or don't care. * \param align alignment in bytes (0 if none) * \param code if nonzero, section is intended to contain code * (e.g. alignment should be made with NOP instructions, not 0) @@ -102,8 +100,7 @@ struct yasm_object { * \return New section. */ /*@dependent@*/ yasm_section *yasm_object_get_general - (yasm_object *object, const char *name, - /*@null@*/ /*@only@*/ yasm_expr *start, unsigned long align, int code, + (yasm_object *object, const char *name, unsigned long align, int code, int res_only, /*@out@*/ int *isnew, unsigned long line); /** Handle a directive. Passed down to object format, debug format, or @@ -311,21 +308,6 @@ int yasm_section_bcs_traverse */ /*@observer@*/ const char *yasm_section_get_name(const yasm_section *sect); -/** Change starting address of a section. - * \param sect section - * \param start starting address - * \param line virtual line - */ -void yasm_section_set_start(yasm_section *sect, /*@only@*/ yasm_expr *start, - unsigned long line); - -/** Get starting address of a section. - * \param sect section - * \return Starting address. - */ -/*@observer@*/ const yasm_expr *yasm_section_get_start - (const yasm_section *sect); - /** Change alignment of a section. * \param sect section * \param align alignment in bytes diff --git a/libyasm/valparam.c b/libyasm/valparam.c index 4a8a8183..648dfaea 100644 --- a/libyasm/valparam.c +++ b/libyasm/valparam.c @@ -302,6 +302,23 @@ yasm_dir_helper_flag_set(void *obj, yasm_valparam *vp, unsigned long line, return 0; } +int +yasm_dir_helper_expr(void *obj, yasm_valparam *vp, unsigned long line, + void *data, uintptr_t arg) +{ + yasm_object *object = (yasm_object *)obj; + yasm_expr **expr = (yasm_expr **)data; + + if (*expr) + yasm_expr_destroy(*expr); + if (!(*expr = yasm_vp_expr(vp, object->symtab, line))) { + yasm_error_set(YASM_ERROR_VALUE, N_("argument to `%s' is not an expression"), + vp->val); + return -1; + } + return 0; +} + int yasm_dir_helper_intn(void *obj, yasm_valparam *vp, unsigned long line, void *data, uintptr_t arg) diff --git a/libyasm/valparam.h b/libyasm/valparam.h index 9646718a..6914435b 100644 --- a/libyasm/valparam.h +++ b/libyasm/valparam.h @@ -326,6 +326,23 @@ int yasm_dir_helper_flag_or(void *obj, yasm_valparam *vp, unsigned long line, int yasm_dir_helper_flag_and(void *obj, yasm_valparam *vp, unsigned long line, void *data, uintptr_t arg); +/** Standard helper for yasm_dir_helper() that parses an expr parameter. + * The #yasm_dir_help structure that uses this function should have + * needsparam=1. The obj parameter to yasm_dir_helper() when this helper + * is used MUST point to a #yasm_object. In addition, the data parameter + * that is ultimately passed to this function (e.g. yasm_dir_helper() data + * parameter plus #yasm_dir_help.off) must point to a #yasm_expr * + * initialized to NULL. + * \param obj object; must be #yasm_object + * \param vp valparam + * \param line virtual line number + * \param data pointer to #yasm_expr * + * \param arg unused argument + * \return -1 on error, 0 otherwise. + */ +int yasm_dir_helper_expr(void *obj, yasm_valparam *vp, unsigned long line, + void *data, uintptr_t arg); + /** Standard helper for yasm_dir_helper() that parses an intnum parameter. * The #yasm_dir_help structure that uses this function should have * needsparam=1. The obj parameter to yasm_dir_helper() when this helper diff --git a/modules/dbgfmts/codeview/cv-symline.c b/modules/dbgfmts/codeview/cv-symline.c index 6d0874f8..ab14b143 100644 --- a/modules/dbgfmts/codeview/cv-symline.c +++ b/modules/dbgfmts/codeview/cv-symline.c @@ -569,7 +569,7 @@ yasm_cv__generate_symline(yasm_object *object, yasm_linemap *linemap, info.linemap = linemap; info.errwarns = errwarns; info.debug_symline = - yasm_object_get_general(object, ".debug$S", 0, 1, 0, 0, &new, 0); + yasm_object_get_general(object, ".debug$S", 1, 0, 0, &new, 0); info.num_lineinfos = 0; STAILQ_INIT(&info.cv8_lineinfos); info.cv8_cur_li = NULL; diff --git a/modules/dbgfmts/codeview/cv-type.c b/modules/dbgfmts/codeview/cv-type.c index 47adc234..0f2fd5d4 100644 --- a/modules/dbgfmts/codeview/cv-type.c +++ b/modules/dbgfmts/codeview/cv-type.c @@ -522,7 +522,7 @@ yasm_cv__generate_type(yasm_object *object) cv_type *type; debug_type = - yasm_object_get_general(object, ".debug$T", 0, 1, 0, 0, &new, 0); + yasm_object_get_general(object, ".debug$T", 1, 0, 0, &new, 0); /* Add label type */ type = cv_type_create(indx++); diff --git a/modules/dbgfmts/dwarf2/dwarf2-aranges.c b/modules/dbgfmts/dwarf2/dwarf2-aranges.c index 0df37b56..0ab0dc58 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-aranges.c +++ b/modules/dbgfmts/dwarf2/dwarf2-aranges.c @@ -89,7 +89,7 @@ yasm_dwarf2__generate_aranges(yasm_object *object, yasm_section *debug_info) dwarf2_aranges_info info; debug_aranges = - yasm_object_get_general(object, ".debug_aranges", 0, + yasm_object_get_general(object, ".debug_aranges", 2*dbgfmt_dwarf2->sizeof_address, 0, 0, &new, 0); diff --git a/modules/dbgfmts/dwarf2/dwarf2-info.c b/modules/dbgfmts/dwarf2/dwarf2-info.c index b6b45eaa..556ca926 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-info.c +++ b/modules/dbgfmts/dwarf2/dwarf2-info.c @@ -267,9 +267,9 @@ yasm_dwarf2__generate_info(yasm_object *object, yasm_section *debug_line, dwarf2_head *head; char *buf; yasm_section *debug_abbrev = - yasm_object_get_general(object, ".debug_abbrev", 0, 4, 0, 0, &new, 0); + yasm_object_get_general(object, ".debug_abbrev", 4, 0, 0, &new, 0); yasm_section *debug_info = - yasm_object_get_general(object, ".debug_info", 0, 4, 0, 0, &new, 0); + yasm_object_get_general(object, ".debug_info", 4, 0, 0, &new, 0); yasm_section_set_align(debug_abbrev, 0, 0); yasm_section_set_align(debug_info, 0, 0); diff --git a/modules/dbgfmts/dwarf2/dwarf2-line.c b/modules/dbgfmts/dwarf2/dwarf2-line.c index e8d84d8c..d3fa76f2 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-line.c +++ b/modules/dbgfmts/dwarf2/dwarf2-line.c @@ -645,8 +645,8 @@ yasm_dwarf2__generate_line(yasm_object *object, yasm_linemap *linemap, info.object = object; info.linemap = linemap; info.dbgfmt_dwarf2 = dbgfmt_dwarf2; - info.debug_line = yasm_object_get_general(object, ".debug_line", 0, 1, 0, - 0, &new, 0); + info.debug_line = yasm_object_get_general(object, ".debug_line", 1, 0, 0, + &new, 0); last = yasm_section_bcs_last(info.debug_line); /* header */ diff --git a/modules/dbgfmts/stabs/stabs-dbgfmt.c b/modules/dbgfmts/stabs/stabs-dbgfmt.c index 5e908308..88d573ab 100644 --- a/modules/dbgfmts/stabs/stabs-dbgfmt.c +++ b/modules/dbgfmts/stabs/stabs-dbgfmt.c @@ -331,7 +331,7 @@ stabs_dbgfmt_generate(yasm_object *object, yasm_linemap *linemap, info.errwarns = errwarns; info.lastline = 0; info.stabcount = 0; - info.stab = yasm_object_get_general(object, ".stab", 0, 4, 0, 0, &new, 0); + info.stab = yasm_object_get_general(object, ".stab", 4, 0, 0, &new, 0); if (!new) { yasm_bytecode *last = yasm_section_bcs_last(info.stab); if (last == NULL) { @@ -347,7 +347,7 @@ stabs_dbgfmt_generate(yasm_object *object, yasm_linemap *linemap, } info.stabstr = - yasm_object_get_general(object, ".stabstr", 0, 1, 0, 0, &new, 0); + yasm_object_get_general(object, ".stabstr", 1, 0, 0, &new, 0); if (!new) { yasm_bytecode *last = yasm_section_bcs_last(info.stabstr); if (last == NULL) { diff --git a/modules/objfmts/bin/bin-objfmt.c b/modules/objfmts/bin/bin-objfmt.c index 7056f97a..655fab1e 100644 --- a/modules/objfmts/bin/bin-objfmt.c +++ b/modules/objfmts/bin/bin-objfmt.c @@ -32,10 +32,68 @@ #define REGULAR_OUTBUF_SIZE 1024 +typedef struct bin_section_data { + int bss; /* aka nobits */ + + /* User-provided alignment */ + yasm_intnum *align, *valign; + + /* User-provided starts */ + /*@null@*/ /*@owned@*/ yasm_expr *start, *vstart; + + /* User-provided follows */ + /*@null@*/ /*@owned@*/ char *follows, *vfollows; + + /* Calculated (final) starts, used only during output() */ + /*@null@*/ /*@owned@*/ yasm_intnum *istart, *ivstart; + + /* Calculated (final) length, used only during output() */ + /*@null@*/ /*@owned@*/ yasm_intnum *length; +} bin_section_data; + typedef struct yasm_objfmt_bin { yasm_objfmt_base objfmt; /* base structure */ + + enum { + NO_MAP = 0, + MAP_NONE = 0x01, + MAP_BRIEF = 0x02, + MAP_SECTIONS = 0x04, + MAP_SYMBOLS = 0x08 + } map_flags; + /*@null@*/ /*@only@*/ char *map_filename; + + /*@null@*/ /*@only@*/ yasm_expr *org; } yasm_objfmt_bin; +/* symrec data is used only for the special symbols section.start, + * section.vstart, and section.length + */ +typedef struct bin_symrec_data { + yasm_section *section; /* referenced section */ + enum bin_ssym { + SSYM_START, + SSYM_VSTART, + SSYM_LENGTH + } which; +} bin_symrec_data; + +static void bin_section_data_destroy(/*@only@*/ void *d); +static void bin_section_data_print(void *data, FILE *f, int indent_level); + +static const yasm_assoc_data_callback bin_section_data_cb = { + bin_section_data_destroy, + bin_section_data_print +}; + +static void bin_symrec_data_destroy(/*@only@*/ void *d); +static void bin_symrec_data_print(void *data, FILE *f, int indent_level); + +static const yasm_assoc_data_callback bin_symrec_data_cb = { + bin_symrec_data_destroy, + bin_symrec_data_print +}; + yasm_objfmt_module yasm_bin_LTX_objfmt; @@ -44,40 +102,81 @@ bin_objfmt_create(yasm_object *object) { yasm_objfmt_bin *objfmt_bin = yasm_xmalloc(sizeof(yasm_objfmt_bin)); objfmt_bin->objfmt.module = &yasm_bin_LTX_objfmt; + + objfmt_bin->map_flags = MAP_NONE; + objfmt_bin->map_filename = NULL; + objfmt_bin->org = NULL; + return (yasm_objfmt *)objfmt_bin; } -/* Aligns sect to either its specified alignment. Uses prevsect and base to - * both determine the new starting address (returned) and the total length of - * prevsect after sect has been aligned. - */ -static unsigned long -bin_objfmt_align_section(yasm_section *sect, yasm_section *prevsect, - unsigned long base, - /*@out@*/ unsigned long *prevsectlen, - /*@out@*/ unsigned long *padamt) +typedef TAILQ_HEAD(, bin_group) bin_groups; + +typedef struct bin_group { + TAILQ_ENTRY(bin_group) link; + yasm_section *section; + bin_section_data *bsd; + + /* Groups that (in parallel) logically come immediately after this + * group's section. + */ + bin_groups follow_groups; +} bin_group; + +/* Recursive function to find group containing named section. */ +static bin_group * +find_group_by_name(bin_groups *groups, const char *name) { - unsigned long start; - unsigned long align; + bin_group *group, *found; + TAILQ_FOREACH(group, groups, link) { + if (strcmp(yasm_section_get_name(group->section), name) == 0) + return group; + /* Recurse to loop through follow groups */ + found = find_group_by_name(&group->follow_groups, name); + if (found) + return found; + } + return NULL; +} - /* Figure out the size of .text by looking at the last bytecode's offset - * plus its length. Add the start and size together to get the new start. - */ - *prevsectlen = yasm_bc_next_offset(yasm_section_bcs_last(prevsect)); - start = base + *prevsectlen; +/* Recursive function to find group. Returns NULL if not found. */ +static bin_group * +find_group_by_section(bin_groups *groups, yasm_section *section) +{ + bin_group *group, *found; + TAILQ_FOREACH(group, groups, link) { + if (group->section == section) + return group; + /* Recurse to loop through follow groups */ + found = find_group_by_section(&group->follow_groups, section); + if (found) + return found; + } + return NULL; +} - /* Round new start up to alignment of .data section, and adjust textlen to - * indicate padded size. Because aignment is always a power of two, we - * can use some bit trickery to do this easily. - */ - align = yasm_section_get_align(sect); +static void +print_groups(const bin_groups *groups, int indent_level) +{ + bin_group *group; + TAILQ_FOREACH(group, groups, link) { + printf("%*sSection `%s':\n", indent_level, "", + yasm_section_get_name(group->section)); + bin_section_data_print(group->bsd, stdout, indent_level+1); + if (!TAILQ_EMPTY(&group->follow_groups)) { + printf("%*sFollowing groups:\n", indent_level, ""); + print_groups(&group->follow_groups, indent_level+1); + } + } +} - if (start & (align-1)) - start = (start & ~(align-1)) + align; - - *padamt = start - (base + *prevsectlen); - - return start; +static void +bin_group_destroy(/*@only@*/ bin_group *group) +{ + bin_group *follow, *group_temp; + TAILQ_FOREACH_SAFE(follow, &group->follow_groups, link, group_temp) + bin_group_destroy(follow); + yasm_xfree(group); } typedef struct bin_objfmt_output_info { @@ -87,21 +186,315 @@ typedef struct bin_objfmt_output_info { /*@only@*/ unsigned char *buf; /*@observer@*/ const yasm_section *sect; unsigned long start; /* what normal variables go against */ - unsigned long abs_start; /* what absolutes go against */ + + yasm_intnum *origin; + yasm_intnum *tmp_intn; /* temporary working intnum */ + + bin_groups lma_groups, vma_groups; } bin_objfmt_output_info; +static int +bin_objfmt_check_sym(yasm_symrec *sym, /*@null@*/ void *d) +{ + /*@null@*/ bin_objfmt_output_info *info = (bin_objfmt_output_info *)d; + yasm_sym_vis vis = yasm_symrec_get_visibility(sym); + assert(info != NULL); + + /* Don't check internally-generated symbols. Only internally generated + * symbols have symrec data, so simply check for its presence. + */ + if (yasm_symrec_get_data(sym, &bin_symrec_data_cb)) + return 0; + + if (vis & YASM_SYM_EXTERN) { + yasm_warn_set(YASM_WARN_GENERAL, + N_("binary object format does not support extern variables")); + yasm_errwarn_propagate(info->errwarns, yasm_symrec_get_decl_line(sym)); + } else if (vis & YASM_SYM_GLOBAL) { + yasm_warn_set(YASM_WARN_GENERAL, + N_("binary object format does not support global variables")); + yasm_errwarn_propagate(info->errwarns, yasm_symrec_get_decl_line(sym)); + } else if (vis & YASM_SYM_COMMON) { + yasm_error_set(YASM_ERROR_TYPE, + N_("binary object format does not support common variables")); + yasm_errwarn_propagate(info->errwarns, yasm_symrec_get_decl_line(sym)); + } + return 0; +} + +static int +bin_lma_create_group(yasm_section *sect, /*@null@*/ void *d) +{ + bin_objfmt_output_info *info = (bin_objfmt_output_info *)d; + bin_section_data *bsd = yasm_section_get_data(sect, &bin_section_data_cb); + unsigned long align = yasm_section_get_align(sect); + bin_group *group; + + assert(info != NULL); + assert(bsd != NULL); + + group = yasm_xmalloc(sizeof(bin_group)); + group->section = sect; + group->bsd = bsd; + TAILQ_INIT(&group->follow_groups); + + /* Determine section alignment as necessary. */ + if (!bsd->align) + bsd->align = yasm_intnum_create_uint(align > 4 ? align : 4); + else { + yasm_intnum *align_intn = yasm_intnum_create_uint(align); + if (yasm_intnum_compare(align_intn, bsd->align) > 0) { + yasm_warn_set(YASM_WARN_GENERAL, + N_("section `%s' internal align of %lu is greater than `%s' of %lu; using `%s'"), + yasm_section_get_name(sect), + yasm_intnum_get_uint(align_intn), + N_("align"), + yasm_intnum_get_uint(bsd->align), + N_("align")); + yasm_errwarn_propagate(info->errwarns, 0); + } + yasm_intnum_destroy(align_intn); + } + + /* Calculate section integer start. */ + if (bsd->start) { + bsd->istart = yasm_expr_get_intnum(&bsd->start, 0); + if (!bsd->istart) { + yasm_error_set(YASM_ERROR_TOO_COMPLEX, + N_("start expression is too complex")); + yasm_errwarn_propagate(info->errwarns, bsd->start->line); + return 1; + } else + bsd->istart = yasm_intnum_copy(bsd->istart); + } else + bsd->istart = NULL; + + /* Calculate section integer vstart. */ + if (bsd->vstart) { + bsd->ivstart = yasm_expr_get_intnum(&bsd->vstart, 0); + if (!bsd->ivstart) { + yasm_error_set(YASM_ERROR_TOO_COMPLEX, + N_("vstart expression is too complex")); + yasm_errwarn_propagate(info->errwarns, bsd->vstart->line); + return 1; + } else + bsd->ivstart = yasm_intnum_copy(bsd->ivstart); + } else + bsd->ivstart = NULL; + + /* Calculate section integer length. */ + bsd->length = yasm_calc_bc_dist(yasm_section_bcs_first(sect), + yasm_section_bcs_last(sect)); + + TAILQ_INSERT_TAIL(&info->lma_groups, group, link); + return 0; +} + +static int +bin_vma_create_group(yasm_section *sect, /*@null@*/ void *d) +{ + bin_objfmt_output_info *info = (bin_objfmt_output_info *)d; + bin_section_data *bsd = yasm_section_get_data(sect, &bin_section_data_cb); + bin_group *group; + + assert(info != NULL); + assert(bsd != NULL); + + group = yasm_xmalloc(sizeof(bin_group)); + group->section = sect; + group->bsd = bsd; + TAILQ_INIT(&group->follow_groups); + + TAILQ_INSERT_TAIL(&info->vma_groups, group, link); + return 0; +} + +/* Calculates new start address based on alignment constraint. + * Start is modified (rounded up) to the closest aligned value greater than + * what was passed in. + * Align must be a power of 2. + */ +static void +bin_objfmt_align(yasm_intnum *start, const yasm_intnum *align) +{ + /* Because alignment is always a power of two, we can use some bit + * trickery to do this easily. + */ + yasm_intnum *align_intn = + yasm_intnum_create_uint(yasm_intnum_get_uint(align)-1); + yasm_intnum_calc(align_intn, YASM_EXPR_AND, start); + if (!yasm_intnum_is_zero(align_intn)) { + /* start = (start & ~(align-1)) + align; */ + yasm_intnum_set_uint(align_intn, yasm_intnum_get_uint(align)-1); + yasm_intnum_calc(align_intn, YASM_EXPR_NOT, NULL); + yasm_intnum_calc(align_intn, YASM_EXPR_AND, start); + yasm_intnum_set(start, align); + yasm_intnum_calc(start, YASM_EXPR_ADD, align_intn); + } + yasm_intnum_destroy(align_intn); +} + +/* Recursive function to assign start addresses. + * Updates start, last, and vdelta parameters as it goes along. + * The tmp parameter is just a working intnum so one doesn't have to be + * locally allocated for this purpose. + */ +static void +group_assign_start_recurse(bin_group *group, yasm_intnum *start, + yasm_intnum *last, yasm_intnum *vdelta, + yasm_intnum *tmp, yasm_errwarns *errwarns) +{ + bin_group *follow_group; + + /* Determine LMA */ + if (group->bsd->istart) { + yasm_intnum_set(group->bsd->istart, start); + if (group->bsd->align) { + bin_objfmt_align(group->bsd->istart, group->bsd->align); + if (yasm_intnum_compare(start, group->bsd->istart) != 0) { + yasm_warn_set(YASM_WARN_GENERAL, + N_("start inconsistent with align; using aligned value")); + yasm_errwarn_propagate(errwarns, group->bsd->start->line); + } + } + } else { + group->bsd->istart = yasm_intnum_copy(start); + if (group->bsd->align != 0) + bin_objfmt_align(group->bsd->istart, group->bsd->align); + } + + /* Determine VMA if either just valign specified or if no v* specified */ + if (!group->bsd->vstart) { + if (!group->bsd->vfollows && !group->bsd->valign) { + /* No v* specified, set VMA=LMA+vdelta. */ + group->bsd->ivstart = yasm_intnum_copy(group->bsd->istart); + yasm_intnum_calc(group->bsd->ivstart, YASM_EXPR_ADD, vdelta); + } else if (!group->bsd->vfollows) { + /* Just valign specified: set VMA=LMA+vdelta, align VMA, then add + * delta between unaligned and aligned to vdelta parameter. + */ + group->bsd->ivstart = yasm_intnum_copy(group->bsd->istart); + yasm_intnum_calc(group->bsd->ivstart, YASM_EXPR_ADD, vdelta); + yasm_intnum_set(tmp, group->bsd->ivstart); + bin_objfmt_align(group->bsd->ivstart, group->bsd->valign); + yasm_intnum_calc(vdelta, YASM_EXPR_ADD, group->bsd->ivstart); + yasm_intnum_calc(vdelta, YASM_EXPR_SUB, tmp); + } + } + + /* Find the maximum end value */ + yasm_intnum_set(tmp, group->bsd->istart); + yasm_intnum_calc(tmp, YASM_EXPR_ADD, group->bsd->length); + if (yasm_intnum_compare(tmp, last) > 0) /* tmp > last */ + yasm_intnum_set(last, tmp); + + /* Recurse for each following group. */ + TAILQ_FOREACH(follow_group, &group->follow_groups, link) { + /* Following sections have to follow this one, + * so add length to start. + */ + yasm_intnum_set(start, group->bsd->istart); + yasm_intnum_calc(start, YASM_EXPR_ADD, group->bsd->length); + + group_assign_start_recurse(follow_group, start, last, vdelta, tmp, + errwarns); + } +} + +/* Recursive function to assign start addresses. + * Updates start parameter as it goes along. + * The tmp parameter is just a working intnum so one doesn't have to be + * locally allocated for this purpose. + */ +static void +group_assign_vstart_recurse(bin_group *group, yasm_intnum *start, + yasm_errwarns *errwarns) +{ + bin_group *follow_group; + + /* Determine VMA section alignment as necessary. + * Default to LMA alignment if not specified. + */ + if (!group->bsd->valign) + group->bsd->valign = yasm_intnum_copy(group->bsd->align); + else { + unsigned long align = yasm_section_get_align(group->section); + yasm_intnum *align_intn = yasm_intnum_create_uint(align); + if (yasm_intnum_compare(align_intn, group->bsd->valign) > 0) { + yasm_warn_set(YASM_WARN_GENERAL, + N_("section `%s' internal align of %lu is greater than `%s' of %lu; using `%s'"), + yasm_section_get_name(group->section), + yasm_intnum_get_uint(align_intn), + N_("valign"), + yasm_intnum_get_uint(group->bsd->valign), + N_("valign")); + yasm_errwarn_propagate(errwarns, 0); + } + yasm_intnum_destroy(align_intn); + } + + /* Determine VMA */ + if (group->bsd->ivstart) { + yasm_intnum_set(group->bsd->ivstart, start); + if (group->bsd->valign) { + bin_objfmt_align(group->bsd->ivstart, group->bsd->valign); + if (yasm_intnum_compare(start, group->bsd->ivstart) != 0) { + yasm_error_set(YASM_ERROR_VALUE, + N_("vstart inconsistent with valign")); + yasm_errwarn_propagate(errwarns, group->bsd->vstart->line); + } + } + } else { + group->bsd->ivstart = yasm_intnum_copy(start); + if (group->bsd->valign) + bin_objfmt_align(group->bsd->ivstart, group->bsd->valign); + } + + /* Recurse for each following group. */ + TAILQ_FOREACH(follow_group, &group->follow_groups, link) { + /* Following sections have to follow this one, + * so add length to start. + */ + yasm_intnum_set(start, group->bsd->ivstart); + yasm_intnum_calc(start, YASM_EXPR_ADD, group->bsd->length); + + group_assign_vstart_recurse(follow_group, start, errwarns); + } +} + +static /*@null@*/ const yasm_intnum * +get_ssym_value(yasm_symrec *sym) +{ + bin_symrec_data *bsymd = yasm_symrec_get_data(sym, &bin_symrec_data_cb); + bin_section_data *bsd; + + if (!bsymd) + return NULL; + + bsd = yasm_section_get_data(bsymd->section, &bin_section_data_cb); + assert(bsd != NULL); + + switch (bsymd->which) { + case SSYM_START: return bsd->istart; + case SSYM_VSTART: return bsd->ivstart; + case SSYM_LENGTH: return bsd->length; + } + return NULL; +} + static /*@only@*/ yasm_expr * bin_objfmt_expr_xform(/*@returned@*/ /*@only@*/ yasm_expr *e, /*@unused@*/ /*@null@*/ void *d) { int i; - /*@dependent@*/ yasm_section *sect; - /*@dependent@*/ /*@null@*/ yasm_bytecode *precbc; - /*@null@*/ yasm_intnum *dist; - for (i=0; inumterms; i++) { + /*@dependent@*/ yasm_section *sect; + /*@dependent@*/ /*@null@*/ yasm_bytecode *precbc; + /*@null@*/ yasm_intnum *dist; + /*@null@*/ const yasm_intnum *ssymval; + /* Transform symrecs or precbcs that reference sections into - * start expr + intnum(dist). + * vstart + intnum(dist). */ if (((e->terms[i].type == YASM_EXPR_SYM && yasm_symrec_get_label(e->terms[i].data.sym, &precbc)) || @@ -109,18 +502,389 @@ bin_objfmt_expr_xform(/*@returned@*/ /*@only@*/ yasm_expr *e, (precbc = e->terms[i].data.precbc))) && (sect = yasm_bc_get_section(precbc)) && (dist = yasm_calc_bc_dist(yasm_section_bcs_first(sect), precbc))) { - const yasm_expr *start = yasm_section_get_start(sect); - e->terms[i].type = YASM_EXPR_EXPR; - e->terms[i].data.expn = - yasm_expr_create(YASM_EXPR_ADD, - yasm_expr_expr(yasm_expr_copy(start)), - yasm_expr_int(dist), e->line); + bin_section_data *bsd; + bsd = yasm_section_get_data(sect, &bin_section_data_cb); + assert(bsd != NULL); + yasm_intnum_calc(dist, YASM_EXPR_ADD, bsd->ivstart); + e->terms[i].type = YASM_EXPR_INT; + e->terms[i].data.intn = dist; + } + + /* Transform our special symrecs into the appropriate value */ + if (e->terms[i].type == YASM_EXPR_SYM && + (ssymval = get_ssym_value(e->terms[i].data.sym))) { + e->terms[i].type = YASM_EXPR_INT; + e->terms[i].data.intn = yasm_intnum_copy(ssymval); } } return e; } +typedef struct map_output_info { + /* address width */ + size_t bytes; + + /* intnum output static data areas */ + unsigned char *buf; + yasm_intnum *intn; + + /* symrec output information */ + unsigned long count; + yasm_section *section; /* NULL for EQUs */ + + yasm_object *object; /* object */ + FILE *f; /* map output file */ +} map_output_info; + +static int +map_prescan_bytes(yasm_section *sect, void *d) +{ + bin_section_data *bsd = yasm_section_get_data(sect, &bin_section_data_cb); + map_output_info *info = (map_output_info *)d; + + assert(bsd != NULL); + assert(info != NULL); + + while (!yasm_intnum_check_size(bsd->length, info->bytes * 8, 0, 0)) + info->bytes *= 2; + while (!yasm_intnum_check_size(bsd->istart, info->bytes * 8, 0, 0)) + info->bytes *= 2; + while (!yasm_intnum_check_size(bsd->ivstart, info->bytes * 8, 0, 0)) + info->bytes *= 2; + + return 0; +} + +static void +map_print_intnum(const yasm_intnum *intn, map_output_info *info) +{ + size_t i; + yasm_intnum_get_sized(intn, info->buf, info->bytes, info->bytes*8, 0, 0, + 0); + for (i=info->bytes; i != 0; i--) + fprintf(info->f, "%02X", info->buf[i-1]); +} + +static void +map_sections_summary(bin_groups *groups, map_output_info *info) +{ + bin_group *group; + TAILQ_FOREACH(group, groups, link) { + bin_section_data *bsd = group->bsd; + + assert(bsd != NULL); + assert(info != NULL); + + map_print_intnum(bsd->ivstart, info); + fprintf(info->f, " "); + + yasm_intnum_set(info->intn, bsd->ivstart); + yasm_intnum_calc(info->intn, YASM_EXPR_ADD, bsd->length); + map_print_intnum(info->intn, info); + fprintf(info->f, " "); + + map_print_intnum(bsd->istart, info); + fprintf(info->f, " "); + + yasm_intnum_set(info->intn, bsd->istart); + yasm_intnum_calc(info->intn, YASM_EXPR_ADD, bsd->length); + map_print_intnum(info->intn, info); + fprintf(info->f, " "); + + map_print_intnum(bsd->length, info); + fprintf(info->f, " "); + + fprintf(info->f, "%-*s", 10, bsd->bss ? "nobits" : "progbits"); + fprintf(info->f, "%s\n", yasm_section_get_name(group->section)); + + /* Recurse to loop through follow groups */ + map_sections_summary(&group->follow_groups, info); + } +} + +static void +map_sections_detail(bin_groups *groups, map_output_info *info) +{ + bin_group *group; + TAILQ_FOREACH(group, groups, link) { + bin_section_data *bsd = group->bsd; + size_t i; + const char *s; + + s = yasm_section_get_name(group->section); + fprintf(info->f, "---- Section %s ", s); + for (i=0; i<(65-strlen(s)); i++) + fputc('-', info->f); + + fprintf(info->f, "\n\nclass: %s", + bsd->bss ? "nobits" : "progbits"); + fprintf(info->f, "\nlength: "); + map_print_intnum(bsd->length, info); + fprintf(info->f, "\nstart: "); + map_print_intnum(bsd->istart, info); + fprintf(info->f, "\nalign: "); + map_print_intnum(bsd->align, info); + fprintf(info->f, "\nfollows: %s", + bsd->follows ? bsd->follows : "not defined"); + fprintf(info->f, "\nvstart: "); + map_print_intnum(bsd->ivstart, info); + fprintf(info->f, "\nvalign: "); + map_print_intnum(bsd->valign, info); + fprintf(info->f, "\nvfollows: %s\n\n", + bsd->vfollows ? bsd->vfollows : "not defined"); + + /* Recurse to loop through follow groups */ + map_sections_detail(&group->follow_groups, info); + } +} + +static int +map_symrec_count(yasm_symrec *sym, void *d) +{ + map_output_info *info = (map_output_info *)d; + /*@dependent@*/ yasm_bytecode *precbc; + + assert(info != NULL); + + /* TODO: autodetect wider size */ + if (!info->section && yasm_symrec_get_equ(sym)) { + info->count++; + } else if (yasm_symrec_get_label(sym, &precbc) && + yasm_bc_get_section(precbc) == info->section) { + info->count++; + } + return 0; +} + +static int +map_symrec_output(yasm_symrec *sym, void *d) +{ + map_output_info *info = (map_output_info *)d; + const yasm_expr *equ; + /*@dependent@*/ yasm_bytecode *precbc; + + assert(info != NULL); + + if (!info->section && (equ = yasm_symrec_get_equ(sym))) { + yasm_expr *realequ = yasm_expr_copy(equ); + realequ = yasm_expr__level_tree + (realequ, 1, 1, 1, 0, bin_objfmt_expr_xform, NULL); + yasm_intnum_set(info->intn, yasm_expr_get_intnum(&realequ, 0)); + yasm_expr_destroy(realequ); + map_print_intnum(info->intn, info); + fprintf(info->f, " %s\n", yasm_symrec_get_name(sym)); + } else if (yasm_symrec_get_label(sym, &precbc) && + yasm_bc_get_section(precbc) == info->section) { + bin_section_data *bsd = + yasm_section_get_data(info->section, &bin_section_data_cb); + + /* Real address */ + yasm_intnum_set_uint(info->intn, precbc->offset); + yasm_intnum_calc(info->intn, YASM_EXPR_ADD, bsd->istart); + map_print_intnum(info->intn, info); + fprintf(info->f, " "); + + /* Virtual address */ + yasm_intnum_set_uint(info->intn, precbc->offset); + yasm_intnum_calc(info->intn, YASM_EXPR_ADD, bsd->ivstart); + map_print_intnum(info->intn, info); + + /* Name */ + fprintf(info->f, " %s\n", yasm_symrec_get_name(sym)); + } + return 0; +} + +static void +map_sections_symbols(bin_groups *groups, map_output_info *info) +{ + bin_group *group; + TAILQ_FOREACH(group, groups, link) { + info->count = 0; + info->section = group->section; + yasm_symtab_traverse(info->object->symtab, info, map_symrec_count); + + if (info->count > 0) { + const char *s = yasm_section_get_name(group->section); + size_t i; + fprintf(info->f, "---- Section %s ", s); + for (i=0; i<(65-strlen(s)); i++) + fputc('-', info->f); + fprintf(info->f, "\n\n%-*s%-*s%s\n", + info->bytes*2+2, "Real", + info->bytes*2+2, "Virtual", + "Name"); + yasm_symtab_traverse(info->object->symtab, info, + map_symrec_output); + fprintf(info->f, "\n\n"); + } + + /* Recurse to loop through follow groups */ + map_sections_symbols(&group->follow_groups, info); + } +} + +static void +output_map(bin_objfmt_output_info *info) +{ + yasm_objfmt_bin *objfmt_bin = (yasm_objfmt_bin *)info->object->objfmt; + FILE *f; + int i; + map_output_info mapinfo; + + if (objfmt_bin->map_flags == NO_MAP) + return; + + if (objfmt_bin->map_flags == MAP_NONE) + objfmt_bin->map_flags = MAP_BRIEF; /* default to brief */ + + if (!objfmt_bin->map_filename) + f = stdout; /* default to stdout */ + else { + f = fopen(objfmt_bin->map_filename, "wt"); + if (!f) { + yasm_warn_set(YASM_WARN_GENERAL, + N_("unable to open map file `%s'"), + objfmt_bin->map_filename); + yasm_errwarn_propagate(info->errwarns, 0); + return; + } + } + + mapinfo.object = info->object; + mapinfo.f = f; + + /* Temporary intnum */ + mapinfo.intn = info->tmp_intn; + + /* Prescan all values to figure out what width we should make the output + * fields. Start with a minimum of 4. + */ + mapinfo.bytes = 4; + while (!yasm_intnum_check_size(info->origin, mapinfo.bytes * 8, 0, 0)) + mapinfo.bytes *= 2; + yasm_object_sections_traverse(info->object, &mapinfo, map_prescan_bytes); + mapinfo.buf = yasm_xmalloc(mapinfo.bytes); + + fprintf(f, "\n- YASM Map file "); + for (i=0; i<63; i++) + fputc('-', f); + fprintf(f, "\n\nSource file: %s\n", info->object->src_filename); + fprintf(f, "Output file: %s\n\n", info->object->obj_filename); + + fprintf(f, "-- Program origin "); + for (i=0; i<61; i++) + fputc('-', f); + fprintf(f, "\n\n"); + map_print_intnum(info->origin, &mapinfo); + fprintf(f, "\n\n"); + + if (objfmt_bin->map_flags & MAP_BRIEF) { + fprintf(f, "-- Sections (summary) "); + for (i=0; i<57; i++) + fputc('-', f); + fprintf(f, "\n\n%-*s%-*s%-*s%-*s%-*s%-*s%s\n", + mapinfo.bytes*2+2, "Vstart", + mapinfo.bytes*2+2, "Vstop", + mapinfo.bytes*2+2, "Start", + mapinfo.bytes*2+2, "Stop", + mapinfo.bytes*2+2, "Length", + 10, "Class", "Name"); + + map_sections_summary(&info->lma_groups, &mapinfo); + fprintf(f, "\n"); + } + + if (objfmt_bin->map_flags & MAP_SECTIONS) { + fprintf(f, "-- Sections (detailed) "); + for (i=0; i<56; i++) + fputc('-', f); + fprintf(f, "\n\n"); + map_sections_detail(&info->lma_groups, &mapinfo); + } + + if (objfmt_bin->map_flags & MAP_SYMBOLS) { + fprintf(f, "-- Symbols "); + for (i=0; i<68; i++) + fputc('-', f); + fprintf(f, "\n\n"); + + /* We do two passes for EQU and each section; the first pass + * determines the byte width to use for the value and whether any + * symbols are present, the second pass actually outputs the text. + */ + + /* EQUs */ + mapinfo.count = 0; + mapinfo.section = NULL; + yasm_symtab_traverse(info->object->symtab, &mapinfo, map_symrec_count); + + if (mapinfo.count > 0) { + fprintf(f, "---- No Section "); + for (i=0; i<63; i++) + fputc('-', f); + fprintf(f, "\n\n%-*s%s\n", mapinfo.bytes*2+2, "Value", "Name"); + yasm_symtab_traverse(info->object->symtab, &mapinfo, + map_symrec_output); + fprintf(f, "\n\n"); + } + + /* Other sections */ + map_sections_symbols(&info->lma_groups, &mapinfo); + } + + if (f != stdout) + fclose(f); + + yasm_xfree(mapinfo.buf); +} + +/* Check for LMA overlap using a simple N^2 algorithm. */ +static int +check_lma_overlap(yasm_section *sect, /*@null@*/ void *d) +{ + bin_section_data *bsd, *bsd2; + yasm_section *other = (yasm_section *)d; + yasm_intnum *overlap; + + if (!d) + return yasm_object_sections_traverse(yasm_section_get_object(sect), + sect, check_lma_overlap); + if (sect == other) + return 0; + + bsd = yasm_section_get_data(sect, &bin_section_data_cb); + bsd2 = yasm_section_get_data(other, &bin_section_data_cb); + + if (yasm_intnum_is_zero(bsd->length) || + yasm_intnum_is_zero(bsd2->length)) + return 0; + + if (yasm_intnum_compare(bsd->istart, bsd2->istart) <= 0) { + overlap = yasm_intnum_copy(bsd->istart); + yasm_intnum_calc(overlap, YASM_EXPR_ADD, bsd->length); + yasm_intnum_calc(overlap, YASM_EXPR_SUB, bsd2->istart); + } else { + overlap = yasm_intnum_copy(bsd2->istart); + yasm_intnum_calc(overlap, YASM_EXPR_ADD, bsd2->length); + yasm_intnum_calc(overlap, YASM_EXPR_SUB, bsd->istart); + } + + if (yasm_intnum_sign(overlap) > 0) { + yasm_error_set(YASM_ERROR_GENERAL, + N_("sections `%s' and `%s' overlap by %lu bytes"), + yasm_section_get_name(sect), + yasm_section_get_name(other), + yasm_intnum_get_uint(overlap)); + yasm_intnum_destroy(overlap); + return -1; + } + + yasm_intnum_destroy(overlap); + return 0; +} + static int bin_objfmt_output_value(yasm_value *value, unsigned char *buf, unsigned int destsize, @@ -137,6 +901,7 @@ bin_objfmt_output_value(yasm_value *value, unsigned char *buf, if (value->rel) { unsigned int rshift = (unsigned int)value->rshift; yasm_expr *syme; + /*@null@*/ const yasm_intnum *ssymval; if (yasm_symrec_is_abs(value->rel)) { syme = yasm_expr_create_ident(yasm_expr_int( @@ -144,6 +909,9 @@ bin_objfmt_output_value(yasm_value *value, unsigned char *buf, } else if (yasm_symrec_get_label(value->rel, &precbc) && (sect = yasm_bc_get_section(precbc))) { syme = yasm_expr_create_ident(yasm_expr_sym(value->rel), bc->line); + } else if ((ssymval = get_ssym_value(value->rel))) { + syme = yasm_expr_create_ident(yasm_expr_int( + yasm_intnum_copy(ssymval)), bc->line); } else goto done; @@ -241,139 +1009,401 @@ bin_objfmt_output_bytecode(yasm_bytecode *bc, /*@null@*/ void *d) return 0; } +/* Check to ensure bytecode is res* (for BSS sections) */ static int -bin_objfmt_check_sym(yasm_symrec *sym, /*@null@*/ void *d) +bin_objfmt_no_output_bytecode(yasm_bytecode *bc, /*@null@*/ void *d) { /*@null@*/ bin_objfmt_output_info *info = (bin_objfmt_output_info *)d; - yasm_sym_vis vis = yasm_symrec_get_visibility(sym); + /*@null@*/ /*@only@*/ unsigned char *bigbuf; + unsigned long size = REGULAR_OUTBUF_SIZE; + int gap; + assert(info != NULL); - if (vis & YASM_SYM_EXTERN) { + bigbuf = yasm_bc_tobytes(bc, info->buf, &size, &gap, info, + bin_objfmt_output_value, NULL); + + /* If bigbuf was allocated, free it */ + if (bigbuf) + yasm_xfree(bigbuf); + + /* Don't bother doing anything else if size ended up being 0. */ + if (size == 0) + return 0; + + /* Warn if not a gap. */ + if (!gap) { yasm_warn_set(YASM_WARN_GENERAL, - N_("binary object format does not support extern variables")); - yasm_errwarn_propagate(info->errwarns, yasm_symrec_get_decl_line(sym)); - } else if (vis & YASM_SYM_GLOBAL) { - yasm_warn_set(YASM_WARN_GENERAL, - N_("binary object format does not support global variables")); - yasm_errwarn_propagate(info->errwarns, yasm_symrec_get_decl_line(sym)); - } else if (vis & YASM_SYM_COMMON) { - yasm_error_set(YASM_ERROR_TYPE, - N_("binary object format does not support common variables")); - yasm_errwarn_propagate(info->errwarns, yasm_symrec_get_decl_line(sym)); + N_("initialized space declared in nobits section: ignoring")); } + return 0; } +static int +bin_objfmt_output_section(yasm_section *sect, /*@null@*/ void *d) +{ + bin_section_data *bsd = yasm_section_get_data(sect, &bin_section_data_cb); + /*@null@*/ bin_objfmt_output_info *info = (bin_objfmt_output_info *)d; + + assert(bsd != NULL); + assert(info != NULL); + + if (bsd->bss) { + yasm_section_bcs_traverse(sect, info->errwarns, + info, bin_objfmt_no_output_bytecode); + } else { + yasm_intnum_set(info->tmp_intn, bsd->istart); + yasm_intnum_calc(info->tmp_intn, YASM_EXPR_SUB, info->origin); + if (yasm_intnum_sign(info->tmp_intn) < 0) { + yasm_error_set(YASM_ERROR_VALUE, + N_("section `%s' starts before origin (ORG)"), + yasm_section_get_name(sect)); + yasm_errwarn_propagate(info->errwarns, 0); + return 0; + } + if (!yasm_intnum_check_size(info->tmp_intn, sizeof(long)*8, 0, 1)) { + yasm_error_set(YASM_ERROR_VALUE, + N_("section `%s' start value too large"), + yasm_section_get_name(sect)); + yasm_errwarn_propagate(info->errwarns, 0); + return 0; + } + fseek(info->f, yasm_intnum_get_int(info->tmp_intn), SEEK_SET); + yasm_section_bcs_traverse(sect, info->errwarns, + info, bin_objfmt_output_bytecode); + } + + return 0; +} + +static void +bin_objfmt_cleanup(bin_objfmt_output_info *info) +{ + bin_group *group, *group_temp; + + yasm_xfree(info->buf); + yasm_intnum_destroy(info->origin); + yasm_intnum_destroy(info->tmp_intn); + + TAILQ_FOREACH_SAFE(group, &info->lma_groups, link, group_temp) + bin_group_destroy(group); + + TAILQ_FOREACH_SAFE(group, &info->vma_groups, link, group_temp) + bin_group_destroy(group); +} + static void bin_objfmt_output(yasm_object *object, FILE *f, /*@unused@*/ int all_syms, yasm_errwarns *errwarns) { - /*@observer@*/ /*@null@*/ yasm_section *text, *data, *bss, *prevsect; - /*@null@*/ yasm_expr *startexpr; - /*@dependent@*/ /*@null@*/ const yasm_intnum *startnum; - unsigned long start = 0, textstart = 0, datastart = 0; - unsigned long textlen = 0, textpad = 0, datalen = 0, datapad = 0; - unsigned long *prevsectlenptr, *prevsectpadptr; - unsigned long i; + yasm_objfmt_bin *objfmt_bin = (yasm_objfmt_bin *)object->objfmt; bin_objfmt_output_info info; + bin_group *group, *lma_group, *vma_group, *group_temp; + yasm_intnum *start, *last, *vdelta; + bin_groups unsorted_groups, bss_groups; + + /* Set ORG to 0 unless otherwise specified */ + if (objfmt_bin->org) { + info.origin = yasm_expr_get_intnum(&objfmt_bin->org, 0); + if (!info.origin) { + yasm_error_set(YASM_ERROR_TOO_COMPLEX, + N_("ORG expression is too complex")); + yasm_errwarn_propagate(errwarns, objfmt_bin->org->line); + return; + } + if (yasm_intnum_sign(info.origin) < 0) { + yasm_error_set(YASM_ERROR_VALUE, N_("ORG expression is negative")); + yasm_errwarn_propagate(errwarns, objfmt_bin->org->line); + return; + } + info.origin = yasm_intnum_copy(info.origin); + } else + info.origin = yasm_intnum_create_uint(0); info.object = object; info.errwarns = errwarns; info.f = f; info.buf = yasm_xmalloc(REGULAR_OUTBUF_SIZE); + info.tmp_intn = yasm_intnum_create_uint(0); + TAILQ_INIT(&info.lma_groups); + TAILQ_INIT(&info.vma_groups); /* Check symbol table */ yasm_symtab_traverse(object->symtab, &info, bin_objfmt_check_sym); - text = yasm_object_find_general(object, ".text"); - data = yasm_object_find_general(object, ".data"); - bss = yasm_object_find_general(object, ".bss"); + /* Create section groups */ + if (yasm_object_sections_traverse(object, &info, bin_lma_create_group)) { + bin_objfmt_cleanup(&info); + return; /* error detected */ + } - if (!text) - yasm_internal_error(N_("No `.text' section in bin objfmt output")); - - /* First determine the actual starting offsets for .data and .bss. - * As the order in the file is .text -> .data -> .bss (not present), - * use the last bytecode in .text (and the .text section start) to - * determine the starting offset in .data, and likewise for .bss. - * Also compensate properly for alignment. + /* Determine section order according to LMA. + * Sections can be ordered either by (priority): + * - follows + * - start + * - progbits/nobits setting + * - order in the input file */ - /* Find out the start of .text */ - startexpr = yasm_expr_copy(yasm_section_get_start(text)); - assert(startexpr != NULL); - startnum = yasm_expr_get_intnum(&startexpr, 0); - if (!startnum) { - yasm_error_set(YASM_ERROR_TOO_COMPLEX, - N_("ORG expression too complex")); - yasm_errwarn_propagate(errwarns, startexpr->line); + /* Look at each group with follows specified, and find the section + * that group is supposed to follow. + */ + TAILQ_FOREACH_SAFE(lma_group, &info.lma_groups, link, group_temp) { + if (lma_group->bsd->follows) { + bin_group *found; + /* Need to find group containing section this section follows. */ + found = + find_group_by_name(&info.lma_groups, lma_group->bsd->follows); + if (!found) { + yasm_error_set(YASM_ERROR_VALUE, + N_("section `%s' follows an invalid or unknown section `%s'"), + yasm_section_get_name(lma_group->section), + lma_group->bsd->follows); + yasm_errwarn_propagate(errwarns, 0); + bin_objfmt_cleanup(&info); + return; + } + + /* Check for loops */ + if (lma_group->section == found->section || + find_group_by_section(&lma_group->follow_groups, + found->section)) { + yasm_error_set(YASM_ERROR_VALUE, + N_("follows loop between section `%s' and section `%s'"), + yasm_section_get_name(lma_group->section), + yasm_section_get_name(found->section)); + yasm_errwarn_propagate(errwarns, 0); + bin_objfmt_cleanup(&info); + return; + } + + /* Remove this section from main lma groups list */ + TAILQ_REMOVE(&info.lma_groups, lma_group, link); + /* Add it after the section it's supposed to follow. */ + TAILQ_INSERT_TAIL(&found->follow_groups, lma_group, link); + } + } + + /* Sort the top-level groups according to their start address. + * Use Shell sort for ease of implementation. + * If no start address is specified for a section, don't change the order, + * and move BSS sections to a separate list so they can be moved to the + * end of the lma list after all other sections are sorted. + */ + unsorted_groups = info.lma_groups; /* structure copy */ + TAILQ_INIT(&info.lma_groups); + TAILQ_INIT(&bss_groups); + TAILQ_FOREACH_SAFE(lma_group, &unsorted_groups, link, group_temp) { + bin_group *before; + + if (!lma_group->bsd->istart) { + if (lma_group->bsd->bss) + TAILQ_INSERT_TAIL(&bss_groups, lma_group, link); + else + TAILQ_INSERT_TAIL(&info.lma_groups, lma_group, link); + continue; + } + + before = NULL; + TAILQ_FOREACH(group, &info.lma_groups, link) { + if (!group->bsd->istart) + continue; + if (yasm_intnum_compare(group->bsd->istart, + lma_group->bsd->istart) > 0) { + before = group; + break; + } + } + if (before) + TAILQ_INSERT_BEFORE(before, lma_group, link); + else + TAILQ_INSERT_TAIL(&info.lma_groups, lma_group, link); + } + + /* Move the pure-BSS sections to the end of the LMA list. */ + TAILQ_FOREACH_SAFE(group, &bss_groups, link, group_temp) + TAILQ_INSERT_TAIL(&info.lma_groups, group, link); + TAILQ_INIT(&bss_groups); /* For sanity */ + + /* Assign a LMA start address to every section. + * Also assign VMA=LMA unless otherwise specified. + * + * We need to assign VMA=LMA here (while walking the tree) for the case: + * sect1 start=0 (size=0x11) + * sect2 follows=sect1 valign=16 (size=0x104) + * sect3 follows=sect2 valign=16 + * Where the valign of sect2 will result in a sect3 vaddr higher than a + * naive segment-by-segment interpretation (where sect3 and sect2 would + * have a VMA overlap). + * + * Algorithm for VMA=LMA setting: + * Start with delta=0. + * If there's no virtual attributes, we simply set VMA = LMA+delta. + * If there's only valign specified, we set VMA = aligned LMA, and add + * any new alignment difference to delta. + * + * We could do the LMA start and VMA=LMA steps in two separate steps, + * but it's easier to just recurse once. + */ + start = yasm_intnum_copy(info.origin); + last = yasm_intnum_copy(info.origin); + vdelta = yasm_intnum_create_uint(0); + TAILQ_FOREACH(lma_group, &info.lma_groups, link) { + if (lma_group->bsd->istart) + yasm_intnum_set(start, lma_group->bsd->istart); + group_assign_start_recurse(lma_group, start, last, vdelta, + info.tmp_intn, errwarns); + yasm_intnum_set(start, last); + } + yasm_intnum_destroy(last); + yasm_intnum_destroy(vdelta); + + /* + * Determine section order according to VMA + */ + + /* Create section groups */ + if (yasm_object_sections_traverse(object, &info, bin_vma_create_group)) { + yasm_intnum_destroy(start); + bin_objfmt_cleanup(&info); + return; /* error detected */ + } + + /* Look at each group with vfollows specified, and find the section + * that group is supposed to follow. + */ + TAILQ_FOREACH_SAFE(vma_group, &info.vma_groups, link, group_temp) { + if (vma_group->bsd->vfollows) { + bin_group *found; + /* Need to find group containing section this section follows. */ + found = find_group_by_name(&info.vma_groups, + vma_group->bsd->vfollows); + if (!found) { + yasm_error_set(YASM_ERROR_VALUE, + N_("section `%s' vfollows an invalid or unknown section `%s'"), + yasm_section_get_name(vma_group->section), + vma_group->bsd->vfollows); + yasm_errwarn_propagate(errwarns, 0); + yasm_intnum_destroy(start); + bin_objfmt_cleanup(&info); + return; + } + + /* Check for loops */ + if (vma_group->section == found->section || + find_group_by_section(&vma_group->follow_groups, + found->section)) { + yasm_error_set(YASM_ERROR_VALUE, + N_("vfollows loop between section `%s' and section `%s'"), + yasm_section_get_name(vma_group->section), + yasm_section_get_name(found->section)); + yasm_errwarn_propagate(errwarns, 0); + bin_objfmt_cleanup(&info); + return; + } + + /* Remove this section from main lma groups list */ + TAILQ_REMOVE(&info.vma_groups, vma_group, link); + /* Add it after the section it's supposed to follow. */ + TAILQ_INSERT_TAIL(&found->follow_groups, vma_group, link); + } + } + + /* Due to the combination of steps above, we now know that all top-level + * groups have integer ivstart: + * Vstart Vfollows Valign Handled by + * No No No group_assign_start_recurse() + * No No Yes group_assign_start_recurse() + * No Yes - vfollows loop (above) + * Yes - - bin_lma_create_group() + */ + TAILQ_FOREACH(vma_group, &info.vma_groups, link) { + yasm_intnum_set(start, vma_group->bsd->ivstart); + group_assign_vstart_recurse(vma_group, start, errwarns); + } + + /* Output map file */ + output_map(&info); + + /* Ensure we don't have overlapping progbits LMAs. + * Use a dumb O(N^2) algorithm as the number of sections is essentially + * always low. + */ + if (yasm_object_sections_traverse(object, NULL, check_lma_overlap)) { + yasm_errwarn_propagate(errwarns, 0); + yasm_intnum_destroy(start); + bin_objfmt_cleanup(&info); return; } - start = yasm_intnum_get_uint(startnum); - yasm_expr_destroy(startexpr); - info.abs_start = start; - textstart = start; - /* Align .data and .bss (if present) by adjusting their starts. */ - prevsect = text; - prevsectlenptr = &textlen; - prevsectpadptr = &textpad; - if (data) { - start = bin_objfmt_align_section(data, prevsect, start, - prevsectlenptr, prevsectpadptr); - yasm_section_set_start(data, yasm_expr_create_ident( - yasm_expr_int(yasm_intnum_create_uint(start)), 0), 0); - datastart = start; - prevsect = data; - prevsectlenptr = &datalen; - prevsectpadptr = &datapad; - } - if (bss) { - start = bin_objfmt_align_section(bss, prevsect, start, - prevsectlenptr, prevsectpadptr); - yasm_section_set_start(bss, yasm_expr_create_ident( - yasm_expr_int(yasm_intnum_create_uint(start)), 0), 0); - } + /* Output sections */ + yasm_object_sections_traverse(object, &info, bin_objfmt_output_section); - /* Output .text first. */ - info.sect = text; - info.start = textstart; - yasm_section_bcs_traverse(text, errwarns, &info, - bin_objfmt_output_bytecode); - - /* If .data is present, output it */ - if (data) { - /* Add padding to align .data. Just use a for loop, as this will - * seldom be very many bytes. - */ - for (i=0; imap_filename) + yasm_xfree(objfmt_bin->map_filename); + yasm_expr_destroy(objfmt_bin->org); yasm_xfree(objfmt); } static void +define_section_symbol(yasm_symtab *symtab, yasm_section *sect, + const char *sectname, const char *suffix, + enum bin_ssym which, unsigned long line) +{ + yasm_symrec *sym; + bin_symrec_data *bsymd = yasm_xmalloc(sizeof(bin_symrec_data)); + char *symname = yasm_xmalloc(8+strlen(sectname)+strlen(suffix)+1); + + strcpy(symname, "section."); + strcat(symname, sectname); + strcat(symname, suffix); + + bsymd->section = sect; + bsymd->which = which; + + sym = yasm_symtab_declare(symtab, symname, YASM_SYM_EXTERN, line); + yasm_xfree(symname); + yasm_symrec_add_data(sym, &bin_symrec_data_cb, bsymd); +} + +static bin_section_data * bin_objfmt_init_new_section(yasm_object *object, yasm_section *sect, const char *sectname, unsigned long line) { - yasm_symtab_define_label(object->symtab, sectname, - yasm_section_bcs_first(sect), 1, line); + /*yasm_objfmt_bin *objfmt_bin = (yasm_objfmt_bin *)object->objfmt;*/ + bin_section_data *data; + + data = yasm_xmalloc(sizeof(bin_section_data)); + data->bss = 0; + data->align = NULL; + data->valign = NULL; + data->start = NULL; + data->vstart = NULL; + data->follows = NULL; + data->vfollows = NULL; + data->istart = NULL; + data->ivstart = NULL; + data->length = NULL; + yasm_section_add_data(sect, &bin_section_data_cb, data); + + define_section_symbol(object->symtab, sect, sectname, ".start", + SSYM_START, line); + define_section_symbol(object->symtab, sect, sectname, ".vstart", + SSYM_VSTART, line); + define_section_symbol(object->symtab, sect, sectname, ".length", + SSYM_LENGTH, line); + + return data; } static yasm_section * @@ -382,7 +1412,7 @@ bin_objfmt_add_default_section(yasm_object *object) yasm_section *retval; int isnew; - retval = yasm_object_get_general(object, ".text", 0, 16, 1, 0, &isnew, 0); + retval = yasm_object_get_general(object, ".text", 0, 1, 0, &isnew, 0); if (isnew) { bin_objfmt_init_new_section(object, retval, ".text", 0); yasm_section_set_default(retval, 1); @@ -399,15 +1429,46 @@ bin_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, yasm_valparam *vp; yasm_section *retval; int isnew; - unsigned long start; + int flags_override = 0; const char *sectname; - int resonly = 0; - /*@only@*/ /*@null@*/ yasm_intnum *align_intn = NULL; - unsigned long align = 4; - int have_align = 0; + bin_section_data *bsd = NULL; + + struct bin_section_switch_data { + /*@only@*/ /*@null@*/ char *follows; + /*@only@*/ /*@null@*/ char *vfollows; + /*@only@*/ /*@null@*/ yasm_expr *start; + /*@only@*/ /*@null@*/ yasm_expr *vstart; + /*@only@*/ /*@null@*/ yasm_intnum *align; + /*@only@*/ /*@null@*/ yasm_intnum *valign; + unsigned long bss; + unsigned long code; + } data; static const yasm_dir_help help[] = { - { "align", 1, yasm_dir_helper_intn, 0, 0 } + { "follows", 1, yasm_dir_helper_string, + offsetof(struct bin_section_switch_data, follows), 0 }, + { "vfollows", 1, yasm_dir_helper_string, + offsetof(struct bin_section_switch_data, vfollows), 0 }, + { "start", 1, yasm_dir_helper_expr, + offsetof(struct bin_section_switch_data, start), 0 }, + { "vstart", 1, yasm_dir_helper_expr, + offsetof(struct bin_section_switch_data, vstart), 0 }, + { "align", 1, yasm_dir_helper_intn, + offsetof(struct bin_section_switch_data, align), 0 }, + { "valign", 1, yasm_dir_helper_intn, + offsetof(struct bin_section_switch_data, valign), 0 }, + { "nobits", 0, yasm_dir_helper_flag_set, + offsetof(struct bin_section_switch_data, bss), 1 }, + { "progbits", 0, yasm_dir_helper_flag_set, + offsetof(struct bin_section_switch_data, bss), 0 }, + { "code", 0, yasm_dir_helper_flag_set, + offsetof(struct bin_section_switch_data, code), 1 }, + { "data", 0, yasm_dir_helper_flag_set, + offsetof(struct bin_section_switch_data, code), 0 }, + { "execute", 0, yasm_dir_helper_flag_set, + offsetof(struct bin_section_switch_data, code), 1 }, + { "noexecute", 0, yasm_dir_helper_flag_set, + offsetof(struct bin_section_switch_data, code), 0 } }; vp = yasm_vps_first(valparams); @@ -416,31 +1477,48 @@ bin_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, return NULL; vp = yasm_vps_next(vp); - /* If it's the first section output (.text) start at 0, otherwise - * make sure the start is > 128. - */ - if (strcmp(sectname, ".text") == 0) - start = 0; - else if (strcmp(sectname, ".data") == 0) - start = 200; - else if (strcmp(sectname, ".bss") == 0) { - start = 200; - resonly = 1; + retval = yasm_object_find_general(object, sectname); + if (retval) { + bsd = yasm_section_get_data(retval, &bin_section_data_cb); + assert(bsd != NULL); + data.follows = bsd->follows; + data.vfollows = bsd->vfollows; + data.start = bsd->start; + data.vstart = bsd->vstart; + data.align = NULL; + data.valign = NULL; + data.bss = bsd->bss; + data.code = yasm_section_is_code(retval); } else { - /* other section names not recognized. */ + data.follows = NULL; + data.vfollows = NULL; + data.start = NULL; + data.vstart = NULL; + data.align = NULL; + data.valign = NULL; + data.bss = strcmp(sectname, ".bss") == 0; + data.code = strcmp(sectname, ".text") == 0; + } + + flags_override = yasm_dir_helper(object, vp, line, help, NELEMS(help), + &data, yasm_dir_helper_valparam_warn); + if (flags_override < 0) + return NULL; /* error occurred */ + + if (data.start && data.follows) { yasm_error_set(YASM_ERROR_GENERAL, - N_("segment name `%s' not recognized"), sectname); + N_("cannot combine `start' and `follows' section attributes")); return NULL; } - have_align = yasm_dir_helper(object, vp, line, help, NELEMS(help), - &align_intn, yasm_dir_helper_valparam_warn); - if (have_align < 0) - return NULL; /* error occurred */ + if (data.vstart && data.vfollows) { + yasm_error_set(YASM_ERROR_GENERAL, + N_("cannot combine `vstart' and `vfollows' section attributes")); + return NULL; + } - if (align_intn) { - align = yasm_intnum_get_uint(align_intn); - yasm_intnum_destroy(align_intn); + if (data.align) { + unsigned long align = yasm_intnum_get_uint(data.align); /* Alignments must be a power of two. */ if (!is_exp2(align)) { @@ -449,22 +1527,42 @@ bin_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, "align"); return NULL; } - } + } else + data.align = bsd ? bsd->align : NULL; - retval = yasm_object_get_general(object, sectname, - yasm_expr_create_ident( - yasm_expr_int(yasm_intnum_create_uint(start)), line), align, - strcmp(sectname, ".text") == 0, resonly, &isnew, line); + if (data.valign) { + unsigned long valign = yasm_intnum_get_uint(data.valign); + + /* Alignments must be a power of two. */ + if (!is_exp2(valign)) { + yasm_error_set(YASM_ERROR_VALUE, + N_("argument to `%s' is not a power of two"), + "valign"); + return NULL; + } + } else + data.valign = bsd ? bsd->valign : NULL; + + retval = yasm_object_get_general(object, sectname, 0, (int)data.code, + (int)data.bss, &isnew, line); if (isnew) - bin_objfmt_init_new_section(object, retval, sectname, line); + bsd = bin_objfmt_init_new_section(object, retval, sectname, line); + else + bsd = yasm_section_get_data(retval, &bin_section_data_cb); if (isnew || yasm_section_is_default(retval)) { yasm_section_set_default(retval, 0); - yasm_section_set_align(retval, align, line); - } else if (have_align) - yasm_warn_set(YASM_WARN_GENERAL, - N_("alignment value ignored on section redeclaration")); + } + + /* Update section flags */ + bsd->bss = data.bss; + bsd->align = data.align; + bsd->valign = data.valign; + bsd->start = data.start; + bsd->vstart = data.vstart; + bsd->follows = data.follows; + bsd->vfollows = data.vfollows; return retval; } @@ -475,25 +1573,181 @@ bin_objfmt_dir_org(yasm_object *object, /*@unused@*/ /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line) { - yasm_section *sect; + yasm_objfmt_bin *objfmt_bin = (yasm_objfmt_bin *)object->objfmt; yasm_valparam *vp; - /*@only@*/ /*@null@*/ yasm_expr *start; - /* ORG takes just a simple integer as param */ + /* We only allow a single ORG in a program. */ + if (objfmt_bin->org) { + yasm_error_set(YASM_ERROR_GENERAL, N_("program origin redefined")); + return; + } + + /* ORG takes just a simple expression as param */ vp = yasm_vps_first(valparams); - start = yasm_vp_expr(vp, object->symtab, line); - if (!start) { + objfmt_bin->org = yasm_vp_expr(vp, object->symtab, line); + if (!objfmt_bin->org) { yasm_error_set(YASM_ERROR_SYNTAX, N_("argument to ORG must be expression")); return; } +} - /* ORG changes the start of the .text section */ - sect = yasm_object_find_general(object, ".text"); - if (!sect) - yasm_internal_error( - N_("bin objfmt: .text section does not exist before ORG is called?")); - yasm_section_set_start(sect, start, line); +struct bin_dir_map_data { + unsigned long flags; + /*@only@*/ /*@null@*/ char *filename; +}; + +static int +dir_map_filename(void *obj, yasm_valparam *vp, unsigned long line, void *data) +{ + struct bin_dir_map_data *mdata = (struct bin_dir_map_data *)data; + const char *filename; + + if (mdata->filename) { + yasm_warn_set(YASM_WARN_GENERAL, N_("map file already specified")); + return 0; + } + + filename = yasm_vp_string(vp); + if (!filename) { + yasm_error_set(YASM_ERROR_SYNTAX, + N_("unexpected expression in [map]")); + return -1; + } + mdata->filename = yasm__xstrdup(filename); + + return 1; +} + +static void +bin_objfmt_dir_map(yasm_object *object, + /*@null@*/ yasm_valparamhead *valparams, + /*@unused@*/ /*@null@*/ + yasm_valparamhead *objext_valparams, unsigned long line) +{ + yasm_objfmt_bin *objfmt_bin = (yasm_objfmt_bin *)object->objfmt; + + struct bin_dir_map_data data; + + static const yasm_dir_help help[] = { + { "all", 0, yasm_dir_helper_flag_or, + offsetof(struct bin_dir_map_data, flags), + MAP_BRIEF|MAP_SECTIONS|MAP_SYMBOLS }, + { "brief", 0, yasm_dir_helper_flag_or, + offsetof(struct bin_dir_map_data, flags), MAP_BRIEF }, + { "sections", 0, yasm_dir_helper_flag_or, + offsetof(struct bin_dir_map_data, flags), MAP_SECTIONS }, + { "segments", 0, yasm_dir_helper_flag_or, + offsetof(struct bin_dir_map_data, flags), MAP_SECTIONS }, + { "symbols", 0, yasm_dir_helper_flag_or, + offsetof(struct bin_dir_map_data, flags), MAP_SYMBOLS } + }; + + data.flags = objfmt_bin->map_flags | MAP_NONE; + data.filename = objfmt_bin->map_filename; + + if (valparams && yasm_dir_helper(object, yasm_vps_first(valparams), line, help, + NELEMS(help), &data, dir_map_filename) < 0) + return; /* error occurred */ + + objfmt_bin->map_flags = data.flags; + objfmt_bin->map_filename = data.filename; +} + +static void +bin_section_data_destroy(void *data) +{ + bin_section_data *bsd = (bin_section_data *)data; + if (bsd->start) + yasm_expr_destroy(bsd->start); + if (bsd->vstart) + yasm_expr_destroy(bsd->vstart); + if (bsd->follows) + yasm_xfree(bsd->follows); + if (bsd->vfollows) + yasm_xfree(bsd->vfollows); + if (bsd->istart) + yasm_intnum_destroy(bsd->istart); + if (bsd->ivstart) + yasm_intnum_destroy(bsd->ivstart); + if (bsd->length) + yasm_intnum_destroy(bsd->length); + yasm_xfree(data); +} + +static void +bin_section_data_print(void *data, FILE *f, int indent_level) +{ + bin_section_data *bsd = (bin_section_data *)data; + + fprintf(f, "%*sbss=%d\n", indent_level, "", bsd->bss); + + fprintf(f, "%*salign=", indent_level, ""); + if (bsd->align) + yasm_intnum_print(bsd->align, f); + else + fprintf(f, "(nil)"); + fprintf(f, "\n%*svalign=", indent_level, ""); + if (bsd->valign) + yasm_intnum_print(bsd->valign, f); + else + fprintf(f, "(nil)"); + + fprintf(f, "\n%*sstart=", indent_level, ""); + yasm_expr_print(bsd->start, f); + fprintf(f, "\n%*svstart=", indent_level, ""); + yasm_expr_print(bsd->vstart, f); + + fprintf(f, "\n%*sfollows=", indent_level, ""); + if (bsd->follows) + fprintf(f, "\"%s\"", bsd->follows); + else + fprintf(f, "(nil)"); + fprintf(f, "\n%*svfollows=", indent_level, ""); + if (bsd->vfollows) + fprintf(f, "\"%s\"", bsd->vfollows); + else + fprintf(f, "(nil)"); + + fprintf(f, "\n%*sistart=", indent_level, ""); + if (bsd->istart) + yasm_intnum_print(bsd->istart, f); + else + fprintf(f, "(nil)"); + fprintf(f, "\n%*sivstart=", indent_level, ""); + if (bsd->ivstart) + yasm_intnum_print(bsd->ivstart, f); + else + fprintf(f, "(nil)"); + + fprintf(f, "\n%*slength=", indent_level, ""); + if (bsd->length) + yasm_intnum_print(bsd->length, f); + else + fprintf(f, "(nil)"); + fprintf(f, "\n"); +} + +static void +bin_symrec_data_destroy(void *data) +{ + yasm_xfree(data); +} + +static void +bin_symrec_data_print(void *data, FILE *f, int indent_level) +{ + bin_symrec_data *bsymd = (bin_symrec_data *)data; + + fprintf(f, "%*ssection=\"%s\"\n", indent_level, "", + yasm_section_get_name(bsymd->section)); + fprintf(f, "%*swhich=", indent_level, ""); + switch (bsymd->which) { + case SSYM_START: fprintf(f, "START"); break; + case SSYM_VSTART: fprintf(f, "VSTART"); break; + case SSYM_LENGTH: fprintf(f, "LENGTH"); break; + } + fprintf(f, "\n"); } @@ -505,6 +1759,7 @@ static const char *bin_objfmt_dbgfmt_keywords[] = { static const yasm_directive bin_objfmt_directives[] = { { "org", "nasm", bin_objfmt_dir_org, YASM_DIR_ARG_REQUIRED }, + { "map", "nasm", bin_objfmt_dir_map, YASM_DIR_ANY }, { NULL, NULL, NULL, 0 } }; diff --git a/modules/objfmts/bin/tests/Makefile.inc b/modules/objfmts/bin/tests/Makefile.inc index e1993ea4..92b85ff6 100644 --- a/modules/objfmts/bin/tests/Makefile.inc +++ b/modules/objfmts/bin/tests/Makefile.inc @@ -30,3 +30,7 @@ EXTRA_DIST += modules/objfmts/bin/tests/reserve.hex EXTRA_DIST += modules/objfmts/bin/tests/reserve.errwarn EXTRA_DIST += modules/objfmts/bin/tests/shr.asm EXTRA_DIST += modules/objfmts/bin/tests/shr.hex + +EXTRA_DIST += modules/objfmts/bin/tests/multisect/Makefile.inc + +include modules/objfmts/bin/tests/multisect/Makefile.inc diff --git a/modules/objfmts/bin/tests/multisect/Makefile.inc b/modules/objfmts/bin/tests/multisect/Makefile.inc new file mode 100644 index 00000000..93c1423b --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/Makefile.inc @@ -0,0 +1,53 @@ +# $Id$ + +TESTS += modules/objfmts/bin/tests/multisect/bin_multi_test.sh + +EXTRA_DIST += modules/objfmts/bin/tests/multisect/bin_multi_test.sh +EXTRA_DIST += modules/objfmts/bin/tests/multisect/bin-align.asm +EXTRA_DIST += modules/objfmts/bin/tests/multisect/bin-align.errwarn +EXTRA_DIST += modules/objfmts/bin/tests/multisect/bin-align.hex +EXTRA_DIST += modules/objfmts/bin/tests/multisect/bin-align.map +EXTRA_DIST += modules/objfmts/bin/tests/multisect/bin-ssym.asm +EXTRA_DIST += modules/objfmts/bin/tests/multisect/bin-ssym.hex +EXTRA_DIST += modules/objfmts/bin/tests/multisect/bin-ssym.map +EXTRA_DIST += modules/objfmts/bin/tests/multisect/follows-loop1-err.asm +EXTRA_DIST += modules/objfmts/bin/tests/multisect/follows-loop1-err.errwarn +EXTRA_DIST += modules/objfmts/bin/tests/multisect/follows-loop2-err.asm +EXTRA_DIST += modules/objfmts/bin/tests/multisect/follows-loop2-err.errwarn +EXTRA_DIST += modules/objfmts/bin/tests/multisect/follows-notfound-err.asm +EXTRA_DIST += modules/objfmts/bin/tests/multisect/follows-notfound-err.errwarn +EXTRA_DIST += modules/objfmts/bin/tests/multisect/initbss.asm +EXTRA_DIST += modules/objfmts/bin/tests/multisect/initbss.errwarn +EXTRA_DIST += modules/objfmts/bin/tests/multisect/initbss.hex +EXTRA_DIST += modules/objfmts/bin/tests/multisect/initbss.map +EXTRA_DIST += modules/objfmts/bin/tests/multisect/ldlinux-sects.asm +EXTRA_DIST += modules/objfmts/bin/tests/multisect/ldlinux-sects.hex +EXTRA_DIST += modules/objfmts/bin/tests/multisect/ldlinux-sects.map +EXTRA_DIST += modules/objfmts/bin/tests/multisect/multisect1.asm +EXTRA_DIST += modules/objfmts/bin/tests/multisect/multisect1.hex +EXTRA_DIST += modules/objfmts/bin/tests/multisect/multisect1.map +EXTRA_DIST += modules/objfmts/bin/tests/multisect/multisect2.asm +EXTRA_DIST += modules/objfmts/bin/tests/multisect/multisect2.hex +EXTRA_DIST += modules/objfmts/bin/tests/multisect/multisect2.map +EXTRA_DIST += modules/objfmts/bin/tests/multisect/multisect3.asm +EXTRA_DIST += modules/objfmts/bin/tests/multisect/multisect3.hex +EXTRA_DIST += modules/objfmts/bin/tests/multisect/multisect3.map +EXTRA_DIST += modules/objfmts/bin/tests/multisect/multisect4.asm +EXTRA_DIST += modules/objfmts/bin/tests/multisect/multisect4.hex +EXTRA_DIST += modules/objfmts/bin/tests/multisect/multisect4.map +EXTRA_DIST += modules/objfmts/bin/tests/multisect/multisect5.asm +EXTRA_DIST += modules/objfmts/bin/tests/multisect/multisect5.hex +EXTRA_DIST += modules/objfmts/bin/tests/multisect/multisect5.map +EXTRA_DIST += modules/objfmts/bin/tests/multisect/nomultisect1.asm +EXTRA_DIST += modules/objfmts/bin/tests/multisect/nomultisect1.hex +EXTRA_DIST += modules/objfmts/bin/tests/multisect/nomultisect1.map +EXTRA_DIST += modules/objfmts/bin/tests/multisect/nomultisect2.asm +EXTRA_DIST += modules/objfmts/bin/tests/multisect/nomultisect2.hex +EXTRA_DIST += modules/objfmts/bin/tests/multisect/nomultisect2.map +EXTRA_DIST += modules/objfmts/bin/tests/multisect/vfollows-loop1-err.asm +EXTRA_DIST += modules/objfmts/bin/tests/multisect/vfollows-loop1-err.errwarn +EXTRA_DIST += modules/objfmts/bin/tests/multisect/vfollows-loop2-err.asm +EXTRA_DIST += modules/objfmts/bin/tests/multisect/vfollows-loop2-err.errwarn +EXTRA_DIST += modules/objfmts/bin/tests/multisect/vfollows-notfound-err.asm +EXTRA_DIST += modules/objfmts/bin/tests/multisect/vfollows-notfound-err.errwarn + diff --git a/modules/objfmts/bin/tests/multisect/bin-align.asm b/modules/objfmts/bin/tests/multisect/bin-align.asm new file mode 100644 index 00000000..e355aac7 --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/bin-align.asm @@ -0,0 +1,12 @@ +[map all binalign.map] +section .text +db 1 +align 8 +db 0 +section .data +align 8 +db 0 +section .foo align=4 +align 8 +section .bar valign=4 +align 8 diff --git a/modules/objfmts/bin/tests/multisect/bin-align.errwarn b/modules/objfmts/bin/tests/multisect/bin-align.errwarn new file mode 100644 index 00000000..e13f89df --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/bin-align.errwarn @@ -0,0 +1,3 @@ +-: warning: section `.foo' internal align of 8 is greater than `align' of 4; using `align' +-: warning: section `.bar' internal align of 8 is greater than `valign' of 4; using `valign' +-:1: warning: map file already specified diff --git a/modules/objfmts/bin/tests/multisect/bin-align.hex b/modules/objfmts/bin/tests/multisect/bin-align.hex new file mode 100644 index 00000000..dd133f77 --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/bin-align.hex @@ -0,0 +1,17 @@ +01 +8d +74 +00 +8d +bd +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 diff --git a/modules/objfmts/bin/tests/multisect/bin-align.map b/modules/objfmts/bin/tests/multisect/bin-align.map new file mode 100644 index 00000000..3031bd15 --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/bin-align.map @@ -0,0 +1,66 @@ + +- YASM Map file --------------------------------------------------------------- + +Source file: - +Output file: results/bin-align + +-- Program origin ------------------------------------------------------------- + +00000000 + +-- Sections (summary) --------------------------------------------------------- + +Vstart Vstop Start Stop Length Class Name +00000000 00000009 00000000 00000009 00000009 progbits .text +00000010 00000011 00000010 00000011 00000001 progbits .data +00000014 00000014 00000014 00000014 00000000 progbits .foo +00000018 00000018 00000018 00000018 00000000 progbits .bar + +-- Sections (detailed) -------------------------------------------------------- + +---- Section .text ------------------------------------------------------------ + +class: progbits +length: 00000009 +start: 00000000 +align: 00000008 +follows: not defined +vstart: 00000000 +valign: 00000008 +vfollows: not defined + +---- Section .data ------------------------------------------------------------ + +class: progbits +length: 00000001 +start: 00000010 +align: 00000008 +follows: not defined +vstart: 00000010 +valign: 00000008 +vfollows: not defined + +---- Section .foo ------------------------------------------------------------- + +class: progbits +length: 00000000 +start: 00000014 +align: 00000004 +follows: not defined +vstart: 00000014 +valign: 00000004 +vfollows: not defined + +---- Section .bar ------------------------------------------------------------- + +class: progbits +length: 00000000 +start: 00000018 +align: 00000008 +follows: not defined +vstart: 00000018 +valign: 00000004 +vfollows: not defined + +-- Symbols -------------------------------------------------------------------- + diff --git a/modules/objfmts/bin/tests/multisect/bin-ssym.asm b/modules/objfmts/bin/tests/multisect/bin-ssym.asm new file mode 100644 index 00000000..8c5608cf --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/bin-ssym.asm @@ -0,0 +1,5 @@ +section foo start=0x10 vstart=0x6000 +mov si, section.foo.start +mov di, section.foo.vstart +mov cx, section.foo.length +;mov dx, section.foo.vstart-section.foo.start diff --git a/modules/objfmts/bin/tests/multisect/bin-ssym.hex b/modules/objfmts/bin/tests/multisect/bin-ssym.hex new file mode 100644 index 00000000..e89a7e22 --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/bin-ssym.hex @@ -0,0 +1,25 @@ +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +be +10 +00 +bf +00 +60 +b9 +09 +00 diff --git a/modules/objfmts/bin/tests/multisect/bin-ssym.map b/modules/objfmts/bin/tests/multisect/bin-ssym.map new file mode 100644 index 00000000..9ddfe168 --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/bin-ssym.map @@ -0,0 +1,16 @@ + +- YASM Map file --------------------------------------------------------------- + +Source file: - +Output file: results/bin-ssym + +-- Program origin ------------------------------------------------------------- + +00000000 + +-- Sections (summary) --------------------------------------------------------- + +Vstart Vstop Start Stop Length Class Name +00000000 00000000 00000000 00000000 00000000 progbits .text +00006000 00006009 00000010 00000019 00000009 progbits foo + diff --git a/modules/objfmts/bin/tests/multisect/bin_multi_test.sh b/modules/objfmts/bin/tests/multisect/bin_multi_test.sh new file mode 100755 index 00000000..1c0f7628 --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/bin_multi_test.sh @@ -0,0 +1,114 @@ +#! /bin/sh +# $Id$ + +YASM_TEST_SUITE=1 +export YASM_TEST_SUITE + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +mkdir results >/dev/null 2>&1 + +# +# Verify that all test cases match +# + +passedct=0 +failedct=0 + +echo $ECHO_N "Test bin_multi_test: $ECHO_C" +for asm in ${srcdir}/modules/objfmts/bin/tests/multisect/*.asm +do + a=`echo ${asm} | sed 's,^.*/,,;s,.asm$,,'` + o=${a} + oh=${a}.hx + og=`echo ${asm} | sed 's,.asm$,.hex,'` + e=${a}.ew + eg=`echo ${asm} | sed 's,.asm$,.errwarn,'` + m=${a}.map + mg=`echo ${asm} | sed 's,.asm$,.map,'` + if test \! -e ${eg}; then + eg=/dev/null + fi + + # Run within a subshell to prevent signal messages from displaying. + sh -c "cat ${asm} | ./yasm -f bin --mapfile=results/${m} -o results/${o} - 2>results/${e}" >/dev/null 2>/dev/null + status=$? + if test $status -gt 128; then + # We should never get a coredump! + echo $ECHO_N "C$ECHO_C" + eval "failed$failedct='C: ${a} crashed!'" + failedct=`expr $failedct + 1` + elif test $status -gt 0; then + echo ${asm} | grep err >/dev/null + if test $? -gt 0; then + # YASM detected errors but shouldn't have! + echo $ECHO_N "E$ECHO_C" + eval "failed$failedct='E: ${a} returned an error code!'" + failedct=`expr $failedct + 1` + else + # We got errors, check to see if they match: + if diff -w ${eg} results/${e} >/dev/null; then + # Error/warnings match, it passes! + echo $ECHO_N ".$ECHO_C" + passedct=`expr $passedct + 1` + else + # Error/warnings don't match. + echo $ECHO_N "W$ECHO_C" + eval "failed$failedct='W: ${a} did not match errors and warnings!'" + failedct=`expr $failedct + 1` + fi + fi + else + echo ${asm} | grep -v err >/dev/null + if test $? -gt 0; then + # YASM didn't detect errors but should have! + echo $ECHO_N "E$ECHO_C" + eval "failed$failedct='E: ${a} did not return an error code!'" + failedct=`expr $failedct + 1` + else + ./test_hd results/${o} > results/${oh} + if diff ${og} results/${oh} >/dev/null; then + if diff -w ${eg} results/${e} >/dev/null; then + if diff -w ${mg} results/${m} >/dev/null; then + # All match, it passes! + echo $ECHO_N ".$ECHO_C" + passedct=`expr $passedct + 1` + else + # Map file doesn't match. + echo $ECHO_N "M$ECHO_C" + eval "failed$failedct='M: ${a} did not match map file!'" + failedct=`expr $failedct + 1` + fi + else + # Error/warnings don't match. + echo $ECHO_N "W$ECHO_C" + eval "failed$failedct='W: ${a} did not match errors and warnings!'" + failedct=`expr $failedct + 1` + fi + else + # Object file doesn't match. + echo $ECHO_N "O$ECHO_C" + eval "failed$failedct='O: ${a} did not match object file!'" + failedct=`expr $failedct + 1` + fi + fi + fi +done + +ct=`expr $failedct + $passedct` +per=`expr 100 \* $passedct / $ct` + +echo " +$passedct-$failedct/$ct $per%" +i=0 +while test $i -lt $failedct; do + eval "failure=\$failed$i" + echo " ** $failure" + i=`expr $i + 1` +done + +exit $failedct diff --git a/modules/objfmts/bin/tests/multisect/follows-loop1-err.asm b/modules/objfmts/bin/tests/multisect/follows-loop1-err.asm new file mode 100644 index 00000000..ad7fef16 --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/follows-loop1-err.asm @@ -0,0 +1,2 @@ +section sect1 follows=sect2 +section sect2 follows=sect1 diff --git a/modules/objfmts/bin/tests/multisect/follows-loop1-err.errwarn b/modules/objfmts/bin/tests/multisect/follows-loop1-err.errwarn new file mode 100644 index 00000000..c7ba6a5a --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/follows-loop1-err.errwarn @@ -0,0 +1 @@ +-: follows loop between section `sect2' and section `sect1' diff --git a/modules/objfmts/bin/tests/multisect/follows-loop2-err.asm b/modules/objfmts/bin/tests/multisect/follows-loop2-err.asm new file mode 100644 index 00000000..9b15f465 --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/follows-loop2-err.asm @@ -0,0 +1 @@ +section sect follows=sect diff --git a/modules/objfmts/bin/tests/multisect/follows-loop2-err.errwarn b/modules/objfmts/bin/tests/multisect/follows-loop2-err.errwarn new file mode 100644 index 00000000..f4f46dd9 --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/follows-loop2-err.errwarn @@ -0,0 +1 @@ +-: follows loop between section `sect' and section `sect' diff --git a/modules/objfmts/bin/tests/multisect/follows-notfound-err.asm b/modules/objfmts/bin/tests/multisect/follows-notfound-err.asm new file mode 100644 index 00000000..36361d52 --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/follows-notfound-err.asm @@ -0,0 +1,2 @@ +section foo follows=bar + diff --git a/modules/objfmts/bin/tests/multisect/follows-notfound-err.errwarn b/modules/objfmts/bin/tests/multisect/follows-notfound-err.errwarn new file mode 100644 index 00000000..85234767 --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/follows-notfound-err.errwarn @@ -0,0 +1 @@ +-: section `foo' follows an invalid or unknown section `bar' diff --git a/modules/objfmts/bin/tests/multisect/initbss.asm b/modules/objfmts/bin/tests/multisect/initbss.asm new file mode 100644 index 00000000..8fe39bcc --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/initbss.asm @@ -0,0 +1,5 @@ +section .bss +mov ax, 5 + +section foo nobits +db 5 diff --git a/modules/objfmts/bin/tests/multisect/initbss.errwarn b/modules/objfmts/bin/tests/multisect/initbss.errwarn new file mode 100644 index 00000000..e92a68e4 --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/initbss.errwarn @@ -0,0 +1,2 @@ +-:2: warning: initialized space declared in nobits section: ignoring +-:5: warning: initialized space declared in nobits section: ignoring diff --git a/modules/objfmts/bin/tests/multisect/initbss.hex b/modules/objfmts/bin/tests/multisect/initbss.hex new file mode 100644 index 00000000..e69de29b diff --git a/modules/objfmts/bin/tests/multisect/initbss.map b/modules/objfmts/bin/tests/multisect/initbss.map new file mode 100644 index 00000000..d26734de --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/initbss.map @@ -0,0 +1,17 @@ + +- YASM Map file --------------------------------------------------------------- + +Source file: - +Output file: results/initbss + +-- Program origin ------------------------------------------------------------- + +00000000 + +-- Sections (summary) --------------------------------------------------------- + +Vstart Vstop Start Stop Length Class Name +00000000 00000000 00000000 00000000 00000000 progbits .text +00000000 00000003 00000000 00000003 00000003 nobits .bss +00000004 00000005 00000004 00000005 00000001 nobits foo + diff --git a/modules/objfmts/bin/tests/multisect/ldlinux-sects.asm b/modules/objfmts/bin/tests/multisect/ldlinux-sects.asm new file mode 100644 index 00000000..2beae7c7 --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/ldlinux-sects.asm @@ -0,0 +1,102 @@ +[map all] +BSS_START equ 0800h +LATEBSS_START equ 0B800h +TEXT_START equ 7C00h +STACK_SIZE equ 4096 +STACK_START equ TEXT_START-STACK_SIZE +org TEXT_START +[section .text] +times 0x2410 db 0x1 +[section .earlybss nobits start=BSS_START] +resb 0x40C4 +[section .bcopy32 align=4 valign=16 follows=.data vfollows=.earlybss] +times 0x2A0 db 0x3 +[section .config align=4 valign=16 follows=.bcopy32 vfollows=.bcopy32] +times 0x23 db 0x4 +[section .config.end nobits valign=4 vfollows=.config] +[section .bss1 nobits valign=16 vfollows=.config.end] +resb 0x1FB +[section .text start=TEXT_START] +[section .data align=16] +times 0x590 db 0x2 +[section .adv progbits align=1 follows=.config] +[section .bss nobits align=16 follows=.adv] +resb 0x3900 +[section .stack nobits align=16 start=STACK_START] +resb STACK_SIZE +[section .stack nobits align=16 start=STACK_START] +[section .stack nobits align=16 start=STACK_START] +[section .earlybss] +[section .bss] +[section .text] +[section .bss] +[section .text] +[section .data] +[section .text] +[section .text] +[section .text] +[section .bss] +[section .text] +[section .data] +[section .bss] +[section .text] +[section .data] +[section .bss] +[section .text] +[section .text] +[section .text] +[section .data] +[section .bss1] +[section .data] +[section .text] +[section .bss1] +[section .text] +[section .text] +[section .data] +[section .text] +[section .text] +[section .bss] +[section .text] +[section .bss] +[section .text] +[section .data] +[section .text] +[section .text] +[section .bss1] +[section .data] +[section .text] +[section .text] +[section .data] +[section .config] +[section .bss] +[section .text] +[section .text] +[section .text] +[section .data] +[section .text] +[section .data] +[section .config] +[section .bss] +[section .text] +[section .text] +[section .data] +[section .bss] +[section .bcopy32] +[section .data] +[section .bcopy32] +[section .earlybss] +[section .text] +[section .text] +[section .bss] +[section .data] +[section .bss1] +[section .text] +[section .data] +[section .bss1] +[section .text] +[section .bss] +[section .text] +[section .text] +[section .text] +[section .bss] +[section .data] diff --git a/modules/objfmts/bin/tests/multisect/ldlinux-sects.hex b/modules/objfmts/bin/tests/multisect/ldlinux-sects.hex new file mode 100644 index 00000000..bb591fc0 --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/ldlinux-sects.hex @@ -0,0 +1,11363 @@ +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +04 +04 +04 +04 +04 +04 +04 +04 +04 +04 +04 +04 +04 +04 +04 +04 +04 +04 +04 +04 +04 +04 +04 +04 +04 +04 +04 +04 +04 +04 +04 +04 +04 +04 +04 diff --git a/modules/objfmts/bin/tests/multisect/ldlinux-sects.map b/modules/objfmts/bin/tests/multisect/ldlinux-sects.map new file mode 100644 index 00000000..03fde845 --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/ldlinux-sects.map @@ -0,0 +1,148 @@ + +- YASM Map file --------------------------------------------------------------- + +Source file: - +Output file: results/ldlinux-sects + +-- Program origin ------------------------------------------------------------- + +00007C00 + +-- Sections (summary) --------------------------------------------------------- + +Vstart Vstop Start Stop Length Class Name +00000800 000048C4 00000800 000048C4 000040C4 nobits .earlybss +00006C00 00007C00 00006C00 00007C00 00001000 nobits .stack +00007C00 0000A010 00007C00 0000A010 00002410 progbits .text +0000A010 0000A5A0 0000A010 0000A5A0 00000590 progbits .data +000048D0 00004B70 0000A5A0 0000A840 000002A0 progbits .bcopy32 +00004B70 00004B93 0000A840 0000A863 00000023 progbits .config +0000A863 0000A863 0000A863 0000A863 00000000 progbits .adv +0000A870 0000E170 0000A870 0000E170 00003900 nobits .bss +00004B94 00004B94 0000E170 0000E170 00000000 nobits .config.end +00004BA0 00004D9B 0000E170 0000E36B 000001FB nobits .bss1 + +-- Sections (detailed) -------------------------------------------------------- + +---- Section .earlybss -------------------------------------------------------- + +class: nobits +length: 000040C4 +start: 00000800 +align: 00000004 +follows: not defined +vstart: 00000800 +valign: 00000004 +vfollows: not defined + +---- Section .stack ----------------------------------------------------------- + +class: nobits +length: 00001000 +start: 00006C00 +align: 00000010 +follows: not defined +vstart: 00006C00 +valign: 00000010 +vfollows: not defined + +---- Section .text ------------------------------------------------------------ + +class: progbits +length: 00002410 +start: 00007C00 +align: 00000004 +follows: not defined +vstart: 00007C00 +valign: 00000004 +vfollows: not defined + +---- Section .data ------------------------------------------------------------ + +class: progbits +length: 00000590 +start: 0000A010 +align: 00000010 +follows: not defined +vstart: 0000A010 +valign: 00000010 +vfollows: not defined + +---- Section .bcopy32 --------------------------------------------------------- + +class: progbits +length: 000002A0 +start: 0000A5A0 +align: 00000004 +follows: .data +vstart: 000048D0 +valign: 00000010 +vfollows: .earlybss + +---- Section .config ---------------------------------------------------------- + +class: progbits +length: 00000023 +start: 0000A840 +align: 00000004 +follows: .bcopy32 +vstart: 00004B70 +valign: 00000010 +vfollows: .bcopy32 + +---- Section .adv ------------------------------------------------------------- + +class: progbits +length: 00000000 +start: 0000A863 +align: 00000001 +follows: .config +vstart: 0000A863 +valign: 00000001 +vfollows: not defined + +---- Section .bss ------------------------------------------------------------- + +class: nobits +length: 00003900 +start: 0000A870 +align: 00000010 +follows: .adv +vstart: 0000A870 +valign: 00000010 +vfollows: not defined + +---- Section .config.end ------------------------------------------------------ + +class: nobits +length: 00000000 +start: 0000E170 +align: 00000004 +follows: not defined +vstart: 00004B94 +valign: 00000004 +vfollows: .config + +---- Section .bss1 ------------------------------------------------------------ + +class: nobits +length: 000001FB +start: 0000E170 +align: 00000004 +follows: not defined +vstart: 00004BA0 +valign: 00000010 +vfollows: .config.end + +-- Symbols -------------------------------------------------------------------- + +---- No Section --------------------------------------------------------------- + +Value Name +00000800 BSS_START +0000B800 LATEBSS_START +00007C00 TEXT_START +00001000 STACK_SIZE +00006C00 STACK_START + + diff --git a/modules/objfmts/bin/tests/multisect/multisect1.asm b/modules/objfmts/bin/tests/multisect/multisect1.asm new file mode 100644 index 00000000..2989b15b --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/multisect1.asm @@ -0,0 +1,31 @@ +BITS 32 + +[MAP all] +; This file is loaded as a DOS .COM file. +SEGMENT _TEXT start=0 vstart=100h + +; shrink & relocate stack: + mov sp, stack_ends ; NASM puts 460h here - + ; 9B0h is desired. + mov bx, sp + mov cl, 4 + shr bx, cl + mov ah, 4Ah ; DOS resize mem.block + int 21h + +SEGMENT GATESEG align=1 follows=_TEXT vstart=0 +; label to use for copying this segment at run-time. +gate0cpy: +dd 0 + +; 32-bit ring-0 protected mode code that interacts +; with the VMM (Win3.x/9x kernel). To be relocated +; at run-time to memory dynamically allocated with +; DPMI, and called through a call-gate from ring-3. +; vstart=0 makes some calculations easier. + +; Reserve space for stack: +SEGMENT .bss follows=GATESEG align=16 + resb 400h +stack_ends: + diff --git a/modules/objfmts/bin/tests/multisect/multisect1.hex b/modules/objfmts/bin/tests/multisect/multisect1.hex new file mode 100644 index 00000000..32695b89 --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/multisect1.hex @@ -0,0 +1,20 @@ +66 +bc +20 +04 +66 +89 +e3 +b1 +04 +66 +d3 +eb +b4 +4a +cd +21 +00 +00 +00 +00 diff --git a/modules/objfmts/bin/tests/multisect/multisect1.map b/modules/objfmts/bin/tests/multisect/multisect1.map new file mode 100644 index 00000000..68cb155e --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/multisect1.map @@ -0,0 +1,78 @@ + +- YASM Map file --------------------------------------------------------------- + +Source file: - +Output file: results/multisect1 + +-- Program origin ------------------------------------------------------------- + +00000000 + +-- Sections (summary) --------------------------------------------------------- + +Vstart Vstop Start Stop Length Class Name +00000000 00000000 00000000 00000000 00000000 progbits .text +00000100 00000110 00000000 00000010 00000010 progbits _TEXT +00000000 00000004 00000010 00000014 00000004 progbits GATESEG +00000020 00000420 00000020 00000420 00000400 nobits .bss + +-- Sections (detailed) -------------------------------------------------------- + +---- Section .text ------------------------------------------------------------ + +class: progbits +length: 00000000 +start: 00000000 +align: 00000004 +follows: not defined +vstart: 00000000 +valign: 00000004 +vfollows: not defined + +---- Section _TEXT ------------------------------------------------------------ + +class: progbits +length: 00000010 +start: 00000000 +align: 00000004 +follows: not defined +vstart: 00000100 +valign: 00000004 +vfollows: not defined + +---- Section GATESEG ---------------------------------------------------------- + +class: progbits +length: 00000004 +start: 00000010 +align: 00000001 +follows: _TEXT +vstart: 00000000 +valign: 00000001 +vfollows: not defined + +---- Section .bss ------------------------------------------------------------- + +class: nobits +length: 00000400 +start: 00000020 +align: 00000010 +follows: GATESEG +vstart: 00000020 +valign: 00000010 +vfollows: not defined + +-- Symbols -------------------------------------------------------------------- + +---- Section GATESEG ---------------------------------------------------------- + +Real Virtual Name +00000010 00000000 gate0cpy + + +---- Section .bss ------------------------------------------------------------- + +Real Virtual Name +00000020 00000020 stack_ends + + diff --git a/modules/objfmts/bin/tests/multisect/multisect2.asm b/modules/objfmts/bin/tests/multisect/multisect2.asm new file mode 100644 index 00000000..cfbf58c6 --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/multisect2.asm @@ -0,0 +1,42 @@ +org 100h +[map all] + +section .bss ; follows=.data + buffer resb 123h +section .data + msg db "this is a message", 0 +section .text + mov ax, msg + call showax + mov ax, buffer + call showax + ret + +;----------------- +showax: + push cx + push dx + + mov cx, 4 ; four digits to show + +.top + rol ax, 4 ; rotate one digit into position + mov dl, al ; make a copy to process + and dl, 0Fh ; mask off a single (hex) digit + cmp dl, 9 ; is it in the "A" to "F" range? + jbe .dec_dig ; no, skip it + add dl, 7 ; adjust +.dec_dig: + add dl, 30h ; convert to character + + push ax + mov ah, 2 + int 21h + pop ax + + loop .top + + pop dx + pop cx + ret +;-------------------------- diff --git a/modules/objfmts/bin/tests/multisect/multisect2.hex b/modules/objfmts/bin/tests/multisect/multisect2.hex new file mode 100644 index 00000000..f043f372 --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/multisect2.hex @@ -0,0 +1,66 @@ +b8 +30 +01 +e8 +07 +00 +b8 +44 +01 +e8 +01 +00 +c3 +51 +52 +b9 +04 +00 +c1 +c0 +04 +88 +c2 +80 +e2 +0f +80 +fa +09 +76 +03 +80 +c2 +07 +80 +c2 +30 +50 +b4 +02 +cd +21 +58 +e2 +e5 +5a +59 +c3 +74 +68 +69 +73 +20 +69 +73 +20 +61 +20 +6d +65 +73 +73 +61 +67 +65 +00 diff --git a/modules/objfmts/bin/tests/multisect/multisect2.map b/modules/objfmts/bin/tests/multisect/multisect2.map new file mode 100644 index 00000000..b3cb273e --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/multisect2.map @@ -0,0 +1,74 @@ + +- YASM Map file --------------------------------------------------------------- + +Source file: - +Output file: results/multisect2 + +-- Program origin ------------------------------------------------------------- + +00000100 + +-- Sections (summary) --------------------------------------------------------- + +Vstart Vstop Start Stop Length Class Name +00000100 00000130 00000100 00000130 00000030 progbits .text +00000130 00000142 00000130 00000142 00000012 progbits .data +00000144 00000267 00000144 00000267 00000123 nobits .bss + +-- Sections (detailed) -------------------------------------------------------- + +---- Section .text ------------------------------------------------------------ + +class: progbits +length: 00000030 +start: 00000100 +align: 00000004 +follows: not defined +vstart: 00000100 +valign: 00000004 +vfollows: not defined + +---- Section .data ------------------------------------------------------------ + +class: progbits +length: 00000012 +start: 00000130 +align: 00000004 +follows: not defined +vstart: 00000130 +valign: 00000004 +vfollows: not defined + +---- Section .bss ------------------------------------------------------------- + +class: nobits +length: 00000123 +start: 00000144 +align: 00000004 +follows: not defined +vstart: 00000144 +valign: 00000004 +vfollows: not defined + +-- Symbols -------------------------------------------------------------------- + +---- Section .text ------------------------------------------------------------ + +Real Virtual Name +0000010C 0000010C showax +0000010F 0000010F showax.top +0000011F 0000011F showax.dec_dig + + +---- Section .data ------------------------------------------------------------ + +Real Virtual Name +00000130 00000130 msg + + +---- Section .bss ------------------------------------------------------------- + +Real Virtual Name +00000144 00000144 buffer + + diff --git a/modules/objfmts/bin/tests/multisect/multisect3.asm b/modules/objfmts/bin/tests/multisect/multisect3.asm new file mode 100644 index 00000000..d6499f96 --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/multisect3.asm @@ -0,0 +1,9 @@ +[map all] +section .text + mov ax, bx + +section .foo nobits follows=.text + resb 4 + +section .bss + resb 4 diff --git a/modules/objfmts/bin/tests/multisect/multisect3.hex b/modules/objfmts/bin/tests/multisect/multisect3.hex new file mode 100644 index 00000000..a9949757 --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/multisect3.hex @@ -0,0 +1,2 @@ +89 +d8 diff --git a/modules/objfmts/bin/tests/multisect/multisect3.map b/modules/objfmts/bin/tests/multisect/multisect3.map new file mode 100644 index 00000000..1c67c227 --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/multisect3.map @@ -0,0 +1,54 @@ + +- YASM Map file --------------------------------------------------------------- + +Source file: - +Output file: results/multisect3 + +-- Program origin ------------------------------------------------------------- + +00000000 + +-- Sections (summary) --------------------------------------------------------- + +Vstart Vstop Start Stop Length Class Name +00000000 00000002 00000000 00000002 00000002 progbits .text +00000004 00000008 00000004 00000008 00000004 nobits .foo +00000008 0000000C 00000008 0000000C 00000004 nobits .bss + +-- Sections (detailed) -------------------------------------------------------- + +---- Section .text ------------------------------------------------------------ + +class: progbits +length: 00000002 +start: 00000000 +align: 00000004 +follows: not defined +vstart: 00000000 +valign: 00000004 +vfollows: not defined + +---- Section .foo ------------------------------------------------------------- + +class: nobits +length: 00000004 +start: 00000004 +align: 00000004 +follows: .text +vstart: 00000004 +valign: 00000004 +vfollows: not defined + +---- Section .bss ------------------------------------------------------------- + +class: nobits +length: 00000004 +start: 00000008 +align: 00000004 +follows: not defined +vstart: 00000008 +valign: 00000004 +vfollows: not defined + +-- Symbols -------------------------------------------------------------------- + diff --git a/modules/objfmts/bin/tests/multisect/multisect4.asm b/modules/objfmts/bin/tests/multisect/multisect4.asm new file mode 100644 index 00000000..94d2415f --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/multisect4.asm @@ -0,0 +1,31 @@ +[map all] +; Memory below 0800h is reserved for the BIOS and the MBR +BSS_START equ 0800h + +; PXELINUX needs lots of BSS, so it relocates itself on startup +;%if IS_PXELINUX +TEXT_START equ 9000h +;%else +;TEXT_START equ 7C00h +;%endif + +; +; The various sections and their relationship +; +org TEXT_START + +times 0x100 db 0x3 + +section .earlybss nobits start=BSS_START +resb 0x100 +section .bcopy32 align=16 follows=.data vfollows=.earlybss +times 0x100 db 0x1 +section .bss nobits align=256 vfollows=.bcopy32 +resb 0x100 + +section .text start=TEXT_START +section .data align=16 follows=.text +times 0x100 db 0x2 + +section .latebss nobits align=16 follows=.bcopy32 +resb 0x100 diff --git a/modules/objfmts/bin/tests/multisect/multisect4.hex b/modules/objfmts/bin/tests/multisect/multisect4.hex new file mode 100644 index 00000000..d40d7a19 --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/multisect4.hex @@ -0,0 +1,768 @@ +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +03 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +02 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 diff --git a/modules/objfmts/bin/tests/multisect/multisect4.map b/modules/objfmts/bin/tests/multisect/multisect4.map new file mode 100644 index 00000000..e1940dc6 --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/multisect4.map @@ -0,0 +1,97 @@ + +- YASM Map file --------------------------------------------------------------- + +Source file: - +Output file: results/multisect4 + +-- Program origin ------------------------------------------------------------- + +00009000 + +-- Sections (summary) --------------------------------------------------------- + +Vstart Vstop Start Stop Length Class Name +00000800 00000900 00000800 00000900 00000100 nobits .earlybss +00009000 00009100 00009000 00009100 00000100 progbits .text +00009100 00009200 00009100 00009200 00000100 progbits .data +00000900 00000A00 00009200 00009300 00000100 progbits .bcopy32 +00009300 00009400 00009300 00009400 00000100 nobits .latebss +00000A00 00000B00 00009400 00009500 00000100 nobits .bss + +-- Sections (detailed) -------------------------------------------------------- + +---- Section .earlybss -------------------------------------------------------- + +class: nobits +length: 00000100 +start: 00000800 +align: 00000004 +follows: not defined +vstart: 00000800 +valign: 00000004 +vfollows: not defined + +---- Section .text ------------------------------------------------------------ + +class: progbits +length: 00000100 +start: 00009000 +align: 00000004 +follows: not defined +vstart: 00009000 +valign: 00000004 +vfollows: not defined + +---- Section .data ------------------------------------------------------------ + +class: progbits +length: 00000100 +start: 00009100 +align: 00000010 +follows: .text +vstart: 00009100 +valign: 00000010 +vfollows: not defined + +---- Section .bcopy32 --------------------------------------------------------- + +class: progbits +length: 00000100 +start: 00009200 +align: 00000010 +follows: .data +vstart: 00000900 +valign: 00000010 +vfollows: .earlybss + +---- Section .latebss --------------------------------------------------------- + +class: nobits +length: 00000100 +start: 00009300 +align: 00000010 +follows: .bcopy32 +vstart: 00009300 +valign: 00000010 +vfollows: not defined + +---- Section .bss ------------------------------------------------------------- + +class: nobits +length: 00000100 +start: 00009400 +align: 00000100 +follows: not defined +vstart: 00000A00 +valign: 00000100 +vfollows: .bcopy32 + +-- Symbols -------------------------------------------------------------------- + +---- No Section --------------------------------------------------------------- + +Value Name +00000800 BSS_START +00009000 TEXT_START + + diff --git a/modules/objfmts/bin/tests/multisect/multisect5.asm b/modules/objfmts/bin/tests/multisect/multisect5.asm new file mode 100644 index 00000000..2b761172 --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/multisect5.asm @@ -0,0 +1,22 @@ +org 0x100 +[map all] +section sect1 start=0x100 vstart=0x2000 +times 0x100 db 0 +section sect2 follows=sect1 +times 0x100 db 0 + +section sect3 start=0x300 vstart=0x4000 +times 0x100 db 0 +section sect4 follows=sect3 +times 0x100 db 0 +section sect5 vfollows=sect3 +times 0x100 db 0 + +section sect6 start=0x600 vstart=0x6000 +times 0x11 db 0 +section sect7 follows=sect6 valign=16 +times 0x104 db 0 +section sect8 follows=sect7 valign=16 ; NASM bug - sect7 and sect8 overlap +times 0x100 db 0 + +section sect9 vfollows=sect8 diff --git a/modules/objfmts/bin/tests/multisect/multisect5.hex b/modules/objfmts/bin/tests/multisect/multisect5.hex new file mode 100644 index 00000000..a2776bc8 --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/multisect5.hex @@ -0,0 +1,1816 @@ +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 diff --git a/modules/objfmts/bin/tests/multisect/multisect5.map b/modules/objfmts/bin/tests/multisect/multisect5.map new file mode 100644 index 00000000..4c052be6 --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/multisect5.map @@ -0,0 +1,138 @@ + +- YASM Map file --------------------------------------------------------------- + +Source file: - +Output file: results/multisect5 + +-- Program origin ------------------------------------------------------------- + +00000100 + +-- Sections (summary) --------------------------------------------------------- + +Vstart Vstop Start Stop Length Class Name +00000100 00000100 00000100 00000100 00000000 progbits .text +00002000 00002100 00000100 00000200 00000100 progbits sect1 +00000200 00000300 00000200 00000300 00000100 progbits sect2 +00004000 00004100 00000300 00000400 00000100 progbits sect3 +00000400 00000500 00000400 00000500 00000100 progbits sect4 +00004100 00004200 00000500 00000600 00000100 progbits sect5 +00006000 00006011 00000600 00000611 00000011 progbits sect6 +00000620 00000724 00000614 00000718 00000104 progbits sect7 +00000730 00000830 00000718 00000818 00000100 progbits sect8 +00000830 00000830 00000818 00000818 00000000 progbits sect9 + +-- Sections (detailed) -------------------------------------------------------- + +---- Section .text ------------------------------------------------------------ + +class: progbits +length: 00000000 +start: 00000100 +align: 00000004 +follows: not defined +vstart: 00000100 +valign: 00000004 +vfollows: not defined + +---- Section sect1 ------------------------------------------------------------ + +class: progbits +length: 00000100 +start: 00000100 +align: 00000004 +follows: not defined +vstart: 00002000 +valign: 00000004 +vfollows: not defined + +---- Section sect2 ------------------------------------------------------------ + +class: progbits +length: 00000100 +start: 00000200 +align: 00000004 +follows: sect1 +vstart: 00000200 +valign: 00000004 +vfollows: not defined + +---- Section sect3 ------------------------------------------------------------ + +class: progbits +length: 00000100 +start: 00000300 +align: 00000004 +follows: not defined +vstart: 00004000 +valign: 00000004 +vfollows: not defined + +---- Section sect4 ------------------------------------------------------------ + +class: progbits +length: 00000100 +start: 00000400 +align: 00000004 +follows: sect3 +vstart: 00000400 +valign: 00000004 +vfollows: not defined + +---- Section sect5 ------------------------------------------------------------ + +class: progbits +length: 00000100 +start: 00000500 +align: 00000004 +follows: not defined +vstart: 00004100 +valign: 00000004 +vfollows: sect3 + +---- Section sect6 ------------------------------------------------------------ + +class: progbits +length: 00000011 +start: 00000600 +align: 00000004 +follows: not defined +vstart: 00006000 +valign: 00000004 +vfollows: not defined + +---- Section sect7 ------------------------------------------------------------ + +class: progbits +length: 00000104 +start: 00000614 +align: 00000004 +follows: sect6 +vstart: 00000620 +valign: 00000010 +vfollows: not defined + +---- Section sect8 ------------------------------------------------------------ + +class: progbits +length: 00000100 +start: 00000718 +align: 00000004 +follows: sect7 +vstart: 00000730 +valign: 00000010 +vfollows: not defined + +---- Section sect9 ------------------------------------------------------------ + +class: progbits +length: 00000000 +start: 00000818 +align: 00000004 +follows: not defined +vstart: 00000830 +valign: 00000004 +vfollows: sect8 + +-- Symbols -------------------------------------------------------------------- + diff --git a/modules/objfmts/bin/tests/multisect/nomultisect1.asm b/modules/objfmts/bin/tests/multisect/nomultisect1.asm new file mode 100644 index 00000000..5f720d84 --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/nomultisect1.asm @@ -0,0 +1,10 @@ +[map all] + +[section .bss] +resb 0x100 + +[section .data] +times 0x100 db 1 + +[section .text] +times 0x100 db 1 diff --git a/modules/objfmts/bin/tests/multisect/nomultisect1.hex b/modules/objfmts/bin/tests/multisect/nomultisect1.hex new file mode 100644 index 00000000..59c9350b --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/nomultisect1.hex @@ -0,0 +1,512 @@ +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 diff --git a/modules/objfmts/bin/tests/multisect/nomultisect1.map b/modules/objfmts/bin/tests/multisect/nomultisect1.map new file mode 100644 index 00000000..89974207 --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/nomultisect1.map @@ -0,0 +1,54 @@ + +- YASM Map file --------------------------------------------------------------- + +Source file: - +Output file: results/nomultisect1 + +-- Program origin ------------------------------------------------------------- + +00000000 + +-- Sections (summary) --------------------------------------------------------- + +Vstart Vstop Start Stop Length Class Name +00000000 00000100 00000000 00000100 00000100 progbits .text +00000100 00000200 00000100 00000200 00000100 progbits .data +00000200 00000300 00000200 00000300 00000100 nobits .bss + +-- Sections (detailed) -------------------------------------------------------- + +---- Section .text ------------------------------------------------------------ + +class: progbits +length: 00000100 +start: 00000000 +align: 00000004 +follows: not defined +vstart: 00000000 +valign: 00000004 +vfollows: not defined + +---- Section .data ------------------------------------------------------------ + +class: progbits +length: 00000100 +start: 00000100 +align: 00000004 +follows: not defined +vstart: 00000100 +valign: 00000004 +vfollows: not defined + +---- Section .bss ------------------------------------------------------------- + +class: nobits +length: 00000100 +start: 00000200 +align: 00000004 +follows: not defined +vstart: 00000200 +valign: 00000004 +vfollows: not defined + +-- Symbols -------------------------------------------------------------------- + diff --git a/modules/objfmts/bin/tests/multisect/nomultisect2.asm b/modules/objfmts/bin/tests/multisect/nomultisect2.asm new file mode 100644 index 00000000..b97e40a7 --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/nomultisect2.asm @@ -0,0 +1,12 @@ +org 0x100 + +[map all] + +[section .bss] +resb 0x100 + +[section .data] +times 0x100 db 1 + +[section .text] +times 0x100 db 1 diff --git a/modules/objfmts/bin/tests/multisect/nomultisect2.hex b/modules/objfmts/bin/tests/multisect/nomultisect2.hex new file mode 100644 index 00000000..59c9350b --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/nomultisect2.hex @@ -0,0 +1,512 @@ +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 diff --git a/modules/objfmts/bin/tests/multisect/nomultisect2.map b/modules/objfmts/bin/tests/multisect/nomultisect2.map new file mode 100644 index 00000000..cc6d9c87 --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/nomultisect2.map @@ -0,0 +1,54 @@ + +- YASM Map file --------------------------------------------------------------- + +Source file: - +Output file: results/nomultisect2 + +-- Program origin ------------------------------------------------------------- + +00000100 + +-- Sections (summary) --------------------------------------------------------- + +Vstart Vstop Start Stop Length Class Name +00000100 00000200 00000100 00000200 00000100 progbits .text +00000200 00000300 00000200 00000300 00000100 progbits .data +00000300 00000400 00000300 00000400 00000100 nobits .bss + +-- Sections (detailed) -------------------------------------------------------- + +---- Section .text ------------------------------------------------------------ + +class: progbits +length: 00000100 +start: 00000100 +align: 00000004 +follows: not defined +vstart: 00000100 +valign: 00000004 +vfollows: not defined + +---- Section .data ------------------------------------------------------------ + +class: progbits +length: 00000100 +start: 00000200 +align: 00000004 +follows: not defined +vstart: 00000200 +valign: 00000004 +vfollows: not defined + +---- Section .bss ------------------------------------------------------------- + +class: nobits +length: 00000100 +start: 00000300 +align: 00000004 +follows: not defined +vstart: 00000300 +valign: 00000004 +vfollows: not defined + +-- Symbols -------------------------------------------------------------------- + diff --git a/modules/objfmts/bin/tests/multisect/vfollows-loop1-err.asm b/modules/objfmts/bin/tests/multisect/vfollows-loop1-err.asm new file mode 100644 index 00000000..84a7c1e4 --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/vfollows-loop1-err.asm @@ -0,0 +1,2 @@ +section sect1 vfollows=sect2 +section sect2 vfollows=sect1 diff --git a/modules/objfmts/bin/tests/multisect/vfollows-loop1-err.errwarn b/modules/objfmts/bin/tests/multisect/vfollows-loop1-err.errwarn new file mode 100644 index 00000000..b7a9006d --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/vfollows-loop1-err.errwarn @@ -0,0 +1 @@ +-: vfollows loop between section `sect2' and section `sect1' diff --git a/modules/objfmts/bin/tests/multisect/vfollows-loop2-err.asm b/modules/objfmts/bin/tests/multisect/vfollows-loop2-err.asm new file mode 100644 index 00000000..ac080b85 --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/vfollows-loop2-err.asm @@ -0,0 +1 @@ +section sect vfollows=sect diff --git a/modules/objfmts/bin/tests/multisect/vfollows-loop2-err.errwarn b/modules/objfmts/bin/tests/multisect/vfollows-loop2-err.errwarn new file mode 100644 index 00000000..d48bbc85 --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/vfollows-loop2-err.errwarn @@ -0,0 +1 @@ +-: vfollows loop between section `sect' and section `sect' diff --git a/modules/objfmts/bin/tests/multisect/vfollows-notfound-err.asm b/modules/objfmts/bin/tests/multisect/vfollows-notfound-err.asm new file mode 100644 index 00000000..fe0f6e5b --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/vfollows-notfound-err.asm @@ -0,0 +1,2 @@ +section foo vfollows=bar + diff --git a/modules/objfmts/bin/tests/multisect/vfollows-notfound-err.errwarn b/modules/objfmts/bin/tests/multisect/vfollows-notfound-err.errwarn new file mode 100644 index 00000000..ecbc97d4 --- /dev/null +++ b/modules/objfmts/bin/tests/multisect/vfollows-notfound-err.errwarn @@ -0,0 +1 @@ +-: section `foo' vfollows an invalid or unknown section `bar' diff --git a/modules/objfmts/coff/coff-objfmt.c b/modules/objfmts/coff/coff-objfmt.c index 52f1e4aa..9c69ad35 100644 --- a/modules/objfmts/coff/coff-objfmt.c +++ b/modules/objfmts/coff/coff-objfmt.c @@ -1253,7 +1253,7 @@ coff_objfmt_add_default_section(yasm_object *object) coff_section_data *csd; int isnew; - retval = yasm_object_get_general(object, ".text", 0, 16, 1, 0, &isnew, 0); + retval = yasm_object_get_general(object, ".text", 16, 1, 0, &isnew, 0); if (isnew) { csd = coff_objfmt_init_new_section(object, retval, ".text", 0); csd->flags = COFF_STYP_TEXT; @@ -1534,7 +1534,7 @@ coff_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, realname[8] = '\0'; } - retval = yasm_object_get_general(object, realname, 0, align, iscode, + retval = yasm_object_get_general(object, realname, align, iscode, resonly, &isnew, line); if (isnew) @@ -1629,8 +1629,7 @@ dir_export(yasm_object *object, yasm_valparamhead *valparams, } /* Add to end of linker directives */ - sect = yasm_object_get_general(object, ".drectve", 0, 0, 0, 0, &isnew, - line); + sect = yasm_object_get_general(object, ".drectve", 0, 0, 0, &isnew, line); /* Initialize directive section if needed */ if (isnew) { @@ -2007,7 +2006,7 @@ dir_endproc_frame(yasm_object *object, /*@null@*/ yasm_valparamhead *valparams, * Add unwind info to end of .xdata section. */ - sect = yasm_object_get_general(object, ".xdata", 0, 0, 0, 0, &isnew, line); + sect = yasm_object_get_general(object, ".xdata", 0, 0, 0, &isnew, line); /* Initialize xdata section if needed */ if (isnew) { @@ -2032,7 +2031,7 @@ dir_endproc_frame(yasm_object *object, /*@null@*/ yasm_valparamhead *valparams, * Add function lookup to end of .pdata section. */ - sect = yasm_object_get_general(object, ".pdata", 0, 0, 0, 0, &isnew, line); + sect = yasm_object_get_general(object, ".pdata", 0, 0, 0, &isnew, line); /* Initialize pdata section if needed */ if (isnew) { diff --git a/modules/objfmts/dbg/dbg-objfmt.c b/modules/objfmts/dbg/dbg-objfmt.c index 8452a810..998dc4f2 100644 --- a/modules/objfmts/dbg/dbg-objfmt.c +++ b/modules/objfmts/dbg/dbg-objfmt.c @@ -96,9 +96,7 @@ dbg_objfmt_add_default_section(yasm_object *object) yasm_section *retval; int isnew; - retval = yasm_object_get_general(object, ".text", - yasm_expr_create_ident(yasm_expr_int(yasm_intnum_create_uint(200)), 0), - 0, 0, 0, &isnew, 0); + retval = yasm_object_get_general(object, ".text", 0, 0, 0, &isnew, 0); if (isnew) { fprintf(objfmt_dbg->dbgfile, "(new) "); yasm_symtab_define_label(object->symtab, ".text", @@ -130,9 +128,8 @@ dbg_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, fprintf(objfmt_dbg->dbgfile, "NULL\n"); return NULL; } - retval = yasm_object_get_general(object, yasm_vp_string(vp), - yasm_expr_create_ident(yasm_expr_int(yasm_intnum_create_uint(200)), - line), 0, 0, 0, &isnew, line); + retval = yasm_object_get_general(object, yasm_vp_string(vp), 0, 0, 0, + &isnew, line); if (isnew) { fprintf(objfmt_dbg->dbgfile, "(new) "); yasm_symtab_define_label(object->symtab, vp->val, diff --git a/modules/objfmts/elf/elf-objfmt.c b/modules/objfmts/elf/elf-objfmt.c index 5ec17b7c..66fb6c56 100644 --- a/modules/objfmts/elf/elf-objfmt.c +++ b/modules/objfmts/elf/elf-objfmt.c @@ -945,7 +945,7 @@ elf_objfmt_add_default_section(yasm_object *object) int isnew; elf_secthead *esd; - retval = yasm_object_get_general(object, ".text", 0, 16, 1, 0, &isnew, 0); + retval = yasm_object_get_general(object, ".text", 16, 1, 0, &isnew, 0); esd = elf_objfmt_init_new_section(object, retval, ".text", SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR, 0); yasm_section_set_default(retval, 1); @@ -1118,7 +1118,7 @@ elf_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, } } - retval = yasm_object_get_general(object, sectname, 0, align, + retval = yasm_object_get_general(object, sectname, align, (data.flags & SHF_EXECINSTR) != 0, resonly, &isnew, line); diff --git a/modules/objfmts/macho/macho-objfmt.c b/modules/objfmts/macho/macho-objfmt.c index 3f13948f..893ef0db 100644 --- a/modules/objfmts/macho/macho-objfmt.c +++ b/modules/objfmts/macho/macho-objfmt.c @@ -1272,8 +1272,8 @@ macho_objfmt_add_default_section(yasm_object *object) macho_section_data *msd; int isnew; - retval = yasm_object_get_general(object, "LC_SEGMENT.__TEXT.__text", 0, 0, 1, 0, - &isnew, 0); + retval = yasm_object_get_general(object, "LC_SEGMENT.__TEXT.__text", 0, 1, + 0, &isnew, 0); if (isnew) { msd = macho_objfmt_init_new_section(object, retval, ".text", 0); msd->segname = yasm__xstrdup("__TEXT"); @@ -1464,7 +1464,7 @@ macho_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, realname = yasm_xmalloc(strlen("LC_SEGMENT") + 1 + strlen(data.f_segname) + 1 + strlen(f_sectname) + 1); sprintf(realname, "LC_SEGMENT.%s.%s", data.f_segname, f_sectname); - retval = yasm_object_get_general(object, realname, 0, align, 1, resonly, + retval = yasm_object_get_general(object, realname, align, 1, resonly, &isnew, line); yasm_xfree(realname); diff --git a/modules/objfmts/rdf/rdf-objfmt.c b/modules/objfmts/rdf/rdf-objfmt.c index 2b96bed3..46a5a8c8 100644 --- a/modules/objfmts/rdf/rdf-objfmt.c +++ b/modules/objfmts/rdf/rdf-objfmt.c @@ -839,7 +839,7 @@ rdf_objfmt_add_default_section(yasm_object *object) rdf_section_data *rsd; int isnew; - retval = yasm_object_get_general(object, ".text", 0, 0, 1, 0, &isnew, 0); + retval = yasm_object_get_general(object, ".text", 0, 1, 0, &isnew, 0); if (isnew) { rsd = rdf_objfmt_init_new_section(object, retval, ".text", 0); rsd->type = RDF_SECT_CODE; @@ -946,7 +946,7 @@ rdf_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, yasm_intnum_destroy(data.reserved_intn); } - retval = yasm_object_get_general(object, sectname, 0, 0, 1, + retval = yasm_object_get_general(object, sectname, 0, 1, data.type == RDF_SECT_BSS, &isnew, line); if (isnew) diff --git a/modules/objfmts/xdf/xdf-objfmt.c b/modules/objfmts/xdf/xdf-objfmt.c index 4ce2f3ef..a68dc0bf 100644 --- a/modules/objfmts/xdf/xdf-objfmt.c +++ b/modules/objfmts/xdf/xdf-objfmt.c @@ -634,7 +634,7 @@ xdf_objfmt_add_default_section(yasm_object *object) xdf_section_data *xsd; int isnew; - retval = yasm_object_get_general(object, ".text", 0, 0, 1, 0, &isnew, 0); + retval = yasm_object_get_general(object, ".text", 0, 1, 0, &isnew, 0); if (isnew) { xsd = xdf_objfmt_init_new_section(object, retval, ".text", 0); yasm_section_set_default(retval, 1); @@ -745,7 +745,7 @@ xdf_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, } } - retval = yasm_object_get_general(object, sectname, 0, align, 1, resonly, + retval = yasm_object_get_general(object, sectname, align, 1, resonly, &isnew, line); if (isnew) From 099b055bb167deb3daa549718980c54c0bc5473a Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 15 Nov 2007 03:55:41 +0000 Subject: [PATCH 120/585] Check for fseek() error. svn path=/trunk/yasm/; revision=2011 --- modules/objfmts/bin/bin-objfmt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/objfmts/bin/bin-objfmt.c b/modules/objfmts/bin/bin-objfmt.c index 655fab1e..481379d2 100644 --- a/modules/objfmts/bin/bin-objfmt.c +++ b/modules/objfmts/bin/bin-objfmt.c @@ -1069,7 +1069,8 @@ bin_objfmt_output_section(yasm_section *sect, /*@null@*/ void *d) yasm_errwarn_propagate(info->errwarns, 0); return 0; } - fseek(info->f, yasm_intnum_get_int(info->tmp_intn), SEEK_SET); + if (fseek(info->f, yasm_intnum_get_int(info->tmp_intn), SEEK_SET) < 0) + yasm__fatal(N_("could not seek on output file")); yasm_section_bcs_traverse(sect, info->errwarns, info, bin_objfmt_output_bytecode); } From 3ecb2331f31175959df4aa9013f3890070ee0c1b Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 15 Nov 2007 03:57:34 +0000 Subject: [PATCH 121/585] Correctly warn for map file usage if there are *no* object format directives. svn path=/trunk/yasm/; revision=2012 --- frontends/yasm/yasm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontends/yasm/yasm.c b/frontends/yasm/yasm.c index 117be48c..83d05241 100644 --- a/frontends/yasm/yasm.c +++ b/frontends/yasm/yasm.c @@ -442,10 +442,10 @@ do_assemble(void) /* Try to enable the map file via a map NASM directive. This is * somewhat of a hack. */ - if (map_filename && cur_objfmt_module->directives) { + if (map_filename) { const yasm_directive *dir = &cur_objfmt_module->directives[0]; matched = 0; - for (; dir->name; dir++) { + for (; dir && dir->name; dir++) { if (yasm__strcasecmp(dir->name, "map") == 0 && yasm__strcasecmp(dir->parser, "nasm") == 0) { yasm_valparamhead vps; From 4a778b6027a6f9d6502b6d4ade0487dedba63cab Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 15 Nov 2007 08:03:26 +0000 Subject: [PATCH 122/585] Correctly initialize bin object format to default to no map generation. svn path=/trunk/yasm/; revision=2013 --- modules/objfmts/bin/bin-objfmt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/objfmts/bin/bin-objfmt.c b/modules/objfmts/bin/bin-objfmt.c index 481379d2..271b58be 100644 --- a/modules/objfmts/bin/bin-objfmt.c +++ b/modules/objfmts/bin/bin-objfmt.c @@ -103,7 +103,7 @@ bin_objfmt_create(yasm_object *object) yasm_objfmt_bin *objfmt_bin = yasm_xmalloc(sizeof(yasm_objfmt_bin)); objfmt_bin->objfmt.module = &yasm_bin_LTX_objfmt; - objfmt_bin->map_flags = MAP_NONE; + objfmt_bin->map_flags = NO_MAP; objfmt_bin->map_filename = NULL; objfmt_bin->org = NULL; From 14596f6658cb247c58d5f65769877ba81bfeac97 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 28 Nov 2007 07:21:08 +0000 Subject: [PATCH 123/585] Fix #119. Quite a few SSE/SSE2 instructions assumed 128-bit memory sizes instead of the correct 64-bit or 32-bit sizes (e.g. xmm/m64 or similar). It worked fine when no memory size was specified, but it should also work with the correct size modifier. svn path=/trunk/yasm/; revision=2015 --- modules/arch/x86/gen_x86_insn.py | 362 ++++--- modules/arch/x86/tests/Makefile.inc | 2 + modules/arch/x86/tests/ssewidth.asm | 566 ++++++++++ modules/arch/x86/tests/ssewidth.hex | 1532 +++++++++++++++++++++++++++ 4 files changed, 2291 insertions(+), 171 deletions(-) create mode 100644 modules/arch/x86/tests/ssewidth.asm create mode 100644 modules/arch/x86/tests/ssewidth.hex diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index e891634e..9213fe0c 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -3710,29 +3710,29 @@ add_insn("prefetcht2", "twobytemem", modifiers=[3, 0x0F, 0x18], cpu=["P3"]) add_insn("sfence", "threebyte", modifiers=[0x0F, 0xAE, 0xF8], cpu=["P3"]) -add_group("sseps", +add_group("xmm_xmm128", cpu=["SSE"], - modifiers=["Op1Add"], + modifiers=["PreAdd", "Op1Add"], + prefix=0x00, opcode=[0x0F, 0x00], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) -add_insn("addps", "sseps", modifiers=[0x58]) -add_insn("andnps", "sseps", modifiers=[0x55]) -add_insn("andps", "sseps", modifiers=[0x54]) -add_insn("comiss", "sseps", modifiers=[0x2F]) -add_insn("divps", "sseps", modifiers=[0x5E]) -add_insn("maxps", "sseps", modifiers=[0x5F]) -add_insn("minps", "sseps", modifiers=[0x5D]) -add_insn("mulps", "sseps", modifiers=[0x59]) -add_insn("orps", "sseps", modifiers=[0x56]) -add_insn("rcpps", "sseps", modifiers=[0x53]) -add_insn("rsqrtps", "sseps", modifiers=[0x52]) -add_insn("sqrtps", "sseps", modifiers=[0x51]) -add_insn("subps", "sseps", modifiers=[0x5C]) -add_insn("unpckhps", "sseps", modifiers=[0x15]) -add_insn("unpcklps", "sseps", modifiers=[0x14]) -add_insn("xorps", "sseps", modifiers=[0x57]) +add_insn("addps", "xmm_xmm128", modifiers=[0, 0x58]) +add_insn("andnps", "xmm_xmm128", modifiers=[0, 0x55]) +add_insn("andps", "xmm_xmm128", modifiers=[0, 0x54]) +add_insn("divps", "xmm_xmm128", modifiers=[0, 0x5E]) +add_insn("maxps", "xmm_xmm128", modifiers=[0, 0x5F]) +add_insn("minps", "xmm_xmm128", modifiers=[0, 0x5D]) +add_insn("mulps", "xmm_xmm128", modifiers=[0, 0x59]) +add_insn("orps", "xmm_xmm128", modifiers=[0, 0x56]) +add_insn("rcpps", "xmm_xmm128", modifiers=[0, 0x53]) +add_insn("rsqrtps", "xmm_xmm128", modifiers=[0, 0x52]) +add_insn("sqrtps", "xmm_xmm128", modifiers=[0, 0x51]) +add_insn("subps", "xmm_xmm128", modifiers=[0, 0x5C]) +add_insn("unpckhps", "xmm_xmm128", modifiers=[0, 0x15]) +add_insn("unpcklps", "xmm_xmm128", modifiers=[0, 0x14]) +add_insn("xorps", "xmm_xmm128", modifiers=[0, 0x57]) add_group("cvt_rx_xmm32", suffix="l", @@ -3819,79 +3819,104 @@ add_group("cvt_xmm_rmx", add_insn("cvtsi2ss", "cvt_xmm_rmx", modifiers=[0xF3, 0x2A]) -add_group("ssess", +add_group("xmm_xmm32", cpu=["SSE"], modifiers=["PreAdd", "Op1Add"], prefix=0x00, opcode=[0x0F, 0x00], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) - -add_insn("addss", "ssess", modifiers=[0xF3, 0x58]) -add_insn("divss", "ssess", modifiers=[0xF3, 0x5E]) -add_insn("maxss", "ssess", modifiers=[0xF3, 0x5F]) -add_insn("minss", "ssess", modifiers=[0xF3, 0x5D]) -add_insn("mulss", "ssess", modifiers=[0xF3, 0x59]) -add_insn("rcpss", "ssess", modifiers=[0xF3, 0x53]) -add_insn("rsqrtss", "ssess", modifiers=[0xF3, 0x52]) -add_insn("sqrtss", "ssess", modifiers=[0xF3, 0x51]) -add_insn("subss", "ssess", modifiers=[0xF3, 0x5C]) -add_insn("ucomiss", "ssess", modifiers=[0, 0x2E]) - -add_group("ssecmpps", + Operand(type="SIMDReg", size=128, dest="EA")]) +add_group("xmm_xmm32", cpu=["SSE"], - modifiers=["Imm8"], + modifiers=["PreAdd", "Op1Add"], + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Mem", size=32, relaxed=True, dest="EA")]) + +add_insn("addss", "xmm_xmm32", modifiers=[0xF3, 0x58]) +add_insn("comiss", "xmm_xmm32", modifiers=[0, 0x2F]) +add_insn("divss", "xmm_xmm32", modifiers=[0xF3, 0x5E]) +add_insn("maxss", "xmm_xmm32", modifiers=[0xF3, 0x5F]) +add_insn("minss", "xmm_xmm32", modifiers=[0xF3, 0x5D]) +add_insn("mulss", "xmm_xmm32", modifiers=[0xF3, 0x59]) +add_insn("rcpss", "xmm_xmm32", modifiers=[0xF3, 0x53]) +add_insn("rsqrtss", "xmm_xmm32", modifiers=[0xF3, 0x52]) +add_insn("sqrtss", "xmm_xmm32", modifiers=[0xF3, 0x51]) +add_insn("subss", "xmm_xmm32", modifiers=[0xF3, 0x5C]) +add_insn("ucomiss", "xmm_xmm32", modifiers=[0, 0x2E]) + +add_group("ssecmp_128", + cpu=["SSE"], + modifiers=["Imm8", "PreAdd"], opcode=[0x0F, 0xC2], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) -add_insn("cmpeqps", "ssecmpps", modifiers=[0x00]) -add_insn("cmpleps", "ssecmpps", modifiers=[0x02]) -add_insn("cmpltps", "ssecmpps", modifiers=[0x01]) -add_insn("cmpneqps", "ssecmpps", modifiers=[0x04]) -add_insn("cmpnleps", "ssecmpps", modifiers=[0x06]) -add_insn("cmpnltps", "ssecmpps", modifiers=[0x05]) -add_insn("cmpordps", "ssecmpps", modifiers=[0x07]) -add_insn("cmpunordps", "ssecmpps", modifiers=[0x03]) +add_insn("cmpeqps", "ssecmp_128", modifiers=[0]) +add_insn("cmpleps", "ssecmp_128", modifiers=[2]) +add_insn("cmpltps", "ssecmp_128", modifiers=[1]) +add_insn("cmpneqps", "ssecmp_128", modifiers=[4]) +add_insn("cmpnleps", "ssecmp_128", modifiers=[6]) +add_insn("cmpnltps", "ssecmp_128", modifiers=[5]) +add_insn("cmpordps", "ssecmp_128", modifiers=[7]) +add_insn("cmpunordps", "ssecmp_128", modifiers=[3]) -add_group("ssecmpss", +add_group("ssecmp_32", cpu=["SSE"], modifiers=["Imm8", "PreAdd"], prefix=0x00, opcode=[0x0F, 0xC2], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) + Operand(type="SIMDReg", size=128, dest="EA")]) -add_insn("cmpeqss", "ssecmpss", modifiers=[0, 0xF3]) -add_insn("cmpless", "ssecmpss", modifiers=[2, 0xF3]) -add_insn("cmpltss", "ssecmpss", modifiers=[1, 0xF3]) -add_insn("cmpneqss", "ssecmpss", modifiers=[4, 0xF3]) -add_insn("cmpnless", "ssecmpss", modifiers=[6, 0xF3]) -add_insn("cmpnltss", "ssecmpss", modifiers=[5, 0xF3]) -add_insn("cmpordss", "ssecmpss", modifiers=[7, 0xF3]) -add_insn("cmpunordss", "ssecmpss", modifiers=[3, 0xF3]) - -add_group("ssepsimm", +add_group("ssecmp_32", cpu=["SSE"], - modifiers=["Op1Add"], + modifiers=["Imm8", "PreAdd"], + prefix=0x00, + opcode=[0x0F, 0xC2], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Mem", size=32, relaxed=True, dest="EA")]) + +add_insn("cmpeqss", "ssecmp_32", modifiers=[0, 0xF3]) +add_insn("cmpless", "ssecmp_32", modifiers=[2, 0xF3]) +add_insn("cmpltss", "ssecmp_32", modifiers=[1, 0xF3]) +add_insn("cmpneqss", "ssecmp_32", modifiers=[4, 0xF3]) +add_insn("cmpnless", "ssecmp_32", modifiers=[6, 0xF3]) +add_insn("cmpnltss", "ssecmp_32", modifiers=[5, 0xF3]) +add_insn("cmpordss", "ssecmp_32", modifiers=[7, 0xF3]) +add_insn("cmpunordss", "ssecmp_32", modifiers=[3, 0xF3]) + +add_group("xmm_xmm128_imm", + cpu=["SSE"], + modifiers=["PreAdd", "Op1Add"], opcode=[0x0F, 0x00], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) -add_insn("cmpps", "ssepsimm", modifiers=[0xC2]) -add_insn("shufps", "ssepsimm", modifiers=[0xC6]) +add_insn("cmpps", "xmm_xmm128_imm", modifiers=[0, 0xC2]) +add_insn("shufps", "xmm_xmm128_imm", modifiers=[0, 0xC6]) -add_group("ssessimm", +add_group("xmm_xmm32_imm", cpu=["SSE"], modifiers=["PreAdd", "Op1Add"], prefix=0x00, opcode=[0x0F, 0x00], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="EA"), Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) -add_insn("cmpss", "ssessimm", modifiers=[0xF3, 0xC2]) +add_group("xmm_xmm32_imm", + cpu=["SSE"], + modifiers=["PreAdd", "Op1Add"], + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Mem", size=32, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + +add_insn("cmpss", "xmm_xmm32_imm", modifiers=[0xF3, 0xC2]) add_group("ldstmxcsr", cpu=["SSE"], @@ -4158,89 +4183,91 @@ add_insn("pshufw", "pshufw") ##################################################################### # SSE2 instructions ##################################################################### -add_insn("addpd", "ssess", modifiers=[0x66, 0x58], cpu=["SSE2"]) -add_insn("addsd", "ssess", modifiers=[0xF2, 0x58], cpu=["SSE2"]) -add_insn("andnpd", "ssess", modifiers=[0x66, 0x55], cpu=["SSE2"]) -add_insn("andpd", "ssess", modifiers=[0x66, 0x54], cpu=["SSE2"]) -add_insn("comisd", "ssess", modifiers=[0x66, 0x2F], cpu=["SSE2"]) -add_insn("divpd", "ssess", modifiers=[0x66, 0x5E], cpu=["SSE2"]) -add_insn("divsd", "ssess", modifiers=[0xF2, 0x5E], cpu=["SSE2"]) -add_insn("maxpd", "ssess", modifiers=[0x66, 0x5F], cpu=["SSE2"]) -add_insn("maxsd", "ssess", modifiers=[0xF2, 0x5F], cpu=["SSE2"]) -add_insn("minpd", "ssess", modifiers=[0x66, 0x5D], cpu=["SSE2"]) -add_insn("minsd", "ssess", modifiers=[0xF2, 0x5D], cpu=["SSE2"]) -add_insn("mulpd", "ssess", modifiers=[0x66, 0x59], cpu=["SSE2"]) -add_insn("mulsd", "ssess", modifiers=[0xF2, 0x59], cpu=["SSE2"]) -add_insn("orpd", "ssess", modifiers=[0x66, 0x56], cpu=["SSE2"]) -add_insn("sqrtpd", "ssess", modifiers=[0x66, 0x51], cpu=["SSE2"]) -add_insn("sqrtsd", "ssess", modifiers=[0xF2, 0x51], cpu=["SSE2"]) -add_insn("subpd", "ssess", modifiers=[0x66, 0x5C], cpu=["SSE2"]) -add_insn("subsd", "ssess", modifiers=[0xF2, 0x5C], cpu=["SSE2"]) -add_insn("ucomisd", "ssess", modifiers=[0x66, 0x2E], cpu=["SSE2"]) -add_insn("unpckhpd", "ssess", modifiers=[0x66, 0x15], cpu=["SSE2"]) -add_insn("unpcklpd", "ssess", modifiers=[0x66, 0x14], cpu=["SSE2"]) -add_insn("xorpd", "ssess", modifiers=[0x66, 0x57], cpu=["SSE2"]) -add_insn("cvtpd2dq", "ssess", modifiers=[0xF2, 0xE6], cpu=["SSE2"]) -add_insn("cvtpd2ps", "ssess", modifiers=[0x66, 0x5A], cpu=["SSE2"]) -add_insn("cvtps2dq", "ssess", modifiers=[0x66, 0x5B], cpu=["SSE2"]) +add_group("xmm_xmm64", + cpu=["SSE2"], + modifiers=["PreAdd", "Op1Add"], + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA")]) +add_group("xmm_xmm64", + cpu=["SSE2"], + modifiers=["PreAdd", "Op1Add"], + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Mem", size=64, relaxed=True, dest="EA")]) -add_insn("cvtdq2ps", "sseps", modifiers=[0x5B], cpu=["SSE2"]) +add_insn("addsd", "xmm_xmm64", modifiers=[0xF2, 0x58]) +add_insn("comisd", "xmm_xmm64", modifiers=[0x66, 0x2F]) +add_insn("cvtdq2pd", "xmm_xmm64", modifiers=[0xF3, 0xE6]) +add_insn("cvtps2pd", "xmm_xmm64", modifiers=[0, 0x5A]) +add_insn("cvtsd2ss", "xmm_xmm64", modifiers=[0xF2, 0x5A]) +add_insn("divsd", "xmm_xmm64", modifiers=[0xF2, 0x5E]) +add_insn("maxsd", "xmm_xmm64", modifiers=[0xF2, 0x5F]) +add_insn("minsd", "xmm_xmm64", modifiers=[0xF2, 0x5D]) +add_insn("mulsd", "xmm_xmm64", modifiers=[0xF2, 0x59]) +add_insn("subsd", "xmm_xmm64", modifiers=[0xF2, 0x5C]) +add_insn("sqrtsd", "xmm_xmm64", modifiers=[0xF2, 0x51]) +add_insn("ucomisd", "xmm_xmm64", modifiers=[0x66, 0x2E]) -add_insn("cmpeqpd", "ssecmpss", modifiers=[0x00, 0x66], cpu=["SSE2"]) -add_insn("cmpeqsd", "ssecmpss", modifiers=[0x00, 0xF2], cpu=["SSE2"]) -add_insn("cmplepd", "ssecmpss", modifiers=[0x02, 0x66], cpu=["SSE2"]) -add_insn("cmplesd", "ssecmpss", modifiers=[0x02, 0xF2], cpu=["SSE2"]) -add_insn("cmpltpd", "ssecmpss", modifiers=[0x01, 0x66], cpu=["SSE2"]) -add_insn("cmpltsd", "ssecmpss", modifiers=[0x01, 0xF2], cpu=["SSE2"]) -add_insn("cmpneqpd", "ssecmpss", modifiers=[0x04, 0x66], cpu=["SSE2"]) -add_insn("cmpneqsd", "ssecmpss", modifiers=[0x04, 0xF2], cpu=["SSE2"]) -add_insn("cmpnlepd", "ssecmpss", modifiers=[0x06, 0x66], cpu=["SSE2"]) -add_insn("cmpnlesd", "ssecmpss", modifiers=[0x06, 0xF2], cpu=["SSE2"]) -add_insn("cmpnltpd", "ssecmpss", modifiers=[0x05, 0x66], cpu=["SSE2"]) -add_insn("cmpnltsd", "ssecmpss", modifiers=[0x05, 0xF2], cpu=["SSE2"]) -add_insn("cmpordpd", "ssecmpss", modifiers=[0x07, 0x66], cpu=["SSE2"]) -add_insn("cmpordsd", "ssecmpss", modifiers=[0x07, 0xF2], cpu=["SSE2"]) -add_insn("cmpunordpd", "ssecmpss", modifiers=[0x03, 0x66], cpu=["SSE2"]) -add_insn("cmpunordsd", "ssecmpss", modifiers=[0x03, 0xF2], cpu=["SSE2"]) +add_insn("addpd", "xmm_xmm128", modifiers=[0x66, 0x58], cpu=["SSE2"]) +add_insn("andnpd", "xmm_xmm128", modifiers=[0x66, 0x55], cpu=["SSE2"]) +add_insn("andpd", "xmm_xmm128", modifiers=[0x66, 0x54], cpu=["SSE2"]) +add_insn("cvtdq2ps", "xmm_xmm128", modifiers=[0, 0x5B], cpu=["SSE2"]) +add_insn("cvtpd2dq", "xmm_xmm128", modifiers=[0xF2, 0xE6], cpu=["SSE2"]) +add_insn("cvtpd2ps", "xmm_xmm128", modifiers=[0x66, 0x5A], cpu=["SSE2"]) +add_insn("cvtps2dq", "xmm_xmm128", modifiers=[0x66, 0x5B], cpu=["SSE2"]) +add_insn("divpd", "xmm_xmm128", modifiers=[0x66, 0x5E], cpu=["SSE2"]) +add_insn("maxpd", "xmm_xmm128", modifiers=[0x66, 0x5F], cpu=["SSE2"]) +add_insn("minpd", "xmm_xmm128", modifiers=[0x66, 0x5D], cpu=["SSE2"]) +add_insn("mulpd", "xmm_xmm128", modifiers=[0x66, 0x59], cpu=["SSE2"]) +add_insn("orpd", "xmm_xmm128", modifiers=[0x66, 0x56], cpu=["SSE2"]) +add_insn("sqrtpd", "xmm_xmm128", modifiers=[0x66, 0x51], cpu=["SSE2"]) +add_insn("subpd", "xmm_xmm128", modifiers=[0x66, 0x5C], cpu=["SSE2"]) +add_insn("unpckhpd", "xmm_xmm128", modifiers=[0x66, 0x15], cpu=["SSE2"]) +add_insn("unpcklpd", "xmm_xmm128", modifiers=[0x66, 0x14], cpu=["SSE2"]) +add_insn("xorpd", "xmm_xmm128", modifiers=[0x66, 0x57], cpu=["SSE2"]) -add_insn("cmppd", "ssessimm", modifiers=[0x66, 0xC2], cpu=["SSE2"]) -add_insn("shufpd", "ssessimm", modifiers=[0x66, 0xC6], cpu=["SSE2"]) +add_group("ssecmp_64", + cpu=["SSE2"], + modifiers=["Imm8", "PreAdd"], + prefix=0x00, + opcode=[0x0F, 0xC2], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA")]) + +add_group("ssecmp_64", + cpu=["SSE2"], + modifiers=["Imm8", "PreAdd"], + prefix=0x00, + opcode=[0x0F, 0xC2], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Mem", size=64, relaxed=True, dest="EA")]) + +add_insn("cmpeqsd", "ssecmp_64", modifiers=[0, 0xF2]) +add_insn("cmplesd", "ssecmp_64", modifiers=[2, 0xF2]) +add_insn("cmpltsd", "ssecmp_64", modifiers=[1, 0xF2]) +add_insn("cmpneqsd", "ssecmp_64", modifiers=[4, 0xF2]) +add_insn("cmpnlesd", "ssecmp_64", modifiers=[6, 0xF2]) +add_insn("cmpnltsd", "ssecmp_64", modifiers=[5, 0xF2]) +add_insn("cmpordsd", "ssecmp_64", modifiers=[7, 0xF2]) +add_insn("cmpunordsd", "ssecmp_64", modifiers=[3, 0xF2]) + +add_insn("cmpeqpd", "ssecmp_128", modifiers=[0, 0x66], cpu=["SSE2"]) +add_insn("cmplepd", "ssecmp_128", modifiers=[2, 0x66], cpu=["SSE2"]) +add_insn("cmpltpd", "ssecmp_128", modifiers=[1, 0x66], cpu=["SSE2"]) +add_insn("cmpneqpd", "ssecmp_128", modifiers=[4, 0x66], cpu=["SSE2"]) +add_insn("cmpnlepd", "ssecmp_128", modifiers=[6, 0x66], cpu=["SSE2"]) +add_insn("cmpnltpd", "ssecmp_128", modifiers=[5, 0x66], cpu=["SSE2"]) +add_insn("cmpordpd", "ssecmp_128", modifiers=[7, 0x66], cpu=["SSE2"]) +add_insn("cmpunordpd", "ssecmp_128", modifiers=[3, 0x66], cpu=["SSE2"]) + +add_insn("cmppd", "xmm_xmm128_imm", modifiers=[0x66, 0xC2], cpu=["SSE2"]) +add_insn("shufpd", "xmm_xmm128_imm", modifiers=[0x66, 0xC6], cpu=["SSE2"]) add_insn("cvtsi2sd", "cvt_xmm_rmx", modifiers=[0xF2, 0x2A], cpu=["SSE2"]) -add_group("cvt_xmm_xmm64_ss", - cpu=["SSE2"], - modifiers=["PreAdd", "Op1Add"], - prefix=0x00, - opcode=[0x0F, 0x00], - operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDReg", size=128, dest="EA")]) -add_group("cvt_xmm_xmm64_ss", - cpu=["SSE2"], - modifiers=["PreAdd", "Op1Add"], - prefix=0x00, - opcode=[0x0F, 0x00], - operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="Mem", size=64, relaxed=True, dest="EA")]) - -add_insn("cvtdq2pd", "cvt_xmm_xmm64_ss", modifiers=[0xF3, 0xE6]) -add_insn("cvtsd2ss", "cvt_xmm_xmm64_ss", modifiers=[0xF2, 0x5A]) - -add_group("cvt_xmm_xmm64_ps", - cpu=["SSE2"], - modifiers=["Op1Add"], - opcode=[0x0F, 0x00], - operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDReg", size=128, dest="EA")]) -add_group("cvt_xmm_xmm64_ps", - cpu=["SSE2"], - modifiers=["Op1Add"], - opcode=[0x0F, 0x00], - operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="Mem", size=64, relaxed=True, dest="EA")]) - -add_insn("cvtps2pd", "cvt_xmm_xmm64_ps", modifiers=[0x5A]) - add_group("cvt_rx_xmm64", suffix="l", cpu=["SSE2"], @@ -4305,7 +4332,15 @@ add_group("cmpsd", prefix=0xF2, opcode=[0x0F, 0xC2], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + +add_group("cmpsd", + cpu=["SSE2"], + prefix=0xF2, + opcode=[0x0F, 0xC2], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Mem", size=64, relaxed=True, dest="EA"), Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) # cmpsd is added in string instructions above, so don't re-add_insn() @@ -4460,31 +4495,16 @@ add_insn("vmxon", "vmxthreebytemem", modifiers=[0xF3]) add_insn("cvttpd2pi", "cvt_mm_xmm", modifiers=[0x66, 0x2C], cpu=["SSE2"]) add_insn("cvttsd2si", "cvt_rx_xmm64", modifiers=[0xF2, 0x2C], cpu=["SSE2"]) -add_insn("cvttpd2dq", "ssess", modifiers=[0x66, 0xE6], cpu=["SSE2"]) -add_insn("cvttps2dq", "ssess", modifiers=[0xF3, 0x5B], cpu=["SSE2"]) +add_insn("cvttpd2dq", "xmm_xmm128", modifiers=[0x66, 0xE6], cpu=["SSE2"]) +add_insn("cvttps2dq", "xmm_xmm128", modifiers=[0xF3, 0x5B], cpu=["SSE2"]) add_insn("pmuludq", "mmxsse2", modifiers=[0xF4], cpu=["SSE2"]) -add_insn("pshufd", "ssessimm", modifiers=[0x66, 0x70], cpu=["SSE2"]) -add_insn("pshufhw", "ssessimm", modifiers=[0xF3, 0x70], cpu=["SSE2"]) -add_insn("pshuflw", "ssessimm", modifiers=[0xF2, 0x70], cpu=["SSE2"]) -add_insn("punpckhqdq", "ssess", modifiers=[0x66, 0x6D], cpu=["SSE2"]) -add_insn("punpcklqdq", "ssess", modifiers=[0x66, 0x6C], cpu=["SSE2"]) +add_insn("pshufd", "xmm_xmm128_imm", modifiers=[0x66, 0x70], cpu=["SSE2"]) +add_insn("pshufhw", "xmm_xmm128_imm", modifiers=[0xF3, 0x70], cpu=["SSE2"]) +add_insn("pshuflw", "xmm_xmm128_imm", modifiers=[0xF2, 0x70], cpu=["SSE2"]) +add_insn("punpckhqdq", "xmm_xmm128", modifiers=[0x66, 0x6D], cpu=["SSE2"]) +add_insn("punpcklqdq", "xmm_xmm128", modifiers=[0x66, 0x6C], cpu=["SSE2"]) -add_group("cvt_xmm_xmm32", - cpu=["SSE2"], - modifiers=["PreAdd", "Op1Add"], - prefix=0x00, - opcode=[0x0F, 0x00], - operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDReg", size=128, dest="EA")]) -add_group("cvt_xmm_xmm32", - cpu=["SSE2"], - modifiers=["PreAdd", "Op1Add"], - prefix=0x00, - opcode=[0x0F, 0x00], - operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="Mem", size=32, relaxed=True, dest="EA")]) - -add_insn("cvtss2sd", "cvt_xmm_xmm32", modifiers=[0xF3, 0x5A]) +add_insn("cvtss2sd", "xmm_xmm32", modifiers=[0xF3, 0x5A], cpu=["SSE2"]) add_group("maskmovdqu", cpu=["SSE2"], @@ -4546,17 +4566,17 @@ add_insn("psrldq", "pslrldq", modifiers=[3]) ##################################################################### # SSE3 / PNI Prescott New Instructions instructions ##################################################################### -add_insn("addsubpd", "ssess", modifiers=[0x66, 0xD0], cpu=["SSE3"]) -add_insn("addsubps", "ssess", modifiers=[0xF2, 0xD0], cpu=["SSE3"]) -add_insn("haddpd", "ssess", modifiers=[0x66, 0x7C], cpu=["SSE3"]) -add_insn("haddps", "ssess", modifiers=[0xF2, 0x7C], cpu=["SSE3"]) -add_insn("hsubpd", "ssess", modifiers=[0x66, 0x7D], cpu=["SSE3"]) -add_insn("hsubps", "ssess", modifiers=[0xF2, 0x7D], cpu=["SSE3"]) -add_insn("movshdup", "ssess", modifiers=[0xF3, 0x16], cpu=["SSE3"]) -add_insn("movsldup", "ssess", modifiers=[0xF3, 0x12], cpu=["SSE3"]) +add_insn("addsubpd", "xmm_xmm128", modifiers=[0x66, 0xD0], cpu=["SSE3"]) +add_insn("addsubps", "xmm_xmm128", modifiers=[0xF2, 0xD0], cpu=["SSE3"]) +add_insn("haddpd", "xmm_xmm128", modifiers=[0x66, 0x7C], cpu=["SSE3"]) +add_insn("haddps", "xmm_xmm128", modifiers=[0xF2, 0x7C], cpu=["SSE3"]) +add_insn("hsubpd", "xmm_xmm128", modifiers=[0x66, 0x7D], cpu=["SSE3"]) +add_insn("hsubps", "xmm_xmm128", modifiers=[0xF2, 0x7D], cpu=["SSE3"]) +add_insn("movshdup", "xmm_xmm128", modifiers=[0xF3, 0x16], cpu=["SSE3"]) +add_insn("movsldup", "xmm_xmm128", modifiers=[0xF3, 0x12], cpu=["SSE3"]) add_insn("fisttp", "fildstp", modifiers=[1, 0, 1], cpu=["SSE3"]) add_insn("fisttpll", "fildstp", suffix="q", modifiers=[7], cpu=["SSE3"]) -add_insn("movddup", "cvt_xmm_xmm64_ss", modifiers=[0xF2, 0x12], cpu=["SSE3"]) +add_insn("movddup", "xmm_xmm64", modifiers=[0xF2, 0x12], cpu=["SSE3"]) add_insn("monitor", "threebyte", modifiers=[0x0F, 0x01, 0xC8], cpu=["SSE3"]) add_insn("mwait", "threebyte", modifiers=[0x0F, 0x01, 0xC9], cpu=["SSE3"]) @@ -4565,7 +4585,7 @@ add_group("lddqu", prefix=0xF2, opcode=[0x0F, 0xF0], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="Mem", dest="EA")]) + Operand(type="Mem", size=128, relaxed=True, dest="EA")]) add_insn("lddqu", "lddqu") diff --git a/modules/arch/x86/tests/Makefile.inc b/modules/arch/x86/tests/Makefile.inc index 87761177..ee1b4c81 100644 --- a/modules/arch/x86/tests/Makefile.inc +++ b/modules/arch/x86/tests/Makefile.inc @@ -163,6 +163,8 @@ EXTRA_DIST += modules/arch/x86/tests/sse5-basic.asm EXTRA_DIST += modules/arch/x86/tests/sse5-basic.hex EXTRA_DIST += modules/arch/x86/tests/sse5-err.asm EXTRA_DIST += modules/arch/x86/tests/sse5-err.errwarn +EXTRA_DIST += modules/arch/x86/tests/ssewidth.asm +EXTRA_DIST += modules/arch/x86/tests/ssewidth.hex EXTRA_DIST += modules/arch/x86/tests/ssse3.asm EXTRA_DIST += modules/arch/x86/tests/ssse3.c EXTRA_DIST += modules/arch/x86/tests/ssse3.hex diff --git a/modules/arch/x86/tests/ssewidth.asm b/modules/arch/x86/tests/ssewidth.asm new file mode 100644 index 00000000..0824b769 --- /dev/null +++ b/modules/arch/x86/tests/ssewidth.asm @@ -0,0 +1,566 @@ +[bits 64] +addpd xmm1, xmm2 +addpd xmm1, dqword [rbx] + +addps xmm1, xmm2 +addps xmm1, dqword [rbx] + +addsd xmm1, xmm2 +addsd xmm1, qword [rbx] + +addss xmm1, xmm2 +addss xmm1, dword [rbx] + +addsubpd xmm1, xmm2 +addsubpd xmm1, dqword [rbx] + +addsubps xmm1, xmm2 +addsubps xmm1, dqword [rbx] + +andnpd xmm1, xmm2 +andnpd xmm1, dqword [rbx] + +andnps xmm1, xmm2 +andnps xmm1, dqword [rbx] + +andpd xmm1, xmm2 +andpd xmm1, dqword [rbx] + +andps xmm1, xmm2 +andps xmm1, dqword [rbx] + +cmppd xmm1, xmm2, 0 +cmppd xmm1, dqword [rbx], 0 +cmpeqpd xmm1, xmm2 +cmpeqpd xmm1, dqword [rbx] + +cmpps xmm1, xmm2, 0 +cmpps xmm1, dqword [rbx], 0 +cmpeqps xmm1, xmm2 +cmpeqps xmm1, dqword [rbx] + +cmpsd xmm1, xmm2, 0 +cmpsd xmm1, qword [rbx], 0 +cmpeqsd xmm1, xmm2 +cmpeqsd xmm1, qword [rbx] + +cmpss xmm1, xmm2, 0 +cmpss xmm1, dword [rbx], 0 +cmpeqss xmm1, xmm2 +cmpeqss xmm1, dword [rbx] + +comisd xmm1, xmm2 +comisd xmm1, qword [rbx] + +comiss xmm1, xmm2 +comiss xmm1, dword [rbx] + +cvtdq2pd xmm1, xmm2 +cvtdq2pd xmm1, qword [rbx] + +cvtdq2ps xmm1, xmm2 +cvtdq2ps xmm1, dqword [rbx] + +cvtpd2dq xmm1, xmm2 +cvtpd2dq xmm1, dqword [rbx] + +cvtpd2pi mm1, xmm2 ; mmx +cvtpd2pi mm1, dqword [rbx] + +cvtpd2ps xmm1, xmm2 +cvtpd2ps xmm1, dqword [rbx] + +cvtpi2pd xmm1, mm2 ; mmx +cvtpi2pd xmm1, qword [rbx] + +cvtpi2ps xmm1, mm2 ; mmx +cvtpi2ps xmm1, qword [rbx] + +cvtps2dq xmm1, xmm2 +cvtps2dq xmm1, dqword [rbx] + +cvtps2pd xmm1, xmm2 +cvtps2pd xmm1, qword [rbx] + +cvtps2pi mm1, xmm2 +cvtps2pi mm1, qword [rbx] + +cvtsd2si rbx, xmm2 +cvtsd2si rbx, qword [rbx] + +cvtsd2ss xmm1, xmm2 +cvtsd2ss xmm1, qword [rbx] + +cvtsi2sd xmm1, ebx +cvtsi2sd xmm1, dword [rbx] +cvtsi2sd xmm1, rbx +cvtsi2sd xmm1, qword [rbx] + +cvtsi2ss xmm1, ebx +cvtsi2ss xmm1, dword [rbx] +cvtsi2ss xmm1, rbx +cvtsi2ss xmm1, qword [rbx] + +cvtss2sd xmm1, xmm2 +cvtss2sd xmm1, dword [rbx] + +cvtss2si ebx, xmm2 +cvtss2si ebx, dword [rbx] +cvtss2si rbx, xmm2 +cvtss2si rbx, dword [rbx] + +cvttpd2dq xmm1, xmm2 +cvttpd2dq xmm1, dqword [rbx] + +cvttpd2pi mm1, xmm2 +cvttpd2pi mm1, dqword [rbx] + +cvttps2dq xmm1, xmm2 +cvttps2dq xmm1, dqword [rbx] + +cvttps2pi mm1, xmm2 +cvttps2pi mm1, qword [rbx] + +cvttsd2si eax, xmm1 +cvttsd2si eax, qword [rbx] +cvttsd2si rax, xmm1 +cvttsd2si rax, qword [rbx] + +cvttss2si eax, xmm1 +cvttss2si eax, dword [rbx] +cvttss2si rax, xmm1 +cvttss2si rax, dword [rbx] + +divpd xmm1, xmm2 +divpd xmm1, dqword [rbx] + +divps xmm1, xmm2 +divps xmm1, dqword [rbx] + +divsd xmm1, xmm2 +divsd xmm1, qword [rbx] + +divss xmm1, xmm2 +divss xmm1, dword [rbx] + +extrq xmm1, 0, 1 +extrq xmm1, byte 0, byte 1 +extrq xmm1, xmm2 + +haddpd xmm1, xmm2 +haddpd xmm1, dqword [rbx] + +haddps xmm1, xmm2 +haddps xmm1, dqword [rbx] + +hsubpd xmm1, xmm2 +hsubpd xmm1, dqword [rbx] + +hsubps xmm1, xmm2 +hsubps xmm1, dqword [rbx] + +insertq xmm1, xmm2, 0, 1 +insertq xmm1, xmm2, byte 0, byte 1 +insertq xmm1, xmm2 + +lddqu xmm1, dqword [rbx] + +ldmxcsr dword [rbx] + +maskmovdqu xmm1, xmm2 + +maxpd xmm1, xmm2 +maxpd xmm1, dqword [rbx] + +maxps xmm1, xmm2 +maxps xmm1, dqword [rbx] + +maxsd xmm1, xmm2 +maxsd xmm1, qword [rbx] + +maxss xmm1, xmm2 +maxss xmm1, dword [rbx] + +minpd xmm1, xmm2 +minpd xmm1, dqword [rbx] + +minps xmm1, xmm2 +minps xmm1, dqword [rbx] + +minsd xmm1, xmm2 +minsd xmm1, qword [rbx] + +minss xmm1, xmm2 +minss xmm1, dword [rbx] + +movapd xmm1, xmm2 +movapd xmm1, dqword [rbx] +movapd dqword [rbx], xmm2 + +movaps xmm1, xmm2 +movaps xmm1, dqword [rbx] +movaps dqword [rbx], xmm2 + +movd xmm1, ebx +movd xmm1, dword [rbx] +movd xmm1, rbx +movd xmm1, qword [rbx] +movd dword [rbx], xmm2 +movd qword [rbx], xmm2 + +movddup xmm1, xmm2 +movddup xmm1, qword [rbx] + +movdq2q mm1, xmm2 + +movdqa xmm1, xmm2 +movdqa xmm1, dqword [rbx] +movdqa dqword [rbx], xmm2 + +movdqu xmm1, xmm2 +movdqu xmm1, dqword [rbx] +movdqu dqword [rbx], xmm2 + +movhlps xmm1, xmm2 + +movhpd xmm1, qword [rbx] +movhpd qword [rbx], xmm2 + +movhps xmm1, qword [rbx] +movhps qword [rbx], xmm2 + +movlhps xmm1, xmm2 + +movlpd xmm1, qword [rbx] +movlpd qword [rbx], xmm2 + +movlps xmm1, qword [rbx] +movlps qword [rbx], xmm2 + +movmskpd ebx, xmm2 + +movmskps ebx, xmm2 + +movntdq dqword [rbx], xmm2 + +movntpd dqword [rbx], xmm2 + +movntps dqword [rbx], xmm2 + +movntsd qword [rbx], xmm2 + +movntss dword [rbx], xmm2 + +movq xmm1, xmm2 +movq xmm1, qword [rbx] +movq qword [rbx], xmm2 + +movq2dq xmm1, mm2 + +movsd xmm1, xmm2 +movsd xmm1, qword [rbx] +movsd qword [rbx], xmm2 + +movshdup xmm1, xmm2 +movshdup xmm1, dqword [rbx] + +movsldup xmm1, xmm2 +movsldup xmm1, dqword [rbx] + +movss xmm1, xmm2 +movss xmm1, dword [rbx] +movss dword [rbx], xmm2 + +movupd xmm1, xmm2 +movupd xmm1, dqword [rbx] +movupd dqword [rbx], xmm2 + +movups xmm1, xmm2 +movups xmm1, dqword [rbx] +movups dqword [rbx], xmm2 + +mulpd xmm1, xmm2 +mulpd xmm1, dqword [rbx] + +mulps xmm1, xmm2 +mulps xmm1, dqword [rbx] + +mulsd xmm1, xmm2 +mulsd xmm1, qword [rbx] + +mulss xmm1, xmm2 +mulss xmm1, dword [rbx] + +orpd xmm1, xmm2 +orpd xmm1, dqword [rbx] + +orps xmm1, xmm2 +orps xmm1, dqword [rbx] + +packssdw xmm1, xmm2 +packssdw xmm1, dqword [rbx] + +packsswb xmm1, xmm2 +packsswb xmm1, dqword [rbx] + +packuswb xmm1, xmm2 +packuswb xmm1, dqword [rbx] + +paddb xmm1, xmm2 +paddb xmm1, dqword [rbx] + +paddd xmm1, xmm2 +paddd xmm1, dqword [rbx] + +paddq xmm1, xmm2 +paddq xmm1, dqword [rbx] + +paddsb xmm1, xmm2 +paddsb xmm1, dqword [rbx] + +paddsw xmm1, xmm2 +paddsw xmm1, dqword [rbx] + +paddusb xmm1, xmm2 +paddusb xmm1, dqword [rbx] + +paddusw xmm1, xmm2 +paddusw xmm1, dqword [rbx] + +paddw xmm1, xmm2 +paddw xmm1, dqword [rbx] + +pand xmm1, xmm2 +pand xmm1, dqword [rbx] + +pandn xmm1, xmm2 +pandn xmm1, dqword [rbx] + +pavgb xmm1, xmm2 +pavgb xmm1, dqword [rbx] + +pavgw xmm1, xmm2 +pavgw xmm1, dqword [rbx] + +pcmpeqb xmm1, xmm2 +pcmpeqb xmm1, dqword [rbx] + +pcmpeqd xmm1, xmm2 +pcmpeqd xmm1, dqword [rbx] + +pcmpeqw xmm1, xmm2 +pcmpeqw xmm1, dqword [rbx] + +pcmpgtb xmm1, xmm2 +pcmpgtb xmm1, dqword [rbx] + +pcmpgtd xmm1, xmm2 +pcmpgtd xmm1, dqword [rbx] + +pcmpgtw xmm1, xmm2 +pcmpgtw xmm1, dqword [rbx] + +pextrw ebx, xmm2, byte 0 + +pinsrw xmm1, ebx, byte 0 +pinsrw xmm1, word [rbx], byte 0 + +pmaddwd xmm1, xmm2 +pmaddwd xmm1, dqword [rbx] + +pmaxsw xmm1, xmm2 +pmaxsw xmm1, dqword [rbx] + +pmaxub xmm1, xmm2 +pmaxub xmm1, dqword [rbx] + +pminsw xmm1, xmm2 +pminsw xmm1, dqword [rbx] + +pminub xmm1, xmm2 +pminub xmm1, dqword [rbx] + +pmovmskb eax, xmm2 + +pmulhuw xmm1, xmm2 +pmulhuw xmm1, dqword [rbx] + +pmulhw xmm1, xmm2 +pmulhw xmm1, dqword [rbx] + +pmullw xmm1, xmm2 +pmullw xmm1, dqword [rbx] + +pmuludq xmm1, xmm2 +pmuludq xmm1, dqword [rbx] + +por xmm1, xmm2 +por xmm1, dqword [rbx] + +psadbw xmm1, xmm2 +psadbw xmm1, dqword [rbx] + +pshufd xmm1, xmm2, byte 0 +pshufd xmm1, dqword [rbx], byte 0 + +pshufhw xmm1, xmm2, byte 0 +pshufhw xmm1, dqword [rbx], byte 0 + +pshuflw xmm1, xmm2, byte 0 +pshuflw xmm1, dqword [rbx], byte 0 + +pslld xmm1, xmm2 +pslld xmm1, dqword [rbx] +pslld xmm1, byte 5 + +pslldq xmm1, byte 5 + +psllq xmm1, xmm2 +psllq xmm1, dqword [rbx] +psllq xmm1, byte 5 + +psllw xmm1, xmm2 +psllw xmm1, dqword [rbx] +psllw xmm1, byte 5 + +psrad xmm1, xmm2 +psrad xmm1, dqword [rbx] +psrad xmm1, byte 5 + +psraw xmm1, xmm2 +psraw xmm1, dqword [rbx] +psraw xmm1, byte 5 + +psrld xmm1, xmm2 +psrld xmm1, dqword [rbx] +psrld xmm1, byte 5 + +psrldq xmm1, byte 5 + +psrlq xmm1, xmm2 +psrlq xmm1, dqword [rbx] +psrlq xmm1, byte 5 + +psrlw xmm1, xmm2 +psrlw xmm1, dqword [rbx] +psrlw xmm1, byte 5 + +psubb xmm1, xmm2 +psubb xmm1, dqword [rbx] + +psubd xmm1, xmm2 +psubd xmm1, dqword [rbx] + +psubq xmm1, xmm2 +psubq xmm1, dqword [rbx] + +psubsb xmm1, xmm2 +psubsb xmm1, dqword [rbx] + +psubsw xmm1, xmm2 +psubsw xmm1, dqword [rbx] + +psubusb xmm1, xmm2 +psubusb xmm1, dqword [rbx] + +psubusw xmm1, xmm2 +psubusw xmm1, dqword [rbx] + +psubw xmm1, xmm2 +psubw xmm1, dqword [rbx] + +punpckhbw xmm1, xmm2 +punpckhbw xmm1, dqword [rbx] + +punpckhdq xmm1, xmm2 +punpckhdq xmm1, dqword [rbx] + +punpckhqdq xmm1, xmm2 +punpckhqdq xmm1, dqword [rbx] + +punpckhwd xmm1, xmm2 +punpckhwd xmm1, dqword [rbx] + +punpcklbw xmm1, xmm2 +punpcklbw xmm1, dqword [rbx] + +punpckldq xmm1, xmm2 +punpckldq xmm1, dqword [rbx] + +punpcklqdq xmm1, xmm2 +punpcklqdq xmm1, dqword [rbx] + +punpcklwd xmm1, xmm2 +punpcklwd xmm1, dqword [rbx] + +pxor xmm1, xmm2 +pxor xmm1, dqword [rbx] + +rcpps xmm1, xmm2 +rcpps xmm1, dqword [rbx] + +rcpss xmm1, xmm2 +rcpss xmm1, dword [rbx] + +rsqrtps xmm1, xmm2 +rsqrtps xmm1, dqword [rbx] + +rsqrtss xmm1, xmm2 +rsqrtss xmm1, dword [rbx] + +shufpd xmm1, xmm2, 0 +shufpd xmm1, dqword [rbx], byte 0 + +shufps xmm1, xmm2, 0 +shufps xmm1, dqword [rbx], byte 0 + +sqrtpd xmm1, xmm2 +sqrtpd xmm1, dqword [rbx] + +sqrtps xmm1, xmm2 +sqrtps xmm1, dqword [rbx] + +sqrtsd xmm1, xmm2 +sqrtsd xmm1, qword [rbx] + +sqrtss xmm1, xmm2 +sqrtss xmm1, dword [rbx] + +stmxcsr dword [rbx] + +subpd xmm1, xmm2 +subpd xmm1, dqword [rbx] + +subps xmm1, xmm2 +subps xmm1, dqword [rbx] + +subsd xmm1, xmm2 +subsd xmm1, qword [rbx] + +subss xmm1, xmm2 +subss xmm1, dword [rbx] + +ucomisd xmm1, xmm2 +ucomisd xmm1, qword [rbx] + +ucomiss xmm1, xmm2 +ucomiss xmm1, dword [rbx] + +unpckhpd xmm1, xmm2 +unpckhpd xmm1, dqword [rbx] + +unpckhps xmm1, xmm2 +unpckhps xmm1, dqword [rbx] + +unpcklpd xmm1, xmm2 +unpcklpd xmm1, dqword [rbx] + +unpcklps xmm1, xmm2 +unpcklps xmm1, dqword [rbx] + +xorpd xmm1, xmm2 +xorpd xmm1, dqword [rbx] + +xorps xmm1, xmm2 +xorps xmm1, dqword [rbx] + diff --git a/modules/arch/x86/tests/ssewidth.hex b/modules/arch/x86/tests/ssewidth.hex new file mode 100644 index 00000000..fc24e8da --- /dev/null +++ b/modules/arch/x86/tests/ssewidth.hex @@ -0,0 +1,1532 @@ +66 +0f +58 +ca +66 +0f +58 +0b +0f +58 +ca +0f +58 +0b +f2 +0f +58 +ca +f2 +0f +58 +0b +f3 +0f +58 +ca +f3 +0f +58 +0b +66 +0f +d0 +ca +66 +0f +d0 +0b +f2 +0f +d0 +ca +f2 +0f +d0 +0b +66 +0f +55 +ca +66 +0f +55 +0b +0f +55 +ca +0f +55 +0b +66 +0f +54 +ca +66 +0f +54 +0b +0f +54 +ca +0f +54 +0b +66 +0f +c2 +ca +00 +66 +0f +c2 +0b +00 +66 +0f +c2 +ca +00 +66 +0f +c2 +0b +00 +0f +c2 +ca +00 +0f +c2 +0b +00 +0f +c2 +ca +00 +0f +c2 +0b +00 +f2 +0f +c2 +ca +00 +f2 +0f +c2 +0b +00 +f2 +0f +c2 +ca +00 +f2 +0f +c2 +0b +00 +f3 +0f +c2 +ca +00 +f3 +0f +c2 +0b +00 +f3 +0f +c2 +ca +00 +f3 +0f +c2 +0b +00 +66 +0f +2f +ca +66 +0f +2f +0b +0f +2f +ca +0f +2f +0b +f3 +0f +e6 +ca +f3 +0f +e6 +0b +0f +5b +ca +0f +5b +0b +f2 +0f +e6 +ca +f2 +0f +e6 +0b +66 +0f +2d +ca +66 +0f +2d +0b +66 +0f +5a +ca +66 +0f +5a +0b +66 +0f +2a +ca +66 +0f +2a +0b +0f +2a +ca +0f +2a +0b +66 +0f +5b +ca +66 +0f +5b +0b +0f +5a +ca +0f +5a +0b +0f +2d +ca +0f +2d +0b +f2 +48 +0f +2d +da +f2 +48 +0f +2d +1b +f2 +0f +5a +ca +f2 +0f +5a +0b +f2 +0f +2a +cb +f2 +0f +2a +0b +f2 +48 +0f +2a +cb +f2 +48 +0f +2a +0b +f3 +0f +2a +cb +f3 +0f +2a +0b +f3 +48 +0f +2a +cb +f3 +48 +0f +2a +0b +f3 +0f +5a +ca +f3 +0f +5a +0b +f3 +0f +2d +da +f3 +0f +2d +1b +f3 +48 +0f +2d +da +f3 +48 +0f +2d +1b +66 +0f +e6 +ca +66 +0f +e6 +0b +66 +0f +2c +ca +66 +0f +2c +0b +f3 +0f +5b +ca +f3 +0f +5b +0b +0f +2c +ca +0f +2c +0b +f2 +0f +2c +c1 +f2 +0f +2c +03 +f2 +48 +0f +2c +c1 +f2 +48 +0f +2c +03 +f3 +0f +2c +c1 +f3 +0f +2c +03 +f3 +48 +0f +2c +c1 +f3 +48 +0f +2c +03 +66 +0f +5e +ca +66 +0f +5e +0b +0f +5e +ca +0f +5e +0b +f2 +0f +5e +ca +f2 +0f +5e +0b +f3 +0f +5e +ca +f3 +0f +5e +0b +66 +0f +78 +c1 +00 +01 +66 +0f +78 +c1 +00 +01 +66 +0f +79 +ca +66 +0f +7c +ca +66 +0f +7c +0b +f2 +0f +7c +ca +f2 +0f +7c +0b +66 +0f +7d +ca +66 +0f +7d +0b +f2 +0f +7d +ca +f2 +0f +7d +0b +f2 +0f +78 +ca +00 +01 +f2 +0f +78 +ca +00 +01 +f2 +0f +79 +ca +f2 +0f +f0 +0b +0f +ae +13 +66 +0f +f7 +ca +66 +0f +5f +ca +66 +0f +5f +0b +0f +5f +ca +0f +5f +0b +f2 +0f +5f +ca +f2 +0f +5f +0b +f3 +0f +5f +ca +f3 +0f +5f +0b +66 +0f +5d +ca +66 +0f +5d +0b +0f +5d +ca +0f +5d +0b +f2 +0f +5d +ca +f2 +0f +5d +0b +f3 +0f +5d +ca +f3 +0f +5d +0b +66 +0f +28 +ca +66 +0f +28 +0b +66 +0f +29 +13 +0f +28 +ca +0f +28 +0b +0f +29 +13 +66 +0f +6e +cb +66 +0f +6e +0b +66 +48 +0f +6e +cb +66 +48 +0f +6e +0b +66 +0f +7e +13 +66 +48 +0f +7e +13 +f2 +0f +12 +ca +f2 +0f +12 +0b +f2 +0f +d6 +ca +66 +0f +6f +ca +66 +0f +6f +0b +66 +0f +7f +13 +f3 +0f +6f +ca +f3 +0f +6f +0b +f3 +0f +7f +13 +0f +12 +ca +66 +0f +16 +0b +66 +0f +17 +13 +0f +16 +0b +0f +17 +13 +0f +16 +ca +66 +0f +12 +0b +66 +0f +13 +13 +0f +12 +0b +0f +13 +13 +66 +0f +50 +da +0f +50 +da +66 +0f +e7 +13 +66 +0f +2b +13 +0f +2b +13 +f2 +0f +2b +13 +f3 +0f +2b +13 +f3 +0f +7e +ca +f3 +0f +7e +0b +66 +0f +d6 +13 +f3 +0f +d6 +ca +f2 +0f +10 +ca +f2 +0f +10 +0b +f2 +0f +11 +13 +f3 +0f +16 +ca +f3 +0f +16 +0b +f3 +0f +12 +ca +f3 +0f +12 +0b +f3 +0f +10 +ca +f3 +0f +10 +0b +f3 +0f +11 +13 +66 +0f +10 +ca +66 +0f +10 +0b +66 +0f +11 +13 +0f +10 +ca +0f +10 +0b +0f +11 +13 +66 +0f +59 +ca +66 +0f +59 +0b +0f +59 +ca +0f +59 +0b +f2 +0f +59 +ca +f2 +0f +59 +0b +f3 +0f +59 +ca +f3 +0f +59 +0b +66 +0f +56 +ca +66 +0f +56 +0b +0f +56 +ca +0f +56 +0b +66 +0f +6b +ca +66 +0f +6b +0b +66 +0f +63 +ca +66 +0f +63 +0b +66 +0f +67 +ca +66 +0f +67 +0b +66 +0f +fc +ca +66 +0f +fc +0b +66 +0f +fe +ca +66 +0f +fe +0b +66 +0f +d4 +ca +66 +0f +d4 +0b +66 +0f +ec +ca +66 +0f +ec +0b +66 +0f +ed +ca +66 +0f +ed +0b +66 +0f +dc +ca +66 +0f +dc +0b +66 +0f +dd +ca +66 +0f +dd +0b +66 +0f +fd +ca +66 +0f +fd +0b +66 +0f +db +ca +66 +0f +db +0b +66 +0f +df +ca +66 +0f +df +0b +66 +0f +e0 +ca +66 +0f +e0 +0b +66 +0f +e3 +ca +66 +0f +e3 +0b +66 +0f +74 +ca +66 +0f +74 +0b +66 +0f +76 +ca +66 +0f +76 +0b +66 +0f +75 +ca +66 +0f +75 +0b +66 +0f +64 +ca +66 +0f +64 +0b +66 +0f +66 +ca +66 +0f +66 +0b +66 +0f +65 +ca +66 +0f +65 +0b +66 +0f +c5 +da +00 +66 +0f +c4 +cb +00 +66 +0f +c4 +0b +00 +66 +0f +f5 +ca +66 +0f +f5 +0b +66 +0f +ee +ca +66 +0f +ee +0b +66 +0f +de +ca +66 +0f +de +0b +66 +0f +ea +ca +66 +0f +ea +0b +66 +0f +da +ca +66 +0f +da +0b +66 +0f +d7 +c2 +66 +0f +e4 +ca +66 +0f +e4 +0b +66 +0f +e5 +ca +66 +0f +e5 +0b +66 +0f +d5 +ca +66 +0f +d5 +0b +66 +0f +f4 +ca +66 +0f +f4 +0b +66 +0f +eb +ca +66 +0f +eb +0b +66 +0f +f6 +ca +66 +0f +f6 +0b +66 +0f +70 +ca +00 +66 +0f +70 +0b +00 +f3 +0f +70 +ca +00 +f3 +0f +70 +0b +00 +f2 +0f +70 +ca +00 +f2 +0f +70 +0b +00 +66 +0f +f2 +ca +66 +0f +f2 +0b +66 +0f +72 +f1 +05 +66 +0f +73 +f9 +05 +66 +0f +f3 +ca +66 +0f +f3 +0b +66 +0f +73 +f1 +05 +66 +0f +f1 +ca +66 +0f +f1 +0b +66 +0f +71 +f1 +05 +66 +0f +e2 +ca +66 +0f +e2 +0b +66 +0f +72 +e1 +05 +66 +0f +e1 +ca +66 +0f +e1 +0b +66 +0f +71 +e1 +05 +66 +0f +d2 +ca +66 +0f +d2 +0b +66 +0f +72 +d1 +05 +66 +0f +73 +d9 +05 +66 +0f +d3 +ca +66 +0f +d3 +0b +66 +0f +73 +d1 +05 +66 +0f +d1 +ca +66 +0f +d1 +0b +66 +0f +71 +d1 +05 +66 +0f +f8 +ca +66 +0f +f8 +0b +66 +0f +fa +ca +66 +0f +fa +0b +66 +0f +fb +ca +66 +0f +fb +0b +66 +0f +e8 +ca +66 +0f +e8 +0b +66 +0f +e9 +ca +66 +0f +e9 +0b +66 +0f +d8 +ca +66 +0f +d8 +0b +66 +0f +d9 +ca +66 +0f +d9 +0b +66 +0f +f9 +ca +66 +0f +f9 +0b +66 +0f +68 +ca +66 +0f +68 +0b +66 +0f +6a +ca +66 +0f +6a +0b +66 +0f +6d +ca +66 +0f +6d +0b +66 +0f +69 +ca +66 +0f +69 +0b +66 +0f +60 +ca +66 +0f +60 +0b +66 +0f +62 +ca +66 +0f +62 +0b +66 +0f +6c +ca +66 +0f +6c +0b +66 +0f +61 +ca +66 +0f +61 +0b +66 +0f +ef +ca +66 +0f +ef +0b +0f +53 +ca +0f +53 +0b +f3 +0f +53 +ca +f3 +0f +53 +0b +0f +52 +ca +0f +52 +0b +f3 +0f +52 +ca +f3 +0f +52 +0b +66 +0f +c6 +ca +00 +66 +0f +c6 +0b +00 +0f +c6 +ca +00 +0f +c6 +0b +00 +66 +0f +51 +ca +66 +0f +51 +0b +0f +51 +ca +0f +51 +0b +f2 +0f +51 +ca +f2 +0f +51 +0b +f3 +0f +51 +ca +f3 +0f +51 +0b +0f +ae +1b +66 +0f +5c +ca +66 +0f +5c +0b +0f +5c +ca +0f +5c +0b +f2 +0f +5c +ca +f2 +0f +5c +0b +f3 +0f +5c +ca +f3 +0f +5c +0b +66 +0f +2e +ca +66 +0f +2e +0b +0f +2e +ca +0f +2e +0b +66 +0f +15 +ca +66 +0f +15 +0b +0f +15 +ca +0f +15 +0b +66 +0f +14 +ca +66 +0f +14 +0b +0f +14 +ca +0f +14 +0b +66 +0f +57 +ca +66 +0f +57 +0b +0f +57 +ca +0f +57 +0b From 760904a07104451ca1993753c60985a80a55c58c Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 28 Nov 2007 07:25:59 +0000 Subject: [PATCH 124/585] Fix internal error for usage of numeric segments in certain memory addresses (e.g. "jmp far [0:0]"). Reported by: arkon@ragestorm.net svn path=/trunk/yasm/; revision=2016 --- modules/arch/x86/tests/Makefile.inc | 2 ++ modules/arch/x86/tests/segoff.asm | 12 ++++++++++++ modules/arch/x86/tests/segoff.hex | 30 +++++++++++++++++++++++++++++ modules/arch/x86/x86expr.c | 5 +++++ 4 files changed, 49 insertions(+) create mode 100644 modules/arch/x86/tests/segoff.asm create mode 100644 modules/arch/x86/tests/segoff.hex diff --git a/modules/arch/x86/tests/Makefile.inc b/modules/arch/x86/tests/Makefile.inc index ee1b4c81..c9093246 100644 --- a/modules/arch/x86/tests/Makefile.inc +++ b/modules/arch/x86/tests/Makefile.inc @@ -139,6 +139,8 @@ EXTRA_DIST += modules/arch/x86/tests/ripseg.errwarn EXTRA_DIST += modules/arch/x86/tests/ripseg.hex EXTRA_DIST += modules/arch/x86/tests/segmov.asm EXTRA_DIST += modules/arch/x86/tests/segmov.hex +EXTRA_DIST += modules/arch/x86/tests/segoff.asm +EXTRA_DIST += modules/arch/x86/tests/segoff.hex EXTRA_DIST += modules/arch/x86/tests/shift.asm EXTRA_DIST += modules/arch/x86/tests/shift.hex EXTRA_DIST += modules/arch/x86/tests/simd-1.asm diff --git a/modules/arch/x86/tests/segoff.asm b/modules/arch/x86/tests/segoff.asm new file mode 100644 index 00000000..987a7cf3 --- /dev/null +++ b/modules/arch/x86/tests/segoff.asm @@ -0,0 +1,12 @@ +; all of these should be legal and should just result in the offset portion + +jmp far[1:2] +mov ax,[1:2] +push dword [1:2] +mov ax,1:2 + +foo equ 1:2 +jmp far[foo] +mov ax,[foo] +push dword [foo] +mov ax,foo diff --git a/modules/arch/x86/tests/segoff.hex b/modules/arch/x86/tests/segoff.hex new file mode 100644 index 00000000..b83919ad --- /dev/null +++ b/modules/arch/x86/tests/segoff.hex @@ -0,0 +1,30 @@ +ff +2e +02 +00 +a1 +02 +00 +66 +ff +36 +02 +00 +b8 +02 +00 +ff +2e +02 +00 +a1 +02 +00 +66 +ff +36 +02 +00 +b8 +02 +00 diff --git a/modules/arch/x86/x86expr.c b/modules/arch/x86/x86expr.c index 6358bff1..f7ace08a 100644 --- a/modules/arch/x86/x86expr.c +++ b/modules/arch/x86/x86expr.c @@ -375,6 +375,11 @@ x86_expr_checkea_getregusage(yasm_expr **ep, /*@null@*/ int *indexreg, *indexreg = regnum; } break; + case YASM_EXPR_SEGOFF: + /* No registers are allowed on either side. */ + if (yasm_expr__contains(e, YASM_EXPR_REG)) + return 1; + break; default: /* Should never get here! */ yasm_internal_error(N_("unexpected expr op")); From ddf78e19b5c3c44c05e0ff0d43656eaea0184c3d Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 4 Dec 2007 04:59:07 +0000 Subject: [PATCH 125/585] Fix #127: Allow use of 0X in addition to 0x for hex constants. svn path=/trunk/yasm/; revision=2017 --- modules/parsers/nasm/nasm-token.re | 4 ++-- modules/parsers/nasm/tests/Makefile.inc | 2 ++ modules/parsers/nasm/tests/hexconst.asm | 2 ++ modules/parsers/nasm/tests/hexconst.hex | 8 ++++++++ 4 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 modules/parsers/nasm/tests/hexconst.asm create mode 100644 modules/parsers/nasm/tests/hexconst.hex diff --git a/modules/parsers/nasm/nasm-token.re b/modules/parsers/nasm/nasm-token.re index cbf9fb0f..8d385e50 100644 --- a/modules/parsers/nasm/nasm-token.re +++ b/modules/parsers/nasm/nasm-token.re @@ -144,10 +144,10 @@ scan: } /* $0AA and 0xAA forms of hexidecimal number */ - (("$" digit) | "0x") hexdigit+ { + (("$" digit) | '0x') hexdigit+ { savech = s->tok[TOKLEN]; s->tok[TOKLEN] = '\0'; - if (s->tok[1] == 'x') + if (s->tok[1] == 'x' || s->tok[1] == 'X') /* skip 0 and x */ lvalp->intn = yasm_intnum_create_hex(TOK+2); else diff --git a/modules/parsers/nasm/tests/Makefile.inc b/modules/parsers/nasm/tests/Makefile.inc index 552320cc..8ec457b4 100644 --- a/modules/parsers/nasm/tests/Makefile.inc +++ b/modules/parsers/nasm/tests/Makefile.inc @@ -15,6 +15,8 @@ EXTRA_DIST += modules/parsers/nasm/tests/equcolon.asm EXTRA_DIST += modules/parsers/nasm/tests/equcolon.hex EXTRA_DIST += modules/parsers/nasm/tests/equlocal.asm EXTRA_DIST += modules/parsers/nasm/tests/equlocal.hex +EXTRA_DIST += modules/parsers/nasm/tests/hexconst.asm +EXTRA_DIST += modules/parsers/nasm/tests/hexconst.hex EXTRA_DIST += modules/parsers/nasm/tests/long.asm EXTRA_DIST += modules/parsers/nasm/tests/long.hex EXTRA_DIST += modules/parsers/nasm/tests/newsect.asm diff --git a/modules/parsers/nasm/tests/hexconst.asm b/modules/parsers/nasm/tests/hexconst.asm new file mode 100644 index 00000000..a0039b02 --- /dev/null +++ b/modules/parsers/nasm/tests/hexconst.asm @@ -0,0 +1,2 @@ +dd 0x500 +dd 0X500 diff --git a/modules/parsers/nasm/tests/hexconst.hex b/modules/parsers/nasm/tests/hexconst.hex new file mode 100644 index 00000000..90a00fe9 --- /dev/null +++ b/modules/parsers/nasm/tests/hexconst.hex @@ -0,0 +1,8 @@ +00 +05 +00 +00 +00 +05 +00 +00 From f938cbd21d4df71780620d620b79dfe4ae353928 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 4 Dec 2007 05:58:54 +0000 Subject: [PATCH 126/585] Fix #124: Fully simplify out sym-sym in values (e.g. a symbol minus itself). This could particularly cause false errors if sym is external. svn path=/trunk/yasm/; revision=2018 --- libyasm/tests/Makefile.inc | 3 +++ libyasm/tests/value-samesym.asm | 2 ++ libyasm/tests/value-samesym.errwarn | 1 + libyasm/tests/value-samesym.hex | 8 ++++++++ libyasm/value.c | 23 +++++++++++++++++++++++ 5 files changed, 37 insertions(+) create mode 100644 libyasm/tests/value-samesym.asm create mode 100644 libyasm/tests/value-samesym.errwarn create mode 100644 libyasm/tests/value-samesym.hex diff --git a/libyasm/tests/Makefile.inc b/libyasm/tests/Makefile.inc index e0e3d951..4b9eb1d6 100644 --- a/libyasm/tests/Makefile.inc +++ b/libyasm/tests/Makefile.inc @@ -75,6 +75,9 @@ EXTRA_DIST += libyasm/tests/unary.asm EXTRA_DIST += libyasm/tests/unary.hex EXTRA_DIST += libyasm/tests/value-err.asm EXTRA_DIST += libyasm/tests/value-err.errwarn +EXTRA_DIST += libyasm/tests/value-samesym.asm +EXTRA_DIST += libyasm/tests/value-samesym.errwarn +EXTRA_DIST += libyasm/tests/value-samesym.hex check_PROGRAMS += bitvect_test check_PROGRAMS += floatnum_test diff --git a/libyasm/tests/value-samesym.asm b/libyasm/tests/value-samesym.asm new file mode 100644 index 00000000..da325992 --- /dev/null +++ b/libyasm/tests/value-samesym.asm @@ -0,0 +1,2 @@ +extern RW +mov [eax + (RW + 22032) - (RW + 23056)], eax diff --git a/libyasm/tests/value-samesym.errwarn b/libyasm/tests/value-samesym.errwarn new file mode 100644 index 00000000..58c850b3 --- /dev/null +++ b/libyasm/tests/value-samesym.errwarn @@ -0,0 +1 @@ +-:1: warning: binary object format does not support extern variables diff --git a/libyasm/tests/value-samesym.hex b/libyasm/tests/value-samesym.hex new file mode 100644 index 00000000..4bab16b8 --- /dev/null +++ b/libyasm/tests/value-samesym.hex @@ -0,0 +1,8 @@ +67 +66 +89 +80 +00 +fc +ff +ff diff --git a/libyasm/value.c b/libyasm/value.c index e3eda5fd..74b793bc 100644 --- a/libyasm/value.c +++ b/libyasm/value.c @@ -208,6 +208,29 @@ value_finalize_scan(yasm_value *value, yasm_expr *e, continue; } + /* Look for the same symrec term; even if both are external, + * they should cancel out. + */ + for (j=0; jnumterms; j++) { + if (e->terms[j].type == YASM_EXPR_SYM + && e->terms[j].data.sym == sym + && (used & (1<terms[i].type = YASM_EXPR_INT; + e->terms[i].data.intn = yasm_intnum_create_uint(0); + e->terms[j].type = YASM_EXPR_INT; + e->terms[j].data.intn = yasm_intnum_create_uint(0); + + break; /* stop looking */ + } + } + if (j != e->numterms) + continue; + if (!yasm_symrec_get_label(sym, &precbc)) { if (value_finalize_scan(value, sube, expr_precbc, ssym_not_ok)) From 02075ed7ca03e83c032feaed280be673e2cdf86f Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 4 Dec 2007 06:19:07 +0000 Subject: [PATCH 127/585] Fix #123: Be explicit that errors are such by printing "error:" at beginning of error messages. svn path=/trunk/yasm/; revision=2019 --- frontends/yasm/yasm.c | 9 +- libyasm/tests/absloop-err.errwarn | 2 +- libyasm/tests/duplabel-err.errwarn | 8 +- libyasm/tests/jmpsize1-err.errwarn | 4 +- libyasm/tests/opt-circular1-err.errwarn | 2 +- libyasm/tests/opt-circular2-err.errwarn | 2 +- libyasm/tests/opt-circular3-err.errwarn | 2 +- libyasm/tests/reserve-err1.errwarn | 4 +- libyasm/tests/reserve-err2.errwarn | 12 +- libyasm/tests/timesover-err.errwarn | 2 +- libyasm/tests/value-err.errwarn | 6 +- modules/arch/lc3b/tests/lc3b-ea-err.errwarn | 2 +- modules/arch/x86/tests/addrop-err.errwarn | 2 +- modules/arch/x86/tests/cpubasic-err.errwarn | 6 +- modules/arch/x86/tests/div-err.errwarn | 8 +- modules/arch/x86/tests/lds-err.errwarn | 8 +- modules/arch/x86/tests/mem64-err.errwarn | 10 +- modules/arch/x86/tests/nomem64-err.errwarn | 16 +- modules/arch/x86/tests/nomem64-err2.errwarn | 4 +- modules/arch/x86/tests/opsize-err.errwarn | 2 +- modules/arch/x86/tests/pushf-err.errwarn | 12 +- modules/arch/x86/tests/sse4-err.errwarn | 4 +- modules/arch/x86/tests/sse5-err.errwarn | 168 +++++++++--------- modules/arch/x86/tests/strict-err.errwarn | 8 +- modules/arch/x86/tests/vmx-err.errwarn | 4 +- .../dwarf2/tests/pass32/dwarf32-err.errwarn | 38 ++-- modules/objfmts/bin/tests/float-err.errwarn | 4 +- .../tests/multisect/follows-loop1-err.errwarn | 2 +- .../tests/multisect/follows-loop2-err.errwarn | 2 +- .../multisect/follows-notfound-err.errwarn | 2 +- .../multisect/vfollows-loop1-err.errwarn | 2 +- .../multisect/vfollows-loop2-err.errwarn | 2 +- .../multisect/vfollows-notfound-err.errwarn | 2 +- modules/objfmts/elf/tests/curpos-err.errwarn | 4 +- .../tests/nasm64/macho-reloc64-err.errwarn | 16 +- modules/objfmts/win64/tests/sce1-err.errwarn | 16 +- modules/objfmts/win64/tests/sce2-err.errwarn | 4 +- modules/objfmts/win64/tests/sce4-err.errwarn | 18 +- modules/objfmts/xdf/tests/xdfsect-err.errwarn | 18 +- .../parsers/gas/tests/bin/rept-err.errwarn | 2 +- .../gas/tests/bin/reptnested-err.errwarn | 14 +- .../parsers/gas/tests/gas-line-err.errwarn | 12 +- .../parsers/gas/tests/gas-line2-err.errwarn | 6 +- .../parsers/gas/tests/reggroup-err.errwarn | 2 +- .../nasm/tests/ifcritical-err.errwarn | 2 +- 45 files changed, 238 insertions(+), 237 deletions(-) diff --git a/frontends/yasm/yasm.c b/frontends/yasm/yasm.c index 83d05241..475d2ba8 100644 --- a/frontends/yasm/yasm.c +++ b/frontends/yasm/yasm.c @@ -1272,16 +1272,17 @@ print_yasm_error(const char *filename, unsigned long line, const char *msg, const char *xref_msg) { if (line) - fprintf(errfile, fmt[ewmsg_style], filename, line, "", msg); + fprintf(errfile, fmt[ewmsg_style], filename, line, _("error: "), msg); else - fprintf(errfile, fmt_noline[ewmsg_style], filename, "", msg); + fprintf(errfile, fmt_noline[ewmsg_style], filename, _("error: "), msg); if (xref_fn && xref_msg) { if (xref_line) - fprintf(errfile, fmt[ewmsg_style], xref_fn, xref_line, "", + fprintf(errfile, fmt[ewmsg_style], xref_fn, xref_line, _("error: "), xref_msg); else - fprintf(errfile, fmt_noline[ewmsg_style], xref_fn, "", xref_msg); + fprintf(errfile, fmt_noline[ewmsg_style], xref_fn, _("error: "), + xref_msg); } } diff --git a/libyasm/tests/absloop-err.errwarn b/libyasm/tests/absloop-err.errwarn index 79983393..29d3a334 100644 --- a/libyasm/tests/absloop-err.errwarn +++ b/libyasm/tests/absloop-err.errwarn @@ -1 +1 @@ --:6: circular reference detected in memory expression +-:6: error: circular reference detected in memory expression diff --git a/libyasm/tests/duplabel-err.errwarn b/libyasm/tests/duplabel-err.errwarn index 69014ad8..4ce13bff 100644 --- a/libyasm/tests/duplabel-err.errwarn +++ b/libyasm/tests/duplabel-err.errwarn @@ -1,4 +1,4 @@ --:16: redefinition of `label' --:12: `label' previously defined here --:18: redefinition of `label' --:12: `label' previously defined here +-:16: error: redefinition of `label' +-:12: error: `label' previously defined here +-:18: error: redefinition of `label' +-:12: error: `label' previously defined here diff --git a/libyasm/tests/jmpsize1-err.errwarn b/libyasm/tests/jmpsize1-err.errwarn index 9b821acc..276b1eb8 100644 --- a/libyasm/tests/jmpsize1-err.errwarn +++ b/libyasm/tests/jmpsize1-err.errwarn @@ -1,2 +1,2 @@ --:132: short jump out of range --:263: short jump out of range +-:132: error: short jump out of range +-:263: error: short jump out of range diff --git a/libyasm/tests/opt-circular1-err.errwarn b/libyasm/tests/opt-circular1-err.errwarn index b26f47ad..9b09e1c5 100644 --- a/libyasm/tests/opt-circular1-err.errwarn +++ b/libyasm/tests/opt-circular1-err.errwarn @@ -1 +1 @@ --:1: circular reference detected +-:1: error: circular reference detected diff --git a/libyasm/tests/opt-circular2-err.errwarn b/libyasm/tests/opt-circular2-err.errwarn index b26f47ad..9b09e1c5 100644 --- a/libyasm/tests/opt-circular2-err.errwarn +++ b/libyasm/tests/opt-circular2-err.errwarn @@ -1 +1 @@ --:1: circular reference detected +-:1: error: circular reference detected diff --git a/libyasm/tests/opt-circular3-err.errwarn b/libyasm/tests/opt-circular3-err.errwarn index bf1d3fa2..041cbba2 100644 --- a/libyasm/tests/opt-circular3-err.errwarn +++ b/libyasm/tests/opt-circular3-err.errwarn @@ -1 +1 @@ --:6: circular reference detected +-:6: error: circular reference detected diff --git a/libyasm/tests/reserve-err1.errwarn b/libyasm/tests/reserve-err1.errwarn index e3da650a..e53fe3c7 100644 --- a/libyasm/tests/reserve-err1.errwarn +++ b/libyasm/tests/reserve-err1.errwarn @@ -1,2 +1,2 @@ --:7: multiple expression not absolute --:14: multiple expression not absolute +-:7: error: multiple expression not absolute +-:14: error: multiple expression not absolute diff --git a/libyasm/tests/reserve-err2.errwarn b/libyasm/tests/reserve-err2.errwarn index 44c5efa9..d3fbbabb 100644 --- a/libyasm/tests/reserve-err2.errwarn +++ b/libyasm/tests/reserve-err2.errwarn @@ -1,6 +1,6 @@ --:3: multiple is negative --:4: expression must not contain floating point value --:5: expression must not contain floating point value --:10: multiple is negative --:11: expression must not contain floating point value --:12: expression must not contain floating point value +-:3: error: multiple is negative +-:4: error: expression must not contain floating point value +-:5: error: expression must not contain floating point value +-:10: error: multiple is negative +-:11: error: expression must not contain floating point value +-:12: error: expression must not contain floating point value diff --git a/libyasm/tests/timesover-err.errwarn b/libyasm/tests/timesover-err.errwarn index c972a1d9..81441ac3 100644 --- a/libyasm/tests/timesover-err.errwarn +++ b/libyasm/tests/timesover-err.errwarn @@ -1 +1 @@ --:2: multiple is negative +-:2: error: multiple is negative diff --git a/libyasm/tests/value-err.errwarn b/libyasm/tests/value-err.errwarn index a7535524..a949cd85 100644 --- a/libyasm/tests/value-err.errwarn +++ b/libyasm/tests/value-err.errwarn @@ -1,3 +1,3 @@ --:2: effective address too complex --:3: immediate expression too complex --:8: data expression too complex +-:2: error: effective address too complex +-:3: error: immediate expression too complex +-:8: error: data expression too complex diff --git a/modules/arch/lc3b/tests/lc3b-ea-err.errwarn b/modules/arch/lc3b/tests/lc3b-ea-err.errwarn index afc28697..e49df726 100644 --- a/modules/arch/lc3b/tests/lc3b-ea-err.errwarn +++ b/modules/arch/lc3b/tests/lc3b-ea-err.errwarn @@ -1 +1 @@ --:1: invalid combination of opcode and operands +-:1: error: invalid combination of opcode and operands diff --git a/modules/arch/x86/tests/addrop-err.errwarn b/modules/arch/x86/tests/addrop-err.errwarn index 72040ee7..0bf0b548 100644 --- a/modules/arch/x86/tests/addrop-err.errwarn +++ b/modules/arch/x86/tests/addrop-err.errwarn @@ -1 +1 @@ --:2: invalid effective address (displacement size) +-:2: error: invalid effective address (displacement size) diff --git a/modules/arch/x86/tests/cpubasic-err.errwarn b/modules/arch/x86/tests/cpubasic-err.errwarn index 917843e5..3c2b876c 100644 --- a/modules/arch/x86/tests/cpubasic-err.errwarn +++ b/modules/arch/x86/tests/cpubasic-err.errwarn @@ -1,6 +1,6 @@ -:2: warning: `pause' is an instruction in CPU P4 --:4: requires CPU 186 +-:4: error: requires CPU 186 -:7: warning: `fninit' is an instruction in CPU FPU --:15: requires CPU 186 +-:15: error: requires CPU 186 -:16: warning: `movsd' is an instruction in CPU 386 --:17: requires CPU 186 +-:17: error: requires CPU 186 diff --git a/modules/arch/x86/tests/div-err.errwarn b/modules/arch/x86/tests/div-err.errwarn index 4b6340e7..af466252 100644 --- a/modules/arch/x86/tests/div-err.errwarn +++ b/modules/arch/x86/tests/div-err.errwarn @@ -1,4 +1,4 @@ --:1: cannot override register size --:3: cannot override register size --:4: cannot override register size --:5: cannot override register size +-:1: error: cannot override register size +-:3: error: cannot override register size +-:4: error: cannot override register size +-:5: error: cannot override register size diff --git a/modules/arch/x86/tests/lds-err.errwarn b/modules/arch/x86/tests/lds-err.errwarn index cd07464a..e29dc728 100644 --- a/modules/arch/x86/tests/lds-err.errwarn +++ b/modules/arch/x86/tests/lds-err.errwarn @@ -1,4 +1,4 @@ --:2: invalid size for operand 2 --:3: invalid size for operand 2 --:5: invalid size for operand 2 --:6: invalid size for operand 2 +-:2: error: invalid size for operand 2 +-:3: error: invalid size for operand 2 +-:5: error: invalid size for operand 2 +-:6: error: invalid size for operand 2 diff --git a/modules/arch/x86/tests/mem64-err.errwarn b/modules/arch/x86/tests/mem64-err.errwarn index c9b1943d..6f37650d 100644 --- a/modules/arch/x86/tests/mem64-err.errwarn +++ b/modules/arch/x86/tests/mem64-err.errwarn @@ -1,5 +1,5 @@ --:2: 16-bit addresses not supported in 64-bit mode --:4: 16-bit addresses not supported in 64-bit mode --:5: invalid effective address --:6: invalid effective address --:7: cannot use A/B/C/DH with instruction needing REX +-:2: error: 16-bit addresses not supported in 64-bit mode +-:4: error: 16-bit addresses not supported in 64-bit mode +-:5: error: invalid effective address +-:6: error: invalid effective address +-:7: error: cannot use A/B/C/DH with instruction needing REX diff --git a/modules/arch/x86/tests/nomem64-err.errwarn b/modules/arch/x86/tests/nomem64-err.errwarn index 2694d2fb..73bfcf97 100644 --- a/modules/arch/x86/tests/nomem64-err.errwarn +++ b/modules/arch/x86/tests/nomem64-err.errwarn @@ -1,12 +1,12 @@ -:2: warning: `es' segment register ignored in 64-bit mode --:4: `pushaw' invalid in 64-bit mode --:5: `popa' invalid in 64-bit mode --:6: `lds' invalid in 64-bit mode --:7: `aas' invalid in 64-bit mode --:8: `das' invalid in 64-bit mode --:9: `aad' invalid in 64-bit mode --:10: `into' invalid in 64-bit mode --:11: `salc' invalid in 64-bit mode +-:4: error: `pushaw' invalid in 64-bit mode +-:5: error: `popa' invalid in 64-bit mode +-:6: error: `lds' invalid in 64-bit mode +-:7: error: `aas' invalid in 64-bit mode +-:8: error: `das' invalid in 64-bit mode +-:9: error: `aad' invalid in 64-bit mode +-:10: error: `into' invalid in 64-bit mode +-:11: error: `salc' invalid in 64-bit mode -:13: warning: `xmm9' is a register in 64-bit mode -:14: warning: `rax' is a register in 64-bit mode -:15: warning: `rdx' is a register in 64-bit mode diff --git a/modules/arch/x86/tests/nomem64-err2.errwarn b/modules/arch/x86/tests/nomem64-err2.errwarn index b26a14d1..8a785392 100644 --- a/modules/arch/x86/tests/nomem64-err2.errwarn +++ b/modules/arch/x86/tests/nomem64-err2.errwarn @@ -1,2 +1,2 @@ --:2: cannot use A/B/C/DH with instruction needing REX --:3: cannot use A/B/C/DH with instruction needing REX +-:2: error: cannot use A/B/C/DH with instruction needing REX +-:3: error: cannot use A/B/C/DH with instruction needing REX diff --git a/modules/arch/x86/tests/opsize-err.errwarn b/modules/arch/x86/tests/opsize-err.errwarn index da7bf083..f515f51e 100644 --- a/modules/arch/x86/tests/opsize-err.errwarn +++ b/modules/arch/x86/tests/opsize-err.errwarn @@ -1 +1 @@ --:3: invalid size for operand 2 +-:3: error: invalid size for operand 2 diff --git a/modules/arch/x86/tests/pushf-err.errwarn b/modules/arch/x86/tests/pushf-err.errwarn index 79f3177a..498610ba 100644 --- a/modules/arch/x86/tests/pushf-err.errwarn +++ b/modules/arch/x86/tests/pushf-err.errwarn @@ -1,10 +1,10 @@ -:5: warning: `pushfq' is an instruction in 64-bit mode -:9: warning: `popfq' is an instruction in 64-bit mode -:15: warning: `pushfq' is an instruction in 64-bit mode --:15: redefinition of `pushfq' --:5: `pushfq' previously defined here +-:15: error: redefinition of `pushfq' +-:5: error: `pushfq' previously defined here -:19: warning: `popfq' is an instruction in 64-bit mode --:19: redefinition of `popfq' --:9: `popfq' previously defined here --:24: `pushfd' invalid in 64-bit mode --:28: `popfd' invalid in 64-bit mode +-:19: error: redefinition of `popfq' +-:9: error: `popfq' previously defined here +-:24: error: `pushfd' invalid in 64-bit mode +-:28: error: `popfd' invalid in 64-bit mode diff --git a/modules/arch/x86/tests/sse4-err.errwarn b/modules/arch/x86/tests/sse4-err.errwarn index b26a14d1..8a785392 100644 --- a/modules/arch/x86/tests/sse4-err.errwarn +++ b/modules/arch/x86/tests/sse4-err.errwarn @@ -1,2 +1,2 @@ --:2: cannot use A/B/C/DH with instruction needing REX --:3: cannot use A/B/C/DH with instruction needing REX +-:2: error: cannot use A/B/C/DH with instruction needing REX +-:3: error: cannot use A/B/C/DH with instruction needing REX diff --git a/modules/arch/x86/tests/sse5-err.errwarn b/modules/arch/x86/tests/sse5-err.errwarn index 19df6e09..3c76880e 100644 --- a/modules/arch/x86/tests/sse5-err.errwarn +++ b/modules/arch/x86/tests/sse5-err.errwarn @@ -1,84 +1,84 @@ --:1: one of source operand 1 or 3 must match dest operand --:2: one of source operand 1 or 3 must match dest operand --:3: one of source operand 1 or 3 must match dest operand --:5: one of source operand 1 or 3 must match dest operand --:6: one of source operand 1 or 3 must match dest operand --:7: one of source operand 1 or 3 must match dest operand --:9: one of source operand 1 or 3 must match dest operand --:10: one of source operand 1 or 3 must match dest operand --:11: one of source operand 1 or 3 must match dest operand --:13: one of source operand 1 or 3 must match dest operand --:14: one of source operand 1 or 3 must match dest operand --:15: one of source operand 1 or 3 must match dest operand --:17: one of source operand 1 or 3 must match dest operand --:18: one of source operand 1 or 3 must match dest operand --:19: one of source operand 1 or 3 must match dest operand --:21: one of source operand 1 or 3 must match dest operand --:22: one of source operand 1 or 3 must match dest operand --:23: one of source operand 1 or 3 must match dest operand --:25: one of source operand 1 or 3 must match dest operand --:26: one of source operand 1 or 3 must match dest operand --:27: one of source operand 1 or 3 must match dest operand --:29: one of source operand 1 or 3 must match dest operand --:30: one of source operand 1 or 3 must match dest operand --:31: one of source operand 1 or 3 must match dest operand --:33: one of source operand 1 or 3 must match dest operand --:34: one of source operand 1 or 3 must match dest operand --:35: one of source operand 1 or 3 must match dest operand --:37: one of source operand 1 or 3 must match dest operand --:38: one of source operand 1 or 3 must match dest operand --:39: one of source operand 1 or 3 must match dest operand --:41: one of source operand 1 or 3 must match dest operand --:42: one of source operand 1 or 3 must match dest operand --:43: one of source operand 1 or 3 must match dest operand --:45: one of source operand 1 or 3 must match dest operand --:46: one of source operand 1 or 3 must match dest operand --:47: one of source operand 1 or 3 must match dest operand --:49: one of source operand 1 or 3 must match dest operand --:50: one of source operand 1 or 3 must match dest operand --:51: one of source operand 1 or 3 must match dest operand --:53: one of source operand 1 or 3 must match dest operand --:54: one of source operand 1 or 3 must match dest operand --:55: one of source operand 1 or 3 must match dest operand --:57: one of source operand 1 or 3 must match dest operand --:58: one of source operand 1 or 3 must match dest operand --:59: one of source operand 1 or 3 must match dest operand --:61: one of source operand 1 or 3 must match dest operand --:62: one of source operand 1 or 3 must match dest operand --:63: one of source operand 1 or 3 must match dest operand --:65: one of source operand 1 or 3 must match dest operand --:66: one of source operand 1 or 3 must match dest operand --:67: one of source operand 1 or 3 must match dest operand --:69: one of source operand 1 or 3 must match dest operand --:70: one of source operand 1 or 3 must match dest operand --:71: one of source operand 1 or 3 must match dest operand --:73: one of source operand 1 or 3 must match dest operand --:74: one of source operand 1 or 3 must match dest operand --:75: one of source operand 1 or 3 must match dest operand --:77: one of source operand 1 or 3 must match dest operand --:78: one of source operand 1 or 3 must match dest operand --:80: one of source operand 1 or 3 must match dest operand --:81: one of source operand 1 or 3 must match dest operand --:83: one of source operand 1 or 3 must match dest operand --:84: one of source operand 1 or 3 must match dest operand --:86: one of source operand 1 or 3 must match dest operand --:87: one of source operand 1 or 3 must match dest operand --:89: one of source operand 1 or 3 must match dest operand --:90: one of source operand 1 or 3 must match dest operand --:92: one of source operand 1 or 3 must match dest operand --:93: one of source operand 1 or 3 must match dest operand --:95: one of source operand 1 or 3 must match dest operand --:96: one of source operand 1 or 3 must match dest operand --:98: one of source operand 1 or 3 must match dest operand --:99: one of source operand 1 or 3 must match dest operand --:101: one of source operand 1 or 3 must match dest operand --:102: one of source operand 1 or 3 must match dest operand --:104: one of source operand 1 or 3 must match dest operand --:105: one of source operand 1 or 3 must match dest operand --:107: one of source operand 1 or 3 must match dest operand --:108: one of source operand 1 or 3 must match dest operand --:110: one of source operand 1 or 3 must match dest operand --:111: one of source operand 1 or 3 must match dest operand --:113: one of source operand 1 or 3 must match dest operand --:114: one of source operand 1 or 3 must match dest operand --:115: one of source operand 1 or 3 must match dest operand +-:1: error: one of source operand 1 or 3 must match dest operand +-:2: error: one of source operand 1 or 3 must match dest operand +-:3: error: one of source operand 1 or 3 must match dest operand +-:5: error: one of source operand 1 or 3 must match dest operand +-:6: error: one of source operand 1 or 3 must match dest operand +-:7: error: one of source operand 1 or 3 must match dest operand +-:9: error: one of source operand 1 or 3 must match dest operand +-:10: error: one of source operand 1 or 3 must match dest operand +-:11: error: one of source operand 1 or 3 must match dest operand +-:13: error: one of source operand 1 or 3 must match dest operand +-:14: error: one of source operand 1 or 3 must match dest operand +-:15: error: one of source operand 1 or 3 must match dest operand +-:17: error: one of source operand 1 or 3 must match dest operand +-:18: error: one of source operand 1 or 3 must match dest operand +-:19: error: one of source operand 1 or 3 must match dest operand +-:21: error: one of source operand 1 or 3 must match dest operand +-:22: error: one of source operand 1 or 3 must match dest operand +-:23: error: one of source operand 1 or 3 must match dest operand +-:25: error: one of source operand 1 or 3 must match dest operand +-:26: error: one of source operand 1 or 3 must match dest operand +-:27: error: one of source operand 1 or 3 must match dest operand +-:29: error: one of source operand 1 or 3 must match dest operand +-:30: error: one of source operand 1 or 3 must match dest operand +-:31: error: one of source operand 1 or 3 must match dest operand +-:33: error: one of source operand 1 or 3 must match dest operand +-:34: error: one of source operand 1 or 3 must match dest operand +-:35: error: one of source operand 1 or 3 must match dest operand +-:37: error: one of source operand 1 or 3 must match dest operand +-:38: error: one of source operand 1 or 3 must match dest operand +-:39: error: one of source operand 1 or 3 must match dest operand +-:41: error: one of source operand 1 or 3 must match dest operand +-:42: error: one of source operand 1 or 3 must match dest operand +-:43: error: one of source operand 1 or 3 must match dest operand +-:45: error: one of source operand 1 or 3 must match dest operand +-:46: error: one of source operand 1 or 3 must match dest operand +-:47: error: one of source operand 1 or 3 must match dest operand +-:49: error: one of source operand 1 or 3 must match dest operand +-:50: error: one of source operand 1 or 3 must match dest operand +-:51: error: one of source operand 1 or 3 must match dest operand +-:53: error: one of source operand 1 or 3 must match dest operand +-:54: error: one of source operand 1 or 3 must match dest operand +-:55: error: one of source operand 1 or 3 must match dest operand +-:57: error: one of source operand 1 or 3 must match dest operand +-:58: error: one of source operand 1 or 3 must match dest operand +-:59: error: one of source operand 1 or 3 must match dest operand +-:61: error: one of source operand 1 or 3 must match dest operand +-:62: error: one of source operand 1 or 3 must match dest operand +-:63: error: one of source operand 1 or 3 must match dest operand +-:65: error: one of source operand 1 or 3 must match dest operand +-:66: error: one of source operand 1 or 3 must match dest operand +-:67: error: one of source operand 1 or 3 must match dest operand +-:69: error: one of source operand 1 or 3 must match dest operand +-:70: error: one of source operand 1 or 3 must match dest operand +-:71: error: one of source operand 1 or 3 must match dest operand +-:73: error: one of source operand 1 or 3 must match dest operand +-:74: error: one of source operand 1 or 3 must match dest operand +-:75: error: one of source operand 1 or 3 must match dest operand +-:77: error: one of source operand 1 or 3 must match dest operand +-:78: error: one of source operand 1 or 3 must match dest operand +-:80: error: one of source operand 1 or 3 must match dest operand +-:81: error: one of source operand 1 or 3 must match dest operand +-:83: error: one of source operand 1 or 3 must match dest operand +-:84: error: one of source operand 1 or 3 must match dest operand +-:86: error: one of source operand 1 or 3 must match dest operand +-:87: error: one of source operand 1 or 3 must match dest operand +-:89: error: one of source operand 1 or 3 must match dest operand +-:90: error: one of source operand 1 or 3 must match dest operand +-:92: error: one of source operand 1 or 3 must match dest operand +-:93: error: one of source operand 1 or 3 must match dest operand +-:95: error: one of source operand 1 or 3 must match dest operand +-:96: error: one of source operand 1 or 3 must match dest operand +-:98: error: one of source operand 1 or 3 must match dest operand +-:99: error: one of source operand 1 or 3 must match dest operand +-:101: error: one of source operand 1 or 3 must match dest operand +-:102: error: one of source operand 1 or 3 must match dest operand +-:104: error: one of source operand 1 or 3 must match dest operand +-:105: error: one of source operand 1 or 3 must match dest operand +-:107: error: one of source operand 1 or 3 must match dest operand +-:108: error: one of source operand 1 or 3 must match dest operand +-:110: error: one of source operand 1 or 3 must match dest operand +-:111: error: one of source operand 1 or 3 must match dest operand +-:113: error: one of source operand 1 or 3 must match dest operand +-:114: error: one of source operand 1 or 3 must match dest operand +-:115: error: one of source operand 1 or 3 must match dest operand diff --git a/modules/arch/x86/tests/strict-err.errwarn b/modules/arch/x86/tests/strict-err.errwarn index 62ebb456..ac3b21b8 100644 --- a/modules/arch/x86/tests/strict-err.errwarn +++ b/modules/arch/x86/tests/strict-err.errwarn @@ -1,4 +1,4 @@ --:2: invalid size for operand 1 --:3: invalid size for operand 1 --:4: invalid size for operand 2 --:5: invalid size for operand 2 +-:2: error: invalid size for operand 1 +-:3: error: invalid size for operand 1 +-:4: error: invalid size for operand 2 +-:5: error: invalid size for operand 2 diff --git a/modules/arch/x86/tests/vmx-err.errwarn b/modules/arch/x86/tests/vmx-err.errwarn index 6faab0a7..7db4b3cb 100644 --- a/modules/arch/x86/tests/vmx-err.errwarn +++ b/modules/arch/x86/tests/vmx-err.errwarn @@ -1,2 +1,2 @@ --:6: invalid size for operand 2 --:7: invalid size for operand 1 +-:6: error: invalid size for operand 2 +-:7: error: invalid size for operand 1 diff --git a/modules/dbgfmts/dwarf2/tests/pass32/dwarf32-err.errwarn b/modules/dbgfmts/dwarf2/tests/pass32/dwarf32-err.errwarn index d22fdf91..9c333565 100644 --- a/modules/dbgfmts/dwarf2/tests/pass32/dwarf32-err.errwarn +++ b/modules/dbgfmts/dwarf2/tests/pass32/dwarf32-err.errwarn @@ -1,22 +1,22 @@ --:1: directive `.loc' requires an argument --:2: file number required --:3: file number required --:4: file number less than one --:6: line number required --:7: line number required --:8: line number required --:11: line number required +-:1: error: directive `.loc' requires an argument +-:2: error: file number required +-:3: error: file number required +-:4: error: file number less than one +-:6: error: line number required +-:7: error: line number required +-:8: error: line number required +-:11: error: line number required -:12: warning: unrecognized numeric qualifier --:13: column number is not a constant --:14: is_stmt requires value --:17: is_stmt value is not a constant --:19: is_stmt value is not a constant --:20: is_stmt value is not a constant --:22: is_stmt value not 0 or 1 --:23: isa requires value --:26: isa value is not a constant --:28: isa value is not a constant --:30: isa value less than zero --:31: column number is not a constant +-:13: error: column number is not a constant +-:14: error: is_stmt requires value +-:17: error: is_stmt value is not a constant +-:19: error: is_stmt value is not a constant +-:20: error: is_stmt value is not a constant +-:22: error: is_stmt value not 0 or 1 +-:23: error: isa requires value +-:26: error: isa value is not a constant +-:28: error: isa value is not a constant +-:30: error: isa value less than zero +-:31: error: column number is not a constant -:33: warning: unrecognized loc option `foo' -:33: warning: unrecognized numeric qualifier diff --git a/modules/objfmts/bin/tests/float-err.errwarn b/modules/objfmts/bin/tests/float-err.errwarn index 33fcebec..4aaa9402 100644 --- a/modules/objfmts/bin/tests/float-err.errwarn +++ b/modules/objfmts/bin/tests/float-err.errwarn @@ -1,8 +1,8 @@ --:2: invalid floating point constant size +-:2: error: invalid floating point constant size -:3: warning: overflow in floating point expression -:4: warning: overflow in floating point expression -:5: warning: underflow in floating point expression --:8: invalid floating point constant size +-:8: error: invalid floating point constant size -:9: warning: overflow in floating point expression -:11: warning: overflow in floating point expression -:12: warning: underflow in floating point expression diff --git a/modules/objfmts/bin/tests/multisect/follows-loop1-err.errwarn b/modules/objfmts/bin/tests/multisect/follows-loop1-err.errwarn index c7ba6a5a..613280e9 100644 --- a/modules/objfmts/bin/tests/multisect/follows-loop1-err.errwarn +++ b/modules/objfmts/bin/tests/multisect/follows-loop1-err.errwarn @@ -1 +1 @@ --: follows loop between section `sect2' and section `sect1' +-: error: follows loop between section `sect2' and section `sect1' diff --git a/modules/objfmts/bin/tests/multisect/follows-loop2-err.errwarn b/modules/objfmts/bin/tests/multisect/follows-loop2-err.errwarn index f4f46dd9..bc832e00 100644 --- a/modules/objfmts/bin/tests/multisect/follows-loop2-err.errwarn +++ b/modules/objfmts/bin/tests/multisect/follows-loop2-err.errwarn @@ -1 +1 @@ --: follows loop between section `sect' and section `sect' +-: error: follows loop between section `sect' and section `sect' diff --git a/modules/objfmts/bin/tests/multisect/follows-notfound-err.errwarn b/modules/objfmts/bin/tests/multisect/follows-notfound-err.errwarn index 85234767..53d29d80 100644 --- a/modules/objfmts/bin/tests/multisect/follows-notfound-err.errwarn +++ b/modules/objfmts/bin/tests/multisect/follows-notfound-err.errwarn @@ -1 +1 @@ --: section `foo' follows an invalid or unknown section `bar' +-: error: section `foo' follows an invalid or unknown section `bar' diff --git a/modules/objfmts/bin/tests/multisect/vfollows-loop1-err.errwarn b/modules/objfmts/bin/tests/multisect/vfollows-loop1-err.errwarn index b7a9006d..3965e589 100644 --- a/modules/objfmts/bin/tests/multisect/vfollows-loop1-err.errwarn +++ b/modules/objfmts/bin/tests/multisect/vfollows-loop1-err.errwarn @@ -1 +1 @@ --: vfollows loop between section `sect2' and section `sect1' +-: error: vfollows loop between section `sect2' and section `sect1' diff --git a/modules/objfmts/bin/tests/multisect/vfollows-loop2-err.errwarn b/modules/objfmts/bin/tests/multisect/vfollows-loop2-err.errwarn index d48bbc85..4f252b42 100644 --- a/modules/objfmts/bin/tests/multisect/vfollows-loop2-err.errwarn +++ b/modules/objfmts/bin/tests/multisect/vfollows-loop2-err.errwarn @@ -1 +1 @@ --: vfollows loop between section `sect' and section `sect' +-: error: vfollows loop between section `sect' and section `sect' diff --git a/modules/objfmts/bin/tests/multisect/vfollows-notfound-err.errwarn b/modules/objfmts/bin/tests/multisect/vfollows-notfound-err.errwarn index ecbc97d4..93b44d08 100644 --- a/modules/objfmts/bin/tests/multisect/vfollows-notfound-err.errwarn +++ b/modules/objfmts/bin/tests/multisect/vfollows-notfound-err.errwarn @@ -1 +1 @@ --: section `foo' vfollows an invalid or unknown section `bar' +-: error: section `foo' vfollows an invalid or unknown section `bar' diff --git a/modules/objfmts/elf/tests/curpos-err.errwarn b/modules/objfmts/elf/tests/curpos-err.errwarn index fb6f65d7..efe6b093 100644 --- a/modules/objfmts/elf/tests/curpos-err.errwarn +++ b/modules/objfmts/elf/tests/curpos-err.errwarn @@ -1,2 +1,2 @@ --:15: data expression too complex --:21: data expression too complex +-:15: error: data expression too complex +-:21: error: data expression too complex diff --git a/modules/objfmts/macho/tests/nasm64/macho-reloc64-err.errwarn b/modules/objfmts/macho/tests/nasm64/macho-reloc64-err.errwarn index 3d4e5d97..8297a5bb 100644 --- a/modules/objfmts/macho/tests/nasm64/macho-reloc64-err.errwarn +++ b/modules/objfmts/macho/tests/nasm64/macho-reloc64-err.errwarn @@ -1,8 +1,8 @@ --:20: macho: sorry, cannot apply 32 bit absolute relocations in 64 bit mode, consider "[_symbol wrt rip]" for mem access, "qword" and "dq _foo" for pointers. --:21: macho: sorry, cannot apply 32 bit absolute relocations in 64 bit mode, consider "[_symbol wrt rip]" for mem access, "qword" and "dq _foo" for pointers. --:23: macho: sorry, cannot apply 32 bit absolute relocations in 64 bit mode, consider "[_symbol wrt rip]" for mem access, "qword" and "dq _foo" for pointers. --:24: macho: sorry, cannot apply 32 bit absolute relocations in 64 bit mode, consider "[_symbol wrt rip]" for mem access, "qword" and "dq _foo" for pointers. --:25: macho: sorry, cannot apply 32 bit absolute relocations in 64 bit mode, consider "[_symbol wrt rip]" for mem access, "qword" and "dq _foo" for pointers. --:26: macho: sorry, cannot apply 32 bit absolute relocations in 64 bit mode, consider "[_symbol wrt rip]" for mem access, "qword" and "dq _foo" for pointers. --:27: macho: sorry, cannot apply 32 bit absolute relocations in 64 bit mode, consider "[_symbol wrt rip]" for mem access, "qword" and "dq _foo" for pointers. --:29: macho: WRT not supported +-:20: error: macho: sorry, cannot apply 32 bit absolute relocations in 64 bit mode, consider "[_symbol wrt rip]" for mem access, "qword" and "dq _foo" for pointers. +-:21: error: macho: sorry, cannot apply 32 bit absolute relocations in 64 bit mode, consider "[_symbol wrt rip]" for mem access, "qword" and "dq _foo" for pointers. +-:23: error: macho: sorry, cannot apply 32 bit absolute relocations in 64 bit mode, consider "[_symbol wrt rip]" for mem access, "qword" and "dq _foo" for pointers. +-:24: error: macho: sorry, cannot apply 32 bit absolute relocations in 64 bit mode, consider "[_symbol wrt rip]" for mem access, "qword" and "dq _foo" for pointers. +-:25: error: macho: sorry, cannot apply 32 bit absolute relocations in 64 bit mode, consider "[_symbol wrt rip]" for mem access, "qword" and "dq _foo" for pointers. +-:26: error: macho: sorry, cannot apply 32 bit absolute relocations in 64 bit mode, consider "[_symbol wrt rip]" for mem access, "qword" and "dq _foo" for pointers. +-:27: error: macho: sorry, cannot apply 32 bit absolute relocations in 64 bit mode, consider "[_symbol wrt rip]" for mem access, "qword" and "dq _foo" for pointers. +-:29: error: macho: WRT not supported diff --git a/modules/objfmts/win64/tests/sce1-err.errwarn b/modules/objfmts/win64/tests/sce1-err.errwarn index f5b67933..bfb88c14 100644 --- a/modules/objfmts/win64/tests/sce1-err.errwarn +++ b/modules/objfmts/win64/tests/sce1-err.errwarn @@ -1,8 +1,8 @@ --:9: ended procedure without ending prologue --:1: procedure started here --:20: nested procedures not supported (didn't use [ENDPROC_FRAME]?) --:11: previous procedure started here --:27: [SAVEREG] after end of prologue --:26: prologue ended here --:31: [ENDPROLOG] without preceding [PROC_FRAME] --:32: [SAVEREG] without preceding [PROC_FRAME] +-:9: error: ended procedure without ending prologue +-:1: error: procedure started here +-:20: error: nested procedures not supported (didn't use [ENDPROC_FRAME]?) +-:11: error: previous procedure started here +-:27: error: [SAVEREG] after end of prologue +-:26: error: prologue ended here +-:31: error: [ENDPROLOG] without preceding [PROC_FRAME] +-:32: error: [SAVEREG] without preceding [PROC_FRAME] diff --git a/modules/objfmts/win64/tests/sce2-err.errwarn b/modules/objfmts/win64/tests/sce2-err.errwarn index d7f0d290..73e18652 100644 --- a/modules/objfmts/win64/tests/sce2-err.errwarn +++ b/modules/objfmts/win64/tests/sce2-err.errwarn @@ -1,2 +1,2 @@ --: end of file in procedure frame --:1: procedure started here +-: error: end of file in procedure frame +-:1: error: procedure started here diff --git a/modules/objfmts/win64/tests/sce4-err.errwarn b/modules/objfmts/win64/tests/sce4-err.errwarn index 92d9cb02..b477ceb7 100644 --- a/modules/objfmts/win64/tests/sce4-err.errwarn +++ b/modules/objfmts/win64/tests/sce4-err.errwarn @@ -1,9 +1,9 @@ --:2: frame offset of -4 bytes, must be between 0 and 240 --:3: negative offset not allowed --:5: negative offset not allowed --:6: negative offset not allowed --:11: frame offset of 248 bytes, must be between 0 and 240 --:17: frame offset of 236 is not a multiple of 16 --:18: offset of 124 is not a multiple of 8 --:20: offset of 1032 is not a multiple of 16 --:21: offset of 1028 is not a multiple of 8 +-:2: error: frame offset of -4 bytes, must be between 0 and 240 +-:3: error: negative offset not allowed +-:5: error: negative offset not allowed +-:6: error: negative offset not allowed +-:11: error: frame offset of 248 bytes, must be between 0 and 240 +-:17: error: frame offset of 236 is not a multiple of 16 +-:18: error: offset of 124 is not a multiple of 8 +-:20: error: offset of 1032 is not a multiple of 16 +-:21: error: offset of 1028 is not a multiple of 8 diff --git a/modules/objfmts/xdf/tests/xdfsect-err.errwarn b/modules/objfmts/xdf/tests/xdfsect-err.errwarn index 4a9d5b3a..84acc4c1 100644 --- a/modules/objfmts/xdf/tests/xdfsect-err.errwarn +++ b/modules/objfmts/xdf/tests/xdfsect-err.errwarn @@ -1,4 +1,4 @@ --:1: directive `section' requires an argument +-:1: error: directive `section' requires an argument -:2: warning: Unrecognized qualifier `use16' -:3: warning: Unrecognized qualifier `use32' -:4: warning: Unrecognized qualifier `use64' @@ -6,15 +6,15 @@ -:6: warning: Unrecognized qualifier `flat' -:7: warning: Unrecognized qualifier `foo' -:8: warning: Unrecognized qualifier `foo' --:9: argument to `absolute' is not an integer --:9: undefined symbol `foo' (first use) --:9: (Each undefined symbol is reported only once.) --:10: argument to `absolute' is not an integer +-:9: error: argument to `absolute' is not an integer +-:9: error: undefined symbol `foo' (first use) +-:9: error: (Each undefined symbol is reported only once.) +-:10: error: argument to `absolute' is not an integer -:11: warning: Unrecognized qualifier `absolute' --:12: argument to `virtual' is not an integer --:13: argument to `virtual' is not an integer +-:12: error: argument to `virtual' is not an integer +-:13: error: argument to `virtual' is not an integer -:14: warning: Unrecognized qualifier `virtual' --:15: argument to `align' is not an integer --:16: argument to `align' is not an integer +-:15: error: argument to `align' is not an integer +-:16: error: argument to `align' is not an integer -:17: warning: Unrecognized qualifier `align' -:18: warning: Unrecognized string qualifier diff --git a/modules/parsers/gas/tests/bin/rept-err.errwarn b/modules/parsers/gas/tests/bin/rept-err.errwarn index 050398c2..3f64c8eb 100644 --- a/modules/parsers/gas/tests/bin/rept-err.errwarn +++ b/modules/parsers/gas/tests/bin/rept-err.errwarn @@ -1 +1 @@ --:1: rept without matching endr +-:1: error: rept without matching endr diff --git a/modules/parsers/gas/tests/bin/reptnested-err.errwarn b/modules/parsers/gas/tests/bin/reptnested-err.errwarn index 016b13e9..d7ac0b71 100644 --- a/modules/parsers/gas/tests/bin/reptnested-err.errwarn +++ b/modules/parsers/gas/tests/bin/reptnested-err.errwarn @@ -1,7 +1,7 @@ --:2: nested rept not supported --:3: rept without matching endr --:4: nested rept not supported --:4: nested rept not supported --:4: nested rept not supported --:4: nested rept not supported --:4: nested rept not supported +-:2: error: nested rept not supported +-:3: error: rept without matching endr +-:4: error: nested rept not supported +-:4: error: nested rept not supported +-:4: error: nested rept not supported +-:4: error: nested rept not supported +-:4: error: nested rept not supported diff --git a/modules/parsers/gas/tests/gas-line-err.errwarn b/modules/parsers/gas/tests/gas-line-err.errwarn index 8f92ad62..f08f8be8 100644 --- a/modules/parsers/gas/tests/gas-line-err.errwarn +++ b/modules/parsers/gas/tests/gas-line-err.errwarn @@ -1,6 +1,6 @@ --:1: invalid number of operands --:3: invalid number of operands -bar1.s:601: invalid number of operands -bar1.s:201: invalid number of operands -bar2.s:203: invalid number of operands -bar2.s:205: invalid number of operands +-:1: error: invalid number of operands +-:3: error: invalid number of operands +bar1.s:601: error: invalid number of operands +bar1.s:201: error: invalid number of operands +bar2.s:203: error: invalid number of operands +bar2.s:205: error: invalid number of operands diff --git a/modules/parsers/gas/tests/gas-line2-err.errwarn b/modules/parsers/gas/tests/gas-line2-err.errwarn index 4cfc626f..5cd6b05b 100644 --- a/modules/parsers/gas/tests/gas-line2-err.errwarn +++ b/modules/parsers/gas/tests/gas-line2-err.errwarn @@ -1,3 +1,3 @@ --:1: invalid number of operands --:3: invalid number of operands -bar1.s:603: invalid number of operands +-:1: error: invalid number of operands +-:3: error: invalid number of operands +bar1.s:603: error: invalid number of operands diff --git a/modules/parsers/gas/tests/reggroup-err.errwarn b/modules/parsers/gas/tests/reggroup-err.errwarn index 1b6d02b7..3f428a79 100644 --- a/modules/parsers/gas/tests/reggroup-err.errwarn +++ b/modules/parsers/gas/tests/reggroup-err.errwarn @@ -1 +1 @@ --:5: bad register index `8' +-:5: error: bad register index `8' diff --git a/modules/preprocs/nasm/tests/ifcritical-err.errwarn b/modules/preprocs/nasm/tests/ifcritical-err.errwarn index 55b237a3..73ca327c 100644 --- a/modules/preprocs/nasm/tests/ifcritical-err.errwarn +++ b/modules/preprocs/nasm/tests/ifcritical-err.errwarn @@ -1 +1 @@ --:5: non-constant value given to `%if' +-:5: error: non-constant value given to `%if' From 4606b9506ac6e662789bf5efc4e48b4fb21ec399 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 4 Dec 2007 06:55:11 +0000 Subject: [PATCH 128/585] Fix #125: Improve reporting of operand and expression syntax errors. Now instead of the generic "expression syntax error", more informative error messages such as the following are reported: - unexpected `:' after instruction - expected expression after `%' - expected operand, got `%' svn path=/trunk/yasm/; revision=2020 --- modules/parsers/nasm/nasm-parse.c | 79 +++++++++++++++---- modules/parsers/nasm/tests/Makefile.inc | 2 + modules/parsers/nasm/tests/syntax-err.asm | 17 ++++ modules/parsers/nasm/tests/syntax-err.errwarn | 16 ++++ 4 files changed, 99 insertions(+), 15 deletions(-) create mode 100644 modules/parsers/nasm/tests/syntax-err.asm create mode 100644 modules/parsers/nasm/tests/syntax-err.errwarn diff --git a/modules/parsers/nasm/nasm-parse.c b/modules/parsers/nasm/nasm-parse.c index 2f7f59ba..98c2034d 100644 --- a/modules/parsers/nasm/nasm-parse.c +++ b/modules/parsers/nasm/nasm-parse.c @@ -133,16 +133,14 @@ demand_eol_(yasm_parser_nasm *parser_nasm) } #define demand_eol() demand_eol_(parser_nasm) -static int -expect_(yasm_parser_nasm *parser_nasm, int token) +static const char * +describe_token(int token) { static char strch[] = "` '"; const char *str; - if (curtok == token) - return 1; - switch (token) { + case 0: str = "end of line"; break; case INTNUM: str = "integer"; break; case FLTNUM: str = "floating point value"; break; case DIRECTIVE_NAME: str = "directive name"; break; @@ -177,7 +175,17 @@ expect_(yasm_parser_nasm *parser_nasm, int token) str = strch; break; } - yasm_error_set(YASM_ERROR_PARSE, "expected %s", str); + + return str; +} + +static int +expect_(yasm_parser_nasm *parser_nasm, int token) +{ + if (curtok == token) + return 1; + + yasm_error_set(YASM_ERROR_PARSE, "expected %s", describe_token(token)); destroy_curtok(); return 0; } @@ -622,8 +630,14 @@ parse_instr(yasm_parser_nasm *parser_nasm) for (;;) { yasm_insn_operand *op = parse_operand(parser_nasm); if (!op) { - yasm_error_set(YASM_ERROR_SYNTAX, - N_("expression syntax error")); + if (insn->num_operands == 0) + yasm_error_set(YASM_ERROR_SYNTAX, + N_("unexpected %s after instruction"), + describe_token(curtok)); + else + yasm_error_set(YASM_ERROR_SYNTAX, + N_("expected operand, got %s"), + describe_token(curtok)); yasm_bc_destroy(bc); return NULL; } @@ -838,6 +852,9 @@ parse_memaddr(yasm_parser_nasm *parser_nasm) get_next_token(); \ f = rightfunc(parser_nasm, type); \ if (!f) { \ + yasm_error_set(YASM_ERROR_SYNTAX, \ + N_("expected expression after %s"), \ + describe_token(op)); \ yasm_expr_destroy(e); \ return NULL; \ } \ @@ -900,6 +917,9 @@ parse_expr3(yasm_parser_nasm *parser_nasm, expr_type type) get_next_token(); f = parse_expr4(parser_nasm, type); if (!f) { + yasm_error_set(YASM_ERROR_SYNTAX, + N_("expected expression after %s"), + describe_token(op)); yasm_expr_destroy(e); return NULL; } @@ -925,6 +945,9 @@ parse_expr4(yasm_parser_nasm *parser_nasm, expr_type type) get_next_token(); f = parse_expr5(parser_nasm, type); if (!f) { + yasm_error_set(YASM_ERROR_SYNTAX, + N_("expected expression after %s"), + describe_token(op)); yasm_expr_destroy(e); return NULL; } @@ -951,6 +974,9 @@ parse_expr5(yasm_parser_nasm *parser_nasm, expr_type type) get_next_token(); f = parse_expr6(parser_nasm, type); if (!f) { + yasm_error_set(YASM_ERROR_SYNTAX, + N_("expected expression after %s"), + describe_token(op)); yasm_expr_destroy(e); return NULL; } @@ -978,14 +1004,20 @@ parse_expr6(yasm_parser_nasm *parser_nasm, expr_type type) case '~': get_next_token(); e = parse_expr6(parser_nasm, type); - if (!e) + if (!e) { + yasm_error_set(YASM_ERROR_SYNTAX, + N_("expected expression after %s"), "`~'"); return NULL; + } return p_expr_new_branch(YASM_EXPR_NOT, e); case '(': get_next_token(); e = parse_expr(parser_nasm, type); - if (!e) + if (!e) { + yasm_error_set(YASM_ERROR_SYNTAX, + N_("expected expression after %s"), "`('"); return NULL; + } if (!expect(')')) { yasm_error_set(YASM_ERROR_SYNTAX, N_("missing parenthesis")); return NULL; @@ -1009,30 +1041,47 @@ parse_expr6(yasm_parser_nasm *parser_nasm, expr_type type) } else switch (curtok) { case '+': get_next_token(); - return parse_expr6(parser_nasm, type); + e = parse_expr6(parser_nasm, type); + if (!e) { + yasm_error_set(YASM_ERROR_SYNTAX, + N_("expected expression after %s"), "`+'"); + } + return e; case '-': get_next_token(); e = parse_expr6(parser_nasm, type); - if (!e) + if (!e) { + yasm_error_set(YASM_ERROR_SYNTAX, + N_("expected expression after %s"), "`-'"); return NULL; + } return p_expr_new_branch(YASM_EXPR_NEG, e); case '~': get_next_token(); e = parse_expr6(parser_nasm, type); - if (!e) + if (!e) { + yasm_error_set(YASM_ERROR_SYNTAX, + N_("expected expression after %s"), "`~'"); return NULL; + } return p_expr_new_branch(YASM_EXPR_NOT, e); case SEG: get_next_token(); e = parse_expr6(parser_nasm, type); - if (!e) + if (!e) { + yasm_error_set(YASM_ERROR_SYNTAX, + N_("expected expression after %s"), "SEG"); return NULL; + } return p_expr_new_branch(YASM_EXPR_SEG, e); case '(': get_next_token(); e = parse_expr(parser_nasm, type); - if (!e) + if (!e) { + yasm_error_set(YASM_ERROR_SYNTAX, + N_("expected expression after %s"), "`('"); return NULL; + } if (!expect(')')) { yasm_error_set(YASM_ERROR_SYNTAX, N_("missing parenthesis")); return NULL; diff --git a/modules/parsers/nasm/tests/Makefile.inc b/modules/parsers/nasm/tests/Makefile.inc index 8ec457b4..599aa397 100644 --- a/modules/parsers/nasm/tests/Makefile.inc +++ b/modules/parsers/nasm/tests/Makefile.inc @@ -30,6 +30,8 @@ EXTRA_DIST += modules/parsers/nasm/tests/strucalign.asm EXTRA_DIST += modules/parsers/nasm/tests/strucalign.hex EXTRA_DIST += modules/parsers/nasm/tests/struczero.asm EXTRA_DIST += modules/parsers/nasm/tests/struczero.hex +EXTRA_DIST += modules/parsers/nasm/tests/syntax-err.asm +EXTRA_DIST += modules/parsers/nasm/tests/syntax-err.errwarn EXTRA_DIST += modules/parsers/nasm/tests/worphan/Makefile.inc diff --git a/modules/parsers/nasm/tests/syntax-err.asm b/modules/parsers/nasm/tests/syntax-err.asm new file mode 100644 index 00000000..f36010a7 --- /dev/null +++ b/modules/parsers/nasm/tests/syntax-err.asm @@ -0,0 +1,17 @@ +global crc32 +crc32: resd 1 +cli: +mov ax, 5% +mov ax, % +mov ax, ~ +mov ax, + +mov ax, - +mov ax, ( +mov ax, ) +ret 5% +ret % +ret ~ +ret + +ret - +ret ( +ret ) diff --git a/modules/parsers/nasm/tests/syntax-err.errwarn b/modules/parsers/nasm/tests/syntax-err.errwarn new file mode 100644 index 00000000..2e52a0d1 --- /dev/null +++ b/modules/parsers/nasm/tests/syntax-err.errwarn @@ -0,0 +1,16 @@ +-:2: error: unexpected `:' after instruction +-:3: error: unexpected `:' after instruction +-:4: error: expected expression after `%' +-:5: error: expected operand, got `%' +-:6: error: expected expression after `~' +-:7: error: expected expression after `+' +-:8: error: expected expression after `-' +-:9: error: expected expression after `(' +-:10: error: expected operand, got `)' +-:11: error: expected expression after `%' +-:12: error: unexpected `%' after instruction +-:13: error: expected expression after `~' +-:14: error: expected expression after `+' +-:15: error: expected expression after `-' +-:16: error: expected expression after `(' +-:17: error: unexpected `)' after instruction From de9302504724a5e41261a2fb0653d5adca6a5756 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 4 Dec 2007 07:08:01 +0000 Subject: [PATCH 129/585] Fix #122: Allow standalone prefixes. Implementation copied from gas parser. svn path=/trunk/yasm/; revision=2021 --- modules/parsers/nasm/nasm-parse.c | 10 ++++++---- modules/parsers/nasm/tests/Makefile.inc | 2 ++ modules/parsers/nasm/tests/nasm-prefix.asm | 5 +++++ modules/parsers/nasm/tests/nasm-prefix.hex | 6 ++++++ 4 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 modules/parsers/nasm/tests/nasm-prefix.asm create mode 100644 modules/parsers/nasm/tests/nasm-prefix.hex diff --git a/modules/parsers/nasm/nasm-parse.c b/modules/parsers/nasm/nasm-parse.c index 98c2034d..db08275f 100644 --- a/modules/parsers/nasm/nasm-parse.c +++ b/modules/parsers/nasm/nasm-parse.c @@ -658,8 +658,9 @@ parse_instr(yasm_parser_nasm *parser_nasm) uintptr_t prefix = PREFIX_val; get_next_token(); bc = parse_instr(parser_nasm); - if (bc) - yasm_insn_add_prefix(yasm_bc_get_insn(bc), prefix); + if (!bc) + bc = yasm_arch_create_empty_insn(p_object->arch, cur_line); + yasm_insn_add_prefix(yasm_bc_get_insn(bc), prefix); return bc; } case SEGREG: @@ -667,8 +668,9 @@ parse_instr(yasm_parser_nasm *parser_nasm) uintptr_t segreg = SEGREG_val; get_next_token(); bc = parse_instr(parser_nasm); - if (bc) - yasm_insn_add_seg_prefix(yasm_bc_get_insn(bc), segreg); + if (!bc) + bc = yasm_arch_create_empty_insn(p_object->arch, cur_line); + yasm_insn_add_seg_prefix(yasm_bc_get_insn(bc), segreg); return bc; } default: diff --git a/modules/parsers/nasm/tests/Makefile.inc b/modules/parsers/nasm/tests/Makefile.inc index 599aa397..0e7cf1ed 100644 --- a/modules/parsers/nasm/tests/Makefile.inc +++ b/modules/parsers/nasm/tests/Makefile.inc @@ -19,6 +19,8 @@ EXTRA_DIST += modules/parsers/nasm/tests/hexconst.asm EXTRA_DIST += modules/parsers/nasm/tests/hexconst.hex EXTRA_DIST += modules/parsers/nasm/tests/long.asm EXTRA_DIST += modules/parsers/nasm/tests/long.hex +EXTRA_DIST += modules/parsers/nasm/tests/nasm-prefix.asm +EXTRA_DIST += modules/parsers/nasm/tests/nasm-prefix.hex EXTRA_DIST += modules/parsers/nasm/tests/newsect.asm EXTRA_DIST += modules/parsers/nasm/tests/newsect.hex EXTRA_DIST += modules/parsers/nasm/tests/orphannowarn.asm diff --git a/modules/parsers/nasm/tests/nasm-prefix.asm b/modules/parsers/nasm/tests/nasm-prefix.asm new file mode 100644 index 00000000..2bd7824f --- /dev/null +++ b/modules/parsers/nasm/tests/nasm-prefix.asm @@ -0,0 +1,5 @@ +es +mov ax, [bx] + +a32 +mov ax, [bx] diff --git a/modules/parsers/nasm/tests/nasm-prefix.hex b/modules/parsers/nasm/tests/nasm-prefix.hex new file mode 100644 index 00000000..24bdfef6 --- /dev/null +++ b/modules/parsers/nasm/tests/nasm-prefix.hex @@ -0,0 +1,6 @@ +26 +8b +07 +67 +8b +07 From ad072d5172b86ef8aff3b8ee726c88caf8268b26 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 6 Dec 2007 05:46:02 +0000 Subject: [PATCH 130/585] Turn off -Wconversion. It is far too noisy for it to be useful due to "passing arg X of `' with different width due to prototype" warnings. svn path=/trunk/yasm/; revision=2022 --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index f539d124..1bea5a2f 100644 --- a/configure.ac +++ b/configure.ac @@ -174,7 +174,7 @@ if test "$USE_MAINTAINER_MODE" = "yes"; then MORE_CFLAGS="$MORE_CFLAGS -Wcast-align" MORE_CFLAGS="$MORE_CFLAGS -Wcast-qual" MORE_CFLAGS="$MORE_CFLAGS -Wchar-subscripts" - MORE_CFLAGS="$MORE_CFLAGS -Wconversion" +# MORE_CFLAGS="$MORE_CFLAGS -Wconversion" # MORE_CFLAGS="$MORE_CFLAGS -Wdeclaration-after-statement" # MORE_CFLAGS="$MORE_CFLAGS -Wendif-labels" MORE_CFLAGS="$MORE_CFLAGS -Winline" From 95ccef973177d461f8a1c26af3f549c828de70ad Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 7 Dec 2007 06:49:24 +0000 Subject: [PATCH 131/585] Check for 0-termination character rather than newline. svn path=/trunk/yasm/; revision=2023 --- modules/parsers/nasm/nasm-token.re | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/parsers/nasm/nasm-token.re b/modules/parsers/nasm/nasm-token.re index 8d385e50..35de7924 100644 --- a/modules/parsers/nasm/nasm-token.re +++ b/modules/parsers/nasm/nasm-token.re @@ -358,7 +358,7 @@ scan: RETURN(ID); } - ";" (any \ [\n])* { goto scan; } + ";" (any \ [\000])* { goto scan; } ws+ { goto scan; } @@ -425,7 +425,7 @@ linechg2: "\r" { } - (any \ [\r\n])+ { + (any \ [\000])+ { parser_nasm->state = LINECHG; lvalp->str_val = yasm__xstrndup(TOK, TOKLEN); RETURN(FILENAME); @@ -596,7 +596,7 @@ directive2: RETURN(ID); } - ";" (any \ [\n])* { goto directive2; } + ";" (any \ [\000])* { goto directive2; } ws+ { goto directive2; } From 8370e6efa974f560e7b69c0f60544a7368e74547 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Mon, 10 Dec 2007 05:20:32 +0000 Subject: [PATCH 132/585] Fix NULL dereference for certain cases of REX used with jump instruction. svn path=/trunk/yasm/; revision=2024 --- modules/arch/x86/tests/Makefile.inc | 3 +++ modules/arch/x86/tests/o64loop.asm | 3 +++ modules/arch/x86/tests/o64loop.errwarn | 1 + modules/arch/x86/tests/o64loop.hex | 2 ++ modules/arch/x86/x86bc.c | 5 ++++- 5 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 modules/arch/x86/tests/o64loop.asm create mode 100644 modules/arch/x86/tests/o64loop.errwarn create mode 100644 modules/arch/x86/tests/o64loop.hex diff --git a/modules/arch/x86/tests/Makefile.inc b/modules/arch/x86/tests/Makefile.inc index c9093246..9069d2c2 100644 --- a/modules/arch/x86/tests/Makefile.inc +++ b/modules/arch/x86/tests/Makefile.inc @@ -104,6 +104,9 @@ EXTRA_DIST += modules/arch/x86/tests/nomem64.errwarn EXTRA_DIST += modules/arch/x86/tests/nomem64.hex EXTRA_DIST += modules/arch/x86/tests/o64.asm EXTRA_DIST += modules/arch/x86/tests/o64.hex +EXTRA_DIST += modules/arch/x86/tests/o64loop.asm +EXTRA_DIST += modules/arch/x86/tests/o64loop.errwarn +EXTRA_DIST += modules/arch/x86/tests/o64loop.hex EXTRA_DIST += modules/arch/x86/tests/opersize.asm EXTRA_DIST += modules/arch/x86/tests/opersize.hex EXTRA_DIST += modules/arch/x86/tests/opsize-err.asm diff --git a/modules/arch/x86/tests/o64loop.asm b/modules/arch/x86/tests/o64loop.asm new file mode 100644 index 00000000..14f7951b --- /dev/null +++ b/modules/arch/x86/tests/o64loop.asm @@ -0,0 +1,3 @@ +[bits 64] +o64 loop next +next: diff --git a/modules/arch/x86/tests/o64loop.errwarn b/modules/arch/x86/tests/o64loop.errwarn new file mode 100644 index 00000000..55f8201b --- /dev/null +++ b/modules/arch/x86/tests/o64loop.errwarn @@ -0,0 +1 @@ +-:2: warning: ignoring REX prefix on jump diff --git a/modules/arch/x86/tests/o64loop.hex b/modules/arch/x86/tests/o64loop.hex new file mode 100644 index 00000000..55e2c214 --- /dev/null +++ b/modules/arch/x86/tests/o64loop.hex @@ -0,0 +1,2 @@ +e2 +00 diff --git a/modules/arch/x86/x86bc.c b/modules/arch/x86/x86bc.c index f3717bf7..dfcaa26c 100644 --- a/modules/arch/x86/x86bc.c +++ b/modules/arch/x86/x86bc.c @@ -294,7 +294,10 @@ yasm_x86__bc_apply_prefixes(x86_common *common, unsigned char *rex, common->opersize = (unsigned char)prefixes[i] & 0xff; if (common->mode_bits == 64 && common->opersize == 64 && def_opersize_64 != 64) { - if (*rex == 0xff) + if (!rex) + yasm_warn_set(YASM_WARN_GENERAL, + N_("ignoring REX prefix on jump")); + else if (*rex == 0xff) yasm_warn_set(YASM_WARN_GENERAL, N_("REX prefix not allowed on this instruction, ignoring")); else From f210b61533980c6d1405338eafab6472ef7642d3 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 15 Dec 2007 00:00:55 +0000 Subject: [PATCH 133/585] re2c: Fix -b generation in certain cases. Fix from re2c repo r417 (sourceforge bug 1479044). svn path=/trunk/yasm/; revision=2025 --- tools/re2c/code.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/re2c/code.c b/tools/re2c/code.c index 1c72517a..a3341cb4 100644 --- a/tools/re2c/code.c +++ b/tools/re2c/code.c @@ -146,11 +146,11 @@ void BitMap_gen(FILE *o, unsigned int lb, unsigned int ub){ unsigned int n = ub - lb; unsigned int i; unsigned char *bm = malloc(sizeof(unsigned char)*n); - memset(bm, 0, n); fputs("\tstatic unsigned char yybm[] = {", o); for(i = 0; b; i += n){ unsigned char m; unsigned int j; + memset(bm, 0, n); for(m = 0x80; b && m; b = b->next, m >>= 1){ b->i = i; b->m = m; doGen(b->go, b->on, bm-lb, m); @@ -161,6 +161,7 @@ void BitMap_gen(FILE *o, unsigned int lb, unsigned int ub){ } } fputs("\n\t};\n", o); oline+=2; + free(bm); } } From 0e0d4b413a0aefbdb7b231651e3c3baa2b1a04bb Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 3 Jan 2008 04:13:18 +0000 Subject: [PATCH 134/585] Fix #129: Support no-operand form of movsd in GAS syntax. Reported and patch by: mm.beck@gmx.net svn path=/trunk/yasm/; revision=2026 --- modules/arch/x86/gen_x86_insn.py | 2 +- modules/arch/x86/tests/gas32/Makefile.inc | 2 + modules/arch/x86/tests/gas32/gas-movsd.asm | 3 + modules/arch/x86/tests/gas32/gas-movsd.hex | 360 +++++++++++++++++++++ 4 files changed, 366 insertions(+), 1 deletion(-) create mode 100644 modules/arch/x86/tests/gas32/gas-movsd.asm create mode 100644 modules/arch/x86/tests/gas32/gas-movsd.hex diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index 9213fe0c..fd923d4f 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -2679,7 +2679,7 @@ add_insn("movsw", "onebyte", modifiers=[0xA5, 16]) # movsd has to be non-onebyte for SSE2 forms below add_group("movsd", - parsers=["nasm"], + parsers=["nasm", "gas"], opersize=32, opcode=[0xA5], operands=[]) diff --git a/modules/arch/x86/tests/gas32/Makefile.inc b/modules/arch/x86/tests/gas32/Makefile.inc index fbb8ccf4..80f22a40 100644 --- a/modules/arch/x86/tests/gas32/Makefile.inc +++ b/modules/arch/x86/tests/gas32/Makefile.inc @@ -9,6 +9,8 @@ EXTRA_DIST += modules/arch/x86/tests/gas32/gas-farithr.asm EXTRA_DIST += modules/arch/x86/tests/gas32/gas-farithr.hex EXTRA_DIST += modules/arch/x86/tests/gas32/gas-movdq32.asm EXTRA_DIST += modules/arch/x86/tests/gas32/gas-movdq32.hex +EXTRA_DIST += modules/arch/x86/tests/gas32/gas-movsd.asm +EXTRA_DIST += modules/arch/x86/tests/gas32/gas-movsd.hex EXTRA_DIST += modules/arch/x86/tests/gas32/gas32-jmpcall.asm EXTRA_DIST += modules/arch/x86/tests/gas32/gas32-jmpcall.hex diff --git a/modules/arch/x86/tests/gas32/gas-movsd.asm b/modules/arch/x86/tests/gas32/gas-movsd.asm new file mode 100644 index 00000000..3d3c0c73 --- /dev/null +++ b/modules/arch/x86/tests/gas32/gas-movsd.asm @@ -0,0 +1,3 @@ +.text +movsd +movsl diff --git a/modules/arch/x86/tests/gas32/gas-movsd.hex b/modules/arch/x86/tests/gas32/gas-movsd.hex new file mode 100644 index 00000000..70701e6d --- /dev/null +++ b/modules/arch/x86/tests/gas32/gas-movsd.hex @@ -0,0 +1,360 @@ +7f +45 +4c +46 +01 +01 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +03 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +a0 +00 +00 +00 +00 +00 +00 +00 +34 +00 +00 +00 +00 +00 +28 +00 +05 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +a5 +a5 +00 +00 +00 +2e +74 +65 +78 +74 +00 +2e +73 +74 +72 +74 +61 +62 +00 +2e +73 +79 +6d +74 +61 +62 +00 +2e +73 +68 +73 +74 +72 +74 +61 +62 +00 +00 +00 +00 +00 +2d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +f1 +ff +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +17 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +44 +00 +00 +00 +21 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +07 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +68 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +0f +00 +00 +00 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +6c +00 +00 +00 +30 +00 +00 +00 +02 +00 +00 +00 +03 +00 +00 +00 +04 +00 +00 +00 +10 +00 +00 +00 +01 +00 +00 +00 +01 +00 +00 +00 +06 +00 +00 +00 +00 +00 +00 +00 +40 +00 +00 +00 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 From e1f577f6d264843e367d4fefda6e06cfe07b8867 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 19 Jan 2008 08:30:21 +0000 Subject: [PATCH 135/585] tools/xdf: Make 64-bit safe. svn path=/trunk/yasm/; revision=2027 --- tools/xdf/xdf.h | 13 +++++++++---- tools/xdf/xdfdump.c | 38 +++++++++++++++++++++++++++++--------- 2 files changed, 38 insertions(+), 13 deletions(-) diff --git a/tools/xdf/xdf.h b/tools/xdf/xdf.h index 8f13774b..6d5e3e79 100644 --- a/tools/xdf/xdf.h +++ b/tools/xdf/xdf.h @@ -18,10 +18,12 @@ #ifndef XDF_H_INCLUDED #define XDF_H_INCLUDED -typedef unsigned char u8; -typedef unsigned short u16; -typedef unsigned int u32; -typedef unsigned long long u64; +#include + +typedef uint8_t u8; +typedef uint16_t u16; +typedef uint32_t u32; +typedef uint64_t u64; typedef enum { @@ -78,6 +80,7 @@ typedef struct { /* 16 bytes */ } FILE_HEADER; +#define FILE_HEADER_SIZE (4+4+4+4) typedef struct { /* 40 bytes */ @@ -94,6 +97,7 @@ typedef struct { /* 40 bytes */ } SECTION_HEADER; +#define SECTION_HEADER_SIZE (4+8+8+2+2+4+4+4+4) typedef struct { /* 16 bytes */ @@ -104,6 +108,7 @@ typedef struct { /* 16 bytes */ } SYMBOL_ENTRY; +#define SYMBOL_ENTRY_SIZE (4+4+4+4) typedef struct { /* 16 bytes */ diff --git a/tools/xdf/xdfdump.c b/tools/xdf/xdfdump.c index 15064c18..b61bf92a 100644 --- a/tools/xdf/xdfdump.c +++ b/tools/xdf/xdfdump.c @@ -39,6 +39,15 @@ print_file_header(const FILE_HEADER *filehead) printf("\tTotal Headers Size=%d\n", filehead->f_size); } +void +read_syment(SYMBOL_ENTRY *syment, FILE *f) +{ + fread(&syment->e_sect_idx, sizeof(syment->e_sect_idx), 1, f); + fread(&syment->e_sect_off, sizeof(syment->e_sect_off), 1, f); + fread(&syment->e_name_off, sizeof(syment->e_name_off), 1, f); + fread(&syment->e_flags, sizeof(syment->e_flags), 1, f); +} + const char * get_syment_name(const SYMBOL_ENTRY *syment, FILE *f) { @@ -56,8 +65,8 @@ get_sym_name(u32 idx, FILE *f, size_t symtab_off) { SYMBOL_ENTRY syment; long oldpos = ftell(f); - fseek(f, symtab_off+idx*sizeof(SYMBOL_ENTRY), SEEK_SET); - fread(&syment, sizeof(syment), 1, f); + fseek(f, symtab_off+idx*SYMBOL_ENTRY_SIZE, SEEK_SET); + read_syment(&syment, f); fseek(f, oldpos, SEEK_SET); return get_syment_name(&syment, f); } @@ -67,8 +76,8 @@ get_sect_name(u32 idx, FILE *f, size_t symtab_off, size_t secttab_off) { SECTION_HEADER secthead; long oldpos = ftell(f); - fseek(f, secttab_off+idx*sizeof(SECTION_HEADER), SEEK_SET); - fread(§head, sizeof(secthead), 1, f); + fseek(f, secttab_off+idx*SECTION_HEADER_SIZE, SEEK_SET); + fread(§head.s_name_idx, sizeof(secthead.s_name_idx), 1, f); fseek(f, oldpos, SEEK_SET); return get_sym_name(secthead.s_name_idx, f, symtab_off); } @@ -88,7 +97,7 @@ print_symbol(const SYMBOL_ENTRY *syment, FILE *f, size_t symtab_off, if (first>0) printf("None"); printf(" Name=`%s' Section=", get_syment_name(syment, f)); - if ((long)syment->e_sect_idx < 0) + if (syment->e_sect_idx >= 0x80000000) printf("%d\n", syment->e_sect_idx); else printf("`%s' (%d)\n", @@ -201,7 +210,10 @@ main(int argc, char **argv) return EXIT_FAILURE; } - fread(&filehead, sizeof(filehead), 1, f); + fread(&filehead.f_magic, sizeof(filehead.f_magic), 1, f); + fread(&filehead.f_nsect, sizeof(filehead.f_nsect), 1, f); + fread(&filehead.f_nsyms, sizeof(filehead.f_nsyms), 1, f); + fread(&filehead.f_size, sizeof(filehead.f_size), 1, f); if (filehead.f_magic != XDF_MAGIC) { fprintf(stderr, "Magic number mismatch (expected %08X, got %08X\n", @@ -210,17 +222,25 @@ main(int argc, char **argv) } print_file_header(&filehead); - symtab_off = sizeof(FILE_HEADER)+filehead.f_nsect*sizeof(SECTION_HEADER); + symtab_off = FILE_HEADER_SIZE+filehead.f_nsect*SECTION_HEADER_SIZE; for (i=0; i Date: Sat, 19 Jan 2008 08:59:19 +0000 Subject: [PATCH 136/585] Make jmp with seg:off equ behave the same as NASM. Formerly: foo equ 1:2 jmp foo would result in a far jump. Now, an explicit "far" is required: jmp far foo to generate a far jump. In addition, the direct use of seg:off in immediates and effective addresses will result in an error; the use of EQU'ed seg:off values is still legal (and will still result in just the offset). This behavior is more sane and also matches NASM behavior. Thus: foo equ 1:2 mov ax, foo ; okay, just 2 mov ax, [foo] ; okay, just 2 mov ax, 1:2 ; illegal mov ax, [1:2] ; illegal svn path=/trunk/yasm/; revision=2028 --- libyasm/insn.c | 4 + libyasm/insn.h | 23 +++-- modules/arch/x86/tests/Makefile.inc | 4 + modules/arch/x86/tests/farbasic.asm | 2 +- modules/arch/x86/tests/jmpfar.asm | 16 +++ modules/arch/x86/tests/jmpfar.hex | 39 ++++++++ modules/arch/x86/tests/segoff-err.asm | 6 ++ modules/arch/x86/tests/segoff-err.errwarn | 4 + modules/arch/x86/tests/segoff.asm | 5 - modules/arch/x86/tests/segoff.hex | 15 --- modules/arch/x86/x86id.c | 33 ++++--- modules/objfmts/bin/tests/bin-farabs.asm | 8 +- modules/objfmts/bin/tests/bin-farabs.hex | 27 +++-- modules/parsers/nasm/nasm-parse.c | 114 +++++++++++++--------- 14 files changed, 191 insertions(+), 109 deletions(-) create mode 100644 modules/arch/x86/tests/jmpfar.asm create mode 100644 modules/arch/x86/tests/jmpfar.hex create mode 100644 modules/arch/x86/tests/segoff-err.asm create mode 100644 modules/arch/x86/tests/segoff-err.errwarn diff --git a/libyasm/insn.c b/libyasm/insn.c index 7127b410..46a78dbe 100644 --- a/libyasm/insn.c +++ b/libyasm/insn.c @@ -59,6 +59,7 @@ yasm_operand_create_reg(uintptr_t reg) retval->type = YASM_INSN__OPERAND_REG; retval->data.reg = reg; + retval->seg = 0; retval->targetmod = 0; retval->size = 0; retval->deref = 0; @@ -74,6 +75,7 @@ yasm_operand_create_segreg(uintptr_t segreg) retval->type = YASM_INSN__OPERAND_SEGREG; retval->data.reg = segreg; + retval->seg = 0; retval->targetmod = 0; retval->size = 0; retval->deref = 0; @@ -89,6 +91,7 @@ yasm_operand_create_mem(/*@only@*/ yasm_effaddr *ea) retval->type = YASM_INSN__OPERAND_MEMORY; retval->data.ea = ea; + retval->seg = 0; retval->targetmod = 0; retval->size = 0; retval->deref = 0; @@ -111,6 +114,7 @@ yasm_operand_create_imm(/*@only@*/ yasm_expr *val) retval = yasm_xmalloc(sizeof(yasm_insn_operand)); retval->type = YASM_INSN__OPERAND_IMM; retval->data.val = val; + retval->seg = 0; retval->targetmod = 0; retval->size = 0; retval->deref = 0; diff --git a/libyasm/insn.h b/libyasm/insn.h index ea3fe539..905b2f96 100644 --- a/libyasm/insn.h +++ b/libyasm/insn.h @@ -75,20 +75,20 @@ struct yasm_effaddr { /** An instruction operand (opaque type). */ typedef struct yasm_insn_operand yasm_insn_operand; +/** The type of an instruction operand. */ +typedef enum yasm_insn_operand_type { + YASM_INSN__OPERAND_REG = 1, /**< A register. */ + YASM_INSN__OPERAND_SEGREG, /**< A segment register. */ + YASM_INSN__OPERAND_MEMORY, /**< An effective address + * (memory reference). */ + YASM_INSN__OPERAND_IMM /**< An immediate or jump target. */ +} yasm_insn_operand_type; + /** An instruction operand. */ struct yasm_insn_operand { /** Link for building linked list of operands. \internal */ /*@reldef@*/ STAILQ_ENTRY(yasm_insn_operand) link; - /** Operand type. */ - enum yasm_insn_operand_type { - YASM_INSN__OPERAND_REG = 1, /**< A register. */ - YASM_INSN__OPERAND_SEGREG, /**< A segment register. */ - YASM_INSN__OPERAND_MEMORY, /**< An effective address - * (memory reference). */ - YASM_INSN__OPERAND_IMM /**< An immediate or jump target. */ - } type; - /** Operand data. */ union { uintptr_t reg; /**< Arch data for reg/segreg. */ @@ -96,6 +96,8 @@ struct yasm_insn_operand { yasm_expr *val; /**< Value of immediate or jump target. */ } data; + yasm_expr *seg; /**< Segment expression */ + uintptr_t targetmod; /**< Arch target modifier, 0 if none. */ /** Specified size of the operand, in bits. 0 if not user-specified. */ @@ -121,6 +123,9 @@ struct yasm_insn_operand { * "push strict dword 4", which sets this flag. */ unsigned int strict:1; + + /** Operand type. */ + unsigned int type:4; }; /** Base structure for "instruction" bytecodes. These are the mnenomic diff --git a/modules/arch/x86/tests/Makefile.inc b/modules/arch/x86/tests/Makefile.inc index 9069d2c2..b9f35d2b 100644 --- a/modules/arch/x86/tests/Makefile.inc +++ b/modules/arch/x86/tests/Makefile.inc @@ -72,6 +72,8 @@ EXTRA_DIST += modules/arch/x86/tests/jmp64-5.asm EXTRA_DIST += modules/arch/x86/tests/jmp64-5.hex EXTRA_DIST += modules/arch/x86/tests/jmp64-6.asm EXTRA_DIST += modules/arch/x86/tests/jmp64-6.hex +EXTRA_DIST += modules/arch/x86/tests/jmpfar.asm +EXTRA_DIST += modules/arch/x86/tests/jmpfar.hex EXTRA_DIST += modules/arch/x86/tests/lds-err.asm EXTRA_DIST += modules/arch/x86/tests/lds-err.errwarn EXTRA_DIST += modules/arch/x86/tests/loopadsz.asm @@ -144,6 +146,8 @@ EXTRA_DIST += modules/arch/x86/tests/segmov.asm EXTRA_DIST += modules/arch/x86/tests/segmov.hex EXTRA_DIST += modules/arch/x86/tests/segoff.asm EXTRA_DIST += modules/arch/x86/tests/segoff.hex +EXTRA_DIST += modules/arch/x86/tests/segoff-err.asm +EXTRA_DIST += modules/arch/x86/tests/segoff-err.errwarn EXTRA_DIST += modules/arch/x86/tests/shift.asm EXTRA_DIST += modules/arch/x86/tests/shift.hex EXTRA_DIST += modules/arch/x86/tests/simd-1.asm diff --git a/modules/arch/x86/tests/farbasic.asm b/modules/arch/x86/tests/farbasic.asm index 0c2648dc..625ed14d 100644 --- a/modules/arch/x86/tests/farbasic.asm +++ b/modules/arch/x86/tests/farbasic.asm @@ -2,7 +2,7 @@ jmp 5:4 -jmp equval +jmp far equval equval equ 6:7 diff --git a/modules/arch/x86/tests/jmpfar.asm b/modules/arch/x86/tests/jmpfar.asm new file mode 100644 index 00000000..92ef261b --- /dev/null +++ b/modules/arch/x86/tests/jmpfar.asm @@ -0,0 +1,16 @@ +jmp 1234:5678 ; YASM: far jump +jmp near 1234:5678 ; YASM: near jump; NASM: mismatch in operand sizes +jmp far 1234:5678 ; YASM: far jump; NASM: mismatch in operand sizes +;dw seg (1234:5678) +far1 equ 1234:5678 +jmp far1 ; both: near jump +jmp near far1 ; both: near jump +jmp far far1 ; YASM: far jump; NASM: value referenced by FAR is not relocatable +dw seg far1 +jmp far2 ; both: near jump +jmp near far2 ; both: near jump +jmp far far2 ; YASM: far jump; NASM: value referenced by FAR is not relocatable +dw seg far2 +far2 equ 1234:5678 +;mov ax, [1234:5678] ; YASM: invalid segment in effective address; NASM: invalid segment override +;mov ax, 1234:5678 ; YASM: immediate does not support segment; NASM: invalid combination of opcode and operands diff --git a/modules/arch/x86/tests/jmpfar.hex b/modules/arch/x86/tests/jmpfar.hex new file mode 100644 index 00000000..f9d3ea42 --- /dev/null +++ b/modules/arch/x86/tests/jmpfar.hex @@ -0,0 +1,39 @@ +ea +2e +16 +d2 +04 +e9 +26 +16 +ea +2e +16 +d2 +04 +e9 +1e +16 +e9 +1b +16 +ea +2e +16 +d2 +04 +d2 +04 +e9 +11 +16 +e9 +0e +16 +ea +2e +16 +d2 +04 +d2 +04 diff --git a/modules/arch/x86/tests/segoff-err.asm b/modules/arch/x86/tests/segoff-err.asm new file mode 100644 index 00000000..ac76927d --- /dev/null +++ b/modules/arch/x86/tests/segoff-err.asm @@ -0,0 +1,6 @@ +; all of these should be illegal + +jmp far[1:2] +mov ax,[1:2] +push dword [1:2] +mov ax,1:2 diff --git a/modules/arch/x86/tests/segoff-err.errwarn b/modules/arch/x86/tests/segoff-err.errwarn new file mode 100644 index 00000000..98a96c7b --- /dev/null +++ b/modules/arch/x86/tests/segoff-err.errwarn @@ -0,0 +1,4 @@ +-:3: error: invalid segment in effective address +-:4: error: invalid segment in effective address +-:5: error: invalid segment in effective address +-:6: error: immediate does not support segment diff --git a/modules/arch/x86/tests/segoff.asm b/modules/arch/x86/tests/segoff.asm index 987a7cf3..7a2091fe 100644 --- a/modules/arch/x86/tests/segoff.asm +++ b/modules/arch/x86/tests/segoff.asm @@ -1,10 +1,5 @@ ; all of these should be legal and should just result in the offset portion -jmp far[1:2] -mov ax,[1:2] -push dword [1:2] -mov ax,1:2 - foo equ 1:2 jmp far[foo] mov ax,[foo] diff --git a/modules/arch/x86/tests/segoff.hex b/modules/arch/x86/tests/segoff.hex index b83919ad..7520242a 100644 --- a/modules/arch/x86/tests/segoff.hex +++ b/modules/arch/x86/tests/segoff.hex @@ -13,18 +13,3 @@ ff b8 02 00 -ff -2e -02 -00 -a1 -02 -00 -66 -ff -36 -02 -00 -b8 -02 -00 diff --git a/modules/arch/x86/x86id.c b/modules/arch/x86/x86id.c index 13dcff60..d17f045c 100644 --- a/modules/arch/x86/x86id.c +++ b/modules/arch/x86/x86id.c @@ -360,7 +360,6 @@ x86_finalize_jmpfar(yasm_bytecode *bc, yasm_bytecode *prev_bc, unsigned int mode_bits = id_insn->mode_bits; x86_jmpfar *jmpfar; yasm_insn_operand *op; - /*@only@*/ yasm_expr *segment; jmpfar = yasm_xmalloc(sizeof(x86_jmpfar)); x86_finalize_common(&jmpfar->common, info, mode_bits); @@ -368,13 +367,9 @@ x86_finalize_jmpfar(yasm_bytecode *bc, yasm_bytecode *prev_bc, op = yasm_insn_ops_first(&id_insn->insn); - if (op->type == YASM_INSN__OPERAND_IMM && - yasm_expr_is_op(op->data.val, YASM_EXPR_SEGOFF)) { - /* SEG:OFF expression; split it. */ - segment = yasm_expr_extract_segoff(&op->data.val); - if (!segment) - yasm_internal_error(N_("didn't get SEG:OFF expression in jmpfar")); - if (yasm_value_finalize_expr(&jmpfar->segment, segment, prev_bc, 16)) + if (op->type == YASM_INSN__OPERAND_IMM && op->seg) { + /* SEG:OFF */ + if (yasm_value_finalize_expr(&jmpfar->segment, op->seg, prev_bc, 16)) yasm_error_set(YASM_ERROR_TOO_COMPLEX, N_("jump target segment too complex")); if (yasm_value_finalize_expr(&jmpfar->offset, op->data.val, prev_bc, @@ -383,13 +378,13 @@ x86_finalize_jmpfar(yasm_bytecode *bc, yasm_bytecode *prev_bc, N_("jump target offset too complex")); } else if (op->targetmod == X86_FAR) { /* "FAR imm" target needs to become "seg imm:imm". */ - if (yasm_value_finalize_expr(&jmpfar->offset, - yasm_expr_copy(op->data.val), prev_bc, 0) - || yasm_value_finalize_expr(&jmpfar->segment, op->data.val, - prev_bc, 16)) + yasm_expr *e = yasm_expr_create_branch(YASM_EXPR_SEG, + yasm_expr_copy(op->data.val), + op->data.val->line); + if (yasm_value_finalize_expr(&jmpfar->offset, op->data.val, prev_bc, 0) + || yasm_value_finalize_expr(&jmpfar->segment, e, prev_bc, 16)) yasm_error_set(YASM_ERROR_TOO_COMPLEX, N_("jump target expression too complex")); - jmpfar->segment.seg_of = 1; } else yasm_internal_error(N_("didn't get FAR expression in jmpfar")); @@ -785,8 +780,7 @@ x86_find_match(x86_id_insn *id_insn, yasm_insn_operand **ops, break; case OPT_ImmNotSegOff: if (op->type != YASM_INSN__OPERAND_IMM || - op->targetmod != 0 || - yasm_expr_is_op(op->data.val, YASM_EXPR_SEGOFF)) + op->targetmod != 0 || op->seg) mismatch = 1; break; case OPT_XMM0: @@ -1173,6 +1167,9 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) yasm_internal_error( N_("invalid operand conversion")); case YASM_INSN__OPERAND_MEMORY: + if (op->seg) + yasm_error_set(YASM_ERROR_VALUE, + N_("invalid segment in effective address")); insn->x86_ea = (x86_effaddr *)op->data.ea; if (info_ops[i].type == OPT_MemOffs) /* Special-case for MOV MemOffs instruction */ @@ -1197,6 +1194,9 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) } break; case OPA_Imm: + if (op->seg) + yasm_error_set(YASM_ERROR_VALUE, + N_("immediate does not support segment")); if (op->type == YASM_INSN__OPERAND_IMM) { imm = op->data.val; im_len = size_lookup[info_ops[i].size]; @@ -1204,6 +1204,9 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) yasm_internal_error(N_("invalid operand conversion")); break; case OPA_SImm: + if (op->seg) + yasm_error_set(YASM_ERROR_VALUE, + N_("immediate does not support segment")); if (op->type == YASM_INSN__OPERAND_IMM) { imm = op->data.val; im_len = size_lookup[info_ops[i].size]; diff --git a/modules/objfmts/bin/tests/bin-farabs.asm b/modules/objfmts/bin/tests/bin-farabs.asm index e26bcbc6..4d931c1e 100644 --- a/modules/objfmts/bin/tests/bin-farabs.asm +++ b/modules/objfmts/bin/tests/bin-farabs.asm @@ -14,14 +14,16 @@ mov es, ax ; Use without seg should yield just the offset part. mov bx, keybuf -mov bx, 0040h:001Eh ; Illegal in NASM ("invalid combination...") +;mov bx, 0040h:001Eh ; Illegal ; Each of the below pairs should be equivalent (and legal) in Yasm. ; There are some differences from NASM here! +; Defaults to near jump (on both NASM and Yasm) +jmp keybuf + ; Direct far jump. -jmp keybuf ; Results in a near jump in NASM -jmp 0040h:001Eh ; But Yasm sees the equ value as equivalent to this +jmp 0040h:001Eh ; Force near (non-far) jump (just offset, no segment). jmp near keybuf diff --git a/modules/objfmts/bin/tests/bin-farabs.hex b/modules/objfmts/bin/tests/bin-farabs.hex index 6f626b56..5ebd4225 100644 --- a/modules/objfmts/bin/tests/bin-farabs.hex +++ b/modules/objfmts/bin/tests/bin-farabs.hex @@ -9,36 +9,31 @@ c0 bb 1e 00 -bb -1e -00 -ea -1e -00 -40 -00 +e9 +10 +ff ea 1e 00 40 00 e9 -03 +08 ff e9 -00 +05 ff e9 -fd +02 +ff +e9 +e1 fe e9 -dc -fe -e9 -d9 +de 0e e9 -d6 +db 4e eb fe diff --git a/modules/parsers/nasm/nasm-parse.c b/modules/parsers/nasm/nasm-parse.c index db08275f..88d2297b 100644 --- a/modules/parsers/nasm/nasm-parse.c +++ b/modules/parsers/nasm/nasm-parse.c @@ -35,8 +35,8 @@ RCSID("$Id$"); typedef enum { NORM_EXPR, - DIR_EXPR, - DV_EXPR + DIR_EXPR, /* Can't have seg:off or WRT anywhere */ + DV_EXPR /* Can't have registers anywhere */ } expr_type; static yasm_bytecode *parse_line(yasm_parser_nasm *parser_nasm); @@ -46,7 +46,7 @@ static yasm_bytecode *parse_times(yasm_parser_nasm *parser_nasm); static yasm_bytecode *parse_exp(yasm_parser_nasm *parser_nasm); static yasm_bytecode *parse_instr(yasm_parser_nasm *parser_nasm); static yasm_insn_operand *parse_operand(yasm_parser_nasm *parser_nasm); -static yasm_effaddr *parse_memaddr(yasm_parser_nasm *parser_nasm); +static yasm_insn_operand *parse_memaddr(yasm_parser_nasm *parser_nasm); static yasm_expr *parse_expr(yasm_parser_nasm *parser_nasm, expr_type type); static yasm_expr *parse_bexpr(yasm_parser_nasm *parser_nasm, expr_type type); static yasm_expr *parse_expr0(yasm_parser_nasm *parser_nasm, expr_type type); @@ -475,7 +475,7 @@ parse_times(yasm_parser_nasm *parser_nasm) yasm_expr *multiple; yasm_bytecode *bc; - multiple = parse_expr(parser_nasm, DV_EXPR); + multiple = parse_bexpr(parser_nasm, DV_EXPR); if (!multiple) { yasm_error_set(YASM_ERROR_SYNTAX, N_("expression expected after %s"), "TIMES"); @@ -526,7 +526,7 @@ parse_exp(yasm_parser_nasm *parser_nasm) goto dv_done; } } - if ((e = parse_expr(parser_nasm, DV_EXPR))) + if ((e = parse_bexpr(parser_nasm, DV_EXPR))) dv = yasm_dv_create_expr(e); else { yasm_error_set(YASM_ERROR_SYNTAX, @@ -554,7 +554,7 @@ dv_done: unsigned int size = RESERVE_SPACE_val/8; yasm_expr *e; get_next_token(); - e = parse_expr(parser_nasm, DV_EXPR); + e = parse_bexpr(parser_nasm, DV_EXPR); if (!e) { yasm_error_set(YASM_ERROR_SYNTAX, N_("expression expected after %s"), "RESx"); @@ -582,7 +582,7 @@ dv_done: get_next_token(); if (is_eol()) goto incbin_done; - start = parse_expr(parser_nasm, DV_EXPR); + start = parse_bexpr(parser_nasm, DV_EXPR); if (!start) { yasm_error_set(YASM_ERROR_SYNTAX, N_("expression expected for INCBIN start")); @@ -594,7 +594,7 @@ dv_done: get_next_token(); if (is_eol()) goto incbin_done; - maxlen = parse_expr(parser_nasm, DV_EXPR); + maxlen = parse_bexpr(parser_nasm, DV_EXPR); if (!maxlen) { yasm_error_set(YASM_ERROR_SYNTAX, N_("expression expected for INCBIN maximum length")); @@ -685,19 +685,18 @@ parse_operand(yasm_parser_nasm *parser_nasm) switch (curtok) { case '[': { - yasm_effaddr *ea; get_next_token(); - ea = parse_memaddr(parser_nasm); + op = parse_memaddr(parser_nasm); expect(']'); get_next_token(); - if (!ea) { + if (!op) { yasm_error_set(YASM_ERROR_SYNTAX, N_("memory address expected")); return NULL; } - return yasm_operand_create_mem(ea); + return op; } case SEGREG: op = yasm_operand_create_segreg(SEGREG_val); @@ -756,19 +755,32 @@ parse_operand(yasm_parser_nasm *parser_nasm) } default: { - yasm_expr *e = parse_expr(parser_nasm, NORM_EXPR); + yasm_expr *e = parse_bexpr(parser_nasm, NORM_EXPR); if (!e) return NULL; - return yasm_operand_create_imm(e); + if (curtok != ':') + return yasm_operand_create_imm(e); + else { + yasm_expr *off; + get_next_token(); + off = parse_bexpr(parser_nasm, NORM_EXPR); + if (!off) { + yasm_expr_destroy(e); + return NULL; + } + op = yasm_operand_create_imm(off); + op->seg = e; + return op; + } } } } /* memory addresses */ -static yasm_effaddr * +static yasm_insn_operand * parse_memaddr(yasm_parser_nasm *parser_nasm) { - yasm_effaddr *ea; + yasm_insn_operand *op; switch (curtok) { case SEGREG: { @@ -780,48 +792,63 @@ parse_memaddr(yasm_parser_nasm *parser_nasm) return NULL; } get_next_token(); - ea = parse_memaddr(parser_nasm); - if (ea) - yasm_ea_set_segreg(ea, segreg); - return ea; + op = parse_memaddr(parser_nasm); + if (op) + yasm_ea_set_segreg(op->data.ea, segreg); + return op; } case SIZE_OVERRIDE: { unsigned int size = SIZE_OVERRIDE_val; get_next_token(); - ea = parse_memaddr(parser_nasm); - if (ea) - ea->disp.size = size; - return ea; + op = parse_memaddr(parser_nasm); + if (op) + op->data.ea->disp.size = size; + return op; } case NOSPLIT: get_next_token(); - ea = parse_memaddr(parser_nasm); - if (ea) - ea->nosplit = 1; - return ea; + op = parse_memaddr(parser_nasm); + if (op) + op->data.ea->nosplit = 1; + return op; case REL: get_next_token(); - ea = parse_memaddr(parser_nasm); - if (ea) { - ea->pc_rel = 1; - ea->not_pc_rel = 0; + op = parse_memaddr(parser_nasm); + if (op) { + op->data.ea->pc_rel = 1; + op->data.ea->not_pc_rel = 0; } - return ea; + return op; case ABS: get_next_token(); - ea = parse_memaddr(parser_nasm); - if (ea) { - ea->pc_rel = 0; - ea->not_pc_rel = 1; + op = parse_memaddr(parser_nasm); + if (op) { + op->data.ea->pc_rel = 0; + op->data.ea->not_pc_rel = 1; } - return ea; + return op; default: { - yasm_expr *e = parse_expr(parser_nasm, NORM_EXPR); + yasm_expr *e = parse_bexpr(parser_nasm, NORM_EXPR); if (!e) return NULL; - return yasm_arch_ea_create(p_object->arch, e); + if (curtok != ':') + return yasm_operand_create_mem( + yasm_arch_ea_create(p_object->arch, e)); + else { + yasm_expr *off; + get_next_token(); + off = parse_bexpr(parser_nasm, NORM_EXPR); + if (!off) { + yasm_expr_destroy(e); + return NULL; + } + op = yasm_operand_create_mem( + yasm_arch_ea_create(p_object->arch, off)); + op->seg = e; + return op; + } } } } @@ -869,14 +896,11 @@ static yasm_expr * parse_expr(yasm_parser_nasm *parser_nasm, expr_type type) { switch (type) { - case NORM_EXPR: - parse_expr_common(parse_bexpr, ':', parse_bexpr, YASM_EXPR_SEGOFF); - case DV_EXPR: - /* dataval expressions can't handle seg:off */ - return parse_bexpr(parser_nasm, type); case DIR_EXPR: /* directive expressions can't handle seg:off or WRT */ return parse_expr0(parser_nasm, type); + default: + parse_expr_common(parse_bexpr, ':', parse_bexpr, YASM_EXPR_SEGOFF); } /*@notreached@*/ return NULL; From e212c413209e55be9df90be25ca5d33782418362 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Mon, 28 Jan 2008 05:48:26 +0000 Subject: [PATCH 137/585] Don't generate 0x90 opcode for xchg rax, r8 and varieties thereof. Without this fix, "xchg eax, r8d" results in 41 90, which is an invalid opcode. Reported by: Stefan svn path=/trunk/yasm/; revision=2029 --- modules/arch/x86/gen_x86_insn.py | 12 ++++---- modules/arch/x86/tests/xchg64.asm | 22 +++++++++++++++ modules/arch/x86/tests/xchg64.hex | 47 +++++++++++++++++++++++++++++++ modules/arch/x86/x86id.c | 23 ++++++++++++++- 4 files changed, 97 insertions(+), 7 deletions(-) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index fd923d4f..bb1ec5fe 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -1357,12 +1357,12 @@ add_group("xchg", opersize=16, opcode=[0x90], operands=[Operand(type="Areg", size=16, dest=None), - Operand(type="Reg", size=16, dest="Op0Add")]) + Operand(type="RegNotR8", size=16, dest="Op0Add")]) add_group("xchg", suffix="w", opersize=16, opcode=[0x90], - operands=[Operand(type="Reg", size=16, dest="Op0Add"), + operands=[Operand(type="RegNotR8", size=16, dest="Op0Add"), Operand(type="Areg", size=16, dest=None)]) add_group("xchg", suffix="w", @@ -1396,12 +1396,12 @@ add_group("xchg", opersize=32, opcode=[0x90], operands=[Operand(type="Areg", size=32, dest=None), - Operand(type="Reg", size=32, dest="Op0Add")]) + Operand(type="RegNotR8", size=32, dest="Op0Add")]) add_group("xchg", suffix="l", opersize=32, opcode=[0x90], - operands=[Operand(type="Reg", size=32, dest="Op0Add"), + operands=[Operand(type="RegNotR8", size=32, dest="Op0Add"), Operand(type="Areg", size=32, dest=None)]) add_group("xchg", suffix="l", @@ -1428,12 +1428,12 @@ add_group("xchg", opersize=64, opcode=[0x90], operands=[Operand(type="Areg", size=64, dest=None), - Operand(type="Reg", size=64, dest="Op0Add")]) + Operand(type="RegNotR8", size=64, dest="Op0Add")]) add_group("xchg", suffix="q", opersize=64, opcode=[0x90], - operands=[Operand(type="Reg", size=64, dest="Op0Add"), + operands=[Operand(type="RegNotR8", size=64, dest="Op0Add"), Operand(type="Areg", size=64, dest=None)]) add_group("xchg", suffix="q", diff --git a/modules/arch/x86/tests/xchg64.asm b/modules/arch/x86/tests/xchg64.asm index d6a13949..794d4f1c 100644 --- a/modules/arch/x86/tests/xchg64.asm +++ b/modules/arch/x86/tests/xchg64.asm @@ -8,3 +8,25 @@ xchg ebx, eax xchg rax, rax xchg rax, rbx xchg rbx, rax + +xchg al, al +xchg al, r8b +xchg r8b, al + +xchg ax, ax +xchg ax, r8w +xchg r8w, ax +xchg ax, r9w +xchg r9w, ax + +xchg eax, eax +xchg eax, r8d +xchg r8d, eax +xchg eax, r9d +xchg r9d, eax + +xchg rax, rax +xchg rax, r8 +xchg r8, rax +xchg rax, r9 +xchg r9, rax diff --git a/modules/arch/x86/tests/xchg64.hex b/modules/arch/x86/tests/xchg64.hex index f7149e3d..d052b668 100644 --- a/modules/arch/x86/tests/xchg64.hex +++ b/modules/arch/x86/tests/xchg64.hex @@ -13,3 +13,50 @@ c0 93 48 93 +86 +c0 +44 +86 +c0 +41 +86 +c0 +66 +90 +66 +44 +87 +c0 +66 +41 +87 +c0 +66 +41 +91 +66 +41 +91 +87 +c0 +44 +87 +c0 +41 +87 +c0 +41 +91 +41 +91 +90 +4c +87 +c0 +49 +87 +c0 +49 +91 +49 +91 diff --git a/modules/arch/x86/x86id.c b/modules/arch/x86/x86id.c index d17f045c..874ad010 100644 --- a/modules/arch/x86/x86id.c +++ b/modules/arch/x86/x86id.c @@ -105,7 +105,9 @@ enum x86_operand_type { /* EAX memory operand only (EA) [special case for SVM skinit opcode] */ OPT_MemEAX = 26, /* SIMDReg with value equal to operand 0 SIMDReg */ - OPT_SIMDRegMatch0 = 27 + OPT_SIMDRegMatch0 = 27, + /* Reg with value != 8 [special case for xchg r8, rax] */ + OPT_RegNotR8 = 28 }; enum x86_operand_size { @@ -806,6 +808,25 @@ x86_find_match(x86_id_insn *id_insn, yasm_insn_operand **ops, mismatch = 1; break; } + case OPT_RegNotR8: + if (op->type != YASM_INSN__OPERAND_REG || + ((op->data.reg&0xFUL) == 8)) + mismatch = 1; + else { + switch ((x86_expritem_reg_size)(op->data.reg&~0xFUL)) { + case X86_REG8: + case X86_REG8X: + case X86_REG16: + case X86_REG32: + case X86_REG64: + case X86_FPUREG: + break; + default: + mismatch = 1; + break; + } + } + break; default: yasm_internal_error(N_("invalid operand type")); } From e03b37ca5d4e684cee984cb7044ff5c14e5e3351 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 31 Jan 2008 02:25:12 +0000 Subject: [PATCH 138/585] Add Visual Studio 2008 build files. Contributed by: Brian Gladman svn path=/trunk/yasm/; revision=2030 --- Mkfiles/vc9/config.h | 177 ++++++ Mkfiles/vc9/crt_secure_no_deprecate.vsprops | 11 + Mkfiles/vc9/genmacro/genmacro.vcproj | 200 +++++++ Mkfiles/vc9/genmacro/run.bat | 2 + Mkfiles/vc9/genmodule/genmodule.vcproj | 204 +++++++ Mkfiles/vc9/genmodule/run.bat | 3 + Mkfiles/vc9/genperf/genperf.vcproj | 232 ++++++++ Mkfiles/vc9/genperf/run.bat | 19 + Mkfiles/vc9/genstring/genstring.vcproj | 200 +++++++ Mkfiles/vc9/genstring/run.bat | 2 + Mkfiles/vc9/genversion/genversion.vcproj | 211 +++++++ Mkfiles/vc9/genversion/run.bat | 2 + Mkfiles/vc9/libyasm-stdint.h | 8 + Mkfiles/vc9/libyasm/libyasm.vcproj | 572 +++++++++++++++++++ Mkfiles/vc9/modules/modules.vcproj | 594 ++++++++++++++++++++ Mkfiles/vc9/re2c/re2c.vcproj | 280 +++++++++ Mkfiles/vc9/re2c/run.bat | 4 + Mkfiles/vc9/readme.vc9.txt | 93 +++ Mkfiles/vc9/yasm.rules | 114 ++++ Mkfiles/vc9/yasm.sln | 128 +++++ Mkfiles/vc9/yasm.vcproj | 410 ++++++++++++++ 21 files changed, 3466 insertions(+) create mode 100644 Mkfiles/vc9/config.h create mode 100644 Mkfiles/vc9/crt_secure_no_deprecate.vsprops create mode 100644 Mkfiles/vc9/genmacro/genmacro.vcproj create mode 100644 Mkfiles/vc9/genmacro/run.bat create mode 100644 Mkfiles/vc9/genmodule/genmodule.vcproj create mode 100644 Mkfiles/vc9/genmodule/run.bat create mode 100644 Mkfiles/vc9/genperf/genperf.vcproj create mode 100644 Mkfiles/vc9/genperf/run.bat create mode 100644 Mkfiles/vc9/genstring/genstring.vcproj create mode 100644 Mkfiles/vc9/genstring/run.bat create mode 100644 Mkfiles/vc9/genversion/genversion.vcproj create mode 100644 Mkfiles/vc9/genversion/run.bat create mode 100644 Mkfiles/vc9/libyasm-stdint.h create mode 100644 Mkfiles/vc9/libyasm/libyasm.vcproj create mode 100644 Mkfiles/vc9/modules/modules.vcproj create mode 100644 Mkfiles/vc9/re2c/re2c.vcproj create mode 100644 Mkfiles/vc9/re2c/run.bat create mode 100644 Mkfiles/vc9/readme.vc9.txt create mode 100644 Mkfiles/vc9/yasm.rules create mode 100644 Mkfiles/vc9/yasm.sln create mode 100644 Mkfiles/vc9/yasm.vcproj diff --git a/Mkfiles/vc9/config.h b/Mkfiles/vc9/config.h new file mode 100644 index 00000000..739687d0 --- /dev/null +++ b/Mkfiles/vc9/config.h @@ -0,0 +1,177 @@ +/* $Id: config.h 1137 2004-09-04 01:24:57Z peter $ */ + +#define yasm__splitpath(path, tail) yasm__splitpath_win(path, tail) +#define yasm__abspath(path) yasm__abspath_win(path) +#define yasm__combpath(from, to) yasm__combpath_win(from, to) + +/* Command name to run C preprocessor */ +#define CPP_PROG "cpp" + +/* */ +/* #undef ENABLE_NLS */ + +/* Define if you have the `abort' function. */ +#define HAVE_ABORT 1 + +/* */ +/* #undef HAVE_CATGETS */ + +/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYCURRENT */ + +/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +/* #undef HAVE_DCGETTEXT */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DIRECT_H 1 + +/* Define to 1 if you have the `getcwd' function. */ +#define HAVE_GETCWD 1 + +/* */ +/* #undef HAVE_GETTEXT */ + +/* Define if you have the GNU C Library */ +/* #undef HAVE_GNU_C_LIBRARY */ + +/* Define if you have the iconv() function. */ +/* #undef HAVE_ICONV */ + +/* Define if you have the header file. */ +/* #undef HAVE_INTTYPES_H */ + +/* */ +/* #undef HAVE_LC_MESSAGES */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LIBGEN_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_MEMORY_H */ + +/* Define if you have the `mergesort' function. */ +/* #undef HAVE_MERGESORT */ + +/* Define to 1 if you have the `popen' function. */ +/* #undef HAVE_POPEN */ + +/* Define if you have the header file. */ +/* #undef HAVE_STDINT_H */ + +/* Define if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* */ +/* #undef HAVE_STPCPY */ + +/* Define if you have the `strcasecmp' function. */ +/* #undef HAVE_STRCASECMP */ + +/* Define if you have the `strcmpi' function. */ +/* #undef HAVE_STRCMPI */ + +/* Define if you have the `stricmp' function. */ +/* #undefine HAVE_STRICMP */ + +/* Define if you have the header file. */ +/* #undef HAVE_STRINGS_H */ + +/* Define if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define if you have the `strncasecmp' function. */ +/* #undef HAVE_STRNCASECMP */ + +/* Define if you have the `strsep' function. */ +/* #undef HAVE_STRSEP */ + +/* Define if you have the header file. */ +/* #undef HAVE_SYS_STAT_H */ + +/* Define if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define if you have the `toascii' function. */ +#define HAVE_TOASCII 1 +#define toascii __toascii + +/* Define if you have the header file. */ +/* #undef HAVE_UNISTD_H */ + +/* Define to 1 if you have the `vsnprintf' function. */ +/* #undef HAVE_VSNPRINTF */ + +/* Define to 1 if you have the `_stricmp' function. */ +#define HAVE__STRICMP 1 + +/* Name of package */ +#define PACKAGE "yasm" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "bug-yasm@tortall.net" + +/* Define to build version of this package. */ +#define PACKAGE_BUILD "2029" + +/* Define to internal version of this package. */ +#define PACKAGE_INTVER "0.6.99" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "yasm" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "yasm 2029" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "yasm" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "2029" + +/* Define if the C compiler supports function prototypes. */ +#define PROTOTYPES 1 + +/* The size of a `char', as computed by sizeof. */ +/* #undef SIZEOF_CHAR */ + +/* The size of a `int', as computed by sizeof. */ +/* #undef SIZEOF_INT */ + +/* The size of a `long', as computed by sizeof. */ +/* #undef SIZEOF_LONG */ + +/* The size of a `short', as computed by sizeof. */ +/* #undef SIZEOF_SHORT */ + +/* The size of a `void*', as computed by sizeof. */ +/* #undef SIZEOF_VOIDP */ + +/* Define if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Version number of package */ +#define VERSION "2029" + +/* Define if using the dmalloc debugging malloc package */ +/* #undef WITH_DMALLOC */ + +/* Define like PROTOTYPES; this can be used by system headers. */ +#define __PROTOTYPES 1 + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define as `__inline' if that's what the C compiler calls it, or to nothing + if it is not supported. */ +#ifndef __cplusplus +/* #undef inline */ +#endif + +/* Define to `unsigned' if doesn't define. */ +/* #undef size_t */ diff --git a/Mkfiles/vc9/crt_secure_no_deprecate.vsprops b/Mkfiles/vc9/crt_secure_no_deprecate.vsprops new file mode 100644 index 00000000..d61ba30a --- /dev/null +++ b/Mkfiles/vc9/crt_secure_no_deprecate.vsprops @@ -0,0 +1,11 @@ + + + + diff --git a/Mkfiles/vc9/genmacro/genmacro.vcproj b/Mkfiles/vc9/genmacro/genmacro.vcproj new file mode 100644 index 00000000..2213150e --- /dev/null +++ b/Mkfiles/vc9/genmacro/genmacro.vcproj @@ -0,0 +1,200 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Mkfiles/vc9/genmacro/run.bat b/Mkfiles/vc9/genmacro/run.bat new file mode 100644 index 00000000..f3323e72 --- /dev/null +++ b/Mkfiles/vc9/genmacro/run.bat @@ -0,0 +1,2 @@ +cd ..\..\.. +%1 modules\preprocs\nasm\standard.mac version.mac diff --git a/Mkfiles/vc9/genmodule/genmodule.vcproj b/Mkfiles/vc9/genmodule/genmodule.vcproj new file mode 100644 index 00000000..ab1f107c --- /dev/null +++ b/Mkfiles/vc9/genmodule/genmodule.vcproj @@ -0,0 +1,204 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Mkfiles/vc9/genmodule/run.bat b/Mkfiles/vc9/genmodule/run.bat new file mode 100644 index 00000000..e34a4169 --- /dev/null +++ b/Mkfiles/vc9/genmodule/run.bat @@ -0,0 +1,3 @@ +@echo off +cd ..\..\.. +%1 libyasm\module.in Makefile.am diff --git a/Mkfiles/vc9/genperf/genperf.vcproj b/Mkfiles/vc9/genperf/genperf.vcproj new file mode 100644 index 00000000..5ad018d7 --- /dev/null +++ b/Mkfiles/vc9/genperf/genperf.vcproj @@ -0,0 +1,232 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Mkfiles/vc9/genperf/run.bat b/Mkfiles/vc9/genperf/run.bat new file mode 100644 index 00000000..64ec1ae3 --- /dev/null +++ b/Mkfiles/vc9/genperf/run.bat @@ -0,0 +1,19 @@ +cd ..\..\.. +@echo off +reg query HKCR\Python.File\shell\open\command >nul: 2>&1 +goto answer%errorlevel% +:answer0 +echo ... building with Python ... +@echo on +modules\arch\x86\gen_x86_insn.py +@echo off +goto end +:answer1 +echo ... building without Python ... +goto end +:end +@echo on +%1 x86insn_nasm.gperf x86insn_nasm.c +%1 x86insn_gas.gperf x86insn_gas.c +%1 modules\arch\x86\x86cpu.gperf x86cpu.c +%1 modules\arch\x86\x86regtmod.gperf x86regtmod.c diff --git a/Mkfiles/vc9/genstring/genstring.vcproj b/Mkfiles/vc9/genstring/genstring.vcproj new file mode 100644 index 00000000..a0c99d93 --- /dev/null +++ b/Mkfiles/vc9/genstring/genstring.vcproj @@ -0,0 +1,200 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Mkfiles/vc9/genstring/run.bat b/Mkfiles/vc9/genstring/run.bat new file mode 100644 index 00000000..5864b1dc --- /dev/null +++ b/Mkfiles/vc9/genstring/run.bat @@ -0,0 +1,2 @@ +cd ..\..\.. +%1 license_msg license.c COPYING diff --git a/Mkfiles/vc9/genversion/genversion.vcproj b/Mkfiles/vc9/genversion/genversion.vcproj new file mode 100644 index 00000000..95daa6ab --- /dev/null +++ b/Mkfiles/vc9/genversion/genversion.vcproj @@ -0,0 +1,211 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Mkfiles/vc9/genversion/run.bat b/Mkfiles/vc9/genversion/run.bat new file mode 100644 index 00000000..30edf8f1 --- /dev/null +++ b/Mkfiles/vc9/genversion/run.bat @@ -0,0 +1,2 @@ +cd ..\..\.. +%1 version.mac diff --git a/Mkfiles/vc9/libyasm-stdint.h b/Mkfiles/vc9/libyasm-stdint.h new file mode 100644 index 00000000..fed61b33 --- /dev/null +++ b/Mkfiles/vc9/libyasm-stdint.h @@ -0,0 +1,8 @@ +#ifndef _UINTPTR_T_DEFINED +#ifdef _WIN64 +#include +#else +typedef unsigned long uintptr_t; +#endif +#define _UINTPTR_T_DEFINED +#endif diff --git a/Mkfiles/vc9/libyasm/libyasm.vcproj b/Mkfiles/vc9/libyasm/libyasm.vcproj new file mode 100644 index 00000000..95e3deff --- /dev/null +++ b/Mkfiles/vc9/libyasm/libyasm.vcproj @@ -0,0 +1,572 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Mkfiles/vc9/modules/modules.vcproj b/Mkfiles/vc9/modules/modules.vcproj new file mode 100644 index 00000000..62db9028 --- /dev/null +++ b/Mkfiles/vc9/modules/modules.vcproj @@ -0,0 +1,594 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Mkfiles/vc9/re2c/re2c.vcproj b/Mkfiles/vc9/re2c/re2c.vcproj new file mode 100644 index 00000000..2428e8fd --- /dev/null +++ b/Mkfiles/vc9/re2c/re2c.vcproj @@ -0,0 +1,280 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Mkfiles/vc9/re2c/run.bat b/Mkfiles/vc9/re2c/run.bat new file mode 100644 index 00000000..cde2a7b6 --- /dev/null +++ b/Mkfiles/vc9/re2c/run.bat @@ -0,0 +1,4 @@ +cd ..\..\..\ +%1 -s -o lc3bid.c modules\arch\lc3b\lc3bid.re +%1 -b -o nasm-token.c modules\parsers\nasm\nasm-token.re +%1 -b -o gas-token.c modules\parsers\gas\gas-token.re diff --git a/Mkfiles/vc9/readme.vc9.txt b/Mkfiles/vc9/readme.vc9.txt new file mode 100644 index 00000000..caec9e66 --- /dev/null +++ b/Mkfiles/vc9/readme.vc9.txt @@ -0,0 +1,93 @@ + +Building YASM with Microsoft Visual Studio 2008 +----------------------------------------------- + +This note describes how to build YASM using Microsoft Visual +Studio 2008. + +1. The Compiler +--------------- + +If you want to build the 64-bit version of YASM you will need to install the Visual Studio 2008 64-bit tools, which may not be +installed by default. + +2. YASM Download +---------------- + +First YASM needs to be downloaded and the files placed within +a suitable directory, which will be called here but can +be named and located as you wish. + +3. Building YASM with Microsoft VC9 +----------------------------------- + +Now locate and double click on the yasm.sln solution file in +the 'Mkfiles/vc9' subdirectory to open the build project in +the Visual Studio 2008 IDE and then select: + + win32 or x64 build + release or debug build + +as appropriate to build the YASM binaries that you need. + +4. Using YASM with Visual Sudio 2008 and VC++ version 9 +------------------------------------------------------- + +1. Firstly you need to locate the directory (or directories) +where the VC++ compiler binaries are located and put copies +of the appropriate yasm.exe binary in these directories. A +typical location is: + +C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin + +Depending on your system you can use either the win32 or the +x64 version of YASM. + +2. To use the new custom tools facility in Visual Studio 2008, +you need to place a copy of the yasm.rules file in the Visual +Studio 2008 VC project defaults directory, which is typically +located at: + +C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC + \VCProjectDefaults + +This allows you to configure YASM as an assembler within the VC++ +IDE. To use YASM in a project, right click on the project in the +Solution Explorer and select 'Custom Build Rules..'. This will +give you a dialog box that allows you to select YASM as an +assembler (note that your assembler files need to have the +extension '.asm'). + +To assemble a file with YASM, select the Property Page for the +file and the select 'Yasm Assembler' in the Tool dialog entry. +Then click 'Apply' and an additional property page entry will +appear and enable YASM settings to be established. + +As alternative to placing the yasm.rules files as described +above is to set the rules file path in the Visual Studio 2008 +settings dialogue. + +5. A Linker Issue +----------------- + +There appears to be a linker bug in the VC++ v9 linker that +prevents symbols with absolute addresses being linked in DLL +builds. This means, for example, that LEA instructions of +the general form: + + lea, rax,[rax+symbol] + +cannot be used for DLL builds. The following general form +has to be used instead: + + lea rcx,[symbol wrt rip] + lea rax,[rax+rcx] + +This limitation may also cause problems with other instruction +that use absolute addresses. + +I am most grateful for the fantastic support that Peter Johnson, +YASM's creator, has given me in tracking down this issue. + + Brian Gladman, 30th January 2008 + diff --git a/Mkfiles/vc9/yasm.rules b/Mkfiles/vc9/yasm.rules new file mode 100644 index 00000000..f2e2eccc --- /dev/null +++ b/Mkfiles/vc9/yasm.rules @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Mkfiles/vc9/yasm.sln b/Mkfiles/vc9/yasm.sln new file mode 100644 index 00000000..ee80f7d9 --- /dev/null +++ b/Mkfiles/vc9/yasm.sln @@ -0,0 +1,128 @@ +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{825AC694-358C-4D8D-92DE-33A2691978CE}" + ProjectSection(SolutionItems) = preProject + crt_secure_no_deprecate.vsprops = crt_secure_no_deprecate.vsprops + readme.vc8.txt = readme.vc8.txt + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libyasm", "libyasm\libyasm.vcproj", "{29FE7874-1256-4AD6-B889-68E399DC9608}" + ProjectSection(ProjectDependencies) = postProject + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0} = {F0E8B707-00C5-4FF2-B8EF-7C39817132A0} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "modules", "modules\modules.vcproj", "{D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}" + ProjectSection(ProjectDependencies) = postProject + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619} = {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619} + {225700A5-07B8-434E-AD61-555278BF6733} = {225700A5-07B8-434E-AD61-555278BF6733} + {29FE7874-1256-4AD6-B889-68E399DC9608} = {29FE7874-1256-4AD6-B889-68E399DC9608} + {3C58BE13-50A3-4583-984D-D8902B3D7713} = {3C58BE13-50A3-4583-984D-D8902B3D7713} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yasm", "yasm.vcproj", "{34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}" + ProjectSection(ProjectDependencies) = postProject + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6} = {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6} + {29FE7874-1256-4AD6-B889-68E399DC9608} = {29FE7874-1256-4AD6-B889-68E399DC9608} + {021CEB0A-F721-4F59-B349-9CEEAF244459} = {021CEB0A-F721-4F59-B349-9CEEAF244459} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genmacro", "genmacro\genmacro.vcproj", "{225700A5-07B8-434E-AD61-555278BF6733}" + ProjectSection(ProjectDependencies) = postProject + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2} = {B545983B-8EE0-4A7B-A67A-E749EEAE62A2} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genversion", "genversion\genversion.vcproj", "{B545983B-8EE0-4A7B-A67A-E749EEAE62A2}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "re2c", "re2c\re2c.vcproj", "{3C58BE13-50A3-4583-984D-D8902B3D7713}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genperf", "genperf\genperf.vcproj", "{C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genmodule", "genmodule\genmodule.vcproj", "{F0E8B707-00C5-4FF2-B8EF-7C39817132A0}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genstring", "genstring\genstring.vcproj", "{021CEB0A-F721-4F59-B349-9CEEAF244459}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|Win32.ActiveCfg = Debug|Win32 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|Win32.Build.0 = Debug|Win32 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|x64.ActiveCfg = Debug|x64 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|x64.Build.0 = Debug|x64 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|Win32.ActiveCfg = Release|Win32 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|Win32.Build.0 = Release|Win32 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|x64.ActiveCfg = Release|x64 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|x64.Build.0 = Release|x64 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|Win32.ActiveCfg = Debug|Win32 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|Win32.Build.0 = Debug|Win32 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|x64.ActiveCfg = Debug|x64 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|x64.Build.0 = Debug|x64 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|Win32.ActiveCfg = Release|Win32 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|Win32.Build.0 = Release|Win32 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|x64.ActiveCfg = Release|x64 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|x64.Build.0 = Release|x64 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|Win32.ActiveCfg = Debug|Win32 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|Win32.Build.0 = Debug|Win32 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|x64.ActiveCfg = Debug|x64 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|x64.Build.0 = Debug|x64 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|Win32.ActiveCfg = Release|Win32 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|Win32.Build.0 = Release|Win32 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|x64.ActiveCfg = Release|x64 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|x64.Build.0 = Release|x64 + {225700A5-07B8-434E-AD61-555278BF6733}.Debug|Win32.ActiveCfg = Debug|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Debug|Win32.Build.0 = Debug|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Debug|x64.ActiveCfg = Debug|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Debug|x64.Build.0 = Debug|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Release|Win32.ActiveCfg = Release|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Release|Win32.Build.0 = Release|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Release|x64.ActiveCfg = Release|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Release|x64.Build.0 = Release|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|Win32.ActiveCfg = Debug|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|Win32.Build.0 = Debug|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|x64.ActiveCfg = Debug|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|x64.Build.0 = Debug|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|Win32.ActiveCfg = Release|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|Win32.Build.0 = Release|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|x64.ActiveCfg = Release|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|x64.Build.0 = Release|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|Win32.ActiveCfg = Debug|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|Win32.Build.0 = Debug|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|x64.ActiveCfg = Debug|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|x64.Build.0 = Debug|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|Win32.ActiveCfg = Release|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|Win32.Build.0 = Release|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|x64.ActiveCfg = Release|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|x64.Build.0 = Release|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|Win32.ActiveCfg = Debug|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|Win32.Build.0 = Debug|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|x64.ActiveCfg = Debug|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|x64.Build.0 = Debug|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|Win32.ActiveCfg = Release|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|Win32.Build.0 = Release|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|x64.ActiveCfg = Release|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|x64.Build.0 = Release|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|Win32.ActiveCfg = Debug|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|Win32.Build.0 = Debug|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|x64.ActiveCfg = Debug|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|x64.Build.0 = Debug|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|Win32.ActiveCfg = Release|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|Win32.Build.0 = Release|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|x64.ActiveCfg = Release|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|x64.Build.0 = Release|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|Win32.ActiveCfg = Debug|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|Win32.Build.0 = Debug|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|x64.ActiveCfg = Debug|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|x64.Build.0 = Debug|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|Win32.ActiveCfg = Release|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|Win32.Build.0 = Release|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|x64.ActiveCfg = Release|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|x64.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Mkfiles/vc9/yasm.vcproj b/Mkfiles/vc9/yasm.vcproj new file mode 100644 index 00000000..ad472444 --- /dev/null +++ b/Mkfiles/vc9/yasm.vcproj @@ -0,0 +1,410 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 2fe53b2c299bf8292b7780105742ac357bcf8224 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 2 Feb 2008 19:23:17 +0000 Subject: [PATCH 139/585] Revert r2029. According to both AMD64 and Intel 64 instruction set references, REX + 90h opcode is not NOP, but a valid XCHG: "The x86 architecture commonly uses the XCHG EAX, EAX instruction (opcode 90h) as a one-byte NOP. In 64-bit mode, the processor treats opcode 90h as a true NOP only if it would exchange rAX with itself. Without this special handling, the instruction would zero-extend the upper 32 bits of RAX, and thus it would not be a true nooperation. Opcode 90h can still be used to exchange rAX and r8 if the appropriate REX prefix is used." Noticed by: nasm64developer@users.sf.net svn path=/trunk/yasm/; revision=2031 --- modules/arch/x86/gen_x86_insn.py | 12 ++++++------ modules/arch/x86/tests/xchg64.hex | 24 +++++++++--------------- modules/arch/x86/x86id.c | 23 +---------------------- 3 files changed, 16 insertions(+), 43 deletions(-) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index bb1ec5fe..fd923d4f 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -1357,12 +1357,12 @@ add_group("xchg", opersize=16, opcode=[0x90], operands=[Operand(type="Areg", size=16, dest=None), - Operand(type="RegNotR8", size=16, dest="Op0Add")]) + Operand(type="Reg", size=16, dest="Op0Add")]) add_group("xchg", suffix="w", opersize=16, opcode=[0x90], - operands=[Operand(type="RegNotR8", size=16, dest="Op0Add"), + operands=[Operand(type="Reg", size=16, dest="Op0Add"), Operand(type="Areg", size=16, dest=None)]) add_group("xchg", suffix="w", @@ -1396,12 +1396,12 @@ add_group("xchg", opersize=32, opcode=[0x90], operands=[Operand(type="Areg", size=32, dest=None), - Operand(type="RegNotR8", size=32, dest="Op0Add")]) + Operand(type="Reg", size=32, dest="Op0Add")]) add_group("xchg", suffix="l", opersize=32, opcode=[0x90], - operands=[Operand(type="RegNotR8", size=32, dest="Op0Add"), + operands=[Operand(type="Reg", size=32, dest="Op0Add"), Operand(type="Areg", size=32, dest=None)]) add_group("xchg", suffix="l", @@ -1428,12 +1428,12 @@ add_group("xchg", opersize=64, opcode=[0x90], operands=[Operand(type="Areg", size=64, dest=None), - Operand(type="RegNotR8", size=64, dest="Op0Add")]) + Operand(type="Reg", size=64, dest="Op0Add")]) add_group("xchg", suffix="q", opersize=64, opcode=[0x90], - operands=[Operand(type="RegNotR8", size=64, dest="Op0Add"), + operands=[Operand(type="Reg", size=64, dest="Op0Add"), Operand(type="Areg", size=64, dest=None)]) add_group("xchg", suffix="q", diff --git a/modules/arch/x86/tests/xchg64.hex b/modules/arch/x86/tests/xchg64.hex index d052b668..44adfca8 100644 --- a/modules/arch/x86/tests/xchg64.hex +++ b/modules/arch/x86/tests/xchg64.hex @@ -24,13 +24,11 @@ c0 66 90 66 -44 -87 -c0 +41 +90 66 41 -87 -c0 +90 66 41 91 @@ -39,23 +37,19 @@ c0 91 87 c0 -44 -87 -c0 41 -87 -c0 +90 +41 +90 41 91 41 91 90 -4c -87 -c0 49 -87 -c0 +90 +49 +90 49 91 49 diff --git a/modules/arch/x86/x86id.c b/modules/arch/x86/x86id.c index 874ad010..d17f045c 100644 --- a/modules/arch/x86/x86id.c +++ b/modules/arch/x86/x86id.c @@ -105,9 +105,7 @@ enum x86_operand_type { /* EAX memory operand only (EA) [special case for SVM skinit opcode] */ OPT_MemEAX = 26, /* SIMDReg with value equal to operand 0 SIMDReg */ - OPT_SIMDRegMatch0 = 27, - /* Reg with value != 8 [special case for xchg r8, rax] */ - OPT_RegNotR8 = 28 + OPT_SIMDRegMatch0 = 27 }; enum x86_operand_size { @@ -808,25 +806,6 @@ x86_find_match(x86_id_insn *id_insn, yasm_insn_operand **ops, mismatch = 1; break; } - case OPT_RegNotR8: - if (op->type != YASM_INSN__OPERAND_REG || - ((op->data.reg&0xFUL) == 8)) - mismatch = 1; - else { - switch ((x86_expritem_reg_size)(op->data.reg&~0xFUL)) { - case X86_REG8: - case X86_REG8X: - case X86_REG16: - case X86_REG32: - case X86_REG64: - case X86_FPUREG: - break; - default: - mismatch = 1; - break; - } - } - break; default: yasm_internal_error(N_("invalid operand type")); } From 0fba7dca8d2e22a5825dd7c9f14c24a7ffee17b3 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 8 Feb 2008 18:26:40 +0000 Subject: [PATCH 140/585] Fix #130: Add SAFESEH directive for indicating SEH handlers in win32 output. Unlike in MASM, no command-line switch is required. Usage: extern handler (or handler: to define locally) safeseh handler svn path=/trunk/yasm/; revision=2032 --- modules/objfmts/coff/coff-objfmt.c | 107 +++++++ modules/objfmts/win32/tests/Makefile.inc | 3 + modules/objfmts/win32/tests/win32-safeseh.asm | 5 + modules/objfmts/win32/tests/win32-safeseh.hex | 278 ++++++++++++++++++ .../objfmts/win32/tests/win32-safeseh.masm | 10 + modules/preprocs/nasm/standard.mac | 4 + 6 files changed, 407 insertions(+) create mode 100644 modules/objfmts/win32/tests/win32-safeseh.asm create mode 100644 modules/objfmts/win32/tests/win32-safeseh.hex create mode 100644 modules/objfmts/win32/tests/win32-safeseh.masm diff --git a/modules/objfmts/coff/coff-objfmt.c b/modules/objfmts/coff/coff-objfmt.c index 9c69ad35..64805610 100644 --- a/modules/objfmts/coff/coff-objfmt.c +++ b/modules/objfmts/coff/coff-objfmt.c @@ -218,6 +218,28 @@ static const yasm_assoc_data_callback coff_symrec_data_cb = { coff_symrec_data_print }; +/* Bytecode callback function prototypes */ +static void win32_sxdata_bc_destroy(void *contents); +static void win32_sxdata_bc_print(const void *contents, FILE *f, + int indent_level); +static int win32_sxdata_bc_calc_len + (yasm_bytecode *bc, yasm_bc_add_span_func add_span, void *add_span_data); +static int win32_sxdata_bc_tobytes + (yasm_bytecode *bc, unsigned char **bufp, void *d, + yasm_output_value_func output_value, + /*@null@*/ yasm_output_reloc_func output_reloc); + +/* Bytecode callback structures */ +static const yasm_bytecode_callback win32_sxdata_bc_callback = { + win32_sxdata_bc_destroy, + win32_sxdata_bc_print, + yasm_bc_finalize_common, + win32_sxdata_bc_calc_len, + yasm_bc_expand_common, + win32_sxdata_bc_tobytes, + 0 +}; + yasm_objfmt_module yasm_coff_LTX_objfmt; yasm_objfmt_module yasm_win32_LTX_objfmt; yasm_objfmt_module yasm_win64_LTX_objfmt; @@ -1478,6 +1500,8 @@ coff_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, } else if (objfmt_coff->win64 && strcmp(sectname, ".xdata") == 0) { data.flags = COFF_STYP_DATA | COFF_STYP_READ; align = 8; + } else if (objfmt_coff->win32 && strcmp(sectname, ".sxdata") == 0) { + data.flags = COFF_STYP_INFO; } else if (strcmp(sectname, ".comment") == 0) { data.flags = COFF_STYP_INFO | COFF_STYP_DISCARD | COFF_STYP_READ; } else if (yasm__strncasecmp(sectname, ".debug", 6)==0) { @@ -1649,6 +1673,88 @@ dir_export(yasm_object *object, yasm_valparamhead *valparams, yasm_section_bcs_append(sect, yasm_bc_create_data(&dvs, 1, 0, NULL, line)); } +static void +dir_safeseh(yasm_object *object, yasm_valparamhead *valparams, + yasm_valparamhead *objext_valparams, unsigned long line) +{ + yasm_valparam *vp; + /*@null@*/ const char *symname; + yasm_symrec *sym; + int isnew; + yasm_section *sect; + + /* Reference symbol (to generate error if not declared). + * Also, symbol must be externally visible, so force global. + */ + vp = yasm_vps_first(valparams); + symname = yasm_vp_id(vp); + if (symname) { + sym = yasm_symtab_use(object->symtab, symname, line); + yasm_symrec_declare(sym, YASM_SYM_GLOBAL, line); + } else { + yasm_error_set(YASM_ERROR_SYNTAX, + N_("argument to SAFESEH must be symbol name")); + return; + } + + /* + * Add symbol number to end of .sxdata section. + */ + + sect = yasm_object_get_general(object, ".sxdata", 0, 0, 0, &isnew, line); + + /* Initialize sxdata section if needed */ + if (isnew) { + coff_section_data *csd; + csd = coff_objfmt_init_new_section(object, sect, ".sxdata", line); + csd->flags = COFF_STYP_INFO; + } + + /* Add as sxdata bytecode */ + yasm_section_bcs_append(sect, + yasm_bc_create_common(&win32_sxdata_bc_callback, + sym, line)); +} + +static void +win32_sxdata_bc_destroy(void *contents) +{ + /* Contents is just the symbol pointer, so no need to delete */ +} + +static void +win32_sxdata_bc_print(const void *contents, FILE *f, int indent_level) +{ + /* TODO */ +} + +static int +win32_sxdata_bc_calc_len(yasm_bytecode *bc, yasm_bc_add_span_func add_span, + void *add_span_data) +{ + bc->len += 4; + return 0; +} + +static int +win32_sxdata_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, + yasm_output_value_func output_value, + yasm_output_reloc_func output_reloc) +{ + yasm_symrec *sym = (yasm_symrec *)bc->contents; + unsigned char *buf = *bufp; + coff_symrec_data *csymd; + + csymd = yasm_symrec_get_data(sym, &coff_symrec_data_cb); + if (!csymd) + yasm_internal_error(N_("coff: no symbol data for SAFESEH symbol")); + + YASM_WRITE_32_L(buf, csymd->index); + + *bufp = buf; + return 0; +} + static void dir_ident(yasm_object *object, yasm_valparamhead *valparams, yasm_valparamhead *objext_valparams, unsigned long line) @@ -2099,6 +2205,7 @@ static const yasm_directive win32_objfmt_directives[] = { { ".export", "gas", dir_export, YASM_DIR_ID_REQUIRED }, { "ident", "nasm", dir_ident, YASM_DIR_ANY }, { "export", "nasm", dir_export, YASM_DIR_ID_REQUIRED }, + { "safeseh", "nasm", dir_safeseh, YASM_DIR_ID_REQUIRED }, { NULL, NULL, NULL, 0 } }; diff --git a/modules/objfmts/win32/tests/Makefile.inc b/modules/objfmts/win32/tests/Makefile.inc index 5bb8d143..3b16d3db 100644 --- a/modules/objfmts/win32/tests/Makefile.inc +++ b/modules/objfmts/win32/tests/Makefile.inc @@ -9,6 +9,9 @@ EXTRA_DIST += modules/objfmts/win32/tests/win32-curpos.asm EXTRA_DIST += modules/objfmts/win32/tests/win32-curpos.hex EXTRA_DIST += modules/objfmts/win32/tests/win32-overdef.asm EXTRA_DIST += modules/objfmts/win32/tests/win32-overdef.hex +EXTRA_DIST += modules/objfmts/win32/tests/win32-safeseh.asm +EXTRA_DIST += modules/objfmts/win32/tests/win32-safeseh.hex +EXTRA_DIST += modules/objfmts/win32/tests/win32-safeseh.masm EXTRA_DIST += modules/objfmts/win32/tests/win32-segof.asm EXTRA_DIST += modules/objfmts/win32/tests/win32-segof.hex EXTRA_DIST += modules/objfmts/win32/tests/win32test.c diff --git a/modules/objfmts/win32/tests/win32-safeseh.asm b/modules/objfmts/win32/tests/win32-safeseh.asm new file mode 100644 index 00000000..9edd8ede --- /dev/null +++ b/modules/objfmts/win32/tests/win32-safeseh.asm @@ -0,0 +1,5 @@ +MyHandler: + ret +safeseh MyHandler +extern MyHandler3 +safeseh MyHandler3 diff --git a/modules/objfmts/win32/tests/win32-safeseh.hex b/modules/objfmts/win32/tests/win32-safeseh.hex new file mode 100644 index 00000000..5598d6fc --- /dev/null +++ b/modules/objfmts/win32/tests/win32-safeseh.hex @@ -0,0 +1,278 @@ +4c +01 +02 +00 +00 +00 +00 +00 +6d +00 +00 +00 +08 +00 +00 +00 +00 +00 +0c +01 +2e +74 +65 +78 +74 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +64 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +20 +00 +50 +60 +2e +73 +78 +64 +61 +74 +61 +00 +01 +00 +00 +00 +00 +00 +00 +00 +08 +00 +00 +00 +65 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +c3 +04 +00 +00 +00 +07 +00 +00 +00 +2e +66 +69 +6c +65 +00 +00 +00 +00 +00 +00 +00 +fe +ff +00 +00 +67 +01 +2d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +2e +74 +65 +78 +74 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +03 +01 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +02 +00 +2e +73 +78 +64 +61 +74 +61 +00 +00 +00 +00 +00 +02 +00 +00 +00 +03 +01 +08 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +0e +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +02 +00 +19 +00 +00 +00 +4d +79 +48 +61 +6e +64 +6c +65 +72 +00 +4d +79 +48 +61 +6e +64 +6c +65 +72 +33 +00 diff --git a/modules/objfmts/win32/tests/win32-safeseh.masm b/modules/objfmts/win32/tests/win32-safeseh.masm new file mode 100644 index 00000000..f165b9c3 --- /dev/null +++ b/modules/objfmts/win32/tests/win32-safeseh.masm @@ -0,0 +1,10 @@ +.386 +.model flat +_TEXT SEGMENT USE32 PUBLIC 'CODE' +MyHandler proc +.safeseh MyHandler +MyHandler endp +_TEXT ENDS +MyHandler3 proto +.safeseh MyHandler3 +end diff --git a/modules/preprocs/nasm/standard.mac b/modules/preprocs/nasm/standard.mac index 6efd3c84..f459a7db 100644 --- a/modules/preprocs/nasm/standard.mac +++ b/modules/preprocs/nasm/standard.mac @@ -131,6 +131,10 @@ __SECT__ %imacro export 1+.nolist [export %1] %endmacro + +%imacro safeseh 1+.nolist +[safeseh %1] +%endmacro %endif %ifidn __YASM_OBJFMT__,win64 From 0beb32cda91e45379343d6186dfe77f327a50571 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 8 Feb 2008 18:49:10 +0000 Subject: [PATCH 141/585] Eliminate conversion warnings due to int/size_t differences. svn path=/trunk/yasm/; revision=2033 --- modules/objfmts/bin/bin-objfmt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/objfmts/bin/bin-objfmt.c b/modules/objfmts/bin/bin-objfmt.c index 271b58be..cb3c5b13 100644 --- a/modules/objfmts/bin/bin-objfmt.c +++ b/modules/objfmts/bin/bin-objfmt.c @@ -523,7 +523,7 @@ bin_objfmt_expr_xform(/*@returned@*/ /*@only@*/ yasm_expr *e, typedef struct map_output_info { /* address width */ - size_t bytes; + int bytes; /* intnum output static data areas */ unsigned char *buf; From aba2a018cbce2c370b9f74019ff2e1148eddfee1 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 8 Feb 2008 18:59:46 +0000 Subject: [PATCH 142/585] Support masking of relocatable values with an AND of the full value width to avoid warnings. This is primarily useful in bin object format output. db label ; if label is >255, warns. db label & 0xff ; okay, no warning. Masks other than full-sized 1s are still not supported: db label & 0x7f ; too complex error svn path=/trunk/yasm/; revision=2034 --- libyasm/coretype.h | 3 ++ libyasm/tests/Makefile.inc | 3 ++ libyasm/tests/value-mask.asm | 5 ++++ libyasm/tests/value-mask.errwarn | 1 + libyasm/tests/value-mask.hex | 2 ++ libyasm/value.c | 49 ++++++++++++++++++++++++++++++++ 6 files changed, 63 insertions(+) create mode 100644 libyasm/tests/value-mask.asm create mode 100644 libyasm/tests/value-mask.errwarn create mode 100644 libyasm/tests/value-mask.hex diff --git a/libyasm/coretype.h b/libyasm/coretype.h index 60114e91..5c99816c 100644 --- a/libyasm/coretype.h +++ b/libyasm/coretype.h @@ -156,6 +156,9 @@ typedef struct yasm_value { */ unsigned int section_rel : 1; + /** Indicates overflow warnings have been disabled for this value. */ + unsigned int no_warn : 1; + /** Sign of the value. Nonzero if the final value should be treated as * signed, 0 if it should be treated as signed. */ diff --git a/libyasm/tests/Makefile.inc b/libyasm/tests/Makefile.inc index 4b9eb1d6..ad65464a 100644 --- a/libyasm/tests/Makefile.inc +++ b/libyasm/tests/Makefile.inc @@ -78,6 +78,9 @@ EXTRA_DIST += libyasm/tests/value-err.errwarn EXTRA_DIST += libyasm/tests/value-samesym.asm EXTRA_DIST += libyasm/tests/value-samesym.errwarn EXTRA_DIST += libyasm/tests/value-samesym.hex +EXTRA_DIST += libyasm/tests/value-mask.asm +EXTRA_DIST += libyasm/tests/value-mask.errwarn +EXTRA_DIST += libyasm/tests/value-mask.hex check_PROGRAMS += bitvect_test check_PROGRAMS += floatnum_test diff --git a/libyasm/tests/value-mask.asm b/libyasm/tests/value-mask.asm new file mode 100644 index 00000000..3e939521 --- /dev/null +++ b/libyasm/tests/value-mask.asm @@ -0,0 +1,5 @@ +db label +db label & 0xff +section .bss +resb 500 +label: diff --git a/libyasm/tests/value-mask.errwarn b/libyasm/tests/value-mask.errwarn new file mode 100644 index 00000000..9df5a665 --- /dev/null +++ b/libyasm/tests/value-mask.errwarn @@ -0,0 +1 @@ +-:1: warning: value does not fit in 8 bit field diff --git a/libyasm/tests/value-mask.hex b/libyasm/tests/value-mask.hex new file mode 100644 index 00000000..8cae27c3 --- /dev/null +++ b/libyasm/tests/value-mask.hex @@ -0,0 +1,2 @@ +f8 +f8 diff --git a/libyasm/value.c b/libyasm/value.c index 74b793bc..a34be634 100644 --- a/libyasm/value.c +++ b/libyasm/value.c @@ -57,6 +57,7 @@ yasm_value_initialize(/*@out@*/ yasm_value *value, value->ip_rel = 0; value->jump_target = 0; value->section_rel = 0; + value->no_warn = 0; value->sign = 0; value->size = size; } @@ -74,6 +75,7 @@ yasm_value_init_sym(/*@out@*/ yasm_value *value, /*@null@*/ yasm_symrec *sym, value->ip_rel = 0; value->jump_target = 0; value->section_rel = 0; + value->no_warn = 0; value->sign = 0; value->size = size; } @@ -90,6 +92,7 @@ yasm_value_init_copy(yasm_value *value, const yasm_value *orig) value->ip_rel = orig->ip_rel; value->jump_target = orig->jump_target; value->section_rel = orig->section_rel; + value->no_warn = orig->no_warn; value->sign = orig->sign; value->size = orig->size; } @@ -485,6 +488,47 @@ yasm_value_finalize_expr(yasm_value *value, yasm_expr *e, if (yasm_error_occurred()) return 1; + /* Strip top-level AND masking to an all-1s mask the same size + * of the value size. This allows forced avoidance of overflow warnings. + */ + if (value->abs->op == YASM_EXPR_AND) { + int term; + + /* Calculate 1<size); + yasm_intnum_calc(mask, YASM_EXPR_SHL, mask_tmp); + yasm_intnum_set_uint(mask_tmp, 1); + yasm_intnum_calc(mask, YASM_EXPR_SUB, mask_tmp); + yasm_intnum_destroy(mask_tmp); + + /* Walk terms and delete matching masks */ + for (term=value->abs->numterms-1; term>=0; term--) { + if (value->abs->terms[term].type == YASM_EXPR_INT && + yasm_intnum_compare(value->abs->terms[term].data.intn, + mask) == 0) { + /* Delete the intnum */ + yasm_intnum_destroy(value->abs->terms[term].data.intn); + + /* Slide everything to its right over by 1 */ + if (term != value->abs->numterms-1) /* if it wasn't last.. */ + memmove(&value->abs->terms[term], + &value->abs->terms[term+1], + (value->abs->numterms-1-term)* + sizeof(yasm_expr__item)); + + /* Update numterms */ + value->abs->numterms--; + + /* Indicate warnings have been disabled */ + value->no_warn = 1; + } + } + if (value->abs->numterms == 1) + value->abs->op = YASM_EXPR_IDENT; + yasm_intnum_destroy(mask); + } + /* Handle trivial (IDENT) cases immediately */ if (value->abs->op == YASM_EXPR_IDENT) { switch (value->abs->terms[0].type) { @@ -612,6 +656,9 @@ yasm_value_output_basic(yasm_value *value, /*@out@*/ unsigned char *buf, int retval = 1; unsigned int valsize = value->size; + if (value->no_warn) + warn = 0; + if (value->abs) { /* Handle floating point expressions */ if (!value->rel && value->abs->op == YASM_EXPR_IDENT @@ -745,5 +792,7 @@ yasm_value_print(const yasm_value *value, FILE *f, int indent_level) fprintf(f, "%*s(Jump target)\n", indent_level, ""); if (value->section_rel) fprintf(f, "%*s(Section-relative)\n", indent_level, ""); + if (value->no_warn) + fprintf(f, "%*s(Overflow warnings disabled)\n", indent_level, ""); } } From 04039380d1c0c79bebf2a1a878c199935ec55ec2 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 9 Feb 2008 03:35:07 +0000 Subject: [PATCH 143/585] Enable use of sym@FOO constructs in GAS parser. To do this, restructure how special symbols are handled between the parser and object format. Instead of creating special symbols with the right names, instead have the parser call the object format to see if a match is found into the special symbols, which are no longer stored in the symbol table. svn path=/trunk/yasm/; revision=2035 --- libyasm/objfmt.h | 20 +++++++++++++++ modules/objfmts/bin/bin-objfmt.c | 10 +++++++- modules/objfmts/coff/coff-objfmt.c | 19 +++++++++++--- modules/objfmts/dbg/dbg-objfmt.c | 13 +++++++++- modules/objfmts/elf/elf-objfmt.c | 16 +++++++++--- modules/objfmts/elf/elf.c | 13 +++++++++- modules/objfmts/elf/elf.h | 2 ++ modules/objfmts/macho/macho-objfmt.c | 16 +++++++++--- modules/objfmts/rdf/rdf-objfmt.c | 10 +++++++- modules/objfmts/xdf/xdf-objfmt.c | 10 +++++++- modules/parsers/gas/gas-parse.c | 38 +++++++++++++++++----------- modules/parsers/nasm/nasm-parse.c | 9 ++++++- modules/parsers/nasm/nasm-token.re | 10 ++++++-- 13 files changed, 153 insertions(+), 33 deletions(-) diff --git a/libyasm/objfmt.h b/libyasm/objfmt.h index afde85eb..0c40c4a3 100644 --- a/libyasm/objfmt.h +++ b/libyasm/objfmt.h @@ -109,6 +109,13 @@ struct yasm_objfmt_module { (*section_switch)(yasm_object *object, yasm_valparamhead *valparams, /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line); + + /** Module-level implementation of yasm_objfmt_get_special_sym(). + * Call yasm_objfmt_get_special_sym() instead of calling this function. + */ + /*@observer@*/ /*@null@*/ yasm_symrec * + (*get_special_sym)(yasm_object *object, const char *name, + const char *parser); }; /** Create object format. @@ -156,6 +163,16 @@ yasm_section *yasm_objfmt_add_default_section(yasm_object *object); (yasm_object *object, yasm_valparamhead *valparams, /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line); +/** Get a special symbol. Special symbols are generally used to generate + * special relocation types via the WRT mechanism. + * \param object object + * \param name symbol name (not including any parser-specific prefix) + * \param parser parser keyword + * \return NULL if unrecognized, otherwise special symbol. + */ +/*@observer@*/ /*@null@*/ yasm_symrec *yasm_objfmt_get_special_sym + (yasm_object *object, const char *name, const char *parser); + #ifndef YASM_DOXYGEN /* Inline macro implementations for objfmt functions */ @@ -173,6 +190,9 @@ yasm_section *yasm_objfmt_add_default_section(yasm_object *object); #define yasm_objfmt_add_default_section(object) \ ((yasm_objfmt_base *)((object)->objfmt))->module->add_default_section \ (object) +#define yasm_objfmt_get_special_sym(object, name, parser) \ + ((yasm_objfmt_base *)((object)->objfmt))->module->get_special_sym \ + (object, name, parser) #endif diff --git a/modules/objfmts/bin/bin-objfmt.c b/modules/objfmts/bin/bin-objfmt.c index cb3c5b13..e1080760 100644 --- a/modules/objfmts/bin/bin-objfmt.c +++ b/modules/objfmts/bin/bin-objfmt.c @@ -1568,6 +1568,13 @@ bin_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, return retval; } +static /*@observer@*/ /*@null@*/ yasm_symrec * +bin_objfmt_get_special_sym(yasm_object *object, const char *name, + const char *parser) +{ + return NULL; +} + static void bin_objfmt_dir_org(yasm_object *object, /*@null@*/ yasm_valparamhead *valparams, @@ -1777,5 +1784,6 @@ yasm_objfmt_module yasm_bin_LTX_objfmt = { bin_objfmt_output, bin_objfmt_destroy, bin_objfmt_add_default_section, - bin_objfmt_section_switch + bin_objfmt_section_switch, + bin_objfmt_get_special_sym }; diff --git a/modules/objfmts/coff/coff-objfmt.c b/modules/objfmts/coff/coff-objfmt.c index 64805610..300b3769 100644 --- a/modules/objfmts/coff/coff-objfmt.c +++ b/modules/objfmts/coff/coff-objfmt.c @@ -1579,6 +1579,13 @@ coff_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, return retval; } +static /*@observer@*/ /*@null@*/ yasm_symrec * +coff_objfmt_get_special_sym(yasm_object *object, const char *name, + const char *parser) +{ + return NULL; +} + static void coff_section_data_destroy(void *data) { @@ -2189,7 +2196,8 @@ yasm_objfmt_module yasm_coff_LTX_objfmt = { coff_objfmt_output, coff_objfmt_destroy, coff_objfmt_add_default_section, - coff_objfmt_section_switch + coff_objfmt_section_switch, + coff_objfmt_get_special_sym }; /* Define valid debug formats to use with this object format */ @@ -2222,7 +2230,8 @@ yasm_objfmt_module yasm_win32_LTX_objfmt = { coff_objfmt_output, coff_objfmt_destroy, coff_objfmt_add_default_section, - coff_objfmt_section_switch + coff_objfmt_section_switch, + coff_objfmt_get_special_sym }; static const yasm_directive win64_objfmt_directives[] = { @@ -2255,7 +2264,8 @@ yasm_objfmt_module yasm_win64_LTX_objfmt = { coff_objfmt_output, coff_objfmt_destroy, coff_objfmt_add_default_section, - coff_objfmt_section_switch + coff_objfmt_section_switch, + coff_objfmt_get_special_sym }; yasm_objfmt_module yasm_x64_LTX_objfmt = { "Win64", @@ -2269,5 +2279,6 @@ yasm_objfmt_module yasm_x64_LTX_objfmt = { coff_objfmt_output, coff_objfmt_destroy, coff_objfmt_add_default_section, - coff_objfmt_section_switch + coff_objfmt_section_switch, + coff_objfmt_get_special_sym }; diff --git a/modules/objfmts/dbg/dbg-objfmt.c b/modules/objfmts/dbg/dbg-objfmt.c index 998dc4f2..21a161ab 100644 --- a/modules/objfmts/dbg/dbg-objfmt.c +++ b/modules/objfmts/dbg/dbg-objfmt.c @@ -140,6 +140,16 @@ dbg_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, return retval; } +static /*@observer@*/ /*@null@*/ yasm_symrec * +dbg_objfmt_get_special_sym(yasm_object *object, const char *name, + const char *parser) +{ + yasm_objfmt_dbg *objfmt_dbg = (yasm_objfmt_dbg *)object->objfmt; + fprintf(objfmt_dbg->dbgfile, "get_special_sym(object, \"%s\", \"%s\")\n", + name, parser); + return NULL; +} + /* Define valid debug formats to use with this object format */ static const char *dbg_objfmt_dbgfmt_keywords[] = { "null", @@ -159,5 +169,6 @@ yasm_objfmt_module yasm_dbg_LTX_objfmt = { dbg_objfmt_output, dbg_objfmt_destroy, dbg_objfmt_add_default_section, - dbg_objfmt_section_switch + dbg_objfmt_section_switch, + dbg_objfmt_get_special_sym }; diff --git a/modules/objfmts/elf/elf-objfmt.c b/modules/objfmts/elf/elf-objfmt.c index 66fb6c56..c2464d77 100644 --- a/modules/objfmts/elf/elf-objfmt.c +++ b/modules/objfmts/elf/elf-objfmt.c @@ -1142,6 +1142,13 @@ elf_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, return retval; } +static /*@observer@*/ /*@null@*/ yasm_symrec * +elf_objfmt_get_special_sym(yasm_object *object, const char *name, + const char *parser) +{ + return elf_get_special_sym(name, parser); +} + static void dir_type(yasm_object *object, yasm_valparamhead *valparams, yasm_valparamhead *objext_valparams, unsigned long line) @@ -1301,7 +1308,8 @@ yasm_objfmt_module yasm_elf_LTX_objfmt = { elf_objfmt_output, elf_objfmt_destroy, elf_objfmt_add_default_section, - elf_objfmt_section_switch + elf_objfmt_section_switch, + elf_objfmt_get_special_sym }; yasm_objfmt_module yasm_elf32_LTX_objfmt = { @@ -1316,7 +1324,8 @@ yasm_objfmt_module yasm_elf32_LTX_objfmt = { elf_objfmt_output, elf_objfmt_destroy, elf_objfmt_add_default_section, - elf_objfmt_section_switch + elf_objfmt_section_switch, + elf_objfmt_get_special_sym }; yasm_objfmt_module yasm_elf64_LTX_objfmt = { @@ -1331,5 +1340,6 @@ yasm_objfmt_module yasm_elf64_LTX_objfmt = { elf_objfmt_output, elf_objfmt_destroy, elf_objfmt_add_default_section, - elf_objfmt_section_switch + elf_objfmt_section_switch, + elf_objfmt_get_special_sym }; diff --git a/modules/objfmts/elf/elf.c b/modules/objfmts/elf/elf.c index 87ee9828..807a3afe 100644 --- a/modules/objfmts/elf/elf.c +++ b/modules/objfmts/elf/elf.c @@ -91,13 +91,24 @@ elf_set_arch(yasm_arch *arch, yasm_symtab *symtab, int bits_pref) /* FIXME: misuse of NULL bytecode */ elf_ssyms[i] = yasm_symtab_define_label(symtab, elf_march->ssyms[i].name, - NULL, 1, 0); + NULL, 0, 0); } } return elf_march; } +yasm_symrec * +elf_get_special_sym(const char *name, const char *parser) +{ + int i; + for (i=0; (unsigned int)inum_ssyms; i++) { + if (yasm__strcasecmp(name, elf_march->ssyms[i].name) == 0) + return elf_ssyms[i]; + } + return NULL; +} + /* reloc functions */ int elf_ssym_has_flag(yasm_symrec *wrt, int flag); diff --git a/modules/objfmts/elf/elf.h b/modules/objfmts/elf/elf.h index 954e052e..a10b0b49 100644 --- a/modules/objfmts/elf/elf.h +++ b/modules/objfmts/elf/elf.h @@ -410,6 +410,8 @@ const elf_machine_handler *elf_set_arch(struct yasm_arch *arch, yasm_symtab *symtab, int bits_pref); +yasm_symrec *elf_get_special_sym(const char *name, const char *parser); + /* reloc functions */ int elf_is_wrt_sym_relative(yasm_symrec *wrt); int elf_is_wrt_pos_adjusted(yasm_symrec *wrt); diff --git a/modules/objfmts/macho/macho-objfmt.c b/modules/objfmts/macho/macho-objfmt.c index 893ef0db..4628bf74 100644 --- a/modules/objfmts/macho/macho-objfmt.c +++ b/modules/objfmts/macho/macho-objfmt.c @@ -1485,6 +1485,13 @@ macho_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, return retval; } +static /*@observer@*/ /*@null@*/ yasm_symrec * +macho_objfmt_get_special_sym(yasm_object *object, const char *name, + const char *parser) +{ + return NULL; +} + static void macho_section_data_destroy(void *data) { @@ -1548,7 +1555,8 @@ yasm_objfmt_module yasm_macho_LTX_objfmt = { macho_objfmt_output, macho_objfmt_destroy, macho_objfmt_add_default_section, - macho_objfmt_section_switch + macho_objfmt_section_switch, + macho_objfmt_get_special_sym }; yasm_objfmt_module yasm_macho32_LTX_objfmt = { @@ -1563,7 +1571,8 @@ yasm_objfmt_module yasm_macho32_LTX_objfmt = { macho_objfmt_output, macho_objfmt_destroy, macho_objfmt_add_default_section, - macho_objfmt_section_switch + macho_objfmt_section_switch, + macho_objfmt_get_special_sym }; yasm_objfmt_module yasm_macho64_LTX_objfmt = { @@ -1578,5 +1587,6 @@ yasm_objfmt_module yasm_macho64_LTX_objfmt = { macho_objfmt_output, macho_objfmt_destroy, macho_objfmt_add_default_section, - macho_objfmt_section_switch + macho_objfmt_section_switch, + macho_objfmt_get_special_sym }; diff --git a/modules/objfmts/rdf/rdf-objfmt.c b/modules/objfmts/rdf/rdf-objfmt.c index 46a5a8c8..22e2a1c7 100644 --- a/modules/objfmts/rdf/rdf-objfmt.c +++ b/modules/objfmts/rdf/rdf-objfmt.c @@ -964,6 +964,13 @@ rdf_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, return retval; } +static /*@observer@*/ /*@null@*/ yasm_symrec * +rdf_objfmt_get_special_sym(yasm_object *object, const char *name, + const char *parser) +{ + return NULL; +} + static void rdf_section_data_destroy(void *data) { @@ -1063,5 +1070,6 @@ yasm_objfmt_module yasm_rdf_LTX_objfmt = { rdf_objfmt_output, rdf_objfmt_destroy, rdf_objfmt_add_default_section, - rdf_objfmt_section_switch + rdf_objfmt_section_switch, + rdf_objfmt_get_special_sym }; diff --git a/modules/objfmts/xdf/xdf-objfmt.c b/modules/objfmts/xdf/xdf-objfmt.c index a68dc0bf..d7cb453b 100644 --- a/modules/objfmts/xdf/xdf-objfmt.c +++ b/modules/objfmts/xdf/xdf-objfmt.c @@ -773,6 +773,13 @@ xdf_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, return retval; } +static /*@observer@*/ /*@null@*/ yasm_symrec * +xdf_objfmt_get_special_sym(yasm_object *object, const char *name, + const char *parser) +{ + return NULL; +} + static void xdf_section_data_destroy(void *data) { @@ -836,5 +843,6 @@ yasm_objfmt_module yasm_xdf_LTX_objfmt = { xdf_objfmt_output, xdf_objfmt_destroy, xdf_objfmt_add_default_section, - xdf_objfmt_section_switch + xdf_objfmt_section_switch, + xdf_objfmt_get_special_sym }; diff --git a/modules/parsers/gas/gas-parse.c b/modules/parsers/gas/gas-parse.c index 2c402f15..583e39e0 100644 --- a/modules/parsers/gas/gas-parse.c +++ b/modules/parsers/gas/gas-parse.c @@ -1347,21 +1347,6 @@ parse_expr2(yasm_parser_gas *parser_gas) { char *name = ID_val; get_next_token(); /* ID */ - if (curtok == '@') { - /* TODO: this is needed for shared objects, e.g. sym@PLT */ - get_next_token(); /* '@' */ - if (!expect(ID)) { - yasm_error_set(YASM_ERROR_SYNTAX, - N_("expected identifier after `@'")); - yasm_xfree(name); - return NULL; - } - yasm_xfree(ID_val); - get_next_token(); /* ID */ - sym = yasm_symtab_use(p_symtab, name, cur_line); - yasm_xfree(name); - return p_expr_new_ident(yasm_expr_sym(sym)); - } /* "." references the current assembly position */ if (name[1] == '\0' && name[0] == '.') @@ -1370,6 +1355,29 @@ parse_expr2(yasm_parser_gas *parser_gas) else sym = yasm_symtab_use(p_symtab, name, cur_line); yasm_xfree(name); + + if (curtok == '@') { + yasm_symrec *wrt; + /* TODO: this is needed for shared objects, e.g. sym@PLT */ + get_next_token(); /* '@' */ + if (!expect(ID)) { + yasm_error_set(YASM_ERROR_SYNTAX, + N_("expected identifier after `@'")); + yasm_xfree(name); + return NULL; + } + wrt = yasm_objfmt_get_special_sym(p_object, ID_val, "gas"); + yasm_xfree(ID_val); + get_next_token(); /* ID */ + if (!wrt) { + yasm_warn_set(YASM_WARN_GENERAL, + N_("unrecognized identifier after `@'")); + return p_expr_new_ident(yasm_expr_sym(sym)); + } + return p_expr_new(yasm_expr_sym(sym), YASM_EXPR_WRT, + yasm_expr_sym(wrt)); + } + return p_expr_new_ident(yasm_expr_sym(sym)); } default: diff --git a/modules/parsers/nasm/nasm-parse.c b/modules/parsers/nasm/nasm-parse.c index 88d2297b..02a64121 100644 --- a/modules/parsers/nasm/nasm-parse.c +++ b/modules/parsers/nasm/nasm-parse.c @@ -1133,8 +1133,15 @@ parse_expr6(yasm_parser_nasm *parser_nasm, expr_type type) yasm_intnum_create_charconst_nasm(STRING_val.contents))); yasm_xfree(STRING_val.contents); break; - case ID: case SPECIAL_ID: + sym = yasm_objfmt_get_special_sym(p_object, ID_val+2, "nasm"); + if (sym) { + e = p_expr_new_ident(yasm_expr_sym(sym)); + yasm_xfree(ID_val); + break; + } + /*@fallthrough@*/ + case ID: case LOCAL_ID: sym = yasm_symtab_use(p_symtab, ID_val, cur_line); e = p_expr_new_ident(yasm_expr_sym(sym)); diff --git a/modules/parsers/nasm/nasm-token.re b/modules/parsers/nasm/nasm-token.re index 35de7924..453744be 100644 --- a/modules/parsers/nasm/nasm-token.re +++ b/modules/parsers/nasm/nasm-token.re @@ -286,8 +286,14 @@ scan: [-+|^*&/%~$():=,\[] { RETURN(s->tok[0]); } "]" { RETURN(s->tok[0]); } - /* special non-local ..@label and labels like ..start */ - ".." [a-zA-Z0-9_$#@~.?]+ { + /* special non-local ..@label */ + "..@" [a-zA-Z0-9_$#@~.?]+ { + lvalp->str_val = yasm__xstrndup(TOK, TOKLEN); + RETURN(ID); + } + + /* special non-local labels like ..start */ + ".." [a-zA-Z0-9_$#~.?]+ { lvalp->str_val = yasm__xstrndup(TOK, TOKLEN); RETURN(SPECIAL_ID); } From a3e30bc39f4f84156622dee7314ea264468b60ca Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 9 Feb 2008 04:06:47 +0000 Subject: [PATCH 144/585] Add support for ELF32 and ELF64 TLS (thread local storage) relocations. While here, simplify how special relocations are handled inside ELF. Requested by: Nils Weller svn path=/trunk/yasm/; revision=2036 --- modules/objfmts/elf/elf-machine.h | 2 + modules/objfmts/elf/elf-x86-amd64.c | 46 +- modules/objfmts/elf/elf-x86-x86.c | 56 +- modules/objfmts/elf/tests/Makefile.inc | 2 + modules/objfmts/elf/tests/gas32/Makefile.inc | 7 + .../elf/tests/gas32/elf_gas32_ssym.asm | 14 + .../elf/tests/gas32/elf_gas32_ssym.hex | 592 ++++++++++++ .../objfmts/elf/tests/gas32/elf_gas32_test.sh | 4 + modules/objfmts/elf/tests/gas64/Makefile.inc | 2 + .../elf/tests/gas64/elf_gas64_ssym.asm | 10 + .../elf/tests/gas64/elf_gas64_ssym.hex | 880 ++++++++++++++++++ 11 files changed, 1562 insertions(+), 53 deletions(-) create mode 100644 modules/objfmts/elf/tests/gas32/Makefile.inc create mode 100644 modules/objfmts/elf/tests/gas32/elf_gas32_ssym.asm create mode 100644 modules/objfmts/elf/tests/gas32/elf_gas32_ssym.hex create mode 100755 modules/objfmts/elf/tests/gas32/elf_gas32_test.sh create mode 100644 modules/objfmts/elf/tests/gas64/elf_gas64_ssym.asm create mode 100644 modules/objfmts/elf/tests/gas64/elf_gas64_ssym.hex diff --git a/modules/objfmts/elf/elf-machine.h b/modules/objfmts/elf/elf-machine.h index f2bb8db7..46cce2db 100644 --- a/modules/objfmts/elf/elf-machine.h +++ b/modules/objfmts/elf/elf-machine.h @@ -77,6 +77,8 @@ enum { typedef struct { const char *name; /* should be something like ..name */ const int sym_rel; /* symbol or section-relative? */ + const unsigned int reloc; /* relocation type */ + const unsigned int size; /* legal data size */ } elf_machine_ssym; struct elf_machine_handler { diff --git a/modules/objfmts/elf/elf-x86-amd64.c b/modules/objfmts/elf/elf-x86-amd64.c index 4bc53b21..d9588284 100644 --- a/modules/objfmts/elf/elf-x86-amd64.c +++ b/modules/objfmts/elf/elf-x86-amd64.c @@ -33,22 +33,27 @@ #include "elf.h" #include "elf-machine.h" -enum ssym_index { - SSYM_GOTPCREL = 0, - SSYM_GOT, - SSYM_PLT +static elf_machine_ssym elf_x86_amd64_ssyms[] = { + {"plt", ELF_SSYM_SYM_RELATIVE, R_X86_64_PLT32, 32}, + {"gotpcrel", ELF_SSYM_SYM_RELATIVE, R_X86_64_GOTPCREL, 32}, + {"tlsgd", ELF_SSYM_SYM_RELATIVE, R_X86_64_TLSGD, 32}, + {"tlsld", ELF_SSYM_SYM_RELATIVE, R_X86_64_TLSLD, 32}, + {"gottpoff", ELF_SSYM_SYM_RELATIVE, R_X86_64_GOTTPOFF, 32}, + {"tpoff", ELF_SSYM_SYM_RELATIVE, R_X86_64_TPOFF32, 32}, + {"dtpoff", ELF_SSYM_SYM_RELATIVE, R_X86_64_DTPOFF32, 32}, + {"got", ELF_SSYM_SYM_RELATIVE, R_X86_64_GOT32, 32} }; static int elf_x86_amd64_accepts_reloc(size_t val, yasm_symrec *wrt, yasm_symrec **ssyms) { if (wrt) { - if ((wrt == ssyms[SSYM_GOTPCREL] && val == 32) - || (wrt == ssyms[SSYM_GOT] && val == 32) - || (wrt == ssyms[SSYM_PLT] && val == 32)) - return 1; - else - return 0; + size_t i; + for (i=0; iwrt) { - if (reloc->wrt == ssyms[SSYM_GOTPCREL] && reloc->valsize == 32) - return (unsigned char) R_X86_64_GOTPCREL; - else if (reloc->wrt == ssyms[SSYM_GOT] && reloc->valsize == 32) - return (unsigned char) R_X86_64_GOT32; - else if (reloc->wrt == ssyms[SSYM_PLT] && reloc->valsize == 32) - return (unsigned char) R_X86_64_PLT32; - else - yasm_internal_error(N_("Unsupported WRT")); + size_t i; + for (i=0; iwrt == ssyms[i] && + reloc->valsize == elf_x86_amd64_ssyms[i].size) + return (unsigned char) elf_x86_amd64_ssyms[i].reloc; + } + yasm_internal_error(N_("Unsupported WRT")); } else if (reloc->rtype_rel) { switch (reloc->valsize) { case 8: return (unsigned char) R_X86_64_PC8; @@ -208,12 +212,6 @@ elf_x86_amd64_write_proghead(unsigned char **bufpp, *bufpp = bufp; } -static elf_machine_ssym elf_x86_amd64_ssyms[] = { - {"..gotpcrel", ELF_SSYM_SYM_RELATIVE}, - {"..got", ELF_SSYM_SYM_RELATIVE}, - {"..plt", 0} -}; - const elf_machine_handler elf_machine_handler_x86_amd64 = { "x86", "amd64", ".rela", diff --git a/modules/objfmts/elf/elf-x86-x86.c b/modules/objfmts/elf/elf-x86-x86.c index 67a23d0a..2a1ba14f 100644 --- a/modules/objfmts/elf/elf-x86-x86.c +++ b/modules/objfmts/elf/elf-x86-x86.c @@ -33,24 +33,32 @@ #include "elf.h" #include "elf-machine.h" -enum ssym_index { - SSYM_GOTPC = 0, - SSYM_GOTOFF, - SSYM_GOT, - SSYM_PLT +static const elf_machine_ssym elf_x86_x86_ssyms[] = { + {"plt", ELF_SSYM_SYM_RELATIVE, R_386_PLT32, 32}, + {"gotoff", 0, R_386_GOTOFF, 32}, + /* special one for NASM */ + {"gotpc", ELF_SSYM_CURPOS_ADJUST, R_386_GOTPC, 32}, + {"tlsgd", ELF_SSYM_SYM_RELATIVE, R_386_TLS_GD, 32}, + {"tlsldm", ELF_SSYM_SYM_RELATIVE, R_386_TLS_LDM, 32}, + {"gottpoff", ELF_SSYM_SYM_RELATIVE, R_386_TLS_IE_32, 32}, + {"tpoff", ELF_SSYM_SYM_RELATIVE, R_386_TLS_LE_32, 32}, + {"ntpoff", ELF_SSYM_SYM_RELATIVE, R_386_TLS_LE, 32}, + {"dtpoff", ELF_SSYM_SYM_RELATIVE, R_386_TLS_LDO_32, 32}, + {"gotntpoff", ELF_SSYM_SYM_RELATIVE, R_386_TLS_GOTIE, 32}, + {"indntpoff", ELF_SSYM_SYM_RELATIVE, R_386_TLS_IE, 32}, + {"got", ELF_SSYM_SYM_RELATIVE, R_386_GOT32, 32} }; static int elf_x86_x86_accepts_reloc(size_t val, yasm_symrec *wrt, yasm_symrec **ssyms) { if (wrt) { - if ((wrt == ssyms[SSYM_GOTPC] && val == 32) - || (wrt == ssyms[SSYM_GOTOFF] && val == 32) - || (wrt == ssyms[SSYM_GOT] && val == 32) - || (wrt == ssyms[SSYM_PLT] && val == 32)) - return 1; - else - return 0; + size_t i; + for (i=0; iwrt) { - if (reloc->wrt == ssyms[SSYM_GOTPC] && reloc->valsize == 32) - return (unsigned char) R_386_GOTPC; - else if (reloc->wrt == ssyms[SSYM_GOTOFF] && reloc->valsize == 32) - return (unsigned char) R_386_GOTOFF; - else if (reloc->wrt == ssyms[SSYM_GOT] && reloc->valsize == 32) - return (unsigned char) R_386_GOT32; - else if (reloc->wrt == ssyms[SSYM_PLT] && reloc->valsize == 32) - return (unsigned char) R_386_PLT32; - else - yasm_internal_error(N_("Unsupported WRT")); + size_t i; + for (i=0; iwrt == ssyms[i] && + reloc->valsize == elf_x86_x86_ssyms[i].size) + return (unsigned char) elf_x86_x86_ssyms[i].reloc; + } + yasm_internal_error(N_("Unsupported WRT")); } else if (reloc->rtype_rel) { switch (reloc->valsize) { case 8: return (unsigned char) R_386_PC8; @@ -193,13 +198,6 @@ elf_x86_x86_write_proghead(unsigned char **bufpp, *bufpp = bufp; } -static elf_machine_ssym elf_x86_x86_ssyms[] = { - {"..gotpc", ELF_SSYM_CURPOS_ADJUST}, - {"..gotoff", 0}, - {"..got", ELF_SSYM_SYM_RELATIVE}, - {"..plt", 0} -}; - const elf_machine_handler elf_machine_handler_x86_x86 = { "x86", "x86", ".rel", diff --git a/modules/objfmts/elf/tests/Makefile.inc b/modules/objfmts/elf/tests/Makefile.inc index bf112037..6ed13e72 100644 --- a/modules/objfmts/elf/tests/Makefile.inc +++ b/modules/objfmts/elf/tests/Makefile.inc @@ -49,7 +49,9 @@ EXTRA_DIST += modules/objfmts/elf/tests/nasm-forceident.asm EXTRA_DIST += modules/objfmts/elf/tests/nasm-forceident.hex EXTRA_DIST += modules/objfmts/elf/tests/amd64/Makefile.inc +EXTRA_DIST += modules/objfmts/elf/tests/gas32/Makefile.inc EXTRA_DIST += modules/objfmts/elf/tests/gas64/Makefile.inc include modules/objfmts/elf/tests/amd64/Makefile.inc +include modules/objfmts/elf/tests/gas32/Makefile.inc include modules/objfmts/elf/tests/gas64/Makefile.inc diff --git a/modules/objfmts/elf/tests/gas32/Makefile.inc b/modules/objfmts/elf/tests/gas32/Makefile.inc new file mode 100644 index 00000000..f9e7d114 --- /dev/null +++ b/modules/objfmts/elf/tests/gas32/Makefile.inc @@ -0,0 +1,7 @@ +# $Id$ + +TESTS += modules/objfmts/elf/tests/gas32/elf_gas32_test.sh + +EXTRA_DIST += modules/objfmts/elf/tests/gas32/elf_gas32_test.sh +EXTRA_DIST += modules/objfmts/elf/tests/gas32/elf_gas32_ssym.asm +EXTRA_DIST += modules/objfmts/elf/tests/gas32/elf_gas32_ssym.hex diff --git a/modules/objfmts/elf/tests/gas32/elf_gas32_ssym.asm b/modules/objfmts/elf/tests/gas32/elf_gas32_ssym.asm new file mode 100644 index 00000000..9bd042d0 --- /dev/null +++ b/modules/objfmts/elf/tests/gas32/elf_gas32_ssym.asm @@ -0,0 +1,14 @@ +.text +foo: +movl %eax, foo@PLT +movl %eax, foo@GOTOFF +#movl %eax, foo@GOTPC +movl %eax, bar@TLSGD +movl %eax, bar@TLSLDM +movl %eax, bar@GOTTPOFF +movl %eax, bar@TPOFF +movl %eax, bar@NTPOFF +movl %eax, bar@DTPOFF +movl %eax, bar@GOTNTPOFF +movl %eax, bar@INDNTPOFF +movl %eax, foo@GOT diff --git a/modules/objfmts/elf/tests/gas32/elf_gas32_ssym.hex b/modules/objfmts/elf/tests/gas32/elf_gas32_ssym.hex new file mode 100644 index 00000000..a6fcecc4 --- /dev/null +++ b/modules/objfmts/elf/tests/gas32/elf_gas32_ssym.hex @@ -0,0 +1,592 @@ +7f +45 +4c +46 +01 +01 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +03 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +60 +01 +00 +00 +00 +00 +00 +00 +34 +00 +00 +00 +00 +00 +28 +00 +06 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +a3 +00 +00 +00 +00 +a3 +00 +00 +00 +00 +a3 +00 +00 +00 +00 +a3 +00 +00 +00 +00 +a3 +00 +00 +00 +00 +a3 +00 +00 +00 +00 +a3 +00 +00 +00 +00 +a3 +00 +00 +00 +00 +a3 +00 +00 +00 +00 +a3 +00 +00 +00 +00 +a3 +00 +00 +00 +00 +00 +01 +00 +00 +00 +04 +02 +00 +00 +06 +00 +00 +00 +09 +03 +00 +00 +0b +00 +00 +00 +12 +04 +00 +00 +10 +00 +00 +00 +13 +04 +00 +00 +15 +00 +00 +00 +21 +04 +00 +00 +1a +00 +00 +00 +22 +04 +00 +00 +1f +00 +00 +00 +11 +04 +00 +00 +24 +00 +00 +00 +20 +04 +00 +00 +29 +00 +00 +00 +10 +04 +00 +00 +2e +00 +00 +00 +0f +04 +00 +00 +33 +00 +00 +00 +03 +02 +00 +00 +00 +2e +74 +65 +78 +74 +00 +2e +72 +65 +6c +2e +74 +65 +78 +74 +00 +2e +73 +74 +72 +74 +61 +62 +00 +2e +73 +79 +6d +74 +61 +62 +00 +2e +73 +68 +73 +74 +72 +74 +61 +62 +00 +00 +00 +2d +00 +62 +61 +72 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +f1 +ff +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +00 +04 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +21 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +d0 +00 +00 +00 +2b +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +11 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +fc +00 +00 +00 +07 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +19 +00 +00 +00 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +01 +00 +00 +50 +00 +00 +00 +02 +00 +00 +00 +04 +00 +00 +00 +04 +00 +00 +00 +10 +00 +00 +00 +01 +00 +00 +00 +01 +00 +00 +00 +06 +00 +00 +00 +00 +00 +00 +00 +40 +00 +00 +00 +37 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +07 +00 +00 +00 +09 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +78 +00 +00 +00 +58 +00 +00 +00 +03 +00 +00 +00 +04 +00 +00 +00 +04 +00 +00 +00 +08 +00 +00 +00 diff --git a/modules/objfmts/elf/tests/gas32/elf_gas32_test.sh b/modules/objfmts/elf/tests/gas32/elf_gas32_test.sh new file mode 100755 index 00000000..ca0df39a --- /dev/null +++ b/modules/objfmts/elf/tests/gas32/elf_gas32_test.sh @@ -0,0 +1,4 @@ +#! /bin/sh +# $Id$ +${srcdir}/out_test.sh elf_gas32_test modules/objfmts/elf/tests/gas32 "GAS elf-x86 objfmt" "-f elf32 -p gas" ".o" +exit $? diff --git a/modules/objfmts/elf/tests/gas64/Makefile.inc b/modules/objfmts/elf/tests/gas64/Makefile.inc index 9be81625..8cedf046 100644 --- a/modules/objfmts/elf/tests/gas64/Makefile.inc +++ b/modules/objfmts/elf/tests/gas64/Makefile.inc @@ -9,3 +9,5 @@ EXTRA_DIST += modules/objfmts/elf/tests/gas64/elf_gas64_curpos.asm EXTRA_DIST += modules/objfmts/elf/tests/gas64/elf_gas64_curpos.hex EXTRA_DIST += modules/objfmts/elf/tests/gas64/elf_gas64_reloc.asm EXTRA_DIST += modules/objfmts/elf/tests/gas64/elf_gas64_reloc.hex +EXTRA_DIST += modules/objfmts/elf/tests/gas64/elf_gas64_ssym.asm +EXTRA_DIST += modules/objfmts/elf/tests/gas64/elf_gas64_ssym.hex diff --git a/modules/objfmts/elf/tests/gas64/elf_gas64_ssym.asm b/modules/objfmts/elf/tests/gas64/elf_gas64_ssym.asm new file mode 100644 index 00000000..b7203f62 --- /dev/null +++ b/modules/objfmts/elf/tests/gas64/elf_gas64_ssym.asm @@ -0,0 +1,10 @@ +.text +foo: +movl %eax, foo@PLT +movl %eax, foo@GOTPCREL +movl %eax, bar@TLSGD +movl %eax, bar@TLSLD +movl %eax, bar@GOTTPOFF +movl %eax, bar@TPOFF +movl %eax, bar@DTPOFF +movl %eax, foo@GOT diff --git a/modules/objfmts/elf/tests/gas64/elf_gas64_ssym.hex b/modules/objfmts/elf/tests/gas64/elf_gas64_ssym.hex new file mode 100644 index 00000000..698890fa --- /dev/null +++ b/modules/objfmts/elf/tests/gas64/elf_gas64_ssym.hex @@ -0,0 +1,880 @@ +7f +45 +4c +46 +02 +01 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +3e +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +f0 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +40 +00 +00 +00 +00 +00 +40 +00 +06 +00 +01 +00 +89 +04 +25 +00 +00 +00 +00 +89 +04 +25 +00 +00 +00 +00 +89 +04 +25 +00 +00 +00 +00 +89 +04 +25 +00 +00 +00 +00 +89 +04 +25 +00 +00 +00 +00 +89 +04 +25 +00 +00 +00 +00 +89 +04 +25 +00 +00 +00 +00 +89 +04 +25 +00 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +04 +00 +00 +00 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +0a +00 +00 +00 +00 +00 +00 +00 +09 +00 +00 +00 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +11 +00 +00 +00 +00 +00 +00 +00 +13 +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +18 +00 +00 +00 +00 +00 +00 +00 +14 +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +1f +00 +00 +00 +00 +00 +00 +00 +16 +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +26 +00 +00 +00 +00 +00 +00 +00 +17 +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +2d +00 +00 +00 +00 +00 +00 +00 +15 +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +34 +00 +00 +00 +00 +00 +00 +00 +03 +00 +00 +00 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +2e +74 +65 +78 +74 +00 +2e +72 +65 +6c +61 +2e +74 +65 +78 +74 +00 +2e +73 +74 +72 +74 +61 +62 +00 +2e +73 +79 +6d +74 +61 +62 +00 +2e +73 +68 +73 +74 +72 +74 +61 +62 +00 +00 +2d +00 +62 +61 +72 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +04 +00 +f1 +ff +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +00 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +22 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +38 +01 +00 +00 +00 +00 +00 +00 +2c +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +12 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +64 +01 +00 +00 +00 +00 +00 +00 +07 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +1a +00 +00 +00 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +6c +01 +00 +00 +00 +00 +00 +00 +78 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +04 +00 +00 +00 +08 +00 +00 +00 +00 +00 +00 +00 +18 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +01 +00 +00 +00 +06 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +40 +00 +00 +00 +00 +00 +00 +00 +38 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +07 +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +78 +00 +00 +00 +00 +00 +00 +00 +c0 +00 +00 +00 +00 +00 +00 +00 +03 +00 +00 +00 +04 +00 +00 +00 +08 +00 +00 +00 +00 +00 +00 +00 +18 +00 +00 +00 +00 +00 +00 +00 From fea08b7307ed8344b2755d7ced1a2207d4d62505 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 9 Feb 2008 04:09:47 +0000 Subject: [PATCH 145/585] Update ..sym to work within new get_special_sym() framework. svn path=/trunk/yasm/; revision=2037 --- modules/objfmts/elf/elf-objfmt.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/objfmts/elf/elf-objfmt.c b/modules/objfmts/elf/elf-objfmt.c index c2464d77..b91aec9e 100644 --- a/modules/objfmts/elf/elf-objfmt.c +++ b/modules/objfmts/elf/elf-objfmt.c @@ -375,7 +375,7 @@ elf_objfmt_create_common(yasm_object *object, yasm_objfmt_module *module, /* FIXME: misuse of NULL bytecode */ objfmt_elf->dotdotsym = - yasm_symtab_define_label(object->symtab, "..sym", NULL, 1, 0); + yasm_symtab_define_label(object->symtab, "..sym", NULL, 0, 0); return (yasm_objfmt *)objfmt_elf; } @@ -1146,6 +1146,10 @@ static /*@observer@*/ /*@null@*/ yasm_symrec * elf_objfmt_get_special_sym(yasm_object *object, const char *name, const char *parser) { + if (yasm__strcasecmp(name, "sym") == 0) { + yasm_objfmt_elf *objfmt_elf = (yasm_objfmt_elf *)object->objfmt; + return objfmt_elf->dotdotsym; + } return elf_get_special_sym(name, parser); } From 7991cd8309cdd047b411d85bb516b15c9c65aa77 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 15 Feb 2008 05:25:47 +0000 Subject: [PATCH 146/585] Fix #134: Allow '@' as the first character of an identifier, like NASM does. svn path=/trunk/yasm/; revision=2038 --- modules/parsers/nasm/nasm-token.re | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/parsers/nasm/nasm-token.re b/modules/parsers/nasm/nasm-token.re index 453744be..d81e0ce6 100644 --- a/modules/parsers/nasm/nasm-token.re +++ b/modules/parsers/nasm/nasm-token.re @@ -323,7 +323,7 @@ scan: } /* identifier that may be a register, instruction, etc. */ - [a-zA-Z_?][a-zA-Z0-9_$#@~.?]* { + [a-zA-Z_?@][a-zA-Z0-9_$#@~.?]* { savech = s->tok[TOKLEN]; s->tok[TOKLEN] = '\0'; if (parser_nasm->state != INSTRUCTION) { From 40a06385d570134260d4fe56327a7e2bc6125097 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 15 Feb 2008 06:06:57 +0000 Subject: [PATCH 147/585] Pass size directly to yasm_value_finalize_expr() rather than setting afterwards. This fixes the value full-mask case for immediate operands: e.g. "mov ax, word (label & 0xffff)". svn path=/trunk/yasm/; revision=2039 --- modules/arch/x86/x86id.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/arch/x86/x86id.c b/modules/arch/x86/x86id.c index d17f045c..f385eaf3 100644 --- a/modules/arch/x86/x86id.c +++ b/modules/arch/x86/x86id.c @@ -1346,10 +1346,9 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) if (imm) { insn->imm = yasm_xmalloc(sizeof(yasm_value)); - if (yasm_value_finalize_expr(insn->imm, imm, prev_bc, 0)) + if (yasm_value_finalize_expr(insn->imm, imm, prev_bc, im_len)) yasm_error_set(YASM_ERROR_TOO_COMPLEX, N_("immediate expression too complex")); - insn->imm->size = im_len; insn->imm->sign = im_sign; } else insn->imm = NULL; From b49c080965494b4f829bc77fb43bd6fa83893725 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 21 Feb 2008 08:57:23 +0000 Subject: [PATCH 148/585] Set ELF symbol type to TLS if either: - symbol is defined in a TLS section - symbol is used in a TLS relocation This is required by the GNU linker, and matches GNU as behavior. The implementation is not as clean as it perhaps should be, but it does the job. Reported by: Nils Weller svn path=/trunk/yasm/; revision=2040 --- modules/objfmts/elf/elf-machine.h | 3 +- modules/objfmts/elf/elf-objfmt.c | 7 ++++ modules/objfmts/elf/elf-x86-amd64.c | 27 ++++++++++---- modules/objfmts/elf/elf-x86-x86.c | 36 ++++++++++++++----- modules/objfmts/elf/elf.c | 12 +++++++ modules/objfmts/elf/elf.h | 3 ++ .../elf/tests/gas32/elf_gas32_ssym.hex | 2 +- .../elf/tests/gas64/elf_gas64_ssym.hex | 2 +- 8 files changed, 74 insertions(+), 18 deletions(-) diff --git a/modules/objfmts/elf/elf-machine.h b/modules/objfmts/elf/elf-machine.h index 46cce2db..1742e444 100644 --- a/modules/objfmts/elf/elf-machine.h +++ b/modules/objfmts/elf/elf-machine.h @@ -71,7 +71,8 @@ typedef void (*func_write_proghead)(unsigned char **bufpp, enum { ELF_SSYM_SYM_RELATIVE = 1 << 0, - ELF_SSYM_CURPOS_ADJUST = 1 << 1 + ELF_SSYM_CURPOS_ADJUST = 1 << 1, + ELF_SSYM_THREAD_LOCAL = 1 << 2 }; typedef struct { diff --git a/modules/objfmts/elf/elf-objfmt.c b/modules/objfmts/elf/elf-objfmt.c index b91aec9e..2dbed1f3 100644 --- a/modules/objfmts/elf/elf-objfmt.c +++ b/modules/objfmts/elf/elf-objfmt.c @@ -1069,6 +1069,9 @@ elf_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, } else if (strcmp(sectname, ".data") == 0) { data.type = SHT_PROGBITS; data.flags = SHF_ALLOC + SHF_WRITE; + } else if (strcmp(sectname, ".tdata") == 0) { + data.type = SHT_PROGBITS; + data.flags = SHF_ALLOC + SHF_WRITE; } else if (strcmp(sectname, ".rodata") == 0) { data.type = SHT_PROGBITS; data.flags = SHF_ALLOC; @@ -1179,6 +1182,10 @@ dir_type(yasm_object *object, yasm_valparamhead *valparams, elf_sym_set_type(entry, STT_FUNC); else if (yasm__strcasecmp(type, "object") == 0) elf_sym_set_type(entry, STT_OBJECT); + else if (yasm__strcasecmp(type, "tls_object") == 0) + elf_sym_set_type(entry, STT_TLS); + else if (yasm__strcasecmp(type, "notype") == 0) + elf_sym_set_type(entry, STT_NOTYPE); else yasm_warn_set(YASM_WARN_GENERAL, N_("unrecognized symbol type `%s'"), type); diff --git a/modules/objfmts/elf/elf-x86-amd64.c b/modules/objfmts/elf/elf-x86-amd64.c index d9588284..b99f089e 100644 --- a/modules/objfmts/elf/elf-x86-amd64.c +++ b/modules/objfmts/elf/elf-x86-amd64.c @@ -36,11 +36,16 @@ static elf_machine_ssym elf_x86_amd64_ssyms[] = { {"plt", ELF_SSYM_SYM_RELATIVE, R_X86_64_PLT32, 32}, {"gotpcrel", ELF_SSYM_SYM_RELATIVE, R_X86_64_GOTPCREL, 32}, - {"tlsgd", ELF_SSYM_SYM_RELATIVE, R_X86_64_TLSGD, 32}, - {"tlsld", ELF_SSYM_SYM_RELATIVE, R_X86_64_TLSLD, 32}, - {"gottpoff", ELF_SSYM_SYM_RELATIVE, R_X86_64_GOTTPOFF, 32}, - {"tpoff", ELF_SSYM_SYM_RELATIVE, R_X86_64_TPOFF32, 32}, - {"dtpoff", ELF_SSYM_SYM_RELATIVE, R_X86_64_DTPOFF32, 32}, + {"tlsgd", ELF_SSYM_SYM_RELATIVE|ELF_SSYM_THREAD_LOCAL, + R_X86_64_TLSGD, 32}, + {"tlsld", ELF_SSYM_SYM_RELATIVE|ELF_SSYM_THREAD_LOCAL, + R_X86_64_TLSLD, 32}, + {"gottpoff", ELF_SSYM_SYM_RELATIVE|ELF_SSYM_THREAD_LOCAL, + R_X86_64_GOTTPOFF, 32}, + {"tpoff", ELF_SSYM_SYM_RELATIVE|ELF_SSYM_THREAD_LOCAL, + R_X86_64_TPOFF32, 32}, + {"dtpoff", ELF_SSYM_SYM_RELATIVE|ELF_SSYM_THREAD_LOCAL, + R_X86_64_DTPOFF32, 32}, {"got", ELF_SSYM_SYM_RELATIVE, R_X86_64_GOT32, 32} }; @@ -141,8 +146,18 @@ elf_x86_amd64_map_reloc_info_to_type(elf_reloc_entry *reloc, size_t i; for (i=0; iwrt == ssyms[i] && - reloc->valsize == elf_x86_amd64_ssyms[i].size) + reloc->valsize == elf_x86_amd64_ssyms[i].size) { + /* Force TLS type; this is required by the linker. */ + if (elf_x86_amd64_ssyms[i].sym_rel & ELF_SSYM_THREAD_LOCAL) { + elf_symtab_entry *esym; + + esym = yasm_symrec_get_data(reloc->reloc.sym, + &elf_symrec_data); + if (esym) + esym->type = STT_TLS; + } return (unsigned char) elf_x86_amd64_ssyms[i].reloc; + } } yasm_internal_error(N_("Unsupported WRT")); } else if (reloc->rtype_rel) { diff --git a/modules/objfmts/elf/elf-x86-x86.c b/modules/objfmts/elf/elf-x86-x86.c index 2a1ba14f..07d60fd2 100644 --- a/modules/objfmts/elf/elf-x86-x86.c +++ b/modules/objfmts/elf/elf-x86-x86.c @@ -38,14 +38,22 @@ static const elf_machine_ssym elf_x86_x86_ssyms[] = { {"gotoff", 0, R_386_GOTOFF, 32}, /* special one for NASM */ {"gotpc", ELF_SSYM_CURPOS_ADJUST, R_386_GOTPC, 32}, - {"tlsgd", ELF_SSYM_SYM_RELATIVE, R_386_TLS_GD, 32}, - {"tlsldm", ELF_SSYM_SYM_RELATIVE, R_386_TLS_LDM, 32}, - {"gottpoff", ELF_SSYM_SYM_RELATIVE, R_386_TLS_IE_32, 32}, - {"tpoff", ELF_SSYM_SYM_RELATIVE, R_386_TLS_LE_32, 32}, - {"ntpoff", ELF_SSYM_SYM_RELATIVE, R_386_TLS_LE, 32}, - {"dtpoff", ELF_SSYM_SYM_RELATIVE, R_386_TLS_LDO_32, 32}, - {"gotntpoff", ELF_SSYM_SYM_RELATIVE, R_386_TLS_GOTIE, 32}, - {"indntpoff", ELF_SSYM_SYM_RELATIVE, R_386_TLS_IE, 32}, + {"tlsgd", ELF_SSYM_SYM_RELATIVE|ELF_SSYM_THREAD_LOCAL, + R_386_TLS_GD, 32}, + {"tlsldm", ELF_SSYM_SYM_RELATIVE|ELF_SSYM_THREAD_LOCAL, + R_386_TLS_LDM, 32}, + {"gottpoff", ELF_SSYM_SYM_RELATIVE|ELF_SSYM_THREAD_LOCAL, + R_386_TLS_IE_32, 32}, + {"tpoff", ELF_SSYM_SYM_RELATIVE|ELF_SSYM_THREAD_LOCAL, + R_386_TLS_LE_32, 32}, + {"ntpoff", ELF_SSYM_SYM_RELATIVE|ELF_SSYM_THREAD_LOCAL, + R_386_TLS_LE, 32}, + {"dtpoff", ELF_SSYM_SYM_RELATIVE|ELF_SSYM_THREAD_LOCAL, + R_386_TLS_LDO_32, 32}, + {"gotntpoff", ELF_SSYM_SYM_RELATIVE|ELF_SSYM_THREAD_LOCAL, + R_386_TLS_GOTIE, 32}, + {"indntpoff", ELF_SSYM_SYM_RELATIVE|ELF_SSYM_THREAD_LOCAL, + R_386_TLS_IE, 32}, {"got", ELF_SSYM_SYM_RELATIVE, R_386_GOT32, 32} }; @@ -138,8 +146,18 @@ elf_x86_x86_map_reloc_info_to_type(elf_reloc_entry *reloc, size_t i; for (i=0; iwrt == ssyms[i] && - reloc->valsize == elf_x86_x86_ssyms[i].size) + reloc->valsize == elf_x86_x86_ssyms[i].size) { + /* Force TLS type; this is required by the linker. */ + if (elf_x86_x86_ssyms[i].sym_rel & ELF_SSYM_THREAD_LOCAL) { + elf_symtab_entry *esym; + + esym = yasm_symrec_get_data(reloc->reloc.sym, + &elf_symrec_data); + if (esym) + esym->type = STT_TLS; + } return (unsigned char) elf_x86_x86_ssyms[i].reloc; + } } yasm_internal_error(N_("Unsupported WRT")); } else if (reloc->rtype_rel) { diff --git a/modules/objfmts/elf/elf.c b/modules/objfmts/elf/elf.c index 807a3afe..01c2fa5b 100644 --- a/modules/objfmts/elf/elf.c +++ b/modules/objfmts/elf/elf.c @@ -495,6 +495,18 @@ elf_symtab_write_to_file(FILE *f, elf_symtab_head *symtab, if (value_intn == NULL) value_intn = yasm_intnum_create_uint(entry->value); + /* If symbol is in a TLS section, force its type to TLS. */ + if (entry->sym) { + yasm_bytecode *precbc; + yasm_section *sect; + elf_secthead *shead; + if (yasm_symrec_get_label(entry->sym, &precbc) && + (sect = yasm_bc_get_section(precbc)) && + (shead = yasm_section_get_data(sect, &elf_section_data)) && + shead->flags & SHF_TLS) { + entry->type = STT_TLS; + } + } if (!elf_march->write_symtab_entry || !elf_march->symtab_entry_size) yasm_internal_error(N_("Unsupported machine for ELF output")); diff --git a/modules/objfmts/elf/elf.h b/modules/objfmts/elf/elf.h index a10b0b49..1fe18bd2 100644 --- a/modules/objfmts/elf/elf.h +++ b/modules/objfmts/elf/elf.h @@ -191,6 +191,9 @@ typedef enum { STT_FUNC = 2, /* a function or executable code */ STT_SECTION = 3, /* a section: often for relocation, STB_LOCAL */ STT_FILE = 4, /* often source filename: STB_LOCAL, SHN_ABS */ + STT_COMMON = 5, /* Uninitialized common block. */ + STT_TLS = 6, /* TLS object. */ + STT_NUM = 7, STT_LOOS = 10, /* Environment specific use */ STT_HIOS = 12, diff --git a/modules/objfmts/elf/tests/gas32/elf_gas32_ssym.hex b/modules/objfmts/elf/tests/gas32/elf_gas32_ssym.hex index a6fcecc4..61057e2f 100644 --- a/modules/objfmts/elf/tests/gas32/elf_gas32_ssym.hex +++ b/modules/objfmts/elf/tests/gas32/elf_gas32_ssym.hex @@ -334,7 +334,7 @@ ff 00 00 00 -10 +16 00 00 00 diff --git a/modules/objfmts/elf/tests/gas64/elf_gas64_ssym.hex b/modules/objfmts/elf/tests/gas64/elf_gas64_ssym.hex index 698890fa..06e4c138 100644 --- a/modules/objfmts/elf/tests/gas64/elf_gas64_ssym.hex +++ b/modules/objfmts/elf/tests/gas64/elf_gas64_ssym.hex @@ -462,7 +462,7 @@ ff 00 00 00 -10 +16 00 00 00 From 6ced647e9798da6e57331065770e4a71131ea802 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 21 Feb 2008 09:00:46 +0000 Subject: [PATCH 149/585] Allow setting of the TLS section flag in the NASM section directive. Also default the .tdata section to having the TLS flag set. svn path=/trunk/yasm/; revision=2041 --- modules/objfmts/elf/elf-objfmt.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/objfmts/elf/elf-objfmt.c b/modules/objfmts/elf/elf-objfmt.c index 2dbed1f3..142275ea 100644 --- a/modules/objfmts/elf/elf-objfmt.c +++ b/modules/objfmts/elf/elf-objfmt.c @@ -1031,6 +1031,8 @@ elf_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, offsetof(struct elf_section_switch_data, flags), SHF_EXECINSTR }, { "write", 0, yasm_dir_helper_flag_or, offsetof(struct elf_section_switch_data, flags), SHF_WRITE }, + { "tls", 0, yasm_dir_helper_flag_or, + offsetof(struct elf_section_switch_data, flags), SHF_TLS }, { "progbits", 0, yasm_dir_helper_flag_set, offsetof(struct elf_section_switch_data, type), SHT_PROGBITS }, { "noalloc", 0, yasm_dir_helper_flag_and, @@ -1039,6 +1041,8 @@ elf_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, offsetof(struct elf_section_switch_data, flags), SHF_EXECINSTR }, { "nowrite", 0, yasm_dir_helper_flag_and, offsetof(struct elf_section_switch_data, flags), SHF_WRITE }, + { "notls", 0, yasm_dir_helper_flag_and, + offsetof(struct elf_section_switch_data, flags), SHF_TLS }, { "noprogbits", 0, yasm_dir_helper_flag_set, offsetof(struct elf_section_switch_data, type), SHT_NOBITS }, { "nobits", 0, yasm_dir_helper_flag_set, @@ -1071,7 +1075,7 @@ elf_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, data.flags = SHF_ALLOC + SHF_WRITE; } else if (strcmp(sectname, ".tdata") == 0) { data.type = SHT_PROGBITS; - data.flags = SHF_ALLOC + SHF_WRITE; + data.flags = SHF_ALLOC + SHF_WRITE + SHF_TLS; } else if (strcmp(sectname, ".rodata") == 0) { data.type = SHT_PROGBITS; data.flags = SHF_ALLOC; From 11ca8fd3241f027b95ec021c41b9ed8bc779259c Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 22 Feb 2008 04:48:56 +0000 Subject: [PATCH 150/585] Add support for Nehalem XSAVE instructions and CPU feature. svn path=/trunk/yasm/; revision=2042 --- modules/arch/x86/gen_x86_insn.py | 12 ++++++++++++ modules/arch/x86/tests/Makefile.inc | 2 ++ modules/arch/x86/tests/xsave.asm | 4 ++++ modules/arch/x86/tests/xsave.hex | 16 ++++++++++++++++ modules/arch/x86/x86arch.h | 1 + modules/arch/x86/x86cpu.gperf | 6 +++++- 6 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 modules/arch/x86/tests/xsave.asm create mode 100644 modules/arch/x86/tests/xsave.hex diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index fd923d4f..d850feed 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -5323,6 +5323,18 @@ add_insn("pshaq", "sse5psh", modifiers=[0x07]) # roundps, roundpd, roundss, roundsd, ptest are in SSE4.1 +##################################################################### +# Intel XSAVE instructions +##################################################################### +add_insn("xgetbv", "threebyte", modifiers=[0x0F, 0x01, 0xD0], + cpu=["XSAVE", "386"]) +add_insn("xsetbv", "threebyte", modifiers=[0x0F, 0x01, 0xD1], + cpu=["XSAVE", "386", "Priv"]) +add_insn("xsave", "twobytemem", modifiers=[4, 0x0F, 0xAE], + cpu=["XSAVE", "386"]) +add_insn("xrstor", "twobytemem", modifiers=[5, 0x0F, 0xAE], + cpu=["XSAVE", "386"]) + ##################################################################### # AMD 3DNow! instructions ##################################################################### diff --git a/modules/arch/x86/tests/Makefile.inc b/modules/arch/x86/tests/Makefile.inc index b9f35d2b..b500f419 100644 --- a/modules/arch/x86/tests/Makefile.inc +++ b/modules/arch/x86/tests/Makefile.inc @@ -204,6 +204,8 @@ EXTRA_DIST += modules/arch/x86/tests/xchg64.asm EXTRA_DIST += modules/arch/x86/tests/xchg64.hex EXTRA_DIST += modules/arch/x86/tests/xmm64.asm EXTRA_DIST += modules/arch/x86/tests/xmm64.hex +EXTRA_DIST += modules/arch/x86/tests/xsave.asm +EXTRA_DIST += modules/arch/x86/tests/xsave.hex EXTRA_DIST += modules/arch/x86/tests/gas32/Makefile.inc EXTRA_DIST += modules/arch/x86/tests/gas64/Makefile.inc diff --git a/modules/arch/x86/tests/xsave.asm b/modules/arch/x86/tests/xsave.asm new file mode 100644 index 00000000..6105879d --- /dev/null +++ b/modules/arch/x86/tests/xsave.asm @@ -0,0 +1,4 @@ +xsave [0] +xrstor [0] +xgetbv +xsetbv diff --git a/modules/arch/x86/tests/xsave.hex b/modules/arch/x86/tests/xsave.hex new file mode 100644 index 00000000..2b6d09a0 --- /dev/null +++ b/modules/arch/x86/tests/xsave.hex @@ -0,0 +1,16 @@ +0f +ae +26 +00 +00 +0f +ae +2e +00 +00 +0f +01 +d0 +0f +01 +d1 diff --git a/modules/arch/x86/x86arch.h b/modules/arch/x86/x86arch.h index b5c0f091..bd53e373 100644 --- a/modules/arch/x86/x86arch.h +++ b/modules/arch/x86/x86arch.h @@ -65,6 +65,7 @@ #define CPU_SSE42 31 /* Streaming SIMD extensions 4.2 required */ #define CPU_SSE4a 32 /* AMD Streaming SIMD extensions 4a required */ #define CPU_SSE5 33 /* AMD Streaming SIMD extensions 5 required */ +#define CPU_XSAVE 33 /* Intel XSAVE instruction */ /* Technically not CPU capabilities, they do affect what instructions are * available. These are tested against BITS==64. diff --git a/modules/arch/x86/x86cpu.gperf b/modules/arch/x86/x86cpu.gperf index 5487d320..c3f27e5b 100644 --- a/modules/arch/x86/x86cpu.gperf +++ b/modules/arch/x86/x86cpu.gperf @@ -58,8 +58,10 @@ x86_cpu_intel(wordptr cpu, unsigned int data) BitVector_Bit_On(cpu, CPU_Prot); if (data >= PROC_386) BitVector_Bit_On(cpu, CPU_SMM); - if (data >= PROC_nehalem) + if (data >= PROC_nehalem) { BitVector_Bit_On(cpu, CPU_SSE42); + BitVector_Bit_On(cpu, CPU_XSAVE); + } if (data >= PROC_penryn) BitVector_Bit_On(cpu, CPU_SSE41); if (data >= PROC_conroe) @@ -326,6 +328,8 @@ sse4, x86_cpu_set_sse4, 0 nosse4, x86_cpu_clear_sse4, 0 sse5, x86_cpu_set, CPU_SSE5 nosse5, x86_cpu_clear, CPU_SSE5 +xsave, x86_cpu_set, CPU_XSAVE +noxsave, x86_cpu_clear, CPU_XSAVE %% void From 31b0b9294c9ca85d2ad10533470bd75d46799256 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 22 Feb 2008 04:50:32 +0000 Subject: [PATCH 151/585] Fix CPU feature bit number for XSAVE. svn path=/trunk/yasm/; revision=2043 --- modules/arch/x86/x86arch.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/arch/x86/x86arch.h b/modules/arch/x86/x86arch.h index bd53e373..466039d2 100644 --- a/modules/arch/x86/x86arch.h +++ b/modules/arch/x86/x86arch.h @@ -65,7 +65,7 @@ #define CPU_SSE42 31 /* Streaming SIMD extensions 4.2 required */ #define CPU_SSE4a 32 /* AMD Streaming SIMD extensions 4a required */ #define CPU_SSE5 33 /* AMD Streaming SIMD extensions 5 required */ -#define CPU_XSAVE 33 /* Intel XSAVE instruction */ +#define CPU_XSAVE 34 /* Intel XSAVE instructions */ /* Technically not CPU capabilities, they do affect what instructions are * available. These are tested against BITS==64. From 698f3fe8ffdc1a29028d99f945d16b943541bbf5 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 27 Mar 2008 05:35:36 +0000 Subject: [PATCH 152/585] Fix #136: Unbreak ..@ non-local-label mechanism. Add testcase for this. Also fix $-prefixed labels to match non-$-prefixed label behavior (this has been broken for a very long time). svn path=/trunk/yasm/; revision=2045 --- modules/parsers/nasm/nasm-parse.c | 4 ++ modules/parsers/nasm/nasm-parser.h | 1 + modules/parsers/nasm/nasm-token.re | 63 +++++++++++++---------- modules/parsers/nasm/tests/Makefile.inc | 2 + modules/parsers/nasm/tests/locallabel.asm | 21 ++++++++ modules/parsers/nasm/tests/locallabel.hex | 16 ++++++ 6 files changed, 79 insertions(+), 28 deletions(-) create mode 100644 modules/parsers/nasm/tests/locallabel.asm create mode 100644 modules/parsers/nasm/tests/locallabel.hex diff --git a/modules/parsers/nasm/nasm-parse.c b/modules/parsers/nasm/nasm-parse.c index 02a64121..cba949f8 100644 --- a/modules/parsers/nasm/nasm-parse.c +++ b/modules/parsers/nasm/nasm-parse.c @@ -98,6 +98,7 @@ destroy_curtok_(yasm_parser_nasm *parser_nasm) case ID: case LOCAL_ID: case SPECIAL_ID: + case NONLOCAL_ID: yasm_xfree(curval.str_val); break; case STRING: @@ -169,6 +170,7 @@ describe_token(int token) case ID: str = "identifier"; break; case LOCAL_ID: str = ".identifier"; break; case SPECIAL_ID: str = "..identifier"; break; + case NONLOCAL_ID: str = "..@identifier"; break; case LINE: str = "%line"; break; default: strch[1] = token; @@ -349,6 +351,7 @@ parse_line(yasm_parser_nasm *parser_nasm) return parse_times(parser_nasm); case ID: case SPECIAL_ID: + case NONLOCAL_ID: case LOCAL_ID: { char *name = ID_val; @@ -1143,6 +1146,7 @@ parse_expr6(yasm_parser_nasm *parser_nasm, expr_type type) /*@fallthrough@*/ case ID: case LOCAL_ID: + case NONLOCAL_ID: sym = yasm_symtab_use(p_symtab, ID_val, cur_line); e = p_expr_new_ident(yasm_expr_sym(sym)); yasm_xfree(ID_val); diff --git a/modules/parsers/nasm/nasm-parser.h b/modules/parsers/nasm/nasm-parser.h index 359761c3..c6148a7b 100644 --- a/modules/parsers/nasm/nasm-parser.h +++ b/modules/parsers/nasm/nasm-parser.h @@ -62,6 +62,7 @@ enum tokentype { ID, LOCAL_ID, SPECIAL_ID, + NONLOCAL_ID, LINE, NONE /* special token for lookahead */ }; diff --git a/modules/parsers/nasm/nasm-token.re b/modules/parsers/nasm/nasm-token.re index d81e0ce6..4409566c 100644 --- a/modules/parsers/nasm/nasm-token.re +++ b/modules/parsers/nasm/nasm-token.re @@ -70,6 +70,34 @@ static int linechg_numcount; quot = ["']; */ +static int +handle_dot_label(YYSTYPE *lvalp, char *tok, size_t toklen, size_t zeropos, + yasm_parser_nasm *parser_nasm) +{ + /* check for special non-local labels like ..start */ + if (tok[zeropos+1] == '.') { + lvalp->str_val = yasm__xstrndup(tok+zeropos, toklen-zeropos); + /* check for special non-local ..@label */ + if (lvalp->str_val[zeropos+2] == '@') + return NONLOCAL_ID; + return SPECIAL_ID; + } + + if (!parser_nasm->locallabel_base) { + lvalp->str_val = yasm__xstrndup(tok+zeropos, toklen-zeropos); + yasm_warn_set(YASM_WARN_GENERAL, + N_("no non-local label before `%s'"), + lvalp->str_val); + } else { + size_t len = toklen - zeropos + parser_nasm->locallabel_base_len; + lvalp->str_val = yasm_xmalloc(len + 1); + strcpy(lvalp->str_val, parser_nasm->locallabel_base); + strncat(lvalp->str_val, tok+zeropos, toklen-zeropos); + lvalp->str_val[len] = '\0'; + } + + return LOCAL_ID; +} int nasm_parser_lex(YYSTYPE *lvalp, yasm_parser_nasm *parser_nasm) @@ -77,7 +105,7 @@ nasm_parser_lex(YYSTYPE *lvalp, yasm_parser_nasm *parser_nasm) yasm_scanner *s = &parser_nasm->s; YYCTYPE *cursor = s->cur; YYCTYPE endch; - size_t count, len; + size_t count; YYCTYPE savech; /* Handle one token of lookahead */ @@ -286,38 +314,17 @@ scan: [-+|^*&/%~$():=,\[] { RETURN(s->tok[0]); } "]" { RETURN(s->tok[0]); } - /* special non-local ..@label */ - "..@" [a-zA-Z0-9_$#@~.?]+ { - lvalp->str_val = yasm__xstrndup(TOK, TOKLEN); - RETURN(ID); - } - - /* special non-local labels like ..start */ - ".." [a-zA-Z0-9_$#~.?]+ { - lvalp->str_val = yasm__xstrndup(TOK, TOKLEN); - RETURN(SPECIAL_ID); - } - /* local label (.label) */ - "." [a-zA-Z0-9_$#@~?][a-zA-Z0-9_$#@~.?]* { - if (!parser_nasm->locallabel_base) { - lvalp->str_val = yasm__xstrndup(TOK, TOKLEN); - yasm_warn_set(YASM_WARN_GENERAL, - N_("no non-local label before `%s'"), - lvalp->str_val); - } else { - len = TOKLEN + parser_nasm->locallabel_base_len; - lvalp->str_val = yasm_xmalloc(len + 1); - strcpy(lvalp->str_val, parser_nasm->locallabel_base); - strncat(lvalp->str_val, TOK, TOKLEN); - lvalp->str_val[len] = '\0'; - } - - RETURN(LOCAL_ID); + "." [a-zA-Z0-9_$#@~.?]+ { + RETURN(handle_dot_label(lvalp, TOK, TOKLEN, 0, parser_nasm)); } /* forced identifier */ "$" [a-zA-Z0-9_$#@~.?]+ { + if (TOK[1] == '.') { + /* handle like .label */ + RETURN(handle_dot_label(lvalp, TOK, TOKLEN, 1, parser_nasm)); + } lvalp->str_val = yasm__xstrndup(TOK+1, TOKLEN-1); RETURN(ID); } diff --git a/modules/parsers/nasm/tests/Makefile.inc b/modules/parsers/nasm/tests/Makefile.inc index 0e7cf1ed..ad84593c 100644 --- a/modules/parsers/nasm/tests/Makefile.inc +++ b/modules/parsers/nasm/tests/Makefile.inc @@ -19,6 +19,8 @@ EXTRA_DIST += modules/parsers/nasm/tests/hexconst.asm EXTRA_DIST += modules/parsers/nasm/tests/hexconst.hex EXTRA_DIST += modules/parsers/nasm/tests/long.asm EXTRA_DIST += modules/parsers/nasm/tests/long.hex +EXTRA_DIST += modules/parsers/nasm/tests/locallabel.asm +EXTRA_DIST += modules/parsers/nasm/tests/locallabel.hex EXTRA_DIST += modules/parsers/nasm/tests/nasm-prefix.asm EXTRA_DIST += modules/parsers/nasm/tests/nasm-prefix.hex EXTRA_DIST += modules/parsers/nasm/tests/newsect.asm diff --git a/modules/parsers/nasm/tests/locallabel.asm b/modules/parsers/nasm/tests/locallabel.asm new file mode 100644 index 00000000..013de530 --- /dev/null +++ b/modules/parsers/nasm/tests/locallabel.asm @@ -0,0 +1,21 @@ +label: +db 0 +.local: +db 0 +..@local1: +.local2: +dw label.local +dw label.local2 + +$label2: +db 0 +$.local: +db 0 +$..@local2: +$.local2: +dw label2.local +dw label2.local2 +dw $label2.local +dw $label2.local2 + + diff --git a/modules/parsers/nasm/tests/locallabel.hex b/modules/parsers/nasm/tests/locallabel.hex new file mode 100644 index 00000000..4aaba4ef --- /dev/null +++ b/modules/parsers/nasm/tests/locallabel.hex @@ -0,0 +1,16 @@ +00 +00 +01 +00 +02 +00 +00 +00 +07 +00 +08 +00 +07 +00 +08 +00 From 211072d520533ce5c56c4faf39c63706ad4fc166 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 28 Mar 2008 02:42:41 +0000 Subject: [PATCH 153/585] Include VC9 build files in the distfile. Noticed by: Brian Gladman svn path=/trunk/yasm/; revision=2046 --- Makefile.am | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Makefile.am b/Makefile.am index 3eae0cb8..35bc57de 100644 --- a/Makefile.am +++ b/Makefile.am @@ -101,6 +101,27 @@ EXTRA_DIST += Mkfiles/vc8/re2c/re2c.vcproj EXTRA_DIST += Mkfiles/vc8/re2c/run.bat EXTRA_DIST += Mkfiles/vc8/genperf/genperf.vcproj EXTRA_DIST += Mkfiles/vc8/genperf/run.bat +EXTRA_DIST += Mkfiles/vc9/crt_secure_no_deprecate.vsprops +EXTRA_DIST += Mkfiles/vc9/yasm.sln +EXTRA_DIST += Mkfiles/vc9/yasm.vcproj +EXTRA_DIST += Mkfiles/vc9/config.h +EXTRA_DIST += Mkfiles/vc9/libyasm-stdint.h +EXTRA_DIST += Mkfiles/vc9/readme.vc9.txt +EXTRA_DIST += Mkfiles/vc9/yasm.rules +EXTRA_DIST += Mkfiles/vc9/genmacro/genmacro.vcproj +EXTRA_DIST += Mkfiles/vc9/genmacro/run.bat +EXTRA_DIST += Mkfiles/vc9/genmodule/genmodule.vcproj +EXTRA_DIST += Mkfiles/vc9/genmodule/run.bat +EXTRA_DIST += Mkfiles/vc9/genstring/genstring.vcproj +EXTRA_DIST += Mkfiles/vc9/genstring/run.bat +EXTRA_DIST += Mkfiles/vc9/genversion/genversion.vcproj +EXTRA_DIST += Mkfiles/vc9/genversion/run.bat +EXTRA_DIST += Mkfiles/vc9/libyasm/libyasm.vcproj +EXTRA_DIST += Mkfiles/vc9/modules/modules.vcproj +EXTRA_DIST += Mkfiles/vc9/re2c/re2c.vcproj +EXTRA_DIST += Mkfiles/vc9/re2c/run.bat +EXTRA_DIST += Mkfiles/vc9/genperf/genperf.vcproj +EXTRA_DIST += Mkfiles/vc9/genperf/run.bat # Until this gets fixed in automake DISTCLEANFILES += libyasm/stamp-h libyasm/stamp-h[0-9]* From 33746edaa4ba14f7bbab6fbd29c8245a5f2a3670 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 1 Apr 2008 04:25:15 +0000 Subject: [PATCH 154/585] Minor update of VC9 compile readme. Also add conversion script from vc9 (2008) build files to vc8 (2005) build files. Contributed by: Brian Gladman svn path=/trunk/yasm/; revision=2047 --- Makefile.am | 1 + Mkfiles/vc9/readme.vc9.txt | 43 ++++++++++-- Mkfiles/vc9/vc928.c | 134 +++++++++++++++++++++++++++++++++++++ 3 files changed, 171 insertions(+), 7 deletions(-) create mode 100644 Mkfiles/vc9/vc928.c diff --git a/Makefile.am b/Makefile.am index 35bc57de..b9a9ed33 100644 --- a/Makefile.am +++ b/Makefile.am @@ -108,6 +108,7 @@ EXTRA_DIST += Mkfiles/vc9/config.h EXTRA_DIST += Mkfiles/vc9/libyasm-stdint.h EXTRA_DIST += Mkfiles/vc9/readme.vc9.txt EXTRA_DIST += Mkfiles/vc9/yasm.rules +EXTRA_DIST += Mkfiles/vc9/vc928.c EXTRA_DIST += Mkfiles/vc9/genmacro/genmacro.vcproj EXTRA_DIST += Mkfiles/vc9/genmacro/run.bat EXTRA_DIST += Mkfiles/vc9/genmodule/genmodule.vcproj diff --git a/Mkfiles/vc9/readme.vc9.txt b/Mkfiles/vc9/readme.vc9.txt index caec9e66..50cf1616 100644 --- a/Mkfiles/vc9/readme.vc9.txt +++ b/Mkfiles/vc9/readme.vc9.txt @@ -1,15 +1,17 @@ -Building YASM with Microsoft Visual Studio 2008 ------------------------------------------------ +Building YASM with Microsoft Visual Studio 2008 (C/C++ v9) +---------------------------------------------------------- This note describes how to build YASM using Microsoft Visual -Studio 2008. +Studio 2008 (C/C++ v9). It also provides a way of using +these files to build YASM with Visual Studio 2005 (C/C++ v8). 1. The Compiler --------------- -If you want to build the 64-bit version of YASM you will need to install the Visual Studio 2008 64-bit tools, which may not be -installed by default. +If you want to build the 64-bit version of YASM you will need +to install the Visual Studio 2008 64-bit tools, which may not +be installed by default. 2. YASM Download ---------------- @@ -86,8 +88,35 @@ has to be used instead: This limitation may also cause problems with other instruction that use absolute addresses. +6. Building with Visual Studio 2005 +----------------------------------- + +The program vc928.c will convert VC9 build projects into those +needed for Visual Studio 2005 (VC8). It will also convert files +that have been converted in this way back into their original +form. It does this conversion by looking for *.vcproj files +in the current working directory and its sub-directories and +changing the following line in each of them: + + Version="9.00" + +to: + + Version="8.00" + +or vice versa. + +It is used by compiling it, placing it in a root build directory +and running it from there. + +Because it acts recursively on all sub-directories of this directory +it is important not to run it at a directory level in which not all +projects are to be converted. + +7. Acknowledgements +------------------- + I am most grateful for the fantastic support that Peter Johnson, YASM's creator, has given me in tracking down this issue. - Brian Gladman, 30th January 2008 - + Brian Gladman, 28th March 2008 diff --git a/Mkfiles/vc9/vc928.c b/Mkfiles/vc9/vc928.c new file mode 100644 index 00000000..b1d6fc81 --- /dev/null +++ b/Mkfiles/vc9/vc928.c @@ -0,0 +1,134 @@ +/* + --------------------------------------------------------------------------- + Copyright (c) 1998-2007, Brian Gladman, Worcester, UK. All rights reserved. + + LICENSE TERMS + + The free distribution and use of this software is allowed (with or without + changes) provided that: + + 1. source code distributions include the above copyright notice, this + list of conditions and the following disclaimer; + + 2. binary distributions include the above copyright notice, this list + of conditions and the following disclaimer in their documentation; + + 3. the name of the copyright holder is not used to endorse products + built using this software without specific written permission. + + DISCLAIMER + + This software is provided 'as is' with no explicit or implied warranties + in respect of its properties, including, but not limited to, correctness + and/or fitness for purpose. + --------------------------------------------------------------------------- + + This program converts Visual Studio 2008 C/C++ version 9 build projects + into build projects for Visual Studio 2005 C/C++ version 8. It will + also convert files that have been converted in this way back into their + original form. It does this conversion by looking for *.vcproj files + in the current working directory and its sub-directories and changing + the following line in each of them: + + Version="9.00" + + to: + + Version="8.00" + + or vice versa. + + It is used by compiling it, placing it in a root build directory and + running it from there. It acts recursively on all sub-directories of + this directory it is important not to run it at a directory level in + which not all projects are to be converted. +*/ + +#include +#include +#include +#include + +void process_file(char *fn) +{ FILE *f; + fpos_t pos; + char iobuf[1024], *p; + + if((f = fopen(fn, "r+")) == 0) /* open for read and write */ + { + printf("File open error on: %s\n", fn); return; + } + + for( ; ; ) + { + if(feof(f)) /* version line not found */ + break; + + if(fgetpos(f, &pos)) /* save position of line */ + { + printf("File getpos error on: %s\n", fn); break; + } + + if(!fgets(iobuf, 1024, f)) /* read the line in */ + { + printf("File read error on: %s\n", fn); break; + } + + if(p = strchr(iobuf, 'V')) /* look for 'version' line */ + { + if(!strncmp(p, "Version=\"8.00\"", 14) + || !strncmp(p, "Version=\"9.00\"", 14)) + { + *(p + 9) ^= 1; /* switch versions */ + /* reset back to start of line in the file and */ + /* write the changed line to the file */ + if(fsetpos(f, &pos)) + printf("File setpos error on: %s\n", fn); + else if(fputs(iobuf, f) == EOF) + printf("File write error on: %s\n", fn); + break; /* this file is now fixed */ + } + } + } + fclose(f); +} + +void find_vcproj_files(char *dir) +{ struct _finddata_t cfile; + intptr_t hfile; + char nbuf[_MAX_PATH], *p; + + strcpy(nbuf, dir); /* find directories and files */ + strcat(nbuf, "\\*.*"); + if((hfile = _findfirst( nbuf, &cfile )) == -1L ) + return; /* if directory is empty */ + + do + { + strcpy(nbuf, dir); /* compile path to the current */ + strcat(nbuf, "\\"); /* file or directory */ + strcat(nbuf, cfile.name); + + if((cfile.attrib & _A_SUBDIR) == _A_SUBDIR) + { /* if it is a sub-direcory */ + if(strcmp(cfile.name, ".") && strcmp(cfile.name, "..")) + find_vcproj_files(nbuf); /* recursive search */ + } + else if((cfile.attrib & 0x1f) == _A_NORMAL && (p = strrchr(cfile.name, '.')) + && !strcmp(p, ".vcproj")) + process_file(nbuf); /* if it is a *.vcproj file */ + } + while + ( _findnext( hfile, &cfile ) == 0 ); + + _findclose( hfile ); +} + +int main(void) +{ char *dir; + + if(!(dir = _getcwd( NULL, 0 ))) + printf("Cannot obtain current working directory\n"); + else + find_vcproj_files(dir); +} From 33cc7a02551e852c69f7a99a3da984d6a59f2894 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 3 Apr 2008 06:45:49 +0000 Subject: [PATCH 155/585] Add mnenomic condition codes for SSE5 comparison opcodes. There are 16 condition codes for COM and 8 condition codes for PCOM/PCOMU. Noticed by: nasm64developer@users.sf.net svn path=/trunk/yasm/; revision=2048 --- modules/arch/x86/gen_x86_insn.py | 49 +++++++ modules/arch/x86/tests/Makefile.inc | 2 + modules/arch/x86/tests/sse5-cc.asm | 37 ++++++ modules/arch/x86/tests/sse5-cc.hex | 192 ++++++++++++++++++++++++++++ 4 files changed, 280 insertions(+) create mode 100644 modules/arch/x86/tests/sse5-cc.asm create mode 100644 modules/arch/x86/tests/sse5-cc.hex diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index d850feed..da0f3012 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -5019,11 +5019,48 @@ for sz in [32, 64]: Operand(type="Mem", size=sz, relaxed=True, dest="EA"), Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +# Condition code versions +add_group("sse5comcc", + cpu=["SSE5"], + modifiers=["Op2Add", "Imm8"], + opcode=[0x0F, 0x25, 0x00], + drex_oc0=0, + operands=[Operand(type="SIMDReg", size=128, dest="DREX"), + Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) + +for sz in [32, 64]: + add_group("sse5comcc%d" % sz, + cpu=["SSE5"], + modifiers=["Op2Add", "Imm8"], + opcode=[0x0F, 0x25, 0x00], + drex_oc0=0, + operands=[Operand(type="SIMDReg", size=128, dest="DREX"), + Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA")]) + add_group("sse5comcc%d" % sz, + cpu=["SSE5"], + modifiers=["Op2Add", "Imm8"], + opcode=[0x0F, 0x25, 0x00], + drex_oc0=0, + operands=[Operand(type="SIMDReg", size=128, dest="DREX"), + Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Mem", size=sz, relaxed=True, dest="EA")]) + add_insn("comps", "sse5com", modifiers=[0x2C]) add_insn("compd", "sse5com", modifiers=[0x2D]) add_insn("comss", "sse5com32", modifiers=[0x2E]) add_insn("comsd", "sse5com64", modifiers=[0x2F]) +for ib, cc in enumerate([ "eq", "lt", "le", "unord", + "uneq", "unlt", "unle", "ord", + "ueq", "ult", "ule", "false", + "neq", "nlt", "nle", "true"]): + add_insn("com"+cc+"ps", "sse5comcc", modifiers=[0x2C, ib]) + add_insn("com"+cc+"pd", "sse5comcc", modifiers=[0x2D, ib]) + add_insn("com"+cc+"ss", "sse5comcc32", modifiers=[0x2E, ib]) + add_insn("com"+cc+"sd", "sse5comcc64", modifiers=[0x2F, ib]) + add_insn("pcomb", "sse5com", modifiers=[0x4C]) add_insn("pcomw", "sse5com", modifiers=[0x4D]) add_insn("pcomd", "sse5com", modifiers=[0x4E]) @@ -5034,6 +5071,18 @@ add_insn("pcomuw", "sse5com", modifiers=[0x6D]) add_insn("pcomud", "sse5com", modifiers=[0x6E]) add_insn("pcomuq", "sse5com", modifiers=[0x6F]) +for ib, cc in enumerate(["lt", "le", "gt", "ge", + "eq", "neq", "false", "true"]): + add_insn("pcom"+cc+"b", "sse5comcc", modifiers=[0x4C, ib]) + add_insn("pcom"+cc+"w", "sse5comcc", modifiers=[0x4D, ib]) + add_insn("pcom"+cc+"d", "sse5comcc", modifiers=[0x4E, ib]) + add_insn("pcom"+cc+"q", "sse5comcc", modifiers=[0x4F, ib]) + + add_insn("pcomu"+cc+"b", "sse5comcc", modifiers=[0x6C, ib]) + add_insn("pcomu"+cc+"w", "sse5comcc", modifiers=[0x6D, ib]) + add_insn("pcomu"+cc+"d", "sse5comcc", modifiers=[0x6E, ib]) + add_insn("pcomu"+cc+"q", "sse5comcc", modifiers=[0x6F, ib]) + add_group("cvtph2ps", cpu=["SSE5"], opcode=[0x0F, 0x7A, 0x30], diff --git a/modules/arch/x86/tests/Makefile.inc b/modules/arch/x86/tests/Makefile.inc index b500f419..09256a7d 100644 --- a/modules/arch/x86/tests/Makefile.inc +++ b/modules/arch/x86/tests/Makefile.inc @@ -170,6 +170,8 @@ EXTRA_DIST += modules/arch/x86/tests/sse5-all.asm EXTRA_DIST += modules/arch/x86/tests/sse5-all.hex EXTRA_DIST += modules/arch/x86/tests/sse5-basic.asm EXTRA_DIST += modules/arch/x86/tests/sse5-basic.hex +EXTRA_DIST += modules/arch/x86/tests/sse5-cc.asm +EXTRA_DIST += modules/arch/x86/tests/sse5-cc.hex EXTRA_DIST += modules/arch/x86/tests/sse5-err.asm EXTRA_DIST += modules/arch/x86/tests/sse5-err.errwarn EXTRA_DIST += modules/arch/x86/tests/ssewidth.asm diff --git a/modules/arch/x86/tests/sse5-cc.asm b/modules/arch/x86/tests/sse5-cc.asm new file mode 100644 index 00000000..6d778a6b --- /dev/null +++ b/modules/arch/x86/tests/sse5-cc.asm @@ -0,0 +1,37 @@ +[bits 16] +comeqpd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 00 +comltpd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 01 +comlepd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 02 +comunordpd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 03 +comuneqpd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 04 +comunltpd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 05 +comunlepd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 06 +comordpd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 07 +comueqpd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 08 +comultpd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 09 +comulepd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 0A +comfalsepd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 0B +comneqpd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 0C +comnltpd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 0D +comnlepd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 0E +comtruepd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 0F + +pcomltb xmm1, xmm2, xmm3 ; 0F 25 4C 323 10 00 +pcomleb xmm1, xmm2, xmm3 ; 0F 25 4C 323 10 01 +pcomgtb xmm1, xmm2, xmm3 ; 0F 25 4C 323 10 02 +pcomgeb xmm1, xmm2, xmm3 ; 0F 25 4C 323 10 03 +pcomeqb xmm1, xmm2, xmm3 ; 0F 25 4C 323 10 04 +pcomneqb xmm1, xmm2, xmm3 ; 0F 25 4C 323 10 05 +pcomfalseb xmm1, xmm2, xmm3 ; 0F 25 4C 323 10 06 +pcomtrueb xmm1, xmm2, xmm3 ; 0F 25 4C 323 10 07 + +pcomultb xmm1, xmm2, xmm3 ; 0F 25 6C 323 10 00 +pcomuleb xmm1, xmm2, xmm3 ; 0F 25 6C 323 10 01 +pcomugtb xmm1, xmm2, xmm3 ; 0F 25 6C 323 10 02 +pcomugeb xmm1, xmm2, xmm3 ; 0F 25 6C 323 10 03 +pcomueqb xmm1, xmm2, xmm3 ; 0F 25 6C 323 10 04 +pcomuneqb xmm1, xmm2, xmm3 ; 0F 25 6C 323 10 05 +pcomufalseb xmm1, xmm2, xmm3 ; 0F 25 6C 323 10 06 +pcomutrueb xmm1, xmm2, xmm3 ; 0F 25 6C 323 10 07 + + diff --git a/modules/arch/x86/tests/sse5-cc.hex b/modules/arch/x86/tests/sse5-cc.hex new file mode 100644 index 00000000..f565535e --- /dev/null +++ b/modules/arch/x86/tests/sse5-cc.hex @@ -0,0 +1,192 @@ +0f +25 +2d +d3 +10 +00 +0f +25 +2d +d3 +10 +01 +0f +25 +2d +d3 +10 +02 +0f +25 +2d +d3 +10 +03 +0f +25 +2d +d3 +10 +04 +0f +25 +2d +d3 +10 +05 +0f +25 +2d +d3 +10 +06 +0f +25 +2d +d3 +10 +07 +0f +25 +2d +d3 +10 +08 +0f +25 +2d +d3 +10 +09 +0f +25 +2d +d3 +10 +0a +0f +25 +2d +d3 +10 +0b +0f +25 +2d +d3 +10 +0c +0f +25 +2d +d3 +10 +0d +0f +25 +2d +d3 +10 +0e +0f +25 +2d +d3 +10 +0f +0f +25 +4c +d3 +10 +00 +0f +25 +4c +d3 +10 +01 +0f +25 +4c +d3 +10 +02 +0f +25 +4c +d3 +10 +03 +0f +25 +4c +d3 +10 +04 +0f +25 +4c +d3 +10 +05 +0f +25 +4c +d3 +10 +06 +0f +25 +4c +d3 +10 +07 +0f +25 +6c +d3 +10 +00 +0f +25 +6c +d3 +10 +01 +0f +25 +6c +d3 +10 +02 +0f +25 +6c +d3 +10 +03 +0f +25 +6c +d3 +10 +04 +0f +25 +6c +d3 +10 +05 +0f +25 +6c +d3 +10 +06 +0f +25 +6c +d3 +10 +07 From 120c28e2d317ab874dedc5948e64a63b94f3166d Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 4 Apr 2008 02:10:24 +0000 Subject: [PATCH 156/585] PCOMUcc should have been PCOMccU. Fix up condition code naming and add aliases to match SSE5 added to GNU binutils as follows: COMcc: - swapped uneq, unlt, and unle with neq, nlt, and nle - added unge, ungt, ne, uge, ugt, nge, ngt, une, ge, and gt aliases PCOMcc: - added ne alias (for neq) svn path=/trunk/yasm/; revision=2049 --- modules/arch/x86/gen_x86_insn.py | 76 +++++++++++++++++------------- modules/arch/x86/tests/sse5-cc.asm | 40 ++++++++++------ modules/arch/x86/tests/sse5-cc.hex | 72 ++++++++++++++++++++++++++++ 3 files changed, 141 insertions(+), 47 deletions(-) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index da0f3012..815dfcab 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -5047,41 +5047,51 @@ for sz in [32, 64]: Operand(type="SIMDReg", size=128, dest="Spare"), Operand(type="Mem", size=sz, relaxed=True, dest="EA")]) -add_insn("comps", "sse5com", modifiers=[0x2C]) -add_insn("compd", "sse5com", modifiers=[0x2D]) -add_insn("comss", "sse5com32", modifiers=[0x2E]) -add_insn("comsd", "sse5com64", modifiers=[0x2F]) +sse5coms = [(0, ""), + (0x0, "eq"), + (0x1, "lt"), (0x1, "unge"), + (0x2, "le"), (0x2, "ungt"), + (0x3, "unord"), + (0x4, "ne"), (0x4, "neq"), + (0x5, "nlt"), (0x5, "uge"), + (0x6, "nle"), (0x6, "ugt"), + (0x7, "ord"), + (0x8, "ueq"), + (0x9, "ult"), (0x9, "nge"), + (0xa, "ule"), (0xa, "ngt"), + (0xb, "false"), + (0xc, "une"), (0xc, "uneq"), + (0xd, "unlt"), (0xd, "ge"), + (0xe, "unle"), (0xe, "gt"), + (0xf, "true")] +for ib, cc in sse5coms: + if cc: + iname = "sse5comcc" + else: + iname = "sse5com" + add_insn("com"+cc+"ps", iname, modifiers=[0x2C, ib]) + add_insn("com"+cc+"pd", iname, modifiers=[0x2D, ib]) + add_insn("com"+cc+"ss", iname+"32", modifiers=[0x2E, ib]) + add_insn("com"+cc+"sd", iname+"64", modifiers=[0x2F, ib]) -for ib, cc in enumerate([ "eq", "lt", "le", "unord", - "uneq", "unlt", "unle", "ord", - "ueq", "ult", "ule", "false", - "neq", "nlt", "nle", "true"]): - add_insn("com"+cc+"ps", "sse5comcc", modifiers=[0x2C, ib]) - add_insn("com"+cc+"pd", "sse5comcc", modifiers=[0x2D, ib]) - add_insn("com"+cc+"ss", "sse5comcc32", modifiers=[0x2E, ib]) - add_insn("com"+cc+"sd", "sse5comcc64", modifiers=[0x2F, ib]) +sse5coms = list(enumerate(["lt", "le", "gt", "ge", + "eq", "neq", "false", "true"])) +sse5coms.append((5, "ne")) +sse5coms.append((0, "")) +for ib, cc in sse5coms: + if cc: + iname = "sse5comcc" + else: + iname = "sse5com" + add_insn("pcom"+cc+"b", iname, modifiers=[0x4C, ib]) + add_insn("pcom"+cc+"w", iname, modifiers=[0x4D, ib]) + add_insn("pcom"+cc+"d", iname, modifiers=[0x4E, ib]) + add_insn("pcom"+cc+"q", iname, modifiers=[0x4F, ib]) -add_insn("pcomb", "sse5com", modifiers=[0x4C]) -add_insn("pcomw", "sse5com", modifiers=[0x4D]) -add_insn("pcomd", "sse5com", modifiers=[0x4E]) -add_insn("pcomq", "sse5com", modifiers=[0x4F]) - -add_insn("pcomub", "sse5com", modifiers=[0x6C]) -add_insn("pcomuw", "sse5com", modifiers=[0x6D]) -add_insn("pcomud", "sse5com", modifiers=[0x6E]) -add_insn("pcomuq", "sse5com", modifiers=[0x6F]) - -for ib, cc in enumerate(["lt", "le", "gt", "ge", - "eq", "neq", "false", "true"]): - add_insn("pcom"+cc+"b", "sse5comcc", modifiers=[0x4C, ib]) - add_insn("pcom"+cc+"w", "sse5comcc", modifiers=[0x4D, ib]) - add_insn("pcom"+cc+"d", "sse5comcc", modifiers=[0x4E, ib]) - add_insn("pcom"+cc+"q", "sse5comcc", modifiers=[0x4F, ib]) - - add_insn("pcomu"+cc+"b", "sse5comcc", modifiers=[0x6C, ib]) - add_insn("pcomu"+cc+"w", "sse5comcc", modifiers=[0x6D, ib]) - add_insn("pcomu"+cc+"d", "sse5comcc", modifiers=[0x6E, ib]) - add_insn("pcomu"+cc+"q", "sse5comcc", modifiers=[0x6F, ib]) + add_insn("pcom"+cc+"ub", iname, modifiers=[0x6C, ib]) + add_insn("pcom"+cc+"uw", iname, modifiers=[0x6D, ib]) + add_insn("pcom"+cc+"ud", iname, modifiers=[0x6E, ib]) + add_insn("pcom"+cc+"uq", iname, modifiers=[0x6F, ib]) add_group("cvtph2ps", cpu=["SSE5"], diff --git a/modules/arch/x86/tests/sse5-cc.asm b/modules/arch/x86/tests/sse5-cc.asm index 6d778a6b..309f5005 100644 --- a/modules/arch/x86/tests/sse5-cc.asm +++ b/modules/arch/x86/tests/sse5-cc.asm @@ -1,19 +1,29 @@ [bits 16] comeqpd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 00 comltpd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 01 +comungepd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 01 comlepd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 02 +comungtpd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 02 comunordpd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 03 -comuneqpd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 04 -comunltpd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 05 -comunlepd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 06 +comnepd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 04 +comneqpd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 04 +comnltpd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 05 +comugepd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 05 +comnlepd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 06 +comugtpd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 06 comordpd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 07 comueqpd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 08 comultpd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 09 +comngepd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 09 comulepd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 0A +comngtpd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 0A comfalsepd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 0B -comneqpd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 0C -comnltpd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 0D -comnlepd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 0E +comunepd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 0C +comuneqpd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 0C +comunltpd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 0D +comgepd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 0D +comunlepd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 0E +comgtpd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 0E comtruepd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 0F pcomltb xmm1, xmm2, xmm3 ; 0F 25 4C 323 10 00 @@ -22,16 +32,18 @@ pcomgtb xmm1, xmm2, xmm3 ; 0F 25 4C 323 10 02 pcomgeb xmm1, xmm2, xmm3 ; 0F 25 4C 323 10 03 pcomeqb xmm1, xmm2, xmm3 ; 0F 25 4C 323 10 04 pcomneqb xmm1, xmm2, xmm3 ; 0F 25 4C 323 10 05 +pcomneb xmm1, xmm2, xmm3 ; 0F 25 4C 323 10 05 pcomfalseb xmm1, xmm2, xmm3 ; 0F 25 4C 323 10 06 pcomtrueb xmm1, xmm2, xmm3 ; 0F 25 4C 323 10 07 -pcomultb xmm1, xmm2, xmm3 ; 0F 25 6C 323 10 00 -pcomuleb xmm1, xmm2, xmm3 ; 0F 25 6C 323 10 01 -pcomugtb xmm1, xmm2, xmm3 ; 0F 25 6C 323 10 02 -pcomugeb xmm1, xmm2, xmm3 ; 0F 25 6C 323 10 03 -pcomueqb xmm1, xmm2, xmm3 ; 0F 25 6C 323 10 04 -pcomuneqb xmm1, xmm2, xmm3 ; 0F 25 6C 323 10 05 -pcomufalseb xmm1, xmm2, xmm3 ; 0F 25 6C 323 10 06 -pcomutrueb xmm1, xmm2, xmm3 ; 0F 25 6C 323 10 07 +pcomltub xmm1, xmm2, xmm3 ; 0F 25 6C 323 10 00 +pcomleub xmm1, xmm2, xmm3 ; 0F 25 6C 323 10 01 +pcomgtub xmm1, xmm2, xmm3 ; 0F 25 6C 323 10 02 +pcomgeub xmm1, xmm2, xmm3 ; 0F 25 6C 323 10 03 +pcomequb xmm1, xmm2, xmm3 ; 0F 25 6C 323 10 04 +pcomnequb xmm1, xmm2, xmm3 ; 0F 25 6C 323 10 05 +pcomneub xmm1, xmm2, xmm3 ; 0F 25 6C 323 10 05 +pcomfalseub xmm1, xmm2, xmm3 ; 0F 25 6C 323 10 06 +pcomtrueub xmm1, xmm2, xmm3 ; 0F 25 6C 323 10 07 diff --git a/modules/arch/x86/tests/sse5-cc.hex b/modules/arch/x86/tests/sse5-cc.hex index f565535e..d41b9cf8 100644 --- a/modules/arch/x86/tests/sse5-cc.hex +++ b/modules/arch/x86/tests/sse5-cc.hex @@ -15,6 +15,18 @@ d3 2d d3 10 +01 +0f +25 +2d +d3 +10 +02 +0f +25 +2d +d3 +10 02 0f 25 @@ -33,12 +45,30 @@ d3 2d d3 10 +04 +0f +25 +2d +d3 +10 05 0f 25 2d d3 10 +05 +0f +25 +2d +d3 +10 +06 +0f +25 +2d +d3 +10 06 0f 25 @@ -63,6 +93,18 @@ d3 2d d3 10 +09 +0f +25 +2d +d3 +10 +0a +0f +25 +2d +d3 +10 0a 0f 25 @@ -81,12 +123,30 @@ d3 2d d3 10 +0c +0f +25 +2d +d3 +10 0d 0f 25 2d d3 10 +0d +0f +25 +2d +d3 +10 +0e +0f +25 +2d +d3 +10 0e 0f 25 @@ -135,6 +195,12 @@ d3 4c d3 10 +05 +0f +25 +4c +d3 +10 06 0f 25 @@ -183,6 +249,12 @@ d3 6c d3 10 +05 +0f +25 +6c +d3 +10 06 0f 25 From 9ade4d408d3a480afe70ed00ce07c0e321a8adaf Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 11 Apr 2008 01:37:46 +0000 Subject: [PATCH 157/585] Move BITS==64 condition out of the CPU field (where it really doesn't belong) and into a new misc_flags field. This doesn't take any more space, simplifies the code, and allows adding additional conditions like this in the future. Found and fixed a bug in CPU field generation (not copying a set variable in gen_x86_insn.py). svn path=/trunk/yasm/; revision=2050 --- modules/arch/x86/gen_x86_insn.py | 95 +++++++++++++++++----------- modules/arch/x86/x86arch.h | 6 -- modules/arch/x86/x86id.c | 103 ++++++++++++++----------------- 3 files changed, 105 insertions(+), 99 deletions(-) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index 815dfcab..a5764d79 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -78,12 +78,6 @@ def cpu_lcd(cpu1, cpu2): for feature in set(unordered_cpu_features) & set(cpu1) & set(cpu2): retval.add(feature) - # 64-bitness - if "64" in cpu1 and "64" in cpu2: - retval.add("64") - if "Not64" in cpu1 and "Not64" in cpu2: - retval.add("Not64") - return retval class Operand(object): @@ -132,10 +126,13 @@ class GroupForm(object): # CPU feature flags initialization self.cpu = set(kwargs.pop("cpu", [])) + + # Misc flags + self.misc_flags = set(kwargs.pop("misc_flags", [])) if kwargs.pop("only64", False): - self.cpu.add("64") + self.misc_flags.add("ONLY_64") if kwargs.pop("not64", False): - self.cpu.add("Not64") + self.misc_flags.add("NOT_64") # Operation size self.opersize = kwargs.pop("opersize", 0) @@ -143,8 +140,8 @@ class GroupForm(object): self.opersize = 0 if self.opersize == 64: - self.cpu.add("64") - elif self.opersize == 32 and "64" not in self.cpu: + self.misc_flags.add("ONLY_64") + elif self.opersize == 32 and "ONLY_64" not in self.misc_flags: self.cpu.add("386") # Default operation size in 64-bit mode @@ -190,20 +187,20 @@ class GroupForm(object): for op in self.operands: if op.type in ["Reg", "RM", "Areg", "Creg", "Dreg"]: if op.size == 64: - self.cpu.add("64") - elif op.size == 32 and "64" not in self.cpu: + self.misc_flags.add("ONLY_64") + elif op.size == 32 and "ONLY_64" not in self.misc_flags: self.cpu.add("386") if op.type in ["Imm", "ImmNotSegOff"]: if op.size == 64: - self.cpu.add("64") - elif op.size == 32 and "64" not in self.cpu: + self.misc_flags.add("ONLY_64") + elif op.size == 32 and "ONLY_64" not in self.misc_flags: self.cpu.add("386") - if op.type in ["FS", "GS"] and "64" not in self.cpu: + if op.type in ["FS", "GS"] and "ONLY_64" not in self.misc_flags: self.cpu.add("386") - if op.type in ["CR4"] and "64" not in self.cpu: + if op.type in ["CR4"] and "ONLY_64" not in self.misc_flags: self.cpu.add("586") if op.dest == "EA64": - self.cpu.add("64") + self.misc_flags.add("ONLY_64") if op.dest == "DREX": self.drex_oc0 |= 0x80 @@ -219,12 +216,9 @@ class GroupForm(object): # CPU feature flags finalization # Remove redundancies maxcpu = -1 - if "64" in self.cpu: - pass #maxcpu = ordered_cpus.index("Hammer") - else: - maxcpu_set = self.cpu & set(ordered_cpus) - if maxcpu_set: - maxcpu = max(ordered_cpus.index(x) for x in maxcpu_set) + maxcpu_set = self.cpu & set(ordered_cpus) + if maxcpu_set: + maxcpu = max(ordered_cpus.index(x) for x in maxcpu_set) if maxcpu != -1: for cpu in ordered_cpus[0:maxcpu]: self.cpu.discard(cpu) @@ -278,6 +272,7 @@ class GroupForm(object): # Build instruction info structure initializer return "{ "+ ", ".join([gas_flags or "0", + "|".join(self.misc_flags) or "0", cpus_str[0], cpus_str[1], cpus_str[2], @@ -302,7 +297,7 @@ def add_group(name, **kwargs): class Insn(object): def __init__(self, groupname, suffix=None, parser=None, modifiers=None, - cpu=None, only64=False, not64=False): + cpu=None, misc_flags=None, only64=False, not64=False): self.groupname = groupname if suffix is None: self.suffix = None @@ -324,20 +319,25 @@ class Insn(object): else: self.cpu = set(cpu) + if misc_flags is None: + self.misc_flags = None + else: + self.misc_flags = set([x for x in misc_flags]) + if only64: - if self.cpu is None: - self.cpu = set() - self.cpu.add("64") + if self.misc_flags is None: + self.misc_flags = set() + self.misc_flags.add("ONLY_64") if not64: - if self.cpu is None: - self.cpu = set() - self.cpu.add("Not64") + if self.misc_flags is None: + self.misc_flags = set() + self.misc_flags.add("NOT_64") def auto_cpu(self, parser): - if self.cpu is not None: - return """Determine lowest common denominator CPU from group and suffix. Does nothing if CPU is already set.""" + if self.cpu is not None: + return # Scan through group, matching parser and suffix for form in groups[self.groupname]: if parser not in form.parsers: @@ -346,16 +346,34 @@ class Insn(object): (form.suffixes is None or self.suffix not in form.suffixes)): continue if self.cpu is None: - self.cpu = form.cpu + self.cpu = set(form.cpu) else: self.cpu = cpu_lcd(self.cpu, form.cpu) + def auto_misc_flags(self, parser): + """Determine lowest common denominator flags from group and suffix. + Does nothing if flags is already set.""" + if self.misc_flags is not None: + return + # Scan through group, matching parser and suffix + for form in groups[self.groupname]: + if parser not in form.parsers: + continue + if (self.suffix is not None and len(self.suffix) == 1 and + (form.suffixes is None or self.suffix not in form.suffixes)): + continue + if self.misc_flags is None: + self.misc_flags = set(form.misc_flags) + else: + self.misc_flags &= form.misc_flags + def copy(self): """Return a shallow copy.""" return Insn(self.groupname, suffix=self.suffix, modifiers=self.modifiers, - cpu=self.cpu) + cpu=self.cpu, + misc_flags=self.misc_flags) def __str__(self): if self.suffix is None: @@ -387,6 +405,7 @@ class Insn(object): mods_str[0], mods_str[1], mods_str[2], + "|".join(self.misc_flags or []) or "0", cpus_str[0], cpus_str[1], cpus_str[2]]) @@ -409,7 +428,8 @@ class Prefix(object): "0", "0", "0", - self.only64 and "CPU_64" or "0", + self.only64 and "ONLY_64" or "0", + "0", "0", "0"]) @@ -440,6 +460,7 @@ def finalize_insns(): raise ValueError("duplicate gas instruction %s" % keyword) newinsn = insn.copy() newinsn.auto_cpu("gas") + newinsn.auto_misc_flags("gas") gas_insns[keyword] = newinsn if insn.suffix is None: @@ -456,6 +477,7 @@ def finalize_insns(): newinsn = insn.copy() newinsn.suffix = suffix newinsn.auto_cpu("gas") + newinsn.auto_misc_flags("gas") gas_insns[keyword] = newinsn if "nasm" in parsers: @@ -464,6 +486,7 @@ def finalize_insns(): raise ValueError("duplicate nasm instruction %s" % keyword) newinsn = insn.copy() newinsn.auto_cpu("nasm") + newinsn.auto_misc_flags("nasm") nasm_insns[keyword] = newinsn def output_insns(f, parser, insns): @@ -5610,7 +5633,7 @@ add_insn("svdc", "svdc") add_insn("fsetpm", "twobyte", modifiers=[0xDB, 0xE4], cpu=["286", "FPU", "Obs"]) add_insn("loadall", "twobyte", modifiers=[0x0F, 0x07], cpu=["386", "Undoc"]) add_insn("loadall286", "twobyte", modifiers=[0x0F, 0x05], cpu=["286", "Undoc"]) -add_insn("salc", "onebyte", modifiers=[0xD6], cpu=["Undoc", "Not64"]) +add_insn("salc", "onebyte", modifiers=[0xD6], cpu=["Undoc"], not64=True) add_insn("smi", "onebyte", modifiers=[0xF1], cpu=["386", "Undoc"]) add_group("ibts", diff --git a/modules/arch/x86/x86arch.h b/modules/arch/x86/x86arch.h index 466039d2..ec21a9c5 100644 --- a/modules/arch/x86/x86arch.h +++ b/modules/arch/x86/x86arch.h @@ -67,12 +67,6 @@ #define CPU_SSE5 33 /* AMD Streaming SIMD extensions 5 required */ #define CPU_XSAVE 34 /* Intel XSAVE instructions */ -/* Technically not CPU capabilities, they do affect what instructions are - * available. These are tested against BITS==64. - */ -#define CPU_64 120 /* Only available in 64-bit mode */ -#define CPU_Not64 121 /* Not available (invalid) in 64-bit mode */ - typedef struct yasm_arch_x86 { yasm_arch_base arch; /* base structure */ diff --git a/modules/arch/x86/x86id.c b/modules/arch/x86/x86id.c index f385eaf3..7adc12e3 100644 --- a/modules/arch/x86/x86id.c +++ b/modules/arch/x86/x86id.c @@ -69,6 +69,13 @@ enum x86_gas_suffix_flags { WEAK = 1<<5 /* Relaxed operand mode for GAS */ }; +/* Miscellaneous flag tests for instructions */ +enum x86_misc_flags { + /* These are tested against BITS==64. */ + ONLY_64 = 1<<0, /* Only available in 64-bit mode */ + NOT_64 = 1<<1 /* Not available (invalid) in 64-bit mode */ +}; + enum x86_operand_type { OPT_Imm = 0, /* immediate */ OPT_Reg = 1, /* any general purpose or FPU register */ @@ -216,14 +223,17 @@ typedef struct x86_insn_info { /* GAS suffix flags */ unsigned int gas_flags:8; /* Enabled for these GAS suffixes */ + /* Tests against BITS==64 and AVX */ + unsigned int misc_flags:6; + /* The CPU feature flags needed to execute this instruction. This is OR'ed * with arch-specific data[2]. This combined value is compared with * cpu_enabled to see if all bits set here are set in cpu_enabled--if so, * the instruction is available on this CPU. */ - unsigned int cpu0:8; - unsigned int cpu1:8; - unsigned int cpu2:8; + unsigned int cpu0:6; + unsigned int cpu1:6; + unsigned int cpu2:6; /* Opcode modifiers for variations of instruction. As each modifier reads * its parameter in LSB->MSB order from the arch-specific data[1] from the @@ -296,6 +306,9 @@ typedef struct x86_id_insn { /* Suffix flags */ unsigned int suffix:8; + /* Tests against BITS==64 and AVX */ + unsigned int misc_flags:6; + /* Parser enabled at the time of parsing the instruction */ unsigned int parser:2; @@ -460,27 +473,15 @@ x86_finalize_jmp(yasm_bytecode *bc, yasm_bytecode *prev_bc, jmp->nearop.len = 0; for (; num_info>0 && (jmp->shortop.len == 0 || jmp->nearop.len == 0); num_info--, info++) { - unsigned int cpu0 = info->cpu0; - unsigned int cpu1 = info->cpu1; - unsigned int cpu2 = info->cpu2; - /* Match CPU */ - if (mode_bits != 64 && - (cpu0 == CPU_64 || cpu1 == CPU_64 || cpu2 == CPU_64)) + if (mode_bits != 64 && (info->misc_flags & ONLY_64)) continue; - if (mode_bits == 64 && - (cpu0 == CPU_Not64 || cpu1 == CPU_Not64 || cpu2 == CPU_Not64)) + if (mode_bits == 64 && (info->misc_flags & NOT_64)) continue; - if (cpu0 == CPU_64 || cpu0 == CPU_Not64) - cpu0 = CPU_Any; - if (cpu1 == CPU_64 || cpu1 == CPU_Not64) - cpu1 = CPU_Any; - if (cpu2 == CPU_64 || cpu2 == CPU_Not64) - cpu2 = CPU_Any; - if (!BitVector_bit_test(id_insn->cpu_enabled, cpu0) || - !BitVector_bit_test(id_insn->cpu_enabled, cpu1) || - !BitVector_bit_test(id_insn->cpu_enabled, cpu2)) + if (!BitVector_bit_test(id_insn->cpu_enabled, info->cpu0) || + !BitVector_bit_test(id_insn->cpu_enabled, info->cpu1) || + !BitVector_bit_test(id_insn->cpu_enabled, info->cpu2)) continue; if (info->num_operands == 0) @@ -553,31 +554,22 @@ x86_find_match(x86_id_insn *id_insn, yasm_insn_operand **ops, yasm_insn_operand *op, **use_ops; const x86_info_operand *info_ops = &insn_operands[info->operands_index]; - unsigned int cpu0 = info->cpu0; - unsigned int cpu1 = info->cpu1; - unsigned int cpu2 = info->cpu2; unsigned int gas_flags = info->gas_flags; + unsigned int misc_flags = info->misc_flags; unsigned int size; int mismatch = 0; int i; /* Match CPU */ - if (mode_bits != 64 && - (cpu0 == CPU_64 || cpu1 == CPU_64 || cpu2 == CPU_64)) + if (mode_bits != 64 && (misc_flags & ONLY_64)) continue; - if (mode_bits == 64 && - (cpu0 == CPU_Not64 || cpu1 == CPU_Not64 || cpu2 == CPU_Not64)) + if (mode_bits == 64 && (misc_flags & NOT_64)) continue; - if (cpu0 == CPU_64 || cpu0 == CPU_Not64) - cpu0 = CPU_Any; - if (cpu1 == CPU_64 || cpu1 == CPU_Not64) - cpu1 = CPU_Any; - if (cpu2 == CPU_64 || cpu2 == CPU_Not64) - cpu2 = CPU_Any; - if (bypass != 8 && (!BitVector_bit_test(id_insn->cpu_enabled, cpu0) || - !BitVector_bit_test(id_insn->cpu_enabled, cpu1) || - !BitVector_bit_test(id_insn->cpu_enabled, cpu2))) + if (bypass != 8 && + (!BitVector_bit_test(id_insn->cpu_enabled, info->cpu0) || + !BitVector_bit_test(id_insn->cpu_enabled, info->cpu1) || + !BitVector_bit_test(id_insn->cpu_enabled, info->cpu2))) continue; /* Match # of operands */ @@ -1428,7 +1420,7 @@ typedef struct insnprefix_parse_data { /* instruction parse group - NULL if prefix */ /*@null@*/ const x86_insn_info *group; - /* For instruction, number of elements in group in lower 8 bits. + /* For instruction, number of elements in group. * For prefix, prefix type shifted right by 8. */ unsigned int num_info:8; @@ -1443,10 +1435,13 @@ typedef struct insnprefix_parse_data { unsigned int mod_data1:8; unsigned int mod_data2:8; + /* Tests against BITS==64 and AVX */ + unsigned int misc_flags:6; + /* CPU flags */ - unsigned int cpu0:8; - unsigned int cpu1:8; - unsigned int cpu2:8; + unsigned int cpu0:6; + unsigned int cpu1:6; + unsigned int cpu2:6; } insnprefix_parse_data; /* Pull in all parse data */ @@ -1544,7 +1539,6 @@ yasm_x86__parse_check_insnprefix(yasm_arch *arch, const char *id, { yasm_arch_x86 *arch_x86 = (yasm_arch_x86 *)arch; /*@null@*/ const insnprefix_parse_data *pdata; - unsigned int cpu0, cpu1, cpu2; size_t i; static char lcaseid[16]; @@ -1570,22 +1564,17 @@ yasm_x86__parse_check_insnprefix(yasm_arch *arch, const char *id, if (!pdata) return YASM_ARCH_NOTINSNPREFIX; - cpu0 = pdata->cpu0; - cpu1 = pdata->cpu1; - cpu2 = pdata->cpu2; - if (pdata->group) { x86_id_insn *id_insn; wordptr cpu_enabled = arch_x86->cpu_enables[arch_x86->active_cpu]; + unsigned int cpu0, cpu1, cpu2; - if (arch_x86->mode_bits != 64 && - (cpu0 == CPU_64 || cpu1 == CPU_64 || cpu2 == CPU_64)) { + if (arch_x86->mode_bits != 64 && (pdata->misc_flags & ONLY_64)) { yasm_warn_set(YASM_WARN_GENERAL, N_("`%s' is an instruction in 64-bit mode"), id); return YASM_ARCH_NOTINSNPREFIX; } - if (arch_x86->mode_bits == 64 && - (cpu0 == CPU_Not64 || cpu1 == CPU_Not64 || cpu2 == CPU_Not64)) { + if (arch_x86->mode_bits == 64 && (pdata->misc_flags & NOT_64)) { yasm_error_set(YASM_ERROR_GENERAL, N_("`%s' invalid in 64-bit mode"), id); id_insn = yasm_xmalloc(sizeof(x86_id_insn)); @@ -1598,6 +1587,7 @@ yasm_x86__parse_check_insnprefix(yasm_arch *arch, const char *id, id_insn->num_info = NELEMS(not64_insn); id_insn->mode_bits = arch_x86->mode_bits; id_insn->suffix = 0; + id_insn->misc_flags = 0; id_insn->parser = arch_x86->parser; id_insn->force_strict = arch_x86->force_strict != 0; id_insn->default_rel = arch_x86->default_rel != 0; @@ -1605,12 +1595,10 @@ yasm_x86__parse_check_insnprefix(yasm_arch *arch, const char *id, return YASM_ARCH_INSN; } - if (cpu0 == CPU_64 || cpu0 == CPU_Not64) - cpu0 = CPU_Any; - if (cpu1 == CPU_64 || cpu1 == CPU_Not64) - cpu1 = CPU_Any; - if (cpu2 == CPU_64 || cpu2 == CPU_Not64) - cpu2 = CPU_Any; + cpu0 = pdata->cpu0; + cpu1 = pdata->cpu1; + cpu2 = pdata->cpu2; + if (!BitVector_bit_test(cpu_enabled, cpu0) || !BitVector_bit_test(cpu_enabled, cpu1) || !BitVector_bit_test(cpu_enabled, cpu2)) { @@ -1630,6 +1618,7 @@ yasm_x86__parse_check_insnprefix(yasm_arch *arch, const char *id, id_insn->num_info = pdata->num_info; id_insn->mode_bits = arch_x86->mode_bits; id_insn->suffix = pdata->flags; + id_insn->misc_flags = pdata->misc_flags; id_insn->parser = arch_x86->parser; id_insn->force_strict = arch_x86->force_strict != 0; id_insn->default_rel = arch_x86->default_rel != 0; @@ -1651,8 +1640,7 @@ yasm_x86__parse_check_insnprefix(yasm_arch *arch, const char *id, return YASM_ARCH_NOTINSNPREFIX; } - if (arch_x86->mode_bits != 64 && - (cpu0 == CPU_64 || cpu1 == CPU_64 || cpu2 == CPU_64)) { + if (arch_x86->mode_bits != 64 && (pdata->misc_flags & ONLY_64)) { yasm_warn_set(YASM_WARN_GENERAL, N_("`%s' is a prefix in 64-bit mode"), id); return YASM_ARCH_NOTINSNPREFIX; @@ -1693,6 +1681,7 @@ yasm_x86__create_empty_insn(yasm_arch *arch, unsigned long line) id_insn->num_info = NELEMS(empty_insn); id_insn->mode_bits = arch_x86->mode_bits; id_insn->suffix = 0; + id_insn->misc_flags = 0; id_insn->parser = arch_x86->parser; id_insn->force_strict = arch_x86->force_strict != 0; id_insn->default_rel = arch_x86->default_rel != 0; From a38f103515f5f2e0600cbf4e6ba8fbd2ac927a74 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 11 Apr 2008 09:29:58 +0000 Subject: [PATCH 158/585] Add complete Intel Advanced Vector Extensions (AVX) support. A full testcase for NASM mode based on the AVX programming reference is included. GAS mode should work, but is untested at present. V-prefix aliases are present for all supported instructions to allow easy use of the VEX prefix version without significant code modifications. All comparison and other pseudo-ops are included. svn path=/trunk/yasm/; revision=2051 --- libyasm/intnum.c | 2 +- modules/arch/x86/gen_x86_insn.py | 1879 +++- modules/arch/x86/tests/Makefile.inc | 12 + modules/arch/x86/tests/aes.asm | 49 + modules/arch/x86/tests/aes.hex | 203 + modules/arch/x86/tests/avx.asm | 2633 ++++++ modules/arch/x86/tests/avx.hex | 10430 ++++++++++++++++++++++ modules/arch/x86/tests/avxcc.asm | 899 ++ modules/arch/x86/tests/avxcc.hex | 3816 ++++++++ modules/arch/x86/tests/clmul.asm | 22 + modules/arch/x86/tests/clmul.hex | 90 + modules/arch/x86/tests/fma.asm | 109 + modules/arch/x86/tests/fma.hex | 540 ++ modules/arch/x86/tests/vpermil2.asm | 10 + modules/arch/x86/tests/vpermil2.hex | 36 + modules/arch/x86/x86arch.c | 6 + modules/arch/x86/x86arch.h | 13 +- modules/arch/x86/x86bc.c | 45 +- modules/arch/x86/x86cpu.gperf | 18 + modules/arch/x86/x86id.c | 212 +- modules/arch/x86/x86regtmod.gperf | 17 + modules/parsers/nasm/nasm-token.re | 12 + modules/parsers/nasm/tests/Makefile.inc | 2 + modules/parsers/nasm/tests/dy.asm | 5 + modules/parsers/nasm/tests/dy.hex | 34 + 25 files changed, 20883 insertions(+), 211 deletions(-) create mode 100644 modules/arch/x86/tests/aes.asm create mode 100644 modules/arch/x86/tests/aes.hex create mode 100644 modules/arch/x86/tests/avx.asm create mode 100644 modules/arch/x86/tests/avx.hex create mode 100644 modules/arch/x86/tests/avxcc.asm create mode 100644 modules/arch/x86/tests/avxcc.hex create mode 100644 modules/arch/x86/tests/clmul.asm create mode 100644 modules/arch/x86/tests/clmul.hex create mode 100644 modules/arch/x86/tests/fma.asm create mode 100644 modules/arch/x86/tests/fma.hex create mode 100644 modules/arch/x86/tests/vpermil2.asm create mode 100644 modules/arch/x86/tests/vpermil2.hex create mode 100644 modules/parsers/nasm/tests/dy.asm create mode 100644 modules/parsers/nasm/tests/dy.hex diff --git a/libyasm/intnum.c b/libyasm/intnum.c index df32b8cb..47173c7e 100644 --- a/libyasm/intnum.c +++ b/libyasm/intnum.c @@ -39,7 +39,7 @@ /* "Native" "word" size for intnum calculations. */ -#define BITVECT_NATIVE_SIZE 128 +#define BITVECT_NATIVE_SIZE 256 struct yasm_intnum { union val { diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index a5764d79..113d64a2 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -32,9 +32,17 @@ ordered_cpus = [ "P4", "IA64", "Hammer"] ordered_cpu_features = [ "FPU", "Cyrix", "AMD", "MMX", "3DNow", "SMM", "SSE", "SSE2", - "SSE3", "SVM", "PadLock", "SSSE3", "SSE41", "SSE42", "SSE4a", "SSE5"] + "SSE3", "SVM", "PadLock", "SSSE3", "SSE41", "SSE42", "SSE4a", "SSE5", + "AVX", "FMA", "AES", "CLMUL"] unordered_cpu_features = ["Priv", "Prot", "Undoc", "Obs"] +# Predefined VEX prefix field values +VEXW0 = 0xC0 +VEXW1 = 0xC8 +VEXL0 = 0xC0 +VEXL1 = 0xC4 +VEXpp = 0xC0 # OR with value + def cpu_lcd(cpu1, cpu2): """Find the lowest common denominator of two CPU sets.""" retval = set() @@ -133,6 +141,10 @@ class GroupForm(object): self.misc_flags.add("ONLY_64") if kwargs.pop("not64", False): self.misc_flags.add("NOT_64") + if kwargs.pop("onlyavx", False): + self.misc_flags.add("ONLY_AVX") + if kwargs.pop("notavx", False): + self.misc_flags.add("NOT_AVX") # Operation size self.opersize = kwargs.pop("opersize", 0) @@ -161,6 +173,35 @@ class GroupForm(object): if "prefix" in kwargs: self.special_prefix = "0x%02X" % kwargs.pop("prefix") + # VEX prefix + if "vex" in kwargs: + self.misc_flags.add("ONLY_AVX") + vexW = kwargs.pop("vexw", 0) + if vexW not in [0, 1]: + raise ValueError("VEX.W must be 0 or 1") + + vexL = kwargs.pop("vex") + if vexL == 128 or vexL == 0: + vexL = 0 + elif vexL == 256: + vexL = 1 + else: + raise ValueError("VEX.L must be 128 or 256") + + if self.special_prefix in ["0", "0x00"]: + vexpp = 0 + elif self.special_prefix == "0x66": + vexpp = 1 + elif self.special_prefix == "0xF3": + vexpp = 2 + elif self.special_prefix == "0xF2": + vexpp = 3 + else: + raise ValueError("Cannot combine VEX and special prefix %s" + % self.special_prefix) + + self.special_prefix = "0x%02X" % (0xC0 + vexW*8 + vexL*4 + vexpp) + # Spare value self.spare = kwargs.pop("spare", 0) @@ -297,7 +338,8 @@ def add_group(name, **kwargs): class Insn(object): def __init__(self, groupname, suffix=None, parser=None, modifiers=None, - cpu=None, misc_flags=None, only64=False, not64=False): + cpu=None, misc_flags=None, only64=False, not64=False, + avx=False): self.groupname = groupname if suffix is None: self.suffix = None @@ -332,6 +374,12 @@ class Insn(object): if self.misc_flags is None: self.misc_flags = set() self.misc_flags.add("NOT_64") + if avx: + if self.misc_flags is None: + self.misc_flags = set() + self.misc_flags.add("ONLY_AVX") + if self.cpu is None: + self.cpu = set(["AVX"]) def auto_cpu(self, parser): """Determine lowest common denominator CPU from group and suffix. @@ -2674,6 +2722,7 @@ add_insn("cmpsw", "onebyte", modifiers=[0xA7, 16]) # cmpsd has to be non-onebyte for SSE2 forms below add_group("cmpsd", parsers=["nasm"], + notavx=True, opersize=32, opcode=[0xA7], operands=[]) @@ -2703,6 +2752,7 @@ add_insn("movsw", "onebyte", modifiers=[0xA5, 16]) # movsd has to be non-onebyte for SSE2 forms below add_group("movsd", parsers=["nasm", "gas"], + notavx=True, opersize=32, opcode=[0xA5], operands=[]) @@ -3676,6 +3726,46 @@ add_insn("punpcklwd", "mmxsse2", modifiers=[0x61]) add_insn("punpckldq", "mmxsse2", modifiers=[0x62]) add_insn("pxor", "mmxsse2", modifiers=[0xEF]) +# AVX versions don't support the MMX registers +add_insn("vpackssdw", "xmm_xmm128", modifiers=[0x66, 0x6B, VEXL0], avx=True) +add_insn("vpacksswb", "xmm_xmm128", modifiers=[0x66, 0x63, VEXL0], avx=True) +add_insn("vpackuswb", "xmm_xmm128", modifiers=[0x66, 0x67, VEXL0], avx=True) +add_insn("vpaddb", "xmm_xmm128", modifiers=[0x66, 0xFC, VEXL0], avx=True) +add_insn("vpaddw", "xmm_xmm128", modifiers=[0x66, 0xFD, VEXL0], avx=True) +add_insn("vpaddd", "xmm_xmm128", modifiers=[0x66, 0xFE, VEXL0], avx=True) +add_insn("vpaddq", "xmm_xmm128", modifiers=[0x66, 0xD4, VEXL0], avx=True) +add_insn("vpaddsb", "xmm_xmm128", modifiers=[0x66, 0xEC, VEXL0], avx=True) +add_insn("vpaddsw", "xmm_xmm128", modifiers=[0x66, 0xED, VEXL0], avx=True) +add_insn("vpaddusb", "xmm_xmm128", modifiers=[0x66, 0xDC, VEXL0], avx=True) +add_insn("vpaddusw", "xmm_xmm128", modifiers=[0x66, 0xDD, VEXL0], avx=True) +add_insn("vpand", "xmm_xmm128", modifiers=[0x66, 0xDB, VEXL0], avx=True) +add_insn("vpandn", "xmm_xmm128", modifiers=[0x66, 0xDF, VEXL0], avx=True) +add_insn("vpcmpeqb", "xmm_xmm128", modifiers=[0x66, 0x74, VEXL0], avx=True) +add_insn("vpcmpeqw", "xmm_xmm128", modifiers=[0x66, 0x75, VEXL0], avx=True) +add_insn("vpcmpeqd", "xmm_xmm128", modifiers=[0x66, 0x76, VEXL0], avx=True) +add_insn("vpcmpgtb", "xmm_xmm128", modifiers=[0x66, 0x64, VEXL0], avx=True) +add_insn("vpcmpgtw", "xmm_xmm128", modifiers=[0x66, 0x65, VEXL0], avx=True) +add_insn("vpcmpgtd", "xmm_xmm128", modifiers=[0x66, 0x66, VEXL0], avx=True) +add_insn("vpmaddwd", "xmm_xmm128", modifiers=[0x66, 0xF5, VEXL0], avx=True) +add_insn("vpmulhw", "xmm_xmm128", modifiers=[0x66, 0xE5, VEXL0], avx=True) +add_insn("vpmullw", "xmm_xmm128", modifiers=[0x66, 0xD5, VEXL0], avx=True) +add_insn("vpor", "xmm_xmm128", modifiers=[0x66, 0xEB, VEXL0], avx=True) +add_insn("vpsubb", "xmm_xmm128", modifiers=[0x66, 0xF8, VEXL0], avx=True) +add_insn("vpsubw", "xmm_xmm128", modifiers=[0x66, 0xF9, VEXL0], avx=True) +add_insn("vpsubd", "xmm_xmm128", modifiers=[0x66, 0xFA, VEXL0], avx=True) +add_insn("vpsubq", "xmm_xmm128", modifiers=[0x66, 0xFB, VEXL0], avx=True) +add_insn("vpsubsb", "xmm_xmm128", modifiers=[0x66, 0xE8, VEXL0], avx=True) +add_insn("vpsubsw", "xmm_xmm128", modifiers=[0x66, 0xE9, VEXL0], avx=True) +add_insn("vpsubusb", "xmm_xmm128", modifiers=[0x66, 0xD8, VEXL0], avx=True) +add_insn("vpsubusw", "xmm_xmm128", modifiers=[0x66, 0xD9, VEXL0], avx=True) +add_insn("vpunpckhbw", "xmm_xmm128", modifiers=[0x66, 0x68, VEXL0], avx=True) +add_insn("vpunpckhwd", "xmm_xmm128", modifiers=[0x66, 0x69, VEXL0], avx=True) +add_insn("vpunpckhdq", "xmm_xmm128", modifiers=[0x66, 0x6A, VEXL0], avx=True) +add_insn("vpunpcklbw", "xmm_xmm128", modifiers=[0x66, 0x60, VEXL0], avx=True) +add_insn("vpunpcklwd", "xmm_xmm128", modifiers=[0x66, 0x61, VEXL0], avx=True) +add_insn("vpunpckldq", "xmm_xmm128", modifiers=[0x66, 0x62, VEXL0], avx=True) +add_insn("vpxor", "xmm_xmm128", modifiers=[0x66, 0xEF, VEXL0], avx=True) + add_group("pshift", cpu=["MMX"], modifiers=["Op1Add"], @@ -3714,6 +3804,53 @@ add_insn("psrlw", "pshift", modifiers=[0xD1, 0x71, 2]) add_insn("psrld", "pshift", modifiers=[0xD2, 0x72, 2]) add_insn("psrlq", "pshift", modifiers=[0xD3, 0x73, 2]) +# Ran out of modifiers, so AVX has to be separate +add_group("vpshift", + cpu=["AVX"], + modifiers=["Op1Add"], + vex=128, + prefix=0x66, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) +add_group("vpshift", + cpu=["AVX"], + modifiers=["Gap", "Op1Add", "SpAdd"], + vex=128, + prefix=0x66, + opcode=[0x0F, 0x00], + spare=0, + operands=[Operand(type="SIMDReg", size=128, dest="EAVEX"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("vpshift", + cpu=["AVX"], + modifiers=["Op1Add"], + vex=128, + prefix=0x66, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) +add_group("vpshift", + cpu=["AVX"], + modifiers=["Gap", "Op1Add", "SpAdd"], + vex=128, + prefix=0x66, + opcode=[0x0F, 0x00], + spare=0, + operands=[Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDReg", size=128, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + +add_insn("vpsllw", "vpshift", modifiers=[0xF1, 0x71, 6]) +add_insn("vpslld", "vpshift", modifiers=[0xF2, 0x72, 6]) +add_insn("vpsllq", "vpshift", modifiers=[0xF3, 0x73, 6]) +add_insn("vpsraw", "vpshift", modifiers=[0xE1, 0x71, 4]) +add_insn("vpsrad", "vpshift", modifiers=[0xE2, 0x72, 4]) +add_insn("vpsrlw", "vpshift", modifiers=[0xD1, 0x71, 2]) +add_insn("vpsrld", "vpshift", modifiers=[0xD2, 0x72, 2]) +add_insn("vpsrlq", "vpshift", modifiers=[0xD3, 0x73, 2]) + # # PIII (Katmai) new instructions / SIMD instructions # @@ -3726,6 +3863,16 @@ add_insn("pminub", "mmxsse2", modifiers=[0xDA], cpu=["P3", "MMX"]) add_insn("pmulhuw", "mmxsse2", modifiers=[0xE4], cpu=["P3", "MMX"]) add_insn("psadbw", "mmxsse2", modifiers=[0xF6], cpu=["P3", "MMX"]) +# AVX versions don't support MMX register +add_insn("vpavgb", "xmm_xmm128", modifiers=[0x66, 0xE0, VEXL0], avx=True) +add_insn("vpavgw", "xmm_xmm128", modifiers=[0x66, 0xE3, VEXL0], avx=True) +add_insn("vpmaxsw", "xmm_xmm128", modifiers=[0x66, 0xEE, VEXL0], avx=True) +add_insn("vpmaxub", "xmm_xmm128", modifiers=[0x66, 0xDE, VEXL0], avx=True) +add_insn("vpminsw", "xmm_xmm128", modifiers=[0x66, 0xEA, VEXL0], avx=True) +add_insn("vpminub", "xmm_xmm128", modifiers=[0x66, 0xDA, VEXL0], avx=True) +add_insn("vpmulhuw", "xmm_xmm128", modifiers=[0x66, 0xE4, VEXL0], avx=True) +add_insn("vpsadbw", "xmm_xmm128", modifiers=[0x66, 0xF6, VEXL0], avx=True) + add_insn("prefetchnta", "twobytemem", modifiers=[0, 0x0F, 0x18], cpu=["P3"]) add_insn("prefetcht0", "twobytemem", modifiers=[1, 0x0F, 0x18], cpu=["P3"]) add_insn("prefetcht1", "twobytemem", modifiers=[2, 0x0F, 0x18], cpu=["P3"]) @@ -3733,12 +3880,48 @@ add_insn("prefetcht2", "twobytemem", modifiers=[3, 0x0F, 0x18], cpu=["P3"]) add_insn("sfence", "threebyte", modifiers=[0x0F, 0xAE, 0xF8], cpu=["P3"]) -add_group("xmm_xmm128", +add_group("xmm_xmm128_256", cpu=["SSE"], + modifiers=["PreAdd", "Op1Add", "SetVEX"], + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) +add_group("xmm_xmm128_256", + cpu=["AVX"], modifiers=["PreAdd", "Op1Add"], + vex=128, prefix=0x00, opcode=[0x0F, 0x00], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) +add_group("xmm_xmm128_256", + cpu=["AVX"], + modifiers=["PreAdd", "Op1Add"], + vex=256, + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="SIMDReg", size=256, dest="VEX"), + Operand(type="SIMDRM", size=256, relaxed=True, dest="EA")]) + +# Version that does not allow YMM registers +add_group("xmm_xmm128", + cpu=["SSE"], + modifiers=["PreAdd", "Op1Add", "SetVEX"], + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) +add_group("xmm_xmm128", + cpu=["AVX"], + modifiers=["PreAdd", "Op1Add"], + vex=128, + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) add_insn("addps", "xmm_xmm128", modifiers=[0, 0x58]) @@ -3757,10 +3940,24 @@ add_insn("unpckhps", "xmm_xmm128", modifiers=[0, 0x15]) add_insn("unpcklps", "xmm_xmm128", modifiers=[0, 0x14]) add_insn("xorps", "xmm_xmm128", modifiers=[0, 0x57]) +add_insn("vaddps", "xmm_xmm128_256", modifiers=[0, 0x58, VEXL0], avx=True) +add_insn("vandnps", "xmm_xmm128_256", modifiers=[0, 0x55, VEXL0], avx=True) +add_insn("vandps", "xmm_xmm128_256", modifiers=[0, 0x54, VEXL0], avx=True) +add_insn("vdivps", "xmm_xmm128_256", modifiers=[0, 0x5E, VEXL0], avx=True) +add_insn("vmaxps", "xmm_xmm128_256", modifiers=[0, 0x5F, VEXL0], avx=True) +add_insn("vminps", "xmm_xmm128_256", modifiers=[0, 0x5D, VEXL0], avx=True) +add_insn("vmulps", "xmm_xmm128_256", modifiers=[0, 0x59, VEXL0], avx=True) +add_insn("vorps", "xmm_xmm128_256", modifiers=[0, 0x56, VEXL0], avx=True) +# vrcpps, vrsqrtps, and vsqrtps don't add third operand +add_insn("vsubps", "xmm_xmm128_256", modifiers=[0, 0x5C, VEXL0], avx=True) +add_insn("vunpckhps", "xmm_xmm128_256", modifiers=[0, 0x15, VEXL0], avx=True) +add_insn("vunpcklps", "xmm_xmm128_256", modifiers=[0, 0x14, VEXL0], avx=True) +add_insn("vxorps", "xmm_xmm128_256", modifiers=[0, 0x57, VEXL0], avx=True) + add_group("cvt_rx_xmm32", suffix="l", cpu=["SSE"], - modifiers=["PreAdd", "Op1Add"], + modifiers=["PreAdd", "Op1Add", "SetVEX"], prefix=0x00, opcode=[0x0F, 0x00], operands=[Operand(type="Reg", size=32, dest="Spare"), @@ -3768,7 +3965,7 @@ add_group("cvt_rx_xmm32", add_group("cvt_rx_xmm32", suffix="l", cpu=["SSE"], - modifiers=["PreAdd", "Op1Add"], + modifiers=["PreAdd", "Op1Add", "SetVEX"], prefix=0x00, opcode=[0x0F, 0x00], operands=[Operand(type="Reg", size=32, dest="Spare"), @@ -3777,7 +3974,7 @@ add_group("cvt_rx_xmm32", add_group("cvt_rx_xmm32", suffix="q", cpu=["SSE"], - modifiers=["PreAdd", "Op1Add"], + modifiers=["PreAdd", "Op1Add", "SetVEX"], opersize=64, prefix=0x00, opcode=[0x0F, 0x00], @@ -3786,7 +3983,7 @@ add_group("cvt_rx_xmm32", add_group("cvt_rx_xmm32", suffix="q", cpu=["SSE"], - modifiers=["PreAdd", "Op1Add"], + modifiers=["PreAdd", "Op1Add", "SetVEX"], opersize=64, prefix=0x00, opcode=[0x0F, 0x00], @@ -3795,6 +3992,8 @@ add_group("cvt_rx_xmm32", add_insn("cvtss2si", "cvt_rx_xmm32", modifiers=[0xF3, 0x2D]) add_insn("cvttss2si", "cvt_rx_xmm32", modifiers=[0xF3, 0x2C]) +add_insn("vcvtss2si", "cvt_rx_xmm32", modifiers=[0xF3, 0x2D, VEXL0], avx=True) +add_insn("vcvttss2si", "cvt_rx_xmm32", modifiers=[0xF3, 0x2C, VEXL0], avx=True) add_group("cvt_mm_xmm64", cpu=["SSE"], @@ -3821,40 +4020,102 @@ add_group("cvt_xmm_mm_ps", add_insn("cvtpi2ps", "cvt_xmm_mm_ps", modifiers=[0x2A]) +# Memory size can be relaxed only in BITS=32 case, where there's no +# ambiguity. add_group("cvt_xmm_rmx", suffix="l", cpu=["SSE"], - modifiers=["PreAdd", "Op1Add"], + modifiers=["PreAdd", "Op1Add", "SetVEX"], prefix=0x00, opcode=[0x0F, 0x00], - operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), + Operand(type="RM", size=32, dest="EA")]) +add_group("cvt_xmm_rmx", + suffix="l", + cpu=["SSE"], + not64=True, + modifiers=["PreAdd", "Op1Add", "SetVEX"], + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), Operand(type="RM", size=32, relaxed=True, dest="EA")]) # REX add_group("cvt_xmm_rmx", suffix="q", cpu=["SSE"], + modifiers=["PreAdd", "Op1Add", "SetVEX"], + opersize=64, + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), + Operand(type="RM", size=64, dest="EA")]) +add_group("cvt_xmm_rmx", + suffix="l", + cpu=["AVX"], + not64=True, modifiers=["PreAdd", "Op1Add"], + vex=128, + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="RM", size=32, relaxed=True, dest="EA")]) +add_group("cvt_xmm_rmx", + suffix="l", + cpu=["AVX"], + modifiers=["PreAdd", "Op1Add"], + vex=128, + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="RM", size=32, dest="EA")]) +add_group("cvt_xmm_rmx", + suffix="q", + cpu=["AVX"], + modifiers=["PreAdd", "Op1Add"], + vex=128, opersize=64, prefix=0x00, opcode=[0x0F, 0x00], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="RM", size=64, relaxed=True, dest="EA")]) + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="RM", size=64, dest="EA")]) add_insn("cvtsi2ss", "cvt_xmm_rmx", modifiers=[0xF3, 0x2A]) +add_insn("vcvtsi2ss", "cvt_xmm_rmx", modifiers=[0xF3, 0x2A, VEXL0], avx=True) add_group("xmm_xmm32", cpu=["SSE"], - modifiers=["PreAdd", "Op1Add"], + modifiers=["PreAdd", "Op1Add", "SetVEX"], prefix=0x00, opcode=[0x0F, 0x00], - operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), Operand(type="SIMDReg", size=128, dest="EA")]) add_group("xmm_xmm32", cpu=["SSE"], + modifiers=["PreAdd", "Op1Add", "SetVEX"], + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), + Operand(type="Mem", size=32, relaxed=True, dest="EA")]) +add_group("xmm_xmm32", + cpu=["AVX"], modifiers=["PreAdd", "Op1Add"], + vex=128, prefix=0x00, opcode=[0x0F, 0x00], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDReg", size=128, dest="EA")]) +add_group("xmm_xmm32", + cpu=["AVX"], + modifiers=["PreAdd", "Op1Add"], + vex=128, + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), Operand(type="Mem", size=32, relaxed=True, dest="EA")]) add_insn("addss", "xmm_xmm32", modifiers=[0xF3, 0x58]) @@ -3869,50 +4130,125 @@ add_insn("sqrtss", "xmm_xmm32", modifiers=[0xF3, 0x51]) add_insn("subss", "xmm_xmm32", modifiers=[0xF3, 0x5C]) add_insn("ucomiss", "xmm_xmm32", modifiers=[0, 0x2E]) +add_insn("vaddss", "xmm_xmm32", modifiers=[0xF3, 0x58, VEXL0], avx=True) +add_insn("vcomiss", "xmm_xmm32", modifiers=[0, 0x2F, VEXL0], avx=True) +add_insn("vdivss", "xmm_xmm32", modifiers=[0xF3, 0x5E, VEXL0], avx=True) +add_insn("vmaxss", "xmm_xmm32", modifiers=[0xF3, 0x5F, VEXL0], avx=True) +add_insn("vminss", "xmm_xmm32", modifiers=[0xF3, 0x5D, VEXL0], avx=True) +add_insn("vmulss", "xmm_xmm32", modifiers=[0xF3, 0x59, VEXL0], avx=True) +add_insn("vrcpss", "xmm_xmm32", modifiers=[0xF3, 0x53, VEXL0], avx=True) +add_insn("vrsqrtss", "xmm_xmm32", modifiers=[0xF3, 0x52, VEXL0], avx=True) +add_insn("vsqrtss", "xmm_xmm32", modifiers=[0xF3, 0x51, VEXL0], avx=True) +add_insn("vsubss", "xmm_xmm32", modifiers=[0xF3, 0x5C, VEXL0], avx=True) +add_insn("vucomiss", "xmm_xmm32", modifiers=[0, 0x2E, VEXL0], avx=True) + add_group("ssecmp_128", cpu=["SSE"], - modifiers=["Imm8", "PreAdd"], + modifiers=["Imm8", "PreAdd", "SetVEX"], opcode=[0x0F, 0xC2], - operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) - -add_insn("cmpeqps", "ssecmp_128", modifiers=[0]) -add_insn("cmpleps", "ssecmp_128", modifiers=[2]) -add_insn("cmpltps", "ssecmp_128", modifiers=[1]) -add_insn("cmpneqps", "ssecmp_128", modifiers=[4]) -add_insn("cmpnleps", "ssecmp_128", modifiers=[6]) -add_insn("cmpnltps", "ssecmp_128", modifiers=[5]) -add_insn("cmpordps", "ssecmp_128", modifiers=[7]) -add_insn("cmpunordps", "ssecmp_128", modifiers=[3]) +add_group("ssecmp_128", + cpu=["AVX"], + modifiers=["Imm8", "PreAdd"], + vex=128, + opcode=[0x0F, 0xC2], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) +add_group("ssecmp_128", + cpu=["AVX"], + modifiers=["Imm8", "PreAdd"], + vex=256, + opcode=[0x0F, 0xC2], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="SIMDReg", size=256, dest="VEX"), + Operand(type="SIMDRM", size=256, relaxed=True, dest="EA")]) add_group("ssecmp_32", cpu=["SSE"], - modifiers=["Imm8", "PreAdd"], + modifiers=["Imm8", "PreAdd", "SetVEX"], prefix=0x00, opcode=[0x0F, 0xC2], - operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), Operand(type="SIMDReg", size=128, dest="EA")]) - add_group("ssecmp_32", cpu=["SSE"], + modifiers=["Imm8", "PreAdd", "SetVEX"], + prefix=0x00, + opcode=[0x0F, 0xC2], + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), + Operand(type="Mem", size=32, relaxed=True, dest="EA")]) +add_group("ssecmp_32", + cpu=["AVX"], modifiers=["Imm8", "PreAdd"], + vex=128, prefix=0x00, opcode=[0x0F, 0xC2], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDReg", size=128, dest="EA")]) +add_group("ssecmp_32", + cpu=["AVX"], + modifiers=["Imm8", "PreAdd"], + vex=128, + prefix=0x00, + opcode=[0x0F, 0xC2], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), Operand(type="Mem", size=32, relaxed=True, dest="EA")]) -add_insn("cmpeqss", "ssecmp_32", modifiers=[0, 0xF3]) -add_insn("cmpless", "ssecmp_32", modifiers=[2, 0xF3]) -add_insn("cmpltss", "ssecmp_32", modifiers=[1, 0xF3]) -add_insn("cmpneqss", "ssecmp_32", modifiers=[4, 0xF3]) -add_insn("cmpnless", "ssecmp_32", modifiers=[6, 0xF3]) -add_insn("cmpnltss", "ssecmp_32", modifiers=[5, 0xF3]) -add_insn("cmpordss", "ssecmp_32", modifiers=[7, 0xF3]) -add_insn("cmpunordss", "ssecmp_32", modifiers=[3, 0xF3]) +ssecoms = [(0x0, "eq"), + (0x1, "lt"), + (0x2, "le"), + (0x3, "unord"), + (0x4, "neq"), + (0x5, "nlt"), + (0x6, "nle"), + (0x7, "ord")] +for ib, cc in ssecoms: + add_insn("cmp"+cc+"ps", "ssecmp_128", modifiers=[ib]) + add_insn("cmp"+cc+"ss", "ssecmp_32", modifiers=[ib, 0xF3]) + +avxcoms = [(0x00, "eq"), + (0x01, "lt"), + (0x02, "le"), + (0x03, "unord"), + (0x04, "neq"), + (0x05, "nlt"), + (0x06, "nle"), + (0x07, "ord"), + (0x08, "eq_uq"), + (0x09, "nge"), + (0x0a, "ngt"), + (0x0b, "false"), + (0x0c, "neq_oq"), + (0x0d, "ge"), + (0x0e, "gt"), + (0x0f, "true"), + (0x10, "eq_os"), + (0x11, "lt_oq"), + (0x12, "le_oq"), + (0x13, "unord_s"), + (0x14, "neq_us"), + (0x15, "nlt_uq"), + (0x16, "nle_uq"), + (0x17, "ord_s"), + (0x18, "eq_us"), + (0x19, "nge_uq"), + (0x1a, "ngt_uq"), + (0x1b, "false_os"), + (0x1c, "neq_os"), + (0x1d, "ge_oq"), + (0x1e, "gt_oq"), + (0x1f, "true_us")] +for ib, cc in avxcoms: + add_insn("vcmp"+cc+"ps", "ssecmp_128", modifiers=[ib, 0, VEXL0], avx=True) + add_insn("vcmp"+cc+"ss", "ssecmp_32", modifiers=[ib, 0xF3, VEXL0], avx=True) add_group("xmm_xmm128_imm", cpu=["SSE"], - modifiers=["PreAdd", "Op1Add"], + modifiers=["PreAdd", "Op1Add", "SetVEX"], opcode=[0x0F, 0x00], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), @@ -3921,35 +4257,87 @@ add_group("xmm_xmm128_imm", add_insn("cmpps", "xmm_xmm128_imm", modifiers=[0, 0xC2]) add_insn("shufps", "xmm_xmm128_imm", modifiers=[0, 0xC6]) -add_group("xmm_xmm32_imm", +# YMM register and 4-operand version of above +add_group("xmm_xmm128_imm_256", cpu=["SSE"], + modifiers=["PreAdd", "Op1Add", "SetVEX"], + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("xmm_xmm128_imm_256", + cpu=["AVX"], modifiers=["PreAdd", "Op1Add"], - prefix=0x00, + vex=128, opcode=[0x0F, 0x00], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDReg", size=128, dest="EA"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("xmm_xmm128_imm_256", + cpu=["AVX"], + modifiers=["PreAdd", "Op1Add"], + vex=256, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="SIMDReg", size=256, dest="VEX"), + Operand(type="SIMDRM", size=256, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + +add_insn("vcmpps", "xmm_xmm128_imm_256", modifiers=[0, 0xC2, VEXL0], avx=True) +add_insn("vshufps", "xmm_xmm128_imm_256", modifiers=[0, 0xC6, VEXL0], avx=True) add_group("xmm_xmm32_imm", cpu=["SSE"], + modifiers=["PreAdd", "Op1Add", "SetVEX"], + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), + Operand(type="SIMDReg", size=128, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("xmm_xmm32_imm", + cpu=["SSE"], + modifiers=["PreAdd", "Op1Add", "SetVEX"], + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), + Operand(type="Mem", size=32, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("xmm_xmm32_imm", + cpu=["AVX"], modifiers=["PreAdd", "Op1Add"], + vex=128, prefix=0x00, opcode=[0x0F, 0x00], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDReg", size=128, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("xmm_xmm32_imm", + cpu=["AVX"], + modifiers=["PreAdd", "Op1Add"], + vex=128, + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), Operand(type="Mem", size=32, relaxed=True, dest="EA"), Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) add_insn("cmpss", "xmm_xmm32_imm", modifiers=[0xF3, 0xC2]) +add_insn("vcmpss", "xmm_xmm32_imm", modifiers=[0xF3, 0xC2, VEXL0], avx=True) add_group("ldstmxcsr", cpu=["SSE"], - modifiers=["SpAdd"], + modifiers=["SpAdd", "SetVEX"], opcode=[0x0F, 0xAE], spare=0, operands=[Operand(type="Mem", size=32, relaxed=True, dest="EA")]) add_insn("ldmxcsr", "ldstmxcsr", modifiers=[2]) add_insn("stmxcsr", "ldstmxcsr", modifiers=[3]) +add_insn("vldmxcsr", "ldstmxcsr", modifiers=[2, VEXL0], avx=True) +add_insn("vstmxcsr", "ldstmxcsr", modifiers=[3, VEXL0], avx=True) add_group("maskmovq", cpu=["MMX", "P3"], @@ -3959,71 +4347,157 @@ add_group("maskmovq", add_insn("maskmovq", "maskmovq") -add_group("movaups", +# Too many modifiers, so can't reuse first two cases for AVX version +# Just repeat and disable first two with noavx. +add_group("movau", cpu=["SSE"], - modifiers=["Op1Add"], + modifiers=["PreAdd", "Op1Add"], + notavx=True, + prefix=0x00, opcode=[0x0F, 0x00], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) -add_group("movaups", +add_group("movau", cpu=["SSE"], - modifiers=["Op1Add"], - opcode=[0x0F, 0x01], + notavx=True, + modifiers=["PreAdd", "Op1Add", "Op1Add"], + prefix=0x00, + opcode=[0x0F, 0x00], operands=[Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), Operand(type="SIMDReg", size=128, dest="Spare")]) +add_group("movau", + cpu=["AVX"], + modifiers=["PreAdd", "Op1Add"], + vex=128, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) +add_group("movau", + cpu=["AVX"], + modifiers=["PreAdd", "Op1Add", "Op1Add"], + vex=128, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="Spare")]) +add_group("movau", + cpu=["AVX"], + modifiers=["PreAdd", "Op1Add"], + vex=256, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="SIMDRM", size=256, relaxed=True, dest="EA")]) +add_group("movau", + cpu=["AVX"], + modifiers=["PreAdd", "Op1Add", "Op1Add"], + vex=256, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDRM", size=256, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=256, dest="Spare")]) -add_insn("movaps", "movaups", modifiers=[0x28]) -add_insn("movups", "movaups", modifiers=[0x10]) +add_insn("movaps", "movau", modifiers=[0, 0x28, 0x01]) +add_insn("movups", "movau", modifiers=[0, 0x10, 0x01]) +add_insn("vmovaps", "movau", modifiers=[0, 0x28, 0x01], avx=True) +add_insn("vmovups", "movau", modifiers=[0, 0x10, 0x01], avx=True) add_group("movhllhps", cpu=["SSE"], + modifiers=["Op1Add", "SetVEX"], + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), + Operand(type="SIMDReg", size=128, dest="EA")]) +add_group("movhllhps", + cpu=["AVX"], modifiers=["Op1Add"], + vex=128, opcode=[0x0F, 0x00], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), Operand(type="SIMDReg", size=128, dest="EA")]) add_insn("movhlps", "movhllhps", modifiers=[0x12]) add_insn("movlhps", "movhllhps", modifiers=[0x16]) +add_insn("vmovhlps", "movhllhps", modifiers=[0x12, VEXL0], avx=True) +add_insn("vmovlhps", "movhllhps", modifiers=[0x16, VEXL0], avx=True) -add_group("movhlps", +add_group("movhlp", cpu=["SSE"], - modifiers=["Op1Add"], + modifiers=["PreAdd", "Op1Add", "SetVEX"], + prefix=0x00, opcode=[0x0F, 0x00], - operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), Operand(type="Mem", size=64, relaxed=True, dest="EA")]) -add_group("movhlps", +add_group("movhlp", cpu=["SSE"], - modifiers=["Op1Add"], + modifiers=["PreAdd", "Op1Add", "SetVEX"], + prefix=0x00, opcode=[0x0F, 0x01], operands=[Operand(type="Mem", size=64, relaxed=True, dest="EA"), Operand(type="SIMDReg", size=128, dest="Spare")]) +add_group("movhlp", + cpu=["AVX"], + modifiers=["PreAdd", "Op1Add"], + vex=128, + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="Mem", size=64, relaxed=True, dest="EA")]) -add_insn("movhps", "movhlps", modifiers=[0x16]) -add_insn("movlps", "movhlps", modifiers=[0x12]) +add_insn("movhps", "movhlp", modifiers=[0, 0x16]) +add_insn("movlps", "movhlp", modifiers=[0, 0x12]) +add_insn("vmovhps", "movhlp", modifiers=[0, 0x16, VEXL0], avx=True) +add_insn("vmovlps", "movhlp", modifiers=[0, 0x12, VEXL0], avx=True) -add_group("movmskps", +add_group("movmsk", suffix="l", cpu=["SSE"], + modifiers=["PreAdd", "SetVEX"], + prefix=0x00, opcode=[0x0F, 0x50], operands=[Operand(type="Reg", size=32, dest="Spare"), Operand(type="SIMDReg", size=128, dest="EA")]) -add_group("movmskps", +add_group("movmsk", suffix="q", cpu=["SSE"], + modifiers=["PreAdd", "SetVEX"], + prefix=0x00, opersize=64, opcode=[0x0F, 0x50], operands=[Operand(type="Reg", size=64, dest="Spare"), Operand(type="SIMDReg", size=128, dest="EA")]) - -add_insn("movmskps", "movmskps") - -add_group("movntps", +add_group("movmsk", + suffix="l", + cpu=["AVX"], + modifiers=["PreAdd"], + vex=256, + prefix=0x00, + opcode=[0x0F, 0x50], + operands=[Operand(type="Reg", size=32, dest="Spare"), + Operand(type="SIMDReg", size=256, dest="EA")]) +add_group("movmsk", + suffix="q", cpu=["SSE"], - opcode=[0x0F, 0x2B], + modifiers=["PreAdd"], + vex=256, + prefix=0x00, + opersize=64, + opcode=[0x0F, 0x50], + operands=[Operand(type="Reg", size=64, dest="Spare"), + Operand(type="SIMDReg", size=256, dest="EA")]) + +add_insn("movmskps", "movmsk") +add_insn("vmovmskps", "movmsk", modifiers=[0, VEXL0], avx=True) + +add_group("movnt", + cpu=["SSE"], + modifiers=["PreAdd", "Op1Add", "SetVEX"], + prefix=0x00, + opcode=[0x0F, 0x00], operands=[Operand(type="Mem", size=128, relaxed=True, dest="EA"), Operand(type="SIMDReg", size=128, dest="Spare")]) -add_insn("movntps", "movntps") +add_insn("movntps", "movnt", modifiers=[0, 0x2B]) +add_insn("vmovntps", "movnt", modifiers=[0, 0x2B, VEXL0], avx=True) add_group("movntq", cpu=["SSE"], @@ -4035,28 +4509,41 @@ add_insn("movntq", "movntq") add_group("movss", cpu=["SSE"], + modifiers=["SetVEX"], prefix=0xF3, opcode=[0x0F, 0x10], - operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), Operand(type="SIMDReg", size=128, dest="EA")]) add_group("movss", cpu=["SSE"], + modifiers=["SetVEX"], prefix=0xF3, opcode=[0x0F, 0x10], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), Operand(type="Mem", size=32, relaxed=True, dest="EA")]) add_group("movss", cpu=["SSE"], + modifiers=["SetVEX"], prefix=0xF3, opcode=[0x0F, 0x11], operands=[Operand(type="Mem", size=32, relaxed=True, dest="EA"), Operand(type="SIMDReg", size=128, dest="Spare")]) - +add_group("movss", + cpu=["AVX"], + vex=128, + prefix=0xF3, + opcode=[0x0F, 0x10], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDReg", size=128, dest="EA")]) + add_insn("movss", "movss") +add_insn("vmovss", "movss", modifiers=[VEXL0], avx=True) add_group("pextrw", suffix="l", cpu=["MMX", "P3"], + notavx=True, opcode=[0x0F, 0xC5], operands=[Operand(type="Reg", size=32, dest="Spare"), Operand(type="SIMDReg", size=64, dest="EA"), @@ -4064,6 +4551,7 @@ add_group("pextrw", add_group("pextrw", suffix="l", cpu=["SSE2"], + modifiers=["SetVEX"], prefix=0x66, opcode=[0x0F, 0xC5], operands=[Operand(type="Reg", size=32, dest="Spare"), @@ -4072,6 +4560,7 @@ add_group("pextrw", add_group("pextrw", suffix="q", cpu=["MMX", "P3"], + notavx=True, opersize=64, opcode=[0x0F, 0xC5], operands=[Operand(type="Reg", size=64, dest="Spare"), @@ -4080,6 +4569,7 @@ add_group("pextrw", add_group("pextrw", suffix="q", cpu=["SSE2"], + modifiers=["SetVEX"], opersize=64, prefix=0x66, opcode=[0x0F, 0xC5], @@ -4089,6 +4579,7 @@ add_group("pextrw", # SSE41 instructions add_group("pextrw", cpu=["SSE41"], + modifiers=["SetVEX"], prefix=0x66, opcode=[0x0F, 0x3A, 0x15], operands=[Operand(type="Mem", size=16, relaxed=True, dest="EA"), @@ -4096,6 +4587,7 @@ add_group("pextrw", Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) add_group("pextrw", cpu=["SSE41"], + modifiers=["SetVEX"], opersize=32, prefix=0x66, opcode=[0x0F, 0x3A, 0x15], @@ -4104,6 +4596,7 @@ add_group("pextrw", Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) add_group("pextrw", cpu=["SSE41"], + modifiers=["SetVEX"], opersize=64, prefix=0x66, opcode=[0x0F, 0x3A, 0x15], @@ -4112,10 +4605,12 @@ add_group("pextrw", Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) add_insn("pextrw", "pextrw") +add_insn("vpextrw", "pextrw", modifiers=[VEXL0], avx=True) add_group("pinsrw", suffix="l", cpu=["MMX", "P3"], + notavx=True, opcode=[0x0F, 0xC4], operands=[Operand(type="SIMDReg", size=64, dest="Spare"), Operand(type="Reg", size=32, dest="EA"), @@ -4123,6 +4618,7 @@ add_group("pinsrw", add_group("pinsrw", suffix="q", cpu=["MMX", "P3"], + notavx=True, opersize=64, opcode=[0x0F, 0xC4], operands=[Operand(type="SIMDReg", size=64, dest="Spare"), @@ -4131,6 +4627,7 @@ add_group("pinsrw", add_group("pinsrw", suffix="l", cpu=["MMX", "P3"], + notavx=True, opcode=[0x0F, 0xC4], operands=[Operand(type="SIMDReg", size=64, dest="Spare"), Operand(type="Mem", size=16, relaxed=True, dest="EA"), @@ -4138,40 +4635,77 @@ add_group("pinsrw", add_group("pinsrw", suffix="l", cpu=["SSE2"], + modifiers=["SetVEX"], prefix=0x66, opcode=[0x0F, 0xC4], - operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), Operand(type="Reg", size=32, dest="EA"), Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) add_group("pinsrw", suffix="q", cpu=["SSE2"], + modifiers=["SetVEX"], opersize=64, prefix=0x66, opcode=[0x0F, 0xC4], - operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), Operand(type="Reg", size=64, dest="EA"), Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) add_group("pinsrw", suffix="l", cpu=["SSE2"], + modifiers=["SetVEX"], + prefix=0x66, + opcode=[0x0F, 0xC4], + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), + Operand(type="Mem", size=16, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("pinsrw", + suffix="l", + cpu=["AVX"], + vex=128, prefix=0x66, opcode=[0x0F, 0xC4], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="Reg", size=32, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("pinsrw", + suffix="q", + cpu=["AVX"], + vex=128, + opersize=64, + prefix=0x66, + opcode=[0x0F, 0xC4], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="Reg", size=64, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("pinsrw", + suffix="l", + cpu=["AVX"], + vex=128, + prefix=0x66, + opcode=[0x0F, 0xC4], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), Operand(type="Mem", size=16, relaxed=True, dest="EA"), Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) add_insn("pinsrw", "pinsrw") +add_insn("vpinsrw", "pinsrw", modifiers=[VEXL0], avx=True) add_group("pmovmskb", suffix="l", cpu=["MMX", "P3"], + notavx=True, opcode=[0x0F, 0xD7], operands=[Operand(type="Reg", size=32, dest="Spare"), Operand(type="SIMDReg", size=64, dest="EA")]) add_group("pmovmskb", suffix="l", cpu=["SSE2"], + modifiers=["SetVEX"], prefix=0x66, opcode=[0x0F, 0xD7], operands=[Operand(type="Reg", size=32, dest="Spare"), @@ -4179,6 +4713,7 @@ add_group("pmovmskb", add_group("pmovmskb", suffix="q", cpu=["MMX", "P3"], + notavx=True, opersize=64, opcode=[0x0F, 0xD7], operands=[Operand(type="Reg", size=64, dest="Spare"), @@ -4186,6 +4721,7 @@ add_group("pmovmskb", add_group("pmovmskb", suffix="q", cpu=["SSE2"], + modifiers=["SetVEX"], opersize=64, prefix=0x66, opcode=[0x0F, 0xD7], @@ -4193,6 +4729,7 @@ add_group("pmovmskb", Operand(type="SIMDReg", size=128, dest="EA")]) add_insn("pmovmskb", "pmovmskb") +add_insn("vpmovmskb", "pmovmskb", modifiers=[VEXL0], avx=True) add_group("pshufw", cpu=["MMX", "P3"], @@ -4208,17 +4745,35 @@ add_insn("pshufw", "pshufw") ##################################################################### add_group("xmm_xmm64", cpu=["SSE2"], - modifiers=["PreAdd", "Op1Add"], + modifiers=["PreAdd", "Op1Add", "SetVEX"], prefix=0x00, opcode=[0x0F, 0x00], - operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), Operand(type="SIMDReg", size=128, dest="EA")]) add_group("xmm_xmm64", cpu=["SSE2"], + modifiers=["PreAdd", "Op1Add", "SetVEX"], + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), + Operand(type="Mem", size=64, relaxed=True, dest="EA")]) +add_group("xmm_xmm64", + cpu=["AVX"], modifiers=["PreAdd", "Op1Add"], + vex=128, prefix=0x00, opcode=[0x0F, 0x00], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDReg", size=128, dest="EA")]) +add_group("xmm_xmm64", + cpu=["AVX"], + modifiers=["PreAdd", "Op1Add"], + vex=128, + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), Operand(type="Mem", size=64, relaxed=True, dest="EA")]) add_insn("addsd", "xmm_xmm64", modifiers=[0xF2, 0x58]) @@ -4234,6 +4789,18 @@ add_insn("subsd", "xmm_xmm64", modifiers=[0xF2, 0x5C]) add_insn("sqrtsd", "xmm_xmm64", modifiers=[0xF2, 0x51]) add_insn("ucomisd", "xmm_xmm64", modifiers=[0x66, 0x2E]) +add_insn("vaddsd", "xmm_xmm64", modifiers=[0xF2, 0x58, VEXL0], avx=True) +add_insn("vcomisd", "xmm_xmm64", modifiers=[0x66, 0x2F, VEXL0], avx=True) +# vcvtdq2pd and vcvtps2pd can take ymm, xmm version +add_insn("vcvtsd2ss", "xmm_xmm64", modifiers=[0xF2, 0x5A, VEXL0], avx=True) +add_insn("vdivsd", "xmm_xmm64", modifiers=[0xF2, 0x5E, VEXL0], avx=True) +add_insn("vmaxsd", "xmm_xmm64", modifiers=[0xF2, 0x5F, VEXL0], avx=True) +add_insn("vminsd", "xmm_xmm64", modifiers=[0xF2, 0x5D, VEXL0], avx=True) +add_insn("vmulsd", "xmm_xmm64", modifiers=[0xF2, 0x59, VEXL0], avx=True) +add_insn("vsubsd", "xmm_xmm64", modifiers=[0xF2, 0x5C, VEXL0], avx=True) +add_insn("vsqrtsd", "xmm_xmm64", modifiers=[0xF2, 0x51, VEXL0], avx=True) +add_insn("vucomisd", "xmm_xmm64", modifiers=[0x66, 0x2E, VEXL0], avx=True) + add_insn("addpd", "xmm_xmm128", modifiers=[0x66, 0x58], cpu=["SSE2"]) add_insn("andnpd", "xmm_xmm128", modifiers=[0x66, 0x55], cpu=["SSE2"]) add_insn("andpd", "xmm_xmm128", modifiers=[0x66, 0x54], cpu=["SSE2"]) @@ -4252,49 +4819,75 @@ add_insn("unpckhpd", "xmm_xmm128", modifiers=[0x66, 0x15], cpu=["SSE2"]) add_insn("unpcklpd", "xmm_xmm128", modifiers=[0x66, 0x14], cpu=["SSE2"]) add_insn("xorpd", "xmm_xmm128", modifiers=[0x66, 0x57], cpu=["SSE2"]) -add_group("ssecmp_64", - cpu=["SSE2"], - modifiers=["Imm8", "PreAdd"], - prefix=0x00, - opcode=[0x0F, 0xC2], - operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDReg", size=128, dest="EA")]) +add_insn("vaddpd", "xmm_xmm128_256", modifiers=[0x66, 0x58, VEXL0], avx=True) +add_insn("vandnpd", "xmm_xmm128_256", modifiers=[0x66, 0x55, VEXL0], avx=True) +add_insn("vandpd", "xmm_xmm128_256", modifiers=[0x66, 0x54, VEXL0], avx=True) +# vcvtdq2ps and vcvtps2dq are 2-operand, YMM capable +# vcvtpd2dq and vcvtpd2ps take xmm, ymm combination +add_insn("vdivpd", "xmm_xmm128_256", modifiers=[0x66, 0x5E, VEXL0], avx=True) +add_insn("vmaxpd", "xmm_xmm128_256", modifiers=[0x66, 0x5F, VEXL0], avx=True) +add_insn("vminpd", "xmm_xmm128_256", modifiers=[0x66, 0x5D, VEXL0], avx=True) +add_insn("vmulpd", "xmm_xmm128_256", modifiers=[0x66, 0x59, VEXL0], avx=True) +add_insn("vorpd", "xmm_xmm128_256", modifiers=[0x66, 0x56, VEXL0], avx=True) +# vsqrtpd doesn't add third operand +add_insn("vsubpd", "xmm_xmm128_256", modifiers=[0x66, 0x5C, VEXL0], avx=True) +add_insn("vunpckhpd", "xmm_xmm128_256", modifiers=[0x66, 0x15, VEXL0], avx=True) +add_insn("vunpcklpd", "xmm_xmm128_256", modifiers=[0x66, 0x14, VEXL0], avx=True) +add_insn("vxorpd", "xmm_xmm128_256", modifiers=[0x66, 0x57, VEXL0], avx=True) add_group("ssecmp_64", cpu=["SSE2"], + modifiers=["Imm8", "PreAdd", "SetVEX"], + prefix=0x00, + opcode=[0x0F, 0xC2], + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), + Operand(type="SIMDReg", size=128, dest="EA")]) +add_group("ssecmp_64", + cpu=["SSE2"], + modifiers=["Imm8", "PreAdd", "SetVEX"], + prefix=0x00, + opcode=[0x0F, 0xC2], + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), + Operand(type="Mem", size=64, relaxed=True, dest="EA")]) +add_group("ssecmp_64", + cpu=["AVX"], modifiers=["Imm8", "PreAdd"], + vex=128, prefix=0x00, opcode=[0x0F, 0xC2], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDReg", size=128, dest="EA")]) +add_group("ssecmp_64", + cpu=["AVX"], + modifiers=["Imm8", "PreAdd"], + vex=128, + prefix=0x00, + opcode=[0x0F, 0xC2], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), Operand(type="Mem", size=64, relaxed=True, dest="EA")]) -add_insn("cmpeqsd", "ssecmp_64", modifiers=[0, 0xF2]) -add_insn("cmplesd", "ssecmp_64", modifiers=[2, 0xF2]) -add_insn("cmpltsd", "ssecmp_64", modifiers=[1, 0xF2]) -add_insn("cmpneqsd", "ssecmp_64", modifiers=[4, 0xF2]) -add_insn("cmpnlesd", "ssecmp_64", modifiers=[6, 0xF2]) -add_insn("cmpnltsd", "ssecmp_64", modifiers=[5, 0xF2]) -add_insn("cmpordsd", "ssecmp_64", modifiers=[7, 0xF2]) -add_insn("cmpunordsd", "ssecmp_64", modifiers=[3, 0xF2]) +for ib, cc in ssecoms: + add_insn("cmp"+cc+"sd", "ssecmp_64", modifiers=[ib, 0xF2]) + add_insn("cmp"+cc+"pd", "ssecmp_128", modifiers=[ib, 0x66]) -add_insn("cmpeqpd", "ssecmp_128", modifiers=[0, 0x66], cpu=["SSE2"]) -add_insn("cmplepd", "ssecmp_128", modifiers=[2, 0x66], cpu=["SSE2"]) -add_insn("cmpltpd", "ssecmp_128", modifiers=[1, 0x66], cpu=["SSE2"]) -add_insn("cmpneqpd", "ssecmp_128", modifiers=[4, 0x66], cpu=["SSE2"]) -add_insn("cmpnlepd", "ssecmp_128", modifiers=[6, 0x66], cpu=["SSE2"]) -add_insn("cmpnltpd", "ssecmp_128", modifiers=[5, 0x66], cpu=["SSE2"]) -add_insn("cmpordpd", "ssecmp_128", modifiers=[7, 0x66], cpu=["SSE2"]) -add_insn("cmpunordpd", "ssecmp_128", modifiers=[3, 0x66], cpu=["SSE2"]) +for ib, cc in avxcoms: + add_insn("vcmp"+cc+"sd", "ssecmp_64", modifiers=[ib, 0xF2, VEXL0], avx=True) + add_insn("vcmp"+cc+"pd", "ssecmp_128", modifiers=[ib, 0x66, VEXL0], avx=True) add_insn("cmppd", "xmm_xmm128_imm", modifiers=[0x66, 0xC2], cpu=["SSE2"]) add_insn("shufpd", "xmm_xmm128_imm", modifiers=[0x66, 0xC6], cpu=["SSE2"]) +add_insn("vcmppd", "xmm_xmm128_imm_256", modifiers=[0x66, 0xC2, VEXL0], avx=True) +add_insn("vshufpd", "xmm_xmm128_imm_256", modifiers=[0x66, 0xC6, VEXL0], avx=True) add_insn("cvtsi2sd", "cvt_xmm_rmx", modifiers=[0xF2, 0x2A], cpu=["SSE2"]) +add_insn("vcvtsi2sd", "cvt_xmm_rmx", modifiers=[0xF2, 0x2A, VEXL0], avx=True) add_group("cvt_rx_xmm64", suffix="l", cpu=["SSE2"], - modifiers=["PreAdd", "Op1Add"], + modifiers=["PreAdd", "Op1Add", "SetVEX"], prefix=0x00, opcode=[0x0F, 0x00], operands=[Operand(type="Reg", size=32, dest="Spare"), @@ -4302,7 +4895,7 @@ add_group("cvt_rx_xmm64", add_group("cvt_rx_xmm64", suffix="l", cpu=["SSE2"], - modifiers=["PreAdd", "Op1Add"], + modifiers=["PreAdd", "Op1Add", "SetVEX"], prefix=0x00, opcode=[0x0F, 0x00], operands=[Operand(type="Reg", size=32, dest="Spare"), @@ -4311,7 +4904,7 @@ add_group("cvt_rx_xmm64", add_group("cvt_rx_xmm64", suffix="q", cpu=["SSE2"], - modifiers=["PreAdd", "Op1Add"], + modifiers=["PreAdd", "Op1Add", "SetVEX"], opersize=64, prefix=0x00, opcode=[0x0F, 0x00], @@ -4320,7 +4913,7 @@ add_group("cvt_rx_xmm64", add_group("cvt_rx_xmm64", suffix="q", cpu=["SSE2"], - modifiers=["PreAdd", "Op1Add"], + modifiers=["PreAdd", "Op1Add", "SetVEX"], opersize=64, prefix=0x00, opcode=[0x0F, 0x00], @@ -4328,6 +4921,7 @@ add_group("cvt_rx_xmm64", Operand(type="Mem", size=64, relaxed=True, dest="EA")]) add_insn("cvtsd2si", "cvt_rx_xmm64", modifiers=[0xF2, 0x2D]) +add_insn("vcvtsd2si", "cvt_rx_xmm64", modifiers=[0xF2, 0x2D, VEXL0], avx=True) add_group("cvt_mm_xmm", cpu=["SSE2"], @@ -4352,105 +4946,92 @@ add_insn("cvtpi2pd", "cvt_xmm_mm_ss", modifiers=[0x66, 0x2A], cpu=["SSE2"]) # cmpsd SSE2 form add_group("cmpsd", cpu=["SSE2"], + modifiers=["SetVEX"], prefix=0xF2, opcode=[0x0F, 0xC2], - operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), Operand(type="SIMDReg", size=128, dest="EA"), Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) - add_group("cmpsd", cpu=["SSE2"], + modifiers=["SetVEX"], + prefix=0xF2, + opcode=[0x0F, 0xC2], + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), + Operand(type="Mem", size=64, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("cmpsd", + cpu=["AVX"], + vex=128, prefix=0xF2, opcode=[0x0F, 0xC2], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDReg", size=128, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("cmpsd", + cpu=["AVX"], + vex=128, + prefix=0xF2, + opcode=[0x0F, 0xC2], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), Operand(type="Mem", size=64, relaxed=True, dest="EA"), Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + # cmpsd is added in string instructions above, so don't re-add_insn() +add_insn("vcmpsd", "cmpsd", modifiers=[VEXL0], avx=True) -add_group("movaupd", - cpu=["SSE2"], - modifiers=["Op1Add"], - prefix=0x66, - opcode=[0x0F, 0x00], - operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) -add_group("movaupd", - cpu=["SSE2"], - modifiers=["Op1Add"], - prefix=0x66, - opcode=[0x0F, 0x01], - operands=[Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), - Operand(type="SIMDReg", size=128, dest="Spare")]) +add_insn("movapd", "movau", modifiers=[0x66, 0x28, 0x01], cpu=["SSE2"]) +add_insn("movupd", "movau", modifiers=[0x66, 0x10, 0x01], cpu=["SSE2"]) +add_insn("vmovapd", "movau", modifiers=[0x66, 0x28, 0x01], avx=True) +add_insn("vmovupd", "movau", modifiers=[0x66, 0x10, 0x01], avx=True) -add_insn("movapd", "movaupd", modifiers=[0x28]) -add_insn("movupd", "movaupd", modifiers=[0x10]) +add_insn("movhpd", "movhlp", modifiers=[0x66, 0x16], cpu=["SSE2"]) +add_insn("movlpd", "movhlp", modifiers=[0x66, 0x12], cpu=["SSE2"]) +add_insn("vmovhpd", "movhlp", modifiers=[0x66, 0x16, VEXL0], avx=True) +add_insn("vmovlpd", "movhlp", modifiers=[0x66, 0x12, VEXL0], avx=True) -add_group("movhlpd", - cpu=["SSE2"], - modifiers=["Op1Add"], - prefix=0x66, - opcode=[0x0F, 0x00], - operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="Mem", size=64, relaxed=True, dest="EA")]) -add_group("movhlpd", - cpu=["SSE2"], - modifiers=["Op1Add"], - prefix=0x66, - opcode=[0x0F, 0x01], - operands=[Operand(type="Mem", size=64, relaxed=True, dest="EA"), - Operand(type="SIMDReg", size=128, dest="Spare")]) +add_insn("movmskpd", "movmsk", modifiers=[0x66], cpu=["SSE2"]) +add_insn("vmovmskpd", "movmsk", modifiers=[0x66, VEXL0], avx=True) -add_insn("movhpd", "movhlpd", modifiers=[0x16]) -add_insn("movlpd", "movhlpd", modifiers=[0x12]) - -add_group("movmskpd", - suffix="l", - cpu=["SSE2"], - prefix=0x66, - opcode=[0x0F, 0x50], - operands=[Operand(type="Reg", size=32, dest="Spare"), - Operand(type="SIMDReg", size=128, dest="EA")]) -add_group("movmskpd", - suffix="q", - cpu=["SSE2"], - prefix=0x66, - opcode=[0x0F, 0x50], - operands=[Operand(type="Reg", size=64, dest="Spare"), - Operand(type="SIMDReg", size=128, dest="EA")]) - -add_insn("movmskpd", "movmskpd") - -add_group("movntpddq", - cpu=["SSE2"], - modifiers=["Op1Add"], - prefix=0x66, - opcode=[0x0F, 0x00], - operands=[Operand(type="Mem", size=128, relaxed=True, dest="EA"), - Operand(type="SIMDReg", size=128, dest="Spare")]) - -add_insn("movntpd", "movntpddq", modifiers=[0x2B]) -add_insn("movntdq", "movntpddq", modifiers=[0xE7]) +add_insn("movntpd", "movnt", modifiers=[0x66, 0x2B], cpu=["SSE2"]) +add_insn("movntdq", "movnt", modifiers=[0x66, 0xE7], cpu=["SSE2"]) +add_insn("vmovntpd", "movnt", modifiers=[0x66, 0x2B, VEXL0], avx=True) +add_insn("vmovntdq", "movnt", modifiers=[0x66, 0xE7, VEXL0], avx=True) # movsd SSE2 forms add_group("movsd", cpu=["SSE2"], + modifiers=["SetVEX"], prefix=0xF2, opcode=[0x0F, 0x10], - operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), Operand(type="SIMDReg", size=128, dest="EA")]) add_group("movsd", cpu=["SSE2"], + modifiers=["SetVEX"], prefix=0xF2, opcode=[0x0F, 0x10], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), Operand(type="Mem", size=64, relaxed=True, dest="EA")]) add_group("movsd", cpu=["SSE2"], + modifiers=["SetVEX"], prefix=0xF2, opcode=[0x0F, 0x11], operands=[Operand(type="Mem", size=64, relaxed=True, dest="EA"), Operand(type="SIMDReg", size=128, dest="Spare")]) +add_group("movsd", + cpu=["AVX"], + vex=128, + prefix=0xF2, + opcode=[0x0F, 0x10], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDReg", size=128, dest="EA")]) # movsd is added in string instructions above, so don't re-add_insn() +add_insn("vmovsd", "movsd", modifiers=[VEXL0], avx=True) ##################################################################### # P4 VMX Instructions @@ -4527,34 +5108,34 @@ add_insn("pshuflw", "xmm_xmm128_imm", modifiers=[0xF2, 0x70], cpu=["SSE2"]) add_insn("punpckhqdq", "xmm_xmm128", modifiers=[0x66, 0x6D], cpu=["SSE2"]) add_insn("punpcklqdq", "xmm_xmm128", modifiers=[0x66, 0x6C], cpu=["SSE2"]) +add_insn("vcvttsd2si", "cvt_rx_xmm64", modifiers=[0xF2, 0x2C, VEXL0], avx=True) +# vcvttpd2dq takes xmm, ymm combination +# vcvttps2dq is two-operand +add_insn("vpmuludq", "xmm_xmm128", modifiers=[0x66, 0xF4, VEXL0], avx=True) +add_insn("vpshufd", "xmm_xmm128_imm", modifiers=[0x66, 0x70, VEXL0], avx=True) +add_insn("vpshufhw", "xmm_xmm128_imm", modifiers=[0xF3, 0x70, VEXL0], avx=True) +add_insn("vpshuflw", "xmm_xmm128_imm", modifiers=[0xF2, 0x70, VEXL0], avx=True) +add_insn("vpunpckhqdq", "xmm_xmm128", modifiers=[0x66, 0x6D, VEXL0], avx=True) +add_insn("vpunpcklqdq", "xmm_xmm128", modifiers=[0x66, 0x6C, VEXL0], avx=True) + add_insn("cvtss2sd", "xmm_xmm32", modifiers=[0xF3, 0x5A], cpu=["SSE2"]) +add_insn("vcvtss2sd", "xmm_xmm32", modifiers=[0xF3, 0x5A, VEXL0], avx=True) add_group("maskmovdqu", cpu=["SSE2"], + modifiers=["SetVEX"], prefix=0x66, opcode=[0x0F, 0xF7], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), Operand(type="SIMDReg", size=128, dest="EA")]) add_insn("maskmovdqu", "maskmovdqu") +add_insn("vmaskmovdqu", "maskmovdqu", modifiers=[VEXL0], avx=True) -add_group("movdqau", - cpu=["SSE2"], - modifiers=["PreAdd"], - prefix=0x00, - opcode=[0x0F, 0x6F], - operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) -add_group("movdqau", - cpu=["SSE2"], - modifiers=["PreAdd"], - prefix=0x00, - opcode=[0x0F, 0x7F], - operands=[Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), - Operand(type="SIMDReg", size=128, dest="Spare")]) - -add_insn("movdqa", "movdqau", modifiers=[0x66]) -add_insn("movdqu", "movdqau", modifiers=[0xF3]) +add_insn("movdqa", "movau", modifiers=[0x66, 0x6F, 0x10], cpu=["SSE2"]) +add_insn("movdqu", "movau", modifiers=[0xF3, 0x6F, 0x10], cpu=["SSE2"]) +add_insn("vmovdqa", "movau", modifiers=[0x66, 0x6F, 0x10], avx=True) +add_insn("vmovdqu", "movau", modifiers=[0xF3, 0x6F, 0x10], avx=True) add_group("movdq2q", cpu=["SSE2"], @@ -4576,15 +5157,26 @@ add_insn("movq2dq", "movq2dq") add_group("pslrldq", cpu=["SSE2"], - modifiers=["SpAdd"], + modifiers=["SpAdd", "SetVEX"], prefix=0x66, opcode=[0x0F, 0x73], spare=0, - operands=[Operand(type="SIMDReg", size=128, dest="EA"), + operands=[Operand(type="SIMDReg", size=128, dest="EAVEX"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("pslrldq", + cpu=["SSE2"], + modifiers=["SpAdd", "SetVEX"], + prefix=0x66, + opcode=[0x0F, 0x73], + spare=0, + operands=[Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDReg", size=128, dest="EA"), Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) add_insn("pslldq", "pslrldq", modifiers=[7]) add_insn("psrldq", "pslrldq", modifiers=[3]) +add_insn("vpslldq", "pslrldq", modifiers=[7, VEXL0], avx=True) +add_insn("vpsrldq", "pslrldq", modifiers=[3, VEXL0], avx=True) ##################################################################### # SSE3 / PNI Prescott New Instructions instructions @@ -4595,6 +5187,14 @@ add_insn("haddpd", "xmm_xmm128", modifiers=[0x66, 0x7C], cpu=["SSE3"]) add_insn("haddps", "xmm_xmm128", modifiers=[0xF2, 0x7C], cpu=["SSE3"]) add_insn("hsubpd", "xmm_xmm128", modifiers=[0x66, 0x7D], cpu=["SSE3"]) add_insn("hsubps", "xmm_xmm128", modifiers=[0xF2, 0x7D], cpu=["SSE3"]) + +add_insn("vaddsubpd", "xmm_xmm128_256", modifiers=[0x66, 0xD0, VEXL0], avx=True) +add_insn("vaddsubps", "xmm_xmm128_256", modifiers=[0xF2, 0xD0, VEXL0], avx=True) +add_insn("vhaddpd", "xmm_xmm128_256", modifiers=[0x66, 0x7C, VEXL0], avx=True) +add_insn("vhaddps", "xmm_xmm128_256", modifiers=[0xF2, 0x7C, VEXL0], avx=True) +add_insn("vhsubpd", "xmm_xmm128_256", modifiers=[0x66, 0x7D, VEXL0], avx=True) +add_insn("vhsubps", "xmm_xmm128_256", modifiers=[0xF2, 0x7D, VEXL0], avx=True) + add_insn("movshdup", "xmm_xmm128", modifiers=[0xF3, 0x16], cpu=["SSE3"]) add_insn("movsldup", "xmm_xmm128", modifiers=[0xF3, 0x12], cpu=["SSE3"]) add_insn("fisttp", "fildstp", modifiers=[1, 0, 1], cpu=["SSE3"]) @@ -4605,12 +5205,21 @@ add_insn("mwait", "threebyte", modifiers=[0x0F, 0x01, 0xC9], cpu=["SSE3"]) add_group("lddqu", cpu=["SSE3"], + modifiers=["SetVEX"], prefix=0xF2, opcode=[0x0F, 0xF0], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), Operand(type="Mem", size=128, relaxed=True, dest="EA")]) +add_group("lddqu", + cpu=["AVX"], + vex=256, + prefix=0xF2, + opcode=[0x0F, 0xF0], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="Mem", size=256, relaxed=True, dest="EA")]) add_insn("lddqu", "lddqu") +add_insn("vlddqu", "lddqu", modifiers=[VEXL0], avx=True) ##################################################################### # SSSE3 / TNI Tejas New Intructions instructions @@ -4618,16 +5227,26 @@ add_insn("lddqu", "lddqu") add_group("ssse3", cpu=["SSSE3"], + notavx=True, modifiers=["Op2Add"], opcode=[0x0F, 0x38, 0x00], operands=[Operand(type="SIMDReg", size=64, dest="Spare"), Operand(type="SIMDRM", size=64, relaxed=True, dest="EA")]) add_group("ssse3", cpu=["SSSE3"], + modifiers=["Op2Add", "SetVEX"], + prefix=0x66, + opcode=[0x0F, 0x38, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) +add_group("ssse3", + cpu=["AVX"], modifiers=["Op2Add"], + vex=128, prefix=0x66, opcode=[0x0F, 0x38, 0x00], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) add_insn("pshufb", "ssse3", modifiers=[0x00]) @@ -4646,6 +5265,22 @@ add_insn("pabsb", "ssse3", modifiers=[0x1C]) add_insn("pabsw", "ssse3", modifiers=[0x1D]) add_insn("pabsd", "ssse3", modifiers=[0x1E]) +add_insn("vpshufb", "ssse3", modifiers=[0x00, VEXL0], avx=True) +add_insn("vphaddw", "ssse3", modifiers=[0x01, VEXL0], avx=True) +add_insn("vphaddd", "ssse3", modifiers=[0x02, VEXL0], avx=True) +add_insn("vphaddsw", "ssse3", modifiers=[0x03, VEXL0], avx=True) +add_insn("vpmaddubsw", "ssse3", modifiers=[0x04, VEXL0], avx=True) +add_insn("vphsubw", "ssse3", modifiers=[0x05, VEXL0], avx=True) +add_insn("vphsubd", "ssse3", modifiers=[0x06, VEXL0], avx=True) +add_insn("vphsubsw", "ssse3", modifiers=[0x07, VEXL0], avx=True) +add_insn("vpsignb", "ssse3", modifiers=[0x08, VEXL0], avx=True) +add_insn("vpsignw", "ssse3", modifiers=[0x09, VEXL0], avx=True) +add_insn("vpsignd", "ssse3", modifiers=[0x0A, VEXL0], avx=True) +add_insn("vpmulhrsw", "ssse3", modifiers=[0x0B, VEXL0], avx=True) +add_insn("vpabsb", "ssse3", modifiers=[0x1C, VEXL0], avx=True) +add_insn("vpabsw", "ssse3", modifiers=[0x1D, VEXL0], avx=True) +add_insn("vpabsd", "ssse3", modifiers=[0x1E, VEXL0], avx=True) + add_group("ssse3imm", cpu=["SSSE3"], modifiers=["Op2Add"], @@ -4663,6 +5298,7 @@ add_group("ssse3imm", Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) add_insn("palignr", "ssse3imm", modifiers=[0x0F]) +add_insn("vpalignr", "sse4imm", modifiers=[0x0F, VEXL0], avx=True) ##################################################################### # SSE4.1 / SSE4.2 instructions @@ -4670,11 +5306,19 @@ add_insn("palignr", "ssse3imm", modifiers=[0x0F]) add_group("sse4", cpu=["SSE41"], - modifiers=["Op2Add"], + modifiers=["Op2Add", "SetVEX"], prefix=0x66, opcode=[0x0F, 0x38, 0x00], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) +add_group("sse4", + cpu=["AVX"], + modifiers=["Op2Add"], + vex=256, + prefix=0x66, + opcode=[0x0F, 0x38, 0x00], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="SIMDRM", size=256, relaxed=True, dest="EA")]) add_insn("packusdw", "sse4", modifiers=[0x2B]) add_insn("pcmpeqq", "sse4", modifiers=[0x29]) @@ -4692,29 +5336,108 @@ add_insn("pmuldq", "sse4", modifiers=[0x28]) add_insn("pmulld", "sse4", modifiers=[0x40]) add_insn("ptest", "sse4", modifiers=[0x17]) -add_group("sse4imm", +# AVX versions use ssse3, and disable MMX version, as they're 3-operand +add_insn("vpackusdw", "ssse3", modifiers=[0x2B, VEXL0], avx=True) +add_insn("vpcmpeqq", "ssse3", modifiers=[0x29, VEXL0], avx=True) +add_insn("vpcmpgtq", "ssse3", modifiers=[0x37, VEXL0], avx=True) +add_insn("vphminposuw", "ssse3", modifiers=[0x41, VEXL0], avx=True) +add_insn("vpmaxsb", "ssse3", modifiers=[0x3C, VEXL0], avx=True) +add_insn("vpmaxsd", "ssse3", modifiers=[0x3D, VEXL0], avx=True) +add_insn("vpmaxud", "ssse3", modifiers=[0x3F, VEXL0], avx=True) +add_insn("vpmaxuw", "ssse3", modifiers=[0x3E, VEXL0], avx=True) +add_insn("vpminsb", "ssse3", modifiers=[0x38, VEXL0], avx=True) +add_insn("vpminsd", "ssse3", modifiers=[0x39, VEXL0], avx=True) +add_insn("vpminud", "ssse3", modifiers=[0x3B, VEXL0], avx=True) +add_insn("vpminuw", "ssse3", modifiers=[0x3A, VEXL0], avx=True) +add_insn("vpmuldq", "ssse3", modifiers=[0x28, VEXL0], avx=True) +add_insn("vpmulld", "ssse3", modifiers=[0x40, VEXL0], avx=True) +# vptest, however, uses SSE4 style (2 operand only) +add_insn("vptest", "sse4", modifiers=[0x17, VEXL0], avx=True) + +add_group("sse4imm_256", cpu=["SSE41"], + modifiers=["Op2Add", "SetVEX"], + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("sse4imm_256", + cpu=["AVX"], modifiers=["Op2Add"], + vex=128, prefix=0x66, opcode=[0x0F, 0x3A, 0x00], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("sse4imm_256", + cpu=["AVX"], + modifiers=["Op2Add"], + vex=256, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="SIMDReg", size=256, dest="VEX"), + Operand(type="SIMDRM", size=256, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + +# Version that does not allow YMM registers +add_group("sse4imm", + cpu=["SSE41"], + modifiers=["Op2Add", "SetVEX"], + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("sse4imm", + cpu=["AVX"], + modifiers=["Op2Add"], + vex=128, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + for sz in [32, 64]: add_group("sse4m%dimm" % sz, cpu=["SSE41"], - modifiers=["Op2Add"], + modifiers=["Op2Add", "SetVEX"], prefix=0x66, opcode=[0x0F, 0x3A, 0x00], - operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), Operand(type="SIMDReg", size=128, dest="EA"), Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) add_group("sse4m%dimm" % sz, cpu=["SSE41"], + modifiers=["Op2Add", "SetVEX"], + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), + Operand(type="Mem", size=sz, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + add_group("sse4m%dimm" % sz, + cpu=["AVX"], modifiers=["Op2Add"], + vex=128, prefix=0x66, opcode=[0x0F, 0x3A, 0x00], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDReg", size=128, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + add_group("sse4m%dimm" % sz, + cpu=["AVX"], + modifiers=["Op2Add"], + vex=128, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), Operand(type="Mem", size=sz, relaxed=True, dest="EA"), Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) @@ -4729,6 +5452,17 @@ add_insn("roundps", "sse4imm", modifiers=[0x08]) add_insn("roundsd", "sse4m64imm", modifiers=[0x0B]) add_insn("roundss", "sse4m32imm", modifiers=[0x0A]) +# vdppd, vmpsadbw, and vpblendw do not allow YMM registers +add_insn("vblendpd", "sse4imm_256", modifiers=[0x0D, VEXL0], avx=True) +add_insn("vblendps", "sse4imm_256", modifiers=[0x0C, VEXL0], avx=True) +add_insn("vdppd", "sse4imm", modifiers=[0x41, VEXL0], avx=True) +add_insn("vdpps", "sse4imm_256", modifiers=[0x40, VEXL0], avx=True) +add_insn("vmpsadbw", "sse4imm", modifiers=[0x42, VEXL0], avx=True) +add_insn("vpblendw", "sse4imm", modifiers=[0x0E, VEXL0], avx=True) +# vroundpd and vroundps don't add another register operand +add_insn("vroundsd", "sse4m64imm", modifiers=[0x0B, VEXL0], avx=True) +add_insn("vroundss", "sse4m32imm", modifiers=[0x0A, VEXL0], avx=True) + add_group("sse4xmm0", cpu=["SSE41"], modifiers=["Op2Add"], @@ -4749,6 +5483,32 @@ add_insn("blendvpd", "sse4xmm0", modifiers=[0x15]) add_insn("blendvps", "sse4xmm0", modifiers=[0x14]) add_insn("pblendvb", "sse4xmm0", modifiers=[0x10]) +# implicit XMM0 can't be VEX-encoded +add_group("avx_sse4xmm0", + cpu=["AVX"], + modifiers=["Op2Add"], + vex=128, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="VEXImmSrc")]) +add_group("avx_sse4xmm0", + cpu=["AVX"], + modifiers=["Op2Add"], + vex=256, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="SIMDReg", size=256, dest="VEX"), + Operand(type="SIMDRM", size=256, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=256, dest="VEXImmSrc")]) + +add_insn("vblendvpd", "avx_sse4xmm0", modifiers=[0x4B]) +add_insn("vblendvps", "avx_sse4xmm0", modifiers=[0x4A]) +add_insn("vpblendvb", "avx_sse4xmm0", modifiers=[0x4C]) + for sfx, sz in zip("bwl", [8, 16, 32]): add_group("crc32", suffix=sfx, @@ -4772,6 +5532,7 @@ add_insn("crc32", "crc32") add_group("extractps", cpu=["SSE41"], + modifiers=["SetVEX"], opersize=32, prefix=0x66, opcode=[0x0F, 0x3A, 0x17], @@ -4780,6 +5541,7 @@ add_group("extractps", Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) add_group("extractps", cpu=["SSE41"], + modifiers=["SetVEX"], opersize=64, prefix=0x66, opcode=[0x0F, 0x3A, 0x17], @@ -4788,36 +5550,60 @@ add_group("extractps", Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) add_insn("extractps", "extractps") +add_insn("vextractps", "extractps", modifiers=[VEXL0], avx=True) add_group("insertps", cpu=["SSE41"], + modifiers=["SetVEX"], prefix=0x66, opcode=[0x0F, 0x3A, 0x21], - operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), Operand(type="Mem", size=32, relaxed=True, dest="EA"), Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) add_group("insertps", cpu=["SSE41"], + modifiers=["SetVEX"], + prefix=0x66, + opcode=[0x0F, 0x3A, 0x21], + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), + Operand(type="SIMDReg", size=128, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("insertps", + cpu=["AVX"], + vex=128, prefix=0x66, opcode=[0x0F, 0x3A, 0x21], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="Mem", size=32, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("insertps", + cpu=["AVX"], + vex=128, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x21], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), Operand(type="SIMDReg", size=128, dest="EA"), Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) add_insn("insertps", "insertps") +add_insn("vinsertps", "insertps", modifiers=[VEXL0], avx=True) add_group("movntdqa", cpu=["SSE41"], + modifiers=["SetVEX"], prefix=0x66, opcode=[0x0F, 0x38, 0x2A], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), Operand(type="Mem", size=128, relaxed=True, dest="EA")]) add_insn("movntdqa", "movntdqa") +add_insn("vmovntdqa", "movntdqa", modifiers=[VEXL0], avx=True) add_group("sse4pcmpstr", cpu=["SSE42"], - modifiers=["Op2Add"], + modifiers=["Op2Add", "SetVEX"], prefix=0x66, opcode=[0x0F, 0x3A, 0x00], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), @@ -4829,8 +5615,14 @@ add_insn("pcmpestrm", "sse4pcmpstr", modifiers=[0x60]) add_insn("pcmpistri", "sse4pcmpstr", modifiers=[0x63]) add_insn("pcmpistrm", "sse4pcmpstr", modifiers=[0x62]) +add_insn("vpcmpestri", "sse4pcmpstr", modifiers=[0x61, VEXL0], avx=True) +add_insn("vpcmpestrm", "sse4pcmpstr", modifiers=[0x60, VEXL0], avx=True) +add_insn("vpcmpistri", "sse4pcmpstr", modifiers=[0x63, VEXL0], avx=True) +add_insn("vpcmpistrm", "sse4pcmpstr", modifiers=[0x62, VEXL0], avx=True) + add_group("pextrb", cpu=["SSE41"], + modifiers=["SetVEX"], prefix=0x66, opcode=[0x0F, 0x3A, 0x14], operands=[Operand(type="Mem", size=8, relaxed=True, dest="EA"), @@ -4839,6 +5631,7 @@ add_group("pextrb", for sz in [32, 64]: add_group("pextrb", cpu=["SSE41"], + modifiers=["SetVEX"], opersize=sz, prefix=0x66, opcode=[0x0F, 0x3A, 0x14], @@ -4847,9 +5640,11 @@ for sz in [32, 64]: Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) add_insn("pextrb", "pextrb") +add_insn("vpextrb", "pextrb", modifiers=[VEXL0], avx=True) add_group("pextrd", cpu=["SSE41"], + modifiers=["SetVEX"], opersize=32, prefix=0x66, opcode=[0x0F, 0x3A, 0x16], @@ -4858,9 +5653,11 @@ add_group("pextrd", Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) add_insn("pextrd", "pextrd") +add_insn("vpextrd", "pextrd", modifiers=[VEXL0], avx=True) add_group("pextrq", cpu=["SSE41"], + modifiers=["SetVEX"], opersize=64, prefix=0x66, opcode=[0x0F, 0x3A, 0x16], @@ -4869,58 +5666,105 @@ add_group("pextrq", Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) add_insn("pextrq", "pextrq") +add_insn("vpextrq", "pextrq", modifiers=[VEXL0], avx=True) add_group("pinsrb", cpu=["SSE41"], + modifiers=["SetVEX"], prefix=0x66, opcode=[0x0F, 0x3A, 0x20], - operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), Operand(type="Mem", size=8, relaxed=True, dest="EA"), Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) add_group("pinsrb", cpu=["SSE41"], + modifiers=["SetVEX"], opersize=32, prefix=0x66, opcode=[0x0F, 0x3A, 0x20], + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), + Operand(type="Reg", size=32, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("pinsrb", + cpu=["AVX"], + vex=128, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x20], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="Mem", size=8, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("pinsrb", + cpu=["AVX"], + vex=128, + opersize=32, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x20], + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), + Operand(type="SIMDReg", size=128, dest="VEX"), Operand(type="Reg", size=32, dest="EA"), Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) add_insn("pinsrb", "pinsrb") +add_insn("vpinsrb", "pinsrb", modifiers=[VEXL0], avx=True) add_group("pinsrd", cpu=["SSE41"], + modifiers=["SetVEX"], + opersize=32, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x22], + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), + Operand(type="RM", size=32, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("pinsrd", + cpu=["AVX"], + vex=128, opersize=32, prefix=0x66, opcode=[0x0F, 0x3A, 0x22], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), Operand(type="RM", size=32, relaxed=True, dest="EA"), Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) add_insn("pinsrd", "pinsrd") +add_insn("vpinsrd", "pinsrd", modifiers=[VEXL0], avx=True) add_group("pinsrq", cpu=["SSE41"], + modifiers=["SetVEX"], opersize=64, prefix=0x66, opcode=[0x0F, 0x3A, 0x22], - operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), + Operand(type="RM", size=64, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("pinsrq", + cpu=["AVX"], + vex=128, + opersize=64, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x22], + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), + Operand(type="SIMDReg", size=128, dest="VEX"), Operand(type="RM", size=64, relaxed=True, dest="EA"), Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) add_insn("pinsrq", "pinsrq") +add_insn("vpinsrq", "pinsrq", modifiers=[VEXL0], avx=True) for sz in [16, 32, 64]: add_group("sse4m%d" % sz, cpu=["SSE41"], - modifiers=["Op2Add"], + modifiers=["Op2Add", "SetVEX"], prefix=0x66, opcode=[0x0F, 0x38, 0x00], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), Operand(type="Mem", size=sz, relaxed=True, dest="EA")]) add_group("sse4m%d" % sz, cpu=["SSE41"], - modifiers=["Op2Add"], + modifiers=["Op2Add", "SetVEX"], prefix=0x66, opcode=[0x0F, 0x38, 0x00], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), @@ -4933,14 +5777,29 @@ add_insn("pmovzxbw", "sse4m64", modifiers=[0x30]) add_insn("pmovzxwd", "sse4m64", modifiers=[0x33]) add_insn("pmovzxdq", "sse4m64", modifiers=[0x35]) +add_insn("vpmovsxbw", "sse4m64", modifiers=[0x20, VEXL0], avx=True) +add_insn("vpmovsxwd", "sse4m64", modifiers=[0x23, VEXL0], avx=True) +add_insn("vpmovsxdq", "sse4m64", modifiers=[0x25, VEXL0], avx=True) +add_insn("vpmovzxbw", "sse4m64", modifiers=[0x30, VEXL0], avx=True) +add_insn("vpmovzxwd", "sse4m64", modifiers=[0x33, VEXL0], avx=True) +add_insn("vpmovzxdq", "sse4m64", modifiers=[0x35, VEXL0], avx=True) + add_insn("pmovsxbd", "sse4m32", modifiers=[0x21]) add_insn("pmovsxwq", "sse4m32", modifiers=[0x24]) add_insn("pmovzxbd", "sse4m32", modifiers=[0x31]) add_insn("pmovzxwq", "sse4m32", modifiers=[0x34]) +add_insn("vpmovsxbd", "sse4m32", modifiers=[0x21, VEXL0], avx=True) +add_insn("vpmovsxwq", "sse4m32", modifiers=[0x24, VEXL0], avx=True) +add_insn("vpmovzxbd", "sse4m32", modifiers=[0x31, VEXL0], avx=True) +add_insn("vpmovzxwq", "sse4m32", modifiers=[0x34, VEXL0], avx=True) + add_insn("pmovsxbq", "sse4m16", modifiers=[0x22]) add_insn("pmovzxbq", "sse4m16", modifiers=[0x32]) +add_insn("vpmovsxbq", "sse4m16", modifiers=[0x22, VEXL0], avx=True) +add_insn("vpmovzxbq", "sse4m16", modifiers=[0x32, VEXL0], avx=True) + for sfx, sz in zip("wlq", [16, 32, 64]): add_group("cnt", suffix=sfx, @@ -4953,6 +5812,654 @@ for sfx, sz in zip("wlq", [16, 32, 64]): add_insn("popcnt", "cnt", modifiers=[0xB8], cpu=["SSE42"]) +##################################################################### +# Intel AVX instructions +##################################################################### + +# Most AVX instructions are mixed in with above SSEx groups. +# Some make more sense to have separate groups due to naming conflicts +# that the v-named versions don't have to deal with. +add_group("vmovd", + cpu=["AVX"], + vex=128, + prefix=0x66, + opcode=[0x0F, 0x6E], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="RM", size=32, relaxed=True, dest="EA")]) +add_group("vmovd", + cpu=["AVX"], + vex=128, + prefix=0x66, + opcode=[0x0F, 0x7E], + operands=[Operand(type="RM", size=32, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="Spare")]) + +add_insn("vmovd", "vmovd") + +add_group("vmovq", + cpu=["AVX"], + vex=128, + prefix=0xF3, + opcode=[0x0F, 0x7E], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA")]) +add_group("vmovq", + cpu=["AVX"], + vex=128, + prefix=0xF3, + opcode=[0x0F, 0x7E], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Mem", size=64, relaxed=True, dest="EA")]) +add_group("vmovq", + cpu=["AVX"], + vex=128, + prefix=0x66, + opcode=[0x0F, 0xD6], + operands=[Operand(type="Mem", size=64, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="Spare")]) +add_group("vmovq", + cpu=["AVX"], + vex=128, + opersize=64, + prefix=0x66, + opcode=[0x0F, 0x6E], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="RM", size=64, relaxed=True, dest="EA")]) +add_group("vmovq", + cpu=["AVX"], + vex=128, + opersize=64, + prefix=0x66, + opcode=[0x0F, 0x7E], + operands=[Operand(type="RM", size=64, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="Spare")]) + +add_insn("vmovq", "vmovq") + +# Some AVX variants don't add third operand +add_group("avx_xmm_xmm128", + cpu=["AVX"], + modifiers=["PreAdd", "Op1Add"], + vex=128, + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) +add_group("avx_xmm_xmm128", + cpu=["AVX"], + modifiers=["PreAdd", "Op1Add"], + vex=256, + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="SIMDRM", size=256, relaxed=True, dest="EA")]) + +add_insn("vmovshdup", "avx_xmm_xmm128", modifiers=[0xF3, 0x16]) +add_insn("vmovsldup", "avx_xmm_xmm128", modifiers=[0xF3, 0x12]) +add_insn("vrcpps", "avx_xmm_xmm128", modifiers=[0, 0x53]) +add_insn("vrsqrtps", "avx_xmm_xmm128", modifiers=[0, 0x52]) +add_insn("vsqrtps", "avx_xmm_xmm128", modifiers=[0, 0x51]) +add_insn("vsqrtpd", "avx_xmm_xmm128", modifiers=[0x66, 0x51]) +add_insn("vcvtdq2ps", "avx_xmm_xmm128", modifiers=[0, 0x5B]) +add_insn("vcvtps2dq", "avx_xmm_xmm128", modifiers=[0x66, 0x5B]) +add_insn("vcvttps2dq", "avx_xmm_xmm128", modifiers=[0xF3, 0x5B]) + +add_group("avx_sse4imm", + cpu=["SSE41"], + modifiers=["Op2Add"], + vex=128, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("avx_sse4imm", + cpu=["AVX"], + modifiers=["Op2Add"], + vex=128, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("avx_sse4imm", + cpu=["AVX"], + modifiers=["Op2Add"], + vex=256, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="SIMDRM", size=256, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + +add_insn("vroundpd", "avx_sse4imm", modifiers=[0x09]) +add_insn("vroundps", "avx_sse4imm", modifiers=[0x08]) + +add_group("vmovddup", + cpu=["AVX"], + modifiers=["PreAdd", "Op1Add"], + vex=128, + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), + Operand(type="SIMDReg", size=128, dest="EA")]) +add_group("vmovddup", + cpu=["AVX"], + modifiers=["PreAdd", "Op1Add"], + vex=128, + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), + Operand(type="Mem", size=64, relaxed=True, dest="EA")]) +add_group("vmovddup", + cpu=["AVX"], + modifiers=["PreAdd", "Op1Add"], + vex=256, + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="SIMDRM", size=256, relaxed=True, dest="EA")]) + +add_insn("vmovddup", "vmovddup", modifiers=[0xF2, 0x12]) + +# Some conversion functions take ymm, xmm combination +add_group("avx_cvt_xmm64", + cpu=["AVX"], + modifiers=["PreAdd", "Op1Add"], + vex=128, + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA")]) +add_group("avx_cvt_xmm64", + cpu=["AVX"], + modifiers=["PreAdd", "Op1Add"], + vex=128, + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Mem", size=64, relaxed=True, dest="EA")]) +add_group("avx_cvt_xmm64", + cpu=["AVX"], + modifiers=["PreAdd", "Op1Add"], + vex=256, + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) + +add_insn("vcvtdq2pd", "avx_cvt_xmm64", modifiers=[0xF3, 0xE6]) +add_insn("vcvtps2pd", "avx_cvt_xmm64", modifiers=[0, 0x5A]) + +# Some conversion functions take xmm, ymm combination +# Need separate x and y versions for gas mode +add_group("avx_cvt_xmm128_x", + cpu=["AVX"], + modifiers=["PreAdd", "Op1Add"], + vex=128, + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) +add_group("avx_cvt_xmm128_y", + cpu=["AVX"], + modifiers=["PreAdd", "Op1Add"], + vex=256, + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=256, relaxed=True, dest="EA")]) + +add_group("avx_cvt_xmm128", + cpu=["AVX"], + modifiers=["PreAdd", "Op1Add"], + vex=128, + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, dest="EA")]) +add_group("avx_cvt_xmm128", + cpu=["AVX"], + modifiers=["PreAdd", "Op1Add"], + vex=256, + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=256, dest="EA")]) + +add_insn("vcvtpd2dqx", "avx_cvt_xmm128_x", modifiers=[0xF2, 0xE6], parser="gas") +add_insn("vcvtpd2dqy", "avx_cvt_xmm128_y", modifiers=[0xF2, 0xE6], parser="gas") +add_insn("vcvtpd2dq", "avx_cvt_xmm128", modifiers=[0xF2, 0xE6]) + +add_insn("vcvtpd2psx", "avx_cvt_xmm128_x", modifiers=[0x66, 0x5A], parser="gas") +add_insn("vcvtpd2psy", "avx_cvt_xmm128_y", modifiers=[0x66, 0x5A], parser="gas") +add_insn("vcvtpd2ps", "avx_cvt_xmm128", modifiers=[0x66, 0x5A]) + +add_insn("vcvttpd2dqx", "avx_cvt_xmm128_x", modifiers=[0x66, 0xE6], parser="gas") +add_insn("vcvttpd2dqy", "avx_cvt_xmm128_y", modifiers=[0x66, 0xE6], parser="gas") +add_insn("vcvttpd2dq", "avx_cvt_xmm128", modifiers=[0x66, 0xE6]) + +# Instructions new to AVX +add_insn("vptestps", "sse4", modifiers=[0x0E, VEXL0], avx=True) +add_insn("vptestpd", "sse4", modifiers=[0x0F, VEXL0], avx=True) + +add_group("vbroadcastss", + cpu=["AVX"], + vex=128, + prefix=0x66, + opcode=[0x0F, 0x38, 0x18], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Mem", size=32, relaxed=True, dest="EA")]) +add_group("vbroadcastss", + cpu=["AVX"], + vex=256, + prefix=0x66, + opcode=[0x0F, 0x38, 0x18], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="Mem", size=32, relaxed=True, dest="EA")]) + +add_insn("vbroadcastss", "vbroadcastss") + +add_group("vbroadcastsd", + cpu=["AVX"], + vex=256, + prefix=0x66, + opcode=[0x0F, 0x38, 0x19], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="Mem", size=64, relaxed=True, dest="EA")]) + +add_insn("vbroadcastsd", "vbroadcastsd") + +add_group("vbroadcastf128", + cpu=["AVX"], + vex=256, + prefix=0x66, + opcode=[0x0F, 0x38, 0x1A], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="Mem", size=128, relaxed=True, dest="EA")]) + +add_insn("vbroadcastf128", "vbroadcastf128") + +add_group("vextractf128", + cpu=["AVX"], + vex=256, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x19], + operands=[Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + +add_insn("vextractf128", "vextractf128") + +add_group("vinsertf128", + cpu=["AVX"], + vex=256, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x18], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="SIMDReg", size=256, dest="VEX"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + +add_insn("vinsertf128", "vinsertf128") + +add_group("vzero", + cpu=["AVX"], + modifiers=["SetVEX"], + opcode=[0x0F, 0x77], + operands=[]) + +add_insn("vzeroall", "vzero", modifiers=[VEXL1]) +add_insn("vzeroupper", "vzero", modifiers=[VEXL0]) + +add_group("vmaskmov", + cpu=["AVX"], + modifiers=["Op2Add"], + vex=128, + prefix=0x66, + opcode=[0x0F, 0x38, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) +add_group("vmaskmov", + cpu=["AVX"], + modifiers=["Op2Add"], + vex=256, + prefix=0x66, + opcode=[0x0F, 0x38, 0x00], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="SIMDReg", size=256, dest="VEX"), + Operand(type="SIMDRM", size=256, relaxed=True, dest="EA")]) +add_group("vmaskmov", + cpu=["AVX"], + modifiers=["Op2Add"], + vex=128, + prefix=0x66, + opcode=[0x0F, 0x38, 0x02], + operands=[Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDReg", size=128, dest="Spare")]) +add_group("vmaskmov", + cpu=["AVX"], + modifiers=["Op2Add"], + vex=256, + prefix=0x66, + opcode=[0x0F, 0x38, 0x02], + operands=[Operand(type="SIMDRM", size=256, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=256, dest="VEX"), + Operand(type="SIMDReg", size=256, dest="Spare")]) + +add_insn("vmaskmovps", "vmaskmov", modifiers=[0x2C]) +add_insn("vmaskmovpd", "vmaskmov", modifiers=[0x2D]) + +add_group("vpermil", + cpu=["AVX"], + modifiers=["Op2Add"], + vex=128, + prefix=0x66, + opcode=[0x0F, 0x38, 0x08], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) +add_group("vpermil", + cpu=["AVX"], + modifiers=["Op2Add"], + vex=256, + prefix=0x66, + opcode=[0x0F, 0x38, 0x08], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="SIMDReg", size=256, dest="VEX"), + Operand(type="SIMDRM", size=256, relaxed=True, dest="EA")]) +add_group("vpermil", + cpu=["AVX"], + modifiers=["Op2Add"], + vex=128, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("vpermil", + cpu=["AVX"], + modifiers=["Op2Add"], + vex=256, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="SIMDRM", size=256, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + +add_insn("vpermilpd", "vpermil", modifiers=[0x05]) +add_insn("vpermilps", "vpermil", modifiers=[0x04]) + +add_group("vpermil2", + cpu=["AVX"], + modifiers=["Op2Add"], + vex=128, + vexw=0, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="VEXImmSrc"), + Operand(type="Imm", dest="VEXImm")]) +add_group("vpermil2", + cpu=["AVX"], + modifiers=["Op2Add"], + vex=256, + vexw=1, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDReg", size=128, dest="VEXImmSrc"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="Imm", dest="VEXImm")]) +add_group("vpermil2", + cpu=["AVX"], + modifiers=["Op2Add"], + vex=256, + vexw=0, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="SIMDReg", size=256, dest="VEX"), + Operand(type="SIMDRM", size=256, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=256, dest="VEXImmSrc"), + Operand(type="Imm", dest="VEXImm")]) +add_group("vpermil2", + cpu=["AVX"], + modifiers=["Op2Add"], + vex=256, + vexw=1, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="SIMDReg", size=256, dest="VEX"), + Operand(type="SIMDReg", size=256, dest="VEXImmSrc"), + Operand(type="SIMDRM", size=256, relaxed=True, dest="EA"), + Operand(type="Imm", dest="VEXImm")]) + +add_insn("vpermil2pd", "vpermil2", modifiers=[0x49]) +add_insn("vpermil2ps", "vpermil2", modifiers=[0x48]) + +# Immediate aliases for the above +add_group("vpermil2_fixed", + cpu=["AVX"], + modifiers=["Op2Add", "Imm8"], + vex=128, + vexw=0, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="VEXImmSrc")]) +add_group("vpermil2_fixed", + cpu=["AVX"], + modifiers=["Op2Add", "Imm8"], + vex=256, + vexw=1, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDReg", size=128, dest="VEXImmSrc"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) +add_group("vpermil2_fixed", + cpu=["AVX"], + modifiers=["Op2Add", "Imm8"], + vex=256, + vexw=0, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="SIMDReg", size=256, dest="VEX"), + Operand(type="SIMDRM", size=256, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=256, dest="VEXImmSrc")]) +add_group("vpermil2_fixed", + cpu=["AVX"], + modifiers=["Op2Add", "Imm8"], + vex=256, + vexw=1, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="SIMDReg", size=256, dest="VEX"), + Operand(type="SIMDReg", size=256, dest="VEXImmSrc"), + Operand(type="SIMDRM", size=256, relaxed=True, dest="EA")]) + +for ib, cc in [(0, "td"), (2, "mo"), (3, "mz")]: + add_insn("vpermil"+cc+"2pd", "vpermil2_fixed", modifiers=[0x49, ib]) + add_insn("vpermil"+cc+"2ps", "vpermil2_fixed", modifiers=[0x48, ib]) + +add_group("vperm2f128", + cpu=["AVX"], + vex=256, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x06], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="SIMDReg", size=256, dest="VEX"), + Operand(type="SIMDRM", size=256, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + +add_insn("vperm2f128", "vperm2f128") + +##################################################################### +# Intel FMA instructions +##################################################################### + +add_group("fma_128_256", + cpu=["FMA"], + modifiers=["Op2Add"], + vex=128, + vexw=0, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="VEXImmSrc")]) +add_group("fma_128_256", + cpu=["FMA"], + modifiers=["Op2Add"], + vex=128, + vexw=1, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDReg", size=128, dest="VEXImmSrc"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) +add_group("fma_128_256", + cpu=["FMA"], + modifiers=["Op2Add"], + vex=256, + vexw=0, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="SIMDReg", size=256, dest="VEX"), + Operand(type="SIMDRM", size=256, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=256, dest="VEXImmSrc")]) +add_group("fma_128_256", + cpu=["FMA"], + modifiers=["Op2Add"], + vex=256, + vexw=1, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="SIMDReg", size=256, dest="VEX"), + Operand(type="SIMDReg", size=256, dest="VEXImmSrc"), + Operand(type="SIMDRM", size=256, relaxed=True, dest="EA")]) + +add_insn("vfmaddpd", "fma_128_256", modifiers=[0x69]) +add_insn("vfmaddps", "fma_128_256", modifiers=[0x68]) +add_insn("vfmaddsubpd", "fma_128_256", modifiers=[0x5D]) +add_insn("vfmaddsubps", "fma_128_256", modifiers=[0x5C]) +add_insn("vfmsubaddpd", "fma_128_256", modifiers=[0x5F]) +add_insn("vfmsubaddps", "fma_128_256", modifiers=[0x5E]) +add_insn("vfmsubpd", "fma_128_256", modifiers=[0x6D]) +add_insn("vfmsubps", "fma_128_256", modifiers=[0x6C]) +add_insn("vfnmaddpd", "fma_128_256", modifiers=[0x79]) +add_insn("vfnmaddps", "fma_128_256", modifiers=[0x78]) +add_insn("vfnmsubpd", "fma_128_256", modifiers=[0x7D]) +add_insn("vfnmsubps", "fma_128_256", modifiers=[0x7C]) + +for sz in [32, 64]: + add_group("fma_128_m%d" % sz, + cpu=["FMA"], + modifiers=["Op2Add"], + vex=128, + vexw=0, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDReg", size=128, dest="EA"), + Operand(type="SIMDReg", size=128, dest="VEXImmSrc")]) + add_group("fma_128_m%d" % sz, + cpu=["FMA"], + modifiers=["Op2Add"], + vex=128, + vexw=0, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="Mem", size=sz, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="VEXImmSrc")]) + add_group("fma_128_m%d" % sz, + cpu=["FMA"], + modifiers=["Op2Add"], + vex=128, + vexw=1, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDReg", size=128, dest="VEXImmSrc"), + Operand(type="Mem", size=sz, relaxed=True, dest="EA")]) + +add_insn("vfmaddsd", "fma_128_m64", modifiers=[0x6B]) +add_insn("vfmaddss", "fma_128_m32", modifiers=[0x6A]) +add_insn("vfmsubsd", "fma_128_m64", modifiers=[0x6F]) +add_insn("vfmsubss", "fma_128_m32", modifiers=[0x6E]) +add_insn("vfnmaddsd", "fma_128_m64", modifiers=[0x7B]) +add_insn("vfnmaddss", "fma_128_m32", modifiers=[0x7A]) +add_insn("vfnmsubsd", "fma_128_m64", modifiers=[0x7F]) +add_insn("vfnmsubss", "fma_128_m32", modifiers=[0x7E]) + +##################################################################### +# Intel AES instructions +##################################################################### + +add_group("aes", + cpu=["AES"], + modifiers=["Op1Add", "Op2Add"], + prefix=0x66, + opcode=[0x0F, 0x00, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) + +add_insn("aesenc", "aes", modifiers=[0x38, 0xDC]) +add_insn("aesenclast", "aes", modifiers=[0x38, 0xDD]) +add_insn("aesdec", "aes", modifiers=[0x38, 0xDE]) +add_insn("aesdeclast", "aes", modifiers=[0x38, 0xDF]) +add_insn("aesimc", "aes", modifiers=[0x38, 0xDB]) + +add_group("aes_imm", + cpu=["AES"], + modifiers=["Op1Add", "Op2Add"], + prefix=0x66, + opcode=[0x0F, 0x00, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + +add_insn("aeskeygenassist", "aes_imm", modifiers=[0x3A, 0xDF]) + +##################################################################### +# Intel PCLMULQDQ instruction +##################################################################### + +add_insn("pclmulqdq", "aes_imm", modifiers=[0x3A, 0x44], cpu=["CLMUL"]) + +add_group("pclmulqdq_fixed", + cpu=["CLMUL"], + modifiers=["Imm8"], + prefix=0x66, + opcode=[0x0F, 0x3A, 0x44], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) + +add_insn("pclmullqlqdq", "pclmulqdq_fixed", modifiers=[0x00]) +add_insn("pclmulhqlqdq", "pclmulqdq_fixed", modifiers=[0x01]) +add_insn("pclmullqhqdq", "pclmulqdq_fixed", modifiers=[0x10]) +add_insn("pclmulhqhqdq", "pclmulqdq_fixed", modifiers=[0x11]) + ##################################################################### # AMD SSE4a instructions ##################################################################### diff --git a/modules/arch/x86/tests/Makefile.inc b/modules/arch/x86/tests/Makefile.inc index 09256a7d..a324aa53 100644 --- a/modules/arch/x86/tests/Makefile.inc +++ b/modules/arch/x86/tests/Makefile.inc @@ -11,15 +11,23 @@ EXTRA_DIST += modules/arch/x86/tests/addrop.errwarn EXTRA_DIST += modules/arch/x86/tests/addrop.hex EXTRA_DIST += modules/arch/x86/tests/addrop-err.asm EXTRA_DIST += modules/arch/x86/tests/addrop-err.errwarn +EXTRA_DIST += modules/arch/x86/tests/aes.asm +EXTRA_DIST += modules/arch/x86/tests/aes.hex EXTRA_DIST += modules/arch/x86/tests/amd200707.asm EXTRA_DIST += modules/arch/x86/tests/amd200707.hex EXTRA_DIST += modules/arch/x86/tests/arithsmall.asm EXTRA_DIST += modules/arch/x86/tests/arithsmall.errwarn EXTRA_DIST += modules/arch/x86/tests/arithsmall.hex +EXTRA_DIST += modules/arch/x86/tests/avx.asm +EXTRA_DIST += modules/arch/x86/tests/avx.hex +EXTRA_DIST += modules/arch/x86/tests/avxcc.asm +EXTRA_DIST += modules/arch/x86/tests/avxcc.hex EXTRA_DIST += modules/arch/x86/tests/bittest.asm EXTRA_DIST += modules/arch/x86/tests/bittest.hex EXTRA_DIST += modules/arch/x86/tests/bswap64.asm EXTRA_DIST += modules/arch/x86/tests/bswap64.hex +EXTRA_DIST += modules/arch/x86/tests/clmul.asm +EXTRA_DIST += modules/arch/x86/tests/clmul.hex EXTRA_DIST += modules/arch/x86/tests/cmpxchg.asm EXTRA_DIST += modules/arch/x86/tests/cmpxchg.hex EXTRA_DIST += modules/arch/x86/tests/cpubasic-err.asm @@ -51,6 +59,8 @@ EXTRA_DIST += modules/arch/x86/tests/farithr.asm EXTRA_DIST += modules/arch/x86/tests/farithr.hex EXTRA_DIST += modules/arch/x86/tests/fcmov.asm EXTRA_DIST += modules/arch/x86/tests/fcmov.hex +EXTRA_DIST += modules/arch/x86/tests/fma.asm +EXTRA_DIST += modules/arch/x86/tests/fma.hex EXTRA_DIST += modules/arch/x86/tests/fwdequ64.asm EXTRA_DIST += modules/arch/x86/tests/fwdequ64.hex EXTRA_DIST += modules/arch/x86/tests/genopcode.asm @@ -200,6 +210,8 @@ EXTRA_DIST += modules/arch/x86/tests/vmx.asm EXTRA_DIST += modules/arch/x86/tests/vmx.hex EXTRA_DIST += modules/arch/x86/tests/vmx-err.asm EXTRA_DIST += modules/arch/x86/tests/vmx-err.errwarn +EXTRA_DIST += modules/arch/x86/tests/vpermil2.asm +EXTRA_DIST += modules/arch/x86/tests/vpermil2.hex EXTRA_DIST += modules/arch/x86/tests/x86label.asm EXTRA_DIST += modules/arch/x86/tests/x86label.hex EXTRA_DIST += modules/arch/x86/tests/xchg64.asm diff --git a/modules/arch/x86/tests/aes.asm b/modules/arch/x86/tests/aes.asm new file mode 100644 index 00000000..7f514eca --- /dev/null +++ b/modules/arch/x86/tests/aes.asm @@ -0,0 +1,49 @@ +[bits 64] +aesenc xmm1, xmm2 +aesenc xmm1, [rax] +aesenc xmm1, dqword [rax] +aesenc xmm10, xmm12 +aesenc xmm10, [rax+r15*4] +aesenc xmm10, [r14+r15*4] + +aesenclast xmm1, xmm2 +aesenclast xmm1, [rax] +aesenclast xmm1, dqword [rax] + +aesdec xmm1, xmm2 +aesdec xmm1, [rax] +aesdec xmm1, dqword [rax] + +aesdeclast xmm1, xmm2 +aesdeclast xmm1, [rax] +aesdeclast xmm1, dqword [rax] + +aesimc xmm1, xmm2 +aesimc xmm1, [rax] +aesimc xmm1, dqword [rax] + +aeskeygenassist xmm1, xmm2, 5 +aeskeygenassist xmm1, [rax], byte 5 +aeskeygenassist xmm1, dqword [rax], 5 + +pclmulqdq xmm1, xmm2, 5 +pclmulqdq xmm1, [rax], byte 5 +pclmulqdq xmm1, dqword [rax], 5 + +; pclmulqdq variants +pclmullqlqdq xmm1, xmm2 +pclmullqlqdq xmm1, [rax] +pclmullqlqdq xmm1, dqword [rax] + +pclmulhqlqdq xmm1, xmm2 +pclmulhqlqdq xmm1, [rax] +pclmulhqlqdq xmm1, dqword [rax] + +pclmullqhqdq xmm1, xmm2 +pclmullqhqdq xmm1, [rax] +pclmullqhqdq xmm1, dqword [rax] + +pclmulhqhqdq xmm1, xmm2 +pclmulhqhqdq xmm1, [rax] +pclmulhqhqdq xmm1, dqword [rax] + diff --git a/modules/arch/x86/tests/aes.hex b/modules/arch/x86/tests/aes.hex new file mode 100644 index 00000000..f87172c0 --- /dev/null +++ b/modules/arch/x86/tests/aes.hex @@ -0,0 +1,203 @@ +66 +0f +38 +dc +ca +66 +0f +38 +dc +08 +66 +0f +38 +dc +08 +66 +45 +0f +38 +dc +d4 +66 +46 +0f +38 +dc +14 +b8 +66 +47 +0f +38 +dc +14 +be +66 +0f +38 +dd +ca +66 +0f +38 +dd +08 +66 +0f +38 +dd +08 +66 +0f +38 +de +ca +66 +0f +38 +de +08 +66 +0f +38 +de +08 +66 +0f +38 +df +ca +66 +0f +38 +df +08 +66 +0f +38 +df +08 +66 +0f +38 +db +ca +66 +0f +38 +db +08 +66 +0f +38 +db +08 +66 +0f +3a +df +ca +05 +66 +0f +3a +df +08 +05 +66 +0f +3a +df +08 +05 +66 +0f +3a +44 +ca +05 +66 +0f +3a +44 +08 +05 +66 +0f +3a +44 +08 +05 +66 +0f +3a +44 +ca +00 +66 +0f +3a +44 +08 +00 +66 +0f +3a +44 +08 +00 +66 +0f +3a +44 +ca +01 +66 +0f +3a +44 +08 +01 +66 +0f +3a +44 +08 +01 +66 +0f +3a +44 +ca +10 +66 +0f +3a +44 +08 +10 +66 +0f +3a +44 +08 +10 +66 +0f +3a +44 +ca +11 +66 +0f +3a +44 +08 +11 +66 +0f +3a +44 +08 +11 diff --git a/modules/arch/x86/tests/avx.asm b/modules/arch/x86/tests/avx.asm new file mode 100644 index 00000000..45495033 --- /dev/null +++ b/modules/arch/x86/tests/avx.asm @@ -0,0 +1,2633 @@ +; Exhaustive test of AVX instructions +; Also includes based-upon SSE instructions for comparison +; +; Copyright (C) 2008 Peter Johnson +; +; Redistribution and use in source and binary forms, with or without +; modification, are permitted provided that the following conditions +; are met: +; 1. Redistributions of source code must retain the above copyright +; notice, this list of conditions and the following disclaimer. +; 2. Redistributions in binary form must reproduce the above copyright +; notice, this list of conditions and the following disclaimer in the +; documentation and/or other materials provided with the distribution. +; +; THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' +; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +; ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE +; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +; POSSIBILITY OF SUCH DAMAGE. +; + +[bits 64] +addpd xmm1, xmm2 +addpd xmm1, [rax] +addpd xmm1, dqword [rax] +addpd xmm10, xmm12 +addpd xmm10, [rax+r15*4] +addpd xmm10, [r14+r15*4] + +vaddpd xmm1, xmm2 +vaddpd xmm1, [rax] +vaddpd xmm1, dqword [rax] +vaddpd xmm10, xmm12 +vaddpd xmm10, [rax+r15*4] +vaddpd xmm10, [r14+r15*4] + +vaddpd xmm1, xmm2, xmm3 +vaddpd xmm1, xmm2, [rax] +vaddpd xmm1, xmm2, dqword [rax] +vaddpd xmm10, xmm12, xmm13 +vaddpd xmm10, xmm12, [rax+r15*4] +vaddpd xmm10, xmm12, [r14+r15*4] + +vaddpd ymm1, ymm2, ymm3 +vaddpd ymm1, ymm2, [rax] +vaddpd ymm1, ymm2, yword [rax] +vaddpd ymm10, ymm12, ymm13 +vaddpd ymm10, ymm12, [rax+r15*4] +vaddpd ymm10, ymm12, [r14+r15*4] + +; Further instructions won't test high 8 registers (validated above) +addps xmm1, xmm2 +addps xmm1, [rax] +addps xmm1, dqword [rax] +vaddps xmm1, xmm2 +vaddps xmm1, [rax] +vaddps xmm1, dqword [rax] +vaddps xmm1, xmm2, xmm3 +vaddps xmm1, xmm2, [rax] +vaddps xmm1, xmm2, dqword [rax] +vaddps ymm1, ymm2, ymm3 +vaddps ymm1, ymm2, [rax] +vaddps ymm1, ymm2, yword [rax] + +addsd xmm1, xmm2 +addsd xmm1, [rax] +addsd xmm1, qword [rax] +vaddsd xmm1, xmm2 +vaddsd xmm1, [rax] +vaddsd xmm1, qword [rax] +vaddsd xmm1, xmm2, xmm3 +vaddsd xmm1, xmm2, [rax] +vaddsd xmm1, xmm2, qword [rax] + +addss xmm1, xmm2 +addss xmm1, [rax] +addss xmm1, dword [rax] +vaddss xmm1, xmm2 +vaddss xmm1, [rax] +vaddss xmm1, dword [rax] +vaddss xmm1, xmm2, xmm3 +vaddss xmm1, xmm2, [rax] +vaddss xmm1, xmm2, dword [rax] + +addsubpd xmm1, xmm2 +addsubpd xmm1, [rax] +addsubpd xmm1, dqword [rax] +vaddsubpd xmm1, xmm2 +vaddsubpd xmm1, [rax] +vaddsubpd xmm1, dqword [rax] +vaddsubpd xmm1, xmm2, xmm3 +vaddsubpd xmm1, xmm2, [rax] +vaddsubpd xmm1, xmm2, dqword [rax] +vaddsubpd ymm1, ymm2, ymm3 +vaddsubpd ymm1, ymm2, [rax] +vaddsubpd ymm1, ymm2, yword [rax] + +addsubps xmm1, xmm2 +addsubps xmm1, [rax] +addsubps xmm1, dqword [rax] +vaddsubps xmm1, xmm2 +vaddsubps xmm1, [rax] +vaddsubps xmm1, dqword [rax] +vaddsubps xmm1, xmm2, xmm3 +vaddsubps xmm1, xmm2, [rax] +vaddsubps xmm1, xmm2, dqword [rax] +vaddsubps ymm1, ymm2, ymm3 +vaddsubps ymm1, ymm2, [rax] +vaddsubps ymm1, ymm2, yword [rax] + +andpd xmm1, xmm2 +andpd xmm1, [rax] +andpd xmm1, dqword [rax] +vandpd xmm1, xmm2 +vandpd xmm1, [rax] +vandpd xmm1, dqword [rax] +vandpd xmm1, xmm2, xmm3 +vandpd xmm1, xmm2, [rax] +vandpd xmm1, xmm2, dqword [rax] +vandpd ymm1, ymm2, ymm3 +vandpd ymm1, ymm2, [rax] +vandpd ymm1, ymm2, yword [rax] + +andps xmm1, xmm2 +andps xmm1, [rax] +andps xmm1, dqword [rax] +vandps xmm1, xmm2 +vandps xmm1, [rax] +vandps xmm1, dqword [rax] +vandps xmm1, xmm2, xmm3 +vandps xmm1, xmm2, [rax] +vandps xmm1, xmm2, dqword [rax] +vandps ymm1, ymm2, ymm3 +vandps ymm1, ymm2, [rax] +vandps ymm1, ymm2, yword [rax] + +andnpd xmm1, xmm2 +andnpd xmm1, [rax] +andnpd xmm1, dqword [rax] +vandnpd xmm1, xmm2 +vandnpd xmm1, [rax] +vandnpd xmm1, dqword [rax] +vandnpd xmm1, xmm2, xmm3 +vandnpd xmm1, xmm2, [rax] +vandnpd xmm1, xmm2, dqword [rax] +vandnpd ymm1, ymm2, ymm3 +vandnpd ymm1, ymm2, [rax] +vandnpd ymm1, ymm2, yword [rax] + +andnps xmm1, xmm2 +andnps xmm1, [rax] +andnps xmm1, dqword [rax] +vandnps xmm1, xmm2 +vandnps xmm1, [rax] +vandnps xmm1, dqword [rax] +vandnps xmm1, xmm2, xmm3 +vandnps xmm1, xmm2, [rax] +vandnps xmm1, xmm2, dqword [rax] +vandnps ymm1, ymm2, ymm3 +vandnps ymm1, ymm2, [rax] +vandnps ymm1, ymm2, yword [rax] + +blendpd xmm1, xmm2, 5 +blendpd xmm1, [rax], byte 5 +blendpd xmm1, dqword [rax], 5 +vblendpd xmm1, xmm2, 5 +vblendpd xmm1, [rax], byte 5 +vblendpd xmm1, dqword [rax], 5 +vblendpd xmm1, xmm2, xmm3, 5 +vblendpd xmm1, xmm2, [rax], byte 5 +vblendpd xmm1, xmm2, dqword [rax], 5 +vblendpd ymm1, ymm2, ymm3, 5 +vblendpd ymm1, ymm2, [rax], byte 5 +vblendpd ymm1, ymm2, yword [rax], 5 + +blendps xmm1, xmm2, 5 +blendps xmm1, [rax], byte 5 +blendps xmm1, dqword [rax], 5 +vblendps xmm1, xmm2, 5 +vblendps xmm1, [rax], byte 5 +vblendps xmm1, dqword [rax], 5 +vblendps xmm1, xmm2, xmm3, 5 +vblendps xmm1, xmm2, [rax], byte 5 +vblendps xmm1, xmm2, dqword [rax], 5 +vblendps ymm1, ymm2, ymm3, 5 +vblendps ymm1, ymm2, [rax], byte 5 +vblendps ymm1, ymm2, yword [rax], 5 + +; blendvpd doesn't have vex-encoded version of implicit xmm0 +blendvpd xmm1, xmm3 +blendvpd xmm1, [rax] +blendvpd xmm1, dqword [rax] +blendvpd xmm1, xmm3, xmm0 +blendvpd xmm1, [rax], xmm0 +blendvpd xmm1, dqword [rax], xmm0 +vblendvpd xmm1, xmm2, xmm3, xmm4 +vblendvpd xmm1, xmm2, [rax], xmm4 +vblendvpd xmm1, xmm2, dqword [rax], xmm4 +vblendvpd ymm1, ymm2, ymm3, ymm4 +vblendvpd ymm1, ymm2, [rax], ymm4 +vblendvpd ymm1, ymm2, yword [rax], ymm4 + +; blendvps doesn't have vex-encoded version of implicit xmm0 +blendvps xmm1, xmm3 +blendvps xmm1, [rax] +blendvps xmm1, dqword [rax] +blendvps xmm1, xmm3, xmm0 +blendvps xmm1, [rax], xmm0 +blendvps xmm1, dqword [rax], xmm0 +vblendvps xmm1, xmm2, xmm3, xmm4 +vblendvps xmm1, xmm2, [rax], xmm4 +vblendvps xmm1, xmm2, dqword [rax], xmm4 +vblendvps ymm1, ymm2, ymm3, ymm4 +vblendvps ymm1, ymm2, [rax], ymm4 +vblendvps ymm1, ymm2, yword [rax], ymm4 + +vbroadcastss xmm1, [rax] +vbroadcastss xmm1, dword [rax] +vbroadcastss ymm1, [rax] +vbroadcastss ymm1, dword [rax] + +vbroadcastsd ymm1, [rax] +vbroadcastsd ymm1, qword [rax] + +vbroadcastf128 ymm1, [rax] +vbroadcastf128 ymm1, dqword [rax] + +cmppd xmm1, xmm2, 5 +cmppd xmm1, [rax], byte 5 +cmppd xmm1, dqword [rax], 5 +vcmppd xmm1, xmm2, 5 +vcmppd xmm1, [rax], byte 5 +vcmppd xmm1, dqword [rax], 5 +vcmppd xmm1, xmm2, xmm3, 5 +vcmppd xmm1, xmm2, [rax], byte 5 +vcmppd xmm1, xmm2, dqword [rax], 5 +vcmppd ymm1, ymm2, ymm3, 5 +vcmppd ymm1, ymm2, [rax], byte 5 +vcmppd ymm1, ymm2, yword [rax], 5 + +cmpps xmm1, xmm2, 5 +cmpps xmm1, [rax], byte 5 +cmpps xmm1, dqword [rax], 5 +vcmpps xmm1, xmm2, 5 +vcmpps xmm1, [rax], byte 5 +vcmpps xmm1, dqword [rax], 5 +vcmpps xmm1, xmm2, xmm3, 5 +vcmpps xmm1, xmm2, [rax], byte 5 +vcmpps xmm1, xmm2, dqword [rax], 5 +vcmpps ymm1, ymm2, ymm3, 5 +vcmpps ymm1, ymm2, [rax], byte 5 +vcmpps ymm1, ymm2, yword [rax], 5 + +cmpsd xmm1, xmm2, 5 +cmpsd xmm1, [rax], byte 5 +cmpsd xmm1, qword [rax], 5 +vcmpsd xmm1, xmm2, 5 +vcmpsd xmm1, [rax], byte 5 +vcmpsd xmm1, qword [rax], 5 +vcmpsd xmm1, xmm2, xmm3, 5 +vcmpsd xmm1, xmm2, [rax], byte 5 +vcmpsd xmm1, xmm2, qword [rax], 5 + +cmpss xmm1, xmm2, 5 +cmpss xmm1, [rax], byte 5 +cmpss xmm1, dword [rax], 5 +vcmpss xmm1, xmm2, 5 +vcmpss xmm1, [rax], byte 5 +vcmpss xmm1, dword [rax], 5 +vcmpss xmm1, xmm2, xmm3, 5 +vcmpss xmm1, xmm2, [rax], byte 5 +vcmpss xmm1, xmm2, dword [rax], 5 + +comisd xmm1, xmm2 +comisd xmm1, [rax] +comisd xmm1, qword [rax] +vcomisd xmm1, xmm2 +vcomisd xmm1, [rax] +vcomisd xmm1, qword [rax] + +comiss xmm1, xmm2 +comiss xmm1, [rax] +comiss xmm1, dword [rax] +vcomiss xmm1, xmm2 +vcomiss xmm1, [rax] +vcomiss xmm1, dword [rax] + +cvtdq2pd xmm1, xmm2 +cvtdq2pd xmm1, [rax] +cvtdq2pd xmm1, qword [rax] +vcvtdq2pd xmm1, xmm2 +vcvtdq2pd xmm1, [rax] +vcvtdq2pd xmm1, qword [rax] +vcvtdq2pd ymm1, xmm2 +vcvtdq2pd ymm1, [rax] +vcvtdq2pd ymm1, dqword [rax] + +cvtdq2ps xmm1, xmm2 +cvtdq2ps xmm1, [rax] +cvtdq2ps xmm1, dqword [rax] +vcvtdq2ps xmm1, xmm2 +vcvtdq2ps xmm1, [rax] +vcvtdq2ps xmm1, dqword [rax] +vcvtdq2ps ymm1, ymm2 +vcvtdq2ps ymm1, [rax] +vcvtdq2ps ymm1, yword [rax] + +; These require memory operand size to be specified (in AVX version) +cvtpd2dq xmm1, xmm2 +cvtpd2dq xmm1, [rax] +cvtpd2dq xmm1, dqword [rax] +vcvtpd2dq xmm1, xmm2 +vcvtpd2dq xmm1, dqword [rax] +vcvtpd2dq xmm1, ymm2 +vcvtpd2dq xmm1, yword [rax] + +cvtpd2ps xmm1, xmm2 +cvtpd2ps xmm1, [rax] +cvtpd2ps xmm1, dqword [rax] +vcvtpd2ps xmm1, xmm2 +vcvtpd2ps xmm1, dqword [rax] +vcvtpd2ps xmm1, ymm2 +vcvtpd2ps xmm1, yword [rax] + +cvtps2dq xmm1, xmm2 +cvtps2dq xmm1, [rax] +cvtps2dq xmm1, dqword [rax] +vcvtps2dq xmm1, xmm2 +vcvtps2dq xmm1, [rax] +vcvtps2dq xmm1, dqword [rax] +vcvtps2dq ymm1, ymm2 +vcvtps2dq ymm1, [rax] +vcvtps2dq ymm1, yword [rax] + +cvtps2pd xmm1, xmm2 +cvtps2pd xmm1, [rax] +cvtps2pd xmm1, qword [rax] +vcvtps2pd xmm1, xmm2 +vcvtps2pd xmm1, [rax] +vcvtps2pd xmm1, qword [rax] +vcvtps2pd ymm1, xmm2 +vcvtps2pd ymm1, [rax] +vcvtps2pd ymm1, dqword [rax] + +cvtsd2si eax, xmm2 +cvtsd2si eax, [rax] +cvtsd2si eax, qword [rax] +vcvtsd2si eax, xmm2 +vcvtsd2si eax, [rax] +vcvtsd2si eax, qword [rax] +cvtsd2si rax, xmm2 +cvtsd2si rax, [rax] +cvtsd2si rax, qword [rax] +vcvtsd2si rax, xmm2 +vcvtsd2si rax, [rax] +vcvtsd2si rax, qword [rax] + +cvtsd2ss xmm1, xmm2 +cvtsd2ss xmm1, [rax] +cvtsd2ss xmm1, qword [rax] +vcvtsd2ss xmm1, xmm2 +vcvtsd2ss xmm1, [rax] +vcvtsd2ss xmm1, qword [rax] +vcvtsd2ss xmm1, xmm2, xmm3 +vcvtsd2ss xmm1, xmm2, [rax] +vcvtsd2ss xmm1, xmm2, qword [rax] + +; unsized not valid +cvtsi2sd xmm1, eax +cvtsi2sd xmm1, dword [rax] +vcvtsi2sd xmm1, eax +vcvtsi2sd xmm1, dword [rax] +vcvtsi2sd xmm1, xmm2, eax +vcvtsi2sd xmm1, xmm2, dword [rax] +cvtsi2sd xmm1, rax +cvtsi2sd xmm1, qword [rax] +vcvtsi2sd xmm1, rax +vcvtsi2sd xmm1, qword [rax] +vcvtsi2sd xmm1, xmm2, rax +vcvtsi2sd xmm1, xmm2, qword [rax] + +cvtsi2ss xmm1, eax +cvtsi2ss xmm1, dword [rax] +vcvtsi2ss xmm1, eax +vcvtsi2ss xmm1, dword [rax] +vcvtsi2ss xmm1, xmm2, eax +vcvtsi2ss xmm1, xmm2, dword [rax] +cvtsi2ss xmm1, rax +cvtsi2ss xmm1, qword [rax] +vcvtsi2ss xmm1, rax +vcvtsi2ss xmm1, qword [rax] +vcvtsi2ss xmm1, xmm2, rax +vcvtsi2ss xmm1, xmm2, qword [rax] + +cvtss2sd xmm1, xmm2 +cvtss2sd xmm1, [rax] +cvtss2sd xmm1, dword [rax] +vcvtss2sd xmm1, xmm2 +vcvtss2sd xmm1, [rax] +vcvtss2sd xmm1, dword [rax] +vcvtss2sd xmm1, xmm2, xmm3 +vcvtss2sd xmm1, xmm2, [rax] +vcvtss2sd xmm1, xmm2, dword [rax] + +cvtss2si eax, xmm2 +cvtss2si eax, [rax] +cvtss2si eax, dword [rax] +vcvtss2si eax, xmm2 +vcvtss2si eax, [rax] +vcvtss2si eax, dword [rax] +cvtss2si rax, xmm2 +cvtss2si rax, [rax] +cvtss2si rax, dword [rax] +vcvtss2si rax, xmm2 +vcvtss2si rax, [rax] +vcvtss2si rax, dword [rax] + +; These require memory operand size to be specified (in AVX version) +cvttpd2dq xmm1, xmm2 +cvttpd2dq xmm1, [rax] +cvttpd2dq xmm1, dqword [rax] +vcvttpd2dq xmm1, xmm2 +vcvttpd2dq xmm1, dqword [rax] +vcvttpd2dq xmm1, ymm2 +vcvttpd2dq xmm1, yword [rax] + +cvttps2dq xmm1, xmm2 +cvttps2dq xmm1, [rax] +cvttps2dq xmm1, dqword [rax] +vcvttps2dq xmm1, xmm2 +vcvttps2dq xmm1, [rax] +vcvttps2dq xmm1, dqword [rax] +vcvttps2dq ymm1, ymm2 +vcvttps2dq ymm1, [rax] +vcvttps2dq ymm1, yword [rax] + +cvttsd2si eax, xmm2 +cvttsd2si eax, [rax] +cvttsd2si eax, qword [rax] +vcvttsd2si eax, xmm2 +vcvttsd2si eax, [rax] +vcvttsd2si eax, qword [rax] +cvttsd2si rax, xmm2 +cvttsd2si rax, [rax] +cvttsd2si rax, qword [rax] +vcvttsd2si rax, xmm2 +vcvttsd2si rax, [rax] +vcvttsd2si rax, qword [rax] + +cvttss2si eax, xmm2 +cvttss2si eax, [rax] +cvttss2si eax, dword [rax] +vcvttss2si eax, xmm2 +vcvttss2si eax, [rax] +vcvttss2si eax, dword [rax] +cvttss2si rax, xmm2 +cvttss2si rax, [rax] +cvttss2si rax, dword [rax] +vcvttss2si rax, xmm2 +vcvttss2si rax, [rax] +vcvttss2si rax, dword [rax] + +divpd xmm1, xmm2 +divpd xmm1, [rax] +divpd xmm1, dqword [rax] +vdivpd xmm1, xmm2 +vdivpd xmm1, [rax] +vdivpd xmm1, dqword [rax] +vdivpd xmm1, xmm2, xmm3 +vdivpd xmm1, xmm2, [rax] +vdivpd xmm1, xmm2, dqword [rax] +vdivpd ymm1, ymm2, ymm3 +vdivpd ymm1, ymm2, [rax] +vdivpd ymm1, ymm2, yword [rax] + +divps xmm1, xmm2 +divps xmm1, [rax] +divps xmm1, dqword [rax] +vdivps xmm1, xmm2 +vdivps xmm1, [rax] +vdivps xmm1, dqword [rax] +vdivps xmm1, xmm2, xmm3 +vdivps xmm1, xmm2, [rax] +vdivps xmm1, xmm2, dqword [rax] +vdivps ymm1, ymm2, ymm3 +vdivps ymm1, ymm2, [rax] +vdivps ymm1, ymm2, yword [rax] + +divsd xmm1, xmm2 +divsd xmm1, [rax] +divsd xmm1, qword [rax] +vdivsd xmm1, xmm2 +vdivsd xmm1, [rax] +vdivsd xmm1, qword [rax] +vdivsd xmm1, xmm2, xmm3 +vdivsd xmm1, xmm2, [rax] +vdivsd xmm1, xmm2, qword [rax] + +divss xmm1, xmm2 +divss xmm1, [rax] +divss xmm1, dword [rax] +vdivss xmm1, xmm2 +vdivss xmm1, [rax] +vdivss xmm1, dword [rax] +vdivss xmm1, xmm2, xmm3 +vdivss xmm1, xmm2, [rax] +vdivss xmm1, xmm2, dword [rax] + +dppd xmm1, xmm2, 5 +dppd xmm1, [rax], byte 5 +dppd xmm1, dqword [rax], 5 +vdppd xmm1, xmm2, 5 +vdppd xmm1, [rax], byte 5 +vdppd xmm1, dqword [rax], 5 +vdppd xmm1, xmm2, xmm3, 5 +vdppd xmm1, xmm2, [rax], byte 5 +vdppd xmm1, xmm2, dqword [rax], 5 +; no ymm version + +dpps xmm1, xmm2, 5 +dpps xmm1, [rax], byte 5 +dpps xmm1, dqword [rax], 5 +vdpps xmm1, xmm2, 5 +vdpps xmm1, [rax], byte 5 +vdpps xmm1, dqword [rax], 5 +vdpps xmm1, xmm2, xmm3, 5 +vdpps xmm1, xmm2, [rax], byte 5 +vdpps xmm1, xmm2, dqword [rax], 5 +vdpps ymm1, ymm2, ymm3, 5 +vdpps ymm1, ymm2, [rax], byte 5 +vdpps ymm1, ymm2, yword [rax], 5 + +vextractf128 xmm1, ymm2, 5 +vextractf128 [rax], ymm2, byte 5 +vextractf128 dqword [rax], ymm2, 5 + +extractps eax, xmm1, 5 +extractps rax, xmm1, 5 +extractps [rax], xmm1, byte 5 +extractps dword [rax], xmm1, 5 +vextractps eax, xmm1, 5 +vextractps rax, xmm1, 5 +vextractps [rax], xmm1, byte 5 +vextractps dword [rax], xmm1, 5 + +haddpd xmm1, xmm2 +haddpd xmm1, [rax] +haddpd xmm1, dqword [rax] +vhaddpd xmm1, xmm2 +vhaddpd xmm1, [rax] +vhaddpd xmm1, dqword [rax] +vhaddpd xmm1, xmm2, xmm3 +vhaddpd xmm1, xmm2, [rax] +vhaddpd xmm1, xmm2, dqword [rax] +vhaddpd ymm1, ymm2, ymm3 +vhaddpd ymm1, ymm2, [rax] +vhaddpd ymm1, ymm2, yword [rax] + +haddps xmm1, xmm2 +haddps xmm1, [rax] +haddps xmm1, dqword [rax] +vhaddps xmm1, xmm2 +vhaddps xmm1, [rax] +vhaddps xmm1, dqword [rax] +vhaddps xmm1, xmm2, xmm3 +vhaddps xmm1, xmm2, [rax] +vhaddps xmm1, xmm2, dqword [rax] +vhaddps ymm1, ymm2, ymm3 +vhaddps ymm1, ymm2, [rax] +vhaddps ymm1, ymm2, yword [rax] + +hsubpd xmm1, xmm2 +hsubpd xmm1, [rax] +hsubpd xmm1, dqword [rax] +vhsubpd xmm1, xmm2 +vhsubpd xmm1, [rax] +vhsubpd xmm1, dqword [rax] +vhsubpd xmm1, xmm2, xmm3 +vhsubpd xmm1, xmm2, [rax] +vhsubpd xmm1, xmm2, dqword [rax] +vhsubpd ymm1, ymm2, ymm3 +vhsubpd ymm1, ymm2, [rax] +vhsubpd ymm1, ymm2, yword [rax] + +hsubps xmm1, xmm2 +hsubps xmm1, [rax] +hsubps xmm1, dqword [rax] +vhsubps xmm1, xmm2 +vhsubps xmm1, [rax] +vhsubps xmm1, dqword [rax] +vhsubps xmm1, xmm2, xmm3 +vhsubps xmm1, xmm2, [rax] +vhsubps xmm1, xmm2, dqword [rax] +vhsubps ymm1, ymm2, ymm3 +vhsubps ymm1, ymm2, [rax] +vhsubps ymm1, ymm2, yword [rax] + +vinsertf128 ymm1, ymm2, xmm3, 5 +vinsertf128 ymm1, ymm2, [rax], byte 5 +vinsertf128 ymm1, ymm2, dqword [rax], 5 + +insertps xmm1, xmm2, 5 +insertps xmm1, [rax], byte 5 +insertps xmm1, dword [rax], 5 +vinsertps xmm1, xmm2, 5 +vinsertps xmm1, [rax], byte 5 +vinsertps xmm1, dword [rax], 5 +vinsertps xmm1, xmm2, xmm3, 5 +vinsertps xmm1, xmm2, [rax], byte 5 +vinsertps xmm1, xmm2, dword [rax], 5 + +lddqu xmm1, [rax] +lddqu xmm1, dqword [rax] +vlddqu xmm1, [rax] +vlddqu xmm1, dqword [rax] +vlddqu ymm1, [rax] +vlddqu ymm1, yword [rax] + +ldmxcsr [rax] +ldmxcsr dword [rax] +vldmxcsr [rax] +vldmxcsr dword [rax] + +maskmovdqu xmm1, xmm2 +vmaskmovdqu xmm1, xmm2 + +vmaskmovps xmm1, xmm2, [rax] +vmaskmovps xmm1, xmm2, dqword [rax] +vmaskmovps ymm1, ymm2, [rax] +vmaskmovps ymm1, ymm2, yword [rax] +vmaskmovps [rax], xmm2, xmm3 +vmaskmovps dqword [rax], xmm2, xmm3 +vmaskmovps [rax], ymm2, ymm3 +vmaskmovps yword [rax], ymm2, ymm3 + +vmaskmovpd xmm1, xmm2, [rax] +vmaskmovpd xmm1, xmm2, dqword [rax] +vmaskmovpd ymm1, ymm2, [rax] +vmaskmovpd ymm1, ymm2, yword [rax] +vmaskmovpd [rax], xmm2, xmm3 +vmaskmovpd dqword [rax], xmm2, xmm3 +vmaskmovpd [rax], ymm2, ymm3 +vmaskmovpd yword [rax], ymm2, ymm3 + +maxpd xmm1, xmm2 +maxpd xmm1, [rax] +maxpd xmm1, dqword [rax] +vmaxpd xmm1, xmm2 +vmaxpd xmm1, [rax] +vmaxpd xmm1, dqword [rax] +vmaxpd xmm1, xmm2, xmm3 +vmaxpd xmm1, xmm2, [rax] +vmaxpd xmm1, xmm2, dqword [rax] +vmaxpd ymm1, ymm2, ymm3 +vmaxpd ymm1, ymm2, [rax] +vmaxpd ymm1, ymm2, yword [rax] + +maxps xmm1, xmm2 +maxps xmm1, [rax] +maxps xmm1, dqword [rax] +vmaxps xmm1, xmm2 +vmaxps xmm1, [rax] +vmaxps xmm1, dqword [rax] +vmaxps xmm1, xmm2, xmm3 +vmaxps xmm1, xmm2, [rax] +vmaxps xmm1, xmm2, dqword [rax] +vmaxps ymm1, ymm2, ymm3 +vmaxps ymm1, ymm2, [rax] +vmaxps ymm1, ymm2, yword [rax] + +maxsd xmm1, xmm2 +maxsd xmm1, [rax] +maxsd xmm1, qword [rax] +vmaxsd xmm1, xmm2 +vmaxsd xmm1, [rax] +vmaxsd xmm1, qword [rax] +vmaxsd xmm1, xmm2, xmm3 +vmaxsd xmm1, xmm2, [rax] +vmaxsd xmm1, xmm2, qword [rax] + +maxss xmm1, xmm2 +maxss xmm1, [rax] +maxss xmm1, dword [rax] +vmaxss xmm1, xmm2 +vmaxss xmm1, [rax] +vmaxss xmm1, dword [rax] +vmaxss xmm1, xmm2, xmm3 +vmaxss xmm1, xmm2, [rax] +vmaxss xmm1, xmm2, dword [rax] + +minpd xmm1, xmm2 +minpd xmm1, [rax] +minpd xmm1, dqword [rax] +vminpd xmm1, xmm2 +vminpd xmm1, [rax] +vminpd xmm1, dqword [rax] +vminpd xmm1, xmm2, xmm3 +vminpd xmm1, xmm2, [rax] +vminpd xmm1, xmm2, dqword [rax] +vminpd ymm1, ymm2, ymm3 +vminpd ymm1, ymm2, [rax] +vminpd ymm1, ymm2, yword [rax] + +minps xmm1, xmm2 +minps xmm1, [rax] +minps xmm1, dqword [rax] +vminps xmm1, xmm2 +vminps xmm1, [rax] +vminps xmm1, dqword [rax] +vminps xmm1, xmm2, xmm3 +vminps xmm1, xmm2, [rax] +vminps xmm1, xmm2, dqword [rax] +vminps ymm1, ymm2, ymm3 +vminps ymm1, ymm2, [rax] +vminps ymm1, ymm2, yword [rax] + +minsd xmm1, xmm2 +minsd xmm1, [rax] +minsd xmm1, qword [rax] +vminsd xmm1, xmm2 +vminsd xmm1, [rax] +vminsd xmm1, qword [rax] +vminsd xmm1, xmm2, xmm3 +vminsd xmm1, xmm2, [rax] +vminsd xmm1, xmm2, qword [rax] + +minss xmm1, xmm2 +minss xmm1, [rax] +minss xmm1, dword [rax] +vminss xmm1, xmm2 +vminss xmm1, [rax] +vminss xmm1, dword [rax] +vminss xmm1, xmm2, xmm3 +vminss xmm1, xmm2, [rax] +vminss xmm1, xmm2, dword [rax] + +movapd xmm1, xmm2 +movapd xmm1, [rax] +movapd xmm1, dqword [rax] +vmovapd xmm1, xmm2 +vmovapd xmm1, [rax] +vmovapd xmm1, dqword [rax] +movapd [rax], xmm2 +movapd dqword [rax], xmm2 +vmovapd [rax], xmm2 +vmovapd dqword [rax], xmm2 +vmovapd ymm1, ymm2 +vmovapd ymm1, [rax] +vmovapd ymm1, yword [rax] +vmovapd [rax], ymm2 +vmovapd yword [rax], ymm2 + +movaps xmm1, xmm2 +movaps xmm1, [rax] +movaps xmm1, dqword [rax] +vmovaps xmm1, xmm2 +vmovaps xmm1, [rax] +vmovaps xmm1, dqword [rax] +movaps [rax], xmm2 +movaps dqword [rax], xmm2 +vmovaps [rax], xmm2 +vmovaps dqword [rax], xmm2 +vmovaps ymm1, ymm2 +vmovaps ymm1, [rax] +vmovaps ymm1, yword [rax] +vmovaps [rax], ymm2 +vmovaps yword [rax], ymm2 + +movd xmm1, eax +movd xmm1, [rax] +movd xmm1, dword [rax] +vmovd xmm1, eax +vmovd xmm1, [rax] +vmovd xmm1, dword [rax] +movd eax, xmm2 +movd [rax], xmm2 +movd dword [rax], xmm2 +vmovd eax, xmm2 +vmovd [rax], xmm2 +vmovd dword [rax], xmm2 + +movq xmm1, rax +movq xmm1, [rax] +movq xmm1, qword [rax] +vmovq xmm1, rax +vmovq xmm1, [rax] +vmovq xmm1, qword [rax] +movq rax, xmm2 +movq [rax], xmm2 +movq qword [rax], xmm2 +vmovq rax, xmm2 +vmovq [rax], xmm2 +vmovq qword [rax], xmm2 + +movq xmm1, xmm2 +movq xmm1, [rax] +movq xmm1, qword [rax] +vmovq xmm1, xmm2 +vmovq xmm1, [rax] +vmovq xmm1, qword [rax] +movq [rax], xmm1 +movq qword [rax], xmm1 +vmovq [rax], xmm1 +vmovq qword [rax], xmm1 + +movddup xmm1, xmm2 +movddup xmm1, [rax] +movddup xmm1, qword [rax] +vmovddup xmm1, xmm2 +vmovddup xmm1, [rax] +vmovddup xmm1, qword [rax] +vmovddup ymm1, ymm2 +vmovddup ymm1, [rax] +vmovddup ymm1, yword [rax] + +movdqa xmm1, xmm2 +movdqa xmm1, [rax] +movdqa xmm1, dqword [rax] +movdqa [rax], xmm2 +movdqa dqword [rax], xmm2 +vmovdqa xmm1, xmm2 +vmovdqa xmm1, [rax] +vmovdqa xmm1, dqword [rax] +vmovdqa [rax], xmm2 +vmovdqa dqword [rax], xmm2 +vmovdqa ymm1, ymm2 +vmovdqa ymm1, [rax] +vmovdqa ymm1, yword [rax] +vmovdqa [rax], ymm2 +vmovdqa yword [rax], ymm2 + +movdqu xmm1, xmm2 +movdqu xmm1, [rax] +movdqu xmm1, dqword [rax] +movdqu [rax], xmm2 +movdqu dqword [rax], xmm2 +vmovdqu xmm1, xmm2 +vmovdqu xmm1, [rax] +vmovdqu xmm1, dqword [rax] +vmovdqu [rax], xmm2 +vmovdqu dqword [rax], xmm2 +vmovdqu ymm1, ymm2 +vmovdqu ymm1, [rax] +vmovdqu ymm1, yword [rax] +vmovdqu [rax], ymm2 +vmovdqu yword [rax], ymm2 + +movhlps xmm1, xmm2 +vmovhlps xmm1, xmm2 +vmovhlps xmm1, xmm2, xmm3 + +movhpd xmm1, [rax] +movhpd xmm1, qword [rax] +vmovhpd xmm1, [rax] +vmovhpd xmm1, qword [rax] +vmovhpd xmm1, xmm2, [rax] +vmovhpd xmm1, xmm2, qword [rax] +movhpd [rax], xmm2 +movhpd qword [rax], xmm2 +vmovhpd [rax], xmm2 +vmovhpd qword [rax], xmm2 + +movhps xmm1, [rax] +movhps xmm1, qword [rax] +vmovhps xmm1, [rax] +vmovhps xmm1, qword [rax] +vmovhps xmm1, xmm2, [rax] +vmovhps xmm1, xmm2, qword [rax] +movhps [rax], xmm2 +movhps qword [rax], xmm2 +vmovhps [rax], xmm2 +vmovhps qword [rax], xmm2 + +movhlps xmm1, xmm2 +vmovhlps xmm1, xmm2 +vmovhlps xmm1, xmm2, xmm3 + +movlpd xmm1, [rax] +movlpd xmm1, qword [rax] +vmovlpd xmm1, [rax] +vmovlpd xmm1, qword [rax] +vmovlpd xmm1, xmm2, [rax] +vmovlpd xmm1, xmm2, qword [rax] +movlpd [rax], xmm2 +movlpd qword [rax], xmm2 +vmovlpd [rax], xmm2 +vmovlpd qword [rax], xmm2 + +movlps xmm1, [rax] +movlps xmm1, qword [rax] +vmovlps xmm1, [rax] +vmovlps xmm1, qword [rax] +vmovlps xmm1, xmm2, [rax] +vmovlps xmm1, xmm2, qword [rax] +movlps [rax], xmm2 +movlps qword [rax], xmm2 +vmovlps [rax], xmm2 +vmovlps qword [rax], xmm2 + +movmskpd eax, xmm2 +movmskpd rax, xmm2 +vmovmskpd eax, xmm2 +vmovmskpd rax, xmm2 +vmovmskpd eax, ymm2 +vmovmskpd rax, ymm2 + +movmskps eax, xmm2 +movmskps rax, xmm2 +vmovmskps eax, xmm2 +vmovmskps rax, xmm2 +vmovmskps eax, ymm2 +vmovmskps rax, ymm2 + +movntdq [rax], xmm1 +movntdq dqword [rax], xmm1 +vmovntdq [rax], xmm1 +vmovntdq dqword [rax], xmm1 + +movntdqa xmm1, [rax] +movntdqa xmm1, dqword [rax] +vmovntdqa xmm1, [rax] +vmovntdqa xmm1, dqword [rax] + +movntpd [rax], xmm1 +movntpd dqword [rax], xmm1 +vmovntpd [rax], xmm1 +vmovntpd dqword [rax], xmm1 + +movntps [rax], xmm1 +movntps dqword [rax], xmm1 +vmovntps [rax], xmm1 +vmovntps dqword [rax], xmm1 + +movsd xmm1, xmm2 +vmovsd xmm1, xmm2 +vmovsd xmm1, xmm2, xmm3 +movsd xmm1, [rax] +movsd xmm1, qword [rax] +vmovsd xmm1, [rax] +vmovsd xmm1, qword [rax] +movsd [rax], xmm2 +movsd qword [rax], xmm2 +vmovsd [rax], xmm2 +vmovsd qword [rax], xmm2 + +movshdup xmm1, xmm2 +movshdup xmm1, [rax] +movshdup xmm1, dqword [rax] +vmovshdup xmm1, xmm2 +vmovshdup xmm1, [rax] +vmovshdup xmm1, dqword [rax] +vmovshdup ymm1, ymm2 +vmovshdup ymm1, [rax] +vmovshdup ymm1, yword [rax] + +movsldup xmm1, xmm2 +movsldup xmm1, [rax] +movsldup xmm1, dqword [rax] +vmovsldup xmm1, xmm2 +vmovsldup xmm1, [rax] +vmovsldup xmm1, dqword [rax] +vmovsldup ymm1, ymm2 +vmovsldup ymm1, [rax] +vmovsldup ymm1, yword [rax] + +movss xmm1, xmm2 +vmovss xmm1, xmm2 +vmovss xmm1, xmm2, xmm3 +movss xmm1, [rax] +movss xmm1, dword [rax] +vmovss xmm1, [rax] +vmovss xmm1, dword [rax] +movss [rax], xmm2 +movss dword [rax], xmm2 +vmovss [rax], xmm2 +vmovss dword [rax], xmm2 + +movupd xmm1, xmm2 +movupd xmm1, [rax] +movupd xmm1, dqword [rax] +vmovupd xmm1, xmm2 +vmovupd xmm1, [rax] +vmovupd xmm1, dqword [rax] +movupd [rax], xmm2 +movupd dqword [rax], xmm2 +vmovupd [rax], xmm2 +vmovupd dqword [rax], xmm2 +vmovupd ymm1, ymm2 +vmovupd ymm1, [rax] +vmovupd ymm1, yword [rax] +vmovupd [rax], ymm2 +vmovupd yword [rax], ymm2 + +movups xmm1, xmm2 +movups xmm1, [rax] +movups xmm1, dqword [rax] +vmovups xmm1, xmm2 +vmovups xmm1, [rax] +vmovups xmm1, dqword [rax] +movups [rax], xmm2 +movups dqword [rax], xmm2 +vmovups [rax], xmm2 +vmovups dqword [rax], xmm2 +vmovups ymm1, ymm2 +vmovups ymm1, [rax] +vmovups ymm1, yword [rax] +vmovups [rax], ymm2 +vmovups yword [rax], ymm2 + +mpsadbw xmm1, xmm2, 5 +mpsadbw xmm1, [rax], byte 5 +mpsadbw xmm1, dqword [rax], 5 +vmpsadbw xmm1, xmm2, 5 +vmpsadbw xmm1, [rax], byte 5 +vmpsadbw xmm1, dqword [rax], 5 +vmpsadbw xmm1, xmm2, xmm3, 5 +vmpsadbw xmm1, xmm2, [rax], byte 5 +vmpsadbw xmm1, xmm2, dqword [rax], 5 + +mulpd xmm1, xmm2 +mulpd xmm1, [rax] +mulpd xmm1, dqword [rax] +vmulpd xmm1, xmm2 +vmulpd xmm1, [rax] +vmulpd xmm1, dqword [rax] +vmulpd xmm1, xmm2, xmm3 +vmulpd xmm1, xmm2, [rax] +vmulpd xmm1, xmm2, dqword [rax] +vmulpd ymm1, ymm2, ymm3 +vmulpd ymm1, ymm2, [rax] +vmulpd ymm1, ymm2, yword [rax] + +mulps xmm1, xmm2 +mulps xmm1, [rax] +mulps xmm1, dqword [rax] +vmulps xmm1, xmm2 +vmulps xmm1, [rax] +vmulps xmm1, dqword [rax] +vmulps xmm1, xmm2, xmm3 +vmulps xmm1, xmm2, [rax] +vmulps xmm1, xmm2, dqword [rax] +vmulps ymm1, ymm2, ymm3 +vmulps ymm1, ymm2, [rax] +vmulps ymm1, ymm2, yword [rax] + +mulsd xmm1, xmm2 +mulsd xmm1, [rax] +mulsd xmm1, qword [rax] +vmulsd xmm1, xmm2 +vmulsd xmm1, [rax] +vmulsd xmm1, qword [rax] +vmulsd xmm1, xmm2, xmm3 +vmulsd xmm1, xmm2, [rax] +vmulsd xmm1, xmm2, qword [rax] + +mulss xmm1, xmm2 +mulss xmm1, [rax] +mulss xmm1, dword [rax] +vmulss xmm1, xmm2 +vmulss xmm1, [rax] +vmulss xmm1, dword [rax] +vmulss xmm1, xmm2, xmm3 +vmulss xmm1, xmm2, [rax] +vmulss xmm1, xmm2, dword [rax] + +orpd xmm1, xmm2 +orpd xmm1, [rax] +orpd xmm1, dqword [rax] +vorpd xmm1, xmm2 +vorpd xmm1, [rax] +vorpd xmm1, dqword [rax] +vorpd xmm1, xmm2, xmm3 +vorpd xmm1, xmm2, [rax] +vorpd xmm1, xmm2, dqword [rax] +vorpd ymm1, ymm2, ymm3 +vorpd ymm1, ymm2, [rax] +vorpd ymm1, ymm2, yword [rax] + +orps xmm1, xmm2 +orps xmm1, [rax] +orps xmm1, dqword [rax] +vorps xmm1, xmm2 +vorps xmm1, [rax] +vorps xmm1, dqword [rax] +vorps xmm1, xmm2, xmm3 +vorps xmm1, xmm2, [rax] +vorps xmm1, xmm2, dqword [rax] +vorps ymm1, ymm2, ymm3 +vorps ymm1, ymm2, [rax] +vorps ymm1, ymm2, yword [rax] + +pabsb xmm1, xmm2 +pabsb xmm1, [rax] +pabsb xmm1, dqword [rax] +vpabsb xmm1, xmm2 +vpabsb xmm1, [rax] +vpabsb xmm1, dqword [rax] + +pabsw xmm1, xmm2 +pabsw xmm1, [rax] +pabsw xmm1, dqword [rax] +vpabsw xmm1, xmm2 +vpabsw xmm1, [rax] +vpabsw xmm1, dqword [rax] + +pabsd xmm1, xmm2 +pabsd xmm1, [rax] +pabsd xmm1, dqword [rax] +vpabsd xmm1, xmm2 +vpabsd xmm1, [rax] +vpabsd xmm1, dqword [rax] + +packsswb xmm1, xmm2 +packsswb xmm1, [rax] +packsswb xmm1, dqword [rax] +vpacksswb xmm1, xmm2 +vpacksswb xmm1, [rax] +vpacksswb xmm1, dqword [rax] +vpacksswb xmm1, xmm2, xmm3 +vpacksswb xmm1, xmm2, [rax] +vpacksswb xmm1, xmm2, dqword [rax] + +packssdw xmm1, xmm2 +packssdw xmm1, [rax] +packssdw xmm1, dqword [rax] +vpackssdw xmm1, xmm2 +vpackssdw xmm1, [rax] +vpackssdw xmm1, dqword [rax] +vpackssdw xmm1, xmm2, xmm3 +vpackssdw xmm1, xmm2, [rax] +vpackssdw xmm1, xmm2, dqword [rax] + +packuswb xmm1, xmm2 +packuswb xmm1, [rax] +packuswb xmm1, dqword [rax] +vpackuswb xmm1, xmm2 +vpackuswb xmm1, [rax] +vpackuswb xmm1, dqword [rax] +vpackuswb xmm1, xmm2, xmm3 +vpackuswb xmm1, xmm2, [rax] +vpackuswb xmm1, xmm2, dqword [rax] + +packusdw xmm1, xmm2 +packusdw xmm1, [rax] +packusdw xmm1, dqword [rax] +vpackusdw xmm1, xmm2 +vpackusdw xmm1, [rax] +vpackusdw xmm1, dqword [rax] +vpackusdw xmm1, xmm2, xmm3 +vpackusdw xmm1, xmm2, [rax] +vpackusdw xmm1, xmm2, dqword [rax] + +paddb xmm1, xmm2 +paddb xmm1, [rax] +paddb xmm1, dqword [rax] +vpaddb xmm1, xmm2 +vpaddb xmm1, [rax] +vpaddb xmm1, dqword [rax] +vpaddb xmm1, xmm2, xmm3 +vpaddb xmm1, xmm2, [rax] +vpaddb xmm1, xmm2, dqword [rax] + +paddw xmm1, xmm2 +paddw xmm1, [rax] +paddw xmm1, dqword [rax] +vpaddw xmm1, xmm2 +vpaddw xmm1, [rax] +vpaddw xmm1, dqword [rax] +vpaddw xmm1, xmm2, xmm3 +vpaddw xmm1, xmm2, [rax] +vpaddw xmm1, xmm2, dqword [rax] + +paddd xmm1, xmm2 +paddd xmm1, [rax] +paddd xmm1, dqword [rax] +vpaddd xmm1, xmm2 +vpaddd xmm1, [rax] +vpaddd xmm1, dqword [rax] +vpaddd xmm1, xmm2, xmm3 +vpaddd xmm1, xmm2, [rax] +vpaddd xmm1, xmm2, dqword [rax] + +paddq xmm1, xmm2 +paddq xmm1, [rax] +paddq xmm1, dqword [rax] +vpaddq xmm1, xmm2 +vpaddq xmm1, [rax] +vpaddq xmm1, dqword [rax] +vpaddq xmm1, xmm2, xmm3 +vpaddq xmm1, xmm2, [rax] +vpaddq xmm1, xmm2, dqword [rax] + +paddsb xmm1, xmm2 +paddsb xmm1, [rax] +paddsb xmm1, dqword [rax] +vpaddsb xmm1, xmm2 +vpaddsb xmm1, [rax] +vpaddsb xmm1, dqword [rax] +vpaddsb xmm1, xmm2, xmm3 +vpaddsb xmm1, xmm2, [rax] +vpaddsb xmm1, xmm2, dqword [rax] + +paddsw xmm1, xmm2 +paddsw xmm1, [rax] +paddsw xmm1, dqword [rax] +vpaddsw xmm1, xmm2 +vpaddsw xmm1, [rax] +vpaddsw xmm1, dqword [rax] +vpaddsw xmm1, xmm2, xmm3 +vpaddsw xmm1, xmm2, [rax] +vpaddsw xmm1, xmm2, dqword [rax] + +paddusb xmm1, xmm2 +paddusb xmm1, [rax] +paddusb xmm1, dqword [rax] +vpaddusb xmm1, xmm2 +vpaddusb xmm1, [rax] +vpaddusb xmm1, dqword [rax] +vpaddusb xmm1, xmm2, xmm3 +vpaddusb xmm1, xmm2, [rax] +vpaddusb xmm1, xmm2, dqword [rax] + +paddusw xmm1, xmm2 +paddusw xmm1, [rax] +paddusw xmm1, dqword [rax] +vpaddusw xmm1, xmm2 +vpaddusw xmm1, [rax] +vpaddusw xmm1, dqword [rax] +vpaddusw xmm1, xmm2, xmm3 +vpaddusw xmm1, xmm2, [rax] +vpaddusw xmm1, xmm2, dqword [rax] + +palignr xmm1, xmm2, 5 +palignr xmm1, [rax], byte 5 +palignr xmm1, dqword [rax], 5 +vpalignr xmm1, xmm2, 5 +vpalignr xmm1, [rax], byte 5 +vpalignr xmm1, dqword [rax], 5 +vpalignr xmm1, xmm2, xmm3, 5 +vpalignr xmm1, xmm2, [rax], byte 5 +vpalignr xmm1, xmm2, dqword [rax], 5 + +pand xmm1, xmm2 +pand xmm1, [rax] +pand xmm1, dqword [rax] +vpand xmm1, xmm2 +vpand xmm1, [rax] +vpand xmm1, dqword [rax] +vpand xmm1, xmm2, xmm3 +vpand xmm1, xmm2, [rax] +vpand xmm1, xmm2, dqword [rax] + +pandn xmm1, xmm2 +pandn xmm1, [rax] +pandn xmm1, dqword [rax] +vpandn xmm1, xmm2 +vpandn xmm1, [rax] +vpandn xmm1, dqword [rax] +vpandn xmm1, xmm2, xmm3 +vpandn xmm1, xmm2, [rax] +vpandn xmm1, xmm2, dqword [rax] + +pavgb xmm1, xmm2 +pavgb xmm1, [rax] +pavgb xmm1, dqword [rax] +vpavgb xmm1, xmm2 +vpavgb xmm1, [rax] +vpavgb xmm1, dqword [rax] +vpavgb xmm1, xmm2, xmm3 +vpavgb xmm1, xmm2, [rax] +vpavgb xmm1, xmm2, dqword [rax] + +pavgw xmm1, xmm2 +pavgw xmm1, [rax] +pavgw xmm1, dqword [rax] +vpavgw xmm1, xmm2 +vpavgw xmm1, [rax] +vpavgw xmm1, dqword [rax] +vpavgw xmm1, xmm2, xmm3 +vpavgw xmm1, xmm2, [rax] +vpavgw xmm1, xmm2, dqword [rax] + +; implicit XMM0 cannot be VEX encoded +pblendvb xmm1, xmm2 +pblendvb xmm1, [rax] +pblendvb xmm1, dqword [rax] +pblendvb xmm1, xmm2, xmm0 +pblendvb xmm1, [rax], xmm0 +pblendvb xmm1, dqword [rax], xmm0 +vpblendvb xmm1, xmm2, xmm3, xmm4 +vpblendvb xmm1, xmm2, [rax], xmm4 +vpblendvb xmm1, xmm2, dqword [rax], xmm4 + +pblendw xmm1, xmm2, 5 +pblendw xmm1, [rax], byte 5 +pblendw xmm1, dqword [rax], 5 +vpblendw xmm1, xmm2, 5 +vpblendw xmm1, [rax], byte 5 +vpblendw xmm1, dqword [rax], 5 +vpblendw xmm1, xmm2, xmm3, 5 +vpblendw xmm1, xmm2, [rax], byte 5 +vpblendw xmm1, xmm2, dqword [rax], 5 + +pcmpestri xmm1, xmm2, 5 +pcmpestri xmm1, [rax], byte 5 +pcmpestri xmm1, dqword [rax], 5 +vpcmpestri xmm1, xmm2, 5 +vpcmpestri xmm1, [rax], byte 5 +vpcmpestri xmm1, dqword [rax], 5 + +pcmpestrm xmm1, xmm2, 5 +pcmpestrm xmm1, [rax], byte 5 +pcmpestrm xmm1, dqword [rax], 5 +vpcmpestrm xmm1, xmm2, 5 +vpcmpestrm xmm1, [rax], byte 5 +vpcmpestrm xmm1, dqword [rax], 5 + +pcmpistri xmm1, xmm2, 5 +pcmpistri xmm1, [rax], byte 5 +pcmpistri xmm1, dqword [rax], 5 +vpcmpistri xmm1, xmm2, 5 +vpcmpistri xmm1, [rax], byte 5 +vpcmpistri xmm1, dqword [rax], 5 + +pcmpistrm xmm1, xmm2, 5 +pcmpistrm xmm1, [rax], byte 5 +pcmpistrm xmm1, dqword [rax], 5 +vpcmpistrm xmm1, xmm2, 5 +vpcmpistrm xmm1, [rax], byte 5 +vpcmpistrm xmm1, dqword [rax], 5 + +pcmpeqb xmm1, xmm2 +pcmpeqb xmm1, [rax] +pcmpeqb xmm1, dqword [rax] +vpcmpeqb xmm1, xmm2 +vpcmpeqb xmm1, [rax] +vpcmpeqb xmm1, dqword [rax] +vpcmpeqb xmm1, xmm2, xmm3 +vpcmpeqb xmm1, xmm2, [rax] +vpcmpeqb xmm1, xmm2, dqword [rax] + +pcmpeqw xmm1, xmm2 +pcmpeqw xmm1, [rax] +pcmpeqw xmm1, dqword [rax] +vpcmpeqw xmm1, xmm2 +vpcmpeqw xmm1, [rax] +vpcmpeqw xmm1, dqword [rax] +vpcmpeqw xmm1, xmm2, xmm3 +vpcmpeqw xmm1, xmm2, [rax] +vpcmpeqw xmm1, xmm2, dqword [rax] + +pcmpeqd xmm1, xmm2 +pcmpeqd xmm1, [rax] +pcmpeqd xmm1, dqword [rax] +vpcmpeqd xmm1, xmm2 +vpcmpeqd xmm1, [rax] +vpcmpeqd xmm1, dqword [rax] +vpcmpeqd xmm1, xmm2, xmm3 +vpcmpeqd xmm1, xmm2, [rax] +vpcmpeqd xmm1, xmm2, dqword [rax] + +pcmpeqq xmm1, xmm2 +pcmpeqq xmm1, [rax] +pcmpeqq xmm1, dqword [rax] +vpcmpeqq xmm1, xmm2 +vpcmpeqq xmm1, [rax] +vpcmpeqq xmm1, dqword [rax] +vpcmpeqq xmm1, xmm2, xmm3 +vpcmpeqq xmm1, xmm2, [rax] +vpcmpeqq xmm1, xmm2, dqword [rax] + +pcmpgtb xmm1, xmm2 +pcmpgtb xmm1, [rax] +pcmpgtb xmm1, dqword [rax] +vpcmpgtb xmm1, xmm2 +vpcmpgtb xmm1, [rax] +vpcmpgtb xmm1, dqword [rax] +vpcmpgtb xmm1, xmm2, xmm3 +vpcmpgtb xmm1, xmm2, [rax] +vpcmpgtb xmm1, xmm2, dqword [rax] + +pcmpgtw xmm1, xmm2 +pcmpgtw xmm1, [rax] +pcmpgtw xmm1, dqword [rax] +vpcmpgtw xmm1, xmm2 +vpcmpgtw xmm1, [rax] +vpcmpgtw xmm1, dqword [rax] +vpcmpgtw xmm1, xmm2, xmm3 +vpcmpgtw xmm1, xmm2, [rax] +vpcmpgtw xmm1, xmm2, dqword [rax] + +pcmpgtd xmm1, xmm2 +pcmpgtd xmm1, [rax] +pcmpgtd xmm1, dqword [rax] +vpcmpgtd xmm1, xmm2 +vpcmpgtd xmm1, [rax] +vpcmpgtd xmm1, dqword [rax] +vpcmpgtd xmm1, xmm2, xmm3 +vpcmpgtd xmm1, xmm2, [rax] +vpcmpgtd xmm1, xmm2, dqword [rax] + +pcmpgtq xmm1, xmm2 +pcmpgtq xmm1, [rax] +pcmpgtq xmm1, dqword [rax] +vpcmpgtq xmm1, xmm2 +vpcmpgtq xmm1, [rax] +vpcmpgtq xmm1, dqword [rax] +vpcmpgtq xmm1, xmm2, xmm3 +vpcmpgtq xmm1, xmm2, [rax] +vpcmpgtq xmm1, xmm2, dqword [rax] + +vpermilpd xmm1, xmm2, xmm3 +vpermilpd xmm1, xmm2, [rax] +vpermilpd xmm1, xmm2, dqword [rax] +vpermilpd ymm1, ymm2, ymm3 +vpermilpd ymm1, ymm2, [rax] +vpermilpd ymm1, ymm2, yword [rax] +vpermilpd xmm1, [rax], byte 5 +vpermilpd xmm1, dqword [rax], 5 +vpermilpd ymm1, [rax], byte 5 +vpermilpd ymm1, yword [rax], 5 + +vpermil2pd xmm1, xmm2, xmm3, xmm4, 5 +vpermil2pd xmm1, xmm2, [rax], xmm4, 5 +vpermil2pd xmm1, xmm2, dqword [rax], xmm4, 5 +vpermil2pd xmm1, xmm2, xmm3, [rax], 5 +vpermil2pd xmm1, xmm2, xmm3, dqword [rax], 5 +vpermil2pd ymm1, ymm2, ymm3, ymm4, 5 +vpermil2pd ymm1, ymm2, [rax], ymm4, 5 +vpermil2pd ymm1, ymm2, yword [rax], ymm4, 5 +vpermil2pd ymm1, ymm2, ymm3, [rax], 5 +vpermil2pd ymm1, ymm2, ymm3, yword [rax], 5 + +vpermilps xmm1, xmm2, xmm3 +vpermilps xmm1, xmm2, [rax] +vpermilps xmm1, xmm2, dqword [rax] +vpermilps ymm1, ymm2, ymm3 +vpermilps ymm1, ymm2, [rax] +vpermilps ymm1, ymm2, yword [rax] +vpermilps xmm1, [rax], byte 5 +vpermilps xmm1, dqword [rax], 5 +vpermilps ymm1, [rax], byte 5 +vpermilps ymm1, yword [rax], 5 + +vpermil2ps xmm1, xmm2, xmm3, xmm4, 5 +vpermil2ps xmm1, xmm2, [rax], xmm4, 5 +vpermil2ps xmm1, xmm2, dqword [rax], xmm4, 5 +vpermil2ps xmm1, xmm2, xmm3, [rax], 5 +vpermil2ps xmm1, xmm2, xmm3, dqword [rax], 5 +vpermil2ps ymm1, ymm2, ymm3, ymm4, 5 +vpermil2ps ymm1, ymm2, [rax], ymm4, 5 +vpermil2ps ymm1, ymm2, yword [rax], ymm4, 5 +vpermil2ps ymm1, ymm2, ymm3, [rax], 5 +vpermil2ps ymm1, ymm2, ymm3, yword [rax], 5 + +vperm2f128 ymm1, ymm2, ymm3, 5 +vperm2f128 ymm1, ymm2, [rax], byte 5 +vperm2f128 ymm1, ymm2, yword [rax], 5 + +pextrb eax, xmm2, 5 +pextrb eax, xmm2, byte 5 +pextrb rax, xmm2, 5 +pextrb rax, xmm2, byte 5 +pextrb byte [rax], xmm2, 5 +pextrb [rax], xmm2, byte 5 +vpextrb eax, xmm2, 5 +vpextrb eax, xmm2, byte 5 +vpextrb rax, xmm2, 5 +vpextrb rax, xmm2, byte 5 +vpextrb byte [rax], xmm2, 5 +vpextrb [rax], xmm2, byte 5 + +pextrw eax, xmm2, 5 +pextrw eax, xmm2, byte 5 +pextrw rax, xmm2, 5 +pextrw rax, xmm2, byte 5 +pextrw word [rax], xmm2, 5 +pextrw [rax], xmm2, byte 5 +vpextrw eax, xmm2, 5 +vpextrw eax, xmm2, byte 5 +vpextrw rax, xmm2, 5 +vpextrw rax, xmm2, byte 5 +vpextrw word [rax], xmm2, 5 +vpextrw [rax], xmm2, byte 5 + +pextrd eax, xmm2, 5 +pextrd eax, xmm2, byte 5 +pextrd dword [rax], xmm2, 5 +pextrd [rax], xmm2, byte 5 +vpextrd eax, xmm2, 5 +vpextrd eax, xmm2, byte 5 +vpextrd dword [rax], xmm2, 5 +vpextrd [rax], xmm2, byte 5 + +pextrq rax, xmm2, 5 +pextrq rax, xmm2, byte 5 +pextrq qword [rax], xmm2, 5 +pextrq [rax], xmm2, byte 5 +vpextrq rax, xmm2, 5 +vpextrq rax, xmm2, byte 5 +vpextrq qword [rax], xmm2, 5 +vpextrq [rax], xmm2, byte 5 + +phaddw xmm1, xmm2 +phaddw xmm1, [rax] +phaddw xmm1, dqword [rax] +vphaddw xmm1, xmm2 +vphaddw xmm1, [rax] +vphaddw xmm1, dqword [rax] +vphaddw xmm1, xmm2, xmm3 +vphaddw xmm1, xmm2, [rax] +vphaddw xmm1, xmm2, dqword [rax] + +phaddd xmm1, xmm2 +phaddd xmm1, [rax] +phaddd xmm1, dqword [rax] +vphaddd xmm1, xmm2 +vphaddd xmm1, [rax] +vphaddd xmm1, dqword [rax] +vphaddd xmm1, xmm2, xmm3 +vphaddd xmm1, xmm2, [rax] +vphaddd xmm1, xmm2, dqword [rax] + +phaddsw xmm1, xmm2 +phaddsw xmm1, [rax] +phaddsw xmm1, dqword [rax] +vphaddsw xmm1, xmm2 +vphaddsw xmm1, [rax] +vphaddsw xmm1, dqword [rax] +vphaddsw xmm1, xmm2, xmm3 +vphaddsw xmm1, xmm2, [rax] +vphaddsw xmm1, xmm2, dqword [rax] + +phminposuw xmm1, xmm2 +phminposuw xmm1, [rax] +phminposuw xmm1, dqword [rax] +vphminposuw xmm1, xmm2 +vphminposuw xmm1, [rax] +vphminposuw xmm1, dqword [rax] + +phsubw xmm1, xmm2 +phsubw xmm1, [rax] +phsubw xmm1, dqword [rax] +vphsubw xmm1, xmm2 +vphsubw xmm1, [rax] +vphsubw xmm1, dqword [rax] +vphsubw xmm1, xmm2, xmm3 +vphsubw xmm1, xmm2, [rax] +vphsubw xmm1, xmm2, dqword [rax] + +phsubd xmm1, xmm2 +phsubd xmm1, [rax] +phsubd xmm1, dqword [rax] +vphsubd xmm1, xmm2 +vphsubd xmm1, [rax] +vphsubd xmm1, dqword [rax] +vphsubd xmm1, xmm2, xmm3 +vphsubd xmm1, xmm2, [rax] +vphsubd xmm1, xmm2, dqword [rax] + +phsubsw xmm1, xmm2 +phsubsw xmm1, [rax] +phsubsw xmm1, dqword [rax] +vphsubsw xmm1, xmm2 +vphsubsw xmm1, [rax] +vphsubsw xmm1, dqword [rax] +vphsubsw xmm1, xmm2, xmm3 +vphsubsw xmm1, xmm2, [rax] +vphsubsw xmm1, xmm2, dqword [rax] + +pinsrb xmm1, eax, 5 +pinsrb xmm1, byte [rax], 5 +pinsrb xmm1, [rax], byte 5 +vpinsrb xmm1, eax, 5 +vpinsrb xmm1, byte [rax], 5 +vpinsrb xmm1, [rax], byte 5 +vpinsrb xmm1, xmm2, eax, 5 +vpinsrb xmm1, xmm2, byte [rax], 5 +vpinsrb xmm1, xmm2, [rax], byte 5 + +pinsrw xmm1, eax, 5 +pinsrw xmm1, word [rax], 5 +pinsrw xmm1, [rax], byte 5 +vpinsrw xmm1, eax, 5 +vpinsrw xmm1, word [rax], 5 +vpinsrw xmm1, [rax], byte 5 +vpinsrw xmm1, xmm2, eax, 5 +vpinsrw xmm1, xmm2, word [rax], 5 +vpinsrw xmm1, xmm2, [rax], byte 5 + +pinsrd xmm1, eax, 5 +pinsrd xmm1, dword [rax], 5 +pinsrd xmm1, [rax], byte 5 +vpinsrd xmm1, eax, 5 +vpinsrd xmm1, dword [rax], 5 +vpinsrd xmm1, [rax], byte 5 +vpinsrd xmm1, xmm2, eax, 5 +vpinsrd xmm1, xmm2, dword [rax], 5 +vpinsrd xmm1, xmm2, [rax], byte 5 + +pinsrq xmm1, rax, 5 +pinsrq xmm1, qword [rax], 5 +pinsrq xmm1, [rax], byte 5 +vpinsrq xmm1, rax, 5 +vpinsrq xmm1, qword [rax], 5 +vpinsrq xmm1, [rax], byte 5 +vpinsrq xmm1, xmm2, rax, 5 +vpinsrq xmm1, xmm2, qword [rax], 5 +vpinsrq xmm1, xmm2, [rax], byte 5 + +pmaddwd xmm1, xmm2 +pmaddwd xmm1, [rax] +pmaddwd xmm1, dqword [rax] +vpmaddwd xmm1, xmm2 +vpmaddwd xmm1, [rax] +vpmaddwd xmm1, dqword [rax] +vpmaddwd xmm1, xmm2, xmm3 +vpmaddwd xmm1, xmm2, [rax] +vpmaddwd xmm1, xmm2, dqword [rax] + +pmaddubsw xmm1, xmm2 +pmaddubsw xmm1, [rax] +pmaddubsw xmm1, dqword [rax] +vpmaddubsw xmm1, xmm2 +vpmaddubsw xmm1, [rax] +vpmaddubsw xmm1, dqword [rax] +vpmaddubsw xmm1, xmm2, xmm3 +vpmaddubsw xmm1, xmm2, [rax] +vpmaddubsw xmm1, xmm2, dqword [rax] + +pmaxsb xmm1, xmm2 +pmaxsb xmm1, [rax] +pmaxsb xmm1, dqword [rax] +vpmaxsb xmm1, xmm2 +vpmaxsb xmm1, [rax] +vpmaxsb xmm1, dqword [rax] +vpmaxsb xmm1, xmm2, xmm3 +vpmaxsb xmm1, xmm2, [rax] +vpmaxsb xmm1, xmm2, dqword [rax] + +pmaxsw xmm1, xmm2 +pmaxsw xmm1, [rax] +pmaxsw xmm1, dqword [rax] +vpmaxsw xmm1, xmm2 +vpmaxsw xmm1, [rax] +vpmaxsw xmm1, dqword [rax] +vpmaxsw xmm1, xmm2, xmm3 +vpmaxsw xmm1, xmm2, [rax] +vpmaxsw xmm1, xmm2, dqword [rax] + +pmaxsd xmm1, xmm2 +pmaxsd xmm1, [rax] +pmaxsd xmm1, dqword [rax] +vpmaxsd xmm1, xmm2 +vpmaxsd xmm1, [rax] +vpmaxsd xmm1, dqword [rax] +vpmaxsd xmm1, xmm2, xmm3 +vpmaxsd xmm1, xmm2, [rax] +vpmaxsd xmm1, xmm2, dqword [rax] + +pmaxub xmm1, xmm2 +pmaxub xmm1, [rax] +pmaxub xmm1, dqword [rax] +vpmaxub xmm1, xmm2 +vpmaxub xmm1, [rax] +vpmaxub xmm1, dqword [rax] +vpmaxub xmm1, xmm2, xmm3 +vpmaxub xmm1, xmm2, [rax] +vpmaxub xmm1, xmm2, dqword [rax] + +pmaxuw xmm1, xmm2 +pmaxuw xmm1, [rax] +pmaxuw xmm1, dqword [rax] +vpmaxuw xmm1, xmm2 +vpmaxuw xmm1, [rax] +vpmaxuw xmm1, dqword [rax] +vpmaxuw xmm1, xmm2, xmm3 +vpmaxuw xmm1, xmm2, [rax] +vpmaxuw xmm1, xmm2, dqword [rax] + +pmaxud xmm1, xmm2 +pmaxud xmm1, [rax] +pmaxud xmm1, dqword [rax] +vpmaxud xmm1, xmm2 +vpmaxud xmm1, [rax] +vpmaxud xmm1, dqword [rax] +vpmaxud xmm1, xmm2, xmm3 +vpmaxud xmm1, xmm2, [rax] +vpmaxud xmm1, xmm2, dqword [rax] + +pminsb xmm1, xmm2 +pminsb xmm1, [rax] +pminsb xmm1, dqword [rax] +vpminsb xmm1, xmm2 +vpminsb xmm1, [rax] +vpminsb xmm1, dqword [rax] +vpminsb xmm1, xmm2, xmm3 +vpminsb xmm1, xmm2, [rax] +vpminsb xmm1, xmm2, dqword [rax] + +pminsw xmm1, xmm2 +pminsw xmm1, [rax] +pminsw xmm1, dqword [rax] +vpminsw xmm1, xmm2 +vpminsw xmm1, [rax] +vpminsw xmm1, dqword [rax] +vpminsw xmm1, xmm2, xmm3 +vpminsw xmm1, xmm2, [rax] +vpminsw xmm1, xmm2, dqword [rax] + +pminsd xmm1, xmm2 +pminsd xmm1, [rax] +pminsd xmm1, dqword [rax] +vpminsd xmm1, xmm2 +vpminsd xmm1, [rax] +vpminsd xmm1, dqword [rax] +vpminsd xmm1, xmm2, xmm3 +vpminsd xmm1, xmm2, [rax] +vpminsd xmm1, xmm2, dqword [rax] + +pminub xmm1, xmm2 +pminub xmm1, [rax] +pminub xmm1, dqword [rax] +vpminub xmm1, xmm2 +vpminub xmm1, [rax] +vpminub xmm1, dqword [rax] +vpminub xmm1, xmm2, xmm3 +vpminub xmm1, xmm2, [rax] +vpminub xmm1, xmm2, dqword [rax] + +pminuw xmm1, xmm2 +pminuw xmm1, [rax] +pminuw xmm1, dqword [rax] +vpminuw xmm1, xmm2 +vpminuw xmm1, [rax] +vpminuw xmm1, dqword [rax] +vpminuw xmm1, xmm2, xmm3 +vpminuw xmm1, xmm2, [rax] +vpminuw xmm1, xmm2, dqword [rax] + +pminud xmm1, xmm2 +pminud xmm1, [rax] +pminud xmm1, dqword [rax] +vpminud xmm1, xmm2 +vpminud xmm1, [rax] +vpminud xmm1, dqword [rax] +vpminud xmm1, xmm2, xmm3 +vpminud xmm1, xmm2, [rax] +vpminud xmm1, xmm2, dqword [rax] + +pmovmskb eax, xmm1 +pmovmskb rax, xmm1 +vpmovmskb eax, xmm1 +vpmovmskb rax, xmm1 + +pmovsxbw xmm1, xmm2 +pmovsxbw xmm1, [rax] +pmovsxbw xmm1, qword [rax] +vpmovsxbw xmm1, xmm2 +vpmovsxbw xmm1, [rax] +vpmovsxbw xmm1, qword [rax] + +pmovsxbd xmm1, xmm2 +pmovsxbd xmm1, [rax] +pmovsxbd xmm1, dword [rax] +vpmovsxbd xmm1, xmm2 +vpmovsxbd xmm1, [rax] +vpmovsxbd xmm1, dword [rax] + +pmovsxbq xmm1, xmm2 +pmovsxbq xmm1, [rax] +pmovsxbq xmm1, word [rax] +vpmovsxbq xmm1, xmm2 +vpmovsxbq xmm1, [rax] +vpmovsxbq xmm1, word [rax] + +pmovsxwd xmm1, xmm2 +pmovsxwd xmm1, [rax] +pmovsxwd xmm1, qword [rax] +vpmovsxwd xmm1, xmm2 +vpmovsxwd xmm1, [rax] +vpmovsxwd xmm1, qword [rax] + +pmovsxwq xmm1, xmm2 +pmovsxwq xmm1, [rax] +pmovsxwq xmm1, dword [rax] +vpmovsxwq xmm1, xmm2 +vpmovsxwq xmm1, [rax] +vpmovsxwq xmm1, dword [rax] + +pmovsxdq xmm1, xmm2 +pmovsxdq xmm1, [rax] +pmovsxdq xmm1, qword [rax] +vpmovsxdq xmm1, xmm2 +vpmovsxdq xmm1, [rax] +vpmovsxdq xmm1, qword [rax] + +pmovzxbw xmm1, xmm2 +pmovzxbw xmm1, [rax] +pmovzxbw xmm1, qword [rax] +vpmovzxbw xmm1, xmm2 +vpmovzxbw xmm1, [rax] +vpmovzxbw xmm1, qword [rax] + +pmovzxbd xmm1, xmm2 +pmovzxbd xmm1, [rax] +pmovzxbd xmm1, dword [rax] +vpmovzxbd xmm1, xmm2 +vpmovzxbd xmm1, [rax] +vpmovzxbd xmm1, dword [rax] + +pmovzxbq xmm1, xmm2 +pmovzxbq xmm1, [rax] +pmovzxbq xmm1, word [rax] +vpmovzxbq xmm1, xmm2 +vpmovzxbq xmm1, [rax] +vpmovzxbq xmm1, word [rax] + +pmovzxwd xmm1, xmm2 +pmovzxwd xmm1, [rax] +pmovzxwd xmm1, qword [rax] +vpmovzxwd xmm1, xmm2 +vpmovzxwd xmm1, [rax] +vpmovzxwd xmm1, qword [rax] + +pmovzxwq xmm1, xmm2 +pmovzxwq xmm1, [rax] +pmovzxwq xmm1, dword [rax] +vpmovzxwq xmm1, xmm2 +vpmovzxwq xmm1, [rax] +vpmovzxwq xmm1, dword [rax] + +pmovzxdq xmm1, xmm2 +pmovzxdq xmm1, [rax] +pmovzxdq xmm1, qword [rax] +vpmovzxdq xmm1, xmm2 +vpmovzxdq xmm1, [rax] +vpmovzxdq xmm1, qword [rax] + +pmulhuw xmm1, xmm2 +pmulhuw xmm1, [rax] +pmulhuw xmm1, dqword [rax] +vpmulhuw xmm1, xmm2 +vpmulhuw xmm1, [rax] +vpmulhuw xmm1, dqword [rax] +vpmulhuw xmm1, xmm2, xmm3 +vpmulhuw xmm1, xmm2, [rax] +vpmulhuw xmm1, xmm2, dqword [rax] + +pmulhrsw xmm1, xmm2 +pmulhrsw xmm1, [rax] +pmulhrsw xmm1, dqword [rax] +vpmulhrsw xmm1, xmm2 +vpmulhrsw xmm1, [rax] +vpmulhrsw xmm1, dqword [rax] +vpmulhrsw xmm1, xmm2, xmm3 +vpmulhrsw xmm1, xmm2, [rax] +vpmulhrsw xmm1, xmm2, dqword [rax] + +pmulhw xmm1, xmm2 +pmulhw xmm1, [rax] +pmulhw xmm1, dqword [rax] +vpmulhw xmm1, xmm2 +vpmulhw xmm1, [rax] +vpmulhw xmm1, dqword [rax] +vpmulhw xmm1, xmm2, xmm3 +vpmulhw xmm1, xmm2, [rax] +vpmulhw xmm1, xmm2, dqword [rax] + +pmullw xmm1, xmm2 +pmullw xmm1, [rax] +pmullw xmm1, dqword [rax] +vpmullw xmm1, xmm2 +vpmullw xmm1, [rax] +vpmullw xmm1, dqword [rax] +vpmullw xmm1, xmm2, xmm3 +vpmullw xmm1, xmm2, [rax] +vpmullw xmm1, xmm2, dqword [rax] + +pmulld xmm1, xmm2 +pmulld xmm1, [rax] +pmulld xmm1, dqword [rax] +vpmulld xmm1, xmm2 +vpmulld xmm1, [rax] +vpmulld xmm1, dqword [rax] +vpmulld xmm1, xmm2, xmm3 +vpmulld xmm1, xmm2, [rax] +vpmulld xmm1, xmm2, dqword [rax] + +pmuludq xmm1, xmm2 +pmuludq xmm1, [rax] +pmuludq xmm1, dqword [rax] +vpmuludq xmm1, xmm2 +vpmuludq xmm1, [rax] +vpmuludq xmm1, dqword [rax] +vpmuludq xmm1, xmm2, xmm3 +vpmuludq xmm1, xmm2, [rax] +vpmuludq xmm1, xmm2, dqword [rax] + +pmuldq xmm1, xmm2 +pmuldq xmm1, [rax] +pmuldq xmm1, dqword [rax] +vpmuldq xmm1, xmm2 +vpmuldq xmm1, [rax] +vpmuldq xmm1, dqword [rax] +vpmuldq xmm1, xmm2, xmm3 +vpmuldq xmm1, xmm2, [rax] +vpmuldq xmm1, xmm2, dqword [rax] + +por xmm1, xmm2 +por xmm1, [rax] +por xmm1, dqword [rax] +vpor xmm1, xmm2 +vpor xmm1, [rax] +vpor xmm1, dqword [rax] +vpor xmm1, xmm2, xmm3 +vpor xmm1, xmm2, [rax] +vpor xmm1, xmm2, dqword [rax] + +psadbw xmm1, xmm2 +psadbw xmm1, [rax] +psadbw xmm1, dqword [rax] +vpsadbw xmm1, xmm2 +vpsadbw xmm1, [rax] +vpsadbw xmm1, dqword [rax] +vpsadbw xmm1, xmm2, xmm3 +vpsadbw xmm1, xmm2, [rax] +vpsadbw xmm1, xmm2, dqword [rax] + +pshufb xmm1, xmm2 +pshufb xmm1, [rax] +pshufb xmm1, dqword [rax] +vpshufb xmm1, xmm2 +vpshufb xmm1, [rax] +vpshufb xmm1, dqword [rax] +vpshufb xmm1, xmm2, xmm3 +vpshufb xmm1, xmm2, [rax] +vpshufb xmm1, xmm2, dqword [rax] + +pshufd xmm1, xmm2, 5 +pshufd xmm1, [rax], byte 5 +pshufd xmm1, dqword [rax], 5 +vpshufd xmm1, xmm2, 5 +vpshufd xmm1, [rax], byte 5 +vpshufd xmm1, dqword [rax], 5 + +pshufhw xmm1, xmm2, 5 +pshufhw xmm1, [rax], byte 5 +pshufhw xmm1, dqword [rax], 5 +vpshufhw xmm1, xmm2, 5 +vpshufhw xmm1, [rax], byte 5 +vpshufhw xmm1, dqword [rax], 5 + +pshuflw xmm1, xmm2, 5 +pshuflw xmm1, [rax], byte 5 +pshuflw xmm1, dqword [rax], 5 +vpshuflw xmm1, xmm2, 5 +vpshuflw xmm1, [rax], byte 5 +vpshuflw xmm1, dqword [rax], 5 + +psignb xmm1, xmm2 +psignb xmm1, [rax] +psignb xmm1, dqword [rax] +vpsignb xmm1, xmm2 +vpsignb xmm1, [rax] +vpsignb xmm1, dqword [rax] +vpsignb xmm1, xmm2, xmm3 +vpsignb xmm1, xmm2, [rax] +vpsignb xmm1, xmm2, dqword [rax] + +psignw xmm1, xmm2 +psignw xmm1, [rax] +psignw xmm1, dqword [rax] +vpsignw xmm1, xmm2 +vpsignw xmm1, [rax] +vpsignw xmm1, dqword [rax] +vpsignw xmm1, xmm2, xmm3 +vpsignw xmm1, xmm2, [rax] +vpsignw xmm1, xmm2, dqword [rax] + +psignd xmm1, xmm2 +psignd xmm1, [rax] +psignd xmm1, dqword [rax] +vpsignd xmm1, xmm2 +vpsignd xmm1, [rax] +vpsignd xmm1, dqword [rax] +vpsignd xmm1, xmm2, xmm3 +vpsignd xmm1, xmm2, [rax] +vpsignd xmm1, xmm2, dqword [rax] + +; Test these with high regs as it goes into VEX.B (REX.B) +pslldq xmm11, 5 +pslldq xmm11, byte 5 +vpslldq xmm11, 5 +vpslldq xmm11, byte 5 +vpslldq xmm11, xmm12, 5 +vpslldq xmm11, xmm12, byte 5 + +pslldq xmm1, 5 +pslldq xmm1, byte 5 +vpslldq xmm1, 5 +vpslldq xmm1, byte 5 +vpslldq xmm1, xmm2, 5 +vpslldq xmm1, xmm2, byte 5 + +psrldq xmm1, 5 +psrldq xmm1, byte 5 +vpsrldq xmm1, 5 +vpsrldq xmm1, byte 5 +vpsrldq xmm1, xmm2, 5 +vpsrldq xmm1, xmm2, byte 5 + +psllw xmm1, xmm2 +psllw xmm1, [rax] +psllw xmm1, dqword [rax] +vpsllw xmm1, xmm2 +vpsllw xmm1, [rax] +vpsllw xmm1, dqword [rax] +vpsllw xmm1, xmm2, xmm3 +vpsllw xmm1, xmm2, [rax] +vpsllw xmm1, xmm2, dqword [rax] +psllw xmm1, 5 +psllw xmm1, byte 5 +vpsllw xmm1, 5 +vpsllw xmm1, byte 5 +vpsllw xmm1, xmm2, 5 +vpsllw xmm1, xmm2, byte 5 + +pslld xmm1, xmm2 +pslld xmm1, [rax] +pslld xmm1, dqword [rax] +vpslld xmm1, xmm2 +vpslld xmm1, [rax] +vpslld xmm1, dqword [rax] +vpslld xmm1, xmm2, xmm3 +vpslld xmm1, xmm2, [rax] +vpslld xmm1, xmm2, dqword [rax] +pslld xmm1, 5 +pslld xmm1, byte 5 +vpslld xmm1, 5 +vpslld xmm1, byte 5 +vpslld xmm1, xmm2, 5 +vpslld xmm1, xmm2, byte 5 + +psllq xmm1, xmm2 +psllq xmm1, [rax] +psllq xmm1, dqword [rax] +vpsllq xmm1, xmm2 +vpsllq xmm1, [rax] +vpsllq xmm1, dqword [rax] +vpsllq xmm1, xmm2, xmm3 +vpsllq xmm1, xmm2, [rax] +vpsllq xmm1, xmm2, dqword [rax] +psllq xmm1, 5 +psllq xmm1, byte 5 +vpsllq xmm1, 5 +vpsllq xmm1, byte 5 +vpsllq xmm1, xmm2, 5 +vpsllq xmm1, xmm2, byte 5 + +psraw xmm1, xmm2 +psraw xmm1, [rax] +psraw xmm1, dqword [rax] +vpsraw xmm1, xmm2 +vpsraw xmm1, [rax] +vpsraw xmm1, dqword [rax] +vpsraw xmm1, xmm2, xmm3 +vpsraw xmm1, xmm2, [rax] +vpsraw xmm1, xmm2, dqword [rax] +psraw xmm1, 5 +psraw xmm1, byte 5 +vpsraw xmm1, 5 +vpsraw xmm1, byte 5 +vpsraw xmm1, xmm2, 5 +vpsraw xmm1, xmm2, byte 5 + +psrad xmm1, xmm2 +psrad xmm1, [rax] +psrad xmm1, dqword [rax] +vpsrad xmm1, xmm2 +vpsrad xmm1, [rax] +vpsrad xmm1, dqword [rax] +vpsrad xmm1, xmm2, xmm3 +vpsrad xmm1, xmm2, [rax] +vpsrad xmm1, xmm2, dqword [rax] +psrad xmm1, 5 +psrad xmm1, byte 5 +vpsrad xmm1, 5 +vpsrad xmm1, byte 5 +vpsrad xmm1, xmm2, 5 +vpsrad xmm1, xmm2, byte 5 + +psrlw xmm1, xmm2 +psrlw xmm1, [rax] +psrlw xmm1, dqword [rax] +vpsrlw xmm1, xmm2 +vpsrlw xmm1, [rax] +vpsrlw xmm1, dqword [rax] +vpsrlw xmm1, xmm2, xmm3 +vpsrlw xmm1, xmm2, [rax] +vpsrlw xmm1, xmm2, dqword [rax] +psrlw xmm1, 5 +psrlw xmm1, byte 5 +vpsrlw xmm1, 5 +vpsrlw xmm1, byte 5 +vpsrlw xmm1, xmm2, 5 +vpsrlw xmm1, xmm2, byte 5 + +psrld xmm1, xmm2 +psrld xmm1, [rax] +psrld xmm1, dqword [rax] +vpsrld xmm1, xmm2 +vpsrld xmm1, [rax] +vpsrld xmm1, dqword [rax] +vpsrld xmm1, xmm2, xmm3 +vpsrld xmm1, xmm2, [rax] +vpsrld xmm1, xmm2, dqword [rax] +psrld xmm1, 5 +psrld xmm1, byte 5 +vpsrld xmm1, 5 +vpsrld xmm1, byte 5 +vpsrld xmm1, xmm2, 5 +vpsrld xmm1, xmm2, byte 5 + +psrlq xmm1, xmm2 +psrlq xmm1, [rax] +psrlq xmm1, dqword [rax] +vpsrlq xmm1, xmm2 +vpsrlq xmm1, [rax] +vpsrlq xmm1, dqword [rax] +vpsrlq xmm1, xmm2, xmm3 +vpsrlq xmm1, xmm2, [rax] +vpsrlq xmm1, xmm2, dqword [rax] +psrlq xmm1, 5 +psrlq xmm1, byte 5 +vpsrlq xmm1, 5 +vpsrlq xmm1, byte 5 +vpsrlq xmm1, xmm2, 5 +vpsrlq xmm1, xmm2, byte 5 + +ptest xmm1, xmm2 +ptest xmm1, [rax] +ptest xmm1, dqword [rax] +vptest xmm1, xmm2 +vptest xmm1, [rax] +vptest xmm1, dqword [rax] +vptest ymm1, ymm2 +vptest ymm1, [rax] +vptest ymm1, yword [rax] + +vptestps xmm1, xmm2 +vptestps xmm1, [rax] +vptestps xmm1, dqword [rax] +vptestps ymm1, ymm2 +vptestps ymm1, [rax] +vptestps ymm1, yword [rax] + +vptestpd xmm1, xmm2 +vptestpd xmm1, [rax] +vptestpd xmm1, dqword [rax] +vptestpd ymm1, ymm2 +vptestpd ymm1, [rax] +vptestpd ymm1, yword [rax] + +psubb xmm1, xmm2 +psubb xmm1, [rax] +psubb xmm1, dqword [rax] +vpsubb xmm1, xmm2 +vpsubb xmm1, [rax] +vpsubb xmm1, dqword [rax] +vpsubb xmm1, xmm2, xmm3 +vpsubb xmm1, xmm2, [rax] +vpsubb xmm1, xmm2, dqword [rax] + +psubw xmm1, xmm2 +psubw xmm1, [rax] +psubw xmm1, dqword [rax] +vpsubw xmm1, xmm2 +vpsubw xmm1, [rax] +vpsubw xmm1, dqword [rax] +vpsubw xmm1, xmm2, xmm3 +vpsubw xmm1, xmm2, [rax] +vpsubw xmm1, xmm2, dqword [rax] + +psubd xmm1, xmm2 +psubd xmm1, [rax] +psubd xmm1, dqword [rax] +vpsubd xmm1, xmm2 +vpsubd xmm1, [rax] +vpsubd xmm1, dqword [rax] +vpsubd xmm1, xmm2, xmm3 +vpsubd xmm1, xmm2, [rax] +vpsubd xmm1, xmm2, dqword [rax] + +psubq xmm1, xmm2 +psubq xmm1, [rax] +psubq xmm1, dqword [rax] +vpsubq xmm1, xmm2 +vpsubq xmm1, [rax] +vpsubq xmm1, dqword [rax] +vpsubq xmm1, xmm2, xmm3 +vpsubq xmm1, xmm2, [rax] +vpsubq xmm1, xmm2, dqword [rax] + +psubsb xmm1, xmm2 +psubsb xmm1, [rax] +psubsb xmm1, dqword [rax] +vpsubsb xmm1, xmm2 +vpsubsb xmm1, [rax] +vpsubsb xmm1, dqword [rax] +vpsubsb xmm1, xmm2, xmm3 +vpsubsb xmm1, xmm2, [rax] +vpsubsb xmm1, xmm2, dqword [rax] + +psubsw xmm1, xmm2 +psubsw xmm1, [rax] +psubsw xmm1, dqword [rax] +vpsubsw xmm1, xmm2 +vpsubsw xmm1, [rax] +vpsubsw xmm1, dqword [rax] +vpsubsw xmm1, xmm2, xmm3 +vpsubsw xmm1, xmm2, [rax] +vpsubsw xmm1, xmm2, dqword [rax] + +psubusb xmm1, xmm2 +psubusb xmm1, [rax] +psubusb xmm1, dqword [rax] +vpsubusb xmm1, xmm2 +vpsubusb xmm1, [rax] +vpsubusb xmm1, dqword [rax] +vpsubusb xmm1, xmm2, xmm3 +vpsubusb xmm1, xmm2, [rax] +vpsubusb xmm1, xmm2, dqword [rax] + +psubusw xmm1, xmm2 +psubusw xmm1, [rax] +psubusw xmm1, dqword [rax] +vpsubusw xmm1, xmm2 +vpsubusw xmm1, [rax] +vpsubusw xmm1, dqword [rax] +vpsubusw xmm1, xmm2, xmm3 +vpsubusw xmm1, xmm2, [rax] +vpsubusw xmm1, xmm2, dqword [rax] + +punpckhbw xmm1, xmm2 +punpckhbw xmm1, [rax] +punpckhbw xmm1, dqword [rax] +vpunpckhbw xmm1, xmm2 +vpunpckhbw xmm1, [rax] +vpunpckhbw xmm1, dqword [rax] +vpunpckhbw xmm1, xmm2, xmm3 +vpunpckhbw xmm1, xmm2, [rax] +vpunpckhbw xmm1, xmm2, dqword [rax] + +punpckhwd xmm1, xmm2 +punpckhwd xmm1, [rax] +punpckhwd xmm1, dqword [rax] +vpunpckhwd xmm1, xmm2 +vpunpckhwd xmm1, [rax] +vpunpckhwd xmm1, dqword [rax] +vpunpckhwd xmm1, xmm2, xmm3 +vpunpckhwd xmm1, xmm2, [rax] +vpunpckhwd xmm1, xmm2, dqword [rax] + +punpckhdq xmm1, xmm2 +punpckhdq xmm1, [rax] +punpckhdq xmm1, dqword [rax] +vpunpckhdq xmm1, xmm2 +vpunpckhdq xmm1, [rax] +vpunpckhdq xmm1, dqword [rax] +vpunpckhdq xmm1, xmm2, xmm3 +vpunpckhdq xmm1, xmm2, [rax] +vpunpckhdq xmm1, xmm2, dqword [rax] + +punpckhqdq xmm1, xmm2 +punpckhqdq xmm1, [rax] +punpckhqdq xmm1, dqword [rax] +vpunpckhqdq xmm1, xmm2 +vpunpckhqdq xmm1, [rax] +vpunpckhqdq xmm1, dqword [rax] +vpunpckhqdq xmm1, xmm2, xmm3 +vpunpckhqdq xmm1, xmm2, [rax] +vpunpckhqdq xmm1, xmm2, dqword [rax] + +punpcklbw xmm1, xmm2 +punpcklbw xmm1, [rax] +punpcklbw xmm1, dqword [rax] +vpunpcklbw xmm1, xmm2 +vpunpcklbw xmm1, [rax] +vpunpcklbw xmm1, dqword [rax] +vpunpcklbw xmm1, xmm2, xmm3 +vpunpcklbw xmm1, xmm2, [rax] +vpunpcklbw xmm1, xmm2, dqword [rax] + +punpcklwd xmm1, xmm2 +punpcklwd xmm1, [rax] +punpcklwd xmm1, dqword [rax] +vpunpcklwd xmm1, xmm2 +vpunpcklwd xmm1, [rax] +vpunpcklwd xmm1, dqword [rax] +vpunpcklwd xmm1, xmm2, xmm3 +vpunpcklwd xmm1, xmm2, [rax] +vpunpcklwd xmm1, xmm2, dqword [rax] + +punpckldq xmm1, xmm2 +punpckldq xmm1, [rax] +punpckldq xmm1, dqword [rax] +vpunpckldq xmm1, xmm2 +vpunpckldq xmm1, [rax] +vpunpckldq xmm1, dqword [rax] +vpunpckldq xmm1, xmm2, xmm3 +vpunpckldq xmm1, xmm2, [rax] +vpunpckldq xmm1, xmm2, dqword [rax] + +punpcklqdq xmm1, xmm2 +punpcklqdq xmm1, [rax] +punpcklqdq xmm1, dqword [rax] +vpunpcklqdq xmm1, xmm2 +vpunpcklqdq xmm1, [rax] +vpunpcklqdq xmm1, dqword [rax] +vpunpcklqdq xmm1, xmm2, xmm3 +vpunpcklqdq xmm1, xmm2, [rax] +vpunpcklqdq xmm1, xmm2, dqword [rax] + +pxor xmm1, xmm2 +pxor xmm1, [rax] +pxor xmm1, dqword [rax] +vpxor xmm1, xmm2 +vpxor xmm1, [rax] +vpxor xmm1, dqword [rax] +vpxor xmm1, xmm2, xmm3 +vpxor xmm1, xmm2, [rax] +vpxor xmm1, xmm2, dqword [rax] + +rcpps xmm1, xmm2 +rcpps xmm1, [rax] +rcpps xmm1, dqword [rax] +vrcpps xmm1, xmm2 +vrcpps xmm1, [rax] +vrcpps xmm1, dqword [rax] +vrcpps ymm1, ymm2 +vrcpps ymm1, [rax] +vrcpps ymm1, yword [rax] + +rcpss xmm1, xmm2 +rcpss xmm1, [rax] +rcpss xmm1, dword [rax] +vrcpss xmm1, xmm2 +vrcpss xmm1, [rax] +vrcpss xmm1, dword [rax] +vrcpss xmm1, xmm2, xmm3 +vrcpss xmm1, xmm2, [rax] +vrcpss xmm1, xmm2, dword [rax] + +rsqrtps xmm1, xmm2 +rsqrtps xmm1, [rax] +rsqrtps xmm1, dqword [rax] +vrsqrtps xmm1, xmm2 +vrsqrtps xmm1, [rax] +vrsqrtps xmm1, dqword [rax] +vrsqrtps ymm1, ymm2 +vrsqrtps ymm1, [rax] +vrsqrtps ymm1, yword [rax] + +rsqrtss xmm1, xmm2 +rsqrtss xmm1, [rax] +rsqrtss xmm1, dword [rax] +vrsqrtss xmm1, xmm2 +vrsqrtss xmm1, [rax] +vrsqrtss xmm1, dword [rax] +vrsqrtss xmm1, xmm2, xmm3 +vrsqrtss xmm1, xmm2, [rax] +vrsqrtss xmm1, xmm2, dword [rax] + +roundpd xmm1, xmm2, 5 +roundpd xmm1, [rax], byte 5 +roundpd xmm1, dqword [rax], 5 +vroundpd xmm1, xmm2, 5 +vroundpd xmm1, [rax], byte 5 +vroundpd xmm1, dqword [rax], 5 +vroundpd ymm1, ymm2, 5 +vroundpd ymm1, [rax], byte 5 +vroundpd ymm1, yword [rax], 5 + +roundps xmm1, xmm2, 5 +roundps xmm1, [rax], byte 5 +roundps xmm1, dqword [rax], 5 +vroundps xmm1, xmm2, 5 +vroundps xmm1, [rax], byte 5 +vroundps xmm1, dqword [rax], 5 +vroundps ymm1, ymm2, 5 +vroundps ymm1, [rax], byte 5 +vroundps ymm1, yword [rax], 5 + +roundsd xmm1, xmm2, 5 +roundsd xmm1, [rax], byte 5 +roundsd xmm1, qword [rax], 5 +vroundsd xmm1, xmm2, 5 +vroundsd xmm1, [rax], byte 5 +vroundsd xmm1, qword [rax], 5 +vroundsd xmm1, xmm2, xmm3, 5 +vroundsd xmm1, xmm2, [rax], byte 5 +vroundsd xmm1, xmm2, qword [rax], 5 + +roundss xmm1, xmm2, 5 +roundss xmm1, [rax], byte 5 +roundss xmm1, dword [rax], 5 +vroundss xmm1, xmm2, 5 +vroundss xmm1, [rax], byte 5 +vroundss xmm1, dword [rax], 5 +vroundss xmm1, xmm2, xmm3, 5 +vroundss xmm1, xmm2, [rax], byte 5 +vroundss xmm1, xmm2, dword [rax], 5 + +shufpd xmm1, xmm2, 5 +shufpd xmm1, [rax], byte 5 +shufpd xmm1, dqword [rax], 5 +vshufpd xmm1, xmm2, 5 +vshufpd xmm1, [rax], byte 5 +vshufpd xmm1, dqword [rax], 5 +vshufpd xmm1, xmm2, xmm3, 5 +vshufpd xmm1, xmm2, [rax], byte 5 +vshufpd xmm1, xmm2, dqword [rax], 5 +vshufpd ymm1, ymm2, ymm3, 5 +vshufpd ymm1, ymm2, [rax], byte 5 +vshufpd ymm1, ymm2, yword [rax], 5 + +shufps xmm1, xmm2, 5 +shufps xmm1, [rax], byte 5 +shufps xmm1, dqword [rax], 5 +vshufps xmm1, xmm2, 5 +vshufps xmm1, [rax], byte 5 +vshufps xmm1, dqword [rax], 5 +vshufps xmm1, xmm2, xmm3, 5 +vshufps xmm1, xmm2, [rax], byte 5 +vshufps xmm1, xmm2, dqword [rax], 5 +vshufps ymm1, ymm2, ymm3, 5 +vshufps ymm1, ymm2, [rax], byte 5 +vshufps ymm1, ymm2, yword [rax], 5 + +sqrtpd xmm1, xmm2 +sqrtpd xmm1, [rax] +sqrtpd xmm1, dqword [rax] +vsqrtpd xmm1, xmm2 +vsqrtpd xmm1, [rax] +vsqrtpd xmm1, dqword [rax] +vsqrtpd ymm1, ymm2 +vsqrtpd ymm1, [rax] +vsqrtpd ymm1, yword [rax] + +sqrtps xmm1, xmm2 +sqrtps xmm1, [rax] +sqrtps xmm1, dqword [rax] +vsqrtps xmm1, xmm2 +vsqrtps xmm1, [rax] +vsqrtps xmm1, dqword [rax] +vsqrtps ymm1, ymm2 +vsqrtps ymm1, [rax] +vsqrtps ymm1, yword [rax] + +sqrtsd xmm1, xmm2 +sqrtsd xmm1, [rax] +sqrtsd xmm1, qword [rax] +vsqrtsd xmm1, xmm2 +vsqrtsd xmm1, [rax] +vsqrtsd xmm1, qword [rax] +vsqrtsd xmm1, xmm2, xmm3 +vsqrtsd xmm1, xmm2, [rax] +vsqrtsd xmm1, xmm2, qword [rax] + +sqrtss xmm1, xmm2 +sqrtss xmm1, [rax] +sqrtss xmm1, dword [rax] +vsqrtss xmm1, xmm2 +vsqrtss xmm1, [rax] +vsqrtss xmm1, dword [rax] +vsqrtss xmm1, xmm2, xmm3 +vsqrtss xmm1, xmm2, [rax] +vsqrtss xmm1, xmm2, dword [rax] + +stmxcsr [rax] +stmxcsr dword [rax] +vstmxcsr [rax] +vstmxcsr dword [rax] + +subpd xmm1, xmm2 +subpd xmm1, [rax] +subpd xmm1, dqword [rax] +vsubpd xmm1, xmm2 +vsubpd xmm1, [rax] +vsubpd xmm1, dqword [rax] +vsubpd xmm1, xmm2, xmm3 +vsubpd xmm1, xmm2, [rax] +vsubpd xmm1, xmm2, dqword [rax] +vsubpd ymm1, ymm2, ymm3 +vsubpd ymm1, ymm2, [rax] +vsubpd ymm1, ymm2, yword [rax] + +subps xmm1, xmm2 +subps xmm1, [rax] +subps xmm1, dqword [rax] +vsubps xmm1, xmm2 +vsubps xmm1, [rax] +vsubps xmm1, dqword [rax] +vsubps xmm1, xmm2, xmm3 +vsubps xmm1, xmm2, [rax] +vsubps xmm1, xmm2, dqword [rax] +vsubps ymm1, ymm2, ymm3 +vsubps ymm1, ymm2, [rax] +vsubps ymm1, ymm2, yword [rax] + +subsd xmm1, xmm2 +subsd xmm1, [rax] +subsd xmm1, qword [rax] +vsubsd xmm1, xmm2 +vsubsd xmm1, [rax] +vsubsd xmm1, qword [rax] +vsubsd xmm1, xmm2, xmm3 +vsubsd xmm1, xmm2, [rax] +vsubsd xmm1, xmm2, qword [rax] + +subss xmm1, xmm2 +subss xmm1, [rax] +subss xmm1, dword [rax] +vsubss xmm1, xmm2 +vsubss xmm1, [rax] +vsubss xmm1, dword [rax] +vsubss xmm1, xmm2, xmm3 +vsubss xmm1, xmm2, [rax] +vsubss xmm1, xmm2, dword [rax] + +ucomisd xmm1, xmm2 +ucomisd xmm1, [rax] +ucomisd xmm1, qword [rax] +vucomisd xmm1, xmm2 +vucomisd xmm1, [rax] +vucomisd xmm1, qword [rax] + +ucomiss xmm1, xmm2 +ucomiss xmm1, [rax] +ucomiss xmm1, dword [rax] +vucomiss xmm1, xmm2 +vucomiss xmm1, [rax] +vucomiss xmm1, dword [rax] + +unpckhpd xmm1, xmm2 +unpckhpd xmm1, [rax] +unpckhpd xmm1, dqword [rax] +vunpckhpd xmm1, xmm2 +vunpckhpd xmm1, [rax] +vunpckhpd xmm1, dqword [rax] +vunpckhpd xmm1, xmm2, xmm3 +vunpckhpd xmm1, xmm2, [rax] +vunpckhpd xmm1, xmm2, dqword [rax] +vunpckhpd ymm1, ymm2, ymm3 +vunpckhpd ymm1, ymm2, [rax] +vunpckhpd ymm1, ymm2, yword [rax] + +unpckhps xmm1, xmm2 +unpckhps xmm1, [rax] +unpckhps xmm1, dqword [rax] +vunpckhps xmm1, xmm2 +vunpckhps xmm1, [rax] +vunpckhps xmm1, dqword [rax] +vunpckhps xmm1, xmm2, xmm3 +vunpckhps xmm1, xmm2, [rax] +vunpckhps xmm1, xmm2, dqword [rax] +vunpckhps ymm1, ymm2, ymm3 +vunpckhps ymm1, ymm2, [rax] +vunpckhps ymm1, ymm2, yword [rax] + +unpcklpd xmm1, xmm2 +unpcklpd xmm1, [rax] +unpcklpd xmm1, dqword [rax] +vunpcklpd xmm1, xmm2 +vunpcklpd xmm1, [rax] +vunpcklpd xmm1, dqword [rax] +vunpcklpd xmm1, xmm2, xmm3 +vunpcklpd xmm1, xmm2, [rax] +vunpcklpd xmm1, xmm2, dqword [rax] +vunpcklpd ymm1, ymm2, ymm3 +vunpcklpd ymm1, ymm2, [rax] +vunpcklpd ymm1, ymm2, yword [rax] + +unpcklps xmm1, xmm2 +unpcklps xmm1, [rax] +unpcklps xmm1, dqword [rax] +vunpcklps xmm1, xmm2 +vunpcklps xmm1, [rax] +vunpcklps xmm1, dqword [rax] +vunpcklps xmm1, xmm2, xmm3 +vunpcklps xmm1, xmm2, [rax] +vunpcklps xmm1, xmm2, dqword [rax] +vunpcklps ymm1, ymm2, ymm3 +vunpcklps ymm1, ymm2, [rax] +vunpcklps ymm1, ymm2, yword [rax] + +xorpd xmm1, xmm2 +xorpd xmm1, [rax] +xorpd xmm1, dqword [rax] +vxorpd xmm1, xmm2 +vxorpd xmm1, [rax] +vxorpd xmm1, dqword [rax] +vxorpd xmm1, xmm2, xmm3 +vxorpd xmm1, xmm2, [rax] +vxorpd xmm1, xmm2, dqword [rax] +vxorpd ymm1, ymm2, ymm3 +vxorpd ymm1, ymm2, [rax] +vxorpd ymm1, ymm2, yword [rax] + +xorps xmm1, xmm2 +xorps xmm1, [rax] +xorps xmm1, dqword [rax] +vxorps xmm1, xmm2 +vxorps xmm1, [rax] +vxorps xmm1, dqword [rax] +vxorps xmm1, xmm2, xmm3 +vxorps xmm1, xmm2, [rax] +vxorps xmm1, xmm2, dqword [rax] +vxorps ymm1, ymm2, ymm3 +vxorps ymm1, ymm2, [rax] +vxorps ymm1, ymm2, yword [rax] + +vzeroall + +vzeroupper + diff --git a/modules/arch/x86/tests/avx.hex b/modules/arch/x86/tests/avx.hex new file mode 100644 index 00000000..39d5c839 --- /dev/null +++ b/modules/arch/x86/tests/avx.hex @@ -0,0 +1,10430 @@ +66 +0f +58 +ca +66 +0f +58 +08 +66 +0f +58 +08 +66 +45 +0f +58 +d4 +66 +46 +0f +58 +14 +b8 +66 +47 +0f +58 +14 +be +c5 +f1 +58 +ca +c5 +f1 +58 +08 +c5 +f1 +58 +08 +c4 +41 +29 +58 +d4 +c4 +21 +29 +58 +14 +b8 +c4 +01 +29 +58 +14 +be +c5 +e9 +58 +cb +c5 +e9 +58 +08 +c5 +e9 +58 +08 +c4 +41 +19 +58 +d5 +c4 +21 +19 +58 +14 +b8 +c4 +01 +19 +58 +14 +be +c5 +ed +58 +cb +c5 +ed +58 +08 +c5 +ed +58 +08 +c4 +41 +1d +58 +d5 +c4 +21 +1d +58 +14 +b8 +c4 +01 +1d +58 +14 +be +0f +58 +ca +0f +58 +08 +0f +58 +08 +c5 +f0 +58 +ca +c5 +f0 +58 +08 +c5 +f0 +58 +08 +c5 +e8 +58 +cb +c5 +e8 +58 +08 +c5 +e8 +58 +08 +c5 +ec +58 +cb +c5 +ec +58 +08 +c5 +ec +58 +08 +f2 +0f +58 +ca +f2 +0f +58 +08 +f2 +0f +58 +08 +c5 +f3 +58 +ca +c5 +f3 +58 +08 +c5 +f3 +58 +08 +c5 +eb +58 +cb +c5 +eb +58 +08 +c5 +eb +58 +08 +f3 +0f +58 +ca +f3 +0f +58 +08 +f3 +0f +58 +08 +c5 +f2 +58 +ca +c5 +f2 +58 +08 +c5 +f2 +58 +08 +c5 +ea +58 +cb +c5 +ea +58 +08 +c5 +ea +58 +08 +66 +0f +d0 +ca +66 +0f +d0 +08 +66 +0f +d0 +08 +c5 +f1 +d0 +ca +c5 +f1 +d0 +08 +c5 +f1 +d0 +08 +c5 +e9 +d0 +cb +c5 +e9 +d0 +08 +c5 +e9 +d0 +08 +c5 +ed +d0 +cb +c5 +ed +d0 +08 +c5 +ed +d0 +08 +f2 +0f +d0 +ca +f2 +0f +d0 +08 +f2 +0f +d0 +08 +c5 +f3 +d0 +ca +c5 +f3 +d0 +08 +c5 +f3 +d0 +08 +c5 +eb +d0 +cb +c5 +eb +d0 +08 +c5 +eb +d0 +08 +c5 +ef +d0 +cb +c5 +ef +d0 +08 +c5 +ef +d0 +08 +66 +0f +54 +ca +66 +0f +54 +08 +66 +0f +54 +08 +c5 +f1 +54 +ca +c5 +f1 +54 +08 +c5 +f1 +54 +08 +c5 +e9 +54 +cb +c5 +e9 +54 +08 +c5 +e9 +54 +08 +c5 +ed +54 +cb +c5 +ed +54 +08 +c5 +ed +54 +08 +0f +54 +ca +0f +54 +08 +0f +54 +08 +c5 +f0 +54 +ca +c5 +f0 +54 +08 +c5 +f0 +54 +08 +c5 +e8 +54 +cb +c5 +e8 +54 +08 +c5 +e8 +54 +08 +c5 +ec +54 +cb +c5 +ec +54 +08 +c5 +ec +54 +08 +66 +0f +55 +ca +66 +0f +55 +08 +66 +0f +55 +08 +c5 +f1 +55 +ca +c5 +f1 +55 +08 +c5 +f1 +55 +08 +c5 +e9 +55 +cb +c5 +e9 +55 +08 +c5 +e9 +55 +08 +c5 +ed +55 +cb +c5 +ed +55 +08 +c5 +ed +55 +08 +0f +55 +ca +0f +55 +08 +0f +55 +08 +c5 +f0 +55 +ca +c5 +f0 +55 +08 +c5 +f0 +55 +08 +c5 +e8 +55 +cb +c5 +e8 +55 +08 +c5 +e8 +55 +08 +c5 +ec +55 +cb +c5 +ec +55 +08 +c5 +ec +55 +08 +66 +0f +3a +0d +ca +05 +66 +0f +3a +0d +08 +05 +66 +0f +3a +0d +08 +05 +c4 +e3 +71 +0d +ca +05 +c4 +e3 +71 +0d +08 +05 +c4 +e3 +71 +0d +08 +05 +c4 +e3 +69 +0d +cb +05 +c4 +e3 +69 +0d +08 +05 +c4 +e3 +69 +0d +08 +05 +c4 +e3 +6d +0d +cb +05 +c4 +e3 +6d +0d +08 +05 +c4 +e3 +6d +0d +08 +05 +66 +0f +3a +0c +ca +05 +66 +0f +3a +0c +08 +05 +66 +0f +3a +0c +08 +05 +c4 +e3 +71 +0c +ca +05 +c4 +e3 +71 +0c +08 +05 +c4 +e3 +71 +0c +08 +05 +c4 +e3 +69 +0c +cb +05 +c4 +e3 +69 +0c +08 +05 +c4 +e3 +69 +0c +08 +05 +c4 +e3 +6d +0c +cb +05 +c4 +e3 +6d +0c +08 +05 +c4 +e3 +6d +0c +08 +05 +66 +0f +38 +15 +cb +66 +0f +38 +15 +08 +66 +0f +38 +15 +08 +66 +0f +38 +15 +cb +66 +0f +38 +15 +08 +66 +0f +38 +15 +08 +c4 +e3 +69 +4b +cb +40 +c4 +e3 +69 +4b +08 +40 +c4 +e3 +69 +4b +08 +40 +c4 +e3 +6d +4b +cb +40 +c4 +e3 +6d +4b +08 +40 +c4 +e3 +6d +4b +08 +40 +66 +0f +38 +14 +cb +66 +0f +38 +14 +08 +66 +0f +38 +14 +08 +66 +0f +38 +14 +cb +66 +0f +38 +14 +08 +66 +0f +38 +14 +08 +c4 +e3 +69 +4a +cb +40 +c4 +e3 +69 +4a +08 +40 +c4 +e3 +69 +4a +08 +40 +c4 +e3 +6d +4a +cb +40 +c4 +e3 +6d +4a +08 +40 +c4 +e3 +6d +4a +08 +40 +c4 +e2 +79 +18 +08 +c4 +e2 +79 +18 +08 +c4 +e2 +7d +18 +08 +c4 +e2 +7d +18 +08 +c4 +e2 +7d +19 +08 +c4 +e2 +7d +19 +08 +c4 +e2 +7d +1a +08 +c4 +e2 +7d +1a +08 +66 +0f +c2 +ca +05 +66 +0f +c2 +08 +05 +66 +0f +c2 +08 +05 +c5 +f1 +c2 +ca +05 +c5 +f1 +c2 +08 +05 +c5 +f1 +c2 +08 +05 +c5 +e9 +c2 +cb +05 +c5 +e9 +c2 +08 +05 +c5 +e9 +c2 +08 +05 +c5 +ed +c2 +cb +05 +c5 +ed +c2 +08 +05 +c5 +ed +c2 +08 +05 +0f +c2 +ca +05 +0f +c2 +08 +05 +0f +c2 +08 +05 +c5 +f0 +c2 +ca +05 +c5 +f0 +c2 +08 +05 +c5 +f0 +c2 +08 +05 +c5 +e8 +c2 +cb +05 +c5 +e8 +c2 +08 +05 +c5 +e8 +c2 +08 +05 +c5 +ec +c2 +cb +05 +c5 +ec +c2 +08 +05 +c5 +ec +c2 +08 +05 +f2 +0f +c2 +ca +05 +f2 +0f +c2 +08 +05 +f2 +0f +c2 +08 +05 +c5 +f3 +c2 +ca +05 +c5 +f3 +c2 +08 +05 +c5 +f3 +c2 +08 +05 +c5 +eb +c2 +cb +05 +c5 +eb +c2 +08 +05 +c5 +eb +c2 +08 +05 +f3 +0f +c2 +ca +05 +f3 +0f +c2 +08 +05 +f3 +0f +c2 +08 +05 +c5 +f2 +c2 +ca +05 +c5 +f2 +c2 +08 +05 +c5 +f2 +c2 +08 +05 +c5 +ea +c2 +cb +05 +c5 +ea +c2 +08 +05 +c5 +ea +c2 +08 +05 +66 +0f +2f +ca +66 +0f +2f +08 +66 +0f +2f +08 +c5 +f1 +2f +ca +c5 +f1 +2f +08 +c5 +f1 +2f +08 +0f +2f +ca +0f +2f +08 +0f +2f +08 +c5 +f0 +2f +ca +c5 +f0 +2f +08 +c5 +f0 +2f +08 +f3 +0f +e6 +ca +f3 +0f +e6 +08 +f3 +0f +e6 +08 +c5 +fa +e6 +ca +c5 +fa +e6 +08 +c5 +fa +e6 +08 +c5 +fe +e6 +ca +c5 +fe +e6 +08 +c5 +fe +e6 +08 +0f +5b +ca +0f +5b +08 +0f +5b +08 +c5 +f8 +5b +ca +c5 +f8 +5b +08 +c5 +f8 +5b +08 +c5 +fc +5b +ca +c5 +fc +5b +08 +c5 +fc +5b +08 +f2 +0f +e6 +ca +f2 +0f +e6 +08 +f2 +0f +e6 +08 +c5 +fb +e6 +ca +c5 +fb +e6 +08 +c5 +ff +e6 +ca +c5 +ff +e6 +08 +66 +0f +5a +ca +66 +0f +5a +08 +66 +0f +5a +08 +c5 +f9 +5a +ca +c5 +f9 +5a +08 +c5 +fd +5a +ca +c5 +fd +5a +08 +66 +0f +5b +ca +66 +0f +5b +08 +66 +0f +5b +08 +c5 +f9 +5b +ca +c5 +f9 +5b +08 +c5 +f9 +5b +08 +c5 +fd +5b +ca +c5 +fd +5b +08 +c5 +fd +5b +08 +0f +5a +ca +0f +5a +08 +0f +5a +08 +c5 +f8 +5a +ca +c5 +f8 +5a +08 +c5 +f8 +5a +08 +c5 +fc +5a +ca +c5 +fc +5a +08 +c5 +fc +5a +08 +f2 +0f +2d +c2 +f2 +0f +2d +00 +f2 +0f +2d +00 +c5 +fb +2d +c2 +c5 +fb +2d +00 +c5 +fb +2d +00 +f2 +48 +0f +2d +c2 +f2 +48 +0f +2d +00 +f2 +48 +0f +2d +00 +c4 +e1 +fb +2d +c2 +c4 +e1 +fb +2d +00 +c4 +e1 +fb +2d +00 +f2 +0f +5a +ca +f2 +0f +5a +08 +f2 +0f +5a +08 +c5 +f3 +5a +ca +c5 +f3 +5a +08 +c5 +f3 +5a +08 +c5 +eb +5a +cb +c5 +eb +5a +08 +c5 +eb +5a +08 +f2 +0f +2a +c8 +f2 +0f +2a +08 +c5 +f3 +2a +c8 +c5 +f3 +2a +08 +c5 +eb +2a +c8 +c5 +eb +2a +08 +f2 +48 +0f +2a +c8 +f2 +48 +0f +2a +08 +c4 +e1 +f3 +2a +c8 +c4 +e1 +f3 +2a +08 +c4 +e1 +eb +2a +c8 +c4 +e1 +eb +2a +08 +f3 +0f +2a +c8 +f3 +0f +2a +08 +c5 +f2 +2a +c8 +c5 +f2 +2a +08 +c5 +ea +2a +c8 +c5 +ea +2a +08 +f3 +48 +0f +2a +c8 +f3 +48 +0f +2a +08 +c4 +e1 +f2 +2a +c8 +c4 +e1 +f2 +2a +08 +c4 +e1 +ea +2a +c8 +c4 +e1 +ea +2a +08 +f3 +0f +5a +ca +f3 +0f +5a +08 +f3 +0f +5a +08 +c5 +f2 +5a +ca +c5 +f2 +5a +08 +c5 +f2 +5a +08 +c5 +ea +5a +cb +c5 +ea +5a +08 +c5 +ea +5a +08 +f3 +0f +2d +c2 +f3 +0f +2d +00 +f3 +0f +2d +00 +c5 +fa +2d +c2 +c5 +fa +2d +00 +c5 +fa +2d +00 +f3 +48 +0f +2d +c2 +f3 +48 +0f +2d +00 +f3 +48 +0f +2d +00 +c4 +e1 +fa +2d +c2 +c4 +e1 +fa +2d +00 +c4 +e1 +fa +2d +00 +66 +0f +e6 +ca +66 +0f +e6 +08 +66 +0f +e6 +08 +c5 +f9 +e6 +ca +c5 +f9 +e6 +08 +c5 +fd +e6 +ca +c5 +fd +e6 +08 +f3 +0f +5b +ca +f3 +0f +5b +08 +f3 +0f +5b +08 +c5 +fa +5b +ca +c5 +fa +5b +08 +c5 +fa +5b +08 +c5 +fe +5b +ca +c5 +fe +5b +08 +c5 +fe +5b +08 +f2 +0f +2c +c2 +f2 +0f +2c +00 +f2 +0f +2c +00 +c5 +fb +2c +c2 +c5 +fb +2c +00 +c5 +fb +2c +00 +f2 +48 +0f +2c +c2 +f2 +48 +0f +2c +00 +f2 +48 +0f +2c +00 +c4 +e1 +fb +2c +c2 +c4 +e1 +fb +2c +00 +c4 +e1 +fb +2c +00 +f3 +0f +2c +c2 +f3 +0f +2c +00 +f3 +0f +2c +00 +c5 +fa +2c +c2 +c5 +fa +2c +00 +c5 +fa +2c +00 +f3 +48 +0f +2c +c2 +f3 +48 +0f +2c +00 +f3 +48 +0f +2c +00 +c4 +e1 +fa +2c +c2 +c4 +e1 +fa +2c +00 +c4 +e1 +fa +2c +00 +66 +0f +5e +ca +66 +0f +5e +08 +66 +0f +5e +08 +c5 +f1 +5e +ca +c5 +f1 +5e +08 +c5 +f1 +5e +08 +c5 +e9 +5e +cb +c5 +e9 +5e +08 +c5 +e9 +5e +08 +c5 +ed +5e +cb +c5 +ed +5e +08 +c5 +ed +5e +08 +0f +5e +ca +0f +5e +08 +0f +5e +08 +c5 +f0 +5e +ca +c5 +f0 +5e +08 +c5 +f0 +5e +08 +c5 +e8 +5e +cb +c5 +e8 +5e +08 +c5 +e8 +5e +08 +c5 +ec +5e +cb +c5 +ec +5e +08 +c5 +ec +5e +08 +f2 +0f +5e +ca +f2 +0f +5e +08 +f2 +0f +5e +08 +c5 +f3 +5e +ca +c5 +f3 +5e +08 +c5 +f3 +5e +08 +c5 +eb +5e +cb +c5 +eb +5e +08 +c5 +eb +5e +08 +f3 +0f +5e +ca +f3 +0f +5e +08 +f3 +0f +5e +08 +c5 +f2 +5e +ca +c5 +f2 +5e +08 +c5 +f2 +5e +08 +c5 +ea +5e +cb +c5 +ea +5e +08 +c5 +ea +5e +08 +66 +0f +3a +41 +ca +05 +66 +0f +3a +41 +08 +05 +66 +0f +3a +41 +08 +05 +c4 +e3 +71 +41 +ca +05 +c4 +e3 +71 +41 +08 +05 +c4 +e3 +71 +41 +08 +05 +c4 +e3 +69 +41 +cb +05 +c4 +e3 +69 +41 +08 +05 +c4 +e3 +69 +41 +08 +05 +66 +0f +3a +40 +ca +05 +66 +0f +3a +40 +08 +05 +66 +0f +3a +40 +08 +05 +c4 +e3 +71 +40 +ca +05 +c4 +e3 +71 +40 +08 +05 +c4 +e3 +71 +40 +08 +05 +c4 +e3 +69 +40 +cb +05 +c4 +e3 +69 +40 +08 +05 +c4 +e3 +69 +40 +08 +05 +c4 +e3 +6d +40 +cb +05 +c4 +e3 +6d +40 +08 +05 +c4 +e3 +6d +40 +08 +05 +c4 +e3 +7d +19 +d1 +05 +c4 +e3 +7d +19 +10 +05 +c4 +e3 +7d +19 +10 +05 +66 +0f +3a +17 +c8 +05 +66 +48 +0f +3a +17 +c8 +05 +66 +0f +3a +17 +08 +05 +66 +0f +3a +17 +08 +05 +c4 +e3 +79 +17 +c8 +05 +c4 +e3 +f9 +17 +c8 +05 +c4 +e3 +79 +17 +08 +05 +c4 +e3 +79 +17 +08 +05 +66 +0f +7c +ca +66 +0f +7c +08 +66 +0f +7c +08 +c5 +f1 +7c +ca +c5 +f1 +7c +08 +c5 +f1 +7c +08 +c5 +e9 +7c +cb +c5 +e9 +7c +08 +c5 +e9 +7c +08 +c5 +ed +7c +cb +c5 +ed +7c +08 +c5 +ed +7c +08 +f2 +0f +7c +ca +f2 +0f +7c +08 +f2 +0f +7c +08 +c5 +f3 +7c +ca +c5 +f3 +7c +08 +c5 +f3 +7c +08 +c5 +eb +7c +cb +c5 +eb +7c +08 +c5 +eb +7c +08 +c5 +ef +7c +cb +c5 +ef +7c +08 +c5 +ef +7c +08 +66 +0f +7d +ca +66 +0f +7d +08 +66 +0f +7d +08 +c5 +f1 +7d +ca +c5 +f1 +7d +08 +c5 +f1 +7d +08 +c5 +e9 +7d +cb +c5 +e9 +7d +08 +c5 +e9 +7d +08 +c5 +ed +7d +cb +c5 +ed +7d +08 +c5 +ed +7d +08 +f2 +0f +7d +ca +f2 +0f +7d +08 +f2 +0f +7d +08 +c5 +f3 +7d +ca +c5 +f3 +7d +08 +c5 +f3 +7d +08 +c5 +eb +7d +cb +c5 +eb +7d +08 +c5 +eb +7d +08 +c5 +ef +7d +cb +c5 +ef +7d +08 +c5 +ef +7d +08 +c4 +e3 +6d +18 +cb +05 +c4 +e3 +6d +18 +08 +05 +c4 +e3 +6d +18 +08 +05 +66 +0f +3a +21 +ca +05 +66 +0f +3a +21 +08 +05 +66 +0f +3a +21 +08 +05 +c4 +e3 +71 +21 +ca +05 +c4 +e3 +71 +21 +08 +05 +c4 +e3 +71 +21 +08 +05 +c4 +e3 +69 +21 +cb +05 +c4 +e3 +69 +21 +08 +05 +c4 +e3 +69 +21 +08 +05 +f2 +0f +f0 +08 +f2 +0f +f0 +08 +c5 +fb +f0 +08 +c5 +fb +f0 +08 +c5 +ff +f0 +08 +c5 +ff +f0 +08 +0f +ae +10 +0f +ae +10 +c5 +f8 +ae +10 +c5 +f8 +ae +10 +66 +0f +f7 +ca +c5 +f9 +f7 +ca +c4 +e2 +69 +2c +08 +c4 +e2 +69 +2c +08 +c4 +e2 +6d +2c +08 +c4 +e2 +6d +2c +08 +c4 +e2 +69 +2e +18 +c4 +e2 +69 +2e +18 +c4 +e2 +6d +2e +18 +c4 +e2 +6d +2e +18 +c4 +e2 +69 +2d +08 +c4 +e2 +69 +2d +08 +c4 +e2 +6d +2d +08 +c4 +e2 +6d +2d +08 +c4 +e2 +69 +2f +18 +c4 +e2 +69 +2f +18 +c4 +e2 +6d +2f +18 +c4 +e2 +6d +2f +18 +66 +0f +5f +ca +66 +0f +5f +08 +66 +0f +5f +08 +c5 +f1 +5f +ca +c5 +f1 +5f +08 +c5 +f1 +5f +08 +c5 +e9 +5f +cb +c5 +e9 +5f +08 +c5 +e9 +5f +08 +c5 +ed +5f +cb +c5 +ed +5f +08 +c5 +ed +5f +08 +0f +5f +ca +0f +5f +08 +0f +5f +08 +c5 +f0 +5f +ca +c5 +f0 +5f +08 +c5 +f0 +5f +08 +c5 +e8 +5f +cb +c5 +e8 +5f +08 +c5 +e8 +5f +08 +c5 +ec +5f +cb +c5 +ec +5f +08 +c5 +ec +5f +08 +f2 +0f +5f +ca +f2 +0f +5f +08 +f2 +0f +5f +08 +c5 +f3 +5f +ca +c5 +f3 +5f +08 +c5 +f3 +5f +08 +c5 +eb +5f +cb +c5 +eb +5f +08 +c5 +eb +5f +08 +f3 +0f +5f +ca +f3 +0f +5f +08 +f3 +0f +5f +08 +c5 +f2 +5f +ca +c5 +f2 +5f +08 +c5 +f2 +5f +08 +c5 +ea +5f +cb +c5 +ea +5f +08 +c5 +ea +5f +08 +66 +0f +5d +ca +66 +0f +5d +08 +66 +0f +5d +08 +c5 +f1 +5d +ca +c5 +f1 +5d +08 +c5 +f1 +5d +08 +c5 +e9 +5d +cb +c5 +e9 +5d +08 +c5 +e9 +5d +08 +c5 +ed +5d +cb +c5 +ed +5d +08 +c5 +ed +5d +08 +0f +5d +ca +0f +5d +08 +0f +5d +08 +c5 +f0 +5d +ca +c5 +f0 +5d +08 +c5 +f0 +5d +08 +c5 +e8 +5d +cb +c5 +e8 +5d +08 +c5 +e8 +5d +08 +c5 +ec +5d +cb +c5 +ec +5d +08 +c5 +ec +5d +08 +f2 +0f +5d +ca +f2 +0f +5d +08 +f2 +0f +5d +08 +c5 +f3 +5d +ca +c5 +f3 +5d +08 +c5 +f3 +5d +08 +c5 +eb +5d +cb +c5 +eb +5d +08 +c5 +eb +5d +08 +f3 +0f +5d +ca +f3 +0f +5d +08 +f3 +0f +5d +08 +c5 +f2 +5d +ca +c5 +f2 +5d +08 +c5 +f2 +5d +08 +c5 +ea +5d +cb +c5 +ea +5d +08 +c5 +ea +5d +08 +66 +0f +28 +ca +66 +0f +28 +08 +66 +0f +28 +08 +c5 +f9 +28 +ca +c5 +f9 +28 +08 +c5 +f9 +28 +08 +66 +0f +29 +10 +66 +0f +29 +10 +c5 +f9 +29 +10 +c5 +f9 +29 +10 +c5 +fd +28 +ca +c5 +fd +28 +08 +c5 +fd +28 +08 +c5 +fd +29 +10 +c5 +fd +29 +10 +0f +28 +ca +0f +28 +08 +0f +28 +08 +c5 +f8 +28 +ca +c5 +f8 +28 +08 +c5 +f8 +28 +08 +0f +29 +10 +0f +29 +10 +c5 +f8 +29 +10 +c5 +f8 +29 +10 +c5 +fc +28 +ca +c5 +fc +28 +08 +c5 +fc +28 +08 +c5 +fc +29 +10 +c5 +fc +29 +10 +66 +0f +6e +c8 +66 +0f +6e +08 +66 +0f +6e +08 +c5 +f9 +6e +c8 +c5 +f9 +6e +08 +c5 +f9 +6e +08 +66 +0f +7e +d0 +66 +0f +7e +10 +66 +0f +7e +10 +c5 +f9 +7e +d0 +c5 +f9 +7e +10 +c5 +f9 +7e +10 +66 +48 +0f +6e +c8 +f3 +0f +7e +08 +f3 +0f +7e +08 +c4 +e1 +f9 +6e +c8 +c5 +fa +7e +08 +c5 +fa +7e +08 +66 +48 +0f +7e +d0 +66 +0f +d6 +10 +66 +0f +d6 +10 +c4 +e1 +f9 +7e +d0 +c5 +f9 +d6 +10 +c5 +f9 +d6 +10 +f3 +0f +7e +ca +f3 +0f +7e +08 +f3 +0f +7e +08 +c5 +fa +7e +ca +c5 +fa +7e +08 +c5 +fa +7e +08 +66 +0f +d6 +08 +66 +0f +d6 +08 +c5 +f9 +d6 +08 +c5 +f9 +d6 +08 +f2 +0f +12 +ca +f2 +0f +12 +08 +f2 +0f +12 +08 +c5 +f3 +12 +ca +c5 +f3 +12 +08 +c5 +f3 +12 +08 +c5 +ff +12 +ca +c5 +ff +12 +08 +c5 +ff +12 +08 +66 +0f +6f +ca +66 +0f +6f +08 +66 +0f +6f +08 +66 +0f +7f +10 +66 +0f +7f +10 +c5 +f9 +6f +ca +c5 +f9 +6f +08 +c5 +f9 +6f +08 +c5 +f9 +7f +10 +c5 +f9 +7f +10 +c5 +fd +6f +ca +c5 +fd +6f +08 +c5 +fd +6f +08 +c5 +fd +7f +10 +c5 +fd +7f +10 +f3 +0f +6f +ca +f3 +0f +6f +08 +f3 +0f +6f +08 +f3 +0f +7f +10 +f3 +0f +7f +10 +c5 +fa +6f +ca +c5 +fa +6f +08 +c5 +fa +6f +08 +c5 +fa +7f +10 +c5 +fa +7f +10 +c5 +fe +6f +ca +c5 +fe +6f +08 +c5 +fe +6f +08 +c5 +fe +7f +10 +c5 +fe +7f +10 +0f +12 +ca +c5 +f0 +12 +ca +c5 +e8 +12 +cb +66 +0f +16 +08 +66 +0f +16 +08 +c5 +f1 +16 +08 +c5 +f1 +16 +08 +c5 +e9 +16 +08 +c5 +e9 +16 +08 +66 +0f +17 +10 +66 +0f +17 +10 +c5 +f9 +17 +10 +c5 +f9 +17 +10 +0f +16 +08 +0f +16 +08 +c5 +f0 +16 +08 +c5 +f0 +16 +08 +c5 +e8 +16 +08 +c5 +e8 +16 +08 +0f +17 +10 +0f +17 +10 +c5 +f8 +17 +10 +c5 +f8 +17 +10 +0f +12 +ca +c5 +f0 +12 +ca +c5 +e8 +12 +cb +66 +0f +12 +08 +66 +0f +12 +08 +c5 +f1 +12 +08 +c5 +f1 +12 +08 +c5 +e9 +12 +08 +c5 +e9 +12 +08 +66 +0f +13 +10 +66 +0f +13 +10 +c5 +f9 +13 +10 +c5 +f9 +13 +10 +0f +12 +08 +0f +12 +08 +c5 +f0 +12 +08 +c5 +f0 +12 +08 +c5 +e8 +12 +08 +c5 +e8 +12 +08 +0f +13 +10 +0f +13 +10 +c5 +f8 +13 +10 +c5 +f8 +13 +10 +66 +0f +50 +c2 +66 +48 +0f +50 +c2 +c5 +f9 +50 +c2 +c4 +e1 +f9 +50 +c2 +c5 +fd +50 +c2 +c4 +e1 +fd +50 +c2 +0f +50 +c2 +48 +0f +50 +c2 +c5 +f8 +50 +c2 +c4 +e1 +f8 +50 +c2 +c5 +fc +50 +c2 +c4 +e1 +fc +50 +c2 +66 +0f +e7 +08 +66 +0f +e7 +08 +c5 +f9 +e7 +08 +c5 +f9 +e7 +08 +66 +0f +38 +2a +08 +66 +0f +38 +2a +08 +c4 +e2 +79 +2a +08 +c4 +e2 +79 +2a +08 +66 +0f +2b +08 +66 +0f +2b +08 +c5 +f9 +2b +08 +c5 +f9 +2b +08 +0f +2b +08 +0f +2b +08 +c5 +f8 +2b +08 +c5 +f8 +2b +08 +f2 +0f +10 +ca +c5 +f3 +10 +ca +c5 +eb +10 +cb +f2 +0f +10 +08 +f2 +0f +10 +08 +c5 +fb +10 +08 +c5 +fb +10 +08 +f2 +0f +11 +10 +f2 +0f +11 +10 +c5 +fb +11 +10 +c5 +fb +11 +10 +f3 +0f +16 +ca +f3 +0f +16 +08 +f3 +0f +16 +08 +c5 +fa +16 +ca +c5 +fa +16 +08 +c5 +fa +16 +08 +c5 +fe +16 +ca +c5 +fe +16 +08 +c5 +fe +16 +08 +f3 +0f +12 +ca +f3 +0f +12 +08 +f3 +0f +12 +08 +c5 +fa +12 +ca +c5 +fa +12 +08 +c5 +fa +12 +08 +c5 +fe +12 +ca +c5 +fe +12 +08 +c5 +fe +12 +08 +f3 +0f +10 +ca +c5 +f2 +10 +ca +c5 +ea +10 +cb +f3 +0f +10 +08 +f3 +0f +10 +08 +c5 +fa +10 +08 +c5 +fa +10 +08 +f3 +0f +11 +10 +f3 +0f +11 +10 +c5 +fa +11 +10 +c5 +fa +11 +10 +66 +0f +10 +ca +66 +0f +10 +08 +66 +0f +10 +08 +c5 +f9 +10 +ca +c5 +f9 +10 +08 +c5 +f9 +10 +08 +66 +0f +11 +10 +66 +0f +11 +10 +c5 +f9 +11 +10 +c5 +f9 +11 +10 +c5 +fd +10 +ca +c5 +fd +10 +08 +c5 +fd +10 +08 +c5 +fd +11 +10 +c5 +fd +11 +10 +0f +10 +ca +0f +10 +08 +0f +10 +08 +c5 +f8 +10 +ca +c5 +f8 +10 +08 +c5 +f8 +10 +08 +0f +11 +10 +0f +11 +10 +c5 +f8 +11 +10 +c5 +f8 +11 +10 +c5 +fc +10 +ca +c5 +fc +10 +08 +c5 +fc +10 +08 +c5 +fc +11 +10 +c5 +fc +11 +10 +66 +0f +3a +42 +ca +05 +66 +0f +3a +42 +08 +05 +66 +0f +3a +42 +08 +05 +c4 +e3 +71 +42 +ca +05 +c4 +e3 +71 +42 +08 +05 +c4 +e3 +71 +42 +08 +05 +c4 +e3 +69 +42 +cb +05 +c4 +e3 +69 +42 +08 +05 +c4 +e3 +69 +42 +08 +05 +66 +0f +59 +ca +66 +0f +59 +08 +66 +0f +59 +08 +c5 +f1 +59 +ca +c5 +f1 +59 +08 +c5 +f1 +59 +08 +c5 +e9 +59 +cb +c5 +e9 +59 +08 +c5 +e9 +59 +08 +c5 +ed +59 +cb +c5 +ed +59 +08 +c5 +ed +59 +08 +0f +59 +ca +0f +59 +08 +0f +59 +08 +c5 +f0 +59 +ca +c5 +f0 +59 +08 +c5 +f0 +59 +08 +c5 +e8 +59 +cb +c5 +e8 +59 +08 +c5 +e8 +59 +08 +c5 +ec +59 +cb +c5 +ec +59 +08 +c5 +ec +59 +08 +f2 +0f +59 +ca +f2 +0f +59 +08 +f2 +0f +59 +08 +c5 +f3 +59 +ca +c5 +f3 +59 +08 +c5 +f3 +59 +08 +c5 +eb +59 +cb +c5 +eb +59 +08 +c5 +eb +59 +08 +f3 +0f +59 +ca +f3 +0f +59 +08 +f3 +0f +59 +08 +c5 +f2 +59 +ca +c5 +f2 +59 +08 +c5 +f2 +59 +08 +c5 +ea +59 +cb +c5 +ea +59 +08 +c5 +ea +59 +08 +66 +0f +56 +ca +66 +0f +56 +08 +66 +0f +56 +08 +c5 +f1 +56 +ca +c5 +f1 +56 +08 +c5 +f1 +56 +08 +c5 +e9 +56 +cb +c5 +e9 +56 +08 +c5 +e9 +56 +08 +c5 +ed +56 +cb +c5 +ed +56 +08 +c5 +ed +56 +08 +0f +56 +ca +0f +56 +08 +0f +56 +08 +c5 +f0 +56 +ca +c5 +f0 +56 +08 +c5 +f0 +56 +08 +c5 +e8 +56 +cb +c5 +e8 +56 +08 +c5 +e8 +56 +08 +c5 +ec +56 +cb +c5 +ec +56 +08 +c5 +ec +56 +08 +66 +0f +38 +1c +ca +66 +0f +38 +1c +08 +66 +0f +38 +1c +08 +c4 +e2 +71 +1c +ca +c4 +e2 +71 +1c +08 +c4 +e2 +71 +1c +08 +66 +0f +38 +1d +ca +66 +0f +38 +1d +08 +66 +0f +38 +1d +08 +c4 +e2 +71 +1d +ca +c4 +e2 +71 +1d +08 +c4 +e2 +71 +1d +08 +66 +0f +38 +1e +ca +66 +0f +38 +1e +08 +66 +0f +38 +1e +08 +c4 +e2 +71 +1e +ca +c4 +e2 +71 +1e +08 +c4 +e2 +71 +1e +08 +66 +0f +63 +ca +66 +0f +63 +08 +66 +0f +63 +08 +c5 +f1 +63 +ca +c5 +f1 +63 +08 +c5 +f1 +63 +08 +c5 +e9 +63 +cb +c5 +e9 +63 +08 +c5 +e9 +63 +08 +66 +0f +6b +ca +66 +0f +6b +08 +66 +0f +6b +08 +c5 +f1 +6b +ca +c5 +f1 +6b +08 +c5 +f1 +6b +08 +c5 +e9 +6b +cb +c5 +e9 +6b +08 +c5 +e9 +6b +08 +66 +0f +67 +ca +66 +0f +67 +08 +66 +0f +67 +08 +c5 +f1 +67 +ca +c5 +f1 +67 +08 +c5 +f1 +67 +08 +c5 +e9 +67 +cb +c5 +e9 +67 +08 +c5 +e9 +67 +08 +66 +0f +38 +2b +ca +66 +0f +38 +2b +08 +66 +0f +38 +2b +08 +c4 +e2 +71 +2b +ca +c4 +e2 +71 +2b +08 +c4 +e2 +71 +2b +08 +c4 +e2 +69 +2b +cb +c4 +e2 +69 +2b +08 +c4 +e2 +69 +2b +08 +66 +0f +fc +ca +66 +0f +fc +08 +66 +0f +fc +08 +c5 +f1 +fc +ca +c5 +f1 +fc +08 +c5 +f1 +fc +08 +c5 +e9 +fc +cb +c5 +e9 +fc +08 +c5 +e9 +fc +08 +66 +0f +fd +ca +66 +0f +fd +08 +66 +0f +fd +08 +c5 +f1 +fd +ca +c5 +f1 +fd +08 +c5 +f1 +fd +08 +c5 +e9 +fd +cb +c5 +e9 +fd +08 +c5 +e9 +fd +08 +66 +0f +fe +ca +66 +0f +fe +08 +66 +0f +fe +08 +c5 +f1 +fe +ca +c5 +f1 +fe +08 +c5 +f1 +fe +08 +c5 +e9 +fe +cb +c5 +e9 +fe +08 +c5 +e9 +fe +08 +66 +0f +d4 +ca +66 +0f +d4 +08 +66 +0f +d4 +08 +c5 +f1 +d4 +ca +c5 +f1 +d4 +08 +c5 +f1 +d4 +08 +c5 +e9 +d4 +cb +c5 +e9 +d4 +08 +c5 +e9 +d4 +08 +66 +0f +ec +ca +66 +0f +ec +08 +66 +0f +ec +08 +c5 +f1 +ec +ca +c5 +f1 +ec +08 +c5 +f1 +ec +08 +c5 +e9 +ec +cb +c5 +e9 +ec +08 +c5 +e9 +ec +08 +66 +0f +ed +ca +66 +0f +ed +08 +66 +0f +ed +08 +c5 +f1 +ed +ca +c5 +f1 +ed +08 +c5 +f1 +ed +08 +c5 +e9 +ed +cb +c5 +e9 +ed +08 +c5 +e9 +ed +08 +66 +0f +dc +ca +66 +0f +dc +08 +66 +0f +dc +08 +c5 +f1 +dc +ca +c5 +f1 +dc +08 +c5 +f1 +dc +08 +c5 +e9 +dc +cb +c5 +e9 +dc +08 +c5 +e9 +dc +08 +66 +0f +dd +ca +66 +0f +dd +08 +66 +0f +dd +08 +c5 +f1 +dd +ca +c5 +f1 +dd +08 +c5 +f1 +dd +08 +c5 +e9 +dd +cb +c5 +e9 +dd +08 +c5 +e9 +dd +08 +66 +0f +3a +0f +ca +05 +66 +0f +3a +0f +08 +05 +66 +0f +3a +0f +08 +05 +c4 +e3 +71 +0f +ca +05 +c4 +e3 +71 +0f +08 +05 +c4 +e3 +71 +0f +08 +05 +c4 +e3 +69 +0f +cb +05 +c4 +e3 +69 +0f +08 +05 +c4 +e3 +69 +0f +08 +05 +66 +0f +db +ca +66 +0f +db +08 +66 +0f +db +08 +c5 +f1 +db +ca +c5 +f1 +db +08 +c5 +f1 +db +08 +c5 +e9 +db +cb +c5 +e9 +db +08 +c5 +e9 +db +08 +66 +0f +df +ca +66 +0f +df +08 +66 +0f +df +08 +c5 +f1 +df +ca +c5 +f1 +df +08 +c5 +f1 +df +08 +c5 +e9 +df +cb +c5 +e9 +df +08 +c5 +e9 +df +08 +66 +0f +e0 +ca +66 +0f +e0 +08 +66 +0f +e0 +08 +c5 +f1 +e0 +ca +c5 +f1 +e0 +08 +c5 +f1 +e0 +08 +c5 +e9 +e0 +cb +c5 +e9 +e0 +08 +c5 +e9 +e0 +08 +66 +0f +e3 +ca +66 +0f +e3 +08 +66 +0f +e3 +08 +c5 +f1 +e3 +ca +c5 +f1 +e3 +08 +c5 +f1 +e3 +08 +c5 +e9 +e3 +cb +c5 +e9 +e3 +08 +c5 +e9 +e3 +08 +66 +0f +38 +10 +ca +66 +0f +38 +10 +08 +66 +0f +38 +10 +08 +66 +0f +38 +10 +ca +66 +0f +38 +10 +08 +66 +0f +38 +10 +08 +c4 +e3 +69 +4c +cb +40 +c4 +e3 +69 +4c +08 +40 +c4 +e3 +69 +4c +08 +40 +66 +0f +3a +0e +ca +05 +66 +0f +3a +0e +08 +05 +66 +0f +3a +0e +08 +05 +c4 +e3 +71 +0e +ca +05 +c4 +e3 +71 +0e +08 +05 +c4 +e3 +71 +0e +08 +05 +c4 +e3 +69 +0e +cb +05 +c4 +e3 +69 +0e +08 +05 +c4 +e3 +69 +0e +08 +05 +66 +0f +3a +61 +ca +05 +66 +0f +3a +61 +08 +05 +66 +0f +3a +61 +08 +05 +c4 +e3 +79 +61 +ca +05 +c4 +e3 +79 +61 +08 +05 +c4 +e3 +79 +61 +08 +05 +66 +0f +3a +60 +ca +05 +66 +0f +3a +60 +08 +05 +66 +0f +3a +60 +08 +05 +c4 +e3 +79 +60 +ca +05 +c4 +e3 +79 +60 +08 +05 +c4 +e3 +79 +60 +08 +05 +66 +0f +3a +63 +ca +05 +66 +0f +3a +63 +08 +05 +66 +0f +3a +63 +08 +05 +c4 +e3 +79 +63 +ca +05 +c4 +e3 +79 +63 +08 +05 +c4 +e3 +79 +63 +08 +05 +66 +0f +3a +62 +ca +05 +66 +0f +3a +62 +08 +05 +66 +0f +3a +62 +08 +05 +c4 +e3 +79 +62 +ca +05 +c4 +e3 +79 +62 +08 +05 +c4 +e3 +79 +62 +08 +05 +66 +0f +74 +ca +66 +0f +74 +08 +66 +0f +74 +08 +c5 +f1 +74 +ca +c5 +f1 +74 +08 +c5 +f1 +74 +08 +c5 +e9 +74 +cb +c5 +e9 +74 +08 +c5 +e9 +74 +08 +66 +0f +75 +ca +66 +0f +75 +08 +66 +0f +75 +08 +c5 +f1 +75 +ca +c5 +f1 +75 +08 +c5 +f1 +75 +08 +c5 +e9 +75 +cb +c5 +e9 +75 +08 +c5 +e9 +75 +08 +66 +0f +76 +ca +66 +0f +76 +08 +66 +0f +76 +08 +c5 +f1 +76 +ca +c5 +f1 +76 +08 +c5 +f1 +76 +08 +c5 +e9 +76 +cb +c5 +e9 +76 +08 +c5 +e9 +76 +08 +66 +0f +38 +29 +ca +66 +0f +38 +29 +08 +66 +0f +38 +29 +08 +c4 +e2 +71 +29 +ca +c4 +e2 +71 +29 +08 +c4 +e2 +71 +29 +08 +c4 +e2 +69 +29 +cb +c4 +e2 +69 +29 +08 +c4 +e2 +69 +29 +08 +66 +0f +64 +ca +66 +0f +64 +08 +66 +0f +64 +08 +c5 +f1 +64 +ca +c5 +f1 +64 +08 +c5 +f1 +64 +08 +c5 +e9 +64 +cb +c5 +e9 +64 +08 +c5 +e9 +64 +08 +66 +0f +65 +ca +66 +0f +65 +08 +66 +0f +65 +08 +c5 +f1 +65 +ca +c5 +f1 +65 +08 +c5 +f1 +65 +08 +c5 +e9 +65 +cb +c5 +e9 +65 +08 +c5 +e9 +65 +08 +66 +0f +66 +ca +66 +0f +66 +08 +66 +0f +66 +08 +c5 +f1 +66 +ca +c5 +f1 +66 +08 +c5 +f1 +66 +08 +c5 +e9 +66 +cb +c5 +e9 +66 +08 +c5 +e9 +66 +08 +66 +0f +38 +37 +ca +66 +0f +38 +37 +08 +66 +0f +38 +37 +08 +c4 +e2 +71 +37 +ca +c4 +e2 +71 +37 +08 +c4 +e2 +71 +37 +08 +c4 +e2 +69 +37 +cb +c4 +e2 +69 +37 +08 +c4 +e2 +69 +37 +08 +c4 +e2 +69 +0d +cb +c4 +e2 +69 +0d +08 +c4 +e2 +69 +0d +08 +c4 +e2 +6d +0d +cb +c4 +e2 +6d +0d +08 +c4 +e2 +6d +0d +08 +c4 +e3 +79 +05 +08 +05 +c4 +e3 +79 +05 +08 +05 +c4 +e3 +7d +05 +08 +05 +c4 +e3 +7d +05 +08 +05 +c4 +e3 +69 +49 +cb +45 +c4 +e3 +69 +49 +08 +45 +c4 +e3 +69 +49 +08 +45 +c4 +e3 +ed +49 +08 +35 +c4 +e3 +ed +49 +08 +35 +c4 +e3 +6d +49 +cb +45 +c4 +e3 +6d +49 +08 +45 +c4 +e3 +6d +49 +08 +45 +c4 +e3 +ed +49 +08 +35 +c4 +e3 +ed +49 +08 +35 +c4 +e2 +69 +0c +cb +c4 +e2 +69 +0c +08 +c4 +e2 +69 +0c +08 +c4 +e2 +6d +0c +cb +c4 +e2 +6d +0c +08 +c4 +e2 +6d +0c +08 +c4 +e3 +79 +04 +08 +05 +c4 +e3 +79 +04 +08 +05 +c4 +e3 +7d +04 +08 +05 +c4 +e3 +7d +04 +08 +05 +c4 +e3 +69 +48 +cb +45 +c4 +e3 +69 +48 +08 +45 +c4 +e3 +69 +48 +08 +45 +c4 +e3 +ed +48 +08 +35 +c4 +e3 +ed +48 +08 +35 +c4 +e3 +6d +48 +cb +45 +c4 +e3 +6d +48 +08 +45 +c4 +e3 +6d +48 +08 +45 +c4 +e3 +ed +48 +08 +35 +c4 +e3 +ed +48 +08 +35 +c4 +e3 +6d +06 +cb +05 +c4 +e3 +6d +06 +08 +05 +c4 +e3 +6d +06 +08 +05 +66 +0f +3a +14 +d0 +05 +66 +0f +3a +14 +d0 +05 +66 +48 +0f +3a +14 +d0 +05 +66 +48 +0f +3a +14 +d0 +05 +66 +0f +3a +14 +10 +05 +66 +0f +3a +14 +10 +05 +c4 +e3 +79 +14 +d0 +05 +c4 +e3 +79 +14 +d0 +05 +c4 +e3 +f9 +14 +d0 +05 +c4 +e3 +f9 +14 +d0 +05 +c4 +e3 +79 +14 +10 +05 +c4 +e3 +79 +14 +10 +05 +66 +0f +c5 +c2 +05 +66 +0f +c5 +c2 +05 +66 +48 +0f +c5 +c2 +05 +66 +48 +0f +c5 +c2 +05 +66 +0f +3a +15 +10 +05 +66 +0f +3a +15 +10 +05 +c5 +f9 +c5 +c2 +05 +c5 +f9 +c5 +c2 +05 +c4 +e1 +f9 +c5 +c2 +05 +c4 +e1 +f9 +c5 +c2 +05 +c4 +e3 +79 +15 +10 +05 +c4 +e3 +79 +15 +10 +05 +66 +0f +3a +16 +d0 +05 +66 +0f +3a +16 +d0 +05 +66 +0f +3a +16 +10 +05 +66 +0f +3a +16 +10 +05 +c4 +e3 +79 +16 +d0 +05 +c4 +e3 +79 +16 +d0 +05 +c4 +e3 +79 +16 +10 +05 +c4 +e3 +79 +16 +10 +05 +66 +48 +0f +3a +16 +d0 +05 +66 +48 +0f +3a +16 +d0 +05 +66 +48 +0f +3a +16 +10 +05 +66 +48 +0f +3a +16 +10 +05 +c4 +e3 +f9 +16 +d0 +05 +c4 +e3 +f9 +16 +d0 +05 +c4 +e3 +f9 +16 +10 +05 +c4 +e3 +f9 +16 +10 +05 +66 +0f +38 +01 +ca +66 +0f +38 +01 +08 +66 +0f +38 +01 +08 +c4 +e2 +71 +01 +ca +c4 +e2 +71 +01 +08 +c4 +e2 +71 +01 +08 +c4 +e2 +69 +01 +cb +c4 +e2 +69 +01 +08 +c4 +e2 +69 +01 +08 +66 +0f +38 +02 +ca +66 +0f +38 +02 +08 +66 +0f +38 +02 +08 +c4 +e2 +71 +02 +ca +c4 +e2 +71 +02 +08 +c4 +e2 +71 +02 +08 +c4 +e2 +69 +02 +cb +c4 +e2 +69 +02 +08 +c4 +e2 +69 +02 +08 +66 +0f +38 +03 +ca +66 +0f +38 +03 +08 +66 +0f +38 +03 +08 +c4 +e2 +71 +03 +ca +c4 +e2 +71 +03 +08 +c4 +e2 +71 +03 +08 +c4 +e2 +69 +03 +cb +c4 +e2 +69 +03 +08 +c4 +e2 +69 +03 +08 +66 +0f +38 +41 +ca +66 +0f +38 +41 +08 +66 +0f +38 +41 +08 +c4 +e2 +71 +41 +ca +c4 +e2 +71 +41 +08 +c4 +e2 +71 +41 +08 +66 +0f +38 +05 +ca +66 +0f +38 +05 +08 +66 +0f +38 +05 +08 +c4 +e2 +71 +05 +ca +c4 +e2 +71 +05 +08 +c4 +e2 +71 +05 +08 +c4 +e2 +69 +05 +cb +c4 +e2 +69 +05 +08 +c4 +e2 +69 +05 +08 +66 +0f +38 +06 +ca +66 +0f +38 +06 +08 +66 +0f +38 +06 +08 +c4 +e2 +71 +06 +ca +c4 +e2 +71 +06 +08 +c4 +e2 +71 +06 +08 +c4 +e2 +69 +06 +cb +c4 +e2 +69 +06 +08 +c4 +e2 +69 +06 +08 +66 +0f +38 +07 +ca +66 +0f +38 +07 +08 +66 +0f +38 +07 +08 +c4 +e2 +71 +07 +ca +c4 +e2 +71 +07 +08 +c4 +e2 +71 +07 +08 +c4 +e2 +69 +07 +cb +c4 +e2 +69 +07 +08 +c4 +e2 +69 +07 +08 +66 +0f +3a +20 +c8 +05 +66 +0f +3a +20 +08 +05 +66 +0f +3a +20 +08 +05 +c4 +e3 +71 +20 +c8 +05 +c4 +e3 +71 +20 +08 +05 +c4 +e3 +71 +20 +08 +05 +c4 +e3 +69 +20 +c8 +05 +c4 +e3 +69 +20 +08 +05 +c4 +e3 +69 +20 +08 +05 +66 +0f +c4 +c8 +05 +66 +0f +c4 +08 +05 +66 +0f +c4 +08 +05 +c5 +f1 +c4 +c8 +05 +c5 +f1 +c4 +08 +05 +c5 +f1 +c4 +08 +05 +c5 +e9 +c4 +c8 +05 +c5 +e9 +c4 +08 +05 +c5 +e9 +c4 +08 +05 +66 +0f +3a +22 +c8 +05 +66 +0f +3a +22 +08 +05 +66 +0f +3a +22 +08 +05 +c4 +e3 +71 +22 +c8 +05 +c4 +e3 +71 +22 +08 +05 +c4 +e3 +71 +22 +08 +05 +c4 +e3 +69 +22 +c8 +05 +c4 +e3 +69 +22 +08 +05 +c4 +e3 +69 +22 +08 +05 +66 +48 +0f +3a +22 +c8 +05 +66 +48 +0f +3a +22 +08 +05 +66 +48 +0f +3a +22 +08 +05 +c4 +e3 +f1 +22 +c8 +05 +c4 +e3 +f1 +22 +08 +05 +c4 +e3 +f1 +22 +08 +05 +c4 +e3 +e9 +22 +c8 +05 +c4 +e3 +e9 +22 +08 +05 +c4 +e3 +e9 +22 +08 +05 +66 +0f +f5 +ca +66 +0f +f5 +08 +66 +0f +f5 +08 +c5 +f1 +f5 +ca +c5 +f1 +f5 +08 +c5 +f1 +f5 +08 +c5 +e9 +f5 +cb +c5 +e9 +f5 +08 +c5 +e9 +f5 +08 +66 +0f +38 +04 +ca +66 +0f +38 +04 +08 +66 +0f +38 +04 +08 +c4 +e2 +71 +04 +ca +c4 +e2 +71 +04 +08 +c4 +e2 +71 +04 +08 +c4 +e2 +69 +04 +cb +c4 +e2 +69 +04 +08 +c4 +e2 +69 +04 +08 +66 +0f +38 +3c +ca +66 +0f +38 +3c +08 +66 +0f +38 +3c +08 +c4 +e2 +71 +3c +ca +c4 +e2 +71 +3c +08 +c4 +e2 +71 +3c +08 +c4 +e2 +69 +3c +cb +c4 +e2 +69 +3c +08 +c4 +e2 +69 +3c +08 +66 +0f +ee +ca +66 +0f +ee +08 +66 +0f +ee +08 +c5 +f1 +ee +ca +c5 +f1 +ee +08 +c5 +f1 +ee +08 +c5 +e9 +ee +cb +c5 +e9 +ee +08 +c5 +e9 +ee +08 +66 +0f +38 +3d +ca +66 +0f +38 +3d +08 +66 +0f +38 +3d +08 +c4 +e2 +71 +3d +ca +c4 +e2 +71 +3d +08 +c4 +e2 +71 +3d +08 +c4 +e2 +69 +3d +cb +c4 +e2 +69 +3d +08 +c4 +e2 +69 +3d +08 +66 +0f +de +ca +66 +0f +de +08 +66 +0f +de +08 +c5 +f1 +de +ca +c5 +f1 +de +08 +c5 +f1 +de +08 +c5 +e9 +de +cb +c5 +e9 +de +08 +c5 +e9 +de +08 +66 +0f +38 +3e +ca +66 +0f +38 +3e +08 +66 +0f +38 +3e +08 +c4 +e2 +71 +3e +ca +c4 +e2 +71 +3e +08 +c4 +e2 +71 +3e +08 +c4 +e2 +69 +3e +cb +c4 +e2 +69 +3e +08 +c4 +e2 +69 +3e +08 +66 +0f +38 +3f +ca +66 +0f +38 +3f +08 +66 +0f +38 +3f +08 +c4 +e2 +71 +3f +ca +c4 +e2 +71 +3f +08 +c4 +e2 +71 +3f +08 +c4 +e2 +69 +3f +cb +c4 +e2 +69 +3f +08 +c4 +e2 +69 +3f +08 +66 +0f +38 +38 +ca +66 +0f +38 +38 +08 +66 +0f +38 +38 +08 +c4 +e2 +71 +38 +ca +c4 +e2 +71 +38 +08 +c4 +e2 +71 +38 +08 +c4 +e2 +69 +38 +cb +c4 +e2 +69 +38 +08 +c4 +e2 +69 +38 +08 +66 +0f +ea +ca +66 +0f +ea +08 +66 +0f +ea +08 +c5 +f1 +ea +ca +c5 +f1 +ea +08 +c5 +f1 +ea +08 +c5 +e9 +ea +cb +c5 +e9 +ea +08 +c5 +e9 +ea +08 +66 +0f +38 +39 +ca +66 +0f +38 +39 +08 +66 +0f +38 +39 +08 +c4 +e2 +71 +39 +ca +c4 +e2 +71 +39 +08 +c4 +e2 +71 +39 +08 +c4 +e2 +69 +39 +cb +c4 +e2 +69 +39 +08 +c4 +e2 +69 +39 +08 +66 +0f +da +ca +66 +0f +da +08 +66 +0f +da +08 +c5 +f1 +da +ca +c5 +f1 +da +08 +c5 +f1 +da +08 +c5 +e9 +da +cb +c5 +e9 +da +08 +c5 +e9 +da +08 +66 +0f +38 +3a +ca +66 +0f +38 +3a +08 +66 +0f +38 +3a +08 +c4 +e2 +71 +3a +ca +c4 +e2 +71 +3a +08 +c4 +e2 +71 +3a +08 +c4 +e2 +69 +3a +cb +c4 +e2 +69 +3a +08 +c4 +e2 +69 +3a +08 +66 +0f +38 +3b +ca +66 +0f +38 +3b +08 +66 +0f +38 +3b +08 +c4 +e2 +71 +3b +ca +c4 +e2 +71 +3b +08 +c4 +e2 +71 +3b +08 +c4 +e2 +69 +3b +cb +c4 +e2 +69 +3b +08 +c4 +e2 +69 +3b +08 +66 +0f +d7 +c1 +66 +48 +0f +d7 +c1 +c5 +f9 +d7 +c1 +c4 +e1 +f9 +d7 +c1 +66 +0f +38 +20 +ca +66 +0f +38 +20 +08 +66 +0f +38 +20 +08 +c4 +e2 +79 +20 +ca +c4 +e2 +79 +20 +08 +c4 +e2 +79 +20 +08 +66 +0f +38 +21 +ca +66 +0f +38 +21 +08 +66 +0f +38 +21 +08 +c4 +e2 +79 +21 +ca +c4 +e2 +79 +21 +08 +c4 +e2 +79 +21 +08 +66 +0f +38 +22 +ca +66 +0f +38 +22 +08 +66 +0f +38 +22 +08 +c4 +e2 +79 +22 +ca +c4 +e2 +79 +22 +08 +c4 +e2 +79 +22 +08 +66 +0f +38 +23 +ca +66 +0f +38 +23 +08 +66 +0f +38 +23 +08 +c4 +e2 +79 +23 +ca +c4 +e2 +79 +23 +08 +c4 +e2 +79 +23 +08 +66 +0f +38 +24 +ca +66 +0f +38 +24 +08 +66 +0f +38 +24 +08 +c4 +e2 +79 +24 +ca +c4 +e2 +79 +24 +08 +c4 +e2 +79 +24 +08 +66 +0f +38 +25 +ca +66 +0f +38 +25 +08 +66 +0f +38 +25 +08 +c4 +e2 +79 +25 +ca +c4 +e2 +79 +25 +08 +c4 +e2 +79 +25 +08 +66 +0f +38 +30 +ca +66 +0f +38 +30 +08 +66 +0f +38 +30 +08 +c4 +e2 +79 +30 +ca +c4 +e2 +79 +30 +08 +c4 +e2 +79 +30 +08 +66 +0f +38 +31 +ca +66 +0f +38 +31 +08 +66 +0f +38 +31 +08 +c4 +e2 +79 +31 +ca +c4 +e2 +79 +31 +08 +c4 +e2 +79 +31 +08 +66 +0f +38 +32 +ca +66 +0f +38 +32 +08 +66 +0f +38 +32 +08 +c4 +e2 +79 +32 +ca +c4 +e2 +79 +32 +08 +c4 +e2 +79 +32 +08 +66 +0f +38 +33 +ca +66 +0f +38 +33 +08 +66 +0f +38 +33 +08 +c4 +e2 +79 +33 +ca +c4 +e2 +79 +33 +08 +c4 +e2 +79 +33 +08 +66 +0f +38 +34 +ca +66 +0f +38 +34 +08 +66 +0f +38 +34 +08 +c4 +e2 +79 +34 +ca +c4 +e2 +79 +34 +08 +c4 +e2 +79 +34 +08 +66 +0f +38 +35 +ca +66 +0f +38 +35 +08 +66 +0f +38 +35 +08 +c4 +e2 +79 +35 +ca +c4 +e2 +79 +35 +08 +c4 +e2 +79 +35 +08 +66 +0f +e4 +ca +66 +0f +e4 +08 +66 +0f +e4 +08 +c5 +f1 +e4 +ca +c5 +f1 +e4 +08 +c5 +f1 +e4 +08 +c5 +e9 +e4 +cb +c5 +e9 +e4 +08 +c5 +e9 +e4 +08 +66 +0f +38 +0b +ca +66 +0f +38 +0b +08 +66 +0f +38 +0b +08 +c4 +e2 +71 +0b +ca +c4 +e2 +71 +0b +08 +c4 +e2 +71 +0b +08 +c4 +e2 +69 +0b +cb +c4 +e2 +69 +0b +08 +c4 +e2 +69 +0b +08 +66 +0f +e5 +ca +66 +0f +e5 +08 +66 +0f +e5 +08 +c5 +f1 +e5 +ca +c5 +f1 +e5 +08 +c5 +f1 +e5 +08 +c5 +e9 +e5 +cb +c5 +e9 +e5 +08 +c5 +e9 +e5 +08 +66 +0f +d5 +ca +66 +0f +d5 +08 +66 +0f +d5 +08 +c5 +f1 +d5 +ca +c5 +f1 +d5 +08 +c5 +f1 +d5 +08 +c5 +e9 +d5 +cb +c5 +e9 +d5 +08 +c5 +e9 +d5 +08 +66 +0f +38 +40 +ca +66 +0f +38 +40 +08 +66 +0f +38 +40 +08 +c4 +e2 +71 +40 +ca +c4 +e2 +71 +40 +08 +c4 +e2 +71 +40 +08 +c4 +e2 +69 +40 +cb +c4 +e2 +69 +40 +08 +c4 +e2 +69 +40 +08 +66 +0f +f4 +ca +66 +0f +f4 +08 +66 +0f +f4 +08 +c5 +f1 +f4 +ca +c5 +f1 +f4 +08 +c5 +f1 +f4 +08 +c5 +e9 +f4 +cb +c5 +e9 +f4 +08 +c5 +e9 +f4 +08 +66 +0f +38 +28 +ca +66 +0f +38 +28 +08 +66 +0f +38 +28 +08 +c4 +e2 +71 +28 +ca +c4 +e2 +71 +28 +08 +c4 +e2 +71 +28 +08 +c4 +e2 +69 +28 +cb +c4 +e2 +69 +28 +08 +c4 +e2 +69 +28 +08 +66 +0f +eb +ca +66 +0f +eb +08 +66 +0f +eb +08 +c5 +f1 +eb +ca +c5 +f1 +eb +08 +c5 +f1 +eb +08 +c5 +e9 +eb +cb +c5 +e9 +eb +08 +c5 +e9 +eb +08 +66 +0f +f6 +ca +66 +0f +f6 +08 +66 +0f +f6 +08 +c5 +f1 +f6 +ca +c5 +f1 +f6 +08 +c5 +f1 +f6 +08 +c5 +e9 +f6 +cb +c5 +e9 +f6 +08 +c5 +e9 +f6 +08 +66 +0f +38 +00 +ca +66 +0f +38 +00 +08 +66 +0f +38 +00 +08 +c4 +e2 +71 +00 +ca +c4 +e2 +71 +00 +08 +c4 +e2 +71 +00 +08 +c4 +e2 +69 +00 +cb +c4 +e2 +69 +00 +08 +c4 +e2 +69 +00 +08 +66 +0f +70 +ca +05 +66 +0f +70 +08 +05 +66 +0f +70 +08 +05 +c5 +f9 +70 +ca +05 +c5 +f9 +70 +08 +05 +c5 +f9 +70 +08 +05 +f3 +0f +70 +ca +05 +f3 +0f +70 +08 +05 +f3 +0f +70 +08 +05 +c5 +fa +70 +ca +05 +c5 +fa +70 +08 +05 +c5 +fa +70 +08 +05 +f2 +0f +70 +ca +05 +f2 +0f +70 +08 +05 +f2 +0f +70 +08 +05 +c5 +fb +70 +ca +05 +c5 +fb +70 +08 +05 +c5 +fb +70 +08 +05 +66 +0f +38 +08 +ca +66 +0f +38 +08 +08 +66 +0f +38 +08 +08 +c4 +e2 +71 +08 +ca +c4 +e2 +71 +08 +08 +c4 +e2 +71 +08 +08 +c4 +e2 +69 +08 +cb +c4 +e2 +69 +08 +08 +c4 +e2 +69 +08 +08 +66 +0f +38 +09 +ca +66 +0f +38 +09 +08 +66 +0f +38 +09 +08 +c4 +e2 +71 +09 +ca +c4 +e2 +71 +09 +08 +c4 +e2 +71 +09 +08 +c4 +e2 +69 +09 +cb +c4 +e2 +69 +09 +08 +c4 +e2 +69 +09 +08 +66 +0f +38 +0a +ca +66 +0f +38 +0a +08 +66 +0f +38 +0a +08 +c4 +e2 +71 +0a +ca +c4 +e2 +71 +0a +08 +c4 +e2 +71 +0a +08 +c4 +e2 +69 +0a +cb +c4 +e2 +69 +0a +08 +c4 +e2 +69 +0a +08 +66 +41 +0f +73 +fb +05 +66 +41 +0f +73 +fb +05 +c4 +c1 +21 +73 +fb +05 +c4 +c1 +21 +73 +fb +05 +c4 +c1 +21 +73 +fc +05 +c4 +c1 +21 +73 +fc +05 +66 +0f +73 +f9 +05 +66 +0f +73 +f9 +05 +c5 +f1 +73 +f9 +05 +c5 +f1 +73 +f9 +05 +c5 +f1 +73 +fa +05 +c5 +f1 +73 +fa +05 +66 +0f +73 +d9 +05 +66 +0f +73 +d9 +05 +c5 +f1 +73 +d9 +05 +c5 +f1 +73 +d9 +05 +c5 +f1 +73 +da +05 +c5 +f1 +73 +da +05 +66 +0f +f1 +ca +66 +0f +f1 +08 +66 +0f +f1 +08 +c5 +f1 +f1 +ca +c5 +f1 +f1 +08 +c5 +f1 +f1 +08 +c5 +e9 +f1 +cb +c5 +e9 +f1 +08 +c5 +e9 +f1 +08 +66 +0f +71 +f1 +05 +66 +0f +71 +f1 +05 +c5 +f1 +71 +f1 +05 +c5 +f1 +71 +f1 +05 +c5 +f1 +71 +f2 +05 +c5 +f1 +71 +f2 +05 +66 +0f +f2 +ca +66 +0f +f2 +08 +66 +0f +f2 +08 +c5 +f1 +f2 +ca +c5 +f1 +f2 +08 +c5 +f1 +f2 +08 +c5 +e9 +f2 +cb +c5 +e9 +f2 +08 +c5 +e9 +f2 +08 +66 +0f +72 +f1 +05 +66 +0f +72 +f1 +05 +c5 +f1 +72 +f1 +05 +c5 +f1 +72 +f1 +05 +c5 +f1 +72 +f2 +05 +c5 +f1 +72 +f2 +05 +66 +0f +f3 +ca +66 +0f +f3 +08 +66 +0f +f3 +08 +c5 +f1 +f3 +ca +c5 +f1 +f3 +08 +c5 +f1 +f3 +08 +c5 +e9 +f3 +cb +c5 +e9 +f3 +08 +c5 +e9 +f3 +08 +66 +0f +73 +f1 +05 +66 +0f +73 +f1 +05 +c5 +f1 +73 +f1 +05 +c5 +f1 +73 +f1 +05 +c5 +f1 +73 +f2 +05 +c5 +f1 +73 +f2 +05 +66 +0f +e1 +ca +66 +0f +e1 +08 +66 +0f +e1 +08 +c5 +f1 +e1 +ca +c5 +f1 +e1 +08 +c5 +f1 +e1 +08 +c5 +e9 +e1 +cb +c5 +e9 +e1 +08 +c5 +e9 +e1 +08 +66 +0f +71 +e1 +05 +66 +0f +71 +e1 +05 +c5 +f1 +71 +e1 +05 +c5 +f1 +71 +e1 +05 +c5 +f1 +71 +e2 +05 +c5 +f1 +71 +e2 +05 +66 +0f +e2 +ca +66 +0f +e2 +08 +66 +0f +e2 +08 +c5 +f1 +e2 +ca +c5 +f1 +e2 +08 +c5 +f1 +e2 +08 +c5 +e9 +e2 +cb +c5 +e9 +e2 +08 +c5 +e9 +e2 +08 +66 +0f +72 +e1 +05 +66 +0f +72 +e1 +05 +c5 +f1 +72 +e1 +05 +c5 +f1 +72 +e1 +05 +c5 +f1 +72 +e2 +05 +c5 +f1 +72 +e2 +05 +66 +0f +d1 +ca +66 +0f +d1 +08 +66 +0f +d1 +08 +c5 +f1 +d1 +ca +c5 +f1 +d1 +08 +c5 +f1 +d1 +08 +c5 +e9 +d1 +cb +c5 +e9 +d1 +08 +c5 +e9 +d1 +08 +66 +0f +71 +d1 +05 +66 +0f +71 +d1 +05 +c5 +f1 +71 +d1 +05 +c5 +f1 +71 +d1 +05 +c5 +f1 +71 +d2 +05 +c5 +f1 +71 +d2 +05 +66 +0f +d2 +ca +66 +0f +d2 +08 +66 +0f +d2 +08 +c5 +f1 +d2 +ca +c5 +f1 +d2 +08 +c5 +f1 +d2 +08 +c5 +e9 +d2 +cb +c5 +e9 +d2 +08 +c5 +e9 +d2 +08 +66 +0f +72 +d1 +05 +66 +0f +72 +d1 +05 +c5 +f1 +72 +d1 +05 +c5 +f1 +72 +d1 +05 +c5 +f1 +72 +d2 +05 +c5 +f1 +72 +d2 +05 +66 +0f +d3 +ca +66 +0f +d3 +08 +66 +0f +d3 +08 +c5 +f1 +d3 +ca +c5 +f1 +d3 +08 +c5 +f1 +d3 +08 +c5 +e9 +d3 +cb +c5 +e9 +d3 +08 +c5 +e9 +d3 +08 +66 +0f +73 +d1 +05 +66 +0f +73 +d1 +05 +c5 +f1 +73 +d1 +05 +c5 +f1 +73 +d1 +05 +c5 +f1 +73 +d2 +05 +c5 +f1 +73 +d2 +05 +66 +0f +38 +17 +ca +66 +0f +38 +17 +08 +66 +0f +38 +17 +08 +c4 +e2 +79 +17 +ca +c4 +e2 +79 +17 +08 +c4 +e2 +79 +17 +08 +c4 +e2 +7d +17 +ca +c4 +e2 +7d +17 +08 +c4 +e2 +7d +17 +08 +c4 +e2 +79 +0e +ca +c4 +e2 +79 +0e +08 +c4 +e2 +79 +0e +08 +c4 +e2 +7d +0e +ca +c4 +e2 +7d +0e +08 +c4 +e2 +7d +0e +08 +c4 +e2 +79 +0f +ca +c4 +e2 +79 +0f +08 +c4 +e2 +79 +0f +08 +c4 +e2 +7d +0f +ca +c4 +e2 +7d +0f +08 +c4 +e2 +7d +0f +08 +66 +0f +f8 +ca +66 +0f +f8 +08 +66 +0f +f8 +08 +c5 +f1 +f8 +ca +c5 +f1 +f8 +08 +c5 +f1 +f8 +08 +c5 +e9 +f8 +cb +c5 +e9 +f8 +08 +c5 +e9 +f8 +08 +66 +0f +f9 +ca +66 +0f +f9 +08 +66 +0f +f9 +08 +c5 +f1 +f9 +ca +c5 +f1 +f9 +08 +c5 +f1 +f9 +08 +c5 +e9 +f9 +cb +c5 +e9 +f9 +08 +c5 +e9 +f9 +08 +66 +0f +fa +ca +66 +0f +fa +08 +66 +0f +fa +08 +c5 +f1 +fa +ca +c5 +f1 +fa +08 +c5 +f1 +fa +08 +c5 +e9 +fa +cb +c5 +e9 +fa +08 +c5 +e9 +fa +08 +66 +0f +fb +ca +66 +0f +fb +08 +66 +0f +fb +08 +c5 +f1 +fb +ca +c5 +f1 +fb +08 +c5 +f1 +fb +08 +c5 +e9 +fb +cb +c5 +e9 +fb +08 +c5 +e9 +fb +08 +66 +0f +e8 +ca +66 +0f +e8 +08 +66 +0f +e8 +08 +c5 +f1 +e8 +ca +c5 +f1 +e8 +08 +c5 +f1 +e8 +08 +c5 +e9 +e8 +cb +c5 +e9 +e8 +08 +c5 +e9 +e8 +08 +66 +0f +e9 +ca +66 +0f +e9 +08 +66 +0f +e9 +08 +c5 +f1 +e9 +ca +c5 +f1 +e9 +08 +c5 +f1 +e9 +08 +c5 +e9 +e9 +cb +c5 +e9 +e9 +08 +c5 +e9 +e9 +08 +66 +0f +d8 +ca +66 +0f +d8 +08 +66 +0f +d8 +08 +c5 +f1 +d8 +ca +c5 +f1 +d8 +08 +c5 +f1 +d8 +08 +c5 +e9 +d8 +cb +c5 +e9 +d8 +08 +c5 +e9 +d8 +08 +66 +0f +d9 +ca +66 +0f +d9 +08 +66 +0f +d9 +08 +c5 +f1 +d9 +ca +c5 +f1 +d9 +08 +c5 +f1 +d9 +08 +c5 +e9 +d9 +cb +c5 +e9 +d9 +08 +c5 +e9 +d9 +08 +66 +0f +68 +ca +66 +0f +68 +08 +66 +0f +68 +08 +c5 +f1 +68 +ca +c5 +f1 +68 +08 +c5 +f1 +68 +08 +c5 +e9 +68 +cb +c5 +e9 +68 +08 +c5 +e9 +68 +08 +66 +0f +69 +ca +66 +0f +69 +08 +66 +0f +69 +08 +c5 +f1 +69 +ca +c5 +f1 +69 +08 +c5 +f1 +69 +08 +c5 +e9 +69 +cb +c5 +e9 +69 +08 +c5 +e9 +69 +08 +66 +0f +6a +ca +66 +0f +6a +08 +66 +0f +6a +08 +c5 +f1 +6a +ca +c5 +f1 +6a +08 +c5 +f1 +6a +08 +c5 +e9 +6a +cb +c5 +e9 +6a +08 +c5 +e9 +6a +08 +66 +0f +6d +ca +66 +0f +6d +08 +66 +0f +6d +08 +c5 +f1 +6d +ca +c5 +f1 +6d +08 +c5 +f1 +6d +08 +c5 +e9 +6d +cb +c5 +e9 +6d +08 +c5 +e9 +6d +08 +66 +0f +60 +ca +66 +0f +60 +08 +66 +0f +60 +08 +c5 +f1 +60 +ca +c5 +f1 +60 +08 +c5 +f1 +60 +08 +c5 +e9 +60 +cb +c5 +e9 +60 +08 +c5 +e9 +60 +08 +66 +0f +61 +ca +66 +0f +61 +08 +66 +0f +61 +08 +c5 +f1 +61 +ca +c5 +f1 +61 +08 +c5 +f1 +61 +08 +c5 +e9 +61 +cb +c5 +e9 +61 +08 +c5 +e9 +61 +08 +66 +0f +62 +ca +66 +0f +62 +08 +66 +0f +62 +08 +c5 +f1 +62 +ca +c5 +f1 +62 +08 +c5 +f1 +62 +08 +c5 +e9 +62 +cb +c5 +e9 +62 +08 +c5 +e9 +62 +08 +66 +0f +6c +ca +66 +0f +6c +08 +66 +0f +6c +08 +c5 +f1 +6c +ca +c5 +f1 +6c +08 +c5 +f1 +6c +08 +c5 +e9 +6c +cb +c5 +e9 +6c +08 +c5 +e9 +6c +08 +66 +0f +ef +ca +66 +0f +ef +08 +66 +0f +ef +08 +c5 +f1 +ef +ca +c5 +f1 +ef +08 +c5 +f1 +ef +08 +c5 +e9 +ef +cb +c5 +e9 +ef +08 +c5 +e9 +ef +08 +0f +53 +ca +0f +53 +08 +0f +53 +08 +c5 +f8 +53 +ca +c5 +f8 +53 +08 +c5 +f8 +53 +08 +c5 +fc +53 +ca +c5 +fc +53 +08 +c5 +fc +53 +08 +f3 +0f +53 +ca +f3 +0f +53 +08 +f3 +0f +53 +08 +c5 +f2 +53 +ca +c5 +f2 +53 +08 +c5 +f2 +53 +08 +c5 +ea +53 +cb +c5 +ea +53 +08 +c5 +ea +53 +08 +0f +52 +ca +0f +52 +08 +0f +52 +08 +c5 +f8 +52 +ca +c5 +f8 +52 +08 +c5 +f8 +52 +08 +c5 +fc +52 +ca +c5 +fc +52 +08 +c5 +fc +52 +08 +f3 +0f +52 +ca +f3 +0f +52 +08 +f3 +0f +52 +08 +c5 +f2 +52 +ca +c5 +f2 +52 +08 +c5 +f2 +52 +08 +c5 +ea +52 +cb +c5 +ea +52 +08 +c5 +ea +52 +08 +66 +0f +3a +09 +ca +05 +66 +0f +3a +09 +08 +05 +66 +0f +3a +09 +08 +05 +c4 +e3 +71 +09 +ca +05 +c4 +e3 +71 +09 +08 +05 +c4 +e3 +71 +09 +08 +05 +c4 +e3 +7d +09 +ca +05 +c4 +e3 +7d +09 +08 +05 +c4 +e3 +7d +09 +08 +05 +66 +0f +3a +08 +ca +05 +66 +0f +3a +08 +08 +05 +66 +0f +3a +08 +08 +05 +c4 +e3 +71 +08 +ca +05 +c4 +e3 +71 +08 +08 +05 +c4 +e3 +71 +08 +08 +05 +c4 +e3 +7d +08 +ca +05 +c4 +e3 +7d +08 +08 +05 +c4 +e3 +7d +08 +08 +05 +66 +0f +3a +0b +ca +05 +66 +0f +3a +0b +08 +05 +66 +0f +3a +0b +08 +05 +c4 +e3 +71 +0b +ca +05 +c4 +e3 +71 +0b +08 +05 +c4 +e3 +71 +0b +08 +05 +c4 +e3 +69 +0b +cb +05 +c4 +e3 +69 +0b +08 +05 +c4 +e3 +69 +0b +08 +05 +66 +0f +3a +0a +ca +05 +66 +0f +3a +0a +08 +05 +66 +0f +3a +0a +08 +05 +c4 +e3 +71 +0a +ca +05 +c4 +e3 +71 +0a +08 +05 +c4 +e3 +71 +0a +08 +05 +c4 +e3 +69 +0a +cb +05 +c4 +e3 +69 +0a +08 +05 +c4 +e3 +69 +0a +08 +05 +66 +0f +c6 +ca +05 +66 +0f +c6 +08 +05 +66 +0f +c6 +08 +05 +c5 +f1 +c6 +ca +05 +c5 +f1 +c6 +08 +05 +c5 +f1 +c6 +08 +05 +c5 +e9 +c6 +cb +05 +c5 +e9 +c6 +08 +05 +c5 +e9 +c6 +08 +05 +c5 +ed +c6 +cb +05 +c5 +ed +c6 +08 +05 +c5 +ed +c6 +08 +05 +0f +c6 +ca +05 +0f +c6 +08 +05 +0f +c6 +08 +05 +c5 +f0 +c6 +ca +05 +c5 +f0 +c6 +08 +05 +c5 +f0 +c6 +08 +05 +c5 +e8 +c6 +cb +05 +c5 +e8 +c6 +08 +05 +c5 +e8 +c6 +08 +05 +c5 +ec +c6 +cb +05 +c5 +ec +c6 +08 +05 +c5 +ec +c6 +08 +05 +66 +0f +51 +ca +66 +0f +51 +08 +66 +0f +51 +08 +c5 +f9 +51 +ca +c5 +f9 +51 +08 +c5 +f9 +51 +08 +c5 +fd +51 +ca +c5 +fd +51 +08 +c5 +fd +51 +08 +0f +51 +ca +0f +51 +08 +0f +51 +08 +c5 +f8 +51 +ca +c5 +f8 +51 +08 +c5 +f8 +51 +08 +c5 +fc +51 +ca +c5 +fc +51 +08 +c5 +fc +51 +08 +f2 +0f +51 +ca +f2 +0f +51 +08 +f2 +0f +51 +08 +c5 +f3 +51 +ca +c5 +f3 +51 +08 +c5 +f3 +51 +08 +c5 +eb +51 +cb +c5 +eb +51 +08 +c5 +eb +51 +08 +f3 +0f +51 +ca +f3 +0f +51 +08 +f3 +0f +51 +08 +c5 +f2 +51 +ca +c5 +f2 +51 +08 +c5 +f2 +51 +08 +c5 +ea +51 +cb +c5 +ea +51 +08 +c5 +ea +51 +08 +0f +ae +18 +0f +ae +18 +c5 +f8 +ae +18 +c5 +f8 +ae +18 +66 +0f +5c +ca +66 +0f +5c +08 +66 +0f +5c +08 +c5 +f1 +5c +ca +c5 +f1 +5c +08 +c5 +f1 +5c +08 +c5 +e9 +5c +cb +c5 +e9 +5c +08 +c5 +e9 +5c +08 +c5 +ed +5c +cb +c5 +ed +5c +08 +c5 +ed +5c +08 +0f +5c +ca +0f +5c +08 +0f +5c +08 +c5 +f0 +5c +ca +c5 +f0 +5c +08 +c5 +f0 +5c +08 +c5 +e8 +5c +cb +c5 +e8 +5c +08 +c5 +e8 +5c +08 +c5 +ec +5c +cb +c5 +ec +5c +08 +c5 +ec +5c +08 +f2 +0f +5c +ca +f2 +0f +5c +08 +f2 +0f +5c +08 +c5 +f3 +5c +ca +c5 +f3 +5c +08 +c5 +f3 +5c +08 +c5 +eb +5c +cb +c5 +eb +5c +08 +c5 +eb +5c +08 +f3 +0f +5c +ca +f3 +0f +5c +08 +f3 +0f +5c +08 +c5 +f2 +5c +ca +c5 +f2 +5c +08 +c5 +f2 +5c +08 +c5 +ea +5c +cb +c5 +ea +5c +08 +c5 +ea +5c +08 +66 +0f +2e +ca +66 +0f +2e +08 +66 +0f +2e +08 +c5 +f1 +2e +ca +c5 +f1 +2e +08 +c5 +f1 +2e +08 +0f +2e +ca +0f +2e +08 +0f +2e +08 +c5 +f0 +2e +ca +c5 +f0 +2e +08 +c5 +f0 +2e +08 +66 +0f +15 +ca +66 +0f +15 +08 +66 +0f +15 +08 +c5 +f1 +15 +ca +c5 +f1 +15 +08 +c5 +f1 +15 +08 +c5 +e9 +15 +cb +c5 +e9 +15 +08 +c5 +e9 +15 +08 +c5 +ed +15 +cb +c5 +ed +15 +08 +c5 +ed +15 +08 +0f +15 +ca +0f +15 +08 +0f +15 +08 +c5 +f0 +15 +ca +c5 +f0 +15 +08 +c5 +f0 +15 +08 +c5 +e8 +15 +cb +c5 +e8 +15 +08 +c5 +e8 +15 +08 +c5 +ec +15 +cb +c5 +ec +15 +08 +c5 +ec +15 +08 +66 +0f +14 +ca +66 +0f +14 +08 +66 +0f +14 +08 +c5 +f1 +14 +ca +c5 +f1 +14 +08 +c5 +f1 +14 +08 +c5 +e9 +14 +cb +c5 +e9 +14 +08 +c5 +e9 +14 +08 +c5 +ed +14 +cb +c5 +ed +14 +08 +c5 +ed +14 +08 +0f +14 +ca +0f +14 +08 +0f +14 +08 +c5 +f0 +14 +ca +c5 +f0 +14 +08 +c5 +f0 +14 +08 +c5 +e8 +14 +cb +c5 +e8 +14 +08 +c5 +e8 +14 +08 +c5 +ec +14 +cb +c5 +ec +14 +08 +c5 +ec +14 +08 +66 +0f +57 +ca +66 +0f +57 +08 +66 +0f +57 +08 +c5 +f1 +57 +ca +c5 +f1 +57 +08 +c5 +f1 +57 +08 +c5 +e9 +57 +cb +c5 +e9 +57 +08 +c5 +e9 +57 +08 +c5 +ed +57 +cb +c5 +ed +57 +08 +c5 +ed +57 +08 +0f +57 +ca +0f +57 +08 +0f +57 +08 +c5 +f0 +57 +ca +c5 +f0 +57 +08 +c5 +f0 +57 +08 +c5 +e8 +57 +cb +c5 +e8 +57 +08 +c5 +e8 +57 +08 +c5 +ec +57 +cb +c5 +ec +57 +08 +c5 +ec +57 +08 +c5 +fc +77 +c5 +f8 +77 diff --git a/modules/arch/x86/tests/avxcc.asm b/modules/arch/x86/tests/avxcc.asm new file mode 100644 index 00000000..bcde2563 --- /dev/null +++ b/modules/arch/x86/tests/avxcc.asm @@ -0,0 +1,899 @@ +; Exhaustive test of AVX condition code aliases +; Also includes based-upon SSE instructions for comparison +; +; Copyright (C) 2008 Peter Johnson +; +; Redistribution and use in source and binary forms, with or without +; modification, are permitted provided that the following conditions +; are met: +; 1. Redistributions of source code must retain the above copyright +; notice, this list of conditions and the following disclaimer. +; 2. Redistributions in binary form must reproduce the above copyright +; notice, this list of conditions and the following disclaimer in the +; documentation and/or other materials provided with the distribution. +; +; THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' +; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +; ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE +; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +; POSSIBILITY OF SUCH DAMAGE. +; + +[bits 64] + +cmpeqpd xmm1, xmm2 ; 00h +cmpltpd xmm1, xmm2 ; 01h +cmplepd xmm1, xmm2 ; 02h +cmpunordpd xmm1, xmm2 ; 03h +cmpneqpd xmm1, xmm2 ; 04h +cmpnltpd xmm1, xmm2 ; 05h +cmpnlepd xmm1, xmm2 ; 06h +cmpordpd xmm1, xmm2 ; 07h + +vcmpeqpd xmm1, xmm2 ; 00h +vcmpltpd xmm1, xmm2 ; 01h +vcmplepd xmm1, xmm2 ; 02h +vcmpunordpd xmm1, xmm2 ; 03h +vcmpneqpd xmm1, xmm2 ; 04h +vcmpnltpd xmm1, xmm2 ; 05h +vcmpnlepd xmm1, xmm2 ; 06h +vcmpordpd xmm1, xmm2 ; 07h + +vcmpeqpd xmm1, xmm2, xmm3 ; 00h +vcmpltpd xmm1, xmm2, xmm3 ; 01h +vcmplepd xmm1, xmm2, xmm3 ; 02h +vcmpunordpd xmm1, xmm2, xmm3 ; 03h +vcmpneqpd xmm1, xmm2, xmm3 ; 04h +vcmpnltpd xmm1, xmm2, xmm3 ; 05h +vcmpnlepd xmm1, xmm2, xmm3 ; 06h +vcmpordpd xmm1, xmm2, xmm3 ; 07h + +vcmpeq_uqpd xmm1, xmm2, xmm3 ; 08h +vcmpngepd xmm1, xmm2, xmm3 ; 09h +vcmpngtpd xmm1, xmm2, xmm3 ; 0Ah +vcmpfalsepd xmm1, xmm2, xmm3 ; 0Bh +vcmpneq_oqpd xmm1, xmm2, xmm3 ; 0Ch +vcmpgepd xmm1, xmm2, xmm3 ; 0Dh +vcmpgtpd xmm1, xmm2, xmm3 ; 0Eh +vcmptruepd xmm1, xmm2, xmm3 ; 0Fh + +vcmpeq_ospd xmm1, xmm2, xmm3 ; 10h +vcmplt_oqpd xmm1, xmm2, xmm3 ; 11h +vcmple_oqpd xmm1, xmm2, xmm3 ; 12h +vcmpunord_spd xmm1, xmm2, xmm3 ; 13h +vcmpneq_uspd xmm1, xmm2, xmm3 ; 14h +vcmpnlt_uqpd xmm1, xmm2, xmm3 ; 15h +vcmpnle_uqpd xmm1, xmm2, xmm3 ; 16h +vcmpord_spd xmm1, xmm2, xmm3 ; 17h + +vcmpeq_uspd xmm1, xmm2, xmm3 ; 18h +vcmpnge_uqpd xmm1, xmm2, xmm3 ; 19h +vcmpngt_uqpd xmm1, xmm2, xmm3 ; 1Ah +vcmpfalse_ospd xmm1, xmm2, xmm3 ; 1Bh +vcmpneq_ospd xmm1, xmm2, xmm3 ; 1Ch +vcmpge_oqpd xmm1, xmm2, xmm3 ; 1Dh +vcmpgt_oqpd xmm1, xmm2, xmm3 ; 1Eh +vcmptrue_uspd xmm1, xmm2, xmm3 ; 1Fh + +cmpeqpd xmm1, [rax] ; 00h +cmpltpd xmm1, [rax] ; 01h +cmplepd xmm1, [rax] ; 02h +cmpunordpd xmm1, [rax] ; 03h +cmpneqpd xmm1, [rax] ; 04h +cmpnltpd xmm1, [rax] ; 05h +cmpnlepd xmm1, [rax] ; 06h +cmpordpd xmm1, [rax] ; 07h + +vcmpeqpd xmm1, [rax] ; 00h +vcmpltpd xmm1, [rax] ; 01h +vcmplepd xmm1, [rax] ; 02h +vcmpunordpd xmm1, [rax] ; 03h +vcmpneqpd xmm1, [rax] ; 04h +vcmpnltpd xmm1, [rax] ; 05h +vcmpnlepd xmm1, [rax] ; 06h +vcmpordpd xmm1, [rax] ; 07h + +vcmpeqpd xmm1, xmm2, [rax] ; 00h +vcmpltpd xmm1, xmm2, [rax] ; 01h +vcmplepd xmm1, xmm2, [rax] ; 02h +vcmpunordpd xmm1, xmm2, [rax] ; 03h +vcmpneqpd xmm1, xmm2, [rax] ; 04h +vcmpnltpd xmm1, xmm2, [rax] ; 05h +vcmpnlepd xmm1, xmm2, [rax] ; 06h +vcmpordpd xmm1, xmm2, [rax] ; 07h + +vcmpeq_uqpd xmm1, xmm2, [rax] ; 08h +vcmpngepd xmm1, xmm2, [rax] ; 09h +vcmpngtpd xmm1, xmm2, [rax] ; 0Ah +vcmpfalsepd xmm1, xmm2, [rax] ; 0Bh +vcmpneq_oqpd xmm1, xmm2, [rax] ; 0Ch +vcmpgepd xmm1, xmm2, [rax] ; 0Dh +vcmpgtpd xmm1, xmm2, [rax] ; 0Eh +vcmptruepd xmm1, xmm2, [rax] ; 0Fh + +vcmpeq_ospd xmm1, xmm2, [rax] ; 10h +vcmplt_oqpd xmm1, xmm2, [rax] ; 11h +vcmple_oqpd xmm1, xmm2, [rax] ; 12h +vcmpunord_spd xmm1, xmm2, [rax] ; 13h +vcmpneq_uspd xmm1, xmm2, [rax] ; 14h +vcmpnlt_uqpd xmm1, xmm2, [rax] ; 15h +vcmpnle_uqpd xmm1, xmm2, [rax] ; 16h +vcmpord_spd xmm1, xmm2, [rax] ; 17h + +vcmpeq_uspd xmm1, xmm2, [rax] ; 18h +vcmpnge_uqpd xmm1, xmm2, [rax] ; 19h +vcmpngt_uqpd xmm1, xmm2, [rax] ; 1Ah +vcmpfalse_ospd xmm1, xmm2, [rax] ; 1Bh +vcmpneq_ospd xmm1, xmm2, [rax] ; 1Ch +vcmpge_oqpd xmm1, xmm2, [rax] ; 1Dh +vcmpgt_oqpd xmm1, xmm2, [rax] ; 1Eh +vcmptrue_uspd xmm1, xmm2, [rax] ; 1Fh + +cmpeqpd xmm1, dqword [rax] ; 00h +cmpltpd xmm1, dqword [rax] ; 01h +cmplepd xmm1, dqword [rax] ; 02h +cmpunordpd xmm1, dqword [rax] ; 03h +cmpneqpd xmm1, dqword [rax] ; 04h +cmpnltpd xmm1, dqword [rax] ; 05h +cmpnlepd xmm1, dqword [rax] ; 06h +cmpordpd xmm1, dqword [rax] ; 07h + +vcmpeqpd xmm1, dqword [rax] ; 00h +vcmpltpd xmm1, dqword [rax] ; 01h +vcmplepd xmm1, dqword [rax] ; 02h +vcmpunordpd xmm1, dqword [rax] ; 03h +vcmpneqpd xmm1, dqword [rax] ; 04h +vcmpnltpd xmm1, dqword [rax] ; 05h +vcmpnlepd xmm1, dqword [rax] ; 06h +vcmpordpd xmm1, dqword [rax] ; 07h + +vcmpeqpd xmm1, xmm2, dqword [rax] ; 00h +vcmpltpd xmm1, xmm2, dqword [rax] ; 01h +vcmplepd xmm1, xmm2, dqword [rax] ; 02h +vcmpunordpd xmm1, xmm2, dqword [rax] ; 03h +vcmpneqpd xmm1, xmm2, dqword [rax] ; 04h +vcmpnltpd xmm1, xmm2, dqword [rax] ; 05h +vcmpnlepd xmm1, xmm2, dqword [rax] ; 06h +vcmpordpd xmm1, xmm2, dqword [rax] ; 07h + +vcmpeq_uqpd xmm1, xmm2, dqword [rax] ; 08h +vcmpngepd xmm1, xmm2, dqword [rax] ; 09h +vcmpngtpd xmm1, xmm2, dqword [rax] ; 0Ah +vcmpfalsepd xmm1, xmm2, dqword [rax] ; 0Bh +vcmpneq_oqpd xmm1, xmm2, dqword [rax] ; 0Ch +vcmpgepd xmm1, xmm2, dqword [rax] ; 0Dh +vcmpgtpd xmm1, xmm2, dqword [rax] ; 0Eh +vcmptruepd xmm1, xmm2, dqword [rax] ; 0Fh + +vcmpeq_ospd xmm1, xmm2, dqword [rax] ; 10h +vcmplt_oqpd xmm1, xmm2, dqword [rax] ; 11h +vcmple_oqpd xmm1, xmm2, dqword [rax] ; 12h +vcmpunord_spd xmm1, xmm2, dqword [rax] ; 13h +vcmpneq_uspd xmm1, xmm2, dqword [rax] ; 14h +vcmpnlt_uqpd xmm1, xmm2, dqword [rax] ; 15h +vcmpnle_uqpd xmm1, xmm2, dqword [rax] ; 16h +vcmpord_spd xmm1, xmm2, dqword [rax] ; 17h + +vcmpeq_uspd xmm1, xmm2, dqword [rax] ; 18h +vcmpnge_uqpd xmm1, xmm2, dqword [rax] ; 19h +vcmpngt_uqpd xmm1, xmm2, dqword [rax] ; 1Ah +vcmpfalse_ospd xmm1, xmm2, dqword [rax] ; 1Bh +vcmpneq_ospd xmm1, xmm2, dqword [rax] ; 1Ch +vcmpge_oqpd xmm1, xmm2, dqword [rax] ; 1Dh +vcmpgt_oqpd xmm1, xmm2, dqword [rax] ; 1Eh +vcmptrue_uspd xmm1, xmm2, dqword [rax] ; 1Fh + +vcmpeqpd ymm1, ymm2, ymm3 ; 00h +vcmpltpd ymm1, ymm2, ymm3 ; 01h +vcmplepd ymm1, ymm2, ymm3 ; 02h +vcmpunordpd ymm1, ymm2, ymm3 ; 03h +vcmpneqpd ymm1, ymm2, ymm3 ; 04h +vcmpnltpd ymm1, ymm2, ymm3 ; 05h +vcmpnlepd ymm1, ymm2, ymm3 ; 06h +vcmpordpd ymm1, ymm2, ymm3 ; 07h + +vcmpeq_uqpd ymm1, ymm2, ymm3 ; 08h +vcmpngepd ymm1, ymm2, ymm3 ; 09h +vcmpngtpd ymm1, ymm2, ymm3 ; 0Ah +vcmpfalsepd ymm1, ymm2, ymm3 ; 0Bh +vcmpneq_oqpd ymm1, ymm2, ymm3 ; 0Ch +vcmpgepd ymm1, ymm2, ymm3 ; 0Dh +vcmpgtpd ymm1, ymm2, ymm3 ; 0Eh +vcmptruepd ymm1, ymm2, ymm3 ; 0Fh + +vcmpeq_ospd ymm1, ymm2, ymm3 ; 10h +vcmplt_oqpd ymm1, ymm2, ymm3 ; 11h +vcmple_oqpd ymm1, ymm2, ymm3 ; 12h +vcmpunord_spd ymm1, ymm2, ymm3 ; 13h +vcmpneq_uspd ymm1, ymm2, ymm3 ; 14h +vcmpnlt_uqpd ymm1, ymm2, ymm3 ; 15h +vcmpnle_uqpd ymm1, ymm2, ymm3 ; 16h +vcmpord_spd ymm1, ymm2, ymm3 ; 17h + +vcmpeq_uspd ymm1, ymm2, ymm3 ; 18h +vcmpnge_uqpd ymm1, ymm2, ymm3 ; 19h +vcmpngt_uqpd ymm1, ymm2, ymm3 ; 1Ah +vcmpfalse_ospd ymm1, ymm2, ymm3 ; 1Bh +vcmpneq_ospd ymm1, ymm2, ymm3 ; 1Ch +vcmpge_oqpd ymm1, ymm2, ymm3 ; 1Dh +vcmpgt_oqpd ymm1, ymm2, ymm3 ; 1Eh +vcmptrue_uspd ymm1, ymm2, ymm3 ; 1Fh + +vcmpeqpd ymm1, ymm2, [rax] ; 00h +vcmpltpd ymm1, ymm2, [rax] ; 01h +vcmplepd ymm1, ymm2, [rax] ; 02h +vcmpunordpd ymm1, ymm2, [rax] ; 03h +vcmpneqpd ymm1, ymm2, [rax] ; 04h +vcmpnltpd ymm1, ymm2, [rax] ; 05h +vcmpnlepd ymm1, ymm2, [rax] ; 06h +vcmpordpd ymm1, ymm2, [rax] ; 07h + +vcmpeq_uqpd ymm1, ymm2, [rax] ; 08h +vcmpngepd ymm1, ymm2, [rax] ; 09h +vcmpngtpd ymm1, ymm2, [rax] ; 0Ah +vcmpfalsepd ymm1, ymm2, [rax] ; 0Bh +vcmpneq_oqpd ymm1, ymm2, [rax] ; 0Ch +vcmpgepd ymm1, ymm2, [rax] ; 0Dh +vcmpgtpd ymm1, ymm2, [rax] ; 0Eh +vcmptruepd ymm1, ymm2, [rax] ; 0Fh + +vcmpeq_ospd ymm1, ymm2, [rax] ; 10h +vcmplt_oqpd ymm1, ymm2, [rax] ; 11h +vcmple_oqpd ymm1, ymm2, [rax] ; 12h +vcmpunord_spd ymm1, ymm2, [rax] ; 13h +vcmpneq_uspd ymm1, ymm2, [rax] ; 14h +vcmpnlt_uqpd ymm1, ymm2, [rax] ; 15h +vcmpnle_uqpd ymm1, ymm2, [rax] ; 16h +vcmpord_spd ymm1, ymm2, [rax] ; 17h + +vcmpeq_uspd ymm1, ymm2, [rax] ; 18h +vcmpnge_uqpd ymm1, ymm2, [rax] ; 19h +vcmpngt_uqpd ymm1, ymm2, [rax] ; 1Ah +vcmpfalse_ospd ymm1, ymm2, [rax] ; 1Bh +vcmpneq_ospd ymm1, ymm2, [rax] ; 1Ch +vcmpge_oqpd ymm1, ymm2, [rax] ; 1Dh +vcmpgt_oqpd ymm1, ymm2, [rax] ; 1Eh +vcmptrue_uspd ymm1, ymm2, [rax] ; 1Fh + +vcmpeqpd ymm1, ymm2, yword [rax] ; 00h +vcmpltpd ymm1, ymm2, yword [rax] ; 01h +vcmplepd ymm1, ymm2, yword [rax] ; 02h +vcmpunordpd ymm1, ymm2, yword [rax] ; 03h +vcmpneqpd ymm1, ymm2, yword [rax] ; 04h +vcmpnltpd ymm1, ymm2, yword [rax] ; 05h +vcmpnlepd ymm1, ymm2, yword [rax] ; 06h +vcmpordpd ymm1, ymm2, yword [rax] ; 07h + +vcmpeq_uqpd ymm1, ymm2, yword [rax] ; 08h +vcmpngepd ymm1, ymm2, yword [rax] ; 09h +vcmpngtpd ymm1, ymm2, yword [rax] ; 0Ah +vcmpfalsepd ymm1, ymm2, yword [rax] ; 0Bh +vcmpneq_oqpd ymm1, ymm2, yword [rax] ; 0Ch +vcmpgepd ymm1, ymm2, yword [rax] ; 0Dh +vcmpgtpd ymm1, ymm2, yword [rax] ; 0Eh +vcmptruepd ymm1, ymm2, yword [rax] ; 0Fh + +vcmpeq_ospd ymm1, ymm2, yword [rax] ; 10h +vcmplt_oqpd ymm1, ymm2, yword [rax] ; 11h +vcmple_oqpd ymm1, ymm2, yword [rax] ; 12h +vcmpunord_spd ymm1, ymm2, yword [rax] ; 13h +vcmpneq_uspd ymm1, ymm2, yword [rax] ; 14h +vcmpnlt_uqpd ymm1, ymm2, yword [rax] ; 15h +vcmpnle_uqpd ymm1, ymm2, yword [rax] ; 16h +vcmpord_spd ymm1, ymm2, yword [rax] ; 17h + +vcmpeq_uspd ymm1, ymm2, yword [rax] ; 18h +vcmpnge_uqpd ymm1, ymm2, yword [rax] ; 19h +vcmpngt_uqpd ymm1, ymm2, yword [rax] ; 1Ah +vcmpfalse_ospd ymm1, ymm2, yword [rax] ; 1Bh +vcmpneq_ospd ymm1, ymm2, yword [rax] ; 1Ch +vcmpge_oqpd ymm1, ymm2, yword [rax] ; 1Dh +vcmpgt_oqpd ymm1, ymm2, yword [rax] ; 1Eh +vcmptrue_uspd ymm1, ymm2, yword [rax] ; 1Fh + +;----------------------------------------------------------------------------- + +cmpeqps xmm1, xmm2 ; 00h +cmpltps xmm1, xmm2 ; 01h +cmpleps xmm1, xmm2 ; 02h +cmpunordps xmm1, xmm2 ; 03h +cmpneqps xmm1, xmm2 ; 04h +cmpnltps xmm1, xmm2 ; 05h +cmpnleps xmm1, xmm2 ; 06h +cmpordps xmm1, xmm2 ; 07h + +vcmpeqps xmm1, xmm2 ; 00h +vcmpltps xmm1, xmm2 ; 01h +vcmpleps xmm1, xmm2 ; 02h +vcmpunordps xmm1, xmm2 ; 03h +vcmpneqps xmm1, xmm2 ; 04h +vcmpnltps xmm1, xmm2 ; 05h +vcmpnleps xmm1, xmm2 ; 06h +vcmpordps xmm1, xmm2 ; 07h + +vcmpeqps xmm1, xmm2, xmm3 ; 00h +vcmpltps xmm1, xmm2, xmm3 ; 01h +vcmpleps xmm1, xmm2, xmm3 ; 02h +vcmpunordps xmm1, xmm2, xmm3 ; 03h +vcmpneqps xmm1, xmm2, xmm3 ; 04h +vcmpnltps xmm1, xmm2, xmm3 ; 05h +vcmpnleps xmm1, xmm2, xmm3 ; 06h +vcmpordps xmm1, xmm2, xmm3 ; 07h + +vcmpeq_uqps xmm1, xmm2, xmm3 ; 08h +vcmpngeps xmm1, xmm2, xmm3 ; 09h +vcmpngtps xmm1, xmm2, xmm3 ; 0Ah +vcmpfalseps xmm1, xmm2, xmm3 ; 0Bh +vcmpneq_oqps xmm1, xmm2, xmm3 ; 0Ch +vcmpgeps xmm1, xmm2, xmm3 ; 0Dh +vcmpgtps xmm1, xmm2, xmm3 ; 0Eh +vcmptrueps xmm1, xmm2, xmm3 ; 0Fh + +vcmpeq_osps xmm1, xmm2, xmm3 ; 10h +vcmplt_oqps xmm1, xmm2, xmm3 ; 11h +vcmple_oqps xmm1, xmm2, xmm3 ; 12h +vcmpunord_sps xmm1, xmm2, xmm3 ; 13h +vcmpneq_usps xmm1, xmm2, xmm3 ; 14h +vcmpnlt_uqps xmm1, xmm2, xmm3 ; 15h +vcmpnle_uqps xmm1, xmm2, xmm3 ; 16h +vcmpord_sps xmm1, xmm2, xmm3 ; 17h + +vcmpeq_usps xmm1, xmm2, xmm3 ; 18h +vcmpnge_uqps xmm1, xmm2, xmm3 ; 19h +vcmpngt_uqps xmm1, xmm2, xmm3 ; 1Ah +vcmpfalse_osps xmm1, xmm2, xmm3 ; 1Bh +vcmpneq_osps xmm1, xmm2, xmm3 ; 1Ch +vcmpge_oqps xmm1, xmm2, xmm3 ; 1Dh +vcmpgt_oqps xmm1, xmm2, xmm3 ; 1Eh +vcmptrue_usps xmm1, xmm2, xmm3 ; 1Fh + +cmpeqps xmm1, [rax] ; 00h +cmpltps xmm1, [rax] ; 01h +cmpleps xmm1, [rax] ; 02h +cmpunordps xmm1, [rax] ; 03h +cmpneqps xmm1, [rax] ; 04h +cmpnltps xmm1, [rax] ; 05h +cmpnleps xmm1, [rax] ; 06h +cmpordps xmm1, [rax] ; 07h + +vcmpeqps xmm1, [rax] ; 00h +vcmpltps xmm1, [rax] ; 01h +vcmpleps xmm1, [rax] ; 02h +vcmpunordps xmm1, [rax] ; 03h +vcmpneqps xmm1, [rax] ; 04h +vcmpnltps xmm1, [rax] ; 05h +vcmpnleps xmm1, [rax] ; 06h +vcmpordps xmm1, [rax] ; 07h + +vcmpeqps xmm1, xmm2, [rax] ; 00h +vcmpltps xmm1, xmm2, [rax] ; 01h +vcmpleps xmm1, xmm2, [rax] ; 02h +vcmpunordps xmm1, xmm2, [rax] ; 03h +vcmpneqps xmm1, xmm2, [rax] ; 04h +vcmpnltps xmm1, xmm2, [rax] ; 05h +vcmpnleps xmm1, xmm2, [rax] ; 06h +vcmpordps xmm1, xmm2, [rax] ; 07h + +vcmpeq_uqps xmm1, xmm2, [rax] ; 08h +vcmpngeps xmm1, xmm2, [rax] ; 09h +vcmpngtps xmm1, xmm2, [rax] ; 0Ah +vcmpfalseps xmm1, xmm2, [rax] ; 0Bh +vcmpneq_oqps xmm1, xmm2, [rax] ; 0Ch +vcmpgeps xmm1, xmm2, [rax] ; 0Dh +vcmpgtps xmm1, xmm2, [rax] ; 0Eh +vcmptrueps xmm1, xmm2, [rax] ; 0Fh + +vcmpeq_osps xmm1, xmm2, [rax] ; 10h +vcmplt_oqps xmm1, xmm2, [rax] ; 11h +vcmple_oqps xmm1, xmm2, [rax] ; 12h +vcmpunord_sps xmm1, xmm2, [rax] ; 13h +vcmpneq_usps xmm1, xmm2, [rax] ; 14h +vcmpnlt_uqps xmm1, xmm2, [rax] ; 15h +vcmpnle_uqps xmm1, xmm2, [rax] ; 16h +vcmpord_sps xmm1, xmm2, [rax] ; 17h + +vcmpeq_usps xmm1, xmm2, [rax] ; 18h +vcmpnge_uqps xmm1, xmm2, [rax] ; 19h +vcmpngt_uqps xmm1, xmm2, [rax] ; 1Ah +vcmpfalse_osps xmm1, xmm2, [rax] ; 1Bh +vcmpneq_osps xmm1, xmm2, [rax] ; 1Ch +vcmpge_oqps xmm1, xmm2, [rax] ; 1Dh +vcmpgt_oqps xmm1, xmm2, [rax] ; 1Eh +vcmptrue_usps xmm1, xmm2, [rax] ; 1Fh + +cmpeqps xmm1, dqword [rax] ; 00h +cmpltps xmm1, dqword [rax] ; 01h +cmpleps xmm1, dqword [rax] ; 02h +cmpunordps xmm1, dqword [rax] ; 03h +cmpneqps xmm1, dqword [rax] ; 04h +cmpnltps xmm1, dqword [rax] ; 05h +cmpnleps xmm1, dqword [rax] ; 06h +cmpordps xmm1, dqword [rax] ; 07h + +vcmpeqps xmm1, dqword [rax] ; 00h +vcmpltps xmm1, dqword [rax] ; 01h +vcmpleps xmm1, dqword [rax] ; 02h +vcmpunordps xmm1, dqword [rax] ; 03h +vcmpneqps xmm1, dqword [rax] ; 04h +vcmpnltps xmm1, dqword [rax] ; 05h +vcmpnleps xmm1, dqword [rax] ; 06h +vcmpordps xmm1, dqword [rax] ; 07h + +vcmpeqps xmm1, xmm2, dqword [rax] ; 00h +vcmpltps xmm1, xmm2, dqword [rax] ; 01h +vcmpleps xmm1, xmm2, dqword [rax] ; 02h +vcmpunordps xmm1, xmm2, dqword [rax] ; 03h +vcmpneqps xmm1, xmm2, dqword [rax] ; 04h +vcmpnltps xmm1, xmm2, dqword [rax] ; 05h +vcmpnleps xmm1, xmm2, dqword [rax] ; 06h +vcmpordps xmm1, xmm2, dqword [rax] ; 07h + +vcmpeq_uqps xmm1, xmm2, dqword [rax] ; 08h +vcmpngeps xmm1, xmm2, dqword [rax] ; 09h +vcmpngtps xmm1, xmm2, dqword [rax] ; 0Ah +vcmpfalseps xmm1, xmm2, dqword [rax] ; 0Bh +vcmpneq_oqps xmm1, xmm2, dqword [rax] ; 0Ch +vcmpgeps xmm1, xmm2, dqword [rax] ; 0Dh +vcmpgtps xmm1, xmm2, dqword [rax] ; 0Eh +vcmptrueps xmm1, xmm2, dqword [rax] ; 0Fh + +vcmpeq_osps xmm1, xmm2, dqword [rax] ; 10h +vcmplt_oqps xmm1, xmm2, dqword [rax] ; 11h +vcmple_oqps xmm1, xmm2, dqword [rax] ; 12h +vcmpunord_sps xmm1, xmm2, dqword [rax] ; 13h +vcmpneq_usps xmm1, xmm2, dqword [rax] ; 14h +vcmpnlt_uqps xmm1, xmm2, dqword [rax] ; 15h +vcmpnle_uqps xmm1, xmm2, dqword [rax] ; 16h +vcmpord_sps xmm1, xmm2, dqword [rax] ; 17h + +vcmpeq_usps xmm1, xmm2, dqword [rax] ; 18h +vcmpnge_uqps xmm1, xmm2, dqword [rax] ; 19h +vcmpngt_uqps xmm1, xmm2, dqword [rax] ; 1Ah +vcmpfalse_osps xmm1, xmm2, dqword [rax] ; 1Bh +vcmpneq_osps xmm1, xmm2, dqword [rax] ; 1Ch +vcmpge_oqps xmm1, xmm2, dqword [rax] ; 1Dh +vcmpgt_oqps xmm1, xmm2, dqword [rax] ; 1Eh +vcmptrue_usps xmm1, xmm2, dqword [rax] ; 1Fh + +vcmpeqps ymm1, ymm2, ymm3 ; 00h +vcmpltps ymm1, ymm2, ymm3 ; 01h +vcmpleps ymm1, ymm2, ymm3 ; 02h +vcmpunordps ymm1, ymm2, ymm3 ; 03h +vcmpneqps ymm1, ymm2, ymm3 ; 04h +vcmpnltps ymm1, ymm2, ymm3 ; 05h +vcmpnleps ymm1, ymm2, ymm3 ; 06h +vcmpordps ymm1, ymm2, ymm3 ; 07h + +vcmpeq_uqps ymm1, ymm2, ymm3 ; 08h +vcmpngeps ymm1, ymm2, ymm3 ; 09h +vcmpngtps ymm1, ymm2, ymm3 ; 0Ah +vcmpfalseps ymm1, ymm2, ymm3 ; 0Bh +vcmpneq_oqps ymm1, ymm2, ymm3 ; 0Ch +vcmpgeps ymm1, ymm2, ymm3 ; 0Dh +vcmpgtps ymm1, ymm2, ymm3 ; 0Eh +vcmptrueps ymm1, ymm2, ymm3 ; 0Fh + +vcmpeq_osps ymm1, ymm2, ymm3 ; 10h +vcmplt_oqps ymm1, ymm2, ymm3 ; 11h +vcmple_oqps ymm1, ymm2, ymm3 ; 12h +vcmpunord_sps ymm1, ymm2, ymm3 ; 13h +vcmpneq_usps ymm1, ymm2, ymm3 ; 14h +vcmpnlt_uqps ymm1, ymm2, ymm3 ; 15h +vcmpnle_uqps ymm1, ymm2, ymm3 ; 16h +vcmpord_sps ymm1, ymm2, ymm3 ; 17h + +vcmpeq_usps ymm1, ymm2, ymm3 ; 18h +vcmpnge_uqps ymm1, ymm2, ymm3 ; 19h +vcmpngt_uqps ymm1, ymm2, ymm3 ; 1Ah +vcmpfalse_osps ymm1, ymm2, ymm3 ; 1Bh +vcmpneq_osps ymm1, ymm2, ymm3 ; 1Ch +vcmpge_oqps ymm1, ymm2, ymm3 ; 1Dh +vcmpgt_oqps ymm1, ymm2, ymm3 ; 1Eh +vcmptrue_usps ymm1, ymm2, ymm3 ; 1Fh + +vcmpeqps ymm1, ymm2, [rax] ; 00h +vcmpltps ymm1, ymm2, [rax] ; 01h +vcmpleps ymm1, ymm2, [rax] ; 02h +vcmpunordps ymm1, ymm2, [rax] ; 03h +vcmpneqps ymm1, ymm2, [rax] ; 04h +vcmpnltps ymm1, ymm2, [rax] ; 05h +vcmpnleps ymm1, ymm2, [rax] ; 06h +vcmpordps ymm1, ymm2, [rax] ; 07h + +vcmpeq_uqps ymm1, ymm2, [rax] ; 08h +vcmpngeps ymm1, ymm2, [rax] ; 09h +vcmpngtps ymm1, ymm2, [rax] ; 0Ah +vcmpfalseps ymm1, ymm2, [rax] ; 0Bh +vcmpneq_oqps ymm1, ymm2, [rax] ; 0Ch +vcmpgeps ymm1, ymm2, [rax] ; 0Dh +vcmpgtps ymm1, ymm2, [rax] ; 0Eh +vcmptrueps ymm1, ymm2, [rax] ; 0Fh + +vcmpeq_osps ymm1, ymm2, [rax] ; 10h +vcmplt_oqps ymm1, ymm2, [rax] ; 11h +vcmple_oqps ymm1, ymm2, [rax] ; 12h +vcmpunord_sps ymm1, ymm2, [rax] ; 13h +vcmpneq_usps ymm1, ymm2, [rax] ; 14h +vcmpnlt_uqps ymm1, ymm2, [rax] ; 15h +vcmpnle_uqps ymm1, ymm2, [rax] ; 16h +vcmpord_sps ymm1, ymm2, [rax] ; 17h + +vcmpeq_usps ymm1, ymm2, [rax] ; 18h +vcmpnge_uqps ymm1, ymm2, [rax] ; 19h +vcmpngt_uqps ymm1, ymm2, [rax] ; 1Ah +vcmpfalse_osps ymm1, ymm2, [rax] ; 1Bh +vcmpneq_osps ymm1, ymm2, [rax] ; 1Ch +vcmpge_oqps ymm1, ymm2, [rax] ; 1Dh +vcmpgt_oqps ymm1, ymm2, [rax] ; 1Eh +vcmptrue_usps ymm1, ymm2, [rax] ; 1Fh + +vcmpeqps ymm1, ymm2, yword [rax] ; 00h +vcmpltps ymm1, ymm2, yword [rax] ; 01h +vcmpleps ymm1, ymm2, yword [rax] ; 02h +vcmpunordps ymm1, ymm2, yword [rax] ; 03h +vcmpneqps ymm1, ymm2, yword [rax] ; 04h +vcmpnltps ymm1, ymm2, yword [rax] ; 05h +vcmpnleps ymm1, ymm2, yword [rax] ; 06h +vcmpordps ymm1, ymm2, yword [rax] ; 07h + +vcmpeq_uqps ymm1, ymm2, yword [rax] ; 08h +vcmpngeps ymm1, ymm2, yword [rax] ; 09h +vcmpngtps ymm1, ymm2, yword [rax] ; 0Ah +vcmpfalseps ymm1, ymm2, yword [rax] ; 0Bh +vcmpneq_oqps ymm1, ymm2, yword [rax] ; 0Ch +vcmpgeps ymm1, ymm2, yword [rax] ; 0Dh +vcmpgtps ymm1, ymm2, yword [rax] ; 0Eh +vcmptrueps ymm1, ymm2, yword [rax] ; 0Fh + +vcmpeq_osps ymm1, ymm2, yword [rax] ; 10h +vcmplt_oqps ymm1, ymm2, yword [rax] ; 11h +vcmple_oqps ymm1, ymm2, yword [rax] ; 12h +vcmpunord_sps ymm1, ymm2, yword [rax] ; 13h +vcmpneq_usps ymm1, ymm2, yword [rax] ; 14h +vcmpnlt_uqps ymm1, ymm2, yword [rax] ; 15h +vcmpnle_uqps ymm1, ymm2, yword [rax] ; 16h +vcmpord_sps ymm1, ymm2, yword [rax] ; 17h + +vcmpeq_usps ymm1, ymm2, yword [rax] ; 18h +vcmpnge_uqps ymm1, ymm2, yword [rax] ; 19h +vcmpngt_uqps ymm1, ymm2, yword [rax] ; 1Ah +vcmpfalse_osps ymm1, ymm2, yword [rax] ; 1Bh +vcmpneq_osps ymm1, ymm2, yword [rax] ; 1Ch +vcmpge_oqps ymm1, ymm2, yword [rax] ; 1Dh +vcmpgt_oqps ymm1, ymm2, yword [rax] ; 1Eh +vcmptrue_usps ymm1, ymm2, yword [rax] ; 1Fh + +;----------------------------------------------------------------------------- + +cmpeqsd xmm1, xmm2 ; 00h +cmpltsd xmm1, xmm2 ; 01h +cmplesd xmm1, xmm2 ; 02h +cmpunordsd xmm1, xmm2 ; 03h +cmpneqsd xmm1, xmm2 ; 04h +cmpnltsd xmm1, xmm2 ; 05h +cmpnlesd xmm1, xmm2 ; 06h +cmpordsd xmm1, xmm2 ; 07h + +vcmpeqsd xmm1, xmm2 ; 00h +vcmpltsd xmm1, xmm2 ; 01h +vcmplesd xmm1, xmm2 ; 02h +vcmpunordsd xmm1, xmm2 ; 03h +vcmpneqsd xmm1, xmm2 ; 04h +vcmpnltsd xmm1, xmm2 ; 05h +vcmpnlesd xmm1, xmm2 ; 06h +vcmpordsd xmm1, xmm2 ; 07h + +vcmpeqsd xmm1, xmm2, xmm3 ; 00h +vcmpltsd xmm1, xmm2, xmm3 ; 01h +vcmplesd xmm1, xmm2, xmm3 ; 02h +vcmpunordsd xmm1, xmm2, xmm3 ; 03h +vcmpneqsd xmm1, xmm2, xmm3 ; 04h +vcmpnltsd xmm1, xmm2, xmm3 ; 05h +vcmpnlesd xmm1, xmm2, xmm3 ; 06h +vcmpordsd xmm1, xmm2, xmm3 ; 07h + +vcmpeq_uqsd xmm1, xmm2, xmm3 ; 08h +vcmpngesd xmm1, xmm2, xmm3 ; 09h +vcmpngtsd xmm1, xmm2, xmm3 ; 0Ah +vcmpfalsesd xmm1, xmm2, xmm3 ; 0Bh +vcmpneq_oqsd xmm1, xmm2, xmm3 ; 0Ch +vcmpgesd xmm1, xmm2, xmm3 ; 0Dh +vcmpgtsd xmm1, xmm2, xmm3 ; 0Eh +vcmptruesd xmm1, xmm2, xmm3 ; 0Fh + +vcmpeq_ossd xmm1, xmm2, xmm3 ; 10h +vcmplt_oqsd xmm1, xmm2, xmm3 ; 11h +vcmple_oqsd xmm1, xmm2, xmm3 ; 12h +vcmpunord_ssd xmm1, xmm2, xmm3 ; 13h +vcmpneq_ussd xmm1, xmm2, xmm3 ; 14h +vcmpnlt_uqsd xmm1, xmm2, xmm3 ; 15h +vcmpnle_uqsd xmm1, xmm2, xmm3 ; 16h +vcmpord_ssd xmm1, xmm2, xmm3 ; 17h + +vcmpeq_ussd xmm1, xmm2, xmm3 ; 18h +vcmpnge_uqsd xmm1, xmm2, xmm3 ; 19h +vcmpngt_uqsd xmm1, xmm2, xmm3 ; 1Ah +vcmpfalse_ossd xmm1, xmm2, xmm3 ; 1Bh +vcmpneq_ossd xmm1, xmm2, xmm3 ; 1Ch +vcmpge_oqsd xmm1, xmm2, xmm3 ; 1Dh +vcmpgt_oqsd xmm1, xmm2, xmm3 ; 1Eh +vcmptrue_ussd xmm1, xmm2, xmm3 ; 1Fh + +cmpeqsd xmm1, [rax] ; 00h +cmpltsd xmm1, [rax] ; 01h +cmplesd xmm1, [rax] ; 02h +cmpunordsd xmm1, [rax] ; 03h +cmpneqsd xmm1, [rax] ; 04h +cmpnltsd xmm1, [rax] ; 05h +cmpnlesd xmm1, [rax] ; 06h +cmpordsd xmm1, [rax] ; 07h + +vcmpeqsd xmm1, [rax] ; 00h +vcmpltsd xmm1, [rax] ; 01h +vcmplesd xmm1, [rax] ; 02h +vcmpunordsd xmm1, [rax] ; 03h +vcmpneqsd xmm1, [rax] ; 04h +vcmpnltsd xmm1, [rax] ; 05h +vcmpnlesd xmm1, [rax] ; 06h +vcmpordsd xmm1, [rax] ; 07h + +vcmpeqsd xmm1, xmm2, [rax] ; 00h +vcmpltsd xmm1, xmm2, [rax] ; 01h +vcmplesd xmm1, xmm2, [rax] ; 02h +vcmpunordsd xmm1, xmm2, [rax] ; 03h +vcmpneqsd xmm1, xmm2, [rax] ; 04h +vcmpnltsd xmm1, xmm2, [rax] ; 05h +vcmpnlesd xmm1, xmm2, [rax] ; 06h +vcmpordsd xmm1, xmm2, [rax] ; 07h + +vcmpeq_uqsd xmm1, xmm2, [rax] ; 08h +vcmpngesd xmm1, xmm2, [rax] ; 09h +vcmpngtsd xmm1, xmm2, [rax] ; 0Ah +vcmpfalsesd xmm1, xmm2, [rax] ; 0Bh +vcmpneq_oqsd xmm1, xmm2, [rax] ; 0Ch +vcmpgesd xmm1, xmm2, [rax] ; 0Dh +vcmpgtsd xmm1, xmm2, [rax] ; 0Eh +vcmptruesd xmm1, xmm2, [rax] ; 0Fh + +vcmpeq_ossd xmm1, xmm2, [rax] ; 10h +vcmplt_oqsd xmm1, xmm2, [rax] ; 11h +vcmple_oqsd xmm1, xmm2, [rax] ; 12h +vcmpunord_ssd xmm1, xmm2, [rax] ; 13h +vcmpneq_ussd xmm1, xmm2, [rax] ; 14h +vcmpnlt_uqsd xmm1, xmm2, [rax] ; 15h +vcmpnle_uqsd xmm1, xmm2, [rax] ; 16h +vcmpord_ssd xmm1, xmm2, [rax] ; 17h + +vcmpeq_ussd xmm1, xmm2, [rax] ; 18h +vcmpnge_uqsd xmm1, xmm2, [rax] ; 19h +vcmpngt_uqsd xmm1, xmm2, [rax] ; 1Ah +vcmpfalse_ossd xmm1, xmm2, [rax] ; 1Bh +vcmpneq_ossd xmm1, xmm2, [rax] ; 1Ch +vcmpge_oqsd xmm1, xmm2, [rax] ; 1Dh +vcmpgt_oqsd xmm1, xmm2, [rax] ; 1Eh +vcmptrue_ussd xmm1, xmm2, [rax] ; 1Fh + +cmpeqsd xmm1, qword [rax] ; 00h +cmpltsd xmm1, qword [rax] ; 01h +cmplesd xmm1, qword [rax] ; 02h +cmpunordsd xmm1, qword [rax] ; 03h +cmpneqsd xmm1, qword [rax] ; 04h +cmpnltsd xmm1, qword [rax] ; 05h +cmpnlesd xmm1, qword [rax] ; 06h +cmpordsd xmm1, qword [rax] ; 07h + +vcmpeqsd xmm1, qword [rax] ; 00h +vcmpltsd xmm1, qword [rax] ; 01h +vcmplesd xmm1, qword [rax] ; 02h +vcmpunordsd xmm1, qword [rax] ; 03h +vcmpneqsd xmm1, qword [rax] ; 04h +vcmpnltsd xmm1, qword [rax] ; 05h +vcmpnlesd xmm1, qword [rax] ; 06h +vcmpordsd xmm1, qword [rax] ; 07h + +vcmpeqsd xmm1, xmm2, qword [rax] ; 00h +vcmpltsd xmm1, xmm2, qword [rax] ; 01h +vcmplesd xmm1, xmm2, qword [rax] ; 02h +vcmpunordsd xmm1, xmm2, qword [rax] ; 03h +vcmpneqsd xmm1, xmm2, qword [rax] ; 04h +vcmpnltsd xmm1, xmm2, qword [rax] ; 05h +vcmpnlesd xmm1, xmm2, qword [rax] ; 06h +vcmpordsd xmm1, xmm2, qword [rax] ; 07h + +vcmpeq_uqsd xmm1, xmm2, qword [rax] ; 08h +vcmpngesd xmm1, xmm2, qword [rax] ; 09h +vcmpngtsd xmm1, xmm2, qword [rax] ; 0Ah +vcmpfalsesd xmm1, xmm2, qword [rax] ; 0Bh +vcmpneq_oqsd xmm1, xmm2, qword [rax] ; 0Ch +vcmpgesd xmm1, xmm2, qword [rax] ; 0Dh +vcmpgtsd xmm1, xmm2, qword [rax] ; 0Eh +vcmptruesd xmm1, xmm2, qword [rax] ; 0Fh + +vcmpeq_ossd xmm1, xmm2, qword [rax] ; 10h +vcmplt_oqsd xmm1, xmm2, qword [rax] ; 11h +vcmple_oqsd xmm1, xmm2, qword [rax] ; 12h +vcmpunord_ssd xmm1, xmm2, qword [rax] ; 13h +vcmpneq_ussd xmm1, xmm2, qword [rax] ; 14h +vcmpnlt_uqsd xmm1, xmm2, qword [rax] ; 15h +vcmpnle_uqsd xmm1, xmm2, qword [rax] ; 16h +vcmpord_ssd xmm1, xmm2, qword [rax] ; 17h + +vcmpeq_ussd xmm1, xmm2, qword [rax] ; 18h +vcmpnge_uqsd xmm1, xmm2, qword [rax] ; 19h +vcmpngt_uqsd xmm1, xmm2, qword [rax] ; 1Ah +vcmpfalse_ossd xmm1, xmm2, qword [rax] ; 1Bh +vcmpneq_ossd xmm1, xmm2, qword [rax] ; 1Ch +vcmpge_oqsd xmm1, xmm2, qword [rax] ; 1Dh +vcmpgt_oqsd xmm1, xmm2, qword [rax] ; 1Eh +vcmptrue_ussd xmm1, xmm2, qword [rax] ; 1Fh + +;----------------------------------------------------------------------------- + +cmpeqss xmm1, xmm2 ; 00h +cmpltss xmm1, xmm2 ; 01h +cmpless xmm1, xmm2 ; 02h +cmpunordss xmm1, xmm2 ; 03h +cmpneqss xmm1, xmm2 ; 04h +cmpnltss xmm1, xmm2 ; 05h +cmpnless xmm1, xmm2 ; 06h +cmpordss xmm1, xmm2 ; 07h + +vcmpeqss xmm1, xmm2 ; 00h +vcmpltss xmm1, xmm2 ; 01h +vcmpless xmm1, xmm2 ; 02h +vcmpunordss xmm1, xmm2 ; 03h +vcmpneqss xmm1, xmm2 ; 04h +vcmpnltss xmm1, xmm2 ; 05h +vcmpnless xmm1, xmm2 ; 06h +vcmpordss xmm1, xmm2 ; 07h + +vcmpeqss xmm1, xmm2, xmm3 ; 00h +vcmpltss xmm1, xmm2, xmm3 ; 01h +vcmpless xmm1, xmm2, xmm3 ; 02h +vcmpunordss xmm1, xmm2, xmm3 ; 03h +vcmpneqss xmm1, xmm2, xmm3 ; 04h +vcmpnltss xmm1, xmm2, xmm3 ; 05h +vcmpnless xmm1, xmm2, xmm3 ; 06h +vcmpordss xmm1, xmm2, xmm3 ; 07h + +vcmpeq_uqss xmm1, xmm2, xmm3 ; 08h +vcmpngess xmm1, xmm2, xmm3 ; 09h +vcmpngtss xmm1, xmm2, xmm3 ; 0Ah +vcmpfalsess xmm1, xmm2, xmm3 ; 0Bh +vcmpneq_oqss xmm1, xmm2, xmm3 ; 0Ch +vcmpgess xmm1, xmm2, xmm3 ; 0Dh +vcmpgtss xmm1, xmm2, xmm3 ; 0Eh +vcmptruess xmm1, xmm2, xmm3 ; 0Fh + +vcmpeq_osss xmm1, xmm2, xmm3 ; 10h +vcmplt_oqss xmm1, xmm2, xmm3 ; 11h +vcmple_oqss xmm1, xmm2, xmm3 ; 12h +vcmpunord_sss xmm1, xmm2, xmm3 ; 13h +vcmpneq_usss xmm1, xmm2, xmm3 ; 14h +vcmpnlt_uqss xmm1, xmm2, xmm3 ; 15h +vcmpnle_uqss xmm1, xmm2, xmm3 ; 16h +vcmpord_sss xmm1, xmm2, xmm3 ; 17h + +vcmpeq_usss xmm1, xmm2, xmm3 ; 18h +vcmpnge_uqss xmm1, xmm2, xmm3 ; 19h +vcmpngt_uqss xmm1, xmm2, xmm3 ; 1Ah +vcmpfalse_osss xmm1, xmm2, xmm3 ; 1Bh +vcmpneq_osss xmm1, xmm2, xmm3 ; 1Ch +vcmpge_oqss xmm1, xmm2, xmm3 ; 1Dh +vcmpgt_oqss xmm1, xmm2, xmm3 ; 1Eh +vcmptrue_usss xmm1, xmm2, xmm3 ; 1Fh + +cmpeqss xmm1, [rax] ; 00h +cmpltss xmm1, [rax] ; 01h +cmpless xmm1, [rax] ; 02h +cmpunordss xmm1, [rax] ; 03h +cmpneqss xmm1, [rax] ; 04h +cmpnltss xmm1, [rax] ; 05h +cmpnless xmm1, [rax] ; 06h +cmpordss xmm1, [rax] ; 07h + +vcmpeqss xmm1, [rax] ; 00h +vcmpltss xmm1, [rax] ; 01h +vcmpless xmm1, [rax] ; 02h +vcmpunordss xmm1, [rax] ; 03h +vcmpneqss xmm1, [rax] ; 04h +vcmpnltss xmm1, [rax] ; 05h +vcmpnless xmm1, [rax] ; 06h +vcmpordss xmm1, [rax] ; 07h + +vcmpeqss xmm1, xmm2, [rax] ; 00h +vcmpltss xmm1, xmm2, [rax] ; 01h +vcmpless xmm1, xmm2, [rax] ; 02h +vcmpunordss xmm1, xmm2, [rax] ; 03h +vcmpneqss xmm1, xmm2, [rax] ; 04h +vcmpnltss xmm1, xmm2, [rax] ; 05h +vcmpnless xmm1, xmm2, [rax] ; 06h +vcmpordss xmm1, xmm2, [rax] ; 07h + +vcmpeq_uqss xmm1, xmm2, [rax] ; 08h +vcmpngess xmm1, xmm2, [rax] ; 09h +vcmpngtss xmm1, xmm2, [rax] ; 0Ah +vcmpfalsess xmm1, xmm2, [rax] ; 0Bh +vcmpneq_oqss xmm1, xmm2, [rax] ; 0Ch +vcmpgess xmm1, xmm2, [rax] ; 0Dh +vcmpgtss xmm1, xmm2, [rax] ; 0Eh +vcmptruess xmm1, xmm2, [rax] ; 0Fh + +vcmpeq_osss xmm1, xmm2, [rax] ; 10h +vcmplt_oqss xmm1, xmm2, [rax] ; 11h +vcmple_oqss xmm1, xmm2, [rax] ; 12h +vcmpunord_sss xmm1, xmm2, [rax] ; 13h +vcmpneq_usss xmm1, xmm2, [rax] ; 14h +vcmpnlt_uqss xmm1, xmm2, [rax] ; 15h +vcmpnle_uqss xmm1, xmm2, [rax] ; 16h +vcmpord_sss xmm1, xmm2, [rax] ; 17h + +vcmpeq_usss xmm1, xmm2, [rax] ; 18h +vcmpnge_uqss xmm1, xmm2, [rax] ; 19h +vcmpngt_uqss xmm1, xmm2, [rax] ; 1Ah +vcmpfalse_osss xmm1, xmm2, [rax] ; 1Bh +vcmpneq_osss xmm1, xmm2, [rax] ; 1Ch +vcmpge_oqss xmm1, xmm2, [rax] ; 1Dh +vcmpgt_oqss xmm1, xmm2, [rax] ; 1Eh +vcmptrue_usss xmm1, xmm2, [rax] ; 1Fh + +cmpeqss xmm1, dword [rax] ; 00h +cmpltss xmm1, dword [rax] ; 01h +cmpless xmm1, dword [rax] ; 02h +cmpunordss xmm1, dword [rax] ; 03h +cmpneqss xmm1, dword [rax] ; 04h +cmpnltss xmm1, dword [rax] ; 05h +cmpnless xmm1, dword [rax] ; 06h +cmpordss xmm1, dword [rax] ; 07h + +vcmpeqss xmm1, dword [rax] ; 00h +vcmpltss xmm1, dword [rax] ; 01h +vcmpless xmm1, dword [rax] ; 02h +vcmpunordss xmm1, dword [rax] ; 03h +vcmpneqss xmm1, dword [rax] ; 04h +vcmpnltss xmm1, dword [rax] ; 05h +vcmpnless xmm1, dword [rax] ; 06h +vcmpordss xmm1, dword [rax] ; 07h + +vcmpeqss xmm1, xmm2, dword [rax] ; 00h +vcmpltss xmm1, xmm2, dword [rax] ; 01h +vcmpless xmm1, xmm2, dword [rax] ; 02h +vcmpunordss xmm1, xmm2, dword [rax] ; 03h +vcmpneqss xmm1, xmm2, dword [rax] ; 04h +vcmpnltss xmm1, xmm2, dword [rax] ; 05h +vcmpnless xmm1, xmm2, dword [rax] ; 06h +vcmpordss xmm1, xmm2, dword [rax] ; 07h + +vcmpeq_uqss xmm1, xmm2, dword [rax] ; 08h +vcmpngess xmm1, xmm2, dword [rax] ; 09h +vcmpngtss xmm1, xmm2, dword [rax] ; 0Ah +vcmpfalsess xmm1, xmm2, dword [rax] ; 0Bh +vcmpneq_oqss xmm1, xmm2, dword [rax] ; 0Ch +vcmpgess xmm1, xmm2, dword [rax] ; 0Dh +vcmpgtss xmm1, xmm2, dword [rax] ; 0Eh +vcmptruess xmm1, xmm2, dword [rax] ; 0Fh + +vcmpeq_osss xmm1, xmm2, dword [rax] ; 10h +vcmplt_oqss xmm1, xmm2, dword [rax] ; 11h +vcmple_oqss xmm1, xmm2, dword [rax] ; 12h +vcmpunord_sss xmm1, xmm2, dword [rax] ; 13h +vcmpneq_usss xmm1, xmm2, dword [rax] ; 14h +vcmpnlt_uqss xmm1, xmm2, dword [rax] ; 15h +vcmpnle_uqss xmm1, xmm2, dword [rax] ; 16h +vcmpord_sss xmm1, xmm2, dword [rax] ; 17h + +vcmpeq_usss xmm1, xmm2, dword [rax] ; 18h +vcmpnge_uqss xmm1, xmm2, dword [rax] ; 19h +vcmpngt_uqss xmm1, xmm2, dword [rax] ; 1Ah +vcmpfalse_osss xmm1, xmm2, dword [rax] ; 1Bh +vcmpneq_osss xmm1, xmm2, dword [rax] ; 1Ch +vcmpge_oqss xmm1, xmm2, dword [rax] ; 1Dh +vcmpgt_oqss xmm1, xmm2, dword [rax] ; 1Eh +vcmptrue_usss xmm1, xmm2, dword [rax] ; 1Fh + diff --git a/modules/arch/x86/tests/avxcc.hex b/modules/arch/x86/tests/avxcc.hex new file mode 100644 index 00000000..c6ed929a --- /dev/null +++ b/modules/arch/x86/tests/avxcc.hex @@ -0,0 +1,3816 @@ +66 +0f +c2 +ca +00 +66 +0f +c2 +ca +01 +66 +0f +c2 +ca +02 +66 +0f +c2 +ca +03 +66 +0f +c2 +ca +04 +66 +0f +c2 +ca +05 +66 +0f +c2 +ca +06 +66 +0f +c2 +ca +07 +c5 +f1 +c2 +ca +00 +c5 +f1 +c2 +ca +01 +c5 +f1 +c2 +ca +02 +c5 +f1 +c2 +ca +03 +c5 +f1 +c2 +ca +04 +c5 +f1 +c2 +ca +05 +c5 +f1 +c2 +ca +06 +c5 +f1 +c2 +ca +07 +c5 +e9 +c2 +cb +00 +c5 +e9 +c2 +cb +01 +c5 +e9 +c2 +cb +02 +c5 +e9 +c2 +cb +03 +c5 +e9 +c2 +cb +04 +c5 +e9 +c2 +cb +05 +c5 +e9 +c2 +cb +06 +c5 +e9 +c2 +cb +07 +c5 +e9 +c2 +cb +08 +c5 +e9 +c2 +cb +09 +c5 +e9 +c2 +cb +0a +c5 +e9 +c2 +cb +0b +c5 +e9 +c2 +cb +0c +c5 +e9 +c2 +cb +0d +c5 +e9 +c2 +cb +0e +c5 +e9 +c2 +cb +0f +c5 +e9 +c2 +cb +10 +c5 +e9 +c2 +cb +11 +c5 +e9 +c2 +cb +12 +c5 +e9 +c2 +cb +13 +c5 +e9 +c2 +cb +14 +c5 +e9 +c2 +cb +15 +c5 +e9 +c2 +cb +16 +c5 +e9 +c2 +cb +17 +c5 +e9 +c2 +cb +18 +c5 +e9 +c2 +cb +19 +c5 +e9 +c2 +cb +1a +c5 +e9 +c2 +cb +1b +c5 +e9 +c2 +cb +1c +c5 +e9 +c2 +cb +1d +c5 +e9 +c2 +cb +1e +c5 +e9 +c2 +cb +1f +66 +0f +c2 +08 +00 +66 +0f +c2 +08 +01 +66 +0f +c2 +08 +02 +66 +0f +c2 +08 +03 +66 +0f +c2 +08 +04 +66 +0f +c2 +08 +05 +66 +0f +c2 +08 +06 +66 +0f +c2 +08 +07 +c5 +f1 +c2 +08 +00 +c5 +f1 +c2 +08 +01 +c5 +f1 +c2 +08 +02 +c5 +f1 +c2 +08 +03 +c5 +f1 +c2 +08 +04 +c5 +f1 +c2 +08 +05 +c5 +f1 +c2 +08 +06 +c5 +f1 +c2 +08 +07 +c5 +e9 +c2 +08 +00 +c5 +e9 +c2 +08 +01 +c5 +e9 +c2 +08 +02 +c5 +e9 +c2 +08 +03 +c5 +e9 +c2 +08 +04 +c5 +e9 +c2 +08 +05 +c5 +e9 +c2 +08 +06 +c5 +e9 +c2 +08 +07 +c5 +e9 +c2 +08 +08 +c5 +e9 +c2 +08 +09 +c5 +e9 +c2 +08 +0a +c5 +e9 +c2 +08 +0b +c5 +e9 +c2 +08 +0c +c5 +e9 +c2 +08 +0d +c5 +e9 +c2 +08 +0e +c5 +e9 +c2 +08 +0f +c5 +e9 +c2 +08 +10 +c5 +e9 +c2 +08 +11 +c5 +e9 +c2 +08 +12 +c5 +e9 +c2 +08 +13 +c5 +e9 +c2 +08 +14 +c5 +e9 +c2 +08 +15 +c5 +e9 +c2 +08 +16 +c5 +e9 +c2 +08 +17 +c5 +e9 +c2 +08 +18 +c5 +e9 +c2 +08 +19 +c5 +e9 +c2 +08 +1a +c5 +e9 +c2 +08 +1b +c5 +e9 +c2 +08 +1c +c5 +e9 +c2 +08 +1d +c5 +e9 +c2 +08 +1e +c5 +e9 +c2 +08 +1f +66 +0f +c2 +08 +00 +66 +0f +c2 +08 +01 +66 +0f +c2 +08 +02 +66 +0f +c2 +08 +03 +66 +0f +c2 +08 +04 +66 +0f +c2 +08 +05 +66 +0f +c2 +08 +06 +66 +0f +c2 +08 +07 +c5 +f1 +c2 +08 +00 +c5 +f1 +c2 +08 +01 +c5 +f1 +c2 +08 +02 +c5 +f1 +c2 +08 +03 +c5 +f1 +c2 +08 +04 +c5 +f1 +c2 +08 +05 +c5 +f1 +c2 +08 +06 +c5 +f1 +c2 +08 +07 +c5 +e9 +c2 +08 +00 +c5 +e9 +c2 +08 +01 +c5 +e9 +c2 +08 +02 +c5 +e9 +c2 +08 +03 +c5 +e9 +c2 +08 +04 +c5 +e9 +c2 +08 +05 +c5 +e9 +c2 +08 +06 +c5 +e9 +c2 +08 +07 +c5 +e9 +c2 +08 +08 +c5 +e9 +c2 +08 +09 +c5 +e9 +c2 +08 +0a +c5 +e9 +c2 +08 +0b +c5 +e9 +c2 +08 +0c +c5 +e9 +c2 +08 +0d +c5 +e9 +c2 +08 +0e +c5 +e9 +c2 +08 +0f +c5 +e9 +c2 +08 +10 +c5 +e9 +c2 +08 +11 +c5 +e9 +c2 +08 +12 +c5 +e9 +c2 +08 +13 +c5 +e9 +c2 +08 +14 +c5 +e9 +c2 +08 +15 +c5 +e9 +c2 +08 +16 +c5 +e9 +c2 +08 +17 +c5 +e9 +c2 +08 +18 +c5 +e9 +c2 +08 +19 +c5 +e9 +c2 +08 +1a +c5 +e9 +c2 +08 +1b +c5 +e9 +c2 +08 +1c +c5 +e9 +c2 +08 +1d +c5 +e9 +c2 +08 +1e +c5 +e9 +c2 +08 +1f +c5 +ed +c2 +cb +00 +c5 +ed +c2 +cb +01 +c5 +ed +c2 +cb +02 +c5 +ed +c2 +cb +03 +c5 +ed +c2 +cb +04 +c5 +ed +c2 +cb +05 +c5 +ed +c2 +cb +06 +c5 +ed +c2 +cb +07 +c5 +ed +c2 +cb +08 +c5 +ed +c2 +cb +09 +c5 +ed +c2 +cb +0a +c5 +ed +c2 +cb +0b +c5 +ed +c2 +cb +0c +c5 +ed +c2 +cb +0d +c5 +ed +c2 +cb +0e +c5 +ed +c2 +cb +0f +c5 +ed +c2 +cb +10 +c5 +ed +c2 +cb +11 +c5 +ed +c2 +cb +12 +c5 +ed +c2 +cb +13 +c5 +ed +c2 +cb +14 +c5 +ed +c2 +cb +15 +c5 +ed +c2 +cb +16 +c5 +ed +c2 +cb +17 +c5 +ed +c2 +cb +18 +c5 +ed +c2 +cb +19 +c5 +ed +c2 +cb +1a +c5 +ed +c2 +cb +1b +c5 +ed +c2 +cb +1c +c5 +ed +c2 +cb +1d +c5 +ed +c2 +cb +1e +c5 +ed +c2 +cb +1f +c5 +ed +c2 +08 +00 +c5 +ed +c2 +08 +01 +c5 +ed +c2 +08 +02 +c5 +ed +c2 +08 +03 +c5 +ed +c2 +08 +04 +c5 +ed +c2 +08 +05 +c5 +ed +c2 +08 +06 +c5 +ed +c2 +08 +07 +c5 +ed +c2 +08 +08 +c5 +ed +c2 +08 +09 +c5 +ed +c2 +08 +0a +c5 +ed +c2 +08 +0b +c5 +ed +c2 +08 +0c +c5 +ed +c2 +08 +0d +c5 +ed +c2 +08 +0e +c5 +ed +c2 +08 +0f +c5 +ed +c2 +08 +10 +c5 +ed +c2 +08 +11 +c5 +ed +c2 +08 +12 +c5 +ed +c2 +08 +13 +c5 +ed +c2 +08 +14 +c5 +ed +c2 +08 +15 +c5 +ed +c2 +08 +16 +c5 +ed +c2 +08 +17 +c5 +ed +c2 +08 +18 +c5 +ed +c2 +08 +19 +c5 +ed +c2 +08 +1a +c5 +ed +c2 +08 +1b +c5 +ed +c2 +08 +1c +c5 +ed +c2 +08 +1d +c5 +ed +c2 +08 +1e +c5 +ed +c2 +08 +1f +c5 +ed +c2 +08 +00 +c5 +ed +c2 +08 +01 +c5 +ed +c2 +08 +02 +c5 +ed +c2 +08 +03 +c5 +ed +c2 +08 +04 +c5 +ed +c2 +08 +05 +c5 +ed +c2 +08 +06 +c5 +ed +c2 +08 +07 +c5 +ed +c2 +08 +08 +c5 +ed +c2 +08 +09 +c5 +ed +c2 +08 +0a +c5 +ed +c2 +08 +0b +c5 +ed +c2 +08 +0c +c5 +ed +c2 +08 +0d +c5 +ed +c2 +08 +0e +c5 +ed +c2 +08 +0f +c5 +ed +c2 +08 +10 +c5 +ed +c2 +08 +11 +c5 +ed +c2 +08 +12 +c5 +ed +c2 +08 +13 +c5 +ed +c2 +08 +14 +c5 +ed +c2 +08 +15 +c5 +ed +c2 +08 +16 +c5 +ed +c2 +08 +17 +c5 +ed +c2 +08 +18 +c5 +ed +c2 +08 +19 +c5 +ed +c2 +08 +1a +c5 +ed +c2 +08 +1b +c5 +ed +c2 +08 +1c +c5 +ed +c2 +08 +1d +c5 +ed +c2 +08 +1e +c5 +ed +c2 +08 +1f +0f +c2 +ca +00 +0f +c2 +ca +01 +0f +c2 +ca +02 +0f +c2 +ca +03 +0f +c2 +ca +04 +0f +c2 +ca +05 +0f +c2 +ca +06 +0f +c2 +ca +07 +c5 +f0 +c2 +ca +00 +c5 +f0 +c2 +ca +01 +c5 +f0 +c2 +ca +02 +c5 +f0 +c2 +ca +03 +c5 +f0 +c2 +ca +04 +c5 +f0 +c2 +ca +05 +c5 +f0 +c2 +ca +06 +c5 +f0 +c2 +ca +07 +c5 +e8 +c2 +cb +00 +c5 +e8 +c2 +cb +01 +c5 +e8 +c2 +cb +02 +c5 +e8 +c2 +cb +03 +c5 +e8 +c2 +cb +04 +c5 +e8 +c2 +cb +05 +c5 +e8 +c2 +cb +06 +c5 +e8 +c2 +cb +07 +c5 +e8 +c2 +cb +08 +c5 +e8 +c2 +cb +09 +c5 +e8 +c2 +cb +0a +c5 +e8 +c2 +cb +0b +c5 +e8 +c2 +cb +0c +c5 +e8 +c2 +cb +0d +c5 +e8 +c2 +cb +0e +c5 +e8 +c2 +cb +0f +c5 +e8 +c2 +cb +10 +c5 +e8 +c2 +cb +11 +c5 +e8 +c2 +cb +12 +c5 +e8 +c2 +cb +13 +c5 +e8 +c2 +cb +14 +c5 +e8 +c2 +cb +15 +c5 +e8 +c2 +cb +16 +c5 +e8 +c2 +cb +17 +c5 +e8 +c2 +cb +18 +c5 +e8 +c2 +cb +19 +c5 +e8 +c2 +cb +1a +c5 +e8 +c2 +cb +1b +c5 +e8 +c2 +cb +1c +c5 +e8 +c2 +cb +1d +c5 +e8 +c2 +cb +1e +c5 +e8 +c2 +cb +1f +0f +c2 +08 +00 +0f +c2 +08 +01 +0f +c2 +08 +02 +0f +c2 +08 +03 +0f +c2 +08 +04 +0f +c2 +08 +05 +0f +c2 +08 +06 +0f +c2 +08 +07 +c5 +f0 +c2 +08 +00 +c5 +f0 +c2 +08 +01 +c5 +f0 +c2 +08 +02 +c5 +f0 +c2 +08 +03 +c5 +f0 +c2 +08 +04 +c5 +f0 +c2 +08 +05 +c5 +f0 +c2 +08 +06 +c5 +f0 +c2 +08 +07 +c5 +e8 +c2 +08 +00 +c5 +e8 +c2 +08 +01 +c5 +e8 +c2 +08 +02 +c5 +e8 +c2 +08 +03 +c5 +e8 +c2 +08 +04 +c5 +e8 +c2 +08 +05 +c5 +e8 +c2 +08 +06 +c5 +e8 +c2 +08 +07 +c5 +e8 +c2 +08 +08 +c5 +e8 +c2 +08 +09 +c5 +e8 +c2 +08 +0a +c5 +e8 +c2 +08 +0b +c5 +e8 +c2 +08 +0c +c5 +e8 +c2 +08 +0d +c5 +e8 +c2 +08 +0e +c5 +e8 +c2 +08 +0f +c5 +e8 +c2 +08 +10 +c5 +e8 +c2 +08 +11 +c5 +e8 +c2 +08 +12 +c5 +e8 +c2 +08 +13 +c5 +e8 +c2 +08 +14 +c5 +e8 +c2 +08 +15 +c5 +e8 +c2 +08 +16 +c5 +e8 +c2 +08 +17 +c5 +e8 +c2 +08 +18 +c5 +e8 +c2 +08 +19 +c5 +e8 +c2 +08 +1a +c5 +e8 +c2 +08 +1b +c5 +e8 +c2 +08 +1c +c5 +e8 +c2 +08 +1d +c5 +e8 +c2 +08 +1e +c5 +e8 +c2 +08 +1f +0f +c2 +08 +00 +0f +c2 +08 +01 +0f +c2 +08 +02 +0f +c2 +08 +03 +0f +c2 +08 +04 +0f +c2 +08 +05 +0f +c2 +08 +06 +0f +c2 +08 +07 +c5 +f0 +c2 +08 +00 +c5 +f0 +c2 +08 +01 +c5 +f0 +c2 +08 +02 +c5 +f0 +c2 +08 +03 +c5 +f0 +c2 +08 +04 +c5 +f0 +c2 +08 +05 +c5 +f0 +c2 +08 +06 +c5 +f0 +c2 +08 +07 +c5 +e8 +c2 +08 +00 +c5 +e8 +c2 +08 +01 +c5 +e8 +c2 +08 +02 +c5 +e8 +c2 +08 +03 +c5 +e8 +c2 +08 +04 +c5 +e8 +c2 +08 +05 +c5 +e8 +c2 +08 +06 +c5 +e8 +c2 +08 +07 +c5 +e8 +c2 +08 +08 +c5 +e8 +c2 +08 +09 +c5 +e8 +c2 +08 +0a +c5 +e8 +c2 +08 +0b +c5 +e8 +c2 +08 +0c +c5 +e8 +c2 +08 +0d +c5 +e8 +c2 +08 +0e +c5 +e8 +c2 +08 +0f +c5 +e8 +c2 +08 +10 +c5 +e8 +c2 +08 +11 +c5 +e8 +c2 +08 +12 +c5 +e8 +c2 +08 +13 +c5 +e8 +c2 +08 +14 +c5 +e8 +c2 +08 +15 +c5 +e8 +c2 +08 +16 +c5 +e8 +c2 +08 +17 +c5 +e8 +c2 +08 +18 +c5 +e8 +c2 +08 +19 +c5 +e8 +c2 +08 +1a +c5 +e8 +c2 +08 +1b +c5 +e8 +c2 +08 +1c +c5 +e8 +c2 +08 +1d +c5 +e8 +c2 +08 +1e +c5 +e8 +c2 +08 +1f +c5 +ec +c2 +cb +00 +c5 +ec +c2 +cb +01 +c5 +ec +c2 +cb +02 +c5 +ec +c2 +cb +03 +c5 +ec +c2 +cb +04 +c5 +ec +c2 +cb +05 +c5 +ec +c2 +cb +06 +c5 +ec +c2 +cb +07 +c5 +ec +c2 +cb +08 +c5 +ec +c2 +cb +09 +c5 +ec +c2 +cb +0a +c5 +ec +c2 +cb +0b +c5 +ec +c2 +cb +0c +c5 +ec +c2 +cb +0d +c5 +ec +c2 +cb +0e +c5 +ec +c2 +cb +0f +c5 +ec +c2 +cb +10 +c5 +ec +c2 +cb +11 +c5 +ec +c2 +cb +12 +c5 +ec +c2 +cb +13 +c5 +ec +c2 +cb +14 +c5 +ec +c2 +cb +15 +c5 +ec +c2 +cb +16 +c5 +ec +c2 +cb +17 +c5 +ec +c2 +cb +18 +c5 +ec +c2 +cb +19 +c5 +ec +c2 +cb +1a +c5 +ec +c2 +cb +1b +c5 +ec +c2 +cb +1c +c5 +ec +c2 +cb +1d +c5 +ec +c2 +cb +1e +c5 +ec +c2 +cb +1f +c5 +ec +c2 +08 +00 +c5 +ec +c2 +08 +01 +c5 +ec +c2 +08 +02 +c5 +ec +c2 +08 +03 +c5 +ec +c2 +08 +04 +c5 +ec +c2 +08 +05 +c5 +ec +c2 +08 +06 +c5 +ec +c2 +08 +07 +c5 +ec +c2 +08 +08 +c5 +ec +c2 +08 +09 +c5 +ec +c2 +08 +0a +c5 +ec +c2 +08 +0b +c5 +ec +c2 +08 +0c +c5 +ec +c2 +08 +0d +c5 +ec +c2 +08 +0e +c5 +ec +c2 +08 +0f +c5 +ec +c2 +08 +10 +c5 +ec +c2 +08 +11 +c5 +ec +c2 +08 +12 +c5 +ec +c2 +08 +13 +c5 +ec +c2 +08 +14 +c5 +ec +c2 +08 +15 +c5 +ec +c2 +08 +16 +c5 +ec +c2 +08 +17 +c5 +ec +c2 +08 +18 +c5 +ec +c2 +08 +19 +c5 +ec +c2 +08 +1a +c5 +ec +c2 +08 +1b +c5 +ec +c2 +08 +1c +c5 +ec +c2 +08 +1d +c5 +ec +c2 +08 +1e +c5 +ec +c2 +08 +1f +c5 +ec +c2 +08 +00 +c5 +ec +c2 +08 +01 +c5 +ec +c2 +08 +02 +c5 +ec +c2 +08 +03 +c5 +ec +c2 +08 +04 +c5 +ec +c2 +08 +05 +c5 +ec +c2 +08 +06 +c5 +ec +c2 +08 +07 +c5 +ec +c2 +08 +08 +c5 +ec +c2 +08 +09 +c5 +ec +c2 +08 +0a +c5 +ec +c2 +08 +0b +c5 +ec +c2 +08 +0c +c5 +ec +c2 +08 +0d +c5 +ec +c2 +08 +0e +c5 +ec +c2 +08 +0f +c5 +ec +c2 +08 +10 +c5 +ec +c2 +08 +11 +c5 +ec +c2 +08 +12 +c5 +ec +c2 +08 +13 +c5 +ec +c2 +08 +14 +c5 +ec +c2 +08 +15 +c5 +ec +c2 +08 +16 +c5 +ec +c2 +08 +17 +c5 +ec +c2 +08 +18 +c5 +ec +c2 +08 +19 +c5 +ec +c2 +08 +1a +c5 +ec +c2 +08 +1b +c5 +ec +c2 +08 +1c +c5 +ec +c2 +08 +1d +c5 +ec +c2 +08 +1e +c5 +ec +c2 +08 +1f +f2 +0f +c2 +ca +00 +f2 +0f +c2 +ca +01 +f2 +0f +c2 +ca +02 +f2 +0f +c2 +ca +03 +f2 +0f +c2 +ca +04 +f2 +0f +c2 +ca +05 +f2 +0f +c2 +ca +06 +f2 +0f +c2 +ca +07 +c5 +f3 +c2 +ca +00 +c5 +f3 +c2 +ca +01 +c5 +f3 +c2 +ca +02 +c5 +f3 +c2 +ca +03 +c5 +f3 +c2 +ca +04 +c5 +f3 +c2 +ca +05 +c5 +f3 +c2 +ca +06 +c5 +f3 +c2 +ca +07 +c5 +eb +c2 +cb +00 +c5 +eb +c2 +cb +01 +c5 +eb +c2 +cb +02 +c5 +eb +c2 +cb +03 +c5 +eb +c2 +cb +04 +c5 +eb +c2 +cb +05 +c5 +eb +c2 +cb +06 +c5 +eb +c2 +cb +07 +c5 +eb +c2 +cb +08 +c5 +eb +c2 +cb +09 +c5 +eb +c2 +cb +0a +c5 +eb +c2 +cb +0b +c5 +eb +c2 +cb +0c +c5 +eb +c2 +cb +0d +c5 +eb +c2 +cb +0e +c5 +eb +c2 +cb +0f +c5 +eb +c2 +cb +10 +c5 +eb +c2 +cb +11 +c5 +eb +c2 +cb +12 +c5 +eb +c2 +cb +13 +c5 +eb +c2 +cb +14 +c5 +eb +c2 +cb +15 +c5 +eb +c2 +cb +16 +c5 +eb +c2 +cb +17 +c5 +eb +c2 +cb +18 +c5 +eb +c2 +cb +19 +c5 +eb +c2 +cb +1a +c5 +eb +c2 +cb +1b +c5 +eb +c2 +cb +1c +c5 +eb +c2 +cb +1d +c5 +eb +c2 +cb +1e +c5 +eb +c2 +cb +1f +f2 +0f +c2 +08 +00 +f2 +0f +c2 +08 +01 +f2 +0f +c2 +08 +02 +f2 +0f +c2 +08 +03 +f2 +0f +c2 +08 +04 +f2 +0f +c2 +08 +05 +f2 +0f +c2 +08 +06 +f2 +0f +c2 +08 +07 +c5 +f3 +c2 +08 +00 +c5 +f3 +c2 +08 +01 +c5 +f3 +c2 +08 +02 +c5 +f3 +c2 +08 +03 +c5 +f3 +c2 +08 +04 +c5 +f3 +c2 +08 +05 +c5 +f3 +c2 +08 +06 +c5 +f3 +c2 +08 +07 +c5 +eb +c2 +08 +00 +c5 +eb +c2 +08 +01 +c5 +eb +c2 +08 +02 +c5 +eb +c2 +08 +03 +c5 +eb +c2 +08 +04 +c5 +eb +c2 +08 +05 +c5 +eb +c2 +08 +06 +c5 +eb +c2 +08 +07 +c5 +eb +c2 +08 +08 +c5 +eb +c2 +08 +09 +c5 +eb +c2 +08 +0a +c5 +eb +c2 +08 +0b +c5 +eb +c2 +08 +0c +c5 +eb +c2 +08 +0d +c5 +eb +c2 +08 +0e +c5 +eb +c2 +08 +0f +c5 +eb +c2 +08 +10 +c5 +eb +c2 +08 +11 +c5 +eb +c2 +08 +12 +c5 +eb +c2 +08 +13 +c5 +eb +c2 +08 +14 +c5 +eb +c2 +08 +15 +c5 +eb +c2 +08 +16 +c5 +eb +c2 +08 +17 +c5 +eb +c2 +08 +18 +c5 +eb +c2 +08 +19 +c5 +eb +c2 +08 +1a +c5 +eb +c2 +08 +1b +c5 +eb +c2 +08 +1c +c5 +eb +c2 +08 +1d +c5 +eb +c2 +08 +1e +c5 +eb +c2 +08 +1f +f2 +0f +c2 +08 +00 +f2 +0f +c2 +08 +01 +f2 +0f +c2 +08 +02 +f2 +0f +c2 +08 +03 +f2 +0f +c2 +08 +04 +f2 +0f +c2 +08 +05 +f2 +0f +c2 +08 +06 +f2 +0f +c2 +08 +07 +c5 +f3 +c2 +08 +00 +c5 +f3 +c2 +08 +01 +c5 +f3 +c2 +08 +02 +c5 +f3 +c2 +08 +03 +c5 +f3 +c2 +08 +04 +c5 +f3 +c2 +08 +05 +c5 +f3 +c2 +08 +06 +c5 +f3 +c2 +08 +07 +c5 +eb +c2 +08 +00 +c5 +eb +c2 +08 +01 +c5 +eb +c2 +08 +02 +c5 +eb +c2 +08 +03 +c5 +eb +c2 +08 +04 +c5 +eb +c2 +08 +05 +c5 +eb +c2 +08 +06 +c5 +eb +c2 +08 +07 +c5 +eb +c2 +08 +08 +c5 +eb +c2 +08 +09 +c5 +eb +c2 +08 +0a +c5 +eb +c2 +08 +0b +c5 +eb +c2 +08 +0c +c5 +eb +c2 +08 +0d +c5 +eb +c2 +08 +0e +c5 +eb +c2 +08 +0f +c5 +eb +c2 +08 +10 +c5 +eb +c2 +08 +11 +c5 +eb +c2 +08 +12 +c5 +eb +c2 +08 +13 +c5 +eb +c2 +08 +14 +c5 +eb +c2 +08 +15 +c5 +eb +c2 +08 +16 +c5 +eb +c2 +08 +17 +c5 +eb +c2 +08 +18 +c5 +eb +c2 +08 +19 +c5 +eb +c2 +08 +1a +c5 +eb +c2 +08 +1b +c5 +eb +c2 +08 +1c +c5 +eb +c2 +08 +1d +c5 +eb +c2 +08 +1e +c5 +eb +c2 +08 +1f +f3 +0f +c2 +ca +00 +f3 +0f +c2 +ca +01 +f3 +0f +c2 +ca +02 +f3 +0f +c2 +ca +03 +f3 +0f +c2 +ca +04 +f3 +0f +c2 +ca +05 +f3 +0f +c2 +ca +06 +f3 +0f +c2 +ca +07 +c5 +f2 +c2 +ca +00 +c5 +f2 +c2 +ca +01 +c5 +f2 +c2 +ca +02 +c5 +f2 +c2 +ca +03 +c5 +f2 +c2 +ca +04 +c5 +f2 +c2 +ca +05 +c5 +f2 +c2 +ca +06 +c5 +f2 +c2 +ca +07 +c5 +ea +c2 +cb +00 +c5 +ea +c2 +cb +01 +c5 +ea +c2 +cb +02 +c5 +ea +c2 +cb +03 +c5 +ea +c2 +cb +04 +c5 +ea +c2 +cb +05 +c5 +ea +c2 +cb +06 +c5 +ea +c2 +cb +07 +c5 +ea +c2 +cb +08 +c5 +ea +c2 +cb +09 +c5 +ea +c2 +cb +0a +c5 +ea +c2 +cb +0b +c5 +ea +c2 +cb +0c +c5 +ea +c2 +cb +0d +c5 +ea +c2 +cb +0e +c5 +ea +c2 +cb +0f +c5 +ea +c2 +cb +10 +c5 +ea +c2 +cb +11 +c5 +ea +c2 +cb +12 +c5 +ea +c2 +cb +13 +c5 +ea +c2 +cb +14 +c5 +ea +c2 +cb +15 +c5 +ea +c2 +cb +16 +c5 +ea +c2 +cb +17 +c5 +ea +c2 +cb +18 +c5 +ea +c2 +cb +19 +c5 +ea +c2 +cb +1a +c5 +ea +c2 +cb +1b +c5 +ea +c2 +cb +1c +c5 +ea +c2 +cb +1d +c5 +ea +c2 +cb +1e +c5 +ea +c2 +cb +1f +f3 +0f +c2 +08 +00 +f3 +0f +c2 +08 +01 +f3 +0f +c2 +08 +02 +f3 +0f +c2 +08 +03 +f3 +0f +c2 +08 +04 +f3 +0f +c2 +08 +05 +f3 +0f +c2 +08 +06 +f3 +0f +c2 +08 +07 +c5 +f2 +c2 +08 +00 +c5 +f2 +c2 +08 +01 +c5 +f2 +c2 +08 +02 +c5 +f2 +c2 +08 +03 +c5 +f2 +c2 +08 +04 +c5 +f2 +c2 +08 +05 +c5 +f2 +c2 +08 +06 +c5 +f2 +c2 +08 +07 +c5 +ea +c2 +08 +00 +c5 +ea +c2 +08 +01 +c5 +ea +c2 +08 +02 +c5 +ea +c2 +08 +03 +c5 +ea +c2 +08 +04 +c5 +ea +c2 +08 +05 +c5 +ea +c2 +08 +06 +c5 +ea +c2 +08 +07 +c5 +ea +c2 +08 +08 +c5 +ea +c2 +08 +09 +c5 +ea +c2 +08 +0a +c5 +ea +c2 +08 +0b +c5 +ea +c2 +08 +0c +c5 +ea +c2 +08 +0d +c5 +ea +c2 +08 +0e +c5 +ea +c2 +08 +0f +c5 +ea +c2 +08 +10 +c5 +ea +c2 +08 +11 +c5 +ea +c2 +08 +12 +c5 +ea +c2 +08 +13 +c5 +ea +c2 +08 +14 +c5 +ea +c2 +08 +15 +c5 +ea +c2 +08 +16 +c5 +ea +c2 +08 +17 +c5 +ea +c2 +08 +18 +c5 +ea +c2 +08 +19 +c5 +ea +c2 +08 +1a +c5 +ea +c2 +08 +1b +c5 +ea +c2 +08 +1c +c5 +ea +c2 +08 +1d +c5 +ea +c2 +08 +1e +c5 +ea +c2 +08 +1f +f3 +0f +c2 +08 +00 +f3 +0f +c2 +08 +01 +f3 +0f +c2 +08 +02 +f3 +0f +c2 +08 +03 +f3 +0f +c2 +08 +04 +f3 +0f +c2 +08 +05 +f3 +0f +c2 +08 +06 +f3 +0f +c2 +08 +07 +c5 +f2 +c2 +08 +00 +c5 +f2 +c2 +08 +01 +c5 +f2 +c2 +08 +02 +c5 +f2 +c2 +08 +03 +c5 +f2 +c2 +08 +04 +c5 +f2 +c2 +08 +05 +c5 +f2 +c2 +08 +06 +c5 +f2 +c2 +08 +07 +c5 +ea +c2 +08 +00 +c5 +ea +c2 +08 +01 +c5 +ea +c2 +08 +02 +c5 +ea +c2 +08 +03 +c5 +ea +c2 +08 +04 +c5 +ea +c2 +08 +05 +c5 +ea +c2 +08 +06 +c5 +ea +c2 +08 +07 +c5 +ea +c2 +08 +08 +c5 +ea +c2 +08 +09 +c5 +ea +c2 +08 +0a +c5 +ea +c2 +08 +0b +c5 +ea +c2 +08 +0c +c5 +ea +c2 +08 +0d +c5 +ea +c2 +08 +0e +c5 +ea +c2 +08 +0f +c5 +ea +c2 +08 +10 +c5 +ea +c2 +08 +11 +c5 +ea +c2 +08 +12 +c5 +ea +c2 +08 +13 +c5 +ea +c2 +08 +14 +c5 +ea +c2 +08 +15 +c5 +ea +c2 +08 +16 +c5 +ea +c2 +08 +17 +c5 +ea +c2 +08 +18 +c5 +ea +c2 +08 +19 +c5 +ea +c2 +08 +1a +c5 +ea +c2 +08 +1b +c5 +ea +c2 +08 +1c +c5 +ea +c2 +08 +1d +c5 +ea +c2 +08 +1e +c5 +ea +c2 +08 +1f diff --git a/modules/arch/x86/tests/clmul.asm b/modules/arch/x86/tests/clmul.asm new file mode 100644 index 00000000..053bc449 --- /dev/null +++ b/modules/arch/x86/tests/clmul.asm @@ -0,0 +1,22 @@ +[bits 64] + +pclmulqdq xmm1, xmm2, 5 +pclmulqdq xmm1, [rax], byte 5 +pclmulqdq xmm1, dqword [rax], 5 + +pclmullqlqdq xmm1, xmm2 +pclmullqlqdq xmm1, [rax] +pclmullqlqdq xmm1, dqword [rax] + +pclmulhqlqdq xmm1, xmm2 +pclmulhqlqdq xmm1, [rax] +pclmulhqlqdq xmm1, dqword [rax] + +pclmullqhqdq xmm1, xmm2 +pclmullqhqdq xmm1, [rax] +pclmullqhqdq xmm1, dqword [rax] + +pclmulhqhqdq xmm1, xmm2 +pclmulhqhqdq xmm1, [rax] +pclmulhqhqdq xmm1, dqword [rax] + diff --git a/modules/arch/x86/tests/clmul.hex b/modules/arch/x86/tests/clmul.hex new file mode 100644 index 00000000..cd7a0242 --- /dev/null +++ b/modules/arch/x86/tests/clmul.hex @@ -0,0 +1,90 @@ +66 +0f +3a +44 +ca +05 +66 +0f +3a +44 +08 +05 +66 +0f +3a +44 +08 +05 +66 +0f +3a +44 +ca +00 +66 +0f +3a +44 +08 +00 +66 +0f +3a +44 +08 +00 +66 +0f +3a +44 +ca +01 +66 +0f +3a +44 +08 +01 +66 +0f +3a +44 +08 +01 +66 +0f +3a +44 +ca +10 +66 +0f +3a +44 +08 +10 +66 +0f +3a +44 +08 +10 +66 +0f +3a +44 +ca +11 +66 +0f +3a +44 +08 +11 +66 +0f +3a +44 +08 +11 diff --git a/modules/arch/x86/tests/fma.asm b/modules/arch/x86/tests/fma.asm new file mode 100644 index 00000000..25fdc50d --- /dev/null +++ b/modules/arch/x86/tests/fma.asm @@ -0,0 +1,109 @@ +[bits 64] +vfmaddpd xmm0, xmm1, xmm2, xmm3 +vfmaddpd xmm0, xmm1, [rax], xmm3 +vfmaddpd xmm0, xmm1, dqword [rax], xmm3 +vfmaddpd xmm0, xmm1, xmm2, [rax] +vfmaddpd xmm0, xmm1, xmm2, dqword [rax] +vfmaddpd ymm0, ymm1, ymm2, ymm3 +vfmaddpd ymm0, ymm1, [rax], ymm3 +vfmaddpd ymm0, ymm1, yword [rax], ymm3 +vfmaddpd ymm0, ymm1, ymm2, [rax] +vfmaddpd ymm0, ymm1, ymm2, yword [rax] + +vfmaddps xmm0, xmm1, xmm2, xmm3 +vfmaddps xmm0, xmm1, dqword [rax], xmm3 +vfmaddps xmm0, xmm1, xmm2, dqword [rax] +vfmaddps ymm0, ymm1, ymm2, ymm3 +vfmaddps ymm0, ymm1, yword [rax], ymm3 +vfmaddps ymm0, ymm1, ymm2, yword [rax] + +vfmaddsd xmm0, xmm1, xmm2, xmm3 +vfmaddsd xmm0, xmm1, [rax], xmm3 +vfmaddsd xmm0, xmm1, qword [rax], xmm3 +vfmaddsd xmm0, xmm1, xmm2, [rax] +vfmaddsd xmm0, xmm1, xmm2, qword [rax] + +vfmaddss xmm0, xmm1, xmm2, xmm3 +vfmaddss xmm0, xmm1, dword [rax], xmm3 +vfmaddss xmm0, xmm1, xmm2, dword [rax] + +vfmaddsubpd xmm0, xmm1, xmm2, xmm3 +vfmaddsubpd xmm0, xmm1, dqword [rax], xmm3 +vfmaddsubpd xmm0, xmm1, xmm2, dqword [rax] +vfmaddsubpd ymm0, ymm1, ymm2, ymm3 +vfmaddsubpd ymm0, ymm1, yword [rax], ymm3 +vfmaddsubpd ymm0, ymm1, ymm2, yword [rax] + +vfmaddsubps xmm0, xmm1, xmm2, xmm3 +vfmaddsubps xmm0, xmm1, dqword [rax], xmm3 +vfmaddsubps xmm0, xmm1, xmm2, dqword [rax] +vfmaddsubps ymm0, ymm1, ymm2, ymm3 +vfmaddsubps ymm0, ymm1, yword [rax], ymm3 +vfmaddsubps ymm0, ymm1, ymm2, yword [rax] + +vfmsubpd xmm0, xmm1, xmm2, xmm3 +vfmsubpd xmm0, xmm1, dqword [rax], xmm3 +vfmsubpd xmm0, xmm1, xmm2, dqword [rax] +vfmsubpd ymm0, ymm1, ymm2, ymm3 +vfmsubpd ymm0, ymm1, yword [rax], ymm3 +vfmsubpd ymm0, ymm1, ymm2, yword [rax] + +vfmsubps xmm0, xmm1, xmm2, xmm3 +vfmsubps xmm0, xmm1, dqword [rax], xmm3 +vfmsubps xmm0, xmm1, xmm2, dqword [rax] +vfmsubps ymm0, ymm1, ymm2, ymm3 +vfmsubps ymm0, ymm1, yword [rax], ymm3 +vfmsubps ymm0, ymm1, ymm2, yword [rax] + +vfmsubsd xmm0, xmm1, xmm2, xmm3 +vfmsubsd xmm0, xmm1, qword [rax], xmm3 +vfmsubsd xmm0, xmm1, xmm2, qword [rax] + +vfmsubss xmm0, xmm1, xmm2, xmm3 +vfmsubss xmm0, xmm1, dword [rax], xmm3 +vfmsubss xmm0, xmm1, xmm2, dword [rax] + +vfnmaddpd xmm0, xmm1, xmm2, xmm3 +vfnmaddpd xmm0, xmm1, dqword [rax], xmm3 +vfnmaddpd xmm0, xmm1, xmm2, dqword [rax] +vfnmaddpd ymm0, ymm1, ymm2, ymm3 +vfnmaddpd ymm0, ymm1, yword [rax], ymm3 +vfnmaddpd ymm0, ymm1, ymm2, yword [rax] + +vfnmaddps xmm0, xmm1, xmm2, xmm3 +vfnmaddps xmm0, xmm1, dqword [rax], xmm3 +vfnmaddps xmm0, xmm1, xmm2, dqword [rax] +vfnmaddps ymm0, ymm1, ymm2, ymm3 +vfnmaddps ymm0, ymm1, yword [rax], ymm3 +vfnmaddps ymm0, ymm1, ymm2, yword [rax] + +vfnmaddsd xmm0, xmm1, xmm2, xmm3 +vfnmaddsd xmm0, xmm1, qword [rax], xmm3 +vfnmaddsd xmm0, xmm1, xmm2, qword [rax] + +vfnmaddss xmm0, xmm1, xmm2, xmm3 +vfnmaddss xmm0, xmm1, dword [rax], xmm3 +vfnmaddss xmm0, xmm1, xmm2, dword [rax] + +vfnmsubpd xmm0, xmm1, xmm2, xmm3 +vfnmsubpd xmm0, xmm1, dqword [rax], xmm3 +vfnmsubpd xmm0, xmm1, xmm2, dqword [rax] +vfnmsubpd ymm0, ymm1, ymm2, ymm3 +vfnmsubpd ymm0, ymm1, yword [rax], ymm3 +vfnmsubpd ymm0, ymm1, ymm2, yword [rax] + +vfnmsubps xmm0, xmm1, xmm2, xmm3 +vfnmsubps xmm0, xmm1, dqword [rax], xmm3 +vfnmsubps xmm0, xmm1, xmm2, dqword [rax] +vfnmsubps ymm0, ymm1, ymm2, ymm3 +vfnmsubps ymm0, ymm1, yword [rax], ymm3 +vfnmsubps ymm0, ymm1, ymm2, yword [rax] + +vfnmsubsd xmm0, xmm1, xmm2, xmm3 +vfnmsubsd xmm0, xmm1, qword [rax], xmm3 +vfnmsubsd xmm0, xmm1, xmm2, qword [rax] + +vfnmsubss xmm0, xmm1, xmm2, xmm3 +vfnmsubss xmm0, xmm1, dword [rax], xmm3 +vfnmsubss xmm0, xmm1, xmm2, dword [rax] + diff --git a/modules/arch/x86/tests/fma.hex b/modules/arch/x86/tests/fma.hex new file mode 100644 index 00000000..a1193179 --- /dev/null +++ b/modules/arch/x86/tests/fma.hex @@ -0,0 +1,540 @@ +c4 +e3 +71 +69 +c2 +30 +c4 +e3 +71 +69 +00 +30 +c4 +e3 +71 +69 +00 +30 +c4 +e3 +f1 +69 +00 +20 +c4 +e3 +f1 +69 +00 +20 +c4 +e3 +75 +69 +c2 +30 +c4 +e3 +75 +69 +00 +30 +c4 +e3 +75 +69 +00 +30 +c4 +e3 +f5 +69 +00 +20 +c4 +e3 +f5 +69 +00 +20 +c4 +e3 +71 +68 +c2 +30 +c4 +e3 +71 +68 +00 +30 +c4 +e3 +f1 +68 +00 +20 +c4 +e3 +75 +68 +c2 +30 +c4 +e3 +75 +68 +00 +30 +c4 +e3 +f5 +68 +00 +20 +c4 +e3 +71 +6b +c2 +30 +c4 +e3 +71 +6b +00 +30 +c4 +e3 +71 +6b +00 +30 +c4 +e3 +f1 +6b +00 +20 +c4 +e3 +f1 +6b +00 +20 +c4 +e3 +71 +6a +c2 +30 +c4 +e3 +71 +6a +00 +30 +c4 +e3 +f1 +6a +00 +20 +c4 +e3 +71 +5d +c2 +30 +c4 +e3 +71 +5d +00 +30 +c4 +e3 +f1 +5d +00 +20 +c4 +e3 +75 +5d +c2 +30 +c4 +e3 +75 +5d +00 +30 +c4 +e3 +f5 +5d +00 +20 +c4 +e3 +71 +5c +c2 +30 +c4 +e3 +71 +5c +00 +30 +c4 +e3 +f1 +5c +00 +20 +c4 +e3 +75 +5c +c2 +30 +c4 +e3 +75 +5c +00 +30 +c4 +e3 +f5 +5c +00 +20 +c4 +e3 +71 +6d +c2 +30 +c4 +e3 +71 +6d +00 +30 +c4 +e3 +f1 +6d +00 +20 +c4 +e3 +75 +6d +c2 +30 +c4 +e3 +75 +6d +00 +30 +c4 +e3 +f5 +6d +00 +20 +c4 +e3 +71 +6c +c2 +30 +c4 +e3 +71 +6c +00 +30 +c4 +e3 +f1 +6c +00 +20 +c4 +e3 +75 +6c +c2 +30 +c4 +e3 +75 +6c +00 +30 +c4 +e3 +f5 +6c +00 +20 +c4 +e3 +71 +6f +c2 +30 +c4 +e3 +71 +6f +00 +30 +c4 +e3 +f1 +6f +00 +20 +c4 +e3 +71 +6e +c2 +30 +c4 +e3 +71 +6e +00 +30 +c4 +e3 +f1 +6e +00 +20 +c4 +e3 +71 +79 +c2 +30 +c4 +e3 +71 +79 +00 +30 +c4 +e3 +f1 +79 +00 +20 +c4 +e3 +75 +79 +c2 +30 +c4 +e3 +75 +79 +00 +30 +c4 +e3 +f5 +79 +00 +20 +c4 +e3 +71 +78 +c2 +30 +c4 +e3 +71 +78 +00 +30 +c4 +e3 +f1 +78 +00 +20 +c4 +e3 +75 +78 +c2 +30 +c4 +e3 +75 +78 +00 +30 +c4 +e3 +f5 +78 +00 +20 +c4 +e3 +71 +7b +c2 +30 +c4 +e3 +71 +7b +00 +30 +c4 +e3 +f1 +7b +00 +20 +c4 +e3 +71 +7a +c2 +30 +c4 +e3 +71 +7a +00 +30 +c4 +e3 +f1 +7a +00 +20 +c4 +e3 +71 +7d +c2 +30 +c4 +e3 +71 +7d +00 +30 +c4 +e3 +f1 +7d +00 +20 +c4 +e3 +75 +7d +c2 +30 +c4 +e3 +75 +7d +00 +30 +c4 +e3 +f5 +7d +00 +20 +c4 +e3 +71 +7c +c2 +30 +c4 +e3 +71 +7c +00 +30 +c4 +e3 +f1 +7c +00 +20 +c4 +e3 +75 +7c +c2 +30 +c4 +e3 +75 +7c +00 +30 +c4 +e3 +f5 +7c +00 +20 +c4 +e3 +71 +7f +c2 +30 +c4 +e3 +71 +7f +00 +30 +c4 +e3 +f1 +7f +00 +20 +c4 +e3 +71 +7e +c2 +30 +c4 +e3 +71 +7e +00 +30 +c4 +e3 +f1 +7e +00 +20 diff --git a/modules/arch/x86/tests/vpermil2.asm b/modules/arch/x86/tests/vpermil2.asm new file mode 100644 index 00000000..cc774c1b --- /dev/null +++ b/modules/arch/x86/tests/vpermil2.asm @@ -0,0 +1,10 @@ +[bits 64] +vpermiltd2pd xmm1, xmm2, xmm3, xmm4 ; 0 +;vpermiltd2pd xmm1, xmm2, xmm3, xmm4 ; 1 +vpermilmo2pd xmm1, xmm2, xmm3, xmm4 ; 2 +vpermilmz2pd xmm1, xmm2, xmm3, xmm4 ; 3 + +vpermiltd2ps xmm1, xmm2, xmm3, xmm4 ; 0 +;vpermiltd2ps xmm1, xmm2, xmm3, xmm4 ; 1 +vpermilmo2ps xmm1, xmm2, xmm3, xmm4 ; 2 +vpermilmz2ps xmm1, xmm2, xmm3, xmm4 ; 3 diff --git a/modules/arch/x86/tests/vpermil2.hex b/modules/arch/x86/tests/vpermil2.hex new file mode 100644 index 00000000..29d1af0a --- /dev/null +++ b/modules/arch/x86/tests/vpermil2.hex @@ -0,0 +1,36 @@ +c4 +e3 +69 +49 +cb +40 +c4 +e3 +69 +49 +cb +42 +c4 +e3 +69 +49 +cb +43 +c4 +e3 +69 +48 +cb +40 +c4 +e3 +69 +48 +cb +42 +c4 +e3 +69 +48 +cb +43 diff --git a/modules/arch/x86/x86arch.c b/modules/arch/x86/x86arch.c index 5b8ad700..de7ba518 100644 --- a/modules/arch/x86/x86arch.c +++ b/modules/arch/x86/x86arch.c @@ -399,6 +399,8 @@ yasm_x86__get_reg_size(uintptr_t reg) return 64; case X86_XMMREG: return 128; + case X86_YMMREG: + return 256; case X86_FPUREG: return 80; default: @@ -420,6 +422,7 @@ x86_reggroup_get_reg(yasm_arch *arch, uintptr_t reggroup, yasm_arch_x86 *arch_x86 = (yasm_arch_x86 *)arch; switch ((x86_expritem_reg_size)(reggroup & ~0xFUL)) { case X86_XMMREG: + case X86_YMMREG: if (arch_x86->mode_bits == 64) { if (regindex > 15) return 0; @@ -480,6 +483,9 @@ x86_reg_print(yasm_arch *arch, uintptr_t reg, FILE *f) case X86_XMMREG: fprintf(f, "xmm%d", (int)(reg&0xF)); break; + case X86_YMMREG: + fprintf(f, "ymm%d", (int)(reg&0xF)); + break; case X86_CRREG: fprintf(f, "cr%d", (int)(reg&0xF)); break; diff --git a/modules/arch/x86/x86arch.h b/modules/arch/x86/x86arch.h index ec21a9c5..2491b3bc 100644 --- a/modules/arch/x86/x86arch.h +++ b/modules/arch/x86/x86arch.h @@ -66,6 +66,10 @@ #define CPU_SSE4a 32 /* AMD Streaming SIMD extensions 4a required */ #define CPU_SSE5 33 /* AMD Streaming SIMD extensions 5 required */ #define CPU_XSAVE 34 /* Intel XSAVE instructions */ +#define CPU_AVX 35 /* Intel Advanced Vector Extensions */ +#define CPU_FMA 36 /* Intel Fused-Multiply-Add Extensions */ +#define CPU_AES 37 /* AES instruction */ +#define CPU_CLMUL 38 /* PCLMULQDQ instruction */ typedef struct yasm_arch_x86 { yasm_arch_base arch; /* base structure */ @@ -97,10 +101,11 @@ typedef enum { X86_FPUREG = 0x6<<4, X86_MMXREG = 0x7<<4, X86_XMMREG = 0x8<<4, - X86_CRREG = 0x9<<4, - X86_DRREG = 0xA<<4, - X86_TRREG = 0xB<<4, - X86_RIP = 0xC<<4 /* 64-bit mode only, always RIP (regnum ignored) */ + X86_YMMREG = 0x9<<4, + X86_CRREG = 0xA<<4, + X86_DRREG = 0xB<<4, + X86_TRREG = 0xC<<4, + X86_RIP = 0xD<<4 /* 64-bit mode only, always RIP (regnum ignored) */ } x86_expritem_reg_size; /* Low 8 bits are used for the prefix value, stored in same data area. */ diff --git a/modules/arch/x86/x86bc.c b/modules/arch/x86/x86bc.c index dfcaa26c..5f542432 100644 --- a/modules/arch/x86/x86bc.c +++ b/modules/arch/x86/x86bc.c @@ -597,11 +597,32 @@ x86_bc_insn_calc_len(yasm_bytecode *bc, yasm_bc_add_span_func add_span, bc->len += immlen/8; } + /* VEX prefixes never have REX. We can come into this function with the + * three byte form, so we need to see if we can optimize to the two byte + * form. We can't do it earlier, as we don't know all of the REX byte + * until now. + */ + if (insn->special_prefix == 0xC4) { + /* See if we can shorten the VEX prefix to its two byte form. + * In order to do this, REX.X, REX.B, and REX.W/VEX.W must all be 0, + * and the VEX mmmmm field must be 1. + */ + if ((insn->opcode.opcode[0] & 0x1F) == 1 && + (insn->opcode.opcode[1] & 0x80) == 0 && + (insn->rex == 0xff || (insn->rex & 0x0B) == 0)) { + insn->opcode.opcode[0] = insn->opcode.opcode[1]; + insn->opcode.opcode[1] = insn->opcode.opcode[2]; + insn->opcode.opcode[2] = 0; /* sanity */ + insn->opcode.len = 2; + insn->special_prefix = 0xC5; /* mark as two-byte VEX */ + } + } else if (insn->rex != 0xff && insn->rex != 0 && + insn->special_prefix != 0xC5) + bc->len++; + bc->len += insn->opcode.len; bc->len += x86_common_calc_len(&insn->common); bc->len += (insn->special_prefix != 0) ? 1:0; - if (insn->rex != 0xff && insn->rex != 0) - bc->len++; return 0; } @@ -798,7 +819,25 @@ x86_bc_insn_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, x86_ea ? (unsigned int)(x86_ea->ea.segreg>>8) : 0); if (insn->special_prefix != 0) YASM_WRITE_8(*bufp, insn->special_prefix); - if (insn->rex != 0xff && insn->rex != 0) { + if (insn->special_prefix == 0xC4) { + /* 3-byte VEX; merge in 1s complement of REX.R, REX.X, REX.B */ + insn->opcode.opcode[0] &= 0x1F; + if (insn->rex != 0xff) + insn->opcode.opcode[0] |= ((~insn->rex) & 0x07) << 5; + /* merge REX.W via ORing; there should never be a case in which REX.W + * is important when VEX.W is already set by the instruction. + */ + if (insn->rex != 0xff && (insn->rex & 0x8) != 0) + insn->opcode.opcode[1] |= 0x80; + } else if (insn->special_prefix == 0xC5) { + /* 2-byte VEX; merge in 1s complement of REX.R */ + insn->opcode.opcode[0] &= 0x7F; + if (insn->rex != 0xff && (insn->rex & 0x4) == 0) + insn->opcode.opcode[0] |= 0x80; + /* No other REX bits should be set */ + if (insn->rex != 0xff && (insn->rex & 0xB) != 0) + yasm_internal_error(N_("x86: REX.WXB set, but 2-byte VEX")); + } else if (insn->rex != 0xff && insn->rex != 0) { if (insn->common.mode_bits != 64) yasm_internal_error(N_("x86: got a REX prefix in non-64-bit mode")); YASM_WRITE_8(*bufp, insn->rex); diff --git a/modules/arch/x86/x86cpu.gperf b/modules/arch/x86/x86cpu.gperf index c3f27e5b..83e29b5a 100644 --- a/modules/arch/x86/x86cpu.gperf +++ b/modules/arch/x86/x86cpu.gperf @@ -47,6 +47,7 @@ RCSID("$Id$"); #define PROC_conroe 11 #define PROC_penryn 12 #define PROC_nehalem 13 +#define PROC_sandybridge 14 static void x86_cpu_intel(wordptr cpu, unsigned int data) @@ -58,6 +59,12 @@ x86_cpu_intel(wordptr cpu, unsigned int data) BitVector_Bit_On(cpu, CPU_Prot); if (data >= PROC_386) BitVector_Bit_On(cpu, CPU_SMM); + if (data >= PROC_sandybridge) { + BitVector_Bit_On(cpu, CPU_AVX); + BitVector_Bit_On(cpu, CPU_FMA); + BitVector_Bit_On(cpu, CPU_AES); + BitVector_Bit_On(cpu, CPU_CLMUL); + } if (data >= PROC_nehalem) { BitVector_Bit_On(cpu, CPU_SSE42); BitVector_Bit_On(cpu, CPU_XSAVE); @@ -266,6 +273,7 @@ conroe, x86_cpu_intel, PROC_conroe core2, x86_cpu_intel, PROC_conroe penryn, x86_cpu_intel, PROC_penryn nehalem, x86_cpu_intel, PROC_nehalem +sandybridge, x86_cpu_intel, PROC_sandybridge # # Features have "no" versions to disable them, and only set/reset the # specific feature being changed. All other bits are left alone. @@ -330,6 +338,16 @@ sse5, x86_cpu_set, CPU_SSE5 nosse5, x86_cpu_clear, CPU_SSE5 xsave, x86_cpu_set, CPU_XSAVE noxsave, x86_cpu_clear, CPU_XSAVE +avx, x86_cpu_set, CPU_AVX +noavx, x86_cpu_clear, CPU_AVX +fma, x86_cpu_set, CPU_FMA +nofma, x86_cpu_clear, CPU_FMA +aes, x86_cpu_set, CPU_AES +noaes, x86_cpu_clear, CPU_AES +clmul, x86_cpu_set, CPU_CLMUL +noclmul, x86_cpu_clear, CPU_CLMUL +pclmulqdq, x86_cpu_set, CPU_CLMUL +nopclmulqdq, x86_cpu_clear, CPU_CLMUL %% void diff --git a/modules/arch/x86/x86id.c b/modules/arch/x86/x86id.c index 7adc12e3..07d05a0e 100644 --- a/modules/arch/x86/x86id.c +++ b/modules/arch/x86/x86id.c @@ -49,6 +49,7 @@ static const char *cpu_find_reverse(unsigned int cpu0, unsigned int cpu1, #define MOD_AdSizeR 8 /* Parameter replaces addrsize (jmp only) */ #define MOD_DOpS64R 9 /* Parameter replaces default 64-bit opersize */ #define MOD_Op1AddSp 10 /* Parameter is added as "spare" to opcode byte 2 */ +#define MOD_SetVEX 11 /* Parameter replaces internal VEX prefix value */ /* GAS suffix flags for instructions */ enum x86_gas_suffix_flags { @@ -73,7 +74,10 @@ enum x86_gas_suffix_flags { enum x86_misc_flags { /* These are tested against BITS==64. */ ONLY_64 = 1<<0, /* Only available in 64-bit mode */ - NOT_64 = 1<<1 /* Not available (invalid) in 64-bit mode */ + NOT_64 = 1<<1, /* Not available (invalid) in 64-bit mode */ + /* These are tested against whether the base instruction is an AVX one. */ + ONLY_AVX = 1<<2, /* Only available in AVX instruction */ + NOT_AVX = 1<<3 /* Not available (invalid) in AVX instruction */ }; enum x86_operand_type { @@ -118,18 +122,18 @@ enum x86_operand_type { enum x86_operand_size { /* any size acceptable/no size spec acceptable (dep. on strict) */ OPS_Any = 0, - /* 8/16/32/64 bits (from user or reg size) */ + /* 8/16/32/64/80/128/256 bits (from user or reg size) */ OPS_8 = 1, OPS_16 = 2, OPS_32 = 3, OPS_64 = 4, - /* 80/128 bits (from user) */ OPS_80 = 5, OPS_128 = 6, + OPS_256 = 7, /* current BITS setting; when this is used the size matched * gets stored into the opersize as well. */ - OPS_BITS = 7 + OPS_BITS = 8 }; enum x86_operand_targetmod { @@ -160,7 +164,18 @@ enum x86_operand_action { OPA_JmpFar = 10, /* ea operand only sets address size (no actual ea field) */ OPA_AdSizeEA = 11, - OPA_DREX = 12 /* operand data goes into DREX "dest" field */ + OPA_DREX = 12, /* operand data goes into DREX "dest" field */ + OPA_VEX = 13, /* operand data goes into VEX "vvvv" field */ + /* operand data goes into BOTH VEX "vvvv" field and ea field */ + OPA_EAVEX = 14, + /* operand data goes into BOTH VEX "vvvv" field and spare field */ + OPA_SpareVEX = 15, + /* operand data goes into upper 4 bits of immediate byte (VEX is4 field) */ + OPA_VEXImmSrc = 16, + /* operand data goes into bottom 4 bits of immediate byte + * (currently only VEX imz2 field) + */ + OPA_VEXImm = 17 }; enum x86_operand_post_action { @@ -184,7 +199,7 @@ typedef struct x86_info_operand { unsigned int type:5; /* size (user-specified, or from register size) */ - unsigned int size:3; + unsigned int size:4; /* size implicit or explicit ("strictness" of size matching on * non-registers -- registers are always strictly matched): @@ -208,7 +223,7 @@ typedef struct x86_info_operand { * an ea field). Naturally, only one of each of these may be contained * in the operands of a single insn_info structure. */ - unsigned int action:4; + unsigned int action:5; /* Postponed actions: actions which can't be completed at * parse-time due to possibly dependent expressions. For these, some @@ -254,6 +269,14 @@ typedef struct x86_insn_info { * mode, they're treated like normal prefixes (e.g. the REX prefix needs * to be *after* the F2/F3/66 "prefix"). * (0=no special prefix) + * 0xC0 - 0xCF indicate a VEX prefix, with the four LSBs holding "WLpp": + * W: VEX.W field (meaning depends on opcode) + * L: 0=128-bit, 1=256-bit + * pp: SIMD prefix designation: + * 00: None + * 01: 66 + * 10: F3 + * 11: F2 */ unsigned char special_prefix; @@ -424,7 +447,8 @@ x86_finalize_jmp(yasm_bytecode *bc, yasm_bytecode *prev_bc, unsigned int mode_bits = id_insn->mode_bits; /*unsigned char suffix = id_insn->suffix;*/ yasm_insn_operand *op; - static const unsigned char size_lookup[] = {0, 8, 16, 32, 64, 80, 128, 0}; + static const unsigned char size_lookup[] = + {0, 8, 16, 32, 64, 80, 128, 0, 0}; /* 256 not needed */ unsigned int i; /* We know the target is in operand 0, but sanity check for Imm. */ @@ -576,6 +600,12 @@ x86_find_match(x86_id_insn *id_insn, yasm_insn_operand **ops, if (id_insn->insn.num_operands != info->num_operands) continue; + /* Match AVX */ + if (!(id_insn->misc_flags & ONLY_AVX) && (misc_flags & ONLY_AVX)) + continue; + if ((id_insn->misc_flags & ONLY_AVX) && (misc_flags & NOT_AVX)) + continue; + /* Match parser mode */ if ((gas_flags & GAS_ONLY) && id_insn->parser != X86_PARSER_GAS) continue; @@ -644,6 +674,7 @@ x86_find_match(x86_id_insn *id_insn, yasm_insn_operand **ops, switch ((x86_expritem_reg_size)(op->data.reg&~0xFUL)) { case X86_MMXREG: case X86_XMMREG: + case X86_YMMREG: break; default: mismatch = 1; @@ -968,29 +999,30 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) const x86_insn_info *info = id_insn->group; unsigned int mode_bits = id_insn->mode_bits; unsigned char *mod_data = id_insn->mod_data; - yasm_insn_operand *op, *ops[4], *rev_ops[4]; + yasm_insn_operand *op, *ops[5], *rev_ops[5]; /*@null@*/ yasm_expr *imm; unsigned char im_len; unsigned char im_sign; unsigned char spare; unsigned char drex; unsigned char *pdrex; + unsigned char vexdata, vexreg; unsigned int i; - unsigned int size_lookup[] = {0, 8, 16, 32, 64, 80, 128, 0}; + unsigned int size_lookup[] = {0, 8, 16, 32, 64, 80, 128, 256, 0}; unsigned long do_postop = 0; - size_lookup[7] = mode_bits; + size_lookup[OPS_BITS] = mode_bits; yasm_insn_finalize(&id_insn->insn); /* Build local array of operands from list, since we know we have a max - * of 4 operands. + * of 5 operands. */ - if (id_insn->insn.num_operands > 4) { + if (id_insn->insn.num_operands > 5) { yasm_error_set(YASM_ERROR_TYPE, N_("too many operands")); return; } - ops[0] = ops[1] = ops[2] = ops[3] = NULL; + ops[0] = ops[1] = ops[2] = ops[3] = ops[4] = NULL; for (i = 0, op = yasm_insn_ops_first(&id_insn->insn); op && i < id_insn->insn.num_operands; op = yasm_insn_op_next(op), i++) @@ -1000,7 +1032,7 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) * as most GAS instructions have reversed operands from Intel style. */ if (id_insn->parser == X86_PARSER_GAS) { - rev_ops[0] = rev_ops[1] = rev_ops[2] = rev_ops[3] = NULL; + rev_ops[0] = rev_ops[1] = rev_ops[2] = rev_ops[3] = rev_ops[4] = NULL; for (i = id_insn->insn.num_operands-1, op = yasm_insn_ops_first(&id_insn->insn); op; op = yasm_insn_op_next(op), i--) @@ -1067,12 +1099,22 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) insn->special_prefix = info->special_prefix; spare = info->spare; drex = info->drex_oc0 & DREX_OC0_MASK; + vexdata = 0; + vexreg = 0; im_len = 0; im_sign = 0; insn->postop = X86_POSTOP_NONE; insn->rex = 0; pdrex = (info->drex_oc0 & NEED_DREX_MASK) ? &drex : NULL; + /* Move VEX data (stored in special prefix) to separate location to + * allow overriding of special prefix by modifiers. + */ + if ((insn->special_prefix & 0xF0) == 0xC0) { + vexdata = insn->special_prefix; + insn->special_prefix = 0; + } + /* Apply modifiers */ for (i=0; imodifiers); i++) { switch (info->modifiers[i]) { @@ -1107,6 +1149,9 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) case MOD_Op1AddSp: insn->opcode.opcode[1] += mod_data[i]<<3; break; + case MOD_SetVEX: + vexdata = mod_data[i]; + break; default: break; } @@ -1185,6 +1230,15 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) break; } break; + case OPA_EAVEX: + if (op->type != YASM_INSN__OPERAND_REG) + yasm_internal_error(N_("invalid operand conversion")); + insn->x86_ea = + yasm_x86__ea_create_reg(insn->x86_ea, + (unsigned long)op->data.reg, &insn->rex, pdrex, + mode_bits); + vexreg = op->data.reg & 0xF; + break; case OPA_Imm: if (op->seg) yasm_error_set(YASM_ERROR_VALUE, @@ -1216,6 +1270,14 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) } else yasm_internal_error(N_("invalid operand conversion")); break; + case OPA_SpareVEX: + if (op->type != YASM_INSN__OPERAND_REG) + yasm_internal_error(N_("invalid operand conversion")); + if (yasm_x86__set_rex_from_reg(&insn->rex, pdrex, + &spare, op->data.reg, mode_bits, X86_REX_R)) + return; + vexreg = op->data.reg & 0xF; + break; case OPA_Op0Add: if (op->type == YASM_INSN__OPERAND_REG) { unsigned char opadd; @@ -1278,8 +1340,64 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) break; } case OPA_DREX: - drex &= 0x0F; - drex |= (op->data.reg << 4) & 0xF0; + if (op->type == YASM_INSN__OPERAND_REG) { + drex &= 0x0F; + drex |= (op->data.reg << 4) & 0xF0; + } else + yasm_internal_error(N_("invalid operand conversion")); + break; + case OPA_VEX: + if (op->type != YASM_INSN__OPERAND_REG) + yasm_internal_error(N_("invalid operand conversion")); + vexreg = op->data.reg & 0xF; + break; + case OPA_VEXImmSrc: + if (op->type != YASM_INSN__OPERAND_REG) + yasm_internal_error(N_("invalid operand conversion")); + + if (!imm) { + imm = yasm_expr_create_ident( + yasm_expr_int( + yasm_intnum_create_uint((op->data.reg << 4) + & 0xF0)), + bc->line); + } else { + imm = yasm_expr_create( + YASM_EXPR_OR, + yasm_expr_expr(yasm_expr_create( + YASM_EXPR_AND, + yasm_expr_expr(imm), + yasm_expr_int(yasm_intnum_create_uint(0x0F)), + bc->line)), + yasm_expr_int( + yasm_intnum_create_uint((op->data.reg << 4) + & 0xF0)), + bc->line); + } + im_len = 8; + break; + case OPA_VEXImm: + if (op->type != YASM_INSN__OPERAND_IMM) + yasm_internal_error(N_("invalid operand conversion")); + + if (!imm) + imm = op->data.val; + else { + imm = yasm_expr_create( + YASM_EXPR_OR, + yasm_expr_expr(yasm_expr_create( + YASM_EXPR_AND, + yasm_expr_expr(op->data.val), + yasm_expr_int(yasm_intnum_create_uint(0x0F)), + bc->line)), + yasm_expr_expr(yasm_expr_create( + YASM_EXPR_AND, + yasm_expr_expr(imm), + yasm_expr_int(yasm_intnum_create_uint(0xF0)), + bc->line)), + bc->line); + } + im_len = 8; break; default: yasm_internal_error(N_("unknown operand action")); @@ -1407,6 +1525,66 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) break; } + /* Convert to VEX prefixes if requested. + * To save space in the insn structure, the VEX prefix is written into + * special_prefix and the first 2 bytes of the instruction are set to + * the second two VEX bytes. During calc_len() it may be shortened to + * one VEX byte (this can only be done after knowledge of REX value). + */ + if (vexdata) { + unsigned char vex1 = 0xE0; /* R=X=B=1, mmmmm=0 */ + unsigned char vex2; + /* Look at the first bytes of the opcode to see what leading bytes + * to encode in the VEX mmmmm field. Leave R=X=B=1 for now. + */ + if (insn->opcode.opcode[0] != 0x0F) + yasm_internal_error(N_("first opcode byte of VEX must be 0x0F")); + + if (insn->opcode.opcode[1] == 0x38) + vex1 |= 0x02; /* implied 0x0F 0x38 */ + else if (insn->opcode.opcode[1] == 0x3A) + vex1 |= 0x03; /* implied 0x0F 0x3A */ + else { + /* Originally a 0F-only opcode; move opcode byte back one position + * to make room for VEX prefix. + */ + insn->opcode.opcode[2] = insn->opcode.opcode[1]; + vex1 |= 0x01; /* implied 0x0F */ + } + + /* Check for update of special prefix by modifiers */ + if (insn->special_prefix != 0) { + vexdata &= ~0x03; + switch (insn->special_prefix) { + case 0x66: + vexdata |= 0x01; + break; + case 0xF3: + vexdata |= 0x02; + break; + case 0xF2: + vexdata |= 0x03; + break; + default: + yasm_internal_error(N_("unrecognized special prefix")); + } + } + + /* 2nd VEX byte is WvvvvLpp. + * W, L, pp come from vexdata + * vvvv comes from 1s complement of vexreg + */ + vex2 = (((vexdata & 0x8) << 4) | /* W */ + ((15 - (vexreg & 0xF)) << 3) | /* vvvv */ + (vexdata & 0x7)); /* Lpp */ + + /* Save to special_prefix and opcode */ + insn->special_prefix = 0xC4; /* VEX prefix */ + insn->opcode.opcode[0] = vex1; + insn->opcode.opcode[1] = vex2; + insn->opcode.len = 3; /* two prefix bytes and 1 opcode byte */ + } + x86_id_insn_clear_operands(id_insn); /* Transform the bytecode */ diff --git a/modules/arch/x86/x86regtmod.gperf b/modules/arch/x86/x86regtmod.gperf index a5763432..1fd6bda8 100644 --- a/modules/arch/x86/x86regtmod.gperf +++ b/modules/arch/x86/x86regtmod.gperf @@ -135,6 +135,23 @@ xmm12, REG, X86_XMMREG, 12, 64 xmm13, REG, X86_XMMREG, 13, 64 xmm14, REG, X86_XMMREG, 14, 64 xmm15, REG, X86_XMMREG, 15, 64 +# AVX registers +ymm0, REG, X86_YMMREG, 0, 0 +ymm1, REG, X86_YMMREG, 1, 0 +ymm2, REG, X86_YMMREG, 2, 0 +ymm3, REG, X86_YMMREG, 3, 0 +ymm4, REG, X86_YMMREG, 4, 0 +ymm5, REG, X86_YMMREG, 5, 0 +ymm6, REG, X86_YMMREG, 6, 0 +ymm7, REG, X86_YMMREG, 7, 0 +ymm8, REG, X86_YMMREG, 8, 64 +ymm9, REG, X86_YMMREG, 9, 64 +ymm10, REG, X86_YMMREG, 10, 64 +ymm11, REG, X86_YMMREG, 11, 64 +ymm12, REG, X86_YMMREG, 12, 64 +ymm13, REG, X86_YMMREG, 13, 64 +ymm14, REG, X86_YMMREG, 14, 64 +ymm15, REG, X86_YMMREG, 15, 64 # # integer registers # diff --git a/modules/parsers/nasm/nasm-token.re b/modules/parsers/nasm/nasm-token.re index 4409566c..a1069459 100644 --- a/modules/parsers/nasm/nasm-token.re +++ b/modules/parsers/nasm/nasm-token.re @@ -234,6 +234,10 @@ scan: lvalp->int_info = yasm_arch_wordsize(p_object->arch)*8; RETURN(SIZE_OVERRIDE); } + 'yword' { + lvalp->int_info = 256; + RETURN(SIZE_OVERRIDE); + } /* pseudo-instructions */ 'db' { lvalp->int_info = 8; RETURN(DECLARE_DATA); } @@ -262,6 +266,10 @@ scan: lvalp->int_info = yasm_arch_wordsize(p_object->arch)*8; RETURN(DECLARE_DATA); } + 'dy' { + lvalp->int_info = 256; + RETURN(DECLARE_DATA); + } 'resb' { lvalp->int_info = 8; RETURN(RESERVE_SPACE); } 'reshw' { @@ -289,6 +297,10 @@ scan: lvalp->int_info = yasm_arch_wordsize(p_object->arch)*8; RETURN(RESERVE_SPACE); } + 'resy' { + lvalp->int_info = 256; + RETURN(RESERVE_SPACE); + } 'incbin' { RETURN(INCBIN); } diff --git a/modules/parsers/nasm/tests/Makefile.inc b/modules/parsers/nasm/tests/Makefile.inc index ad84593c..c9115e94 100644 --- a/modules/parsers/nasm/tests/Makefile.inc +++ b/modules/parsers/nasm/tests/Makefile.inc @@ -9,6 +9,8 @@ EXTRA_DIST += modules/parsers/nasm/tests/alignnop32.asm EXTRA_DIST += modules/parsers/nasm/tests/alignnop32.hex EXTRA_DIST += modules/parsers/nasm/tests/charconstmath.asm EXTRA_DIST += modules/parsers/nasm/tests/charconstmath.hex +EXTRA_DIST += modules/parsers/nasm/tests/dy.asm +EXTRA_DIST += modules/parsers/nasm/tests/dy.hex EXTRA_DIST += modules/parsers/nasm/tests/endcomma.asm EXTRA_DIST += modules/parsers/nasm/tests/endcomma.hex EXTRA_DIST += modules/parsers/nasm/tests/equcolon.asm diff --git a/modules/parsers/nasm/tests/dy.asm b/modules/parsers/nasm/tests/dy.asm new file mode 100644 index 00000000..5a74e2f4 --- /dev/null +++ b/modules/parsers/nasm/tests/dy.asm @@ -0,0 +1,5 @@ +dy 0x0123456789abcdef00112233445566778899aabbccddeeff1111222233334444 +dw label +section .bss +resy 1 +label: diff --git a/modules/parsers/nasm/tests/dy.hex b/modules/parsers/nasm/tests/dy.hex new file mode 100644 index 00000000..ead24e69 --- /dev/null +++ b/modules/parsers/nasm/tests/dy.hex @@ -0,0 +1,34 @@ +44 +44 +33 +33 +22 +22 +11 +11 +ff +ee +dd +cc +bb +aa +99 +88 +77 +66 +55 +44 +33 +22 +11 +00 +ef +cd +ab +89 +67 +45 +23 +01 +44 +00 From 97a96c648deaf14e83b14f0a2ab4112671cbc5f2 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 12 Apr 2008 00:56:30 +0000 Subject: [PATCH 159/585] Disable Python bindings by default; the build process for them is broken on most non-32-bit systems. svn path=/trunk/yasm/; revision=2052 --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 1bea5a2f..4d5ba24f 100644 --- a/configure.ac +++ b/configure.ac @@ -67,7 +67,7 @@ AC_HELP_STRING([--enable-python-bindings],[Build Python bindings]), yes) enable_python_bindings="yes" ;; no) enable_python_bindings="no" ;; *) AC_MSG_ERROR([bad value ${enableval} for --enable-python-bindings]) ;; -esac], enable_python_bindings="auto") +esac], enable_python_bindings="no") # # Checks for programs. From 07020fa4b7ec16827918504cb144f55c81271253 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 12 Apr 2008 01:04:29 +0000 Subject: [PATCH 160/585] Bump trunk version after 0.7.x branch. svn path=/trunk/yasm/; revision=2054 --- Mkfiles/dj/config.h | 2 +- Mkfiles/vc/config.h | 2 +- Mkfiles/vc8/config.h | 2 +- Mkfiles/vc9/config.h | 2 +- configure.ac | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Mkfiles/dj/config.h b/Mkfiles/dj/config.h index f9faf334..2ba19857 100644 --- a/Mkfiles/dj/config.h +++ b/Mkfiles/dj/config.h @@ -119,7 +119,7 @@ #define PACKAGE_BUILD "HEAD" /* Define to internal version of this package. */ -#define PACKAGE_INTVER "0.6.99" +#define PACKAGE_INTVER "0.7.99" /* Define to the full name of this package. */ #define PACKAGE_NAME "yasm" diff --git a/Mkfiles/vc/config.h b/Mkfiles/vc/config.h index e78ddf2e..204f224e 100644 --- a/Mkfiles/vc/config.h +++ b/Mkfiles/vc/config.h @@ -120,7 +120,7 @@ #define PACKAGE_BUILD "HEAD" /* Define to internal version of this package. */ -#define PACKAGE_INTVER "0.6.99" +#define PACKAGE_INTVER "0.7.99" /* Define to the full name of this package. */ #define PACKAGE_NAME "yasm" diff --git a/Mkfiles/vc8/config.h b/Mkfiles/vc8/config.h index 50369a0c..96e2dddc 100644 --- a/Mkfiles/vc8/config.h +++ b/Mkfiles/vc8/config.h @@ -120,7 +120,7 @@ #define PACKAGE_BUILD "HEAD" /* Define to internal version of this package. */ -#define PACKAGE_INTVER "0.6.99" +#define PACKAGE_INTVER "0.7.99" /* Define to the full name of this package. */ #define PACKAGE_NAME "yasm" diff --git a/Mkfiles/vc9/config.h b/Mkfiles/vc9/config.h index 739687d0..1e42c17f 100644 --- a/Mkfiles/vc9/config.h +++ b/Mkfiles/vc9/config.h @@ -120,7 +120,7 @@ #define PACKAGE_BUILD "2029" /* Define to internal version of this package. */ -#define PACKAGE_INTVER "0.6.99" +#define PACKAGE_INTVER "0.7.99" /* Define to the full name of this package. */ #define PACKAGE_NAME "yasm" diff --git a/configure.ac b/configure.ac index 4d5ba24f..97510622 100644 --- a/configure.ac +++ b/configure.ac @@ -13,7 +13,7 @@ AM_CONFIG_HEADER([config.h]) AM_INIT_AUTOMAKE(yasm, [HEAD]) AM_MAINTAINER_MODE -AC_DEFINE(PACKAGE_INTVER, ["0.6.99"], +AC_DEFINE(PACKAGE_INTVER, ["0.7.99"], [Define to internal version of this package.]) AC_DEFINE(PACKAGE_BUILD, ["HEAD"], [Define to build version of this package.]) From 76e18e1aab6b26a79df5ff018089efd3d347142d Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 12 Apr 2008 01:08:19 +0000 Subject: [PATCH 161/585] Remove snapshot version number accidentally committed with Mkfiles. svn path=/trunk/yasm/; revision=2055 --- Mkfiles/vc9/config.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Mkfiles/vc9/config.h b/Mkfiles/vc9/config.h index 1e42c17f..96e2dddc 100644 --- a/Mkfiles/vc9/config.h +++ b/Mkfiles/vc9/config.h @@ -117,7 +117,7 @@ #define PACKAGE_BUGREPORT "bug-yasm@tortall.net" /* Define to build version of this package. */ -#define PACKAGE_BUILD "2029" +#define PACKAGE_BUILD "HEAD" /* Define to internal version of this package. */ #define PACKAGE_INTVER "0.7.99" @@ -126,13 +126,13 @@ #define PACKAGE_NAME "yasm" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "yasm 2029" +#define PACKAGE_STRING "yasm HEAD" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "yasm" /* Define to the version of this package. */ -#define PACKAGE_VERSION "2029" +#define PACKAGE_VERSION "HEAD" /* Define if the C compiler supports function prototypes. */ #define PROTOTYPES 1 @@ -156,7 +156,7 @@ #define STDC_HEADERS 1 /* Version number of package */ -#define VERSION "2029" +#define VERSION "HEAD" /* Define if using the dmalloc debugging malloc package */ /* #undef WITH_DMALLOC */ From 73ce31d01d8b1798db44e5fc2c5e7aa7096c879d Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 12 Apr 2008 01:16:04 +0000 Subject: [PATCH 162/585] We no longer need bison, but we do need Python for building from SVN. svn path=/trunk/yasm/; revision=2058 --- HACKING | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HACKING b/HACKING index bc85acc5..3980f560 100644 --- a/HACKING +++ b/HACKING @@ -66,7 +66,7 @@ requires in a packaged distribution. Programs required: * m4 * gettext * make (GNU preferred) - * bison + * Python * gcc To rebuild the manpages from the DocBook XML files, the program "xmlto" and From ef8479870eeee5b19d3c5b38ecc969030f66efee Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 12 Apr 2008 01:17:00 +0000 Subject: [PATCH 163/585] Update copyright dates. svn path=/trunk/yasm/; revision=2059 --- COPYING | 2 +- frontends/yasm/yasm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/COPYING b/COPYING index 5e9221f9..7a44c8d6 100644 --- a/COPYING +++ b/COPYING @@ -1,4 +1,4 @@ -Yasm is Copyright (c) 2001-2007 Peter Johnson and other Yasm developers. +Yasm is Copyright (c) 2001-2008 Peter Johnson and other Yasm developers. Yasm developers and/or contributors include: Peter Johnson diff --git a/frontends/yasm/yasm.c b/frontends/yasm/yasm.c index 475d2ba8..8c24d285 100644 --- a/frontends/yasm/yasm.c +++ b/frontends/yasm/yasm.c @@ -194,7 +194,7 @@ static opt_option options[] = /*@observer@*/ static const char *version_msg[] = { PACKAGE_NAME " " PACKAGE_INTVER "." PACKAGE_BUILD, "Compiled on " __DATE__ ".", - "Copyright (c) 2001-2007 Peter Johnson and other Yasm developers.", + "Copyright (c) 2001-2008 Peter Johnson and other Yasm developers.", "Run yasm --license for licensing overview and summary." }; From ae63705e5602b6d7e031abe82ceb27aecc1bd42c Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 12 Apr 2008 01:33:54 +0000 Subject: [PATCH 164/585] Add YMM register group for GAS mode. svn path=/trunk/yasm/; revision=2061 --- modules/arch/x86/x86regtmod.gperf | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/arch/x86/x86regtmod.gperf b/modules/arch/x86/x86regtmod.gperf index 1fd6bda8..5d6a3d22 100644 --- a/modules/arch/x86/x86regtmod.gperf +++ b/modules/arch/x86/x86regtmod.gperf @@ -235,6 +235,7 @@ rip, REG, X86_RIP, 0, 64 st, REGGROUP, 0, X86_FPUREG, 0 mm, REGGROUP, 0, X86_MMXREG, 0 xmm, REGGROUP, 0, X86_XMMREG, 0 +ymm, REGGROUP, 0, X86_YMMREG, 0 # # segment registers # From 180d18bc11de5be247147ec2c868706652f9be9b Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 12 Apr 2008 08:30:22 +0000 Subject: [PATCH 165/585] Allow underscores in the middle of binary, octal, and hex constants. This makes things like 00_11_22_33h okay. Allow 0X as well as 0x in directives (already allowed for normal case). svn path=/trunk/yasm/; revision=2063 --- libyasm/bitvect.c | 11 +++++++-- modules/parsers/nasm/nasm-token.re | 18 +++++++------- modules/parsers/nasm/tests/Makefile.inc | 2 ++ modules/parsers/nasm/tests/uscore.asm | 10 ++++++++ modules/parsers/nasm/tests/uscore.hex | 32 +++++++++++++++++++++++++ 5 files changed, 62 insertions(+), 11 deletions(-) create mode 100644 modules/parsers/nasm/tests/uscore.asm create mode 100644 modules/parsers/nasm/tests/uscore.hex diff --git a/libyasm/bitvect.c b/libyasm/bitvect.c index 49f19b26..57ad6133 100644 --- a/libyasm/bitvect.c +++ b/libyasm/bitvect.c @@ -1511,7 +1511,9 @@ ErrCode BitVector_from_Hex(wordptr addr, charptr string) digit = (int) *(--string); length--; /* separate because toupper() is likely a macro! */ digit = toupper(digit); - if ((ok = (isxdigit(digit) != 0))) + if (digit == '_') + count -= 4; + else if ((ok = (isxdigit(digit) != 0))) { if (digit >= (int) 'A') digit -= (int) 'A' - 10; else digit -= (int) '0'; @@ -1548,7 +1550,9 @@ ErrCode BitVector_from_Oct(wordptr addr, charptr string) for ( count = count_fill; (ok and (length > 0) and (count < BITS)); count += 3 ) { digit = (int) *(--string); length--; - if ((ok = (isdigit(digit) && digit != '8' && digit != '9')) != 0) + if (digit == '_') + count -= 3; + else if ((ok = (isdigit(digit) && digit != '8' && digit != '9')) != 0) { digit -= (int) '0'; value |= (((N_word) digit) << count); @@ -1628,6 +1632,9 @@ ErrCode BitVector_from_Bin(wordptr addr, charptr string) case (int) '1': value |= BITMASKTAB[count]; break; + case (int) '_': + count--; + break; default: ok = FALSE; break; diff --git a/modules/parsers/nasm/nasm-token.re b/modules/parsers/nasm/nasm-token.re index a1069459..931dbdc4 100644 --- a/modules/parsers/nasm/nasm-token.re +++ b/modules/parsers/nasm/nasm-token.re @@ -63,9 +63,9 @@ static int linechg_numcount; any = [\001-\377]; digit = [0-9]; iletter = [a-zA-Z]; - bindigit = [01]; - octdigit = [0-7]; - hexdigit = [0-9a-fA-F]; + bindigit = [01_]; + octdigit = [0-7_]; + hexdigit = [0-9a-fA-F_]; ws = [ \t\r]; quot = ["']; */ @@ -151,14 +151,14 @@ scan: } /* 10010011b - binary number */ - bindigit+ 'b' { + [01] bindigit* 'b' { s->tok[TOKLEN-1] = '\0'; /* strip off 'b' */ lvalp->intn = yasm_intnum_create_bin(TOK); RETURN(INTNUM); } /* 777q or 777o - octal number */ - octdigit+ [qQoO] { + [0-7] octdigit* [qQoO] { s->tok[TOKLEN-1] = '\0'; /* strip off 'q' or 'o' */ lvalp->intn = yasm_intnum_create_oct(TOK); RETURN(INTNUM); @@ -541,14 +541,14 @@ directive2: } /* 10010011b - binary number */ - bindigit+ 'b' { + [01] bindigit* 'b' { s->tok[TOKLEN-1] = '\0'; /* strip off 'b' */ lvalp->intn = yasm_intnum_create_bin(TOK); RETURN(INTNUM); } /* 777q or 777o - octal number */ - octdigit+ [qQoO] { + [0-7] octdigit* [qQoO] { s->tok[TOKLEN-1] = '\0'; /* strip off 'q' or 'o' */ lvalp->intn = yasm_intnum_create_oct(TOK); RETURN(INTNUM); @@ -562,10 +562,10 @@ directive2: } /* $0AA and 0xAA forms of hexidecimal number */ - (("$" digit) | "0x") hexdigit+ { + (("$" digit) | '0x') hexdigit+ { savech = s->tok[TOKLEN]; s->tok[TOKLEN] = '\0'; - if (s->tok[1] == 'x') + if (s->tok[1] == 'x' || s->tok[1] == 'X') /* skip 0 and x */ lvalp->intn = yasm_intnum_create_hex(TOK+2); else diff --git a/modules/parsers/nasm/tests/Makefile.inc b/modules/parsers/nasm/tests/Makefile.inc index c9115e94..f4589c3c 100644 --- a/modules/parsers/nasm/tests/Makefile.inc +++ b/modules/parsers/nasm/tests/Makefile.inc @@ -38,6 +38,8 @@ EXTRA_DIST += modules/parsers/nasm/tests/struczero.asm EXTRA_DIST += modules/parsers/nasm/tests/struczero.hex EXTRA_DIST += modules/parsers/nasm/tests/syntax-err.asm EXTRA_DIST += modules/parsers/nasm/tests/syntax-err.errwarn +EXTRA_DIST += modules/parsers/nasm/tests/uscore.asm +EXTRA_DIST += modules/parsers/nasm/tests/uscore.hex EXTRA_DIST += modules/parsers/nasm/tests/worphan/Makefile.inc diff --git a/modules/parsers/nasm/tests/uscore.asm b/modules/parsers/nasm/tests/uscore.asm new file mode 100644 index 00000000..0630597f --- /dev/null +++ b/modules/parsers/nasm/tests/uscore.asm @@ -0,0 +1,10 @@ +dq 0000_1111_2222_3333h +dq 0000111122223333h +dd 0x01_23_45_67 +dd 0x01234567 +dw 1_2_3_4q +dw 1234q +db 00_11_00_11b +db 00110011b +_0: +dw _0 diff --git a/modules/parsers/nasm/tests/uscore.hex b/modules/parsers/nasm/tests/uscore.hex new file mode 100644 index 00000000..4793d1d8 --- /dev/null +++ b/modules/parsers/nasm/tests/uscore.hex @@ -0,0 +1,32 @@ +33 +33 +22 +22 +11 +11 +00 +00 +33 +33 +22 +22 +11 +11 +00 +00 +67 +45 +23 +01 +67 +45 +23 +01 +9c +02 +9c +02 +33 +33 +1e +00 From 2d36cf72ae9da8b3f205308b79e982dc74fbfcb3 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Mon, 14 Apr 2008 01:48:02 +0000 Subject: [PATCH 166/585] Allow {extern symbol}-{symbol in same segment} transformation. This was earlier limited to local symbols. Reported by: Dave Lee svn path=/trunk/yasm/; revision=2064 --- libyasm/value.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libyasm/value.c b/libyasm/value.c index a34be634..180bf6af 100644 --- a/libyasm/value.c +++ b/libyasm/value.c @@ -276,8 +276,8 @@ value_finalize_scan(yasm_value *value, yasm_expr *e, && sect2 == yasm_bc_get_section(expr_precbc)))) { for (j=0; jnumterms; j++) { if (e->terms[j].type == YASM_EXPR_SYM - && yasm_symrec_get_label(e->terms[j].data.sym, - &precbc2) + && !yasm_symrec_get_equ(e->terms[j].data.sym) + && !yasm_symrec_is_special(e->terms[j].data.sym) && (used & (1< Date: Mon, 21 Apr 2008 07:56:26 +0000 Subject: [PATCH 167/585] Fix AVX instruction misnaming of new vptest variants: - vptestps should be vtestps - vptestpd should be vtestpd svn path=/trunk/yasm/; revision=2069 --- modules/arch/x86/gen_x86_insn.py | 4 ++-- modules/arch/x86/tests/avx.asm | 24 ++++++++++++------------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index 113d64a2..1f250d10 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -6040,8 +6040,8 @@ add_insn("vcvttpd2dqy", "avx_cvt_xmm128_y", modifiers=[0x66, 0xE6], parser="gas" add_insn("vcvttpd2dq", "avx_cvt_xmm128", modifiers=[0x66, 0xE6]) # Instructions new to AVX -add_insn("vptestps", "sse4", modifiers=[0x0E, VEXL0], avx=True) -add_insn("vptestpd", "sse4", modifiers=[0x0F, VEXL0], avx=True) +add_insn("vtestps", "sse4", modifiers=[0x0E, VEXL0], avx=True) +add_insn("vtestpd", "sse4", modifiers=[0x0F, VEXL0], avx=True) add_group("vbroadcastss", cpu=["AVX"], diff --git a/modules/arch/x86/tests/avx.asm b/modules/arch/x86/tests/avx.asm index 45495033..2a2ad594 100644 --- a/modules/arch/x86/tests/avx.asm +++ b/modules/arch/x86/tests/avx.asm @@ -2154,19 +2154,19 @@ vptest ymm1, ymm2 vptest ymm1, [rax] vptest ymm1, yword [rax] -vptestps xmm1, xmm2 -vptestps xmm1, [rax] -vptestps xmm1, dqword [rax] -vptestps ymm1, ymm2 -vptestps ymm1, [rax] -vptestps ymm1, yword [rax] +vtestps xmm1, xmm2 +vtestps xmm1, [rax] +vtestps xmm1, dqword [rax] +vtestps ymm1, ymm2 +vtestps ymm1, [rax] +vtestps ymm1, yword [rax] -vptestpd xmm1, xmm2 -vptestpd xmm1, [rax] -vptestpd xmm1, dqword [rax] -vptestpd ymm1, ymm2 -vptestpd ymm1, [rax] -vptestpd ymm1, yword [rax] +vtestpd xmm1, xmm2 +vtestpd xmm1, [rax] +vtestpd xmm1, dqword [rax] +vtestpd ymm1, ymm2 +vtestpd ymm1, [rax] +vtestpd ymm1, yword [rax] psubb xmm1, xmm2 psubb xmm1, [rax] From 3d2fb09a5f33774c3a6c0bd2cff12aacf0c14923 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Mon, 21 Apr 2008 07:59:57 +0000 Subject: [PATCH 168/585] Fix a number of AVX instructions where VEX.vvvv was incorrectly being set to a register value instead of 1111b as required by the specification. Reported by: Mark Charney svn path=/trunk/yasm/; revision=2070 --- modules/arch/x86/gen_x86_insn.py | 80 +++++++++++++++++++++++++++----- modules/arch/x86/tests/avx.hex | 66 +++++++++++++------------- 2 files changed, 101 insertions(+), 45 deletions(-) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index 1f250d10..ef19a408 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -4131,7 +4131,7 @@ add_insn("subss", "xmm_xmm32", modifiers=[0xF3, 0x5C]) add_insn("ucomiss", "xmm_xmm32", modifiers=[0, 0x2E]) add_insn("vaddss", "xmm_xmm32", modifiers=[0xF3, 0x58, VEXL0], avx=True) -add_insn("vcomiss", "xmm_xmm32", modifiers=[0, 0x2F, VEXL0], avx=True) +# vcomiss and vucomiss are only two operand add_insn("vdivss", "xmm_xmm32", modifiers=[0xF3, 0x5E, VEXL0], avx=True) add_insn("vmaxss", "xmm_xmm32", modifiers=[0xF3, 0x5F, VEXL0], avx=True) add_insn("vminss", "xmm_xmm32", modifiers=[0xF3, 0x5D, VEXL0], avx=True) @@ -4140,7 +4140,6 @@ add_insn("vrcpss", "xmm_xmm32", modifiers=[0xF3, 0x53, VEXL0], avx=True) add_insn("vrsqrtss", "xmm_xmm32", modifiers=[0xF3, 0x52, VEXL0], avx=True) add_insn("vsqrtss", "xmm_xmm32", modifiers=[0xF3, 0x51, VEXL0], avx=True) add_insn("vsubss", "xmm_xmm32", modifiers=[0xF3, 0x5C, VEXL0], avx=True) -add_insn("vucomiss", "xmm_xmm32", modifiers=[0, 0x2E, VEXL0], avx=True) add_group("ssecmp_128", cpu=["SSE"], @@ -4790,7 +4789,7 @@ add_insn("sqrtsd", "xmm_xmm64", modifiers=[0xF2, 0x51]) add_insn("ucomisd", "xmm_xmm64", modifiers=[0x66, 0x2E]) add_insn("vaddsd", "xmm_xmm64", modifiers=[0xF2, 0x58, VEXL0], avx=True) -add_insn("vcomisd", "xmm_xmm64", modifiers=[0x66, 0x2F, VEXL0], avx=True) +# vcomisd and vucomisd are only two operand # vcvtdq2pd and vcvtps2pd can take ymm, xmm version add_insn("vcvtsd2ss", "xmm_xmm64", modifiers=[0xF2, 0x5A, VEXL0], avx=True) add_insn("vdivsd", "xmm_xmm64", modifiers=[0xF2, 0x5E, VEXL0], avx=True) @@ -4799,7 +4798,6 @@ add_insn("vminsd", "xmm_xmm64", modifiers=[0xF2, 0x5D, VEXL0], avx=True) add_insn("vmulsd", "xmm_xmm64", modifiers=[0xF2, 0x59, VEXL0], avx=True) add_insn("vsubsd", "xmm_xmm64", modifiers=[0xF2, 0x5C, VEXL0], avx=True) add_insn("vsqrtsd", "xmm_xmm64", modifiers=[0xF2, 0x51, VEXL0], avx=True) -add_insn("vucomisd", "xmm_xmm64", modifiers=[0x66, 0x2E, VEXL0], avx=True) add_insn("addpd", "xmm_xmm128", modifiers=[0x66, 0x58], cpu=["SSE2"]) add_insn("andnpd", "xmm_xmm128", modifiers=[0x66, 0x55], cpu=["SSE2"]) @@ -5277,9 +5275,7 @@ add_insn("vpsignb", "ssse3", modifiers=[0x08, VEXL0], avx=True) add_insn("vpsignw", "ssse3", modifiers=[0x09, VEXL0], avx=True) add_insn("vpsignd", "ssse3", modifiers=[0x0A, VEXL0], avx=True) add_insn("vpmulhrsw", "ssse3", modifiers=[0x0B, VEXL0], avx=True) -add_insn("vpabsb", "ssse3", modifiers=[0x1C, VEXL0], avx=True) -add_insn("vpabsw", "ssse3", modifiers=[0x1D, VEXL0], avx=True) -add_insn("vpabsd", "ssse3", modifiers=[0x1E, VEXL0], avx=True) +# vpabsb/vpabsw/vpabsd are 2 operand only add_group("ssse3imm", cpu=["SSSE3"], @@ -5340,7 +5336,7 @@ add_insn("ptest", "sse4", modifiers=[0x17]) add_insn("vpackusdw", "ssse3", modifiers=[0x2B, VEXL0], avx=True) add_insn("vpcmpeqq", "ssse3", modifiers=[0x29, VEXL0], avx=True) add_insn("vpcmpgtq", "ssse3", modifiers=[0x37, VEXL0], avx=True) -add_insn("vphminposuw", "ssse3", modifiers=[0x41, VEXL0], avx=True) +# vphminposuw is 2 operand only add_insn("vpmaxsb", "ssse3", modifiers=[0x3C, VEXL0], avx=True) add_insn("vpmaxsd", "ssse3", modifiers=[0x3D, VEXL0], avx=True) add_insn("vpmaxud", "ssse3", modifiers=[0x3F, VEXL0], avx=True) @@ -5351,7 +5347,7 @@ add_insn("vpminud", "ssse3", modifiers=[0x3B, VEXL0], avx=True) add_insn("vpminuw", "ssse3", modifiers=[0x3A, VEXL0], avx=True) add_insn("vpmuldq", "ssse3", modifiers=[0x28, VEXL0], avx=True) add_insn("vpmulld", "ssse3", modifiers=[0x40, VEXL0], avx=True) -# vptest, however, uses SSE4 style (2 operand only) +# vptest uses SSE4 style (2 operand only), and takes 256-bit operands add_insn("vptest", "sse4", modifiers=[0x17, VEXL0], avx=True) add_group("sse4imm_256", @@ -5910,7 +5906,7 @@ add_group("avx_sse4imm", vex=128, prefix=0x66, opcode=[0x0F, 0x3A, 0x00], - operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) add_group("avx_sse4imm", @@ -5941,7 +5937,7 @@ add_group("vmovddup", vex=128, prefix=0x00, opcode=[0x0F, 0x00], - operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), Operand(type="SIMDReg", size=128, dest="EA")]) add_group("vmovddup", cpu=["AVX"], @@ -5949,7 +5945,7 @@ add_group("vmovddup", vex=128, prefix=0x00, opcode=[0x0F, 0x00], - operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), Operand(type="Mem", size=64, relaxed=True, dest="EA")]) add_group("vmovddup", cpu=["AVX"], @@ -5962,6 +5958,50 @@ add_group("vmovddup", add_insn("vmovddup", "vmovddup", modifiers=[0xF2, 0x12]) +# Some xmm_xmm64 combinations only take two operands in AVX +# (VEX.vvvv must be 1111b) +add_group("avx_xmm_xmm64", + cpu=["SSE2"], + modifiers=["PreAdd", "Op1Add"], + vex=128, + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA")]) +add_group("avx_xmm_xmm64", + cpu=["SSE2"], + modifiers=["PreAdd", "Op1Add"], + vex=128, + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Mem", size=64, relaxed=True, dest="EA")]) + +add_insn("vcomisd", "avx_xmm_xmm64", modifiers=[0x66, 0x2F], avx=True) +add_insn("vucomisd", "avx_xmm_xmm64", modifiers=[0x66, 0x2E], avx=True) + +# Some xmm_xmm64 combinations only take two operands in AVX +# (VEX.vvvv must be 1111b) +add_group("avx_xmm_xmm32", + cpu=["SSE"], + modifiers=["PreAdd", "Op1Add"], + vex=128, + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA")]) +add_group("avx_xmm_xmm32", + cpu=["SSE"], + modifiers=["PreAdd", "Op1Add"], + vex=128, + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Mem", size=32, relaxed=True, dest="EA")]) + +add_insn("vcomiss", "avx_xmm_xmm32", modifiers=[0, 0x2F], avx=True) +add_insn("vucomiss", "avx_xmm_xmm32", modifiers=[0, 0x2E], avx=True) + # Some conversion functions take ymm, xmm combination add_group("avx_cvt_xmm64", cpu=["AVX"], @@ -5991,6 +6031,22 @@ add_group("avx_cvt_xmm64", add_insn("vcvtdq2pd", "avx_cvt_xmm64", modifiers=[0xF3, 0xE6]) add_insn("vcvtps2pd", "avx_cvt_xmm64", modifiers=[0, 0x5A]) +# Some SSE3 opcodes are only two operand in AVX +# (VEX.vvvv must be 1111b) +add_group("avx_ssse3_2op", + cpu=["AVX"], + modifiers=["Op2Add"], + vex=128, + prefix=0x66, + opcode=[0x0F, 0x38, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) + +add_insn("vpabsb", "avx_ssse3_2op", modifiers=[0x1C], avx=True) +add_insn("vpabsw", "avx_ssse3_2op", modifiers=[0x1D], avx=True) +add_insn("vpabsd", "avx_ssse3_2op", modifiers=[0x1E], avx=True) +add_insn("vphminposuw", "avx_ssse3_2op", modifiers=[0x41], avx=True) + # Some conversion functions take xmm, ymm combination # Need separate x and y versions for gas mode add_group("avx_cvt_xmm128_x", diff --git a/modules/arch/x86/tests/avx.hex b/modules/arch/x86/tests/avx.hex index 39d5c839..f0fb5631 100644 --- a/modules/arch/x86/tests/avx.hex +++ b/modules/arch/x86/tests/avx.hex @@ -1049,15 +1049,15 @@ ca 2f 08 c5 -f1 +f9 2f ca c5 -f1 +f9 2f 08 c5 -f1 +f9 2f 08 0f @@ -1070,15 +1070,15 @@ ca 2f 08 c5 -f0 +f8 2f ca c5 -f0 +f8 2f 08 c5 -f0 +f8 2f 08 f3 @@ -3081,15 +3081,15 @@ f2 12 08 c5 -f3 +fb 12 ca c5 -f3 +fb 12 08 c5 -f3 +fb 12 08 c5 @@ -4120,17 +4120,17 @@ ca 08 c4 e2 -71 +79 1c ca c4 e2 -71 +79 1c 08 c4 e2 -71 +79 1c 08 66 @@ -4150,17 +4150,17 @@ ca 08 c4 e2 -71 +79 1d ca c4 e2 -71 +79 1d 08 c4 e2 -71 +79 1d 08 66 @@ -4180,17 +4180,17 @@ ca 08 c4 e2 -71 +79 1e ca c4 e2 -71 +79 1e 08 c4 e2 -71 +79 1e 08 66 @@ -6024,17 +6024,17 @@ ca 08 c4 e2 -71 +79 41 ca c4 e2 -71 +79 41 08 c4 e2 -71 +79 41 08 66 @@ -9465,19 +9465,19 @@ ca 05 c4 e3 -71 +79 09 ca 05 c4 e3 -71 +79 09 08 05 c4 e3 -71 +79 09 08 05 @@ -9519,19 +9519,19 @@ ca 05 c4 e3 -71 +79 08 ca 05 c4 e3 -71 +79 08 08 05 c4 e3 -71 +79 08 08 05 @@ -10111,15 +10111,15 @@ ca 2e 08 c5 -f1 +f9 2e ca c5 -f1 +f9 2e 08 c5 -f1 +f9 2e 08 0f @@ -10132,15 +10132,15 @@ ca 2e 08 c5 -f0 +f8 2e ca c5 -f0 +f8 2e 08 c5 -f0 +f8 2e 08 66 From bf5716cbd7d9558eb298a3f07a1aa2ec7a4bc1db Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 22 Apr 2008 05:41:11 +0000 Subject: [PATCH 169/585] Fix register fields on FMA instructions. The FMA instructions swap VEX.vvvv and imm8[7:4] as compared to other AVX instructions. Reported by: nasm64developer@users.sf.net svn path=/trunk/yasm/; revision=2071 --- modules/arch/x86/gen_x86_insn.py | 22 +- modules/arch/x86/tests/fma.hex | 360 +++++++++++++++---------------- 2 files changed, 191 insertions(+), 191 deletions(-) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index ef19a408..e52ca641 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -6374,9 +6374,9 @@ add_group("fma_128_256", prefix=0x66, opcode=[0x0F, 0x3A, 0x00], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDReg", size=128, dest="VEXImmSrc"), Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), - Operand(type="SIMDReg", size=128, dest="VEXImmSrc")]) + Operand(type="SIMDReg", size=128, dest="VEX")]) add_group("fma_128_256", cpu=["FMA"], modifiers=["Op2Add"], @@ -6385,8 +6385,8 @@ add_group("fma_128_256", prefix=0x66, opcode=[0x0F, 0x3A, 0x00], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDReg", size=128, dest="VEX"), Operand(type="SIMDReg", size=128, dest="VEXImmSrc"), + Operand(type="SIMDReg", size=128, dest="VEX"), Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) add_group("fma_128_256", cpu=["FMA"], @@ -6396,9 +6396,9 @@ add_group("fma_128_256", prefix=0x66, opcode=[0x0F, 0x3A, 0x00], operands=[Operand(type="SIMDReg", size=256, dest="Spare"), - Operand(type="SIMDReg", size=256, dest="VEX"), + Operand(type="SIMDReg", size=256, dest="VEXImmSrc"), Operand(type="SIMDRM", size=256, relaxed=True, dest="EA"), - Operand(type="SIMDReg", size=256, dest="VEXImmSrc")]) + Operand(type="SIMDReg", size=256, dest="VEX")]) add_group("fma_128_256", cpu=["FMA"], modifiers=["Op2Add"], @@ -6407,8 +6407,8 @@ add_group("fma_128_256", prefix=0x66, opcode=[0x0F, 0x3A, 0x00], operands=[Operand(type="SIMDReg", size=256, dest="Spare"), - Operand(type="SIMDReg", size=256, dest="VEX"), Operand(type="SIMDReg", size=256, dest="VEXImmSrc"), + Operand(type="SIMDReg", size=256, dest="VEX"), Operand(type="SIMDRM", size=256, relaxed=True, dest="EA")]) add_insn("vfmaddpd", "fma_128_256", modifiers=[0x69]) @@ -6433,9 +6433,9 @@ for sz in [32, 64]: prefix=0x66, opcode=[0x0F, 0x3A, 0x00], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDReg", size=128, dest="VEXImmSrc"), Operand(type="SIMDReg", size=128, dest="EA"), - Operand(type="SIMDReg", size=128, dest="VEXImmSrc")]) + Operand(type="SIMDReg", size=128, dest="VEX")]) add_group("fma_128_m%d" % sz, cpu=["FMA"], modifiers=["Op2Add"], @@ -6444,9 +6444,9 @@ for sz in [32, 64]: prefix=0x66, opcode=[0x0F, 0x3A, 0x00], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDReg", size=128, dest="VEXImmSrc"), Operand(type="Mem", size=sz, relaxed=True, dest="EA"), - Operand(type="SIMDReg", size=128, dest="VEXImmSrc")]) + Operand(type="SIMDReg", size=128, dest="VEX")]) add_group("fma_128_m%d" % sz, cpu=["FMA"], modifiers=["Op2Add"], @@ -6455,8 +6455,8 @@ for sz in [32, 64]: prefix=0x66, opcode=[0x0F, 0x3A, 0x00], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDReg", size=128, dest="VEX"), Operand(type="SIMDReg", size=128, dest="VEXImmSrc"), + Operand(type="SIMDReg", size=128, dest="VEX"), Operand(type="Mem", size=sz, relaxed=True, dest="EA")]) add_insn("vfmaddsd", "fma_128_m64", modifiers=[0x6B]) diff --git a/modules/arch/x86/tests/fma.hex b/modules/arch/x86/tests/fma.hex index a1193179..7f51092a 100644 --- a/modules/arch/x86/tests/fma.hex +++ b/modules/arch/x86/tests/fma.hex @@ -1,540 +1,540 @@ c4 e3 -71 +61 69 c2 -30 +10 c4 e3 -71 +61 69 00 -30 +10 c4 e3 -71 +61 69 00 -30 +10 c4 e3 -f1 +e9 69 00 -20 +10 c4 e3 -f1 +e9 69 00 -20 +10 c4 e3 -75 +65 69 c2 -30 +10 c4 e3 -75 +65 69 00 -30 +10 c4 e3 -75 +65 69 00 -30 +10 c4 e3 -f5 +ed 69 00 -20 +10 c4 e3 -f5 +ed 69 00 -20 +10 c4 e3 -71 +61 68 c2 -30 +10 c4 e3 -71 +61 68 00 -30 +10 c4 e3 -f1 +e9 68 00 -20 +10 c4 e3 -75 +65 68 c2 -30 +10 c4 e3 -75 +65 68 00 -30 +10 c4 e3 -f5 +ed 68 00 -20 +10 c4 e3 -71 +61 6b c2 -30 +10 c4 e3 -71 +61 6b 00 -30 +10 c4 e3 -71 +61 6b 00 -30 +10 c4 e3 -f1 +e9 6b 00 -20 +10 c4 e3 -f1 +e9 6b 00 -20 +10 c4 e3 -71 +61 6a c2 -30 +10 c4 e3 -71 +61 6a 00 -30 +10 c4 e3 -f1 +e9 6a 00 -20 +10 c4 e3 -71 +61 5d c2 -30 +10 c4 e3 -71 +61 5d 00 -30 +10 c4 e3 -f1 +e9 5d 00 -20 +10 c4 e3 -75 +65 5d c2 -30 +10 c4 e3 -75 +65 5d 00 -30 +10 c4 e3 -f5 +ed 5d 00 -20 +10 c4 e3 -71 +61 5c c2 -30 +10 c4 e3 -71 +61 5c 00 -30 +10 c4 e3 -f1 +e9 5c 00 -20 +10 c4 e3 -75 +65 5c c2 -30 +10 c4 e3 -75 +65 5c 00 -30 +10 c4 e3 -f5 +ed 5c 00 -20 +10 c4 e3 -71 +61 6d c2 -30 +10 c4 e3 -71 +61 6d 00 -30 +10 c4 e3 -f1 +e9 6d 00 -20 +10 c4 e3 -75 +65 6d c2 -30 +10 c4 e3 -75 +65 6d 00 -30 +10 c4 e3 -f5 +ed 6d 00 -20 +10 c4 e3 -71 +61 6c c2 -30 +10 c4 e3 -71 +61 6c 00 -30 +10 c4 e3 -f1 +e9 6c 00 -20 +10 c4 e3 -75 +65 6c c2 -30 +10 c4 e3 -75 +65 6c 00 -30 +10 c4 e3 -f5 +ed 6c 00 -20 +10 c4 e3 -71 +61 6f c2 -30 +10 c4 e3 -71 +61 6f 00 -30 +10 c4 e3 -f1 +e9 6f 00 -20 +10 c4 e3 -71 +61 6e c2 -30 +10 c4 e3 -71 +61 6e 00 -30 +10 c4 e3 -f1 +e9 6e 00 -20 +10 c4 e3 -71 +61 79 c2 -30 +10 c4 e3 -71 +61 79 00 -30 +10 c4 e3 -f1 +e9 79 00 -20 +10 c4 e3 -75 +65 79 c2 -30 +10 c4 e3 -75 +65 79 00 -30 +10 c4 e3 -f5 +ed 79 00 -20 +10 c4 e3 -71 +61 78 c2 -30 +10 c4 e3 -71 +61 78 00 -30 +10 c4 e3 -f1 +e9 78 00 -20 +10 c4 e3 -75 +65 78 c2 -30 +10 c4 e3 -75 +65 78 00 -30 +10 c4 e3 -f5 +ed 78 00 -20 +10 c4 e3 -71 +61 7b c2 -30 +10 c4 e3 -71 +61 7b 00 -30 +10 c4 e3 -f1 +e9 7b 00 -20 +10 c4 e3 -71 +61 7a c2 -30 +10 c4 e3 -71 +61 7a 00 -30 +10 c4 e3 -f1 +e9 7a 00 -20 +10 c4 e3 -71 +61 7d c2 -30 +10 c4 e3 -71 +61 7d 00 -30 +10 c4 e3 -f1 +e9 7d 00 -20 +10 c4 e3 -75 +65 7d c2 -30 +10 c4 e3 -75 +65 7d 00 -30 +10 c4 e3 -f5 +ed 7d 00 -20 +10 c4 e3 -71 +61 7c c2 -30 +10 c4 e3 -71 +61 7c 00 -30 +10 c4 e3 -f1 +e9 7c 00 -20 +10 c4 e3 -75 +65 7c c2 -30 +10 c4 e3 -75 +65 7c 00 -30 +10 c4 e3 -f5 +ed 7c 00 -20 +10 c4 e3 -71 +61 7f c2 -30 +10 c4 e3 -71 +61 7f 00 -30 +10 c4 e3 -f1 +e9 7f 00 -20 +10 c4 e3 -71 +61 7e c2 -30 +10 c4 e3 -71 +61 7e 00 -30 +10 c4 e3 -f1 +e9 7e 00 -20 +10 From 0423a89a790af79f4eb0063416ce5c9a139bc168 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 25 Apr 2008 01:58:59 +0000 Subject: [PATCH 170/585] Fix some re2c memory/initialization issues. Found by: valgrind svn path=/trunk/yasm/; revision=2072 --- tools/re2c/dfa.c | 4 ++++ tools/re2c/scanner.c | 2 +- tools/re2c/scanner.re | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/re2c/dfa.c b/tools/re2c/dfa.c index e54deecc..16509de2 100644 --- a/tools/re2c/dfa.c +++ b/tools/re2c/dfa.c @@ -76,10 +76,14 @@ State * State_new(void) { State *s = malloc(sizeof(State)); + s->label = 0; s->rule = NULL; + s->next = NULL; s->link = NULL; + s->depth = 0; s->kCount = 0; s->kernel = NULL; + s->isBase = 0; s->action = NULL; s->go.nSpans = 0; s->go.span = NULL; diff --git a/tools/re2c/scanner.c b/tools/re2c/scanner.c index 4640ee4a..034c935b 100644 --- a/tools/re2c/scanner.c +++ b/tools/re2c/scanner.c @@ -48,7 +48,7 @@ fill(Scanner *s, unsigned char *cursor) s->lim -= cnt; } if((s->top - s->lim) < BSIZE){ - unsigned char *buf = malloc(((s->lim - s->bot) + BSIZE)); + unsigned char *buf = malloc(((s->lim - s->bot) + BSIZE) + 1); memcpy(buf, s->tok, s->lim - s->tok); s->tok = buf; s->ptr = &buf[s->ptr - s->bot]; diff --git a/tools/re2c/scanner.re b/tools/re2c/scanner.re index 10af0883..423835b6 100644 --- a/tools/re2c/scanner.re +++ b/tools/re2c/scanner.re @@ -45,7 +45,7 @@ fill(Scanner *s, unsigned char *cursor) s->lim -= cnt; } if((s->top - s->lim) < BSIZE){ - unsigned char *buf = malloc(((s->lim - s->bot) + BSIZE)); + unsigned char *buf = malloc(((s->lim - s->bot) + BSIZE) + 1); memcpy(buf, s->tok, s->lim - s->tok); s->tok = buf; s->ptr = &buf[s->ptr - s->bot]; From 1fd4e2ff761f6dee8c5223a5bb041f23db486b64 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 25 Apr 2008 04:58:11 +0000 Subject: [PATCH 171/585] Fix two instances of VERMIL2PS/PD incorrectly setting VEX.L=1. Reported by: nasm64developer@users.sf.net svn path=/trunk/yasm/; revision=2074 --- modules/arch/x86/gen_x86_insn.py | 4 ++-- modules/arch/x86/tests/avx.hex | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index e52ca641..5069d22c 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -6263,7 +6263,7 @@ add_group("vpermil2", add_group("vpermil2", cpu=["AVX"], modifiers=["Op2Add"], - vex=256, + vex=128, vexw=1, prefix=0x66, opcode=[0x0F, 0x3A, 0x00], @@ -6315,7 +6315,7 @@ add_group("vpermil2_fixed", add_group("vpermil2_fixed", cpu=["AVX"], modifiers=["Op2Add", "Imm8"], - vex=256, + vex=128, vexw=1, prefix=0x66, opcode=[0x0F, 0x3A, 0x00], diff --git a/modules/arch/x86/tests/avx.hex b/modules/arch/x86/tests/avx.hex index f0fb5631..1a73e386 100644 --- a/modules/arch/x86/tests/avx.hex +++ b/modules/arch/x86/tests/avx.hex @@ -5458,13 +5458,13 @@ e3 45 c4 e3 -ed +e9 49 08 35 c4 e3 -ed +e9 49 08 35 @@ -5572,13 +5572,13 @@ e3 45 c4 e3 -ed +e9 48 08 35 c4 e3 -ed +e9 48 08 35 From ca23bda1cf4a5efa579d7ecbc7b909d789992615 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 25 Apr 2008 05:07:57 +0000 Subject: [PATCH 172/585] Defensively look for NULL istk. svn path=/trunk/yasm/; revision=2075 --- modules/preprocs/nasm/nasm-pp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/preprocs/nasm/nasm-pp.c b/modules/preprocs/nasm/nasm-pp.c index 604bb2bc..2bb94b04 100644 --- a/modules/preprocs/nasm/nasm-pp.c +++ b/modules/preprocs/nasm/nasm-pp.c @@ -4237,6 +4237,8 @@ pp_getline(void) * buffer or from the input file. */ tline = NULL; + if (!istk) + return NULL; while (istk->expansion && istk->expansion->finishes) { Line *l = istk->expansion; From 7b190b80fb87dca29fc026f05fb25d1eb69b18f3 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 25 Apr 2008 06:50:36 +0000 Subject: [PATCH 173/585] Support use of NASM preprocessor with GAS parser. Note: this combination is obviously not supported by any other assembler. Requested by: Brian Gladman svn path=/trunk/yasm/; revision=2076 --- modules/parsers/gas/gas-parse.c | 115 +++++++++++++++++++++++++++---- modules/parsers/gas/gas-parser.c | 6 ++ modules/parsers/gas/gas-parser.h | 9 ++- modules/parsers/gas/gas-token.re | 45 +++++++++++- 4 files changed, 156 insertions(+), 19 deletions(-) diff --git a/modules/parsers/gas/gas-parse.c b/modules/parsers/gas/gas-parse.c index 583e39e0..1873521a 100644 --- a/modules/parsers/gas/gas-parse.c +++ b/modules/parsers/gas/gas-parse.c @@ -44,7 +44,8 @@ typedef struct dir_lookup { enum gas_parser_state newstate; } dir_lookup; -static yasm_bytecode * cpp_line_marker(yasm_parser_gas *parser_gas); +static void cpp_line_marker(yasm_parser_gas *parser_gas); +static void nasm_line_marker(yasm_parser_gas *parser_gas); static yasm_bytecode *parse_instr(yasm_parser_gas *parser_gas); static int parse_dirvals(yasm_parser_gas *parser_gas, yasm_valparamhead *vps); static int parse_datavals(yasm_parser_gas *parser_gas, yasm_datavalhead *dvs); @@ -248,9 +249,14 @@ parse_line(yasm_parser_gas *parser_gas) define_label(parser_gas, LABEL_val, 0); get_next_token(); /* LABEL */ return parse_line(parser_gas); - case LINE_MARKER: + case CPP_LINE_MARKER: get_next_token(); - return cpp_line_marker(parser_gas); + cpp_line_marker(parser_gas); + return NULL; + case NASM_LINE_MARKER: + get_next_token(); + nasm_line_marker(parser_gas); + return NULL; default: yasm_error_set(YASM_ERROR_SYNTAX, N_("label or instruction expected at start of line")); @@ -268,10 +274,10 @@ parse_line(yasm_parser_gas *parser_gas) without adding a filter to the input before passing it to cpp. This function is only called if the preprocessor was 'cpp', since the - LINE_MARKER token isn't generated for any other preprocessor. With any other - preprocessor, anything after a '#' is always treated as a comment. + CPP_LINE_MARKER token isn't generated for any other preprocessor. With any + other preprocessor, anything after a '#' is always treated as a comment. */ -static yasm_bytecode * +static void cpp_line_marker(yasm_parser_gas *parser_gas) { yasm_valparamhead vps; @@ -285,14 +291,14 @@ cpp_line_marker(yasm_parser_gas *parser_gas) while (curtok != '\n') get_next_token(); - return NULL; + return; } if (yasm_intnum_sign(INTNUM_val) < 0) { get_next_token(); /* INTNUM */ yasm_error_set(YASM_ERROR_SYNTAX, N_("line number is negative")); - return NULL; + return; } line = yasm_intnum_get_uint(INTNUM_val); @@ -315,7 +321,7 @@ cpp_line_marker(yasm_parser_gas *parser_gas) while (curtok != '\n') get_next_token(); - return NULL; + return; } filename = STRING_val.contents; @@ -339,7 +345,8 @@ cpp_line_marker(yasm_parser_gas *parser_gas) yasm_object_directive(p_object, ".file", "gas", &vps, NULL, cur_line); yasm_vps_delete(&vps); - } + } else + yasm_xfree(filename); /* Skip flags. */ while (1) { @@ -348,18 +355,98 @@ cpp_line_marker(yasm_parser_gas *parser_gas) break; case '\n': - return NULL; + return; default: yasm_error_set(YASM_ERROR_SYNTAX, N_("junk at end of cpp line marker")); - return NULL; + return; } get_next_token(); } +} - /* Never reached. */ - return NULL; +/* + Handle line markers generated by the nasm preproc. + + We expect a positive integer (line) followed by a plus sign, followed by + another positive integer, followed by a string (filename). + + This function is only called if the preprocessor was 'nasm', since the + NASM_LINE_MARKER token isn't generated for any other preprocessor. +*/ +static void +nasm_line_marker(yasm_parser_gas *parser_gas) +{ + yasm_valparamhead vps; + yasm_valparam *vp; + unsigned long line, incr; + char *filename; + + /* Line number. */ + if (!expect(INTNUM)) return; + + if (yasm_intnum_sign(INTNUM_val) < 0) { + get_next_token(); /* INTNUM */ + yasm_error_set(YASM_ERROR_SYNTAX, + N_("line number is negative")); + return; + } + + line = yasm_intnum_get_uint(INTNUM_val); + + yasm_intnum_destroy(INTNUM_val); + get_next_token(); /* INTNUM */ + + if (!expect('+')) return; + get_next_token(); /* + */ + + /* Line number increment. */ + if (!expect(INTNUM)) return; + + if (yasm_intnum_sign(INTNUM_val) < 0) { + get_next_token(); /* INTNUM */ + yasm_error_set(YASM_ERROR_SYNTAX, + N_("line increment is negative")); + return; + } + + incr = yasm_intnum_get_uint(INTNUM_val); + yasm_intnum_destroy(INTNUM_val); + + /* File name is not in quotes, so need to switch to a different tokenizer + * state. + */ + parser_gas->state = NASM_FILENAME; + get_next_token(); /* INTNUM */ + if (!expect(STRING)) { + parser_gas->state = INITIAL; + return; + } + + filename = STRING_val.contents; + get_next_token(); /* STRING */ + + /* Set linemap. */ + yasm_linemap_set(parser_gas->linemap, filename, line, incr); + + /* + The first line marker in the file (which should be on the first line + of the file) will give us the name of the source file. This information + needs to be passed on to the debug format module. + */ + if (parser_gas->seen_line_marker == 0) { + parser_gas->seen_line_marker = 1; + + yasm_vps_initialize(&vps); + vp = yasm_vp_create_string(NULL, filename); + yasm_vps_append(&vps, vp); + + yasm_object_directive(p_object, ".file", "gas", &vps, NULL, cur_line); + + yasm_vps_delete(&vps); + } else + yasm_xfree(filename); } /* Line directive */ diff --git a/modules/parsers/gas/gas-parser.c b/modules/parsers/gas/gas-parser.c index 80bd5039..1e7fb8b6 100644 --- a/modules/parsers/gas/gas-parser.c +++ b/modules/parsers/gas/gas-parser.c @@ -76,6 +76,11 @@ gas_parser_do_parse(yasm_object *object, yasm_preproc *pp, for (i=0; i<10; i++) parser_gas.local[i] = 0; + parser_gas.is_cpp_preproc = + yasm__strcasecmp(((yasm_preproc_base*)pp)->module->keyword, "cpp") == 0; + parser_gas.is_nasm_preproc = + yasm__strcasecmp(((yasm_preproc_base*)pp)->module->keyword, "nasm") == 0; + /* yacc debugging, needs YYDEBUG set in bison.y.in to work */ parser_gas.debug = 1; @@ -114,6 +119,7 @@ gas_parser_do_parse(yasm_object *object, yasm_preproc *pp, static const char *gas_parser_preproc_keywords[] = { "raw", "cpp", + "nasm", NULL }; diff --git a/modules/parsers/gas/gas-parser.h b/modules/parsers/gas/gas-parser.h index 0a22e3e4..70704b53 100644 --- a/modules/parsers/gas/gas-parser.h +++ b/modules/parsers/gas/gas-parser.h @@ -48,7 +48,8 @@ enum tokentype { RIGHT_OP, ID, LABEL, - LINE_MARKER, + CPP_LINE_MARKER, + NASM_LINE_MARKER, NONE }; @@ -90,7 +91,8 @@ enum gas_parser_state { INITIAL, COMMENT, SECTION_DIRECTIVE, - INSTDIR + INSTDIR, + NASM_FILENAME }; typedef struct yasm_parser_gas { @@ -147,6 +149,9 @@ typedef struct yasm_parser_gas { /* Parser-handled directives HAMT lookup */ HAMT *dirs; + + int is_nasm_preproc; + int is_cpp_preproc; } yasm_parser_gas; /* shorter access names to commonly used parser_gas fields */ diff --git a/modules/parsers/gas/gas-token.re b/modules/parsers/gas/gas-token.re index c72ce901..c08da11a 100644 --- a/modules/parsers/gas/gas-token.re +++ b/modules/parsers/gas/gas-token.re @@ -302,6 +302,8 @@ gas_parser_lex(YYSTYPE *lvalp, yasm_parser_gas *parser_gas) goto comment; case SECTION_DIRECTIVE: goto section_directive; + case NASM_FILENAME: + goto nasm_filename; default: break; } @@ -387,6 +389,11 @@ scan: [%][a-zA-Z0-9]+ { savech = s->tok[TOKLEN]; s->tok[TOKLEN] = '\0'; + if (parser_gas->is_nasm_preproc && strcmp(TOK+1, "line") == 0) { + s->tok[TOKLEN] = savech; + RETURN(NASM_LINE_MARKER); + } + switch (yasm_arch_parse_check_regtmod (p_object->arch, TOK+1, TOKLEN-1, &lvalp->arch_data)) { case YASM_ARCH_REG: @@ -482,10 +489,9 @@ scan: "/*" { parser_gas->state = COMMENT; goto comment; } "#" { - if (strcmp(((yasm_preproc_base*)parser_gas->preproc)->module->keyword, - "cpp") == 0) + if (parser_gas->is_cpp_preproc) { - RETURN(LINE_MARKER); + RETURN(CPP_LINE_MARKER); } else goto line_comment; } @@ -569,6 +575,39 @@ section_directive: } */ + /* filename portion of nasm preproc %line */ +nasm_filename: + strbuf = yasm_xmalloc(STRBUF_ALLOC_SIZE); + strbuf_size = STRBUF_ALLOC_SIZE; + count = 0; + +nasm_filename_scan: + SCANINIT(); + + /*!re2c + "\n" { + strbuf_append(count++, cursor, s, '\0'); + lvalp->str.contents = (char *)strbuf; + lvalp->str.len = count; + parser_gas->state = INITIAL; + RETURN(STRING); + } + + ws+ { goto nasm_filename_scan; } + + any { + if (cursor == s->eof) { + strbuf_append(count++, cursor, s, '\0'); + lvalp->str.contents = (char *)strbuf; + lvalp->str.len = count; + parser_gas->state = INITIAL; + RETURN(STRING); + } + strbuf_append(count++, cursor, s, s->tok[0]); + goto nasm_filename_scan; + } + */ + /* character constant values */ charconst: /*TODO*/ From a4c7d7b85c14349851eafdacb981032576d4e902 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 29 Apr 2008 02:24:02 +0000 Subject: [PATCH 174/585] Fix #137: LAR and LSL should only need 286+Prot CPU flags, not 386. svn path=/trunk/yasm/; revision=2077 --- modules/arch/x86/gen_x86_insn.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index 5069d22c..b45dd3ad 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -2823,15 +2823,14 @@ add_insn("btc", "bittest", modifiers=[0xBB, 7]) for sfx, sz in zip("wlq", [16, 32, 64]): add_group("bsfr", suffix=sfx, - cpu=["386"], modifiers=["Op1Add"], opersize=sz, opcode=[0x0F, 0x00], operands=[Operand(type="Reg", size=sz, dest="Spare"), Operand(type="RM", size=sz, relaxed=True, dest="EA")]) -add_insn("bsf", "bsfr", modifiers=[0xBC]) -add_insn("bsr", "bsfr", modifiers=[0xBD]) +add_insn("bsf", "bsfr", modifiers=[0xBC], cpu=["386"]) +add_insn("bsr", "bsfr", modifiers=[0xBD], cpu=["386"]) ##################################################################### # Interrupts and operating system instructions From 5bdb018c95c3b6db229393b68c5fcf5cab385272 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 29 Apr 2008 05:11:52 +0000 Subject: [PATCH 175/585] Fix GAS handling of NASM preproc %line. Reported by: Brian Gladman svn path=/trunk/yasm/; revision=2078 --- modules/parsers/gas/gas-parse.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/parsers/gas/gas-parse.c b/modules/parsers/gas/gas-parse.c index 1873521a..a0e09156 100644 --- a/modules/parsers/gas/gas-parse.c +++ b/modules/parsers/gas/gas-parse.c @@ -395,6 +395,15 @@ nasm_line_marker(yasm_parser_gas *parser_gas) line = yasm_intnum_get_uint(INTNUM_val); + /* + Set to (line - 1) since the directive indicates that the *next* line + will have the number given. + + cpp should never produce line=0, but the if keeps us safe just incase. + */ + if (line != 0) + line--; + yasm_intnum_destroy(INTNUM_val); get_next_token(); /* INTNUM */ @@ -425,7 +434,6 @@ nasm_line_marker(yasm_parser_gas *parser_gas) } filename = STRING_val.contents; - get_next_token(); /* STRING */ /* Set linemap. */ yasm_linemap_set(parser_gas->linemap, filename, line, incr); @@ -447,6 +455,10 @@ nasm_line_marker(yasm_parser_gas *parser_gas) yasm_vps_delete(&vps); } else yasm_xfree(filename); + + /* We need to poke back on the \n that was consumed by the tokenizer */ + parser_gas->peek_token = '\n'; + get_next_token(); } /* Line directive */ From 3e6d218d3bfe8a79d82bb81420dd66815b87b713 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 29 Apr 2008 06:06:20 +0000 Subject: [PATCH 176/585] Enable GAS versions of the win32/win64 safe exception handling directives. svn path=/trunk/yasm/; revision=2079 --- modules/objfmts/coff/coff-objfmt.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/objfmts/coff/coff-objfmt.c b/modules/objfmts/coff/coff-objfmt.c index 300b3769..22ecac45 100644 --- a/modules/objfmts/coff/coff-objfmt.c +++ b/modules/objfmts/coff/coff-objfmt.c @@ -2210,9 +2210,10 @@ static const char *winXX_objfmt_dbgfmt_keywords[] = { static const yasm_directive win32_objfmt_directives[] = { { ".ident", "gas", dir_ident, YASM_DIR_ANY }, - { ".export", "gas", dir_export, YASM_DIR_ID_REQUIRED }, { "ident", "nasm", dir_ident, YASM_DIR_ANY }, + { ".export", "gas", dir_export, YASM_DIR_ID_REQUIRED }, { "export", "nasm", dir_export, YASM_DIR_ID_REQUIRED }, + { ".safeseh", "gas", dir_safeseh, YASM_DIR_ID_REQUIRED }, { "safeseh", "nasm", dir_safeseh, YASM_DIR_ID_REQUIRED }, { NULL, NULL, NULL, 0 } }; @@ -2239,14 +2240,23 @@ static const yasm_directive win64_objfmt_directives[] = { { "ident", "nasm", dir_ident, YASM_DIR_ANY }, { ".export", "gas", dir_export, YASM_DIR_ID_REQUIRED }, { "export", "nasm", dir_export, YASM_DIR_ID_REQUIRED }, + { ".proc_frame", "gas", dir_proc_frame, YASM_DIR_ID_REQUIRED }, { "proc_frame", "nasm", dir_proc_frame, YASM_DIR_ID_REQUIRED }, + { ".pushreg", "gas", dir_pushreg, YASM_DIR_ARG_REQUIRED }, { "pushreg", "nasm", dir_pushreg, YASM_DIR_ARG_REQUIRED }, + { ".setframe", "gas", dir_setframe, YASM_DIR_ARG_REQUIRED }, { "setframe", "nasm", dir_setframe, YASM_DIR_ARG_REQUIRED }, + { ".allocstack", "gas", dir_allocstack, YASM_DIR_ARG_REQUIRED }, { "allocstack", "nasm", dir_allocstack, YASM_DIR_ARG_REQUIRED }, + { ".savereg", "gas", dir_savereg, YASM_DIR_ARG_REQUIRED }, { "savereg", "nasm", dir_savereg, YASM_DIR_ARG_REQUIRED }, + { ".savexmm128", "gas", dir_savexmm128, YASM_DIR_ARG_REQUIRED }, { "savexmm128", "nasm", dir_savexmm128, YASM_DIR_ARG_REQUIRED }, + { ".pushframe", "gas", dir_pushframe, YASM_DIR_ANY }, { "pushframe", "nasm", dir_pushframe, YASM_DIR_ANY }, + { ".endprolog", "gas", dir_endprolog, YASM_DIR_ANY }, { "endprolog", "nasm", dir_endprolog, YASM_DIR_ANY }, + { ".endproc_frame", "gas", dir_endproc_frame, YASM_DIR_ANY }, { "endproc_frame", "nasm", dir_endproc_frame, YASM_DIR_ANY }, { NULL, NULL, NULL, 0 } }; From 44c098823fe3ebc40c276c7bb869430734221789 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 30 Apr 2008 04:40:29 +0000 Subject: [PATCH 177/585] Allow registering of new modules at runtime. svn path=/trunk/yasm/; revision=2080 --- libyasm/module.h | 3 ++ libyasm/module.in | 117 ++++++++++++++++++++++++++++++++-------------- 2 files changed, 84 insertions(+), 36 deletions(-) diff --git a/libyasm/module.h b/libyasm/module.h index f930800f..b6b4f60b 100644 --- a/libyasm/module.h +++ b/libyasm/module.h @@ -69,4 +69,7 @@ void yasm_list_modules #define yasm_list_preproc(func) \ yasm_list_modules(YASM_MODULE_PREPROC, func) +void yasm_register_module(yasm_module_type type, const char *keyword, + void *data); + #endif diff --git a/libyasm/module.in b/libyasm/module.in index 2a3fd571..ff1e399b 100644 --- a/libyasm/module.in +++ b/libyasm/module.in @@ -73,14 +73,33 @@ static struct { {preproc_modules, sizeof(preproc_modules)/sizeof(module)}, }; +typedef struct loaded_module { + yasm_module_type type; /* module type */ + const char *keyword; /* module keyword */ + void *data; /* associated data */ +} loaded_module; + +static loaded_module *loaded_modules = NULL; +static size_t num_loaded_modules = 0; + void * yasm_load_module(yasm_module_type type, const char *keyword) { size_t i; - module *modules = module_types[type].m; - size_t n = module_types[type].n; + module *modules; + size_t n; - /* Look for the module/symbol. */ + /* Look for the module/symbol, first in loaded modules */ + if (loaded_modules) { + for (i=0; iname, arch->keyword); - break; - case YASM_MODULE_DBGFMT: - dbgfmt = modules[i].data; - printfunc(dbgfmt->name, dbgfmt->keyword); - break; - case YASM_MODULE_OBJFMT: - objfmt = modules[i].data; - printfunc(objfmt->name, objfmt->keyword); - break; - case YASM_MODULE_LISTFMT: - listfmt = modules[i].data; - printfunc(listfmt->name, listfmt->keyword); - break; - case YASM_MODULE_PARSER: - parser = modules[i].data; - printfunc(parser->name, parser->keyword); - break; - case YASM_MODULE_PREPROC: - preproc = modules[i].data; - printfunc(preproc->name, preproc->keyword); - break; - } + switch (type) { + case YASM_MODULE_ARCH: + arch = data; + printfunc(arch->name, arch->keyword); + break; + case YASM_MODULE_DBGFMT: + dbgfmt = data; + printfunc(dbgfmt->name, dbgfmt->keyword); + break; + case YASM_MODULE_OBJFMT: + objfmt = data; + printfunc(objfmt->name, objfmt->keyword); + break; + case YASM_MODULE_LISTFMT: + listfmt = data; + printfunc(listfmt->name, listfmt->keyword); + break; + case YASM_MODULE_PARSER: + parser = data; + printfunc(parser->name, parser->keyword); + break; + case YASM_MODULE_PREPROC: + preproc = data; + printfunc(preproc->name, preproc->keyword); + break; } } + +void +yasm_list_modules(yasm_module_type type, + void (*printfunc) (const char *name, const char *keyword)) +{ + size_t i; + module *modules; + size_t n;; + + /* Go through available list, and try to load each one */ + if (loaded_modules) { + for (i=0; i Date: Fri, 9 May 2008 06:28:47 +0000 Subject: [PATCH 178/585] Allow registers as GAS directive parameters. This is required for the win64 SEH directives. svn path=/trunk/yasm/; revision=2081 --- modules/parsers/gas/gas-parse.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/parsers/gas/gas-parse.c b/modules/parsers/gas/gas-parse.c index a0e09156..de46afff 100644 --- a/modules/parsers/gas/gas-parse.c +++ b/modules/parsers/gas/gas-parse.c @@ -1027,6 +1027,11 @@ parse_dirvals(yasm_parser_gas *parser_gas, yasm_valparamhead *vps) vp = yasm_vp_create_string(NULL, STRING_val.contents); get_next_token(); /* STRING */ break; + case REG: + e = p_expr_new_ident(yasm_expr_reg(REG_val)); + vp = yasm_vp_create_expr(NULL, e); + get_next_token(); /* REG */ + break; case '@': /* XXX: is throwing it away *really* the right thing? */ get_next_token(); /* @ */ From cbf0c7befdecd2da9bf4f866c3b25bb0f6b173f0 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 9 May 2008 06:46:02 +0000 Subject: [PATCH 179/585] Split NASM preprocessor standard macro set between various modules. Standard macro sets are looked up based on parser and preprocessor keyword from individual modules. The "standard" NASM parser macros now reside in the NASM parser, so when the GAS parser is used with the NASM preprocessor, the NASM-specific macros are no longer defined. Object-format specific macros are now individually defined by each object formatm module. This allows for the object formats to be independent of the NASM preprocessor module and yields a small optimization benefit as unused object format macros don't need to be skipped over. Also add GAS macro equivalents for the Win64 SEH more complex directives [1]. [1] Requested by Brian Gladman svn path=/trunk/yasm/; revision=2082 --- frontends/yasm/yasm.c | 28 +- libyasm/coretype.h | 15 + libyasm/objfmt.h | 3 + libyasm/parser.h | 3 + libyasm/preproc.h | 16 + modules/objfmts/bin/bin-objfmt.c | 13 + modules/objfmts/coff/Makefile.inc | 16 + modules/objfmts/coff/coff-objfmt.c | 28 ++ modules/objfmts/coff/win64-gas.mac | 73 ++++ modules/objfmts/coff/win64-nasm.mac | 106 +++++ modules/objfmts/dbg/dbg-objfmt.c | 1 + modules/objfmts/elf/elf-objfmt.c | 21 + modules/objfmts/macho/macho-objfmt.c | 3 + modules/objfmts/rdf/rdf-objfmt.c | 16 + modules/objfmts/win64/tests/Makefile.inc | 4 + modules/objfmts/win64/tests/gas/Makefile.inc | 7 + .../objfmts/win64/tests/gas/win64-gas-sce.asm | 11 + .../objfmts/win64/tests/gas/win64-gas-sce.hex | 403 ++++++++++++++++++ .../objfmts/win64/tests/gas/win64_gas_test.sh | 4 + modules/objfmts/xdf/xdf-objfmt.c | 1 + modules/parsers/gas/gas-parser.c | 2 + modules/parsers/nasm/Makefile.inc | 12 +- modules/parsers/nasm/nasm-parser.c | 8 + modules/parsers/nasm/nasm-std.mac | 109 +++++ modules/preprocs/cpp/cpp-preproc.c | 9 +- modules/preprocs/nasm/Makefile.inc | 21 +- modules/preprocs/nasm/genmacro.c | 145 ------- modules/preprocs/nasm/genversion.c | 12 +- modules/preprocs/nasm/nasm-pp.c | 157 ++++--- modules/preprocs/nasm/nasm-preproc.c | 13 +- modules/preprocs/nasm/standard.mac | 293 ------------- .../preprocs/nasm/tests/nasmpp-nested.errwarn | 6 +- modules/preprocs/raw/raw-preproc.c | 9 +- modules/preprocs/yapp/yapp-preproc.c | 9 +- 34 files changed, 1026 insertions(+), 551 deletions(-) create mode 100644 modules/objfmts/coff/win64-gas.mac create mode 100644 modules/objfmts/coff/win64-nasm.mac create mode 100644 modules/objfmts/win64/tests/gas/Makefile.inc create mode 100644 modules/objfmts/win64/tests/gas/win64-gas-sce.asm create mode 100644 modules/objfmts/win64/tests/gas/win64-gas-sce.hex create mode 100755 modules/objfmts/win64/tests/gas/win64_gas_test.sh create mode 100644 modules/parsers/nasm/nasm-std.mac delete mode 100644 modules/preprocs/nasm/genmacro.c delete mode 100644 modules/preprocs/nasm/standard.mac diff --git a/frontends/yasm/yasm.c b/frontends/yasm/yasm.c index 8c24d285..b5f47080 100644 --- a/frontends/yasm/yasm.c +++ b/frontends/yasm/yasm.c @@ -120,6 +120,7 @@ static void print_yasm_warning(const char *filename, unsigned long line, const char *msg); static void apply_preproc_builtins(void); +static void apply_preproc_standard_macros(const yasm_stdmac *stdmacs); static void apply_preproc_saved_options(void); static void print_list_keyword_desc(const char *name, const char *keyword); @@ -264,13 +265,17 @@ do_preproc_only(void) return EXIT_FAILURE; } - /* Pre-process until done */ + /* Create preprocessor */ cur_preproc = yasm_preproc_create(cur_preproc_module, in_filename, NULL, linemap, errwarns); + /* Apply macros */ apply_preproc_builtins(); + apply_preproc_standard_macros(cur_parser_module->stdmacs); + apply_preproc_standard_macros(cur_objfmt_module->stdmacs); apply_preproc_saved_options(); + /* Pre-process until done */ if (generate_make_dependencies) { size_t totlen; @@ -429,6 +434,8 @@ do_assemble(void) object->symtab, linemap, errwarns); apply_preproc_builtins(); + apply_preproc_standard_macros(cur_parser_module->stdmacs); + apply_preproc_standard_macros(cur_objfmt_module->stdmacs); apply_preproc_saved_options(); /* Get initial x86 BITS setting from object format */ @@ -1125,6 +1132,25 @@ apply_preproc_builtins() yasm_xfree(predef); } +static void +apply_preproc_standard_macros(const yasm_stdmac *stdmacs) +{ + int i, matched; + + if (!stdmacs) + return; + + matched = -1; + for (i=0; stdmacs[i].parser; i++) + if (yasm__strcasecmp(stdmacs[i].parser, + cur_parser_module->keyword) == 0 && + yasm__strcasecmp(stdmacs[i].preproc, + cur_preproc_module->keyword) == 0) + matched = i; + if (matched >= 0 && stdmacs[matched].macros) + yasm_preproc_add_standard(cur_preproc, stdmacs[matched].macros); +} + static void apply_preproc_saved_options() { diff --git a/libyasm/coretype.h b/libyasm/coretype.h index 5c99816c..b23e3eae 100644 --- a/libyasm/coretype.h +++ b/libyasm/coretype.h @@ -52,6 +52,21 @@ typedef struct yasm_objfmt_module yasm_objfmt_module; /** Debug format module interface. \see dbgfmt.h for details. */ typedef struct yasm_dbgfmt_module yasm_dbgfmt_module; +/** Standard macro structure for modules that allows association of a set of + * standard macros with a parser/preprocessor combination. + * A NULL-terminated array of these structures is used in a number of module + * interfaces. + */ +typedef struct yasm_stdmac { + const char *parser; /**< Parser keyword */ + const char *preproc; /**< Preprocessor keyword */ + + /** NULL-terminated array of standard macros. May be NULL if no standard + * macros should be added for this preprocessor. + */ + const char **macros; +} yasm_stdmac; + /** YASM associated data callback structure. Many data structures can have * arbitrary data associated with them. */ diff --git a/libyasm/objfmt.h b/libyasm/objfmt.h index 0c40c4a3..c65e76c1 100644 --- a/libyasm/objfmt.h +++ b/libyasm/objfmt.h @@ -77,6 +77,9 @@ struct yasm_objfmt_module { /** NULL-terminated list of directives. NULL if none. */ /*@null@*/ const yasm_directive *directives; + /** NULL-terminated list of standard macro lookups. NULL if none. */ + const yasm_stdmac *stdmacs; + /** Create object format. * Module-level implementation of yasm_objfmt_create(). * Call yasm_objfmt_create() instead of calling this function. diff --git a/libyasm/parser.h b/libyasm/parser.h index fcbb20c4..26c347be 100644 --- a/libyasm/parser.h +++ b/libyasm/parser.h @@ -51,6 +51,9 @@ typedef struct yasm_parser_module { /** Default preprocessor. */ const char *default_preproc_keyword; + /** NULL-terminated list of standard macro lookups. NULL if none. */ + const yasm_stdmac *stdmacs; + /** Parse a source file into an object. * \param object object to parse into (already created) * \param pp preprocessor diff --git a/libyasm/preproc.h b/libyasm/preproc.h index fff40daa..0b8c54ff 100644 --- a/libyasm/preproc.h +++ b/libyasm/preproc.h @@ -105,6 +105,11 @@ typedef struct yasm_preproc_module { * Call yasm_preproc_builtin_define() instead of calling this function. */ void (*define_builtin) (yasm_preproc *preproc, const char *macronameval); + + /** Module-level implementation of yasm_preproc_add_standard(). + * Call yasm_preproc_add_standard() instead of calling this function. + */ + void (*add_standard) (yasm_preproc *preproc, const char **macros); } yasm_preproc_module; /** Initialize preprocessor. @@ -169,6 +174,14 @@ void yasm_preproc_undefine_macro(yasm_preproc *preproc, const char *macroname); void yasm_preproc_define_builtin(yasm_preproc *preproc, const char *macronameval); +/** Define additional standard macros, preprocessed after the builtins but + * prior to any user-defined macros. + * \param preproc preprocessor + * \param macros NULL-terminated array of macro strings + */ +void yasm_preproc_add_standard(yasm_preproc *preproc, + const char **macros); + #ifndef YASM_DOXYGEN /* Inline macro implementations for preproc functions */ @@ -192,6 +205,9 @@ void yasm_preproc_define_builtin(yasm_preproc *preproc, #define yasm_preproc_define_builtin(preproc, macronameval) \ ((yasm_preproc_base *)preproc)->module->define_builtin(preproc, \ macronameval) +#define yasm_preproc_add_standard(preproc, macros) \ + ((yasm_preproc_base *)preproc)->module->add_standard(preproc, \ + macros) #endif diff --git a/modules/objfmts/bin/bin-objfmt.c b/modules/objfmts/bin/bin-objfmt.c index e1080760..478502ec 100644 --- a/modules/objfmts/bin/bin-objfmt.c +++ b/modules/objfmts/bin/bin-objfmt.c @@ -1771,6 +1771,18 @@ static const yasm_directive bin_objfmt_directives[] = { { NULL, NULL, NULL, 0 } }; +static const char *bin_nasm_stdmac[] = { + "%imacro org 1+.nolist", + "[org %1]", + "%endmacro", + NULL +}; + +static const yasm_stdmac bin_objfmt_stdmacs[] = { + { "nasm", "nasm", bin_nasm_stdmac }, + { NULL, NULL, NULL } +}; + /* Define objfmt structure -- see objfmt.h for details */ yasm_objfmt_module yasm_bin_LTX_objfmt = { "Flat format binary", @@ -1780,6 +1792,7 @@ yasm_objfmt_module yasm_bin_LTX_objfmt = { bin_objfmt_dbgfmt_keywords, "null", bin_objfmt_directives, + bin_objfmt_stdmacs, bin_objfmt_create, bin_objfmt_output, bin_objfmt_destroy, diff --git a/modules/objfmts/coff/Makefile.inc b/modules/objfmts/coff/Makefile.inc index 526f7713..e9e8576d 100644 --- a/modules/objfmts/coff/Makefile.inc +++ b/modules/objfmts/coff/Makefile.inc @@ -6,6 +6,22 @@ libyasm_a_SOURCES += modules/objfmts/coff/win64-except.c YASM_MODULES += objfmt_coff +$(top_srcdir)/modules/objfmts/coff/coff-objfmt.c: win64-nasm.c win64-gas.c + +win64-nasm.c: $(srcdir)/modules/objfmts/coff/win64-nasm.mac genmacro$(EXEEXT) + $(top_builddir)/genmacro$(EXEEXT) $@ win64_nasm_stdmac $(srcdir)/modules/objfmts/coff/win64-nasm.mac + +BUILT_SOURCES += win64-nasm.c +CLEANFILES += win64-nasm.c +EXTRA_DIST += modules/objfmts/coff/win64-nasm.mac + +win64-gas.c: $(srcdir)/modules/objfmts/coff/win64-gas.mac genmacro$(EXEEXT) + $(top_builddir)/genmacro$(EXEEXT) $@ win64_gas_stdmac $(srcdir)/modules/objfmts/coff/win64-gas.mac + +BUILT_SOURCES += win64-gas.c +CLEANFILES += win64-gas.c +EXTRA_DIST += modules/objfmts/coff/win64-gas.mac + EXTRA_DIST += modules/objfmts/coff/tests/Makefile.inc include modules/objfmts/coff/tests/Makefile.inc diff --git a/modules/objfmts/coff/coff-objfmt.c b/modules/objfmts/coff/coff-objfmt.c index 22ecac45..16cf6ea3 100644 --- a/modules/objfmts/coff/coff-objfmt.c +++ b/modules/objfmts/coff/coff-objfmt.c @@ -2192,6 +2192,7 @@ yasm_objfmt_module yasm_coff_LTX_objfmt = { coff_objfmt_dbgfmt_keywords, "null", coff_objfmt_directives, + NULL, /* no standard macros */ coff_objfmt_create, coff_objfmt_output, coff_objfmt_destroy, @@ -2218,6 +2219,21 @@ static const yasm_directive win32_objfmt_directives[] = { { NULL, NULL, NULL, 0 } }; +static const char *win32_nasm_stdmac[] = { + "%imacro export 1+.nolist", + "[export %1]", + "%endmacro", + "%imacro safeseh 1+.nolist", + "[safeseh %1]", + "%endmacro", + NULL +}; + +static const yasm_stdmac win32_objfmt_stdmacs[] = { + { "nasm", "nasm", win32_nasm_stdmac }, + { NULL, NULL, NULL } +}; + /* Define objfmt structure -- see objfmt.h for details */ yasm_objfmt_module yasm_win32_LTX_objfmt = { "Win32", @@ -2227,6 +2243,7 @@ yasm_objfmt_module yasm_win32_LTX_objfmt = { winXX_objfmt_dbgfmt_keywords, "null", win32_objfmt_directives, + win32_objfmt_stdmacs, win32_objfmt_create, coff_objfmt_output, coff_objfmt_destroy, @@ -2261,6 +2278,15 @@ static const yasm_directive win64_objfmt_directives[] = { { NULL, NULL, NULL, 0 } }; +#include "win64-nasm.c" +#include "win64-gas.c" + +static const yasm_stdmac win64_objfmt_stdmacs[] = { + { "nasm", "nasm", win64_nasm_stdmac }, + { "gas", "nasm", win64_gas_stdmac }, + { NULL, NULL, NULL } +}; + /* Define objfmt structure -- see objfmt.h for details */ yasm_objfmt_module yasm_win64_LTX_objfmt = { "Win64", @@ -2270,6 +2296,7 @@ yasm_objfmt_module yasm_win64_LTX_objfmt = { winXX_objfmt_dbgfmt_keywords, "null", win64_objfmt_directives, + win64_objfmt_stdmacs, win64_objfmt_create, coff_objfmt_output, coff_objfmt_destroy, @@ -2285,6 +2312,7 @@ yasm_objfmt_module yasm_x64_LTX_objfmt = { winXX_objfmt_dbgfmt_keywords, "null", win64_objfmt_directives, + win64_objfmt_stdmacs, win64_objfmt_create, coff_objfmt_output, coff_objfmt_destroy, diff --git a/modules/objfmts/coff/win64-gas.mac b/modules/objfmts/coff/win64-gas.mac new file mode 100644 index 00000000..cf1e7dc6 --- /dev/null +++ b/modules/objfmts/coff/win64-gas.mac @@ -0,0 +1,73 @@ +%imacro export 1+.nolist +.export %1 +%endmacro + +; Raw exception handling operations +%imacro proc_frame 1+.nolist +%1: +.proc_frame %1 +%endmacro + +%imacro endproc_frame 0.nolist +.endproc_frame +%endmacro + +; Complex (macro) exception handling operations +; Mimics many macros provided by MASM's macamd64.inc +%imacro push_reg 1 +pushq %1 +.pushreg %1 +%endmacro + +%imacro rex_push_reg 1 +.byte 0x48 +pushq %1 +.pushreg %1 +%endmacro + +%imacro push_eflags 0 +pushfq +.allocstack 8 +%endmacro + +%imacro rex_push_eflags 0 +.byte 0x48 +pushfq +.allocstack 8 +%endmacro + +%imacro alloc_stack 1 +subq %1, %rsp +.allocstack %1 +%endmacro + +%imacro save_reg 2 +movq %1, %2(%rsp) +.savereg %1 %2 +%endmacro + +%imacro save_xmm128 2 +movdqa %1, %2(%rsp) +.savexmm128 %1, %2 +%endmacro + +%imacro push_frame 0-1.nolist +.pushframe %1 +%endmacro + +%imacro set_frame 1-2 +%if %0==1 +movq %rsp, %1 +%else +leaq %2(%rsp), %1 +%endif +.setframe %1, %2 +%endmacro + +%imacro end_prolog 0.nolist +.endprolog +%endmacro + +%imacro end_prologue 0.nolist +.endprolog +%endmacro diff --git a/modules/objfmts/coff/win64-nasm.mac b/modules/objfmts/coff/win64-nasm.mac new file mode 100644 index 00000000..13954b89 --- /dev/null +++ b/modules/objfmts/coff/win64-nasm.mac @@ -0,0 +1,106 @@ +%imacro export 1+.nolist +[export %1] +%endmacro + +; Raw exception handling operations +%imacro proc_frame 1+.nolist +%1: +[proc_frame %1] +%endmacro + +; Disable these as they're too closely named to the macroized ones. +; MASM needs a preceding . to use these, so it seems reasonable for +; us to similarly require the []. +; +;%imacro pushreg 1.nolist +;[pushreg %1] +;%endmacro +; +;%imacro setframe 1-2.nolist +;[setframe %1 %2] +;%endmacro +; +;%imacro allocstack 1.nolist +;[allocstack %1] +;%endmacro +; +;%imacro savereg 2.nolist +;[savereg %1 %2] +;%endmacro +; +;%imacro savexmm128 2.nolist +;[savexmm128 %1 %2] +;%endmacro +; +;%imacro pushframe 0-1.nolist +;[pushframe %1] +;%endmacro +; +;%imacro endprolog 0.nolist +;[endprolog] +;%endmacro +; + +%imacro endproc_frame 0.nolist +[endproc_frame] +%endmacro + +; Complex (macro) exception handling operations +; Mimics many macros provided by MASM's macamd64.inc +%imacro push_reg 1 +push %1 +[pushreg %1] +%endmacro + +%imacro rex_push_reg 1 +db 0x48 +push %1 +[pushreg %1] +%endmacro + +%imacro push_eflags 0 +pushfq +[allocstack 8] +%endmacro + +%imacro rex_push_eflags 0 +db 0x48 +pushfq +[allocstack 8] +%endmacro + +%imacro alloc_stack 1 +sub rsp, %1 +[allocstack %1] +%endmacro + +%imacro save_reg 2 +mov [rsp+%2], %1 +[savereg %1 %2] +%endmacro + +%imacro save_xmm128 2 +movdqa [rsp+%2], %1 +[savexmm128 %1 %2] +%endmacro + +%imacro push_frame 0-1.nolist +[pushframe %1] +%endmacro + +%imacro set_frame 1-2 +%if %0==1 +mov %1, rsp +%else +lea %1, [rsp+%2] +%endif +[setframe %1 %2] +%endmacro + +%imacro end_prolog 0.nolist +[endprolog] +%endmacro + +%imacro end_prologue 0.nolist +[endprolog] +%endmacro diff --git a/modules/objfmts/dbg/dbg-objfmt.c b/modules/objfmts/dbg/dbg-objfmt.c index 21a161ab..ad5f14a1 100644 --- a/modules/objfmts/dbg/dbg-objfmt.c +++ b/modules/objfmts/dbg/dbg-objfmt.c @@ -165,6 +165,7 @@ yasm_objfmt_module yasm_dbg_LTX_objfmt = { dbg_objfmt_dbgfmt_keywords, "null", NULL, /* no directives */ + NULL, /* no standard macros */ dbg_objfmt_create, dbg_objfmt_output, dbg_objfmt_destroy, diff --git a/modules/objfmts/elf/elf-objfmt.c b/modules/objfmts/elf/elf-objfmt.c index 142275ea..d2083a84 100644 --- a/modules/objfmts/elf/elf-objfmt.c +++ b/modules/objfmts/elf/elf-objfmt.c @@ -1310,6 +1310,24 @@ static const yasm_directive elf_objfmt_directives[] = { { NULL, NULL, NULL, 0 } }; +static const char *elf_nasm_stdmac[] = { + "%imacro type 1+.nolist", + "[type %1]", + "%endmacro", + "%imacro size 1+.nolist", + "[size %1]", + "%endmacro", + "%imacro weak 1+.nolist", + "[weak %1]", + "%endmacro", + NULL +}; + +static const yasm_stdmac elf_objfmt_stdmacs[] = { + { "nasm", "nasm", elf_nasm_stdmac }, + { NULL, NULL, NULL } +}; + /* Define objfmt structure -- see objfmt.h for details */ yasm_objfmt_module yasm_elf_LTX_objfmt = { "ELF", @@ -1319,6 +1337,7 @@ yasm_objfmt_module yasm_elf_LTX_objfmt = { elf_objfmt_dbgfmt_keywords, "null", elf_objfmt_directives, + elf_objfmt_stdmacs, elf_objfmt_create, elf_objfmt_output, elf_objfmt_destroy, @@ -1335,6 +1354,7 @@ yasm_objfmt_module yasm_elf32_LTX_objfmt = { elf_objfmt_dbgfmt_keywords, "null", elf_objfmt_directives, + elf_objfmt_stdmacs, elf32_objfmt_create, elf_objfmt_output, elf_objfmt_destroy, @@ -1351,6 +1371,7 @@ yasm_objfmt_module yasm_elf64_LTX_objfmt = { elf_objfmt_dbgfmt_keywords, "null", elf_objfmt_directives, + elf_objfmt_stdmacs, elf64_objfmt_create, elf_objfmt_output, elf_objfmt_destroy, diff --git a/modules/objfmts/macho/macho-objfmt.c b/modules/objfmts/macho/macho-objfmt.c index 4628bf74..0a049baf 100644 --- a/modules/objfmts/macho/macho-objfmt.c +++ b/modules/objfmts/macho/macho-objfmt.c @@ -1551,6 +1551,7 @@ yasm_objfmt_module yasm_macho_LTX_objfmt = { macho_objfmt_dbgfmt_keywords, "null", NULL, /* no directives */ + NULL, /* no standard macros */ macho_objfmt_create, macho_objfmt_output, macho_objfmt_destroy, @@ -1567,6 +1568,7 @@ yasm_objfmt_module yasm_macho32_LTX_objfmt = { macho_objfmt_dbgfmt_keywords, "null", NULL, /* no directives */ + NULL, /* no standard macros */ macho32_objfmt_create, macho_objfmt_output, macho_objfmt_destroy, @@ -1583,6 +1585,7 @@ yasm_objfmt_module yasm_macho64_LTX_objfmt = { macho_objfmt_dbgfmt_keywords, "null", NULL, /* no directives */ + NULL, /* no standard macros */ macho64_objfmt_create, macho_objfmt_output, macho_objfmt_destroy, diff --git a/modules/objfmts/rdf/rdf-objfmt.c b/modules/objfmts/rdf/rdf-objfmt.c index 22e2a1c7..e4173289 100644 --- a/modules/objfmts/rdf/rdf-objfmt.c +++ b/modules/objfmts/rdf/rdf-objfmt.c @@ -1057,6 +1057,21 @@ static const yasm_directive rdf_objfmt_directives[] = { { NULL, NULL, NULL, 0 } }; +static const char *rdf_nasm_stdmac[] = { + "%imacro library 1+.nolist", + "[library %1]", + "%endmacro", + "%imacro module 1+.nolist", + "[module %1]", + "%endmacro", + NULL +}; + +static const yasm_stdmac rdf_objfmt_stdmacs[] = { + { "nasm", "nasm", rdf_nasm_stdmac }, + { NULL, NULL, NULL } +}; + /* Define objfmt structure -- see objfmt.h for details */ yasm_objfmt_module yasm_rdf_LTX_objfmt = { "Relocatable Dynamic Object File Format (RDOFF) v2.0", @@ -1066,6 +1081,7 @@ yasm_objfmt_module yasm_rdf_LTX_objfmt = { rdf_objfmt_dbgfmt_keywords, "null", rdf_objfmt_directives, + rdf_objfmt_stdmacs, rdf_objfmt_create, rdf_objfmt_output, rdf_objfmt_destroy, diff --git a/modules/objfmts/win64/tests/Makefile.inc b/modules/objfmts/win64/tests/Makefile.inc index 4bc0907c..06e0f86d 100644 --- a/modules/objfmts/win64/tests/Makefile.inc +++ b/modules/objfmts/win64/tests/Makefile.inc @@ -27,3 +27,7 @@ EXTRA_DIST += modules/objfmts/win64/tests/win64-dataref.masm EXTRA_DIST += modules/objfmts/win64/tests/win64-dataref2.asm EXTRA_DIST += modules/objfmts/win64/tests/win64-dataref2.hex EXTRA_DIST += modules/objfmts/win64/tests/win64-dataref2.masm + +EXTRA_DIST += modules/objfmts/win64/tests/gas/Makefile.inc + +include modules/objfmts/win64/tests/gas/Makefile.inc diff --git a/modules/objfmts/win64/tests/gas/Makefile.inc b/modules/objfmts/win64/tests/gas/Makefile.inc new file mode 100644 index 00000000..0d16bd12 --- /dev/null +++ b/modules/objfmts/win64/tests/gas/Makefile.inc @@ -0,0 +1,7 @@ +# $Id$ + +TESTS += modules/objfmts/win64/tests/gas/win64_gas_test.sh + +EXTRA_DIST += modules/objfmts/win64/tests/gas/win64_gas_test.sh +EXTRA_DIST += modules/objfmts/win64/tests/gas/win64-gas-sce.asm +EXTRA_DIST += modules/objfmts/win64/tests/gas/win64-gas-sce.hex diff --git a/modules/objfmts/win64/tests/gas/win64-gas-sce.asm b/modules/objfmts/win64/tests/gas/win64-gas-sce.asm new file mode 100644 index 00000000..3a75ee4c --- /dev/null +++ b/modules/objfmts/win64/tests/gas/win64-gas-sce.asm @@ -0,0 +1,11 @@ +PROC_FRAME sample +rex_push_reg %rbp +rex_push_eflags +alloc_stack 16 +save_reg %rsi, 0x18 +save_xmm128 %xmm7, 0x20 +push_frame 16 +set_frame %rdi +set_frame %rdi, 16 +END_PROLOGUE +ENDPROC_FRAME diff --git a/modules/objfmts/win64/tests/gas/win64-gas-sce.hex b/modules/objfmts/win64/tests/gas/win64-gas-sce.hex new file mode 100644 index 00000000..ff4288f9 --- /dev/null +++ b/modules/objfmts/win64/tests/gas/win64-gas-sce.hex @@ -0,0 +1,403 @@ +64 +86 +03 +00 +00 +00 +00 +00 +ed +00 +00 +00 +09 +00 +00 +00 +00 +00 +04 +00 +2e +74 +65 +78 +74 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +1f +00 +00 +00 +8c +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +20 +00 +50 +60 +2e +78 +64 +61 +74 +61 +00 +00 +1f +00 +00 +00 +00 +00 +00 +00 +18 +00 +00 +00 +ab +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +40 +00 +40 +40 +2e +70 +64 +61 +74 +61 +00 +00 +37 +00 +00 +00 +00 +00 +00 +00 +0c +00 +00 +00 +c3 +00 +00 +00 +cf +00 +00 +00 +00 +00 +00 +00 +03 +00 +00 +00 +40 +00 +30 +40 +48 +55 +48 +9c +48 +2b +24 +25 +10 +00 +00 +00 +48 +89 +74 +24 +18 +66 +0f +7f +7c +24 +20 +48 +89 +e7 +48 +8d +7c +24 +10 +01 +1f +0a +17 +1f +73 +1a +73 +17 +1a +17 +78 +02 +00 +11 +64 +03 +00 +0c +12 +04 +02 +02 +50 +00 +00 +00 +00 +1f +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +00 +00 +03 +00 +04 +00 +00 +00 +04 +00 +00 +00 +03 +00 +08 +00 +00 +00 +05 +00 +00 +00 +03 +00 +2e +66 +69 +6c +65 +00 +00 +00 +00 +00 +00 +00 +fe +ff +00 +00 +67 +01 +2d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +2e +74 +65 +78 +74 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +03 +01 +1f +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +73 +61 +6d +70 +6c +65 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +03 +00 +2e +78 +64 +61 +74 +61 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +03 +01 +18 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +2e +70 +64 +61 +74 +61 +00 +00 +00 +00 +00 +00 +03 +00 +00 +00 +03 +01 +0c +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +00 +00 diff --git a/modules/objfmts/win64/tests/gas/win64_gas_test.sh b/modules/objfmts/win64/tests/gas/win64_gas_test.sh new file mode 100755 index 00000000..55753839 --- /dev/null +++ b/modules/objfmts/win64/tests/gas/win64_gas_test.sh @@ -0,0 +1,4 @@ +#! /bin/sh +# $Id$ +${srcdir}/out_test.sh win64_gas_test modules/objfmts/win64/tests/gas "win64 objfmt" "-f win64 -p gas -r nasm" ".obj" +exit $? diff --git a/modules/objfmts/xdf/xdf-objfmt.c b/modules/objfmts/xdf/xdf-objfmt.c index d7cb453b..89cb403c 100644 --- a/modules/objfmts/xdf/xdf-objfmt.c +++ b/modules/objfmts/xdf/xdf-objfmt.c @@ -839,6 +839,7 @@ yasm_objfmt_module yasm_xdf_LTX_objfmt = { xdf_objfmt_dbgfmt_keywords, "null", NULL, /* no directives */ + NULL, /* no standard macros */ xdf_objfmt_create, xdf_objfmt_output, xdf_objfmt_destroy, diff --git a/modules/parsers/gas/gas-parser.c b/modules/parsers/gas/gas-parser.c index 1e7fb8b6..de3397c2 100644 --- a/modules/parsers/gas/gas-parser.c +++ b/modules/parsers/gas/gas-parser.c @@ -129,6 +129,7 @@ yasm_parser_module yasm_gas_LTX_parser = { "gas", gas_parser_preproc_keywords, "raw", + NULL, /* No standard macros */ gas_parser_do_parse }; yasm_parser_module yasm_gnu_LTX_parser = { @@ -136,5 +137,6 @@ yasm_parser_module yasm_gnu_LTX_parser = { "gnu", gas_parser_preproc_keywords, "raw", + NULL, /* No standard macros */ gas_parser_do_parse }; diff --git a/modules/parsers/nasm/Makefile.inc b/modules/parsers/nasm/Makefile.inc index 9994e316..ac174ca0 100644 --- a/modules/parsers/nasm/Makefile.inc +++ b/modules/parsers/nasm/Makefile.inc @@ -14,7 +14,17 @@ BUILT_SOURCES += nasm-token.c CLEANFILES += nasm-token.c -EXTRA_DIST += modules/parsers/nasm/tests/Makefile.inc EXTRA_DIST += modules/parsers/nasm/nasm-token.re +$(top_srcdir)/modules/parsers/nasm/nasm-parser.c: nasm-macros.c + +nasm-macros.c: $(srcdir)/modules/parsers/nasm/nasm-std.mac genmacro$(EXEEXT) + $(top_builddir)/genmacro$(EXEEXT) $@ nasm_standard_mac $(srcdir)/modules/parsers/nasm/nasm-std.mac + +BUILT_SOURCES += nasm-macros.c +CLEANFILES += nasm-macros.c +EXTRA_DIST += modules/parsers/nasm/nasm-std.mac + +EXTRA_DIST += modules/parsers/nasm/tests/Makefile.inc + include modules/parsers/nasm/tests/Makefile.inc diff --git a/modules/parsers/nasm/nasm-parser.c b/modules/parsers/nasm/nasm-parser.c index dc46a717..ac10de37 100644 --- a/modules/parsers/nasm/nasm-parser.c +++ b/modules/parsers/nasm/nasm-parser.c @@ -77,6 +77,8 @@ nasm_parser_do_parse(yasm_object *object, yasm_preproc *pp, yasm_symtab_parser_finalize(object->symtab, 0, errwarns); } +#include "nasm-macros.c" + /* Define valid preprocessors to use with this parser */ static const char *nasm_parser_preproc_keywords[] = { "raw", @@ -84,11 +86,17 @@ static const char *nasm_parser_preproc_keywords[] = { NULL }; +static const yasm_stdmac nasm_parser_stdmacs[] = { + { "nasm", "nasm", nasm_standard_mac }, + { NULL, NULL, NULL } +}; + /* Define parser structure -- see parser.h for details */ yasm_parser_module yasm_nasm_LTX_parser = { "NASM-compatible parser", "nasm", nasm_parser_preproc_keywords, "nasm", + nasm_parser_stdmacs, nasm_parser_do_parse }; diff --git a/modules/parsers/nasm/nasm-std.mac b/modules/parsers/nasm/nasm-std.mac new file mode 100644 index 00000000..3c9223ab --- /dev/null +++ b/modules/parsers/nasm/nasm-std.mac @@ -0,0 +1,109 @@ +; Standard macro set for NASM -*- nasm -*- + +; Note that although some user-level forms of directives are defined +; here, not all of them are: the user-level form of a format-specific +; directive should be defined in the module for that directive. + +; These two need to be defined, though the actual definitions will +; be constantly updated during preprocessing. +%define __FILE__ +%define __LINE__ + +%define __SECT__ [section .text] ; it ought to be defined, even if as nothing + +%imacro section 1+.nolist +%define __SECT__ [section %1] + __SECT__ +%endmacro +%imacro segment 1+.nolist +%define __SECT__ [segment %1] + __SECT__ +%endmacro + +%imacro absolute 1+.nolist +%define __SECT__ [absolute %1] + __SECT__ +%endmacro + +%imacro struc 1.nolist +%push struc +%define %$strucname %1 +[absolute 0] +%$strucname: ; allow definition of `.member' to work sanely +%endmacro +%imacro endstruc 0.nolist +%{$strucname}_size: +%pop +__SECT__ +%endmacro + +%imacro istruc 1.nolist +%push istruc +%define %$strucname %1 +%$strucstart: +%endmacro +%imacro at 1-2+.nolist + times %1-($-%$strucstart) db 0 + %2 +%endmacro +%imacro iend 0.nolist + times %{$strucname}_size-($-%$strucstart) db 0 +%pop +%endmacro + +%imacro align 1-2+.nolist nop +%ifidni %2,nop + [align %1] +%else + times ($$-$) & ((%1)-1) %2 +%endif +%endmacro +%imacro alignb 1-2+.nolist resb 1 + times ($$-$) & ((%1)-1) %2 +%endmacro + +%imacro extern 1-*.nolist +%rep %0 +[extern %1] +%rotate 1 +%endrep +%endmacro + +%imacro bits 1+.nolist +[bits %1] +%endmacro + +%imacro use16 0.nolist +[bits 16] +%endmacro +%imacro use32 0.nolist +[bits 32] +%endmacro +%imacro use64 0.nolist +[bits 64] +%endmacro + +%imacro global 1-*.nolist +%rep %0 +[global %1] +%rotate 1 +%endrep +%endmacro + +%imacro common 1-*.nolist +%rep %0 +[common %1] +%rotate 1 +%endrep +%endmacro + +%imacro cpu 1+.nolist +[cpu %1] +%endmacro + +%imacro default 1+.nolist +[default %1] +%endmacro + +; NASM compatibility shim +%define __OUTPUT_FORMAT__ __YASM_OBJFMT__ diff --git a/modules/preprocs/cpp/cpp-preproc.c b/modules/preprocs/cpp/cpp-preproc.c index dae2e032..c58e4044 100644 --- a/modules/preprocs/cpp/cpp-preproc.c +++ b/modules/preprocs/cpp/cpp-preproc.c @@ -377,6 +377,12 @@ cpp_preproc_define_builtin(yasm_preproc *preproc, const char *macronameval) cpp_preproc_predefine_macro(preproc, macronameval); } +static void +cpp_preproc_add_standard(yasm_preproc *preproc, const char **macros) +{ + /* TODO */ +} + /******************************************************************************* Preprocessor module object. *******************************************************************************/ @@ -391,5 +397,6 @@ yasm_preproc_module yasm_cpp_LTX_preproc = { cpp_preproc_add_include_file, cpp_preproc_predefine_macro, cpp_preproc_undefine_macro, - cpp_preproc_define_builtin + cpp_preproc_define_builtin, + cpp_preproc_add_standard }; diff --git a/modules/preprocs/nasm/Makefile.inc b/modules/preprocs/nasm/Makefile.inc index a91eb914..f9aa9d5e 100644 --- a/modules/preprocs/nasm/Makefile.inc +++ b/modules/preprocs/nasm/Makefile.inc @@ -11,23 +11,13 @@ libyasm_a_SOURCES += modules/preprocs/nasm/nasm-eval.c YASM_MODULES += preproc_nasm -$(top_srcdir)/src/preprocs/nasm/nasm-pp.c: nasm-macros.c +$(top_srcdir)/modules/preprocs/nasm/nasm-preproc.c: nasm-version.c -nasm-macros.c: $(top_srcdir)/modules/preprocs/nasm/standard.mac version.mac genmacro$(EXEEXT) - $(top_builddir)/genmacro$(EXEEXT) $(top_srcdir)/modules/preprocs/nasm/standard.mac version.mac +nasm-version.c: version.mac genmacro$(EXEEXT) + $(top_builddir)/genmacro$(EXEEXT) $@ nasm_version_mac version.mac -BUILT_SOURCES += nasm-macros.c -CLEANFILES += nasm-macros.c - -noinst_PROGRAMS += genmacro - -genmacro_SOURCES = -EXTRA_DIST += modules/preprocs/nasm/genmacro.c -genmacro_LDADD = genmacro.$(OBJEXT) -genmacro_LINK = $(CCLD_FOR_BUILD) -o $@ - -genmacro.$(OBJEXT): modules/preprocs/nasm/genmacro.c - $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f modules/preprocs/nasm/genmacro.c || echo '$(srcdir)/'`modules/preprocs/nasm/genmacro.c +BUILT_SOURCES += nasm-version.c +CLEANFILES += nasm-version.c version.mac: genversion$(EXEEXT) $(top_builddir)/genversion$(EXEEXT) $@ @@ -45,7 +35,6 @@ genversion_LINK = $(CCLD_FOR_BUILD) -o $@ genversion.$(OBJEXT): modules/preprocs/nasm/genversion.c $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f modules/preprocs/nasm/genversion.c || echo '$(srcdir)/'`modules/preprocs/nasm/genversion.c -EXTRA_DIST += modules/preprocs/nasm/standard.mac EXTRA_DIST += modules/preprocs/nasm/tests/Makefile.inc include modules/preprocs/nasm/tests/Makefile.inc diff --git a/modules/preprocs/nasm/genmacro.c b/modules/preprocs/nasm/genmacro.c deleted file mode 100644 index e6f40193..00000000 --- a/modules/preprocs/nasm/genmacro.c +++ /dev/null @@ -1,145 +0,0 @@ -/* $Id$ - * - * C version of NASM's macros.pl - * - * Copyright (C) 2004-2007 Peter Johnson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ -#include -#include -#include - -#define OUTPUT "nasm-macros.c" -#define MAXLINE 1024 - -int -main(int argc, char *argv[]) -{ - FILE *in, *out; - int i; - char *str; - char *strp; - char *charp; - int fline; - int line = 0; - int lindex = 0; - int tasm_count = -1; - size_t len; - - if (argc < 2) { - fprintf(stderr, "Usage: %s [ ...]\n", argv[0]); - return EXIT_FAILURE; - } - - out = fopen(OUTPUT, "wt"); - - if (!out) { - fprintf(stderr, "Could not open `%s'.\n", OUTPUT); - return EXIT_FAILURE; - } - - str = malloc(MAXLINE); - - fprintf(out, "/* This file auto-generated from standard.mac by genmacro.c" - " - don't edit it */\n\n#include \n\n" - "static const char *stdmac[] = {\n"); - - for (i=1; i 0 && (strp[len-1] == ' ' || strp[len-1] == '\t' || - strp[len-1] == '\n')) { - strp[len-1] = '\0'; - len--; - } - - /* skip blank lines */ - if (len == 0) - continue; - - /* check for special TASM ending token */ - if (strcmp(strp, "*END*TASM*MACROS*") == 0) { - tasm_count = lindex; - continue; - } - - /* output as string to output file */ - fprintf(out, " \""); - while (*strp != '\0') { - if (*strp == '\\' || *strp == '"') - fputc('\\', out); - fputc(*strp, out); - strp++; - } - fprintf(out, "\",\n"); - lindex++; - } - - fclose(in); - } - - fprintf(out, " NULL\n};\n"); - if (tasm_count == -1) - tasm_count = lindex; - fprintf(out, "#define TASM_MACRO_COUNT %d\n", tasm_count); - fclose(out); - - free(str); - - return EXIT_SUCCESS; -} diff --git a/modules/preprocs/nasm/genversion.c b/modules/preprocs/nasm/genversion.c index 5426c3dd..ac977685 100644 --- a/modules/preprocs/nasm/genversion.c +++ b/modules/preprocs/nasm/genversion.c @@ -43,6 +43,11 @@ main(int argc, char *argv[]) return EXIT_FAILURE; } + if (sscanf(PACKAGE_INTVER, "%d.%d.%d", &major, &minor, &subminor) != 3) { + fprintf(stderr, "Version tokenizing error\n"); + return EXIT_FAILURE; + } + out = fopen(argv[1], "wt"); if (!out) { @@ -53,13 +58,6 @@ main(int argc, char *argv[]) fprintf(out, "; This file auto-generated by genversion.c" " - don't edit it\n"); - if (sscanf(PACKAGE_INTVER, "%d.%d.%d", &major, &minor, &subminor) != 3) { - fprintf(stderr, "Version tokenizing error\n"); - fclose(out); - remove(argv[1]); - return EXIT_FAILURE; - } - fprintf(out, "%%define __YASM_MAJOR__ %d\n", major); fprintf(out, "%%define __YASM_MINOR__ %d\n", minor); fprintf(out, "%%define __YASM_SUBMINOR__ %d\n", subminor); diff --git a/modules/preprocs/nasm/nasm-pp.c b/modules/preprocs/nasm/nasm-pp.c index 2bb94b04..2d5e7d21 100644 --- a/modules/preprocs/nasm/nasm-pp.c +++ b/modules/preprocs/nasm/nasm-pp.c @@ -351,7 +351,9 @@ static int pass; /* HACK: pass 0 = generate dependencies only */ static unsigned long unique; /* unique identifier numbers */ static Line *builtindef = NULL; +static Line *stddef = NULL; static Line *predef = NULL; +static int first_line = 1; static ListGen *list; @@ -384,18 +386,19 @@ static MMacro *defining; #define PARAM_DELTA 16 /* - * The standard macro set: defined as `static char *stdmac[]'. Also - * gives our position in the macro set, when we're processing it. + * Macros to make NASM ignore some TASM directives before the first include + * directive. */ -#include "nasm-macros.c" -static const char **stdmacpos; - -/* - * The extra standard macros that come from the object format, if - * any. - */ -static const char **extrastdmac = NULL; -int any_extrastdmac; +static const char *tasm_compat_macros[] = +{ + "%idefine IDEAL", + "%idefine JUMPS", + "%idefine P386", + "%idefine P486", + "%idefine P586", + "%idefine END", + NULL +}; static int nested_mac_count, nested_rep_count; @@ -641,69 +644,6 @@ read_line(void) char *buffer, *p, *q; int bufsize, continued_count; - Line *pd, *l; - Token *head, **tail, *t; - - /* Nasty hack for builtin defines */ - for (pd = builtindef; pd; pd = pd->next) - { - head = NULL; - tail = &head; - for (t = pd->first; t; t = t->next) - { - *tail = new_Token(NULL, t->type, t->text, 0); - tail = &(*tail)->next; - } - l = nasm_malloc(sizeof(Line)); - l->next = istk->expansion; - l->first = head; - l->finishes = FALSE; - istk->expansion = l; - } - - if (stdmacpos) - { - if (*stdmacpos) - { - char *ret = nasm_strdup(*stdmacpos++); - if (!*stdmacpos && any_extrastdmac) - { - stdmacpos = extrastdmac; - any_extrastdmac = FALSE; - return ret; - } - /* - * Nasty hack: here we push the contents of `predef' on - * to the top-level expansion stack, since this is the - * most convenient way to implement the pre-include and - * pre-define features. - */ - if (!*stdmacpos) - { - for (pd = predef; pd; pd = pd->next) - { - head = NULL; - tail = &head; - for (t = pd->first; t; t = t->next) - { - *tail = new_Token(NULL, t->type, t->text, 0); - tail = &(*tail)->next; - } - l = nasm_malloc(sizeof(Line)); - l->next = istk->expansion; - l->first = head; - l->finishes = FALSE; - istk->expansion = l; - } - } - return ret; - } - else - { - stdmacpos = NULL; - } - } - bufsize = BUF_DELTA; buffer = nasm_malloc(BUF_DELTA); p = buffer; @@ -4213,15 +4153,42 @@ pp_reset(FILE *f, const char *file, int apass, efunc errfunc, evalfunc eval, smacros[h] = NULL; } unique = 0; - if (tasm_compatible_mode) { - stdmacpos = stdmac; - } else { - stdmacpos = &stdmac[TASM_MACRO_COUNT]; - } - any_extrastdmac = (extrastdmac != NULL); + if (tasm_compatible_mode) { + pp_extra_stdmac(tasm_compat_macros); + } list = listgen; evaluate = eval; pass = apass; + first_line = 1; +} + +/* + * Nasty hack: here we push the contents of `predef' on + * to the top-level expansion stack, since this is the + * most convenient way to implement the pre-include and + * pre-define features. + */ +static void +poke_predef(Line *predef_lines) +{ + Line *pd, *l; + Token *head, **tail, *t; + + for (pd = predef_lines; pd; pd = pd->next) + { + head = NULL; + tail = &head; + for (t = pd->first; t; t = t->next) + { + *tail = new_Token(NULL, t->type, t->text, 0); + tail = &(*tail)->next; + } + l = nasm_malloc(sizeof(Line)); + l->next = istk->expansion; + l->first = head; + l->finishes = FALSE; + istk->expansion = l; + } } static char * @@ -4237,6 +4204,16 @@ pp_getline(void) * buffer or from the input file. */ tline = NULL; + + if (first_line) + { + /* Reverse order */ + poke_predef(predef); + poke_predef(stddef); + poke_predef(builtindef); + first_line = 0; + } + if (!istk) return NULL; while (istk->expansion && istk->expansion->finishes) @@ -4501,6 +4478,7 @@ pp_cleanup(int pass_) if (pass_ == 0) { free_llist(builtindef); + free_llist(stddef); free_llist(predef); delete_Blocks(); } @@ -4589,7 +4567,24 @@ pp_builtin_define(char *definition) void pp_extra_stdmac(const char **macros) { - extrastdmac = macros; + const char **lp; + + for (lp=macros; *lp; lp++) + { + char *macro; + Token *t; + Line *l; + + macro = nasm_strdup(*lp); + t = tokenise(macro); + nasm_free(macro); + + l = nasm_malloc(sizeof(Line)); + l->next = stddef; + l->first = t; + l->finishes = FALSE; + stddef = l; + } } static void diff --git a/modules/preprocs/nasm/nasm-preproc.c b/modules/preprocs/nasm/nasm-preproc.c index a0d941cf..bb4c7a74 100644 --- a/modules/preprocs/nasm/nasm-preproc.c +++ b/modules/preprocs/nasm/nasm-preproc.c @@ -48,6 +48,8 @@ static yasm_linemap *cur_lm; static yasm_errwarns *cur_errwarns; int tasm_compatible_mode = 0; +#include "nasm-version.c" + typedef struct preproc_dep { STAILQ_ENTRY(preproc_dep) link; char *name; @@ -156,6 +158,8 @@ nasm_preproc_create(const char *in_filename, yasm_symtab *symtab, preproc_nasm->lineinc = 0; nasmpp.reset(f, in_filename, 2, nasm_efunc, nasm_evaluate, &nil_list); + pp_extra_stdmac(nasm_version_mac); + return (yasm_preproc *)preproc_nasm; } @@ -290,6 +294,12 @@ nasm_preproc_define_builtin(yasm_preproc *preproc, const char *macronameval) yasm_xfree(mnv); } +static void +nasm_preproc_add_standard(yasm_preproc *preproc, const char **macros) +{ + pp_extra_stdmac(macros); +} + /* Define preproc structure -- see preproc.h for details */ yasm_preproc_module yasm_nasm_LTX_preproc = { "Real NASM Preprocessor", @@ -301,5 +311,6 @@ yasm_preproc_module yasm_nasm_LTX_preproc = { nasm_preproc_add_include_file, nasm_preproc_predefine_macro, nasm_preproc_undefine_macro, - nasm_preproc_define_builtin + nasm_preproc_define_builtin, + nasm_preproc_add_standard }; diff --git a/modules/preprocs/nasm/standard.mac b/modules/preprocs/nasm/standard.mac deleted file mode 100644 index f459a7db..00000000 --- a/modules/preprocs/nasm/standard.mac +++ /dev/null @@ -1,293 +0,0 @@ -; Standard macro set for NASM -*- nasm -*- - -; Macros to make NASM ignore some TASM directives before the first include -; directive. - - %idefine IDEAL - %idefine JUMPS - %idefine P386 - %idefine P486 - %idefine P586 - %idefine END - -; This is a magic token which indicates the end of the TASM macros -*END*TASM*MACROS* - -; Note that although some user-level forms of directives are defined -; here, not all of them are: the user-level form of a format-specific -; directive should be defined in the module for that directive. - -; These two need to be defined, though the actual definitions will -; be constantly updated during preprocessing. -%define __FILE__ -%define __LINE__ - -%define __SECT__ [section .text] ; it ought to be defined, even if as nothing - -%imacro section 1+.nolist -%define __SECT__ [section %1] - __SECT__ -%endmacro -%imacro segment 1+.nolist -%define __SECT__ [segment %1] - __SECT__ -%endmacro - -%imacro absolute 1+.nolist -%define __SECT__ [absolute %1] - __SECT__ -%endmacro - -%imacro struc 1.nolist -%push struc -%define %$strucname %1 -[absolute 0] -%$strucname: ; allow definition of `.member' to work sanely -%endmacro -%imacro endstruc 0.nolist -%{$strucname}_size: -%pop -__SECT__ -%endmacro - -%imacro istruc 1.nolist -%push istruc -%define %$strucname %1 -%$strucstart: -%endmacro -%imacro at 1-2+.nolist - times %1-($-%$strucstart) db 0 - %2 -%endmacro -%imacro iend 0.nolist - times %{$strucname}_size-($-%$strucstart) db 0 -%pop -%endmacro - -%imacro align 1-2+.nolist nop -%ifidni %2,nop - [align %1] -%else - times ($$-$) & ((%1)-1) %2 -%endif -%endmacro -%imacro alignb 1-2+.nolist resb 1 - times ($$-$) & ((%1)-1) %2 -%endmacro - -%imacro extern 1-*.nolist -%rep %0 -[extern %1] -%rotate 1 -%endrep -%endmacro - -%imacro bits 1+.nolist -[bits %1] -%endmacro - -%imacro use16 0.nolist -[bits 16] -%endmacro -%imacro use32 0.nolist -[bits 32] -%endmacro -%imacro use64 0.nolist -[bits 64] -%endmacro - -%imacro global 1-*.nolist -%rep %0 -[global %1] -%rotate 1 -%endrep -%endmacro - -%imacro common 1-*.nolist -%rep %0 -[common %1] -%rotate 1 -%endrep -%endmacro - -%imacro cpu 1+.nolist -[cpu %1] -%endmacro - -%imacro default 1+.nolist -[default %1] -%endmacro - -; NASM compatibility shim -%define __OUTPUT_FORMAT__ __YASM_OBJFMT__ - -%ifidn __YASM_OBJFMT__,bin -%imacro org 1+.nolist -[org %1] -%endmacro -%endif - -%ifidn __YASM_OBJFMT__,win32 -%imacro export 1+.nolist -[export %1] -%endmacro - -%imacro safeseh 1+.nolist -[safeseh %1] -%endmacro -%endif - -%ifidn __YASM_OBJFMT__,win64 -%define __YASM_WIN64__ -%endif - -%ifidn __YASM_OBJFMT__,x64 -%define __YASM_WIN64__ -%endif - -%ifdef __YASM_WIN64__ -%undef __YASM_WIN64__ - -%imacro export 1+.nolist -[export %1] -%endmacro - -; Raw exception handling operations -%imacro proc_frame 1+.nolist -%1: -[proc_frame %1] -%endmacro - -%if 0 -; Disable these as they're too closely named to the macroized ones. -; MASM needs a preceding . to use these, so it seems reasonable for -; us to similarly require the []. -%imacro pushreg 1.nolist -[pushreg %1] -%endmacro - -%imacro setframe 1-2.nolist -[setframe %1 %2] -%endmacro - -%imacro allocstack 1.nolist -[allocstack %1] -%endmacro - -%imacro savereg 2.nolist -[savereg %1 %2] -%endmacro - -%imacro savexmm128 2.nolist -[savexmm128 %1 %2] -%endmacro - -%imacro pushframe 0-1.nolist -[pushframe %1] -%endmacro - -%imacro endprolog 0.nolist -[endprolog] -%endmacro -%endif - -%imacro endproc_frame 0.nolist -[endproc_frame] -%endmacro - -; Complex (macro) exception handling operations -; Mimics many macros provided by MASM's macamd64.inc -%imacro push_reg 1 -push %1 -[pushreg %1] -%endmacro - -%imacro rex_push_reg 1 -db 0x48 -push %1 -[pushreg %1] -%endmacro - -%imacro push_eflags 0 -pushfq -[allocstack 8] -%endmacro - -%imacro rex_push_eflags 0 -db 0x48 -pushfq -[allocstack 8] -%endmacro - -%imacro alloc_stack 1 -sub rsp, %1 -[allocstack %1] -%endmacro - -%imacro save_reg 2 -mov [rsp+%2], %1 -[savereg %1 %2] -%endmacro - -%imacro save_xmm128 2 -movdqa [rsp+%2], %1 -[savexmm128 %1 %2] -%endmacro - -%imacro push_frame 0-1.nolist -[pushframe %1] -%endmacro - -%imacro set_frame 1-2 -%if %0==1 -mov %1, rsp -%else -lea %1, [rsp+%2] -%endif -[setframe %1 %2] -%endmacro - -%imacro end_prolog 0.nolist -[endprolog] -%endmacro - -%imacro end_prologue 0.nolist -[endprolog] -%endmacro - -%endif - -%ifidn __YASM_OBJFMT__,elf -%define __YASM_ELF__ -%endif - -%ifidn __YASM_OBJFMT__,elf32 -%define __YASM_ELF__ -%endif - -%ifidn __YASM_OBJFMT__,elf64 -%define __YASM_ELF__ -%endif - -%ifdef __YASM_ELF__ -%undef __YASM_ELF__ -%imacro type 1+.nolist -[type %1] -%endmacro -%imacro size 1+.nolist -[size %1] -%endmacro -%imacro weak 1+.nolist -[weak %1] -%endmacro -%endif - -%ifidn __YASM_OBJFMT__,rdf -%imacro library 1+.nolist -[library %1] -%endmacro -%imacro module 1+.nolist -[module %1] -%endmacro -%endif - diff --git a/modules/preprocs/nasm/tests/nasmpp-nested.errwarn b/modules/preprocs/nasm/tests/nasmpp-nested.errwarn index 4df49285..31839e33 100644 --- a/modules/preprocs/nasm/tests/nasmpp-nested.errwarn +++ b/modules/preprocs/nasm/tests/nasmpp-nested.errwarn @@ -1,3 +1,3 @@ --:27: warning: (WORK_1:4) 4 --:28: warning: (WORK_2:4) 4 --:29: warning: (DONT_WORK_1:6) 4 4 +-:27: warning: (WORK_1:2) 4 +-:28: warning: (WORK_2:2) 4 +-:29: warning: (DONT_WORK_1:3) 4 4 diff --git a/modules/preprocs/raw/raw-preproc.c b/modules/preprocs/raw/raw-preproc.c index 03f07559..463ceaa1 100644 --- a/modules/preprocs/raw/raw-preproc.c +++ b/modules/preprocs/raw/raw-preproc.c @@ -147,6 +147,12 @@ raw_preproc_define_builtin(yasm_preproc *preproc, const char *macronameval) /* no builtin defines */ } +static void +raw_preproc_add_standard(yasm_preproc *preproc, const char **macros) +{ + /* no standard macros */ +} + /* Define preproc structure -- see preproc.h for details */ yasm_preproc_module yasm_raw_LTX_preproc = { @@ -159,5 +165,6 @@ yasm_preproc_module yasm_raw_LTX_preproc = { raw_preproc_add_include_file, raw_preproc_predefine_macro, raw_preproc_undefine_macro, - raw_preproc_define_builtin + raw_preproc_define_builtin, + raw_preproc_add_standard }; diff --git a/modules/preprocs/yapp/yapp-preproc.c b/modules/preprocs/yapp/yapp-preproc.c index e1215a75..0c774049 100644 --- a/modules/preprocs/yapp/yapp-preproc.c +++ b/modules/preprocs/yapp/yapp-preproc.c @@ -999,6 +999,12 @@ yapp_preproc_define_builtin(yasm_preproc *preproc, const char *macronameval) /* TODO */ } +static void +yapp_preproc_add_standard(yasm_preproc *preproc, const char **macros) +{ + /* TODO */ +} + /* Define preproc structure -- see preproc.h for details */ yasm_preproc_module yasm_yapp_LTX_preproc = { "YAPP preprocessing (NASM style)", @@ -1010,5 +1016,6 @@ yasm_preproc_module yasm_yapp_LTX_preproc = { yapp_preproc_add_include_file, yapp_preproc_predefine_macro, yapp_preproc_undefine_macro, - yapp_preproc_define_builtin + yapp_preproc_define_builtin, + yapp_preproc_add_standard }; From a1cd884de8f3b198b849d924ce0163ffc93773a4 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 9 May 2008 06:51:41 +0000 Subject: [PATCH 180/585] Fix #138: Incorrect UNW_FLAG_CHAININFO value (currently unused). svn path=/trunk/yasm/; revision=2083 --- modules/objfmts/coff/win64-except.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/objfmts/coff/win64-except.c b/modules/objfmts/coff/win64-except.c index ea703812..11ea4bde 100644 --- a/modules/objfmts/coff/win64-except.c +++ b/modules/objfmts/coff/win64-except.c @@ -34,7 +34,7 @@ #define UNW_FLAG_EHANDLER 0x01 #define UNW_FLAG_UHANDLER 0x02 -#define UNW_FLAG_CHAININFO 0x03 +#define UNW_FLAG_CHAININFO 0x04 /* Bytecode callback function prototypes */ static void win64_uwinfo_bc_destroy(void *contents); From deffd98d53c850665c8179fd22235ed789811986 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 9 May 2008 07:08:17 +0000 Subject: [PATCH 181/585] Commit moved, updated genmacro script missed in [2082] commit. svn path=/trunk/yasm/; revision=2084 --- tools/Makefile.inc | 2 + tools/genmacro/Makefile.inc | 15 ++++ tools/genmacro/genmacro.c | 134 ++++++++++++++++++++++++++++++++++++ 3 files changed, 151 insertions(+) create mode 100644 tools/genmacro/Makefile.inc create mode 100644 tools/genmacro/genmacro.c diff --git a/tools/Makefile.inc b/tools/Makefile.inc index 984578b9..0dd462c6 100644 --- a/tools/Makefile.inc +++ b/tools/Makefile.inc @@ -1,9 +1,11 @@ # $Id$ EXTRA_DIST += tools/re2c/Makefile.inc +EXTRA_DIST += tools/genmacro/Makefile.inc EXTRA_DIST += tools/genperf/Makefile.inc EXTRA_DIST += tools/python-yasm/Makefile.inc include tools/re2c/Makefile.inc +include tools/genmacro/Makefile.inc include tools/genperf/Makefile.inc include tools/python-yasm/Makefile.inc diff --git a/tools/genmacro/Makefile.inc b/tools/genmacro/Makefile.inc new file mode 100644 index 00000000..6232b9c4 --- /dev/null +++ b/tools/genmacro/Makefile.inc @@ -0,0 +1,15 @@ +# $Id$ + +# These utility programs have to be built for BUILD host in cross-build. +# This makes things rather non-standard automake + +noinst_PROGRAMS += genmacro + +genmacro_SOURCES = +EXTRA_DIST += tools/genmacro/genmacro.c +genmacro_LDADD = genmacro.$(OBJEXT) +genmacro_LINK = $(CCLD_FOR_BUILD) -o $@ + +genmacro.$(OBJEXT): tools/genmacro/genmacro.c + $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f tools/genmacro/genmacro.c || echo '$(srcdir)/'`tools/genmacro/genmacro.c + diff --git a/tools/genmacro/genmacro.c b/tools/genmacro/genmacro.c new file mode 100644 index 00000000..d3f4200a --- /dev/null +++ b/tools/genmacro/genmacro.c @@ -0,0 +1,134 @@ +/* $Id$ + * + * C version of NASM's macros.pl + * + * Copyright (C) 2004-2008 Peter Johnson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include +#include +#include + +#define MAXLINE 1024 + +int +main(int argc, char *argv[]) +{ + FILE *in, *out; + int i; + char *str; + char *strp; + char *charp; + int fline; + int line = 0; + int lindex = 0; + size_t len; + + if (argc < 4) { + fprintf(stderr, "Usage: %s [ ...]\n", argv[0]); + return EXIT_FAILURE; + } + + out = fopen(argv[1], "wt"); + + if (!out) { + fprintf(stderr, "Could not open `%s'.\n", argv[1]); + return EXIT_FAILURE; + } + + str = malloc(MAXLINE); + + fprintf(out, "/* This file auto-generated from standard.mac by genmacro.c" + " - don't edit it */\n\n#include \n\n" + "static const char *%s[] = {\n", argv[2]); + + for (i=3; i 0 && (strp[len-1] == ' ' || strp[len-1] == '\t' || + strp[len-1] == '\n')) { + strp[len-1] = '\0'; + len--; + } + + /* skip blank lines */ + if (len == 0) + continue; + + /* output as string to output file */ + fprintf(out, " \""); + while (*strp != '\0') { + if (*strp == '\\' || *strp == '"') + fputc('\\', out); + fputc(*strp, out); + strp++; + } + fprintf(out, "\",\n"); + lindex++; + } + + fclose(in); + } + + fprintf(out, " NULL\n};\n"); + fclose(out); + + free(str); + + return EXIT_SUCCESS; +} From 77aea19bc4c4f5cb9211677d89d333d57b118a81 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 13 May 2008 03:41:27 +0000 Subject: [PATCH 182/585] Fix handling of alloc_stack macro in GAS mode. Reported by: Brian Gladman svn path=/trunk/yasm/; revision=2086 --- modules/objfmts/coff/win64-gas.mac | 2 +- .../objfmts/win64/tests/gas/win64-gas-sce.hex | 40 +++++++++---------- 2 files changed, 19 insertions(+), 23 deletions(-) diff --git a/modules/objfmts/coff/win64-gas.mac b/modules/objfmts/coff/win64-gas.mac index cf1e7dc6..c8c36fbc 100644 --- a/modules/objfmts/coff/win64-gas.mac +++ b/modules/objfmts/coff/win64-gas.mac @@ -37,7 +37,7 @@ pushfq %endmacro %imacro alloc_stack 1 -subq %1, %rsp +subq $%1, %rsp .allocstack %1 %endmacro diff --git a/modules/objfmts/win64/tests/gas/win64-gas-sce.hex b/modules/objfmts/win64/tests/gas/win64-gas-sce.hex index ff4288f9..4721c514 100644 --- a/modules/objfmts/win64/tests/gas/win64-gas-sce.hex +++ b/modules/objfmts/win64/tests/gas/win64-gas-sce.hex @@ -6,7 +6,7 @@ 00 00 00 -ed +e9 00 00 00 @@ -34,7 +34,7 @@ ed 00 00 00 -1f +1b 00 00 00 @@ -66,7 +66,7 @@ ed 61 00 00 -1f +1b 00 00 00 @@ -78,7 +78,7 @@ ed 00 00 00 -ab +a7 00 00 00 @@ -106,7 +106,7 @@ ab 61 00 00 -37 +33 00 00 00 @@ -118,11 +118,11 @@ ab 00 00 00 -c3 +bf 00 00 00 -cf +cb 00 00 00 @@ -143,13 +143,9 @@ cf 48 9c 48 -2b -24 -25 +83 +ec 10 -00 -00 -00 48 89 74 @@ -170,24 +166,24 @@ e7 24 10 01 -1f +1b 0a 17 -1f +1b 73 -1a +16 73 -17 +13 1a -17 +13 78 02 00 -11 +0d 64 03 00 -0c +08 12 04 02 @@ -197,7 +193,7 @@ e7 00 00 00 -1f +1b 00 00 00 @@ -289,7 +285,7 @@ ff 00 03 01 -1f +1b 00 00 00 From 0fb038e9a18680dbaf2780e889e053142a4f9cea Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 13 May 2008 05:28:09 +0000 Subject: [PATCH 183/585] Bring Mkfiles up-to-date with genmacro/preproc changes. svn path=/trunk/yasm/; revision=2087 --- Mkfiles/Makefile.dj | 20 ++++++++++++++++---- Mkfiles/Makefile.flat | 20 ++++++++++++++++---- Mkfiles/vc/genmacro/genmacro.vcproj | 2 +- Mkfiles/vc/genmacro/run.bat | 5 ++++- Mkfiles/vc8/genmacro/genmacro.vcproj | 2 +- Mkfiles/vc8/genmacro/run.bat | 5 ++++- Mkfiles/vc9/genmacro/genmacro.vcproj | 2 +- Mkfiles/vc9/genmacro/run.bat | 5 ++++- 8 files changed, 47 insertions(+), 14 deletions(-) diff --git a/Mkfiles/Makefile.dj b/Mkfiles/Makefile.dj index 56afb281..ac10158e 100644 --- a/Mkfiles/Makefile.dj +++ b/Mkfiles/Makefile.dj @@ -157,13 +157,25 @@ license.c: COPYING genstring frontends/yasm/yasm.c: license.c -genmacro: modules/preprocs/nasm/genmacro.c +genmacro: tools/genmacro/genmacro.c $(BUILDCC) -o $@ $< -nasm-macros.c: modules/preprocs/nasm/standard.mac version.mac genmacro - ./genmacro modules/preprocs/nasm/standard.mac version.mac +nasm-version.c: version.mac genmacro + ./genmacro $@ nasm_version_mac version.mac -modules/preprocs/nasm/nasm-pp.c: nasm-macros.c +modules/preprocs/nasm/nasm-pp.c: nasm-version.c + +nasm-macros.c: modules/parsers/nasm/nasm-std.mac genmacro + ./genmacro $@ nasm_standard_mac modules/parsers/nasm/nasm-std.mac + +modules/parsers/nasm/nasm-parser.c: nasm-macros.c + +win64-nasm.c: modules/objfmts/coff/win64-nasm.mac genmacro + ./genmacro $@ win64_nasm_stdmac modules/objfmts/coff/win64-nasm.mac +win64-gas.c: modules/objfmts/coff/win64-gas.mac genmacro + ./genmacro $@ win64_gas_stdmac modules/objfmts/coff/win64-gas.mac + +modules/objfmts/coff/coff-objfmt.c: win64-nasm.c win64-gas.c genversion: modules/preprocs/nasm/genversion.c $(BUILDCC) -IMkfiles/dj -o $@ $< diff --git a/Mkfiles/Makefile.flat b/Mkfiles/Makefile.flat index 2dd1b56b..e9aec971 100644 --- a/Mkfiles/Makefile.flat +++ b/Mkfiles/Makefile.flat @@ -160,13 +160,25 @@ license.c: COPYING genstring frontends/yasm/yasm.c: license.c -genmacro: modules/preprocs/nasm/genmacro.c +genmacro: tools/genmacro/genmacro.c $(BUILDCC) -o $@ $< -nasm-macros.c: modules/preprocs/nasm/standard.mac version.mac genmacro - ./genmacro modules/preprocs/nasm/standard.mac version.mac +nasm-version.c: version.mac genmacro + ./genmacro $@ nasm_version_mac version.mac -modules/preprocs/nasm/nasm-pp.c: nasm-macros.c +modules/preprocs/nasm/nasm-pp.c: nasm-version.c + +nasm-macros.c: modules/parsers/nasm/nasm-std.mac genmacro + ./genmacro $@ nasm_standard_mac modules/parsers/nasm/nasm-std.mac + +modules/parsers/nasm/nasm-parser.c: nasm-macros.c + +win64-nasm.c: modules/objfmts/coff/win64-nasm.mac genmacro + ./genmacro $@ win64_nasm_stdmac modules/objfmts/coff/win64-nasm.mac +win64-gas.c: modules/objfmts/coff/win64-gas.mac genmacro + ./genmacro $@ win64_gas_stdmac modules/objfmts/coff/win64-gas.mac + +modules/objfmts/coff/coff-objfmt.c: win64-nasm.c win64-gas.c genversion: modules/preprocs/nasm/genversion.c $(BUILDCC) -IMkfiles -I. -o $@ $< diff --git a/Mkfiles/vc/genmacro/genmacro.vcproj b/Mkfiles/vc/genmacro/genmacro.vcproj index 0f18b4bd..6ca8a82c 100644 --- a/Mkfiles/vc/genmacro/genmacro.vcproj +++ b/Mkfiles/vc/genmacro/genmacro.vcproj @@ -116,7 +116,7 @@ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx" UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"> + RelativePath="..\..\..\tools\genmacro\genmacro.c"> diff --git a/Mkfiles/vc8/genmacro/run.bat b/Mkfiles/vc8/genmacro/run.bat index f3323e72..d2fbb98c 100644 --- a/Mkfiles/vc8/genmacro/run.bat +++ b/Mkfiles/vc8/genmacro/run.bat @@ -1,2 +1,5 @@ cd ..\..\.. -%1 modules\preprocs\nasm\standard.mac version.mac +%1 nasm-version.c nasm_version_mac version.mac +%1 nasm-macros.c nasm_standard_mac modules\parsers\nasm\nasm-std.mac +%1 win64-nasm.c win64_nasm_stdmac modules\objfmts\coff\win64-nasm.mac +%1 win64-gas.c win64_gas_stdmac modules\objfmts\coff\win64-gas.mac diff --git a/Mkfiles/vc9/genmacro/genmacro.vcproj b/Mkfiles/vc9/genmacro/genmacro.vcproj index 2213150e..e6980bc1 100644 --- a/Mkfiles/vc9/genmacro/genmacro.vcproj +++ b/Mkfiles/vc9/genmacro/genmacro.vcproj @@ -186,7 +186,7 @@ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" > diff --git a/Mkfiles/vc9/genmacro/run.bat b/Mkfiles/vc9/genmacro/run.bat index f3323e72..d2fbb98c 100644 --- a/Mkfiles/vc9/genmacro/run.bat +++ b/Mkfiles/vc9/genmacro/run.bat @@ -1,2 +1,5 @@ cd ..\..\.. -%1 modules\preprocs\nasm\standard.mac version.mac +%1 nasm-version.c nasm_version_mac version.mac +%1 nasm-macros.c nasm_standard_mac modules\parsers\nasm\nasm-std.mac +%1 win64-nasm.c win64_nasm_stdmac modules\objfmts\coff\win64-nasm.mac +%1 win64-gas.c win64_gas_stdmac modules\objfmts\coff\win64-gas.mac From a72cc83b3ca66fef496325032f461c58b180d37e Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 14 May 2008 03:32:20 +0000 Subject: [PATCH 184/585] Add westmere CPU (supports AES and CLMUL), redefine sandybridge to add AVX (FMA won't appear until the 22nm shrink of sandybridge). Reported by: nasm64developer@users.sf.net svn path=/trunk/yasm/; revision=2088 --- modules/arch/x86/x86cpu.gperf | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/arch/x86/x86cpu.gperf b/modules/arch/x86/x86cpu.gperf index 83e29b5a..526e1569 100644 --- a/modules/arch/x86/x86cpu.gperf +++ b/modules/arch/x86/x86cpu.gperf @@ -47,7 +47,8 @@ RCSID("$Id$"); #define PROC_conroe 11 #define PROC_penryn 12 #define PROC_nehalem 13 -#define PROC_sandybridge 14 +#define PROC_westmere 14 +#define PROC_sandybridge 15 static void x86_cpu_intel(wordptr cpu, unsigned int data) @@ -59,9 +60,9 @@ x86_cpu_intel(wordptr cpu, unsigned int data) BitVector_Bit_On(cpu, CPU_Prot); if (data >= PROC_386) BitVector_Bit_On(cpu, CPU_SMM); - if (data >= PROC_sandybridge) { + if (data >= PROC_sandybridge) BitVector_Bit_On(cpu, CPU_AVX); - BitVector_Bit_On(cpu, CPU_FMA); + if (data >= PROC_westmere) { BitVector_Bit_On(cpu, CPU_AES); BitVector_Bit_On(cpu, CPU_CLMUL); } @@ -273,6 +274,7 @@ conroe, x86_cpu_intel, PROC_conroe core2, x86_cpu_intel, PROC_conroe penryn, x86_cpu_intel, PROC_penryn nehalem, x86_cpu_intel, PROC_nehalem +westmere, x86_cpu_intel, PROC_westmere sandybridge, x86_cpu_intel, PROC_sandybridge # # Features have "no" versions to disable them, and only set/reset the From 3d8a8f577c0c9c002a54fed7e3868d91dea03ee6 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 15 May 2008 06:55:57 +0000 Subject: [PATCH 185/585] Make ISO C89 compliant (too long constant string, use of // comment). svn path=/trunk/yasm/; revision=2096 --- tools/re2c/main.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tools/re2c/main.c b/tools/re2c/main.c index f0baaf61..94843160 100644 --- a/tools/re2c/main.c +++ b/tools/re2c/main.c @@ -45,20 +45,23 @@ static void usage() "-? -h --help Display this info.\n" "\n" "-b --bit-vectors Implies -s. Use bit vectors as well in the attempt to\n" - " coax better code out of the compiler. Most useful for\n" + " coax better code out of the compiler. Most useful for\n"); + fprintf(stderr, " specifications with more than a few keywords (e.g. for\n" " most programming languages).\n" "\n" "-e --ecb Cross-compile from an ASCII platform to\n" " an EBCDIC one.\n" - "\n" + "\n"); + fprintf(stderr, "-s --nested-ifs Generate nested ifs for some switches. Many compilers\n" " need this assist to generate better code.\n" "\n" "-f --storable-state Generate a scanner with support for storable state\n" "\n" "-o --output=output Specify the output file instead of stdout\n" - "\n" + "\n"); + fprintf(stderr, "-d --debug-output Creates a parser that dumps information during\n" " about the current position and in which state the\n" " parser is.\n" @@ -159,7 +162,7 @@ int main(int argc, char *argv[]) } } - // set up the output stream + /* set up the output stream */ if (outputFileName == 0 || (fileName[0] == '-' && fileName[1] == '\0')) { outputFileName = mystrdup(""); output = stdout; From 811d7ad566a3e7df758c47d4f11dcf4ea82a403d Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 22 May 2008 08:37:32 +0000 Subject: [PATCH 186/585] Make util.h more robust against use without config.h by moving the toascii redefinition to the only file that uses it, errwarn.c. svn path=/trunk/yasm/; revision=2097 --- libyasm/errwarn.c | 4 ++++ util.h | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libyasm/errwarn.c b/libyasm/errwarn.c index 64b2f9eb..26d7f072 100644 --- a/libyasm/errwarn.c +++ b/libyasm/errwarn.c @@ -38,6 +38,10 @@ #define MSG_MAXSIZE 1024 +#if !defined(HAVE_TOASCII) || defined(lint) +# define toascii(c) ((c) & 0x7F) +#endif + /* Default handlers for replacable functions */ static /*@exits@*/ void def_internal_error_ (const char *file, unsigned int line, const char *message); diff --git a/util.h b/util.h index f19792e8..f1886a23 100644 --- a/util.h +++ b/util.h @@ -116,10 +116,6 @@ # define USE_OUR_OWN_STRCASECMP #endif -#if !defined(HAVE_TOASCII) || defined(lint) -# define toascii(c) ((c) & 0x7F) -#endif - #include #ifdef HAVE_SYS_CDEFS_H From b7f2fbc64fcfe8e30650a32e3354613aceaceb0c Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 22 May 2008 09:08:03 +0000 Subject: [PATCH 187/585] Add cmake build infrastructure. Not default nor even distributed in the .tar.gz, the cmake build allows for loadable yasm plugins by building libyasm as a shared library. Example plugins are in the plugins/ directory, and may be loaded into a cmake-built yasm using the -N command line option (non-cmake builds will not have this option). Tested only on Linux so far, but should be relatively painless to port to Windows thanks to the use of cmake rather than libtool to create shared libraries. The only modification to the main source tree is some conditional-compiled additions to yasm.c. svn path=/trunk/yasm/; revision=2098 --- CMakeLists.txt | 47 +++++++ ConfigureChecks.cmake | 70 ++++++++++ cmake/CMakeLists.txt | 1 + cmake/modules/CMakeLists.txt | 2 + cmake/modules/DummyCFile.c | 4 + cmake/modules/YasmMacros.cmake | 89 ++++++++++++ config.h.cmake | 51 +++++++ frontends/CMakeLists.txt | 1 + frontends/yasm/CMakeLists.txt | 26 ++++ frontends/yasm/genstring.py | 41 ++++++ frontends/yasm/yasm-plugin.c | 119 ++++++++++++++++ frontends/yasm/yasm-plugin.h | 34 +++++ frontends/yasm/yasm.c | 53 +++++-- libyasm-stdint.h.cmake | 20 +++ libyasm/CMakeLists.txt | 70 ++++++++++ libyasm/cmake-module.c | 127 +++++++++++++++++ modules/CMakeLists.txt | 89 ++++++++++++ modules/arch/CMakeLists.txt | 2 + modules/arch/lc3b/CMakeLists.txt | 11 ++ modules/arch/x86/CMakeLists.txt | 50 +++++++ modules/dbgfmts/CMakeLists.txt | 4 + modules/dbgfmts/codeview/CMakeLists.txt | 5 + modules/dbgfmts/dwarf2/CMakeLists.txt | 6 + modules/dbgfmts/null/CMakeLists.txt | 3 + modules/dbgfmts/stabs/CMakeLists.txt | 3 + modules/listfmts/CMakeLists.txt | 1 + modules/listfmts/nasm/CMakeLists.txt | 3 + modules/objfmts/CMakeLists.txt | 9 ++ modules/objfmts/bin/CMakeLists.txt | 3 + modules/objfmts/coff/CMakeLists.txt | 27 ++++ modules/objfmts/dbg/CMakeLists.txt | 3 + modules/objfmts/elf/CMakeLists.txt | 8 ++ modules/objfmts/macho/CMakeLists.txt | 5 + modules/objfmts/rdf/CMakeLists.txt | 3 + modules/objfmts/xdf/CMakeLists.txt | 3 + modules/parsers/CMakeLists.txt | 2 + modules/parsers/gas/CMakeLists.txt | 11 ++ modules/parsers/nasm/CMakeLists.txt | 21 +++ modules/preprocs/CMakeLists.txt | 3 + modules/preprocs/cpp/CMakeLists.txt | 3 + modules/preprocs/nasm/CMakeLists.txt | 25 ++++ modules/preprocs/raw/CMakeLists.txt | 3 + plugins/README | 20 +++ plugins/dbg/CMakeLists.txt | 45 ++++++ plugins/dbg/README | 15 ++ plugins/dbg/dbg-objfmt.c | 175 ++++++++++++++++++++++++ plugins/dbg/init_plugin.c | 13 ++ plugins/x86/CMakeLists.txt | 117 ++++++++++++++++ plugins/x86/README | 10 ++ plugins/x86/init_plugin.c | 13 ++ tools/CMakeLists.txt | 3 + tools/genmacro/CMakeLists.txt | 3 + tools/genperf/CMakeLists.txt | 7 + tools/re2c/CMakeLists.txt | 11 ++ 54 files changed, 1483 insertions(+), 10 deletions(-) create mode 100644 CMakeLists.txt create mode 100644 ConfigureChecks.cmake create mode 100644 cmake/CMakeLists.txt create mode 100644 cmake/modules/CMakeLists.txt create mode 100644 cmake/modules/DummyCFile.c create mode 100644 cmake/modules/YasmMacros.cmake create mode 100644 config.h.cmake create mode 100644 frontends/CMakeLists.txt create mode 100644 frontends/yasm/CMakeLists.txt create mode 100755 frontends/yasm/genstring.py create mode 100644 frontends/yasm/yasm-plugin.c create mode 100644 frontends/yasm/yasm-plugin.h create mode 100644 libyasm-stdint.h.cmake create mode 100644 libyasm/CMakeLists.txt create mode 100644 libyasm/cmake-module.c create mode 100644 modules/CMakeLists.txt create mode 100644 modules/arch/CMakeLists.txt create mode 100644 modules/arch/lc3b/CMakeLists.txt create mode 100644 modules/arch/x86/CMakeLists.txt create mode 100644 modules/dbgfmts/CMakeLists.txt create mode 100644 modules/dbgfmts/codeview/CMakeLists.txt create mode 100644 modules/dbgfmts/dwarf2/CMakeLists.txt create mode 100644 modules/dbgfmts/null/CMakeLists.txt create mode 100644 modules/dbgfmts/stabs/CMakeLists.txt create mode 100644 modules/listfmts/CMakeLists.txt create mode 100644 modules/listfmts/nasm/CMakeLists.txt create mode 100644 modules/objfmts/CMakeLists.txt create mode 100644 modules/objfmts/bin/CMakeLists.txt create mode 100644 modules/objfmts/coff/CMakeLists.txt create mode 100644 modules/objfmts/dbg/CMakeLists.txt create mode 100644 modules/objfmts/elf/CMakeLists.txt create mode 100644 modules/objfmts/macho/CMakeLists.txt create mode 100644 modules/objfmts/rdf/CMakeLists.txt create mode 100644 modules/objfmts/xdf/CMakeLists.txt create mode 100644 modules/parsers/CMakeLists.txt create mode 100644 modules/parsers/gas/CMakeLists.txt create mode 100644 modules/parsers/nasm/CMakeLists.txt create mode 100644 modules/preprocs/CMakeLists.txt create mode 100644 modules/preprocs/cpp/CMakeLists.txt create mode 100644 modules/preprocs/nasm/CMakeLists.txt create mode 100644 modules/preprocs/raw/CMakeLists.txt create mode 100644 plugins/README create mode 100644 plugins/dbg/CMakeLists.txt create mode 100644 plugins/dbg/README create mode 100644 plugins/dbg/dbg-objfmt.c create mode 100644 plugins/dbg/init_plugin.c create mode 100644 plugins/x86/CMakeLists.txt create mode 100644 plugins/x86/README create mode 100644 plugins/x86/init_plugin.c create mode 100644 tools/CMakeLists.txt create mode 100644 tools/genmacro/CMakeLists.txt create mode 100644 tools/genperf/CMakeLists.txt create mode 100644 tools/re2c/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..bc49eeec --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,47 @@ +PROJECT(yasm) +CMAKE_MINIMUM_REQUIRED(VERSION 2.4) + +SET(BUILD_SHARED_LIBS ON) + +# Where to look first for cmake modules +set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules") + +INCLUDE(YasmMacros) + +OPTION(ENABLE_NLS "Enable message translations" OFF) + +OPTION(YASM_BUILD_TESTS "Enable building of tests" ON) + +IF(YASM_BUILD_TESTS) + ENABLE_TESTING() +ENDIF(YASM_BUILD_TESTS) + +# Default build type to debug if not set +IF(NOT CMAKE_BUILD_TYPE) + SET(CMAKE_BUILD_TYPE Debug CACHE STRING + "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." + FORCE) +ENDIF(NOT CMAKE_BUILD_TYPE) + +set (YASM_VERSION_MAJOR 0) +set (YASM_VERSION_MINOR 6) +set (YASM_VERSION_SUBMINOR 99) +set (PACKAGE_INTVER "${YASM_VERSION_MAJOR}.${YASM_VERSION_MINOR}.${YASM_VERSION_SUBMINOR}") +set (PACKAGE_BUILD "HEAD") +set (PACKAGE_VERSION ${PACKAGE_BUILD}) +set (PACKAGE_STRING "yasm ${PACKAGE_VERSION}") + +INCLUDE_DIRECTORIES(BEFORE ${CMAKE_BINARY_DIR} ${yasm_SOURCE_DIR}) + +INCLUDE(ConfigureChecks.cmake) + +ADD_SUBDIRECTORY(tools) +ADD_SUBDIRECTORY(libyasm) +ADD_SUBDIRECTORY(modules) +ADD_SUBDIRECTORY(frontends) + +INSTALL(FILES + libyasm.h + ${CMAKE_BINARY_DIR}/libyasm-stdint.h + DESTINATION include + ) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake new file mode 100644 index 00000000..05a3523f --- /dev/null +++ b/ConfigureChecks.cmake @@ -0,0 +1,70 @@ +INCLUDE(CheckCSourceCompiles) +INCLUDE(CheckCCompilerFlag) +INCLUDE(CheckFunctionExists) +INCLUDE(CheckIncludeFile) +INCLUDE(CheckSymbolExists) +INCLUDE(CheckTypeSize) +INCLUDE(CheckLibraryExists) + +FIND_PROGRAM(CPP_PROG NAMES cpp) + +# Platform-specific include files (POSIX, Win32) +CHECK_INCLUDE_FILE(locale.h HAVE_LOCALE_H) +CHECK_INCLUDE_FILE(libgen.h HAVE_LIBGEN_H) +CHECK_INCLUDE_FILE(unistd.h HAVE_UNISTD_H) +CHECK_INCLUDE_FILE(direct.h HAVE_DIRECT_H) +CHECK_INCLUDE_FILE(stdint.h HAVE_STDINT_H) + +CHECK_SYMBOL_EXISTS(abort "stdlib.h" HAVE_ABORT) + +CHECK_FUNCTION_EXISTS(getcwd HAVE_GETCWD) +CHECK_FUNCTION_EXISTS(toascii HAVE_TOASCII) + +CHECK_LIBRARY_EXISTS(dl dlopen "" HAVE_LIBDL) + +IF (HAVE_LIBDL) + SET(LIBDL "dl") +ELSE (HAVE_LIBDL) + SET(LIBDL "") +ENDIF (HAVE_LIBDL) + +CONFIGURE_FILE(libyasm-stdint.h.cmake + ${CMAKE_CURRENT_BINARY_DIR}/libyasm-stdint.h) +CONFIGURE_FILE(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) + +ADD_DEFINITIONS(-DHAVE_CONFIG_H) +INCLUDE(FindPythonInterp) + +IF (CMAKE_COMPILER_IS_GNUCXX) + CHECK_C_COMPILER_FLAG(-pipe C_ACCEPTS_PIPE) + CHECK_C_COMPILER_FLAG(-ansi C_ACCEPTS_ANSI) + CHECK_C_COMPILER_FLAG(-pedantic C_ACCEPTS_PEDANTIC) + CHECK_C_COMPILER_FLAG(-Wall C_ACCEPTS_WALL) + CHECK_C_COMPILER_FLAG(-Wno-unused-parameter C_ACCEPTS_WNOUNUSEDPARAM) + + IF (C_ACCEPTS_PIPE) + ADD_DEFINITIONS(-pipe) + ENDIF (C_ACCEPTS_PIPE) + + IF (C_ACCEPTS_ANSI) + ADD_DEFINITIONS(-ansi) + ENDIF (C_ACCEPTS_ANSI) + + IF (C_ACCEPTS_PEDANTIC) + ADD_DEFINITIONS(-pedantic) + ENDIF (C_ACCEPTS_PEDANTIC) + + IF (C_ACCEPTS_WALL) + ADD_DEFINITIONS(-Wall) + ENDIF (C_ACCEPTS_WALL) + + IF (C_ACCEPTS_WNOUNUSEDPARAM) + ADD_DEFINITIONS(-Wno-unused-parameter) + ENDIF (C_ACCEPTS_WNOUNUSEDPARAM) +ENDIF (CMAKE_COMPILER_IS_GNUCXX) + +# Disable some annoying Visual Studio warnings +IF (MSVC) + ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS) + ADD_DEFINITIONS(-D_CRT_NONSTDC_NO_WARNINGS) +ENDIF (MSVC) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt new file mode 100644 index 00000000..5e4ef796 --- /dev/null +++ b/cmake/CMakeLists.txt @@ -0,0 +1 @@ +ADD_SUBDIRECTORY(modules) diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt new file mode 100644 index 00000000..e4351fc9 --- /dev/null +++ b/cmake/modules/CMakeLists.txt @@ -0,0 +1,2 @@ +FILE(GLOB cmakeFiles "${CMAKE_CURRENT_SOURCE_DIR}/*.cmake") + diff --git a/cmake/modules/DummyCFile.c b/cmake/modules/DummyCFile.c new file mode 100644 index 00000000..f8b643af --- /dev/null +++ b/cmake/modules/DummyCFile.c @@ -0,0 +1,4 @@ +int main() +{ + return 0; +} diff --git a/cmake/modules/YasmMacros.cmake b/cmake/modules/YasmMacros.cmake new file mode 100644 index 00000000..ab1be00e --- /dev/null +++ b/cmake/modules/YasmMacros.cmake @@ -0,0 +1,89 @@ +# Portions based on kdelibs KDE4Macros.cmake: +# +# Copyright (c) 2006, 2007, Alexander Neundorf, +# Copyright (c) 2006, 2007, Laurent Montel, +# Copyright (c) 2007 Matthias Kretz +# +# Redistribution and use is allowed according to the terms of the BSD license. +# +# Changes for Yasm Copyright (c) 2007 Peter Johnson + +# add a unit test, which is executed when running make test +# it will be built with RPATH pointing to the build dir +# The targets are always created, but only built for the "all" +# target if the option YASM_BUILD_TESTS is enabled. Otherwise the rules for +# the target are created but not built by default. You can build them by +# manually building the target. +# The name of the target can be specified using TESTNAME , if it is +# not given the macro will default to the +macro (YASM_ADD_UNIT_TEST _test_NAME) + set(_srcList ${ARGN}) + set(_targetName ${_test_NAME}) + if( ${ARGV1} STREQUAL "TESTNAME" ) + set(_targetName ${ARGV2}) + LIST(REMOVE_AT _srcList 0 1) + endif( ${ARGV1} STREQUAL "TESTNAME" ) + yasm_add_test_executable( ${_test_NAME} ${_srcList} ) + add_test( ${_targetName} ${EXECUTABLE_OUTPUT_PATH}/${_test_NAME} ) +endmacro (YASM_ADD_UNIT_TEST) + +# add an test executable +# it will be built with RPATH pointing to the build dir +# The targets are always created, but only built for the "all" +# target if the option YASM_BUILD_TESTS is enabled. Otherwise the rules for +# the target are created but not built by default. You can build them by +# manually building the target. +macro (YASM_ADD_TEST_EXECUTABLE _target_NAME) + + set(_add_executable_param) + + if (NOT YASM_BUILD_TESTS) + set(_add_executable_param EXCLUDE_FROM_ALL) + endif (NOT YASM_BUILD_TESTS) + + set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} ) + + set(_SRCS ${ARGN}) + add_executable(${_target_NAME} ${_add_executable_param} ${_SRCS}) + + set_target_properties(${_target_NAME} PROPERTIES + SKIP_BUILD_RPATH FALSE + BUILD_WITH_INSTALL_RPATH FALSE) + +endmacro (YASM_ADD_TEST_EXECUTABLE) + +macro (YASM_ADD_MODULE _module_NAME) + list(APPEND YASM_MODULES_SRC ${ARGN}) + list(APPEND YASM_MODULES ${_module_NAME}) +endmacro (YASM_ADD_MODULE) + +macro (YASM_GENPERF _in_NAME _out_NAME) + get_target_property(_tmp_GENPERF_EXE genperf LOCATION) + add_custom_command( + OUTPUT ${_out_NAME} + COMMAND ${_tmp_GENPERF_EXE} ${_in_NAME} ${_out_NAME} + DEPENDS ${_tmp_GENPERF_EXE} + MAIN_DEPENDENCY ${_in_NAME} + ) +endmacro (YASM_GENPERF) + +macro (YASM_RE2C _in_NAME _out_NAME) + get_target_property(_tmp_RE2C_EXE re2c LOCATION) + add_custom_command( + OUTPUT ${_out_NAME} + COMMAND ${_tmp_RE2C_EXE} ${ARGN} -o ${_out_NAME} ${_in_NAME} + DEPENDS ${_tmp_RE2C_EXE} + MAIN_DEPENDENCY ${_in_NAME} + ) +endmacro (YASM_RE2C) + +macro (YASM_GENMACRO _in_NAME _out_NAME _var_NAME) + get_target_property(_tmp_GENMACRO_EXE genmacro LOCATION) + add_custom_command( + OUTPUT ${_out_NAME} + COMMAND ${_tmp_GENMACRO_EXE} ${_out_NAME} ${_var_NAME} ${_in_NAME} + DEPENDS ${_tmp_GENMACRO_EXE} + MAIN_DEPENDENCY ${_in_NAME} + ) +endmacro (YASM_GENMACRO) + diff --git a/config.h.cmake b/config.h.cmake new file mode 100644 index 00000000..d282b931 --- /dev/null +++ b/config.h.cmake @@ -0,0 +1,51 @@ +/* config.h. Generated by cmake from config.h.cmake */ + +#define CMAKE_BUILD 1 + +/* Define if messsage translations are enabled */ +#cmakedefine ENABLE_NLS 1 + +/* */ +#undef HAVE_GETTEXT + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_LIBGEN_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_UNISTD_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_DIRECT_H 1 + +/* Define to 1 if you have the `getcwd' function. */ +#cmakedefine HAVE_GETCWD 1 + +/* Define to 1 if you have the `toascii' function. */ +#cmakedefine HAVE_TOASCII 1 + +/* Name of package */ +#define PACKAGE "yasm" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "bug-yasm@tortall.net" + +/* Define to internal version of this package. */ +#define PACKAGE_INTVER "@PACKAGE_INTVER@" + +/* Define to build version of this package. */ +#define PACKAGE_BUILD "@PACKAGE_BUILD@" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "yasm" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "@PACKAGE_STRING@" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "@PACKAGE_VERSION@" + +#define VERSION PACKAGE_VERSION + +/* Command name to run C preprocessor */ +#define CPP_PROG "@CPP_PROG@" + diff --git a/frontends/CMakeLists.txt b/frontends/CMakeLists.txt new file mode 100644 index 00000000..b8b55d2d --- /dev/null +++ b/frontends/CMakeLists.txt @@ -0,0 +1 @@ +ADD_SUBDIRECTORY(yasm) diff --git a/frontends/yasm/CMakeLists.txt b/frontends/yasm/CMakeLists.txt new file mode 100644 index 00000000..6d963eb4 --- /dev/null +++ b/frontends/yasm/CMakeLists.txt @@ -0,0 +1,26 @@ +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) + +ADD_CUSTOM_COMMAND( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/license.c + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/genstring.py + license_msg + ${CMAKE_CURRENT_BINARY_DIR}/license.c + ${CMAKE_SOURCE_DIR}/COPYING + MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/COPYING + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/genstring.py + ) + +SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}) + +ADD_EXECUTABLE(yasm + yasm.c + yasm-options.c + yasm-plugin.c + ) +TARGET_LINK_LIBRARIES(yasm libyasm ${LIBDL}) + +SET_SOURCE_FILES_PROPERTIES(yasm.c PROPERTIES + OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/license.c + ) + +INSTALL(TARGETS yasm RUNTIME DESTINATION bin) diff --git a/frontends/yasm/genstring.py b/frontends/yasm/genstring.py new file mode 100755 index 00000000..96f49d9f --- /dev/null +++ b/frontends/yasm/genstring.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python +# Generate array-of-const-string from text file. +# +# Copyright (C) 2006-2007 Peter Johnson +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. + +def file_to_string(fout, str_name, fin_name): + from os.path import basename + print >>fout, "/* This file auto-generated from %s by genstring.py - don't edit it */\n" % basename(fin_name) + print >>fout, "static const char* %s[] = {" % str_name + print >>fout, "\n".join(' "%s",' % + l.strip().replace('\\', '\\\\').replace('"', '\\"') + for l in open(fin_name)) + print >>fout, "};" + +if __name__ == "__main__": + import sys + if len(sys.argv) != 4: + print >>sys.stderr, "Usage: genstring.py " + sys.exit(2) + file_to_string(open(sys.argv[2], "w"), sys.argv[1], sys.argv[3]) diff --git a/frontends/yasm/yasm-plugin.c b/frontends/yasm/yasm-plugin.c new file mode 100644 index 00000000..55b3f75d --- /dev/null +++ b/frontends/yasm/yasm-plugin.c @@ -0,0 +1,119 @@ +/* + * Semi-portable (Windows and Unix) plugin loading + * + * Copyright (C) 2008 Peter Johnson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include +/*@unused@*/ RCSID("$Id$"); + +#include + +#include "yasm-plugin.h" + +#if defined(_MSC_VER) +#include +#elif defined(__GNUC__) +#include +#endif + +static void **loaded_plugins = NULL; +static int num_loaded_plugins = 0; + +static void * +load_dll(const char *name) +{ +#if defined(_MSC_VER) + return LoadLibrary(name); +#elif defined(__GNUC__) + return dlopen(name, RTLD_NOW); +#else + return NULL; +#endif +} + +int +load_plugin(const char *name) +{ + char *path; + void *lib = NULL; + void (*init_plugin) (void) = NULL; + + /* Load library */ + + path = yasm_xmalloc(strlen(name)+5); + strcpy(path, name); +#if defined(_MSC_VER) + strcat(path, ".dll"); + lib = load_dll(path); +#elif defined(__GNUC__) + strcat(path, ".so"); + lib = load_dll(path); +#endif + yasm_xfree(path); + if (!lib) + lib = load_dll(name); + + if (!lib) + return 0; /* Didn't load successfully */ + + /* Add to array of loaded plugins */ + loaded_plugins = + yasm_xrealloc(loaded_plugins, (num_loaded_plugins+1)*sizeof(void *)); + loaded_plugins[num_loaded_plugins] = lib; + num_loaded_plugins++; + + /* Get yasm_init_plugin() function and run it */ + +#if defined(_MSC_VER) + init_plugin = + (void (*)(void))GetProcAddress((HINSTANCE)lib, "yasm_init_plugin"); +#elif defined(__GNUC__) + init_plugin = (void (*)(void))dlsym(lib, "yasm_init_plugin"); +#endif + + if (!init_plugin) + return 0; /* Didn't load successfully */ + + init_plugin(); + return 1; +} + +void +unload_plugins(void) +{ + int i; + + if (!loaded_plugins) + return; + + for (i = 0; i < num_loaded_plugins; i++) { +#if defined(_MSC_VER) + FreeLibrary((HINSTANCE)loaded_plugins[i]); +#elif defined(__GNUC__) + dlclose(loaded_plugins[i]); +#endif + } + yasm_xfree(loaded_plugins); + num_loaded_plugins = 0; +} diff --git a/frontends/yasm/yasm-plugin.h b/frontends/yasm/yasm-plugin.h new file mode 100644 index 00000000..efb1bf51 --- /dev/null +++ b/frontends/yasm/yasm-plugin.h @@ -0,0 +1,34 @@ +/* + * Semi-portable (Windows and Unix) plugin loading + * + * Copyright (C) 2008 Peter Johnson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef YASM_PLUGIN_H +#define YASM_PLUGIN_H + +/* Load a plugin. Returns 0 on failure. */ +int load_plugin(const char *name); +void unload_plugins(void); + +#endif diff --git a/frontends/yasm/yasm.c b/frontends/yasm/yasm.c index b5f47080..bf3121f2 100644 --- a/frontends/yasm/yasm.c +++ b/frontends/yasm/yasm.c @@ -38,6 +38,10 @@ #include "yasm-options.h" +#ifdef CMAKE_BUILD +#include "yasm-plugin.h" +#endif + #include "license.c" /* Preprocess-only buffer size */ @@ -102,6 +106,9 @@ static int opt_include_option(char *cmd, /*@null@*/ char *param, int extra); static int opt_preproc_option(char *cmd, /*@null@*/ char *param, int extra); static int opt_ewmsg_handler(char *cmd, /*@null@*/ char *param, int extra); static int opt_makedep_handler(char *cmd, /*@null@*/ char *param, int extra); +#ifdef CMAKE_BUILD +static int opt_plugin_handler(char *cmd, /*@null@*/ char *param, int extra); +#endif static /*@only@*/ char *replace_extension(const char *orig, /*@null@*/ const char *ext, const char *def); @@ -189,6 +196,10 @@ static opt_option options[] = N_("undefine a macro"), N_("macro") }, { 'X', NULL, 1, opt_ewmsg_handler, 0, N_("select error/warning message style (`gnu' or `vc')"), N_("style") }, +#ifdef CMAKE_BUILD + { 'N', "plugin", 1, opt_plugin_handler, 0, + N_("load plugin module"), N_("plugin") }, +#endif }; /* version message */ @@ -560,6 +571,24 @@ main(int argc, char *argv[]) yasm_gettext_hook = handle_yasm_gettext; yasm_errwarn_initialize(); + /* Initialize BitVector (needed for intnum/floatnum). */ + if (BitVector_Boot() != ErrCode_Ok) { + print_error(_("%s: could not initialize BitVector"), _("FATAL")); + return EXIT_FAILURE; + } + + /* Initialize intnum and floatnum */ + yasm_intnum_initialize(); + yasm_floatnum_initialize(); + +#ifdef CMAKE_BUILD + /* Load standard modules */ + if (!load_plugin("libyasmstd")) { + print_error(_("%s: could not load standard modules"), _("FATAL")); + return EXIT_FAILURE; + } +#endif + /* Initialize parameter storage */ STAILQ_INIT(&preproc_options); @@ -591,16 +620,6 @@ main(int argc, char *argv[]) return EXIT_FAILURE; } - /* Initialize BitVector (needed for intnum/floatnum). */ - if (BitVector_Boot() != ErrCode_Ok) { - print_error(_("%s: could not initialize BitVector"), _("FATAL")); - return EXIT_FAILURE; - } - - /* Initialize intnum and floatnum */ - yasm_intnum_initialize(); - yasm_floatnum_initialize(); - /* If not already specified, default to bin as the object format. */ if (!cur_objfmt_module) { if (!objfmt_keyword) @@ -764,6 +783,9 @@ cleanup(yasm_object *object) if (errfile != stderr && errfile != stdout) fclose(errfile); +#ifdef CMAKE_BUILD + unload_plugins(); +#endif } /* @@ -1118,6 +1140,17 @@ opt_makedep_handler(/*@unused@*/ char *cmd, /*@unused@*/ char *param, return 0; } +#ifdef CMAKE_BUILD +static int +opt_plugin_handler(/*@unused@*/ char *cmd, char *param, + /*@unused@*/ int extra) +{ + if (!load_plugin(param)) + print_error(_("warning: could not load plugin `%s'"), param); + return 0; +} +#endif + static void apply_preproc_builtins() { diff --git a/libyasm-stdint.h.cmake b/libyasm-stdint.h.cmake new file mode 100644 index 00000000..261a6182 --- /dev/null +++ b/libyasm-stdint.h.cmake @@ -0,0 +1,20 @@ +#cmakedefine HAVE_STDINT_H + +#ifdef HAVE_STDINT_H +#include +#elif defined(_MSC_VER) + +#ifndef _UINTPTR_T_DEFINED +#ifdef _WIN64 +#include +#else +typedef unsigned long uintptr_t; +#endif +#define _UINTPTR_T_DEFINED +#endif + +#else +typedef unsigned long uintptr_t; +#endif + +#undef HAVE_STDINT_H diff --git a/libyasm/CMakeLists.txt b/libyasm/CMakeLists.txt new file mode 100644 index 00000000..8be337e5 --- /dev/null +++ b/libyasm/CMakeLists.txt @@ -0,0 +1,70 @@ +SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}) + +ADD_LIBRARY(libyasm SHARED + assocdat.c + bitvect.c + bc-align.c + bc-data.c + bc-incbin.c + bc-org.c + bc-reserve.c + bytecode.c + cmake-module.c + errwarn.c + expr.c + file.c + floatnum.c + hamt.c + insn.c + intnum.c + inttree.c + linemap.c + md5.c + mergesort.c + phash.c + section.c + strcasecmp.c + strsep.c + symrec.c + valparam.c + value.c + xmalloc.c + xstrdup.c + ) +SET_TARGET_PROPERTIES(libyasm PROPERTIES OUTPUT_NAME "yasm") + +INSTALL(TARGETS libyasm + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + ) + +INSTALL(FILES + arch.h + assocdat.h + bitvect.h + bytecode.h + compat-queue.h + coretype.h + dbgfmt.h + errwarn.h + expr.h + file.h + floatnum.h + hamt.h + insn.h + intnum.h + inttree.h + linemap.h + listfmt.h + md5.h + module.h + objfmt.h + parser.h + phash.h + preproc.h + section.h + symrec.h + valparam.h + value.h + DESTINATION include/libyasm + ) diff --git a/libyasm/cmake-module.c b/libyasm/cmake-module.c new file mode 100644 index 00000000..85309946 --- /dev/null +++ b/libyasm/cmake-module.c @@ -0,0 +1,127 @@ +/* + * YASM module loader + * + * Copyright (C) 2004-2007 Peter Johnson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include +/*@unused@*/ RCSID("$Id: module.in 2080 2008-04-30 04:40:29Z peter $"); + +#include + + +typedef struct loaded_module { + const char *keyword; /* module keyword */ + void *data; /* associated data */ +} loaded_module; + +static HAMT *loaded_modules[] = {NULL, NULL, NULL, NULL, NULL, NULL}; + +static void +load_module_destroy(/*@only@*/ void *data) +{ + /* do nothing */ +} + +void * +yasm_load_module(yasm_module_type type, const char *keyword) +{ + if (!loaded_modules[type]) + return NULL; + return HAMT_search(loaded_modules[type], keyword); +} + +void +yasm_register_module(yasm_module_type type, const char *keyword, void *data) +{ + int replace = 1; + + assert(type < sizeof(loaded_modules)); + + if (!loaded_modules[type]) + loaded_modules[type] = HAMT_create(0, yasm_internal_error_); + + HAMT_insert(loaded_modules[type], keyword, data, &replace, + load_module_destroy); +} + +typedef struct { + yasm_module_type type; + void (*printfunc) (const char *name, const char *keyword); +} list_one_data; + +static int +yasm_list_one_module(void *node, void *d) +{ + list_one_data *data = (list_one_data *)d; + yasm_arch_module *arch; + yasm_dbgfmt_module *dbgfmt; + yasm_objfmt_module *objfmt; + yasm_listfmt_module *listfmt; + yasm_parser_module *parser; + yasm_preproc_module *preproc; + + switch (data->type) { + case YASM_MODULE_ARCH: + arch = node; + data->printfunc(arch->name, arch->keyword); + break; + case YASM_MODULE_DBGFMT: + dbgfmt = node; + data->printfunc(dbgfmt->name, dbgfmt->keyword); + break; + case YASM_MODULE_OBJFMT: + objfmt = node; + data->printfunc(objfmt->name, objfmt->keyword); + break; + case YASM_MODULE_LISTFMT: + listfmt = node; + data->printfunc(listfmt->name, listfmt->keyword); + break; + case YASM_MODULE_PARSER: + parser = node; + data->printfunc(parser->name, parser->keyword); + break; + case YASM_MODULE_PREPROC: + preproc = node; + data->printfunc(preproc->name, preproc->keyword); + break; + } + return 0; +} + +void +yasm_list_modules(yasm_module_type type, + void (*printfunc) (const char *name, const char *keyword)) +{ + list_one_data data; + + /* Go through available list, and try to load each one */ + if (!loaded_modules[type]) + return; + + data.type = type; + data.printfunc = printfunc; + + HAMT_traverse(loaded_modules[type], &data, yasm_list_one_module); +} diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt new file mode 100644 index 00000000..ebb7b6d6 --- /dev/null +++ b/modules/CMakeLists.txt @@ -0,0 +1,89 @@ +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) + +INCLUDE(arch/CMakeLists.txt) +INCLUDE(listfmts/CMakeLists.txt) +INCLUDE(parsers/CMakeLists.txt) +INCLUDE(preprocs/CMakeLists.txt) +INCLUDE(dbgfmts/CMakeLists.txt) +INCLUDE(objfmts/CMakeLists.txt) + +MESSAGE(STATUS "Standard modules: ${YASM_MODULES}") + +# +# Generate init_plugin.c +# This file provides the yasm_init_plugin() function for yasmstd. +# + +SET(INIT_PLUGIN_C ${CMAKE_CURRENT_BINARY_DIR}/init_plugin.c) +SET(INIT_PLUGIN_C_REV 1) + +# Don't regen if no changes; default to regen +SET(regen_init_plugin_c TRUE) +IF(EXISTS ${INIT_PLUGIN_C}) + FILE(READ ${INIT_PLUGIN_C} _old_init_plugin_c) + STRING(REGEX MATCHALL "[^\n]*\n" _lines "${_old_init_plugin_c}") + #MESSAGE(STATUS "Lines: ${_lines}") + + LIST(GET _lines 0 _line0) + STRING(REGEX MATCH "([A-Za-z][A-Za-z0-9_]+[ ]?)+" _old_modules "${_line0}") + #MESSAGE(STATUS "Old modules: ${_old_modules}") + STRING(REPLACE ";" " " _modules_str "${YASM_MODULES}") + STRING(COMPARE EQUAL "${_old_modules}" "${_modules_str} " _modules_match) + + LIST(GET _lines 1 _line1) + STRING(REGEX MATCH "rev [0-9]+" _old_modules_rev "${_line1}") + #MESSAGE(STATUS "Old modules rev: ${_old_modules_rev}") + STRING(COMPARE EQUAL "${_old_modules_rev}" "rev ${INIT_PLUGIN_C_REV}" + _modules_rev_match) + + IF(_modules_match AND _modules_rev_match) + SET(regen_init_plugin_c FALSE) + ENDIF(_modules_match AND _modules_rev_match) +ENDIF(EXISTS ${INIT_PLUGIN_C}) + +IF(regen_init_plugin_c) + MESSAGE(STATUS "Generating standard plugin initialization file") + STRING(REPLACE ";" " " _modules_str "${YASM_MODULES}") + FILE(WRITE ${INIT_PLUGIN_C} "/* ${_modules_str} \n") + FILE(APPEND ${INIT_PLUGIN_C} " rev ${INIT_PLUGIN_C_REV}\n") + FILE(APPEND ${INIT_PLUGIN_C} " */\n\n") + FILE(APPEND ${INIT_PLUGIN_C} "#include \n") + FILE(APPEND ${INIT_PLUGIN_C} "#include \n\n") + FOREACH(module ${YASM_MODULES}) + STRING(REGEX MATCHALL "[a-zA-Z][a-zA-Z0-9]+" _modulepath ${module}) + LIST(GET _modulepath 0 _type) + LIST(GET _modulepath 1 _keyword) + FILE(APPEND ${INIT_PLUGIN_C} + "extern yasm_${_type}_module yasm_${_keyword}_LTX_${_type};\n") + ENDFOREACH(module) + FILE(APPEND ${INIT_PLUGIN_C} "\n#ifdef _MSC_VER\n") + FILE(APPEND ${INIT_PLUGIN_C} "__declspec(dllexport)\n") + FILE(APPEND ${INIT_PLUGIN_C} "#endif\n") + FILE(APPEND ${INIT_PLUGIN_C} "void\n") + FILE(APPEND ${INIT_PLUGIN_C} "yasm_init_plugin(void)\n") + FILE(APPEND ${INIT_PLUGIN_C} "{\n") + FOREACH(module ${YASM_MODULES}) + STRING(REGEX MATCHALL "[a-zA-Z][a-zA-Z0-9]+" _modulepath ${module}) + LIST(GET _modulepath 0 _type) + LIST(GET _modulepath 1 _keyword) + SET(_data "yasm_${_keyword}_LTX_${_type}") + STRING(TOUPPER "${_type}" _type) + FILE(APPEND ${INIT_PLUGIN_C} + " yasm_register_module(YASM_MODULE_${_type}, \"${_keyword}\", &${_data});\n") + ENDFOREACH(module) + FILE(APPEND ${INIT_PLUGIN_C} "}\n") +ELSE(regen_init_plugin_c) + MESSAGE(STATUS "Not regenerating static modules file (unchanged)") +ENDIF(regen_init_plugin_c) + +SET_SOURCE_FILES_PROPERTIES(init_plugin.c GENERATED) + +SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}) + +ADD_LIBRARY(yasmstd MODULE + init_plugin.c + ${YASM_MODULES_SRC} + ) +TARGET_LINK_LIBRARIES(yasmstd libyasm) + +INSTALL(TARGETS yasmstd LIBRARY DESTINATION lib) diff --git a/modules/arch/CMakeLists.txt b/modules/arch/CMakeLists.txt new file mode 100644 index 00000000..ea65fbd0 --- /dev/null +++ b/modules/arch/CMakeLists.txt @@ -0,0 +1,2 @@ +INCLUDE(arch/lc3b/CMakeLists.txt) +INCLUDE(arch/x86/CMakeLists.txt) diff --git a/modules/arch/lc3b/CMakeLists.txt b/modules/arch/lc3b/CMakeLists.txt new file mode 100644 index 00000000..0d5df705 --- /dev/null +++ b/modules/arch/lc3b/CMakeLists.txt @@ -0,0 +1,11 @@ +YASM_RE2C( + ${CMAKE_CURRENT_SOURCE_DIR}/arch/lc3b/lc3bid.re + ${CMAKE_CURRENT_BINARY_DIR}/lc3bid.c + -s + ) + +YASM_ADD_MODULE(arch_lc3b + arch/lc3b/lc3barch.c + arch/lc3b/lc3bbc.c + lc3bid.c + ) diff --git a/modules/arch/x86/CMakeLists.txt b/modules/arch/x86/CMakeLists.txt new file mode 100644 index 00000000..d15c9948 --- /dev/null +++ b/modules/arch/x86/CMakeLists.txt @@ -0,0 +1,50 @@ +ADD_CUSTOM_COMMAND( + OUTPUT + ${CMAKE_CURRENT_BINARY_DIR}/x86insns.c + ${CMAKE_CURRENT_BINARY_DIR}/x86insn_gas.gperf + ${CMAKE_CURRENT_BINARY_DIR}/x86insn_nasm.gperf + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/arch/x86/gen_x86_insn.py + ${CMAKE_CURRENT_BINARY_DIR}/x86insns.c + ${CMAKE_CURRENT_BINARY_DIR}/x86insn_gas.gperf + ${CMAKE_CURRENT_BINARY_DIR}/x86insn_nasm.gperf + MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/arch/x86/gen_x86_insn.py + ) + +YASM_GENPERF( + ${CMAKE_CURRENT_SOURCE_DIR}/arch/x86/x86cpu.gperf + ${CMAKE_CURRENT_BINARY_DIR}/x86cpu.c + ) + +YASM_GENPERF( + ${CMAKE_CURRENT_SOURCE_DIR}/arch/x86/x86regtmod.gperf + ${CMAKE_CURRENT_BINARY_DIR}/x86regtmod.c + ) + +YASM_GENPERF( + ${CMAKE_CURRENT_BINARY_DIR}/x86insn_nasm.gperf + ${CMAKE_CURRENT_BINARY_DIR}/x86insn_nasm.c + ) + +YASM_GENPERF( + ${CMAKE_CURRENT_BINARY_DIR}/x86insn_gas.gperf + ${CMAKE_CURRENT_BINARY_DIR}/x86insn_gas.c + ) + +YASM_ADD_MODULE(arch_x86 + arch/x86/x86arch.c + arch/x86/x86bc.c + arch/x86/x86expr.c + arch/x86/x86id.c + x86cpu.c + x86regtmod.c + ) + +SET(insn_DEPS + ${CMAKE_CURRENT_BINARY_DIR}/x86insn_nasm.c + ${CMAKE_CURRENT_BINARY_DIR}/x86insn_gas.c + ${CMAKE_CURRENT_BINARY_DIR}/x86insns.c + ) + +SET_SOURCE_FILES_PROPERTIES(arch/x86/x86id.c PROPERTIES + OBJECT_DEPENDS "${insn_DEPS}" + ) diff --git a/modules/dbgfmts/CMakeLists.txt b/modules/dbgfmts/CMakeLists.txt new file mode 100644 index 00000000..93c29fe8 --- /dev/null +++ b/modules/dbgfmts/CMakeLists.txt @@ -0,0 +1,4 @@ +INCLUDE(dbgfmts/codeview/CMakeLists.txt) +INCLUDE(dbgfmts/dwarf2/CMakeLists.txt) +INCLUDE(dbgfmts/null/CMakeLists.txt) +INCLUDE(dbgfmts/stabs/CMakeLists.txt) diff --git a/modules/dbgfmts/codeview/CMakeLists.txt b/modules/dbgfmts/codeview/CMakeLists.txt new file mode 100644 index 00000000..3ecd9fa5 --- /dev/null +++ b/modules/dbgfmts/codeview/CMakeLists.txt @@ -0,0 +1,5 @@ +YASM_ADD_MODULE(dbgfmt_cv8 + dbgfmts/codeview/cv-dbgfmt.c + dbgfmts/codeview/cv-symline.c + dbgfmts/codeview/cv-type.c + ) diff --git a/modules/dbgfmts/dwarf2/CMakeLists.txt b/modules/dbgfmts/dwarf2/CMakeLists.txt new file mode 100644 index 00000000..671910ee --- /dev/null +++ b/modules/dbgfmts/dwarf2/CMakeLists.txt @@ -0,0 +1,6 @@ +YASM_ADD_MODULE(dbgfmt_dwarf2 + dbgfmts/dwarf2/dwarf2-dbgfmt.c + dbgfmts/dwarf2/dwarf2-line.c + dbgfmts/dwarf2/dwarf2-aranges.c + dbgfmts/dwarf2/dwarf2-info.c + ) diff --git a/modules/dbgfmts/null/CMakeLists.txt b/modules/dbgfmts/null/CMakeLists.txt new file mode 100644 index 00000000..9f85b2fd --- /dev/null +++ b/modules/dbgfmts/null/CMakeLists.txt @@ -0,0 +1,3 @@ +YASM_ADD_MODULE(dbgfmt_null + dbgfmts/null/null-dbgfmt.c + ) diff --git a/modules/dbgfmts/stabs/CMakeLists.txt b/modules/dbgfmts/stabs/CMakeLists.txt new file mode 100644 index 00000000..bd3b0268 --- /dev/null +++ b/modules/dbgfmts/stabs/CMakeLists.txt @@ -0,0 +1,3 @@ +YASM_ADD_MODULE(dbgfmt_stabs + dbgfmts/stabs/stabs-dbgfmt.c + ) diff --git a/modules/listfmts/CMakeLists.txt b/modules/listfmts/CMakeLists.txt new file mode 100644 index 00000000..ce3c92a0 --- /dev/null +++ b/modules/listfmts/CMakeLists.txt @@ -0,0 +1 @@ +INCLUDE(listfmts/nasm/CMakeLists.txt) diff --git a/modules/listfmts/nasm/CMakeLists.txt b/modules/listfmts/nasm/CMakeLists.txt new file mode 100644 index 00000000..9d54f82f --- /dev/null +++ b/modules/listfmts/nasm/CMakeLists.txt @@ -0,0 +1,3 @@ +YASM_ADD_MODULE(listfmt_nasm + listfmts/nasm/nasm-listfmt.c + ) diff --git a/modules/objfmts/CMakeLists.txt b/modules/objfmts/CMakeLists.txt new file mode 100644 index 00000000..c00a3a04 --- /dev/null +++ b/modules/objfmts/CMakeLists.txt @@ -0,0 +1,9 @@ +INCLUDE(objfmts/dbg/CMakeLists.txt) +INCLUDE(objfmts/bin/CMakeLists.txt) +INCLUDE(objfmts/elf/CMakeLists.txt) +INCLUDE(objfmts/coff/CMakeLists.txt) +INCLUDE(objfmts/macho/CMakeLists.txt) +INCLUDE(objfmts/rdf/CMakeLists.txt) +#INCLUDE(objfmts/win32/CMakeLists.txt) +#INCLUDE(objfmts/win64/CMakeLists.txt) +INCLUDE(objfmts/xdf/CMakeLists.txt) diff --git a/modules/objfmts/bin/CMakeLists.txt b/modules/objfmts/bin/CMakeLists.txt new file mode 100644 index 00000000..a3d396a5 --- /dev/null +++ b/modules/objfmts/bin/CMakeLists.txt @@ -0,0 +1,3 @@ +YASM_ADD_MODULE(objfmt_bin + objfmts/bin/bin-objfmt.c + ) diff --git a/modules/objfmts/coff/CMakeLists.txt b/modules/objfmts/coff/CMakeLists.txt new file mode 100644 index 00000000..5f63d4f7 --- /dev/null +++ b/modules/objfmts/coff/CMakeLists.txt @@ -0,0 +1,27 @@ +YASM_GENMACRO( + ${CMAKE_CURRENT_SOURCE_DIR}/objfmts/coff/win64-nasm.mac + ${CMAKE_CURRENT_BINARY_DIR}/win64-nasm.c + win64_nasm_stdmac + ) + +YASM_GENMACRO( + ${CMAKE_CURRENT_SOURCE_DIR}/objfmts/coff/win64-gas.mac + ${CMAKE_CURRENT_BINARY_DIR}/win64-gas.c + win64_gas_stdmac + ) + +SET(coff_DEPS + ${CMAKE_CURRENT_BINARY_DIR}/win64-nasm.c + ${CMAKE_CURRENT_BINARY_DIR}/win64-gas.c + ) + +SET_SOURCE_FILES_PROPERTIES(objfmts/coff/coff-objfmt.c PROPERTIES + OBJECT_DEPENDS "${coff_DEPS}" + ) + +YASM_ADD_MODULE(objfmt_coff + objfmts/coff/coff-objfmt.c + objfmts/coff/win64-except.c + ) +list(APPEND YASM_MODULES objfmt_win32) +list(APPEND YASM_MODULES objfmt_win64) diff --git a/modules/objfmts/dbg/CMakeLists.txt b/modules/objfmts/dbg/CMakeLists.txt new file mode 100644 index 00000000..ba5193fa --- /dev/null +++ b/modules/objfmts/dbg/CMakeLists.txt @@ -0,0 +1,3 @@ +YASM_ADD_MODULE(objfmt_dbg + objfmts/dbg/dbg-objfmt.c + ) diff --git a/modules/objfmts/elf/CMakeLists.txt b/modules/objfmts/elf/CMakeLists.txt new file mode 100644 index 00000000..c06b81d8 --- /dev/null +++ b/modules/objfmts/elf/CMakeLists.txt @@ -0,0 +1,8 @@ +YASM_ADD_MODULE(objfmt_elf + objfmts/elf/elf.c + objfmts/elf/elf-objfmt.c + objfmts/elf/elf-x86-x86.c + objfmts/elf/elf-x86-amd64.c + ) +list(APPEND YASM_MODULES objfmt_elf32) +list(APPEND YASM_MODULES objfmt_elf64) diff --git a/modules/objfmts/macho/CMakeLists.txt b/modules/objfmts/macho/CMakeLists.txt new file mode 100644 index 00000000..cb5f4934 --- /dev/null +++ b/modules/objfmts/macho/CMakeLists.txt @@ -0,0 +1,5 @@ +YASM_ADD_MODULE(objfmt_macho + objfmts/macho/macho-objfmt.c + ) +list(APPEND YASM_MODULES objfmt_macho32) +list(APPEND YASM_MODULES objfmt_macho64) diff --git a/modules/objfmts/rdf/CMakeLists.txt b/modules/objfmts/rdf/CMakeLists.txt new file mode 100644 index 00000000..6cf9157d --- /dev/null +++ b/modules/objfmts/rdf/CMakeLists.txt @@ -0,0 +1,3 @@ +YASM_ADD_MODULE(objfmt_rdf + objfmts/rdf/rdf-objfmt.c + ) diff --git a/modules/objfmts/xdf/CMakeLists.txt b/modules/objfmts/xdf/CMakeLists.txt new file mode 100644 index 00000000..681ec2b0 --- /dev/null +++ b/modules/objfmts/xdf/CMakeLists.txt @@ -0,0 +1,3 @@ +YASM_ADD_MODULE(objfmt_xdf + objfmts/xdf/xdf-objfmt.c + ) diff --git a/modules/parsers/CMakeLists.txt b/modules/parsers/CMakeLists.txt new file mode 100644 index 00000000..db1e371f --- /dev/null +++ b/modules/parsers/CMakeLists.txt @@ -0,0 +1,2 @@ +INCLUDE(parsers/gas/CMakeLists.txt) +INCLUDE(parsers/nasm/CMakeLists.txt) diff --git a/modules/parsers/gas/CMakeLists.txt b/modules/parsers/gas/CMakeLists.txt new file mode 100644 index 00000000..de23426f --- /dev/null +++ b/modules/parsers/gas/CMakeLists.txt @@ -0,0 +1,11 @@ +YASM_RE2C( + ${CMAKE_CURRENT_SOURCE_DIR}/parsers/gas/gas-token.re + ${CMAKE_CURRENT_BINARY_DIR}/gas-token.c + -b + ) + +YASM_ADD_MODULE(parser_gas + parsers/gas/gas-parser.c + parsers/gas/gas-parse.c + gas-token.c + ) diff --git a/modules/parsers/nasm/CMakeLists.txt b/modules/parsers/nasm/CMakeLists.txt new file mode 100644 index 00000000..7a060d29 --- /dev/null +++ b/modules/parsers/nasm/CMakeLists.txt @@ -0,0 +1,21 @@ +YASM_GENMACRO( + ${CMAKE_CURRENT_SOURCE_DIR}/parsers/nasm/nasm-std.mac + ${CMAKE_CURRENT_BINARY_DIR}/nasm-macros.c + nasm_standard_mac + ) + +SET_SOURCE_FILES_PROPERTIES(parsers/nasm/nasm-parser.c PROPERTIES + OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/nasm-macros.c + ) + +YASM_RE2C( + ${CMAKE_CURRENT_SOURCE_DIR}/parsers/nasm/nasm-token.re + ${CMAKE_CURRENT_BINARY_DIR}/nasm-token.c + -b + ) + +YASM_ADD_MODULE(parser_nasm + parsers/nasm/nasm-parser.c + parsers/nasm/nasm-parse.c + nasm-token.c + ) diff --git a/modules/preprocs/CMakeLists.txt b/modules/preprocs/CMakeLists.txt new file mode 100644 index 00000000..dccecbe5 --- /dev/null +++ b/modules/preprocs/CMakeLists.txt @@ -0,0 +1,3 @@ +INCLUDE(preprocs/nasm/CMakeLists.txt) +INCLUDE(preprocs/raw/CMakeLists.txt) +INCLUDE(preprocs/cpp/CMakeLists.txt) diff --git a/modules/preprocs/cpp/CMakeLists.txt b/modules/preprocs/cpp/CMakeLists.txt new file mode 100644 index 00000000..202787cb --- /dev/null +++ b/modules/preprocs/cpp/CMakeLists.txt @@ -0,0 +1,3 @@ +YASM_ADD_MODULE(preproc_cpp + preprocs/cpp/cpp-preproc.c + ) diff --git a/modules/preprocs/nasm/CMakeLists.txt b/modules/preprocs/nasm/CMakeLists.txt new file mode 100644 index 00000000..e10a9dd1 --- /dev/null +++ b/modules/preprocs/nasm/CMakeLists.txt @@ -0,0 +1,25 @@ +add_executable(genversion preprocs/nasm/genversion.c) +get_target_property(_tmp_GENVERSION_EXE genversion LOCATION) +add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/version.mac + COMMAND ${_tmp_GENVERSION_EXE} ${CMAKE_CURRENT_BINARY_DIR}/version.mac + DEPENDS ${_tmp_GENVERSION_EXE} + ) + +YASM_GENMACRO( + ${CMAKE_CURRENT_BINARY_DIR}/version.mac + ${CMAKE_CURRENT_BINARY_DIR}/nasm-version.c + nasm_version_mac + ) + +SET_SOURCE_FILES_PROPERTIES(preprocs/nasm/nasm-preproc.c PROPERTIES + OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/nasm-version.c + ) + +YASM_ADD_MODULE(preproc_nasm + preprocs/nasm/nasm-preproc.c + preprocs/nasm/nasm-pp.c + preprocs/nasm/nasmlib.c + preprocs/nasm/nasm-eval.c + ) + diff --git a/modules/preprocs/raw/CMakeLists.txt b/modules/preprocs/raw/CMakeLists.txt new file mode 100644 index 00000000..fc345386 --- /dev/null +++ b/modules/preprocs/raw/CMakeLists.txt @@ -0,0 +1,3 @@ +YASM_ADD_MODULE(preproc_raw + preprocs/raw/raw-preproc.c + ) diff --git a/plugins/README b/plugins/README new file mode 100644 index 00000000..c16a8fd0 --- /dev/null +++ b/plugins/README @@ -0,0 +1,20 @@ +These directories contain example yasm plugins. +Yasm is only capable of loading plugins when it was built using cmake. +To build yasm with cmake on Unix, from the yasm source tree, do: + mkdir objdir + cd objdir + cmake .. + make + +The plugins are written to be compiled against an *installed* yasm. +Plugins may be loaded on the yasm command line using the -N command line +option, e.g.: + yasm -N ./libdbgmod.so + yasm -N /usr/local/lib/libx86mod +(the .so will be automatically appended) +If no directory path is specified, yasm will search in standard library +locations (e.g. LD_LIBRARY_PATH, the rpath of the yasm executable, etc) to +try to load the plugin. Thus the last example could likely be written: + yasm -N libx86mod + +Plugins may override builtin modules like x86. diff --git a/plugins/dbg/CMakeLists.txt b/plugins/dbg/CMakeLists.txt new file mode 100644 index 00000000..fa51498b --- /dev/null +++ b/plugins/dbg/CMakeLists.txt @@ -0,0 +1,45 @@ +FIND_PROGRAM(YASM_PATH yasm) + +SET (YASM_POSSIBLE_INCLUDE_PATHS + "${YASM_PATH}" + "${YASM_PATH}/../include" + "$ENV{ProgramFiles}/Yasm/Include" + /usr/include + /usr/local/include + ) + +FIND_PATH(YASM_INCLUDE_PATH NAMES libyasm.h + DOC "The path to the libyasm include files" + PATHS ${YASM_POSSIBLE_INCLUDE_PATHS} + ) + +IF (NOT YASM_INCLUDE_PATH) + MESSAGE(FATAL_ERROR "Could not find yasm include files") +ENDIF (NOT YASM_INCLUDE_PATH) + +INCLUDE_DIRECTORIES(${YASM_INCLUDE_PATH}) + +SET (YASM_POSSIBLE_LIB_PATHS + "${YASM_PATH}" + "${YASM_PATH}/../lib" + "${YASM_INCLUDE_PATH}/../lib" + "$ENV{ProgramFiles}/Yasm/Lib" + /usr/lib + /usr/local/lib + ) + +FIND_LIBRARY(YASM_LIBRARY + NAMES yasm + DOC "The path to the libyasm library" + PATHS ${YASM_POSSIBLE_LIB_PATHS} + ) + +IF (NOT YASM_LIBRARY) + MESSAGE(FATAL_ERROR "Could not find yasm library") +ENDIF (NOT YASM_LIBRARY) + +ADD_LIBRARY(dbgmod MODULE + init_plugin.c + dbg-objfmt.c + ) +TARGET_LINK_LIBRARIES(dbgmod ${YASM_LIBRARY}) diff --git a/plugins/dbg/README b/plugins/dbg/README new file mode 100644 index 00000000..3a1f5cb7 --- /dev/null +++ b/plugins/dbg/README @@ -0,0 +1,15 @@ +This directory demonstrates how to build a basic plugin. +It does not need access to the yasm source, only an installed yasm. + +To build: + mkdir objdir + cd objdir + cmake .. + make + +Testing: + yasm -N ./libdbgmod.so -f dbg - + db 5 + ^D +(result lines will have PLUGIN prefixed to the function calls; this +demonstrates the plugin is being used rather than the builtin dbg module) diff --git a/plugins/dbg/dbg-objfmt.c b/plugins/dbg/dbg-objfmt.c new file mode 100644 index 00000000..1aef7c20 --- /dev/null +++ b/plugins/dbg/dbg-objfmt.c @@ -0,0 +1,175 @@ +/* + * Debugging object format (used to debug object format module interface) + * + * Copyright (C) 2001-2007 Peter Johnson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include +#include + +#define N_(String) (String) + +typedef struct yasm_objfmt_dbg { + yasm_objfmt_base objfmt; /* base structure */ + + FILE *dbgfile; +} yasm_objfmt_dbg; + +yasm_objfmt_module yasm_dbg_LTX_objfmt; + + +static yasm_objfmt * +dbg_objfmt_create(yasm_object *object) +{ + yasm_objfmt_dbg *objfmt_dbg = yasm_xmalloc(sizeof(yasm_objfmt_dbg)); + + objfmt_dbg->objfmt.module = &yasm_dbg_LTX_objfmt; + + objfmt_dbg->dbgfile = tmpfile(); + if (!objfmt_dbg->dbgfile) { + fprintf(stderr, N_("could not open temporary file")); + return 0; + } + fprintf(objfmt_dbg->dbgfile, "PLUGIN create()\n"); + return (yasm_objfmt *)objfmt_dbg; +} + +static void +dbg_objfmt_output(yasm_object *object, FILE *f, int all_syms, + yasm_errwarns *errwarns) +{ + yasm_objfmt_dbg *objfmt_dbg = (yasm_objfmt_dbg *)object->objfmt; + char buf[1024]; + size_t i; + + /* Copy temp file to real output file */ + rewind(objfmt_dbg->dbgfile); + while ((i = fread(buf, 1, 1024, objfmt_dbg->dbgfile))) { + if (fwrite(buf, 1, i, f) != i) + break; + } + + /* Reassign objfmt debug file to output file */ + fclose(objfmt_dbg->dbgfile); + objfmt_dbg->dbgfile = f; + + fprintf(objfmt_dbg->dbgfile, "PLUGIN output(f, object->\n"); + yasm_object_print(object, objfmt_dbg->dbgfile, 1); + fprintf(objfmt_dbg->dbgfile, "%d)\n", all_syms); + fprintf(objfmt_dbg->dbgfile, " Symbol Table:\n"); + yasm_symtab_print(object->symtab, objfmt_dbg->dbgfile, 1); +} + +static void +dbg_objfmt_destroy(yasm_objfmt *objfmt) +{ + yasm_objfmt_dbg *objfmt_dbg = (yasm_objfmt_dbg *)objfmt; + fprintf(objfmt_dbg->dbgfile, "PLUGIN destroy()\n"); + yasm_xfree(objfmt); +} + +static yasm_section * +dbg_objfmt_add_default_section(yasm_object *object) +{ + yasm_objfmt_dbg *objfmt_dbg = (yasm_objfmt_dbg *)object->objfmt; + yasm_section *retval; + int isnew; + + retval = yasm_object_get_general(object, ".text", 0, 0, 0, &isnew, 0); + if (isnew) { + fprintf(objfmt_dbg->dbgfile, "(new) "); + yasm_symtab_define_label(object->symtab, ".text", + yasm_section_bcs_first(retval), 1, 0); + yasm_section_set_default(retval, 1); + } + return retval; +} + +static /*@observer@*/ /*@null@*/ yasm_section * +dbg_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, + /*@unused@*/ /*@null@*/ + yasm_valparamhead *objext_valparams, + unsigned long line) +{ + yasm_objfmt_dbg *objfmt_dbg = (yasm_objfmt_dbg *)object->objfmt; + yasm_valparam *vp; + yasm_section *retval; + int isnew; + + fprintf(objfmt_dbg->dbgfile, "PLUGIN section_switch(headp, "); + yasm_vps_print(valparams, objfmt_dbg->dbgfile); + fprintf(objfmt_dbg->dbgfile, ", "); + yasm_vps_print(objext_valparams, objfmt_dbg->dbgfile); + fprintf(objfmt_dbg->dbgfile, ", %lu), returning ", line); + + vp = yasm_vps_first(valparams); + if (!yasm_vp_string(vp)) { + fprintf(objfmt_dbg->dbgfile, "NULL\n"); + return NULL; + } + retval = yasm_object_get_general(object, yasm_vp_string(vp), 0, 0, 0, + &isnew, line); + if (isnew) { + fprintf(objfmt_dbg->dbgfile, "(new) "); + yasm_symtab_define_label(object->symtab, vp->val, + yasm_section_bcs_first(retval), 1, line); + } + yasm_section_set_default(retval, 0); + fprintf(objfmt_dbg->dbgfile, "\"%s\" section\n", vp->val); + return retval; +} + +static /*@observer@*/ /*@null@*/ yasm_symrec * +dbg_objfmt_get_special_sym(yasm_object *object, const char *name, + const char *parser) +{ + yasm_objfmt_dbg *objfmt_dbg = (yasm_objfmt_dbg *)object->objfmt; + fprintf(objfmt_dbg->dbgfile, + "PLUGIN get_special_sym(object, \"%s\", \"%s\")\n", + name, parser); + return NULL; +} + +/* Define valid debug formats to use with this object format */ +static const char *dbg_objfmt_dbgfmt_keywords[] = { + "null", + NULL +}; + +/* Define objfmt structure -- see objfmt.h for details */ +yasm_objfmt_module yasm_dbg_LTX_objfmt = { + "Trace of all info passed to object format module", + "dbg", + "dbg", + 32, + dbg_objfmt_dbgfmt_keywords, + "null", + NULL, /* no directives */ + NULL, /* no standard macros */ + dbg_objfmt_create, + dbg_objfmt_output, + dbg_objfmt_destroy, + dbg_objfmt_add_default_section, + dbg_objfmt_section_switch, + dbg_objfmt_get_special_sym +}; diff --git a/plugins/dbg/init_plugin.c b/plugins/dbg/init_plugin.c new file mode 100644 index 00000000..e8e53dc5 --- /dev/null +++ b/plugins/dbg/init_plugin.c @@ -0,0 +1,13 @@ +#include +#include + +extern yasm_arch_module yasm_dbg_LTX_objfmt; + +#ifdef _MSC_VER +__declspec(dllexport) +#endif +void +yasm_init_plugin(void) +{ + yasm_register_module(YASM_MODULE_OBJFMT, "dbg", &yasm_dbg_LTX_objfmt); +} diff --git a/plugins/x86/CMakeLists.txt b/plugins/x86/CMakeLists.txt new file mode 100644 index 00000000..55d273d5 --- /dev/null +++ b/plugins/x86/CMakeLists.txt @@ -0,0 +1,117 @@ +SET(SOURCE_DIR "${YASM_SOURCE_DIR}/modules/arch/x86") + +FIND_PROGRAM(YASM_PATH yasm) + +FIND_PROGRAM(GENPERF_PATH genperf + DOC "The path to the yasm genperf executable" + PATHS ${YASM_SOURCE_DIR}/objdir/tools/genperf + ) + +IF (NOT GENPERF_PATH) + MESSAGE(FATAL_ERROR "Could not find genperf executable") +ENDIF (NOT GENPERF_PATH) + +SET (YASM_POSSIBLE_INCLUDE_PATHS + "${YASM_PATH}" + "${YASM_PATH}/../include" + "$ENV{ProgramFiles}/Yasm/Include" + /usr/include + /usr/local/include + ) + +FIND_PATH(YASM_INCLUDE_PATH NAMES libyasm.h + DOC "The path to the libyasm include files" + PATHS ${YASM_POSSIBLE_INCLUDE_PATHS} + ) + +IF (NOT YASM_INCLUDE_PATH) + MESSAGE(FATAL_ERROR "Could not find yasm include files") +ENDIF (NOT YASM_INCLUDE_PATH) + +INCLUDE_DIRECTORIES(${YASM_INCLUDE_PATH}) +INCLUDE_DIRECTORIES(${YASM_SOURCE_DIR}) + +SET (YASM_POSSIBLE_LIB_PATHS + "${YASM_PATH}" + "${YASM_PATH}/../lib" + "${YASM_INCLUDE_PATH}/../lib" + "$ENV{ProgramFiles}/Yasm/Lib" + /usr/lib + /usr/local/lib + ) + +FIND_LIBRARY(YASM_LIBRARY + NAMES yasm + DOC "The path to the libyasm library" + PATHS ${YASM_POSSIBLE_LIB_PATHS} + ) + +IF (NOT YASM_LIBRARY) + MESSAGE(FATAL_ERROR "Could not find yasm library") +ENDIF (NOT YASM_LIBRARY) + +INCLUDE(FindPythonInterp) + +INCLUDE_DIRECTORIES(${SOURCE_DIR}) +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) + +ADD_CUSTOM_COMMAND( + OUTPUT + ${CMAKE_CURRENT_BINARY_DIR}/x86insns.c + ${CMAKE_CURRENT_BINARY_DIR}/x86insn_gas.gperf + ${CMAKE_CURRENT_BINARY_DIR}/x86insn_nasm.gperf + COMMAND ${PYTHON_EXECUTABLE} ${SOURCE_DIR}/gen_x86_insn.py + ${CMAKE_CURRENT_BINARY_DIR}/x86insns.c + ${CMAKE_CURRENT_BINARY_DIR}/x86insn_gas.gperf + ${CMAKE_CURRENT_BINARY_DIR}/x86insn_nasm.gperf + MAIN_DEPENDENCY ${SOURCE_DIR}/gen_x86_insn.py + ) + +macro (YASM_GENPERF _in_NAME _out_NAME) + add_custom_command( + OUTPUT ${_out_NAME} + COMMAND ${GENPERF_PATH} ${_in_NAME} ${_out_NAME} + MAIN_DEPENDENCY ${_in_NAME} + ) +endmacro (YASM_GENPERF) + +YASM_GENPERF( + ${SOURCE_DIR}/x86cpu.gperf + ${CMAKE_CURRENT_BINARY_DIR}/x86cpu.c + ) + +YASM_GENPERF( + ${SOURCE_DIR}/x86regtmod.gperf + ${CMAKE_CURRENT_BINARY_DIR}/x86regtmod.c + ) + +YASM_GENPERF( + ${CMAKE_CURRENT_BINARY_DIR}/x86insn_nasm.gperf + ${CMAKE_CURRENT_BINARY_DIR}/x86insn_nasm.c + ) + +YASM_GENPERF( + ${CMAKE_CURRENT_BINARY_DIR}/x86insn_gas.gperf + ${CMAKE_CURRENT_BINARY_DIR}/x86insn_gas.c + ) + +SET(insn_DEPS + ${CMAKE_CURRENT_BINARY_DIR}/x86insn_nasm.c + ${CMAKE_CURRENT_BINARY_DIR}/x86insn_gas.c + ${CMAKE_CURRENT_BINARY_DIR}/x86insns.c + ) + +SET_SOURCE_FILES_PROPERTIES(${SOURCE_DIR}/x86id.c PROPERTIES + OBJECT_DEPENDS "${insn_DEPS}" + ) + +ADD_LIBRARY(x86mod MODULE + init_plugin.c + ${SOURCE_DIR}/x86arch.c + ${SOURCE_DIR}/x86bc.c + ${SOURCE_DIR}/x86expr.c + ${SOURCE_DIR}/x86id.c + x86cpu.c + x86regtmod.c + ) +TARGET_LINK_LIBRARIES(x86mod ${YASM_LIBRARY}) diff --git a/plugins/x86/README b/plugins/x86/README new file mode 100644 index 00000000..17346155 --- /dev/null +++ b/plugins/x86/README @@ -0,0 +1,10 @@ +This directory demonstrates how to build a yasm builtin module as a plugin. +This can be useful for integrating custom changes without +rebuilding/reinstalling yasm. +It requires access to the yasm source. + +The yasm source directory must be defined to cmake, e.g. + mkdir objdir + cd objdir + cmake -DYASM_SOURCE_DIR=/home/foo/yasm .. + make diff --git a/plugins/x86/init_plugin.c b/plugins/x86/init_plugin.c new file mode 100644 index 00000000..d2698b19 --- /dev/null +++ b/plugins/x86/init_plugin.c @@ -0,0 +1,13 @@ +#include +#include + +extern yasm_arch_module yasm_x86_LTX_arch; + +#ifdef _MSC_VER +__declspec(dllexport) +#endif +void +yasm_init_plugin(void) +{ + yasm_register_module(YASM_MODULE_ARCH, "x86", &yasm_x86_LTX_arch); +} diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt new file mode 100644 index 00000000..4b83d4eb --- /dev/null +++ b/tools/CMakeLists.txt @@ -0,0 +1,3 @@ +ADD_SUBDIRECTORY(genmacro) +ADD_SUBDIRECTORY(genperf) +ADD_SUBDIRECTORY(re2c) diff --git a/tools/genmacro/CMakeLists.txt b/tools/genmacro/CMakeLists.txt new file mode 100644 index 00000000..27ba5996 --- /dev/null +++ b/tools/genmacro/CMakeLists.txt @@ -0,0 +1,3 @@ +add_executable(genmacro + genmacro.c + ) diff --git a/tools/genperf/CMakeLists.txt b/tools/genperf/CMakeLists.txt new file mode 100644 index 00000000..22afcc95 --- /dev/null +++ b/tools/genperf/CMakeLists.txt @@ -0,0 +1,7 @@ +add_executable(genperf + genperf.c + perfect.c + ../../libyasm/phash.c + ../../libyasm/xmalloc.c + ../../libyasm/xstrdup.c + ) diff --git a/tools/re2c/CMakeLists.txt b/tools/re2c/CMakeLists.txt new file mode 100644 index 00000000..7125d496 --- /dev/null +++ b/tools/re2c/CMakeLists.txt @@ -0,0 +1,11 @@ +add_executable(re2c + main.c + code.c + dfa.c + parser.c + actions.c + scanner.c + mbo_getopt.c + substr.c + translate.c + ) From 92d938f93fe2f9bf0fcdf9ce697c0a34d702f067 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 23 May 2008 06:30:38 +0000 Subject: [PATCH 188/585] Prepend "lib" on plugin name only on Unix. svn path=/trunk/yasm/; revision=2099 --- frontends/yasm/yasm-plugin.c | 11 +++++++++-- frontends/yasm/yasm.c | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/frontends/yasm/yasm-plugin.c b/frontends/yasm/yasm-plugin.c index 55b3f75d..e23a807a 100644 --- a/frontends/yasm/yasm-plugin.c +++ b/frontends/yasm/yasm-plugin.c @@ -61,14 +61,21 @@ load_plugin(const char *name) /* Load library */ - path = yasm_xmalloc(strlen(name)+5); - strcpy(path, name); + path = yasm_xmalloc(strlen(name)+10); #if defined(_MSC_VER) + strcpy(path, name); strcat(path, ".dll"); lib = load_dll(path); #elif defined(__GNUC__) + strcpy(path, "lib"); + strcat(path, name); strcat(path, ".so"); lib = load_dll(path); + if (!lib) { + strcpy(path, name); + strcat(path, ".so"); + lib = load_dll(path); + } #endif yasm_xfree(path); if (!lib) diff --git a/frontends/yasm/yasm.c b/frontends/yasm/yasm.c index bf3121f2..83294069 100644 --- a/frontends/yasm/yasm.c +++ b/frontends/yasm/yasm.c @@ -583,7 +583,7 @@ main(int argc, char *argv[]) #ifdef CMAKE_BUILD /* Load standard modules */ - if (!load_plugin("libyasmstd")) { + if (!load_plugin("yasmstd")) { print_error(_("%s: could not load standard modules"), _("FATAL")); return EXIT_FAILURE; } From e4f292ef16ec5888920bc07b57227970e54aec7d Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 23 May 2008 06:31:52 +0000 Subject: [PATCH 189/585] Enable Id keyword expansion. svn path=/trunk/yasm/; revision=2100 --- frontends/yasm/yasm-plugin.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontends/yasm/yasm-plugin.h b/frontends/yasm/yasm-plugin.h index efb1bf51..edee2537 100644 --- a/frontends/yasm/yasm-plugin.h +++ b/frontends/yasm/yasm-plugin.h @@ -1,4 +1,4 @@ -/* +/* $Id$ * Semi-portable (Windows and Unix) plugin loading * * Copyright (C) 2008 Peter Johnson From eb7b1adb30124353ea0add7a07b569ef72f4646f Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 23 May 2008 06:46:51 +0000 Subject: [PATCH 190/585] Enable DLL/plugin builds with cmake on Windows. Add proper declspec dllimport/dllexport to all libyasm functions. Use macros to make these do nothing on non-cmake and Unix builds. svn path=/trunk/yasm/; revision=2101 --- libyasm-stdint.h.cmake | 17 ++++++ libyasm/CMakeLists.txt | 5 +- libyasm/assocdat.h | 9 +++ libyasm/bitvect.h | 108 +++++++++++++++++++++++++++++++++++ libyasm/bytecode.h | 36 ++++++++++++ libyasm/coretype.h | 14 +++++ libyasm/errwarn.h | 32 +++++++++++ libyasm/expr.h | 28 +++++++++ libyasm/file.h | 23 ++++++++ libyasm/floatnum.h | 14 +++++ libyasm/hamt.h | 12 ++++ libyasm/insn.h | 16 ++++++ libyasm/intnum.h | 40 +++++++++++++ libyasm/inttree.h | 12 ++++ libyasm/linemap.h | 14 +++++ libyasm/md5.h | 8 +++ libyasm/module.h | 7 +++ libyasm/phash.h | 6 ++ libyasm/section.h | 33 +++++++++++ libyasm/symrec.h | 39 +++++++++++++ libyasm/valparam.h | 23 ++++++++ libyasm/value.h | 14 +++++ libyasm/xmalloc.c | 4 ++ tools/genperf/CMakeLists.txt | 1 + util.h | 1 + 25 files changed, 515 insertions(+), 1 deletion(-) diff --git a/libyasm-stdint.h.cmake b/libyasm-stdint.h.cmake index 261a6182..f2361d4c 100644 --- a/libyasm-stdint.h.cmake +++ b/libyasm-stdint.h.cmake @@ -1,3 +1,6 @@ +#ifndef YASM_STDINT_H +#define YASM_STDINT_H + #cmakedefine HAVE_STDINT_H #ifdef HAVE_STDINT_H @@ -17,4 +20,18 @@ typedef unsigned long uintptr_t; typedef unsigned long uintptr_t; #endif +#ifndef YASM_LIB_DECL +# ifdef _MSC_VER +# ifdef YASM_LIB_SOURCE +# define YASM_LIB_DECL __declspec(dllexport) +# else +# define YASM_LIB_DECL __declspec(dllimport) +# endif +# else +# define YASM_LIB_DECL +# endif +#endif + #undef HAVE_STDINT_H + +#endif diff --git a/libyasm/CMakeLists.txt b/libyasm/CMakeLists.txt index 8be337e5..125afa0d 100644 --- a/libyasm/CMakeLists.txt +++ b/libyasm/CMakeLists.txt @@ -31,7 +31,10 @@ ADD_LIBRARY(libyasm SHARED xmalloc.c xstrdup.c ) -SET_TARGET_PROPERTIES(libyasm PROPERTIES OUTPUT_NAME "yasm") +SET_TARGET_PROPERTIES(libyasm PROPERTIES + OUTPUT_NAME "yasm" + COMPILE_FLAGS -DYASM_LIB_SOURCE + ) INSTALL(TARGETS libyasm LIBRARY DESTINATION lib diff --git a/libyasm/assocdat.h b/libyasm/assocdat.h index 4b162d66..d18e1ebf 100644 --- a/libyasm/assocdat.h +++ b/libyasm/assocdat.h @@ -34,10 +34,15 @@ #ifndef YASM_ASSOCDAT_H #define YASM_ASSOCDAT_H +#ifndef YASM_LIB_DECL +#define YASM_LIB_DECL +#endif + /** Associated data container. */ typedef struct yasm__assoc_data yasm__assoc_data; /** Create an associated data container. */ +YASM_LIB_DECL /*@only@*/ yasm__assoc_data *yasm__assoc_data_create(void); /** Get associated data for a data callback. @@ -45,6 +50,7 @@ typedef struct yasm__assoc_data yasm__assoc_data; * \param callback callback used when adding data * \return Associated data (NULL if none). */ +YASM_LIB_DECL /*@dependent@*/ /*@null@*/ void *yasm__assoc_data_get (/*@null@*/ yasm__assoc_data *assoc_data, const yasm_assoc_data_callback *callback); @@ -55,16 +61,19 @@ typedef struct yasm__assoc_data yasm__assoc_data; * \param callback callback * \param data data to associate */ +YASM_LIB_DECL /*@only@*/ yasm__assoc_data *yasm__assoc_data_add (/*@null@*/ /*@only@*/ yasm__assoc_data *assoc_data, const yasm_assoc_data_callback *callback, /*@only@*/ /*@null@*/ void *data); /** Destroy all associated data in a container. */ +YASM_LIB_DECL void yasm__assoc_data_destroy (/*@null@*/ /*@only@*/ yasm__assoc_data *assoc_data); /** Print all associated data in a container. */ +YASM_LIB_DECL void yasm__assoc_data_print(const yasm__assoc_data *assoc_data, FILE *f, int indent_level); diff --git a/libyasm/bitvect.h b/libyasm/bitvect.h index e2a10238..dc77d4fa 100644 --- a/libyasm/bitvect.h +++ b/libyasm/bitvect.h @@ -15,6 +15,9 @@ /* and your own application(s) which might - directly or indirectly - */ /* include this definitions file. */ /*****************************************************************************/ +#ifndef YASM_LIB_DECL +#define YASM_LIB_DECL +#endif typedef unsigned char N_char; typedef unsigned char N_byte; @@ -117,213 +120,318 @@ typedef wordptr *listptr; /* ===> MISCELLANEOUS BASIC FUNCTIONS: <=== */ +YASM_LIB_DECL const char * BitVector_Error (ErrCode error); /* return string for err code */ +YASM_LIB_DECL ErrCode BitVector_Boot (void); /* 0 = ok, 1..7 = error */ +YASM_LIB_DECL void BitVector_Shutdown (void); /* undo Boot */ +YASM_LIB_DECL N_word BitVector_Size (N_int bits); /* bit vector size (# of words) */ +YASM_LIB_DECL N_word BitVector_Mask (N_int bits); /* bit vector mask (unused bits) */ /* ===> CLASS METHODS: <=== */ +YASM_LIB_DECL const char * BitVector_Version (void); /* returns version string */ +YASM_LIB_DECL N_int BitVector_Word_Bits (void); /* return # of bits in machine word */ +YASM_LIB_DECL N_int BitVector_Long_Bits (void); /* return # of bits in unsigned long */ /* ===> CONSTRUCTOR METHODS: <=== */ +YASM_LIB_DECL /*@only@*/ wordptr BitVector_Create (N_int bits, boolean clear); /* malloc */ +YASM_LIB_DECL listptr BitVector_Create_List(N_int bits, boolean clear, N_int count); +YASM_LIB_DECL wordptr BitVector_Resize (wordptr oldaddr, N_int bits); /* realloc */ +YASM_LIB_DECL wordptr BitVector_Shadow (wordptr addr); /* make new same size but empty */ +YASM_LIB_DECL wordptr BitVector_Clone (wordptr addr); /* make exact duplicate */ +YASM_LIB_DECL wordptr BitVector_Concat (wordptr X, wordptr Y); /* return concatenation */ /* ===> DESTRUCTOR METHODS: <=== */ +YASM_LIB_DECL void BitVector_Dispose (/*@only@*/ /*@out@*/ charptr string); /* string */ +YASM_LIB_DECL void BitVector_Destroy (/*@only@*/ wordptr addr); /* bitvec */ +YASM_LIB_DECL void BitVector_Destroy_List (listptr list, N_int count); /* list */ /* ===> OBJECT METHODS: <=== */ /* ===> bit vector copy function: */ +YASM_LIB_DECL void BitVector_Copy (wordptr X, wordptr Y); /* X = Y */ /* ===> bit vector initialization: */ +YASM_LIB_DECL void BitVector_Empty (wordptr addr); /* X = {} */ +YASM_LIB_DECL void BitVector_Fill (wordptr addr); /* X = ~{} */ +YASM_LIB_DECL void BitVector_Flip (wordptr addr); /* X = ~X */ +YASM_LIB_DECL void BitVector_Primes (wordptr addr); /* ===> miscellaneous functions: */ +YASM_LIB_DECL void BitVector_Reverse (wordptr X, wordptr Y); /* ===> bit vector interval operations and functions: */ +YASM_LIB_DECL void BitVector_Interval_Empty (/*@out@*/ wordptr addr, N_int lower, N_int upper); +YASM_LIB_DECL void BitVector_Interval_Fill (/*@out@*/ wordptr addr, N_int lower, N_int upper); +YASM_LIB_DECL void BitVector_Interval_Flip (/*@out@*/ wordptr addr, N_int lower, N_int upper); +YASM_LIB_DECL void BitVector_Interval_Reverse (/*@out@*/ wordptr addr, N_int lower, N_int upper); +YASM_LIB_DECL boolean BitVector_interval_scan_inc (wordptr addr, N_int start, N_intptr min, N_intptr max); +YASM_LIB_DECL boolean BitVector_interval_scan_dec (wordptr addr, N_int start, N_intptr min, N_intptr max); +YASM_LIB_DECL void BitVector_Interval_Copy (/*@out@*/ wordptr X, wordptr Y, N_int Xoffset, N_int Yoffset, N_int length); +YASM_LIB_DECL wordptr BitVector_Interval_Substitute(/*@out@*/ wordptr X, wordptr Y, N_int Xoffset, N_int Xlength, N_int Yoffset, N_int Ylength); /* ===> bit vector test functions: */ +YASM_LIB_DECL boolean BitVector_is_empty (wordptr addr); /* X == {} ? */ +YASM_LIB_DECL boolean BitVector_is_full (wordptr addr); /* X == ~{} ? */ +YASM_LIB_DECL boolean BitVector_equal (wordptr X, wordptr Y); /* X == Y ? */ +YASM_LIB_DECL Z_int BitVector_Lexicompare(wordptr X, wordptr Y); /* X <,=,> Y ? */ +YASM_LIB_DECL Z_int BitVector_Compare (wordptr X, wordptr Y); /* X <,=,> Y ? */ /* ===> bit vector string conversion functions: */ +YASM_LIB_DECL /*@only@*/ charptr BitVector_to_Hex (wordptr addr); +YASM_LIB_DECL ErrCode BitVector_from_Hex (/*@out@*/wordptr addr, charptr string); +YASM_LIB_DECL ErrCode BitVector_from_Oct(/*@out@*/ wordptr addr, charptr string); +YASM_LIB_DECL /*@only@*/ charptr BitVector_to_Bin (wordptr addr); +YASM_LIB_DECL ErrCode BitVector_from_Bin (/*@out@*/ wordptr addr, charptr string); +YASM_LIB_DECL /*@only@*/ charptr BitVector_to_Dec (wordptr addr); +YASM_LIB_DECL ErrCode BitVector_from_Dec (/*@out@*/ wordptr addr, charptr string); typedef struct BitVector_from_Dec_static_data BitVector_from_Dec_static_data; +YASM_LIB_DECL BitVector_from_Dec_static_data *BitVector_from_Dec_static_Boot(N_word bits); +YASM_LIB_DECL void BitVector_from_Dec_static_Shutdown(/*@null@*/ BitVector_from_Dec_static_data *data); +YASM_LIB_DECL ErrCode BitVector_from_Dec_static(BitVector_from_Dec_static_data *data, /*@out@*/ wordptr addr, charptr string); +YASM_LIB_DECL /*@only@*/ charptr BitVector_to_Enum (wordptr addr); +YASM_LIB_DECL ErrCode BitVector_from_Enum (/*@out@*/ wordptr addr, charptr string); /* ===> bit vector bit operations, functions & tests: */ +YASM_LIB_DECL void BitVector_Bit_Off (/*@out@*/ wordptr addr, N_int indx); /* X = X \ {x} */ +YASM_LIB_DECL void BitVector_Bit_On (/*@out@*/ wordptr addr, N_int indx); /* X = X + {x} */ +YASM_LIB_DECL boolean BitVector_bit_flip (/*@out@*/ wordptr addr, N_int indx); /* (X+{x})\(X*{x}) */ +YASM_LIB_DECL boolean BitVector_bit_test (wordptr addr, N_int indx); /* {x} in X ? */ +YASM_LIB_DECL void BitVector_Bit_Copy (/*@out@*/ wordptr addr, N_int indx, boolean bit); /* ===> bit vector bit shift & rotate functions: */ +YASM_LIB_DECL void BitVector_LSB (/*@out@*/ wordptr addr, boolean bit); +YASM_LIB_DECL void BitVector_MSB (/*@out@*/ wordptr addr, boolean bit); +YASM_LIB_DECL boolean BitVector_lsb_ (wordptr addr); +YASM_LIB_DECL boolean BitVector_msb_ (wordptr addr); +YASM_LIB_DECL boolean /*@alt void@*/ BitVector_rotate_left (wordptr addr); +YASM_LIB_DECL boolean /*@alt void@*/ BitVector_rotate_right (wordptr addr); +YASM_LIB_DECL boolean /*@alt void@*/ BitVector_shift_left (wordptr addr, boolean carry_in); +YASM_LIB_DECL boolean /*@alt void@*/ BitVector_shift_right (wordptr addr, boolean carry_in); +YASM_LIB_DECL void BitVector_Move_Left (wordptr addr, N_int bits); +YASM_LIB_DECL void BitVector_Move_Right (wordptr addr, N_int bits); /* ===> bit vector insert/delete bits: */ +YASM_LIB_DECL void BitVector_Insert (wordptr addr, N_int offset, N_int count, boolean clear); +YASM_LIB_DECL void BitVector_Delete (wordptr addr, N_int offset, N_int count, boolean clear); /* ===> bit vector arithmetic: */ +YASM_LIB_DECL boolean /*@alt void@*/ BitVector_increment (wordptr addr); /* X++ */ +YASM_LIB_DECL boolean /*@alt void@*/ BitVector_decrement (wordptr addr); /* X-- */ +YASM_LIB_DECL boolean /*@alt void@*/ BitVector_compute (wordptr X, wordptr Y, wordptr Z, boolean minus, boolean *carry); +YASM_LIB_DECL boolean /*@alt void@*/ BitVector_add (wordptr X, wordptr Y, wordptr Z, boolean *carry); +YASM_LIB_DECL boolean /*@alt void@*/ BitVector_sub (wordptr X, wordptr Y, wordptr Z, boolean *carry); +YASM_LIB_DECL boolean /*@alt void@*/ BitVector_inc (wordptr X, wordptr Y); +YASM_LIB_DECL boolean /*@alt void@*/ BitVector_dec (wordptr X, wordptr Y); +YASM_LIB_DECL void BitVector_Negate (wordptr X, wordptr Y); +YASM_LIB_DECL void BitVector_Absolute (wordptr X, wordptr Y); +YASM_LIB_DECL Z_int BitVector_Sign (wordptr addr); +YASM_LIB_DECL ErrCode BitVector_Mul_Pos (wordptr X, wordptr Y, wordptr Z, boolean strict); +YASM_LIB_DECL ErrCode BitVector_Multiply (wordptr X, wordptr Y, wordptr Z); +YASM_LIB_DECL ErrCode BitVector_Div_Pos (wordptr Q, wordptr X, wordptr Y, wordptr R); +YASM_LIB_DECL ErrCode BitVector_Divide (wordptr Q, wordptr X, wordptr Y, wordptr R); +YASM_LIB_DECL ErrCode BitVector_GCD (wordptr X, wordptr Y, wordptr Z); +YASM_LIB_DECL ErrCode BitVector_GCD2 (wordptr U, wordptr V, wordptr W, /* O */ wordptr X, wordptr Y); /* I */ +YASM_LIB_DECL ErrCode BitVector_Power (wordptr X, wordptr Y, wordptr Z); /* ===> direct memory access functions: */ +YASM_LIB_DECL void BitVector_Block_Store(wordptr addr, charptr buffer, N_int length); +YASM_LIB_DECL charptr BitVector_Block_Read (wordptr addr, /*@out@*/ N_intptr length); /* ===> word array functions: */ +YASM_LIB_DECL void BitVector_Word_Store (wordptr addr, N_int offset, N_int value); +YASM_LIB_DECL N_int BitVector_Word_Read (wordptr addr, N_int offset); +YASM_LIB_DECL void BitVector_Word_Insert(wordptr addr, N_int offset, N_int count, boolean clear); +YASM_LIB_DECL void BitVector_Word_Delete(wordptr addr, N_int offset, N_int count, boolean clear); /* ===> arbitrary size chunk functions: */ +YASM_LIB_DECL void BitVector_Chunk_Store(wordptr addr, N_int chunksize, N_int offset, N_long value); +YASM_LIB_DECL N_long BitVector_Chunk_Read (wordptr addr, N_int chunksize, N_int offset); /* ===> set operations: */ +YASM_LIB_DECL void Set_Union (wordptr X, wordptr Y, wordptr Z); /* X = Y + Z */ +YASM_LIB_DECL void Set_Intersection (wordptr X, wordptr Y, wordptr Z); /* X = Y * Z */ +YASM_LIB_DECL void Set_Difference (wordptr X, wordptr Y, wordptr Z); /* X = Y \ Z */ +YASM_LIB_DECL void Set_ExclusiveOr (wordptr X, wordptr Y, wordptr Z); /*(Y+Z)\(Y*Z)*/ +YASM_LIB_DECL void Set_Complement (wordptr X, wordptr Y); /* X = ~Y */ /* ===> set functions: */ +YASM_LIB_DECL boolean Set_subset (wordptr X, wordptr Y); /* X in Y ? */ +YASM_LIB_DECL N_int Set_Norm (wordptr addr); /* = | X | */ +YASM_LIB_DECL N_int Set_Norm2 (wordptr addr); /* = | X | */ +YASM_LIB_DECL N_int Set_Norm3 (wordptr addr); /* = | X | */ +YASM_LIB_DECL Z_long Set_Min (wordptr addr); /* = min(X) */ +YASM_LIB_DECL Z_long Set_Max (wordptr addr); /* = max(X) */ /* ===> matrix-of-booleans operations: */ +YASM_LIB_DECL void Matrix_Multiplication(wordptr X, N_int rowsX, N_int colsX, wordptr Y, N_int rowsY, N_int colsY, wordptr Z, N_int rowsZ, N_int colsZ); +YASM_LIB_DECL void Matrix_Product (wordptr X, N_int rowsX, N_int colsX, wordptr Y, N_int rowsY, N_int colsY, wordptr Z, N_int rowsZ, N_int colsZ); +YASM_LIB_DECL void Matrix_Closure (wordptr addr, N_int rows, N_int cols); +YASM_LIB_DECL void Matrix_Transpose (wordptr X, N_int rowsX, N_int colsX, wordptr Y, N_int rowsY, N_int colsY); diff --git a/libyasm/bytecode.h b/libyasm/bytecode.h index 741aabb6..bff958f8 100644 --- a/libyasm/bytecode.h +++ b/libyasm/bytecode.h @@ -34,6 +34,10 @@ #ifndef YASM_BYTECODE_H #define YASM_BYTECODE_H +#ifndef YASM_LIB_DECL +#define YASM_LIB_DECL +#endif + /** A data value (opaque type). */ typedef struct yasm_dataval yasm_dataval; /** A list of data values. */ @@ -223,6 +227,7 @@ struct yasm_bytecode { * \param line virtual line (from yasm_linemap) * \return Newly allocated bytecode of the specified type. */ +YASM_LIB_DECL /*@only@*/ yasm_bytecode *yasm_bc_create_common (/*@null@*/ const yasm_bytecode_callback *callback, /*@only@*/ /*@null@*/ void *contents, unsigned long line); @@ -232,6 +237,7 @@ struct yasm_bytecode { * \param callback new bytecode callback function * \param contents new type-specific data */ +YASM_LIB_DECL void yasm_bc_transform(yasm_bytecode *bc, const yasm_bytecode_callback *callback, void *contents); @@ -239,11 +245,13 @@ void yasm_bc_transform(yasm_bytecode *bc, /** Common bytecode callback finalize function, for where no finalization * is ever required for this type of bytecode. */ +YASM_LIB_DECL void yasm_bc_finalize_common(yasm_bytecode *bc, yasm_bytecode *prev_bc); /** Common bytecode callback calc_len function, for where the bytecode has * no calculatable length. Causes an internal error if called. */ +YASM_LIB_DECL int yasm_bc_calc_len_common(yasm_bytecode *bc, yasm_bc_add_span_func add_span, void *add_span_data); @@ -251,6 +259,7 @@ int yasm_bc_calc_len_common(yasm_bytecode *bc, yasm_bc_add_span_func add_span, * always short (calc_len never calls add_span). Causes an internal * error if called. */ +YASM_LIB_DECL int yasm_bc_expand_common (yasm_bytecode *bc, int span, long old_val, long new_val, /*@out@*/ long *neg_thres, /*@out@*/ long *pos_thres); @@ -258,6 +267,7 @@ int yasm_bc_expand_common /** Common bytecode callback tobytes function, for where the bytecode * cannot be converted to bytes. Causes an internal error if called. */ +YASM_LIB_DECL int yasm_bc_tobytes_common (yasm_bytecode *bc, unsigned char **bufp, void *d, yasm_output_value_func output_value, @@ -275,6 +285,7 @@ int yasm_bc_tobytes_common * \param bc bytecode * \param e multiple (kept, do not free) */ +YASM_LIB_DECL void yasm_bc_set_multiple(yasm_bytecode *bc, /*@keep@*/ yasm_expr *e); /** Create a bytecode containing data value(s). @@ -287,6 +298,7 @@ void yasm_bc_set_multiple(yasm_bytecode *bc, /*@keep@*/ yasm_expr *e); * \param line virtual line (from yasm_linemap) * \return Newly allocated bytecode. */ +YASM_LIB_DECL /*@only@*/ yasm_bytecode *yasm_bc_create_data (yasm_datavalhead *datahead, unsigned int size, int append_zero, /*@null@*/ yasm_arch *arch, unsigned long line); @@ -297,6 +309,7 @@ void yasm_bc_set_multiple(yasm_bytecode *bc, /*@keep@*/ yasm_expr *e); * \param line virtual line (from yasm_linemap) * \return Newly allocated bytecode. */ +YASM_LIB_DECL /*@only@*/ yasm_bytecode *yasm_bc_create_leb128 (yasm_datavalhead *datahead, int sign, unsigned long line); @@ -306,6 +319,7 @@ void yasm_bc_set_multiple(yasm_bytecode *bc, /*@keep@*/ yasm_expr *e); * \param line virtual line (from yasm_linemap) * \return Newly allocated bytecode. */ +YASM_LIB_DECL /*@only@*/ yasm_bytecode *yasm_bc_create_reserve (/*@only@*/ yasm_expr *numitems, unsigned int itemsize, unsigned long line); @@ -317,6 +331,7 @@ void yasm_bc_set_multiple(yasm_bytecode *bc, /*@keep@*/ yasm_expr *e); * \return NULL if bc is not a reserve bytecode, otherwise an expression * for the number of items to reserve. */ +YASM_LIB_DECL /*@null@*/ const yasm_expr *yasm_bc_reserve_numitems (yasm_bytecode *bc, /*@out@*/ unsigned int *itemsize); @@ -330,6 +345,7 @@ void yasm_bc_set_multiple(yasm_bytecode *bc, /*@keep@*/ yasm_expr *e); * \param line virtual line (from yasm_linemap) for the bytecode * \return Newly allocated bytecode. */ +YASM_LIB_DECL /*@only@*/ yasm_bytecode *yasm_bc_create_incbin (/*@only@*/ char *filename, /*@only@*/ /*@null@*/ yasm_expr *start, /*@only@*/ /*@null@*/ yasm_expr *maxlen, yasm_linemap *linemap, @@ -347,6 +363,7 @@ void yasm_bc_set_multiple(yasm_bytecode *bc, /*@keep@*/ yasm_expr *e); * - from code_fill parameter (if not NULL) * - 0 */ +YASM_LIB_DECL /*@only@*/ yasm_bytecode *yasm_bc_create_align (/*@keep@*/ yasm_expr *boundary, /*@keep@*/ /*@null@*/ yasm_expr *fill, /*@keep@*/ /*@null@*/ yasm_expr *maxskip, @@ -359,6 +376,7 @@ void yasm_bc_set_multiple(yasm_bytecode *bc, /*@keep@*/ yasm_expr *e); * \param line virtual line (from yasm_linemap) * \return Newly allocated bytecode. */ +YASM_LIB_DECL /*@only@*/ yasm_bytecode *yasm_bc_create_org (unsigned long start, unsigned long fill, unsigned long line); @@ -367,6 +385,7 @@ void yasm_bc_set_multiple(yasm_bytecode *bc, /*@keep@*/ yasm_expr *e); * \return Section containing bc (can be NULL if bytecode is not part of a * section). */ +YASM_LIB_DECL /*@dependent@*/ /*@null@*/ yasm_section *yasm_bc_get_section (yasm_bytecode *bc); @@ -375,11 +394,13 @@ void yasm_bc_set_multiple(yasm_bytecode *bc, /*@keep@*/ yasm_expr *e); * \param bc bytecode * \param sym symbol */ +YASM_LIB_DECL void yasm_bc__add_symrec(yasm_bytecode *bc, /*@dependent@*/ yasm_symrec *sym); /** Delete (free allocated memory for) a bytecode. * \param bc bytecode (only pointer to it); may be NULL */ +YASM_LIB_DECL void yasm_bc_destroy(/*@only@*/ /*@null@*/ yasm_bytecode *bc); /** Print a bytecode. For debugging purposes. @@ -387,12 +408,14 @@ void yasm_bc_destroy(/*@only@*/ /*@null@*/ yasm_bytecode *bc); * \param indent_level indentation level * \param bc bytecode */ +YASM_LIB_DECL void yasm_bc_print(const yasm_bytecode *bc, FILE *f, int indent_level); /** Finalize a bytecode after parsing. * \param bc bytecode * \param prev_bc bytecode directly preceding bc in a list of bytecodes */ +YASM_LIB_DECL void yasm_bc_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc); /** Determine the distance between the starting offsets of two bytecodes. @@ -402,6 +425,7 @@ void yasm_bc_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc); * the distance was indeterminate. * \warning Only valid /after/ optimization. */ +YASM_LIB_DECL /*@null@*/ /*@only@*/ yasm_intnum *yasm_calc_bc_dist (yasm_bytecode *precbc1, yasm_bytecode *precbc2); @@ -411,6 +435,7 @@ void yasm_bc_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc); * \return Offset of the next bytecode in bytes. * \warning Only valid /after/ optimization. */ +YASM_LIB_DECL unsigned long yasm_bc_next_offset(yasm_bytecode *precbc); /** Resolve EQUs in a bytecode and calculate its minimum size. @@ -425,6 +450,7 @@ unsigned long yasm_bc_next_offset(yasm_bytecode *precbc); * (and output) during execution. * \note May store to bytecode updated expressions and the short length. */ +YASM_LIB_DECL int yasm_bc_calc_len(yasm_bytecode *bc, yasm_bc_add_span_func add_span, void *add_span_data); @@ -442,6 +468,7 @@ int yasm_bc_calc_len(yasm_bytecode *bc, yasm_bc_add_span_func add_span, * new negative and positive thresholds returned. * \note May store to bytecode updated expressions and the updated length. */ +YASM_LIB_DECL int yasm_bc_expand(yasm_bytecode *bc, int span, long old_val, long new_val, /*@out@*/ long *neg_thres, /*@out@*/ long *pos_thres); @@ -465,6 +492,7 @@ int yasm_bc_expand(yasm_bytecode *bc, int span, long old_val, long new_val, * results on the second call, as calling this function may result in * non-reversible changes to the bytecode. */ +YASM_LIB_DECL /*@null@*/ /*@only@*/ unsigned char *yasm_bc_tobytes (yasm_bytecode *bc, unsigned char *buf, unsigned long *bufsize, /*@out@*/ int *gap, void *d, yasm_output_value_func output_value, @@ -478,6 +506,7 @@ int yasm_bc_expand(yasm_bytecode *bc, int span, long old_val, long new_val, * calculated, 0 if error should be returned in this case * \return 1 on error (set with yasm_error_set), 0 on success. */ +YASM_LIB_DECL int yasm_bc_get_multiple(yasm_bytecode *bc, /*@out@*/ long *multiple, int calc_bc_dist); @@ -485,6 +514,7 @@ int yasm_bc_get_multiple(yasm_bytecode *bc, /*@out@*/ long *multiple, * \param bc bytecode * \return Bytecode multiple, NULL if =1. */ +YASM_LIB_DECL const yasm_expr *yasm_bc_get_multiple_expr(const yasm_bytecode *bc); /** Get a #yasm_insn structure from an instruction bytecode (if possible). @@ -492,12 +522,14 @@ const yasm_expr *yasm_bc_get_multiple_expr(const yasm_bytecode *bc); * \return Instruction details if bytecode is an instruction bytecode, * otherwise NULL. */ +YASM_LIB_DECL /*@dependent@*/ /*@null@*/ yasm_insn *yasm_bc_get_insn(yasm_bytecode *bc); /** Create a new data value from an expression. * \param expn expression * \return Newly allocated data value. */ +YASM_LIB_DECL yasm_dataval *yasm_dv_create_expr(/*@keep@*/ yasm_expr *expn); /** Create a new data value from a string. @@ -512,6 +544,7 @@ yasm_dataval *yasm_dv_create_string(/*@keep@*/ char *contents, size_t len); * \param len length * \return Newly allocated data value. */ +YASM_LIB_DECL yasm_dataval *yasm_dv_create_raw(/*@keep@*/ unsigned char *contents, unsigned long len); @@ -531,6 +564,7 @@ void yasm_dvs_initialize(yasm_datavalhead *headp); /** Delete (free allocated memory for) a list of data values. * \param headp list of data values */ +YASM_LIB_DECL void yasm_dvs_delete(yasm_datavalhead *headp); /** Add data value to the end of a list of data values. @@ -542,6 +576,7 @@ void yasm_dvs_delete(yasm_datavalhead *headp); * \return If data value was actually appended (it wasn't NULL), the data * value; otherwise NULL. */ +YASM_LIB_DECL /*@null@*/ yasm_dataval *yasm_dvs_append (yasm_datavalhead *headp, /*@returned@*/ /*@null@*/ yasm_dataval *dv); @@ -550,6 +585,7 @@ void yasm_dvs_delete(yasm_datavalhead *headp); * \param indent_level indentation level * \param headp data value list */ +YASM_LIB_DECL void yasm_dvs_print(const yasm_datavalhead *headp, FILE *f, int indent_level); #endif diff --git a/libyasm/coretype.h b/libyasm/coretype.h index b23e3eae..a78c28f2 100644 --- a/libyasm/coretype.h +++ b/libyasm/coretype.h @@ -34,6 +34,10 @@ #ifndef YASM_CORETYPE_H #define YASM_CORETYPE_H +#ifndef YASM_LIB_DECL +#define YASM_LIB_DECL +#endif + /** Architecture instance (mostly opaque type). \see arch.h for details. */ typedef struct yasm_arch yasm_arch; /** Preprocessor interface. \see preproc.h for details. */ @@ -302,6 +306,7 @@ typedef int (*yasm_output_reloc_func) * \param size size of each array element * \param compar element comparison function */ +YASM_LIB_DECL int yasm__mergesort(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)); @@ -311,6 +316,7 @@ int yasm__mergesort(void *base, size_t nmemb, size_t size, * \param delim set of 1 or more delimiters * \return First/next substring. */ +YASM_LIB_DECL /*@null@*/ char *yasm__strsep(char **stringp, const char *delim); /** Compare two strings, ignoring case differences. @@ -319,6 +325,7 @@ int yasm__mergesort(void *base, size_t nmemb, size_t size, * \param s2 string 2 * \return 0 if strings are equal, -1 if s1s2. */ +YASM_LIB_DECL int yasm__strcasecmp(const char *s1, const char *s2); /** Compare portion of two strings, ignoring case differences. @@ -328,6 +335,7 @@ int yasm__strcasecmp(const char *s1, const char *s2); * \param n maximum number of characters to compare * \return 0 if strings are equal, -1 if s1s2. */ +YASM_LIB_DECL int yasm__strncasecmp(const char *s1, const char *s2, size_t n); /** strdup() implementation using yasm_xmalloc(). @@ -335,6 +343,7 @@ int yasm__strncasecmp(const char *s1, const char *s2, size_t n); * \param str string * \return Newly allocated duplicate string. */ +YASM_LIB_DECL /*@only@*/ char *yasm__xstrdup(const char *str); /** strndup() implementation using yasm_xmalloc(). @@ -343,6 +352,7 @@ int yasm__strncasecmp(const char *s1, const char *s2, size_t n); * \param max maximum number of characters to copy * \return Newly allocated duplicate string. */ +YASM_LIB_DECL /*@only@*/ char *yasm__xstrndup(const char *str, size_t max); /** Error-checking memory allocation. A default implementation is provided @@ -351,6 +361,7 @@ int yasm__strncasecmp(const char *s1, const char *s2, size_t n); * \param size number of bytes to allocate * \return Allocated memory block. */ +YASM_LIB_DECL extern /*@only@*/ /*@out@*/ void * (*yasm_xmalloc) (size_t size); /** Error-checking memory allocation (with clear-to-0). A default @@ -360,6 +371,7 @@ extern /*@only@*/ /*@out@*/ void * (*yasm_xmalloc) (size_t size); * \param elsize size (in bytes) of each element * \return Allocated and cleared memory block. */ +YASM_LIB_DECL extern /*@only@*/ void * (*yasm_xcalloc) (size_t nelem, size_t elsize); /** Error-checking memory reallocation. A default implementation is provided @@ -369,6 +381,7 @@ extern /*@only@*/ void * (*yasm_xcalloc) (size_t nelem, size_t elsize); * \param elsize new size, in bytes * \return Re-allocated memory block. */ +YASM_LIB_DECL extern /*@only@*/ void * (*yasm_xrealloc) (/*@only@*/ /*@out@*/ /*@returned@*/ /*@null@*/ void *oldmem, size_t size) /*@modifies oldmem@*/; @@ -377,6 +390,7 @@ extern /*@only@*/ void * (*yasm_xrealloc) * that calls yasm_fatal() on allocation errors. * \param p memory block to free */ +YASM_LIB_DECL extern void (*yasm_xfree) (/*@only@*/ /*@out@*/ /*@null@*/ void *p) /*@modifies p@*/; diff --git a/libyasm/errwarn.h b/libyasm/errwarn.h index 214f3125..d1e9928b 100644 --- a/libyasm/errwarn.h +++ b/libyasm/errwarn.h @@ -34,6 +34,10 @@ #ifndef YASM_ERRWARN_H #define YASM_ERRWARN_H +#ifndef YASM_LIB_DECL +#define YASM_LIB_DECL +#endif + /** Warning classes (that may be enabled/disabled). */ typedef enum yasm_warn_class { YASM_WARN_NONE = 0, /**< No warning */ @@ -67,11 +71,13 @@ typedef enum yasm_error_class { } yasm_error_class; /** Initialize any internal data structures. */ +YASM_LIB_DECL void yasm_errwarn_initialize(void); /** Clean up any memory allocated by yasm_errwarn_initialize() or other * functions. */ +YASM_LIB_DECL void yasm_errwarn_cleanup(void); /** Reporting point of internal errors. These are usually due to sanity @@ -82,6 +88,7 @@ void yasm_errwarn_cleanup(void); * \param line source line (ala __LINE__) * \param message internal error message */ +YASM_LIB_DECL extern /*@exits@*/ void (*yasm_internal_error_) (const char *file, unsigned int line, const char *message); @@ -98,6 +105,7 @@ extern /*@exits@*/ void (*yasm_internal_error_) * \param message fatal error message * \param va va_list argument list for message */ +YASM_LIB_DECL extern /*@exits@*/ void (*yasm_fatal) (const char *message, va_list va); /** Reporting point of fatal errors, with variable arguments (internal only). @@ -106,11 +114,13 @@ extern /*@exits@*/ void (*yasm_fatal) (const char *message, va_list va); * \param message fatal error message * \param ... argument list for message */ +YASM_LIB_DECL /*@exits@*/ void yasm__fatal(const char *message, ...); /** Unconditionally clear the error indicator, freeing any associated data. * Has no effect if the error indicator is not set. */ +YASM_LIB_DECL void yasm_error_clear(void); /** Get the error indicator. YASM_ERROR_NONE is returned if no error has @@ -127,9 +137,11 @@ yasm_error_class yasm_error_occurred(void); * \return Nonzero if error indicator is set and a subclass of eclass, 0 * otherwise. */ +YASM_LIB_DECL int yasm_error_matches(yasm_error_class eclass); #ifndef YASM_DOXYGEN +YASM_LIB_DECL extern yasm_error_class yasm_eclass; #define yasm_error_occurred() yasm_eclass #endif @@ -140,6 +152,7 @@ extern yasm_error_class yasm_eclass; * \param format printf format string * \param va argument list for format */ +YASM_LIB_DECL void yasm_error_set_va(yasm_error_class eclass, const char *format, va_list va); /** Set the error indicator. Has no effect if the error indicator is already @@ -148,6 +161,7 @@ void yasm_error_set_va(yasm_error_class eclass, const char *format, va_list va); * \param format printf format string * \param ... argument list for format */ +YASM_LIB_DECL void yasm_error_set(yasm_error_class eclass, const char *format, ...) /*@printflike@*/; @@ -158,6 +172,7 @@ void yasm_error_set(yasm_error_class eclass, const char *format, ...) * \param format printf format string * \param va argument list for format */ +YASM_LIB_DECL void yasm_error_set_xref_va(unsigned long xrefline, const char *format, va_list va); @@ -168,6 +183,7 @@ void yasm_error_set_xref_va(unsigned long xrefline, const char *format, * \param format printf format string * \param ... argument list for format */ +YASM_LIB_DECL void yasm_error_set_xref(unsigned long xrefline, const char *format, ...) /*@printflike@*/; @@ -183,6 +199,7 @@ void yasm_error_set_xref(unsigned long xrefline, const char *format, ...) * \param xrefline virtual line used for cross-referencing (0 if no xref) * \param xrefstr cross-reference error message (NULL if no xref) */ +YASM_LIB_DECL void yasm_error_fetch(/*@out@*/ yasm_error_class *eclass, /*@out@*/ /*@only@*/ /*@null@*/ char **str, /*@out@*/ unsigned long *xrefline, @@ -191,6 +208,7 @@ void yasm_error_fetch(/*@out@*/ yasm_error_class *eclass, /** Unconditionally clear all warning indicators, freeing any associated data. * Has no effect if no warning indicators have been set. */ +YASM_LIB_DECL void yasm_warn_clear(void); /** Get the first warning indicator. YASM_WARN_NONE is returned if no warning @@ -198,6 +216,7 @@ void yasm_warn_clear(void); * be treated as a boolean value. * \return First warning indicator. */ +YASM_LIB_DECL yasm_warn_class yasm_warn_occurred(void); /** Add a warning indicator (va_list version). @@ -205,6 +224,7 @@ yasm_warn_class yasm_warn_occurred(void); * \param format printf format string * \param va argument list for format */ +YASM_LIB_DECL void yasm_warn_set_va(yasm_warn_class wclass, const char *format, va_list va); /** Add a warning indicator. @@ -212,6 +232,7 @@ void yasm_warn_set_va(yasm_warn_class wclass, const char *format, va_list va); * \param format printf format string * \param ... argument list for format */ +YASM_LIB_DECL void yasm_warn_set(yasm_warn_class wclass, const char *format, ...) /*@printflike@*/; @@ -225,30 +246,36 @@ void yasm_warn_set(yasm_warn_class wclass, const char *format, ...) * \param wclass warning class (output) * \param str warning message */ +YASM_LIB_DECL void yasm_warn_fetch(/*@out@*/ yasm_warn_class *wclass, /*@out@*/ /*@only@*/ char **str); /** Enable a class of warnings. * \param wclass warning class */ +YASM_LIB_DECL void yasm_warn_enable(yasm_warn_class wclass); /** Disable a class of warnings. * \param wclass warning class */ +YASM_LIB_DECL void yasm_warn_disable(yasm_warn_class wclass); /** Disable all classes of warnings. */ +YASM_LIB_DECL void yasm_warn_disable_all(void); /** Create an error/warning set for collection of multiple error/warnings. * \return Newly allocated set. */ +YASM_LIB_DECL /*@only@*/ yasm_errwarns *yasm_errwarns_create(void); /** Destroy an error/warning set. * \param errwarns error/warning set */ +YASM_LIB_DECL void yasm_errwarns_destroy(/*@only@*/ yasm_errwarns *errwarns); /** Propagate error indicator and warning indicator(s) to an error/warning set. @@ -261,6 +288,7 @@ void yasm_errwarns_destroy(/*@only@*/ yasm_errwarns *errwarns); * \param errwarns error/warning set * \param line virtual line */ +YASM_LIB_DECL void yasm_errwarn_propagate(yasm_errwarns *errwarns, unsigned long line); /** Get total number of errors logged. @@ -268,6 +296,7 @@ void yasm_errwarn_propagate(yasm_errwarns *errwarns, unsigned long line); * \param warning_as_error if nonzero, warnings are treated as errors. * \return Number of errors. */ +YASM_LIB_DECL unsigned int yasm_errwarns_num_errors(yasm_errwarns *errwarns, int warning_as_error); @@ -299,6 +328,7 @@ typedef void (*yasm_print_warning_func) * \param print_error function called to print out errors * \param print_warning function called to print out warnings */ +YASM_LIB_DECL void yasm_errwarns_output_all (yasm_errwarns *errwarns, yasm_linemap *lm, int warning_as_error, yasm_print_error_func print_error, yasm_print_warning_func print_warning); @@ -308,12 +338,14 @@ void yasm_errwarns_output_all * \param ch possibly unprintable character * \return Printable string representation (static buffer). */ +YASM_LIB_DECL char *yasm__conv_unprint(int ch); /** Hook for library users to map to gettext() if GNU gettext is being used. * \param msgid message catalog identifier * \return Translated message. */ +YASM_LIB_DECL extern const char * (*yasm_gettext_hook) (const char *msgid); #endif diff --git a/libyasm/expr.h b/libyasm/expr.h index 990452f2..96d1796c 100644 --- a/libyasm/expr.h +++ b/libyasm/expr.h @@ -34,6 +34,10 @@ #ifndef YASM_EXPR_H #define YASM_EXPR_H +#ifndef YASM_LIB_DECL +#define YASM_LIB_DECL +#endif + /** Type of an expression item. Types are listed in canonical sorting order. * See expr_order_terms(). * Note #YASM_EXPR_PRECBC must be used carefully (in a-b pairs), as only @@ -86,6 +90,7 @@ struct yasm_expr { * \param line virtual line (where expression defined) * \return Newly allocated expression. */ +YASM_LIB_DECL /*@only@*/ yasm_expr *yasm_expr_create (yasm_expr_op op, /*@only@*/ yasm_expr__item *a, /*@only@*/ /*@null@*/ yasm_expr__item *b, unsigned long line); @@ -94,36 +99,42 @@ struct yasm_expr { * \param precbc preceding bytecode * \return Newly allocated expression item. */ +YASM_LIB_DECL /*@only@*/ yasm_expr__item *yasm_expr_precbc(/*@keep@*/ yasm_bytecode *precbc); /** Create a new symbol expression item. * \param sym symbol * \return Newly allocated expression item. */ +YASM_LIB_DECL /*@only@*/ yasm_expr__item *yasm_expr_sym(/*@keep@*/ yasm_symrec *sym); /** Create a new expression expression item. * \param e expression * \return Newly allocated expression item. */ +YASM_LIB_DECL /*@only@*/ yasm_expr__item *yasm_expr_expr(/*@keep@*/ yasm_expr *e); /** Create a new intnum expression item. * \param intn intnum * \return Newly allocated expression item. */ +YASM_LIB_DECL /*@only@*/ yasm_expr__item *yasm_expr_int(/*@keep@*/ yasm_intnum *intn); /** Create a new floatnum expression item. * \param flt floatnum * \return Newly allocated expression item. */ +YASM_LIB_DECL /*@only@*/ yasm_expr__item *yasm_expr_float(/*@keep@*/ yasm_floatnum *flt); /** Create a new register expression item. * \param reg register * \return Newly allocated expression item. */ +YASM_LIB_DECL /*@only@*/ yasm_expr__item *yasm_expr_reg(uintptr_t reg); /** Create a new expression tree e=l op r. @@ -165,6 +176,7 @@ yasm_expr *yasm_expr_copy(const yasm_expr *e); /** Destroy (free allocated memory for) an expression. * \param e expression */ +YASM_LIB_DECL void yasm_expr_destroy(/*@only@*/ /*@null@*/ yasm_expr *e); /** Determine if an expression is a specified operation (at the top level). @@ -173,6 +185,7 @@ void yasm_expr_destroy(/*@only@*/ /*@null@*/ yasm_expr *e); * \return Nonzero if the expression was the specified operation at the top * level, zero otherwise. */ +YASM_LIB_DECL int yasm_expr_is_op(const yasm_expr *e, yasm_expr_op op); /** Extra transformation function for yasm_expr__level_tree(). @@ -196,6 +209,7 @@ typedef /*@only@*/ yasm_expr * (*yasm_expr_xform_func) * \param expr_xform_extra_data data to pass to expr_xform_extra * \return Leveled expression. */ +YASM_LIB_DECL /*@only@*/ /*@null@*/ yasm_expr *yasm_expr__level_tree (/*@returned@*/ /*@only@*/ /*@null@*/ yasm_expr *e, int fold_const, int simplify_ident, int simplify_reg_mul, int calc_bc_dist, @@ -220,6 +234,7 @@ typedef /*@only@*/ yasm_expr * (*yasm_expr_xform_func) * The input expression is modified such that on return, it's the * offset expression. */ +YASM_LIB_DECL /*@only@*/ /*@null@*/ yasm_expr *yasm_expr_extract_deep_segoff(yasm_expr **ep); /** Extract the segment portion of a SEG:OFF expression, leaving the offset. @@ -229,6 +244,7 @@ typedef /*@only@*/ yasm_expr * (*yasm_expr_xform_func) * expression is modified such that on return, it's the offset * expression. */ +YASM_LIB_DECL /*@only@*/ /*@null@*/ yasm_expr *yasm_expr_extract_segoff(yasm_expr **ep); /** Extract the right portion (y) of a x WRT y expression, leaving the left @@ -239,6 +255,7 @@ typedef /*@only@*/ yasm_expr * (*yasm_expr_xform_func) * input expression is modified such that on return, it's the left side * of the WRT expression. */ +YASM_LIB_DECL /*@only@*/ /*@null@*/ yasm_expr *yasm_expr_extract_wrt(yasm_expr **ep); /** Get the integer value of an expression if it's just an integer. @@ -249,6 +266,7 @@ typedef /*@only@*/ yasm_expr * (*yasm_expr_xform_func) * integers, ie floats, non-valued labels, registers); otherwise the * intnum value of the expression. */ +YASM_LIB_DECL /*@dependent@*/ /*@null@*/ yasm_intnum *yasm_expr_get_intnum (yasm_expr **ep, int calc_bc_dist); @@ -258,6 +276,7 @@ typedef /*@only@*/ yasm_expr * (*yasm_expr_xform_func) * \return NULL if the expression is too complex; otherwise the symbol value of * the expression. */ +YASM_LIB_DECL /*@dependent@*/ /*@null@*/ const yasm_symrec *yasm_expr_get_symrec (yasm_expr **ep, int simplify); @@ -267,6 +286,7 @@ typedef /*@only@*/ yasm_expr * (*yasm_expr_xform_func) * \return NULL if the expression is too complex; otherwise the register value * of the expression. */ +YASM_LIB_DECL /*@dependent@*/ /*@null@*/ const uintptr_t *yasm_expr_get_reg (yasm_expr **ep, int simplify); @@ -274,6 +294,7 @@ typedef /*@only@*/ yasm_expr * (*yasm_expr_xform_func) * \param e expression * \param f file */ +YASM_LIB_DECL void yasm_expr_print(/*@null@*/ const yasm_expr *e, FILE *f); /** Traverse over expression tree in order (const version). @@ -284,6 +305,7 @@ void yasm_expr_print(/*@null@*/ const yasm_expr *e, FILE *f); * \return Stops early (and returns 1) if func returns 1. * Otherwise returns 0. */ +YASM_LIB_DECL int yasm_expr__traverse_leaves_in_const (const yasm_expr *e, /*@null@*/ void *d, int (*func) (/*@null@*/ const yasm_expr__item *ei, /*@null@*/ void *d)); @@ -296,6 +318,7 @@ int yasm_expr__traverse_leaves_in_const * \return Stops early (and returns 1) if func returns 1. * Otherwise returns 0. */ +YASM_LIB_DECL int yasm_expr__traverse_leaves_in (yasm_expr *e, /*@null@*/ void *d, int (*func) (/*@null@*/ yasm_expr__item *ei, /*@null@*/ void *d)); @@ -308,6 +331,7 @@ int yasm_expr__traverse_leaves_in * \param e expression * \note Only performs reordering on *one* level (no recursion). */ +YASM_LIB_DECL void yasm_expr__order_terms(yasm_expr *e); /** Copy entire expression EXCEPT for index "except" at *top level only*. @@ -315,6 +339,7 @@ void yasm_expr__order_terms(yasm_expr *e); * \param except term index not to copy; -1 to copy all terms * \return Newly allocated copy of expression. */ +YASM_LIB_DECL yasm_expr *yasm_expr__copy_except(const yasm_expr *e, int except); /** Test if expression contains an item. Searches recursively into @@ -323,6 +348,7 @@ yasm_expr *yasm_expr__copy_except(const yasm_expr *e, int except); * \param t type of item to look for * \return Nonzero if expression contains an item of type t, zero if not. */ +YASM_LIB_DECL int yasm_expr__contains(const yasm_expr *e, yasm_expr__type t); /** Transform symrec-symrec terms in expression into #YASM_EXPR_SUBST items. @@ -333,6 +359,7 @@ int yasm_expr__contains(const yasm_expr *e, yasm_expr__type t); * pair, bytecode pair (bc2-bc1), and cbd (callback data) * \return Number of transformations made. */ +YASM_LIB_DECL int yasm_expr__bc_dist_subst(yasm_expr **ep, void *cbd, void (*callback) (unsigned int subst, yasm_bytecode *precbc, @@ -346,6 +373,7 @@ int yasm_expr__bc_dist_subst(yasm_expr **ep, void *cbd, * \param items items array * \return 1 on error (index out of range). */ +YASM_LIB_DECL int yasm_expr__subst(yasm_expr *e, unsigned int num_items, const yasm_expr__item *items); diff --git a/libyasm/file.h b/libyasm/file.h index 4a1cd005..f257faed 100644 --- a/libyasm/file.h +++ b/libyasm/file.h @@ -34,6 +34,10 @@ #ifndef YASM_FILE_H #define YASM_FILE_H +#ifndef YASM_LIB_DECL +#define YASM_LIB_DECL +#endif + /** Re2c scanner state. */ typedef struct yasm_scanner { unsigned char *bot; /**< Bottom of scan buffer */ @@ -48,11 +52,13 @@ typedef struct yasm_scanner { /** Initialize scanner state. * \param scanner Re2c scanner state */ +YASM_LIB_DECL void yasm_scanner_initialize(yasm_scanner *scanner); /** Frees any memory used by scanner state; does not free state itself. * \param scanner Re2c scanner state */ +YASM_LIB_DECL void yasm_scanner_delete(yasm_scanner *scanner); /** Fill a scanner state structure with data coming from an input function. @@ -64,6 +70,7 @@ void yasm_scanner_delete(yasm_scanner *scanner); * \return 1 if this was the first time this function was called on this * scanner state, 0 otherwise. */ +YASM_LIB_DECL int yasm_fill_helper (yasm_scanner *scanner, unsigned char **cursor, size_t (*input_func) (void *d, unsigned char *buf, size_t max), @@ -78,6 +85,7 @@ int yasm_fill_helper * \param str C-style string (updated in place) * \param len length of string (updated with new length) */ +YASM_LIB_DECL void yasm_unescape_cstring(unsigned char *str, size_t *len); /** Split a UNIX pathname into head (directory) and tail (base filename) @@ -87,6 +95,7 @@ void yasm_unescape_cstring(unsigned char *str, size_t *len); * \param tail (returned) base filename * \return Length of head (directory). */ +YASM_LIB_DECL size_t yasm__splitpath_unix(const char *path, /*@out@*/ const char **tail); /** Split a Windows pathname into head (directory) and tail (base filename) @@ -96,6 +105,7 @@ size_t yasm__splitpath_unix(const char *path, /*@out@*/ const char **tail); * \param tail (returned) base filename * \return Length of head (directory). */ +YASM_LIB_DECL size_t yasm__splitpath_win(const char *path, /*@out@*/ const char **tail); /** Split a pathname into head (directory) and tail (base filename) portions. @@ -119,6 +129,7 @@ size_t yasm__splitpath_win(const char *path, /*@out@*/ const char **tail); * \internal * \return Current working directory pathname (newly allocated). */ +YASM_LIB_DECL /*@only@*/ char *yasm__getcwd(void); /** Convert a UNIX relative or absolute pathname into an absolute pathname. @@ -126,6 +137,7 @@ size_t yasm__splitpath_win(const char *path, /*@out@*/ const char **tail); * \param path pathname * \return Absolute version of path (newly allocated). */ +YASM_LIB_DECL /*@only@*/ char *yasm__abspath_unix(const char *path); /** Convert a Windows relative or absolute pathname into an absolute pathname. @@ -133,6 +145,7 @@ size_t yasm__splitpath_win(const char *path, /*@out@*/ const char **tail); * \param path pathname * \return Absolute version of path (newly allocated). */ +YASM_LIB_DECL /*@only@*/ char *yasm__abspath_win(const char *path); /** Convert a relative or absolute pathname into an absolute pathname. @@ -159,6 +172,7 @@ size_t yasm__splitpath_win(const char *path, /*@out@*/ const char **tail); * \param to to pathname * \return Combined path (newly allocated). */ +YASM_LIB_DECL char *yasm__combpath_unix(const char *from, const char *to); /** Build a Windows pathname that is equivalent to accessing the "to" pathname @@ -169,6 +183,7 @@ char *yasm__combpath_unix(const char *from, const char *to); * \param to to pathname * \return Combined path (newly allocated). */ +YASM_LIB_DECL char *yasm__combpath_win(const char *from, const char *to); /** Build a pathname that is equivalent to accessing the "to" pathname @@ -208,16 +223,19 @@ char *yasm__combpath_win(const char *from, const char *to); * may be passed if this is unwanted. * \return fopen'ed include file, or NULL if not found. */ +YASM_LIB_DECL /*@null@*/ FILE *yasm_fopen_include (const char *iname, const char *from, const char *mode, /*@null@*/ /*@out@*/ /*@only@*/ char **oname); /** Delete any stored include paths added by yasm_add_include_path(). */ +YASM_LIB_DECL void yasm_delete_include_paths(void); /** Iterate through include paths. */ +YASM_LIB_DECL const char * yasm_get_include_dir(void **iter); /** Add an include path for use by yasm_fopen_include(). @@ -226,6 +244,7 @@ const char * yasm_get_include_dir(void **iter); * * \param path path to add */ +YASM_LIB_DECL void yasm_add_include_path(const char *path); /** Write an 8-bit value to a buffer, incrementing buffer pointer. @@ -356,6 +375,7 @@ void yasm_add_include_path(const char *path); * \param f file * \return 1 if the write was successful, 0 if not (just like fwrite()). */ +YASM_LIB_DECL size_t yasm_fwrite_16_l(unsigned short val, FILE *f); /** Direct-to-file version of YASM_SAVE_32_L(). @@ -365,6 +385,7 @@ size_t yasm_fwrite_16_l(unsigned short val, FILE *f); * \param f file * \return 1 if the write was successful, 0 if not (just like fwrite()). */ +YASM_LIB_DECL size_t yasm_fwrite_32_l(unsigned long val, FILE *f); /** Direct-to-file version of YASM_SAVE_16_B(). @@ -374,6 +395,7 @@ size_t yasm_fwrite_32_l(unsigned long val, FILE *f); * \param f file * \return 1 if the write was successful, 0 if not (just like fwrite()). */ +YASM_LIB_DECL size_t yasm_fwrite_16_b(unsigned short val, FILE *f); /** Direct-to-file version of YASM_SAVE_32_B(). @@ -383,6 +405,7 @@ size_t yasm_fwrite_16_b(unsigned short val, FILE *f); * \param f file * \return 1 if the write was successful, 0 if not (just like fwrite()). */ +YASM_LIB_DECL size_t yasm_fwrite_32_b(unsigned long val, FILE *f); /** Read an 8-bit value from a buffer, incrementing buffer pointer. diff --git a/libyasm/floatnum.h b/libyasm/floatnum.h index 15696a56..8fa3d1d5 100644 --- a/libyasm/floatnum.h +++ b/libyasm/floatnum.h @@ -36,10 +36,16 @@ #ifndef YASM_FLOATNUM_H #define YASM_FLOATNUM_H +#ifndef YASM_LIB_DECL +#define YASM_LIB_DECL +#endif + /** Initialize floatnum internal data structures. */ +YASM_LIB_DECL void yasm_floatnum_initialize(void); /** Clean up internal floatnum allocations. */ +YASM_LIB_DECL void yasm_floatnum_cleanup(void); /** Create a new floatnum from a decimal string. The input string must be in @@ -47,17 +53,20 @@ void yasm_floatnum_cleanup(void); * \param str floating point decimal string * \return Newly allocated floatnum. */ +YASM_LIB_DECL /*@only@*/ yasm_floatnum *yasm_floatnum_create(const char *str); /** Duplicate a floatnum. * \param flt floatnum * \return Newly allocated floatnum with the same value as flt. */ +YASM_LIB_DECL /*@only@*/ yasm_floatnum *yasm_floatnum_copy(const yasm_floatnum *flt); /** Destroy (free allocated memory for) a floatnum. * \param flt floatnum */ +YASM_LIB_DECL void yasm_floatnum_destroy(/*@only@*/ yasm_floatnum *flt); /** Floating point calculation function: acc = acc op operand. @@ -68,6 +77,7 @@ void yasm_floatnum_destroy(/*@only@*/ yasm_floatnum *flt); * \param operand floatnum operand * \return Nonzero on error. */ +YASM_LIB_DECL int yasm_floatnum_calc(yasm_floatnum *acc, yasm_expr_op op, yasm_floatnum *operand); @@ -78,6 +88,7 @@ int yasm_floatnum_calc(yasm_floatnum *acc, yasm_expr_op op, * \return Nonzero if flt can't fit into single precision: -1 if underflow * occurred, 1 if overflow occurred. */ +YASM_LIB_DECL int yasm_floatnum_get_int(const yasm_floatnum *flt, /*@out@*/ unsigned long *ret_val); @@ -98,6 +109,7 @@ int yasm_floatnum_get_int(const yasm_floatnum *flt, * \return Nonzero if flt can't fit into the specified precision: -1 if * underflow occurred, 1 if overflow occurred. */ +YASM_LIB_DECL int yasm_floatnum_get_sized(const yasm_floatnum *flt, unsigned char *ptr, size_t destsize, size_t valsize, size_t shift, int bigendian, int warn); @@ -110,12 +122,14 @@ int yasm_floatnum_get_sized(const yasm_floatnum *flt, unsigned char *ptr, * \param size number of bits of output space * \return 1 if valid size, 0 if invalid size. */ +YASM_LIB_DECL int yasm_floatnum_check_size(const yasm_floatnum *flt, size_t size); /** Print various representations of a floatnum. For debugging purposes only. * \param f file * \param flt floatnum */ +YASM_LIB_DECL void yasm_floatnum_print(const yasm_floatnum *flt, FILE *f); #endif diff --git a/libyasm/hamt.h b/libyasm/hamt.h index d33bbe3b..c54172b7 100644 --- a/libyasm/hamt.h +++ b/libyasm/hamt.h @@ -34,6 +34,10 @@ #ifndef YASM_HAMT_H #define YASM_HAMT_H +#ifndef YASM_LIB_DECL +#define YASM_LIB_DECL +#endif + /** Hash array mapped trie data structure (opaque type). */ typedef struct HAMT HAMT; /** Hash array mapped trie entry (opaque type). */ @@ -45,6 +49,7 @@ typedef struct HAMTEntry HAMTEntry; * \param error_func function called on internal error * \return New, empty, hash array mapped trie. */ +YASM_LIB_DECL HAMT *HAMT_create(int nocase, /*@exits@*/ void (*error_func) (const char *file, unsigned int line, const char *message)); @@ -53,6 +58,7 @@ HAMT *HAMT_create(int nocase, /*@exits@*/ void (*error_func) * \param hamt Hash array mapped trie * \param deletefunc Data deletion function */ +YASM_LIB_DECL void HAMT_destroy(/*@only@*/ HAMT *hamt, void (*deletefunc) (/*@only@*/ void *data)); @@ -72,6 +78,7 @@ void HAMT_destroy(/*@only@*/ HAMT *hamt, * \param deletefunc Data deletion function if data is replaced * \return Data now associated with key. */ +YASM_LIB_DECL /*@dependent@*/ void *HAMT_insert(HAMT *hamt, /*@dependent@*/ const char *str, /*@only@*/ void *data, int *replace, void (*deletefunc) (/*@only@*/ void *data)); @@ -81,6 +88,7 @@ void HAMT_destroy(/*@only@*/ HAMT *hamt, * \param str Key * \return NULL if key/data not present in HAMT, otherwise associated data. */ +YASM_LIB_DECL /*@dependent@*/ /*@null@*/ void *HAMT_search(HAMT *hamt, const char *str); /** Traverse over all keys in HAMT, calling function on each data item. @@ -90,6 +98,7 @@ void HAMT_destroy(/*@only@*/ HAMT *hamt, * \return Stops early (and returns func's return value) if func returns a * nonzero value; otherwise 0. */ +YASM_LIB_DECL int HAMT_traverse(HAMT *hamt, /*@null@*/ void *d, int (*func) (/*@dependent@*/ /*@null@*/ void *node, /*@null@*/ void *d)); @@ -98,18 +107,21 @@ int HAMT_traverse(HAMT *hamt, /*@null@*/ void *d, * \param hamt Hash array mapped trie * \return First entry in HAMT, or NULL if HAMT is empty. */ +YASM_LIB_DECL const HAMTEntry *HAMT_first(const HAMT *hamt); /** Get the next entry in a HAMT. * \param prev Previous entry in HAMT * \return Next entry in HAMT, or NULL if no more entries. */ +YASM_LIB_DECL /*@null@*/ const HAMTEntry *HAMT_next(const HAMTEntry *prev); /** Get the corresponding data for a HAMT entry. * \param entry HAMT entry (as returned by HAMT_first() and HAMT_next()) * \return Corresponding data item. */ +YASM_LIB_DECL void *HAMTEntry_get_data(const HAMTEntry *entry); #endif diff --git a/libyasm/insn.h b/libyasm/insn.h index 905b2f96..9fdf0ebb 100644 --- a/libyasm/insn.h +++ b/libyasm/insn.h @@ -34,6 +34,10 @@ #ifndef YASM_INSN_H #define YASM_INSN_H +#ifndef YASM_LIB_DECL +#define YASM_LIB_DECL +#endif + /** Base structure for an effective address. As with all base * structures, must be present as the first element in any * #yasm_arch implementation of an effective address. @@ -154,24 +158,28 @@ struct yasm_insn { * \param ea effective address * \param segreg segment register (0 if none) */ +YASM_LIB_DECL void yasm_ea_set_segreg(yasm_effaddr *ea, uintptr_t segreg); /** Create an instruction operand from a register. * \param reg register * \return Newly allocated operand. */ +YASM_LIB_DECL yasm_insn_operand *yasm_operand_create_reg(uintptr_t reg); /** Create an instruction operand from a segment register. * \param segreg segment register * \return Newly allocated operand. */ +YASM_LIB_DECL yasm_insn_operand *yasm_operand_create_segreg(uintptr_t segreg); /** Create an instruction operand from an effective address. * \param ea effective address * \return Newly allocated operand. */ +YASM_LIB_DECL yasm_insn_operand *yasm_operand_create_mem(/*@only@*/ yasm_effaddr *ea); /** Create an instruction operand from an immediate expression. @@ -180,6 +188,7 @@ yasm_insn_operand *yasm_operand_create_mem(/*@only@*/ yasm_effaddr *ea); * \param val immediate expression * \return Newly allocated operand. */ +YASM_LIB_DECL yasm_insn_operand *yasm_operand_create_imm(/*@only@*/ yasm_expr *val); /** Get the first operand in an instruction. @@ -205,6 +214,7 @@ yasm_insn_operand *yasm_insn_op_next(yasm_insn_operand *op); * \return If operand was actually appended (it wasn't NULL), the operand; * otherwise NULL. */ +YASM_LIB_DECL /*@null@*/ yasm_insn_operand *yasm_insn_ops_append (yasm_insn *insn, /*@returned@*/ /*@null@*/ yasm_insn_operand *op); @@ -213,18 +223,21 @@ yasm_insn_operand *yasm_insn_op_next(yasm_insn_operand *op); * \param insn instruction * \param prefix data that identifies the prefix */ +YASM_LIB_DECL void yasm_insn_add_prefix(yasm_insn *insn, uintptr_t prefix); /** Associate a segment prefix with an instruction. * \param insn instruction * \param segreg data that identifies the segment register */ +YASM_LIB_DECL void yasm_insn_add_seg_prefix(yasm_insn *insn, uintptr_t segreg); /** Initialize the common parts of an instruction. * \internal For use by yasm_arch implementations only. * \param insn instruction */ +YASM_LIB_DECL void yasm_insn_initialize(/*@out@*/ yasm_insn *insn); /** Delete the common parts of an instruction. @@ -233,6 +246,7 @@ void yasm_insn_initialize(/*@out@*/ yasm_insn *insn); * \param content if nonzero, deletes content of each operand * \param arch architecture */ +YASM_LIB_DECL void yasm_insn_delete(yasm_insn *insn, void (*ea_destroy) (/*@only@*/ yasm_effaddr *)); @@ -243,12 +257,14 @@ void yasm_insn_delete(yasm_insn *insn, * \param indent_level indentation level * \param arch architecture */ +YASM_LIB_DECL void yasm_insn_print(const yasm_insn *insn, FILE *f, int indent_level); /** Finalize the common parts of an instruction. * \internal For use by yasm_arch implementations only. * \param insn instruction */ +YASM_LIB_DECL void yasm_insn_finalize(yasm_insn *insn); #endif diff --git a/libyasm/intnum.h b/libyasm/intnum.h index 382f5fb1..8e1529fc 100644 --- a/libyasm/intnum.h +++ b/libyasm/intnum.h @@ -34,34 +34,44 @@ #ifndef YASM_INTNUM_H #define YASM_INTNUM_H +#ifndef YASM_LIB_DECL +#define YASM_LIB_DECL +#endif + /** Initialize intnum internal data structures. */ +YASM_LIB_DECL void yasm_intnum_initialize(void); /** Clean up internal intnum allocations. */ +YASM_LIB_DECL void yasm_intnum_cleanup(void); /** Create a new intnum from a decimal string. * \param str decimal string * \return Newly allocated intnum. */ +YASM_LIB_DECL /*@only@*/ yasm_intnum *yasm_intnum_create_dec(char *str); /** Create a new intnum from a binary string. * \param str binary string * \return Newly allocated intnum. */ +YASM_LIB_DECL /*@only@*/ yasm_intnum *yasm_intnum_create_bin(char *str); /** Create a new intnum from an octal string. * \param str octal string * \return Newly allocated intnum. */ +YASM_LIB_DECL /*@only@*/ yasm_intnum *yasm_intnum_create_oct(char *str); /** Create a new intnum from a hexidecimal string. * \param str hexidecimal string * \return Newly allocated intnum. */ +YASM_LIB_DECL /*@only@*/ yasm_intnum *yasm_intnum_create_hex(char *str); /** Convert character constant to integer value, using NASM rules. NASM syntax @@ -70,18 +80,21 @@ void yasm_intnum_cleanup(void); * \param str character constant string * \return Newly allocated intnum. */ +YASM_LIB_DECL /*@only@*/ yasm_intnum *yasm_intnum_create_charconst_nasm(const char *str); /** Create a new intnum from an unsigned integer value. * \param i unsigned integer value * \return Newly allocated intnum. */ +YASM_LIB_DECL /*@only@*/ yasm_intnum *yasm_intnum_create_uint(unsigned long i); /** Create a new intnum from an signed integer value. * \param i signed integer value * \return Newly allocated intnum. */ +YASM_LIB_DECL /*@only@*/ yasm_intnum *yasm_intnum_create_int(long i); /** Create a new intnum from LEB128-encoded form. @@ -91,6 +104,7 @@ void yasm_intnum_cleanup(void); * \return Newly allocated intnum. Number of bytes read returned into * bytes_read parameter. */ +YASM_LIB_DECL /*@only@*/ yasm_intnum *yasm_intnum_create_leb128 (const unsigned char *ptr, int sign, /*@out@*/ unsigned long *size); @@ -101,6 +115,7 @@ void yasm_intnum_cleanup(void); * \param srcsize source buffer size (in bytes) * \param bigendian endianness (nonzero=big, zero=little) */ +YASM_LIB_DECL /*@only@*/ yasm_intnum *yasm_intnum_create_sized (unsigned char *ptr, int sign, size_t srcsize, int bigendian); @@ -108,11 +123,13 @@ void yasm_intnum_cleanup(void); * \param intn intnum * \return Newly allocated intnum with the same value as intn. */ +YASM_LIB_DECL /*@only@*/ yasm_intnum *yasm_intnum_copy(const yasm_intnum *intn); /** Destroy (free allocated memory for) an intnum. * \param intn intnum */ +YASM_LIB_DECL void yasm_intnum_destroy(/*@only@*/ yasm_intnum *intn); /** Floating point calculation function: acc = acc op operand. @@ -123,6 +140,7 @@ void yasm_intnum_destroy(/*@only@*/ yasm_intnum *intn); * \param operand intnum operand * \return Nonzero if error occurred. */ +YASM_LIB_DECL int yasm_intnum_calc(yasm_intnum *acc, yasm_expr_op op, yasm_intnum *operand); /** Compare two intnums. @@ -130,53 +148,62 @@ int yasm_intnum_calc(yasm_intnum *acc, yasm_expr_op op, yasm_intnum *operand); * \param intn2 second intnum * \return -1 if intn1 < intn2, 0 if intn1 == intn2, 1 if intn1 > intn2. */ +YASM_LIB_DECL int yasm_intnum_compare(const yasm_intnum *intn1, const yasm_intnum *intn2); /** Zero an intnum. * \param intn intnum */ +YASM_LIB_DECL void yasm_intnum_zero(yasm_intnum *intn); /** Set an intnum to the value of another intnum. * \param intn intnum * \param val intnum to get value from */ +YASM_LIB_DECL void yasm_intnum_set(yasm_intnum *intn, const yasm_intnum *val); /** Set an intnum to an unsigned integer. * \param intn intnum * \param val integer value */ +YASM_LIB_DECL void yasm_intnum_set_uint(yasm_intnum *intn, unsigned long val); /** Set an intnum to an signed integer. * \param intn intnum * \param val integer value */ +YASM_LIB_DECL void yasm_intnum_set_int(yasm_intnum *intn, long val); /** Simple value check for 0. * \param acc intnum * \return Nonzero if acc==0. */ +YASM_LIB_DECL int yasm_intnum_is_zero(const yasm_intnum *acc); /** Simple value check for 1. * \param acc intnum * \return Nonzero if acc==1. */ +YASM_LIB_DECL int yasm_intnum_is_pos1(const yasm_intnum *acc); /** Simple value check for -1. * \param acc intnum * \return Nonzero if acc==-1. */ +YASM_LIB_DECL int yasm_intnum_is_neg1(const yasm_intnum *acc); /** Simple sign check. * \param acc intnum * \return -1 if negative, 0 if zero, +1 if positive */ +YASM_LIB_DECL int yasm_intnum_sign(const yasm_intnum *acc); /** Convert an intnum to an unsigned 32-bit value. The value is in "standard" @@ -186,6 +213,7 @@ int yasm_intnum_sign(const yasm_intnum *acc); * \param intn intnum * \return Unsigned 32-bit value of intn. */ +YASM_LIB_DECL unsigned long yasm_intnum_get_uint(const yasm_intnum *intn); /** Convert an intnum to a signed 32-bit value. The value is in "standard" C @@ -195,6 +223,7 @@ unsigned long yasm_intnum_get_uint(const yasm_intnum *intn); * \param intn intnum * \return Signed 32-bit value of intn. */ +YASM_LIB_DECL long yasm_intnum_get_int(const yasm_intnum *intn); /** Output #yasm_intnum to buffer in little-endian or big-endian. Puts the @@ -211,6 +240,7 @@ long yasm_intnum_get_int(const yasm_intnum *intn); * \param warn enables standard warnings (value doesn't fit into valsize * bits): <0=signed warnings, >0=unsigned warnings, 0=no warn */ +YASM_LIB_DECL void yasm_intnum_get_sized(const yasm_intnum *intn, unsigned char *ptr, size_t destsize, size_t valsize, int shift, int bigendian, int warn); @@ -225,6 +255,7 @@ void yasm_intnum_get_sized(const yasm_intnum *intn, unsigned char *ptr, * 2 => (signed min, unsigned max) * \return Nonzero if intnum will fit. */ +YASM_LIB_DECL int yasm_intnum_check_size(const yasm_intnum *intn, size_t size, size_t rshift, int rangetype); @@ -234,6 +265,7 @@ int yasm_intnum_check_size(const yasm_intnum *intn, size_t size, * \param high high end of range (inclusive) * \return Nonzero if intnum is within range. */ +YASM_LIB_DECL int yasm_intnum_in_range(const yasm_intnum *intn, long low, long high); /** Output #yasm_intnum to buffer in LEB128-encoded form. @@ -242,6 +274,7 @@ int yasm_intnum_in_range(const yasm_intnum *intn, long low, long high); * \param sign signedness of LEB128 encoding (0=unsigned, 1=signed) * \return Number of bytes generated. */ +YASM_LIB_DECL unsigned long yasm_intnum_get_leb128(const yasm_intnum *intn, unsigned char *ptr, int sign); @@ -250,6 +283,7 @@ unsigned long yasm_intnum_get_leb128(const yasm_intnum *intn, * \param sign signedness of LEB128 encoding (0=unsigned, 1=signed) * \return Number of bytes. */ +YASM_LIB_DECL unsigned long yasm_intnum_size_leb128(const yasm_intnum *intn, int sign); /** Output integer to buffer in signed LEB128-encoded form. @@ -257,12 +291,14 @@ unsigned long yasm_intnum_size_leb128(const yasm_intnum *intn, int sign); * \param ptr pointer to storage for output bytes * \return Number of bytes generated. */ +YASM_LIB_DECL unsigned long yasm_get_sleb128(long v, unsigned char *ptr); /** Calculate number of bytes signed LEB128-encoded form of integer will take. * \param v integer * \return Number of bytes. */ +YASM_LIB_DECL unsigned long yasm_size_sleb128(long v); /** Output integer to buffer in unsigned LEB128-encoded form. @@ -270,12 +306,14 @@ unsigned long yasm_size_sleb128(long v); * \param ptr pointer to storage for output bytes * \return Number of bytes generated. */ +YASM_LIB_DECL unsigned long yasm_get_uleb128(unsigned long v, unsigned char *ptr); /** Calculate number of bytes unsigned LEB128-encoded form of integer will take. * \param v integer * \return Number of bytes. */ +YASM_LIB_DECL unsigned long yasm_size_uleb128(unsigned long v); /** Get an intnum as a signed decimal string. The returned string will @@ -284,12 +322,14 @@ unsigned long yasm_size_uleb128(unsigned long v); * \return Newly allocated string containing the decimal representation of * the intnum. */ +YASM_LIB_DECL /*@only@*/ char *yasm_intnum_get_str(const yasm_intnum *intn); /** Print an intnum. For debugging purposes. * \param f file * \param intn intnum */ +YASM_LIB_DECL void yasm_intnum_print(const yasm_intnum *intn, FILE *f); #endif diff --git a/libyasm/inttree.h b/libyasm/inttree.h index 972f5713..de037e44 100644 --- a/libyasm/inttree.h +++ b/libyasm/inttree.h @@ -2,6 +2,10 @@ #ifndef YASM_INTTREE_H #define YASM_INTTREE_H +#ifndef YASM_LIB_DECL +#define YASM_LIB_DECL +#endif + /* The interval_tree.h and interval_tree.cc files contain code for * interval trees implemented using red-black-trees as described in * the book _Introduction_To_Algorithms_ by Cormen, Leisserson, @@ -45,14 +49,22 @@ typedef struct IntervalTree { unsigned int recursionNodeStackTop; } IntervalTree; +YASM_LIB_DECL IntervalTree *IT_create(void); +YASM_LIB_DECL void IT_destroy(IntervalTree *); +YASM_LIB_DECL void IT_print(const IntervalTree *); +YASM_LIB_DECL void *IT_delete_node(IntervalTree *, IntervalTreeNode *, long *low, long *high); +YASM_LIB_DECL IntervalTreeNode *IT_insert(IntervalTree *, long low, long high, void *data); +YASM_LIB_DECL IntervalTreeNode *IT_get_predecessor(const IntervalTree *, IntervalTreeNode *); +YASM_LIB_DECL IntervalTreeNode *IT_get_successor(const IntervalTree *, IntervalTreeNode *); +YASM_LIB_DECL void IT_enumerate(IntervalTree *, long low, long high, void *cbd, void (*callback) (IntervalTreeNode *node, void *cbd)); diff --git a/libyasm/linemap.h b/libyasm/linemap.h index 18062989..03912551 100644 --- a/libyasm/linemap.h +++ b/libyasm/linemap.h @@ -34,20 +34,27 @@ #ifndef YASM_LINEMAP_H #define YASM_LINEMAP_H +#ifndef YASM_LIB_DECL +#define YASM_LIB_DECL +#endif + /** Create a new line mapping repository. * \return New repository. */ +YASM_LIB_DECL yasm_linemap *yasm_linemap_create(void); /** Clean up any memory allocated for a repository. * \param linemap line mapping repository */ +YASM_LIB_DECL void yasm_linemap_destroy(yasm_linemap *linemap); /** Get the current line position in a repository. * \param linemap line mapping repository * \return Current virtual line. */ +YASM_LIB_DECL unsigned long yasm_linemap_get_current(yasm_linemap *linemap); /** Get bytecode and source line information, if any, for a virtual line. @@ -59,6 +66,7 @@ unsigned long yasm_linemap_get_current(yasm_linemap *linemap); * \note If source line information is not available, bcp and sourcep targets * are set to NULL. */ +YASM_LIB_DECL int yasm_linemap_get_source(yasm_linemap *linemap, unsigned long line, /*@null@*/ yasm_bytecode **bcp, const char **sourcep); @@ -71,6 +79,7 @@ int yasm_linemap_get_source(yasm_linemap *linemap, unsigned long line, * \param source source code line * \note The source code line pointer is NOT kept, it is strdup'ed. */ +YASM_LIB_DECL void yasm_linemap_add_source(yasm_linemap *linemap, /*@null@*/ yasm_bytecode *bc, const char *source); @@ -79,6 +88,7 @@ void yasm_linemap_add_source(yasm_linemap *linemap, * \param linemap line mapping repository * \return The current (new) virtual line. */ +YASM_LIB_DECL unsigned long yasm_linemap_goto_next(yasm_linemap *linemap); /** Set a new file/line physical association starting point at the current @@ -89,6 +99,7 @@ unsigned long yasm_linemap_goto_next(yasm_linemap *linemap); * \param file_line physical line number * \param line_inc line increment */ +YASM_LIB_DECL void yasm_linemap_set(yasm_linemap *linemap, /*@null@*/ const char *filename, unsigned long file_line, unsigned long line_inc); @@ -100,6 +111,7 @@ void yasm_linemap_set(yasm_linemap *linemap, /*@null@*/ const char *filename, * \param file_line physical line number * \return The virtual line number of the poked association. */ +YASM_LIB_DECL unsigned long yasm_linemap_poke(yasm_linemap *linemap, /*@null@*/ const char *filename, unsigned long file_line); @@ -110,6 +122,7 @@ unsigned long yasm_linemap_poke(yasm_linemap *linemap, * \param filename physical file name (output) * \param file_line physical line number (output) */ +YASM_LIB_DECL void yasm_linemap_lookup(yasm_linemap *linemap, unsigned long line, /*@out@*/ const char **filename, /*@out@*/ unsigned long *file_line); @@ -122,6 +135,7 @@ void yasm_linemap_lookup(yasm_linemap *linemap, unsigned long line, * \return Stops early (and returns func's return value) if func returns a * nonzero value; otherwise 0. */ +YASM_LIB_DECL int yasm_linemap_traverse_filenames (yasm_linemap *linemap, /*@null@*/ void *d, int (*func) (const char *filename, void *d)); diff --git a/libyasm/md5.h b/libyasm/md5.h index a7dbc9ab..7226f1dc 100644 --- a/libyasm/md5.h +++ b/libyasm/md5.h @@ -7,6 +7,10 @@ #ifndef YASM_MD5_H #define YASM_MD5_H +#ifndef YASM_LIB_DECL +#define YASM_LIB_DECL +#endif + /* Unlike previous versions of this code, uint32 need not be exactly 32 bits, merely 32 bits or more. Choosing a data type which is 32 bits instead of 64 is not important; speed is considerably more @@ -19,10 +23,14 @@ typedef struct yasm_md5_context { unsigned char in[64]; } yasm_md5_context; +YASM_LIB_DECL void yasm_md5_init(yasm_md5_context *context); +YASM_LIB_DECL void yasm_md5_update(yasm_md5_context *context, unsigned char const *buf, unsigned long len); +YASM_LIB_DECL void yasm_md5_final(unsigned char digest[16], yasm_md5_context *context); +YASM_LIB_DECL void yasm_md5_transform(unsigned long buf[4], const unsigned char in[64]); #endif /* !YASM_MD5_H */ diff --git a/libyasm/module.h b/libyasm/module.h index b6b4f60b..ce2e14b7 100644 --- a/libyasm/module.h +++ b/libyasm/module.h @@ -27,6 +27,10 @@ #ifndef YASM_MODULE_H #define YASM_MODULE_H +#ifndef YASM_LIB_DECL +#define YASM_LIB_DECL +#endif + typedef enum yasm_module_type { YASM_MODULE_ARCH = 0, YASM_MODULE_DBGFMT, @@ -36,6 +40,7 @@ typedef enum yasm_module_type { YASM_MODULE_PREPROC } yasm_module_type; +YASM_LIB_DECL /*@dependent@*/ /*@null@*/ void *yasm_load_module (yasm_module_type type, const char *keyword); @@ -52,6 +57,7 @@ typedef enum yasm_module_type { #define yasm_load_preproc(keyword) \ yasm_load_module(YASM_MODULE_PREPROC, keyword) +YASM_LIB_DECL void yasm_list_modules (yasm_module_type type, void (*printfunc) (const char *name, const char *keyword)); @@ -69,6 +75,7 @@ void yasm_list_modules #define yasm_list_preproc(func) \ yasm_list_modules(YASM_MODULE_PREPROC, func) +YASM_LIB_DECL void yasm_register_module(yasm_module_type type, const char *keyword, void *data); diff --git a/libyasm/phash.h b/libyasm/phash.h index c4cc88a0..f446eeab 100644 --- a/libyasm/phash.h +++ b/libyasm/phash.h @@ -10,6 +10,12 @@ Source is http://burtleburtle.net/bob/c/lookupa.h ------------------------------------------------------------------------------ */ +#ifndef YASM_LIB_DECL +#define YASM_LIB_DECL +#endif + +YASM_LIB_DECL unsigned long phash_lookup(const char *k, size_t length, unsigned long level); +YASM_LIB_DECL void phash_checksum(const char *k, size_t length, unsigned long *state); diff --git a/libyasm/section.h b/libyasm/section.h index d42040a6..b17f887d 100644 --- a/libyasm/section.h +++ b/libyasm/section.h @@ -34,6 +34,10 @@ #ifndef YASM_SECTION_H #define YASM_SECTION_H +#ifndef YASM_LIB_DECL +#define YASM_LIB_DECL +#endif + /** Basic YASM relocation. Object formats will need to extend this * structure with additional fields for relocation type, etc. */ @@ -79,6 +83,7 @@ struct yasm_object { * \param dbgfmt_module debug format module * \return Newly allocated object, or NULL on error. */ +YASM_LIB_DECL /*@null@*/ /*@only@*/ yasm_object *yasm_object_create (const char *src_filename, const char *obj_filename, /*@kept@*/ yasm_arch *arch, @@ -99,6 +104,7 @@ struct yasm_object { * already exists) * \return New section. */ +YASM_LIB_DECL /*@dependent@*/ yasm_section *yasm_object_get_general (yasm_object *object, const char *name, unsigned long align, int code, int res_only, /*@out@*/ int *isnew, unsigned long line); @@ -113,6 +119,7 @@ struct yasm_object { * \param line virtual line (from yasm_linemap) * \return 0 if directive recognized, nonzero if unrecognized. */ +YASM_LIB_DECL int yasm_object_directive(yasm_object *object, const char *name, const char *parser, yasm_valparamhead *valparams, yasm_valparamhead *objext_valparams, @@ -122,6 +129,7 @@ int yasm_object_directive(yasm_object *object, const char *name, * object and all bytecodes within those sections are also deleted. * \param object object */ +YASM_LIB_DECL void yasm_object_destroy(/*@only@*/ yasm_object *object); /** Print an object. For debugging purposes. @@ -129,6 +137,7 @@ void yasm_object_destroy(/*@only@*/ yasm_object *object); * \param f file * \param indent_level indentation level */ +YASM_LIB_DECL void yasm_object_print(const yasm_object *object, FILE *f, int indent_level); /** Finalize an object after parsing. @@ -136,6 +145,7 @@ void yasm_object_print(const yasm_object *object, FILE *f, int indent_level); * \param errwarns error/warning set * \note Errors/warnings are stored into errwarns. */ +YASM_LIB_DECL void yasm_object_finalize(yasm_object *object, yasm_errwarns *errwarns); /** Traverses all sections in an object, calling a function on each section. @@ -145,6 +155,7 @@ void yasm_object_finalize(yasm_object *object, yasm_errwarns *errwarns); * \return Stops early (and returns func's return value) if func returns a * nonzero value; otherwise 0. */ +YASM_LIB_DECL int yasm_object_sections_traverse (yasm_object *object, /*@null@*/ void *d, int (*func) (yasm_section *sect, /*@null@*/ void *d)); @@ -154,6 +165,7 @@ int yasm_object_sections_traverse * \param name section name * \return Section matching name, or NULL if no match found. */ +YASM_LIB_DECL /*@dependent@*/ /*@null@*/ yasm_section *yasm_object_find_general (yasm_object *object, const char *name); @@ -161,6 +173,7 @@ int yasm_object_sections_traverse * \param object object * \param src_filename new source filename (e.g. "file.asm") */ +YASM_LIB_DECL void yasm_object_set_source_fn(yasm_object *object, const char *src_filename); /** Optimize an object. Takes the unoptimized object and optimizes it. @@ -169,24 +182,28 @@ void yasm_object_set_source_fn(yasm_object *object, const char *src_filename); * \param errwarns error/warning set * \note Optimization failures are stored into errwarns. */ +YASM_LIB_DECL void yasm_object_optimize(yasm_object *object, yasm_errwarns *errwarns); /** Determine if a section is flagged to contain code. * \param sect section * \return Nonzero if section is flagged to contain code. */ +YASM_LIB_DECL int yasm_section_is_code(yasm_section *sect); /** Get yasm_optimizer-specific flags. For yasm_optimizer use only. * \param sect section * \return Optimizer-specific flags. */ +YASM_LIB_DECL unsigned long yasm_section_get_opt_flags(const yasm_section *sect); /** Set yasm_optimizer-specific flags. For yasm_optimizer use only. * \param sect section * \param opt_flags optimizer-specific flags. */ +YASM_LIB_DECL void yasm_section_set_opt_flags(yasm_section *sect, unsigned long opt_flags); /** Determine if a section was declared as the "default" section (e.g. not @@ -194,18 +211,21 @@ void yasm_section_set_opt_flags(yasm_section *sect, unsigned long opt_flags); * \param sect section * \return Nonzero if section was declared as default. */ +YASM_LIB_DECL int yasm_section_is_default(const yasm_section *sect); /** Set section "default" flag to a new value. * \param sect section * \param def new value of default flag */ +YASM_LIB_DECL void yasm_section_set_default(yasm_section *sect, int def); /** Get object owner of a section. * \param sect section * \return Object this section is a part of. */ +YASM_LIB_DECL yasm_object *yasm_section_get_object(const yasm_section *sect); /** Get assocated data for a section and data callback. @@ -213,6 +233,7 @@ yasm_object *yasm_section_get_object(const yasm_section *sect); * \param callback callback used when adding data * \return Associated data (NULL if none). */ +YASM_LIB_DECL /*@dependent@*/ /*@null@*/ void *yasm_section_get_data (yasm_section *sect, const yasm_assoc_data_callback *callback); @@ -222,6 +243,7 @@ yasm_object *yasm_section_get_object(const yasm_section *sect); * \param callback callback * \param data data to associate */ +YASM_LIB_DECL void yasm_section_add_data(yasm_section *sect, const yasm_assoc_data_callback *callback, /*@null@*/ /*@only@*/ void *data); @@ -235,6 +257,7 @@ void yasm_section_add_data(yasm_section *sect, * The section will destroy the relocation address; it is the caller's * responsibility to destroy any other allocated data. */ +YASM_LIB_DECL void yasm_section_add_reloc(yasm_section *sect, yasm_reloc *reloc, void (*destroy_func) (/*@only@*/ void *reloc)); @@ -242,6 +265,7 @@ void yasm_section_add_reloc(yasm_section *sect, yasm_reloc *reloc, * \param sect section * \return First relocation for section. NULL if no relocations. */ +YASM_LIB_DECL /*@null@*/ yasm_reloc *yasm_section_relocs_first(yasm_section *sect); /** Get the next relocation for a section. @@ -258,6 +282,7 @@ void yasm_section_add_reloc(yasm_section *sect, yasm_reloc *reloc, * \param addrp address of relocation within section (returned) * \param symp relocated symbol (returned) */ +YASM_LIB_DECL void yasm_reloc_get(yasm_reloc *reloc, yasm_intnum **addrp, /*@dependent@*/ yasm_symrec **symp); @@ -266,6 +291,7 @@ void yasm_reloc_get(yasm_reloc *reloc, yasm_intnum **addrp, * \return First bytecode in section (at least one empty bytecode is always * present). */ +YASM_LIB_DECL yasm_bytecode *yasm_section_bcs_first(yasm_section *sect); /** Get the last bytecode in a section. @@ -273,6 +299,7 @@ yasm_bytecode *yasm_section_bcs_first(yasm_section *sect); * \return Last bytecode in section (at least one empty bytecode is always * present). */ +YASM_LIB_DECL yasm_bytecode *yasm_section_bcs_last(yasm_section *sect); /** Add bytecode to the end of a section. @@ -284,6 +311,7 @@ yasm_bytecode *yasm_section_bcs_last(yasm_section *sect); * \return If bytecode was actually appended (it wasn't NULL or empty), the * bytecode; otherwise NULL. */ +YASM_LIB_DECL /*@only@*/ /*@null@*/ yasm_bytecode *yasm_section_bcs_append (yasm_section *sect, /*@returned@*/ /*@only@*/ /*@null@*/ yasm_bytecode *bc); @@ -298,6 +326,7 @@ yasm_bytecode *yasm_section_bcs_last(yasm_section *sect); * \note If errwarns is non-NULL, yasm_errwarn_propagate() is called after * each call to func (with the bytecode's line number). */ +YASM_LIB_DECL int yasm_section_bcs_traverse (yasm_section *sect, /*@null@*/ yasm_errwarns *errwarns, /*@null@*/ void *d, int (*func) (yasm_bytecode *bc, /*@null@*/ void *d)); @@ -306,6 +335,7 @@ int yasm_section_bcs_traverse * \param sect section * \return Section name. */ +YASM_LIB_DECL /*@observer@*/ const char *yasm_section_get_name(const yasm_section *sect); /** Change alignment of a section. @@ -313,6 +343,7 @@ int yasm_section_bcs_traverse * \param align alignment in bytes * \param line virtual line */ +YASM_LIB_DECL void yasm_section_set_align(yasm_section *sect, unsigned long align, unsigned long line); @@ -320,6 +351,7 @@ void yasm_section_set_align(yasm_section *sect, unsigned long align, * \param sect section * \return Alignment in bytes (0 if none). */ +YASM_LIB_DECL unsigned long yasm_section_get_align(const yasm_section *sect); /** Print a section. For debugging purposes. @@ -328,6 +360,7 @@ unsigned long yasm_section_get_align(const yasm_section *sect); * \param sect section * \param print_bcs if nonzero, print bytecodes within section */ +YASM_LIB_DECL void yasm_section_print(/*@null@*/ const yasm_section *sect, FILE *f, int indent_level, int print_bcs); diff --git a/libyasm/symrec.h b/libyasm/symrec.h index 349dcce5..10706d9d 100644 --- a/libyasm/symrec.h +++ b/libyasm/symrec.h @@ -34,6 +34,10 @@ #ifndef YASM_SYMREC_H #define YASM_SYMREC_H +#ifndef YASM_LIB_DECL +#define YASM_LIB_DECL +#endif + /** Symbol status. YASM_SYM_DEFINED is set by yasm_symtab_define_label(), * yasm_symtab_define_equ(), or yasm_symtab_declare()/yasm_symrec_declare() * with a visibility of #YASM_SYM_EXTERN or #YASM_SYM_COMMON. @@ -58,6 +62,7 @@ typedef enum yasm_sym_vis { } yasm_sym_vis; /** Create a new symbol table. */ +YASM_LIB_DECL yasm_symtab *yasm_symtab_create(void); /** Destroy a symbol table and all internal symbols. @@ -65,6 +70,7 @@ yasm_symtab *yasm_symtab_create(void); * \warning All yasm_symrec *'s into this symbol table become invalid after * this is called! */ +YASM_LIB_DECL void yasm_symtab_destroy(/*@only@*/ yasm_symtab *symtab); /** Get a reference to the symbol table's "absolute" symbol. This is @@ -74,6 +80,7 @@ void yasm_symtab_destroy(/*@only@*/ yasm_symtab *symtab); * \param symtab symbol table * \return Absolute symbol (dependent pointer, do not free). */ +YASM_LIB_DECL /*@dependent@*/ yasm_symrec *yasm_symtab_abs_sym(yasm_symtab *symtab); /** Get a reference to (use) a symbol. The symbol does not necessarily need to @@ -83,6 +90,7 @@ void yasm_symtab_destroy(/*@only@*/ yasm_symtab *symtab); * \param line virtual line where referenced * \return Symbol (dependent pointer, do not free). */ +YASM_LIB_DECL /*@dependent@*/ yasm_symrec *yasm_symtab_use (yasm_symtab *symtab, const char *name, unsigned long line); @@ -94,6 +102,7 @@ void yasm_symtab_destroy(/*@only@*/ yasm_symtab *symtab); * \return Symbol (dependent pointer, do not free). May be NULL if symbol * doesn't exist. */ +YASM_LIB_DECL /*@null@*/ /*@dependent@*/ yasm_symrec *yasm_symtab_get (yasm_symtab *symtab, const char *name); @@ -104,6 +113,7 @@ void yasm_symtab_destroy(/*@only@*/ yasm_symtab *symtab); * \param line virtual line of EQU * \return Symbol (dependent pointer, do not free). */ +YASM_LIB_DECL /*@dependent@*/ yasm_symrec *yasm_symtab_define_equ (yasm_symtab *symtab, const char *name, /*@keep@*/ yasm_expr *e, unsigned long line); @@ -117,6 +127,7 @@ void yasm_symtab_destroy(/*@only@*/ yasm_symtab *symtab); * \param line virtual line of label * \return Symbol (dependent pointer, do not free). */ +YASM_LIB_DECL /*@dependent@*/ yasm_symrec *yasm_symtab_define_label (yasm_symtab *symtab, const char *name, /*@dependent@*/ yasm_bytecode *precbc, int in_table, unsigned long line); @@ -131,6 +142,7 @@ void yasm_symtab_destroy(/*@only@*/ yasm_symtab *symtab); * \param line virtual line of label * \return Symbol (dependent pointer, do not free). */ +YASM_LIB_DECL /*@dependent@*/ yasm_symrec *yasm_symtab_define_curpos (yasm_symtab *symtab, const char *name, /*@dependent@*/ yasm_bytecode *precbc, unsigned long line); @@ -143,6 +155,7 @@ void yasm_symtab_destroy(/*@only@*/ yasm_symtab *symtab); * \param vis symbol visibility * \return Symbol (dependent pointer, do not free). */ +YASM_LIB_DECL /*@dependent@*/ yasm_symrec *yasm_symtab_define_special (yasm_symtab *symtab, const char *name, yasm_sym_vis vis); @@ -154,6 +167,7 @@ void yasm_symtab_destroy(/*@only@*/ yasm_symtab *symtab); * \param line virtual line of visibility-setting * \return Symbol (dependent pointer, do not free). */ +YASM_LIB_DECL /*@dependent@*/ yasm_symrec *yasm_symtab_declare (yasm_symtab *symtab, const char *name, yasm_sym_vis vis, unsigned long line); @@ -164,6 +178,7 @@ void yasm_symtab_destroy(/*@only@*/ yasm_symtab *symtab); * \param vis visibility * \param line virtual line of visibility-setting */ +YASM_LIB_DECL void yasm_symrec_declare(yasm_symrec *symrec, yasm_sym_vis vis, unsigned long line); @@ -182,6 +197,7 @@ typedef int (*yasm_symtab_traverse_callback) * \return Nonzero value returned by callback function if it ever returned * nonzero. */ +YASM_LIB_DECL int /*@alt void@*/ yasm_symtab_traverse (yasm_symtab *symtab, /*@null@*/ void *d, yasm_symtab_traverse_callback func); @@ -193,12 +209,14 @@ typedef struct yasm_symtab_iter yasm_symtab_iter; * \param symtab symbol table * \return Iterator for the symbol table. */ +YASM_LIB_DECL const yasm_symtab_iter *yasm_symtab_first(const yasm_symtab *symtab); /** Move a symbol table iterator to the next symbol in the symbol table. * \param prev Previous iterator value * \return Next iterator value, or NULL if no more symbols in the table. */ +YASM_LIB_DECL /*@null@*/ const yasm_symtab_iter *yasm_symtab_next (const yasm_symtab_iter *prev); @@ -206,6 +224,7 @@ const yasm_symtab_iter *yasm_symtab_first(const yasm_symtab *symtab); * \param cur iterator value * \return Corresponding symbol. */ +YASM_LIB_DECL yasm_symrec *yasm_symtab_iter_value(const yasm_symtab_iter *cur); /** Finalize symbol table after parsing stage. Checks for symbols that are @@ -215,6 +234,7 @@ yasm_symrec *yasm_symtab_iter_value(const yasm_symtab_iter *cur); * \param errwarns error/warning set * \note Errors/warnings are stored into errwarns. */ +YASM_LIB_DECL void yasm_symtab_parser_finalize(yasm_symtab *symtab, int undef_extern, yasm_errwarns *errwarns); @@ -223,48 +243,56 @@ void yasm_symtab_parser_finalize(yasm_symtab *symtab, int undef_extern, * \param f file * \param indent_level indentation level */ +YASM_LIB_DECL void yasm_symtab_print(yasm_symtab *symtab, FILE *f, int indent_level); /** Get the name of a symbol. * \param sym symbol * \return Symbol name. */ +YASM_LIB_DECL /*@observer@*/ const char *yasm_symrec_get_name(const yasm_symrec *sym); /** Get the visibility of a symbol. * \param sym symbol * \return Symbol visibility. */ +YASM_LIB_DECL yasm_sym_vis yasm_symrec_get_visibility(const yasm_symrec *sym); /** Get the status of a symbol. * \param sym symbol * \return Symbol status. */ +YASM_LIB_DECL yasm_sym_status yasm_symrec_get_status(const yasm_symrec *sym); /** Get the virtual line of where a symbol was first defined. * \param sym symbol * \return line virtual line */ +YASM_LIB_DECL unsigned long yasm_symrec_get_def_line(const yasm_symrec *sym); /** Get the virtual line of where a symbol was first declared. * \param sym symbol * \return line virtual line */ +YASM_LIB_DECL unsigned long yasm_symrec_get_decl_line(const yasm_symrec *sym); /** Get the virtual line of where a symbol was first used. * \param sym symbol * \return line virtual line */ +YASM_LIB_DECL unsigned long yasm_symrec_get_use_line(const yasm_symrec *sym); /** Get EQU value of a symbol. * \param sym symbol * \return EQU value, or NULL if symbol is not an EQU or is not defined. */ +YASM_LIB_DECL /*@observer@*/ /*@null@*/ const yasm_expr *yasm_symrec_get_equ (const yasm_symrec *sym); @@ -277,6 +305,7 @@ typedef /*@dependent@*/ yasm_bytecode *yasm_symrec_get_label_bytecodep; * \return 0 if not symbol is not a label or if the symbol's visibility is * #YASM_SYM_EXTERN or #YASM_SYM_COMMON (not defined in the file). */ +YASM_LIB_DECL int yasm_symrec_get_label(const yasm_symrec *sym, /*@out@*/ yasm_symrec_get_label_bytecodep *precbc); @@ -285,24 +314,28 @@ int yasm_symrec_get_label(const yasm_symrec *sym, * \param sym symbol * \return 0 if symbol is not the "absolute" symbol, nonzero otherwise. */ +YASM_LIB_DECL int yasm_symrec_is_abs(const yasm_symrec *sym); /** Determine if symbol is a special symbol. * \param sym symbol * \return 0 if symbol is not a special symbol, nonzero otherwise. */ +YASM_LIB_DECL int yasm_symrec_is_special(const yasm_symrec *sym); /** Determine if symbol is a label representing the current assembly position. * \param sym symbol * \return 0 if symbol is not a current position label, nonzero otherwise. */ +YASM_LIB_DECL int yasm_symrec_is_curpos(const yasm_symrec *sym); /** Set object-extended valparams. * \param sym symbol * \param objext_valparams object-extended valparams */ +YASM_LIB_DECL void yasm_symrec_set_objext_valparams (yasm_symrec *sym, /*@only@*/ yasm_valparamhead *objext_valparams); @@ -311,6 +344,7 @@ void yasm_symrec_set_objext_valparams * \param sym symbol * \return Object-extended valparams (NULL if none). */ +YASM_LIB_DECL /*@null@*/ /*@dependent@*/ yasm_valparamhead *yasm_symrec_get_objext_valparams (yasm_symrec *sym); @@ -318,6 +352,7 @@ void yasm_symrec_set_objext_valparams * \param sym symbol * \param common_size common size expression */ +YASM_LIB_DECL void yasm_symrec_set_common_size (yasm_symrec *sym, /*@only@*/ yasm_expr *common_size); @@ -326,6 +361,7 @@ void yasm_symrec_set_common_size * \param sym symbol * \return Common size (NULL if none). */ +YASM_LIB_DECL /*@dependent@*/ /*@null@*/ yasm_expr **yasm_symrec_get_common_size (yasm_symrec *sym); @@ -334,6 +370,7 @@ void yasm_symrec_set_common_size * \param callback callback used when adding data * \return Associated data (NULL if none). */ +YASM_LIB_DECL /*@dependent@*/ /*@null@*/ void *yasm_symrec_get_data (yasm_symrec *sym, const yasm_assoc_data_callback *callback); @@ -343,6 +380,7 @@ void yasm_symrec_set_common_size * \param callback callback * \param data data to associate */ +YASM_LIB_DECL void yasm_symrec_add_data(yasm_symrec *sym, const yasm_assoc_data_callback *callback, /*@only@*/ /*@null@*/ void *data); @@ -352,6 +390,7 @@ void yasm_symrec_add_data(yasm_symrec *sym, * \param indent_level indentation level * \param sym symbol */ +YASM_LIB_DECL void yasm_symrec_print(const yasm_symrec *sym, FILE *f, int indent_level); #endif diff --git a/libyasm/valparam.h b/libyasm/valparam.h index 6914435b..3a7e8df6 100644 --- a/libyasm/valparam.h +++ b/libyasm/valparam.h @@ -34,6 +34,10 @@ #ifndef YASM_VALPARAM_H #define YASM_VALPARAM_H +#ifndef YASM_LIB_DECL +#define YASM_LIB_DECL +#endif + /** Value/parameter pair. \internal */ struct yasm_valparam { /*@reldef@*/ STAILQ_ENTRY(yasm_valparam) link; /**< Next pair in list */ @@ -101,6 +105,7 @@ struct yasm_directive { * \param objext_valparams object format-specific value/parameters * \param line virtual line (from yasm_linemap) */ +YASM_LIB_DECL void yasm_call_directive(const yasm_directive *directive, yasm_object *object, yasm_valparamhead *valparams, yasm_valparamhead *objext_valparams, @@ -112,6 +117,7 @@ void yasm_call_directive(const yasm_directive *directive, yasm_object *object, * \param id_prefix identifier prefix for raw identifiers * \return Newly allocated valparam. */ +YASM_LIB_DECL yasm_valparam *yasm_vp_create_id(/*@keep@*/ char *v, /*@keep@*/ char *p, int id_prefix); @@ -120,6 +126,7 @@ yasm_valparam *yasm_vp_create_id(/*@keep@*/ char *v, /*@keep@*/ char *p, * \param p parameter * \return Newly allocated valparam. */ +YASM_LIB_DECL yasm_valparam *yasm_vp_create_string(/*@keep@*/ char *v, /*@keep@*/ char *p); /** Create a new valparam with expression parameter. @@ -127,6 +134,7 @@ yasm_valparam *yasm_vp_create_string(/*@keep@*/ char *v, /*@keep@*/ char *p); * \param p parameter * \return Newly allocated valparam. */ +YASM_LIB_DECL yasm_valparam *yasm_vp_create_expr(/*@keep@*/ char *v, /*@keep@*/ yasm_expr *p); @@ -138,6 +146,7 @@ yasm_valparam *yasm_vp_create_expr(/*@keep@*/ char *v, * \return Expression, or NULL if vp is NULL or the parameter cannot be * converted to an expression. */ +YASM_LIB_DECL /*@null@*/ /*@only@*/ yasm_expr *yasm_vp_expr (const yasm_valparam *vp, yasm_symtab *symtab, unsigned long line); @@ -147,6 +156,7 @@ yasm_valparam *yasm_vp_create_expr(/*@keep@*/ char *v, * \return String, or NULL if vp is NULL or the parameter cannot be realized * as a string. */ +YASM_LIB_DECL /*@null@*/ /*@dependent@*/ const char *yasm_vp_string(const yasm_valparam *vp); /** Get a valparam parameter as an identifier. @@ -154,16 +164,19 @@ yasm_valparam *yasm_vp_create_expr(/*@keep@*/ char *v, * \return Identifier (string), or NULL if vp is NULL or the parameter is not * an identifier. */ +YASM_LIB_DECL /*@null@*/ /*@dependent@*/ const char *yasm_vp_id(const yasm_valparam *vp); /** Create a new linked list of valparams. * \return Newly allocated valparam list. */ +YASM_LIB_DECL yasm_valparamhead *yasm_vps_create(void); /** Destroy a list of valparams (created with yasm_vps_create). * \param headp list of valparams */ +YASM_LIB_DECL void yasm_vps_destroy(yasm_valparamhead *headp); /** Initialize linked list of valparams. @@ -179,6 +192,7 @@ void yasm_vps_initialize(/*@out@*/ yasm_valparamhead *headp); * \warning Deletes val/params. * \param headp linked list */ +YASM_LIB_DECL void yasm_vps_delete(yasm_valparamhead *headp); /** Append valparam to tail of linked list. @@ -225,6 +239,7 @@ void yasm_vps_append(yasm_valparamhead *headp, /*@keep@*/ yasm_valparam *vp); * \param f file * \param headp linked list */ +YASM_LIB_DECL void yasm_vps_print(/*@null@*/ const yasm_valparamhead *headp, FILE *f); /** Directive valparam parse helper structure. */ @@ -280,6 +295,7 @@ typedef struct yasm_dir_help { * \return -1 on error, 1 if any arguments matched (including via * catch-all callback), 0 if no match. */ +YASM_LIB_DECL int yasm_dir_helper(void *obj, yasm_valparam *vp_first, unsigned long line, const yasm_dir_help *help, size_t nhelp, void *data, int (*helper_valparam) (void *object, @@ -297,6 +313,7 @@ int yasm_dir_helper(void *obj, yasm_valparam *vp_first, unsigned long line, * \param arg flag to set * \return 0 */ +YASM_LIB_DECL int yasm_dir_helper_flag_set(void *obj, yasm_valparam *vp, unsigned long line, void *data, uintptr_t arg); @@ -310,6 +327,7 @@ int yasm_dir_helper_flag_set(void *obj, yasm_valparam *vp, unsigned long line, * \param arg flag to OR * \return 0 */ +YASM_LIB_DECL int yasm_dir_helper_flag_or(void *obj, yasm_valparam *vp, unsigned long line, void *data, uintptr_t arg); @@ -323,6 +341,7 @@ int yasm_dir_helper_flag_or(void *obj, yasm_valparam *vp, unsigned long line, * \param arg flag to AND * \return 0 */ +YASM_LIB_DECL int yasm_dir_helper_flag_and(void *obj, yasm_valparam *vp, unsigned long line, void *data, uintptr_t arg); @@ -340,6 +359,7 @@ int yasm_dir_helper_flag_and(void *obj, yasm_valparam *vp, unsigned long line, * \param arg unused argument * \return -1 on error, 0 otherwise. */ +YASM_LIB_DECL int yasm_dir_helper_expr(void *obj, yasm_valparam *vp, unsigned long line, void *data, uintptr_t arg); @@ -357,6 +377,7 @@ int yasm_dir_helper_expr(void *obj, yasm_valparam *vp, unsigned long line, * \param arg unused argument * \return -1 on error, 0 otherwise. */ +YASM_LIB_DECL int yasm_dir_helper_intn(void *obj, yasm_valparam *vp, unsigned long line, void *data, uintptr_t arg); @@ -373,6 +394,7 @@ int yasm_dir_helper_intn(void *obj, yasm_valparam *vp, unsigned long line, * \param arg unused * \return -1 on error, 0 otherwise. */ +YASM_LIB_DECL int yasm_dir_helper_string(void *obj, yasm_valparam *vp, unsigned long line, void *data, uintptr_t arg); @@ -384,6 +406,7 @@ int yasm_dir_helper_string(void *obj, yasm_valparam *vp, unsigned long line, * \param data unused * \return 0 */ +YASM_LIB_DECL int yasm_dir_helper_valparam_warn(void *obj, yasm_valparam *vp, unsigned long line, void *data); #endif diff --git a/libyasm/value.h b/libyasm/value.h index cc6d3469..3d51ebaf 100644 --- a/libyasm/value.h +++ b/libyasm/value.h @@ -34,6 +34,10 @@ #ifndef YASM_VALUE_H #define YASM_VALUE_H +#ifndef YASM_LIB_DECL +#define YASM_LIB_DECL +#endif + /** Initialize a #yasm_value with just an expression. No processing is * performed, the expression is simply stuck into value.abs and the other * fields are initialized. Use yasm_expr_extract_value() to perform "smart" @@ -45,6 +49,7 @@ * \param e expression (kept) * \param size value size (in bits) */ +YASM_LIB_DECL void yasm_value_initialize(/*@out@*/ yasm_value *value, /*@null@*/ /*@kept@*/ yasm_expr *e, unsigned int size); @@ -56,6 +61,7 @@ void yasm_value_initialize(/*@out@*/ yasm_value *value, * \param sym symrec * \param size value size (in bits) */ +YASM_LIB_DECL void yasm_value_init_sym(/*@out@*/ yasm_value *value, /*@null@*/ yasm_symrec *sym, unsigned int size); @@ -64,11 +70,13 @@ void yasm_value_init_sym(/*@out@*/ yasm_value *value, * \param value value (copy to create) * \param orig original value */ +YASM_LIB_DECL void yasm_value_init_copy(yasm_value *value, const yasm_value *orig); /** Frees any memory inside value; does not free value itself. * \param value value */ +YASM_LIB_DECL void yasm_value_delete(yasm_value *value); /** Set a value to be relative to the current assembly position rather than @@ -80,6 +88,7 @@ void yasm_value_delete(yasm_value *value); * \note If value is just an absolute value, will get an absolute symrec to * reference to (via bc's symbol table). */ +YASM_LIB_DECL void yasm_value_set_curpos_rel(yasm_value *value, yasm_bytecode *bc, unsigned int ip_rel); @@ -89,6 +98,7 @@ void yasm_value_set_curpos_rel(yasm_value *value, yasm_bytecode *bc, * \param precbc previous bytecode to bytecode containing value * \return Nonzero if value could not be split. */ +YASM_LIB_DECL int yasm_value_finalize(yasm_value *value, /*@null@*/ yasm_bytecode *precbc); /** Break a #yasm_expr into a #yasm_value constituent parts. Extracts @@ -110,6 +120,7 @@ int yasm_value_finalize(yasm_value *value, /*@null@*/ yasm_bytecode *precbc); * \note This should only be called after the parse is complete. Calling * before the parse is complete will usually result in an error return. */ +YASM_LIB_DECL int yasm_value_finalize_expr(/*@out@*/ yasm_value *value, /*@null@*/ /*@kept@*/ yasm_expr *e, /*@null@*/ yasm_bytecode *precbc, @@ -126,6 +137,7 @@ int yasm_value_finalize_expr(/*@out@*/ yasm_value *value, * as bc (and there is no WRT or SEG). * \return Intnum if can be resolved to integer value, otherwise NULL. */ +YASM_LIB_DECL /*@null@*/ /*@only@*/ yasm_intnum *yasm_value_get_intnum (yasm_value *value, /*@null@*/ yasm_bytecode *bc, int calc_bc_dist); @@ -148,6 +160,7 @@ int yasm_value_finalize_expr(/*@out@*/ yasm_value *value, * \return 0 if no value output due to value needing relocation; * 1 if value output; -1 if error. */ +YASM_LIB_DECL int yasm_value_output_basic (yasm_value *value, /*@out@*/ unsigned char *buf, size_t destsize, yasm_bytecode *bc, int warn, yasm_arch *arch); @@ -157,6 +170,7 @@ int yasm_value_output_basic * \param indent_level indentation level * \param f file */ +YASM_LIB_DECL void yasm_value_print(const yasm_value *value, FILE *f, int indent_level); #endif diff --git a/libyasm/xmalloc.c b/libyasm/xmalloc.c index d2cd2380..30b30f43 100644 --- a/libyasm/xmalloc.c +++ b/libyasm/xmalloc.c @@ -47,11 +47,15 @@ static void def_xfree(/*@only@*/ /*@out@*/ /*@null@*/ void *p) /*@modifies p@*/; /* storage for global function pointers */ +YASM_LIB_DECL /*@only@*/ /*@out@*/ void * (*yasm_xmalloc) (size_t size) = def_xmalloc; +YASM_LIB_DECL /*@only@*/ void * (*yasm_xcalloc) (size_t nelem, size_t elsize) = def_xcalloc; +YASM_LIB_DECL /*@only@*/ void * (*yasm_xrealloc) (/*@only@*/ /*@out@*/ /*@returned@*/ /*@null@*/ void *oldmem, size_t size) /*@modifies oldmem@*/ = def_xrealloc; +YASM_LIB_DECL void (*yasm_xfree) (/*@only@*/ /*@out@*/ /*@null@*/ void *p) /*@modifies p@*/ = def_xfree; diff --git a/tools/genperf/CMakeLists.txt b/tools/genperf/CMakeLists.txt index 22afcc95..6f50989e 100644 --- a/tools/genperf/CMakeLists.txt +++ b/tools/genperf/CMakeLists.txt @@ -5,3 +5,4 @@ add_executable(genperf ../../libyasm/xmalloc.c ../../libyasm/xstrdup.c ) +set_target_properties(genperf PROPERTIES COMPILE_FLAGS -DYASM_LIB_DECL=) diff --git a/util.h b/util.h index f1886a23..132cba1e 100644 --- a/util.h +++ b/util.h @@ -64,6 +64,7 @@ #include #endif +#include #include #ifdef lint From 0a3f7ea1b9ceecd6635832924e3cd50b38e75546 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 24 May 2008 18:30:29 +0000 Subject: [PATCH 191/585] (cmake build) Install DLL files to correct locations on Windows. svn path=/trunk/yasm/; revision=2102 --- libyasm/CMakeLists.txt | 1 + modules/CMakeLists.txt | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libyasm/CMakeLists.txt b/libyasm/CMakeLists.txt index 125afa0d..f886f734 100644 --- a/libyasm/CMakeLists.txt +++ b/libyasm/CMakeLists.txt @@ -37,6 +37,7 @@ SET_TARGET_PROPERTIES(libyasm PROPERTIES ) INSTALL(TARGETS libyasm + RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib ) diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt index ebb7b6d6..48a3b5cf 100644 --- a/modules/CMakeLists.txt +++ b/modules/CMakeLists.txt @@ -86,4 +86,8 @@ ADD_LIBRARY(yasmstd MODULE ) TARGET_LINK_LIBRARIES(yasmstd libyasm) -INSTALL(TARGETS yasmstd LIBRARY DESTINATION lib) +IF(WIN32) + INSTALL(TARGETS yasmstd LIBRARY DESTINATION bin) +ELSE(WIN32) + INSTALL(TARGETS yasmstd LIBRARY DESTINATION lib) +ENDIF(WIN32) From e733283016415ea2e5b6aaee54801ec6aba903c2 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 24 May 2008 18:32:39 +0000 Subject: [PATCH 192/585] Clean up plugins CMakeLists a bit. Be more clever about finding the yasm executable on Windows. svn path=/trunk/yasm/; revision=2103 --- plugins/dbg/CMakeLists.txt | 13 ++++++++++++- plugins/x86/CMakeLists.txt | 13 ++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/plugins/dbg/CMakeLists.txt b/plugins/dbg/CMakeLists.txt index fa51498b..3d4fe681 100644 --- a/plugins/dbg/CMakeLists.txt +++ b/plugins/dbg/CMakeLists.txt @@ -1,4 +1,15 @@ -FIND_PROGRAM(YASM_PATH yasm) +PROJECT(dbgmod) +CMAKE_MINIMUM_REQUIRED(VERSION 2.4) + +SET (YASM_POSSIBLE_PATHS + "$ENV{ProgramFiles}/Yasm/Bin" + /usr/bin + /usr/local/bin + ) + +FIND_PROGRAM(YASM_PATH yasm + PATHS ${YASM_POSSIBLE_PATHS} + ) SET (YASM_POSSIBLE_INCLUDE_PATHS "${YASM_PATH}" diff --git a/plugins/x86/CMakeLists.txt b/plugins/x86/CMakeLists.txt index 55d273d5..7f382d35 100644 --- a/plugins/x86/CMakeLists.txt +++ b/plugins/x86/CMakeLists.txt @@ -1,6 +1,17 @@ +PROJECT(x86mod) +CMAKE_MINIMUM_REQUIRED(VERSION 2.4) + SET(SOURCE_DIR "${YASM_SOURCE_DIR}/modules/arch/x86") -FIND_PROGRAM(YASM_PATH yasm) +SET (YASM_POSSIBLE_PATHS + "$ENV{ProgramFiles}/Yasm/Bin" + /usr/bin + /usr/local/bin + ) + +FIND_PROGRAM(YASM_PATH yasm + PATHS ${YASM_POSSIBLE_PATHS} + ) FIND_PROGRAM(GENPERF_PATH genperf DOC "The path to the yasm genperf executable" From c59ebcbe3665084ec0f8a2582b84ce2183be3bad Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 24 May 2008 18:49:59 +0000 Subject: [PATCH 193/585] Fix x86 plugin build on Windows. svn path=/trunk/yasm/; revision=2104 --- plugins/x86/CMakeLists.txt | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/plugins/x86/CMakeLists.txt b/plugins/x86/CMakeLists.txt index 7f382d35..d0e10dae 100644 --- a/plugins/x86/CMakeLists.txt +++ b/plugins/x86/CMakeLists.txt @@ -1,6 +1,13 @@ PROJECT(x86mod) CMAKE_MINIMUM_REQUIRED(VERSION 2.4) +SET(YASM_SOURCE_DIR "${PROJECT_SOURCE_DIR}/../.." + CACHE STRING "Location of Yasm source") + +IF (NOT YASM_SOURCE_DIR) + MESSAGE(FATAL_ERROR "YASM_SOURCE_DIR must be defined") +ENDIF (NOT YASM_SOURCE_DIR) + SET(SOURCE_DIR "${YASM_SOURCE_DIR}/modules/arch/x86") SET (YASM_POSSIBLE_PATHS @@ -13,9 +20,15 @@ FIND_PROGRAM(YASM_PATH yasm PATHS ${YASM_POSSIBLE_PATHS} ) +SET (GENPERF_POSSIBLE_PATHS + ${YASM_SOURCE_DIR}/objdir/tools/genperf + ${YASM_SOURCE_DIR}/objdir/tools/genperf/Debug + ${YASM_SOURCE_DIR}/objdir/tools/genperf/Release + ) + FIND_PROGRAM(GENPERF_PATH genperf DOC "The path to the yasm genperf executable" - PATHS ${YASM_SOURCE_DIR}/objdir/tools/genperf + PATHS ${GENPERF_POSSIBLE_PATHS} ) IF (NOT GENPERF_PATH) @@ -63,6 +76,10 @@ ENDIF (NOT YASM_LIBRARY) INCLUDE(FindPythonInterp) +IF (NOT PYTHON_EXECUTABLE) + MESSAGE(FATAL_ERROR "Could not find Python executable") +ENDIF (NOT PYTHON_EXECUTABLE) + INCLUDE_DIRECTORIES(${SOURCE_DIR}) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) From e09d5a7968aca3fc614a9080e917c0c65cc587e5 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 24 May 2008 18:50:32 +0000 Subject: [PATCH 194/585] Error out if Python not found. svn path=/trunk/yasm/; revision=2105 --- ConfigureChecks.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 05a3523f..4b05d048 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -33,7 +33,11 @@ CONFIGURE_FILE(libyasm-stdint.h.cmake CONFIGURE_FILE(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) ADD_DEFINITIONS(-DHAVE_CONFIG_H) + INCLUDE(FindPythonInterp) +IF (NOT PYTHON_EXECUTABLE) + MESSAGE(FATAL_ERROR "Could not find Python executable") +ENDIF (NOT PYTHON_EXECUTABLE) IF (CMAKE_COMPILER_IS_GNUCXX) CHECK_C_COMPILER_FLAG(-pipe C_ACCEPTS_PIPE) From 13665a69db954e8ab1dee0f160330c16df98bbab Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 24 May 2008 19:00:48 +0000 Subject: [PATCH 195/585] Update plugin README files for Windows. svn path=/trunk/yasm/; revision=2106 --- plugins/README | 6 ++++-- plugins/dbg/README | 12 +++++++++--- plugins/x86/README | 15 ++++++++++++--- 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/plugins/README b/plugins/README index c16a8fd0..63a6a53c 100644 --- a/plugins/README +++ b/plugins/README @@ -10,11 +10,13 @@ The plugins are written to be compiled against an *installed* yasm. Plugins may be loaded on the yasm command line using the -N command line option, e.g.: yasm -N ./libdbgmod.so + yasm -N Release/dbgmod.dll yasm -N /usr/local/lib/libx86mod (the .so will be automatically appended) If no directory path is specified, yasm will search in standard library locations (e.g. LD_LIBRARY_PATH, the rpath of the yasm executable, etc) to -try to load the plugin. Thus the last example could likely be written: - yasm -N libx86mod +try to load the plugin. Thus the last example (after installing the plugin) +could likely be written: + yasm -N x86mod Plugins may override builtin modules like x86. diff --git a/plugins/dbg/README b/plugins/dbg/README index 3a1f5cb7..d4fdbc58 100644 --- a/plugins/dbg/README +++ b/plugins/dbg/README @@ -7,9 +7,15 @@ To build: cmake .. make -Testing: +Testing (on Windows): + yasm -N Release/dbgmod.dll -f dbg - + db 5 + ^Z + +Testing (on Unix): yasm -N ./libdbgmod.so -f dbg - db 5 ^D -(result lines will have PLUGIN prefixed to the function calls; this -demonstrates the plugin is being used rather than the builtin dbg module) + +Result lines will have PLUGIN prefixed to the function calls; this +demonstrates the plugin is being used rather than the builtin dbg module. diff --git a/plugins/x86/README b/plugins/x86/README index 17346155..dddedd0d 100644 --- a/plugins/x86/README +++ b/plugins/x86/README @@ -1,10 +1,19 @@ This directory demonstrates how to build a yasm builtin module as a plugin. This can be useful for integrating custom changes without rebuilding/reinstalling yasm. -It requires access to the yasm source. -The yasm source directory must be defined to cmake, e.g. +It requires access to the yasm source. It defaults to assuming it is being +built inside of the yasm source tree. + +To build: mkdir objdir cd objdir - cmake -DYASM_SOURCE_DIR=/home/foo/yasm .. + cmake .. make + +Testing (on Windows): + yasm -N Release/x86mod.dll -f x86 ... + +Testing (on Unix): + yasm -N ./libx86mod.so -f x86 ... + From 3196e62ef6cb6ea5ec70c77e53accf79bb912b6d Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 25 May 2008 17:02:24 +0000 Subject: [PATCH 196/585] Quiet a warning about casting from a data to function pointer. This is required to get a function pointer from dlsym(). svn path=/trunk/yasm/; revision=2107 --- frontends/yasm/yasm-plugin.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontends/yasm/yasm-plugin.c b/frontends/yasm/yasm-plugin.c index e23a807a..a04c42bf 100644 --- a/frontends/yasm/yasm-plugin.c +++ b/frontends/yasm/yasm-plugin.c @@ -29,6 +29,7 @@ #include +#include "libyasm-stdint.h" #include "yasm-plugin.h" #if defined(_MSC_VER) @@ -96,7 +97,7 @@ load_plugin(const char *name) init_plugin = (void (*)(void))GetProcAddress((HINSTANCE)lib, "yasm_init_plugin"); #elif defined(__GNUC__) - init_plugin = (void (*)(void))dlsym(lib, "yasm_init_plugin"); + init_plugin = (void (*)(void))(uintptr_t)dlsym(lib, "yasm_init_plugin"); #endif if (!init_plugin) From 3aab66a119b5be2a5163c1de4909f27bdc28a91e Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 5 Jun 2008 08:48:21 +0000 Subject: [PATCH 197/585] Fix #141: Add macho64 PIC support. The way PIC relocations are generated for macho64 requires a bit of a hack to detect MOV opcodes and generate GOT_LOAD relocs. GAS contains a similar hack. svn path=/trunk/yasm/; revision=2108 --- modules/objfmts/macho/macho-objfmt.c | 39 +- .../objfmts/macho/tests/gas64/Makefile.inc | 2 + .../macho/tests/gas64/gas-macho64-pic.asm | 32 ++ .../macho/tests/gas64/gas-macho64-pic.hex | 346 ++++++++++++++++++ .../objfmts/macho/tests/nasm64/Makefile.inc | 2 + .../tests/nasm64/macho-reloc64-err.errwarn | 2 +- .../macho/tests/nasm64/nasm-macho64-pic.asm | 34 ++ .../macho/tests/nasm64/nasm-macho64-pic.hex | 346 ++++++++++++++++++ 8 files changed, 789 insertions(+), 14 deletions(-) create mode 100644 modules/objfmts/macho/tests/gas64/gas-macho64-pic.asm create mode 100644 modules/objfmts/macho/tests/gas64/gas-macho64-pic.hex create mode 100644 modules/objfmts/macho/tests/nasm64/nasm-macho64-pic.asm create mode 100644 modules/objfmts/macho/tests/nasm64/nasm-macho64-pic.hex diff --git a/modules/objfmts/macho/macho-objfmt.c b/modules/objfmts/macho/macho-objfmt.c index 0a049baf..78ba9f0a 100644 --- a/modules/objfmts/macho/macho-objfmt.c +++ b/modules/objfmts/macho/macho-objfmt.c @@ -88,12 +88,7 @@ Will currently produce an error though the necessary means are provided by the Mach-O specification. - 3) position independend coding (64 Bit) - Mach-O provides the relocation features X86_64_RELOC_GOT_LOAD and - X86_64_RELOC_GOT for C-compatible global offset tables. This IS NOT - implemented yet, sorry. - - 4) symbol naming for global and external symbols + 3) symbol naming for global and external symbols BSD, Windows and MacOS-X use underscores for global symbols, where ELF/Linux does not. This file contains simple means of adding underscores to symbols by defining "AUTO_UNDERSCORE" but that @@ -302,6 +297,8 @@ typedef struct yasm_objfmt_macho { long parse_scnum; /* sect numbering in parser */ int bits; /* 32 / 64 */ + + yasm_symrec *gotpcrel_sym; /* ..gotpcrel */ } yasm_objfmt_macho; @@ -368,13 +365,17 @@ macho_objfmt_create_common(yasm_object *object, yasm_objfmt_module *module, /* Support x86 and amd64 machines of x86 arch */ if (yasm__strcasecmp(yasm_arch_get_machine(object->arch), "x86") == 0 && - (bits_pref == 0 || bits_pref == 32)) + (bits_pref == 0 || bits_pref == 32)) { objfmt_macho->bits = 32; - else if (yasm__strcasecmp(yasm_arch_get_machine(object->arch), + objfmt_macho->gotpcrel_sym = NULL; + } else if (yasm__strcasecmp(yasm_arch_get_machine(object->arch), "amd64") == 0 && - (bits_pref == 0 || bits_pref == 64)) + (bits_pref == 0 || bits_pref == 64)) { objfmt_macho->bits = 64; - else { + /* FIXME: misuse of NULL bytecode */ + objfmt_macho->gotpcrel_sym = + yasm_symtab_define_label(object->symtab, "..gotpcrel", NULL, 0, 0); + } else { yasm_xfree(objfmt_macho); return NULL; } @@ -496,9 +497,13 @@ macho_objfmt_output_value(yasm_value *value, unsigned char *buf, return 1; } - if (value->wrt) { + if (value->curpos_rel && objfmt_macho->gotpcrel_sym && + value->wrt == objfmt_macho->gotpcrel_sym) { + reloc->type = X86_64_RELOC_GOT; + value->wrt = NULL; + } else if (value->wrt) { yasm_error_set(YASM_ERROR_TOO_COMPLEX, - N_("macho: WRT not supported")); + N_("macho: invalid WRT")); yasm_xfree(reloc); return 1; } @@ -513,7 +518,11 @@ macho_objfmt_output_value(yasm_value *value, unsigned char *buf, } else { /* Add in the offset plus value size to end up with 0. */ intn_plus = offset+destsize; - if (value->jump_target) + if (reloc->type == X86_64_RELOC_GOT) { + /* XXX: This is a hack */ + if (offset >= 2 && buf[-2] == 0x8B) + reloc->type = X86_64_RELOC_GOT_LOAD; + } else if (value->jump_target) reloc->type = X86_64_RELOC_BRANCH; else reloc->type = X86_64_RELOC_SIGNED; @@ -1489,6 +1498,10 @@ static /*@observer@*/ /*@null@*/ yasm_symrec * macho_objfmt_get_special_sym(yasm_object *object, const char *name, const char *parser) { + yasm_objfmt_macho *objfmt_macho = (yasm_objfmt_macho *)object->objfmt; + if (yasm__strcasecmp(name, "gotpcrel") == 0) { + return objfmt_macho->gotpcrel_sym; + } return NULL; } diff --git a/modules/objfmts/macho/tests/gas64/Makefile.inc b/modules/objfmts/macho/tests/gas64/Makefile.inc index 79d85edc..24398843 100644 --- a/modules/objfmts/macho/tests/gas64/Makefile.inc +++ b/modules/objfmts/macho/tests/gas64/Makefile.inc @@ -5,3 +5,5 @@ TESTS += modules/objfmts/macho/tests/gas64/gas_macho64_test.sh EXTRA_DIST += modules/objfmts/macho/tests/gas64/gas_macho64_test.sh EXTRA_DIST += modules/objfmts/macho/tests/gas64/gas-macho64.asm EXTRA_DIST += modules/objfmts/macho/tests/gas64/gas-macho64.hex +EXTRA_DIST += modules/objfmts/macho/tests/gas64/gas-macho64-pic.asm +EXTRA_DIST += modules/objfmts/macho/tests/gas64/gas-macho64-pic.hex diff --git a/modules/objfmts/macho/tests/gas64/gas-macho64-pic.asm b/modules/objfmts/macho/tests/gas64/gas-macho64-pic.asm new file mode 100644 index 00000000..c44502b3 --- /dev/null +++ b/modules/objfmts/macho/tests/gas64/gas-macho64-pic.asm @@ -0,0 +1,32 @@ +call _foo +# r_type=X86_64_RELOC_BRANCH, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo +# E8 00 00 00 00 + +call _foo+4 +# r_type=X86_64_RELOC_BRANCH, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo +# E8 04 00 00 00 + +movq _foo@GOTPCREL(%rip), %rax +# r_type=X86_64_RELOC_GOT_LOAD, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo +# 48 8B 05 00 00 00 00 + +pushq _foo@GOTPCREL(%rip) +# r_type=X86_64_RELOC_GOT, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo +# FF 35 00 00 00 00 + +movl _foo(%rip), %eax +# r_type=X86_64_RELOC_SIGNED, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo +# 8B 05 00 00 00 00 + +movl _foo+4(%rip), %eax +# r_type=X86_64_RELOC_SIGNED, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo +# 8B 05 04 00 00 00 + +movb $0x12, _foo(%rip) +# r_type=X86_64_RELOC_SIGNED, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo +# C6 05 FF FF FF FF 12 + +movl $0x12345678, _foo(%rip) +# r_type=X86_64_RELOC_SIGNED, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo +# C7 05 FC FF FF FF 78 56 34 12 + diff --git a/modules/objfmts/macho/tests/gas64/gas-macho64-pic.hex b/modules/objfmts/macho/tests/gas64/gas-macho64-pic.hex new file mode 100644 index 00000000..83bb7bbf --- /dev/null +++ b/modules/objfmts/macho/tests/gas64/gas-macho64-pic.hex @@ -0,0 +1,346 @@ +cf +fa +ed +fe +07 +00 +00 +01 +03 +00 +00 +00 +01 +00 +00 +00 +02 +00 +00 +00 +b0 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +19 +00 +00 +00 +98 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +34 +00 +00 +00 +00 +00 +00 +00 +d0 +00 +00 +00 +00 +00 +00 +00 +34 +00 +00 +00 +00 +00 +00 +00 +07 +00 +00 +00 +07 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +5f +5f +74 +65 +78 +74 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +5f +5f +54 +45 +58 +54 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +34 +00 +00 +00 +00 +00 +00 +00 +d0 +00 +00 +00 +00 +00 +00 +00 +04 +01 +00 +00 +08 +00 +00 +00 +00 +03 +00 +80 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +18 +00 +00 +00 +44 +01 +00 +00 +01 +00 +00 +00 +54 +01 +00 +00 +06 +00 +00 +00 +e8 +00 +00 +00 +00 +e8 +04 +00 +00 +00 +48 +8b +05 +00 +00 +00 +00 +ff +35 +00 +00 +00 +00 +8b +05 +00 +00 +00 +00 +8b +05 +04 +00 +00 +00 +c6 +05 +ff +ff +ff +ff +12 +c7 +05 +fc +ff +ff +ff +78 +56 +34 +12 +01 +00 +00 +00 +00 +00 +00 +2d +06 +00 +00 +00 +00 +00 +00 +2d +0d +00 +00 +00 +00 +00 +00 +3d +13 +00 +00 +00 +00 +00 +00 +4d +19 +00 +00 +00 +00 +00 +00 +1d +1f +00 +00 +00 +00 +00 +00 +1d +25 +00 +00 +00 +00 +00 +00 +1d +2c +00 +00 +00 +00 +00 +00 +1d +01 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +5f +66 +6f +6f +00 diff --git a/modules/objfmts/macho/tests/nasm64/Makefile.inc b/modules/objfmts/macho/tests/nasm64/Makefile.inc index efe5de4d..502edca0 100644 --- a/modules/objfmts/macho/tests/nasm64/Makefile.inc +++ b/modules/objfmts/macho/tests/nasm64/Makefile.inc @@ -2,6 +2,8 @@ TESTS += modules/objfmts/macho/tests/nasm64/macho64_test.sh +EXTRA_DIST += modules/objfmts/macho/tests/nasm64/nasm-macho64-pic.asm +EXTRA_DIST += modules/objfmts/macho/tests/nasm64/nasm-macho64-pic.hex EXTRA_DIST += modules/objfmts/macho/tests/nasm64/macho64_test.sh EXTRA_DIST += modules/objfmts/macho/tests/nasm64/machotest64.c EXTRA_DIST += modules/objfmts/macho/tests/nasm64/machotest64.asm diff --git a/modules/objfmts/macho/tests/nasm64/macho-reloc64-err.errwarn b/modules/objfmts/macho/tests/nasm64/macho-reloc64-err.errwarn index 8297a5bb..1a118833 100644 --- a/modules/objfmts/macho/tests/nasm64/macho-reloc64-err.errwarn +++ b/modules/objfmts/macho/tests/nasm64/macho-reloc64-err.errwarn @@ -5,4 +5,4 @@ -:25: error: macho: sorry, cannot apply 32 bit absolute relocations in 64 bit mode, consider "[_symbol wrt rip]" for mem access, "qword" and "dq _foo" for pointers. -:26: error: macho: sorry, cannot apply 32 bit absolute relocations in 64 bit mode, consider "[_symbol wrt rip]" for mem access, "qword" and "dq _foo" for pointers. -:27: error: macho: sorry, cannot apply 32 bit absolute relocations in 64 bit mode, consider "[_symbol wrt rip]" for mem access, "qword" and "dq _foo" for pointers. --:29: error: macho: WRT not supported +-:29: error: macho: invalid WRT diff --git a/modules/objfmts/macho/tests/nasm64/nasm-macho64-pic.asm b/modules/objfmts/macho/tests/nasm64/nasm-macho64-pic.asm new file mode 100644 index 00000000..7b46163e --- /dev/null +++ b/modules/objfmts/macho/tests/nasm64/nasm-macho64-pic.asm @@ -0,0 +1,34 @@ +[extern _foo] + +call _foo +; r_type=X86_64_RELOC_BRANCH, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo +; E8 00 00 00 00 + +call _foo+4 +; r_type=X86_64_RELOC_BRANCH, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo +; E8 04 00 00 00 + +mov rax, [rel _foo wrt ..gotpcrel] +; r_type=X86_64_RELOC_GOT_LOAD, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo +; 48 8B 05 00 00 00 00 + +push qword [rel _foo wrt ..gotpcrel] +; r_type=X86_64_RELOC_GOT, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo +; FF 35 00 00 00 00 + +mov eax, [rel _foo] +; r_type=X86_64_RELOC_SIGNED, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo +; 8B 05 00 00 00 00 + +mov eax, [rel _foo+4] +; r_type=X86_64_RELOC_SIGNED, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo +; 8B 05 04 00 00 00 + +mov [rel _foo], byte 12h +; r_type=X86_64_RELOC_SIGNED, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo +; C6 05 FF FF FF FF 12 + +mov dword [rel _foo], 0x12345678 +; r_type=X86_64_RELOC_SIGNED, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo +; C7 05 FC FF FF FF 78 56 34 12 + diff --git a/modules/objfmts/macho/tests/nasm64/nasm-macho64-pic.hex b/modules/objfmts/macho/tests/nasm64/nasm-macho64-pic.hex new file mode 100644 index 00000000..83bb7bbf --- /dev/null +++ b/modules/objfmts/macho/tests/nasm64/nasm-macho64-pic.hex @@ -0,0 +1,346 @@ +cf +fa +ed +fe +07 +00 +00 +01 +03 +00 +00 +00 +01 +00 +00 +00 +02 +00 +00 +00 +b0 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +19 +00 +00 +00 +98 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +34 +00 +00 +00 +00 +00 +00 +00 +d0 +00 +00 +00 +00 +00 +00 +00 +34 +00 +00 +00 +00 +00 +00 +00 +07 +00 +00 +00 +07 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +5f +5f +74 +65 +78 +74 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +5f +5f +54 +45 +58 +54 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +34 +00 +00 +00 +00 +00 +00 +00 +d0 +00 +00 +00 +00 +00 +00 +00 +04 +01 +00 +00 +08 +00 +00 +00 +00 +03 +00 +80 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +18 +00 +00 +00 +44 +01 +00 +00 +01 +00 +00 +00 +54 +01 +00 +00 +06 +00 +00 +00 +e8 +00 +00 +00 +00 +e8 +04 +00 +00 +00 +48 +8b +05 +00 +00 +00 +00 +ff +35 +00 +00 +00 +00 +8b +05 +00 +00 +00 +00 +8b +05 +04 +00 +00 +00 +c6 +05 +ff +ff +ff +ff +12 +c7 +05 +fc +ff +ff +ff +78 +56 +34 +12 +01 +00 +00 +00 +00 +00 +00 +2d +06 +00 +00 +00 +00 +00 +00 +2d +0d +00 +00 +00 +00 +00 +00 +3d +13 +00 +00 +00 +00 +00 +00 +4d +19 +00 +00 +00 +00 +00 +00 +1d +1f +00 +00 +00 +00 +00 +00 +1d +25 +00 +00 +00 +00 +00 +00 +1d +2c +00 +00 +00 +00 +00 +00 +1d +01 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +5f +66 +6f +6f +00 From 53b2d01a779913ba35c301b7e3080da15a41e8cf Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 8 Jun 2008 09:06:05 +0000 Subject: [PATCH 198/585] Fix #132: Add --prefix and --suffix (aka --postfix) options. These allow arbitrary prefixes and/or suffixes to be added to externally-visible (GLOBAL, EXTERN, or COMMON) symbol names. svn path=/trunk/yasm/; revision=2109 --- frontends/yasm/yasm.c | 38 ++++++++++++++++++++++++++++ libyasm/section.c | 22 ++++++++++++++++ libyasm/section.h | 20 +++++++++++++++ libyasm/symrec.c | 15 +++++++++++ libyasm/symrec.h | 8 ++++++ modules/objfmts/bin/bin-objfmt.c | 6 +++-- modules/objfmts/coff/coff-objfmt.c | 6 +++-- modules/objfmts/elf/elf-objfmt.c | 31 +++++++++++++---------- modules/objfmts/macho/macho-objfmt.c | 33 ++++++------------------ modules/objfmts/rdf/rdf-objfmt.c | 5 ++-- modules/objfmts/xdf/xdf-objfmt.c | 6 +++-- 11 files changed, 144 insertions(+), 46 deletions(-) diff --git a/frontends/yasm/yasm.c b/frontends/yasm/yasm.c index 83294069..b8c1ac59 100644 --- a/frontends/yasm/yasm.c +++ b/frontends/yasm/yasm.c @@ -48,6 +48,7 @@ #define PREPROC_BUF_SIZE 16384 /*@null@*/ /*@only@*/ static char *obj_filename = NULL, *in_filename = NULL; +/*@null@*/ /*@only@*/ static char *global_prefix = NULL, *global_suffix = NULL; /*@null@*/ /*@only@*/ static char *list_filename = NULL, *map_filename = NULL; /*@null@*/ /*@only@*/ static char *machine_name = NULL; static int special_options = 0; @@ -106,6 +107,8 @@ static int opt_include_option(char *cmd, /*@null@*/ char *param, int extra); static int opt_preproc_option(char *cmd, /*@null@*/ char *param, int extra); static int opt_ewmsg_handler(char *cmd, /*@null@*/ char *param, int extra); static int opt_makedep_handler(char *cmd, /*@null@*/ char *param, int extra); +static int opt_prefix_handler(char *cmd, /*@null@*/ char *param, int extra); +static int opt_suffix_handler(char *cmd, /*@null@*/ char *param, int extra); #ifdef CMAKE_BUILD static int opt_plugin_handler(char *cmd, /*@null@*/ char *param, int extra); #endif @@ -196,6 +199,12 @@ static opt_option options[] = N_("undefine a macro"), N_("macro") }, { 'X', NULL, 1, opt_ewmsg_handler, 0, N_("select error/warning message style (`gnu' or `vc')"), N_("style") }, + { 0, "prefix", 1, opt_prefix_handler, 0, + N_("prepend argument to name of all external symbols"), N_("prefix") }, + { 0, "suffix", 1, opt_suffix_handler, 0, + N_("append argument to name of all external symbols"), N_("suffix") }, + { 0, "postfix", 1, opt_suffix_handler, 0, + N_("append argument to name of all external symbols"), N_("suffix") }, #ifdef CMAKE_BUILD { 'N', "plugin", 1, opt_plugin_handler, 0, N_("load plugin module"), N_("plugin") }, @@ -441,6 +450,11 @@ do_assemble(void) return EXIT_FAILURE; } + if (global_prefix) + yasm_object_set_global_prefix(object, global_prefix); + if (global_suffix) + yasm_object_set_global_suffix(object, global_suffix); + cur_preproc = yasm_preproc_create(cur_preproc_module, in_filename, object->symtab, linemap, errwarns); @@ -1140,6 +1154,30 @@ opt_makedep_handler(/*@unused@*/ char *cmd, /*@unused@*/ char *param, return 0; } +static int +opt_prefix_handler(/*@unused@*/ char *cmd, char *param, /*@unused@*/ int extra) +{ + if (global_prefix) + yasm_xfree(global_prefix); + + assert(param != NULL); + global_prefix = yasm__xstrdup(param); + + return 0; +} + +static int +opt_suffix_handler(/*@unused@*/ char *cmd, char *param, /*@unused@*/ int extra) +{ + if (global_suffix) + yasm_xfree(global_suffix); + + assert(param != NULL); + global_suffix = yasm__xstrdup(param); + + return 0; +} + #ifdef CMAKE_BUILD static int opt_plugin_handler(/*@unused@*/ char *cmd, char *param, diff --git a/libyasm/section.c b/libyasm/section.c index a767e309..1f73929b 100644 --- a/libyasm/section.c +++ b/libyasm/section.c @@ -223,6 +223,10 @@ yasm_object_create(const char *src_filename, const char *obj_filename, object->src_filename = yasm__xstrdup(src_filename); object->obj_filename = yasm__xstrdup(obj_filename); + /* No prefix/suffix */ + object->global_prefix = yasm__xstrdup(""); + object->global_suffix = yasm__xstrdup(""); + /* Create empty symbol table */ object->symtab = yasm_symtab_create(); @@ -376,6 +380,20 @@ yasm_object_set_source_fn(yasm_object *object, const char *src_filename) object->src_filename = yasm__xstrdup(src_filename); } +void +yasm_object_set_global_prefix(yasm_object *object, const char *prefix) +{ + yasm_xfree(object->global_prefix); + object->global_prefix = yasm__xstrdup(prefix); +} + +void +yasm_object_set_global_suffix(yasm_object *object, const char *suffix) +{ + yasm_xfree(object->global_suffix); + object->global_suffix = yasm__xstrdup(suffix); +} + int yasm_section_is_code(yasm_section *sect) { @@ -450,6 +468,10 @@ yasm_object_destroy(yasm_object *object) /* Delete directives HAMT */ HAMT_destroy(object->directives, directive_level1_delete); + /* Delete prefix/suffix */ + yasm_xfree(object->global_prefix); + yasm_xfree(object->global_suffix); + /* Delete associated filenames */ yasm_xfree(object->src_filename); yasm_xfree(object->obj_filename); diff --git a/libyasm/section.h b/libyasm/section.h index b17f887d..3b3942a9 100644 --- a/libyasm/section.h +++ b/libyasm/section.h @@ -71,6 +71,12 @@ struct yasm_object { * second level is directive name. */ /*@owned@*/ struct HAMT *directives; + + /** Prefix prepended to externally-visible symbols (empty string if none) */ + /*@owned@*/ char *global_prefix; + + /** Suffix appended to externally-visible symbols (empty string if none) */ + /*@owned@*/ char *global_suffix; }; /** Create a new object. A default section is created as the first section. @@ -176,6 +182,20 @@ YASM_LIB_DECL YASM_LIB_DECL void yasm_object_set_source_fn(yasm_object *object, const char *src_filename); +/** Change the prefix used for externally-visible symbols. + * \param object object + * \param prefix new prefix + */ +YASM_LIB_DECL +void yasm_object_set_global_prefix(yasm_object *object, const char *prefix); + +/** Change the suffix used for externally-visible symbols. + * \param object object + * \param suffix new suffix + */ +YASM_LIB_DECL +void yasm_object_set_global_suffix(yasm_object *object, const char *suffix); + /** Optimize an object. Takes the unoptimized object and optimizes it. * If successful, the object is ready for output to an object file. * \param object object diff --git a/libyasm/symrec.c b/libyasm/symrec.c index 91807eb4..4ea0ca7e 100644 --- a/libyasm/symrec.c +++ b/libyasm/symrec.c @@ -453,6 +453,21 @@ yasm_symrec_get_name(const yasm_symrec *sym) return sym->name; } +char * +yasm_symrec_get_global_name(const yasm_symrec *sym, const yasm_object *object) +{ + if (sym->visibility & (YASM_SYM_GLOBAL|YASM_SYM_COMMON|YASM_SYM_EXTERN)) { + char *name = yasm_xmalloc(strlen(object->global_prefix) + + strlen(sym->name) + + strlen(object->global_suffix) + 1); + strcpy(name, object->global_prefix); + strcat(name, sym->name); + strcat(name, object->global_suffix); + return name; + } + return yasm__xstrdup(sym->name); +} + yasm_sym_vis yasm_symrec_get_visibility(const yasm_symrec *sym) { diff --git a/libyasm/symrec.h b/libyasm/symrec.h index 10706d9d..65d47755 100644 --- a/libyasm/symrec.h +++ b/libyasm/symrec.h @@ -253,6 +253,14 @@ void yasm_symtab_print(yasm_symtab *symtab, FILE *f, int indent_level); YASM_LIB_DECL /*@observer@*/ const char *yasm_symrec_get_name(const yasm_symrec *sym); +/** Get the externally-visible (global) name of a symbol. + * \param sym symbol + * \return Externally-visible symbol name (allocated, caller must free). + */ +YASM_LIB_DECL +/*@only@*/ char *yasm_symrec_get_global_name(const yasm_symrec *sym, + const yasm_object *object); + /** Get the visibility of a symbol. * \param sym symbol * \return Symbol visibility. diff --git a/modules/objfmts/bin/bin-objfmt.c b/modules/objfmts/bin/bin-objfmt.c index 478502ec..3d69a2db 100644 --- a/modules/objfmts/bin/bin-objfmt.c +++ b/modules/objfmts/bin/bin-objfmt.c @@ -663,6 +663,7 @@ map_symrec_output(yasm_symrec *sym, void *d) map_output_info *info = (map_output_info *)d; const yasm_expr *equ; /*@dependent@*/ yasm_bytecode *precbc; + /*@only@*/ char *name = yasm_symrec_get_global_name(sym, info->object); assert(info != NULL); @@ -673,7 +674,7 @@ map_symrec_output(yasm_symrec *sym, void *d) yasm_intnum_set(info->intn, yasm_expr_get_intnum(&realequ, 0)); yasm_expr_destroy(realequ); map_print_intnum(info->intn, info); - fprintf(info->f, " %s\n", yasm_symrec_get_name(sym)); + fprintf(info->f, " %s\n", name); } else if (yasm_symrec_get_label(sym, &precbc) && yasm_bc_get_section(precbc) == info->section) { bin_section_data *bsd = @@ -691,8 +692,9 @@ map_symrec_output(yasm_symrec *sym, void *d) map_print_intnum(info->intn, info); /* Name */ - fprintf(info->f, " %s\n", yasm_symrec_get_name(sym)); + fprintf(info->f, " %s\n", name); } + yasm_xfree(name); return 0; } diff --git a/modules/objfmts/coff/coff-objfmt.c b/modules/objfmts/coff/coff-objfmt.c index 16cf6ea3..5066acff 100644 --- a/modules/objfmts/coff/coff-objfmt.c +++ b/modules/objfmts/coff/coff-objfmt.c @@ -973,7 +973,7 @@ coff_objfmt_output_sym(yasm_symrec *sym, /*@null@*/ void *d) /* Don't output local syms unless outputting all syms */ if (info->all_syms || vis != YASM_SYM_LOCAL) { - const char *name = yasm_symrec_get_name(sym); + /*@only*/ char *name = yasm_symrec_get_global_name(sym, info->object); const yasm_expr *equ_val; const yasm_intnum *intn; unsigned char *localbuf; @@ -1091,6 +1091,7 @@ coff_objfmt_output_sym(yasm_symrec *sym, /*@null@*/ void *d) } fwrite(info->buf, 18, 1, info->f); } + yasm_xfree(name); } return 0; } @@ -1105,7 +1106,7 @@ coff_objfmt_output_str(yasm_symrec *sym, /*@null@*/ void *d) /* Don't output local syms unless outputting all syms */ if (info->all_syms || vis != YASM_SYM_LOCAL) { - const char *name = yasm_symrec_get_name(sym); + /*@only@*/ char *name = yasm_symrec_get_global_name(sym, info->object); /*@dependent@*/ /*@null@*/ coff_symrec_data *csymd; size_t len = strlen(name); int aux; @@ -1127,6 +1128,7 @@ coff_objfmt_output_str(yasm_symrec *sym, /*@null@*/ void *d) break; } } + yasm_xfree(name); } return 0; } diff --git a/modules/objfmts/elf/elf-objfmt.c b/modules/objfmts/elf/elf-objfmt.c index d2083a84..dd868d91 100644 --- a/modules/objfmts/elf/elf-objfmt.c +++ b/modules/objfmts/elf/elf-objfmt.c @@ -86,14 +86,16 @@ static elf_symtab_entry * elf_objfmt_symtab_append(yasm_objfmt_elf *objfmt_elf, yasm_symrec *sym, elf_section_index sectidx, elf_symbol_binding bind, elf_symbol_type type, elf_symbol_vis vis, - yasm_expr *size, elf_address *value) + yasm_expr *size, elf_address *value, + yasm_object *object) { elf_symtab_entry *entry = yasm_symrec_get_data(sym, &elf_symrec_data); if (!entry) { + /*@only@*/ char *symname = yasm_symrec_get_global_name(sym, object); elf_strtab_entry *name = - elf_strtab_append_str(objfmt_elf->strtab, - yasm_symrec_get_name(sym)); + elf_strtab_append_str(objfmt_elf->strtab, symname); + yasm_xfree(symname); entry = elf_symtab_entry_create(name, sym); yasm_symrec_add_data(sym, &elf_symrec_data, entry); } @@ -109,7 +111,7 @@ elf_objfmt_symtab_append(yasm_objfmt_elf *objfmt_elf, yasm_symrec *sym, } static elf_symtab_entry * -build_extern(yasm_objfmt_elf *objfmt_elf, yasm_symrec *sym) +build_extern(yasm_objfmt_elf *objfmt_elf, yasm_symrec *sym, yasm_object *object) { yasm_valparamhead *objext_valparams = yasm_symrec_get_objext_valparams(sym); @@ -125,7 +127,7 @@ build_extern(yasm_objfmt_elf *objfmt_elf, yasm_symrec *sym) } return elf_objfmt_symtab_append(objfmt_elf, sym, SHN_UNDEF, STB_GLOBAL, 0, - STV_DEFAULT, NULL, NULL); + STV_DEFAULT, NULL, NULL, object); } struct elf_build_global_data { @@ -166,7 +168,7 @@ elf_global_helper_vis(void *obj, yasm_valparam *vp, unsigned long line, static elf_symtab_entry * -build_global(yasm_objfmt_elf *objfmt_elf, yasm_symrec *sym) +build_global(yasm_objfmt_elf *objfmt_elf, yasm_symrec *sym, yasm_object *object) { yasm_valparamhead *objext_valparams = yasm_symrec_get_objext_valparams(sym); @@ -201,7 +203,8 @@ build_global(yasm_objfmt_elf *objfmt_elf, yasm_symrec *sym) } return elf_objfmt_symtab_append(objfmt_elf, sym, SHN_UNDEF, STB_GLOBAL, - data.type, data.vis, data.size, NULL); + data.type, data.vis, data.size, NULL, + object); } static /*@null@*/ elf_symtab_entry * @@ -244,7 +247,7 @@ build_common(yasm_objfmt_elf *objfmt_elf, yasm_symrec *sym, yasm_object *object) } return elf_objfmt_symtab_append(objfmt_elf, sym, SHN_COMMON, STB_GLOBAL, - 0, STV_DEFAULT, *size, &addralign); + 0, STV_DEFAULT, *size, &addralign, object); } static int @@ -261,7 +264,7 @@ elf_objfmt_build_symtab(yasm_symrec *sym, /*@null@*/ void *d) assert(info != NULL); if (vis & YASM_SYM_EXTERN) { - entry = build_extern(info->objfmt_elf, sym); + entry = build_extern(info->objfmt_elf, sym, info->object); yasm_errwarn_propagate(info->errwarns, yasm_symrec_get_decl_line(sym)); return 0; @@ -292,7 +295,7 @@ elf_objfmt_build_symtab(yasm_symrec *sym, /*@null@*/ void *d) if (entry && elf_sym_in_table(entry)) ; else if (vis & YASM_SYM_GLOBAL) { - entry = build_global(info->objfmt_elf, sym); + entry = build_global(info->objfmt_elf, sym, info->object); yasm_errwarn_propagate(info->errwarns, yasm_symrec_get_decl_line(sym)); } else { int is_sect = 0; @@ -315,9 +318,11 @@ elf_objfmt_build_symtab(yasm_symrec *sym, /*@null@*/ void *d) #endif entry = yasm_symrec_get_data(sym, &elf_symrec_data); if (!entry) { + /*@only@*/ char *symname = + yasm_symrec_get_global_name(sym, info->object); elf_strtab_entry *name = !info->local_names || is_sect ? NULL : - elf_strtab_append_str(info->objfmt_elf->strtab, - yasm_symrec_get_name(sym)); + elf_strtab_append_str(info->objfmt_elf->strtab, symname); + yasm_xfree(symname); entry = elf_symtab_entry_create(name, sym); yasm_symrec_add_data(sym, &elf_symrec_data, entry); } @@ -1234,7 +1239,7 @@ dir_weak(yasm_object *object, yasm_valparamhead *valparams, yasm_symrec *sym = yasm_symtab_declare(object->symtab, symname, YASM_SYM_GLOBAL, line); elf_objfmt_symtab_append(objfmt_elf, sym, SHN_UNDEF, STB_WEAK, 0, - STV_DEFAULT, NULL, NULL); + STV_DEFAULT, NULL, NULL, object); } static void diff --git a/modules/objfmts/macho/macho-objfmt.c b/modules/objfmts/macho/macho-objfmt.c index 78ba9f0a..10d5893a 100644 --- a/modules/objfmts/macho/macho-objfmt.c +++ b/modules/objfmts/macho/macho-objfmt.c @@ -88,21 +88,11 @@ Will currently produce an error though the necessary means are provided by the Mach-O specification. - 3) symbol naming for global and external symbols - BSD, Windows and MacOS-X use underscores for global symbols, - where ELF/Linux does not. This file contains simple means of adding - underscores to symbols by defining "AUTO_UNDERSCORE" but that - can be considered not more than a hack. For cross-platform coding, - use two symbols for your routines and referenced data. - */ #include /*@unused@*/ RCSID("$Id$"); -/* optional: automatically prefix underscores to global exported symbols */ -/*#define AUTO_UNDERSCORE*/ - #include /* MACH-O DEFINES */ @@ -288,7 +278,6 @@ typedef struct macho_symrec_data { unsigned long index; /* index in output order */ yasm_intnum *value; /* valid after writing symtable to file */ unsigned long length; /* length + 1 (plus auto underscore) */ - int add_uscore; /* add underscore (0/1) */ } macho_symrec_data; @@ -808,7 +797,7 @@ static int macho_objfmt_count_sym(yasm_symrec *sym, /*@null@*/ void *d) { /*@null@*/ macho_objfmt_output_info *info = (macho_objfmt_output_info *)d; - const char *name; + /*@only@*/ char *name; yasm_sym_vis vis = yasm_symrec_get_visibility(sym); assert(info != NULL); @@ -825,19 +814,13 @@ macho_objfmt_count_sym(yasm_symrec *sym, /*@null@*/ void *d) sym_data->index = info->symindex; info->symindex++; - name = yasm_symrec_get_name(sym); /*printf("%s\n",name); */ - sym_data->add_uscore = 0; -#ifdef AUTO_UNDERSCORE - if (vis & (YASM_SYM_EXTERN | YASM_SYM_COMMON | YASM_SYM_GLOBAL)) { - if (name[0] != '_') - sym_data->add_uscore = 1; - } -#endif + name = yasm_symrec_get_global_name(sym, info->object); + /*printf("%s\n",name); */ /* name length + delimiter */ - sym_data->length = - (unsigned long)strlen(name) + sym_data->add_uscore + 1; + sym_data->length = (unsigned long)strlen(name) + 1; info->strlength += sym_data->length; info->indx++; + yasm_xfree(name); } } return 0; @@ -977,13 +960,13 @@ macho_objfmt_output_str(yasm_symrec *sym, /*@null@*/ void *d) if (info->all_syms || vis & (YASM_SYM_GLOBAL | YASM_SYM_COMMON | YASM_SYM_EXTERN)) { if (0 == macho_objfmt_is_section_label(sym)) { - const char *name = yasm_symrec_get_name(sym); + /*@only@*/ char *name = + yasm_symrec_get_global_name(sym, info->object); size_t len = strlen(name); xsymd = yasm_symrec_get_data(sym, &macho_symrec_data_cb); - if (xsymd->add_uscore) - fputc('_', info->f); fwrite(name, len + 1, 1, info->f); + yasm_xfree(name); } } return 0; diff --git a/modules/objfmts/rdf/rdf-objfmt.c b/modules/objfmts/rdf/rdf-objfmt.c index e4173289..962f02f6 100644 --- a/modules/objfmts/rdf/rdf-objfmt.c +++ b/modules/objfmts/rdf/rdf-objfmt.c @@ -520,7 +520,7 @@ rdf_objfmt_output_sym(yasm_symrec *sym, /*@null@*/ void *d) { /*@null@*/ rdf_objfmt_output_info *info = (rdf_objfmt_output_info *)d; yasm_sym_vis vis = yasm_symrec_get_visibility(sym); - const char *name; + /*@only@*/ char *name; size_t len; unsigned long value = 0; unsigned int scnum = 0; @@ -558,7 +558,7 @@ rdf_objfmt_output_sym(yasm_symrec *sym, /*@null@*/ void *d) return 0; } - name = yasm_symrec_get_name(sym); + name = yasm_symrec_get_global_name(sym, info->object); len = strlen(name); if (len > EXIM_LABEL_MAX-1) { @@ -655,6 +655,7 @@ rdf_objfmt_output_sym(yasm_symrec *sym, /*@null@*/ void *d) memcpy(localbuf, name, len); localbuf += len; YASM_WRITE_8(localbuf, 0); /* 0-terminated name */ + yasm_xfree(name); fwrite(info->buf, (unsigned long)(localbuf-info->buf), 1, info->f); diff --git a/modules/objfmts/xdf/xdf-objfmt.c b/modules/objfmts/xdf/xdf-objfmt.c index 89cb403c..bae43525 100644 --- a/modules/objfmts/xdf/xdf-objfmt.c +++ b/modules/objfmts/xdf/xdf-objfmt.c @@ -452,7 +452,7 @@ xdf_objfmt_output_sym(yasm_symrec *sym, /*@null@*/ void *d) assert(info != NULL); if (info->all_syms || vis != YASM_SYM_LOCAL) { - const char *name = yasm_symrec_get_name(sym); + /*@only@*/ char *name = yasm_symrec_get_global_name(sym, info->object); const yasm_expr *equ_val; const yasm_intnum *intn; size_t len = strlen(name); @@ -514,6 +514,7 @@ xdf_objfmt_output_sym(yasm_symrec *sym, /*@null@*/ void *d) info->strtab_offset += (unsigned long)(len+1); YASM_WRITE_32_L(localbuf, flags); /* flags */ fwrite(info->buf, 16, 1, info->f); + yasm_xfree(name); } return 0; } @@ -527,9 +528,10 @@ xdf_objfmt_output_str(yasm_symrec *sym, /*@null@*/ void *d) assert(info != NULL); if (info->all_syms || vis != YASM_SYM_LOCAL) { - const char *name = yasm_symrec_get_name(sym); + /*@only@*/ char *name = yasm_symrec_get_global_name(sym, info->object); size_t len = strlen(name); fwrite(name, len+1, 1, info->f); + yasm_xfree(name); } return 0; } From bd4a2ffdb87b45354f1a5c9c27501b0175737858 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 3 Jul 2008 04:19:12 +0000 Subject: [PATCH 199/585] Bin map file: Fix incorrect address printing for symbols. We were printing the previous bytecode's start rather than the label's bytecode. Use yasm_bc_next_offset() to get the correct offset. svn path=/trunk/yasm/; revision=2110 --- modules/objfmts/bin/bin-objfmt.c | 4 ++-- modules/objfmts/bin/tests/multisect/multisect1.map | 2 +- modules/objfmts/bin/tests/multisect/multisect2.map | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/objfmts/bin/bin-objfmt.c b/modules/objfmts/bin/bin-objfmt.c index 3d69a2db..fc283d71 100644 --- a/modules/objfmts/bin/bin-objfmt.c +++ b/modules/objfmts/bin/bin-objfmt.c @@ -681,13 +681,13 @@ map_symrec_output(yasm_symrec *sym, void *d) yasm_section_get_data(info->section, &bin_section_data_cb); /* Real address */ - yasm_intnum_set_uint(info->intn, precbc->offset); + yasm_intnum_set_uint(info->intn, yasm_bc_next_offset(precbc)); yasm_intnum_calc(info->intn, YASM_EXPR_ADD, bsd->istart); map_print_intnum(info->intn, info); fprintf(info->f, " "); /* Virtual address */ - yasm_intnum_set_uint(info->intn, precbc->offset); + yasm_intnum_set_uint(info->intn, yasm_bc_next_offset(precbc)); yasm_intnum_calc(info->intn, YASM_EXPR_ADD, bsd->ivstart); map_print_intnum(info->intn, info); diff --git a/modules/objfmts/bin/tests/multisect/multisect1.map b/modules/objfmts/bin/tests/multisect/multisect1.map index 68cb155e..0a56e413 100644 --- a/modules/objfmts/bin/tests/multisect/multisect1.map +++ b/modules/objfmts/bin/tests/multisect/multisect1.map @@ -73,6 +73,6 @@ Real Virtual Name ---- Section .bss ------------------------------------------------------------- Real Virtual Name -00000020 00000020 stack_ends +00000420 00000420 stack_ends diff --git a/modules/objfmts/bin/tests/multisect/multisect2.map b/modules/objfmts/bin/tests/multisect/multisect2.map index b3cb273e..82002edb 100644 --- a/modules/objfmts/bin/tests/multisect/multisect2.map +++ b/modules/objfmts/bin/tests/multisect/multisect2.map @@ -55,9 +55,9 @@ vfollows: not defined ---- Section .text ------------------------------------------------------------ Real Virtual Name -0000010C 0000010C showax -0000010F 0000010F showax.top -0000011F 0000011F showax.dec_dig +0000010D 0000010D showax +00000112 00000112 showax.top +00000122 00000122 showax.dec_dig ---- Section .data ------------------------------------------------------------ From a78a908baba52c6cbbf5a2143fdcc91c2695bcfb Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 6 Jul 2008 22:26:49 +0000 Subject: [PATCH 200/585] Generated files listed in SOURCES (rather than included by other files) should not be listed in BUILT_SOURCES but rather have nodist_ prepended. They still need to be separately listed as CLEANFILES as they're built at make time. Reported by: David Harvey svn path=/trunk/yasm/; revision=2111 --- libyasm/Makefile.inc | 3 +-- modules/arch/lc3b/Makefile.inc | 4 +--- modules/arch/x86/Makefile.inc | 6 ++---- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/libyasm/Makefile.inc b/libyasm/Makefile.inc index 9e82a0e3..482af05a 100644 --- a/libyasm/Makefile.inc +++ b/libyasm/Makefile.inc @@ -28,12 +28,11 @@ libyasm_a_SOURCES += libyasm/valparam.c libyasm_a_SOURCES += libyasm/value.c libyasm_a_SOURCES += libyasm/xmalloc.c libyasm_a_SOURCES += libyasm/xstrdup.c -libyasm_a_SOURCES += module.c +nodist_libyasm_a_SOURCES += module.c module.c: $(top_srcdir)/libyasm/module.in genmodule$(EXEEXT) Makefile $(top_builddir)/genmodule$(EXEEXT) $(top_srcdir)/libyasm/module.in Makefile -BUILT_SOURCES += module.c CLEANFILES += module.c noinst_PROGRAMS += genmodule diff --git a/modules/arch/lc3b/Makefile.inc b/modules/arch/lc3b/Makefile.inc index 6fbc60ce..13cc33b8 100644 --- a/modules/arch/lc3b/Makefile.inc +++ b/modules/arch/lc3b/Makefile.inc @@ -3,15 +3,13 @@ libyasm_a_SOURCES += modules/arch/lc3b/lc3barch.c libyasm_a_SOURCES += modules/arch/lc3b/lc3barch.h libyasm_a_SOURCES += modules/arch/lc3b/lc3bbc.c -libyasm_a_SOURCES += lc3bid.c +nodist_libyasm_a_SOURCES += lc3bid.c YASM_MODULES += arch_lc3b lc3bid.c: $(srcdir)/modules/arch/lc3b/lc3bid.re re2c$(EXEEXT) $(top_builddir)/re2c$(EXEEXT) -s -o $@ $(srcdir)/modules/arch/lc3b/lc3bid.re -BUILT_SOURCES += lc3bid.c - CLEANFILES += lc3bid.c EXTRA_DIST += modules/arch/lc3b/tests/Makefile.inc diff --git a/modules/arch/x86/Makefile.inc b/modules/arch/x86/Makefile.inc index 0f682381..ef5e581d 100644 --- a/modules/arch/x86/Makefile.inc +++ b/modules/arch/x86/Makefile.inc @@ -5,8 +5,8 @@ libyasm_a_SOURCES += modules/arch/x86/x86arch.h libyasm_a_SOURCES += modules/arch/x86/x86bc.c libyasm_a_SOURCES += modules/arch/x86/x86expr.c libyasm_a_SOURCES += modules/arch/x86/x86id.c -libyasm_a_SOURCES += x86cpu.c -libyasm_a_SOURCES += x86regtmod.c +nodist_libyasm_a_SOURCES += x86cpu.c +nodist_libyasm_a_SOURCES += x86regtmod.c YASM_MODULES += arch_x86 @@ -49,8 +49,6 @@ x86regtmod.c: $(srcdir)/modules/arch/x86/x86regtmod.gperf genperf$(EXEEXT) BUILT_SOURCES += x86insn_nasm.c BUILT_SOURCES += x86insn_gas.c -BUILT_SOURCES += x86cpu.c -BUILT_SOURCES += x86regtmod.c CLEANFILES += x86insn_nasm.c CLEANFILES += x86insn_gas.c CLEANFILES += x86cpu.c From 901b28cab4e7ce1e539d723c2e86ca1b3be90eaf Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 6 Jul 2008 22:30:07 +0000 Subject: [PATCH 201/585] yasm_symrec_get_global_name(): Document object parameter. svn path=/trunk/yasm/; revision=2112 --- libyasm/symrec.h | 1 + 1 file changed, 1 insertion(+) diff --git a/libyasm/symrec.h b/libyasm/symrec.h index 65d47755..94dca89d 100644 --- a/libyasm/symrec.h +++ b/libyasm/symrec.h @@ -255,6 +255,7 @@ YASM_LIB_DECL /** Get the externally-visible (global) name of a symbol. * \param sym symbol + * \param object object * \return Externally-visible symbol name (allocated, caller must free). */ YASM_LIB_DECL From 9cd2ac337893e40cb73c4826448f953f1f7f2438 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Mon, 7 Jul 2008 06:17:33 +0000 Subject: [PATCH 202/585] x86_reg_print(): Add missing commas for correct register name lookup. svn path=/trunk/yasm/; revision=2113 --- modules/arch/x86/x86arch.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/arch/x86/x86arch.c b/modules/arch/x86/x86arch.c index de7ba518..9ad3cda0 100644 --- a/modules/arch/x86/x86arch.c +++ b/modules/arch/x86/x86arch.c @@ -449,15 +449,15 @@ x86_reg_print(yasm_arch *arch, uintptr_t reg, FILE *f) "r8b", "r9b", "r10b", "r11b", "r12b", "r13b", "r14b", "r15b" }; static const char *name16[] = { - "ax", "cx", "dx", "bx", "sp", "bp", "si", "di" + "ax", "cx", "dx", "bx", "sp", "bp", "si", "di", "r8w", "r9w", "r10w", "r11w", "r12w", "r13w", "r14w", "r15w" }; static const char *name32[] = { - "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi" + "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi", "r8d", "r9d", "r10d", "r11d", "r12d", "r13d", "r14d", "r15d" }; static const char *name64[] = { - "rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi" + "rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi", "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15" }; From dbf6c6ce38697d21157502d9c938dc8053214ccd Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 8 Jul 2008 06:28:37 +0000 Subject: [PATCH 203/585] Fix #148: Don't clear elf section flags in GAS if it's a standard section and no GAS flags were provided. svn path=/trunk/yasm/; revision=2114 --- modules/objfmts/elf/elf-objfmt.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/objfmts/elf/elf-objfmt.c b/modules/objfmts/elf/elf-objfmt.c index dd868d91..2fd400c7 100644 --- a/modules/objfmts/elf/elf-objfmt.c +++ b/modules/objfmts/elf/elf-objfmt.c @@ -962,6 +962,7 @@ struct elf_section_switch_data { unsigned long flags; unsigned long type; int gasflags; + int stdsect; }; /* GAS-style flags */ @@ -979,6 +980,9 @@ elf_helper_gasflags(void *obj, yasm_valparam *vp, unsigned long line, void *d, return -1; } + if (data->stdsect && strlen(s) == 0) + return 0; + data->flags = 0; for (i=0; i Date: Tue, 8 Jul 2008 06:36:44 +0000 Subject: [PATCH 204/585] Fix extraneous warnings and update testcases for [2114] changes. svn path=/trunk/yasm/; revision=2115 --- modules/dbgfmts/dwarf2/tests/pass64/dwarf64_leb128.hex | 2 +- modules/objfmts/elf/elf-objfmt.c | 4 +++- modules/objfmts/elf/tests/gas64/crosssect.hex | 2 +- modules/objfmts/elf/tests/gas64/elf_gas64_curpos.hex | 4 ++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/dbgfmts/dwarf2/tests/pass64/dwarf64_leb128.hex b/modules/dbgfmts/dwarf2/tests/pass64/dwarf64_leb128.hex index af09833c..562eadb6 100644 --- a/modules/dbgfmts/dwarf2/tests/pass64/dwarf64_leb128.hex +++ b/modules/dbgfmts/dwarf2/tests/pass64/dwarf64_leb128.hex @@ -90134,7 +90134,7 @@ c0 00 00 00 -00 +02 00 00 00 diff --git a/modules/objfmts/elf/elf-objfmt.c b/modules/objfmts/elf/elf-objfmt.c index 2fd400c7..02051de1 100644 --- a/modules/objfmts/elf/elf-objfmt.c +++ b/modules/objfmts/elf/elf-objfmt.c @@ -980,8 +980,10 @@ elf_helper_gasflags(void *obj, yasm_valparam *vp, unsigned long line, void *d, return -1; } - if (data->stdsect && strlen(s) == 0) + if (data->stdsect && strlen(s) == 0) { + data->gasflags = 1; return 0; + } data->flags = 0; for (i=0; i Date: Tue, 15 Jul 2008 05:49:29 +0000 Subject: [PATCH 205/585] Actually implement yasm__abspath() according to its documentation. Formerly, it would not correctly handle absolute paths. Now it uses yasm__combpath() to do absolute-path aware path combination. As a benefit, it no longer needs to be OS-specific. Reported by: Shmuel Baron svn path=/trunk/yasm/; revision=2116 --- libyasm/file.c | 38 ++------------------------------------ libyasm/file.h | 28 ++-------------------------- 2 files changed, 4 insertions(+), 62 deletions(-) diff --git a/libyasm/file.c b/libyasm/file.c index a231d89d..01359de3 100644 --- a/libyasm/file.c +++ b/libyasm/file.c @@ -247,52 +247,18 @@ yasm__getcwd(void) return buf; } -/* FIXME: dumb way for now */ char * -yasm__abspath_unix(const char *path) +yasm__abspath(const char *path) { char *curdir, *abspath; - static const char pathsep[2] = "/"; curdir = yasm__getcwd(); - - abspath = yasm_xmalloc(strlen(curdir) + strlen(path) + 2); - strcpy(abspath, curdir); - strcat(abspath, pathsep); - strcat(abspath, path); - + abspath = yasm__combpath(curdir, path); yasm_xfree(curdir); return abspath; } -/* FIXME: dumb way for now */ -char * -yasm__abspath_win(const char *path) -{ - char *curdir, *abspath, *ch; - static const char pathsep[2] = "\\"; - - curdir = yasm__getcwd(); - - abspath = yasm_xmalloc(strlen(curdir) + strlen(path) + 2); - strcpy(abspath, curdir); - strcat(abspath, pathsep); - strcat(abspath, path); - - yasm_xfree(curdir); - - /* Replace all / with \ */ - ch = abspath; - while (*ch) { - if (*ch == '/') - *ch = '\\'; - ch++; - } - - return abspath; -} - char * yasm__combpath_unix(const char *from, const char *to) { diff --git a/libyasm/file.h b/libyasm/file.h index f257faed..e16491b7 100644 --- a/libyasm/file.h +++ b/libyasm/file.h @@ -132,37 +132,13 @@ size_t yasm__splitpath_win(const char *path, /*@out@*/ const char **tail); YASM_LIB_DECL /*@only@*/ char *yasm__getcwd(void); -/** Convert a UNIX relative or absolute pathname into an absolute pathname. - * \internal - * \param path pathname - * \return Absolute version of path (newly allocated). - */ -YASM_LIB_DECL -/*@only@*/ char *yasm__abspath_unix(const char *path); - -/** Convert a Windows relative or absolute pathname into an absolute pathname. - * \internal - * \param path pathname - * \return Absolute version of path (newly allocated). - */ -YASM_LIB_DECL -/*@only@*/ char *yasm__abspath_win(const char *path); - /** Convert a relative or absolute pathname into an absolute pathname. - * Unless otherwise defined, defaults to yasm__abspath_unix(). * \internal * \param path pathname * \return Absolute version of path (newly allocated). */ -#ifndef yasm__abspath -# if defined (_WIN32) || defined (WIN32) || defined (__MSDOS__) || \ - defined (__DJGPP__) || defined (__OS2__) || defined (__CYGWIN__) || \ - defined (__CYGWIN32__) -# define yasm__abspath(path) yasm__abspath_win(path) -# else -# define yasm__abspath(path) yasm__abspath_unix(path) -# endif -#endif +YASM_LIB_DECL +/*@only@*/ char *yasm__abspath(const char *path); /** Build a UNIX pathname that is equivalent to accessing the "to" pathname * when you're in the directory containing "from". Result is relative if both From 33aa2d621bbb1104c525d11a154b4bf03d8aff6c Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 18 Jul 2008 05:52:01 +0000 Subject: [PATCH 206/585] Fix bug in expr_level_op(). Discovered when adding on-the-fly expr leveling. svn path=/trunk/yasm/; revision=2117 --- libyasm/expr.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libyasm/expr.c b/libyasm/expr.c index fe7cb9a9..14a52264 100644 --- a/libyasm/expr.c +++ b/libyasm/expr.c @@ -43,6 +43,9 @@ #include "arch.h" +static /*@only@*/ yasm_expr *expr_level_op + (/*@returned@*/ /*@only@*/ yasm_expr *e, int fold_const, + int simplify_ident, int simplify_reg_mul); static int expr_traverse_nodes_post(/*@null@*/ yasm_expr *e, /*@null@*/ void *d, int (*func) (/*@null@*/ yasm_expr *e, @@ -116,7 +119,7 @@ yasm_expr_create(yasm_expr_op op, yasm_expr__item *left, ptr->line = line; - return ptr; + return expr_level_op(ptr, 1, 1, 0); } /*@=compmempass@*/ @@ -779,7 +782,8 @@ expr_level_op(/*@returned@*/ /*@only@*/ yasm_expr *e, int fold_const, if (i == first_int_term) first_int_term = o; o--; - } + } else + o--; } /* Simplify identities, make IDENT if possible, and save to e->numterms. */ From b174e03f509b1af7d5638cb21bef0817aba8a479 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 13 Aug 2008 03:43:47 +0000 Subject: [PATCH 207/585] Add support for newly specified AVX/AES instructions: - vaes* - 256b vmovnt{ps,pd,dq} Reported by: Mark.Charney@intel.com svn path=/trunk/yasm/; revision=2118 --- modules/arch/x86/gen_x86_insn.py | 40 +++++++- modules/arch/x86/tests/aes.asm | 31 +++++++ modules/arch/x86/tests/aes.hex | 153 +++++++++++++++++++++++++++++++ modules/arch/x86/tests/avx.asm | 6 ++ modules/arch/x86/tests/avx.hex | 24 +++++ modules/arch/x86/x86id.c | 2 +- 6 files changed, 253 insertions(+), 3 deletions(-) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index b45dd3ad..a361c483 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -4493,6 +4493,14 @@ add_group("movnt", opcode=[0x0F, 0x00], operands=[Operand(type="Mem", size=128, relaxed=True, dest="EA"), Operand(type="SIMDReg", size=128, dest="Spare")]) +add_group("movnt", + cpu=["AVX"], + modifiers=["PreAdd", "Op1Add"], + vex=256, + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="Mem", size=256, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=256, dest="Spare")]) add_insn("movntps", "movnt", modifiers=[0, 0x2B]) add_insn("vmovntps", "movnt", modifiers=[0, 0x2B, VEXL0], avx=True) @@ -6473,21 +6481,47 @@ add_insn("vfnmsubss", "fma_128_m32", modifiers=[0x7E]) add_group("aes", cpu=["AES"], + modifiers=["Op1Add", "Op2Add", "SetVEX"], + prefix=0x66, + opcode=[0x0F, 0x00, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) +add_group("aes", + cpu=["AES", "AVX"], modifiers=["Op1Add", "Op2Add"], + vex=128, prefix=0x66, opcode=[0x0F, 0x00, 0x00], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) + add_insn("aesenc", "aes", modifiers=[0x38, 0xDC]) add_insn("aesenclast", "aes", modifiers=[0x38, 0xDD]) add_insn("aesdec", "aes", modifiers=[0x38, 0xDE]) add_insn("aesdeclast", "aes", modifiers=[0x38, 0xDF]) -add_insn("aesimc", "aes", modifiers=[0x38, 0xDB]) + +add_insn("vaesenc", "aes", modifiers=[0x38, 0xDC, VEXL0], avx=True) +add_insn("vaesenclast", "aes", modifiers=[0x38, 0xDD, VEXL0], avx=True) +add_insn("vaesdec", "aes", modifiers=[0x38, 0xDE, VEXL0], avx=True) +add_insn("vaesdeclast", "aes", modifiers=[0x38, 0xDF, VEXL0], avx=True) + +add_group("aesimc", + cpu=["AES"], + modifiers=["Op1Add", "Op2Add", "SetVEX"], + prefix=0x66, + opcode=[0x0F, 0x00, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) + +add_insn("aesimc", "aesimc", modifiers=[0x38, 0xDB]) +add_insn("vaesimc", "aesimc", modifiers=[0x38, 0xDB, VEXL0], avx=True) + add_group("aes_imm", cpu=["AES"], - modifiers=["Op1Add", "Op2Add"], + modifiers=["Op1Add", "Op2Add", "SetVEX"], prefix=0x66, opcode=[0x0F, 0x00, 0x00], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), @@ -6495,6 +6529,8 @@ add_group("aes_imm", Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) add_insn("aeskeygenassist", "aes_imm", modifiers=[0x3A, 0xDF]) +add_insn("vaeskeygenassist", "aes_imm", modifiers=[0x3A, 0xDF, VEXL0], + avx=True) ##################################################################### # Intel PCLMULQDQ instruction diff --git a/modules/arch/x86/tests/aes.asm b/modules/arch/x86/tests/aes.asm index 7f514eca..52c587d5 100644 --- a/modules/arch/x86/tests/aes.asm +++ b/modules/arch/x86/tests/aes.asm @@ -5,26 +5,57 @@ aesenc xmm1, dqword [rax] aesenc xmm10, xmm12 aesenc xmm10, [rax+r15*4] aesenc xmm10, [r14+r15*4] +vaesenc xmm1, xmm2 +vaesenc xmm1, [rax] +vaesenc xmm1, dqword [rax] +vaesenc xmm1, xmm2, xmm3 +vaesenc xmm1, xmm2, [rax] +vaesenc xmm1, xmm2, dqword [rax] aesenclast xmm1, xmm2 aesenclast xmm1, [rax] aesenclast xmm1, dqword [rax] +vaesenclast xmm1, xmm2 +vaesenclast xmm1, [rax] +vaesenclast xmm1, dqword [rax] +vaesenclast xmm1, xmm2, xmm3 +vaesenclast xmm1, xmm2, [rax] +vaesenclast xmm1, xmm2, dqword [rax] aesdec xmm1, xmm2 aesdec xmm1, [rax] aesdec xmm1, dqword [rax] +vaesdec xmm1, xmm2 +vaesdec xmm1, [rax] +vaesdec xmm1, dqword [rax] +vaesdec xmm1, xmm2, xmm3 +vaesdec xmm1, xmm2, [rax] +vaesdec xmm1, xmm2, dqword [rax] aesdeclast xmm1, xmm2 aesdeclast xmm1, [rax] aesdeclast xmm1, dqword [rax] +vaesdeclast xmm1, xmm2 +vaesdeclast xmm1, [rax] +vaesdeclast xmm1, dqword [rax] +vaesdeclast xmm1, xmm2, xmm3 +vaesdeclast xmm1, xmm2, [rax] +vaesdeclast xmm1, xmm2, dqword [rax] aesimc xmm1, xmm2 aesimc xmm1, [rax] aesimc xmm1, dqword [rax] +vaesimc xmm1, xmm2 +vaesimc xmm1, [rax] +vaesimc xmm1, dqword [rax] +; no 3-operand form aeskeygenassist xmm1, xmm2, 5 aeskeygenassist xmm1, [rax], byte 5 aeskeygenassist xmm1, dqword [rax], 5 +vaeskeygenassist xmm1, xmm2, 5 +vaeskeygenassist xmm1, [rax], byte 5 +vaeskeygenassist xmm1, dqword [rax], 5 pclmulqdq xmm1, xmm2, 5 pclmulqdq xmm1, [rax], byte 5 diff --git a/modules/arch/x86/tests/aes.hex b/modules/arch/x86/tests/aes.hex index f87172c0..5396dee7 100644 --- a/modules/arch/x86/tests/aes.hex +++ b/modules/arch/x86/tests/aes.hex @@ -33,6 +33,36 @@ b8 dc 14 be +c4 +e2 +71 +dc +ca +c4 +e2 +71 +dc +08 +c4 +e2 +71 +dc +08 +c4 +e2 +69 +dc +cb +c4 +e2 +69 +dc +08 +c4 +e2 +69 +dc +08 66 0f 38 @@ -48,6 +78,36 @@ dd 38 dd 08 +c4 +e2 +71 +dd +ca +c4 +e2 +71 +dd +08 +c4 +e2 +71 +dd +08 +c4 +e2 +69 +dd +cb +c4 +e2 +69 +dd +08 +c4 +e2 +69 +dd +08 66 0f 38 @@ -63,6 +123,36 @@ de 38 de 08 +c4 +e2 +71 +de +ca +c4 +e2 +71 +de +08 +c4 +e2 +71 +de +08 +c4 +e2 +69 +de +cb +c4 +e2 +69 +de +08 +c4 +e2 +69 +de +08 66 0f 38 @@ -78,6 +168,36 @@ df 38 df 08 +c4 +e2 +71 +df +ca +c4 +e2 +71 +df +08 +c4 +e2 +71 +df +08 +c4 +e2 +69 +df +cb +c4 +e2 +69 +df +08 +c4 +e2 +69 +df +08 66 0f 38 @@ -93,6 +213,21 @@ db 38 db 08 +c4 +e2 +71 +db +ca +c4 +e2 +71 +db +08 +c4 +e2 +71 +db +08 66 0f 3a @@ -111,6 +246,24 @@ df df 08 05 +c4 +e3 +79 +df +ca +05 +c4 +e3 +79 +df +08 +05 +c4 +e3 +79 +df +08 +05 66 0f 3a diff --git a/modules/arch/x86/tests/avx.asm b/modules/arch/x86/tests/avx.asm index 2a2ad594..6461ea05 100644 --- a/modules/arch/x86/tests/avx.asm +++ b/modules/arch/x86/tests/avx.asm @@ -921,6 +921,8 @@ movntdq [rax], xmm1 movntdq dqword [rax], xmm1 vmovntdq [rax], xmm1 vmovntdq dqword [rax], xmm1 +vmovntdq [rax], ymm1 +vmovntdq yword [rax], ymm1 movntdqa xmm1, [rax] movntdqa xmm1, dqword [rax] @@ -931,11 +933,15 @@ movntpd [rax], xmm1 movntpd dqword [rax], xmm1 vmovntpd [rax], xmm1 vmovntpd dqword [rax], xmm1 +vmovntpd [rax], ymm1 +vmovntpd yword [rax], ymm1 movntps [rax], xmm1 movntps dqword [rax], xmm1 vmovntps [rax], xmm1 vmovntps dqword [rax], xmm1 +vmovntps [rax], ymm1 +vmovntps yword [rax], ymm1 movsd xmm1, xmm2 vmovsd xmm1, xmm2 diff --git a/modules/arch/x86/tests/avx.hex b/modules/arch/x86/tests/avx.hex index 1a73e386..c9ada3e1 100644 --- a/modules/arch/x86/tests/avx.hex +++ b/modules/arch/x86/tests/avx.hex @@ -3466,6 +3466,14 @@ c5 f9 e7 08 +c5 +fd +e7 +08 +c5 +fd +e7 +08 66 0f 38 @@ -3502,6 +3510,14 @@ c5 f9 2b 08 +c5 +fd +2b +08 +c5 +fd +2b +08 0f 2b 08 @@ -3516,6 +3532,14 @@ c5 f8 2b 08 +c5 +fc +2b +08 +c5 +fc +2b +08 f2 0f 10 diff --git a/modules/arch/x86/x86id.c b/modules/arch/x86/x86id.c index 07d05a0e..4b60810b 100644 --- a/modules/arch/x86/x86id.c +++ b/modules/arch/x86/x86id.c @@ -1723,7 +1723,7 @@ yasm_x86__parse_check_insnprefix(yasm_arch *arch, const char *id, *bc = (yasm_bytecode *)NULL; *prefix = 0; - if (id_len > 15) + if (id_len > 16) return YASM_ARCH_NOTINSNPREFIX; for (i=0; i Date: Wed, 13 Aug 2008 04:05:19 +0000 Subject: [PATCH 208/585] Increase size of buffer now that mnenomics can be 16 characters. svn path=/trunk/yasm/; revision=2119 --- modules/arch/x86/x86id.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/arch/x86/x86id.c b/modules/arch/x86/x86id.c index 4b60810b..2e51a433 100644 --- a/modules/arch/x86/x86id.c +++ b/modules/arch/x86/x86id.c @@ -1718,7 +1718,7 @@ yasm_x86__parse_check_insnprefix(yasm_arch *arch, const char *id, yasm_arch_x86 *arch_x86 = (yasm_arch_x86 *)arch; /*@null@*/ const insnprefix_parse_data *pdata; size_t i; - static char lcaseid[16]; + static char lcaseid[17]; *bc = (yasm_bytecode *)NULL; *prefix = 0; From c80ed373bab9bf5948a8d06b687a93845301bd28 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 4 Sep 2008 04:45:30 +0000 Subject: [PATCH 209/585] Fix #153: Name the absolute symbol. While we're here, ensure it's always output regardless of all_syms setting. svn path=/trunk/yasm/; revision=2120 --- modules/objfmts/coff/coff-objfmt.c | 15 +- modules/objfmts/win64/tests/Makefile.inc | 2 + modules/objfmts/win64/tests/win64-abs.asm | 1 + modules/objfmts/win64/tests/win64-abs.hex | 171 ++++++++++++++++++++++ 4 files changed, 185 insertions(+), 4 deletions(-) create mode 100644 modules/objfmts/win64/tests/win64-abs.asm create mode 100644 modules/objfmts/win64/tests/win64-abs.hex diff --git a/modules/objfmts/coff/coff-objfmt.c b/modules/objfmts/coff/coff-objfmt.c index 5066acff..46f6d1eb 100644 --- a/modules/objfmts/coff/coff-objfmt.c +++ b/modules/objfmts/coff/coff-objfmt.c @@ -950,7 +950,7 @@ coff_objfmt_count_sym(yasm_symrec *sym, /*@null@*/ void *d) sym_data = coff_objfmt_sym_set_data(sym, COFF_SCL_EXT, 0, COFF_SYMTAB_AUX_NONE); - if (info->all_syms || vis != YASM_SYM_LOCAL) { + if (info->all_syms || vis != YASM_SYM_LOCAL || yasm_symrec_is_abs(sym)) { /* Save index in symrec data */ if (!sym_data) { sym_data = coff_objfmt_sym_set_data(sym, COFF_SCL_STAT, 0, @@ -968,16 +968,17 @@ coff_objfmt_output_sym(yasm_symrec *sym, /*@null@*/ void *d) { /*@null@*/ coff_objfmt_output_info *info = (coff_objfmt_output_info *)d; yasm_sym_vis vis = yasm_symrec_get_visibility(sym); + int is_abs = yasm_symrec_is_abs(sym); assert(info != NULL); /* Don't output local syms unless outputting all syms */ - if (info->all_syms || vis != YASM_SYM_LOCAL) { - /*@only*/ char *name = yasm_symrec_get_global_name(sym, info->object); + if (info->all_syms || vis != YASM_SYM_LOCAL || is_abs) { + /*@only*/ char *name; const yasm_expr *equ_val; const yasm_intnum *intn; unsigned char *localbuf; - size_t len = strlen(name); + size_t len; int aux; /*@dependent@*/ /*@null@*/ coff_symrec_data *csymd; unsigned long value = 0; @@ -988,6 +989,12 @@ coff_objfmt_output_sym(yasm_symrec *sym, /*@null@*/ void *d) unsigned long nreloc = 0; /* for sect auxent */ yasm_objfmt_coff *objfmt_coff = info->objfmt_coff; + if (is_abs) + name = yasm__xstrdup(".absolut"); + else + name = yasm_symrec_get_global_name(sym, info->object); + len = strlen(name); + /* Get symrec's of_data (needed for storage class) */ csymd = yasm_symrec_get_data(sym, &coff_symrec_data_cb); if (!csymd) diff --git a/modules/objfmts/win64/tests/Makefile.inc b/modules/objfmts/win64/tests/Makefile.inc index 06e0f86d..ed104766 100644 --- a/modules/objfmts/win64/tests/Makefile.inc +++ b/modules/objfmts/win64/tests/Makefile.inc @@ -19,6 +19,8 @@ EXTRA_DIST += modules/objfmts/win64/tests/sce4.hex EXTRA_DIST += modules/objfmts/win64/tests/sce4.masm EXTRA_DIST += modules/objfmts/win64/tests/sce4-err.asm EXTRA_DIST += modules/objfmts/win64/tests/sce4-err.errwarn +EXTRA_DIST += modules/objfmts/win64/tests/win64-abs.asm +EXTRA_DIST += modules/objfmts/win64/tests/win64-abs.hex EXTRA_DIST += modules/objfmts/win64/tests/win64-curpos.asm EXTRA_DIST += modules/objfmts/win64/tests/win64-curpos.hex EXTRA_DIST += modules/objfmts/win64/tests/win64-dataref.asm diff --git a/modules/objfmts/win64/tests/win64-abs.asm b/modules/objfmts/win64/tests/win64-abs.asm new file mode 100644 index 00000000..b5c29ea2 --- /dev/null +++ b/modules/objfmts/win64/tests/win64-abs.asm @@ -0,0 +1 @@ +mov rax, [rel 0x1000] diff --git a/modules/objfmts/win64/tests/win64-abs.hex b/modules/objfmts/win64/tests/win64-abs.hex new file mode 100644 index 00000000..7d4b35e9 --- /dev/null +++ b/modules/objfmts/win64/tests/win64-abs.hex @@ -0,0 +1,171 @@ +64 +86 +01 +00 +00 +00 +00 +00 +4d +00 +00 +00 +05 +00 +00 +00 +00 +00 +04 +00 +2e +74 +65 +78 +74 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +07 +00 +00 +00 +3c +00 +00 +00 +43 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +20 +00 +50 +60 +48 +8b +05 +00 +10 +00 +00 +03 +00 +00 +00 +04 +00 +00 +00 +04 +00 +2e +66 +69 +6c +65 +00 +00 +00 +00 +00 +00 +00 +fe +ff +00 +00 +67 +01 +2d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +2e +74 +65 +78 +74 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +03 +01 +07 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +2e +61 +62 +73 +6f +6c +75 +74 +00 +00 +00 +00 +ff +ff +00 +00 +03 +00 +04 +00 +00 +00 From 11798b4d6b3b7bacd5f91535c13bafcf8a46b86e Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 10 Sep 2008 02:42:45 +0000 Subject: [PATCH 210/585] Mark gen_x86_insn.py outputs as generated, to discourage hand-editing. Suggested by: Mark Charney svn path=/trunk/yasm/; revision=2121 --- modules/arch/x86/gen_x86_insn.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index a361c483..d9ddb7c4 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -1,5 +1,4 @@ #! /usr/bin/env python -# $Id$ # x86 instructions and prefixes data and code generation # # Copyright (C) 2002-2007 Peter Johnson @@ -26,6 +25,9 @@ # POSSIBILITY OF SUCH DAMAGE. # # NOTE: operands are arranged in NASM / Intel order (e.g. dest, src) +rcstag = "$Id$" +scriptname = rcstag.split()[1] +scriptrev = rcstag.split()[2] ordered_cpus = [ "086", "186", "286", "386", "486", "586", "686", "K6", "Athlon", "P3", @@ -538,6 +540,8 @@ def finalize_insns(): nasm_insns[keyword] = newinsn def output_insns(f, parser, insns): + print >>f, "/* Generated by %s r%s, do not edit */" % \ + (scriptname, scriptrev) print >>f, """%%ignore-case %%language=ANSI-C %%compare-strncmp @@ -573,6 +577,8 @@ def output_groups(f): all_operands.extend(form.operands) # Output operands list + print >>f, "/* Generated by %s r%s, do not edit */" % \ + (scriptname, scriptrev) print >>f, "static const x86_info_operand insn_operands[] = {" print >>f, " ", print >>f, ",\n ".join(str(x) for x in all_operands) From 1b1c9ba0ad674c47292137a8f2519d97a0f0a964 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 30 Sep 2008 02:52:56 +0000 Subject: [PATCH 211/585] Nasm lexer: Don't read past end of passed string. This was because the re2c-generated code always reads the next character prior to user code being executed. Instead, check for the \0 marker prior to entering the re2c code. Retain the re2c check just for sanity. Reported by: Samuel Thibault (on yasm-devel@) svn path=/trunk/yasm/; revision=2122 --- modules/parsers/nasm/nasm-token.re | 85 +++++++++++++----------------- 1 file changed, 38 insertions(+), 47 deletions(-) diff --git a/modules/parsers/nasm/nasm-token.re b/modules/parsers/nasm/nasm-token.re index 931dbdc4..cc589b18 100644 --- a/modules/parsers/nasm/nasm-token.re +++ b/modules/parsers/nasm/nasm-token.re @@ -139,6 +139,8 @@ nasm_parser_lex(YYSTYPE *lvalp, yasm_parser_nasm *parser_nasm) scan: SCANINIT(); + if (*cursor == '\0') + goto endofinput; /*!re2c /* standard decimal integer */ @@ -387,10 +389,7 @@ scan: ws+ { goto scan; } - [\000] { - parser_nasm->state = INITIAL; - RETURN(s->tok[0]); - } + [\000] { goto endofinput; } any { yasm_warn_set(YASM_WARN_UNREC_CHAR, @@ -403,6 +402,8 @@ scan: /* %line linenum+lineinc filename */ linechg: SCANINIT(); + if (*cursor == '\0') + goto endofinput; /*!re2c digit+ { @@ -414,10 +415,7 @@ linechg: RETURN(INTNUM); } - [\000] { - parser_nasm->state = INITIAL; - RETURN(s->tok[0]); - } + [\000] { goto endofinput; } "+" { RETURN(s->tok[0]); @@ -441,14 +439,13 @@ linechg: linechg2: SCANINIT(); + if (*cursor == '\0') + goto endofinput; /*!re2c - [\000] { - parser_nasm->state = INITIAL; - RETURN(s->tok[0]); - } + [\000] { goto endofinput; } - "\r" { } + "\r" { goto linechg2; } (any \ [\000])+ { parser_nasm->state = LINECHG; @@ -460,12 +457,11 @@ linechg2: /* directive: [name value] */ directive: SCANINIT(); + if (*cursor == '\0') + goto endofinput; /*!re2c - [\]\000] { - parser_nasm->state = INITIAL; - RETURN(s->tok[0]); - } + [\]\000] { goto endofinput; } [a-zA-Z_][a-zA-Z_0-9]* { lvalp->str_val = yasm__xstrndup(TOK, TOKLEN); @@ -488,6 +484,8 @@ directive: /* section directive (the section name portion thereof) */ section_directive: SCANINIT(); + if (*cursor == '\0') + goto endofinput; /*!re2c [a-zA-Z0-9_$#@~.?-]+ { @@ -508,15 +506,7 @@ section_directive: goto section_directive; } - "]" { - parser_nasm->state = INITIAL; - RETURN(s->tok[0]); - } - - [\000] { - parser_nasm->state = INITIAL; - RETURN(s->tok[0]); - } + [\]\000] { goto endofinput; } any { yasm_warn_set(YASM_WARN_UNREC_CHAR, @@ -529,6 +519,8 @@ section_directive: /* inner part of directive */ directive2: SCANINIT(); + if (*cursor == '\0') + goto endofinput; /*!re2c /* standard decimal integer */ @@ -589,10 +581,7 @@ directive2: [-+|^*&/%~$():=,\[] { RETURN(s->tok[0]); } /* handle ] for directives */ - "]" { - parser_nasm->state = INITIAL; - RETURN(s->tok[0]); - } + "]" { goto endofinput; } /* forced identifier; within directive, don't strip '$', this is * handled later. @@ -625,10 +614,7 @@ directive2: ws+ { goto directive2; } - [\000] { - parser_nasm->state = INITIAL; - RETURN(s->tok[0]); - } + [\000] { goto endofinput; } any { yasm_warn_set(YASM_WARN_UNREC_CHAR, @@ -646,23 +632,15 @@ stringconst: stringconst_scan: SCANINIT(); + if (*cursor == '\0') + goto stringconst_error; /*!re2c - [\000] { - yasm_error_set(YASM_ERROR_SYNTAX, N_("unterminated string")); - strbuf[count] = '\0'; - lvalp->str.contents = (char *)strbuf; - lvalp->str.len = count; - RETURN(STRING); - } + [\000] { goto stringconst_error; } any { - if (s->tok[0] == endch) { - strbuf[count] = '\0'; - lvalp->str.contents = (char *)strbuf; - lvalp->str.len = count; - RETURN(STRING); - } + if (s->tok[0] == endch) + goto stringconst_end; strbuf[count++] = s->tok[0]; if (count >= strbuf_size) { @@ -673,4 +651,17 @@ stringconst_scan: goto stringconst_scan; } */ + +stringconst_error: + yasm_error_set(YASM_ERROR_SYNTAX, N_("unterminated string")); + +stringconst_end: + strbuf[count] = '\0'; + lvalp->str.contents = (char *)strbuf; + lvalp->str.len = count; + RETURN(STRING); + +endofinput: + parser_nasm->state = INITIAL; + RETURN(s->tok[0]); } From 457170f54ef06c79df5d64a60ba267b03ecd9b48 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 30 Sep 2008 03:56:37 +0000 Subject: [PATCH 212/585] Fix expr simplification bug. If an expression of the form INT+(a+b)+INT was simplified, constant folding would combine the ints, but then the level stage (to make INT+a+b) would start reading from the second (deleted due to folding) INT rather than the new end of the expression. Reported by: Samuel Thibault (on yasm-devel@) svn path=/trunk/yasm/; revision=2123 --- libyasm/expr.c | 2 +- libyasm/tests/Makefile.inc | 2 ++ libyasm/tests/expr-fold-level.asm | 4 ++++ libyasm/tests/expr-fold-level.hex | 4 ++++ 4 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 libyasm/tests/expr-fold-level.asm create mode 100644 libyasm/tests/expr-fold-level.hex diff --git a/libyasm/expr.c b/libyasm/expr.c index 14a52264..20e52473 100644 --- a/libyasm/expr.c +++ b/libyasm/expr.c @@ -741,7 +741,7 @@ expr_level_op(/*@returned@*/ /*@only@*/ yasm_expr *e, int fold_const, * ordering as was present originally. * Combine integer terms as necessary. */ - for (i=e->numterms-1, o=level_numterms-1; i>=0; i--) { + for (i=fold_numterms-1, o=level_numterms-1; i>=0; i--) { if (e->terms[i].type == YASM_EXPR_EXPR && e->terms[i].data.expn->op == e->op) { /* bring up subexpression */ diff --git a/libyasm/tests/Makefile.inc b/libyasm/tests/Makefile.inc index ad65464a..23f422bf 100644 --- a/libyasm/tests/Makefile.inc +++ b/libyasm/tests/Makefile.inc @@ -23,6 +23,8 @@ EXTRA_DIST += libyasm/tests/emptydata.asm EXTRA_DIST += libyasm/tests/emptydata.hex EXTRA_DIST += libyasm/tests/equ-expand.asm EXTRA_DIST += libyasm/tests/equ-expand.hex +EXTRA_DIST += libyasm/tests/expr-fold-level.asm +EXTRA_DIST += libyasm/tests/expr-fold-level.hex EXTRA_DIST += libyasm/tests/expr-wide-ident.asm EXTRA_DIST += libyasm/tests/expr-wide-ident.hex EXTRA_DIST += libyasm/tests/externdef.asm diff --git a/libyasm/tests/expr-fold-level.asm b/libyasm/tests/expr-fold-level.asm new file mode 100644 index 00000000..814a62c5 --- /dev/null +++ b/libyasm/tests/expr-fold-level.asm @@ -0,0 +1,4 @@ +begin +A equ 09000h +a dd (A+(end-begin)+3) +end diff --git a/libyasm/tests/expr-fold-level.hex b/libyasm/tests/expr-fold-level.hex new file mode 100644 index 00000000..aba10f6d --- /dev/null +++ b/libyasm/tests/expr-fold-level.hex @@ -0,0 +1,4 @@ +07 +90 +00 +00 From 5abca04eff65f57a544915496b2bab6e96bedef6 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 2 Oct 2008 02:15:56 +0000 Subject: [PATCH 213/585] gen_x86_insn.py: Warn if any groups are unused (due to a typo, for example). svn path=/trunk/yasm/; revision=2124 --- modules/arch/x86/gen_x86_insn.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index d9ddb7c4..7af53a8b 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -494,9 +494,11 @@ def add_prefix(name, groupname, value, parser=None, **kwargs): nasm_insns[name] = prefix def finalize_insns(): + unused_groups = set(groups.keys()) for name, opts in insns.iteritems(): for insn in opts: group = groups[insn.groupname] + unused_groups.discard(insn.groupname) parsers = set() for form in group: @@ -539,6 +541,11 @@ def finalize_insns(): newinsn.auto_misc_flags("nasm") nasm_insns[keyword] = newinsn + unused_groups.discard("empty") + unused_groups.discard("not64") + if unused_groups: + print "warning: unused groups: %s" % ", ".join(unused_groups) + def output_insns(f, parser, insns): print >>f, "/* Generated by %s r%s, do not edit */" % \ (scriptname, scriptrev) From 0b002cd6a36f8cfc3db4553454f34c15501dca07 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 2 Oct 2008 07:26:22 +0000 Subject: [PATCH 214/585] VPBLENDVB doesn't have a 256-bit form. Reported by: Mark Charney svn path=/trunk/yasm/; revision=2125 --- modules/arch/x86/gen_x86_insn.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index 7af53a8b..fa4069b3 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -5523,7 +5523,20 @@ add_group("avx_sse4xmm0", add_insn("vblendvpd", "avx_sse4xmm0", modifiers=[0x4B]) add_insn("vblendvps", "avx_sse4xmm0", modifiers=[0x4A]) -add_insn("vpblendvb", "avx_sse4xmm0", modifiers=[0x4C]) + +# vpblendvb doesn't have a 256-bit form +add_group("avx_sse4xmm0_128", + cpu=["AVX"], + modifiers=["Op2Add"], + vex=128, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="VEXImmSrc")]) + +add_insn("vpblendvb", "avx_sse4xmm0_128", modifiers=[0x4C]) for sfx, sz in zip("bwl", [8, 16, 32]): add_group("crc32", From 4d78c310b52cb039ac366983780ac91c4d728fb3 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 3 Oct 2008 08:13:00 +0000 Subject: [PATCH 215/585] elf64: automatically promote [rel foo wrt ..gotpc] to GOTPCREL relocation. Formerly, [rel foo wrt ..gotpcrel] was required. svn path=/trunk/yasm/; revision=2126 --- modules/objfmts/elf/elf-x86-amd64.c | 4 + modules/objfmts/elf/tests/amd64/Makefile.inc | 2 + modules/objfmts/elf/tests/amd64/gotpcrel.asm | 6 + modules/objfmts/elf/tests/amd64/gotpcrel.hex | 720 +++++++++++++++++++ 4 files changed, 732 insertions(+) create mode 100644 modules/objfmts/elf/tests/amd64/gotpcrel.asm create mode 100644 modules/objfmts/elf/tests/amd64/gotpcrel.hex diff --git a/modules/objfmts/elf/elf-x86-amd64.c b/modules/objfmts/elf/elf-x86-amd64.c index b99f089e..caa20a53 100644 --- a/modules/objfmts/elf/elf-x86-amd64.c +++ b/modules/objfmts/elf/elf-x86-amd64.c @@ -156,6 +156,10 @@ elf_x86_amd64_map_reloc_info_to_type(elf_reloc_entry *reloc, if (esym) esym->type = STT_TLS; } + /* Map PC-relative GOT to appropriate relocation */ + if (reloc->rtype_rel && + elf_x86_amd64_ssyms[i].reloc == R_X86_64_GOT32) + return (unsigned char) R_X86_64_GOTPCREL; return (unsigned char) elf_x86_amd64_ssyms[i].reloc; } } diff --git a/modules/objfmts/elf/tests/amd64/Makefile.inc b/modules/objfmts/elf/tests/amd64/Makefile.inc index d0695926..58b6156f 100644 --- a/modules/objfmts/elf/tests/amd64/Makefile.inc +++ b/modules/objfmts/elf/tests/amd64/Makefile.inc @@ -7,3 +7,5 @@ EXTRA_DIST += modules/objfmts/elf/tests/amd64/elf-rip.asm EXTRA_DIST += modules/objfmts/elf/tests/amd64/elf-rip.hex EXTRA_DIST += modules/objfmts/elf/tests/amd64/elfso64.asm EXTRA_DIST += modules/objfmts/elf/tests/amd64/elfso64.hex +EXTRA_DIST += modules/objfmts/elf/tests/amd64/gotpcrel.asm +EXTRA_DIST += modules/objfmts/elf/tests/amd64/gotpcrel.hex diff --git a/modules/objfmts/elf/tests/amd64/gotpcrel.asm b/modules/objfmts/elf/tests/amd64/gotpcrel.asm new file mode 100644 index 00000000..c3d12383 --- /dev/null +++ b/modules/objfmts/elf/tests/amd64/gotpcrel.asm @@ -0,0 +1,6 @@ +var: +mov rax, [var wrt ..got] +mov rax, [var wrt ..gotpcrel] ; should be error/warning? +mov rax, [rel var wrt ..got] ; automatic promotion to GOTPCREL +mov rax, [rel var wrt ..gotpcrel] + diff --git a/modules/objfmts/elf/tests/amd64/gotpcrel.hex b/modules/objfmts/elf/tests/amd64/gotpcrel.hex new file mode 100644 index 00000000..1ad94244 --- /dev/null +++ b/modules/objfmts/elf/tests/amd64/gotpcrel.hex @@ -0,0 +1,720 @@ +7f +45 +4c +46 +02 +01 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +3e +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +50 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +40 +00 +00 +00 +00 +00 +40 +00 +06 +00 +01 +00 +48 +8b +04 +25 +00 +00 +00 +00 +48 +8b +04 +25 +00 +00 +00 +00 +48 +8b +05 +00 +00 +00 +00 +48 +8b +05 +00 +00 +00 +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +03 +00 +00 +00 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +0c +00 +00 +00 +00 +00 +00 +00 +09 +00 +00 +00 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +13 +00 +00 +00 +00 +00 +00 +00 +09 +00 +00 +00 +02 +00 +00 +00 +fc +ff +ff +ff +ff +ff +ff +ff +1a +00 +00 +00 +00 +00 +00 +00 +09 +00 +00 +00 +02 +00 +00 +00 +fc +ff +ff +ff +ff +ff +ff +ff +00 +2e +74 +65 +78 +74 +00 +2e +72 +65 +6c +61 +2e +74 +65 +78 +74 +00 +2e +73 +74 +72 +74 +61 +62 +00 +2e +73 +79 +6d +74 +61 +62 +00 +2e +73 +68 +73 +74 +72 +74 +61 +62 +00 +00 +2d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +04 +00 +f1 +ff +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +22 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +c0 +00 +00 +00 +00 +00 +00 +00 +2c +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +12 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +ec +00 +00 +00 +00 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +1a +00 +00 +00 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +f0 +00 +00 +00 +00 +00 +00 +00 +60 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +04 +00 +00 +00 +08 +00 +00 +00 +00 +00 +00 +00 +18 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +01 +00 +00 +00 +06 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +40 +00 +00 +00 +00 +00 +00 +00 +1e +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +07 +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +60 +00 +00 +00 +00 +00 +00 +00 +60 +00 +00 +00 +00 +00 +00 +00 +03 +00 +00 +00 +04 +00 +00 +00 +08 +00 +00 +00 +00 +00 +00 +00 +18 +00 +00 +00 +00 +00 +00 +00 From ef29b94867d27c0ec07655ae69d591afc4c08e50 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 5 Oct 2008 08:31:04 +0000 Subject: [PATCH 216/585] Optimize non-strict push with 66 override to byte size if possible in NASM syntax. Previously, the forms of push that did this optimization were disabled in NASM syntax due to conflicting with the size=BITS case. Fix this via reordering to allow these forms to be active in NASM syntax. svn path=/trunk/yasm/; revision=2127 --- modules/arch/x86/gen_x86_insn.py | 36 +++++++++++++-------------- modules/arch/x86/tests/pushnosize.asm | 16 ++++++------ modules/arch/x86/tests/pushnosize.hex | 11 +++----- 3 files changed, 28 insertions(+), 35 deletions(-) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index fa4069b3..4a7c715c 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -1138,25 +1138,6 @@ add_group("push", def_opersize_64=64, opcode=[0x6A], operands=[Operand(type="Imm", size=8, relaxed=True, dest="SImm")]) -add_group("push", - suffix="w", - cpu=["186"], - parsers=["gas"], - opersize=16, - def_opersize_64=64, - opcode1=[0x6A], - opcode2=[0x68], - operands=[Operand(type="Imm", size=16, relaxed=True, dest="Imm", - opt="SImm8")]) -add_group("push", - suffix="l", - not64=True, - parsers=["gas"], - opersize=32, - opcode1=[0x6A], - opcode2=[0x68], - operands=[Operand(type="Imm", size=32, relaxed=True, dest="Imm", - opt="SImm8")]) add_group("push", suffix="q", only64=True, @@ -1174,6 +1155,23 @@ add_group("push", opcode2=[0x68], operands=[Operand(type="Imm", size="BITS", relaxed=True, dest="Imm", opt="SImm8")]) +add_group("push", + suffix="w", + cpu=["186"], + opersize=16, + def_opersize_64=64, + opcode1=[0x6A], + opcode2=[0x68], + operands=[Operand(type="Imm", size=16, relaxed=True, dest="Imm", + opt="SImm8")]) +add_group("push", + suffix="l", + not64=True, + opersize=32, + opcode1=[0x6A], + opcode2=[0x68], + operands=[Operand(type="Imm", size=32, relaxed=True, dest="Imm", + opt="SImm8")]) # Need these when we don't match the BITS size, but they need to be # below the above line so the optimizer can kick in by default. add_group("push", diff --git a/modules/arch/x86/tests/pushnosize.asm b/modules/arch/x86/tests/pushnosize.asm index 3d999774..ada9be17 100644 --- a/modules/arch/x86/tests/pushnosize.asm +++ b/modules/arch/x86/tests/pushnosize.asm @@ -2,7 +2,7 @@ push 0 ; 6A 00 - equivalent to push byte 0 push byte 0 ; 6A 00 push word 0 ; 6A 00 - optimized -push dword 0 ; 66 68 00000000 +push dword 0 ; 66 6A 00 - optimized push strict byte 0 ; 6A 00 push strict word 0 ; 68 0000 push strict dword 0 ; 66 68 00000000 @@ -17,7 +17,7 @@ push strict dword 128 ; 66 68 80000000 [bits 32] push 0 ; 6A 00 - equivalent to push byte 0 push byte 0 ; 6A 00 -push word 0 ; 66 68 0000 +push word 0 ; 66 6A 00 - optimized push dword 0 ; 6A 00 - optimized push strict byte 0 ; 6A 00 push strict word 0 ; 66 68 0000 @@ -32,12 +32,12 @@ push strict dword 128 ; 6A 80000000 [bits 64] push 0 ; same as bits 32 output -push byte 0 -push word 0 -push dword 0 ; optimized to byte -push strict byte 0 -push strict word 0 -push strict dword 0 +push byte 0 ; 6A 00; 64 bits pushed onto stack +push word 0 ; 66 6A 00 - 66h prefix, optimized to byte +push dword 0 ; 6A 00 - optimized to byte; note 64 bits pushed onto stack +push strict byte 0 ; 6A 00; 64 bits pushed onto stack +push strict word 0 ; 66 68 0000 +push strict dword 0 ; 68 00000000; note 64 bits pushed onto stack push 128 push byte 128 ; warning push word 128 diff --git a/modules/arch/x86/tests/pushnosize.hex b/modules/arch/x86/tests/pushnosize.hex index de28febf..08960202 100644 --- a/modules/arch/x86/tests/pushnosize.hex +++ b/modules/arch/x86/tests/pushnosize.hex @@ -5,10 +5,7 @@ 6a 00 66 -68 -00 -00 -00 +6a 00 6a 00 @@ -51,8 +48,7 @@ 6a 00 66 -68 -00 +6a 00 6a 00 @@ -99,8 +95,7 @@ 6a 00 66 -68 -00 +6a 00 6a 00 From 63e1873a8ea01edfd49af750c2c4480c34bca2e1 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 7 Oct 2008 04:34:19 +0000 Subject: [PATCH 217/585] Don't require nasm preproc for some testcases. svn path=/trunk/yasm/; revision=2129 --- .../bin/tests/multisect/multisect1.asm | 8 +++--- modules/objfmts/elf/tests/amd64/elfso64.asm | 26 +++++++++---------- modules/objfmts/elf/tests/elfvisibility.asm | 8 +++--- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/modules/objfmts/bin/tests/multisect/multisect1.asm b/modules/objfmts/bin/tests/multisect/multisect1.asm index 2989b15b..d9699b79 100644 --- a/modules/objfmts/bin/tests/multisect/multisect1.asm +++ b/modules/objfmts/bin/tests/multisect/multisect1.asm @@ -1,8 +1,8 @@ -BITS 32 +[BITS 32] [MAP all] ; This file is loaded as a DOS .COM file. -SEGMENT _TEXT start=0 vstart=100h +[SEGMENT _TEXT start=0 vstart=100h] ; shrink & relocate stack: mov sp, stack_ends ; NASM puts 460h here - @@ -13,7 +13,7 @@ SEGMENT _TEXT start=0 vstart=100h mov ah, 4Ah ; DOS resize mem.block int 21h -SEGMENT GATESEG align=1 follows=_TEXT vstart=0 +[SEGMENT GATESEG align=1 follows=_TEXT vstart=0] ; label to use for copying this segment at run-time. gate0cpy: dd 0 @@ -25,7 +25,7 @@ dd 0 ; vstart=0 makes some calculations easier. ; Reserve space for stack: -SEGMENT .bss follows=GATESEG align=16 +[SEGMENT .bss follows=GATESEG align=16] resb 400h stack_ends: diff --git a/modules/objfmts/elf/tests/amd64/elfso64.asm b/modules/objfmts/elf/tests/amd64/elfso64.asm index 39dbf2ea..931c7ffe 100644 --- a/modules/objfmts/elf/tests/amd64/elfso64.asm +++ b/modules/objfmts/elf/tests/amd64/elfso64.asm @@ -21,18 +21,18 @@ ; [16] Reference a data-section symbol in the data section ; [17] Reference a BSS-section symbol in the data section - BITS 64 - GLOBAL lrotate:function ; [1] - GLOBAL greet:function ; [1] - GLOBAL asmstr:data asmstr.end-asmstr ; [2] - GLOBAL textptr:data 4 ; [2] - GLOBAL selfptr:data 4 ; [2] - GLOBAL integer:data 4 ; [3] - EXTERN printf ; [10] - COMMON commvar 4:4 ; [7] - EXTERN _GLOBAL_OFFSET_TABLE_ + [BITS 64] + [GLOBAL lrotate:function] ; [1] + [GLOBAL greet:function] ; [1] + [GLOBAL asmstr:data asmstr.end-asmstr] ; [2] + [GLOBAL textptr:data 4] ; [2] + [GLOBAL selfptr:data 4] ; [2] + [GLOBAL integer:data 4] ; [3] + [EXTERN printf] ; [10] + [COMMON commvar 4:4] ; [7] + [EXTERN _GLOBAL_OFFSET_TABLE_] - SECTION .text + [SECTION .text] ; prototype: long lrotate(long x, int num); lrotate: ; [1] @@ -66,7 +66,7 @@ greet push rbx ; we'll use RBX for GOT, so save it pop rbx ret - SECTION .data + [SECTION .data] ; a string asmstr db 'hello, world', 0 ; [2] @@ -81,7 +81,7 @@ localptr dd localint ; [5] [17] textptr dd greet wrt ..sym ; [15] selfptr dd selfptr wrt ..sym ; [16] - SECTION .bss + [SECTION .bss] ; an integer integer resd 1 ; [3] diff --git a/modules/objfmts/elf/tests/elfvisibility.asm b/modules/objfmts/elf/tests/elfvisibility.asm index 32d20722..8577b5de 100644 --- a/modules/objfmts/elf/tests/elfvisibility.asm +++ b/modules/objfmts/elf/tests/elfvisibility.asm @@ -1,9 +1,9 @@ [section .text] -global ghidden:hidden -global ginternal:internal -global gprotected:protected -global gtoomany:hidden internal +[global ghidden:hidden] +[global ginternal:internal] +[global gprotected:protected] +[global gtoomany:hidden internal] ghidden: ginternal: From 1e77ce6c40f369c01672c915ed4afd57eb2a6283 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 7 Oct 2008 05:38:11 +0000 Subject: [PATCH 218/585] Add core TASM syntax support. Contributed by: Samuel Thibault It is built on top of the NASM parser and preproc, with the following notable extensions for TASM syntax: - case insensitive symbols and filenames, - support for segment and size of labels, which permits to avoid giving them on each memory dereference, - support for data reservation (i.e. e.g. "var dd ?"), - support for multiples (i.e. e.g. "var dd 1 dup 10"), - little endian string integer constants, - additional expression operators: shl, shr, and, or, low, high, - additional offset keyword, - additional fword and df, - support for doubled quotes within quotes, - support for array-like and structure-like notations: t[eax] and [var].field, - support for tasm directives: macro, rept, irp, locals, proc, struc, segment, assume. Notes: - Almost all extensions are only effective when tasm_compatible_mode is set, so we should have very reduced possible breakage. - Because the "and" keyword can be an expression operator and an instruction name, the data pseudo-instructions explicitly switch the lexer state to INSTRUCTION state to fix the ambiguity. - In gen_x86_insn.py, several instructions (namely lds and lea) now take relaxed memory sizes. The reason is that in the case of tasm, the size of the actual pointed data is passed up to there, and thus any type of data should be accepted. With all of this, loadlin can be compiled by yasm with quite reduced modifications. A new TASM-like frontend is also included. svn path=/trunk/yasm/; revision=2130 --- configure.ac | 2 +- frontends/CMakeLists.txt | 1 + frontends/Makefile.inc | 2 + frontends/tasm/Makefile.inc | 9 + frontends/tasm/tasm-options.c | 140 +++ frontends/tasm/tasm-options.h | 69 ++ frontends/tasm/tasm.c | 1003 +++++++++++++++++ libyasm/bc-align.c | 1 + libyasm/bc-data.c | 168 ++- libyasm/bc-incbin.c | 1 + libyasm/bc-org.c | 1 + libyasm/bc-reserve.c | 9 + libyasm/bytecode.c | 12 + libyasm/bytecode.h | 37 + libyasm/errwarn.c | 3 +- libyasm/errwarn.h | 3 +- libyasm/expr.c | 70 ++ libyasm/expr.h | 10 + libyasm/insn.c | 1 + libyasm/insn.h | 3 + libyasm/intnum.c | 51 +- libyasm/intnum.h | 11 +- libyasm/symrec.c | 71 +- libyasm/symrec.h | 32 + modules/arch/lc3b/lc3bbc.c | 1 + modules/arch/lc3b/lc3bid.re | 1 + modules/arch/x86/gen_x86_insn.py | 8 +- modules/arch/x86/tests/Makefile.inc | 4 +- modules/arch/x86/tests/lds-err.errwarn | 4 - .../arch/x86/tests/{lds-err.asm => lds.asm} | 0 modules/arch/x86/tests/lds.hex | 27 + modules/arch/x86/x86arch.c | 2 + modules/arch/x86/x86arch.h | 3 +- modules/arch/x86/x86bc.c | 6 + modules/arch/x86/x86expr.c | 2 +- modules/arch/x86/x86id.c | 4 + modules/dbgfmts/codeview/cv-symline.c | 4 + modules/dbgfmts/codeview/cv-type.c | 1 + modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c | 1 + modules/dbgfmts/dwarf2/dwarf2-info.c | 1 + modules/dbgfmts/dwarf2/dwarf2-line.c | 2 + modules/dbgfmts/stabs/stabs-dbgfmt.c | 2 + modules/objfmts/bin/Makefile.inc | 2 +- modules/objfmts/bin/bin-objfmt.c | 160 ++- modules/objfmts/coff/coff-objfmt.c | 1 + modules/objfmts/coff/win64-except.c | 2 + modules/objfmts/win64/tests/win64-dataref.hex | 40 +- modules/parsers/Makefile.inc | 1 + modules/parsers/nasm/Makefile.inc | 2 +- modules/parsers/nasm/nasm-parse.c | 326 +++++- modules/parsers/nasm/nasm-parser.c | 35 + modules/parsers/nasm/nasm-parser.h | 5 + modules/parsers/nasm/nasm-token.re | 129 ++- modules/parsers/tasm/Makefile.inc | 5 + modules/parsers/tasm/tests/Makefile.inc | 46 + modules/parsers/tasm/tests/array.asm | 2 + modules/parsers/tasm/tests/array.hex | 6 + modules/parsers/tasm/tests/case.asm | 3 + modules/parsers/tasm/tests/case.hex | 5 + modules/parsers/tasm/tests/charstr.asm | 1 + modules/parsers/tasm/tests/charstr.hex | 6 + modules/parsers/tasm/tests/dup.asm | 1 + modules/parsers/tasm/tests/dup.hex | 10 + modules/parsers/tasm/tests/equal.asm | 1 + modules/parsers/tasm/tests/equal.hex | 0 modules/parsers/tasm/tests/exe/Makefile.inc | 8 + modules/parsers/tasm/tests/exe/exe.asm | 4 + modules/parsers/tasm/tests/exe/exe.hex | 515 +++++++++ .../parsers/tasm/tests/exe/tasm_exe_test.sh | 4 + modules/parsers/tasm/tests/expr.asm | 1 + modules/parsers/tasm/tests/expr.hex | 1 + modules/parsers/tasm/tests/irp.asm | 3 + modules/parsers/tasm/tests/irp.hex | 9 + modules/parsers/tasm/tests/label.asm | 2 + modules/parsers/tasm/tests/label.hex | 3 + modules/parsers/tasm/tests/les.asm | 2 + modules/parsers/tasm/tests/les.hex | 5 + modules/parsers/tasm/tests/lidt.asm | 3 + modules/parsers/tasm/tests/lidt.hex | 11 + modules/parsers/tasm/tests/macro.asm | 6 + modules/parsers/tasm/tests/macro.hex | 6 + modules/parsers/tasm/tests/offset.asm | 3 + modules/parsers/tasm/tests/offset.hex | 7 + modules/parsers/tasm/tests/quote.asm | 2 + modules/parsers/tasm/tests/quote.hex | 6 + modules/parsers/tasm/tests/res.asm | 2 + modules/parsers/tasm/tests/res.errwarn | 2 + modules/parsers/tasm/tests/res.hex | 3 + modules/parsers/tasm/tests/segment.asm | 8 + modules/parsers/tasm/tests/segment.hex | 7 + modules/parsers/tasm/tests/size.asm | 2 + modules/parsers/tasm/tests/size.hex | 6 + modules/parsers/tasm/tests/struc.asm | 8 + modules/parsers/tasm/tests/struc.errwarn | 1 + modules/parsers/tasm/tests/struc.hex | 5 + modules/parsers/tasm/tests/tasm_test.sh | 4 + modules/preprocs/nasm/Makefile.inc | 2 +- modules/preprocs/nasm/nasm-pp.c | 660 ++++++++++- modules/preprocs/nasm/nasm-preproc.c | 24 + modules/preprocs/nasm/nasm.h | 3 + 100 files changed, 3772 insertions(+), 138 deletions(-) create mode 100644 frontends/tasm/Makefile.inc create mode 100644 frontends/tasm/tasm-options.c create mode 100644 frontends/tasm/tasm-options.h create mode 100644 frontends/tasm/tasm.c delete mode 100644 modules/arch/x86/tests/lds-err.errwarn rename modules/arch/x86/tests/{lds-err.asm => lds.asm} (100%) create mode 100644 modules/arch/x86/tests/lds.hex create mode 100644 modules/parsers/tasm/Makefile.inc create mode 100644 modules/parsers/tasm/tests/Makefile.inc create mode 100644 modules/parsers/tasm/tests/array.asm create mode 100644 modules/parsers/tasm/tests/array.hex create mode 100644 modules/parsers/tasm/tests/case.asm create mode 100644 modules/parsers/tasm/tests/case.hex create mode 100644 modules/parsers/tasm/tests/charstr.asm create mode 100644 modules/parsers/tasm/tests/charstr.hex create mode 100644 modules/parsers/tasm/tests/dup.asm create mode 100644 modules/parsers/tasm/tests/dup.hex create mode 100644 modules/parsers/tasm/tests/equal.asm create mode 100644 modules/parsers/tasm/tests/equal.hex create mode 100644 modules/parsers/tasm/tests/exe/Makefile.inc create mode 100644 modules/parsers/tasm/tests/exe/exe.asm create mode 100644 modules/parsers/tasm/tests/exe/exe.hex create mode 100755 modules/parsers/tasm/tests/exe/tasm_exe_test.sh create mode 100644 modules/parsers/tasm/tests/expr.asm create mode 100644 modules/parsers/tasm/tests/expr.hex create mode 100644 modules/parsers/tasm/tests/irp.asm create mode 100644 modules/parsers/tasm/tests/irp.hex create mode 100644 modules/parsers/tasm/tests/label.asm create mode 100644 modules/parsers/tasm/tests/label.hex create mode 100644 modules/parsers/tasm/tests/les.asm create mode 100644 modules/parsers/tasm/tests/les.hex create mode 100644 modules/parsers/tasm/tests/lidt.asm create mode 100644 modules/parsers/tasm/tests/lidt.hex create mode 100644 modules/parsers/tasm/tests/macro.asm create mode 100644 modules/parsers/tasm/tests/macro.hex create mode 100644 modules/parsers/tasm/tests/offset.asm create mode 100644 modules/parsers/tasm/tests/offset.hex create mode 100644 modules/parsers/tasm/tests/quote.asm create mode 100644 modules/parsers/tasm/tests/quote.hex create mode 100644 modules/parsers/tasm/tests/res.asm create mode 100644 modules/parsers/tasm/tests/res.errwarn create mode 100644 modules/parsers/tasm/tests/res.hex create mode 100644 modules/parsers/tasm/tests/segment.asm create mode 100644 modules/parsers/tasm/tests/segment.hex create mode 100644 modules/parsers/tasm/tests/size.asm create mode 100644 modules/parsers/tasm/tests/size.hex create mode 100644 modules/parsers/tasm/tests/struc.asm create mode 100644 modules/parsers/tasm/tests/struc.errwarn create mode 100644 modules/parsers/tasm/tests/struc.hex create mode 100755 modules/parsers/tasm/tests/tasm_test.sh diff --git a/configure.ac b/configure.ac index 97510622..40d99510 100644 --- a/configure.ac +++ b/configure.ac @@ -125,7 +125,7 @@ AX_CREATE_STDINT_H([libyasm-stdint.h]) # AC_CHECK_FUNCS([abort toascii vsnprintf]) AC_CHECK_FUNCS([strsep mergesort getcwd]) -AC_CHECK_FUNCS([popen]) +AC_CHECK_FUNCS([popen ftruncate]) # Look for the case-insensitive comparison functions AC_CHECK_FUNCS([strcasecmp strncasecmp stricmp _stricmp strcmpi]) diff --git a/frontends/CMakeLists.txt b/frontends/CMakeLists.txt index b8b55d2d..0d117734 100644 --- a/frontends/CMakeLists.txt +++ b/frontends/CMakeLists.txt @@ -1 +1,2 @@ ADD_SUBDIRECTORY(yasm) +ADD_SUBDIRECTORY(tasm) diff --git a/frontends/Makefile.inc b/frontends/Makefile.inc index 832a2f0b..0e1552fa 100644 --- a/frontends/Makefile.inc +++ b/frontends/Makefile.inc @@ -1,5 +1,7 @@ # $Id$ EXTRA_DIST += frontends/yasm/Makefile.inc +EXTRA_DIST += frontends/tasm/Makefile.inc include frontends/yasm/Makefile.inc +include frontends/tasm/Makefile.inc diff --git a/frontends/tasm/Makefile.inc b/frontends/tasm/Makefile.inc new file mode 100644 index 00000000..69ec826c --- /dev/null +++ b/frontends/tasm/Makefile.inc @@ -0,0 +1,9 @@ +# $Id: Makefile.inc 1463 2006-04-05 05:39:23Z peter $ + +bin_PROGRAMS += tasm + +tasm_SOURCES = frontends/tasm/tasm.c +tasm_SOURCES += frontends/tasm/tasm-options.c +tasm_SOURCES += frontends/tasm/tasm-options.h + +tasm_LDADD = libyasm.a $(INTLLIBS) diff --git a/frontends/tasm/tasm-options.c b/frontends/tasm/tasm-options.c new file mode 100644 index 00000000..945e5c06 --- /dev/null +++ b/frontends/tasm/tasm-options.c @@ -0,0 +1,140 @@ +/* + * Generic Options Support Header File + * + * Copyright (c) 2001 Stanislav Karchebny + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the author nor the names of other contributors + * may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include +#include +/*@unused@*/ RCSID("$Id: tasm-options.c 1197 2005-01-24 06:44:25Z peter $"); + +#include "tasm-options.h" + + +#ifdef __DEBUG__ +#define DEBUG(x) fprintf ## x ; +#else +#define DEBUG(x) +#endif + + +/* Options Parser */ +int +parse_cmdline(int argc, char **argv, opt_option *options, size_t nopts, + void (*print_error) (const char *fmt, ...)) +{ + int errors = 0, warnings = 0; + size_t i; + int got_it; + + DEBUG((stderr, "parse_cmdline: entered\n")); + + fail: + while (--argc) { + argv++; + + if (argv[0][0] == '/' && argv[0][1]) { /* opt */ + got_it = 0; + for (i = 0; i < nopts; i++) { + char lower[3]; + unsigned len; + + lower[0] = tolower(argv[0][1]); + if (!argv[0][2]) { + lower[1] = '\0'; + } else { + lower[1] = tolower(argv[0][2]); + lower[2] = '\0'; + } + + len = strlen(options[i].opt); + if (!strncmp(lower, options[i].opt, len)) { + char *cmd = &argv[0][1]; + char *param; + + param = &argv[0][1+len]; + if (options[i].takes_param) { + if (param[0] == '\0') { + print_error( + _("option `-%c' needs an argument!"), + options[i].opt); + errors++; + goto fail; + } else { + argc--; + argv++; + } + } else + param = NULL; + + if (!options[i].handler(cmd, param, options[i].extra)) + got_it = 1; + break; + } + } + if (!got_it) { + print_error(_("warning: unrecognized option `%s'"), + argv[0]); + warnings++; + } + } else { /* not an option, then it should be a file or something */ + + if (not_an_option_handler(argv[0])) + errors++; + } + } + + DEBUG((stderr, "parse_cmdline: finished\n")); + return errors; +} + +void +help_msg(const char *msg, const char *tail, opt_option *options, size_t nopts) +{ + char optbuf[100], optopt[100]; + size_t i; + + printf("%s", gettext(msg)); + + for (i = 0; i < nopts; i++) { + optbuf[0] = 0; + optopt[0] = 0; + + if (options[i].takes_param) { + if (options[i].opt) + sprintf(optbuf, "/%s <%s>", options[i].opt, + options[i].param_desc ? options[i]. + param_desc : _("param")); + } else { + if (options[i].opt) + sprintf(optbuf, "/%s", options[i].opt); + } + + printf(" %-22s %s\n", optbuf, gettext(options[i].description)); + } + + printf("%s", gettext(tail)); +} diff --git a/frontends/tasm/tasm-options.h b/frontends/tasm/tasm-options.h new file mode 100644 index 00000000..6f2e7419 --- /dev/null +++ b/frontends/tasm/tasm-options.h @@ -0,0 +1,69 @@ +/* $Id: tasm-options.h 1137 2004-09-04 01:24:57Z peter $ + * Generic Options Support Header File + * + * Copyright (c) 2001 Stanislav Karchebny + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef TASM_OPTIONS_H +#define TASM_OPTIONS_H + +/* an option structure + * operate on either -sopt, --lopt, -sopt or --lopt= + */ +typedef struct opt_option_s +{ + /* option */ + const char *opt; + + /* !=0 if option requires parameter, 0 if not */ + int takes_param; + + int (*handler) (char *cmd, /*@null@*/ char *param, int extra); + int extra; /* extra value for handler */ + + /* description to use in help_msg() */ + /*@observer@*/ const char *description; + + /* optional description for the param taken (NULL if not present) */ + /* (short - will be printed after option sopt/lopt) */ + /*@observer@*/ /*@null@*/ const char *param_desc; +} opt_option; + +/* handle everything that is not an option */ +int not_an_option_handler(char *param); + +/* parse command line calling handlers when appropriate + * argc, argv - pass directly from main(argc,argv) + * options - array of options + * nopts - options count + */ +int parse_cmdline(int argc, char **argv, opt_option *options, size_t nopts, + void (*print_error) (const char *fmt, ...)); + +/* display help message msg followed by list of options in options and followed + * by tail + */ +void help_msg(const char *msg, const char *tail, opt_option *options, + size_t nopts); + +#endif diff --git a/frontends/tasm/tasm.c b/frontends/tasm/tasm.c new file mode 100644 index 00000000..695681ff --- /dev/null +++ b/frontends/tasm/tasm.c @@ -0,0 +1,1003 @@ +/* + * Program entry point, command line parsing + * + * Copyright (C) 2001-2008 Peter Johnson + * Copyright (C) 2007-2008 Samuel Thibault + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include +/*@unused@*/ RCSID("$Id: tasm.c 1523 2006-05-06 16:11:56Z peter $"); + +#include +#include +#include +#include +#include + +#ifdef HAVE_LIBGEN_H +#include +#endif + +#include "tasm-options.h" + +#ifdef CMAKE_BUILD +#include "yasm-plugin.h" +#endif + +#include "license.c" + +#define DEFAULT_OBJFMT_MODULE "bin" + +/*@null@*/ /*@only@*/ static char *obj_filename = NULL, *in_filename = NULL; +/*@null@*/ /*@only@*/ static char *list_filename = NULL, *xref_filename = NULL; +/*@null@*/ /*@only@*/ static char *machine_name = NULL; +static int special_options = 0; +static int segment_ordering = 0; +static int cross_reference = 0; +static int floating_point = 0; +static int listing = 0; +static int expanded_listing = 0; +static int case_sensitivity = 0; +static int valid_length = -1; +/*@null@*/ /*@dependent@*/ static yasm_arch *cur_arch = NULL; +/*@null@*/ /*@dependent@*/ static const yasm_arch_module * + cur_arch_module = NULL; +/*@null@*/ /*@dependent@*/ static const yasm_parser_module * + cur_parser_module = NULL; +/*@null@*/ /*@dependent@*/ static yasm_preproc *cur_preproc = NULL; +/*@null@*/ /*@dependent@*/ static const yasm_preproc_module * + cur_preproc_module = NULL; +/*@null@*/ static char *objfmt_keyword = NULL; +/*@null@*/ /*@dependent@*/ static const yasm_objfmt_module * + cur_objfmt_module = NULL; +/*@null@*/ /*@dependent@*/ static const yasm_dbgfmt_module * + cur_dbgfmt_module = NULL; +/*@null@*/ /*@dependent@*/ static yasm_listfmt *cur_listfmt = NULL; +/*@null@*/ /*@dependent@*/ static const yasm_listfmt_module * + cur_listfmt_module = NULL; +static int warning_error = 0; /* warnings being treated as errors */ +static FILE *errfile; +/*@null@*/ /*@only@*/ static char *error_filename = NULL; + +/*@null@*/ /*@dependent@*/ static FILE *open_file(const char *filename, + const char *mode); +static void check_errors(/*@only@*/ yasm_errwarns *errwarns, + /*@only@*/ yasm_object *object, + /*@only@*/ yasm_linemap *linemap); +static void cleanup(/*@null@*/ /*@only@*/ yasm_object *object); + +/* Forward declarations: cmd line parser handlers */ +static int opt_special_handler(char *cmd, /*@null@*/ char *param, int extra); +static int opt_segment_ordering_handler(char *cmd, /*@null@*/ char *param, int extra); +static int opt_cross_reference_handler(char *cmd, /*@null@*/ char *param, int extra); +static int opt_floating_point_handler(char *cmd, /*@null@*/ char *param, int extra); +static int opt_ignore(char *cmd, /*@null@*/ char *param, int extra); +static int opt_listing_handler(char *cmd, /*@null@*/ char *param, int extra); +static int opt_case_handler(char *cmd, /*@null@*/ char *param, int extra); +static int opt_valid_length_handler(char *cmd, /*@null@*/ char *param, int extra); + +static int opt_warning_handler(char *cmd, /*@null@*/ char *param, int extra); +static int opt_preproc_option(char *cmd, /*@null@*/ char *param, int extra); +static int opt_exe_handler(char *cmd, /*@null@*/ char *param, int extra); + +static /*@only@*/ char *replace_extension(const char *orig, /*@null@*/ + const char *ext, const char *def); +static void print_error(const char *fmt, ...); + +static /*@exits@*/ void handle_yasm_int_error(const char *file, + unsigned int line, + const char *message); +static /*@exits@*/ void handle_yasm_fatal(const char *message, va_list va); +static const char *handle_yasm_gettext(const char *msgid); +static void print_yasm_error(const char *filename, unsigned long line, + const char *msg, /*@null@*/ const char *xref_fn, + unsigned long xref_line, + /*@null@*/ const char *xref_msg); +static void print_yasm_warning(const char *filename, unsigned long line, + const char *msg); + +static void apply_preproc_builtins(void); +static void apply_preproc_standard_macros(const yasm_stdmac *stdmacs); +static void apply_preproc_saved_options(void); +static void print_list_keyword_desc(const char *name, const char *keyword); + +/* values for special_options */ +#define SPECIAL_SHOW_HELP 0x01 +#define SPECIAL_SHOW_VERSION 0x02 +#define SPECIAL_SHOW_LICENSE 0x04 + +#define SEGMENT_ORDERING_ALPHABETIC 0x01 +#define SEGMENT_ORDERING_SOURCE 0x02 + +#define FP_EMULATED 0x01 +#define FP_REAL 0x02 + +#define CASE_ALL 0x01 +#define CASE_GLOBALS 0x02 +#define CASE_NONE 0x04 + +#define DEBUG_FULL 0x01 +#define DEBUG_LINES 0x02 +#define DEBUG_NONE 0x04 + +/* command line options */ +static opt_option options[] = +{ + { "version", 0, opt_special_handler, SPECIAL_SHOW_VERSION, + N_("show version text"), NULL }, + { "license", 0, opt_special_handler, SPECIAL_SHOW_LICENSE, + N_("show license text"), NULL }, + { "a", 0, opt_segment_ordering_handler, SEGMENT_ORDERING_ALPHABETIC, + N_("Alphabetic segment ordering"), NULL }, + { "s", 0, opt_segment_ordering_handler, SEGMENT_ORDERING_SOURCE, + N_("Source segment ordering"), NULL }, + + { "c", 0, opt_cross_reference_handler, 0, + N_("Generate cross-reference in listing"), NULL }, + + { "d", 1, opt_preproc_option, 2, + N_("pre-define a macro, optionally to value"), N_("macro[=value]") }, + + { "e", 0, opt_floating_point_handler, FP_EMULATED, + N_("Emulated floating-point instructions (not supported)"), NULL }, + { "r", 0, opt_floating_point_handler, FP_REAL, + N_("Real floating-point instructions"), NULL }, + + { "h", 0, opt_special_handler, SPECIAL_SHOW_HELP, + N_("show help text"), NULL }, + { "?", 0, opt_special_handler, SPECIAL_SHOW_HELP, + N_("show help text"), NULL }, + + { "i", 1, opt_preproc_option, 0, + N_("add include path"), N_("path") }, + + { "j", 1, opt_ignore, 0, + N_("Jam in an assemble directive CMD (eg. /jIDEAL) (not supported)"), NULL }, + + { "k", 1, opt_ignore, 0, + N_("Hash table capacity (ignored)"), N_("# symbols") }, + + { "l", 0, opt_listing_handler, 0, + N_("Generate listing"), N_("l=normal listing, la=expanded listing") }, + + { "ml", 0, opt_case_handler, CASE_ALL, + N_("Case sensitivity on all symbols"), NULL }, + { "mx", 0, opt_case_handler, CASE_GLOBALS, + N_("Case sensitivity on global symbols"), NULL }, + { "mu", 0, opt_case_handler, CASE_NONE, + N_("No case sensitivity on symbols"), NULL }, + { "mv", 0, opt_valid_length_handler, 0, + N_("Set maximum valid length for symbols"), N_("length") }, + + { "m", 1, opt_ignore, 0, + N_("Allow multiple passes to resolve forward reference (ignored)"), N_("number of passes") }, + + { "n", 0, opt_ignore, 0, + N_("Suppress symbol tables in listing"), NULL }, + + { "o", 0, opt_ignore, 0, + N_("Object code"), N_("os: standard, o: standard w/overlays, op: Phar Lap, oi: IBM") }, + + { "p", 0, opt_ignore, 0, + N_("Check for code segment overrides in protected mode"), NULL }, + { "q", 0, opt_ignore, 0, + N_("Suppress OBJ records not needed for linking (ignored)"), NULL }, + { "t", 0, opt_ignore, 0, + N_("Suppress messages if successful assembly"), NULL }, + { "u", 0, opt_ignore, 0, + N_("Set version emulation"), N_("Version") }, + { "w", 1, opt_warning_handler, 0, + N_("Set warning level"), N_("w0=none, w1=w2=warnings on, w-xxx/w+xxx=disable/enable warning xxx") }, + { "x", 0, opt_ignore, 0, + N_("Include false conditionals in listing"), NULL }, + { "zi", 0, opt_ignore, DEBUG_FULL, + N_("Full debug info"), NULL }, + { "zd", 0, opt_ignore, DEBUG_LINES, + N_("Line numbers debug info"), NULL }, + { "zn", 0, opt_ignore, DEBUG_NONE, + N_("No debug info"), NULL }, + { "z", 0, opt_ignore, 0, + N_("Display source line with error message (ignored)"), NULL }, + + { "b", 0, opt_exe_handler, 0, + N_("Build a (very) basic .exe file"), NULL }, +}; + +/* version message */ +/*@observer@*/ static const char *version_msg[] = { + PACKAGE_NAME " " PACKAGE_INTVER "." PACKAGE_BUILD, + "Compiled on " __DATE__ ".", + "Copyright (c) 2001-2008 Peter Johnson and other Yasm developers.", + "Run yasm --license for licensing overview and summary." +}; + +/* help messages */ +/*@observer@*/ static const char *help_head = N_( + "usage: tasm [option]* source [,object] [,listing] [,xref] \n" + "Options:\n"); +/*@observer@*/ static const char *help_tail = N_( + "\n" + "source is asm source to be assembled.\n" + "\n" + "Sample invocation:\n" + " tasm /zi source.asm\n" + "\n" + "Report bugs to bug-yasm@tortall.net\n"); + +/* parsed command line storage until appropriate modules have been loaded */ +typedef STAILQ_HEAD(constcharparam_head, constcharparam) constcharparam_head; + +typedef struct constcharparam { + STAILQ_ENTRY(constcharparam) link; + const char *param; + int id; +} constcharparam; + +static constcharparam_head preproc_options; + +static int +do_assemble(void) +{ + yasm_object *object; + const char *base_filename; + /*@null@*/ FILE *obj = NULL; + yasm_arch_create_error arch_error; + yasm_linemap *linemap; + yasm_errwarns *errwarns = yasm_errwarns_create(); + int i, matched; + + /* Initialize line map */ + linemap = yasm_linemap_create(); + yasm_linemap_set(linemap, in_filename, 1, 1); + + /* determine the object filename if not specified */ + if (!obj_filename) { + if (in_filename == NULL) + /* Default to yasm.out if no obj filename specified */ + obj_filename = yasm__xstrdup("yasm.out"); + else { + /* replace (or add) extension to base filename */ + yasm__splitpath(in_filename, &base_filename); + if (base_filename[0] == '\0') + obj_filename = yasm__xstrdup("yasm.out"); + else + obj_filename = replace_extension(base_filename, + "obj", + "yasm.out"); + } + } + + cur_arch = yasm_arch_create(cur_arch_module, machine_name, + cur_parser_module->keyword, &arch_error); + if (!cur_arch) { + switch (arch_error) { + case YASM_ARCH_CREATE_BAD_MACHINE: + print_error(_("%s: `%s' is not a valid %s for %s `%s'"), + _("FATAL"), machine_name, _("machine"), + _("architecture"), cur_arch_module->keyword); + break; + case YASM_ARCH_CREATE_BAD_PARSER: + print_error(_("%s: `%s' is not a valid %s for %s `%s'"), + _("FATAL"), cur_parser_module->keyword, + _("parser"), _("architecture"), + cur_arch_module->keyword); + break; + default: + print_error(_("%s: unknown architecture error"), _("FATAL")); + } + + return EXIT_FAILURE; + } + + /* Create object */ + object = yasm_object_create(in_filename, obj_filename, cur_arch, + cur_objfmt_module, cur_dbgfmt_module); + if (!object) { + yasm_error_class eclass; + unsigned long xrefline; + /*@only@*/ /*@null@*/ char *estr, *xrefstr; + + yasm_error_fetch(&eclass, &estr, &xrefline, &xrefstr); + print_error("%s: %s", _("FATAL"), estr); + yasm_xfree(estr); + yasm_xfree(xrefstr); + + cleanup(object); + return EXIT_FAILURE; + } + + /* Get a fresh copy of objfmt_module as it may have changed. */ + cur_objfmt_module = ((yasm_objfmt_base *)object->objfmt)->module; + + /* Check to see if the requested preprocessor is in the allowed list + * for the active parser. + */ + matched = 0; + for (i=0; cur_parser_module->preproc_keywords[i]; i++) + if (yasm__strcasecmp(cur_parser_module->preproc_keywords[i], + cur_preproc_module->keyword) == 0) + matched = 1; + if (!matched) { + print_error(_("%s: `%s' is not a valid %s for %s `%s'"), _("FATAL"), + cur_preproc_module->keyword, _("preprocessor"), + _("parser"), cur_parser_module->keyword); + cleanup(object); + return EXIT_FAILURE; + } + + cur_preproc = yasm_preproc_create(cur_preproc_module, in_filename, + object->symtab, linemap, errwarns); + + apply_preproc_builtins(); + apply_preproc_standard_macros(cur_parser_module->stdmacs); + apply_preproc_standard_macros(cur_objfmt_module->stdmacs); + apply_preproc_saved_options(); + + /* Get initial x86 BITS setting from object format */ + if (strcmp(cur_arch_module->keyword, "x86") == 0) { + yasm_arch_set_var(cur_arch, "mode_bits", + cur_objfmt_module->default_x86_mode_bits); + } + + /* Parse! */ + cur_parser_module->do_parse(object, cur_preproc, list_filename != NULL, + linemap, errwarns); + + check_errors(errwarns, object, linemap); + + /* Finalize parse */ + yasm_object_finalize(object, errwarns); + check_errors(errwarns, object, linemap); + + /* Optimize */ + yasm_object_optimize(object, errwarns); + check_errors(errwarns, object, linemap); + + /* generate any debugging information */ + yasm_dbgfmt_generate(object, linemap, errwarns); + check_errors(errwarns, object, linemap); + + /* open the object file for output (if not already opened by dbg objfmt) */ + if (!obj && strcmp(cur_objfmt_module->keyword, "dbg") != 0) { + obj = open_file(obj_filename, "wb"); + if (!obj) { + cleanup(object); + return EXIT_FAILURE; + } + } + + /* Write the object file */ + yasm_objfmt_output(object, obj?obj:stderr, + strcmp(cur_dbgfmt_module->keyword, "null"), errwarns); + + /* Close object file */ + if (obj) + fclose(obj); + + /* If we had an error at this point, we also need to delete the output + * object file (to make sure it's not left newer than the source). + */ + if (yasm_errwarns_num_errors(errwarns, warning_error) > 0) + remove(obj_filename); + check_errors(errwarns, object, linemap); + + /* Open and write the list file */ + if (list_filename) { + FILE *list = open_file(list_filename, "wt"); + if (!list) { + cleanup(object); + return EXIT_FAILURE; + } + /* Initialize the list format */ + cur_listfmt = yasm_listfmt_create(cur_listfmt_module, in_filename, + obj_filename); + yasm_listfmt_output(cur_listfmt, list, linemap, cur_arch); + fclose(list); + } + + yasm_errwarns_output_all(errwarns, linemap, warning_error, + print_yasm_error, print_yasm_warning); + + yasm_linemap_destroy(linemap); + yasm_errwarns_destroy(errwarns); + cleanup(object); + return EXIT_SUCCESS; +} + +/* main function */ +/*@-globstate -unrecog@*/ +int +main(int argc, char *argv[]) +{ + size_t i; + + errfile = stderr; + +#if defined(HAVE_SETLOCALE) && defined(HAVE_LC_MESSAGES) + setlocale(LC_MESSAGES, ""); +#endif +#if defined(LOCALEDIR) + bindtextdomain(PACKAGE, LOCALEDIR); +#endif + textdomain(PACKAGE); + + /* Initialize errwarn handling */ + yasm_internal_error_ = handle_yasm_int_error; + yasm_fatal = handle_yasm_fatal; + yasm_gettext_hook = handle_yasm_gettext; + yasm_errwarn_initialize(); + + /* Initialize BitVector (needed for intnum/floatnum). */ + if (BitVector_Boot() != ErrCode_Ok) { + print_error(_("%s: could not initialize BitVector"), _("FATAL")); + return EXIT_FAILURE; + } + + /* Initialize intnum and floatnum */ + yasm_intnum_initialize(); + yasm_floatnum_initialize(); + +#ifdef CMAKE_BUILD + /* Load standard modules */ + if (!load_plugin("yasmstd")) { + print_error(_("%s: could not load standard modules"), _("FATAL")); + return EXIT_FAILURE; + } +#endif + + /* Initialize parameter storage */ + STAILQ_INIT(&preproc_options); + + if (parse_cmdline(argc, argv, options, NELEMS(options), print_error)) + return EXIT_FAILURE; + + switch (special_options) { + case SPECIAL_SHOW_HELP: + /* Does gettext calls internally */ + help_msg(help_head, help_tail, options, NELEMS(options)); + return EXIT_SUCCESS; + case SPECIAL_SHOW_VERSION: + for (i=0; idefault_machine_keyword); + + /* Check for arch help */ + if (machine_name && strcmp(machine_name, "help") == 0) { + const yasm_arch_machine *m = cur_arch_module->machines; + printf(_("Available %s for %s `%s':\n"), _("machines"), + _("architecture"), cur_arch_module->keyword); + while (m->keyword && m->name) { + print_list_keyword_desc(m->name, m->keyword); + m++; + } + return EXIT_SUCCESS; + } + + cur_parser_module = yasm_load_parser("tasm"); + if (!cur_parser_module) { + print_error(_("%s: could not load %s"), _("FATAL"), + _("parser")); + cleanup(NULL); + return EXIT_FAILURE; + } + + /* If not already specified, default to the parser's default preproc. */ + if (!cur_preproc_module) { + cur_preproc_module = + yasm_load_preproc(cur_parser_module->default_preproc_keyword); + if (!cur_preproc_module) { + print_error(_("%s: could not load default %s"), _("FATAL"), + _("preprocessor")); + cleanup(NULL); + return EXIT_FAILURE; + } + } + + /* Determine input filename and open input file. */ + if (!in_filename) { + print_error(_("No input files specified")); + return EXIT_FAILURE; + } + + /* If list file enabled, make sure we have a list format loaded. */ + if (list_filename) { + /* use nasm as the list format. */ + cur_listfmt_module = yasm_load_listfmt("nasm"); + } + + /* If not already specified, default to null as the debug format. */ + if (!cur_dbgfmt_module) { + cur_dbgfmt_module = yasm_load_dbgfmt("null"); + if (!cur_dbgfmt_module) { + print_error(_("%s: could not load default %s"), _("FATAL"), + _("debug format")); + return EXIT_FAILURE; + } + } + + return do_assemble(); +} +/*@=globstate =unrecog@*/ + +/* Open the object file. Returns 0 on failure. */ +static FILE * +open_file(const char *filename, const char *mode) +{ + FILE *f; + + f = fopen(filename, mode); + if (!f) + print_error(_("could not open file `%s'"), filename); + return f; +} + +static void +check_errors(yasm_errwarns *errwarns, yasm_object *object, + yasm_linemap *linemap) +{ + if (yasm_errwarns_num_errors(errwarns, warning_error) > 0) { + yasm_errwarns_output_all(errwarns, linemap, warning_error, + print_yasm_error, print_yasm_warning); + yasm_linemap_destroy(linemap); + yasm_errwarns_destroy(errwarns); + cleanup(object); + exit(EXIT_FAILURE); + } +} + +/* Define DO_FREE to 1 to enable deallocation of all data structures. + * Useful for detecting memory leaks, but slows down execution unnecessarily + * (as the OS will free everything we miss here). + */ +#define DO_FREE 1 + +/* Cleans up all allocated structures. */ +static void +cleanup(yasm_object *object) +{ + if (DO_FREE) { + if (cur_listfmt) + yasm_listfmt_destroy(cur_listfmt); + if (cur_preproc) + yasm_preproc_destroy(cur_preproc); + if (object) + yasm_object_destroy(object); + + yasm_floatnum_cleanup(); + yasm_intnum_cleanup(); + + yasm_errwarn_cleanup(); + + BitVector_Shutdown(); + } + + if (DO_FREE) { + if (in_filename) + yasm_xfree(in_filename); + if (obj_filename) + yasm_xfree(obj_filename); + if (list_filename) + yasm_xfree(list_filename); + if (xref_filename) + yasm_xfree(xref_filename); + if (machine_name) + yasm_xfree(machine_name); + if (objfmt_keyword) + yasm_xfree(objfmt_keyword); + } + + if (errfile != stderr && errfile != stdout) + fclose(errfile); +#ifdef CMAKE_BUILD + unload_plugins(); +#endif +} + +/* + * Command line options handlers + */ +static char ** const filenames[] = { + &in_filename, &obj_filename, &list_filename, &xref_filename, NULL +}, ** const * cur_filename = &filenames[0]; + +static int filename_handler(char *param) { + if (!*cur_filename) { + print_error(_("error: too many files on command line.")); + return 1; + } + + if (*param) + **cur_filename = yasm__xstrdup(param); + + return 0; +} +int +not_an_option_handler(char *param) { + char *c, *d = param; + + while ((c = strchr(d, ','))) { + *c = '\0'; + if (filename_handler(d)) + return 1; + d = c + 1; + cur_filename++; + } + filename_handler(d); + return 0; +} + +static int +opt_special_handler(/*@unused@*/ char *cmd, /*@unused@*/ char *param, int extra) +{ + if (special_options == 0) + special_options = extra; + return 0; +} + +static int +opt_segment_ordering_handler(/*@unused@*/ char *cmd, /*@unused@*/ char *param, int extra) +{ + segment_ordering = extra; + return 0; +} + +static int +opt_cross_reference_handler(/*@unused@*/ char *cmd, /*@unused@*/ char *param, int extra) +{ + cross_reference = 1; + return 0; +} + +static int +opt_floating_point_handler(/*@unused@*/ char *cmd, /*@unused@*/ char *param, int extra) +{ + floating_point = extra; + return 0; +} + +static int +opt_ignore(/*@unused@*/ char *cmd, /*@unused@*/ char *param, int extra) +{ + return 0; +} + +static int +opt_listing_handler(/*@unused@*/ char *cmd, /*@unused@*/ char *param, int extra) +{ + if (param[0]) { + if (param[0] != 'a') + return 1; + expanded_listing = 1; + } + listing = 1; + return 0; +} + +static int +opt_case_handler(/*@unused@*/ char *cmd, /*@unused@*/ char *param, int extra) +{ + case_sensitivity = extra; + return 0; +} + +static int +opt_valid_length_handler(/*@unused@*/ char *cmd, /*@unused@*/ char *param, int extra) +{ + valid_length = atoi(param); + return 0; +} + +static int +opt_warning_handler(char *cmd, /*@unused@*/ char *param, int extra) +{ + /* is it disabling the warning instead of enabling? */ + void (*action)(yasm_warn_class wclass) = NULL; + + if (cmd[0] == '0') { + /* /w0, disable warnings */ + yasm_warn_disable_all(); + return 0; + } + + if (cmd[0] == '1' || cmd[0] == '2') { + /* /w[12], enable warnings */ + yasm_warn_enable(YASM_WARN_UNREC_CHAR); + yasm_warn_enable(YASM_WARN_ORPHAN_LABEL); + yasm_warn_enable(YASM_WARN_UNINIT_CONTENTS); + return 0; + } + + /* detect no- prefix to disable the warning */ + if (cmd[0] == '-') { + action = yasm_warn_disable; + } else if (cmd[0] == '+') { + action = yasm_warn_enable; + } else return 1; + + /* skip past '+/-' */ + cmd++; + + if (cmd[0] == '\0') + /* just /w- or /w+, so definitely not valid */ + return 1; + else if (strcmp(cmd, "error") == 0) + warning_error = (action == yasm_warn_enable); + else if (strcmp(cmd, "unrecognized-char") == 0) + action(YASM_WARN_UNREC_CHAR); + else if (strcmp(cmd, "orphan-labels") == 0) + action(YASM_WARN_ORPHAN_LABEL); + else if (strcmp(cmd, "uninit-contents") == 0) + action(YASM_WARN_UNINIT_CONTENTS); + else if (strcmp(cmd, "size-override") == 0) + action(YASM_WARN_SIZE_OVERRIDE); + else + return 1; + + return 0; +} + +static int +opt_preproc_option(/*@unused@*/ char *cmd, char *param, int extra) +{ + constcharparam *cp; + cp = yasm_xmalloc(sizeof(constcharparam)); + cp->param = param; + cp->id = extra; + STAILQ_INSERT_TAIL(&preproc_options, cp, link); + return 0; +} + +static int +opt_exe_handler(char *cmd, /*@unused@*/ char *param, int extra) +{ + objfmt_keyword = yasm__xstrdup("dosexe"); + return 0; +} + +static void +apply_preproc_builtins() +{ + char *predef; + + if (!objfmt_keyword) + objfmt_keyword = yasm__xstrdup(DEFAULT_OBJFMT_MODULE); + + /* Define standard YASM assembly-time macro constants */ + predef = yasm_xmalloc(strlen("__YASM_OBJFMT__=") + + strlen(objfmt_keyword) + 1); + strcpy(predef, "__YASM_OBJFMT__="); + strcat(predef, objfmt_keyword); + yasm_preproc_define_builtin(cur_preproc, predef); + yasm_xfree(predef); +} + +static void +apply_preproc_standard_macros(const yasm_stdmac *stdmacs) +{ + int i, matched; + + if (!stdmacs) + return; + + matched = -1; + for (i=0; stdmacs[i].parser; i++) + if (yasm__strcasecmp(stdmacs[i].parser, + cur_parser_module->keyword) == 0 && + yasm__strcasecmp(stdmacs[i].preproc, + cur_preproc_module->keyword) == 0) + matched = i; + if (matched >= 0 && stdmacs[matched].macros) + yasm_preproc_add_standard(cur_preproc, stdmacs[matched].macros); +} + +static void +apply_preproc_saved_options() +{ + constcharparam *cp, *cpnext; + + void (*funcs[3])(yasm_preproc *, const char *); + funcs[0] = cur_preproc_module->add_include_file; + funcs[1] = cur_preproc_module->predefine_macro; + funcs[2] = cur_preproc_module->undefine_macro; + + STAILQ_FOREACH(cp, &preproc_options, link) { + if (0 <= cp->id && cp->id < 3 && funcs[cp->id]) + funcs[cp->id](cur_preproc, cp->param); + } + + cp = STAILQ_FIRST(&preproc_options); + while (cp != NULL) { + cpnext = STAILQ_NEXT(cp, link); + yasm_xfree(cp); + cp = cpnext; + } + STAILQ_INIT(&preproc_options); +} + +/* Replace extension on a filename (or append one if none is present). + * If output filename would be identical to input (same extension out as in), + * returns (copy of) def. + * A NULL ext means the trailing '.' should NOT be included, whereas a "" ext + * means the trailing '.' should be included. + */ +static char * +replace_extension(const char *orig, /*@null@*/ const char *ext, + const char *def) +{ + char *out, *outext; + size_t deflen, outlen; + + /* allocate enough space for full existing name + extension */ + outlen = strlen(orig) + 2; + if (ext) + outlen += strlen(ext) + 1; + deflen = strlen(def) + 1; + if (outlen < deflen) + outlen = deflen; + out = yasm_xmalloc(outlen); + + strcpy(out, orig); + outext = strrchr(out, '.'); + if (outext) { + /* Existing extension: make sure it's not the same as the replacement + * (as we don't want to overwrite the source file). + */ + outext++; /* advance past '.' */ + if (ext && strcmp(outext, ext) == 0) { + outext = NULL; /* indicate default should be used */ + print_error( + _("file name already ends in `.%s': output will be in `%s'"), + ext, def); + } + } else { + /* No extension: make sure the output extension is not empty + * (again, we don't want to overwrite the source file). + */ + if (!ext) + print_error( + _("file name already has no extension: output will be in `%s'"), + def); + else { + outext = strrchr(out, '\0'); /* point to end of the string */ + *outext++ = '.'; /* append '.' */ + } + } + + /* replace extension or use default name */ + if (outext) { + if (!ext) { + /* Back up and replace '.' with string terminator */ + outext--; + *outext = '\0'; + } else + strcpy(outext, ext); + } else + strcpy(out, def); + + return out; +} + +void +print_list_keyword_desc(const char *name, const char *keyword) +{ + printf("%4s%-12s%s\n", "", keyword, name); +} + +static void +print_error(const char *fmt, ...) +{ + va_list va; + fprintf(errfile, "tasm: "); + va_start(va, fmt); + vfprintf(errfile, fmt, va); + va_end(va); + fputc('\n', errfile); +} + +static /*@exits@*/ void +handle_yasm_int_error(const char *file, unsigned int line, const char *message) +{ + fprintf(stderr, _("INTERNAL ERROR at %s, line %u: %s\n"), file, line, + gettext(message)); +#ifdef HAVE_ABORT + abort(); +#else + exit(EXIT_FAILURE); +#endif +} + +static /*@exits@*/ void +handle_yasm_fatal(const char *fmt, va_list va) +{ + fprintf(errfile, "**%s**: ", _("Fatal")); + vfprintf(errfile, gettext(fmt), va); + fputc('\n', errfile); + exit(EXIT_FAILURE); +} + +static const char * +handle_yasm_gettext(const char *msgid) +{ + return gettext(msgid); +} + +static void +print_yasm_error(const char *filename, unsigned long line, const char *msg, + const char *xref_fn, unsigned long xref_line, + const char *xref_msg) +{ + if (line) + fprintf(errfile, "**%s** %s(%lu) %s\n", _("Error"), filename, line, msg); + else + fprintf(errfile, "**%s** %s %s\n", _("Error"), filename, msg); + + if (/* xref_fn && */ xref_msg) { + if (xref_line) + fprintf(errfile, "**%s** %s(%lu) %s\n", _("Error"), filename, xref_line, xref_msg); + else + fprintf(errfile, "**%s** %s %s\n", _("Error"), filename, xref_msg); + } +} + +static void +print_yasm_warning(const char *filename, unsigned long line, const char *msg) +{ + if (line) + fprintf(errfile, "*%s* %s(%lu) %s\n", _("Warning"), filename, line, msg); + else + fprintf(errfile, "*%s* %s %s\n", _("Warning"), filename, msg); +} diff --git a/libyasm/bc-align.c b/libyasm/bc-align.c index e4e6b648..fd7c8f52 100644 --- a/libyasm/bc-align.c +++ b/libyasm/bc-align.c @@ -66,6 +66,7 @@ static const yasm_bytecode_callback bc_align_callback = { bc_align_destroy, bc_align_print, bc_align_finalize, + NULL, bc_align_calc_len, bc_align_expand, bc_align_tobytes, diff --git a/libyasm/bc-data.c b/libyasm/bc-data.c index 8560da31..bdbf7b6b 100644 --- a/libyasm/bc-data.c +++ b/libyasm/bc-data.c @@ -42,7 +42,8 @@ struct yasm_dataval { /*@reldef@*/ STAILQ_ENTRY(yasm_dataval) link; - enum { DV_EMPTY, DV_VALUE, DV_RAW, DV_ULEB128, DV_SLEB128 } type; + enum { DV_EMPTY, DV_VALUE, DV_RAW, DV_ULEB128, DV_SLEB128, DV_RESERVE } + type; union { yasm_value val; @@ -51,16 +52,22 @@ struct yasm_dataval { unsigned long len; } raw; } data; + + /* number of times data is repeated, NULL=1. */ + /*@only@*/ /*@null@*/ yasm_expr *multiple; }; typedef struct bytecode_data { /* converted data (linked list) */ yasm_datavalhead datahead; + + int item_size; } bytecode_data; static void bc_data_destroy(void *contents); static void bc_data_print(const void *contents, FILE *f, int indent_level); static void bc_data_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc); +static int bc_data_item_size(yasm_bytecode *bc); static int bc_data_calc_len(yasm_bytecode *bc, yasm_bc_add_span_func add_span, void *add_span_data); static int bc_data_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, @@ -71,6 +78,7 @@ static const yasm_bytecode_callback bc_data_callback = { bc_data_destroy, bc_data_print, bc_data_finalize, + bc_data_item_size, bc_data_calc_len, yasm_bc_expand_common, bc_data_tobytes, @@ -131,9 +139,26 @@ bc_data_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) default: break; } + if (dv->multiple) { + yasm_value val; + if (yasm_value_finalize_expr(&val, dv->multiple, prev_bc, 0)) + yasm_error_set(YASM_ERROR_TOO_COMPLEX, + N_("multiple expression too complex")); + else if (val.rel) + yasm_error_set(YASM_ERROR_NOT_ABSOLUTE, + N_("multiple expression not absolute")); + dv->multiple = val.abs; + } } } +static int +bc_data_item_size(yasm_bytecode *bc) +{ + bytecode_data *bc_data = (bytecode_data *)bc->contents; + return bc_data->item_size; +} + static int bc_data_calc_len(yasm_bytecode *bc, yasm_bc_add_span_func add_span, void *add_span_data) @@ -141,27 +166,37 @@ bc_data_calc_len(yasm_bytecode *bc, yasm_bc_add_span_func add_span, bytecode_data *bc_data = (bytecode_data *)bc->contents; yasm_dataval *dv; yasm_intnum *intn; + int len; + unsigned long multiple; /* Count up element sizes, rounding up string length. */ STAILQ_FOREACH(dv, &bc_data->datahead, link) { switch (dv->type) { case DV_EMPTY: + len = 0; break; case DV_VALUE: - bc->len += dv->data.val.size/8; + len = dv->data.val.size/8; break; case DV_RAW: - bc->len += dv->data.raw.len; + len = dv->data.raw.len; break; case DV_ULEB128: case DV_SLEB128: intn = yasm_expr_get_intnum(&dv->data.val.abs, 0); if (!intn) yasm_internal_error(N_("non-constant in data_tobytes")); - bc->len += - yasm_intnum_size_leb128(intn, dv->type == DV_SLEB128); + len = yasm_intnum_size_leb128(intn, dv->type == DV_SLEB128); + break; + case DV_RESERVE: + len = dv->data.val.size/8; break; } + + if (!yasm_dv_get_multiple(dv, &multiple)) + len *= multiple; + + bc->len += len; } return 0; @@ -177,29 +212,47 @@ bc_data_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, unsigned char *bufp_orig = *bufp; yasm_intnum *intn; unsigned int val_len; + unsigned long multiple, i; STAILQ_FOREACH(dv, &bc_data->datahead, link) { + if (yasm_dv_get_multiple(dv, &multiple) || multiple == 0) + continue; switch (dv->type) { case DV_EMPTY: break; case DV_VALUE: val_len = dv->data.val.size/8; - if (output_value(&dv->data.val, *bufp, val_len, - (unsigned long)(*bufp-bufp_orig), bc, 1, d)) - return 1; - *bufp += val_len; + for (i=0; idata.val, *bufp, val_len, + (unsigned long)(*bufp-bufp_orig), bc, 1, + d)) + return 1; + *bufp += val_len; + } break; case DV_RAW: - memcpy(*bufp, dv->data.raw.contents, dv->data.raw.len); - *bufp += dv->data.raw.len; + for (i=0; idata.raw.contents, dv->data.raw.len); + *bufp += dv->data.raw.len; + } break; case DV_ULEB128: case DV_SLEB128: intn = yasm_expr_get_intnum(&dv->data.val.abs, 234); if (!intn) yasm_internal_error(N_("non-constant in data_tobytes")); - *bufp += - yasm_intnum_get_leb128(intn, *bufp, dv->type == DV_SLEB128); + for (i=0; itype == DV_SLEB128); + } + case DV_RESERVE: + val_len = dv->data.val.size/8; + for (i=0; idatahead); + data->item_size = size; /* Prescan input data for length, etc. Careful: this needs to be * precisely paired with the second loop. */ STAILQ_FOREACH(dv, datahead, link) { + if (dv->multiple && dv->type != DV_EMPTY && len > 0) { + /* Flush previous data */ + dvo = yasm_dv_create_raw(yasm_xmalloc(len), len); + STAILQ_INSERT_TAIL(&data->datahead, dvo, link); + len = 0; + } switch (dv->type) { case DV_EMPTY: break; @@ -247,6 +307,7 @@ yasm_bc_create_data(yasm_datavalhead *datahead, unsigned int size, /* Create bytecode for this value */ dvo = yasm_xmalloc(sizeof(yasm_dataval)); STAILQ_INSERT_TAIL(&data->datahead, dvo, link); + dvo->multiple = dv->multiple; } break; case DV_RAW: @@ -255,7 +316,19 @@ yasm_bc_create_data(yasm_datavalhead *datahead, unsigned int size, rlen = (rlen + size - 1) / size; len += rlen*size; break; + case DV_RESERVE: + len += size; + break; } + + if (dv->multiple && dv->type != DV_EMPTY && len > 0) { + /* Flush this data */ + dvo = yasm_dv_create_raw(yasm_xmalloc(len), len); + STAILQ_INSERT_TAIL(&data->datahead, dvo, link); + dvo->multiple = dv->multiple; + len = 0; + } + if (append_zero) len++; } @@ -271,6 +344,10 @@ yasm_bc_create_data(yasm_datavalhead *datahead, unsigned int size, dvo = STAILQ_FIRST(&data->datahead); len = 0; while (dv && dvo) { + if (dv->multiple && dv->type != DV_EMPTY && len > 0) { + dvo = STAILQ_NEXT(dvo, link); + len = 0; + } switch (dv->type) { case DV_EMPTY: break; @@ -323,7 +400,17 @@ yasm_bc_create_data(yasm_datavalhead *datahead, unsigned int size, dvo->data.raw.contents[len++] = 0; } break; + case DV_RESERVE: + memset(&dvo->data.raw.contents[len], 0, size); + len += size; + break; } + + if (dv->multiple && dv->type != DV_EMPTY && len > 0) { + dvo = STAILQ_NEXT(dvo, link); + len = 0; + } + if (append_zero) dvo->data.raw.contents[len++] = 0; dv2 = STAILQ_NEXT(dv, link); @@ -364,6 +451,7 @@ yasm_dv_create_expr(yasm_expr *e) retval->type = DV_VALUE; yasm_value_initialize(&retval->data.val, e, 0); + retval->multiple = NULL; return retval; } @@ -376,10 +464,54 @@ yasm_dv_create_raw(unsigned char *contents, unsigned long len) retval->type = DV_RAW; retval->data.raw.contents = contents; retval->data.raw.len = len; + retval->multiple = NULL; return retval; } +yasm_dataval * +yasm_dv_create_reserve(void) +{ + yasm_dataval *retval = yasm_xmalloc(sizeof(yasm_dataval)); + + retval->type = DV_RESERVE; + retval->multiple = NULL; + + return retval; +} + +void +yasm_dv_set_multiple(yasm_dataval *dv, yasm_expr *e) +{ + if (dv->multiple) + dv->multiple = yasm_expr_create_tree( dv->multiple, YASM_EXPR_MUL, e, + e->line); + else + dv->multiple = e; +} + +int +yasm_dv_get_multiple(yasm_dataval *dv, unsigned long *multiple) +{ + /*@dependent@*/ /*@null@*/ const yasm_intnum *num; + + *multiple = 1; + if (dv->multiple) { + num = yasm_expr_get_intnum(&dv->multiple, 0); + if (!num) { + yasm_error_set(YASM_ERROR_VALUE, + N_("could not determine multiple")); + return 1; + } + if (yasm_intnum_sign(num) < 0) { + yasm_error_set(YASM_ERROR_VALUE, N_("multiple is negative")); + return 1; + } + *multiple = yasm_intnum_get_uint(num); + } + return 0; +} + void yasm_dvs_delete(yasm_datavalhead *headp) { @@ -398,6 +530,8 @@ yasm_dvs_delete(yasm_datavalhead *headp) default: break; } + if (cur->multiple) + yasm_expr_destroy(cur->multiple); yasm_xfree(cur); cur = next; } @@ -421,6 +555,11 @@ yasm_dvs_print(const yasm_datavalhead *head, FILE *f, int indent_level) unsigned long i; STAILQ_FOREACH(cur, head, link) { + fprintf(f, "%*sMultiple=", indent_level, ""); + if (!cur->multiple) + fprintf(f, "nil (1)"); + else + yasm_expr_print(cur->multiple, f); switch (cur->type) { case DV_EMPTY: fprintf(f, "%*sEmpty\n", indent_level, ""); @@ -445,6 +584,9 @@ yasm_dvs_print(const yasm_datavalhead *head, FILE *f, int indent_level) fprintf(f, "%*sSLEB128 value:\n", indent_level, ""); yasm_value_print(&cur->data.val, f, indent_level+1); break; + case DV_RESERVE: + fprintf(f, "%*sReserved\n", indent_level, ""); + break; } } } diff --git a/libyasm/bc-incbin.c b/libyasm/bc-incbin.c index 55634468..f2bee743 100644 --- a/libyasm/bc-incbin.c +++ b/libyasm/bc-incbin.c @@ -66,6 +66,7 @@ static const yasm_bytecode_callback bc_incbin_callback = { bc_incbin_destroy, bc_incbin_print, bc_incbin_finalize, + NULL, bc_incbin_calc_len, yasm_bc_expand_common, bc_incbin_tobytes, diff --git a/libyasm/bc-org.c b/libyasm/bc-org.c index ae0497a2..b6f101cc 100644 --- a/libyasm/bc-org.c +++ b/libyasm/bc-org.c @@ -60,6 +60,7 @@ static const yasm_bytecode_callback bc_org_callback = { bc_org_destroy, bc_org_print, bc_org_finalize, + NULL, bc_org_calc_len, bc_org_expand, bc_org_tobytes, diff --git a/libyasm/bc-reserve.c b/libyasm/bc-reserve.c index 32f524f9..5cfd38a0 100644 --- a/libyasm/bc-reserve.c +++ b/libyasm/bc-reserve.c @@ -46,6 +46,7 @@ typedef struct bytecode_reserve { static void bc_reserve_destroy(void *contents); static void bc_reserve_print(const void *contents, FILE *f, int indent_level); static void bc_reserve_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc); +static int bc_reserve_elem_size(yasm_bytecode *bc); static int bc_reserve_calc_len(yasm_bytecode *bc, yasm_bc_add_span_func add_span, void *add_span_data); @@ -57,6 +58,7 @@ static const yasm_bytecode_callback bc_reserve_callback = { bc_reserve_destroy, bc_reserve_print, bc_reserve_finalize, + bc_reserve_elem_size, bc_reserve_calc_len, yasm_bc_expand_common, bc_reserve_tobytes, @@ -95,6 +97,13 @@ bc_reserve_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) reserve->numitems = NULL; } +static int +bc_reserve_elem_size(yasm_bytecode *bc) +{ + bytecode_reserve *reserve = (bytecode_reserve *)bc->contents; + return reserve->itemsize; +} + static int bc_reserve_calc_len(yasm_bytecode *bc, yasm_bc_add_span_func add_span, void *add_span_data) diff --git a/libyasm/bytecode.c b/libyasm/bytecode.c index b8386f79..df3cc9d5 100644 --- a/libyasm/bytecode.c +++ b/libyasm/bytecode.c @@ -222,6 +222,18 @@ yasm_bc_next_offset(yasm_bytecode *precbc) return precbc->offset + precbc->len*precbc->mult_int; } +int +yasm_bc_elem_size(yasm_bytecode *bc) +{ + if (!bc->callback) { + yasm_internal_error(N_("got empty bytecode in yasm_bc_elem_size")); + return 0; + } else if (!bc->callback->elem_size) + return 0; + else + return bc->callback->elem_size(bc); +} + int yasm_bc_calc_len(yasm_bytecode *bc, yasm_bc_add_span_func add_span, void *add_span_data) diff --git a/libyasm/bytecode.h b/libyasm/bytecode.h index bff958f8..d5a98995 100644 --- a/libyasm/bytecode.h +++ b/libyasm/bytecode.h @@ -86,6 +86,14 @@ typedef struct yasm_bytecode_callback { */ void (*finalize) (yasm_bytecode *bc, yasm_bytecode *prev_bc); + /** Return elements size of a data bytecode. + * This function should return the size of each elements of a data + * bytecode, for proper dereference of symbols attached to it. + * \param bc bytecode + * \return 0 if element size is unknown. + */ + int (*elem_size) (yasm_bytecode *bc); + /** Calculates the minimum size of a bytecode. * Called from yasm_bc_calc_len(). * A generic fill-in for this is yasm_bc_calc_len_common(), but as this @@ -438,6 +446,15 @@ YASM_LIB_DECL YASM_LIB_DECL unsigned long yasm_bc_next_offset(yasm_bytecode *precbc); +/** Return elemens size of a data bytecode. + * Returns the size of each elements of a data bytecode, for proper dereference + * of symbols attached to it. + * \param bc bytecode + * \return 0 if element size is unknown + */ +YASM_LIB_DECL +int yasm_bc_elem_size(yasm_bytecode *bc); + /** Resolve EQUs in a bytecode and calculate its minimum size. * Generates dependent bytecode spans for cases where, if the length spanned * increases, it could cause the bytecode size to increase. @@ -548,11 +565,31 @@ YASM_LIB_DECL yasm_dataval *yasm_dv_create_raw(/*@keep@*/ unsigned char *contents, unsigned long len); +/** Create a new uninitialized data value. + * \return Newly allocated data value. + */ +yasm_dataval *yasm_dv_create_reserve(void); + #ifndef YASM_DOXYGEN #define yasm_dv_create_string(s, l) yasm_dv_create_raw((unsigned char *)(s), \ (unsigned long)(l)) #endif +/** Set multiple field of a data value. + * A data value can be repeated a number of times when output. This function + * sets that multiple. + * \param dv data value + * \param e multiple (kept, do not free) + */ +void yasm_dv_set_multiple(yasm_dataval *dv, /*@keep@*/ yasm_expr *e); + +/** Get the data value multiple value as an unsigned long integer. + * \param dv data value + * \param multiple multiple value (output) + * \return 1 on error (set with yasm_error_set), 0 on success. + */ +int yasm_dv_get_multiple(yasm_dataval *dv, /*@out@*/ unsigned long *multiple); + /** Initialize a list of data values. * \param headp list of data values */ diff --git a/libyasm/errwarn.c b/libyasm/errwarn.c index 26d7f072..644d7d27 100644 --- a/libyasm/errwarn.c +++ b/libyasm/errwarn.c @@ -115,7 +115,8 @@ yasm_errwarn_initialize(void) warn_class_enabled = (1UL<op == YASM_EXPR_IDENT) { + if (e->terms[0].type == YASM_EXPR_SYM) + return yasm_symrec_get_size(e->terms[0].data.sym); + return 0; + } + if (e->op != YASM_EXPR_ADD && e->op != YASM_EXPR_SUB) + return 0; + + for (i=0; inumterms; i++) { + newsize = 0; + switch (e->terms[i].type) { + case YASM_EXPR_EXPR: + newsize = yasm_expr_size(e->terms[i].data.expn); + break; + case YASM_EXPR_SYM: + newsize = yasm_symrec_get_size(e->terms[i].data.sym); + break; + default: + break; + } + if (newsize) { + size = newsize; + if (seen) + /* either sum of idents (?!) or substract of idents */ + return 0; + seen = 1; + } + } + /* exactly one offset */ + return size; +} + +const char * +yasm_expr_segment(const yasm_expr *e) +{ + int i; + int seen = 0; + const char *segment = NULL; + + if (e->op == YASM_EXPR_IDENT) { + if (e->terms[0].type == YASM_EXPR_SYM) + return yasm_symrec_get_segment(e->terms[0].data.sym); + return NULL; + } + if (e->op != YASM_EXPR_ADD && e->op != YASM_EXPR_SUB) + return NULL; + + for (i=0; inumterms; i++) { + if ((e->op == YASM_EXPR_ADD || !i) && + e->terms[i].type == YASM_EXPR_EXPR) { + if ((segment = yasm_expr_segment(e->terms[i].data.expn))) { + if (seen) { + /* either sum of idents (?!) or substract of idents */ + return NULL; + } + seen = 1; + } + } + } + /* exactly one offset */ + return segment; +} diff --git a/libyasm/expr.h b/libyasm/expr.h index 96d1796c..ee43fca6 100644 --- a/libyasm/expr.h +++ b/libyasm/expr.h @@ -297,6 +297,16 @@ YASM_LIB_DECL YASM_LIB_DECL void yasm_expr_print(/*@null@*/ const yasm_expr *e, FILE *f); +/** Return the size of an expression, if the user provided it + * \param e expression + */ +unsigned int yasm_expr_size(const yasm_expr *e); + +/** Return the segment of an expression, if the user provided it + * \param e expression + */ +const char *yasm_expr_segment(const yasm_expr *e); + /** Traverse over expression tree in order (const version). * Calls func for each leaf (non-operation). * \param e expression diff --git a/libyasm/insn.c b/libyasm/insn.c index 46a78dbe..c4c26867 100644 --- a/libyasm/insn.c +++ b/libyasm/insn.c @@ -96,6 +96,7 @@ yasm_operand_create_mem(/*@only@*/ yasm_effaddr *ea) retval->size = 0; retval->deref = 0; retval->strict = 0; + retval->size = ea->data_len * 8; return retval; } diff --git a/libyasm/insn.h b/libyasm/insn.h index 9fdf0ebb..99bcb841 100644 --- a/libyasm/insn.h +++ b/libyasm/insn.h @@ -74,6 +74,9 @@ struct yasm_effaddr { /** 1 if effective address is forced non-PC-relative. */ unsigned int not_pc_rel:1; + + /** length of pointed data (in bytes), 0 if unknown. */ + unsigned int data_len; }; /** An instruction operand (opaque type). */ diff --git a/libyasm/intnum.c b/libyasm/intnum.c index 47173c7e..dab359ab 100644 --- a/libyasm/intnum.c +++ b/libyasm/intnum.c @@ -244,11 +244,58 @@ yasm_intnum_create_charconst_nasm(const char *str) case 0: break; default: - /* >32 bit conversion */ + /* >=32 bit conversion */ while (len) { BitVector_Move_Left(conv_bv, 8); BitVector_Chunk_Store(conv_bv, 8, 0, - (unsigned long)str[--len]); + ((unsigned long)str[--len]) & 0xff); + } + intn->val.bv = BitVector_Clone(conv_bv); + } + + return intn; +} + +yasm_intnum * +yasm_intnum_create_charconst_tasm(const char *str) +{ + yasm_intnum *intn = yasm_xmalloc(sizeof(yasm_intnum)); + size_t len = strlen(str); + + if(len*8 > BITVECT_NATIVE_SIZE) + yasm_error_set(YASM_ERROR_OVERFLOW, + N_("Character constant too large for internal format")); + + /* be conservative in choosing bitvect in case MSB is set */ + if (len > 3) { + BitVector_Empty(conv_bv); + intn->type = INTNUM_BV; + } else { + intn->val.l = 0; + intn->type = INTNUM_L; + } + + /* tasm uses big endian notation */ + int i = 0; + switch (len) { + case 3: + intn->val.l |= ((unsigned long)str[i++]) & 0xff; + intn->val.l <<= 8; + /*@fallthrough@*/ + case 2: + intn->val.l |= ((unsigned long)str[i++]) & 0xff; + intn->val.l <<= 8; + /*@fallthrough@*/ + case 1: + intn->val.l |= ((unsigned long)str[i++]) & 0xff; + case 0: + break; + default: + /* >=32 bit conversion */ + while (i < len) { + BitVector_Chunk_Store(conv_bv, 8, (len-i-1)*8, + ((unsigned long)str[i]) & 0xff); + i++; } intn->val.bv = BitVector_Clone(conv_bv); } diff --git a/libyasm/intnum.h b/libyasm/intnum.h index 8e1529fc..132e8b00 100644 --- a/libyasm/intnum.h +++ b/libyasm/intnum.h @@ -76,13 +76,22 @@ YASM_LIB_DECL /** Convert character constant to integer value, using NASM rules. NASM syntax * supports automatic conversion from strings such as 'abcd' to a 32-bit - * integer value. This function performs those conversions. + * integer value (little endian order). This function performs those conversions. * \param str character constant string * \return Newly allocated intnum. */ YASM_LIB_DECL /*@only@*/ yasm_intnum *yasm_intnum_create_charconst_nasm(const char *str); +/** Convert character constant to integer value, using TASM rules. TASM syntax + * supports automatic conversion from strings such as 'abcd' to a 32-bit + * integer value (big endian order). This function performs those conversions. + * \param str character constant string + * \return Newly allocated intnum. + */ +YASM_LIB_DECL +/*@only@*/ yasm_intnum *yasm_intnum_create_charconst_tasm(const char *str); + /** Create a new intnum from an unsigned integer value. * \param i unsigned integer value * \return Newly allocated intnum. diff --git a/libyasm/symrec.c b/libyasm/symrec.c index 4ea0ca7e..6ebfc1c6 100644 --- a/libyasm/symrec.c +++ b/libyasm/symrec.c @@ -28,6 +28,7 @@ /*@unused@*/ RCSID("$Id$"); #include +#include #include "libyasm-stdint.h" #include "coretype.h" @@ -71,6 +72,8 @@ struct yasm_symrec { /* bytecode immediately preceding a label */ /*@dependent@*/ yasm_bytecode *precbc; } value; + unsigned int size; /* 0 if not user-defined */ + const char *segment; /* for segmented systems like DOS */ /* associated data; NULL if none */ /*@null@*/ /*@only@*/ yasm__assoc_data *assoc_data; @@ -87,6 +90,8 @@ struct yasm_symtab { /*@only@*/ HAMT *sym_table; /* Symbols not in the table */ SLIST_HEAD(nontablesymhead_s, non_table_symrec_s) non_table_syms; + + int case_sensitive; }; static void @@ -132,9 +137,16 @@ yasm_symtab_create(void) yasm_symtab *symtab = yasm_xmalloc(sizeof(yasm_symtab)); symtab->sym_table = HAMT_create(0, yasm_internal_error_); SLIST_INIT(&symtab->non_table_syms); + symtab->case_sensitive = 1; return symtab; } +void +yasm_symtab_set_case_sensitive(yasm_symtab *symtab, int sensitive) +{ + symtab->case_sensitive = sensitive; +} + static void symrec_destroy_one(/*@only@*/ void *d) { @@ -147,15 +159,24 @@ symrec_destroy_one(/*@only@*/ void *d) } static /*@partial@*/ yasm_symrec * -symrec_new_common(/*@keep@*/ char *name) +symrec_new_common(/*@keep@*/ char *name, int case_sensitive) { yasm_symrec *rec = yasm_xmalloc(sizeof(yasm_symrec)); + + if (!case_sensitive) { + char *c; + for (c=name; *c; c++) + *c = tolower(*c); + } + rec->name = name; rec->type = SYM_UNKNOWN; rec->def_line = 0; rec->decl_line = 0; rec->use_line = 0; rec->visibility = YASM_SYM_LOCAL; + rec->size = 0; + rec->segment = NULL; rec->assoc_data = NULL; return rec; } @@ -163,11 +184,17 @@ symrec_new_common(/*@keep@*/ char *name) static /*@partial@*/ /*@dependent@*/ yasm_symrec * symtab_get_or_new_in_table(yasm_symtab *symtab, /*@only@*/ char *name) { - yasm_symrec *rec = symrec_new_common(name); + yasm_symrec *rec = symrec_new_common(name, symtab->case_sensitive); int replace = 0; rec->status = YASM_SYM_NOSTATUS; + if (!symtab->case_sensitive) { + char *c; + for (c=name; *c; c++) + *c = tolower(*c); + } + return HAMT_insert(symtab->sym_table, name, rec, &replace, symrec_destroy_one); } @@ -176,7 +203,7 @@ static /*@partial@*/ /*@dependent@*/ yasm_symrec * symtab_get_or_new_not_in_table(yasm_symtab *symtab, /*@only@*/ char *name) { non_table_symrec *sym = yasm_xmalloc(sizeof(non_table_symrec)); - sym->rec = symrec_new_common(name); + sym->rec = symrec_new_common(name, symtab->case_sensitive); sym->rec->status = YASM_SYM_NOTINTABLE; @@ -251,7 +278,17 @@ yasm_symtab_use(yasm_symtab *symtab, const char *name, unsigned long line) yasm_symrec * yasm_symtab_get(yasm_symtab *symtab, const char *name) { - return HAMT_search(symtab->sym_table, name); + if (!symtab->case_sensitive) { + char *_name = yasm__xstrdup(name); + char *c; + yasm_symrec *ret; + for (c=_name; *c; c++) + *c = tolower(*c); + ret = HAMT_search(symtab->sym_table, _name); + yasm_xfree(_name); + return ret; + } else + return HAMT_search(symtab->sym_table, name); } static /*@dependent@*/ yasm_symrec * @@ -273,6 +310,8 @@ symtab_define(yasm_symtab *symtab, const char *name, sym_type type, rec->def_line = line; /* set line number of definition */ rec->type = type; rec->status |= YASM_SYM_DEFINED; + rec->size = 0; + rec->segment = NULL; } return rec; } @@ -519,6 +558,30 @@ yasm_symrec_get_label(const yasm_symrec *sym, return 1; } +void +yasm_symrec_set_size(yasm_symrec *sym, int size) +{ + sym->size = size; +} + +int +yasm_symrec_get_size(const yasm_symrec *sym) +{ + return sym->size; +} + +void +yasm_symrec_set_segment(yasm_symrec *sym, const char *segment) +{ + sym->segment = segment; +} + +const char * +yasm_symrec_get_segment(const yasm_symrec *sym) +{ + return sym->segment; +} + int yasm_symrec_is_abs(const yasm_symrec *sym) { diff --git a/libyasm/symrec.h b/libyasm/symrec.h index 94dca89d..0eac87bf 100644 --- a/libyasm/symrec.h +++ b/libyasm/symrec.h @@ -73,6 +73,14 @@ yasm_symtab *yasm_symtab_create(void); YASM_LIB_DECL void yasm_symtab_destroy(/*@only@*/ yasm_symtab *symtab); +/** Set the symbol table to be case sensitive or not. + * Should be called before adding any symbol. + * \param symtab symbol table + * \param sensitive whether the symbol table should be case sensitive. + */ +YASM_LIB_DECL +void yasm_symtab_set_case_sensitive(yasm_symtab *symtab, int sensitive); + /** Get a reference to the symbol table's "absolute" symbol. This is * essentially an EQU with no name and value 0, and is used for relocating * absolute current-position-relative values. @@ -318,6 +326,30 @@ YASM_LIB_DECL int yasm_symrec_get_label(const yasm_symrec *sym, /*@out@*/ yasm_symrec_get_label_bytecodep *precbc); +/** Set the size of a symbol. + * \param sym symbol + * \param size size to be set + */ +void yasm_symrec_set_size(yasm_symrec *sym, int size); + +/** Get the size of a symbol. + * \param sym symbol + * \return size of the symbol, 0 if none specified by the user. + */ +int yasm_symrec_get_size(const yasm_symrec *sym); + +/** Set the segment of a symbol. + * \param sym symbol + * \param segment segment to be set + */ +void yasm_symrec_set_segment(yasm_symrec *sym, const char *segment); + +/** Get the segment of a symbol. + * \param sym symbol + * \return segment of the symbol, NULL if none specified by the user. + */ +const char *yasm_symrec_get_segment(const yasm_symrec *sym); + /** Determine if symbol is the "absolute" symbol created by * yasm_symtab_abs_sym(). * \param sym symbol diff --git a/modules/arch/lc3b/lc3bbc.c b/modules/arch/lc3b/lc3bbc.c index 35965248..a5d0192b 100644 --- a/modules/arch/lc3b/lc3bbc.c +++ b/modules/arch/lc3b/lc3bbc.c @@ -53,6 +53,7 @@ static const yasm_bytecode_callback lc3b_bc_callback_insn = { lc3b_bc_insn_destroy, lc3b_bc_insn_print, yasm_bc_finalize_common, + NULL, lc3b_bc_insn_calc_len, lc3b_bc_insn_expand, lc3b_bc_insn_tobytes, diff --git a/modules/arch/lc3b/lc3bid.re b/modules/arch/lc3b/lc3bid.re index bfbf78b2..de8a2bdf 100644 --- a/modules/arch/lc3b/lc3bid.re +++ b/modules/arch/lc3b/lc3bid.re @@ -128,6 +128,7 @@ static const yasm_bytecode_callback lc3b_id_insn_callback = { lc3b_id_insn_destroy, lc3b_id_insn_print, lc3b_id_insn_finalize, + NULL, yasm_bc_calc_len_common, yasm_bc_expand_common, yasm_bc_tobytes_common, diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index 4a7c715c..6397d9c9 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -671,7 +671,7 @@ add_group("twobytemem", modifiers=["SpAdd", "Op0Add", "Op1Add"], opcode=[0x00, 0x00], spare=0, - operands=[Operand(type="Mem", dest="EA")]) + operands=[Operand(type="Mem", relaxed=True, dest="EA")]) # # mov @@ -1666,7 +1666,7 @@ for sfx, sz in zip("wlq", [16, 32, 64]): opersize=sz, opcode=[0x8D], operands=[Operand(type="Reg", size=sz, dest="Spare"), - Operand(type="Mem", size=sz, relaxed=True, dest="EA")]) + Operand(type="Mem", relaxed=True, dest="EA")]) add_insn("lea", "lea") @@ -1681,7 +1681,7 @@ for sfx, sz in zip("wl", [16, 32]): opersize=sz, opcode=[0x00], operands=[Operand(type="Reg", size=sz, dest="Spare"), - Operand(type="Mem", dest="EA")]) + Operand(type="Mem", relaxed=True, dest="EA")]) add_insn("lds", "ldes", modifiers=[0xC5]) add_insn("les", "ldes", modifiers=[0xC4]) @@ -1694,7 +1694,7 @@ for sfx, sz in zip("wl", [16, 32]): opersize=sz, opcode=[0x0F, 0x00], operands=[Operand(type="Reg", size=sz, dest="Spare"), - Operand(type="Mem", dest="EA")]) + Operand(type="Mem", relaxed=True, dest="EA")]) add_insn("lfs", "lfgss", modifiers=[0xB4]) add_insn("lgs", "lfgss", modifiers=[0xB5]) diff --git a/modules/arch/x86/tests/Makefile.inc b/modules/arch/x86/tests/Makefile.inc index a324aa53..4f83c1ed 100644 --- a/modules/arch/x86/tests/Makefile.inc +++ b/modules/arch/x86/tests/Makefile.inc @@ -84,8 +84,8 @@ EXTRA_DIST += modules/arch/x86/tests/jmp64-6.asm EXTRA_DIST += modules/arch/x86/tests/jmp64-6.hex EXTRA_DIST += modules/arch/x86/tests/jmpfar.asm EXTRA_DIST += modules/arch/x86/tests/jmpfar.hex -EXTRA_DIST += modules/arch/x86/tests/lds-err.asm -EXTRA_DIST += modules/arch/x86/tests/lds-err.errwarn +EXTRA_DIST += modules/arch/x86/tests/lds.asm +EXTRA_DIST += modules/arch/x86/tests/lds.hex EXTRA_DIST += modules/arch/x86/tests/loopadsz.asm EXTRA_DIST += modules/arch/x86/tests/loopadsz.hex EXTRA_DIST += modules/arch/x86/tests/lsahf.asm diff --git a/modules/arch/x86/tests/lds-err.errwarn b/modules/arch/x86/tests/lds-err.errwarn deleted file mode 100644 index e29dc728..00000000 --- a/modules/arch/x86/tests/lds-err.errwarn +++ /dev/null @@ -1,4 +0,0 @@ --:2: error: invalid size for operand 2 --:3: error: invalid size for operand 2 --:5: error: invalid size for operand 2 --:6: error: invalid size for operand 2 diff --git a/modules/arch/x86/tests/lds-err.asm b/modules/arch/x86/tests/lds.asm similarity index 100% rename from modules/arch/x86/tests/lds-err.asm rename to modules/arch/x86/tests/lds.asm diff --git a/modules/arch/x86/tests/lds.hex b/modules/arch/x86/tests/lds.hex new file mode 100644 index 00000000..c3909546 --- /dev/null +++ b/modules/arch/x86/tests/lds.hex @@ -0,0 +1,27 @@ +c5 +06 +01 +00 +c5 +06 +01 +00 +c5 +06 +01 +00 +66 +c5 +06 +01 +00 +66 +c5 +06 +01 +00 +66 +c5 +06 +01 +00 diff --git a/modules/arch/x86/x86arch.c b/modules/arch/x86/x86arch.c index 9ad3cda0..1b272f4b 100644 --- a/modules/arch/x86/x86arch.c +++ b/modules/arch/x86/x86arch.c @@ -71,6 +71,8 @@ x86_create(const char *machine, const char *parser, if (yasm__strcasecmp(parser, "nasm") == 0) arch_x86->parser = X86_PARSER_NASM; + else if (yasm__strcasecmp(parser, "tasm") == 0) + arch_x86->parser = X86_PARSER_TASM; else if (yasm__strcasecmp(parser, "gas") == 0 || yasm__strcasecmp(parser, "gnu") == 0) arch_x86->parser = X86_PARSER_GAS; diff --git a/modules/arch/x86/x86arch.h b/modules/arch/x86/x86arch.h index 2491b3bc..adcc87ea 100644 --- a/modules/arch/x86/x86arch.h +++ b/modules/arch/x86/x86arch.h @@ -82,7 +82,8 @@ typedef struct yasm_arch_x86 { unsigned int amd64_machine; enum { X86_PARSER_NASM = 0, - X86_PARSER_GAS = 1 + X86_PARSER_TASM = 1, + X86_PARSER_GAS = 2 } parser; unsigned int mode_bits; unsigned int force_strict; diff --git a/modules/arch/x86/x86bc.c b/modules/arch/x86/x86bc.c index 5f542432..adf08c9a 100644 --- a/modules/arch/x86/x86bc.c +++ b/modules/arch/x86/x86bc.c @@ -76,6 +76,7 @@ static const yasm_bytecode_callback x86_bc_callback_insn = { x86_bc_insn_destroy, x86_bc_insn_print, yasm_bc_finalize_common, + NULL, x86_bc_insn_calc_len, x86_bc_insn_expand, x86_bc_insn_tobytes, @@ -86,6 +87,7 @@ static const yasm_bytecode_callback x86_bc_callback_jmp = { x86_bc_jmp_destroy, x86_bc_jmp_print, yasm_bc_finalize_common, + NULL, x86_bc_jmp_calc_len, x86_bc_jmp_expand, x86_bc_jmp_tobytes, @@ -96,6 +98,7 @@ static const yasm_bytecode_callback x86_bc_callback_jmpfar = { x86_bc_jmpfar_destroy, x86_bc_jmpfar_print, yasm_bc_finalize_common, + NULL, x86_bc_jmpfar_calc_len, yasm_bc_expand_common, x86_bc_jmpfar_tobytes, @@ -192,6 +195,7 @@ ea_create(void) x86_ea->ea.segreg = 0; x86_ea->ea.pc_rel = 0; x86_ea->ea.not_pc_rel = 0; + x86_ea->ea.data_len = 0; x86_ea->modrm = 0; x86_ea->valid_modrm = 0; x86_ea->need_modrm = 0; @@ -254,6 +258,8 @@ yasm_x86__ea_create_expr(yasm_arch *arch, yasm_expr *e) */ x86_ea->need_sib = 0xff; + x86_ea->ea.data_len = 0; + return (yasm_effaddr *)x86_ea; } diff --git a/modules/arch/x86/x86expr.c b/modules/arch/x86/x86expr.c index f7ace08a..b141a121 100644 --- a/modules/arch/x86/x86expr.c +++ b/modules/arch/x86/x86expr.c @@ -422,7 +422,7 @@ x86_checkea_calc_displen(x86_effaddr *x86_ea, unsigned int wordsize, int noreg, * EA. With no registers, we must have a 16/32 value. */ if (noreg) { - yasm_warn_set(YASM_WARN_GENERAL, + yasm_warn_set(YASM_WARN_IMPLICIT_SIZE_OVERRIDE, N_("invalid displacement size; fixed")); x86_ea->ea.disp.size = wordsize; } else diff --git a/modules/arch/x86/x86id.c b/modules/arch/x86/x86id.c index 2e51a433..29926ada 100644 --- a/modules/arch/x86/x86id.c +++ b/modules/arch/x86/x86id.c @@ -350,6 +350,7 @@ static const yasm_bytecode_callback x86_id_insn_callback = { x86_id_insn_destroy, x86_id_insn_print, x86_id_insn_finalize, + NULL, yasm_bc_calc_len_common, yasm_bc_expand_common, yasm_bc_tobytes_common, @@ -1733,6 +1734,9 @@ yasm_x86__parse_check_insnprefix(yasm_arch *arch, const char *id, case X86_PARSER_NASM: pdata = insnprefix_nasm_find(lcaseid, id_len); break; + case X86_PARSER_TASM: + pdata = insnprefix_nasm_find(lcaseid, id_len); + break; case X86_PARSER_GAS: pdata = insnprefix_gas_find(lcaseid, id_len); break; diff --git a/modules/dbgfmts/codeview/cv-symline.c b/modules/dbgfmts/codeview/cv-symline.c index ab14b143..0a806226 100644 --- a/modules/dbgfmts/codeview/cv-symline.c +++ b/modules/dbgfmts/codeview/cv-symline.c @@ -201,6 +201,7 @@ static const yasm_bytecode_callback cv8_symhead_bc_callback = { cv8_symhead_bc_destroy, cv8_symhead_bc_print, yasm_bc_finalize_common, + NULL, cv8_symhead_bc_calc_len, yasm_bc_expand_common, cv8_symhead_bc_tobytes, @@ -211,6 +212,7 @@ static const yasm_bytecode_callback cv8_fileinfo_bc_callback = { cv8_fileinfo_bc_destroy, cv8_fileinfo_bc_print, yasm_bc_finalize_common, + NULL, cv8_fileinfo_bc_calc_len, yasm_bc_expand_common, cv8_fileinfo_bc_tobytes, @@ -221,6 +223,7 @@ static const yasm_bytecode_callback cv8_lineinfo_bc_callback = { cv8_lineinfo_bc_destroy, cv8_lineinfo_bc_print, yasm_bc_finalize_common, + NULL, cv8_lineinfo_bc_calc_len, yasm_bc_expand_common, cv8_lineinfo_bc_tobytes, @@ -231,6 +234,7 @@ static const yasm_bytecode_callback cv_sym_bc_callback = { cv_sym_bc_destroy, cv_sym_bc_print, yasm_bc_finalize_common, + NULL, cv_sym_bc_calc_len, yasm_bc_expand_common, cv_sym_bc_tobytes, diff --git a/modules/dbgfmts/codeview/cv-type.c b/modules/dbgfmts/codeview/cv-type.c index 0f2fd5d4..862bea43 100644 --- a/modules/dbgfmts/codeview/cv-type.c +++ b/modules/dbgfmts/codeview/cv-type.c @@ -492,6 +492,7 @@ static const yasm_bytecode_callback cv_type_bc_callback = { cv_type_bc_destroy, cv_type_bc_print, yasm_bc_finalize_common, + NULL, cv_type_bc_calc_len, yasm_bc_expand_common, cv_type_bc_tobytes, diff --git a/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c b/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c index 6e89a13d..d015f5c3 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c +++ b/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c @@ -55,6 +55,7 @@ static const yasm_bytecode_callback dwarf2_head_bc_callback = { dwarf2_head_bc_destroy, dwarf2_head_bc_print, yasm_bc_finalize_common, + NULL, dwarf2_head_bc_calc_len, yasm_bc_expand_common, dwarf2_head_bc_tobytes, diff --git a/modules/dbgfmts/dwarf2/dwarf2-info.c b/modules/dbgfmts/dwarf2/dwarf2-info.c index 556ca926..dd48098b 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-info.c +++ b/modules/dbgfmts/dwarf2/dwarf2-info.c @@ -207,6 +207,7 @@ static const yasm_bytecode_callback dwarf2_abbrev_bc_callback = { dwarf2_abbrev_bc_destroy, dwarf2_abbrev_bc_print, yasm_bc_finalize_common, + NULL, dwarf2_abbrev_bc_calc_len, yasm_bc_expand_common, dwarf2_abbrev_bc_tobytes, diff --git a/modules/dbgfmts/dwarf2/dwarf2-line.c b/modules/dbgfmts/dwarf2/dwarf2-line.c index d3fa76f2..3f7b96ed 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-line.c +++ b/modules/dbgfmts/dwarf2/dwarf2-line.c @@ -149,6 +149,7 @@ static const yasm_bytecode_callback dwarf2_spp_bc_callback = { dwarf2_spp_bc_destroy, dwarf2_spp_bc_print, yasm_bc_finalize_common, + NULL, dwarf2_spp_bc_calc_len, yasm_bc_expand_common, dwarf2_spp_bc_tobytes, @@ -159,6 +160,7 @@ static const yasm_bytecode_callback dwarf2_line_op_bc_callback = { dwarf2_line_op_bc_destroy, dwarf2_line_op_bc_print, yasm_bc_finalize_common, + NULL, dwarf2_line_op_bc_calc_len, yasm_bc_expand_common, dwarf2_line_op_bc_tobytes, diff --git a/modules/dbgfmts/stabs/stabs-dbgfmt.c b/modules/dbgfmts/stabs/stabs-dbgfmt.c index 88d573ab..247639ea 100644 --- a/modules/dbgfmts/stabs/stabs-dbgfmt.c +++ b/modules/dbgfmts/stabs/stabs-dbgfmt.c @@ -139,6 +139,7 @@ static const yasm_bytecode_callback stabs_bc_str_callback = { stabs_bc_str_destroy, stabs_bc_str_print, yasm_bc_finalize_common, + NULL, stabs_bc_str_calc_len, yasm_bc_expand_common, stabs_bc_str_tobytes, @@ -149,6 +150,7 @@ static const yasm_bytecode_callback stabs_bc_stab_callback = { stabs_bc_stab_destroy, stabs_bc_stab_print, yasm_bc_finalize_common, + NULL, stabs_bc_stab_calc_len, yasm_bc_expand_common, stabs_bc_stab_tobytes, diff --git a/modules/objfmts/bin/Makefile.inc b/modules/objfmts/bin/Makefile.inc index 4d38b539..a7539fe8 100644 --- a/modules/objfmts/bin/Makefile.inc +++ b/modules/objfmts/bin/Makefile.inc @@ -2,7 +2,7 @@ libyasm_a_SOURCES += modules/objfmts/bin/bin-objfmt.c -YASM_MODULES += objfmt_bin +YASM_MODULES += objfmt_bin objfmt_dosexe EXTRA_DIST += modules/objfmts/bin/tests/Makefile.inc diff --git a/modules/objfmts/bin/bin-objfmt.c b/modules/objfmts/bin/bin-objfmt.c index fc283d71..e05a5acb 100644 --- a/modules/objfmts/bin/bin-objfmt.c +++ b/modules/objfmts/bin/bin-objfmt.c @@ -27,6 +27,9 @@ #include /*@unused@*/ RCSID("$Id$"); +#ifdef HAVE_UNISTD_H +#include +#endif #include @@ -1071,7 +1074,8 @@ bin_objfmt_output_section(yasm_section *sect, /*@null@*/ void *d) yasm_errwarn_propagate(info->errwarns, 0); return 0; } - if (fseek(info->f, yasm_intnum_get_int(info->tmp_intn), SEEK_SET) < 0) + if (fseek(info->f, yasm_intnum_get_int(info->tmp_intn) + info->start, + SEEK_SET) < 0) yasm__fatal(N_("could not seek on output file")); yasm_section_bcs_traverse(sect, info->errwarns, info, bin_objfmt_output_bytecode); @@ -1106,6 +1110,8 @@ bin_objfmt_output(yasm_object *object, FILE *f, /*@unused@*/ int all_syms, yasm_intnum *start, *last, *vdelta; bin_groups unsorted_groups, bss_groups; + info.start = ftell(f); + /* Set ORG to 0 unless otherwise specified */ if (objfmt_bin->org) { info.origin = yasm_expr_get_intnum(&objfmt_bin->org, 0); @@ -1782,6 +1788,7 @@ static const char *bin_nasm_stdmac[] = { static const yasm_stdmac bin_objfmt_stdmacs[] = { { "nasm", "nasm", bin_nasm_stdmac }, + { "tasm", "tasm", bin_nasm_stdmac }, { NULL, NULL, NULL } }; @@ -1802,3 +1809,154 @@ yasm_objfmt_module yasm_bin_LTX_objfmt = { bin_objfmt_section_switch, bin_objfmt_get_special_sym }; + +#define EXE_HEADER_SIZE 0x200 + +/* DOS .EXE binaries are just raw binaries with a header */ +yasm_objfmt_module yasm_dosexe_LTX_objfmt; + +static yasm_objfmt * +dosexe_objfmt_create(yasm_object *object) +{ + yasm_objfmt_bin *objfmt_bin = (yasm_objfmt_bin *) bin_objfmt_create(object); + objfmt_bin->objfmt.module = &yasm_dosexe_LTX_objfmt; + return (yasm_objfmt *)objfmt_bin; +} + +static unsigned long +get_sym(yasm_object *object, const char *name) { + yasm_symrec *symrec = yasm_symtab_get(object->symtab, name); + yasm_bytecode *prevbc; + if (!symrec) + return 0; + if (!yasm_symrec_get_label(symrec, &prevbc)) + return 0; + return prevbc->offset + prevbc->len; +} + +static void +dosexe_objfmt_output(yasm_object *object, FILE *f, /*@unused@*/ int all_syms, + yasm_errwarns *errwarns) +{ + unsigned long tot_size, size, bss_size; + unsigned long start, bss; + unsigned char c; + + fseek(f, EXE_HEADER_SIZE, SEEK_SET); + + bin_objfmt_output(object, f, all_syms, errwarns); + + tot_size = ftell(f); + + /* if there is a __bss_start symbol, data after it is 0, no need to write + * it. */ + bss = get_sym(object, "__bss_start"); + if (bss) + size = bss; + else + size = tot_size; + bss_size = tot_size - size; +#ifdef HAVE_FTRUNCATE + if (size != tot_size) + ftruncate(fileno(f), EXE_HEADER_SIZE + size); +#endif + fseek(f, 0, SEEK_SET); + + /* magic */ + fwrite("MZ", 1, 2, f); + + /* file size */ + c = size & 0xff; + fwrite(&c, 1, 1, f); + c = !!(size & 0x100); + fwrite(&c, 1, 1, f); + c = ((size + 511) >> 9) & 0xff; + fwrite(&c, 1, 1, f); + c = ((size + 511) >> 17) & 0xff; + fwrite(&c, 1, 1, f); + + /* relocation # */ + c = 0; + fwrite(&c, 1, 1, f); + fwrite(&c, 1, 1, f); + + /* header size */ + c = EXE_HEADER_SIZE / 16; + fwrite(&c, 1, 1, f); + c = 0; + fwrite(&c, 1, 1, f); + + /* minimum paragraph # */ + bss_size = (bss_size + 15) >> 4; + c = bss_size & 0xff; + fwrite(&c, 1, 1, f); + c = (bss_size >> 8) & 0xff; + fwrite(&c, 1, 1, f); + + /* maximum paragraph # */ + c = 0xFF; + fwrite(&c, 1, 1, f); + fwrite(&c, 1, 1, f); + + /* relative value of stack segment */ + c = 0; + fwrite(&c, 1, 1, f); + fwrite(&c, 1, 1, f); + + /* SP at start */ + c = 0; + fwrite(&c, 1, 1, f); + fwrite(&c, 1, 1, f); + + /* header checksum */ + c = 0; + fwrite(&c, 1, 1, f); + fwrite(&c, 1, 1, f); + + /* IP at start */ + start = get_sym(object, "start"); + if (!start) { + yasm_error_set(YASM_ERROR_GENERAL, + N_("%s: could not find symbol `start'")); + return; + } + c = start & 0xff; + fwrite(&c, 1, 1, f); + c = (start >> 8) & 0xff; + fwrite(&c, 1, 1, f); + + /* CS start */ + c = 0; + fwrite(&c, 1, 1, f); + fwrite(&c, 1, 1, f); + + /* reloc start */ + c = 0x22; + fwrite(&c, 1, 1, f); + c = 0; + fwrite(&c, 1, 1, f); + + /* Overlay number */ + c = 0; + fwrite(&c, 1, 1, f); + fwrite(&c, 1, 1, f); +} + + +/* Define objfmt structure -- see objfmt.h for details */ +yasm_objfmt_module yasm_dosexe_LTX_objfmt = { + "DOS .EXE format binary", + "dosexe", + "exe", + 16, + bin_objfmt_dbgfmt_keywords, + "null", + bin_objfmt_directives, + bin_objfmt_stdmacs, + dosexe_objfmt_create, + dosexe_objfmt_output, + bin_objfmt_destroy, + bin_objfmt_add_default_section, + bin_objfmt_section_switch, + bin_objfmt_get_special_sym +}; diff --git a/modules/objfmts/coff/coff-objfmt.c b/modules/objfmts/coff/coff-objfmt.c index 46f6d1eb..448682e2 100644 --- a/modules/objfmts/coff/coff-objfmt.c +++ b/modules/objfmts/coff/coff-objfmt.c @@ -234,6 +234,7 @@ static const yasm_bytecode_callback win32_sxdata_bc_callback = { win32_sxdata_bc_destroy, win32_sxdata_bc_print, yasm_bc_finalize_common, + NULL, win32_sxdata_bc_calc_len, yasm_bc_expand_common, win32_sxdata_bc_tobytes, diff --git a/modules/objfmts/coff/win64-except.c b/modules/objfmts/coff/win64-except.c index 11ea4bde..5596eac3 100644 --- a/modules/objfmts/coff/win64-except.c +++ b/modules/objfmts/coff/win64-except.c @@ -72,6 +72,7 @@ static const yasm_bytecode_callback win64_uwinfo_bc_callback = { win64_uwinfo_bc_destroy, win64_uwinfo_bc_print, win64_uwinfo_bc_finalize, + NULL, win64_uwinfo_bc_calc_len, win64_uwinfo_bc_expand, win64_uwinfo_bc_tobytes, @@ -82,6 +83,7 @@ static const yasm_bytecode_callback win64_uwcode_bc_callback = { win64_uwcode_bc_destroy, win64_uwcode_bc_print, win64_uwcode_bc_finalize, + NULL, win64_uwcode_bc_calc_len, win64_uwcode_bc_expand, win64_uwcode_bc_tobytes, diff --git a/modules/objfmts/win64/tests/win64-dataref.hex b/modules/objfmts/win64/tests/win64-dataref.hex index 3af07864..fa604a6f 100644 --- a/modules/objfmts/win64/tests/win64-dataref.hex +++ b/modules/objfmts/win64/tests/win64-dataref.hex @@ -1364,7 +1364,7 @@ f8 00 00 00 -17 +16 00 00 00 @@ -1374,7 +1374,7 @@ f8 00 00 00 -17 +16 00 00 00 @@ -1999,6 +1999,24 @@ a0 03 00 78 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +00 +00 +00 +03 +00 +78 70 74 72 @@ -2017,24 +2035,6 @@ a0 03 00 78 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -03 -00 -00 -00 -03 -00 -78 70 74 72 diff --git a/modules/parsers/Makefile.inc b/modules/parsers/Makefile.inc index 89bfd35b..a2ab23f3 100644 --- a/modules/parsers/Makefile.inc +++ b/modules/parsers/Makefile.inc @@ -5,6 +5,7 @@ EXTRA_DIST += modules/parsers/nasm/Makefile.inc include modules/parsers/gas/Makefile.inc include modules/parsers/nasm/Makefile.inc +include modules/parsers/tasm/Makefile.inc dist_man_MANS += yasm_parsers.7 diff --git a/modules/parsers/nasm/Makefile.inc b/modules/parsers/nasm/Makefile.inc index ac174ca0..7149959d 100644 --- a/modules/parsers/nasm/Makefile.inc +++ b/modules/parsers/nasm/Makefile.inc @@ -5,7 +5,7 @@ libyasm_a_SOURCES += modules/parsers/nasm/nasm-parser.h libyasm_a_SOURCES += modules/parsers/nasm/nasm-parse.c nodist_libyasm_a_SOURCES += nasm-token.c -YASM_MODULES += parser_nasm +YASM_MODULES += parser_nasm parser_tasm nasm-token.c: $(srcdir)/modules/parsers/nasm/nasm-token.re re2c$(EXEEXT) $(top_builddir)/re2c$(EXEEXT) -b -o $@ $(srcdir)/modules/parsers/nasm/nasm-token.re diff --git a/modules/parsers/nasm/nasm-parse.c b/modules/parsers/nasm/nasm-parse.c index cba949f8..7afd0086 100644 --- a/modules/parsers/nasm/nasm-parse.c +++ b/modules/parsers/nasm/nasm-parse.c @@ -32,6 +32,7 @@ RCSID("$Id$"); #include #include "modules/parsers/nasm/nasm-parser.h" +#include "modules/preprocs/nasm/nasm.h" typedef enum { NORM_EXPR, @@ -62,7 +63,23 @@ static void nasm_parser_directive /*@null@*/ yasm_valparamhead *valparams, /*@null@*/ yasm_valparamhead *objext_valparams); static void define_label(yasm_parser_nasm *parser_nasm, /*@only@*/ char *name, - int local); + unsigned int size, int local); + +static void yasm_ea_set_implicit_size_segment(yasm_parser_nasm *parser_nasm, + yasm_effaddr *ea, yasm_expr *e) +{ + if (tasm_compatible_mode) { + const char *segment = yasm_expr_segment(e); + ea->data_len = yasm_expr_size(e); + if (segment) { + const char *segreg = tasm_get_segment_register(segment); + if (segreg) + yasm_arch_parse_check_regtmod(p_object->arch, segreg, + strlen(segreg), &ea->segreg); + } + } +} + #define is_eol_tok(tok) ((tok) == 0) #define is_eol() is_eol_tok(curtok) @@ -242,11 +259,12 @@ nasm_parser_parse(yasm_parser_nasm *parser_nasm) yasm_bc_destroy(bc); } temp_bc = NULL; - } else { + } else if (bc) { temp_bc = yasm_section_bcs_append(cursect, bc); if (temp_bc) parser_nasm->prev_bc = temp_bc; - } + } else + temp_bc = NULL; yasm_errwarn_propagate(parser_nasm->errwarns, cur_line); if (parser_nasm->save_input) @@ -355,23 +373,33 @@ parse_line(yasm_parser_nasm *parser_nasm) case LOCAL_ID: { char *name = ID_val; - int local = (curtok != ID); + int local = tasm_compatible_mode + ? (curtok == ID || curtok == LOCAL_ID || + (curtok == SPECIAL_ID && name[0] == '@')) + : (curtok != ID); + unsigned int size = 0; get_next_token(); if (is_eol()) { /* label alone on the line */ yasm_warn_set(YASM_WARN_ORPHAN_LABEL, N_("label alone on a line without a colon might be in error")); - define_label(parser_nasm, name, local); + define_label(parser_nasm, name, 0, local); return NULL; } if (curtok == ':') get_next_token(); - if (curtok == EQU) { + if (curtok == EQU || (tasm_compatible_mode && curtok == '=')) { /* label EQU expr */ yasm_expr *e; get_next_token(); + + if (tasm_compatible_mode && curtok == SIZE_OVERRIDE) { + size = SIZE_OVERRIDE_val; + get_next_token(); + } + e = parse_expr(parser_nasm, NORM_EXPR); if (!e) { yasm_error_set(YASM_ERROR_SYNTAX, @@ -384,17 +412,30 @@ parse_line(yasm_parser_nasm *parser_nasm) return NULL; } - define_label(parser_nasm, name, local); - if (is_eol()) + if (tasm_compatible_mode && curtok == LABEL) + get_next_token(); + + if (tasm_compatible_mode && curtok == SIZE_OVERRIDE) { + size = SIZE_OVERRIDE_val; + get_next_token(); + } + + if (is_eol()) { + define_label(parser_nasm, name, size, local); return NULL; + } if (curtok == TIMES) { + define_label(parser_nasm, name, size, local); get_next_token(); return parse_times(parser_nasm); } bc = parse_exp(parser_nasm); - if (!bc) + if (!tasm_compatible_mode && !bc) yasm_error_set(YASM_ERROR_SYNTAX, N_("instruction expected after label")); + if (tasm_compatible_mode && bc && !size) + size = yasm_bc_elem_size(bc); + define_label(parser_nasm, name, size, local); return bc; } default: @@ -510,7 +551,7 @@ parse_exp(yasm_parser_nasm *parser_nasm) unsigned int size = DECLARE_DATA_val/8; yasm_datavalhead dvs; yasm_dataval *dv; - yasm_expr *e; + yasm_expr *e, *e2; get_next_token(); @@ -529,14 +570,68 @@ parse_exp(yasm_parser_nasm *parser_nasm) goto dv_done; } } - if ((e = parse_bexpr(parser_nasm, DV_EXPR))) - dv = yasm_dv_create_expr(e); - else { + if (curtok == '?') { + yasm_dvs_delete(&dvs); + get_next_token(); + if (! is_eol_tok(curtok)) { + yasm_error_set(YASM_ERROR_SYNTAX, + N_("can not handle more than one '?'")); + return NULL; + } + return yasm_bc_create_reserve( + p_expr_new_ident(yasm_expr_int( + yasm_intnum_create_uint(1))), + size, cur_line); + } + if (!(e = parse_bexpr(parser_nasm, DV_EXPR))) { yasm_error_set(YASM_ERROR_SYNTAX, N_("expression or string expected")); yasm_dvs_delete(&dvs); return NULL; } + if (curtok == DUP) { + get_next_token(); + if (curtok != '(') { + yasm_error_set(YASM_ERROR_SYNTAX, + N_("expected ( after DUP")); + goto error; + } + get_next_token(); + if (curtok == '?') { + get_next_token(); + if (curtok != ')') { + yasm_error_set(YASM_ERROR_SYNTAX, + N_("expected ) after DUPlicated expression")); + goto error; + } + get_next_token(); + if (! is_eol_tok(curtok)) { + yasm_error_set(YASM_ERROR_SYNTAX, + N_("can not handle more than one '?'")); + goto error; + } + yasm_dvs_delete(&dvs); + return yasm_bc_create_reserve(e, size, cur_line); + } else if ((e2 = parse_bexpr(parser_nasm, DV_EXPR))) { + if (curtok != ')') { + yasm_expr_destroy(e2); + yasm_error_set(YASM_ERROR_SYNTAX, + N_("expected ) after DUPlicated expression")); + goto error; + } + get_next_token(); + dv = yasm_dv_create_expr(e2); + yasm_dv_set_multiple(dv, e); + } else { + yasm_error_set(YASM_ERROR_SYNTAX, + N_("expression or string expected")); +error: + yasm_expr_destroy(e); + yasm_dvs_delete(&dvs); + return NULL; + } + } else + dv = yasm_dv_create_expr(e); dv_done: yasm_dvs_append(&dvs, dv); if (is_eol()) @@ -699,12 +794,104 @@ parse_operand(yasm_parser_nasm *parser_nasm) N_("memory address expected")); return NULL; } + + if (tasm_compatible_mode && !is_eol() && curtok != ',') { + yasm_expr *e, *f; + yasm_effaddr *ea; + + switch (op->type) { + case YASM_INSN__OPERAND_IMM: + e = op->data.val; + break; + case YASM_INSN__OPERAND_MEMORY: + if (op->data.ea->disp.rel) { + yasm_error_set(YASM_ERROR_SYNTAX, + N_("relative adressing not supported\n")); + return NULL; + } + e = yasm_expr_copy(op->data.ea->disp.abs); + yasm_arch_ea_destroy(p_object->arch, op->data.ea); + break; + case YASM_INSN__OPERAND_REG: + case YASM_INSN__OPERAND_SEGREG: + yasm_error_set(YASM_ERROR_SYNTAX, + N_("register adressing not supported\n")); + return NULL; + } + yasm_xfree(op); + f = parse_bexpr(parser_nasm, NORM_EXPR); + if (!f) { + yasm_expr_destroy(e); + yasm_error_set(YASM_ERROR_SYNTAX, + N_("expected expression after ]")); + return NULL; + } + e = p_expr_new_tree(e, YASM_EXPR_ADD, f); + ea = yasm_arch_ea_create(p_object->arch, e); + yasm_ea_set_implicit_size_segment(parser_nasm, ea, e); + op = yasm_operand_create_mem(ea); + } return op; } - case SEGREG: - op = yasm_operand_create_segreg(SEGREG_val); + case OFFSET: + { + yasm_insn_operand *op2; get_next_token(); + op = parse_operand(parser_nasm); + if (!op) { + yasm_error_set(YASM_ERROR_SYNTAX, + N_("memory address expected")); + return NULL; + } + if (op->type == YASM_INSN__OPERAND_IMM) + return op; + if (op->type != YASM_INSN__OPERAND_MEMORY) { + yasm_error_set(YASM_ERROR_SYNTAX, + N_("OFFSET applied to non-memory operand")); + return NULL; + } + if (op->data.ea->disp.rel) { + yasm_error_set(YASM_ERROR_SYNTAX, + N_("OFFSET applied to non-absolute memory operand")); + return NULL; + } + if (op->data.ea->disp.abs) + op2 = yasm_operand_create_imm(op->data.ea->disp.abs); + else + op2 = yasm_operand_create_imm(p_expr_new_ident( + yasm_expr_int(yasm_intnum_create_uint(0)))); + yasm_xfree(op); + return op2; + } + case SEGREG: + { + uintptr_t segreg = SEGREG_val; + get_next_token(); + if (tasm_compatible_mode && curtok == ':') { + get_next_token(); + op = parse_operand(parser_nasm); + if (!op) + return NULL; + if (op->type == YASM_INSN__OPERAND_IMM) { + yasm_effaddr *ea = yasm_arch_ea_create(p_object->arch, + op->data.val); + yasm_ea_set_implicit_size_segment(parser_nasm, ea, op->data.val); + yasm_insn_operand *op2 = yasm_operand_create_mem(ea); + op2->size = op->size; + yasm_xfree(op); + op = op2; + } + if (op->type != YASM_INSN__OPERAND_MEMORY) { + yasm_error_set(YASM_ERROR_SYNTAX, + N_("segment applied to non-memory operand")); + return NULL; + } + yasm_ea_set_segreg(op->data.ea, segreg); + return op; + } + op = yasm_operand_create_segreg(segreg); return op; + } case REG: op = yasm_operand_create_reg(REG_val); get_next_token(); @@ -756,13 +943,51 @@ parse_operand(yasm_parser_nasm *parser_nasm) op->targetmod = tmod; return op; } + case ID: + case LOCAL_ID: + case NONLOCAL_ID: + if (tasm_compatible_mode) { + get_peek_token(parser_nasm); + if (parser_nasm->peek_token == '[') { + yasm_symrec *sym = yasm_symtab_use(p_symtab, ID_val, + cur_line); + yasm_expr *e = p_expr_new_ident(yasm_expr_sym(sym)), *f; + yasm_effaddr *ea; + yasm_xfree(ID_val); + get_next_token(); + get_next_token(); + f = parse_bexpr(parser_nasm, NORM_EXPR); + if (!f) { + yasm_error_set(YASM_ERROR_SYNTAX, + N_("expected expression after [")); + return NULL; + } + e = p_expr_new_tree(e, YASM_EXPR_ADD, f); + if (!expect(']')) { + yasm_error_set(YASM_ERROR_SYNTAX, N_("missing closing bracket")); + return NULL; + } + get_next_token(); + ea = yasm_arch_ea_create(p_object->arch, e); + yasm_ea_set_implicit_size_segment(parser_nasm, ea, e); + op = yasm_operand_create_mem(ea); + return op; + } + } + /* Fallthrough */ default: { yasm_expr *e = parse_bexpr(parser_nasm, NORM_EXPR); if (!e) return NULL; if (curtok != ':') - return yasm_operand_create_imm(e); + if (tasm_compatible_mode && yasm_expr_size(e)) { + yasm_effaddr *ea = yasm_arch_ea_create(p_object->arch, e); + yasm_ea_set_implicit_size_segment(parser_nasm, ea, e); + op = yasm_operand_create_mem(ea); + return op; + } else + return yasm_operand_create_imm(e); else { yasm_expr *off; get_next_token(); @@ -836,10 +1061,12 @@ parse_memaddr(yasm_parser_nasm *parser_nasm) yasm_expr *e = parse_bexpr(parser_nasm, NORM_EXPR); if (!e) return NULL; - if (curtok != ':') - return yasm_operand_create_mem( - yasm_arch_ea_create(p_object->arch, e)); - else { + if (curtok != ':') { + yasm_effaddr *ea = yasm_arch_ea_create(p_object->arch, e); + yasm_ea_set_implicit_size_segment(parser_nasm, ea, e); + return yasm_operand_create_mem(ea); + } else { + yasm_effaddr *ea; yasm_expr *off; get_next_token(); off = parse_bexpr(parser_nasm, NORM_EXPR); @@ -847,8 +1074,9 @@ parse_memaddr(yasm_parser_nasm *parser_nasm) yasm_expr_destroy(e); return NULL; } - op = yasm_operand_create_mem( - yasm_arch_ea_create(p_object->arch, off)); + ea = yasm_arch_ea_create(p_object->arch, off); + yasm_ea_set_implicit_size_segment(parser_nasm, ea, off); + op = yasm_operand_create_mem(ea); op->seg = e; return op; } @@ -1094,6 +1322,30 @@ parse_expr6(yasm_parser_nasm *parser_nasm, expr_type type) return NULL; } return p_expr_new_branch(YASM_EXPR_NOT, e); + case LOW: + get_next_token(); + e = parse_expr6(parser_nasm, type); + if (!e) { + yasm_error_set(YASM_ERROR_SYNTAX, + N_("expected expression after %s"), "LOW"); + return NULL; + } + return p_expr_new_tree(e, YASM_EXPR_AND, + p_expr_new_ident(yasm_expr_int(yasm_intnum_create_uint(0xff)))); + case HIGH: + get_next_token(); + e = parse_expr6(parser_nasm, type); + if (!e) { + yasm_error_set(YASM_ERROR_SYNTAX, + N_("expected expression after %s"), "HIGH"); + return NULL; + } + return p_expr_new_tree( + p_expr_new_tree(e, YASM_EXPR_SHR, + p_expr_new_ident(yasm_expr_int( + yasm_intnum_create_uint(8)))), + YASM_EXPR_AND, + p_expr_new_ident(yasm_expr_int(yasm_intnum_create_uint(0xff)))); case SEG: get_next_token(); e = parse_expr6(parser_nasm, type); @@ -1132,10 +1384,16 @@ parse_expr6(yasm_parser_nasm *parser_nasm, expr_type type) e = p_expr_new_ident(yasm_expr_reg(REG_val)); break; case STRING: - e = p_expr_new_ident(yasm_expr_int( - yasm_intnum_create_charconst_nasm(STRING_val.contents))); + { + yasm_intnum *intn; + if (tasm_compatible_mode) + intn = yasm_intnum_create_charconst_tasm(STRING_val.contents); + else + intn = yasm_intnum_create_charconst_nasm(STRING_val.contents); + e = p_expr_new_ident(yasm_expr_int(intn)); yasm_xfree(STRING_val.contents); break; + } case SPECIAL_ID: sym = yasm_objfmt_get_special_sym(p_object, ID_val+2, "nasm"); if (sym) { @@ -1179,9 +1437,12 @@ parse_expr6(yasm_parser_nasm *parser_nasm, expr_type type) } static void -define_label(yasm_parser_nasm *parser_nasm, char *name, int local) +define_label(yasm_parser_nasm *parser_nasm, char *name, unsigned int size, + int local) { - if (!local) { + yasm_symrec *symrec; + + if ((!tasm_compatible_mode || tasm_locals) && !local) { if (parser_nasm->locallabel_base) yasm_xfree(parser_nasm->locallabel_base); parser_nasm->locallabel_base_len = strlen(name); @@ -1191,11 +1452,16 @@ define_label(yasm_parser_nasm *parser_nasm, char *name, int local) } if (parser_nasm->abspos) - yasm_symtab_define_equ(p_symtab, name, - yasm_expr_copy(parser_nasm->abspos), cur_line); + symrec = yasm_symtab_define_equ(p_symtab, name, + yasm_expr_copy(parser_nasm->abspos), + cur_line); else - yasm_symtab_define_label(p_symtab, name, parser_nasm->prev_bc, 1, - cur_line); + symrec = yasm_symtab_define_label(p_symtab, name, parser_nasm->prev_bc, + 1, cur_line); + + yasm_symrec_set_size(symrec, size); + yasm_symrec_set_segment(symrec, tasm_segment); + yasm_xfree(name); } diff --git a/modules/parsers/nasm/nasm-parser.c b/modules/parsers/nasm/nasm-parser.c index ac10de37..12070061 100644 --- a/modules/parsers/nasm/nasm-parser.c +++ b/modules/parsers/nasm/nasm-parser.c @@ -31,6 +31,8 @@ #include "nasm-parser.h" +#include "modules/preprocs/nasm/nasm.h" + static void nasm_parser_do_parse(yasm_object *object, yasm_preproc *pp, @@ -100,3 +102,36 @@ yasm_parser_module yasm_nasm_LTX_parser = { nasm_parser_stdmacs, nasm_parser_do_parse }; + +static void +tasm_parser_do_parse(yasm_object *object, yasm_preproc *pp, + int save_input, yasm_linemap *linemap, + yasm_errwarns *errwarns) +{ + tasm_compatible_mode = 1; + yasm_symtab_set_case_sensitive(object->symtab, 0); + yasm_warn_disable(YASM_WARN_IMPLICIT_SIZE_OVERRIDE); + nasm_parser_do_parse(object, pp, save_input, linemap, errwarns); +} + +/* Define valid preprocessors to use with this parser */ +static const char *tasm_parser_preproc_keywords[] = { + "raw", + "tasm", + NULL +}; + +static const yasm_stdmac tasm_parser_stdmacs[] = { + { "tasm", "tasm", nasm_standard_mac }, + { NULL, NULL, NULL } +}; + +/* Define parser structure -- see parser.h for details */ +yasm_parser_module yasm_tasm_LTX_parser = { + "TASM-compatible parser", + "tasm", + tasm_parser_preproc_keywords, + "tasm", + tasm_parser_stdmacs, + tasm_parser_do_parse +}; diff --git a/modules/parsers/nasm/nasm-parser.h b/modules/parsers/nasm/nasm-parser.h index c6148a7b..63127589 100644 --- a/modules/parsers/nasm/nasm-parser.h +++ b/modules/parsers/nasm/nasm-parser.h @@ -38,11 +38,14 @@ enum tokentype { FILENAME, STRING, SIZE_OVERRIDE, + OFFSET, DECLARE_DATA, RESERVE_SPACE, + LABEL, INCBIN, EQU, TIMES, + DUP, SEG, WRT, ABS, @@ -56,6 +59,8 @@ enum tokentype { TARGETMOD, LEFT_OP, RIGHT_OP, + LOW, + HIGH, SIGNDIV, SIGNMOD, START_SECTION_ID, diff --git a/modules/parsers/nasm/nasm-token.re b/modules/parsers/nasm/nasm-token.re index cc589b18..72e15080 100644 --- a/modules/parsers/nasm/nasm-token.re +++ b/modules/parsers/nasm/nasm-token.re @@ -32,6 +32,7 @@ RCSID("$Id$"); #include #include "modules/parsers/nasm/nasm-parser.h" +#include "modules/preprocs/nasm/nasm.h" #define YYCURSOR cursor @@ -76,13 +77,22 @@ handle_dot_label(YYSTYPE *lvalp, char *tok, size_t toklen, size_t zeropos, { /* check for special non-local labels like ..start */ if (tok[zeropos+1] == '.') { - lvalp->str_val = yasm__xstrndup(tok+zeropos, toklen-zeropos); + lvalp->str_val = yasm__xstrndup(tok+zeropos+(tasm_compatible_mode?2:0), + toklen-zeropos-(tasm_compatible_mode?2:0)); /* check for special non-local ..@label */ if (lvalp->str_val[zeropos+2] == '@') return NONLOCAL_ID; return SPECIAL_ID; } - + if (tasm_compatible_mode && (!tasm_locals || + (tok[zeropos] == '.' && + tok[zeropos+1] != '@' && tok[zeropos+2] != '@'))) { + /* no locals on Tasm without the 'locals' directive */ + /* .foo is never local either, but .@@foo may be (local structure + * members) */ + lvalp->str_val = yasm__xstrndup(tok + zeropos, toklen - zeropos); + return SPECIAL_ID; + } if (!parser_nasm->locallabel_base) { lvalp->str_val = yasm__xstrndup(tok+zeropos, toklen-zeropos); yasm_warn_set(YASM_WARN_GENERAL, @@ -242,65 +252,95 @@ scan: } /* pseudo-instructions */ - 'db' { lvalp->int_info = 8; RETURN(DECLARE_DATA); } + 'db' { + lvalp->int_info = 8; + parser_nasm->state = INSTRUCTION; + RETURN(DECLARE_DATA); + } 'dhw' { lvalp->int_info = yasm_arch_wordsize(p_object->arch)/2; + parser_nasm->state = INSTRUCTION; RETURN(DECLARE_DATA); } 'dw' { lvalp->int_info = yasm_arch_wordsize(p_object->arch); + parser_nasm->state = INSTRUCTION; RETURN(DECLARE_DATA); } 'dd' { lvalp->int_info = yasm_arch_wordsize(p_object->arch)*2; + parser_nasm->state = INSTRUCTION; RETURN(DECLARE_DATA); } 'dq' { lvalp->int_info = yasm_arch_wordsize(p_object->arch)*4; + parser_nasm->state = INSTRUCTION; + RETURN(DECLARE_DATA); + } + 'dt' { + lvalp->int_info = 80; + parser_nasm->state = INSTRUCTION; RETURN(DECLARE_DATA); } - 'dt' { lvalp->int_info = 80; RETURN(DECLARE_DATA); } 'ddq' { lvalp->int_info = yasm_arch_wordsize(p_object->arch)*8; + parser_nasm->state = INSTRUCTION; RETURN(DECLARE_DATA); } 'do' { lvalp->int_info = yasm_arch_wordsize(p_object->arch)*8; + parser_nasm->state = INSTRUCTION; RETURN(DECLARE_DATA); } 'dy' { lvalp->int_info = 256; + parser_nasm->state = INSTRUCTION; RETURN(DECLARE_DATA); } - 'resb' { lvalp->int_info = 8; RETURN(RESERVE_SPACE); } + 'resb' { + lvalp->int_info = 8; + parser_nasm->state = INSTRUCTION; + RETURN(RESERVE_SPACE); + } 'reshw' { lvalp->int_info = yasm_arch_wordsize(p_object->arch)/2; + parser_nasm->state = INSTRUCTION; RETURN(RESERVE_SPACE); } 'resw' { lvalp->int_info = yasm_arch_wordsize(p_object->arch); + parser_nasm->state = INSTRUCTION; RETURN(RESERVE_SPACE); } 'resd' { lvalp->int_info = yasm_arch_wordsize(p_object->arch)*2; + parser_nasm->state = INSTRUCTION; RETURN(RESERVE_SPACE); } 'resq' { lvalp->int_info = yasm_arch_wordsize(p_object->arch)*4; + parser_nasm->state = INSTRUCTION; + RETURN(RESERVE_SPACE); + } + 'rest' { + lvalp->int_info = 80; + parser_nasm->state = INSTRUCTION; RETURN(RESERVE_SPACE); } - 'rest' { lvalp->int_info = 80; RETURN(RESERVE_SPACE); } 'resdq' { lvalp->int_info = yasm_arch_wordsize(p_object->arch)*8; + parser_nasm->state = INSTRUCTION; RETURN(RESERVE_SPACE); } 'reso' { lvalp->int_info = yasm_arch_wordsize(p_object->arch)*8; + parser_nasm->state = INSTRUCTION; RETURN(RESERVE_SPACE); } 'resy' { lvalp->int_info = 256; + parser_nasm->state = INSTRUCTION; RETURN(RESERVE_SPACE); } @@ -325,17 +365,18 @@ scan: "//" { RETURN(SIGNDIV); } "%%" { RETURN(SIGNMOD); } "$$" { RETURN(START_SECTION_ID); } - [-+|^*&/%~$():=,\[] { RETURN(s->tok[0]); } + [-+|^*&/%~$():=,\[?] { RETURN(s->tok[0]); } "]" { RETURN(s->tok[0]); } /* local label (.label) */ - "." [a-zA-Z0-9_$#@~.?]+ { + ("." | "@@") [a-zA-Z0-9_$#@~.?]+ { RETURN(handle_dot_label(lvalp, TOK, TOKLEN, 0, parser_nasm)); } /* forced identifier */ "$" [a-zA-Z0-9_$#@~.?]+ { - if (TOK[1] == '.') { + if (TOK[1] == '.' || + (tasm_compatible_mode && TOK[1] == '@' && TOK[2] == '@')) { /* handle like .label */ RETURN(handle_dot_label(lvalp, TOK, TOKLEN, 1, parser_nasm)); } @@ -376,11 +417,61 @@ scan: s->tok[TOKLEN] = savech; RETURN(TARGETMOD); default: + break; + } + if (tasm_compatible_mode) { + if (!strcasecmp(TOK, "shl")) { s->tok[TOKLEN] = savech; + RETURN(LEFT_OP); + } + if (!strcasecmp(TOK, "shr")) { + s->tok[TOKLEN] = savech; + RETURN(RIGHT_OP); + } + if (!strcasecmp(TOK, "and")) { + s->tok[TOKLEN] = savech; + RETURN('&'); + } + if (!strcasecmp(TOK, "or")) { + s->tok[TOKLEN] = savech; + RETURN('|'); + } + if (!strcasecmp(TOK, "low")) { + s->tok[TOKLEN] = savech; + RETURN(LOW); + } + if (!strcasecmp(TOK, "high")) { + s->tok[TOKLEN] = savech; + RETURN(HIGH); + } + if (!strcasecmp(TOK, "offset")) { + s->tok[TOKLEN] = savech; + RETURN(OFFSET); + } + if (!strcasecmp(TOK, "fword")) { + s->tok[TOKLEN] = savech; + lvalp->int_info = yasm_arch_wordsize(p_object->arch)*2; + RETURN(SIZE_OVERRIDE); + } + if (!strcasecmp(TOK, "df")) { + s->tok[TOKLEN] = savech; + lvalp->int_info = yasm_arch_wordsize(p_object->arch)*3; + parser_nasm->state = INSTRUCTION; + RETURN(DECLARE_DATA); + } + if (!strcasecmp(TOK, "label")) { + s->tok[TOKLEN] = savech; + RETURN(LABEL); + } + if (!strcasecmp(TOK, "dup")) { + s->tok[TOKLEN] = savech; + RETURN(DUP); + } } /* Propagate errors in case we got a warning from the arch */ yasm_errwarn_propagate(parser_nasm->errwarns, cur_line); /* Just an identifier, return as such. */ + s->tok[TOKLEN] = savech; lvalp->str_val = yasm__xstrndup(TOK, TOKLEN); RETURN(ID); } @@ -638,6 +729,26 @@ stringconst_scan: /*!re2c [\000] { goto stringconst_error; } + "''" | '""' { + if (endch != s->tok[0]) { + strbuf[count++] = s->tok[0]; + if (count >= strbuf_size) { + strbuf = yasm_xrealloc(strbuf, + strbuf_size + STRBUF_ALLOC_SIZE); + strbuf_size += STRBUF_ALLOC_SIZE; + } + } else if (!tasm_compatible_mode) { + YYCURSOR--; + goto stringconst_end; + } + strbuf[count++] = s->tok[0]; + if (count >= strbuf_size) { + strbuf = yasm_xrealloc(strbuf, strbuf_size + STRBUF_ALLOC_SIZE); + strbuf_size += STRBUF_ALLOC_SIZE; + } + goto stringconst_scan; + } + any { if (s->tok[0] == endch) goto stringconst_end; diff --git a/modules/parsers/tasm/Makefile.inc b/modules/parsers/tasm/Makefile.inc new file mode 100644 index 00000000..e7589585 --- /dev/null +++ b/modules/parsers/tasm/Makefile.inc @@ -0,0 +1,5 @@ +# $Id: Makefile.inc 2082 2008-05-09 06:46:02Z peter $ + +EXTRA_DIST += modules/parsers/tasm/tests/Makefile.inc + +include modules/parsers/tasm/tests/Makefile.inc diff --git a/modules/parsers/tasm/tests/Makefile.inc b/modules/parsers/tasm/tests/Makefile.inc new file mode 100644 index 00000000..64dececf --- /dev/null +++ b/modules/parsers/tasm/tests/Makefile.inc @@ -0,0 +1,46 @@ +# $Id: Makefile.inc 2063 2008-04-12 08:30:22Z peter $ + +TESTS += modules/parsers/tasm/tests/tasm_test.sh + +EXTRA_DIST += modules/parsers/tasm/tests/tasm_test.sh +EXTRA_DIST += modules/parsers/tasm/tests/array.asm +EXTRA_DIST += modules/parsers/tasm/tests/array.hex +EXTRA_DIST += modules/parsers/tasm/tests/case.asm +EXTRA_DIST += modules/parsers/tasm/tests/case.hex +EXTRA_DIST += modules/parsers/tasm/tests/charstr.asm +EXTRA_DIST += modules/parsers/tasm/tests/charstr.hex +EXTRA_DIST += modules/parsers/tasm/tests/dup.asm +EXTRA_DIST += modules/parsers/tasm/tests/dup.hex +EXTRA_DIST += modules/parsers/tasm/tests/equal.asm +EXTRA_DIST += modules/parsers/tasm/tests/equal.hex +EXTRA_DIST += modules/parsers/tasm/tests/expr.asm +EXTRA_DIST += modules/parsers/tasm/tests/expr.hex +EXTRA_DIST += modules/parsers/tasm/tests/irp.asm +EXTRA_DIST += modules/parsers/tasm/tests/irp.hex +EXTRA_DIST += modules/parsers/tasm/tests/label.asm +EXTRA_DIST += modules/parsers/tasm/tests/label.hex +EXTRA_DIST += modules/parsers/tasm/tests/les.asm +EXTRA_DIST += modules/parsers/tasm/tests/les.hex +EXTRA_DIST += modules/parsers/tasm/tests/lidt.asm +EXTRA_DIST += modules/parsers/tasm/tests/lidt.hex +EXTRA_DIST += modules/parsers/tasm/tests/macro.asm +EXTRA_DIST += modules/parsers/tasm/tests/macro.hex +EXTRA_DIST += modules/parsers/tasm/tests/offset.asm +EXTRA_DIST += modules/parsers/tasm/tests/offset.hex +EXTRA_DIST += modules/parsers/tasm/tests/quote.asm +EXTRA_DIST += modules/parsers/tasm/tests/quote.hex +EXTRA_DIST += modules/parsers/tasm/tests/res.asm +EXTRA_DIST += modules/parsers/tasm/tests/res.errwarn +EXTRA_DIST += modules/parsers/tasm/tests/res.hex +EXTRA_DIST += modules/parsers/tasm/tests/segment.asm +EXTRA_DIST += modules/parsers/tasm/tests/segment.hex +EXTRA_DIST += modules/parsers/tasm/tests/size.asm +EXTRA_DIST += modules/parsers/tasm/tests/size.hex +EXTRA_DIST += modules/parsers/tasm/tests/struc.asm +EXTRA_DIST += modules/parsers/tasm/tests/struc.errwarn +EXTRA_DIST += modules/parsers/tasm/tests/struc.hex +EXTRA_DIST += modules/parsers/tasm/tests/ + +EXTRA_DIST += modules/parsers/tasm/tests/exe/Makefile.inc + +include modules/parsers/tasm/tests/exe/Makefile.inc diff --git a/modules/parsers/tasm/tests/array.asm b/modules/parsers/tasm/tests/array.asm new file mode 100644 index 00000000..44842678 --- /dev/null +++ b/modules/parsers/tasm/tests/array.asm @@ -0,0 +1,2 @@ +t db 0,1,2 +mov al,t[1] diff --git a/modules/parsers/tasm/tests/array.hex b/modules/parsers/tasm/tests/array.hex new file mode 100644 index 00000000..97758932 --- /dev/null +++ b/modules/parsers/tasm/tests/array.hex @@ -0,0 +1,6 @@ +00 +01 +02 +a0 +01 +00 diff --git a/modules/parsers/tasm/tests/case.asm b/modules/parsers/tasm/tests/case.asm new file mode 100644 index 00000000..1549d4bf --- /dev/null +++ b/modules/parsers/tasm/tests/case.asm @@ -0,0 +1,3 @@ +a db 0 +B dw A +c dw b diff --git a/modules/parsers/tasm/tests/case.hex b/modules/parsers/tasm/tests/case.hex new file mode 100644 index 00000000..e2092e09 --- /dev/null +++ b/modules/parsers/tasm/tests/case.hex @@ -0,0 +1,5 @@ +00 +00 +00 +01 +00 diff --git a/modules/parsers/tasm/tests/charstr.asm b/modules/parsers/tasm/tests/charstr.asm new file mode 100644 index 00000000..a753716c --- /dev/null +++ b/modules/parsers/tasm/tests/charstr.asm @@ -0,0 +1 @@ +mov eax,"1234" diff --git a/modules/parsers/tasm/tests/charstr.hex b/modules/parsers/tasm/tests/charstr.hex new file mode 100644 index 00000000..42deac41 --- /dev/null +++ b/modules/parsers/tasm/tests/charstr.hex @@ -0,0 +1,6 @@ +66 +b8 +34 +33 +32 +31 diff --git a/modules/parsers/tasm/tests/dup.asm b/modules/parsers/tasm/tests/dup.asm new file mode 100644 index 00000000..c19ea762 --- /dev/null +++ b/modules/parsers/tasm/tests/dup.asm @@ -0,0 +1 @@ +a db 10 dup(1) diff --git a/modules/parsers/tasm/tests/dup.hex b/modules/parsers/tasm/tests/dup.hex new file mode 100644 index 00000000..5a51766a --- /dev/null +++ b/modules/parsers/tasm/tests/dup.hex @@ -0,0 +1,10 @@ +01 +01 +01 +01 +01 +01 +01 +01 +01 +01 diff --git a/modules/parsers/tasm/tests/equal.asm b/modules/parsers/tasm/tests/equal.asm new file mode 100644 index 00000000..4b8919dc --- /dev/null +++ b/modules/parsers/tasm/tests/equal.asm @@ -0,0 +1 @@ +a = byte 1 diff --git a/modules/parsers/tasm/tests/equal.hex b/modules/parsers/tasm/tests/equal.hex new file mode 100644 index 00000000..e69de29b diff --git a/modules/parsers/tasm/tests/exe/Makefile.inc b/modules/parsers/tasm/tests/exe/Makefile.inc new file mode 100644 index 00000000..faed7f57 --- /dev/null +++ b/modules/parsers/tasm/tests/exe/Makefile.inc @@ -0,0 +1,8 @@ +# $Id: Makefile.inc 2063 2008-04-12 08:30:22Z peter $ + +TESTS += modules/parsers/tasm/tests/exe/tasm_exe_test.sh + +EXTRA_DIST += modules/parsers/tasm/tests/exe/tasm_exe_test.sh +EXTRA_DIST += modules/parsers/tasm/tests/exe/exe.asm +EXTRA_DIST += modules/parsers/tasm/tests/exe/exe.hex + diff --git a/modules/parsers/tasm/tests/exe/exe.asm b/modules/parsers/tasm/tests/exe/exe.asm new file mode 100644 index 00000000..f040a1cf --- /dev/null +++ b/modules/parsers/tasm/tests/exe/exe.asm @@ -0,0 +1,4 @@ +a db 1 +start proc +int 22 +start endp diff --git a/modules/parsers/tasm/tests/exe/exe.hex b/modules/parsers/tasm/tests/exe/exe.hex new file mode 100644 index 00000000..4547fbc7 --- /dev/null +++ b/modules/parsers/tasm/tests/exe/exe.hex @@ -0,0 +1,515 @@ +4d +5a +03 +00 +02 +00 +00 +00 +20 +00 +00 +00 +ff +ff +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +22 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +cd +16 diff --git a/modules/parsers/tasm/tests/exe/tasm_exe_test.sh b/modules/parsers/tasm/tests/exe/tasm_exe_test.sh new file mode 100755 index 00000000..47645e3e --- /dev/null +++ b/modules/parsers/tasm/tests/exe/tasm_exe_test.sh @@ -0,0 +1,4 @@ +#! /bin/sh +# $Id: tasm_test.sh 1137 2004-09-04 01:24:57Z peter $ +${srcdir}/out_test.sh tasm_test modules/parsers/tasm/tests/exe "tasm-compat parser" "-f dosexe -p tasm" "" +exit $? diff --git a/modules/parsers/tasm/tests/expr.asm b/modules/parsers/tasm/tests/expr.asm new file mode 100644 index 00000000..53198852 --- /dev/null +++ b/modules/parsers/tasm/tests/expr.asm @@ -0,0 +1 @@ +a db low ((1 shl 2) and (16 shr 2) or (high 0x5034)) diff --git a/modules/parsers/tasm/tests/expr.hex b/modules/parsers/tasm/tests/expr.hex new file mode 100644 index 00000000..d3c4f66b --- /dev/null +++ b/modules/parsers/tasm/tests/expr.hex @@ -0,0 +1 @@ +54 diff --git a/modules/parsers/tasm/tests/irp.asm b/modules/parsers/tasm/tests/irp.asm new file mode 100644 index 00000000..d24cd29f --- /dev/null +++ b/modules/parsers/tasm/tests/irp.asm @@ -0,0 +1,3 @@ +irp i,<1,2,3> + mov ax,i +endm diff --git a/modules/parsers/tasm/tests/irp.hex b/modules/parsers/tasm/tests/irp.hex new file mode 100644 index 00000000..7bf091db --- /dev/null +++ b/modules/parsers/tasm/tests/irp.hex @@ -0,0 +1,9 @@ +b8 +01 +00 +b8 +02 +00 +b8 +03 +00 diff --git a/modules/parsers/tasm/tests/label.asm b/modules/parsers/tasm/tests/label.asm new file mode 100644 index 00000000..ff72ba3e --- /dev/null +++ b/modules/parsers/tasm/tests/label.asm @@ -0,0 +1,2 @@ +a label byte +mov ax,offset a diff --git a/modules/parsers/tasm/tests/label.hex b/modules/parsers/tasm/tests/label.hex new file mode 100644 index 00000000..b74f90bd --- /dev/null +++ b/modules/parsers/tasm/tests/label.hex @@ -0,0 +1,3 @@ +b8 +00 +00 diff --git a/modules/parsers/tasm/tests/les.asm b/modules/parsers/tasm/tests/les.asm new file mode 100644 index 00000000..bbcfd90a --- /dev/null +++ b/modules/parsers/tasm/tests/les.asm @@ -0,0 +1,2 @@ +a db 1 +les ax,a diff --git a/modules/parsers/tasm/tests/les.hex b/modules/parsers/tasm/tests/les.hex new file mode 100644 index 00000000..032eee74 --- /dev/null +++ b/modules/parsers/tasm/tests/les.hex @@ -0,0 +1,5 @@ +01 +c4 +06 +00 +00 diff --git a/modules/parsers/tasm/tests/lidt.asm b/modules/parsers/tasm/tests/lidt.asm new file mode 100644 index 00000000..11cf0c6a --- /dev/null +++ b/modules/parsers/tasm/tests/lidt.asm @@ -0,0 +1,3 @@ +idtr dw 0 + dd 0 +lidt fword ptr idtr diff --git a/modules/parsers/tasm/tests/lidt.hex b/modules/parsers/tasm/tests/lidt.hex new file mode 100644 index 00000000..97fb3b73 --- /dev/null +++ b/modules/parsers/tasm/tests/lidt.hex @@ -0,0 +1,11 @@ +00 +00 +00 +00 +00 +00 +0f +01 +1e +00 +00 diff --git a/modules/parsers/tasm/tests/macro.asm b/modules/parsers/tasm/tests/macro.asm new file mode 100644 index 00000000..75902391 --- /dev/null +++ b/modules/parsers/tasm/tests/macro.asm @@ -0,0 +1,6 @@ +a macro reg,i + mov reg,i + endm + +a ax,0 +a bx,1 diff --git a/modules/parsers/tasm/tests/macro.hex b/modules/parsers/tasm/tests/macro.hex new file mode 100644 index 00000000..92b4e4ae --- /dev/null +++ b/modules/parsers/tasm/tests/macro.hex @@ -0,0 +1,6 @@ +b8 +00 +00 +bb +01 +00 diff --git a/modules/parsers/tasm/tests/offset.asm b/modules/parsers/tasm/tests/offset.asm new file mode 100644 index 00000000..417fd2c3 --- /dev/null +++ b/modules/parsers/tasm/tests/offset.asm @@ -0,0 +1,3 @@ +a db 1 +mov ax,offset a +mov ax,offset[a] diff --git a/modules/parsers/tasm/tests/offset.hex b/modules/parsers/tasm/tests/offset.hex new file mode 100644 index 00000000..3def1cf9 --- /dev/null +++ b/modules/parsers/tasm/tests/offset.hex @@ -0,0 +1,7 @@ +01 +b8 +00 +00 +b8 +00 +00 diff --git a/modules/parsers/tasm/tests/quote.asm b/modules/parsers/tasm/tests/quote.asm new file mode 100644 index 00000000..a269ba37 --- /dev/null +++ b/modules/parsers/tasm/tests/quote.asm @@ -0,0 +1,2 @@ +a db 'don''t' +b db """" diff --git a/modules/parsers/tasm/tests/quote.hex b/modules/parsers/tasm/tests/quote.hex new file mode 100644 index 00000000..eb41f7b4 --- /dev/null +++ b/modules/parsers/tasm/tests/quote.hex @@ -0,0 +1,6 @@ +64 +6f +6e +27 +74 +22 diff --git a/modules/parsers/tasm/tests/res.asm b/modules/parsers/tasm/tests/res.asm new file mode 100644 index 00000000..8cf0829a --- /dev/null +++ b/modules/parsers/tasm/tests/res.asm @@ -0,0 +1,2 @@ +a db ? +b db 2 dup (?) diff --git a/modules/parsers/tasm/tests/res.errwarn b/modules/parsers/tasm/tests/res.errwarn new file mode 100644 index 00000000..490e1ad7 --- /dev/null +++ b/modules/parsers/tasm/tests/res.errwarn @@ -0,0 +1,2 @@ +-:1: warning: uninitialized space declared in code/data section: zeroing +-:2: warning: uninitialized space declared in code/data section: zeroing diff --git a/modules/parsers/tasm/tests/res.hex b/modules/parsers/tasm/tests/res.hex new file mode 100644 index 00000000..47f99ba3 --- /dev/null +++ b/modules/parsers/tasm/tests/res.hex @@ -0,0 +1,3 @@ +00 +00 +00 diff --git a/modules/parsers/tasm/tests/segment.asm b/modules/parsers/tasm/tests/segment.asm new file mode 100644 index 00000000..f0563ebd --- /dev/null +++ b/modules/parsers/tasm/tests/segment.asm @@ -0,0 +1,8 @@ +data segment + a db 0 +data ends + +assume es:data +code segment + mov byte ptr [a],1 +code ends diff --git a/modules/parsers/tasm/tests/segment.hex b/modules/parsers/tasm/tests/segment.hex new file mode 100644 index 00000000..667a69b2 --- /dev/null +++ b/modules/parsers/tasm/tests/segment.hex @@ -0,0 +1,7 @@ +00 +26 +c6 +06 +00 +00 +01 diff --git a/modules/parsers/tasm/tests/size.asm b/modules/parsers/tasm/tests/size.asm new file mode 100644 index 00000000..405cc407 --- /dev/null +++ b/modules/parsers/tasm/tests/size.asm @@ -0,0 +1,2 @@ +a db 0 +mov a,1 diff --git a/modules/parsers/tasm/tests/size.hex b/modules/parsers/tasm/tests/size.hex new file mode 100644 index 00000000..401266a1 --- /dev/null +++ b/modules/parsers/tasm/tests/size.hex @@ -0,0 +1,6 @@ +00 +c6 +06 +00 +00 +01 diff --git a/modules/parsers/tasm/tests/struc.asm b/modules/parsers/tasm/tests/struc.asm new file mode 100644 index 00000000..5a88b615 --- /dev/null +++ b/modules/parsers/tasm/tests/struc.asm @@ -0,0 +1,8 @@ +s struc + a db ? + b db ? +s ends + +v s <1,?> + +mov al,[v].b diff --git a/modules/parsers/tasm/tests/struc.errwarn b/modules/parsers/tasm/tests/struc.errwarn new file mode 100644 index 00000000..4e188892 --- /dev/null +++ b/modules/parsers/tasm/tests/struc.errwarn @@ -0,0 +1 @@ +-:6: warning: uninitialized space declared in code/data section: zeroing diff --git a/modules/parsers/tasm/tests/struc.hex b/modules/parsers/tasm/tests/struc.hex new file mode 100644 index 00000000..d2ad9563 --- /dev/null +++ b/modules/parsers/tasm/tests/struc.hex @@ -0,0 +1,5 @@ +01 +00 +a0 +01 +00 diff --git a/modules/parsers/tasm/tests/tasm_test.sh b/modules/parsers/tasm/tests/tasm_test.sh new file mode 100755 index 00000000..531e03e8 --- /dev/null +++ b/modules/parsers/tasm/tests/tasm_test.sh @@ -0,0 +1,4 @@ +#! /bin/sh +# $Id: tasm_test.sh 1137 2004-09-04 01:24:57Z peter $ +${srcdir}/out_test.sh tasm_test modules/parsers/tasm/tests "tasm-compat parser" "-f bin -p tasm" "" +exit $? diff --git a/modules/preprocs/nasm/Makefile.inc b/modules/preprocs/nasm/Makefile.inc index f9aa9d5e..922b887c 100644 --- a/modules/preprocs/nasm/Makefile.inc +++ b/modules/preprocs/nasm/Makefile.inc @@ -9,7 +9,7 @@ libyasm_a_SOURCES += modules/preprocs/nasm/nasmlib.c libyasm_a_SOURCES += modules/preprocs/nasm/nasm-eval.h libyasm_a_SOURCES += modules/preprocs/nasm/nasm-eval.c -YASM_MODULES += preproc_nasm +YASM_MODULES += preproc_nasm preproc_tasm $(top_srcdir)/modules/preprocs/nasm/nasm-preproc.c: nasm-version.c diff --git a/modules/preprocs/nasm/nasm-pp.c b/modules/preprocs/nasm/nasm-pp.c index 2d5e7d21..3f6e2961 100644 --- a/modules/preprocs/nasm/nasm-pp.c +++ b/modules/preprocs/nasm/nasm-pp.c @@ -324,7 +324,9 @@ static int is_condition(int arg) enum { TM_ARG, TM_ELIF, TM_ELSE, TM_ENDIF, TM_IF, TM_IFDEF, TM_IFDIFI, - TM_IFNDEF, TM_INCLUDE, TM_LOCAL + TM_IFNDEF, TM_INCLUDE, TM_LOCAL, + TM_REPT, TM_IRP, TM_MACRO, + TM_STRUC, TM_SEGMENT }; static const char *tasm_directives[] = { @@ -393,10 +395,53 @@ static const char *tasm_compat_macros[] = { "%idefine IDEAL", "%idefine JUMPS", - "%idefine P386", - "%idefine P486", - "%idefine P586", "%idefine END", + "%idefine P8086 CPU 8086", + "%idefine P186 CPU 186", + "%idefine P286 CPU 286", + "%idefine P286N CPU 286", + "%idefine P286P CPU 286 Priv", + "%idefine P386 CPU 386", + "%idefine P386N CPU 386", + "%idefine P386P CPU 386 Priv", + "%idefine P486 CPU 486", + "%idefine P586 CPU 586", + "%idefine .8086 CPU 8086", + "%idefine .186 CPU 186", + "%idefine .286 CPU 286", + "%idefine .286C CPU 286", + "%idefine .286P CPU 286", + "%idefine .386 CPU 386", + "%idefine .386C CPU 386", + "%idefine .386P CPU 386", + "%idefine .486 CPU 486", + "%idefine .486C CPU 486", + "%idefine .486P CPU 486", + "%idefine .586 CPU 586", + "%idefine .586C CPU 586", + "%idefine .586P CPU 586", + "", + "%imacro TITLE 1", + "%endm", + "%imacro NAME 1", + "%endm", + "", + "%imacro EXTRN 1-*.nolist", + "%rep %0", + "[extern %1]", + "%rotate 1", + "%endrep", + "%endmacro", + "", + "%imacro PUBLIC 1-*.nolist", + "%rep %0", + "[global %1]", + "%rotate 1", + "%endrep", + "%endmacro", + "", + "; this is not needed", + "%idefine PTR", NULL }; @@ -428,6 +473,7 @@ static void delete_Blocks(void); static Token *new_Token(Token * next, int type, const char *text, size_t txtlen); static Token *delete_Token(Token * t); +static Token *tokenise(char *line); /* * Macros for safe checking of token pointers, avoid *(NULL) @@ -442,69 +488,555 @@ static Token *delete_Token(Token * t); * place to do it for the moment, and it is a hack (ideally it would * be nice to be able to use the NASM pre-processor to do it). */ + +typedef struct TMEndItem { + int type; + void *data; + struct TMEndItem *next; +} TMEndItem; + +static TMEndItem *EndmStack = NULL, *EndsStack = NULL; + +char **TMParameters; + +struct TStrucField { + char *name; + char *type; + struct TStrucField *next; +}; +struct TStruc { + char *name; + struct TStrucField *fields, *lastField; + struct TStruc *next; +}; +static struct TStruc *TStrucs = NULL; +static int inTstruc = 0; + +struct TSegmentAssume { + char *segreg; + char *segment; +}; +struct TSegmentAssume *TAssumes; + +const char *tasm_get_segment_register(const char *segment) +{ + struct TSegmentAssume *assume; + if (!TAssumes) + return NULL; + for (assume = TAssumes; assume->segreg; assume++) { + if (!strcmp(assume->segment, segment)) + break; + } + return assume->segreg; +} + static char * check_tasm_directive(char *line) { int i, j, k, m; - size_t len; - char *p = line, *oldline, oldchar; + size_t len, len2; + char *p, *oldline, oldchar, *q, oldchar2; + TMEndItem *end; + + if ((p = strchr(line, ';'))) + *p = '\0'; + + p = line; /* Skip whitespace */ while (isspace(*p) && *p != 0) p++; + /* Ignore nasm directives */ + if (*p == '%') + return line; + /* Binary search for the directive name */ - i = -1; - j = elements(tasm_directives); len = 0; while (!isspace(p[len]) && p[len] != 0) len++; - if (len) + if (!len) + return line; + + oldchar = p[len]; + p[len] = 0; + i = -1; + j = elements(tasm_directives); + while (j - i > 1) { - oldchar = p[len]; - p[len] = 0; - while (j - i > 1) + k = (j + i) / 2; + m = nasm_stricmp(p, tasm_directives[k]); + if (m == 0) { - k = (j + i) / 2; - m = nasm_stricmp(p, tasm_directives[k]); - if (m == 0) + /* We have found a directive, so jam a % in front of it + * so that NASM will then recognise it as one if it's own. + */ + p[len] = oldchar; + len = strlen(p); + oldline = line; + if (k == TM_IFDIFI) { - /* We have found a directive, so jam a % in front of it - * so that NASM will then recognise it as one if it's own. + /* NASM does not recognise IFDIFI, so we convert it to + * %ifdef BOGUS. This is not used in NASM comaptible + * code, but does need to parse for the TASM macro + * package. */ - p[len] = oldchar; + line = nasm_malloc(13); + strcpy(line, "%ifdef BOGUS"); + } + else if (k == TM_INCLUDE) + { + /* add double quotes around file name */ + p += 7 + 1; + while (isspace(*p) && *p) + p++; len = strlen(p); - oldline = line; + line = nasm_malloc(1 + 7 + 1 + 1 + len + 1 + 1); + sprintf(line, "%%include \"%s\"", p); + } + else + { line = nasm_malloc(len + 2); line[0] = '%'; - if (k == TM_IFDIFI) - { - /* NASM does not recognise IFDIFI, so we convert it to - * %ifdef BOGUS. This is not used in NASM comaptible - * code, but does need to parse for the TASM macro - * package. - */ - strcpy(line + 1, "ifdef BOGUS"); + memcpy(line + 1, p, len + 1); + } + nasm_free(oldline); + return line; + } + else if (m < 0) + { + j = k; + } + else + i = k; + } + + /* Not a simple directive */ + + if (!nasm_stricmp(p, "endm")) { + /* handle end of endm directive */ + char **parameter; + end = EndmStack; + /* undef parameters */ + if (!end) { + error(ERR_FATAL, "ENDM: not in an endm context"); + return line; + } + EndmStack = EndmStack->next; + nasm_free(line); + switch (end->type) { + case TM_MACRO: + len = 0; + for (parameter = end->data; *parameter; parameter++) + len += 6 + 1 + strlen(*parameter) + 1; + len += 5 + 1; + line = nasm_malloc(len); + p = line; + for (parameter = end->data; *parameter; parameter++) { + p += sprintf(p, "%%undef %s\n", *parameter); + nasm_free(*parameter); + } + nasm_free(end->data); + nasm_free(end); + sprintf(p, "%%endm"); + return line; + case TM_REPT: + nasm_free(end); + return nasm_strdup("%endrep"); + case TM_IRP: { + char **data; + const char *irp_format = + "%%undef %s\n" + "%%rotate 1\n" + "%%endrep\n" + "%%endm\n" + "irp %s\n" + "%%undef irp"; + data = end->data; + line = nasm_malloc(strlen(irp_format) - 4 + strlen(data[0]) + + strlen(data[1])); + sprintf(line, irp_format, data[0], data[1]); + nasm_free(data[0]); + nasm_free(data[1]); + nasm_free(data); + return line; + } + default: + error(ERR_FATAL, "ENDM: bogus endm context type %d\n",end->type); + return NULL; + } + } else if (!nasm_stricmp(p, "end")) { + nasm_free(line); + return strdup(""); + } else if (!nasm_stricmp(p, "rept")) { + /* handle repeat directive */ + end = nasm_malloc(sizeof(*end)); + end->type = TM_REPT; + end->next = EndmStack; + EndmStack = end; + memcpy(p, "%rep", 4); + p[len] = oldchar; + return line; + } else if (!nasm_stricmp(p, "locals")) { + tasm_locals = 1; + nasm_free(line); + return strdup(""); + } + + if (!oldchar) + return line; + + /* handle two-words directives */ + q = p + len + 1; + /* Skip whitespaces */ + while (isspace(*q) && *q) + q++; + + len2 = 0; + while (!isspace(q[len2]) && q[len2]!=',' && q[len2] != 0) + len2++; + oldchar2 = q[len2]; + q[len2] = '\0'; + + if (!nasm_stricmp(p, "irp")) { + /* handle indefinite repeat directive */ + const char *irp_format = + "%%imacro irp 0-*\n" + "%%rep %%0\n" + "%%define %s %%1\n"; + char **data; + + data = malloc(2*sizeof(char*)); + oldline = line; + line = nasm_malloc(strlen(irp_format) - 2 + len2 + 1); + sprintf(line,irp_format,q); + data[0] = nasm_strdup(q); + + if (!oldchar2) + error(ERR_FATAL, "%s: expected ", q + len2); + p = strchr(q + len2 + 1, '<'); + if (!p) + error(ERR_FATAL, "%s: expected ", q + len2); + p++; + q = strchr(p, '>'); + data[1] = nasm_strndup(p, q - p); + + end = nasm_malloc(sizeof(*end)); + end->type = TM_IRP; + end->next = EndmStack; + end->data = data; + EndmStack = end; + + nasm_free(oldline); + return line; + } else if (!nasm_stricmp(q, "macro")) { + char *name = p; + /* handle MACRO */ + /* count parameters */ + j = 1; + i = 0; + TMParameters = nasm_malloc(j*sizeof(*TMParameters)); + len = 0; + p = q + len2 + 1; + /* Skip whitespaces */ + while (isspace(*p) && *p) + p++; + while (*p) { + /* Get parameter name */ + for (q = p; !isspace(*q) && *q != ',' && *q; q++); + len2 = q-p; + if (len2 == 0) + error(ERR_FATAL, "'%s': expected parameter name", p); + TMParameters[i] = nasm_malloc(len2 + 1); + memcpy(TMParameters[i], p, len2); + TMParameters[i][len2] = '\0'; + len += len2; + i++; + if (i + 1 > j) { + j *= 2; + TMParameters = nasm_realloc(TMParameters, + j*sizeof(*TMParameters)); + } + if (i == 1000) + error(ERR_FATAL, "too many parameters for macro %s", name); + p = q; + while (isspace(*p) && *p) + p++; + if (!*p) + break; + if (*p != ',') + error(ERR_FATAL, "expected comma"); + p++; + while (isspace(*p) && *p) + p++; + } + TMParameters[i] = NULL; + TMParameters = nasm_realloc(TMParameters, + (i+1)*sizeof(*TMParameters)); + len += 1 + 6 + 1 + strlen(name) + 1 + 3; /* macro definition */ + len += i * (1 + 9 + 1 + 1 + 1 + 3 + 2); /* macro parameter definition */ + oldline = line; + p = line = nasm_malloc(len + 1); + p += sprintf(p, "%%imacro %s 0-*", name); + nasm_free(oldline); + for (j = 0; TMParameters[j]; j++) { + p += sprintf(p, "\n%%idefine %s %%{%-u}", TMParameters[j], j + 1); + } + end = nasm_malloc(sizeof(*end)); + end->type = TM_MACRO; + end->next = EndmStack; + end->data = TMParameters; + EndmStack = end; + return line; + } else if (!nasm_stricmp(q, "proc")) { + /* handle PROC */ + oldline = line; + line = nasm_malloc(2 + len + 1); + sprintf(line, "..%s",p); + nasm_free(oldline); + return line; + } else if (!nasm_stricmp(q, "struc")) { + /* handle struc */ + struct TStruc *struc; + if (inTstruc) { + error(ERR_FATAL, "STRUC: already in a struc context"); + return line; + } + oldline = line; + line = nasm_malloc(5 + 1 + len + 1); + sprintf(line, "struc %s", p); + struc = malloc(sizeof(*struc)); + struc->name = strdup(p); + struc->fields = NULL; + struc->lastField = NULL; + struc->next = TStrucs; + TStrucs = struc; + inTstruc = 1; + nasm_free(oldline); + end = nasm_malloc(sizeof(*end)); + end->type = TM_STRUC; + end->next = EndsStack; + EndsStack = end; + return line; + } else if (!nasm_stricmp(q, "segment")) { + /* handle SEGMENT */ + oldline = line; + line = strdup(oldchar2?q+len2+1:""); + if (tasm_segment) { + error(ERR_FATAL, "SEGMENT: already in a segment context"); + return line; + } + tasm_segment = strdup(p); + nasm_free(oldline); + end = nasm_malloc(sizeof(*end)); + end->type = TM_SEGMENT; + end->next = EndsStack; + EndsStack = end; + return line; + } else if (!nasm_stricmp(p, "ends") || !nasm_stricmp(q, "ends")) { + /* handle end of ends directive */ + end = EndsStack; + /* undef parameters */ + if (!end) { + error(ERR_FATAL, "ENDS: not in an ends context"); + return line; + } + EndsStack = EndsStack->next; + nasm_free(line); + switch (end->type) { + case TM_STRUC: + inTstruc = 0; + return strdup("endstruc"); + case TM_SEGMENT: + /* XXX: yes, we leak memory here, but that permits labels + * to avoid strduping... */ + tasm_segment = NULL; + return strdup(""); + default: + error(ERR_FATAL, "ENDS: bogus ends context type %d",end->type); + return NULL; + } + } else if (!nasm_stricmp(p, "endp") || !nasm_stricmp(q, "endp")) { + nasm_free(line); + return strdup(""); + } else if (!nasm_stricmp(p, "assume")) { + struct TSegmentAssume *assume; + /* handle ASSUME */ + if (!TAssumes) { + TAssumes = nasm_malloc(sizeof(*TAssumes)); + TAssumes[0].segreg = NULL; + } + i = 0; + q[len2] = oldchar2; + /* Skip whitespaces */ + while (isspace(*q) && *q) + q++; + while (*q) { + p = q; + for (; *q && *q != ':' && !isspace(*q); q++); + if (!*q) + break; + /* segment register name */ + for (assume = TAssumes; assume->segreg; assume++) + if (strlen(assume->segreg) == q-p && + !strncasecmp(assume->segreg, p, q-p)) + break; + if (!assume->segreg) { + i = assume - TAssumes + 1; + TAssumes = nasm_realloc(TAssumes, (i+1)*sizeof(*TAssumes)); + assume = TAssumes + i - 1; + assume->segreg = nasm_strndup(p, q-p); + assume[1].segreg = NULL; + } + for (; *q && *q != ':' && isspace(*q); q++); + if (*q != ':') + error(ERR_FATAL, "expected `:' instead of `%c'", *q); + for (q++; *q && isspace(*q); q++); + + /* segment name */ + p = q; + for (; *q && *q != ',' && !isspace(*q); q++); + assume->segment = nasm_strndup(p, q-p); + for (; *q && isspace(*q); q++); + if (*q && *q != ',') + error(ERR_FATAL, "expected `,' instead of `%c'", *q); + + for (q++; *q && isspace(*q); q++); + } + TAssumes[i].segreg = NULL; + TAssumes = nasm_realloc(TAssumes, (i+1)*sizeof(*TAssumes)); + nasm_free(line); + return strdup(""); + } else if (inTstruc) { + struct TStrucField *field; + /* TODO: handle unnamed data */ + field = nasm_malloc(sizeof(*field)); + field->name = strdup(p); + /* TODO: type struc ! */ + field->type = strdup(q); + field->next = NULL; + if (!TStrucs->fields) + TStrucs->fields = field; + else if (TStrucs->lastField) + TStrucs->lastField->next = field; + TStrucs->lastField = field; + if (!oldchar2) { + error(ERR_FATAL, "Expected struc field initializer after %s %s", p, q); + return line; + } + oldline = line; + line = nasm_malloc(1 + len + 1 + len2 + 1 + strlen(q+len2+1) + 1); + sprintf(line, ".%s %s %s", p, q, q+len2+1); + nasm_free(oldline); + return line; + } + { + struct TStruc *struc; + for (struc = TStrucs; struc; struc = struc->next) { + if (!strcasecmp(q, struc->name)) { + char *r = q + len2 + 1, *s, *t, tasm_param[6]; + struct TStrucField *field = struc->fields; + int size, n, m; + if (!oldchar2) { + error(ERR_FATAL, "Expected struc field initializer after %s %s", p, q); + return line; } - else - { - memcpy(line + 1, p, len + 1); + r = strchr(r, '<'); + if (!r) { + error(ERR_FATAL, "Expected < for struc field initializer in %s %s %s", p, q, r); + return line; } + t = strchr(r + 1, '>'); + if (!t) { + error(ERR_FATAL, "Expected > for struc field initializer in %s %s %s", p, q, r); + return line; + } + *t = 0; + oldline = line; + size = len + len2 + 128; + line = nasm_malloc(size); + if (defining) + for (n=0;TMParameters[n];n++) + if (!strcmp(TMParameters[n],p)) { + sprintf(tasm_param,"%%{%d}",n+1); + p = tasm_param; + break; + } + n = sprintf(line, "%s: istruc %s\n", p, q); + /* use initialisers */ + while ((s = strchr(r + 1, ','))) { + if (!field) { + error(ERR_FATAL, "Too many initializers in structure %s %s", p, q); + return oldline; + } + *s = 0; + while (1) { + m = snprintf(line + n, size - n, "%s.%s: at .%s, %s %s\n", p, field->name, field->name, field->type, r + 1); + if (m + 1 <= size - n) + break; + size *= 2; + line = nasm_realloc(line, size); + } + n += m; + r = s; + field = field->next; + } + /* complete with last initializer and '?' */ + while(field) { + while (1) { + m = snprintf(line + n, size - n, "%s.%s: at .%s, %s %s\n", p, field->name, field->name, field->type, r ? r + 1: "?"); + if (m + 1 <= size - n) + break; + size *= 2; + line = nasm_realloc(line, size); + } + n += m; + r = NULL; + field = field->next; + } + line = nasm_realloc(line, n + 5); + sprintf(line + n, "iend"); nasm_free(oldline); return line; } - else if (m < 0) - { - j = k; - } - else - i = k; } - p[len] = oldchar; } + + q[len2] = oldchar2; + p[len] = oldchar; + return line; } +Token * tasm_join_tokens(Token *tline) +{ + Token *t, *prev, *next; + for (prev = NULL, t = tline; t; prev = t, t = next) { + next = t->next; + if (t->type == TOK_OTHER && !strcmp(t->text,"&")) { + if (!prev) + error(ERR_FATAL, "no token before &"); + else if (!next) + error(ERR_FATAL, "no token after &"); + else if (prev->type != next->type) + error(ERR_FATAL, "can't handle different types of token around &"); + else if (!prev->text || !next->text) + error(ERR_FATAL, "can't handle empty token around &"); + else { + int lenp = strlen(prev->text); + int lenn = strlen(next->text); + prev->text = nasm_realloc(prev->text, lenp + lenn + 1); + strncpy(prev->text + lenp, next->text, lenn + 1); + (void) delete_Token(t); + prev->next = delete_Token(next); + t = prev; + next = t->next; + } + } + } + return tline; +} + /* * The pre-preprocessing stage... This function translates line * number indications as they emerge from GNU cpp (`# lineno "file" @@ -517,6 +1049,8 @@ prepreproc(char *line) int lineno; size_t fnlen; char *fname, *oldline; + char *c, *d, *ret; + Line *l, **lp; if (line[0] == '#' && line[1] == ' ') { @@ -532,8 +1066,30 @@ prepreproc(char *line) nasm_free(oldline); } if (tasm_compatible_mode) - return check_tasm_directive(line); - return line; + line = check_tasm_directive(line); + + if (!(c = strchr(line, '\n'))) + return line; + + /* Turn multiline macros into several lines */ + *c = '\0'; + ret = nasm_strdup(line); + + lp = &istk->expansion; + do { + d = strchr(c+1, '\n'); + if (d) + *d = '\0'; + l = malloc(sizeof(*l)); + l -> first = tokenise(c+1); + l -> finishes = NULL; + l -> next = *lp; + *lp = l; + c = d; + lp = &l -> next; + } while (c); + nasm_free(line); + return ret; } /* @@ -1231,7 +1787,7 @@ static FILE * inc_fopen(char *file, char **newname) { FILE *fp; - char *combine = NULL; + char *combine = NULL, *c; char *pb, *p1, *p2, *file2 = NULL; /* Try to expand all %ENVVAR% in filename. Warn, and leave %string% @@ -1281,6 +1837,27 @@ inc_fopen(char *file, char **newname) fp = yasm_fopen_include(file2 ? file2 : file, nasm_src_get_fname(), "r", &combine); + if (!fp && tasm_compatible_mode) + { + char *thefile = file2 ? file2 : file; + /* try a few case combinations */ + do { + for (c = thefile; *c; c++) + *c = toupper(*c); + fp = yasm_fopen_include(thefile, nasm_src_get_fname(), "r", &combine); + if (fp) break; + *thefile = tolower(*thefile); + fp = yasm_fopen_include(thefile, nasm_src_get_fname(), "r", &combine); + if (fp) break; + for (c = thefile; *c; c++) + *c = tolower(*c); + fp = yasm_fopen_include(thefile, nasm_src_get_fname(), "r", &combine); + if (fp) break; + *thefile = toupper(*thefile); + fp = yasm_fopen_include(thefile, nasm_src_get_fname(), "r", &combine); + if (fp) break; + } while (0); + } if (!fp) error(ERR_FATAL, "unable to open include file `%s'", file2 ? file2 : file); @@ -4420,6 +4997,9 @@ pp_getline(void) /* * De-tokenise the line again, and emit it. */ + if (tasm_compatible_mode) + tline = tasm_join_tokens(tline); + line = detoken(tline, TRUE); free_tlist(tline); break; diff --git a/modules/preprocs/nasm/nasm-preproc.c b/modules/preprocs/nasm/nasm-preproc.c index bb4c7a74..fa2b91e7 100644 --- a/modules/preprocs/nasm/nasm-preproc.c +++ b/modules/preprocs/nasm/nasm-preproc.c @@ -47,6 +47,8 @@ yasm_symtab *nasm_symtab; static yasm_linemap *cur_lm; static yasm_errwarns *cur_errwarns; int tasm_compatible_mode = 0; +int tasm_locals; +const char *tasm_segment; #include "nasm-version.c" @@ -314,3 +316,25 @@ yasm_preproc_module yasm_nasm_LTX_preproc = { nasm_preproc_define_builtin, nasm_preproc_add_standard }; + +static yasm_preproc * +tasm_preproc_create(const char *in_filename, yasm_symtab *symtab, + yasm_linemap *lm, yasm_errwarns *errwarns) +{ + tasm_compatible_mode = 1; + return nasm_preproc_create(in_filename, symtab, lm, errwarns); +} + +yasm_preproc_module yasm_tasm_LTX_preproc = { + "Real TASM Preprocessor", + "tasm", + tasm_preproc_create, + nasm_preproc_destroy, + nasm_preproc_get_line, + nasm_preproc_get_included_file, + nasm_preproc_add_include_file, + nasm_preproc_predefine_macro, + nasm_preproc_undefine_macro, + nasm_preproc_define_builtin, + nasm_preproc_add_standard +}; diff --git a/modules/preprocs/nasm/nasm.h b/modules/preprocs/nasm/nasm.h index 792877b0..b3382ffe 100644 --- a/modules/preprocs/nasm/nasm.h +++ b/modules/preprocs/nasm/nasm.h @@ -276,5 +276,8 @@ enum { #define elements(x) ( sizeof(x) / sizeof(*(x)) ) extern int tasm_compatible_mode; +extern int tasm_locals; +extern const char *tasm_segment; +const char *tasm_get_segment_register(const char *segment); #endif From af8fcc98caddf5125ad965a18347df1578847a84 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 7 Oct 2008 05:43:29 +0000 Subject: [PATCH 219/585] Update Mkfiles (except for VC) for TASM build. svn path=/trunk/yasm/; revision=2131 --- Mkfiles/Makefile.dj | 17 +++++++++++++---- Mkfiles/Makefile.flat | 17 +++++++++++++---- Mkfiles/dj/config.h | 3 +++ Mkfiles/vc/config.h | 3 +++ 4 files changed, 32 insertions(+), 8 deletions(-) diff --git a/Mkfiles/Makefile.dj b/Mkfiles/Makefile.dj index ac10158e..451bfade 100644 --- a/Mkfiles/Makefile.dj +++ b/Mkfiles/Makefile.dj @@ -13,7 +13,7 @@ CFLAGS=-DHAVE_CONFIG_H -IMkfiles/dj -O -I. CC?=gcc BUILDCC?=$(CC) -all: yasm +all: yasm tasm LIBYASM_OBJS= \ libyasm/assocdat.o \ @@ -97,7 +97,7 @@ MODULES_OBJFMTS_OBJS= \ modules/objfmts/rdf/rdf-objfmt.o \ modules/objfmts/xdf/xdf-objfmt.o YASM_MODULES+=objfmt_dbg -YASM_MODULES+=objfmt_bin +YASM_MODULES+=objfmt_bin objfmt_dosexe YASM_MODULES+=objfmt_coff objfmt_win32 objfmt_win64 objfmt_x64 YASM_MODULES+=objfmt_elf objfmt_elf32 objfmt_elf64 YASM_MODULES+=objfmt_macho objfmt_macho32 objfmt_macho64 @@ -111,7 +111,7 @@ MODULES_PARSERS_OBJS= \ modules/parsers/gas/gas-parser.o \ modules/parsers/gas/gas-parse.o \ gas-token.o -YASM_MODULES+=parser_nasm +YASM_MODULES+=parser_nasm parser_tasm YASM_MODULES+=parser_gas parser_gnu MODULES_PREPROCS_NASM_OBJS= \ @@ -119,7 +119,7 @@ MODULES_PREPROCS_NASM_OBJS= \ modules/preprocs/nasm/nasm-pp.o \ modules/preprocs/nasm/nasm-preproc.o \ modules/preprocs/nasm/nasmlib.o -YASM_MODULES+=preproc_nasm +YASM_MODULES+=preproc_nasm preproc_tasm MODULES_PREPROCS_RAW_OBJS = \ modules/preprocs/raw/raw-preproc.o @@ -149,6 +149,12 @@ YASM_OBJS= \ $(LIBYASM_OBJS) \ $(MODULES_OBJS) +TASM_OBJS= \ + frontends/tasm/tasm.o \ + frontends/tasm/tasm-options.o \ + $(LIBYASM_OBJS) \ + $(MODULES_OBJS) + genstring: genstring.c $(BUILDCC) -o $@ $< @@ -243,6 +249,9 @@ genperf: $(GENPERF_SRCS) yasm: $(YASM_OBJS) $(CC) -o yasm $(YASM_OBJS) +tasm: $(TASM_OBJS) + $(CC) -o tasm $(TASM_OBJS) + .c.o: $(CC) -c $(CFLAGS) -o $@ $< diff --git a/Mkfiles/Makefile.flat b/Mkfiles/Makefile.flat index e9aec971..28cb7dcf 100644 --- a/Mkfiles/Makefile.flat +++ b/Mkfiles/Makefile.flat @@ -16,7 +16,7 @@ CFLAGS=-DHAVE_CONFIG_H -IMkfiles -I. CC?=gcc BUILDCC?=$(CC) -all: yasm +all: yasm tasm LIBYASM_OBJS= \ libyasm/assocdat.o \ @@ -100,7 +100,7 @@ MODULES_OBJFMTS_OBJS= \ modules/objfmts/rdf/rdf-objfmt.o \ modules/objfmts/xdf/xdf-objfmt.o YASM_MODULES+=objfmt_dbg -YASM_MODULES+=objfmt_bin +YASM_MODULES+=objfmt_bin objfmt_dosexe YASM_MODULES+=objfmt_coff objfmt_win32 objfmt_win64 objfmt_x64 YASM_MODULES+=objfmt_elf objfmt_elf32 objfmt_elf64 YASM_MODULES+=objfmt_macho objfmt_macho32 objfmt_macho64 @@ -114,7 +114,7 @@ MODULES_PARSERS_OBJS= \ modules/parsers/gas/gas-parser.o \ modules/parsers/gas/gas-parse.o \ gas-token.o -YASM_MODULES+=parser_nasm +YASM_MODULES+=parser_nasm parser_tasm YASM_MODULES+=parser_gas parser_gnu MODULES_PREPROCS_NASM_OBJS= \ @@ -122,7 +122,7 @@ MODULES_PREPROCS_NASM_OBJS= \ modules/preprocs/nasm/nasm-pp.o \ modules/preprocs/nasm/nasm-preproc.o \ modules/preprocs/nasm/nasmlib.o -YASM_MODULES+=preproc_nasm +YASM_MODULES+=preproc_nasm preproc_tasm MODULES_PREPROCS_RAW_OBJS = \ modules/preprocs/raw/raw-preproc.o @@ -152,6 +152,12 @@ YASM_OBJS= \ $(LIBYASM_OBJS) \ $(MODULES_OBJS) +TASM_OBJS= \ + frontends/tasm/tasm.o \ + frontends/tasm/tasm-options.o \ + $(LIBYASM_OBJS) \ + $(MODULES_OBJS) + genstring: genstring.c $(BUILDCC) -o $@ $< @@ -246,6 +252,9 @@ genperf: $(GENPERF_SRCS) yasm: $(YASM_OBJS) $(CC) -o yasm $(YASM_OBJS) +tasm: $(TASM_OBJS) + $(CC) -o tasm $(TASM_OBJS) + .c.o: $(CC) -c $(CFLAGS) -o $@ $< diff --git a/Mkfiles/dj/config.h b/Mkfiles/dj/config.h index 2ba19857..0ce8a3f0 100644 --- a/Mkfiles/dj/config.h +++ b/Mkfiles/dj/config.h @@ -31,6 +31,9 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_DIRECT_H */ +/* Define to 1 if you have the `ftruncate' function. */ +#define HAVE_FTRUNCATE 1 + /* Define to 1 if you have the `getcwd' function. */ #define HAVE_GETCWD 1 diff --git a/Mkfiles/vc/config.h b/Mkfiles/vc/config.h index 204f224e..1a7d9c03 100644 --- a/Mkfiles/vc/config.h +++ b/Mkfiles/vc/config.h @@ -31,6 +31,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_DIRECT_H 1 +/* Define to 1 if you have the `ftruncate' function. */ +/* #undef HAVE_FTRUNCATE */ + /* Define to 1 if you have the `getcwd' function. */ #define HAVE_GETCWD 1 From d810f45f7cb9f930780c46529b6d25fafec3e9d9 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 7 Oct 2008 05:47:08 +0000 Subject: [PATCH 220/585] Add CMakeLists.txt for tasm frontend. svn path=/trunk/yasm/; revision=2132 --- frontends/tasm/CMakeLists.txt | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 frontends/tasm/CMakeLists.txt diff --git a/frontends/tasm/CMakeLists.txt b/frontends/tasm/CMakeLists.txt new file mode 100644 index 00000000..e89d5aeb --- /dev/null +++ b/frontends/tasm/CMakeLists.txt @@ -0,0 +1,25 @@ +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) + +ADD_CUSTOM_COMMAND( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/license.c + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/frontends/yasm/genstring.py + license_msg + ${CMAKE_CURRENT_BINARY_DIR}/license.c + ${CMAKE_SOURCE_DIR}/COPYING + MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/COPYING + DEPENDS ${CMAKE_SOURCE_DIR}/frontends/yasm/genstring.py + ) + +SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}) + +ADD_EXECUTABLE(tasm + tasm.c + tasm-options.c + ) +TARGET_LINK_LIBRARIES(tasm libyasm ${LIBDL}) + +SET_SOURCE_FILES_PROPERTIES(tasm.c PROPERTIES + OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/license.c + ) + +INSTALL(TARGETS tasm RUNTIME DESTINATION bin) From 536542a69eea01f2a4208127c16a4238114e77e7 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 7 Oct 2008 05:59:29 +0000 Subject: [PATCH 221/585] Fix a number of warnings. svn path=/trunk/yasm/; revision=2133 --- libyasm/bc-data.c | 2 +- libyasm/intnum.c | 3 ++- modules/preprocs/nasm/nasm-pp.c | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/libyasm/bc-data.c b/libyasm/bc-data.c index bdbf7b6b..3191958b 100644 --- a/libyasm/bc-data.c +++ b/libyasm/bc-data.c @@ -166,7 +166,7 @@ bc_data_calc_len(yasm_bytecode *bc, yasm_bc_add_span_func add_span, bytecode_data *bc_data = (bytecode_data *)bc->contents; yasm_dataval *dv; yasm_intnum *intn; - int len; + unsigned long len = 0; unsigned long multiple; /* Count up element sizes, rounding up string length. */ diff --git a/libyasm/intnum.c b/libyasm/intnum.c index dab359ab..e39eb26f 100644 --- a/libyasm/intnum.c +++ b/libyasm/intnum.c @@ -261,6 +261,7 @@ yasm_intnum_create_charconst_tasm(const char *str) { yasm_intnum *intn = yasm_xmalloc(sizeof(yasm_intnum)); size_t len = strlen(str); + size_t i; if(len*8 > BITVECT_NATIVE_SIZE) yasm_error_set(YASM_ERROR_OVERFLOW, @@ -276,7 +277,7 @@ yasm_intnum_create_charconst_tasm(const char *str) } /* tasm uses big endian notation */ - int i = 0; + i = 0; switch (len) { case 3: intn->val.l |= ((unsigned long)str[i++]) & 0xff; diff --git a/modules/preprocs/nasm/nasm-pp.c b/modules/preprocs/nasm/nasm-pp.c index 3f6e2961..372f32b6 100644 --- a/modules/preprocs/nasm/nasm-pp.c +++ b/modules/preprocs/nasm/nasm-pp.c @@ -878,7 +878,7 @@ check_tasm_directive(char *line) break; /* segment register name */ for (assume = TAssumes; assume->segreg; assume++) - if (strlen(assume->segreg) == q-p && + if (strlen(assume->segreg) == (size_t)(q-p) && !strncasecmp(assume->segreg, p, q-p)) break; if (!assume->segreg) { @@ -936,7 +936,7 @@ check_tasm_directive(char *line) if (!strcasecmp(q, struc->name)) { char *r = q + len2 + 1, *s, *t, tasm_param[6]; struct TStrucField *field = struc->fields; - int size, n, m; + int size, n; if (!oldchar2) { error(ERR_FATAL, "Expected struc field initializer after %s %s", p, q); return line; @@ -1008,7 +1008,7 @@ check_tasm_directive(char *line) return line; } -Token * tasm_join_tokens(Token *tline) +static Token * tasm_join_tokens(Token *tline) { Token *t, *prev, *next; for (prev = NULL, t = tline; t; prev = t, t = next) { From 8986aa0764fb69855bba04f3d4f3580fcccccd1a Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 7 Oct 2008 06:02:12 +0000 Subject: [PATCH 222/585] Don't use tasm_compatible_mode in nasm parser (use local var instead). Fix a few warnings while here. svn path=/trunk/yasm/; revision=2134 --- modules/parsers/nasm/nasm-parse.c | 36 ++++++++++++++++-------------- modules/parsers/nasm/nasm-parser.c | 20 +++++++++++------ modules/parsers/nasm/nasm-parser.h | 2 ++ modules/parsers/nasm/nasm-token.re | 12 +++++----- 4 files changed, 40 insertions(+), 30 deletions(-) diff --git a/modules/parsers/nasm/nasm-parse.c b/modules/parsers/nasm/nasm-parse.c index 7afd0086..0e80b582 100644 --- a/modules/parsers/nasm/nasm-parse.c +++ b/modules/parsers/nasm/nasm-parse.c @@ -68,7 +68,7 @@ static void define_label(yasm_parser_nasm *parser_nasm, /*@only@*/ char *name, static void yasm_ea_set_implicit_size_segment(yasm_parser_nasm *parser_nasm, yasm_effaddr *ea, yasm_expr *e) { - if (tasm_compatible_mode) { + if (parser_nasm->tasm) { const char *segment = yasm_expr_segment(e); ea->data_len = yasm_expr_size(e); if (segment) { @@ -373,7 +373,7 @@ parse_line(yasm_parser_nasm *parser_nasm) case LOCAL_ID: { char *name = ID_val; - int local = tasm_compatible_mode + int local = parser_nasm->tasm ? (curtok == ID || curtok == LOCAL_ID || (curtok == SPECIAL_ID && name[0] == '@')) : (curtok != ID); @@ -390,12 +390,12 @@ parse_line(yasm_parser_nasm *parser_nasm) if (curtok == ':') get_next_token(); - if (curtok == EQU || (tasm_compatible_mode && curtok == '=')) { + if (curtok == EQU || (parser_nasm->tasm && curtok == '=')) { /* label EQU expr */ yasm_expr *e; get_next_token(); - if (tasm_compatible_mode && curtok == SIZE_OVERRIDE) { + if (parser_nasm->tasm && curtok == SIZE_OVERRIDE) { size = SIZE_OVERRIDE_val; get_next_token(); } @@ -412,10 +412,10 @@ parse_line(yasm_parser_nasm *parser_nasm) return NULL; } - if (tasm_compatible_mode && curtok == LABEL) + if (parser_nasm->tasm && curtok == LABEL) get_next_token(); - if (tasm_compatible_mode && curtok == SIZE_OVERRIDE) { + if (parser_nasm->tasm && curtok == SIZE_OVERRIDE) { size = SIZE_OVERRIDE_val; get_next_token(); } @@ -430,10 +430,10 @@ parse_line(yasm_parser_nasm *parser_nasm) return parse_times(parser_nasm); } bc = parse_exp(parser_nasm); - if (!tasm_compatible_mode && !bc) + if (!parser_nasm->tasm && !bc) yasm_error_set(YASM_ERROR_SYNTAX, N_("instruction expected after label")); - if (tasm_compatible_mode && bc && !size) + if (parser_nasm->tasm && bc && !size) size = yasm_bc_elem_size(bc); define_label(parser_nasm, name, size, local); return bc; @@ -795,8 +795,8 @@ parse_operand(yasm_parser_nasm *parser_nasm) return NULL; } - if (tasm_compatible_mode && !is_eol() && curtok != ',') { - yasm_expr *e, *f; + if (parser_nasm->tasm && !is_eol() && curtok != ',') { + yasm_expr *e = NULL, *f; yasm_effaddr *ea; switch (op->type) { @@ -867,7 +867,7 @@ parse_operand(yasm_parser_nasm *parser_nasm) { uintptr_t segreg = SEGREG_val; get_next_token(); - if (tasm_compatible_mode && curtok == ':') { + if (parser_nasm->tasm && curtok == ':') { get_next_token(); op = parse_operand(parser_nasm); if (!op) @@ -875,8 +875,10 @@ parse_operand(yasm_parser_nasm *parser_nasm) if (op->type == YASM_INSN__OPERAND_IMM) { yasm_effaddr *ea = yasm_arch_ea_create(p_object->arch, op->data.val); - yasm_ea_set_implicit_size_segment(parser_nasm, ea, op->data.val); - yasm_insn_operand *op2 = yasm_operand_create_mem(ea); + yasm_insn_operand *op2; + yasm_ea_set_implicit_size_segment(parser_nasm, ea, + op->data.val); + op2 = yasm_operand_create_mem(ea); op2->size = op->size; yasm_xfree(op); op = op2; @@ -946,7 +948,7 @@ parse_operand(yasm_parser_nasm *parser_nasm) case ID: case LOCAL_ID: case NONLOCAL_ID: - if (tasm_compatible_mode) { + if (parser_nasm->tasm) { get_peek_token(parser_nasm); if (parser_nasm->peek_token == '[') { yasm_symrec *sym = yasm_symtab_use(p_symtab, ID_val, @@ -981,7 +983,7 @@ parse_operand(yasm_parser_nasm *parser_nasm) if (!e) return NULL; if (curtok != ':') - if (tasm_compatible_mode && yasm_expr_size(e)) { + if (parser_nasm->tasm && yasm_expr_size(e)) { yasm_effaddr *ea = yasm_arch_ea_create(p_object->arch, e); yasm_ea_set_implicit_size_segment(parser_nasm, ea, e); op = yasm_operand_create_mem(ea); @@ -1386,7 +1388,7 @@ parse_expr6(yasm_parser_nasm *parser_nasm, expr_type type) case STRING: { yasm_intnum *intn; - if (tasm_compatible_mode) + if (parser_nasm->tasm) intn = yasm_intnum_create_charconst_tasm(STRING_val.contents); else intn = yasm_intnum_create_charconst_nasm(STRING_val.contents); @@ -1442,7 +1444,7 @@ define_label(yasm_parser_nasm *parser_nasm, char *name, unsigned int size, { yasm_symrec *symrec; - if ((!tasm_compatible_mode || tasm_locals) && !local) { + if ((!parser_nasm->tasm || tasm_locals) && !local) { if (parser_nasm->locallabel_base) yasm_xfree(parser_nasm->locallabel_base); parser_nasm->locallabel_base_len = strlen(name); diff --git a/modules/parsers/nasm/nasm-parser.c b/modules/parsers/nasm/nasm-parser.c index 12070061..ba3263ae 100644 --- a/modules/parsers/nasm/nasm-parser.c +++ b/modules/parsers/nasm/nasm-parser.c @@ -31,16 +31,15 @@ #include "nasm-parser.h" -#include "modules/preprocs/nasm/nasm.h" - static void -nasm_parser_do_parse(yasm_object *object, yasm_preproc *pp, - int save_input, yasm_linemap *linemap, - yasm_errwarns *errwarns) +nasm_do_parse(yasm_object *object, yasm_preproc *pp, int save_input, + yasm_linemap *linemap, yasm_errwarns *errwarns, int tasm) { yasm_parser_nasm parser_nasm; + parser_nasm.tasm = tasm; + parser_nasm.object = object; parser_nasm.linemap = linemap; @@ -79,6 +78,14 @@ nasm_parser_do_parse(yasm_object *object, yasm_preproc *pp, yasm_symtab_parser_finalize(object->symtab, 0, errwarns); } +static void +nasm_parser_do_parse(yasm_object *object, yasm_preproc *pp, + int save_input, yasm_linemap *linemap, + yasm_errwarns *errwarns) +{ + nasm_do_parse(object, pp, save_input, linemap, errwarns, 0); +} + #include "nasm-macros.c" /* Define valid preprocessors to use with this parser */ @@ -108,10 +115,9 @@ tasm_parser_do_parse(yasm_object *object, yasm_preproc *pp, int save_input, yasm_linemap *linemap, yasm_errwarns *errwarns) { - tasm_compatible_mode = 1; yasm_symtab_set_case_sensitive(object->symtab, 0); yasm_warn_disable(YASM_WARN_IMPLICIT_SIZE_OVERRIDE); - nasm_parser_do_parse(object, pp, save_input, linemap, errwarns); + nasm_do_parse(object, pp, save_input, linemap, errwarns, 1); } /* Define valid preprocessors to use with this parser */ diff --git a/modules/parsers/nasm/nasm-parser.h b/modules/parsers/nasm/nasm-parser.h index 63127589..3312027e 100644 --- a/modules/parsers/nasm/nasm-parser.h +++ b/modules/parsers/nasm/nasm-parser.h @@ -87,6 +87,8 @@ typedef union { #define YYSTYPE yystype typedef struct yasm_parser_nasm { + int tasm; + int debug; /*@only@*/ yasm_object *object; diff --git a/modules/parsers/nasm/nasm-token.re b/modules/parsers/nasm/nasm-token.re index 72e15080..23a81a22 100644 --- a/modules/parsers/nasm/nasm-token.re +++ b/modules/parsers/nasm/nasm-token.re @@ -77,14 +77,14 @@ handle_dot_label(YYSTYPE *lvalp, char *tok, size_t toklen, size_t zeropos, { /* check for special non-local labels like ..start */ if (tok[zeropos+1] == '.') { - lvalp->str_val = yasm__xstrndup(tok+zeropos+(tasm_compatible_mode?2:0), - toklen-zeropos-(tasm_compatible_mode?2:0)); + lvalp->str_val = yasm__xstrndup(tok+zeropos+(parser_nasm->tasm?2:0), + toklen-zeropos-(parser_nasm->tasm?2:0)); /* check for special non-local ..@label */ if (lvalp->str_val[zeropos+2] == '@') return NONLOCAL_ID; return SPECIAL_ID; } - if (tasm_compatible_mode && (!tasm_locals || + if (parser_nasm->tasm && (!tasm_locals || (tok[zeropos] == '.' && tok[zeropos+1] != '@' && tok[zeropos+2] != '@'))) { /* no locals on Tasm without the 'locals' directive */ @@ -376,7 +376,7 @@ scan: /* forced identifier */ "$" [a-zA-Z0-9_$#@~.?]+ { if (TOK[1] == '.' || - (tasm_compatible_mode && TOK[1] == '@' && TOK[2] == '@')) { + (parser_nasm->tasm && TOK[1] == '@' && TOK[2] == '@')) { /* handle like .label */ RETURN(handle_dot_label(lvalp, TOK, TOKLEN, 1, parser_nasm)); } @@ -419,7 +419,7 @@ scan: default: break; } - if (tasm_compatible_mode) { + if (parser_nasm->tasm) { if (!strcasecmp(TOK, "shl")) { s->tok[TOKLEN] = savech; RETURN(LEFT_OP); @@ -737,7 +737,7 @@ stringconst_scan: strbuf_size + STRBUF_ALLOC_SIZE); strbuf_size += STRBUF_ALLOC_SIZE; } - } else if (!tasm_compatible_mode) { + } else if (!parser_nasm->tasm) { YYCURSOR--; goto stringconst_end; } From 0efccb5ad0a397d4ef5f4eb011e30f529a1d0afa Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 7 Oct 2008 06:16:57 +0000 Subject: [PATCH 223/585] tasm frontend: Fix crash with plain /l option. svn path=/trunk/yasm/; revision=2135 --- frontends/tasm/tasm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontends/tasm/tasm.c b/frontends/tasm/tasm.c index 695681ff..5431f580 100644 --- a/frontends/tasm/tasm.c +++ b/frontends/tasm/tasm.c @@ -718,7 +718,7 @@ opt_ignore(/*@unused@*/ char *cmd, /*@unused@*/ char *param, int extra) static int opt_listing_handler(/*@unused@*/ char *cmd, /*@unused@*/ char *param, int extra) { - if (param[0]) { + if (param && param[0]) { if (param[0] != 'a') return 1; expanded_listing = 1; From 19b420b63cecbd38cec788aec745e2aadb154982 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 7 Oct 2008 06:21:06 +0000 Subject: [PATCH 224/585] tasm frontend: Fix handling of options >2 chars long. Use yasm__strncasecmp instead of manually lowercasing up to two characters. svn path=/trunk/yasm/; revision=2136 --- frontends/tasm/tasm-options.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/frontends/tasm/tasm-options.c b/frontends/tasm/tasm-options.c index 945e5c06..2f8f46dd 100644 --- a/frontends/tasm/tasm-options.c +++ b/frontends/tasm/tasm-options.c @@ -59,20 +59,9 @@ parse_cmdline(int argc, char **argv, opt_option *options, size_t nopts, if (argv[0][0] == '/' && argv[0][1]) { /* opt */ got_it = 0; for (i = 0; i < nopts; i++) { - char lower[3]; - unsigned len; - - lower[0] = tolower(argv[0][1]); - if (!argv[0][2]) { - lower[1] = '\0'; - } else { - lower[1] = tolower(argv[0][2]); - lower[2] = '\0'; - } - - len = strlen(options[i].opt); - if (!strncmp(lower, options[i].opt, len)) { - char *cmd = &argv[0][1]; + char *cmd = &argv[0][1]; + size_t len = strlen(options[i].opt); + if (yasm__strncasecmp(cmd, options[i].opt, len) == 0) { char *param; param = &argv[0][1+len]; From a5a734f835d720f9ddd3a57c8df66069caacd8ad Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 7 Oct 2008 06:22:58 +0000 Subject: [PATCH 225/585] Add Samuel Thibault to list of contributors. svn path=/trunk/yasm/; revision=2137 --- COPYING | 1 + 1 file changed, 1 insertion(+) diff --git a/COPYING b/COPYING index 7a44c8d6..15265bcb 100644 --- a/COPYING +++ b/COPYING @@ -10,6 +10,7 @@ Yasm developers and/or contributors include: Stephen Polkowski (x86 instruction patches) Henryk Richter (Mach-O object format) Ben Skeggs (patches, bug reports) + Samuel Thibault (TASM parser and frontend) ----------------------------------- Yasm licensing overview and summary From 90697b87e7f9bcfd1e398365fad723697beb4c6b Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 8 Oct 2008 04:58:08 +0000 Subject: [PATCH 226/585] tasm.c: Don't include unistd.h. svn path=/trunk/yasm/; revision=2138 --- frontends/tasm/tasm.c | 1 - 1 file changed, 1 deletion(-) diff --git a/frontends/tasm/tasm.c b/frontends/tasm/tasm.c index 5431f580..a8490b23 100644 --- a/frontends/tasm/tasm.c +++ b/frontends/tasm/tasm.c @@ -29,7 +29,6 @@ /*@unused@*/ RCSID("$Id: tasm.c 1523 2006-05-06 16:11:56Z peter $"); #include -#include #include #include #include From a51609437b990056dd0cf7e80d27b7afb4c586b2 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 8 Oct 2008 05:19:47 +0000 Subject: [PATCH 227/585] Use yasm functions yasm__strcasecmp and nasm_strdup instead of relying on platform to have them. Also, instead of using snprintf, preallocate and then use sprintf. This also avoids the while() reallocation loop. Reported by: Brian Gladman svn path=/trunk/yasm/; revision=2139 --- modules/parsers/nasm/nasm-token.re | 22 ++++++------ modules/preprocs/nasm/nasm-pp.c | 56 ++++++++++++++---------------- 2 files changed, 38 insertions(+), 40 deletions(-) diff --git a/modules/parsers/nasm/nasm-token.re b/modules/parsers/nasm/nasm-token.re index 23a81a22..eb44d208 100644 --- a/modules/parsers/nasm/nasm-token.re +++ b/modules/parsers/nasm/nasm-token.re @@ -420,50 +420,50 @@ scan: break; } if (parser_nasm->tasm) { - if (!strcasecmp(TOK, "shl")) { + if (!yasm__strcasecmp(TOK, "shl")) { s->tok[TOKLEN] = savech; RETURN(LEFT_OP); } - if (!strcasecmp(TOK, "shr")) { + if (!yasm__strcasecmp(TOK, "shr")) { s->tok[TOKLEN] = savech; RETURN(RIGHT_OP); } - if (!strcasecmp(TOK, "and")) { + if (!yasm__strcasecmp(TOK, "and")) { s->tok[TOKLEN] = savech; RETURN('&'); } - if (!strcasecmp(TOK, "or")) { + if (!yasm__strcasecmp(TOK, "or")) { s->tok[TOKLEN] = savech; RETURN('|'); } - if (!strcasecmp(TOK, "low")) { + if (!yasm__strcasecmp(TOK, "low")) { s->tok[TOKLEN] = savech; RETURN(LOW); } - if (!strcasecmp(TOK, "high")) { + if (!yasm__strcasecmp(TOK, "high")) { s->tok[TOKLEN] = savech; RETURN(HIGH); } - if (!strcasecmp(TOK, "offset")) { + if (!yasm__strcasecmp(TOK, "offset")) { s->tok[TOKLEN] = savech; RETURN(OFFSET); } - if (!strcasecmp(TOK, "fword")) { + if (!yasm__strcasecmp(TOK, "fword")) { s->tok[TOKLEN] = savech; lvalp->int_info = yasm_arch_wordsize(p_object->arch)*2; RETURN(SIZE_OVERRIDE); } - if (!strcasecmp(TOK, "df")) { + if (!yasm__strcasecmp(TOK, "df")) { s->tok[TOKLEN] = savech; lvalp->int_info = yasm_arch_wordsize(p_object->arch)*3; parser_nasm->state = INSTRUCTION; RETURN(DECLARE_DATA); } - if (!strcasecmp(TOK, "label")) { + if (!yasm__strcasecmp(TOK, "label")) { s->tok[TOKLEN] = savech; RETURN(LABEL); } - if (!strcasecmp(TOK, "dup")) { + if (!yasm__strcasecmp(TOK, "dup")) { s->tok[TOKLEN] = savech; RETURN(DUP); } diff --git a/modules/preprocs/nasm/nasm-pp.c b/modules/preprocs/nasm/nasm-pp.c index 372f32b6..77865c4e 100644 --- a/modules/preprocs/nasm/nasm-pp.c +++ b/modules/preprocs/nasm/nasm-pp.c @@ -667,7 +667,7 @@ check_tasm_directive(char *line) } } else if (!nasm_stricmp(p, "end")) { nasm_free(line); - return strdup(""); + return nasm_strdup(""); } else if (!nasm_stricmp(p, "rept")) { /* handle repeat directive */ end = nasm_malloc(sizeof(*end)); @@ -680,7 +680,7 @@ check_tasm_directive(char *line) } else if (!nasm_stricmp(p, "locals")) { tasm_locals = 1; nasm_free(line); - return strdup(""); + return nasm_strdup(""); } if (!oldchar) @@ -806,7 +806,7 @@ check_tasm_directive(char *line) line = nasm_malloc(5 + 1 + len + 1); sprintf(line, "struc %s", p); struc = malloc(sizeof(*struc)); - struc->name = strdup(p); + struc->name = nasm_strdup(p); struc->fields = NULL; struc->lastField = NULL; struc->next = TStrucs; @@ -821,12 +821,12 @@ check_tasm_directive(char *line) } else if (!nasm_stricmp(q, "segment")) { /* handle SEGMENT */ oldline = line; - line = strdup(oldchar2?q+len2+1:""); + line = nasm_strdup(oldchar2?q+len2+1:""); if (tasm_segment) { error(ERR_FATAL, "SEGMENT: already in a segment context"); return line; } - tasm_segment = strdup(p); + tasm_segment = nasm_strdup(p); nasm_free(oldline); end = nasm_malloc(sizeof(*end)); end->type = TM_SEGMENT; @@ -846,19 +846,19 @@ check_tasm_directive(char *line) switch (end->type) { case TM_STRUC: inTstruc = 0; - return strdup("endstruc"); + return nasm_strdup("endstruc"); case TM_SEGMENT: /* XXX: yes, we leak memory here, but that permits labels * to avoid strduping... */ tasm_segment = NULL; - return strdup(""); + return nasm_strdup(""); default: error(ERR_FATAL, "ENDS: bogus ends context type %d",end->type); return NULL; } } else if (!nasm_stricmp(p, "endp") || !nasm_stricmp(q, "endp")) { nasm_free(line); - return strdup(""); + return nasm_strdup(""); } else if (!nasm_stricmp(p, "assume")) { struct TSegmentAssume *assume; /* handle ASSUME */ @@ -879,7 +879,7 @@ check_tasm_directive(char *line) /* segment register name */ for (assume = TAssumes; assume->segreg; assume++) if (strlen(assume->segreg) == (size_t)(q-p) && - !strncasecmp(assume->segreg, p, q-p)) + !yasm__strncasecmp(assume->segreg, p, q-p)) break; if (!assume->segreg) { i = assume - TAssumes + 1; @@ -906,14 +906,14 @@ check_tasm_directive(char *line) TAssumes[i].segreg = NULL; TAssumes = nasm_realloc(TAssumes, (i+1)*sizeof(*TAssumes)); nasm_free(line); - return strdup(""); + return nasm_strdup(""); } else if (inTstruc) { struct TStrucField *field; /* TODO: handle unnamed data */ field = nasm_malloc(sizeof(*field)); - field->name = strdup(p); + field->name = nasm_strdup(p); /* TODO: type struc ! */ - field->type = strdup(q); + field->type = nasm_strdup(q); field->next = NULL; if (!TStrucs->fields) TStrucs->fields = field; @@ -933,7 +933,7 @@ check_tasm_directive(char *line) { struct TStruc *struc; for (struc = TStrucs; struc; struc = struc->next) { - if (!strcasecmp(q, struc->name)) { + if (!yasm__strcasecmp(q, struc->name)) { char *r = q + len2 + 1, *s, *t, tasm_param[6]; struct TStrucField *field = struc->fields; int size, n; @@ -970,27 +970,25 @@ check_tasm_directive(char *line) return oldline; } *s = 0; - while (1) { - m = snprintf(line + n, size - n, "%s.%s: at .%s, %s %s\n", p, field->name, field->name, field->type, r + 1); - if (m + 1 <= size - n) - break; - size *= 2; - line = nasm_realloc(line, size); - } - n += m; + m = strlen(p) + 1 + strlen(field->name)*2 + 8 + + strlen(field->type) + 1 + strlen(r+1) + 2; + size += m; + line = nasm_realloc(line, size); + sprintf(line + n, "%s.%s: at .%s, %s %s\n", + p, field->name, field->name, field->type, r + 1); + n += m-1; r = s; field = field->next; } /* complete with last initializer and '?' */ while(field) { - while (1) { - m = snprintf(line + n, size - n, "%s.%s: at .%s, %s %s\n", p, field->name, field->name, field->type, r ? r + 1: "?"); - if (m + 1 <= size - n) - break; - size *= 2; - line = nasm_realloc(line, size); - } - n += m; + m = strlen(p) + 1 + strlen(field->name)*2 + 8 + + strlen(field->type) + 1 + (r ? strlen(r+1) : 1) + 2; + size += m; + line = nasm_realloc(line, size); + sprintf(line + n, "%s.%s: at .%s, %s %s\n", p, field->name, + field->name, field->type, r ? r + 1: "?"); + n += m-1; r = NULL; field = field->next; } From 2496ce652dfc147da2dbe41a5d6741ff52b84a64 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 8 Oct 2008 07:15:45 +0000 Subject: [PATCH 228/585] Remove directory EXTRA_DIST; it seems to be making distcheck on ctn die. svn path=/trunk/yasm/; revision=2140 --- modules/parsers/tasm/tests/Makefile.inc | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/parsers/tasm/tests/Makefile.inc b/modules/parsers/tasm/tests/Makefile.inc index 64dececf..1af4dea0 100644 --- a/modules/parsers/tasm/tests/Makefile.inc +++ b/modules/parsers/tasm/tests/Makefile.inc @@ -39,7 +39,6 @@ EXTRA_DIST += modules/parsers/tasm/tests/size.hex EXTRA_DIST += modules/parsers/tasm/tests/struc.asm EXTRA_DIST += modules/parsers/tasm/tests/struc.errwarn EXTRA_DIST += modules/parsers/tasm/tests/struc.hex -EXTRA_DIST += modules/parsers/tasm/tests/ EXTRA_DIST += modules/parsers/tasm/tests/exe/Makefile.inc From b2048de4413d2679c5f26a17980f94bc16f8c893 Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Wed, 8 Oct 2008 08:22:37 +0000 Subject: [PATCH 229/585] update Visual Studio 2008 build svn path=/trunk/yasm/; revision=2149 --- Mkfiles/vc9/genmacro/genmacro.vcproj | 2 -- Mkfiles/vc9/genmodule/genmodule.vcproj | 2 -- Mkfiles/vc9/genperf/genperf.vcproj | 2 -- Mkfiles/vc9/genstring/genstring.vcproj | 2 -- Mkfiles/vc9/genversion/genversion.vcproj | 2 -- Mkfiles/vc9/re2c/re2c.vcproj | 2 -- Mkfiles/vc9/yasm.sln | 24 +++++++++++++++++++----- 7 files changed, 19 insertions(+), 17 deletions(-) diff --git a/Mkfiles/vc9/genmacro/genmacro.vcproj b/Mkfiles/vc9/genmacro/genmacro.vcproj index e6980bc1..9d34e2ef 100644 --- a/Mkfiles/vc9/genmacro/genmacro.vcproj +++ b/Mkfiles/vc9/genmacro/genmacro.vcproj @@ -49,7 +49,6 @@ UsePrecompiledHeader="0" ProgramDataBaseFileName="$(IntDir)\" WarningLevel="3" - Detect64BitPortabilityProblems="true" DebugInformationFormat="4" CompileAs="0" /> @@ -127,7 +126,6 @@ UsePrecompiledHeader="0" ProgramDataBaseFileName="$(IntDir)\" WarningLevel="3" - Detect64BitPortabilityProblems="true" DebugInformationFormat="3" CompileAs="0" /> diff --git a/Mkfiles/vc9/genmodule/genmodule.vcproj b/Mkfiles/vc9/genmodule/genmodule.vcproj index ab1f107c..affc9735 100644 --- a/Mkfiles/vc9/genmodule/genmodule.vcproj +++ b/Mkfiles/vc9/genmodule/genmodule.vcproj @@ -51,7 +51,6 @@ AssemblerListingLocation="$(IntDir)\" ProgramDataBaseFileName="$(IntDir)\" WarningLevel="3" - Detect64BitPortabilityProblems="true" DebugInformationFormat="4" CompileAs="0" /> @@ -131,7 +130,6 @@ AssemblerListingLocation="$(IntDir)\" ProgramDataBaseFileName="$(IntDir)\" WarningLevel="3" - Detect64BitPortabilityProblems="true" DebugInformationFormat="3" CompileAs="0" /> diff --git a/Mkfiles/vc9/genperf/genperf.vcproj b/Mkfiles/vc9/genperf/genperf.vcproj index 5ad018d7..507d0934 100644 --- a/Mkfiles/vc9/genperf/genperf.vcproj +++ b/Mkfiles/vc9/genperf/genperf.vcproj @@ -50,7 +50,6 @@ UsePrecompiledHeader="0" ProgramDataBaseFileName="$(IntDir)\" WarningLevel="3" - Detect64BitPortabilityProblems="true" DebugInformationFormat="4" CompileAs="0" /> @@ -129,7 +128,6 @@ UsePrecompiledHeader="0" ProgramDataBaseFileName="$(IntDir)\" WarningLevel="3" - Detect64BitPortabilityProblems="true" DebugInformationFormat="3" CompileAs="0" /> diff --git a/Mkfiles/vc9/genstring/genstring.vcproj b/Mkfiles/vc9/genstring/genstring.vcproj index a0c99d93..368346e8 100644 --- a/Mkfiles/vc9/genstring/genstring.vcproj +++ b/Mkfiles/vc9/genstring/genstring.vcproj @@ -49,7 +49,6 @@ UsePrecompiledHeader="0" ProgramDataBaseFileName="$(IntDir)\" WarningLevel="3" - Detect64BitPortabilityProblems="true" DebugInformationFormat="4" CompileAs="0" /> @@ -127,7 +126,6 @@ UsePrecompiledHeader="0" ProgramDataBaseFileName="$(IntDir)\" WarningLevel="3" - Detect64BitPortabilityProblems="true" DebugInformationFormat="3" CompileAs="0" /> diff --git a/Mkfiles/vc9/genversion/genversion.vcproj b/Mkfiles/vc9/genversion/genversion.vcproj index 95daa6ab..84c92a2d 100644 --- a/Mkfiles/vc9/genversion/genversion.vcproj +++ b/Mkfiles/vc9/genversion/genversion.vcproj @@ -50,7 +50,6 @@ UsePrecompiledHeader="0" ProgramDataBaseFileName="$(IntDir)\" WarningLevel="3" - Detect64BitPortabilityProblems="true" DebugInformationFormat="4" CompileAs="0" /> @@ -129,7 +128,6 @@ UsePrecompiledHeader="0" ProgramDataBaseFileName="$(IntDir)\" WarningLevel="3" - Detect64BitPortabilityProblems="true" DebugInformationFormat="3" CompileAs="0" /> diff --git a/Mkfiles/vc9/re2c/re2c.vcproj b/Mkfiles/vc9/re2c/re2c.vcproj index 2428e8fd..45bc3e36 100644 --- a/Mkfiles/vc9/re2c/re2c.vcproj +++ b/Mkfiles/vc9/re2c/re2c.vcproj @@ -50,7 +50,6 @@ UsePrecompiledHeader="0" ProgramDataBaseFileName="$(IntDir)\" WarningLevel="3" - Detect64BitPortabilityProblems="true" DebugInformationFormat="4" CompileAs="0" /> @@ -129,7 +128,6 @@ UsePrecompiledHeader="0" ProgramDataBaseFileName="$(IntDir)\" WarningLevel="3" - Detect64BitPortabilityProblems="true" DebugInformationFormat="3" CompileAs="0" /> diff --git a/Mkfiles/vc9/yasm.sln b/Mkfiles/vc9/yasm.sln index ee80f7d9..0fc830fd 100644 --- a/Mkfiles/vc9/yasm.sln +++ b/Mkfiles/vc9/yasm.sln @@ -13,17 +13,17 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libyasm", "libyasm\libyasm. EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "modules", "modules\modules.vcproj", "{D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}" ProjectSection(ProjectDependencies) = postProject - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619} = {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619} - {225700A5-07B8-434E-AD61-555278BF6733} = {225700A5-07B8-434E-AD61-555278BF6733} - {29FE7874-1256-4AD6-B889-68E399DC9608} = {29FE7874-1256-4AD6-B889-68E399DC9608} {3C58BE13-50A3-4583-984D-D8902B3D7713} = {3C58BE13-50A3-4583-984D-D8902B3D7713} + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619} = {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619} + {29FE7874-1256-4AD6-B889-68E399DC9608} = {29FE7874-1256-4AD6-B889-68E399DC9608} + {225700A5-07B8-434E-AD61-555278BF6733} = {225700A5-07B8-434E-AD61-555278BF6733} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yasm", "yasm.vcproj", "{34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}" ProjectSection(ProjectDependencies) = postProject - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6} = {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6} - {29FE7874-1256-4AD6-B889-68E399DC9608} = {29FE7874-1256-4AD6-B889-68E399DC9608} {021CEB0A-F721-4F59-B349-9CEEAF244459} = {021CEB0A-F721-4F59-B349-9CEEAF244459} + {29FE7874-1256-4AD6-B889-68E399DC9608} = {29FE7874-1256-4AD6-B889-68E399DC9608} + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6} = {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genmacro", "genmacro\genmacro.vcproj", "{225700A5-07B8-434E-AD61-555278BF6733}" @@ -41,6 +41,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genmodule", "genmodule\genm EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genstring", "genstring\genstring.vcproj", "{021CEB0A-F721-4F59-B349-9CEEAF244459}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tasm", "tasm.vcproj", "{A9E67688-7E5B-41D2-9C90-7ED14EF37E1E}" + ProjectSection(ProjectDependencies) = postProject + {29FE7874-1256-4AD6-B889-68E399DC9608} = {29FE7874-1256-4AD6-B889-68E399DC9608} + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6} = {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6} + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -121,6 +127,14 @@ Global {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|Win32.Build.0 = Release|Win32 {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|x64.ActiveCfg = Release|Win32 {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|x64.Build.0 = Release|Win32 + {A9E67688-7E5B-41D2-9C90-7ED14EF37E1E}.Debug|Win32.ActiveCfg = Debug|Win32 + {A9E67688-7E5B-41D2-9C90-7ED14EF37E1E}.Debug|Win32.Build.0 = Debug|Win32 + {A9E67688-7E5B-41D2-9C90-7ED14EF37E1E}.Debug|x64.ActiveCfg = Debug|x64 + {A9E67688-7E5B-41D2-9C90-7ED14EF37E1E}.Debug|x64.Build.0 = Debug|x64 + {A9E67688-7E5B-41D2-9C90-7ED14EF37E1E}.Release|Win32.ActiveCfg = Release|Win32 + {A9E67688-7E5B-41D2-9C90-7ED14EF37E1E}.Release|Win32.Build.0 = Release|Win32 + {A9E67688-7E5B-41D2-9C90-7ED14EF37E1E}.Release|x64.ActiveCfg = Release|x64 + {A9E67688-7E5B-41D2-9C90-7ED14EF37E1E}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From 0f79103a3f3d79fdf1bce7e9181aae8e7e056395 Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Wed, 8 Oct 2008 08:41:55 +0000 Subject: [PATCH 230/585] svn path=/trunk/yasm/; revision=2150 --- Mkfiles/vc9/readme.vc9.txt | 38 ++++++++++++++++++---------- Mkfiles/vc9/vc98_swap.py | 52 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+), 14 deletions(-) create mode 100644 Mkfiles/vc9/vc98_swap.py diff --git a/Mkfiles/vc9/readme.vc9.txt b/Mkfiles/vc9/readme.vc9.txt index 50cf1616..14b21d69 100644 --- a/Mkfiles/vc9/readme.vc9.txt +++ b/Mkfiles/vc9/readme.vc9.txt @@ -91,12 +91,12 @@ that use absolute addresses. 6. Building with Visual Studio 2005 ----------------------------------- -The program vc928.c will convert VC9 build projects into those -needed for Visual Studio 2005 (VC8). It will also convert files -that have been converted in this way back into their original -form. It does this conversion by looking for *.vcproj files -in the current working directory and its sub-directories and -changing the following line in each of them: +The Python program vc98_swap.py will convert VC9 build projects +into those needed for Visual Studio 2005 (VC8). It will also +convert files that have been converted in this way back into their +original form. It does this conversion by looking for *.vcproj +and *.sln files in the current working directory and its sub-directories and changing the following line in each *.vcproj +file: Version="9.00" @@ -105,18 +105,28 @@ to: Version="8.00" or vice versa. - -It is used by compiling it, placing it in a root build directory -and running it from there. -Because it acts recursively on all sub-directories of this directory -it is important not to run it at a directory level in which not all -projects are to be converted. +The lines + + Microsoft Visual Studio Solution File, Format Version 10.00 + # Visual Studio 2008 + +in *.sln files are changed to: + + Microsoft Visual Studio Solution File, Format Version 9.00 + # Visual Studio 2005 + +or vice versa. + +Because it acts recursively on all sub-directories of this +directory it is important not to run it at a directory level +in which not all projects are to be converted. 7. Acknowledgements ------------------- I am most grateful for the fantastic support that Peter Johnson, -YASM's creator, has given me in tracking down this issue. +YASM's creator, has given me in tracking down issues in using +YASM for the production of Windows x64 code. - Brian Gladman, 28th March 2008 + Brian Gladman, 10th October 2008 diff --git a/Mkfiles/vc9/vc98_swap.py b/Mkfiles/vc9/vc98_swap.py new file mode 100644 index 00000000..d5237a2f --- /dev/null +++ b/Mkfiles/vc9/vc98_swap.py @@ -0,0 +1,52 @@ + +# Convert between Visual Studio 2008 and 2005 Project Files +# (with thanks to Tommi Vainikainen) + +l05 = "# Visual Studio 2005\n" +l08 = "# Visual Studio 2008\n" +l09 = "Microsoft Visual Studio Solution File, Format Version 9.00\n" +l10 = "Microsoft Visual Studio Solution File, Format Version 10.00\n" + +import os, shutil, string, fileinput, sys + +def vcproj_convert(sp) : + for l in fileinput.input(sp, inplace = 1) : + p8 = l.find("Version=\"8.00\"") + p9 = l.find("Version=\"9.00\"") + if p8 != -1 or p9 != -1 : + if p8 != -1 : + l = l[ : p8 + 9] + '9' + l[ p8 + 10 : ] + else : + l = l[ : p9 + 9] + '8' + l[ p9 + 10 : ] + sys.stdout.write(l) + +def sln_convert(sp) : + cnt = 0 + for l in fileinput.input(sp, inplace = 1) : + cnt = cnt + 1 + if cnt < 3 : + p09 = l.find(l09) + p10 = l.find(l10) + if p09 != -1 or p10 != -1 : + if p09 != -1 : + l = l10 + else : + l = l09 + p05 = l.find(l05) + p08 = l.find(l08) + if p05 != -1 or p08 != -1 : + if p05 != -1 : + l = l08 + else : + l = l05 + sys.stdout.write(l) + +if os.getcwd().endswith('Mkfiles\\vc9') : + for root, dirs, files in os.walk("./") : + for file in files : + if file.endswith(".sln") : + sln_convert(os.path.join(root, file)) + if file.endswith(".vcproj") : + vcproj_convert(os.path.join(root, file)) +else : + print "This script must be run in the 'Mkfiles\vc9' directory" From 979cb9362eea728f8b0ff2481de8bb26399aebdc Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Wed, 8 Oct 2008 08:48:18 +0000 Subject: [PATCH 231/585] Change to Python for Visual Studio 2008/2005 conversion (vc98_swap.py in place of vc928.c) svn path=/trunk/yasm/; revision=2151 --- Mkfiles/vc9/vc928.c | 134 -------------------------------------------- 1 file changed, 134 deletions(-) delete mode 100644 Mkfiles/vc9/vc928.c diff --git a/Mkfiles/vc9/vc928.c b/Mkfiles/vc9/vc928.c deleted file mode 100644 index b1d6fc81..00000000 --- a/Mkfiles/vc9/vc928.c +++ /dev/null @@ -1,134 +0,0 @@ -/* - --------------------------------------------------------------------------- - Copyright (c) 1998-2007, Brian Gladman, Worcester, UK. All rights reserved. - - LICENSE TERMS - - The free distribution and use of this software is allowed (with or without - changes) provided that: - - 1. source code distributions include the above copyright notice, this - list of conditions and the following disclaimer; - - 2. binary distributions include the above copyright notice, this list - of conditions and the following disclaimer in their documentation; - - 3. the name of the copyright holder is not used to endorse products - built using this software without specific written permission. - - DISCLAIMER - - This software is provided 'as is' with no explicit or implied warranties - in respect of its properties, including, but not limited to, correctness - and/or fitness for purpose. - --------------------------------------------------------------------------- - - This program converts Visual Studio 2008 C/C++ version 9 build projects - into build projects for Visual Studio 2005 C/C++ version 8. It will - also convert files that have been converted in this way back into their - original form. It does this conversion by looking for *.vcproj files - in the current working directory and its sub-directories and changing - the following line in each of them: - - Version="9.00" - - to: - - Version="8.00" - - or vice versa. - - It is used by compiling it, placing it in a root build directory and - running it from there. It acts recursively on all sub-directories of - this directory it is important not to run it at a directory level in - which not all projects are to be converted. -*/ - -#include -#include -#include -#include - -void process_file(char *fn) -{ FILE *f; - fpos_t pos; - char iobuf[1024], *p; - - if((f = fopen(fn, "r+")) == 0) /* open for read and write */ - { - printf("File open error on: %s\n", fn); return; - } - - for( ; ; ) - { - if(feof(f)) /* version line not found */ - break; - - if(fgetpos(f, &pos)) /* save position of line */ - { - printf("File getpos error on: %s\n", fn); break; - } - - if(!fgets(iobuf, 1024, f)) /* read the line in */ - { - printf("File read error on: %s\n", fn); break; - } - - if(p = strchr(iobuf, 'V')) /* look for 'version' line */ - { - if(!strncmp(p, "Version=\"8.00\"", 14) - || !strncmp(p, "Version=\"9.00\"", 14)) - { - *(p + 9) ^= 1; /* switch versions */ - /* reset back to start of line in the file and */ - /* write the changed line to the file */ - if(fsetpos(f, &pos)) - printf("File setpos error on: %s\n", fn); - else if(fputs(iobuf, f) == EOF) - printf("File write error on: %s\n", fn); - break; /* this file is now fixed */ - } - } - } - fclose(f); -} - -void find_vcproj_files(char *dir) -{ struct _finddata_t cfile; - intptr_t hfile; - char nbuf[_MAX_PATH], *p; - - strcpy(nbuf, dir); /* find directories and files */ - strcat(nbuf, "\\*.*"); - if((hfile = _findfirst( nbuf, &cfile )) == -1L ) - return; /* if directory is empty */ - - do - { - strcpy(nbuf, dir); /* compile path to the current */ - strcat(nbuf, "\\"); /* file or directory */ - strcat(nbuf, cfile.name); - - if((cfile.attrib & _A_SUBDIR) == _A_SUBDIR) - { /* if it is a sub-direcory */ - if(strcmp(cfile.name, ".") && strcmp(cfile.name, "..")) - find_vcproj_files(nbuf); /* recursive search */ - } - else if((cfile.attrib & 0x1f) == _A_NORMAL && (p = strrchr(cfile.name, '.')) - && !strcmp(p, ".vcproj")) - process_file(nbuf); /* if it is a *.vcproj file */ - } - while - ( _findnext( hfile, &cfile ) == 0 ); - - _findclose( hfile ); -} - -int main(void) -{ char *dir; - - if(!(dir = _getcwd( NULL, 0 ))) - printf("Cannot obtain current working directory\n"); - else - find_vcproj_files(dir); -} From dca3ebc625f05421383bd720be97bb55100adbfb Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 9 Oct 2008 04:37:12 +0000 Subject: [PATCH 232/585] Update Makefile.am for vc98_swap.py. svn path=/trunk/yasm/; revision=2152 --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index b9a9ed33..8d6f3ada 100644 --- a/Makefile.am +++ b/Makefile.am @@ -108,7 +108,7 @@ EXTRA_DIST += Mkfiles/vc9/config.h EXTRA_DIST += Mkfiles/vc9/libyasm-stdint.h EXTRA_DIST += Mkfiles/vc9/readme.vc9.txt EXTRA_DIST += Mkfiles/vc9/yasm.rules -EXTRA_DIST += Mkfiles/vc9/vc928.c +EXTRA_DIST += Mkfiles/vc9/vc98_swap.py EXTRA_DIST += Mkfiles/vc9/genmacro/genmacro.vcproj EXTRA_DIST += Mkfiles/vc9/genmacro/run.bat EXTRA_DIST += Mkfiles/vc9/genmodule/genmodule.vcproj From 2bcaa278be7762c0bc49255e6750de0c3446eb7d Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 16 Oct 2008 02:44:49 +0000 Subject: [PATCH 233/585] Add movbe instruction and CPU feature. Noticed by: Mark Charney svn path=/trunk/yasm/; revision=2156 --- modules/arch/x86/gen_x86_insn.py | 18 +++ modules/arch/x86/tests/Makefile.inc | 2 + modules/arch/x86/tests/movbe.asm | 20 ++++ modules/arch/x86/tests/movbe.hex | 176 ++++++++++++++++++++++++++++ modules/arch/x86/x86arch.h | 1 + modules/arch/x86/x86cpu.gperf | 2 + 6 files changed, 219 insertions(+) create mode 100644 modules/arch/x86/tests/movbe.asm create mode 100644 modules/arch/x86/tests/movbe.hex diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index 6397d9c9..95202d01 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -7039,6 +7039,24 @@ add_insn("xsave", "twobytemem", modifiers=[4, 0x0F, 0xAE], add_insn("xrstor", "twobytemem", modifiers=[5, 0x0F, 0xAE], cpu=["XSAVE", "386"]) +##################################################################### +# Intel MOVBE instruction +##################################################################### +for sz in (16, 32, 64): + add_group("movbe", + cpu=["MOVBE"], + opersize=sz, + opcode=[0x0F, 0x38, 0xF0], + operands=[Operand(type="Reg", size=sz, dest="Spare"), + Operand(type="Mem", size=sz, relaxed=True, dest="EA")]) + add_group("movbe", + cpu=["MOVBE"], + opersize=sz, + opcode=[0x0F, 0x38, 0xF1], + operands=[Operand(type="Mem", size=sz, relaxed=True, dest="EA"), + Operand(type="Reg", size=sz, dest="Spare")]) +add_insn("movbe", "movbe") + ##################################################################### # AMD 3DNow! instructions ##################################################################### diff --git a/modules/arch/x86/tests/Makefile.inc b/modules/arch/x86/tests/Makefile.inc index 4f83c1ed..687fb31a 100644 --- a/modules/arch/x86/tests/Makefile.inc +++ b/modules/arch/x86/tests/Makefile.inc @@ -101,6 +101,8 @@ EXTRA_DIST += modules/arch/x86/tests/mem64rip.asm EXTRA_DIST += modules/arch/x86/tests/mem64rip.hex EXTRA_DIST += modules/arch/x86/tests/mixcase.asm EXTRA_DIST += modules/arch/x86/tests/mixcase.hex +EXTRA_DIST += modules/arch/x86/tests/movbe.asm +EXTRA_DIST += modules/arch/x86/tests/movbe.hex EXTRA_DIST += modules/arch/x86/tests/movdq32.asm EXTRA_DIST += modules/arch/x86/tests/movdq32.hex EXTRA_DIST += modules/arch/x86/tests/movdq64.asm diff --git a/modules/arch/x86/tests/movbe.asm b/modules/arch/x86/tests/movbe.asm new file mode 100644 index 00000000..637524ae --- /dev/null +++ b/modules/arch/x86/tests/movbe.asm @@ -0,0 +1,20 @@ +[bits 64] +movbe cx, [5] +movbe cx, word [5] +movbe ecx, [5] +movbe ecx, dword [5] +movbe rcx, [5] +movbe rcx, qword [5] +movbe r9, [5] +movbe r9, qword [5] +movbe [5], bx +movbe word [5], bx +movbe [5], ebx +movbe dword [5], ebx +movbe [5], r10d +movbe dword [5], r10d +movbe [5], rbx +movbe qword [5], rbx +movbe [5], r10 +movbe qword [5], r10 + diff --git a/modules/arch/x86/tests/movbe.hex b/modules/arch/x86/tests/movbe.hex new file mode 100644 index 00000000..108bedf7 --- /dev/null +++ b/modules/arch/x86/tests/movbe.hex @@ -0,0 +1,176 @@ +66 +0f +38 +f0 +0c +25 +05 +00 +00 +00 +66 +0f +38 +f0 +0c +25 +05 +00 +00 +00 +0f +38 +f0 +0c +25 +05 +00 +00 +00 +0f +38 +f0 +0c +25 +05 +00 +00 +00 +48 +0f +38 +f0 +0c +25 +05 +00 +00 +00 +48 +0f +38 +f0 +0c +25 +05 +00 +00 +00 +4c +0f +38 +f0 +0c +25 +05 +00 +00 +00 +4c +0f +38 +f0 +0c +25 +05 +00 +00 +00 +66 +0f +38 +f1 +1c +25 +05 +00 +00 +00 +66 +0f +38 +f1 +1c +25 +05 +00 +00 +00 +0f +38 +f1 +1c +25 +05 +00 +00 +00 +0f +38 +f1 +1c +25 +05 +00 +00 +00 +44 +0f +38 +f1 +14 +25 +05 +00 +00 +00 +44 +0f +38 +f1 +14 +25 +05 +00 +00 +00 +48 +0f +38 +f1 +1c +25 +05 +00 +00 +00 +48 +0f +38 +f1 +1c +25 +05 +00 +00 +00 +4c +0f +38 +f1 +14 +25 +05 +00 +00 +00 +4c +0f +38 +f1 +14 +25 +05 +00 +00 +00 diff --git a/modules/arch/x86/x86arch.h b/modules/arch/x86/x86arch.h index adcc87ea..41cde219 100644 --- a/modules/arch/x86/x86arch.h +++ b/modules/arch/x86/x86arch.h @@ -70,6 +70,7 @@ #define CPU_FMA 36 /* Intel Fused-Multiply-Add Extensions */ #define CPU_AES 37 /* AES instruction */ #define CPU_CLMUL 38 /* PCLMULQDQ instruction */ +#define CPU_MOVBE 39 /* MOVBE instruction */ typedef struct yasm_arch_x86 { yasm_arch_base arch; /* base structure */ diff --git a/modules/arch/x86/x86cpu.gperf b/modules/arch/x86/x86cpu.gperf index 526e1569..29c0f49d 100644 --- a/modules/arch/x86/x86cpu.gperf +++ b/modules/arch/x86/x86cpu.gperf @@ -350,6 +350,8 @@ clmul, x86_cpu_set, CPU_CLMUL noclmul, x86_cpu_clear, CPU_CLMUL pclmulqdq, x86_cpu_set, CPU_CLMUL nopclmulqdq, x86_cpu_clear, CPU_CLMUL +movbe, x86_cpu_set, CPU_MOVBE +nomovbe, x86_cpu_clear, CPU_MOVBE %% void From 7b901e3596309180400de5e5c30421abf3a3af55 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 19 Oct 2008 07:29:15 +0000 Subject: [PATCH 234/585] Fix #157: Use UNIX (not Windows) path functions on cygwin platform. svn path=/trunk/yasm/; revision=2157 --- libyasm/file.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libyasm/file.h b/libyasm/file.h index e16491b7..a1de0339 100644 --- a/libyasm/file.h +++ b/libyasm/file.h @@ -117,8 +117,7 @@ size_t yasm__splitpath_win(const char *path, /*@out@*/ const char **tail); */ #ifndef yasm__splitpath # if defined (_WIN32) || defined (WIN32) || defined (__MSDOS__) || \ - defined (__DJGPP__) || defined (__OS2__) || defined (__CYGWIN__) || \ - defined (__CYGWIN32__) + defined (__DJGPP__) || defined (__OS2__) # define yasm__splitpath(path, tail) yasm__splitpath_win(path, tail) # else # define yasm__splitpath(path, tail) yasm__splitpath_unix(path, tail) @@ -173,8 +172,7 @@ char *yasm__combpath_win(const char *from, const char *to); */ #ifndef yasm__combpath # if defined (_WIN32) || defined (WIN32) || defined (__MSDOS__) || \ - defined (__DJGPP__) || defined (__OS2__) || defined (__CYGWIN__) || \ - defined (__CYGWIN32__) + defined (__DJGPP__) || defined (__OS2__) # define yasm__combpath(from, to) yasm__combpath_win(from, to) # else # define yasm__combpath(from, to) yasm__combpath_unix(from, to) From bb1aaf9efd64c6d1df378111f9ddd3a9a96f49a1 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 30 Oct 2008 07:36:25 +0000 Subject: [PATCH 235/585] Fix #161: Don't require 0d/0e/0f/0t prefix on floating point numbers. While this is not mentioned in the GAS documentation, GAS doesn't require it. svn path=/trunk/yasm/; revision=2158 --- modules/parsers/gas/gas-token.re | 16 +- modules/parsers/gas/tests/Makefile.inc | 2 + modules/parsers/gas/tests/gas-float.asm | 2 + modules/parsers/gas/tests/gas-float.hex | 376 ++++++++++++++++++++++++ 4 files changed, 395 insertions(+), 1 deletion(-) create mode 100644 modules/parsers/gas/tests/gas-float.asm create mode 100644 modules/parsers/gas/tests/gas-float.hex diff --git a/modules/parsers/gas/gas-token.re b/modules/parsers/gas/gas-token.re index c08da11a..0ac61f12 100644 --- a/modules/parsers/gas/gas-token.re +++ b/modules/parsers/gas/gas-token.re @@ -350,7 +350,21 @@ scan: } /* floating point value */ - "0" [DdEeFfTt] [-+]? (digit+)? ("." digit*)? ('e' [-+]? digit+)? { + [-+]? digit* "." digit+ ('e' [-+]? digit+)? { + savech = s->tok[TOKLEN]; + s->tok[TOKLEN] = '\0'; + lvalp->flt = yasm_floatnum_create(TOK); + s->tok[TOKLEN] = savech; + RETURN(FLTNUM); + } + [-+]? digit+ "." digit* ('e' [-+]? digit+)? { + savech = s->tok[TOKLEN]; + s->tok[TOKLEN] = '\0'; + lvalp->flt = yasm_floatnum_create(TOK); + s->tok[TOKLEN] = savech; + RETURN(FLTNUM); + } + "0" [DdEeFfTt] [-+]? digit* ("." digit*)? ('e' [-+]? digit+)? { savech = s->tok[TOKLEN]; s->tok[TOKLEN] = '\0'; lvalp->flt = yasm_floatnum_create(TOK+2); diff --git a/modules/parsers/gas/tests/Makefile.inc b/modules/parsers/gas/tests/Makefile.inc index 44827334..756e3251 100644 --- a/modules/parsers/gas/tests/Makefile.inc +++ b/modules/parsers/gas/tests/Makefile.inc @@ -14,6 +14,8 @@ EXTRA_DIST += modules/parsers/gas/tests/execsect.asm EXTRA_DIST += modules/parsers/gas/tests/execsect.hex EXTRA_DIST += modules/parsers/gas/tests/gas-fill.asm EXTRA_DIST += modules/parsers/gas/tests/gas-fill.hex +EXTRA_DIST += modules/parsers/gas/tests/gas-float.asm +EXTRA_DIST += modules/parsers/gas/tests/gas-float.hex EXTRA_DIST += modules/parsers/gas/tests/gas-instlabel.asm EXTRA_DIST += modules/parsers/gas/tests/gas-instlabel.hex EXTRA_DIST += modules/parsers/gas/tests/gas-line-err.asm diff --git a/modules/parsers/gas/tests/gas-float.asm b/modules/parsers/gas/tests/gas-float.asm new file mode 100644 index 00000000..7101eed6 --- /dev/null +++ b/modules/parsers/gas/tests/gas-float.asm @@ -0,0 +1,2 @@ +.double 0.1 +.double -.0 diff --git a/modules/parsers/gas/tests/gas-float.hex b/modules/parsers/gas/tests/gas-float.hex new file mode 100644 index 00000000..4daadf4c --- /dev/null +++ b/modules/parsers/gas/tests/gas-float.hex @@ -0,0 +1,376 @@ +7f +45 +4c +46 +01 +01 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +03 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +b0 +00 +00 +00 +00 +00 +00 +00 +34 +00 +00 +00 +00 +00 +28 +00 +05 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +9a +99 +99 +99 +99 +99 +b9 +3f +00 +00 +00 +00 +00 +00 +00 +80 +00 +2e +74 +65 +78 +74 +00 +2e +73 +74 +72 +74 +61 +62 +00 +2e +73 +79 +6d +74 +61 +62 +00 +2e +73 +68 +73 +74 +72 +74 +61 +62 +00 +00 +00 +00 +00 +2d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +f1 +ff +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +17 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +50 +00 +00 +00 +21 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +07 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +74 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +0f +00 +00 +00 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +78 +00 +00 +00 +30 +00 +00 +00 +02 +00 +00 +00 +03 +00 +00 +00 +04 +00 +00 +00 +10 +00 +00 +00 +01 +00 +00 +00 +01 +00 +00 +00 +06 +00 +00 +00 +00 +00 +00 +00 +40 +00 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 From 36598c73343484bf56e84bb7512e2ae9cf22b56b Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 25 Nov 2008 09:16:26 +0000 Subject: [PATCH 236/585] Don't assume CPP_PROG is 3 characters long (e.g. "gcc -E" isn't). Reported and fix submitted by: Mark Charney svn path=/trunk/yasm/; revision=2159 --- modules/preprocs/cpp/cpp-preproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/preprocs/cpp/cpp-preproc.c b/modules/preprocs/cpp/cpp-preproc.c index c58e4044..821b98b5 100644 --- a/modules/preprocs/cpp/cpp-preproc.c +++ b/modules/preprocs/cpp/cpp-preproc.c @@ -103,7 +103,7 @@ cpp_build_cmdline(yasm_preproc_cpp *pp, const char *extra) cmdline = p = yasm_xmalloc(strlen(CPP_PROG)+CMDLINE_SIZE); limit = p + CMDLINE_SIZE; strcpy(p, CPP_PROG); - p += 3; + p += strlen(CPP_PROG); arg = TAILQ_FIRST(&pp->cpp_args); From 1af17712ca011ba64a20653413032d543ced7017 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 5 Dec 2008 07:13:33 +0000 Subject: [PATCH 237/585] gen_x86_insn.py: Handle invalid rcstag. This can happen if somehow this file is retrieved without expanded keywords (e.g. directly from the webpage, or via something like git-svn). Reported by: Patrick Walton svn path=/trunk/yasm/; revision=2160 --- modules/arch/x86/gen_x86_insn.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index 95202d01..9dcae4ba 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -26,8 +26,12 @@ # # NOTE: operands are arranged in NASM / Intel order (e.g. dest, src) rcstag = "$Id$" -scriptname = rcstag.split()[1] -scriptrev = rcstag.split()[2] +try: + scriptname = rcstag.split()[1] + scriptrev = rcstag.split()[2] +except IndexError: + scriptname = "gen_x86_insn.py" + scriptrev = "HEAD" ordered_cpus = [ "086", "186", "286", "386", "486", "586", "686", "K6", "Athlon", "P3", From 6eaa345a2c6246be6f48463823cf6f447b27c0c4 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 7 Dec 2008 02:49:22 +0000 Subject: [PATCH 238/585] Fix Mach-O alignment handling by aligning start and end of every section. Reported and patch by: David DeHaven svn path=/trunk/yasm/; revision=2161 --- modules/objfmts/macho/macho-objfmt.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/objfmts/macho/macho-objfmt.c b/modules/objfmts/macho/macho-objfmt.c index 10d5893a..e825dbef 100644 --- a/modules/objfmts/macho/macho-objfmt.c +++ b/modules/objfmts/macho/macho-objfmt.c @@ -978,6 +978,7 @@ macho_objfmt_calc_sectsize(yasm_section *sect, /*@null@ */ void *d) /*@null@ */ macho_objfmt_output_info *info = (macho_objfmt_output_info *) d; /*@dependent@ *//*@null@ */ macho_section_data *msd; + unsigned long align; assert(info != NULL); msd = yasm_section_get_data(sect, &macho_section_data_cb); @@ -994,6 +995,16 @@ macho_objfmt_calc_sectsize(yasm_section *sect, /*@null@ */ void *d) msd->vmoff = info->vmsize; info->vmsize += msd->size; + /* align both start and end of section */ + align = yasm_section_get_align(sect); + if (align != 0) { + unsigned long delta = msd->vmoff % align; + if (delta > 0) { + msd->vmoff += align - delta; + info->vmsize += delta; + } + } + return 0; } From 3f620d2dcbe06780c772f60ab97db23f1f6c9eb4 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 21 Dec 2008 10:57:36 +0000 Subject: [PATCH 239/585] Legalize effective addresses such as [eax*2+ebx*2-ebx]. These were incorrectly identified as invalid. The code would see the ebx*2 term and identify ebx as the index register. After the ebx was subtracted, the ebx remained in the index register slot, so eax*2 had nowhere to go. The code now recognizes this case and frees the slot when the -ebx is processed, leaving the index register selection up to the main part of the code. svn path=/trunk/yasm/; revision=2162 --- modules/arch/x86/tests/effaddr.asm | 1 + modules/arch/x86/tests/effaddr.hex | 4 ++++ modules/arch/x86/x86expr.c | 26 ++++++++++++++++++++++---- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/modules/arch/x86/tests/effaddr.asm b/modules/arch/x86/tests/effaddr.asm index 5a165c9a..1a22a158 100644 --- a/modules/arch/x86/tests/effaddr.asm +++ b/modules/arch/x86/tests/effaddr.asm @@ -15,3 +15,4 @@ label dd 5 label2 ;mov ax,[eax+ebx*(label2-label)] ; not supported +mov ax,[eax*2+ebx*2-ebx] diff --git a/modules/arch/x86/tests/effaddr.hex b/modules/arch/x86/tests/effaddr.hex index b3628f0d..225a2152 100644 --- a/modules/arch/x86/tests/effaddr.hex +++ b/modules/arch/x86/tests/effaddr.hex @@ -57,3 +57,7 @@ f8 00 00 00 +66 +8b +04 +43 diff --git a/modules/arch/x86/x86expr.c b/modules/arch/x86/x86expr.c index b141a121..2acd6a9f 100644 --- a/modules/arch/x86/x86expr.c +++ b/modules/arch/x86/x86expr.c @@ -339,6 +339,7 @@ x86_expr_checkea_getregusage(yasm_expr **ep, /*@null@*/ int *indexreg, */ if (e->terms[i].data.expn->terms[0].type == YASM_EXPR_REG) { + long delta; if (e->terms[i].data.expn->terms[1].type != YASM_EXPR_INT) yasm_internal_error( @@ -347,13 +348,19 @@ x86_expr_checkea_getregusage(yasm_expr **ep, /*@null@*/ int *indexreg, ®num, data); if (!reg) return 1; - (*reg) += yasm_intnum_get_int( + delta = yasm_intnum_get_int( e->terms[i].data.expn->terms[1].data.intn); + (*reg) += delta; /* Let last, largest multipler win indexreg */ - if (indexreg && *reg > 0 && indexval <= *reg) { + if (indexreg && delta > 0 && indexval <= *reg) { *indexreg = regnum; indexval = *reg; indexmult = 1; + } else if (indexreg && *indexreg == regnum && + delta < 0 && *reg <= 1) { + *indexreg = -1; + indexval = 0; + indexmult = 0; } } } @@ -363,6 +370,7 @@ x86_expr_checkea_getregusage(yasm_expr **ep, /*@null@*/ int *indexreg, /* Here, too, check for non-int multipliers against a reg. */ yasm_expr__order_terms(e); if (e->terms[0].type == YASM_EXPR_REG) { + long delta; if (e->numterms > 2) return 1; if (e->terms[1].type != YASM_EXPR_INT) @@ -370,9 +378,19 @@ x86_expr_checkea_getregusage(yasm_expr **ep, /*@null@*/ int *indexreg, reg = get_reg(&e->terms[0], ®num, data); if (!reg) return 1; - (*reg) += yasm_intnum_get_int(e->terms[1].data.intn); + delta = yasm_intnum_get_int(e->terms[1].data.intn); + (*reg) += delta; if (indexreg) - *indexreg = regnum; + { + if (delta < 0 && *reg <= 1) + { + *indexreg = -1; + indexval = 0; + indexmult = 0; + } + else + *indexreg = regnum; + } } break; case YASM_EXPR_SEGOFF: From cdbf4a94348f833a5ebec05467b6722e5877bba6 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 24 Dec 2008 06:17:54 +0000 Subject: [PATCH 240/585] gas-parse.c: Fix double-free on error. svn path=/trunk/yasm/; revision=2163 --- modules/parsers/gas/gas-parse.c | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/parsers/gas/gas-parse.c b/modules/parsers/gas/gas-parse.c index de46afff..e3bd6f7a 100644 --- a/modules/parsers/gas/gas-parse.c +++ b/modules/parsers/gas/gas-parse.c @@ -1467,7 +1467,6 @@ parse_expr2(yasm_parser_gas *parser_gas) if (!expect(ID)) { yasm_error_set(YASM_ERROR_SYNTAX, N_("expected identifier after `@'")); - yasm_xfree(name); return NULL; } wrt = yasm_objfmt_get_special_sym(p_object, ID_val, "gas"); From ff8b0ae836dbfa06a5fb0f25da70d47b8ff5a4cb Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 2 Jan 2009 07:27:39 +0000 Subject: [PATCH 241/585] Gas parser: Move instruction/prefix lookup from tokenizer to parser. Use the single token of lookahead to detect the label case. This is significantly cleaner as it removes the special-casing of labels in the tokenizer (so there is just a single identifier rule) and removes the INSTDIR parser state (as this was only used to prevent instruction lookup within other locations). Also, ID and LABEL now provide the string length to the parser. We needed to do this for ID due to parse_check_insnprefix() needing the length, so both were folded in for consistency. svn path=/trunk/yasm/; revision=2164 --- modules/parsers/gas/gas-parse.c | 130 ++++++++++++++++++------------- modules/parsers/gas/gas-parser.h | 12 +-- modules/parsers/gas/gas-token.re | 74 +++++------------- 3 files changed, 98 insertions(+), 118 deletions(-) diff --git a/modules/parsers/gas/gas-parse.c b/modules/parsers/gas/gas-parse.c index e3bd6f7a..41b1888d 100644 --- a/modules/parsers/gas/gas-parse.c +++ b/modules/parsers/gas/gas-parse.c @@ -32,6 +32,7 @@ RCSID("$Id$"); #include +#include #include #include @@ -108,14 +109,9 @@ destroy_curtok_(yasm_parser_gas *parser_gas) break; case ID: case LABEL: - yasm_xfree(curval.str_val); - break; case STRING: yasm_xfree(curval.str.contents); break; - case INSN: - yasm_bc_destroy(curval.bc); - break; default: break; } @@ -156,8 +152,6 @@ expect_(yasm_parser_gas *parser_gas, int token) case INTNUM: str = "integer"; break; case FLTNUM: str = "floating point value"; break; case STRING: str = "string"; break; - case INSN: str = "instruction"; break; - case PREFIX: str = "instruction prefix"; break; case REG: str = "register"; break; case REGGROUP: str = "register group"; break; case SEGREG: str = "segment register"; break; @@ -205,7 +199,6 @@ parse_line(yasm_parser_gas *parser_gas) return dir->handler(parser_gas, dir->param); } - parser_gas->state = INSTDIR; get_next_token(); /* ID */ if (curtok == ':') { /* Label */ @@ -939,15 +932,38 @@ static yasm_bytecode * parse_instr(yasm_parser_gas *parser_gas) { yasm_bytecode *bc; + char *id; + size_t id_len; + uintptr_t prefix; - switch (curtok) { - case INSN: + if (curtok != ID) + return NULL; + + id = ID_val; + id_len = ID_len; + + /* instructions/prefixes must start with a letter */ + if (!isalpha(id[0])) + return NULL; + + /* check to be sure it's not a label */ + get_peek_token(parser_gas); + if (parser_gas->peek_token == ':') + return NULL; + + switch (yasm_arch_parse_check_insnprefix + (p_object->arch, ID_val, ID_len, cur_line, &bc, &prefix)) { + case YASM_ARCH_INSN: { yasm_insn *insn; - bc = INSN_val; + + /* Propagate errors in case we got a warning from the arch */ + yasm_errwarn_propagate(parser_gas->errwarns, cur_line); + insn = yasm_bc_get_insn(bc); - get_next_token(); + yasm_xfree(id); + get_next_token(); /* ID */ if (is_eol()) return bc; /* no operands */ @@ -972,16 +988,21 @@ parse_instr(yasm_parser_gas *parser_gas) } return bc; } - case PREFIX: + case YASM_ARCH_PREFIX: { - uintptr_t prefix = PREFIX_val; - get_next_token(); /* PREFIX */ + /* Propagate errors in case we got a warning from the arch */ + yasm_errwarn_propagate(parser_gas->errwarns, cur_line); + + yasm_xfree(id); + get_next_token(); /* ID */ bc = parse_instr(parser_gas); if (!bc) bc = yasm_arch_create_empty_insn(p_object->arch, cur_line); yasm_insn_add_prefix(yasm_bc_get_insn(bc), prefix); return bc; } +#if 0 + /* TODO */ case SEGREG: { uintptr_t segreg = SEGREG_val; @@ -991,6 +1012,7 @@ parse_instr(yasm_parser_gas *parser_gas) bc = yasm_arch_create_empty_insn(p_object->arch, cur_line); yasm_insn_add_seg_prefix(yasm_bc_get_insn(bc), segreg); } +#endif default: return NULL; } @@ -1652,59 +1674,59 @@ gas_parser_dir_fill(yasm_parser_gas *parser_gas, /*@only@*/ yasm_expr *repeat, static dir_lookup dirs_static[] = { /* FIXME: Whether this is power-of-two or not depends on arch and objfmt. */ - {".align", dir_align, 0, INSTDIR}, - {".p2align", dir_align, 1, INSTDIR}, - {".balign", dir_align, 0, INSTDIR}, - {".org", dir_org, 0, INSTDIR}, + {".align", dir_align, 0, INITIAL}, + {".p2align", dir_align, 1, INITIAL}, + {".balign", dir_align, 0, INITIAL}, + {".org", dir_org, 0, INITIAL}, /* data visibility directives */ - {".local", dir_local, 0, INSTDIR}, - {".comm", dir_comm, 0, INSTDIR}, - {".lcomm", dir_comm, 1, INSTDIR}, + {".local", dir_local, 0, INITIAL}, + {".comm", dir_comm, 0, INITIAL}, + {".lcomm", dir_comm, 1, INITIAL}, /* integer data declaration directives */ - {".byte", dir_data, 1, INSTDIR}, - {".2byte", dir_data, 2, INSTDIR}, - {".4byte", dir_data, 4, INSTDIR}, - {".8byte", dir_data, 8, INSTDIR}, - {".16byte", dir_data, 16, INSTDIR}, + {".byte", dir_data, 1, INITIAL}, + {".2byte", dir_data, 2, INITIAL}, + {".4byte", dir_data, 4, INITIAL}, + {".8byte", dir_data, 8, INITIAL}, + {".16byte", dir_data, 16, INITIAL}, /* TODO: These should depend on arch */ - {".short", dir_data, 2, INSTDIR}, - {".int", dir_data, 4, INSTDIR}, - {".long", dir_data, 4, INSTDIR}, - {".hword", dir_data, 2, INSTDIR}, - {".quad", dir_data, 8, INSTDIR}, - {".octa", dir_data, 16, INSTDIR}, + {".short", dir_data, 2, INITIAL}, + {".int", dir_data, 4, INITIAL}, + {".long", dir_data, 4, INITIAL}, + {".hword", dir_data, 2, INITIAL}, + {".quad", dir_data, 8, INITIAL}, + {".octa", dir_data, 16, INITIAL}, /* XXX: At least on x86, this is 2 bytes */ - {".value", dir_data, 2, INSTDIR}, + {".value", dir_data, 2, INITIAL}, /* ASCII data declaration directives */ - {".ascii", dir_ascii, 0, INSTDIR}, /* no terminating zero */ - {".asciz", dir_ascii, 1, INSTDIR}, /* add terminating zero */ - {".string", dir_ascii, 1, INSTDIR}, /* add terminating zero */ + {".ascii", dir_ascii, 0, INITIAL}, /* no terminating zero */ + {".asciz", dir_ascii, 1, INITIAL}, /* add terminating zero */ + {".string", dir_ascii, 1, INITIAL}, /* add terminating zero */ /* LEB128 integer data declaration directives */ - {".sleb128", dir_leb128, 1, INSTDIR}, /* signed */ - {".uleb128", dir_leb128, 0, INSTDIR}, /* unsigned */ + {".sleb128", dir_leb128, 1, INITIAL}, /* signed */ + {".uleb128", dir_leb128, 0, INITIAL}, /* unsigned */ /* floating point data declaration directives */ - {".float", dir_data, 4, INSTDIR}, - {".single", dir_data, 4, INSTDIR}, - {".double", dir_data, 8, INSTDIR}, - {".tfloat", dir_data, 10, INSTDIR}, + {".float", dir_data, 4, INITIAL}, + {".single", dir_data, 4, INITIAL}, + {".double", dir_data, 8, INITIAL}, + {".tfloat", dir_data, 10, INITIAL}, /* section directives */ {".bss", dir_bss_section, 0, INITIAL}, {".data", dir_data_section, 0, INITIAL}, {".text", dir_text_section, 0, INITIAL}, {".section", dir_section, 0, SECTION_DIRECTIVE}, /* macro directives */ - {".rept", dir_rept, 0, INSTDIR}, - {".endr", dir_endr, 0, INSTDIR}, + {".rept", dir_rept, 0, INITIAL}, + {".endr", dir_endr, 0, INITIAL}, /* empty space/fill directives */ - {".skip", dir_skip, 0, INSTDIR}, - {".space", dir_skip, 0, INSTDIR}, - {".fill", dir_fill, 0, INSTDIR}, - {".zero", dir_zero, 0, INSTDIR}, + {".skip", dir_skip, 0, INITIAL}, + {".space", dir_skip, 0, INITIAL}, + {".fill", dir_fill, 0, INITIAL}, + {".zero", dir_zero, 0, INITIAL}, /* other directives */ - {".equ", dir_equ, 0, INSTDIR}, - {".file", dir_file, 0, INSTDIR}, - {".line", dir_line, 0, INSTDIR}, - {".set", dir_equ, 0, INSTDIR} + {".equ", dir_equ, 0, INITIAL}, + {".file", dir_file, 0, INITIAL}, + {".line", dir_line, 0, INITIAL}, + {".set", dir_equ, 0, INITIAL} }; static void @@ -1722,7 +1744,7 @@ gas_parser_parse(yasm_parser_gas *parser_gas) word.name = ".word"; word.handler = dir_data; word.param = yasm_arch_wordsize(p_object->arch)/8; - word.newstate = INSTDIR; + word.newstate = INITIAL; /* Create directive lookup */ parser_gas->dirs = HAMT_create(1, yasm_internal_error_); diff --git a/modules/parsers/gas/gas-parser.h b/modules/parsers/gas/gas-parser.h index 70704b53..3463563f 100644 --- a/modules/parsers/gas/gas-parser.h +++ b/modules/parsers/gas/gas-parser.h @@ -38,8 +38,6 @@ enum tokentype { INTNUM = 258, FLTNUM, STRING, - INSN, - PREFIX, REG, REGGROUP, SEGREG, @@ -55,7 +53,6 @@ enum tokentype { typedef union { unsigned int int_info; - char *str_val; yasm_intnum *intn; yasm_floatnum *flt; yasm_bytecode *bc; @@ -91,7 +88,6 @@ enum gas_parser_state { INITIAL, COMMENT, SECTION_DIRECTIVE, - INSTDIR, NASM_FILENAME }; @@ -164,14 +160,14 @@ typedef struct yasm_parser_gas { #define INTNUM_val (curval.intn) #define FLTNUM_val (curval.flt) #define STRING_val (curval.str) -#define INSN_val (curval.bc) -#define PREFIX_val (curval.arch_data) #define REG_val (curval.arch_data) #define REGGROUP_val (curval.arch_data) #define SEGREG_val (curval.arch_data) #define TARGETMOD_val (curval.arch_data) -#define ID_val (curval.str_val) -#define LABEL_val (curval.str_val) +#define ID_val (curval.str.contents) +#define ID_len (curval.str.len) +#define LABEL_val (curval.str.contents) +#define LABEL_len (curval.str.len) #define cur_line (yasm_linemap_get_current(parser_gas->linemap)) diff --git a/modules/parsers/gas/gas-token.re b/modules/parsers/gas/gas-token.re index 0ac61f12..0a68af59 100644 --- a/modules/parsers/gas/gas-token.re +++ b/modules/parsers/gas/gas-token.re @@ -393,9 +393,10 @@ scan: RETURN(s->tok[0]); } - /* label or maybe directive */ - [_.][a-zA-Z0-9_$.]* { - lvalp->str_val = yasm__xstrndup(TOK, TOKLEN); + /* identifier */ + [a-zA-Z_.][a-zA-Z0-9_$.]* { + lvalp->str.contents = yasm__xstrndup(TOK, TOKLEN); + lvalp->str.len = TOKLEN; RETURN(ID); } @@ -429,75 +430,35 @@ scan: RETURN(REG); } - /* label */ - [a-zA-Z][a-zA-Z0-9_$.]* ws* ':' { - /* strip off colon and any whitespace */ - count = TOKLEN-1; - while (s->tok[count] == ' ' || s->tok[count] == '\t' - || s->tok[count] == '\r') - count--; - /* Just an identifier, return as such. */ - lvalp->str_val = yasm__xstrndup(TOK, count); - RETURN(LABEL); - } - /* local label */ [0-9] ':' { /* increment label index */ parser_gas->local[s->tok[0]-'0']++; /* build local label name */ - lvalp->str_val = yasm_xmalloc(30); - sprintf(lvalp->str_val, "L%c\001%lu", s->tok[0], - parser_gas->local[s->tok[0]-'0']); + lvalp->str.contents = yasm_xmalloc(30); + lvalp->str.len = + sprintf(lvalp->str.contents, "L%c\001%lu", s->tok[0], + parser_gas->local[s->tok[0]-'0']); RETURN(LABEL); } /* local label forward reference */ [0-9] 'f' { /* build local label name */ - lvalp->str_val = yasm_xmalloc(30); - sprintf(lvalp->str_val, "L%c\001%lu", s->tok[0], - parser_gas->local[s->tok[0]-'0']+1); + lvalp->str.contents = yasm_xmalloc(30); + lvalp->str.len = + sprintf(lvalp->str.contents, "L%c\001%lu", s->tok[0], + parser_gas->local[s->tok[0]-'0']+1); RETURN(ID); } /* local label backward reference */ [0-9] 'b' { /* build local label name */ - lvalp->str_val = yasm_xmalloc(30); - sprintf(lvalp->str_val, "L%c\001%lu", s->tok[0], - parser_gas->local[s->tok[0]-'0']); - RETURN(ID); - } - - /* identifier that may be an instruction, etc. */ - [a-zA-Z][a-zA-Z0-9_$.]* { - /* Can only be an instruction/prefix when not inside an - * instruction or directive. - */ - if (parser_gas->state != INSTDIR) { - uintptr_t prefix; - savech = s->tok[TOKLEN]; - s->tok[TOKLEN] = '\0'; - switch (yasm_arch_parse_check_insnprefix - (p_object->arch, TOK, TOKLEN, cur_line, &lvalp->bc, - &prefix)) { - case YASM_ARCH_INSN: - s->tok[TOKLEN] = savech; - parser_gas->state = INSTDIR; - RETURN(INSN); - case YASM_ARCH_PREFIX: - lvalp->arch_data = prefix; - s->tok[TOKLEN] = savech; - RETURN(PREFIX); - default: - s->tok[TOKLEN] = savech; - } - } - /* Propagate errors in case we got a warning from the arch */ - yasm_errwarn_propagate(parser_gas->errwarns, cur_line); - /* Just an identifier, return as such. */ - lvalp->str_val = yasm__xstrndup(TOK, TOKLEN); + lvalp->str.contents = yasm_xmalloc(30); + lvalp->str.len = + sprintf(lvalp->str.contents, "L%c\001%lu", s->tok[0], + parser_gas->local[s->tok[0]-'0']); RETURN(ID); } @@ -560,7 +521,8 @@ section_directive: /*!re2c [a-zA-Z0-9_$.-]+ { - lvalp->str_val = yasm__xstrndup(TOK, TOKLEN); + lvalp->str.contents = yasm__xstrndup(TOK, TOKLEN); + lvalp->str.len = TOKLEN; parser_gas->state = INITIAL; RETURN(ID); } From f8113755e55da628a1f903ed74f1b97562ea5bd2 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 2 Jan 2009 08:15:58 +0000 Subject: [PATCH 242/585] elf-x86id.asm testcase: Don't require NASM preproc. svn path=/trunk/yasm/; revision=2165 --- modules/objfmts/elf/tests/elf-x86id.asm | 588 ++++++++++++------------ 1 file changed, 294 insertions(+), 294 deletions(-) diff --git a/modules/objfmts/elf/tests/elf-x86id.asm b/modules/objfmts/elf/tests/elf-x86id.asm index e083fdd5..04b4a039 100644 --- a/modules/objfmts/elf/tests/elf-x86id.asm +++ b/modules/objfmts/elf/tests/elf-x86id.asm @@ -5,37 +5,37 @@ ;#APP ;.ident "$Id$" ;#NO_APP -extern yasm_internal_error_ -extern yasm_expr_copy -extern yasm_expr_expr -extern yasm_expr_new -extern yasm_symrec_define_label -extern yasm_x86_LTX_mode_bits -extern yasm_x86__bc_new_jmp -extern yasm_ea_get_disp -extern yasm_expr__contains -extern yasm_x86__get_reg_size -extern yasm__error -extern yasm_intnum_new_uint -extern yasm_expr_int -extern yasm_ea_delete -extern yasm_expr_delete -extern yasm_x86__ea_new_reg -extern yasm_x86__ea_set_disponly -extern yasm_x86__ea_new_imm -extern yasm_x86__set_rex_from_reg -extern yasm_xfree -extern yasm_x86__bc_new_insn -extern yasm__warning +[extern yasm_internal_error_] +[extern yasm_expr_copy] +[extern yasm_expr_expr] +[extern yasm_expr_new] +[extern yasm_symrec_define_label] +[extern yasm_x86_LTX_mode_bits] +[extern yasm_x86__bc_new_jmp] +[extern yasm_ea_get_disp] +[extern yasm_expr__contains] +[extern yasm_x86__get_reg_size] +[extern yasm__error] +[extern yasm_intnum_new_uint] +[extern yasm_expr_int] +[extern yasm_ea_delete] +[extern yasm_expr_delete] +[extern yasm_x86__ea_new_reg] +[extern yasm_x86__ea_set_disponly] +[extern yasm_x86__ea_new_imm] +[extern yasm_x86__set_rex_from_reg] +[extern yasm_xfree] +[extern yasm_x86__bc_new_insn] +[extern yasm__warning] - section .data - align 4 + [section .data] + [align 4] ;.type cpu_enabled,@object ;.size cpu_enabled,4 cpu_enabled: dd -1 - section .rodata - align 4 + [section .rodata] + [align 4] ;.type not64_insn,@object ;.size not64_insn,28 not64_insn: @@ -52,7 +52,7 @@ not64_insn: dd 0 dd 0 dd 0 - align 4 + [align 4] ;.type onebyte_insn,@object ;.size onebyte_insn,28 onebyte_insn: @@ -69,7 +69,7 @@ onebyte_insn: dd 0 dd 0 dd 0 - align 4 + [align 4] ;.type twobyte_insn,@object ;.size twobyte_insn,28 twobyte_insn: @@ -86,7 +86,7 @@ twobyte_insn: dd 0 dd 0 dd 0 - align 4 + [align 4] ;.type threebyte_insn,@object ;.size threebyte_insn,28 threebyte_insn: @@ -103,7 +103,7 @@ threebyte_insn: dd 0 dd 0 dd 0 - align 4 + [align 4] ;.type onebytemem_insn,@object ;.size onebytemem_insn,28 onebytemem_insn: @@ -120,7 +120,7 @@ onebytemem_insn: dd 4098 dd 0 dd 0 - align 4 + [align 4] ;.type twobytemem_insn,@object ;.size twobytemem_insn,28 twobytemem_insn: @@ -137,7 +137,7 @@ twobytemem_insn: dd 4098 dd 0 dd 0 - align 32 + [align 32] ;.type mov_insn,@object ;.size mov_insn,1260 mov_insn: @@ -726,7 +726,7 @@ mov_insn: dd 4225 dd 16488 dd 0 - align 32 + [align 32] ;.type movszx_insn,@object ;.size movszx_insn,140 movszx_insn: @@ -795,7 +795,7 @@ movszx_insn: dd 16513 dd 4163 dd 0 - align 4 + [align 4] ;.type movsxd_insn,@object ;.size movsxd_insn,28 movsxd_insn: @@ -812,7 +812,7 @@ movsxd_insn: dd 16513 dd 4195 dd 0 - align 32 + [align 32] ;.type push_insn,@object ;.size push_insn,784 push_insn: @@ -1180,7 +1180,7 @@ push_insn: dd 114 dd 0 dd 0 - align 32 + [align 32] ;.type pop_insn,@object ;.size pop_insn,588 pop_insn: @@ -1457,7 +1457,7 @@ pop_insn: dd 114 dd 0 dd 0 - align 32 + [align 32] ;.type xchg_insn,@object ;.size xchg_insn,392 xchg_insn: @@ -1643,7 +1643,7 @@ xchg_insn: dd 16513 dd 4483 dd 0 - align 32 + [align 32] ;.type in_insn,@object ;.size in_insn,168 in_insn: @@ -1725,7 +1725,7 @@ in_insn: dd 107 dd 77 dd 0 - align 32 + [align 32] ;.type out_insn,@object ;.size out_insn,168 out_insn: @@ -1807,7 +1807,7 @@ out_insn: dd 77 dd 107 dd 0 - align 32 + [align 32] ;.type lea_insn,@object ;.size lea_insn,84 lea_insn: @@ -1850,7 +1850,7 @@ lea_insn: dd 16513 dd 4482 dd 0 - align 32 + [align 32] ;.type ldes_insn,@object ;.size ldes_insn,56 ldes_insn: @@ -1880,7 +1880,7 @@ ldes_insn: dd 16481 dd 4098 dd 0 - align 32 + [align 32] ;.type lfgss_insn,@object ;.size lfgss_insn,56 lfgss_insn: @@ -1910,7 +1910,7 @@ lfgss_insn: dd 16481 dd 4098 dd 0 - align 32 + [align 32] ;.type arith_insn,@object ;.size arith_insn,644 arith_insn: @@ -2213,7 +2213,7 @@ arith_insn: dd 16513 dd 4483 dd 0 - align 32 + [align 32] ;.type incdec_insn,@object ;.size incdec_insn,168 incdec_insn: @@ -2295,7 +2295,7 @@ incdec_insn: dd 4227 dd 0 dd 0 - align 32 + [align 32] ;.type f6_insn,@object ;.size f6_insn,112 f6_insn: @@ -2351,7 +2351,7 @@ f6_insn: dd 4227 dd 0 dd 0 - align 32 + [align 32] ;.type test_insn,@object ;.size test_insn,560 test_insn: @@ -2615,7 +2615,7 @@ test_insn: dd 16513 dd 4483 dd 0 - align 32 + [align 32] ;.type aadm_insn,@object ;.size aadm_insn,56 aadm_insn: @@ -2645,7 +2645,7 @@ aadm_insn: dd 8480 dd 0 dd 0 - align 32 + [align 32] ;.type imul_insn,@object ;.size imul_insn,532 imul_insn: @@ -2896,7 +2896,7 @@ imul_insn: dd 28801 dd 143712 dd 0 - align 32 + [align 32] ;.type shift_insn,@object ;.size shift_insn,224 shift_insn: @@ -3004,7 +3004,7 @@ shift_insn: dd 4227 dd 74016 dd 0 - align 32 + [align 32] ;.type shlrd_insn,@object ;.size shlrd_insn,168 shlrd_insn: @@ -3086,7 +3086,7 @@ shlrd_insn: dd 4483 dd 16513 dd 44 - align 32 + [align 32] ;.type call_insn,@object ;.size call_insn,560 call_insn: @@ -3350,7 +3350,7 @@ call_insn: dd 5634 dd 0 dd 0 - align 32 + [align 32] ;.type jmp_insn,@object ;.size jmp_insn,588 jmp_insn: @@ -3627,7 +3627,7 @@ jmp_insn: dd 5634 dd 0 dd 0 - align 32 + [align 32] ;.type retnf_insn,@object ;.size retnf_insn,56 retnf_insn: @@ -3657,7 +3657,7 @@ retnf_insn: dd 8512 dd 0 dd 0 - align 4 + [align 4] ;.type enter_insn,@object ;.size enter_insn,28 enter_insn: @@ -3674,7 +3674,7 @@ enter_insn: dd 4416 dd 8480 dd 0 - align 32 + [align 32] ;.type jcc_insn,@object ;.size jcc_insn,196 jcc_insn: @@ -3769,7 +3769,7 @@ jcc_insn: dd 33280 dd 0 dd 0 - align 32 + [align 32] ;.type jcxz_insn,@object ;.size jcxz_insn,56 jcxz_insn: @@ -3799,7 +3799,7 @@ jcxz_insn: dd 33792 dd 0 dd 0 - align 32 + [align 32] ;.type loop_insn,@object ;.size loop_insn,224 loop_insn: @@ -3907,7 +3907,7 @@ loop_insn: dd 33792 dd 37004 dd 0 - align 4 + [align 4] ;.type setcc_insn,@object ;.size setcc_insn,28 setcc_insn: @@ -3924,7 +3924,7 @@ setcc_insn: dd 4387 dd 0 dd 0 - align 32 + [align 32] ;.type bittest_insn,@object ;.size bittest_insn,168 bittest_insn: @@ -4006,7 +4006,7 @@ bittest_insn: dd 4227 dd 8224 dd 0 - align 32 + [align 32] ;.type bsfr_insn,@object ;.size bsfr_insn,84 bsfr_insn: @@ -4049,7 +4049,7 @@ bsfr_insn: dd 16513 dd 4483 dd 0 - align 4 + [align 4] ;.type int_insn,@object ;.size int_insn,28 int_insn: @@ -4066,7 +4066,7 @@ int_insn: dd 8480 dd 0 dd 0 - align 32 + [align 32] ;.type bound_insn,@object ;.size bound_insn,56 bound_insn: @@ -4096,7 +4096,7 @@ bound_insn: dd 16481 dd 4450 dd 0 - align 4 + [align 4] ;.type arpl_insn,@object ;.size arpl_insn,28 arpl_insn: @@ -4113,7 +4113,7 @@ arpl_insn: dd 4419 dd 16449 dd 0 - align 32 + [align 32] ;.type str_insn,@object ;.size str_insn,112 str_insn: @@ -4169,7 +4169,7 @@ str_insn: dd 4419 dd 0 dd 0 - align 4 + [align 4] ;.type prot286_insn,@object ;.size prot286_insn,28 prot286_insn: @@ -4186,7 +4186,7 @@ prot286_insn: dd 4419 dd 0 dd 0 - align 32 + [align 32] ;.type sldtmsw_insn,@object ;.size sldtmsw_insn,168 sldtmsw_insn: @@ -4268,7 +4268,7 @@ sldtmsw_insn: dd 4225 dd 0 dd 0 - align 32 + [align 32] ;.type fldstp_insn,@object ;.size fldstp_insn,112 fldstp_insn: @@ -4324,7 +4324,7 @@ fldstp_insn: dd 24737 dd 0 dd 0 - align 32 + [align 32] ;.type fildstp_insn,@object ;.size fildstp_insn,84 fildstp_insn: @@ -4367,7 +4367,7 @@ fildstp_insn: dd 4226 dd 0 dd 0 - align 4 + [align 4] ;.type fbldstp_insn,@object ;.size fbldstp_insn,28 fbldstp_insn: @@ -4384,7 +4384,7 @@ fbldstp_insn: dd 4514 dd 0 dd 0 - align 32 + [align 32] ;.type fst_insn,@object ;.size fst_insn,84 fst_insn: @@ -4427,7 +4427,7 @@ fst_insn: dd 24737 dd 0 dd 0 - align 32 + [align 32] ;.type fxch_insn,@object ;.size fxch_insn,112 fxch_insn: @@ -4483,7 +4483,7 @@ fxch_insn: dd 0 dd 0 dd 0 - align 32 + [align 32] ;.type fcom_insn,@object ;.size fcom_insn,112 fcom_insn: @@ -4539,7 +4539,7 @@ fcom_insn: dd 170 dd 24737 dd 0 - align 32 + [align 32] ;.type fcom2_insn,@object ;.size fcom2_insn,56 fcom2_insn: @@ -4569,7 +4569,7 @@ fcom2_insn: dd 170 dd 24737 dd 0 - align 32 + [align 32] ;.type farith_insn,@object ;.size farith_insn,168 farith_insn: @@ -4651,7 +4651,7 @@ farith_insn: dd 24737 dd 170 dd 0 - align 32 + [align 32] ;.type farithp_insn,@object ;.size farithp_insn,84 farithp_insn: @@ -4694,7 +4694,7 @@ farithp_insn: dd 24737 dd 170 dd 0 - align 32 + [align 32] ;.type fiarith_insn,@object ;.size fiarith_insn,56 fiarith_insn: @@ -4724,7 +4724,7 @@ fiarith_insn: dd 4194 dd 0 dd 0 - align 4 + [align 4] ;.type fldnstcw_insn,@object ;.size fldnstcw_insn,28 fldnstcw_insn: @@ -4741,7 +4741,7 @@ fldnstcw_insn: dd 4418 dd 0 dd 0 - align 4 + [align 4] ;.type fstcw_insn,@object ;.size fstcw_insn,28 fstcw_insn: @@ -4758,7 +4758,7 @@ fstcw_insn: dd 4418 dd 0 dd 0 - align 32 + [align 32] ;.type fnstsw_insn,@object ;.size fnstsw_insn,56 fnstsw_insn: @@ -4788,7 +4788,7 @@ fnstsw_insn: dd 75 dd 0 dd 0 - align 32 + [align 32] ;.type fstsw_insn,@object ;.size fstsw_insn,56 fstsw_insn: @@ -4818,7 +4818,7 @@ fstsw_insn: dd 75 dd 0 dd 0 - align 4 + [align 4] ;.type ffree_insn,@object ;.size ffree_insn,28 ffree_insn: @@ -4835,7 +4835,7 @@ ffree_insn: dd 24737 dd 0 dd 0 - align 32 + [align 32] ;.type bswap_insn,@object ;.size bswap_insn,56 bswap_insn: @@ -4865,7 +4865,7 @@ bswap_insn: dd 24705 dd 0 dd 0 - align 32 + [align 32] ;.type cmpxchgxadd_insn,@object ;.size cmpxchgxadd_insn,112 cmpxchgxadd_insn: @@ -4921,7 +4921,7 @@ cmpxchgxadd_insn: dd 4483 dd 16513 dd 0 - align 4 + [align 4] ;.type cmpxchg8b_insn,@object ;.size cmpxchg8b_insn,28 cmpxchg8b_insn: @@ -4938,7 +4938,7 @@ cmpxchg8b_insn: dd 4482 dd 0 dd 0 - align 32 + [align 32] ;.type cmovcc_insn,@object ;.size cmovcc_insn,84 cmovcc_insn: @@ -4981,7 +4981,7 @@ cmovcc_insn: dd 16513 dd 4483 dd 0 - align 4 + [align 4] ;.type fcmovcc_insn,@object ;.size fcmovcc_insn,28 fcmovcc_insn: @@ -4998,7 +4998,7 @@ fcmovcc_insn: dd 170 dd 24737 dd 0 - align 32 + [align 32] ;.type movnti_insn,@object ;.size movnti_insn,56 movnti_insn: @@ -5028,7 +5028,7 @@ movnti_insn: dd 4482 dd 16513 dd 0 - align 4 + [align 4] ;.type clflush_insn,@object ;.size clflush_insn,28 clflush_insn: @@ -5045,7 +5045,7 @@ clflush_insn: dd 4386 dd 0 dd 0 - align 32 + [align 32] ;.type movd_insn,@object ;.size movd_insn,224 movd_insn: @@ -5153,7 +5153,7 @@ movd_insn: dd 4483 dd 16580 dd 0 - align 32 + [align 32] ;.type movq_insn,@object ;.size movq_insn,140 movq_insn: @@ -5222,7 +5222,7 @@ movq_insn: dd 4485 dd 16580 dd 0 - align 32 + [align 32] ;.type mmxsse2_insn,@object ;.size mmxsse2_insn,56 mmxsse2_insn: @@ -5252,7 +5252,7 @@ mmxsse2_insn: dd 16580 dd 4549 dd 0 - align 32 + [align 32] ;.type pshift_insn,@object ;.size pshift_insn,112 pshift_insn: @@ -5308,7 +5308,7 @@ pshift_insn: dd 4292 dd 8480 dd 0 - align 4 + [align 4] ;.type sseps_insn,@object ;.size sseps_insn,28 sseps_insn: @@ -5325,7 +5325,7 @@ sseps_insn: dd 16580 dd 4549 dd 0 - align 4 + [align 4] ;.type ssess_insn,@object ;.size ssess_insn,28 ssess_insn: @@ -5342,7 +5342,7 @@ ssess_insn: dd 16580 dd 4549 dd 0 - align 4 + [align 4] ;.type ssecmpps_insn,@object ;.size ssecmpps_insn,28 ssecmpps_insn: @@ -5359,7 +5359,7 @@ ssecmpps_insn: dd 16580 dd 4549 dd 0 - align 4 + [align 4] ;.type ssecmpss_insn,@object ;.size ssecmpss_insn,28 ssecmpss_insn: @@ -5376,7 +5376,7 @@ ssecmpss_insn: dd 16580 dd 4549 dd 0 - align 4 + [align 4] ;.type ssepsimm_insn,@object ;.size ssepsimm_insn,28 ssepsimm_insn: @@ -5393,7 +5393,7 @@ ssepsimm_insn: dd 16580 dd 4549 dd 8480 - align 4 + [align 4] ;.type ssessimm_insn,@object ;.size ssessimm_insn,28 ssessimm_insn: @@ -5410,7 +5410,7 @@ ssessimm_insn: dd 16580 dd 4549 dd 8480 - align 4 + [align 4] ;.type ldstmxcsr_insn,@object ;.size ldstmxcsr_insn,28 ldstmxcsr_insn: @@ -5427,7 +5427,7 @@ ldstmxcsr_insn: dd 4450 dd 0 dd 0 - align 4 + [align 4] ;.type maskmovq_insn,@object ;.size maskmovq_insn,28 maskmovq_insn: @@ -5444,7 +5444,7 @@ maskmovq_insn: dd 16516 dd 4228 dd 0 - align 32 + [align 32] ;.type movaups_insn,@object ;.size movaups_insn,56 movaups_insn: @@ -5474,7 +5474,7 @@ movaups_insn: dd 4549 dd 16580 dd 0 - align 4 + [align 4] ;.type movhllhps_insn,@object ;.size movhllhps_insn,28 movhllhps_insn: @@ -5491,7 +5491,7 @@ movhllhps_insn: dd 16580 dd 4292 dd 0 - align 32 + [align 32] ;.type movhlps_insn,@object ;.size movhlps_insn,56 movhlps_insn: @@ -5521,7 +5521,7 @@ movhlps_insn: dd 4482 dd 16580 dd 0 - align 4 + [align 4] ;.type movmskps_insn,@object ;.size movmskps_insn,28 movmskps_insn: @@ -5538,7 +5538,7 @@ movmskps_insn: dd 4193 dd 16580 dd 0 - align 4 + [align 4] ;.type movntps_insn,@object ;.size movntps_insn,28 movntps_insn: @@ -5555,7 +5555,7 @@ movntps_insn: dd 4546 dd 16577 dd 0 - align 4 + [align 4] ;.type movntq_insn,@object ;.size movntq_insn,28 movntq_insn: @@ -5572,7 +5572,7 @@ movntq_insn: dd 4482 dd 16580 dd 0 - align 32 + [align 32] ;.type movss_insn,@object ;.size movss_insn,84 movss_insn: @@ -5615,7 +5615,7 @@ movss_insn: dd 4482 dd 16580 dd 0 - align 32 + [align 32] ;.type pextrw_insn,@object ;.size pextrw_insn,56 pextrw_insn: @@ -5645,7 +5645,7 @@ pextrw_insn: dd 4193 dd 16580 dd 8480 - align 32 + [align 32] ;.type pinsrw_insn,@object ;.size pinsrw_insn,112 pinsrw_insn: @@ -5701,7 +5701,7 @@ pinsrw_insn: dd 16516 dd 4419 dd 8480 - align 32 + [align 32] ;.type pmovmskb_insn,@object ;.size pmovmskb_insn,56 pmovmskb_insn: @@ -5731,7 +5731,7 @@ pmovmskb_insn: dd 4193 dd 16580 dd 0 - align 4 + [align 4] ;.type pshufw_insn,@object ;.size pshufw_insn,28 pshufw_insn: @@ -5748,7 +5748,7 @@ pshufw_insn: dd 16516 dd 4485 dd 8480 - align 32 + [align 32] ;.type cmpsd_insn,@object ;.size cmpsd_insn,56 cmpsd_insn: @@ -5778,7 +5778,7 @@ cmpsd_insn: dd 16580 dd 4549 dd 8480 - align 32 + [align 32] ;.type movaupd_insn,@object ;.size movaupd_insn,56 movaupd_insn: @@ -5808,7 +5808,7 @@ movaupd_insn: dd 4549 dd 16580 dd 0 - align 32 + [align 32] ;.type movhlpd_insn,@object ;.size movhlpd_insn,56 movhlpd_insn: @@ -5838,7 +5838,7 @@ movhlpd_insn: dd 4482 dd 16580 dd 0 - align 4 + [align 4] ;.type movmskpd_insn,@object ;.size movmskpd_insn,28 movmskpd_insn: @@ -5855,7 +5855,7 @@ movmskpd_insn: dd 4193 dd 16580 dd 0 - align 4 + [align 4] ;.type movntpddq_insn,@object ;.size movntpddq_insn,28 movntpddq_insn: @@ -5872,7 +5872,7 @@ movntpddq_insn: dd 4546 dd 16580 dd 0 - align 32 + [align 32] ;.type movsd_insn,@object ;.size movsd_insn,112 movsd_insn: @@ -5928,7 +5928,7 @@ movsd_insn: dd 4482 dd 16580 dd 0 - align 4 + [align 4] ;.type maskmovdqu_insn,@object ;.size maskmovdqu_insn,28 maskmovdqu_insn: @@ -5945,7 +5945,7 @@ maskmovdqu_insn: dd 16580 dd 4292 dd 0 - align 32 + [align 32] ;.type movdqau_insn,@object ;.size movdqau_insn,56 movdqau_insn: @@ -5975,7 +5975,7 @@ movdqau_insn: dd 4549 dd 16580 dd 0 - align 4 + [align 4] ;.type movdq2q_insn,@object ;.size movdq2q_insn,28 movdq2q_insn: @@ -5992,7 +5992,7 @@ movdq2q_insn: dd 16516 dd 4292 dd 0 - align 4 + [align 4] ;.type movq2dq_insn,@object ;.size movq2dq_insn,28 movq2dq_insn: @@ -6009,7 +6009,7 @@ movq2dq_insn: dd 16580 dd 4228 dd 0 - align 4 + [align 4] ;.type pslrldq_insn,@object ;.size pslrldq_insn,28 pslrldq_insn: @@ -6026,7 +6026,7 @@ pslrldq_insn: dd 4292 dd 8480 dd 0 - align 4 + [align 4] ;.type now3d_insn,@object ;.size now3d_insn,28 now3d_insn: @@ -6043,7 +6043,7 @@ now3d_insn: dd 16516 dd 4485 dd 0 - align 4 + [align 4] ;.type cyrixmmx_insn,@object ;.size cyrixmmx_insn,28 cyrixmmx_insn: @@ -6060,7 +6060,7 @@ cyrixmmx_insn: dd 16516 dd 4485 dd 0 - align 4 + [align 4] ;.type pmachriw_insn,@object ;.size pmachriw_insn,28 pmachriw_insn: @@ -6077,7 +6077,7 @@ pmachriw_insn: dd 16516 dd 4482 dd 0 - align 4 + [align 4] ;.type rsdc_insn,@object ;.size rsdc_insn,28 rsdc_insn: @@ -6094,7 +6094,7 @@ rsdc_insn: dd 16454 dd 4514 dd 0 - align 4 + [align 4] ;.type cyrixsmm_insn,@object ;.size cyrixsmm_insn,28 cyrixsmm_insn: @@ -6111,7 +6111,7 @@ cyrixsmm_insn: dd 4514 dd 0 dd 0 - align 4 + [align 4] ;.type svdc_insn,@object ;.size svdc_insn,28 svdc_insn: @@ -6128,7 +6128,7 @@ svdc_insn: dd 4514 dd 16454 dd 0 - align 32 + [align 32] ;.type ibts_insn,@object ;.size ibts_insn,56 ibts_insn: @@ -6158,7 +6158,7 @@ ibts_insn: dd 4451 dd 16481 dd 0 - align 32 + [align 32] ;.type umov_insn,@object ;.size umov_insn,168 umov_insn: @@ -6240,7 +6240,7 @@ umov_insn: dd 16481 dd 4451 dd 0 - align 32 + [align 32] ;.type xbts_insn,@object ;.size xbts_insn,56 xbts_insn: @@ -6281,14 +6281,14 @@ size_lookup.0: db 80 db -128 db 0 - section .rodata;.str1.1,"aMS",@progbits,1 + [section .rodata];.str1.1,"aMS",@progbits,1 LC0: db "invalid operand conversion", 0 LC1: db "./modules/arch/x86/x86id.re", 0 LC2: db "$", 0 - section .text + [section .text] ;.type x86_new_jmp,@function x86_new_jmp: push ebp @@ -6524,8 +6524,8 @@ x86_new_jmp: ret .Lfe1: ;.size x86_new_jmp,.Lfe1-x86_new_jmp - section .rodata - align 32 + [section .rodata] + [align 32] ;.type size_lookup.1,@object ;.size size_lookup.1,32 size_lookup.1: @@ -6537,7 +6537,7 @@ size_lookup.1: dd 10 dd 16 dd 0 - section .rodata;.str1.1 + [section .rodata];.str1.1 LC3: db "invalid operand type", 0 LC4: @@ -6546,25 +6546,25 @@ LC6: db "mismatch in operand sizes", 0 LC7: db "operand size not specified", 0 - section .rodata;.str1.32,"aMS",@progbits,1 - align 32 + [section .rodata];.str1.32,"aMS",@progbits,1 + [align 32] LC8: db "unrecognized x86 ext mod index", 0 - align 32 + [align 32] LC9: db "unrecognized x86 extended modifier", 0 - align 32 + [align 32] LC5: db "invalid combination of opcode and operands", 0 - section .rodata;.str1.1 + [section .rodata];.str1.1 LC10: db "unknown operand action", 0 - section .rodata;.str1.32 - align 32 + [section .rodata];.str1.32 + [align 32] LC11: db "unknown operand postponed action", 0 - section .text -global yasm_x86__parse_insn + [section .text] +[global yasm_x86__parse_insn] ;.type yasm_x86__parse_insn,@function yasm_x86__parse_insn: push ebp @@ -6626,9 +6626,9 @@ yasm_x86__parse_insn: cmp eax, 21 ja .L139 jmp DWORD [.L140+eax*4] - section .rodata - align 4 - align 4 + [section .rodata] + [align 4] + [align 4] .L140: dd .L53 dd .L57 @@ -6652,7 +6652,7 @@ yasm_x86__parse_insn: dd .L130 dd .L133 dd .L136 - section .text + [section .text] .L53: cmp DWORD [edi+4], 4 jmp .L273 @@ -7496,12 +7496,12 @@ yasm_x86__parse_insn: ret .Lfe2: ;.size yasm_x86__parse_insn,.Lfe2-yasm_x86__parse_insn - section .rodata;.str1.32 - align 32 + [section .rodata];.str1.32 + [align 32] LC12: db "unrecognized CPU identifier `s'", 0 - section .text -global yasm_x86__parse_cpu + [section .text] +[global yasm_x86__parse_cpu] ;.type yasm_x86__parse_cpu,@function yasm_x86__parse_cpu: push ebp @@ -7515,9 +7515,9 @@ yasm_x86__parse_cpu: cmp eax, 119 ja .L338 jmp DWORD [.L339+eax*4] - section .rodata - align 4 - align 4 + [section .rodata] + [align 4] + [align 4] .L339: dd .L283 dd .L338 @@ -7639,7 +7639,7 @@ yasm_x86__parse_cpu: dd .L333 dd .L338 dd .L336 - section .text + [section .text] .L297: inc edx mov cl, BYTE [edx] @@ -7988,9 +7988,9 @@ yasm_x86__parse_cpu: cmp eax, 66 ja .L342 jmp DWORD [.L530+eax*4] - section .rodata - align 4 - align 4 + [section .rodata] + [align 4] + [align 4] .L530: dd .L504 dd .L342 @@ -8059,7 +8059,7 @@ yasm_x86__parse_cpu: dd .L525 dd .L342 dd .L528 - section .text + [section .text] .L513: inc edx mov cl, BYTE [edx] @@ -9102,27 +9102,27 @@ yasm_x86__parse_cpu: ret .Lfe3: ;.size yasm_x86__parse_cpu,.Lfe3-yasm_x86__parse_cpu - section .rodata;.str1.32 - align 32 + [section .rodata];.str1.32 + [align 32] LC16: db "`s' segment register ignored in 64-bit mode", 0 - align 32 + [align 32] LC18: db "Cannot override address size to 16 bits in 64-bit mode", 0 - align 32 + [align 32] LC17: db "`s' is a prefix in 64-bit mode", 0 - align 32 + [align 32] LC15: db "`s' is a register in 64-bit mode", 0 - align 32 + [align 32] LC13: db "`s' is an instruction in 64-bit mode", 0 - section .rodata;.str1.1 + [section .rodata];.str1.1 LC14: db "`s' invalid in 64-bit mode", 0 - section .text -global yasm_x86__parse_check_id + [section .text] +[global yasm_x86__parse_check_id] ;.type yasm_x86__parse_check_id,@function yasm_x86__parse_check_id: push ebp @@ -9140,9 +9140,9 @@ yasm_x86__parse_check_id: cmp eax, 120 ja .L999 jmp DWORD [.L1000+eax*4] - section .rodata - align 4 - align 4 + [section .rodata] + [align 4] + [align 4] .L1000: dd .L8702 dd .L999 @@ -9265,7 +9265,7 @@ yasm_x86__parse_check_id: dd .L991 dd .L994 dd .L997 - section .text + [section .text] .L970: inc ecx mov dl, BYTE [ecx] @@ -9295,9 +9295,9 @@ yasm_x86__parse_check_id: cmp eax, 56 ja .L1005 jmp DWORD [.L1069+eax*4] - section .rodata - align 4 - align 4 + [section .rodata] + [align 4] + [align 4] .L1069: dd .L1016 dd .L1019 @@ -9356,7 +9356,7 @@ yasm_x86__parse_check_id: dd .L1064 dd .L1005 dd .L1067 - section .text + [section .text] .L949: inc ecx mov dl, BYTE [ecx] @@ -9365,9 +9365,9 @@ yasm_x86__parse_check_id: cmp eax, 71 ja .L1005 jmp DWORD [.L1128+eax*4] - section .rodata - align 4 - align 4 + [section .rodata] + [align 4] + [align 4] .L1128: dd .L1072 dd .L1005 @@ -9441,7 +9441,7 @@ yasm_x86__parse_check_id: dd .L1120 dd .L1123 dd .L1126 - section .text + [section .text] .L985: inc ecx mov dl, BYTE [ecx] @@ -9508,9 +9508,9 @@ yasm_x86__parse_check_id: cmp eax, 71 ja .L1005 jmp DWORD [.L1191+eax*4] - section .rodata - align 4 - align 4 + [section .rodata] + [align 4] + [align 4] .L1191: dd .L1164 dd .L1005 @@ -9584,7 +9584,7 @@ yasm_x86__parse_check_id: dd .L1005 dd .L1005 dd .L1189 - section .text + [section .text] .L964: inc ecx mov dl, BYTE [ecx] @@ -9593,9 +9593,9 @@ yasm_x86__parse_check_id: cmp eax, 51 ja .L1005 jmp DWORD [.L1227+eax*4] - section .rodata - align 4 - align 4 + [section .rodata] + [align 4] + [align 4] .L1227: dd .L1195 dd .L1005 @@ -9649,7 +9649,7 @@ yasm_x86__parse_check_id: dd .L1005 dd .L1222 dd .L1225 - section .text + [section .text] .L979: inc ecx mov dl, BYTE [ecx] @@ -9658,9 +9658,9 @@ yasm_x86__parse_check_id: cmp eax, 66 ja .L1005 jmp DWORD [.L1259+eax*4] - section .rodata - align 4 - align 4 + [section .rodata] + [align 4] + [align 4] .L1259: dd .L1230 dd .L1005 @@ -9729,7 +9729,7 @@ yasm_x86__parse_check_id: dd .L1005 dd .L1005 dd .L1257 - section .text + [section .text] .L940: inc ecx mov dl, BYTE [ecx] @@ -9738,9 +9738,9 @@ yasm_x86__parse_check_id: cmp eax, 55 ja .L1005 jmp DWORD [.L1301+eax*4] - section .rodata - align 4 - align 4 + [section .rodata] + [align 4] + [align 4] .L1301: dd .L1263 dd .L1266 @@ -9798,7 +9798,7 @@ yasm_x86__parse_check_id: dd .L1293 dd .L1296 dd .L1299 - section .text + [section .text] .L943: inc ecx mov dl, BYTE [ecx] @@ -9807,9 +9807,9 @@ yasm_x86__parse_check_id: cmp eax, 55 ja .L1005 jmp DWORD [.L1328+eax*4] - section .rodata - align 4 - align 4 + [section .rodata] + [align 4] + [align 4] .L1328: dd .L1305 dd .L1005 @@ -9867,7 +9867,7 @@ yasm_x86__parse_check_id: dd .L1005 dd .L1005 dd .L1326 - section .text + [section .text] .L967: inc ecx mov dl, BYTE [ecx] @@ -9876,9 +9876,9 @@ yasm_x86__parse_check_id: cmp eax, 52 ja .L1005 jmp DWORD [.L1349+eax*4] - section .rodata - align 4 - align 4 + [section .rodata] + [align 4] + [align 4] .L1349: dd .L1332 dd .L1005 @@ -9933,7 +9933,7 @@ yasm_x86__parse_check_id: dd .L1005 dd .L1005 dd .L1347 - section .text + [section .text] .L997: inc ecx mov dl, BYTE [ecx] @@ -9942,9 +9942,9 @@ yasm_x86__parse_check_id: cmp eax, 46 ja .L1005 jmp DWORD [.L1370+eax*4] - section .rodata - align 4 - align 4 + [section .rodata] + [align 4] + [align 4] .L1370: dd .L1353 dd .L1356 @@ -9993,7 +9993,7 @@ yasm_x86__parse_check_id: dd .L1365 dd .L1005 dd .L1368 - section .text + [section .text] .L946: inc ecx mov dl, BYTE [ecx] @@ -10002,9 +10002,9 @@ yasm_x86__parse_check_id: cmp eax, 50 ja .L1005 jmp DWORD [.L1394+eax*4] - section .rodata - align 4 - align 4 + [section .rodata] + [align 4] + [align 4] .L1394: dd .L1374 dd .L1377 @@ -10057,7 +10057,7 @@ yasm_x86__parse_check_id: dd .L1005 dd .L1005 dd .L1392 - section .text + [section .text] .L937: inc ecx mov dl, BYTE [ecx] @@ -10066,9 +10066,9 @@ yasm_x86__parse_check_id: cmp eax, 48 ja .L1005 jmp DWORD [.L1418+eax*4] - section .rodata - align 4 - align 4 + [section .rodata] + [align 4] + [align 4] .L1418: dd .L1398 dd .L1005 @@ -10119,7 +10119,7 @@ yasm_x86__parse_check_id: dd .L1005 dd .L1005 dd .L1416 - section .text + [section .text] .L952: inc ecx mov dl, BYTE [ecx] @@ -10136,9 +10136,9 @@ yasm_x86__parse_check_id: cmp eax, 55 ja .L1005 jmp DWORD [.L1457+eax*4] - section .rodata - align 4 - align 4 + [section .rodata] + [align 4] + [align 4] .L1457: dd .L1425 dd .L1005 @@ -10196,7 +10196,7 @@ yasm_x86__parse_check_id: dd .L1005 dd .L1005 dd .L1455 - section .text + [section .text] .L958: inc ecx mov dl, BYTE [ecx] @@ -10205,9 +10205,9 @@ yasm_x86__parse_check_id: cmp eax, 48 ja .L1005 jmp DWORD [.L1475+eax*4] - section .rodata - align 4 - align 4 + [section .rodata] + [align 4] + [align 4] .L1475: dd .L1461 dd .L1005 @@ -10258,7 +10258,7 @@ yasm_x86__parse_check_id: dd .L1005 dd .L1005 dd .L1473 - section .text + [section .text] .L961: inc ecx mov dl, BYTE [ecx] @@ -10267,9 +10267,9 @@ yasm_x86__parse_check_id: cmp eax, 57 ja .L1005 jmp DWORD [.L1517+eax*4] - section .rodata - align 4 - align 4 + [section .rodata] + [align 4] + [align 4] .L1517: dd .L1479 dd .L1482 @@ -10329,7 +10329,7 @@ yasm_x86__parse_check_id: dd .L1005 dd .L1005 dd .L1515 - section .text + [section .text] .L955: inc ecx mov dl, BYTE [ecx] @@ -10932,9 +10932,9 @@ yasm_x86__parse_check_id: cmp eax, 57 ja .L1005 jmp DWORD [.L1830+eax*4] - section .rodata - align 4 - align 4 + [section .rodata] + [align 4] + [align 4] .L1830: dd .L1801 dd .L1804 @@ -10994,7 +10994,7 @@ yasm_x86__parse_check_id: dd .L1005 dd .L1005 dd .L1828 - section .text + [section .text] .L1503: inc ecx cmp BYTE [ecx], 0 @@ -11676,9 +11676,9 @@ yasm_x86__parse_check_id: cmp eax, 65 ja .L1005 jmp DWORD [.L2189+eax*4] - section .rodata - align 4 - align 4 + [section .rodata] + [align 4] + [align 4] .L2189: dd .L2166 dd .L1005 @@ -11746,7 +11746,7 @@ yasm_x86__parse_check_id: dd .L1005 dd .L2184 dd .L2187 - section .text + [section .text] .L1437: inc ecx mov dl, BYTE [ecx] @@ -11845,9 +11845,9 @@ yasm_x86__parse_check_id: cmp eax, 54 ja .L1005 jmp DWORD [.L2257+eax*4] - section .rodata - align 4 - align 4 + [section .rodata] + [align 4] + [align 4] .L2257: dd .L2240 dd .L1005 @@ -11904,7 +11904,7 @@ yasm_x86__parse_check_id: dd .L2252 dd .L1005 dd .L2255 - section .text + [section .text] .L1452: inc ecx mov dl, BYTE [ecx] @@ -12531,9 +12531,9 @@ yasm_x86__parse_check_id: cmp eax, 53 ja .L1005 jmp DWORD [.L2571+eax*4] - section .rodata - align 4 - align 4 + [section .rodata] + [align 4] + [align 4] .L2571: dd .L2554 dd .L1005 @@ -12589,7 +12589,7 @@ yasm_x86__parse_check_id: dd .L2566 dd .L1005 dd .L2569 - section .text + [section .text] .L2554: inc ecx cmp BYTE [ecx], 0 @@ -14530,9 +14530,9 @@ yasm_x86__parse_check_id: cmp eax, 53 ja .L1005 jmp DWORD [.L3482+eax*4] - section .rodata - align 4 - align 4 + [section .rodata] + [align 4] + [align 4] .L3482: dd .L3465 dd .L1005 @@ -14588,7 +14588,7 @@ yasm_x86__parse_check_id: dd .L3477 dd .L1005 dd .L3480 - section .text + [section .text] .L3465: inc ecx cmp BYTE [ecx], 0 @@ -15939,9 +15939,9 @@ yasm_x86__parse_check_id: cmp eax, 54 ja .L1005 jmp DWORD [.L4093+eax*4] - section .rodata - align 4 - align 4 + [section .rodata] + [align 4] + [align 4] .L4093: dd .L4076 dd .L1005 @@ -15998,7 +15998,7 @@ yasm_x86__parse_check_id: dd .L1005 dd .L4088 dd .L4091 - section .text + [section .text] .L4001: inc ecx mov dl, BYTE [ecx] @@ -18089,9 +18089,9 @@ yasm_x86__parse_check_id: cmp eax, 57 ja .L1005 jmp DWORD [.L5073+eax*4] - section .rodata - align 4 - align 4 + [section .rodata] + [align 4] + [align 4] .L5073: dd .L5041 dd .L5044 @@ -18151,7 +18151,7 @@ yasm_x86__parse_check_id: dd .L1005 dd .L1005 dd .L5071 - section .text + [section .text] .L5062: inc ecx cmp BYTE [ecx], 0 @@ -18167,9 +18167,9 @@ yasm_x86__parse_check_id: cmp eax, 57 ja .L1005 jmp DWORD [.L5109+eax*4] - section .rodata - align 4 - align 4 + [section .rodata] + [align 4] + [align 4] .L5109: dd .L5080 dd .L5083 @@ -18229,7 +18229,7 @@ yasm_x86__parse_check_id: dd .L1005 dd .L1005 dd .L5107 - section .text + [section .text] .L5044: inc ecx mov dl, BYTE [ecx] @@ -18577,9 +18577,9 @@ yasm_x86__parse_check_id: cmp eax, 53 ja .L1005 jmp DWORD [.L5310+eax*4] - section .rodata - align 4 - align 4 + [section .rodata] + [align 4] + [align 4] .L5310: dd .L5296 dd .L1005 @@ -18635,7 +18635,7 @@ yasm_x86__parse_check_id: dd .L1005 dd .L1005 dd .L5308 - section .text + [section .text] .L5015: inc ecx mov dl, BYTE [ecx] @@ -19766,9 +19766,9 @@ yasm_x86__parse_check_id: cmp eax, 47 ja .L1005 jmp DWORD [.L5855+eax*4] - section .rodata - align 4 - align 4 + [section .rodata] + [align 4] + [align 4] .L5855: dd .L5838 dd .L1005 @@ -19818,7 +19818,7 @@ yasm_x86__parse_check_id: dd .L1005 dd .L1005 dd .L5853 - section .text + [section .text] .L1248: inc ecx mov dl, BYTE [ecx] @@ -19875,9 +19875,9 @@ yasm_x86__parse_check_id: cmp eax, 48 ja .L1005 jmp DWORD [.L5902+eax*4] - section .rodata - align 4 - align 4 + [section .rodata] + [align 4] + [align 4] .L5902: dd .L5882 dd .L1005 @@ -19928,7 +19928,7 @@ yasm_x86__parse_check_id: dd .L1005 dd .L1005 dd .L5900 - section .text + [section .text] .L5894: inc ecx cmp BYTE [ecx], 0 @@ -21890,9 +21890,9 @@ yasm_x86__parse_check_id: cmp eax, 50 ja .L1005 jmp DWORD [.L6775+eax*4] - section .rodata - align 4 - align 4 + [section .rodata] + [align 4] + [align 4] .L6775: dd .L6755 dd .L1005 @@ -21945,7 +21945,7 @@ yasm_x86__parse_check_id: dd .L1005 dd .L1005 dd .L6773 - section .text + [section .text] .L1096: inc ecx mov dl, BYTE [ecx] @@ -24308,9 +24308,9 @@ yasm_x86__parse_check_id: cmp eax, 41 ja .L1005 jmp DWORD [.L7863+eax*4] - section .rodata - align 4 - align 4 + [section .rodata] + [align 4] + [align 4] .L7863: dd .L7852 dd .L1005 @@ -24354,7 +24354,7 @@ yasm_x86__parse_check_id: dd .L1005 dd .L1005 dd .L7861 - section .text + [section .text] .L1037: inc ecx mov dl, BYTE [ecx] @@ -24462,9 +24462,9 @@ yasm_x86__parse_check_id: cmp eax, 66 ja .L1005 jmp DWORD [.L7931+eax*4] - section .rodata - align 4 - align 4 + [section .rodata] + [align 4] + [align 4] .L7931: dd .L7911 dd .L7911 @@ -24533,7 +24533,7 @@ yasm_x86__parse_check_id: dd .L1005 dd .L1005 dd .L7929 - section .text + [section .text] .L1058: inc ecx mov dl, BYTE [ecx] @@ -25478,9 +25478,9 @@ yasm_x86__parse_check_id: cmp eax, 57 ja .L1005 jmp DWORD [.L8375+eax*4] - section .rodata - align 4 - align 4 + [section .rodata] + [align 4] + [align 4] .L8375: dd .L8343 dd .L8346 @@ -25540,7 +25540,7 @@ yasm_x86__parse_check_id: dd .L1005 dd .L1005 dd .L8373 - section .text + [section .text] .L8343: inc ecx mov dl, BYTE [ecx] @@ -25611,9 +25611,9 @@ yasm_x86__parse_check_id: cmp eax, 57 ja .L1005 jmp DWORD [.L8450+eax*4] - section .rodata - align 4 - align 4 + [section .rodata] + [align 4] + [align 4] .L8450: dd .L8421 dd .L8424 @@ -25673,7 +25673,7 @@ yasm_x86__parse_check_id: dd .L1005 dd .L1005 dd .L8448 - section .text + [section .text] .L8364: inc ecx cmp BYTE [ecx], 0 From b7a38ed4fdb71dd6b9f16614b2f015a0051e8ae2 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 2 Jan 2009 08:33:21 +0000 Subject: [PATCH 243/585] Allow @ signs in identifiers in win32/win64 only. In ELF, @ is used to indicate special relocations. Fixes #164. Reported by: Gregory McGarry on yasm-devel@ Testcase by: Gregory McGarry We don't allow identifiers to start with @; doing so conflicts with use of e.g. "@function" in some directives. Need to look into what GAS does. svn path=/trunk/yasm/; revision=2166 --- libyasm/objfmt.h | 3 + modules/objfmts/bin/bin-objfmt.c | 2 + modules/objfmts/coff/coff-objfmt.c | 4 + modules/objfmts/dbg/dbg-objfmt.c | 1 + modules/objfmts/elf/elf-objfmt.c | 3 + modules/objfmts/macho/macho-objfmt.c | 3 + modules/objfmts/rdf/rdf-objfmt.c | 1 + modules/objfmts/win32/tests/Makefile.inc | 4 + modules/objfmts/win32/tests/gas/Makefile.inc | 7 + .../objfmts/win32/tests/gas/win32_gas_test.sh | 4 + modules/objfmts/win32/tests/gas/win32at.asm | 167 ++ modules/objfmts/win32/tests/gas/win32at.hex | 1635 +++++++++++++++++ modules/objfmts/xdf/xdf-objfmt.c | 1 + modules/parsers/gas/gas-token.re | 10 + 14 files changed, 1845 insertions(+) create mode 100644 modules/objfmts/win32/tests/gas/Makefile.inc create mode 100755 modules/objfmts/win32/tests/gas/win32_gas_test.sh create mode 100644 modules/objfmts/win32/tests/gas/win32at.asm create mode 100644 modules/objfmts/win32/tests/gas/win32at.hex diff --git a/libyasm/objfmt.h b/libyasm/objfmt.h index c65e76c1..d30e75e2 100644 --- a/libyasm/objfmt.h +++ b/libyasm/objfmt.h @@ -62,6 +62,9 @@ struct yasm_objfmt_module { */ const unsigned char default_x86_mode_bits; + /** If @ signs should be legal in identifiers. */ + const unsigned char id_at_ok; + /** NULL-terminated list of debug format (yasm_dbgfmt) keywords that are * valid to use with this object format. The null debug format * (null_dbgfmt, "null") should always be in this list so it's possible to diff --git a/modules/objfmts/bin/bin-objfmt.c b/modules/objfmts/bin/bin-objfmt.c index e05a5acb..3a64429d 100644 --- a/modules/objfmts/bin/bin-objfmt.c +++ b/modules/objfmts/bin/bin-objfmt.c @@ -1798,6 +1798,7 @@ yasm_objfmt_module yasm_bin_LTX_objfmt = { "bin", NULL, 16, + 0, bin_objfmt_dbgfmt_keywords, "null", bin_objfmt_directives, @@ -1949,6 +1950,7 @@ yasm_objfmt_module yasm_dosexe_LTX_objfmt = { "dosexe", "exe", 16, + 0, bin_objfmt_dbgfmt_keywords, "null", bin_objfmt_directives, diff --git a/modules/objfmts/coff/coff-objfmt.c b/modules/objfmts/coff/coff-objfmt.c index 448682e2..b9f4494e 100644 --- a/modules/objfmts/coff/coff-objfmt.c +++ b/modules/objfmts/coff/coff-objfmt.c @@ -2199,6 +2199,7 @@ yasm_objfmt_module yasm_coff_LTX_objfmt = { "coff", "o", 32, + 0, coff_objfmt_dbgfmt_keywords, "null", coff_objfmt_directives, @@ -2250,6 +2251,7 @@ yasm_objfmt_module yasm_win32_LTX_objfmt = { "win32", "obj", 32, + 1, winXX_objfmt_dbgfmt_keywords, "null", win32_objfmt_directives, @@ -2303,6 +2305,7 @@ yasm_objfmt_module yasm_win64_LTX_objfmt = { "win64", "obj", 64, + 1, winXX_objfmt_dbgfmt_keywords, "null", win64_objfmt_directives, @@ -2319,6 +2322,7 @@ yasm_objfmt_module yasm_x64_LTX_objfmt = { "x64", "obj", 64, + 1, winXX_objfmt_dbgfmt_keywords, "null", win64_objfmt_directives, diff --git a/modules/objfmts/dbg/dbg-objfmt.c b/modules/objfmts/dbg/dbg-objfmt.c index ad5f14a1..5a71c4f1 100644 --- a/modules/objfmts/dbg/dbg-objfmt.c +++ b/modules/objfmts/dbg/dbg-objfmt.c @@ -162,6 +162,7 @@ yasm_objfmt_module yasm_dbg_LTX_objfmt = { "dbg", "dbg", 32, + 0, dbg_objfmt_dbgfmt_keywords, "null", NULL, /* no directives */ diff --git a/modules/objfmts/elf/elf-objfmt.c b/modules/objfmts/elf/elf-objfmt.c index 02051de1..4ceccc25 100644 --- a/modules/objfmts/elf/elf-objfmt.c +++ b/modules/objfmts/elf/elf-objfmt.c @@ -1347,6 +1347,7 @@ yasm_objfmt_module yasm_elf_LTX_objfmt = { "elf", "o", 32, + 0, elf_objfmt_dbgfmt_keywords, "null", elf_objfmt_directives, @@ -1364,6 +1365,7 @@ yasm_objfmt_module yasm_elf32_LTX_objfmt = { "elf32", "o", 32, + 0, elf_objfmt_dbgfmt_keywords, "null", elf_objfmt_directives, @@ -1381,6 +1383,7 @@ yasm_objfmt_module yasm_elf64_LTX_objfmt = { "elf64", "o", 64, + 0, elf_objfmt_dbgfmt_keywords, "null", elf_objfmt_directives, diff --git a/modules/objfmts/macho/macho-objfmt.c b/modules/objfmts/macho/macho-objfmt.c index e825dbef..a57c4c73 100644 --- a/modules/objfmts/macho/macho-objfmt.c +++ b/modules/objfmts/macho/macho-objfmt.c @@ -1555,6 +1555,7 @@ yasm_objfmt_module yasm_macho_LTX_objfmt = { "macho", "o", 32, + 0, macho_objfmt_dbgfmt_keywords, "null", NULL, /* no directives */ @@ -1572,6 +1573,7 @@ yasm_objfmt_module yasm_macho32_LTX_objfmt = { "macho32", "o", 32, + 0, macho_objfmt_dbgfmt_keywords, "null", NULL, /* no directives */ @@ -1589,6 +1591,7 @@ yasm_objfmt_module yasm_macho64_LTX_objfmt = { "macho64", "o", 64, + 0, macho_objfmt_dbgfmt_keywords, "null", NULL, /* no directives */ diff --git a/modules/objfmts/rdf/rdf-objfmt.c b/modules/objfmts/rdf/rdf-objfmt.c index 962f02f6..8b704a54 100644 --- a/modules/objfmts/rdf/rdf-objfmt.c +++ b/modules/objfmts/rdf/rdf-objfmt.c @@ -1079,6 +1079,7 @@ yasm_objfmt_module yasm_rdf_LTX_objfmt = { "rdf", "rdf", 32, + 0, rdf_objfmt_dbgfmt_keywords, "null", rdf_objfmt_directives, diff --git a/modules/objfmts/win32/tests/Makefile.inc b/modules/objfmts/win32/tests/Makefile.inc index 3b16d3db..b2b6800c 100644 --- a/modules/objfmts/win32/tests/Makefile.inc +++ b/modules/objfmts/win32/tests/Makefile.inc @@ -17,3 +17,7 @@ EXTRA_DIST += modules/objfmts/win32/tests/win32-segof.hex EXTRA_DIST += modules/objfmts/win32/tests/win32test.c EXTRA_DIST += modules/objfmts/win32/tests/win32test.asm EXTRA_DIST += modules/objfmts/win32/tests/win32test.hex + +EXTRA_DIST += modules/objfmts/win32/tests/gas/Makefile.inc + +include modules/objfmts/win32/tests/gas/Makefile.inc diff --git a/modules/objfmts/win32/tests/gas/Makefile.inc b/modules/objfmts/win32/tests/gas/Makefile.inc new file mode 100644 index 00000000..fb319233 --- /dev/null +++ b/modules/objfmts/win32/tests/gas/Makefile.inc @@ -0,0 +1,7 @@ +# $Id$ + +TESTS += modules/objfmts/win32/tests/gas/win32_gas_test.sh + +EXTRA_DIST += modules/objfmts/win32/tests/gas/win32_gas_test.sh +EXTRA_DIST += modules/objfmts/win32/tests/gas/win32at.asm +EXTRA_DIST += modules/objfmts/win32/tests/gas/win32at.hex diff --git a/modules/objfmts/win32/tests/gas/win32_gas_test.sh b/modules/objfmts/win32/tests/gas/win32_gas_test.sh new file mode 100755 index 00000000..ed5e3c32 --- /dev/null +++ b/modules/objfmts/win32/tests/gas/win32_gas_test.sh @@ -0,0 +1,4 @@ +#! /bin/sh +# $Id$ +${srcdir}/out_test.sh win32_gas_test modules/objfmts/win32/tests/gas "win32 objfmt" "-f win32 -p gas" ".obj" +exit $? diff --git a/modules/objfmts/win32/tests/gas/win32at.asm b/modules/objfmts/win32/tests/gas/win32at.asm new file mode 100644 index 00000000..f56520a2 --- /dev/null +++ b/modules/objfmts/win32/tests/gas/win32at.asm @@ -0,0 +1,167 @@ +.section .rodata +L2586: +.ascii "myWindowClass\0" +.globl _g_szClassName +_g_szClassName: +.byte 109 +.byte 121 +.byte 87 +.byte 105 +.byte 110 +.byte 100 +.byte 111 +.byte 119 +.byte 67 +.byte 108 +.byte 97 +.byte 115 +.byte 115 +.byte 0 +.text +.align 4 +.globl _WndProc@16 +_WndProc@16: +pushl %ebp +movl %esp,%ebp +subl $8,%esp +L2588: +L2590: +movl 12(%ebp),%eax +movl %eax,-4(%ebp) +jmp L2592 +L2593: +pushl 8(%ebp) +call _DestroyWindow@4 +jmp L2591 +L2594: +pushl $0 +call _PostQuitMessage@4 +jmp L2591 +L2595: +pushl 20(%ebp) +pushl 16(%ebp) +pushl 12(%ebp) +pushl 8(%ebp) +call _DefWindowProcA@16 +movl %eax,-8(%ebp) +jmp L2589 +L2592: +cmpl $2,-4(%ebp) +je L2594 +cmpl $16,-4(%ebp) +je L2593 +jmp L2595 +L2591: +movl $0,-8(%ebp) +jmp L2589 +L2589: +movl -8(%ebp),%eax +leave +ret $16 +.section .rodata +L2600: +.ascii "Window Registration Failed!\0" +L2601: +.ascii "Error!\0" +L2602: +.ascii "The title of my window\0" +L2604: +.ascii "Window Creation Failed!\0" +.text +.align 4 +.globl _WinMain@16 +_WinMain@16: +pushl %ebp +movl %esp,%ebp +subl $84,%esp +L2596: +L2598: +movl $48,-48(%ebp) +movl $0,-44(%ebp) +movl $_WndProc@16,-40(%ebp) +movl $0,-36(%ebp) +movl $0,-32(%ebp) +movl 8(%ebp),%eax +movl %eax,-28(%ebp) +pushl $32512 +pushl $0 +call _LoadIconA@8 +movl %eax,-24(%ebp) +pushl $32512 +pushl $0 +call _LoadCursorA@8 +movl %eax,-20(%ebp) +movl $6,-16(%ebp) +movl $0,-12(%ebp) +movl $_g_szClassName,-8(%ebp) +pushl $32512 +pushl $0 +call _LoadIconA@8 +movl %eax,-4(%ebp) +leal -48(%ebp),%edx +pushl %edx +call _RegisterClassExA@4 +cmpw $0,%ax +jne L2599 +pushl $48 +pushl $L2601 +pushl $L2600 +pushl $0 +call _MessageBoxA@16 +movl $0,-84(%ebp) +jmp L2597 +L2599: +pushl $0 +pushl 8(%ebp) +pushl $0 +pushl $0 +pushl $120 +pushl $240 +pushl $-2147483648 +pushl $-2147483648 +pushl $13565952 +pushl $L2602 +pushl $_g_szClassName +pushl $512 +call _CreateWindowExA@48 +movl %eax,-52(%ebp) +cmpl $0,-52(%ebp) +jne L2603 +pushl $48 +pushl $L2601 +pushl $L2604 +pushl $0 +call _MessageBoxA@16 +movl $0,-84(%ebp) +jmp L2597 +L2603: +pushl 20(%ebp) +pushl -52(%ebp) +call _ShowWindow@8 +pushl -52(%ebp) +call _UpdateWindow@4 +L2605: +pushl $0 +pushl $0 +pushl $0 +leal -80(%ebp),%edx +pushl %edx +call _GetMessageA@16 +cmpl $0,%eax +jle L2606 +leal -80(%ebp),%eax +pushl %eax +call _TranslateMessage@4 +leal -80(%ebp),%eax +pushl %eax +call _DispatchMessageA@4 +jmp L2605 +L2606: +movl -72(%ebp),%eax +movl %eax,-84(%ebp) +jmp L2597 +L2597: +movl -84(%ebp),%eax +leave +ret $16 +.ident "PCC: pcc 0.9.9 (win32)" diff --git a/modules/objfmts/win32/tests/gas/win32at.hex b/modules/objfmts/win32/tests/gas/win32at.hex new file mode 100644 index 00000000..22a9f128 --- /dev/null +++ b/modules/objfmts/win32/tests/gas/win32at.hex @@ -0,0 +1,1635 @@ +4c +01 +03 +00 +00 +00 +00 +00 +91 +03 +00 +00 +18 +00 +00 +00 +00 +00 +0c +01 +2e +74 +65 +78 +74 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +99 +01 +00 +00 +8c +00 +00 +00 +25 +02 +00 +00 +00 +00 +00 +00 +17 +00 +00 +00 +20 +00 +50 +60 +2e +72 +6f +64 +61 +74 +61 +00 +99 +01 +00 +00 +00 +00 +00 +00 +6e +00 +00 +00 +0b +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +40 +00 +40 +40 +2f +34 +00 +00 +00 +00 +00 +00 +07 +02 +00 +00 +00 +00 +00 +00 +18 +00 +00 +00 +79 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +40 +00 +40 +40 +55 +89 +e5 +83 +ec +08 +8b +45 +0c +89 +45 +fc +eb +29 +ff +75 +08 +e8 +00 +00 +00 +00 +eb +2d +6a +00 +e8 +00 +00 +00 +00 +eb +24 +ff +75 +14 +ff +75 +10 +ff +75 +0c +ff +75 +08 +e8 +00 +00 +00 +00 +89 +45 +f8 +eb +17 +83 +7d +fc +02 +74 +db +83 +7d +fc +10 +74 +cb +eb +dc +c7 +45 +f8 +00 +00 +00 +00 +eb +00 +8b +45 +f8 +c9 +c2 +10 +00 +8d +76 +00 +55 +89 +e5 +83 +ec +54 +c7 +45 +d0 +30 +00 +00 +00 +c7 +45 +d4 +00 +00 +00 +00 +c7 +45 +d8 +00 +00 +00 +00 +c7 +45 +dc +00 +00 +00 +00 +c7 +45 +e0 +00 +00 +00 +00 +8b +45 +08 +89 +45 +e4 +68 +00 +7f +00 +00 +6a +00 +e8 +00 +00 +00 +00 +89 +45 +e8 +68 +00 +7f +00 +00 +6a +00 +e8 +00 +00 +00 +00 +89 +45 +ec +c7 +45 +f0 +06 +00 +00 +00 +c7 +45 +f4 +00 +00 +00 +00 +c7 +45 +f8 +0e +00 +00 +00 +68 +00 +7f +00 +00 +6a +00 +e8 +00 +00 +00 +00 +89 +45 +fc +8d +55 +d0 +52 +e8 +00 +00 +00 +00 +66 +83 +f8 +00 +75 +1f +6a +30 +68 +38 +00 +00 +00 +68 +1c +00 +00 +00 +6a +00 +e8 +00 +00 +00 +00 +c7 +45 +ac +00 +00 +00 +00 +e9 +9b +00 +00 +00 +6a +00 +ff +75 +08 +6a +00 +6a +00 +6a +78 +68 +f0 +00 +00 +00 +68 +00 +00 +00 +80 +68 +00 +00 +00 +80 +68 +00 +00 +cf +00 +68 +3f +00 +00 +00 +68 +0e +00 +00 +00 +68 +00 +02 +00 +00 +e8 +00 +00 +00 +00 +89 +45 +cc +83 +7d +cc +00 +75 +1c +6a +30 +68 +38 +00 +00 +00 +68 +56 +00 +00 +00 +6a +00 +e8 +00 +00 +00 +00 +c7 +45 +ac +00 +00 +00 +00 +eb +43 +ff +75 +14 +ff +75 +cc +e8 +00 +00 +00 +00 +ff +75 +cc +e8 +00 +00 +00 +00 +6a +00 +6a +00 +6a +00 +8d +55 +b0 +52 +e8 +00 +00 +00 +00 +83 +f8 +00 +7e +14 +8d +45 +b0 +50 +e8 +00 +00 +00 +00 +8d +45 +b0 +50 +e8 +00 +00 +00 +00 +eb +d8 +8b +45 +b8 +89 +45 +ac +eb +00 +8b +45 +ac +c9 +c2 +10 +00 +12 +00 +00 +00 +08 +00 +00 +00 +14 +00 +1b +00 +00 +00 +09 +00 +00 +00 +14 +00 +2e +00 +00 +00 +0a +00 +00 +00 +14 +00 +6f +00 +00 +00 +02 +00 +00 +00 +06 +00 +8f +00 +00 +00 +0c +00 +00 +00 +14 +00 +9e +00 +00 +00 +0d +00 +00 +00 +14 +00 +b6 +00 +00 +00 +04 +00 +00 +00 +06 +00 +c2 +00 +00 +00 +0c +00 +00 +00 +14 +00 +ce +00 +00 +00 +0e +00 +00 +00 +14 +00 +db +00 +00 +00 +04 +00 +00 +00 +06 +00 +e0 +00 +00 +00 +04 +00 +00 +00 +06 +00 +e7 +00 +00 +00 +0f +00 +00 +00 +14 +00 +17 +01 +00 +00 +04 +00 +00 +00 +06 +00 +1c +01 +00 +00 +04 +00 +00 +00 +06 +00 +26 +01 +00 +00 +10 +00 +00 +00 +14 +00 +36 +01 +00 +00 +04 +00 +00 +00 +06 +00 +3b +01 +00 +00 +04 +00 +00 +00 +06 +00 +42 +01 +00 +00 +0f +00 +00 +00 +14 +00 +56 +01 +00 +00 +11 +00 +00 +00 +14 +00 +5e +01 +00 +00 +12 +00 +00 +00 +14 +00 +6d +01 +00 +00 +13 +00 +00 +00 +14 +00 +7b +01 +00 +00 +14 +00 +00 +00 +14 +00 +84 +01 +00 +00 +15 +00 +00 +00 +14 +00 +6d +79 +57 +69 +6e +64 +6f +77 +43 +6c +61 +73 +73 +00 +6d +79 +57 +69 +6e +64 +6f +77 +43 +6c +61 +73 +73 +00 +57 +69 +6e +64 +6f +77 +20 +52 +65 +67 +69 +73 +74 +72 +61 +74 +69 +6f +6e +20 +46 +61 +69 +6c +65 +64 +21 +00 +45 +72 +72 +6f +72 +21 +00 +54 +68 +65 +20 +74 +69 +74 +6c +65 +20 +6f +66 +20 +6d +79 +20 +77 +69 +6e +64 +6f +77 +00 +57 +69 +6e +64 +6f +77 +20 +43 +72 +65 +61 +74 +69 +6f +6e +20 +46 +61 +69 +6c +65 +64 +21 +00 +00 +50 +43 +43 +3a +20 +70 +63 +63 +20 +30 +2e +39 +2e +39 +20 +28 +77 +69 +6e +33 +32 +29 +00 +2e +66 +69 +6c +65 +00 +00 +00 +00 +00 +00 +00 +fe +ff +00 +00 +67 +01 +2d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +2e +74 +65 +78 +74 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +03 +01 +99 +01 +00 +00 +17 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +2e +72 +6f +64 +61 +74 +61 +00 +00 +00 +00 +00 +02 +00 +00 +00 +03 +01 +6e +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +0f +00 +00 +00 +0e +00 +00 +00 +02 +00 +00 +00 +02 +00 +00 +00 +00 +00 +1e +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +02 +00 +00 +00 +00 +00 +2a +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +00 +00 +3b +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +00 +00 +4e +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +00 +00 +61 +00 +00 +00 +58 +00 +00 +00 +01 +00 +00 +00 +02 +00 +00 +00 +00 +00 +6d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +00 +00 +7a +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +00 +00 +89 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +00 +00 +9d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +00 +00 +ad +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +00 +00 +c1 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +00 +00 +cf +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +00 +00 +df +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +00 +00 +ef +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +00 +00 +03 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +00 +00 +17 +01 +00 +00 +00 +00 +00 +00 +03 +00 +00 +00 +03 +01 +18 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +22 +01 +00 +00 +2e +72 +64 +61 +74 +61 +24 +7a +7a +7a +00 +5f +67 +5f +73 +7a +43 +6c +61 +73 +73 +4e +61 +6d +65 +00 +5f +57 +6e +64 +50 +72 +6f +63 +40 +31 +36 +00 +5f +44 +65 +73 +74 +72 +6f +79 +57 +69 +6e +64 +6f +77 +40 +34 +00 +5f +50 +6f +73 +74 +51 +75 +69 +74 +4d +65 +73 +73 +61 +67 +65 +40 +34 +00 +5f +44 +65 +66 +57 +69 +6e +64 +6f +77 +50 +72 +6f +63 +41 +40 +31 +36 +00 +5f +57 +69 +6e +4d +61 +69 +6e +40 +31 +36 +00 +5f +4c +6f +61 +64 +49 +63 +6f +6e +41 +40 +38 +00 +5f +4c +6f +61 +64 +43 +75 +72 +73 +6f +72 +41 +40 +38 +00 +5f +52 +65 +67 +69 +73 +74 +65 +72 +43 +6c +61 +73 +73 +45 +78 +41 +40 +34 +00 +5f +4d +65 +73 +73 +61 +67 +65 +42 +6f +78 +41 +40 +31 +36 +00 +5f +43 +72 +65 +61 +74 +65 +57 +69 +6e +64 +6f +77 +45 +78 +41 +40 +34 +38 +00 +5f +53 +68 +6f +77 +57 +69 +6e +64 +6f +77 +40 +38 +00 +5f +55 +70 +64 +61 +74 +65 +57 +69 +6e +64 +6f +77 +40 +34 +00 +5f +47 +65 +74 +4d +65 +73 +73 +61 +67 +65 +41 +40 +31 +36 +00 +5f +54 +72 +61 +6e +73 +6c +61 +74 +65 +4d +65 +73 +73 +61 +67 +65 +40 +34 +00 +5f +44 +69 +73 +70 +61 +74 +63 +68 +4d +65 +73 +73 +61 +67 +65 +41 +40 +34 +00 +2e +72 +64 +61 +74 +61 +24 +7a +7a +7a +00 diff --git a/modules/objfmts/xdf/xdf-objfmt.c b/modules/objfmts/xdf/xdf-objfmt.c index bae43525..8f109d20 100644 --- a/modules/objfmts/xdf/xdf-objfmt.c +++ b/modules/objfmts/xdf/xdf-objfmt.c @@ -838,6 +838,7 @@ yasm_objfmt_module yasm_xdf_LTX_objfmt = { "xdf", "xdf", 32, + 0, xdf_objfmt_dbgfmt_keywords, "null", NULL, /* no directives */ diff --git a/modules/parsers/gas/gas-token.re b/modules/parsers/gas/gas-token.re index 0a68af59..a4ce5bba 100644 --- a/modules/parsers/gas/gas-token.re +++ b/modules/parsers/gas/gas-token.re @@ -400,6 +400,16 @@ scan: RETURN(ID); } + /* identifier with @ */ + [a-zA-Z_.]([a-zA-Z0-9_$.]*[@][a-zA-Z0-9_$.]*)+ { + /* if @ not part of ID, move the scanner cursor to the first @ */ + if (!((yasm_objfmt_base *)p_object->objfmt)->module->id_at_ok) + cursor = (unsigned char *)strchr(TOK, '@'); + lvalp->str.contents = yasm__xstrndup(TOK, TOKLEN); + lvalp->str.len = TOKLEN; + RETURN(ID); + } + /* register or segment register */ [%][a-zA-Z0-9]+ { savech = s->tok[TOKLEN]; From cf56635ebf196c7ad9174f8b8f8e6756950e50c4 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 2 Jan 2009 08:36:09 +0000 Subject: [PATCH 244/585] Remove long-obsolete "debug" flag from internal parser structures. svn path=/trunk/yasm/; revision=2167 --- modules/parsers/gas/gas-parser.c | 3 --- modules/parsers/gas/gas-parser.h | 2 -- modules/parsers/nasm/nasm-parser.c | 3 --- modules/parsers/nasm/nasm-parser.h | 2 -- 4 files changed, 10 deletions(-) diff --git a/modules/parsers/gas/gas-parser.c b/modules/parsers/gas/gas-parser.c index de3397c2..98231471 100644 --- a/modules/parsers/gas/gas-parser.c +++ b/modules/parsers/gas/gas-parser.c @@ -81,9 +81,6 @@ gas_parser_do_parse(yasm_object *object, yasm_preproc *pp, parser_gas.is_nasm_preproc = yasm__strcasecmp(((yasm_preproc_base*)pp)->module->keyword, "nasm") == 0; - /* yacc debugging, needs YYDEBUG set in bison.y.in to work */ - parser_gas.debug = 1; - gas_parser_parse(&parser_gas); /* Check for ending inside a rept */ diff --git a/modules/parsers/gas/gas-parser.h b/modules/parsers/gas/gas-parser.h index 3463563f..edb40a8f 100644 --- a/modules/parsers/gas/gas-parser.h +++ b/modules/parsers/gas/gas-parser.h @@ -92,8 +92,6 @@ enum gas_parser_state { }; typedef struct yasm_parser_gas { - int debug; - /*@only@*/ yasm_object *object; /* last "base" label for local (.) labels */ diff --git a/modules/parsers/nasm/nasm-parser.c b/modules/parsers/nasm/nasm-parser.c index ba3263ae..b0ad4b51 100644 --- a/modules/parsers/nasm/nasm-parser.c +++ b/modules/parsers/nasm/nasm-parser.c @@ -63,9 +63,6 @@ nasm_do_parse(yasm_object *object, yasm_preproc *pp, int save_input, parser_nasm.state = INITIAL; - /* yacc debugging, needs YYDEBUG set in bison.y.in to work */ - /* nasm_parser_debug = 1; */ - nasm_parser_parse(&parser_nasm); /*yasm_scanner_delete(&parser_nasm.s);*/ diff --git a/modules/parsers/nasm/nasm-parser.h b/modules/parsers/nasm/nasm-parser.h index 3312027e..e0607a7b 100644 --- a/modules/parsers/nasm/nasm-parser.h +++ b/modules/parsers/nasm/nasm-parser.h @@ -89,8 +89,6 @@ typedef union { typedef struct yasm_parser_nasm { int tasm; - int debug; - /*@only@*/ yasm_object *object; /* last "base" label for local (.) labels */ From 7defbd57e6bba1c766467ec4916f09e5ef7c1388 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 2 Jan 2009 20:32:05 +0000 Subject: [PATCH 245/585] gas parser: Allow equ's to be named the same as instructions. svn path=/trunk/yasm/; revision=2168 --- modules/parsers/gas/gas-parse.c | 4 ++-- modules/parsers/gas/tests/gas-instlabel.asm | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/parsers/gas/gas-parse.c b/modules/parsers/gas/gas-parse.c index 41b1888d..27fb77fe 100644 --- a/modules/parsers/gas/gas-parse.c +++ b/modules/parsers/gas/gas-parse.c @@ -946,9 +946,9 @@ parse_instr(yasm_parser_gas *parser_gas) if (!isalpha(id[0])) return NULL; - /* check to be sure it's not a label */ + /* check to be sure it's not a label or equ */ get_peek_token(parser_gas); - if (parser_gas->peek_token == ':') + if (parser_gas->peek_token == ':' || parser_gas->peek_token == '=') return NULL; switch (yasm_arch_parse_check_insnprefix diff --git a/modules/parsers/gas/tests/gas-instlabel.asm b/modules/parsers/gas/tests/gas-instlabel.asm index 44c47482..22c0c00a 100644 --- a/modules/parsers/gas/tests/gas-instlabel.asm +++ b/modules/parsers/gas/tests/gas-instlabel.asm @@ -1,3 +1,6 @@ .globl SUB .type SUB, @function SUB: + +ADD = 5 + From ab1449c2067c16b260d4681419ae595139b1a878 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 2 Jan 2009 20:46:57 +0000 Subject: [PATCH 246/585] gas parser: Allow segment register prefixes before instructions. svn path=/trunk/yasm/; revision=2169 --- modules/parsers/gas/gas-parse.c | 23 +- modules/parsers/gas/tests/Makefile.inc | 2 + modules/parsers/gas/tests/gas-segprefix.asm | 2 + modules/parsers/gas/tests/gas-segprefix.hex | 360 ++++++++++++++++++++ 4 files changed, 376 insertions(+), 11 deletions(-) create mode 100644 modules/parsers/gas/tests/gas-segprefix.asm create mode 100644 modules/parsers/gas/tests/gas-segprefix.hex diff --git a/modules/parsers/gas/gas-parse.c b/modules/parsers/gas/gas-parse.c index 27fb77fe..cabf5764 100644 --- a/modules/parsers/gas/gas-parse.c +++ b/modules/parsers/gas/gas-parse.c @@ -989,7 +989,6 @@ parse_instr(yasm_parser_gas *parser_gas) return bc; } case YASM_ARCH_PREFIX: - { /* Propagate errors in case we got a warning from the arch */ yasm_errwarn_propagate(parser_gas->errwarns, cur_line); @@ -1000,19 +999,21 @@ parse_instr(yasm_parser_gas *parser_gas) bc = yasm_arch_create_empty_insn(p_object->arch, cur_line); yasm_insn_add_prefix(yasm_bc_get_insn(bc), prefix); return bc; - } -#if 0 - /* TODO */ - case SEGREG: - { - uintptr_t segreg = SEGREG_val; - get_next_token(); /* SEGREG */ + default: + break; + } + + /* Check for segment register used as prefix */ + switch (yasm_arch_parse_check_regtmod(p_object->arch, ID_val, ID_len, + &prefix)) { + case YASM_ARCH_SEGREG: + yasm_xfree(id); + get_next_token(); /* ID */ bc = parse_instr(parser_gas); if (!bc) bc = yasm_arch_create_empty_insn(p_object->arch, cur_line); - yasm_insn_add_seg_prefix(yasm_bc_get_insn(bc), segreg); - } -#endif + yasm_insn_add_seg_prefix(yasm_bc_get_insn(bc), prefix); + return bc; default: return NULL; } diff --git a/modules/parsers/gas/tests/Makefile.inc b/modules/parsers/gas/tests/Makefile.inc index 756e3251..aee3c461 100644 --- a/modules/parsers/gas/tests/Makefile.inc +++ b/modules/parsers/gas/tests/Makefile.inc @@ -24,6 +24,8 @@ EXTRA_DIST += modules/parsers/gas/tests/gas-line2-err.asm EXTRA_DIST += modules/parsers/gas/tests/gas-line2-err.errwarn EXTRA_DIST += modules/parsers/gas/tests/gas-push.asm EXTRA_DIST += modules/parsers/gas/tests/gas-push.hex +EXTRA_DIST += modules/parsers/gas/tests/gas-segprefix.asm +EXTRA_DIST += modules/parsers/gas/tests/gas-segprefix.hex EXTRA_DIST += modules/parsers/gas/tests/gas-semi.asm EXTRA_DIST += modules/parsers/gas/tests/gas-semi.hex EXTRA_DIST += modules/parsers/gas/tests/gassectalign.asm diff --git a/modules/parsers/gas/tests/gas-segprefix.asm b/modules/parsers/gas/tests/gas-segprefix.asm new file mode 100644 index 00000000..9295b90a --- /dev/null +++ b/modules/parsers/gas/tests/gas-segprefix.asm @@ -0,0 +1,2 @@ +.text +es pushl %ebp diff --git a/modules/parsers/gas/tests/gas-segprefix.hex b/modules/parsers/gas/tests/gas-segprefix.hex new file mode 100644 index 00000000..932e1ea6 --- /dev/null +++ b/modules/parsers/gas/tests/gas-segprefix.hex @@ -0,0 +1,360 @@ +7f +45 +4c +46 +01 +01 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +03 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +a0 +00 +00 +00 +00 +00 +00 +00 +34 +00 +00 +00 +00 +00 +28 +00 +05 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +26 +55 +00 +00 +00 +2e +74 +65 +78 +74 +00 +2e +73 +74 +72 +74 +61 +62 +00 +2e +73 +79 +6d +74 +61 +62 +00 +2e +73 +68 +73 +74 +72 +74 +61 +62 +00 +00 +00 +00 +00 +2d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +f1 +ff +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +17 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +44 +00 +00 +00 +21 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +07 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +68 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +0f +00 +00 +00 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +6c +00 +00 +00 +30 +00 +00 +00 +02 +00 +00 +00 +03 +00 +00 +00 +04 +00 +00 +00 +10 +00 +00 +00 +01 +00 +00 +00 +01 +00 +00 +00 +06 +00 +00 +00 +00 +00 +00 +00 +40 +00 +00 +00 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 From 5624364e9096be838dcdb872ee88d704968b4048 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 14 Jan 2009 08:28:13 +0000 Subject: [PATCH 247/585] Update AVX and FMA to latest Intel specification (Dec 2008). - Removed VPERMIL2 opcodes (VPERMIL2PS, VPERMIL2PD). - Replaced 4-operand FMA instructions with completely new set of opcodes. Contributed by: Mark Charney, Intel Corporation svn path=/trunk/yasm/; revision=2170 --- modules/arch/x86/gen_x86_insn.py | 270 ++-- modules/arch/x86/tests/Makefile.inc | 3 +- modules/arch/x86/tests/avx.asm | 22 - modules/arch/x86/tests/avx.hex | 120 -- modules/arch/x86/tests/fma.asm | 396 ++++-- modules/arch/x86/tests/fma.hex | 1862 ++++++++++++++++++++------- modules/arch/x86/tests/vpermil2.asm | 10 - modules/arch/x86/tests/vpermil2.hex | 36 - 8 files changed, 1754 insertions(+), 965 deletions(-) delete mode 100644 modules/arch/x86/tests/vpermil2.asm delete mode 100644 modules/arch/x86/tests/vpermil2.hex diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index 9dcae4ba..60f27eb4 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -6283,108 +6283,6 @@ add_group("vpermil", add_insn("vpermilpd", "vpermil", modifiers=[0x05]) add_insn("vpermilps", "vpermil", modifiers=[0x04]) -add_group("vpermil2", - cpu=["AVX"], - modifiers=["Op2Add"], - vex=128, - vexw=0, - prefix=0x66, - opcode=[0x0F, 0x3A, 0x00], - operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDReg", size=128, dest="VEX"), - Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), - Operand(type="SIMDReg", size=128, dest="VEXImmSrc"), - Operand(type="Imm", dest="VEXImm")]) -add_group("vpermil2", - cpu=["AVX"], - modifiers=["Op2Add"], - vex=128, - vexw=1, - prefix=0x66, - opcode=[0x0F, 0x3A, 0x00], - operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDReg", size=128, dest="VEX"), - Operand(type="SIMDReg", size=128, dest="VEXImmSrc"), - Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), - Operand(type="Imm", dest="VEXImm")]) -add_group("vpermil2", - cpu=["AVX"], - modifiers=["Op2Add"], - vex=256, - vexw=0, - prefix=0x66, - opcode=[0x0F, 0x3A, 0x00], - operands=[Operand(type="SIMDReg", size=256, dest="Spare"), - Operand(type="SIMDReg", size=256, dest="VEX"), - Operand(type="SIMDRM", size=256, relaxed=True, dest="EA"), - Operand(type="SIMDReg", size=256, dest="VEXImmSrc"), - Operand(type="Imm", dest="VEXImm")]) -add_group("vpermil2", - cpu=["AVX"], - modifiers=["Op2Add"], - vex=256, - vexw=1, - prefix=0x66, - opcode=[0x0F, 0x3A, 0x00], - operands=[Operand(type="SIMDReg", size=256, dest="Spare"), - Operand(type="SIMDReg", size=256, dest="VEX"), - Operand(type="SIMDReg", size=256, dest="VEXImmSrc"), - Operand(type="SIMDRM", size=256, relaxed=True, dest="EA"), - Operand(type="Imm", dest="VEXImm")]) - -add_insn("vpermil2pd", "vpermil2", modifiers=[0x49]) -add_insn("vpermil2ps", "vpermil2", modifiers=[0x48]) - -# Immediate aliases for the above -add_group("vpermil2_fixed", - cpu=["AVX"], - modifiers=["Op2Add", "Imm8"], - vex=128, - vexw=0, - prefix=0x66, - opcode=[0x0F, 0x3A, 0x00], - operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDReg", size=128, dest="VEX"), - Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), - Operand(type="SIMDReg", size=128, dest="VEXImmSrc")]) -add_group("vpermil2_fixed", - cpu=["AVX"], - modifiers=["Op2Add", "Imm8"], - vex=128, - vexw=1, - prefix=0x66, - opcode=[0x0F, 0x3A, 0x00], - operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDReg", size=128, dest="VEX"), - Operand(type="SIMDReg", size=128, dest="VEXImmSrc"), - Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) -add_group("vpermil2_fixed", - cpu=["AVX"], - modifiers=["Op2Add", "Imm8"], - vex=256, - vexw=0, - prefix=0x66, - opcode=[0x0F, 0x3A, 0x00], - operands=[Operand(type="SIMDReg", size=256, dest="Spare"), - Operand(type="SIMDReg", size=256, dest="VEX"), - Operand(type="SIMDRM", size=256, relaxed=True, dest="EA"), - Operand(type="SIMDReg", size=256, dest="VEXImmSrc")]) -add_group("vpermil2_fixed", - cpu=["AVX"], - modifiers=["Op2Add", "Imm8"], - vex=256, - vexw=1, - prefix=0x66, - opcode=[0x0F, 0x3A, 0x00], - operands=[Operand(type="SIMDReg", size=256, dest="Spare"), - Operand(type="SIMDReg", size=256, dest="VEX"), - Operand(type="SIMDReg", size=256, dest="VEXImmSrc"), - Operand(type="SIMDRM", size=256, relaxed=True, dest="EA")]) - -for ib, cc in [(0, "td"), (2, "mo"), (3, "mz")]: - add_insn("vpermil"+cc+"2pd", "vpermil2_fixed", modifiers=[0x49, ib]) - add_insn("vpermil"+cc+"2ps", "vpermil2_fixed", modifiers=[0x48, ib]) - add_group("vperm2f128", cpu=["AVX"], vex=256, @@ -6401,107 +6299,107 @@ add_insn("vperm2f128", "vperm2f128") # Intel FMA instructions ##################################################################### -add_group("fma_128_256", +### 128/256b FMA PS +add_group("vfma_ps", cpu=["FMA"], modifiers=["Op2Add"], vex=128, - vexw=0, + vexw=0, # single precision prefix=0x66, - opcode=[0x0F, 0x3A, 0x00], + opcode=[0x0F, 0x38, 0x00], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDReg", size=128, dest="VEXImmSrc"), - Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), - Operand(type="SIMDReg", size=128, dest="VEX")]) -add_group("fma_128_256", - cpu=["FMA"], - modifiers=["Op2Add"], - vex=128, - vexw=1, - prefix=0x66, - opcode=[0x0F, 0x3A, 0x00], - operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDReg", size=128, dest="VEXImmSrc"), Operand(type="SIMDReg", size=128, dest="VEX"), Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) -add_group("fma_128_256", +add_group("vfma_ps", cpu=["FMA"], modifiers=["Op2Add"], vex=256, - vexw=0, + vexw=0, # single precision prefix=0x66, - opcode=[0x0F, 0x3A, 0x00], + opcode=[0x0F, 0x38, 0x00], operands=[Operand(type="SIMDReg", size=256, dest="Spare"), - Operand(type="SIMDReg", size=256, dest="VEXImmSrc"), - Operand(type="SIMDRM", size=256, relaxed=True, dest="EA"), - Operand(type="SIMDReg", size=256, dest="VEX")]) -add_group("fma_128_256", - cpu=["FMA"], - modifiers=["Op2Add"], - vex=256, - vexw=1, - prefix=0x66, - opcode=[0x0F, 0x3A, 0x00], - operands=[Operand(type="SIMDReg", size=256, dest="Spare"), - Operand(type="SIMDReg", size=256, dest="VEXImmSrc"), Operand(type="SIMDReg", size=256, dest="VEX"), Operand(type="SIMDRM", size=256, relaxed=True, dest="EA")]) -add_insn("vfmaddpd", "fma_128_256", modifiers=[0x69]) -add_insn("vfmaddps", "fma_128_256", modifiers=[0x68]) -add_insn("vfmaddsubpd", "fma_128_256", modifiers=[0x5D]) -add_insn("vfmaddsubps", "fma_128_256", modifiers=[0x5C]) -add_insn("vfmsubaddpd", "fma_128_256", modifiers=[0x5F]) -add_insn("vfmsubaddps", "fma_128_256", modifiers=[0x5E]) -add_insn("vfmsubpd", "fma_128_256", modifiers=[0x6D]) -add_insn("vfmsubps", "fma_128_256", modifiers=[0x6C]) -add_insn("vfnmaddpd", "fma_128_256", modifiers=[0x79]) -add_insn("vfnmaddps", "fma_128_256", modifiers=[0x78]) -add_insn("vfnmsubpd", "fma_128_256", modifiers=[0x7D]) -add_insn("vfnmsubps", "fma_128_256", modifiers=[0x7C]) +### 128/256b FMA PD(W=1) +add_group("vfma_pd", + cpu=["FMA"], + modifiers=["Op2Add"], + vex=128, + vexw=1, # double precision + prefix=0x66, + opcode=[0x0F, 0x38, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) +add_group("vfma_pd", + cpu=["FMA"], + modifiers=["Op2Add"], + vex=256, + vexw=1, # double precision + prefix=0x66, + opcode=[0x0F, 0x38, 0x00], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="SIMDReg", size=256, dest="VEX"), + Operand(type="SIMDRM", size=256, relaxed=True, dest="EA")]) -for sz in [32, 64]: - add_group("fma_128_m%d" % sz, - cpu=["FMA"], - modifiers=["Op2Add"], - vex=128, - vexw=0, - prefix=0x66, - opcode=[0x0F, 0x3A, 0x00], - operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDReg", size=128, dest="VEXImmSrc"), - Operand(type="SIMDReg", size=128, dest="EA"), - Operand(type="SIMDReg", size=128, dest="VEX")]) - add_group("fma_128_m%d" % sz, - cpu=["FMA"], - modifiers=["Op2Add"], - vex=128, - vexw=0, - prefix=0x66, - opcode=[0x0F, 0x3A, 0x00], - operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDReg", size=128, dest="VEXImmSrc"), - Operand(type="Mem", size=sz, relaxed=True, dest="EA"), - Operand(type="SIMDReg", size=128, dest="VEX")]) - add_group("fma_128_m%d" % sz, - cpu=["FMA"], - modifiers=["Op2Add"], - vex=128, - vexw=1, - prefix=0x66, - opcode=[0x0F, 0x3A, 0x00], - operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDReg", size=128, dest="VEXImmSrc"), - Operand(type="SIMDReg", size=128, dest="VEX"), - Operand(type="Mem", size=sz, relaxed=True, dest="EA")]) +add_group("vfma_ss", + cpu=["FMA"], + modifiers=["Op2Add"], + vex=128, + vexw=0, + prefix=0x66, + opcode=[0x0F, 0x38, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDReg", size=128, dest="EA")]) -add_insn("vfmaddsd", "fma_128_m64", modifiers=[0x6B]) -add_insn("vfmaddss", "fma_128_m32", modifiers=[0x6A]) -add_insn("vfmsubsd", "fma_128_m64", modifiers=[0x6F]) -add_insn("vfmsubss", "fma_128_m32", modifiers=[0x6E]) -add_insn("vfnmaddsd", "fma_128_m64", modifiers=[0x7B]) -add_insn("vfnmaddss", "fma_128_m32", modifiers=[0x7A]) -add_insn("vfnmsubsd", "fma_128_m64", modifiers=[0x7F]) -add_insn("vfnmsubss", "fma_128_m32", modifiers=[0x7E]) +add_group("vfma_ss", + cpu=["FMA"], + modifiers=["Op2Add"], + vex=128, + vexw=0, + prefix=0x66, + opcode=[0x0F, 0x38, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="Mem", size=32, relaxed=True, dest="EA")]) + +add_group("vfma_sd", + cpu=["FMA"], + modifiers=["Op2Add"], + vex=128, + vexw=1, + prefix=0x66, + opcode=[0x0F, 0x38, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDReg", size=128, dest="EA")]) + +add_group("vfma_sd", + cpu=["FMA"], + modifiers=["Op2Add"], + vex=128, + vexw=1, + prefix=0x66, + opcode=[0x0F, 0x38, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="Mem", size=64, relaxed=True, dest="EA")]) + +for orderval, order in enumerate(["132", "213", "231"]): + ov = orderval << 4 + for combval, comb in enumerate(["ps", "pd", "ss", "sd"]): + cv = combval >> 1 + add_insn("vfmadd"+order+comb, "vfma_"+comb, modifiers=[0x98+ov+cv]) + add_insn("vfmsub"+order+comb, "vfma_"+comb, modifiers=[0x9A+ov+cv]) + add_insn("vfnmsub"+order+comb, "vfma_"+comb, modifiers=[0x9E+ov+cv]) + add_insn("vfnmadd"+order+comb, "vfma_"+comb, modifiers=[0x9C+ov+cv]) + + # no ss/sd for these + for comb in ["ps", "pd"]: + add_insn("vfmaddsub"+order+comb, "vfma_"+comb, modifiers=[0x96+ov]) + add_insn("vfmsubadd"+order+comb, "vfma_"+comb, modifiers=[0x97+ov]) ##################################################################### # Intel AES instructions diff --git a/modules/arch/x86/tests/Makefile.inc b/modules/arch/x86/tests/Makefile.inc index 687fb31a..bbe26ed2 100644 --- a/modules/arch/x86/tests/Makefile.inc +++ b/modules/arch/x86/tests/Makefile.inc @@ -3,6 +3,7 @@ TESTS += modules/arch/x86/tests/x86_test.sh EXTRA_DIST += modules/arch/x86/tests/x86_test.sh +EXTRA_DIST += modules/arch/x86/tests/gen-fma-test.py EXTRA_DIST += modules/arch/x86/tests/addbyte.asm EXTRA_DIST += modules/arch/x86/tests/addbyte.errwarn EXTRA_DIST += modules/arch/x86/tests/addbyte.hex @@ -212,8 +213,6 @@ EXTRA_DIST += modules/arch/x86/tests/vmx.asm EXTRA_DIST += modules/arch/x86/tests/vmx.hex EXTRA_DIST += modules/arch/x86/tests/vmx-err.asm EXTRA_DIST += modules/arch/x86/tests/vmx-err.errwarn -EXTRA_DIST += modules/arch/x86/tests/vpermil2.asm -EXTRA_DIST += modules/arch/x86/tests/vpermil2.hex EXTRA_DIST += modules/arch/x86/tests/x86label.asm EXTRA_DIST += modules/arch/x86/tests/x86label.hex EXTRA_DIST += modules/arch/x86/tests/xchg64.asm diff --git a/modules/arch/x86/tests/avx.asm b/modules/arch/x86/tests/avx.asm index 6461ea05..eff8cc97 100644 --- a/modules/arch/x86/tests/avx.asm +++ b/modules/arch/x86/tests/avx.asm @@ -1432,17 +1432,6 @@ vpermilpd xmm1, dqword [rax], 5 vpermilpd ymm1, [rax], byte 5 vpermilpd ymm1, yword [rax], 5 -vpermil2pd xmm1, xmm2, xmm3, xmm4, 5 -vpermil2pd xmm1, xmm2, [rax], xmm4, 5 -vpermil2pd xmm1, xmm2, dqword [rax], xmm4, 5 -vpermil2pd xmm1, xmm2, xmm3, [rax], 5 -vpermil2pd xmm1, xmm2, xmm3, dqword [rax], 5 -vpermil2pd ymm1, ymm2, ymm3, ymm4, 5 -vpermil2pd ymm1, ymm2, [rax], ymm4, 5 -vpermil2pd ymm1, ymm2, yword [rax], ymm4, 5 -vpermil2pd ymm1, ymm2, ymm3, [rax], 5 -vpermil2pd ymm1, ymm2, ymm3, yword [rax], 5 - vpermilps xmm1, xmm2, xmm3 vpermilps xmm1, xmm2, [rax] vpermilps xmm1, xmm2, dqword [rax] @@ -1454,17 +1443,6 @@ vpermilps xmm1, dqword [rax], 5 vpermilps ymm1, [rax], byte 5 vpermilps ymm1, yword [rax], 5 -vpermil2ps xmm1, xmm2, xmm3, xmm4, 5 -vpermil2ps xmm1, xmm2, [rax], xmm4, 5 -vpermil2ps xmm1, xmm2, dqword [rax], xmm4, 5 -vpermil2ps xmm1, xmm2, xmm3, [rax], 5 -vpermil2ps xmm1, xmm2, xmm3, dqword [rax], 5 -vpermil2ps ymm1, ymm2, ymm3, ymm4, 5 -vpermil2ps ymm1, ymm2, [rax], ymm4, 5 -vpermil2ps ymm1, ymm2, yword [rax], ymm4, 5 -vpermil2ps ymm1, ymm2, ymm3, [rax], 5 -vpermil2ps ymm1, ymm2, ymm3, yword [rax], 5 - vperm2f128 ymm1, ymm2, ymm3, 5 vperm2f128 ymm1, ymm2, [rax], byte 5 vperm2f128 ymm1, ymm2, yword [rax], 5 diff --git a/modules/arch/x86/tests/avx.hex b/modules/arch/x86/tests/avx.hex index c9ada3e1..4bc11def 100644 --- a/modules/arch/x86/tests/avx.hex +++ b/modules/arch/x86/tests/avx.hex @@ -5463,66 +5463,6 @@ e3 08 05 c4 -e3 -69 -49 -cb -45 -c4 -e3 -69 -49 -08 -45 -c4 -e3 -69 -49 -08 -45 -c4 -e3 -e9 -49 -08 -35 -c4 -e3 -e9 -49 -08 -35 -c4 -e3 -6d -49 -cb -45 -c4 -e3 -6d -49 -08 -45 -c4 -e3 -6d -49 -08 -45 -c4 -e3 -ed -49 -08 -35 -c4 -e3 -ed -49 -08 -35 -c4 e2 69 0c @@ -5578,66 +5518,6 @@ e3 05 c4 e3 -69 -48 -cb -45 -c4 -e3 -69 -48 -08 -45 -c4 -e3 -69 -48 -08 -45 -c4 -e3 -e9 -48 -08 -35 -c4 -e3 -e9 -48 -08 -35 -c4 -e3 -6d -48 -cb -45 -c4 -e3 -6d -48 -08 -45 -c4 -e3 -6d -48 -08 -45 -c4 -e3 -ed -48 -08 -35 -c4 -e3 -ed -48 -08 -35 -c4 -e3 6d 06 cb diff --git a/modules/arch/x86/tests/fma.asm b/modules/arch/x86/tests/fma.asm index 25fdc50d..9bfb512b 100644 --- a/modules/arch/x86/tests/fma.asm +++ b/modules/arch/x86/tests/fma.asm @@ -1,109 +1,289 @@ [bits 64] -vfmaddpd xmm0, xmm1, xmm2, xmm3 -vfmaddpd xmm0, xmm1, [rax], xmm3 -vfmaddpd xmm0, xmm1, dqword [rax], xmm3 -vfmaddpd xmm0, xmm1, xmm2, [rax] -vfmaddpd xmm0, xmm1, xmm2, dqword [rax] -vfmaddpd ymm0, ymm1, ymm2, ymm3 -vfmaddpd ymm0, ymm1, [rax], ymm3 -vfmaddpd ymm0, ymm1, yword [rax], ymm3 -vfmaddpd ymm0, ymm1, ymm2, [rax] -vfmaddpd ymm0, ymm1, ymm2, yword [rax] - -vfmaddps xmm0, xmm1, xmm2, xmm3 -vfmaddps xmm0, xmm1, dqword [rax], xmm3 -vfmaddps xmm0, xmm1, xmm2, dqword [rax] -vfmaddps ymm0, ymm1, ymm2, ymm3 -vfmaddps ymm0, ymm1, yword [rax], ymm3 -vfmaddps ymm0, ymm1, ymm2, yword [rax] - -vfmaddsd xmm0, xmm1, xmm2, xmm3 -vfmaddsd xmm0, xmm1, [rax], xmm3 -vfmaddsd xmm0, xmm1, qword [rax], xmm3 -vfmaddsd xmm0, xmm1, xmm2, [rax] -vfmaddsd xmm0, xmm1, xmm2, qword [rax] - -vfmaddss xmm0, xmm1, xmm2, xmm3 -vfmaddss xmm0, xmm1, dword [rax], xmm3 -vfmaddss xmm0, xmm1, xmm2, dword [rax] - -vfmaddsubpd xmm0, xmm1, xmm2, xmm3 -vfmaddsubpd xmm0, xmm1, dqword [rax], xmm3 -vfmaddsubpd xmm0, xmm1, xmm2, dqword [rax] -vfmaddsubpd ymm0, ymm1, ymm2, ymm3 -vfmaddsubpd ymm0, ymm1, yword [rax], ymm3 -vfmaddsubpd ymm0, ymm1, ymm2, yword [rax] - -vfmaddsubps xmm0, xmm1, xmm2, xmm3 -vfmaddsubps xmm0, xmm1, dqword [rax], xmm3 -vfmaddsubps xmm0, xmm1, xmm2, dqword [rax] -vfmaddsubps ymm0, ymm1, ymm2, ymm3 -vfmaddsubps ymm0, ymm1, yword [rax], ymm3 -vfmaddsubps ymm0, ymm1, ymm2, yword [rax] - -vfmsubpd xmm0, xmm1, xmm2, xmm3 -vfmsubpd xmm0, xmm1, dqword [rax], xmm3 -vfmsubpd xmm0, xmm1, xmm2, dqword [rax] -vfmsubpd ymm0, ymm1, ymm2, ymm3 -vfmsubpd ymm0, ymm1, yword [rax], ymm3 -vfmsubpd ymm0, ymm1, ymm2, yword [rax] - -vfmsubps xmm0, xmm1, xmm2, xmm3 -vfmsubps xmm0, xmm1, dqword [rax], xmm3 -vfmsubps xmm0, xmm1, xmm2, dqword [rax] -vfmsubps ymm0, ymm1, ymm2, ymm3 -vfmsubps ymm0, ymm1, yword [rax], ymm3 -vfmsubps ymm0, ymm1, ymm2, yword [rax] - -vfmsubsd xmm0, xmm1, xmm2, xmm3 -vfmsubsd xmm0, xmm1, qword [rax], xmm3 -vfmsubsd xmm0, xmm1, xmm2, qword [rax] - -vfmsubss xmm0, xmm1, xmm2, xmm3 -vfmsubss xmm0, xmm1, dword [rax], xmm3 -vfmsubss xmm0, xmm1, xmm2, dword [rax] - -vfnmaddpd xmm0, xmm1, xmm2, xmm3 -vfnmaddpd xmm0, xmm1, dqword [rax], xmm3 -vfnmaddpd xmm0, xmm1, xmm2, dqword [rax] -vfnmaddpd ymm0, ymm1, ymm2, ymm3 -vfnmaddpd ymm0, ymm1, yword [rax], ymm3 -vfnmaddpd ymm0, ymm1, ymm2, yword [rax] - -vfnmaddps xmm0, xmm1, xmm2, xmm3 -vfnmaddps xmm0, xmm1, dqword [rax], xmm3 -vfnmaddps xmm0, xmm1, xmm2, dqword [rax] -vfnmaddps ymm0, ymm1, ymm2, ymm3 -vfnmaddps ymm0, ymm1, yword [rax], ymm3 -vfnmaddps ymm0, ymm1, ymm2, yword [rax] - -vfnmaddsd xmm0, xmm1, xmm2, xmm3 -vfnmaddsd xmm0, xmm1, qword [rax], xmm3 -vfnmaddsd xmm0, xmm1, xmm2, qword [rax] - -vfnmaddss xmm0, xmm1, xmm2, xmm3 -vfnmaddss xmm0, xmm1, dword [rax], xmm3 -vfnmaddss xmm0, xmm1, xmm2, dword [rax] - -vfnmsubpd xmm0, xmm1, xmm2, xmm3 -vfnmsubpd xmm0, xmm1, dqword [rax], xmm3 -vfnmsubpd xmm0, xmm1, xmm2, dqword [rax] -vfnmsubpd ymm0, ymm1, ymm2, ymm3 -vfnmsubpd ymm0, ymm1, yword [rax], ymm3 -vfnmsubpd ymm0, ymm1, ymm2, yword [rax] - -vfnmsubps xmm0, xmm1, xmm2, xmm3 -vfnmsubps xmm0, xmm1, dqword [rax], xmm3 -vfnmsubps xmm0, xmm1, xmm2, dqword [rax] -vfnmsubps ymm0, ymm1, ymm2, ymm3 -vfnmsubps ymm0, ymm1, yword [rax], ymm3 -vfnmsubps ymm0, ymm1, ymm2, yword [rax] - -vfnmsubsd xmm0, xmm1, xmm2, xmm3 -vfnmsubsd xmm0, xmm1, qword [rax], xmm3 -vfnmsubsd xmm0, xmm1, xmm2, qword [rax] - -vfnmsubss xmm0, xmm1, xmm2, xmm3 -vfnmsubss xmm0, xmm1, dword [rax], xmm3 -vfnmsubss xmm0, xmm1, xmm2, dword [rax] - +vfmadd132ss xmm1, xmm2, xmm3 +vfmadd132ss xmm1, xmm2, dword [rax] +vfmadd132ss xmm1, xmm2, [rax] +vfmadd231ss xmm1, xmm2, xmm3 +vfmadd231ss xmm1, xmm2, dword [rax] +vfmadd231ss xmm1, xmm2, [rax] +vfmadd213ss xmm1, xmm2, xmm3 +vfmadd213ss xmm1, xmm2, dword [rax] +vfmadd213ss xmm1, xmm2, [rax] +vfmadd132sd xmm1, xmm2, xmm3 +vfmadd132sd xmm1, xmm2, qword [rax] +vfmadd132sd xmm1, xmm2, [rax] +vfmadd231sd xmm1, xmm2, xmm3 +vfmadd231sd xmm1, xmm2, qword [rax] +vfmadd231sd xmm1, xmm2, [rax] +vfmadd213sd xmm1, xmm2, xmm3 +vfmadd213sd xmm1, xmm2, qword [rax] +vfmadd213sd xmm1, xmm2, [rax] +vfmadd132ps xmm1, xmm2, xmm3 +vfmadd132ps xmm1, xmm2, xmm3 +vfmadd132ps xmm1, xmm2, [rax] +vfmadd231ps xmm1, xmm2, xmm3 +vfmadd231ps xmm1, xmm2, xmm3 +vfmadd231ps xmm1, xmm2, [rax] +vfmadd213ps xmm1, xmm2, xmm3 +vfmadd213ps xmm1, xmm2, xmm3 +vfmadd213ps xmm1, xmm2, [rax] +vfmadd132ps ymm1, ymm2, ymm3 +vfmadd132ps ymm1, ymm2, yword [rax] +vfmadd132ps ymm1, ymm2, [rax] +vfmadd231ps ymm1, ymm2, ymm3 +vfmadd231ps ymm1, ymm2, yword [rax] +vfmadd231ps ymm1, ymm2, [rax] +vfmadd213ps ymm1, ymm2, ymm3 +vfmadd213ps ymm1, ymm2, yword [rax] +vfmadd213ps ymm1, ymm2, [rax] +vfmadd132pd xmm1, xmm2, xmm3 +vfmadd132pd xmm1, xmm2, dqword [rax] +vfmadd132pd xmm1, xmm2, [rax] +vfmadd231pd xmm1, xmm2, xmm3 +vfmadd231pd xmm1, xmm2, dqword [rax] +vfmadd231pd xmm1, xmm2, [rax] +vfmadd213pd xmm1, xmm2, xmm3 +vfmadd213pd xmm1, xmm2, dqword [rax] +vfmadd213pd xmm1, xmm2, [rax] +vfmadd132pd ymm1, ymm2, ymm3 +vfmadd132pd ymm1, ymm2, yword [rax] +vfmadd132pd ymm1, ymm2, [rax] +vfmadd231pd ymm1, ymm2, ymm3 +vfmadd231pd ymm1, ymm2, yword [rax] +vfmadd231pd ymm1, ymm2, [rax] +vfmadd213pd ymm1, ymm2, ymm3 +vfmadd213pd ymm1, ymm2, yword [rax] +vfmadd213pd ymm1, ymm2, [rax] +vfmsub132ss xmm1, xmm2, xmm3 +vfmsub132ss xmm1, xmm2, dword [rax] +vfmsub132ss xmm1, xmm2, [rax] +vfmsub231ss xmm1, xmm2, xmm3 +vfmsub231ss xmm1, xmm2, dword [rax] +vfmsub231ss xmm1, xmm2, [rax] +vfmsub213ss xmm1, xmm2, xmm3 +vfmsub213ss xmm1, xmm2, dword [rax] +vfmsub213ss xmm1, xmm2, [rax] +vfmsub132sd xmm1, xmm2, xmm3 +vfmsub132sd xmm1, xmm2, qword [rax] +vfmsub132sd xmm1, xmm2, [rax] +vfmsub231sd xmm1, xmm2, xmm3 +vfmsub231sd xmm1, xmm2, qword [rax] +vfmsub231sd xmm1, xmm2, [rax] +vfmsub213sd xmm1, xmm2, xmm3 +vfmsub213sd xmm1, xmm2, qword [rax] +vfmsub213sd xmm1, xmm2, [rax] +vfmsub132ps xmm1, xmm2, xmm3 +vfmsub132ps xmm1, xmm2, xmm3 +vfmsub132ps xmm1, xmm2, [rax] +vfmsub231ps xmm1, xmm2, xmm3 +vfmsub231ps xmm1, xmm2, xmm3 +vfmsub231ps xmm1, xmm2, [rax] +vfmsub213ps xmm1, xmm2, xmm3 +vfmsub213ps xmm1, xmm2, xmm3 +vfmsub213ps xmm1, xmm2, [rax] +vfmsub132ps ymm1, ymm2, ymm3 +vfmsub132ps ymm1, ymm2, yword [rax] +vfmsub132ps ymm1, ymm2, [rax] +vfmsub231ps ymm1, ymm2, ymm3 +vfmsub231ps ymm1, ymm2, yword [rax] +vfmsub231ps ymm1, ymm2, [rax] +vfmsub213ps ymm1, ymm2, ymm3 +vfmsub213ps ymm1, ymm2, yword [rax] +vfmsub213ps ymm1, ymm2, [rax] +vfmsub132pd xmm1, xmm2, xmm3 +vfmsub132pd xmm1, xmm2, dqword [rax] +vfmsub132pd xmm1, xmm2, [rax] +vfmsub231pd xmm1, xmm2, xmm3 +vfmsub231pd xmm1, xmm2, dqword [rax] +vfmsub231pd xmm1, xmm2, [rax] +vfmsub213pd xmm1, xmm2, xmm3 +vfmsub213pd xmm1, xmm2, dqword [rax] +vfmsub213pd xmm1, xmm2, [rax] +vfmsub132pd ymm1, ymm2, ymm3 +vfmsub132pd ymm1, ymm2, yword [rax] +vfmsub132pd ymm1, ymm2, [rax] +vfmsub231pd ymm1, ymm2, ymm3 +vfmsub231pd ymm1, ymm2, yword [rax] +vfmsub231pd ymm1, ymm2, [rax] +vfmsub213pd ymm1, ymm2, ymm3 +vfmsub213pd ymm1, ymm2, yword [rax] +vfmsub213pd ymm1, ymm2, [rax] +vfnmadd132ss xmm1, xmm2, xmm3 +vfnmadd132ss xmm1, xmm2, dword [rax] +vfnmadd132ss xmm1, xmm2, [rax] +vfnmadd231ss xmm1, xmm2, xmm3 +vfnmadd231ss xmm1, xmm2, dword [rax] +vfnmadd231ss xmm1, xmm2, [rax] +vfnmadd213ss xmm1, xmm2, xmm3 +vfnmadd213ss xmm1, xmm2, dword [rax] +vfnmadd213ss xmm1, xmm2, [rax] +vfnmadd132sd xmm1, xmm2, xmm3 +vfnmadd132sd xmm1, xmm2, qword [rax] +vfnmadd132sd xmm1, xmm2, [rax] +vfnmadd231sd xmm1, xmm2, xmm3 +vfnmadd231sd xmm1, xmm2, qword [rax] +vfnmadd231sd xmm1, xmm2, [rax] +vfnmadd213sd xmm1, xmm2, xmm3 +vfnmadd213sd xmm1, xmm2, qword [rax] +vfnmadd213sd xmm1, xmm2, [rax] +vfnmadd132ps xmm1, xmm2, xmm3 +vfnmadd132ps xmm1, xmm2, xmm3 +vfnmadd132ps xmm1, xmm2, [rax] +vfnmadd231ps xmm1, xmm2, xmm3 +vfnmadd231ps xmm1, xmm2, xmm3 +vfnmadd231ps xmm1, xmm2, [rax] +vfnmadd213ps xmm1, xmm2, xmm3 +vfnmadd213ps xmm1, xmm2, xmm3 +vfnmadd213ps xmm1, xmm2, [rax] +vfnmadd132ps ymm1, ymm2, ymm3 +vfnmadd132ps ymm1, ymm2, yword [rax] +vfnmadd132ps ymm1, ymm2, [rax] +vfnmadd231ps ymm1, ymm2, ymm3 +vfnmadd231ps ymm1, ymm2, yword [rax] +vfnmadd231ps ymm1, ymm2, [rax] +vfnmadd213ps ymm1, ymm2, ymm3 +vfnmadd213ps ymm1, ymm2, yword [rax] +vfnmadd213ps ymm1, ymm2, [rax] +vfnmadd132pd xmm1, xmm2, xmm3 +vfnmadd132pd xmm1, xmm2, dqword [rax] +vfnmadd132pd xmm1, xmm2, [rax] +vfnmadd231pd xmm1, xmm2, xmm3 +vfnmadd231pd xmm1, xmm2, dqword [rax] +vfnmadd231pd xmm1, xmm2, [rax] +vfnmadd213pd xmm1, xmm2, xmm3 +vfnmadd213pd xmm1, xmm2, dqword [rax] +vfnmadd213pd xmm1, xmm2, [rax] +vfnmadd132pd ymm1, ymm2, ymm3 +vfnmadd132pd ymm1, ymm2, yword [rax] +vfnmadd132pd ymm1, ymm2, [rax] +vfnmadd231pd ymm1, ymm2, ymm3 +vfnmadd231pd ymm1, ymm2, yword [rax] +vfnmadd231pd ymm1, ymm2, [rax] +vfnmadd213pd ymm1, ymm2, ymm3 +vfnmadd213pd ymm1, ymm2, yword [rax] +vfnmadd213pd ymm1, ymm2, [rax] +vfnmsub132ss xmm1, xmm2, xmm3 +vfnmsub132ss xmm1, xmm2, dword [rax] +vfnmsub132ss xmm1, xmm2, [rax] +vfnmsub231ss xmm1, xmm2, xmm3 +vfnmsub231ss xmm1, xmm2, dword [rax] +vfnmsub231ss xmm1, xmm2, [rax] +vfnmsub213ss xmm1, xmm2, xmm3 +vfnmsub213ss xmm1, xmm2, dword [rax] +vfnmsub213ss xmm1, xmm2, [rax] +vfnmsub132sd xmm1, xmm2, xmm3 +vfnmsub132sd xmm1, xmm2, qword [rax] +vfnmsub132sd xmm1, xmm2, [rax] +vfnmsub231sd xmm1, xmm2, xmm3 +vfnmsub231sd xmm1, xmm2, qword [rax] +vfnmsub231sd xmm1, xmm2, [rax] +vfnmsub213sd xmm1, xmm2, xmm3 +vfnmsub213sd xmm1, xmm2, qword [rax] +vfnmsub213sd xmm1, xmm2, [rax] +vfnmsub132ps xmm1, xmm2, xmm3 +vfnmsub132ps xmm1, xmm2, xmm3 +vfnmsub132ps xmm1, xmm2, [rax] +vfnmsub231ps xmm1, xmm2, xmm3 +vfnmsub231ps xmm1, xmm2, xmm3 +vfnmsub231ps xmm1, xmm2, [rax] +vfnmsub213ps xmm1, xmm2, xmm3 +vfnmsub213ps xmm1, xmm2, xmm3 +vfnmsub213ps xmm1, xmm2, [rax] +vfnmsub132ps ymm1, ymm2, ymm3 +vfnmsub132ps ymm1, ymm2, yword [rax] +vfnmsub132ps ymm1, ymm2, [rax] +vfnmsub231ps ymm1, ymm2, ymm3 +vfnmsub231ps ymm1, ymm2, yword [rax] +vfnmsub231ps ymm1, ymm2, [rax] +vfnmsub213ps ymm1, ymm2, ymm3 +vfnmsub213ps ymm1, ymm2, yword [rax] +vfnmsub213ps ymm1, ymm2, [rax] +vfnmsub132pd xmm1, xmm2, xmm3 +vfnmsub132pd xmm1, xmm2, dqword [rax] +vfnmsub132pd xmm1, xmm2, [rax] +vfnmsub231pd xmm1, xmm2, xmm3 +vfnmsub231pd xmm1, xmm2, dqword [rax] +vfnmsub231pd xmm1, xmm2, [rax] +vfnmsub213pd xmm1, xmm2, xmm3 +vfnmsub213pd xmm1, xmm2, dqword [rax] +vfnmsub213pd xmm1, xmm2, [rax] +vfnmsub132pd ymm1, ymm2, ymm3 +vfnmsub132pd ymm1, ymm2, yword [rax] +vfnmsub132pd ymm1, ymm2, [rax] +vfnmsub231pd ymm1, ymm2, ymm3 +vfnmsub231pd ymm1, ymm2, yword [rax] +vfnmsub231pd ymm1, ymm2, [rax] +vfnmsub213pd ymm1, ymm2, ymm3 +vfnmsub213pd ymm1, ymm2, yword [rax] +vfnmsub213pd ymm1, ymm2, [rax] +vfmaddsub132ps xmm1, xmm2, xmm3 +vfmaddsub132ps xmm1, xmm2, xmm3 +vfmaddsub132ps xmm1, xmm2, [rax] +vfmaddsub231ps xmm1, xmm2, xmm3 +vfmaddsub231ps xmm1, xmm2, xmm3 +vfmaddsub231ps xmm1, xmm2, [rax] +vfmaddsub213ps xmm1, xmm2, xmm3 +vfmaddsub213ps xmm1, xmm2, xmm3 +vfmaddsub213ps xmm1, xmm2, [rax] +vfmaddsub132ps ymm1, ymm2, ymm3 +vfmaddsub132ps ymm1, ymm2, yword [rax] +vfmaddsub132ps ymm1, ymm2, [rax] +vfmaddsub231ps ymm1, ymm2, ymm3 +vfmaddsub231ps ymm1, ymm2, yword [rax] +vfmaddsub231ps ymm1, ymm2, [rax] +vfmaddsub213ps ymm1, ymm2, ymm3 +vfmaddsub213ps ymm1, ymm2, yword [rax] +vfmaddsub213ps ymm1, ymm2, [rax] +vfmaddsub132pd xmm1, xmm2, xmm3 +vfmaddsub132pd xmm1, xmm2, dqword [rax] +vfmaddsub132pd xmm1, xmm2, [rax] +vfmaddsub231pd xmm1, xmm2, xmm3 +vfmaddsub231pd xmm1, xmm2, dqword [rax] +vfmaddsub231pd xmm1, xmm2, [rax] +vfmaddsub213pd xmm1, xmm2, xmm3 +vfmaddsub213pd xmm1, xmm2, dqword [rax] +vfmaddsub213pd xmm1, xmm2, [rax] +vfmaddsub132pd ymm1, ymm2, ymm3 +vfmaddsub132pd ymm1, ymm2, yword [rax] +vfmaddsub132pd ymm1, ymm2, [rax] +vfmaddsub231pd ymm1, ymm2, ymm3 +vfmaddsub231pd ymm1, ymm2, yword [rax] +vfmaddsub231pd ymm1, ymm2, [rax] +vfmaddsub213pd ymm1, ymm2, ymm3 +vfmaddsub213pd ymm1, ymm2, yword [rax] +vfmaddsub213pd ymm1, ymm2, [rax] +vfmsubadd132ps xmm1, xmm2, xmm3 +vfmsubadd132ps xmm1, xmm2, xmm3 +vfmsubadd132ps xmm1, xmm2, [rax] +vfmsubadd231ps xmm1, xmm2, xmm3 +vfmsubadd231ps xmm1, xmm2, xmm3 +vfmsubadd231ps xmm1, xmm2, [rax] +vfmsubadd213ps xmm1, xmm2, xmm3 +vfmsubadd213ps xmm1, xmm2, xmm3 +vfmsubadd213ps xmm1, xmm2, [rax] +vfmsubadd132ps ymm1, ymm2, ymm3 +vfmsubadd132ps ymm1, ymm2, yword [rax] +vfmsubadd132ps ymm1, ymm2, [rax] +vfmsubadd231ps ymm1, ymm2, ymm3 +vfmsubadd231ps ymm1, ymm2, yword [rax] +vfmsubadd231ps ymm1, ymm2, [rax] +vfmsubadd213ps ymm1, ymm2, ymm3 +vfmsubadd213ps ymm1, ymm2, yword [rax] +vfmsubadd213ps ymm1, ymm2, [rax] +vfmsubadd132pd xmm1, xmm2, xmm3 +vfmsubadd132pd xmm1, xmm2, dqword [rax] +vfmsubadd132pd xmm1, xmm2, [rax] +vfmsubadd231pd xmm1, xmm2, xmm3 +vfmsubadd231pd xmm1, xmm2, dqword [rax] +vfmsubadd231pd xmm1, xmm2, [rax] +vfmsubadd213pd xmm1, xmm2, xmm3 +vfmsubadd213pd xmm1, xmm2, dqword [rax] +vfmsubadd213pd xmm1, xmm2, [rax] +vfmsubadd132pd ymm1, ymm2, ymm3 +vfmsubadd132pd ymm1, ymm2, yword [rax] +vfmsubadd132pd ymm1, ymm2, [rax] +vfmsubadd231pd ymm1, ymm2, ymm3 +vfmsubadd231pd ymm1, ymm2, yword [rax] +vfmsubadd231pd ymm1, ymm2, [rax] +vfmsubadd213pd ymm1, ymm2, ymm3 +vfmsubadd213pd ymm1, ymm2, yword [rax] +vfmsubadd213pd ymm1, ymm2, [rax] diff --git a/modules/arch/x86/tests/fma.hex b/modules/arch/x86/tests/fma.hex index 7f51092a..161933f9 100644 --- a/modules/arch/x86/tests/fma.hex +++ b/modules/arch/x86/tests/fma.hex @@ -1,540 +1,1440 @@ c4 -e3 -61 +e2 69 -c2 -10 +99 +cb c4 -e3 -61 +e2 69 -00 -10 +99 +08 c4 -e3 -61 +e2 69 -00 -10 +99 +08 c4 -e3 +e2 +69 +b9 +cb +c4 +e2 +69 +b9 +08 +c4 +e2 +69 +b9 +08 +c4 +e2 +69 +a9 +cb +c4 +e2 +69 +a9 +08 +c4 +e2 +69 +a9 +08 +c4 +e2 e9 -69 -00 -10 +99 +cb c4 -e3 +e2 e9 -69 -00 -10 +99 +08 c4 -e3 -65 -69 -c2 -10 -c4 -e3 -65 -69 -00 -10 -c4 -e3 -65 -69 -00 -10 -c4 -e3 -ed -69 -00 -10 -c4 -e3 -ed -69 -00 -10 -c4 -e3 -61 -68 -c2 -10 -c4 -e3 -61 -68 -00 -10 -c4 -e3 +e2 e9 -68 -00 -10 +99 +08 c4 -e3 -65 -68 -c2 -10 -c4 -e3 -65 -68 -00 -10 -c4 -e3 -ed -68 -00 -10 -c4 -e3 -61 -6b -c2 -10 -c4 -e3 -61 -6b -00 -10 -c4 -e3 -61 -6b -00 -10 -c4 -e3 +e2 e9 -6b -00 -10 +b9 +cb c4 -e3 +e2 e9 -6b -00 -10 +b9 +08 c4 -e3 -61 -6a -c2 -10 -c4 -e3 -61 -6a -00 -10 -c4 -e3 +e2 e9 -6a -00 -10 +b9 +08 c4 -e3 -61 -5d -c2 -10 -c4 -e3 -61 -5d -00 -10 -c4 -e3 +e2 e9 -5d -00 -10 +a9 +cb c4 -e3 -65 -5d -c2 -10 -c4 -e3 -65 -5d -00 -10 -c4 -e3 -ed -5d -00 -10 -c4 -e3 -61 -5c -c2 -10 -c4 -e3 -61 -5c -00 -10 -c4 -e3 +e2 e9 -5c -00 -10 +a9 +08 c4 -e3 -65 -5c -c2 -10 +e2 +e9 +a9 +08 c4 -e3 -65 -5c -00 -10 +e2 +69 +98 +cb c4 -e3 -ed -5c -00 -10 +e2 +69 +98 +cb c4 -e3 -61 +e2 +69 +98 +08 +c4 +e2 +69 +b8 +cb +c4 +e2 +69 +b8 +cb +c4 +e2 +69 +b8 +08 +c4 +e2 +69 +a8 +cb +c4 +e2 +69 +a8 +cb +c4 +e2 +69 +a8 +08 +c4 +e2 6d -c2 -10 +98 +cb c4 -e3 -61 +e2 6d -00 -10 +98 +08 c4 -e3 -e9 +e2 6d -00 -10 +98 +08 c4 -e3 -65 +e2 6d -c2 -10 +b8 +cb c4 -e3 -65 +e2 6d -00 -10 +b8 +08 c4 -e3 -ed +e2 6d -00 -10 +b8 +08 c4 -e3 -61 -6c -c2 -10 +e2 +6d +a8 +cb c4 -e3 -61 -6c -00 -10 +e2 +6d +a8 +08 c4 -e3 +e2 +6d +a8 +08 +c4 +e2 e9 -6c -00 -10 +98 +cb c4 -e3 -65 -6c -c2 -10 +e2 +e9 +98 +08 c4 -e3 -65 -6c -00 -10 +e2 +e9 +98 +08 c4 -e3 +e2 +e9 +b8 +cb +c4 +e2 +e9 +b8 +08 +c4 +e2 +e9 +b8 +08 +c4 +e2 +e9 +a8 +cb +c4 +e2 +e9 +a8 +08 +c4 +e2 +e9 +a8 +08 +c4 +e2 ed -6c -00 -10 +98 +cb c4 -e3 -61 -6f -c2 -10 -c4 -e3 -61 -6f -00 -10 -c4 -e3 -e9 -6f -00 -10 -c4 -e3 -61 -6e -c2 -10 -c4 -e3 -61 -6e -00 -10 -c4 -e3 -e9 -6e -00 -10 -c4 -e3 -61 -79 -c2 -10 -c4 -e3 -61 -79 -00 -10 -c4 -e3 -e9 -79 -00 -10 -c4 -e3 -65 -79 -c2 -10 -c4 -e3 -65 -79 -00 -10 -c4 -e3 +e2 ed -79 -00 -10 +98 +08 c4 -e3 -61 -78 -c2 -10 -c4 -e3 -61 -78 -00 -10 -c4 -e3 -e9 -78 -00 -10 -c4 -e3 -65 -78 -c2 -10 -c4 -e3 -65 -78 -00 -10 -c4 -e3 +e2 ed -78 -00 -10 +98 +08 c4 -e3 -61 -7b -c2 -10 -c4 -e3 -61 -7b -00 -10 -c4 -e3 -e9 -7b -00 -10 -c4 -e3 -61 -7a -c2 -10 -c4 -e3 -61 -7a -00 -10 -c4 -e3 -e9 -7a -00 -10 -c4 -e3 -61 -7d -c2 -10 -c4 -e3 -61 -7d -00 -10 -c4 -e3 -e9 -7d -00 -10 -c4 -e3 -65 -7d -c2 -10 -c4 -e3 -65 -7d -00 -10 -c4 -e3 +e2 ed -7d -00 -10 +b8 +cb c4 -e3 -61 -7c -c2 -10 -c4 -e3 -61 -7c -00 -10 -c4 -e3 -e9 -7c -00 -10 -c4 -e3 -65 -7c -c2 -10 -c4 -e3 -65 -7c -00 -10 -c4 -e3 +e2 ed -7c -00 -10 +b8 +08 c4 -e3 -61 -7f -c2 -10 +e2 +ed +b8 +08 c4 -e3 -61 -7f -00 -10 +e2 +ed +a8 +cb c4 -e3 +e2 +ed +a8 +08 +c4 +e2 +ed +a8 +08 +c4 +e2 +69 +9b +cb +c4 +e2 +69 +9b +08 +c4 +e2 +69 +9b +08 +c4 +e2 +69 +bb +cb +c4 +e2 +69 +bb +08 +c4 +e2 +69 +bb +08 +c4 +e2 +69 +ab +cb +c4 +e2 +69 +ab +08 +c4 +e2 +69 +ab +08 +c4 +e2 e9 -7f -00 -10 +9b +cb c4 -e3 -61 -7e -c2 -10 -c4 -e3 -61 -7e -00 -10 -c4 -e3 +e2 e9 -7e -00 -10 +9b +08 +c4 +e2 +e9 +9b +08 +c4 +e2 +e9 +bb +cb +c4 +e2 +e9 +bb +08 +c4 +e2 +e9 +bb +08 +c4 +e2 +e9 +ab +cb +c4 +e2 +e9 +ab +08 +c4 +e2 +e9 +ab +08 +c4 +e2 +69 +9a +cb +c4 +e2 +69 +9a +cb +c4 +e2 +69 +9a +08 +c4 +e2 +69 +ba +cb +c4 +e2 +69 +ba +cb +c4 +e2 +69 +ba +08 +c4 +e2 +69 +aa +cb +c4 +e2 +69 +aa +cb +c4 +e2 +69 +aa +08 +c4 +e2 +6d +9a +cb +c4 +e2 +6d +9a +08 +c4 +e2 +6d +9a +08 +c4 +e2 +6d +ba +cb +c4 +e2 +6d +ba +08 +c4 +e2 +6d +ba +08 +c4 +e2 +6d +aa +cb +c4 +e2 +6d +aa +08 +c4 +e2 +6d +aa +08 +c4 +e2 +e9 +9a +cb +c4 +e2 +e9 +9a +08 +c4 +e2 +e9 +9a +08 +c4 +e2 +e9 +ba +cb +c4 +e2 +e9 +ba +08 +c4 +e2 +e9 +ba +08 +c4 +e2 +e9 +aa +cb +c4 +e2 +e9 +aa +08 +c4 +e2 +e9 +aa +08 +c4 +e2 +ed +9a +cb +c4 +e2 +ed +9a +08 +c4 +e2 +ed +9a +08 +c4 +e2 +ed +ba +cb +c4 +e2 +ed +ba +08 +c4 +e2 +ed +ba +08 +c4 +e2 +ed +aa +cb +c4 +e2 +ed +aa +08 +c4 +e2 +ed +aa +08 +c4 +e2 +69 +9d +cb +c4 +e2 +69 +9d +08 +c4 +e2 +69 +9d +08 +c4 +e2 +69 +bd +cb +c4 +e2 +69 +bd +08 +c4 +e2 +69 +bd +08 +c4 +e2 +69 +ad +cb +c4 +e2 +69 +ad +08 +c4 +e2 +69 +ad +08 +c4 +e2 +e9 +9d +cb +c4 +e2 +e9 +9d +08 +c4 +e2 +e9 +9d +08 +c4 +e2 +e9 +bd +cb +c4 +e2 +e9 +bd +08 +c4 +e2 +e9 +bd +08 +c4 +e2 +e9 +ad +cb +c4 +e2 +e9 +ad +08 +c4 +e2 +e9 +ad +08 +c4 +e2 +69 +9c +cb +c4 +e2 +69 +9c +cb +c4 +e2 +69 +9c +08 +c4 +e2 +69 +bc +cb +c4 +e2 +69 +bc +cb +c4 +e2 +69 +bc +08 +c4 +e2 +69 +ac +cb +c4 +e2 +69 +ac +cb +c4 +e2 +69 +ac +08 +c4 +e2 +6d +9c +cb +c4 +e2 +6d +9c +08 +c4 +e2 +6d +9c +08 +c4 +e2 +6d +bc +cb +c4 +e2 +6d +bc +08 +c4 +e2 +6d +bc +08 +c4 +e2 +6d +ac +cb +c4 +e2 +6d +ac +08 +c4 +e2 +6d +ac +08 +c4 +e2 +e9 +9c +cb +c4 +e2 +e9 +9c +08 +c4 +e2 +e9 +9c +08 +c4 +e2 +e9 +bc +cb +c4 +e2 +e9 +bc +08 +c4 +e2 +e9 +bc +08 +c4 +e2 +e9 +ac +cb +c4 +e2 +e9 +ac +08 +c4 +e2 +e9 +ac +08 +c4 +e2 +ed +9c +cb +c4 +e2 +ed +9c +08 +c4 +e2 +ed +9c +08 +c4 +e2 +ed +bc +cb +c4 +e2 +ed +bc +08 +c4 +e2 +ed +bc +08 +c4 +e2 +ed +ac +cb +c4 +e2 +ed +ac +08 +c4 +e2 +ed +ac +08 +c4 +e2 +69 +9f +cb +c4 +e2 +69 +9f +08 +c4 +e2 +69 +9f +08 +c4 +e2 +69 +bf +cb +c4 +e2 +69 +bf +08 +c4 +e2 +69 +bf +08 +c4 +e2 +69 +af +cb +c4 +e2 +69 +af +08 +c4 +e2 +69 +af +08 +c4 +e2 +e9 +9f +cb +c4 +e2 +e9 +9f +08 +c4 +e2 +e9 +9f +08 +c4 +e2 +e9 +bf +cb +c4 +e2 +e9 +bf +08 +c4 +e2 +e9 +bf +08 +c4 +e2 +e9 +af +cb +c4 +e2 +e9 +af +08 +c4 +e2 +e9 +af +08 +c4 +e2 +69 +9e +cb +c4 +e2 +69 +9e +cb +c4 +e2 +69 +9e +08 +c4 +e2 +69 +be +cb +c4 +e2 +69 +be +cb +c4 +e2 +69 +be +08 +c4 +e2 +69 +ae +cb +c4 +e2 +69 +ae +cb +c4 +e2 +69 +ae +08 +c4 +e2 +6d +9e +cb +c4 +e2 +6d +9e +08 +c4 +e2 +6d +9e +08 +c4 +e2 +6d +be +cb +c4 +e2 +6d +be +08 +c4 +e2 +6d +be +08 +c4 +e2 +6d +ae +cb +c4 +e2 +6d +ae +08 +c4 +e2 +6d +ae +08 +c4 +e2 +e9 +9e +cb +c4 +e2 +e9 +9e +08 +c4 +e2 +e9 +9e +08 +c4 +e2 +e9 +be +cb +c4 +e2 +e9 +be +08 +c4 +e2 +e9 +be +08 +c4 +e2 +e9 +ae +cb +c4 +e2 +e9 +ae +08 +c4 +e2 +e9 +ae +08 +c4 +e2 +ed +9e +cb +c4 +e2 +ed +9e +08 +c4 +e2 +ed +9e +08 +c4 +e2 +ed +be +cb +c4 +e2 +ed +be +08 +c4 +e2 +ed +be +08 +c4 +e2 +ed +ae +cb +c4 +e2 +ed +ae +08 +c4 +e2 +ed +ae +08 +c4 +e2 +69 +96 +cb +c4 +e2 +69 +96 +cb +c4 +e2 +69 +96 +08 +c4 +e2 +69 +b6 +cb +c4 +e2 +69 +b6 +cb +c4 +e2 +69 +b6 +08 +c4 +e2 +69 +a6 +cb +c4 +e2 +69 +a6 +cb +c4 +e2 +69 +a6 +08 +c4 +e2 +6d +96 +cb +c4 +e2 +6d +96 +08 +c4 +e2 +6d +96 +08 +c4 +e2 +6d +b6 +cb +c4 +e2 +6d +b6 +08 +c4 +e2 +6d +b6 +08 +c4 +e2 +6d +a6 +cb +c4 +e2 +6d +a6 +08 +c4 +e2 +6d +a6 +08 +c4 +e2 +e9 +96 +cb +c4 +e2 +e9 +96 +08 +c4 +e2 +e9 +96 +08 +c4 +e2 +e9 +b6 +cb +c4 +e2 +e9 +b6 +08 +c4 +e2 +e9 +b6 +08 +c4 +e2 +e9 +a6 +cb +c4 +e2 +e9 +a6 +08 +c4 +e2 +e9 +a6 +08 +c4 +e2 +ed +96 +cb +c4 +e2 +ed +96 +08 +c4 +e2 +ed +96 +08 +c4 +e2 +ed +b6 +cb +c4 +e2 +ed +b6 +08 +c4 +e2 +ed +b6 +08 +c4 +e2 +ed +a6 +cb +c4 +e2 +ed +a6 +08 +c4 +e2 +ed +a6 +08 +c4 +e2 +69 +97 +cb +c4 +e2 +69 +97 +cb +c4 +e2 +69 +97 +08 +c4 +e2 +69 +b7 +cb +c4 +e2 +69 +b7 +cb +c4 +e2 +69 +b7 +08 +c4 +e2 +69 +a7 +cb +c4 +e2 +69 +a7 +cb +c4 +e2 +69 +a7 +08 +c4 +e2 +6d +97 +cb +c4 +e2 +6d +97 +08 +c4 +e2 +6d +97 +08 +c4 +e2 +6d +b7 +cb +c4 +e2 +6d +b7 +08 +c4 +e2 +6d +b7 +08 +c4 +e2 +6d +a7 +cb +c4 +e2 +6d +a7 +08 +c4 +e2 +6d +a7 +08 +c4 +e2 +e9 +97 +cb +c4 +e2 +e9 +97 +08 +c4 +e2 +e9 +97 +08 +c4 +e2 +e9 +b7 +cb +c4 +e2 +e9 +b7 +08 +c4 +e2 +e9 +b7 +08 +c4 +e2 +e9 +a7 +cb +c4 +e2 +e9 +a7 +08 +c4 +e2 +e9 +a7 +08 +c4 +e2 +ed +97 +cb +c4 +e2 +ed +97 +08 +c4 +e2 +ed +97 +08 +c4 +e2 +ed +b7 +cb +c4 +e2 +ed +b7 +08 +c4 +e2 +ed +b7 +08 +c4 +e2 +ed +a7 +cb +c4 +e2 +ed +a7 +08 +c4 +e2 +ed +a7 +08 diff --git a/modules/arch/x86/tests/vpermil2.asm b/modules/arch/x86/tests/vpermil2.asm deleted file mode 100644 index cc774c1b..00000000 --- a/modules/arch/x86/tests/vpermil2.asm +++ /dev/null @@ -1,10 +0,0 @@ -[bits 64] -vpermiltd2pd xmm1, xmm2, xmm3, xmm4 ; 0 -;vpermiltd2pd xmm1, xmm2, xmm3, xmm4 ; 1 -vpermilmo2pd xmm1, xmm2, xmm3, xmm4 ; 2 -vpermilmz2pd xmm1, xmm2, xmm3, xmm4 ; 3 - -vpermiltd2ps xmm1, xmm2, xmm3, xmm4 ; 0 -;vpermiltd2ps xmm1, xmm2, xmm3, xmm4 ; 1 -vpermilmo2ps xmm1, xmm2, xmm3, xmm4 ; 2 -vpermilmz2ps xmm1, xmm2, xmm3, xmm4 ; 3 diff --git a/modules/arch/x86/tests/vpermil2.hex b/modules/arch/x86/tests/vpermil2.hex deleted file mode 100644 index 29d1af0a..00000000 --- a/modules/arch/x86/tests/vpermil2.hex +++ /dev/null @@ -1,36 +0,0 @@ -c4 -e3 -69 -49 -cb -40 -c4 -e3 -69 -49 -cb -42 -c4 -e3 -69 -49 -cb -43 -c4 -e3 -69 -48 -cb -40 -c4 -e3 -69 -48 -cb -42 -c4 -e3 -69 -48 -cb -43 From b1710263e90ee44e7dfb3969fa90e844a8dfd749 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 14 Jan 2009 08:34:22 +0000 Subject: [PATCH 248/585] Add file missed in previous commit. Contributed by: Mark Charney, Intel Corporation svn path=/trunk/yasm/; revision=2171 --- modules/arch/x86/tests/gen-fma-test.py | 63 ++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100755 modules/arch/x86/tests/gen-fma-test.py diff --git a/modules/arch/x86/tests/gen-fma-test.py b/modules/arch/x86/tests/gen-fma-test.py new file mode 100755 index 00000000..a8f4e025 --- /dev/null +++ b/modules/arch/x86/tests/gen-fma-test.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python + +def emit(opcode,suffix,width,order,optype): + d = {} + d['opcode']=opcode + d['suffix']=suffix + d['order']=order + if width == 128: + d['op1']= 'xmm1' + d['op2']= 'xmm2' + d['op3']= 'xmm3' + if optype == 'rrr': + d['op3']= 'xmm3' + elif suffix == 'pd': + d['op3']= 'dqword [rax]' + elif suffix == 'sd': + d['op3']= 'qword [rax]' + elif suffix == 'ss': + d['op3']= 'dword [rax]' + else: + d['op1']= 'ymm1' + d['op2']= 'ymm2' + if optype == 'rrr': + d['op3']= 'ymm3' + else: + d['op3']= 'yword [rax]' + + + print "v%(opcode)s%(order)s%(suffix)s %(op1)s, %(op2)s, %(op3)s" % (d) + if optype == 'rrm': + d['op3']= '[rax]' + print "v%(opcode)s%(order)s%(suffix)s %(op1)s, %(op2)s, %(op3)s" % (d) + +def gen(opcodes, combos, optypes, orders): + for opcode in opcodes: + for (suffix,width) in combos: + for order in orders: + for optype in optypes: + emit(opcode,suffix,width,order,optype) + + +if __name__ == '__main__': + orders = ['132', '231', '213'] + + all_combos = [('ss',128), + ('sd',128), + ('ps',128), + ('ps',256), + ('pd',128), + ('pd',256) ] + packed_combos = [ ('ps',128), + ('ps',256), + ('pd',128), + ('pd',256) ] + + opcodes1 = ['fmadd', 'fmsub', 'fnmadd', 'fnmsub'] + opcodes2 = ['fmaddsub', 'fmsubadd'] + + optypes = ['rrr','rrm'] + + print "[bits 64]" + gen(opcodes1, all_combos,optypes, orders) + gen(opcodes2, packed_combos,optypes, orders) From b6c9134ac7d0746a2c86f44f3ae4ab065f413ae1 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 27 Jan 2009 06:38:14 +0000 Subject: [PATCH 249/585] Fix #166: Off-by-one error in raw preproc caused hang on lines longer than 512 characters. svn path=/trunk/yasm/; revision=2172 --- modules/preprocs/raw/Makefile.inc | 4 ++++ modules/preprocs/raw/raw-preproc.c | 2 +- modules/preprocs/raw/tests/Makefile.inc | 7 +++++++ modules/preprocs/raw/tests/longline.asm | 1 + modules/preprocs/raw/tests/longline.hex | 0 modules/preprocs/raw/tests/rawpp_test.sh | 4 ++++ 6 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 modules/preprocs/raw/tests/Makefile.inc create mode 100644 modules/preprocs/raw/tests/longline.asm create mode 100644 modules/preprocs/raw/tests/longline.hex create mode 100755 modules/preprocs/raw/tests/rawpp_test.sh diff --git a/modules/preprocs/raw/Makefile.inc b/modules/preprocs/raw/Makefile.inc index ad3ae673..aff8353d 100644 --- a/modules/preprocs/raw/Makefile.inc +++ b/modules/preprocs/raw/Makefile.inc @@ -3,3 +3,7 @@ libyasm_a_SOURCES += modules/preprocs/raw/raw-preproc.c YASM_MODULES += preproc_raw + +EXTRA_DIST += modules/preprocs/raw/tests/Makefile.inc + +include modules/preprocs/raw/tests/Makefile.inc diff --git a/modules/preprocs/raw/raw-preproc.c b/modules/preprocs/raw/raw-preproc.c index 463ceaa1..a441ad47 100644 --- a/modules/preprocs/raw/raw-preproc.c +++ b/modules/preprocs/raw/raw-preproc.c @@ -94,7 +94,7 @@ raw_preproc_get_line(yasm_preproc *preproc) p += strlen(p); if (p > buf && p[-1] == '\n') break; - if ((p-buf) >= bufsize) { + if ((p-buf)+1 >= bufsize) { /* Increase size of buffer */ char *oldbuf = buf; bufsize *= 2; diff --git a/modules/preprocs/raw/tests/Makefile.inc b/modules/preprocs/raw/tests/Makefile.inc new file mode 100644 index 00000000..19b2792b --- /dev/null +++ b/modules/preprocs/raw/tests/Makefile.inc @@ -0,0 +1,7 @@ +# $Id$ + +TESTS += modules/preprocs/raw/tests/rawpp_test.sh + +EXTRA_DIST += modules/preprocs/nasm/tests/rawpp_test.sh +EXTRA_DIST += modules/preprocs/nasm/tests/longline.asm +EXTRA_DIST += modules/preprocs/nasm/tests/longline.hex diff --git a/modules/preprocs/raw/tests/longline.asm b/modules/preprocs/raw/tests/longline.asm new file mode 100644 index 00000000..2d5931a1 --- /dev/null +++ b/modules/preprocs/raw/tests/longline.asm @@ -0,0 +1 @@ +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: diff --git a/modules/preprocs/raw/tests/longline.hex b/modules/preprocs/raw/tests/longline.hex new file mode 100644 index 00000000..e69de29b diff --git a/modules/preprocs/raw/tests/rawpp_test.sh b/modules/preprocs/raw/tests/rawpp_test.sh new file mode 100755 index 00000000..d57a529b --- /dev/null +++ b/modules/preprocs/raw/tests/rawpp_test.sh @@ -0,0 +1,4 @@ +#! /bin/sh +# $Id$ +${srcdir}/out_test.sh rawpp_test modules/preprocs/raw/tests "raw preproc" "-f bin -r raw" "" +exit $? From cd680341453bcc8189d033a52a724cce29ccea5c Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Mon, 2 Feb 2009 08:20:12 +0000 Subject: [PATCH 250/585] Add support for VEX-encoded pclmul*qdq instructions per the latest AVX spec. To stay consist with handling of other VEX instructions, also add yasm extensions to support combining the first two operands for direct translation from non-VEX to VEX-encoded by simply adding a "v" prefix to the opcode. Contributed by: Mark Charney, Intel Corporation Yasm extensions by: Peter Johnson svn path=/trunk/yasm/; revision=2173 --- modules/arch/x86/gen_x86_insn.py | 41 +++++++++-- modules/arch/x86/tests/clmul.asm | 20 ++++++ modules/arch/x86/tests/clmul.hex | 120 +++++++++++++++++++++++++++++++ 3 files changed, 175 insertions(+), 6 deletions(-) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index 60f27eb4..271d3ffa 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -6462,20 +6462,49 @@ add_insn("vaeskeygenassist", "aes_imm", modifiers=[0x3A, 0xDF, VEXL0], # Intel PCLMULQDQ instruction ##################################################################### -add_insn("pclmulqdq", "aes_imm", modifiers=[0x3A, 0x44], cpu=["CLMUL"]) +add_group("pclmulqdq", + cpu=["CLMUL"], + modifiers=["Op1Add", "Op2Add", "SetVEX"], + prefix=0x66, + opcode=[0x0F, 0x00, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("pclmulqdq", + cpu=["CLMUL", "AVX"], + modifiers=["Op1Add", "Op2Add"], + vex=128, + prefix=0x66, + opcode=[0x0F, 0x00, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + +add_insn("pclmulqdq", "pclmulqdq", modifiers=[0x3A, 0x44]) +add_insn("vpclmulqdq", "pclmulqdq", modifiers=[0x3A, 0x44, VEXL0], avx=True) add_group("pclmulqdq_fixed", cpu=["CLMUL"], + modifiers=["Imm8", "SetVEX"], + prefix=0x66, + opcode=[0x0F, 0x3A, 0x44], + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) +add_group("pclmulqdq_fixed", + cpu=["CLMUL", "AVX"], modifiers=["Imm8"], + vex=128, prefix=0x66, opcode=[0x0F, 0x3A, 0x44], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) -add_insn("pclmullqlqdq", "pclmulqdq_fixed", modifiers=[0x00]) -add_insn("pclmulhqlqdq", "pclmulqdq_fixed", modifiers=[0x01]) -add_insn("pclmullqhqdq", "pclmulqdq_fixed", modifiers=[0x10]) -add_insn("pclmulhqhqdq", "pclmulqdq_fixed", modifiers=[0x11]) +for comb, combval in zip(["lql","hql","lqh","hqh"], [0x00,0x01,0x10,0x11]): + add_insn("pclmul"+comb+"qdq", "pclmulqdq_fixed", modifiers=[combval]) + add_insn("vpclmul"+comb+"qdq", "pclmulqdq_fixed", + modifiers=[combval, VEXL0], avx=True) ##################################################################### # AMD SSE4a instructions diff --git a/modules/arch/x86/tests/clmul.asm b/modules/arch/x86/tests/clmul.asm index 053bc449..92e168ef 100644 --- a/modules/arch/x86/tests/clmul.asm +++ b/modules/arch/x86/tests/clmul.asm @@ -3,20 +3,40 @@ pclmulqdq xmm1, xmm2, 5 pclmulqdq xmm1, [rax], byte 5 pclmulqdq xmm1, dqword [rax], 5 +vpclmulqdq xmm1, xmm2, 0x10 +vpclmulqdq xmm1, dqword [rbx], 0x10 +vpclmulqdq xmm0, xmm1, xmm2, 0x10 +vpclmulqdq xmm0, xmm1, dqword [rbx], 0x10 pclmullqlqdq xmm1, xmm2 pclmullqlqdq xmm1, [rax] pclmullqlqdq xmm1, dqword [rax] +vpclmullqlqdq xmm1, xmm2 +vpclmullqlqdq xmm1, dqword[rbx] +vpclmullqlqdq xmm0, xmm1, xmm2 +vpclmullqlqdq xmm0, xmm1, dqword[rbx] pclmulhqlqdq xmm1, xmm2 pclmulhqlqdq xmm1, [rax] pclmulhqlqdq xmm1, dqword [rax] +vpclmulhqlqdq xmm1, xmm2 +vpclmulhqlqdq xmm1, dqword[rbx] +vpclmulhqlqdq xmm0, xmm1, xmm2 +vpclmulhqlqdq xmm0, xmm1, dqword[rbx] pclmullqhqdq xmm1, xmm2 pclmullqhqdq xmm1, [rax] pclmullqhqdq xmm1, dqword [rax] +vpclmullqhqdq xmm1, xmm2 +vpclmullqhqdq xmm1, dqword[rbx] +vpclmullqhqdq xmm0, xmm1, xmm2 +vpclmullqhqdq xmm0, xmm1, dqword[rbx] pclmulhqhqdq xmm1, xmm2 pclmulhqhqdq xmm1, [rax] pclmulhqhqdq xmm1, dqword [rax] +vpclmulhqhqdq xmm1, xmm2 +vpclmulhqhqdq xmm1, dqword[rbx] +vpclmulhqhqdq xmm0, xmm1, xmm2 +vpclmulhqhqdq xmm0, xmm1, dqword[rbx] diff --git a/modules/arch/x86/tests/clmul.hex b/modules/arch/x86/tests/clmul.hex index cd7a0242..6aad748a 100644 --- a/modules/arch/x86/tests/clmul.hex +++ b/modules/arch/x86/tests/clmul.hex @@ -16,6 +16,30 @@ ca 44 08 05 +c4 +e3 +71 +44 +ca +10 +c4 +e3 +71 +44 +0b +10 +c4 +e3 +71 +44 +c2 +10 +c4 +e3 +71 +44 +03 +10 66 0f 3a @@ -34,6 +58,30 @@ ca 44 08 00 +c4 +e3 +71 +44 +ca +00 +c4 +e3 +71 +44 +0b +00 +c4 +e3 +71 +44 +c2 +00 +c4 +e3 +71 +44 +03 +00 66 0f 3a @@ -52,6 +100,30 @@ ca 44 08 01 +c4 +e3 +71 +44 +ca +01 +c4 +e3 +71 +44 +0b +01 +c4 +e3 +71 +44 +c2 +01 +c4 +e3 +71 +44 +03 +01 66 0f 3a @@ -70,6 +142,30 @@ ca 44 08 10 +c4 +e3 +71 +44 +ca +10 +c4 +e3 +71 +44 +0b +10 +c4 +e3 +71 +44 +c2 +10 +c4 +e3 +71 +44 +03 +10 66 0f 3a @@ -88,3 +184,27 @@ ca 44 08 11 +c4 +e3 +71 +44 +ca +11 +c4 +e3 +71 +44 +0b +11 +c4 +e3 +71 +44 +c2 +11 +c4 +e3 +71 +44 +03 +11 From 0c544ecff1aab0dfed911be9ef828ce601909e9d Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Wed, 25 Feb 2009 18:33:05 +0000 Subject: [PATCH 251/585] rename tasm for VC++ svn path=/trunk/yasm/; revision=2174 --- Mkfiles/vc9/tasm.vcproj | 410 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 410 insertions(+) create mode 100644 Mkfiles/vc9/tasm.vcproj diff --git a/Mkfiles/vc9/tasm.vcproj b/Mkfiles/vc9/tasm.vcproj new file mode 100644 index 00000000..bb4c417b --- /dev/null +++ b/Mkfiles/vc9/tasm.vcproj @@ -0,0 +1,410 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 963ded10cd5da0d0703437837807ffb4a5e7c12c Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Thu, 26 Feb 2009 09:58:33 +0000 Subject: [PATCH 252/585] Tidy up VC++ project names for ytasm svn path=/trunk/yasm/; revision=2175 --- Mkfiles/vc9/yasm.sln | 18 +- Mkfiles/vc9/ytasm.vcproj | 410 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 419 insertions(+), 9 deletions(-) create mode 100644 Mkfiles/vc9/ytasm.vcproj diff --git a/Mkfiles/vc9/yasm.sln b/Mkfiles/vc9/yasm.sln index 0fc830fd..f532e1c4 100644 --- a/Mkfiles/vc9/yasm.sln +++ b/Mkfiles/vc9/yasm.sln @@ -41,7 +41,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genmodule", "genmodule\genm EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genstring", "genstring\genstring.vcproj", "{021CEB0A-F721-4F59-B349-9CEEAF244459}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tasm", "tasm.vcproj", "{A9E67688-7E5B-41D2-9C90-7ED14EF37E1E}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ytasm", "ytasm.vcproj", "{2162937B-0DBD-4450-B45F-DF578D8E7508}" ProjectSection(ProjectDependencies) = postProject {29FE7874-1256-4AD6-B889-68E399DC9608} = {29FE7874-1256-4AD6-B889-68E399DC9608} {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6} = {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6} @@ -127,14 +127,14 @@ Global {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|Win32.Build.0 = Release|Win32 {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|x64.ActiveCfg = Release|Win32 {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|x64.Build.0 = Release|Win32 - {A9E67688-7E5B-41D2-9C90-7ED14EF37E1E}.Debug|Win32.ActiveCfg = Debug|Win32 - {A9E67688-7E5B-41D2-9C90-7ED14EF37E1E}.Debug|Win32.Build.0 = Debug|Win32 - {A9E67688-7E5B-41D2-9C90-7ED14EF37E1E}.Debug|x64.ActiveCfg = Debug|x64 - {A9E67688-7E5B-41D2-9C90-7ED14EF37E1E}.Debug|x64.Build.0 = Debug|x64 - {A9E67688-7E5B-41D2-9C90-7ED14EF37E1E}.Release|Win32.ActiveCfg = Release|Win32 - {A9E67688-7E5B-41D2-9C90-7ED14EF37E1E}.Release|Win32.Build.0 = Release|Win32 - {A9E67688-7E5B-41D2-9C90-7ED14EF37E1E}.Release|x64.ActiveCfg = Release|x64 - {A9E67688-7E5B-41D2-9C90-7ED14EF37E1E}.Release|x64.Build.0 = Release|x64 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|Win32.ActiveCfg = Debug|Win32 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|Win32.Build.0 = Debug|Win32 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|x64.ActiveCfg = Debug|x64 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|x64.Build.0 = Debug|x64 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|Win32.ActiveCfg = Release|Win32 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|Win32.Build.0 = Release|Win32 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|x64.ActiveCfg = Release|x64 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Mkfiles/vc9/ytasm.vcproj b/Mkfiles/vc9/ytasm.vcproj new file mode 100644 index 00000000..b638a40f --- /dev/null +++ b/Mkfiles/vc9/ytasm.vcproj @@ -0,0 +1,410 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 92f63a58c715f0498b6754c70916e5353331c29b Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 4 Mar 2009 07:39:02 +0000 Subject: [PATCH 253/585] Unbreak snapshots (broken in [2172]). Noticed by: Mark Charney svn path=/trunk/yasm/; revision=2176 --- modules/preprocs/raw/tests/Makefile.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/preprocs/raw/tests/Makefile.inc b/modules/preprocs/raw/tests/Makefile.inc index 19b2792b..bfb35cab 100644 --- a/modules/preprocs/raw/tests/Makefile.inc +++ b/modules/preprocs/raw/tests/Makefile.inc @@ -2,6 +2,6 @@ TESTS += modules/preprocs/raw/tests/rawpp_test.sh -EXTRA_DIST += modules/preprocs/nasm/tests/rawpp_test.sh -EXTRA_DIST += modules/preprocs/nasm/tests/longline.asm -EXTRA_DIST += modules/preprocs/nasm/tests/longline.hex +EXTRA_DIST += modules/preprocs/raw/tests/rawpp_test.sh +EXTRA_DIST += modules/preprocs/raw/tests/longline.asm +EXTRA_DIST += modules/preprocs/raw/tests/longline.hex From ccac72fdb3056079e302515f3cc0c5d2e11cc639 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 4 Mar 2009 07:41:59 +0000 Subject: [PATCH 254/585] Remove renamed tasm.vcproj (as of [2175] it is ytasm.vcproj). Add to distribution files. svn path=/trunk/yasm/; revision=2177 --- Makefile.am | 1 + Mkfiles/vc9/tasm.vcproj | 410 ---------------------------------------- 2 files changed, 1 insertion(+), 410 deletions(-) delete mode 100644 Mkfiles/vc9/tasm.vcproj diff --git a/Makefile.am b/Makefile.am index 8d6f3ada..5252b416 100644 --- a/Makefile.am +++ b/Makefile.am @@ -104,6 +104,7 @@ EXTRA_DIST += Mkfiles/vc8/genperf/run.bat EXTRA_DIST += Mkfiles/vc9/crt_secure_no_deprecate.vsprops EXTRA_DIST += Mkfiles/vc9/yasm.sln EXTRA_DIST += Mkfiles/vc9/yasm.vcproj +EXTRA_DIST += Mkfiles/vc9/ytasm.vcproj EXTRA_DIST += Mkfiles/vc9/config.h EXTRA_DIST += Mkfiles/vc9/libyasm-stdint.h EXTRA_DIST += Mkfiles/vc9/readme.vc9.txt diff --git a/Mkfiles/vc9/tasm.vcproj b/Mkfiles/vc9/tasm.vcproj deleted file mode 100644 index bb4c417b..00000000 --- a/Mkfiles/vc9/tasm.vcproj +++ /dev/null @@ -1,410 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From b39e06bc945a24cbcd6db12871817fa63e8277f5 Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Fri, 6 Mar 2009 09:18:56 +0000 Subject: [PATCH 255/585] Update yasm.rules file for VC++ svn path=/trunk/yasm/; revision=2178 --- Mkfiles/vc9/yasm.rules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Mkfiles/vc9/yasm.rules b/Mkfiles/vc9/yasm.rules index f2e2eccc..6e1fa6ea 100644 --- a/Mkfiles/vc9/yasm.rules +++ b/Mkfiles/vc9/yasm.rules @@ -28,7 +28,7 @@ DisplayName="Include Paths" Category="Configuration" Description="Set the paths for any additional include files" - Switch="-i "[value]"" + Switch="-I "[value]"" Delimited="true" Inheritable="true" /> @@ -37,7 +37,7 @@ DisplayName="Remove Definitions" Category="Pre-Defined Symbols" Description="Remove pre-defined symbols " - Switch="-u [value]" + Switch="-U [value]" Delimited="true" Inheritable="true" /> From 1bdcac64ad69f96b4c1a5bdeee9f78a6400ae13f Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Wed, 18 Mar 2009 19:57:37 +0000 Subject: [PATCH 256/585] Add (but don't enable) AMD K10 alignment padding data svn path=/trunk/yasm/; revision=2179 --- modules/arch/x86/x86arch.c | 40 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/modules/arch/x86/x86arch.c b/modules/arch/x86/x86arch.c index 1b272f4b..651fc426 100644 --- a/modules/arch/x86/x86arch.c +++ b/modules/arch/x86/x86arch.c @@ -333,6 +333,8 @@ x86_get_fill(const yasm_arch *arch) "\x90", /* 1 - nop */ (const unsigned char *) "\x66\x90", /* 2 - o16; nop */ +#if 1 + /* recommmended padding for AMD K8 processors */ (const unsigned char *) "\x66\x66\x90", /* 3 - o16; o16; nop */ (const unsigned char *) @@ -367,6 +369,44 @@ x86_get_fill(const yasm_arch *arch) (const unsigned char *) "\x66\x66\x66\x90\x66\x66\x66" /* 15 */ "\x90\x66\x66\x66\x90\x66\x66\x90" +#else + /* from Software Optimisation Guide for AMD Family 10h */ + /* Processors 40546 revision 3.10 February 2009 */ + (const unsigned char *) + "\x0f\x1f\x00", /* 3 */ + (const unsigned char *) + "\x0f\x1f\x40\x00", /* 4 */ + (const unsigned char *) + "\x0f\x1f\x44\x00\x00", /* 5 */ + (const unsigned char *) + "\x66\x0f\x1f\x44\x00\x00", /* 6 */ + (const unsigned char *) + "\x0f\x1f\x80\x00\x00\x00\x00", /* 7 */ + (const unsigned char *) + "\x0f\x1f\x84\x00\x00\x00\x00" /* 8 */ + "\x00", + (const unsigned char *) + "\x66\x0f\x1f\x84\x00\x00\x00" /* 9 */ + "\x00\x00", + (const unsigned char *) + "\x66\x2e\x0f\x1f\x84\x00\x00" /* 10 */ + "\x00\x00\x00", + (const unsigned char *) + "\x0f\x1f\x44\x00\x00\x66\x0f" /* 11 */ + "\x1f\x44\x00\x00", + (const unsigned char *) + "\x66\x0f\x1f\x44\x00\x00\x66" /* 12 */ + "\x0f\x1f\x44\x00\x00", + (const unsigned char *) + "\x66\x0f\x1f\x44\x00\x00\x0f" /* 13 */ + "\x1f\x80\x00\x00\x00\x00", + (const unsigned char *) + "\x0f\x1f\x80\x00\x00\x00\x00" /* 14 */ + "\x0f\x1f\x80\x00\x00\x00\x00", + (const unsigned char *) + "\x0f\x1f\x80\x00\x00\x00\x00" /* 15 */ + "\x0f\x1f\x84\x00\x00\x00\x00\x00" +#endif }; switch (arch_x86->mode_bits) { case 16: From b22c1896f7e3319dc4a2c2c1d0d6464e98c899e0 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 20 Mar 2009 05:24:16 +0000 Subject: [PATCH 257/585] Use arrays instead of strings to store NOP fill. svn path=/trunk/yasm/; revision=2180 --- modules/arch/x86/x86arch.c | 385 ++++++++++++++++++++----------------- 1 file changed, 204 insertions(+), 181 deletions(-) diff --git a/modules/arch/x86/x86arch.c b/modules/arch/x86/x86arch.c index 651fc426..f2344063 100644 --- a/modules/arch/x86/x86arch.c +++ b/modules/arch/x86/x86arch.c @@ -218,196 +218,219 @@ x86_get_fill(const yasm_arch *arch) const yasm_arch_x86 *arch_x86 = (const yasm_arch_x86 *)arch; /* Fill patterns that GAS uses. */ - static const unsigned char *fill16[16] = { - NULL, /* unused */ - (const unsigned char *) - "\x90", /* 1 - nop */ - (const unsigned char *) - "\x89\xf6", /* 2 - mov si, si */ - (const unsigned char *) - "\x8d\x74\x00", /* 3 - lea si, [si+byte 0] */ - (const unsigned char *) - "\x8d\xb4\x00\x00", /* 4 - lea si, [si+word 0] */ - (const unsigned char *) - "\x90" /* 5 - nop */ - "\x8d\xb4\x00\x00", /* lea si, [si+word 0] */ - (const unsigned char *) - "\x89\xf6" /* 6 - mov si, si */ - "\x8d\xbd\x00\x00", /* lea di, [di+word 0] */ - (const unsigned char *) - "\x8d\x74\x00" /* 7 - lea si, [si+byte 0] */ - "\x8d\xbd\x00\x00", /* lea di, [di+word 0] */ - (const unsigned char *) - "\x8d\xb4\x00\x00" /* 8 - lea si, [si+word 0] */ - "\x8d\xbd\x00\x00", /* lea di, [di+word 0] */ - (const unsigned char *) - "\xeb\x07\x90\x90\x90\x90\x90" /* 9 - jmp $+9; nop fill */ - "\x90\x90", - (const unsigned char *) - "\xeb\x08\x90\x90\x90\x90\x90" /* 10 - jmp $+10; nop fill */ - "\x90\x90\x90", - (const unsigned char *) - "\xeb\x09\x90\x90\x90\x90\x90" /* 11 - jmp $+11; nop fill */ - "\x90\x90\x90\x90", - (const unsigned char *) - "\xeb\x0a\x90\x90\x90\x90\x90" /* 12 - jmp $+12; nop fill */ - "\x90\x90\x90\x90\x90", - (const unsigned char *) - "\xeb\x0b\x90\x90\x90\x90\x90" /* 13 - jmp $+13; nop fill */ - "\x90\x90\x90\x90\x90\x90", - (const unsigned char *) - "\xeb\x0c\x90\x90\x90\x90\x90" /* 14 - jmp $+14; nop fill */ - "\x90\x90\x90\x90\x90\x90\x90", - (const unsigned char *) - "\xeb\x0d\x90\x90\x90\x90\x90" /* 15 - jmp $+15; nop fill */ - "\x90\x90\x90\x90\x90\x90\x90\x90" + static const unsigned char fill16_1[1] = + {0x90}; /* 1 - nop */ + static const unsigned char fill16_2[2] = + {0x89, 0xf6}; /* 2 - mov si, si */ + static const unsigned char fill16_3[3] = + {0x8d, 0x74, 0x00}; /* 3 - lea si, [si+byte 0] */ + static const unsigned char fill16_4[4] = + {0x8d, 0xb4, 0x00, 0x00}; /* 4 - lea si, [si+word 0] */ + static const unsigned char fill16_5[5] = + {0x90, /* 5 - nop */ + 0x8d, 0xb4, 0x00, 0x00}; /* lea si, [si+word 0] */ + static const unsigned char fill16_6[6] = + {0x89, 0xf6, /* 6 - mov si, si */ + 0x8d, 0xbd, 0x00, 0x00}; /* lea di, [di+word 0] */ + static const unsigned char fill16_7[7] = + {0x8d, 0x74, 0x00, /* 7 - lea si, [si+byte 0] */ + 0x8d, 0xbd, 0x00, 0x00}; /* lea di, [di+word 0] */ + static const unsigned char fill16_8[8] = + {0x8d, 0xb4, 0x00, 0x00, /* 8 - lea si, [si+word 0] */ + 0x8d, 0xbd, 0x00, 0x00}; /* lea di, [di+word 0] */ + static const unsigned char fill16_9[9] = + {0xeb, 0x07, 0x90, 0x90, 0x90, 0x90, /* 9 - jmp $+9; nop fill */ + 0x90, 0x90, 0x90}; + static const unsigned char fill16_10[10] = + {0xeb, 0x08, 0x90, 0x90, 0x90, 0x90, /* 10 - jmp $+10; nop fill */ + 0x90, 0x90, 0x90, 0x90}; + static const unsigned char fill16_11[11] = + {0xeb, 0x09, 0x90, 0x90, 0x90, 0x90, /* 11 - jmp $+11; nop fill */ + 0x90, 0x90, 0x90, 0x90, 0x90}; + static const unsigned char fill16_12[12] = + {0xeb, 0x0a, 0x90, 0x90, 0x90, 0x90, /* 12 - jmp $+12; nop fill */ + 0x90, 0x90, 0x90, 0x90, 0x90, 0x90}; + static const unsigned char fill16_13[13] = + {0xeb, 0x0b, 0x90, 0x90, 0x90, 0x90, /* 13 - jmp $+13; nop fill */ + 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90}; + static const unsigned char fill16_14[14] = + {0xeb, 0x0c, 0x90, 0x90, 0x90, 0x90, /* 14 - jmp $+14; nop fill */ + 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90}; + static const unsigned char fill16_15[15] = + {0xeb, 0x0d, 0x90, 0x90, 0x90, 0x90, /* 15 - jmp $+15; nop fill */ + 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90}; + static const unsigned char *fill16[16] = + { + NULL, fill16_1, fill16_2, fill16_3, + fill16_4, fill16_5, fill16_6, fill16_7, + fill16_8, fill16_9, fill16_10, fill16_11, + fill16_12, fill16_13, fill16_14, fill16_15 }; - static const unsigned char *fill32[16] = { - NULL, /* unused */ - (const unsigned char *) - "\x90", /* 1 - nop */ - (const unsigned char *) - "\x89\xf6", /* 2 - mov esi, esi */ - (const unsigned char *) - "\x8d\x76\x00", /* 3 - lea esi, [esi+byte 0] */ - (const unsigned char *) - "\x8d\x74\x26\x00", /* 4 - lea esi, [esi*1+byte 0] */ - (const unsigned char *) - "\x90" /* 5 - nop */ - "\x8d\x74\x26\x00", /* lea esi, [esi*1+byte 0] */ - (const unsigned char *) - "\x8d\xb6\x00\x00\x00\x00", /* 6 - lea esi, [esi+dword 0] */ - (const unsigned char *) - "\x8d\xb4\x26\x00\x00\x00\x00", /* 7 - lea esi, [esi*1+dword 0] */ - (const unsigned char *) - "\x90" /* 8 - nop */ - "\x8d\xb4\x26\x00\x00\x00\x00", /* lea esi, [esi*1+dword 0] */ + + static const unsigned char fill32_1[1] = + {0x90}; /* 1 - nop */ + static const unsigned char fill32_2[2] = + {0x89, 0xf6}; /* 2 - mov esi, esi */ + static const unsigned char fill32_3[3] = + {0x8d, 0x76, 0x00}; /* 3 - lea esi, [esi+byte 0] */ + static const unsigned char fill32_4[4] = + {0x8d, 0x74, 0x26, 0x00}; /* 4 - lea esi, [esi*1+byte 0] */ + static const unsigned char fill32_5[5] = + {0x90, /* 5 - nop */ + 0x8d, 0x74, 0x26, 0x00}; /* lea esi, [esi*1+byte 0] */ + static const unsigned char fill32_6[6] = + {0x8d, 0xb6, 0x00, 0x00, 0x00, 0x00};/* 6 - lea esi, [esi+dword 0] */ + static const unsigned char fill32_7[7] = + {0x8d, 0xb4, 0x26, 0x00, 0x00, 0x00, /* 7 - lea esi, [esi*1+dword 0] */ + 0x00}; + static const unsigned char fill32_8[8] = + {0x90, /* 8 - nop */ + 0x8d, 0xb4, 0x26, 0x00, 0x00, 0x00, /* lea esi, [esi*1+dword 0] */ + 0x00}; #if 0 - /* GAS uses these */ - (const unsigned char *) - "\x89\xf6" /* 9 - mov esi, esi */ - "\x8d\xbc\x27\x00\x00\x00\x00", /* lea edi, [edi*1+dword 0] */ - (const unsigned char *) - "\x8d\x76\x00" /* 10 - lea esi, [esi+byte 0] */ - "\x8d\xbc\x27\x00\x00\x00\x00", /* lea edi, [edi+dword 0] */ - (const unsigned char *) - "\x8d\x74\x26\x00" /* 11 - lea esi, [esi*1+byte 0] */ - "\x8d\xbc\x27\x00\x00\x00\x00", /* lea edi, [edi*1+dword 0]*/ - (const unsigned char *) - "\x8d\xb6\x00\x00\x00\x00" /* 12 - lea esi, [esi+dword 0] */ - "\x8d\xbf\x00\x00\x00\x00", /* lea edi, [edi+dword 0] */ - (const unsigned char *) - "\x8d\xb6\x00\x00\x00\x00" /* 13 - lea esi, [esi+dword 0] */ - "\x8d\xbc\x27\x00\x00\x00\x00", /* lea edi, [edi*1+dword 0]*/ - (const unsigned char *) - "\x8d\xb4\x26\x00\x00\x00\x00" /* 14 - lea esi, [esi*1+dword 0]*/ - "\x8d\xbc\x27\x00\x00\x00\x00", /* lea edi, [edi*1+dword 0]*/ + /* GAS uses these */ + static const unsigned char fill32_9[9] = + {0x89, 0xf6, /* 9 - mov esi, esi */ + 0x8d, 0xbc, 0x27, 0x00, 0x00, 0x00, /* lea edi, [edi*1+dword 0] */ + 0x00}; + static const unsigned char fill32_10[10] = + {0x8d, 0x76, 0x00, /* 10 - lea esi, [esi+byte 0] */ + 0x8d, 0xbc, 0x27, 0x00, 0x00, 0x00, /* lea edi, [edi+dword 0] */ + 0x00}; + static const unsigned char fill32_11[11] = + {0x8d, 0x74, 0x26, 0x00, /* 11 - lea esi, [esi*1+byte 0] */ + 0x8d, 0xbc, 0x27, 0x00, 0x00, 0x00, /* lea edi, [edi*1+dword 0] */ + 0x00}; + static const unsigned char fill32_12[12] = + {0x8d, 0xb6, 0x00, 0x00, 0x00, 0x00, /* 12 - lea esi, [esi+dword 0] */ + 0x8d, 0xbf, 0x00, 0x00, 0x00, 0x00};/* lea edi, [edi+dword 0] */ + static const unsigned char fill32_13[13] = + {0x8d, 0xb6, 0x00, 0x00, 0x00, 0x00, /* 13 - lea esi, [esi+dword 0] */ + 0x8d, 0xbc, 0x27, 0x00, 0x00, 0x00, /* lea edi, [edi*1+dword 0] */ + 0x00}; + static const unsigned char fill32_14[14] = + {0x8d, 0xb4, 0x26, 0x00, 0x00, 0x00, /* 14 - lea esi, [esi*1+dword 0] */ + 0x00, + 0x8d, 0xbc, 0x27, 0x00, 0x00, 0x00, /* lea edi, [edi*1+dword 0] */ + 0x00}; #else - /* But on newer processors, these are recommended */ - (const unsigned char *) - "\xeb\x07\x90\x90\x90\x90\x90" /* 9 - jmp $+9; nop fill */ - "\x90\x90", - (const unsigned char *) - "\xeb\x08\x90\x90\x90\x90\x90" /* 10 - jmp $+10; nop fill */ - "\x90\x90\x90", - (const unsigned char *) - "\xeb\x09\x90\x90\x90\x90\x90" /* 11 - jmp $+11; nop fill */ - "\x90\x90\x90\x90", - (const unsigned char *) - "\xeb\x0a\x90\x90\x90\x90\x90" /* 12 - jmp $+12; nop fill */ - "\x90\x90\x90\x90\x90", - (const unsigned char *) - "\xeb\x0b\x90\x90\x90\x90\x90" /* 13 - jmp $+13; nop fill */ - "\x90\x90\x90\x90\x90\x90", - (const unsigned char *) - "\xeb\x0c\x90\x90\x90\x90\x90" /* 14 - jmp $+14; nop fill */ - "\x90\x90\x90\x90\x90\x90\x90", + /* But on newer processors, these are recommended */ + static const unsigned char fill32_9[9] = + {0xeb, 0x07, 0x90, 0x90, 0x90, 0x90, /* 9 - jmp $+9; nop fill */ + 0x90, 0x90, 0x90}; + static const unsigned char fill32_10[10] = + {0xeb, 0x08, 0x90, 0x90, 0x90, 0x90, /* 10 - jmp $+10; nop fill */ + 0x90, 0x90, 0x90, 0x90}; + static const unsigned char fill32_11[11] = + {0xeb, 0x09, 0x90, 0x90, 0x90, 0x90, /* 11 - jmp $+11; nop fill */ + 0x90, 0x90, 0x90, 0x90, 0x90}; + static const unsigned char fill32_12[12] = + {0xeb, 0x0a, 0x90, 0x90, 0x90, 0x90, /* 12 - jmp $+12; nop fill */ + 0x90, 0x90, 0x90, 0x90, 0x90, 0x90}; + static const unsigned char fill32_13[13] = + {0xeb, 0x0b, 0x90, 0x90, 0x90, 0x90, /* 13 - jmp $+13; nop fill */ + 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90}; + static const unsigned char fill32_14[14] = + {0xeb, 0x0c, 0x90, 0x90, 0x90, 0x90, /* 14 - jmp $+14; nop fill */ + 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90}; #endif - (const unsigned char *) - "\xeb\x0d\x90\x90\x90\x90\x90" /* 15 - jmp $+15; nop fill */ - "\x90\x90\x90\x90\x90\x90\x90\x90" + static const unsigned char fill32_15[15] = + {0xeb, 0x0d, 0x90, 0x90, 0x90, 0x90, /* 15 - jmp $+15; nop fill */ + 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90}; + static const unsigned char *fill32[16] = + { + NULL, fill32_1, fill32_2, fill32_3, + fill32_4, fill32_5, fill32_6, fill32_7, + fill32_8, fill32_9, fill32_10, fill32_11, + fill32_12, fill32_13, fill32_14, fill32_15 }; - static const unsigned char *fill64[16] = { - NULL, /* unused */ - (const unsigned char *) - "\x90", /* 1 - nop */ - (const unsigned char *) - "\x66\x90", /* 2 - o16; nop */ + + static const unsigned char fill64_1[1] = + {0x90}; /* 1 - nop */ + static const unsigned char fill64_2[2] = + {0x66, 0x90}; /* 2 - o16; nop */ #if 1 - /* recommmended padding for AMD K8 processors */ - (const unsigned char *) - "\x66\x66\x90", /* 3 - o16; o16; nop */ - (const unsigned char *) - "\x66\x66\x66\x90", /* 4 - o16; o16; o16; nop */ - (const unsigned char *) - "\x66\x66\x90\x66\x90", /* 5 */ - (const unsigned char *) - "\x66\x66\x90\x66\x66\x90", /* 6 */ - (const unsigned char *) - "\x66\x66\x66\x90\x66\x66\x90", /* 7 */ - (const unsigned char *) - "\x66\x66\x66\x90\x66\x66\x66" /* 8 */ - "\x90", - (const unsigned char *) - "\x66\x66\x90\x66\x66\x90\x66" /* 9 */ - "\x66\x90", - (const unsigned char *) - "\x66\x66\x66\x90\x66\x66\x90" /* 10 */ - "\x66\x66\x90", - (const unsigned char *) - "\x66\x66\x66\x90\x66\x66\x66" /* 11 */ - "\x90\x66\x66\x90", - (const unsigned char *) - "\x66\x66\x66\x90\x66\x66\x66" /* 12 */ - "\x90\x66\x66\x66\x90", - (const unsigned char *) - "\x66\x66\x66\x90\x66\x66\x90" /* 13 */ - "\x66\x66\x90\x66\x66\x90", - (const unsigned char *) - "\x66\x66\x66\x90\x66\x66\x66" /* 14 */ - "\x90\x66\x66\x90\x66\x66\x90", - (const unsigned char *) - "\x66\x66\x66\x90\x66\x66\x66" /* 15 */ - "\x90\x66\x66\x66\x90\x66\x66\x90" + /* recommmended padding for AMD K8 processors */ + static const unsigned char fill64_3[3] = + {0x66, 0x66, 0x90}; /* 3 - o16; o16; nop */ + static const unsigned char fill64_4[4] = + {0x66, 0x66, 0x66, 0x90}; /* 4 - o16; o16; o16; nop */ + static const unsigned char fill64_5[5] = + {0x66, 0x66, 0x90, 0x66, 0x90}; /* 5 */ + static const unsigned char fill64_6[6] = + {0x66, 0x66, 0x90, 0x66, 0x66, 0x90};/* 6 */ + static const unsigned char fill64_7[7] = + {0x66, 0x66, 0x66, 0x90, 0x66, 0x66, 0x90}; /* 7 */ + static const unsigned char fill64_8[8] = + {0x66, 0x66, 0x66, 0x90, 0x66, 0x66, 0x66, /* 8 */ + 0x90}; + static const unsigned char fill64_9[9] = + {0x66, 0x66, 0x90, 0x66, 0x66, 0x90, 0x66, /* 9 */ + 0x66, 0x90}; + static const unsigned char fill64_10[10] = + {0x66, 0x66, 0x66, 0x90, 0x66, 0x66, 0x90, /* 10 */ + 0x66, 0x66, 0x90}; + static const unsigned char fill64_11[11] = + {0x66, 0x66, 0x66, 0x90, 0x66, 0x66, 0x66, /* 11 */ + 0x90, 0x66, 0x66, 0x90}; + static const unsigned char fill64_12[12] = + {0x66, 0x66, 0x66, 0x90, 0x66, 0x66, 0x66, /* 12 */ + 0x90, 0x66, 0x66, 0x66, 0x90}; + static const unsigned char fill64_13[13] = + {0x66, 0x66, 0x66, 0x90, 0x66, 0x66, 0x90, /* 13 */ + 0x66, 0x66, 0x90, 0x66, 0x66, 0x90}; + static const unsigned char fill64_14[14] = + {0x66, 0x66, 0x66, 0x90, 0x66, 0x66, 0x66, /* 14 */ + 0x90, 0x66, 0x66, 0x90, 0x66, 0x66, 0x90}; + static const unsigned char fill64_15[15] = + {0x66, 0x66, 0x66, 0x90, 0x66, 0x66, 0x66, /* 15 */ + 0x90, 0x66, 0x66, 0x66, 0x90, 0x66, 0x66, 0x90}; #else - /* from Software Optimisation Guide for AMD Family 10h */ - /* Processors 40546 revision 3.10 February 2009 */ - (const unsigned char *) - "\x0f\x1f\x00", /* 3 */ - (const unsigned char *) - "\x0f\x1f\x40\x00", /* 4 */ - (const unsigned char *) - "\x0f\x1f\x44\x00\x00", /* 5 */ - (const unsigned char *) - "\x66\x0f\x1f\x44\x00\x00", /* 6 */ - (const unsigned char *) - "\x0f\x1f\x80\x00\x00\x00\x00", /* 7 */ - (const unsigned char *) - "\x0f\x1f\x84\x00\x00\x00\x00" /* 8 */ - "\x00", - (const unsigned char *) - "\x66\x0f\x1f\x84\x00\x00\x00" /* 9 */ - "\x00\x00", - (const unsigned char *) - "\x66\x2e\x0f\x1f\x84\x00\x00" /* 10 */ - "\x00\x00\x00", - (const unsigned char *) - "\x0f\x1f\x44\x00\x00\x66\x0f" /* 11 */ - "\x1f\x44\x00\x00", - (const unsigned char *) - "\x66\x0f\x1f\x44\x00\x00\x66" /* 12 */ - "\x0f\x1f\x44\x00\x00", - (const unsigned char *) - "\x66\x0f\x1f\x44\x00\x00\x0f" /* 13 */ - "\x1f\x80\x00\x00\x00\x00", - (const unsigned char *) - "\x0f\x1f\x80\x00\x00\x00\x00" /* 14 */ - "\x0f\x1f\x80\x00\x00\x00\x00", - (const unsigned char *) - "\x0f\x1f\x80\x00\x00\x00\x00" /* 15 */ - "\x0f\x1f\x84\x00\x00\x00\x00\x00" + /* from Software Optimisation Guide for AMD Family 10h */ + /* Processors 40546 revision 3.10 February 2009 */ + static const unsigned char fill64_3[3] = + {0x0f, 0x1f, 0x00}; /* 3 */ + static const unsigned char fill64_4[4] = + {0x0f, 0x1f, 0x40, 0x00}; /* 4 */ + static const unsigned char fill64_5[5] = + {0x0f, 0x1f, 0x44, 0x00, 0x00}; /* 5 */ + static const unsigned char fill64_6[6] = + {0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00}; /* 6 */ + static const unsigned char fill64_7[7] = + {0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00}; /* 7 */ + static const unsigned char fill64_8[8] = + {0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, /* 8 */ + 0x00}; + static const unsigned char fill64_9[9] = + {0x66, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, /* 9 */ + 0x00, 0x00}; + static const unsigned char fill64_10[10] = + {0x66, 0x2e, 0x0f, 0x1f, 0x84, 0x00, 0x00, /* 10 */ + 0x00, 0x00, 0x00}; + static const unsigned char fill64_11[11] = + {0x0f, 0x1f, 0x44, 0x00, 0x00, 0x66, 0x0f, /* 11 */ + 0x1f, 0x44, 0x00, 0x00}; + static const unsigned char fill64_12[12] = + {0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00, 0x66, /* 12 */ + 0x0f, 0x1f, 0x44, 0x00, 0x00}; + static const unsigned char fill64_13[13] = + {0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00, 0x0f, /* 13 */ + 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00}; + static const unsigned char fill64_14[14] = + {0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00, /* 14 */ + 0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00}; + static const unsigned char fill64_15[15] = + {0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00, /* 15 */ + 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00}; #endif + static const unsigned char *fill64[16] = + { + NULL, fill64_1, fill64_2, fill64_3, + fill64_4, fill64_5, fill64_6, fill64_7, + fill64_8, fill64_9, fill64_10, fill64_11, + fill64_12, fill64_13, fill64_14, fill64_15 }; + switch (arch_x86->mode_bits) { case 16: return fill16; From 4d2de8713a9bf3307cdd5696050207d9fd83bb02 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 20 Mar 2009 07:36:49 +0000 Subject: [PATCH 258/585] Update code generated for alignment padding for more recent processors. Also match GAS behavior by using different NOP sequences for AMD and Intel. Different "Long" NOP opcode sequences are used based on the below criteria. Defaults in 32-bit mode: - CPU directive not used: backwards compatible (no long NOP opcodes) - CPU directive with Intel CPU >= 686: Intel guidelines, using long NOPs - CPU directive with AMD CPU >= K6: AMD guidelines, using long NOPs Defaults in 64-bit mode: - CPU directive not used: Intel guidelines, using long NOPs - CPU directive with Intel CPU >= 686: Intel guidelines, using long NOPs - CPU directive with AMD CPU >= K6: AMD guidelines, using long NOPs The above defaults may be overridden with these options to the CPU directive: - CPU basicnop: backwards compatible (no long NOP opcodes) - CPU intelnop: Intel guidelines, using long NOPs - CPU amdnop: AMD guidelines, using long NOPs Suggested by: Brian Gladman svn path=/trunk/yasm/; revision=2181 --- modules/arch/x86/tests/gas32/align32.hex | 4 +- modules/arch/x86/tests/gas64/align64.hex | 188 ++++---- modules/arch/x86/x86arch.c | 166 +++---- modules/arch/x86/x86arch.h | 6 + modules/arch/x86/x86cpu.gperf | 43 +- .../dwarf2/tests/pass32/dwarf32_testhd.hex | 8 +- .../dwarf2/tests/pass64/dwarf64_leb128.hex | 444 +++++++++--------- .../tests/passwin64/dwarfwin64_testhd.hex | 22 +- 8 files changed, 457 insertions(+), 424 deletions(-) diff --git a/modules/arch/x86/tests/gas32/align32.hex b/modules/arch/x86/tests/gas32/align32.hex index 77181969..8fb42419 100644 --- a/modules/arch/x86/tests/gas32/align32.hex +++ b/modules/arch/x86/tests/gas32/align32.hex @@ -228,8 +228,8 @@ ff 00 ff ff -89 -f6 +66 +90 ff 90 00 diff --git a/modules/arch/x86/tests/gas64/align64.hex b/modules/arch/x86/tests/gas64/align64.hex index 3e9c5c1d..ecfbf7ab 100644 --- a/modules/arch/x86/tests/gas64/align64.hex +++ b/modules/arch/x86/tests/gas64/align64.hex @@ -66,50 +66,50 @@ ff 66 66 66 -90 66 66 66 -90 -66 -66 -66 -90 -66 -66 -90 +2e +0f +1f +84 +00 +00 +00 +00 +00 ff ff 66 66 66 -90 66 66 -66 -90 -66 -66 -90 -66 -66 -90 +2e +0f +1f +84 +00 +00 +00 +00 +00 ff ff ff 66 66 66 -90 66 -66 -90 -66 -66 -90 -66 -66 -90 +2e +0f +1f +84 +00 +00 +00 +00 +00 ff ff ff @@ -117,15 +117,15 @@ ff 66 66 66 -90 -66 -66 -66 -90 -66 -66 -66 -90 +2e +0f +1f +84 +00 +00 +00 +00 +00 ff ff ff @@ -133,15 +133,15 @@ ff ff 66 66 -66 -90 -66 -66 -66 -90 -66 -66 -90 +2e +0f +1f +84 +00 +00 +00 +00 +00 ff ff ff @@ -149,15 +149,15 @@ ff ff ff 66 -66 -66 -90 -66 -66 -90 -66 -66 -90 +2e +0f +1f +84 +00 +00 +00 +00 +00 ff ff ff @@ -166,14 +166,14 @@ ff ff ff 66 -66 -90 -66 -66 -90 -66 -66 -90 +0f +1f +84 +00 +00 +00 +00 +00 ff ff ff @@ -182,50 +182,50 @@ ff ff ff ff -66 -66 -66 -90 -66 -66 -66 -90 +0f +1f +84 +00 +00 +00 +00 +00 ff -66 -66 -66 -90 -66 -66 -90 +0f +1f +80 +00 +00 +00 +00 ff ff 66 -66 -90 -66 -66 -90 +0f +1f +44 +00 +00 ff ff ff -66 -66 -90 -66 -90 +0f +1f +44 +00 +00 ff ff ff ff -66 -66 -66 -90 +0f +1f +40 +00 ff -66 -66 -90 +0f +1f +00 ff ff 66 diff --git a/modules/arch/x86/x86arch.c b/modules/arch/x86/x86arch.c index f2344063..73192ecc 100644 --- a/modules/arch/x86/x86arch.c +++ b/modules/arch/x86/x86arch.c @@ -68,6 +68,7 @@ x86_create(const char *machine, const char *parser, arch_x86->mode_bits = 0; arch_x86->force_strict = 0; arch_x86->default_rel = 0; + arch_x86->nop = X86_NOP_BASIC; if (yasm__strcasecmp(parser, "nasm") == 0) arch_x86->parser = X86_PARSER_NASM; @@ -270,7 +271,7 @@ x86_get_fill(const yasm_arch *arch) static const unsigned char fill32_1[1] = {0x90}; /* 1 - nop */ static const unsigned char fill32_2[2] = - {0x89, 0xf6}; /* 2 - mov esi, esi */ + {0x66, 0x90}; /* 2 - xchg ax, ax (o16 nop) */ static const unsigned char fill32_3[3] = {0x8d, 0x76, 0x00}; /* 3 - lea esi, [esi+byte 0] */ static const unsigned char fill32_4[4] = @@ -345,99 +346,100 @@ x86_get_fill(const yasm_arch *arch) fill32_12, fill32_13, fill32_14, fill32_15 }; - static const unsigned char fill64_1[1] = - {0x90}; /* 1 - nop */ - static const unsigned char fill64_2[2] = - {0x66, 0x90}; /* 2 - o16; nop */ -#if 1 - /* recommmended padding for AMD K8 processors */ - static const unsigned char fill64_3[3] = - {0x66, 0x66, 0x90}; /* 3 - o16; o16; nop */ - static const unsigned char fill64_4[4] = - {0x66, 0x66, 0x66, 0x90}; /* 4 - o16; o16; o16; nop */ - static const unsigned char fill64_5[5] = - {0x66, 0x66, 0x90, 0x66, 0x90}; /* 5 */ - static const unsigned char fill64_6[6] = - {0x66, 0x66, 0x90, 0x66, 0x66, 0x90};/* 6 */ - static const unsigned char fill64_7[7] = - {0x66, 0x66, 0x66, 0x90, 0x66, 0x66, 0x90}; /* 7 */ - static const unsigned char fill64_8[8] = - {0x66, 0x66, 0x66, 0x90, 0x66, 0x66, 0x66, /* 8 */ - 0x90}; - static const unsigned char fill64_9[9] = - {0x66, 0x66, 0x90, 0x66, 0x66, 0x90, 0x66, /* 9 */ - 0x66, 0x90}; - static const unsigned char fill64_10[10] = - {0x66, 0x66, 0x66, 0x90, 0x66, 0x66, 0x90, /* 10 */ - 0x66, 0x66, 0x90}; - static const unsigned char fill64_11[11] = - {0x66, 0x66, 0x66, 0x90, 0x66, 0x66, 0x66, /* 11 */ - 0x90, 0x66, 0x66, 0x90}; - static const unsigned char fill64_12[12] = - {0x66, 0x66, 0x66, 0x90, 0x66, 0x66, 0x66, /* 12 */ - 0x90, 0x66, 0x66, 0x66, 0x90}; - static const unsigned char fill64_13[13] = - {0x66, 0x66, 0x66, 0x90, 0x66, 0x66, 0x90, /* 13 */ - 0x66, 0x66, 0x90, 0x66, 0x66, 0x90}; - static const unsigned char fill64_14[14] = - {0x66, 0x66, 0x66, 0x90, 0x66, 0x66, 0x66, /* 14 */ - 0x90, 0x66, 0x66, 0x90, 0x66, 0x66, 0x90}; - static const unsigned char fill64_15[15] = - {0x66, 0x66, 0x66, 0x90, 0x66, 0x66, 0x66, /* 15 */ - 0x90, 0x66, 0x66, 0x66, 0x90, 0x66, 0x66, 0x90}; -#else - /* from Software Optimisation Guide for AMD Family 10h */ - /* Processors 40546 revision 3.10 February 2009 */ - static const unsigned char fill64_3[3] = - {0x0f, 0x1f, 0x00}; /* 3 */ - static const unsigned char fill64_4[4] = - {0x0f, 0x1f, 0x40, 0x00}; /* 4 */ - static const unsigned char fill64_5[5] = - {0x0f, 0x1f, 0x44, 0x00, 0x00}; /* 5 */ - static const unsigned char fill64_6[6] = - {0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00}; /* 6 */ - static const unsigned char fill64_7[7] = - {0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00}; /* 7 */ - static const unsigned char fill64_8[8] = - {0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, /* 8 */ + /* Long form nops available on more recent Intel and AMD processors */ + static const unsigned char fill32new_3[3] = + {0x0f, 0x1f, 0x00}; /* 3 - nop(3) */ + static const unsigned char fill32new_4[4] = + {0x0f, 0x1f, 0x40, 0x00}; /* 4 - nop(4) */ + static const unsigned char fill32new_5[5] = + {0x0f, 0x1f, 0x44, 0x00, 0x00}; /* 5 - nop(5) */ + static const unsigned char fill32new_6[6] = + {0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00}; /* 6 - nop(6) */ + static const unsigned char fill32new_7[7] = + {0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00}; /* 7 - nop(7) */ + static const unsigned char fill32new_8[8] = + {0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, /* 8 - nop(8) */ 0x00}; - static const unsigned char fill64_9[9] = - {0x66, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, /* 9 */ + static const unsigned char fill32new_9[9] = + {0x66, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, /* 9 - nop(9) */ 0x00, 0x00}; - static const unsigned char fill64_10[10] = - {0x66, 0x2e, 0x0f, 0x1f, 0x84, 0x00, 0x00, /* 10 */ + + /* Longer forms preferred by Intel use repeated o16 prefixes */ + static const unsigned char fill32intel_10[10] = + {0x66, 0x2e, 0x0f, 0x1f, 0x84, 0x00, 0x00, /* 10 - o16; cs; nop */ 0x00, 0x00, 0x00}; - static const unsigned char fill64_11[11] = - {0x0f, 0x1f, 0x44, 0x00, 0x00, 0x66, 0x0f, /* 11 */ - 0x1f, 0x44, 0x00, 0x00}; - static const unsigned char fill64_12[12] = - {0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00, 0x66, /* 12 */ - 0x0f, 0x1f, 0x44, 0x00, 0x00}; - static const unsigned char fill64_13[13] = - {0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00, 0x0f, /* 13 */ - 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00}; - static const unsigned char fill64_14[14] = - {0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00, /* 14 */ - 0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00}; - static const unsigned char fill64_15[15] = - {0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00, /* 15 */ + static const unsigned char fill32intel_11[11] = + {0x66, 0x66, 0x2e, 0x0f, 0x1f, 0x84, 0x00, /* 11 - 2x o16; cs; nop */ + 0x00, 0x00, 0x00, 0x00}; + static const unsigned char fill32intel_12[12] = + {0x66, 0x66, 0x66, 0x2e, 0x0f, 0x1f, 0x84, /* 12 - 3x o16; cs; nop */ + 0x00, 0x00, 0x00, 0x00, 0x00}; + static const unsigned char fill32intel_13[13] = + {0x66, 0x66, 0x66, 0x66, 0x2e, 0x0f, 0x1f, /* 13 - 4x o16; cs; nop */ + 0x84, 0x00, 0x00, 0x00, 0x00, 0x00}; + static const unsigned char fill32intel_14[14] = + {0x66, 0x66, 0x66, 0x66, 0x66, 0x2e, 0x0f, /* 14 - 5x o16; cs; nop */ + 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00}; + static const unsigned char fill32intel_15[15] = + {0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x2e, /* 15 - 6x o16; cs; nop */ 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00}; -#endif - static const unsigned char *fill64[16] = + + /* Longer forms preferred by AMD use fewer o16 prefixes and no CS prefix; + * Source: Software Optimisation Guide for AMD Family 10h + * Processors 40546 revision 3.10 February 2009 + */ + static const unsigned char fill32amd_10[10] = + {0x66, 0x66, 0x0f, 0x1f, 0x84, 0x00, 0x00, /* 10 - nop(10) */ + 0x00, 0x00, 0x00}; + static const unsigned char fill32amd_11[11] = + {0x0f, 0x1f, 0x44, 0x00, 0x00, /* 11 - nop(5) */ + 0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00}; /* nop(6) */ + static const unsigned char fill32amd_12[12] = + {0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00, /* 12 - nop(6) */ + 0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00}; /* nop(6) */ + static const unsigned char fill32amd_13[13] = + {0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00, /* 13 - nop(6) */ + 0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00}; /* nop(7) */ + static const unsigned char fill32amd_14[14] = + {0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00, /* 14 - nop(7) */ + 0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00}; /* nop(7) */ + static const unsigned char fill32amd_15[15] = + {0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00, /* 15 - nop(7) */ + 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00}; /* nop(8) */ + + static const unsigned char *fill32_intel[16] = { - NULL, fill64_1, fill64_2, fill64_3, - fill64_4, fill64_5, fill64_6, fill64_7, - fill64_8, fill64_9, fill64_10, fill64_11, - fill64_12, fill64_13, fill64_14, fill64_15 + NULL, fill32_1, fill32_2, fill32new_3, + fill32new_4, fill32new_5, fill32new_6, fill32new_7, + fill32new_8, fill32new_9, fill32intel_10, fill32intel_11, + fill32intel_12, fill32intel_13, fill32intel_14, fill32intel_15 + }; + static const unsigned char *fill32_amd[16] = + { + NULL, fill32_1, fill32_2, fill32new_3, + fill32new_4, fill32new_5, fill32new_6, fill32new_7, + fill32new_8, fill32new_9, fill32amd_10, fill32amd_11, + fill32amd_12, fill32amd_13, fill32amd_14, fill32amd_15 }; switch (arch_x86->mode_bits) { case 16: return fill16; case 32: - return fill32; + if (arch_x86->nop == X86_NOP_INTEL) + return fill32_intel; + else if (arch_x86->nop == X86_NOP_AMD) + return fill32_amd; + else + return fill32; case 64: - return fill64; + /* We know long nops are available in 64-bit mode; default to Intel + * ones if unspecified (to match GAS behavior). + */ + if (arch_x86->nop == X86_NOP_AMD) + return fill32_amd; + else + return fill32_intel; default: yasm_error_set(YASM_ERROR_VALUE, N_("Invalid mode_bits in x86_get_fill")); diff --git a/modules/arch/x86/x86arch.h b/modules/arch/x86/x86arch.h index 41cde219..ac4b7ed7 100644 --- a/modules/arch/x86/x86arch.h +++ b/modules/arch/x86/x86arch.h @@ -89,6 +89,12 @@ typedef struct yasm_arch_x86 { unsigned int mode_bits; unsigned int force_strict; unsigned int default_rel; + + enum { + X86_NOP_BASIC = 0, + X86_NOP_INTEL = 1, + X86_NOP_AMD = 2 + } nop; } yasm_arch_x86; /* 0-15 (low 4 bits) used for register number, stored in same data area. diff --git a/modules/arch/x86/x86cpu.gperf b/modules/arch/x86/x86cpu.gperf index 29c0f49d..caf0b529 100644 --- a/modules/arch/x86/x86cpu.gperf +++ b/modules/arch/x86/x86cpu.gperf @@ -51,7 +51,7 @@ RCSID("$Id$"); #define PROC_sandybridge 15 static void -x86_cpu_intel(wordptr cpu, unsigned int data) +x86_cpu_intel(wordptr cpu, yasm_arch_x86 *arch_x86, unsigned int data) { BitVector_Empty(cpu); @@ -104,10 +104,16 @@ x86_cpu_intel(wordptr cpu, unsigned int data) if (data >= PROC_186) BitVector_Bit_On(cpu, CPU_186); BitVector_Bit_On(cpu, CPU_086); + + /* Use Intel long NOPs if 686 or better */ + if (data >= PROC_686) + arch_x86->nop = X86_NOP_INTEL; + else + arch_x86->nop = X86_NOP_BASIC; } static void -x86_cpu_ia64(wordptr cpu, unsigned int data) +x86_cpu_ia64(wordptr cpu, yasm_arch_x86 *arch_x86, unsigned int data) { BitVector_Empty(cpu); BitVector_Bit_On(cpu, CPU_Priv); @@ -137,7 +143,7 @@ x86_cpu_ia64(wordptr cpu, unsigned int data) #define PROC_k6 6 static void -x86_cpu_amd(wordptr cpu, unsigned int data) +x86_cpu_amd(wordptr cpu, yasm_arch_x86 *arch_x86, unsigned int data) { BitVector_Empty(cpu); @@ -172,34 +178,46 @@ x86_cpu_amd(wordptr cpu, unsigned int data) BitVector_Bit_On(cpu, CPU_286); BitVector_Bit_On(cpu, CPU_186); BitVector_Bit_On(cpu, CPU_086); + + /* Use AMD long NOPs if k6 or better */ + if (data >= PROC_k6) + arch_x86->nop = X86_NOP_AMD; + else + arch_x86->nop = X86_NOP_BASIC; } static void -x86_cpu_set(wordptr cpu, unsigned int data) +x86_cpu_set(wordptr cpu, yasm_arch_x86 *arch_x86, unsigned int data) { BitVector_Bit_On(cpu, data); } static void -x86_cpu_clear(wordptr cpu, unsigned int data) +x86_cpu_clear(wordptr cpu, yasm_arch_x86 *arch_x86, unsigned int data) { BitVector_Bit_Off(cpu, data); } static void -x86_cpu_set_sse4(wordptr cpu, unsigned int data) +x86_cpu_set_sse4(wordptr cpu, yasm_arch_x86 *arch_x86, unsigned int data) { BitVector_Bit_On(cpu, CPU_SSE41); BitVector_Bit_On(cpu, CPU_SSE42); } static void -x86_cpu_clear_sse4(wordptr cpu, unsigned int data) +x86_cpu_clear_sse4(wordptr cpu, yasm_arch_x86 *arch_x86, unsigned int data) { BitVector_Bit_Off(cpu, CPU_SSE41); BitVector_Bit_Off(cpu, CPU_SSE42); } +static void +x86_nop(wordptr cpu, yasm_arch_x86 *arch_x86, unsigned int data) +{ + arch_x86->nop = data; +} + %} %ignore-case %language=ANSI-C @@ -211,7 +229,7 @@ x86_cpu_clear_sse4(wordptr cpu, unsigned int data) %define lookup-function-name cpu_find struct cpu_parse_data { const char *name; - void (*handler) (wordptr cpu, unsigned int data); + void (*handler) (wordptr cpu, yasm_arch_x86 *arch_x86, unsigned int data); unsigned int data; }; %% @@ -268,12 +286,15 @@ athlon64, x86_cpu_amd, PROC_hammer athlon-64, x86_cpu_amd, PROC_hammer venice, x86_cpu_amd, PROC_venice k10, x86_cpu_amd, PROC_k10 +phenom, x86_cpu_amd, PROC_k10 +family10h, x86_cpu_amd, PROC_k10 bulldozer, x86_cpu_amd, PROC_bulldozer prescott, x86_cpu_intel, PROC_prescott conroe, x86_cpu_intel, PROC_conroe core2, x86_cpu_intel, PROC_conroe penryn, x86_cpu_intel, PROC_penryn nehalem, x86_cpu_intel, PROC_nehalem +corei7, x86_cpu_intel, PROC_nehalem westmere, x86_cpu_intel, PROC_westmere sandybridge, x86_cpu_intel, PROC_sandybridge # @@ -352,6 +373,10 @@ pclmulqdq, x86_cpu_set, CPU_CLMUL nopclmulqdq, x86_cpu_clear, CPU_CLMUL movbe, x86_cpu_set, CPU_MOVBE nomovbe, x86_cpu_clear, CPU_MOVBE +# Change NOP patterns +basicnop, x86_nop, X86_NOP_BASIC +intelnop, x86_nop, X86_NOP_INTEL +amdnop, x86_nop, X86_NOP_AMD %% void @@ -377,7 +402,7 @@ yasm_x86__parse_cpu(yasm_arch_x86 *arch_x86, const char *cpuid, } new_cpu = BitVector_Clone(arch_x86->cpu_enables[arch_x86->active_cpu]); - pdata->handler(new_cpu, pdata->data); + pdata->handler(new_cpu, arch_x86, pdata->data); /* try to find an existing match in the CPU table first */ for (i=0; icpu_enables_size; i++) { diff --git a/modules/dbgfmts/dwarf2/tests/pass32/dwarf32_testhd.hex b/modules/dbgfmts/dwarf2/tests/pass32/dwarf32_testhd.hex index e73e882a..7cfddd03 100644 --- a/modules/dbgfmts/dwarf2/tests/pass32/dwarf32_testhd.hex +++ b/modules/dbgfmts/dwarf2/tests/pass32/dwarf32_testhd.hex @@ -168,8 +168,8 @@ b8 00 eb 72 -89 -f6 +66 +90 83 ec 08 @@ -280,8 +280,8 @@ b8 00 00 00 -89 -f6 +66 +90 8d 65 f8 diff --git a/modules/dbgfmts/dwarf2/tests/pass64/dwarf64_leb128.hex b/modules/dbgfmts/dwarf2/tests/pass64/dwarf64_leb128.hex index 562eadb6..2af91504 100644 --- a/modules/dbgfmts/dwarf2/tests/pass64/dwarf64_leb128.hex +++ b/modules/dbgfmts/dwarf2/tests/pass64/dwarf64_leb128.hex @@ -183,13 +183,13 @@ e8 c4 08 c3 -66 -66 -66 -90 -66 -66 -90 +0f +1f +80 +00 +00 +00 +00 48 83 ec @@ -410,10 +410,10 @@ e8 c4 18 c3 -66 -66 -66 -90 +0f +1f +40 +00 48 8b 3d @@ -459,9 +459,9 @@ e8 c4 18 c3 -66 -66 -90 +0f +1f +00 ba 00 00 @@ -485,15 +485,15 @@ ff ff ff 66 -66 -66 -90 -66 -66 -90 -66 -66 -90 +2e +0f +1f +84 +00 +00 +00 +00 +00 48 89 6c @@ -682,10 +682,10 @@ d8 c4 18 c3 -66 -66 -66 -90 +0f +1f +40 +00 ba 00 00 @@ -709,15 +709,15 @@ ff ff ff 66 -66 -66 -90 -66 -66 -90 -66 -66 -90 +2e +0f +1f +84 +00 +00 +00 +00 +00 48 89 6c @@ -933,15 +933,15 @@ ff ff ff 66 -66 -66 -90 -66 -66 -90 -66 -66 -90 +2e +0f +1f +84 +00 +00 +00 +00 +00 48 89 6c @@ -1157,15 +1157,15 @@ ff ff ff 66 -66 -66 -90 -66 -66 -90 -66 -66 -90 +2e +0f +1f +84 +00 +00 +00 +00 +00 48 89 5c @@ -1371,9 +1371,9 @@ e8 c4 28 c3 -66 -66 -90 +0f +1f +00 4d 85 e4 @@ -1450,10 +1450,10 @@ ff 23 31 db -66 -66 -66 -90 +0f +1f +40 +00 48 8b 3d @@ -1557,15 +1557,15 @@ ff ff 66 66 -66 -90 -66 -66 -66 -90 -66 -66 -90 +2e +0f +1f +84 +00 +00 +00 +00 +00 53 48 89 @@ -1610,10 +1610,10 @@ fb 5b eb d4 -66 -66 -66 -90 +0f +1f +40 +00 48 8b 3d @@ -1714,18 +1714,18 @@ c3 66 66 66 -90 66 66 66 -90 -66 -66 -66 -90 -66 -66 -90 +2e +0f +1f +84 +00 +00 +00 +00 +00 48 89 6c @@ -1833,11 +1833,11 @@ c4 18 c3 66 -66 -90 -66 -66 -90 +0f +1f +44 +00 +00 48 8b 7d @@ -1881,11 +1881,11 @@ d8 c4 18 c3 -66 -66 -90 -66 -90 +0f +1f +44 +00 +00 53 83 7f @@ -2281,11 +2281,11 @@ ff 4c 8b 27 -66 -66 -90 -66 -90 +0f +1f +44 +00 +00 e9 fb fe @@ -3299,17 +3299,17 @@ ff 66 66 66 -90 66 66 -66 -90 -66 -66 -90 -66 -66 -90 +2e +0f +1f +84 +00 +00 +00 +00 +00 53 83 7f @@ -3353,11 +3353,11 @@ c7 00 5b c3 -66 -66 -90 -66 -90 +0f +1f +44 +00 +00 8b 4f 08 @@ -3382,14 +3382,14 @@ c3 c0 c3 66 -66 -90 -66 -66 -90 -66 -66 -90 +0f +1f +84 +00 +00 +00 +00 +00 8b 77 08 @@ -3413,15 +3413,15 @@ c0 f3 c3 66 -66 -66 -90 -66 -66 -90 -66 -66 -90 +2e +0f +1f +84 +00 +00 +00 +00 +00 48 83 ec @@ -3465,11 +3465,11 @@ d0 c4 08 c3 -66 -66 -90 -66 -90 +0f +1f +44 +00 +00 44 8b 47 @@ -3497,11 +3497,11 @@ e9 00 00 00 -66 -66 -90 -66 -90 +0f +1f +44 +00 +00 48 83 ec @@ -3545,11 +3545,11 @@ c0 c4 08 c3 -66 -66 -90 -66 -90 +0f +1f +44 +00 +00 48 8b 07 @@ -3577,11 +3577,11 @@ e9 00 00 00 -66 -66 -90 -66 -90 +0f +1f +44 +00 +00 53 8b 47 @@ -3641,11 +3641,11 @@ ff ff 7f c3 -66 -66 -90 -66 -90 +0f +1f +44 +00 +00 48 8b 3f @@ -3733,15 +3733,15 @@ d8 c3 66 66 -66 -90 -66 -66 -66 -90 -66 -66 -90 +2e +0f +1f +84 +00 +00 +00 +00 +00 48 89 5c @@ -3929,11 +3929,11 @@ c4 38 c3 66 -66 -90 -66 -66 -90 +0f +1f +44 +00 +00 48 89 ef @@ -3947,9 +3947,9 @@ e8 41 89 c4 -66 -66 -90 +0f +1f +00 44 89 e6 @@ -3979,9 +3979,9 @@ d2 48 8b 2f -66 -66 -90 +0f +1f +00 e9 64 ff @@ -4070,14 +4070,14 @@ e9 ff ff ff -66 -66 -66 -90 -66 -66 -66 -90 +0f +1f +84 +00 +00 +00 +00 +00 48 89 5c @@ -4649,11 +4649,11 @@ fe ff ff 66 -66 -90 -66 -66 -90 +0f +1f +44 +00 +00 48 89 ef @@ -4715,9 +4715,9 @@ d0 fd ff ff -66 -66 -90 +0f +1f +00 48 89 5c @@ -4875,9 +4875,9 @@ ed 2f 74 be -66 -66 -90 +0f +1f +00 4c 89 ef @@ -4954,10 +4954,10 @@ d8 f0 eb 85 -66 -66 -66 -90 +0f +1f +40 +00 b8 01 00 @@ -5010,18 +5010,18 @@ ff 66 66 66 -90 66 66 66 -90 -66 -66 -66 -90 -66 -66 -90 +2e +0f +1f +84 +00 +00 +00 +00 +00 48 89 5c @@ -5251,17 +5251,17 @@ eb 66 66 66 -90 66 66 -66 -90 -66 -66 -90 -66 -66 -90 +2e +0f +1f +84 +00 +00 +00 +00 +00 48 89 6c @@ -5767,13 +5767,13 @@ b8 00 00 00 -66 -66 -66 -90 -66 -66 -90 +0f +1f +80 +00 +00 +00 +00 c6 44 28 diff --git a/modules/dbgfmts/dwarf2/tests/passwin64/dwarfwin64_testhd.hex b/modules/dbgfmts/dwarf2/tests/passwin64/dwarfwin64_testhd.hex index fdf74cc5..eb9cfe81 100644 --- a/modules/dbgfmts/dwarf2/tests/passwin64/dwarfwin64_testhd.hex +++ b/modules/dbgfmts/dwarf2/tests/passwin64/dwarfwin64_testhd.hex @@ -611,13 +611,13 @@ b8 c4 18 c3 -66 -66 -66 -90 -66 -66 -90 +0f +1f +80 +00 +00 +00 +00 48 8b 7d @@ -646,10 +646,10 @@ c3 14 eb 77 -66 -66 -66 -90 +0f +1f +40 +00 89 c6 bf From bf635274b11d3979293cfbd8d5366c37b0f1b784 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 24 Mar 2009 04:58:46 +0000 Subject: [PATCH 259/585] Rename tasm to ytasm in Unix builds. We aren't compatible enough to call ourselves the "real" one. svn path=/trunk/yasm/; revision=2183 --- Mkfiles/Makefile.dj | 8 ++++---- Mkfiles/Makefile.flat | 8 ++++---- frontends/tasm/Makefile.inc | 10 +++++----- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Mkfiles/Makefile.dj b/Mkfiles/Makefile.dj index 451bfade..e3702ebf 100644 --- a/Mkfiles/Makefile.dj +++ b/Mkfiles/Makefile.dj @@ -13,7 +13,7 @@ CFLAGS=-DHAVE_CONFIG_H -IMkfiles/dj -O -I. CC?=gcc BUILDCC?=$(CC) -all: yasm tasm +all: yasm ytasm LIBYASM_OBJS= \ libyasm/assocdat.o \ @@ -149,7 +149,7 @@ YASM_OBJS= \ $(LIBYASM_OBJS) \ $(MODULES_OBJS) -TASM_OBJS= \ +YTASM_OBJS= \ frontends/tasm/tasm.o \ frontends/tasm/tasm-options.o \ $(LIBYASM_OBJS) \ @@ -249,8 +249,8 @@ genperf: $(GENPERF_SRCS) yasm: $(YASM_OBJS) $(CC) -o yasm $(YASM_OBJS) -tasm: $(TASM_OBJS) - $(CC) -o tasm $(TASM_OBJS) +ytasm: $(YTASM_OBJS) + $(CC) -o ytasm $(YTASM_OBJS) .c.o: $(CC) -c $(CFLAGS) -o $@ $< diff --git a/Mkfiles/Makefile.flat b/Mkfiles/Makefile.flat index 28cb7dcf..d97a491d 100644 --- a/Mkfiles/Makefile.flat +++ b/Mkfiles/Makefile.flat @@ -16,7 +16,7 @@ CFLAGS=-DHAVE_CONFIG_H -IMkfiles -I. CC?=gcc BUILDCC?=$(CC) -all: yasm tasm +all: yasm ytasm LIBYASM_OBJS= \ libyasm/assocdat.o \ @@ -152,7 +152,7 @@ YASM_OBJS= \ $(LIBYASM_OBJS) \ $(MODULES_OBJS) -TASM_OBJS= \ +YTASM_OBJS= \ frontends/tasm/tasm.o \ frontends/tasm/tasm-options.o \ $(LIBYASM_OBJS) \ @@ -252,8 +252,8 @@ genperf: $(GENPERF_SRCS) yasm: $(YASM_OBJS) $(CC) -o yasm $(YASM_OBJS) -tasm: $(TASM_OBJS) - $(CC) -o tasm $(TASM_OBJS) +ytasm: $(YTASM_OBJS) + $(CC) -o ytasm $(YTASM_OBJS) .c.o: $(CC) -c $(CFLAGS) -o $@ $< diff --git a/frontends/tasm/Makefile.inc b/frontends/tasm/Makefile.inc index 69ec826c..22370df8 100644 --- a/frontends/tasm/Makefile.inc +++ b/frontends/tasm/Makefile.inc @@ -1,9 +1,9 @@ # $Id: Makefile.inc 1463 2006-04-05 05:39:23Z peter $ -bin_PROGRAMS += tasm +bin_PROGRAMS += ytasm -tasm_SOURCES = frontends/tasm/tasm.c -tasm_SOURCES += frontends/tasm/tasm-options.c -tasm_SOURCES += frontends/tasm/tasm-options.h +ytasm_SOURCES = frontends/tasm/tasm.c +ytasm_SOURCES += frontends/tasm/tasm-options.c +ytasm_SOURCES += frontends/tasm/tasm-options.h -tasm_LDADD = libyasm.a $(INTLLIBS) +ytasm_LDADD = libyasm.a $(INTLLIBS) From 73276e64a8b30973dbc141e9d0929c14351e58bd Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 24 Mar 2009 05:04:15 +0000 Subject: [PATCH 260/585] Remove vc7 and vc8 build files, as they're no longer being maintained. There's a Python script (vc98_swap.py) in the Mkfiles/vc9 directory for those who want to build with vc8. svn path=/trunk/yasm/; revision=2184 --- Makefile.am | 39 -- Mkfiles/vc/config.h | 180 ------ Mkfiles/vc/genmacro/genmacro.vcproj | 128 ----- Mkfiles/vc/genmacro/run.bat | 5 - Mkfiles/vc/genmodule/genmodule.vcproj | 127 ----- Mkfiles/vc/genmodule/run.bat | 3 - Mkfiles/vc/genperf/genperf.vcproj | 158 ------ Mkfiles/vc/genperf/run.bat | 19 - Mkfiles/vc/genstring/genstring.vcproj | 128 ----- Mkfiles/vc/genstring/run.bat | 2 - Mkfiles/vc/genversion/genversion.vcproj | 137 ----- Mkfiles/vc/genversion/run.bat | 2 - Mkfiles/vc/libyasm-stdint.h | 8 - Mkfiles/vc/libyasm/libyasm.vcproj | 305 ---------- Mkfiles/vc/modules/modules.vcproj | 336 ----------- Mkfiles/vc/re2c/re2c.vcproj | 197 ------- Mkfiles/vc/re2c/run.bat | 4 - Mkfiles/vc/yasm.sln | 95 ---- Mkfiles/vc/yasm.vcproj | 161 ------ Mkfiles/vc8/config.h | 177 ------ Mkfiles/vc8/crt_secure_no_deprecate.vsprops | 11 - Mkfiles/vc8/genmacro/genmacro.vcproj | 201 ------- Mkfiles/vc8/genmacro/run.bat | 5 - Mkfiles/vc8/genmodule/genmodule.vcproj | 203 ------- Mkfiles/vc8/genmodule/run.bat | 3 - Mkfiles/vc8/genperf/genperf.vcproj | 233 -------- Mkfiles/vc8/genperf/run.bat | 19 - Mkfiles/vc8/genstring/genstring.vcproj | 201 ------- Mkfiles/vc8/genstring/run.bat | 2 - Mkfiles/vc8/genversion/genversion.vcproj | 212 ------- Mkfiles/vc8/genversion/run.bat | 2 - Mkfiles/vc8/libyasm-stdint.h | 8 - Mkfiles/vc8/libyasm/libyasm.vcproj | 571 ------------------- Mkfiles/vc8/modules/modules.vcproj | 593 -------------------- Mkfiles/vc8/re2c/re2c.vcproj | 281 ---------- Mkfiles/vc8/re2c/run.bat | 4 - Mkfiles/vc8/readme.vc8.txt | 98 ---- Mkfiles/vc8/yasm.rules | 114 ---- Mkfiles/vc8/yasm.sln | 128 ----- Mkfiles/vc8/yasm.vcproj | 413 -------------- 40 files changed, 5513 deletions(-) delete mode 100644 Mkfiles/vc/config.h delete mode 100644 Mkfiles/vc/genmacro/genmacro.vcproj delete mode 100644 Mkfiles/vc/genmacro/run.bat delete mode 100644 Mkfiles/vc/genmodule/genmodule.vcproj delete mode 100644 Mkfiles/vc/genmodule/run.bat delete mode 100644 Mkfiles/vc/genperf/genperf.vcproj delete mode 100644 Mkfiles/vc/genperf/run.bat delete mode 100644 Mkfiles/vc/genstring/genstring.vcproj delete mode 100644 Mkfiles/vc/genstring/run.bat delete mode 100644 Mkfiles/vc/genversion/genversion.vcproj delete mode 100644 Mkfiles/vc/genversion/run.bat delete mode 100644 Mkfiles/vc/libyasm-stdint.h delete mode 100644 Mkfiles/vc/libyasm/libyasm.vcproj delete mode 100644 Mkfiles/vc/modules/modules.vcproj delete mode 100644 Mkfiles/vc/re2c/re2c.vcproj delete mode 100644 Mkfiles/vc/re2c/run.bat delete mode 100644 Mkfiles/vc/yasm.sln delete mode 100644 Mkfiles/vc/yasm.vcproj delete mode 100644 Mkfiles/vc8/config.h delete mode 100644 Mkfiles/vc8/crt_secure_no_deprecate.vsprops delete mode 100644 Mkfiles/vc8/genmacro/genmacro.vcproj delete mode 100644 Mkfiles/vc8/genmacro/run.bat delete mode 100644 Mkfiles/vc8/genmodule/genmodule.vcproj delete mode 100644 Mkfiles/vc8/genmodule/run.bat delete mode 100644 Mkfiles/vc8/genperf/genperf.vcproj delete mode 100644 Mkfiles/vc8/genperf/run.bat delete mode 100644 Mkfiles/vc8/genstring/genstring.vcproj delete mode 100644 Mkfiles/vc8/genstring/run.bat delete mode 100644 Mkfiles/vc8/genversion/genversion.vcproj delete mode 100644 Mkfiles/vc8/genversion/run.bat delete mode 100644 Mkfiles/vc8/libyasm-stdint.h delete mode 100644 Mkfiles/vc8/libyasm/libyasm.vcproj delete mode 100644 Mkfiles/vc8/modules/modules.vcproj delete mode 100644 Mkfiles/vc8/re2c/re2c.vcproj delete mode 100644 Mkfiles/vc8/re2c/run.bat delete mode 100644 Mkfiles/vc8/readme.vc8.txt delete mode 100644 Mkfiles/vc8/yasm.rules delete mode 100644 Mkfiles/vc8/yasm.sln delete mode 100644 Mkfiles/vc8/yasm.vcproj diff --git a/Makefile.am b/Makefile.am index 5252b416..0ddc3bcd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -62,45 +62,6 @@ EXTRA_DIST += Mkfiles/Makefile.flat EXTRA_DIST += Mkfiles/Makefile.dj EXTRA_DIST += Mkfiles/dj/config.h EXTRA_DIST += Mkfiles/dj/libyasm-stdint.h -EXTRA_DIST += Mkfiles/vc/yasm.sln -EXTRA_DIST += Mkfiles/vc/yasm.vcproj -EXTRA_DIST += Mkfiles/vc/config.h -EXTRA_DIST += Mkfiles/vc/libyasm-stdint.h -EXTRA_DIST += Mkfiles/vc/genmacro/genmacro.vcproj -EXTRA_DIST += Mkfiles/vc/genmacro/run.bat -EXTRA_DIST += Mkfiles/vc/genmodule/genmodule.vcproj -EXTRA_DIST += Mkfiles/vc/genmodule/run.bat -EXTRA_DIST += Mkfiles/vc/genstring/genstring.vcproj -EXTRA_DIST += Mkfiles/vc/genstring/run.bat -EXTRA_DIST += Mkfiles/vc/genversion/genversion.vcproj -EXTRA_DIST += Mkfiles/vc/genversion/run.bat -EXTRA_DIST += Mkfiles/vc/libyasm/libyasm.vcproj -EXTRA_DIST += Mkfiles/vc/modules/modules.vcproj -EXTRA_DIST += Mkfiles/vc/re2c/re2c.vcproj -EXTRA_DIST += Mkfiles/vc/re2c/run.bat -EXTRA_DIST += Mkfiles/vc/genperf/genperf.vcproj -EXTRA_DIST += Mkfiles/vc/genperf/run.bat -EXTRA_DIST += Mkfiles/vc8/crt_secure_no_deprecate.vsprops -EXTRA_DIST += Mkfiles/vc8/yasm.sln -EXTRA_DIST += Mkfiles/vc8/yasm.vcproj -EXTRA_DIST += Mkfiles/vc8/config.h -EXTRA_DIST += Mkfiles/vc8/libyasm-stdint.h -EXTRA_DIST += Mkfiles/vc8/readme.vc8.txt -EXTRA_DIST += Mkfiles/vc8/yasm.rules -EXTRA_DIST += Mkfiles/vc8/genmacro/genmacro.vcproj -EXTRA_DIST += Mkfiles/vc8/genmacro/run.bat -EXTRA_DIST += Mkfiles/vc8/genmodule/genmodule.vcproj -EXTRA_DIST += Mkfiles/vc8/genmodule/run.bat -EXTRA_DIST += Mkfiles/vc8/genstring/genstring.vcproj -EXTRA_DIST += Mkfiles/vc8/genstring/run.bat -EXTRA_DIST += Mkfiles/vc8/genversion/genversion.vcproj -EXTRA_DIST += Mkfiles/vc8/genversion/run.bat -EXTRA_DIST += Mkfiles/vc8/libyasm/libyasm.vcproj -EXTRA_DIST += Mkfiles/vc8/modules/modules.vcproj -EXTRA_DIST += Mkfiles/vc8/re2c/re2c.vcproj -EXTRA_DIST += Mkfiles/vc8/re2c/run.bat -EXTRA_DIST += Mkfiles/vc8/genperf/genperf.vcproj -EXTRA_DIST += Mkfiles/vc8/genperf/run.bat EXTRA_DIST += Mkfiles/vc9/crt_secure_no_deprecate.vsprops EXTRA_DIST += Mkfiles/vc9/yasm.sln EXTRA_DIST += Mkfiles/vc9/yasm.vcproj diff --git a/Mkfiles/vc/config.h b/Mkfiles/vc/config.h deleted file mode 100644 index 1a7d9c03..00000000 --- a/Mkfiles/vc/config.h +++ /dev/null @@ -1,180 +0,0 @@ -/* $Id$ */ - -#define yasm__splitpath(path, tail) yasm__splitpath_win(path, tail) -#define yasm__abspath(path) yasm__abspath_win(path) -#define yasm__combpath(from, to) yasm__combpath_win(from, to) - -/* Command name to run C preprocessor */ -#define CPP_PROG "cpp" - -/* */ -/* #undef ENABLE_NLS */ - -/* Define if you have the `abort' function. */ -#define HAVE_ABORT 1 - -/* */ -/* #undef HAVE_CATGETS */ - -/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the - CoreFoundation framework. */ -/* #undef HAVE_CFLOCALECOPYCURRENT */ - -/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in - the CoreFoundation framework. */ -/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ - -/* Define if the GNU dcgettext() function is already present or preinstalled. - */ -/* #undef HAVE_DCGETTEXT */ - -/* Define to 1 if you have the header file. */ -#define HAVE_DIRECT_H 1 - -/* Define to 1 if you have the `ftruncate' function. */ -/* #undef HAVE_FTRUNCATE */ - -/* Define to 1 if you have the `getcwd' function. */ -#define HAVE_GETCWD 1 - -/* */ -/* #undef HAVE_GETTEXT */ - -/* Define if you have the GNU C Library */ -/* #undef HAVE_GNU_C_LIBRARY */ - -/* Define if you have the iconv() function. */ -/* #undef HAVE_ICONV */ - -/* Define if you have the header file. */ -/* #undef HAVE_INTTYPES_H */ - -/* */ -/* #undef HAVE_LC_MESSAGES */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_LIBGEN_H */ - -/* Define if you have the header file. */ -/* #undef HAVE_MEMORY_H */ - -/* Define if you have the `mergesort' function. */ -/* #undef HAVE_MERGESORT */ - -/* Define to 1 if you have the `popen' function. */ -/* #undef HAVE_POPEN */ - -/* Define if you have the header file. */ -/* #undef HAVE_STDINT_H */ - -/* Define if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* */ -/* #undef HAVE_STPCPY */ - -/* Define if you have the `strcasecmp' function. */ -/* #undef HAVE_STRCASECMP */ - -/* Define if you have the `strcmpi' function. */ -/* #undefine HAVE_STRCMPI */ - -/* Define if you have the `stricmp' function. */ -/* #undefine HAVE_STRICMP */ - -/* Define if you have the header file. */ -/* #undef HAVE_STRINGS_H */ - -/* Define if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define if you have the `strncasecmp' function. */ -/* #undef HAVE_STRNCASECMP */ - -/* Define if you have the `strsep' function. */ -/* #undef HAVE_STRSEP */ - -/* Define if you have the header file. */ -/* #undef HAVE_SYS_STAT_H */ - -/* Define if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define if you have the `toascii' function. */ -#define HAVE_TOASCII 1 -#define toascii __toascii - -/* Define if you have the header file. */ -/* #undef HAVE_UNISTD_H */ - -/* Define to 1 if you have the `vsnprintf' function. */ -/* #undef HAVE_VSNPRINTF */ - -/* Define to 1 if you have the `_stricmp' function. */ -#define HAVE__STRICMP 1 - -/* Name of package */ -#define PACKAGE "yasm" - -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "bug-yasm@tortall.net" - -/* Define to build version of this package. */ -#define PACKAGE_BUILD "HEAD" - -/* Define to internal version of this package. */ -#define PACKAGE_INTVER "0.7.99" - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "yasm" - -/* Define to the full name and version of this package. */ -#define PACKAGE_STRING "yasm HEAD" - -/* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "yasm" - -/* Define to the version of this package. */ -#define PACKAGE_VERSION "HEAD" - -/* Define if the C compiler supports function prototypes. */ -#define PROTOTYPES 1 - -/* The size of a `char', as computed by sizeof. */ -/* #undef SIZEOF_CHAR */ - -/* The size of a `int', as computed by sizeof. */ -/* #undef SIZEOF_INT */ - -/* The size of a `long', as computed by sizeof. */ -/* #undef SIZEOF_LONG */ - -/* The size of a `short', as computed by sizeof. */ -/* #undef SIZEOF_SHORT */ - -/* The size of a `void*', as computed by sizeof. */ -/* #undef SIZEOF_VOIDP */ - -/* Define if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Version number of package */ -#define VERSION "HEAD" - -/* Define if using the dmalloc debugging malloc package */ -/* #undef WITH_DMALLOC */ - -/* Define like PROTOTYPES; this can be used by system headers. */ -#define __PROTOTYPES 1 - -/* Define to empty if `const' does not conform to ANSI C. */ -/* #undef const */ - -/* Define as `__inline' if that's what the C compiler calls it, or to nothing - if it is not supported. */ -#ifndef __cplusplus -/* #undef inline */ -#endif - -/* Define to `unsigned' if doesn't define. */ -/* #undef size_t */ diff --git a/Mkfiles/vc/genmacro/genmacro.vcproj b/Mkfiles/vc/genmacro/genmacro.vcproj deleted file mode 100644 index 6ca8a82c..00000000 --- a/Mkfiles/vc/genmacro/genmacro.vcproj +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Mkfiles/vc/genmacro/run.bat b/Mkfiles/vc/genmacro/run.bat deleted file mode 100644 index d2fbb98c..00000000 --- a/Mkfiles/vc/genmacro/run.bat +++ /dev/null @@ -1,5 +0,0 @@ -cd ..\..\.. -%1 nasm-version.c nasm_version_mac version.mac -%1 nasm-macros.c nasm_standard_mac modules\parsers\nasm\nasm-std.mac -%1 win64-nasm.c win64_nasm_stdmac modules\objfmts\coff\win64-nasm.mac -%1 win64-gas.c win64_gas_stdmac modules\objfmts\coff\win64-gas.mac diff --git a/Mkfiles/vc/genmodule/genmodule.vcproj b/Mkfiles/vc/genmodule/genmodule.vcproj deleted file mode 100644 index 0cd85b27..00000000 --- a/Mkfiles/vc/genmodule/genmodule.vcproj +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Mkfiles/vc/genmodule/run.bat b/Mkfiles/vc/genmodule/run.bat deleted file mode 100644 index e34a4169..00000000 --- a/Mkfiles/vc/genmodule/run.bat +++ /dev/null @@ -1,3 +0,0 @@ -@echo off -cd ..\..\.. -%1 libyasm\module.in Makefile.am diff --git a/Mkfiles/vc/genperf/genperf.vcproj b/Mkfiles/vc/genperf/genperf.vcproj deleted file mode 100644 index a0d9f4d4..00000000 --- a/Mkfiles/vc/genperf/genperf.vcproj +++ /dev/null @@ -1,158 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Mkfiles/vc/genperf/run.bat b/Mkfiles/vc/genperf/run.bat deleted file mode 100644 index 64ec1ae3..00000000 --- a/Mkfiles/vc/genperf/run.bat +++ /dev/null @@ -1,19 +0,0 @@ -cd ..\..\.. -@echo off -reg query HKCR\Python.File\shell\open\command >nul: 2>&1 -goto answer%errorlevel% -:answer0 -echo ... building with Python ... -@echo on -modules\arch\x86\gen_x86_insn.py -@echo off -goto end -:answer1 -echo ... building without Python ... -goto end -:end -@echo on -%1 x86insn_nasm.gperf x86insn_nasm.c -%1 x86insn_gas.gperf x86insn_gas.c -%1 modules\arch\x86\x86cpu.gperf x86cpu.c -%1 modules\arch\x86\x86regtmod.gperf x86regtmod.c diff --git a/Mkfiles/vc/genstring/genstring.vcproj b/Mkfiles/vc/genstring/genstring.vcproj deleted file mode 100644 index cc1ba413..00000000 --- a/Mkfiles/vc/genstring/genstring.vcproj +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Mkfiles/vc/genstring/run.bat b/Mkfiles/vc/genstring/run.bat deleted file mode 100644 index 5864b1dc..00000000 --- a/Mkfiles/vc/genstring/run.bat +++ /dev/null @@ -1,2 +0,0 @@ -cd ..\..\.. -%1 license_msg license.c COPYING diff --git a/Mkfiles/vc/genversion/genversion.vcproj b/Mkfiles/vc/genversion/genversion.vcproj deleted file mode 100644 index 62e252d3..00000000 --- a/Mkfiles/vc/genversion/genversion.vcproj +++ /dev/null @@ -1,137 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Mkfiles/vc/genversion/run.bat b/Mkfiles/vc/genversion/run.bat deleted file mode 100644 index 30edf8f1..00000000 --- a/Mkfiles/vc/genversion/run.bat +++ /dev/null @@ -1,2 +0,0 @@ -cd ..\..\.. -%1 version.mac diff --git a/Mkfiles/vc/libyasm-stdint.h b/Mkfiles/vc/libyasm-stdint.h deleted file mode 100644 index fed61b33..00000000 --- a/Mkfiles/vc/libyasm-stdint.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef _UINTPTR_T_DEFINED -#ifdef _WIN64 -#include -#else -typedef unsigned long uintptr_t; -#endif -#define _UINTPTR_T_DEFINED -#endif diff --git a/Mkfiles/vc/libyasm/libyasm.vcproj b/Mkfiles/vc/libyasm/libyasm.vcproj deleted file mode 100644 index 43ab409c..00000000 --- a/Mkfiles/vc/libyasm/libyasm.vcproj +++ /dev/null @@ -1,305 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Mkfiles/vc/modules/modules.vcproj b/Mkfiles/vc/modules/modules.vcproj deleted file mode 100644 index 5fe66b20..00000000 --- a/Mkfiles/vc/modules/modules.vcproj +++ /dev/null @@ -1,336 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Mkfiles/vc/re2c/re2c.vcproj b/Mkfiles/vc/re2c/re2c.vcproj deleted file mode 100644 index 13579b6e..00000000 --- a/Mkfiles/vc/re2c/re2c.vcproj +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Mkfiles/vc/re2c/run.bat b/Mkfiles/vc/re2c/run.bat deleted file mode 100644 index cde2a7b6..00000000 --- a/Mkfiles/vc/re2c/run.bat +++ /dev/null @@ -1,4 +0,0 @@ -cd ..\..\..\ -%1 -s -o lc3bid.c modules\arch\lc3b\lc3bid.re -%1 -b -o nasm-token.c modules\parsers\nasm\nasm-token.re -%1 -b -o gas-token.c modules\parsers\gas\gas-token.re diff --git a/Mkfiles/vc/yasm.sln b/Mkfiles/vc/yasm.sln deleted file mode 100644 index b0fd177f..00000000 --- a/Mkfiles/vc/yasm.sln +++ /dev/null @@ -1,95 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libyasm", "libyasm\libyasm.vcproj", "{29FE7874-1256-4AD6-B889-68E399DC9608}" - ProjectSection(ProjectDependencies) = postProject - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0} = {F0E8B707-00C5-4FF2-B8EF-7C39817132A0} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "modules", "modules\modules.vcproj", "{D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}" - ProjectSection(ProjectDependencies) = postProject - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619} = {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619} - {225700A5-07B8-434E-AD61-555278BF6733} = {225700A5-07B8-434E-AD61-555278BF6733} - {29FE7874-1256-4AD6-B889-68E399DC9608} = {29FE7874-1256-4AD6-B889-68E399DC9608} - {3C58BE13-50A3-4583-984D-D8902B3D7713} = {3C58BE13-50A3-4583-984D-D8902B3D7713} - {5758BF4E-ABC4-11DA-B012-B622A1EF5492} = {5758BF4E-ABC4-11DA-B012-B622A1EF5492} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yasm", "yasm.vcproj", "{34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}" - ProjectSection(ProjectDependencies) = postProject - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6} = {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6} - {29FE7874-1256-4AD6-B889-68E399DC9608} = {29FE7874-1256-4AD6-B889-68E399DC9608} - {021CEB0A-F721-4F59-B349-9CEEAF244459} = {021CEB0A-F721-4F59-B349-9CEEAF244459} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genmacro", "genmacro\genmacro.vcproj", "{225700A5-07B8-434E-AD61-555278BF6733}" - ProjectSection(ProjectDependencies) = postProject - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2} = {B545983B-8EE0-4A7B-A67A-E749EEAE62A2} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genversion", "genversion\genversion.vcproj", "{B545983B-8EE0-4A7B-A67A-E749EEAE62A2}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "re2c", "re2c\re2c.vcproj", "{3C58BE13-50A3-4583-984D-D8902B3D7713}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genperf", "genperf\genperf.vcproj", "{C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genmodule", "genmodule\genmodule.vcproj", "{F0E8B707-00C5-4FF2-B8EF-7C39817132A0}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genstring", "genstring\genstring.vcproj", "{021CEB0A-F721-4F59-B349-9CEEAF244459}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Release = Release - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug.ActiveCfg = Debug|Win32 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug.Build.0 = Debug|Win32 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Release.ActiveCfg = Release|Win32 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Release.Build.0 = Release|Win32 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug.ActiveCfg = Debug|Win32 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug.Build.0 = Debug|Win32 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release.ActiveCfg = Release|Win32 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release.Build.0 = Release|Win32 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug.ActiveCfg = Debug|Win32 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug.Build.0 = Debug|Win32 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release.ActiveCfg = Release|Win32 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release.Build.0 = Release|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Debug.ActiveCfg = Debug|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Debug.Build.0 = Debug|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Release.ActiveCfg = Release|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Release.Build.0 = Release|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug.ActiveCfg = Debug|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug.Build.0 = Debug|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release.ActiveCfg = Release|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release.Build.0 = Release|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug.ActiveCfg = Debug|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug.Build.0 = Debug|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release.ActiveCfg = Release|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release.Build.0 = Release|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug.ActiveCfg = Debug|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug.Build.0 = Debug|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release.ActiveCfg = Release|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release.Build.0 = Release|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug.ActiveCfg = Debug|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug.Build.0 = Debug|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release.ActiveCfg = Release|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release.Build.0 = Release|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug.ActiveCfg = Debug|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug.Build.0 = Debug|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release.ActiveCfg = Release|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/Mkfiles/vc/yasm.vcproj b/Mkfiles/vc/yasm.vcproj deleted file mode 100644 index 70a25a9f..00000000 --- a/Mkfiles/vc/yasm.vcproj +++ /dev/null @@ -1,161 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Mkfiles/vc8/config.h b/Mkfiles/vc8/config.h deleted file mode 100644 index 96e2dddc..00000000 --- a/Mkfiles/vc8/config.h +++ /dev/null @@ -1,177 +0,0 @@ -/* $Id: config.h 1137 2004-09-04 01:24:57Z peter $ */ - -#define yasm__splitpath(path, tail) yasm__splitpath_win(path, tail) -#define yasm__abspath(path) yasm__abspath_win(path) -#define yasm__combpath(from, to) yasm__combpath_win(from, to) - -/* Command name to run C preprocessor */ -#define CPP_PROG "cpp" - -/* */ -/* #undef ENABLE_NLS */ - -/* Define if you have the `abort' function. */ -#define HAVE_ABORT 1 - -/* */ -/* #undef HAVE_CATGETS */ - -/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the - CoreFoundation framework. */ -/* #undef HAVE_CFLOCALECOPYCURRENT */ - -/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in - the CoreFoundation framework. */ -/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ - -/* Define if the GNU dcgettext() function is already present or preinstalled. - */ -/* #undef HAVE_DCGETTEXT */ - -/* Define to 1 if you have the header file. */ -#define HAVE_DIRECT_H 1 - -/* Define to 1 if you have the `getcwd' function. */ -#define HAVE_GETCWD 1 - -/* */ -/* #undef HAVE_GETTEXT */ - -/* Define if you have the GNU C Library */ -/* #undef HAVE_GNU_C_LIBRARY */ - -/* Define if you have the iconv() function. */ -/* #undef HAVE_ICONV */ - -/* Define if you have the header file. */ -/* #undef HAVE_INTTYPES_H */ - -/* */ -/* #undef HAVE_LC_MESSAGES */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_LIBGEN_H */ - -/* Define if you have the header file. */ -/* #undef HAVE_MEMORY_H */ - -/* Define if you have the `mergesort' function. */ -/* #undef HAVE_MERGESORT */ - -/* Define to 1 if you have the `popen' function. */ -/* #undef HAVE_POPEN */ - -/* Define if you have the header file. */ -/* #undef HAVE_STDINT_H */ - -/* Define if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* */ -/* #undef HAVE_STPCPY */ - -/* Define if you have the `strcasecmp' function. */ -/* #undef HAVE_STRCASECMP */ - -/* Define if you have the `strcmpi' function. */ -/* #undef HAVE_STRCMPI */ - -/* Define if you have the `stricmp' function. */ -/* #undefine HAVE_STRICMP */ - -/* Define if you have the header file. */ -/* #undef HAVE_STRINGS_H */ - -/* Define if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define if you have the `strncasecmp' function. */ -/* #undef HAVE_STRNCASECMP */ - -/* Define if you have the `strsep' function. */ -/* #undef HAVE_STRSEP */ - -/* Define if you have the header file. */ -/* #undef HAVE_SYS_STAT_H */ - -/* Define if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define if you have the `toascii' function. */ -#define HAVE_TOASCII 1 -#define toascii __toascii - -/* Define if you have the header file. */ -/* #undef HAVE_UNISTD_H */ - -/* Define to 1 if you have the `vsnprintf' function. */ -/* #undef HAVE_VSNPRINTF */ - -/* Define to 1 if you have the `_stricmp' function. */ -#define HAVE__STRICMP 1 - -/* Name of package */ -#define PACKAGE "yasm" - -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "bug-yasm@tortall.net" - -/* Define to build version of this package. */ -#define PACKAGE_BUILD "HEAD" - -/* Define to internal version of this package. */ -#define PACKAGE_INTVER "0.7.99" - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "yasm" - -/* Define to the full name and version of this package. */ -#define PACKAGE_STRING "yasm HEAD" - -/* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "yasm" - -/* Define to the version of this package. */ -#define PACKAGE_VERSION "HEAD" - -/* Define if the C compiler supports function prototypes. */ -#define PROTOTYPES 1 - -/* The size of a `char', as computed by sizeof. */ -/* #undef SIZEOF_CHAR */ - -/* The size of a `int', as computed by sizeof. */ -/* #undef SIZEOF_INT */ - -/* The size of a `long', as computed by sizeof. */ -/* #undef SIZEOF_LONG */ - -/* The size of a `short', as computed by sizeof. */ -/* #undef SIZEOF_SHORT */ - -/* The size of a `void*', as computed by sizeof. */ -/* #undef SIZEOF_VOIDP */ - -/* Define if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Version number of package */ -#define VERSION "HEAD" - -/* Define if using the dmalloc debugging malloc package */ -/* #undef WITH_DMALLOC */ - -/* Define like PROTOTYPES; this can be used by system headers. */ -#define __PROTOTYPES 1 - -/* Define to empty if `const' does not conform to ANSI C. */ -/* #undef const */ - -/* Define as `__inline' if that's what the C compiler calls it, or to nothing - if it is not supported. */ -#ifndef __cplusplus -/* #undef inline */ -#endif - -/* Define to `unsigned' if doesn't define. */ -/* #undef size_t */ diff --git a/Mkfiles/vc8/crt_secure_no_deprecate.vsprops b/Mkfiles/vc8/crt_secure_no_deprecate.vsprops deleted file mode 100644 index d61ba30a..00000000 --- a/Mkfiles/vc8/crt_secure_no_deprecate.vsprops +++ /dev/null @@ -1,11 +0,0 @@ - - - - diff --git a/Mkfiles/vc8/genmacro/genmacro.vcproj b/Mkfiles/vc8/genmacro/genmacro.vcproj deleted file mode 100644 index c004697d..00000000 --- a/Mkfiles/vc8/genmacro/genmacro.vcproj +++ /dev/null @@ -1,201 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Mkfiles/vc8/genmacro/run.bat b/Mkfiles/vc8/genmacro/run.bat deleted file mode 100644 index d2fbb98c..00000000 --- a/Mkfiles/vc8/genmacro/run.bat +++ /dev/null @@ -1,5 +0,0 @@ -cd ..\..\.. -%1 nasm-version.c nasm_version_mac version.mac -%1 nasm-macros.c nasm_standard_mac modules\parsers\nasm\nasm-std.mac -%1 win64-nasm.c win64_nasm_stdmac modules\objfmts\coff\win64-nasm.mac -%1 win64-gas.c win64_gas_stdmac modules\objfmts\coff\win64-gas.mac diff --git a/Mkfiles/vc8/genmodule/genmodule.vcproj b/Mkfiles/vc8/genmodule/genmodule.vcproj deleted file mode 100644 index b55f7125..00000000 --- a/Mkfiles/vc8/genmodule/genmodule.vcproj +++ /dev/null @@ -1,203 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Mkfiles/vc8/genmodule/run.bat b/Mkfiles/vc8/genmodule/run.bat deleted file mode 100644 index e34a4169..00000000 --- a/Mkfiles/vc8/genmodule/run.bat +++ /dev/null @@ -1,3 +0,0 @@ -@echo off -cd ..\..\.. -%1 libyasm\module.in Makefile.am diff --git a/Mkfiles/vc8/genperf/genperf.vcproj b/Mkfiles/vc8/genperf/genperf.vcproj deleted file mode 100644 index 0bb6bd67..00000000 --- a/Mkfiles/vc8/genperf/genperf.vcproj +++ /dev/null @@ -1,233 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Mkfiles/vc8/genperf/run.bat b/Mkfiles/vc8/genperf/run.bat deleted file mode 100644 index 64ec1ae3..00000000 --- a/Mkfiles/vc8/genperf/run.bat +++ /dev/null @@ -1,19 +0,0 @@ -cd ..\..\.. -@echo off -reg query HKCR\Python.File\shell\open\command >nul: 2>&1 -goto answer%errorlevel% -:answer0 -echo ... building with Python ... -@echo on -modules\arch\x86\gen_x86_insn.py -@echo off -goto end -:answer1 -echo ... building without Python ... -goto end -:end -@echo on -%1 x86insn_nasm.gperf x86insn_nasm.c -%1 x86insn_gas.gperf x86insn_gas.c -%1 modules\arch\x86\x86cpu.gperf x86cpu.c -%1 modules\arch\x86\x86regtmod.gperf x86regtmod.c diff --git a/Mkfiles/vc8/genstring/genstring.vcproj b/Mkfiles/vc8/genstring/genstring.vcproj deleted file mode 100644 index 9910c8b4..00000000 --- a/Mkfiles/vc8/genstring/genstring.vcproj +++ /dev/null @@ -1,201 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Mkfiles/vc8/genstring/run.bat b/Mkfiles/vc8/genstring/run.bat deleted file mode 100644 index 5864b1dc..00000000 --- a/Mkfiles/vc8/genstring/run.bat +++ /dev/null @@ -1,2 +0,0 @@ -cd ..\..\.. -%1 license_msg license.c COPYING diff --git a/Mkfiles/vc8/genversion/genversion.vcproj b/Mkfiles/vc8/genversion/genversion.vcproj deleted file mode 100644 index c65952fa..00000000 --- a/Mkfiles/vc8/genversion/genversion.vcproj +++ /dev/null @@ -1,212 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Mkfiles/vc8/genversion/run.bat b/Mkfiles/vc8/genversion/run.bat deleted file mode 100644 index 30edf8f1..00000000 --- a/Mkfiles/vc8/genversion/run.bat +++ /dev/null @@ -1,2 +0,0 @@ -cd ..\..\.. -%1 version.mac diff --git a/Mkfiles/vc8/libyasm-stdint.h b/Mkfiles/vc8/libyasm-stdint.h deleted file mode 100644 index fed61b33..00000000 --- a/Mkfiles/vc8/libyasm-stdint.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef _UINTPTR_T_DEFINED -#ifdef _WIN64 -#include -#else -typedef unsigned long uintptr_t; -#endif -#define _UINTPTR_T_DEFINED -#endif diff --git a/Mkfiles/vc8/libyasm/libyasm.vcproj b/Mkfiles/vc8/libyasm/libyasm.vcproj deleted file mode 100644 index efbcf4c4..00000000 --- a/Mkfiles/vc8/libyasm/libyasm.vcproj +++ /dev/null @@ -1,571 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Mkfiles/vc8/modules/modules.vcproj b/Mkfiles/vc8/modules/modules.vcproj deleted file mode 100644 index 38024723..00000000 --- a/Mkfiles/vc8/modules/modules.vcproj +++ /dev/null @@ -1,593 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Mkfiles/vc8/re2c/re2c.vcproj b/Mkfiles/vc8/re2c/re2c.vcproj deleted file mode 100644 index 84de9b8b..00000000 --- a/Mkfiles/vc8/re2c/re2c.vcproj +++ /dev/null @@ -1,281 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Mkfiles/vc8/re2c/run.bat b/Mkfiles/vc8/re2c/run.bat deleted file mode 100644 index cde2a7b6..00000000 --- a/Mkfiles/vc8/re2c/run.bat +++ /dev/null @@ -1,4 +0,0 @@ -cd ..\..\..\ -%1 -s -o lc3bid.c modules\arch\lc3b\lc3bid.re -%1 -b -o nasm-token.c modules\parsers\nasm\nasm-token.re -%1 -b -o gas-token.c modules\parsers\gas\gas-token.re diff --git a/Mkfiles/vc8/readme.vc8.txt b/Mkfiles/vc8/readme.vc8.txt deleted file mode 100644 index 03741bfa..00000000 --- a/Mkfiles/vc8/readme.vc8.txt +++ /dev/null @@ -1,98 +0,0 @@ - -Building YASM with Microsoft Visual Studio 2005 ------------------------------------------------ - -This note describes how to build YASM using Microsoft Visual Studio 2005. - -1. The Compiler ---------------- - -If you want to build the 64-bit version of YASM you will need to install -the Visual Studio 2005 64-bit tools, which are not installed by default. - -2. YASM Download ----------------- - -First YASM needs to be downloaded and the files placed within a suitable -directory, which will be called here but can be named and located -as you wish. - -3. Building YASM with Microsoft VC8 ------------------------------------ - -Now locate and double click on the yasm.sln solution file in the 'Mkfiles/vc8' -subdirectory to open the build project in the Visual Studio 2005 IDE and then -select: - - win32 or x64 build - release or debug build - -as appropriate to build the YASM binaries that you need. - -4. Using YASM with Visual Sudio 2005 and VC++ version 8 -------------------------------------------------------- - -1. Firstly you need to locate the directory (or directories) where the VC++ -compiler binaries are located and put copies of the appropriate yasm.exe -binary in these directories. - -On a win32 system you will use the win32 version of YASM. On an x64 system -you can use either the 32 or the 64 bit versions. The win32 YASM binary -should be placed in the 32-bit VC++ binary directory, which is typically -located at: - - Program Files (x86)\Microsoft Visual Studio 8\VC\bin - -If needed the 64-bit YASM binary should be places in the 64-bit tools -binary directory, which is typically at: - - Program Files\Microsoft Visual Studio 8\VC\bin - -2. To use the new custom tools facility in Visual Studio 2005, you need to -place a copy of the yasm.rules file in the Visual Studio 2005 VC project -defaults directory, which is typically located at: - - Program Files (x86)\Microsoft Visual Studio 8\VC\VCProjectDefaults - -This allows you to configure YASM as an assembler within the VC++ IDE. To -use YASM in a project, right click on the project in the Solution Explorer -and select 'Custom Build Rules..'. This will give you a dialog box that -allows you to select YASM as an assembler (note that your assembler files -need to have the extension '.asm'). - -To assemble a file with YASM, select the Property Page for the file and the -select 'Yasm Assembler' in the Tool dialog entry. Then click 'Apply' and an -additional property page entry will appear and enable YASM settings to be -established. - -As alternative to placing the yasm.rules files as described above is to set -the rules file path in the Visual Studio 2005 settings dialogue. - -It is also important to note that the rules file passes the symbols 'Win32' -or 'x64' to YASM by using the Visual Studio 2005 $(PlatformName) macro in -order to obtain either a 32 or a 64 bit assembler mode. This is a recent -enhancement to YASM so you will need to be sure that your YASM files are at -revision r1331 or higher to use this facility. - -5. A Linker Issue ------------------ - -There appears to be a linker bug in the VC++ v8 linker that prevents symbols -with absolute addresses being linked in DLL builds. This means, for example, -that LEA instructions of the general form: - - lea, rax,[rax+symbol] - -cannot be used for DLL builds. The following general form has to be used -instead: - - lea rcx,[symbol wrt rip] - lea rax,[rax+rcx] - -This limitation may also cause problems with other instruction that use -absolute addresses. - -I am most grateful for the fantastic support that Peter Johnson, YASM's -creator, has given me in tracking down this issue. - - Brian Gladman, 16th January 2006 diff --git a/Mkfiles/vc8/yasm.rules b/Mkfiles/vc8/yasm.rules deleted file mode 100644 index f2e2eccc..00000000 --- a/Mkfiles/vc8/yasm.rules +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Mkfiles/vc8/yasm.sln b/Mkfiles/vc8/yasm.sln deleted file mode 100644 index 03c56f63..00000000 --- a/Mkfiles/vc8/yasm.sln +++ /dev/null @@ -1,128 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libyasm", "libyasm\libyasm.vcproj", "{29FE7874-1256-4AD6-B889-68E399DC9608}" - ProjectSection(ProjectDependencies) = postProject - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0} = {F0E8B707-00C5-4FF2-B8EF-7C39817132A0} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "modules", "modules\modules.vcproj", "{D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}" - ProjectSection(ProjectDependencies) = postProject - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619} = {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619} - {225700A5-07B8-434E-AD61-555278BF6733} = {225700A5-07B8-434E-AD61-555278BF6733} - {29FE7874-1256-4AD6-B889-68E399DC9608} = {29FE7874-1256-4AD6-B889-68E399DC9608} - {3C58BE13-50A3-4583-984D-D8902B3D7713} = {3C58BE13-50A3-4583-984D-D8902B3D7713} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yasm", "yasm.vcproj", "{34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}" - ProjectSection(ProjectDependencies) = postProject - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6} = {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6} - {29FE7874-1256-4AD6-B889-68E399DC9608} = {29FE7874-1256-4AD6-B889-68E399DC9608} - {021CEB0A-F721-4F59-B349-9CEEAF244459} = {021CEB0A-F721-4F59-B349-9CEEAF244459} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genmacro", "genmacro\genmacro.vcproj", "{225700A5-07B8-434E-AD61-555278BF6733}" - ProjectSection(ProjectDependencies) = postProject - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2} = {B545983B-8EE0-4A7B-A67A-E749EEAE62A2} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genversion", "genversion\genversion.vcproj", "{B545983B-8EE0-4A7B-A67A-E749EEAE62A2}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "re2c", "re2c\re2c.vcproj", "{3C58BE13-50A3-4583-984D-D8902B3D7713}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genperf", "genperf\genperf.vcproj", "{C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genmodule", "genmodule\genmodule.vcproj", "{F0E8B707-00C5-4FF2-B8EF-7C39817132A0}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genstring", "genstring\genstring.vcproj", "{021CEB0A-F721-4F59-B349-9CEEAF244459}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{825AC694-358C-4D8D-92DE-33A2691978CE}" - ProjectSection(SolutionItems) = preProject - crt_secure_no_deprecate.vsprops = crt_secure_no_deprecate.vsprops - readme.vc8.txt = readme.vc8.txt - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|Win32.ActiveCfg = Debug|Win32 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|Win32.Build.0 = Debug|Win32 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|x64.ActiveCfg = Debug|x64 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|x64.Build.0 = Debug|x64 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|Win32.ActiveCfg = Release|Win32 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|Win32.Build.0 = Release|Win32 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|x64.ActiveCfg = Release|x64 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|x64.Build.0 = Release|x64 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|Win32.ActiveCfg = Debug|Win32 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|Win32.Build.0 = Debug|Win32 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|x64.ActiveCfg = Debug|x64 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|x64.Build.0 = Debug|x64 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|Win32.ActiveCfg = Release|Win32 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|Win32.Build.0 = Release|Win32 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|x64.ActiveCfg = Release|x64 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|x64.Build.0 = Release|x64 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|Win32.ActiveCfg = Debug|Win32 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|Win32.Build.0 = Debug|Win32 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|x64.ActiveCfg = Debug|x64 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|x64.Build.0 = Debug|x64 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|Win32.ActiveCfg = Release|Win32 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|Win32.Build.0 = Release|Win32 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|x64.ActiveCfg = Release|x64 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|x64.Build.0 = Release|x64 - {225700A5-07B8-434E-AD61-555278BF6733}.Debug|Win32.ActiveCfg = Debug|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Debug|Win32.Build.0 = Debug|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Debug|x64.ActiveCfg = Debug|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Debug|x64.Build.0 = Debug|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Release|Win32.ActiveCfg = Release|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Release|Win32.Build.0 = Release|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Release|x64.ActiveCfg = Release|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Release|x64.Build.0 = Release|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|Win32.ActiveCfg = Debug|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|Win32.Build.0 = Debug|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|x64.ActiveCfg = Debug|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|x64.Build.0 = Debug|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|Win32.ActiveCfg = Release|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|Win32.Build.0 = Release|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|x64.ActiveCfg = Release|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|x64.Build.0 = Release|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|Win32.ActiveCfg = Debug|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|Win32.Build.0 = Debug|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|x64.ActiveCfg = Debug|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|x64.Build.0 = Debug|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|Win32.ActiveCfg = Release|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|Win32.Build.0 = Release|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|x64.ActiveCfg = Release|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|x64.Build.0 = Release|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|Win32.ActiveCfg = Debug|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|Win32.Build.0 = Debug|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|x64.ActiveCfg = Debug|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|x64.Build.0 = Debug|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|Win32.ActiveCfg = Release|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|Win32.Build.0 = Release|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|x64.ActiveCfg = Release|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|x64.Build.0 = Release|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|Win32.ActiveCfg = Debug|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|Win32.Build.0 = Debug|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|x64.ActiveCfg = Debug|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|x64.Build.0 = Debug|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|Win32.ActiveCfg = Release|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|Win32.Build.0 = Release|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|x64.ActiveCfg = Release|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|x64.Build.0 = Release|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|Win32.ActiveCfg = Debug|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|Win32.Build.0 = Debug|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|x64.ActiveCfg = Debug|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|x64.Build.0 = Debug|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|Win32.ActiveCfg = Release|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|Win32.Build.0 = Release|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|x64.ActiveCfg = Release|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|x64.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/Mkfiles/vc8/yasm.vcproj b/Mkfiles/vc8/yasm.vcproj deleted file mode 100644 index ef4eab3a..00000000 --- a/Mkfiles/vc8/yasm.vcproj +++ /dev/null @@ -1,413 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 338a832c3478deb9360bd5638a0201f5565a96a9 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 24 Mar 2009 06:33:32 +0000 Subject: [PATCH 261/585] Fix #155: Don't crash on missing %endmacro. We were crashing because we didn't generate this error until the preproc module was getting cleaned up, which doesn't happen until after linemap is cleaned up. Instead detect and output this error when we reach the end of preprocessed tokens during the parsing stage. svn path=/trunk/yasm/; revision=2185 --- modules/preprocs/nasm/nasm-pp.c | 12 ++++++++---- modules/preprocs/nasm/nasm-preproc.c | 3 +++ modules/preprocs/nasm/tests/Makefile.inc | 2 ++ modules/preprocs/nasm/tests/macroeof-err.asm | 1 + modules/preprocs/nasm/tests/macroeof-err.errwarn | 1 + 5 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 modules/preprocs/nasm/tests/macroeof-err.asm create mode 100644 modules/preprocs/nasm/tests/macroeof-err.errwarn diff --git a/modules/preprocs/nasm/nasm-pp.c b/modules/preprocs/nasm/nasm-pp.c index 77865c4e..0bbb0f3a 100644 --- a/modules/preprocs/nasm/nasm-pp.c +++ b/modules/preprocs/nasm/nasm-pp.c @@ -5017,11 +5017,15 @@ pp_cleanup(int pass_) { int h; - if (defining) + if (pass_ == 1) { - error(ERR_NONFATAL, "end of file while still defining macro `%s'", - defining->name); - free_mmacro(defining); + if (defining) + { + error(ERR_NONFATAL, "end of file while still defining macro `%s'", + defining->name); + free_mmacro(defining); + } + return; } while (cstk) ctx_pop(); diff --git a/modules/preprocs/nasm/nasm-preproc.c b/modules/preprocs/nasm/nasm-preproc.c index fa2b91e7..011831b4 100644 --- a/modules/preprocs/nasm/nasm-preproc.c +++ b/modules/preprocs/nasm/nasm-preproc.c @@ -195,7 +195,10 @@ nasm_preproc_get_line(yasm_preproc *preproc) line = nasmpp.getline(); if (!line) + { + nasmpp.cleanup(1); return NULL; /* EOF */ + } linnum = preproc_nasm->prior_linnum += preproc_nasm->lineinc; altline = nasm_src_get(&linnum, &preproc_nasm->file_name); diff --git a/modules/preprocs/nasm/tests/Makefile.inc b/modules/preprocs/nasm/tests/Makefile.inc index 6d7dcfb5..375316ac 100644 --- a/modules/preprocs/nasm/tests/Makefile.inc +++ b/modules/preprocs/nasm/tests/Makefile.inc @@ -9,6 +9,8 @@ EXTRA_DIST += modules/preprocs/nasm/tests/ifcritical-err.asm EXTRA_DIST += modules/preprocs/nasm/tests/ifcritical-err.errwarn EXTRA_DIST += modules/preprocs/nasm/tests/longline.asm EXTRA_DIST += modules/preprocs/nasm/tests/longline.hex +EXTRA_DIST += modules/preprocs/nasm/tests/macroeof-err.asm +EXTRA_DIST += modules/preprocs/nasm/tests/macroeof-err.errwarn EXTRA_DIST += modules/preprocs/nasm/tests/noinclude-err.asm EXTRA_DIST += modules/preprocs/nasm/tests/noinclude-err.errwarn EXTRA_DIST += modules/preprocs/nasm/tests/nasmpp-bigint.asm diff --git a/modules/preprocs/nasm/tests/macroeof-err.asm b/modules/preprocs/nasm/tests/macroeof-err.asm new file mode 100644 index 00000000..dd51488b --- /dev/null +++ b/modules/preprocs/nasm/tests/macroeof-err.asm @@ -0,0 +1 @@ +%macro foo 0 diff --git a/modules/preprocs/nasm/tests/macroeof-err.errwarn b/modules/preprocs/nasm/tests/macroeof-err.errwarn new file mode 100644 index 00000000..c92f71e4 --- /dev/null +++ b/modules/preprocs/nasm/tests/macroeof-err.errwarn @@ -0,0 +1 @@ +-:1: error: end of file while still defining macro `foo' From 6ad55c80ee6ffdb3ba531ca4a779a1debd400668 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 24 Mar 2009 06:47:38 +0000 Subject: [PATCH 262/585] Update copyright dates. svn path=/trunk/yasm/; revision=2188 --- COPYING | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/COPYING b/COPYING index 15265bcb..e5d99e28 100644 --- a/COPYING +++ b/COPYING @@ -1,4 +1,4 @@ -Yasm is Copyright (c) 2001-2008 Peter Johnson and other Yasm developers. +Yasm is Copyright (c) 2001-2009 Peter Johnson and other Yasm developers. Yasm developers and/or contributors include: Peter Johnson From ff21f3e607c91163253b74a63e5bac433a57a0ab Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 25 Mar 2009 03:40:59 +0000 Subject: [PATCH 263/585] Fix referencing of local label from line that defines nonlocal label. Reported by: Brian Gladman svn path=/trunk/yasm/; revision=2190 --- modules/parsers/nasm/nasm-parse.c | 29 ++++++++++++++-------- modules/parsers/nasm/tests/Makefile.inc | 2 ++ modules/parsers/nasm/tests/locallabel2.asm | 4 +++ modules/parsers/nasm/tests/locallabel2.hex | 2 ++ 4 files changed, 27 insertions(+), 10 deletions(-) create mode 100644 modules/parsers/nasm/tests/locallabel2.asm create mode 100644 modules/parsers/nasm/tests/locallabel2.hex diff --git a/modules/parsers/nasm/nasm-parse.c b/modules/parsers/nasm/nasm-parse.c index 0e80b582..6ec14fd0 100644 --- a/modules/parsers/nasm/nasm-parse.c +++ b/modules/parsers/nasm/nasm-parse.c @@ -62,8 +62,9 @@ static void nasm_parser_directive (yasm_parser_nasm *parser_nasm, const char *name, /*@null@*/ yasm_valparamhead *valparams, /*@null@*/ yasm_valparamhead *objext_valparams); +static void set_nonlocal_label(yasm_parser_nasm *parser_nasm, const char *name); static void define_label(yasm_parser_nasm *parser_nasm, /*@only@*/ char *name, - unsigned int size, int local); + unsigned int size); static void yasm_ea_set_implicit_size_segment(yasm_parser_nasm *parser_nasm, yasm_effaddr *ea, yasm_expr *e) @@ -384,7 +385,9 @@ parse_line(yasm_parser_nasm *parser_nasm) /* label alone on the line */ yasm_warn_set(YASM_WARN_ORPHAN_LABEL, N_("label alone on a line without a colon might be in error")); - define_label(parser_nasm, name, 0, local); + if (!local) + set_nonlocal_label(parser_nasm, name); + define_label(parser_nasm, name, 0); return NULL; } if (curtok == ':') @@ -420,12 +423,15 @@ parse_line(yasm_parser_nasm *parser_nasm) get_next_token(); } + if (!local) + set_nonlocal_label(parser_nasm, name); + if (is_eol()) { - define_label(parser_nasm, name, size, local); + define_label(parser_nasm, name, size); return NULL; } if (curtok == TIMES) { - define_label(parser_nasm, name, size, local); + define_label(parser_nasm, name, size); get_next_token(); return parse_times(parser_nasm); } @@ -435,7 +441,7 @@ parse_line(yasm_parser_nasm *parser_nasm) N_("instruction expected after label")); if (parser_nasm->tasm && bc && !size) size = yasm_bc_elem_size(bc); - define_label(parser_nasm, name, size, local); + define_label(parser_nasm, name, size); return bc; } default: @@ -1439,12 +1445,9 @@ parse_expr6(yasm_parser_nasm *parser_nasm, expr_type type) } static void -define_label(yasm_parser_nasm *parser_nasm, char *name, unsigned int size, - int local) +set_nonlocal_label(yasm_parser_nasm *parser_nasm, const char *name) { - yasm_symrec *symrec; - - if ((!parser_nasm->tasm || tasm_locals) && !local) { + if (!parser_nasm->tasm || tasm_locals) { if (parser_nasm->locallabel_base) yasm_xfree(parser_nasm->locallabel_base); parser_nasm->locallabel_base_len = strlen(name); @@ -1452,6 +1455,12 @@ define_label(yasm_parser_nasm *parser_nasm, char *name, unsigned int size, yasm_xmalloc(parser_nasm->locallabel_base_len+1); strcpy(parser_nasm->locallabel_base, name); } +} + +static void +define_label(yasm_parser_nasm *parser_nasm, char *name, unsigned int size) +{ + yasm_symrec *symrec; if (parser_nasm->abspos) symrec = yasm_symtab_define_equ(p_symtab, name, diff --git a/modules/parsers/nasm/tests/Makefile.inc b/modules/parsers/nasm/tests/Makefile.inc index f4589c3c..9a1d5db5 100644 --- a/modules/parsers/nasm/tests/Makefile.inc +++ b/modules/parsers/nasm/tests/Makefile.inc @@ -23,6 +23,8 @@ EXTRA_DIST += modules/parsers/nasm/tests/long.asm EXTRA_DIST += modules/parsers/nasm/tests/long.hex EXTRA_DIST += modules/parsers/nasm/tests/locallabel.asm EXTRA_DIST += modules/parsers/nasm/tests/locallabel.hex +EXTRA_DIST += modules/parsers/nasm/tests/locallabel2.asm +EXTRA_DIST += modules/parsers/nasm/tests/locallabel2.hex EXTRA_DIST += modules/parsers/nasm/tests/nasm-prefix.asm EXTRA_DIST += modules/parsers/nasm/tests/nasm-prefix.hex EXTRA_DIST += modules/parsers/nasm/tests/newsect.asm diff --git a/modules/parsers/nasm/tests/locallabel2.asm b/modules/parsers/nasm/tests/locallabel2.asm new file mode 100644 index 00000000..ea0f8c92 --- /dev/null +++ b/modules/parsers/nasm/tests/locallabel2.asm @@ -0,0 +1,4 @@ +nl1: +nl2:db .0 - nl2 +.0: db .1 - nl2 +.1: diff --git a/modules/parsers/nasm/tests/locallabel2.hex b/modules/parsers/nasm/tests/locallabel2.hex new file mode 100644 index 00000000..26334819 --- /dev/null +++ b/modules/parsers/nasm/tests/locallabel2.hex @@ -0,0 +1,2 @@ +01 +02 From 8bc9e295a55ed41577e3a7dd516d4f9510a87469 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 29 Mar 2009 23:25:05 +0000 Subject: [PATCH 264/585] Default memory size to "s" for no-suffix FP conversions in GAS syntax. Reported by: Gregory McGarry svn path=/trunk/yasm/; revision=2192 --- modules/arch/x86/gen_x86_insn.py | 16 + modules/arch/x86/tests/gas32/Makefile.inc | 2 + modules/arch/x86/tests/gas32/gas-fpmem.asm | 11 + modules/arch/x86/tests/gas32/gas-fpmem.hex | 376 +++++++++++++++++++++ 4 files changed, 405 insertions(+) create mode 100644 modules/arch/x86/tests/gas32/gas-fpmem.asm create mode 100644 modules/arch/x86/tests/gas32/gas-fpmem.hex diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index 271d3ffa..372454df 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -3096,6 +3096,14 @@ add_group("fildstp", opcode=[0xDD], spare=0, operands=[Operand(type="Mem", size=64, dest="EA")]) +# No-suffix alias for memory for GAS compat -> "s" version generated +add_group("fildstp", + cpu=["FPU"], + parsers=["gas"], + modifiers=["SpAdd"], + opcode=[0xDF], + spare=0, + operands=[Operand(type="Mem", size=16, relaxed=True, dest="EA")]) add_insn("fild", "fildstp", modifiers=[0, 2, 5]) add_insn("fistp", "fildstp", modifiers=[3, 2, 7]) @@ -3180,6 +3188,14 @@ add_group("fcom", modifiers=["Op1Add"], opcode=[0xD8, 0x00], operands=[Operand(type="Reg", size=80, dest="Op1Add")]) +# No-suffix alias for memory for GAS compat -> "s" version generated +add_group("fcom", + cpu=["FPU"], + parsers=["gas"], + modifiers=["Gap", "SpAdd"], + opcode=[0xD8], + spare=0, + operands=[Operand(type="Mem", size=32, relaxed=True, dest="EA")]) # Alias for fcom %st(1) for GAS compat add_group("fcom", cpu=["FPU"], diff --git a/modules/arch/x86/tests/gas32/Makefile.inc b/modules/arch/x86/tests/gas32/Makefile.inc index 80f22a40..10329f1d 100644 --- a/modules/arch/x86/tests/gas32/Makefile.inc +++ b/modules/arch/x86/tests/gas32/Makefile.inc @@ -7,6 +7,8 @@ EXTRA_DIST += modules/arch/x86/tests/gas32/align32.asm EXTRA_DIST += modules/arch/x86/tests/gas32/align32.hex EXTRA_DIST += modules/arch/x86/tests/gas32/gas-farithr.asm EXTRA_DIST += modules/arch/x86/tests/gas32/gas-farithr.hex +EXTRA_DIST += modules/arch/x86/tests/gas32/gas-fpmem.asm +EXTRA_DIST += modules/arch/x86/tests/gas32/gas-fpmem.hex EXTRA_DIST += modules/arch/x86/tests/gas32/gas-movdq32.asm EXTRA_DIST += modules/arch/x86/tests/gas32/gas-movdq32.hex EXTRA_DIST += modules/arch/x86/tests/gas32/gas-movsd.asm diff --git a/modules/arch/x86/tests/gas32/gas-fpmem.asm b/modules/arch/x86/tests/gas32/gas-fpmem.asm new file mode 100644 index 00000000..ca905308 --- /dev/null +++ b/modules/arch/x86/tests/gas32/gas-fpmem.asm @@ -0,0 +1,11 @@ +.text +fcomp +fcomp %st(1) +fcomp 0(%eax) +fcomps 0(%eax) +fcompl 0(%eax) + +fistp 0(%eax) +fistps 0(%eax) +fistpl 0(%eax) + diff --git a/modules/arch/x86/tests/gas32/gas-fpmem.hex b/modules/arch/x86/tests/gas32/gas-fpmem.hex new file mode 100644 index 00000000..81d6a3a0 --- /dev/null +++ b/modules/arch/x86/tests/gas32/gas-fpmem.hex @@ -0,0 +1,376 @@ +7f +45 +4c +46 +01 +01 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +03 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +b0 +00 +00 +00 +00 +00 +00 +00 +34 +00 +00 +00 +00 +00 +28 +00 +05 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +d8 +d9 +d8 +d9 +d8 +18 +d8 +18 +dc +18 +df +18 +df +18 +db +18 +00 +2e +74 +65 +78 +74 +00 +2e +73 +74 +72 +74 +61 +62 +00 +2e +73 +79 +6d +74 +61 +62 +00 +2e +73 +68 +73 +74 +72 +74 +61 +62 +00 +00 +00 +00 +00 +2d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +f1 +ff +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +17 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +50 +00 +00 +00 +21 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +07 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +74 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +0f +00 +00 +00 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +78 +00 +00 +00 +30 +00 +00 +00 +02 +00 +00 +00 +03 +00 +00 +00 +04 +00 +00 +00 +10 +00 +00 +00 +01 +00 +00 +00 +01 +00 +00 +00 +06 +00 +00 +00 +00 +00 +00 +00 +40 +00 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 From 88ffc998047d47137166bfa3bf4faed772d162be Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 17 Apr 2009 03:22:25 +0000 Subject: [PATCH 265/585] tasm parser: Support "not" keyword. Requested by: Rugxulo svn path=/trunk/yasm/; revision=2196 --- modules/parsers/nasm/nasm-token.re | 4 ++++ modules/parsers/tasm/tests/expr.asm | 1 + modules/parsers/tasm/tests/expr.hex | 1 + 3 files changed, 6 insertions(+) diff --git a/modules/parsers/nasm/nasm-token.re b/modules/parsers/nasm/nasm-token.re index eb44d208..6e9b3ca4 100644 --- a/modules/parsers/nasm/nasm-token.re +++ b/modules/parsers/nasm/nasm-token.re @@ -436,6 +436,10 @@ scan: s->tok[TOKLEN] = savech; RETURN('|'); } + if (!yasm__strcasecmp(TOK, "not")) { + s->tok[TOKLEN] = savech; + RETURN('~'); + } if (!yasm__strcasecmp(TOK, "low")) { s->tok[TOKLEN] = savech; RETURN(LOW); diff --git a/modules/parsers/tasm/tests/expr.asm b/modules/parsers/tasm/tests/expr.asm index 53198852..f5958cae 100644 --- a/modules/parsers/tasm/tests/expr.asm +++ b/modules/parsers/tasm/tests/expr.asm @@ -1 +1,2 @@ a db low ((1 shl 2) and (16 shr 2) or (high 0x5034)) +b db not 1 diff --git a/modules/parsers/tasm/tests/expr.hex b/modules/parsers/tasm/tests/expr.hex index d3c4f66b..c6b00472 100644 --- a/modules/parsers/tasm/tests/expr.hex +++ b/modules/parsers/tasm/tests/expr.hex @@ -1 +1,2 @@ 54 +fe From bccb81d575c229c453f06fa891c2e69efc557544 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 17 Apr 2009 03:25:08 +0000 Subject: [PATCH 266/585] tasm (tweaked nasm) preproc fixes: - comments stripped before tokenization caused strings containing ';' to generate warnings (unterminated string) and incorrect output. - assume directive parsing did not properly handle ';' as end of line Also add tests for the above. Reported by: Rugxulo svn path=/trunk/yasm/; revision=2197 --- modules/preprocs/Makefile.inc | 2 ++ modules/preprocs/nasm/nasm-pp.c | 23 +++++++++---------- modules/preprocs/tasm/Makefile.inc | 5 ++++ modules/preprocs/tasm/tests/Makefile.inc | 9 ++++++++ .../tasm/tests/tasm-assume-comment.asm | 3 +++ .../tasm/tests/tasm-assume-comment.hex | 0 .../tasm/tests/tasm-comment-instr.asm | 1 + .../tasm/tests/tasm-comment-instr.hex | 11 +++++++++ modules/preprocs/tasm/tests/tasmpp_test.sh | 4 ++++ 9 files changed, 46 insertions(+), 12 deletions(-) create mode 100644 modules/preprocs/tasm/Makefile.inc create mode 100644 modules/preprocs/tasm/tests/Makefile.inc create mode 100644 modules/preprocs/tasm/tests/tasm-assume-comment.asm create mode 100644 modules/preprocs/tasm/tests/tasm-assume-comment.hex create mode 100644 modules/preprocs/tasm/tests/tasm-comment-instr.asm create mode 100644 modules/preprocs/tasm/tests/tasm-comment-instr.hex create mode 100755 modules/preprocs/tasm/tests/tasmpp_test.sh diff --git a/modules/preprocs/Makefile.inc b/modules/preprocs/Makefile.inc index 8d3f7cfd..aee9accd 100644 --- a/modules/preprocs/Makefile.inc +++ b/modules/preprocs/Makefile.inc @@ -1,9 +1,11 @@ # $Id$ +EXTRA_DIST += modules/preprocs/tasm/Makefile.inc EXTRA_DIST += modules/preprocs/nasm/Makefile.inc EXTRA_DIST += modules/preprocs/raw/Makefile.inc EXTRA_DIST += modules/preprocs/cpp/Makefile.inc +include modules/preprocs/tasm/Makefile.inc include modules/preprocs/nasm/Makefile.inc include modules/preprocs/raw/Makefile.inc include modules/preprocs/cpp/Makefile.inc diff --git a/modules/preprocs/nasm/nasm-pp.c b/modules/preprocs/nasm/nasm-pp.c index 0bbb0f3a..64733557 100644 --- a/modules/preprocs/nasm/nasm-pp.c +++ b/modules/preprocs/nasm/nasm-pp.c @@ -538,13 +538,10 @@ check_tasm_directive(char *line) char *p, *oldline, oldchar, *q, oldchar2; TMEndItem *end; - if ((p = strchr(line, ';'))) - *p = '\0'; - p = line; /* Skip whitespace */ - while (isspace(*p) && *p != 0) + while (isspace(*p) && *p != 0 && *p != ';') p++; /* Ignore nasm directives */ @@ -553,7 +550,7 @@ check_tasm_directive(char *line) /* Binary search for the directive name */ len = 0; - while (!isspace(p[len]) && p[len] != 0) + while (!isspace(p[len]) && p[len] != 0 && p[len] != ';') len++; if (!len) return line; @@ -871,10 +868,10 @@ check_tasm_directive(char *line) /* Skip whitespaces */ while (isspace(*q) && *q) q++; - while (*q) { + while (*q && *q != ';') { p = q; - for (; *q && *q != ':' && !isspace(*q); q++); - if (!*q) + for (; *q && *q != ';' && *q != ':' && !isspace(*q); q++); + if (!*q || *q == ';') break; /* segment register name */ for (assume = TAssumes; assume->segreg; assume++) @@ -888,20 +885,22 @@ check_tasm_directive(char *line) assume->segreg = nasm_strndup(p, q-p); assume[1].segreg = NULL; } - for (; *q && *q != ':' && isspace(*q); q++); + for (; *q && *q != ';' && *q != ':' && isspace(*q); q++); if (*q != ':') error(ERR_FATAL, "expected `:' instead of `%c'", *q); for (q++; *q && isspace(*q); q++); /* segment name */ p = q; - for (; *q && *q != ',' && !isspace(*q); q++); + for (; *q && *q != ';' && *q != ',' && !isspace(*q); q++); assume->segment = nasm_strndup(p, q-p); for (; *q && isspace(*q); q++); - if (*q && *q != ',') + if (*q && *q != ';' && *q != ',') error(ERR_FATAL, "expected `,' instead of `%c'", *q); - for (q++; *q && isspace(*q); q++); + if (*q && *q != ';') + q++; + for (; *q && isspace(*q); q++); } TAssumes[i].segreg = NULL; TAssumes = nasm_realloc(TAssumes, (i+1)*sizeof(*TAssumes)); diff --git a/modules/preprocs/tasm/Makefile.inc b/modules/preprocs/tasm/Makefile.inc new file mode 100644 index 00000000..588a3e8f --- /dev/null +++ b/modules/preprocs/tasm/Makefile.inc @@ -0,0 +1,5 @@ +# $Id$ + +EXTRA_DIST += modules/preprocs/tasm/tests/Makefile.inc + +include modules/preprocs/tasm/tests/Makefile.inc diff --git a/modules/preprocs/tasm/tests/Makefile.inc b/modules/preprocs/tasm/tests/Makefile.inc new file mode 100644 index 00000000..23450b4e --- /dev/null +++ b/modules/preprocs/tasm/tests/Makefile.inc @@ -0,0 +1,9 @@ +# $Id$ + +TESTS += modules/preprocs/tasm/tests/tasmpp_test.sh + +EXTRA_DIST += modules/preprocs/tasm/tests/tasmpp_test.sh +EXTRA_DIST += modules/preprocs/nasm/tests/tasm-assume-comment.asm +EXTRA_DIST += modules/preprocs/nasm/tests/tasm-assume-comment.hex +EXTRA_DIST += modules/preprocs/nasm/tests/tasm-comment-instr.asm +EXTRA_DIST += modules/preprocs/nasm/tests/tasm-comment-instr.hex diff --git a/modules/preprocs/tasm/tests/tasm-assume-comment.asm b/modules/preprocs/tasm/tests/tasm-assume-comment.asm new file mode 100644 index 00000000..6b7cc1bf --- /dev/null +++ b/modules/preprocs/tasm/tests/tasm-assume-comment.asm @@ -0,0 +1,3 @@ +assume cs:code,ds:code,es:code ; tiny model (CS=DS=ES) +assume ds:code,es:code; close comment +assume fs:code,gs:code diff --git a/modules/preprocs/tasm/tests/tasm-assume-comment.hex b/modules/preprocs/tasm/tests/tasm-assume-comment.hex new file mode 100644 index 00000000..e69de29b diff --git a/modules/preprocs/tasm/tests/tasm-comment-instr.asm b/modules/preprocs/tasm/tests/tasm-comment-instr.asm new file mode 100644 index 00000000..d93001b1 --- /dev/null +++ b/modules/preprocs/tasm/tests/tasm-comment-instr.asm @@ -0,0 +1 @@ +ansi_normal db 0x27,'[0;40;37m$' diff --git a/modules/preprocs/tasm/tests/tasm-comment-instr.hex b/modules/preprocs/tasm/tests/tasm-comment-instr.hex new file mode 100644 index 00000000..594d68f0 --- /dev/null +++ b/modules/preprocs/tasm/tests/tasm-comment-instr.hex @@ -0,0 +1,11 @@ +27 +5b +30 +3b +34 +30 +3b +33 +37 +6d +24 diff --git a/modules/preprocs/tasm/tests/tasmpp_test.sh b/modules/preprocs/tasm/tests/tasmpp_test.sh new file mode 100755 index 00000000..e3155b52 --- /dev/null +++ b/modules/preprocs/tasm/tests/tasmpp_test.sh @@ -0,0 +1,4 @@ +#! /bin/sh +# $Id$ +${srcdir}/out_test.sh tasmpp_test modules/preprocs/tasm/tests "tasm preproc" "-f bin -p tasm" "" +exit $? From e3b6f5bc9b3427bd3babda03ba73faa6f3f00500 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 10 May 2009 05:21:26 +0000 Subject: [PATCH 267/585] Add gencheck.py Python script to make it easier to generate expected results from long .asm files that generate simple binary output (e.g. for opcode testing). svn path=/trunk/yasm/; revision=2198 --- tools/gencheck.py | 59 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100755 tools/gencheck.py diff --git a/tools/gencheck.py b/tools/gencheck.py new file mode 100755 index 00000000..6c25709e --- /dev/null +++ b/tools/gencheck.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python +# Generate expected binary hexdump output from specially formatted asm file. +# +# Copyright (C) 2009 Peter Johnson +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. + +def gen_expected(fout, fin): + count = 0 + for line in fin: + if not line: + continue + if line.startswith(';'): + continue + # extract portion after ; character + (insn, sep, comment) = line.partition(';') + if not sep: + continue # ; not found + # comment must be formatted as 2-char hex and/or 3-char octal bytes + # separated by spaces + bytes = [] + for byte in comment.split(): + if len(byte) == 2: + bytes.append(int(byte, 16)) + elif len(byte) == 3: + bytes.append(int(byte, 8)) + else: + break + for byte in bytes: + print >>fout, "%02x " % byte + count += 1 + print "Processed %d instructions" % count + + +if __name__ == "__main__": + import sys + if len(sys.argv) != 3: + print >>sys.stderr, "Usage: gencheck.py " + sys.exit(2) + gen_expected(open(sys.argv[2], "w"), open(sys.argv[1], "r")) From 93c4d75fb220d0db82d058a5a6d565071870d112 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 10 May 2009 05:24:46 +0000 Subject: [PATCH 268/585] Add support for AMD XOP, FMA4, and CVT16 instructions (replacing SSE5). AMD has obsoleted the SSE5 spec in favor of these instructions. These instructions use an AVX-like new opcode structure called XOP instead of the SSE5 DREX byte. The AMD FMA4 instructions are a copy of the *old* Intel FMA instructions. Intel has since updated their spec, and AMD may follow, but for now we've implemented what AMD's spec contains. svn path=/trunk/yasm/; revision=2199 --- modules/arch/x86/gen_x86_insn.py | 779 +++---- modules/arch/x86/tests/Makefile.inc | 18 +- modules/arch/x86/tests/amd-fma4.asm | 109 + modules/arch/x86/tests/amd-fma4.hex | 540 +++++ modules/arch/x86/tests/cvt16.asm | 16 + modules/arch/x86/tests/cvt16.hex | 88 + modules/arch/x86/tests/farbasic.asm | 4 +- modules/arch/x86/tests/mixcase.asm | 2 +- modules/arch/x86/tests/sse5-all.asm | 509 ----- modules/arch/x86/tests/sse5-all.hex | 2727 ----------------------- modules/arch/x86/tests/sse5-basic.asm | 12 - modules/arch/x86/tests/sse5-basic.hex | 59 - modules/arch/x86/tests/sse5-cc.asm | 49 - modules/arch/x86/tests/sse5-cc.hex | 264 --- modules/arch/x86/tests/sse5-err.asm | 116 - modules/arch/x86/tests/sse5-err.errwarn | 84 - modules/arch/x86/tests/xop-all.asm | 266 +++ modules/arch/x86/tests/xop-all.hex | 1437 ++++++++++++ modules/arch/x86/tests/xop-basic.asm | 8 + modules/arch/x86/tests/xop-basic.hex | 47 + modules/arch/x86/tests/xop-cc.asm | 22 + modules/arch/x86/tests/xop-cc.hex | 108 + modules/arch/x86/x86arch.h | 29 +- modules/arch/x86/x86bc.c | 54 +- modules/arch/x86/x86cpu.gperf | 15 +- modules/arch/x86/x86expr.c | 7 +- modules/arch/x86/x86id.c | 136 +- 27 files changed, 3163 insertions(+), 4342 deletions(-) create mode 100644 modules/arch/x86/tests/amd-fma4.asm create mode 100644 modules/arch/x86/tests/amd-fma4.hex create mode 100644 modules/arch/x86/tests/cvt16.asm create mode 100644 modules/arch/x86/tests/cvt16.hex delete mode 100644 modules/arch/x86/tests/sse5-all.asm delete mode 100644 modules/arch/x86/tests/sse5-all.hex delete mode 100644 modules/arch/x86/tests/sse5-basic.asm delete mode 100644 modules/arch/x86/tests/sse5-basic.hex delete mode 100644 modules/arch/x86/tests/sse5-cc.asm delete mode 100644 modules/arch/x86/tests/sse5-cc.hex delete mode 100644 modules/arch/x86/tests/sse5-err.asm delete mode 100644 modules/arch/x86/tests/sse5-err.errwarn create mode 100644 modules/arch/x86/tests/xop-all.asm create mode 100644 modules/arch/x86/tests/xop-all.hex create mode 100644 modules/arch/x86/tests/xop-basic.asm create mode 100644 modules/arch/x86/tests/xop-basic.hex create mode 100644 modules/arch/x86/tests/xop-cc.asm create mode 100644 modules/arch/x86/tests/xop-cc.hex diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index 372454df..2e263bc0 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -39,7 +39,7 @@ ordered_cpus = [ ordered_cpu_features = [ "FPU", "Cyrix", "AMD", "MMX", "3DNow", "SMM", "SSE", "SSE2", "SSE3", "SVM", "PadLock", "SSSE3", "SSE41", "SSE42", "SSE4a", "SSE5", - "AVX", "FMA", "AES", "CLMUL"] + "AVX", "FMA", "AES", "CLMUL", "MOVBE", "XOP", "FMA4", "CVT16"] unordered_cpu_features = ["Priv", "Prot", "Undoc", "Obs"] # Predefined VEX prefix field values @@ -49,6 +49,13 @@ VEXL0 = 0xC0 VEXL1 = 0xC4 VEXpp = 0xC0 # OR with value +# Predefined XOP prefix field values +XOPW0 = 0x80 +XOPW1 = 0x88 +XOPL0 = 0x80 +XOPL1 = 0x84 +XOPpp = 0x80 # OR with value + def cpu_lcd(cpu1, cpu2): """Find the lowest common denominator of two CPU sets.""" retval = set() @@ -208,6 +215,27 @@ class GroupForm(object): self.special_prefix = "0x%02X" % (0xC0 + vexW*8 + vexL*4 + vexpp) + # XOP prefix + if "xop" in kwargs: + xopW = kwargs.pop("xopw", 0) + if xopW not in [0, 1]: + raise ValueError("XOP.W must be 0 or 1") + + xopL = kwargs.pop("xop") + if xopL == 128 or xopL == 0: + xopL = 0 + elif xopL == 256: + xopL = 1 + else: + raise ValueError("XOP.L must be 128 or 256") + + # XOPpp is currently reserved (0) + xoppp = 0 + if self.special_prefix not in ["0", "0x00"]: + raise ValueError("Cannot combine XOP and special prefix %s" + % self.special_prefix) + self.special_prefix = "0x%02X" % (0x80 + xopW*8 + xopL*4 + xoppp) + # Spare value self.spare = kwargs.pop("spare", 0) @@ -226,9 +254,6 @@ class GroupForm(object): else: raise KeyError("missing opcode") - # DREX opcode0 field - self.drex_oc0 = kwargs.pop("drex_oc0", 0) and 0x08 or 0 - # Build operands string (C array initializer) self.operands = kwargs.pop("operands") for op in self.operands: @@ -248,8 +273,6 @@ class GroupForm(object): self.cpu.add("586") if op.dest == "EA64": self.misc_flags.add("ONLY_64") - if op.dest == "DREX": - self.drex_oc0 |= 0x80 # Modifiers self.modifiers = kwargs.pop("modifiers", []) @@ -327,8 +350,6 @@ class GroupForm(object): "%d" % (self.opersize or 0), "%d" % (self.def_opersize_64 or 0), self.special_prefix or "0", - self.drex_oc0 and - ("0x%02X" % self.drex_oc0) or "0", "%d" % self.opcode_len, opcodes_str, "%d" % (self.spare or 0), @@ -6578,401 +6599,401 @@ add_group("movntss", add_insn("movntss", "movntss") ##################################################################### -# AMD SSE5 instructions +# AMD CVT16 instructions ##################################################################### -add_group("sse5com", - cpu=["SSE5"], - modifiers=["Op2Add"], - opcode=[0x0F, 0x25, 0x00], - drex_oc0=0, - operands=[Operand(type="SIMDReg", size=128, dest="DREX"), - Operand(type="SIMDReg", size=128, dest="Spare"), +add_group("vcvtph2ps", + cpu=["CVT16"], + xop=128, + opcode=[0x08, 0xA0], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Mem", size=64, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("vcvtph2ps", + cpu=["CVT16"], + xop=128, + opcode=[0x08, 0xA0], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("vcvtph2ps", + cpu=["CVT16"], + xop=256, + opcode=[0x08, 0xA0], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_insn("vcvtph2ps", "vcvtph2ps") -for sz in [32, 64]: - add_group("sse5com%d" % sz, - cpu=["SSE5"], - modifiers=["Op2Add"], - opcode=[0x0F, 0x25, 0x00], - drex_oc0=0, - operands=[Operand(type="SIMDReg", size=128, dest="DREX"), - Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDReg", size=128, dest="EA"), - Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) - add_group("sse5com%d" % sz, - cpu=["SSE5"], - modifiers=["Op2Add"], - opcode=[0x0F, 0x25, 0x00], - drex_oc0=0, - operands=[Operand(type="SIMDReg", size=128, dest="DREX"), - Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="Mem", size=sz, relaxed=True, dest="EA"), - Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) - -# Condition code versions -add_group("sse5comcc", - cpu=["SSE5"], - modifiers=["Op2Add", "Imm8"], - opcode=[0x0F, 0x25, 0x00], - drex_oc0=0, - operands=[Operand(type="SIMDReg", size=128, dest="DREX"), +add_group("vcvtps2ph", + cpu=["CVT16"], + xop=128, + opcode=[0x08, 0xA1], + operands=[Operand(type="Mem", size=64, relaxed=True, dest="EA"), Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("vcvtps2ph", + cpu=["CVT16"], + xop=128, + opcode=[0x08, 0xA1], + operands=[Operand(type="SIMDReg", size=128, dest="EA"), + Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("vcvtps2ph", + cpu=["CVT16"], + xop=256, + opcode=[0x08, 0xA1], + operands=[Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_insn("vcvtps2ph", "vcvtps2ph") + +##################################################################### +# AMD XOP instructions +##################################################################### + +add_group("vfrc_pdps", + cpu=["XOP"], + modifiers=["Op1Add"], + xop=128, + opcode=[0x09, 0x80], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) +add_group("vfrc_pdps", + cpu=["XOP"], + modifiers=["Op1Add"], + xop=256, + opcode=[0x09, 0x80], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="SIMDRM", size=256, relaxed=True, dest="EA")]) +add_insn("vfrczpd", "vfrc_pdps", modifiers=[0x01]) +add_insn("vfrczps", "vfrc_pdps", modifiers=[0x00]) -for sz in [32, 64]: - add_group("sse5comcc%d" % sz, - cpu=["SSE5"], - modifiers=["Op2Add", "Imm8"], - opcode=[0x0F, 0x25, 0x00], - drex_oc0=0, - operands=[Operand(type="SIMDReg", size=128, dest="DREX"), - Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDReg", size=128, dest="EA")]) - add_group("sse5comcc%d" % sz, - cpu=["SSE5"], - modifiers=["Op2Add", "Imm8"], - opcode=[0x0F, 0x25, 0x00], - drex_oc0=0, - operands=[Operand(type="SIMDReg", size=128, dest="DREX"), - Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="Mem", size=sz, relaxed=True, dest="EA")]) - -sse5coms = [(0, ""), - (0x0, "eq"), - (0x1, "lt"), (0x1, "unge"), - (0x2, "le"), (0x2, "ungt"), - (0x3, "unord"), - (0x4, "ne"), (0x4, "neq"), - (0x5, "nlt"), (0x5, "uge"), - (0x6, "nle"), (0x6, "ugt"), - (0x7, "ord"), - (0x8, "ueq"), - (0x9, "ult"), (0x9, "nge"), - (0xa, "ule"), (0xa, "ngt"), - (0xb, "false"), - (0xc, "une"), (0xc, "uneq"), - (0xd, "unlt"), (0xd, "ge"), - (0xe, "unle"), (0xe, "gt"), - (0xf, "true")] -for ib, cc in sse5coms: - if cc: - iname = "sse5comcc" - else: - iname = "sse5com" - add_insn("com"+cc+"ps", iname, modifiers=[0x2C, ib]) - add_insn("com"+cc+"pd", iname, modifiers=[0x2D, ib]) - add_insn("com"+cc+"ss", iname+"32", modifiers=[0x2E, ib]) - add_insn("com"+cc+"sd", iname+"64", modifiers=[0x2F, ib]) - -sse5coms = list(enumerate(["lt", "le", "gt", "ge", - "eq", "neq", "false", "true"])) -sse5coms.append((5, "ne")) -sse5coms.append((0, "")) -for ib, cc in sse5coms: - if cc: - iname = "sse5comcc" - else: - iname = "sse5com" - add_insn("pcom"+cc+"b", iname, modifiers=[0x4C, ib]) - add_insn("pcom"+cc+"w", iname, modifiers=[0x4D, ib]) - add_insn("pcom"+cc+"d", iname, modifiers=[0x4E, ib]) - add_insn("pcom"+cc+"q", iname, modifiers=[0x4F, ib]) - - add_insn("pcom"+cc+"ub", iname, modifiers=[0x6C, ib]) - add_insn("pcom"+cc+"uw", iname, modifiers=[0x6D, ib]) - add_insn("pcom"+cc+"ud", iname, modifiers=[0x6E, ib]) - add_insn("pcom"+cc+"uq", iname, modifiers=[0x6F, ib]) - -add_group("cvtph2ps", - cpu=["SSE5"], - opcode=[0x0F, 0x7A, 0x30], +add_group("vfrczsd", + cpu=["XOP"], + xop=128, + opcode=[0x09, 0x83], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), Operand(type="SIMDReg", size=128, dest="EA")]) -add_group("cvtph2ps", - cpu=["SSE5"], - opcode=[0x0F, 0x7A, 0x30], +add_group("vfrczsd", + cpu=["XOP"], + xop=128, + opcode=[0x09, 0x83], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), Operand(type="Mem", size=64, relaxed=True, dest="EA")]) +add_insn("vfrczsd", "vfrczsd") -add_insn("cvtph2ps", "cvtph2ps") - -add_group("cvtps2ph", - cpu=["SSE5"], - opcode=[0x0F, 0x7A, 0x31], - operands=[Operand(type="SIMDReg", size=128, dest="EA"), - Operand(type="SIMDReg", size=128, dest="Spare")]) -add_group("cvtps2ph", - cpu=["SSE5"], - opcode=[0x0F, 0x7A, 0x31], - operands=[Operand(type="Mem", size=64, relaxed=True, dest="EA"), - Operand(type="SIMDReg", size=128, dest="Spare")]) - -add_insn("cvtps2ph", "cvtps2ph") - -add_group("sse5arith", - cpu=["SSE5"], - modifiers=["Op2Add"], - opcode=[0x0F, 0x24, 0x00], - drex_oc0=0, - operands=[Operand(type="SIMDReg", size=128, dest="DREX"), - Operand(type="SIMDRegMatch0", size=128, dest=None), - Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) -add_group("sse5arith", - cpu=["SSE5"], - modifiers=["Op2Add"], - opcode=[0x0F, 0x24, 0x00], - drex_oc0=1, - operands=[Operand(type="SIMDReg", size=128, dest="DREX"), - Operand(type="SIMDRegMatch0", size=128, dest=None), - Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), - Operand(type="SIMDReg", size=128, dest="Spare")]) -add_group("sse5arith", - cpu=["SSE5"], - modifiers=["Op2Add"], - opcode=[0x0F, 0x24, 0x04], - drex_oc0=0, - operands=[Operand(type="SIMDReg", size=128, dest="DREX"), - Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), - Operand(type="SIMDRegMatch0", size=128, dest=None)]) -add_group("sse5arith", - cpu=["SSE5"], - modifiers=["Op2Add"], - opcode=[0x0F, 0x24, 0x04], - drex_oc0=1, - operands=[Operand(type="SIMDReg", size=128, dest="DREX"), - Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), - Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDRegMatch0", size=128, dest=None)]) - -for sz in [32, 64]: - add_group("sse5arith%d" % sz, - cpu=["SSE5"], - modifiers=["Op2Add"], - opcode=[0x0F, 0x24, 0x00], - drex_oc0=0, - operands=[Operand(type="SIMDReg", size=128, dest="DREX"), - Operand(type="SIMDRegMatch0", size=128, dest=None), - Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDReg", size=128, dest="EA")]) - add_group("sse5arith%d" % sz, - cpu=["SSE5"], - modifiers=["Op2Add"], - opcode=[0x0F, 0x24, 0x00], - drex_oc0=0, - operands=[Operand(type="SIMDReg", size=128, dest="DREX"), - Operand(type="SIMDRegMatch0", size=128, dest=None), - Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="Mem", size=sz, relaxed=True, dest="EA")]) - add_group("sse5arith%d" % sz, - cpu=["SSE5"], - modifiers=["Op2Add"], - opcode=[0x0F, 0x24, 0x00], - drex_oc0=1, - operands=[Operand(type="SIMDReg", size=128, dest="DREX"), - Operand(type="SIMDRegMatch0", size=128, dest=None), - Operand(type="SIMDReg", size=128, dest="EA"), - Operand(type="SIMDReg", size=128, dest="Spare")]) - add_group("sse5arith%d" % sz, - cpu=["SSE5"], - modifiers=["Op2Add"], - opcode=[0x0F, 0x24, 0x00], - drex_oc0=1, - operands=[Operand(type="SIMDReg", size=128, dest="DREX"), - Operand(type="SIMDRegMatch0", size=128, dest=None), - Operand(type="Mem", size=sz, relaxed=True, dest="EA"), - Operand(type="SIMDReg", size=128, dest="Spare")]) - add_group("sse5arith%d" % sz, - cpu=["SSE5"], - modifiers=["Op2Add"], - opcode=[0x0F, 0x24, 0x04], - drex_oc0=0, - operands=[Operand(type="SIMDReg", size=128, dest="DREX"), - Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDReg", size=128, dest="EA"), - Operand(type="SIMDRegMatch0", size=128, dest=None)]) - add_group("sse5arith%d" % sz, - cpu=["SSE5"], - modifiers=["Op2Add"], - opcode=[0x0F, 0x24, 0x04], - drex_oc0=0, - operands=[Operand(type="SIMDReg", size=128, dest="DREX"), - Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="Mem", size=sz, relaxed=True, dest="EA"), - Operand(type="SIMDRegMatch0", size=128, dest=None)]) - add_group("sse5arith%d" % sz, - cpu=["SSE5"], - modifiers=["Op2Add"], - opcode=[0x0F, 0x24, 0x04], - drex_oc0=1, - operands=[Operand(type="SIMDReg", size=128, dest="DREX"), - Operand(type="SIMDReg", size=128, dest="EA"), - Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDRegMatch0", size=128, dest=None)]) - add_group("sse5arith%d" % sz, - cpu=["SSE5"], - modifiers=["Op2Add"], - opcode=[0x0F, 0x24, 0x04], - drex_oc0=1, - operands=[Operand(type="SIMDReg", size=128, dest="DREX"), - Operand(type="Mem", size=sz, relaxed=True, dest="EA"), - Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDRegMatch0", size=128, dest=None)]) - -add_insn("fmaddps", "sse5arith", modifiers=[0x00]) -add_insn("fmaddpd", "sse5arith", modifiers=[0x01]) -add_insn("fmaddss", "sse5arith32", modifiers=[0x02]) -add_insn("fmaddsd", "sse5arith64", modifiers=[0x03]) - -add_insn("fmsubps", "sse5arith", modifiers=[0x08]) -add_insn("fmsubpd", "sse5arith", modifiers=[0x09]) -add_insn("fmsubss", "sse5arith32", modifiers=[0x0A]) -add_insn("fmsubsd", "sse5arith64", modifiers=[0x0B]) - -add_insn("fnmaddps", "sse5arith", modifiers=[0x10]) -add_insn("fnmaddpd", "sse5arith", modifiers=[0x11]) -add_insn("fnmaddss", "sse5arith32", modifiers=[0x12]) -add_insn("fnmaddsd", "sse5arith64", modifiers=[0x13]) - -add_insn("fnmsubps", "sse5arith", modifiers=[0x18]) -add_insn("fnmsubpd", "sse5arith", modifiers=[0x19]) -add_insn("fnmsubss", "sse5arith32", modifiers=[0x1A]) -add_insn("fnmsubsd", "sse5arith64", modifiers=[0x1B]) - -add_insn("pcmov", "sse5arith", modifiers=[0x22]) - -add_insn("permps", "sse5arith", modifiers=[0x20]) -add_insn("permpd", "sse5arith", modifiers=[0x21]) -add_insn("pperm", "sse5arith", modifiers=[0x23]) - -add_group("sse5two", - cpu=["SSE5"], - modifiers=["Op2Add"], - opcode=[0x0F, 0x7A, 0x00], +add_group("vfrczss", + cpu=["XOP"], + xop=128, + opcode=[0x09, 0x82], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) -for sz in [32, 64]: - add_group("sse5two%d" % sz, - cpu=["SSE5"], - modifiers=["Op2Add"], - opcode=[0x0F, 0x7A, 0x00], - operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDReg", size=128, dest="EA")]) - add_group("sse5two%d" % sz, - cpu=["SSE5"], - modifiers=["Op2Add"], - opcode=[0x0F, 0x7A, 0x00], - operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="Mem", size=sz, relaxed=True, dest="EA")]) - -add_insn("frczps", "sse5two", modifiers=[0x10]) -add_insn("frczpd", "sse5two", modifiers=[0x11]) -add_insn("frczss", "sse5two32", modifiers=[0x12]) -add_insn("frczsd", "sse5two64", modifiers=[0x13]) - -add_insn("phaddbw", "sse5two", modifiers=[0x41]) -add_insn("phaddbd", "sse5two", modifiers=[0x42]) -add_insn("phaddbq", "sse5two", modifiers=[0x43]) -add_insn("phaddwd", "sse5two", modifiers=[0x46]) -add_insn("phaddwq", "sse5two", modifiers=[0x47]) -add_insn("phadddq", "sse5two", modifiers=[0x4B]) - -add_insn("phaddubw", "sse5two", modifiers=[0x51]) -add_insn("phaddubd", "sse5two", modifiers=[0x52]) -add_insn("phaddubq", "sse5two", modifiers=[0x53]) -add_insn("phadduwd", "sse5two", modifiers=[0x56]) -add_insn("phadduwq", "sse5two", modifiers=[0x57]) -add_insn("phaddudq", "sse5two", modifiers=[0x5B]) - -add_insn("phsubbw", "sse5two", modifiers=[0x61]) -add_insn("phsubwd", "sse5two", modifiers=[0x62]) -add_insn("phsubdq", "sse5two", modifiers=[0x63]) - -add_group("sse5pmacs", - cpu=["SSE5"], - modifiers=["Op2Add"], - opcode=[0x0F, 0x24, 0x00], - drex_oc0=0, - operands=[Operand(type="SIMDReg", size=128, dest="DREX"), - Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), - Operand(type="SIMDRegMatch0", size=128, dest=None)]) - -add_insn("pmacsww", "sse5pmacs", modifiers=[0x95]) -add_insn("pmacswd", "sse5pmacs", modifiers=[0x96]) -add_insn("pmacsdql", "sse5pmacs", modifiers=[0x97]) -add_insn("pmacsdd", "sse5pmacs", modifiers=[0x9E]) -add_insn("pmacsdqh", "sse5pmacs", modifiers=[0x9F]) - -add_insn("pmacssww", "sse5pmacs", modifiers=[0x85]) -add_insn("pmacsswd", "sse5pmacs", modifiers=[0x86]) -add_insn("pmacssdql", "sse5pmacs", modifiers=[0x87]) -add_insn("pmacssdd", "sse5pmacs", modifiers=[0x8E]) -add_insn("pmacssdqh", "sse5pmacs", modifiers=[0x8F]) - -add_insn("pmadcsswd", "sse5pmacs", modifiers=[0xA6]) -add_insn("pmadcswd", "sse5pmacs", modifiers=[0xB6]) - -add_group("sse5prot", - cpu=["SSE5"], - modifiers=["Op2Add"], - opcode=[0x0F, 0x24, 0x40], - drex_oc0=0, - operands=[Operand(type="SIMDReg", size=128, dest="DREX"), - Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) -add_group("sse5prot", - cpu=["SSE5"], - modifiers=["Op2Add"], - opcode=[0x0F, 0x24, 0x40], - drex_oc0=1, - operands=[Operand(type="SIMDReg", size=128, dest="DREX"), - Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), - Operand(type="SIMDReg", size=128, dest="Spare")]) -add_group("sse5prot", - cpu=["SSE5"], - modifiers=["Op2Add"], - opcode=[0x0F, 0x7B, 0x40], + Operand(type="SIMDReg", size=128, dest="EA")]) +add_group("vfrczss", + cpu=["XOP"], + xop=128, + opcode=[0x09, 0x82], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Mem", size=32, relaxed=True, dest="EA")]) +add_insn("vfrczss", "vfrczss") + +add_group("vpcmov", + cpu=["XOP"], + xop=128, + xopw=0, + opcode=[0x08, 0xA2], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="VEXImmSrc")]) +add_group("vpcmov", + cpu=["XOP"], + xop=128, + xopw=1, + opcode=[0x08, 0xA2], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDReg", size=128, dest="VEXImmSrc"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) +add_group("vpcmov", + cpu=["XOP"], + xop=256, + xopw=0, + opcode=[0x08, 0xA2], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="SIMDReg", size=256, dest="VEX"), + Operand(type="SIMDRM", size=256, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=256, dest="VEXImmSrc")]) +add_group("vpcmov", + cpu=["XOP"], + xop=256, + xopw=1, + opcode=[0x08, 0xA2], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="SIMDReg", size=256, dest="VEX"), + Operand(type="SIMDReg", size=256, dest="VEXImmSrc"), + Operand(type="SIMDRM", size=256, relaxed=True, dest="EA")]) + +add_insn("vpcmov", "vpcmov") + +add_group("vpcom", + cpu=["XOP"], + modifiers=["Op1Add", "Imm8"], + xop=128, + opcode=[0x08, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) +add_group("vpcom_imm", + cpu=["XOP"], + modifiers=["Op1Add"], + xop=128, + opcode=[0x08, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) -add_insn("protb", "sse5prot", modifiers=[0x00]) -add_insn("protw", "sse5prot", modifiers=[0x01]) -add_insn("protd", "sse5prot", modifiers=[0x02]) -add_insn("protq", "sse5prot", modifiers=[0x03]) +for opc, sfx in [(0xCC, "b"), + (0xCE, "d"), + (0xCD, "w"), + (0xCF, "q"), + (0xEC, "ub"), + (0xEE, "ud"), + (0xEF, "uq"), + (0xED, "uw")]: + add_insn("vpcom"+sfx, "vpcom_imm", modifiers=[opc]) + for ib, cc in enumerate(["lt", "le", "gt", "ge", + "eq", "neq", "false", "true"]): + add_insn("vpcom"+cc+sfx, "vpcom", modifiers=[opc, ib]) + # ne alias for neq + add_insn("vpcomne"+sfx, "vpcom", modifiers=[opc, 5]) -add_group("sse5psh", - cpu=["SSE5"], - modifiers=["Op2Add"], - opcode=[0x0F, 0x24, 0x44], - drex_oc0=0, - operands=[Operand(type="SIMDReg", size=128, dest="DREX"), - Operand(type="SIMDReg", size=128, dest="Spare"), +add_group("vphaddsub", + cpu=["XOP"], + modifiers=["Op1Add"], + xop=128, + opcode=[0x09, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) -add_group("sse5psh", - cpu=["SSE5"], - modifiers=["Op2Add"], - opcode=[0x0F, 0x24, 0x44], - drex_oc0=1, - operands=[Operand(type="SIMDReg", size=128, dest="DREX"), + +add_insn("vphaddbw", "vphaddsub", modifiers=[0xC1]) +add_insn("vphaddbd", "vphaddsub", modifiers=[0xC2]) +add_insn("vphaddbq", "vphaddsub", modifiers=[0xC3]) +add_insn("vphaddwd", "vphaddsub", modifiers=[0xC6]) +add_insn("vphaddwq", "vphaddsub", modifiers=[0xC7]) +add_insn("vphadddq", "vphaddsub", modifiers=[0xCB]) + +add_insn("vphaddubw", "vphaddsub", modifiers=[0xD1]) +add_insn("vphaddubd", "vphaddsub", modifiers=[0xD2]) +add_insn("vphaddubq", "vphaddsub", modifiers=[0xD3]) +add_insn("vphadduwd", "vphaddsub", modifiers=[0xD6]) +add_insn("vphadduwq", "vphaddsub", modifiers=[0xD7]) +add_insn("vphaddudq", "vphaddsub", modifiers=[0xDB]) + +add_insn("vphsubbw", "vphaddsub", modifiers=[0xE1]) +add_insn("vphsubwd", "vphaddsub", modifiers=[0xE2]) +add_insn("vphsubdq", "vphaddsub", modifiers=[0xE3]) + +add_group("vpma", + cpu=["XOP"], + modifiers=["Op1Add"], + xop=128, + opcode=[0x08, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), - Operand(type="SIMDReg", size=128, dest="Spare")]) + Operand(type="SIMDReg", size=128, dest="VEXImmSrc")]) -add_insn("pshlb", "sse5psh", modifiers=[0x00]) -add_insn("pshlw", "sse5psh", modifiers=[0x01]) -add_insn("pshld", "sse5psh", modifiers=[0x02]) -add_insn("pshlq", "sse5psh", modifiers=[0x03]) +add_insn("vpmacsdd", "vpma", modifiers=[0x9E]) +add_insn("vpmacsdqh", "vpma", modifiers=[0x9F]) +add_insn("vpmacsdql", "vpma", modifiers=[0x97]) +add_insn("vpmacssdd", "vpma", modifiers=[0x8E]) +add_insn("vpmacssdqh", "vpma", modifiers=[0x8F]) +add_insn("vpmacssdql", "vpma", modifiers=[0x87]) +add_insn("vpmacsswd", "vpma", modifiers=[0x86]) +add_insn("vpmacssww", "vpma", modifiers=[0x85]) +add_insn("vpmacswd", "vpma", modifiers=[0x96]) +add_insn("vpmacsww", "vpma", modifiers=[0x95]) +add_insn("vpmadcsswd", "vpma", modifiers=[0xA6]) +add_insn("vpmadcswd", "vpma", modifiers=[0xB6]) -add_insn("pshab", "sse5psh", modifiers=[0x04]) -add_insn("pshaw", "sse5psh", modifiers=[0x05]) -add_insn("pshad", "sse5psh", modifiers=[0x06]) -add_insn("pshaq", "sse5psh", modifiers=[0x07]) +add_group("vpperm", + cpu=["XOP"], + xop=128, + xopw=0, + opcode=[0x08, 0xA3], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="VEXImmSrc")]) +add_group("vpperm", + cpu=["XOP"], + xop=128, + xopw=1, + opcode=[0x08, 0xA3], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDReg", size=128, dest="VEXImmSrc"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) +add_insn("vpperm", "vpperm") -# roundps, roundpd, roundss, roundsd, ptest are in SSE4.1 +add_group("vprot", + cpu=["XOP"], + modifiers=["Op1Add"], + xop=128, + xopw=0, + opcode=[0x09, 0x90], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="VEX")]) +add_group("vprot", + cpu=["XOP"], + modifiers=["Op1Add"], + xop=128, + xopw=1, + opcode=[0x09, 0x90], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) +add_group("vprot", + cpu=["XOP"], + modifiers=["Op1Add"], + xop=128, + opcode=[0x08, 0xC0], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +for opc, sfx in enumerate(["b", "w", "d", "q"]): + add_insn("vprot"+sfx, "vprot", modifiers=[opc]) + +add_group("amd_vpshift", + cpu=["XOP"], + modifiers=["Op1Add"], + xop=128, + xopw=0, + opcode=[0x09, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="VEX")]) +add_group("amd_vpshift", + cpu=["XOP"], + modifiers=["Op1Add"], + xop=128, + xopw=1, + opcode=[0x09, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) +for opc, sfx in enumerate(["b", "w", "d", "q"]): + add_insn("vpsha"+sfx, "amd_vpshift", modifiers=[0x98+opc]) + add_insn("vpshl"+sfx, "amd_vpshift", modifiers=[0x94+opc]) + +##################################################################### +# AMD FMA4 instructions (same as original Intel FMA instructions) +##################################################################### + +add_group("fma_128_256", + cpu=["FMA4"], + modifiers=["Op2Add"], + vex=128, + vexw=0, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEXImmSrc"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="VEX")]) +add_group("fma_128_256", + cpu=["FMA4"], + modifiers=["Op2Add"], + vex=128, + vexw=1, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEXImmSrc"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) +add_group("fma_128_256", + cpu=["FMA4"], + modifiers=["Op2Add"], + vex=256, + vexw=0, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="SIMDReg", size=256, dest="VEXImmSrc"), + Operand(type="SIMDRM", size=256, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=256, dest="VEX")]) +add_group("fma_128_256", + cpu=["FMA4"], + modifiers=["Op2Add"], + vex=256, + vexw=1, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="SIMDReg", size=256, dest="VEXImmSrc"), + Operand(type="SIMDReg", size=256, dest="VEX"), + Operand(type="SIMDRM", size=256, relaxed=True, dest="EA")]) + +add_insn("vfmaddpd", "fma_128_256", modifiers=[0x69]) +add_insn("vfmaddps", "fma_128_256", modifiers=[0x68]) +add_insn("vfmaddsubpd", "fma_128_256", modifiers=[0x5D]) +add_insn("vfmaddsubps", "fma_128_256", modifiers=[0x5C]) +add_insn("vfmsubaddpd", "fma_128_256", modifiers=[0x5F]) +add_insn("vfmsubaddps", "fma_128_256", modifiers=[0x5E]) +add_insn("vfmsubpd", "fma_128_256", modifiers=[0x6D]) +add_insn("vfmsubps", "fma_128_256", modifiers=[0x6C]) +add_insn("vfnmaddpd", "fma_128_256", modifiers=[0x79]) +add_insn("vfnmaddps", "fma_128_256", modifiers=[0x78]) +add_insn("vfnmsubpd", "fma_128_256", modifiers=[0x7D]) +add_insn("vfnmsubps", "fma_128_256", modifiers=[0x7C]) + +for sz in [32, 64]: + add_group("fma_128_m%d" % sz, + cpu=["FMA4"], + modifiers=["Op2Add"], + vex=128, + vexw=0, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEXImmSrc"), + Operand(type="SIMDReg", size=128, dest="EA"), + Operand(type="SIMDReg", size=128, dest="VEX")]) + add_group("fma_128_m%d" % sz, + cpu=["FMA4"], + modifiers=["Op2Add"], + vex=128, + vexw=0, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEXImmSrc"), + Operand(type="Mem", size=sz, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="VEX")]) + add_group("fma_128_m%d" % sz, + cpu=["FMA4"], + modifiers=["Op2Add"], + vex=128, + vexw=1, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEXImmSrc"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="Mem", size=sz, relaxed=True, dest="EA")]) + +add_insn("vfmaddsd", "fma_128_m64", modifiers=[0x6B]) +add_insn("vfmaddss", "fma_128_m32", modifiers=[0x6A]) +add_insn("vfmsubsd", "fma_128_m64", modifiers=[0x6F]) +add_insn("vfmsubss", "fma_128_m32", modifiers=[0x6E]) +add_insn("vfnmaddsd", "fma_128_m64", modifiers=[0x7B]) +add_insn("vfnmaddss", "fma_128_m32", modifiers=[0x7A]) +add_insn("vfnmsubsd", "fma_128_m64", modifiers=[0x7F]) +add_insn("vfnmsubss", "fma_128_m32", modifiers=[0x7E]) ##################################################################### # Intel XSAVE instructions diff --git a/modules/arch/x86/tests/Makefile.inc b/modules/arch/x86/tests/Makefile.inc index bbe26ed2..1a6391ea 100644 --- a/modules/arch/x86/tests/Makefile.inc +++ b/modules/arch/x86/tests/Makefile.inc @@ -16,6 +16,8 @@ EXTRA_DIST += modules/arch/x86/tests/aes.asm EXTRA_DIST += modules/arch/x86/tests/aes.hex EXTRA_DIST += modules/arch/x86/tests/amd200707.asm EXTRA_DIST += modules/arch/x86/tests/amd200707.hex +EXTRA_DIST += modules/arch/x86/tests/amd-fma4.asm +EXTRA_DIST += modules/arch/x86/tests/amd-fma4.hex EXTRA_DIST += modules/arch/x86/tests/arithsmall.asm EXTRA_DIST += modules/arch/x86/tests/arithsmall.errwarn EXTRA_DIST += modules/arch/x86/tests/arithsmall.hex @@ -33,6 +35,8 @@ EXTRA_DIST += modules/arch/x86/tests/cmpxchg.asm EXTRA_DIST += modules/arch/x86/tests/cmpxchg.hex EXTRA_DIST += modules/arch/x86/tests/cpubasic-err.asm EXTRA_DIST += modules/arch/x86/tests/cpubasic-err.errwarn +EXTRA_DIST += modules/arch/x86/tests/cvt16.asm +EXTRA_DIST += modules/arch/x86/tests/cvt16.hex EXTRA_DIST += modules/arch/x86/tests/cyrix.asm EXTRA_DIST += modules/arch/x86/tests/cyrix.hex EXTRA_DIST += modules/arch/x86/tests/div-err.asm @@ -179,14 +183,6 @@ EXTRA_DIST += modules/arch/x86/tests/sse4.asm EXTRA_DIST += modules/arch/x86/tests/sse4.hex EXTRA_DIST += modules/arch/x86/tests/sse4-err.asm EXTRA_DIST += modules/arch/x86/tests/sse4-err.errwarn -EXTRA_DIST += modules/arch/x86/tests/sse5-all.asm -EXTRA_DIST += modules/arch/x86/tests/sse5-all.hex -EXTRA_DIST += modules/arch/x86/tests/sse5-basic.asm -EXTRA_DIST += modules/arch/x86/tests/sse5-basic.hex -EXTRA_DIST += modules/arch/x86/tests/sse5-cc.asm -EXTRA_DIST += modules/arch/x86/tests/sse5-cc.hex -EXTRA_DIST += modules/arch/x86/tests/sse5-err.asm -EXTRA_DIST += modules/arch/x86/tests/sse5-err.errwarn EXTRA_DIST += modules/arch/x86/tests/ssewidth.asm EXTRA_DIST += modules/arch/x86/tests/ssewidth.hex EXTRA_DIST += modules/arch/x86/tests/ssse3.asm @@ -219,6 +215,12 @@ EXTRA_DIST += modules/arch/x86/tests/xchg64.asm EXTRA_DIST += modules/arch/x86/tests/xchg64.hex EXTRA_DIST += modules/arch/x86/tests/xmm64.asm EXTRA_DIST += modules/arch/x86/tests/xmm64.hex +EXTRA_DIST += modules/arch/x86/tests/xop-all.asm +EXTRA_DIST += modules/arch/x86/tests/xop-all.hex +EXTRA_DIST += modules/arch/x86/tests/xop-basic.asm +EXTRA_DIST += modules/arch/x86/tests/xop-basic.hex +EXTRA_DIST += modules/arch/x86/tests/xop-cc.asm +EXTRA_DIST += modules/arch/x86/tests/xop-cc.hex EXTRA_DIST += modules/arch/x86/tests/xsave.asm EXTRA_DIST += modules/arch/x86/tests/xsave.hex diff --git a/modules/arch/x86/tests/amd-fma4.asm b/modules/arch/x86/tests/amd-fma4.asm new file mode 100644 index 00000000..25fdc50d --- /dev/null +++ b/modules/arch/x86/tests/amd-fma4.asm @@ -0,0 +1,109 @@ +[bits 64] +vfmaddpd xmm0, xmm1, xmm2, xmm3 +vfmaddpd xmm0, xmm1, [rax], xmm3 +vfmaddpd xmm0, xmm1, dqword [rax], xmm3 +vfmaddpd xmm0, xmm1, xmm2, [rax] +vfmaddpd xmm0, xmm1, xmm2, dqword [rax] +vfmaddpd ymm0, ymm1, ymm2, ymm3 +vfmaddpd ymm0, ymm1, [rax], ymm3 +vfmaddpd ymm0, ymm1, yword [rax], ymm3 +vfmaddpd ymm0, ymm1, ymm2, [rax] +vfmaddpd ymm0, ymm1, ymm2, yword [rax] + +vfmaddps xmm0, xmm1, xmm2, xmm3 +vfmaddps xmm0, xmm1, dqword [rax], xmm3 +vfmaddps xmm0, xmm1, xmm2, dqword [rax] +vfmaddps ymm0, ymm1, ymm2, ymm3 +vfmaddps ymm0, ymm1, yword [rax], ymm3 +vfmaddps ymm0, ymm1, ymm2, yword [rax] + +vfmaddsd xmm0, xmm1, xmm2, xmm3 +vfmaddsd xmm0, xmm1, [rax], xmm3 +vfmaddsd xmm0, xmm1, qword [rax], xmm3 +vfmaddsd xmm0, xmm1, xmm2, [rax] +vfmaddsd xmm0, xmm1, xmm2, qword [rax] + +vfmaddss xmm0, xmm1, xmm2, xmm3 +vfmaddss xmm0, xmm1, dword [rax], xmm3 +vfmaddss xmm0, xmm1, xmm2, dword [rax] + +vfmaddsubpd xmm0, xmm1, xmm2, xmm3 +vfmaddsubpd xmm0, xmm1, dqword [rax], xmm3 +vfmaddsubpd xmm0, xmm1, xmm2, dqword [rax] +vfmaddsubpd ymm0, ymm1, ymm2, ymm3 +vfmaddsubpd ymm0, ymm1, yword [rax], ymm3 +vfmaddsubpd ymm0, ymm1, ymm2, yword [rax] + +vfmaddsubps xmm0, xmm1, xmm2, xmm3 +vfmaddsubps xmm0, xmm1, dqword [rax], xmm3 +vfmaddsubps xmm0, xmm1, xmm2, dqword [rax] +vfmaddsubps ymm0, ymm1, ymm2, ymm3 +vfmaddsubps ymm0, ymm1, yword [rax], ymm3 +vfmaddsubps ymm0, ymm1, ymm2, yword [rax] + +vfmsubpd xmm0, xmm1, xmm2, xmm3 +vfmsubpd xmm0, xmm1, dqword [rax], xmm3 +vfmsubpd xmm0, xmm1, xmm2, dqword [rax] +vfmsubpd ymm0, ymm1, ymm2, ymm3 +vfmsubpd ymm0, ymm1, yword [rax], ymm3 +vfmsubpd ymm0, ymm1, ymm2, yword [rax] + +vfmsubps xmm0, xmm1, xmm2, xmm3 +vfmsubps xmm0, xmm1, dqword [rax], xmm3 +vfmsubps xmm0, xmm1, xmm2, dqword [rax] +vfmsubps ymm0, ymm1, ymm2, ymm3 +vfmsubps ymm0, ymm1, yword [rax], ymm3 +vfmsubps ymm0, ymm1, ymm2, yword [rax] + +vfmsubsd xmm0, xmm1, xmm2, xmm3 +vfmsubsd xmm0, xmm1, qword [rax], xmm3 +vfmsubsd xmm0, xmm1, xmm2, qword [rax] + +vfmsubss xmm0, xmm1, xmm2, xmm3 +vfmsubss xmm0, xmm1, dword [rax], xmm3 +vfmsubss xmm0, xmm1, xmm2, dword [rax] + +vfnmaddpd xmm0, xmm1, xmm2, xmm3 +vfnmaddpd xmm0, xmm1, dqword [rax], xmm3 +vfnmaddpd xmm0, xmm1, xmm2, dqword [rax] +vfnmaddpd ymm0, ymm1, ymm2, ymm3 +vfnmaddpd ymm0, ymm1, yword [rax], ymm3 +vfnmaddpd ymm0, ymm1, ymm2, yword [rax] + +vfnmaddps xmm0, xmm1, xmm2, xmm3 +vfnmaddps xmm0, xmm1, dqword [rax], xmm3 +vfnmaddps xmm0, xmm1, xmm2, dqword [rax] +vfnmaddps ymm0, ymm1, ymm2, ymm3 +vfnmaddps ymm0, ymm1, yword [rax], ymm3 +vfnmaddps ymm0, ymm1, ymm2, yword [rax] + +vfnmaddsd xmm0, xmm1, xmm2, xmm3 +vfnmaddsd xmm0, xmm1, qword [rax], xmm3 +vfnmaddsd xmm0, xmm1, xmm2, qword [rax] + +vfnmaddss xmm0, xmm1, xmm2, xmm3 +vfnmaddss xmm0, xmm1, dword [rax], xmm3 +vfnmaddss xmm0, xmm1, xmm2, dword [rax] + +vfnmsubpd xmm0, xmm1, xmm2, xmm3 +vfnmsubpd xmm0, xmm1, dqword [rax], xmm3 +vfnmsubpd xmm0, xmm1, xmm2, dqword [rax] +vfnmsubpd ymm0, ymm1, ymm2, ymm3 +vfnmsubpd ymm0, ymm1, yword [rax], ymm3 +vfnmsubpd ymm0, ymm1, ymm2, yword [rax] + +vfnmsubps xmm0, xmm1, xmm2, xmm3 +vfnmsubps xmm0, xmm1, dqword [rax], xmm3 +vfnmsubps xmm0, xmm1, xmm2, dqword [rax] +vfnmsubps ymm0, ymm1, ymm2, ymm3 +vfnmsubps ymm0, ymm1, yword [rax], ymm3 +vfnmsubps ymm0, ymm1, ymm2, yword [rax] + +vfnmsubsd xmm0, xmm1, xmm2, xmm3 +vfnmsubsd xmm0, xmm1, qword [rax], xmm3 +vfnmsubsd xmm0, xmm1, xmm2, qword [rax] + +vfnmsubss xmm0, xmm1, xmm2, xmm3 +vfnmsubss xmm0, xmm1, dword [rax], xmm3 +vfnmsubss xmm0, xmm1, xmm2, dword [rax] + diff --git a/modules/arch/x86/tests/amd-fma4.hex b/modules/arch/x86/tests/amd-fma4.hex new file mode 100644 index 00000000..7f51092a --- /dev/null +++ b/modules/arch/x86/tests/amd-fma4.hex @@ -0,0 +1,540 @@ +c4 +e3 +61 +69 +c2 +10 +c4 +e3 +61 +69 +00 +10 +c4 +e3 +61 +69 +00 +10 +c4 +e3 +e9 +69 +00 +10 +c4 +e3 +e9 +69 +00 +10 +c4 +e3 +65 +69 +c2 +10 +c4 +e3 +65 +69 +00 +10 +c4 +e3 +65 +69 +00 +10 +c4 +e3 +ed +69 +00 +10 +c4 +e3 +ed +69 +00 +10 +c4 +e3 +61 +68 +c2 +10 +c4 +e3 +61 +68 +00 +10 +c4 +e3 +e9 +68 +00 +10 +c4 +e3 +65 +68 +c2 +10 +c4 +e3 +65 +68 +00 +10 +c4 +e3 +ed +68 +00 +10 +c4 +e3 +61 +6b +c2 +10 +c4 +e3 +61 +6b +00 +10 +c4 +e3 +61 +6b +00 +10 +c4 +e3 +e9 +6b +00 +10 +c4 +e3 +e9 +6b +00 +10 +c4 +e3 +61 +6a +c2 +10 +c4 +e3 +61 +6a +00 +10 +c4 +e3 +e9 +6a +00 +10 +c4 +e3 +61 +5d +c2 +10 +c4 +e3 +61 +5d +00 +10 +c4 +e3 +e9 +5d +00 +10 +c4 +e3 +65 +5d +c2 +10 +c4 +e3 +65 +5d +00 +10 +c4 +e3 +ed +5d +00 +10 +c4 +e3 +61 +5c +c2 +10 +c4 +e3 +61 +5c +00 +10 +c4 +e3 +e9 +5c +00 +10 +c4 +e3 +65 +5c +c2 +10 +c4 +e3 +65 +5c +00 +10 +c4 +e3 +ed +5c +00 +10 +c4 +e3 +61 +6d +c2 +10 +c4 +e3 +61 +6d +00 +10 +c4 +e3 +e9 +6d +00 +10 +c4 +e3 +65 +6d +c2 +10 +c4 +e3 +65 +6d +00 +10 +c4 +e3 +ed +6d +00 +10 +c4 +e3 +61 +6c +c2 +10 +c4 +e3 +61 +6c +00 +10 +c4 +e3 +e9 +6c +00 +10 +c4 +e3 +65 +6c +c2 +10 +c4 +e3 +65 +6c +00 +10 +c4 +e3 +ed +6c +00 +10 +c4 +e3 +61 +6f +c2 +10 +c4 +e3 +61 +6f +00 +10 +c4 +e3 +e9 +6f +00 +10 +c4 +e3 +61 +6e +c2 +10 +c4 +e3 +61 +6e +00 +10 +c4 +e3 +e9 +6e +00 +10 +c4 +e3 +61 +79 +c2 +10 +c4 +e3 +61 +79 +00 +10 +c4 +e3 +e9 +79 +00 +10 +c4 +e3 +65 +79 +c2 +10 +c4 +e3 +65 +79 +00 +10 +c4 +e3 +ed +79 +00 +10 +c4 +e3 +61 +78 +c2 +10 +c4 +e3 +61 +78 +00 +10 +c4 +e3 +e9 +78 +00 +10 +c4 +e3 +65 +78 +c2 +10 +c4 +e3 +65 +78 +00 +10 +c4 +e3 +ed +78 +00 +10 +c4 +e3 +61 +7b +c2 +10 +c4 +e3 +61 +7b +00 +10 +c4 +e3 +e9 +7b +00 +10 +c4 +e3 +61 +7a +c2 +10 +c4 +e3 +61 +7a +00 +10 +c4 +e3 +e9 +7a +00 +10 +c4 +e3 +61 +7d +c2 +10 +c4 +e3 +61 +7d +00 +10 +c4 +e3 +e9 +7d +00 +10 +c4 +e3 +65 +7d +c2 +10 +c4 +e3 +65 +7d +00 +10 +c4 +e3 +ed +7d +00 +10 +c4 +e3 +61 +7c +c2 +10 +c4 +e3 +61 +7c +00 +10 +c4 +e3 +e9 +7c +00 +10 +c4 +e3 +65 +7c +c2 +10 +c4 +e3 +65 +7c +00 +10 +c4 +e3 +ed +7c +00 +10 +c4 +e3 +61 +7f +c2 +10 +c4 +e3 +61 +7f +00 +10 +c4 +e3 +e9 +7f +00 +10 +c4 +e3 +61 +7e +c2 +10 +c4 +e3 +61 +7e +00 +10 +c4 +e3 +e9 +7e +00 +10 diff --git a/modules/arch/x86/tests/cvt16.asm b/modules/arch/x86/tests/cvt16.asm new file mode 100644 index 00000000..5e23b4bd --- /dev/null +++ b/modules/arch/x86/tests/cvt16.asm @@ -0,0 +1,16 @@ +; BITS=16 to minimize output length +[bits 16] +vcvtph2ps xmm1, xmm4, 5 ; 8F E8 78 A0 314 05 +vcvtph2ps xmm2, [0], byte 5 ; 8F E8 78 A0 026 00 00 05 +vcvtph2ps xmm3, qword [0], 5 ; 8F E8 78 A0 036 00 00 05 +vcvtph2ps ymm1, xmm4, 5 ; 8F E8 7C A0 314 05 +vcvtph2ps ymm2, [0], byte 5 ; 8F E8 7C A0 026 00 00 05 +vcvtph2ps ymm3, dqword [0], 5 ; 8F E8 7C A0 036 00 00 05 + +vcvtps2ph xmm1, xmm4, 5 ; 8F E8 78 A1 341 05 +vcvtps2ph [0], xmm2, byte 5 ; 8F E8 78 A1 026 00 00 05 +vcvtps2ph qword [0], xmm3, 5 ; 8F E8 78 A1 036 00 00 05 +vcvtps2ph xmm1, ymm4, 5 ; 8F E8 7C A1 341 05 +vcvtps2ph [0], ymm2, byte 5 ; 8F E8 7C A1 026 00 00 05 +vcvtps2ph dqword [0], ymm3, 5 ; 8F E8 7C A1 036 00 00 05 + diff --git a/modules/arch/x86/tests/cvt16.hex b/modules/arch/x86/tests/cvt16.hex new file mode 100644 index 00000000..730d15ef --- /dev/null +++ b/modules/arch/x86/tests/cvt16.hex @@ -0,0 +1,88 @@ +8f +e8 +78 +a0 +cc +05 +8f +e8 +78 +a0 +16 +00 +00 +05 +8f +e8 +78 +a0 +1e +00 +00 +05 +8f +e8 +7c +a0 +cc +05 +8f +e8 +7c +a0 +16 +00 +00 +05 +8f +e8 +7c +a0 +1e +00 +00 +05 +8f +e8 +78 +a1 +e1 +05 +8f +e8 +78 +a1 +16 +00 +00 +05 +8f +e8 +78 +a1 +1e +00 +00 +05 +8f +e8 +7c +a1 +e1 +05 +8f +e8 +7c +a1 +16 +00 +00 +05 +8f +e8 +7c +a1 +1e +00 +00 +05 diff --git a/modules/arch/x86/tests/farbasic.asm b/modules/arch/x86/tests/farbasic.asm index 625ed14d..fa1ced0f 100644 --- a/modules/arch/x86/tests/farbasic.asm +++ b/modules/arch/x86/tests/farbasic.asm @@ -1,11 +1,11 @@ +equval equ 6:7 + [bits 32] jmp 5:4 jmp far equval -equval equ 6:7 - [bits 16] jmp 8:9 diff --git a/modules/arch/x86/tests/mixcase.asm b/modules/arch/x86/tests/mixcase.asm index 4964e721..66a96865 100644 --- a/modules/arch/x86/tests/mixcase.asm +++ b/modules/arch/x86/tests/mixcase.asm @@ -1,3 +1,3 @@ -CPU SSE5 +CPU SSSE3 MOV AX,5 diff --git a/modules/arch/x86/tests/sse5-all.asm b/modules/arch/x86/tests/sse5-all.asm deleted file mode 100644 index c4fdd6dd..00000000 --- a/modules/arch/x86/tests/sse5-all.asm +++ /dev/null @@ -1,509 +0,0 @@ -; Instructions are ordered in SSE5 databook order -; BITS=16 to minimize output length -[bits 16] -compd xmm1, xmm4, xmm7, 5 ; 0F 25 2D 347 10 05 -compd xmm2, xmm5, [0], byte 5 ; 0F 25 2D 056 20 00 00 05 -compd xmm3, xmm6, dqword [0], 5 ; 0F 25 2D 066 30 00 00 05 - -comps xmm1, xmm4, xmm7, 5 ; 0F 25 2C 347 10 05 -comps xmm2, xmm5, [0], byte 5 ; 0F 25 2C 056 20 00 00 05 -comps xmm3, xmm6, dqword [0], 5 ; 0F 25 2C 066 30 00 00 05 - -comsd xmm1, xmm4, xmm7, 5 ; 0F 25 2F 347 10 05 -comsd xmm2, xmm5, [0], byte 5 ; 0F 25 2F 056 20 00 00 05 -comsd xmm3, xmm6, qword [0], 5 ; 0F 25 2F 066 30 00 00 05 - -comss xmm1, xmm4, xmm7, 5 ; 0F 25 2E 347 10 05 -comss xmm2, xmm5, [0], byte 5 ; 0F 25 2E 056 20 00 00 05 -comss xmm3, xmm6, dword [0], 5 ; 0F 25 2E 066 30 00 00 05 - -cvtph2ps xmm1, xmm4 ; 0F 7A 30 314 -cvtph2ps xmm2, [0] ; 0F 7A 30 026 00 00 -cvtph2ps xmm3, qword [0] ; 0F 7A 30 036 00 00 - -cvtps2ph xmm1, xmm4 ; 0F 7A 31 341 -cvtps2ph [0], xmm2 ; 0F 7A 31 026 00 00 -cvtps2ph qword [0], xmm3 ; 0F 7A 31 036 00 00 - -fmaddpd xmm1, xmm1, xmm2, xmm3 ; 0F 24 01 323 10 /or/ 0F 24 01 332 18 -fmaddpd xmm1, xmm1, xmm2, [0] ; 0F 24 01 026 10 00 00 -fmaddpd xmm1, xmm1, xmm2, dqword [0] ; 0F 24 01 026 10 00 00 -fmaddpd xmm1, xmm1, [0], xmm3 ; 0F 24 01 036 18 00 00 -fmaddpd xmm1, xmm1, dqword [0], xmm3 ; 0F 24 01 036 18 00 00 -fmaddpd xmm1, xmm2, xmm3, xmm1 ; 0F 24 05 323 10 /or/ 0F 24 05 332 18 -fmaddpd xmm1, xmm2, [0], xmm1 ; 0F 24 05 026 10 00 00 -fmaddpd xmm1, xmm2, dqword [0], xmm1 ; 0F 24 05 026 10 00 00 -fmaddpd xmm1, [0], xmm3, xmm1 ; 0F 24 05 036 18 00 00 -fmaddpd xmm1, dqword [0], xmm3, xmm1 ; 0F 24 05 036 18 00 00 - -fmaddps xmm1, xmm1, xmm2, xmm3 ; 0F 24 00 323 10 /or/ 0F 24 00 332 18 -fmaddps xmm1, xmm1, xmm2, [0] ; 0F 24 00 026 10 00 00 -fmaddps xmm1, xmm1, xmm2, dqword [0] ; 0F 24 00 026 10 00 00 -fmaddps xmm1, xmm1, [0], xmm3 ; 0F 24 00 036 18 00 00 -fmaddps xmm1, xmm1, dqword [0], xmm3 ; 0F 24 00 036 18 00 00 -fmaddps xmm1, xmm2, xmm3, xmm1 ; 0F 24 04 323 10 /or/ 0F 24 04 332 18 -fmaddps xmm1, xmm2, [0], xmm1 ; 0F 24 04 026 10 00 00 -fmaddps xmm1, xmm2, dqword [0], xmm1 ; 0F 24 04 026 10 00 00 -fmaddps xmm1, [0], xmm3, xmm1 ; 0F 24 04 036 18 00 00 -fmaddps xmm1, dqword [0], xmm3, xmm1 ; 0F 24 04 036 18 00 00 - -fmaddsd xmm1, xmm1, xmm2, xmm3 ; 0F 24 03 323 10 /or/ 0F 24 03 332 18 -fmaddsd xmm1, xmm1, xmm2, [0] ; 0F 24 03 026 10 00 00 -fmaddsd xmm1, xmm1, xmm2, qword [0] ; 0F 24 03 026 10 00 00 -fmaddsd xmm1, xmm1, [0], xmm3 ; 0F 24 03 036 18 00 00 -fmaddsd xmm1, xmm1, qword [0], xmm3 ; 0F 24 03 036 18 00 00 -fmaddsd xmm1, xmm2, xmm3, xmm1 ; 0F 24 07 323 10 /or/ 0F 24 07 332 18 -fmaddsd xmm1, xmm2, [0], xmm1 ; 0F 24 07 026 10 00 00 -fmaddsd xmm1, xmm2, qword [0], xmm1 ; 0F 24 07 026 10 00 00 -fmaddsd xmm1, [0], xmm3, xmm1 ; 0F 24 07 036 18 00 00 -fmaddsd xmm1, qword [0], xmm3, xmm1 ; 0F 24 07 036 18 00 00 - -fmaddss xmm1, xmm1, xmm2, xmm3 ; 0F 24 02 323 10 /or/ 0F 24 02 332 18 -fmaddss xmm1, xmm1, xmm2, [0] ; 0F 24 02 026 10 00 00 -fmaddss xmm1, xmm1, xmm2, dword [0] ; 0F 24 02 026 10 00 00 -fmaddss xmm1, xmm1, [0], xmm3 ; 0F 24 02 036 18 00 00 -fmaddss xmm1, xmm1, dword [0], xmm3 ; 0F 24 02 036 18 00 00 -fmaddss xmm1, xmm2, xmm3, xmm1 ; 0F 24 06 323 10 /or/ 0F 24 06 332 18 -fmaddss xmm1, xmm2, [0], xmm1 ; 0F 24 06 026 10 00 00 -fmaddss xmm1, xmm2, dword [0], xmm1 ; 0F 24 06 026 10 00 00 -fmaddss xmm1, [0], xmm3, xmm1 ; 0F 24 06 036 18 00 00 -fmaddss xmm1, dword [0], xmm3, xmm1 ; 0F 24 06 036 18 00 00 - -fmsubpd xmm1, xmm1, xmm2, xmm3 ; 0F 24 09 323 10 /or/ 0F 24 09 332 18 -fmsubpd xmm1, xmm1, xmm2, [0] ; 0F 24 09 026 10 00 00 -fmsubpd xmm1, xmm1, xmm2, dqword [0] ; 0F 24 09 026 10 00 00 -fmsubpd xmm1, xmm1, [0], xmm3 ; 0F 24 09 036 18 00 00 -fmsubpd xmm1, xmm1, dqword [0], xmm3 ; 0F 24 09 036 18 00 00 -fmsubpd xmm1, xmm2, xmm3, xmm1 ; 0F 24 0D 323 10 /or/ 0F 24 0D 332 18 -fmsubpd xmm1, xmm2, [0], xmm1 ; 0F 24 0D 026 10 00 00 -fmsubpd xmm1, xmm2, dqword [0], xmm1 ; 0F 24 0D 026 10 00 00 -fmsubpd xmm1, [0], xmm3, xmm1 ; 0F 24 0D 036 18 00 00 -fmsubpd xmm1, dqword [0], xmm3, xmm1 ; 0F 24 0D 036 18 00 00 - -fmsubps xmm1, xmm1, xmm2, xmm3 ; 0F 24 08 323 10 /or/ 0F 24 08 332 18 -fmsubps xmm1, xmm1, xmm2, [0] ; 0F 24 08 026 10 00 00 -fmsubps xmm1, xmm1, xmm2, dqword [0] ; 0F 24 08 026 10 00 00 -fmsubps xmm1, xmm1, [0], xmm3 ; 0F 24 08 036 18 00 00 -fmsubps xmm1, xmm1, dqword [0], xmm3 ; 0F 24 08 036 18 00 00 -fmsubps xmm1, xmm2, xmm3, xmm1 ; 0F 24 0C 323 10 /or/ 0F 24 0C 332 18 -fmsubps xmm1, xmm2, [0], xmm1 ; 0F 24 0C 026 10 00 00 -fmsubps xmm1, xmm2, dqword [0], xmm1 ; 0F 24 0C 026 10 00 00 -fmsubps xmm1, [0], xmm3, xmm1 ; 0F 24 0C 036 18 00 00 -fmsubps xmm1, dqword [0], xmm3, xmm1 ; 0F 24 0C 036 18 00 00 - -fmsubsd xmm1, xmm1, xmm2, xmm3 ; 0F 24 0B 323 10 /or/ 0F 24 0B 332 18 -fmsubsd xmm1, xmm1, xmm2, [0] ; 0F 24 0B 026 10 00 00 -fmsubsd xmm1, xmm1, xmm2, qword [0] ; 0F 24 0B 026 10 00 00 -fmsubsd xmm1, xmm1, [0], xmm3 ; 0F 24 0B 036 18 00 00 -fmsubsd xmm1, xmm1, qword [0], xmm3 ; 0F 24 0B 036 18 00 00 -fmsubsd xmm1, xmm2, xmm3, xmm1 ; 0F 24 0F 323 10 /or/ 0F 24 0F 332 18 -fmsubsd xmm1, xmm2, [0], xmm1 ; 0F 24 0F 026 10 00 00 -fmsubsd xmm1, xmm2, qword [0], xmm1 ; 0F 24 0F 026 10 00 00 -fmsubsd xmm1, [0], xmm3, xmm1 ; 0F 24 0F 036 18 00 00 -fmsubsd xmm1, qword [0], xmm3, xmm1 ; 0F 24 0F 036 18 00 00 - -fmsubss xmm1, xmm1, xmm2, xmm3 ; 0F 24 0A 323 10 /or/ 0F 24 0A 332 18 -fmsubss xmm1, xmm1, xmm2, [0] ; 0F 24 0A 026 10 00 00 -fmsubss xmm1, xmm1, xmm2, dword [0] ; 0F 24 0A 026 10 00 00 -fmsubss xmm1, xmm1, [0], xmm3 ; 0F 24 0A 036 18 00 00 -fmsubss xmm1, xmm1, dword [0], xmm3 ; 0F 24 0A 036 18 00 00 -fmsubss xmm1, xmm2, xmm3, xmm1 ; 0F 24 0E 323 10 /or/ 0F 24 0E 332 18 -fmsubss xmm1, xmm2, [0], xmm1 ; 0F 24 0E 026 10 00 00 -fmsubss xmm1, xmm2, dword [0], xmm1 ; 0F 24 0E 026 10 00 00 -fmsubss xmm1, [0], xmm3, xmm1 ; 0F 24 0E 036 18 00 00 -fmsubss xmm1, dword [0], xmm3, xmm1 ; 0F 24 0E 036 18 00 00 - -fnmaddpd xmm1, xmm1, xmm2, xmm3 ; 0F 24 11 323 10 /or/ 0F 24 11 332 18 -fnmaddpd xmm1, xmm1, xmm2, [0] ; 0F 24 11 026 10 00 00 -fnmaddpd xmm1, xmm1, xmm2, dqword [0] ; 0F 24 11 026 10 00 00 -fnmaddpd xmm1, xmm1, [0], xmm3 ; 0F 24 11 036 18 00 00 -fnmaddpd xmm1, xmm1, dqword [0], xmm3 ; 0F 24 11 036 18 00 00 -fnmaddpd xmm1, xmm2, xmm3, xmm1 ; 0F 24 15 323 10 /or/ 0F 24 15 332 18 -fnmaddpd xmm1, xmm2, [0], xmm1 ; 0F 24 15 026 10 00 00 -fnmaddpd xmm1, xmm2, dqword [0], xmm1 ; 0F 24 15 026 10 00 00 -fnmaddpd xmm1, [0], xmm3, xmm1 ; 0F 24 15 036 18 00 00 -fnmaddpd xmm1, dqword [0], xmm3, xmm1 ; 0F 24 15 036 18 00 00 - -fnmaddps xmm1, xmm1, xmm2, xmm3 ; 0F 24 10 323 10 /or/ 0F 24 10 332 18 -fnmaddps xmm1, xmm1, xmm2, [0] ; 0F 24 10 026 10 00 00 -fnmaddps xmm1, xmm1, xmm2, dqword [0] ; 0F 24 10 026 10 00 00 -fnmaddps xmm1, xmm1, [0], xmm3 ; 0F 24 10 036 18 00 00 -fnmaddps xmm1, xmm1, dqword [0], xmm3 ; 0F 24 10 036 18 00 00 -fnmaddps xmm1, xmm2, xmm3, xmm1 ; 0F 24 14 323 10 /or/ 0F 24 14 332 18 -fnmaddps xmm1, xmm2, [0], xmm1 ; 0F 24 14 026 10 00 00 -fnmaddps xmm1, xmm2, dqword [0], xmm1 ; 0F 24 14 026 10 00 00 -fnmaddps xmm1, [0], xmm3, xmm1 ; 0F 24 14 036 18 00 00 -fnmaddps xmm1, dqword [0], xmm3, xmm1 ; 0F 24 14 036 18 00 00 - -fnmaddsd xmm1, xmm1, xmm2, xmm3 ; 0F 24 13 323 10 /or/ 0F 24 13 332 18 -fnmaddsd xmm1, xmm1, xmm2, [0] ; 0F 24 13 026 10 00 00 -fnmaddsd xmm1, xmm1, xmm2, qword [0] ; 0F 24 13 026 10 00 00 -fnmaddsd xmm1, xmm1, [0], xmm3 ; 0F 24 13 036 18 00 00 -fnmaddsd xmm1, xmm1, qword [0], xmm3 ; 0F 24 13 036 18 00 00 -fnmaddsd xmm1, xmm2, xmm3, xmm1 ; 0F 24 17 323 10 /or/ 0F 24 17 332 18 -fnmaddsd xmm1, xmm2, [0], xmm1 ; 0F 24 17 026 10 00 00 -fnmaddsd xmm1, xmm2, qword [0], xmm1 ; 0F 24 17 026 10 00 00 -fnmaddsd xmm1, [0], xmm3, xmm1 ; 0F 24 17 036 18 00 00 -fnmaddsd xmm1, qword [0], xmm3, xmm1 ; 0F 24 17 036 18 00 00 - -fnmaddss xmm1, xmm1, xmm2, xmm3 ; 0F 24 12 323 10 /or/ 0F 24 12 332 18 -fnmaddss xmm1, xmm1, xmm2, [0] ; 0F 24 12 026 10 00 00 -fnmaddss xmm1, xmm1, xmm2, dword [0] ; 0F 24 12 026 10 00 00 -fnmaddss xmm1, xmm1, [0], xmm3 ; 0F 24 12 036 18 00 00 -fnmaddss xmm1, xmm1, dword [0], xmm3 ; 0F 24 12 036 18 00 00 -fnmaddss xmm1, xmm2, xmm3, xmm1 ; 0F 24 16 323 10 /or/ 0F 24 16 332 18 -fnmaddss xmm1, xmm2, [0], xmm1 ; 0F 24 16 026 10 00 00 -fnmaddss xmm1, xmm2, dword [0], xmm1 ; 0F 24 16 026 10 00 00 -fnmaddss xmm1, [0], xmm3, xmm1 ; 0F 24 16 036 18 00 00 -fnmaddss xmm1, dword [0], xmm3, xmm1 ; 0F 24 16 036 18 00 00 - -fnmsubpd xmm1, xmm1, xmm2, xmm3 ; 0F 24 19 323 10 /or/ 0F 24 19 332 18 -fnmsubpd xmm1, xmm1, xmm2, [0] ; 0F 24 19 026 10 00 00 -fnmsubpd xmm1, xmm1, xmm2, dqword [0] ; 0F 24 19 026 10 00 00 -fnmsubpd xmm1, xmm1, [0], xmm3 ; 0F 24 19 036 18 00 00 -fnmsubpd xmm1, xmm1, dqword [0], xmm3 ; 0F 24 19 036 18 00 00 -fnmsubpd xmm1, xmm2, xmm3, xmm1 ; 0F 24 1D 323 10 /or/ 0F 24 1D 332 18 -fnmsubpd xmm1, xmm2, [0], xmm1 ; 0F 24 1D 026 10 00 00 -fnmsubpd xmm1, xmm2, dqword [0], xmm1 ; 0F 24 1D 026 10 00 00 -fnmsubpd xmm1, [0], xmm3, xmm1 ; 0F 24 1D 036 18 00 00 -fnmsubpd xmm1, dqword [0], xmm3, xmm1 ; 0F 24 1D 036 18 00 00 - -fnmsubps xmm1, xmm1, xmm2, xmm3 ; 0F 24 18 323 10 /or/ 0F 24 18 332 18 -fnmsubps xmm1, xmm1, xmm2, [0] ; 0F 24 18 026 10 00 00 -fnmsubps xmm1, xmm1, xmm2, dqword [0] ; 0F 24 18 026 10 00 00 -fnmsubps xmm1, xmm1, [0], xmm3 ; 0F 24 18 036 18 00 00 -fnmsubps xmm1, xmm1, dqword [0], xmm3 ; 0F 24 18 036 18 00 00 -fnmsubps xmm1, xmm2, xmm3, xmm1 ; 0F 24 1C 323 10 /or/ 0F 24 1C 332 18 -fnmsubps xmm1, xmm2, [0], xmm1 ; 0F 24 1C 026 10 00 00 -fnmsubps xmm1, xmm2, dqword [0], xmm1 ; 0F 24 1C 026 10 00 00 -fnmsubps xmm1, [0], xmm3, xmm1 ; 0F 24 1C 036 18 00 00 -fnmsubps xmm1, dqword [0], xmm3, xmm1 ; 0F 24 1C 036 18 00 00 - -fnmsubsd xmm1, xmm1, xmm2, xmm3 ; 0F 24 1B 323 10 /or/ 0F 24 1B 332 18 -fnmsubsd xmm1, xmm1, xmm2, [0] ; 0F 24 1B 026 10 00 00 -fnmsubsd xmm1, xmm1, xmm2, qword [0] ; 0F 24 1B 026 10 00 00 -fnmsubsd xmm1, xmm1, [0], xmm3 ; 0F 24 1B 036 18 00 00 -fnmsubsd xmm1, xmm1, qword [0], xmm3 ; 0F 24 1B 036 18 00 00 -fnmsubsd xmm1, xmm2, xmm3, xmm1 ; 0F 24 1F 323 10 /or/ 0F 24 1F 332 18 -fnmsubsd xmm1, xmm2, [0], xmm1 ; 0F 24 1F 026 10 00 00 -fnmsubsd xmm1, xmm2, qword [0], xmm1 ; 0F 24 1F 026 10 00 00 -fnmsubsd xmm1, [0], xmm3, xmm1 ; 0F 24 1F 036 18 00 00 -fnmsubsd xmm1, qword [0], xmm3, xmm1 ; 0F 24 1F 036 18 00 00 - -fnmsubss xmm1, xmm1, xmm2, xmm3 ; 0F 24 1A 323 10 /or/ 0F 24 1A 332 18 -fnmsubss xmm1, xmm1, xmm2, [0] ; 0F 24 1A 026 10 00 00 -fnmsubss xmm1, xmm1, xmm2, dword [0] ; 0F 24 1A 026 10 00 00 -fnmsubss xmm1, xmm1, [0], xmm3 ; 0F 24 1A 036 18 00 00 -fnmsubss xmm1, xmm1, dword [0], xmm3 ; 0F 24 1A 036 18 00 00 -fnmsubss xmm1, xmm2, xmm3, xmm1 ; 0F 24 1E 323 10 /or/ 0F 24 1E 332 18 -fnmsubss xmm1, xmm2, [0], xmm1 ; 0F 24 1E 026 10 00 00 -fnmsubss xmm1, xmm2, dword [0], xmm1 ; 0F 24 1E 026 10 00 00 -fnmsubss xmm1, [0], xmm3, xmm1 ; 0F 24 1E 036 18 00 00 -fnmsubss xmm1, dword [0], xmm3, xmm1 ; 0F 24 1E 036 18 00 00 - -frczpd xmm1, xmm2 ; 0F 7A 11 312 -frczpd xmm1, [0] ; 0F 7A 11 016 00 00 -frczpd xmm1, dqword [0] ; 0F 7A 11 016 00 00 - -frczps xmm1, xmm2 ; 0F 7A 10 312 -frczps xmm1, [0] ; 0F 7A 10 016 00 00 -frczps xmm1, dqword [0] ; 0F 7A 10 016 00 00 - -frczsd xmm1, xmm2 ; 0F 7A 13 312 -frczsd xmm1, [0] ; 0F 7A 13 016 00 00 -frczsd xmm1, qword [0] ; 0F 7A 13 016 00 00 - -frczss xmm1, xmm2 ; 0F 7A 12 312 -frczss xmm1, [0] ; 0F 7A 12 016 00 00 -frczss xmm1, dword [0] ; 0F 7A 12 016 00 00 - -pcmov xmm1, xmm1, xmm2, xmm3 ; 0F 24 22 323 10 /or/ 0F 24 22 332 18 -pcmov xmm1, xmm1, xmm2, [0] ; 0F 24 22 026 10 00 00 -pcmov xmm1, xmm1, xmm2, dqword [0] ; 0F 24 22 026 10 00 00 -pcmov xmm1, xmm1, [0], xmm3 ; 0F 24 22 036 18 00 00 -pcmov xmm1, xmm1, dqword [0], xmm3 ; 0F 24 22 036 18 00 00 -pcmov xmm1, xmm2, xmm3, xmm1 ; 0F 24 26 323 10 /or/ 0F 24 26 332 18 -pcmov xmm1, xmm2, [0], xmm1 ; 0F 24 26 026 10 00 00 -pcmov xmm1, xmm2, dqword [0], xmm1 ; 0F 24 26 026 10 00 00 -pcmov xmm1, [0], xmm3, xmm1 ; 0F 24 26 036 18 00 00 -pcmov xmm1, dqword [0], xmm3, xmm1 ; 0F 24 26 036 18 00 00 - -pcomb xmm1, xmm4, xmm7, 5 ; 0F 25 4C 347 10 05 -pcomb xmm2, xmm5, [0], byte 5 ; 0F 25 4C 056 20 00 00 05 -pcomb xmm3, xmm6, dqword [0], 5 ; 0F 25 4C 066 30 00 00 05 - -pcomd xmm1, xmm4, xmm7, 5 ; 0F 25 4E 347 10 05 -pcomd xmm2, xmm5, [0], byte 5 ; 0F 25 4E 056 20 00 00 05 -pcomd xmm3, xmm6, dqword [0], 5 ; 0F 25 4E 066 30 00 00 05 - -pcomq xmm1, xmm4, xmm7, 5 ; 0F 25 4F 347 10 05 -pcomq xmm2, xmm5, [0], byte 5 ; 0F 25 4F 056 20 00 00 05 -pcomq xmm3, xmm6, dqword [0], 5 ; 0F 25 4F 066 30 00 00 05 - -pcomub xmm1, xmm4, xmm7, 5 ; 0F 25 6C 347 10 05 -pcomub xmm2, xmm5, [0], byte 5 ; 0F 25 6C 056 20 00 00 05 -pcomub xmm3, xmm6, dqword [0], 5 ; 0F 25 6C 066 30 00 00 05 - -pcomud xmm1, xmm4, xmm7, 5 ; 0F 25 6E 347 10 05 -pcomud xmm2, xmm5, [0], byte 5 ; 0F 25 6E 056 20 00 00 05 -pcomud xmm3, xmm6, dqword [0], 5 ; 0F 25 6E 066 30 00 00 05 - -pcomuq xmm1, xmm4, xmm7, 5 ; 0F 25 6F 347 10 05 -pcomuq xmm2, xmm5, [0], byte 5 ; 0F 25 6F 056 20 00 00 05 -pcomuq xmm3, xmm6, dqword [0], 5 ; 0F 25 6F 066 30 00 00 05 - -pcomuw xmm1, xmm4, xmm7, 5 ; 0F 25 6D 347 10 05 -pcomuw xmm2, xmm5, [0], byte 5 ; 0F 25 6D 056 20 00 00 05 -pcomuw xmm3, xmm6, dqword [0], 5 ; 0F 25 6D 066 30 00 00 05 - -pcomw xmm1, xmm4, xmm7, 5 ; 0F 25 4D 347 10 05 -pcomw xmm2, xmm5, [0], byte 5 ; 0F 25 4D 056 20 00 00 05 -pcomw xmm3, xmm6, dqword [0], 5 ; 0F 25 4D 066 30 00 00 05 - -permpd xmm1, xmm1, xmm2, xmm3 ; 0F 24 21 323 10 /or/ 0F 24 21 332 18 -permpd xmm1, xmm1, xmm2, [0] ; 0F 24 21 026 10 00 00 -permpd xmm1, xmm1, xmm2, dqword [0] ; 0F 24 21 026 10 00 00 -permpd xmm1, xmm1, [0], xmm3 ; 0F 24 21 036 18 00 00 -permpd xmm1, xmm1, dqword [0], xmm3 ; 0F 24 21 036 18 00 00 -permpd xmm1, xmm2, xmm3, xmm1 ; 0F 24 25 323 10 /or/ 0F 24 25 332 18 -permpd xmm1, xmm2, [0], xmm1 ; 0F 24 25 026 10 00 00 -permpd xmm1, xmm2, dqword [0], xmm1 ; 0F 24 25 026 10 00 00 -permpd xmm1, [0], xmm3, xmm1 ; 0F 24 25 036 18 00 00 -permpd xmm1, dqword [0], xmm3, xmm1 ; 0F 24 25 036 18 00 00 - -permps xmm1, xmm1, xmm2, xmm3 ; 0F 24 20 323 10 /or/ 0F 24 20 332 18 -permps xmm1, xmm1, xmm2, [0] ; 0F 24 20 026 10 00 00 -permps xmm1, xmm1, xmm2, dqword [0] ; 0F 24 20 026 10 00 00 -permps xmm1, xmm1, [0], xmm3 ; 0F 24 20 036 18 00 00 -permps xmm1, xmm1, dqword [0], xmm3 ; 0F 24 20 036 18 00 00 -permps xmm1, xmm2, xmm3, xmm1 ; 0F 24 24 323 10 /or/ 0F 24 24 332 18 -permps xmm1, xmm2, [0], xmm1 ; 0F 24 24 026 10 00 00 -permps xmm1, xmm2, dqword [0], xmm1 ; 0F 24 24 026 10 00 00 -permps xmm1, [0], xmm3, xmm1 ; 0F 24 24 036 18 00 00 -permps xmm1, dqword [0], xmm3, xmm1 ; 0F 24 24 036 18 00 00 - -phaddbd xmm1, xmm2 ; 0F 7A 42 312 -phaddbd xmm1, [0] ; 0F 7A 42 016 00 00 -phaddbd xmm1, dqword [0] ; 0F 7A 42 016 00 00 - -phaddbq xmm1, xmm2 ; 0F 7A 43 312 -phaddbq xmm1, [0] ; 0F 7A 43 016 00 00 -phaddbq xmm1, dqword [0] ; 0F 7A 43 016 00 00 - -phaddbw xmm1, xmm2 ; 0F 7A 41 312 -phaddbw xmm1, [0] ; 0F 7A 41 016 00 00 -phaddbw xmm1, dqword [0] ; 0F 7A 41 016 00 00 - -phadddq xmm1, xmm2 ; 0F 7A 4B 312 -phadddq xmm1, [0] ; 0F 7A 4B 016 00 00 -phadddq xmm1, dqword [0] ; 0F 7A 4B 016 00 00 - -phaddubd xmm1, xmm2 ; 0F 7A 52 312 -phaddubd xmm1, [0] ; 0F 7A 52 016 00 00 -phaddubd xmm1, dqword [0] ; 0F 7A 52 016 00 00 - -phaddubq xmm1, xmm2 ; 0F 7A 53 312 -phaddubq xmm1, [0] ; 0F 7A 53 016 00 00 -phaddubq xmm1, dqword [0] ; 0F 7A 53 016 00 00 - -phaddubw xmm1, xmm2 ; 0F 7A 51 312 -phaddubw xmm1, [0] ; 0F 7A 51 016 00 00 -phaddubw xmm1, dqword [0] ; 0F 7A 51 016 00 00 - -phaddudq xmm1, xmm2 ; 0F 7A 5B 312 -phaddudq xmm1, [0] ; 0F 7A 5B 016 00 00 -phaddudq xmm1, dqword [0] ; 0F 7A 5B 016 00 00 - -phadduwd xmm1, xmm2 ; 0F 7A 56 312 -phadduwd xmm1, [0] ; 0F 7A 56 016 00 00 -phadduwd xmm1, dqword [0] ; 0F 7A 56 016 00 00 - -phadduwq xmm1, xmm2 ; 0F 7A 57 312 -phadduwq xmm1, [0] ; 0F 7A 57 016 00 00 -phadduwq xmm1, dqword [0] ; 0F 7A 57 016 00 00 - -phaddwd xmm1, xmm2 ; 0F 7A 46 312 -phaddwd xmm1, [0] ; 0F 7A 46 016 00 00 -phaddwd xmm1, dqword [0] ; 0F 7A 46 016 00 00 - -phaddwq xmm1, xmm2 ; 0F 7A 47 312 -phaddwq xmm1, [0] ; 0F 7A 47 016 00 00 -phaddwq xmm1, dqword [0] ; 0F 7A 47 016 00 00 - -phsubbw xmm1, xmm2 ; 0F 7A 61 312 -phsubbw xmm1, [0] ; 0F 7A 61 016 00 00 -phsubbw xmm1, dqword [0] ; 0F 7A 61 016 00 00 - -phsubdq xmm1, xmm2 ; 0F 7A 63 312 -phsubdq xmm1, [0] ; 0F 7A 63 016 00 00 -phsubdq xmm1, dqword [0] ; 0F 7A 63 016 00 00 - -phsubwd xmm1, xmm2 ; 0F 7A 62 312 -phsubwd xmm1, [0] ; 0F 7A 62 016 00 00 -phsubwd xmm1, dqword [0] ; 0F 7A 62 016 00 00 - -pmacsdd xmm1, xmm4, xmm7, xmm1 ; 0F 24 9E 347 10 -pmacsdd xmm2, xmm5, [0], xmm2 ; 0F 24 9E 056 20 00 00 -pmacsdd xmm3, xmm6, dqword [0], xmm3 ; 0F 24 9E 066 30 00 00 - -pmacsdqh xmm1, xmm4, xmm7, xmm1 ; 0F 24 9F 347 10 -pmacsdqh xmm2, xmm5, [0], xmm2 ; 0F 24 9F 056 20 00 00 -pmacsdqh xmm3, xmm6, dqword [0], xmm3 ; 0F 24 9F 066 30 00 00 - -pmacsdql xmm1, xmm4, xmm7, xmm1 ; 0F 24 97 347 10 -pmacsdql xmm2, xmm5, [0], xmm2 ; 0F 24 97 056 20 00 00 -pmacsdql xmm3, xmm6, dqword [0], xmm3 ; 0F 24 97 066 30 00 00 - -pmacssdd xmm1, xmm4, xmm7, xmm1 ; 0F 24 8E 347 10 -pmacssdd xmm2, xmm5, [0], xmm2 ; 0F 24 8E 056 20 00 00 -pmacssdd xmm3, xmm6, dqword [0], xmm3 ; 0F 24 8E 066 30 00 00 - -pmacssdqh xmm1, xmm4, xmm7, xmm1 ; 0F 24 8F 347 10 -pmacssdqh xmm2, xmm5, [0], xmm2 ; 0F 24 8F 056 20 00 00 -pmacssdqh xmm3, xmm6, dqword [0], xmm3 ; 0F 24 8F 066 30 00 00 - -pmacssdql xmm1, xmm4, xmm7, xmm1 ; 0F 24 87 347 10 -pmacssdql xmm2, xmm5, [0], xmm2 ; 0F 24 87 056 20 00 00 -pmacssdql xmm3, xmm6, dqword [0], xmm3 ; 0F 24 87 066 30 00 00 - -pmacsswd xmm1, xmm4, xmm7, xmm1 ; 0F 24 86 347 10 -pmacsswd xmm2, xmm5, [0], xmm2 ; 0F 24 86 056 20 00 00 -pmacsswd xmm3, xmm6, dqword [0], xmm3 ; 0F 24 86 066 30 00 00 - -pmacssww xmm1, xmm4, xmm7, xmm1 ; 0F 24 85 347 10 -pmacssww xmm2, xmm5, [0], xmm2 ; 0F 24 85 056 20 00 00 -pmacssww xmm3, xmm6, dqword [0], xmm3 ; 0F 24 85 066 30 00 00 - -pmacswd xmm1, xmm4, xmm7, xmm1 ; 0F 24 96 347 10 -pmacswd xmm2, xmm5, [0], xmm2 ; 0F 24 96 056 20 00 00 -pmacswd xmm3, xmm6, dqword [0], xmm3 ; 0F 24 96 066 30 00 00 - -pmacsww xmm1, xmm4, xmm7, xmm1 ; 0F 24 95 347 10 -pmacsww xmm2, xmm5, [0], xmm2 ; 0F 24 95 056 20 00 00 -pmacsww xmm3, xmm6, dqword [0], xmm3 ; 0F 24 95 066 30 00 00 - -pmadcsswd xmm1, xmm4, xmm7, xmm1 ; 0F 24 A6 347 10 -pmadcsswd xmm2, xmm5, [0], xmm2 ; 0F 24 A6 056 20 00 00 -pmadcsswd xmm3, xmm6, dqword [0], xmm3 ; 0F 24 A6 066 30 00 00 - -pmadcswd xmm1, xmm4, xmm7, xmm1 ; 0F 24 B6 347 10 -pmadcswd xmm2, xmm5, [0], xmm2 ; 0F 24 B6 056 20 00 00 -pmadcswd xmm3, xmm6, dqword [0], xmm3 ; 0F 24 B6 066 30 00 00 - -pperm xmm1, xmm1, xmm2, xmm3 ; 0F 24 23 323 10 /or/ 0F 24 23 332 18 -pperm xmm1, xmm1, xmm2, [0] ; 0F 24 23 026 10 00 00 -pperm xmm1, xmm1, xmm2, dqword [0] ; 0F 24 23 026 10 00 00 -pperm xmm1, xmm1, [0], xmm3 ; 0F 24 23 036 18 00 00 -pperm xmm1, xmm1, dqword [0], xmm3 ; 0F 24 23 036 18 00 00 -pperm xmm1, xmm2, xmm3, xmm1 ; 0F 24 27 323 10 /or/ 0F 24 27 332 18 -pperm xmm1, xmm2, [0], xmm1 ; 0F 24 27 026 10 00 00 -pperm xmm1, xmm2, dqword [0], xmm1 ; 0F 24 27 026 10 00 00 -pperm xmm1, [0], xmm3, xmm1 ; 0F 24 27 036 18 00 00 -pperm xmm1, dqword [0], xmm3, xmm1 ; 0F 24 27 036 18 00 00 - -protb xmm1, xmm2, xmm3 ; 0F 24 40 323 10 /or/ 0F 24 40 332 18 -protb xmm1, xmm2, [0] ; 0F 24 40 026 10 00 00 -protb xmm1, xmm2, dqword [0] ; 0F 24 40 026 10 00 00 -protb xmm1, [0], xmm3 ; 0F 24 40 036 18 00 00 -protb xmm1, dqword [0], xmm3 ; 0F 24 40 036 18 00 00 -protb xmm1, xmm2, byte 5 ; 0F 7B 40 312 05 -protb xmm1, [0], byte 5 ; 0F 7B 40 016 00 00 05 -protb xmm1, dqword [0], 5 ; 0F 7B 40 016 00 00 05 - -protd xmm1, xmm2, xmm3 ; 0F 24 42 323 10 /or/ 0F 24 42 332 18 -protd xmm1, xmm2, [0] ; 0F 24 42 026 10 00 00 -protd xmm1, xmm2, dqword [0] ; 0F 24 42 026 10 00 00 -protd xmm1, [0], xmm3 ; 0F 24 42 036 18 00 00 -protd xmm1, dqword [0], xmm3 ; 0F 24 42 036 18 00 00 -protd xmm1, xmm2, byte 5 ; 0F 7B 42 312 05 -protd xmm1, [0], byte 5 ; 0F 7B 42 016 00 00 05 -protd xmm1, dqword [0], 5 ; 0F 7B 42 016 00 00 05 - -protq xmm1, xmm2, xmm3 ; 0F 24 43 323 10 /or/ 0F 24 43 332 18 -protq xmm1, xmm2, [0] ; 0F 24 43 026 10 00 00 -protq xmm1, xmm2, dqword [0] ; 0F 24 43 026 10 00 00 -protq xmm1, [0], xmm3 ; 0F 24 43 036 18 00 00 -protq xmm1, dqword [0], xmm3 ; 0F 24 43 036 18 00 00 -protq xmm1, xmm2, byte 5 ; 0F 7B 43 312 05 -protq xmm1, [0], byte 5 ; 0F 7B 43 016 00 00 05 -protq xmm1, dqword [0], 5 ; 0F 7B 43 016 00 00 05 - -protw xmm1, xmm2, xmm3 ; 0F 24 41 323 10 /or/ 0F 24 41 332 18 -protw xmm1, xmm2, [0] ; 0F 24 41 026 10 00 00 -protw xmm1, xmm2, dqword [0] ; 0F 24 41 026 10 00 00 -protw xmm1, [0], xmm3 ; 0F 24 41 036 18 00 00 -protw xmm1, dqword [0], xmm3 ; 0F 24 41 036 18 00 00 -protw xmm1, xmm2, byte 5 ; 0F 7B 41 312 05 -protw xmm1, [0], byte 5 ; 0F 7B 41 016 00 00 05 -protw xmm1, dqword [0], 5 ; 0F 7B 41 016 00 00 05 - -pshab xmm1, xmm2, xmm3 ; 0F 24 48 323 10 /or/ 0F 24 48 332 18 -pshab xmm1, xmm2, [0] ; 0F 24 48 026 10 00 00 -pshab xmm1, xmm2, dqword [0] ; 0F 24 48 026 10 00 00 -pshab xmm1, [0], xmm3 ; 0F 24 48 036 18 00 00 -pshab xmm1, dqword [0], xmm3 ; 0F 24 48 036 18 00 00 - -pshad xmm1, xmm2, xmm3 ; 0F 24 4A 323 10 /or/ 0F 24 4A 332 18 -pshad xmm1, xmm2, [0] ; 0F 24 4A 026 10 00 00 -pshad xmm1, xmm2, dqword [0] ; 0F 24 4A 026 10 00 00 -pshad xmm1, [0], xmm3 ; 0F 24 4A 036 18 00 00 -pshad xmm1, dqword [0], xmm3 ; 0F 24 4A 036 18 00 00 - -pshaq xmm1, xmm2, xmm3 ; 0F 24 4B 323 10 /or/ 0F 24 4B 332 18 -pshaq xmm1, xmm2, [0] ; 0F 24 4B 026 10 00 00 -pshaq xmm1, xmm2, dqword [0] ; 0F 24 4B 026 10 00 00 -pshaq xmm1, [0], xmm3 ; 0F 24 4B 036 18 00 00 -pshaq xmm1, dqword [0], xmm3 ; 0F 24 4B 036 18 00 00 - -pshaw xmm1, xmm2, xmm3 ; 0F 24 49 323 10 /or/ 0F 24 49 332 18 -pshaw xmm1, xmm2, [0] ; 0F 24 49 026 10 00 00 -pshaw xmm1, xmm2, dqword [0] ; 0F 24 49 026 10 00 00 -pshaw xmm1, [0], xmm3 ; 0F 24 49 036 18 00 00 -pshaw xmm1, dqword [0], xmm3 ; 0F 24 49 036 18 00 00 - -pshlb xmm1, xmm2, xmm3 ; 0F 24 44 323 10 /or/ 0F 24 44 332 18 -pshlb xmm1, xmm2, [0] ; 0F 24 44 026 10 00 00 -pshlb xmm1, xmm2, dqword [0] ; 0F 24 44 026 10 00 00 -pshlb xmm1, [0], xmm3 ; 0F 24 44 036 18 00 00 -pshlb xmm1, dqword [0], xmm3 ; 0F 24 44 036 18 00 00 - -pshld xmm1, xmm2, xmm3 ; 0F 24 46 323 10 /or/ 0F 24 46 332 18 -pshld xmm1, xmm2, [0] ; 0F 24 46 026 10 00 00 -pshld xmm1, xmm2, dqword [0] ; 0F 24 46 026 10 00 00 -pshld xmm1, [0], xmm3 ; 0F 24 46 036 18 00 00 -pshld xmm1, dqword [0], xmm3 ; 0F 24 46 036 18 00 00 - -pshlq xmm1, xmm2, xmm3 ; 0F 24 47 323 10 /or/ 0F 24 47 332 18 -pshlq xmm1, xmm2, [0] ; 0F 24 47 026 10 00 00 -pshlq xmm1, xmm2, dqword [0] ; 0F 24 47 026 10 00 00 -pshlq xmm1, [0], xmm3 ; 0F 24 47 036 18 00 00 -pshlq xmm1, dqword [0], xmm3 ; 0F 24 47 036 18 00 00 - -pshlw xmm1, xmm2, xmm3 ; 0F 24 45 323 10 /or/ 0F 24 45 332 18 -pshlw xmm1, xmm2, [0] ; 0F 24 45 026 10 00 00 -pshlw xmm1, xmm2, dqword [0] ; 0F 24 45 026 10 00 00 -pshlw xmm1, [0], xmm3 ; 0F 24 45 036 18 00 00 -pshlw xmm1, dqword [0], xmm3 ; 0F 24 45 036 18 00 00 - -; SSE5 instructions that are also SSE4.1 instructions - -ptest xmm1, xmm2 ; 66 0F 38 17 312 -ptest xmm1, [0] ; 66 0F 38 17 016 00 00 -ptest xmm1, dqword [0] ; 66 0F 38 17 016 00 00 - -roundpd xmm1, xmm2, 5 ; 66 0F 3A 09 312 05 -roundpd xmm1, [0], byte 5 ; 66 0F 3A 09 016 00 00 05 -roundpd xmm1, dqword [0], 5 ; 66 0F 3A 09 016 00 00 05 - -roundps xmm1, xmm2, 5 ; 66 0F 3A 08 312 05 -roundps xmm1, [0], byte 5 ; 66 0F 3A 08 016 00 00 05 -roundps xmm1, dqword [0], 5 ; 66 0F 3A 08 016 00 00 05 - -roundsd xmm1, xmm2, 5 ; 66 0F 3A 0B 312 05 -roundsd xmm1, [0], byte 5 ; 66 0F 3A 0B 016 00 00 05 -roundsd xmm1, qword [0], 5 ; 66 0F 3A 0B 016 00 00 05 - -roundss xmm1, xmm2, 5 ; 66 0F 3A 0A 312 05 -roundss xmm1, [0], byte 5 ; 66 0F 3A 0A 016 00 00 05 -roundss xmm1, dword [0], 5 ; 66 0F 3A 0A 016 00 00 05 - diff --git a/modules/arch/x86/tests/sse5-all.hex b/modules/arch/x86/tests/sse5-all.hex deleted file mode 100644 index 1c9edacf..00000000 --- a/modules/arch/x86/tests/sse5-all.hex +++ /dev/null @@ -1,2727 +0,0 @@ -0f -25 -2d -e7 -10 -05 -0f -25 -2d -2e -20 -00 -00 -05 -0f -25 -2d -36 -30 -00 -00 -05 -0f -25 -2c -e7 -10 -05 -0f -25 -2c -2e -20 -00 -00 -05 -0f -25 -2c -36 -30 -00 -00 -05 -0f -25 -2f -e7 -10 -05 -0f -25 -2f -2e -20 -00 -00 -05 -0f -25 -2f -36 -30 -00 -00 -05 -0f -25 -2e -e7 -10 -05 -0f -25 -2e -2e -20 -00 -00 -05 -0f -25 -2e -36 -30 -00 -00 -05 -0f -7a -30 -cc -0f -7a -30 -16 -00 -00 -0f -7a -30 -1e -00 -00 -0f -7a -31 -e1 -0f -7a -31 -16 -00 -00 -0f -7a -31 -1e -00 -00 -0f -24 -01 -d3 -10 -0f -24 -01 -16 -10 -00 -00 -0f -24 -01 -16 -10 -00 -00 -0f -24 -01 -1e -18 -00 -00 -0f -24 -01 -1e -18 -00 -00 -0f -24 -05 -d3 -10 -0f -24 -05 -16 -10 -00 -00 -0f -24 -05 -16 -10 -00 -00 -0f -24 -05 -1e -18 -00 -00 -0f -24 -05 -1e -18 -00 -00 -0f -24 -00 -d3 -10 -0f -24 -00 -16 -10 -00 -00 -0f -24 -00 -16 -10 -00 -00 -0f -24 -00 -1e -18 -00 -00 -0f -24 -00 -1e -18 -00 -00 -0f -24 -04 -d3 -10 -0f -24 -04 -16 -10 -00 -00 -0f -24 -04 -16 -10 -00 -00 -0f -24 -04 -1e -18 -00 -00 -0f -24 -04 -1e -18 -00 -00 -0f -24 -03 -d3 -10 -0f -24 -03 -16 -10 -00 -00 -0f -24 -03 -16 -10 -00 -00 -0f -24 -03 -1e -18 -00 -00 -0f -24 -03 -1e -18 -00 -00 -0f -24 -07 -d3 -10 -0f -24 -07 -16 -10 -00 -00 -0f -24 -07 -16 -10 -00 -00 -0f -24 -07 -1e -18 -00 -00 -0f -24 -07 -1e -18 -00 -00 -0f -24 -02 -d3 -10 -0f -24 -02 -16 -10 -00 -00 -0f -24 -02 -16 -10 -00 -00 -0f -24 -02 -1e -18 -00 -00 -0f -24 -02 -1e -18 -00 -00 -0f -24 -06 -d3 -10 -0f -24 -06 -16 -10 -00 -00 -0f -24 -06 -16 -10 -00 -00 -0f -24 -06 -1e -18 -00 -00 -0f -24 -06 -1e -18 -00 -00 -0f -24 -09 -d3 -10 -0f -24 -09 -16 -10 -00 -00 -0f -24 -09 -16 -10 -00 -00 -0f -24 -09 -1e -18 -00 -00 -0f -24 -09 -1e -18 -00 -00 -0f -24 -0d -d3 -10 -0f -24 -0d -16 -10 -00 -00 -0f -24 -0d -16 -10 -00 -00 -0f -24 -0d -1e -18 -00 -00 -0f -24 -0d -1e -18 -00 -00 -0f -24 -08 -d3 -10 -0f -24 -08 -16 -10 -00 -00 -0f -24 -08 -16 -10 -00 -00 -0f -24 -08 -1e -18 -00 -00 -0f -24 -08 -1e -18 -00 -00 -0f -24 -0c -d3 -10 -0f -24 -0c -16 -10 -00 -00 -0f -24 -0c -16 -10 -00 -00 -0f -24 -0c -1e -18 -00 -00 -0f -24 -0c -1e -18 -00 -00 -0f -24 -0b -d3 -10 -0f -24 -0b -16 -10 -00 -00 -0f -24 -0b -16 -10 -00 -00 -0f -24 -0b -1e -18 -00 -00 -0f -24 -0b -1e -18 -00 -00 -0f -24 -0f -d3 -10 -0f -24 -0f -16 -10 -00 -00 -0f -24 -0f -16 -10 -00 -00 -0f -24 -0f -1e -18 -00 -00 -0f -24 -0f -1e -18 -00 -00 -0f -24 -0a -d3 -10 -0f -24 -0a -16 -10 -00 -00 -0f -24 -0a -16 -10 -00 -00 -0f -24 -0a -1e -18 -00 -00 -0f -24 -0a -1e -18 -00 -00 -0f -24 -0e -d3 -10 -0f -24 -0e -16 -10 -00 -00 -0f -24 -0e -16 -10 -00 -00 -0f -24 -0e -1e -18 -00 -00 -0f -24 -0e -1e -18 -00 -00 -0f -24 -11 -d3 -10 -0f -24 -11 -16 -10 -00 -00 -0f -24 -11 -16 -10 -00 -00 -0f -24 -11 -1e -18 -00 -00 -0f -24 -11 -1e -18 -00 -00 -0f -24 -15 -d3 -10 -0f -24 -15 -16 -10 -00 -00 -0f -24 -15 -16 -10 -00 -00 -0f -24 -15 -1e -18 -00 -00 -0f -24 -15 -1e -18 -00 -00 -0f -24 -10 -d3 -10 -0f -24 -10 -16 -10 -00 -00 -0f -24 -10 -16 -10 -00 -00 -0f -24 -10 -1e -18 -00 -00 -0f -24 -10 -1e -18 -00 -00 -0f -24 -14 -d3 -10 -0f -24 -14 -16 -10 -00 -00 -0f -24 -14 -16 -10 -00 -00 -0f -24 -14 -1e -18 -00 -00 -0f -24 -14 -1e -18 -00 -00 -0f -24 -13 -d3 -10 -0f -24 -13 -16 -10 -00 -00 -0f -24 -13 -16 -10 -00 -00 -0f -24 -13 -1e -18 -00 -00 -0f -24 -13 -1e -18 -00 -00 -0f -24 -17 -d3 -10 -0f -24 -17 -16 -10 -00 -00 -0f -24 -17 -16 -10 -00 -00 -0f -24 -17 -1e -18 -00 -00 -0f -24 -17 -1e -18 -00 -00 -0f -24 -12 -d3 -10 -0f -24 -12 -16 -10 -00 -00 -0f -24 -12 -16 -10 -00 -00 -0f -24 -12 -1e -18 -00 -00 -0f -24 -12 -1e -18 -00 -00 -0f -24 -16 -d3 -10 -0f -24 -16 -16 -10 -00 -00 -0f -24 -16 -16 -10 -00 -00 -0f -24 -16 -1e -18 -00 -00 -0f -24 -16 -1e -18 -00 -00 -0f -24 -19 -d3 -10 -0f -24 -19 -16 -10 -00 -00 -0f -24 -19 -16 -10 -00 -00 -0f -24 -19 -1e -18 -00 -00 -0f -24 -19 -1e -18 -00 -00 -0f -24 -1d -d3 -10 -0f -24 -1d -16 -10 -00 -00 -0f -24 -1d -16 -10 -00 -00 -0f -24 -1d -1e -18 -00 -00 -0f -24 -1d -1e -18 -00 -00 -0f -24 -18 -d3 -10 -0f -24 -18 -16 -10 -00 -00 -0f -24 -18 -16 -10 -00 -00 -0f -24 -18 -1e -18 -00 -00 -0f -24 -18 -1e -18 -00 -00 -0f -24 -1c -d3 -10 -0f -24 -1c -16 -10 -00 -00 -0f -24 -1c -16 -10 -00 -00 -0f -24 -1c -1e -18 -00 -00 -0f -24 -1c -1e -18 -00 -00 -0f -24 -1b -d3 -10 -0f -24 -1b -16 -10 -00 -00 -0f -24 -1b -16 -10 -00 -00 -0f -24 -1b -1e -18 -00 -00 -0f -24 -1b -1e -18 -00 -00 -0f -24 -1f -d3 -10 -0f -24 -1f -16 -10 -00 -00 -0f -24 -1f -16 -10 -00 -00 -0f -24 -1f -1e -18 -00 -00 -0f -24 -1f -1e -18 -00 -00 -0f -24 -1a -d3 -10 -0f -24 -1a -16 -10 -00 -00 -0f -24 -1a -16 -10 -00 -00 -0f -24 -1a -1e -18 -00 -00 -0f -24 -1a -1e -18 -00 -00 -0f -24 -1e -d3 -10 -0f -24 -1e -16 -10 -00 -00 -0f -24 -1e -16 -10 -00 -00 -0f -24 -1e -1e -18 -00 -00 -0f -24 -1e -1e -18 -00 -00 -0f -7a -11 -ca -0f -7a -11 -0e -00 -00 -0f -7a -11 -0e -00 -00 -0f -7a -10 -ca -0f -7a -10 -0e -00 -00 -0f -7a -10 -0e -00 -00 -0f -7a -13 -ca -0f -7a -13 -0e -00 -00 -0f -7a -13 -0e -00 -00 -0f -7a -12 -ca -0f -7a -12 -0e -00 -00 -0f -7a -12 -0e -00 -00 -0f -24 -22 -d3 -10 -0f -24 -22 -16 -10 -00 -00 -0f -24 -22 -16 -10 -00 -00 -0f -24 -22 -1e -18 -00 -00 -0f -24 -22 -1e -18 -00 -00 -0f -24 -26 -d3 -10 -0f -24 -26 -16 -10 -00 -00 -0f -24 -26 -16 -10 -00 -00 -0f -24 -26 -1e -18 -00 -00 -0f -24 -26 -1e -18 -00 -00 -0f -25 -4c -e7 -10 -05 -0f -25 -4c -2e -20 -00 -00 -05 -0f -25 -4c -36 -30 -00 -00 -05 -0f -25 -4e -e7 -10 -05 -0f -25 -4e -2e -20 -00 -00 -05 -0f -25 -4e -36 -30 -00 -00 -05 -0f -25 -4f -e7 -10 -05 -0f -25 -4f -2e -20 -00 -00 -05 -0f -25 -4f -36 -30 -00 -00 -05 -0f -25 -6c -e7 -10 -05 -0f -25 -6c -2e -20 -00 -00 -05 -0f -25 -6c -36 -30 -00 -00 -05 -0f -25 -6e -e7 -10 -05 -0f -25 -6e -2e -20 -00 -00 -05 -0f -25 -6e -36 -30 -00 -00 -05 -0f -25 -6f -e7 -10 -05 -0f -25 -6f -2e -20 -00 -00 -05 -0f -25 -6f -36 -30 -00 -00 -05 -0f -25 -6d -e7 -10 -05 -0f -25 -6d -2e -20 -00 -00 -05 -0f -25 -6d -36 -30 -00 -00 -05 -0f -25 -4d -e7 -10 -05 -0f -25 -4d -2e -20 -00 -00 -05 -0f -25 -4d -36 -30 -00 -00 -05 -0f -24 -21 -d3 -10 -0f -24 -21 -16 -10 -00 -00 -0f -24 -21 -16 -10 -00 -00 -0f -24 -21 -1e -18 -00 -00 -0f -24 -21 -1e -18 -00 -00 -0f -24 -25 -d3 -10 -0f -24 -25 -16 -10 -00 -00 -0f -24 -25 -16 -10 -00 -00 -0f -24 -25 -1e -18 -00 -00 -0f -24 -25 -1e -18 -00 -00 -0f -24 -20 -d3 -10 -0f -24 -20 -16 -10 -00 -00 -0f -24 -20 -16 -10 -00 -00 -0f -24 -20 -1e -18 -00 -00 -0f -24 -20 -1e -18 -00 -00 -0f -24 -24 -d3 -10 -0f -24 -24 -16 -10 -00 -00 -0f -24 -24 -16 -10 -00 -00 -0f -24 -24 -1e -18 -00 -00 -0f -24 -24 -1e -18 -00 -00 -0f -7a -42 -ca -0f -7a -42 -0e -00 -00 -0f -7a -42 -0e -00 -00 -0f -7a -43 -ca -0f -7a -43 -0e -00 -00 -0f -7a -43 -0e -00 -00 -0f -7a -41 -ca -0f -7a -41 -0e -00 -00 -0f -7a -41 -0e -00 -00 -0f -7a -4b -ca -0f -7a -4b -0e -00 -00 -0f -7a -4b -0e -00 -00 -0f -7a -52 -ca -0f -7a -52 -0e -00 -00 -0f -7a -52 -0e -00 -00 -0f -7a -53 -ca -0f -7a -53 -0e -00 -00 -0f -7a -53 -0e -00 -00 -0f -7a -51 -ca -0f -7a -51 -0e -00 -00 -0f -7a -51 -0e -00 -00 -0f -7a -5b -ca -0f -7a -5b -0e -00 -00 -0f -7a -5b -0e -00 -00 -0f -7a -56 -ca -0f -7a -56 -0e -00 -00 -0f -7a -56 -0e -00 -00 -0f -7a -57 -ca -0f -7a -57 -0e -00 -00 -0f -7a -57 -0e -00 -00 -0f -7a -46 -ca -0f -7a -46 -0e -00 -00 -0f -7a -46 -0e -00 -00 -0f -7a -47 -ca -0f -7a -47 -0e -00 -00 -0f -7a -47 -0e -00 -00 -0f -7a -61 -ca -0f -7a -61 -0e -00 -00 -0f -7a -61 -0e -00 -00 -0f -7a -63 -ca -0f -7a -63 -0e -00 -00 -0f -7a -63 -0e -00 -00 -0f -7a -62 -ca -0f -7a -62 -0e -00 -00 -0f -7a -62 -0e -00 -00 -0f -24 -9e -e7 -10 -0f -24 -9e -2e -20 -00 -00 -0f -24 -9e -36 -30 -00 -00 -0f -24 -9f -e7 -10 -0f -24 -9f -2e -20 -00 -00 -0f -24 -9f -36 -30 -00 -00 -0f -24 -97 -e7 -10 -0f -24 -97 -2e -20 -00 -00 -0f -24 -97 -36 -30 -00 -00 -0f -24 -8e -e7 -10 -0f -24 -8e -2e -20 -00 -00 -0f -24 -8e -36 -30 -00 -00 -0f -24 -8f -e7 -10 -0f -24 -8f -2e -20 -00 -00 -0f -24 -8f -36 -30 -00 -00 -0f -24 -87 -e7 -10 -0f -24 -87 -2e -20 -00 -00 -0f -24 -87 -36 -30 -00 -00 -0f -24 -86 -e7 -10 -0f -24 -86 -2e -20 -00 -00 -0f -24 -86 -36 -30 -00 -00 -0f -24 -85 -e7 -10 -0f -24 -85 -2e -20 -00 -00 -0f -24 -85 -36 -30 -00 -00 -0f -24 -96 -e7 -10 -0f -24 -96 -2e -20 -00 -00 -0f -24 -96 -36 -30 -00 -00 -0f -24 -95 -e7 -10 -0f -24 -95 -2e -20 -00 -00 -0f -24 -95 -36 -30 -00 -00 -0f -24 -a6 -e7 -10 -0f -24 -a6 -2e -20 -00 -00 -0f -24 -a6 -36 -30 -00 -00 -0f -24 -b6 -e7 -10 -0f -24 -b6 -2e -20 -00 -00 -0f -24 -b6 -36 -30 -00 -00 -0f -24 -23 -d3 -10 -0f -24 -23 -16 -10 -00 -00 -0f -24 -23 -16 -10 -00 -00 -0f -24 -23 -1e -18 -00 -00 -0f -24 -23 -1e -18 -00 -00 -0f -24 -27 -d3 -10 -0f -24 -27 -16 -10 -00 -00 -0f -24 -27 -16 -10 -00 -00 -0f -24 -27 -1e -18 -00 -00 -0f -24 -27 -1e -18 -00 -00 -0f -24 -40 -d3 -10 -0f -24 -40 -16 -10 -00 -00 -0f -24 -40 -16 -10 -00 -00 -0f -24 -40 -1e -18 -00 -00 -0f -24 -40 -1e -18 -00 -00 -0f -7b -40 -ca -05 -0f -7b -40 -0e -00 -00 -05 -0f -7b -40 -0e -00 -00 -05 -0f -24 -42 -d3 -10 -0f -24 -42 -16 -10 -00 -00 -0f -24 -42 -16 -10 -00 -00 -0f -24 -42 -1e -18 -00 -00 -0f -24 -42 -1e -18 -00 -00 -0f -7b -42 -ca -05 -0f -7b -42 -0e -00 -00 -05 -0f -7b -42 -0e -00 -00 -05 -0f -24 -43 -d3 -10 -0f -24 -43 -16 -10 -00 -00 -0f -24 -43 -16 -10 -00 -00 -0f -24 -43 -1e -18 -00 -00 -0f -24 -43 -1e -18 -00 -00 -0f -7b -43 -ca -05 -0f -7b -43 -0e -00 -00 -05 -0f -7b -43 -0e -00 -00 -05 -0f -24 -41 -d3 -10 -0f -24 -41 -16 -10 -00 -00 -0f -24 -41 -16 -10 -00 -00 -0f -24 -41 -1e -18 -00 -00 -0f -24 -41 -1e -18 -00 -00 -0f -7b -41 -ca -05 -0f -7b -41 -0e -00 -00 -05 -0f -7b -41 -0e -00 -00 -05 -0f -24 -48 -d3 -10 -0f -24 -48 -16 -10 -00 -00 -0f -24 -48 -16 -10 -00 -00 -0f -24 -48 -1e -18 -00 -00 -0f -24 -48 -1e -18 -00 -00 -0f -24 -4a -d3 -10 -0f -24 -4a -16 -10 -00 -00 -0f -24 -4a -16 -10 -00 -00 -0f -24 -4a -1e -18 -00 -00 -0f -24 -4a -1e -18 -00 -00 -0f -24 -4b -d3 -10 -0f -24 -4b -16 -10 -00 -00 -0f -24 -4b -16 -10 -00 -00 -0f -24 -4b -1e -18 -00 -00 -0f -24 -4b -1e -18 -00 -00 -0f -24 -49 -d3 -10 -0f -24 -49 -16 -10 -00 -00 -0f -24 -49 -16 -10 -00 -00 -0f -24 -49 -1e -18 -00 -00 -0f -24 -49 -1e -18 -00 -00 -0f -24 -44 -d3 -10 -0f -24 -44 -16 -10 -00 -00 -0f -24 -44 -16 -10 -00 -00 -0f -24 -44 -1e -18 -00 -00 -0f -24 -44 -1e -18 -00 -00 -0f -24 -46 -d3 -10 -0f -24 -46 -16 -10 -00 -00 -0f -24 -46 -16 -10 -00 -00 -0f -24 -46 -1e -18 -00 -00 -0f -24 -46 -1e -18 -00 -00 -0f -24 -47 -d3 -10 -0f -24 -47 -16 -10 -00 -00 -0f -24 -47 -16 -10 -00 -00 -0f -24 -47 -1e -18 -00 -00 -0f -24 -47 -1e -18 -00 -00 -0f -24 -45 -d3 -10 -0f -24 -45 -16 -10 -00 -00 -0f -24 -45 -16 -10 -00 -00 -0f -24 -45 -1e -18 -00 -00 -0f -24 -45 -1e -18 -00 -00 -66 -0f -38 -17 -ca -66 -0f -38 -17 -0e -00 -00 -66 -0f -38 -17 -0e -00 -00 -66 -0f -3a -09 -ca -05 -66 -0f -3a -09 -0e -00 -00 -05 -66 -0f -3a -09 -0e -00 -00 -05 -66 -0f -3a -08 -ca -05 -66 -0f -3a -08 -0e -00 -00 -05 -66 -0f -3a -08 -0e -00 -00 -05 -66 -0f -3a -0b -ca -05 -66 -0f -3a -0b -0e -00 -00 -05 -66 -0f -3a -0b -0e -00 -00 -05 -66 -0f -3a -0a -ca -05 -66 -0f -3a -0a -0e -00 -00 -05 -66 -0f -3a -0a -0e -00 -00 -05 diff --git a/modules/arch/x86/tests/sse5-basic.asm b/modules/arch/x86/tests/sse5-basic.asm deleted file mode 100644 index ed79e77e..00000000 --- a/modules/arch/x86/tests/sse5-basic.asm +++ /dev/null @@ -1,12 +0,0 @@ -[bits 32] -compd xmm1, xmm4, xmm7, 5 ; 0F 25 2D 347 10 05 -compd xmm2, xmm5, [0], byte 5 ; 0F 25 2D 055 20 00 00 00 00 05 -compd xmm3, xmm6, dqword [ebx+ecx*4], byte 5 ; 0F 25 2D 064 213 30 05 - -[bits 64] -compd xmm8, xmm11, xmm3, 5 ; 0F 25 2D 333 84 05 -compd xmm12, xmm4, xmm14, 5 ; 0F 25 2D 346 C1 05 -compd xmm9, xmm12, [0], byte 5 ; 0F 25 2D 044 045 94 00 00 00 00 05 -compd xmm9, xmm12, [r8], byte 5 ; 0F 25 2D 040 95 05 -compd xmm10, xmm13, dqword [rbx+r9*4], 5 ; 0F 25 2D 054 213 A6 05 - diff --git a/modules/arch/x86/tests/sse5-basic.hex b/modules/arch/x86/tests/sse5-basic.hex deleted file mode 100644 index 2d6c87b6..00000000 --- a/modules/arch/x86/tests/sse5-basic.hex +++ /dev/null @@ -1,59 +0,0 @@ -0f -25 -2d -e7 -10 -05 -0f -25 -2d -2d -20 -00 -00 -00 -00 -05 -0f -25 -2d -34 -8b -30 -05 -0f -25 -2d -db -84 -05 -0f -25 -2d -e6 -c1 -05 -0f -25 -2d -24 -25 -94 -00 -00 -00 -00 -05 -0f -25 -2d -20 -95 -05 -0f -25 -2d -2c -8b -a6 -05 diff --git a/modules/arch/x86/tests/sse5-cc.asm b/modules/arch/x86/tests/sse5-cc.asm deleted file mode 100644 index 309f5005..00000000 --- a/modules/arch/x86/tests/sse5-cc.asm +++ /dev/null @@ -1,49 +0,0 @@ -[bits 16] -comeqpd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 00 -comltpd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 01 -comungepd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 01 -comlepd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 02 -comungtpd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 02 -comunordpd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 03 -comnepd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 04 -comneqpd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 04 -comnltpd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 05 -comugepd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 05 -comnlepd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 06 -comugtpd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 06 -comordpd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 07 -comueqpd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 08 -comultpd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 09 -comngepd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 09 -comulepd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 0A -comngtpd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 0A -comfalsepd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 0B -comunepd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 0C -comuneqpd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 0C -comunltpd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 0D -comgepd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 0D -comunlepd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 0E -comgtpd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 0E -comtruepd xmm1, xmm2, xmm3 ; 0F 25 2D 323 10 0F - -pcomltb xmm1, xmm2, xmm3 ; 0F 25 4C 323 10 00 -pcomleb xmm1, xmm2, xmm3 ; 0F 25 4C 323 10 01 -pcomgtb xmm1, xmm2, xmm3 ; 0F 25 4C 323 10 02 -pcomgeb xmm1, xmm2, xmm3 ; 0F 25 4C 323 10 03 -pcomeqb xmm1, xmm2, xmm3 ; 0F 25 4C 323 10 04 -pcomneqb xmm1, xmm2, xmm3 ; 0F 25 4C 323 10 05 -pcomneb xmm1, xmm2, xmm3 ; 0F 25 4C 323 10 05 -pcomfalseb xmm1, xmm2, xmm3 ; 0F 25 4C 323 10 06 -pcomtrueb xmm1, xmm2, xmm3 ; 0F 25 4C 323 10 07 - -pcomltub xmm1, xmm2, xmm3 ; 0F 25 6C 323 10 00 -pcomleub xmm1, xmm2, xmm3 ; 0F 25 6C 323 10 01 -pcomgtub xmm1, xmm2, xmm3 ; 0F 25 6C 323 10 02 -pcomgeub xmm1, xmm2, xmm3 ; 0F 25 6C 323 10 03 -pcomequb xmm1, xmm2, xmm3 ; 0F 25 6C 323 10 04 -pcomnequb xmm1, xmm2, xmm3 ; 0F 25 6C 323 10 05 -pcomneub xmm1, xmm2, xmm3 ; 0F 25 6C 323 10 05 -pcomfalseub xmm1, xmm2, xmm3 ; 0F 25 6C 323 10 06 -pcomtrueub xmm1, xmm2, xmm3 ; 0F 25 6C 323 10 07 - - diff --git a/modules/arch/x86/tests/sse5-cc.hex b/modules/arch/x86/tests/sse5-cc.hex deleted file mode 100644 index d41b9cf8..00000000 --- a/modules/arch/x86/tests/sse5-cc.hex +++ /dev/null @@ -1,264 +0,0 @@ -0f -25 -2d -d3 -10 -00 -0f -25 -2d -d3 -10 -01 -0f -25 -2d -d3 -10 -01 -0f -25 -2d -d3 -10 -02 -0f -25 -2d -d3 -10 -02 -0f -25 -2d -d3 -10 -03 -0f -25 -2d -d3 -10 -04 -0f -25 -2d -d3 -10 -04 -0f -25 -2d -d3 -10 -05 -0f -25 -2d -d3 -10 -05 -0f -25 -2d -d3 -10 -06 -0f -25 -2d -d3 -10 -06 -0f -25 -2d -d3 -10 -07 -0f -25 -2d -d3 -10 -08 -0f -25 -2d -d3 -10 -09 -0f -25 -2d -d3 -10 -09 -0f -25 -2d -d3 -10 -0a -0f -25 -2d -d3 -10 -0a -0f -25 -2d -d3 -10 -0b -0f -25 -2d -d3 -10 -0c -0f -25 -2d -d3 -10 -0c -0f -25 -2d -d3 -10 -0d -0f -25 -2d -d3 -10 -0d -0f -25 -2d -d3 -10 -0e -0f -25 -2d -d3 -10 -0e -0f -25 -2d -d3 -10 -0f -0f -25 -4c -d3 -10 -00 -0f -25 -4c -d3 -10 -01 -0f -25 -4c -d3 -10 -02 -0f -25 -4c -d3 -10 -03 -0f -25 -4c -d3 -10 -04 -0f -25 -4c -d3 -10 -05 -0f -25 -4c -d3 -10 -05 -0f -25 -4c -d3 -10 -06 -0f -25 -4c -d3 -10 -07 -0f -25 -6c -d3 -10 -00 -0f -25 -6c -d3 -10 -01 -0f -25 -6c -d3 -10 -02 -0f -25 -6c -d3 -10 -03 -0f -25 -6c -d3 -10 -04 -0f -25 -6c -d3 -10 -05 -0f -25 -6c -d3 -10 -05 -0f -25 -6c -d3 -10 -06 -0f -25 -6c -d3 -10 -07 diff --git a/modules/arch/x86/tests/sse5-err.asm b/modules/arch/x86/tests/sse5-err.asm deleted file mode 100644 index 93b474fa..00000000 --- a/modules/arch/x86/tests/sse5-err.asm +++ /dev/null @@ -1,116 +0,0 @@ -fmaddpd xmm1, xmm2, xmm1, xmm3 ; illegal -fmaddpd xmm1, xmm2, xmm3, xmm3 ; illegal -fmaddpd xmm1, xmm2, xmm2, xmm3 ; illegal - -fmaddps xmm1, xmm2, xmm1, xmm3 ; illegal -fmaddps xmm1, xmm2, xmm3, xmm3 ; illegal -fmaddps xmm1, xmm2, xmm2, xmm3 ; illegal - -fmaddsd xmm1, xmm2, xmm1, xmm3 ; illegal -fmaddsd xmm1, xmm2, xmm3, xmm3 ; illegal -fmaddsd xmm1, xmm2, xmm2, xmm3 ; illegal - -fmaddss xmm1, xmm2, xmm1, xmm3 ; illegal -fmaddss xmm1, xmm2, xmm3, xmm3 ; illegal -fmaddss xmm1, xmm2, xmm2, xmm3 ; illegal - -fmsubpd xmm1, xmm2, xmm1, xmm3 ; illegal -fmsubpd xmm1, xmm2, xmm3, xmm3 ; illegal -fmsubpd xmm1, xmm2, xmm2, xmm3 ; illegal - -fmsubps xmm1, xmm2, xmm1, xmm3 ; illegal -fmsubps xmm1, xmm2, xmm3, xmm3 ; illegal -fmsubps xmm1, xmm2, xmm2, xmm3 ; illegal - -fmsubsd xmm1, xmm2, xmm1, xmm3 ; illegal -fmsubsd xmm1, xmm2, xmm3, xmm3 ; illegal -fmsubsd xmm1, xmm2, xmm2, xmm3 ; illegal - -fmsubss xmm1, xmm2, xmm1, xmm3 ; illegal -fmsubss xmm1, xmm2, xmm3, xmm3 ; illegal -fmsubss xmm1, xmm2, xmm2, xmm3 ; illegal - -fnmaddpd xmm1, xmm2, xmm1, xmm3 ; illegal -fnmaddpd xmm1, xmm2, xmm3, xmm3 ; illegal -fnmaddpd xmm1, xmm2, xmm2, xmm3 ; illegal - -fnmaddps xmm1, xmm2, xmm1, xmm3 ; illegal -fnmaddps xmm1, xmm2, xmm3, xmm3 ; illegal -fnmaddps xmm1, xmm2, xmm2, xmm3 ; illegal - -fnmaddsd xmm1, xmm2, xmm1, xmm3 ; illegal -fnmaddsd xmm1, xmm2, xmm3, xmm3 ; illegal -fnmaddsd xmm1, xmm2, xmm2, xmm3 ; illegal - -fnmaddss xmm1, xmm2, xmm1, xmm3 ; illegal -fnmaddss xmm1, xmm2, xmm3, xmm3 ; illegal -fnmaddss xmm1, xmm2, xmm2, xmm3 ; illegal - -fnmsubpd xmm1, xmm2, xmm1, xmm3 ; illegal -fnmsubpd xmm1, xmm2, xmm3, xmm3 ; illegal -fnmsubpd xmm1, xmm2, xmm2, xmm3 ; illegal - -fnmsubps xmm1, xmm2, xmm1, xmm3 ; illegal -fnmsubps xmm1, xmm2, xmm3, xmm3 ; illegal -fnmsubps xmm1, xmm2, xmm2, xmm3 ; illegal - -fnmsubsd xmm1, xmm2, xmm1, xmm3 ; illegal -fnmsubsd xmm1, xmm2, xmm3, xmm3 ; illegal -fnmsubsd xmm1, xmm2, xmm2, xmm3 ; illegal - -fnmsubss xmm1, xmm2, xmm1, xmm3 ; illegal -fnmsubss xmm1, xmm2, xmm3, xmm3 ; illegal -fnmsubss xmm1, xmm2, xmm2, xmm3 ; illegal - -pcmov xmm1, xmm2, xmm1, xmm3 ; illegal -pcmov xmm1, xmm2, xmm3, xmm3 ; illegal -pcmov xmm1, xmm2, xmm2, xmm3 ; illegal - -permpd xmm1, xmm2, xmm1, xmm3 ; illegal -permpd xmm1, xmm2, xmm3, xmm3 ; illegal -permpd xmm1, xmm2, xmm2, xmm3 ; illegal - -permps xmm1, xmm2, xmm1, xmm3 ; illegal -permps xmm1, xmm2, xmm3, xmm3 ; illegal -permps xmm1, xmm2, xmm2, xmm3 ; illegal - -pmacsdd xmm1, xmm2, xmm1, xmm3 ; illegal -pmacsdd xmm1, xmm1, xmm2, xmm3 ; illegal - better message? - -pmacsdqh xmm1, xmm2, xmm1, xmm3 ; illegal -pmacsdqh xmm1, xmm1, xmm2, xmm3 ; illegal - better message? - -pmacsdql xmm1, xmm2, xmm1, xmm3 ; illegal -pmacsdql xmm1, xmm1, xmm2, xmm3 ; illegal - better message? - -pmacssdd xmm1, xmm2, xmm1, xmm3 ; illegal -pmacssdd xmm1, xmm1, xmm2, xmm3 ; illegal - better message? - -pmacssdqh xmm1, xmm2, xmm1, xmm3 ; illegal -pmacssdqh xmm1, xmm1, xmm2, xmm3 ; illegal - better message? - -pmacssdql xmm1, xmm2, xmm1, xmm3 ; illegal -pmacssdql xmm1, xmm1, xmm2, xmm3 ; illegal - better message? - -pmacsswd xmm1, xmm2, xmm1, xmm3 ; illegal -pmacsswd xmm1, xmm1, xmm2, xmm3 ; illegal - better message? - -pmacssww xmm1, xmm2, xmm1, xmm3 ; illegal -pmacssww xmm1, xmm1, xmm2, xmm3 ; illegal - better message? - -pmacswd xmm1, xmm2, xmm1, xmm3 ; illegal -pmacswd xmm1, xmm1, xmm2, xmm3 ; illegal - better message? - -pmacsww xmm1, xmm2, xmm1, xmm3 ; illegal -pmacsww xmm1, xmm1, xmm2, xmm3 ; illegal - better message? - -pmadcsswd xmm1, xmm2, xmm1, xmm3 ; illegal -pmadcsswd xmm1, xmm1, xmm2, xmm3 ; illegal - better message? - -pmadcswd xmm1, xmm2, xmm1, xmm3 ; illegal -pmadcswd xmm1, xmm1, xmm2, xmm3 ; illegal - better message? - -pperm xmm1, xmm2, xmm1, xmm3 ; illegal -pperm xmm1, xmm2, xmm3, xmm3 ; illegal -pperm xmm1, xmm2, xmm2, xmm3 ; illegal - diff --git a/modules/arch/x86/tests/sse5-err.errwarn b/modules/arch/x86/tests/sse5-err.errwarn deleted file mode 100644 index 3c76880e..00000000 --- a/modules/arch/x86/tests/sse5-err.errwarn +++ /dev/null @@ -1,84 +0,0 @@ --:1: error: one of source operand 1 or 3 must match dest operand --:2: error: one of source operand 1 or 3 must match dest operand --:3: error: one of source operand 1 or 3 must match dest operand --:5: error: one of source operand 1 or 3 must match dest operand --:6: error: one of source operand 1 or 3 must match dest operand --:7: error: one of source operand 1 or 3 must match dest operand --:9: error: one of source operand 1 or 3 must match dest operand --:10: error: one of source operand 1 or 3 must match dest operand --:11: error: one of source operand 1 or 3 must match dest operand --:13: error: one of source operand 1 or 3 must match dest operand --:14: error: one of source operand 1 or 3 must match dest operand --:15: error: one of source operand 1 or 3 must match dest operand --:17: error: one of source operand 1 or 3 must match dest operand --:18: error: one of source operand 1 or 3 must match dest operand --:19: error: one of source operand 1 or 3 must match dest operand --:21: error: one of source operand 1 or 3 must match dest operand --:22: error: one of source operand 1 or 3 must match dest operand --:23: error: one of source operand 1 or 3 must match dest operand --:25: error: one of source operand 1 or 3 must match dest operand --:26: error: one of source operand 1 or 3 must match dest operand --:27: error: one of source operand 1 or 3 must match dest operand --:29: error: one of source operand 1 or 3 must match dest operand --:30: error: one of source operand 1 or 3 must match dest operand --:31: error: one of source operand 1 or 3 must match dest operand --:33: error: one of source operand 1 or 3 must match dest operand --:34: error: one of source operand 1 or 3 must match dest operand --:35: error: one of source operand 1 or 3 must match dest operand --:37: error: one of source operand 1 or 3 must match dest operand --:38: error: one of source operand 1 or 3 must match dest operand --:39: error: one of source operand 1 or 3 must match dest operand --:41: error: one of source operand 1 or 3 must match dest operand --:42: error: one of source operand 1 or 3 must match dest operand --:43: error: one of source operand 1 or 3 must match dest operand --:45: error: one of source operand 1 or 3 must match dest operand --:46: error: one of source operand 1 or 3 must match dest operand --:47: error: one of source operand 1 or 3 must match dest operand --:49: error: one of source operand 1 or 3 must match dest operand --:50: error: one of source operand 1 or 3 must match dest operand --:51: error: one of source operand 1 or 3 must match dest operand --:53: error: one of source operand 1 or 3 must match dest operand --:54: error: one of source operand 1 or 3 must match dest operand --:55: error: one of source operand 1 or 3 must match dest operand --:57: error: one of source operand 1 or 3 must match dest operand --:58: error: one of source operand 1 or 3 must match dest operand --:59: error: one of source operand 1 or 3 must match dest operand --:61: error: one of source operand 1 or 3 must match dest operand --:62: error: one of source operand 1 or 3 must match dest operand --:63: error: one of source operand 1 or 3 must match dest operand --:65: error: one of source operand 1 or 3 must match dest operand --:66: error: one of source operand 1 or 3 must match dest operand --:67: error: one of source operand 1 or 3 must match dest operand --:69: error: one of source operand 1 or 3 must match dest operand --:70: error: one of source operand 1 or 3 must match dest operand --:71: error: one of source operand 1 or 3 must match dest operand --:73: error: one of source operand 1 or 3 must match dest operand --:74: error: one of source operand 1 or 3 must match dest operand --:75: error: one of source operand 1 or 3 must match dest operand --:77: error: one of source operand 1 or 3 must match dest operand --:78: error: one of source operand 1 or 3 must match dest operand --:80: error: one of source operand 1 or 3 must match dest operand --:81: error: one of source operand 1 or 3 must match dest operand --:83: error: one of source operand 1 or 3 must match dest operand --:84: error: one of source operand 1 or 3 must match dest operand --:86: error: one of source operand 1 or 3 must match dest operand --:87: error: one of source operand 1 or 3 must match dest operand --:89: error: one of source operand 1 or 3 must match dest operand --:90: error: one of source operand 1 or 3 must match dest operand --:92: error: one of source operand 1 or 3 must match dest operand --:93: error: one of source operand 1 or 3 must match dest operand --:95: error: one of source operand 1 or 3 must match dest operand --:96: error: one of source operand 1 or 3 must match dest operand --:98: error: one of source operand 1 or 3 must match dest operand --:99: error: one of source operand 1 or 3 must match dest operand --:101: error: one of source operand 1 or 3 must match dest operand --:102: error: one of source operand 1 or 3 must match dest operand --:104: error: one of source operand 1 or 3 must match dest operand --:105: error: one of source operand 1 or 3 must match dest operand --:107: error: one of source operand 1 or 3 must match dest operand --:108: error: one of source operand 1 or 3 must match dest operand --:110: error: one of source operand 1 or 3 must match dest operand --:111: error: one of source operand 1 or 3 must match dest operand --:113: error: one of source operand 1 or 3 must match dest operand --:114: error: one of source operand 1 or 3 must match dest operand --:115: error: one of source operand 1 or 3 must match dest operand diff --git a/modules/arch/x86/tests/xop-all.asm b/modules/arch/x86/tests/xop-all.asm new file mode 100644 index 00000000..db5dabf0 --- /dev/null +++ b/modules/arch/x86/tests/xop-all.asm @@ -0,0 +1,266 @@ +; Instructions are ordered in XOP databook order +; BITS=16 to minimize output length +[bits 16] +vfrczpd xmm1, xmm2 ; 8F E9 78 81 312 +vfrczpd xmm1, [0] ; 8F E9 78 81 016 00 00 +vfrczpd xmm1, dqword [0] ; 8F E9 78 81 016 00 00 +vfrczpd ymm1, ymm2 ; 8F E9 7C 81 312 +vfrczpd ymm1, [0] ; 8F E9 7C 81 016 00 00 +vfrczpd ymm1, yword [0] ; 8F E9 7C 81 016 00 00 + +vfrczps xmm1, xmm2 ; 8F E9 78 80 312 +vfrczps xmm1, [0] ; 8F E9 78 80 016 00 00 +vfrczps xmm1, dqword [0] ; 8F E9 78 80 016 00 00 +vfrczps ymm1, ymm2 ; 8F E9 7C 80 312 +vfrczps ymm1, [0] ; 8F E9 7C 80 016 00 00 +vfrczps ymm1, yword [0] ; 8F E9 7C 80 016 00 00 + +vfrczsd xmm1, xmm2 ; 8F E9 78 83 312 +vfrczsd xmm1, [0] ; 8F E9 78 83 016 00 00 +vfrczsd xmm1, qword [0] ; 8F E9 78 83 016 00 00 + +vfrczss xmm1, xmm2 ; 8F E9 78 82 312 +vfrczss xmm1, [0] ; 8F E9 78 82 016 00 00 +vfrczss xmm1, dword [0] ; 8F E9 78 82 016 00 00 + +vpcmov xmm1, xmm2, xmm3, xmm4 ; 8F E8 68 A2 313 40 /or/ 8F E8 E8 A2 314 30 +vpcmov xmm1, xmm2, xmm3, [0] ; 8F E8 E8 A2 016 00 00 30 +vpcmov xmm1, xmm2, xmm3, dqword [0] ; 8F E8 E8 A2 016 00 00 30 +vpcmov xmm1, xmm2, [0], xmm4 ; 8F E8 68 A2 016 00 00 40 +vpcmov xmm1, xmm2, dqword [0], xmm4 ; 8F E8 68 A2 016 00 00 40 +vpcmov ymm1, ymm2, ymm3, ymm4 ; 8F E8 6C A2 313 40 /or/ 8F E8 EC A2 314 30 +vpcmov ymm1, ymm2, ymm3, [0] ; 8F E8 EC A2 016 00 00 30 +vpcmov ymm1, ymm2, ymm3, yword [0] ; 8F E8 EC A2 016 00 00 30 +vpcmov ymm1, ymm2, [0], ymm4 ; 8F E8 6C A2 016 00 00 40 +vpcmov ymm1, ymm2, yword [0], ymm4 ; 8F E8 6C A2 016 00 00 40 + +vpcomb xmm1, xmm4, xmm7, 5 ; 8F E8 58 CC 317 05 +vpcomb xmm2, xmm5, [0], byte 5 ; 8F E8 50 CC 026 00 00 05 +vpcomb xmm3, xmm6, dqword [0], 5 ; 8F E8 48 CC 036 00 00 05 + +vpcomd xmm1, xmm4, xmm7, 5 ; 8F E8 58 CE 317 05 +vpcomd xmm2, xmm5, [0], byte 5 ; 8F E8 50 CE 026 00 00 05 +vpcomd xmm3, xmm6, dqword [0], 5 ; 8F E8 48 CE 036 00 00 05 + +vpcomq xmm1, xmm4, xmm7, 5 ; 8F E8 58 CF 317 05 +vpcomq xmm2, xmm5, [0], byte 5 ; 8F E8 50 CF 026 00 00 05 +vpcomq xmm3, xmm6, dqword [0], 5 ; 8F E8 48 CF 036 00 00 05 + +vpcomub xmm1, xmm4, xmm7, 5 ; 8F E8 58 EC 317 05 +vpcomub xmm2, xmm5, [0], byte 5 ; 8F E8 50 EC 026 00 00 05 +vpcomub xmm3, xmm6, dqword [0], 5 ; 8F E8 48 EC 036 00 00 05 + +vpcomud xmm1, xmm4, xmm7, 5 ; 8F E8 58 EE 317 05 +vpcomud xmm2, xmm5, [0], byte 5 ; 8F E8 50 EE 026 00 00 05 +vpcomud xmm3, xmm6, dqword [0], 5 ; 8F E8 48 EE 036 00 00 05 + +vpcomuq xmm1, xmm4, xmm7, 5 ; 8F E8 58 EF 317 05 +vpcomuq xmm2, xmm5, [0], byte 5 ; 8F E8 50 EF 026 00 00 05 +vpcomuq xmm3, xmm6, dqword [0], 5 ; 8F E8 48 EF 036 00 00 05 + +vpcomuw xmm1, xmm4, xmm7, 5 ; 8F E8 58 ED 317 05 +vpcomuw xmm2, xmm5, [0], byte 5 ; 8F E8 50 ED 026 00 00 05 +vpcomuw xmm3, xmm6, dqword [0], 5 ; 8F E8 48 ED 036 00 00 05 + +vpcomw xmm1, xmm4, xmm7, 5 ; 8F E8 58 CD 317 05 +vpcomw xmm2, xmm5, [0], byte 5 ; 8F E8 50 CD 026 00 00 05 +vpcomw xmm3, xmm6, dqword [0], 5 ; 8F E8 48 CD 036 00 00 05 + +vphaddbd xmm1, xmm2 ; 8F E9 78 C2 312 +vphaddbd xmm1, [0] ; 8F E9 78 C2 016 00 00 +vphaddbd xmm1, dqword [0] ; 8F E9 78 C2 016 00 00 + +vphaddbq xmm1, xmm2 ; 8F E9 78 C3 312 +vphaddbq xmm1, [0] ; 8F E9 78 C3 016 00 00 +vphaddbq xmm1, dqword [0] ; 8F E9 78 C3 016 00 00 + +vphaddbw xmm1, xmm2 ; 8F E9 78 C1 312 +vphaddbw xmm1, [0] ; 8F E9 78 C1 016 00 00 +vphaddbw xmm1, dqword [0] ; 8F E9 78 C1 016 00 00 + +vphadddq xmm1, xmm2 ; 8F E9 78 CB 312 +vphadddq xmm1, [0] ; 8F E9 78 CB 016 00 00 +vphadddq xmm1, dqword [0] ; 8F E9 78 CB 016 00 00 + +vphaddubd xmm1, xmm2 ; 8F E9 78 D2 312 +vphaddubd xmm1, [0] ; 8F E9 78 D2 016 00 00 +vphaddubd xmm1, dqword [0] ; 8F E9 78 D2 016 00 00 + +vphaddubq xmm1, xmm2 ; 8F E9 78 D3 312 +vphaddubq xmm1, [0] ; 8F E9 78 D3 016 00 00 +vphaddubq xmm1, dqword [0] ; 8F E9 78 D3 016 00 00 + +vphaddubw xmm1, xmm2 ; 8F E9 78 D1 312 +vphaddubw xmm1, [0] ; 8F E9 78 D1 016 00 00 +vphaddubw xmm1, dqword [0] ; 8F E9 78 D1 016 00 00 + +vphaddudq xmm1, xmm2 ; 8F E9 78 DB 312 +vphaddudq xmm1, [0] ; 8F E9 78 DB 016 00 00 +vphaddudq xmm1, dqword [0] ; 8F E9 78 DB 016 00 00 + +vphadduwd xmm1, xmm2 ; 8F E9 78 D6 312 +vphadduwd xmm1, [0] ; 8F E9 78 D6 016 00 00 +vphadduwd xmm1, dqword [0] ; 8F E9 78 D6 016 00 00 + +vphadduwq xmm1, xmm2 ; 8F E9 78 D7 312 +vphadduwq xmm1, [0] ; 8F E9 78 D7 016 00 00 +vphadduwq xmm1, dqword [0] ; 8F E9 78 D7 016 00 00 + +vphaddwd xmm1, xmm2 ; 8F E9 78 C6 312 +vphaddwd xmm1, [0] ; 8F E9 78 C6 016 00 00 +vphaddwd xmm1, dqword [0] ; 8F E9 78 C6 016 00 00 + +vphaddwq xmm1, xmm2 ; 8F E9 78 C7 312 +vphaddwq xmm1, [0] ; 8F E9 78 C7 016 00 00 +vphaddwq xmm1, dqword [0] ; 8F E9 78 C7 016 00 00 + +vphsubbw xmm1, xmm2 ; 8F E9 78 E1 312 +vphsubbw xmm1, [0] ; 8F E9 78 E1 016 00 00 +vphsubbw xmm1, dqword [0] ; 8F E9 78 E1 016 00 00 + +vphsubdq xmm1, xmm2 ; 8F E9 78 E3 312 +vphsubdq xmm1, [0] ; 8F E9 78 E3 016 00 00 +vphsubdq xmm1, dqword [0] ; 8F E9 78 E3 016 00 00 + +vphsubwd xmm1, xmm2 ; 8F E9 78 E2 312 +vphsubwd xmm1, [0] ; 8F E9 78 E2 016 00 00 +vphsubwd xmm1, dqword [0] ; 8F E9 78 E2 016 00 00 + +vpmacsdd xmm1, xmm4, xmm7, xmm3 ; 8F E8 58 9E 317 30 +vpmacsdd xmm2, xmm5, [0], xmm0 ; 8F E8 50 9E 026 00 00 00 +vpmacsdd xmm3, xmm6, dqword [0], xmm2 ; 8F E8 48 9E 036 00 00 20 + +vpmacsdqh xmm1, xmm4, xmm7, xmm3 ; 8F E8 58 9F 317 30 +vpmacsdqh xmm2, xmm5, [0], xmm0 ; 8F E8 50 9F 026 00 00 00 +vpmacsdqh xmm3, xmm6, dqword [0], xmm2 ; 8F E8 48 9F 036 00 00 20 + +vpmacsdql xmm1, xmm4, xmm7, xmm3 ; 8F E8 58 97 317 30 +vpmacsdql xmm2, xmm5, [0], xmm0 ; 8F E8 50 97 026 00 00 00 +vpmacsdql xmm3, xmm6, dqword [0], xmm2 ; 8F E8 48 97 036 00 00 20 + +vpmacssdd xmm1, xmm4, xmm7, xmm3 ; 8F E8 58 8E 317 30 +vpmacssdd xmm2, xmm5, [0], xmm0 ; 8F E8 50 8E 026 00 00 00 +vpmacssdd xmm3, xmm6, dqword [0], xmm2 ; 8F E8 48 8E 036 00 00 20 + +vpmacssdqh xmm1, xmm4, xmm7, xmm3 ; 8F E8 58 8F 317 30 +vpmacssdqh xmm2, xmm5, [0], xmm0 ; 8F E8 50 8F 026 00 00 00 +vpmacssdqh xmm3, xmm6, dqword [0], xmm2 ; 8F E8 48 8F 036 00 00 20 + +vpmacssdql xmm1, xmm4, xmm7, xmm3 ; 8F E8 58 87 317 30 +vpmacssdql xmm2, xmm5, [0], xmm0 ; 8F E8 50 87 026 00 00 00 +vpmacssdql xmm3, xmm6, dqword [0], xmm2 ; 8F E8 48 87 036 00 00 20 + +vpmacsswd xmm1, xmm4, xmm7, xmm3 ; 8F E8 58 86 317 30 +vpmacsswd xmm2, xmm5, [0], xmm0 ; 8F E8 50 86 026 00 00 00 +vpmacsswd xmm3, xmm6, dqword [0], xmm2 ; 8F E8 48 86 036 00 00 20 + +vpmacssww xmm1, xmm4, xmm7, xmm3 ; 8F E8 58 85 317 30 +vpmacssww xmm2, xmm5, [0], xmm0 ; 8F E8 50 85 026 00 00 00 +vpmacssww xmm3, xmm6, dqword [0], xmm2 ; 8F E8 48 85 036 00 00 20 + +vpmacswd xmm1, xmm4, xmm7, xmm3 ; 8F E8 58 96 317 30 +vpmacswd xmm2, xmm5, [0], xmm0 ; 8F E8 50 96 026 00 00 00 +vpmacswd xmm3, xmm6, dqword [0], xmm2 ; 8F E8 48 96 036 00 00 20 + +vpmacsww xmm1, xmm4, xmm7, xmm3 ; 8F E8 58 95 317 30 +vpmacsww xmm2, xmm5, [0], xmm0 ; 8F E8 50 95 026 00 00 00 +vpmacsww xmm3, xmm6, dqword [0], xmm2 ; 8F E8 48 95 036 00 00 20 + +vpmadcsswd xmm1, xmm4, xmm7, xmm3 ; 8F E8 58 A6 317 30 +vpmadcsswd xmm2, xmm5, [0], xmm0 ; 8F E8 50 A6 026 00 00 00 +vpmadcsswd xmm3, xmm6, dqword [0], xmm2 ; 8F E8 48 A6 036 00 00 20 + +vpmadcswd xmm1, xmm4, xmm7, xmm3 ; 8F E8 58 B6 317 30 +vpmadcswd xmm2, xmm5, [0], xmm0 ; 8F E8 50 B6 026 00 00 00 +vpmadcswd xmm3, xmm6, dqword [0], xmm2 ; 8F E8 48 B6 036 00 00 20 + +vpperm xmm1, xmm2, xmm3, xmm4 ; 8F E8 68 A3 313 40 /or/ 8F E8 E8 A3 314 30 +vpperm xmm1, xmm2, xmm3, [0] ; 8F E8 E8 A3 016 00 00 30 +vpperm xmm1, xmm2, xmm3, dqword [0] ; 8F E8 E8 A3 016 00 00 30 +vpperm xmm1, xmm2, [0], xmm4 ; 8F E8 68 A3 016 00 00 40 +vpperm xmm1, xmm2, dqword [0], xmm4 ; 8F E8 68 A3 016 00 00 40 + +vprotb xmm1, xmm2, xmm3 ; 8F E9 60 90 312 /or/ 8F E9 E8 90 313 +vprotb xmm1, xmm2, [0] ; 8F E9 E8 90 016 00 00 +vprotb xmm1, xmm2, dqword [0] ; 8F E9 E8 90 016 00 00 +vprotb xmm1, [0], xmm3 ; 8F E9 60 90 016 00 00 +vprotb xmm1, dqword [0], xmm3 ; 8F E9 60 90 016 00 00 +vprotb xmm1, xmm2, byte 5 ; 8F E8 78 C0 312 05 +vprotb xmm1, [0], byte 5 ; 8F E8 78 C0 016 00 00 05 +vprotb xmm1, dqword [0], 5 ; 8F E8 78 C0 016 00 00 05 + +vprotd xmm1, xmm2, xmm3 ; 8F E9 60 92 312 /or/ 8F E9 E8 92 313 +vprotd xmm1, xmm2, [0] ; 8F E9 E8 92 016 00 00 +vprotd xmm1, xmm2, dqword [0] ; 8F E9 E8 92 016 00 00 +vprotd xmm1, [0], xmm3 ; 8F E9 60 92 016 00 00 +vprotd xmm1, dqword [0], xmm3 ; 8F E9 60 92 016 00 00 +vprotd xmm1, xmm2, byte 5 ; 8F E8 78 C2 312 05 +vprotd xmm1, [0], byte 5 ; 8F E8 78 C2 016 00 00 05 +vprotd xmm1, dqword [0], 5 ; 8F E8 78 C2 016 00 00 05 + +vprotq xmm1, xmm2, xmm3 ; 8F E9 60 93 312 /or/ 8F E9 E8 93 313 +vprotq xmm1, xmm2, [0] ; 8F E9 E8 93 016 00 00 +vprotq xmm1, xmm2, dqword [0] ; 8F E9 E8 93 016 00 00 +vprotq xmm1, [0], xmm3 ; 8F E9 60 93 016 00 00 +vprotq xmm1, dqword [0], xmm3 ; 8F E9 60 93 016 00 00 +vprotq xmm1, xmm2, byte 5 ; 8F E8 78 C3 312 05 +vprotq xmm1, [0], byte 5 ; 8F E8 78 C3 016 00 00 05 +vprotq xmm1, dqword [0], 5 ; 8F E8 78 C3 016 00 00 05 + +vprotw xmm1, xmm2, xmm3 ; 8F E9 60 91 312 /or/ 8F E9 E8 91 313 +vprotw xmm1, xmm2, [0] ; 8F E9 E8 91 016 00 00 +vprotw xmm1, xmm2, dqword [0] ; 8F E9 E8 91 016 00 00 +vprotw xmm1, [0], xmm3 ; 8F E9 60 91 016 00 00 +vprotw xmm1, dqword [0], xmm3 ; 8F E9 60 91 016 00 00 +vprotw xmm1, xmm2, byte 5 ; 8F E8 78 C1 312 05 +vprotw xmm1, [0], byte 5 ; 8F E8 78 C1 016 00 00 05 +vprotw xmm1, dqword [0], 5 ; 8F E8 78 C1 016 00 00 05 + +vpshab xmm1, xmm2, xmm3 ; 8F E9 60 98 312 /or/ 8F E9 E8 98 313 +vpshab xmm1, xmm2, [0] ; 8F E9 E8 98 016 00 00 +vpshab xmm1, xmm2, dqword [0] ; 8F E9 E8 98 016 00 00 +vpshab xmm1, [0], xmm3 ; 8F E9 60 98 016 00 00 +vpshab xmm1, dqword [0], xmm3 ; 8F E9 60 98 016 00 00 + +vpshad xmm1, xmm2, xmm3 ; 8F E9 60 9A 312 /or/ 8F E9 E8 9A 313 +vpshad xmm1, xmm2, [0] ; 8F E9 E8 9A 016 00 00 +vpshad xmm1, xmm2, dqword [0] ; 8F E9 E8 9A 016 00 00 +vpshad xmm1, [0], xmm3 ; 8F E9 60 9A 016 00 00 +vpshad xmm1, dqword [0], xmm3 ; 8F E9 60 9A 016 00 00 + +vpshaq xmm1, xmm2, xmm3 ; 8F E9 60 9B 312 /or/ 8F E9 E8 9B 313 +vpshaq xmm1, xmm2, [0] ; 8F E9 E8 9B 016 00 00 +vpshaq xmm1, xmm2, dqword [0] ; 8F E9 E8 9B 016 00 00 +vpshaq xmm1, [0], xmm3 ; 8F E9 60 9B 016 00 00 +vpshaq xmm1, dqword [0], xmm3 ; 8F E9 60 9B 016 00 00 + +vpshaw xmm1, xmm2, xmm3 ; 8F E9 60 99 312 /or/ 8F E9 E8 99 313 +vpshaw xmm1, xmm2, [0] ; 8F E9 E8 99 016 00 00 +vpshaw xmm1, xmm2, dqword [0] ; 8F E9 E8 99 016 00 00 +vpshaw xmm1, [0], xmm3 ; 8F E9 60 99 016 00 00 +vpshaw xmm1, dqword [0], xmm3 ; 8F E9 60 99 016 00 00 + +vpshlb xmm1, xmm2, xmm3 ; 8F E9 60 94 312 /or/ 8F E9 E8 94 313 +vpshlb xmm1, xmm2, [0] ; 8F E9 E8 94 016 00 00 +vpshlb xmm1, xmm2, dqword [0] ; 8F E9 E8 94 016 00 00 +vpshlb xmm1, [0], xmm3 ; 8F E9 60 94 016 00 00 +vpshlb xmm1, dqword [0], xmm3 ; 8F E9 60 94 016 00 00 + +vpshld xmm1, xmm2, xmm3 ; 8F E9 60 96 312 /or/ 8F E9 E8 96 313 +vpshld xmm1, xmm2, [0] ; 8F E9 E8 96 016 00 00 +vpshld xmm1, xmm2, dqword [0] ; 8F E9 E8 96 016 00 00 +vpshld xmm1, [0], xmm3 ; 8F E9 60 96 016 00 00 +vpshld xmm1, dqword [0], xmm3 ; 8F E9 60 96 016 00 00 + +vpshlq xmm1, xmm2, xmm3 ; 8F E9 60 97 312 /or/ 8F E9 E8 97 313 +vpshlq xmm1, xmm2, [0] ; 8F E9 E8 97 016 00 00 +vpshlq xmm1, xmm2, dqword [0] ; 8F E9 E8 97 016 00 00 +vpshlq xmm1, [0], xmm3 ; 8F E9 60 97 016 00 00 +vpshlq xmm1, dqword [0], xmm3 ; 8F E9 60 97 016 00 00 + +vpshlw xmm1, xmm2, xmm3 ; 8F E9 60 95 312 /or/ 8F E9 E8 95 313 +vpshlw xmm1, xmm2, [0] ; 8F E9 E8 95 016 00 00 +vpshlw xmm1, xmm2, dqword [0] ; 8F E9 E8 95 016 00 00 +vpshlw xmm1, [0], xmm3 ; 8F E9 60 95 016 00 00 +vpshlw xmm1, dqword [0], xmm3 ; 8F E9 60 95 016 00 00 + diff --git a/modules/arch/x86/tests/xop-all.hex b/modules/arch/x86/tests/xop-all.hex new file mode 100644 index 00000000..ee9fd7fb --- /dev/null +++ b/modules/arch/x86/tests/xop-all.hex @@ -0,0 +1,1437 @@ +8f +e9 +78 +81 +ca +8f +e9 +78 +81 +0e +00 +00 +8f +e9 +78 +81 +0e +00 +00 +8f +e9 +7c +81 +ca +8f +e9 +7c +81 +0e +00 +00 +8f +e9 +7c +81 +0e +00 +00 +8f +e9 +78 +80 +ca +8f +e9 +78 +80 +0e +00 +00 +8f +e9 +78 +80 +0e +00 +00 +8f +e9 +7c +80 +ca +8f +e9 +7c +80 +0e +00 +00 +8f +e9 +7c +80 +0e +00 +00 +8f +e9 +78 +83 +ca +8f +e9 +78 +83 +0e +00 +00 +8f +e9 +78 +83 +0e +00 +00 +8f +e9 +78 +82 +ca +8f +e9 +78 +82 +0e +00 +00 +8f +e9 +78 +82 +0e +00 +00 +8f +e8 +68 +a2 +cb +40 +8f +e8 +e8 +a2 +0e +00 +00 +30 +8f +e8 +e8 +a2 +0e +00 +00 +30 +8f +e8 +68 +a2 +0e +00 +00 +40 +8f +e8 +68 +a2 +0e +00 +00 +40 +8f +e8 +6c +a2 +cb +40 +8f +e8 +ec +a2 +0e +00 +00 +30 +8f +e8 +ec +a2 +0e +00 +00 +30 +8f +e8 +6c +a2 +0e +00 +00 +40 +8f +e8 +6c +a2 +0e +00 +00 +40 +8f +e8 +58 +cc +cf +05 +8f +e8 +50 +cc +16 +00 +00 +05 +8f +e8 +48 +cc +1e +00 +00 +05 +8f +e8 +58 +ce +cf +05 +8f +e8 +50 +ce +16 +00 +00 +05 +8f +e8 +48 +ce +1e +00 +00 +05 +8f +e8 +58 +cf +cf +05 +8f +e8 +50 +cf +16 +00 +00 +05 +8f +e8 +48 +cf +1e +00 +00 +05 +8f +e8 +58 +ec +cf +05 +8f +e8 +50 +ec +16 +00 +00 +05 +8f +e8 +48 +ec +1e +00 +00 +05 +8f +e8 +58 +ee +cf +05 +8f +e8 +50 +ee +16 +00 +00 +05 +8f +e8 +48 +ee +1e +00 +00 +05 +8f +e8 +58 +ef +cf +05 +8f +e8 +50 +ef +16 +00 +00 +05 +8f +e8 +48 +ef +1e +00 +00 +05 +8f +e8 +58 +ed +cf +05 +8f +e8 +50 +ed +16 +00 +00 +05 +8f +e8 +48 +ed +1e +00 +00 +05 +8f +e8 +58 +cd +cf +05 +8f +e8 +50 +cd +16 +00 +00 +05 +8f +e8 +48 +cd +1e +00 +00 +05 +8f +e9 +78 +c2 +ca +8f +e9 +78 +c2 +0e +00 +00 +8f +e9 +78 +c2 +0e +00 +00 +8f +e9 +78 +c3 +ca +8f +e9 +78 +c3 +0e +00 +00 +8f +e9 +78 +c3 +0e +00 +00 +8f +e9 +78 +c1 +ca +8f +e9 +78 +c1 +0e +00 +00 +8f +e9 +78 +c1 +0e +00 +00 +8f +e9 +78 +cb +ca +8f +e9 +78 +cb +0e +00 +00 +8f +e9 +78 +cb +0e +00 +00 +8f +e9 +78 +d2 +ca +8f +e9 +78 +d2 +0e +00 +00 +8f +e9 +78 +d2 +0e +00 +00 +8f +e9 +78 +d3 +ca +8f +e9 +78 +d3 +0e +00 +00 +8f +e9 +78 +d3 +0e +00 +00 +8f +e9 +78 +d1 +ca +8f +e9 +78 +d1 +0e +00 +00 +8f +e9 +78 +d1 +0e +00 +00 +8f +e9 +78 +db +ca +8f +e9 +78 +db +0e +00 +00 +8f +e9 +78 +db +0e +00 +00 +8f +e9 +78 +d6 +ca +8f +e9 +78 +d6 +0e +00 +00 +8f +e9 +78 +d6 +0e +00 +00 +8f +e9 +78 +d7 +ca +8f +e9 +78 +d7 +0e +00 +00 +8f +e9 +78 +d7 +0e +00 +00 +8f +e9 +78 +c6 +ca +8f +e9 +78 +c6 +0e +00 +00 +8f +e9 +78 +c6 +0e +00 +00 +8f +e9 +78 +c7 +ca +8f +e9 +78 +c7 +0e +00 +00 +8f +e9 +78 +c7 +0e +00 +00 +8f +e9 +78 +e1 +ca +8f +e9 +78 +e1 +0e +00 +00 +8f +e9 +78 +e1 +0e +00 +00 +8f +e9 +78 +e3 +ca +8f +e9 +78 +e3 +0e +00 +00 +8f +e9 +78 +e3 +0e +00 +00 +8f +e9 +78 +e2 +ca +8f +e9 +78 +e2 +0e +00 +00 +8f +e9 +78 +e2 +0e +00 +00 +8f +e8 +58 +9e +cf +30 +8f +e8 +50 +9e +16 +00 +00 +00 +8f +e8 +48 +9e +1e +00 +00 +20 +8f +e8 +58 +9f +cf +30 +8f +e8 +50 +9f +16 +00 +00 +00 +8f +e8 +48 +9f +1e +00 +00 +20 +8f +e8 +58 +97 +cf +30 +8f +e8 +50 +97 +16 +00 +00 +00 +8f +e8 +48 +97 +1e +00 +00 +20 +8f +e8 +58 +8e +cf +30 +8f +e8 +50 +8e +16 +00 +00 +00 +8f +e8 +48 +8e +1e +00 +00 +20 +8f +e8 +58 +8f +cf +30 +8f +e8 +50 +8f +16 +00 +00 +00 +8f +e8 +48 +8f +1e +00 +00 +20 +8f +e8 +58 +87 +cf +30 +8f +e8 +50 +87 +16 +00 +00 +00 +8f +e8 +48 +87 +1e +00 +00 +20 +8f +e8 +58 +86 +cf +30 +8f +e8 +50 +86 +16 +00 +00 +00 +8f +e8 +48 +86 +1e +00 +00 +20 +8f +e8 +58 +85 +cf +30 +8f +e8 +50 +85 +16 +00 +00 +00 +8f +e8 +48 +85 +1e +00 +00 +20 +8f +e8 +58 +96 +cf +30 +8f +e8 +50 +96 +16 +00 +00 +00 +8f +e8 +48 +96 +1e +00 +00 +20 +8f +e8 +58 +95 +cf +30 +8f +e8 +50 +95 +16 +00 +00 +00 +8f +e8 +48 +95 +1e +00 +00 +20 +8f +e8 +58 +a6 +cf +30 +8f +e8 +50 +a6 +16 +00 +00 +00 +8f +e8 +48 +a6 +1e +00 +00 +20 +8f +e8 +58 +b6 +cf +30 +8f +e8 +50 +b6 +16 +00 +00 +00 +8f +e8 +48 +b6 +1e +00 +00 +20 +8f +e8 +68 +a3 +cb +40 +8f +e8 +e8 +a3 +0e +00 +00 +30 +8f +e8 +e8 +a3 +0e +00 +00 +30 +8f +e8 +68 +a3 +0e +00 +00 +40 +8f +e8 +68 +a3 +0e +00 +00 +40 +8f +e9 +60 +90 +ca +8f +e9 +e8 +90 +0e +00 +00 +8f +e9 +e8 +90 +0e +00 +00 +8f +e9 +60 +90 +0e +00 +00 +8f +e9 +60 +90 +0e +00 +00 +8f +e8 +78 +c0 +ca +05 +8f +e8 +78 +c0 +0e +00 +00 +05 +8f +e8 +78 +c0 +0e +00 +00 +05 +8f +e9 +60 +92 +ca +8f +e9 +e8 +92 +0e +00 +00 +8f +e9 +e8 +92 +0e +00 +00 +8f +e9 +60 +92 +0e +00 +00 +8f +e9 +60 +92 +0e +00 +00 +8f +e8 +78 +c2 +ca +05 +8f +e8 +78 +c2 +0e +00 +00 +05 +8f +e8 +78 +c2 +0e +00 +00 +05 +8f +e9 +60 +93 +ca +8f +e9 +e8 +93 +0e +00 +00 +8f +e9 +e8 +93 +0e +00 +00 +8f +e9 +60 +93 +0e +00 +00 +8f +e9 +60 +93 +0e +00 +00 +8f +e8 +78 +c3 +ca +05 +8f +e8 +78 +c3 +0e +00 +00 +05 +8f +e8 +78 +c3 +0e +00 +00 +05 +8f +e9 +60 +91 +ca +8f +e9 +e8 +91 +0e +00 +00 +8f +e9 +e8 +91 +0e +00 +00 +8f +e9 +60 +91 +0e +00 +00 +8f +e9 +60 +91 +0e +00 +00 +8f +e8 +78 +c1 +ca +05 +8f +e8 +78 +c1 +0e +00 +00 +05 +8f +e8 +78 +c1 +0e +00 +00 +05 +8f +e9 +60 +98 +ca +8f +e9 +e8 +98 +0e +00 +00 +8f +e9 +e8 +98 +0e +00 +00 +8f +e9 +60 +98 +0e +00 +00 +8f +e9 +60 +98 +0e +00 +00 +8f +e9 +60 +9a +ca +8f +e9 +e8 +9a +0e +00 +00 +8f +e9 +e8 +9a +0e +00 +00 +8f +e9 +60 +9a +0e +00 +00 +8f +e9 +60 +9a +0e +00 +00 +8f +e9 +60 +9b +ca +8f +e9 +e8 +9b +0e +00 +00 +8f +e9 +e8 +9b +0e +00 +00 +8f +e9 +60 +9b +0e +00 +00 +8f +e9 +60 +9b +0e +00 +00 +8f +e9 +60 +99 +ca +8f +e9 +e8 +99 +0e +00 +00 +8f +e9 +e8 +99 +0e +00 +00 +8f +e9 +60 +99 +0e +00 +00 +8f +e9 +60 +99 +0e +00 +00 +8f +e9 +60 +94 +ca +8f +e9 +e8 +94 +0e +00 +00 +8f +e9 +e8 +94 +0e +00 +00 +8f +e9 +60 +94 +0e +00 +00 +8f +e9 +60 +94 +0e +00 +00 +8f +e9 +60 +96 +ca +8f +e9 +e8 +96 +0e +00 +00 +8f +e9 +e8 +96 +0e +00 +00 +8f +e9 +60 +96 +0e +00 +00 +8f +e9 +60 +96 +0e +00 +00 +8f +e9 +60 +97 +ca +8f +e9 +e8 +97 +0e +00 +00 +8f +e9 +e8 +97 +0e +00 +00 +8f +e9 +60 +97 +0e +00 +00 +8f +e9 +60 +97 +0e +00 +00 +8f +e9 +60 +95 +ca +8f +e9 +e8 +95 +0e +00 +00 +8f +e9 +e8 +95 +0e +00 +00 +8f +e9 +60 +95 +0e +00 +00 +8f +e9 +60 +95 +0e +00 +00 diff --git a/modules/arch/x86/tests/xop-basic.asm b/modules/arch/x86/tests/xop-basic.asm new file mode 100644 index 00000000..516b4bd2 --- /dev/null +++ b/modules/arch/x86/tests/xop-basic.asm @@ -0,0 +1,8 @@ +[bits 64] +vfrczpd ymm9, ymm10 ; 8F 49 7C 81 312 +vfrczpd ymm9, [0] ; 8F 69 7C 81 0C 25 00 00 00 00 +vfrczpd ymm9, yword [0] ; 8F 69 7C 81 0C 25 00 00 00 00 +vfrczpd ymm9, [r8*4] ; 8F 29 7C 81 0C 85 00 00 00 00 +vfrczpd ymm9, [r8*4+r9] ; 8F 09 7C 81 0C 81 + +vpcmov ymm10, ymm11, ymm12, ymm13 ; 8F 48 24 A2 324 D0 diff --git a/modules/arch/x86/tests/xop-basic.hex b/modules/arch/x86/tests/xop-basic.hex new file mode 100644 index 00000000..6be478a1 --- /dev/null +++ b/modules/arch/x86/tests/xop-basic.hex @@ -0,0 +1,47 @@ +8f +49 +7c +81 +ca +8f +69 +7c +81 +0c +25 +00 +00 +00 +00 +8f +69 +7c +81 +0c +25 +00 +00 +00 +00 +8f +29 +7c +81 +0c +85 +00 +00 +00 +00 +8f +09 +7c +81 +0c +81 +8f +48 +24 +a2 +d4 +d0 diff --git a/modules/arch/x86/tests/xop-cc.asm b/modules/arch/x86/tests/xop-cc.asm new file mode 100644 index 00000000..8b8bbe39 --- /dev/null +++ b/modules/arch/x86/tests/xop-cc.asm @@ -0,0 +1,22 @@ +[bits 16] +vpcomltb xmm1, xmm2, xmm3 ; 8F E8 68 CC 313 00 +vpcomleb xmm1, xmm2, xmm3 ; 8F E8 68 CC 313 01 +vpcomgtb xmm1, xmm2, xmm3 ; 8F E8 68 CC 313 02 +vpcomgeb xmm1, xmm2, xmm3 ; 8F E8 68 CC 313 03 +vpcomeqb xmm1, xmm2, xmm3 ; 8F E8 68 CC 313 04 +vpcomneqb xmm1, xmm2, xmm3 ; 8F E8 68 CC 313 05 +vpcomneb xmm1, xmm2, xmm3 ; 8F E8 68 CC 313 05 +vpcomfalseb xmm1, xmm2, xmm3 ; 8F E8 68 CC 313 06 +vpcomtrueb xmm1, xmm2, xmm3 ; 8F E8 68 CC 313 07 + +vpcomltuw xmm1, xmm2, xmm3 ; 8F E8 68 ED 313 00 +vpcomleuw xmm1, xmm2, xmm3 ; 8F E8 68 ED 313 01 +vpcomgtuw xmm1, xmm2, xmm3 ; 8F E8 68 ED 313 02 +vpcomgeuw xmm1, xmm2, xmm3 ; 8F E8 68 ED 313 03 +vpcomequw xmm1, xmm2, xmm3 ; 8F E8 68 ED 313 04 +vpcomnequw xmm1, xmm2, xmm3 ; 8F E8 68 ED 313 05 +vpcomneuw xmm1, xmm2, xmm3 ; 8F E8 68 ED 313 05 +vpcomfalseuw xmm1, xmm2, xmm3 ; 8F E8 68 ED 313 06 +vpcomtrueuw xmm1, xmm2, xmm3 ; 8F E8 68 ED 313 07 + + diff --git a/modules/arch/x86/tests/xop-cc.hex b/modules/arch/x86/tests/xop-cc.hex new file mode 100644 index 00000000..24300585 --- /dev/null +++ b/modules/arch/x86/tests/xop-cc.hex @@ -0,0 +1,108 @@ +8f +e8 +68 +cc +cb +00 +8f +e8 +68 +cc +cb +01 +8f +e8 +68 +cc +cb +02 +8f +e8 +68 +cc +cb +03 +8f +e8 +68 +cc +cb +04 +8f +e8 +68 +cc +cb +05 +8f +e8 +68 +cc +cb +05 +8f +e8 +68 +cc +cb +06 +8f +e8 +68 +cc +cb +07 +8f +e8 +68 +ed +cb +00 +8f +e8 +68 +ed +cb +01 +8f +e8 +68 +ed +cb +02 +8f +e8 +68 +ed +cb +03 +8f +e8 +68 +ed +cb +04 +8f +e8 +68 +ed +cb +05 +8f +e8 +68 +ed +cb +05 +8f +e8 +68 +ed +cb +06 +8f +e8 +68 +ed +cb +07 diff --git a/modules/arch/x86/x86arch.h b/modules/arch/x86/x86arch.h index ac4b7ed7..29d8f7a4 100644 --- a/modules/arch/x86/x86arch.h +++ b/modules/arch/x86/x86arch.h @@ -64,13 +64,15 @@ #define CPU_SSE41 30 /* Streaming SIMD extensions 4.1 required */ #define CPU_SSE42 31 /* Streaming SIMD extensions 4.2 required */ #define CPU_SSE4a 32 /* AMD Streaming SIMD extensions 4a required */ -#define CPU_SSE5 33 /* AMD Streaming SIMD extensions 5 required */ -#define CPU_XSAVE 34 /* Intel XSAVE instructions */ -#define CPU_AVX 35 /* Intel Advanced Vector Extensions */ -#define CPU_FMA 36 /* Intel Fused-Multiply-Add Extensions */ -#define CPU_AES 37 /* AES instruction */ -#define CPU_CLMUL 38 /* PCLMULQDQ instruction */ -#define CPU_MOVBE 39 /* MOVBE instruction */ +#define CPU_XSAVE 33 /* Intel XSAVE instructions */ +#define CPU_AVX 34 /* Intel Advanced Vector Extensions */ +#define CPU_FMA 35 /* Intel Fused-Multiply-Add Extensions */ +#define CPU_AES 36 /* AES instruction */ +#define CPU_CLMUL 37 /* PCLMULQDQ instruction */ +#define CPU_MOVBE 38 /* MOVBE instruction */ +#define CPU_XOP 39 /* AMD XOP extensions */ +#define CPU_FMA4 40 /* AMD Fused-Multiply-Add extensions */ +#define CPU_CVT16 41 /* AMD CVT16 extensions */ typedef struct yasm_arch_x86 { yasm_arch_base arch; /* base structure */ @@ -152,9 +154,9 @@ typedef enum { * indicates bit of REX to use if REX is needed. Will not modify REX if not * in 64-bit mode or if it wasn't needed to express reg. */ -int yasm_x86__set_rex_from_reg(unsigned char *rex, unsigned char *drex, - unsigned char *low3, uintptr_t reg, - unsigned int bits, x86_rex_bit_pos rexbit); +int yasm_x86__set_rex_from_reg(unsigned char *rex, unsigned char *low3, + uintptr_t reg, unsigned int bits, + x86_rex_bit_pos rexbit); /* Effective address type */ typedef struct x86_effaddr { @@ -172,19 +174,14 @@ typedef struct x86_effaddr { unsigned char valid_sib; /* 1 if SIB byte currently valid, 0 if not */ unsigned char need_sib; /* 1 if SIB byte needed, 0 if not, 0xff if unknown */ - - unsigned char drex; /* DREX SSE5 extension byte */ - unsigned char need_drex; /* 1 if DREX byte needed, 0 if not */ } x86_effaddr; void yasm_x86__ea_init(x86_effaddr *x86_ea, unsigned int spare, - unsigned int drex, unsigned int need_drex, yasm_bytecode *precbc); void yasm_x86__ea_set_disponly(x86_effaddr *x86_ea); x86_effaddr *yasm_x86__ea_create_reg(x86_effaddr *x86_ea, unsigned long reg, - unsigned char *rex, unsigned char *drex, - unsigned int bits); + unsigned char *rex, unsigned int bits); x86_effaddr *yasm_x86__ea_create_imm (x86_effaddr *x86_ea, /*@keep@*/ yasm_expr *imm, unsigned int im_len); yasm_effaddr *yasm_x86__ea_create_expr(yasm_arch *arch, diff --git a/modules/arch/x86/x86bc.c b/modules/arch/x86/x86bc.c index adf08c9a..844a3342 100644 --- a/modules/arch/x86/x86bc.c +++ b/modules/arch/x86/x86bc.c @@ -106,9 +106,9 @@ static const yasm_bytecode_callback x86_bc_callback_jmpfar = { }; int -yasm_x86__set_rex_from_reg(unsigned char *rex, unsigned char *drex, - unsigned char *low3, uintptr_t reg, - unsigned int bits, x86_rex_bit_pos rexbit) +yasm_x86__set_rex_from_reg(unsigned char *rex, unsigned char *low3, + uintptr_t reg, unsigned int bits, + x86_rex_bit_pos rexbit) { *low3 = (unsigned char)(reg&7); @@ -116,17 +116,13 @@ yasm_x86__set_rex_from_reg(unsigned char *rex, unsigned char *drex, x86_expritem_reg_size size = (x86_expritem_reg_size)(reg & ~0xFUL); if (size == X86_REG8X || (reg & 0xF) >= 8) { - if (drex) { - *drex |= ((reg & 8) >> 3) << rexbit; - } else { - /* Check to make sure we can set it */ - if (*rex == 0xff) { - yasm_error_set(YASM_ERROR_TYPE, - N_("cannot use A/B/C/DH with instruction needing REX")); - return 1; - } - *rex |= 0x40 | (((reg & 8) >> 3) << rexbit); + /* Check to make sure we can set it */ + if (*rex == 0xff) { + yasm_error_set(YASM_ERROR_TYPE, + N_("cannot use A/B/C/DH with instruction needing REX")); + return 1; } + *rex |= 0x40 | (((reg & 8) >> 3) << rexbit); } else if (size == X86_REG8 && (reg & 7) >= 4) { /* AH/BH/CH/DH, so no REX allowed */ if (*rex != 0 && *rex != 0xff) { @@ -160,16 +156,14 @@ yasm_x86__bc_transform_jmpfar(yasm_bytecode *bc, x86_jmpfar *jmpfar) } void -yasm_x86__ea_init(x86_effaddr *x86_ea, unsigned int spare, unsigned int drex, - unsigned int need_drex, yasm_bytecode *precbc) +yasm_x86__ea_init(x86_effaddr *x86_ea, unsigned int spare, + yasm_bytecode *precbc) { if (yasm_value_finalize(&x86_ea->ea.disp, precbc)) yasm_error_set(YASM_ERROR_TOO_COMPLEX, N_("effective address too complex")); x86_ea->modrm &= 0xC7; /* zero spare/reg bits */ x86_ea->modrm |= (spare << 3) & 0x38; /* plug in provided bits */ - x86_ea->drex = (unsigned char)drex; - x86_ea->need_drex = (unsigned char)need_drex; } void @@ -179,7 +173,6 @@ yasm_x86__ea_set_disponly(x86_effaddr *x86_ea) x86_ea->need_modrm = 0; x86_ea->valid_sib = 0; x86_ea->need_sib = 0; - x86_ea->need_drex = 0; } static x86_effaddr * @@ -202,20 +195,17 @@ ea_create(void) x86_ea->sib = 0; x86_ea->valid_sib = 0; x86_ea->need_sib = 0; - x86_ea->drex = 0; - x86_ea->need_drex = 0; return x86_ea; } x86_effaddr * yasm_x86__ea_create_reg(x86_effaddr *x86_ea, unsigned long reg, - unsigned char *rex, unsigned char *drex, - unsigned int bits) + unsigned char *rex, unsigned int bits) { unsigned char rm; - if (yasm_x86__set_rex_from_reg(rex, drex, &rm, reg, bits, X86_REX_B)) + if (yasm_x86__set_rex_from_reg(rex, &rm, reg, bits, X86_REX_B)) return NULL; if (!x86_ea) @@ -560,7 +550,6 @@ x86_bc_insn_calc_len(yasm_bytecode *bc, yasm_bc_add_span_func add_span, /* Compute length of ea and add to total */ bc->len += x86_ea->need_modrm + (x86_ea->need_sib ? 1:0); - bc->len += x86_ea->need_drex ? 1:0; bc->len += (x86_ea->ea.segreg != 0) ? 1 : 0; } @@ -603,10 +592,10 @@ x86_bc_insn_calc_len(yasm_bytecode *bc, yasm_bc_add_span_func add_span, bc->len += immlen/8; } - /* VEX prefixes never have REX. We can come into this function with the - * three byte form, so we need to see if we can optimize to the two byte - * form. We can't do it earlier, as we don't know all of the REX byte - * until now. + /* VEX and XOP prefixes never have REX (it's embedded in the opcode). + * For VEX, we can come into this function with the three byte form, + * so we need to see if we can optimize to the two byte form. + * We can't do it earlier, as we don't know all of the REX byte until now. */ if (insn->special_prefix == 0xC4) { /* See if we can shorten the VEX prefix to its two byte form. @@ -623,7 +612,7 @@ x86_bc_insn_calc_len(yasm_bytecode *bc, yasm_bc_add_span_func add_span, insn->special_prefix = 0xC5; /* mark as two-byte VEX */ } } else if (insn->rex != 0xff && insn->rex != 0 && - insn->special_prefix != 0xC5) + insn->special_prefix != 0xC5 && insn->special_prefix != 0x8F) bc->len++; bc->len += insn->opcode.len; @@ -825,8 +814,8 @@ x86_bc_insn_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, x86_ea ? (unsigned int)(x86_ea->ea.segreg>>8) : 0); if (insn->special_prefix != 0) YASM_WRITE_8(*bufp, insn->special_prefix); - if (insn->special_prefix == 0xC4) { - /* 3-byte VEX; merge in 1s complement of REX.R, REX.X, REX.B */ + if (insn->special_prefix == 0xC4 || insn->special_prefix == 0x8F) { + /* 3-byte VEX/XOP; merge in 1s complement of REX.R, REX.X, REX.B */ insn->opcode.opcode[0] &= 0x1F; if (insn->rex != 0xff) insn->opcode.opcode[0] |= ((~insn->rex) & 0x07) << 5; @@ -868,9 +857,6 @@ x86_bc_insn_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, YASM_WRITE_8(*bufp, x86_ea->sib); } - if (x86_ea->need_drex) - YASM_WRITE_8(*bufp, x86_ea->drex); - if (x86_ea->ea.need_disp) { unsigned int disp_len = x86_ea->ea.disp.size/8; diff --git a/modules/arch/x86/x86cpu.gperf b/modules/arch/x86/x86cpu.gperf index caf0b529..765cf08b 100644 --- a/modules/arch/x86/x86cpu.gperf +++ b/modules/arch/x86/x86cpu.gperf @@ -151,8 +151,11 @@ x86_cpu_amd(wordptr cpu, yasm_arch_x86 *arch_x86, unsigned int data) BitVector_Bit_On(cpu, CPU_Prot); BitVector_Bit_On(cpu, CPU_SMM); BitVector_Bit_On(cpu, CPU_3DNow); - if (data >= PROC_bulldozer) - BitVector_Bit_On(cpu, CPU_SSE5); + if (data >= PROC_bulldozer) { + BitVector_Bit_On(cpu, CPU_XOP); + BitVector_Bit_On(cpu, CPU_FMA4); + BitVector_Bit_On(cpu, CPU_CVT16); + } if (data >= PROC_k10) BitVector_Bit_On(cpu, CPU_SSE4a); if (data >= PROC_venice) @@ -357,8 +360,6 @@ sse4a, x86_cpu_set, CPU_SSE4a nosse4a, x86_cpu_clear, CPU_SSE4a sse4, x86_cpu_set_sse4, 0 nosse4, x86_cpu_clear_sse4, 0 -sse5, x86_cpu_set, CPU_SSE5 -nosse5, x86_cpu_clear, CPU_SSE5 xsave, x86_cpu_set, CPU_XSAVE noxsave, x86_cpu_clear, CPU_XSAVE avx, x86_cpu_set, CPU_AVX @@ -373,6 +374,12 @@ pclmulqdq, x86_cpu_set, CPU_CLMUL nopclmulqdq, x86_cpu_clear, CPU_CLMUL movbe, x86_cpu_set, CPU_MOVBE nomovbe, x86_cpu_clear, CPU_MOVBE +xop, x86_cpu_set, CPU_XOP +noxop, x86_cpu_clear, CPU_XOP +fma4, x86_cpu_set, CPU_FMA4 +nofma4, x86_cpu_clear, CPU_FMA4 +cvt16, x86_cpu_set, CPU_CVT16 +nocvt16, x86_cpu_clear, CPU_CVT16 # Change NOP patterns basicnop, x86_nop, X86_NOP_BASIC intelnop, x86_nop, X86_NOP_INTEL diff --git a/modules/arch/x86/x86expr.c b/modules/arch/x86/x86expr.c index 2acd6a9f..814a9b2a 100644 --- a/modules/arch/x86/x86expr.c +++ b/modules/arch/x86/x86expr.c @@ -572,7 +572,6 @@ yasm_x86__expr_checkea(x86_effaddr *x86_ea, unsigned char *addrsize, yasm_bytecode *bc) { int retval; - unsigned char *drex = x86_ea->need_drex ? &x86_ea->drex : NULL; if (*addrsize == 0) { /* we need to figure out the address size from what we know about: @@ -823,7 +822,7 @@ yasm_x86__expr_checkea(x86_effaddr *x86_ea, unsigned char *addrsize, * of register basereg is, as x86_set_rex_from_reg doesn't pay * much attention. */ - if (yasm_x86__set_rex_from_reg(rex, drex, &low3, + if (yasm_x86__set_rex_from_reg(rex, &low3, (unsigned int)(X86_REG64 | basereg), bits, X86_REX_B)) return 1; @@ -850,7 +849,7 @@ yasm_x86__expr_checkea(x86_effaddr *x86_ea, unsigned char *addrsize, if (basereg == REG3264_NONE) x86_ea->sib |= 5; else { - if (yasm_x86__set_rex_from_reg(rex, drex, &low3, (unsigned int) + if (yasm_x86__set_rex_from_reg(rex, &low3, (unsigned int) (X86_REG64 | basereg), bits, X86_REX_B)) return 1; @@ -862,7 +861,7 @@ yasm_x86__expr_checkea(x86_effaddr *x86_ea, unsigned char *addrsize, x86_ea->sib |= 040; /* Any scale field is valid, just leave at 0. */ else { - if (yasm_x86__set_rex_from_reg(rex, drex, &low3, (unsigned int) + if (yasm_x86__set_rex_from_reg(rex, &low3, (unsigned int) (X86_REG64 | indexreg), bits, X86_REX_X)) return 1; diff --git a/modules/arch/x86/x86id.c b/modules/arch/x86/x86id.c index 29926ada..902b8475 100644 --- a/modules/arch/x86/x86id.c +++ b/modules/arch/x86/x86id.c @@ -114,9 +114,7 @@ enum x86_operand_type { */ OPT_MemrAX = 25, /* EAX memory operand only (EA) [special case for SVM skinit opcode] */ - OPT_MemEAX = 26, - /* SIMDReg with value equal to operand 0 SIMDReg */ - OPT_SIMDRegMatch0 = 27 + OPT_MemEAX = 26 }; enum x86_operand_size { @@ -164,18 +162,17 @@ enum x86_operand_action { OPA_JmpFar = 10, /* ea operand only sets address size (no actual ea field) */ OPA_AdSizeEA = 11, - OPA_DREX = 12, /* operand data goes into DREX "dest" field */ - OPA_VEX = 13, /* operand data goes into VEX "vvvv" field */ - /* operand data goes into BOTH VEX "vvvv" field and ea field */ - OPA_EAVEX = 14, - /* operand data goes into BOTH VEX "vvvv" field and spare field */ - OPA_SpareVEX = 15, + OPA_VEX = 12, /* operand data goes into VEX/XOP "vvvv" field */ + /* operand data goes into BOTH VEX/XOP "vvvv" field and ea field */ + OPA_EAVEX = 13, + /* operand data goes into BOTH VEX/XOP "vvvv" field and spare field */ + OPA_SpareVEX = 14, /* operand data goes into upper 4 bits of immediate byte (VEX is4 field) */ - OPA_VEXImmSrc = 16, + OPA_VEXImmSrc = 15, /* operand data goes into bottom 4 bits of immediate byte * (currently only VEX imz2 field) */ - OPA_VEXImm = 17 + OPA_VEXImm = 16 }; enum x86_operand_post_action { @@ -238,7 +235,7 @@ typedef struct x86_insn_info { /* GAS suffix flags */ unsigned int gas_flags:8; /* Enabled for these GAS suffixes */ - /* Tests against BITS==64 and AVX */ + /* Tests against BITS==64, AVX, and XOP */ unsigned int misc_flags:6; /* The CPU feature flags needed to execute this instruction. This is OR'ed @@ -277,17 +274,11 @@ typedef struct x86_insn_info { * 01: 66 * 10: F3 * 11: F2 + * 0x80 - 0x8F indicate a XOP prefix, with the four LSBs holding "WLpp": + * same meanings as VEX prefix. */ unsigned char special_prefix; - /* The DREX base byte value (almost). The only bit kept from this - * value is the OC0 bit (0x08). The MSB (0x80) of this value indicates - * if the DREX byte needs to be present in the instruction. - */ -#define NEED_DREX_MASK 0x80 -#define DREX_OC0_MASK 0x08 - unsigned char drex_oc0; - /* The length of the basic opcode */ unsigned char opcode_len; @@ -667,7 +658,6 @@ x86_find_match(x86_id_insn *id_insn, yasm_insn_operand **ops, if (op->type == YASM_INSN__OPERAND_MEMORY) break; /*@fallthrough@*/ - case OPT_SIMDRegMatch0: case OPT_SIMDReg: if (op->type != YASM_INSN__OPERAND_REG) mismatch = 1; @@ -682,9 +672,6 @@ x86_find_match(x86_id_insn *id_insn, yasm_insn_operand **ops, break; } } - if (!mismatch && info_ops[i].type == OPT_SIMDRegMatch0 && - bypass != 7 && op->data.reg != use_ops[0]->data.reg) - mismatch = 1; break; case OPT_SegReg: if (op->type != YASM_INSN__OPERAND_SEGREG) @@ -1005,8 +992,6 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) unsigned char im_len; unsigned char im_sign; unsigned char spare; - unsigned char drex; - unsigned char *pdrex; unsigned char vexdata, vexreg; unsigned int i; unsigned int size_lookup[] = {0, 8, 16, 32, 64, 80, 128, 256, 0}; @@ -1099,19 +1084,18 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) insn->def_opersize_64 = info->def_opersize_64; insn->special_prefix = info->special_prefix; spare = info->spare; - drex = info->drex_oc0 & DREX_OC0_MASK; vexdata = 0; vexreg = 0; im_len = 0; im_sign = 0; insn->postop = X86_POSTOP_NONE; insn->rex = 0; - pdrex = (info->drex_oc0 & NEED_DREX_MASK) ? &drex : NULL; - /* Move VEX data (stored in special prefix) to separate location to + /* Move VEX/XOP data (stored in special prefix) to separate location to * allow overriding of special prefix by modifiers. */ - if ((insn->special_prefix & 0xF0) == 0xC0) { + if ((insn->special_prefix & 0xF0) == 0xC0 || + (insn->special_prefix & 0xF0) == 0x80) { vexdata = insn->special_prefix; insn->special_prefix = 0; } @@ -1199,7 +1183,7 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) insn->x86_ea = yasm_x86__ea_create_reg(insn->x86_ea, (unsigned long)op->data.reg, &insn->rex, - pdrex, mode_bits); + mode_bits); break; case YASM_INSN__OPERAND_SEGREG: yasm_internal_error( @@ -1236,8 +1220,7 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) yasm_internal_error(N_("invalid operand conversion")); insn->x86_ea = yasm_x86__ea_create_reg(insn->x86_ea, - (unsigned long)op->data.reg, &insn->rex, pdrex, - mode_bits); + (unsigned long)op->data.reg, &insn->rex, mode_bits); vexreg = op->data.reg & 0xF; break; case OPA_Imm: @@ -1265,8 +1248,8 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) if (op->type == YASM_INSN__OPERAND_SEGREG) spare = (unsigned char)(op->data.reg&7); else if (op->type == YASM_INSN__OPERAND_REG) { - if (yasm_x86__set_rex_from_reg(&insn->rex, pdrex, - &spare, op->data.reg, mode_bits, X86_REX_R)) + if (yasm_x86__set_rex_from_reg(&insn->rex, &spare, + op->data.reg, mode_bits, X86_REX_R)) return; } else yasm_internal_error(N_("invalid operand conversion")); @@ -1274,16 +1257,16 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) case OPA_SpareVEX: if (op->type != YASM_INSN__OPERAND_REG) yasm_internal_error(N_("invalid operand conversion")); - if (yasm_x86__set_rex_from_reg(&insn->rex, pdrex, - &spare, op->data.reg, mode_bits, X86_REX_R)) + if (yasm_x86__set_rex_from_reg(&insn->rex, &spare, + op->data.reg, mode_bits, X86_REX_R)) return; vexreg = op->data.reg & 0xF; break; case OPA_Op0Add: if (op->type == YASM_INSN__OPERAND_REG) { unsigned char opadd; - if (yasm_x86__set_rex_from_reg(&insn->rex, pdrex, - &opadd, op->data.reg, mode_bits, X86_REX_B)) + if (yasm_x86__set_rex_from_reg(&insn->rex, &opadd, + op->data.reg, mode_bits, X86_REX_B)) return; insn->opcode.opcode[0] += opadd; } else @@ -1292,8 +1275,8 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) case OPA_Op1Add: if (op->type == YASM_INSN__OPERAND_REG) { unsigned char opadd; - if (yasm_x86__set_rex_from_reg(&insn->rex, pdrex, - &opadd, op->data.reg, mode_bits, X86_REX_B)) + if (yasm_x86__set_rex_from_reg(&insn->rex, &opadd, + op->data.reg, mode_bits, X86_REX_B)) return; insn->opcode.opcode[1] += opadd; } else @@ -1304,10 +1287,10 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) insn->x86_ea = yasm_x86__ea_create_reg(insn->x86_ea, (unsigned long)op->data.reg, &insn->rex, - pdrex, mode_bits); + mode_bits); if (!insn->x86_ea || - yasm_x86__set_rex_from_reg(&insn->rex, pdrex, - &spare, op->data.reg, mode_bits, X86_REX_R)) { + yasm_x86__set_rex_from_reg(&insn->rex, &spare, + op->data.reg, mode_bits, X86_REX_R)) { if (insn->x86_ea) yasm_xfree(insn->x86_ea); yasm_xfree(insn); @@ -1340,13 +1323,6 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) yasm_x86__ea_destroy(op->data.ea); break; } - case OPA_DREX: - if (op->type == YASM_INSN__OPERAND_REG) { - drex &= 0x0F; - drex |= (op->data.reg << 4) & 0xF0; - } else - yasm_internal_error(N_("invalid operand conversion")); - break; case OPA_VEX: if (op->type != YASM_INSN__OPERAND_REG) yasm_internal_error(N_("invalid operand conversion")); @@ -1441,9 +1417,7 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) } if (insn->x86_ea) { - yasm_x86__ea_init(insn->x86_ea, spare, drex, - (unsigned int)(info->drex_oc0 & NEED_DREX_MASK), - prev_bc); + yasm_x86__ea_init(insn->x86_ea, spare, prev_bc); for (i=0; iinsn.num_segregs; i++) yasm_ea_set_segreg(&insn->x86_ea->ea, id_insn->insn.segregs[i]); } else if (id_insn->insn.num_segregs > 0 && insn->special_prefix == 0) { @@ -1513,8 +1487,7 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) * opcode 0 being a mov instruction! */ insn->x86_ea = yasm_x86__ea_create_reg(insn->x86_ea, - (unsigned long)insn->opcode.opcode[0]-0xB8, &rex_temp, - NULL, 64); + (unsigned long)insn->opcode.opcode[0]-0xB8, &rex_temp, 64); /* Make the imm32s form permanent. */ insn->opcode.opcode[0] = insn->opcode.opcode[1]; @@ -1526,31 +1499,46 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) break; } - /* Convert to VEX prefixes if requested. - * To save space in the insn structure, the VEX prefix is written into + /* Convert to VEX/XOP prefixes if requested. + * To save space in the insn structure, the VEX/XOP prefix is written into * special_prefix and the first 2 bytes of the instruction are set to - * the second two VEX bytes. During calc_len() it may be shortened to - * one VEX byte (this can only be done after knowledge of REX value). + * the second two VEX/XOP bytes. During calc_len() it may be shortened to + * one VEX byte (this can only be done after knowledge of REX value); this + * further optimization is not possible for XOP. */ if (vexdata) { + int xop = ((vexdata & 0xF0) == 0x80); unsigned char vex1 = 0xE0; /* R=X=B=1, mmmmm=0 */ unsigned char vex2; - /* Look at the first bytes of the opcode to see what leading bytes - * to encode in the VEX mmmmm field. Leave R=X=B=1 for now. - */ - if (insn->opcode.opcode[0] != 0x0F) - yasm_internal_error(N_("first opcode byte of VEX must be 0x0F")); - if (insn->opcode.opcode[1] == 0x38) - vex1 |= 0x02; /* implied 0x0F 0x38 */ - else if (insn->opcode.opcode[1] == 0x3A) - vex1 |= 0x03; /* implied 0x0F 0x3A */ - else { - /* Originally a 0F-only opcode; move opcode byte back one position - * to make room for VEX prefix. + if (xop) { + /* Look at the first bytes of the opcode for the XOP mmmmm field. + * Leave R=X=B=1 for now. */ + if (insn->opcode.opcode[0] != 0x08 && + insn->opcode.opcode[0] != 0x09) + yasm_internal_error(N_("first opcode byte of XOP must be 0x08 or 0x09")); + vex1 |= insn->opcode.opcode[0]; + /* Move opcode byte back one byte to make room for XOP prefix. */ insn->opcode.opcode[2] = insn->opcode.opcode[1]; - vex1 |= 0x01; /* implied 0x0F */ + } else { + /* Look at the first bytes of the opcode to see what leading bytes + * to encode in the VEX mmmmm field. Leave R=X=B=1 for now. + */ + if (insn->opcode.opcode[0] != 0x0F) + yasm_internal_error(N_("first opcode byte of VEX must be 0x0F")); + + if (insn->opcode.opcode[1] == 0x38) + vex1 |= 0x02; /* implied 0x0F 0x38 */ + else if (insn->opcode.opcode[1] == 0x3A) + vex1 |= 0x03; /* implied 0x0F 0x3A */ + else { + /* Originally a 0F-only opcode; move opcode byte back one + * position to make room for VEX prefix. + */ + insn->opcode.opcode[2] = insn->opcode.opcode[1]; + vex1 |= 0x01; /* implied 0x0F */ + } } /* Check for update of special prefix by modifiers */ @@ -1580,7 +1568,7 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) (vexdata & 0x7)); /* Lpp */ /* Save to special_prefix and opcode */ - insn->special_prefix = 0xC4; /* VEX prefix */ + insn->special_prefix = xop ? 0x8F : 0xC4; /* VEX/XOP prefix */ insn->opcode.opcode[0] = vex1; insn->opcode.opcode[1] = vex2; insn->opcode.len = 3; /* two prefix bytes and 1 opcode byte */ From f91196bc8a50ba0c2897aaf3b494327811665fdb Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 12 May 2009 01:46:42 +0000 Subject: [PATCH 269/585] CMakeLists.txt: Set cmake policy to avoid warning. svn path=/trunk/yasm/; revision=2200 --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index bc49eeec..0bbb68bf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,8 @@ PROJECT(yasm) CMAKE_MINIMUM_REQUIRED(VERSION 2.4) +if (COMMAND cmake_policy) + cmake_policy(SET CMP0003 NEW) +endif (COMMAND cmake_policy) SET(BUILD_SHARED_LIBS ON) From 9752153285b44f10f78e9bc5feffa20d946c6cec Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 12 May 2009 01:47:59 +0000 Subject: [PATCH 270/585] Fix #171: Broken build in ytasm CMakeLists.txt. Reported by: postmodern.mod3 svn path=/trunk/yasm/; revision=2201 --- frontends/tasm/CMakeLists.txt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/frontends/tasm/CMakeLists.txt b/frontends/tasm/CMakeLists.txt index e89d5aeb..982b95d1 100644 --- a/frontends/tasm/CMakeLists.txt +++ b/frontends/tasm/CMakeLists.txt @@ -1,4 +1,7 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +INCLUDE_DIRECTORIES( + ${CMAKE_CURRENT_BINARY_DIR} + ${yasm_SOURCE_DIR}/frontends/yasm + ) ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/license.c @@ -12,14 +15,15 @@ ADD_CUSTOM_COMMAND( SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}) -ADD_EXECUTABLE(tasm +ADD_EXECUTABLE(ytasm tasm.c tasm-options.c + ${yasm_SOURCE_DIR}/frontends/yasm/yasm-plugin.c ) -TARGET_LINK_LIBRARIES(tasm libyasm ${LIBDL}) +TARGET_LINK_LIBRARIES(ytasm libyasm ${LIBDL}) SET_SOURCE_FILES_PROPERTIES(tasm.c PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/license.c ) -INSTALL(TARGETS tasm RUNTIME DESTINATION bin) +INSTALL(TARGETS ytasm RUNTIME DESTINATION bin) From a4987364549e185c8b94d73eb9cd0b4a604d660e Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 3 Jun 2009 05:49:18 +0000 Subject: [PATCH 271/585] Fix #173: Debug full paths were being generated incorrectly. This was because the path returned by yasm__getcwd() did not have a trailing slash and thus yasm__combpath() stripped off the last path component. svn path=/trunk/yasm/; revision=2202 --- libyasm/file.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libyasm/file.c b/libyasm/file.c index 01359de3..fa225af0 100644 --- a/libyasm/file.c +++ b/libyasm/file.c @@ -235,7 +235,7 @@ yasm__getcwd(void) size = 1024; buf = yasm_xmalloc(size); - while (getcwd(buf, size) == NULL) { + while (getcwd(buf, size-1) == NULL) { if (errno != ERANGE) { yasm__fatal(N_("could not determine current working directory")); yasm_xfree(buf); @@ -244,6 +244,13 @@ yasm__getcwd(void) size *= 2; buf = yasm_xrealloc(buf, size); } + + /* append a '/' if not already present */ + size = strlen(buf); + if (buf[size-1] != '\\' && buf[size-1] != '/') { + buf[size] = '/'; + buf[size+1] = '\0'; + } return buf; } From db5f3437482e67bc21245a94ae00227f18bc77ed Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 12 Jun 2009 07:06:16 +0000 Subject: [PATCH 272/585] Fix #175: Only sanity check final section size if no user errors occurred. svn path=/trunk/yasm/; revision=2203 --- modules/objfmts/coff/coff-objfmt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/objfmts/coff/coff-objfmt.c b/modules/objfmts/coff/coff-objfmt.c index b9f4494e..b4191572 100644 --- a/modules/objfmts/coff/coff-objfmt.c +++ b/modules/objfmts/coff/coff-objfmt.c @@ -793,7 +793,8 @@ coff_objfmt_output_section(yasm_section *sect, /*@null@*/ void *d) coff_objfmt_output_bytecode); /* Sanity check final section size */ - if (csd->size != yasm_bc_next_offset(yasm_section_bcs_last(sect))) + if (yasm_errwarns_num_errors(info->errwarns, 0) == 0 && + csd->size != yasm_bc_next_offset(yasm_section_bcs_last(sect))) yasm_internal_error( N_("coff: section computed size did not match actual size")); } From d69ce714c115db7576f523c5f6a2b43b7230b906 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 18 Jul 2009 02:33:10 +0000 Subject: [PATCH 273/585] Fix #177: Make check fails on CR/LF systems. The diff on the hexdump output was not using -w. svn path=/trunk/yasm/; revision=2204 --- modules/objfmts/bin/tests/multisect/bin_multi_test.sh | 2 +- out_test.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/objfmts/bin/tests/multisect/bin_multi_test.sh b/modules/objfmts/bin/tests/multisect/bin_multi_test.sh index 1c0f7628..1c42dabe 100755 --- a/modules/objfmts/bin/tests/multisect/bin_multi_test.sh +++ b/modules/objfmts/bin/tests/multisect/bin_multi_test.sh @@ -72,7 +72,7 @@ do failedct=`expr $failedct + 1` else ./test_hd results/${o} > results/${oh} - if diff ${og} results/${oh} >/dev/null; then + if diff -w ${og} results/${oh} >/dev/null; then if diff -w ${eg} results/${e} >/dev/null; then if diff -w ${mg} results/${m} >/dev/null; then # All match, it passes! diff --git a/out_test.sh b/out_test.sh index a0eb8be4..93acbfba 100755 --- a/out_test.sh +++ b/out_test.sh @@ -70,7 +70,7 @@ do failedct=`expr $failedct + 1` else ./test_hd results/${o} > results/${oh} - if diff ${og} results/${oh} >/dev/null; then + if diff -w ${og} results/${oh} >/dev/null; then if diff -w ${eg} results/${e} >/dev/null; then # Both object file and error/warnings match, it passes! echo $ECHO_N ".$ECHO_C" From 2e2dbcd04f3ccf0f50a29879a738493f4fa7e9a9 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Mon, 20 Jul 2009 06:04:58 +0000 Subject: [PATCH 274/585] NASM is now licensed under the 2-clause BSD license. svn path=/trunk/yasm/; revision=2205 --- BSD.txt | 30 ++++++++++++++++++++++++++++++ COPYING | 3 +-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/BSD.txt b/BSD.txt index ae21308f..03476b75 100644 --- a/BSD.txt +++ b/BSD.txt @@ -42,3 +42,33 @@ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +------------------------------------------------------------------------------- +NASM is now licensed under the 2-clause BSD license, also known as the +simplified BSD license. + + Copyright 1996-2009 the NASM Authors - All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following + conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/COPYING b/COPYING index e5d99e28..6b8118d3 100644 --- a/COPYING +++ b/COPYING @@ -39,8 +39,7 @@ bitvect) are fulfilled. ------- Modules ------- -The modules are 2-clause or 3-clause BSD licensed, with the exception of: - preprocs/nasm - LGPL licensed +The modules are 2-clause or 3-clause BSD licensed. --------- Frontends From 6f329fb10706d1c26fbddedcfd5d1bb8f9a330e9 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 21 Jul 2009 06:48:42 +0000 Subject: [PATCH 275/585] Special-case _GLOBAL_OFFSET_TABLE_ in elf32/64 to generate appropriate relocs. This was particularly noticable in GAS, but there was also a bug in NASM output (lack of fixup within instruction in elf32). Also: - changed ssym lookup from a linear search to using assocdata - added more relocation types (most not implemented) Reported by: Mark Charney svn path=/trunk/yasm/; revision=2206 --- modules/objfmts/elf/elf-machine.h | 9 +- modules/objfmts/elf/elf-objfmt.c | 11 +- modules/objfmts/elf/elf-x86-amd64.c | 58 +- modules/objfmts/elf/elf-x86-x86.c | 66 ++- modules/objfmts/elf/elf.c | 28 +- modules/objfmts/elf/elf.h | 22 +- modules/objfmts/elf/tests/gas32/Makefile.inc | 2 + .../objfmts/elf/tests/gas32/elf_gas32_got.asm | 13 + .../objfmts/elf/tests/gas32/elf_gas32_got.hex | 544 ++++++++++++++++++ 9 files changed, 682 insertions(+), 71 deletions(-) create mode 100644 modules/objfmts/elf/tests/gas32/elf_gas32_got.asm create mode 100644 modules/objfmts/elf/tests/gas32/elf_gas32_got.hex diff --git a/modules/objfmts/elf/elf-machine.h b/modules/objfmts/elf/elf-machine.h index 1742e444..0d8933b1 100644 --- a/modules/objfmts/elf/elf-machine.h +++ b/modules/objfmts/elf/elf-machine.h @@ -44,8 +44,7 @@ #define YASM_WRITE_64Z_L(p, i) YASM_WRITE_64C_L(p, 0, i) -typedef int(*func_accepts_reloc)(size_t val, yasm_symrec *wrt, - yasm_symrec **ssyms); +typedef int(*func_accepts_reloc)(size_t val, yasm_symrec *wrt); typedef void(*func_write_symtab_entry)(unsigned char *bufp, elf_symtab_entry *entry, yasm_intnum *value_intn, @@ -57,9 +56,9 @@ typedef void(*func_write_secthead_rel)(unsigned char *bufp, elf_section_index sindex); typedef void(*func_handle_reloc_addend)(yasm_intnum *intn, - elf_reloc_entry *reloc); -typedef unsigned int(*func_map_reloc_info_to_type)(elf_reloc_entry *reloc, - yasm_symrec **ssyms); + elf_reloc_entry *reloc, + unsigned long offset); +typedef unsigned int(*func_map_reloc_info_to_type)(elf_reloc_entry *reloc); typedef void(*func_write_reloc)(unsigned char *bufp, elf_reloc_entry *reloc, unsigned int r_type, diff --git a/modules/objfmts/elf/elf-objfmt.c b/modules/objfmts/elf/elf-objfmt.c index 4ceccc25..df5bf233 100644 --- a/modules/objfmts/elf/elf-objfmt.c +++ b/modules/objfmts/elf/elf-objfmt.c @@ -68,6 +68,7 @@ typedef struct { yasm_section *sect; yasm_object *object; unsigned long sindex; + yasm_symrec *GOT_sym; } elf_objfmt_output_info; typedef struct { @@ -454,7 +455,7 @@ elf_objfmt_output_reloc(yasm_symrec *sym, yasm_bytecode *bc, int retval; reloc = elf_reloc_entry_create(sym, NULL, - yasm_intnum_create_uint(bc->offset), 0, valsize); + yasm_intnum_create_uint(bc->offset), 0, valsize, 0); if (reloc == NULL) { yasm_error_set(YASM_ERROR_TYPE, N_("elf: invalid relocation size")); return 1; @@ -463,7 +464,7 @@ elf_objfmt_output_reloc(yasm_symrec *sym, yasm_bytecode *bc, elf_secthead_append_reloc(info->sect, info->shead, reloc); zero = yasm_intnum_create_uint(0); - elf_handle_reloc_addend(zero, reloc); + elf_handle_reloc_addend(zero, reloc, 0); retval = yasm_arch_intnum_tobytes(info->object->arch, zero, buf, destsize, valsize, 0, bc, warn); yasm_intnum_destroy(zero); @@ -546,9 +547,10 @@ elf_objfmt_output_value(yasm_value *value, unsigned char *buf, if (value->curpos_rel) intn_val += offset; + /* Check for _GLOBAL_OFFSET_TABLE_ symbol reference */ reloc = elf_reloc_entry_create(sym, wrt, yasm_intnum_create_uint(bc->offset + offset), value->curpos_rel, - valsize); + valsize, sym == info->GOT_sym); if (reloc == NULL) { yasm_error_set(YASM_ERROR_TYPE, N_("elf: invalid relocation (WRT or size)")); @@ -572,7 +574,7 @@ elf_objfmt_output_value(yasm_value *value, unsigned char *buf, } if (reloc) - elf_handle_reloc_addend(intn, reloc); + elf_handle_reloc_addend(intn, reloc, offset); retval = yasm_arch_intnum_tobytes(info->object->arch, intn, buf, destsize, valsize, 0, bc, warn); yasm_intnum_destroy(intn); @@ -780,6 +782,7 @@ elf_objfmt_output(yasm_object *object, FILE *f, int all_syms, info.objfmt_elf = objfmt_elf; info.errwarns = errwarns; info.f = f; + info.GOT_sym = yasm_symtab_get(object->symtab, "_GLOBAL_OFFSET_TABLE_"); /* Update filename strtab */ elf_strtab_entry_set_str(objfmt_elf->file_strtab_entry, diff --git a/modules/objfmts/elf/elf-x86-amd64.c b/modules/objfmts/elf/elf-x86-amd64.c index caa20a53..bdaf82fa 100644 --- a/modules/objfmts/elf/elf-x86-amd64.c +++ b/modules/objfmts/elf/elf-x86-amd64.c @@ -50,15 +50,14 @@ static elf_machine_ssym elf_x86_amd64_ssyms[] = { }; static int -elf_x86_amd64_accepts_reloc(size_t val, yasm_symrec *wrt, yasm_symrec **ssyms) +elf_x86_amd64_accepts_reloc(size_t val, yasm_symrec *wrt) { if (wrt) { - size_t i; - for (i=0; isize) + return 0; + return 1; } return (val&(val-1)) ? 0 : ((val & (8|16|32|64)) != 0); } @@ -131,7 +130,9 @@ elf_x86_amd64_write_secthead_rel(unsigned char *bufp, } static void -elf_x86_amd64_handle_reloc_addend(yasm_intnum *intn, elf_reloc_entry *reloc) +elf_x86_amd64_handle_reloc_addend(yasm_intnum *intn, + elf_reloc_entry *reloc, + unsigned long offset) { /* .rela: copy value out as addend, replace original with 0 */ reloc->addend = yasm_intnum_copy(intn); @@ -139,31 +140,30 @@ elf_x86_amd64_handle_reloc_addend(yasm_intnum *intn, elf_reloc_entry *reloc) } static unsigned int -elf_x86_amd64_map_reloc_info_to_type(elf_reloc_entry *reloc, - yasm_symrec **ssyms) +elf_x86_amd64_map_reloc_info_to_type(elf_reloc_entry *reloc) { if (reloc->wrt) { - size_t i; - for (i=0; iwrt == ssyms[i] && - reloc->valsize == elf_x86_amd64_ssyms[i].size) { - /* Force TLS type; this is required by the linker. */ - if (elf_x86_amd64_ssyms[i].sym_rel & ELF_SSYM_THREAD_LOCAL) { - elf_symtab_entry *esym; + const elf_machine_ssym *ssym = (elf_machine_ssym *) + yasm_symrec_get_data(reloc->wrt, &elf_ssym_symrec_data); + if (!ssym || reloc->valsize != ssym->size) + yasm_internal_error(N_("Unsupported WRT")); - esym = yasm_symrec_get_data(reloc->reloc.sym, - &elf_symrec_data); - if (esym) - esym->type = STT_TLS; - } - /* Map PC-relative GOT to appropriate relocation */ - if (reloc->rtype_rel && - elf_x86_amd64_ssyms[i].reloc == R_X86_64_GOT32) - return (unsigned char) R_X86_64_GOTPCREL; - return (unsigned char) elf_x86_amd64_ssyms[i].reloc; - } + /* Force TLS type; this is required by the linker. */ + if (ssym->sym_rel & ELF_SSYM_THREAD_LOCAL) { + elf_symtab_entry *esym; + + esym = yasm_symrec_get_data(reloc->reloc.sym, &elf_symrec_data); + if (esym) + esym->type = STT_TLS; } - yasm_internal_error(N_("Unsupported WRT")); + /* Map PC-relative GOT to appropriate relocation */ + if (reloc->rtype_rel && ssym->reloc == R_X86_64_GOT32) + return (unsigned char) R_X86_64_GOTPCREL; + return (unsigned char) ssym->reloc; + } else if (reloc->is_GOT_sym && reloc->valsize == 32) { + return (unsigned char) R_X86_64_GOTPC32; + } else if (reloc->is_GOT_sym && reloc->valsize == 64) { + return (unsigned char) R_X86_64_GOTPC64; } else if (reloc->rtype_rel) { switch (reloc->valsize) { case 8: return (unsigned char) R_X86_64_PC8; diff --git a/modules/objfmts/elf/elf-x86-x86.c b/modules/objfmts/elf/elf-x86-x86.c index 07d60fd2..5357c45a 100644 --- a/modules/objfmts/elf/elf-x86-x86.c +++ b/modules/objfmts/elf/elf-x86-x86.c @@ -58,15 +58,14 @@ static const elf_machine_ssym elf_x86_x86_ssyms[] = { }; static int -elf_x86_x86_accepts_reloc(size_t val, yasm_symrec *wrt, yasm_symrec **ssyms) +elf_x86_x86_accepts_reloc(size_t val, yasm_symrec *wrt) { if (wrt) { - size_t i; - for (i=0; isize) + return 0; + return 1; } return (val&(val-1)) ? 0 : ((val & (8|16|32)) != 0); } @@ -133,33 +132,50 @@ elf_x86_x86_write_secthead_rel(unsigned char *bufp, } static void -elf_x86_x86_handle_reloc_addend(yasm_intnum *intn, elf_reloc_entry *reloc) +elf_x86_x86_handle_reloc_addend(yasm_intnum *intn, + elf_reloc_entry *reloc, + unsigned long offset) { + int is_GOT = reloc->is_GOT_sym; + + if (reloc->wrt) { + const elf_machine_ssym *ssym = (elf_machine_ssym *) + yasm_symrec_get_data(reloc->wrt, &elf_ssym_symrec_data); + if (!ssym || reloc->valsize != ssym->size) + yasm_internal_error(N_("Unsupported WRT")); + if (ssym->reloc == R_386_GOTPC) + is_GOT = 1; + } + + if (is_GOT && reloc->valsize == 32 && offset != 0) + { + yasm_intnum *off_intn = yasm_intnum_create_uint(offset); + yasm_intnum_calc(intn, YASM_EXPR_ADD, off_intn); + yasm_intnum_destroy(off_intn); + } return; /* .rel: Leave addend in intn */ } static unsigned int -elf_x86_x86_map_reloc_info_to_type(elf_reloc_entry *reloc, - yasm_symrec **ssyms) +elf_x86_x86_map_reloc_info_to_type(elf_reloc_entry *reloc) { if (reloc->wrt) { - size_t i; - for (i=0; iwrt == ssyms[i] && - reloc->valsize == elf_x86_x86_ssyms[i].size) { - /* Force TLS type; this is required by the linker. */ - if (elf_x86_x86_ssyms[i].sym_rel & ELF_SSYM_THREAD_LOCAL) { - elf_symtab_entry *esym; + const elf_machine_ssym *ssym = (elf_machine_ssym *) + yasm_symrec_get_data(reloc->wrt, &elf_ssym_symrec_data); + if (!ssym || reloc->valsize != ssym->size) + yasm_internal_error(N_("Unsupported WRT")); - esym = yasm_symrec_get_data(reloc->reloc.sym, - &elf_symrec_data); - if (esym) - esym->type = STT_TLS; - } - return (unsigned char) elf_x86_x86_ssyms[i].reloc; - } + /* Force TLS type; this is required by the linker. */ + if (ssym->sym_rel & ELF_SSYM_THREAD_LOCAL) { + elf_symtab_entry *esym; + + esym = yasm_symrec_get_data(reloc->reloc.sym, &elf_symrec_data); + if (esym) + esym->type = STT_TLS; } - yasm_internal_error(N_("Unsupported WRT")); + return (unsigned char) ssym->reloc; + } else if (reloc->is_GOT_sym && reloc->valsize == 32) { + return (unsigned char) R_386_GOTPC; } else if (reloc->rtype_rel) { switch (reloc->valsize) { case 8: return (unsigned char) R_386_PC8; diff --git a/modules/objfmts/elf/elf.c b/modules/objfmts/elf/elf.c index 01c2fa5b..acd83d4e 100644 --- a/modules/objfmts/elf/elf.c +++ b/modules/objfmts/elf/elf.c @@ -43,12 +43,18 @@ const yasm_assoc_data_callback elf_section_data = { static void elf_symrec_data_destroy(/*@only@*/ void *d); static void elf_symtab_entry_print(void *data, FILE *f, int indent_level); +static void elf_ssym_symtab_entry_print(void *data, FILE *f, int indent_level); const yasm_assoc_data_callback elf_symrec_data = { elf_symrec_data_destroy, elf_symtab_entry_print }; +const yasm_assoc_data_callback elf_ssym_symrec_data = { + elf_symrec_data_destroy, + elf_ssym_symtab_entry_print +}; + extern elf_machine_handler elf_machine_handler_x86_x86, elf_machine_handler_x86_amd64; @@ -92,6 +98,8 @@ elf_set_arch(yasm_arch *arch, yasm_symtab *symtab, int bits_pref) elf_ssyms[i] = yasm_symtab_define_label(symtab, elf_march->ssyms[i].name, NULL, 0, 0); + yasm_symrec_add_data(elf_ssyms[i], &elf_ssym_symrec_data, + &elf_march->ssyms[i]); } } @@ -141,14 +149,15 @@ elf_reloc_entry_create(yasm_symrec *sym, yasm_symrec *wrt, yasm_intnum *addr, int rel, - size_t valsize) + size_t valsize, + int is_GOT_sym) { elf_reloc_entry *entry; if (!elf_march->accepts_reloc) yasm_internal_error(N_("Unsupported machine for ELF output")); - if (!elf_march->accepts_reloc(valsize, wrt, elf_ssyms)) + if (!elf_march->accepts_reloc(valsize, wrt)) { if (addr) yasm_intnum_destroy(addr); @@ -165,6 +174,7 @@ elf_reloc_entry_create(yasm_symrec *sym, entry->valsize = valsize; entry->addend = NULL; entry->wrt = wrt; + entry->is_GOT_sym = is_GOT_sym; return entry; } @@ -350,6 +360,12 @@ elf_symtab_entry_print(void *data, FILE *f, int indent_level) fprintf(f, "\n"); } +static void +elf_ssym_symtab_entry_print(void *data, FILE *f, int indent_level) +{ + /* TODO */ +} + elf_symtab_head * elf_symtab_create() { @@ -702,11 +718,13 @@ elf_secthead_name_reloc_section(const char *basesect) } void -elf_handle_reloc_addend(yasm_intnum *intn, elf_reloc_entry *reloc) +elf_handle_reloc_addend(yasm_intnum *intn, + elf_reloc_entry *reloc, + unsigned long offset) { if (!elf_march->handle_reloc_addend) yasm_internal_error(N_("Unsupported machine for ELF output")); - elf_march->handle_reloc_addend(intn, reloc); + elf_march->handle_reloc_addend(intn, reloc, offset); } unsigned long @@ -778,7 +796,7 @@ elf_secthead_write_relocs_to_file(FILE *f, yasm_section *sect, vis = yasm_symrec_get_visibility(reloc->reloc.sym); if (!elf_march->map_reloc_info_to_type) yasm_internal_error(N_("Unsupported arch/machine for elf output")); - r_type = elf_march->map_reloc_info_to_type(reloc, elf_ssyms); + r_type = elf_march->map_reloc_info_to_type(reloc); bufp = buf; if (!elf_march->write_reloc || !elf_march->reloc_entry_size) diff --git a/modules/objfmts/elf/elf.h b/modules/objfmts/elf/elf.h index 1fe18bd2..41e9af2d 100644 --- a/modules/objfmts/elf/elf.h +++ b/modules/objfmts/elf/elf.h @@ -330,7 +330,18 @@ typedef enum { R_X86_64_TLSLD = 20, /* word32, PC-rel offset to LD GOT block */ R_X86_64_DTPOFF32 = 21, /* word32, offset to TLS block */ R_X86_64_GOTTPOFF = 22, /* word32, PC-rel offset to IE GOT entry */ - R_X86_64_TPOFF32 = 23 /* word32, offset in initial TLS block */ + R_X86_64_TPOFF32 = 23, /* word32, offset in initial TLS block */ + R_X86_64_PC64 = 24, /* word64, PC relative */ + R_X86_64_GOTOFF64 = 25, /* word64, offset to GOT */ + R_X86_64_GOTPC32 = 26, /* word32, signed pc relative to GOT */ + R_X86_64_GOT64 = 27, /* word64, GOT entry offset */ + R_X86_64_GOTPCREL64 = 28, /* word64, signed pc relative to GOT entry */ + R_X86_64_GOTPC64 = 29, /* word64, signed pc relative to GOT */ + R_X86_64_GOTPLT64 = 30, /* like GOT64, but indicates PLT entry needed */ + R_X86_64_PLTOFF64 = 31, /* word64, GOT relative offset to PLT entry */ + R_X86_64_GOTPC32_TLSDESC = 34, /* GOT offset for TLS descriptor */ + R_X86_64_TLSDESC_CALL = 35, /* Marker for call through TLS descriptor */ + R_X86_64_TLSDESC = 36 /* TLS descriptor */ } elf_x86_64_relocation_type; struct elf_secthead { @@ -377,6 +388,7 @@ struct elf_reloc_entry { size_t valsize; yasm_intnum *addend; /*@null@*/ yasm_symrec *wrt; + int is_GOT_sym; }; STAILQ_HEAD(elf_strtab_head, elf_strtab_entry); @@ -407,6 +419,7 @@ struct elf_symtab_entry { extern const yasm_assoc_data_callback elf_section_data; extern const yasm_assoc_data_callback elf_symrec_data; +extern const yasm_assoc_data_callback elf_ssym_symrec_data; const elf_machine_handler *elf_set_arch(struct yasm_arch *arch, @@ -422,7 +435,8 @@ elf_reloc_entry *elf_reloc_entry_create(yasm_symrec *sym, /*@null@*/ yasm_symrec *wrt, yasm_intnum *addr, int rel, - size_t valsize); + size_t valsize, + int is_GOT_sym); void elf_reloc_entry_destroy(void *entry); /* strtab functions */ @@ -491,7 +505,9 @@ struct yasm_symrec *elf_secthead_set_sym(elf_secthead *shead, struct yasm_symrec *sym); void elf_secthead_add_size(elf_secthead *shead, yasm_intnum *size); char *elf_secthead_name_reloc_section(const char *basesect); -void elf_handle_reloc_addend(yasm_intnum *intn, elf_reloc_entry *reloc); +void elf_handle_reloc_addend(yasm_intnum *intn, + elf_reloc_entry *reloc, + unsigned long offset); unsigned long elf_secthead_write_rel_to_file(FILE *f, elf_section_index symtab, yasm_section *sect, elf_secthead *esd, diff --git a/modules/objfmts/elf/tests/gas32/Makefile.inc b/modules/objfmts/elf/tests/gas32/Makefile.inc index f9e7d114..506e3bc5 100644 --- a/modules/objfmts/elf/tests/gas32/Makefile.inc +++ b/modules/objfmts/elf/tests/gas32/Makefile.inc @@ -5,3 +5,5 @@ TESTS += modules/objfmts/elf/tests/gas32/elf_gas32_test.sh EXTRA_DIST += modules/objfmts/elf/tests/gas32/elf_gas32_test.sh EXTRA_DIST += modules/objfmts/elf/tests/gas32/elf_gas32_ssym.asm EXTRA_DIST += modules/objfmts/elf/tests/gas32/elf_gas32_ssym.hex +EXTRA_DIST += modules/objfmts/elf/tests/gas32/elf_gas32_got.asm +EXTRA_DIST += modules/objfmts/elf/tests/gas32/elf_gas32_got.hex diff --git a/modules/objfmts/elf/tests/gas32/elf_gas32_got.asm b/modules/objfmts/elf/tests/gas32/elf_gas32_got.asm new file mode 100644 index 00000000..22a60a52 --- /dev/null +++ b/modules/objfmts/elf/tests/gas32/elf_gas32_got.asm @@ -0,0 +1,13 @@ +.text + +.extern a + +.globl tst +tst: + call L1 +L1: + pop %eax + add $_GLOBAL_OFFSET_TABLE_+(.-L1), %eax + mov (a@GOT)(%eax), %eax + movl $5, (%eax) + ret diff --git a/modules/objfmts/elf/tests/gas32/elf_gas32_got.hex b/modules/objfmts/elf/tests/gas32/elf_gas32_got.hex new file mode 100644 index 00000000..c7060e62 --- /dev/null +++ b/modules/objfmts/elf/tests/gas32/elf_gas32_got.hex @@ -0,0 +1,544 @@ +7f +45 +4c +46 +01 +01 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +03 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +30 +01 +00 +00 +00 +00 +00 +00 +34 +00 +00 +00 +00 +00 +28 +00 +06 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +e8 +00 +00 +00 +00 +58 +05 +02 +00 +00 +00 +8b +80 +00 +00 +00 +00 +c7 +00 +05 +00 +00 +00 +c3 +07 +00 +00 +00 +0a +06 +00 +00 +0d +00 +00 +00 +03 +04 +00 +00 +00 +2e +74 +65 +78 +74 +00 +2e +72 +65 +6c +2e +74 +65 +78 +74 +00 +2e +73 +74 +72 +74 +61 +62 +00 +2e +73 +79 +6d +74 +61 +62 +00 +2e +73 +68 +73 +74 +72 +74 +61 +62 +00 +00 +00 +2d +00 +61 +00 +74 +73 +74 +00 +5f +47 +4c +4f +42 +41 +4c +5f +4f +46 +46 +53 +45 +54 +5f +54 +41 +42 +4c +45 +5f +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +f1 +ff +00 +00 +00 +00 +05 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +00 +04 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +10 +00 +00 +00 +05 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +10 +00 +04 +00 +09 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +21 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +68 +00 +00 +00 +2b +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +11 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +94 +00 +00 +00 +1f +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +19 +00 +00 +00 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +b4 +00 +00 +00 +70 +00 +00 +00 +02 +00 +00 +00 +04 +00 +00 +00 +04 +00 +00 +00 +10 +00 +00 +00 +01 +00 +00 +00 +01 +00 +00 +00 +06 +00 +00 +00 +00 +00 +00 +00 +40 +00 +00 +00 +18 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +07 +00 +00 +00 +09 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +58 +00 +00 +00 +10 +00 +00 +00 +03 +00 +00 +00 +04 +00 +00 +00 +04 +00 +00 +00 +08 +00 +00 +00 From 0f373ef2ae19766bb62e05d901779f80826e6a1e Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 21 Jul 2009 06:49:44 +0000 Subject: [PATCH 276/585] elf: Add support for 64-bit PC-relative relocation. svn path=/trunk/yasm/; revision=2207 --- modules/objfmts/elf/elf-x86-amd64.c | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/objfmts/elf/elf-x86-amd64.c b/modules/objfmts/elf/elf-x86-amd64.c index bdaf82fa..23675d64 100644 --- a/modules/objfmts/elf/elf-x86-amd64.c +++ b/modules/objfmts/elf/elf-x86-amd64.c @@ -169,6 +169,7 @@ elf_x86_amd64_map_reloc_info_to_type(elf_reloc_entry *reloc) case 8: return (unsigned char) R_X86_64_PC8; case 16: return (unsigned char) R_X86_64_PC16; case 32: return (unsigned char) R_X86_64_PC32; + case 64: return (unsigned char) R_X86_64_PC64; default: yasm_internal_error(N_("Unsupported relocation size")); } } else { From fbb1fd248d5d5bcaed264df1b9083cc1df060444 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 22 Jul 2009 05:45:03 +0000 Subject: [PATCH 277/585] elf: Add latest x86 relocation types. svn path=/trunk/yasm/; revision=2208 --- modules/objfmts/elf/elf.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/objfmts/elf/elf.h b/modules/objfmts/elf/elf.h index 41e9af2d..84fe83a3 100644 --- a/modules/objfmts/elf/elf.h +++ b/modules/objfmts/elf/elf.h @@ -303,7 +303,10 @@ typedef enum { R_386_TLS_LE_32 = 34, /* Offset relative to static TLS block */ R_386_TLS_DTPMOD32 = 35, /* ID of module containing symbol */ R_386_TLS_DTPOFF32 = 36, /* Offset in TLS block */ - R_386_TLS_TPOFF32 = 37 /* Offset in static TLS block */ + R_386_TLS_TPOFF32 = 37, /* Offset in static TLS block */ + R_386_TLS_GOTDESC = 39, + R_386_TLS_DESC_CALL = 40, + R_386_TLS_DESC = 41 } elf_386_relocation_type; typedef enum { From 948d59417b7d67bfee0f86c1c68a19c74be8d83e Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 22 Jul 2009 05:49:54 +0000 Subject: [PATCH 278/585] Unbreak make check (broken by [2206]). svn path=/trunk/yasm/; revision=2209 --- modules/objfmts/elf/tests/elfso.hex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/objfmts/elf/tests/elfso.hex b/modules/objfmts/elf/tests/elfso.hex index 206cce9c..94a50cbd 100644 --- a/modules/objfmts/elf/tests/elfso.hex +++ b/modules/objfmts/elf/tests/elfso.hex @@ -88,7 +88,7 @@ e8 5b 81 c3 -03 +05 00 00 00 From c2dce0a354d2274724ae61b14fb854861c0c618f Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 22 Jul 2009 05:51:35 +0000 Subject: [PATCH 279/585] Update elf special symbols: - Add tlsdesc and tlscall to both x86 and amd64. - Add 64-bit pltoff, gotplt, gotoff to amd64. svn path=/trunk/yasm/; revision=2210 --- modules/objfmts/elf/elf-x86-amd64.c | 9 ++++++++- modules/objfmts/elf/elf-x86-x86.c | 6 +++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/modules/objfmts/elf/elf-x86-amd64.c b/modules/objfmts/elf/elf-x86-amd64.c index 23675d64..16d70f9a 100644 --- a/modules/objfmts/elf/elf-x86-amd64.c +++ b/modules/objfmts/elf/elf-x86-amd64.c @@ -34,7 +34,10 @@ #include "elf-machine.h" static elf_machine_ssym elf_x86_amd64_ssyms[] = { + {"pltoff", ELF_SSYM_SYM_RELATIVE, R_X86_64_PLTOFF64, 64}, {"plt", ELF_SSYM_SYM_RELATIVE, R_X86_64_PLT32, 32}, + {"gotplt", ELF_SSYM_SYM_RELATIVE, R_X86_64_GOTPLT64, 64}, + {"gotoff", ELF_SSYM_SYM_RELATIVE, R_X86_64_GOTOFF64, 64}, {"gotpcrel", ELF_SSYM_SYM_RELATIVE, R_X86_64_GOTPCREL, 32}, {"tlsgd", ELF_SSYM_SYM_RELATIVE|ELF_SSYM_THREAD_LOCAL, R_X86_64_TLSGD, 32}, @@ -46,7 +49,11 @@ static elf_machine_ssym elf_x86_amd64_ssyms[] = { R_X86_64_TPOFF32, 32}, {"dtpoff", ELF_SSYM_SYM_RELATIVE|ELF_SSYM_THREAD_LOCAL, R_X86_64_DTPOFF32, 32}, - {"got", ELF_SSYM_SYM_RELATIVE, R_X86_64_GOT32, 32} + {"got", ELF_SSYM_SYM_RELATIVE, R_X86_64_GOT32, 32}, + {"tlsdesc", ELF_SSYM_SYM_RELATIVE|ELF_SSYM_THREAD_LOCAL, + R_X86_64_GOTPC32_TLSDESC, 32}, + {"tlscall", ELF_SSYM_SYM_RELATIVE|ELF_SSYM_THREAD_LOCAL, + R_X86_64_TLSDESC_CALL, 32} }; static int diff --git a/modules/objfmts/elf/elf-x86-x86.c b/modules/objfmts/elf/elf-x86-x86.c index 5357c45a..d2fa6d1e 100644 --- a/modules/objfmts/elf/elf-x86-x86.c +++ b/modules/objfmts/elf/elf-x86-x86.c @@ -54,7 +54,11 @@ static const elf_machine_ssym elf_x86_x86_ssyms[] = { R_386_TLS_GOTIE, 32}, {"indntpoff", ELF_SSYM_SYM_RELATIVE|ELF_SSYM_THREAD_LOCAL, R_386_TLS_IE, 32}, - {"got", ELF_SSYM_SYM_RELATIVE, R_386_GOT32, 32} + {"got", ELF_SSYM_SYM_RELATIVE, R_386_GOT32, 32}, + {"tlsdesc", ELF_SSYM_SYM_RELATIVE|ELF_SSYM_THREAD_LOCAL, + R_386_TLS_GOTDESC, 32}, + {"tlscall", ELF_SSYM_SYM_RELATIVE|ELF_SSYM_THREAD_LOCAL, + R_386_TLS_DESC_CALL, 32} }; static int From dd7c64f68a26be4c6ca3e07c53c874c86b6d601b Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 24 Jul 2009 19:01:35 +0000 Subject: [PATCH 280/585] Fix #178: Don't "distribute" shift right op. This breaks horribly for things like (sym+511)>>9 in -f bin, as the result is zero instead of something more useful. Also don't check RHS for symbols; these will fall out later in the assembly process if they cannot be simplified. svn path=/trunk/yasm/; revision=2220 --- libyasm/tests/Makefile.inc | 2 ++ libyasm/tests/value-shr-symexpr.asm | 6 ++++ libyasm/tests/value-shr-symexpr.hex | 8 +++++ libyasm/value.c | 54 ++++++++--------------------- 4 files changed, 30 insertions(+), 40 deletions(-) create mode 100644 libyasm/tests/value-shr-symexpr.asm create mode 100644 libyasm/tests/value-shr-symexpr.hex diff --git a/libyasm/tests/Makefile.inc b/libyasm/tests/Makefile.inc index 23f422bf..44cb5bc1 100644 --- a/libyasm/tests/Makefile.inc +++ b/libyasm/tests/Makefile.inc @@ -83,6 +83,8 @@ EXTRA_DIST += libyasm/tests/value-samesym.hex EXTRA_DIST += libyasm/tests/value-mask.asm EXTRA_DIST += libyasm/tests/value-mask.errwarn EXTRA_DIST += libyasm/tests/value-mask.hex +EXTRA_DIST += libyasm/tests/value-shr-symexpr.asm +EXTRA_DIST += libyasm/tests/value-shr-symexpr.hex check_PROGRAMS += bitvect_test check_PROGRAMS += floatnum_test diff --git a/libyasm/tests/value-shr-symexpr.asm b/libyasm/tests/value-shr-symexpr.asm new file mode 100644 index 00000000..988abbff --- /dev/null +++ b/libyasm/tests/value-shr-symexpr.asm @@ -0,0 +1,6 @@ +dw foo +dw (foo+((1<<9)-1)) +dw (foo+((1<<9)-1)) >> 9 +foo: +dw (bar+foo)>>(0+1) +bar: diff --git a/libyasm/tests/value-shr-symexpr.hex b/libyasm/tests/value-shr-symexpr.hex new file mode 100644 index 00000000..b3169287 --- /dev/null +++ b/libyasm/tests/value-shr-symexpr.hex @@ -0,0 +1,8 @@ +06 +00 +05 +02 +01 +00 +07 +00 diff --git a/libyasm/value.c b/libyasm/value.c index 180bf6af..a49daa03 100644 --- a/libyasm/value.c +++ b/libyasm/value.c @@ -336,54 +336,28 @@ value_finalize_scan(yasm_value *value, yasm_expr *e, * XXX: should rshift be an expr instead?? */ - /* Check for not allowed cases on RHS */ - switch (e->terms[1].type) { - case YASM_EXPR_REG: - case YASM_EXPR_FLOAT: - return 1; /* not legal */ - case YASM_EXPR_SYM: - return 1; - case YASM_EXPR_EXPR: - if (value_finalize_scan(value, e->terms[1].data.expn, - expr_precbc, 1)) - return 1; - break; - default: - break; - } + /* Check for single sym on LHS */ + if (e->terms[0].type != YASM_EXPR_SYM) + break; - /* Check for single sym and allowed cases on LHS */ - switch (e->terms[0].type) { - /*case YASM_EXPR_REG: ????? should this be illegal ????? */ - case YASM_EXPR_FLOAT: - return 1; /* not legal */ - case YASM_EXPR_SYM: - if (value->rel || ssym_not_ok) - return 1; - value->rel = e->terms[0].data.sym; - /* and replace with 0 */ - e->terms[0].type = YASM_EXPR_INT; - e->terms[0].data.intn = yasm_intnum_create_uint(0); - break; - case YASM_EXPR_EXPR: - /* recurse */ - if (value_finalize_scan(value, e->terms[0].data.expn, - expr_precbc, ssym_not_ok)) - return 1; - break; - default: - break; /* ignore */ - } + /* If we already have a sym, we can't take another one */ + if (value->rel || ssym_not_ok) + return 1; - /* Handle RHS */ - if (!value->rel) - break; /* no handling needed */ + /* RHS must be a positive integer */ if (e->terms[1].type != YASM_EXPR_INT) return 1; /* can't shift sym by non-constant integer */ shamt = yasm_intnum_get_uint(e->terms[1].data.intn); if ((shamt + value->rshift) > YASM_VALUE_RSHIFT_MAX) return 1; /* total shift would be too large */ + + /* Update value */ value->rshift += shamt; + value->rel = e->terms[0].data.sym; + + /* Replace symbol with 0 */ + e->terms[0].type = YASM_EXPR_INT; + e->terms[0].data.intn = yasm_intnum_create_uint(0); /* Just leave SHR in place */ break; From 0e0556cc9dd48c969353f1d00db5b8ee734432cd Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 25 Jul 2009 05:29:47 +0000 Subject: [PATCH 281/585] Unbreak distcheck. svn path=/trunk/yasm/; revision=2224 --- modules/preprocs/tasm/tests/Makefile.inc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/preprocs/tasm/tests/Makefile.inc b/modules/preprocs/tasm/tests/Makefile.inc index 23450b4e..e2e0beca 100644 --- a/modules/preprocs/tasm/tests/Makefile.inc +++ b/modules/preprocs/tasm/tests/Makefile.inc @@ -3,7 +3,7 @@ TESTS += modules/preprocs/tasm/tests/tasmpp_test.sh EXTRA_DIST += modules/preprocs/tasm/tests/tasmpp_test.sh -EXTRA_DIST += modules/preprocs/nasm/tests/tasm-assume-comment.asm -EXTRA_DIST += modules/preprocs/nasm/tests/tasm-assume-comment.hex -EXTRA_DIST += modules/preprocs/nasm/tests/tasm-comment-instr.asm -EXTRA_DIST += modules/preprocs/nasm/tests/tasm-comment-instr.hex +EXTRA_DIST += modules/preprocs/tasm/tests/tasm-assume-comment.asm +EXTRA_DIST += modules/preprocs/tasm/tests/tasm-assume-comment.hex +EXTRA_DIST += modules/preprocs/tasm/tests/tasm-comment-instr.asm +EXTRA_DIST += modules/preprocs/tasm/tests/tasm-comment-instr.hex From b5f0a4008c9210dfac6fd7eede2c77c534edb5f0 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 30 Jul 2009 02:19:38 +0000 Subject: [PATCH 282/585] Fix #184: test -e is not portable (despite being in POSIX); use test -f instead. svn path=/trunk/yasm/; revision=2226 --- modules/objfmts/bin/tests/multisect/bin_multi_test.sh | 2 +- modules/preprocs/yapp/tests/yapp_test.sh | 2 +- out_test.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/objfmts/bin/tests/multisect/bin_multi_test.sh b/modules/objfmts/bin/tests/multisect/bin_multi_test.sh index 1c42dabe..acf6ae7c 100755 --- a/modules/objfmts/bin/tests/multisect/bin_multi_test.sh +++ b/modules/objfmts/bin/tests/multisect/bin_multi_test.sh @@ -31,7 +31,7 @@ do eg=`echo ${asm} | sed 's,.asm$,.errwarn,'` m=${a}.map mg=`echo ${asm} | sed 's,.asm$,.map,'` - if test \! -e ${eg}; then + if test \! -f ${eg}; then eg=/dev/null fi diff --git a/modules/preprocs/yapp/tests/yapp_test.sh b/modules/preprocs/yapp/tests/yapp_test.sh index 53143850..4753b69d 100755 --- a/modules/preprocs/yapp/tests/yapp_test.sh +++ b/modules/preprocs/yapp/tests/yapp_test.sh @@ -29,7 +29,7 @@ do og=`echo ${asm} | sed 's,.asm$,.pre,'` e=${a}.ew eg=`echo ${asm} | sed 's,.asm$,.errwarn,'` - if test \! -e ${eg}; then + if test \! -f ${eg}; then eg=/dev/null fi diff --git a/out_test.sh b/out_test.sh index 93acbfba..2c9ad65d 100755 --- a/out_test.sh +++ b/out_test.sh @@ -29,7 +29,7 @@ do og=`echo ${asm} | sed 's,.asm$,.hex,'` e=${a}.ew eg=`echo ${asm} | sed 's,.asm$,.errwarn,'` - if test \! -e ${eg}; then + if test \! -f ${eg}; then eg=/dev/null fi From 47d7fbf5135a1739899d33be67cbfb770f729ddb Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 31 Jul 2009 02:50:19 +0000 Subject: [PATCH 283/585] Fix #185: Add mkinstalldirs to svn repo, as autogen.sh doesn't pull it in. svn path=/trunk/yasm/; revision=2227 --- config/mkinstalldirs | 161 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100755 config/mkinstalldirs diff --git a/config/mkinstalldirs b/config/mkinstalldirs new file mode 100755 index 00000000..ef7e16fd --- /dev/null +++ b/config/mkinstalldirs @@ -0,0 +1,161 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy + +scriptversion=2006-05-11.19 + +# Original author: Noah Friedman +# Created: 1993-05-16 +# Public domain. +# +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' +IFS=" "" $nl" +errstatus=0 +dirmode= + +usage="\ +Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... + +Create each directory DIR (with mode MODE, if specified), including all +leading file name components. + +Report bugs to ." + +# process command line arguments +while test $# -gt 0 ; do + case $1 in + -h | --help | --h*) # -h for help + echo "$usage" + exit $? + ;; + -m) # -m PERM arg + shift + test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } + dirmode=$1 + shift + ;; + --version) + echo "$0 $scriptversion" + exit $? + ;; + --) # stop option processing + shift + break + ;; + -*) # unknown option + echo "$usage" 1>&2 + exit 1 + ;; + *) # first non-opt arg + break + ;; + esac +done + +for file +do + if test -d "$file"; then + shift + else + break + fi +done + +case $# in + 0) exit 0 ;; +esac + +# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and +# mkdir -p a/c at the same time, both will detect that a is missing, +# one will create a, then the other will try to create a and die with +# a "File exists" error. This is a problem when calling mkinstalldirs +# from a parallel make. We use --version in the probe to restrict +# ourselves to GNU mkdir, which is thread-safe. +case $dirmode in + '') + if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + echo "mkdir -p -- $*" + exec mkdir -p -- "$@" + else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + test -d ./-p && rmdir ./-p + test -d ./--version && rmdir ./--version + fi + ;; + *) + if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && + test ! -d ./--version; then + echo "mkdir -m $dirmode -p -- $*" + exec mkdir -m "$dirmode" -p -- "$@" + else + # Clean up after NextStep and OpenStep mkdir. + for d in ./-m ./-p ./--version "./$dirmode"; + do + test -d $d && rmdir $d + done + fi + ;; +esac + +for file +do + case $file in + /*) pathcomp=/ ;; + *) pathcomp= ;; + esac + oIFS=$IFS + IFS=/ + set fnord $file + shift + IFS=$oIFS + + for d + do + test "x$d" = x && continue + + pathcomp=$pathcomp$d + case $pathcomp in + -*) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + else + if test ! -z "$dirmode"; then + echo "chmod $dirmode $pathcomp" + lasterr= + chmod "$dirmode" "$pathcomp" || lasterr=$? + + if test ! -z "$lasterr"; then + errstatus=$lasterr + fi + fi + fi + fi + + pathcomp=$pathcomp/ + done +done + +exit $errstatus + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: From 7a0082c94d011a5154200b8fe7a204eef2765a07 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 6 Aug 2009 07:13:11 +0000 Subject: [PATCH 284/585] Fix #186: Avoid memory runaway in optimizer TIMES circular reference checking. Check for duplicates in backtrace used when checking for circular references. This uses a simple N^2 algorithm (as the number of items in the backtrace is usually small) but avoids memory runaway due to duplicate item storage. svn path=/trunk/yasm/; revision=2229 --- libyasm/section.c | 67 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 47 insertions(+), 20 deletions(-) diff --git a/libyasm/section.c b/libyasm/section.c index 1f73929b..2c6c8de6 100644 --- a/libyasm/section.c +++ b/libyasm/section.c @@ -864,6 +864,7 @@ struct yasm_span { * checking for circular references (cycles) with id=0 spans. */ yasm_span **backtrace; + int backtrace_size; /* First offset setter following this span's bytecode */ yasm_offset_setter *os; @@ -901,6 +902,7 @@ create_span(yasm_bytecode *bc, int id, /*@null@*/ const yasm_value *value, span->id = id; span->active = 1; span->backtrace = NULL; + span->backtrace_size = 0; span->os = os; return span; @@ -1160,7 +1162,8 @@ check_cycle(IntervalTreeNode *node, void *d) optimize_data *optd = d; yasm_span_term *term = node->data; yasm_span *depspan = term->span; - int bt_size = 0, dep_bt_size = 0; + int i; + int depspan_bt_alloc; /* Only check for cycles in id=0 spans */ if (depspan->id > 0) @@ -1170,10 +1173,8 @@ check_cycle(IntervalTreeNode *node, void *d) * span is in our backtrace. */ if (optd->span->backtrace) { - yasm_span *s; - while ((s = optd->span->backtrace[bt_size])) { - bt_size++; - if (s == depspan) + for (i=0; ispan->backtrace_size; i++) { + if (optd->span->backtrace[i] == depspan) yasm_error_set(YASM_ERROR_VALUE, N_("circular reference detected")); } @@ -1183,25 +1184,51 @@ check_cycle(IntervalTreeNode *node, void *d) * span. */ if (!depspan->backtrace) { - depspan->backtrace = yasm_xmalloc((bt_size+2)*sizeof(yasm_span *)); - if (bt_size > 0) + depspan->backtrace = yasm_xmalloc((optd->span->backtrace_size+1)* + sizeof(yasm_span *)); + if (optd->span->backtrace_size > 0) memcpy(depspan->backtrace, optd->span->backtrace, - bt_size*sizeof(yasm_span *)); - depspan->backtrace[bt_size] = optd->span; - depspan->backtrace[bt_size+1] = NULL; + optd->span->backtrace_size*sizeof(yasm_span *)); + depspan->backtrace[optd->span->backtrace_size] = optd->span; + depspan->backtrace_size = optd->span->backtrace_size+1; return; } - while (depspan->backtrace[dep_bt_size]) - dep_bt_size++; - depspan->backtrace = - yasm_xrealloc(depspan->backtrace, - (dep_bt_size+bt_size+2)*sizeof(yasm_span *)); - if (bt_size > 0) - memcpy(&depspan->backtrace[dep_bt_size], optd->span->backtrace, - (bt_size-1)*sizeof(yasm_span *)); - depspan->backtrace[dep_bt_size+bt_size] = optd->span; - depspan->backtrace[dep_bt_size+bt_size+1] = NULL; + /* Add our complete backtrace, checking for duplicates */ + depspan_bt_alloc = depspan->backtrace_size; + for (i=0; ispan->backtrace_size; i++) { + int present = 0; + int j; + for (j=0; jbacktrace_size; j++) { + if (optd->span->backtrace[i] == optd->span->backtrace[j]) { + present = 1; + break; + } + } + if (present) + continue; + /* Not already in array; add it. */ + if (depspan->backtrace_size >= depspan_bt_alloc) + { + depspan_bt_alloc *= 2; + depspan->backtrace = + yasm_xrealloc(depspan->backtrace, + depspan_bt_alloc*sizeof(yasm_span *)); + } + depspan->backtrace[depspan->backtrace_size] = optd->span->backtrace[i]; + depspan->backtrace_size++; + } + + /* Add ourselves. */ + if (depspan->backtrace_size >= depspan_bt_alloc) + { + depspan_bt_alloc++; + depspan->backtrace = + yasm_xrealloc(depspan->backtrace, + depspan_bt_alloc*sizeof(yasm_span *)); + } + depspan->backtrace[depspan->backtrace_size] = optd->span; + depspan->backtrace_size++; } static void From de776f46eafeae1ea166c7d60137d9224d09c5db Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Wed, 12 Aug 2009 14:33:52 +0000 Subject: [PATCH 285/585] improve handling of Python batch file for genperf svn path=/trunk/yasm/; revision=2230 --- Mkfiles/vc9/genperf/run.bat | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Mkfiles/vc9/genperf/run.bat b/Mkfiles/vc9/genperf/run.bat index 64ec1ae3..04b07940 100644 --- a/Mkfiles/vc9/genperf/run.bat +++ b/Mkfiles/vc9/genperf/run.bat @@ -1,11 +1,12 @@ cd ..\..\.. @echo off -reg query HKCR\Python.File\shell\open\command >nul: 2>&1 +for /f "usebackq tokens=2,3,4" %%f in (`reg query HKCR\Python.File\shell\open\command`) do (if %%f==REG_SZ echo %%g %%h >run_py.bat) goto answer%errorlevel% :answer0 echo ... building with Python ... @echo on -modules\arch\x86\gen_x86_insn.py +call run_py.bat modules\arch\x86\gen_x86_insn.py +del run_py.bat @echo off goto end :answer1 From f3f0f20466a32cff10c15c6e8885648658ef9fca Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Wed, 12 Aug 2009 14:51:57 +0000 Subject: [PATCH 286/585] Further change to python invocation in genperf svn path=/trunk/yasm/; revision=2231 --- Mkfiles/vc9/genperf/run.bat | 1 + 1 file changed, 1 insertion(+) diff --git a/Mkfiles/vc9/genperf/run.bat b/Mkfiles/vc9/genperf/run.bat index 04b07940..11e69040 100644 --- a/Mkfiles/vc9/genperf/run.bat +++ b/Mkfiles/vc9/genperf/run.bat @@ -3,6 +3,7 @@ cd ..\..\.. for /f "usebackq tokens=2,3,4" %%f in (`reg query HKCR\Python.File\shell\open\command`) do (if %%f==REG_SZ echo %%g %%h >run_py.bat) goto answer%errorlevel% :answer0 +if not exist run_py.bat goto answer1 echo ... building with Python ... @echo on call run_py.bat modules\arch\x86\gen_x86_insn.py From d9e4f1bc19ef0b55d1694ad3bee4cfdb6bcbfd8e Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 12 Sep 2009 02:38:35 +0000 Subject: [PATCH 287/585] Fix #78 further: Support C++ style // comments. svn path=/trunk/yasm/; revision=2232 --- modules/parsers/gas/gas-token.re | 1 + modules/parsers/gas/tests/bin/gas-comment.asm | 2 ++ modules/parsers/gas/tests/bin/gas-comment.errwarn | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/parsers/gas/gas-token.re b/modules/parsers/gas/gas-token.re index a4ce5bba..b252ab43 100644 --- a/modules/parsers/gas/gas-token.re +++ b/modules/parsers/gas/gas-token.re @@ -480,6 +480,7 @@ scan: } else goto line_comment; } + "//" { goto line_comment; } ws+ { goto scan; } diff --git a/modules/parsers/gas/tests/bin/gas-comment.asm b/modules/parsers/gas/tests/bin/gas-comment.asm index ee68e554..0c265f7d 100644 --- a/modules/parsers/gas/tests/bin/gas-comment.asm +++ b/modules/parsers/gas/tests/bin/gas-comment.asm @@ -2,6 +2,8 @@ /* So is this */ +// and so is this + .byte 0 /* at end of line? */ .byte 0 /* at end of line, diff --git a/modules/parsers/gas/tests/bin/gas-comment.errwarn b/modules/parsers/gas/tests/bin/gas-comment.errwarn index 1fb55a30..6a29a1fd 100644 --- a/modules/parsers/gas/tests/bin/gas-comment.errwarn +++ b/modules/parsers/gas/tests/bin/gas-comment.errwarn @@ -1 +1 @@ --:23: warning: end of file in comment +-:25: warning: end of file in comment From e15ad1b94b458419b75b1430e1a4a0e8cd596b18 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 31 Oct 2009 21:45:55 +0000 Subject: [PATCH 288/585] Fix #188: Times forward references would result in bad code generation. svn path=/trunk/yasm/; revision=2233 --- libyasm/bytecode.c | 4 +++- libyasm/tests/Makefile.inc | 2 ++ libyasm/tests/timesfwd.asm | 8 ++++++++ libyasm/tests/timesfwd.hex | 10 ++++++++++ 4 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 libyasm/tests/timesfwd.asm create mode 100644 libyasm/tests/timesfwd.hex diff --git a/libyasm/bytecode.c b/libyasm/bytecode.c index df3cc9d5..851085c0 100644 --- a/libyasm/bytecode.c +++ b/libyasm/bytecode.c @@ -309,10 +309,12 @@ yasm_bc_tobytes(yasm_bytecode *bc, unsigned char *buf, unsigned long *bufsize, long i; int error = 0; - if (yasm_bc_get_multiple(bc, &bc->mult_int, 1) || bc->mult_int == 0) { + long mult; + if (yasm_bc_get_multiple(bc, &mult, 1) || mult == 0) { *bufsize = 0; return NULL; } + bc->mult_int = mult; /* special case for reserve bytecodes */ if (bc->callback->special == YASM_BC_SPECIAL_RESERVE) { diff --git a/libyasm/tests/Makefile.inc b/libyasm/tests/Makefile.inc index 44cb5bc1..005fbbc5 100644 --- a/libyasm/tests/Makefile.inc +++ b/libyasm/tests/Makefile.inc @@ -66,6 +66,8 @@ EXTRA_DIST += libyasm/tests/strucsize.asm EXTRA_DIST += libyasm/tests/strucsize.hex EXTRA_DIST += libyasm/tests/times0.asm EXTRA_DIST += libyasm/tests/times0.hex +EXTRA_DIST += libyasm/tests/timesfwd.asm +EXTRA_DIST += libyasm/tests/timesfwd.hex EXTRA_DIST += libyasm/tests/timesover-err.asm EXTRA_DIST += libyasm/tests/timesover-err.errwarn EXTRA_DIST += libyasm/tests/timesunder.asm diff --git a/libyasm/tests/timesfwd.asm b/libyasm/tests/timesfwd.asm new file mode 100644 index 00000000..bdb36d3e --- /dev/null +++ b/libyasm/tests/timesfwd.asm @@ -0,0 +1,8 @@ +[section .text] +[bits 64] +;[global foo] +;[global bar] +times (foo-bar+$$-$)&7 nop +foo: inc eax +bar: inc ecx + diff --git a/libyasm/tests/timesfwd.hex b/libyasm/tests/timesfwd.hex new file mode 100644 index 00000000..82904beb --- /dev/null +++ b/libyasm/tests/timesfwd.hex @@ -0,0 +1,10 @@ +90 +90 +90 +90 +90 +90 +ff +c0 +ff +c1 From 4e15ef1cc9e83edf0709b78e9e70f09901adab32 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 31 Oct 2009 21:52:42 +0000 Subject: [PATCH 289/585] Fix #187: Add new variable CFLAGS_FOR_BUILD for CC_FOR_BUILD compiles. Due to the need to support cross-building, CC_FOR_BUILD is used instead of CC for tools that will be run as part of the build process. However, it is sometimes necessary to add custom CFLAGS for these builds; CFLAGS_FOR_BUILD supports this cleanly. svn path=/trunk/yasm/; revision=2234 --- tools/genmacro/Makefile.inc | 3 ++- tools/genperf/Makefile.inc | 15 ++++++++++----- tools/re2c/Makefile.inc | 27 ++++++++++++++++++--------- 3 files changed, 30 insertions(+), 15 deletions(-) diff --git a/tools/genmacro/Makefile.inc b/tools/genmacro/Makefile.inc index 6232b9c4..c81edd14 100644 --- a/tools/genmacro/Makefile.inc +++ b/tools/genmacro/Makefile.inc @@ -11,5 +11,6 @@ genmacro_LDADD = genmacro.$(OBJEXT) genmacro_LINK = $(CCLD_FOR_BUILD) -o $@ genmacro.$(OBJEXT): tools/genmacro/genmacro.c - $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f tools/genmacro/genmacro.c || echo '$(srcdir)/'`tools/genmacro/genmacro.c + $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) \ + -c -o $@ `test -f tools/genmacro/genmacro.c || echo '$(srcdir)/'`tools/genmacro/genmacro.c diff --git a/tools/genperf/Makefile.inc b/tools/genperf/Makefile.inc index b7e80ed8..d9f24afa 100644 --- a/tools/genperf/Makefile.inc +++ b/tools/genperf/Makefile.inc @@ -23,17 +23,22 @@ genperf_LDADD += gp-xstrdup.$(OBJEXT) genperf_LINK = $(CCLD_FOR_BUILD) -o $@ genperf.$(OBJEXT): tools/genperf/genperf.c - $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f tools/genperf/genperf.c || echo '$(srcdir)/'`tools/genperf/genperf.c + $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) \ + -c -o $@ `test -f tools/genperf/genperf.c || echo '$(srcdir)/'`tools/genperf/genperf.c gp-perfect.$(OBJEXT): tools/genperf/perfect.c - $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f tools/genperf/perfect.c || echo '$(srcdir)/'`tools/genperf/perfect.c + $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) \ + -c -o $@ `test -f tools/genperf/perfect.c || echo '$(srcdir)/'`tools/genperf/perfect.c gp-phash.$(OBJEXT): libyasm/phash.c - $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f libyasm/phash.c || echo '$(srcdir)/'`libyasm/phash.c + $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) \ + -c -o $@ `test -f libyasm/phash.c || echo '$(srcdir)/'`libyasm/phash.c gp-xmalloc.$(OBJEXT): libyasm/xmalloc.c - $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f libyasm/xmalloc.c || echo '$(srcdir)/'`libyasm/xmalloc.c + $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) \ + -c -o $@ `test -f libyasm/xmalloc.c || echo '$(srcdir)/'`libyasm/xmalloc.c gp-xstrdup.$(OBJEXT): libyasm/xstrdup.c - $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f libyasm/xstrdup.c || echo '$(srcdir)/'`libyasm/xstrdup.c + $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) \ + -c -o $@ `test -f libyasm/xstrdup.c || echo '$(srcdir)/'`libyasm/xstrdup.c diff --git a/tools/re2c/Makefile.inc b/tools/re2c/Makefile.inc index abd2db87..ceff9087 100644 --- a/tools/re2c/Makefile.inc +++ b/tools/re2c/Makefile.inc @@ -38,31 +38,40 @@ re2c_LDADD += re2c-translate.$(OBJEXT) re2c_LINK = $(CCLD_FOR_BUILD) -o $@ re2c-main.$(OBJEXT): tools/re2c/main.c - $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f tools/re2c/main.c || echo '$(srcdir)/'`tools/re2c/main.c + $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) \ + -c -o $@ `test -f tools/re2c/main.c || echo '$(srcdir)/'`tools/re2c/main.c re2c-code.$(OBJEXT): tools/re2c/code.c - $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f tools/re2c/code.c || echo '$(srcdir)/'`tools/re2c/code.c + $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) \ + -c -o $@ `test -f tools/re2c/code.c || echo '$(srcdir)/'`tools/re2c/code.c re2c-dfa.$(OBJEXT): tools/re2c/dfa.c - $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f tools/re2c/dfa.c || echo '$(srcdir)/'`tools/re2c/dfa.c + $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) \ + -c -o $@ `test -f tools/re2c/dfa.c || echo '$(srcdir)/'`tools/re2c/dfa.c re2c-parser.$(OBJEXT): tools/re2c/parser.c - $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f tools/re2c/parser.c || echo '$(srcdir)/'`tools/re2c/parser.c + $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) \ + -c -o $@ `test -f tools/re2c/parser.c || echo '$(srcdir)/'`tools/re2c/parser.c re2c-actions.$(OBJEXT): tools/re2c/actions.c - $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f tools/re2c/actions.c || echo '$(srcdir)/'`tools/re2c/actions.c + $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) \ + -c -o $@ `test -f tools/re2c/actions.c || echo '$(srcdir)/'`tools/re2c/actions.c re2c-scanner.$(OBJEXT): tools/re2c/scanner.c - $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f tools/re2c/scanner.c || echo '$(srcdir)/'`tools/re2c/scanner.c + $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) \ + -c -o $@ `test -f tools/re2c/scanner.c || echo '$(srcdir)/'`tools/re2c/scanner.c re2c-mbo_getopt.$(OBJEXT): tools/re2c/mbo_getopt.c - $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f tools/re2c/mbo_getopt.c || echo '$(srcdir)/'`tools/re2c/mbo_getopt.c + $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) \ + -c -o $@ `test -f tools/re2c/mbo_getopt.c || echo '$(srcdir)/'`tools/re2c/mbo_getopt.c re2c-substr.$(OBJEXT): tools/re2c/substr.c - $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f tools/re2c/substr.c || echo '$(srcdir)/'`tools/re2c/substr.c + $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) \ + -c -o $@ `test -f tools/re2c/substr.c || echo '$(srcdir)/'`tools/re2c/substr.c re2c-translate.$(OBJEXT): tools/re2c/translate.c - $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f tools/re2c/translate.c || echo '$(srcdir)/'`tools/re2c/translate.c + $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) \ + -c -o $@ `test -f tools/re2c/translate.c || echo '$(srcdir)/'`tools/re2c/translate.c EXTRA_DIST += tools/re2c/CHANGELOG EXTRA_DIST += tools/re2c/NO_WARRANTY From 29ad858dadf53e6dfa8703927463a151e85d9c6f Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 3 Nov 2009 05:15:37 +0000 Subject: [PATCH 290/585] Fix #189: Avoid compiler warning in genperf. svn path=/trunk/yasm/; revision=2235 --- tools/genperf/genperf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/genperf/genperf.c b/tools/genperf/genperf.c index 1fcf2da1..c05a4cc0 100644 --- a/tools/genperf/genperf.c +++ b/tools/genperf/genperf.c @@ -234,7 +234,7 @@ perfect_gen(FILE *out, const char *lookup_function_name, /* The hash function body */ fprintf(out, " const struct %s *ret;\n", struct_name); for (i=0; i= %lu) return NULL;\n", nkeys); fprintf(out, " ret = &pd[rsl];\n"); fprintf(out, " if (strcmp(key, ret->name) != 0) return NULL;\n"); From 10b0c9214be742bc9e17f5638d39eee8dfa43c0b Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 8 Nov 2009 17:14:01 +0000 Subject: [PATCH 291/585] Fix #190: Incorrect opcode generated for vphaddudq. svn path=/trunk/yasm/; revision=2236 --- modules/arch/x86/gen_x86_insn.py | 2 +- modules/arch/x86/tests/xop-all.hex | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index 2e263bc0..ab97e8ce 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -6789,7 +6789,7 @@ add_insn("vphaddubd", "vphaddsub", modifiers=[0xD2]) add_insn("vphaddubq", "vphaddsub", modifiers=[0xD3]) add_insn("vphadduwd", "vphaddsub", modifiers=[0xD6]) add_insn("vphadduwq", "vphaddsub", modifiers=[0xD7]) -add_insn("vphaddudq", "vphaddsub", modifiers=[0xDB]) +add_insn("vphaddudq", "vphaddsub", modifiers=[0xD8]) add_insn("vphsubbw", "vphaddsub", modifiers=[0xE1]) add_insn("vphsubwd", "vphaddsub", modifiers=[0xE2]) diff --git a/modules/arch/x86/tests/xop-all.hex b/modules/arch/x86/tests/xop-all.hex index ee9fd7fb..1d03cbe6 100644 --- a/modules/arch/x86/tests/xop-all.hex +++ b/modules/arch/x86/tests/xop-all.hex @@ -500,19 +500,19 @@ d1 8f e9 78 -db +d8 ca 8f e9 78 -db +d8 0e 00 00 8f e9 78 -db +d8 0e 00 00 From 32b5671cf09f0c48ff6d83f81b3c9000375c60fc Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 8 Nov 2009 17:30:34 +0000 Subject: [PATCH 292/585] Fix #191: Incorrect argument order generated for AMD FMA4 opcodes. svn path=/trunk/yasm/; revision=2237 --- modules/arch/x86/gen_x86_insn.py | 22 +- modules/arch/x86/tests/amd-fma4.hex | 360 ++++++++++++++-------------- 2 files changed, 191 insertions(+), 191 deletions(-) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index ab97e8ce..eb79cc28 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -6901,9 +6901,9 @@ add_group("fma_128_256", prefix=0x66, opcode=[0x0F, 0x3A, 0x00], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDReg", size=128, dest="VEXImmSrc"), + Operand(type="SIMDReg", size=128, dest="VEX"), Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), - Operand(type="SIMDReg", size=128, dest="VEX")]) + Operand(type="SIMDReg", size=128, dest="VEXImmSrc")]) add_group("fma_128_256", cpu=["FMA4"], modifiers=["Op2Add"], @@ -6912,8 +6912,8 @@ add_group("fma_128_256", prefix=0x66, opcode=[0x0F, 0x3A, 0x00], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDReg", size=128, dest="VEXImmSrc"), Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDReg", size=128, dest="VEXImmSrc"), Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) add_group("fma_128_256", cpu=["FMA4"], @@ -6923,9 +6923,9 @@ add_group("fma_128_256", prefix=0x66, opcode=[0x0F, 0x3A, 0x00], operands=[Operand(type="SIMDReg", size=256, dest="Spare"), - Operand(type="SIMDReg", size=256, dest="VEXImmSrc"), + Operand(type="SIMDReg", size=256, dest="VEX"), Operand(type="SIMDRM", size=256, relaxed=True, dest="EA"), - Operand(type="SIMDReg", size=256, dest="VEX")]) + Operand(type="SIMDReg", size=256, dest="VEXImmSrc")]) add_group("fma_128_256", cpu=["FMA4"], modifiers=["Op2Add"], @@ -6934,8 +6934,8 @@ add_group("fma_128_256", prefix=0x66, opcode=[0x0F, 0x3A, 0x00], operands=[Operand(type="SIMDReg", size=256, dest="Spare"), - Operand(type="SIMDReg", size=256, dest="VEXImmSrc"), Operand(type="SIMDReg", size=256, dest="VEX"), + Operand(type="SIMDReg", size=256, dest="VEXImmSrc"), Operand(type="SIMDRM", size=256, relaxed=True, dest="EA")]) add_insn("vfmaddpd", "fma_128_256", modifiers=[0x69]) @@ -6960,9 +6960,9 @@ for sz in [32, 64]: prefix=0x66, opcode=[0x0F, 0x3A, 0x00], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDReg", size=128, dest="VEXImmSrc"), + Operand(type="SIMDReg", size=128, dest="VEX"), Operand(type="SIMDReg", size=128, dest="EA"), - Operand(type="SIMDReg", size=128, dest="VEX")]) + Operand(type="SIMDReg", size=128, dest="VEXImmSrc")]) add_group("fma_128_m%d" % sz, cpu=["FMA4"], modifiers=["Op2Add"], @@ -6971,9 +6971,9 @@ for sz in [32, 64]: prefix=0x66, opcode=[0x0F, 0x3A, 0x00], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDReg", size=128, dest="VEXImmSrc"), + Operand(type="SIMDReg", size=128, dest="VEX"), Operand(type="Mem", size=sz, relaxed=True, dest="EA"), - Operand(type="SIMDReg", size=128, dest="VEX")]) + Operand(type="SIMDReg", size=128, dest="VEXImmSrc")]) add_group("fma_128_m%d" % sz, cpu=["FMA4"], modifiers=["Op2Add"], @@ -6982,8 +6982,8 @@ for sz in [32, 64]: prefix=0x66, opcode=[0x0F, 0x3A, 0x00], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDReg", size=128, dest="VEXImmSrc"), Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDReg", size=128, dest="VEXImmSrc"), Operand(type="Mem", size=sz, relaxed=True, dest="EA")]) add_insn("vfmaddsd", "fma_128_m64", modifiers=[0x6B]) diff --git a/modules/arch/x86/tests/amd-fma4.hex b/modules/arch/x86/tests/amd-fma4.hex index 7f51092a..a1193179 100644 --- a/modules/arch/x86/tests/amd-fma4.hex +++ b/modules/arch/x86/tests/amd-fma4.hex @@ -1,540 +1,540 @@ c4 e3 -61 +71 69 c2 -10 +30 c4 e3 -61 +71 69 00 -10 +30 c4 e3 -61 +71 69 00 -10 +30 c4 e3 -e9 +f1 69 00 -10 +20 c4 e3 -e9 +f1 69 00 -10 +20 c4 e3 -65 +75 69 c2 -10 +30 c4 e3 -65 +75 69 00 -10 +30 c4 e3 -65 +75 69 00 -10 +30 c4 e3 -ed +f5 69 00 -10 +20 c4 e3 -ed +f5 69 00 -10 +20 c4 e3 -61 +71 68 c2 -10 +30 c4 e3 -61 +71 68 00 -10 +30 c4 e3 -e9 +f1 68 00 -10 +20 c4 e3 -65 +75 68 c2 -10 +30 c4 e3 -65 +75 68 00 -10 +30 c4 e3 -ed +f5 68 00 -10 +20 c4 e3 -61 +71 6b c2 -10 +30 c4 e3 -61 +71 6b 00 -10 +30 c4 e3 -61 +71 6b 00 -10 +30 c4 e3 -e9 +f1 6b 00 -10 +20 c4 e3 -e9 +f1 6b 00 -10 +20 c4 e3 -61 +71 6a c2 -10 +30 c4 e3 -61 +71 6a 00 -10 +30 c4 e3 -e9 +f1 6a 00 -10 +20 c4 e3 -61 +71 5d c2 -10 +30 c4 e3 -61 +71 5d 00 -10 +30 c4 e3 -e9 +f1 5d 00 -10 +20 c4 e3 -65 +75 5d c2 -10 +30 c4 e3 -65 +75 5d 00 -10 +30 c4 e3 -ed +f5 5d 00 -10 +20 c4 e3 -61 +71 5c c2 -10 +30 c4 e3 -61 +71 5c 00 -10 +30 c4 e3 -e9 +f1 5c 00 -10 +20 c4 e3 -65 +75 5c c2 -10 +30 c4 e3 -65 +75 5c 00 -10 +30 c4 e3 -ed +f5 5c 00 -10 +20 c4 e3 -61 +71 6d c2 -10 +30 c4 e3 -61 +71 6d 00 -10 +30 c4 e3 -e9 +f1 6d 00 -10 +20 c4 e3 -65 +75 6d c2 -10 +30 c4 e3 -65 +75 6d 00 -10 +30 c4 e3 -ed +f5 6d 00 -10 +20 c4 e3 -61 +71 6c c2 -10 +30 c4 e3 -61 +71 6c 00 -10 +30 c4 e3 -e9 +f1 6c 00 -10 +20 c4 e3 -65 +75 6c c2 -10 +30 c4 e3 -65 +75 6c 00 -10 +30 c4 e3 -ed +f5 6c 00 -10 +20 c4 e3 -61 +71 6f c2 -10 +30 c4 e3 -61 +71 6f 00 -10 +30 c4 e3 -e9 +f1 6f 00 -10 +20 c4 e3 -61 +71 6e c2 -10 +30 c4 e3 -61 +71 6e 00 -10 +30 c4 e3 -e9 +f1 6e 00 -10 +20 c4 e3 -61 +71 79 c2 -10 +30 c4 e3 -61 +71 79 00 -10 +30 c4 e3 -e9 +f1 79 00 -10 +20 c4 e3 -65 +75 79 c2 -10 +30 c4 e3 -65 +75 79 00 -10 +30 c4 e3 -ed +f5 79 00 -10 +20 c4 e3 -61 +71 78 c2 -10 +30 c4 e3 -61 +71 78 00 -10 +30 c4 e3 -e9 +f1 78 00 -10 +20 c4 e3 -65 +75 78 c2 -10 +30 c4 e3 -65 +75 78 00 -10 +30 c4 e3 -ed +f5 78 00 -10 +20 c4 e3 -61 +71 7b c2 -10 +30 c4 e3 -61 +71 7b 00 -10 +30 c4 e3 -e9 +f1 7b 00 -10 +20 c4 e3 -61 +71 7a c2 -10 +30 c4 e3 -61 +71 7a 00 -10 +30 c4 e3 -e9 +f1 7a 00 -10 +20 c4 e3 -61 +71 7d c2 -10 +30 c4 e3 -61 +71 7d 00 -10 +30 c4 e3 -e9 +f1 7d 00 -10 +20 c4 e3 -65 +75 7d c2 -10 +30 c4 e3 -65 +75 7d 00 -10 +30 c4 e3 -ed +f5 7d 00 -10 +20 c4 e3 -61 +71 7c c2 -10 +30 c4 e3 -61 +71 7c 00 -10 +30 c4 e3 -e9 +f1 7c 00 -10 +20 c4 e3 -65 +75 7c c2 -10 +30 c4 e3 -65 +75 7c 00 -10 +30 c4 e3 -ed +f5 7c 00 -10 +20 c4 e3 -61 +71 7f c2 -10 +30 c4 e3 -61 +71 7f 00 -10 +30 c4 e3 -e9 +f1 7f 00 -10 +20 c4 e3 -61 +71 7e c2 -10 +30 c4 e3 -61 +71 7e 00 -10 +30 c4 e3 -e9 +f1 7e 00 -10 +20 From ad1280030cb5e189600af3c02e436ab880673c0c Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Mon, 30 Nov 2009 03:43:10 +0000 Subject: [PATCH 293/585] Fix a bunch of GAS x86 instruction issues. - Fix #193: ljmp/lcall not implemented; add 2-operand far jump to jmp/call. - Add loop{,z,e} instruction suffixes - Fix a bunch of jmp/call minor issues. - Vastly improve suffix handling in general to make more consistent and make a greater variety of no-suffix instructions work in a way that matches GAS. svn path=/trunk/yasm/; revision=2238 --- modules/arch/x86/gen_x86_insn.py | 229 +++++++- modules/arch/x86/tests/gas32/Makefile.inc | 4 + modules/arch/x86/tests/gas32/gas-farjump.asm | 13 + modules/arch/x86/tests/gas32/gas-farjump.hex | 408 ++++++++++++++ modules/arch/x86/tests/gas32/gas-loop32.asm | 5 + modules/arch/x86/tests/gas32/gas-loop32.hex | 376 +++++++++++++ modules/arch/x86/tests/gas64/Makefile.inc | 2 + modules/arch/x86/tests/gas64/gas-loop64.asm | 5 + modules/arch/x86/tests/gas64/gas-loop64.hex | 528 +++++++++++++++++++ modules/arch/x86/x86id.c | 77 ++- 10 files changed, 1597 insertions(+), 50 deletions(-) create mode 100644 modules/arch/x86/tests/gas32/gas-farjump.asm create mode 100644 modules/arch/x86/tests/gas32/gas-farjump.hex create mode 100644 modules/arch/x86/tests/gas32/gas-loop32.asm create mode 100644 modules/arch/x86/tests/gas32/gas-loop32.hex create mode 100644 modules/arch/x86/tests/gas64/gas-loop64.asm create mode 100644 modules/arch/x86/tests/gas64/gas-loop64.hex diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index eb79cc28..eefd2ca8 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -178,6 +178,14 @@ class GroupForm(object): suffix = kwargs.pop("suffix", None) if suffix is not None: self.suffixes = [suffix] + + req_suffix = kwargs.pop("req_suffix", False) + if not req_suffix: + if self.suffixes is None: + self.suffixes = ["Z"] + else: + self.suffixes.append("Z") + if self.suffixes is not None: self.suffixes = set(x.upper() for x in self.suffixes) @@ -452,7 +460,7 @@ class Insn(object): def __str__(self): if self.suffix is None: - suffix_str = "NONE" + suffix_str = "SUF_Z" elif len(self.suffix) == 1: suffix_str = "SUF_" + self.suffix else: @@ -532,14 +540,6 @@ def finalize_insns(): parsers &= insn.parsers if "gas" in parsers: - keyword = name - if keyword in gas_insns: - raise ValueError("duplicate gas instruction %s" % keyword) - newinsn = insn.copy() - newinsn.auto_cpu("gas") - newinsn.auto_misc_flags("gas") - gas_insns[keyword] = newinsn - if insn.suffix is None: suffixes = set() for form in group: @@ -547,7 +547,10 @@ def finalize_insns(): suffixes |= form.suffixes for suffix in suffixes: - keyword = name+suffix + if suffix == "Z": + keyword = name + else: + keyword = name+suffix if keyword in gas_insns: raise ValueError("duplicate gas instruction %s" % keyword) @@ -556,6 +559,15 @@ def finalize_insns(): newinsn.auto_cpu("gas") newinsn.auto_misc_flags("gas") gas_insns[keyword] = newinsn + else: + keyword = name + if keyword in gas_insns: + raise ValueError("duplicate gas instruction %s" % + keyword) + newinsn = insn.copy() + newinsn.auto_cpu("gas") + newinsn.auto_misc_flags("gas") + gas_insns[keyword] = newinsn if "nasm" in parsers: keyword = name @@ -2206,15 +2218,18 @@ add_group("call", opcode=[], operands=[Operand(type="ImmNotSegOff", dest="JmpRel")]) add_group("call", + suffix="w", opersize=16, opcode=[], operands=[Operand(type="ImmNotSegOff", size=16, dest="JmpRel")]) add_group("call", + suffix="l", not64=True, opersize=32, opcode=[], operands=[Operand(type="ImmNotSegOff", size=32, dest="JmpRel")]) add_group("call", + suffixes=["l", "q"], only64=True, opersize=64, opcode=[], @@ -2242,59 +2257,77 @@ add_group("call", operands=[Operand(type="Imm", tmod="Near", dest="JmpRel")]) add_group("call", + suffix="w", + req_suffix=True, opersize=16, opcode=[0xFF], spare=2, operands=[Operand(type="RM", size=16, dest="EA")]) add_group("call", + suffix="l", + req_suffix=True, not64=True, opersize=32, opcode=[0xFF], spare=2, operands=[Operand(type="RM", size=32, dest="EA")]) add_group("call", + suffix="q", + req_suffix=True, opersize=64, def_opersize_64=64, opcode=[0xFF], spare=2, operands=[Operand(type="RM", size=64, dest="EA")]) +add_group("call", + parsers=["gas"], + def_opersize_64=64, + opcode=[0xFF], + spare=2, + operands=[Operand(type="Reg", size="BITS", dest="EA")]) add_group("call", def_opersize_64=64, opcode=[0xFF], spare=2, operands=[Operand(type="Mem", dest="EA")]) add_group("call", + parsers=["nasm"], opersize=16, def_opersize_64=64, opcode=[0xFF], spare=2, operands=[Operand(type="RM", size=16, tmod="Near", dest="EA")]) add_group("call", + parsers=["nasm"], not64=True, opersize=32, opcode=[0xFF], spare=2, operands=[Operand(type="RM", size=32, tmod="Near", dest="EA")]) add_group("call", + parsers=["nasm"], opersize=64, def_opersize_64=64, opcode=[0xFF], spare=2, operands=[Operand(type="RM", size=64, tmod="Near", dest="EA")]) add_group("call", + parsers=["nasm"], def_opersize_64=64, opcode=[0xFF], spare=2, operands=[Operand(type="Mem", tmod="Near", dest="EA")]) -# Far indirect (through memory). Needs explicit FAR override. +# Far indirect (through memory). Needs explicit FAR override (NASM only) for sz in [16, 32, 64]: add_group("call", + parsers=["nasm"], opersize=sz, opcode=[0xFF], spare=3, operands=[Operand(type="Mem", size=sz, tmod="Far", dest="EA")]) add_group("call", + parsers=["nasm"], opcode=[0xFF], spare=3, operands=[Operand(type="Mem", tmod="Far", dest="EA")]) @@ -2302,34 +2335,52 @@ add_group("call", # With explicit FAR override for sz in [16, 32]: add_group("call", + parsers=["nasm"], not64=True, opersize=sz, opcode=[0x9A], - spare=3, operands=[Operand(type="Imm", size=sz, tmod="Far", dest="JmpFar")]) add_group("call", + parsers=["nasm"], not64=True, opcode=[0x9A], - spare=3, operands=[Operand(type="Imm", tmod="Far", dest="JmpFar")]) -# Since not caught by first ImmNotSegOff group, implicitly FAR. +# Since not caught by first ImmNotSegOff group, implicitly FAR (in NASM). for sz in [16, 32]: add_group("call", + parsers=["nasm"], not64=True, opersize=sz, opcode=[0x9A], - spare=3, operands=[Operand(type="Imm", size=sz, dest="JmpFar")]) add_group("call", + parsers=["nasm"], not64=True, opcode=[0x9A], - spare=3, operands=[Operand(type="Imm", dest="JmpFar")]) +# Two-operand FAR (GAS only) +for sfx, sz in zip("wl", [16, 32]): + add_group("call", + suffix=sfx, + req_suffix=True, + parsers=["gas"], + not64=True, + gas_no_reverse=True, + opersize=sz, + opcode=[0x9A], + operands=[Operand(type="Imm", size=16, relaxed=True, dest="JmpFar"), + Operand(type="Imm", size=sz, relaxed=True, dest="JmpFar")]) +add_group("call", + parsers=["gas"], + not64=True, + gas_no_reverse=True, + opcode=[0x9A], + operands=[Operand(type="Imm", size=16, relaxed=True, dest="JmpFar"), + Operand(type="Imm", size="BITS", relaxed=True, dest="JmpFar")]) + add_insn("call", "call") -add_insn("calll", "call", parser="gas", not64=True) -add_insn("callq", "call", parser="gas", only64=True) # # jmp @@ -2338,15 +2389,18 @@ add_group("jmp", opcode=[], operands=[Operand(type="ImmNotSegOff", dest="JmpRel")]) add_group("jmp", + suffix="w", opersize=16, opcode=[], operands=[Operand(type="ImmNotSegOff", size=16, dest="JmpRel")]) add_group("jmp", + suffix="l", not64=True, opersize=32, opcode=[0x00], operands=[Operand(type="ImmNotSegOff", size=32, dest="JmpRel")]) add_group("jmp", + suffixes=["l", "q"], only64=True, opersize=64, opcode=[0x00], @@ -2379,35 +2433,49 @@ add_group("jmp", operands=[Operand(type="Imm", tmod="Near", dest="JmpRel")]) add_group("jmp", + suffix="w", + req_suffix=True, opersize=16, def_opersize_64=64, opcode=[0xFF], spare=4, operands=[Operand(type="RM", size=16, dest="EA")]) add_group("jmp", + suffix="l", + req_suffix=True, not64=True, opersize=32, opcode=[0xFF], spare=4, operands=[Operand(type="RM", size=32, dest="EA")]) add_group("jmp", + suffix="q", + req_suffix=True, opersize=64, def_opersize_64=64, opcode=[0xFF], spare=4, operands=[Operand(type="RM", size=64, dest="EA")]) +add_group("jmp", + parsers=["gas"], + def_opersize_64=64, + opcode=[0xFF], + spare=4, + operands=[Operand(type="Reg", size="BITS", dest="EA")]) add_group("jmp", def_opersize_64=64, opcode=[0xFF], spare=4, operands=[Operand(type="Mem", dest="EA")]) add_group("jmp", + parsers=["nasm"], opersize=16, def_opersize_64=64, opcode=[0xFF], spare=4, operands=[Operand(type="RM", size=16, tmod="Near", dest="EA")]) add_group("jmp", + parsers=["nasm"], not64=True, cpu=["386"], opersize=32, @@ -2415,12 +2483,14 @@ add_group("jmp", spare=4, operands=[Operand(type="RM", size=32, tmod="Near", dest="EA")]) add_group("jmp", + parsers=["nasm"], opersize=64, def_opersize_64=64, opcode=[0xFF], spare=4, operands=[Operand(type="RM", size=64, tmod="Near", dest="EA")]) add_group("jmp", + parsers=["nasm"], def_opersize_64=64, opcode=[0xFF], spare=4, @@ -2444,30 +2514,91 @@ for sz in [16, 32]: not64=True, opersize=sz, opcode=[0xEA], - spare=3, operands=[Operand(type="Imm", size=sz, tmod="Far", dest="JmpFar")]) add_group("jmp", not64=True, opcode=[0xEA], - spare=3, operands=[Operand(type="Imm", tmod="Far", dest="JmpFar")]) -# Since not caught by first ImmNotSegOff group, implicitly FAR. +# Since not caught by first ImmNotSegOff group, implicitly FAR (in NASM). for sz in [16, 32]: add_group("jmp", + parsers=["nasm"], not64=True, opersize=sz, opcode=[0xEA], - spare=3, operands=[Operand(type="Imm", size=sz, dest="JmpFar")]) add_group("jmp", + parsers=["nasm"], not64=True, opcode=[0xEA], - spare=3, operands=[Operand(type="Imm", dest="JmpFar")]) +# Two-operand FAR (GAS only) +for sfx, sz in zip("wl", [16, 32]): + add_group("jmp", + parsers=["gas"], + suffix=sfx, + req_suffix=True, + not64=True, + gas_no_reverse=True, + opersize=sz, + opcode=[0xEA], + operands=[Operand(type="Imm", size=16, relaxed=True, dest="JmpFar"), + Operand(type="Imm", size=sz, relaxed=True, dest="JmpFar")]) +add_group("jmp", + parsers=["gas"], + not64=True, + gas_no_reverse=True, + opcode=[0xEA], + operands=[Operand(type="Imm", size=16, relaxed=True, dest="JmpFar"), + Operand(type="Imm", size="BITS", relaxed=True, dest="JmpFar")]) + add_insn("jmp", "jmp") +# +# GAS far calls/jumps +# + +# Far indirect (through memory) +for sfx, sz in zip("wlq", [16, 32, 64]): + add_group("ljmpcall", + suffix=sfx, + req_suffix=True, + opersize=sz, + modifiers=["SpAdd"], + opcode=[0xFF], + spare=0, + operands=[Operand(type="Mem", size=sz, relaxed=True, dest="EA")]) +add_group("ljmpcall", + modifiers=["SpAdd"], + opcode=[0xFF], + spare=0, + operands=[Operand(type="Mem", size="BITS", relaxed=True, dest="EA")]) + +# Two-operand far +for sfx, sz in zip("wl", [16, 32]): + add_group("ljmpcall", + not64=True, + gas_no_reverse=True, + suffix=sfx, + req_suffix=True, + opersize=sz, + modifiers=["Gap", "Op0Add"], + opcode=[0x00], + operands=[Operand(type="Imm", size=16, relaxed=True, dest="JmpFar"), + Operand(type="Imm", size=sz, relaxed=True, dest="JmpFar")]) +add_group("ljmpcall", + not64=True, + gas_no_reverse=True, + modifiers=["Gap", "Op0Add"], + opcode=[0x00], + operands=[Operand(type="Imm", size=16, relaxed=True, dest="JmpFar"), + Operand(type="Imm", size="BITS", relaxed=True, dest="JmpFar")]) + +add_insn("ljmp", "ljmpcall", parser="gas", modifiers=[5, 0xEA]) +add_insn("lcall", "ljmpcall", parser="gas", modifiers=[3, 0x9A]) + # # ret # @@ -2511,10 +2642,11 @@ add_insn("retl", "retnf", parser="gas", modifiers=[0xC2], not64=True) add_insn("retq", "retnf", parser="gas", modifiers=[0xC2], only64=True) add_insn("retn", "retnf", parser="nasm", modifiers=[0xC2]) add_insn("retf", "retnf", parser="nasm", modifiers=[0xCA, 64]) -add_insn("lretw", "retnf", parser="gas", modifiers=[0xCA, 16], suffix="NONE") -add_insn("lretl", "retnf", parser="gas", modifiers=[0xCA], suffix="NONE") +add_insn("lret", "retnf", parser="gas", modifiers=[0xCA], suffix="z") +add_insn("lretw", "retnf", parser="gas", modifiers=[0xCA, 16], suffix="w") +add_insn("lretl", "retnf", parser="gas", modifiers=[0xCA], suffix="l") add_insn("lretq", "retnf", parser="gas", modifiers=[0xCA, 64], only64=True, - suffix="NONE") + suffix="q") # # enter @@ -2707,6 +2839,45 @@ add_insn("loope", "loop", modifiers=[1]) add_insn("loopnz", "loop", modifiers=[0]) add_insn("loopne", "loop", modifiers=[0]) +# GAS w/l/q suffixes have to set addrsize via modifiers +for sfx, sz in zip("wlq", [16, 32, 64]): + add_group("loop"+sfx, + not64=(sz == 16), + only64=(sz == 64), + modifiers=["Gap", "AdSizeR"], + def_opersize_64=64, + opcode=[], + operands=[Operand(type="Imm", dest="JmpRel")]) + add_group("loop"+sfx, + not64=(sz == 16), + only64=(sz == 64), + modifiers=["Op0Add", "AdSizeR"], + def_opersize_64=64, + opcode=[0xE0], + operands=[Operand(type="Imm", tmod="Short", dest="JmpRel")]) + + add_group("loop"+sfx, + not64=(sz == 16), + only64=(sz == 64), + def_opersize_64=64, + opcode=[], + operands=[Operand(type="Imm", dest="JmpRel"), + Operand(type="Creg", size=sz, dest="AdSizeR")]) + add_group("loop"+sfx, + not64=(sz == 16), + only64=(sz == 64), + modifiers=["Op0Add"], + def_opersize_64=64, + opcode=[0xE0], + operands=[Operand(type="Imm", tmod="Short", dest="JmpRel"), + Operand(type="Creg", size=sz, dest="AdSizeR")]) + + add_insn("loop"+sfx, "loop"+sfx, parser="gas", modifiers=[2, sz]) + add_insn("loopz"+sfx, "loop"+sfx, parser="gas", modifiers=[1, sz]) + add_insn("loope"+sfx, "loop"+sfx, parser="gas", modifiers=[1, sz]) + add_insn("loopnz"+sfx, "loop"+sfx, parser="gas", modifiers=[0, sz]) + add_insn("loopne"+sfx, "loop"+sfx, parser="gas", modifiers=[0, sz]) + ##################################################################### # Set byte on flag instructions ##################################################################### @@ -3091,10 +3262,10 @@ add_group("fldstpt", modifiers=["SpAdd"], opcode=[0xDB], spare=0, - operands=[Operand(type="Mem", size=80, dest="EA")]) + operands=[Operand(type="Mem", size=80, relaxed=True, dest="EA")]) -add_insn("fldt", "fldstpt", suffix="WEAK", modifiers=[5]) -add_insn("fstpt", "fldstpt", suffix="WEAK", modifiers=[7]) +add_insn("fldt", "fldstpt", modifiers=[5]) +add_insn("fstpt", "fldstpt", modifiers=[7]) add_group("fildstp", suffix="s", diff --git a/modules/arch/x86/tests/gas32/Makefile.inc b/modules/arch/x86/tests/gas32/Makefile.inc index 10329f1d..11fbe15c 100644 --- a/modules/arch/x86/tests/gas32/Makefile.inc +++ b/modules/arch/x86/tests/gas32/Makefile.inc @@ -7,8 +7,12 @@ EXTRA_DIST += modules/arch/x86/tests/gas32/align32.asm EXTRA_DIST += modules/arch/x86/tests/gas32/align32.hex EXTRA_DIST += modules/arch/x86/tests/gas32/gas-farithr.asm EXTRA_DIST += modules/arch/x86/tests/gas32/gas-farithr.hex +EXTRA_DIST += modules/arch/x86/tests/gas32/gas-farjump.asm +EXTRA_DIST += modules/arch/x86/tests/gas32/gas-farjump.hex EXTRA_DIST += modules/arch/x86/tests/gas32/gas-fpmem.asm EXTRA_DIST += modules/arch/x86/tests/gas32/gas-fpmem.hex +EXTRA_DIST += modules/arch/x86/tests/gas32/gas-loop32.asm +EXTRA_DIST += modules/arch/x86/tests/gas32/gas-loop32.hex EXTRA_DIST += modules/arch/x86/tests/gas32/gas-movdq32.asm EXTRA_DIST += modules/arch/x86/tests/gas32/gas-movdq32.hex EXTRA_DIST += modules/arch/x86/tests/gas32/gas-movsd.asm diff --git a/modules/arch/x86/tests/gas32/gas-farjump.asm b/modules/arch/x86/tests/gas32/gas-farjump.asm new file mode 100644 index 00000000..6d890da2 --- /dev/null +++ b/modules/arch/x86/tests/gas32/gas-farjump.asm @@ -0,0 +1,13 @@ +call $0x1234, $0x567890ab +lcall $0x1234, $0x567890ab +jmp $0x1234, $0x567890ab +ljmp $0x1234, $0x567890ab +ljmp *(%eax) +lcall *(%eax) +jmp *(%eax) +call *(%eax) +jmp *%eax +call *%eax +ret +lret +lret $0x100 diff --git a/modules/arch/x86/tests/gas32/gas-farjump.hex b/modules/arch/x86/tests/gas32/gas-farjump.hex new file mode 100644 index 00000000..839492d4 --- /dev/null +++ b/modules/arch/x86/tests/gas32/gas-farjump.hex @@ -0,0 +1,408 @@ +7f +45 +4c +46 +01 +01 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +03 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +d0 +00 +00 +00 +00 +00 +00 +00 +34 +00 +00 +00 +00 +00 +28 +00 +05 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +9a +ab +90 +78 +56 +34 +12 +9a +ab +90 +78 +56 +34 +12 +ea +ab +90 +78 +56 +34 +12 +ea +ab +90 +78 +56 +34 +12 +ff +28 +ff +18 +ff +20 +ff +10 +ff +e0 +ff +d0 +c3 +cb +ca +00 +01 +00 +00 +00 +00 +2e +74 +65 +78 +74 +00 +2e +73 +74 +72 +74 +61 +62 +00 +2e +73 +79 +6d +74 +61 +62 +00 +2e +73 +68 +73 +74 +72 +74 +61 +62 +00 +00 +00 +00 +00 +2d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +f1 +ff +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +17 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +70 +00 +00 +00 +21 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +07 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +94 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +0f +00 +00 +00 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +98 +00 +00 +00 +30 +00 +00 +00 +02 +00 +00 +00 +03 +00 +00 +00 +04 +00 +00 +00 +10 +00 +00 +00 +01 +00 +00 +00 +01 +00 +00 +00 +06 +00 +00 +00 +00 +00 +00 +00 +40 +00 +00 +00 +2d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 diff --git a/modules/arch/x86/tests/gas32/gas-loop32.asm b/modules/arch/x86/tests/gas32/gas-loop32.asm new file mode 100644 index 00000000..3b5777de --- /dev/null +++ b/modules/arch/x86/tests/gas32/gas-loop32.asm @@ -0,0 +1,5 @@ +loop label +loopw label +loopl label +#loopq label +label: diff --git a/modules/arch/x86/tests/gas32/gas-loop32.hex b/modules/arch/x86/tests/gas32/gas-loop32.hex new file mode 100644 index 00000000..5bf161bc --- /dev/null +++ b/modules/arch/x86/tests/gas32/gas-loop32.hex @@ -0,0 +1,376 @@ +7f +45 +4c +46 +01 +01 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +03 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +b0 +00 +00 +00 +00 +00 +00 +00 +34 +00 +00 +00 +00 +00 +28 +00 +05 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +e2 +05 +67 +e2 +02 +e2 +00 +00 +00 +2e +74 +65 +78 +74 +00 +2e +73 +74 +72 +74 +61 +62 +00 +2e +73 +79 +6d +74 +61 +62 +00 +2e +73 +68 +73 +74 +72 +74 +61 +62 +00 +00 +00 +00 +00 +2d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +f1 +ff +00 +00 +00 +00 +07 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +17 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +48 +00 +00 +00 +21 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +07 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +6c +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +0f +00 +00 +00 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +70 +00 +00 +00 +40 +00 +00 +00 +02 +00 +00 +00 +04 +00 +00 +00 +04 +00 +00 +00 +10 +00 +00 +00 +01 +00 +00 +00 +01 +00 +00 +00 +06 +00 +00 +00 +00 +00 +00 +00 +40 +00 +00 +00 +07 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 diff --git a/modules/arch/x86/tests/gas64/Makefile.inc b/modules/arch/x86/tests/gas64/Makefile.inc index ab6589aa..cfda8a56 100644 --- a/modules/arch/x86/tests/gas64/Makefile.inc +++ b/modules/arch/x86/tests/gas64/Makefile.inc @@ -11,6 +11,8 @@ EXTRA_DIST += modules/arch/x86/tests/gas64/gas-fp.asm EXTRA_DIST += modules/arch/x86/tests/gas64/gas-fp.hex EXTRA_DIST += modules/arch/x86/tests/gas64/gas-inout.asm EXTRA_DIST += modules/arch/x86/tests/gas64/gas-inout.hex +EXTRA_DIST += modules/arch/x86/tests/gas64/gas-loop64.asm +EXTRA_DIST += modules/arch/x86/tests/gas64/gas-loop64.hex EXTRA_DIST += modules/arch/x86/tests/gas64/gas-moreinsn.asm EXTRA_DIST += modules/arch/x86/tests/gas64/gas-moreinsn.hex EXTRA_DIST += modules/arch/x86/tests/gas64/gas-movabs.asm diff --git a/modules/arch/x86/tests/gas64/gas-loop64.asm b/modules/arch/x86/tests/gas64/gas-loop64.asm new file mode 100644 index 00000000..d441ad69 --- /dev/null +++ b/modules/arch/x86/tests/gas64/gas-loop64.asm @@ -0,0 +1,5 @@ +loop label +#loopw label +loopl label +loopq label +label: diff --git a/modules/arch/x86/tests/gas64/gas-loop64.hex b/modules/arch/x86/tests/gas64/gas-loop64.hex new file mode 100644 index 00000000..7c1e9246 --- /dev/null +++ b/modules/arch/x86/tests/gas64/gas-loop64.hex @@ -0,0 +1,528 @@ +7f +45 +4c +46 +02 +01 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +3e +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +d0 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +40 +00 +00 +00 +00 +00 +40 +00 +05 +00 +01 +00 +e2 +05 +67 +e2 +02 +e2 +00 +00 +00 +2e +74 +65 +78 +74 +00 +2e +73 +74 +72 +74 +61 +62 +00 +2e +73 +79 +6d +74 +61 +62 +00 +2e +73 +68 +73 +74 +72 +74 +61 +62 +00 +00 +00 +00 +00 +2d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +04 +00 +f1 +ff +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +07 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +17 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +48 +00 +00 +00 +00 +00 +00 +00 +21 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +07 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +6c +00 +00 +00 +00 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +0f +00 +00 +00 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +70 +00 +00 +00 +00 +00 +00 +00 +60 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +04 +00 +00 +00 +08 +00 +00 +00 +00 +00 +00 +00 +18 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +01 +00 +00 +00 +06 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +40 +00 +00 +00 +00 +00 +00 +00 +07 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 diff --git a/modules/arch/x86/x86id.c b/modules/arch/x86/x86id.c index 902b8475..c446d462 100644 --- a/modules/arch/x86/x86id.c +++ b/modules/arch/x86/x86id.c @@ -53,21 +53,18 @@ static const char *cpu_find_reverse(unsigned int cpu0, unsigned int cpu1, /* GAS suffix flags for instructions */ enum x86_gas_suffix_flags { - NONE = 0, - SUF_B = 1<<0, - SUF_W = 1<<1, - SUF_L = 1<<2, - SUF_Q = 1<<3, - SUF_S = 1<<4, - SUF_MASK = SUF_B|SUF_W|SUF_L|SUF_Q|SUF_S, + SUF_Z = 1<<0, /* no suffix */ + SUF_B = 1<<1, + SUF_W = 1<<2, + SUF_L = 1<<3, + SUF_Q = 1<<4, + SUF_S = 1<<5, + SUF_MASK = SUF_Z|SUF_B|SUF_W|SUF_L|SUF_Q|SUF_S, /* Flags only used in x86_insn_info */ - GAS_ONLY = 1<<5, /* Only available in GAS mode */ - GAS_ILLEGAL = 1<<6, /* Illegal in GAS mode */ - GAS_NO_REV = 1<<7, /* Don't reverse operands in GAS mode */ - - /* Flags only used in insnprefix_parse_data */ - WEAK = 1<<5 /* Relaxed operand mode for GAS */ + GAS_ONLY = 1<<6, /* Only available in GAS mode */ + GAS_ILLEGAL = 1<<7, /* Illegal in GAS mode */ + GAS_NO_REV = 1<<8 /* Don't reverse operands in GAS mode */ }; /* Miscellaneous flag tests for instructions */ @@ -233,10 +230,10 @@ typedef struct x86_info_operand { typedef struct x86_insn_info { /* GAS suffix flags */ - unsigned int gas_flags:8; /* Enabled for these GAS suffixes */ + unsigned int gas_flags:9; /* Enabled for these GAS suffixes */ /* Tests against BITS==64, AVX, and XOP */ - unsigned int misc_flags:6; + unsigned int misc_flags:5; /* The CPU feature flags needed to execute this instruction. This is OR'ed * with arch-specific data[2]. This combined value is compared with @@ -318,10 +315,10 @@ typedef struct x86_id_insn { unsigned int mode_bits:8; /* Suffix flags */ - unsigned int suffix:8; + unsigned int suffix:9; /* Tests against BITS==64 and AVX */ - unsigned int misc_flags:6; + unsigned int misc_flags:5; /* Parser enabled at the time of parsing the instruction */ unsigned int parser:2; @@ -385,9 +382,11 @@ x86_finalize_jmpfar(yasm_bytecode *bc, yasm_bytecode *prev_bc, const x86_insn_info *info) { x86_id_insn *id_insn = (x86_id_insn *)bc->contents; + unsigned char *mod_data = id_insn->mod_data; unsigned int mode_bits = id_insn->mode_bits; x86_jmpfar *jmpfar; yasm_insn_operand *op; + unsigned int i; jmpfar = yasm_xmalloc(sizeof(x86_jmpfar)); x86_finalize_common(&jmpfar->common, info, mode_bits); @@ -413,9 +412,44 @@ x86_finalize_jmpfar(yasm_bytecode *bc, yasm_bytecode *prev_bc, || yasm_value_finalize_expr(&jmpfar->segment, e, prev_bc, 16)) yasm_error_set(YASM_ERROR_TOO_COMPLEX, N_("jump target expression too complex")); + } else if (yasm_insn_op_next(op)) { + /* Two operand form (gas) */ + yasm_insn_operand *op2 = yasm_insn_op_next(op); + if (yasm_value_finalize_expr(&jmpfar->segment, op->data.val, prev_bc, + 16)) + yasm_error_set(YASM_ERROR_TOO_COMPLEX, + N_("jump target segment too complex")); + if (yasm_value_finalize_expr(&jmpfar->offset, op2->data.val, prev_bc, + 0)) + yasm_error_set(YASM_ERROR_TOO_COMPLEX, + N_("jump target offset too complex")); + if (op2->size == OPS_BITS) + jmpfar->common.opersize = (unsigned char)mode_bits; } else yasm_internal_error(N_("didn't get FAR expression in jmpfar")); + /* Apply modifiers */ + for (i=0; imodifiers); i++) { + switch (info->modifiers[i]) { + case MOD_Gap: + break; + case MOD_Op0Add: + jmpfar->opcode.opcode[0] += mod_data[i]; + break; + case MOD_Op1Add: + jmpfar->opcode.opcode[1] += mod_data[i]; + break; + case MOD_Op2Add: + jmpfar->opcode.opcode[2] += mod_data[i]; + break; + case MOD_Op1AddSp: + jmpfar->opcode.opcode[1] += mod_data[i]<<3; + break; + default: + break; + } + } + yasm_x86__bc_apply_prefixes((x86_common *)jmpfar, NULL, info->def_opersize_64, id_insn->insn.num_prefixes, @@ -605,7 +639,7 @@ x86_find_match(x86_id_insn *id_insn, yasm_insn_operand **ops, continue; /* Match suffix (if required) */ - if (suffix != 0 && suffix != WEAK + if (id_insn->parser == X86_PARSER_GAS && ((suffix & SUF_MASK) & (gas_flags & SUF_MASK)) == 0) continue; @@ -826,7 +860,7 @@ x86_find_match(x86_id_insn *id_insn, yasm_insn_operand **ops, /* Check operand size */ size = size_lookup[info_ops[i].size]; - if (suffix != 0) { + if (id_insn->parser == X86_PARSER_GAS) { /* Require relaxed operands for GAS mode (don't allow * per-operand sizing). */ @@ -868,7 +902,8 @@ x86_find_match(x86_id_insn *id_insn, yasm_insn_operand **ops, break; /* Check for 64-bit effective address size in NASM mode */ - if (suffix == 0 && op->type == YASM_INSN__OPERAND_MEMORY) { + if (id_insn->parser != X86_PARSER_GAS && + op->type == YASM_INSN__OPERAND_MEMORY) { if (info_ops[i].eas64) { if (op->data.ea->disp.size != 64) mismatch = 1; @@ -1850,7 +1885,7 @@ yasm_x86__create_empty_insn(yasm_arch *arch, unsigned long line) id_insn->mod_data[2] = 0; id_insn->num_info = NELEMS(empty_insn); id_insn->mode_bits = arch_x86->mode_bits; - id_insn->suffix = 0; + id_insn->suffix = (arch_x86->parser == X86_PARSER_GAS) ? SUF_Z : 0; id_insn->misc_flags = 0; id_insn->parser = arch_x86->parser; id_insn->force_strict = arch_x86->force_strict != 0; From c89b6619250fed006d8fe3ed7b7f04ab79f69a44 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 1 Dec 2009 03:33:03 +0000 Subject: [PATCH 294/585] Fix #198: Previous commit accidentally broke a great many instructions. svn path=/trunk/yasm/; revision=2239 --- modules/arch/x86/gen_x86_insn.py | 25 +- modules/arch/x86/tests/gas32/Makefile.inc | 2 + modules/arch/x86/tests/gas32/gas-invlpg.asm | 2 + modules/arch/x86/tests/gas32/gas-invlpg.hex | 360 ++++++++++++++++++++ 4 files changed, 373 insertions(+), 16 deletions(-) create mode 100644 modules/arch/x86/tests/gas32/gas-invlpg.asm create mode 100644 modules/arch/x86/tests/gas32/gas-invlpg.hex diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index eefd2ca8..50efbe99 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -540,31 +540,24 @@ def finalize_insns(): parsers &= insn.parsers if "gas" in parsers: + suffixes = set() if insn.suffix is None: - suffixes = set() for form in group: if form.gen_suffix and form.suffixes is not None: suffixes |= form.suffixes - for suffix in suffixes: - if suffix == "Z": - keyword = name - else: - keyword = name+suffix - if keyword in gas_insns: - raise ValueError("duplicate gas instruction %s" % - keyword) - newinsn = insn.copy() - newinsn.suffix = suffix - newinsn.auto_cpu("gas") - newinsn.auto_misc_flags("gas") - gas_insns[keyword] = newinsn - else: - keyword = name + if not suffixes: + suffixes.add("Z") + for suffix in suffixes: + if suffix == "Z": + keyword = name + else: + keyword = name+suffix if keyword in gas_insns: raise ValueError("duplicate gas instruction %s" % keyword) newinsn = insn.copy() + newinsn.suffix = suffix newinsn.auto_cpu("gas") newinsn.auto_misc_flags("gas") gas_insns[keyword] = newinsn diff --git a/modules/arch/x86/tests/gas32/Makefile.inc b/modules/arch/x86/tests/gas32/Makefile.inc index 11fbe15c..282cf75f 100644 --- a/modules/arch/x86/tests/gas32/Makefile.inc +++ b/modules/arch/x86/tests/gas32/Makefile.inc @@ -11,6 +11,8 @@ EXTRA_DIST += modules/arch/x86/tests/gas32/gas-farjump.asm EXTRA_DIST += modules/arch/x86/tests/gas32/gas-farjump.hex EXTRA_DIST += modules/arch/x86/tests/gas32/gas-fpmem.asm EXTRA_DIST += modules/arch/x86/tests/gas32/gas-fpmem.hex +EXTRA_DIST += modules/arch/x86/tests/gas32/gas-invlpg.asm +EXTRA_DIST += modules/arch/x86/tests/gas32/gas-invlpg.hex EXTRA_DIST += modules/arch/x86/tests/gas32/gas-loop32.asm EXTRA_DIST += modules/arch/x86/tests/gas32/gas-loop32.hex EXTRA_DIST += modules/arch/x86/tests/gas32/gas-movdq32.asm diff --git a/modules/arch/x86/tests/gas32/gas-invlpg.asm b/modules/arch/x86/tests/gas32/gas-invlpg.asm new file mode 100644 index 00000000..f7d6faa9 --- /dev/null +++ b/modules/arch/x86/tests/gas32/gas-invlpg.asm @@ -0,0 +1,2 @@ +invlpg (%eax) + diff --git a/modules/arch/x86/tests/gas32/gas-invlpg.hex b/modules/arch/x86/tests/gas32/gas-invlpg.hex new file mode 100644 index 00000000..c40e0506 --- /dev/null +++ b/modules/arch/x86/tests/gas32/gas-invlpg.hex @@ -0,0 +1,360 @@ +7f +45 +4c +46 +01 +01 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +03 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +a0 +00 +00 +00 +00 +00 +00 +00 +34 +00 +00 +00 +00 +00 +28 +00 +05 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +0f +01 +38 +00 +00 +2e +74 +65 +78 +74 +00 +2e +73 +74 +72 +74 +61 +62 +00 +2e +73 +79 +6d +74 +61 +62 +00 +2e +73 +68 +73 +74 +72 +74 +61 +62 +00 +00 +00 +00 +00 +2d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +f1 +ff +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +17 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +44 +00 +00 +00 +21 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +07 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +68 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +0f +00 +00 +00 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +6c +00 +00 +00 +30 +00 +00 +00 +02 +00 +00 +00 +03 +00 +00 +00 +04 +00 +00 +00 +10 +00 +00 +00 +01 +00 +00 +00 +01 +00 +00 +00 +06 +00 +00 +00 +00 +00 +00 +00 +40 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 From abef3a711daba7936f5b812625bb08a9e5399885 Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Sat, 5 Dec 2009 16:13:05 +0000 Subject: [PATCH 295/585] Update gen_x86_insn.py to work in both Python 2 and 3 svn path=/trunk/yasm/; revision=2240 --- Mkfiles/vc9/modules/modules.vcproj | 4 +++ modules/arch/x86/gen_x86_insn.py | 58 +++++++++++++++++------------- 2 files changed, 37 insertions(+), 25 deletions(-) diff --git a/Mkfiles/vc9/modules/modules.vcproj b/Mkfiles/vc9/modules/modules.vcproj index 62db9028..77d9ab49 100644 --- a/Mkfiles/vc9/modules/modules.vcproj +++ b/Mkfiles/vc9/modules/modules.vcproj @@ -327,6 +327,10 @@ Name="Source Files" Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" > + + diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index 50efbe99..b7d6428a 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -25,6 +25,9 @@ # POSSIBILITY OF SUCH DAMAGE. # # NOTE: operands are arranged in NASM / Intel order (e.g. dest, src) + +from sys import stdout, version_info + rcstag = "$Id$" try: scriptname = rcstag.split()[1] @@ -56,6 +59,9 @@ XOPL0 = 0x80 XOPL1 = 0x84 XOPpp = 0x80 # OR with value +def lprint(s, f = stdout, e = '\n') : + f.write(s + e) + def cpu_lcd(cpu1, cpu2): """Find the lowest common denominator of two CPU sets.""" retval = set() @@ -112,7 +118,7 @@ class Operand(object): if kwargs: for arg in kwargs: - print "Warning: unrecognized arg %s" % arg + lprint("Warning: unrecognized arg %s" % arg) def __str__(self): return "{"+ ", ".join(["OPT_%s" % self.type, @@ -303,7 +309,7 @@ class GroupForm(object): if kwargs: for arg in kwargs: - print "Warning: unrecognized arg %s" % arg + lprint("Warning: unrecognized arg %s" % arg) def __str__(self): if hasattr(self, "opcode"): @@ -528,8 +534,8 @@ def add_prefix(name, groupname, value, parser=None, **kwargs): def finalize_insns(): unused_groups = set(groups.keys()) - for name, opts in insns.iteritems(): - for insn in opts: + for name in insns: + for insn in insns[name]: group = groups[insn.groupname] unused_groups.discard(insn.groupname) @@ -574,12 +580,12 @@ def finalize_insns(): unused_groups.discard("empty") unused_groups.discard("not64") if unused_groups: - print "warning: unused groups: %s" % ", ".join(unused_groups) + lprint("warning: unused groups: %s" % ", ".join(unused_groups)) def output_insns(f, parser, insns): - print >>f, "/* Generated by %s r%s, do not edit */" % \ - (scriptname, scriptrev) - print >>f, """%%ignore-case + lprint("/* Generated by %s r%s, do not edit */" % \ + (scriptname, scriptrev), f) + lprint("""%%ignore-case %%language=ANSI-C %%compare-strncmp %%readonly-tables @@ -588,9 +594,9 @@ def output_insns(f, parser, insns): %%define hash-function-name insnprefix_%s_hash %%define lookup-function-name insnprefix_%s_find struct insnprefix_parse_data; -%%%%""" % (parser, parser) +%%%%""" % (parser, parser), f) for keyword in sorted(insns): - print >>f, "%s,\t%s" % (keyword.lower(), insns[keyword]) + lprint("%s,\t%s" % (keyword.lower(), insns[keyword]), f) def output_gas_insns(f): output_insns(f, "gas", gas_insns) @@ -602,10 +608,11 @@ def output_groups(f): # Merge all operand lists into single list # Sort by number of operands to shorten output all_operands = [] - for form in sorted((form for g in groups.itervalues() for form in g), + gi = groups.itervalues() if version_info[0] == 2 else groups.values() + for form in sorted((form for g in gi for form in g), key=lambda x:len(x.operands), reverse=True): num_operands = len(form.operands) - for i in xrange(len(all_operands)): + for i in range(len(all_operands)): if all_operands[i:i+num_operands] == form.operands: form.all_operands_index = i break @@ -614,12 +621,12 @@ def output_groups(f): all_operands.extend(form.operands) # Output operands list - print >>f, "/* Generated by %s r%s, do not edit */" % \ - (scriptname, scriptrev) - print >>f, "static const x86_info_operand insn_operands[] = {" - print >>f, " ", - print >>f, ",\n ".join(str(x) for x in all_operands) - print >>f, "};\n" + lprint("/* Generated by %s r%s, do not edit */" % \ + (scriptname, scriptrev), f) + lprint("static const x86_info_operand insn_operands[] = {", f) + lprint(" ", f, '') + lprint(",\n ".join(str(x) for x in all_operands), f) + lprint("};\n", f) # Output groups seen = set() @@ -627,10 +634,10 @@ def output_groups(f): if name in seen: continue seen.add(name) - print >>f, "static const x86_insn_info %s_insn[] = {" % name - print >>f, " ", - print >>f, ",\n ".join(str(x) for x in groups[name]) - print >>f, "};\n" + lprint("static const x86_insn_info %s_insn[] = {" % name, f) + lprint(" ", f, '') + lprint(",\n ".join(str(x) for x in groups[name]), f) + lprint("};\n", f) ##################################################################### # General instruction groupings @@ -7518,6 +7525,7 @@ for val, suf in enumerate(["", "z", "y", "yz", "x", "xz", "xy", "xyz"]): # Output generation ##################################################################### -output_groups(file("x86insns.c", "wt")) -output_gas_insns(file("x86insn_gas.gperf", "wt")) -output_nasm_insns(file("x86insn_nasm.gperf", "wt")) +output_groups(open("x86insns.c", "wt")) +output_gas_insns(open("x86insn_gas.gperf", "wt")) +output_nasm_insns(open("x86insn_nasm.gperf", "wt")) + From 4db0d17f641f8f0f8d14473e1aa2e2c603a68c6b Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Sat, 5 Dec 2009 16:33:12 +0000 Subject: [PATCH 296/585] Add files for building YASM with Visual Studio 2010 (beta 2) svn path=/trunk/yasm/; revision=2241 --- Mkfiles/vc10/config.h | 177 +++++++++++ Mkfiles/vc10/crt_secure_no_deprecate.props | 11 + Mkfiles/vc10/crt_secure_no_deprecate.vsprops | 11 + Mkfiles/vc10/genmacro/genmacro.vcxproj | 119 ++++++++ .../vc10/genmacro/genmacro.vcxproj.filters | 17 ++ Mkfiles/vc10/genmacro/run.bat | 5 + Mkfiles/vc10/genmodule/genmodule.vcxproj | 117 ++++++++ .../vc10/genmodule/genmodule.vcxproj.filters | 17 ++ Mkfiles/vc10/genmodule/run.bat | 3 + Mkfiles/vc10/genperf/genperf.vcxproj | 123 ++++++++ Mkfiles/vc10/genperf/genperf.vcxproj.filters | 41 +++ Mkfiles/vc10/genperf/run.bat | 21 ++ Mkfiles/vc10/genstring/genstring.vcxproj | 113 +++++++ .../vc10/genstring/genstring.vcxproj.filters | 17 ++ Mkfiles/vc10/genstring/run.bat | 2 + Mkfiles/vc10/genversion/genversion.vcxproj | 118 ++++++++ .../genversion/genversion.vcxproj.filters | 26 ++ Mkfiles/vc10/genversion/run.bat | 2 + Mkfiles/vc10/libyasm-stdint.h | 8 + Mkfiles/vc10/libyasm/libyasm.vcxproj | 269 +++++++++++++++++ Mkfiles/vc10/libyasm/libyasm.vcxproj.filters | 194 ++++++++++++ Mkfiles/vc10/modules/modules.vcxproj | 283 ++++++++++++++++++ Mkfiles/vc10/modules/modules.vcxproj.filters | 208 +++++++++++++ Mkfiles/vc10/re2c/re2c.vcxproj | 135 +++++++++ Mkfiles/vc10/re2c/re2c.vcxproj.filters | 77 +++++ Mkfiles/vc10/re2c/run.bat | 4 + Mkfiles/vc10/readme.vc10.txt | 98 ++++++ Mkfiles/vc10/yasm.props | 24 ++ Mkfiles/vc10/yasm.sln | 121 ++++++++ Mkfiles/vc10/yasm.targets | 91 ++++++ Mkfiles/vc10/yasm.vcxproj | 271 +++++++++++++++++ Mkfiles/vc10/yasm.vcxproj.filters | 26 ++ Mkfiles/vc10/yasm.xml | 209 +++++++++++++ Mkfiles/vc10/ytasm.vcxproj | 267 +++++++++++++++++ 34 files changed, 3225 insertions(+) create mode 100644 Mkfiles/vc10/config.h create mode 100644 Mkfiles/vc10/crt_secure_no_deprecate.props create mode 100644 Mkfiles/vc10/crt_secure_no_deprecate.vsprops create mode 100644 Mkfiles/vc10/genmacro/genmacro.vcxproj create mode 100644 Mkfiles/vc10/genmacro/genmacro.vcxproj.filters create mode 100644 Mkfiles/vc10/genmacro/run.bat create mode 100644 Mkfiles/vc10/genmodule/genmodule.vcxproj create mode 100644 Mkfiles/vc10/genmodule/genmodule.vcxproj.filters create mode 100644 Mkfiles/vc10/genmodule/run.bat create mode 100644 Mkfiles/vc10/genperf/genperf.vcxproj create mode 100644 Mkfiles/vc10/genperf/genperf.vcxproj.filters create mode 100644 Mkfiles/vc10/genperf/run.bat create mode 100644 Mkfiles/vc10/genstring/genstring.vcxproj create mode 100644 Mkfiles/vc10/genstring/genstring.vcxproj.filters create mode 100644 Mkfiles/vc10/genstring/run.bat create mode 100644 Mkfiles/vc10/genversion/genversion.vcxproj create mode 100644 Mkfiles/vc10/genversion/genversion.vcxproj.filters create mode 100644 Mkfiles/vc10/genversion/run.bat create mode 100644 Mkfiles/vc10/libyasm-stdint.h create mode 100644 Mkfiles/vc10/libyasm/libyasm.vcxproj create mode 100644 Mkfiles/vc10/libyasm/libyasm.vcxproj.filters create mode 100644 Mkfiles/vc10/modules/modules.vcxproj create mode 100644 Mkfiles/vc10/modules/modules.vcxproj.filters create mode 100644 Mkfiles/vc10/re2c/re2c.vcxproj create mode 100644 Mkfiles/vc10/re2c/re2c.vcxproj.filters create mode 100644 Mkfiles/vc10/re2c/run.bat create mode 100644 Mkfiles/vc10/readme.vc10.txt create mode 100644 Mkfiles/vc10/yasm.props create mode 100644 Mkfiles/vc10/yasm.sln create mode 100644 Mkfiles/vc10/yasm.targets create mode 100644 Mkfiles/vc10/yasm.vcxproj create mode 100644 Mkfiles/vc10/yasm.vcxproj.filters create mode 100644 Mkfiles/vc10/yasm.xml create mode 100644 Mkfiles/vc10/ytasm.vcxproj diff --git a/Mkfiles/vc10/config.h b/Mkfiles/vc10/config.h new file mode 100644 index 00000000..96e2dddc --- /dev/null +++ b/Mkfiles/vc10/config.h @@ -0,0 +1,177 @@ +/* $Id: config.h 1137 2004-09-04 01:24:57Z peter $ */ + +#define yasm__splitpath(path, tail) yasm__splitpath_win(path, tail) +#define yasm__abspath(path) yasm__abspath_win(path) +#define yasm__combpath(from, to) yasm__combpath_win(from, to) + +/* Command name to run C preprocessor */ +#define CPP_PROG "cpp" + +/* */ +/* #undef ENABLE_NLS */ + +/* Define if you have the `abort' function. */ +#define HAVE_ABORT 1 + +/* */ +/* #undef HAVE_CATGETS */ + +/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYCURRENT */ + +/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +/* #undef HAVE_DCGETTEXT */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DIRECT_H 1 + +/* Define to 1 if you have the `getcwd' function. */ +#define HAVE_GETCWD 1 + +/* */ +/* #undef HAVE_GETTEXT */ + +/* Define if you have the GNU C Library */ +/* #undef HAVE_GNU_C_LIBRARY */ + +/* Define if you have the iconv() function. */ +/* #undef HAVE_ICONV */ + +/* Define if you have the header file. */ +/* #undef HAVE_INTTYPES_H */ + +/* */ +/* #undef HAVE_LC_MESSAGES */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LIBGEN_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_MEMORY_H */ + +/* Define if you have the `mergesort' function. */ +/* #undef HAVE_MERGESORT */ + +/* Define to 1 if you have the `popen' function. */ +/* #undef HAVE_POPEN */ + +/* Define if you have the header file. */ +/* #undef HAVE_STDINT_H */ + +/* Define if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* */ +/* #undef HAVE_STPCPY */ + +/* Define if you have the `strcasecmp' function. */ +/* #undef HAVE_STRCASECMP */ + +/* Define if you have the `strcmpi' function. */ +/* #undef HAVE_STRCMPI */ + +/* Define if you have the `stricmp' function. */ +/* #undefine HAVE_STRICMP */ + +/* Define if you have the header file. */ +/* #undef HAVE_STRINGS_H */ + +/* Define if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define if you have the `strncasecmp' function. */ +/* #undef HAVE_STRNCASECMP */ + +/* Define if you have the `strsep' function. */ +/* #undef HAVE_STRSEP */ + +/* Define if you have the header file. */ +/* #undef HAVE_SYS_STAT_H */ + +/* Define if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define if you have the `toascii' function. */ +#define HAVE_TOASCII 1 +#define toascii __toascii + +/* Define if you have the header file. */ +/* #undef HAVE_UNISTD_H */ + +/* Define to 1 if you have the `vsnprintf' function. */ +/* #undef HAVE_VSNPRINTF */ + +/* Define to 1 if you have the `_stricmp' function. */ +#define HAVE__STRICMP 1 + +/* Name of package */ +#define PACKAGE "yasm" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "bug-yasm@tortall.net" + +/* Define to build version of this package. */ +#define PACKAGE_BUILD "HEAD" + +/* Define to internal version of this package. */ +#define PACKAGE_INTVER "0.7.99" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "yasm" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "yasm HEAD" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "yasm" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "HEAD" + +/* Define if the C compiler supports function prototypes. */ +#define PROTOTYPES 1 + +/* The size of a `char', as computed by sizeof. */ +/* #undef SIZEOF_CHAR */ + +/* The size of a `int', as computed by sizeof. */ +/* #undef SIZEOF_INT */ + +/* The size of a `long', as computed by sizeof. */ +/* #undef SIZEOF_LONG */ + +/* The size of a `short', as computed by sizeof. */ +/* #undef SIZEOF_SHORT */ + +/* The size of a `void*', as computed by sizeof. */ +/* #undef SIZEOF_VOIDP */ + +/* Define if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Version number of package */ +#define VERSION "HEAD" + +/* Define if using the dmalloc debugging malloc package */ +/* #undef WITH_DMALLOC */ + +/* Define like PROTOTYPES; this can be used by system headers. */ +#define __PROTOTYPES 1 + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define as `__inline' if that's what the C compiler calls it, or to nothing + if it is not supported. */ +#ifndef __cplusplus +/* #undef inline */ +#endif + +/* Define to `unsigned' if doesn't define. */ +/* #undef size_t */ diff --git a/Mkfiles/vc10/crt_secure_no_deprecate.props b/Mkfiles/vc10/crt_secure_no_deprecate.props new file mode 100644 index 00000000..16e9f0d0 --- /dev/null +++ b/Mkfiles/vc10/crt_secure_no_deprecate.props @@ -0,0 +1,11 @@ + + + + <_ProjectFileVersion>10.0.21006.1 + + + + _CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + + + \ No newline at end of file diff --git a/Mkfiles/vc10/crt_secure_no_deprecate.vsprops b/Mkfiles/vc10/crt_secure_no_deprecate.vsprops new file mode 100644 index 00000000..d61ba30a --- /dev/null +++ b/Mkfiles/vc10/crt_secure_no_deprecate.vsprops @@ -0,0 +1,11 @@ + + + + diff --git a/Mkfiles/vc10/genmacro/genmacro.vcxproj b/Mkfiles/vc10/genmacro/genmacro.vcxproj new file mode 100644 index 00000000..6da0bbec --- /dev/null +++ b/Mkfiles/vc10/genmacro/genmacro.vcxproj @@ -0,0 +1,119 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {225700A5-07B8-434E-AD61-555278BF6733} + genmacro + Win32Proj + + + + Application + MultiByte + + + Application + MultiByte + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + + + + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + EditAndContinue + Default + + + $(OutDir)genmacro.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + + + Full + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genmacro.exe + false + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + + + + + + + + + {b545983b-8ee0-4a7b-a67a-e749eeae62a2} + false + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc10/genmacro/genmacro.vcxproj.filters b/Mkfiles/vc10/genmacro/genmacro.vcxproj.filters new file mode 100644 index 00000000..b9d110e6 --- /dev/null +++ b/Mkfiles/vc10/genmacro/genmacro.vcxproj.filters @@ -0,0 +1,17 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Source Files + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc10/genmacro/run.bat b/Mkfiles/vc10/genmacro/run.bat new file mode 100644 index 00000000..d2fbb98c --- /dev/null +++ b/Mkfiles/vc10/genmacro/run.bat @@ -0,0 +1,5 @@ +cd ..\..\.. +%1 nasm-version.c nasm_version_mac version.mac +%1 nasm-macros.c nasm_standard_mac modules\parsers\nasm\nasm-std.mac +%1 win64-nasm.c win64_nasm_stdmac modules\objfmts\coff\win64-nasm.mac +%1 win64-gas.c win64_gas_stdmac modules\objfmts\coff\win64-gas.mac diff --git a/Mkfiles/vc10/genmodule/genmodule.vcxproj b/Mkfiles/vc10/genmodule/genmodule.vcxproj new file mode 100644 index 00000000..4b2ae292 --- /dev/null +++ b/Mkfiles/vc10/genmodule/genmodule.vcxproj @@ -0,0 +1,117 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0} + genmodule + Win32Proj + + + + Application + MultiByte + + + Application + MultiByte + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + + + + Disabled + %(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;FILTERMODE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + $(IntDir) + Level3 + EditAndContinue + Default + + + $(OutDir)genmodule.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + + + Full + %(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;FILTERMODE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genmodule.exe + false + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc10/genmodule/genmodule.vcxproj.filters b/Mkfiles/vc10/genmodule/genmodule.vcxproj.filters new file mode 100644 index 00000000..85bdf9fe --- /dev/null +++ b/Mkfiles/vc10/genmodule/genmodule.vcxproj.filters @@ -0,0 +1,17 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Source Files + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc10/genmodule/run.bat b/Mkfiles/vc10/genmodule/run.bat new file mode 100644 index 00000000..e34a4169 --- /dev/null +++ b/Mkfiles/vc10/genmodule/run.bat @@ -0,0 +1,3 @@ +@echo off +cd ..\..\.. +%1 libyasm\module.in Makefile.am diff --git a/Mkfiles/vc10/genperf/genperf.vcxproj b/Mkfiles/vc10/genperf/genperf.vcxproj new file mode 100644 index 00000000..f3550e30 --- /dev/null +++ b/Mkfiles/vc10/genperf/genperf.vcxproj @@ -0,0 +1,123 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619} + genperf + Win32Proj + + + + Application + MultiByte + + + Application + MultiByte + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + + + + Disabled + ..;../../..;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;STDC_HEADERS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + EditAndContinue + Default + + + $(OutDir)genperf.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + + + Full + ..;../../..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;STDC_HEADERS;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genperf.exe + false + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc10/genperf/genperf.vcxproj.filters b/Mkfiles/vc10/genperf/genperf.vcxproj.filters new file mode 100644 index 00000000..40029ebc --- /dev/null +++ b/Mkfiles/vc10/genperf/genperf.vcxproj.filters @@ -0,0 +1,41 @@ + + + + + {3C1E9AA8-6338-4CED-99F1-BEBA80607BD5} + h;hpp;hxx;hm;inl;inc;xsd + + + {1062695D-1C50-4068-8313-73A409885BC1} + cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc10/genperf/run.bat b/Mkfiles/vc10/genperf/run.bat new file mode 100644 index 00000000..08639737 --- /dev/null +++ b/Mkfiles/vc10/genperf/run.bat @@ -0,0 +1,21 @@ +cd ..\..\.. +@echo off +for /f "usebackq tokens=2,3,4" %%f in (`reg query HKCR\Python.File\shell\open\command`) do (if %%f==REG_SZ echo %%g %%h >run_py.bat) +goto answer%errorlevel% +:answer0 +if not exist run_py.bat goto answer1 +echo ... building with Python ... +@echo on +call run_py.bat modules\arch\x86\gen_x86_insn.23.py +del run_py.bat +@echo off +goto end +:answer1 +echo ... building without Python ... +goto end +:end +@echo on +%1 x86insn_nasm.gperf x86insn_nasm.c +%1 x86insn_gas.gperf x86insn_gas.c +%1 modules\arch\x86\x86cpu.gperf x86cpu.c +%1 modules\arch\x86\x86regtmod.gperf x86regtmod.c diff --git a/Mkfiles/vc10/genstring/genstring.vcxproj b/Mkfiles/vc10/genstring/genstring.vcxproj new file mode 100644 index 00000000..b77920c7 --- /dev/null +++ b/Mkfiles/vc10/genstring/genstring.vcxproj @@ -0,0 +1,113 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {021CEB0A-F721-4F59-B349-9CEEAF244459} + genstring + Win32Proj + + + + Application + MultiByte + + + Application + MultiByte + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + + + + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + EditAndContinue + Default + + + $(OutDir)genstring.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + + + Full + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genstring.exe + false + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc10/genstring/genstring.vcxproj.filters b/Mkfiles/vc10/genstring/genstring.vcxproj.filters new file mode 100644 index 00000000..4ec3efa3 --- /dev/null +++ b/Mkfiles/vc10/genstring/genstring.vcxproj.filters @@ -0,0 +1,17 @@ + + + + + {28EBE11C-5BE8-4935-9381-F57696749E0C} + cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Source Files + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc10/genstring/run.bat b/Mkfiles/vc10/genstring/run.bat new file mode 100644 index 00000000..5864b1dc --- /dev/null +++ b/Mkfiles/vc10/genstring/run.bat @@ -0,0 +1,2 @@ +cd ..\..\.. +%1 license_msg license.c COPYING diff --git a/Mkfiles/vc10/genversion/genversion.vcxproj b/Mkfiles/vc10/genversion/genversion.vcxproj new file mode 100644 index 00000000..c5152eb9 --- /dev/null +++ b/Mkfiles/vc10/genversion/genversion.vcxproj @@ -0,0 +1,118 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2} + genversion + Win32Proj + + + + Application + MultiByte + + + Application + MultiByte + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + + + + Disabled + ..\..\vc9;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + EditAndContinue + Default + + + $(OutDir)genversion.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + + + Full + ..\..\vc9;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genversion.exe + false + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc10/genversion/genversion.vcxproj.filters b/Mkfiles/vc10/genversion/genversion.vcxproj.filters new file mode 100644 index 00000000..a5fd059a --- /dev/null +++ b/Mkfiles/vc10/genversion/genversion.vcxproj.filters @@ -0,0 +1,26 @@ + + + + + {2acbec3a-0ed8-4b2e-826e-a84c7d35f205} + h;hpp;hxx;hm;inl + + + {E67ED277-E4F2-4D79-8C9E-962BAC164F3F} + cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Source Files + + + + + Header Files + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc10/genversion/run.bat b/Mkfiles/vc10/genversion/run.bat new file mode 100644 index 00000000..30edf8f1 --- /dev/null +++ b/Mkfiles/vc10/genversion/run.bat @@ -0,0 +1,2 @@ +cd ..\..\.. +%1 version.mac diff --git a/Mkfiles/vc10/libyasm-stdint.h b/Mkfiles/vc10/libyasm-stdint.h new file mode 100644 index 00000000..fed61b33 --- /dev/null +++ b/Mkfiles/vc10/libyasm-stdint.h @@ -0,0 +1,8 @@ +#ifndef _UINTPTR_T_DEFINED +#ifdef _WIN64 +#include +#else +typedef unsigned long uintptr_t; +#endif +#define _UINTPTR_T_DEFINED +#endif diff --git a/Mkfiles/vc10/libyasm/libyasm.vcxproj b/Mkfiles/vc10/libyasm/libyasm.vcxproj new file mode 100644 index 00000000..cd90e236 --- /dev/null +++ b/Mkfiles/vc10/libyasm/libyasm.vcxproj @@ -0,0 +1,269 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {29FE7874-1256-4AD6-B889-68E399DC9608} + libyasm + + + + StaticLibrary + false + MultiByte + + + StaticLibrary + false + MultiByte + + + StaticLibrary + false + MultiByte + + + StaticLibrary + false + MultiByte + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + + + + Full + Default + ..;../../..;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)libyasm.lib + true + + + + + X64 + + + Full + Default + ..;../../..;%(AdditionalIncludeDirectories) + NDEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)libyasm.lib + true + + + + + Disabled + ..;../../..;%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + EditAndContinue + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)libyasm.lib + true + + + + + X64 + + + Disabled + ..;../../..;%(AdditionalIncludeDirectories) + _DEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)libyasm.lib + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {f0e8b707-00c5-4ff2-b8ef-7c39817132a0} + false + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc10/libyasm/libyasm.vcxproj.filters b/Mkfiles/vc10/libyasm/libyasm.vcxproj.filters new file mode 100644 index 00000000..aaad93d7 --- /dev/null +++ b/Mkfiles/vc10/libyasm/libyasm.vcxproj.filters @@ -0,0 +1,194 @@ + + + + + {4ca3b698-9d01-4e4e-ae00-5c98da045efe} + h;hpp;hxx;hm;inl + + + {68607062-982d-4251-9a1a-30f76474983d} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Source Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc10/modules/modules.vcxproj b/Mkfiles/vc10/modules/modules.vcxproj new file mode 100644 index 00000000..1d8abe42 --- /dev/null +++ b/Mkfiles/vc10/modules/modules.vcxproj @@ -0,0 +1,283 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6} + modules + + + + StaticLibrary + false + MultiByte + + + StaticLibrary + false + MultiByte + + + StaticLibrary + false + MultiByte + + + StaticLibrary + false + MultiByte + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + + + + Full + Default + ..;../../..;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)modules.lib + true + + + + + + + + + X64 + + + Full + Default + ..;../../..;%(AdditionalIncludeDirectories) + NDEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)modules.lib + true + + + + + Disabled + ..;../../..;%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + EditAndContinue + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)modules.lib + true + + + + + X64 + + + Disabled + ..;../../..;%(AdditionalIncludeDirectories) + _DEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)modules.lib + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {225700a5-07b8-434e-ad61-555278bf6733} + false + + + {c45a8b59-8b59-4d5d-a8e8-fb090f8dd619} + false + + + {29fe7874-1256-4ad6-b889-68e399dc9608} + false + + + {3c58be13-50a3-4583-984d-d8902b3d7713} + false + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc10/modules/modules.vcxproj.filters b/Mkfiles/vc10/modules/modules.vcxproj.filters new file mode 100644 index 00000000..f85c74be --- /dev/null +++ b/Mkfiles/vc10/modules/modules.vcxproj.filters @@ -0,0 +1,208 @@ + + + + + {39c89f91-d860-4396-a49f-86b8b7a51c33} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {be0cdf28-cbed-4774-b3cc-b63e4e3fa0a9} + + + {491cc60a-889b-4f53-aae9-f4d7d6aa667a} + + + {c084015d-3c3e-4379-8746-ae5cffcec79e} + + + {3333e0b3-e95f-44f6-9000-58d4da368360} + + + {528f2955-ceba-4691-a36c-054f119e3dcc} + + + {81686d52-eb71-4d4a-a830-66c45afb808f} + + + {98fe1e43-3794-4639-bf29-14b0c569754f} + + + {6b3956d4-0bff-4e8e-af61-a7e59b476fa4} + + + {33fb7fc8-61f9-428d-9c94-7a4912fbb678} + + + {48fc77ec-7d78-4c0a-bfc2-9aa76faf5d7f} + + + + + Source Files\parsers + + + Source Files\arch + + + Source Files\arch + + + Source Files\arch + + + Source Files\arch + + + Source Files\arch + + + Source Files\arch + + + Source Files\arch + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\listfmts\nasm + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\parsers + + + Source Files\parsers + + + Source Files\parsers + + + Source Files\parsers + + + Source Files\preprocs\cpp + + + Source Files\preprocs\nasm + + + Source Files\preprocs\nasm + + + Source Files\preprocs\nasm + + + Source Files\preprocs\nasm + + + Source Files\preprocs\raw + + + Source Files\parsers + + + Source Files\arch + + + Source Files\arch + + + + + Source Files\arch + + + Source Files\arch + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\parsers + + + Source Files\parsers + + + Source Files\preprocs\nasm + + + Source Files\preprocs\nasm + + + Source Files\preprocs\nasm + + + Source Files\preprocs\nasm + + + \ No newline at end of file diff --git a/Mkfiles/vc10/re2c/re2c.vcxproj b/Mkfiles/vc10/re2c/re2c.vcxproj new file mode 100644 index 00000000..e7d57010 --- /dev/null +++ b/Mkfiles/vc10/re2c/re2c.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {3C58BE13-50A3-4583-984D-D8902B3D7713} + re2c + Win32Proj + + + + Application + MultiByte + + + Application + MultiByte + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + + + + Disabled + ..;../../..;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + EditAndContinue + Default + + + $(OutDir)re2c.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + + + Full + ..;../../..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)re2c.exe + false + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc10/re2c/re2c.vcxproj.filters b/Mkfiles/vc10/re2c/re2c.vcxproj.filters new file mode 100644 index 00000000..9416e71d --- /dev/null +++ b/Mkfiles/vc10/re2c/re2c.vcxproj.filters @@ -0,0 +1,77 @@ + + + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc10/re2c/run.bat b/Mkfiles/vc10/re2c/run.bat new file mode 100644 index 00000000..cde2a7b6 --- /dev/null +++ b/Mkfiles/vc10/re2c/run.bat @@ -0,0 +1,4 @@ +cd ..\..\..\ +%1 -s -o lc3bid.c modules\arch\lc3b\lc3bid.re +%1 -b -o nasm-token.c modules\parsers\nasm\nasm-token.re +%1 -b -o gas-token.c modules\parsers\gas\gas-token.re diff --git a/Mkfiles/vc10/readme.vc10.txt b/Mkfiles/vc10/readme.vc10.txt new file mode 100644 index 00000000..497495d3 --- /dev/null +++ b/Mkfiles/vc10/readme.vc10.txt @@ -0,0 +1,98 @@ +Building YASM with Microsoft Visual Studio 2010 (C/C++ v10) +----------------------------------------------------------- + +This note describes how to build YASM using Microsoft Visual +Studio 2010 (C/C++ v10 - currently releasxed as beta 2). + +1. The Compiler +--------------- + +If you want to build the 64-bit version of YASM you will need +to install the Visual Studio 2010 64-bit tools, which may not +be installed by default. If using Visual C++ Express 2010, +you will need to install the Windows SDK to obtain the 64-bit +build tools. + +2. YASM Download +---------------- + +First YASM needs to be downloaded and the files placed within +a suitable directory, which will be called here but can +be named and located as you wish. + +3. Building YASM with Microsoft 2010 (VC10) +------------------------------------------- + +Now locate and double click on the yasm.sln solution file in +the 'Mkfiles/vc10' subdirectory to open the build project in +the Visual Studio 2010 IDE and then select: + + win32 or x64 build + release or debug build + +as appropriate to build the YASM binaries that you need. + +4. Using YASM with Visual Sudio 2010 and VC++ version 10 +-------------------------------------------------------- + +1. Firstly you need to locate the directory (or directories) +where the VC++ compiler binaries are located and put copies +of the appropriate yasm.exe binary in these directories. A +typical location is: + +C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin + +Depending on your system you can use either the win32 or the +x64 version of YASM. It must be named yasm.exe. + +2. To use the new custom tools facility in Visual Studio 2010, +you need to place a copy of three files - yasm.props, yasm.targets +and yasm.xml - into the MSBUILD customisation directory, which is +typically at: + +C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations + +This allows you to configure YASM as an assembler within the VC++ +IDE. To use YASM in a project, right click on the project in the +Solution Explorer and select 'Build Customisations..'. This will +give you a dialog box that allows you to select YASM as an +assembler (note that your assembler files need to have the +extension '.asm'). + +To assemble a file with YASM, select the Property Page for the +file and the select 'Yasm Assembler' in the Tool dialog entry. +Then click 'Apply' and an additional property page entry will +appear and enable YASM settings to be established. + +As alternative to placing the yasm.rules files as described +above is to set the rules file path in the Visual Studio 2010 +settings dialogue. + +5. A Linker Issue +----------------- + +There appears to be a linker bug in the VC++ linker that +prevents symbols with absolute addresses being linked in DLL +builds. This means, for example, that LEA instructions of +the general form: + + lea, rax,[rax+symbol] + +cannot be used for DLL builds. The following general form +has to be used instead: + + lea rcx,[symbol wrt rip] + lea rax,[rax+rcx] + +This limitation may also cause problems with other instruction +that use absolute addresses. + +6. Acknowledgements +------------------- + +I am most grateful for the fantastic support that Peter Johnson, +YASM's creator, has given me in tracking down issues in using +YASM for the production of Windows x64 code. + + Brian Gladman, 10th November 2009 + diff --git a/Mkfiles/vc10/yasm.props b/Mkfiles/vc10/yasm.props new file mode 100644 index 00000000..1d7edcae --- /dev/null +++ b/Mkfiles/vc10/yasm.props @@ -0,0 +1,24 @@ + + + + Midl + CustomBuild + + + _SelectedFiles;$(YASMDependsOn) + + + + False + $(IntDir)%(FileName).obj + 0 + 0 + yasm -Xvc -f $(Platform) [AllOptions] [AdditionalOptions] [Inputs] + %(ObjectFileName) + Assembling %(Filename)%(Extension) + false + + + diff --git a/Mkfiles/vc10/yasm.sln b/Mkfiles/vc10/yasm.sln new file mode 100644 index 00000000..9b061a37 --- /dev/null +++ b/Mkfiles/vc10/yasm.sln @@ -0,0 +1,121 @@ +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{825AC694-358C-4D8D-92DE-33A2691978CE}" + ProjectSection(SolutionItems) = preProject + crt_secure_no_deprecate.vsprops = crt_secure_no_deprecate.vsprops + readme.vc8.txt = readme.vc8.txt + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libyasm", "libyasm\libyasm.vcxproj", "{29FE7874-1256-4AD6-B889-68E399DC9608}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "modules", "modules\modules.vcxproj", "{D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yasm", "yasm.vcxproj", "{34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genmacro", "genmacro\genmacro.vcxproj", "{225700A5-07B8-434E-AD61-555278BF6733}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genversion", "genversion\genversion.vcxproj", "{B545983B-8EE0-4A7B-A67A-E749EEAE62A2}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "re2c", "re2c\re2c.vcxproj", "{3C58BE13-50A3-4583-984D-D8902B3D7713}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genperf", "genperf\genperf.vcxproj", "{C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genmodule", "genmodule\genmodule.vcxproj", "{F0E8B707-00C5-4FF2-B8EF-7C39817132A0}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genstring", "genstring\genstring.vcxproj", "{021CEB0A-F721-4F59-B349-9CEEAF244459}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ytasm", "ytasm.vcxproj", "{2162937B-0DBD-4450-B45F-DF578D8E7508}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|Win32.ActiveCfg = Debug|Win32 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|Win32.Build.0 = Debug|Win32 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|x64.ActiveCfg = Debug|x64 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|x64.Build.0 = Debug|x64 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|Win32.ActiveCfg = Release|Win32 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|Win32.Build.0 = Release|Win32 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|x64.ActiveCfg = Release|x64 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|x64.Build.0 = Release|x64 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|Win32.ActiveCfg = Debug|Win32 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|Win32.Build.0 = Debug|Win32 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|x64.ActiveCfg = Debug|x64 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|x64.Build.0 = Debug|x64 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|Win32.ActiveCfg = Release|Win32 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|Win32.Build.0 = Release|Win32 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|x64.ActiveCfg = Release|x64 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|x64.Build.0 = Release|x64 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|Win32.ActiveCfg = Debug|Win32 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|Win32.Build.0 = Debug|Win32 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|x64.ActiveCfg = Debug|x64 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|x64.Build.0 = Debug|x64 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|Win32.ActiveCfg = Release|Win32 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|Win32.Build.0 = Release|Win32 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|x64.ActiveCfg = Release|x64 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|x64.Build.0 = Release|x64 + {225700A5-07B8-434E-AD61-555278BF6733}.Debug|Win32.ActiveCfg = Debug|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Debug|Win32.Build.0 = Debug|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Debug|x64.ActiveCfg = Debug|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Debug|x64.Build.0 = Debug|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Release|Win32.ActiveCfg = Release|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Release|Win32.Build.0 = Release|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Release|x64.ActiveCfg = Release|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Release|x64.Build.0 = Release|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|Win32.ActiveCfg = Debug|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|Win32.Build.0 = Debug|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|x64.ActiveCfg = Debug|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|x64.Build.0 = Debug|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|Win32.ActiveCfg = Release|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|Win32.Build.0 = Release|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|x64.ActiveCfg = Release|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|x64.Build.0 = Release|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|Win32.ActiveCfg = Debug|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|Win32.Build.0 = Debug|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|x64.ActiveCfg = Debug|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|x64.Build.0 = Debug|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|Win32.ActiveCfg = Release|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|Win32.Build.0 = Release|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|x64.ActiveCfg = Release|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|x64.Build.0 = Release|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|Win32.ActiveCfg = Debug|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|Win32.Build.0 = Debug|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|x64.ActiveCfg = Debug|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|x64.Build.0 = Debug|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|Win32.ActiveCfg = Release|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|Win32.Build.0 = Release|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|x64.ActiveCfg = Release|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|x64.Build.0 = Release|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|Win32.ActiveCfg = Debug|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|Win32.Build.0 = Debug|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|x64.ActiveCfg = Debug|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|x64.Build.0 = Debug|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|Win32.ActiveCfg = Release|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|Win32.Build.0 = Release|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|x64.ActiveCfg = Release|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|x64.Build.0 = Release|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|Win32.ActiveCfg = Debug|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|Win32.Build.0 = Debug|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|x64.ActiveCfg = Debug|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|x64.Build.0 = Debug|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|Win32.ActiveCfg = Release|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|Win32.Build.0 = Release|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|x64.ActiveCfg = Release|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|x64.Build.0 = Release|Win32 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|Win32.ActiveCfg = Debug|Win32 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|Win32.Build.0 = Debug|Win32 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|x64.ActiveCfg = Debug|x64 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|x64.Build.0 = Debug|x64 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|Win32.ActiveCfg = Release|Win32 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|Win32.Build.0 = Release|Win32 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|x64.ActiveCfg = Release|x64 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Mkfiles/vc10/yasm.targets b/Mkfiles/vc10/yasm.targets new file mode 100644 index 00000000..92bdccc9 --- /dev/null +++ b/Mkfiles/vc10/yasm.targets @@ -0,0 +1,91 @@ + + + + + + _YASM + + + + $(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml + + + + + + + + @(YASM, '|') + + + + + + + + + $(ComputeLinkInputsTargets); + ComputeYASMOutput; + + + $(ComputeLibInputsTargets); + ComputeYASMOutput; + + + + + + + + + + + + diff --git a/Mkfiles/vc10/yasm.vcxproj b/Mkfiles/vc10/yasm.vcxproj new file mode 100644 index 00000000..1ba96d8b --- /dev/null +++ b/Mkfiles/vc10/yasm.vcxproj @@ -0,0 +1,271 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5} + yasm + + + + Application + false + MultiByte + + + Application + false + MultiByte + + + Application + false + MultiByte + + + Application + false + MultiByte + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + + + + $(Platform)\$(Configuration)/yasm.tlb + + + + + Disabled + .;../..;%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + EditAndContinue + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)yasm.exe + true + true + $(OutDir)$(ProjectName).pdb + Console + false + + + MachineX86 + + + + + X64 + $(Platform)\$(Configuration)/yasm.tlb + + + + + Disabled + .;../..;%(AdditionalIncludeDirectories) + _DEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)yasm.exe + true + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX64 + + + + + $(Platform)\$(Configuration)/yasm.tlb + + + + + Full + Default + true + .;../..;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)yasm.exe + true + false + $(OutDir)$(ProjectName).pdb + Console + false + + + MachineX86 + + + + + X64 + $(Platform)\$(Configuration)/yasm.tlb + + + + + Full + OnlyExplicitInline + .;../..;%(AdditionalIncludeDirectories) + NDEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)yasm.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX64 + + + + + + + + + + + + {021ceb0a-f721-4f59-b349-9ceeaf244459} + false + + + {29fe7874-1256-4ad6-b889-68e399dc9608} + false + + + {d715a3d4-efaa-442e-ad8b-5b4ff64e1dd6} + false + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc10/yasm.vcxproj.filters b/Mkfiles/vc10/yasm.vcxproj.filters new file mode 100644 index 00000000..9f3aa728 --- /dev/null +++ b/Mkfiles/vc10/yasm.vcxproj.filters @@ -0,0 +1,26 @@ + + + + + {51f0d88e-1373-4bf8-a72e-c79706d37f8b} + h;hpp;hxx;hm;inl + + + {db67b411-6f59-462c-9c20-75024c6b3912} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + + + Source Files + + + Source Files + + + + + Header Files + + + \ No newline at end of file diff --git a/Mkfiles/vc10/yasm.xml b/Mkfiles/vc10/yasm.xml new file mode 100644 index 00000000..631b613d --- /dev/null +++ b/Mkfiles/vc10/yasm.xml @@ -0,0 +1,209 @@ + + + + + + + + + + General + + + + + Command Line + + + + + + + + + + + + + + + + + + + + + + + + + + + Execute Before + + + Specifies the targets for the build customization to run before. + + + + + + + + + + + Execute After + + + Specifies the targets for the build customization to run after. + + + + + + + + + + + + + + Additional Options + + + Additional Options + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc10/ytasm.vcxproj b/Mkfiles/vc10/ytasm.vcxproj new file mode 100644 index 00000000..19603a09 --- /dev/null +++ b/Mkfiles/vc10/ytasm.vcxproj @@ -0,0 +1,267 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {2162937B-0DBD-4450-B45F-DF578D8E7508} + ytasm + + + + Application + false + MultiByte + + + Application + false + MultiByte + + + Application + false + MultiByte + + + Application + false + MultiByte + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + + + + $(Platform)\$(Configuration)/yasm.tlb + + + + + Disabled + .;../..;%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + EditAndContinue + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)ytasm.exe + true + true + $(OutDir)$(ProjectName).pdb + Console + false + + + MachineX86 + + + + + X64 + $(Platform)\$(Configuration)/yasm.tlb + + + + + Disabled + .;../..;%(AdditionalIncludeDirectories) + _DEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)ytasm.exe + true + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX64 + + + + + $(Platform)\$(Configuration)/yasm.tlb + + + + + Full + Default + true + .;../..;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)ytasm.exe + true + false + $(OutDir)$(ProjectName).pdb + Console + false + + + MachineX86 + + + + + X64 + $(Platform)\$(Configuration)/yasm.tlb + + + + + Full + OnlyExplicitInline + .;../..;%(AdditionalIncludeDirectories) + NDEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)ytasm.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX64 + + + + + + + + + + + + {29fe7874-1256-4ad6-b889-68e399dc9608} + false + + + {d715a3d4-efaa-442e-ad8b-5b4ff64e1dd6} + false + + + + + + \ No newline at end of file From 9f91d82b07dbf49c11f3124bd9de8d359ce98326 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 6 Dec 2009 03:37:43 +0000 Subject: [PATCH 297/585] Unbreak gen_x86_insn.py on Python 2.4. Patch by: Alexei Svitkine svn path=/trunk/yasm/; revision=2242 --- modules/arch/x86/gen_x86_insn.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index b7d6428a..40147358 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -608,7 +608,10 @@ def output_groups(f): # Merge all operand lists into single list # Sort by number of operands to shorten output all_operands = [] - gi = groups.itervalues() if version_info[0] == 2 else groups.values() + if version_info[0] == 2: + gi = groups.itervalues() + else: + gi = groups.values() for form in sorted((form for g in gi for form in g), key=lambda x:len(x.operands), reverse=True): num_operands = len(form.operands) From 493c5b8861fc7a9a97b9d07833b6dee91f2987a2 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 23 Dec 2009 06:45:17 +0000 Subject: [PATCH 298/585] Add initial gas preprocessor, contributed by Alexei Svitkine. Support for include directive amongst other major key pieces. Does not currently support macros. Fixes #79. Contributed by: Alexei Svitkine svn path=/trunk/yasm/; revision=2243 --- COPYING | 1 + modules/parsers/gas/gas-parser.c | 3 +- modules/preprocs/CMakeLists.txt | 1 + modules/preprocs/Makefile.inc | 2 + modules/preprocs/gas/CMakeLists.txt | 4 + modules/preprocs/gas/Makefile.inc | 10 + modules/preprocs/gas/gas-eval.c | 443 ++++++++++++ modules/preprocs/gas/gas-eval.h | 120 +++ modules/preprocs/gas/gas-preproc.c | 921 ++++++++++++++++++++++++ modules/preprocs/gas/tests/Makefile.inc | 7 + po/POTFILES.in | 2 + 11 files changed, 1513 insertions(+), 1 deletion(-) create mode 100644 modules/preprocs/gas/CMakeLists.txt create mode 100644 modules/preprocs/gas/Makefile.inc create mode 100644 modules/preprocs/gas/gas-eval.c create mode 100644 modules/preprocs/gas/gas-eval.h create mode 100644 modules/preprocs/gas/gas-preproc.c create mode 100644 modules/preprocs/gas/tests/Makefile.inc diff --git a/COPYING b/COPYING index 6b8118d3..b28d40c9 100644 --- a/COPYING +++ b/COPYING @@ -10,6 +10,7 @@ Yasm developers and/or contributors include: Stephen Polkowski (x86 instruction patches) Henryk Richter (Mach-O object format) Ben Skeggs (patches, bug reports) + Alexei Svitkine (GAS preprocessor) Samuel Thibault (TASM parser and frontend) ----------------------------------- diff --git a/modules/parsers/gas/gas-parser.c b/modules/parsers/gas/gas-parser.c index 98231471..64a10c20 100644 --- a/modules/parsers/gas/gas-parser.c +++ b/modules/parsers/gas/gas-parser.c @@ -114,6 +114,7 @@ gas_parser_do_parse(yasm_object *object, yasm_preproc *pp, /* Define valid preprocessors to use with this parser */ static const char *gas_parser_preproc_keywords[] = { + "gas", "raw", "cpp", "nasm", @@ -133,7 +134,7 @@ yasm_parser_module yasm_gnu_LTX_parser = { "GNU AS (GAS)-compatible parser", "gnu", gas_parser_preproc_keywords, - "raw", + "gas", NULL, /* No standard macros */ gas_parser_do_parse }; diff --git a/modules/preprocs/CMakeLists.txt b/modules/preprocs/CMakeLists.txt index dccecbe5..59640272 100644 --- a/modules/preprocs/CMakeLists.txt +++ b/modules/preprocs/CMakeLists.txt @@ -1,3 +1,4 @@ INCLUDE(preprocs/nasm/CMakeLists.txt) INCLUDE(preprocs/raw/CMakeLists.txt) INCLUDE(preprocs/cpp/CMakeLists.txt) +INCLUDE(preprocs/gas/CMakeLists.txt) diff --git a/modules/preprocs/Makefile.inc b/modules/preprocs/Makefile.inc index aee9accd..fedcf75b 100644 --- a/modules/preprocs/Makefile.inc +++ b/modules/preprocs/Makefile.inc @@ -4,8 +4,10 @@ EXTRA_DIST += modules/preprocs/tasm/Makefile.inc EXTRA_DIST += modules/preprocs/nasm/Makefile.inc EXTRA_DIST += modules/preprocs/raw/Makefile.inc EXTRA_DIST += modules/preprocs/cpp/Makefile.inc +EXTRA_DIST += modules/preprocs/gas/Makefile.inc include modules/preprocs/tasm/Makefile.inc include modules/preprocs/nasm/Makefile.inc include modules/preprocs/raw/Makefile.inc include modules/preprocs/cpp/Makefile.inc +include modules/preprocs/gas/Makefile.inc diff --git a/modules/preprocs/gas/CMakeLists.txt b/modules/preprocs/gas/CMakeLists.txt new file mode 100644 index 00000000..e8d09148 --- /dev/null +++ b/modules/preprocs/gas/CMakeLists.txt @@ -0,0 +1,4 @@ +YASM_ADD_MODULE(preproc_gas + preprocs/gas/gas-preproc.c + preprocs/gas/gas-eval.c + ) diff --git a/modules/preprocs/gas/Makefile.inc b/modules/preprocs/gas/Makefile.inc new file mode 100644 index 00000000..a53077b6 --- /dev/null +++ b/modules/preprocs/gas/Makefile.inc @@ -0,0 +1,10 @@ +# $Id$ + +libyasm_a_SOURCES += modules/preprocs/gas/gas-preproc.c +libyasm_a_SOURCES += modules/preprocs/gas/gas-eval.c + +YASM_MODULES += preproc_gas + +EXTRA_DIST += modules/preprocs/gas/tests/Makefile.inc + +include modules/preprocs/gas/tests/Makefile.inc diff --git a/modules/preprocs/gas/gas-eval.c b/modules/preprocs/gas/gas-eval.c new file mode 100644 index 00000000..db70d7fd --- /dev/null +++ b/modules/preprocs/gas/gas-eval.c @@ -0,0 +1,443 @@ +/* eval.c expression evaluator for the Netwide Assembler + * + * The Netwide Assembler is copyright (C) 1996 Simon Tatham and + * Julian Hall. All rights reserved. The software is + * redistributable under the licence given in the file "Licence" + * distributed in the NASM archive. + * + * initial version 27/iii/95 by Simon Tatham + */ +#include +#include +#include +#include +#include +#include +#include + +#include "gas-eval.h" + +/* The assembler symbol table. */ +static yasm_symtab *symtab; + +static scanner scan; /* Address of scanner routine */ +static efunc error; /* Address of error reporting routine */ + +static struct tokenval *tokval; /* The current token */ +static int i; /* The t_type of tokval */ + +static void *scpriv; +static void *epriv; + +/* + * Recursive-descent parser. Called with a single boolean operand, + * which is TRUE if the evaluation is critical (i.e. unresolved + * symbols are an error condition). Must update the global `i' to + * reflect the token after the parsed string. May return NULL. + * + * evaluate() should report its own errors: on return it is assumed + * that if NULL has been returned, the error has already been + * reported. + */ + +/* + * Grammar parsed is: + * + * expr : bexpr [ WRT expr6 ] + * bexpr : rexp0 or expr0 depending on relative-mode setting + * rexp0 : rexp1 [ {||} rexp1...] + * rexp1 : rexp2 [ {^^} rexp2...] + * rexp2 : rexp3 [ {&&} rexp3...] + * rexp3 : expr0 [ {=,==,<>,!=,<,>,<=,>=} expr0 ] + * expr0 : expr1 [ {|} expr1...] + * expr1 : expr2 [ {^} expr2...] + * expr2 : expr3 [ {&} expr3...] + * expr3 : expr4 [ {<<,>>} expr4...] + * expr4 : expr5 [ {+,-} expr5...] + * expr5 : expr6 [ {*,/,%,//,%%} expr6...] + * expr6 : { ~,+,-,SEG } expr6 + * | (bexpr) + * | symbol + * | $ + * | number + */ + +static yasm_expr *rexp0(void), *rexp1(void), *rexp2(void), *rexp3(void); + +static yasm_expr *expr0(void), *expr1(void), *expr2(void), *expr3(void); +static yasm_expr *expr4(void), *expr5(void), *expr6(void); + +static yasm_expr *(*bexpr)(void); + +static yasm_expr *rexp0(void) +{ + yasm_expr *e, *f; + + e = rexp1(); + if (!e) + return NULL; + + while (i == TOKEN_DBL_OR) + { + i = scan(scpriv, tokval); + f = rexp1(); + if (!f) { + yasm_expr_destroy(e); + return NULL; + } + + e = yasm_expr_create_tree(e, YASM_EXPR_LOR, f, 0); + } + return e; +} + +static yasm_expr *rexp1(void) +{ + yasm_expr *e, *f; + + e = rexp2(); + if (!e) + return NULL; + + while (i == TOKEN_DBL_XOR) + { + i = scan(scpriv, tokval); + f = rexp2(); + if (!f) { + yasm_expr_destroy(e); + return NULL; + } + + e = yasm_expr_create_tree(e, YASM_EXPR_LXOR, f, 0); + } + return e; +} + +static yasm_expr *rexp2(void) +{ + yasm_expr *e, *f; + + e = rexp3(); + if (!e) + return NULL; + while (i == TOKEN_DBL_AND) + { + i = scan(scpriv, tokval); + f = rexp3(); + if (!f) { + yasm_expr_destroy(e); + return NULL; + } + + e = yasm_expr_create_tree(e, YASM_EXPR_LAND, f, 0); + } + return e; +} + +static yasm_expr *rexp3(void) +{ + yasm_expr *e, *f; + + e = expr0(); + if (!e) + return NULL; + + while (i == TOKEN_EQ || i == TOKEN_LT || i == TOKEN_GT || + i == TOKEN_NE || i == TOKEN_LE || i == TOKEN_GE) + { + int j = i; + i = scan(scpriv, tokval); + f = expr0(); + if (!f) { + yasm_expr_destroy(e); + return NULL; + } + + switch (j) + { + case TOKEN_EQ: + e = yasm_expr_create_tree(e, YASM_EXPR_EQ, f, 0); + break; + case TOKEN_LT: + e = yasm_expr_create_tree(e, YASM_EXPR_LT, f, 0); + break; + case TOKEN_GT: + e = yasm_expr_create_tree(e, YASM_EXPR_GT, f, 0); + break; + case TOKEN_NE: + e = yasm_expr_create_tree(e, YASM_EXPR_NE, f, 0); + break; + case TOKEN_LE: + e = yasm_expr_create_tree(e, YASM_EXPR_LE, f, 0); + break; + case TOKEN_GE: + e = yasm_expr_create_tree(e, YASM_EXPR_GE, f, 0); + break; + } + } + return e; +} + +static yasm_expr *expr0(void) +{ + yasm_expr *e, *f; + + e = expr1(); + if (!e) + return NULL; + + while (i == '|') + { + i = scan(scpriv, tokval); + f = expr1(); + if (!f) { + yasm_expr_destroy(e); + return NULL; + } + + e = yasm_expr_create_tree(e, YASM_EXPR_OR, f, 0); + } + return e; +} + +static yasm_expr *expr1(void) +{ + yasm_expr *e, *f; + + e = expr2(); + if (!e) + return NULL; + + while (i == '^') { + i = scan(scpriv, tokval); + f = expr2(); + if (!f) { + yasm_expr_destroy(e); + return NULL; + } + + e = yasm_expr_create_tree(e, YASM_EXPR_XOR, f, 0); + } + return e; +} + +static yasm_expr *expr2(void) +{ + yasm_expr *e, *f; + + e = expr3(); + if (!e) + return NULL; + + while (i == '&') { + i = scan(scpriv, tokval); + f = expr3(); + if (!f) { + yasm_expr_destroy(e); + return NULL; + } + + e = yasm_expr_create_tree(e, YASM_EXPR_AND, f, 0); + } + return e; +} + +static yasm_expr *expr3(void) +{ + yasm_expr *e, *f; + + e = expr4(); + if (!e) + return NULL; + + while (i == TOKEN_SHL || i == TOKEN_SHR) + { + int j = i; + i = scan(scpriv, tokval); + f = expr4(); + if (!f) { + yasm_expr_destroy(e); + return NULL; + } + + switch (j) { + case TOKEN_SHL: + e = yasm_expr_create_tree(e, YASM_EXPR_SHL, f, 0); + break; + case TOKEN_SHR: + e = yasm_expr_create_tree(e, YASM_EXPR_SHR, f, 0); + break; + } + } + return e; +} + +static yasm_expr *expr4(void) +{ + yasm_expr *e, *f; + + e = expr5(); + if (!e) + return NULL; + while (i == '+' || i == '-') + { + int j = i; + i = scan(scpriv, tokval); + f = expr5(); + if (!f) { + yasm_expr_destroy(e); + return NULL; + } + switch (j) { + case '+': + e = yasm_expr_create_tree(e, YASM_EXPR_ADD, f, 0); + break; + case '-': + e = yasm_expr_create_tree(e, YASM_EXPR_SUB, f, 0); + break; + } + } + return e; +} + +static yasm_expr *expr5(void) +{ + yasm_expr *e, *f; + + e = expr6(); + if (!e) + return NULL; + while (i == '*' || i == '/' || i == '%' || + i == TOKEN_SDIV || i == TOKEN_SMOD) + { + int j = i; + i = scan(scpriv, tokval); + f = expr6(); + if (!f) { + yasm_expr_destroy(e); + return NULL; + } + switch (j) { + case '*': + e = yasm_expr_create_tree(e, YASM_EXPR_MUL, f, 0); + break; + case '/': + e = yasm_expr_create_tree(e, YASM_EXPR_DIV, f, 0); + break; + case '%': + e = yasm_expr_create_tree(e, YASM_EXPR_MOD, f, 0); + break; + case TOKEN_SDIV: + e = yasm_expr_create_tree(e, YASM_EXPR_SIGNDIV, f, 0); + break; + case TOKEN_SMOD: + e = yasm_expr_create_tree(e, YASM_EXPR_SIGNMOD, f, 0); + break; + } + } + return e; +} + +static yasm_expr *expr6(void) +{ + yasm_expr *e = NULL; + + if (i == '-') { + i = scan(scpriv, tokval); + e = expr6(); + if (!e) + return NULL; + return yasm_expr_create_branch(YASM_EXPR_NEG, e, 0); + } else if (i == '+') { + i = scan(scpriv, tokval); + return expr6(); + } else if (i == '~') { + i = scan(scpriv, tokval); + e = expr6(); + if (!e) + return NULL; + return yasm_expr_create_branch(YASM_EXPR_NOT, e, 0); + } else if (i == TOKEN_SEG) { + i = scan(scpriv, tokval); + e = expr6(); + if (!e) + return NULL; + error(epriv, ERR_NONFATAL, "%s not supported", "SEG"); + return e; + } else if (i == '(') { + i = scan(scpriv, tokval); + e = bexpr(); + if (!e) + return NULL; + if (i != ')') { + error(epriv, ERR_NONFATAL, "expecting `)'"); + return NULL; + } + i = scan(scpriv, tokval); + return e; + } + else if (i == TOKEN_NUM || i == TOKEN_ID || + i == TOKEN_HERE || i == TOKEN_BASE) + { + switch (i) { + case TOKEN_NUM: + e = yasm_expr_create_ident(yasm_expr_int(tokval->t_integer), 0); + break; + case TOKEN_ID: + if (symtab) { + yasm_symrec *sym = + yasm_symtab_get(symtab, tokval->t_charptr); + if (sym) { + e = yasm_expr_create_ident(yasm_expr_sym(sym), 0); + } else { + error(epriv, ERR_NONFATAL, + "undefined symbol `%s' in preprocessor", + tokval->t_charptr); + e = yasm_expr_create_ident(yasm_expr_int( + yasm_intnum_create_int(1)), 0); + } + break; + } + /*fallthrough*/ + case TOKEN_HERE: + case TOKEN_BASE: + error(epriv, ERR_NONFATAL, + "cannot reference symbol `%s' in preprocessor", + (i == TOKEN_ID ? tokval->t_charptr : + i == TOKEN_HERE ? "$" : "$$")); + e = yasm_expr_create_ident(yasm_expr_int(yasm_intnum_create_int(1)), + 0); + break; + } + i = scan(scpriv, tokval); + return e; + } else { + error(epriv, ERR_NONFATAL, "expression syntax error"); + return NULL; + } +} + +yasm_expr *evaluate (scanner sc, void *scprivate, struct tokenval *tv, + void *eprivate, int critical, efunc report_error, + yasm_symtab *st) +{ + if (critical & CRITICAL) { + critical &= ~CRITICAL; + bexpr = rexp0; + } else + bexpr = expr0; + + scan = sc; + scpriv = scprivate; + tokval = tv; + error = report_error; + epriv = eprivate; + symtab = st; + + if (tokval->t_type == TOKEN_INVALID) + i = scan(scpriv, tokval); + else + i = tokval->t_type; + + return bexpr (); +} diff --git a/modules/preprocs/gas/gas-eval.h b/modules/preprocs/gas/gas-eval.h new file mode 100644 index 00000000..18dcc517 --- /dev/null +++ b/modules/preprocs/gas/gas-eval.h @@ -0,0 +1,120 @@ +/* eval.h header file for eval.c + * + * The Netwide Assembler is copyright (C) 1996 Simon Tatham and + * Julian Hall. All rights reserved. The software is + * redistributable under the licence given in the file "Licence" + * distributed in the NASM archive. + */ + +#ifndef YASM_EVAL_H +#define YASM_EVAL_H + +/* + * ------------------------- + * Error reporting functions + * ------------------------- + */ + +/* + * An error reporting function should look like this. + */ +typedef void (*efunc) (void *private_data, int severity, const char *fmt, ...); + +/* + * These are the error severity codes which get passed as the first + * argument to an efunc. + */ + +#define ERR_DEBUG 0x00000008 /* put out debugging message */ +#define ERR_WARNING 0x00000000 /* warn only: no further action */ +#define ERR_NONFATAL 0x00000001 /* terminate assembly after phase */ +#define ERR_FATAL 0x00000002 /* instantly fatal: exit with error */ +#define ERR_PANIC 0x00000003 /* internal error: panic instantly + * and dump core for reference */ +#define ERR_MASK 0x0000000F /* mask off the above codes */ +#define ERR_NOFILE 0x00000010 /* don't give source file name/line */ +#define ERR_USAGE 0x00000020 /* print a usage message */ +#define ERR_PASS1 0x00000040 /* only print this error on pass one */ + +/* + * These codes define specific types of suppressible warning. + */ + +#define ERR_WARN_MASK 0x0000FF00 /* the mask for this feature */ +#define ERR_WARN_SHR 8 /* how far to shift right */ + +#define ERR_WARN_MNP 0x00000100 /* macro-num-parameters warning */ +#define ERR_WARN_MSR 0x00000200 /* macro self-reference */ +#define ERR_WARN_OL 0x00000300 /* orphan label (no colon, and + * alone on line) */ +#define ERR_WARN_NOV 0x00000400 /* numeric overflow */ +#define ERR_WARN_GNUELF 0x00000500 /* using GNU ELF extensions */ +#define ERR_WARN_MAX 5 /* the highest numbered one */ + +/* + * The expression evaluator must be passed a scanner function; a + * standard scanner is provided as part of nasmlib.c. The + * preprocessor will use a different one. Scanners, and the + * token-value structures they return, look like this. + * + * The return value from the scanner is always a copy of the + * `t_type' field in the structure. + */ +struct tokenval { + int t_type; + yasm_intnum *t_integer, *t_inttwo; + char *t_charptr; +}; +typedef int (*scanner) (void *private_data, struct tokenval *tv); + +/* + * Token types returned by the scanner, in addition to ordinary + * ASCII character values, and zero for end-of-string. + */ +enum { /* token types, other than chars */ + TOKEN_INVALID = -1, /* a placeholder value */ + TOKEN_EOS = 0, /* end of string */ + TOKEN_EQ = '=', TOKEN_GT = '>', TOKEN_LT = '<', /* aliases */ + TOKEN_ID = 256, TOKEN_NUM, TOKEN_REG, TOKEN_INSN, /* major token types */ + TOKEN_ERRNUM, /* numeric constant with error in */ + TOKEN_HERE, TOKEN_BASE, /* $ and $$ */ + TOKEN_SPECIAL, /* BYTE, WORD, DWORD, FAR, NEAR, etc */ + TOKEN_PREFIX, /* A32, O16, LOCK, REPNZ, TIMES, etc */ + TOKEN_SHL, TOKEN_SHR, /* << and >> */ + TOKEN_SDIV, TOKEN_SMOD, /* // and %% */ + TOKEN_GE, TOKEN_LE, TOKEN_NE, /* >=, <= and <> (!= is same as <>) */ + TOKEN_DBL_AND, TOKEN_DBL_OR, TOKEN_DBL_XOR, /* &&, || and ^^ */ + TOKEN_SEG, TOKEN_WRT, /* SEG and WRT */ + TOKEN_FLOAT /* floating-point constant */ +}; + +/* + * The actual expression evaluator function looks like this. When + * called, it expects the first token of its expression to already + * be in `*tv'; if it is not, set tv->t_type to TOKEN_INVALID and + * it will start by calling the scanner. + * + * `critical' is non-zero if the expression may not contain forward + * references. The evaluator will report its own error if this + * occurs; if `critical' is 1, the error will be "symbol not + * defined before use", whereas if `critical' is 2, the error will + * be "symbol undefined". + * + * If `critical' has bit 8 set (in addition to its main value: 0x101 + * and 0x102 correspond to 1 and 2) then an extended expression + * syntax is recognised, in which relational operators such as =, < + * and >= are accepted, as well as low-precedence logical operators + * &&, ^^ and ||. + */ +#define CRITICAL 0x100 +typedef yasm_expr *(*evalfunc) (scanner sc, void *scprivate, struct tokenval *tv, + int critical, efunc error, yasm_symtab *symtab); + +/* + * The evaluator itself. + */ +yasm_expr *evaluate (scanner sc, void *scprivate, struct tokenval *tv, + void *eprivate, int critical, efunc report_error, + yasm_symtab *symtab); + +#endif diff --git a/modules/preprocs/gas/gas-preproc.c b/modules/preprocs/gas/gas-preproc.c new file mode 100644 index 00000000..729aeaec --- /dev/null +++ b/modules/preprocs/gas/gas-preproc.c @@ -0,0 +1,921 @@ +/* + * GAS preprocessor (emulates GNU Assembler's preprocessor) + * + * Copyright (C) 2009 Alexei Svitkine + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include +#include +/*@unused@*/ RCSID("$Id$"); + +#include +#include "gas-eval.h" + +#define FALSE 0 +#define TRUE 1 +#define BSIZE 512 + +#ifndef MAXPATHLEN +#define MAXPATHLEN 1024 +#endif + +typedef struct buffered_line { + char *line; + SLIST_ENTRY(buffered_line) next; +} buffered_line; + +typedef struct included_file { + char *filename; + int lines_remaining; + SLIST_ENTRY(included_file) next; +} included_file; + +typedef struct yasm_preproc_gas { + yasm_preproc_base preproc; /* base structure */ + + FILE *in; + char *in_filename; + + yasm_symtab *defines; + + int depth; + int skip_depth; + + const char *expr_string; + char *expr_symbol; + int expr_string_cursor; + + SLIST_HEAD(buffered_lines_head, buffered_line) buffered_lines; + SLIST_HEAD(included_files_head, included_file) included_files; + + yasm_linemap *cur_lm; + yasm_errwarns *errwarns; + int fatal_error; +} yasm_preproc_gas; + +yasm_preproc_module yasm_gas_LTX_preproc; + +/* String helpers. */ + +static const char *starts_with(const char *big, const char *little) +{ + while (*little) { + if (*little++ != *big++) { + return NULL; + } + } + return big; +} + +static void skip_whitespace(const char **line) +{ + while (isspace(**line)) { + (*line)++; + } +} + +static void skip_whitespace2(char **line) +{ + while (isspace(**line)) { + (*line)++; + } +} + +static const char *matches(const char *line, const char *directive) +{ + skip_whitespace(&line); + + if (*line == '.') { + line = starts_with(line + 1, directive); + if (line && (!*line || isspace(*line))) { + skip_whitespace(&line); + return line; + } + } + + return NULL; +} + +static int unquote(const char *arg, char *to, size_t to_size, char q, char expected, const char **remainder) +{ + const char *quote; + const char *end; + size_t len; + + skip_whitespace(&arg); + if (*arg != q) { + return -1; + } + + arg++; + + end = arg; + do { + quote = strchr(end, q); + if (!quote) { + return -2; + } + end = quote + 1; + } while (*(quote - 1) == '\\'); + + skip_whitespace(&end); + if (*end != expected) { + return -3; + } + + if (remainder) { + *remainder = end + 1; + } + + len = (size_t) (quote - arg); + if (len >= to_size) { + return -4; + } + + strncpy(to, arg, len); + to[len] = '\0'; + + return (int) len; +} + +/* Line-reading. */ + +static char *read_line_from_file(yasm_preproc_gas *pp, FILE *file) +{ + int bufsize = BSIZE; + char *buf; + char *p; + + buf = yasm_xmalloc((size_t)bufsize); + + /* Loop to ensure entire line is read (don't want to limit line length). */ + p = buf; + for (;;) { + if (!fgets(p, bufsize - (p - buf), file)) { + if (ferror(file)) { + yasm_error_set(YASM_ERROR_IO, N_("error when reading from file")); + yasm_errwarn_propagate(pp->errwarns, yasm_linemap_get_current(pp->cur_lm)); + } + break; + } + p += strlen(p); + if (p > buf && p[-1] == '\n') { + break; + } + if ((p - buf) + 1 >= bufsize) { + /* Increase size of buffer */ + char *oldbuf = buf; + bufsize *= 2; + buf = yasm_xrealloc(buf, (size_t) bufsize); + p = buf + (p - oldbuf); + } + } + + if (p == buf) { + /* No data; must be at EOF */ + yasm_xfree(buf); + return NULL; + } + + /* Strip the line ending */ + buf[strcspn(buf, "\r\n")] = '\0'; + return buf; +} + +static char *read_line(yasm_preproc_gas *pp) +{ + char *buf; + + if (!SLIST_EMPTY(&pp->included_files)) { + included_file *inc_file = SLIST_FIRST(&pp->included_files); + if (inc_file->lines_remaining <= 0) { + SLIST_REMOVE_HEAD(&pp->included_files, next); + yasm_xfree(inc_file->filename); + yasm_xfree(inc_file); + } + } + + if (!SLIST_EMPTY(&pp->buffered_lines)) { + buffered_line *bline = SLIST_FIRST(&pp->buffered_lines); + SLIST_REMOVE_HEAD(&pp->buffered_lines, next); + buf = bline->line; + yasm_xfree(bline); + if (!SLIST_EMPTY(&pp->included_files)) { + SLIST_FIRST(&pp->included_files)->lines_remaining--; + } + return buf; + } + + buf = read_line_from_file(pp, pp->in); + + return buf; +} + +static const char *get_arg(yasm_preproc_gas *pp, const char *src, char *dest, size_t dest_size) +{ + const char *comma = strchr(src, ','); + if (comma) { + size_t len = (size_t) (comma - src); + if (len >= dest_size) { + len = dest_size - 1; + } + strncpy(dest, src, len); + dest[len] = '\0'; + comma++; + skip_whitespace(&comma); + } else { + yasm_error_set(YASM_ERROR_SYNTAX, N_("expected comma")); + yasm_errwarn_propagate(pp->errwarns, yasm_linemap_get_current(pp->cur_lm)); + } + return comma; +} + +/* GAS expression evaluation. */ + +static char get_char(yasm_preproc_gas *pp) +{ + return pp->expr_string[pp->expr_string_cursor]; +} + +static const char *get_str(yasm_preproc_gas *pp) +{ + return pp->expr_string + pp->expr_string_cursor; +} + +static void next_char(yasm_preproc_gas *pp) +{ + pp->expr_string_cursor++; +} + +static int gas_scan(void *preproc, struct tokenval *tokval) +{ + yasm_preproc_gas *pp = (yasm_preproc_gas *) preproc; + char c = get_char(pp); + const char *str; + + tokval->t_charptr = NULL; + + if (c == '\0') { + return tokval->t_type = TOKEN_EOS; + } + + if (isspace(c)) { + do { + next_char(pp); + c = get_char(pp); + } while (isspace(c)); + } + + if (isdigit(c)) { + int value = 0; + do { + value = value*10 + (c - '0'); + next_char(pp); + c = get_char(pp); + } while (isdigit(c)); + tokval->t_integer = yasm_intnum_create_int(value); + return tokval->t_type = TOKEN_NUM; + } + + tokval->t_type = TOKEN_INVALID; + str = get_str(pp); + + { + /* It should be tested whether GAS supports all of these or if there are missing ones. */ + unsigned i; + struct { + const char *op; + int token; + } ops[] = { + { "<<", TOKEN_SHL }, + { ">>", TOKEN_SHR }, + { "//", TOKEN_SDIV }, + { "%%", TOKEN_SMOD }, + { "==", TOKEN_EQ }, + { "!=", TOKEN_NE }, + { "<>", TOKEN_NE }, + { "<>", TOKEN_NE }, + { "<=", TOKEN_LE }, + { ">=", TOKEN_GE }, + { "&&", TOKEN_DBL_AND }, + { "^^", TOKEN_DBL_XOR }, + { "||", TOKEN_DBL_OR } + }; + for (i = 0; i < sizeof(ops)/sizeof(ops[0]); i++) { + if (!strcmp(str, ops[i].op)) { + tokval->t_type = ops[i].token; + break; + } + } + } + + if (tokval->t_type != TOKEN_INVALID) { + next_char(pp); + next_char(pp); + } else { + str = get_str(pp); + + next_char(pp); + tokval->t_type = c; + + /* Is it a symbol? If so we need to make it a TOKEN_ID. */ + if (isalpha(c) || c == '_' || c == '.') { + int symbol_length = 1; + + c = get_char(pp); + while (isalnum(c) || c == '$' || c == '_') { + symbol_length++; + next_char(pp); + c = get_char(pp); + } + + pp->expr_symbol = yasm_xrealloc(pp->expr_symbol, symbol_length + 1); + memcpy(pp->expr_symbol, str, symbol_length); + pp->expr_symbol[symbol_length] = '\0'; + + tokval->t_type = TOKEN_ID; + tokval->t_charptr = pp->expr_symbol; + } + } + + return tokval->t_type; +} + +static void gas_err(void *private_data, int severity, const char *fmt, ...) +{ + va_list args; + yasm_preproc_gas *pp = private_data; + + va_start(args, fmt); + yasm_error_set_va(YASM_ERROR_SYNTAX, N_(fmt), args); + yasm_errwarn_propagate(pp->errwarns, yasm_linemap_get_current(pp->cur_lm)); + va_end(args); + + pp->fatal_error = 1; +} + +static long eval_expr(yasm_preproc_gas *pp, const char *arg1) +{ + struct tokenval tv; + yasm_expr *expr; + yasm_intnum *intn; + long value; + + if (!*arg1) { + return 0; + } + + tv.t_type = TOKEN_INVALID; + + pp->expr_symbol = NULL; + pp->expr_string = arg1; + pp->expr_string_cursor = 0; + expr = evaluate(gas_scan, pp, &tv, pp, CRITICAL, gas_err, pp->defines); + intn = yasm_expr_get_intnum(&expr, 0); + value = yasm_intnum_get_int(intn); + yasm_expr_destroy(expr); + + if (pp->expr_symbol) { + yasm_xfree(pp->expr_symbol); + pp->expr_symbol = NULL; + } + + return value; +} + +/* If-directive helpers. */ + +static int handle_if(yasm_preproc_gas *pp, int is_true) +{ + assert(pp->depth >= 0); + assert(pp->skip_depth == 0); + if (is_true) { + pp->depth++; + } else { + pp->skip_depth = 1; + } + return 1; +} + +static int handle_endif(yasm_preproc_gas *pp) +{ + if (pp->skip_depth) { + pp->skip_depth--; + } else if (pp->depth) { + pp->depth--; + } else { + yasm_error_set(YASM_ERROR_SYNTAX, N_("\".endif\" without \".if\"")); + yasm_errwarn_propagate(pp->errwarns, yasm_linemap_get_current(pp->cur_lm)); + return 0; + } + return 1; +} + +static int handle_else(yasm_preproc_gas *pp, int is_elseif) +{ + if (pp->skip_depth == 1) { + pp->skip_depth = 0; + pp->depth++; + } else if (!pp->depth) { + yasm_error_set(YASM_ERROR_SYNTAX, N_("\".%s\" without \".if\""), is_elseif ? "elseif" : "else"); + yasm_errwarn_propagate(pp->errwarns, yasm_linemap_get_current(pp->cur_lm)); + return 0; + } else if (!pp->skip_depth) { + pp->skip_depth = 1; + } + return 1; +} + +/* Directive-handling functions. */ + +static int eval_if(yasm_preproc_gas *pp, int negate, const char *arg1) +{ + long value; + if (!*arg1) { + yasm_error_set(YASM_ERROR_SYNTAX, N_("expression is required in \".if\" statement")); + yasm_errwarn_propagate(pp->errwarns, yasm_linemap_get_current(pp->cur_lm)); + return 0; + } + value = eval_expr(pp, arg1); + handle_if(pp, (negate ? !value : !!value)); + return 1; +} + +static int eval_else(yasm_preproc_gas *pp, int unused) +{ + return handle_else(pp, 0); +} + +static int eval_endif(yasm_preproc_gas *pp, int unused) +{ + return handle_endif(pp); +} + +static int eval_elseif(yasm_preproc_gas *pp, int unused, const char *arg1) +{ + if (!*arg1) { + yasm_error_set(YASM_ERROR_SYNTAX, N_("expression is required in \".elseif\" statement")); + yasm_errwarn_propagate(pp->errwarns, yasm_linemap_get_current(pp->cur_lm)); + return 0; + } + if (!handle_else(pp, 1)) { + return 0; + } + return eval_if(pp, 0, arg1); +} + +static int eval_ifb(yasm_preproc_gas *pp, int negate, const char *arg1) +{ + int is_blank = !*arg1; + return handle_if(pp, (negate ? !is_blank : is_blank)); +} + +static int eval_ifc(yasm_preproc_gas *pp, int negate, const char *args) +{ + char arg1[512], arg2[512]; + const char *remainder; + int len = unquote(args, arg1, sizeof(arg1), '\'', ',', &remainder); + if (len >= 0) { + len = unquote(remainder, arg2, sizeof(arg2), '\'', '\0', NULL); + if (len >= 0) { + int result = !strcmp(arg1, arg2); + return handle_if(pp, (negate ? !result : result)); + } + } else { + /* first argument was not single-quoted, assume non-quoted mode */ + remainder = get_arg(pp, args, arg1, sizeof(arg1)); + if (remainder) { + int result = !strcmp(arg1, remainder); + return handle_if(pp, (negate ? !result : result)); + } + } + yasm_error_set(YASM_ERROR_SYNTAX, N_("\"%s\" expects two single-quoted or unquoted arguments"), negate ? ".ifnc" : ".ifc"); + yasm_errwarn_propagate(pp->errwarns, yasm_linemap_get_current(pp->cur_lm)); + return 0; +} + +static int eval_ifeqs(yasm_preproc_gas *pp, int negate, const char *args) +{ + char arg1[512], arg2[512]; + const char *remainder; + int len = unquote(args, arg1, sizeof(arg1), '"', ',', &remainder); + if (len >= 0) { + len = unquote(remainder, arg2, sizeof(arg2), '"', '\0', NULL); + if (len >= 0) { + int result = !strcmp(arg1, arg2); + return handle_if(pp, (negate ? !result : result)); + } + } + yasm_error_set(YASM_ERROR_SYNTAX, N_("\"%s\" expects two double-quoted arguments"), negate ? ".ifnes" : ".ifeqs"); + yasm_errwarn_propagate(pp->errwarns, yasm_linemap_get_current(pp->cur_lm)); + return 1; +} + +static int eval_ifdef(yasm_preproc_gas *pp, int negate, const char *name) +{ + yasm_symrec *rec = yasm_symtab_get(pp->defines, name); + int result = (rec != NULL); + return handle_if(pp, (negate ? !result : result)); +} + +static int eval_ifge(yasm_preproc_gas *pp, int negate, const char *arg1) +{ + long value = eval_expr(pp, arg1); + int result = (value >= 0); + return handle_if(pp, (negate ? !result : result)); +} + +static int eval_ifgt(yasm_preproc_gas *pp, int negate, const char *arg1) +{ + long value = eval_expr(pp, arg1); + int result = (value > 0); + return handle_if(pp, (negate ? !result : result)); +} + +static int eval_include(yasm_preproc_gas *pp, int unused, const char *arg1) +{ + char *current_filename; + char filename[MAXPATHLEN]; + char *line; + int num_lines; + FILE *file; + buffered_line *prev_bline; + included_file *inc_file; + + if (unquote(arg1, filename, sizeof(filename), '"', '\0', NULL) < 0) { + yasm_error_set(YASM_ERROR_SYNTAX, N_("string expected")); + yasm_errwarn_propagate(pp->errwarns, yasm_linemap_get_current(pp->cur_lm)); + return 0; + } + + if (SLIST_EMPTY(&pp->included_files)) { + current_filename = pp->in_filename; + } else { + current_filename = SLIST_FIRST(&pp->included_files)->filename; + } + file = yasm_fopen_include(filename, current_filename, "r", NULL); + if (!file) { + yasm_error_set(YASM_ERROR_SYNTAX, N_("unable to open included file \"%s\""), filename); + yasm_errwarn_propagate(pp->errwarns, yasm_linemap_get_current(pp->cur_lm)); + return 0; + } + + num_lines = 0; + prev_bline = NULL; + line = read_line_from_file(pp, file); + while (line) { + buffered_line *bline = yasm_xmalloc(sizeof(buffered_line)); + bline->line = line; + if (prev_bline) { + SLIST_INSERT_AFTER(prev_bline, bline, next); + } else { + SLIST_INSERT_HEAD(&pp->buffered_lines, bline, next); + } + prev_bline = bline; + line = read_line_from_file(pp, file); + num_lines++; + } + + inc_file = yasm_xmalloc(sizeof(included_file)); + inc_file->filename = yasm__xstrdup(filename); + inc_file->lines_remaining = num_lines; + SLIST_INSERT_HEAD(&pp->included_files, inc_file, next); + return 1; +} + +static int eval_set(yasm_preproc_gas *pp, int allow_redefine, const char *name, const char *value) +{ + if (!pp->skip_depth) { + yasm_intnum *num = yasm_intnum_create_int(eval_expr(pp, value)); + yasm_expr *expr = yasm_expr_create_ident(yasm_expr_int(num), 0); + yasm_symrec *rec = yasm_symtab_get(pp->defines, name); + if (rec) { + if (!allow_redefine) { + yasm_error_set(YASM_ERROR_SYNTAX, N_("symbol \"%s\" is already defined"), name); + yasm_errwarn_propagate(pp->errwarns, yasm_linemap_get_current(pp->cur_lm)); + return 0; + } + /* TODO */ + yasm_error_set(YASM_ERROR_SYNTAX, N_("redefining symbols not yet implimented"), name); + yasm_errwarn_propagate(pp->errwarns, yasm_linemap_get_current(pp->cur_lm)); + return 0; + } else { + yasm_symtab_define_equ(pp->defines, name, expr, 0); + } + } + return 1; +} + +static int eval_rept(yasm_preproc_gas *pp, int unused, const char *arg1) +{ + long i, n = eval_expr(pp, arg1); + long num_lines = 0; + char *line = read_line(pp); + buffered_line *prev_bline = NULL; + SLIST_HEAD(buffered_lines_head, buffered_line) lines; + + SLIST_INIT(&lines); + + while (line) { + skip_whitespace2(&line); + if (!strncmp(line, ".endr", 4)) { + for (i = 0; i < n; i++) { + buffered_line *current_line; + prev_bline = NULL; + SLIST_FOREACH(current_line, &lines, next) { + buffered_line *bline = yasm_xmalloc(sizeof(buffered_line)); + bline->line = yasm__xstrdup(current_line->line); + if (prev_bline) { + SLIST_INSERT_AFTER(prev_bline, bline, next); + } else { + SLIST_INSERT_HEAD(&pp->buffered_lines, bline, next); + } + prev_bline = bline; + } + } + if (!SLIST_EMPTY(&pp->included_files)) { + included_file *inc_file = SLIST_FIRST(&pp->included_files); + inc_file->lines_remaining += n * num_lines; + } + while (!SLIST_EMPTY(&lines)) { + buffered_line *bline = SLIST_FIRST(&lines); + SLIST_REMOVE_HEAD(&lines, next); + yasm_xfree(bline->line); + yasm_xfree(bline); + } + yasm_xfree(line); + return 1; + } + if (n > 0) { + buffered_line *bline = yasm_xmalloc(sizeof(buffered_line)); + bline->line = line; + if (prev_bline) { + SLIST_INSERT_AFTER(prev_bline, bline, next); + } else { + SLIST_INSERT_HEAD(&lines, bline, next); + } + prev_bline = bline; + } else { + yasm_xfree(line); + } + line = read_line(pp); + num_lines++; + } + yasm_error_set(YASM_ERROR_SYNTAX, N_("unexpected EOF in \".rept\" block")); + yasm_errwarn_propagate(pp->errwarns, yasm_linemap_get_current(pp->cur_lm)); + return 0; +} + +static int eval_endr(yasm_preproc_gas *pp, int unused) +{ + yasm_error_set(YASM_ERROR_SYNTAX, N_("\".endr\" without \".rept\"")); + yasm_errwarn_propagate(pp->errwarns, yasm_linemap_get_current(pp->cur_lm)); + return 0; +} + +/* Top-level line processing. */ + +typedef int (*pp_fn0_t)(yasm_preproc_gas *pp, int param); +typedef int (*pp_fn1_t)(yasm_preproc_gas *pp, int param, const char *arg1); +typedef int (*pp_fn2_t)(yasm_preproc_gas *pp, int param, const char *arg1, const char *arg2); + +#define FN(f) ((pp_fn0_t) &(f)) + +static int process_line(yasm_preproc_gas *pp, const char *line) +{ + size_t i; + struct { + const char *name; + int nargs; + pp_fn0_t fn; + int param; + } directives[] = { + {"else", 0, FN(eval_else), 0}, + {"elseif", 1, FN(eval_elseif), 0}, + {"endif", 0, FN(eval_endif), 0}, + {"if", 1, FN(eval_if), 0}, + {"ifb", 1, FN(eval_ifb), 0}, + {"ifc", 1, FN(eval_ifc), 0}, + {"ifdef", 1, FN(eval_ifdef), 0}, + {"ifeq", 1, FN(eval_if), 1}, + {"ifeqs", 1, FN(eval_ifeqs), 0}, + {"ifge", 1, FN(eval_ifge), 0}, + {"ifgt", 1, FN(eval_ifgt), 0}, + {"ifle", 1, FN(eval_ifgt), 1}, + {"iflt", 1, FN(eval_ifge), 1}, + {"ifnb", 1, FN(eval_ifb), 1}, + {"ifnc", 1, FN(eval_ifc), 1}, + {"ifndef", 1, FN(eval_ifdef), 1}, + {"ifnotdef", 1, FN(eval_ifdef), 1}, + {"ifne", 1, FN(eval_if), 0}, + {"ifnes", 1, FN(eval_ifeqs), 1}, + {"include", 1, FN(eval_include), 0}, + {"set", 2, FN(eval_set), 1}, + {"equ", 2, FN(eval_set), 1}, + {"equiv", 2, FN(eval_set), 0}, + {"rept", 1, FN(eval_rept), 0}, + {"endr", 1, FN(eval_endr), 0}, + }; + + for (i = 0; i < sizeof(directives)/sizeof(directives[0]); i++) { + char buf1[1024]; + const char *remainder = matches(line, directives[i].name); + + if (remainder) { + if (pp->skip_depth && !strncmp("if", directives[i].name, 2)) { + pp->skip_depth++; + return FALSE; + } else if (directives[i].nargs == 0) { + pp_fn0_t fn = (pp_fn0_t) directives[i].fn; + pp->fatal_error = !fn(pp, directives[i].param); + return FALSE; + } else if (directives[i].nargs == 1) { + pp_fn1_t fn = (pp_fn1_t) directives[i].fn; + skip_whitespace(&remainder); + pp->fatal_error = !fn(pp, directives[i].param, remainder); + return FALSE; + } else if (directives[i].nargs == 2) { + remainder = get_arg(pp, remainder, buf1, sizeof(buf1)); + if (!remainder || !*remainder || !*buf1) { + yasm_error_set(YASM_ERROR_SYNTAX, N_("\".%s\" expects two arguments"), directives[i].name); + yasm_errwarn_propagate(pp->errwarns, yasm_linemap_get_current(pp->cur_lm)); + pp->fatal_error = 1; + } else { + pp_fn2_t fn = (pp_fn2_t) directives[i].fn; + pp->fatal_error = !fn(pp, directives[i].param, buf1, remainder); + } + return FALSE; + } + } + } + + return (pp->skip_depth == 0); +} + +/* Functions exported by the preprocessor. */ + +static yasm_preproc * +gas_preproc_create(const char *in_filename, yasm_symtab *symtab, + yasm_linemap *lm, yasm_errwarns *errwarns) +{ + FILE *f; + yasm_preproc_gas *pp = yasm_xmalloc(sizeof(yasm_preproc_gas)); + + if (strcmp(in_filename, "-") != 0) { + f = fopen(in_filename, "r"); + if (!f) { + yasm__fatal(N_("Could not open input file")); + } + } else { + f = stdin; + } + + pp->preproc.module = &yasm_gas_LTX_preproc; + pp->in = f; + pp->in_filename = yasm__xstrdup(in_filename); + pp->defines = yasm_symtab_create(); + yasm_symtab_set_case_sensitive(pp->defines, 1); + pp->depth = 0; + pp->skip_depth = 0; + SLIST_INIT(&pp->buffered_lines); + SLIST_INIT(&pp->included_files); + pp->cur_lm = lm; + pp->errwarns = errwarns; + pp->fatal_error = 0; + + return (yasm_preproc *) pp; +} + +static void +gas_preproc_destroy(yasm_preproc *preproc) +{ + yasm_preproc_gas *pp = (yasm_preproc_gas *) preproc; + yasm_xfree(pp->in_filename); + yasm_symtab_destroy(pp->defines); + while (!SLIST_EMPTY(&pp->buffered_lines)) { + buffered_line *bline = SLIST_FIRST(&pp->buffered_lines); + SLIST_REMOVE_HEAD(&pp->buffered_lines, next); + yasm_xfree(bline->line); + yasm_xfree(bline); + } + while (!SLIST_EMPTY(&pp->included_files)) { + included_file *inc_file = SLIST_FIRST(&pp->included_files); + SLIST_REMOVE_HEAD(&pp->included_files, next); + yasm_xfree(inc_file->filename); + yasm_xfree(inc_file); + } + yasm_xfree(preproc); +} + +static char * +gas_preproc_get_line(yasm_preproc *preproc) +{ + yasm_preproc_gas *pp = (yasm_preproc_gas *)preproc; + int done = FALSE; + char *line = NULL; + + do { + if (line != NULL) { + yasm_xfree(line); + } + if (pp->fatal_error) { + return NULL; + } + line = read_line(pp); + if (line == NULL) { + return NULL; + } + done = process_line(pp, line); + } while (!done); + + return line; +} + +static size_t +gas_preproc_get_included_file(yasm_preproc *preproc, char *buf, + size_t max_size) +{ + /* TODO */ + return 0; +} + +static void +gas_preproc_add_include_file(yasm_preproc *preproc, const char *filename) +{ + yasm_preproc_gas *pp = (yasm_preproc_gas *) preproc; + eval_include(pp, 0, filename); +} + +static void +gas_preproc_predefine_macro(yasm_preproc *preproc, const char *macronameval) +{ + yasm_preproc_gas *pp = (yasm_preproc_gas *) preproc; + const char *eq = strstr(macronameval, "="); + char *name, *value; + if (eq) { + value = yasm__xstrdup(eq + 1); + name = yasm_xmalloc(eq - macronameval + 1); + memcpy(name, macronameval, eq - macronameval); + name[eq - macronameval] = '\0'; + } else { + name = yasm__xstrdup(macronameval); + value = yasm__xstrdup(""); + } + eval_set(pp, 1, name, value); + yasm_xfree(name); + yasm_xfree(value); +} + +static void +gas_preproc_undefine_macro(yasm_preproc *preproc, const char *macroname) +{ + /* TODO */ +} + +static void +gas_preproc_define_builtin(yasm_preproc *preproc, const char *macronameval) +{ + /* TODO */ +} + +static void +gas_preproc_add_standard(yasm_preproc *preproc, const char **macros) +{ + /* TODO */ +} + + +/* Define preproc structure -- see preproc.h for details */ +yasm_preproc_module yasm_gas_LTX_preproc = { + "GAS Preprocessor", + "gas", + gas_preproc_create, + gas_preproc_destroy, + gas_preproc_get_line, + gas_preproc_get_included_file, + gas_preproc_add_include_file, + gas_preproc_predefine_macro, + gas_preproc_undefine_macro, + gas_preproc_define_builtin, + gas_preproc_add_standard +}; diff --git a/modules/preprocs/gas/tests/Makefile.inc b/modules/preprocs/gas/tests/Makefile.inc new file mode 100644 index 00000000..c2a07c2e --- /dev/null +++ b/modules/preprocs/gas/tests/Makefile.inc @@ -0,0 +1,7 @@ +# $Id$ + +#TESTS += modules/preprocs/gas/tests/rawpp_test.sh + +#EXTRA_DIST += modules/preprocs/gas/tests/rawpp_test.sh +#EXTRA_DIST += modules/preprocs/gas/tests/longline.asm +#EXTRA_DIST += modules/preprocs/gas/tests/longline.hex diff --git a/po/POTFILES.in b/po/POTFILES.in index 4cb66b12..bdea54fd 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -55,6 +55,8 @@ modules/parsers/gas/gas-token.re modules/parsers/nasm/nasm-parse.c modules/parsers/nasm/nasm-token.re modules/preprocs/cpp/cpp-preproc.c +modules/preprocs/gas/gas-preproc.c +modules/preprocs/gas/gas-eval.c modules/preprocs/nasm/nasm-preproc.c modules/preprocs/nasm/nasm-pp.c modules/preprocs/raw/raw-preproc.c From b0fb3fd160db2ab44bb1ccf3e187441b83164218 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 26 Dec 2009 04:26:46 +0000 Subject: [PATCH 299/585] Default to gas preproc for gas parser. svn path=/trunk/yasm/; revision=2244 --- modules/parsers/gas/gas-parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/parsers/gas/gas-parser.c b/modules/parsers/gas/gas-parser.c index 64a10c20..2e285c2c 100644 --- a/modules/parsers/gas/gas-parser.c +++ b/modules/parsers/gas/gas-parser.c @@ -126,7 +126,7 @@ yasm_parser_module yasm_gas_LTX_parser = { "GNU AS (GAS)-compatible parser", "gas", gas_parser_preproc_keywords, - "raw", + "gas", NULL, /* No standard macros */ gas_parser_do_parse }; From 9f471a9ba9253fcc476cc744a25415526de83020 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 26 Dec 2009 04:28:40 +0000 Subject: [PATCH 300/585] nasm-pp.c: Use vsnprintf if available. Patch contributed by: Alexei Svitkine svn path=/trunk/yasm/; revision=2245 --- modules/preprocs/nasm/nasm-pp.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/preprocs/nasm/nasm-pp.c b/modules/preprocs/nasm/nasm-pp.c index 64733557..5762e9d3 100644 --- a/modules/preprocs/nasm/nasm-pp.c +++ b/modules/preprocs/nasm/nasm-pp.c @@ -4673,8 +4673,8 @@ expand_mmacro(Token * tline) } /* - * Since preprocessor always operate only on the line that didn't - * arrived yet, we should always use ERR_OFFBY1. Also since user + * Since preprocessor always operates only on the line that didn't + * arrive yet, we should always use ERR_OFFBY1. Also since user * won't want to see same error twice (preprocessing is done once * per pass) we will want to show errors only during pass one. */ @@ -4689,7 +4689,11 @@ error(int severity, const char *fmt, ...) return; va_start(arg, fmt); +#ifdef HAVE_VSNPRINTF + vsnprintf(buff, sizeof(buff), fmt, arg); +#else vsprintf(buff, fmt, arg); +#endif va_end(arg); if (istk && istk->mstk && istk->mstk->name) From 7a6e9cb4304d0dcd9ecbc50ebd79588adcae58f8 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 26 Dec 2009 04:30:39 +0000 Subject: [PATCH 301/585] Update gas preproc a bit: - Handle removal of comments during preprocessing - Fix a bug with evaluation of nested .if/.else statements. Contributed by: Alexei Svitkine svn path=/trunk/yasm/; revision=2246 --- modules/preprocs/gas/gas-preproc.c | 55 ++++++++++++++++++++++-------- 1 file changed, 41 insertions(+), 14 deletions(-) diff --git a/modules/preprocs/gas/gas-preproc.c b/modules/preprocs/gas/gas-preproc.c index 729aeaec..1ae0d4aa 100644 --- a/modules/preprocs/gas/gas-preproc.c +++ b/modules/preprocs/gas/gas-preproc.c @@ -61,7 +61,7 @@ typedef struct yasm_preproc_gas { int depth; int skip_depth; - const char *expr_string; + char *expr_string; char *expr_symbol; int expr_string_cursor; @@ -388,7 +388,7 @@ static long eval_expr(yasm_preproc_gas *pp, const char *arg1) tv.t_type = TOKEN_INVALID; pp->expr_symbol = NULL; - pp->expr_string = arg1; + pp->expr_string = (char *) arg1; pp->expr_string_cursor = 0; expr = evaluate(gas_scan, pp, &tv, pp, CRITICAL, gas_err, pp->defines); intn = yasm_expr_get_intnum(&expr, 0); @@ -419,9 +419,7 @@ static int handle_if(yasm_preproc_gas *pp, int is_true) static int handle_endif(yasm_preproc_gas *pp) { - if (pp->skip_depth) { - pp->skip_depth--; - } else if (pp->depth) { + if (pp->depth) { pp->depth--; } else { yasm_error_set(YASM_ERROR_SYNTAX, N_("\".endif\" without \".if\"")); @@ -433,14 +431,11 @@ static int handle_endif(yasm_preproc_gas *pp) static int handle_else(yasm_preproc_gas *pp, int is_elseif) { - if (pp->skip_depth == 1) { - pp->skip_depth = 0; - pp->depth++; - } else if (!pp->depth) { + if (!pp->depth) { yasm_error_set(YASM_ERROR_SYNTAX, N_("\".%s\" without \".if\""), is_elseif ? "elseif" : "else"); yasm_errwarn_propagate(pp->errwarns, yasm_linemap_get_current(pp->cur_lm)); return 0; - } else if (!pp->skip_depth) { + } else { pp->skip_depth = 1; } return 1; @@ -701,7 +696,24 @@ typedef int (*pp_fn2_t)(yasm_preproc_gas *pp, int param, const char *arg1, const #define FN(f) ((pp_fn0_t) &(f)) -static int process_line(yasm_preproc_gas *pp, const char *line) +static void kill_comments(yasm_preproc_gas *pp, char *line) +{ + char *cstart = strstr(line, "/*"); + while (cstart) { + char *cend = strstr(cstart + 2, "*/"); + + if (!cend) { + yasm_error_set(YASM_ERROR_SYNTAX, N_("unterminated comment")); + yasm_errwarn_propagate(pp->errwarns, yasm_linemap_get_current(pp->cur_lm)); + return; + } + + strcpy(cstart, cend + 2); + cstart = strstr(cstart, "/*"); + } +} + +static int process_line(yasm_preproc_gas *pp, char *line) { size_t i; struct { @@ -737,13 +749,28 @@ static int process_line(yasm_preproc_gas *pp, const char *line) {"endr", 1, FN(eval_endr), 0}, }; + kill_comments(pp, line); + skip_whitespace2(&line); + if (*line == '\0') { + return FALSE; + } + for (i = 0; i < sizeof(directives)/sizeof(directives[0]); i++) { char buf1[1024]; const char *remainder = matches(line, directives[i].name); if (remainder) { - if (pp->skip_depth && !strncmp("if", directives[i].name, 2)) { - pp->skip_depth++; + if (pp->skip_depth) { + if (!strncmp("if", directives[i].name, 2)) { + pp->skip_depth++; + } else if (!strcmp("endif", directives[i].name)) { + pp->skip_depth--; + } else if (!strcmp("else", directives[i].name)) { + if (pp->skip_depth == 1) { + pp->skip_depth = 0; + pp->depth++; + } + } return FALSE; } else if (directives[i].nargs == 0) { pp_fn0_t fn = (pp_fn0_t) directives[i].fn; @@ -907,7 +934,7 @@ gas_preproc_add_standard(yasm_preproc *preproc, const char **macros) /* Define preproc structure -- see preproc.h for details */ yasm_preproc_module yasm_gas_LTX_preproc = { - "GAS Preprocessor", + "GNU AS (GAS)-compatible preprocessor", "gas", gas_preproc_create, gas_preproc_destroy, From a530673198e06fa13441207b488f2cdd9c71c1cb Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 26 Dec 2009 04:38:27 +0000 Subject: [PATCH 302/585] gas-preproc.c: Avoid casting away of const. svn path=/trunk/yasm/; revision=2247 --- modules/preprocs/gas/gas-preproc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/preprocs/gas/gas-preproc.c b/modules/preprocs/gas/gas-preproc.c index 1ae0d4aa..b6f01143 100644 --- a/modules/preprocs/gas/gas-preproc.c +++ b/modules/preprocs/gas/gas-preproc.c @@ -61,7 +61,7 @@ typedef struct yasm_preproc_gas { int depth; int skip_depth; - char *expr_string; + const char *expr_string; char *expr_symbol; int expr_string_cursor; @@ -388,7 +388,7 @@ static long eval_expr(yasm_preproc_gas *pp, const char *arg1) tv.t_type = TOKEN_INVALID; pp->expr_symbol = NULL; - pp->expr_string = (char *) arg1; + pp->expr_string = arg1; pp->expr_string_cursor = 0; expr = evaluate(gas_scan, pp, &tv, pp, CRITICAL, gas_err, pp->defines); intn = yasm_expr_get_intnum(&expr, 0); From 27e105a07fead52cf6a731183136c1130097f199 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 26 Dec 2009 04:41:21 +0000 Subject: [PATCH 303/585] Fix --preproc-only (and possibly other long options) by avoiding false matches on shorter long argument names. Contributed by: Alexei Svitkine svn path=/trunk/yasm/; revision=2248 --- frontends/yasm/yasm-options.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontends/yasm/yasm-options.c b/frontends/yasm/yasm-options.c index 87f6e240..48c8c56d 100644 --- a/frontends/yasm/yasm-options.c +++ b/frontends/yasm/yasm-options.c @@ -28,6 +28,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include +#include /*@unused@*/ RCSID("$Id$"); #include "yasm-options.h" @@ -69,10 +70,15 @@ parse_cmdline(int argc, char **argv, opt_option *options, size_t nopts, } for (i = 0; i < nopts; i++) { + size_t optlen; if (options[i].lopt && strncmp(&argv[0][2], options[i].lopt, - strlen(options[i].lopt)) == 0) { + (optlen = strlen(options[i].lopt))) == 0) { char *param; + char c = argv[0][2 + optlen]; + + if (c != '\0' && c != '=' && !isspace(c)) + continue; if (options[i].takes_param) { param = strchr(&argv[0][2], '='); From ba15a13ef02e6eb7c1908c90c5117726472a92e1 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Mon, 28 Dec 2009 04:40:30 +0000 Subject: [PATCH 304/585] Fix incorrect vaesimc encoding (need to set VEX.vvvv=1111). Reported by: Gil Dabah svn path=/trunk/yasm/; revision=2249 --- modules/arch/x86/gen_x86_insn.py | 2 +- modules/arch/x86/tests/aes.hex | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index 40147358..91889ac0 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -6649,7 +6649,7 @@ add_group("aesimc", modifiers=["Op1Add", "Op2Add", "SetVEX"], prefix=0x66, opcode=[0x0F, 0x00, 0x00], - operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) add_insn("aesimc", "aesimc", modifiers=[0x38, 0xDB]) diff --git a/modules/arch/x86/tests/aes.hex b/modules/arch/x86/tests/aes.hex index 5396dee7..6583be83 100644 --- a/modules/arch/x86/tests/aes.hex +++ b/modules/arch/x86/tests/aes.hex @@ -215,17 +215,17 @@ db 08 c4 e2 -71 +79 db ca c4 e2 -71 +79 db 08 c4 e2 -71 +79 db 08 66 From f7ba1c66479a1fd6a2f941d7a03f27aaee2aae17 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Mon, 28 Dec 2009 05:23:46 +0000 Subject: [PATCH 305/585] Revert gas parser default to raw preproc until gas tests pass with the gas preproc. svn path=/trunk/yasm/; revision=2250 --- modules/parsers/gas/gas-parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/parsers/gas/gas-parser.c b/modules/parsers/gas/gas-parser.c index 2e285c2c..241c067a 100644 --- a/modules/parsers/gas/gas-parser.c +++ b/modules/parsers/gas/gas-parser.c @@ -126,7 +126,7 @@ yasm_parser_module yasm_gas_LTX_parser = { "GNU AS (GAS)-compatible parser", "gas", gas_parser_preproc_keywords, - "gas", + "raw", NULL, /* No standard macros */ gas_parser_do_parse }; @@ -134,7 +134,7 @@ yasm_parser_module yasm_gnu_LTX_parser = { "GNU AS (GAS)-compatible parser", "gnu", gas_parser_preproc_keywords, - "gas", + "raw", NULL, /* No standard macros */ gas_parser_do_parse }; From 3888758ce322ce23a3922a3564575cda4cb1783c Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 29 Dec 2009 06:18:25 +0000 Subject: [PATCH 306/585] Avoid generating duplicate 66h prefix on PINSRB in 16-bit mode. Reported by: Gil Dabah svn path=/trunk/yasm/; revision=2251 --- modules/arch/x86/gen_x86_insn.py | 2 -- modules/arch/x86/tests/Makefile.inc | 2 ++ modules/arch/x86/tests/pinsrb.asm | 6 ++++++ modules/arch/x86/tests/pinsrb.hex | 18 ++++++++++++++++++ 4 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 modules/arch/x86/tests/pinsrb.asm create mode 100644 modules/arch/x86/tests/pinsrb.hex diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index 91889ac0..187c0721 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -5921,7 +5921,6 @@ add_group("pinsrb", add_group("pinsrb", cpu=["SSE41"], modifiers=["SetVEX"], - opersize=32, prefix=0x66, opcode=[0x0F, 0x3A, 0x20], operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), @@ -5939,7 +5938,6 @@ add_group("pinsrb", add_group("pinsrb", cpu=["AVX"], vex=128, - opersize=32, prefix=0x66, opcode=[0x0F, 0x3A, 0x20], operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), diff --git a/modules/arch/x86/tests/Makefile.inc b/modules/arch/x86/tests/Makefile.inc index 1a6391ea..7ea7ced1 100644 --- a/modules/arch/x86/tests/Makefile.inc +++ b/modules/arch/x86/tests/Makefile.inc @@ -135,6 +135,8 @@ EXTRA_DIST += modules/arch/x86/tests/overflow.errwarn EXTRA_DIST += modules/arch/x86/tests/overflow.hex EXTRA_DIST += modules/arch/x86/tests/padlock.asm EXTRA_DIST += modules/arch/x86/tests/padlock.hex +EXTRA_DIST += modules/arch/x86/tests/pinsrb.asm +EXTRA_DIST += modules/arch/x86/tests/pinsrb.hex EXTRA_DIST += modules/arch/x86/tests/pshift.asm EXTRA_DIST += modules/arch/x86/tests/pshift.hex EXTRA_DIST += modules/arch/x86/tests/push64.asm diff --git a/modules/arch/x86/tests/pinsrb.asm b/modules/arch/x86/tests/pinsrb.asm new file mode 100644 index 00000000..7ee059d7 --- /dev/null +++ b/modules/arch/x86/tests/pinsrb.asm @@ -0,0 +1,6 @@ +[bits 16] +pinsrb xmm4, eax, 0x55 +[bits 32] +pinsrb xmm4, eax, 0x55 +[bits 64] +pinsrb xmm4, eax, 0x55 diff --git a/modules/arch/x86/tests/pinsrb.hex b/modules/arch/x86/tests/pinsrb.hex new file mode 100644 index 00000000..27e71a9e --- /dev/null +++ b/modules/arch/x86/tests/pinsrb.hex @@ -0,0 +1,18 @@ +66 +0f +3a +20 +e0 +55 +66 +0f +3a +20 +e0 +55 +66 +0f +3a +20 +e0 +55 From 65b18427f41294fef3193c4a5ed794d3a17c1e2a Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 30 Dec 2009 06:21:24 +0000 Subject: [PATCH 307/585] Unbreak python bindings on 64-bit Linux. svn path=/trunk/yasm/; revision=2252 --- tools/python-yasm/Makefile.inc | 4 ++-- tools/python-yasm/setup.py | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/tools/python-yasm/Makefile.inc b/tools/python-yasm/Makefile.inc index b4275586..ed816cfa 100644 --- a/tools/python-yasm/Makefile.inc +++ b/tools/python-yasm/Makefile.inc @@ -50,13 +50,13 @@ CLEANFILES += yasm_python.c # Now the Python build magic... python-setup.txt: Makefile echo "includes=${DEFS} ${DEFAULT_INCLUDES} ${INCLUDES} ${AM_CPPFLAGS} ${CPPFLAGS}" > python-setup.txt - echo "sources=${libyasm_a_SOURCES}" >> python-setup.txt + echo "sources=${libyasm_a_SOURCES} ${nodist_libyasm_a_SOURCES}" >> python-setup.txt echo "srcdir=${srcdir}" >> python-setup.txt echo "gcc=${GCC}" >> python-setup.txt CLEANFILES += python-setup.txt -.python-build: python-setup.txt yasm_python.c ${libyasm_a_SOURCES} +.python-build: python-setup.txt yasm_python.c ${libyasm_a_SOURCES} ${nodist_libyasm_a_SOURCES} $(PYTHON) `test -f tools/python-yasm/setup.py || echo '$(srcdir)/'`tools/python-yasm/setup.py build touch .python-build python-build: .python-build diff --git a/tools/python-yasm/setup.py b/tools/python-yasm/setup.py index 60e2364d..0633fd3e 100644 --- a/tools/python-yasm/setup.py +++ b/tools/python-yasm/setup.py @@ -52,8 +52,6 @@ def ParseSources(src, srcdir): for tok in src.split(): if tok.endswith(".c"): fn = tok - elif tok.endswith(".y"): - fn = basename(tok)[:-2] + ".c" else: continue if not exists(fn): @@ -74,8 +72,6 @@ def RunSetup(incldir, cppflags, sources): sources=sources, extra_compile_args=cppflags, include_dirs=incldir, - library_dirs=['.'], - libraries=['yasm'], ), ], cmdclass = dict(build_ext=build_ext), From b70e2373f75585edca75a1a3736cc049b9a9bdbb Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 1 Jan 2010 20:47:58 +0000 Subject: [PATCH 308/585] yasm_intnum_create_sized(): Fix off-by-one error in sign extension check. svn path=/trunk/yasm/; revision=2253 --- libyasm/intnum.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libyasm/intnum.c b/libyasm/intnum.c index e39eb26f..625349c6 100644 --- a/libyasm/intnum.c +++ b/libyasm/intnum.c @@ -385,7 +385,7 @@ yasm_intnum_create_sized(unsigned char *ptr, int sign, size_t srcsize, } /* Sign extend if needed */ - if (srcsize*8 < BITVECT_NATIVE_SIZE && sign && (ptr[i] & 0x80) == 0x80) + if (srcsize*8 < BITVECT_NATIVE_SIZE && sign && (ptr[i-1] & 0x80) == 0x80) BitVector_Interval_Fill(conv_bv, i*8, BITVECT_NATIVE_SIZE-1); intnum_frombv(intn, conv_bv); From 4df9f87323a12af47df42c6847ceaa1b9689eea0 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 1 Jan 2010 20:52:25 +0000 Subject: [PATCH 309/585] All Pyrex files: Use __cinit__ instead of __new__ in extension classes. svn path=/trunk/yasm/; revision=2254 --- tools/python-yasm/bytecode.pxi | 2 +- tools/python-yasm/expr.pxi | 2 +- tools/python-yasm/floatnum.pxi | 2 +- tools/python-yasm/intnum.pxi | 2 +- tools/python-yasm/symrec.pxi | 10 +++++----- tools/python-yasm/value.pxi | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tools/python-yasm/bytecode.pxi b/tools/python-yasm/bytecode.pxi index 193e3a6c..34aeaa57 100644 --- a/tools/python-yasm/bytecode.pxi +++ b/tools/python-yasm/bytecode.pxi @@ -28,7 +28,7 @@ cdef class Bytecode: cdef object __weakref__ # make weak-referenceable - def __new__(self, bc): + def __cinit__(self, bc): self.bc = NULL if PyCObject_Check(bc): self.bc = __get_voidp(bc, Bytecode) diff --git a/tools/python-yasm/expr.pxi b/tools/python-yasm/expr.pxi index dea75d78..995a46ad 100644 --- a/tools/python-yasm/expr.pxi +++ b/tools/python-yasm/expr.pxi @@ -59,7 +59,7 @@ cdef object __make_expression(yasm_expr *expr): cdef class Expression: cdef yasm_expr *expr - def __new__(self, op, *args, **kwargs): + def __cinit__(self, op, *args, **kwargs): self.expr = NULL if isinstance(op, Expression): diff --git a/tools/python-yasm/floatnum.pxi b/tools/python-yasm/floatnum.pxi index 3939056f..b7bfbc30 100644 --- a/tools/python-yasm/floatnum.pxi +++ b/tools/python-yasm/floatnum.pxi @@ -25,7 +25,7 @@ cdef class FloatNum: cdef yasm_floatnum *flt - def __new__(self, value): + def __cinit__(self, value): self.flt = NULL if isinstance(value, FloatNum): self.flt = yasm_floatnum_copy((value).flt) diff --git a/tools/python-yasm/intnum.pxi b/tools/python-yasm/intnum.pxi index f99769e6..0b469b89 100644 --- a/tools/python-yasm/intnum.pxi +++ b/tools/python-yasm/intnum.pxi @@ -57,7 +57,7 @@ cdef object __make_intnum(yasm_intnum *intn): cdef class IntNum: cdef yasm_intnum *intn - def __new__(self, value, base=None): + def __cinit__(self, value, base=None): cdef unsigned char buf[16] self.intn = NULL diff --git a/tools/python-yasm/symrec.pxi b/tools/python-yasm/symrec.pxi index d91fe7f5..404ffe97 100644 --- a/tools/python-yasm/symrec.pxi +++ b/tools/python-yasm/symrec.pxi @@ -26,7 +26,7 @@ cdef class Symbol: cdef yasm_symrec *sym - def __new__(self, symrec): + def __cinit__(self, symrec): self.sym = NULL if PyCObject_Check(symrec): self.sym = __get_voidp(symrec, Symbol) @@ -124,7 +124,7 @@ cdef class SymbolTable cdef class SymbolTableKeyIterator: cdef yasm_symtab_iter *iter - def __new__(self, symtab): + def __cinit__(self, symtab): if not isinstance(symtab, SymbolTable): raise TypeError self.iter = yasm_symtab_first((symtab).symtab) @@ -142,7 +142,7 @@ cdef class SymbolTableKeyIterator: cdef class SymbolTableValueIterator: cdef yasm_symtab_iter *iter - def __new__(self, symtab): + def __cinit__(self, symtab): if not isinstance(symtab, SymbolTable): raise TypeError self.iter = yasm_symtab_first((symtab).symtab) @@ -160,7 +160,7 @@ cdef class SymbolTableValueIterator: cdef class SymbolTableItemIterator: cdef yasm_symtab_iter *iter - def __new__(self, symtab): + def __cinit__(self, symtab): if not isinstance(symtab, SymbolTable): raise TypeError self.iter = yasm_symtab_first((symtab).symtab) @@ -190,7 +190,7 @@ cdef int __parse_vis(vis) except -1: cdef class SymbolTable: cdef yasm_symtab *symtab - def __new__(self): + def __cinit__(self): self.symtab = yasm_symtab_create() def __dealloc__(self): diff --git a/tools/python-yasm/value.pxi b/tools/python-yasm/value.pxi index f2328dd4..5d78c054 100644 --- a/tools/python-yasm/value.pxi +++ b/tools/python-yasm/value.pxi @@ -25,7 +25,7 @@ cdef class Value: cdef yasm_value value - def __new__(self, value=None, size=None): + def __cinit__(self, value=None, size=None): cdef unsigned int sz if size is None: sz = 0 From f608f67ad258a7802a674809f2e5472c7651aef9 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 1 Jan 2010 20:54:15 +0000 Subject: [PATCH 310/585] Some minor Pyrex fixes: - Don't return self in IntNum.__abs__ (return a copy instead). - yasm_sym_status enum values have YASM_ prefixes. svn path=/trunk/yasm/; revision=2255 --- tools/python-yasm/intnum.pxi | 2 +- tools/python-yasm/symrec.pxi | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/python-yasm/intnum.pxi b/tools/python-yasm/intnum.pxi index 0b469b89..320ca1b0 100644 --- a/tools/python-yasm/intnum.pxi +++ b/tools/python-yasm/intnum.pxi @@ -115,7 +115,7 @@ cdef class IntNum: def __neg__(self): return __intnum_op(self, YASM_EXPR_NEG, None) def __pos__(self): return self def __abs__(self): - if yasm_intnum_sign(self.intn) >= 0: return self + if yasm_intnum_sign(self.intn) >= 0: return IntNum(self) else: return __intnum_op(self, YASM_EXPR_NEG, None) def __nonzero__(self): return not yasm_intnum_is_zero(self.intn) def __invert__(self): return __intnum_op(self, YASM_EXPR_NOT, None) diff --git a/tools/python-yasm/symrec.pxi b/tools/python-yasm/symrec.pxi index 404ffe97..eb56ccf0 100644 --- a/tools/python-yasm/symrec.pxi +++ b/tools/python-yasm/symrec.pxi @@ -43,15 +43,15 @@ cdef class Symbol: cdef yasm_sym_status status s = set() status = yasm_symrec_get_status(self.sym) - if status & SYM_USED: s.add('used') - if status & SYM_DEFINED: s.add('defined') - if status & SYM_VALUED: s.add('valued') + if status & YASM_SYM_USED: s.add('used') + if status & YASM_SYM_DEFINED: s.add('defined') + if status & YASM_SYM_VALUED: s.add('valued') return s property in_table: def __get__(self): return bool(yasm_symrec_get_status(self.sym) & - SYM_NOTINTABLE) + YASM_SYM_NOTINTABLE) property visibility: def __get__(self): From fcb228f18cd5c1286e79ff3d0e7b6a299df76fc6 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 1 Jan 2010 20:55:07 +0000 Subject: [PATCH 311/585] Use Cython instead of Pyrex. svn path=/trunk/yasm/; revision=2256 --- configure.ac | 16 ++++++++-------- m4/cython.m4 | 17 +++++++++++++++++ m4/pyrex.m4 | 17 ----------------- tools/python-yasm/Makefile.inc | 4 ++-- tools/python-yasm/setup.py | 2 +- 5 files changed, 28 insertions(+), 28 deletions(-) create mode 100644 m4/cython.m4 delete mode 100644 m4/pyrex.m4 diff --git a/configure.ac b/configure.ac index 40d99510..7883dc47 100644 --- a/configure.ac +++ b/configure.ac @@ -280,31 +280,31 @@ else fi # Detect if we can build Python bindings -# (needs Python, Python headers, and Pyrex) +# (needs Python, Python headers, and Cython) if test x$enable_python_bindings = xno; then have_python_bindings=no else AC_MSG_NOTICE([Checking to see if we can build Python bindings]) have_python_bindings=no if test x$have_python = xyes; then - AC_MSG_CHECKING([for Pyrex >= 0.9.5.1]) - PYREX_CHECK_VERSION(0.9.5.1, [AC_MSG_RESULT(yes) - have_pyrex=yes], + AC_MSG_CHECKING([for Cython >= 0.11.3]) + CYTHON_CHECK_VERSION(0.11.3, [AC_MSG_RESULT(yes) + have_cython=yes], [AC_MSG_RESULT(no) - have_pyrex=no]) + have_cython=no]) AM_CHECK_PYTHON_HEADERS(have_python_headers=yes,have_python_headers=no) - if test x$have_pyrex = xyes -a x$have_python_headers = xyes ; then + if test x$have_cython = xyes -a x$have_python_headers = xyes ; then have_python_bindings=yes fi fi if test x$have_python_bindings = xno ; then if test x$enable_python_bindings = xyes ; then - AC_MSG_ERROR([Building Python bindings explicitly requested, but can't build Python bindings because either Pyrex, Python headers or a suitable Python version was not found]) + AC_MSG_ERROR([Building Python bindings explicitly requested, but can't build Python bindings because either Cython, Python headers or a suitable Python version was not found]) else - AC_MSG_WARN([Couldn't find either Pyrex, the Python headers or a suitable version of Python, not building Python bindings]) + AC_MSG_WARN([Couldn't find either Cython, the Python headers or a suitable version of Python, not building Python bindings]) fi fi fi diff --git a/m4/cython.m4 b/m4/cython.m4 new file mode 100644 index 00000000..352df3d6 --- /dev/null +++ b/m4/cython.m4 @@ -0,0 +1,17 @@ +dnl a macro to check for the installed Cython version; note PYTHON needs to +dnl be set before this function is called. +dnl CYTHON_CHECK_VERSION([MIN-VERSION], [ACTION-IF-TRUE], [ACTION-IF-FALSE]) +AC_DEFUN([CYTHON_CHECK_VERSION], + [prog="import sys +from Cython.Compiler.Version import version +# split strings by '.' and convert to numeric. Append some zeros +# because we need at least 4 digits for the hex conversion. +ver = map(int, version.rstrip('abcdefghijklmnopqrstuvwxyz').split('.')) + [[0, 0, 0]] +verhex = 0 +for i in xrange(0, 4): verhex = (verhex << 8) + ver[[i]] +minver = map(int, '$1'.split('.')) + [[0, 0, 0]] +minverhex = 0 +for i in xrange(0, 4): minverhex = (minverhex << 8) + minver[[i]] +sys.exit(verhex < minverhex)" + AS_IF([AM_RUN_LOG([$PYTHON -c "$prog"])], [$2], [$3])]) + diff --git a/m4/pyrex.m4 b/m4/pyrex.m4 deleted file mode 100644 index 379c5e3d..00000000 --- a/m4/pyrex.m4 +++ /dev/null @@ -1,17 +0,0 @@ -dnl a macro to check for the installed Pyrex version; note PYTHON needs to -dnl be set before this function is called. -dnl PYREX_CHECK_VERSION([MIN-VERSION], [ACTION-IF-TRUE], [ACTION-IF-FALSE]) -AC_DEFUN([PYREX_CHECK_VERSION], - [prog="import sys -from Pyrex.Compiler.Version import version -# split strings by '.' and convert to numeric. Append some zeros -# because we need at least 4 digits for the hex conversion. -pyrexver = map(int, version.rstrip('abcdefghijklmnopqrstuvwxyz').split('.')) + [[0, 0, 0]] -pyrexverhex = 0 -for i in xrange(0, 4): pyrexverhex = (pyrexverhex << 8) + pyrexver[[i]] -minver = map(int, '$1'.split('.')) + [[0, 0, 0]] -minverhex = 0 -for i in xrange(0, 4): minverhex = (minverhex << 8) + minver[[i]] -sys.exit(pyrexverhex < minverhex)" - AS_IF([AM_RUN_LOG([$PYTHON -c "$prog"])], [$2], [$3])]) - diff --git a/tools/python-yasm/Makefile.inc b/tools/python-yasm/Makefile.inc index ed816cfa..e4559964 100644 --- a/tools/python-yasm/Makefile.inc +++ b/tools/python-yasm/Makefile.inc @@ -40,9 +40,9 @@ yasm.pyx: $(srcdir)/tools/python-yasm/yasm.pyx CLEANFILES += yasm.pyx -# Actually run Pyrex +# Actually run Cython yasm_python.c: yasm.pyx _yasm.pxi $(PYBINDING_DEPS) - $(PYTHON) -c "from Pyrex.Compiler.Main import main; main(command_line=1)" \ + $(PYTHON) -c "from Cython.Compiler.Main import main; main(command_line=1)" \ -o $@ yasm.pyx CLEANFILES += yasm_python.c diff --git a/tools/python-yasm/setup.py b/tools/python-yasm/setup.py index 0633fd3e..d4ce2f44 100644 --- a/tools/python-yasm/setup.py +++ b/tools/python-yasm/setup.py @@ -26,7 +26,7 @@ from distutils.core import setup from distutils.extension import Extension -from Pyrex.Distutils import build_ext +from Cython.Distutils import build_ext from os.path import basename, join, exists def ReadSetup(filename): From 40f06c127537be8d72cadcf6e7ada96e493cf345 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 2 Jan 2010 17:56:16 +0000 Subject: [PATCH 312/585] Fix additional cases of duplicate 66h prefix generation for AVX instructions. Reported by: Gil Dabah svn path=/trunk/yasm/; revision=2257 --- modules/arch/x86/gen_x86_insn.py | 31 +++++++++-------- modules/arch/x86/tests/Makefile.inc | 2 ++ modules/arch/x86/tests/avx16.asm | 10 ++++++ modules/arch/x86/tests/avx16.hex | 52 +++++++++++++++++++++++++++++ 4 files changed, 81 insertions(+), 14 deletions(-) create mode 100644 modules/arch/x86/tests/avx16.asm create mode 100644 modules/arch/x86/tests/avx16.hex diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index 187c0721..19bc74f2 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -5775,7 +5775,6 @@ add_insn("crc32", "crc32") add_group("extractps", cpu=["SSE41"], modifiers=["SetVEX"], - opersize=32, prefix=0x66, opcode=[0x0F, 0x3A, 0x17], operands=[Operand(type="RM", size=32, relaxed=True, dest="EA"), @@ -5870,16 +5869,23 @@ add_group("pextrb", operands=[Operand(type="Mem", size=8, relaxed=True, dest="EA"), Operand(type="SIMDReg", size=128, dest="Spare"), Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) -for sz in [32, 64]: - add_group("pextrb", - cpu=["SSE41"], - modifiers=["SetVEX"], - opersize=sz, - prefix=0x66, - opcode=[0x0F, 0x3A, 0x14], - operands=[Operand(type="Reg", size=sz, dest="EA"), - Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("pextrb", + cpu=["SSE41"], + modifiers=["SetVEX"], + prefix=0x66, + opcode=[0x0F, 0x3A, 0x14], + operands=[Operand(type="Reg", size=32, dest="EA"), + Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("pextrb", + cpu=["SSE41"], + modifiers=["SetVEX"], + opersize=64, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x14], + operands=[Operand(type="Reg", size=64, dest="EA"), + Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) add_insn("pextrb", "pextrb") add_insn("vpextrb", "pextrb", modifiers=[VEXL0], avx=True) @@ -5887,7 +5893,6 @@ add_insn("vpextrb", "pextrb", modifiers=[VEXL0], avx=True) add_group("pextrd", cpu=["SSE41"], modifiers=["SetVEX"], - opersize=32, prefix=0x66, opcode=[0x0F, 0x3A, 0x16], operands=[Operand(type="RM", size=32, relaxed=True, dest="EA"), @@ -5951,7 +5956,6 @@ add_insn("vpinsrb", "pinsrb", modifiers=[VEXL0], avx=True) add_group("pinsrd", cpu=["SSE41"], modifiers=["SetVEX"], - opersize=32, prefix=0x66, opcode=[0x0F, 0x3A, 0x22], operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), @@ -5960,7 +5964,6 @@ add_group("pinsrd", add_group("pinsrd", cpu=["AVX"], vex=128, - opersize=32, prefix=0x66, opcode=[0x0F, 0x3A, 0x22], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), diff --git a/modules/arch/x86/tests/Makefile.inc b/modules/arch/x86/tests/Makefile.inc index 7ea7ced1..298f075a 100644 --- a/modules/arch/x86/tests/Makefile.inc +++ b/modules/arch/x86/tests/Makefile.inc @@ -23,6 +23,8 @@ EXTRA_DIST += modules/arch/x86/tests/arithsmall.errwarn EXTRA_DIST += modules/arch/x86/tests/arithsmall.hex EXTRA_DIST += modules/arch/x86/tests/avx.asm EXTRA_DIST += modules/arch/x86/tests/avx.hex +EXTRA_DIST += modules/arch/x86/tests/avx16.asm +EXTRA_DIST += modules/arch/x86/tests/avx16.hex EXTRA_DIST += modules/arch/x86/tests/avxcc.asm EXTRA_DIST += modules/arch/x86/tests/avxcc.hex EXTRA_DIST += modules/arch/x86/tests/bittest.asm diff --git a/modules/arch/x86/tests/avx16.asm b/modules/arch/x86/tests/avx16.asm new file mode 100644 index 00000000..72167589 --- /dev/null +++ b/modules/arch/x86/tests/avx16.asm @@ -0,0 +1,10 @@ +[bits 16] +extractps eax, xmm1, 5 +vextractps eax, xmm1, 5 +pextrb eax, xmm1, 5 +vpextrb eax, xmm1, 5 +pextrw eax, xmm1, 5 +vpextrw eax, xmm1, 5 +pextrd eax, xmm1, 5 +vpextrd eax, xmm1, 5 +vpinsrd xmm1, xmm2, eax, 5 diff --git a/modules/arch/x86/tests/avx16.hex b/modules/arch/x86/tests/avx16.hex new file mode 100644 index 00000000..6e3a538d --- /dev/null +++ b/modules/arch/x86/tests/avx16.hex @@ -0,0 +1,52 @@ +66 +0f +3a +17 +c8 +05 +c4 +e3 +79 +17 +c8 +05 +66 +0f +3a +14 +c8 +05 +c4 +e3 +79 +14 +c8 +05 +66 +0f +c5 +c1 +05 +c5 +f9 +c5 +c1 +05 +66 +0f +3a +16 +c8 +05 +c4 +e3 +79 +16 +c8 +05 +c4 +e3 +69 +22 +c8 +05 From 5501768adbef05e82ffb5b62a0fc40a702b3f49a Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 3 Jan 2010 01:04:18 +0000 Subject: [PATCH 313/585] Use queue.h HEAD macros more portably (also avoiding compiler warning). svn path=/trunk/yasm/; revision=2258 --- libyasm/errwarn.c | 4 ++-- libyasm/section.c | 7 ++++--- modules/dbgfmts/codeview/cv-symline.c | 4 ++-- modules/objfmts/bin/bin-objfmt.c | 2 +- modules/preprocs/cpp/cpp-preproc.c | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/libyasm/errwarn.c b/libyasm/errwarn.c index 644d7d27..fa136005 100644 --- a/libyasm/errwarn.c +++ b/libyasm/errwarn.c @@ -69,7 +69,7 @@ typedef struct warn { yasm_warn_class wclass; /*@owned@*/ /*@null@*/ char *wstr; } warn; -static STAILQ_HEAD(, warn) yasm_warns; +static STAILQ_HEAD(warn_head, warn) yasm_warns; /* Enabled warnings. See errwarn.h for a list. */ static unsigned long warn_class_enabled; @@ -86,7 +86,7 @@ typedef struct errwarn_data { } errwarn_data; struct yasm_errwarns { - /*@reldef@*/ SLIST_HEAD(, errwarn_data) errwarns; + /*@reldef@*/ SLIST_HEAD(errwarn_head, errwarn_data) errwarns; /* Total error count */ unsigned int ecount; diff --git a/libyasm/section.c b/libyasm/section.c index 2c6c8de6..3271e391 100644 --- a/libyasm/section.c +++ b/libyasm/section.c @@ -871,10 +871,11 @@ struct yasm_span { }; typedef struct optimize_data { - /*@reldef@*/ TAILQ_HEAD(, yasm_span) spans; - /*@reldef@*/ STAILQ_HEAD(, yasm_span) QA, QB; + /*@reldef@*/ TAILQ_HEAD(yasm_span_head, yasm_span) spans; + /*@reldef@*/ STAILQ_HEAD(yasm_span_shead, yasm_span) QA, QB; /*@only@*/ IntervalTree *itree; - /*@reldef@*/ STAILQ_HEAD(, yasm_offset_setter) offset_setters; + /*@reldef@*/ STAILQ_HEAD(offset_setters_head, yasm_offset_setter) + offset_setters; long len_diff; /* used only for optimize_term_expand */ yasm_span *span; /* used only for check_cycle */ yasm_offset_setter *os; diff --git a/modules/dbgfmts/codeview/cv-symline.c b/modules/dbgfmts/codeview/cv-symline.c index 0a806226..1996c33a 100644 --- a/modules/dbgfmts/codeview/cv-symline.c +++ b/modules/dbgfmts/codeview/cv-symline.c @@ -134,7 +134,7 @@ typedef struct cv8_lineinfo { yasm_section *sect; /* section line numbers are for */ yasm_symrec *sectsym; /* symbol for beginning of sect */ unsigned long num_linenums; - STAILQ_HEAD(, cv8_lineset) linesets; + STAILQ_HEAD(cv8_lineset_head, cv8_lineset) linesets; } cv8_lineinfo; /* Symbols use a bit of meta-programming to encode formats: each character @@ -419,7 +419,7 @@ typedef struct cv_line_info { yasm_linemap *linemap; yasm_errwarns *errwarns; unsigned int num_lineinfos; - STAILQ_HEAD(, cv8_lineinfo) cv8_lineinfos; + STAILQ_HEAD(cv8_lineinfo_head, cv8_lineinfo) cv8_lineinfos; /*@null@*/ cv8_lineinfo *cv8_cur_li; /*@null@*/ cv8_lineset *cv8_cur_ls; } cv_line_info; diff --git a/modules/objfmts/bin/bin-objfmt.c b/modules/objfmts/bin/bin-objfmt.c index 3a64429d..c1be24ec 100644 --- a/modules/objfmts/bin/bin-objfmt.c +++ b/modules/objfmts/bin/bin-objfmt.c @@ -113,7 +113,7 @@ bin_objfmt_create(yasm_object *object) return (yasm_objfmt *)objfmt_bin; } -typedef TAILQ_HEAD(, bin_group) bin_groups; +typedef TAILQ_HEAD(bin_group_head, bin_group) bin_groups; typedef struct bin_group { TAILQ_ENTRY(bin_group) link; diff --git a/modules/preprocs/cpp/cpp-preproc.c b/modules/preprocs/cpp/cpp-preproc.c index 821b98b5..663f726c 100644 --- a/modules/preprocs/cpp/cpp-preproc.c +++ b/modules/preprocs/cpp/cpp-preproc.c @@ -59,7 +59,7 @@ typedef struct yasm_preproc_cpp { yasm_preproc_base preproc; /* base structure */ /* List of arguments to pass to cpp. */ - TAILQ_HEAD(, cpp_arg_entry) cpp_args; + TAILQ_HEAD(cpp_arg_head, cpp_arg_entry) cpp_args; char *filename; FILE *f, *f_deps; From b3d84a814873f7e4376d6d7fdc138b525097ad31 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 3 Jan 2010 01:58:23 +0000 Subject: [PATCH 314/585] Implement some linemap changes required for the GAS preprocessor. Contributed by: Alexei Svitkine - yasm_linemap_set() now takes virtual_line as a parameter, instead of always using linemap->current. If 0 is passed for the virtual_line, then linemap->current is used, as before. This is because linemap->current was only incremented by the parser (and never decremented), so the preprocessor was not able to set mappings during the preprocessing phase (whereas with these changes, it now does). Additionally, setting a mapping for a line number will now delete any existing mappings for line numbers equal or greater to that line number. This allows the code to correctly handle the case when the preprocessor first sets mappings from pre-pp lines to post-pp lines, and later those mappings getting superseded by .line directives in the original source. This change also required making a change to yasm_linemap_lookup() to set *file_line to 0 when line is 0 (i.e. preventing line 0 - which means "don't display line number in output" - from getting mapped). svn path=/trunk/yasm/; revision=2259 --- frontends/tasm/tasm.c | 2 +- frontends/yasm/yasm.c | 4 +-- libyasm/linemap.c | 48 +++++++++++++++++++++---------- libyasm/linemap.h | 6 ++-- modules/parsers/gas/gas-parse.c | 12 ++++---- modules/parsers/nasm/nasm-parse.c | 2 +- 6 files changed, 47 insertions(+), 27 deletions(-) diff --git a/frontends/tasm/tasm.c b/frontends/tasm/tasm.c index a8490b23..70f9573a 100644 --- a/frontends/tasm/tasm.c +++ b/frontends/tasm/tasm.c @@ -267,7 +267,7 @@ do_assemble(void) /* Initialize line map */ linemap = yasm_linemap_create(); - yasm_linemap_set(linemap, in_filename, 1, 1); + yasm_linemap_set(linemap, in_filename, 0, 1, 1); /* determine the object filename if not specified */ if (!obj_filename) { diff --git a/frontends/yasm/yasm.c b/frontends/yasm/yasm.c index b8c1ac59..05d0dfe7 100644 --- a/frontends/yasm/yasm.c +++ b/frontends/yasm/yasm.c @@ -255,7 +255,7 @@ do_preproc_only(void) /* Initialize line map */ linemap = yasm_linemap_create(); - yasm_linemap_set(linemap, in_filename, 1, 1); + yasm_linemap_set(linemap, in_filename, 0, 1, 1); /* Default output to stdout if not specified or generating dependency makefiles */ @@ -359,7 +359,7 @@ do_assemble(void) /* Initialize line map */ linemap = yasm_linemap_create(); - yasm_linemap_set(linemap, in_filename, 1, 1); + yasm_linemap_set(linemap, in_filename, 0, 1, 1); /* determine the object filename if not specified */ if (!obj_filename) { diff --git a/libyasm/linemap.c b/libyasm/linemap.c index 926c3102..abee7482 100644 --- a/libyasm/linemap.c +++ b/libyasm/linemap.c @@ -80,22 +80,40 @@ filename_delete_one(/*@only@*/ void *d) void yasm_linemap_set(yasm_linemap *linemap, const char *filename, - unsigned long file_line, unsigned long line_inc) + unsigned long virtual_line, unsigned long file_line, + unsigned long line_inc) { char *copy; + unsigned long i; int replace = 0; - line_mapping *mapping; + line_mapping *mapping = NULL; - /* Create a new mapping in the map */ - if (linemap->map_size >= linemap->map_allocated) { - /* allocate another size bins when full for 2x space */ - linemap->map_vector = - yasm_xrealloc(linemap->map_vector, 2*linemap->map_allocated - *sizeof(line_mapping)); - linemap->map_allocated *= 2; + if (virtual_line == 0) { + virtual_line = linemap->current; + } + + /* Replace all existing mappings that have line numbers >= this one. */ + for (i = linemap->map_size; i > 0; i--) { + if (linemap->map_vector[i-1].line < virtual_line) { + if (i < linemap->map_size) { + mapping = &linemap->map_vector[i]; + linemap->map_size = i + 1; + } + break; + } + } + + if (mapping == NULL) { + /* Create a new mapping in the map */ + if (linemap->map_size >= linemap->map_allocated) { + /* allocate another size bins when full for 2x space */ + linemap->map_vector = yasm_xrealloc(linemap->map_vector, + 2*linemap->map_allocated*sizeof(line_mapping)); + linemap->map_allocated *= 2; + } + mapping = &linemap->map_vector[linemap->map_size]; + linemap->map_size++; } - mapping = &linemap->map_vector[linemap->map_size]; - linemap->map_size++; /* Fill it */ @@ -115,7 +133,7 @@ yasm_linemap_set(yasm_linemap *linemap, const char *filename, /*@=aliasunique@*/ } - mapping->line = linemap->current; + mapping->line = virtual_line; mapping->file_line = file_line; mapping->line_inc = line_inc; } @@ -128,14 +146,14 @@ yasm_linemap_poke(yasm_linemap *linemap, const char *filename, line_mapping *mapping; linemap->current++; - yasm_linemap_set(linemap, filename, file_line, 0); + yasm_linemap_set(linemap, filename, 0, file_line, 0); mapping = &linemap->map_vector[linemap->map_size-1]; line = linemap->current; linemap->current++; - yasm_linemap_set(linemap, mapping->filename, + yasm_linemap_set(linemap, mapping->filename, 0, mapping->file_line + mapping->line_inc*(linemap->current-2-mapping->line), mapping->line_inc); @@ -249,7 +267,7 @@ yasm_linemap_lookup(yasm_linemap *linemap, unsigned long line, mapping = &linemap->map_vector[vindex]; *filename = mapping->filename; - *file_line = mapping->file_line + mapping->line_inc*(line-mapping->line); + *file_line = (line ? mapping->file_line + mapping->line_inc*(line-mapping->line) : 0); } int diff --git a/libyasm/linemap.h b/libyasm/linemap.h index 03912551..e916c6d0 100644 --- a/libyasm/linemap.h +++ b/libyasm/linemap.h @@ -91,17 +91,19 @@ void yasm_linemap_add_source(yasm_linemap *linemap, YASM_LIB_DECL unsigned long yasm_linemap_goto_next(yasm_linemap *linemap); -/** Set a new file/line physical association starting point at the current +/** Set a new file/line physical association starting point at the specified * virtual line. line_inc indicates how much the "real" line is incremented * by for each virtual line increment (0 is perfectly legal). * \param linemap line mapping repository * \param filename physical file name (if NULL, not changed) + * \param virtual_line virtual line number (if 0, linemap->current is used) * \param file_line physical line number * \param line_inc line increment */ YASM_LIB_DECL void yasm_linemap_set(yasm_linemap *linemap, /*@null@*/ const char *filename, - unsigned long file_line, unsigned long line_inc); + unsigned long virtual_line, unsigned long file_line, + unsigned long line_inc); /** Poke a single file/line association, restoring the original physical * association starting point. Caution: increments the current virtual line diff --git a/modules/parsers/gas/gas-parse.c b/modules/parsers/gas/gas-parse.c index cabf5764..e790f912 100644 --- a/modules/parsers/gas/gas-parse.c +++ b/modules/parsers/gas/gas-parse.c @@ -321,7 +321,7 @@ cpp_line_marker(yasm_parser_gas *parser_gas) get_next_token(); /* Set linemap. */ - yasm_linemap_set(parser_gas->linemap, filename, line, 1); + yasm_linemap_set(parser_gas->linemap, filename, 0, line, 1); /* The first line marker in the file (which should be on the first line @@ -429,7 +429,7 @@ nasm_line_marker(yasm_parser_gas *parser_gas) filename = STRING_val.contents; /* Set linemap. */ - yasm_linemap_set(parser_gas->linemap, filename, line, incr); + yasm_linemap_set(parser_gas->linemap, filename, 0, line, incr); /* The first line marker in the file (which should be on the first line @@ -472,12 +472,12 @@ dir_line(yasm_parser_gas *parser_gas, unsigned int param) if (parser_gas->dir_fileline == 3) { /* Have both file and line */ - yasm_linemap_set(parser_gas->linemap, NULL, + yasm_linemap_set(parser_gas->linemap, NULL, 0, parser_gas->dir_line, 1); } else if (parser_gas->dir_fileline == 1) { /* Had previous file directive only */ parser_gas->dir_fileline = 3; - yasm_linemap_set(parser_gas->linemap, parser_gas->dir_file, + yasm_linemap_set(parser_gas->linemap, parser_gas->dir_file, 0, parser_gas->dir_line, 1); } else { /* Didn't see file yet */ @@ -877,12 +877,12 @@ dir_file(yasm_parser_gas *parser_gas, unsigned int param) yasm_linemap_lookup(parser_gas->linemap, cur_line, &old_fn, &old_line); - yasm_linemap_set(parser_gas->linemap, filename, old_line, + yasm_linemap_set(parser_gas->linemap, filename, 0, old_line, 1); } else if (parser_gas->dir_fileline == 2) { /* Had previous line directive only */ parser_gas->dir_fileline = 3; - yasm_linemap_set(parser_gas->linemap, filename, + yasm_linemap_set(parser_gas->linemap, filename, 0, parser_gas->dir_line, 1); } else { /* Didn't see line yet, save file */ diff --git a/modules/parsers/nasm/nasm-parse.c b/modules/parsers/nasm/nasm-parse.c index 6ec14fd0..242d3f0b 100644 --- a/modules/parsers/nasm/nasm-parse.c +++ b/modules/parsers/nasm/nasm-parse.c @@ -316,7 +316,7 @@ parse_line(yasm_parser_nasm *parser_nasm) /* %line indicates the line number of the *next* line, so subtract * out the increment when setting the line number. */ - yasm_linemap_set(parser_nasm->linemap, filename, + yasm_linemap_set(parser_nasm->linemap, filename, 0, yasm_intnum_get_uint(line) - yasm_intnum_get_uint(incr), yasm_intnum_get_uint(incr)); yasm_intnum_destroy(line); From bf8e6be2a90a9cc1acacbf5ff24c26299779433c Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 3 Jan 2010 02:04:13 +0000 Subject: [PATCH 315/585] Improve the gas preprocessor and re-add it as default for gas parser. Contributed by: Alexei Svitkine Summary of changes: - Correct line numbers will now be reported for warnings and errors when using the GAS preprocessor - GAS preprocessor will now replace defined (e.g. via .set) variables by their values in lines returned to the parser - GAS preprocessor will now handle multi-line comments correctly - GAS preprocessor will now handle nested .rept directives correctly svn path=/trunk/yasm/; revision=2260 --- modules/parsers/gas/gas-parser.c | 4 +- modules/parsers/gas/tests/bin/Makefile.inc | 4 +- .../gas/tests/bin/reptnested-err.errwarn | 7 - .../{reptnested-err.asm => reptnested.asm} | 6 +- modules/parsers/gas/tests/bin/reptnested.hex | 10 ++ modules/preprocs/gas/gas-preproc.c | 152 ++++++++++++++---- 6 files changed, 141 insertions(+), 42 deletions(-) delete mode 100644 modules/parsers/gas/tests/bin/reptnested-err.errwarn rename modules/parsers/gas/tests/bin/{reptnested-err.asm => reptnested.asm} (69%) create mode 100644 modules/parsers/gas/tests/bin/reptnested.hex diff --git a/modules/parsers/gas/gas-parser.c b/modules/parsers/gas/gas-parser.c index 241c067a..2e285c2c 100644 --- a/modules/parsers/gas/gas-parser.c +++ b/modules/parsers/gas/gas-parser.c @@ -126,7 +126,7 @@ yasm_parser_module yasm_gas_LTX_parser = { "GNU AS (GAS)-compatible parser", "gas", gas_parser_preproc_keywords, - "raw", + "gas", NULL, /* No standard macros */ gas_parser_do_parse }; @@ -134,7 +134,7 @@ yasm_parser_module yasm_gnu_LTX_parser = { "GNU AS (GAS)-compatible parser", "gnu", gas_parser_preproc_keywords, - "raw", + "gas", NULL, /* No standard macros */ gas_parser_do_parse }; diff --git a/modules/parsers/gas/tests/bin/Makefile.inc b/modules/parsers/gas/tests/bin/Makefile.inc index 196b82aa..e7d97831 100644 --- a/modules/parsers/gas/tests/bin/Makefile.inc +++ b/modules/parsers/gas/tests/bin/Makefile.inc @@ -16,8 +16,8 @@ EXTRA_DIST += modules/parsers/gas/tests/bin/reptempty.asm EXTRA_DIST += modules/parsers/gas/tests/bin/reptempty.hex EXTRA_DIST += modules/parsers/gas/tests/bin/reptlong.asm EXTRA_DIST += modules/parsers/gas/tests/bin/reptlong.hex -EXTRA_DIST += modules/parsers/gas/tests/bin/reptnested-err.asm -EXTRA_DIST += modules/parsers/gas/tests/bin/reptnested-err.errwarn +EXTRA_DIST += modules/parsers/gas/tests/bin/reptnested.asm +EXTRA_DIST += modules/parsers/gas/tests/bin/reptnested.hex EXTRA_DIST += modules/parsers/gas/tests/bin/reptsimple.asm EXTRA_DIST += modules/parsers/gas/tests/bin/reptsimple.hex EXTRA_DIST += modules/parsers/gas/tests/bin/reptwarn.asm diff --git a/modules/parsers/gas/tests/bin/reptnested-err.errwarn b/modules/parsers/gas/tests/bin/reptnested-err.errwarn deleted file mode 100644 index d7ac0b71..00000000 --- a/modules/parsers/gas/tests/bin/reptnested-err.errwarn +++ /dev/null @@ -1,7 +0,0 @@ --:2: error: nested rept not supported --:3: error: rept without matching endr --:4: error: nested rept not supported --:4: error: nested rept not supported --:4: error: nested rept not supported --:4: error: nested rept not supported --:4: error: nested rept not supported diff --git a/modules/parsers/gas/tests/bin/reptnested-err.asm b/modules/parsers/gas/tests/bin/reptnested.asm similarity index 69% rename from modules/parsers/gas/tests/bin/reptnested-err.asm rename to modules/parsers/gas/tests/bin/reptnested.asm index bb85988a..061cae02 100644 --- a/modules/parsers/gas/tests/bin/reptnested-err.asm +++ b/modules/parsers/gas/tests/bin/reptnested.asm @@ -1,7 +1,7 @@ -.rept 6 +.rept 3 .byte 1 .rept 2 -.byte 2 -.endr .byte 3 .endr +.endr +.byte 5 diff --git a/modules/parsers/gas/tests/bin/reptnested.hex b/modules/parsers/gas/tests/bin/reptnested.hex new file mode 100644 index 00000000..451c1d31 --- /dev/null +++ b/modules/parsers/gas/tests/bin/reptnested.hex @@ -0,0 +1,10 @@ +01 +03 +03 +01 +03 +03 +01 +03 +03 +05 diff --git a/modules/preprocs/gas/gas-preproc.c b/modules/preprocs/gas/gas-preproc.c index b6f01143..41107aaf 100644 --- a/modules/preprocs/gas/gas-preproc.c +++ b/modules/preprocs/gas/gas-preproc.c @@ -41,6 +41,7 @@ typedef struct buffered_line { char *line; + int line_number; SLIST_ENTRY(buffered_line) next; } buffered_line; @@ -61,6 +62,8 @@ typedef struct yasm_preproc_gas { int depth; int skip_depth; + int in_comment; + const char *expr_string; char *expr_symbol; int expr_string_cursor; @@ -68,6 +71,10 @@ typedef struct yasm_preproc_gas { SLIST_HEAD(buffered_lines_head, buffered_line) buffered_lines; SLIST_HEAD(included_files_head, included_file) included_files; + int in_line_number; + int next_line_number; + int current_line_number; /* virtual (output) line number */ + yasm_linemap *cur_lm; yasm_errwarns *errwarns; int fatal_error; @@ -174,7 +181,7 @@ static char *read_line_from_file(yasm_preproc_gas *pp, FILE *file) if (!fgets(p, bufsize - (p - buf), file)) { if (ferror(file)) { yasm_error_set(YASM_ERROR_IO, N_("error when reading from file")); - yasm_errwarn_propagate(pp->errwarns, yasm_linemap_get_current(pp->cur_lm)); + yasm_errwarn_propagate(pp->errwarns, pp->current_line_number); } break; } @@ -204,7 +211,7 @@ static char *read_line_from_file(yasm_preproc_gas *pp, FILE *file) static char *read_line(yasm_preproc_gas *pp) { - char *buf; + char *line; if (!SLIST_EMPTY(&pp->included_files)) { included_file *inc_file = SLIST_FIRST(&pp->included_files); @@ -218,17 +225,24 @@ static char *read_line(yasm_preproc_gas *pp) if (!SLIST_EMPTY(&pp->buffered_lines)) { buffered_line *bline = SLIST_FIRST(&pp->buffered_lines); SLIST_REMOVE_HEAD(&pp->buffered_lines, next); - buf = bline->line; + line = bline->line; + if (bline->line_number != -1) { + pp->next_line_number = bline->line_number; + } yasm_xfree(bline); if (!SLIST_EMPTY(&pp->included_files)) { SLIST_FIRST(&pp->included_files)->lines_remaining--; } - return buf; + return line; } - buf = read_line_from_file(pp, pp->in); + line = read_line_from_file(pp, pp->in); + if (line) { + pp->in_line_number++; + pp->next_line_number = pp->in_line_number; + } - return buf; + return line; } static const char *get_arg(yasm_preproc_gas *pp, const char *src, char *dest, size_t dest_size) @@ -245,7 +259,7 @@ static const char *get_arg(yasm_preproc_gas *pp, const char *src, char *dest, si skip_whitespace(&comma); } else { yasm_error_set(YASM_ERROR_SYNTAX, N_("expected comma")); - yasm_errwarn_propagate(pp->errwarns, yasm_linemap_get_current(pp->cur_lm)); + yasm_errwarn_propagate(pp->errwarns, pp->current_line_number); } return comma; } @@ -368,7 +382,7 @@ static void gas_err(void *private_data, int severity, const char *fmt, ...) va_start(args, fmt); yasm_error_set_va(YASM_ERROR_SYNTAX, N_(fmt), args); - yasm_errwarn_propagate(pp->errwarns, yasm_linemap_get_current(pp->cur_lm)); + yasm_errwarn_propagate(pp->errwarns, pp->current_line_number); va_end(args); pp->fatal_error = 1; @@ -423,7 +437,7 @@ static int handle_endif(yasm_preproc_gas *pp) pp->depth--; } else { yasm_error_set(YASM_ERROR_SYNTAX, N_("\".endif\" without \".if\"")); - yasm_errwarn_propagate(pp->errwarns, yasm_linemap_get_current(pp->cur_lm)); + yasm_errwarn_propagate(pp->errwarns, pp->current_line_number); return 0; } return 1; @@ -433,7 +447,7 @@ static int handle_else(yasm_preproc_gas *pp, int is_elseif) { if (!pp->depth) { yasm_error_set(YASM_ERROR_SYNTAX, N_("\".%s\" without \".if\""), is_elseif ? "elseif" : "else"); - yasm_errwarn_propagate(pp->errwarns, yasm_linemap_get_current(pp->cur_lm)); + yasm_errwarn_propagate(pp->errwarns, pp->current_line_number); return 0; } else { pp->skip_depth = 1; @@ -448,7 +462,7 @@ static int eval_if(yasm_preproc_gas *pp, int negate, const char *arg1) long value; if (!*arg1) { yasm_error_set(YASM_ERROR_SYNTAX, N_("expression is required in \".if\" statement")); - yasm_errwarn_propagate(pp->errwarns, yasm_linemap_get_current(pp->cur_lm)); + yasm_errwarn_propagate(pp->errwarns, pp->current_line_number); return 0; } value = eval_expr(pp, arg1); @@ -470,7 +484,7 @@ static int eval_elseif(yasm_preproc_gas *pp, int unused, const char *arg1) { if (!*arg1) { yasm_error_set(YASM_ERROR_SYNTAX, N_("expression is required in \".elseif\" statement")); - yasm_errwarn_propagate(pp->errwarns, yasm_linemap_get_current(pp->cur_lm)); + yasm_errwarn_propagate(pp->errwarns, pp->current_line_number); return 0; } if (!handle_else(pp, 1)) { @@ -505,7 +519,7 @@ static int eval_ifc(yasm_preproc_gas *pp, int negate, const char *args) } } yasm_error_set(YASM_ERROR_SYNTAX, N_("\"%s\" expects two single-quoted or unquoted arguments"), negate ? ".ifnc" : ".ifc"); - yasm_errwarn_propagate(pp->errwarns, yasm_linemap_get_current(pp->cur_lm)); + yasm_errwarn_propagate(pp->errwarns, pp->current_line_number); return 0; } @@ -522,7 +536,7 @@ static int eval_ifeqs(yasm_preproc_gas *pp, int negate, const char *args) } } yasm_error_set(YASM_ERROR_SYNTAX, N_("\"%s\" expects two double-quoted arguments"), negate ? ".ifnes" : ".ifeqs"); - yasm_errwarn_propagate(pp->errwarns, yasm_linemap_get_current(pp->cur_lm)); + yasm_errwarn_propagate(pp->errwarns, pp->current_line_number); return 1; } @@ -559,7 +573,7 @@ static int eval_include(yasm_preproc_gas *pp, int unused, const char *arg1) if (unquote(arg1, filename, sizeof(filename), '"', '\0', NULL) < 0) { yasm_error_set(YASM_ERROR_SYNTAX, N_("string expected")); - yasm_errwarn_propagate(pp->errwarns, yasm_linemap_get_current(pp->cur_lm)); + yasm_errwarn_propagate(pp->errwarns, pp->current_line_number); return 0; } @@ -571,7 +585,7 @@ static int eval_include(yasm_preproc_gas *pp, int unused, const char *arg1) file = yasm_fopen_include(filename, current_filename, "r", NULL); if (!file) { yasm_error_set(YASM_ERROR_SYNTAX, N_("unable to open included file \"%s\""), filename); - yasm_errwarn_propagate(pp->errwarns, yasm_linemap_get_current(pp->cur_lm)); + yasm_errwarn_propagate(pp->errwarns, pp->current_line_number); return 0; } @@ -581,6 +595,7 @@ static int eval_include(yasm_preproc_gas *pp, int unused, const char *arg1) while (line) { buffered_line *bline = yasm_xmalloc(sizeof(buffered_line)); bline->line = line; + bline->line_number = -1; if (prev_bline) { SLIST_INSERT_AFTER(prev_bline, bline, next); } else { @@ -607,12 +622,12 @@ static int eval_set(yasm_preproc_gas *pp, int allow_redefine, const char *name, if (rec) { if (!allow_redefine) { yasm_error_set(YASM_ERROR_SYNTAX, N_("symbol \"%s\" is already defined"), name); - yasm_errwarn_propagate(pp->errwarns, yasm_linemap_get_current(pp->cur_lm)); + yasm_errwarn_propagate(pp->errwarns, pp->current_line_number); return 0; } /* TODO */ yasm_error_set(YASM_ERROR_SYNTAX, N_("redefining symbols not yet implimented"), name); - yasm_errwarn_propagate(pp->errwarns, yasm_linemap_get_current(pp->cur_lm)); + yasm_errwarn_propagate(pp->errwarns, pp->current_line_number); return 0; } else { yasm_symtab_define_equ(pp->defines, name, expr, 0); @@ -625,6 +640,7 @@ static int eval_rept(yasm_preproc_gas *pp, int unused, const char *arg1) { long i, n = eval_expr(pp, arg1); long num_lines = 0; + long nesting = 1; char *line = read_line(pp); buffered_line *prev_bline = NULL; SLIST_HEAD(buffered_lines_head, buffered_line) lines; @@ -633,13 +649,17 @@ static int eval_rept(yasm_preproc_gas *pp, int unused, const char *arg1) while (line) { skip_whitespace2(&line); - if (!strncmp(line, ".endr", 4)) { + if (starts_with(line, ".rept")) { + nesting++; + } else if (starts_with(line, ".endr") && --nesting == 0) { for (i = 0; i < n; i++) { + int line = 0; buffered_line *current_line; prev_bline = NULL; SLIST_FOREACH(current_line, &lines, next) { buffered_line *bline = yasm_xmalloc(sizeof(buffered_line)); bline->line = yasm__xstrdup(current_line->line); + bline->line_number = current_line->line_number; if (prev_bline) { SLIST_INSERT_AFTER(prev_bline, bline, next); } else { @@ -664,6 +684,7 @@ static int eval_rept(yasm_preproc_gas *pp, int unused, const char *arg1) if (n > 0) { buffered_line *bline = yasm_xmalloc(sizeof(buffered_line)); bline->line = line; + bline->line_number = pp->next_line_number; if (prev_bline) { SLIST_INSERT_AFTER(prev_bline, bline, next); } else { @@ -676,15 +697,15 @@ static int eval_rept(yasm_preproc_gas *pp, int unused, const char *arg1) line = read_line(pp); num_lines++; } - yasm_error_set(YASM_ERROR_SYNTAX, N_("unexpected EOF in \".rept\" block")); - yasm_errwarn_propagate(pp->errwarns, yasm_linemap_get_current(pp->cur_lm)); + yasm_error_set(YASM_ERROR_SYNTAX, N_("rept without matching endr")); + yasm_errwarn_propagate(pp->errwarns, pp->current_line_number); return 0; } static int eval_endr(yasm_preproc_gas *pp, int unused) { yasm_error_set(YASM_ERROR_SYNTAX, N_("\".endr\" without \".rept\"")); - yasm_errwarn_propagate(pp->errwarns, yasm_linemap_get_current(pp->cur_lm)); + yasm_errwarn_propagate(pp->errwarns, pp->current_line_number); return 0; } @@ -698,18 +719,74 @@ typedef int (*pp_fn2_t)(yasm_preproc_gas *pp, int param, const char *arg1, const static void kill_comments(yasm_preproc_gas *pp, char *line) { - char *cstart = strstr(line, "/*"); + int next = 2; + char *cstart; + + skip_whitespace2(&line); + if (*line == '#' || !strncmp(line, "//", 2)) { + *line = '\0'; + return; + } + + if (pp->in_comment) { + cstart = line; + next = 0; + } else { + cstart = strstr(line, "/*"); + next = 2; + } + while (cstart) { - char *cend = strstr(cstart + 2, "*/"); + char *cend = strstr(cstart + next, "*/"); if (!cend) { - yasm_error_set(YASM_ERROR_SYNTAX, N_("unterminated comment")); - yasm_errwarn_propagate(pp->errwarns, yasm_linemap_get_current(pp->cur_lm)); + *cstart = '\0'; + pp->in_comment = TRUE; return; } strcpy(cstart, cend + 2); + pp->in_comment = FALSE; cstart = strstr(cstart, "/*"); + next = 2; + } +} + +static void substitute_values(yasm_preproc_gas *pp, char *line) +{ + int line_length = strlen(line); + struct tokenval tokval; + + pp->expr_string = line; + pp->expr_string_cursor = 0; + pp->expr_symbol = NULL; + + while (gas_scan(pp, &tokval) != TOKEN_EOS) { + if (tokval.t_type == TOKEN_ID) { + yasm_symrec *rec = yasm_symtab_get(pp->defines, tokval.t_charptr); + if (rec) { + int cursor = pp->expr_string_cursor; + int k, len = strlen(tokval.t_charptr); + char value[64]; + int value_length = snprintf(value, sizeof(value), "%ld", eval_expr(pp, tokval.t_charptr)); + int delta = value_length - len; + + line_length += delta; + if (delta > 0) { + line = yasm_xrealloc(line, line_length); + for (k = line_length; k >= cursor; k--) { + line[k + delta] = line[k]; + } + memcpy(line + cursor - len, value, value_length); + } else { + memcpy(line + cursor - len, value, value_length); + strcpy(line + cursor - len + value_length, line + cursor); + } + pp->expr_string = line; + pp->expr_string_cursor = cursor + delta; + pp->expr_symbol = NULL; + } + } } } @@ -785,7 +862,7 @@ static int process_line(yasm_preproc_gas *pp, char *line) remainder = get_arg(pp, remainder, buf1, sizeof(buf1)); if (!remainder || !*remainder || !*buf1) { yasm_error_set(YASM_ERROR_SYNTAX, N_("\".%s\" expects two arguments"), directives[i].name); - yasm_errwarn_propagate(pp->errwarns, yasm_linemap_get_current(pp->cur_lm)); + yasm_errwarn_propagate(pp->errwarns, pp->current_line_number); pp->fatal_error = 1; } else { pp_fn2_t fn = (pp_fn2_t) directives[i].fn; @@ -796,7 +873,12 @@ static int process_line(yasm_preproc_gas *pp, char *line) } } - return (pp->skip_depth == 0); + if (pp->skip_depth == 0) { + substitute_values(pp, line); + return TRUE; + } + + return FALSE; } /* Functions exported by the preprocessor. */ @@ -824,8 +906,12 @@ gas_preproc_create(const char *in_filename, yasm_symtab *symtab, yasm_symtab_set_case_sensitive(pp->defines, 1); pp->depth = 0; pp->skip_depth = 0; + pp->in_comment = FALSE; SLIST_INIT(&pp->buffered_lines); SLIST_INIT(&pp->included_files); + pp->in_line_number = 0; + pp->next_line_number = 0; + pp->current_line_number = 0; pp->cur_lm = lm; pp->errwarns = errwarns; pp->fatal_error = 0; @@ -861,6 +947,8 @@ gas_preproc_get_line(yasm_preproc *preproc) int done = FALSE; char *line = NULL; + pp->current_line_number++; + do { if (line != NULL) { yasm_xfree(line); @@ -870,11 +958,19 @@ gas_preproc_get_line(yasm_preproc *preproc) } line = read_line(pp); if (line == NULL) { + if (pp->in_comment) { + yasm_linemap_set(pp->cur_lm, pp->in_filename, pp->current_line_number, pp->next_line_number, 0); + yasm_warn_set(YASM_WARN_GENERAL, N_("end of file in comment")); + yasm_errwarn_propagate(pp->errwarns, pp->current_line_number); + pp->in_comment = FALSE; + } return NULL; } done = process_line(pp, line); } while (!done); + yasm_linemap_set(pp->cur_lm, pp->in_filename, pp->current_line_number, pp->next_line_number, 0); + return line; } From 5ce81be7fe3524f25234923e8d168f39e02e20a2 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 3 Jan 2010 02:41:50 +0000 Subject: [PATCH 316/585] gas-preproc.c: Avoid warning on unused variable. svn path=/trunk/yasm/; revision=2261 --- modules/preprocs/gas/gas-preproc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/preprocs/gas/gas-preproc.c b/modules/preprocs/gas/gas-preproc.c index 41107aaf..e81bb897 100644 --- a/modules/preprocs/gas/gas-preproc.c +++ b/modules/preprocs/gas/gas-preproc.c @@ -653,7 +653,6 @@ static int eval_rept(yasm_preproc_gas *pp, int unused, const char *arg1) nesting++; } else if (starts_with(line, ".endr") && --nesting == 0) { for (i = 0; i < n; i++) { - int line = 0; buffered_line *current_line; prev_bline = NULL; SLIST_FOREACH(current_line, &lines, next) { From e8ff41cac1359b606071945245a6d0dc91e95edc Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 3 Jan 2010 02:46:11 +0000 Subject: [PATCH 317/585] Fix two more instances of queue.h HEAD macros for portability. svn path=/trunk/yasm/; revision=2262 --- libyasm/file.c | 2 +- libyasm/inttree.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/libyasm/file.c b/libyasm/file.c index fa225af0..128934a8 100644 --- a/libyasm/file.c +++ b/libyasm/file.c @@ -455,7 +455,7 @@ typedef struct incpath { /*@owned@*/ char *path; } incpath; -STAILQ_HEAD(, incpath) incpaths = STAILQ_HEAD_INITIALIZER(incpaths); +STAILQ_HEAD(incpath_head, incpath) incpaths = STAILQ_HEAD_INITIALIZER(incpaths); FILE * yasm_fopen_include(const char *iname, const char *from, const char *mode, diff --git a/libyasm/inttree.c b/libyasm/inttree.c index 382a5981..a7739fb1 100644 --- a/libyasm/inttree.c +++ b/libyasm/inttree.c @@ -492,7 +492,8 @@ void IT_destroy(IntervalTree *it) { IntervalTreeNode *x = it->root->left; - SLIST_HEAD(, nodeent) stuffToFree = SLIST_HEAD_INITIALIZER(stuffToFree); + SLIST_HEAD(node_head, nodeent) + stuffToFree = SLIST_HEAD_INITIALIZER(stuffToFree); struct nodeent { SLIST_ENTRY(nodeent) link; struct IntervalTreeNode *node; From 8500270339639ab244f3b1a1f2072c86c30e2e88 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 3 Jan 2010 02:47:28 +0000 Subject: [PATCH 318/585] bin-objfmt.c: Comment out unused function (kept in the code for debugging). svn path=/trunk/yasm/; revision=2263 --- modules/objfmts/bin/bin-objfmt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/objfmts/bin/bin-objfmt.c b/modules/objfmts/bin/bin-objfmt.c index c1be24ec..21d43dac 100644 --- a/modules/objfmts/bin/bin-objfmt.c +++ b/modules/objfmts/bin/bin-objfmt.c @@ -158,6 +158,8 @@ find_group_by_section(bin_groups *groups, yasm_section *section) return NULL; } +#if 0 +/* Debugging function */ static void print_groups(const bin_groups *groups, int indent_level) { @@ -172,6 +174,7 @@ print_groups(const bin_groups *groups, int indent_level) } } } +#endif static void bin_group_destroy(/*@only@*/ bin_group *group) From 737c225a5081207542398a89950c17b326bd5d30 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 3 Jan 2010 03:47:16 +0000 Subject: [PATCH 319/585] Update Pyxelator to avoid deprecation warnings on recent Python versions. svn path=/trunk/yasm/; revision=2264 --- tools/python-yasm/pyxelator/genpyx.py | 1 - tools/python-yasm/pyxelator/work_unit.py | 25 +++++++++++++++++++----- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/tools/python-yasm/pyxelator/genpyx.py b/tools/python-yasm/pyxelator/genpyx.py index 00cfa3f5..3f2a4cc2 100755 --- a/tools/python-yasm/pyxelator/genpyx.py +++ b/tools/python-yasm/pyxelator/genpyx.py @@ -16,7 +16,6 @@ So, for example, when we refer to Node we get ir.Node . import sys from datetime import datetime -from sets import Set # XX use this Context class instead of all those kw dicts !! XX class Context(object): diff --git a/tools/python-yasm/pyxelator/work_unit.py b/tools/python-yasm/pyxelator/work_unit.py index 0d888f8b..31ab3e56 100755 --- a/tools/python-yasm/pyxelator/work_unit.py +++ b/tools/python-yasm/pyxelator/work_unit.py @@ -16,6 +16,18 @@ import os import cparse import ir +def callcmd(cmd): + try: + from subprocess import call + try: + retcode = call(cmd, shell=True) + assert retcode == 0, "command failed: %s"%cmd + except OSError, e: + assert False, "command failed: %s"%e + except ImportError: + status = os.system( cmd ) + assert status == 0, "command failed: %s"%cmd + class WorkUnit(object): def __init__(self, files, modname, filename, std=False, strip=False, mark_cb=None, @@ -62,13 +74,11 @@ class WorkUnit(object): ifile.close() cmd = '%s %s %s > %s'%(self.CPP,name+'.h',self.CPPFLAGS,name+'.E') sys.stderr.write( "# %s\n" % cmd ) - status = os.system( cmd ) - assert status == 0, "command failed: %s"%cmd + callcmd( cmd ) assert open(name+'.E').read().count('\n') > 10, "failed to run preprocessor" cmd = '%s -dM %s %s > %s'%(self.CPP,name+'.h',self.CPPFLAGS,name+'.dM') sys.stderr.write( "# %s\n" % cmd ) - status = os.system( cmd ) - assert status == 0, "command failed: %s"%cmd + callcmd( cmd ) assert open(name+'.dM').read().count('\n') > 10, "failed to run preprocessor with -dM" return name @@ -157,7 +167,12 @@ def get_syms(libs, libdirs): accept = [ ' %s '%c for c in 'TVWBCDGRS' ] #f = open('syms.out','w') for libname in libnames: - fin, fout = os.popen2( 'nm %s' % libname ) + try: + from subprocess import Popen, PIPE + p = Popen(['nm', libname], bufsize=1, stdout=PIPE) + fout = p.stdout + except ImportError: + fin, fout = os.popen2( 'nm %s' % libname ) for line in fout.readlines(): for acc in accept: if line.count(acc): From 6ede18e881c81f0f5779c9daf67b0b1db4411905 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 3 Jan 2010 21:59:28 +0000 Subject: [PATCH 320/585] GAS preproc: Fix line number for .rept without matching .endr error. The line number reported for the error is that of the .rept directive. Contributed by: Alexei Svitkine svn path=/trunk/yasm/; revision=2265 --- modules/parsers/gas/tests/bin/rept-err.asm | 2 ++ modules/parsers/gas/tests/bin/rept-err.errwarn | 2 +- modules/preprocs/gas/gas-preproc.c | 5 ++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/parsers/gas/tests/bin/rept-err.asm b/modules/parsers/gas/tests/bin/rept-err.asm index 143e9041..88582f93 100644 --- a/modules/parsers/gas/tests/bin/rept-err.asm +++ b/modules/parsers/gas/tests/bin/rept-err.asm @@ -1,2 +1,4 @@ .rept 6 +.endr +.rept 3 .byte 0 diff --git a/modules/parsers/gas/tests/bin/rept-err.errwarn b/modules/parsers/gas/tests/bin/rept-err.errwarn index 3f64c8eb..5682b14a 100644 --- a/modules/parsers/gas/tests/bin/rept-err.errwarn +++ b/modules/parsers/gas/tests/bin/rept-err.errwarn @@ -1 +1 @@ --:1: error: rept without matching endr +-:3: error: rept without matching endr diff --git a/modules/preprocs/gas/gas-preproc.c b/modules/preprocs/gas/gas-preproc.c index e81bb897..998070bb 100644 --- a/modules/preprocs/gas/gas-preproc.c +++ b/modules/preprocs/gas/gas-preproc.c @@ -644,6 +644,8 @@ static int eval_rept(yasm_preproc_gas *pp, int unused, const char *arg1) char *line = read_line(pp); buffered_line *prev_bline = NULL; SLIST_HEAD(buffered_lines_head, buffered_line) lines; + int rept_start_file_line_number = pp->next_line_number - 1; + int rept_start_output_line_number = pp->current_line_number; SLIST_INIT(&lines); @@ -696,8 +698,9 @@ static int eval_rept(yasm_preproc_gas *pp, int unused, const char *arg1) line = read_line(pp); num_lines++; } + yasm_linemap_set(pp->cur_lm, pp->in_filename, rept_start_output_line_number, rept_start_file_line_number, 0); yasm_error_set(YASM_ERROR_SYNTAX, N_("rept without matching endr")); - yasm_errwarn_propagate(pp->errwarns, pp->current_line_number); + yasm_errwarn_propagate(pp->errwarns, rept_start_output_line_number); return 0; } From fd03e1eef586e8fcc0f1027b0a87a44448fdba18 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 3 Jan 2010 22:02:30 +0000 Subject: [PATCH 321/585] Now that the gas preproc supports .rept, remove it from the gas parser. svn path=/trunk/yasm/; revision=2266 --- modules/parsers/gas/gas-parse.c | 50 -------- modules/parsers/gas/gas-parser.c | 8 -- modules/parsers/gas/gas-parser.h | 22 ---- modules/parsers/gas/gas-token.re | 190 +------------------------------ 4 files changed, 1 insertion(+), 269 deletions(-) diff --git a/modules/parsers/gas/gas-parse.c b/modules/parsers/gas/gas-parse.c index e790f912..b3e318df 100644 --- a/modules/parsers/gas/gas-parse.c +++ b/modules/parsers/gas/gas-parse.c @@ -486,53 +486,6 @@ dir_line(yasm_parser_gas *parser_gas, unsigned int param) return NULL; } -/* Macro directives */ - -static yasm_bytecode * -dir_rept(yasm_parser_gas *parser_gas, unsigned int param) -{ - yasm_intnum *intn; - yasm_expr *e = parse_expr(parser_gas); - - if (!e) { - yasm_error_set(YASM_ERROR_SYNTAX, - N_("expression expected after `%s'"), - ".rept"); - return NULL; - } - intn = yasm_expr_get_intnum(&e, 0); - - if (!intn) { - yasm_error_set(YASM_ERROR_NOT_ABSOLUTE, - N_("rept expression not absolute")); - } else if (yasm_intnum_sign(intn) < 0) { - yasm_error_set(YASM_ERROR_VALUE, - N_("rept expression is negative")); - } else { - gas_rept *rept = yasm_xmalloc(sizeof(gas_rept)); - STAILQ_INIT(&rept->lines); - rept->startline = cur_line; - rept->numrept = yasm_intnum_get_uint(intn); - rept->numdone = 0; - rept->line = NULL; - rept->linepos = 0; - rept->ended = 0; - rept->oldbuf = NULL; - rept->oldbuflen = 0; - rept->oldbufpos = 0; - parser_gas->rept = rept; - } - return NULL; -} - -static yasm_bytecode * -dir_endr(yasm_parser_gas *parser_gas, unsigned int param) -{ - /* Shouldn't ever get here unless we didn't get a DIR_REPT first */ - yasm_error_set(YASM_ERROR_SYNTAX, N_("endr without matching rept")); - return NULL; -} - /* Alignment directives */ static yasm_bytecode * @@ -1715,9 +1668,6 @@ static dir_lookup dirs_static[] = { {".data", dir_data_section, 0, INITIAL}, {".text", dir_text_section, 0, INITIAL}, {".section", dir_section, 0, SECTION_DIRECTIVE}, - /* macro directives */ - {".rept", dir_rept, 0, INITIAL}, - {".endr", dir_endr, 0, INITIAL}, /* empty space/fill directives */ {".skip", dir_skip, 0, INITIAL}, {".space", dir_skip, 0, INITIAL}, diff --git a/modules/parsers/gas/gas-parser.c b/modules/parsers/gas/gas-parser.c index 2e285c2c..d4211539 100644 --- a/modules/parsers/gas/gas-parser.c +++ b/modules/parsers/gas/gas-parser.c @@ -71,8 +71,6 @@ gas_parser_do_parse(yasm_object *object, yasm_preproc *pp, parser_gas.state = INITIAL; - parser_gas.rept = NULL; - for (i=0; i<10; i++) parser_gas.local[i] = 0; @@ -83,12 +81,6 @@ gas_parser_do_parse(yasm_object *object, yasm_preproc *pp, gas_parser_parse(&parser_gas); - /* Check for ending inside a rept */ - if (parser_gas.rept) { - yasm_error_set(YASM_ERROR_SYNTAX, N_("rept without matching endr")); - yasm_errwarn_propagate(errwarns, parser_gas.rept->startline); - } - /* Check for ending inside a comment */ if (parser_gas.state == COMMENT) { yasm_warn_set(YASM_WARN_GENERAL, N_("end of file in comment")); diff --git a/modules/parsers/gas/gas-parser.h b/modules/parsers/gas/gas-parser.h index edb40a8f..fe8a0bc0 100644 --- a/modules/parsers/gas/gas-parser.h +++ b/modules/parsers/gas/gas-parser.h @@ -64,26 +64,6 @@ typedef union { } yystype; #define YYSTYPE yystype -typedef struct gas_rept_line { - STAILQ_ENTRY(gas_rept_line) link; - YYCTYPE *data; /* line characters */ - size_t len; /* length of data */ -} gas_rept_line; - -typedef struct gas_rept { - STAILQ_HEAD(reptlinelist, gas_rept_line) lines; /* repeated lines */ - unsigned long startline; /* line number of rept directive */ - unsigned long numrept; /* number of repititions to generate */ - unsigned long numdone; /* number of repititions executed so far */ - /*@null@*/ gas_rept_line *line; /* next line to repeat */ - size_t linepos; /* position to start pulling chars from line */ - int ended; /* seen endr directive yet? */ - - YYCTYPE *oldbuf; /* saved previous fill buffer */ - size_t oldbuflen; /* previous fill buffer length */ - size_t oldbufpos; /* position in previous fill buffer */ -} gas_rept; - enum gas_parser_state { INITIAL, COMMENT, @@ -134,8 +114,6 @@ typedef struct yasm_parser_gas { yystype peek_tokval; char peek_tokch; - /*@null@*/ gas_rept *rept; - /* Index of local labels; what's stored here is the /next/ index, * so these are all 0 at start. */ diff --git a/modules/parsers/gas/gas-token.re b/modules/parsers/gas/gas-token.re index b252ab43..cf020fbe 100644 --- a/modules/parsers/gas/gas-token.re +++ b/modules/parsers/gas/gas-token.re @@ -50,82 +50,6 @@ RCSID("$Id$"); #define TOK ((char *)s->tok) #define TOKLEN (size_t)(cursor-s->tok) -static size_t -rept_input(yasm_parser_gas *parser_gas, /*@out@*/ YYCTYPE *buf, - size_t max_size) -{ - gas_rept *rept = parser_gas->rept; - size_t numleft = max_size; - YYCTYPE *bufp = buf; - - /* If numrept is 0, copy out just the line end characters */ - if (rept->numrept == 0) { - /* Skip first line, which contains .line */ - rept->line = STAILQ_NEXT(rept->line, link); - if (!rept->line) { - rept->numrept = 1; - rept->numdone = 1; - } - while (rept->numrept == 0 && numleft > 0) { - *bufp++ = rept->line->data[rept->line->len-1]; - rept->line = STAILQ_NEXT(rept->line, link); - if (!rept->line) { - rept->numrept = 1; - rept->numdone = 1; - } - } - } - - /* Copy out the previous fill buffer until we're *really* done */ - if (rept->numdone == rept->numrept) { - size_t numcopy = rept->oldbuflen - rept->oldbufpos; - if (numcopy > numleft) - numcopy = numleft; - memcpy(bufp, &rept->oldbuf[rept->oldbufpos], numcopy); - numleft -= numcopy; - bufp += numcopy; - rept->oldbufpos += numcopy; - - if (rept->oldbufpos == rept->oldbuflen) { - /* Delete lines, then delete rept and clear rept state */ - gas_rept_line *cur, *next; - cur = STAILQ_FIRST(&rept->lines); - while (cur) { - next = STAILQ_NEXT(cur, link); - yasm_xfree(cur->data); - yasm_xfree(cur); - cur = next; - } - yasm_xfree(rept->oldbuf); - yasm_xfree(rept); - parser_gas->rept = NULL; - } - } - - while (numleft > 0 && rept->numdone < rept->numrept) { - /* Copy from line data to buf */ - size_t numcopy = rept->line->len - rept->linepos; - if (numcopy > numleft) - numcopy = numleft; - memcpy(bufp, &rept->line->data[rept->linepos], numcopy); - numleft -= numcopy; - bufp += numcopy; - rept->linepos += numcopy; - - /* Update locations if needed */ - if (rept->linepos == rept->line->len) { - rept->line = STAILQ_NEXT(rept->line, link); - rept->linepos = 0; - } - if (rept->line == NULL) { - rept->numdone++; - rept->line = STAILQ_FIRST(&rept->lines); - } - } - - return (max_size-numleft); -} - /* Bridge function to convert byte-oriented parser with line-oriented * preprocessor. */ @@ -197,10 +121,7 @@ fill(yasm_parser_gas *parser_gas, YYCTYPE *cursor) yasm_xfree(s->bot); s->bot = buf; } - if (parser_gas->rept && parser_gas->rept->ended) { - /* Pull from rept lines instead of preproc */ - cnt = rept_input(parser_gas, s->lim, BSIZE); - } else if((cnt = preproc_input(parser_gas, s->lim, BSIZE)) == 0) { + if((cnt = preproc_input(parser_gas, s->lim, BSIZE)) == 0) { s->eof = &s->lim[cnt]; *s->eof++ = '\n'; } s->lim += cnt; @@ -271,13 +192,10 @@ strbuf_append(size_t count, YYCTYPE *cursor, yasm_scanner *s, int ch) int gas_parser_lex(YYSTYPE *lvalp, yasm_parser_gas *parser_gas) { - /*@null@*/ gas_rept *rept = parser_gas->rept; yasm_scanner *s = &parser_gas->s; YYCTYPE *cursor = s->cur; size_t count; YYCTYPE savech; - int linestart; - gas_rept_line *new_line; /* Handle one token of lookahead */ if (parser_gas->peek_token != NONE) { @@ -292,10 +210,6 @@ gas_parser_lex(YYSTYPE *lvalp, yasm_parser_gas *parser_gas) if (s->eof && cursor == s->eof) return 0; - /* Handle rept */ - if (rept && !rept->ended) - goto rept_directive; - /* Jump to proper "exclusive" states */ switch (parser_gas->state) { case COMMENT: @@ -642,106 +556,4 @@ stringconst_scan: goto stringconst_scan; } */ - -rept_directive: - strbuf = yasm_xmalloc(STRBUF_ALLOC_SIZE); - strbuf_size = STRBUF_ALLOC_SIZE; - count = 0; - linestart = 1; - - -rept_scan: - SCANINIT(); - - /*!re2c - [\n;] { - /* Line ending, save in lines */ - new_line = yasm_xmalloc(sizeof(gas_rept_line)); - if (cursor == s->eof) { - yasm_xfree(strbuf); - return 0; - } - strbuf_append(count++, cursor, s, s->tok[0]); - new_line->data = strbuf; - new_line->len = count; - STAILQ_INSERT_TAIL(&rept->lines, new_line, link); - /* Allocate new strbuf */ - strbuf = yasm_xmalloc(STRBUF_ALLOC_SIZE); - strbuf_size = STRBUF_ALLOC_SIZE; - count = 0; - /* Mark start of line */ - linestart = 1; - goto rept_scan; - } - '.rept' { - int i; - if (linestart) { - /* We don't support nested right now, error */ - yasm_error_set(YASM_ERROR_GENERAL, - N_("nested rept not supported")); - yasm_errwarn_propagate(parser_gas->errwarns, cur_line); - } - for (i=0; i<6; i++) - strbuf_append(count++, cursor, s, s->tok[i]); - goto rept_scan; - } - '.endr' { - if (linestart) { - /* We're done, kick off the main lexer */ - rept->line = STAILQ_FIRST(&rept->lines); - if (!rept->line) { - /* Didn't get any intervening data? Empty repeat, so - * don't even bother. - */ - yasm_xfree(strbuf); - yasm_xfree(rept); - parser_gas->rept = NULL; - } else { - rept->ended = 1; - - /* Add .line as first line to get line numbers correct */ - new_line = yasm_xmalloc(sizeof(gas_rept_line)); - new_line->data = yasm_xmalloc(40); - sprintf((char *)new_line->data, ".line %lu;", - rept->startline+1); - new_line->len = strlen((char *)new_line->data); - STAILQ_INSERT_HEAD(&rept->lines, new_line, link); - - /* Save previous fill buffer */ - rept->oldbuf = parser_gas->s.bot; - rept->oldbuflen = s->lim - s->bot; - rept->oldbufpos = cursor - s->bot; - - /* Reset fill */ - s->bot = NULL; - s->tok = NULL; - s->ptr = NULL; - s->cur = NULL; - s->lim = NULL; - s->top = NULL; - s->eof = NULL; - cursor = NULL; - YYFILL(1); - } - - goto scan; - } else { - int i; - for (i=0; i<6; i++) - strbuf_append(count++, cursor, s, s->tok[i]); - goto rept_scan; - } - } - - any { - if (cursor == s->eof) { - yasm_xfree(strbuf); - return 0; - } - strbuf_append(count++, cursor, s, s->tok[0]); - linestart = 0; - goto rept_scan; - } - */ - } From ed1ff0ef267854e790799c7aa13b52bd3a3e1007 Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Tue, 5 Jan 2010 16:01:53 +0000 Subject: [PATCH 322/585] 1. Add gas preprocessor build on Windows 2. Add snprintf -> _snprintf define for VC++ build svn path=/trunk/yasm/; revision=2267 --- Mkfiles/vc10/genperf/run.bat | 2 +- Mkfiles/vc10/modules/modules.vcxproj | 3 +++ Mkfiles/vc10/modules/modules.vcxproj.filters | 12 ++++++++++++ Mkfiles/vc9/modules/modules.vcproj | 16 ++++++++++++++++ util.h | 4 ++++ 5 files changed, 36 insertions(+), 1 deletion(-) diff --git a/Mkfiles/vc10/genperf/run.bat b/Mkfiles/vc10/genperf/run.bat index 08639737..11e69040 100644 --- a/Mkfiles/vc10/genperf/run.bat +++ b/Mkfiles/vc10/genperf/run.bat @@ -6,7 +6,7 @@ goto answer%errorlevel% if not exist run_py.bat goto answer1 echo ... building with Python ... @echo on -call run_py.bat modules\arch\x86\gen_x86_insn.23.py +call run_py.bat modules\arch\x86\gen_x86_insn.py del run_py.bat @echo off goto end diff --git a/Mkfiles/vc10/modules/modules.vcxproj b/Mkfiles/vc10/modules/modules.vcxproj index 1d8abe42..8af38cf4 100644 --- a/Mkfiles/vc10/modules/modules.vcxproj +++ b/Mkfiles/vc10/modules/modules.vcxproj @@ -206,6 +206,8 @@ + + @@ -254,6 +256,7 @@ + diff --git a/Mkfiles/vc10/modules/modules.vcxproj.filters b/Mkfiles/vc10/modules/modules.vcxproj.filters index f85c74be..fbcd9fbf 100644 --- a/Mkfiles/vc10/modules/modules.vcxproj.filters +++ b/Mkfiles/vc10/modules/modules.vcxproj.filters @@ -29,6 +29,9 @@ {6b3956d4-0bff-4e8e-af61-a7e59b476fa4} + + {446fad62-ac17-49e9-8263-33481f04f182} + {33fb7fc8-61f9-428d-9c94-7a4912fbb678} @@ -139,6 +142,12 @@ Source Files\preprocs\cpp + + Source Files\preprocs\gas + + + Source Files\preprocs\gas + Source Files\preprocs\nasm @@ -192,6 +201,9 @@ Source Files\parsers + + Source Files\preprocs\gas + Source Files\preprocs\nasm diff --git a/Mkfiles/vc9/modules/modules.vcproj b/Mkfiles/vc9/modules/modules.vcproj index 77d9ab49..9de56658 100644 --- a/Mkfiles/vc9/modules/modules.vcproj +++ b/Mkfiles/vc9/modules/modules.vcproj @@ -578,6 +578,22 @@ > + + + + + + + + #ifdef HAVE_SYS_CDEFS_H From 553e615b567d53bac1b82bc08e28765326360f75 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 7 Jan 2010 06:55:03 +0000 Subject: [PATCH 323/585] Unbreak make distcheck. svn path=/trunk/yasm/; revision=2268 --- m4/Makefile.inc | 2 +- modules/preprocs/gas/Makefile.inc | 1 + modules/preprocs/gas/gas-preproc.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/m4/Makefile.inc b/m4/Makefile.inc index 4dac7a1c..1afffbbf 100644 --- a/m4/Makefile.inc +++ b/m4/Makefile.inc @@ -27,4 +27,4 @@ EXTRA_DIST += m4/progtest.m4 EXTRA_DIST += m4/stdint_h.m4 EXTRA_DIST += m4/uintmax_t.m4 EXTRA_DIST += m4/pythonhead.m4 -EXTRA_DIST += m4/pyrex.m4 +EXTRA_DIST += m4/cython.m4 diff --git a/modules/preprocs/gas/Makefile.inc b/modules/preprocs/gas/Makefile.inc index a53077b6..cbef0d22 100644 --- a/modules/preprocs/gas/Makefile.inc +++ b/modules/preprocs/gas/Makefile.inc @@ -1,6 +1,7 @@ # $Id$ libyasm_a_SOURCES += modules/preprocs/gas/gas-preproc.c +libyasm_a_SOURCES += modules/preprocs/gas/gas-eval.h libyasm_a_SOURCES += modules/preprocs/gas/gas-eval.c YASM_MODULES += preproc_gas diff --git a/modules/preprocs/gas/gas-preproc.c b/modules/preprocs/gas/gas-preproc.c index 998070bb..4c125066 100644 --- a/modules/preprocs/gas/gas-preproc.c +++ b/modules/preprocs/gas/gas-preproc.c @@ -29,7 +29,7 @@ /*@unused@*/ RCSID("$Id$"); #include -#include "gas-eval.h" +#include "modules/preprocs/gas/gas-eval.h" #define FALSE 0 #define TRUE 1 From c30e4abfd370409280eeea1dc5b785c02ef469a0 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 7 Jan 2010 07:00:05 +0000 Subject: [PATCH 324/585] Update autoconf/automake scripts. Also remove ltmain.sh as we no longer use libtool. Patch submitted by: Roumen Petrov svn path=/trunk/yasm/; revision=2269 --- Makefile.am | 11 +- config/ltmain.sh | 6919 ---------------------------------- configure.ac | 38 +- modules/arch/Makefile.inc | 2 +- modules/dbgfmts/Makefile.inc | 2 +- modules/objfmts/Makefile.inc | 2 +- modules/parsers/Makefile.inc | 2 +- 7 files changed, 27 insertions(+), 6949 deletions(-) delete mode 100755 config/ltmain.sh diff --git a/Makefile.am b/Makefile.am index 0ddc3bcd..9ddf2283 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,11 +2,13 @@ SUBDIRS = po . +ACLOCAL_AMFLAGS = -I m4 AM_YFLAGS = -d AM_CFLAGS = @MORE_CFLAGS@ bin_PROGRAMS = dist_man_MANS = +notrans_dist_man_MANS = TESTS = TESTS_ENVIRONMENT = noinst_PROGRAMS = genstring @@ -32,9 +34,6 @@ EXTRA_DIST = config/config.rpath # libyasm-stdint.h doesn't clean up after itself? CONFIG_CLEAN_FILES = libyasm-stdint.h -# automake doesn't distribute mkinstalldirs? -EXTRA_DIST += config/mkinstalldirs - EXTRA_DIST += tools/Makefile.inc EXTRA_DIST += libyasm/Makefile.inc EXTRA_DIST += modules/Makefile.inc @@ -89,20 +88,20 @@ EXTRA_DIST += Mkfiles/vc9/genperf/run.bat # Until this gets fixed in automake DISTCLEANFILES += libyasm/stamp-h libyasm/stamp-h[0-9]* -ACLOCAL_AMFLAGS = -I m4 - distclean-local: -rm -rf results if HAVE_PYTHON -rm -rf build endif +# Until gets fixed libyasm cross-build for target system +# use fixinstall-yasm-XXX make targets all-local: python-build install-exec-hook: python-install uninstall-hook: python-uninstall if BUILD_MAN -MAINTAINERCLEANFILES += $(dist_man_MANS) +MAINTAINERCLEANFILES += $(dist_man_MANS) $(notrans_dist_man_MANS) endif # genstring build diff --git a/config/ltmain.sh b/config/ltmain.sh deleted file mode 100755 index a85567fc..00000000 --- a/config/ltmain.sh +++ /dev/null @@ -1,6919 +0,0 @@ -# ltmain.sh - Provide generalized library-building support services. -# NOTE: Changing this file will not affect anything until you rerun configure. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 -# Free Software Foundation, Inc. -# Originally by Gordon Matzigkeit , 1996 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -basename="s,^.*/,,g" - -# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh -# is ksh but when the shell is invoked as "sh" and the current value of -# the _XPG environment variable is not equal to 1 (one), the special -# positional parameter $0, within a function call, is the name of the -# function. -progpath="$0" - -# The name of this program: -progname=`echo "$progpath" | $SED $basename` -modename="$progname" - -# Global variables: -EXIT_SUCCESS=0 -EXIT_FAILURE=1 - -PROGRAM=ltmain.sh -PACKAGE=libtool -VERSION=1.5.22 -TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)" - -# See if we are running on zsh, and set the options which allow our -# commands through without removal of \ escapes. -if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi - -# Check that we have a working $echo. -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then - # Yippee, $echo works! - : -else - # Restart under the correct shell, and then maybe $echo will work. - exec $SHELL "$progpath" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat <&2 - $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit $EXIT_FAILURE -fi - -# Global variables. -mode=$default_mode -nonopt= -prev= -prevopt= -run= -show="$echo" -show_help= -execute_dlfiles= -duplicate_deps=no -preserve_args= -lo2o="s/\\.lo\$/.${objext}/" -o2lo="s/\\.${objext}\$/.lo/" - -##################################### -# Shell function definitions: -# This seems to be the best place for them - -# func_mktempdir [string] -# Make a temporary directory that won't clash with other running -# libtool processes, and avoids race conditions if possible. If -# given, STRING is the basename for that directory. -func_mktempdir () -{ - my_template="${TMPDIR-/tmp}/${1-$progname}" - - if test "$run" = ":"; then - # Return a directory name, but don't create it in dry-run mode - my_tmpdir="${my_template}-$$" - else - - # If mktemp works, use that first and foremost - my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` - - if test ! -d "$my_tmpdir"; then - # Failing that, at least try and use $RANDOM to avoid a race - my_tmpdir="${my_template}-${RANDOM-0}$$" - - save_mktempdir_umask=`umask` - umask 0077 - $mkdir "$my_tmpdir" - umask $save_mktempdir_umask - fi - - # If we're not in dry-run mode, bomb out on failure - test -d "$my_tmpdir" || { - $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 - exit $EXIT_FAILURE - } - fi - - $echo "X$my_tmpdir" | $Xsed -} - - -# func_win32_libid arg -# return the library type of file 'arg' -# -# Need a lot of goo to handle *both* DLLs and import libs -# Has to be a shell function in order to 'eat' the argument -# that is supplied when $file_magic_command is called. -func_win32_libid () -{ - win32_libid_type="unknown" - win32_fileres=`file -L $1 2>/dev/null` - case $win32_fileres in - *ar\ archive\ import\ library*) # definitely import - win32_libid_type="x86 archive import" - ;; - *ar\ archive*) # could be an import, or static - if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ - $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then - win32_nmres=`eval $NM -f posix -A $1 | \ - $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'` - case $win32_nmres in - import*) win32_libid_type="x86 archive import";; - *) win32_libid_type="x86 archive static";; - esac - fi - ;; - *DLL*) - win32_libid_type="x86 DLL" - ;; - *executable*) # but shell scripts are "executable" too... - case $win32_fileres in - *MS\ Windows\ PE\ Intel*) - win32_libid_type="x86 DLL" - ;; - esac - ;; - esac - $echo $win32_libid_type -} - - -# func_infer_tag arg -# Infer tagged configuration to use if any are available and -# if one wasn't chosen via the "--tag" command line option. -# Only attempt this if the compiler in the base compile -# command doesn't match the default compiler. -# arg is usually of the form 'gcc ...' -func_infer_tag () -{ - # FreeBSD-specific: where we install compilers with non-standard names - tag_compilers_CC="*cc cc* *gcc gcc*" - tag_compilers_CXX="*c++ c++* *g++ g++*" - base_compiler=`set -- "$@"; echo $1` - - # If $tagname isn't set, then try to infer if the default "CC" tag applies - if test -z "$tagname"; then - for zp in $tag_compilers_CC; do - case $base_compiler in - $zp) tagname="CC"; break;; - esac - done - fi - - if test -n "$available_tags" && test -z "$tagname"; then - CC_quoted= - for arg in $CC; do - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - CC_quoted="$CC_quoted $arg" - done - case $@ in - # Blanks in the command may have been stripped by the calling shell, - # but not from the CC environment variable when configure was run. - " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; - # Blanks at the start of $base_compile will cause this to fail - # if we don't check for them as well. - *) - for z in $available_tags; do - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then - # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" - CC_quoted= - for arg in $CC; do - # Double-quote args containing other shell metacharacters. - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - CC_quoted="$CC_quoted $arg" - done - case "$@ " in - " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) - # The compiler in the base compile command matches - # the one in the tagged configuration. - # Assume this is the tagged configuration we want. - tagname=$z - break - ;; - esac - - # FreeBSD-specific: try compilers based on inferred tag - if test -z "$tagname"; then - eval "tag_compilers=\$tag_compilers_${z}" - if test -n "$tag_compilers"; then - for zp in $tag_compilers; do - case $base_compiler in - $zp) tagname=$z; break;; - esac - done - if test -n "$tagname"; then - break - fi - fi - fi - fi - done - # If $tagname still isn't set, then no tagged configuration - # was found and let the user know that the "--tag" command - # line option must be used. - if test -z "$tagname"; then - $echo "$modename: unable to infer tagged configuration" - $echo "$modename: specify a tag with \`--tag'" 1>&2 - exit $EXIT_FAILURE -# else -# $echo "$modename: using $tagname tagged configuration" - fi - ;; - esac - fi -} - - -# func_extract_an_archive dir oldlib -func_extract_an_archive () -{ - f_ex_an_ar_dir="$1"; shift - f_ex_an_ar_oldlib="$1" - - $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" - $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? - if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then - : - else - $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 - exit $EXIT_FAILURE - fi -} - -# func_extract_archives gentop oldlib ... -func_extract_archives () -{ - my_gentop="$1"; shift - my_oldlibs=${1+"$@"} - my_oldobjs="" - my_xlib="" - my_xabs="" - my_xdir="" - my_status="" - - $show "${rm}r $my_gentop" - $run ${rm}r "$my_gentop" - $show "$mkdir $my_gentop" - $run $mkdir "$my_gentop" - my_status=$? - if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then - exit $my_status - fi - - for my_xlib in $my_oldlibs; do - # Extract the objects. - case $my_xlib in - [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; - *) my_xabs=`pwd`"/$my_xlib" ;; - esac - my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` - my_xdir="$my_gentop/$my_xlib" - - $show "${rm}r $my_xdir" - $run ${rm}r "$my_xdir" - $show "$mkdir $my_xdir" - $run $mkdir "$my_xdir" - exit_status=$? - if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then - exit $exit_status - fi - case $host in - *-darwin*) - $show "Extracting $my_xabs" - # Do not bother doing anything if just a dry run - if test -z "$run"; then - darwin_orig_dir=`pwd` - cd $my_xdir || exit $? - darwin_archive=$my_xabs - darwin_curdir=`pwd` - darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` - darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` - if test -n "$darwin_arches"; then - darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` - darwin_arch= - $show "$darwin_base_archive has multiple architectures $darwin_arches" - for darwin_arch in $darwin_arches ; do - mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" - lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" - cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" - func_extract_an_archive "`pwd`" "${darwin_base_archive}" - cd "$darwin_curdir" - $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" - done # $darwin_arches - ## Okay now we have a bunch of thin objects, gotta fatten them up :) - darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` - darwin_file= - darwin_files= - for darwin_file in $darwin_filelist; do - darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` - lipo -create -output "$darwin_file" $darwin_files - done # $darwin_filelist - ${rm}r unfat-$$ - cd "$darwin_orig_dir" - else - cd "$darwin_orig_dir" - func_extract_an_archive "$my_xdir" "$my_xabs" - fi # $darwin_arches - fi # $run - ;; - *) - func_extract_an_archive "$my_xdir" "$my_xabs" - ;; - esac - my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` - done - func_extract_archives_result="$my_oldobjs" -} -# End of Shell function definitions -##################################### - -# Darwin sucks -eval std_shrext=\"$shrext_cmds\" - -disable_libs=no - -# Parse our command line options once, thoroughly. -while test "$#" -gt 0 -do - arg="$1" - shift - - case $arg in - -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; - *) optarg= ;; - esac - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - execute_dlfiles) - execute_dlfiles="$execute_dlfiles $arg" - ;; - tag) - tagname="$arg" - preserve_args="${preserve_args}=$arg" - - # Check whether tagname contains only valid characters - case $tagname in - *[!-_A-Za-z0-9,/]*) - $echo "$progname: invalid tag name: $tagname" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - case $tagname in - CC) - # Don't test for the "default" C tag, as we know, it's there, but - # not specially marked. - ;; - *) - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then - taglist="$taglist $tagname" - # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" - else - $echo "$progname: ignoring unknown tag $tagname" 1>&2 - fi - ;; - esac - ;; - *) - eval "$prev=\$arg" - ;; - esac - - prev= - prevopt= - continue - fi - - # Have we seen a non-optional argument yet? - case $arg in - --help) - show_help=yes - ;; - - --version) - $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" - $echo - $echo "Copyright (C) 2005 Free Software Foundation, Inc." - $echo "This is free software; see the source for copying conditions. There is NO" - $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - exit $? - ;; - - --config) - ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath - # Now print the configurations for the tags. - for tagname in $taglist; do - ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" - done - exit $? - ;; - - --debug) - $echo "$progname: enabling shell trace mode" - set -x - preserve_args="$preserve_args $arg" - ;; - - --dry-run | -n) - run=: - ;; - - --features) - $echo "host: $host" - if test "$build_libtool_libs" = yes; then - $echo "enable shared libraries" - else - $echo "disable shared libraries" - fi - if test "$build_old_libs" = yes; then - $echo "enable static libraries" - else - $echo "disable static libraries" - fi - exit $? - ;; - - --finish) mode="finish" ;; - - --mode) prevopt="--mode" prev=mode ;; - --mode=*) mode="$optarg" ;; - - --preserve-dup-deps) duplicate_deps="yes" ;; - - --quiet | --silent) - show=: - preserve_args="$preserve_args $arg" - ;; - - --tag) - prevopt="--tag" - prev=tag - preserve_args="$preserve_args --tag" - ;; - --tag=*) - set tag "$optarg" ${1+"$@"} - shift - prev=tag - preserve_args="$preserve_args --tag" - ;; - - -dlopen) - prevopt="-dlopen" - prev=execute_dlfiles - ;; - - -*) - $echo "$modename: unrecognized option \`$arg'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; - - *) - nonopt="$arg" - break - ;; - esac -done - -if test -n "$prevopt"; then - $echo "$modename: option \`$prevopt' requires an argument" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE -fi - -case $disable_libs in -no) - ;; -shared) - build_libtool_libs=no - build_old_libs=yes - ;; -static) - build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` - ;; -esac - -# If this variable is set in any of the actions, the command in it -# will be execed at the end. This prevents here-documents from being -# left over by shells. -exec_cmd= - -if test -z "$show_help"; then - - # Infer the operation mode. - if test -z "$mode"; then - $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 - $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 - case $nonopt in - *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) - mode=link - for arg - do - case $arg in - -c) - mode=compile - break - ;; - esac - done - ;; - *db | *dbx | *strace | *truss) - mode=execute - ;; - *install*|cp|mv) - mode=install - ;; - *rm) - mode=uninstall - ;; - *) - # If we have no mode, but dlfiles were specified, then do execute mode. - test -n "$execute_dlfiles" && mode=execute - - # Just use the default operation mode. - if test -z "$mode"; then - if test -n "$nonopt"; then - $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 - else - $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 - fi - fi - ;; - esac - fi - - # Only execute mode is allowed to have -dlopen flags. - if test -n "$execute_dlfiles" && test "$mode" != execute; then - $echo "$modename: unrecognized option \`-dlopen'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Change the help message to a mode-specific one. - generic_help="$help" - help="Try \`$modename --help --mode=$mode' for more information." - - # These modes are in order of execution frequency so that they run quickly. - case $mode in - # libtool compile mode - compile) - modename="$modename: compile" - # Get the compilation command and the source file. - base_compile= - srcfile="$nonopt" # always keep a non-empty value in "srcfile" - suppress_opt=yes - suppress_output= - arg_mode=normal - libobj= - later= - - for arg - do - case $arg_mode in - arg ) - # do not "continue". Instead, add this to base_compile - lastarg="$arg" - arg_mode=normal - ;; - - target ) - libobj="$arg" - arg_mode=normal - continue - ;; - - normal ) - # Accept any command-line options. - case $arg in - -o) - if test -n "$libobj" ; then - $echo "$modename: you cannot specify \`-o' more than once" 1>&2 - exit $EXIT_FAILURE - fi - arg_mode=target - continue - ;; - - -static | -prefer-pic | -prefer-non-pic) - later="$later $arg" - continue - ;; - - -no-suppress) - suppress_opt=no - continue - ;; - - -Xcompiler) - arg_mode=arg # the next one goes into the "base_compile" arg list - continue # The current "srcfile" will either be retained or - ;; # replaced later. I would guess that would be a bug. - - -Wc,*) - args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` - lastarg= - save_ifs="$IFS"; IFS=',' - for arg in $args; do - IFS="$save_ifs" - - # Double-quote args containing other shell metacharacters. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - lastarg="$lastarg $arg" - done - IFS="$save_ifs" - lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` - - # Add the arguments to base_compile. - base_compile="$base_compile $lastarg" - continue - ;; - - * ) - # Accept the current argument as the source file. - # The previous "srcfile" becomes the current argument. - # - lastarg="$srcfile" - srcfile="$arg" - ;; - esac # case $arg - ;; - esac # case $arg_mode - - # Aesthetically quote the previous argument. - lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` - - case $lastarg in - # Double-quote args containing other shell metacharacters. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, and some SunOS ksh mistreat backslash-escaping - # in scan sets (worked around with variable expansion), - # and furthermore cannot handle '|' '&' '(' ')' in scan sets - # at all, so we specify them separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - lastarg="\"$lastarg\"" - ;; - esac - - base_compile="$base_compile $lastarg" - done # for arg - - case $arg_mode in - arg) - $echo "$modename: you must specify an argument for -Xcompile" - exit $EXIT_FAILURE - ;; - target) - $echo "$modename: you must specify a target with \`-o'" 1>&2 - exit $EXIT_FAILURE - ;; - *) - # Get the name of the library object. - [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` - ;; - esac - - # Recognize several different file suffixes. - # If the user specifies -o file.o, it is replaced with file.lo - xform='[cCFSifmso]' - case $libobj in - *.ada) xform=ada ;; - *.adb) xform=adb ;; - *.ads) xform=ads ;; - *.asm) xform=asm ;; - *.c++) xform=c++ ;; - *.cc) xform=cc ;; - *.ii) xform=ii ;; - *.class) xform=class ;; - *.cpp) xform=cpp ;; - *.cxx) xform=cxx ;; - *.f90) xform=f90 ;; - *.for) xform=for ;; - *.java) xform=java ;; - esac - - libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` - - case $libobj in - *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; - *) - $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - func_infer_tag $base_compile - - for arg in $later; do - case $arg in - -static) - build_old_libs=yes - continue - ;; - - -prefer-pic) - pic_mode=yes - continue - ;; - - -prefer-non-pic) - pic_mode=no - continue - ;; - esac - done - - qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` - case $qlibobj in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - qlibobj="\"$qlibobj\"" ;; - esac - test "X$libobj" != "X$qlibobj" \ - && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ - && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." - objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` - xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$obj"; then - xdir= - else - xdir=$xdir/ - fi - lobj=${xdir}$objdir/$objname - - if test -z "$base_compile"; then - $echo "$modename: you must specify a compilation command" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Delete any leftover library objects. - if test "$build_old_libs" = yes; then - removelist="$obj $lobj $libobj ${libobj}T" - else - removelist="$lobj $libobj ${libobj}T" - fi - - $run $rm $removelist - trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 - - # On Cygwin there's no "real" PIC flag so we must build both object types - case $host_os in - cygwin* | mingw* | pw32* | os2*) - pic_mode=default - ;; - esac - if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then - # non-PIC code in shared libraries is not supported - pic_mode=default - fi - - # Calculate the filename of the output object if compiler does - # not support -o with -c - if test "$compiler_c_o" = no; then - output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} - lockfile="$output_obj.lock" - removelist="$removelist $output_obj $lockfile" - trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 - else - output_obj= - need_locks=no - lockfile= - fi - - # Lock this critical section if it is needed - # We use this script file to make the link, it avoids creating a new file - if test "$need_locks" = yes; then - until $run ln "$progpath" "$lockfile" 2>/dev/null; do - $show "Waiting for $lockfile to be removed" - sleep 2 - done - elif test "$need_locks" = warn; then - if test -f "$lockfile"; then - $echo "\ -*** ERROR, $lockfile exists and contains: -`cat $lockfile 2>/dev/null` - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit $EXIT_FAILURE - fi - $echo "$srcfile" > "$lockfile" - fi - - if test -n "$fix_srcfile_path"; then - eval srcfile=\"$fix_srcfile_path\" - fi - qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` - case $qsrcfile in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - qsrcfile="\"$qsrcfile\"" ;; - esac - - $run $rm "$libobj" "${libobj}T" - - # Create a libtool object file (analogous to a ".la" file), - # but don't create it if we're doing a dry run. - test -z "$run" && cat > ${libobj}T </dev/null`" != "X$srcfile"; then - $echo "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit $EXIT_FAILURE - fi - - # Just move the object if needed, then go on to compile the next one - if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then - $show "$mv $output_obj $lobj" - if $run $mv $output_obj $lobj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - fi - - # Append the name of the PIC object to the libtool object file. - test -z "$run" && cat >> ${libobj}T <> ${libobj}T </dev/null`" != "X$srcfile"; then - $echo "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit $EXIT_FAILURE - fi - - # Just move the object if needed - if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then - $show "$mv $output_obj $obj" - if $run $mv $output_obj $obj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - fi - - # Append the name of the non-PIC object the libtool object file. - # Only append if the libtool object file exists. - test -z "$run" && cat >> ${libobj}T <> ${libobj}T <&2 - fi - if test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=yes - else - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=built - fi - build_libtool_libs=no - build_old_libs=yes - break - ;; - esac - done - - # See if our shared archives depend on static archives. - test -n "$old_archive_from_new_cmds" && build_old_libs=yes - - # Go through the arguments, transforming them on the way. - while test "$#" -gt 0; do - arg="$1" - shift - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test - ;; - *) qarg=$arg ;; - esac - libtool_args="$libtool_args $qarg" - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - output) - compile_command="$compile_command @OUTPUT@" - finalize_command="$finalize_command @OUTPUT@" - ;; - esac - - case $prev in - dlfiles|dlprefiles) - if test "$preload" = no; then - # Add the symbol object into the linking commands. - compile_command="$compile_command @SYMFILE@" - finalize_command="$finalize_command @SYMFILE@" - preload=yes - fi - case $arg in - *.la | *.lo) ;; # We handle these cases below. - force) - if test "$dlself" = no; then - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - self) - if test "$prev" = dlprefiles; then - dlself=yes - elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then - dlself=yes - else - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - *) - if test "$prev" = dlfiles; then - dlfiles="$dlfiles $arg" - else - dlprefiles="$dlprefiles $arg" - fi - prev= - continue - ;; - esac - ;; - expsyms) - export_symbols="$arg" - if test ! -f "$arg"; then - $echo "$modename: symbol file \`$arg' does not exist" - exit $EXIT_FAILURE - fi - prev= - continue - ;; - expsyms_regex) - export_symbols_regex="$arg" - prev= - continue - ;; - inst_prefix) - inst_prefix_dir="$arg" - prev= - continue - ;; - precious_regex) - precious_files_regex="$arg" - prev= - continue - ;; - release) - release="-$arg" - prev= - continue - ;; - objectlist) - if test -f "$arg"; then - save_arg=$arg - moreargs= - for fil in `cat $save_arg` - do -# moreargs="$moreargs $fil" - arg=$fil - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - pic_object= - non_pic_object= - - # Read the .lo file - # If there is no directory component, then add one. - case $arg in - */* | *\\*) . $arg ;; - *) . ./$arg ;; - esac - - if test -z "$pic_object" || \ - test -z "$non_pic_object" || - test "$pic_object" = none && \ - test "$non_pic_object" = none; then - $echo "$modename: cannot find name of object for \`$arg'" 1>&2 - exit $EXIT_FAILURE - fi - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - if test "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - dlfiles="$dlfiles $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. - dlprefiles="$dlprefiles $pic_object" - prev= - fi - - # A PIC object. - libobjs="$libobjs $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - non_pic_objects="$non_pic_objects $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" - fi - else - # If the PIC object exists, use it instead. - # $xdir was prepended to $pic_object above. - non_pic_object="$pic_object" - non_pic_objects="$non_pic_objects $non_pic_object" - fi - else - # Only an error if not doing a dry-run. - if test -z "$run"; then - $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 - exit $EXIT_FAILURE - else - # Dry-run case. - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` - non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` - libobjs="$libobjs $pic_object" - non_pic_objects="$non_pic_objects $non_pic_object" - fi - fi - done - else - $echo "$modename: link input file \`$save_arg' does not exist" - exit $EXIT_FAILURE - fi - arg=$save_arg - prev= - continue - ;; - rpath | xrpath) - # We need an absolute path. - case $arg in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - $echo "$modename: only absolute run-paths are allowed" 1>&2 - exit $EXIT_FAILURE - ;; - esac - if test "$prev" = rpath; then - case "$rpath " in - *" $arg "*) ;; - *) rpath="$rpath $arg" ;; - esac - else - case "$xrpath " in - *" $arg "*) ;; - *) xrpath="$xrpath $arg" ;; - esac - fi - prev= - continue - ;; - xcompiler) - compiler_flags="$compiler_flags $qarg" - prev= - compile_command="$compile_command $qarg" - finalize_command="$finalize_command $qarg" - continue - ;; - xlinker) - linker_flags="$linker_flags $qarg" - compiler_flags="$compiler_flags $wl$qarg" - prev= - compile_command="$compile_command $wl$qarg" - finalize_command="$finalize_command $wl$qarg" - continue - ;; - xcclinker) - linker_flags="$linker_flags $qarg" - compiler_flags="$compiler_flags $qarg" - prev= - compile_command="$compile_command $qarg" - finalize_command="$finalize_command $qarg" - continue - ;; - shrext) - shrext_cmds="$arg" - prev= - continue - ;; - darwin_framework|darwin_framework_skip) - test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - prev= - continue - ;; - *) - eval "$prev=\"\$arg\"" - prev= - continue - ;; - esac - fi # test -n "$prev" - - prevarg="$arg" - - case $arg in - -all-static) - if test -n "$link_static_flag"; then - compile_command="$compile_command $link_static_flag" - finalize_command="$finalize_command $link_static_flag" - fi - continue - ;; - - -allow-undefined) - # FIXME: remove this flag sometime in the future. - $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 - continue - ;; - - -avoid-version) - avoid_version=yes - continue - ;; - - -dlopen) - prev=dlfiles - continue - ;; - - -dlpreopen) - prev=dlprefiles - continue - ;; - - -export-dynamic) - export_dynamic=yes - continue - ;; - - -export-symbols | -export-symbols-regex) - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - $echo "$modename: more than one -exported-symbols argument is not allowed" - exit $EXIT_FAILURE - fi - if test "X$arg" = "X-export-symbols"; then - prev=expsyms - else - prev=expsyms_regex - fi - continue - ;; - - -framework|-arch|-isysroot) - case " $CC " in - *" ${arg} ${1} "* | *" ${arg} ${1} "*) - prev=darwin_framework_skip ;; - *) compiler_flags="$compiler_flags $arg" - prev=darwin_framework ;; - esac - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - continue - ;; - - -inst-prefix-dir) - prev=inst_prefix - continue - ;; - - # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* - # so, if we see these flags be careful not to treat them like -L - -L[A-Z][A-Z]*:*) - case $with_gcc/$host in - no/*-*-irix* | /*-*-irix*) - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - ;; - esac - continue - ;; - - -L*) - dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 - absdir="$dir" - notinst_path="$notinst_path $dir" - fi - dir="$absdir" - ;; - esac - case "$deplibs " in - *" -L$dir "*) ;; - *) - deplibs="$deplibs -L$dir" - lib_search_path="$lib_search_path $dir" - ;; - esac - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$dir:"*) ;; - *) dllsearchpath="$dllsearchpath:$dir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - *) dllsearchpath="$dllsearchpath:$testbindir";; - esac - ;; - esac - continue - ;; - - -l*) - if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) - # These systems don't actually have a C or math library (as such) - continue - ;; - *-*-os2*) - # These systems don't actually have a C library (as such) - test "X$arg" = "X-lc" && continue - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc due to us having libc/libc_r. - test "X$arg" = "X-lc" && continue - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C and math libraries are in the System framework - deplibs="$deplibs -framework System" - continue - ;; - *-*-sco3.2v5* | *-*-sco5v6*) - # Causes problems with __ctype - test "X$arg" = "X-lc" && continue - ;; - *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) - # Compiler inserts libc in the correct place for threads to work - test "X$arg" = "X-lc" && continue - ;; - esac - elif test "X$arg" = "X-lc_r"; then - case $host in - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc_r directly, use -pthread flag. - continue - ;; - esac - fi - deplibs="$deplibs $arg" - continue - ;; - - # Tru64 UNIX uses -model [arg] to determine the layout of C++ - # classes, name mangling, and exception handling. - -model) - compile_command="$compile_command $arg" - compiler_flags="$compiler_flags $arg" - finalize_command="$finalize_command $arg" - prev=xcompiler - continue - ;; - - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) - compiler_flags="$compiler_flags $arg" - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - deplibs="$deplibs $arg" - continue - ;; - - -module) - module=yes - continue - ;; - - # -64, -mips[0-9] enable 64-bit mode on the SGI compiler - # -r[0-9][0-9]* specifies the processor on the SGI compiler - # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler - # +DA*, +DD* enable 64-bit mode on the HP compiler - # -q* pass through compiler args for the IBM compiler - # -m* pass through architecture-specific compiler args for GCC - # -m*, -t[45]*, -txscale* pass through architecture-specific - # compiler args for GCC - # -pg pass through profiling flag for GCC - # @file GCC response files - -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \ - -t[45]*|-txscale*|@*) - - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - compiler_flags="$compiler_flags $arg" - continue - ;; - - -shrext) - prev=shrext - continue - ;; - - -no-fast-install) - fast_install=no - continue - ;; - - -no-install) - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - # The PATH hackery in wrapper scripts is required on Windows - # in order for the loader to find any dlls it needs. - $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 - $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 - fast_install=no - ;; - *) no_install=yes ;; - esac - continue - ;; - - -no-undefined) - allow_undefined=no - continue - ;; - - -objectlist) - prev=objectlist - continue - ;; - - -o) prev=output ;; - - -precious-files-regex) - prev=precious_regex - continue - ;; - - -release) - prev=release - continue - ;; - - -rpath) - prev=rpath - continue - ;; - - -R) - prev=xrpath - continue - ;; - - -R*) - dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - $echo "$modename: only absolute run-paths are allowed" 1>&2 - exit $EXIT_FAILURE - ;; - esac - case "$xrpath " in - *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; - esac - continue - ;; - - -static) - # The effects of -static are defined in a previous loop. - # We used to do the same as -all-static on platforms that - # didn't have a PIC flag, but the assumption that the effects - # would be equivalent was wrong. It would break on at least - # Digital Unix and AIX. - continue - ;; - - -thread-safe) - thread_safe=yes - continue - ;; - - -version-info) - prev=vinfo - continue - ;; - -version-number) - prev=vinfo - vinfo_number=yes - continue - ;; - - -Wc,*) - args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` - arg= - save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - case $flag in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - flag="\"$flag\"" - ;; - esac - arg="$arg $wl$flag" - compiler_flags="$compiler_flags $flag" - done - IFS="$save_ifs" - arg=`$echo "X$arg" | $Xsed -e "s/^ //"` - ;; - - -Wl,*) - args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` - arg= - save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - case $flag in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - flag="\"$flag\"" - ;; - esac - arg="$arg $wl$flag" - compiler_flags="$compiler_flags $wl$flag" - linker_flags="$linker_flags $flag" - done - IFS="$save_ifs" - arg=`$echo "X$arg" | $Xsed -e "s/^ //"` - ;; - - -Xcompiler) - prev=xcompiler - continue - ;; - - -Xlinker) - prev=xlinker - continue - ;; - - -XCClinker) - prev=xcclinker - continue - ;; - - # Some other compiler flag. - -* | +*) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - ;; - - *.$objext) - # A standard object. - objs="$objs $arg" - ;; - - *.lo) - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - pic_object= - non_pic_object= - - # Read the .lo file - # If there is no directory component, then add one. - case $arg in - */* | *\\*) . $arg ;; - *) . ./$arg ;; - esac - - if test -z "$pic_object" || \ - test -z "$non_pic_object" || - test "$pic_object" = none && \ - test "$non_pic_object" = none; then - $echo "$modename: cannot find name of object for \`$arg'" 1>&2 - exit $EXIT_FAILURE - fi - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - if test "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - dlfiles="$dlfiles $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. - dlprefiles="$dlprefiles $pic_object" - prev= - fi - - # A PIC object. - libobjs="$libobjs $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - non_pic_objects="$non_pic_objects $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" - fi - else - # If the PIC object exists, use it instead. - # $xdir was prepended to $pic_object above. - non_pic_object="$pic_object" - non_pic_objects="$non_pic_objects $non_pic_object" - fi - else - # Only an error if not doing a dry-run. - if test -z "$run"; then - $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 - exit $EXIT_FAILURE - else - # Dry-run case. - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` - non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` - libobjs="$libobjs $pic_object" - non_pic_objects="$non_pic_objects $non_pic_object" - fi - fi - ;; - - *.$libext) - # An archive. - deplibs="$deplibs $arg" - old_deplibs="$old_deplibs $arg" - continue - ;; - - *.la) - # A libtool-controlled library. - - if test "$prev" = dlfiles; then - # This library was specified with -dlopen. - dlfiles="$dlfiles $arg" - prev= - elif test "$prev" = dlprefiles; then - # The library was specified with -dlpreopen. - dlprefiles="$dlprefiles $arg" - prev= - else - deplibs="$deplibs $arg" - fi - continue - ;; - - # Some other compiler argument. - *) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - ;; - esac # arg - - # Now actually substitute the argument into the commands. - if test -n "$arg"; then - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - fi - done # argument parsing loop - - if test -n "$prev"; then - $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then - eval arg=\"$export_dynamic_flag_spec\" - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - fi - - oldlibs= - # calculate the name of the file, without its directory - outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` - libobjs_save="$libobjs" - - if test -n "$shlibpath_var"; then - # get the directories listed in $shlibpath_var - eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` - else - shlib_search_path= - fi - eval sys_lib_search_path=\"$sys_lib_search_path_spec\" - eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" - - output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` - if test "X$output_objdir" = "X$output"; then - output_objdir="$objdir" - else - output_objdir="$output_objdir/$objdir" - fi - # Create the object directory. - if test ! -d "$output_objdir"; then - $show "$mkdir $output_objdir" - $run $mkdir $output_objdir - exit_status=$? - if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then - exit $exit_status - fi - fi - - # Determine the type of output - case $output in - "") - $echo "$modename: you must specify an output file" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; - *.$libext) linkmode=oldlib ;; - *.lo | *.$objext) linkmode=obj ;; - *.la) linkmode=lib ;; - *) linkmode=prog ;; # Anything else should be a program. - esac - - case $host in - *cygwin* | *mingw* | *pw32*) - # don't eliminate duplications in $postdeps and $predeps - duplicate_compiler_generated_deps=yes - ;; - *) - duplicate_compiler_generated_deps=$duplicate_deps - ;; - esac - specialdeplibs= - - libs= - # Find all interdependent deplibs by searching for libraries - # that are linked more than once (e.g. -la -lb -la) - for deplib in $deplibs; do - if test "X$duplicate_deps" = "Xyes" ; then - case "$libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - libs="$libs $deplib" - done - - if test "$linkmode" = lib; then - libs="$predeps $libs $compiler_lib_search_path $postdeps" - - # Compute libraries that are listed more than once in $predeps - # $postdeps and mark them as special (i.e., whose duplicates are - # not to be eliminated). - pre_post_deps= - if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then - for pre_post_dep in $predeps $postdeps; do - case "$pre_post_deps " in - *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; - esac - pre_post_deps="$pre_post_deps $pre_post_dep" - done - fi - pre_post_deps= - fi - - deplibs= - newdependency_libs= - newlib_search_path= - need_relink=no # whether we're linking any uninstalled libtool libraries - notinst_deplibs= # not-installed libtool libraries - case $linkmode in - lib) - passes="conv link" - for file in $dlfiles $dlprefiles; do - case $file in - *.la) ;; - *) - $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 - exit $EXIT_FAILURE - ;; - esac - done - ;; - prog) - compile_deplibs= - finalize_deplibs= - alldeplibs=no - newdlfiles= - newdlprefiles= - passes="conv scan dlopen dlpreopen link" - ;; - *) passes="conv" - ;; - esac - for pass in $passes; do - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan"; then - libs="$deplibs" - deplibs= - fi - if test "$linkmode" = prog; then - case $pass in - dlopen) libs="$dlfiles" ;; - dlpreopen) libs="$dlprefiles" ;; - link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; - esac - fi - if test "$pass" = dlopen; then - # Collect dlpreopened libraries - save_deplibs="$deplibs" - deplibs= - fi - for deplib in $libs; do - lib= - found=no - case $deplib in - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - compiler_flags="$compiler_flags $deplib" - fi - - case $linkmode in - lib) - deplibs="$deplib $deplibs" - test "$pass" = conv && continue - newdependency_libs="$deplib $newdependency_libs" - ;; - prog) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - if test "$pass" = scan; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - ;; - *) - ;; - esac # linkmode - - continue - ;; - -l*) - if test "$linkmode" != lib && test "$linkmode" != prog; then - $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 - continue - fi - name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` - for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do - for search_ext in .la $std_shrext .so .a; do - # Search the libtool library - lib="$searchdir/lib${name}${search_ext}" - if test -f "$lib"; then - if test "$search_ext" = ".la"; then - found=yes - else - found=no - fi - break 2 - fi - done - done - if test "$found" != yes; then - # deplib doesn't seem to be a libtool library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - else # deplib is a libtool library - # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, - # We need to do some special things here, and not later. - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $deplib "*) - if (${SED} -e '2q' $lib | - grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - library_names= - old_library= - case $lib in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - for l in $old_library $library_names; do - ll="$l" - done - if test "X$ll" = "X$old_library" ; then # only static version available - found=no - ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` - test "X$ladir" = "X$lib" && ladir="." - lib=$ladir/$old_library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - fi - fi - ;; - *) ;; - esac - fi - fi - ;; # -l - -L*) - case $linkmode in - lib) - deplibs="$deplib $deplibs" - test "$pass" = conv && continue - newdependency_libs="$deplib $newdependency_libs" - newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` - ;; - prog) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - if test "$pass" = scan; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` - ;; - *) - $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 - ;; - esac # linkmode - continue - ;; # -L - -R*) - if test "$pass" = link; then - dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` - # Make sure the xrpath contains only unique directories. - case "$xrpath " in - *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; - esac - fi - deplibs="$deplib $deplibs" - continue - ;; - *.la) lib="$deplib" ;; - *.$libext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - case $linkmode in - lib) - valid_a_lib=no - case $deplibs_check_method in - match_pattern*) - set dummy $deplibs_check_method - match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` - if eval $echo \"$deplib\" 2>/dev/null \ - | $SED 10q \ - | $EGREP "$match_pattern_regex" > /dev/null; then - valid_a_lib=yes - fi - ;; - pass_all) - valid_a_lib=yes - ;; - esac - if test "$valid_a_lib" != yes; then - $echo - $echo "*** Warning: Trying to link with static lib archive $deplib." - $echo "*** I have the capability to make that library automatically link in when" - $echo "*** you link to this library. But I can only do this if you have a" - $echo "*** shared version of the library, which you do not appear to have" - $echo "*** because the file extensions .$libext of this argument makes me believe" - $echo "*** that it is just a static archive that I should not used here." - else - $echo - $echo "*** Warning: Linking the shared library $output against the" - $echo "*** static library $deplib is not portable!" - deplibs="$deplib $deplibs" - fi - continue - ;; - prog) - if test "$pass" != link; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - continue - ;; - esac # linkmode - ;; # *.$libext - *.lo | *.$objext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - elif test "$linkmode" = prog; then - if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then - # If there is no dlopen support or we're linking statically, - # we need to preload. - newdlprefiles="$newdlprefiles $deplib" - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - newdlfiles="$newdlfiles $deplib" - fi - fi - continue - ;; - %DEPLIBS%) - alldeplibs=yes - continue - ;; - esac # case $deplib - if test "$found" = yes || test -f "$lib"; then : - else - $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2 - exit $EXIT_FAILURE - fi - - # Check to see that this really is a libtool archive. - if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - - ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` - test "X$ladir" = "X$lib" && ladir="." - - dlname= - dlopen= - dlpreopen= - libdir= - library_names= - old_library= - # If the library was installed with an old release of libtool, - # it will not redefine variables installed, or shouldnotlink - installed=yes - shouldnotlink=no - avoidtemprpath= - - - # Read the .la file - case $lib in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan" || - { test "$linkmode" != prog && test "$linkmode" != lib; }; then - test -n "$dlopen" && dlfiles="$dlfiles $dlopen" - test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" - fi - - if test "$pass" = conv; then - # Only check for convenience libraries - deplibs="$lib $deplibs" - if test -z "$libdir"; then - if test -z "$old_library"; then - $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 - exit $EXIT_FAILURE - fi - # It is a libtool convenience library, so add in its objects. - convenience="$convenience $ladir/$objdir/$old_library" - old_convenience="$old_convenience $ladir/$objdir/$old_library" - tmp_libs= - for deplib in $dependency_libs; do - deplibs="$deplib $deplibs" - if test "X$duplicate_deps" = "Xyes" ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done - elif test "$linkmode" != prog && test "$linkmode" != lib; then - $echo "$modename: \`$lib' is not a convenience library" 1>&2 - exit $EXIT_FAILURE - fi - continue - fi # $pass = conv - - - # Get the name of the library we link against. - linklib= - for l in $old_library $library_names; do - linklib="$l" - done - if test -z "$linklib"; then - $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 - exit $EXIT_FAILURE - fi - - # This library was specified with -dlopen. - if test "$pass" = dlopen; then - if test -z "$libdir"; then - $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 - exit $EXIT_FAILURE - fi - if test -z "$dlname" || - test "$dlopen_support" != yes || - test "$build_libtool_libs" = no; then - # If there is no dlname, no dlopen support or we're linking - # statically, we need to preload. We also need to preload any - # dependent libraries so libltdl's deplib preloader doesn't - # bomb out in the load deplibs phase. - dlprefiles="$dlprefiles $lib $dependency_libs" - else - newdlfiles="$newdlfiles $lib" - fi - continue - fi # $pass = dlopen - - # We need an absolute path. - case $ladir in - [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; - *) - abs_ladir=`cd "$ladir" && pwd` - if test -z "$abs_ladir"; then - $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 - $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 - abs_ladir="$ladir" - fi - ;; - esac - laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - - # Find the relevant object directory and library name. - if test "X$installed" = Xyes; then - if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then - $echo "$modename: warning: library \`$lib' was moved." 1>&2 - dir="$ladir" - absdir="$abs_ladir" - libdir="$abs_ladir" - else - dir="$libdir" - absdir="$libdir" - fi - test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes - else - if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then - dir="$ladir" - absdir="$abs_ladir" - # Remove this search path later - notinst_path="$notinst_path $abs_ladir" - else - dir="$ladir/$objdir" - absdir="$abs_ladir/$objdir" - # Remove this search path later - notinst_path="$notinst_path $abs_ladir" - fi - fi # $installed = yes - name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` - - # This library was specified with -dlpreopen. - if test "$pass" = dlpreopen; then - if test -z "$libdir"; then - $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 - exit $EXIT_FAILURE - fi - # Prefer using a static library (so that no silly _DYNAMIC symbols - # are required to link). - if test -n "$old_library"; then - newdlprefiles="$newdlprefiles $dir/$old_library" - # Otherwise, use the dlname, so that lt_dlopen finds it. - elif test -n "$dlname"; then - newdlprefiles="$newdlprefiles $dir/$dlname" - else - newdlprefiles="$newdlprefiles $dir/$linklib" - fi - fi # $pass = dlpreopen - - if test -z "$libdir"; then - # Link the convenience library - if test "$linkmode" = lib; then - deplibs="$dir/$old_library $deplibs" - elif test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$dir/$old_library $compile_deplibs" - finalize_deplibs="$dir/$old_library $finalize_deplibs" - else - deplibs="$lib $deplibs" # used for prog,scan pass - fi - continue - fi - - - if test "$linkmode" = prog && test "$pass" != link; then - newlib_search_path="$newlib_search_path $ladir" - deplibs="$lib $deplibs" - - linkalldeplibs=no - if test "$link_all_deplibs" != no || test -z "$library_names" || - test "$build_libtool_libs" = no; then - linkalldeplibs=yes - fi - - tmp_libs= - for deplib in $dependency_libs; do - case $deplib in - -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test - esac - # Need to link against all dependency_libs? - if test "$linkalldeplibs" = yes; then - deplibs="$deplib $deplibs" - else - # Need to hardcode shared library paths - # or/and link against static libraries - newdependency_libs="$deplib $newdependency_libs" - fi - if test "X$duplicate_deps" = "Xyes" ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done # for deplib - continue - fi # $linkmode = prog... - - if test "$linkmode,$pass" = "prog,link"; then - if test -n "$library_names" && - { test "$prefer_static_libs" = no || test -z "$old_library"; }; then - # We need to hardcode the library path - if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then - # Make sure the rpath contains only unique directories. - case "$temp_rpath " in - *" $dir "*) ;; - *" $absdir "*) ;; - *) temp_rpath="$temp_rpath $absdir" ;; - esac - fi - - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) compile_rpath="$compile_rpath $absdir" - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" - esac - ;; - esac - fi # $linkmode,$pass = prog,link... - - if test "$alldeplibs" = yes && - { test "$deplibs_check_method" = pass_all || - { test "$build_libtool_libs" = yes && - test -n "$library_names"; }; }; then - # We only need to search for static libraries - continue - fi - fi - - link_static=no # Whether the deplib will be linked statically - use_static_libs=$prefer_static_libs - if test "$use_static_libs" = built && test "$installed" = yes ; then - use_static_libs=no - fi - if test -n "$library_names" && - { test "$use_static_libs" = no || test -z "$old_library"; }; then - if test "$installed" = no; then - notinst_deplibs="$notinst_deplibs $lib" - need_relink=yes - fi - # This is a shared library - - # Warn about portability, can't link against -module's on - # some systems (darwin) - if test "$shouldnotlink" = yes && test "$pass" = link ; then - $echo - if test "$linkmode" = prog; then - $echo "*** Warning: Linking the executable $output against the loadable module" - else - $echo "*** Warning: Linking the shared library $output against the loadable module" - fi - $echo "*** $linklib is not portable!" - fi - if test "$linkmode" = lib && - test "$hardcode_into_libs" = yes; then - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) compile_rpath="$compile_rpath $absdir" - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" - esac - ;; - esac - fi - - if test -n "$old_archive_from_expsyms_cmds"; then - # figure out the soname - set dummy $library_names - realname="$2" - shift; shift - libname=`eval \\$echo \"$libname_spec\"` - # use dlname if we got it. it's perfectly good, no? - if test -n "$dlname"; then - soname="$dlname" - elif test -n "$soname_spec"; then - # bleh windows - case $host in - *cygwin* | mingw*) - major=`expr $current - $age` - versuffix="-$major" - ;; - esac - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - - # Make a new name for the extract_expsyms_cmds to use - soroot="$soname" - soname=`$echo $soroot | ${SED} -e 's/^.*\///'` - newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" - - # If the library has no export list, then create one now - if test -f "$output_objdir/$soname-def"; then : - else - $show "extracting exported symbol list from \`$soname'" - save_ifs="$IFS"; IFS='~' - cmds=$extract_expsyms_cmds - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - - # Create $newlib - if test -f "$output_objdir/$newlib"; then :; else - $show "generating import library for \`$soname'" - save_ifs="$IFS"; IFS='~' - cmds=$old_archive_from_expsyms_cmds - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - # make sure the library variables are pointing to the new library - dir=$output_objdir - linklib=$newlib - fi # test -n "$old_archive_from_expsyms_cmds" - - if test "$linkmode" = prog || test "$mode" != relink; then - add_shlibpath= - add_dir= - add= - lib_linked=yes - case $hardcode_action in - immediate | unsupported) - if test "$hardcode_direct" = no; then - add="$dir/$linklib" - case $host in - *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; - *-*-sysv4*uw2*) add_dir="-L$dir" ;; - *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ - *-*-unixware7*) add_dir="-L$dir" ;; - *-*-darwin* ) - # if the lib is a module then we can not link against - # it, someone is ignoring the new warnings I added - if /usr/bin/file -L $add 2> /dev/null | - $EGREP ": [^:]* bundle" >/dev/null ; then - $echo "** Warning, lib $linklib is a module, not a shared library" - if test -z "$old_library" ; then - $echo - $echo "** And there doesn't seem to be a static archive available" - $echo "** The link will probably fail, sorry" - else - add="$dir/$old_library" - fi - fi - esac - elif test "$hardcode_minus_L" = no; then - case $host in - *-*-sunos*) add_shlibpath="$dir" ;; - esac - add_dir="-L$dir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = no; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - relink) - if test "$hardcode_direct" = yes; then - add="$dir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$dir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case $libdir in - [\\/]*) - add_dir="$add_dir -L$inst_prefix_dir$libdir" - ;; - esac - fi - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - *) lib_linked=no ;; - esac - - if test "$lib_linked" != yes; then - $echo "$modename: configuration error: unsupported hardcode properties" - exit $EXIT_FAILURE - fi - - if test -n "$add_shlibpath"; then - case :$compile_shlibpath: in - *":$add_shlibpath:"*) ;; - *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; - esac - fi - if test "$linkmode" = prog; then - test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" - test -n "$add" && compile_deplibs="$add $compile_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - if test "$hardcode_direct" != yes && \ - test "$hardcode_minus_L" != yes && \ - test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; - esac - fi - fi - fi - - if test "$linkmode" = prog || test "$mode" = relink; then - add_shlibpath= - add_dir= - add= - # Finalize command for both is simple: just hardcode it. - if test "$hardcode_direct" = yes; then - add="$libdir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$libdir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; - esac - add="-l$name" - elif test "$hardcode_automatic" = yes; then - if test -n "$inst_prefix_dir" && - test -f "$inst_prefix_dir$libdir/$linklib" ; then - add="$inst_prefix_dir$libdir/$linklib" - else - add="$libdir/$linklib" - fi - else - # We cannot seem to hardcode it, guess we'll fake it. - add_dir="-L$libdir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case $libdir in - [\\/]*) - add_dir="$add_dir -L$inst_prefix_dir$libdir" - ;; - esac - fi - add="-l$name" - fi - - if test "$linkmode" = prog; then - test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" - test -n "$add" && finalize_deplibs="$add $finalize_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - fi - fi - elif test "$linkmode" = prog; then - # Here we assume that one of hardcode_direct or hardcode_minus_L - # is not unsupported. This is valid on all known static and - # shared platforms. - if test "$hardcode_direct" != unsupported; then - test -n "$old_library" && linklib="$old_library" - compile_deplibs="$dir/$linklib $compile_deplibs" - finalize_deplibs="$dir/$linklib $finalize_deplibs" - else - compile_deplibs="-l$name -L$dir $compile_deplibs" - finalize_deplibs="-l$name -L$dir $finalize_deplibs" - fi - elif test "$build_libtool_libs" = yes; then - # Not a shared library - if test "$deplibs_check_method" != pass_all; then - # We're trying link a shared library against a static one - # but the system doesn't support it. - - # Just print a warning and add the library to dependency_libs so - # that the program can be linked against the static library. - $echo - $echo "*** Warning: This system can not link to static lib archive $lib." - $echo "*** I have the capability to make that library automatically link in when" - $echo "*** you link to this library. But I can only do this if you have a" - $echo "*** shared version of the library, which you do not appear to have." - if test "$module" = yes; then - $echo "*** But as you try to build a module library, libtool will still create " - $echo "*** a static module, that should work as long as the dlopening application" - $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." - if test -z "$global_symbol_pipe"; then - $echo - $echo "*** However, this would only work if libtool was able to extract symbol" - $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - $echo "*** not find such a program. So, this module is probably useless." - $echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - else - deplibs="$dir/$old_library $deplibs" - link_static=yes - fi - fi # link shared/static library? - - if test "$linkmode" = lib; then - if test -n "$dependency_libs" && - { test "$hardcode_into_libs" != yes || - test "$build_old_libs" = yes || - test "$link_static" = yes; }; then - # Extract -R from dependency_libs - temp_deplibs= - for libdir in $dependency_libs; do - case $libdir in - -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` - case " $xrpath " in - *" $temp_xrpath "*) ;; - *) xrpath="$xrpath $temp_xrpath";; - esac;; - *) temp_deplibs="$temp_deplibs $libdir";; - esac - done - dependency_libs="$temp_deplibs" - fi - - newlib_search_path="$newlib_search_path $absdir" - # Link against this library - test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" - # ... and its dependency_libs - tmp_libs= - for deplib in $dependency_libs; do - newdependency_libs="$deplib $newdependency_libs" - if test "X$duplicate_deps" = "Xyes" ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done - - if test "$link_all_deplibs" != no; then - # Add the search paths of all dependency libraries - for deplib in $dependency_libs; do - case $deplib in - -L*) path="$deplib" ;; - *.la) - dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$deplib" && dir="." - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 - absdir="$dir" - fi - ;; - esac - if grep "^installed=no" $deplib > /dev/null; then - path="$absdir/$objdir" - else - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - if test -z "$libdir"; then - $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - if test "$absdir" != "$libdir"; then - $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 - fi - path="$absdir" - fi - depdepl= - case $host in - *-*-darwin*) - # we do not want to link against static libs, - # but need to link against shared - eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` - if test -n "$deplibrary_names" ; then - for tmp in $deplibrary_names ; do - depdepl=$tmp - done - if test -f "$path/$depdepl" ; then - depdepl="$path/$depdepl" - fi - # do not add paths which are already there - case " $newlib_search_path " in - *" $path "*) ;; - *) newlib_search_path="$newlib_search_path $path";; - esac - fi - path="" - ;; - *) - path="-L$path" - ;; - esac - ;; - -l*) - case $host in - *-*-darwin*) - # Again, we only want to link against shared libraries - eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` - for tmp in $newlib_search_path ; do - if test -f "$tmp/lib$tmp_libs.dylib" ; then - eval depdepl="$tmp/lib$tmp_libs.dylib" - break - fi - done - path="" - ;; - *) continue ;; - esac - ;; - *) continue ;; - esac - case " $deplibs " in - *" $path "*) ;; - *) deplibs="$path $deplibs" ;; - esac - case " $deplibs " in - *" $depdepl "*) ;; - *) deplibs="$depdepl $deplibs" ;; - esac - done - fi # link_all_deplibs != no - fi # linkmode = lib - done # for deplib in $libs - dependency_libs="$newdependency_libs" - if test "$pass" = dlpreopen; then - # Link the dlpreopened libraries before other libraries - for deplib in $save_deplibs; do - deplibs="$deplib $deplibs" - done - fi - if test "$pass" != dlopen; then - if test "$pass" != conv; then - # Make sure lib_search_path contains only unique directories. - lib_search_path= - for dir in $newlib_search_path; do - case "$lib_search_path " in - *" $dir "*) ;; - *) lib_search_path="$lib_search_path $dir" ;; - esac - done - newlib_search_path= - fi - - if test "$linkmode,$pass" != "prog,link"; then - vars="deplibs" - else - vars="compile_deplibs finalize_deplibs" - fi - for var in $vars dependency_libs; do - # Add libraries to $var in reverse order - eval tmp_libs=\"\$$var\" - new_libs= - for deplib in $tmp_libs; do - # FIXME: Pedantically, this is the right thing to do, so - # that some nasty dependency loop isn't accidentally - # broken: - #new_libs="$deplib $new_libs" - # Pragmatically, this seems to cause very few problems in - # practice: - case $deplib in - -L*) new_libs="$deplib $new_libs" ;; - -R*) ;; - *) - # And here is the reason: when a library appears more - # than once as an explicit dependence of a library, or - # is implicitly linked in more than once by the - # compiler, it is considered special, and multiple - # occurrences thereof are not removed. Compare this - # with having the same library being listed as a - # dependency of multiple other libraries: in this case, - # we know (pedantically, we assume) the library does not - # need to be listed more than once, so we keep only the - # last copy. This is not always right, but it is rare - # enough that we require users that really mean to play - # such unportable linking tricks to link the library - # using -Wl,-lname, so that libtool does not consider it - # for duplicate removal. - case " $specialdeplibs " in - *" $deplib "*) new_libs="$deplib $new_libs" ;; - *) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$deplib $new_libs" ;; - esac - ;; - esac - ;; - esac - done - tmp_libs= - for deplib in $new_libs; do - case $deplib in - -L*) - case " $tmp_libs " in - *" $deplib "*) ;; - *) tmp_libs="$tmp_libs $deplib" ;; - esac - ;; - *) tmp_libs="$tmp_libs $deplib" ;; - esac - done - eval $var=\"$tmp_libs\" - done # for var - fi - # Last step: remove runtime libs from dependency_libs - # (they stay in deplibs) - tmp_libs= - for i in $dependency_libs ; do - case " $predeps $postdeps $compiler_lib_search_path " in - *" $i "*) - i="" - ;; - esac - if test -n "$i" ; then - tmp_libs="$tmp_libs $i" - fi - done - dependency_libs=$tmp_libs - done # for pass - if test "$linkmode" = prog; then - dlfiles="$newdlfiles" - dlprefiles="$newdlprefiles" - fi - - case $linkmode in - oldlib) - if test -n "$deplibs"; then - $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 - fi - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 - fi - - if test -n "$rpath"; then - $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 - fi - - if test -n "$xrpath"; then - $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 - fi - - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 - fi - - # Now set the variables for building old libraries. - build_libtool_libs=no - oldlibs="$output" - objs="$objs$old_deplibs" - ;; - - lib) - # Make sure we only generate libraries of the form `libNAME.la'. - case $outputname in - lib*) - name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - ;; - *) - if test "$module" = no; then - $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - if test "$need_lib_prefix" != no; then - # Add the "lib" prefix for modules if required - name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - else - libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` - fi - ;; - esac - - if test -n "$objs"; then - if test "$deplibs_check_method" != pass_all; then - $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 - exit $EXIT_FAILURE - else - $echo - $echo "*** Warning: Linking the shared library $output against the non-libtool" - $echo "*** objects $objs is not portable!" - libobjs="$libobjs $objs" - fi - fi - - if test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 - fi - - set dummy $rpath - if test "$#" -gt 2; then - $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 - fi - install_libdir="$2" - - oldlibs= - if test -z "$rpath"; then - if test "$build_libtool_libs" = yes; then - # Building a libtool convenience library. - # Some compilers have problems with a `.al' extension so - # convenience libraries should have the same extension an - # archive normally would. - oldlibs="$output_objdir/$libname.$libext $oldlibs" - build_libtool_libs=convenience - build_old_libs=yes - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 - fi - else - - # Parse the version information argument. - save_ifs="$IFS"; IFS=':' - set dummy $vinfo 0 0 0 - IFS="$save_ifs" - - if test -n "$8"; then - $echo "$modename: too many parameters to \`-version-info'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # convert absolute version numbers to libtool ages - # this retains compatibility with .la files and attempts - # to make the code below a bit more comprehensible - - case $vinfo_number in - yes) - number_major="$2" - number_minor="$3" - number_revision="$4" - # - # There are really only two kinds -- those that - # use the current revision as the major version - # and those that subtract age and use age as - # a minor version. But, then there is irix - # which has an extra 1 added just for fun - # - case $version_type in - darwin|linux|osf|windows) - current=`expr $number_major + $number_minor` - age="$number_minor" - revision="$number_revision" - ;; - freebsd-aout|freebsd-elf|sunos) - current="$number_major" - revision="$number_minor" - age="0" - ;; - irix|nonstopux) - current=`expr $number_major + $number_minor - 1` - age="$number_minor" - revision="$number_minor" - ;; - esac - ;; - no) - current="$2" - revision="$3" - age="$4" - ;; - esac - - # Check that each of the things are valid numbers. - case $current in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - case $revision in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - case $age in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - if test "$age" -gt "$current"; then - $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit $EXIT_FAILURE - fi - - # Calculate the version variables. - major= - versuffix= - verstring= - case $version_type in - none) ;; - - darwin) - # Like Linux, but with the current version available in - # verstring for coding it into the library header - major=.`expr $current - $age` - versuffix="$major.$age.$revision" - # Darwin ld doesn't like 0 for these options... - minor_current=`expr $current + 1` - verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" - ;; - - freebsd-aout) - major=".$current" - versuffix=".$current.$revision"; - ;; - - freebsd-elf) - major=".$current" - versuffix=".$current"; - ;; - - irix | nonstopux) - major=`expr $current - $age + 1` - - case $version_type in - nonstopux) verstring_prefix=nonstopux ;; - *) verstring_prefix=sgi ;; - esac - verstring="$verstring_prefix$major.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$revision - while test "$loop" -ne 0; do - iface=`expr $revision - $loop` - loop=`expr $loop - 1` - verstring="$verstring_prefix$major.$iface:$verstring" - done - - # Before this point, $major must not contain `.'. - major=.$major - versuffix="$major.$revision" - ;; - - linux) - major=.`expr $current - $age` - versuffix="$major.$age.$revision" - ;; - - osf) - major=.`expr $current - $age` - versuffix=".$current.$age.$revision" - verstring="$current.$age.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$age - while test "$loop" -ne 0; do - iface=`expr $current - $loop` - loop=`expr $loop - 1` - verstring="$verstring:${iface}.0" - done - - # Make executables depend on our current version. - verstring="$verstring:${current}.0" - ;; - - sunos) - major=".$current" - versuffix=".$current.$revision" - ;; - - windows) - # Use '-' rather than '.', since we only want one - # extension on DOS 8.3 filesystems. - major=`expr $current - $age` - versuffix="-$major" - ;; - - *) - $echo "$modename: unknown library version type \`$version_type'" 1>&2 - $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit $EXIT_FAILURE - ;; - esac - - # Clear the version info if we defaulted, and they specified a release. - if test -z "$vinfo" && test -n "$release"; then - major= - case $version_type in - darwin) - # we can't check for "0.0" in archive_cmds due to quoting - # problems, so we reset it completely - verstring= - ;; - *) - verstring="0.0" - ;; - esac - if test "$need_version" = no; then - versuffix= - else - versuffix=".0.0" - fi - fi - - # Remove version info from name if versioning should be avoided - if test "$avoid_version" = yes && test "$need_version" = no; then - major= - versuffix= - verstring="" - fi - - # Check to see if the archive will have undefined symbols. - if test "$allow_undefined" = yes; then - if test "$allow_undefined_flag" = unsupported; then - $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 - build_libtool_libs=no - build_old_libs=yes - fi - else - # Don't allow undefined symbols. - allow_undefined_flag="$no_undefined_flag" - fi - fi - - if test "$mode" != relink; then - # Remove our outputs, but don't remove object files since they - # may have been created when compiling PIC objects. - removelist= - tempremovelist=`$echo "$output_objdir/*"` - for p in $tempremovelist; do - case $p in - *.$objext) - ;; - $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) - if test "X$precious_files_regex" != "X"; then - if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 - then - continue - fi - fi - removelist="$removelist $p" - ;; - *) ;; - esac - done - if test -n "$removelist"; then - $show "${rm}r $removelist" - $run ${rm}r $removelist - fi - fi - - # Now set the variables for building old libraries. - if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then - oldlibs="$oldlibs $output_objdir/$libname.$libext" - - # Transform .lo files to .o files. - oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` - fi - - # Eliminate all temporary directories. - for path in $notinst_path; do - lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` - deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` - dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"` - done - - if test -n "$xrpath"; then - # If the user specified any rpath flags, then add them. - temp_xrpath= - for libdir in $xrpath; do - temp_xrpath="$temp_xrpath -R$libdir" - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; - esac - done - if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then - dependency_libs="$temp_xrpath $dependency_libs" - fi - fi - - # Make sure dlfiles contains only unique files that won't be dlpreopened - old_dlfiles="$dlfiles" - dlfiles= - for lib in $old_dlfiles; do - case " $dlprefiles $dlfiles " in - *" $lib "*) ;; - *) dlfiles="$dlfiles $lib" ;; - esac - done - - # Make sure dlprefiles contains only unique files - old_dlprefiles="$dlprefiles" - dlprefiles= - for lib in $old_dlprefiles; do - case "$dlprefiles " in - *" $lib "*) ;; - *) dlprefiles="$dlprefiles $lib" ;; - esac - done - - if test "$build_libtool_libs" = yes; then - if test -n "$rpath"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) - # these systems don't actually have a c library (as such)! - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C library is in the System framework - deplibs="$deplibs -framework System" - ;; - *-*-netbsd*) - # Don't link with libc until the a.out ld.so is fixed. - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc due to us having libc/libc_r. - ;; - *-*-sco3.2v5* | *-*-sco5v6*) - # Causes problems with __ctype - ;; - *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) - # Compiler inserts libc in the correct place for threads to work - ;; - *) - # Add libc to deplibs on all other systems if necessary. - if test "$build_libtool_need_lc" = "yes"; then - deplibs="$deplibs -lc" - fi - ;; - esac - fi - - # Transform deplibs into only deplibs that can be linked in shared. - name_save=$name - libname_save=$libname - release_save=$release - versuffix_save=$versuffix - major_save=$major - # I'm not sure if I'm treating the release correctly. I think - # release should show up in the -l (ie -lgmp5) so we don't want to - # add it in twice. Is that correct? - release="" - versuffix="" - major="" - newdeplibs= - droppeddeps=no - case $deplibs_check_method in - pass_all) - # Don't check for shared/static. Everything works. - # This might be a little naive. We might want to check - # whether the library exists or not. But this is on - # osf3 & osf4 and I'm not really sure... Just - # implementing what was already the behavior. - newdeplibs=$deplibs - ;; - test_compile) - # This code stresses the "libraries are programs" paradigm to its - # limits. Maybe even breaks it. We compile a program, linking it - # against the deplibs as a proxy for the library. Then we can check - # whether they linked in statically or dynamically with ldd. - $rm conftest.c - cat > conftest.c </dev/null` - for potent_lib in $potential_libs; do - # Follow soft links. - if ls -lLd "$potent_lib" 2>/dev/null \ - | grep " -> " >/dev/null; then - continue - fi - # The statement above tries to avoid entering an - # endless loop below, in case of cyclic links. - # We might still enter an endless loop, since a link - # loop can be closed while we follow links, - # but so what? - potlib="$potent_lib" - while test -h "$potlib" 2>/dev/null; do - potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` - case $potliblink in - [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; - *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; - esac - done - if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ - | ${SED} 10q \ - | $EGREP "$file_magic_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - break 2 - fi - done - done - fi - if test -n "$a_deplib" ; then - droppeddeps=yes - $echo - $echo "*** Warning: linker path does not have real file for library $a_deplib." - $echo "*** I have the capability to make that library automatically link in when" - $echo "*** you link to this library. But I can only do this if you have a" - $echo "*** shared version of the library, which you do not appear to have" - $echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib" ; then - $echo "*** with $libname but no candidates were found. (...for file magic test)" - else - $echo "*** with $libname and none of the candidates passed a file format test" - $echo "*** using a file magic. Last file checked: $potlib" - fi - fi - else - # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" - fi - done # Gone through all deplibs. - ;; - match_pattern*) - set dummy $deplibs_check_method - match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` - for a_deplib in $deplibs; do - name=`expr $a_deplib : '-l\(.*\)'` - # If $name is empty we are operating on a -L argument. - if test -n "$name" && test "$name" != "0"; then - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $a_deplib "*) - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - ;; - esac - fi - if test -n "$a_deplib" ; then - libname=`eval \\$echo \"$libname_spec\"` - for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - potential_libs=`ls $i/$libname[.-]* 2>/dev/null` - for potent_lib in $potential_libs; do - potlib="$potent_lib" # see symlink-check above in file_magic test - if eval $echo \"$potent_lib\" 2>/dev/null \ - | ${SED} 10q \ - | $EGREP "$match_pattern_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - break 2 - fi - done - done - fi - if test -n "$a_deplib" ; then - droppeddeps=yes - $echo - $echo "*** Warning: linker path does not have real file for library $a_deplib." - $echo "*** I have the capability to make that library automatically link in when" - $echo "*** you link to this library. But I can only do this if you have a" - $echo "*** shared version of the library, which you do not appear to have" - $echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib" ; then - $echo "*** with $libname but no candidates were found. (...for regex pattern test)" - else - $echo "*** with $libname and none of the candidates passed a file format test" - $echo "*** using a regex pattern. Last file checked: $potlib" - fi - fi - else - # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" - fi - done # Gone through all deplibs. - ;; - none | unknown | *) - newdeplibs="" - tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ - -e 's/ -[LR][^ ]*//g'` - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - for i in $predeps $postdeps ; do - # can't use Xsed below, because $i might contain '/' - tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` - done - fi - if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ - | grep . >/dev/null; then - $echo - if test "X$deplibs_check_method" = "Xnone"; then - $echo "*** Warning: inter-library dependencies are not supported in this platform." - else - $echo "*** Warning: inter-library dependencies are not known to be supported." - fi - $echo "*** All declared inter-library dependencies are being dropped." - droppeddeps=yes - fi - ;; - esac - versuffix=$versuffix_save - major=$major_save - release=$release_save - libname=$libname_save - name=$name_save - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library is the System framework - newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` - ;; - esac - - if test "$droppeddeps" = yes; then - if test "$module" = yes; then - $echo - $echo "*** Warning: libtool could not satisfy all declared inter-library" - $echo "*** dependencies of module $libname. Therefore, libtool will create" - $echo "*** a static module, that should work as long as the dlopening" - $echo "*** application is linked with the -dlopen flag." - if test -z "$global_symbol_pipe"; then - $echo - $echo "*** However, this would only work if libtool was able to extract symbol" - $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - $echo "*** not find such a program. So, this module is probably useless." - $echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - else - $echo "*** The inter-library dependencies that have been dropped here will be" - $echo "*** automatically added whenever a program is linked with this library" - $echo "*** or is declared to -dlopen it." - - if test "$allow_undefined" = no; then - $echo - $echo "*** Since this library must not contain undefined symbols," - $echo "*** because either the platform does not support them or" - $echo "*** it was explicitly requested with -no-undefined," - $echo "*** libtool will only create a static version of it." - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - fi - fi - # Done checking deplibs! - deplibs=$newdeplibs - fi - - - # move library search paths that coincide with paths to not yet - # installed libraries to the beginning of the library search list - new_libs= - for path in $notinst_path; do - case " $new_libs " in - *" -L$path/$objdir "*) ;; - *) - case " $deplibs " in - *" -L$path/$objdir "*) - new_libs="$new_libs -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$new_libs $deplib" ;; - esac - ;; - *) new_libs="$new_libs $deplib" ;; - esac - done - deplibs="$new_libs" - - - # All the library-specific variables (install_libdir is set above). - library_names= - old_library= - dlname= - - # Test again, we may have decided not to build it any more - if test "$build_libtool_libs" = yes; then - if test "$hardcode_into_libs" = yes; then - # Hardcode the library paths - hardcode_libdirs= - dep_rpath= - rpath="$finalize_rpath" - test "$mode" != relink && rpath="$compile_rpath$rpath" - for libdir in $rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - dep_rpath="$dep_rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - if test -n "$hardcode_libdir_flag_spec_ld"; then - eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" - else - eval dep_rpath=\"$hardcode_libdir_flag_spec\" - fi - fi - if test -n "$runpath_var" && test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - rpath="$rpath$dir:" - done - eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" - fi - test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" - fi - - shlibpath="$finalize_shlibpath" - test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" - if test -n "$shlibpath"; then - eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" - fi - - # Get the real and link names of the library. - eval shared_ext=\"$shrext_cmds\" - eval library_names=\"$library_names_spec\" - set dummy $library_names - realname="$2" - shift; shift - - if test -n "$soname_spec"; then - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - if test -z "$dlname"; then - dlname=$soname - fi - - lib="$output_objdir/$realname" - linknames= - for link - do - linknames="$linknames $link" - done - - # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then - $show "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $run $rm $export_symbols - cmds=$export_symbols_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - if len=`expr "X$cmd" : ".*"` && - test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then - $show "$cmd" - $run eval "$cmd" || exit $? - skipped_export=false - else - # The command line is too long to execute in one step. - $show "using reloadable object file for export list..." - skipped_export=: - # Break out early, otherwise skipped_export may be - # set to false by a later but shorter cmd. - break - fi - done - IFS="$save_ifs" - if test -n "$export_symbols_regex"; then - $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" - $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - $show "$mv \"${export_symbols}T\" \"$export_symbols\"" - $run eval '$mv "${export_symbols}T" "$export_symbols"' - fi - fi - fi - - if test -n "$export_symbols" && test -n "$include_expsyms"; then - $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' - fi - - tmp_deplibs= - for test_deplib in $deplibs; do - case " $convenience " in - *" $test_deplib "*) ;; - *) - tmp_deplibs="$tmp_deplibs $test_deplib" - ;; - esac - done - deplibs="$tmp_deplibs" - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - else - gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" - - func_extract_archives $gentop $convenience - libobjs="$libobjs $func_extract_archives_result" - fi - fi - - if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then - eval flag=\"$thread_safe_flag_spec\" - linker_flags="$linker_flags $flag" - fi - - # Make a backup of the uninstalled library when relinking - if test "$mode" = relink; then - $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? - fi - - # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - eval test_cmds=\"$module_expsym_cmds\" - cmds=$module_expsym_cmds - else - eval test_cmds=\"$module_cmds\" - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - eval test_cmds=\"$archive_expsym_cmds\" - cmds=$archive_expsym_cmds - else - eval test_cmds=\"$archive_cmds\" - cmds=$archive_cmds - fi - fi - - if test "X$skipped_export" != "X:" && - len=`expr "X$test_cmds" : ".*" 2>/dev/null` && - test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then - : - else - # The command line is too long to link in one step, link piecewise. - $echo "creating reloadable object files..." - - # Save the value of $output and $libobjs because we want to - # use them later. If we have whole_archive_flag_spec, we - # want to use save_libobjs as it was before - # whole_archive_flag_spec was expanded, because we can't - # assume the linker understands whole_archive_flag_spec. - # This may have to be revisited, in case too many - # convenience libraries get linked in and end up exceeding - # the spec. - if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - fi - save_output=$output - output_la=`$echo "X$output" | $Xsed -e "$basename"` - - # Clear the reloadable object creation command queue and - # initialize k to one. - test_cmds= - concat_cmds= - objlist= - delfiles= - last_robj= - k=1 - output=$output_objdir/$output_la-${k}.$objext - # Loop over the list of objects to be linked. - for obj in $save_libobjs - do - eval test_cmds=\"$reload_cmds $objlist $last_robj\" - if test "X$objlist" = X || - { len=`expr "X$test_cmds" : ".*" 2>/dev/null` && - test "$len" -le "$max_cmd_len"; }; then - objlist="$objlist $obj" - else - # The command $test_cmds is almost too long, add a - # command to the queue. - if test "$k" -eq 1 ; then - # The first file doesn't have a previous command to add. - eval concat_cmds=\"$reload_cmds $objlist $last_robj\" - else - # All subsequent reloadable object files will link in - # the last one created. - eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" - fi - last_robj=$output_objdir/$output_la-${k}.$objext - k=`expr $k + 1` - output=$output_objdir/$output_la-${k}.$objext - objlist=$obj - len=1 - fi - done - # Handle the remaining objects by creating one last - # reloadable object file. All subsequent reloadable object - # files will link in the last one created. - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" - - if ${skipped_export-false}; then - $show "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $run $rm $export_symbols - libobjs=$output - # Append the command to create the export file. - eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" - fi - - # Set up a command to remove the reloadable object files - # after they are used. - i=0 - while test "$i" -lt "$k" - do - i=`expr $i + 1` - delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" - done - - $echo "creating a temporary reloadable object file: $output" - - # Loop through the commands generated above and execute them. - save_ifs="$IFS"; IFS='~' - for cmd in $concat_cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - - libobjs=$output - # Restore the value of output. - output=$save_output - - if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - fi - # Expand the library linking commands again to reset the - # value of $libobjs for piecewise linking. - - # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - cmds=$module_expsym_cmds - else - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - cmds=$archive_expsym_cmds - else - cmds=$archive_cmds - fi - fi - - # Append the command to remove the reloadable object files - # to the just-reset $cmds. - eval cmds=\"\$cmds~\$rm $delfiles\" - fi - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || { - lt_exit=$? - - # Restore the uninstalled library and exit - if test "$mode" = relink; then - $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' - fi - - exit $lt_exit - } - done - IFS="$save_ifs" - - # Restore the uninstalled library and exit - if test "$mode" = relink; then - $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? - - if test -n "$convenience"; then - if test -z "$whole_archive_flag_spec"; then - $show "${rm}r $gentop" - $run ${rm}r "$gentop" - fi - fi - - exit $EXIT_SUCCESS - fi - - # Create links to the real library. - for linkname in $linknames; do - if test "$realname" != "$linkname"; then - $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" - $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? - fi - done - - # If -module or -export-dynamic was specified, set the dlname. - if test "$module" = yes || test "$export_dynamic" = yes; then - # On all known operating systems, these are identical. - dlname="$soname" - fi - fi - ;; - - obj) - if test -n "$deplibs"; then - $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 - fi - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 - fi - - if test -n "$rpath"; then - $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 - fi - - if test -n "$xrpath"; then - $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 - fi - - case $output in - *.lo) - if test -n "$objs$old_deplibs"; then - $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 - exit $EXIT_FAILURE - fi - libobj="$output" - obj=`$echo "X$output" | $Xsed -e "$lo2o"` - ;; - *) - libobj= - obj="$output" - ;; - esac - - # Delete the old objects. - $run $rm $obj $libobj - - # Objects from convenience libraries. This assumes - # single-version convenience libraries. Whenever we create - # different ones for PIC/non-PIC, this we'll have to duplicate - # the extraction. - reload_conv_objs= - gentop= - # reload_cmds runs $LD directly, so let us get rid of - # -Wl from whole_archive_flag_spec - wl= - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" - else - gentop="$output_objdir/${obj}x" - generated="$generated $gentop" - - func_extract_archives $gentop $convenience - reload_conv_objs="$reload_objs $func_extract_archives_result" - fi - fi - - # Create the old-style object. - reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test - - output="$obj" - cmds=$reload_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - - # Exit if we aren't doing a library object file. - if test -z "$libobj"; then - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - exit $EXIT_SUCCESS - fi - - if test "$build_libtool_libs" != yes; then - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - # Create an invalid libtool object if no PIC, so that we don't - # accidentally link it into a program. - # $show "echo timestamp > $libobj" - # $run eval "echo timestamp > $libobj" || exit $? - exit $EXIT_SUCCESS - fi - - if test -n "$pic_flag" || test "$pic_mode" != default; then - # Only do commands if we really have different PIC objects. - reload_objs="$libobjs $reload_conv_objs" - output="$libobj" - cmds=$reload_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - exit $EXIT_SUCCESS - ;; - - prog) - case $host in - *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; - esac - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 - fi - - if test "$preload" = yes; then - if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && - test "$dlopen_self_static" = unknown; then - $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." - fi - fi - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library is the System framework - compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` - finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` - ;; - esac - - case $host in - *darwin*) - # Don't allow lazy linking, it breaks C++ global constructors - if test "$tagname" = CXX ; then - compile_command="$compile_command ${wl}-bind_at_load" - finalize_command="$finalize_command ${wl}-bind_at_load" - fi - ;; - esac - - - # move library search paths that coincide with paths to not yet - # installed libraries to the beginning of the library search list - new_libs= - for path in $notinst_path; do - case " $new_libs " in - *" -L$path/$objdir "*) ;; - *) - case " $compile_deplibs " in - *" -L$path/$objdir "*) - new_libs="$new_libs -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $compile_deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$new_libs $deplib" ;; - esac - ;; - *) new_libs="$new_libs $deplib" ;; - esac - done - compile_deplibs="$new_libs" - - - compile_command="$compile_command $compile_deplibs" - finalize_command="$finalize_command $finalize_deplibs" - - if test -n "$rpath$xrpath"; then - # If the user specified any rpath flags, then add them. - for libdir in $rpath $xrpath; do - # This is the magic to use -rpath. - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; - esac - done - fi - - # Now hardcode the library paths - rpath= - hardcode_libdirs= - for libdir in $compile_rpath $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; - esac - fi - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$libdir:"*) ;; - *) dllsearchpath="$dllsearchpath:$libdir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - *) dllsearchpath="$dllsearchpath:$testbindir";; - esac - ;; - esac - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - compile_rpath="$rpath" - - rpath= - hardcode_libdirs= - for libdir in $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$finalize_perm_rpath " in - *" $libdir "*) ;; - *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - finalize_rpath="$rpath" - - if test -n "$libobjs" && test "$build_old_libs" = yes; then - # Transform all the library objects into standard objects. - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - fi - - dlsyms= - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - if test -n "$NM" && test -n "$global_symbol_pipe"; then - dlsyms="${outputname}S.c" - else - $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 - fi - fi - - if test -n "$dlsyms"; then - case $dlsyms in - "") ;; - *.c) - # Discover the nlist of each of the dlfiles. - nlist="$output_objdir/${outputname}.nm" - - $show "$rm $nlist ${nlist}S ${nlist}T" - $run $rm "$nlist" "${nlist}S" "${nlist}T" - - # Parse the name list into a source file. - $show "creating $output_objdir/$dlsyms" - - test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ -/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ -/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ - -#ifdef __cplusplus -extern \"C\" { -#endif - -/* Prevent the only kind of declaration conflicts we can make. */ -#define lt_preloaded_symbols some_other_symbol - -/* External symbol declarations for the compiler. */\ -" - - if test "$dlself" = yes; then - $show "generating symbol list for \`$output'" - - test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" - - # Add our own program objects to the symbol list. - progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - for arg in $progfiles; do - $show "extracting global C symbols from \`$arg'" - $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" - done - - if test -n "$exclude_expsyms"; then - $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' - $run eval '$mv "$nlist"T "$nlist"' - fi - - if test -n "$export_symbols_regex"; then - $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' - $run eval '$mv "$nlist"T "$nlist"' - fi - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - export_symbols="$output_objdir/$outputname.exp" - $run $rm $export_symbols - $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' - case $host in - *cygwin* | *mingw* ) - $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' - $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' - ;; - esac - else - $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' - $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' - $run eval 'mv "$nlist"T "$nlist"' - case $host in - *cygwin* | *mingw* ) - $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' - $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' - ;; - esac - fi - fi - - for arg in $dlprefiles; do - $show "extracting global C symbols from \`$arg'" - name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` - $run eval '$echo ": $name " >> "$nlist"' - $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" - done - - if test -z "$run"; then - # Make sure we have at least an empty file. - test -f "$nlist" || : > "$nlist" - - if test -n "$exclude_expsyms"; then - $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T - $mv "$nlist"T "$nlist" - fi - - # Try sorting and uniquifying the output. - if grep -v "^: " < "$nlist" | - if sort -k 3 /dev/null 2>&1; then - sort -k 3 - else - sort +2 - fi | - uniq > "$nlist"S; then - : - else - grep -v "^: " < "$nlist" > "$nlist"S - fi - - if test -f "$nlist"S; then - eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' - else - $echo '/* NONE */' >> "$output_objdir/$dlsyms" - fi - - $echo >> "$output_objdir/$dlsyms" "\ - -#undef lt_preloaded_symbols - -#if defined (__STDC__) && __STDC__ -# define lt_ptr void * -#else -# define lt_ptr char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -" - - case $host in - *cygwin* | *mingw* ) - $echo >> "$output_objdir/$dlsyms" "\ -/* DATA imports from DLLs on WIN32 can't be const, because - runtime relocations are performed -- see ld's documentation - on pseudo-relocs */ -struct { -" - ;; - * ) - $echo >> "$output_objdir/$dlsyms" "\ -const struct { -" - ;; - esac - - - $echo >> "$output_objdir/$dlsyms" "\ - const char *name; - lt_ptr address; -} -lt_preloaded_symbols[] = -{\ -" - - eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" - - $echo >> "$output_objdir/$dlsyms" "\ - {0, (lt_ptr) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif\ -" - fi - - pic_flag_for_symtable= - case $host in - # compiling the symbol table file with pic_flag works around - # a FreeBSD bug that causes programs to crash when -lm is - # linked before any other PIC object. But we must not use - # pic_flag when linking with -static. The problem exists in - # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. - *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) - case "$compile_command " in - *" -static "*) ;; - *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; - esac;; - *-*-hpux*) - case "$compile_command " in - *" -static "*) ;; - *) pic_flag_for_symtable=" $pic_flag";; - esac - esac - - # Now compile the dynamic symbol file. - $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" - $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? - - # Clean up the generated files. - $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" - $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" - - # Transform the symbol file into the correct name. - case $host in - *cygwin* | *mingw* ) - if test -f "$output_objdir/${outputname}.def" ; then - compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` - else - compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` - fi - ;; - * ) - compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` - ;; - esac - ;; - *-*-freebsd*) - # FreeBSD doesn't need this... - ;; - *) - $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 - exit $EXIT_FAILURE - ;; - esac - else - # We keep going just in case the user didn't refer to - # lt_preloaded_symbols. The linker will fail if global_symbol_pipe - # really was required. - - # Nullify the symbol file. - compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` - fi - - if test "$need_relink" = no || test "$build_libtool_libs" != yes; then - # Replace the output file specification. - compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` - link_command="$compile_command$compile_rpath" - - # We have no uninstalled library dependencies, so finalize right now. - $show "$link_command" - $run eval "$link_command" - exit_status=$? - - # Delete the generated files. - if test -n "$dlsyms"; then - $show "$rm $output_objdir/${outputname}S.${objext}" - $run $rm "$output_objdir/${outputname}S.${objext}" - fi - - exit $exit_status - fi - - if test -n "$shlibpath_var"; then - # We should set the shlibpath_var - rpath= - for dir in $temp_rpath; do - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) - # Absolute path. - rpath="$rpath$dir:" - ;; - *) - # Relative path: add a thisdir entry. - rpath="$rpath\$thisdir/$dir:" - ;; - esac - done - temp_rpath="$rpath" - fi - - if test -n "$compile_shlibpath$finalize_shlibpath"; then - compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" - fi - if test -n "$finalize_shlibpath"; then - finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" - fi - - compile_var= - finalize_var= - if test -n "$runpath_var"; then - if test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - rpath="$rpath$dir:" - done - compile_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - if test -n "$finalize_perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $finalize_perm_rpath; do - rpath="$rpath$dir:" - done - finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - fi - - if test "$no_install" = yes; then - # We don't need to create a wrapper script. - link_command="$compile_var$compile_command$compile_rpath" - # Replace the output file specification. - link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` - # Delete the old output file. - $run $rm $output - # Link the executable and exit - $show "$link_command" - $run eval "$link_command" || exit $? - exit $EXIT_SUCCESS - fi - - if test "$hardcode_action" = relink; then - # Fast installation is not supported - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - - $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 - $echo "$modename: \`$output' will be relinked during installation" 1>&2 - else - if test "$fast_install" != no; then - link_command="$finalize_var$compile_command$finalize_rpath" - if test "$fast_install" = yes; then - relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` - else - # fast_install is set to needless - relink_command= - fi - else - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - fi - fi - - # Replace the output file specification. - link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` - - # Delete the old output files. - $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname - - $show "$link_command" - $run eval "$link_command" || exit $? - - # Now create the wrapper script. - $show "creating $output" - - # Quote the relink command for shipping. - if test -n "$relink_command"; then - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` - relink_command="$var=\"$var_value\"; export $var; $relink_command" - fi - done - relink_command="(cd `pwd`; $relink_command)" - relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` - fi - - # Quote $echo for shipping. - if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then - case $progpath in - [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; - *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; - esac - qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` - else - qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` - fi - - # Only actually do things if our run command is non-null. - if test -z "$run"; then - # win32 will think the script is a binary if it has - # a .exe suffix, so we strip it off here. - case $output in - *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; - esac - # test for cygwin because mv fails w/o .exe extensions - case $host in - *cygwin*) - exeext=.exe - outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; - *) exeext= ;; - esac - case $host in - *cygwin* | *mingw* ) - output_name=`basename $output` - output_path=`dirname $output` - cwrappersource="$output_path/$objdir/lt-$output_name.c" - cwrapper="$output_path/$output_name.exe" - $rm $cwrappersource $cwrapper - trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 - - cat > $cwrappersource <> $cwrappersource<<"EOF" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if defined(PATH_MAX) -# define LT_PATHMAX PATH_MAX -#elif defined(MAXPATHLEN) -# define LT_PATHMAX MAXPATHLEN -#else -# define LT_PATHMAX 1024 -#endif - -#ifndef DIR_SEPARATOR -# define DIR_SEPARATOR '/' -# define PATH_SEPARATOR ':' -#endif - -#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ - defined (__OS2__) -# define HAVE_DOS_BASED_FILE_SYSTEM -# ifndef DIR_SEPARATOR_2 -# define DIR_SEPARATOR_2 '\\' -# endif -# ifndef PATH_SEPARATOR_2 -# define PATH_SEPARATOR_2 ';' -# endif -#endif - -#ifndef DIR_SEPARATOR_2 -# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) -#else /* DIR_SEPARATOR_2 */ -# define IS_DIR_SEPARATOR(ch) \ - (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) -#endif /* DIR_SEPARATOR_2 */ - -#ifndef PATH_SEPARATOR_2 -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) -#else /* PATH_SEPARATOR_2 */ -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) -#endif /* PATH_SEPARATOR_2 */ - -#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) -#define XFREE(stale) do { \ - if (stale) { free ((void *) stale); stale = 0; } \ -} while (0) - -/* -DDEBUG is fairly common in CFLAGS. */ -#undef DEBUG -#if defined DEBUGWRAPPER -# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) -#else -# define DEBUG(format, ...) -#endif - -const char *program_name = NULL; - -void * xmalloc (size_t num); -char * xstrdup (const char *string); -const char * base_name (const char *name); -char * find_executable(const char *wrapper); -int check_executable(const char *path); -char * strendzap(char *str, const char *pat); -void lt_fatal (const char *message, ...); - -int -main (int argc, char *argv[]) -{ - char **newargz; - int i; - - program_name = (char *) xstrdup (base_name (argv[0])); - DEBUG("(main) argv[0] : %s\n",argv[0]); - DEBUG("(main) program_name : %s\n",program_name); - newargz = XMALLOC(char *, argc+2); -EOF - - cat >> $cwrappersource <> $cwrappersource <<"EOF" - newargz[1] = find_executable(argv[0]); - if (newargz[1] == NULL) - lt_fatal("Couldn't find %s", argv[0]); - DEBUG("(main) found exe at : %s\n",newargz[1]); - /* we know the script has the same name, without the .exe */ - /* so make sure newargz[1] doesn't end in .exe */ - strendzap(newargz[1],".exe"); - for (i = 1; i < argc; i++) - newargz[i+1] = xstrdup(argv[i]); - newargz[argc+1] = NULL; - - for (i=0; i> $cwrappersource <> $cwrappersource <> $cwrappersource <<"EOF" - return 127; -} - -void * -xmalloc (size_t num) -{ - void * p = (void *) malloc (num); - if (!p) - lt_fatal ("Memory exhausted"); - - return p; -} - -char * -xstrdup (const char *string) -{ - return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL -; -} - -const char * -base_name (const char *name) -{ - const char *base; - -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - /* Skip over the disk name in MSDOS pathnames. */ - if (isalpha ((unsigned char)name[0]) && name[1] == ':') - name += 2; -#endif - - for (base = name; *name; name++) - if (IS_DIR_SEPARATOR (*name)) - base = name + 1; - return base; -} - -int -check_executable(const char * path) -{ - struct stat st; - - DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); - if ((!path) || (!*path)) - return 0; - - if ((stat (path, &st) >= 0) && - ( - /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ -#if defined (S_IXOTH) - ((st.st_mode & S_IXOTH) == S_IXOTH) || -#endif -#if defined (S_IXGRP) - ((st.st_mode & S_IXGRP) == S_IXGRP) || -#endif - ((st.st_mode & S_IXUSR) == S_IXUSR)) - ) - return 1; - else - return 0; -} - -/* Searches for the full path of the wrapper. Returns - newly allocated full path name if found, NULL otherwise */ -char * -find_executable (const char* wrapper) -{ - int has_slash = 0; - const char* p; - const char* p_next; - /* static buffer for getcwd */ - char tmp[LT_PATHMAX + 1]; - int tmp_len; - char* concat_name; - - DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); - - if ((wrapper == NULL) || (*wrapper == '\0')) - return NULL; - - /* Absolute path? */ -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':') - { - concat_name = xstrdup (wrapper); - if (check_executable(concat_name)) - return concat_name; - XFREE(concat_name); - } - else - { -#endif - if (IS_DIR_SEPARATOR (wrapper[0])) - { - concat_name = xstrdup (wrapper); - if (check_executable(concat_name)) - return concat_name; - XFREE(concat_name); - } -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - } -#endif - - for (p = wrapper; *p; p++) - if (*p == '/') - { - has_slash = 1; - break; - } - if (!has_slash) - { - /* no slashes; search PATH */ - const char* path = getenv ("PATH"); - if (path != NULL) - { - for (p = path; *p; p = p_next) - { - const char* q; - size_t p_len; - for (q = p; *q; q++) - if (IS_PATH_SEPARATOR(*q)) - break; - p_len = q - p; - p_next = (*q == '\0' ? q : q + 1); - if (p_len == 0) - { - /* empty path: current directory */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal ("getcwd failed"); - tmp_len = strlen(tmp); - concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); - memcpy (concat_name, tmp, tmp_len); - concat_name[tmp_len] = '/'; - strcpy (concat_name + tmp_len + 1, wrapper); - } - else - { - concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1); - memcpy (concat_name, p, p_len); - concat_name[p_len] = '/'; - strcpy (concat_name + p_len + 1, wrapper); - } - if (check_executable(concat_name)) - return concat_name; - XFREE(concat_name); - } - } - /* not found in PATH; assume curdir */ - } - /* Relative path | not found in path: prepend cwd */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal ("getcwd failed"); - tmp_len = strlen(tmp); - concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); - memcpy (concat_name, tmp, tmp_len); - concat_name[tmp_len] = '/'; - strcpy (concat_name + tmp_len + 1, wrapper); - - if (check_executable(concat_name)) - return concat_name; - XFREE(concat_name); - return NULL; -} - -char * -strendzap(char *str, const char *pat) -{ - size_t len, patlen; - - assert(str != NULL); - assert(pat != NULL); - - len = strlen(str); - patlen = strlen(pat); - - if (patlen <= len) - { - str += len - patlen; - if (strcmp(str, pat) == 0) - *str = '\0'; - } - return str; -} - -static void -lt_error_core (int exit_status, const char * mode, - const char * message, va_list ap) -{ - fprintf (stderr, "%s: %s: ", program_name, mode); - vfprintf (stderr, message, ap); - fprintf (stderr, ".\n"); - - if (exit_status >= 0) - exit (exit_status); -} - -void -lt_fatal (const char *message, ...) -{ - va_list ap; - va_start (ap, message); - lt_error_core (EXIT_FAILURE, "FATAL", message, ap); - va_end (ap); -} -EOF - # we should really use a build-platform specific compiler - # here, but OTOH, the wrappers (shell script and this C one) - # are only useful if you want to execute the "real" binary. - # Since the "real" binary is built for $host, then this - # wrapper might as well be built for $host, too. - $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource - ;; - esac - $rm $output - trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 - - $echo > $output "\ -#! $SHELL - -# $output - temporary wrapper script for $objdir/$outputname -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP -# -# The $output program cannot be directly executed until all the libtool -# libraries that it depends on are installed. -# -# This wrapper script should never be moved out of the build directory. -# If it is, it will not operate correctly. - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='${SED} -e 1s/^X//' -sed_quote_subst='$sed_quote_subst' - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -relink_command=\"$relink_command\" - -# This environment variable determines our operation mode. -if test \"\$libtool_install_magic\" = \"$magic\"; then - # install mode needs the following variable: - notinst_deplibs='$notinst_deplibs' -else - # When we are sourced in execute mode, \$file and \$echo are already set. - if test \"\$libtool_execute_magic\" != \"$magic\"; then - echo=\"$qecho\" - file=\"\$0\" - # Make sure echo works. - if test \"X\$1\" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift - elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then - # Yippee, \$echo works! - : - else - # Restart under the correct shell, and then maybe \$echo will work. - exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} - fi - fi\ -" - $echo >> $output "\ - - # Find the directory that this script lives in. - thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` - test \"x\$thisdir\" = \"x\$file\" && thisdir=. - - # Follow symbolic links until we get to the real thisdir. - file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` - while test -n \"\$file\"; do - destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` - - # If there was a directory component, then change thisdir. - if test \"x\$destdir\" != \"x\$file\"; then - case \"\$destdir\" in - [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; - *) thisdir=\"\$thisdir/\$destdir\" ;; - esac - fi - - file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` - file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` - done - - # Try to get the absolute directory name. - absdir=\`cd \"\$thisdir\" && pwd\` - test -n \"\$absdir\" && thisdir=\"\$absdir\" -" - - if test "$fast_install" = yes; then - $echo >> $output "\ - program=lt-'$outputname'$exeext - progdir=\"\$thisdir/$objdir\" - - if test ! -f \"\$progdir/\$program\" || \\ - { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ - test \"X\$file\" != \"X\$progdir/\$program\"; }; then - - file=\"\$\$-\$program\" - - if test ! -d \"\$progdir\"; then - $mkdir \"\$progdir\" - else - $rm \"\$progdir/\$file\" - fi" - - $echo >> $output "\ - - # relink executable if necessary - if test -n \"\$relink_command\"; then - if relink_command_output=\`eval \$relink_command 2>&1\`; then : - else - $echo \"\$relink_command_output\" >&2 - $rm \"\$progdir/\$file\" - exit $EXIT_FAILURE - fi - fi - - $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || - { $rm \"\$progdir/\$program\"; - $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } - $rm \"\$progdir/\$file\" - fi" - else - $echo >> $output "\ - program='$outputname' - progdir=\"\$thisdir/$objdir\" -" - fi - - $echo >> $output "\ - - if test -f \"\$progdir/\$program\"; then" - - # Export our shlibpath_var if we have one. - if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then - $echo >> $output "\ - # Add our own library path to $shlibpath_var - $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" - - # Some systems cannot cope with colon-terminated $shlibpath_var - # The second colon is a workaround for a bug in BeOS R4 sed - $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` - - export $shlibpath_var -" - fi - - # fixup the dll searchpath if we need to. - if test -n "$dllsearchpath"; then - $echo >> $output "\ - # Add the dll search path components to the executable PATH - PATH=$dllsearchpath:\$PATH -" - fi - - $echo >> $output "\ - if test \"\$libtool_execute_magic\" != \"$magic\"; then - # Run the actual program with our arguments. -" - case $host in - # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2*) - $echo >> $output "\ - exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} -" - ;; - - *) - $echo >> $output "\ - exec \"\$progdir/\$program\" \${1+\"\$@\"} -" - ;; - esac - $echo >> $output "\ - \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" - exit $EXIT_FAILURE - fi - else - # The program doesn't exist. - \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 - \$echo \"This script is just a wrapper for \$program.\" 1>&2 - $echo \"See the $PACKAGE documentation for more information.\" 1>&2 - exit $EXIT_FAILURE - fi -fi\ -" - chmod +x $output - fi - exit $EXIT_SUCCESS - ;; - esac - - # See if we need to build an old-fashioned archive. - for oldlib in $oldlibs; do - - if test "$build_libtool_libs" = convenience; then - oldobjs="$libobjs_save" - addlibs="$convenience" - build_libtool_libs=no - else - if test "$build_libtool_libs" = module; then - oldobjs="$libobjs_save" - build_libtool_libs=no - else - oldobjs="$old_deplibs $non_pic_objects" - fi - addlibs="$old_convenience" - fi - - if test -n "$addlibs"; then - gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" - - func_extract_archives $gentop $addlibs - oldobjs="$oldobjs $func_extract_archives_result" - fi - - # Do each command in the archive commands. - if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then - cmds=$old_archive_from_new_cmds - else - # POSIX demands no paths to be encoded in archives. We have - # to avoid creating archives with duplicate basenames if we - # might have to extract them afterwards, e.g., when creating a - # static archive out of a convenience library, or when linking - # the entirety of a libtool archive into another (currently - # not supported by libtool). - if (for obj in $oldobjs - do - $echo "X$obj" | $Xsed -e 's%^.*/%%' - done | sort | sort -uc >/dev/null 2>&1); then - : - else - $echo "copying selected object files to avoid basename conflicts..." - - if test -z "$gentop"; then - gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" - - $show "${rm}r $gentop" - $run ${rm}r "$gentop" - $show "$mkdir $gentop" - $run $mkdir "$gentop" - exit_status=$? - if test "$exit_status" -ne 0 && test ! -d "$gentop"; then - exit $exit_status - fi - fi - - save_oldobjs=$oldobjs - oldobjs= - counter=1 - for obj in $save_oldobjs - do - objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` - case " $oldobjs " in - " ") oldobjs=$obj ;; - *[\ /]"$objbase "*) - while :; do - # Make sure we don't pick an alternate name that also - # overlaps. - newobj=lt$counter-$objbase - counter=`expr $counter + 1` - case " $oldobjs " in - *[\ /]"$newobj "*) ;; - *) if test ! -f "$gentop/$newobj"; then break; fi ;; - esac - done - $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" - $run ln "$obj" "$gentop/$newobj" || - $run cp "$obj" "$gentop/$newobj" - oldobjs="$oldobjs $gentop/$newobj" - ;; - *) oldobjs="$oldobjs $obj" ;; - esac - done - fi - - eval cmds=\"$old_archive_cmds\" - - if len=`expr "X$cmds" : ".*"` && - test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then - cmds=$old_archive_cmds - else - # the command line is too long to link in one step, link in parts - $echo "using piecewise archive linking..." - save_RANLIB=$RANLIB - RANLIB=: - objlist= - concat_cmds= - save_oldobjs=$oldobjs - - # Is there a better way of finding the last object in the list? - for obj in $save_oldobjs - do - last_oldobj=$obj - done - for obj in $save_oldobjs - do - oldobjs="$objlist $obj" - objlist="$objlist $obj" - eval test_cmds=\"$old_archive_cmds\" - if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && - test "$len" -le "$max_cmd_len"; then - : - else - # the above command should be used before it gets too long - oldobjs=$objlist - if test "$obj" = "$last_oldobj" ; then - RANLIB=$save_RANLIB - fi - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" - objlist= - fi - done - RANLIB=$save_RANLIB - oldobjs=$objlist - if test "X$oldobjs" = "X" ; then - eval cmds=\"\$concat_cmds\" - else - eval cmds=\"\$concat_cmds~\$old_archive_cmds\" - fi - fi - fi - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - eval cmd=\"$cmd\" - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - done - - if test -n "$generated"; then - $show "${rm}r$generated" - $run ${rm}r$generated - fi - - # Now create the libtool archive. - case $output in - *.la) - old_library= - test "$build_old_libs" = yes && old_library="$libname.$libext" - $show "creating $output" - - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` - relink_command="$var=\"$var_value\"; export $var; $relink_command" - fi - done - # Quote the link command for shipping. - relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" - relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` - if test "$hardcode_automatic" = yes ; then - relink_command= - fi - - - # Only create the output if not a dry run. - if test -z "$run"; then - for installed in no yes; do - if test "$installed" = yes; then - if test -z "$install_libdir"; then - break - fi - output="$output_objdir/$outputname"i - # Replace all uninstalled libtool libraries with the installed ones - newdependency_libs= - for deplib in $dependency_libs; do - case $deplib in - *.la) - name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - if test -z "$libdir"; then - $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - newdependency_libs="$newdependency_libs $libdir/$name" - ;; - *) newdependency_libs="$newdependency_libs $deplib" ;; - esac - done - dependency_libs="$newdependency_libs" - newdlfiles= - for lib in $dlfiles; do - name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - if test -z "$libdir"; then - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - newdlfiles="$newdlfiles $libdir/$name" - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - if test -z "$libdir"; then - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - newdlprefiles="$newdlprefiles $libdir/$name" - done - dlprefiles="$newdlprefiles" - else - newdlfiles= - for lib in $dlfiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; - *) abs=`pwd`"/$lib" ;; - esac - newdlfiles="$newdlfiles $abs" - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; - *) abs=`pwd`"/$lib" ;; - esac - newdlprefiles="$newdlprefiles $abs" - done - dlprefiles="$newdlprefiles" - fi - $rm $output - # place dlname in correct position for cygwin - tdlname=$dlname - case $host,$output,$installed,$module,$dlname in - *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; - esac - $echo > $output "\ -# $outputname - a libtool library file -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP -# -# Please DO NOT delete this file! -# It is necessary for linking the library. - -# The name that we can dlopen(3). -dlname='$tdlname' - -# Names of this library. -library_names='$library_names' - -# The name of the static archive. -old_library='$old_library' - -# Libraries that this one depends upon. -dependency_libs='$dependency_libs' - -# Version information for $libname. -current=$current -age=$age -revision=$revision - -# Is this an already installed library? -installed=$installed - -# Should we warn about portability when linking against -modules? -shouldnotlink=$module - -# Files to dlopen/dlpreopen -dlopen='$dlfiles' -dlpreopen='$dlprefiles' - -# Directory that this library needs to be installed in: -libdir='$install_libdir'" - if test "$installed" = no && test "$need_relink" = yes; then - $echo >> $output "\ -relink_command=\"$relink_command\"" - fi - done - fi - - # Do a symbolic link so that the libtool archive can be found in - # LD_LIBRARY_PATH before the program is installed. - $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" - $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? - ;; - esac - exit $EXIT_SUCCESS - ;; - - # libtool install mode - install) - modename="$modename: install" - - # There may be an optional sh(1) argument at the beginning of - # install_prog (especially on Windows NT). - if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || - # Allow the use of GNU shtool's install command. - $echo "X$nonopt" | grep shtool > /dev/null; then - # Aesthetically quote it. - arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - install_prog="$arg " - arg="$1" - shift - else - install_prog= - arg=$nonopt - fi - - # The real first argument should be the name of the installation program. - # Aesthetically quote it. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - install_prog="$install_prog$arg" - - # We need to accept at least all the BSD install flags. - dest= - files= - opts= - prev= - install_type= - isdir=no - stripme= - for arg - do - if test -n "$dest"; then - files="$files $dest" - dest=$arg - continue - fi - - case $arg in - -d) isdir=yes ;; - -f) - case " $install_prog " in - *[\\\ /]cp\ *) ;; - *) prev=$arg ;; - esac - ;; - -g | -m | -o) prev=$arg ;; - -s) - stripme=" -s" - continue - ;; - -*) - ;; - *) - # If the previous option needed an argument, then skip it. - if test -n "$prev"; then - prev= - else - dest=$arg - continue - fi - ;; - esac - - # Aesthetically quote the argument. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - install_prog="$install_prog $arg" - done - - if test -z "$install_prog"; then - $echo "$modename: you must specify an install program" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - if test -n "$prev"; then - $echo "$modename: the \`$prev' option requires an argument" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - if test -z "$files"; then - if test -z "$dest"; then - $echo "$modename: no file or destination specified" 1>&2 - else - $echo "$modename: you must specify a destination" 1>&2 - fi - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Strip any trailing slash from the destination. - dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` - - # Check to see that the destination is a directory. - test -d "$dest" && isdir=yes - if test "$isdir" = yes; then - destdir="$dest" - destname= - else - destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` - test "X$destdir" = "X$dest" && destdir=. - destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` - - # Not a directory, so check to see that there is only one file specified. - set dummy $files - if test "$#" -gt 2; then - $echo "$modename: \`$dest' is not a directory" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - fi - case $destdir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - for file in $files; do - case $file in - *.lo) ;; - *) - $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; - esac - done - ;; - esac - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - staticlibs= - future_libdirs= - current_libdirs= - for file in $files; do - - # Do each installation. - case $file in - *.$libext) - # Do the static libraries later. - staticlibs="$staticlibs $file" - ;; - - *.la) - # Check to see that this really is a libtool archive. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - library_names= - old_library= - relink_command= - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Add the libdir to current_libdirs if it is the destination. - if test "X$destdir" = "X$libdir"; then - case "$current_libdirs " in - *" $libdir "*) ;; - *) current_libdirs="$current_libdirs $libdir" ;; - esac - else - # Note the libdir as a future libdir. - case "$future_libdirs " in - *" $libdir "*) ;; - *) future_libdirs="$future_libdirs $libdir" ;; - esac - fi - - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ - test "X$dir" = "X$file/" && dir= - dir="$dir$objdir" - - if test -n "$relink_command"; then - # Determine the prefix the user has applied to our future dir. - inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` - - # Don't allow the user to place us outside of our expected - # location b/c this prevents finding dependent libraries that - # are installed to the same prefix. - # At present, this check doesn't affect windows .dll's that - # are installed into $libdir/../bin (currently, that works fine) - # but it's something to keep an eye on. - if test "$inst_prefix_dir" = "$destdir"; then - $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 - exit $EXIT_FAILURE - fi - - if test -n "$inst_prefix_dir"; then - # Stick the inst_prefix_dir data into the link command. - relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` - else - relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"` - fi - - $echo "$modename: warning: relinking \`$file'" 1>&2 - $show "$relink_command" - if $run eval "$relink_command"; then : - else - $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 - exit $EXIT_FAILURE - fi - fi - - # See the names of the shared library. - set dummy $library_names - if test -n "$2"; then - realname="$2" - shift - shift - - srcname="$realname" - test -n "$relink_command" && srcname="$realname"T - - # Install the shared library and build the symlinks. - $show "$install_prog $dir/$srcname $destdir/$realname" - $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? - if test -n "$stripme" && test -n "$striplib"; then - $show "$striplib $destdir/$realname" - $run eval "$striplib $destdir/$realname" || exit $? - fi - - if test "$#" -gt 0; then - # Delete the old symlinks, and create new ones. - # Try `ln -sf' first, because the `ln' binary might depend on - # the symlink we replace! Solaris /bin/ln does not understand -f, - # so we also need to try rm && ln -s. - for linkname - do - if test "$linkname" != "$realname"; then - $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" - $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" - fi - done - fi - - # Do each command in the postinstall commands. - lib="$destdir/$realname" - cmds=$postinstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || { - lt_exit=$? - - # Restore the uninstalled library and exit - if test "$mode" = relink; then - $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' - fi - - exit $lt_exit - } - done - IFS="$save_ifs" - fi - - # Install the pseudo-library for information purposes. - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - instname="$dir/$name"i - $show "$install_prog $instname $destdir/$name" - $run eval "$install_prog $instname $destdir/$name" || exit $? - - # Maybe install the static library, too. - test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" - ;; - - *.lo) - # Install (i.e. copy) a libtool object. - - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - destfile="$destdir/$destfile" - fi - - # Deduce the name of the destination old-style object file. - case $destfile in - *.lo) - staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` - ;; - *.$objext) - staticdest="$destfile" - destfile= - ;; - *) - $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - # Install the libtool object if requested. - if test -n "$destfile"; then - $show "$install_prog $file $destfile" - $run eval "$install_prog $file $destfile" || exit $? - fi - - # Install the old object if enabled. - if test "$build_old_libs" = yes; then - # Deduce the name of the old-style object file. - staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` - - $show "$install_prog $staticobj $staticdest" - $run eval "$install_prog \$staticobj \$staticdest" || exit $? - fi - exit $EXIT_SUCCESS - ;; - - *) - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - destfile="$destdir/$destfile" - fi - - # If the file is missing, and there is a .exe on the end, strip it - # because it is most likely a libtool script we actually want to - # install - stripped_ext="" - case $file in - *.exe) - if test ! -f "$file"; then - file=`$echo $file|${SED} 's,.exe$,,'` - stripped_ext=".exe" - fi - ;; - esac - - # Do a test to see if this is really a libtool program. - case $host in - *cygwin*|*mingw*) - wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` - ;; - *) - wrapper=$file - ;; - esac - if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then - notinst_deplibs= - relink_command= - - # Note that it is not necessary on cygwin/mingw to append a dot to - # foo even if both foo and FILE.exe exist: automatic-append-.exe - # behavior happens only for exec(3), not for open(2)! Also, sourcing - # `FILE.' does not work on cygwin managed mounts. - # - # If there is no directory component, then add one. - case $wrapper in - */* | *\\*) . ${wrapper} ;; - *) . ./${wrapper} ;; - esac - - # Check the variables that should have been set. - if test -z "$notinst_deplibs"; then - $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 - exit $EXIT_FAILURE - fi - - finalize=yes - for lib in $notinst_deplibs; do - # Check to see that each library is installed. - libdir= - if test -f "$lib"; then - # If there is no directory component, then add one. - case $lib in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - fi - libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test - if test -n "$libdir" && test ! -f "$libfile"; then - $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 - finalize=no - fi - done - - relink_command= - # Note that it is not necessary on cygwin/mingw to append a dot to - # foo even if both foo and FILE.exe exist: automatic-append-.exe - # behavior happens only for exec(3), not for open(2)! Also, sourcing - # `FILE.' does not work on cygwin managed mounts. - # - # If there is no directory component, then add one. - case $wrapper in - */* | *\\*) . ${wrapper} ;; - *) . ./${wrapper} ;; - esac - - outputname= - if test "$fast_install" = no && test -n "$relink_command"; then - if test "$finalize" = yes && test -z "$run"; then - tmpdir=`func_mktempdir` - file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` - outputname="$tmpdir/$file" - # Replace the output file specification. - relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` - - $show "$relink_command" - if $run eval "$relink_command"; then : - else - $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 - ${rm}r "$tmpdir" - continue - fi - file="$outputname" - else - $echo "$modename: warning: cannot relink \`$file'" 1>&2 - fi - else - # Install the binary that we compiled earlier. - file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` - fi - fi - - # remove .exe since cygwin /usr/bin/install will append another - # one anyway - case $install_prog,$host in - */usr/bin/install*,*cygwin*) - case $file:$destfile in - *.exe:*.exe) - # this is ok - ;; - *.exe:*) - destfile=$destfile.exe - ;; - *:*.exe) - destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` - ;; - esac - ;; - esac - $show "$install_prog$stripme $file $destfile" - $run eval "$install_prog\$stripme \$file \$destfile" || exit $? - test -n "$outputname" && ${rm}r "$tmpdir" - ;; - esac - done - - for file in $staticlibs; do - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - - # Set up the ranlib parameters. - oldlib="$destdir/$name" - - $show "$install_prog $file $oldlib" - $run eval "$install_prog \$file \$oldlib" || exit $? - - if test -n "$stripme" && test -n "$old_striplib"; then - $show "$old_striplib $oldlib" - $run eval "$old_striplib $oldlib" || exit $? - fi - - # Do each command in the postinstall commands. - cmds=$old_postinstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - done - - if test -n "$future_libdirs"; then - $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 - fi - - if test -n "$current_libdirs"; then - # Maybe just do a dry run. - test -n "$run" && current_libdirs=" -n$current_libdirs" - exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' - else - exit $EXIT_SUCCESS - fi - ;; - - # libtool finish mode - finish) - modename="$modename: finish" - libdirs="$nonopt" - admincmds= - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - for dir - do - libdirs="$libdirs $dir" - done - - for libdir in $libdirs; do - if test -n "$finish_cmds"; then - # Do each command in the finish commands. - cmds=$finish_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || admincmds="$admincmds - $cmd" - done - IFS="$save_ifs" - fi - if test -n "$finish_eval"; then - # Do the single finish_eval. - eval cmds=\"$finish_eval\" - $run eval "$cmds" || admincmds="$admincmds - $cmds" - fi - done - fi - - # Exit here if they wanted silent mode. - test "$show" = : && exit $EXIT_SUCCESS - - $echo "X----------------------------------------------------------------------" | $Xsed - $echo "Libraries have been installed in:" - for libdir in $libdirs; do - $echo " $libdir" - done - $echo - $echo "If you ever happen to want to link against installed libraries" - $echo "in a given directory, LIBDIR, you must either use libtool, and" - $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" - $echo "flag during linking and do at least one of the following:" - if test -n "$shlibpath_var"; then - $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" - $echo " during execution" - fi - if test -n "$runpath_var"; then - $echo " - add LIBDIR to the \`$runpath_var' environment variable" - $echo " during linking" - fi - if test -n "$hardcode_libdir_flag_spec"; then - libdir=LIBDIR - eval flag=\"$hardcode_libdir_flag_spec\" - - $echo " - use the \`$flag' linker flag" - fi - if test -n "$admincmds"; then - $echo " - have your system administrator run these commands:$admincmds" - fi - if test -f /etc/ld.so.conf; then - $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" - fi - $echo - $echo "See any operating system documentation about shared libraries for" - $echo "more information, such as the ld(1) and ld.so(8) manual pages." - $echo "X----------------------------------------------------------------------" | $Xsed - exit $EXIT_SUCCESS - ;; - - # libtool execute mode - execute) - modename="$modename: execute" - - # The first argument is the command name. - cmd="$nonopt" - if test -z "$cmd"; then - $echo "$modename: you must specify a COMMAND" 1>&2 - $echo "$help" - exit $EXIT_FAILURE - fi - - # Handle -dlopen flags immediately. - for file in $execute_dlfiles; do - if test ! -f "$file"; then - $echo "$modename: \`$file' is not a file" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - dir= - case $file in - *.la) - # Check to see that this really is a libtool archive. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Read the libtool library. - dlname= - library_names= - - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Skip this library if it cannot be dlopened. - if test -z "$dlname"; then - # Warn if it was a shared library. - test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" - continue - fi - - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$file" && dir=. - - if test -f "$dir/$objdir/$dlname"; then - dir="$dir/$objdir" - else - $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 - exit $EXIT_FAILURE - fi - ;; - - *.lo) - # Just add the directory containing the .lo file. - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$file" && dir=. - ;; - - *) - $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 - continue - ;; - esac - - # Get the absolute pathname. - absdir=`cd "$dir" && pwd` - test -n "$absdir" && dir="$absdir" - - # Now add the directory to shlibpath_var. - if eval "test -z \"\$$shlibpath_var\""; then - eval "$shlibpath_var=\"\$dir\"" - else - eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" - fi - done - - # This variable tells wrapper scripts just to set shlibpath_var - # rather than running their programs. - libtool_execute_magic="$magic" - - # Check if any of the arguments is a wrapper script. - args= - for file - do - case $file in - -*) ;; - *) - # Do a test to see if this is really a libtool program. - if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Transform arg to wrapped name. - file="$progdir/$program" - fi - ;; - esac - # Quote arguments (to preserve shell metacharacters). - file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` - args="$args \"$file\"" - done - - if test -z "$run"; then - if test -n "$shlibpath_var"; then - # Export the shlibpath_var. - eval "export $shlibpath_var" - fi - - # Restore saved environment variables - if test "${save_LC_ALL+set}" = set; then - LC_ALL="$save_LC_ALL"; export LC_ALL - fi - if test "${save_LANG+set}" = set; then - LANG="$save_LANG"; export LANG - fi - - # Now prepare to actually exec the command. - exec_cmd="\$cmd$args" - else - # Display what would be done. - if test -n "$shlibpath_var"; then - eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" - $echo "export $shlibpath_var" - fi - $echo "$cmd$args" - exit $EXIT_SUCCESS - fi - ;; - - # libtool clean and uninstall mode - clean | uninstall) - modename="$modename: $mode" - rm="$nonopt" - files= - rmforce= - exit_status=0 - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - for arg - do - case $arg in - -f) rm="$rm $arg"; rmforce=yes ;; - -*) rm="$rm $arg" ;; - *) files="$files $arg" ;; - esac - done - - if test -z "$rm"; then - $echo "$modename: you must specify an RM program" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - rmdirs= - - origobjdir="$objdir" - for file in $files; do - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - if test "X$dir" = "X$file"; then - dir=. - objdir="$origobjdir" - else - objdir="$dir/$origobjdir" - fi - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - test "$mode" = uninstall && objdir="$dir" - - # Remember objdir for removal later, being careful to avoid duplicates - if test "$mode" = clean; then - case " $rmdirs " in - *" $objdir "*) ;; - *) rmdirs="$rmdirs $objdir" ;; - esac - fi - - # Don't error if the file doesn't exist and rm -f was used. - if (test -L "$file") >/dev/null 2>&1 \ - || (test -h "$file") >/dev/null 2>&1 \ - || test -f "$file"; then - : - elif test -d "$file"; then - exit_status=1 - continue - elif test "$rmforce" = yes; then - continue - fi - - rmfiles="$file" - - case $name in - *.la) - # Possibly a libtool archive, so verify it. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - . $dir/$name - - # Delete the libtool libraries and symlinks. - for n in $library_names; do - rmfiles="$rmfiles $objdir/$n" - done - test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" - - case "$mode" in - clean) - case " $library_names " in - # " " in the beginning catches empty $dlname - *" $dlname "*) ;; - *) rmfiles="$rmfiles $objdir/$dlname" ;; - esac - test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" - ;; - uninstall) - if test -n "$library_names"; then - # Do each command in the postuninstall commands. - cmds=$postuninstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" - if test "$?" -ne 0 && test "$rmforce" != yes; then - exit_status=1 - fi - done - IFS="$save_ifs" - fi - - if test -n "$old_library"; then - # Do each command in the old_postuninstall commands. - cmds=$old_postuninstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" - if test "$?" -ne 0 && test "$rmforce" != yes; then - exit_status=1 - fi - done - IFS="$save_ifs" - fi - # FIXME: should reinstall the best remaining shared library. - ;; - esac - fi - ;; - - *.lo) - # Possibly a libtool object, so verify it. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - - # Read the .lo file - . $dir/$name - - # Add PIC object to the list of files to remove. - if test -n "$pic_object" \ - && test "$pic_object" != none; then - rmfiles="$rmfiles $dir/$pic_object" - fi - - # Add non-PIC object to the list of files to remove. - if test -n "$non_pic_object" \ - && test "$non_pic_object" != none; then - rmfiles="$rmfiles $dir/$non_pic_object" - fi - fi - ;; - - *) - if test "$mode" = clean ; then - noexename=$name - case $file in - *.exe) - file=`$echo $file|${SED} 's,.exe$,,'` - noexename=`$echo $name|${SED} 's,.exe$,,'` - # $file with .exe has already been added to rmfiles, - # add $file without .exe - rmfiles="$rmfiles $file" - ;; - esac - # Do a test to see if this is a libtool program. - if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - relink_command= - . $dir/$noexename - - # note $name still contains .exe if it was in $file originally - # as does the version of $file that was added into $rmfiles - rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" - if test "$fast_install" = yes && test -n "$relink_command"; then - rmfiles="$rmfiles $objdir/lt-$name" - fi - if test "X$noexename" != "X$name" ; then - rmfiles="$rmfiles $objdir/lt-${noexename}.c" - fi - fi - fi - ;; - esac - $show "$rm $rmfiles" - $run $rm $rmfiles || exit_status=1 - done - objdir="$origobjdir" - - # Try to remove the ${objdir}s in the directories where we deleted files - for dir in $rmdirs; do - if test -d "$dir"; then - $show "rmdir $dir" - $run rmdir $dir >/dev/null 2>&1 - fi - done - - exit $exit_status - ;; - - "") - $echo "$modename: you must specify a MODE" 1>&2 - $echo "$generic_help" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - if test -z "$exec_cmd"; then - $echo "$modename: invalid operation mode \`$mode'" 1>&2 - $echo "$generic_help" 1>&2 - exit $EXIT_FAILURE - fi -fi # test -z "$show_help" - -if test -n "$exec_cmd"; then - eval exec $exec_cmd - exit $EXIT_FAILURE -fi - -# We need to display help for each of the modes. -case $mode in -"") $echo \ -"Usage: $modename [OPTION]... [MODE-ARG]... - -Provide generalized library-building support services. - - --config show all configuration variables - --debug enable verbose shell tracing --n, --dry-run display commands without modifying any files - --features display basic configuration information and exit - --finish same as \`--mode=finish' - --help display this help message and exit - --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] - --quiet same as \`--silent' - --silent don't print informational messages - --tag=TAG use configuration variables from tag TAG - --version print version information - -MODE must be one of the following: - - clean remove files from the build directory - compile compile a source file into a libtool object - execute automatically set library path, then run a program - finish complete the installation of libtool libraries - install install libraries or executables - link create a library or an executable - uninstall remove libraries from an installed directory - -MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for -a more detailed description of MODE. - -Report bugs to ." - exit $EXIT_SUCCESS - ;; - -clean) - $echo \ -"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... - -Remove files from the build directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, object or program, all the files associated -with it are deleted. Otherwise, only FILE itself is deleted using RM." - ;; - -compile) - $echo \ -"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE - -Compile a source file into a libtool library object. - -This mode accepts the following additional options: - - -o OUTPUT-FILE set the output file name to OUTPUT-FILE - -prefer-pic try to building PIC objects only - -prefer-non-pic try to building non-PIC objects only - -static always build a \`.o' file suitable for static linking - -COMPILE-COMMAND is a command to be used in creating a \`standard' object file -from the given SOURCEFILE. - -The output file name is determined by removing the directory component from -SOURCEFILE, then substituting the C source code suffix \`.c' with the -library object suffix, \`.lo'." - ;; - -execute) - $echo \ -"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... - -Automatically set library path, then run a program. - -This mode accepts the following additional options: - - -dlopen FILE add the directory containing FILE to the library path - -This mode sets the library path environment variable according to \`-dlopen' -flags. - -If any of the ARGS are libtool executable wrappers, then they are translated -into their corresponding uninstalled binary, and any of their required library -directories are added to the library path. - -Then, COMMAND is executed, with ARGS as arguments." - ;; - -finish) - $echo \ -"Usage: $modename [OPTION]... --mode=finish [LIBDIR]... - -Complete the installation of libtool libraries. - -Each LIBDIR is a directory that contains libtool libraries. - -The commands that this mode executes may require superuser privileges. Use -the \`--dry-run' option if you just want to see what would be executed." - ;; - -install) - $echo \ -"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... - -Install executables or libraries. - -INSTALL-COMMAND is the installation command. The first component should be -either the \`install' or \`cp' program. - -The rest of the components are interpreted as arguments to that command (only -BSD-compatible install options are recognized)." - ;; - -link) - $echo \ -"Usage: $modename [OPTION]... --mode=link LINK-COMMAND... - -Link object files or libraries together to form another library, or to -create an executable program. - -LINK-COMMAND is a command using the C compiler that you would use to create -a program from several object files. - -The following components of LINK-COMMAND are treated specially: - - -all-static do not do any dynamic linking at all - -avoid-version do not add a version suffix if possible - -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime - -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols - -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) - -export-symbols SYMFILE - try to export only the symbols listed in SYMFILE - -export-symbols-regex REGEX - try to export only the symbols matching REGEX - -LLIBDIR search LIBDIR for required installed libraries - -lNAME OUTPUT-FILE requires the installed library libNAME - -module build a library that can dlopened - -no-fast-install disable the fast-install mode - -no-install link a not-installable executable - -no-undefined declare that a library does not refer to external symbols - -o OUTPUT-FILE create OUTPUT-FILE from the specified objects - -objectlist FILE Use a list of object files found in FILE to specify objects - -precious-files-regex REGEX - don't remove output files matching REGEX - -release RELEASE specify package release information - -rpath LIBDIR the created library will eventually be installed in LIBDIR - -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries - -static do not do any dynamic linking of libtool libraries - -version-info CURRENT[:REVISION[:AGE]] - specify library version info [each variable defaults to 0] - -All other options (arguments beginning with \`-') are ignored. - -Every other argument is treated as a filename. Files ending in \`.la' are -treated as uninstalled libtool libraries, other files are standard or library -object files. - -If the OUTPUT-FILE ends in \`.la', then a libtool library is created, -only library objects (\`.lo' files) may be specified, and \`-rpath' is -required, except when creating a convenience library. - -If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created -using \`ar' and \`ranlib', or on Windows using \`lib'. - -If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file -is created, otherwise an executable program is created." - ;; - -uninstall) - $echo \ -"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... - -Remove libraries from an installation directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, all the files associated with it are deleted. -Otherwise, only FILE itself is deleted using RM." - ;; - -*) - $echo "$modename: invalid operation mode \`$mode'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; -esac - -$echo -$echo "Try \`$modename --help' for more information about other modes." - -exit $? - -# The TAGs below are defined such that we never get into a situation -# in which we disable both kinds of libraries. Given conflicting -# choices, we go for a static library, that is the most portable, -# since we can't tell whether shared libraries were disabled because -# the user asked for that or because the platform doesn't support -# them. This is particularly important on AIX, because we don't -# support having both static and shared libraries enabled at the same -# time on that platform, so we default to a shared-only configuration. -# If a disable-shared tag is given, we'll fallback to a static-only -# configuration. But we'll never go from static-only to shared-only. - -# ### BEGIN LIBTOOL TAG CONFIG: disable-shared -disable_libs=shared -# ### END LIBTOOL TAG CONFIG: disable-shared - -# ### BEGIN LIBTOOL TAG CONFIG: disable-static -disable_libs=static -# ### END LIBTOOL TAG CONFIG: disable-static - -# Local Variables: -# mode:shell-script -# sh-indentation:2 -# End: diff --git a/configure.ac b/configure.ac index 7883dc47..8441b052 100644 --- a/configure.ac +++ b/configure.ac @@ -8,9 +8,9 @@ AC_PREREQ(2.53) AC_INIT([yasm], [HEAD], [bug-yasm@tortall.net]) #AC_CONFIG_SRCDIR([src/main.c]) AC_CONFIG_AUX_DIR(config) -AM_CONFIG_HEADER([config.h]) +AC_CONFIG_HEADER([config.h]) -AM_INIT_AUTOMAKE(yasm, [HEAD]) +AM_INIT_AUTOMAKE([1.11 foreign]) AM_MAINTAINER_MODE AC_DEFINE(PACKAGE_INTVER, ["0.7.99"], @@ -73,10 +73,11 @@ esac], enable_python_bindings="no") # Checks for programs. # AC_PROG_CPP -AC_DEFINE_UNQUOTED([CPP_PROG], "${CPP}", [Command name to run C preprocessor]) AC_PROG_CC_STDC AC_PROG_INSTALL AC_PROG_LN_S +#automake default ARFLAGS to "cru" +AC_CHECK_TOOLS(AR,[$AR ar],[ar]) AC_PROG_RANLIB # REQUIRE a standard (ANSI/ISO) C compiler @@ -233,28 +234,25 @@ if test "$USE_MAINTAINER_MODE" = "yes"; then fi AC_SUBST(MORE_CFLAGS) -# -# Cross-building -# -if test "$cross_compiling" = "yes"; then - AC_MSG_CHECKING([cc for build]) - CC_FOR_BUILD="${CC_FOR_BUILD-PATH=/usr/bin:$PATH cc}" - AC_MSG_RESULT($CC_FOR_BUILD) - CCLD_FOR_BUILD="$CC_FOR_BUILD" -else - CC_FOR_BUILD="${CC_FOR_BUILD-$CC}" - CCLD_FOR_BUILD="${CCLD_FOR_BUILD-$CC}" -fi - AC_ARG_VAR(CC_FOR_BUILD,[build system C compiler]) AC_ARG_VAR(CCLD_FOR_BUILD,[build system C linker frontend]) +if test "${build}" != "${host}" ; then + CC_FOR_BUILD=${CC_FOR_BUILD-cc} + CCLD_FOR_BUILD=${CCLD_FOR_BUILD-cc} +else + CC_FOR_BUILD="\$(CC)" + CCLD_FOR_BUILD="\$(CC)" +fi AC_SUBST(CC_FOR_BUILD) AC_SUBST(CCLD_FOR_BUILD) -# libtool erroneously calls CC_FOR_BUILD HOST_CC; -# --host is the platform that the package is compiled for. -HOST_CC="$CC_FOR_BUILD" -AC_SUBST(HOST_CC) +AC_ARG_VAR(CPP_FOR_HOST,[host system C preprocessor]) +if test "$build" != "$target" || test "$build" != "$host"; then + CPP_PROG="${CPP_FOR_HOST-cc -E}" +else + CPP_PROG="${CPP}" +fi +AC_DEFINE_UNQUOTED([CPP_PROG], "${CPP_PROG}", [Command name to run C preprocessor]) # Detect if we have Python if test x$enable_python = xno; then diff --git a/modules/arch/Makefile.inc b/modules/arch/Makefile.inc index 1a9f9055..be5f2c55 100644 --- a/modules/arch/Makefile.inc +++ b/modules/arch/Makefile.inc @@ -6,7 +6,7 @@ EXTRA_DIST += modules/arch/lc3b/Makefile.inc include modules/arch/x86/Makefile.inc include modules/arch/lc3b/Makefile.inc -dist_man_MANS += yasm_arch.7 +notrans_dist_man_MANS += yasm_arch.7 if BUILD_MAN yasm_arch.7: modules/arch/yasm_arch.xml diff --git a/modules/dbgfmts/Makefile.inc b/modules/dbgfmts/Makefile.inc index be53622c..7a5cf35a 100644 --- a/modules/dbgfmts/Makefile.inc +++ b/modules/dbgfmts/Makefile.inc @@ -10,7 +10,7 @@ include modules/dbgfmts/dwarf2/Makefile.inc include modules/dbgfmts/null/Makefile.inc include modules/dbgfmts/stabs/Makefile.inc -dist_man_MANS += yasm_dbgfmts.7 +notrans_dist_man_MANS += yasm_dbgfmts.7 if BUILD_MAN yasm_dbgfmts.7: modules/dbgfmts/yasm_dbgfmts.xml diff --git a/modules/objfmts/Makefile.inc b/modules/objfmts/Makefile.inc index be672182..f927a09c 100644 --- a/modules/objfmts/Makefile.inc +++ b/modules/objfmts/Makefile.inc @@ -22,7 +22,7 @@ include modules/objfmts/win32/Makefile.inc include modules/objfmts/win64/Makefile.inc include modules/objfmts/xdf/Makefile.inc -dist_man_MANS += yasm_objfmts.7 +notrans_dist_man_MANS += yasm_objfmts.7 if BUILD_MAN yasm_objfmts.7: modules/objfmts/yasm_objfmts.xml diff --git a/modules/parsers/Makefile.inc b/modules/parsers/Makefile.inc index a2ab23f3..5daba560 100644 --- a/modules/parsers/Makefile.inc +++ b/modules/parsers/Makefile.inc @@ -7,7 +7,7 @@ include modules/parsers/gas/Makefile.inc include modules/parsers/nasm/Makefile.inc include modules/parsers/tasm/Makefile.inc -dist_man_MANS += yasm_parsers.7 +notrans_dist_man_MANS += yasm_parsers.7 if BUILD_MAN yasm_parsers.7: modules/parsers/yasm_parsers.xml From 9dbb4aa480296c26c4f239c8bc2c4f389fb22d38 Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Fri, 8 Jan 2010 09:47:46 +0000 Subject: [PATCH 325/585] "Fix #200" - yasm.rules double quote issue svn path=/trunk/yasm/; revision=2270 --- Mkfiles/vc9/yasm.rules | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Mkfiles/vc9/yasm.rules b/Mkfiles/vc9/yasm.rules index 6e1fa6ea..05052d93 100644 --- a/Mkfiles/vc9/yasm.rules +++ b/Mkfiles/vc9/yasm.rules @@ -28,7 +28,7 @@ DisplayName="Include Paths" Category="Configuration" Description="Set the paths for any additional include files" - Switch="-I "[value]"" + Switch="-I [value]" Delimited="true" Inheritable="true" /> @@ -46,22 +46,22 @@ DisplayName="Object File Name" Category="Output" Description="Select the output file name" - Switch="-o "[value]"" - DefaultValue=""$(IntDir)\$(InputName).obj"" + Switch="-o [value]" + DefaultValue="$(IntDir)\$(InputName).obj" /> Date: Fri, 8 Jan 2010 09:50:52 +0000 Subject: [PATCH 326/585] Fix #200 - yasm.rules double quote issue svn path=/trunk/yasm/; revision=2271 --- Mkfiles/vc9/yasm.rules | 51 +++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/Mkfiles/vc9/yasm.rules b/Mkfiles/vc9/yasm.rules index 05052d93..ee1fefbc 100644 --- a/Mkfiles/vc9/yasm.rules +++ b/Mkfiles/vc9/yasm.rules @@ -3,8 +3,8 @@ Name="Yasm" Version="8.00" > - - + - - + - - - - - - - - - + - - - - + + - - + - - - - - - + + + + + + From cc6301d9ced4800c0b7e7773868d5e6b719b45eb Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 12 Jan 2010 05:59:37 +0000 Subject: [PATCH 327/585] Allow older automake version (1.9.6). svn path=/trunk/yasm/; revision=2272 --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 8441b052..501b7525 100644 --- a/configure.ac +++ b/configure.ac @@ -10,7 +10,7 @@ AC_INIT([yasm], [HEAD], [bug-yasm@tortall.net]) AC_CONFIG_AUX_DIR(config) AC_CONFIG_HEADER([config.h]) -AM_INIT_AUTOMAKE([1.11 foreign]) +AM_INIT_AUTOMAKE([1.9.6 foreign]) AM_MAINTAINER_MODE AC_DEFINE(PACKAGE_INTVER, ["0.7.99"], From e7185d2e24047e6af72911687f535562286a7fc5 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 13 Jan 2010 04:44:28 +0000 Subject: [PATCH 328/585] gas-preproc.c: Use sprintf instead of snprintf. It's impossible for a decimal long string to be longer than 64 chars. Also remove workaround for MSVC added in r2267. svn path=/trunk/yasm/; revision=2273 --- modules/preprocs/gas/gas-preproc.c | 2 +- util.h | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/modules/preprocs/gas/gas-preproc.c b/modules/preprocs/gas/gas-preproc.c index 4c125066..0f659252 100644 --- a/modules/preprocs/gas/gas-preproc.c +++ b/modules/preprocs/gas/gas-preproc.c @@ -770,7 +770,7 @@ static void substitute_values(yasm_preproc_gas *pp, char *line) int cursor = pp->expr_string_cursor; int k, len = strlen(tokval.t_charptr); char value[64]; - int value_length = snprintf(value, sizeof(value), "%ld", eval_expr(pp, tokval.t_charptr)); + int value_length = sprintf(value, "%ld", eval_expr(pp, tokval.t_charptr)); int delta = value_length - len; line_length += delta; diff --git a/util.h b/util.h index 27014f73..132cba1e 100644 --- a/util.h +++ b/util.h @@ -117,10 +117,6 @@ # define USE_OUR_OWN_STRCASECMP #endif -#ifdef _MSC_VER -# define snprintf _snprintf -#endif - #include #ifdef HAVE_SYS_CDEFS_H From 26c7e747294895bf0f8b68bf064e4ca2b5cdf88a Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 14 Jan 2010 08:10:35 +0000 Subject: [PATCH 329/585] substitute_values(): Allocate sufficient space for null terminator. Noticed by: Alexei Svitkine svn path=/trunk/yasm/; revision=2274 --- modules/preprocs/gas/gas-preproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/preprocs/gas/gas-preproc.c b/modules/preprocs/gas/gas-preproc.c index 0f659252..2fa7af9b 100644 --- a/modules/preprocs/gas/gas-preproc.c +++ b/modules/preprocs/gas/gas-preproc.c @@ -775,7 +775,7 @@ static void substitute_values(yasm_preproc_gas *pp, char *line) line_length += delta; if (delta > 0) { - line = yasm_xrealloc(line, line_length); + line = yasm_xrealloc(line, line_length + 1); for (k = line_length; k >= cursor; k--) { line[k + delta] = line[k]; } From d61b43941d00c04622764cf75bdd0824654496d7 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 14 Jan 2010 08:24:13 +0000 Subject: [PATCH 330/585] Allow gas flags input to bin objfmt (ignored and not used). Contributed by: Alexei Svitkine svn path=/trunk/yasm/; revision=2275 --- modules/objfmts/bin/bin-objfmt.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/objfmts/bin/bin-objfmt.c b/modules/objfmts/bin/bin-objfmt.c index 21d43dac..6f2d14d6 100644 --- a/modules/objfmts/bin/bin-objfmt.c +++ b/modules/objfmts/bin/bin-objfmt.c @@ -1432,6 +1432,15 @@ bin_objfmt_add_default_section(yasm_object *object) return retval; } +/* GAS-style flags */ +static int +bin_helper_gasflags(void *obj, yasm_valparam *vp, unsigned long line, void *d, + /*@unused@*/ uintptr_t arg) +{ + /* TODO */ + return 0; +} + static /*@observer@*/ /*@null@*/ yasm_section * bin_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, /*@unused@*/ /*@null@*/ @@ -1480,7 +1489,8 @@ bin_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, { "execute", 0, yasm_dir_helper_flag_set, offsetof(struct bin_section_switch_data, code), 1 }, { "noexecute", 0, yasm_dir_helper_flag_set, - offsetof(struct bin_section_switch_data, code), 0 } + offsetof(struct bin_section_switch_data, code), 0 }, + { "gasflags", 1, bin_helper_gasflags, 0, 0 } }; vp = yasm_vps_first(valparams); From d965ef7d7a7df127821ae2a49e0a2a710db32a54 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 19 Jan 2010 06:56:08 +0000 Subject: [PATCH 331/585] Split yasm_parser_nasm structure out to separate header. This is needed so that other parsers can get access to this structure without naming conflicts. Contributed by: Alexei Svitkine svn path=/trunk/yasm/; revision=2276 --- modules/parsers/nasm/nasm-parser-struct.h | 84 +++++++++++++++++++++++ modules/parsers/nasm/nasm-parser.h | 73 ++++---------------- 2 files changed, 96 insertions(+), 61 deletions(-) create mode 100644 modules/parsers/nasm/nasm-parser-struct.h diff --git a/modules/parsers/nasm/nasm-parser-struct.h b/modules/parsers/nasm/nasm-parser-struct.h new file mode 100644 index 00000000..506f02cc --- /dev/null +++ b/modules/parsers/nasm/nasm-parser-struct.h @@ -0,0 +1,84 @@ +/* $Id$ + * NASM-compatible parser struct header file + * + * Copyright (C) 2002-2007 Peter Johnson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef YASM_NASM_PARSER_STRUCT_H +#define YASM_NASM_PARSER_STRUCT_H + +typedef union { + unsigned int int_info; + char *str_val; + yasm_intnum *intn; + yasm_floatnum *flt; + yasm_bytecode *bc; + uintptr_t arch_data; + struct { + char *contents; + size_t len; + } str; +} nasm_yystype; + +typedef struct yasm_parser_nasm { + int tasm; + + /*@only@*/ yasm_object *object; + + /* last "base" label for local (.) labels */ + /*@null@*/ char *locallabel_base; + size_t locallabel_base_len; + + /*@dependent@*/ yasm_preproc *preproc; + /*@dependent@*/ yasm_errwarns *errwarns; + + /*@dependent@*/ yasm_linemap *linemap; + + /*@null@*/ yasm_bytecode *prev_bc; + + int save_input; + + yasm_scanner s; + int state; + + int token; /* enum tokentype or any character */ + nasm_yystype tokval; + char tokch; /* first character of token */ + + /* one token of lookahead; used sparingly */ + int peek_token; /* NONE if none */ + nasm_yystype peek_tokval; + char peek_tokch; + + /* Starting point of the absolute section. NULL if not in an absolute + * section. + */ + /*@null@*/ yasm_expr *absstart; + + /* Current location inside an absolute section (including the start). + * NULL if not in an absolute section. + */ + /*@null@*/ yasm_expr *abspos; +} yasm_parser_nasm; + +#endif diff --git a/modules/parsers/nasm/nasm-parser.h b/modules/parsers/nasm/nasm-parser.h index e0607a7b..b213edcc 100644 --- a/modules/parsers/nasm/nasm-parser.h +++ b/modules/parsers/nasm/nasm-parser.h @@ -27,6 +27,8 @@ #ifndef YASM_NASM_PARSER_H #define YASM_NASM_PARSER_H +#include "nasm-parser-struct.h" + #define YYCTYPE unsigned char #define MAX_SAVED_LINE_LEN 80 @@ -72,68 +74,17 @@ enum tokentype { NONE /* special token for lookahead */ }; -typedef union { - unsigned int int_info; - char *str_val; - yasm_intnum *intn; - yasm_floatnum *flt; - yasm_bytecode *bc; - uintptr_t arch_data; - struct { - char *contents; - size_t len; - } str; -} yystype; -#define YYSTYPE yystype +enum nasm_parser_state { + INITIAL, + DIRECTIVE, + SECTION_DIRECTIVE, + DIRECTIVE2, + LINECHG, + LINECHG2, + INSTRUCTION +}; -typedef struct yasm_parser_nasm { - int tasm; - - /*@only@*/ yasm_object *object; - - /* last "base" label for local (.) labels */ - /*@null@*/ char *locallabel_base; - size_t locallabel_base_len; - - /*@dependent@*/ yasm_preproc *preproc; - /*@dependent@*/ yasm_errwarns *errwarns; - - /*@dependent@*/ yasm_linemap *linemap; - - /*@null@*/ yasm_bytecode *prev_bc; - - int save_input; - - yasm_scanner s; - enum { - INITIAL, - DIRECTIVE, - SECTION_DIRECTIVE, - DIRECTIVE2, - LINECHG, - LINECHG2, - INSTRUCTION - } state; - - int token; /* enum tokentype or any character */ - yystype tokval; - char tokch; /* first character of token */ - - /* one token of lookahead; used sparingly */ - int peek_token; /* NONE if none */ - yystype peek_tokval; - char peek_tokch; - - /* Starting point of the absolute section. NULL if not in an absolute - * section. - */ - /*@null@*/ yasm_expr *absstart; - - /* Current location inside an absolute section (including the start). - * NULL if not in an absolute section. - */ - /*@null@*/ yasm_expr *abspos; -} yasm_parser_nasm; +#define YYSTYPE nasm_yystype /* shorter access names to commonly used parser_nasm fields */ #define p_object (parser_nasm->object) From 7d6b1a0ae4eafe0bd4b2197f74062934b7263cd6 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 19 Jan 2010 07:03:15 +0000 Subject: [PATCH 332/585] Nasm parser: Add some very basic MASM-ish syntax handling, along the lines of the TASM "mode". These code paths aren't used yet; they will be used for GAS .intel_syntax handling. Contributed by: Alexei Svitkine svn path=/trunk/yasm/; revision=2277 --- modules/parsers/nasm/nasm-parse.c | 64 +++++++++++++++++++++-- modules/parsers/nasm/nasm-parser-struct.h | 1 + modules/parsers/nasm/nasm-parser.c | 1 + modules/parsers/nasm/nasm-parser.h | 2 + modules/parsers/nasm/nasm-token.re | 16 +++++- 5 files changed, 80 insertions(+), 4 deletions(-) diff --git a/modules/parsers/nasm/nasm-parse.c b/modules/parsers/nasm/nasm-parse.c index 242d3f0b..72db7775 100644 --- a/modules/parsers/nasm/nasm-parse.c +++ b/modules/parsers/nasm/nasm-parse.c @@ -178,6 +178,7 @@ describe_token(int token) case INSN: str = "instruction"; break; case PREFIX: str = "instruction prefix"; break; case REG: str = "register"; break; + case REGGROUP: str = "register group"; break; case SEGREG: str = "segment register"; break; case TARGETMOD: str = "target modifier"; break; case LEFT_OP: str = "<<"; break; @@ -843,6 +844,12 @@ parse_operand(yasm_parser_nasm *parser_nasm) { yasm_insn_operand *op2; get_next_token(); + if (parser_nasm->masm && curtok == ID && !yasm__strcasecmp(ID_val, "flat")) { + get_next_token(); + if (curtok == ':') { + get_next_token(); + } + } op = parse_operand(parser_nasm); if (!op) { yasm_error_set(YASM_ERROR_SYNTAX, @@ -904,6 +911,35 @@ parse_operand(yasm_parser_nasm *parser_nasm) op = yasm_operand_create_reg(REG_val); get_next_token(); return op; + case REGGROUP: + { + unsigned long regindex; + uintptr_t reg = REGGROUP_val; + get_next_token(); /* REGGROUP */ + if (curtok != '(') + return yasm_operand_create_reg(reg); + get_next_token(); /* '(' */ + if (!expect(INTNUM)) { + yasm_error_set(YASM_ERROR_SYNTAX, + N_("integer register index expected")); + return NULL; + } + regindex = yasm_intnum_get_uint(INTNUM_val); + get_next_token(); /* INTNUM */ + if (!expect(')')) { + yasm_error_set(YASM_ERROR_SYNTAX, + N_("missing closing parenthesis for register index")); + return NULL; + } + get_next_token(); /* ')' */ + reg = yasm_arch_reggroup_get_reg(p_object->arch, reg, regindex); + if (reg == 0) { + yasm_error_set(YASM_ERROR_SYNTAX, N_("bad register index `%u'"), + regindex); + return NULL; + } + return yasm_operand_create_reg(reg); + } case STRICT: get_next_token(); op = parse_operand(parser_nasm); @@ -914,6 +950,9 @@ parse_operand(yasm_parser_nasm *parser_nasm) { unsigned int size = SIZE_OVERRIDE_val; get_next_token(); + if (parser_nasm->masm && curtok == ID && !yasm__strcasecmp(ID_val, "ptr")) { + get_next_token(); + } op = parse_operand(parser_nasm); if (!op) return NULL; @@ -988,15 +1027,34 @@ parse_operand(yasm_parser_nasm *parser_nasm) yasm_expr *e = parse_bexpr(parser_nasm, NORM_EXPR); if (!e) return NULL; - if (curtok != ':') + if (curtok != ':') { if (parser_nasm->tasm && yasm_expr_size(e)) { yasm_effaddr *ea = yasm_arch_ea_create(p_object->arch, e); yasm_ea_set_implicit_size_segment(parser_nasm, ea, e); op = yasm_operand_create_mem(ea); return op; - } else + } else if (curtok == '[') { + yasm_expr *f; + yasm_effaddr *ea; + yasm_insn_operand *op2; + + op = parse_operand(parser_nasm); + if (!op) + return NULL; + + f = op->data.ea->disp.abs; + e = p_expr_new_tree(e, YASM_EXPR_ADD, f); + ea = yasm_arch_ea_create(p_object->arch, e); + yasm_ea_set_implicit_size_segment(parser_nasm, ea, e); + op2 = yasm_operand_create_mem(ea); + + yasm_xfree(op); + + return op2; + } else { return yasm_operand_create_imm(e); - else { + } + } else { yasm_expr *off; get_next_token(); off = parse_bexpr(parser_nasm, NORM_EXPR); diff --git a/modules/parsers/nasm/nasm-parser-struct.h b/modules/parsers/nasm/nasm-parser-struct.h index 506f02cc..60b098a5 100644 --- a/modules/parsers/nasm/nasm-parser-struct.h +++ b/modules/parsers/nasm/nasm-parser-struct.h @@ -42,6 +42,7 @@ typedef union { typedef struct yasm_parser_nasm { int tasm; + int masm; /*@only@*/ yasm_object *object; diff --git a/modules/parsers/nasm/nasm-parser.c b/modules/parsers/nasm/nasm-parser.c index b0ad4b51..11be0b6e 100644 --- a/modules/parsers/nasm/nasm-parser.c +++ b/modules/parsers/nasm/nasm-parser.c @@ -39,6 +39,7 @@ nasm_do_parse(yasm_object *object, yasm_preproc *pp, int save_input, yasm_parser_nasm parser_nasm; parser_nasm.tasm = tasm; + parser_nasm.masm = 0; parser_nasm.object = object; parser_nasm.linemap = linemap; diff --git a/modules/parsers/nasm/nasm-parser.h b/modules/parsers/nasm/nasm-parser.h index b213edcc..257429b8 100644 --- a/modules/parsers/nasm/nasm-parser.h +++ b/modules/parsers/nasm/nasm-parser.h @@ -57,6 +57,7 @@ enum tokentype { INSN, PREFIX, REG, + REGGROUP, SEGREG, TARGETMOD, LEFT_OP, @@ -104,6 +105,7 @@ enum nasm_parser_state { #define INSN_val (curval.bc) #define PREFIX_val (curval.arch_data) #define REG_val (curval.arch_data) +#define REGGROUP_val (curval.arch_data) #define SEGREG_val (curval.arch_data) #define TARGETMOD_val (curval.arch_data) #define ID_val (curval.str_val) diff --git a/modules/parsers/nasm/nasm-token.re b/modules/parsers/nasm/nasm-token.re index 6e9b3ca4..f057bb17 100644 --- a/modules/parsers/nasm/nasm-token.re +++ b/modules/parsers/nasm/nasm-token.re @@ -84,6 +84,10 @@ handle_dot_label(YYSTYPE *lvalp, char *tok, size_t toklen, size_t zeropos, return NONLOCAL_ID; return SPECIAL_ID; } + if (parser_nasm->masm && tok[zeropos] == '.') { + lvalp->str_val = yasm__xstrndup(tok + zeropos, toklen - zeropos); + return SPECIAL_ID; + } if (parser_nasm->tasm && (!tasm_locals || (tok[zeropos] == '.' && tok[zeropos+1] != '@' && tok[zeropos+2] != '@'))) { @@ -416,10 +420,20 @@ scan: case YASM_ARCH_TARGETMOD: s->tok[TOKLEN] = savech; RETURN(TARGETMOD); + case YASM_ARCH_REGGROUP: + if (parser_nasm->masm) { + s->tok[TOKLEN] = savech; + RETURN(REGGROUP); + } default: break; } - if (parser_nasm->tasm) { + if (parser_nasm->masm) { + if (!yasm__strcasecmp(TOK, "offset")) { + s->tok[TOKLEN] = savech; + RETURN(OFFSET); + } + } else if (parser_nasm->tasm) { if (!yasm__strcasecmp(TOK, "shl")) { s->tok[TOKLEN] = savech; RETURN(LEFT_OP); From 14888572a63cc9622d9c3bf4ab44b3cd8ba4b709 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 19 Jan 2010 07:28:08 +0000 Subject: [PATCH 333/585] Add nasm-parser-struct.h to SOURCES. svn path=/trunk/yasm/; revision=2278 --- modules/parsers/nasm/Makefile.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/parsers/nasm/Makefile.inc b/modules/parsers/nasm/Makefile.inc index 7149959d..feda7e84 100644 --- a/modules/parsers/nasm/Makefile.inc +++ b/modules/parsers/nasm/Makefile.inc @@ -2,6 +2,7 @@ libyasm_a_SOURCES += modules/parsers/nasm/nasm-parser.c libyasm_a_SOURCES += modules/parsers/nasm/nasm-parser.h +libyasm_a_SOURCES += modules/parsers/nasm/nasm-parser-struct.h libyasm_a_SOURCES += modules/parsers/nasm/nasm-parse.c nodist_libyasm_a_SOURCES += nasm-token.c From cb7f1a254c41586e905a3fa1b5e85c73fb276ad4 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 19 Jan 2010 07:57:43 +0000 Subject: [PATCH 334/585] Add .intel_syntax and .gas_syntax support to GAS parser. Uses the NASM parser for the .intel_syntax parsing heavy lifting. Contributed by: Alexei Svitkine svn path=/trunk/yasm/; revision=2279 --- modules/arch/x86/x86arch.c | 3 + modules/arch/x86/x86arch.h | 15 ++- modules/arch/x86/x86bc.c | 2 +- modules/arch/x86/x86id.c | 11 ++- modules/parsers/gas/CMakeLists.txt | 1 + modules/parsers/gas/Makefile.inc | 1 + modules/parsers/gas/gas-parse-intel.c | 91 +++++++++++++++++++ modules/parsers/gas/gas-parse.c | 36 ++++++++ modules/parsers/gas/gas-parser.c | 2 + modules/parsers/gas/gas-parser.h | 4 + modules/parsers/gas/tests/bin/Makefile.inc | 2 + .../tests/bin/gas-intel_syntax-noprefix.asm | 19 ++++ .../tests/bin/gas-intel_syntax-noprefix.hex | 58 ++++++++++++ modules/parsers/nasm/nasm-parse.c | 22 +++++ splint.sh | 1 + 15 files changed, 257 insertions(+), 11 deletions(-) create mode 100644 modules/parsers/gas/gas-parse-intel.c create mode 100644 modules/parsers/gas/tests/bin/gas-intel_syntax-noprefix.asm create mode 100644 modules/parsers/gas/tests/bin/gas-intel_syntax-noprefix.hex diff --git a/modules/arch/x86/x86arch.c b/modules/arch/x86/x86arch.c index 73192ecc..95b7e385 100644 --- a/modules/arch/x86/x86arch.c +++ b/modules/arch/x86/x86arch.c @@ -68,6 +68,7 @@ x86_create(const char *machine, const char *parser, arch_x86->mode_bits = 0; arch_x86->force_strict = 0; arch_x86->default_rel = 0; + arch_x86->gas_intel_mode = 0; arch_x86->nop = X86_NOP_BASIC; if (yasm__strcasecmp(parser, "nasm") == 0) @@ -133,6 +134,8 @@ x86_set_var(yasm_arch *arch, const char *var, unsigned long val) N_("ignoring default rel in non-64-bit mode")); else arch_x86->default_rel = (unsigned int)val; + } else if (yasm__strcasecmp(var, "gas_intel_mode") == 0) { + arch_x86->gas_intel_mode = (unsigned int)val; } else return 1; return 0; diff --git a/modules/arch/x86/x86arch.h b/modules/arch/x86/x86arch.h index 29d8f7a4..e33f132f 100644 --- a/modules/arch/x86/x86arch.h +++ b/modules/arch/x86/x86arch.h @@ -74,6 +74,14 @@ #define CPU_FMA4 40 /* AMD Fused-Multiply-Add extensions */ #define CPU_CVT16 41 /* AMD CVT16 extensions */ +enum x86_parser_type { + X86_PARSER_NASM = 0, + X86_PARSER_TASM = 1, + X86_PARSER_GAS = 2 +}; + +#define PARSER(arch) (((arch)->parser == X86_PARSER_GAS && (arch)->gas_intel_mode) ? X86_PARSER_NASM : (arch)->parser) + typedef struct yasm_arch_x86 { yasm_arch_base arch; /* base structure */ @@ -83,14 +91,11 @@ typedef struct yasm_arch_x86 { wordptr *cpu_enables; unsigned int amd64_machine; - enum { - X86_PARSER_NASM = 0, - X86_PARSER_TASM = 1, - X86_PARSER_GAS = 2 - } parser; + enum x86_parser_type parser; unsigned int mode_bits; unsigned int force_strict; unsigned int default_rel; + unsigned int gas_intel_mode; enum { X86_NOP_BASIC = 0, diff --git a/modules/arch/x86/x86bc.c b/modules/arch/x86/x86bc.c index 844a3342..c329f2ea 100644 --- a/modules/arch/x86/x86bc.c +++ b/modules/arch/x86/x86bc.c @@ -226,7 +226,7 @@ yasm_x86__ea_create_expr(yasm_arch *arch, yasm_expr *e) x86_ea = ea_create(); if (arch_x86->parser == X86_PARSER_GAS) { - /* Need to change foo+rip into foo wrt rip. + /* Need to change foo+rip into foo wrt rip (even in .intel_syntax mode). * Note this assumes a particular ordering coming from the parser * to work (it's not very smart)! */ diff --git a/modules/arch/x86/x86id.c b/modules/arch/x86/x86id.c index c446d462..c734d335 100644 --- a/modules/arch/x86/x86id.c +++ b/modules/arch/x86/x86id.c @@ -1753,7 +1753,7 @@ yasm_x86__parse_check_insnprefix(yasm_arch *arch, const char *id, lcaseid[i] = tolower(id[i]); lcaseid[id_len] = '\0'; - switch (arch_x86->parser) { + switch (PARSER(arch_x86)) { case X86_PARSER_NASM: pdata = insnprefix_nasm_find(lcaseid, id_len); break; @@ -1793,7 +1793,8 @@ yasm_x86__parse_check_insnprefix(yasm_arch *arch, const char *id, id_insn->mode_bits = arch_x86->mode_bits; id_insn->suffix = 0; id_insn->misc_flags = 0; - id_insn->parser = arch_x86->parser; + id_insn->parser = PARSER(arch_x86); + id_insn->force_strict = arch_x86->force_strict != 0; id_insn->default_rel = arch_x86->default_rel != 0; *bc = yasm_bc_create_common(&x86_id_insn_callback, id_insn, line); @@ -1824,7 +1825,7 @@ yasm_x86__parse_check_insnprefix(yasm_arch *arch, const char *id, id_insn->mode_bits = arch_x86->mode_bits; id_insn->suffix = pdata->flags; id_insn->misc_flags = pdata->misc_flags; - id_insn->parser = arch_x86->parser; + id_insn->parser = PARSER(arch_x86); id_insn->force_strict = arch_x86->force_strict != 0; id_insn->default_rel = arch_x86->default_rel != 0; *bc = yasm_bc_create_common(&x86_id_insn_callback, id_insn, line); @@ -1885,9 +1886,9 @@ yasm_x86__create_empty_insn(yasm_arch *arch, unsigned long line) id_insn->mod_data[2] = 0; id_insn->num_info = NELEMS(empty_insn); id_insn->mode_bits = arch_x86->mode_bits; - id_insn->suffix = (arch_x86->parser == X86_PARSER_GAS) ? SUF_Z : 0; + id_insn->suffix = (PARSER(arch_x86) == X86_PARSER_GAS) ? SUF_Z : 0; id_insn->misc_flags = 0; - id_insn->parser = arch_x86->parser; + id_insn->parser = PARSER(arch_x86); id_insn->force_strict = arch_x86->force_strict != 0; id_insn->default_rel = arch_x86->default_rel != 0; diff --git a/modules/parsers/gas/CMakeLists.txt b/modules/parsers/gas/CMakeLists.txt index de23426f..d4ecb3ea 100644 --- a/modules/parsers/gas/CMakeLists.txt +++ b/modules/parsers/gas/CMakeLists.txt @@ -7,5 +7,6 @@ YASM_RE2C( YASM_ADD_MODULE(parser_gas parsers/gas/gas-parser.c parsers/gas/gas-parse.c + parsers/gas/gas-parse-intel.c gas-token.c ) diff --git a/modules/parsers/gas/Makefile.inc b/modules/parsers/gas/Makefile.inc index 84fa4190..ebc36576 100644 --- a/modules/parsers/gas/Makefile.inc +++ b/modules/parsers/gas/Makefile.inc @@ -3,6 +3,7 @@ libyasm_a_SOURCES += modules/parsers/gas/gas-parser.c libyasm_a_SOURCES += modules/parsers/gas/gas-parser.h libyasm_a_SOURCES += modules/parsers/gas/gas-parse.c +libyasm_a_SOURCES += modules/parsers/gas/gas-parse-intel.c nodist_libyasm_a_SOURCES += gas-token.c YASM_MODULES += parser_gas parser_gnu diff --git a/modules/parsers/gas/gas-parse-intel.c b/modules/parsers/gas/gas-parse-intel.c new file mode 100644 index 00000000..ca54d2ed --- /dev/null +++ b/modules/parsers/gas/gas-parse-intel.c @@ -0,0 +1,91 @@ +/* + * GAS-compatible parser Intel syntax support + * + * Copyright (C) 2010 Alexei Svitkine + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the author nor the names of other contributors + * may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include +RCSID("$Id$"); + +#include + +#include "modules/parsers/gas/gas-parser.h" +#include "modules/parsers/nasm/nasm-parser-struct.h" + +extern yasm_bytecode *gas_intel_syntax_parse_instr(yasm_parser_nasm *parser_nasm, unsigned char *instr); + +#define SET_FIELDS(to, from) \ + (to)->object = (from)->object; \ + (to)->locallabel_base = (from)->locallabel_base; \ + (to)->locallabel_base_len = (from)->locallabel_base_len; \ + (to)->preproc = (from)->preproc; \ + (to)->errwarns = (from)->errwarns; \ + (to)->linemap = (from)->linemap; \ + (to)->prev_bc = (from)->prev_bc; + +yasm_bytecode *parse_instr_intel(yasm_parser_gas *parser_gas) +{ + char *stok, *slim; + unsigned char *line; + size_t length; + + yasm_parser_nasm parser_nasm; + yasm_bytecode *bc; + + memset(&parser_nasm, 0, sizeof(parser_nasm)); + + yasm_arch_set_var(parser_gas->object->arch, "gas_intel_mode", 1); + SET_FIELDS(&parser_nasm, parser_gas); + parser_nasm.masm = 1; + + stok = (char *) parser_gas->s.tok; + slim = (char *) parser_gas->s.lim; + length = 0; + while (&stok[length] < slim && stok[length] != '\n') { + length++; + } + + if (&stok[length] == slim && parser_gas->line) { + line = yasm_xmalloc(length + parser_gas->lineleft + 1); + memcpy(line, parser_gas->s.tok, length); + memcpy(line + length, parser_gas->linepos, parser_gas->lineleft); + length += parser_gas->lineleft; + if (line[length - 1] == '\n') length--; + } else { + line = yasm_xmalloc(length + 1); + memcpy(line, parser_gas->s.tok, length); + } + line[length] = '\0'; + + bc = gas_intel_syntax_parse_instr(&parser_nasm, line); + + SET_FIELDS(parser_gas, &parser_nasm); + yasm_arch_set_var(parser_gas->object->arch, "gas_intel_mode", 0); + + yasm_xfree(line); + + return bc; +} diff --git a/modules/parsers/gas/gas-parse.c b/modules/parsers/gas/gas-parse.c index b3e318df..8ab7a41b 100644 --- a/modules/parsers/gas/gas-parse.c +++ b/modules/parsers/gas/gas-parse.c @@ -881,6 +881,26 @@ dir_file(yasm_parser_gas *parser_gas, unsigned int param) return NULL; } + +static yasm_bytecode * +dir_intel_syntax(yasm_parser_gas *parser_gas, unsigned int param) +{ + parser_gas->intel_syntax = 1; + + do { + destroy_curtok(); + get_next_token(); + } while (!is_eol()); + return NULL; +} + +static yasm_bytecode * +dir_att_syntax(yasm_parser_gas *parser_gas, unsigned int param) +{ + parser_gas->intel_syntax = 0; + return NULL; +} + static yasm_bytecode * parse_instr(yasm_parser_gas *parser_gas) { @@ -889,6 +909,19 @@ parse_instr(yasm_parser_gas *parser_gas) size_t id_len; uintptr_t prefix; + if (parser_gas->intel_syntax) { + bc = parse_instr_intel(parser_gas); + if (bc) { + yasm_warn_disable(YASM_WARN_UNREC_CHAR); + do { + destroy_curtok(); + get_next_token(); + } while (!is_eol()); + yasm_warn_enable(YASM_WARN_UNREC_CHAR); + } + return bc; + } + if (curtok != ID) return NULL; @@ -1673,6 +1706,9 @@ static dir_lookup dirs_static[] = { {".space", dir_skip, 0, INITIAL}, {".fill", dir_fill, 0, INITIAL}, {".zero", dir_zero, 0, INITIAL}, + /* syntax directives */ + {".intel_syntax", dir_intel_syntax, 0, INITIAL}, + {".att_syntax", dir_att_syntax, 0, INITIAL}, /* other directives */ {".equ", dir_equ, 0, INITIAL}, {".file", dir_file, 0, INITIAL}, diff --git a/modules/parsers/gas/gas-parser.c b/modules/parsers/gas/gas-parser.c index d4211539..948341d9 100644 --- a/modules/parsers/gas/gas-parser.c +++ b/modules/parsers/gas/gas-parser.c @@ -74,6 +74,8 @@ gas_parser_do_parse(yasm_object *object, yasm_preproc *pp, for (i=0; i<10; i++) parser_gas.local[i] = 0; + parser_gas.intel_syntax = 0; + parser_gas.is_cpp_preproc = yasm__strcasecmp(((yasm_preproc_base*)pp)->module->keyword, "cpp") == 0; parser_gas.is_nasm_preproc = diff --git a/modules/parsers/gas/gas-parser.h b/modules/parsers/gas/gas-parser.h index fe8a0bc0..2b1d311a 100644 --- a/modules/parsers/gas/gas-parser.h +++ b/modules/parsers/gas/gas-parser.h @@ -122,6 +122,8 @@ typedef struct yasm_parser_gas { /* Parser-handled directives HAMT lookup */ HAMT *dirs; + int intel_syntax; + int is_nasm_preproc; int is_cpp_preproc; } yasm_parser_gas; @@ -152,6 +154,8 @@ typedef struct yasm_parser_gas { #define p_expr_new_branch(o,r) yasm_expr_create_branch(o,r,cur_line) #define p_expr_new_ident(r) yasm_expr_create_ident(r,cur_line) +yasm_bytecode *parse_instr_intel(yasm_parser_gas *parser_gas); + void gas_parser_parse(yasm_parser_gas *parser_gas); void gas_parser_cleanup(yasm_parser_gas *parser_gas); int gas_parser_lex(YYSTYPE *lvalp, yasm_parser_gas *parser_gas); diff --git a/modules/parsers/gas/tests/bin/Makefile.inc b/modules/parsers/gas/tests/bin/Makefile.inc index e7d97831..c318defa 100644 --- a/modules/parsers/gas/tests/bin/Makefile.inc +++ b/modules/parsers/gas/tests/bin/Makefile.inc @@ -6,6 +6,8 @@ EXTRA_DIST += modules/parsers/gas/tests/bin/gas_bin_test.sh EXTRA_DIST += modules/parsers/gas/tests/bin/gas-comment.asm EXTRA_DIST += modules/parsers/gas/tests/bin/gas-comment.errwarn EXTRA_DIST += modules/parsers/gas/tests/bin/gas-comment.hex +EXTRA_DIST += modules/parsers/gas/tests/bin/gas-intel_syntax-noprefix.asm +EXTRA_DIST += modules/parsers/gas/tests/bin/gas-intel_syntax-noprefix.hex EXTRA_DIST += modules/parsers/gas/tests/bin/gas-llabel.asm EXTRA_DIST += modules/parsers/gas/tests/bin/gas-llabel.hex EXTRA_DIST += modules/parsers/gas/tests/bin/gas-set.asm diff --git a/modules/parsers/gas/tests/bin/gas-intel_syntax-noprefix.asm b/modules/parsers/gas/tests/bin/gas-intel_syntax-noprefix.asm new file mode 100644 index 00000000..25c65076 --- /dev/null +++ b/modules/parsers/gas/tests/bin/gas-intel_syntax-noprefix.asm @@ -0,0 +1,19 @@ +.intel_syntax noprefix +.section .rodata +.LC0: +.string "Hello" +.text + lea ecx, 4 [esp] + and esp, -16 + push DWORD PTR [ecx-4] + push ebp + fstp st(0) + ffree st(1) + mov ebp, esp + push ecx + sub esp, 4 + mov DWORD PTR [esp], OFFSET FLAT:.LC0 + add esp, 4 + pop ebp + lea esp, [ecx-4] + ret diff --git a/modules/parsers/gas/tests/bin/gas-intel_syntax-noprefix.hex b/modules/parsers/gas/tests/bin/gas-intel_syntax-noprefix.hex new file mode 100644 index 00000000..fe0fdafa --- /dev/null +++ b/modules/parsers/gas/tests/bin/gas-intel_syntax-noprefix.hex @@ -0,0 +1,58 @@ +67 +66 +8d +4c +24 +04 +66 +83 +e4 +f0 +67 +66 +ff +71 +fc +66 +55 +dd +d8 +dd +c1 +66 +89 +e5 +66 +51 +66 +83 +ec +04 +67 +66 +c7 +04 +24 +34 +00 +00 +00 +66 +83 +c4 +04 +66 +5d +67 +66 +8d +61 +fc +c3 +00 +48 +65 +6c +6c +6f +00 diff --git a/modules/parsers/nasm/nasm-parse.c b/modules/parsers/nasm/nasm-parse.c index 72db7775..0c4820ff 100644 --- a/modules/parsers/nasm/nasm-parse.c +++ b/modules/parsers/nasm/nasm-parse.c @@ -1664,3 +1664,25 @@ nasm_parser_directive(yasm_parser_nasm *parser_nasm, const char *name, if (objext_valparams) yasm_vps_delete(objext_valparams); } + +yasm_bytecode * +gas_intel_syntax_parse_instr(yasm_parser_nasm *parser_nasm, unsigned char *instr) +{ + yasm_bytecode *bc = NULL; + char *sinstr = (char *) instr; + + parser_nasm->s.bot = instr; + parser_nasm->s.tok = instr; + parser_nasm->s.ptr = instr; + parser_nasm->s.cur = instr; + parser_nasm->s.lim = instr + strlen(sinstr) + 1; + parser_nasm->s.top = parser_nasm->s.lim; + parser_nasm->peek_token = NONE; + + get_next_token(); + if (!is_eol()) { + bc = parse_instr(parser_nasm); + } + + return bc; +} diff --git a/splint.sh b/splint.sh index 0a119281..56850ff3 100755 --- a/splint.sh +++ b/splint.sh @@ -78,6 +78,7 @@ splint \ modules/objfmts/rdf/rdf-objfmt.c \ modules/objfmts/xdf/xdf-objfmt.c \ modules/parsers/gas/gas-parse.c \ + modules/parsers/gas/gas-parse-intel.c \ modules/parsers/gas/gas-parser.c \ modules/parsers/nasm/nasm-parse.c \ modules/parsers/nasm/nasm-parser.c \ From 3097cd1ad024fff024a40c78dfc61d04e155e7a1 Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Tue, 19 Jan 2010 11:09:21 +0000 Subject: [PATCH 335/585] Update VC++ v9 build svn path=/trunk/yasm/; revision=2280 --- Mkfiles/vc9/modules/modules.vcproj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Mkfiles/vc9/modules/modules.vcproj b/Mkfiles/vc9/modules/modules.vcproj index 9de56658..24638379 100644 --- a/Mkfiles/vc9/modules/modules.vcproj +++ b/Mkfiles/vc9/modules/modules.vcproj @@ -490,6 +490,10 @@ + + From d9bfa3d26f02b2759528e13b632802c4c5e6a6bb Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Tue, 19 Jan 2010 11:11:35 +0000 Subject: [PATCH 336/585] Update VC++ v10 build svn path=/trunk/yasm/; revision=2281 --- Mkfiles/vc10/modules/modules.vcxproj | 1 + Mkfiles/vc10/modules/modules.vcxproj.filters | 3 +++ 2 files changed, 4 insertions(+) diff --git a/Mkfiles/vc10/modules/modules.vcxproj b/Mkfiles/vc10/modules/modules.vcxproj index 8af38cf4..75cbfccd 100644 --- a/Mkfiles/vc10/modules/modules.vcxproj +++ b/Mkfiles/vc10/modules/modules.vcxproj @@ -206,6 +206,7 @@ + diff --git a/Mkfiles/vc10/modules/modules.vcxproj.filters b/Mkfiles/vc10/modules/modules.vcxproj.filters index fbcd9fbf..1d0ad244 100644 --- a/Mkfiles/vc10/modules/modules.vcxproj.filters +++ b/Mkfiles/vc10/modules/modules.vcxproj.filters @@ -127,6 +127,9 @@ Source Files\objfmts + + Source Files\parsers + Source Files\parsers From 702da8cc554cf36ccbc7a3d9d682be693f71a0f3 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 20 Jan 2010 03:58:15 +0000 Subject: [PATCH 337/585] Update flat and DJGPP Makefiles for GAS preproc and parser changes. svn path=/trunk/yasm/; revision=2282 --- Mkfiles/Makefile.dj | 9 ++++++++- Mkfiles/Makefile.flat | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Mkfiles/Makefile.dj b/Mkfiles/Makefile.dj index e3702ebf..de05d141 100644 --- a/Mkfiles/Makefile.dj +++ b/Mkfiles/Makefile.dj @@ -109,6 +109,7 @@ MODULES_PARSERS_OBJS= \ modules/parsers/nasm/nasm-parse.o \ nasm-token.o \ modules/parsers/gas/gas-parser.o \ + modules/parsers/gas/gas-parse-intel.o \ modules/parsers/gas/gas-parse.o \ gas-token.o YASM_MODULES+=parser_nasm parser_tasm @@ -129,10 +130,16 @@ MODULES_PREPROCS_CPP_OBJS = \ modules/preprocs/cpp/cpp-preproc.o YASM_MODULES+=preproc_cpp +MODULES_PREPROCS_GAS_OBJS = \ + modules/preprocs/gas/gas-eval.o \ + modules/preprocs/gas/gas-preproc.o +YASM_MODULES+=preproc_gas + MODULES_PREPROCS_OBJS = \ $(MODULES_PREPROCS_NASM_OBJS) \ $(MODULES_PREPROCS_RAW_OBJS) \ - $(MODULES_PREPROCS_CPP_OBJS) + $(MODULES_PREPROCS_CPP_OBJS) \ + $(MODULES_PREPROCS_GAS_OBJS) MODULES_OBJS = \ $(MODULES_ARCH_OBJS) \ diff --git a/Mkfiles/Makefile.flat b/Mkfiles/Makefile.flat index d97a491d..75450588 100644 --- a/Mkfiles/Makefile.flat +++ b/Mkfiles/Makefile.flat @@ -112,6 +112,7 @@ MODULES_PARSERS_OBJS= \ modules/parsers/nasm/nasm-parse.o \ nasm-token.o \ modules/parsers/gas/gas-parser.o \ + modules/parsers/gas/gas-parse-intel.o \ modules/parsers/gas/gas-parse.o \ gas-token.o YASM_MODULES+=parser_nasm parser_tasm @@ -132,10 +133,16 @@ MODULES_PREPROCS_CPP_OBJS = \ modules/preprocs/cpp/cpp-preproc.o YASM_MODULES+=preproc_cpp +MODULES_PREPROCS_GAS_OBJS = \ + modules/preprocs/gas/gas-eval.o \ + modules/preprocs/gas/gas-preproc.o +YASM_MODULES+=preproc_gas + MODULES_PREPROCS_OBJS = \ $(MODULES_PREPROCS_NASM_OBJS) \ $(MODULES_PREPROCS_RAW_OBJS) \ - $(MODULES_PREPROCS_CPP_OBJS) + $(MODULES_PREPROCS_CPP_OBJS) \ + $(MODULES_PREPROCS_GAS_OBJS) MODULES_OBJS = \ $(MODULES_ARCH_OBJS) \ From 419e16fc7165d8d1068783535584e2e8014fce6a Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 6 Feb 2010 09:13:56 +0000 Subject: [PATCH 338/585] nasm_pp_cleanup(): Do a better job of cleaning up. svn path=/trunk/yasm/; revision=2283 --- modules/preprocs/nasm/nasm-pp.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/preprocs/nasm/nasm-pp.c b/modules/preprocs/nasm/nasm-pp.c index 5762e9d3..b7c99832 100644 --- a/modules/preprocs/nasm/nasm-pp.c +++ b/modules/preprocs/nasm/nasm-pp.c @@ -5065,7 +5065,13 @@ pp_cleanup(int pass_) free_llist(builtindef); free_llist(stddef); free_llist(predef); + builtindef = NULL; + stddef = NULL; + predef = NULL; + freeTokens = NULL; delete_Blocks(); + blocks.next = NULL; + blocks.chunk = NULL; } } From 463f4d79636d6d320f4c10f67423af893e5a67be Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 6 Feb 2010 09:27:32 +0000 Subject: [PATCH 339/585] Add "vsyasm", a batch version of yasm primarily useful for VS2010. Basically the objfile, listfile, and mapfile options specify output directories instead of files. Multiple files are accepted and each one is independently assembled in command line order. All options (such as include directories and predefined macros) apply to all input files. Any error terminates the process early. Suggested by: Brian Gladman svn path=/trunk/yasm/; revision=2284 --- Mkfiles/Makefile.dj | 11 +- Mkfiles/Makefile.flat | 11 +- frontends/Makefile.inc | 2 + frontends/vsyasm/CMakeLists.txt | 29 + frontends/vsyasm/Makefile.inc | 11 + frontends/vsyasm/vsyasm.c | 1329 +++++++++++++++++++++++++++++++ 6 files changed, 1391 insertions(+), 2 deletions(-) create mode 100644 frontends/vsyasm/CMakeLists.txt create mode 100644 frontends/vsyasm/Makefile.inc create mode 100644 frontends/vsyasm/vsyasm.c diff --git a/Mkfiles/Makefile.dj b/Mkfiles/Makefile.dj index de05d141..419bed86 100644 --- a/Mkfiles/Makefile.dj +++ b/Mkfiles/Makefile.dj @@ -13,7 +13,7 @@ CFLAGS=-DHAVE_CONFIG_H -IMkfiles/dj -O -I. CC?=gcc BUILDCC?=$(CC) -all: yasm ytasm +all: yasm ytasm vsyasm LIBYASM_OBJS= \ libyasm/assocdat.o \ @@ -162,6 +162,12 @@ YTASM_OBJS= \ $(LIBYASM_OBJS) \ $(MODULES_OBJS) +VSYASM_OBJS= \ + frontends/vsyasm/vsyasm.o \ + frontends/yasm/yasm-options.o \ + $(LIBYASM_OBJS) \ + $(MODULES_OBJS) + genstring: genstring.c $(BUILDCC) -o $@ $< @@ -259,6 +265,9 @@ yasm: $(YASM_OBJS) ytasm: $(YTASM_OBJS) $(CC) -o ytasm $(YTASM_OBJS) +vsyasm: $(VSYASM_OBJS) + $(CC) -o vsyasm $(VSYASM_OBJS) + .c.o: $(CC) -c $(CFLAGS) -o $@ $< diff --git a/Mkfiles/Makefile.flat b/Mkfiles/Makefile.flat index 75450588..b979176d 100644 --- a/Mkfiles/Makefile.flat +++ b/Mkfiles/Makefile.flat @@ -16,7 +16,7 @@ CFLAGS=-DHAVE_CONFIG_H -IMkfiles -I. CC?=gcc BUILDCC?=$(CC) -all: yasm ytasm +all: yasm ytasm vsyasm LIBYASM_OBJS= \ libyasm/assocdat.o \ @@ -165,6 +165,12 @@ YTASM_OBJS= \ $(LIBYASM_OBJS) \ $(MODULES_OBJS) +VSYASM_OBJS= \ + frontends/vsyasm/vsyasm.o \ + frontends/yasm/yasm-options.o \ + $(LIBYASM_OBJS) \ + $(MODULES_OBJS) + genstring: genstring.c $(BUILDCC) -o $@ $< @@ -262,6 +268,9 @@ yasm: $(YASM_OBJS) ytasm: $(YTASM_OBJS) $(CC) -o ytasm $(YTASM_OBJS) +vsyasm: $(VSYASM_OBJS) + $(CC) -o vsyasm $(VSYASM_OBJS) + .c.o: $(CC) -c $(CFLAGS) -o $@ $< diff --git a/frontends/Makefile.inc b/frontends/Makefile.inc index 0e1552fa..72140c3f 100644 --- a/frontends/Makefile.inc +++ b/frontends/Makefile.inc @@ -2,6 +2,8 @@ EXTRA_DIST += frontends/yasm/Makefile.inc EXTRA_DIST += frontends/tasm/Makefile.inc +EXTRA_DIST += frontends/vsyasm/Makefile.inc include frontends/yasm/Makefile.inc include frontends/tasm/Makefile.inc +include frontends/vsyasm/Makefile.inc diff --git a/frontends/vsyasm/CMakeLists.txt b/frontends/vsyasm/CMakeLists.txt new file mode 100644 index 00000000..62c7405c --- /dev/null +++ b/frontends/vsyasm/CMakeLists.txt @@ -0,0 +1,29 @@ +INCLUDE_DIRECTORIES( + ${CMAKE_CURRENT_BINARY_DIR} + ${yasm_SOURCE_DIR}/frontends/yasm + ) + +ADD_CUSTOM_COMMAND( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/license.c + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/frontends/yasm/genstring.py + license_msg + ${CMAKE_CURRENT_BINARY_DIR}/license.c + ${CMAKE_SOURCE_DIR}/COPYING + MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/COPYING + DEPENDS ${CMAKE_SOURCE_DIR}/frontends/yasm/genstring.py + ) + +SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}) + +ADD_EXECUTABLE(vsyasm + vsyasm.c + ${yasm_SOURCE_DIR}/frontends/yasm/yasm-options.c + ${yasm_SOURCE_DIR}/frontends/yasm/yasm-plugin.c + ) +TARGET_LINK_LIBRARIES(vsyasm libyasm ${LIBDL}) + +SET_SOURCE_FILES_PROPERTIES(vsyasm.c PROPERTIES + OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/license.c + ) + +INSTALL(TARGETS vsyasm RUNTIME DESTINATION bin) diff --git a/frontends/vsyasm/Makefile.inc b/frontends/vsyasm/Makefile.inc new file mode 100644 index 00000000..1adcca8d --- /dev/null +++ b/frontends/vsyasm/Makefile.inc @@ -0,0 +1,11 @@ +# $Id: Makefile.inc 1463 2006-04-05 05:39:23Z peter $ + +bin_PROGRAMS += vsyasm + +vsyasm_SOURCES = frontends/vsyasm/vsyasm.c +vsyasm_SOURCES += frontends/yasm/yasm-options.c +vsyasm_SOURCES += frontends/yasm/yasm-options.h + +$(srcdir)/frontends/vsyasm/vsyasm.c: license.c + +vsyasm_LDADD = libyasm.a $(INTLLIBS) diff --git a/frontends/vsyasm/vsyasm.c b/frontends/vsyasm/vsyasm.c new file mode 100644 index 00000000..43a478d8 --- /dev/null +++ b/frontends/vsyasm/vsyasm.c @@ -0,0 +1,1329 @@ +/* + * Program entry point, command line parsing + * + * Copyright (C) 2001-2007 Peter Johnson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include +/*@unused@*/ RCSID("$Id$"); + +#include +#include +#include +#include + +#ifdef HAVE_LIBGEN_H +#include +#endif + +#include "frontends/yasm/yasm-options.h" + +#ifdef CMAKE_BUILD +#include "frontends/yasm/yasm-plugin.h" +#endif + +#include "license.c" + +/*@null@*/ /*@only@*/ static char *objdir_pathname = NULL; +/*@null@*/ /*@only@*/ static char *global_prefix = NULL, *global_suffix = NULL; +/*@null@*/ /*@only@*/ static char *listdir_pathname = NULL; +/*@null@*/ /*@only@*/ static char *mapdir_pathname = NULL; +/*@null@*/ /*@only@*/ static char *machine_name = NULL; +static int special_options = 0; +/*@null@*/ /*@dependent@*/ static const yasm_arch_module * + cur_arch_module = NULL; +/*@null@*/ /*@dependent@*/ static const yasm_parser_module * + cur_parser_module = NULL; +/*@null@*/ /*@dependent@*/ static const yasm_preproc_module * + cur_preproc_module = NULL; +/*@null@*/ static char *objfmt_keyword = NULL; +/*@null@*/ /*@dependent@*/ static const yasm_objfmt_module * + cur_objfmt_module = NULL; +/*@null@*/ /*@dependent@*/ static const yasm_dbgfmt_module * + cur_dbgfmt_module = NULL; +/*@null@*/ /*@dependent@*/ static const yasm_listfmt_module * + cur_listfmt_module = NULL; +static unsigned int force_strict = 0; +static int warning_error = 0; /* warnings being treated as errors */ +static FILE *errfile; +/*@null@*/ /*@only@*/ static char *error_filename = NULL; +static enum { + EWSTYLE_GNU = 0, + EWSTYLE_VC +} ewmsg_style = EWSTYLE_GNU; + +/*@null@*/ /*@dependent@*/ static FILE *open_file(const char *filename, + const char *mode); +static int check_errors(/*@only@*/ yasm_errwarns *errwarns, + /*@only@*/ yasm_object *object, + /*@only@*/ yasm_linemap *linemap, + /*@only@*/ yasm_preproc *preproc, + /*@only@*/ yasm_arch *arch); +static void cleanup(void); +static void free_input_filenames(void); + +/* Forward declarations: cmd line parser handlers */ +static int opt_special_handler(char *cmd, /*@null@*/ char *param, int extra); +static int opt_arch_handler(char *cmd, /*@null@*/ char *param, int extra); +static int opt_parser_handler(char *cmd, /*@null@*/ char *param, int extra); +static int opt_preproc_handler(char *cmd, /*@null@*/ char *param, int extra); +static int opt_objfmt_handler(char *cmd, /*@null@*/ char *param, int extra); +static int opt_dbgfmt_handler(char *cmd, /*@null@*/ char *param, int extra); +static int opt_listfmt_handler(char *cmd, /*@null@*/ char *param, int extra); +static int opt_listdir_handler(char *cmd, /*@null@*/ char *param, int extra); +static int opt_objdir_handler(char *cmd, /*@null@*/ char *param, int extra); +static int opt_mapdir_handler(char *cmd, /*@null@*/ char *param, int extra); +static int opt_machine_handler(char *cmd, /*@null@*/ char *param, int extra); +static int opt_strict_handler(char *cmd, /*@null@*/ char *param, int extra); +static int opt_warning_handler(char *cmd, /*@null@*/ char *param, int extra); +static int opt_error_file(char *cmd, /*@null@*/ char *param, int extra); +static int opt_error_stdout(char *cmd, /*@null@*/ char *param, int extra); +static int opt_include_option(char *cmd, /*@null@*/ char *param, int extra); +static int opt_preproc_option(char *cmd, /*@null@*/ char *param, int extra); +static int opt_ewmsg_handler(char *cmd, /*@null@*/ char *param, int extra); +static int opt_prefix_handler(char *cmd, /*@null@*/ char *param, int extra); +static int opt_suffix_handler(char *cmd, /*@null@*/ char *param, int extra); +#ifdef CMAKE_BUILD +static int opt_plugin_handler(char *cmd, /*@null@*/ char *param, int extra); +#endif + +static /*@only@*/ char *replace_extension(const char *orig, /*@null@*/ + const char *ext); +static void print_error(const char *fmt, ...); + +static /*@exits@*/ void handle_yasm_int_error(const char *file, + unsigned int line, + const char *message); +static /*@exits@*/ void handle_yasm_fatal(const char *message, va_list va); +static const char *handle_yasm_gettext(const char *msgid); +static void print_yasm_error(const char *filename, unsigned long line, + const char *msg, /*@null@*/ const char *xref_fn, + unsigned long xref_line, + /*@null@*/ const char *xref_msg); +static void print_yasm_warning(const char *filename, unsigned long line, + const char *msg); + +static void apply_preproc_builtins(yasm_preproc *preproc); +static void apply_preproc_standard_macros(yasm_preproc *preproc, + const yasm_stdmac *stdmacs); +static void apply_preproc_saved_options(yasm_preproc *preproc); +static void free_preproc_saved_options(void); +static void print_list_keyword_desc(const char *name, const char *keyword); + +/* values for special_options */ +#define SPECIAL_SHOW_HELP 0x01 +#define SPECIAL_SHOW_VERSION 0x02 +#define SPECIAL_SHOW_LICENSE 0x04 +#define SPECIAL_LISTED 0x08 + +/* command line options */ +static opt_option options[] = +{ + { 0, "version", 0, opt_special_handler, SPECIAL_SHOW_VERSION, + N_("show version text"), NULL }, + { 0, "license", 0, opt_special_handler, SPECIAL_SHOW_LICENSE, + N_("show license text"), NULL }, + { 'h', "help", 0, opt_special_handler, SPECIAL_SHOW_HELP, + N_("show help text"), NULL }, + { 'a', "arch", 1, opt_arch_handler, 0, + N_("select architecture (list with -a help)"), N_("arch") }, + { 'p', "parser", 1, opt_parser_handler, 0, + N_("select parser (list with -p help)"), N_("parser") }, + { 'r', "preproc", 1, opt_preproc_handler, 0, + N_("select preprocessor (list with -r help)"), N_("preproc") }, + { 'f', "oformat", 1, opt_objfmt_handler, 0, + N_("select object format (list with -f help)"), N_("format") }, + { 'g', "dformat", 1, opt_dbgfmt_handler, 0, + N_("select debugging format (list with -g help)"), N_("debug") }, + { 'L', "lformat", 1, opt_listfmt_handler, 0, + N_("select list format (list with -L help)"), N_("list") }, + { 'l', "list", 1, opt_listdir_handler, 0, + N_("name of list-file output directory"), N_("pathname") }, + { 'o', "objdir", 1, opt_objdir_handler, 0, + N_("name of object-file output directory"), N_("pathname") }, + { 0, "mapdir", 1, opt_mapdir_handler, 0, + N_("name of map-file output directory"), N_("pathname") }, + { 'm', "machine", 1, opt_machine_handler, 0, + N_("select machine (list with -m help)"), N_("machine") }, + { 0, "force-strict", 0, opt_strict_handler, 0, + N_("treat all sized operands as if `strict' was used"), NULL }, + { 'w', NULL, 0, opt_warning_handler, 1, + N_("inhibits warning messages"), NULL }, + { 'W', NULL, 0, opt_warning_handler, 0, + N_("enables/disables warning"), NULL }, + { 'E', NULL, 1, opt_error_file, 0, + N_("redirect error messages to file"), N_("file") }, + { 's', NULL, 0, opt_error_stdout, 0, + N_("redirect error messages to stdout"), NULL }, + { 'i', NULL, 1, opt_include_option, 0, + N_("add include path"), N_("path") }, + { 'I', NULL, 1, opt_include_option, 0, + N_("add include path"), N_("path") }, + { 'P', NULL, 1, opt_preproc_option, 0, + N_("pre-include file"), N_("filename") }, + { 'd', NULL, 1, opt_preproc_option, 1, + N_("pre-define a macro, optionally to value"), N_("macro[=value]") }, + { 'D', NULL, 1, opt_preproc_option, 1, + N_("pre-define a macro, optionally to value"), N_("macro[=value]") }, + { 'u', NULL, 1, opt_preproc_option, 2, + N_("undefine a macro"), N_("macro") }, + { 'U', NULL, 1, opt_preproc_option, 2, + N_("undefine a macro"), N_("macro") }, + { 'X', NULL, 1, opt_ewmsg_handler, 0, + N_("select error/warning message style (`gnu' or `vc')"), N_("style") }, + { 0, "prefix", 1, opt_prefix_handler, 0, + N_("prepend argument to name of all external symbols"), N_("prefix") }, + { 0, "suffix", 1, opt_suffix_handler, 0, + N_("append argument to name of all external symbols"), N_("suffix") }, + { 0, "postfix", 1, opt_suffix_handler, 0, + N_("append argument to name of all external symbols"), N_("suffix") }, +#ifdef CMAKE_BUILD + { 'N', "plugin", 1, opt_plugin_handler, 0, + N_("load plugin module"), N_("plugin") }, +#endif +}; + +/* version message */ +/*@observer@*/ static const char *version_msg[] = { + PACKAGE_NAME " " PACKAGE_INTVER "." PACKAGE_BUILD, + "Compiled on " __DATE__ ".", + "Copyright (c) 2001-2010 Peter Johnson and other Yasm developers.", + "Run yasm --license for licensing overview and summary." +}; + +/* help messages */ +/*@observer@*/ static const char *help_head = N_( + "usage: vsyasm [option]* file...\n" + "Options:\n"); +/*@observer@*/ static const char *help_tail = N_( + "\n" + "Files are asm sources to be assembled.\n" + "\n" + "Sample invocation:\n" + " vsyasm -f win64 -o objdir source1.asm source2.asm\n" + "\n" + "All options apply to all files.\n" + "\n" + "Report bugs to bug-yasm@tortall.net\n"); + +/* parsed command line storage until appropriate modules have been loaded */ +typedef STAILQ_HEAD(constcharparam_head, constcharparam) constcharparam_head; + +typedef struct constcharparam { + STAILQ_ENTRY(constcharparam) link; + const char *param; + int id; +} constcharparam; + +static constcharparam_head preproc_options; +static constcharparam_head input_files; + +static int +do_assemble(const char *in_filename) +{ + yasm_object *object; + const char *base_filename; + char *fn = NULL; + char *obj_filename, *list_filename = NULL, *map_filename = NULL; + /*@null@*/ FILE *obj = NULL; + yasm_arch_create_error arch_error; + yasm_linemap *linemap; + yasm_arch *arch = NULL; + yasm_preproc *preproc = NULL; + yasm_errwarns *errwarns = yasm_errwarns_create(); + int i, matched; + + /* Initialize line map */ + linemap = yasm_linemap_create(); + yasm_linemap_set(linemap, in_filename, 0, 1, 1); + + /* determine the output filenames */ + /* replace (or add) extension to base filename */ + yasm__splitpath(in_filename, &base_filename); + if (base_filename[0] != '\0') + fn = replace_extension(base_filename, cur_objfmt_module->extension); + if (!fn) + { + print_error(_("could not determine output filename for `%s'"), + in_filename); + return EXIT_FAILURE; + } + obj_filename = yasm__combpath(objdir_pathname, fn); + yasm_xfree(fn); + + if (listdir_pathname) { + fn = replace_extension(base_filename, "lst"); + if (!fn) + { + print_error(_("could not determine list filename for `%s'"), + in_filename); + return EXIT_FAILURE; + } + list_filename = yasm__combpath(listdir_pathname, fn); + yasm_xfree(fn); + } + + if (mapdir_pathname) { + fn = replace_extension(base_filename, "lst"); + if (!fn) + { + print_error(_("could not determine map filename for `%s'"), + in_filename); + return EXIT_FAILURE; + } + map_filename = yasm__combpath(mapdir_pathname, fn); + yasm_xfree(fn); + } + + /* Set up architecture using machine and parser. */ + if (!machine_name) { + /* If we're using x86 and the default objfmt bits is 64, default the + * machine to amd64. When we get more arches with multiple machines, + * we should do this in a more modular fashion. + */ + if (strcmp(cur_arch_module->keyword, "x86") == 0 && + cur_objfmt_module->default_x86_mode_bits == 64) + machine_name = yasm__xstrdup("amd64"); + else + machine_name = + yasm__xstrdup(cur_arch_module->default_machine_keyword); + } + + arch = yasm_arch_create(cur_arch_module, machine_name, + cur_parser_module->keyword, &arch_error); + if (!arch) { + switch (arch_error) { + case YASM_ARCH_CREATE_BAD_MACHINE: + print_error(_("%s: `%s' is not a valid %s for %s `%s'"), + _("FATAL"), machine_name, _("machine"), + _("architecture"), cur_arch_module->keyword); + break; + case YASM_ARCH_CREATE_BAD_PARSER: + print_error(_("%s: `%s' is not a valid %s for %s `%s'"), + _("FATAL"), cur_parser_module->keyword, + _("parser"), _("architecture"), + cur_arch_module->keyword); + break; + default: + print_error(_("%s: unknown architecture error"), _("FATAL")); + } + + return EXIT_FAILURE; + } + + /* Create object */ + object = yasm_object_create(in_filename, obj_filename, arch, + cur_objfmt_module, cur_dbgfmt_module); + if (!object) { + yasm_error_class eclass; + unsigned long xrefline; + /*@only@*/ /*@null@*/ char *estr, *xrefstr; + + yasm_error_fetch(&eclass, &estr, &xrefline, &xrefstr); + print_error("%s: %s", _("FATAL"), estr); + yasm_xfree(estr); + yasm_xfree(xrefstr); + return EXIT_FAILURE; + } + + /* Get a fresh copy of objfmt_module as it may have changed. */ + cur_objfmt_module = ((yasm_objfmt_base *)object->objfmt)->module; + + /* Check to see if the requested preprocessor is in the allowed list + * for the active parser. + */ + matched = 0; + for (i=0; cur_parser_module->preproc_keywords[i]; i++) + if (yasm__strcasecmp(cur_parser_module->preproc_keywords[i], + cur_preproc_module->keyword) == 0) + matched = 1; + if (!matched) { + print_error(_("%s: `%s' is not a valid %s for %s `%s'"), _("FATAL"), + cur_preproc_module->keyword, _("preprocessor"), + _("parser"), cur_parser_module->keyword); + yasm_object_destroy(object); + return EXIT_FAILURE; + } + + if (global_prefix) + yasm_object_set_global_prefix(object, global_prefix); + if (global_suffix) + yasm_object_set_global_suffix(object, global_suffix); + + preproc = yasm_preproc_create(cur_preproc_module, in_filename, + object->symtab, linemap, errwarns); + + apply_preproc_builtins(preproc); + apply_preproc_standard_macros(preproc, cur_parser_module->stdmacs); + apply_preproc_standard_macros(preproc, cur_objfmt_module->stdmacs); + apply_preproc_saved_options(preproc); + + /* Get initial x86 BITS setting from object format */ + if (strcmp(cur_arch_module->keyword, "x86") == 0) { + yasm_arch_set_var(arch, "mode_bits", + cur_objfmt_module->default_x86_mode_bits); + } + + yasm_arch_set_var(arch, "force_strict", force_strict); + + /* Try to enable the map file via a map NASM directive. This is + * somewhat of a hack. + */ + if (map_filename) { + const yasm_directive *dir = &cur_objfmt_module->directives[0]; + matched = 0; + for (; dir && dir->name; dir++) { + if (yasm__strcasecmp(dir->name, "map") == 0 && + yasm__strcasecmp(dir->parser, "nasm") == 0) { + yasm_valparamhead vps; + yasm_valparam *vp; + matched = 1; + yasm_vps_initialize(&vps); + vp = yasm_vp_create_string(NULL, yasm__xstrdup(map_filename)); + yasm_vps_append(&vps, vp); + dir->handler(object, &vps, NULL, 0); + yasm_vps_delete(&vps); + } + } + if (!matched) { + print_error( + _("warning: object format `%s' does not support map files"), + cur_objfmt_module->keyword); + } + } + + /* Parse! */ + cur_parser_module->do_parse(object, preproc, list_filename != NULL, + linemap, errwarns); + + if (check_errors(errwarns, object, linemap, preproc, arch) == EXIT_FAILURE) + return EXIT_FAILURE; + + /* Finalize parse */ + yasm_object_finalize(object, errwarns); + if (check_errors(errwarns, object, linemap, preproc, arch) == EXIT_FAILURE) + return EXIT_FAILURE; + + /* Optimize */ + yasm_object_optimize(object, errwarns); + if (check_errors(errwarns, object, linemap, preproc, arch) == EXIT_FAILURE) + return EXIT_FAILURE; + + /* generate any debugging information */ + yasm_dbgfmt_generate(object, linemap, errwarns); + if (check_errors(errwarns, object, linemap, preproc, arch) == EXIT_FAILURE) + return EXIT_FAILURE; + + /* open the object file for output (if not already opened by dbg objfmt) */ + if (!obj && strcmp(cur_objfmt_module->keyword, "dbg") != 0) { + obj = open_file(obj_filename, "wb"); + if (!obj) { + yasm_preproc_destroy(preproc); + yasm_object_destroy(object); + yasm_linemap_destroy(linemap); + yasm_errwarns_destroy(errwarns); + return EXIT_FAILURE; + } + } + + /* Write the object file */ + yasm_objfmt_output(object, obj?obj:stderr, + strcmp(cur_dbgfmt_module->keyword, "null"), errwarns); + + /* Close object file */ + if (obj) + fclose(obj); + + /* If we had an error at this point, we also need to delete the output + * object file (to make sure it's not left newer than the source). + */ + if (yasm_errwarns_num_errors(errwarns, warning_error) > 0) + remove(obj_filename); + if (check_errors(errwarns, object, linemap, preproc, arch) == EXIT_FAILURE) + return EXIT_FAILURE; + + /* Open and write the list file */ + if (list_filename) { + yasm_listfmt *cur_listfmt; + FILE *list = open_file(list_filename, "wt"); + if (!list) { + yasm_preproc_destroy(preproc); + yasm_object_destroy(object); + yasm_linemap_destroy(linemap); + yasm_errwarns_destroy(errwarns); + return EXIT_FAILURE; + } + /* Initialize the list format */ + cur_listfmt = yasm_listfmt_create(cur_listfmt_module, in_filename, + obj_filename); + yasm_listfmt_output(cur_listfmt, list, linemap, arch); + yasm_listfmt_destroy(cur_listfmt); + fclose(list); + } + + yasm_errwarns_output_all(errwarns, linemap, warning_error, + print_yasm_error, print_yasm_warning); + + yasm_preproc_destroy(preproc); + yasm_object_destroy(object); + yasm_linemap_destroy(linemap); + yasm_errwarns_destroy(errwarns); + + yasm_xfree(obj_filename); + yasm_xfree(map_filename); + yasm_xfree(list_filename); + return EXIT_SUCCESS; +} + +/* main function */ +/*@-globstate -unrecog@*/ +int +main(int argc, char *argv[]) +{ + size_t i; + constcharparam *infile; + + errfile = stderr; + +#if defined(HAVE_SETLOCALE) && defined(HAVE_LC_MESSAGES) + setlocale(LC_MESSAGES, ""); +#endif +#if defined(LOCALEDIR) + bindtextdomain(PACKAGE, LOCALEDIR); +#endif + textdomain(PACKAGE); + + /* Initialize errwarn handling */ + yasm_internal_error_ = handle_yasm_int_error; + yasm_fatal = handle_yasm_fatal; + yasm_gettext_hook = handle_yasm_gettext; + yasm_errwarn_initialize(); + + /* Initialize BitVector (needed for intnum/floatnum). */ + if (BitVector_Boot() != ErrCode_Ok) { + print_error(_("%s: could not initialize BitVector"), _("FATAL")); + return EXIT_FAILURE; + } + + /* Initialize intnum and floatnum */ + yasm_intnum_initialize(); + yasm_floatnum_initialize(); + +#ifdef CMAKE_BUILD + /* Load standard modules */ + if (!load_plugin("yasmstd")) { + print_error(_("%s: could not load standard modules"), _("FATAL")); + return EXIT_FAILURE; + } +#endif + + /* Initialize parameter storage */ + STAILQ_INIT(&preproc_options); + STAILQ_INIT(&input_files); + + if (parse_cmdline(argc, argv, options, NELEMS(options), print_error)) + return EXIT_FAILURE; + + switch (special_options) { + case SPECIAL_SHOW_HELP: + /* Does gettext calls internally */ + help_msg(help_head, help_tail, options, NELEMS(options)); + return EXIT_SUCCESS; + case SPECIAL_SHOW_VERSION: + for (i=0; imachines; + printf(_("Available %s for %s `%s':\n"), _("machines"), + _("architecture"), cur_arch_module->keyword); + while (m->keyword && m->name) { + print_list_keyword_desc(m->name, m->keyword); + m++; + } + return EXIT_SUCCESS; + } + + /* Default to NASM as the parser */ + if (!cur_parser_module) { + cur_parser_module = yasm_load_parser("nasm"); + if (!cur_parser_module) { + print_error(_("%s: could not load default %s"), _("FATAL"), + _("parser")); + cleanup(); + return EXIT_FAILURE; + } + } + + /* If not already specified, default to the parser's default preproc. */ + if (!cur_preproc_module) { + cur_preproc_module = + yasm_load_preproc(cur_parser_module->default_preproc_keyword); + if (!cur_preproc_module) { + print_error(_("%s: could not load default %s"), _("FATAL"), + _("preprocessor")); + cleanup(); + return EXIT_FAILURE; + } + } + + /* Determine input filenames. */ + if (STAILQ_EMPTY(&input_files)) { + print_error(_("No input files specified")); + return EXIT_FAILURE; + } + + /* If list file enabled, make sure we have a list format loaded. */ + if (listdir_pathname) { + /* If not already specified, default to nasm as the list format. */ + if (!cur_listfmt_module) { + cur_listfmt_module = yasm_load_listfmt("nasm"); + if (!cur_listfmt_module) { + print_error(_("%s: could not load default %s"), _("FATAL"), + _("list format")); + return EXIT_FAILURE; + } + } + } + + /* If not already specified, default to null as the debug format. */ + if (!cur_dbgfmt_module) { + cur_dbgfmt_module = yasm_load_dbgfmt("null"); + if (!cur_dbgfmt_module) { + print_error(_("%s: could not load default %s"), _("FATAL"), + _("debug format")); + return EXIT_FAILURE; + } + } + + /* If not already specified, output to the current directory. */ + if (!objdir_pathname) + objdir_pathname = yasm__xstrdup("./"); + + /* Assemble each input file. Terminate on first error. */ + STAILQ_FOREACH(infile, &input_files, link) + { + if (do_assemble(infile->param) == EXIT_FAILURE) { + cleanup(); + return EXIT_FAILURE; + } + } + cleanup(); + return EXIT_SUCCESS; +} +/*@=globstate =unrecog@*/ + +/* Open the object file. Returns 0 on failure. */ +static FILE * +open_file(const char *filename, const char *mode) +{ + FILE *f; + + f = fopen(filename, mode); + if (!f) + print_error(_("could not open file `%s'"), filename); + return f; +} + +static int +check_errors(yasm_errwarns *errwarns, yasm_object *object, + yasm_linemap *linemap, yasm_preproc *preproc, yasm_arch *arch) +{ + if (yasm_errwarns_num_errors(errwarns, warning_error) > 0) { + yasm_errwarns_output_all(errwarns, linemap, warning_error, + print_yasm_error, print_yasm_warning); + yasm_preproc_destroy(preproc); + yasm_object_destroy(object); + yasm_linemap_destroy(linemap); + yasm_errwarns_destroy(errwarns); + return EXIT_FAILURE; + } + return EXIT_SUCCESS; +} + +/* Define DO_FREE to 1 to enable deallocation of all data structures. + * Useful for detecting memory leaks, but slows down execution unnecessarily + * (as the OS will free everything we miss here). + */ +#define DO_FREE 1 + +/* Cleans up all allocated structures. */ +static void +cleanup(void) +{ + if (DO_FREE) { + yasm_floatnum_cleanup(); + yasm_intnum_cleanup(); + + yasm_errwarn_cleanup(); + + BitVector_Shutdown(); + } + + if (DO_FREE) { + free_input_filenames(); + if (objdir_pathname) + yasm_xfree(objdir_pathname); + if (listdir_pathname) + yasm_xfree(listdir_pathname); + if (mapdir_pathname) + yasm_xfree(mapdir_pathname); + if (machine_name) + yasm_xfree(machine_name); + if (objfmt_keyword) + yasm_xfree(objfmt_keyword); + free_preproc_saved_options(); + } + + if (errfile != stderr && errfile != stdout) + fclose(errfile); +#ifdef CMAKE_BUILD + unload_plugins(); +#endif +} + +static void +free_input_filenames(void) +{ + constcharparam *cp, *cpnext; + cp = STAILQ_FIRST(&input_files); + while (cp != NULL) { + cpnext = STAILQ_NEXT(cp, link); + yasm_xfree(cp); + cp = cpnext; + } + STAILQ_INIT(&input_files); +} + +/* + * Command line options handlers + */ +int +not_an_option_handler(char *param) +{ + constcharparam *cp; + cp = yasm_xmalloc(sizeof(constcharparam)); + cp->param = param; + cp->id = 0; + STAILQ_INSERT_TAIL(&input_files, cp, link); + return 0; +} + +int +other_option_handler(char *option) +{ + /* Accept, but ignore, -O and -Onnn, for compatibility with NASM. */ + if (option[0] == '-' && option[1] == 'O') { + int n = 2; + for (;;) { + if (option[n] == '\0') + return 0; + if (!isdigit(option[n])) + return 1; + n++; + } + } + return 1; +} + +static int +opt_special_handler(/*@unused@*/ char *cmd, /*@unused@*/ char *param, int extra) +{ + if (special_options == 0) + special_options = extra; + return 0; +} + +static int +opt_arch_handler(/*@unused@*/ char *cmd, char *param, /*@unused@*/ int extra) +{ + assert(param != NULL); + cur_arch_module = yasm_load_arch(param); + if (!cur_arch_module) { + if (!strcmp("help", param)) { + printf(_("Available yasm %s:\n"), _("architectures")); + yasm_list_arch(print_list_keyword_desc); + special_options = SPECIAL_LISTED; + return 0; + } + print_error(_("%s: unrecognized %s `%s'"), _("FATAL"), + _("architecture"), param); + exit(EXIT_FAILURE); + } + return 0; +} + +static int +opt_parser_handler(/*@unused@*/ char *cmd, char *param, /*@unused@*/ int extra) +{ + assert(param != NULL); + cur_parser_module = yasm_load_parser(param); + if (!cur_parser_module) { + if (!strcmp("help", param)) { + printf(_("Available yasm %s:\n"), _("parsers")); + yasm_list_parser(print_list_keyword_desc); + special_options = SPECIAL_LISTED; + return 0; + } + print_error(_("%s: unrecognized %s `%s'"), _("FATAL"), _("parser"), + param); + exit(EXIT_FAILURE); + } + return 0; +} + +static int +opt_preproc_handler(/*@unused@*/ char *cmd, char *param, /*@unused@*/ int extra) +{ + assert(param != NULL); + cur_preproc_module = yasm_load_preproc(param); + if (!cur_preproc_module) { + if (!strcmp("help", param)) { + printf(_("Available yasm %s:\n"), _("preprocessors")); + yasm_list_preproc(print_list_keyword_desc); + special_options = SPECIAL_LISTED; + return 0; + } + print_error(_("%s: unrecognized %s `%s'"), _("FATAL"), + _("preprocessor"), param); + exit(EXIT_FAILURE); + } + return 0; +} + +static int +opt_objfmt_handler(/*@unused@*/ char *cmd, char *param, /*@unused@*/ int extra) +{ + size_t i; + assert(param != NULL); + cur_objfmt_module = yasm_load_objfmt(param); + if (!cur_objfmt_module) { + if (!strcmp("help", param)) { + printf(_("Available yasm %s:\n"), _("object formats")); + yasm_list_objfmt(print_list_keyword_desc); + special_options = SPECIAL_LISTED; + return 0; + } + print_error(_("%s: unrecognized %s `%s'"), _("FATAL"), + _("object format"), param); + exit(EXIT_FAILURE); + } + if (objfmt_keyword) + yasm_xfree(objfmt_keyword); + objfmt_keyword = yasm__xstrdup(param); + for (i=0; iparam = param; + cp->id = extra; + STAILQ_INSERT_TAIL(&preproc_options, cp, link); + return 0; +} + +static int +opt_ewmsg_handler(/*@unused@*/ char *cmd, char *param, /*@unused@*/ int extra) +{ + if (yasm__strcasecmp(param, "gnu") == 0 || + yasm__strcasecmp(param, "gcc") == 0) { + ewmsg_style = EWSTYLE_GNU; + } else if (yasm__strcasecmp(param, "vc") == 0) { + ewmsg_style = EWSTYLE_VC; + } else + print_error(_("warning: unrecognized message style `%s'"), param); + + return 0; +} + +static int +opt_prefix_handler(/*@unused@*/ char *cmd, char *param, /*@unused@*/ int extra) +{ + if (global_prefix) + yasm_xfree(global_prefix); + + assert(param != NULL); + global_prefix = yasm__xstrdup(param); + + return 0; +} + +static int +opt_suffix_handler(/*@unused@*/ char *cmd, char *param, /*@unused@*/ int extra) +{ + if (global_suffix) + yasm_xfree(global_suffix); + + assert(param != NULL); + global_suffix = yasm__xstrdup(param); + + return 0; +} + +#ifdef CMAKE_BUILD +static int +opt_plugin_handler(/*@unused@*/ char *cmd, char *param, + /*@unused@*/ int extra) +{ + if (!load_plugin(param)) + print_error(_("warning: could not load plugin `%s'"), param); + return 0; +} +#endif + +static void +apply_preproc_builtins(yasm_preproc *preproc) +{ + char *predef; + + /* Define standard YASM assembly-time macro constants */ + predef = yasm_xmalloc(strlen("__YASM_OBJFMT__=") + + strlen(objfmt_keyword) + 1); + strcpy(predef, "__YASM_OBJFMT__="); + strcat(predef, objfmt_keyword); + yasm_preproc_define_builtin(preproc, predef); + yasm_xfree(predef); +} + +static void +apply_preproc_standard_macros(yasm_preproc *preproc, const yasm_stdmac *stdmacs) +{ + int i, matched; + + if (!stdmacs) + return; + + matched = -1; + for (i=0; stdmacs[i].parser; i++) + if (yasm__strcasecmp(stdmacs[i].parser, + cur_parser_module->keyword) == 0 && + yasm__strcasecmp(stdmacs[i].preproc, + cur_preproc_module->keyword) == 0) + matched = i; + if (matched >= 0 && stdmacs[matched].macros) + yasm_preproc_add_standard(preproc, stdmacs[matched].macros); +} + +static void +apply_preproc_saved_options(yasm_preproc *preproc) +{ + constcharparam *cp; + + void (*funcs[3])(yasm_preproc *, const char *); + funcs[0] = cur_preproc_module->add_include_file; + funcs[1] = cur_preproc_module->predefine_macro; + funcs[2] = cur_preproc_module->undefine_macro; + + STAILQ_FOREACH(cp, &preproc_options, link) { + if (0 <= cp->id && cp->id < 3 && funcs[cp->id]) + funcs[cp->id](preproc, cp->param); + } +} + +static void +free_preproc_saved_options(void) +{ + constcharparam *cp, *cpnext; + cp = STAILQ_FIRST(&preproc_options); + while (cp != NULL) { + cpnext = STAILQ_NEXT(cp, link); + yasm_xfree(cp); + cp = cpnext; + } + STAILQ_INIT(&preproc_options); +} + +/* Replace extension on a filename (or append one if none is present). + * If output filename would be identical to input (same extension out as in), + * returns NULL. + * A NULL ext means the trailing '.' should NOT be included, whereas a "" ext + * means the trailing '.' should be included. + */ +static char * +replace_extension(const char *orig, /*@null@*/ const char *ext) +{ + char *out, *outext; + size_t outlen; + + /* allocate enough space for full existing name + extension */ + outlen = strlen(orig) + 2; + if (ext) + outlen += strlen(ext) + 1; + out = yasm_xmalloc(outlen); + + strcpy(out, orig); + outext = strrchr(out, '.'); + if (outext) { + /* Existing extension: make sure it's not the same as the replacement + * (as we don't want to overwrite the source file). + */ + outext++; /* advance past '.' */ + if (ext && strcmp(outext, ext) == 0) { + outext = NULL; /* indicate default should be used */ + print_error(_("file name already ends in `.%s'"), ext); + } + } else { + /* No extension: make sure the output extension is not empty + * (again, we don't want to overwrite the source file). + */ + if (!ext) { + outext = NULL; + print_error(_("file name already has no extension")); + } else { + outext = strrchr(out, '\0'); /* point to end of the string */ + *outext++ = '.'; /* append '.' */ + } + } + + /* replace extension or use default name */ + if (outext) { + if (!ext) { + /* Back up and replace '.' with string terminator */ + outext--; + *outext = '\0'; + } else + strcpy(outext, ext); + } else + return NULL; + + return out; +} + +void +print_list_keyword_desc(const char *name, const char *keyword) +{ + printf("%4s%-12s%s\n", "", keyword, name); +} + +static void +print_error(const char *fmt, ...) +{ + va_list va; + fprintf(errfile, "vsyasm: "); + va_start(va, fmt); + vfprintf(errfile, fmt, va); + va_end(va); + fputc('\n', errfile); +} + +static /*@exits@*/ void +handle_yasm_int_error(const char *file, unsigned int line, const char *message) +{ + fprintf(stderr, _("INTERNAL ERROR at %s, line %u: %s\n"), file, line, + gettext(message)); +#ifdef HAVE_ABORT + abort(); +#else + exit(EXIT_FAILURE); +#endif +} + +static /*@exits@*/ void +handle_yasm_fatal(const char *fmt, va_list va) +{ + fprintf(errfile, "vsyasm: %s: ", _("FATAL")); + vfprintf(errfile, gettext(fmt), va); + fputc('\n', errfile); + exit(EXIT_FAILURE); +} + +static const char * +handle_yasm_gettext(const char *msgid) +{ + return gettext(msgid); +} + +static const char *fmt[2] = { + "%s:%lu: %s%s\n", /* GNU */ + "%s(%lu) : %s%s\n" /* VC */ +}; + +static const char *fmt_noline[2] = { + "%s: %s%s\n", /* GNU */ + "%s : %s%s\n" /* VC */ +}; + +static void +print_yasm_error(const char *filename, unsigned long line, const char *msg, + const char *xref_fn, unsigned long xref_line, + const char *xref_msg) +{ + if (line) + fprintf(errfile, fmt[ewmsg_style], filename, line, _("error: "), msg); + else + fprintf(errfile, fmt_noline[ewmsg_style], filename, _("error: "), msg); + + if (xref_fn && xref_msg) { + if (xref_line) + fprintf(errfile, fmt[ewmsg_style], xref_fn, xref_line, _("error: "), + xref_msg); + else + fprintf(errfile, fmt_noline[ewmsg_style], xref_fn, _("error: "), + xref_msg); + } +} + +static void +print_yasm_warning(const char *filename, unsigned long line, const char *msg) +{ + if (line) + fprintf(errfile, fmt[ewmsg_style], filename, line, _("warning: "), + msg); + else + fprintf(errfile, fmt_noline[ewmsg_style], filename, _("warning: "), + msg); +} From 74e776b0f62cc953f88a6bf94dbf63f62af8c419 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 13 Feb 2010 07:22:23 +0000 Subject: [PATCH 340/585] Add support for gas preprocessor macro directives. It doesn't yet support the full set of macro types gas supports, but can handle a lot of common cases. Contributed by: Alexei Svitkine svn path=/trunk/yasm/; revision=2285 --- modules/parsers/gas/tests/bin/Makefile.inc | 2 + modules/parsers/gas/tests/bin/gas-macro.asm | 25 +++ modules/parsers/gas/tests/bin/gas-macro.hex | 6 + modules/preprocs/gas/gas-preproc.c | 208 ++++++++++++++++++++ 4 files changed, 241 insertions(+) create mode 100644 modules/parsers/gas/tests/bin/gas-macro.asm create mode 100644 modules/parsers/gas/tests/bin/gas-macro.hex diff --git a/modules/parsers/gas/tests/bin/Makefile.inc b/modules/parsers/gas/tests/bin/Makefile.inc index c318defa..39f12f01 100644 --- a/modules/parsers/gas/tests/bin/Makefile.inc +++ b/modules/parsers/gas/tests/bin/Makefile.inc @@ -10,6 +10,8 @@ EXTRA_DIST += modules/parsers/gas/tests/bin/gas-intel_syntax-noprefix.asm EXTRA_DIST += modules/parsers/gas/tests/bin/gas-intel_syntax-noprefix.hex EXTRA_DIST += modules/parsers/gas/tests/bin/gas-llabel.asm EXTRA_DIST += modules/parsers/gas/tests/bin/gas-llabel.hex +EXTRA_DIST += modules/parsers/gas/tests/bin/gas-macro.asm +EXTRA_DIST += modules/parsers/gas/tests/bin/gas-macro.hex EXTRA_DIST += modules/parsers/gas/tests/bin/gas-set.asm EXTRA_DIST += modules/parsers/gas/tests/bin/gas-set.hex EXTRA_DIST += modules/parsers/gas/tests/bin/rept-err.asm diff --git a/modules/parsers/gas/tests/bin/gas-macro.asm b/modules/parsers/gas/tests/bin/gas-macro.asm new file mode 100644 index 00000000..29b475cc --- /dev/null +++ b/modules/parsers/gas/tests/bin/gas-macro.asm @@ -0,0 +1,25 @@ +.macro foo arg1, arg2 +.byte \arg1 +.byte \arg2 +.endm + +.macro bar x y +.byte \x-\y +.endm + +.macro def a=5 b +.byte \a + \b +.endm + +.macro nest x=9 +.macro zap y +.byte \y +.endm +zap \x +.endm + +foo 5 6 +bar 3, 2 +def ,3 +def 3 2 +nest diff --git a/modules/parsers/gas/tests/bin/gas-macro.hex b/modules/parsers/gas/tests/bin/gas-macro.hex new file mode 100644 index 00000000..0904d1cd --- /dev/null +++ b/modules/parsers/gas/tests/bin/gas-macro.hex @@ -0,0 +1,6 @@ +05 +06 +01 +08 +05 +09 diff --git a/modules/preprocs/gas/gas-preproc.c b/modules/preprocs/gas/gas-preproc.c index 2fa7af9b..bbdd4992 100644 --- a/modules/preprocs/gas/gas-preproc.c +++ b/modules/preprocs/gas/gas-preproc.c @@ -51,6 +51,15 @@ typedef struct included_file { SLIST_ENTRY(included_file) next; } included_file; +typedef struct macro_entry { + char *name; + int num_params; + char **params; + int num_lines; + char **lines; + STAILQ_ENTRY(macro_entry) next; +} macro_entry; + typedef struct yasm_preproc_gas { yasm_preproc_base preproc; /* base structure */ @@ -70,6 +79,7 @@ typedef struct yasm_preproc_gas { SLIST_HEAD(buffered_lines_head, buffered_line) buffered_lines; SLIST_HEAD(included_files_head, included_file) included_files; + STAILQ_HEAD(macros_head, macro_entry) macros; int in_line_number; int next_line_number; @@ -636,6 +646,177 @@ static int eval_set(yasm_preproc_gas *pp, int allow_redefine, const char *name, return 1; } +static int eval_macro(yasm_preproc_gas *pp, int unused, char *args) +{ + char *end; + char *line; + long nesting = 1; + macro_entry *macro = yasm_xmalloc(sizeof(macro_entry)); + + memset(macro, 0, sizeof(macro_entry)); + + end = args; + while (*end && !isspace(*end)) { + end++; + } + macro->name = yasm_xmalloc(end - args + 1); + memcpy(macro->name, args, end - args); + macro->name[end - args] = '\0'; + + skip_whitespace2(&end); + while (*end) { + args = end; + while (*end && !isspace(*end) && *end != ',') { + end++; + } + macro->num_params++; + macro->params = yasm_xrealloc(macro->params, macro->num_params*sizeof(char *)); + macro->params[macro->num_params - 1] = yasm_xmalloc(end - args + 1); + memcpy(macro->params[macro->num_params - 1], args, end - args); + macro->params[macro->num_params - 1][end - args] = '\0'; + skip_whitespace2(&end); + if (*end == ',') { + end++; + skip_whitespace2(&end); + } + } + + STAILQ_INSERT_TAIL(&pp->macros, macro, next); + + line = read_line(pp); + while (line) { + char *line2 = line; + skip_whitespace2(&line2); + if (starts_with(line2, ".macro")) { + nesting++; + } else if (starts_with(line, ".endm") && --nesting == 0) { + return 1; + } + macro->num_lines++; + macro->lines = yasm_xrealloc(macro->lines, macro->num_lines*sizeof(char *)); + macro->lines[macro->num_lines - 1] = line; + line = read_line(pp); + } + + yasm_error_set(YASM_ERROR_SYNTAX, N_("unexpected EOF in \".macro\" block")); + yasm_errwarn_propagate(pp->errwarns, yasm_linemap_get_current(pp->cur_lm)); + return 0; +} + +static int eval_endm(yasm_preproc_gas *pp, int unused) +{ + yasm_error_set(YASM_ERROR_SYNTAX, N_("\".endm\" without \".macro\"")); + yasm_errwarn_propagate(pp->errwarns, yasm_linemap_get_current(pp->cur_lm)); + return 0; +} + +static void get_param_value(macro_entry *macro, int param_index, const char *args, const char **value, int *length) +{ + int arg_index = 0; + const char *default_value = NULL; + const char *end, *eq = strstr(macro->params[param_index], "="); + + if (eq) { + default_value = eq + 1; + } + + skip_whitespace(&args); + end = args; + while (*end) { + args = end; + while (*end && !isspace(*end) && *end != ',') { + end++; + } + if (arg_index == param_index) { + if (end == args && default_value) { + *value = default_value; + *length = strlen(default_value); + } else { + *value = args; + *length = end - args; + } + return; + } + arg_index++; + skip_whitespace(&end); + if (*end == ',') { + end++; + skip_whitespace(&end); + } + } + + *value = default_value; + *length = (default_value ? strlen(default_value) : 0); +} + +static void expand_macro(yasm_preproc_gas *pp, macro_entry *macro, const char *args) +{ + int i, j, k; + buffered_line *prev_bline = NULL; + + for (i = 0; i < macro->num_lines; i++) { + buffered_line *bline = yasm_xmalloc(sizeof(buffered_line)); + struct tokenval tokval; + int prev_was_backslash = FALSE; + int line_length = strlen(macro->lines[i]); + char *work = yasm__xstrdup(macro->lines[i]); + + pp->expr_symbol = NULL; + pp->expr_string = work; + pp->expr_string_cursor = 0; + while (gas_scan(pp, &tokval) != TOKEN_EOS) { + if (prev_was_backslash) { + if (tokval.t_type == TOKEN_ID) { + for (j = 0; j < macro->num_params; j++) { + char *end = strstr(macro->params[j], "="); + int len = (end ? (size_t)(end - macro->params[j]) + : strlen(macro->params[j])); + if (!strncmp(tokval.t_charptr, macro->params[j], len) + && tokval.t_charptr[len] == '\0') { + /* now, find matching argument. */ + const char *value; + char *line = work + (pp->expr_string - work); + int cursor = pp->expr_string_cursor; + int value_length, delta; + + get_param_value(macro, j, args, &value, &value_length); + + len++; /* leading slash */ + delta = value_length - len; + line_length += delta; + if (delta > 0) { + line = yasm_xrealloc(line, line_length + 1); + for (k = strlen(line); k >= cursor; k--) { + line[k + delta] = line[k]; + } + memcpy(line + cursor - len, value, value_length); + } else { + memcpy(line + cursor - len, value, value_length); + strcpy(line + cursor - len + value_length, line + cursor); + } + pp->expr_string = work = line; + pp->expr_string_cursor += delta; + } + } + } + prev_was_backslash = FALSE; + } else if (tokval.t_type == '\\') { + prev_was_backslash = TRUE; + } + } + + bline->line = work + (pp->expr_string - work); + pp->expr_string = NULL; + + if (prev_bline) { + SLIST_INSERT_AFTER(prev_bline, bline, next); + } else { + SLIST_INSERT_HEAD(&pp->buffered_lines, bline, next); + } + prev_bline = bline; + } +} + static int eval_rept(yasm_preproc_gas *pp, int unused, const char *arg1) { long i, n = eval_expr(pp, arg1); @@ -794,6 +975,7 @@ static void substitute_values(yasm_preproc_gas *pp, char *line) static int process_line(yasm_preproc_gas *pp, char *line) { + macro_entry *macro; size_t i; struct { const char *name; @@ -824,6 +1006,8 @@ static int process_line(yasm_preproc_gas *pp, char *line) {"set", 2, FN(eval_set), 1}, {"equ", 2, FN(eval_set), 1}, {"equiv", 2, FN(eval_set), 0}, + {"macro", 1, FN(eval_macro), 0}, + {"endm", 0, FN(eval_endm), 0}, {"rept", 1, FN(eval_rept), 0}, {"endr", 1, FN(eval_endr), 0}, }; @@ -834,6 +1018,16 @@ static int process_line(yasm_preproc_gas *pp, char *line) return FALSE; } + /* See if this is a macro call. */ + STAILQ_FOREACH(macro, &pp->macros, next) { + const char *remainder = starts_with(line, macro->name); + if (remainder && (!*remainder || isspace(*remainder))) { + skip_whitespace2(&line); + expand_macro(pp, macro, remainder); + return FALSE; + } + } + for (i = 0; i < sizeof(directives)/sizeof(directives[0]); i++) { char buf1[1024]; const char *remainder = matches(line, directives[i].name); @@ -911,6 +1105,7 @@ gas_preproc_create(const char *in_filename, yasm_symtab *symtab, pp->in_comment = FALSE; SLIST_INIT(&pp->buffered_lines); SLIST_INIT(&pp->included_files); + STAILQ_INIT(&pp->macros); pp->in_line_number = 0; pp->next_line_number = 0; pp->current_line_number = 0; @@ -939,6 +1134,19 @@ gas_preproc_destroy(yasm_preproc *preproc) yasm_xfree(inc_file->filename); yasm_xfree(inc_file); } + while (!STAILQ_EMPTY(&pp->macros)) { + int i; + macro_entry *macro = STAILQ_FIRST(&pp->macros); + STAILQ_REMOVE_HEAD(&pp->macros, next); + yasm_xfree(macro->name); + for (i = 0; i < macro->num_params; i++) + yasm_xfree(macro->params[i]); + yasm_xfree(macro->params); + for (i = 0; i < macro->num_lines; i++) + yasm_xfree(macro->lines[i]); + yasm_xfree(macro->lines); + yasm_xfree(macro); + } yasm_xfree(preproc); } From 11a71a15f90c183064b93910b226bb7d2ee0f1ab Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 13 Feb 2010 07:25:23 +0000 Subject: [PATCH 341/585] Update yasm_parsers(7) now that GAS preprocessor support is fairly mature. svn path=/trunk/yasm/; revision=2286 --- modules/parsers/yasm_parsers.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/parsers/yasm_parsers.xml b/modules/parsers/yasm_parsers.xml index d29421de..d0756ac9 100644 --- a/modules/parsers/yasm_parsers.xml +++ b/modules/parsers/yasm_parsers.xml @@ -91,11 +91,11 @@ assembler for modern Unix systems, and is used as the backend for the GCC compiler. Yasm's support for GAS syntax is moderately good, although immature: not all directives are supported, and only - 32-bit x86 and AMD64 architectures are supported. There is also no - support for the GAS preprocessor. Despite these limitations, - Yasm's GAS syntax support is good enough to handle essentially all - x86 and AMD64 GCC compiler output. The GAS parser can be selected - with . + 32-bit x86 and AMD64 architectures are supported. Nearly all of + the GAS preprocessor is also supported. Yasm's GAS syntax support + is good enough to handle essentially all x86 and AMD64 GCC compiler + output. The GAS parser can be selected with . From c699637602d24bc29413d12a4165eb47a1251769 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 13 Feb 2010 08:42:27 +0000 Subject: [PATCH 342/585] vsyasm: create intermediate output directories if necessary. This feature is apparently assumed by MSBUILD. Contributed (with minor modifications) by: Brian Gladman svn path=/trunk/yasm/; revision=2287 --- configure.ac | 2 +- frontends/vsyasm/vsyasm.c | 20 ++++++++--- libyasm/file.c | 70 +++++++++++++++++++++++++++++++++++++++ libyasm/file.h | 24 ++++++++++++++ 4 files changed, 111 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 501b7525..638d654a 100644 --- a/configure.ac +++ b/configure.ac @@ -105,7 +105,7 @@ AM_WITH_DMALLOC # Checks for header files. # AC_HEADER_STDC -AC_CHECK_HEADERS([strings.h libgen.h unistd.h direct.h]) +AC_CHECK_HEADERS([strings.h libgen.h unistd.h direct.h sys/stat.h]) # REQUIRE standard C headers if test "$ac_cv_header_stdc" != yes; then diff --git a/frontends/vsyasm/vsyasm.c b/frontends/vsyasm/vsyasm.c index 43a478d8..5983a954 100644 --- a/frontends/vsyasm/vsyasm.c +++ b/frontends/vsyasm/vsyasm.c @@ -45,7 +45,8 @@ #include "license.c" /*@null@*/ /*@only@*/ static char *objdir_pathname = NULL; -/*@null@*/ /*@only@*/ static char *global_prefix = NULL, *global_suffix = NULL; +/*@null@*/ /*@only@*/ static char *global_prefix = NULL, *global_suffix = +NULL; /*@null@*/ /*@only@*/ static char *listdir_pathname = NULL; /*@null@*/ /*@only@*/ static char *mapdir_pathname = NULL; /*@null@*/ /*@only@*/ static char *machine_name = NULL; @@ -658,6 +659,20 @@ main(int argc, char *argv[]) /* If not already specified, output to the current directory. */ if (!objdir_pathname) objdir_pathname = yasm__xstrdup("./"); + else if((i = yasm__createpath(objdir_pathname)) > 0) { + objdir_pathname[i] = '/'; + objdir_pathname[i+1] = '\0'; + } + + /* Create other output directories if necessary */ + if (listdir_pathname && (i = yasm__createpath(listdir_pathname)) > 0) { + listdir_pathname[i] = '/'; + listdir_pathname[i+1] = '\0'; + } + if (mapdir_pathname && (i = yasm__createpath(mapdir_pathname)) > 0) { + mapdir_pathname[i] = '/'; + mapdir_pathname[i+1] = '\0'; + } /* Assemble each input file. Terminate on first error. */ STAILQ_FOREACH(infile, &input_files, link) @@ -927,7 +942,6 @@ opt_listdir_handler(/*@unused@*/ char *cmd, char *param, assert(param != NULL); listdir_pathname = yasm_xmalloc(strlen(param)+2); strcpy(listdir_pathname, param); - strcat(listdir_pathname, "/"); return 0; } @@ -945,7 +959,6 @@ opt_objdir_handler(/*@unused@*/ char *cmd, char *param, assert(param != NULL); objdir_pathname = yasm_xmalloc(strlen(param)+2); strcpy(objdir_pathname, param); - strcat(objdir_pathname, "/"); return 0; } @@ -963,7 +976,6 @@ opt_mapdir_handler(/*@unused@*/ char *cmd, char *param, assert(param != NULL); mapdir_pathname = yasm_xmalloc(strlen(param)+2); strcpy(mapdir_pathname, param); - strcat(mapdir_pathname, "/"); return 0; } diff --git a/libyasm/file.c b/libyasm/file.c index 128934a8..07609348 100644 --- a/libyasm/file.c +++ b/libyasm/file.c @@ -34,6 +34,14 @@ #include #endif +#ifdef _WIN32 +#include +#endif + +#ifdef HAVE_SYS_STAT_H +#include +#endif + #include #include @@ -450,6 +458,68 @@ yasm__combpath_win(const char *from, const char *to) return out; } +size_t +yasm__createpath_common(const char *path, int win) +{ + const char *pp = path, *pe; + char *ts, *tp; + size_t len, lth; + + lth = len = strlen(path); + ts = tp = (char *) malloc(len + 1); + pe = pp + len; + while (pe > pp) { + if ((win && *pe == '\\') || *pe == '/') + break; + --pe; + --lth; + } + + while (pp <= pe) { + if (pp == pe || (win && *pp == '\\') || *pp == '/') { +#ifdef _WIN32 + struct _finddata_t fi; + intptr_t h; +#elif defined(HAVE_SYS_STAT_H) + struct stat fi; +#endif + *tp = '\0'; + +#ifdef _WIN32 + h = _findfirst(ts, &fi); + if (h != -1) { + if (fi.attrib != _A_SUBDIR) { + _findclose(h); + break; + } + } else if (errno == ENOENT) { + if (_mkdir(ts) == -1) { + _findclose(h); + lth = -1; + break; + } + } + _findclose(h); +#elif defined(HAVE_SYS_STAT_H) + if (stat(ts, &fi) != -1) { + if (!S_ISDIR(fi.st_mode)) + break; + } else if (errno == ENOENT) { + if (mkdir(ts, 0755) == -1) { + lth = 0; + break; + } + } +#else + break; +#endif + } + *tp++ = *pp++; + } + free(ts); + return lth; +} + typedef struct incpath { STAILQ_ENTRY(incpath) link; /*@owned@*/ char *path; diff --git a/libyasm/file.h b/libyasm/file.h index a1de0339..d99785dd 100644 --- a/libyasm/file.h +++ b/libyasm/file.h @@ -179,6 +179,30 @@ char *yasm__combpath_win(const char *from, const char *to); # endif #endif +/** Recursively create tree of directories needed for pathname. + * \internal + * \param path pathname + * \param win handle windows paths + * \return Length of directory portion of pathname. + */ +YASM_LIB_DECL +size_t yasm__createpath_common(const char *path, int win); + +/** Recursively create tree of directories needed for pathname. + * Unless otherwise defined, defaults to yasm__createpath_unix(). + * \internal + * \param path pathname + * \return Length of directory portion of pathname. + */ +#ifndef yasm__createpath +# if defined (_WIN32) || defined (WIN32) || defined (__MSDOS__) || \ + defined (__DJGPP__) || defined (__OS2__) +# define yasm__createpath(path) yasm__createpath_common(path, 1) +# else +# define yasm__createpath(path) yasm__createpath_common(path, 0) +# endif +#endif + /** Try to find and open an include file, searching through include paths. * First iname is looked for relative to the directory containing "from", then * it's looked for relative to each of the include paths. From 03a71a10e42d2d3ac6f04c8d9d42d5522d785c50 Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Sat, 13 Feb 2010 19:26:44 +0000 Subject: [PATCH 343/585] 1. Add vsyasm build to VC9 and vc10 builds 2. Improve search for Python interpreter svn path=/trunk/yasm/; revision=2288 --- Mkfiles/vc10/genperf/genperf.vcxproj | 18 +- Mkfiles/vc10/genperf/run.bat | 2 +- Mkfiles/vc10/vsyasm.vcxproj | 268 ++++++++++++++++++ Mkfiles/vc10/yasm.sln | 10 + Mkfiles/vc9/genperf/genperf.vcproj | 8 +- Mkfiles/vc9/genperf/run.bat | 2 +- Mkfiles/vc9/modules/modules.vcproj | 6 +- Mkfiles/vc9/vsyasm.vcproj | 406 +++++++++++++++++++++++++++ Mkfiles/vc9/yasm.sln | 14 + 9 files changed, 724 insertions(+), 10 deletions(-) create mode 100644 Mkfiles/vc10/vsyasm.vcxproj create mode 100644 Mkfiles/vc9/vsyasm.vcproj diff --git a/Mkfiles/vc10/genperf/genperf.vcxproj b/Mkfiles/vc10/genperf/genperf.vcxproj index f3550e30..bd8ef6be 100644 --- a/Mkfiles/vc10/genperf/genperf.vcxproj +++ b/Mkfiles/vc10/genperf/genperf.vcxproj @@ -71,8 +71,15 @@ MachineX86 - run.bat "$(TargetPath)" + + + + run.bat "$(TargetPath)" + + + x86insn_nasm.c;x86insn_gas.c;x86cpu.c;x86regtmod.c;%(Outputs) + @@ -100,8 +107,15 @@ MachineX86 - run.bat "$(TargetPath)" + + + + run.bat "$(TargetPath)" + + + x86insn_nasm.c;x86insn_gas.c;x86cpu.c;x86regtmod.c;%(Outputs) + diff --git a/Mkfiles/vc10/genperf/run.bat b/Mkfiles/vc10/genperf/run.bat index 11e69040..4582e28e 100644 --- a/Mkfiles/vc10/genperf/run.bat +++ b/Mkfiles/vc10/genperf/run.bat @@ -1,6 +1,6 @@ cd ..\..\.. @echo off -for /f "usebackq tokens=2,3,4" %%f in (`reg query HKCR\Python.File\shell\open\command`) do (if %%f==REG_SZ echo %%g %%h >run_py.bat) +for /f "usebackq tokens=2,3,4,5,6" %%f in (`reg query HKCR\Python.File\shell\open\command`) do (if %%f==REG_SZ echo %%g %%h %%i %%j >run_py.bat) goto answer%errorlevel% :answer0 if not exist run_py.bat goto answer1 diff --git a/Mkfiles/vc10/vsyasm.vcxproj b/Mkfiles/vc10/vsyasm.vcxproj new file mode 100644 index 00000000..d10c2a66 --- /dev/null +++ b/Mkfiles/vc10/vsyasm.vcxproj @@ -0,0 +1,268 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {7FDD85BB-CC86-442B-A425-989B5B296ED5} + vsyasm + + + + Application + false + MultiByte + + + Application + false + MultiByte + + + Application + false + MultiByte + + + Application + false + MultiByte + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30128.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + + + + $(Platform)\$(Configuration)/vsyasm.tlb + + + + + Disabled + .;../..;%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + EditAndContinue + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)vsyasm.exe + true + true + $(OutDir)$(ProjectName).pdb + Console + false + + + MachineX86 + + + + + X64 + $(Platform)\$(Configuration)/vsyasm.tlb + + + + + Disabled + .;../..;%(AdditionalIncludeDirectories) + _DEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)vsyasm.exe + true + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX64 + + + + + $(Platform)\$(Configuration)/vsyasm.tlb + + + + + Full + Default + true + .;../..;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)vsyasm.exe + true + false + $(OutDir)$(ProjectName).pdb + Console + false + + + MachineX86 + + + + + X64 + $(Platform)\$(Configuration)/vsyasm.tlb + + + + + Full + OnlyExplicitInline + .;../..;%(AdditionalIncludeDirectories) + NDEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)vsyasm.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX64 + + + + + + + + + {021ceb0a-f721-4f59-b349-9ceeaf244459} + false + + + {29fe7874-1256-4ad6-b889-68e399dc9608} + false + + + {d715a3d4-efaa-442e-ad8b-5b4ff64e1dd6} + false + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc10/yasm.sln b/Mkfiles/vc10/yasm.sln index 9b061a37..ba248571 100644 --- a/Mkfiles/vc10/yasm.sln +++ b/Mkfiles/vc10/yasm.sln @@ -26,6 +26,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genstring", "genstring\gens EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ytasm", "ytasm.vcxproj", "{2162937B-0DBD-4450-B45F-DF578D8E7508}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vsyasm", "vsyasm.vcxproj", "{7FDD85BB-CC86-442B-A425-989B5B296ED5}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -114,6 +116,14 @@ Global {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|Win32.Build.0 = Release|Win32 {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|x64.ActiveCfg = Release|x64 {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|x64.Build.0 = Release|x64 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|Win32.ActiveCfg = Debug|Win32 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|Win32.Build.0 = Debug|Win32 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|x64.ActiveCfg = Debug|x64 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|x64.Build.0 = Debug|x64 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|Win32.ActiveCfg = Release|Win32 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|Win32.Build.0 = Release|Win32 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|x64.ActiveCfg = Release|x64 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Mkfiles/vc9/genperf/genperf.vcproj b/Mkfiles/vc9/genperf/genperf.vcproj index 507d0934..ab6e9e4e 100644 --- a/Mkfiles/vc9/genperf/genperf.vcproj +++ b/Mkfiles/vc9/genperf/genperf.vcproj @@ -29,6 +29,8 @@ /> diff --git a/Mkfiles/vc9/genperf/run.bat b/Mkfiles/vc9/genperf/run.bat index 11e69040..4582e28e 100644 --- a/Mkfiles/vc9/genperf/run.bat +++ b/Mkfiles/vc9/genperf/run.bat @@ -1,6 +1,6 @@ cd ..\..\.. @echo off -for /f "usebackq tokens=2,3,4" %%f in (`reg query HKCR\Python.File\shell\open\command`) do (if %%f==REG_SZ echo %%g %%h >run_py.bat) +for /f "usebackq tokens=2,3,4,5,6" %%f in (`reg query HKCR\Python.File\shell\open\command`) do (if %%f==REG_SZ echo %%g %%h %%i %%j >run_py.bat) goto answer%errorlevel% :answer0 if not exist run_py.bat goto answer1 diff --git a/Mkfiles/vc9/modules/modules.vcproj b/Mkfiles/vc9/modules/modules.vcproj index 24638379..0aa18f06 100644 --- a/Mkfiles/vc9/modules/modules.vcproj +++ b/Mkfiles/vc9/modules/modules.vcproj @@ -168,6 +168,7 @@ /> @@ -327,10 +329,6 @@ Name="Source Files" Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" > - - diff --git a/Mkfiles/vc9/vsyasm.vcproj b/Mkfiles/vc9/vsyasm.vcproj new file mode 100644 index 00000000..215d8edd --- /dev/null +++ b/Mkfiles/vc9/vsyasm.vcproj @@ -0,0 +1,406 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Mkfiles/vc9/yasm.sln b/Mkfiles/vc9/yasm.sln index f532e1c4..833e3beb 100644 --- a/Mkfiles/vc9/yasm.sln +++ b/Mkfiles/vc9/yasm.sln @@ -47,6 +47,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ytasm", "ytasm.vcproj", "{2 {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6} = {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vsyasm", "vsyasm.vcproj", "{7FDD85BB-CC86-442B-A425-989B5B296ED5}" + ProjectSection(ProjectDependencies) = postProject + {29FE7874-1256-4AD6-B889-68E399DC9608} = {29FE7874-1256-4AD6-B889-68E399DC9608} + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6} = {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6} + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -135,6 +141,14 @@ Global {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|Win32.Build.0 = Release|Win32 {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|x64.ActiveCfg = Release|x64 {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|x64.Build.0 = Release|x64 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|Win32.ActiveCfg = Debug|Win32 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|Win32.Build.0 = Debug|Win32 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|x64.ActiveCfg = Debug|x64 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|x64.Build.0 = Debug|x64 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|Win32.ActiveCfg = Release|Win32 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|Win32.Build.0 = Release|Win32 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|x64.ActiveCfg = Release|x64 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From b2d1f3fe4b10efa6b9426657f253069364b26be0 Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Mon, 15 Feb 2010 10:45:22 +0000 Subject: [PATCH 344/585] Update Visual Studio 2010 build files svn path=/trunk/yasm/; revision=2289 --- Mkfiles/vc10/genmacro/genmacro.vcxproj | 4 +-- Mkfiles/vc10/genmodule/genmodule.vcxproj | 4 +-- Mkfiles/vc10/genperf/genperf.vcxproj | 4 +-- Mkfiles/vc10/genstring/genstring.vcxproj | 4 +-- Mkfiles/vc10/genversion/genversion.vcxproj | 4 +-- Mkfiles/vc10/libyasm/libyasm.vcxproj | 4 ++- Mkfiles/vc10/modules/modules.vcxproj | 4 ++- Mkfiles/vc10/re2c/re2c.vcxproj | 4 +-- Mkfiles/vc10/vsyasm.vcxproj | 32 ++++++++++++---------- Mkfiles/vc10/yasm.vcxproj | 7 +++-- Mkfiles/vc10/ytasm.vcxproj | 7 +++-- 11 files changed, 39 insertions(+), 39 deletions(-) diff --git a/Mkfiles/vc10/genmacro/genmacro.vcxproj b/Mkfiles/vc10/genmacro/genmacro.vcxproj index 6da0bbec..15cf1693 100644 --- a/Mkfiles/vc10/genmacro/genmacro.vcxproj +++ b/Mkfiles/vc10/genmacro/genmacro.vcxproj @@ -56,7 +56,7 @@ $(IntDir) Level3 - EditAndContinue + ProgramDatabase Default @@ -82,12 +82,10 @@ $(IntDir) Level3 - ProgramDatabase Default $(OutDir)genmacro.exe - false $(OutDir)$(TargetName).pdb Console true diff --git a/Mkfiles/vc10/genmodule/genmodule.vcxproj b/Mkfiles/vc10/genmodule/genmodule.vcxproj index 4b2ae292..4a48093b 100644 --- a/Mkfiles/vc10/genmodule/genmodule.vcxproj +++ b/Mkfiles/vc10/genmodule/genmodule.vcxproj @@ -58,7 +58,7 @@ $(IntDir) $(IntDir) Level3 - EditAndContinue + ProgramDatabase Default @@ -86,12 +86,10 @@ $(IntDir) $(IntDir) Level3 - ProgramDatabase Default $(OutDir)genmodule.exe - false $(OutDir)$(TargetName).pdb Console true diff --git a/Mkfiles/vc10/genperf/genperf.vcxproj b/Mkfiles/vc10/genperf/genperf.vcxproj index bd8ef6be..3ca1fb45 100644 --- a/Mkfiles/vc10/genperf/genperf.vcxproj +++ b/Mkfiles/vc10/genperf/genperf.vcxproj @@ -57,7 +57,7 @@ $(IntDir) Level3 - EditAndContinue + ProgramDatabase Default @@ -91,12 +91,10 @@ $(IntDir) Level3 - ProgramDatabase Default $(OutDir)genperf.exe - false $(OutDir)$(TargetName).pdb Console true diff --git a/Mkfiles/vc10/genstring/genstring.vcxproj b/Mkfiles/vc10/genstring/genstring.vcxproj index b77920c7..118ec80c 100644 --- a/Mkfiles/vc10/genstring/genstring.vcxproj +++ b/Mkfiles/vc10/genstring/genstring.vcxproj @@ -56,7 +56,7 @@ $(IntDir) Level3 - EditAndContinue + ProgramDatabase Default @@ -82,12 +82,10 @@ $(IntDir) Level3 - ProgramDatabase Default $(OutDir)genstring.exe - false $(OutDir)$(TargetName).pdb Console true diff --git a/Mkfiles/vc10/genversion/genversion.vcxproj b/Mkfiles/vc10/genversion/genversion.vcxproj index c5152eb9..60e2679f 100644 --- a/Mkfiles/vc10/genversion/genversion.vcxproj +++ b/Mkfiles/vc10/genversion/genversion.vcxproj @@ -57,7 +57,7 @@ $(IntDir) Level3 - EditAndContinue + ProgramDatabase Default @@ -84,12 +84,10 @@ $(IntDir) Level3 - ProgramDatabase Default $(OutDir)genversion.exe - false $(OutDir)$(TargetName).pdb Console true diff --git a/Mkfiles/vc10/libyasm/libyasm.vcxproj b/Mkfiles/vc10/libyasm/libyasm.vcxproj index cd90e236..a480d2a6 100644 --- a/Mkfiles/vc10/libyasm/libyasm.vcxproj +++ b/Mkfiles/vc10/libyasm/libyasm.vcxproj @@ -93,6 +93,7 @@ Level3 true Default + ProgramDatabase NDEBUG;%(PreprocessorDefinitions) @@ -125,6 +126,7 @@ Level3 true Default + ProgramDatabase NDEBUG;%(PreprocessorDefinitions) @@ -149,8 +151,8 @@ $(IntDir) Level3 true - EditAndContinue Default + ProgramDatabase _DEBUG;%(PreprocessorDefinitions) diff --git a/Mkfiles/vc10/modules/modules.vcxproj b/Mkfiles/vc10/modules/modules.vcxproj index 75cbfccd..5fc78cfa 100644 --- a/Mkfiles/vc10/modules/modules.vcxproj +++ b/Mkfiles/vc10/modules/modules.vcxproj @@ -95,6 +95,7 @@ Level3 true Default + ProgramDatabase NDEBUG;%(PreprocessorDefinitions) @@ -131,6 +132,7 @@ Level3 true Default + ProgramDatabase NDEBUG;%(PreprocessorDefinitions) @@ -157,7 +159,7 @@ $(IntDir) Level3 true - EditAndContinue + ProgramDatabase Default diff --git a/Mkfiles/vc10/re2c/re2c.vcxproj b/Mkfiles/vc10/re2c/re2c.vcxproj index e7d57010..88bb5dea 100644 --- a/Mkfiles/vc10/re2c/re2c.vcxproj +++ b/Mkfiles/vc10/re2c/re2c.vcxproj @@ -57,8 +57,8 @@ $(IntDir) Level3 - EditAndContinue Default + ProgramDatabase $(OutDir)re2c.exe @@ -84,12 +84,10 @@ $(IntDir) Level3 - ProgramDatabase Default $(OutDir)re2c.exe - false $(OutDir)$(TargetName).pdb Console true diff --git a/Mkfiles/vc10/vsyasm.vcxproj b/Mkfiles/vc10/vsyasm.vcxproj index d10c2a66..7decc5bc 100644 --- a/Mkfiles/vc10/vsyasm.vcxproj +++ b/Mkfiles/vc10/vsyasm.vcxproj @@ -47,26 +47,26 @@ - + - + - + - + - <_ProjectFileVersion>10.0.30128.1 + <_ProjectFileVersion>10.0.21006.1 $(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ false @@ -82,7 +82,7 @@ - $(Platform)\$(Configuration)/vsyasm.tlb + $(Platform)\$(Configuration)/yasm.tlb @@ -101,7 +101,7 @@ $(IntDir) Level3 true - EditAndContinue + ProgramDatabase Default @@ -123,7 +123,7 @@ X64 - $(Platform)\$(Configuration)/vsyasm.tlb + $(Platform)\$(Configuration)/yasm.tlb @@ -163,7 +163,7 @@ - $(Platform)\$(Configuration)/vsyasm.tlb + $(Platform)\$(Configuration)/yasm.tlb @@ -186,6 +186,7 @@ Level3 true Default + ProgramDatabase NDEBUG;%(PreprocessorDefinitions) @@ -194,7 +195,7 @@ $(OutDir)vsyasm.exe true - false + true $(OutDir)$(ProjectName).pdb Console false @@ -206,7 +207,7 @@ X64 - $(Platform)\$(Configuration)/vsyasm.tlb + $(Platform)\$(Configuration)/yasm.tlb @@ -228,6 +229,7 @@ Level3 true Default + ProgramDatabase NDEBUG;%(PreprocessorDefinitions) @@ -242,6 +244,7 @@ MachineX64 + true @@ -249,10 +252,9 @@ - - {021ceb0a-f721-4f59-b349-9ceeaf244459} - false - + + + {29fe7874-1256-4ad6-b889-68e399dc9608} false diff --git a/Mkfiles/vc10/yasm.vcxproj b/Mkfiles/vc10/yasm.vcxproj index 1ba96d8b..bf663e78 100644 --- a/Mkfiles/vc10/yasm.vcxproj +++ b/Mkfiles/vc10/yasm.vcxproj @@ -101,7 +101,7 @@ $(IntDir) Level3 true - EditAndContinue + ProgramDatabase Default @@ -186,6 +186,7 @@ Level3 true Default + ProgramDatabase NDEBUG;%(PreprocessorDefinitions) @@ -194,7 +195,7 @@ $(OutDir)yasm.exe true - false + true $(OutDir)$(ProjectName).pdb Console false @@ -228,6 +229,7 @@ Level3 true Default + ProgramDatabase NDEBUG;%(PreprocessorDefinitions) @@ -242,6 +244,7 @@ MachineX64 + true diff --git a/Mkfiles/vc10/ytasm.vcxproj b/Mkfiles/vc10/ytasm.vcxproj index 19603a09..1599a15b 100644 --- a/Mkfiles/vc10/ytasm.vcxproj +++ b/Mkfiles/vc10/ytasm.vcxproj @@ -101,7 +101,7 @@ $(IntDir) Level3 true - EditAndContinue + ProgramDatabase Default @@ -186,6 +186,7 @@ Level3 true Default + ProgramDatabase NDEBUG;%(PreprocessorDefinitions) @@ -194,7 +195,7 @@ $(OutDir)ytasm.exe true - false + true $(OutDir)$(ProjectName).pdb Console false @@ -228,6 +229,7 @@ Level3 true Default + ProgramDatabase NDEBUG;%(PreprocessorDefinitions) @@ -242,6 +244,7 @@ MachineX64 + true From 03de198f0905cffabd58b5f09cd68ede38fcc63c Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 17 Feb 2010 06:33:26 +0000 Subject: [PATCH 345/585] Add vc10 and vsyasm build files to EXTRA_DIST. svn path=/trunk/yasm/; revision=2290 --- Makefile.am | 48 ++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/Makefile.am b/Makefile.am index 9ddf2283..32ba643d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -61,19 +61,22 @@ EXTRA_DIST += Mkfiles/Makefile.flat EXTRA_DIST += Mkfiles/Makefile.dj EXTRA_DIST += Mkfiles/dj/config.h EXTRA_DIST += Mkfiles/dj/libyasm-stdint.h +EXTRA_DIST += Mkfiles/vc9/config.h EXTRA_DIST += Mkfiles/vc9/crt_secure_no_deprecate.vsprops +EXTRA_DIST += Mkfiles/vc9/libyasm-stdint.h +EXTRA_DIST += Mkfiles/vc9/readme.vc9.txt +EXTRA_DIST += Mkfiles/vc9/vc98_swap.py +EXTRA_DIST += Mkfiles/vc9/vsyasm.vcproj EXTRA_DIST += Mkfiles/vc9/yasm.sln EXTRA_DIST += Mkfiles/vc9/yasm.vcproj EXTRA_DIST += Mkfiles/vc9/ytasm.vcproj -EXTRA_DIST += Mkfiles/vc9/config.h -EXTRA_DIST += Mkfiles/vc9/libyasm-stdint.h -EXTRA_DIST += Mkfiles/vc9/readme.vc9.txt EXTRA_DIST += Mkfiles/vc9/yasm.rules -EXTRA_DIST += Mkfiles/vc9/vc98_swap.py EXTRA_DIST += Mkfiles/vc9/genmacro/genmacro.vcproj EXTRA_DIST += Mkfiles/vc9/genmacro/run.bat EXTRA_DIST += Mkfiles/vc9/genmodule/genmodule.vcproj EXTRA_DIST += Mkfiles/vc9/genmodule/run.bat +EXTRA_DIST += Mkfiles/vc9/genperf/genperf.vcproj +EXTRA_DIST += Mkfiles/vc9/genperf/run.bat EXTRA_DIST += Mkfiles/vc9/genstring/genstring.vcproj EXTRA_DIST += Mkfiles/vc9/genstring/run.bat EXTRA_DIST += Mkfiles/vc9/genversion/genversion.vcproj @@ -82,8 +85,41 @@ EXTRA_DIST += Mkfiles/vc9/libyasm/libyasm.vcproj EXTRA_DIST += Mkfiles/vc9/modules/modules.vcproj EXTRA_DIST += Mkfiles/vc9/re2c/re2c.vcproj EXTRA_DIST += Mkfiles/vc9/re2c/run.bat -EXTRA_DIST += Mkfiles/vc9/genperf/genperf.vcproj -EXTRA_DIST += Mkfiles/vc9/genperf/run.bat +EXTRA_DIST += Mkfiles/vc10/config.h +EXTRA_DIST += Mkfiles/vc10/crt_secure_no_deprecate.props +EXTRA_DIST += Mkfiles/vc10/crt_secure_no_deprecate.vsprops +EXTRA_DIST += Mkfiles/vc10/libyasm-stdint.h +EXTRA_DIST += Mkfiles/vc10/readme.vc10.txt +EXTRA_DIST += Mkfiles/vc10/vsyasm.vcxproj +EXTRA_DIST += Mkfiles/vc10/yasm.props +EXTRA_DIST += Mkfiles/vc10/yasm.sln +EXTRA_DIST += Mkfiles/vc10/yasm.targets +EXTRA_DIST += Mkfiles/vc10/yasm.vcxproj +EXTRA_DIST += Mkfiles/vc10/yasm.vcxproj.filters +EXTRA_DIST += Mkfiles/vc10/yasm.xml +EXTRA_DIST += Mkfiles/vc10/ytasm.vcxproj +EXTRA_DIST += Mkfiles/vc10/genmacro/genmacro.vcxproj +EXTRA_DIST += Mkfiles/vc10/genmacro/genmacro.vcxproj.filters +EXTRA_DIST += Mkfiles/vc10/genmacro/run.bat +EXTRA_DIST += Mkfiles/vc10/genmodule/genmodule.vcxproj +EXTRA_DIST += Mkfiles/vc10/genmodule/genmodule.vcxproj.filters +EXTRA_DIST += Mkfiles/vc10/genmodule/run.bat +EXTRA_DIST += Mkfiles/vc10/genperf/genperf.vcxproj +EXTRA_DIST += Mkfiles/vc10/genperf/genperf.vcxproj.filters +EXTRA_DIST += Mkfiles/vc10/genperf/run.bat +EXTRA_DIST += Mkfiles/vc10/genstring/genstring.vcxproj +EXTRA_DIST += Mkfiles/vc10/genstring/genstring.vcxproj.filters +EXTRA_DIST += Mkfiles/vc10/genstring/run.bat +EXTRA_DIST += Mkfiles/vc10/genversion/genversion.vcxproj +EXTRA_DIST += Mkfiles/vc10/genversion/genversion.vcxproj.filters +EXTRA_DIST += Mkfiles/vc10/genversion/run.bat +EXTRA_DIST += Mkfiles/vc10/libyasm/libyasm.vcxproj +EXTRA_DIST += Mkfiles/vc10/libyasm/libyasm.vcxproj.filters +EXTRA_DIST += Mkfiles/vc10/modules/modules.vcxproj +EXTRA_DIST += Mkfiles/vc10/modules/modules.vcxproj.filters +EXTRA_DIST += Mkfiles/vc10/re2c/re2c.vcxproj +EXTRA_DIST += Mkfiles/vc10/re2c/re2c.vcxproj.filters +EXTRA_DIST += Mkfiles/vc10/re2c/run.bat # Until this gets fixed in automake DISTCLEANFILES += libyasm/stamp-h libyasm/stamp-h[0-9]* From d28f2a03a7bfc15d9e783d9421eb759a2ad3e197 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 19 Feb 2010 07:07:51 +0000 Subject: [PATCH 346/585] vsyasm: More gracefully handle single input file by using output name as-is. Patch by: Brian Gladman svn path=/trunk/yasm/; revision=2291 --- frontends/vsyasm/vsyasm.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/frontends/vsyasm/vsyasm.c b/frontends/vsyasm/vsyasm.c index 5983a954..cde023bd 100644 --- a/frontends/vsyasm/vsyasm.c +++ b/frontends/vsyasm/vsyasm.c @@ -45,8 +45,7 @@ #include "license.c" /*@null@*/ /*@only@*/ static char *objdir_pathname = NULL; -/*@null@*/ /*@only@*/ static char *global_prefix = NULL, *global_suffix = -NULL; +/*@null@*/ /*@only@*/ static char *global_prefix = NULL, *global_suffix = NULL; /*@null@*/ /*@only@*/ static char *listdir_pathname = NULL; /*@null@*/ /*@only@*/ static char *mapdir_pathname = NULL; /*@null@*/ /*@only@*/ static char *machine_name = NULL; @@ -238,6 +237,7 @@ typedef struct constcharparam { static constcharparam_head preproc_options; static constcharparam_head input_files; +static int num_input_files = 0; static int do_assemble(const char *in_filename) @@ -659,17 +659,20 @@ main(int argc, char *argv[]) /* If not already specified, output to the current directory. */ if (!objdir_pathname) objdir_pathname = yasm__xstrdup("./"); - else if((i = yasm__createpath(objdir_pathname)) > 0) { + else if ((i = yasm__createpath(objdir_pathname)) > 0 && + num_input_files > 1) { objdir_pathname[i] = '/'; objdir_pathname[i+1] = '\0'; } /* Create other output directories if necessary */ - if (listdir_pathname && (i = yasm__createpath(listdir_pathname)) > 0) { + if (listdir_pathname && (i = yasm__createpath(listdir_pathname)) > 0 && + num_input_files > 1) { listdir_pathname[i] = '/'; listdir_pathname[i+1] = '\0'; } - if (mapdir_pathname && (i = yasm__createpath(mapdir_pathname)) > 0) { + if (mapdir_pathname && (i = yasm__createpath(mapdir_pathname)) > 0 && + num_input_files > 1) { mapdir_pathname[i] = '/'; mapdir_pathname[i+1] = '\0'; } @@ -780,6 +783,7 @@ not_an_option_handler(char *param) cp->param = param; cp->id = 0; STAILQ_INSERT_TAIL(&input_files, cp, link); + ++num_input_files; return 0; } From c85781d095dc47a812bf68d3fd22c84408d534cf Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Tue, 23 Feb 2010 08:15:43 +0000 Subject: [PATCH 347/585] Hopefully remove python discovery issue in Windows build svn path=/trunk/yasm/; revision=2292 --- Mkfiles/vc10/genperf/run.bat | 23 ++++++++++++++++++----- Mkfiles/vc9/genperf/run.bat | 23 ++++++++++++++++++----- 2 files changed, 36 insertions(+), 10 deletions(-) diff --git a/Mkfiles/vc10/genperf/run.bat b/Mkfiles/vc10/genperf/run.bat index 4582e28e..f2295c5d 100644 --- a/Mkfiles/vc10/genperf/run.bat +++ b/Mkfiles/vc10/genperf/run.bat @@ -1,18 +1,31 @@ cd ..\..\.. @echo off for /f "usebackq tokens=2,3,4,5,6" %%f in (`reg query HKCR\Python.File\shell\open\command`) do (if %%f==REG_SZ echo %%g %%h %%i %%j >run_py.bat) -goto answer%errorlevel% -:answer0 -if not exist run_py.bat goto answer1 +goto ftry%errorlevel% + +:ftry0 +goto pyfound +:ftry1 +for /f "usebackq tokens=2,3,4" %%f in (`reg query HKCR\Python.File\shell\open\command`) do (if %%f==REG_SZ echo %%g %%h >run_py.bat) +goto stry%errorlevel% + +:stry0 +goto pyfound +:stry1 +goto pynotfound + +:pyfound +if not exist run_py.bat goto notfound echo ... building with Python ... @echo on call run_py.bat modules\arch\x86\gen_x86_insn.py del run_py.bat @echo off goto end -:answer1 + +:pynotfound echo ... building without Python ... -goto end + :end @echo on %1 x86insn_nasm.gperf x86insn_nasm.c diff --git a/Mkfiles/vc9/genperf/run.bat b/Mkfiles/vc9/genperf/run.bat index 4582e28e..f2295c5d 100644 --- a/Mkfiles/vc9/genperf/run.bat +++ b/Mkfiles/vc9/genperf/run.bat @@ -1,18 +1,31 @@ cd ..\..\.. @echo off for /f "usebackq tokens=2,3,4,5,6" %%f in (`reg query HKCR\Python.File\shell\open\command`) do (if %%f==REG_SZ echo %%g %%h %%i %%j >run_py.bat) -goto answer%errorlevel% -:answer0 -if not exist run_py.bat goto answer1 +goto ftry%errorlevel% + +:ftry0 +goto pyfound +:ftry1 +for /f "usebackq tokens=2,3,4" %%f in (`reg query HKCR\Python.File\shell\open\command`) do (if %%f==REG_SZ echo %%g %%h >run_py.bat) +goto stry%errorlevel% + +:stry0 +goto pyfound +:stry1 +goto pynotfound + +:pyfound +if not exist run_py.bat goto notfound echo ... building with Python ... @echo on call run_py.bat modules\arch\x86\gen_x86_insn.py del run_py.bat @echo off goto end -:answer1 + +:pynotfound echo ... building without Python ... -goto end + :end @echo on %1 x86insn_nasm.gperf x86insn_nasm.c From e6fd6d7af1d5fa6135d6c89de9ffd8832a80f145 Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Tue, 23 Feb 2010 08:56:20 +0000 Subject: [PATCH 348/585] correct error in python detection batch file svn path=/trunk/yasm/; revision=2293 --- Mkfiles/vc10/genperf/run.bat | 2 +- Mkfiles/vc9/genperf/run.bat | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Mkfiles/vc10/genperf/run.bat b/Mkfiles/vc10/genperf/run.bat index f2295c5d..dc39a570 100644 --- a/Mkfiles/vc10/genperf/run.bat +++ b/Mkfiles/vc10/genperf/run.bat @@ -15,7 +15,7 @@ goto pyfound goto pynotfound :pyfound -if not exist run_py.bat goto notfound +if not exist run_py.bat goto pynotfound echo ... building with Python ... @echo on call run_py.bat modules\arch\x86\gen_x86_insn.py diff --git a/Mkfiles/vc9/genperf/run.bat b/Mkfiles/vc9/genperf/run.bat index f2295c5d..dc39a570 100644 --- a/Mkfiles/vc9/genperf/run.bat +++ b/Mkfiles/vc9/genperf/run.bat @@ -15,7 +15,7 @@ goto pyfound goto pynotfound :pyfound -if not exist run_py.bat goto notfound +if not exist run_py.bat goto pynotfound echo ... building with Python ... @echo on call run_py.bat modules\arch\x86\gen_x86_insn.py From 40ab77b4d03c079010f66ce37355ec7e6ae253c1 Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Wed, 24 Feb 2010 11:26:40 +0000 Subject: [PATCH 349/585] Make a further attempt to use the Windows registry to find Python svn path=/trunk/yasm/; revision=2294 --- Mkfiles/vc10/genperf/run.bat | 31 ++++++++----------------------- Mkfiles/vc9/genperf/run.bat | 31 ++++++++----------------------- 2 files changed, 16 insertions(+), 46 deletions(-) diff --git a/Mkfiles/vc10/genperf/run.bat b/Mkfiles/vc10/genperf/run.bat index dc39a570..b2aed9ed 100644 --- a/Mkfiles/vc10/genperf/run.bat +++ b/Mkfiles/vc10/genperf/run.bat @@ -1,33 +1,18 @@ cd ..\..\.. @echo off -for /f "usebackq tokens=2,3,4,5,6" %%f in (`reg query HKCR\Python.File\shell\open\command`) do (if %%f==REG_SZ echo %%g %%h %%i %%j >run_py.bat) -goto ftry%errorlevel% - -:ftry0 -goto pyfound -:ftry1 -for /f "usebackq tokens=2,3,4" %%f in (`reg query HKCR\Python.File\shell\open\command`) do (if %%f==REG_SZ echo %%g %%h >run_py.bat) -goto stry%errorlevel% - -:stry0 -goto pyfound -:stry1 -goto pynotfound - -:pyfound -if not exist run_py.bat goto pynotfound -echo ... building with Python ... -@echo on -call run_py.bat modules\arch\x86\gen_x86_insn.py del run_py.bat -@echo off +for /f "usebackq tokens=2*" %%f in (`reg query HKCR\Python.File\shell\open\command`) do (if %%f==REG_SZ echo %%g >run_py.bat) +@echo on +if exist run_py.bat goto pyfound +echo ... building without Python ... goto end -:pynotfound -echo ... building without Python ... +:pyfound +echo ... building with Python ... +call run_py.bat modules\arch\x86\gen_x86_insn.py +del run_py.bat :end -@echo on %1 x86insn_nasm.gperf x86insn_nasm.c %1 x86insn_gas.gperf x86insn_gas.c %1 modules\arch\x86\x86cpu.gperf x86cpu.c diff --git a/Mkfiles/vc9/genperf/run.bat b/Mkfiles/vc9/genperf/run.bat index dc39a570..b2aed9ed 100644 --- a/Mkfiles/vc9/genperf/run.bat +++ b/Mkfiles/vc9/genperf/run.bat @@ -1,33 +1,18 @@ cd ..\..\.. @echo off -for /f "usebackq tokens=2,3,4,5,6" %%f in (`reg query HKCR\Python.File\shell\open\command`) do (if %%f==REG_SZ echo %%g %%h %%i %%j >run_py.bat) -goto ftry%errorlevel% - -:ftry0 -goto pyfound -:ftry1 -for /f "usebackq tokens=2,3,4" %%f in (`reg query HKCR\Python.File\shell\open\command`) do (if %%f==REG_SZ echo %%g %%h >run_py.bat) -goto stry%errorlevel% - -:stry0 -goto pyfound -:stry1 -goto pynotfound - -:pyfound -if not exist run_py.bat goto pynotfound -echo ... building with Python ... -@echo on -call run_py.bat modules\arch\x86\gen_x86_insn.py del run_py.bat -@echo off +for /f "usebackq tokens=2*" %%f in (`reg query HKCR\Python.File\shell\open\command`) do (if %%f==REG_SZ echo %%g >run_py.bat) +@echo on +if exist run_py.bat goto pyfound +echo ... building without Python ... goto end -:pynotfound -echo ... building without Python ... +:pyfound +echo ... building with Python ... +call run_py.bat modules\arch\x86\gen_x86_insn.py +del run_py.bat :end -@echo on %1 x86insn_nasm.gperf x86insn_nasm.c %1 x86insn_gas.gperf x86insn_gas.c %1 modules\arch\x86\x86cpu.gperf x86cpu.c From e062b3c45682b59b25440f2afa311773b0562028 Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Thu, 25 Feb 2010 10:57:07 +0000 Subject: [PATCH 350/585] Yet one more attempt to find Python in Windows svn path=/trunk/yasm/; revision=2295 --- Mkfiles/vc10/genperf/run.bat | 27 +++++++++++++++------------ Mkfiles/vc9/genperf/run.bat | 27 +++++++++++++++------------ 2 files changed, 30 insertions(+), 24 deletions(-) diff --git a/Mkfiles/vc10/genperf/run.bat b/Mkfiles/vc10/genperf/run.bat index b2aed9ed..1811dd6e 100644 --- a/Mkfiles/vc10/genperf/run.bat +++ b/Mkfiles/vc10/genperf/run.bat @@ -1,18 +1,21 @@ cd ..\..\.. @echo off -del run_py.bat -for /f "usebackq tokens=2*" %%f in (`reg query HKCR\Python.File\shell\open\command`) do (if %%f==REG_SZ echo %%g >run_py.bat) +for /f "usebackq tokens=1*" %%f in (`reg query HKCR\Python.File\shell\open\command`) do (set _my_=%%f %%g) +goto next%errorlevel% + +:next1 +echo Building without Python ... +goto therest + +:next0 +echo Building with Python ... +set _res_=%_my_:*REG_SZ=% +set _end_=%_res_:*exe"=% +call set _python_=%%res:%_end_%=%% +call %_python_% modules\arch\x86\gen_x86_insn.py + +:therest @echo on -if exist run_py.bat goto pyfound -echo ... building without Python ... -goto end - -:pyfound -echo ... building with Python ... -call run_py.bat modules\arch\x86\gen_x86_insn.py -del run_py.bat - -:end %1 x86insn_nasm.gperf x86insn_nasm.c %1 x86insn_gas.gperf x86insn_gas.c %1 modules\arch\x86\x86cpu.gperf x86cpu.c diff --git a/Mkfiles/vc9/genperf/run.bat b/Mkfiles/vc9/genperf/run.bat index b2aed9ed..1811dd6e 100644 --- a/Mkfiles/vc9/genperf/run.bat +++ b/Mkfiles/vc9/genperf/run.bat @@ -1,18 +1,21 @@ cd ..\..\.. @echo off -del run_py.bat -for /f "usebackq tokens=2*" %%f in (`reg query HKCR\Python.File\shell\open\command`) do (if %%f==REG_SZ echo %%g >run_py.bat) +for /f "usebackq tokens=1*" %%f in (`reg query HKCR\Python.File\shell\open\command`) do (set _my_=%%f %%g) +goto next%errorlevel% + +:next1 +echo Building without Python ... +goto therest + +:next0 +echo Building with Python ... +set _res_=%_my_:*REG_SZ=% +set _end_=%_res_:*exe"=% +call set _python_=%%res:%_end_%=%% +call %_python_% modules\arch\x86\gen_x86_insn.py + +:therest @echo on -if exist run_py.bat goto pyfound -echo ... building without Python ... -goto end - -:pyfound -echo ... building with Python ... -call run_py.bat modules\arch\x86\gen_x86_insn.py -del run_py.bat - -:end %1 x86insn_nasm.gperf x86insn_nasm.c %1 x86insn_gas.gperf x86insn_gas.c %1 modules\arch\x86\x86cpu.gperf x86cpu.c From ed581366059bf532bb78a830d8810e99cc5702be Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Thu, 25 Feb 2010 11:47:02 +0000 Subject: [PATCH 351/585] Correction to Python detection on Windows svn path=/trunk/yasm/; revision=2296 --- Mkfiles/vc10/genperf/run.bat | 2 +- Mkfiles/vc9/genperf/run.bat | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Mkfiles/vc10/genperf/run.bat b/Mkfiles/vc10/genperf/run.bat index 1811dd6e..9c22b57e 100644 --- a/Mkfiles/vc10/genperf/run.bat +++ b/Mkfiles/vc10/genperf/run.bat @@ -11,7 +11,7 @@ goto therest echo Building with Python ... set _res_=%_my_:*REG_SZ=% set _end_=%_res_:*exe"=% -call set _python_=%%res:%_end_%=%% +call set _python_=%%_res_:%_end_%=%% call %_python_% modules\arch\x86\gen_x86_insn.py :therest diff --git a/Mkfiles/vc9/genperf/run.bat b/Mkfiles/vc9/genperf/run.bat index 1811dd6e..9c22b57e 100644 --- a/Mkfiles/vc9/genperf/run.bat +++ b/Mkfiles/vc9/genperf/run.bat @@ -11,7 +11,7 @@ goto therest echo Building with Python ... set _res_=%_my_:*REG_SZ=% set _end_=%_res_:*exe"=% -call set _python_=%%res:%_end_%=%% +call set _python_=%%_res_:%_end_%=%% call %_python_% modules\arch\x86\gen_x86_insn.py :therest From d7ca41bfa8ea2f3aee02664bbbca5d010b8ff323 Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Wed, 3 Mar 2010 09:41:12 +0000 Subject: [PATCH 352/585] Add VSYASM integration files for Visual Studio 2010 (and remove incorrect YASM ones) svn path=/trunk/yasm/; revision=2297 --- Mkfiles/vc10/vsyasm.props | 24 ++++++ Mkfiles/vc10/vsyasm.targets | 104 ++++++++++++++++++++++++++ Mkfiles/vc10/{yasm.xml => vsyasm.xml} | 10 +-- Mkfiles/vc10/yasm.props | 24 ------ Mkfiles/vc10/yasm.targets | 91 ---------------------- 5 files changed, 133 insertions(+), 120 deletions(-) create mode 100644 Mkfiles/vc10/vsyasm.props create mode 100644 Mkfiles/vc10/vsyasm.targets rename Mkfiles/vc10/{yasm.xml => vsyasm.xml} (92%) delete mode 100644 Mkfiles/vc10/yasm.props delete mode 100644 Mkfiles/vc10/yasm.targets diff --git a/Mkfiles/vc10/vsyasm.props b/Mkfiles/vc10/vsyasm.props new file mode 100644 index 00000000..4f2cc764 --- /dev/null +++ b/Mkfiles/vc10/vsyasm.props @@ -0,0 +1,24 @@ + + + + Midl + CustomBuild + + + _SelectedFiles;$(YASMDependsOn) + + + + False + $(IntDir)$(TargetName) + 0 + 0 + vsyasm -Xvc -f $(Platform) [AllOptions] [AdditionalOptions] [Inputs] + %(ObjectFileName) + Assembling %(Filename)%(Extension) + false + + + \ No newline at end of file diff --git a/Mkfiles/vc10/vsyasm.targets b/Mkfiles/vc10/vsyasm.targets new file mode 100644 index 00000000..a250afbb --- /dev/null +++ b/Mkfiles/vc10/vsyasm.targets @@ -0,0 +1,104 @@ + + + + + + _YASM + + + + $(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml + + + + + + + + @(YASM, '|') + + + + + + + + + $(ComputeLinkInputsTargets); + ComputeYASMOutput; + + + $(ComputeLibInputsTargets); + ComputeYASMOutput; + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc10/yasm.xml b/Mkfiles/vc10/vsyasm.xml similarity index 92% rename from Mkfiles/vc10/yasm.xml rename to Mkfiles/vc10/vsyasm.xml index 631b613d..a2170083 100644 --- a/Mkfiles/vc10/yasm.xml +++ b/Mkfiles/vc10/vsyasm.xml @@ -1,5 +1,5 @@  - + + Switch="-i "[value]"" /> + Switch="-o "[value]"" /> + Switch="-l "[value]"" /> + Switch="-P "[value]"" /> - - - Midl - CustomBuild - - - _SelectedFiles;$(YASMDependsOn) - - - - False - $(IntDir)%(FileName).obj - 0 - 0 - yasm -Xvc -f $(Platform) [AllOptions] [AdditionalOptions] [Inputs] - %(ObjectFileName) - Assembling %(Filename)%(Extension) - false - - - diff --git a/Mkfiles/vc10/yasm.targets b/Mkfiles/vc10/yasm.targets deleted file mode 100644 index 92bdccc9..00000000 --- a/Mkfiles/vc10/yasm.targets +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - _YASM - - - - $(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml - - - - - - - - @(YASM, '|') - - - - - - - - - $(ComputeLinkInputsTargets); - ComputeYASMOutput; - - - $(ComputeLibInputsTargets); - ComputeYASMOutput; - - - - - - - - - - - - From 7b10030105885b15cfce1ba4bd31d09e1b81d9ec Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Wed, 3 Mar 2010 10:31:37 +0000 Subject: [PATCH 353/585] Adjust YASM integration into Visual Studio 2010 slightly svn path=/trunk/yasm/; revision=2298 --- Mkfiles/vc10/vsyasm.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mkfiles/vc10/vsyasm.props b/Mkfiles/vc10/vsyasm.props index 4f2cc764..24d8972a 100644 --- a/Mkfiles/vc10/vsyasm.props +++ b/Mkfiles/vc10/vsyasm.props @@ -12,7 +12,7 @@ False - $(IntDir)$(TargetName) + $(IntDir) 0 0 vsyasm -Xvc -f $(Platform) [AllOptions] [AdditionalOptions] [Inputs] From 47b7b364c753af7d130919d23a45e3dfdd97b78d Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 4 Mar 2010 05:08:00 +0000 Subject: [PATCH 354/585] Makefile.am: Update for [2297] changes. svn path=/trunk/yasm/; revision=2299 --- Makefile.am | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index 32ba643d..95dae006 100644 --- a/Makefile.am +++ b/Makefile.am @@ -90,13 +90,13 @@ EXTRA_DIST += Mkfiles/vc10/crt_secure_no_deprecate.props EXTRA_DIST += Mkfiles/vc10/crt_secure_no_deprecate.vsprops EXTRA_DIST += Mkfiles/vc10/libyasm-stdint.h EXTRA_DIST += Mkfiles/vc10/readme.vc10.txt +EXTRA_DIST += Mkfiles/vc10/vsyasm.props +EXTRA_DIST += Mkfiles/vc10/vsyasm.targets EXTRA_DIST += Mkfiles/vc10/vsyasm.vcxproj -EXTRA_DIST += Mkfiles/vc10/yasm.props +EXTRA_DIST += Mkfiles/vc10/vsyasm.xml EXTRA_DIST += Mkfiles/vc10/yasm.sln -EXTRA_DIST += Mkfiles/vc10/yasm.targets EXTRA_DIST += Mkfiles/vc10/yasm.vcxproj EXTRA_DIST += Mkfiles/vc10/yasm.vcxproj.filters -EXTRA_DIST += Mkfiles/vc10/yasm.xml EXTRA_DIST += Mkfiles/vc10/ytasm.vcxproj EXTRA_DIST += Mkfiles/vc10/genmacro/genmacro.vcxproj EXTRA_DIST += Mkfiles/vc10/genmacro/genmacro.vcxproj.filters From d7c5571bcb8c403ffa30cb096094aa5fb3cccd60 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 4 Mar 2010 05:13:48 +0000 Subject: [PATCH 355/585] vsyasm: if -E is used, print command line as first line in error file. Requested by: Brian Gladman svn path=/trunk/yasm/; revision=2300 --- frontends/vsyasm/vsyasm.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontends/vsyasm/vsyasm.c b/frontends/vsyasm/vsyasm.c index cde023bd..d903b087 100644 --- a/frontends/vsyasm/vsyasm.c +++ b/frontends/vsyasm/vsyasm.c @@ -565,9 +565,14 @@ main(int argc, char *argv[]) /* Open error file if specified. */ if (error_filename) { + int j; errfile = open_file(error_filename, "wt"); if (!errfile) return EXIT_FAILURE; + + /* Print command line as first line in error file. */ + for (j=0; j Date: Wed, 10 Mar 2010 11:33:55 +0000 Subject: [PATCH 356/585] Improve VSYASM integration into Visual Studio 2010 svn path=/trunk/yasm/; revision=2307 --- Mkfiles/vc10/vsyasm.props | 4 +- Mkfiles/vc10/vsyasm.targets | 28 +++++----- Mkfiles/vc10/vsyasm.xml | 105 +++++++++++++++++++++++++++++++----- 3 files changed, 109 insertions(+), 28 deletions(-) diff --git a/Mkfiles/vc10/vsyasm.props b/Mkfiles/vc10/vsyasm.props index 24d8972a..c7a97495 100644 --- a/Mkfiles/vc10/vsyasm.props +++ b/Mkfiles/vc10/vsyasm.props @@ -12,11 +12,11 @@ False - $(IntDir) + $(IntDir) 0 0 vsyasm -Xvc -f $(Platform) [AllOptions] [AdditionalOptions] [Inputs] - %(ObjectFileName) + %(ObjectFile) Assembling %(Filename)%(Extension) false diff --git a/Mkfiles/vc10/vsyasm.targets b/Mkfiles/vc10/vsyasm.targets index a250afbb..c86180dd 100644 --- a/Mkfiles/vc10/vsyasm.targets +++ b/Mkfiles/vc10/vsyasm.targets @@ -20,7 +20,7 @@ AfterTargets="$(YASMAfterTargets)" Condition="'@(YASM)' != ''" DependsOnTargets="$(YASMDependsOn);ComputeYASMOutput" - Outputs="@(YASM->'%(ObjectFileName)')" + Outputs="@(YASM->'%(ObjectFile)')" Inputs="@(YASM);%(YASM.AdditionalDependencies);$(MSBuildProjectFile)"> @@ -30,8 +30,8 @@ + Include="%(YASM.ObjectFile)" + Condition="'%(YASM.ObjectFile)' != '' and '%(YASM.ExcludedFromBuild)' != 'true'"> @(YASM, '|') @@ -46,12 +46,16 @@ Condition="'@(YASM)' != '' and '%(YASM.ExcludedFromBuild)' != 'true'" CommandLineTemplate="%(YASM.CommandLineTemplate)" Debug="%(YASM.Debug)" - Defines="%(YASM.Defines)" - IncludePaths="%(YASM.IncludePaths)" - UnDefines="%(YASM.UnDefines)" - ObjectFileName="%(YASM.ObjectFileName)" - ListFileName="%(YASM.ListFileName)" PreIncludeFile="%(YASM.PreIncludeFile)" + IncludePaths="%(YASM.IncludePaths)" + Defines="%(YASM.Defines)" + UnDefines="%(YASM.UnDefines)" + ObjectFile="%(YASM.ObjectFile)" + ListFile="%(YASM.ListFile)" + MapFile="%(YASM.MapFile)" + ErrorFile="%(YASM.ErrorFile)" + SymbolPrefix="%(YASM.SymbolPrefix)" + SymbolSuffix="%(YASM.SymbolSuffix)" PreProc="%(YASM.PreProc)" Parser="%(YASM.Parser)" AdditionalOptions="%(YASM.AdditionalOptions)" @@ -72,8 +76,8 @@ Condition="'@(YASM)' != ''"> + Condition="'@(YASM)' != '' and '%(YASM.ExcludedFromBuild)' != 'true' and !HasTrailingSlash('%(YASM.ObjectFile)')" + Include="%(YASM.ObjectFile)" /> @@ -86,8 +90,8 @@ + Condition="'@(YASM)' != '' and '%(YASM.ExcludedFromBuild)' != 'true' and HasTrailingSlash('%(YASM.ObjectFile)')" + Include="@(YASM->'%(ObjectFile)%(Filename).obj')" /> diff --git a/Mkfiles/vc10/vsyasm.xml b/Mkfiles/vc10/vsyasm.xml index a2170083..9ee43193 100644 --- a/Mkfiles/vc10/vsyasm.xml +++ b/Mkfiles/vc10/vsyasm.xml @@ -5,18 +5,36 @@ PageTemplate="tool" DisplayName="Yasm Assembler" Order="200"> + + + General + + + + Symbols + + + + + + Files + + + @@ -24,7 +42,9 @@ Command Line + + + - + + + + + Switch="-u "[value]"" /> + + + + + + + + + + + + + + + + + + + + + From e55891a3028627ddb52d200f88d56edb99c7c861 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 19 Mar 2010 22:46:16 +0000 Subject: [PATCH 357/585] vsyasm: Fix map extension. svn path=/trunk/yasm/; revision=2308 --- frontends/vsyasm/vsyasm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontends/vsyasm/vsyasm.c b/frontends/vsyasm/vsyasm.c index d903b087..b0ed0f20 100644 --- a/frontends/vsyasm/vsyasm.c +++ b/frontends/vsyasm/vsyasm.c @@ -285,7 +285,7 @@ do_assemble(const char *in_filename) } if (mapdir_pathname) { - fn = replace_extension(base_filename, "lst"); + fn = replace_extension(base_filename, "map"); if (!fn) { print_error(_("could not determine map filename for `%s'"), From e56ece9a7d2f05233460b528fa5d04f46a30b370 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 19 Mar 2010 23:00:36 +0000 Subject: [PATCH 358/585] vsyasm: Allow override of object, list, and map file extensions. svn path=/trunk/yasm/; revision=2309 --- frontends/vsyasm/vsyasm.c | 73 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 70 insertions(+), 3 deletions(-) diff --git a/frontends/vsyasm/vsyasm.c b/frontends/vsyasm/vsyasm.c index b0ed0f20..8c966703 100644 --- a/frontends/vsyasm/vsyasm.c +++ b/frontends/vsyasm/vsyasm.c @@ -48,6 +48,8 @@ /*@null@*/ /*@only@*/ static char *global_prefix = NULL, *global_suffix = NULL; /*@null@*/ /*@only@*/ static char *listdir_pathname = NULL; /*@null@*/ /*@only@*/ static char *mapdir_pathname = NULL; +/*@null@*/ /*@only@*/ static char *objext = NULL; +/*@null@*/ /*@only@*/ static char *listext = NULL, *mapext = NULL; /*@null@*/ /*@only@*/ static char *machine_name = NULL; static int special_options = 0; /*@null@*/ /*@dependent@*/ static const yasm_arch_module * @@ -93,6 +95,9 @@ static int opt_listfmt_handler(char *cmd, /*@null@*/ char *param, int extra); static int opt_listdir_handler(char *cmd, /*@null@*/ char *param, int extra); static int opt_objdir_handler(char *cmd, /*@null@*/ char *param, int extra); static int opt_mapdir_handler(char *cmd, /*@null@*/ char *param, int extra); +static int opt_listext_handler(char *cmd, /*@null@*/ char *param, int extra); +static int opt_objext_handler(char *cmd, /*@null@*/ char *param, int extra); +static int opt_mapext_handler(char *cmd, /*@null@*/ char *param, int extra); static int opt_machine_handler(char *cmd, /*@null@*/ char *param, int extra); static int opt_strict_handler(char *cmd, /*@null@*/ char *param, int extra); static int opt_warning_handler(char *cmd, /*@null@*/ char *param, int extra); @@ -163,6 +168,12 @@ static opt_option options[] = N_("name of object-file output directory"), N_("pathname") }, { 0, "mapdir", 1, opt_mapdir_handler, 0, N_("name of map-file output directory"), N_("pathname") }, + { 0, "listext", 1, opt_listext_handler, 0, + N_("list-file extension (default `lst')"), N_("ext") }, + { 0, "objext", 1, opt_objext_handler, 0, + N_("object-file extension (default is by object format)"), N_("ext") }, + { 0, "mapext", 1, opt_mapext_handler, 0, + N_("map-file extension (default `map')"), N_("ext") }, { 'm', "machine", 1, opt_machine_handler, 0, N_("select machine (list with -m help)"), N_("machine") }, { 0, "force-strict", 0, opt_strict_handler, 0, @@ -262,7 +273,7 @@ do_assemble(const char *in_filename) /* replace (or add) extension to base filename */ yasm__splitpath(in_filename, &base_filename); if (base_filename[0] != '\0') - fn = replace_extension(base_filename, cur_objfmt_module->extension); + fn = replace_extension(base_filename, objext); if (!fn) { print_error(_("could not determine output filename for `%s'"), @@ -273,7 +284,7 @@ do_assemble(const char *in_filename) yasm_xfree(fn); if (listdir_pathname) { - fn = replace_extension(base_filename, "lst"); + fn = replace_extension(base_filename, listext); if (!fn) { print_error(_("could not determine list filename for `%s'"), @@ -285,7 +296,7 @@ do_assemble(const char *in_filename) } if (mapdir_pathname) { - fn = replace_extension(base_filename, "map"); + fn = replace_extension(base_filename, mapext); if (!fn) { print_error(_("could not determine map filename for `%s'"), @@ -682,6 +693,14 @@ main(int argc, char *argv[]) mapdir_pathname[i+1] = '\0'; } + /* If not already specified, set file extensions */ + if (!objext && cur_objfmt_module->extension) + objext = yasm__xstrdup(cur_objfmt_module->extension); + if (!listext) + listext = yasm__xstrdup("lst"); + if (!mapext) + mapext = yasm__xstrdup("map"); + /* Assemble each input file. Terminate on first error. */ STAILQ_FOREACH(infile, &input_files, link) { @@ -750,6 +769,12 @@ cleanup(void) yasm_xfree(listdir_pathname); if (mapdir_pathname) yasm_xfree(mapdir_pathname); + if (objext) + yasm_xfree(objext); + if (listext) + yasm_xfree(listext); + if (mapext) + yasm_xfree(mapext); if (machine_name) yasm_xfree(machine_name); if (objfmt_keyword) @@ -989,6 +1014,48 @@ opt_mapdir_handler(/*@unused@*/ char *cmd, char *param, return 0; } +static int +opt_listext_handler(/*@unused@*/ char *cmd, char *param, + /*@unused@*/ int extra) +{ + if (listext) { + print_error( + _("warning: can set only one list extension, last specified used")); + yasm_xfree(listext); + } + assert(param != NULL); + listext = yasm__xstrdup(param); + return 0; +} + +static int +opt_objext_handler(/*@unused@*/ char *cmd, char *param, + /*@unused@*/ int extra) +{ + if (objext) { + print_error( + _("warning: can set only one object extension, last specified used")); + yasm_xfree(objext); + } + assert(param != NULL); + objext = yasm__xstrdup(param); + return 0; +} + +static int +opt_mapext_handler(/*@unused@*/ char *cmd, char *param, + /*@unused@*/ int extra) +{ + if (mapext) { + print_error( + _("warning: can set only one map extension, last specified used")); + yasm_xfree(mapext); + } + assert(param != NULL); + mapext = yasm__xstrdup(param); + return 0; +} + static int opt_machine_handler(/*@unused@*/ char *cmd, char *param, /*@unused@*/ int extra) From 323153d55a9e88184a5feea6644b61d13fa0d0ec Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 28 Mar 2010 19:28:54 +0000 Subject: [PATCH 359/585] Instead of initializing unknown sections en-masse during objfmt_output(), add new objfmt interface function init_new_section() to initialize as we go. This fixes several issues, primarily with debug formats that create sections. Reported by: Brian Gladman svn path=/trunk/yasm/; revision=2310 --- libyasm/objfmt.h | 15 ++++ libyasm/section.c | 3 + .../tests/passwin64/dwarfwin64_testhd.hex | 48 +++++------ modules/dbgfmts/stabs/tests/stabs-elf.hex | 34 ++++---- modules/objfmts/bin/bin-objfmt.c | 20 ++--- modules/objfmts/coff/coff-objfmt.c | 70 ++++++--------- modules/objfmts/dbg/dbg-objfmt.c | 18 ++-- modules/objfmts/elf/elf-objfmt.c | 86 ++++++------------- modules/objfmts/macho/macho-objfmt.c | 18 ++-- modules/objfmts/rdf/rdf-objfmt.c | 16 ++-- modules/objfmts/xdf/xdf-objfmt.c | 19 ++-- 11 files changed, 153 insertions(+), 194 deletions(-) diff --git a/libyasm/objfmt.h b/libyasm/objfmt.h index d30e75e2..6abba74d 100644 --- a/libyasm/objfmt.h +++ b/libyasm/objfmt.h @@ -108,6 +108,11 @@ struct yasm_objfmt_module { */ yasm_section * (*add_default_section) (yasm_object *object); + /** Module-level implementation of yasm_objfmt_init_new_section(). + * Call yasm_objfmt_init_new_section() instead of calling this function. + */ + void (*init_new_section) (yasm_section *section, unsigned long line); + /** Module-level implementation of yasm_objfmt_section_switch(). * Call yasm_objfmt_section_switch() instead of calling this function. */ @@ -156,6 +161,13 @@ void yasm_objfmt_destroy(/*@only@*/ yasm_objfmt *objfmt); */ yasm_section *yasm_objfmt_add_default_section(yasm_object *object); +/** Initialize the object-format specific portion of a section. Called + * by yasm_object_get_general(); in general should not be directly called. + * \param section section + * \param line virtual line (from yasm_linemap) + */ +void yasm_objfmt_init_new_section(yasm_object *object, unsigned long line); + /** Switch object file sections. The first val of the valparams should * be the section name. Calls yasm_object_get_general() to actually get * the section. @@ -196,6 +208,9 @@ yasm_section *yasm_objfmt_add_default_section(yasm_object *object); #define yasm_objfmt_add_default_section(object) \ ((yasm_objfmt_base *)((object)->objfmt))->module->add_default_section \ (object) +#define yasm_objfmt_init_new_section(section, line) \ + ((yasm_objfmt_base *)((object)->objfmt))->module->init_new_section \ + (section, line) #define yasm_objfmt_get_special_sym(object, name, parser) \ ((yasm_objfmt_base *)((object)->objfmt))->module->get_special_sym \ (object, name, parser) diff --git a/libyasm/section.c b/libyasm/section.c index 3271e391..bb796308 100644 --- a/libyasm/section.c +++ b/libyasm/section.c @@ -346,6 +346,9 @@ yasm_object_get_general(yasm_object *object, const char *name, s->res_only = res_only; s->def = 0; + /* Initialize object format specific data */ + yasm_objfmt_init_new_section(s, line); + *isnew = 1; return s; } diff --git a/modules/dbgfmts/dwarf2/tests/passwin64/dwarfwin64_testhd.hex b/modules/dbgfmts/dwarf2/tests/passwin64/dwarfwin64_testhd.hex index eb9cfe81..114906bf 100644 --- a/modules/dbgfmts/dwarf2/tests/passwin64/dwarfwin64_testhd.hex +++ b/modules/dbgfmts/dwarf2/tests/passwin64/dwarfwin64_testhd.hex @@ -66,8 +66,8 @@ 00 00 00 -04 -01 +00 +00 00 00 00 @@ -106,8 +106,8 @@ c0 00 00 00 -ec -01 +00 +00 00 00 00 @@ -146,8 +146,8 @@ f3 00 00 00 -37 -05 +00 +00 00 00 00 @@ -186,8 +186,8 @@ f3 00 00 00 -d6 -05 +04 +01 00 00 00 @@ -226,8 +226,8 @@ d6 00 00 00 -22 -06 +00 +00 00 00 00 @@ -266,8 +266,8 @@ ce 00 00 00 -6a -06 +50 +01 00 00 00 @@ -306,8 +306,8 @@ c0 00 00 00 -b2 -06 +00 +00 00 00 00 @@ -346,8 +346,8 @@ b2 00 00 00 -bf -08 +00 +00 00 00 00 @@ -386,8 +386,8 @@ bf 00 00 00 -da -08 +00 +00 00 00 00 @@ -426,8 +426,8 @@ da 00 00 00 -0a -09 +00 +00 00 00 00 @@ -466,8 +466,8 @@ aa 00 00 00 -54 -0b +98 +01 00 00 00 @@ -506,8 +506,8 @@ f4 00 00 00 -77 -0b +bb +01 00 00 00 diff --git a/modules/dbgfmts/stabs/tests/stabs-elf.hex b/modules/dbgfmts/stabs/tests/stabs-elf.hex index c2e9e3cf..71cd7c9f 100644 --- a/modules/dbgfmts/stabs/tests/stabs-elf.hex +++ b/modules/dbgfmts/stabs/tests/stabs-elf.hex @@ -599,7 +599,7 @@ c3 00 00 01 -04 +02 00 00 00 @@ -862,6 +862,22 @@ c3 00 f1 ff +69 +00 +00 +00 +3d +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 00 00 00 @@ -894,22 +910,6 @@ ff 00 09 00 -69 -00 -00 -00 -3d -00 -00 -00 -00 -00 -00 -00 -00 -00 -04 -00 00 00 00 diff --git a/modules/objfmts/bin/bin-objfmt.c b/modules/objfmts/bin/bin-objfmt.c index 6f2d14d6..8d3abf8c 100644 --- a/modules/objfmts/bin/bin-objfmt.c +++ b/modules/objfmts/bin/bin-objfmt.c @@ -1388,10 +1388,11 @@ define_section_symbol(yasm_symtab *symtab, yasm_section *sect, yasm_symrec_add_data(sym, &bin_symrec_data_cb, bsymd); } -static bin_section_data * -bin_objfmt_init_new_section(yasm_object *object, yasm_section *sect, - const char *sectname, unsigned long line) +static void +bin_objfmt_init_new_section(yasm_section *sect, unsigned long line) { + yasm_object *object = yasm_section_get_object(sect); + const char *sectname = yasm_section_get_name(sect); /*yasm_objfmt_bin *objfmt_bin = (yasm_objfmt_bin *)object->objfmt;*/ bin_section_data *data; @@ -1414,8 +1415,6 @@ bin_objfmt_init_new_section(yasm_object *object, yasm_section *sect, SSYM_VSTART, line); define_section_symbol(object->symtab, sect, sectname, ".length", SSYM_LENGTH, line); - - return data; } static yasm_section * @@ -1425,10 +1424,8 @@ bin_objfmt_add_default_section(yasm_object *object) int isnew; retval = yasm_object_get_general(object, ".text", 0, 1, 0, &isnew, 0); - if (isnew) { - bin_objfmt_init_new_section(object, retval, ".text", 0); + if (isnew) yasm_section_set_default(retval, 1); - } return retval; } @@ -1568,10 +1565,7 @@ bin_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, retval = yasm_object_get_general(object, sectname, 0, (int)data.code, (int)data.bss, &isnew, line); - if (isnew) - bsd = bin_objfmt_init_new_section(object, retval, sectname, line); - else - bsd = yasm_section_get_data(retval, &bin_section_data_cb); + bsd = yasm_section_get_data(retval, &bin_section_data_cb); if (isnew || yasm_section_is_default(retval)) { yasm_section_set_default(retval, 0); @@ -1820,6 +1814,7 @@ yasm_objfmt_module yasm_bin_LTX_objfmt = { bin_objfmt_output, bin_objfmt_destroy, bin_objfmt_add_default_section, + bin_objfmt_init_new_section, bin_objfmt_section_switch, bin_objfmt_get_special_sym }; @@ -1972,6 +1967,7 @@ yasm_objfmt_module yasm_dosexe_LTX_objfmt = { dosexe_objfmt_output, bin_objfmt_destroy, bin_objfmt_add_default_section, + bin_objfmt_init_new_section, bin_objfmt_section_switch, bin_objfmt_get_special_sym }; diff --git a/modules/objfmts/coff/coff-objfmt.c b/modules/objfmts/coff/coff-objfmt.c index b4191572..7ad087ce 100644 --- a/modules/objfmts/coff/coff-objfmt.c +++ b/modules/objfmts/coff/coff-objfmt.c @@ -369,10 +369,11 @@ win64_objfmt_create(yasm_object *object) return (yasm_objfmt *)objfmt_coff; } -static coff_section_data * -coff_objfmt_init_new_section(yasm_object *object, yasm_section *sect, - const char *sectname, unsigned long line) +static void +coff_objfmt_init_new_section(yasm_section *sect, unsigned long line) { + yasm_object *object = yasm_section_get_object(sect); + const char *sectname = yasm_section_get_name(sect); yasm_objfmt_coff *objfmt_coff = (yasm_objfmt_coff *)object->objfmt; coff_section_data *data; yasm_symrec *sym; @@ -388,6 +389,15 @@ coff_objfmt_init_new_section(yasm_object *object, yasm_section *sect, data->flags2 = 0; data->strtab_name = 0; data->isdebug = 0; + + if (yasm__strncasecmp(sectname, ".debug", 6)==0) { + data->flags = COFF_STYP_DATA; + if (objfmt_coff->win32) + data->flags |= COFF_STYP_DISCARD|COFF_STYP_READ; + data->isdebug = 1; + } else + data->flags = COFF_STYP_TEXT; + yasm_section_add_data(sect, &coff_section_data_cb, data); sym = yasm_symtab_define_label(object->symtab, sectname, @@ -395,31 +405,6 @@ coff_objfmt_init_new_section(yasm_object *object, yasm_section *sect, yasm_symrec_declare(sym, YASM_SYM_GLOBAL, line); coff_objfmt_sym_set_data(sym, COFF_SCL_STAT, 1, COFF_SYMTAB_AUX_SECT); data->sym = sym; - return data; -} - -static int -coff_objfmt_init_remaining_section(yasm_section *sect, /*@null@*/ void *d) -{ - /*@null@*/ coff_objfmt_output_info *info = (coff_objfmt_output_info *)d; - /*@dependent@*/ /*@null@*/ coff_section_data *csd; - - assert(info != NULL); - csd = yasm_section_get_data(sect, &coff_section_data_cb); - if (!csd) { - /* Initialize new one */ - const char *sectname = yasm_section_get_name(sect); - csd = coff_objfmt_init_new_section(info->object, sect, sectname, 0); - if (yasm__strncasecmp(sectname, ".debug", 6)==0) { - csd->flags = COFF_STYP_DATA; - if (info->objfmt_coff->win32) - csd->flags |= COFF_STYP_DISCARD|COFF_STYP_READ; - csd->isdebug = 1; - } else - csd->flags = COFF_STYP_TEXT; - } - - return 0; } static int @@ -1182,12 +1167,6 @@ coff_objfmt_output(yasm_object *object, FILE *f, int all_syms, info.f = f; info.buf = yasm_xmalloc(REGULAR_OUTBUF_SIZE); - /* Initialize section data (and count in parse_scnum) any sections that - * we've not initialized so far. - */ - yasm_object_sections_traverse(object, &info, - coff_objfmt_init_remaining_section); - /* Allocate space for headers by seeking forward */ if (fseek(f, (long)(20+40*(objfmt_coff->parse_scnum-1)), SEEK_SET) < 0) { yasm__fatal(N_("could not seek on output file")); @@ -1288,7 +1267,7 @@ coff_objfmt_add_default_section(yasm_object *object) retval = yasm_object_get_general(object, ".text", 16, 1, 0, &isnew, 0); if (isnew) { - csd = coff_objfmt_init_new_section(object, retval, ".text", 0); + csd = yasm_section_get_data(retval, &coff_section_data_cb); csd->flags = COFF_STYP_TEXT; if (objfmt_coff->win32) csd->flags |= COFF_STYP_EXECUTE | COFF_STYP_READ; @@ -1571,14 +1550,10 @@ coff_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, retval = yasm_object_get_general(object, realname, align, iscode, resonly, &isnew, line); - - if (isnew) - csd = coff_objfmt_init_new_section(object, retval, realname, line); - else - csd = yasm_section_get_data(retval, &coff_section_data_cb); - yasm_xfree(realname); + csd = yasm_section_get_data(retval, &coff_section_data_cb); + if (isnew || yasm_section_is_default(retval)) { yasm_section_set_default(retval, 0); csd->flags = data.flags; @@ -1676,8 +1651,7 @@ dir_export(yasm_object *object, yasm_valparamhead *valparams, /* Initialize directive section if needed */ if (isnew) { coff_section_data *csd; - csd = coff_objfmt_init_new_section(object, sect, - yasm_section_get_name(sect), line); + csd = yasm_section_get_data(sect, &coff_section_data_cb); csd->flags = COFF_STYP_INFO | COFF_STYP_DISCARD | COFF_STYP_READ; } @@ -1724,7 +1698,7 @@ dir_safeseh(yasm_object *object, yasm_valparamhead *valparams, /* Initialize sxdata section if needed */ if (isnew) { coff_section_data *csd; - csd = coff_objfmt_init_new_section(object, sect, ".sxdata", line); + csd = yasm_section_get_data(sect, &coff_section_data_cb); csd->flags = COFF_STYP_INFO; } @@ -2134,7 +2108,7 @@ dir_endproc_frame(yasm_object *object, /*@null@*/ yasm_valparamhead *valparams, /* Initialize xdata section if needed */ if (isnew) { - csd = coff_objfmt_init_new_section(object, sect, ".xdata", line); + csd = yasm_section_get_data(sect, &coff_section_data_cb); csd->flags = COFF_STYP_DATA | COFF_STYP_READ; yasm_section_set_align(sect, 8, line); } @@ -2159,7 +2133,7 @@ dir_endproc_frame(yasm_object *object, /*@null@*/ yasm_valparamhead *valparams, /* Initialize pdata section if needed */ if (isnew) { - csd = coff_objfmt_init_new_section(object, sect, ".pdata", line); + csd = yasm_section_get_data(sect, &coff_section_data_cb); csd->flags = COFF_STYP_DATA | COFF_STYP_READ; csd->flags2 = COFF_FLAG_NOBASE; yasm_section_set_align(sect, 4, line); @@ -2209,6 +2183,7 @@ yasm_objfmt_module yasm_coff_LTX_objfmt = { coff_objfmt_output, coff_objfmt_destroy, coff_objfmt_add_default_section, + coff_objfmt_init_new_section, coff_objfmt_section_switch, coff_objfmt_get_special_sym }; @@ -2261,6 +2236,7 @@ yasm_objfmt_module yasm_win32_LTX_objfmt = { coff_objfmt_output, coff_objfmt_destroy, coff_objfmt_add_default_section, + coff_objfmt_init_new_section, coff_objfmt_section_switch, coff_objfmt_get_special_sym }; @@ -2315,6 +2291,7 @@ yasm_objfmt_module yasm_win64_LTX_objfmt = { coff_objfmt_output, coff_objfmt_destroy, coff_objfmt_add_default_section, + coff_objfmt_init_new_section, coff_objfmt_section_switch, coff_objfmt_get_special_sym }; @@ -2332,6 +2309,7 @@ yasm_objfmt_module yasm_x64_LTX_objfmt = { coff_objfmt_output, coff_objfmt_destroy, coff_objfmt_add_default_section, + coff_objfmt_init_new_section, coff_objfmt_section_switch, coff_objfmt_get_special_sym }; diff --git a/modules/objfmts/dbg/dbg-objfmt.c b/modules/objfmts/dbg/dbg-objfmt.c index 5a71c4f1..a6017f09 100644 --- a/modules/objfmts/dbg/dbg-objfmt.c +++ b/modules/objfmts/dbg/dbg-objfmt.c @@ -89,6 +89,17 @@ dbg_objfmt_destroy(yasm_objfmt *objfmt) yasm_xfree(objfmt); } +static void +dbg_objfmt_init_new_section(yasm_section *sect, unsigned long line) +{ + yasm_object *object = yasm_section_get_object(sect); + yasm_objfmt_dbg *objfmt_dbg = (yasm_objfmt_dbg *)object->objfmt; + fprintf(objfmt_dbg->dbgfile, "init_new_section(\"%s\", %lu)\n", + yasm_section_get_name(sect), line); + yasm_symtab_define_label(object->symtab, ".text", + yasm_section_bcs_first(sect), 1, 0); +} + static yasm_section * dbg_objfmt_add_default_section(yasm_object *object) { @@ -96,11 +107,9 @@ dbg_objfmt_add_default_section(yasm_object *object) yasm_section *retval; int isnew; + fprintf(objfmt_dbg->dbgfile, "add_default_section()\n"); retval = yasm_object_get_general(object, ".text", 0, 0, 0, &isnew, 0); if (isnew) { - fprintf(objfmt_dbg->dbgfile, "(new) "); - yasm_symtab_define_label(object->symtab, ".text", - yasm_section_bcs_first(retval), 1, 0); yasm_section_set_default(retval, 1); } return retval; @@ -132,8 +141,6 @@ dbg_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, &isnew, line); if (isnew) { fprintf(objfmt_dbg->dbgfile, "(new) "); - yasm_symtab_define_label(object->symtab, vp->val, - yasm_section_bcs_first(retval), 1, line); } yasm_section_set_default(retval, 0); fprintf(objfmt_dbg->dbgfile, "\"%s\" section\n", vp->val); @@ -171,6 +178,7 @@ yasm_objfmt_module yasm_dbg_LTX_objfmt = { dbg_objfmt_output, dbg_objfmt_destroy, dbg_objfmt_add_default_section, + dbg_objfmt_init_new_section, dbg_objfmt_section_switch, dbg_objfmt_get_special_sym }; diff --git a/modules/objfmts/elf/elf-objfmt.c b/modules/objfmts/elf/elf-objfmt.c index df5bf233..04bc7baa 100644 --- a/modules/objfmts/elf/elf-objfmt.c +++ b/modules/objfmts/elf/elf-objfmt.c @@ -633,45 +633,6 @@ elf_objfmt_output_bytecode(yasm_bytecode *bc, /*@null@*/ void *d) return 0; } -static int -elf_objfmt_create_dbg_secthead(yasm_section *sect, /*@null@*/ void *d) -{ - /*@null@*/ elf_objfmt_output_info *info = (elf_objfmt_output_info *)d; - elf_secthead *shead; - elf_section_type type=SHT_PROGBITS; - elf_size entsize=0; - const char *sectname; - /*@dependent@*/ yasm_symrec *sym; - elf_strtab_entry *name; - - shead = yasm_section_get_data(sect, &elf_section_data); - if (shead) - return 0; /* only create new secthead if missing */ - - sectname = yasm_section_get_name(sect); - name = elf_strtab_append_str(info->objfmt_elf->shstrtab, sectname); - - if (yasm__strcasecmp(sectname, ".stab")==0) { - entsize = 12; - } else if (yasm__strcasecmp(sectname, ".stabstr")==0) { - type = SHT_STRTAB; - } else if (yasm__strncasecmp(sectname, ".debug_", 7)==0) { - ; - } else - yasm_internal_error(N_("Unrecognized section without data")); - - shead = elf_secthead_create(name, type, 0, 0, 0); - elf_secthead_set_entsize(shead, entsize); - - sym = yasm_symtab_define_label(info->object->symtab, sectname, - yasm_section_bcs_first(sect), 1, 0); - elf_secthead_set_sym(shead, sym); - - yasm_section_add_data(sect, &elf_section_data, shead); - - return 0; -} - static int elf_objfmt_output_section(yasm_section *sect, /*@null@*/ void *d) { @@ -795,11 +756,6 @@ elf_objfmt_output(yasm_object *object, FILE *f, int all_syms, return; } - /* Create missing section headers */ - if (yasm_object_sections_traverse(object, &info, - elf_objfmt_create_dbg_secthead)) - return; - /* add all (local) syms to symtab because relocation needs a symtab index * if all_syms, register them by name. if not, use strtab entry 0 */ buildsym_info.object = object; @@ -925,25 +881,33 @@ elf_objfmt_destroy(yasm_objfmt *objfmt) yasm_xfree(objfmt); } -static elf_secthead * -elf_objfmt_init_new_section(yasm_object *object, yasm_section *sect, - const char *sectname, unsigned long type, - unsigned long flags, unsigned long line) +static void +elf_objfmt_init_new_section(yasm_section *sect, unsigned long line) { + yasm_object *object = yasm_section_get_object(sect); + const char *sectname = yasm_section_get_name(sect); yasm_objfmt_elf *objfmt_elf = (yasm_objfmt_elf *)object->objfmt; elf_secthead *esd; yasm_symrec *sym; elf_strtab_entry *name = elf_strtab_append_str(objfmt_elf->shstrtab, sectname); - esd = elf_secthead_create(name, type, flags, 0, 0); + elf_section_type type=SHT_PROGBITS; + elf_size entsize=0; + + if (yasm__strcasecmp(sectname, ".stab")==0) { + entsize = 12; + } else if (yasm__strcasecmp(sectname, ".stabstr")==0) { + type = SHT_STRTAB; + } + + esd = elf_secthead_create(name, type, 0, 0, 0); + elf_secthead_set_entsize(esd, entsize); yasm_section_add_data(sect, &elf_section_data, esd); sym = yasm_symtab_define_label(object->symtab, sectname, yasm_section_bcs_first(sect), 1, line); elf_secthead_set_sym(esd, sym); - - return esd; } static yasm_section * @@ -951,12 +915,15 @@ elf_objfmt_add_default_section(yasm_object *object) { yasm_section *retval; int isnew; - elf_secthead *esd; retval = yasm_object_get_general(object, ".text", 16, 1, 0, &isnew, 0); - esd = elf_objfmt_init_new_section(object, retval, ".text", SHT_PROGBITS, - SHF_ALLOC + SHF_EXECINSTR, 0); - yasm_section_set_default(retval, 1); + if (isnew) + { + elf_secthead *esd = yasm_section_get_data(retval, &elf_section_data); + elf_secthead_set_typeflags(esd, SHT_PROGBITS, + SHF_ALLOC + SHF_EXECINSTR); + yasm_section_set_default(retval, 1); + } return retval; } @@ -1145,11 +1112,7 @@ elf_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, (data.flags & SHF_EXECINSTR) != 0, resonly, &isnew, line); - if (isnew) - esd = elf_objfmt_init_new_section(object, retval, sectname, data.type, - data.flags, line); - else - esd = yasm_section_get_data(retval, &elf_section_data); + esd = yasm_section_get_data(retval, &elf_section_data); if (isnew || yasm_section_is_default(retval)) { yasm_section_set_default(retval, 0); @@ -1359,6 +1322,7 @@ yasm_objfmt_module yasm_elf_LTX_objfmt = { elf_objfmt_output, elf_objfmt_destroy, elf_objfmt_add_default_section, + elf_objfmt_init_new_section, elf_objfmt_section_switch, elf_objfmt_get_special_sym }; @@ -1377,6 +1341,7 @@ yasm_objfmt_module yasm_elf32_LTX_objfmt = { elf_objfmt_output, elf_objfmt_destroy, elf_objfmt_add_default_section, + elf_objfmt_init_new_section, elf_objfmt_section_switch, elf_objfmt_get_special_sym }; @@ -1395,6 +1360,7 @@ yasm_objfmt_module yasm_elf64_LTX_objfmt = { elf_objfmt_output, elf_objfmt_destroy, elf_objfmt_add_default_section, + elf_objfmt_init_new_section, elf_objfmt_section_switch, elf_objfmt_get_special_sym }; diff --git a/modules/objfmts/macho/macho-objfmt.c b/modules/objfmts/macho/macho-objfmt.c index a57c4c73..5f96571a 100644 --- a/modules/objfmts/macho/macho-objfmt.c +++ b/modules/objfmts/macho/macho-objfmt.c @@ -1242,10 +1242,11 @@ macho_objfmt_destroy(yasm_objfmt *objfmt) yasm_xfree(objfmt); } -static macho_section_data * -macho_objfmt_init_new_section(yasm_object *object, yasm_section *sect, - const char *sectname, unsigned long line) +static void +macho_objfmt_init_new_section(yasm_section *sect, unsigned long line) { + yasm_object *object = yasm_section_get_object(sect); + const char *sectname = yasm_section_get_name(sect); yasm_objfmt_macho *objfmt_macho = (yasm_objfmt_macho *)object->objfmt; macho_section_data *data; yasm_symrec *sym; @@ -1265,7 +1266,6 @@ macho_objfmt_init_new_section(yasm_object *object, yasm_section *sect, sym = yasm_symtab_define_label(object->symtab, sectname, yasm_section_bcs_first(sect), 1, line); data->sym = sym; - return data; } static yasm_section * @@ -1278,7 +1278,7 @@ macho_objfmt_add_default_section(yasm_object *object) retval = yasm_object_get_general(object, "LC_SEGMENT.__TEXT.__text", 0, 1, 0, &isnew, 0); if (isnew) { - msd = macho_objfmt_init_new_section(object, retval, ".text", 0); + msd = yasm_section_get_data(retval, &macho_section_data_cb); msd->segname = yasm__xstrdup("__TEXT"); msd->sectname = yasm__xstrdup("__text"); msd->flags = S_ATTR_PURE_INSTRUCTIONS; @@ -1471,10 +1471,7 @@ macho_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, &isnew, line); yasm_xfree(realname); - if (isnew) - msd = macho_objfmt_init_new_section(object, retval, sectname, line); - else - msd = yasm_section_get_data(retval, &macho_section_data_cb); + msd = yasm_section_get_data(retval, &macho_section_data_cb); if (isnew || yasm_section_is_default(retval)) { yasm_section_set_default(retval, 0); @@ -1564,6 +1561,7 @@ yasm_objfmt_module yasm_macho_LTX_objfmt = { macho_objfmt_output, macho_objfmt_destroy, macho_objfmt_add_default_section, + macho_objfmt_init_new_section, macho_objfmt_section_switch, macho_objfmt_get_special_sym }; @@ -1582,6 +1580,7 @@ yasm_objfmt_module yasm_macho32_LTX_objfmt = { macho_objfmt_output, macho_objfmt_destroy, macho_objfmt_add_default_section, + macho_objfmt_init_new_section, macho_objfmt_section_switch, macho_objfmt_get_special_sym }; @@ -1600,6 +1599,7 @@ yasm_objfmt_module yasm_macho64_LTX_objfmt = { macho_objfmt_output, macho_objfmt_destroy, macho_objfmt_add_default_section, + macho_objfmt_init_new_section, macho_objfmt_section_switch, macho_objfmt_get_special_sym }; diff --git a/modules/objfmts/rdf/rdf-objfmt.c b/modules/objfmts/rdf/rdf-objfmt.c index 8b704a54..69ce08b5 100644 --- a/modules/objfmts/rdf/rdf-objfmt.c +++ b/modules/objfmts/rdf/rdf-objfmt.c @@ -811,10 +811,11 @@ rdf_objfmt_destroy(yasm_objfmt *objfmt) yasm_xfree(objfmt); } -static rdf_section_data * -rdf_objfmt_init_new_section(yasm_object *object, yasm_section *sect, - const char *sectname, unsigned long line) +static void +rdf_objfmt_init_new_section(yasm_section *sect, unsigned long line) { + yasm_object *object = yasm_section_get_object(sect); + const char *sectname = yasm_section_get_name(sect); yasm_objfmt_rdf *objfmt_rdf = (yasm_objfmt_rdf *)object->objfmt; rdf_section_data *data; yasm_symrec *sym; @@ -830,7 +831,6 @@ rdf_objfmt_init_new_section(yasm_object *object, yasm_section *sect, sym = yasm_symtab_define_label(object->symtab, sectname, yasm_section_bcs_first(sect), 1, line); data->sym = sym; - return data; } static yasm_section * @@ -842,7 +842,7 @@ rdf_objfmt_add_default_section(yasm_object *object) retval = yasm_object_get_general(object, ".text", 0, 1, 0, &isnew, 0); if (isnew) { - rsd = rdf_objfmt_init_new_section(object, retval, ".text", 0); + rsd = yasm_section_get_data(retval, &rdf_section_data_cb); rsd->type = RDF_SECT_CODE; rsd->reserved = 0; yasm_section_set_default(retval, 1); @@ -950,10 +950,7 @@ rdf_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, retval = yasm_object_get_general(object, sectname, 0, 1, data.type == RDF_SECT_BSS, &isnew, line); - if (isnew) - rsd = rdf_objfmt_init_new_section(object, retval, sectname, line); - else - rsd = yasm_section_get_data(retval, &rdf_section_data_cb); + rsd = yasm_section_get_data(retval, &rdf_section_data_cb); if (isnew || yasm_section_is_default(retval)) { yasm_section_set_default(retval, 0); @@ -1088,6 +1085,7 @@ yasm_objfmt_module yasm_rdf_LTX_objfmt = { rdf_objfmt_output, rdf_objfmt_destroy, rdf_objfmt_add_default_section, + rdf_objfmt_init_new_section, rdf_objfmt_section_switch, rdf_objfmt_get_special_sym }; diff --git a/modules/objfmts/xdf/xdf-objfmt.c b/modules/objfmts/xdf/xdf-objfmt.c index 8f109d20..c96786b1 100644 --- a/modules/objfmts/xdf/xdf-objfmt.c +++ b/modules/objfmts/xdf/xdf-objfmt.c @@ -604,10 +604,11 @@ xdf_objfmt_destroy(yasm_objfmt *objfmt) yasm_xfree(objfmt); } -static xdf_section_data * -xdf_objfmt_init_new_section(yasm_object *object, yasm_section *sect, - const char *sectname, unsigned long line) +static void +xdf_objfmt_init_new_section(yasm_section *sect, unsigned long line) { + yasm_object *object = yasm_section_get_object(sect); + const char *sectname = yasm_section_get_name(sect); yasm_objfmt_xdf *objfmt_xdf = (yasm_objfmt_xdf *)object->objfmt; xdf_section_data *data; yasm_symrec *sym; @@ -626,21 +627,17 @@ xdf_objfmt_init_new_section(yasm_object *object, yasm_section *sect, sym = yasm_symtab_define_label(object->symtab, sectname, yasm_section_bcs_first(sect), 1, line); data->sym = sym; - return data; } static yasm_section * xdf_objfmt_add_default_section(yasm_object *object) { yasm_section *retval; - xdf_section_data *xsd; int isnew; retval = yasm_object_get_general(object, ".text", 0, 1, 0, &isnew, 0); - if (isnew) { - xsd = xdf_objfmt_init_new_section(object, retval, ".text", 0); + if (isnew) yasm_section_set_default(retval, 1); - } return retval; } @@ -750,10 +747,7 @@ xdf_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, retval = yasm_object_get_general(object, sectname, align, 1, resonly, &isnew, line); - if (isnew) - xsd = xdf_objfmt_init_new_section(object, retval, sectname, line); - else - xsd = yasm_section_get_data(retval, &xdf_section_data_cb); + xsd = yasm_section_get_data(retval, &xdf_section_data_cb); if (isnew || yasm_section_is_default(retval)) { yasm_section_set_default(retval, 0); @@ -847,6 +841,7 @@ yasm_objfmt_module yasm_xdf_LTX_objfmt = { xdf_objfmt_output, xdf_objfmt_destroy, xdf_objfmt_add_default_section, + xdf_objfmt_init_new_section, xdf_objfmt_section_switch, xdf_objfmt_get_special_sym }; From 2de9ac8edef56733c697653616bda00f46a73401 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 8 Apr 2010 03:32:04 +0000 Subject: [PATCH 360/585] NASM preprocessor: Add %scope and %endscope. Contributed by: Mathieu Monnier svn path=/trunk/yasm/; revision=2311 --- modules/preprocs/nasm/nasm-pp.c | 97 ++++++++++++++++--- modules/preprocs/nasm/tests/Makefile.inc | 2 + modules/preprocs/nasm/tests/scope-err.asm | 13 +++ modules/preprocs/nasm/tests/scope-err.errwarn | 6 ++ 4 files changed, 107 insertions(+), 11 deletions(-) create mode 100644 modules/preprocs/nasm/tests/scope-err.asm create mode 100644 modules/preprocs/nasm/tests/scope-err.errwarn diff --git a/modules/preprocs/nasm/nasm-pp.c b/modules/preprocs/nasm/nasm-pp.c index b7c99832..211eca2e 100644 --- a/modules/preprocs/nasm/nasm-pp.c +++ b/modules/preprocs/nasm/nasm-pp.c @@ -63,6 +63,7 @@ struct SMacro { SMacro *next; char *name; + int level; int casesense; int nparam; int in_progress; @@ -276,14 +277,14 @@ static const char *directives[] = { "%elifid", "%elifidn", "%elifidni", "%elifmacro", "%elifnctx", "%elifndef", "%elifnid", "%elifnidn", "%elifnidni", "%elifnmacro", "%elifnnum", "%elifnstr", "%elifnum", "%elifstr", "%else", "%endif", "%endm", "%endmacro", - "%endrep", "%error", "%exitrep", "%iassign", "%idefine", "%if", + "%endrep", "%endscope", "%error", "%exitrep", "%iassign", "%idefine", "%if", "%ifctx", "%ifdef", "%ifid", "%ifidn", "%ifidni", "%ifmacro", "%ifnctx", "%ifndef", "%ifnid", "%ifnidn", "%ifnidni", "%ifnmacro", "%ifnnum", "%ifnstr", "%ifnum", "%ifstr", "%imacro", "%include", "%ixdefine", "%line", "%local", "%macro", "%pop", "%push", "%rep", "%repl", "%rotate", - "%stacksize", + "%scope", "%stacksize", "%strlen", "%substr", "%undef", "%xdefine" }; enum @@ -293,14 +294,14 @@ enum PP_ELIFID, PP_ELIFIDN, PP_ELIFIDNI, PP_ELIFMACRO, PP_ELIFNCTX, PP_ELIFNDEF, PP_ELIFNID, PP_ELIFNIDN, PP_ELIFNIDNI, PP_ELIFNMACRO, PP_ELIFNNUM, PP_ELIFNSTR, PP_ELIFNUM, PP_ELIFSTR, PP_ELSE, PP_ENDIF, PP_ENDM, PP_ENDMACRO, - PP_ENDREP, PP_ERROR, PP_EXITREP, PP_IASSIGN, PP_IDEFINE, PP_IF, + PP_ENDREP, PP_ENDSCOPE, PP_ERROR, PP_EXITREP, PP_IASSIGN, PP_IDEFINE, PP_IF, PP_IFCTX, PP_IFDEF, PP_IFID, PP_IFIDN, PP_IFIDNI, PP_IFMACRO, PP_IFNCTX, PP_IFNDEF, PP_IFNID, PP_IFNIDN, PP_IFNIDNI, PP_IFNMACRO, PP_IFNNUM, PP_IFNSTR, PP_IFNUM, PP_IFSTR, PP_IMACRO, PP_INCLUDE, PP_IXDEFINE, PP_LINE, PP_LOCAL, PP_MACRO, PP_POP, PP_PUSH, PP_REP, PP_REPL, PP_ROTATE, - PP_STACKSIZE, + PP_SCOPE, PP_STACKSIZE, PP_STRLEN, PP_SUBSTR, PP_UNDEF, PP_XDEFINE }; @@ -338,6 +339,7 @@ static int StackSize = 4; static const char *StackPointer = "ebp"; static int ArgOffset = 8; static int LocalOffset = 4; +static int Level = 0; static Context *cstk; @@ -1893,6 +1895,7 @@ smacro_defined(Context * ctx, char *name, int nparam, SMacro ** defn, int nocase) { SMacro *m; + int highest_level = -1; if (ctx) m = ctx->localmac; @@ -1910,8 +1913,9 @@ smacro_defined(Context * ctx, char *name, int nparam, SMacro ** defn, while (m) { if (!mstrcmp(m->name, name, m->casesense && nocase) && - (nparam <= 0 || m->nparam == 0 || nparam == m->nparam)) + (nparam <= 0 || m->nparam == 0 || nparam == m->nparam) && (highest_level < 0 || m->level > highest_level)) { + highest_level = m->level; if (defn) { if (nparam == m->nparam || nparam == -1) @@ -1919,12 +1923,11 @@ smacro_defined(Context * ctx, char *name, int nparam, SMacro ** defn, else *defn = NULL; } - return TRUE; } m = m->next; } - return FALSE; + return highest_level >= 0; } /* @@ -2790,6 +2793,68 @@ do_directive(Token * tline) free_tlist(origline); break; + case PP_SCOPE: + if (tline->next) + error(ERR_WARNING, "trailing garbage after `%%scope' ignored"); + Level++; + free_tlist(origline); + break; + + case PP_ENDSCOPE: + if (tline->next) + error(ERR_WARNING, "trailing garbage after `%%endscope' ignored"); + if (!Level) + error(ERR_NONFATAL, + "`%%endscope': already popped all levels"); + else + { + for (k = 0; k < NHASH; k++) + { + SMacro **smlast = &smacros[k]; + smac = smacros[k]; + while (smac) + { + if (smac->level < Level) + { + smlast = &smac->next; + smac = smac->next; + } + else + { + *smlast = smac->next; + nasm_free(smac->name); + free_tlist(smac->expansion); + nasm_free(smac); + smac = *smlast; + } + } + } + for (ctx = cstk; ctx; ctx = ctx->next) + { + SMacro **smlast = &ctx->localmac; + smac = ctx->localmac; + while (smac) + { + if (smac->level < Level) + { + smlast = &smac->next; + smac = smac->next; + } + else + { + *smlast = smac->next; + nasm_free(smac->name); + free_tlist(smac->expansion); + nasm_free(smac); + smac = *smlast; + } + } + } + Level--; + } + free_tlist(origline); + break; + case PP_ERROR: tline->next = expand_smacro(tline->next); tline = tline->next; @@ -3314,16 +3379,22 @@ do_directive(Token * tline) free_tlist(macro_start); return DIRECTIVE_FOUND; } - else + else if (smac->level == Level) { /* - * We're redefining, so we have to take over an - * existing SMacro structure. This means freeing - * what was already in it. + * We're redefining in the same level, so we have to + * take over an existing SMacro structure. This means + * freeing what was already in it. */ nasm_free(smac->name); free_tlist(smac->expansion); } + else + { + smac = nasm_malloc(sizeof(SMacro)); + smac->next = *smhead; + *smhead = smac; + } } else { @@ -3334,6 +3405,7 @@ do_directive(Token * tline) smac->name = nasm_strdup(mname); smac->casesense = ((i == PP_DEFINE) || (i == PP_XDEFINE)); smac->nparam = nparam; + smac->level = Level; smac->expansion = macro_start; smac->in_progress = FALSE; free_tlist(origline); @@ -3458,6 +3530,7 @@ do_directive(Token * tline) smac->name = nasm_strdup(mname); smac->casesense = (i == PP_STRLEN); smac->nparam = 0; + smac->level = 0; smac->expansion = macro_start; smac->in_progress = FALSE; free_tlist(tline); @@ -3568,6 +3641,7 @@ do_directive(Token * tline) smac->name = nasm_strdup(mname); smac->casesense = (i == PP_SUBSTR); smac->nparam = 0; + smac->level = 0; smac->expansion = macro_start; smac->in_progress = FALSE; free_tlist(tline); @@ -3663,6 +3737,7 @@ do_directive(Token * tline) smac->name = nasm_strdup(mname); smac->casesense = (i == PP_ASSIGN); smac->nparam = 0; + smac->level = 0; smac->expansion = macro_start; smac->in_progress = FALSE; free_tlist(origline); diff --git a/modules/preprocs/nasm/tests/Makefile.inc b/modules/preprocs/nasm/tests/Makefile.inc index 375316ac..8167d08e 100644 --- a/modules/preprocs/nasm/tests/Makefile.inc +++ b/modules/preprocs/nasm/tests/Makefile.inc @@ -22,3 +22,5 @@ EXTRA_DIST += modules/preprocs/nasm/tests/nasmpp-nested.errwarn EXTRA_DIST += modules/preprocs/nasm/tests/nasmpp-nested.hex EXTRA_DIST += modules/preprocs/nasm/tests/orgsect.asm EXTRA_DIST += modules/preprocs/nasm/tests/orgsect.hex +EXTRA_DIST += modules/preprocs/nasm/tests/scope-err.asm +EXTRA_DIST += modules/preprocs/nasm/tests/scope-err.errwarn diff --git a/modules/preprocs/nasm/tests/scope-err.asm b/modules/preprocs/nasm/tests/scope-err.asm new file mode 100644 index 00000000..0359532f --- /dev/null +++ b/modules/preprocs/nasm/tests/scope-err.asm @@ -0,0 +1,13 @@ +%define a b +%error a +%scope +%define a c +%error a +%scope +%define a d +%error a +%endscope +%error a +%endscope +%error a +%endscope diff --git a/modules/preprocs/nasm/tests/scope-err.errwarn b/modules/preprocs/nasm/tests/scope-err.errwarn new file mode 100644 index 00000000..32cea76c --- /dev/null +++ b/modules/preprocs/nasm/tests/scope-err.errwarn @@ -0,0 +1,6 @@ +-:2: warning: b +-:5: warning: c +-:8: warning: d +-:10: warning: c +-:12: warning: b +-:13: error: `%endscope': already popped all levels From bc3a8286ea4033931940742a8dc0b944747e1ce5 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 8 Apr 2010 03:46:43 +0000 Subject: [PATCH 361/585] NASM preproc: Add basic support for %{x:y} parameter list expansion. Contributed by: Mathieu Monnier nasm64developer has a more advanced 3-parameter version that will take some time to integrate, so for now just provide the simpler version. svn path=/trunk/yasm/; revision=2312 --- modules/preprocs/nasm/nasm-pp.c | 209 ++++++++++++++++++++------------ 1 file changed, 129 insertions(+), 80 deletions(-) diff --git a/modules/preprocs/nasm/nasm-pp.c b/modules/preprocs/nasm/nasm-pp.c index 211eca2e..b892a64a 100644 --- a/modules/preprocs/nasm/nasm-pp.c +++ b/modules/preprocs/nasm/nasm-pp.c @@ -3858,105 +3858,51 @@ expand_mmac_params(Token * tline) char *text = NULL; int type = 0, cc; /* type = 0 to placate optimisers */ char tmpbuf[30]; + char *second_text = NULL; int n, i; MMacro *mac; t = tline; tline = tline->next; + second_text = strchr(t->text, ':'); + mac = istk->mstk; while (mac && !mac->name) /* avoid mistaking %reps for macros */ mac = mac->next_active; if (!mac) error(ERR_NONFATAL, "`%s': not in a macro call", t->text); else - switch (t->text[1]) + { + if (second_text) { - /* - * We have to make a substitution of one of the - * forms %1, %-1, %+1, %%foo, %0. - */ - case '0': - type = TOK_NUMBER; - sprintf(tmpbuf, "%ld", mac->nparam); - text = nasm_strdup(tmpbuf); - break; - case '%': - type = TOK_ID; - sprintf(tmpbuf, "..@%lu.", mac->unique); - text = nasm_strcat(tmpbuf, t->text + 2); - break; - case '-': - n = atoi(t->text + 2) - 1; - if (n >= mac->nparam) + int end = atoi(second_text+1)-1; + int is_fst = 1; + int k; + n = atoi(t->text + 1)-1; + if (end < 0) + end += mac->nparam; + + for (k = n; k <= end; k++) + { + if (k >= mac->nparam) tt = NULL; else { if (mac->nparam > 1) - n = (n + mac->rotate) % mac->nparam; - tt = mac->params[n]; - } - cc = find_cc(tt); - if (cc == -1) - { - error(ERR_NONFATAL, - "macro parameter %d is not a condition code", - n + 1); - text = NULL; - } - else - { - type = TOK_ID; - if (inverse_ccs[cc] == -1) - { - error(ERR_NONFATAL, - "condition code `%s' is not invertible", - conditions[cc]); - text = NULL; - } - else - text = - nasm_strdup(conditions[inverse_ccs - [cc]]); - } - break; - case '+': - n = atoi(t->text + 2) - 1; - if (n >= mac->nparam) - tt = NULL; - else - { - if (mac->nparam > 1) - n = (n + mac->rotate) % mac->nparam; - tt = mac->params[n]; - } - cc = find_cc(tt); - if (cc == -1) - { - error(ERR_NONFATAL, - "macro parameter %d is not a condition code", - n + 1); - text = NULL; - } - else - { - type = TOK_ID; - text = nasm_strdup(conditions[cc]); - } - break; - default: - n = atoi(t->text + 1) - 1; - if (n >= mac->nparam) - tt = NULL; - else - { - if (mac->nparam > 1) - n = (n + mac->rotate) % mac->nparam; - tt = mac->params[n]; + k = (k + mac->rotate) % mac->nparam; + tt = mac->params[k]; } if (tt) { - for (i = 0; i < mac->paramlen[n]; i++) + if (!is_fst && mac->paramlen[k]) + { + *tail = new_Token(NULL, TOK_OTHER, ",", 0); + tail = &(*tail)->next; + } + if (mac->paramlen[k]) + is_fst = 0; + for (i = 0; i < mac->paramlen[k]; i++) { *tail = new_Token(NULL, tt->type, tt->text, @@ -3966,8 +3912,111 @@ expand_mmac_params(Token * tline) } } text = NULL; /* we've done it here */ - break; + } } + else + { + switch (t->text[1]) + { + /* + * We have to make a substitution of one of the + * forms %1, %-1, %+1, %%foo, %0. + */ + case '0': + type = TOK_NUMBER; + sprintf(tmpbuf, "%ld", mac->nparam); + text = nasm_strdup(tmpbuf); + break; + case '%': + type = TOK_ID; + sprintf(tmpbuf, "..@%lu.", mac->unique); + text = nasm_strcat(tmpbuf, t->text + 2); + break; + case '-': + n = atoi(t->text + 2) - 1; + if (n >= mac->nparam) + tt = NULL; + else + { + if (mac->nparam > 1) + n = (n + mac->rotate) % mac->nparam; + tt = mac->params[n]; + } + cc = find_cc(tt); + if (cc == -1) + { + error(ERR_NONFATAL, + "macro parameter %d is not a condition code", + n + 1); + text = NULL; + } + else + { + type = TOK_ID; + if (inverse_ccs[cc] == -1) + { + error(ERR_NONFATAL, + "condition code `%s' is not invertible", + conditions[cc]); + text = NULL; + } + else + text = + nasm_strdup(conditions[inverse_ccs + [cc]]); + } + break; + case '+': + n = atoi(t->text + 2) - 1; + if (n >= mac->nparam) + tt = NULL; + else + { + if (mac->nparam > 1) + n = (n + mac->rotate) % mac->nparam; + tt = mac->params[n]; + } + cc = find_cc(tt); + if (cc == -1) + { + error(ERR_NONFATAL, + "macro parameter %d is not a condition code", + n + 1); + text = NULL; + } + else + { + type = TOK_ID; + text = nasm_strdup(conditions[cc]); + } + break; + default: + n = atoi(t->text + 1) - 1; + if (n >= mac->nparam) + tt = NULL; + else + { + if (mac->nparam > 1) + n = (n + mac->rotate) % mac->nparam; + tt = mac->params[n]; + } + if (tt) + { + for (i = 0; i < mac->paramlen[n]; i++) + { + *tail = + new_Token(NULL, tt->type, tt->text, + 0); + tail = &(*tail)->next; + tt = tt->next; + } + } + text = NULL; /* we've done it here */ + break; + } + } + } + if (!text) { delete_Token(t); From e2e877c615cd36a945c0183d8986cb2ecf08a7ee Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 8 Apr 2010 05:56:33 +0000 Subject: [PATCH 362/585] Update copyright dates. svn path=/trunk/yasm/; revision=2313 --- COPYING | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/COPYING b/COPYING index b28d40c9..5eb7340b 100644 --- a/COPYING +++ b/COPYING @@ -1,4 +1,4 @@ -Yasm is Copyright (c) 2001-2009 Peter Johnson and other Yasm developers. +Yasm is Copyright (c) 2001-2010 Peter Johnson and other Yasm developers. Yasm developers and/or contributors include: Peter Johnson From 34379be2ad8201ed298f8697afbe033d6807768b Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 8 Apr 2010 05:57:28 +0000 Subject: [PATCH 363/585] COPYING: Update credits a bit. svn path=/trunk/yasm/; revision=2314 --- COPYING | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/COPYING b/COPYING index 5eb7340b..ddd3c01f 100644 --- a/COPYING +++ b/COPYING @@ -3,9 +3,9 @@ Yasm is Copyright (c) 2001-2010 Peter Johnson and other Yasm developers. Yasm developers and/or contributors include: Peter Johnson Michael Urman - Brian Gladman (VC8 build files, other fixes) + Brian Gladman (Visual Studio build files, other fixes) Stanislav Karchebny (options parser) - Mathieu Monnier (SSE4 instruction patches) + Mathieu Monnier (SSE4 instruction patches, NASM preprocessor additions) Anonymous "NASM64" developer (NASM preprocessor fixes) Stephen Polkowski (x86 instruction patches) Henryk Richter (Mach-O object format) From 4003fa1bc0c69cf7cc08119b7452e3b8c68829cb Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 8 Apr 2010 06:10:16 +0000 Subject: [PATCH 364/585] Update frontend --version copyright dates. svn path=/trunk/yasm/; revision=2317 --- frontends/tasm/tasm.c | 2 +- frontends/yasm/yasm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontends/tasm/tasm.c b/frontends/tasm/tasm.c index 70f9573a..400e1baf 100644 --- a/frontends/tasm/tasm.c +++ b/frontends/tasm/tasm.c @@ -226,7 +226,7 @@ static opt_option options[] = /*@observer@*/ static const char *version_msg[] = { PACKAGE_NAME " " PACKAGE_INTVER "." PACKAGE_BUILD, "Compiled on " __DATE__ ".", - "Copyright (c) 2001-2008 Peter Johnson and other Yasm developers.", + "Copyright (c) 2001-2010 Peter Johnson and other Yasm developers.", "Run yasm --license for licensing overview and summary." }; diff --git a/frontends/yasm/yasm.c b/frontends/yasm/yasm.c index 05d0dfe7..ca049756 100644 --- a/frontends/yasm/yasm.c +++ b/frontends/yasm/yasm.c @@ -215,7 +215,7 @@ static opt_option options[] = /*@observer@*/ static const char *version_msg[] = { PACKAGE_NAME " " PACKAGE_INTVER "." PACKAGE_BUILD, "Compiled on " __DATE__ ".", - "Copyright (c) 2001-2008 Peter Johnson and other Yasm developers.", + "Copyright (c) 2001-2010 Peter Johnson and other Yasm developers.", "Run yasm --license for licensing overview and summary." }; From d5ae19570398116de4d7c31d1a72de771715c138 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 15 May 2010 07:45:48 +0000 Subject: [PATCH 365/585] Fix #202 (incorrect GOT offset generated in NASM mode). Don't generate an additional offset for _GLOBAL_OFFSET_TABLE_ if a WRT was specified (the NASM usage). In GAS, _GLOBAL_OFFSET_TABLE_ doesn't have a WRT but instead has special handling. This isn't quite *exactly* the right fix; a better fix would be to recognize the _GLOBAL_OFFSET_TABLE_ case in the GAS parser and adjust the value appropriately there. However, this fix seems to do the right thing in the meantime for both GAS and NASM cases. svn path=/trunk/yasm/; revision=2321 --- modules/objfmts/elf/elf-x86-x86.c | 13 +------------ modules/objfmts/elf/tests/elfso.hex | 2 +- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/modules/objfmts/elf/elf-x86-x86.c b/modules/objfmts/elf/elf-x86-x86.c index d2fa6d1e..3c5157fe 100644 --- a/modules/objfmts/elf/elf-x86-x86.c +++ b/modules/objfmts/elf/elf-x86-x86.c @@ -140,18 +140,7 @@ elf_x86_x86_handle_reloc_addend(yasm_intnum *intn, elf_reloc_entry *reloc, unsigned long offset) { - int is_GOT = reloc->is_GOT_sym; - - if (reloc->wrt) { - const elf_machine_ssym *ssym = (elf_machine_ssym *) - yasm_symrec_get_data(reloc->wrt, &elf_ssym_symrec_data); - if (!ssym || reloc->valsize != ssym->size) - yasm_internal_error(N_("Unsupported WRT")); - if (ssym->reloc == R_386_GOTPC) - is_GOT = 1; - } - - if (is_GOT && reloc->valsize == 32 && offset != 0) + if (!reloc->wrt && reloc->is_GOT_sym && reloc->valsize == 32 && offset != 0) { yasm_intnum *off_intn = yasm_intnum_create_uint(offset); yasm_intnum_calc(intn, YASM_EXPR_ADD, off_intn); diff --git a/modules/objfmts/elf/tests/elfso.hex b/modules/objfmts/elf/tests/elfso.hex index 94a50cbd..206cce9c 100644 --- a/modules/objfmts/elf/tests/elfso.hex +++ b/modules/objfmts/elf/tests/elfso.hex @@ -88,7 +88,7 @@ e8 5b 81 c3 -05 +03 00 00 00 From 6c7cc8ef767ff45a3a6fb215ff27568a55f0897b Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 16 May 2010 03:14:09 +0000 Subject: [PATCH 366/585] Support all unary operators in directive expressions. svn path=/trunk/yasm/; revision=2322 --- modules/parsers/nasm/nasm-parse.c | 67 ++++++++++--------------------- 1 file changed, 22 insertions(+), 45 deletions(-) diff --git a/modules/parsers/nasm/nasm-parse.c b/modules/parsers/nasm/nasm-parse.c index 0c4820ff..792091e1 100644 --- a/modules/parsers/nasm/nasm-parse.c +++ b/modules/parsers/nasm/nasm-parse.c @@ -1321,47 +1321,7 @@ parse_expr6(yasm_parser_nasm *parser_nasm, expr_type type) yasm_expr *e; yasm_symrec *sym; - /* directives allow very little and handle IDs specially */ - if (type == DIR_EXPR) { - switch (curtok) { - case '~': - get_next_token(); - e = parse_expr6(parser_nasm, type); - if (!e) { - yasm_error_set(YASM_ERROR_SYNTAX, - N_("expected expression after %s"), "`~'"); - return NULL; - } - return p_expr_new_branch(YASM_EXPR_NOT, e); - case '(': - get_next_token(); - e = parse_expr(parser_nasm, type); - if (!e) { - yasm_error_set(YASM_ERROR_SYNTAX, - N_("expected expression after %s"), "`('"); - return NULL; - } - if (!expect(')')) { - yasm_error_set(YASM_ERROR_SYNTAX, N_("missing parenthesis")); - return NULL; - } - get_next_token(); - return e; - case INTNUM: - e = p_expr_new_ident(yasm_expr_int(INTNUM_val)); - break; - case REG: - e = p_expr_new_ident(yasm_expr_reg(REG_val)); - break; - case ID: - sym = yasm_symtab_use(p_symtab, ID_val, cur_line); - e = p_expr_new_ident(yasm_expr_sym(sym)); - yasm_xfree(ID_val); - break; - default: - return NULL; - } - } else switch (curtok) { + switch (curtok) { case '+': get_next_token(); e = parse_expr6(parser_nasm, type); @@ -1437,10 +1397,8 @@ parse_expr6(yasm_parser_nasm *parser_nasm, expr_type type) return e; case INTNUM: e = p_expr_new_ident(yasm_expr_int(INTNUM_val)); - break; - case FLTNUM: - e = p_expr_new_ident(yasm_expr_float(FLTNUM_val)); - break; + get_next_token(); + return e; case REG: if (type == DV_EXPR) { yasm_error_set(YASM_ERROR_SYNTAX, @@ -1448,6 +1406,24 @@ parse_expr6(yasm_parser_nasm *parser_nasm, expr_type type) return NULL; } e = p_expr_new_ident(yasm_expr_reg(REG_val)); + get_next_token(); + return e; + } + + /* directives allow very little and handle IDs specially */ + if (type == DIR_EXPR) { + switch (curtok) { + case ID: + sym = yasm_symtab_use(p_symtab, ID_val, cur_line); + e = p_expr_new_ident(yasm_expr_sym(sym)); + yasm_xfree(ID_val); + break; + default: + return NULL; + } + } else switch (curtok) { + case FLTNUM: + e = p_expr_new_ident(yasm_expr_float(FLTNUM_val)); break; case STRING: { @@ -1498,6 +1474,7 @@ parse_expr6(yasm_parser_nasm *parser_nasm, expr_type type) default: return NULL; } + get_next_token(); return e; } From 104dba1981b5df6363aa69fe3da5cae83b481a30 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 16 May 2010 03:37:00 +0000 Subject: [PATCH 367/585] Fix #201: explicitly ignore [warning] directive and treat as warning. svn path=/trunk/yasm/; revision=2323 --- modules/parsers/nasm/nasm-parse.c | 16 ++++++++++++++++ modules/parsers/nasm/tests/Makefile.inc | 3 +++ modules/parsers/nasm/tests/dirwarning.asm | 1 + modules/parsers/nasm/tests/dirwarning.errwarn | 1 + modules/parsers/nasm/tests/dirwarning.hex | 0 5 files changed, 21 insertions(+) create mode 100644 modules/parsers/nasm/tests/dirwarning.asm create mode 100644 modules/parsers/nasm/tests/dirwarning.errwarn create mode 100644 modules/parsers/nasm/tests/dirwarning.hex diff --git a/modules/parsers/nasm/nasm-parse.c b/modules/parsers/nasm/nasm-parse.c index 792091e1..8cbbe531 100644 --- a/modules/parsers/nasm/nasm-parse.c +++ b/modules/parsers/nasm/nasm-parse.c @@ -339,6 +339,22 @@ parse_line(yasm_parser_nasm *parser_nasm) dirname = DIRECTIVE_NAME_val; get_next_token(); + /* ignore [warning]. TODO: actually implement */ + if (yasm__strcasecmp(dirname, "warning") == 0) { + yasm_warn_set(YASM_WARN_GENERAL, + N_("[warning] directive not supported; ignored")); + + /* throw away the rest of the directive tokens */ + while (!is_eol() && curtok != ']') + { + destroy_curtok(); + get_next_token(); + } + expect(']'); + get_next_token(); + return NULL; + } + if (curtok == ']' || curtok == ':') have_vps = 0; else if (!parse_directive_valparams(parser_nasm, &dir_vps)) { diff --git a/modules/parsers/nasm/tests/Makefile.inc b/modules/parsers/nasm/tests/Makefile.inc index 9a1d5db5..ddf5910b 100644 --- a/modules/parsers/nasm/tests/Makefile.inc +++ b/modules/parsers/nasm/tests/Makefile.inc @@ -9,6 +9,9 @@ EXTRA_DIST += modules/parsers/nasm/tests/alignnop32.asm EXTRA_DIST += modules/parsers/nasm/tests/alignnop32.hex EXTRA_DIST += modules/parsers/nasm/tests/charconstmath.asm EXTRA_DIST += modules/parsers/nasm/tests/charconstmath.hex +EXTRA_DIST += modules/parsers/nasm/tests/dirwarning.asm +EXTRA_DIST += modules/parsers/nasm/tests/dirwarning.errwarn +EXTRA_DIST += modules/parsers/nasm/tests/dirwarning.hex EXTRA_DIST += modules/parsers/nasm/tests/dy.asm EXTRA_DIST += modules/parsers/nasm/tests/dy.hex EXTRA_DIST += modules/parsers/nasm/tests/endcomma.asm diff --git a/modules/parsers/nasm/tests/dirwarning.asm b/modules/parsers/nasm/tests/dirwarning.asm new file mode 100644 index 00000000..265d60a5 --- /dev/null +++ b/modules/parsers/nasm/tests/dirwarning.asm @@ -0,0 +1 @@ +[warning -w] diff --git a/modules/parsers/nasm/tests/dirwarning.errwarn b/modules/parsers/nasm/tests/dirwarning.errwarn new file mode 100644 index 00000000..366c8d66 --- /dev/null +++ b/modules/parsers/nasm/tests/dirwarning.errwarn @@ -0,0 +1 @@ +-:1: warning: [warning] directive not supported; ignored diff --git a/modules/parsers/nasm/tests/dirwarning.hex b/modules/parsers/nasm/tests/dirwarning.hex new file mode 100644 index 00000000..e69de29b From e5b53cf7e6411391c62c3a1e52c3115bc22b5247 Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Mon, 24 May 2010 08:37:45 +0000 Subject: [PATCH 368/585] change vsyasm property sheet to use an absolute path to vsyasm (as msbuild requires) svn path=/trunk/yasm/; revision=2328 --- Mkfiles/vc10/vsyasm.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mkfiles/vc10/vsyasm.props b/Mkfiles/vc10/vsyasm.props index c7a97495..c8f8472e 100644 --- a/Mkfiles/vc10/vsyasm.props +++ b/Mkfiles/vc10/vsyasm.props @@ -15,7 +15,7 @@ $(IntDir) 0 0 - vsyasm -Xvc -f $(Platform) [AllOptions] [AdditionalOptions] [Inputs] + "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\vsyasm" -Xvc -f $(Platform) [AllOptions] [AdditionalOptions] [Inputs] %(ObjectFile) Assembling %(Filename)%(Extension) false From 3a14d898b24de46081335ec79114531c396c72c7 Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Thu, 27 May 2010 08:46:46 +0000 Subject: [PATCH 369/585] correct reported error in vsyasm.xml svn path=/trunk/yasm/; revision=2329 --- Mkfiles/vc10/vsyasm.xml | 3 --- 1 file changed, 3 deletions(-) diff --git a/Mkfiles/vc10/vsyasm.xml b/Mkfiles/vc10/vsyasm.xml index 9ee43193..860bce8d 100644 --- a/Mkfiles/vc10/vsyasm.xml +++ b/Mkfiles/vc10/vsyasm.xml @@ -72,7 +72,6 @@ HelpContext="0" DisplayName="Include Paths" Description="Set the paths for any additional include files" - Separator=";" Switch="-i "[value]"" /> Date: Thu, 27 May 2010 13:26:23 +0000 Subject: [PATCH 370/585] Add an environment variable YASMPATH to override the default vsyasm directory svn path=/trunk/yasm/; revision=2330 --- Mkfiles/vc10/vsyasm.props | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Mkfiles/vc10/vsyasm.props b/Mkfiles/vc10/vsyasm.props index c8f8472e..66308c4c 100644 --- a/Mkfiles/vc10/vsyasm.props +++ b/Mkfiles/vc10/vsyasm.props @@ -9,13 +9,16 @@ _SelectedFiles;$(YASMDependsOn) + + C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\ + False $(IntDir) 0 0 - "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\vsyasm" -Xvc -f $(Platform) [AllOptions] [AdditionalOptions] [Inputs] + "$(YasmPath)"vsyasm.exe -Xvc -f $(Platform) [AllOptions] [AdditionalOptions] [Inputs] %(ObjectFile) Assembling %(Filename)%(Extension) false From af34e08058e366a28bbc2b57601417edffc3deee Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Tue, 8 Jun 2010 16:30:52 +0000 Subject: [PATCH 371/585] svn path=/trunk/yasm/; revision=2331 --- Mkfiles/vc10/genversion/genversion.vcxproj | 4 +-- Mkfiles/vc10/readme.vc10.txt | 40 +++++++++++++--------- Mkfiles/vc10/yasm.sln | 2 +- 3 files changed, 27 insertions(+), 19 deletions(-) diff --git a/Mkfiles/vc10/genversion/genversion.vcxproj b/Mkfiles/vc10/genversion/genversion.vcxproj index 60e2679f..cce7c7fd 100644 --- a/Mkfiles/vc10/genversion/genversion.vcxproj +++ b/Mkfiles/vc10/genversion/genversion.vcxproj @@ -48,7 +48,7 @@ Disabled - ..\..\vc9;%(AdditionalIncludeDirectories) + ..\..\vc10;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true EnableFastChecks @@ -77,7 +77,7 @@ Full - ..\..\vc9;%(AdditionalIncludeDirectories) + ..\..\vc10;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) MultiThreaded diff --git a/Mkfiles/vc10/readme.vc10.txt b/Mkfiles/vc10/readme.vc10.txt index 497495d3..81c79dd0 100644 --- a/Mkfiles/vc10/readme.vc10.txt +++ b/Mkfiles/vc10/readme.vc10.txt @@ -35,39 +35,48 @@ as appropriate to build the YASM binaries that you need. 4. Using YASM with Visual Sudio 2010 and VC++ version 10 -------------------------------------------------------- -1. Firstly you need to locate the directory (or directories) +The YASM version vsyasm.exe is designed specifically for use +with Visual Studio 2010. To tell Visual Studio where to find +vsyasm.exe, the environment variable YASMPATH can be set to +the absolute path to the directory in which vsyasm.exe is +located (this path should include the final backslash). + +Alternatively you can locate the directory (or directories) where the VC++ compiler binaries are located and put copies -of the appropriate yasm.exe binary in these directories. A -typical location is: +of the vsyasm.exe binary in these directories. A typical +location is: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin Depending on your system you can use either the win32 or the -x64 version of YASM. It must be named yasm.exe. +x64 version of vsyasm.exe. It must be named vsyasm.exe. -2. To use the new custom tools facility in Visual Studio 2010, -you need to place a copy of three files - yasm.props, yasm.targets -and yasm.xml - into the MSBUILD customisation directory, which is -typically at: +To use the new custom tools facility in Visual Studio 2010, you +need to place a copy of three files - yasm.props, yasm.targets +and yasm.xml - into the MSBUILD customisation directory, which +is typically at: C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations This allows you to configure YASM as an assembler within the VC++ -IDE. To use YASM in a project, right click on the project in the +IDE. Alternatively, these three files can be placed anywhere and +the build customisation process described later can be used to set +their location. + +To use YASM in a project, right click on the project in the Solution Explorer and select 'Build Customisations..'. This will give you a dialog box that allows you to select YASM as an assembler (note that your assembler files need to have the -extension '.asm'). +extension '.asm'). If you have put the three vsyasm files +described above in a custom location, you will need to let the +dialogue find them using the 'Find Existing' button below the +dialogue. To assemble a file with YASM, select the Property Page for the file and the select 'Yasm Assembler' in the Tool dialog entry. Then click 'Apply' and an additional property page entry will appear and enable YASM settings to be established. -As alternative to placing the yasm.rules files as described -above is to set the rules file path in the Visual Studio 2010 -settings dialogue. - 5. A Linker Issue ----------------- @@ -94,5 +103,4 @@ I am most grateful for the fantastic support that Peter Johnson, YASM's creator, has given me in tracking down issues in using YASM for the production of Windows x64 code. - Brian Gladman, 10th November 2009 - + Brian Gladman, 10th June 2010 diff --git a/Mkfiles/vc10/yasm.sln b/Mkfiles/vc10/yasm.sln index ba248571..76f5df73 100644 --- a/Mkfiles/vc10/yasm.sln +++ b/Mkfiles/vc10/yasm.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 11.00 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{825AC694-358C-4D8D-92DE-33A2691978CE}" ProjectSection(SolutionItems) = preProject crt_secure_no_deprecate.vsprops = crt_secure_no_deprecate.vsprops - readme.vc8.txt = readme.vc8.txt + readme.vc10.txt = readme.vc10.txt EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libyasm", "libyasm\libyasm.vcxproj", "{29FE7874-1256-4AD6-B889-68E399DC9608}" From 1c6ad1742b1970d1691bf4edaa9daf0edb2159b1 Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Tue, 8 Jun 2010 17:12:48 +0000 Subject: [PATCH 372/585] Minor update to the Visual Studio 2010 build files svn path=/trunk/yasm/; revision=2332 --- Mkfiles/vc10/readme.vc10.txt | 41 ++++++++++++++++++++---------------- Mkfiles/vc10/yasm.sln | 6 ++++++ 2 files changed, 29 insertions(+), 18 deletions(-) diff --git a/Mkfiles/vc10/readme.vc10.txt b/Mkfiles/vc10/readme.vc10.txt index 81c79dd0..a390d661 100644 --- a/Mkfiles/vc10/readme.vc10.txt +++ b/Mkfiles/vc10/readme.vc10.txt @@ -38,10 +38,10 @@ as appropriate to build the YASM binaries that you need. The YASM version vsyasm.exe is designed specifically for use with Visual Studio 2010. To tell Visual Studio where to find vsyasm.exe, the environment variable YASMPATH can be set to -the absolute path to the directory in which vsyasm.exe is +the absolute path of the directory in which vsyasm.exe is located (this path should include the final backslash). -Alternatively you can locate the directory (or directories) +Alternatively you can find the directory (or directories) where the VC++ compiler binaries are located and put copies of the vsyasm.exe binary in these directories. A typical location is: @@ -49,28 +49,33 @@ location is: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin Depending on your system you can use either the win32 or the -x64 version of vsyasm.exe. It must be named vsyasm.exe. +x64 version of vsyasm.exe, which must be named vsyasm.exe. To use the new custom tools facility in Visual Studio 2010, you need to place a copy of three files - yasm.props, yasm.targets -and yasm.xml - into the MSBUILD customisation directory, which -is typically at: +and yasm.xml - into a location where they can be found by the +Visual Studio build customisation processes. There are several +ways to do this: -C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations + a. put these files in the MSBUILD customisation directory, + which is typically at: -This allows you to configure YASM as an assembler within the VC++ -IDE. Alternatively, these three files can be placed anywhere and -the build customisation process described later can be used to set -their location. + C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations -To use YASM in a project, right click on the project in the -Solution Explorer and select 'Build Customisations..'. This will -give you a dialog box that allows you to select YASM as an -assembler (note that your assembler files need to have the -extension '.asm'). If you have put the three vsyasm files -described above in a custom location, you will need to let the -dialogue find them using the 'Find Existing' button below the -dialogue. + b. put them in a convenient location and set this path in the + 'Build Customisations Search Path' in the Visual Studio + 'Projects and Solutions|VC++ Project Settings' item in + the 'Tools|Options' menu; + + c. put them in a convenient location and set this path in the + 'Build Customisation dialogue (discussed later). + +To use YASM in a project, right click on the project in the Solution +Explorer and select 'Build Customisations..'. This will give you a +dialog box that allows you to select YASM as an assembler (note that +your assembler files need to have the extension '.asm'). If you have +used option c. above, you will need to let the dialogue find them +using the 'Find Existing' button below the dialogue. To assemble a file with YASM, select the Property Page for the file and the select 'Yasm Assembler' in the Tool dialog entry. diff --git a/Mkfiles/vc10/yasm.sln b/Mkfiles/vc10/yasm.sln index 76f5df73..342bf07b 100644 --- a/Mkfiles/vc10/yasm.sln +++ b/Mkfiles/vc10/yasm.sln @@ -25,8 +25,14 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genstring", "genstring\genstring.vcxproj", "{021CEB0A-F721-4F59-B349-9CEEAF244459}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ytasm", "ytasm.vcxproj", "{2162937B-0DBD-4450-B45F-DF578D8E7508}" + ProjectSection(ProjectDependencies) = postProject + {021CEB0A-F721-4F59-B349-9CEEAF244459} = {021CEB0A-F721-4F59-B349-9CEEAF244459} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vsyasm", "vsyasm.vcxproj", "{7FDD85BB-CC86-442B-A425-989B5B296ED5}" + ProjectSection(ProjectDependencies) = postProject + {021CEB0A-F721-4F59-B349-9CEEAF244459} = {021CEB0A-F721-4F59-B349-9CEEAF244459} + EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution From d190d9dfa598dc7b82f7814c5f7e13438fe0b0ed Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 16 Jun 2010 05:13:23 +0000 Subject: [PATCH 373/585] Fix #206: Update gettext bits to gettext 0.17. svn path=/trunk/yasm/; revision=2333 --- ABOUT-NLS | 1165 +++++++++++++++++++++---------------------- config/config.rpath | 102 +++- m4/gettext.m4 | 42 +- m4/iconv.m4 | 87 +++- m4/lib-link.m4 | 193 ++++--- m4/po.m4 | 25 +- po/ChangeLog | 4 + po/Makefile.in.in | 42 +- 8 files changed, 918 insertions(+), 742 deletions(-) diff --git a/ABOUT-NLS b/ABOUT-NLS index ec20977e..83bc72ec 100644 --- a/ABOUT-NLS +++ b/ABOUT-NLS @@ -101,8 +101,11 @@ codes, stating which languages are allowed. As a user, if your language has been installed for this package, you only have to set the `LANG' environment variable to the appropriate -`LL_CC' combination. Here `LL' is an ISO 639 two-letter language code, -and `CC' is an ISO 3166 two-letter country code. For example, let's +`LL_CC' combination. If you happen to have the `LC_ALL' or some other +`LC_xxx' environment variables set, you should unset them before +setting `LANG', otherwise the setting of `LANG' will not have the +desired effect. Here `LL' is an ISO 639 two-letter language code, and +`CC' is an ISO 3166 two-letter country code. For example, let's suppose that you speak German and live in Germany. At the shell prompt, merely execute `setenv LANG de_DE' (in `csh'), `export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash'). @@ -153,8 +156,7 @@ people who like their own language and write it well, and who are also able to synergize with other translators speaking the same language. Each translation team has its own mailing list. The up-to-date list of teams can be found at the Free Translation Project's homepage, -`http://www.iro.umontreal.ca/contrib/po/HTML/', in the "National teams" -area. +`http://translationproject.org/', in the "Teams" area. If you'd like to volunteer to _work_ at translating messages, you should become a member of the translating team for your own language. @@ -168,8 +170,8 @@ message to `sv-request@li.org', having this message body: _actively_ in translations, or at solving translational difficulties, rather than merely lurking around. If your team does not exist yet and you want to start one, or if you are unsure about what to do or how to -get started, please write to `translation@iro.umontreal.ca' to reach the -coordinator for all translator teams. +get started, please write to `coordinator@translationproject.org' to +reach the coordinator for all translator teams. The English team is special. It works at improving and uniformizing the terminology in use. Proven linguistic skills are praised more than @@ -179,67 +181,62 @@ programming skills, here. ====================== Languages are not equally supported in all packages. The following -matrix shows the current state of internationalization, as of October -2006. The matrix shows, in regard of each package, for which languages +matrix shows the current state of internationalization, as of November +2007. The matrix shows, in regard of each package, for which languages PO files have been submitted to translation coordination, with a translation percentage of at least 50%. Ready PO files af am ar az be bg bs ca cs cy da de el en en_GB eo +----------------------------------------------------+ - GNUnet | [] | + Compendium | [] [] [] [] | a2ps | [] [] [] [] [] | aegis | () | ant-phone | () | anubis | [] | ap-utils | | aspell | [] [] [] [] [] | - bash | [] [] [] | - batchelor | [] | + bash | [] | bfd | | bibshelf | [] | - binutils | [] | + binutils | | bison | [] [] | - bison-runtime | | + bison-runtime | [] | bluez-pin | [] [] [] [] [] | cflow | [] | - clisp | [] [] | + clisp | [] [] [] | console-tools | [] [] | - coreutils | [] [] [] | + coreutils | [] [] [] [] | cpio | | cpplib | [] [] [] | cryptonit | [] | - darkstat | [] () [] | - dialog | [] [] [] [] [] [] | + dialog | | diffutils | [] [] [] [] [] [] | doodle | [] | e2fsprogs | [] [] | enscript | [] [] [] [] | - error | [] [] [] [] | - fetchmail | [] [] () [] | - fileutils | [] [] | - findutils | [] [] [] | + fetchmail | [] [] () [] [] | + findutils | [] | + findutils_stable | [] [] [] | flex | [] [] [] | - fslint | [] | + fslint | | gas | | gawk | [] [] [] | - gbiff | [] | gcal | [] | gcc | [] | gettext-examples | [] [] [] [] [] | gettext-runtime | [] [] [] [] [] | gettext-tools | [] [] | - gimp-print | [] [] [] [] | gip | [] | - gliv | [] | + gliv | [] [] | glunarclock | [] | gmult | [] [] | gnubiff | () | - gnucash | () () [] | - gnucash-glossary | [] () | + gnucash | [] [] () () [] | gnuedu | | - gnulib | [] [] [] [] [] [] | + gnulib | [] | + gnunet | | gnunet-gtk | | - gnutls | | + gnutls | [] | gpe-aerial | [] [] | gpe-beam | [] [] | gpe-calendar | | @@ -260,40 +257,43 @@ translation percentage of at least 50%. gpe-todo | | gphoto2 | [] [] [] [] | gprof | [] [] | - gpsdrive | () () | + gpsdrive | | gramadoir | [] [] | - grep | [] [] [] [] [] [] | - gretl | | + grep | [] [] | + gretl | () | gsasl | | gss | | - gst-plugins | [] [] [] [] | - gst-plugins-base | [] [] [] | - gst-plugins-good | [] [] [] [] [] [] [] | + gst-plugins-bad | [] [] | + gst-plugins-base | [] [] | + gst-plugins-good | [] [] [] | + gst-plugins-ugly | [] [] | gstreamer | [] [] [] [] [] [] [] | gtick | () | - gtkam | [] [] [] | + gtkam | [] [] [] [] | gtkorphan | [] [] | gtkspell | [] [] [] [] | gutenprint | [] | hello | [] [] [] [] [] | - id-utils | [] [] | - impost | | - indent | [] [] [] | - iso_3166 | [] [] | + herrie | [] | + hylafax | | + idutils | [] [] | + indent | [] [] [] [] | + iso_15924 | | + iso_3166 | [] [] [] [] [] [] [] [] [] [] [] | iso_3166_2 | | - iso_4217 | [] | - iso_639 | [] [] | + iso_4217 | [] [] [] | + iso_639 | [] [] [] [] | jpilot | [] | jtag | | jwhois | | kbd | [] [] [] [] | - keytouch | | - keytouch-editor | | - keytouch-keyboa... | | + keytouch | [] [] | + keytouch-editor | [] | + keytouch-keyboa... | [] | latrine | () | ld | [] | leafpad | [] [] [] [] [] | - libc | [] [] [] [] [] | + libc | [] [] [] [] | libexif | [] | libextractor | [] | libgpewidget | [] [] [] | @@ -302,76 +302,70 @@ translation percentage of at least 50%. libgphoto2_port | [] [] | libgsasl | | libiconv | [] [] | - libidn | [] [] | + libidn | [] [] [] | lifelines | [] () | lilypond | [] | lingoteach | | + lprng | | lynx | [] [] [] [] | m4 | [] [] [] [] | + mailfromd | | mailutils | [] | make | [] [] | - man-db | [] () [] [] | + man-db | [] [] [] | minicom | [] [] [] | - mysecretdiary | [] [] | nano | [] [] [] | - nano_1_0 | [] () [] [] | opcodes | [] | - parted | | - pilot-qof | [] | + parted | [] [] | + pilot-qof | | + popt | [] [] [] | psmisc | [] | pwdutils | | - python | | qof | | radius | [] | recode | [] [] [] [] [] [] | - rpm | [] [] | + rpm | [] | screem | | scrollkeeper | [] [] [] [] [] [] [] [] | sed | [] [] [] | - sh-utils | [] [] | - shared-mime-info | [] [] [] [] | + shared-mime-info | [] [] [] [] () [] [] [] | sharutils | [] [] [] [] [] [] | shishi | | - silky | | skencil | [] () | - sketch | [] () | solfege | | soundtracker | [] [] | sp | [] | - stardict | [] | system-tools-ba... | [] [] [] [] [] [] [] [] [] | - tar | [] | + tar | [] [] | texinfo | [] [] [] | - textutils | [] [] [] | tin | () () | - tp-robot | [] | - tuxpaint | [] [] [] [] [] | + tuxpaint | [] [] [] [] [] [] | unicode-han-tra... | | unicode-transla... | | util-linux | [] [] [] [] | - vorbis-tools | [] [] [] [] | + util-linux-ng | [] [] [] [] | + vorbis-tools | [] | wastesedge | () | wdiff | [] [] [] [] | - wget | [] [] | - xchat | [] [] [] [] [] [] | - xkeyboard-config | | - xpad | [] [] | + wget | [] [] [] | + xchat | [] [] [] [] [] [] [] | + xkeyboard-config | [] | + xpad | [] [] [] | +----------------------------------------------------+ af am ar az be bg bs ca cs cy da de el en en_GB eo - 10 0 1 2 9 22 1 42 41 2 60 95 16 1 17 16 + 6 0 2 1 8 26 2 40 48 2 56 88 15 1 15 18 es et eu fa fi fr ga gl gu he hi hr hu id is it +--------------------------------------------------+ - GNUnet | | + Compendium | [] [] [] [] [] | a2ps | [] [] [] () | aegis | | ant-phone | [] | anubis | [] | ap-utils | [] [] | aspell | [] [] [] | - bash | [] [] [] | - batchelor | [] [] | - bfd | [] | + bash | [] | + bfd | [] [] | bibshelf | [] [] [] | binutils | [] [] [] | bison | [] [] [] [] [] [] | @@ -384,36 +378,32 @@ translation percentage of at least 50%. cpio | [] [] [] | cpplib | [] [] | cryptonit | [] | - darkstat | [] () [] [] [] | - dialog | [] [] [] [] [] [] [] [] | + dialog | [] [] [] | diffutils | [] [] [] [] [] [] [] [] [] | doodle | [] [] | e2fsprogs | [] [] [] | enscript | [] [] [] | - error | [] [] [] [] [] | fetchmail | [] | - fileutils | [] [] [] [] [] [] | - findutils | [] [] [] [] | + findutils | [] [] [] | + findutils_stable | [] [] [] [] | flex | [] [] [] | - fslint | [] | + fslint | | gas | [] [] | - gawk | [] [] [] [] | - gbiff | [] | + gawk | [] [] [] [] () | gcal | [] [] | gcc | [] | - gettext-examples | [] [] [] [] [] [] | + gettext-examples | [] [] [] [] [] [] [] | gettext-runtime | [] [] [] [] [] [] | - gettext-tools | [] [] [] | - gimp-print | [] [] | - gip | [] [] [] | + gettext-tools | [] [] [] [] | + gip | [] [] [] [] | gliv | () | glunarclock | [] [] [] | gmult | [] [] [] | gnubiff | () () | gnucash | () () () | - gnucash-glossary | [] [] | gnuedu | [] | - gnulib | [] [] [] [] [] [] [] [] | + gnulib | [] [] [] | + gnunet | | gnunet-gtk | | gnutls | | gpe-aerial | [] [] | @@ -435,68 +425,71 @@ translation percentage of at least 50%. gpe-today | [] [] [] [] | gpe-todo | [] | gphoto2 | [] [] [] [] [] | - gprof | [] [] [] [] | - gpsdrive | () () [] () | + gprof | [] [] [] [] [] | + gpsdrive | [] | gramadoir | [] [] | - grep | [] [] [] [] [] [] [] [] [] [] [] [] | - gretl | [] [] [] | + grep | [] [] [] | + gretl | [] [] [] () | gsasl | [] [] | - gss | [] | - gst-plugins | [] [] [] | - gst-plugins-base | [] [] | - gst-plugins-good | [] [] [] | + gss | [] [] | + gst-plugins-bad | [] [] [] [] | + gst-plugins-base | [] [] [] [] | + gst-plugins-good | [] [] [] [] [] | + gst-plugins-ugly | [] [] [] [] | gstreamer | [] [] [] | - gtick | [] | + gtick | [] [] [] | gtkam | [] [] [] [] | gtkorphan | [] [] | - gtkspell | [] [] [] [] [] [] | + gtkspell | [] [] [] [] [] [] [] | gutenprint | [] | hello | [] [] [] [] [] [] [] [] [] [] [] [] [] | - id-utils | [] [] [] [] [] | - impost | [] [] | + herrie | [] | + hylafax | | + idutils | [] [] [] [] [] | indent | [] [] [] [] [] [] [] [] [] [] | - iso_3166 | [] [] [] | + iso_15924 | [] | + iso_3166 | [] [] [] [] [] [] [] [] [] [] [] [] [] | iso_3166_2 | [] | - iso_4217 | [] [] [] [] | - iso_639 | [] [] [] [] [] | + iso_4217 | [] [] [] [] [] [] | + iso_639 | [] [] [] [] [] [] | jpilot | [] [] | jtag | [] | jwhois | [] [] [] [] [] | kbd | [] [] | - keytouch | [] | + keytouch | [] [] [] | keytouch-editor | [] | - keytouch-keyboa... | [] | - latrine | [] [] [] | - ld | [] [] | + keytouch-keyboa... | [] [] | + latrine | [] [] | + ld | [] [] [] [] | leafpad | [] [] [] [] [] [] | libc | [] [] [] [] [] | libexif | [] | libextractor | [] | libgpewidget | [] [] [] [] [] | - libgpg-error | | + libgpg-error | [] | libgphoto2 | [] [] [] | libgphoto2_port | [] [] | libgsasl | [] [] | - libiconv | [] [] | + libiconv | [] [] [] | libidn | [] [] | lifelines | () | - lilypond | [] | + lilypond | [] [] [] | lingoteach | [] [] [] | + lprng | | lynx | [] [] [] | m4 | [] [] [] [] | + mailfromd | | mailutils | [] [] | make | [] [] [] [] [] [] [] [] | - man-db | () | + man-db | [] | minicom | [] [] [] [] | - mysecretdiary | [] [] [] | - nano | [] [] [] [] [] [] | - nano_1_0 | [] [] [] [] [] | + nano | [] [] [] [] [] [] [] | opcodes | [] [] [] [] | - parted | [] [] [] [] | + parted | [] [] [] | pilot-qof | | - psmisc | [] [] [] | + popt | [] [] [] [] | + psmisc | [] [] | pwdutils | | - python | | qof | [] | radius | [] [] | recode | [] [] [] [] [] [] [] [] | @@ -504,565 +497,539 @@ translation percentage of at least 50%. screem | | scrollkeeper | [] [] [] | sed | [] [] [] [] [] | - sh-utils | [] [] [] [] [] [] [] | shared-mime-info | [] [] [] [] [] [] | sharutils | [] [] [] [] [] [] [] [] | - shishi | | - silky | [] | + shishi | [] | skencil | [] [] | - sketch | [] [] | solfege | [] | soundtracker | [] [] [] | sp | [] | - stardict | [] | - system-tools-ba... | [] [] [] [] [] [] [] [] | - tar | [] [] [] [] [] [] [] | - texinfo | [] [] | - textutils | [] [] [] [] [] | + system-tools-ba... | [] [] [] [] [] [] [] [] [] | + tar | [] [] [] [] [] | + texinfo | [] [] [] | tin | [] () | - tp-robot | [] [] [] [] | tuxpaint | [] [] | unicode-han-tra... | | unicode-transla... | [] [] | util-linux | [] [] [] [] [] [] [] | - vorbis-tools | [] [] | + util-linux-ng | [] [] [] [] [] [] [] | + vorbis-tools | | wastesedge | () | wdiff | [] [] [] [] [] [] [] [] | wget | [] [] [] [] [] [] [] [] | - xchat | [] [] [] [] [] [] [] [] | - xkeyboard-config | [] [] [] [] | + xchat | [] [] [] [] [] [] [] | + xkeyboard-config | [] [] [] [] | xpad | [] [] [] | +--------------------------------------------------+ es et eu fa fi fr ga gl gu he hi hr hu id is it - 88 22 14 2 40 115 61 14 1 8 1 6 59 31 0 52 + 85 22 14 2 48 101 61 12 2 8 2 6 53 29 1 52 - ja ko ku ky lg lt lv mk mn ms mt nb ne nl nn no - +-------------------------------------------------+ - GNUnet | | - a2ps | () [] [] () | - aegis | () | - ant-phone | [] | - anubis | [] [] [] | - ap-utils | [] | - aspell | [] [] | - bash | [] | - batchelor | [] [] | - bfd | | - bibshelf | [] | - binutils | | - bison | [] [] [] | - bison-runtime | [] [] [] | - bluez-pin | [] [] [] | - cflow | | - clisp | [] | - console-tools | | - coreutils | [] | - cpio | | - cpplib | [] | - cryptonit | [] | - darkstat | [] [] | - dialog | [] [] | - diffutils | [] [] [] | - doodle | | - e2fsprogs | [] | - enscript | [] | - error | [] | - fetchmail | [] [] | - fileutils | [] [] | - findutils | [] | - flex | [] [] | - fslint | [] [] | - gas | | - gawk | [] [] | - gbiff | [] | - gcal | | - gcc | | - gettext-examples | [] [] | - gettext-runtime | [] [] [] | - gettext-tools | [] [] | - gimp-print | [] [] | - gip | [] [] | - gliv | [] | - glunarclock | [] [] | - gmult | [] [] | - gnubiff | | - gnucash | () () | - gnucash-glossary | [] | - gnuedu | | - gnulib | [] [] [] [] | - gnunet-gtk | | - gnutls | | - gpe-aerial | [] | - gpe-beam | [] | - gpe-calendar | [] | - gpe-clock | [] [] [] | - gpe-conf | [] [] | - gpe-contacts | [] | - gpe-edit | [] [] [] | - gpe-filemanager | [] [] | - gpe-go | [] [] [] | - gpe-login | [] [] [] | - gpe-ownerinfo | [] [] | - gpe-package | [] [] | - gpe-sketchbook | [] [] | - gpe-su | [] [] [] | - gpe-taskmanager | [] [] [] [] | - gpe-timesheet | [] | - gpe-today | [] [] | - gpe-todo | [] | - gphoto2 | [] [] | - gprof | | - gpsdrive | () () () | - gramadoir | () | - grep | [] [] [] [] | - gretl | | - gsasl | [] | - gss | | - gst-plugins | [] | - gst-plugins-base | | - gst-plugins-good | [] | - gstreamer | [] | - gtick | | - gtkam | [] | - gtkorphan | [] | - gtkspell | [] [] | - gutenprint | | - hello | [] [] [] [] [] [] | - id-utils | [] | - impost | | - indent | [] [] | - iso_3166 | [] | - iso_3166_2 | [] | - iso_4217 | [] [] [] | - iso_639 | [] [] | - jpilot | () () () | - jtag | | - jwhois | [] | - kbd | [] | - keytouch | [] | - keytouch-editor | | - keytouch-keyboa... | | - latrine | [] | - ld | | - leafpad | [] [] | - libc | [] [] [] [] [] | - libexif | | - libextractor | | - libgpewidget | [] | - libgpg-error | | - libgphoto2 | [] | - libgphoto2_port | [] | - libgsasl | [] | - libiconv | | - libidn | [] [] | - lifelines | [] | - lilypond | | - lingoteach | [] | - lynx | [] [] | - m4 | [] [] | - mailutils | | - make | [] [] [] | - man-db | () | - minicom | [] | - mysecretdiary | [] | - nano | [] [] [] | - nano_1_0 | [] [] [] | - opcodes | [] | - parted | [] [] | - pilot-qof | | - psmisc | [] [] [] | - pwdutils | | - python | | - qof | | - radius | | - recode | [] | - rpm | [] [] | - screem | [] | - scrollkeeper | [] [] [] [] | - sed | [] [] | - sh-utils | [] [] | - shared-mime-info | [] [] [] [] [] | - sharutils | [] [] | - shishi | | - silky | [] | - skencil | | - sketch | | - solfege | | - soundtracker | | - sp | () | - stardict | [] [] | - system-tools-ba... | [] [] [] [] | - tar | [] [] [] | - texinfo | [] [] [] | - textutils | [] [] [] | - tin | | - tp-robot | [] | - tuxpaint | [] | - unicode-han-tra... | | - unicode-transla... | | - util-linux | [] [] | - vorbis-tools | [] | - wastesedge | [] | - wdiff | [] [] | - wget | [] [] | - xchat | [] [] [] [] | - xkeyboard-config | [] | - xpad | [] [] [] | - +-------------------------------------------------+ - ja ko ku ky lg lt lv mk mn ms mt nb ne nl nn no - 52 24 2 2 1 3 0 2 3 21 0 15 1 97 5 1 + ja ka ko ku ky lg lt lv mk mn ms mt nb ne nl nn + +--------------------------------------------------+ + Compendium | [] | + a2ps | () [] [] | + aegis | () | + ant-phone | [] | + anubis | [] [] [] | + ap-utils | [] | + aspell | [] [] | + bash | [] | + bfd | | + bibshelf | [] | + binutils | | + bison | [] [] [] | + bison-runtime | [] [] [] | + bluez-pin | [] [] [] | + cflow | | + clisp | [] | + console-tools | | + coreutils | [] | + cpio | [] | + cpplib | [] | + cryptonit | [] | + dialog | [] [] | + diffutils | [] [] [] | + doodle | | + e2fsprogs | [] | + enscript | [] | + fetchmail | [] [] | + findutils | [] | + findutils_stable | [] | + flex | [] [] | + fslint | | + gas | | + gawk | [] [] | + gcal | | + gcc | | + gettext-examples | [] [] [] | + gettext-runtime | [] [] [] | + gettext-tools | [] [] | + gip | [] [] | + gliv | [] | + glunarclock | [] [] | + gmult | [] [] [] | + gnubiff | | + gnucash | () () () | + gnuedu | | + gnulib | [] [] | + gnunet | | + gnunet-gtk | | + gnutls | [] | + gpe-aerial | [] | + gpe-beam | [] | + gpe-calendar | [] | + gpe-clock | [] [] [] | + gpe-conf | [] [] [] | + gpe-contacts | [] | + gpe-edit | [] [] [] | + gpe-filemanager | [] [] | + gpe-go | [] [] [] | + gpe-login | [] [] [] | + gpe-ownerinfo | [] [] | + gpe-package | [] [] | + gpe-sketchbook | [] [] | + gpe-su | [] [] [] | + gpe-taskmanager | [] [] [] [] | + gpe-timesheet | [] | + gpe-today | [] [] | + gpe-todo | [] | + gphoto2 | [] [] | + gprof | [] | + gpsdrive | [] | + gramadoir | () | + grep | [] [] | + gretl | | + gsasl | [] | + gss | | + gst-plugins-bad | [] | + gst-plugins-base | [] | + gst-plugins-good | [] | + gst-plugins-ugly | [] | + gstreamer | [] | + gtick | [] | + gtkam | [] [] | + gtkorphan | [] | + gtkspell | [] [] | + gutenprint | [] | + hello | [] [] [] [] [] [] [] | + herrie | [] | + hylafax | | + idutils | [] | + indent | [] [] | + iso_15924 | [] | + iso_3166 | [] [] [] [] [] [] [] [] | + iso_3166_2 | [] | + iso_4217 | [] [] [] | + iso_639 | [] [] [] [] | + jpilot | () () | + jtag | | + jwhois | [] | + kbd | [] | + keytouch | [] | + keytouch-editor | [] | + keytouch-keyboa... | | + latrine | [] | + ld | | + leafpad | [] [] | + libc | [] [] [] | + libexif | | + libextractor | | + libgpewidget | [] | + libgpg-error | | + libgphoto2 | [] | + libgphoto2_port | [] | + libgsasl | [] | + libiconv | [] | + libidn | [] [] | + lifelines | [] | + lilypond | [] | + lingoteach | [] | + lprng | | + lynx | [] [] | + m4 | [] [] | + mailfromd | | + mailutils | | + make | [] [] [] | + man-db | | + minicom | [] | + nano | [] [] [] | + opcodes | [] | + parted | [] [] | + pilot-qof | | + popt | [] [] [] | + psmisc | [] [] [] | + pwdutils | | + qof | | + radius | | + recode | [] | + rpm | [] [] | + screem | [] | + scrollkeeper | [] [] [] [] | + sed | [] [] | + shared-mime-info | [] [] [] [] [] [] [] | + sharutils | [] [] | + shishi | | + skencil | | + solfege | () () | + soundtracker | | + sp | () | + system-tools-ba... | [] [] [] [] | + tar | [] [] [] | + texinfo | [] [] | + tin | | + tuxpaint | () [] [] | + unicode-han-tra... | | + unicode-transla... | | + util-linux | [] [] | + util-linux-ng | [] [] | + vorbis-tools | | + wastesedge | [] | + wdiff | [] [] | + wget | [] [] | + xchat | [] [] [] [] | + xkeyboard-config | [] [] [] | + xpad | [] [] [] | + +--------------------------------------------------+ + ja ka ko ku ky lg lt lv mk mn ms mt nb ne nl nn + 51 2 25 3 2 0 6 0 2 2 20 0 11 1 103 6 - nso or pa pl pt pt_BR rm ro ru rw sk sl sq sr sv ta - +------------------------------------------------------+ - GNUnet | | - a2ps | () [] [] [] [] [] [] | - aegis | () () | - ant-phone | [] [] | - anubis | [] [] [] | - ap-utils | () | - aspell | [] [] | - bash | [] [] [] | - batchelor | [] [] | - bfd | | - bibshelf | [] | - binutils | [] [] | - bison | [] [] [] [] [] | - bison-runtime | [] [] [] [] | - bluez-pin | [] [] [] [] [] [] [] [] [] | - cflow | [] | - clisp | [] | - console-tools | [] | - coreutils | [] [] [] [] | - cpio | [] [] [] | - cpplib | [] | - cryptonit | [] [] | - darkstat | [] [] [] [] [] [] | - dialog | [] [] [] [] [] [] [] [] [] | - diffutils | [] [] [] [] [] [] | - doodle | [] [] | - e2fsprogs | [] [] | - enscript | [] [] [] [] [] | - error | [] [] [] [] | - fetchmail | [] [] [] | - fileutils | [] [] [] [] [] | - findutils | [] [] [] [] [] [] | - flex | [] [] [] [] [] | - fslint | [] [] [] [] | - gas | | - gawk | [] [] [] [] | - gbiff | [] | - gcal | [] | - gcc | [] | - gettext-examples | [] [] [] [] [] [] [] [] | - gettext-runtime | [] [] [] [] [] [] [] [] | - gettext-tools | [] [] [] [] [] [] [] | - gimp-print | [] [] | - gip | [] [] [] [] | - gliv | [] [] [] [] | - glunarclock | [] [] [] [] [] [] | - gmult | [] [] [] [] | - gnubiff | () | - gnucash | () [] | - gnucash-glossary | [] [] [] | - gnuedu | | - gnulib | [] [] [] [] [] | - gnunet-gtk | [] | - gnutls | [] [] | - gpe-aerial | [] [] [] [] [] [] [] | - gpe-beam | [] [] [] [] [] [] [] | - gpe-calendar | [] | - gpe-clock | [] [] [] [] [] [] [] [] | - gpe-conf | [] [] [] [] [] [] [] | - gpe-contacts | [] [] [] [] [] | - gpe-edit | [] [] [] [] [] [] [] [] | - gpe-filemanager | [] [] | - gpe-go | [] [] [] [] [] [] | - gpe-login | [] [] [] [] [] [] [] [] | - gpe-ownerinfo | [] [] [] [] [] [] [] [] | - gpe-package | [] [] | - gpe-sketchbook | [] [] [] [] [] [] [] [] | - gpe-su | [] [] [] [] [] [] [] [] | - gpe-taskmanager | [] [] [] [] [] [] [] [] | - gpe-timesheet | [] [] [] [] [] [] [] [] | - gpe-today | [] [] [] [] [] [] [] [] | - gpe-todo | [] [] [] [] | - gphoto2 | [] [] [] [] [] | - gprof | [] [] [] | - gpsdrive | [] [] [] | - gramadoir | [] [] | - grep | [] [] [] [] [] [] [] [] | - gretl | [] | - gsasl | [] [] [] | - gss | [] [] [] | - gst-plugins | [] [] [] [] | - gst-plugins-base | [] | - gst-plugins-good | [] [] [] [] | - gstreamer | [] [] [] | - gtick | [] | - gtkam | [] [] [] [] | - gtkorphan | [] | - gtkspell | [] [] [] [] [] [] [] [] | - gutenprint | [] | - hello | [] [] [] [] [] [] [] [] | - id-utils | [] [] [] [] | - impost | [] | - indent | [] [] [] [] [] [] | - iso_3166 | [] [] [] [] [] [] | - iso_3166_2 | | - iso_4217 | [] [] [] [] | - iso_639 | [] [] [] [] | - jpilot | | - jtag | [] | - jwhois | [] [] [] [] | - kbd | [] [] [] | - keytouch | [] | - keytouch-editor | [] | - keytouch-keyboa... | [] | - latrine | [] [] | - ld | [] | - leafpad | [] [] [] [] [] [] | - libc | [] [] [] [] [] | - libexif | [] | - libextractor | [] [] | - libgpewidget | [] [] [] [] [] [] [] | - libgpg-error | [] [] | - libgphoto2 | [] | - libgphoto2_port | [] [] [] | - libgsasl | [] [] [] [] | - libiconv | [] [] | - libidn | [] [] () | - lifelines | [] [] | - lilypond | | - lingoteach | [] | - lynx | [] [] [] | - m4 | [] [] [] [] [] | - mailutils | [] [] [] [] | - make | [] [] [] [] | - man-db | [] [] | - minicom | [] [] [] [] [] | - mysecretdiary | [] [] [] [] | - nano | [] [] [] | - nano_1_0 | [] [] [] [] | - opcodes | [] [] | - parted | [] | - pilot-qof | [] | - psmisc | [] [] | - pwdutils | [] [] | - python | | - qof | [] [] | - radius | [] [] | - recode | [] [] [] [] [] [] [] | - rpm | [] [] [] [] | - screem | | - scrollkeeper | [] [] [] [] [] [] [] | - sed | [] [] [] [] [] [] [] [] [] | - sh-utils | [] [] [] | - shared-mime-info | [] [] [] [] [] | - sharutils | [] [] [] [] | - shishi | [] | - silky | [] | - skencil | [] [] [] | - sketch | [] [] [] | - solfege | [] | - soundtracker | [] [] | - sp | | - stardict | [] [] [] | - system-tools-ba... | [] [] [] [] [] [] [] [] [] | - tar | [] [] [] [] [] | - texinfo | [] [] [] [] | - textutils | [] [] [] | - tin | () | - tp-robot | [] | - tuxpaint | [] [] [] [] [] | - unicode-han-tra... | | - unicode-transla... | | - util-linux | [] [] [] [] | - vorbis-tools | [] [] | - wastesedge | | - wdiff | [] [] [] [] [] [] | - wget | [] [] [] [] | - xchat | [] [] [] [] [] [] [] | - xkeyboard-config | [] [] | - xpad | [] [] [] | - +------------------------------------------------------+ - nso or pa pl pt pt_BR rm ro ru rw sk sl sq sr sv ta - 0 2 3 58 30 54 5 73 72 4 40 46 11 50 128 2 + or pa pl pt pt_BR rm ro ru rw sk sl sq sr sv ta + +--------------------------------------------------+ + Compendium | [] [] [] [] [] | + a2ps | () [] [] [] [] [] [] | + aegis | () () | + ant-phone | [] [] | + anubis | [] [] [] | + ap-utils | () | + aspell | [] [] [] | + bash | [] [] | + bfd | | + bibshelf | [] | + binutils | [] [] | + bison | [] [] [] [] [] | + bison-runtime | [] [] [] [] [] | + bluez-pin | [] [] [] [] [] [] [] [] [] | + cflow | [] | + clisp | [] | + console-tools | [] | + coreutils | [] [] [] [] | + cpio | [] [] [] | + cpplib | [] | + cryptonit | [] [] | + dialog | [] | + diffutils | [] [] [] [] [] [] | + doodle | [] [] | + e2fsprogs | [] [] | + enscript | [] [] [] [] [] | + fetchmail | [] [] [] | + findutils | [] [] [] | + findutils_stable | [] [] [] [] [] [] | + flex | [] [] [] [] [] | + fslint | [] | + gas | | + gawk | [] [] [] [] | + gcal | [] | + gcc | [] [] | + gettext-examples | [] [] [] [] [] [] [] [] | + gettext-runtime | [] [] [] [] [] [] [] [] | + gettext-tools | [] [] [] [] [] [] [] | + gip | [] [] [] [] | + gliv | [] [] [] [] [] [] | + glunarclock | [] [] [] [] [] [] | + gmult | [] [] [] [] | + gnubiff | () [] | + gnucash | () [] | + gnuedu | | + gnulib | [] [] [] | + gnunet | | + gnunet-gtk | [] | + gnutls | [] [] | + gpe-aerial | [] [] [] [] [] [] [] | + gpe-beam | [] [] [] [] [] [] [] | + gpe-calendar | [] [] [] [] | + gpe-clock | [] [] [] [] [] [] [] [] | + gpe-conf | [] [] [] [] [] [] [] | + gpe-contacts | [] [] [] [] [] | + gpe-edit | [] [] [] [] [] [] [] [] [] | + gpe-filemanager | [] [] | + gpe-go | [] [] [] [] [] [] [] [] | + gpe-login | [] [] [] [] [] [] [] [] | + gpe-ownerinfo | [] [] [] [] [] [] [] [] | + gpe-package | [] [] | + gpe-sketchbook | [] [] [] [] [] [] [] [] | + gpe-su | [] [] [] [] [] [] [] [] | + gpe-taskmanager | [] [] [] [] [] [] [] [] | + gpe-timesheet | [] [] [] [] [] [] [] [] | + gpe-today | [] [] [] [] [] [] [] [] | + gpe-todo | [] [] [] [] | + gphoto2 | [] [] [] [] [] [] | + gprof | [] [] [] | + gpsdrive | [] [] | + gramadoir | [] [] | + grep | [] [] [] [] | + gretl | [] [] [] | + gsasl | [] [] [] | + gss | [] [] [] [] | + gst-plugins-bad | [] [] [] | + gst-plugins-base | [] [] | + gst-plugins-good | [] [] | + gst-plugins-ugly | [] [] [] | + gstreamer | [] [] [] [] | + gtick | [] | + gtkam | [] [] [] [] [] | + gtkorphan | [] | + gtkspell | [] [] [] [] [] [] [] [] | + gutenprint | [] | + hello | [] [] [] [] [] [] [] [] | + herrie | [] [] [] | + hylafax | | + idutils | [] [] [] [] [] | + indent | [] [] [] [] [] [] [] | + iso_15924 | | + iso_3166 | [] [] [] [] [] [] [] [] [] [] [] [] [] | + iso_3166_2 | | + iso_4217 | [] [] [] [] [] [] [] | + iso_639 | [] [] [] [] [] [] [] | + jpilot | | + jtag | [] | + jwhois | [] [] [] [] | + kbd | [] [] [] | + keytouch | [] | + keytouch-editor | [] | + keytouch-keyboa... | [] | + latrine | | + ld | [] | + leafpad | [] [] [] [] [] [] | + libc | [] [] [] [] | + libexif | [] [] | + libextractor | [] [] | + libgpewidget | [] [] [] [] [] [] [] [] | + libgpg-error | [] [] [] | + libgphoto2 | [] | + libgphoto2_port | [] [] [] | + libgsasl | [] [] [] [] | + libiconv | [] [] [] | + libidn | [] [] () | + lifelines | [] [] | + lilypond | | + lingoteach | [] | + lprng | [] | + lynx | [] [] [] | + m4 | [] [] [] [] [] | + mailfromd | [] | + mailutils | [] [] [] | + make | [] [] [] [] | + man-db | [] [] [] [] | + minicom | [] [] [] [] [] | + nano | [] [] [] [] | + opcodes | [] [] | + parted | [] | + pilot-qof | | + popt | [] [] [] [] | + psmisc | [] [] | + pwdutils | [] [] | + qof | [] [] | + radius | [] [] | + recode | [] [] [] [] [] [] [] | + rpm | [] [] [] [] | + screem | | + scrollkeeper | [] [] [] [] [] [] [] | + sed | [] [] [] [] [] [] [] [] [] | + shared-mime-info | [] [] [] [] [] [] | + sharutils | [] [] [] [] | + shishi | [] | + skencil | [] [] [] | + solfege | [] | + soundtracker | [] [] | + sp | | + system-tools-ba... | [] [] [] [] [] [] [] [] [] | + tar | [] [] [] [] | + texinfo | [] [] [] [] | + tin | () | + tuxpaint | [] [] [] [] [] [] | + unicode-han-tra... | | + unicode-transla... | | + util-linux | [] [] [] [] | + util-linux-ng | [] [] [] [] | + vorbis-tools | [] | + wastesedge | | + wdiff | [] [] [] [] [] [] [] | + wget | [] [] [] [] | + xchat | [] [] [] [] [] [] [] | + xkeyboard-config | [] [] [] | + xpad | [] [] [] | + +--------------------------------------------------+ + or pa pl pt pt_BR rm ro ru rw sk sl sq sr sv ta + 0 5 77 31 53 4 58 72 3 45 46 9 45 122 3 tg th tk tr uk ven vi wa xh zh_CN zh_HK zh_TW zu +---------------------------------------------------+ - GNUnet | [] | 2 + Compendium | [] [] [] [] | 19 a2ps | [] [] [] | 19 - aegis | | 0 + aegis | [] | 1 ant-phone | [] [] | 6 anubis | [] [] [] | 11 ap-utils | () [] | 4 - aspell | [] [] [] | 15 - bash | [] | 11 - batchelor | [] [] | 9 - bfd | | 1 + aspell | [] [] [] | 16 + bash | [] | 6 + bfd | | 2 bibshelf | [] | 7 - binutils | [] [] [] | 9 - bison | [] [] [] | 19 - bison-runtime | [] [] [] | 15 + binutils | [] [] [] [] | 9 + bison | [] [] [] [] | 20 + bison-runtime | [] [] [] [] | 18 bluez-pin | [] [] [] [] [] [] | 28 cflow | [] [] | 5 - clisp | | 6 + clisp | | 9 console-tools | [] [] | 5 - coreutils | [] [] | 16 - cpio | [] [] [] | 9 - cpplib | [] [] [] [] | 11 - cryptonit | | 5 - darkstat | [] () () | 15 - dialog | [] [] [] [] [] | 30 - diffutils | [] [] [] [] | 28 + coreutils | [] [] [] | 18 + cpio | [] [] [] [] | 11 + cpplib | [] [] [] [] [] | 12 + cryptonit | [] | 6 + dialog | [] [] [] | 9 + diffutils | [] [] [] [] [] | 29 doodle | [] | 6 e2fsprogs | [] [] | 10 enscript | [] [] [] | 16 - error | [] [] [] [] | 18 fetchmail | [] [] | 12 - fileutils | [] [] [] | 18 - findutils | [] [] [] | 17 + findutils | [] [] [] | 11 + findutils_stable | [] [] [] [] | 18 flex | [] [] | 15 - fslint | [] | 9 + fslint | [] | 2 gas | [] | 3 - gawk | [] [] | 15 - gbiff | [] | 5 + gawk | [] [] [] | 16 gcal | [] | 5 - gcc | [] [] [] | 6 - gettext-examples | [] [] [] [] [] [] | 27 + gcc | [] [] [] | 7 + gettext-examples | [] [] [] [] [] [] | 29 gettext-runtime | [] [] [] [] [] [] | 28 - gettext-tools | [] [] [] [] [] | 19 - gimp-print | [] [] | 12 - gip | [] [] | 12 - gliv | [] [] | 8 + gettext-tools | [] [] [] [] [] | 20 + gip | [] [] | 13 + gliv | [] [] | 11 glunarclock | [] [] [] | 15 - gmult | [] [] [] [] | 15 - gnubiff | [] | 1 - gnucash | () | 2 - gnucash-glossary | [] [] | 9 + gmult | [] [] [] [] | 16 + gnubiff | [] | 2 + gnucash | () [] | 5 gnuedu | [] | 2 - gnulib | [] [] [] [] [] | 28 - gnunet-gtk | | 1 - gnutls | | 2 + gnulib | [] | 10 + gnunet | | 0 + gnunet-gtk | [] [] | 3 + gnutls | | 4 gpe-aerial | [] [] | 14 gpe-beam | [] [] | 14 - gpe-calendar | [] | 3 + gpe-calendar | [] [] | 7 gpe-clock | [] [] [] [] | 21 - gpe-conf | [] [] | 14 + gpe-conf | [] [] [] | 16 gpe-contacts | [] [] | 10 - gpe-edit | [] [] [] [] | 20 - gpe-filemanager | [] | 6 - gpe-go | [] [] | 15 + gpe-edit | [] [] [] [] [] | 22 + gpe-filemanager | [] [] | 7 + gpe-go | [] [] [] [] | 19 gpe-login | [] [] [] [] [] | 21 gpe-ownerinfo | [] [] [] [] | 21 gpe-package | [] | 6 gpe-sketchbook | [] [] | 16 - gpe-su | [] [] [] | 20 - gpe-taskmanager | [] [] [] | 20 + gpe-su | [] [] [] [] | 21 + gpe-taskmanager | [] [] [] [] | 21 gpe-timesheet | [] [] [] [] | 18 gpe-today | [] [] [] [] [] | 21 - gpe-todo | [] | 7 - gphoto2 | [] [] [] [] | 20 - gprof | [] [] | 11 - gpsdrive | | 4 + gpe-todo | [] [] | 8 + gphoto2 | [] [] [] [] | 21 + gprof | [] [] | 13 + gpsdrive | [] | 5 gramadoir | [] | 7 - grep | [] [] [] [] | 34 - gretl | | 4 - gsasl | [] [] | 8 - gss | [] | 5 - gst-plugins | [] [] [] | 15 - gst-plugins-base | [] [] [] | 9 - gst-plugins-good | [] [] [] [] [] | 20 - gstreamer | [] [] [] | 17 - gtick | [] | 3 - gtkam | [] | 13 + grep | [] | 12 + gretl | | 6 + gsasl | [] [] [] | 9 + gss | [] | 7 + gst-plugins-bad | [] [] [] | 13 + gst-plugins-base | [] [] | 11 + gst-plugins-good | [] [] [] [] [] | 16 + gst-plugins-ugly | [] [] [] | 13 + gstreamer | [] [] [] | 18 + gtick | [] [] | 7 + gtkam | [] | 16 gtkorphan | [] | 7 - gtkspell | [] [] [] [] [] [] | 26 - gutenprint | | 3 - hello | [] [] [] [] [] | 37 - id-utils | [] [] | 14 - impost | [] | 4 - indent | [] [] [] [] | 25 - iso_3166 | [] [] [] [] | 16 - iso_3166_2 | | 2 - iso_4217 | [] [] | 14 - iso_639 | [] | 14 + gtkspell | [] [] [] [] [] [] | 27 + gutenprint | | 4 + hello | [] [] [] [] [] | 38 + herrie | [] [] | 8 + hylafax | | 0 + idutils | [] [] | 15 + indent | [] [] [] [] [] | 28 + iso_15924 | [] [] | 4 + iso_3166 | [] [] [] [] [] [] [] [] [] | 54 + iso_3166_2 | [] [] | 4 + iso_4217 | [] [] [] [] [] | 24 + iso_639 | [] [] [] [] [] | 26 jpilot | [] [] [] [] | 7 jtag | [] | 3 jwhois | [] [] [] | 13 - kbd | [] [] | 12 - keytouch | [] | 4 - keytouch-editor | | 2 - keytouch-keyboa... | [] | 3 - latrine | [] [] | 8 - ld | [] [] [] [] | 8 - leafpad | [] [] [] [] | 23 - libc | [] [] [] | 23 - libexif | [] | 4 + kbd | [] [] [] | 13 + keytouch | [] | 8 + keytouch-editor | [] | 5 + keytouch-keyboa... | [] | 5 + latrine | [] [] | 5 + ld | [] [] [] [] | 10 + leafpad | [] [] [] [] [] | 24 + libc | [] [] [] | 19 + libexif | [] | 5 libextractor | [] | 5 - libgpewidget | [] [] [] | 19 - libgpg-error | [] | 4 - libgphoto2 | [] | 8 + libgpewidget | [] [] [] | 20 + libgpg-error | [] | 6 + libgphoto2 | [] [] | 9 libgphoto2_port | [] [] [] | 11 libgsasl | [] | 8 - libiconv | [] | 7 - libidn | [] [] | 10 + libiconv | [] [] | 11 + libidn | [] [] | 11 lifelines | | 4 - lilypond | | 2 + lilypond | [] | 6 lingoteach | [] | 6 + lprng | [] | 2 lynx | [] [] [] | 15 m4 | [] [] [] | 18 - mailutils | [] | 8 + mailfromd | [] [] | 3 + mailutils | [] [] | 8 make | [] [] [] | 20 - man-db | [] | 6 + man-db | [] | 9 minicom | [] | 14 - mysecretdiary | [] [] | 12 - nano | [] [] | 17 - nano_1_0 | [] [] [] | 18 + nano | [] [] [] | 20 opcodes | [] [] | 10 - parted | [] [] [] | 10 - pilot-qof | [] | 3 - psmisc | [] | 10 + parted | [] [] [] | 11 + pilot-qof | [] | 1 + popt | [] [] [] [] | 18 + psmisc | [] [] | 10 pwdutils | [] | 3 - python | | 0 qof | [] | 4 - radius | [] | 6 + radius | [] [] | 7 recode | [] [] [] | 25 - rpm | [] [] [] [] | 14 + rpm | [] [] [] [] | 13 screem | [] | 2 scrollkeeper | [] [] [] [] | 26 - sed | [] [] [] | 22 - sh-utils | [] | 15 - shared-mime-info | [] [] [] [] | 24 + sed | [] [] [] [] | 23 + shared-mime-info | [] [] [] | 29 sharutils | [] [] [] | 23 - shishi | | 1 - silky | [] | 4 + shishi | [] | 3 skencil | [] | 7 - sketch | | 6 - solfege | | 2 + solfege | [] | 3 soundtracker | [] [] | 9 sp | [] | 3 - stardict | [] [] [] [] | 11 - system-tools-ba... | [] [] [] [] [] [] [] | 37 - tar | [] [] [] [] | 20 + system-tools-ba... | [] [] [] [] [] [] [] | 38 + tar | [] [] [] | 17 texinfo | [] [] [] | 15 - textutils | [] [] [] | 17 tin | | 1 - tp-robot | [] [] [] | 10 - tuxpaint | [] [] [] | 16 + tuxpaint | [] [] [] | 19 unicode-han-tra... | | 0 unicode-transla... | | 2 util-linux | [] [] [] | 20 - vorbis-tools | [] [] | 11 + util-linux-ng | [] [] [] | 20 + vorbis-tools | [] [] | 4 wastesedge | | 1 - wdiff | [] [] | 22 - wget | [] [] [] | 19 + wdiff | [] [] | 23 + wget | [] [] [] | 20 xchat | [] [] [] [] | 29 - xkeyboard-config | [] [] [] [] | 11 - xpad | [] [] [] | 14 + xkeyboard-config | [] [] [] | 14 + xpad | [] [] [] | 15 +---------------------------------------------------+ - 77 teams tg th tk tr uk ven vi wa xh zh_CN zh_HK zh_TW zu - 170 domains 0 1 1 77 39 0 136 10 1 48 5 54 0 2028 + 76 teams tg th tk tr uk ven vi wa xh zh_CN zh_HK zh_TW zu + 163 domains 0 3 1 74 51 0 143 21 1 57 7 45 0 2036 Some counters in the preceding matrix are higher than the number of visible blocks let us expect. This is because a few extra PO files are @@ -1075,10 +1042,10 @@ distributed as such by its maintainer. There might be an observable lag between the mere existence a PO file and its wide availability in a distribution. - If October 2006 seems to be old, you may fetch a more recent copy of -this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date -matrix with full percentage details can be found at -`http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'. + If November 2007 seems to be old, you may fetch a more recent copy +of this `ABOUT-NLS' file on most GNU archive sites. The most +up-to-date matrix with full percentage details can be found at +`http://translationproject.org/extra/matrix.html'. 1.6 Using `gettext' in new packages =================================== @@ -1096,6 +1063,6 @@ the use of `gettext' the only thing missing are the translations. The Free Translation Project is also available for packages which are not developed inside the GNU project. Therefore the information given above applies also for every other Free Software Project. Contact -`translation@iro.umontreal.ca' to make the `.pot' files available to -the translation teams. +`coordinator@translationproject.org' to make the `.pot' files available +to the translation teams. diff --git a/config/config.rpath b/config/config.rpath index c492a93b..c547c688 100755 --- a/config/config.rpath +++ b/config/config.rpath @@ -2,7 +2,7 @@ # Output a system dependent set of variables, describing how to set the # run time search path of shared libraries in an executable. # -# Copyright 1996-2006 Free Software Foundation, Inc. +# Copyright 1996-2007 Free Software Foundation, Inc. # Taken from GNU libtool, 2001 # Originally by Gordon Matzigkeit , 1996 # @@ -64,7 +64,7 @@ else ;; esac ;; - mingw* | pw32* | os2*) + mingw* | cygwin* | pw32* | os2*) ;; hpux9* | hpux10* | hpux11*) wl='-Wl,' @@ -74,7 +74,7 @@ else ;; newsos6) ;; - linux*) + linux* | k*bsd*-gnu) case $cc_basename in icc* | ecc*) wl='-Wl,' @@ -100,7 +100,7 @@ else osf3* | osf4* | osf5*) wl='-Wl,' ;; - sco3.2v5*) + rdos*) ;; solaris*) wl='-Wl,' @@ -108,11 +108,14 @@ else sunos4*) wl='-Qoption ld ' ;; - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + sysv4 | sysv4.2uw2* | sysv4.3*) wl='-Wl,' ;; sysv4*MP*) ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + wl='-Wl,' + ;; unicos*) wl='-Wl,' ;; @@ -189,11 +192,11 @@ if test "$with_gnu_ld" = yes; then ld_shlibs=no fi ;; - interix3*) + interix[3-9]*) hardcode_direct=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; - linux*) + gnu* | linux* | k*bsd*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else @@ -280,7 +283,7 @@ else strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 - hardcode_direct=yes + : else # We have old collect2 hardcode_direct=unsupported @@ -359,7 +362,7 @@ else hardcode_direct=yes hardcode_minus_L=yes ;; - freebsd* | kfreebsd*-gnu | dragonfly*) + freebsd* | dragonfly*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; @@ -412,18 +415,22 @@ else hardcode_libdir_separator=: ;; openbsd*) - hardcode_direct=yes - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + else + case "$host_os" in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi else - case "$host_os" in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - hardcode_libdir_flag_spec='-R$libdir' - ;; - *) - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - ;; - esac + ld_shlibs=no fi ;; os2*) @@ -471,7 +478,7 @@ else ld_shlibs=yes fi ;; - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) ;; sysv5* | sco3.2v5* | sco5v6*) hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' @@ -488,33 +495,51 @@ fi # Check dynamic linker characteristics # Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER. +# Unlike libtool.m4, here we don't care about _all_ names of the library, but +# only about the one the linker finds when passed -lNAME. This is the last +# element of library_names_spec in libtool.m4, or possibly two of them if the +# linker has special search rules. +library_names_spec= # the last element of library_names_spec in libtool.m4 libname_spec='lib$name' case "$host_os" in aix3*) + library_names_spec='$libname.a' ;; aix4* | aix5*) + library_names_spec='$libname$shrext' ;; amigaos*) + library_names_spec='$libname.a' ;; beos*) + library_names_spec='$libname$shrext' ;; bsdi[45]*) + library_names_spec='$libname$shrext' ;; cygwin* | mingw* | pw32*) shrext=.dll + library_names_spec='$libname.dll.a $libname.lib' ;; darwin* | rhapsody*) shrext=.dylib + library_names_spec='$libname$shrext' ;; dgux*) + library_names_spec='$libname$shrext' ;; freebsd1*) ;; - kfreebsd*-gnu) - ;; freebsd* | dragonfly*) + case "$host_os" in + freebsd[123]*) + library_names_spec='$libname$shrext$versuffix' ;; + *) + library_names_spec='$libname$shrext' ;; + esac ;; gnu*) + library_names_spec='$libname$shrext' ;; hpux9* | hpux10* | hpux11*) case $host_cpu in @@ -528,10 +553,13 @@ case "$host_os" in shrext=.sl ;; esac + library_names_spec='$libname$shrext' ;; - interix3*) + interix[3-9]*) + library_names_spec='$libname$shrext' ;; irix5* | irix6* | nonstopux*) + library_names_spec='$libname$shrext' case "$host_os" in irix5* | nonstopux*) libsuff= shlibsuff= @@ -548,41 +576,59 @@ case "$host_os" in ;; linux*oldld* | linux*aout* | linux*coff*) ;; - linux*) + linux* | k*bsd*-gnu) + library_names_spec='$libname$shrext' ;; knetbsd*-gnu) + library_names_spec='$libname$shrext' ;; netbsd*) + library_names_spec='$libname$shrext' ;; newsos6) + library_names_spec='$libname$shrext' ;; nto-qnx*) + library_names_spec='$libname$shrext' ;; openbsd*) + library_names_spec='$libname$shrext$versuffix' ;; os2*) libname_spec='$name' shrext=.dll + library_names_spec='$libname.a' ;; osf3* | osf4* | osf5*) + library_names_spec='$libname$shrext' + ;; + rdos*) ;; solaris*) + library_names_spec='$libname$shrext' ;; sunos4*) + library_names_spec='$libname$shrext$versuffix' ;; sysv4 | sysv4.3*) + library_names_spec='$libname$shrext' ;; sysv4*MP*) + library_names_spec='$libname$shrext' ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + library_names_spec='$libname$shrext' ;; uts4*) + library_names_spec='$libname$shrext' ;; esac sed_quote_subst='s/\(["`$\\]\)/\\\1/g' escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` shlibext=`echo "$shrext" | sed -e 's,^\.,,'` +escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` +escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <], - [CFPreferencesCopyAppValue(NULL, NULL)], - [gt_cv_func_CFPreferencesCopyAppValue=yes], - [gt_cv_func_CFPreferencesCopyAppValue=no]) - LIBS="$gt_save_LIBS"]) - if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then - AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1, - [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.]) - fi - dnl Check for API introduced in MacOS X 10.3. - AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent, - [gt_save_LIBS="$LIBS" - LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" - AC_TRY_LINK([#include ], [CFLocaleCopyCurrent();], - [gt_cv_func_CFLocaleCopyCurrent=yes], - [gt_cv_func_CFLocaleCopyCurrent=no]) - LIBS="$gt_save_LIBS"]) - if test $gt_cv_func_CFLocaleCopyCurrent = yes; then - AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1, - [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.]) - fi - INTL_MACOSX_LIBS= - if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then - INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" - fi - AC_SUBST([INTL_MACOSX_LIBS]) -]) - - dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized. m4_define([gt_NEEDS_INIT], [ diff --git a/m4/iconv.m4 b/m4/iconv.m4 index 654c4158..66bc76f4 100644 --- a/m4/iconv.m4 +++ b/m4/iconv.m4 @@ -1,5 +1,5 @@ -# iconv.m4 serial AM4 (gettext-0.11.3) -dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. +# iconv.m4 serial AM6 (gettext-0.17) +dnl Copyright (C) 2000-2002, 2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -21,6 +21,7 @@ AC_DEFUN([AM_ICONV_LINK], [ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and dnl those with the standalone portable GNU libiconv installed). + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. @@ -33,7 +34,7 @@ AC_DEFUN([AM_ICONV_LINK], am_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) - AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ + AC_CACHE_CHECK([for iconv], am_cv_func_iconv, [ am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no AC_TRY_LINK([#include @@ -56,7 +57,85 @@ AC_DEFUN([AM_ICONV_LINK], fi ]) if test "$am_cv_func_iconv" = yes; then - AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) + AC_CACHE_CHECK([for working iconv], am_cv_func_iconv_works, [ + dnl This tests against bugs in AIX 5.1 and HP-UX 11.11. + am_save_LIBS="$LIBS" + if test $am_cv_lib_iconv = yes; then + LIBS="$LIBS $LIBICONV" + fi + AC_TRY_RUN([ +#include +#include +int main () +{ + /* Test against AIX 5.1 bug: Failures are not distinguishable from successful + returns. */ + { + iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); + if (cd_utf8_to_88591 != (iconv_t)(-1)) + { + static const char input[] = "\342\202\254"; /* EURO SIGN */ + char buf[10]; + const char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_utf8_to_88591, + (char **) &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + return 1; + } + } +#if 0 /* This bug could be worked around by the caller. */ + /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; + char buf[50]; + const char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_88591_to_utf8, + (char **) &inptr, &inbytesleft, + &outptr, &outbytesleft); + if ((int)res > 0) + return 1; + } + } +#endif + /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is + provided. */ + if (/* Try standardized names. */ + iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) + /* Try IRIX, OSF/1 names. */ + && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) + /* Try AIX names. */ + && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) + /* Try HP-UX names. */ + && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) + return 1; + return 0; +}], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no], + [case "$host_os" in + aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; + *) am_cv_func_iconv_works="guessing yes" ;; + esac]) + LIBS="$am_save_LIBS" + ]) + case "$am_cv_func_iconv_works" in + *no) am_func_iconv=no am_cv_lib_iconv=no ;; + *) am_func_iconv=yes ;; + esac + else + am_func_iconv=no am_cv_lib_iconv=no + fi + if test "$am_func_iconv" = yes; then + AC_DEFINE(HAVE_ICONV, 1, + [Define if you have the iconv() function and it works.]) fi if test "$am_cv_lib_iconv" = yes; then AC_MSG_CHECKING([how to link with libiconv]) diff --git a/m4/lib-link.m4 b/m4/lib-link.m4 index f95b7ba8..e3d26fc4 100644 --- a/m4/lib-link.m4 +++ b/m4/lib-link.m4 @@ -1,17 +1,19 @@ -# lib-link.m4 serial 9 (gettext-0.16) -dnl Copyright (C) 2001-2006 Free Software Foundation, Inc. +# lib-link.m4 serial 13 (gettext-0.17) +dnl Copyright (C) 2001-2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. -AC_PREREQ(2.50) +AC_PREREQ(2.54) dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and dnl augments the CPPFLAGS variable. +dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname +dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_LINKFLAGS], [ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) @@ -24,13 +26,16 @@ AC_DEFUN([AC_LIB_LINKFLAGS], ac_cv_lib[]Name[]_libs="$LIB[]NAME" ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" ac_cv_lib[]Name[]_cppflags="$INC[]NAME" + ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX" ]) LIB[]NAME="$ac_cv_lib[]Name[]_libs" LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" INC[]NAME="$ac_cv_lib[]Name[]_cppflags" + LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) AC_SUBST([LIB]NAME) AC_SUBST([LTLIB]NAME) + AC_SUBST([LIB]NAME[_PREFIX]) dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the dnl results of this search when this library appears as a dependency. HAVE_LIB[]NAME=yes @@ -46,6 +51,8 @@ dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. +dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname +dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], [ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) @@ -82,17 +89,23 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], CPPFLAGS="$ac_save_CPPFLAGS" LIB[]NAME= LTLIB[]NAME= + LIB[]NAME[]_PREFIX= fi AC_SUBST([HAVE_LIB]NAME) AC_SUBST([LIB]NAME) AC_SUBST([LTLIB]NAME) + AC_SUBST([LIB]NAME[_PREFIX]) undefine([Name]) undefine([NAME]) ]) dnl Determine the platform dependent parameters needed to use rpath: -dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator, -dnl hardcode_direct, hardcode_minus_L. +dnl acl_libext, +dnl acl_shlibext, +dnl acl_hardcode_libdir_flag_spec, +dnl acl_hardcode_libdir_separator, +dnl acl_hardcode_direct, +dnl acl_hardcode_minus_L. AC_DEFUN([AC_LIB_RPATH], [ dnl Tell automake >= 1.10 to complain if config.rpath is missing. @@ -109,12 +122,14 @@ AC_DEFUN([AC_LIB_RPATH], acl_cv_rpath=done ]) wl="$acl_cv_wl" - libext="$acl_cv_libext" - shlibext="$acl_cv_shlibext" - hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" - hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" - hardcode_direct="$acl_cv_hardcode_direct" - hardcode_minus_L="$acl_cv_hardcode_minus_L" + acl_libext="$acl_cv_libext" + acl_shlibext="$acl_cv_shlibext" + acl_libname_spec="$acl_cv_libname_spec" + acl_library_names_spec="$acl_cv_library_names_spec" + acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + acl_hardcode_direct="$acl_cv_hardcode_direct" + acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" dnl Determine whether the user wants rpath handling at all. AC_ARG_ENABLE(rpath, [ --disable-rpath do not hardcode runtime library paths], @@ -124,20 +139,24 @@ AC_DEFUN([AC_LIB_RPATH], dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. +dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found +dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_LINKFLAGS_BODY], [ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + dnl Autoconf >= 2.61 supports dots in --with options. + define([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit([$1],[.],[_])],[$1])]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) - AC_LIB_ARG_WITH([lib$1-prefix], -[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib - --without-lib$1-prefix don't search for lib$1 in includedir and libdir], + AC_LIB_ARG_WITH([lib]N_A_M_E[-prefix], +[ --with-lib]N_A_M_E[-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib + --without-lib]N_A_M_E[-prefix don't search for lib$1 in includedir and libdir], [ if test "X$withval" = "Xno"; then use_additional=no @@ -158,6 +177,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], LIB[]NAME= LTLIB[]NAME= INC[]NAME= + LIB[]NAME[]_PREFIX= rpathdirs= ltrpathdirs= names_already_handled= @@ -197,29 +217,55 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], found_la= found_so= found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi if test $use_additional = yes; then - if test -n "$shlibext" \ - && { test -f "$additional_libdir/lib$name.$shlibext" \ - || { test "$shlibext" = dll \ - && test -f "$additional_libdir/lib$name.dll.a"; }; }; then - found_dir="$additional_libdir" - if test -f "$additional_libdir/lib$name.$shlibext"; then - found_so="$additional_libdir/lib$name.$shlibext" + dir="$additional_libdir" + dnl The same code as in the loop below: + dnl First look for a shared library. + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" else - found_so="$additional_libdir/lib$name.dll.a" - fi - if test -f "$additional_libdir/lib$name.la"; then - found_la="$additional_libdir/lib$name.la" - fi - else - if test -f "$additional_libdir/lib$name.$libext"; then - found_dir="$additional_libdir" - found_a="$additional_libdir/lib$name.$libext" - if test -f "$additional_libdir/lib$name.la"; then - found_la="$additional_libdir/lib$name.la" + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done fi fi fi + dnl Then look for a static library. + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIB[]NAME; do @@ -227,28 +273,46 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` - if test -n "$shlibext" \ - && { test -f "$dir/lib$name.$shlibext" \ - || { test "$shlibext" = dll \ - && test -f "$dir/lib$name.dll.a"; }; }; then - found_dir="$dir" - if test -f "$dir/lib$name.$shlibext"; then - found_so="$dir/lib$name.$shlibext" - else - found_so="$dir/lib$name.dll.a" - fi - if test -f "$dir/lib$name.la"; then - found_la="$dir/lib$name.la" - fi - else - if test -f "$dir/lib$name.$libext"; then + dnl First look for a shared library. + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then found_dir="$dir" - found_a="$dir/lib$name.$libext" - if test -f "$dir/lib$name.la"; then - found_la="$dir/lib$name.la" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done fi fi fi + dnl Then look for a static library. + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi ;; esac if test "X$found_dir" != "X"; then @@ -282,12 +346,12 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], ltrpathdirs="$ltrpathdirs $found_dir" fi dnl The hardcoding into $LIBNAME is system dependent. - if test "$hardcode_direct" = yes; then + if test "$acl_hardcode_direct" = yes; then dnl Using DIR/libNAME.so during linking hardcodes DIR into the dnl resulting binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else - if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then dnl Use an explicit option to hardcode DIR into the resulting dnl binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" @@ -318,13 +382,13 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], if test -z "$haveit"; then LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" fi - if test "$hardcode_minus_L" != no; then + if test "$acl_hardcode_minus_L" != no; then dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else - dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH + dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH dnl here, because this doesn't fit in flags passed to the dnl compiler. So give up. No hardcoding. This affects only dnl very old systems. @@ -351,6 +415,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + LIB[]NAME[]_PREFIX="$basedir" additional_includedir="$basedir/include" ;; esac @@ -512,18 +577,18 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], done done if test "X$rpathdirs" != "X"; then - if test -n "$hardcode_libdir_separator"; then + if test -n "$acl_hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user must dnl pass all path elements in one option. We can arrange that for a dnl single library, but not when more than one $LIBNAMEs are used. alldirs= for found_dir in $rpathdirs; do - alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done - dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl. + dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl. acl_save_libdir="$libdir" libdir="$alldirs" - eval flag=\"$hardcode_libdir_flag_spec\" + eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" else @@ -531,7 +596,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" - eval flag=\"$hardcode_libdir_flag_spec\" + eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" done @@ -580,7 +645,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) $1= if test "$enable_rpath" != no; then - if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then dnl Use an explicit option to hardcode directories into the resulting dnl binary. rpathdirs= @@ -614,16 +679,16 @@ AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], done else dnl The linker is used for linking directly. - if test -n "$hardcode_libdir_separator"; then + if test -n "$acl_hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user dnl must pass all path elements in one option. alldirs= for dir in $rpathdirs; do - alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$dir" + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir" done acl_save_libdir="$libdir" libdir="$alldirs" - eval flag=\"$hardcode_libdir_flag_spec\" + eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" $1="$flag" else @@ -631,7 +696,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], for dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$dir" - eval flag=\"$hardcode_libdir_flag_spec\" + eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" $1="${$1}${$1:+ }$flag" done diff --git a/m4/po.m4 b/m4/po.m4 index 00133ef3..0734762a 100644 --- a/m4/po.m4 +++ b/m4/po.m4 @@ -1,5 +1,5 @@ -# po.m4 serial 13 (gettext-0.15) -dnl Copyright (C) 1995-2006 Free Software Foundation, Inc. +# po.m4 serial 15 (gettext-0.17) +dnl Copyright (C) 1995-2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -27,6 +27,10 @@ AC_DEFUN([AM_PO_SUBDIRS], AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake AC_REQUIRE([AM_NLS])dnl + dnl Release version of the gettext macros. This is used to ensure that + dnl the gettext macros and po/Makefile.in.in are in sync. + AC_SUBST([GETTEXT_MACRO_VERSION], [0.17]) + dnl Perform the following tests also if --disable-nls has been given, dnl because they are needed for "make dist" to work. @@ -84,6 +88,10 @@ changequote([,])dnl test -n "$localedir" || localedir='${datadir}/locale' AC_SUBST([localedir]) + dnl Support for AM_XGETTEXT_OPTION. + test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= + AC_SUBST([XGETTEXT_EXTRA_OPTIONS]) + AC_CONFIG_COMMANDS([po-directories], [[ for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" @@ -426,3 +434,16 @@ EOF fi mv "$ac_file.tmp" "$ac_file" ]) + +dnl Initializes the accumulator used by AM_XGETTEXT_OPTION. +AC_DEFUN([AM_XGETTEXT_OPTION_INIT], +[ + XGETTEXT_EXTRA_OPTIONS= +]) + +dnl Registers an option to be passed to xgettext in the po subdirectory. +AC_DEFUN([AM_XGETTEXT_OPTION], +[ + AC_REQUIRE([AM_XGETTEXT_OPTION_INIT]) + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS $1" +]) diff --git a/po/ChangeLog b/po/ChangeLog index e69de29b..07f045bd 100644 --- a/po/ChangeLog +++ b/po/ChangeLog @@ -0,0 +1,4 @@ +2010-06-15 gettextize + + * Makefile.in.in: Upgrade to gettext-0.17. + diff --git a/po/Makefile.in.in b/po/Makefile.in.in index 5022b8b1..fecf500f 100644 --- a/po/Makefile.in.in +++ b/po/Makefile.in.in @@ -1,5 +1,5 @@ # Makefile for PO directory in any package using GNU gettext. -# Copyright (C) 1995-1997, 2000-2006 by Ulrich Drepper +# Copyright (C) 1995-1997, 2000-2007 by Ulrich Drepper # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU General Public @@ -8,7 +8,8 @@ # Please note that the actual code of GNU gettext is covered by the GNU # General Public License and is *not* in the public domain. # -# Origin: gettext-0.16 +# Origin: gettext-0.17 +GETTEXT_MACRO_VERSION = 0.17 PACKAGE = @PACKAGE@ VERSION = @VERSION@ @@ -95,11 +96,18 @@ CATALOGS = @CATALOGS@ mv t-$@ $@ -all: all-@USE_NLS@ +all: check-macro-version all-@USE_NLS@ all-yes: stamp-po all-no: +# Ensure that the gettext macros and this Makefile.in.in are in sync. +check-macro-version: + @test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \ + || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \ + exit 1; \ + } + # $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no # internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because # we don't want to bother translators with empty POT files). We assume that @@ -130,16 +138,34 @@ stamp-po: $(srcdir)/$(DOMAIN).pot # This target rebuilds $(DOMAIN).pot; it is an expensive operation. # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed + if LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null | grep -v 'libtool:' >/dev/null; then \ + package_gnu='GNU '; \ + else \ + package_gnu=''; \ + fi; \ if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \ msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ else \ msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ fi; \ - $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ - --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ - --files-from=$(srcdir)/POTFILES.in \ - --copyright-holder='$(COPYRIGHT_HOLDER)' \ - --msgid-bugs-address="$$msgid_bugs_address" + case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \ + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ + --files-from=$(srcdir)/POTFILES.in \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --msgid-bugs-address="$$msgid_bugs_address" \ + ;; \ + *) \ + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ + --files-from=$(srcdir)/POTFILES.in \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --package-name="$${package_gnu}@PACKAGE@" \ + --package-version='@VERSION@' \ + --msgid-bugs-address="$$msgid_bugs_address" \ + ;; \ + esac test ! -f $(DOMAIN).po || { \ if test -f $(srcdir)/$(DOMAIN).pot; then \ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ From ff8d0e090929af2d3ea8a885af65b57794884626 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 16 Jun 2010 05:22:17 +0000 Subject: [PATCH 374/585] Fix #207: Don't emit unnecessary REX.W for pinsrw. svn path=/trunk/yasm/; revision=2334 --- modules/arch/x86/gen_x86_insn.py | 3 +++ modules/arch/x86/tests/gas64/gas-moreinsn.hex | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index 19bc74f2..10d70676 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -4851,6 +4851,7 @@ add_group("pinsrw", suffix="q", cpu=["MMX", "P3"], notavx=True, + def_opersize_64=64, opersize=64, opcode=[0x0F, 0xC4], operands=[Operand(type="SIMDReg", size=64, dest="Spare"), @@ -4877,6 +4878,7 @@ add_group("pinsrw", suffix="q", cpu=["SSE2"], modifiers=["SetVEX"], + def_opersize_64=64, opersize=64, prefix=0x66, opcode=[0x0F, 0xC4], @@ -4906,6 +4908,7 @@ add_group("pinsrw", suffix="q", cpu=["AVX"], vex=128, + def_opersize_64=64, opersize=64, prefix=0x66, opcode=[0x0F, 0xC4], diff --git a/modules/arch/x86/tests/gas64/gas-moreinsn.hex b/modules/arch/x86/tests/gas64/gas-moreinsn.hex index 399c179a..2380a1fd 100644 --- a/modules/arch/x86/tests/gas64/gas-moreinsn.hex +++ b/modules/arch/x86/tests/gas64/gas-moreinsn.hex @@ -208,7 +208,6 @@ c1 c4 c0 05 -48 0f c4 c8 @@ -219,7 +218,6 @@ c4 c0 05 66 -48 0f c4 c8 @@ -287,6 +285,8 @@ df 00 00 00 +00 +00 2e 74 65 @@ -686,7 +686,7 @@ ff 00 00 00 -e0 +de 00 00 00 From 1227dda3c337f6189c3bf542736d74818d4a1dfe Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 2 Jul 2010 21:27:43 +0000 Subject: [PATCH 375/585] Remove AMD CVT16 instructions. Per http://sourceware.org/ml/binutils/2009-11/msg00372.html, this has been removed from GNU as. Several instructions also conflict with the latest Intel AVX instructions. svn path=/trunk/yasm/; revision=2335 --- modules/arch/x86/gen_x86_insn.py | 52 +---------------- modules/arch/x86/tests/Makefile.inc | 2 - modules/arch/x86/tests/cvt16.asm | 16 ------ modules/arch/x86/tests/cvt16.hex | 88 ----------------------------- modules/arch/x86/x86arch.h | 1 - modules/arch/x86/x86cpu.gperf | 3 - 6 files changed, 1 insertion(+), 161 deletions(-) delete mode 100644 modules/arch/x86/tests/cvt16.asm delete mode 100644 modules/arch/x86/tests/cvt16.hex diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index 10d70676..1ca1bc10 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -42,7 +42,7 @@ ordered_cpus = [ ordered_cpu_features = [ "FPU", "Cyrix", "AMD", "MMX", "3DNow", "SMM", "SSE", "SSE2", "SSE3", "SVM", "PadLock", "SSSE3", "SSE41", "SSE42", "SSE4a", "SSE5", - "AVX", "FMA", "AES", "CLMUL", "MOVBE", "XOP", "FMA4", "CVT16"] + "AVX", "FMA", "AES", "CLMUL", "MOVBE", "XOP", "FMA4"] unordered_cpu_features = ["Priv", "Prot", "Undoc", "Obs"] # Predefined VEX prefix field values @@ -6776,56 +6776,6 @@ add_group("movntss", add_insn("movntss", "movntss") -##################################################################### -# AMD CVT16 instructions -##################################################################### - -add_group("vcvtph2ps", - cpu=["CVT16"], - xop=128, - opcode=[0x08, 0xA0], - operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="Mem", size=64, relaxed=True, dest="EA"), - Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) -add_group("vcvtph2ps", - cpu=["CVT16"], - xop=128, - opcode=[0x08, 0xA0], - operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDReg", size=128, dest="EA"), - Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) -add_group("vcvtph2ps", - cpu=["CVT16"], - xop=256, - opcode=[0x08, 0xA0], - operands=[Operand(type="SIMDReg", size=256, dest="Spare"), - Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), - Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) -add_insn("vcvtph2ps", "vcvtph2ps") - -add_group("vcvtps2ph", - cpu=["CVT16"], - xop=128, - opcode=[0x08, 0xA1], - operands=[Operand(type="Mem", size=64, relaxed=True, dest="EA"), - Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) -add_group("vcvtps2ph", - cpu=["CVT16"], - xop=128, - opcode=[0x08, 0xA1], - operands=[Operand(type="SIMDReg", size=128, dest="EA"), - Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) -add_group("vcvtps2ph", - cpu=["CVT16"], - xop=256, - opcode=[0x08, 0xA1], - operands=[Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), - Operand(type="SIMDReg", size=256, dest="Spare"), - Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) -add_insn("vcvtps2ph", "vcvtps2ph") - ##################################################################### # AMD XOP instructions ##################################################################### diff --git a/modules/arch/x86/tests/Makefile.inc b/modules/arch/x86/tests/Makefile.inc index 298f075a..d6cef7b4 100644 --- a/modules/arch/x86/tests/Makefile.inc +++ b/modules/arch/x86/tests/Makefile.inc @@ -37,8 +37,6 @@ EXTRA_DIST += modules/arch/x86/tests/cmpxchg.asm EXTRA_DIST += modules/arch/x86/tests/cmpxchg.hex EXTRA_DIST += modules/arch/x86/tests/cpubasic-err.asm EXTRA_DIST += modules/arch/x86/tests/cpubasic-err.errwarn -EXTRA_DIST += modules/arch/x86/tests/cvt16.asm -EXTRA_DIST += modules/arch/x86/tests/cvt16.hex EXTRA_DIST += modules/arch/x86/tests/cyrix.asm EXTRA_DIST += modules/arch/x86/tests/cyrix.hex EXTRA_DIST += modules/arch/x86/tests/div-err.asm diff --git a/modules/arch/x86/tests/cvt16.asm b/modules/arch/x86/tests/cvt16.asm deleted file mode 100644 index 5e23b4bd..00000000 --- a/modules/arch/x86/tests/cvt16.asm +++ /dev/null @@ -1,16 +0,0 @@ -; BITS=16 to minimize output length -[bits 16] -vcvtph2ps xmm1, xmm4, 5 ; 8F E8 78 A0 314 05 -vcvtph2ps xmm2, [0], byte 5 ; 8F E8 78 A0 026 00 00 05 -vcvtph2ps xmm3, qword [0], 5 ; 8F E8 78 A0 036 00 00 05 -vcvtph2ps ymm1, xmm4, 5 ; 8F E8 7C A0 314 05 -vcvtph2ps ymm2, [0], byte 5 ; 8F E8 7C A0 026 00 00 05 -vcvtph2ps ymm3, dqword [0], 5 ; 8F E8 7C A0 036 00 00 05 - -vcvtps2ph xmm1, xmm4, 5 ; 8F E8 78 A1 341 05 -vcvtps2ph [0], xmm2, byte 5 ; 8F E8 78 A1 026 00 00 05 -vcvtps2ph qword [0], xmm3, 5 ; 8F E8 78 A1 036 00 00 05 -vcvtps2ph xmm1, ymm4, 5 ; 8F E8 7C A1 341 05 -vcvtps2ph [0], ymm2, byte 5 ; 8F E8 7C A1 026 00 00 05 -vcvtps2ph dqword [0], ymm3, 5 ; 8F E8 7C A1 036 00 00 05 - diff --git a/modules/arch/x86/tests/cvt16.hex b/modules/arch/x86/tests/cvt16.hex deleted file mode 100644 index 730d15ef..00000000 --- a/modules/arch/x86/tests/cvt16.hex +++ /dev/null @@ -1,88 +0,0 @@ -8f -e8 -78 -a0 -cc -05 -8f -e8 -78 -a0 -16 -00 -00 -05 -8f -e8 -78 -a0 -1e -00 -00 -05 -8f -e8 -7c -a0 -cc -05 -8f -e8 -7c -a0 -16 -00 -00 -05 -8f -e8 -7c -a0 -1e -00 -00 -05 -8f -e8 -78 -a1 -e1 -05 -8f -e8 -78 -a1 -16 -00 -00 -05 -8f -e8 -78 -a1 -1e -00 -00 -05 -8f -e8 -7c -a1 -e1 -05 -8f -e8 -7c -a1 -16 -00 -00 -05 -8f -e8 -7c -a1 -1e -00 -00 -05 diff --git a/modules/arch/x86/x86arch.h b/modules/arch/x86/x86arch.h index e33f132f..1f324671 100644 --- a/modules/arch/x86/x86arch.h +++ b/modules/arch/x86/x86arch.h @@ -72,7 +72,6 @@ #define CPU_MOVBE 38 /* MOVBE instruction */ #define CPU_XOP 39 /* AMD XOP extensions */ #define CPU_FMA4 40 /* AMD Fused-Multiply-Add extensions */ -#define CPU_CVT16 41 /* AMD CVT16 extensions */ enum x86_parser_type { X86_PARSER_NASM = 0, diff --git a/modules/arch/x86/x86cpu.gperf b/modules/arch/x86/x86cpu.gperf index 765cf08b..5d753433 100644 --- a/modules/arch/x86/x86cpu.gperf +++ b/modules/arch/x86/x86cpu.gperf @@ -154,7 +154,6 @@ x86_cpu_amd(wordptr cpu, yasm_arch_x86 *arch_x86, unsigned int data) if (data >= PROC_bulldozer) { BitVector_Bit_On(cpu, CPU_XOP); BitVector_Bit_On(cpu, CPU_FMA4); - BitVector_Bit_On(cpu, CPU_CVT16); } if (data >= PROC_k10) BitVector_Bit_On(cpu, CPU_SSE4a); @@ -378,8 +377,6 @@ xop, x86_cpu_set, CPU_XOP noxop, x86_cpu_clear, CPU_XOP fma4, x86_cpu_set, CPU_FMA4 nofma4, x86_cpu_clear, CPU_FMA4 -cvt16, x86_cpu_set, CPU_CVT16 -nocvt16, x86_cpu_clear, CPU_CVT16 # Change NOP patterns basicnop, x86_nop, X86_NOP_BASIC intelnop, x86_nop, X86_NOP_INTEL From 81c903cd707b9dd0e58b361ac3f9b50cd3fed514 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 3 Jul 2010 02:29:22 +0000 Subject: [PATCH 376/585] Add Intel post-32nm processor instructions (section 7 of AVX spec). Contributed by: Mark Charney svn path=/trunk/yasm/; revision=2336 --- modules/arch/x86/gen_x86_insn.py | 119 +++++++++++++++++++++++++++- modules/arch/x86/tests/Makefile.inc | 6 ++ modules/arch/x86/tests/f16c.asm | 10 +++ modules/arch/x86/tests/f16c.hex | 64 +++++++++++++++ modules/arch/x86/tests/fsgsbase.asm | 10 +++ modules/arch/x86/tests/fsgsbase.hex | 36 +++++++++ modules/arch/x86/tests/rdrnd.asm | 4 + modules/arch/x86/tests/rdrnd.hex | 11 +++ modules/arch/x86/x86arch.h | 3 + modules/arch/x86/x86cpu.gperf | 6 ++ 10 files changed, 268 insertions(+), 1 deletion(-) create mode 100644 modules/arch/x86/tests/f16c.asm create mode 100644 modules/arch/x86/tests/f16c.hex create mode 100644 modules/arch/x86/tests/fsgsbase.asm create mode 100644 modules/arch/x86/tests/fsgsbase.hex create mode 100644 modules/arch/x86/tests/rdrnd.asm create mode 100644 modules/arch/x86/tests/rdrnd.hex diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index 1ca1bc10..a260e503 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -42,7 +42,8 @@ ordered_cpus = [ ordered_cpu_features = [ "FPU", "Cyrix", "AMD", "MMX", "3DNow", "SMM", "SSE", "SSE2", "SSE3", "SVM", "PadLock", "SSSE3", "SSE41", "SSE42", "SSE4a", "SSE5", - "AVX", "FMA", "AES", "CLMUL", "MOVBE", "XOP", "FMA4"] + "AVX", "FMA", "AES", "CLMUL", "MOVBE", "XOP", "FMA4", "F16C", + "FSGSBASE", "RDRND"] unordered_cpu_features = ["Priv", "Prot", "Undoc", "Obs"] # Predefined VEX prefix field values @@ -6721,6 +6722,122 @@ for comb, combval in zip(["lql","hql","lqh","hqh"], [0x00,0x01,0x10,0x11]): add_insn("vpclmul"+comb+"qdq", "pclmulqdq_fixed", modifiers=[combval, VEXL0], avx=True) +##################################################################### +# AVX Post-32nm instructions +##################################################################### + +# RDRND +add_group("rdrand", + cpu=["RDRND"], + opersize=16, + opcode=[0x0F, 0xC7], + spare=6, + operands=[Operand(type="Reg", size=16, dest="EA")]) +add_group("rdrand", + #suffix="l", + cpu=["RDRND"], + opersize=32, + opcode=[0x0F, 0xC7], + spare=6, + operands=[Operand(type="Reg", size=32, dest="EA")]) +add_group("rdrand", + cpu=["RDRND"], + opersize=64, + opcode=[0x0F, 0xC7], + spare=6, + operands=[Operand(type="Reg", size=64, dest="EA")]) +add_insn("rdrand", "rdrand") + +# FSGSBASE instructions +add_group("fs_gs_base", + only64=True, + cpu=["FSGSBASE"], + modifiers=['SpAdd'], + opersize=32, + prefix=0xF3, + opcode=[0x0F, 0xAE], + operands=[Operand(type="Reg", size=32, dest="EA")]) +add_group("fs_gs_base", + only64=True, + cpu=["FSGSBASE"], + opersize=64, + modifiers=['SpAdd'], + prefix=0xF3, + opcode=[0x0F, 0xAE], + operands=[Operand(type="Reg", size=64, dest="EA")]) + +add_insn("rdfsbase", "fs_gs_base", modifiers=[0], only64=True) +add_insn("rdgsbase", "fs_gs_base", modifiers=[1], only64=True) +add_insn("wrfsbase", "fs_gs_base", modifiers=[2], only64=True) +add_insn("wrgsbase", "fs_gs_base", modifiers=[3], only64=True) + +# Float-16 conversion instructions +for g in ['ps2ph', 'ph2ps']: + operands1=[] + operands1.append(Operand(type="SIMDReg", size=128, dest="EA")) + operands1.append(Operand(type="SIMDReg", size=128, dest="Spare")) + + operands2=[] + operands2.append(Operand(type="Mem", size=64, dest="EA")) + operands2.append(Operand(type="SIMDReg", size=128, dest="Spare")) + + operands3=[] + operands3.append(Operand(type="SIMDReg", size=128, dest="EA")) + operands3.append(Operand(type="SIMDReg", size=256, dest="Spare")) + + operands4=[] + operands4.append(Operand(type="Mem", size=128, dest="EA")) + operands4.append(Operand(type="SIMDReg", size=256, dest="Spare")) + + if g == 'ph2ps': + operands1.reverse() + operands2.reverse() + operands3.reverse() + operands4.reverse() + map = 0x38 + elif g == 'ps2ph': + immop = Operand(type="Imm", size=8, relaxed=True, dest="Imm") + operands1.append(immop) + operands2.append(immop) + operands3.append(immop) + operands4.append(immop) + map = 0x3A + + add_group("avx_cvt" + g, + cpu=["F16C", "AVX"], + modifiers=["PreAdd", "Op2Add"], + vex=128, + prefix=0x00, + opcode=[0x0F, map, 0x00], + operands=operands1) + + add_group("avx_cvt" + g, + cpu=["F16C", "AVX"], + modifiers=["PreAdd", "Op2Add"], + vex=128, + prefix=0x00, + opcode=[0x0F, map, 0x00], + operands=operands2) + + add_group("avx_cvt" + g, + cpu=["F16C", "AVX"], + modifiers=["PreAdd", "Op2Add"], + vex=256, + prefix=0x00, + opcode=[0x0F, map, 0x00], + operands=operands3) + + add_group("avx_cvt" + g, + cpu=["F16C", "AVX"], + modifiers=["PreAdd", "Op2Add"], + vex=256, + prefix=0x00, + opcode=[0x0F, map, 0x00], + operands=operands4) + +add_insn("vcvtps2ph", "avx_cvtps2ph", modifiers=[0x66, 0x1D], avx=True) +add_insn("vcvtph2ps", "avx_cvtph2ps", modifiers=[0x66, 0x13], avx=True) + ##################################################################### # AMD SSE4a instructions ##################################################################### diff --git a/modules/arch/x86/tests/Makefile.inc b/modules/arch/x86/tests/Makefile.inc index d6cef7b4..b99a52f9 100644 --- a/modules/arch/x86/tests/Makefile.inc +++ b/modules/arch/x86/tests/Makefile.inc @@ -56,6 +56,8 @@ EXTRA_DIST += modules/arch/x86/tests/effaddr.hex EXTRA_DIST += modules/arch/x86/tests/enter.asm EXTRA_DIST += modules/arch/x86/tests/enter.errwarn EXTRA_DIST += modules/arch/x86/tests/enter.hex +EXTRA_DIST += modules/arch/x86/tests/f16c.asm +EXTRA_DIST += modules/arch/x86/tests/f16c.hex EXTRA_DIST += modules/arch/x86/tests/far64.asm EXTRA_DIST += modules/arch/x86/tests/far64.hex EXTRA_DIST += modules/arch/x86/tests/farbasic.asm @@ -66,6 +68,8 @@ EXTRA_DIST += modules/arch/x86/tests/fcmov.asm EXTRA_DIST += modules/arch/x86/tests/fcmov.hex EXTRA_DIST += modules/arch/x86/tests/fma.asm EXTRA_DIST += modules/arch/x86/tests/fma.hex +EXTRA_DIST += modules/arch/x86/tests/fsgsbase.asm +EXTRA_DIST += modules/arch/x86/tests/fsgsbase.hex EXTRA_DIST += modules/arch/x86/tests/fwdequ64.asm EXTRA_DIST += modules/arch/x86/tests/fwdequ64.hex EXTRA_DIST += modules/arch/x86/tests/genopcode.asm @@ -149,6 +153,8 @@ EXTRA_DIST += modules/arch/x86/tests/pushf-err.errwarn EXTRA_DIST += modules/arch/x86/tests/pushnosize.asm EXTRA_DIST += modules/arch/x86/tests/pushnosize.errwarn EXTRA_DIST += modules/arch/x86/tests/pushnosize.hex +EXTRA_DIST += modules/arch/x86/tests/rdrnd.asm +EXTRA_DIST += modules/arch/x86/tests/rdrnd.hex EXTRA_DIST += modules/arch/x86/tests/rep.asm EXTRA_DIST += modules/arch/x86/tests/rep.hex EXTRA_DIST += modules/arch/x86/tests/ret.asm diff --git a/modules/arch/x86/tests/f16c.asm b/modules/arch/x86/tests/f16c.asm new file mode 100644 index 00000000..06fa5f1d --- /dev/null +++ b/modules/arch/x86/tests/f16c.asm @@ -0,0 +1,10 @@ +[bits 64] +vcvtph2ps ymm1, xmm2 +vcvtph2ps ymm1, oword [0] +vcvtph2ps xmm1, xmm2 +vcvtph2ps xmm1, qword [0] + +vcvtps2ph xmm1, ymm2, 4 +vcvtps2ph oword [0], ymm2, 8 +vcvtps2ph xmm1, xmm2, 3 +vcvtps2ph qword [0], xmm2, 5 diff --git a/modules/arch/x86/tests/f16c.hex b/modules/arch/x86/tests/f16c.hex new file mode 100644 index 00000000..8ba06fc7 --- /dev/null +++ b/modules/arch/x86/tests/f16c.hex @@ -0,0 +1,64 @@ +c4 +e2 +7d +13 +ca +c4 +e2 +7d +13 +0c +25 +00 +00 +00 +00 +c4 +e2 +79 +13 +ca +c4 +e2 +79 +13 +0c +25 +00 +00 +00 +00 +c4 +e3 +7d +1d +d1 +04 +c4 +e3 +7d +1d +14 +25 +00 +00 +00 +00 +08 +c4 +e3 +79 +1d +d1 +03 +c4 +e3 +79 +1d +14 +25 +00 +00 +00 +00 +05 diff --git a/modules/arch/x86/tests/fsgsbase.asm b/modules/arch/x86/tests/fsgsbase.asm new file mode 100644 index 00000000..bae73013 --- /dev/null +++ b/modules/arch/x86/tests/fsgsbase.asm @@ -0,0 +1,10 @@ +[bits 64] +rdfsbase ebx +rdfsbase rbx +rdgsbase ecx +rdgsbase rcx + +wrfsbase ebx +wrfsbase rbx +wrgsbase ecx +wrgsbase rcx diff --git a/modules/arch/x86/tests/fsgsbase.hex b/modules/arch/x86/tests/fsgsbase.hex new file mode 100644 index 00000000..27b5eee0 --- /dev/null +++ b/modules/arch/x86/tests/fsgsbase.hex @@ -0,0 +1,36 @@ +f3 +0f +ae +c3 +f3 +48 +0f +ae +c3 +f3 +0f +ae +c9 +f3 +48 +0f +ae +c9 +f3 +0f +ae +d3 +f3 +48 +0f +ae +d3 +f3 +0f +ae +d9 +f3 +48 +0f +ae +d9 diff --git a/modules/arch/x86/tests/rdrnd.asm b/modules/arch/x86/tests/rdrnd.asm new file mode 100644 index 00000000..234451df --- /dev/null +++ b/modules/arch/x86/tests/rdrnd.asm @@ -0,0 +1,4 @@ +[bits 64] +rdrand cx +rdrand ecx +rdrand rcx diff --git a/modules/arch/x86/tests/rdrnd.hex b/modules/arch/x86/tests/rdrnd.hex new file mode 100644 index 00000000..be4bb809 --- /dev/null +++ b/modules/arch/x86/tests/rdrnd.hex @@ -0,0 +1,11 @@ +66 +0f +c7 +f1 +0f +c7 +f1 +48 +0f +c7 +f1 diff --git a/modules/arch/x86/x86arch.h b/modules/arch/x86/x86arch.h index 1f324671..f66ff359 100644 --- a/modules/arch/x86/x86arch.h +++ b/modules/arch/x86/x86arch.h @@ -72,6 +72,9 @@ #define CPU_MOVBE 38 /* MOVBE instruction */ #define CPU_XOP 39 /* AMD XOP extensions */ #define CPU_FMA4 40 /* AMD Fused-Multiply-Add extensions */ +#define CPU_F16C 41 /* Intel float-16 instructions */ +#define CPU_FSGSBASE 42 /* Intel FSGSBASE instructions */ +#define CPU_RDRND 43 /* Intel RDRND instruction */ enum x86_parser_type { X86_PARSER_NASM = 0, diff --git a/modules/arch/x86/x86cpu.gperf b/modules/arch/x86/x86cpu.gperf index 5d753433..5d03e57c 100644 --- a/modules/arch/x86/x86cpu.gperf +++ b/modules/arch/x86/x86cpu.gperf @@ -377,6 +377,12 @@ xop, x86_cpu_set, CPU_XOP noxop, x86_cpu_clear, CPU_XOP fma4, x86_cpu_set, CPU_FMA4 nofma4, x86_cpu_clear, CPU_FMA4 +f16c, x86_cpu_set, CPU_F16C +nof16c, x86_cpu_clear, CPU_F16C +fsgsbase, x86_cpu_set, CPU_FSGSBASE +nofsgsbase, x86_cpu_clear, CPU_FSGSBASE +rdrnd, x86_cpu_set, CPU_RDRND +nordrnd, x86_cpu_clear, CPU_RDRND # Change NOP patterns basicnop, x86_nop, X86_NOP_BASIC intelnop, x86_nop, X86_NOP_INTEL From 548f983552526bfca83165e836cd3ed19a7a706c Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 3 Jul 2010 19:48:00 +0000 Subject: [PATCH 377/585] Add support for XSAVEOPT instruction. Reported by: Mark Charney svn path=/trunk/yasm/; revision=2337 --- modules/arch/x86/gen_x86_insn.py | 14 +++++++++++++- modules/arch/x86/tests/xsave.asm | 4 ++++ modules/arch/x86/tests/xsave.hex | 14 ++++++++++++++ modules/arch/x86/x86arch.h | 1 + modules/arch/x86/x86cpu.gperf | 2 ++ 5 files changed, 34 insertions(+), 1 deletion(-) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index a260e503..83f7111e 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -7241,7 +7241,7 @@ add_insn("vfnmsubsd", "fma_128_m64", modifiers=[0x7F]) add_insn("vfnmsubss", "fma_128_m32", modifiers=[0x7E]) ##################################################################### -# Intel XSAVE instructions +# Intel XSAVE and XSAVEOPT instructions ##################################################################### add_insn("xgetbv", "threebyte", modifiers=[0x0F, 0x01, 0xD0], cpu=["XSAVE", "386"]) @@ -7252,6 +7252,18 @@ add_insn("xsave", "twobytemem", modifiers=[4, 0x0F, 0xAE], add_insn("xrstor", "twobytemem", modifiers=[5, 0x0F, 0xAE], cpu=["XSAVE", "386"]) +add_insn("xsaveopt", "twobytemem", modifiers=[6, 0x0F, 0xAE], + cpu=["XSAVEOPT"]) + +add_group("xsaveopt64", + modifiers=["SpAdd", "Op0Add", "Op1Add"], + opcode=[0x00, 0x00], + spare=0, + opersize=64, + operands=[Operand(type="Mem", relaxed=True, dest="EA")]) +add_insn("xsaveopt64", "xsaveopt64", modifiers=[6, 0x0F, 0xAE], + cpu=["XSAVEOPT"], only64=True) + ##################################################################### # Intel MOVBE instruction ##################################################################### diff --git a/modules/arch/x86/tests/xsave.asm b/modules/arch/x86/tests/xsave.asm index 6105879d..43f5f28d 100644 --- a/modules/arch/x86/tests/xsave.asm +++ b/modules/arch/x86/tests/xsave.asm @@ -2,3 +2,7 @@ xsave [0] xrstor [0] xgetbv xsetbv + +xsaveopt [0] +[bits 64] +xsaveopt64 [0] diff --git a/modules/arch/x86/tests/xsave.hex b/modules/arch/x86/tests/xsave.hex index 2b6d09a0..21e3a193 100644 --- a/modules/arch/x86/tests/xsave.hex +++ b/modules/arch/x86/tests/xsave.hex @@ -14,3 +14,17 @@ d0 0f 01 d1 +0f +ae +36 +00 +00 +48 +0f +ae +34 +25 +00 +00 +00 +00 diff --git a/modules/arch/x86/x86arch.h b/modules/arch/x86/x86arch.h index f66ff359..a148ee37 100644 --- a/modules/arch/x86/x86arch.h +++ b/modules/arch/x86/x86arch.h @@ -75,6 +75,7 @@ #define CPU_F16C 41 /* Intel float-16 instructions */ #define CPU_FSGSBASE 42 /* Intel FSGSBASE instructions */ #define CPU_RDRND 43 /* Intel RDRND instruction */ +#define CPU_XSAVEOPT 44 /* Intel XSAVEOPT instruction */ enum x86_parser_type { X86_PARSER_NASM = 0, diff --git a/modules/arch/x86/x86cpu.gperf b/modules/arch/x86/x86cpu.gperf index 5d03e57c..3baa954c 100644 --- a/modules/arch/x86/x86cpu.gperf +++ b/modules/arch/x86/x86cpu.gperf @@ -383,6 +383,8 @@ fsgsbase, x86_cpu_set, CPU_FSGSBASE nofsgsbase, x86_cpu_clear, CPU_FSGSBASE rdrnd, x86_cpu_set, CPU_RDRND nordrnd, x86_cpu_clear, CPU_RDRND +xsaveopt, x86_cpu_set, CPU_XSAVEOPT +noxsaveopt, x86_cpu_clear, CPU_XSAVEOPT # Change NOP patterns basicnop, x86_nop, X86_NOP_BASIC intelnop, x86_nop, X86_NOP_INTEL From 472838271cd3aff6e56c296e492da323ec0c6a35 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 23 Jul 2010 03:08:24 +0000 Subject: [PATCH 378/585] Fix #212: Set LC_SEGMENT vmsize correctly. svn path=/trunk/yasm/; revision=2338 --- modules/objfmts/macho/macho-objfmt.c | 2 +- .../objfmts/macho/tests/nasm32/Makefile.inc | 2 + .../macho/tests/nasm32/macho32-size.asm | 60 ++++ .../macho/tests/nasm32/macho32-size.hex | 328 ++++++++++++++++++ 4 files changed, 391 insertions(+), 1 deletion(-) create mode 100644 modules/objfmts/macho/tests/nasm32/macho32-size.asm create mode 100644 modules/objfmts/macho/tests/nasm32/macho32-size.hex diff --git a/modules/objfmts/macho/macho-objfmt.c b/modules/objfmts/macho/macho-objfmt.c index 5f96571a..e982ac5b 100644 --- a/modules/objfmts/macho/macho-objfmt.c +++ b/modules/objfmts/macho/macho-objfmt.c @@ -1001,7 +1001,7 @@ macho_objfmt_calc_sectsize(yasm_section *sect, /*@null@ */ void *d) unsigned long delta = msd->vmoff % align; if (delta > 0) { msd->vmoff += align - delta; - info->vmsize += delta; + info->vmsize += align - delta; } } diff --git a/modules/objfmts/macho/tests/nasm32/Makefile.inc b/modules/objfmts/macho/tests/nasm32/Makefile.inc index 1ee18be1..f850eceb 100644 --- a/modules/objfmts/macho/tests/nasm32/Makefile.inc +++ b/modules/objfmts/macho/tests/nasm32/Makefile.inc @@ -11,3 +11,5 @@ EXTRA_DIST += modules/objfmts/macho/tests/nasm32/macho-reloc.hex EXTRA_DIST += modules/objfmts/macho/tests/nasm32/macho32-sect.asm EXTRA_DIST += modules/objfmts/macho/tests/nasm32/macho32-sect.errwarn EXTRA_DIST += modules/objfmts/macho/tests/nasm32/macho32-sect.hex +EXTRA_DIST += modules/objfmts/macho/tests/nasm32/macho32-size.asm +EXTRA_DIST += modules/objfmts/macho/tests/nasm32/macho32-size.hex diff --git a/modules/objfmts/macho/tests/nasm32/macho32-size.asm b/modules/objfmts/macho/tests/nasm32/macho32-size.asm new file mode 100644 index 00000000..f8cd50fa --- /dev/null +++ b/modules/objfmts/macho/tests/nasm32/macho32-size.asm @@ -0,0 +1,60 @@ + section .data align=16 + + align 16 + + mmx_yuy2_00ff dw 000ffh, 000ffh, 000ffh, 000ffh + + section .text + +; -- Import/Export ------------------------------------------------------ + + global mb_yuy2yuv_mmx + + struc macroblock_yuy2_param + .dsty: resd 1 + .dstu: resd 1 + .dstv: resd 1 + .dypitch: resd 1 + .dcpitch: resd 1 + .src: resd 1 + .spitch: resd 1 + endstruc + +; ----------------------------------------------------------------------- +; -= mb_yuy2yuv_mmx =- +; +; extern "C" int __fastcall mb_yuy2yuv_mmx( macroblock_param *param ); +; ----------------------------------------------------------------------- + + align 16 + +mb_yuy2yuv_mmx: + + push ebx + push edx + + push esi + push edi + push ebp + + mov esi, [ecx + macroblock_yuy2_param.src] + mov edx, [ecx + macroblock_yuy2_param.spitch] + + mov edi, [ecx + macroblock_yuy2_param.dsty] + mov eax, [ecx + macroblock_yuy2_param.dstu] + mov ebx, [ecx + macroblock_yuy2_param.dstv] + + mov ebp, [ecx + macroblock_yuy2_param.dypitch] + mov ecx, [ecx + macroblock_yuy2_param.dcpitch] + + movq mm6, [mmx_yuy2_00ff] + + pop ebp + pop edi + pop esi + + pop edx + pop ebx + + retn + diff --git a/modules/objfmts/macho/tests/nasm32/macho32-size.hex b/modules/objfmts/macho/tests/nasm32/macho32-size.hex new file mode 100644 index 00000000..2ed324ea --- /dev/null +++ b/modules/objfmts/macho/tests/nasm32/macho32-size.hex @@ -0,0 +1,328 @@ +ce +fa +ed +fe +07 +00 +00 +00 +03 +00 +00 +00 +01 +00 +00 +00 +02 +00 +00 +00 +d8 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +c0 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +38 +00 +00 +00 +f4 +00 +00 +00 +2e +00 +00 +00 +07 +00 +00 +00 +07 +00 +00 +00 +02 +00 +00 +00 +00 +00 +00 +00 +5f +5f +74 +65 +78 +74 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +5f +5f +54 +45 +58 +54 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +26 +00 +00 +00 +f4 +00 +00 +00 +04 +00 +00 +00 +24 +01 +00 +00 +01 +00 +00 +00 +00 +01 +00 +80 +00 +00 +00 +00 +00 +00 +00 +00 +5f +5f +64 +61 +74 +61 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +5f +5f +44 +41 +54 +41 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +30 +00 +00 +00 +08 +00 +00 +00 +1a +01 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +18 +00 +00 +00 +2c +01 +00 +00 +01 +00 +00 +00 +38 +01 +00 +00 +10 +00 +00 +00 +53 +52 +56 +57 +55 +8b +71 +14 +8b +51 +18 +8b +39 +8b +41 +04 +8b +59 +08 +8b +69 +0c +8b +49 +10 +0f +6f +35 +30 +00 +00 +00 +5d +5f +5e +5a +5b +c3 +ff +00 +ff +00 +ff +00 +ff +00 +00 +00 +1c +00 +00 +00 +02 +00 +00 +04 +01 +00 +00 +00 +0f +01 +00 +00 +00 +00 +00 +00 +00 +6d +62 +5f +79 +75 +79 +32 +79 +75 +76 +5f +6d +6d +78 +00 From b716897f3392df533fbecaa4e1501ceb1b34e93e Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 23 Jul 2010 03:35:21 +0000 Subject: [PATCH 379/585] Fix #211: Add INVEPT, INVVPID, and GETSEC instructions. INVEPT and INVVPID is enabled via the "eptvpid" cpu feature. GETSEC is enabled via the "smx" cpu feature. svn path=/trunk/yasm/; revision=2339 --- modules/arch/x86/gen_x86_insn.py | 29 ++++++++++++++++++++++++++++- modules/arch/x86/tests/Makefile.inc | 4 ++++ modules/arch/x86/tests/eptvpid.asm | 8 ++++++++ modules/arch/x86/tests/eptvpid.hex | 22 ++++++++++++++++++++++ modules/arch/x86/tests/smx.asm | 3 +++ modules/arch/x86/tests/smx.hex | 2 ++ modules/arch/x86/x86arch.h | 2 ++ modules/arch/x86/x86cpu.gperf | 4 ++++ 8 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 modules/arch/x86/tests/eptvpid.asm create mode 100644 modules/arch/x86/tests/eptvpid.hex create mode 100644 modules/arch/x86/tests/smx.asm create mode 100644 modules/arch/x86/tests/smx.hex diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index 83f7111e..1074ad15 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -43,7 +43,7 @@ ordered_cpu_features = [ "FPU", "Cyrix", "AMD", "MMX", "3DNow", "SMM", "SSE", "SSE2", "SSE3", "SVM", "PadLock", "SSSE3", "SSE41", "SSE42", "SSE4a", "SSE5", "AVX", "FMA", "AES", "CLMUL", "MOVBE", "XOP", "FMA4", "F16C", - "FSGSBASE", "RDRND"] + "FSGSBASE", "RDRND", "XSAVEOPT", "EPTVPID"] unordered_cpu_features = ["Priv", "Prot", "Undoc", "Obs"] # Predefined VEX prefix field values @@ -5272,6 +5272,28 @@ add_insn("vmovsd", "movsd", modifiers=[VEXL0], avx=True) # P4 VMX Instructions ##################################################################### +add_group("eptvpid", + modifiers=["Op2Add"], + suffix="l", + not64=True, + cpu=["EPTVPID"], + opersize=32, + prefix=0x66, + opcode=[0x0F, 0x38, 0x80], + operands=[Operand(type="Reg", size=32, dest="Spare"), + Operand(type="Mem", size=128, relaxed=True, dest="EA")]) +add_group("eptvpid", + modifiers=["Op2Add"], + suffix="q", + cpu=["EPTVPID"], + opersize=64, + prefix=0x66, + opcode=[0x0F, 0x38, 0x80], + operands=[Operand(type="Reg", size=64, dest="Spare"), + Operand(type="Mem", size=128, relaxed=True, dest="EA")]) +add_insn("invept", "eptvpid", modifiers=[0]) +add_insn("invvpid", "eptvpid", modifiers=[1]) + add_insn("vmcall", "threebyte", modifiers=[0x0F, 0x01, 0xC1], cpu=["P4"]) add_insn("vmlaunch", "threebyte", modifiers=[0x0F, 0x01, 0xC2], cpu=["P4"]) add_insn("vmresume", "threebyte", modifiers=[0x0F, 0x01, 0xC3], cpu=["P4"]) @@ -5332,6 +5354,11 @@ add_group("vmxthreebytemem", add_insn("vmclear", "vmxthreebytemem", modifiers=[0x66]) add_insn("vmxon", "vmxthreebytemem", modifiers=[0xF3]) +##################################################################### +# Intel SMX Instructions +##################################################################### +add_insn("getsec", "twobyte", modifiers=[0x0F, 0x37], cpu=["SMX"]) + add_insn("cvttpd2pi", "cvt_mm_xmm", modifiers=[0x66, 0x2C], cpu=["SSE2"]) add_insn("cvttsd2si", "cvt_rx_xmm64", modifiers=[0xF2, 0x2C], cpu=["SSE2"]) add_insn("cvttpd2dq", "xmm_xmm128", modifiers=[0x66, 0xE6], cpu=["SSE2"]) diff --git a/modules/arch/x86/tests/Makefile.inc b/modules/arch/x86/tests/Makefile.inc index b99a52f9..f46fa074 100644 --- a/modules/arch/x86/tests/Makefile.inc +++ b/modules/arch/x86/tests/Makefile.inc @@ -56,6 +56,8 @@ EXTRA_DIST += modules/arch/x86/tests/effaddr.hex EXTRA_DIST += modules/arch/x86/tests/enter.asm EXTRA_DIST += modules/arch/x86/tests/enter.errwarn EXTRA_DIST += modules/arch/x86/tests/enter.hex +EXTRA_DIST += modules/arch/x86/tests/eptvpid.asm +EXTRA_DIST += modules/arch/x86/tests/eptvpid.hex EXTRA_DIST += modules/arch/x86/tests/f16c.asm EXTRA_DIST += modules/arch/x86/tests/f16c.hex EXTRA_DIST += modules/arch/x86/tests/far64.asm @@ -183,6 +185,8 @@ EXTRA_DIST += modules/arch/x86/tests/simd64-1.asm EXTRA_DIST += modules/arch/x86/tests/simd64-1.hex EXTRA_DIST += modules/arch/x86/tests/simd64-2.asm EXTRA_DIST += modules/arch/x86/tests/simd64-2.hex +EXTRA_DIST += modules/arch/x86/tests/smx.asm +EXTRA_DIST += modules/arch/x86/tests/smx.hex EXTRA_DIST += modules/arch/x86/tests/sse-prefix.asm EXTRA_DIST += modules/arch/x86/tests/sse-prefix.hex EXTRA_DIST += modules/arch/x86/tests/sse3.asm diff --git a/modules/arch/x86/tests/eptvpid.asm b/modules/arch/x86/tests/eptvpid.asm new file mode 100644 index 00000000..8c4881f4 --- /dev/null +++ b/modules/arch/x86/tests/eptvpid.asm @@ -0,0 +1,8 @@ +[bits 32] +invept eax, [eax] +invvpid eax, [eax] + +[bits 64] +invept rax, [rax] +invvpid rax, [rax] + diff --git a/modules/arch/x86/tests/eptvpid.hex b/modules/arch/x86/tests/eptvpid.hex new file mode 100644 index 00000000..1e2c2420 --- /dev/null +++ b/modules/arch/x86/tests/eptvpid.hex @@ -0,0 +1,22 @@ +66 +0f +38 +80 +00 +66 +0f +38 +81 +00 +66 +48 +0f +38 +80 +00 +66 +48 +0f +38 +81 +00 diff --git a/modules/arch/x86/tests/smx.asm b/modules/arch/x86/tests/smx.asm new file mode 100644 index 00000000..e5ca5b5a --- /dev/null +++ b/modules/arch/x86/tests/smx.asm @@ -0,0 +1,3 @@ +[bits 32] +getsec + diff --git a/modules/arch/x86/tests/smx.hex b/modules/arch/x86/tests/smx.hex new file mode 100644 index 00000000..7e6dae1f --- /dev/null +++ b/modules/arch/x86/tests/smx.hex @@ -0,0 +1,2 @@ +0f +37 diff --git a/modules/arch/x86/x86arch.h b/modules/arch/x86/x86arch.h index a148ee37..773f163e 100644 --- a/modules/arch/x86/x86arch.h +++ b/modules/arch/x86/x86arch.h @@ -76,6 +76,8 @@ #define CPU_FSGSBASE 42 /* Intel FSGSBASE instructions */ #define CPU_RDRND 43 /* Intel RDRND instruction */ #define CPU_XSAVEOPT 44 /* Intel XSAVEOPT instruction */ +#define CPU_EPTVPID 45 /* Intel INVEPT, INVVPID instructions */ +#define CPU_SMX 46 /* Intel SMX instruction (GETSEC) */ enum x86_parser_type { X86_PARSER_NASM = 0, diff --git a/modules/arch/x86/x86cpu.gperf b/modules/arch/x86/x86cpu.gperf index 3baa954c..488f2791 100644 --- a/modules/arch/x86/x86cpu.gperf +++ b/modules/arch/x86/x86cpu.gperf @@ -385,6 +385,10 @@ rdrnd, x86_cpu_set, CPU_RDRND nordrnd, x86_cpu_clear, CPU_RDRND xsaveopt, x86_cpu_set, CPU_XSAVEOPT noxsaveopt, x86_cpu_clear, CPU_XSAVEOPT +eptvpid, x86_cpu_set, CPU_EPTVPID +noeptvpid, x86_cpu_clear, CPU_EPTVPID +smx, x86_cpu_set, CPU_SMX +nosmx, x86_cpu_clear, CPU_SMX # Change NOP patterns basicnop, x86_nop, X86_NOP_BASIC intelnop, x86_nop, X86_NOP_INTEL From ea41f1e4e52de81112770694a408ca3af6dd0932 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 23 Jul 2010 03:36:01 +0000 Subject: [PATCH 380/585] gen_x86_insn.py: Add SMX to list of ordered_cpu_features. svn path=/trunk/yasm/; revision=2340 --- modules/arch/x86/gen_x86_insn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index 1074ad15..796f0b18 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -43,7 +43,7 @@ ordered_cpu_features = [ "FPU", "Cyrix", "AMD", "MMX", "3DNow", "SMM", "SSE", "SSE2", "SSE3", "SVM", "PadLock", "SSSE3", "SSE41", "SSE42", "SSE4a", "SSE5", "AVX", "FMA", "AES", "CLMUL", "MOVBE", "XOP", "FMA4", "F16C", - "FSGSBASE", "RDRND", "XSAVEOPT", "EPTVPID"] + "FSGSBASE", "RDRND", "XSAVEOPT", "EPTVPID", "SMX"] unordered_cpu_features = ["Priv", "Prot", "Undoc", "Obs"] # Predefined VEX prefix field values From 71afeff2ebb636e5300fc29df8497e38bb3f88fe Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Tue, 27 Jul 2010 18:20:22 +0000 Subject: [PATCH 381/585] Remove some causes of unnecessary rebuilds on Windows (VC10 only) svn path=/trunk/yasm/; revision=2342 --- Mkfiles/vc10/genperf/genperf.vcxproj | 4 ++ Mkfiles/vc10/genperf/run.bat | 14 +++++-- Mkfiles/vc10/libyasm/libyasm.vcxproj | 4 -- Mkfiles/vc10/libyasm/libyasm.vcxproj.filters | 12 ------ Mkfiles/vc10/out_copy_rename.bat | 42 ++++++++++++++++++++ Mkfiles/vc10/vsyasm.vcxproj | 6 +-- 6 files changed, 59 insertions(+), 23 deletions(-) create mode 100644 Mkfiles/vc10/out_copy_rename.bat diff --git a/Mkfiles/vc10/genperf/genperf.vcxproj b/Mkfiles/vc10/genperf/genperf.vcxproj index 3ca1fb45..b94d5a2b 100644 --- a/Mkfiles/vc10/genperf/genperf.vcxproj +++ b/Mkfiles/vc10/genperf/genperf.vcxproj @@ -44,6 +44,10 @@ $(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ false + false + false + false + false diff --git a/Mkfiles/vc10/genperf/run.bat b/Mkfiles/vc10/genperf/run.bat index 9c22b57e..5827138b 100644 --- a/Mkfiles/vc10/genperf/run.bat +++ b/Mkfiles/vc10/genperf/run.bat @@ -16,7 +16,13 @@ call %_python_% modules\arch\x86\gen_x86_insn.py :therest @echo on -%1 x86insn_nasm.gperf x86insn_nasm.c -%1 x86insn_gas.gperf x86insn_gas.c -%1 modules\arch\x86\x86cpu.gperf x86cpu.c -%1 modules\arch\x86\x86regtmod.gperf x86regtmod.c +call :update %1 x86insn_nasm.gperf x86insn_nasm.c +call :update %1 x86insn_gas.gperf x86insn_gas.c +call :update %1 modules\arch\x86\x86cpu.gperf x86cpu.c +call :update %1 modules\arch\x86\x86regtmod.gperf x86regtmod.c +goto :eof + +:update +%1 %2 tf +call mkfiles\vc10\out_copy_rename tf .\ %3 +del tf diff --git a/Mkfiles/vc10/libyasm/libyasm.vcxproj b/Mkfiles/vc10/libyasm/libyasm.vcxproj index a480d2a6..af67e44d 100644 --- a/Mkfiles/vc10/libyasm/libyasm.vcxproj +++ b/Mkfiles/vc10/libyasm/libyasm.vcxproj @@ -229,15 +229,12 @@ - - - @@ -252,7 +249,6 @@ - diff --git a/Mkfiles/vc10/libyasm/libyasm.vcxproj.filters b/Mkfiles/vc10/libyasm/libyasm.vcxproj.filters index aaad93d7..6385583d 100644 --- a/Mkfiles/vc10/libyasm/libyasm.vcxproj.filters +++ b/Mkfiles/vc10/libyasm/libyasm.vcxproj.filters @@ -106,9 +106,6 @@ Header Files - - Header Files - Header Files @@ -127,9 +124,6 @@ Header Files - - Header Files - Header Files @@ -175,18 +169,12 @@ Header Files - - Header Files - Header Files Header Files - - Header Files - diff --git a/Mkfiles/vc10/out_copy_rename.bat b/Mkfiles/vc10/out_copy_rename.bat new file mode 100644 index 00000000..349ee330 --- /dev/null +++ b/Mkfiles/vc10/out_copy_rename.bat @@ -0,0 +1,42 @@ +@echo off +if not exist %1 goto nofile +if exist %2 goto copy + +echo creating directory %2 +md %2 > nul + +:copy +set str=%2 +for /f "useback tokens=*" %%a in ('%str%') do set str=%%~a +set str=%str:~-1% +if %str% == "\" goto hasbackslash + +if not exist %2\%3 goto cpy +fc %1 %2\%3 > nul && if not %errorlevel 1 goto exit +echo overwriting %2\%3 with %1 +copy %1 %2\%3 > nul +goto exit + +:cpy +echo copying %1 to %2\%3 +copy %1 %2\%3 > nul +goto exit + +:hasbackslash +if not exist %2%3 goto cpy2 +fc %1 %2%3 > nul && if not %errorlevel 1 goto exit +echo overwriting %2%3 with %1 +copy %1 %2%3 > nul +goto exit + +:cpy2 +echo copying %1 to %2%3 +copy %1 %2%3 > nul +goto exit + +:nofile +echo %1 not found + +:exit + + diff --git a/Mkfiles/vc10/vsyasm.vcxproj b/Mkfiles/vc10/vsyasm.vcxproj index 7decc5bc..0c6e22a2 100644 --- a/Mkfiles/vc10/vsyasm.vcxproj +++ b/Mkfiles/vc10/vsyasm.vcxproj @@ -251,9 +251,6 @@ - - - {29fe7874-1256-4ad6-b889-68e399dc9608} @@ -264,6 +261,9 @@ false + + + From 86534657f27a226d03d4e0c9a36ec1a57ffa9291 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 31 Jul 2010 10:17:05 +0000 Subject: [PATCH 382/585] Fix #139: Fix a number of issues with win32 safeseh support. - Always create a non-global absolute symbol @feat.00 with value of 1. - Set type field to 0x20 (function) for safeseh-declared symbols. - Force safeseh-declared symbols into the symbol table, but don't force them to be global. svn path=/trunk/yasm/; revision=2343 --- modules/objfmts/coff/coff-objfmt.c | 45 ++++++++++--- modules/objfmts/win32/tests/export.hex | 20 +++++- modules/objfmts/win32/tests/gas/win32at.hex | 66 ++++++++++++------- modules/objfmts/win32/tests/win32-curpos.hex | 38 ++++++++--- .../objfmts/win32/tests/win32-longsect.hex | 20 +++++- modules/objfmts/win32/tests/win32-overdef.hex | 20 +++++- modules/objfmts/win32/tests/win32-safeseh.hex | 32 +++++++-- modules/objfmts/win32/tests/win32-segof.hex | 24 ++++++- modules/objfmts/win32/tests/win32test.hex | 40 +++++++---- 9 files changed, 237 insertions(+), 68 deletions(-) diff --git a/modules/objfmts/coff/coff-objfmt.c b/modules/objfmts/coff/coff-objfmt.c index 7ad087ce..82a78c3a 100644 --- a/modules/objfmts/coff/coff-objfmt.c +++ b/modules/objfmts/coff/coff-objfmt.c @@ -162,7 +162,9 @@ typedef enum coff_symtab_auxtype { } coff_symtab_auxtype; typedef struct coff_symrec_data { + int forcevis; /* force visibility in symbol table */ unsigned long index; /* assigned COFF symbol table index */ + unsigned int type; /* type */ coff_symrec_sclass sclass; /* storage class */ int numaux; /* number of auxiliary entries */ @@ -254,7 +256,9 @@ coff_objfmt_sym_set_data(yasm_symrec *sym, coff_symrec_sclass sclass, sym_data = yasm_xmalloc(sizeof(coff_symrec_data) + (numaux-1)*sizeof(coff_symtab_auxent)); + sym_data->forcevis = 0; sym_data->index = 0; + sym_data->type = 0; sym_data->sclass = sclass; sym_data->numaux = numaux; sym_data->auxtype = auxtype; @@ -343,6 +347,17 @@ win32_objfmt_create(yasm_object *object) } objfmt_coff->win32 = 1; + /* Define a @feat.00 symbol for win32 safeseh handling */ + if (!objfmt_coff->win64) { + yasm_symrec *feat00; + coff_symrec_data *sym_data; + feat00 = yasm_symtab_define_equ(object->symtab, "@feat.00", + yasm_expr_create_ident(yasm_expr_int( + yasm_intnum_create_uint(1)), 0), 0); + sym_data = coff_objfmt_sym_set_data(feat00, COFF_SCL_STAT, 0, + COFF_SYMTAB_AUX_NONE); + sym_data->forcevis = 1; + } } return (yasm_objfmt *)objfmt_coff; } @@ -937,7 +952,8 @@ coff_objfmt_count_sym(yasm_symrec *sym, /*@null@*/ void *d) sym_data = coff_objfmt_sym_set_data(sym, COFF_SCL_EXT, 0, COFF_SYMTAB_AUX_NONE); - if (info->all_syms || vis != YASM_SYM_LOCAL || yasm_symrec_is_abs(sym)) { + if (info->all_syms || vis != YASM_SYM_LOCAL || yasm_symrec_is_abs(sym) || + (sym_data && sym_data->forcevis)) { /* Save index in symrec data */ if (!sym_data) { sym_data = coff_objfmt_sym_set_data(sym, COFF_SCL_STAT, 0, @@ -956,18 +972,20 @@ coff_objfmt_output_sym(yasm_symrec *sym, /*@null@*/ void *d) /*@null@*/ coff_objfmt_output_info *info = (coff_objfmt_output_info *)d; yasm_sym_vis vis = yasm_symrec_get_visibility(sym); int is_abs = yasm_symrec_is_abs(sym); + /*@dependent@*/ /*@null@*/ coff_symrec_data *csymd; + csymd = yasm_symrec_get_data(sym, &coff_symrec_data_cb); assert(info != NULL); /* Don't output local syms unless outputting all syms */ - if (info->all_syms || vis != YASM_SYM_LOCAL || is_abs) { + if (info->all_syms || vis != YASM_SYM_LOCAL || is_abs || + (csymd && csymd->forcevis)) { /*@only*/ char *name; const yasm_expr *equ_val; const yasm_intnum *intn; unsigned char *localbuf; size_t len; int aux; - /*@dependent@*/ /*@null@*/ coff_symrec_data *csymd; unsigned long value = 0; unsigned int scnum = 0xfffe; /* -2 = debugging symbol */ /*@dependent@*/ /*@null@*/ yasm_section *sect; @@ -983,7 +1001,6 @@ coff_objfmt_output_sym(yasm_symrec *sym, /*@null@*/ void *d) len = strlen(name); /* Get symrec's of_data (needed for storage class) */ - csymd = yasm_symrec_get_data(sym, &coff_symrec_data_cb); if (!csymd) yasm_internal_error(N_("coff: expected sym data to be present")); @@ -1055,7 +1072,7 @@ coff_objfmt_output_sym(yasm_symrec *sym, /*@null@*/ void *d) } YASM_WRITE_32_L(localbuf, value); /* value */ YASM_WRITE_16_L(localbuf, scnum); /* section number */ - YASM_WRITE_16_L(localbuf, 0); /* type is always zero (for now) */ + YASM_WRITE_16_L(localbuf, csymd->type); /* type */ YASM_WRITE_8(localbuf, csymd->sclass); /* storage class */ YASM_WRITE_8(localbuf, csymd->numaux); /* number of aux entries */ fwrite(info->buf, 18, 1, info->f); @@ -1095,17 +1112,18 @@ coff_objfmt_output_str(yasm_symrec *sym, /*@null@*/ void *d) { /*@null@*/ coff_objfmt_output_info *info = (coff_objfmt_output_info *)d; yasm_sym_vis vis = yasm_symrec_get_visibility(sym); + /*@dependent@*/ /*@null@*/ coff_symrec_data *csymd; + csymd = yasm_symrec_get_data(sym, &coff_symrec_data_cb); assert(info != NULL); /* Don't output local syms unless outputting all syms */ - if (info->all_syms || vis != YASM_SYM_LOCAL) { + if (info->all_syms || vis != YASM_SYM_LOCAL || + (csymd && csymd->forcevis)) { /*@only@*/ char *name = yasm_symrec_get_global_name(sym, info->object); - /*@dependent@*/ /*@null@*/ coff_symrec_data *csymd; size_t len = strlen(name); int aux; - csymd = yasm_symrec_get_data(sym, &coff_symrec_data_cb); if (!csymd) yasm_internal_error(N_("coff: expected sym data to be present")); @@ -1676,13 +1694,20 @@ dir_safeseh(yasm_object *object, yasm_valparamhead *valparams, yasm_section *sect; /* Reference symbol (to generate error if not declared). - * Also, symbol must be externally visible, so force global. + * Also, symbol must be externally visible, so force it. */ vp = yasm_vps_first(valparams); symname = yasm_vp_id(vp); if (symname) { + coff_symrec_data *sym_data; sym = yasm_symtab_use(object->symtab, symname, line); - yasm_symrec_declare(sym, YASM_SYM_GLOBAL, line); + sym_data = yasm_symrec_get_data(sym, &coff_symrec_data_cb); + if (!sym_data) { + sym_data = coff_objfmt_sym_set_data(sym, COFF_SCL_STAT, 0, + COFF_SYMTAB_AUX_NONE); + } + sym_data->forcevis = 1; + sym_data->type = 0x20; /* function */ } else { yasm_error_set(YASM_ERROR_SYNTAX, N_("argument to SAFESEH must be symbol name")); diff --git a/modules/objfmts/win32/tests/export.hex b/modules/objfmts/win32/tests/export.hex index bcae2219..33ca9ffb 100644 --- a/modules/objfmts/win32/tests/export.hex +++ b/modules/objfmts/win32/tests/export.hex @@ -10,7 +10,7 @@ 00 00 00 -07 +08 00 00 00 @@ -159,6 +159,24 @@ ff 00 00 00 +40 +66 +65 +61 +74 +2e +30 +30 +01 +00 +00 +00 +ff +ff +00 +00 +03 +00 2e 74 65 diff --git a/modules/objfmts/win32/tests/gas/win32at.hex b/modules/objfmts/win32/tests/gas/win32at.hex index 22a9f128..d7bf5a0c 100644 --- a/modules/objfmts/win32/tests/gas/win32at.hex +++ b/modules/objfmts/win32/tests/gas/win32at.hex @@ -10,7 +10,7 @@ 03 00 00 -18 +19 00 00 00 @@ -551,7 +551,7 @@ c2 00 00 00 -08 +09 00 00 00 @@ -561,7 +561,7 @@ c2 00 00 00 -09 +0a 00 00 00 @@ -571,7 +571,7 @@ c2 00 00 00 -0a +0b 00 00 00 @@ -581,7 +581,7 @@ c2 00 00 00 -02 +03 00 00 00 @@ -591,7 +591,7 @@ c2 00 00 00 -0c +0d 00 00 00 @@ -601,7 +601,7 @@ c2 00 00 00 -0d +0e 00 00 00 @@ -611,7 +611,7 @@ b6 00 00 00 -04 +05 00 00 00 @@ -621,7 +621,7 @@ c2 00 00 00 -0c +0d 00 00 00 @@ -631,7 +631,7 @@ ce 00 00 00 -0e +0f 00 00 00 @@ -641,7 +641,7 @@ db 00 00 00 -04 +05 00 00 00 @@ -651,7 +651,7 @@ e0 00 00 00 -04 +05 00 00 00 @@ -661,7 +661,7 @@ e7 00 00 00 -0f +10 00 00 00 @@ -671,7 +671,7 @@ e7 01 00 00 -04 +05 00 00 00 @@ -681,7 +681,7 @@ e7 01 00 00 -04 +05 00 00 00 @@ -691,7 +691,7 @@ e7 01 00 00 -10 +11 00 00 00 @@ -701,7 +701,7 @@ e7 01 00 00 -04 +05 00 00 00 @@ -711,7 +711,7 @@ e7 01 00 00 -04 +05 00 00 00 @@ -721,7 +721,7 @@ e7 01 00 00 -0f +10 00 00 00 @@ -731,7 +731,7 @@ e7 01 00 00 -11 +12 00 00 00 @@ -741,7 +741,7 @@ e7 01 00 00 -12 +13 00 00 00 @@ -751,7 +751,7 @@ e7 01 00 00 -13 +14 00 00 00 @@ -761,7 +761,7 @@ e7 01 00 00 -14 +15 00 00 00 @@ -771,7 +771,7 @@ e7 01 00 00 -15 +16 00 00 00 @@ -947,6 +947,24 @@ ff 00 00 00 +40 +66 +65 +61 +74 +2e +30 +30 +01 +00 +00 +00 +ff +ff +00 +00 +03 +00 2e 74 65 diff --git a/modules/objfmts/win32/tests/win32-curpos.hex b/modules/objfmts/win32/tests/win32-curpos.hex index 16b39a8f..bcedd9d5 100644 --- a/modules/objfmts/win32/tests/win32-curpos.hex +++ b/modules/objfmts/win32/tests/win32-curpos.hex @@ -10,7 +10,7 @@ 01 00 00 -0a +0b 00 00 00 @@ -162,7 +162,7 @@ e8 00 00 00 -06 +07 00 00 00 @@ -172,7 +172,7 @@ e8 00 00 00 -06 +07 00 00 00 @@ -182,7 +182,7 @@ e8 00 00 00 -06 +07 00 00 00 @@ -210,7 +210,7 @@ e8 00 00 00 -08 +09 00 00 00 @@ -220,7 +220,7 @@ e8 00 00 00 -08 +09 00 00 00 @@ -258,7 +258,7 @@ ff 00 00 00 -06 +07 00 00 00 @@ -268,7 +268,7 @@ ff 00 00 00 -06 +07 00 00 00 @@ -278,7 +278,7 @@ ff 00 00 00 -06 +07 00 00 00 @@ -288,7 +288,7 @@ ff 00 00 00 -06 +07 00 00 00 @@ -330,6 +330,24 @@ ff 00 00 00 +40 +66 +65 +61 +74 +2e +30 +30 +01 +00 +00 +00 +ff +ff +00 +00 +03 +00 2e 74 65 diff --git a/modules/objfmts/win32/tests/win32-longsect.hex b/modules/objfmts/win32/tests/win32-longsect.hex index 25d4812e..57ab5286 100644 --- a/modules/objfmts/win32/tests/win32-longsect.hex +++ b/modules/objfmts/win32/tests/win32-longsect.hex @@ -10,7 +10,7 @@ 01 00 00 -0e +0f 00 00 00 @@ -314,6 +314,24 @@ ff 00 00 00 +40 +66 +65 +61 +74 +2e +30 +30 +01 +00 +00 +00 +ff +ff +00 +00 +03 +00 2e 74 65 diff --git a/modules/objfmts/win32/tests/win32-overdef.hex b/modules/objfmts/win32/tests/win32-overdef.hex index 00d97cd6..fe0d6d73 100644 --- a/modules/objfmts/win32/tests/win32-overdef.hex +++ b/modules/objfmts/win32/tests/win32-overdef.hex @@ -10,7 +10,7 @@ 00 00 00 -04 +05 00 00 00 @@ -94,6 +94,24 @@ ff 00 00 00 +40 +66 +65 +61 +74 +2e +30 +30 +01 +00 +00 +00 +ff +ff +00 +00 +03 +00 2e 74 65 diff --git a/modules/objfmts/win32/tests/win32-safeseh.hex b/modules/objfmts/win32/tests/win32-safeseh.hex index 5598d6fc..65644680 100644 --- a/modules/objfmts/win32/tests/win32-safeseh.hex +++ b/modules/objfmts/win32/tests/win32-safeseh.hex @@ -10,7 +10,7 @@ 00 00 00 -08 +09 00 00 00 @@ -99,11 +99,11 @@ 00 00 c3 -04 +05 00 00 00 -07 +08 00 00 00 @@ -143,6 +143,24 @@ ff 00 00 00 +40 +66 +65 +61 +74 +2e +30 +30 +01 +00 +00 +00 +ff +ff +00 +00 +03 +00 2e 74 65 @@ -193,9 +211,9 @@ ff 00 01 00 +20 00 -00 -02 +03 00 2e 73 @@ -247,9 +265,9 @@ ff 00 00 00 +20 00 -00 -02 +03 00 19 00 diff --git a/modules/objfmts/win32/tests/win32-segof.hex b/modules/objfmts/win32/tests/win32-segof.hex index 873129f1..fd400133 100644 --- a/modules/objfmts/win32/tests/win32-segof.hex +++ b/modules/objfmts/win32/tests/win32-segof.hex @@ -10,7 +10,7 @@ 00 00 00 -07 +08 00 00 00 @@ -114,7 +114,7 @@ c0 00 00 00 -04 +05 00 00 00 @@ -124,7 +124,7 @@ c0 00 00 00 -05 +06 00 00 00 @@ -166,6 +166,24 @@ ff 00 00 00 +40 +66 +65 +61 +74 +2e +30 +30 +01 +00 +00 +00 +ff +ff +00 +00 +03 +00 2e 74 65 diff --git a/modules/objfmts/win32/tests/win32test.hex b/modules/objfmts/win32/tests/win32test.hex index 339090b1..2548ee00 100644 --- a/modules/objfmts/win32/tests/win32test.hex +++ b/modules/objfmts/win32/tests/win32test.hex @@ -10,7 +10,7 @@ 01 00 00 -10 +11 00 00 00 @@ -203,7 +203,7 @@ c3 00 00 00 -0e +0f 00 00 00 @@ -213,7 +213,7 @@ c3 00 00 00 -0e +0f 00 00 00 @@ -223,7 +223,7 @@ c3 00 00 00 -0b +0c 00 00 00 @@ -233,7 +233,7 @@ c3 00 00 00 -0c +0d 00 00 00 @@ -243,7 +243,7 @@ c3 00 00 00 -0e +0f 00 00 00 @@ -253,7 +253,7 @@ c3 00 00 00 -0c +0d 00 00 00 @@ -263,7 +263,7 @@ c3 00 00 00 -0a +0b 00 00 00 @@ -337,7 +337,7 @@ c3 00 00 00 -0e +0f 00 00 00 @@ -347,7 +347,7 @@ c3 00 00 00 -02 +03 00 00 00 @@ -357,7 +357,7 @@ c3 00 00 00 -0c +0d 00 00 00 @@ -399,6 +399,24 @@ ff 00 00 00 +40 +66 +65 +61 +74 +2e +30 +30 +01 +00 +00 +00 +ff +ff +00 +00 +03 +00 2e 74 65 From a4024ab0ca1707b35e5c16822594627d15e53e53 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 1 Aug 2010 01:05:04 +0000 Subject: [PATCH 383/585] macho: Fix relocation table file location. svn path=/trunk/yasm/; revision=2344 --- modules/objfmts/macho/macho-objfmt.c | 6 +++--- modules/objfmts/macho/tests/nasm32/macho32-sect.hex | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/objfmts/macho/macho-objfmt.c b/modules/objfmts/macho/macho-objfmt.c index e982ac5b..a3caae17 100644 --- a/modules/objfmts/macho/macho-objfmt.c +++ b/modules/objfmts/macho/macho-objfmt.c @@ -1188,7 +1188,7 @@ macho_objfmt_output(yasm_object *object, FILE *f, int all_syms, /* next: section headers */ /* offset to relocs for first section */ - info.rel_base = align32((long)fileoffset + (long)info.filesize); + info.rel_base = align32((long)fileoff_sections); info.s_reloff = 0; /* offset for relocs of following sections */ yasm_object_sections_traverse(object, &info, macho_objfmt_output_secthead); @@ -1217,8 +1217,8 @@ macho_objfmt_output(yasm_object *object, FILE *f, int all_syms, } /* padding to long boundary */ - if (info.rel_base - (fileoffset + info.filesize)) { - fwrite(pad_data, info.rel_base - (fileoffset + info.filesize), 1, f); + if ((info.rel_base - fileoff_sections) > 0) { + fwrite(pad_data, info.rel_base - fileoff_sections, 1, f); } /* relocation data */ diff --git a/modules/objfmts/macho/tests/nasm32/macho32-sect.hex b/modules/objfmts/macho/tests/nasm32/macho32-sect.hex index eff781a5..aeaec6f9 100644 --- a/modules/objfmts/macho/tests/nasm32/macho32-sect.hex +++ b/modules/objfmts/macho/tests/nasm32/macho32-sect.hex @@ -770,16 +770,16 @@ fc 00 00 00 -fc -02 +14 +03 00 00 00 00 00 00 -fc -02 +14 +03 00 00 01 From abaf3f7d492962bf624cc16b306cde6758ca9557 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 1 Aug 2010 01:27:40 +0000 Subject: [PATCH 384/585] macho32: Correctly output pc-relative non-external intersegment. Reported by: Justin Lebar svn path=/trunk/yasm/; revision=2345 --- modules/objfmts/macho/macho-objfmt.c | 2 +- .../objfmts/macho/tests/nasm32/Makefile.inc | 2 + .../macho/tests/nasm32/macho32-pic.asm | 46 +++ .../macho/tests/nasm32/macho32-pic.hex | 338 ++++++++++++++++++ 4 files changed, 387 insertions(+), 1 deletion(-) create mode 100644 modules/objfmts/macho/tests/nasm32/macho32-pic.asm create mode 100644 modules/objfmts/macho/tests/nasm32/macho32-pic.hex diff --git a/modules/objfmts/macho/macho-objfmt.c b/modules/objfmts/macho/macho-objfmt.c index a3caae17..c80e315a 100644 --- a/modules/objfmts/macho/macho-objfmt.c +++ b/modules/objfmts/macho/macho-objfmt.c @@ -532,7 +532,7 @@ macho_objfmt_output_value(yasm_value *value, unsigned char *buf, if ((vis & YASM_SYM_EXTERN) || (vis & YASM_SYM_COMMON)) { reloc->ext = 1; info->msd->extreloc = 1; /* section has external relocations */ - } else if (!value->curpos_rel && !info->is_64) { + } else if (!info->is_64) { /*@dependent@*/ /*@null@*/ yasm_bytecode *sym_precbc; /* Local symbols need valued to their actual address */ diff --git a/modules/objfmts/macho/tests/nasm32/Makefile.inc b/modules/objfmts/macho/tests/nasm32/Makefile.inc index f850eceb..d93e7ecf 100644 --- a/modules/objfmts/macho/tests/nasm32/Makefile.inc +++ b/modules/objfmts/macho/tests/nasm32/Makefile.inc @@ -8,6 +8,8 @@ EXTRA_DIST += modules/objfmts/macho/tests/nasm32/machotest.asm EXTRA_DIST += modules/objfmts/macho/tests/nasm32/machotest.hex EXTRA_DIST += modules/objfmts/macho/tests/nasm32/macho-reloc.asm EXTRA_DIST += modules/objfmts/macho/tests/nasm32/macho-reloc.hex +EXTRA_DIST += modules/objfmts/macho/tests/nasm32/macho32-pic.asm +EXTRA_DIST += modules/objfmts/macho/tests/nasm32/macho32-pic.hex EXTRA_DIST += modules/objfmts/macho/tests/nasm32/macho32-sect.asm EXTRA_DIST += modules/objfmts/macho/tests/nasm32/macho32-sect.errwarn EXTRA_DIST += modules/objfmts/macho/tests/nasm32/macho32-sect.hex diff --git a/modules/objfmts/macho/tests/nasm32/macho32-pic.asm b/modules/objfmts/macho/tests/nasm32/macho32-pic.asm new file mode 100644 index 00000000..438923d1 --- /dev/null +++ b/modules/objfmts/macho/tests/nasm32/macho32-pic.asm @@ -0,0 +1,46 @@ +; At present, nasm doesn't seem to support PIC generation for Mach-O. +; The PIC support code below is a little tricky. +[extern func] + SECTION .rodata +const_base: + +%define GOTOFF(got,sym) (got) + (sym) - const_base + +%imacro get_GOT 1 + ; NOTE: this macro destroys ecx resister. + call %%geteip + add ecx, byte (%%ref - $) + jmp short %%adjust +%%geteip: + mov ecx, [esp] + ret +%%adjust: + push ebp + xor ebp,ebp ; ebp = 0 +%ifidni %1,ebx ; (%1 == ebx) + ; db 0x8D,0x9C + jmp near const_base = + ; lea ebx, [ecx+ebp*8+(const_base-%%ref)] ; 8D,9C,E9,(offset32) + db 0x8D,0x9C ; 8D,9C + jmp near const_base ; E9,(const_base-%%ref) +%%ref: +%else ; (%1 != ebx) + ; db 0x8D,0x8C + jmp near const_base = + ; lea ecx, [ecx+ebp*8+(const_base-%%ref)] ; 8D,8C,E9,(offset32) + db 0x8D,0x8C ; 8D,8C + jmp strict near const_base ; E9,(const_base-%%ref) +%%ref: mov %1, ecx +%endif ; (%1 == ebx) + pop ebp +%endmacro + +SECTION .text + +jmp const_base + +get_GOT ebx + +jmp const_base + +call func + +ret diff --git a/modules/objfmts/macho/tests/nasm32/macho32-pic.hex b/modules/objfmts/macho/tests/nasm32/macho32-pic.hex new file mode 100644 index 00000000..f81f708c --- /dev/null +++ b/modules/objfmts/macho/tests/nasm32/macho32-pic.hex @@ -0,0 +1,338 @@ +ce +fa +ed +fe +07 +00 +00 +00 +03 +00 +00 +00 +01 +00 +00 +00 +02 +00 +00 +00 +d8 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +c0 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +29 +00 +00 +00 +f4 +00 +00 +00 +29 +00 +00 +00 +07 +00 +00 +00 +07 +00 +00 +00 +02 +00 +00 +00 +00 +00 +00 +00 +5f +5f +74 +65 +78 +74 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +5f +5f +54 +45 +58 +54 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +29 +00 +00 +00 +f4 +00 +00 +00 +00 +00 +00 +00 +20 +01 +00 +00 +04 +00 +00 +00 +00 +03 +00 +80 +00 +00 +00 +00 +00 +00 +00 +00 +5f +5f +63 +6f +6e +73 +74 +00 +00 +00 +00 +00 +00 +00 +00 +00 +5f +5f +44 +41 +54 +41 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +29 +00 +00 +00 +00 +00 +00 +00 +1d +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +18 +00 +00 +00 +40 +01 +00 +00 +01 +00 +00 +00 +4c +01 +00 +00 +06 +00 +00 +00 +e9 +24 +00 +00 +00 +e8 +05 +00 +00 +00 +83 +c1 +13 +eb +04 +8b +0c +24 +c3 +55 +31 +ed +8d +9c +e9 +0c +00 +00 +00 +5d +e9 +06 +00 +00 +00 +e8 +d8 +ff +ff +ff +c3 +00 +00 +00 +01 +00 +00 +00 +02 +00 +00 +05 +19 +00 +00 +00 +02 +00 +00 +05 +1f +00 +00 +00 +02 +00 +00 +05 +24 +00 +00 +00 +00 +00 +00 +0d +01 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +66 +75 +6e +63 +00 From f288243be42274ba5d45ca14bba9ea4545220bd6 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 1 Aug 2010 01:37:37 +0000 Subject: [PATCH 385/585] Rename RDRND feature bit to RDRAND. svn path=/trunk/yasm/; revision=2346 --- modules/arch/x86/gen_x86_insn.py | 10 +++++----- modules/arch/x86/x86arch.h | 2 +- modules/arch/x86/x86cpu.gperf | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index 796f0b18..d04601e4 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -43,7 +43,7 @@ ordered_cpu_features = [ "FPU", "Cyrix", "AMD", "MMX", "3DNow", "SMM", "SSE", "SSE2", "SSE3", "SVM", "PadLock", "SSSE3", "SSE41", "SSE42", "SSE4a", "SSE5", "AVX", "FMA", "AES", "CLMUL", "MOVBE", "XOP", "FMA4", "F16C", - "FSGSBASE", "RDRND", "XSAVEOPT", "EPTVPID", "SMX"] + "FSGSBASE", "RDRAND", "XSAVEOPT", "EPTVPID", "SMX"] unordered_cpu_features = ["Priv", "Prot", "Undoc", "Obs"] # Predefined VEX prefix field values @@ -6753,22 +6753,22 @@ for comb, combval in zip(["lql","hql","lqh","hqh"], [0x00,0x01,0x10,0x11]): # AVX Post-32nm instructions ##################################################################### -# RDRND +# RDRAND add_group("rdrand", - cpu=["RDRND"], + cpu=["RDRAND"], opersize=16, opcode=[0x0F, 0xC7], spare=6, operands=[Operand(type="Reg", size=16, dest="EA")]) add_group("rdrand", #suffix="l", - cpu=["RDRND"], + cpu=["RDRAND"], opersize=32, opcode=[0x0F, 0xC7], spare=6, operands=[Operand(type="Reg", size=32, dest="EA")]) add_group("rdrand", - cpu=["RDRND"], + cpu=["RDRAND"], opersize=64, opcode=[0x0F, 0xC7], spare=6, diff --git a/modules/arch/x86/x86arch.h b/modules/arch/x86/x86arch.h index 773f163e..d1ba2325 100644 --- a/modules/arch/x86/x86arch.h +++ b/modules/arch/x86/x86arch.h @@ -74,7 +74,7 @@ #define CPU_FMA4 40 /* AMD Fused-Multiply-Add extensions */ #define CPU_F16C 41 /* Intel float-16 instructions */ #define CPU_FSGSBASE 42 /* Intel FSGSBASE instructions */ -#define CPU_RDRND 43 /* Intel RDRND instruction */ +#define CPU_RDRAND 43 /* Intel RDRAND instruction */ #define CPU_XSAVEOPT 44 /* Intel XSAVEOPT instruction */ #define CPU_EPTVPID 45 /* Intel INVEPT, INVVPID instructions */ #define CPU_SMX 46 /* Intel SMX instruction (GETSEC) */ diff --git a/modules/arch/x86/x86cpu.gperf b/modules/arch/x86/x86cpu.gperf index 488f2791..e83be09a 100644 --- a/modules/arch/x86/x86cpu.gperf +++ b/modules/arch/x86/x86cpu.gperf @@ -381,8 +381,8 @@ f16c, x86_cpu_set, CPU_F16C nof16c, x86_cpu_clear, CPU_F16C fsgsbase, x86_cpu_set, CPU_FSGSBASE nofsgsbase, x86_cpu_clear, CPU_FSGSBASE -rdrnd, x86_cpu_set, CPU_RDRND -nordrnd, x86_cpu_clear, CPU_RDRND +rdrand, x86_cpu_set, CPU_RDRAND +nordrand, x86_cpu_clear, CPU_RDRAND xsaveopt, x86_cpu_set, CPU_XSAVEOPT noxsaveopt, x86_cpu_clear, CPU_XSAVEOPT eptvpid, x86_cpu_set, CPU_EPTVPID From a0a5404f14061107f7b9849e651a73193b34f50e Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 1 Aug 2010 17:31:12 +0000 Subject: [PATCH 386/585] win32: Make external safeseh work again (broken in [2343]). svn path=/trunk/yasm/; revision=2347 --- modules/objfmts/coff/coff-objfmt.c | 16 ++++++++++------ modules/objfmts/win32/tests/win32-safeseh.hex | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/modules/objfmts/coff/coff-objfmt.c b/modules/objfmts/coff/coff-objfmt.c index 82a78c3a..87bdd6b6 100644 --- a/modules/objfmts/coff/coff-objfmt.c +++ b/modules/objfmts/coff/coff-objfmt.c @@ -948,17 +948,21 @@ coff_objfmt_count_sym(yasm_symrec *sym, /*@null@*/ void *d) assert(info != NULL); sym_data = yasm_symrec_get_data(sym, &coff_symrec_data_cb); - if ((vis & (YASM_SYM_EXTERN|YASM_SYM_GLOBAL|YASM_SYM_COMMON)) && !sym_data) - sym_data = coff_objfmt_sym_set_data(sym, COFF_SCL_EXT, 0, - COFF_SYMTAB_AUX_NONE); if (info->all_syms || vis != YASM_SYM_LOCAL || yasm_symrec_is_abs(sym) || (sym_data && sym_data->forcevis)) { /* Save index in symrec data */ - if (!sym_data) { - sym_data = coff_objfmt_sym_set_data(sym, COFF_SCL_STAT, 0, + if (!sym_data) + sym_data = coff_objfmt_sym_set_data(sym, COFF_SCL_NULL, 0, COFF_SYMTAB_AUX_NONE); + /* Set storage class based on visibility if not already set */ + if (sym_data->sclass == COFF_SCL_NULL) { + if (vis & (YASM_SYM_EXTERN|YASM_SYM_GLOBAL|YASM_SYM_COMMON)) + sym_data->sclass = COFF_SCL_EXT; + else + sym_data->sclass = COFF_SCL_STAT; } + sym_data->index = info->indx; info->indx += sym_data->numaux + 1; @@ -1703,7 +1707,7 @@ dir_safeseh(yasm_object *object, yasm_valparamhead *valparams, sym = yasm_symtab_use(object->symtab, symname, line); sym_data = yasm_symrec_get_data(sym, &coff_symrec_data_cb); if (!sym_data) { - sym_data = coff_objfmt_sym_set_data(sym, COFF_SCL_STAT, 0, + sym_data = coff_objfmt_sym_set_data(sym, COFF_SCL_NULL, 0, COFF_SYMTAB_AUX_NONE); } sym_data->forcevis = 1; diff --git a/modules/objfmts/win32/tests/win32-safeseh.hex b/modules/objfmts/win32/tests/win32-safeseh.hex index 65644680..d9a4cb5d 100644 --- a/modules/objfmts/win32/tests/win32-safeseh.hex +++ b/modules/objfmts/win32/tests/win32-safeseh.hex @@ -267,7 +267,7 @@ ff 00 20 00 -03 +02 00 19 00 From 0d3b3797e57cd7ed5f5810246dbb17ea29e68d94 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 1 Aug 2010 17:44:56 +0000 Subject: [PATCH 387/585] Fix #213: Fix gas-preproc misuse of strcpy() and uninitialized variables. - strcpy() was being used with overlapping memory ranges; switched to memmove(). - bline->line_number was not set in one location. Exact causes identified using valgrind. svn path=/trunk/yasm/; revision=2348 --- modules/preprocs/gas/gas-preproc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/preprocs/gas/gas-preproc.c b/modules/preprocs/gas/gas-preproc.c index bbdd4992..86060d74 100644 --- a/modules/preprocs/gas/gas-preproc.c +++ b/modules/preprocs/gas/gas-preproc.c @@ -792,7 +792,7 @@ static void expand_macro(yasm_preproc_gas *pp, macro_entry *macro, const char *a memcpy(line + cursor - len, value, value_length); } else { memcpy(line + cursor - len, value, value_length); - strcpy(line + cursor - len + value_length, line + cursor); + memmove(line + cursor - len + value_length, line + cursor, strlen(line + cursor) + 1); } pp->expr_string = work = line; pp->expr_string_cursor += delta; @@ -806,6 +806,7 @@ static void expand_macro(yasm_preproc_gas *pp, macro_entry *macro, const char *a } bline->line = work + (pp->expr_string - work); + bline->line_number = -1; pp->expr_string = NULL; if (prev_bline) { @@ -928,7 +929,7 @@ static void kill_comments(yasm_preproc_gas *pp, char *line) return; } - strcpy(cstart, cend + 2); + memmove(cstart, cend + 2, strlen(cend + 2) + 1); pp->in_comment = FALSE; cstart = strstr(cstart, "/*"); next = 2; @@ -963,7 +964,7 @@ static void substitute_values(yasm_preproc_gas *pp, char *line) memcpy(line + cursor - len, value, value_length); } else { memcpy(line + cursor - len, value, value_length); - strcpy(line + cursor - len + value_length, line + cursor); + memmove(line + cursor - len + value_length, line + cursor, strlen(line + cursor) + 1); } pp->expr_string = line; pp->expr_string_cursor = cursor + delta; From 3ef8f426d735678d3679c76b4b98aa77e5d0e034 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 6 Aug 2010 08:14:51 +0000 Subject: [PATCH 388/585] Bump trunk internal version to 1.1.99. svn path=/trunk/yasm/; revision=2351 --- CMakeLists.txt | 4 ++-- Mkfiles/dj/config.h | 2 +- Mkfiles/vc10/config.h | 2 +- Mkfiles/vc9/config.h | 2 +- configure.ac | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0bbb68bf..9237329e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,8 +26,8 @@ IF(NOT CMAKE_BUILD_TYPE) FORCE) ENDIF(NOT CMAKE_BUILD_TYPE) -set (YASM_VERSION_MAJOR 0) -set (YASM_VERSION_MINOR 6) +set (YASM_VERSION_MAJOR 1) +set (YASM_VERSION_MINOR 1) set (YASM_VERSION_SUBMINOR 99) set (PACKAGE_INTVER "${YASM_VERSION_MAJOR}.${YASM_VERSION_MINOR}.${YASM_VERSION_SUBMINOR}") set (PACKAGE_BUILD "HEAD") diff --git a/Mkfiles/dj/config.h b/Mkfiles/dj/config.h index 0ce8a3f0..1d45e76b 100644 --- a/Mkfiles/dj/config.h +++ b/Mkfiles/dj/config.h @@ -122,7 +122,7 @@ #define PACKAGE_BUILD "HEAD" /* Define to internal version of this package. */ -#define PACKAGE_INTVER "0.7.99" +#define PACKAGE_INTVER "1.1.99" /* Define to the full name of this package. */ #define PACKAGE_NAME "yasm" diff --git a/Mkfiles/vc10/config.h b/Mkfiles/vc10/config.h index 96e2dddc..28aa8d10 100644 --- a/Mkfiles/vc10/config.h +++ b/Mkfiles/vc10/config.h @@ -120,7 +120,7 @@ #define PACKAGE_BUILD "HEAD" /* Define to internal version of this package. */ -#define PACKAGE_INTVER "0.7.99" +#define PACKAGE_INTVER "1.1.99" /* Define to the full name of this package. */ #define PACKAGE_NAME "yasm" diff --git a/Mkfiles/vc9/config.h b/Mkfiles/vc9/config.h index 96e2dddc..28aa8d10 100644 --- a/Mkfiles/vc9/config.h +++ b/Mkfiles/vc9/config.h @@ -120,7 +120,7 @@ #define PACKAGE_BUILD "HEAD" /* Define to internal version of this package. */ -#define PACKAGE_INTVER "0.7.99" +#define PACKAGE_INTVER "1.1.99" /* Define to the full name of this package. */ #define PACKAGE_NAME "yasm" diff --git a/configure.ac b/configure.ac index 638d654a..ae9dcf06 100644 --- a/configure.ac +++ b/configure.ac @@ -13,7 +13,7 @@ AC_CONFIG_HEADER([config.h]) AM_INIT_AUTOMAKE([1.9.6 foreign]) AM_MAINTAINER_MODE -AC_DEFINE(PACKAGE_INTVER, ["0.7.99"], +AC_DEFINE(PACKAGE_INTVER, ["1.1.99"], [Define to internal version of this package.]) AC_DEFINE(PACKAGE_BUILD, ["HEAD"], [Define to build version of this package.]) From 2678cb3c3a42b3870a209ed8de38c1a16449695a Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 14 Aug 2010 02:26:41 +0000 Subject: [PATCH 389/585] gas: Fix movsw/movzw memory operand encodings. The register versions worked okay due to size matching, but the memory versions relied on suffix matching, which wasn't being generated correctly. Reported by: Tony Goelz svn path=/trunk/yasm/; revision=2358 --- modules/arch/x86/gen_x86_insn.py | 4 +- modules/arch/x86/tests/gas64/gas-movsxs.asm | 14 +++ modules/arch/x86/tests/gas64/gas-movsxs.hex | 124 +++++++++++++++++--- 3 files changed, 127 insertions(+), 15 deletions(-) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index d04601e4..56af2735 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -560,11 +560,13 @@ def finalize_insns(): keyword = name else: keyword = name+suffix + keyword = keyword.lower() if keyword in gas_insns: raise ValueError("duplicate gas instruction %s" % keyword) newinsn = insn.copy() - newinsn.suffix = suffix + if insn.suffix is None: + newinsn.suffix = suffix newinsn.auto_cpu("gas") newinsn.auto_misc_flags("gas") gas_insns[keyword] = newinsn diff --git a/modules/arch/x86/tests/gas64/gas-movsxs.asm b/modules/arch/x86/tests/gas64/gas-movsxs.asm index 1aa1e97e..7216a8ca 100644 --- a/modules/arch/x86/tests/gas64/gas-movsxs.asm +++ b/modules/arch/x86/tests/gas64/gas-movsxs.asm @@ -16,3 +16,17 @@ movzbw %al, %ax movzwl %ax, %eax movzbq %al, %rax movzwq %ax, %rax + +movsbw 5,%ax +movsbl 5,%eax +movswl 5,%eax +movsbq 5,%rax +movswq 5,%rax +movsx 5,%eax +movzbw 5,%ax +movzbl 5,%eax +movzwl 5,%eax +movzbq 5,%rax +movzwq 5,%rax +movzx 5,%eax + diff --git a/modules/arch/x86/tests/gas64/gas-movsxs.hex b/modules/arch/x86/tests/gas64/gas-movsxs.hex index dc1dfd30..50abeba2 100644 --- a/modules/arch/x86/tests/gas64/gas-movsxs.hex +++ b/modules/arch/x86/tests/gas64/gas-movsxs.hex @@ -38,8 +38,8 @@ 00 00 00 -e0 -00 +40 +01 00 00 00 @@ -101,6 +101,110 @@ c0 0f b7 c0 +66 +0f +be +04 +25 +05 +00 +00 +00 +0f +be +04 +25 +05 +00 +00 +00 +0f +bf +04 +25 +05 +00 +00 +00 +48 +0f +be +04 +25 +05 +00 +00 +00 +48 +0f +bf +04 +25 +05 +00 +00 +00 +0f +be +04 +25 +05 +00 +00 +00 +66 +0f +b6 +04 +25 +05 +00 +00 +00 +0f +b6 +04 +25 +05 +00 +00 +00 +0f +b7 +04 +25 +05 +00 +00 +00 +48 +0f +b6 +04 +25 +05 +00 +00 +00 +48 +0f +b7 +04 +25 +05 +00 +00 +00 +0f +b6 +04 +25 +05 +00 +00 +00 +00 +00 00 00 2e @@ -278,14 +382,6 @@ ff 00 00 00 -00 -00 -00 -00 -00 -00 -00 -00 17 00 00 @@ -310,7 +406,7 @@ ff 00 00 00 -68 +d0 00 00 00 @@ -374,7 +470,7 @@ ff 00 00 00 -8c +f4 00 00 00 @@ -438,7 +534,7 @@ ff 00 00 00 -90 +f8 00 00 00 @@ -510,7 +606,7 @@ ff 00 00 00 -27 +8d 00 00 00 From 985038f102fc23c63e9012134dd35cfedf82e071 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Mon, 16 Aug 2010 02:28:36 +0000 Subject: [PATCH 390/585] dwarf2: Add support for .loc "discriminator" option. svn path=/trunk/yasm/; revision=2359 --- modules/dbgfmts/dwarf2/dwarf2-dbgfmt.h | 1 + modules/dbgfmts/dwarf2/dwarf2-line.c | 73 ++++++++++++++++++++++++-- 2 files changed, 70 insertions(+), 4 deletions(-) diff --git a/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.h b/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.h index 7331bf36..d939c1d4 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.h +++ b/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.h @@ -66,6 +66,7 @@ typedef struct dwarf2_loc { unsigned long file; /* index into table of filenames */ unsigned long line; /* source line number */ unsigned long column; /* source column */ + unsigned long discriminator; int isa_change; unsigned long isa; enum { diff --git a/modules/dbgfmts/dwarf2/dwarf2-line.c b/modules/dbgfmts/dwarf2/dwarf2-line.c index 3f7b96ed..b5d3ad35 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-line.c +++ b/modules/dbgfmts/dwarf2/dwarf2-line.c @@ -77,7 +77,8 @@ static unsigned char line_opcode_num_operands[DWARF2_LINE_OPCODE_BASE-1] = { typedef enum { DW_LNE_end_sequence = 1, DW_LNE_set_address, - DW_LNE_define_file + DW_LNE_define_file, + DW_LNE_set_discriminator } dwarf_line_number_ext_op; /* Base and range for line offsets in special opcodes */ @@ -120,6 +121,7 @@ typedef struct dwarf2_line_op { /* extended opcode */ dwarf_line_number_ext_op ext_opcode; /*@null@*/ /*@dependent@*/ yasm_symrec *ext_operand; /* unsigned */ + /*@null@*/ /*@dependent@*/ yasm_intnum *ext_operand_int; /* unsigned */ unsigned long ext_operandsize; } dwarf2_line_op; @@ -254,6 +256,7 @@ dwarf2_dbgfmt_append_line_op(yasm_section *sect, dwarf_line_number_op opcode, line_op->operand = operand; line_op->ext_opcode = 0; line_op->ext_operand = NULL; + line_op->ext_operand_int = NULL; line_op->ext_operandsize = 0; bc = yasm_bc_create_common(&dwarf2_line_op_bc_callback, line_op, 0); @@ -282,6 +285,31 @@ dwarf2_dbgfmt_append_line_ext_op(yasm_section *sect, line_op->operand = yasm_intnum_create_uint(ext_operandsize+1); line_op->ext_opcode = ext_opcode; line_op->ext_operand = ext_operand; + line_op->ext_operand_int = NULL; + line_op->ext_operandsize = ext_operandsize; + + bc = yasm_bc_create_common(&dwarf2_line_op_bc_callback, line_op, 0); + bc->len = 2 + yasm_intnum_size_leb128(line_op->operand, 0) + + ext_operandsize; + + yasm_dwarf2__append_bc(sect, bc); + return bc; +} + +static yasm_bytecode * +dwarf2_dbgfmt_append_line_ext_op_int(yasm_section *sect, + dwarf_line_number_ext_op ext_opcode, + /*@only@*/ yasm_intnum *ext_operand) +{ + dwarf2_line_op *line_op = yasm_xmalloc(sizeof(dwarf2_line_op)); + unsigned long ext_operandsize = yasm_intnum_size_leb128(ext_operand, 0); + yasm_bytecode *bc; + + line_op->opcode = DW_LNS_extended_op; + line_op->operand = yasm_intnum_create_uint(ext_operandsize+1); + line_op->ext_opcode = ext_opcode; + line_op->ext_operand = NULL; + line_op->ext_operand_int = ext_operand; line_op->ext_operandsize = ext_operandsize; bc = yasm_bc_create_common(&dwarf2_line_op_bc_callback, line_op, 0); @@ -344,6 +372,11 @@ dwarf2_dbgfmt_gen_line_op(yasm_section *debug_line, dwarf2_line_state *state, dwarf2_dbgfmt_append_line_op(debug_line, DW_LNS_set_column, yasm_intnum_create_uint(state->column)); } + if (loc->discriminator != 0) { + dwarf2_dbgfmt_append_line_ext_op_int(debug_line, + DW_LNE_set_discriminator, + yasm_intnum_create_uint(loc->discriminator)); + } #ifdef WITH_DWARF3 if (loc->isa_change) { state->isa = loc->isa; @@ -780,6 +813,8 @@ dwarf2_line_op_bc_destroy(void *contents) dwarf2_line_op *line_op = (dwarf2_line_op *)contents; if (line_op->operand) yasm_intnum_destroy(line_op->operand); + if (line_op->ext_operand_int) + yasm_intnum_destroy(line_op->ext_operand_int); yasm_xfree(contents); } @@ -820,6 +855,9 @@ dwarf2_line_op_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, (unsigned long)(buf-*bufp), bc, 0, d); buf += line_op->ext_operandsize; } + if (line_op->ext_operand_int) { + buf += yasm_intnum_get_leb128(line_op->ext_operand_int, buf, 0); + } } *bufp = buf; @@ -831,7 +869,7 @@ yasm_dwarf2__dir_loc(yasm_object *object, yasm_valparamhead *valparams, yasm_valparamhead *objext_valparams, unsigned long line) { yasm_valparam *vp; - int in_is_stmt = 0, in_isa = 0; + int in_is_stmt = 0, in_isa = 0, in_discriminator = 0; /*@dependent@*/ /*@null@*/ const yasm_intnum *intn; dwarf2_section_data *dsd; @@ -892,6 +930,7 @@ yasm_dwarf2__dir_loc(yasm_object *object, yasm_valparamhead *valparams, /* Defaults for optional settings */ loc->column = 0; + loc->discriminator = 0; loc->isa_change = 0; loc->isa = 0; loc->is_stmt = IS_STMT_NOCHANGE; @@ -966,11 +1005,33 @@ restart: loc->isa_change = 1; loc->isa = yasm_intnum_get_uint(intn); yasm_expr_destroy(e); + } else if (in_discriminator) { + in_discriminator = 0; + if (!(e = yasm_vp_expr(vp, object->symtab, line)) || + !(intn = yasm_expr_get_intnum(&e, 0))) { + yasm_error_set(YASM_ERROR_NOT_CONSTANT, + N_("discriminator value is not a constant")); + yasm_xfree(loc); + if (e) + yasm_expr_destroy(e); + return; + } + if (yasm_intnum_sign(intn) < 0) { + yasm_error_set(YASM_ERROR_VALUE, + N_("discriminator value less than zero")); + yasm_xfree(loc); + yasm_expr_destroy(e); + return; + } + loc->discriminator = yasm_intnum_get_uint(intn); + yasm_expr_destroy(e); } else if (!vp->val && (s = yasm_vp_id(vp))) { if (yasm__strcasecmp(s, "is_stmt") == 0) in_is_stmt = 1; else if (yasm__strcasecmp(s, "isa") == 0) in_isa = 1; + else if (yasm__strcasecmp(s, "discriminator") == 0) + in_discriminator = 1; else if (yasm__strcasecmp(s, "basic_block") == 0) loc->basic_block = 1; else if (yasm__strcasecmp(s, "prologue_end") == 0) @@ -989,15 +1050,19 @@ restart: } else if (yasm__strcasecmp(vp->val, "isa") == 0) { in_isa = 1; goto restart; /* don't go to the next valparam */ + } else if (yasm__strcasecmp(vp->val, "discriminator") == 0) { + in_discriminator = 1; + goto restart; /* don't go to the next valparam */ } else yasm_warn_set(YASM_WARN_GENERAL, N_("unrecognized loc option `%s'"), vp->val); vp = yasm_vps_next(vp); } - if (in_is_stmt || in_isa) { + if (in_is_stmt || in_isa || in_discriminator) { yasm_error_set(YASM_ERROR_SYNTAX, N_("%s requires value"), - in_is_stmt ? "is_stmt" : "isa"); + in_is_stmt ? "is_stmt" : + (in_isa ? "isa" : "discriminator")); yasm_xfree(loc); return; } From 5fb3213be3b2cd2b21ea5e6990f32a46e161b02d Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 17 Aug 2010 05:32:46 +0000 Subject: [PATCH 391/585] coff/win32/win64: Add support for .def, .scl, .type, and .endef directives. These can be used to set a specific value for the coff sclass and type symbol fields. svn path=/trunk/yasm/; revision=2360 --- .../tests/passwin64/dwarfwin64_testhd.errwarn | 2 +- modules/objfmts/coff/coff-objfmt.c | 107 +++++++++++ modules/objfmts/win32/tests/gas/Makefile.inc | 2 + modules/objfmts/win32/tests/gas/win32def.asm | 7 + modules/objfmts/win32/tests/gas/win32def.hex | 172 ++++++++++++++++++ 5 files changed, 289 insertions(+), 1 deletion(-) create mode 100644 modules/objfmts/win32/tests/gas/win32def.asm create mode 100644 modules/objfmts/win32/tests/gas/win32def.hex diff --git a/modules/dbgfmts/dwarf2/tests/passwin64/dwarfwin64_testhd.errwarn b/modules/dbgfmts/dwarf2/tests/passwin64/dwarfwin64_testhd.errwarn index d383da2a..be2a237e 100644 --- a/modules/dbgfmts/dwarf2/tests/passwin64/dwarfwin64_testhd.errwarn +++ b/modules/dbgfmts/dwarf2/tests/passwin64/dwarfwin64_testhd.errwarn @@ -4,7 +4,7 @@ -:10: warning: unrecognized section attribute: `M' -:10: warning: unrecognized section attribute: `S' -:10: warning: Unrecognized qualifier `progbits' --:24: warning: directive `.type' not recognized +-:24: warning: .type pseudo-op used outside of .def/.endef; ignored -:152: warning: directive `.size' not recognized -:153: warning: Unrecognized qualifier `progbits' -:190: warning: Unrecognized qualifier `progbits' diff --git a/modules/objfmts/coff/coff-objfmt.c b/modules/objfmts/coff/coff-objfmt.c index 87bdd6b6..d2505e08 100644 --- a/modules/objfmts/coff/coff-objfmt.c +++ b/modules/objfmts/coff/coff-objfmt.c @@ -183,6 +183,9 @@ typedef struct yasm_objfmt_coff { coff_symrec_data *filesym_data; /* Data for .file symbol */ + /* data for .def/.endef and related directives */ + coff_symrec_data *def_sym; /* symbol specified by .def */ + /* data for win64 proc_frame and related directives */ unsigned long proc_frame; /* Line number of start of proc, or 0 */ unsigned long done_prolog; /* Line number of end of prologue, or 0 */ @@ -1839,6 +1842,98 @@ dir_ident(yasm_object *object, yasm_valparamhead *valparams, yasm_bc_create_data(&dvs, 1, 1, object->arch, line)); } +static void +dir_def(yasm_object *object, yasm_valparamhead *valparams, + yasm_valparamhead *objext_valparams, unsigned long line) +{ + yasm_objfmt_coff *objfmt_coff = (yasm_objfmt_coff *)object->objfmt; + yasm_valparam *vp; + const char *symname; + yasm_symrec *sym; + coff_symrec_data *sym_data; + + if (objfmt_coff->def_sym) { + yasm_warn_set(YASM_WARN_GENERAL, + N_(".def pseudo-op used inside of .def/.endef; ignored")); + return; + } + + vp = yasm_vps_first(valparams); + symname = yasm_vp_id(vp); + if (!symname) { + yasm_error_set(YASM_ERROR_SYNTAX, + N_("argument to SAFESEH must be symbol name")); + return; + } + + sym = yasm_symtab_get(object->symtab, symname); + sym_data = yasm_symrec_get_data(sym, &coff_symrec_data_cb); + if (!sym_data) { + sym_data = coff_objfmt_sym_set_data(sym, COFF_SCL_NULL, 0, + COFF_SYMTAB_AUX_NONE); + } + objfmt_coff->def_sym = sym_data; +} + +static void +dir_scl(yasm_object *object, yasm_valparamhead *valparams, + yasm_valparamhead *objext_valparams, unsigned long line) +{ + yasm_objfmt_coff *objfmt_coff = (yasm_objfmt_coff *)object->objfmt; + yasm_intnum *intn = NULL; + + if (!objfmt_coff->def_sym) { + yasm_warn_set(YASM_WARN_GENERAL, + N_("%s pseudo-op used outside of .def/.endef; ignored"), + ".scl"); + return; + } + + if (yasm_dir_helper_intn(object, yasm_vps_first(valparams), line, + &intn, 0) < 0) + return; + if (!intn) + return; + objfmt_coff->def_sym->sclass = yasm_intnum_get_uint(intn); + yasm_intnum_destroy(intn); +} + +static void +dir_type(yasm_object *object, yasm_valparamhead *valparams, + yasm_valparamhead *objext_valparams, unsigned long line) +{ + yasm_objfmt_coff *objfmt_coff = (yasm_objfmt_coff *)object->objfmt; + yasm_intnum *intn = NULL; + + if (!objfmt_coff->def_sym) { + yasm_warn_set(YASM_WARN_GENERAL, + N_("%s pseudo-op used outside of .def/.endef; ignored"), + ".type"); + return; + } + + if (yasm_dir_helper_intn(object, yasm_vps_first(valparams), line, + &intn, 0) < 0) + return; + if (!intn) + return; + objfmt_coff->def_sym->type = yasm_intnum_get_uint(intn); + yasm_intnum_destroy(intn); +} + +static void +dir_endef(yasm_object *object, yasm_valparamhead *valparams, + yasm_valparamhead *objext_valparams, unsigned long line) +{ + yasm_objfmt_coff *objfmt_coff = (yasm_objfmt_coff *)object->objfmt; + if (!objfmt_coff->def_sym) { + yasm_warn_set(YASM_WARN_GENERAL, + N_(".endef pseudo-op used before .def; ignored")); + return; + } + objfmt_coff->def_sym = NULL; +} + static void dir_proc_frame(yasm_object *object, /*@null@*/ yasm_valparamhead *valparams, yasm_valparamhead *objext_valparams, unsigned long line) @@ -2194,6 +2289,10 @@ static const char *coff_objfmt_dbgfmt_keywords[] = { static const yasm_directive coff_objfmt_directives[] = { { ".ident", "gas", dir_ident, YASM_DIR_ANY }, { "ident", "nasm", dir_ident, YASM_DIR_ANY }, + { ".def", "gas", dir_def, YASM_DIR_ID_REQUIRED }, + { ".endef", "gas", dir_endef, YASM_DIR_ANY }, + { ".scl", "gas", dir_scl, YASM_DIR_ARG_REQUIRED }, + { ".type", "gas", dir_type, YASM_DIR_ARG_REQUIRED }, { NULL, NULL, NULL, 0 } }; @@ -2228,6 +2327,10 @@ static const char *winXX_objfmt_dbgfmt_keywords[] = { static const yasm_directive win32_objfmt_directives[] = { { ".ident", "gas", dir_ident, YASM_DIR_ANY }, { "ident", "nasm", dir_ident, YASM_DIR_ANY }, + { ".def", "gas", dir_def, YASM_DIR_ID_REQUIRED }, + { ".endef", "gas", dir_endef, YASM_DIR_ANY }, + { ".scl", "gas", dir_scl, YASM_DIR_ARG_REQUIRED }, + { ".type", "gas", dir_type, YASM_DIR_ARG_REQUIRED }, { ".export", "gas", dir_export, YASM_DIR_ID_REQUIRED }, { "export", "nasm", dir_export, YASM_DIR_ID_REQUIRED }, { ".safeseh", "gas", dir_safeseh, YASM_DIR_ID_REQUIRED }, @@ -2273,6 +2376,10 @@ yasm_objfmt_module yasm_win32_LTX_objfmt = { static const yasm_directive win64_objfmt_directives[] = { { ".ident", "gas", dir_ident, YASM_DIR_ANY }, { "ident", "nasm", dir_ident, YASM_DIR_ANY }, + { ".def", "gas", dir_def, YASM_DIR_ID_REQUIRED }, + { ".endef", "gas", dir_endef, YASM_DIR_ANY }, + { ".scl", "gas", dir_scl, YASM_DIR_ARG_REQUIRED }, + { ".type", "gas", dir_type, YASM_DIR_ARG_REQUIRED }, { ".export", "gas", dir_export, YASM_DIR_ID_REQUIRED }, { "export", "nasm", dir_export, YASM_DIR_ID_REQUIRED }, { ".proc_frame", "gas", dir_proc_frame, YASM_DIR_ID_REQUIRED }, diff --git a/modules/objfmts/win32/tests/gas/Makefile.inc b/modules/objfmts/win32/tests/gas/Makefile.inc index fb319233..8a00372c 100644 --- a/modules/objfmts/win32/tests/gas/Makefile.inc +++ b/modules/objfmts/win32/tests/gas/Makefile.inc @@ -5,3 +5,5 @@ TESTS += modules/objfmts/win32/tests/gas/win32_gas_test.sh EXTRA_DIST += modules/objfmts/win32/tests/gas/win32_gas_test.sh EXTRA_DIST += modules/objfmts/win32/tests/gas/win32at.asm EXTRA_DIST += modules/objfmts/win32/tests/gas/win32at.hex +EXTRA_DIST += modules/objfmts/win32/tests/gas/win32def.asm +EXTRA_DIST += modules/objfmts/win32/tests/gas/win32def.hex diff --git a/modules/objfmts/win32/tests/gas/win32def.asm b/modules/objfmts/win32/tests/gas/win32def.asm new file mode 100644 index 00000000..e4764668 --- /dev/null +++ b/modules/objfmts/win32/tests/gas/win32def.asm @@ -0,0 +1,7 @@ +.globl label +label: + +.def label +.scl 2 +.type 32 +.endef diff --git a/modules/objfmts/win32/tests/gas/win32def.hex b/modules/objfmts/win32/tests/gas/win32def.hex new file mode 100644 index 00000000..bfedd51b --- /dev/null +++ b/modules/objfmts/win32/tests/gas/win32def.hex @@ -0,0 +1,172 @@ +4c +01 +01 +00 +00 +00 +00 +00 +3c +00 +00 +00 +06 +00 +00 +00 +00 +00 +0c +01 +2e +74 +65 +78 +74 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +20 +00 +50 +60 +2e +66 +69 +6c +65 +00 +00 +00 +00 +00 +00 +00 +fe +ff +00 +00 +67 +01 +2d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +40 +66 +65 +61 +74 +2e +30 +30 +01 +00 +00 +00 +ff +ff +00 +00 +03 +00 +2e +74 +65 +78 +74 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +03 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +6c +61 +62 +65 +6c +00 +00 +00 +00 +00 +00 +00 +01 +00 +20 +00 +02 +00 +04 +00 +00 +00 From 2f82e3a7bad36fde302d47ea3f64a48f9b90b9d3 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 17 Aug 2010 05:36:18 +0000 Subject: [PATCH 392/585] coff dir_def(): Use symtab_use() instead of symtab_get(). svn path=/trunk/yasm/; revision=2361 --- modules/objfmts/coff/coff-objfmt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/objfmts/coff/coff-objfmt.c b/modules/objfmts/coff/coff-objfmt.c index d2505e08..09e58c6e 100644 --- a/modules/objfmts/coff/coff-objfmt.c +++ b/modules/objfmts/coff/coff-objfmt.c @@ -1866,7 +1866,7 @@ dir_def(yasm_object *object, yasm_valparamhead *valparams, return; } - sym = yasm_symtab_get(object->symtab, symname); + sym = yasm_symtab_use(object->symtab, symname, line); sym_data = yasm_symrec_get_data(sym, &coff_symrec_data_cb); if (!sym_data) { sym_data = coff_objfmt_sym_set_data(sym, COFF_SCL_NULL, 0, From 72df1b52a25e8b4d6853ffe5a724921443413dee Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 18 Aug 2010 06:21:08 +0000 Subject: [PATCH 393/585] Add yasm_dv_get_value() to get yasm_value from yasm_dataval. svn path=/trunk/yasm/; revision=2362 --- libyasm/bc-data.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libyasm/bc-data.c b/libyasm/bc-data.c index 3191958b..1a62d200 100644 --- a/libyasm/bc-data.c +++ b/libyasm/bc-data.c @@ -480,6 +480,14 @@ yasm_dv_create_reserve(void) return retval; } +yasm_value * +yasm_dv_get_value(yasm_dataval *dv) +{ + if (dv->type != DV_VALUE) + return NULL; + return &dv->data.val; +} + void yasm_dv_set_multiple(yasm_dataval *dv, yasm_expr *e) { From 50017b49af0b83359912bac0aa092a821e563b0a Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 18 Aug 2010 06:21:34 +0000 Subject: [PATCH 394/585] Add prototype for yasm_dv_get_value(). svn path=/trunk/yasm/; revision=2363 --- libyasm/bytecode.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libyasm/bytecode.h b/libyasm/bytecode.h index d5a98995..0753ccf5 100644 --- a/libyasm/bytecode.h +++ b/libyasm/bytecode.h @@ -575,6 +575,12 @@ yasm_dataval *yasm_dv_create_reserve(void); (unsigned long)(l)) #endif +/** Get the underlying value of a data value. + * \param dv data value + * \return Value, or null if non-value (e.g. string or raw). + */ +yasm_value *yasm_dv_get_value(yasm_dataval *dv); + /** Set multiple field of a data value. * A data value can be repeated a number of times when output. This function * sets that multiple. From 7263e1d241bd776ecc270fcc0342863d3689c6f6 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 18 Aug 2010 06:23:06 +0000 Subject: [PATCH 395/585] Implement yasm_value_finalize_expr() using yasm_value_finalize(). Previously this was implemented the opposite way, contrary to its documentation. This resulted in clearing any already set yasm_value relative fields. svn path=/trunk/yasm/; revision=2364 --- libyasm/value.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/libyasm/value.c b/libyasm/value.c index a49daa03..e85d54b2 100644 --- a/libyasm/value.c +++ b/libyasm/value.c @@ -453,10 +453,17 @@ yasm_value_finalize_expr(yasm_value *value, yasm_expr *e, yasm_value_initialize(value, NULL, size); return 0; } + yasm_value_initialize(value, e, size); + return yasm_value_finalize(value, precbc); +} - yasm_value_initialize(value, - yasm_expr__level_tree(e, 1, 1, 0, 0, NULL, NULL), - size); +int +yasm_value_finalize(yasm_value *value, yasm_bytecode *precbc) +{ + if (!value->abs) + return 0; + + value->abs = yasm_expr__level_tree(value->abs, 1, 1, 0, 0, NULL, NULL); /* quit early if there was an issue in simplify() */ if (yasm_error_occurred()) @@ -549,13 +556,6 @@ yasm_value_finalize_expr(yasm_value *value, yasm_expr *e, return 0; } -int -yasm_value_finalize(yasm_value *value, yasm_bytecode *precbc) -{ - unsigned int valsize = value->size; - return yasm_value_finalize_expr(value, value->abs, precbc, valsize); -} - yasm_intnum * yasm_value_get_intnum(yasm_value *value, yasm_bytecode *bc, int calc_bc_dist) { From bafc905860d88a8cdf86cd8dbfc48b8e1f91fc68 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 18 Aug 2010 06:23:30 +0000 Subject: [PATCH 396/585] coff: Add support for gas .secrel32 directive. svn path=/trunk/yasm/; revision=2365 --- modules/objfmts/coff/coff-objfmt.c | 40 +- modules/objfmts/win32/tests/gas/Makefile.inc | 2 + .../objfmts/win32/tests/gas/win32secrel32.asm | 80 ++ .../objfmts/win32/tests/gas/win32secrel32.hex | 778 ++++++++++++++++++ 4 files changed, 898 insertions(+), 2 deletions(-) create mode 100644 modules/objfmts/win32/tests/gas/win32secrel32.asm create mode 100644 modules/objfmts/win32/tests/gas/win32secrel32.hex diff --git a/modules/objfmts/coff/coff-objfmt.c b/modules/objfmts/coff/coff-objfmt.c index 09e58c6e..0f941569 100644 --- a/modules/objfmts/coff/coff-objfmt.c +++ b/modules/objfmts/coff/coff-objfmt.c @@ -572,8 +572,8 @@ coff_objfmt_output_value(yasm_value *value, unsigned char *buf, intn_minus = bc->offset; } - if (value->seg_of || value->section_rel) { - /* Segment or section-relative generation; zero value. */ + if (value->seg_of) { + /* Segment generation; zero value. */ intn_val = 0; intn_minus = 0; } @@ -1842,6 +1842,39 @@ dir_ident(yasm_object *object, yasm_valparamhead *valparams, yasm_bc_create_data(&dvs, 1, 1, object->arch, line)); } +static void +dir_secrel32(yasm_object *object, yasm_valparamhead *valparams, + yasm_valparamhead *objext_valparams, unsigned long line) +{ + yasm_datavalhead dvs; + yasm_valparam *vp; + + if (!object->cur_section) { + yasm_error_set(YASM_ERROR_SYNTAX, + N_(".secrel32 can only be used inside of a section")); + return; + } + + vp = yasm_vps_first(valparams); + yasm_dvs_initialize(&dvs); + do { + yasm_expr *e = yasm_vp_expr(vp, object->symtab, line); + yasm_dataval *dv; + if (!e) { + yasm_error_set(YASM_ERROR_VALUE, + N_(".secrel32 requires expressions")); + yasm_dvs_delete(&dvs); + return; + } + dv = yasm_dv_create_expr(e); + yasm_dv_get_value(dv)->section_rel = 1; + yasm_dvs_append(&dvs, dv); + } while ((vp = yasm_vps_next(vp))); + + yasm_section_bcs_append(object->cur_section, + yasm_bc_create_data(&dvs, 4, 0, object->arch, line)); +} + static void dir_def(yasm_object *object, yasm_valparamhead *valparams, yasm_valparamhead *objext_valparams, unsigned long line) @@ -2293,6 +2326,7 @@ static const yasm_directive coff_objfmt_directives[] = { { ".endef", "gas", dir_endef, YASM_DIR_ANY }, { ".scl", "gas", dir_scl, YASM_DIR_ARG_REQUIRED }, { ".type", "gas", dir_type, YASM_DIR_ARG_REQUIRED }, + { ".secrel32", "gas", dir_secrel32, YASM_DIR_ARG_REQUIRED }, { NULL, NULL, NULL, 0 } }; @@ -2331,6 +2365,7 @@ static const yasm_directive win32_objfmt_directives[] = { { ".endef", "gas", dir_endef, YASM_DIR_ANY }, { ".scl", "gas", dir_scl, YASM_DIR_ARG_REQUIRED }, { ".type", "gas", dir_type, YASM_DIR_ARG_REQUIRED }, + { ".secrel32", "gas", dir_secrel32, YASM_DIR_ARG_REQUIRED }, { ".export", "gas", dir_export, YASM_DIR_ID_REQUIRED }, { "export", "nasm", dir_export, YASM_DIR_ID_REQUIRED }, { ".safeseh", "gas", dir_safeseh, YASM_DIR_ID_REQUIRED }, @@ -2380,6 +2415,7 @@ static const yasm_directive win64_objfmt_directives[] = { { ".endef", "gas", dir_endef, YASM_DIR_ANY }, { ".scl", "gas", dir_scl, YASM_DIR_ARG_REQUIRED }, { ".type", "gas", dir_type, YASM_DIR_ARG_REQUIRED }, + { ".secrel32", "gas", dir_secrel32, YASM_DIR_ARG_REQUIRED }, { ".export", "gas", dir_export, YASM_DIR_ID_REQUIRED }, { "export", "nasm", dir_export, YASM_DIR_ID_REQUIRED }, { ".proc_frame", "gas", dir_proc_frame, YASM_DIR_ID_REQUIRED }, diff --git a/modules/objfmts/win32/tests/gas/Makefile.inc b/modules/objfmts/win32/tests/gas/Makefile.inc index 8a00372c..b2948acf 100644 --- a/modules/objfmts/win32/tests/gas/Makefile.inc +++ b/modules/objfmts/win32/tests/gas/Makefile.inc @@ -7,3 +7,5 @@ EXTRA_DIST += modules/objfmts/win32/tests/gas/win32at.asm EXTRA_DIST += modules/objfmts/win32/tests/gas/win32at.hex EXTRA_DIST += modules/objfmts/win32/tests/gas/win32def.asm EXTRA_DIST += modules/objfmts/win32/tests/gas/win32def.hex +EXTRA_DIST += modules/objfmts/win32/tests/gas/win32secrel32.asm +EXTRA_DIST += modules/objfmts/win32/tests/gas/win32secrel32.hex diff --git a/modules/objfmts/win32/tests/gas/win32secrel32.asm b/modules/objfmts/win32/tests/gas/win32secrel32.asm new file mode 100644 index 00000000..0e8a82f7 --- /dev/null +++ b/modules/objfmts/win32/tests/gas/win32secrel32.asm @@ -0,0 +1,80 @@ +# [oformat win32] +.text + + .ascii ">>>>" +pre04: .ascii "<<<<" + .ascii ">>>>>" +pre0d: .ascii "<<<" + .ascii ">>>>>>" +pre16: .ascii "<<" + .ascii ">>>>>>>" +pre1f: .ascii "<" + +.data + + .ascii ">>>>" +sam04: .ascii "<<<<" + .ascii ">>>>>" +sam0d: .ascii "<<<" + .ascii ">>>>>>" +sam16: .ascii "<<" + .ascii ">>>>>>>" +sam1f: .ascii "<" + + .ascii ">>>>" + .secrel32 pre04 + .byte 0x11 + .secrel32 pre0d + .byte 0x11 + .secrel32 pre16 + .byte 0x11 + .secrel32 pre1f + .byte 0x11 + .ascii "<<<<<<<<" + + .ascii ">>>>" + .secrel32 sam04 + .byte 0x11 + .secrel32 sam0d + .byte 0x11 + .secrel32 sam16 + .byte 0x11 + .secrel32 sam1f + .byte 0x11 + .ascii "<<<<<<<<" + + .ascii ">>>>" + .secrel32 nex04 + .byte 0x11 + .secrel32 nex0d + .byte 0x11 + .secrel32 nex16 + .byte 0x11 + .secrel32 nex1f + .byte 0x11 + .ascii "<<<<<<<<" + + .ascii ">>>>" + .secrel32 ext24 + .byte 0x11 + .secrel32 ext2d + .byte 0x11 + .secrel32 ext36 + .byte 0x11 + .secrel32 ext3f + .byte 0x11 + .ascii "<<<<<<<<" + +.section .rdata + + .ascii ">>>>" +nex04: .ascii "<<<<" + .ascii ">>>>>" +nex0d: .ascii "<<<" + .ascii ">>>>>>" +nex16: .ascii "<<" + .ascii ">>>>>>>" +nex1f: .ascii "<" + .ascii ">>>>" + + .p2align 4,0 diff --git a/modules/objfmts/win32/tests/gas/win32secrel32.hex b/modules/objfmts/win32/tests/gas/win32secrel32.hex new file mode 100644 index 00000000..28cc8643 --- /dev/null +++ b/modules/objfmts/win32/tests/gas/win32secrel32.hex @@ -0,0 +1,778 @@ +4c +01 +03 +00 +00 +00 +00 +00 +1c +02 +00 +00 +0d +00 +00 +00 +00 +00 +0c +01 +2e +74 +65 +78 +74 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +20 +00 +00 +00 +8c +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +20 +00 +50 +60 +2e +64 +61 +74 +61 +00 +00 +00 +20 +00 +00 +00 +00 +00 +00 +00 +a0 +00 +00 +00 +ac +00 +00 +00 +4c +01 +00 +00 +00 +00 +00 +00 +10 +00 +00 +00 +40 +00 +30 +c0 +2e +72 +64 +61 +74 +61 +00 +00 +c0 +00 +00 +00 +00 +00 +00 +00 +30 +00 +00 +00 +ec +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +40 +00 +50 +40 +3e +3e +3e +3e +3c +3c +3c +3c +3e +3e +3e +3e +3e +3c +3c +3c +3e +3e +3e +3e +3e +3e +3c +3c +3e +3e +3e +3e +3e +3e +3e +3c +3e +3e +3e +3e +3c +3c +3c +3c +3e +3e +3e +3e +3e +3c +3c +3c +3e +3e +3e +3e +3e +3e +3c +3c +3e +3e +3e +3e +3e +3e +3e +3c +3e +3e +3e +3e +04 +00 +00 +00 +11 +0d +00 +00 +00 +11 +16 +00 +00 +00 +11 +1f +00 +00 +00 +11 +3c +3c +3c +3c +3c +3c +3c +3c +3e +3e +3e +3e +04 +00 +00 +00 +11 +0d +00 +00 +00 +11 +16 +00 +00 +00 +11 +1f +00 +00 +00 +11 +3c +3c +3c +3c +3c +3c +3c +3c +3e +3e +3e +3e +04 +00 +00 +00 +11 +0d +00 +00 +00 +11 +16 +00 +00 +00 +11 +1f +00 +00 +00 +11 +3c +3c +3c +3c +3c +3c +3c +3c +3e +3e +3e +3e +00 +00 +00 +00 +11 +00 +00 +00 +00 +11 +00 +00 +00 +00 +11 +00 +00 +00 +00 +11 +3c +3c +3c +3c +3c +3c +3c +3c +24 +00 +00 +00 +03 +00 +00 +00 +0b +00 +29 +00 +00 +00 +03 +00 +00 +00 +0b +00 +2e +00 +00 +00 +03 +00 +00 +00 +0b +00 +33 +00 +00 +00 +03 +00 +00 +00 +0b +00 +44 +00 +00 +00 +05 +00 +00 +00 +0b +00 +49 +00 +00 +00 +05 +00 +00 +00 +0b +00 +4e +00 +00 +00 +05 +00 +00 +00 +0b +00 +53 +00 +00 +00 +05 +00 +00 +00 +0b +00 +64 +00 +00 +00 +0b +00 +00 +00 +0b +00 +69 +00 +00 +00 +0b +00 +00 +00 +0b +00 +6e +00 +00 +00 +0b +00 +00 +00 +0b +00 +73 +00 +00 +00 +0b +00 +00 +00 +0b +00 +84 +00 +00 +00 +07 +00 +00 +00 +0b +00 +89 +00 +00 +00 +08 +00 +00 +00 +0b +00 +8e +00 +00 +00 +09 +00 +00 +00 +0b +00 +93 +00 +00 +00 +0a +00 +00 +00 +0b +00 +3e +3e +3e +3e +3c +3c +3c +3c +3e +3e +3e +3e +3e +3c +3c +3c +3e +3e +3e +3e +3e +3e +3c +3c +3e +3e +3e +3e +3e +3e +3e +3c +3e +3e +3e +3e +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +2e +66 +69 +6c +65 +00 +00 +00 +00 +00 +00 +00 +fe +ff +00 +00 +67 +01 +2d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +40 +66 +65 +61 +74 +2e +30 +30 +01 +00 +00 +00 +ff +ff +00 +00 +03 +00 +2e +74 +65 +78 +74 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +03 +01 +20 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +2e +64 +61 +74 +61 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +03 +01 +a0 +00 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +65 +78 +74 +32 +34 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +02 +00 +65 +78 +74 +32 +64 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +02 +00 +65 +78 +74 +33 +36 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +02 +00 +65 +78 +74 +33 +66 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +02 +00 +2e +72 +64 +61 +74 +61 +00 +00 +00 +00 +00 +00 +03 +00 +00 +00 +03 +01 +30 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +00 +00 From 5355299056d298c91e5528eb61f05122cb41914f Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 21 Aug 2010 07:32:54 +0000 Subject: [PATCH 397/585] Improve gas syntax .set directive to better match GNU as behavior. - Add support for deferred symbols (those which depend on other symbols that have not yet been .set) - Add support for re-defining symbols - Add support for 0x hex notation in literals Contributed by: Alexei Svitkine svn path=/trunk/yasm/; revision=2366 --- modules/parsers/gas/tests/bin/gas-set.asm | 34 ++- modules/parsers/gas/tests/bin/gas-set.hex | 11 + modules/preprocs/gas/gas-eval.c | 1 + modules/preprocs/gas/gas-preproc.c | 307 ++++++++++++++++------ 4 files changed, 276 insertions(+), 77 deletions(-) diff --git a/modules/parsers/gas/tests/bin/gas-set.asm b/modules/parsers/gas/tests/bin/gas-set.asm index 24f278fb..6bce4a2f 100644 --- a/modules/parsers/gas/tests/bin/gas-set.asm +++ b/modules/parsers/gas/tests/bin/gas-set.asm @@ -1,2 +1,34 @@ +.set bar,(foo-1) .set foo,5 -.byte foo +.byte foo /* 0x5 */ +.byte bar /* 0x4 */ +.set foo,6 +.byte foo /* 0x6 */ +.byte bar /* 0x4 */ +.set bar,10 +.byte bar /* 0xa */ +.set bar,foo+1 +.byte bar /* 0x7 */ +.set bar,bar+1 +.byte bar /* 0x8 */ +.set bar,5 +.set bam,bar-1 +.set bar,1 +.byte bam /* 0x4 */ +.set bar, boo + 1 +.set boo, 5 +.set boo, 6 +.byte bar /* 0x6 */ +.set a, b+c +.set b, 0x1 +.set b, 0x2 +.set c, 0x10 +.set c, 0x20 +.byte a /* 0x11 */ +.set x, 5 +.set y, x+z +.set x, 10 +.set z, 1 +.byte y /* 0x6 */ +.set z, 0xfe +.byte z /* 0xfe */ diff --git a/modules/parsers/gas/tests/bin/gas-set.hex b/modules/parsers/gas/tests/bin/gas-set.hex index f62fa93d..54ccb308 100644 --- a/modules/parsers/gas/tests/bin/gas-set.hex +++ b/modules/parsers/gas/tests/bin/gas-set.hex @@ -1 +1,12 @@ 05 +04 +06 +04 +0a +07 +08 +04 +06 +11 +06 +fe diff --git a/modules/preprocs/gas/gas-eval.c b/modules/preprocs/gas/gas-eval.c index db70d7fd..3625c7a9 100644 --- a/modules/preprocs/gas/gas-eval.c +++ b/modules/preprocs/gas/gas-eval.c @@ -382,6 +382,7 @@ static yasm_expr *expr6(void) switch (i) { case TOKEN_NUM: e = yasm_expr_create_ident(yasm_expr_int(tokval->t_integer), 0); + tokval->t_integer = NULL; break; case TOKEN_ID: if (symtab) { diff --git a/modules/preprocs/gas/gas-preproc.c b/modules/preprocs/gas/gas-preproc.c index 86060d74..8f47ec8f 100644 --- a/modules/preprocs/gas/gas-preproc.c +++ b/modules/preprocs/gas/gas-preproc.c @@ -60,6 +60,18 @@ typedef struct macro_entry { STAILQ_ENTRY(macro_entry) next; } macro_entry; +typedef struct deferred_define { + char *name; + char *value; + SLIST_ENTRY(deferred_define) next; +} deferred_define; + +typedef struct expr_state { + const char *string; + char *symbol; + int string_cursor; +} expr_state; + typedef struct yasm_preproc_gas { yasm_preproc_base preproc; /* base structure */ @@ -67,15 +79,14 @@ typedef struct yasm_preproc_gas { char *in_filename; yasm_symtab *defines; + SLIST_HEAD(deferred_defines_head, deferred_define) deferred_defines; int depth; int skip_depth; int in_comment; - const char *expr_string; - char *expr_symbol; - int expr_string_cursor; + expr_state expr; SLIST_HEAD(buffered_lines_head, buffered_line) buffered_lines; SLIST_HEAD(included_files_head, included_file) included_files; @@ -88,10 +99,15 @@ typedef struct yasm_preproc_gas { yasm_linemap *cur_lm; yasm_errwarns *errwarns; int fatal_error; + int detect_errors_only; } yasm_preproc_gas; yasm_preproc_module yasm_gas_LTX_preproc; +/* Forward declarations. */ + +static int substitute_values(yasm_preproc_gas *pp, char **line_ptr); + /* String helpers. */ static const char *starts_with(const char *big, const char *little) @@ -278,17 +294,44 @@ static const char *get_arg(yasm_preproc_gas *pp, const char *src, char *dest, si static char get_char(yasm_preproc_gas *pp) { - return pp->expr_string[pp->expr_string_cursor]; + return pp->expr.string[pp->expr.string_cursor]; } static const char *get_str(yasm_preproc_gas *pp) { - return pp->expr_string + pp->expr_string_cursor; + return pp->expr.string + pp->expr.string_cursor; } static void next_char(yasm_preproc_gas *pp) { - pp->expr_string_cursor++; + pp->expr.string_cursor++; +} + +static int ishex(char c) +{ + c = tolower(c); + return isdigit(c) || (c >= 'a' && c <= 'f'); +} + +static void gas_scan_init(yasm_preproc_gas *pp, struct tokenval *tokval, const char *arg1) +{ + pp->expr.symbol = NULL; + pp->expr.string = arg1; + pp->expr.string_cursor = 0; + memset(tokval, 0, sizeof(struct tokenval)); + tokval->t_type = TOKEN_INVALID; +} + +static void gas_scan_cleanup(yasm_preproc_gas *pp, struct tokenval *tokval) +{ + if (tokval->t_integer) { + yasm_intnum_destroy(tokval->t_integer); + tokval->t_integer = NULL; + } + if (pp->expr.symbol) { + yasm_xfree(pp->expr.symbol); + pp->expr.symbol = NULL; + } } static int gas_scan(void *preproc, struct tokenval *tokval) @@ -311,12 +354,34 @@ static int gas_scan(void *preproc, struct tokenval *tokval) } if (isdigit(c)) { + int char_index = 0; int value = 0; + do { value = value*10 + (c - '0'); + char_index++; next_char(pp); c = get_char(pp); + if (char_index == 1 && c == 'x' && value == 0) { + next_char(pp); + c = get_char(pp); + /* Hex notation. */ + while (ishex(c)) { + if (isdigit(c)) { + value = (value << 4) | (c - '0'); + } else { + value = (value << 4) | (tolower(c) - 'a' + 0xa); + } + next_char(pp); + c = get_char(pp); + } + break; + } } while (isdigit(c)); + + if (tokval->t_integer) { + yasm_intnum_destroy(tokval->t_integer); + } tokval->t_integer = yasm_intnum_create_int(value); return tokval->t_type = TOKEN_NUM; } @@ -373,12 +438,12 @@ static int gas_scan(void *preproc, struct tokenval *tokval) c = get_char(pp); } - pp->expr_symbol = yasm_xrealloc(pp->expr_symbol, symbol_length + 1); - memcpy(pp->expr_symbol, str, symbol_length); - pp->expr_symbol[symbol_length] = '\0'; + pp->expr.symbol = yasm_xrealloc(pp->expr.symbol, symbol_length + 1); + memcpy(pp->expr.symbol, str, symbol_length); + pp->expr.symbol[symbol_length] = '\0'; tokval->t_type = TOKEN_ID; - tokval->t_charptr = pp->expr_symbol; + tokval->t_charptr = pp->expr.symbol; } } @@ -390,10 +455,12 @@ static void gas_err(void *private_data, int severity, const char *fmt, ...) va_list args; yasm_preproc_gas *pp = private_data; - va_start(args, fmt); - yasm_error_set_va(YASM_ERROR_SYNTAX, N_(fmt), args); - yasm_errwarn_propagate(pp->errwarns, pp->current_line_number); - va_end(args); + if (!pp->detect_errors_only) { + va_start(args, fmt); + yasm_error_set_va(YASM_ERROR_SYNTAX, N_(fmt), args); + yasm_errwarn_propagate(pp->errwarns, pp->current_line_number); + va_end(args); + } pp->fatal_error = 1; } @@ -404,25 +471,20 @@ static long eval_expr(yasm_preproc_gas *pp, const char *arg1) yasm_expr *expr; yasm_intnum *intn; long value; + expr_state prev_state; if (!*arg1) { return 0; } - tv.t_type = TOKEN_INVALID; - - pp->expr_symbol = NULL; - pp->expr_string = arg1; - pp->expr_string_cursor = 0; + prev_state = pp->expr; + gas_scan_init(pp, &tv, arg1); expr = evaluate(gas_scan, pp, &tv, pp, CRITICAL, gas_err, pp->defines); intn = yasm_expr_get_intnum(&expr, 0); value = yasm_intnum_get_int(intn); yasm_expr_destroy(expr); - - if (pp->expr_symbol) { - yasm_xfree(pp->expr_symbol); - pp->expr_symbol = NULL; - } + gas_scan_cleanup(pp, &tv); + pp->expr = prev_state; return value; } @@ -623,24 +685,103 @@ static int eval_include(yasm_preproc_gas *pp, int unused, const char *arg1) return 1; } +static int try_eval_expr(yasm_preproc_gas *pp, const char *value, long *result) +{ + int success; + + pp->detect_errors_only = 1; + *result = eval_expr(pp, value); + success = !pp->fatal_error; + pp->fatal_error = 0; + pp->detect_errors_only = 0; + + return success; +} + +static int remove_define(yasm_preproc_gas *pp, const char *name, int allow_redefine) +{ + yasm_symrec *rec = yasm_symtab_get(pp->defines, name); + if (rec) { + const yasm_symtab_iter *entry; + yasm_symtab *new_defines; + + if (!allow_redefine) { + yasm_error_set(YASM_ERROR_SYNTAX, N_("symbol \"%s\" is already defined"), name); + yasm_errwarn_propagate(pp->errwarns, pp->current_line_number); + return 0; + } + + new_defines = yasm_symtab_create(); + + for (entry = yasm_symtab_first(pp->defines); entry; entry = yasm_symtab_next(entry)) { + yasm_symrec *entry_rec = yasm_symtab_iter_value(entry); + const char *rec_name = yasm_symrec_get_name(entry_rec); + if (strcmp(rec_name, name)) { + yasm_intnum *num = yasm_intnum_create_int(eval_expr(pp, rec_name)); + yasm_expr *expr = yasm_expr_create_ident(yasm_expr_int(num), 0); + yasm_symtab_define_equ(new_defines, rec_name, expr, 0); + } + } + + yasm_symtab_destroy(pp->defines); + pp->defines = new_defines; + } + return (rec != NULL); +} + +static void add_define(yasm_preproc_gas *pp, const char *name, long value, int allow_redefine, int substitute) +{ + deferred_define *def, *prev_def, *temp_def; + yasm_intnum *num; + yasm_expr *expr; + + remove_define(pp, name, allow_redefine); + + /* Add the new define. */ + num = yasm_intnum_create_int(value); + expr = yasm_expr_create_ident(yasm_expr_int(num), 0); + yasm_symtab_define_equ(pp->defines, name, expr, 0); + + /* Perform substitution on any deferred defines. */ + if (substitute) { + prev_def = NULL; + temp_def = NULL; + SLIST_FOREACH_SAFE(def, &pp->deferred_defines, next, temp_def) { + if (substitute_values(pp, &def->value)) { + /* Value was updated - check if it can be added to the symtab. */ + if (try_eval_expr(pp, def->value, &value)) { + add_define(pp, def->name, value, FALSE, FALSE); + if (prev_def) { + SLIST_NEXT(prev_def, next) = SLIST_NEXT(def, next); + } else { + SLIST_FIRST(&pp->deferred_defines) = SLIST_NEXT(def, next); + } + yasm_xfree(def->name); + yasm_xfree(def->value); + yasm_xfree(def); + continue; + } + } + prev_def = def; + } + } +} + static int eval_set(yasm_preproc_gas *pp, int allow_redefine, const char *name, const char *value) { if (!pp->skip_depth) { - yasm_intnum *num = yasm_intnum_create_int(eval_expr(pp, value)); - yasm_expr *expr = yasm_expr_create_ident(yasm_expr_int(num), 0); - yasm_symrec *rec = yasm_symtab_get(pp->defines, name); - if (rec) { - if (!allow_redefine) { - yasm_error_set(YASM_ERROR_SYNTAX, N_("symbol \"%s\" is already defined"), name); - yasm_errwarn_propagate(pp->errwarns, pp->current_line_number); - return 0; - } - /* TODO */ - yasm_error_set(YASM_ERROR_SYNTAX, N_("redefining symbols not yet implimented"), name); - yasm_errwarn_propagate(pp->errwarns, pp->current_line_number); - return 0; + long result; + + if (!try_eval_expr(pp, value, &result)) { + deferred_define *def; + remove_define(pp, name, allow_redefine); + def = yasm_xmalloc(sizeof(deferred_define)); + def->name = yasm__xstrdup(name); + def->value = yasm__xstrdup(value); + substitute_values(pp, &def->value); + SLIST_INSERT_HEAD(&pp->deferred_defines, def, next); } else { - yasm_symtab_define_equ(pp->defines, name, expr, 0); + add_define(pp, name, result, allow_redefine, TRUE); } } return 1; @@ -751,7 +892,7 @@ static void get_param_value(macro_entry *macro, int param_index, const char *arg static void expand_macro(yasm_preproc_gas *pp, macro_entry *macro, const char *args) { - int i, j, k; + int i, j; buffered_line *prev_bline = NULL; for (i = 0; i < macro->num_lines; i++) { @@ -760,10 +901,9 @@ static void expand_macro(yasm_preproc_gas *pp, macro_entry *macro, const char *a int prev_was_backslash = FALSE; int line_length = strlen(macro->lines[i]); char *work = yasm__xstrdup(macro->lines[i]); + expr_state prev_state = pp->expr; - pp->expr_symbol = NULL; - pp->expr_string = work; - pp->expr_string_cursor = 0; + gas_scan_init(pp, &tokval, work); while (gas_scan(pp, &tokval) != TOKEN_EOS) { if (prev_was_backslash) { if (tokval.t_type == TOKEN_ID) { @@ -775,8 +915,8 @@ static void expand_macro(yasm_preproc_gas *pp, macro_entry *macro, const char *a && tokval.t_charptr[len] == '\0') { /* now, find matching argument. */ const char *value; - char *line = work + (pp->expr_string - work); - int cursor = pp->expr_string_cursor; + char *line = work + (pp->expr.string - work); + int cursor = pp->expr.string_cursor; int value_length, delta; get_param_value(macro, j, args, &value, &value_length); @@ -786,16 +926,15 @@ static void expand_macro(yasm_preproc_gas *pp, macro_entry *macro, const char *a line_length += delta; if (delta > 0) { line = yasm_xrealloc(line, line_length + 1); - for (k = strlen(line); k >= cursor; k--) { - line[k + delta] = line[k]; - } - memcpy(line + cursor - len, value, value_length); - } else { - memcpy(line + cursor - len, value, value_length); - memmove(line + cursor - len + value_length, line + cursor, strlen(line + cursor) + 1); } - pp->expr_string = work = line; - pp->expr_string_cursor += delta; + memmove(line + cursor - len + value_length, line + cursor, strlen(line + cursor) + 1); + memcpy(line + cursor - len, value, value_length); + pp->expr.string = work = line; + pp->expr.string_cursor += delta; + if (pp->expr.symbol) { + yasm_xfree(pp->expr.symbol); + pp->expr.symbol = NULL; + } } } } @@ -804,10 +943,11 @@ static void expand_macro(yasm_preproc_gas *pp, macro_entry *macro, const char *a prev_was_backslash = TRUE; } } + gas_scan_cleanup(pp, &tokval); - bline->line = work + (pp->expr_string - work); + bline->line = work + (pp->expr.string - work); bline->line_number = -1; - pp->expr_string = NULL; + pp->expr = prev_state; if (prev_bline) { SLIST_INSERT_AFTER(prev_bline, bline, next); @@ -849,7 +989,7 @@ static int eval_rept(yasm_preproc_gas *pp, int unused, const char *arg1) SLIST_INSERT_HEAD(&pp->buffered_lines, bline, next); } prev_bline = bline; - } + } } if (!SLIST_EMPTY(&pp->included_files)) { included_file *inc_file = SLIST_FIRST(&pp->included_files); @@ -936,21 +1076,21 @@ static void kill_comments(yasm_preproc_gas *pp, char *line) } } -static void substitute_values(yasm_preproc_gas *pp, char *line) +static int substitute_values(yasm_preproc_gas *pp, char **line_ptr) { + int changed = 0; + char *line = *line_ptr; int line_length = strlen(line); struct tokenval tokval; + expr_state prev_state = pp->expr; - pp->expr_string = line; - pp->expr_string_cursor = 0; - pp->expr_symbol = NULL; - + gas_scan_init(pp, &tokval, line); while (gas_scan(pp, &tokval) != TOKEN_EOS) { if (tokval.t_type == TOKEN_ID) { yasm_symrec *rec = yasm_symtab_get(pp->defines, tokval.t_charptr); if (rec) { - int cursor = pp->expr_string_cursor; - int k, len = strlen(tokval.t_charptr); + int cursor = pp->expr.string_cursor; + int len = strlen(tokval.t_charptr); char value[64]; int value_length = sprintf(value, "%ld", eval_expr(pp, tokval.t_charptr)); int delta = value_length - len; @@ -958,26 +1098,32 @@ static void substitute_values(yasm_preproc_gas *pp, char *line) line_length += delta; if (delta > 0) { line = yasm_xrealloc(line, line_length + 1); - for (k = line_length; k >= cursor; k--) { - line[k + delta] = line[k]; - } - memcpy(line + cursor - len, value, value_length); - } else { - memcpy(line + cursor - len, value, value_length); - memmove(line + cursor - len + value_length, line + cursor, strlen(line + cursor) + 1); } - pp->expr_string = line; - pp->expr_string_cursor = cursor + delta; - pp->expr_symbol = NULL; + memmove(line + cursor - len + value_length, line + cursor, strlen(line + cursor) + 1); + memcpy(line + cursor - len, value, value_length); + pp->expr.string = line; + pp->expr.string_cursor = cursor + delta; + changed = 1; } + yasm_xfree(pp->expr.symbol); + pp->expr.symbol = NULL; } } + gas_scan_cleanup(pp, &tokval); + pp->expr = prev_state; + + if (changed) { + *line_ptr = line; + } + + return changed; } -static int process_line(yasm_preproc_gas *pp, char *line) +static int process_line(yasm_preproc_gas *pp, char **line_ptr) { macro_entry *macro; size_t i; + char *line = *line_ptr; struct { const char *name; int nargs; @@ -1071,7 +1217,7 @@ static int process_line(yasm_preproc_gas *pp, char *line) } if (pp->skip_depth == 0) { - substitute_values(pp, line); + substitute_values(pp, line_ptr); return TRUE; } @@ -1100,6 +1246,7 @@ gas_preproc_create(const char *in_filename, yasm_symtab *symtab, pp->in = f; pp->in_filename = yasm__xstrdup(in_filename); pp->defines = yasm_symtab_create(); + SLIST_INIT(&pp->deferred_defines); yasm_symtab_set_case_sensitive(pp->defines, 1); pp->depth = 0; pp->skip_depth = 0; @@ -1113,6 +1260,7 @@ gas_preproc_create(const char *in_filename, yasm_symtab *symtab, pp->cur_lm = lm; pp->errwarns = errwarns; pp->fatal_error = 0; + pp->detect_errors_only = 0; return (yasm_preproc *) pp; } @@ -1123,6 +1271,13 @@ gas_preproc_destroy(yasm_preproc *preproc) yasm_preproc_gas *pp = (yasm_preproc_gas *) preproc; yasm_xfree(pp->in_filename); yasm_symtab_destroy(pp->defines); + while (!SLIST_EMPTY(&pp->deferred_defines)) { + deferred_define *def = SLIST_FIRST(&pp->deferred_defines); + SLIST_REMOVE_HEAD(&pp->deferred_defines, next); + yasm_xfree(def->name); + yasm_xfree(def->value); + yasm_xfree(def); + } while (!SLIST_EMPTY(&pp->buffered_lines)) { buffered_line *bline = SLIST_FIRST(&pp->buffered_lines); SLIST_REMOVE_HEAD(&pp->buffered_lines, next); @@ -1177,7 +1332,7 @@ gas_preproc_get_line(yasm_preproc *preproc) } return NULL; } - done = process_line(pp, line); + done = process_line(pp, &line); } while (!done); yasm_linemap_set(pp->cur_lm, pp->in_filename, pp->current_line_number, pp->next_line_number, 0); From 65f6f7a1ffd23bd28ef900e63dc1f53952383e34 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Mon, 6 Sep 2010 19:33:25 +0000 Subject: [PATCH 398/585] Fix #223: Correctly handle "./" paths in dwarf2. As dwarf2 has a directory table in addition to a filename table, we split the provided pathname when generating the filename table. This correctly combined both "./foo" and "foo" into a single filename table entry. However, we were only matching on pathname instead of dir+filename when actually generating the dwarf opcodes, resulting in not finding the "./foo" version. Fix to check both dir and filename separately, splitting the same way we do when generating the filename table. svn path=/trunk/yasm/; revision=2367 --- modules/dbgfmts/dwarf2/dwarf2-line.c | 37 +- modules/dbgfmts/dwarf2/tests/Makefile.inc | 2 + .../dbgfmts/dwarf2/tests/gen64/Makefile.inc | 8 + .../dwarf2/tests/gen64/dwarf2_gen64_test.sh | 4 + .../dwarf2/tests/gen64/dwarf64_pathname.asm | 22 + .../dwarf2/tests/gen64/dwarf64_pathname.hex | 1696 +++++++++++++++++ 6 files changed, 1764 insertions(+), 5 deletions(-) create mode 100644 modules/dbgfmts/dwarf2/tests/gen64/Makefile.inc create mode 100755 modules/dbgfmts/dwarf2/tests/gen64/dwarf2_gen64_test.sh create mode 100644 modules/dbgfmts/dwarf2/tests/gen64/dwarf64_pathname.asm create mode 100644 modules/dbgfmts/dwarf2/tests/gen64/dwarf64_pathname.hex diff --git a/modules/dbgfmts/dwarf2/dwarf2-line.c b/modules/dbgfmts/dwarf2/dwarf2-line.c index b5d3ad35..e961eb39 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-line.c +++ b/modules/dbgfmts/dwarf2/dwarf2-line.c @@ -485,13 +485,35 @@ typedef struct dwarf2_line_bc_info { unsigned long lastfile; } dwarf2_line_bc_info; +static int +dwarf2_filename_equals(const dwarf2_filename *fn, + char **dirs, + const char *pathname, + unsigned long dirlen, + const char *filename) +{ + /* check directory */ + if (fn->dir == 0) { + if (dirlen != 0) + return 0; + } else { + if (strncmp(dirs[fn->dir-1], pathname, dirlen) != 0 || + dirs[fn->dir-1][dirlen] != '\0') + return 0; + } + + /* check filename */ + return strcmp(fn->filename, filename) == 0; +} + static int dwarf2_generate_line_bc(yasm_bytecode *bc, /*@null@*/ void *d) { dwarf2_line_bc_info *info = (dwarf2_line_bc_info *)d; yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2 = info->dbgfmt_dwarf2; unsigned long i; - const char *filename; + size_t dirlen; + const char *pathname, *filename; /*@null@*/ yasm_bytecode *nextbc = yasm_bc__next(bc); if (nextbc && bc->offset == nextbc->offset) @@ -509,15 +531,20 @@ dwarf2_generate_line_bc(yasm_bytecode *bc, /*@null@*/ void *d) } } - yasm_linemap_lookup(info->linemap, bc->line, &filename, &info->loc.line); + yasm_linemap_lookup(info->linemap, bc->line, &pathname, &info->loc.line); + dirlen = yasm__splitpath(pathname, &filename); + /* Find file index; just linear search it unless it was the last used */ if (info->lastfile > 0 - && strcmp(filename, dbgfmt_dwarf2->filenames[info->lastfile-1].pathname) - == 0) + && dwarf2_filename_equals(&dbgfmt_dwarf2->filenames[info->lastfile-1], + dbgfmt_dwarf2->dirs, pathname, dirlen, + filename)) info->loc.file = info->lastfile; else { for (i=0; ifilenames_size; i++) { - if (strcmp(filename, dbgfmt_dwarf2->filenames[i].pathname) == 0) + if (dwarf2_filename_equals(&dbgfmt_dwarf2->filenames[i], + dbgfmt_dwarf2->dirs, pathname, dirlen, + filename)) break; } if (i >= dbgfmt_dwarf2->filenames_size) diff --git a/modules/dbgfmts/dwarf2/tests/Makefile.inc b/modules/dbgfmts/dwarf2/tests/Makefile.inc index 1136e288..5ae1d93a 100644 --- a/modules/dbgfmts/dwarf2/tests/Makefile.inc +++ b/modules/dbgfmts/dwarf2/tests/Makefile.inc @@ -1,8 +1,10 @@ # $Id$ +EXTRA_DIST += modules/dbgfmts/dwarf2/tests/gen64/Makefile.inc EXTRA_DIST += modules/dbgfmts/dwarf2/tests/pass32/Makefile.inc EXTRA_DIST += modules/dbgfmts/dwarf2/tests/pass64/Makefile.inc EXTRA_DIST += modules/dbgfmts/dwarf2/tests/passwin64/Makefile.inc +include modules/dbgfmts/dwarf2/tests/gen64/Makefile.inc include modules/dbgfmts/dwarf2/tests/pass32/Makefile.inc include modules/dbgfmts/dwarf2/tests/pass64/Makefile.inc include modules/dbgfmts/dwarf2/tests/passwin64/Makefile.inc diff --git a/modules/dbgfmts/dwarf2/tests/gen64/Makefile.inc b/modules/dbgfmts/dwarf2/tests/gen64/Makefile.inc new file mode 100644 index 00000000..66076da2 --- /dev/null +++ b/modules/dbgfmts/dwarf2/tests/gen64/Makefile.inc @@ -0,0 +1,8 @@ +# $Id$ + +TESTS += modules/dbgfmts/dwarf2/tests/gen64/dwarf2_gen64_test.sh + +EXTRA_DIST += modules/dbgfmts/dwarf2/tests/gen64/dwarf2_gen64_test.sh +EXTRA_DIST += modules/dbgfmts/dwarf2/tests/gen64/dwarf64_pathname.asm +EXTRA_DIST += modules/dbgfmts/dwarf2/tests/gen64/dwarf64_pathname.hex + diff --git a/modules/dbgfmts/dwarf2/tests/gen64/dwarf2_gen64_test.sh b/modules/dbgfmts/dwarf2/tests/gen64/dwarf2_gen64_test.sh new file mode 100755 index 00000000..07d1a1d7 --- /dev/null +++ b/modules/dbgfmts/dwarf2/tests/gen64/dwarf2_gen64_test.sh @@ -0,0 +1,4 @@ +#! /bin/sh +# $Id$ +${srcdir}/out_test.sh dwarf2_gen64_test modules/dbgfmts/dwarf2/tests/gen64 "dwarf2 dbgfmt gen64" "-f elf64 -g dwarf2" ".o" +exit $? diff --git a/modules/dbgfmts/dwarf2/tests/gen64/dwarf64_pathname.asm b/modules/dbgfmts/dwarf2/tests/gen64/dwarf64_pathname.asm new file mode 100644 index 00000000..a216f9bd --- /dev/null +++ b/modules/dbgfmts/dwarf2/tests/gen64/dwarf64_pathname.asm @@ -0,0 +1,22 @@ +[bits 64] +[section .text] +[default rel] + +%line 1+0 ./some_filename +; program tst_wyjatki +global _start +_start: + XOR EBP, EBP + CALL main + XOR RAX, RAX + MOV RDI, RAX + MOV RAX, 60 + SYSCALL + HLT + +main: + PUSH rbp + MOV rbp, rsp + SUB RSP, 0x20 + %line 2+0 some_filename + SUB RSP, 64 diff --git a/modules/dbgfmts/dwarf2/tests/gen64/dwarf64_pathname.hex b/modules/dbgfmts/dwarf2/tests/gen64/dwarf64_pathname.hex new file mode 100644 index 00000000..379a050b --- /dev/null +++ b/modules/dbgfmts/dwarf2/tests/gen64/dwarf64_pathname.hex @@ -0,0 +1,1696 @@ +7f +45 +4c +46 +02 +01 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +3e +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +a0 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +40 +00 +00 +00 +00 +00 +40 +00 +0c +00 +01 +00 +31 +ed +e8 +10 +00 +00 +00 +48 +31 +c0 +48 +89 +c7 +48 +c7 +c0 +3c +00 +00 +00 +0f +05 +f4 +55 +48 +89 +e5 +48 +83 +ec +20 +48 +83 +ec +40 +78 +00 +00 +00 +02 +00 +29 +00 +00 +00 +01 +01 +fb +0e +0d +00 +01 +01 +01 +01 +00 +00 +00 +01 +00 +00 +01 +00 +2d +00 +00 +00 +00 +73 +6f +6d +65 +5f +66 +69 +6c +65 +6e +61 +6d +65 +00 +00 +00 +00 +00 +04 +02 +00 +02 +04 +5b +00 +09 +02 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +02 +04 +5b +2e +00 +02 +04 +5b +58 +00 +02 +04 +5b +3c +00 +02 +04 +5b +3c +00 +02 +04 +5b +74 +00 +02 +04 +5b +2e +00 +02 +04 +5b +20 +00 +02 +04 +5b +20 +00 +02 +04 +5b +3c +00 +02 +04 +5b +4b +02 +04 +00 +01 +01 +00 +3c +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +08 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +11 +00 +10 +06 +11 +01 +12 +01 +03 +08 +1b +08 +25 +08 +13 +05 +00 +00 +00 +45 +00 +00 +00 +02 +00 +00 +00 +00 +00 +08 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +2d +00 +2f +68 +6f +6d +65 +2f +70 +65 +74 +65 +72 +2f +70 +72 +6f +6a +65 +63 +74 +2f +79 +61 +73 +6d +32 +2f +00 +79 +61 +73 +6d +20 +48 +45 +41 +44 +00 +01 +80 +00 +00 +00 +06 +00 +00 +00 +00 +00 +00 +00 +0a +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +0c +00 +00 +00 +00 +00 +00 +00 +0a +00 +00 +00 +05 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +07 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +18 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +07 +00 +00 +00 +23 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +2c +00 +00 +00 +02 +00 +00 +00 +00 +00 +08 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +23 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +06 +00 +00 +00 +00 +00 +00 +00 +0a +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +07 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +2e +74 +65 +78 +74 +00 +2e +64 +65 +62 +75 +67 +5f +6c +69 +6e +65 +00 +2e +64 +65 +62 +75 +67 +5f +61 +62 +62 +72 +65 +76 +00 +2e +64 +65 +62 +75 +67 +5f +69 +6e +66 +6f +00 +2e +64 +65 +62 +75 +67 +5f +61 +72 +61 +6e +67 +65 +73 +00 +2e +72 +65 +6c +61 +2e +64 +65 +62 +75 +67 +5f +6c +69 +6e +65 +00 +2e +72 +65 +6c +61 +2e +64 +65 +62 +75 +67 +5f +69 +6e +66 +6f +00 +2e +72 +65 +6c +61 +2e +64 +65 +62 +75 +67 +5f +61 +72 +61 +6e +67 +65 +73 +00 +2e +73 +74 +72 +74 +61 +62 +00 +2e +73 +79 +6d +74 +61 +62 +00 +2e +73 +68 +73 +74 +72 +74 +61 +62 +00 +00 +2d +00 +5f +73 +74 +61 +72 +74 +00 +6d +61 +69 +6e +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +04 +00 +f1 +ff +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +00 +0a +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +00 +08 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +00 +07 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +00 +05 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +0a +00 +00 +00 +00 +00 +04 +00 +17 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +00 +00 +00 +10 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +82 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +20 +02 +00 +00 +00 +00 +00 +00 +8c +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +72 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +ac +02 +00 +00 +00 +00 +00 +00 +0f +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +7a +00 +00 +00 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +bc +02 +00 +00 +00 +00 +00 +00 +d8 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +08 +00 +00 +00 +08 +00 +00 +00 +00 +00 +00 +00 +18 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +01 +00 +00 +00 +06 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +40 +00 +00 +00 +00 +00 +00 +00 +23 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +07 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +63 +00 +00 +00 +00 +00 +00 +00 +7c +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +3c +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +e0 +00 +00 +00 +00 +00 +00 +00 +18 +00 +00 +00 +00 +00 +00 +00 +03 +00 +00 +00 +05 +00 +00 +00 +08 +00 +00 +00 +00 +00 +00 +00 +18 +00 +00 +00 +00 +00 +00 +00 +13 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +f8 +00 +00 +00 +00 +00 +00 +00 +14 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +21 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +0c +01 +00 +00 +00 +00 +00 +00 +49 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +4d +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +58 +01 +00 +00 +00 +00 +00 +00 +60 +00 +00 +00 +00 +00 +00 +00 +03 +00 +00 +00 +08 +00 +00 +00 +08 +00 +00 +00 +00 +00 +00 +00 +18 +00 +00 +00 +00 +00 +00 +00 +2d +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +c0 +01 +00 +00 +00 +00 +00 +00 +30 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +5e +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +f0 +01 +00 +00 +00 +00 +00 +00 +30 +00 +00 +00 +00 +00 +00 +00 +03 +00 +00 +00 +0a +00 +00 +00 +08 +00 +00 +00 +00 +00 +00 +00 +18 +00 +00 +00 +00 +00 +00 +00 From db258a7b50e89a6b4967724fe6ee3eb37f0b9d44 Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Sat, 29 Jan 2011 10:50:25 +0000 Subject: [PATCH 399/585] 1. Tidy up VS 2010 build 2. Set correct VS tool path on win32 systems svn path=/trunk/yasm/; revision=2368 --- Mkfiles/vc10/genmodule/genmodule.vcxproj | 3 ++ .../vc10/genmodule/genmodule.vcxproj.filters | 3 ++ Mkfiles/vc10/genperf/genperf.vcxproj | 5 ++++ Mkfiles/vc10/genperf/genperf.vcxproj.filters | 15 ++++++++++ Mkfiles/vc10/libyasm/libyasm.vcxproj | 6 ++++ Mkfiles/vc10/libyasm/libyasm.vcxproj.filters | 18 +++++++++++ Mkfiles/vc10/modules/modules.vcxproj | 30 +++++++++++++++++++ Mkfiles/vc10/modules/modules.vcxproj.filters | 30 +++++++++++++++++++ Mkfiles/vc10/re2c/re2c.vcxproj | 1 + Mkfiles/vc10/re2c/re2c.vcxproj.filters | 3 ++ Mkfiles/vc10/readme.vc10.txt | 18 +++++++---- Mkfiles/vc10/vsyasm.props | 2 +- Mkfiles/vc10/vsyasm.vcxproj | 5 ++++ Mkfiles/vc10/yasm.vcxproj | 5 ++++ Mkfiles/vc10/yasm.vcxproj.filters | 15 ++++++++++ Mkfiles/vc10/ytasm.vcxproj | 4 +++ 16 files changed, 157 insertions(+), 6 deletions(-) diff --git a/Mkfiles/vc10/genmodule/genmodule.vcxproj b/Mkfiles/vc10/genmodule/genmodule.vcxproj index 4a48093b..eca6ce85 100644 --- a/Mkfiles/vc10/genmodule/genmodule.vcxproj +++ b/Mkfiles/vc10/genmodule/genmodule.vcxproj @@ -109,6 +109,9 @@ + + + diff --git a/Mkfiles/vc10/genmodule/genmodule.vcxproj.filters b/Mkfiles/vc10/genmodule/genmodule.vcxproj.filters index 85bdf9fe..e9777360 100644 --- a/Mkfiles/vc10/genmodule/genmodule.vcxproj.filters +++ b/Mkfiles/vc10/genmodule/genmodule.vcxproj.filters @@ -14,4 +14,7 @@ + + + \ No newline at end of file diff --git a/Mkfiles/vc10/genperf/genperf.vcxproj b/Mkfiles/vc10/genperf/genperf.vcxproj index b94d5a2b..9d14bf53 100644 --- a/Mkfiles/vc10/genperf/genperf.vcxproj +++ b/Mkfiles/vc10/genperf/genperf.vcxproj @@ -127,8 +127,13 @@ + + + + + diff --git a/Mkfiles/vc10/genperf/genperf.vcxproj.filters b/Mkfiles/vc10/genperf/genperf.vcxproj.filters index 40029ebc..f45157d9 100644 --- a/Mkfiles/vc10/genperf/genperf.vcxproj.filters +++ b/Mkfiles/vc10/genperf/genperf.vcxproj.filters @@ -34,6 +34,21 @@ Header Files + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + diff --git a/Mkfiles/vc10/libyasm/libyasm.vcxproj b/Mkfiles/vc10/libyasm/libyasm.vcxproj index af67e44d..1498e312 100644 --- a/Mkfiles/vc10/libyasm/libyasm.vcxproj +++ b/Mkfiles/vc10/libyasm/libyasm.vcxproj @@ -226,6 +226,7 @@ + @@ -242,7 +243,9 @@ + + @@ -251,6 +254,9 @@ + + + diff --git a/Mkfiles/vc10/libyasm/libyasm.vcxproj.filters b/Mkfiles/vc10/libyasm/libyasm.vcxproj.filters index 6385583d..d1ee2793 100644 --- a/Mkfiles/vc10/libyasm/libyasm.vcxproj.filters +++ b/Mkfiles/vc10/libyasm/libyasm.vcxproj.filters @@ -175,6 +175,24 @@ Header Files + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + diff --git a/Mkfiles/vc10/modules/modules.vcxproj b/Mkfiles/vc10/modules/modules.vcxproj index 5fc78cfa..9e1f917d 100644 --- a/Mkfiles/vc10/modules/modules.vcxproj +++ b/Mkfiles/vc10/modules/modules.vcxproj @@ -250,6 +250,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -258,12 +284,16 @@ + + + + diff --git a/Mkfiles/vc10/modules/modules.vcxproj.filters b/Mkfiles/vc10/modules/modules.vcxproj.filters index 1d0ad244..d66bf489 100644 --- a/Mkfiles/vc10/modules/modules.vcxproj.filters +++ b/Mkfiles/vc10/modules/modules.vcxproj.filters @@ -219,5 +219,35 @@ Source Files\preprocs\nasm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc10/re2c/re2c.vcxproj b/Mkfiles/vc10/re2c/re2c.vcxproj index 88bb5dea..fb50f146 100644 --- a/Mkfiles/vc10/re2c/re2c.vcxproj +++ b/Mkfiles/vc10/re2c/re2c.vcxproj @@ -117,6 +117,7 @@ + diff --git a/Mkfiles/vc10/re2c/re2c.vcxproj.filters b/Mkfiles/vc10/re2c/re2c.vcxproj.filters index 9416e71d..426ee6eb 100644 --- a/Mkfiles/vc10/re2c/re2c.vcxproj.filters +++ b/Mkfiles/vc10/re2c/re2c.vcxproj.filters @@ -70,6 +70,9 @@ Header Files + + Header Files + diff --git a/Mkfiles/vc10/readme.vc10.txt b/Mkfiles/vc10/readme.vc10.txt index a390d661..0182520b 100644 --- a/Mkfiles/vc10/readme.vc10.txt +++ b/Mkfiles/vc10/readme.vc10.txt @@ -2,7 +2,7 @@ Building YASM with Microsoft Visual Studio 2010 (C/C++ v10) ----------------------------------------------------------- This note describes how to build YASM using Microsoft Visual -Studio 2010 (C/C++ v10 - currently releasxed as beta 2). +Studio 2010 (C/C++ v10). 1. The Compiler --------------- @@ -36,18 +36,22 @@ as appropriate to build the YASM binaries that you need. -------------------------------------------------------- The YASM version vsyasm.exe is designed specifically for use -with Visual Studio 2010. To tell Visual Studio where to find +with Visual Studio 2010. To tell Visual Studio where to find vsyasm.exe, the environment variable YASMPATH can be set to the absolute path of the directory in which vsyasm.exe is located (this path should include the final backslash). Alternatively you can find the directory (or directories) where the VC++ compiler binaries are located and put copies -of the vsyasm.exe binary in these directories. A typical -location is: +of the vsyasm.exe binary in these directories. The typical +location on 64-bit Windows is: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin +On 32-bit Windows it is normally at: + +C:\Program Files\Microsoft Visual Studio 10.0\VC\bin + Depending on your system you can use either the win32 or the x64 version of vsyasm.exe, which must be named vsyasm.exe. @@ -61,6 +65,10 @@ ways to do this: which is typically at: C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations + + or: + + C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations b. put them in a convenient location and set this path in the 'Build Customisations Search Path' in the Visual Studio @@ -108,4 +116,4 @@ I am most grateful for the fantastic support that Peter Johnson, YASM's creator, has given me in tracking down issues in using YASM for the production of Windows x64 code. - Brian Gladman, 10th June 2010 + Brian Gladman, 29th January 2011 diff --git a/Mkfiles/vc10/vsyasm.props b/Mkfiles/vc10/vsyasm.props index 66308c4c..89476f2e 100644 --- a/Mkfiles/vc10/vsyasm.props +++ b/Mkfiles/vc10/vsyasm.props @@ -10,7 +10,7 @@ Condition="'$(ConfigurationType)' != 'Makefile'">_SelectedFiles;$(YASMDependsOn) - C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\ + $(VCInstallDir)bin\ diff --git a/Mkfiles/vc10/vsyasm.vcxproj b/Mkfiles/vc10/vsyasm.vcxproj index 0c6e22a2..a5ed2604 100644 --- a/Mkfiles/vc10/vsyasm.vcxproj +++ b/Mkfiles/vc10/vsyasm.vcxproj @@ -263,6 +263,11 @@ + + + + + diff --git a/Mkfiles/vc10/yasm.vcxproj b/Mkfiles/vc10/yasm.vcxproj index bf663e78..9379d70a 100644 --- a/Mkfiles/vc10/yasm.vcxproj +++ b/Mkfiles/vc10/yasm.vcxproj @@ -253,6 +253,11 @@ + + + + + diff --git a/Mkfiles/vc10/yasm.vcxproj.filters b/Mkfiles/vc10/yasm.vcxproj.filters index 9f3aa728..df5419b8 100644 --- a/Mkfiles/vc10/yasm.vcxproj.filters +++ b/Mkfiles/vc10/yasm.vcxproj.filters @@ -22,5 +22,20 @@ Header Files + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + \ No newline at end of file diff --git a/Mkfiles/vc10/ytasm.vcxproj b/Mkfiles/vc10/ytasm.vcxproj index 1599a15b..d45cdf48 100644 --- a/Mkfiles/vc10/ytasm.vcxproj +++ b/Mkfiles/vc10/ytasm.vcxproj @@ -253,6 +253,10 @@ + + + + From 1143fb752013edfdea5d43d0d7231ac9ed65b510 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 20 Mar 2011 21:18:01 -0700 Subject: [PATCH 400/585] Fix test failure due to build environment. When YASM_TEST_SUITE environment is defined, force version to "yasm HEAD" and all yasm__getcwd() calls to return "./". --- libyasm/file.c | 6 +++ modules/dbgfmts/codeview/cv-symline.c | 9 ++-- modules/dbgfmts/dwarf2/dwarf2-info.c | 5 +- .../dwarf2/tests/gen64/dwarf64_pathname.hex | 52 ++++--------------- 4 files changed, 26 insertions(+), 46 deletions(-) diff --git a/libyasm/file.c b/libyasm/file.c index 07609348..6b0b5cc0 100644 --- a/libyasm/file.c +++ b/libyasm/file.c @@ -243,6 +243,12 @@ yasm__getcwd(void) size = 1024; buf = yasm_xmalloc(size); + + if (getenv("YASM_TEST_SUITE")) { + strcpy(buf, "./"); + return buf; + } + while (getcwd(buf, size-1) == NULL) { if (errno != ERANGE) { yasm__fatal(N_("could not determine current working directory")); diff --git a/modules/dbgfmts/codeview/cv-symline.c b/modules/dbgfmts/codeview/cv-symline.c index 1996c33a..ca31271b 100644 --- a/modules/dbgfmts/codeview/cv-symline.c +++ b/modules/dbgfmts/codeview/cv-symline.c @@ -638,9 +638,12 @@ yasm_cv__generate_symline(yasm_object *object, yasm_linemap *linemap, /* add object and compile flag first */ cv8_add_sym_objname(info.debug_symline, yasm__abspath(object->obj_filename)); - cv8_add_sym_compile(object, info.debug_symline, - yasm__xstrdup(PACKAGE_NAME " " PACKAGE_INTVER "." - PACKAGE_BUILD)); + if (getenv("YASM_TEST_SUITE")) + cv8_add_sym_compile(object, info.debug_symline, + yasm__xstrdup("yasm HEAD")); + else + cv8_add_sym_compile(object, info.debug_symline, + yasm__xstrdup(PACKAGE_STRING)); /* then iterate through symbol table */ yasm_symtab_traverse(object->symtab, &info, cv_generate_sym); cv8_set_symhead_end(head, yasm_section_bcs_last(info.debug_symline)); diff --git a/modules/dbgfmts/dwarf2/dwarf2-info.c b/modules/dbgfmts/dwarf2/dwarf2-info.c index dd48098b..eebce33f 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-info.c +++ b/modules/dbgfmts/dwarf2/dwarf2-info.c @@ -337,7 +337,10 @@ yasm_dwarf2__generate_info(yasm_object *object, yasm_section *debug_line, /* producer - assembler name */ abc->len += dwarf2_add_abbrev_attr(abbrev, DW_AT_producer, DW_FORM_string); - dwarf2_append_str(debug_info, PACKAGE " " VERSION); + if (getenv("YASM_TEST_SUITE")) + dwarf2_append_str(debug_info, "yasm HEAD"); + else + dwarf2_append_str(debug_info, PACKAGE_STRING); /* language - no standard code for assembler, use MIPS as a substitute */ abc->len += dwarf2_add_abbrev_attr(abbrev, DW_AT_language, DW_FORM_data2); diff --git a/modules/dbgfmts/dwarf2/tests/gen64/dwarf64_pathname.hex b/modules/dbgfmts/dwarf2/tests/gen64/dwarf64_pathname.hex index 379a050b..10ae2c38 100644 --- a/modules/dbgfmts/dwarf2/tests/gen64/dwarf64_pathname.hex +++ b/modules/dbgfmts/dwarf2/tests/gen64/dwarf64_pathname.hex @@ -38,7 +38,7 @@ 00 00 00 -a0 +80 03 00 00 @@ -266,7 +266,7 @@ fb 00 00 00 -45 +2d 00 00 00 @@ -300,31 +300,7 @@ fb 00 2d 00 -2f -68 -6f -6d -65 -2f -70 -65 -74 -65 -72 -2f -70 -72 -6f -6a -65 -63 -74 -2f -79 -61 -73 -6d -32 +2e 2f 00 79 @@ -438,14 +414,6 @@ fb 00 00 00 -00 -00 -00 -00 -00 -00 -00 -00 2c 00 00 @@ -1014,7 +982,7 @@ ff 00 00 00 -20 +00 02 00 00 @@ -1078,7 +1046,7 @@ ff 00 00 00 -ac +8c 02 00 00 @@ -1142,7 +1110,7 @@ ac 00 00 00 -bc +9c 02 00 00 @@ -1470,7 +1438,7 @@ f8 00 00 00 -49 +31 00 00 00 @@ -1526,7 +1494,7 @@ f8 00 00 00 -58 +40 01 00 00 @@ -1590,7 +1558,7 @@ f8 00 00 00 -c0 +a0 01 00 00 @@ -1654,7 +1622,7 @@ c0 00 00 00 -f0 +d0 01 00 00 From 49c9e094297370b53a3fccd68eb41aa247828050 Mon Sep 17 00:00:00 2001 From: Jari Aalto Date: Sun, 1 May 2011 14:46:36 +0300 Subject: [PATCH 401/585] frontends/yasm/yasm.xml: Use GNU layout and put --help option to the end Signed-off-by: Jari Aalto Signed-off-by: Peter Johnson --- frontends/yasm/yasm.xml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/frontends/yasm/yasm.xml b/frontends/yasm/yasm.xml index 11a5fb29..fde13492 100644 --- a/frontends/yasm/yasm.xml +++ b/frontends/yasm/yasm.xml @@ -171,16 +171,6 @@ - - or : Print a - summary of options - - - Prints a summary of invocation options. All other options - are ignored, and no output file is generated. - - - or : @@ -289,6 +279,16 @@ + + or : Print a + summary of options + + + Prints a summary of invocation options. All other options + are ignored, and no output file is generated. + + + : Get the Yasm version From 3bf0ed3927ba03884fe5c24ffabcae964b1d8e89 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 29 May 2011 13:14:22 -0700 Subject: [PATCH 402/585] Fix lar and lsl second operand size. Also support 32-bit second operand for extra compatibility against ISA documentation, although only the low 16 bits are used. Fixes #261. --- modules/arch/x86/gen_x86_insn.py | 20 +++- modules/arch/x86/tests/Makefile.inc | 2 + modules/arch/x86/tests/larlsl.asm | 59 +++++++++ modules/arch/x86/tests/larlsl.hex | 178 ++++++++++++++++++++++++++++ 4 files changed, 257 insertions(+), 2 deletions(-) create mode 100644 modules/arch/x86/tests/larlsl.asm create mode 100644 modules/arch/x86/tests/larlsl.hex diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index 56af2735..a91e4e1e 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -3081,8 +3081,24 @@ add_insn("nop", "onebyte", modifiers=[0x90]) # # Protection control # -add_insn("lar", "bsfr", modifiers=[0x02], cpu=["286", "Prot"]) -add_insn("lsl", "bsfr", modifiers=[0x03], cpu=["286", "Prot"]) +for sfx, sz, sz2 in zip("wlq", [16, 32, 64], [16, 32, 32]): + add_group("larlsl", + suffix=sfx, + modifiers=["Op1Add"], + opersize=sz, + opcode=[0x0F, 0x00], + operands=[Operand(type="Reg", size=sz, dest="Spare"), + Operand(type="Reg", size=sz2, dest="EA")]) + add_group("larlsl", + suffix=sfx, + modifiers=["Op1Add"], + opersize=sz, + opcode=[0x0F, 0x00], + operands=[Operand(type="Reg", size=sz, dest="Spare"), + Operand(type="RM", size=16, relaxed=True, dest="EA")]) + +add_insn("lar", "larlsl", modifiers=[0x02], cpu=["286", "Prot"]) +add_insn("lsl", "larlsl", modifiers=[0x03], cpu=["286", "Prot"]) add_group("arpl", suffix="w", diff --git a/modules/arch/x86/tests/Makefile.inc b/modules/arch/x86/tests/Makefile.inc index f46fa074..8058f2d8 100644 --- a/modules/arch/x86/tests/Makefile.inc +++ b/modules/arch/x86/tests/Makefile.inc @@ -95,6 +95,8 @@ EXTRA_DIST += modules/arch/x86/tests/jmp64-6.asm EXTRA_DIST += modules/arch/x86/tests/jmp64-6.hex EXTRA_DIST += modules/arch/x86/tests/jmpfar.asm EXTRA_DIST += modules/arch/x86/tests/jmpfar.hex +EXTRA_DIST += modules/arch/x86/tests/larlsl.asm +EXTRA_DIST += modules/arch/x86/tests/larlsl.hex EXTRA_DIST += modules/arch/x86/tests/lds.asm EXTRA_DIST += modules/arch/x86/tests/lds.hex EXTRA_DIST += modules/arch/x86/tests/loopadsz.asm diff --git a/modules/arch/x86/tests/larlsl.asm b/modules/arch/x86/tests/larlsl.asm new file mode 100644 index 00000000..51c3feca --- /dev/null +++ b/modules/arch/x86/tests/larlsl.asm @@ -0,0 +1,59 @@ +[bits 16] +lar ax, bx +lar ax, [bx] +lar ax, word [bx] +lar eax, bx +lar eax, ebx +lar eax, [bx] +lar eax, word [bx] + +lsl ax, bx +lsl ax, [bx] +lsl ax, word [bx] +lsl eax, bx +lsl eax, ebx +lsl eax, [bx] +lsl eax, word [bx] + +[bits 32] +lar ax, bx +lar ax, [ebx] +lar ax, word [ebx] +lar eax, bx +lar eax, ebx +lar eax, [ebx] +lar eax, word [ebx] + +lsl ax, bx +lsl ax, [ebx] +lsl ax, word [ebx] +lsl eax, bx +lsl eax, ebx +lsl eax, [ebx] +lsl eax, word [ebx] + +[bits 64] +lar ax, bx +lar ax, [rbx] +lar ax, word [rbx] +lar eax, bx +lar eax, ebx +lar eax, [rbx] +lar eax, word [rbx] +lar rax, bx +lar rax, ebx +lar rax, [rbx] +lar rax, word [rbx] + +lsl ax, bx +lsl ax, [rbx] +lsl ax, word [rbx] +lsl eax, bx +lsl eax, ebx +lsl eax, [rbx] +lsl eax, word [rbx] +lsl rax, bx +lsl rax, ebx +lsl rax, [rbx] +lsl rax, word [rbx] + diff --git a/modules/arch/x86/tests/larlsl.hex b/modules/arch/x86/tests/larlsl.hex new file mode 100644 index 00000000..38c8b973 --- /dev/null +++ b/modules/arch/x86/tests/larlsl.hex @@ -0,0 +1,178 @@ +0f +02 +c3 +0f +02 +07 +0f +02 +07 +66 +0f +02 +c3 +66 +0f +02 +c3 +66 +0f +02 +07 +66 +0f +02 +07 +0f +03 +c3 +0f +03 +07 +0f +03 +07 +66 +0f +03 +c3 +66 +0f +03 +c3 +66 +0f +03 +07 +66 +0f +03 +07 +66 +0f +02 +c3 +66 +0f +02 +03 +66 +0f +02 +03 +0f +02 +c3 +0f +02 +c3 +0f +02 +03 +0f +02 +03 +66 +0f +03 +c3 +66 +0f +03 +03 +66 +0f +03 +03 +0f +03 +c3 +0f +03 +c3 +0f +03 +03 +0f +03 +03 +66 +0f +02 +c3 +66 +0f +02 +03 +66 +0f +02 +03 +0f +02 +c3 +0f +02 +c3 +0f +02 +03 +0f +02 +03 +48 +0f +02 +c3 +48 +0f +02 +c3 +48 +0f +02 +03 +48 +0f +02 +03 +66 +0f +03 +c3 +66 +0f +03 +03 +66 +0f +03 +03 +0f +03 +c3 +0f +03 +c3 +0f +03 +03 +0f +03 +03 +48 +0f +03 +c3 +48 +0f +03 +c3 +48 +0f +03 +03 +48 +0f +03 +03 From b96cc7d9b282c6aed441b791e6cb6eae7b2296bc Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 29 May 2011 15:29:15 -0700 Subject: [PATCH 403/585] Fix escaping at end of gas string constant. Patch by: Daniel Diaz --- modules/parsers/gas/gas-token.re | 7 ++++--- modules/parsers/gas/tests/bin/Makefile.inc | 2 ++ modules/parsers/gas/tests/bin/gas-str.asm | 1 + modules/parsers/gas/tests/bin/gas-str.hex | 3 +++ 4 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 modules/parsers/gas/tests/bin/gas-str.asm create mode 100644 modules/parsers/gas/tests/bin/gas-str.hex diff --git a/modules/parsers/gas/gas-token.re b/modules/parsers/gas/gas-token.re index cf020fbe..f2212af5 100644 --- a/modules/parsers/gas/gas-token.re +++ b/modules/parsers/gas/gas-token.re @@ -523,8 +523,8 @@ stringconst_scan: SCANINIT(); /*!re2c - /* Handle escaped double-quote by copying and continuing */ - "\\\"" { + /* Handle escaped character by copying both and continuing. */ + "\\". { if (cursor == s->eof) { yasm_error_set(YASM_ERROR_SYNTAX, N_("unexpected end of file in string")); @@ -532,7 +532,8 @@ stringconst_scan: lvalp->str.len = count; RETURN(STRING); } - strbuf_append(count++, cursor, s, '"'); + strbuf_append(count++, cursor, s, '\\'); + strbuf_append(count++, cursor, s, s->tok[1]); goto stringconst_scan; } diff --git a/modules/parsers/gas/tests/bin/Makefile.inc b/modules/parsers/gas/tests/bin/Makefile.inc index 39f12f01..bc8f6174 100644 --- a/modules/parsers/gas/tests/bin/Makefile.inc +++ b/modules/parsers/gas/tests/bin/Makefile.inc @@ -14,6 +14,8 @@ EXTRA_DIST += modules/parsers/gas/tests/bin/gas-macro.asm EXTRA_DIST += modules/parsers/gas/tests/bin/gas-macro.hex EXTRA_DIST += modules/parsers/gas/tests/bin/gas-set.asm EXTRA_DIST += modules/parsers/gas/tests/bin/gas-set.hex +EXTRA_DIST += modules/parsers/gas/tests/bin/gas-str.asm +EXTRA_DIST += modules/parsers/gas/tests/bin/gas-str.hex EXTRA_DIST += modules/parsers/gas/tests/bin/rept-err.asm EXTRA_DIST += modules/parsers/gas/tests/bin/rept-err.errwarn EXTRA_DIST += modules/parsers/gas/tests/bin/reptempty.asm diff --git a/modules/parsers/gas/tests/bin/gas-str.asm b/modules/parsers/gas/tests/bin/gas-str.asm new file mode 100644 index 00000000..4d02a02c --- /dev/null +++ b/modules/parsers/gas/tests/bin/gas-str.asm @@ -0,0 +1 @@ +.string "a\\" diff --git a/modules/parsers/gas/tests/bin/gas-str.hex b/modules/parsers/gas/tests/bin/gas-str.hex new file mode 100644 index 00000000..d4eaa859 --- /dev/null +++ b/modules/parsers/gas/tests/bin/gas-str.hex @@ -0,0 +1,3 @@ +61 +5c +00 From 19d85dfe8450914a791576840da08248671b398e Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Mon, 20 Jun 2011 23:30:44 -0700 Subject: [PATCH 404/585] Fix #263: Add quotes to yasm.rules switches. --- Mkfiles/vc9/yasm.rules | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Mkfiles/vc9/yasm.rules b/Mkfiles/vc9/yasm.rules index ee1fefbc..2514ae0a 100644 --- a/Mkfiles/vc9/yasm.rules +++ b/Mkfiles/vc9/yasm.rules @@ -19,7 +19,7 @@ DisplayName="Definitions" Category="Pre-Defined Symbols" Description="Specify pre-defined symbols ('symbol' or 'symbol = value') " - Switch="-D [value]" + Switch="-D "[value]"" Delimited="true" Inheritable="true" /> @@ -28,7 +28,7 @@ DisplayName="Include Paths" Category="Configuration" Description="Set the paths for any additional include files" - Switch="-I [value]" + Switch="-I "[value]"" Delimited="true" Inheritable="true" /> @@ -37,7 +37,7 @@ DisplayName="Remove Definitions" Category="Pre-Defined Symbols" Description="Remove pre-defined symbols " - Switch="-U [value]" + Switch="-U "[value]"" Delimited="true" Inheritable="true" /> @@ -46,7 +46,7 @@ DisplayName="Object File Name" Category="Output" Description="Select the output file name" - Switch="-o [value]" + Switch="-o "[value]"" DefaultValue="$(IntDir)\$(InputName).obj" /> Date: Sat, 25 Jun 2011 14:58:27 -0700 Subject: [PATCH 405/585] Fix build with recent Cython. [#216 state:resolved] --- tools/python-yasm/yasm.pyx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/python-yasm/yasm.pyx b/tools/python-yasm/yasm.pyx index f9c6ee4d..adbc734e 100644 --- a/tools/python-yasm/yasm.pyx +++ b/tools/python-yasm/yasm.pyx @@ -97,7 +97,7 @@ cdef void *__get_voidp(object obj, object forclass) except NULL: # cdef class __assoc_data_callback: cdef yasm_assoc_data_callback *cb - def __new__(self, destroy, print_): + def __cinit__(self, destroy, print_): self.cb = malloc(sizeof(yasm_assoc_data_callback)) self.cb.destroy = PyCObject_AsVoidPtr(destroy) #self.cb.print_ = PyCObject_AsVoidPtr(print_) @@ -107,7 +107,7 @@ cdef class __assoc_data_callback: cdef class Register: cdef unsigned long reg - def __new__(self, reg): + def __cinit__(self, reg): self.reg = reg include "errwarn.pxi" From ac59d2353b540ed48bb7f503bd1396f59fe257e4 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 25 Jun 2011 15:09:03 -0700 Subject: [PATCH 406/585] Fix cython.m4 for beta versions of Cython. [#204 state:resolved] --- m4/cython.m4 | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/m4/cython.m4 b/m4/cython.m4 index 352df3d6..ba6b3cab 100644 --- a/m4/cython.m4 +++ b/m4/cython.m4 @@ -4,14 +4,19 @@ dnl CYTHON_CHECK_VERSION([MIN-VERSION], [ACTION-IF-TRUE], [ACTION-IF-FALSE]) AC_DEFUN([CYTHON_CHECK_VERSION], [prog="import sys from Cython.Compiler.Version import version +def get_int(arg): + try: + return int(arg) + except ValueError: + return 0 # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for the hex conversion. -ver = map(int, version.rstrip('abcdefghijklmnopqrstuvwxyz').split('.')) + [[0, 0, 0]] +ver = map(get_int, version.rstrip('abcdefghijklmnopqrstuvwxyz').split('.')) + [[0, 0, 0]] verhex = 0 -for i in xrange(0, 4): verhex = (verhex << 8) + ver[[i]] -minver = map(int, '$1'.split('.')) + [[0, 0, 0]] +for i in range(0, 4): verhex = (verhex << 8) + ver[[i]] +minver = map(get_int, '$1'.split('.')) + [[0, 0, 0]] minverhex = 0 -for i in xrange(0, 4): minverhex = (minverhex << 8) + minver[[i]] +for i in range(0, 4): minverhex = (minverhex << 8) + minver[[i]] sys.exit(verhex < minverhex)" AS_IF([AM_RUN_LOG([$PYTHON -c "$prog"])], [$2], [$3])]) From de38127f1c626d7ea46aedc45723b9ae7f79d082 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 25 Jun 2011 23:32:22 -0700 Subject: [PATCH 407/585] Fix "times" relocation handling. Previously a line such as "times 4 mov rax, [rel foobar]" would result in incorrect relocations being generated. Patch by: bird-yasm@anduin.net [#211 state:resolved] --- libyasm/bc-align.c | 6 +- libyasm/bc-data.c | 9 +- libyasm/bc-incbin.c | 6 +- libyasm/bc-org.c | 6 +- libyasm/bc-reserve.c | 6 +- libyasm/bytecode.c | 7 +- libyasm/bytecode.h | 7 +- modules/arch/lc3b/lc3bbc.c | 19 +- modules/arch/x86/x86bc.c | 28 +- modules/dbgfmts/codeview/cv-symline.c | 25 +- modules/dbgfmts/codeview/cv-type.c | 5 +- modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c | 7 +- modules/dbgfmts/dwarf2/dwarf2-info.c | 5 +- modules/dbgfmts/dwarf2/dwarf2-line.c | 12 +- modules/dbgfmts/stabs/stabs-dbgfmt.c | 10 +- modules/objfmts/coff/coff-objfmt.c | 5 +- modules/objfmts/coff/win64-except.c | 16 +- modules/objfmts/elf/tests/amd64/Makefile.inc | 2 + .../objfmts/elf/tests/amd64/multiplefixup.asm | 8 + .../objfmts/elf/tests/amd64/multiplefixup.hex | 992 ++++++++++++++++++ 20 files changed, 1109 insertions(+), 72 deletions(-) create mode 100644 modules/objfmts/elf/tests/amd64/multiplefixup.asm create mode 100644 modules/objfmts/elf/tests/amd64/multiplefixup.hex diff --git a/libyasm/bc-align.c b/libyasm/bc-align.c index fd7c8f52..763140d7 100644 --- a/libyasm/bc-align.c +++ b/libyasm/bc-align.c @@ -58,7 +58,8 @@ static int bc_align_calc_len(yasm_bytecode *bc, yasm_bc_add_span_func add_span, static int bc_align_expand(yasm_bytecode *bc, int span, long old_val, long new_val, /*@out@*/ long *neg_thres, /*@out@*/ long *pos_thres); -static int bc_align_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, +static int bc_align_tobytes(yasm_bytecode *bc, unsigned char **bufp, + unsigned char *bufstart, void *d, yasm_output_value_func output_value, /*@null@*/ yasm_output_reloc_func output_reloc); @@ -164,7 +165,8 @@ bc_align_expand(yasm_bytecode *bc, int span, long old_val, long new_val, } static int -bc_align_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, +bc_align_tobytes(yasm_bytecode *bc, unsigned char **bufp, + unsigned char *bufstart, void *d, yasm_output_value_func output_value, /*@unused@*/ yasm_output_reloc_func output_reloc) { diff --git a/libyasm/bc-data.c b/libyasm/bc-data.c index 1a62d200..7fe40913 100644 --- a/libyasm/bc-data.c +++ b/libyasm/bc-data.c @@ -70,7 +70,8 @@ static void bc_data_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc); static int bc_data_item_size(yasm_bytecode *bc); static int bc_data_calc_len(yasm_bytecode *bc, yasm_bc_add_span_func add_span, void *add_span_data); -static int bc_data_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, +static int bc_data_tobytes(yasm_bytecode *bc, unsigned char **bufp, + unsigned char *bufstart, void *d, yasm_output_value_func output_value, /*@null@*/ yasm_output_reloc_func output_reloc); @@ -203,13 +204,13 @@ bc_data_calc_len(yasm_bytecode *bc, yasm_bc_add_span_func add_span, } static int -bc_data_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, +bc_data_tobytes(yasm_bytecode *bc, unsigned char **bufp, + unsigned char *bufstart, void *d, yasm_output_value_func output_value, /*@unused@*/ yasm_output_reloc_func output_reloc) { bytecode_data *bc_data = (bytecode_data *)bc->contents; yasm_dataval *dv; - unsigned char *bufp_orig = *bufp; yasm_intnum *intn; unsigned int val_len; unsigned long multiple, i; @@ -224,7 +225,7 @@ bc_data_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, val_len = dv->data.val.size/8; for (i=0; idata.val, *bufp, val_len, - (unsigned long)(*bufp-bufp_orig), bc, 1, + (unsigned long)(*bufp-bufstart), bc, 1, d)) return 1; *bufp += val_len; diff --git a/libyasm/bc-incbin.c b/libyasm/bc-incbin.c index f2bee743..23146015 100644 --- a/libyasm/bc-incbin.c +++ b/libyasm/bc-incbin.c @@ -58,7 +58,8 @@ static void bc_incbin_print(const void *contents, FILE *f, int indent_level); static void bc_incbin_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc); static int bc_incbin_calc_len(yasm_bytecode *bc, yasm_bc_add_span_func add_span, void *add_span_data); -static int bc_incbin_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, +static int bc_incbin_tobytes(yasm_bytecode *bc, unsigned char **bufp, + unsigned char *bufstart, void *d, yasm_output_value_func output_value, /*@null@*/ yasm_output_reloc_func output_reloc); @@ -195,7 +196,8 @@ bc_incbin_calc_len(yasm_bytecode *bc, yasm_bc_add_span_func add_span, } static int -bc_incbin_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, +bc_incbin_tobytes(yasm_bytecode *bc, unsigned char **bufp, + unsigned char *bufstart, void *d, yasm_output_value_func output_value, /*@unused@*/ yasm_output_reloc_func output_reloc) { diff --git a/libyasm/bc-org.c b/libyasm/bc-org.c index b6f101cc..cb2d82b8 100644 --- a/libyasm/bc-org.c +++ b/libyasm/bc-org.c @@ -52,7 +52,8 @@ static int bc_org_calc_len(yasm_bytecode *bc, yasm_bc_add_span_func add_span, static int bc_org_expand(yasm_bytecode *bc, int span, long old_val, long new_val, /*@out@*/ long *neg_thres, /*@out@*/ long *pos_thres); -static int bc_org_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, +static int bc_org_tobytes(yasm_bytecode *bc, unsigned char **bufp, + unsigned char *bufstart, void *d, yasm_output_value_func output_value, /*@null@*/ yasm_output_reloc_func output_reloc); @@ -120,7 +121,8 @@ bc_org_expand(yasm_bytecode *bc, int span, long old_val, long new_val, } static int -bc_org_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, +bc_org_tobytes(yasm_bytecode *bc, unsigned char **bufp, + unsigned char *bufstart, void *d, yasm_output_value_func output_value, /*@unused@*/ yasm_output_reloc_func output_reloc) { diff --git a/libyasm/bc-reserve.c b/libyasm/bc-reserve.c index 5cfd38a0..09196faa 100644 --- a/libyasm/bc-reserve.c +++ b/libyasm/bc-reserve.c @@ -50,7 +50,8 @@ static int bc_reserve_elem_size(yasm_bytecode *bc); static int bc_reserve_calc_len(yasm_bytecode *bc, yasm_bc_add_span_func add_span, void *add_span_data); -static int bc_reserve_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, +static int bc_reserve_tobytes(yasm_bytecode *bc, unsigned char **bufp, + unsigned char *bufstart, void *d, yasm_output_value_func output_value, /*@null@*/ yasm_output_reloc_func output_reloc); @@ -114,7 +115,8 @@ bc_reserve_calc_len(yasm_bytecode *bc, yasm_bc_add_span_func add_span, } static int -bc_reserve_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, +bc_reserve_tobytes(yasm_bytecode *bc, unsigned char **bufp, + unsigned char *bufstart, void *d, yasm_output_value_func output_value, /*@unused@*/ yasm_output_reloc_func output_reloc) { diff --git a/libyasm/bytecode.c b/libyasm/bytecode.c index 851085c0..50a4fa0f 100644 --- a/libyasm/bytecode.c +++ b/libyasm/bytecode.c @@ -73,7 +73,8 @@ yasm_bc_expand_common(yasm_bytecode *bc, int span, long old_val, long new_val, } int -yasm_bc_tobytes_common(yasm_bytecode *bc, unsigned char **bufp, void *d, +yasm_bc_tobytes_common(yasm_bytecode *bc, unsigned char **buf, + unsigned char *bufstart, void *d, yasm_output_value_func output_value, /*@null@*/ yasm_output_reloc_func output_reloc) { @@ -305,6 +306,7 @@ yasm_bc_tobytes(yasm_bytecode *bc, unsigned char *buf, unsigned long *bufsize, /*@sets *buf@*/ { /*@only@*/ /*@null@*/ unsigned char *mybuf = NULL; + unsigned char *bufstart; unsigned char *origbuf, *destbuf; long i; int error = 0; @@ -329,6 +331,7 @@ yasm_bc_tobytes(yasm_bytecode *bc, unsigned char *buf, unsigned long *bufsize, destbuf = mybuf; } else destbuf = buf; + bufstart = destbuf; *bufsize = bc->len*bc->mult_int; @@ -336,7 +339,7 @@ yasm_bc_tobytes(yasm_bytecode *bc, unsigned char *buf, unsigned long *bufsize, yasm_internal_error(N_("got empty bytecode in bc_tobytes")); else for (i=0; imult_int; i++) { origbuf = destbuf; - error = bc->callback->tobytes(bc, &destbuf, d, output_value, + error = bc->callback->tobytes(bc, &destbuf, bufstart, d, output_value, output_reloc); if (!error && ((unsigned long)(destbuf - origbuf) != bc->len)) diff --git a/libyasm/bytecode.h b/libyasm/bytecode.h index 0753ccf5..2b664271 100644 --- a/libyasm/bytecode.h +++ b/libyasm/bytecode.h @@ -147,6 +147,8 @@ typedef struct yasm_bytecode_callback { * passed-in buf matches the bytecode length * (it's okay not to do this if an error * indication is returned) + * \param bufstart For calculating the correct offset parameter for + * the \a output_value calls: *bufp - bufstart. * \param d data to pass to each call to * output_value/output_reloc * \param output_value function to call to convert values into their byte @@ -158,7 +160,8 @@ typedef struct yasm_bytecode_callback { * preferable if calling this function twice would result in the * same output. */ - int (*tobytes) (yasm_bytecode *bc, unsigned char **bufp, void *d, + int (*tobytes) (yasm_bytecode *bc, unsigned char **bufp, + unsigned char *bufstart, void *d, yasm_output_value_func output_value, /*@null@*/ yasm_output_reloc_func output_reloc); @@ -277,7 +280,7 @@ int yasm_bc_expand_common */ YASM_LIB_DECL int yasm_bc_tobytes_common - (yasm_bytecode *bc, unsigned char **bufp, void *d, + (yasm_bytecode *bc, unsigned char **bufp, unsigned char *bufstart, void *d, yasm_output_value_func output_value, /*@null@*/ yasm_output_reloc_func output_reloc); diff --git a/modules/arch/lc3b/lc3bbc.c b/modules/arch/lc3b/lc3bbc.c index a5d0192b..51029cdb 100644 --- a/modules/arch/lc3b/lc3bbc.c +++ b/modules/arch/lc3b/lc3bbc.c @@ -44,6 +44,7 @@ static int lc3b_bc_insn_expand(yasm_bytecode *bc, int span, long old_val, long new_val, /*@out@*/ long *neg_thres, /*@out@*/ long *pos_thres); static int lc3b_bc_insn_tobytes(yasm_bytecode *bc, unsigned char **bufp, + unsigned char *bufstart, void *d, yasm_output_value_func output_value, /*@null@*/ yasm_output_reloc_func output_reloc); @@ -165,12 +166,14 @@ lc3b_bc_insn_expand(yasm_bytecode *bc, int span, long old_val, long new_val, } static int -lc3b_bc_insn_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, +lc3b_bc_insn_tobytes(yasm_bytecode *bc, unsigned char **bufp, + unsigned char *bufstart, void *d, yasm_output_value_func output_value, /*@unused@*/ yasm_output_reloc_func output_reloc) { lc3b_insn *insn = (lc3b_insn *)bc->contents; /*@only@*/ yasm_intnum *delta; + unsigned long buf_off = (unsigned long)(*bufp - bufstart); /* Output opcode */ YASM_SAVE_16_L(*bufp, insn->opcode); @@ -181,29 +184,29 @@ lc3b_bc_insn_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, break; case LC3B_IMM_4: insn->imm.size = 4; - if (output_value(&insn->imm, *bufp, 2, 0, bc, 1, d)) + if (output_value(&insn->imm, *bufp, 2, buf_off, bc, 1, d)) return 1; break; case LC3B_IMM_5: insn->imm.size = 5; insn->imm.sign = 1; - if (output_value(&insn->imm, *bufp, 2, 0, bc, 1, d)) + if (output_value(&insn->imm, *bufp, 2, buf_off, bc, 1, d)) return 1; break; case LC3B_IMM_6_WORD: insn->imm.size = 6; - if (output_value(&insn->imm, *bufp, 2, 0, bc, 1, d)) + if (output_value(&insn->imm, *bufp, 2, buf_off, bc, 1, d)) return 1; break; case LC3B_IMM_6_BYTE: insn->imm.size = 6; insn->imm.sign = 1; - if (output_value(&insn->imm, *bufp, 2, 0, bc, 1, d)) + if (output_value(&insn->imm, *bufp, 2, buf_off, bc, 1, d)) return 1; break; case LC3B_IMM_8: insn->imm.size = 8; - if (output_value(&insn->imm, *bufp, 2, 0, bc, 1, d)) + if (output_value(&insn->imm, *bufp, 2, buf_off, bc, 1, d)) return 1; break; case LC3B_IMM_9_PC: @@ -220,12 +223,12 @@ lc3b_bc_insn_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, insn->imm.size = 9; insn->imm.sign = 1; - if (output_value(&insn->imm, *bufp, 2, 0, bc, 1, d)) + if (output_value(&insn->imm, *bufp, 2, buf_off, bc, 1, d)) return 1; break; case LC3B_IMM_9: insn->imm.size = 9; - if (output_value(&insn->imm, *bufp, 2, 0, bc, 1, d)) + if (output_value(&insn->imm, *bufp, 2, buf_off, bc, 1, d)) return 1; break; default: diff --git a/modules/arch/x86/x86bc.c b/modules/arch/x86/x86bc.c index c329f2ea..49df4f8f 100644 --- a/modules/arch/x86/x86bc.c +++ b/modules/arch/x86/x86bc.c @@ -44,6 +44,7 @@ static int x86_bc_insn_expand(yasm_bytecode *bc, int span, long old_val, long new_val, /*@out@*/ long *neg_thres, /*@out@*/ long *pos_thres); static int x86_bc_insn_tobytes(yasm_bytecode *bc, unsigned char **bufp, + unsigned char *bufstart, void *d, yasm_output_value_func output_value, /*@null@*/ yasm_output_reloc_func output_reloc); @@ -56,6 +57,7 @@ static int x86_bc_jmp_expand(yasm_bytecode *bc, int span, long old_val, long new_val, /*@out@*/ long *neg_thres, /*@out@*/ long *pos_thres); static int x86_bc_jmp_tobytes(yasm_bytecode *bc, unsigned char **bufp, + unsigned char *bufstart, void *d, yasm_output_value_func output_value, /*@null@*/ yasm_output_reloc_func output_reloc); @@ -66,7 +68,7 @@ static int x86_bc_jmpfar_calc_len(yasm_bytecode *bc, yasm_bc_add_span_func add_span, void *add_span_data); static int x86_bc_jmpfar_tobytes - (yasm_bytecode *bc, unsigned char **bufp, void *d, + (yasm_bytecode *bc, unsigned char **bufp, unsigned char *bufstart, void *d, yasm_output_value_func output_value, /*@null@*/ yasm_output_reloc_func output_reloc); @@ -800,14 +802,14 @@ x86_opcode_tobytes(const x86_opcode *opcode, unsigned char **bufp) } static int -x86_bc_insn_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, +x86_bc_insn_tobytes(yasm_bytecode *bc, unsigned char **bufp, + unsigned char *bufstart, void *d, yasm_output_value_func output_value, /*@unused@*/ yasm_output_reloc_func output_reloc) { x86_insn *insn = (x86_insn *)bc->contents; /*@null@*/ x86_effaddr *x86_ea = (x86_effaddr *)insn->x86_ea; yasm_value *imm = insn->imm; - unsigned char *bufp_orig = *bufp; /* Prefixes */ x86_common_tobytes(&insn->common, bufp, @@ -874,7 +876,7 @@ x86_bc_insn_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, yasm_expr_int(delta), bc->line); } if (output_value(&x86_ea->ea.disp, *bufp, disp_len, - (unsigned long)(*bufp-bufp_orig), bc, 1, d)) + (unsigned long)(*bufp-bufstart), bc, 1, d)) return 1; *bufp += disp_len; } @@ -892,7 +894,7 @@ x86_bc_insn_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, imm_len = 1; } else imm_len = imm->size/8; - if (output_value(imm, *bufp, imm_len, (unsigned long)(*bufp-bufp_orig), + if (output_value(imm, *bufp, imm_len, (unsigned long)(*bufp-bufstart), bc, 1, d)) return 1; *bufp += imm_len; @@ -902,14 +904,14 @@ x86_bc_insn_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, } static int -x86_bc_jmp_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, +x86_bc_jmp_tobytes(yasm_bytecode *bc, unsigned char **bufp, + unsigned char *bufstart, void *d, yasm_output_value_func output_value, /*@unused@*/ yasm_output_reloc_func output_reloc) { x86_jmp *jmp = (x86_jmp *)bc->contents; unsigned char opersize; unsigned int i; - unsigned char *bufp_orig = *bufp; /*@only@*/ yasm_intnum *delta; /* Prefixes */ @@ -944,7 +946,7 @@ x86_bc_jmp_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, jmp->target.size = 8; jmp->target.sign = 1; if (output_value(&jmp->target, *bufp, 1, - (unsigned long)(*bufp-bufp_orig), bc, 1, d)) + (unsigned long)(*bufp-bufstart), bc, 1, d)) return 1; *bufp += 1; break; @@ -976,7 +978,7 @@ x86_bc_jmp_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, jmp->target.size = i*8; jmp->target.sign = 1; if (output_value(&jmp->target, *bufp, i, - (unsigned long)(*bufp-bufp_orig), bc, 1, d)) + (unsigned long)(*bufp-bufstart), bc, 1, d)) return 1; *bufp += i; break; @@ -989,13 +991,13 @@ x86_bc_jmp_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, } static int -x86_bc_jmpfar_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, +x86_bc_jmpfar_tobytes(yasm_bytecode *bc, unsigned char **bufp, + unsigned char *bufstart, void *d, yasm_output_value_func output_value, /*@unused@*/ yasm_output_reloc_func output_reloc) { x86_jmpfar *jmpfar = (x86_jmpfar *)bc->contents; unsigned int i; - unsigned char *bufp_orig = *bufp; unsigned char opersize; x86_common_tobytes(&jmpfar->common, bufp, 0); @@ -1009,12 +1011,12 @@ x86_bc_jmpfar_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, i = (opersize == 16) ? 2 : 4; jmpfar->offset.size = i*8; if (output_value(&jmpfar->offset, *bufp, i, - (unsigned long)(*bufp-bufp_orig), bc, 1, d)) + (unsigned long)(*bufp-bufstart), bc, 1, d)) return 1; *bufp += i; jmpfar->segment.size = 16; if (output_value(&jmpfar->segment, *bufp, 2, - (unsigned long)(*bufp-bufp_orig), bc, 1, d)) + (unsigned long)(*bufp-bufstart), bc, 1, d)) return 1; *bufp += 2; diff --git a/modules/dbgfmts/codeview/cv-symline.c b/modules/dbgfmts/codeview/cv-symline.c index ca31271b..8a797295 100644 --- a/modules/dbgfmts/codeview/cv-symline.c +++ b/modules/dbgfmts/codeview/cv-symline.c @@ -163,7 +163,7 @@ static void cv8_symhead_bc_print(const void *contents, FILE *f, static int cv8_symhead_bc_calc_len (yasm_bytecode *bc, yasm_bc_add_span_func add_span, void *add_span_data); static int cv8_symhead_bc_tobytes - (yasm_bytecode *bc, unsigned char **bufp, void *d, + (yasm_bytecode *bc, unsigned char **bufp, unsigned char *bufstart, void *d, yasm_output_value_func output_value, /*@null@*/ yasm_output_reloc_func output_reloc); @@ -173,7 +173,7 @@ static void cv8_fileinfo_bc_print(const void *contents, FILE *f, static int cv8_fileinfo_bc_calc_len (yasm_bytecode *bc, yasm_bc_add_span_func add_span, void *add_span_data); static int cv8_fileinfo_bc_tobytes - (yasm_bytecode *bc, unsigned char **bufp, void *d, + (yasm_bytecode *bc, unsigned char **bufp, unsigned char *bufstart, void *d, yasm_output_value_func output_value, /*@null@*/ yasm_output_reloc_func output_reloc); @@ -183,7 +183,7 @@ static void cv8_lineinfo_bc_print(const void *contents, FILE *f, static int cv8_lineinfo_bc_calc_len (yasm_bytecode *bc, yasm_bc_add_span_func add_span, void *add_span_data); static int cv8_lineinfo_bc_tobytes - (yasm_bytecode *bc, unsigned char **bufp, void *d, + (yasm_bytecode *bc, unsigned char **bufp, unsigned char *bufstart, void *d, yasm_output_value_func output_value, /*@null@*/ yasm_output_reloc_func output_reloc); @@ -192,7 +192,7 @@ static void cv_sym_bc_print(const void *contents, FILE *f, int indent_level); static int cv_sym_bc_calc_len (yasm_bytecode *bc, yasm_bc_add_span_func add_span, void *add_span_data); static int cv_sym_bc_tobytes - (yasm_bytecode *bc, unsigned char **bufp, void *d, + (yasm_bytecode *bc, unsigned char **bufp, unsigned char *bufstart, void *d, yasm_output_value_func output_value, /*@null@*/ yasm_output_reloc_func output_reloc); @@ -727,7 +727,8 @@ cv8_symhead_bc_calc_len(yasm_bytecode *bc, yasm_bc_add_span_func add_span, } static int -cv8_symhead_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, +cv8_symhead_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, + unsigned char *bufstart, void *d, yasm_output_value_func output_value, yasm_output_reloc_func output_reloc) { @@ -800,7 +801,8 @@ cv8_fileinfo_bc_calc_len(yasm_bytecode *bc, yasm_bc_add_span_func add_span, } static int -cv8_fileinfo_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, +cv8_fileinfo_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, + unsigned char *bufstart, void *d, yasm_output_value_func output_value, yasm_output_reloc_func output_reloc) { @@ -867,7 +869,8 @@ cv8_lineinfo_bc_calc_len(yasm_bytecode *bc, yasm_bc_add_span_func add_span, } static int -cv8_lineinfo_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, +cv8_lineinfo_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, + unsigned char *bufstart, void *d, yasm_output_value_func output_value, yasm_output_reloc_func output_reloc) { @@ -879,7 +882,8 @@ cv8_lineinfo_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, cv8_lineset *ls; /* start offset and section */ - cv_out_sym(li->sectsym, 0, bc, &buf, d, output_value); + cv_out_sym(li->sectsym, (unsigned long)(buf - bufstart), bc, &buf, + d, output_value); /* Two bytes of pad/alignment */ YASM_WRITE_8(buf, 0); @@ -1022,7 +1026,8 @@ cv_sym_bc_calc_len(yasm_bytecode *bc, yasm_bc_add_span_func add_span, } static int -cv_sym_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, +cv_sym_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, + unsigned char *bufstart, void *d, yasm_output_value_func output_value, yasm_output_reloc_func output_reloc) { @@ -1064,7 +1069,7 @@ cv_sym_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, break; case 'Y': cv_out_sym((yasm_symrec *)cvs->args[arg++].p, - (unsigned long)(buf-(*bufp)), bc, &buf, d, + (unsigned long)(buf-bufstart), bc, &buf, d, output_value); break; case 'T': diff --git a/modules/dbgfmts/codeview/cv-type.c b/modules/dbgfmts/codeview/cv-type.c index 862bea43..79516257 100644 --- a/modules/dbgfmts/codeview/cv-type.c +++ b/modules/dbgfmts/codeview/cv-type.c @@ -483,7 +483,7 @@ static void cv_type_bc_print(const void *contents, FILE *f, int indent_level); static int cv_type_bc_calc_len (yasm_bytecode *bc, yasm_bc_add_span_func add_span, void *add_span_data); static int cv_type_bc_tobytes - (yasm_bytecode *bc, unsigned char **bufp, void *d, + (yasm_bytecode *bc, unsigned char **bufp, unsigned char *bufstart, void *d, yasm_output_value_func output_value, /*@null@*/ yasm_output_reloc_func output_reloc); @@ -732,7 +732,8 @@ cv_type_bc_calc_len(yasm_bytecode *bc, yasm_bc_add_span_func add_span, } static int -cv_type_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, +cv_type_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, + unsigned char *bufstart, void *d, yasm_output_value_func output_value, yasm_output_reloc_func output_reloc) { diff --git a/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c b/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c index d015f5c3..85c5e508 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c +++ b/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c @@ -46,7 +46,7 @@ static void dwarf2_head_bc_print(const void *contents, FILE *f, static int dwarf2_head_bc_calc_len (yasm_bytecode *bc, yasm_bc_add_span_func add_span, void *add_span_data); static int dwarf2_head_bc_tobytes - (yasm_bytecode *bc, unsigned char **bufp, void *d, + (yasm_bytecode *bc, unsigned char **bufp, unsigned char *bufstart, void *d, yasm_output_value_func output_value, /*@null@*/ yasm_output_reloc_func output_reloc); @@ -248,7 +248,8 @@ dwarf2_head_bc_calc_len(yasm_bytecode *bc, yasm_bc_add_span_func add_span, } static int -dwarf2_head_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, +dwarf2_head_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, + unsigned char *bufstart, void *d, yasm_output_value_func output_value, yasm_output_reloc_func output_reloc) { @@ -288,7 +289,7 @@ dwarf2_head_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, yasm_section_bcs_first(head->debug_ptr)), dbgfmt_dwarf2->sizeof_offset*8); output_value(&value, buf, dbgfmt_dwarf2->sizeof_offset, - (unsigned long)(buf-*bufp), bc, 0, d); + (unsigned long)(buf-bufstart), bc, 0, d); buf += dbgfmt_dwarf2->sizeof_offset; } diff --git a/modules/dbgfmts/dwarf2/dwarf2-info.c b/modules/dbgfmts/dwarf2/dwarf2-info.c index eebce33f..72657504 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-info.c +++ b/modules/dbgfmts/dwarf2/dwarf2-info.c @@ -197,7 +197,7 @@ static void dwarf2_abbrev_bc_print(const void *contents, FILE *f, static int dwarf2_abbrev_bc_calc_len (yasm_bytecode *bc, yasm_bc_add_span_func add_span, void *add_span_data); static int dwarf2_abbrev_bc_tobytes - (yasm_bytecode *bc, unsigned char **bufp, void *d, + (yasm_bytecode *bc, unsigned char **bufp, unsigned char *bufstart, void *d, yasm_output_value_func output_value, /*@null@*/ yasm_output_reloc_func output_reloc); @@ -397,7 +397,8 @@ dwarf2_abbrev_bc_calc_len(yasm_bytecode *bc, yasm_bc_add_span_func add_span, } static int -dwarf2_abbrev_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, +dwarf2_abbrev_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, + unsigned char *bufstart, void *d, yasm_output_value_func output_value, yasm_output_reloc_func output_reloc) { diff --git a/modules/dbgfmts/dwarf2/dwarf2-line.c b/modules/dbgfmts/dwarf2/dwarf2-line.c index e961eb39..d2f55e55 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-line.c +++ b/modules/dbgfmts/dwarf2/dwarf2-line.c @@ -132,7 +132,7 @@ static void dwarf2_spp_bc_print(const void *contents, FILE *f, static int dwarf2_spp_bc_calc_len (yasm_bytecode *bc, yasm_bc_add_span_func add_span, void *add_span_data); static int dwarf2_spp_bc_tobytes - (yasm_bytecode *bc, unsigned char **bufp, void *d, + (yasm_bytecode *bc, unsigned char **bufp, unsigned char *bufstart, void *d, yasm_output_value_func output_value, /*@null@*/ yasm_output_reloc_func output_reloc); @@ -142,7 +142,7 @@ static void dwarf2_line_op_bc_print(const void *contents, FILE *f, static int dwarf2_line_op_bc_calc_len (yasm_bytecode *bc, yasm_bc_add_span_func add_span, void *add_span_data); static int dwarf2_line_op_bc_tobytes - (yasm_bytecode *bc, unsigned char **bufp, void *d, + (yasm_bytecode *bc, unsigned char **bufp, unsigned char *bufstart, void *d, yasm_output_value_func output_value, /*@null@*/ yasm_output_reloc_func output_reloc); @@ -777,7 +777,8 @@ dwarf2_spp_bc_calc_len(yasm_bytecode *bc, yasm_bc_add_span_func add_span, } static int -dwarf2_spp_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, +dwarf2_spp_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, + unsigned char *bufstart, void *d, yasm_output_value_func output_value, yasm_output_reloc_func output_reloc) { @@ -861,7 +862,8 @@ dwarf2_line_op_bc_calc_len(yasm_bytecode *bc, yasm_bc_add_span_func add_span, } static int -dwarf2_line_op_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, +dwarf2_line_op_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, + unsigned char *bufstart, void *d, yasm_output_value_func output_value, yasm_output_reloc_func output_reloc) { @@ -879,7 +881,7 @@ dwarf2_line_op_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, yasm_value_init_sym(&value, line_op->ext_operand, line_op->ext_operandsize*8); output_value(&value, buf, line_op->ext_operandsize, - (unsigned long)(buf-*bufp), bc, 0, d); + (unsigned long)(buf-bufstart), bc, 0, d); buf += line_op->ext_operandsize; } if (line_op->ext_operand_int) { diff --git a/modules/dbgfmts/stabs/stabs-dbgfmt.c b/modules/dbgfmts/stabs/stabs-dbgfmt.c index 247639ea..a4ad2894 100644 --- a/modules/dbgfmts/stabs/stabs-dbgfmt.c +++ b/modules/dbgfmts/stabs/stabs-dbgfmt.c @@ -119,7 +119,7 @@ static void stabs_bc_str_print(const void *contents, FILE *f, int static int stabs_bc_str_calc_len (yasm_bytecode *bc, yasm_bc_add_span_func add_span, void *add_span_data); static int stabs_bc_str_tobytes - (yasm_bytecode *bc, unsigned char **bufp, void *d, + (yasm_bytecode *bc, unsigned char **bufp, unsigned char *bufstart, void *d, yasm_output_value_func output_value, /*@null@*/ yasm_output_reloc_func output_reloc); @@ -129,7 +129,7 @@ static void stabs_bc_stab_print(const void *contents, FILE *f, int static int stabs_bc_stab_calc_len (yasm_bytecode *bc, yasm_bc_add_span_func add_span, void *add_span_data); static int stabs_bc_stab_tobytes - (yasm_bytecode *bc, unsigned char **bufp, void *d, + (yasm_bytecode *bc, unsigned char **bufp, unsigned char *bufstart, void *d, yasm_output_value_func output_value, /*@null@*/ yasm_output_reloc_func output_reloc); @@ -405,7 +405,8 @@ stabs_dbgfmt_generate(yasm_object *object, yasm_linemap *linemap, } static int -stabs_bc_stab_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, +stabs_bc_stab_tobytes(yasm_bytecode *bc, unsigned char **bufp, + unsigned char *bufstart, void *d, yasm_output_value_func output_value, yasm_output_reloc_func output_reloc) { @@ -439,7 +440,8 @@ stabs_bc_stab_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, } static int -stabs_bc_str_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, +stabs_bc_str_tobytes(yasm_bytecode *bc, unsigned char **bufp, + unsigned char *bufstart, void *d, yasm_output_value_func output_value, yasm_output_reloc_func output_reloc) { diff --git a/modules/objfmts/coff/coff-objfmt.c b/modules/objfmts/coff/coff-objfmt.c index 0f941569..0591884e 100644 --- a/modules/objfmts/coff/coff-objfmt.c +++ b/modules/objfmts/coff/coff-objfmt.c @@ -230,7 +230,7 @@ static void win32_sxdata_bc_print(const void *contents, FILE *f, static int win32_sxdata_bc_calc_len (yasm_bytecode *bc, yasm_bc_add_span_func add_span, void *add_span_data); static int win32_sxdata_bc_tobytes - (yasm_bytecode *bc, unsigned char **bufp, void *d, + (yasm_bytecode *bc, unsigned char **bufp, unsigned char *bufstart, void *d, yasm_output_value_func output_value, /*@null@*/ yasm_output_reloc_func output_reloc); @@ -1761,7 +1761,8 @@ win32_sxdata_bc_calc_len(yasm_bytecode *bc, yasm_bc_add_span_func add_span, } static int -win32_sxdata_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, +win32_sxdata_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, + unsigned char *bufstart, void *d, yasm_output_value_func output_value, yasm_output_reloc_func output_reloc) { diff --git a/modules/objfmts/coff/win64-except.c b/modules/objfmts/coff/win64-except.c index 5596eac3..32ef919a 100644 --- a/modules/objfmts/coff/win64-except.c +++ b/modules/objfmts/coff/win64-except.c @@ -48,7 +48,7 @@ static int win64_uwinfo_bc_expand(yasm_bytecode *bc, int span, long old_val, long new_val, /*@out@*/ long *neg_thres, /*@out@*/ long *pos_thres); static int win64_uwinfo_bc_tobytes - (yasm_bytecode *bc, unsigned char **bufp, void *d, + (yasm_bytecode *bc, unsigned char **bufp, unsigned char *bufstart, void *d, yasm_output_value_func output_value, /*@null@*/ yasm_output_reloc_func output_reloc); @@ -63,7 +63,7 @@ static int win64_uwcode_bc_expand(yasm_bytecode *bc, int span, long old_val, long new_val, /*@out@*/ long *neg_thres, /*@out@*/ long *pos_thres); static int win64_uwcode_bc_tobytes - (yasm_bytecode *bc, unsigned char **bufp, void *d, + (yasm_bytecode *bc, unsigned char **bufp, unsigned char *bufstart, void *d, yasm_output_value_func output_value, /*@null@*/ yasm_output_reloc_func output_reloc); @@ -279,7 +279,8 @@ win64_uwinfo_bc_expand(yasm_bytecode *bc, int span, long old_val, long new_val, } static int -win64_uwinfo_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, +win64_uwinfo_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, + unsigned char *bufstart, void *d, yasm_output_value_func output_value, yasm_output_reloc_func output_reloc) { @@ -295,12 +296,12 @@ win64_uwinfo_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, YASM_WRITE_8(buf, 1); /* Size of prolog */ - output_value(&info->prolog_size, buf, 1, (unsigned long)(buf-*bufp), + output_value(&info->prolog_size, buf, 1, (unsigned long)(buf-*bufstart), bc, 1, d); buf += 1; /* Count of codes */ - output_value(&info->codes_count, buf, 1, (unsigned long)(buf-*bufp), + output_value(&info->codes_count, buf, 1, (unsigned long)(buf-bufstart), bc, 1, d); buf += 1; @@ -459,7 +460,8 @@ win64_uwcode_bc_expand(yasm_bytecode *bc, int span, long old_val, long new_val, } static int -win64_uwcode_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, +win64_uwcode_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, + unsigned char *bufstart, void *d, yasm_output_value_func output_value, yasm_output_reloc_func output_reloc) { @@ -476,7 +478,7 @@ win64_uwcode_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, yasm_expr_create(YASM_EXPR_SUB, yasm_expr_sym(code->loc), yasm_expr_sym(code->proc), bc->line), 8); - output_value(&val, buf, 1, (unsigned long)(buf-*bufp), bc, 1, d); + output_value(&val, buf, 1, (unsigned long)(buf-bufstart), bc, 1, d); buf += 1; yasm_value_delete(&val); diff --git a/modules/objfmts/elf/tests/amd64/Makefile.inc b/modules/objfmts/elf/tests/amd64/Makefile.inc index 58b6156f..7d10d9c1 100644 --- a/modules/objfmts/elf/tests/amd64/Makefile.inc +++ b/modules/objfmts/elf/tests/amd64/Makefile.inc @@ -9,3 +9,5 @@ EXTRA_DIST += modules/objfmts/elf/tests/amd64/elfso64.asm EXTRA_DIST += modules/objfmts/elf/tests/amd64/elfso64.hex EXTRA_DIST += modules/objfmts/elf/tests/amd64/gotpcrel.asm EXTRA_DIST += modules/objfmts/elf/tests/amd64/gotpcrel.hex +EXTRA_DIST += modules/objfmts/elf/tests/amd64/multiplefixup.asm +EXTRA_DIST += modules/objfmts/elf/tests/amd64/multiplefixup.hex diff --git a/modules/objfmts/elf/tests/amd64/multiplefixup.asm b/modules/objfmts/elf/tests/amd64/multiplefixup.asm new file mode 100644 index 00000000..ec253cbb --- /dev/null +++ b/modules/objfmts/elf/tests/amd64/multiplefixup.asm @@ -0,0 +1,8 @@ +[section .data] +foobar: + dq 42 +[section .text] +foo: + times 4 mov rax, [rel foobar] + times 4 mov rax, [foobar] + times 4 jmp foo diff --git a/modules/objfmts/elf/tests/amd64/multiplefixup.hex b/modules/objfmts/elf/tests/amd64/multiplefixup.hex new file mode 100644 index 00000000..16565ff5 --- /dev/null +++ b/modules/objfmts/elf/tests/amd64/multiplefixup.hex @@ -0,0 +1,992 @@ +7f +45 +4c +46 +02 +01 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +3e +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +20 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +40 +00 +00 +00 +00 +00 +40 +00 +07 +00 +01 +00 +48 +8b +05 +00 +00 +00 +00 +48 +8b +05 +00 +00 +00 +00 +48 +8b +05 +00 +00 +00 +00 +48 +8b +05 +00 +00 +00 +00 +48 +8b +04 +25 +00 +00 +00 +00 +48 +8b +04 +25 +00 +00 +00 +00 +48 +8b +04 +25 +00 +00 +00 +00 +48 +8b +04 +25 +00 +00 +00 +00 +eb +c2 +eb +c0 +eb +be +eb +bc +03 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +04 +00 +00 +00 +fc +ff +ff +ff +ff +ff +ff +ff +0a +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +04 +00 +00 +00 +fc +ff +ff +ff +ff +ff +ff +ff +11 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +04 +00 +00 +00 +fc +ff +ff +ff +ff +ff +ff +ff +18 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +04 +00 +00 +00 +fc +ff +ff +ff +ff +ff +ff +ff +20 +00 +00 +00 +00 +00 +00 +00 +0a +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +28 +00 +00 +00 +00 +00 +00 +00 +0a +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +30 +00 +00 +00 +00 +00 +00 +00 +0a +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +38 +00 +00 +00 +00 +00 +00 +00 +0a +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +2a +00 +00 +00 +00 +00 +00 +00 +00 +2e +74 +65 +78 +74 +00 +2e +64 +61 +74 +61 +00 +2e +72 +65 +6c +61 +2e +74 +65 +78 +74 +00 +2e +73 +74 +72 +74 +61 +62 +00 +2e +73 +79 +6d +74 +61 +62 +00 +2e +73 +68 +73 +74 +72 +74 +61 +62 +00 +00 +00 +00 +2d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +04 +00 +f1 +ff +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +06 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +00 +06 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +28 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +4c +01 +00 +00 +00 +00 +00 +00 +32 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +18 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +80 +01 +00 +00 +00 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +20 +00 +00 +00 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +84 +01 +00 +00 +00 +00 +00 +00 +90 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +06 +00 +00 +00 +08 +00 +00 +00 +00 +00 +00 +00 +18 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +01 +00 +00 +00 +06 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +40 +00 +00 +00 +00 +00 +00 +00 +44 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +0d +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +84 +00 +00 +00 +00 +00 +00 +00 +c0 +00 +00 +00 +00 +00 +00 +00 +03 +00 +00 +00 +04 +00 +00 +00 +08 +00 +00 +00 +00 +00 +00 +00 +18 +00 +00 +00 +00 +00 +00 +00 +07 +00 +00 +00 +01 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +44 +01 +00 +00 +00 +00 +00 +00 +08 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 From 5d5ad1d91c0707d03dbd7d24bbefb495cc76c02c Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Mon, 27 Jun 2011 23:48:28 -0700 Subject: [PATCH 408/585] Allow 64-bit LFS/LGS/LSS. [#229 state:resolved] --- modules/arch/x86/gen_x86_insn.py | 2 +- modules/arch/x86/tests/Makefile.inc | 2 ++ modules/arch/x86/tests/lfs64.asm | 10 +++++++++ modules/arch/x86/tests/lfs64.hex | 33 +++++++++++++++++++++++++++++ 4 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 modules/arch/x86/tests/lfs64.asm create mode 100644 modules/arch/x86/tests/lfs64.hex diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index a91e4e1e..b0c26465 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -1729,7 +1729,7 @@ for sfx, sz in zip("wl", [16, 32]): add_insn("lds", "ldes", modifiers=[0xC5]) add_insn("les", "ldes", modifiers=[0xC4]) -for sfx, sz in zip("wl", [16, 32]): +for sfx, sz in zip("wlq", [16, 32, 64]): add_group("lfgss", suffix=sfx, cpu=["386"], diff --git a/modules/arch/x86/tests/Makefile.inc b/modules/arch/x86/tests/Makefile.inc index 8058f2d8..cb2377fc 100644 --- a/modules/arch/x86/tests/Makefile.inc +++ b/modules/arch/x86/tests/Makefile.inc @@ -99,6 +99,8 @@ EXTRA_DIST += modules/arch/x86/tests/larlsl.asm EXTRA_DIST += modules/arch/x86/tests/larlsl.hex EXTRA_DIST += modules/arch/x86/tests/lds.asm EXTRA_DIST += modules/arch/x86/tests/lds.hex +EXTRA_DIST += modules/arch/x86/tests/lfs64.asm +EXTRA_DIST += modules/arch/x86/tests/lfs64.hex EXTRA_DIST += modules/arch/x86/tests/loopadsz.asm EXTRA_DIST += modules/arch/x86/tests/loopadsz.hex EXTRA_DIST += modules/arch/x86/tests/lsahf.asm diff --git a/modules/arch/x86/tests/lfs64.asm b/modules/arch/x86/tests/lfs64.asm new file mode 100644 index 00000000..5ee04760 --- /dev/null +++ b/modules/arch/x86/tests/lfs64.asm @@ -0,0 +1,10 @@ +[bits 64] +lfs ax, [rbx] +lfs eax, [rbx] +lfs rax, [rbx] +lgs ax, [rbx] +lgs eax, [rbx] +lgs rax, [rbx] +lss ax, [rbx] +lss eax, [rbx] +lss rax, [rbx] diff --git a/modules/arch/x86/tests/lfs64.hex b/modules/arch/x86/tests/lfs64.hex new file mode 100644 index 00000000..8eb71864 --- /dev/null +++ b/modules/arch/x86/tests/lfs64.hex @@ -0,0 +1,33 @@ +66 +0f +b4 +03 +0f +b4 +03 +48 +0f +b4 +03 +66 +0f +b5 +03 +0f +b5 +03 +48 +0f +b5 +03 +66 +0f +b2 +03 +0f +b2 +03 +48 +0f +b2 +03 From f12d030f908a41a70877ee84cf46da8655756f83 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 2 Jul 2011 16:28:29 -0700 Subject: [PATCH 409/585] Add test for 64-bit shr/shl. --- modules/arch/x86/tests/Makefile.inc | 2 ++ modules/arch/x86/tests/shift64.asm | 5 +++++ modules/arch/x86/tests/shift64.hex | 16 ++++++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 modules/arch/x86/tests/shift64.asm create mode 100644 modules/arch/x86/tests/shift64.hex diff --git a/modules/arch/x86/tests/Makefile.inc b/modules/arch/x86/tests/Makefile.inc index cb2377fc..5ce31e56 100644 --- a/modules/arch/x86/tests/Makefile.inc +++ b/modules/arch/x86/tests/Makefile.inc @@ -181,6 +181,8 @@ EXTRA_DIST += modules/arch/x86/tests/segoff-err.asm EXTRA_DIST += modules/arch/x86/tests/segoff-err.errwarn EXTRA_DIST += modules/arch/x86/tests/shift.asm EXTRA_DIST += modules/arch/x86/tests/shift.hex +EXTRA_DIST += modules/arch/x86/tests/shift64.asm +EXTRA_DIST += modules/arch/x86/tests/shift64.hex EXTRA_DIST += modules/arch/x86/tests/simd-1.asm EXTRA_DIST += modules/arch/x86/tests/simd-1.hex EXTRA_DIST += modules/arch/x86/tests/simd-2.asm diff --git a/modules/arch/x86/tests/shift64.asm b/modules/arch/x86/tests/shift64.asm new file mode 100644 index 00000000..c1ce6b1c --- /dev/null +++ b/modules/arch/x86/tests/shift64.asm @@ -0,0 +1,5 @@ +[bits 64] +shl rax, 5 +shl rax, 32 +shr rax, 5 +shr rax, 32 diff --git a/modules/arch/x86/tests/shift64.hex b/modules/arch/x86/tests/shift64.hex new file mode 100644 index 00000000..ad28eb24 --- /dev/null +++ b/modules/arch/x86/tests/shift64.hex @@ -0,0 +1,16 @@ +48 +c1 +e0 +05 +48 +c1 +e0 +20 +48 +c1 +e8 +05 +48 +c1 +e8 +20 From 0614dede9bb5b285804882cf71479f4e9757ec2f Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 2 Jul 2011 17:11:10 -0700 Subject: [PATCH 410/585] x86/gas: Fix no-suffix push and pop. Previously plain "push" and "pop" would always generate a 16-bit pop (for effective address versions). Reported by: Alexei Svitkine [#212 state:resolved] --- modules/arch/x86/gen_x86_insn.py | 25 ++ modules/arch/x86/tests/gas32/Makefile.inc | 2 + modules/arch/x86/tests/gas32/gas-pop.asm | 50 +++ modules/arch/x86/tests/gas32/gas-pop.hex | 456 ++++++++++++++++++++++ 4 files changed, 533 insertions(+) create mode 100644 modules/arch/x86/tests/gas32/gas-pop.asm create mode 100644 modules/arch/x86/tests/gas32/gas-pop.hex diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index b0c26465..b48f806e 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -1132,6 +1132,10 @@ add_insn("movsxd", "movsxd", parser="nasm") # # Push instructions # +add_group("push", + def_opersize_64=64, + opcode=[0x50], + operands=[Operand(type="Reg", size="BITS", dest="Op0Add")]) add_group("push", suffix="w", opersize=16, @@ -1146,9 +1150,16 @@ add_group("push", operands=[Operand(type="Reg", size=32, dest="Op0Add")]) add_group("push", suffix="q", + only64=True, def_opersize_64=64, opcode=[0x50], operands=[Operand(type="Reg", size=64, dest="Op0Add")]) + +add_group("push", + def_opersize_64=64, + opcode=[0xFF], + spare=6, + operands=[Operand(type="RM", size="BITS", dest="EA")]) add_group("push", suffix="w", opersize=16, @@ -1165,10 +1176,12 @@ add_group("push", operands=[Operand(type="RM", size=32, dest="EA")]) add_group("push", suffix="q", + only64=True, def_opersize_64=64, opcode=[0xFF], spare=6, operands=[Operand(type="RM", size=64, dest="EA")]) + add_group("push", cpu=["186"], parsers=["nasm"], @@ -1339,6 +1352,10 @@ add_insn("pushaw", "onebyte", modifiers=[0x60, 16], cpu=["186"], not64=True) # # Pop instructions # +add_group("pop", + def_opersize_64=64, + opcode=[0x58], + operands=[Operand(type="Reg", size="BITS", dest="Op0Add")]) add_group("pop", suffix="w", opersize=16, @@ -1353,9 +1370,15 @@ add_group("pop", operands=[Operand(type="Reg", size=32, dest="Op0Add")]) add_group("pop", suffix="q", + only64=True, def_opersize_64=64, opcode=[0x58], operands=[Operand(type="Reg", size=64, dest="Op0Add")]) + +add_group("pop", + def_opersize_64=64, + opcode=[0x8F], + operands=[Operand(type="RM", size="BITS", dest="EA")]) add_group("pop", suffix="w", opersize=16, @@ -1370,9 +1393,11 @@ add_group("pop", operands=[Operand(type="RM", size=32, dest="EA")]) add_group("pop", suffix="q", + only64=True, def_opersize_64=64, opcode=[0x8F], operands=[Operand(type="RM", size=64, dest="EA")]) + # POP CS is debateably valid on the 8086, if obsolete and undocumented. # We don't include it because it's VERY unlikely it will ever be used # anywhere. If someone really wants it they can db 0x0F it. diff --git a/modules/arch/x86/tests/gas32/Makefile.inc b/modules/arch/x86/tests/gas32/Makefile.inc index 282cf75f..5fc0afbf 100644 --- a/modules/arch/x86/tests/gas32/Makefile.inc +++ b/modules/arch/x86/tests/gas32/Makefile.inc @@ -19,6 +19,8 @@ EXTRA_DIST += modules/arch/x86/tests/gas32/gas-movdq32.asm EXTRA_DIST += modules/arch/x86/tests/gas32/gas-movdq32.hex EXTRA_DIST += modules/arch/x86/tests/gas32/gas-movsd.asm EXTRA_DIST += modules/arch/x86/tests/gas32/gas-movsd.hex +EXTRA_DIST += modules/arch/x86/tests/gas32/gas-pop.asm +EXTRA_DIST += modules/arch/x86/tests/gas32/gas-pop.hex EXTRA_DIST += modules/arch/x86/tests/gas32/gas32-jmpcall.asm EXTRA_DIST += modules/arch/x86/tests/gas32/gas32-jmpcall.hex diff --git a/modules/arch/x86/tests/gas32/gas-pop.asm b/modules/arch/x86/tests/gas32/gas-pop.asm new file mode 100644 index 00000000..7c47ebef --- /dev/null +++ b/modules/arch/x86/tests/gas32/gas-pop.asm @@ -0,0 +1,50 @@ +.code64 +push %cx # out: 66 51 +pop %cx # out: 66 59 +push %rcx # out: 51 +pop %rcx # out: 59 +pushw %cx # out: 66 51 +popw %cx # out: 66 59 +pushq %rcx # out: 51 +popq %rcx # out: 59 + +push -24(%rcx) # out: ff 71 e8 +pop -24(%rcx) # out: 8f 41 e8 +pushw -24(%rcx) # out: 66 ff 71 e8 +popw -24(%rcx) # out: 66 8f 41 e8 +pushq -24(%rcx) # out: ff 71 e8 +popq -24(%rcx) # out: 8f 41 e8 + +.code32 +push %cx # out: 66 51 +pop %cx # out: 66 59 +push %ecx # out: 51 +pop %ecx # out: 59 +pushw %cx # out: 66 51 +popw %cx # out: 66 59 +pushl %ecx # out: 51 +popl %ecx # out: 59 + +push -24(%ecx) # out: ff 71 e8 +pop -24(%ecx) # out: 8f 41 e8 +pushw -24(%ecx) # out: 66 ff 71 e8 +popw -24(%ecx) # out: 66 8f 41 e8 +pushl -24(%ecx) # out: ff 71 e8 +popl -24(%ecx) # out: 8f 41 e8 + +.code16 +push %cx # out: 51 +pop %cx # out: 59 +push %ecx # out: 66 51 +pop %ecx # out: 66 59 +pushw %cx # out: 51 +popw %cx # out: 59 +pushl %ecx # out: 66 51 +popl %ecx # out: 66 59 + +push -24(%bp) # out: ff 76 e8 +pop -24(%bp) # out: 8f 46 e8 +pushw -24(%bp) # out: ff 76 e8 +popw -24(%bp) # out: 8f 46 e8 +pushl -24(%bp) # out: 66 ff 76 e8 +popl -24(%bp) # out: 66 8f 46 e8 diff --git a/modules/arch/x86/tests/gas32/gas-pop.hex b/modules/arch/x86/tests/gas32/gas-pop.hex new file mode 100644 index 00000000..30744378 --- /dev/null +++ b/modules/arch/x86/tests/gas32/gas-pop.hex @@ -0,0 +1,456 @@ +7f +45 +4c +46 +01 +01 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +03 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +34 +00 +00 +00 +00 +00 +28 +00 +05 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +66 +51 +66 +59 +51 +59 +66 +51 +66 +59 +51 +59 +ff +71 +e8 +8f +41 +e8 +66 +ff +71 +e8 +66 +8f +41 +e8 +ff +71 +e8 +8f +41 +e8 +66 +51 +66 +59 +51 +59 +66 +51 +66 +59 +51 +59 +ff +71 +e8 +8f +41 +e8 +66 +ff +71 +e8 +66 +8f +41 +e8 +ff +71 +e8 +8f +41 +e8 +51 +59 +66 +51 +66 +59 +51 +59 +66 +51 +66 +59 +ff +76 +e8 +8f +46 +e8 +ff +76 +e8 +8f +46 +e8 +66 +ff +76 +e8 +66 +8f +46 +e8 +00 +2e +74 +65 +78 +74 +00 +2e +73 +74 +72 +74 +61 +62 +00 +2e +73 +79 +6d +74 +61 +62 +00 +2e +73 +68 +73 +74 +72 +74 +61 +62 +00 +00 +00 +00 +00 +2d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +f1 +ff +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +17 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +a0 +00 +00 +00 +21 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +07 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +c4 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +0f +00 +00 +00 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +c8 +00 +00 +00 +30 +00 +00 +00 +02 +00 +00 +00 +03 +00 +00 +00 +04 +00 +00 +00 +10 +00 +00 +00 +01 +00 +00 +00 +01 +00 +00 +00 +06 +00 +00 +00 +00 +00 +00 +00 +40 +00 +00 +00 +60 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 From 47f693fd89b5d961e7097674c21263060299b10c Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 3 Jul 2011 01:48:44 -0700 Subject: [PATCH 411/585] Add Intel BMI1, BMI2, INVPCID, LZCNT instructions. Reference: http://www.intel.com/software/avx rev11 spec Also add appropriate CPU bits and directive handling for these. Currently we have no good way of handling an "or" of instruction bits (in this case needed for LZCNT, where it's either AMD or LZCNT). For now, make it LZCNT only. Contributed by: Mark Charney Part of [#227]. --- modules/arch/x86/gen_x86_insn.py | 116 ++++++++++++- modules/arch/x86/tests/Makefile.inc | 8 + modules/arch/x86/tests/bmi1.asm | 32 ++++ modules/arch/x86/tests/bmi1.hex | 193 ++++++++++++++++++++++ modules/arch/x86/tests/bmi2.asm | 40 +++++ modules/arch/x86/tests/bmi2.hex | 244 ++++++++++++++++++++++++++++ modules/arch/x86/tests/invpcid.asm | 6 + modules/arch/x86/tests/invpcid.hex | 19 +++ modules/arch/x86/tests/lzcnt.asm | 8 + modules/arch/x86/tests/lzcnt.hex | 43 +++++ modules/arch/x86/x86arch.h | 5 + modules/arch/x86/x86cpu.gperf | 10 ++ 12 files changed, 721 insertions(+), 3 deletions(-) create mode 100644 modules/arch/x86/tests/bmi1.asm create mode 100644 modules/arch/x86/tests/bmi1.hex create mode 100644 modules/arch/x86/tests/bmi2.asm create mode 100644 modules/arch/x86/tests/bmi2.hex create mode 100644 modules/arch/x86/tests/invpcid.asm create mode 100644 modules/arch/x86/tests/invpcid.hex create mode 100644 modules/arch/x86/tests/lzcnt.asm create mode 100644 modules/arch/x86/tests/lzcnt.hex diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index b48f806e..eacb0e51 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -43,7 +43,8 @@ ordered_cpu_features = [ "FPU", "Cyrix", "AMD", "MMX", "3DNow", "SMM", "SSE", "SSE2", "SSE3", "SVM", "PadLock", "SSSE3", "SSE41", "SSE42", "SSE4a", "SSE5", "AVX", "FMA", "AES", "CLMUL", "MOVBE", "XOP", "FMA4", "F16C", - "FSGSBASE", "RDRAND", "XSAVEOPT", "EPTVPID", "SMX"] + "FSGSBASE", "RDRAND", "XSAVEOPT", "EPTVPID", "SMX", "AVX2", "BMI1", + "BMI2", "INVPCID", "LZCNT"] unordered_cpu_features = ["Priv", "Prot", "Undoc", "Obs"] # Predefined VEX prefix field values @@ -6607,7 +6608,7 @@ add_group("vfma_ps", Operand(type="SIMDReg", size=256, dest="VEX"), Operand(type="SIMDRM", size=256, relaxed=True, dest="EA")]) -### 128/256b FMA PD(W=1) +### 128/256b FMA PD(W=1) add_group("vfma_pd", cpu=["FMA"], modifiers=["Op2Add"], @@ -7352,6 +7353,115 @@ for sz in (16, 32, 64): Operand(type="Reg", size=sz, dest="Spare")]) add_insn("movbe", "movbe") +##################################################################### +# Intel advanced bit manipulations (BMI1/2) +##################################################################### + +add_insn("tzcnt", "cnt", modifiers=[0xBC], cpu=["BMI1"]) +# LZCNT is present as AMD ext + +for sfx, sz in zip("wlq", [32, 64]): + add_group("vex_gpr_ndd_rm_0F38_regext", + suffix=sfx, + modifiers=["PreAdd", "Op2Add", "SpAdd" ], + opersize=sz, + prefix=0x00, + opcode=[0x0F, 0x38, 0x00], + vex=0, ## VEX.L=0 + operands=[Operand(type="Reg", size=sz, dest="VEX"), + Operand(type="RM", size=sz, relaxed=True, dest="EA")]) + + +add_insn("blsr", "vex_gpr_ndd_rm_0F38_regext", modifiers=[0x00, 0xF3, 1], + cpu=["BMI1"]) +add_insn("blsmsk", "vex_gpr_ndd_rm_0F38_regext", modifiers=[0x00, 0xF3, 2], + cpu=["BMI1"]) +add_insn("blsi", "vex_gpr_ndd_rm_0F38_regext", modifiers=[0x00, 0xF3, 3], + cpu=["BMI1"]) + +for sfx, sz in zip("wlq", [32, 64]): + add_group("vex_gpr_reg_rm_0F_imm8", + suffix=sfx, + modifiers=["PreAdd", "Op1Add", "Op2Add"], + opersize=sz, + prefix=0x00, + opcode=[0x0F, 0x00, 0x00], + vex=0, ## VEX.L=0 + operands=[Operand(type="Reg", size=sz, dest="Spare"), + Operand(type="RM", size=sz, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + +add_insn("rorx", "vex_gpr_reg_rm_0F_imm8", modifiers=[0xF2, 0x3A, 0xF0], + cpu=["BMI2"]) + +for sfx, sz in zip("lq", [32, 64]): # no 16-bit forms + add_group("vex_gpr_reg_nds_rm_0F", + suffix=sfx, + modifiers=["PreAdd", "Op1Add", "Op2Add"], + opersize=sz, + prefix=0x00, + opcode=[0x0F, 0x00, 0x00], + vex=0, + operands=[Operand(type="Reg", size=sz, dest="Spare"), + Operand(type="Reg", size=sz, dest="VEX"), + Operand(type="RM", size=sz, relaxed=True, dest="EA")]) + +add_insn("andn", "vex_gpr_reg_nds_rm_0F", modifiers=[0x00, 0x38, 0xF2], + cpu=["BMI1"]) + +add_insn("pdep", "vex_gpr_reg_nds_rm_0F", modifiers=[0xF2, 0x38, 0xF5], + cpu=["BMI2"]) +add_insn("pext", "vex_gpr_reg_nds_rm_0F", modifiers=[0xF3, 0x38, 0xF5], + cpu=["BMI2"]) + +for sfx, sz in zip("lq", [32, 64]): # no 16-bit forms + add_group("vex_gpr_reg_rm_nds_0F", + suffix=sfx, + modifiers=["PreAdd", "Op1Add", "Op2Add"], + opersize=sz, + prefix=0x00, + opcode=[0x0F, 0x00, 0x00], + vex=0, + operands=[Operand(type="Reg", size=sz, dest="Spare"), + Operand(type="RM", size=sz, relaxed=True, dest="EA"), + Operand(type="Reg", size=sz, dest="VEX")]) + +add_insn("bzhi", "vex_gpr_reg_rm_nds_0F", modifiers=[0x00, 0x38, 0xF5], + cpu=["BMI2"]) +add_insn("bextr","vex_gpr_reg_rm_nds_0F", modifiers=[0x00, 0x38, 0xF7], + cpu=["BMI1"]) +add_insn("shlx", "vex_gpr_reg_rm_nds_0F", modifiers=[0x66, 0x38, 0xF7], + cpu=["BMI2"]) +add_insn("shrx", "vex_gpr_reg_rm_nds_0F", modifiers=[0xF2, 0x38, 0xF7], + cpu=["BMI2"]) +add_insn("sarx", "vex_gpr_reg_rm_nds_0F", modifiers=[0xF3, 0x38, 0xF7], + cpu=["BMI2"]) + +add_insn("mulx", "vex_gpr_reg_nds_rm_0F", modifiers=[0xF2, 0x38, 0xF6], + cpu=["BMI2"]) + + + +##################################################################### +# Intel INVPCID instruction +##################################################################### +add_group("invpcid", + cpu=["INVPCID", "Priv"], + not64=True, + prefix=0x66, + opcode=[0x0F, 0x38, 0x82], + operands=[Operand(type="Reg", size=32, dest="Spare"), + Operand(type="Mem", size=128, relaxed=True, dest="EA")]) +add_group("invpcid", + cpu=["INVPCID", "Priv"], + only64=True, + def_opersize_64=64, + prefix=0x66, + opcode=[0x0F, 0x38, 0x82], + operands=[Operand(type="Reg", size=64, dest="Spare"), + Operand(type="Mem", size=128, relaxed=True, dest="EA")]) +add_insn("invpcid", "invpcid") + ##################################################################### # AMD 3DNow! instructions ##################################################################### @@ -7400,7 +7510,7 @@ add_insn("syscall", "twobyte", modifiers=[0x0F, 0x05], cpu=["686", "AMD"]) for sfx in [None, "l", "q"]: add_insn("sysret"+(sfx or ""), "twobyte", suffix=sfx, modifiers=[0x0F, 0x07], cpu=["686", "AMD", "Priv"]) -add_insn("lzcnt", "cnt", modifiers=[0xBD], cpu=["686", "AMD"]) +add_insn("lzcnt", "cnt", modifiers=[0xBD], cpu=["LZCNT"]) ##################################################################### # AMD x86-64 extensions diff --git a/modules/arch/x86/tests/Makefile.inc b/modules/arch/x86/tests/Makefile.inc index 5ce31e56..fab543b3 100644 --- a/modules/arch/x86/tests/Makefile.inc +++ b/modules/arch/x86/tests/Makefile.inc @@ -29,6 +29,10 @@ EXTRA_DIST += modules/arch/x86/tests/avxcc.asm EXTRA_DIST += modules/arch/x86/tests/avxcc.hex EXTRA_DIST += modules/arch/x86/tests/bittest.asm EXTRA_DIST += modules/arch/x86/tests/bittest.hex +EXTRA_DIST += modules/arch/x86/tests/bmi1.asm +EXTRA_DIST += modules/arch/x86/tests/bmi1.hex +EXTRA_DIST += modules/arch/x86/tests/bmi2.asm +EXTRA_DIST += modules/arch/x86/tests/bmi2.hex EXTRA_DIST += modules/arch/x86/tests/bswap64.asm EXTRA_DIST += modules/arch/x86/tests/bswap64.hex EXTRA_DIST += modules/arch/x86/tests/clmul.asm @@ -79,6 +83,8 @@ EXTRA_DIST += modules/arch/x86/tests/genopcode.hex EXTRA_DIST += modules/arch/x86/tests/imm64.asm EXTRA_DIST += modules/arch/x86/tests/imm64.errwarn EXTRA_DIST += modules/arch/x86/tests/imm64.hex +EXTRA_DIST += modules/arch/x86/tests/invpcid.asm +EXTRA_DIST += modules/arch/x86/tests/invpcid.hex EXTRA_DIST += modules/arch/x86/tests/iret.asm EXTRA_DIST += modules/arch/x86/tests/iret.hex EXTRA_DIST += modules/arch/x86/tests/jmp64-1.asm @@ -105,6 +111,8 @@ EXTRA_DIST += modules/arch/x86/tests/loopadsz.asm EXTRA_DIST += modules/arch/x86/tests/loopadsz.hex EXTRA_DIST += modules/arch/x86/tests/lsahf.asm EXTRA_DIST += modules/arch/x86/tests/lsahf.hex +EXTRA_DIST += modules/arch/x86/tests/lzcnt.asm +EXTRA_DIST += modules/arch/x86/tests/lzcnt.hex EXTRA_DIST += modules/arch/x86/tests/mem64-err.asm EXTRA_DIST += modules/arch/x86/tests/mem64-err.errwarn EXTRA_DIST += modules/arch/x86/tests/mem64.asm diff --git a/modules/arch/x86/tests/bmi1.asm b/modules/arch/x86/tests/bmi1.asm new file mode 100644 index 00000000..4913a4f8 --- /dev/null +++ b/modules/arch/x86/tests/bmi1.asm @@ -0,0 +1,32 @@ +[bits 64] +andn eax, ebx, ecx ; c4 e2 60 f2 c1 +andn eax, ebx, [0] ; c4 e2 60 f2 04 25 00 00 00 00 +andn rax, rbx, rcx ; c4 e2 e0 f2 c1 +andn rax, rbx, [0] ; c4 e2 e0 f2 04 25 00 00 00 00 + +bextr eax, ebx, ecx ; c4 e2 70 f7 c3 +bextr eax, [0], ecx ; c4 e2 70 f7 04 25 00 00 00 00 +bextr rax, rbx, rcx ; c4 e2 f0 f7 c3 +bextr rax, [0], rcx ; c4 e2 f0 f7 04 25 00 00 00 00 + +blsi eax, ecx ; c4 e2 78 f3 d9 +blsi eax, [0] ; c4 e2 78 f3 1c 25 00 00 00 00 +blsi rax, rcx ; c4 e2 f8 f3 d9 +blsi rax, [0] ; c4 e2 f8 f3 1c 25 00 00 00 00 + +blsmsk eax, ecx ; c4 e2 78 f3 d1 +blsmsk eax, [0] ; c4 e2 78 f3 14 25 00 00 00 00 +blsmsk rax, rcx ; c4 e2 f8 f3 d1 +blsmsk rax, [0] ; c4 e2 f8 f3 14 25 00 00 00 00 + +blsr eax, ecx ; c4 e2 78 f3 c9 +blsr eax, [0] ; c4 e2 78 f3 0c 25 00 00 00 00 +blsr rax, rcx ; c4 e2 f8 f3 c9 +blsr rax, [0] ; c4 e2 f8 f3 0c 25 00 00 00 00 + +tzcnt ax, bx ; 66 f3 0f bc c3 +tzcnt ax, [0] ; 66 f3 0f bc 04 25 00 00 00 00 +tzcnt eax, ebx ; f3 0f bc c3 +tzcnt eax, [0] ; f3 0f bc 04 25 00 00 00 00 +tzcnt rax, rbx ; f3 48 0f bc c3 +tzcnt rax, [0] ; f3 48 0f bc 04 25 00 00 00 00 diff --git a/modules/arch/x86/tests/bmi1.hex b/modules/arch/x86/tests/bmi1.hex new file mode 100644 index 00000000..fc692cde --- /dev/null +++ b/modules/arch/x86/tests/bmi1.hex @@ -0,0 +1,193 @@ +c4 +e2 +60 +f2 +c1 +c4 +e2 +60 +f2 +04 +25 +00 +00 +00 +00 +c4 +e2 +e0 +f2 +c1 +c4 +e2 +e0 +f2 +04 +25 +00 +00 +00 +00 +c4 +e2 +70 +f7 +c3 +c4 +e2 +70 +f7 +04 +25 +00 +00 +00 +00 +c4 +e2 +f0 +f7 +c3 +c4 +e2 +f0 +f7 +04 +25 +00 +00 +00 +00 +c4 +e2 +78 +f3 +d9 +c4 +e2 +78 +f3 +1c +25 +00 +00 +00 +00 +c4 +e2 +f8 +f3 +d9 +c4 +e2 +f8 +f3 +1c +25 +00 +00 +00 +00 +c4 +e2 +78 +f3 +d1 +c4 +e2 +78 +f3 +14 +25 +00 +00 +00 +00 +c4 +e2 +f8 +f3 +d1 +c4 +e2 +f8 +f3 +14 +25 +00 +00 +00 +00 +c4 +e2 +78 +f3 +c9 +c4 +e2 +78 +f3 +0c +25 +00 +00 +00 +00 +c4 +e2 +f8 +f3 +c9 +c4 +e2 +f8 +f3 +0c +25 +00 +00 +00 +00 +66 +f3 +0f +bc +c3 +66 +f3 +0f +bc +04 +25 +00 +00 +00 +00 +f3 +0f +bc +c3 +f3 +0f +bc +04 +25 +00 +00 +00 +00 +f3 +48 +0f +bc +c3 +f3 +48 +0f +bc +04 +25 +00 +00 +00 +00 diff --git a/modules/arch/x86/tests/bmi2.asm b/modules/arch/x86/tests/bmi2.asm new file mode 100644 index 00000000..d19d7f3a --- /dev/null +++ b/modules/arch/x86/tests/bmi2.asm @@ -0,0 +1,40 @@ +[bits 64] +bzhi eax, ebx, ecx ; c4 e2 70 f5 c3 +bzhi eax, [0], ecx ; c4 e2 70 f5 04 25 00 00 00 00 +bzhi rax, rbx, rcx ; c4 e2 f0 f5 c3 +bzhi rax, [0], rcx ; c4 e2 f0 f5 04 25 00 00 00 00 + +mulx eax, ebx, ecx ; c4 e2 63 f6 c1 +mulx eax, ebx, [0] ; c4 e2 63 f6 04 25 00 00 00 00 +mulx rax, rbx, rcx ; c4 e2 e3 f6 c1 +mulx rax, rbx, [0] ; c4 e2 e3 f6 04 25 00 00 00 00 + +pdep eax, ebx, ecx ; c4 e2 63 f5 c1 +pdep eax, ebx, [0] ; c4 e2 63 f5 04 25 00 00 00 00 +pdep rax, rbx, rcx ; c4 e2 e3 f5 c1 +pdep rax, rbx, [0] ; c4 e2 e3 f5 04 25 00 00 00 00 + +pext eax, ebx, ecx ; c4 e2 62 f5 c1 +pext eax, ebx, [0] ; c4 e2 62 f5 04 25 00 00 00 00 +pext rax, rbx, rcx ; c4 e2 e2 f5 c1 +pext rax, rbx, [0] ; c4 e2 e2 f5 04 25 00 00 00 00 + +rorx eax, ebx, 3 ; c4 e3 7b f0 c3 03 +rorx eax, [0], 3 ; c4 e3 7b f0 04 25 00 00 00 00 03 +rorx rax, rbx, 3 ; c4 e3 fb f0 c3 03 +rorx rax, [0], 3 ; c4 e3 fb f0 04 25 00 00 00 00 03 + +sarx eax, ebx, ecx ; c4 e2 72 f7 c3 +sarx eax, [0], ecx ; c4 e2 72 f7 04 25 00 00 00 00 +sarx rax, rbx, rcx ; c4 e2 f2 f7 c3 +sarx rax, [0], rcx ; c4 e2 f2 f7 04 25 00 00 00 00 + +shlx eax, ebx, ecx ; c4 e2 71 f7 c3 +shlx eax, [0], ecx ; c4 e2 71 f7 04 25 00 00 00 00 +shlx rax, rbx, rcx ; c4 e2 f1 f7 c3 +shlx rax, [0], rcx ; c4 e2 f1 f7 04 25 00 00 00 00 + +shrx eax, ebx, ecx ; c4 e2 73 f7 c3 +shrx eax, [0], ecx ; c4 e2 73 f7 04 25 00 00 00 00 +shrx rax, rbx, rcx ; c4 e2 f3 f7 c3 +shrx rax, [0], rcx ; c4 e2 f3 f7 04 25 00 00 00 00 diff --git a/modules/arch/x86/tests/bmi2.hex b/modules/arch/x86/tests/bmi2.hex new file mode 100644 index 00000000..c1529729 --- /dev/null +++ b/modules/arch/x86/tests/bmi2.hex @@ -0,0 +1,244 @@ +c4 +e2 +70 +f5 +c3 +c4 +e2 +70 +f5 +04 +25 +00 +00 +00 +00 +c4 +e2 +f0 +f5 +c3 +c4 +e2 +f0 +f5 +04 +25 +00 +00 +00 +00 +c4 +e2 +63 +f6 +c1 +c4 +e2 +63 +f6 +04 +25 +00 +00 +00 +00 +c4 +e2 +e3 +f6 +c1 +c4 +e2 +e3 +f6 +04 +25 +00 +00 +00 +00 +c4 +e2 +63 +f5 +c1 +c4 +e2 +63 +f5 +04 +25 +00 +00 +00 +00 +c4 +e2 +e3 +f5 +c1 +c4 +e2 +e3 +f5 +04 +25 +00 +00 +00 +00 +c4 +e2 +62 +f5 +c1 +c4 +e2 +62 +f5 +04 +25 +00 +00 +00 +00 +c4 +e2 +e2 +f5 +c1 +c4 +e2 +e2 +f5 +04 +25 +00 +00 +00 +00 +c4 +e3 +7b +f0 +c3 +03 +c4 +e3 +7b +f0 +04 +25 +00 +00 +00 +00 +03 +c4 +e3 +fb +f0 +c3 +03 +c4 +e3 +fb +f0 +04 +25 +00 +00 +00 +00 +03 +c4 +e2 +72 +f7 +c3 +c4 +e2 +72 +f7 +04 +25 +00 +00 +00 +00 +c4 +e2 +f2 +f7 +c3 +c4 +e2 +f2 +f7 +04 +25 +00 +00 +00 +00 +c4 +e2 +71 +f7 +c3 +c4 +e2 +71 +f7 +04 +25 +00 +00 +00 +00 +c4 +e2 +f1 +f7 +c3 +c4 +e2 +f1 +f7 +04 +25 +00 +00 +00 +00 +c4 +e2 +73 +f7 +c3 +c4 +e2 +73 +f7 +04 +25 +00 +00 +00 +00 +c4 +e2 +f3 +f7 +c3 +c4 +e2 +f3 +f7 +04 +25 +00 +00 +00 +00 diff --git a/modules/arch/x86/tests/invpcid.asm b/modules/arch/x86/tests/invpcid.asm new file mode 100644 index 00000000..90f517aa --- /dev/null +++ b/modules/arch/x86/tests/invpcid.asm @@ -0,0 +1,6 @@ +[bits 32] +invpcid eax, oword [0] ; 66 0f 38 82 05 00 00 00 00 + +[bits 64] +invpcid rax, oword [0] ; 66 0f 38 82 04 25 00 00 00 00 + diff --git a/modules/arch/x86/tests/invpcid.hex b/modules/arch/x86/tests/invpcid.hex new file mode 100644 index 00000000..cfc8726b --- /dev/null +++ b/modules/arch/x86/tests/invpcid.hex @@ -0,0 +1,19 @@ +66 +0f +38 +82 +05 +00 +00 +00 +00 +66 +0f +38 +82 +04 +25 +00 +00 +00 +00 diff --git a/modules/arch/x86/tests/lzcnt.asm b/modules/arch/x86/tests/lzcnt.asm new file mode 100644 index 00000000..4e545dfa --- /dev/null +++ b/modules/arch/x86/tests/lzcnt.asm @@ -0,0 +1,8 @@ +[bits 64] + +lzcnt ax, bx ; 66 f3 0f bd c3 +lzcnt ax, [0] ; 66 f3 0f bd 04 25 00 00 00 00 +lzcnt eax, ebx ; f3 0f bd c3 +lzcnt eax, [0] ; f3 0f bd 04 25 00 00 00 00 +lzcnt rax, rbx ; f3 48 0f bd c3 +lzcnt rax, [0] ; f3 48 0f bd 04 25 00 00 00 00 diff --git a/modules/arch/x86/tests/lzcnt.hex b/modules/arch/x86/tests/lzcnt.hex new file mode 100644 index 00000000..ed14eb0e --- /dev/null +++ b/modules/arch/x86/tests/lzcnt.hex @@ -0,0 +1,43 @@ +66 +f3 +0f +bd +c3 +66 +f3 +0f +bd +04 +25 +00 +00 +00 +00 +f3 +0f +bd +c3 +f3 +0f +bd +04 +25 +00 +00 +00 +00 +f3 +48 +0f +bd +c3 +f3 +48 +0f +bd +04 +25 +00 +00 +00 +00 diff --git a/modules/arch/x86/x86arch.h b/modules/arch/x86/x86arch.h index d1ba2325..8e7caf82 100644 --- a/modules/arch/x86/x86arch.h +++ b/modules/arch/x86/x86arch.h @@ -78,6 +78,11 @@ #define CPU_XSAVEOPT 44 /* Intel XSAVEOPT instruction */ #define CPU_EPTVPID 45 /* Intel INVEPT, INVVPID instructions */ #define CPU_SMX 46 /* Intel SMX instruction (GETSEC) */ +#define CPU_AVX2 47 /* Intel AVX2 instructions */ +#define CPU_BMI1 48 /* Intel BMI1 instructions */ +#define CPU_BMI2 49 /* Intel BMI2 instructions */ +#define CPU_INVPCID 50 /* Intel INVPCID instruction */ +#define CPU_LZCNT 51 /* Intel LZCNT instruction */ enum x86_parser_type { X86_PARSER_NASM = 0, diff --git a/modules/arch/x86/x86cpu.gperf b/modules/arch/x86/x86cpu.gperf index e83be09a..8939d636 100644 --- a/modules/arch/x86/x86cpu.gperf +++ b/modules/arch/x86/x86cpu.gperf @@ -389,6 +389,16 @@ eptvpid, x86_cpu_set, CPU_EPTVPID noeptvpid, x86_cpu_clear, CPU_EPTVPID smx, x86_cpu_set, CPU_SMX nosmx, x86_cpu_clear, CPU_SMX +avx2, x86_cpu_set, CPU_AVX2 +noavx2, x86_cpu_clear, CPU_AVX2 +bmi1, x86_cpu_set, CPU_BMI1 +nobmi1, x86_cpu_clear, CPU_BMI1 +bmi2, x86_cpu_set, CPU_BMI2 +nobmi2, x86_cpu_clear, CPU_BMI2 +invpcid, x86_cpu_set, CPU_INVPCID +noinvpcid, x86_cpu_clear, CPU_INVPCID +lzcnt, x86_cpu_set, CPU_LZCNT +nolzcnt, x86_cpu_clear, CPU_LZCNT # Change NOP patterns basicnop, x86_nop, X86_NOP_BASIC intelnop, x86_nop, X86_NOP_INTEL From fc7724a3df1dd3b65317f66547573939a1f269e6 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 3 Jul 2011 12:48:46 -0700 Subject: [PATCH 412/585] pmovmskb/vpmovmskb: default operand size is 64 bits. --- modules/arch/x86/gen_x86_insn.py | 2 ++ modules/arch/x86/tests/avx.hex | 4 +--- modules/arch/x86/tests/gas64/gas-moreinsn.hex | 16 ++++++++-------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index eacb0e51..ded19ea5 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -4995,6 +4995,7 @@ add_group("pmovmskb", cpu=["MMX", "P3"], notavx=True, opersize=64, + def_opersize_64=64, opcode=[0x0F, 0xD7], operands=[Operand(type="Reg", size=64, dest="Spare"), Operand(type="SIMDReg", size=64, dest="EA")]) @@ -5003,6 +5004,7 @@ add_group("pmovmskb", cpu=["SSE2"], modifiers=["SetVEX"], opersize=64, + def_opersize_64=64, prefix=0x66, opcode=[0x0F, 0xD7], operands=[Operand(type="Reg", size=64, dest="Spare"), diff --git a/modules/arch/x86/tests/avx.hex b/modules/arch/x86/tests/avx.hex index 4bc11def..57eb96f5 100644 --- a/modules/arch/x86/tests/avx.hex +++ b/modules/arch/x86/tests/avx.hex @@ -6876,7 +6876,6 @@ e2 d7 c1 66 -48 0f d7 c1 @@ -6884,8 +6883,7 @@ c5 f9 d7 c1 -c4 -e1 +c5 f9 d7 c1 diff --git a/modules/arch/x86/tests/gas64/gas-moreinsn.hex b/modules/arch/x86/tests/gas64/gas-moreinsn.hex index 2380a1fd..fa76e393 100644 --- a/modules/arch/x86/tests/gas64/gas-moreinsn.hex +++ b/modules/arch/x86/tests/gas64/gas-moreinsn.hex @@ -225,7 +225,6 @@ c8 0f d7 c0 -48 0f d7 c0 @@ -234,7 +233,6 @@ c0 d7 c0 66 -48 0f d7 c0 @@ -285,8 +283,6 @@ df 00 00 00 -00 -00 2e 74 65 @@ -462,6 +458,10 @@ ff 00 00 00 +00 +00 +00 +00 17 00 00 @@ -486,7 +486,7 @@ ff 00 00 00 -20 +1c 01 00 00 @@ -550,7 +550,7 @@ ff 00 00 00 -44 +40 01 00 00 @@ -614,7 +614,7 @@ ff 00 00 00 -48 +44 01 00 00 @@ -686,7 +686,7 @@ ff 00 00 00 -de +dc 00 00 00 From d779fcb04e7b47b6054483a498ec3ad77428bb24 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 3 Jul 2011 14:36:37 -0700 Subject: [PATCH 413/585] Add most Intel AVX2 instructions. Reference: http://www.intel.com/software/avx rev11 spec This is all AVX2 instructions except for VGATHER*/VPGATHER*, which require additional ModRM handling. Portions contributed by: Mark Charney Part of [#227]. --- modules/arch/x86/gen_x86_insn.py | 679 +++++++-- modules/arch/x86/tests/Makefile.inc | 2 + modules/arch/x86/tests/avx2.asm | 612 ++++++++ modules/arch/x86/tests/avx2.hex | 2105 +++++++++++++++++++++++++++ 4 files changed, 3280 insertions(+), 118 deletions(-) create mode 100644 modules/arch/x86/tests/avx2.asm create mode 100644 modules/arch/x86/tests/avx2.hex diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index ded19ea5..5dec9e81 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -3997,44 +3997,44 @@ add_insn("punpckldq", "mmxsse2", modifiers=[0x62]) add_insn("pxor", "mmxsse2", modifiers=[0xEF]) # AVX versions don't support the MMX registers -add_insn("vpackssdw", "xmm_xmm128", modifiers=[0x66, 0x6B, VEXL0], avx=True) -add_insn("vpacksswb", "xmm_xmm128", modifiers=[0x66, 0x63, VEXL0], avx=True) -add_insn("vpackuswb", "xmm_xmm128", modifiers=[0x66, 0x67, VEXL0], avx=True) -add_insn("vpaddb", "xmm_xmm128", modifiers=[0x66, 0xFC, VEXL0], avx=True) -add_insn("vpaddw", "xmm_xmm128", modifiers=[0x66, 0xFD, VEXL0], avx=True) -add_insn("vpaddd", "xmm_xmm128", modifiers=[0x66, 0xFE, VEXL0], avx=True) -add_insn("vpaddq", "xmm_xmm128", modifiers=[0x66, 0xD4, VEXL0], avx=True) -add_insn("vpaddsb", "xmm_xmm128", modifiers=[0x66, 0xEC, VEXL0], avx=True) -add_insn("vpaddsw", "xmm_xmm128", modifiers=[0x66, 0xED, VEXL0], avx=True) -add_insn("vpaddusb", "xmm_xmm128", modifiers=[0x66, 0xDC, VEXL0], avx=True) -add_insn("vpaddusw", "xmm_xmm128", modifiers=[0x66, 0xDD, VEXL0], avx=True) -add_insn("vpand", "xmm_xmm128", modifiers=[0x66, 0xDB, VEXL0], avx=True) -add_insn("vpandn", "xmm_xmm128", modifiers=[0x66, 0xDF, VEXL0], avx=True) -add_insn("vpcmpeqb", "xmm_xmm128", modifiers=[0x66, 0x74, VEXL0], avx=True) -add_insn("vpcmpeqw", "xmm_xmm128", modifiers=[0x66, 0x75, VEXL0], avx=True) -add_insn("vpcmpeqd", "xmm_xmm128", modifiers=[0x66, 0x76, VEXL0], avx=True) -add_insn("vpcmpgtb", "xmm_xmm128", modifiers=[0x66, 0x64, VEXL0], avx=True) -add_insn("vpcmpgtw", "xmm_xmm128", modifiers=[0x66, 0x65, VEXL0], avx=True) -add_insn("vpcmpgtd", "xmm_xmm128", modifiers=[0x66, 0x66, VEXL0], avx=True) -add_insn("vpmaddwd", "xmm_xmm128", modifiers=[0x66, 0xF5, VEXL0], avx=True) -add_insn("vpmulhw", "xmm_xmm128", modifiers=[0x66, 0xE5, VEXL0], avx=True) -add_insn("vpmullw", "xmm_xmm128", modifiers=[0x66, 0xD5, VEXL0], avx=True) -add_insn("vpor", "xmm_xmm128", modifiers=[0x66, 0xEB, VEXL0], avx=True) -add_insn("vpsubb", "xmm_xmm128", modifiers=[0x66, 0xF8, VEXL0], avx=True) -add_insn("vpsubw", "xmm_xmm128", modifiers=[0x66, 0xF9, VEXL0], avx=True) -add_insn("vpsubd", "xmm_xmm128", modifiers=[0x66, 0xFA, VEXL0], avx=True) -add_insn("vpsubq", "xmm_xmm128", modifiers=[0x66, 0xFB, VEXL0], avx=True) -add_insn("vpsubsb", "xmm_xmm128", modifiers=[0x66, 0xE8, VEXL0], avx=True) -add_insn("vpsubsw", "xmm_xmm128", modifiers=[0x66, 0xE9, VEXL0], avx=True) -add_insn("vpsubusb", "xmm_xmm128", modifiers=[0x66, 0xD8, VEXL0], avx=True) -add_insn("vpsubusw", "xmm_xmm128", modifiers=[0x66, 0xD9, VEXL0], avx=True) -add_insn("vpunpckhbw", "xmm_xmm128", modifiers=[0x66, 0x68, VEXL0], avx=True) -add_insn("vpunpckhwd", "xmm_xmm128", modifiers=[0x66, 0x69, VEXL0], avx=True) -add_insn("vpunpckhdq", "xmm_xmm128", modifiers=[0x66, 0x6A, VEXL0], avx=True) -add_insn("vpunpcklbw", "xmm_xmm128", modifiers=[0x66, 0x60, VEXL0], avx=True) -add_insn("vpunpcklwd", "xmm_xmm128", modifiers=[0x66, 0x61, VEXL0], avx=True) -add_insn("vpunpckldq", "xmm_xmm128", modifiers=[0x66, 0x62, VEXL0], avx=True) -add_insn("vpxor", "xmm_xmm128", modifiers=[0x66, 0xEF, VEXL0], avx=True) +add_insn("vpackssdw", "xmm_xmm128_256avx2", modifiers=[0x66, 0x6B, VEXL0], avx=True) +add_insn("vpacksswb", "xmm_xmm128_256avx2", modifiers=[0x66, 0x63, VEXL0], avx=True) +add_insn("vpackuswb", "xmm_xmm128_256avx2", modifiers=[0x66, 0x67, VEXL0], avx=True) +add_insn("vpaddb", "xmm_xmm128_256avx2", modifiers=[0x66, 0xFC, VEXL0], avx=True) +add_insn("vpaddw", "xmm_xmm128_256avx2", modifiers=[0x66, 0xFD, VEXL0], avx=True) +add_insn("vpaddd", "xmm_xmm128_256avx2", modifiers=[0x66, 0xFE, VEXL0], avx=True) +add_insn("vpaddq", "xmm_xmm128_256avx2", modifiers=[0x66, 0xD4, VEXL0], avx=True) +add_insn("vpaddsb", "xmm_xmm128_256avx2", modifiers=[0x66, 0xEC, VEXL0], avx=True) +add_insn("vpaddsw", "xmm_xmm128_256avx2", modifiers=[0x66, 0xED, VEXL0], avx=True) +add_insn("vpaddusb", "xmm_xmm128_256avx2", modifiers=[0x66, 0xDC, VEXL0], avx=True) +add_insn("vpaddusw", "xmm_xmm128_256avx2", modifiers=[0x66, 0xDD, VEXL0], avx=True) +add_insn("vpand", "xmm_xmm128_256avx2", modifiers=[0x66, 0xDB, VEXL0], avx=True) +add_insn("vpandn", "xmm_xmm128_256avx2", modifiers=[0x66, 0xDF, VEXL0], avx=True) +add_insn("vpcmpeqb", "xmm_xmm128_256avx2", modifiers=[0x66, 0x74, VEXL0], avx=True) +add_insn("vpcmpeqw", "xmm_xmm128_256avx2", modifiers=[0x66, 0x75, VEXL0], avx=True) +add_insn("vpcmpeqd", "xmm_xmm128_256avx2", modifiers=[0x66, 0x76, VEXL0], avx=True) +add_insn("vpcmpgtb", "xmm_xmm128_256avx2", modifiers=[0x66, 0x64, VEXL0], avx=True) +add_insn("vpcmpgtw", "xmm_xmm128_256avx2", modifiers=[0x66, 0x65, VEXL0], avx=True) +add_insn("vpcmpgtd", "xmm_xmm128_256avx2", modifiers=[0x66, 0x66, VEXL0], avx=True) +add_insn("vpmaddwd", "xmm_xmm128_256avx2", modifiers=[0x66, 0xF5, VEXL0], avx=True) +add_insn("vpmulhw", "xmm_xmm128_256avx2", modifiers=[0x66, 0xE5, VEXL0], avx=True) +add_insn("vpmullw", "xmm_xmm128_256avx2", modifiers=[0x66, 0xD5, VEXL0], avx=True) +add_insn("vpor", "xmm_xmm128_256avx2", modifiers=[0x66, 0xEB, VEXL0], avx=True) +add_insn("vpsubb", "xmm_xmm128_256avx2", modifiers=[0x66, 0xF8, VEXL0], avx=True) +add_insn("vpsubw", "xmm_xmm128_256avx2", modifiers=[0x66, 0xF9, VEXL0], avx=True) +add_insn("vpsubd", "xmm_xmm128_256avx2", modifiers=[0x66, 0xFA, VEXL0], avx=True) +add_insn("vpsubq", "xmm_xmm128_256avx2", modifiers=[0x66, 0xFB, VEXL0], avx=True) +add_insn("vpsubsb", "xmm_xmm128_256avx2", modifiers=[0x66, 0xE8, VEXL0], avx=True) +add_insn("vpsubsw", "xmm_xmm128_256avx2", modifiers=[0x66, 0xE9, VEXL0], avx=True) +add_insn("vpsubusb", "xmm_xmm128_256avx2", modifiers=[0x66, 0xD8, VEXL0], avx=True) +add_insn("vpsubusw", "xmm_xmm128_256avx2", modifiers=[0x66, 0xD9, VEXL0], avx=True) +add_insn("vpunpckhbw", "xmm_xmm128_256avx2", modifiers=[0x66, 0x68, VEXL0], avx=True) +add_insn("vpunpckhwd", "xmm_xmm128_256avx2", modifiers=[0x66, 0x69, VEXL0], avx=True) +add_insn("vpunpckhdq", "xmm_xmm128_256avx2", modifiers=[0x66, 0x6A, VEXL0], avx=True) +add_insn("vpunpcklbw", "xmm_xmm128_256avx2", modifiers=[0x66, 0x60, VEXL0], avx=True) +add_insn("vpunpcklwd", "xmm_xmm128_256avx2", modifiers=[0x66, 0x61, VEXL0], avx=True) +add_insn("vpunpckldq", "xmm_xmm128_256avx2", modifiers=[0x66, 0x62, VEXL0], avx=True) +add_insn("vpxor", "xmm_xmm128_256avx2", modifiers=[0x66, 0xEF, VEXL0], avx=True) add_group("pshift", cpu=["MMX"], @@ -4075,42 +4075,43 @@ add_insn("psrld", "pshift", modifiers=[0xD2, 0x72, 2]) add_insn("psrlq", "pshift", modifiers=[0xD3, 0x73, 2]) # Ran out of modifiers, so AVX has to be separate -add_group("vpshift", - cpu=["AVX"], - modifiers=["Op1Add"], - vex=128, - prefix=0x66, - opcode=[0x0F, 0x00], - operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), - Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) -add_group("vpshift", - cpu=["AVX"], - modifiers=["Gap", "Op1Add", "SpAdd"], - vex=128, - prefix=0x66, - opcode=[0x0F, 0x00], - spare=0, - operands=[Operand(type="SIMDReg", size=128, dest="EAVEX"), - Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) -add_group("vpshift", - cpu=["AVX"], - modifiers=["Op1Add"], - vex=128, - prefix=0x66, - opcode=[0x0F, 0x00], - operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDReg", size=128, dest="VEX"), - Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) -add_group("vpshift", - cpu=["AVX"], - modifiers=["Gap", "Op1Add", "SpAdd"], - vex=128, - prefix=0x66, - opcode=[0x0F, 0x00], - spare=0, - operands=[Operand(type="SIMDReg", size=128, dest="VEX"), - Operand(type="SIMDReg", size=128, dest="EA"), - Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +for cpu, sz in zip(["AVX", "AVX2"], [128, 256]): + add_group("vpshift", + cpu=[cpu], + modifiers=["Op1Add"], + vex=sz, + prefix=0x66, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=sz, dest="SpareVEX"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) + add_group("vpshift", + cpu=[cpu], + modifiers=["Gap", "Op1Add", "SpAdd"], + vex=sz, + prefix=0x66, + opcode=[0x0F, 0x00], + spare=0, + operands=[Operand(type="SIMDReg", size=sz, dest="EAVEX"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + add_group("vpshift", + cpu=[cpu], + modifiers=["Op1Add"], + vex=sz, + prefix=0x66, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=sz, dest="Spare"), + Operand(type="SIMDReg", size=sz, dest="VEX"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) + add_group("vpshift", + cpu=[cpu], + modifiers=["Gap", "Op1Add", "SpAdd"], + vex=sz, + prefix=0x66, + opcode=[0x0F, 0x00], + spare=0, + operands=[Operand(type="SIMDReg", size=sz, dest="VEX"), + Operand(type="SIMDReg", size=sz, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) add_insn("vpsllw", "vpshift", modifiers=[0xF1, 0x71, 6]) add_insn("vpslld", "vpshift", modifiers=[0xF2, 0x72, 6]) @@ -4134,14 +4135,14 @@ add_insn("pmulhuw", "mmxsse2", modifiers=[0xE4], cpu=["P3", "MMX"]) add_insn("psadbw", "mmxsse2", modifiers=[0xF6], cpu=["P3", "MMX"]) # AVX versions don't support MMX register -add_insn("vpavgb", "xmm_xmm128", modifiers=[0x66, 0xE0, VEXL0], avx=True) -add_insn("vpavgw", "xmm_xmm128", modifiers=[0x66, 0xE3, VEXL0], avx=True) -add_insn("vpmaxsw", "xmm_xmm128", modifiers=[0x66, 0xEE, VEXL0], avx=True) -add_insn("vpmaxub", "xmm_xmm128", modifiers=[0x66, 0xDE, VEXL0], avx=True) -add_insn("vpminsw", "xmm_xmm128", modifiers=[0x66, 0xEA, VEXL0], avx=True) -add_insn("vpminub", "xmm_xmm128", modifiers=[0x66, 0xDA, VEXL0], avx=True) -add_insn("vpmulhuw", "xmm_xmm128", modifiers=[0x66, 0xE4, VEXL0], avx=True) -add_insn("vpsadbw", "xmm_xmm128", modifiers=[0x66, 0xF6, VEXL0], avx=True) +add_insn("vpavgb", "xmm_xmm128_256avx2", modifiers=[0x66, 0xE0, VEXL0], avx=True) +add_insn("vpavgw", "xmm_xmm128_256avx2", modifiers=[0x66, 0xE3, VEXL0], avx=True) +add_insn("vpmaxsw", "xmm_xmm128_256avx2", modifiers=[0x66, 0xEE, VEXL0], avx=True) +add_insn("vpmaxub", "xmm_xmm128_256avx2", modifiers=[0x66, 0xDE, VEXL0], avx=True) +add_insn("vpminsw", "xmm_xmm128_256avx2", modifiers=[0x66, 0xEA, VEXL0], avx=True) +add_insn("vpminub", "xmm_xmm128_256avx2", modifiers=[0x66, 0xDA, VEXL0], avx=True) +add_insn("vpmulhuw", "xmm_xmm128_256avx2", modifiers=[0x66, 0xE4, VEXL0], avx=True) +add_insn("vpsadbw", "xmm_xmm128_256avx2", modifiers=[0x66, 0xF6, VEXL0], avx=True) add_insn("prefetchnta", "twobytemem", modifiers=[0, 0x0F, 0x18], cpu=["P3"]) add_insn("prefetcht0", "twobytemem", modifiers=[1, 0x0F, 0x18], cpu=["P3"]) @@ -4172,6 +4173,49 @@ add_group("xmm_xmm128_256", vex=256, prefix=0x00, opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=256, dest="SpareVEX"), + Operand(type="SIMDRM", size=256, relaxed=True, dest="EA")]) +add_group("xmm_xmm128_256", + cpu=["AVX"], + modifiers=["PreAdd", "Op1Add"], + vex=256, + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="SIMDReg", size=256, dest="VEX"), + Operand(type="SIMDRM", size=256, relaxed=True, dest="EA")]) + +# Same as above, except 256-bit version only available in AVX2 +add_group("xmm_xmm128_256avx2", + cpu=["SSE"], + modifiers=["PreAdd", "Op1Add", "SetVEX"], + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) +add_group("xmm_xmm128_256avx2", + cpu=["AVX"], + modifiers=["PreAdd", "Op1Add"], + vex=128, + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) +add_group("xmm_xmm128_256avx2", + cpu=["AVX2"], + modifiers=["PreAdd", "Op1Add"], + vex=256, + prefix=0x00, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=256, dest="SpareVEX"), + Operand(type="SIMDRM", size=256, relaxed=True, dest="EA")]) +add_group("xmm_xmm128_256avx2", + cpu=["AVX2"], + modifiers=["PreAdd", "Op1Add"], + vex=256, + prefix=0x00, + opcode=[0x0F, 0x00], operands=[Operand(type="SIMDReg", size=256, dest="Spare"), Operand(type="SIMDReg", size=256, dest="VEX"), Operand(type="SIMDRM", size=256, relaxed=True, dest="EA")]) @@ -4526,6 +4570,23 @@ add_group("xmm_xmm128_imm", add_insn("cmpps", "xmm_xmm128_imm", modifiers=[0, 0xC2]) add_insn("shufps", "xmm_xmm128_imm", modifiers=[0, 0xC6]) +# YMM register AVX2 version of above +add_group("xmm_xmm128_imm_256avx2", + cpu=["SSE"], + modifiers=["PreAdd", "Op1Add", "SetVEX"], + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("xmm_xmm128_imm_256avx2", + cpu=["AVX2"], + modifiers=["PreAdd", "Op1Add"], + vex=256, + opcode=[0x0F, 0x00], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="SIMDRM", size=256, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + # YMM register and 4-operand version of above add_group("xmm_xmm128_imm_256", cpu=["SSE"], @@ -4990,6 +5051,14 @@ add_group("pmovmskb", opcode=[0x0F, 0xD7], operands=[Operand(type="Reg", size=32, dest="Spare"), Operand(type="SIMDReg", size=128, dest="EA")]) +add_group("pmovmskb", + suffix="l", + cpu=["AVX2"], + vex=256, + prefix=0x66, + opcode=[0x0F, 0xD7], + operands=[Operand(type="Reg", size=32, dest="Spare"), + Operand(type="SIMDReg", size=256, dest="EA")]) add_group("pmovmskb", suffix="q", cpu=["MMX", "P3"], @@ -5009,6 +5078,16 @@ add_group("pmovmskb", opcode=[0x0F, 0xD7], operands=[Operand(type="Reg", size=64, dest="Spare"), Operand(type="SIMDReg", size=128, dest="EA")]) +add_group("pmovmskb", + suffix="q", + cpu=["SSE2"], + vex=256, + opersize=64, + def_opersize_64=64, + prefix=0x66, + opcode=[0x0F, 0xD7], + operands=[Operand(type="Reg", size=64, dest="Spare"), + Operand(type="SIMDReg", size=256, dest="EA")]) add_insn("pmovmskb", "pmovmskb") add_insn("vpmovmskb", "pmovmskb", modifiers=[VEXL0], avx=True) @@ -5419,12 +5498,12 @@ add_insn("punpcklqdq", "xmm_xmm128", modifiers=[0x66, 0x6C], cpu=["SSE2"]) add_insn("vcvttsd2si", "cvt_rx_xmm64", modifiers=[0xF2, 0x2C, VEXL0], avx=True) # vcvttpd2dq takes xmm, ymm combination # vcvttps2dq is two-operand -add_insn("vpmuludq", "xmm_xmm128", modifiers=[0x66, 0xF4, VEXL0], avx=True) -add_insn("vpshufd", "xmm_xmm128_imm", modifiers=[0x66, 0x70, VEXL0], avx=True) -add_insn("vpshufhw", "xmm_xmm128_imm", modifiers=[0xF3, 0x70, VEXL0], avx=True) -add_insn("vpshuflw", "xmm_xmm128_imm", modifiers=[0xF2, 0x70, VEXL0], avx=True) -add_insn("vpunpckhqdq", "xmm_xmm128", modifiers=[0x66, 0x6D, VEXL0], avx=True) -add_insn("vpunpcklqdq", "xmm_xmm128", modifiers=[0x66, 0x6C, VEXL0], avx=True) +add_insn("vpmuludq", "xmm_xmm128_256avx2", modifiers=[0x66, 0xF4, VEXL0], avx=True) +add_insn("vpshufd", "xmm_xmm128_imm_256avx2", modifiers=[0x66, 0x70, VEXL0], avx=True) +add_insn("vpshufhw", "xmm_xmm128_imm_256avx2", modifiers=[0xF3, 0x70, VEXL0], avx=True) +add_insn("vpshuflw", "xmm_xmm128_imm_256avx2", modifiers=[0xF2, 0x70, VEXL0], avx=True) +add_insn("vpunpckhqdq", "xmm_xmm128_256avx2", modifiers=[0x66, 0x6D, VEXL0], avx=True) +add_insn("vpunpcklqdq", "xmm_xmm128_256avx2", modifiers=[0x66, 0x6C, VEXL0], avx=True) add_insn("cvtss2sd", "xmm_xmm32", modifiers=[0xF3, 0x5A], cpu=["SSE2"]) add_insn("vcvtss2sd", "xmm_xmm32", modifiers=[0xF3, 0x5A, VEXL0], avx=True) @@ -5480,6 +5559,25 @@ add_group("pslrldq", operands=[Operand(type="SIMDReg", size=128, dest="VEX"), Operand(type="SIMDReg", size=128, dest="EA"), Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("pslrldq", + cpu=["AVX2"], + modifiers=["SpAdd"], + vex=256, + prefix=0x66, + opcode=[0x0F, 0x73], + spare=0, + operands=[Operand(type="SIMDReg", size=256, dest="EAVEX"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("pslrldq", + cpu=["AVX2"], + modifiers=["SpAdd"], + vex=256, + prefix=0x66, + opcode=[0x0F, 0x73], + spare=0, + operands=[Operand(type="SIMDReg", size=256, dest="VEX"), + Operand(type="SIMDReg", size=256, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) add_insn("pslldq", "pslrldq", modifiers=[7]) add_insn("psrldq", "pslrldq", modifiers=[3]) @@ -5556,6 +5654,23 @@ add_group("ssse3", operands=[Operand(type="SIMDReg", size=128, dest="Spare"), Operand(type="SIMDReg", size=128, dest="VEX"), Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) +add_group("ssse3", + cpu=["AVX2"], + modifiers=["Op2Add"], + vex=256, + prefix=0x66, + opcode=[0x0F, 0x38, 0x00], + operands=[Operand(type="SIMDReg", size=256, dest="SpareVEX"), + Operand(type="SIMDRM", size=256, relaxed=True, dest="EA")]) +add_group("ssse3", + cpu=["AVX2"], + modifiers=["Op2Add"], + vex=256, + prefix=0x66, + opcode=[0x0F, 0x38, 0x00], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="SIMDReg", size=256, dest="VEX"), + Operand(type="SIMDRM", size=256, relaxed=True, dest="EA")]) add_insn("pshufb", "ssse3", modifiers=[0x00]) add_insn("phaddw", "ssse3", modifiers=[0x01]) @@ -5604,7 +5719,7 @@ add_group("ssse3imm", Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) add_insn("palignr", "ssse3imm", modifiers=[0x0F]) -add_insn("vpalignr", "sse4imm", modifiers=[0x0F, VEXL0], avx=True) +add_insn("vpalignr", "sse4imm_256avx2", modifiers=[0x0F, VEXL0], avx=True) ##################################################################### # SSE4.1 / SSE4.2 instructions @@ -5684,6 +5799,54 @@ add_group("sse4imm_256", vex=256, prefix=0x66, opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=256, dest="SpareVEX"), + Operand(type="SIMDRM", size=256, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("sse4imm_256", + cpu=["AVX"], + modifiers=["Op2Add"], + vex=256, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="SIMDReg", size=256, dest="VEX"), + Operand(type="SIMDRM", size=256, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + +# Same as above except AVX2 required for 256-bit. +add_group("sse4imm_256avx2", + cpu=["SSE41"], + modifiers=["Op2Add", "SetVEX"], + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="SpareVEX"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("sse4imm_256avx2", + cpu=["AVX"], + modifiers=["Op2Add"], + vex=128, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="VEX"), + Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("sse4imm_256avx2", + cpu=["AVX2"], + modifiers=["Op2Add"], + vex=256, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=256, dest="SpareVEX"), + Operand(type="SIMDRM", size=256, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_group("sse4imm_256avx2", + cpu=["AVX2"], + modifiers=["Op2Add"], + vex=256, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], operands=[Operand(type="SIMDReg", size=256, dest="Spare"), Operand(type="SIMDReg", size=256, dest="VEX"), Operand(type="SIMDRM", size=256, relaxed=True, dest="EA"), @@ -5758,13 +5921,14 @@ add_insn("roundps", "sse4imm", modifiers=[0x08]) add_insn("roundsd", "sse4m64imm", modifiers=[0x0B]) add_insn("roundss", "sse4m32imm", modifiers=[0x0A]) -# vdppd, vmpsadbw, and vpblendw do not allow YMM registers +# vdppd does not allow YMM registers +# vmpsadbw and vpblendw do not allow YMM registers unless AVX2 add_insn("vblendpd", "sse4imm_256", modifiers=[0x0D, VEXL0], avx=True) add_insn("vblendps", "sse4imm_256", modifiers=[0x0C, VEXL0], avx=True) add_insn("vdppd", "sse4imm", modifiers=[0x41, VEXL0], avx=True) add_insn("vdpps", "sse4imm_256", modifiers=[0x40, VEXL0], avx=True) -add_insn("vmpsadbw", "sse4imm", modifiers=[0x42, VEXL0], avx=True) -add_insn("vpblendw", "sse4imm", modifiers=[0x0E, VEXL0], avx=True) +add_insn("vmpsadbw", "sse4imm_256avx2", modifiers=[0x42, VEXL0], avx=True) +add_insn("vpblendw", "sse4imm_256avx2", modifiers=[0x0E, VEXL0], avx=True) # vroundpd and vroundps don't add another register operand add_insn("vroundsd", "sse4m64imm", modifiers=[0x0B, VEXL0], avx=True) add_insn("vroundss", "sse4m32imm", modifiers=[0x0A, VEXL0], avx=True) @@ -5814,9 +5978,9 @@ add_group("avx_sse4xmm0", add_insn("vblendvpd", "avx_sse4xmm0", modifiers=[0x4B]) add_insn("vblendvps", "avx_sse4xmm0", modifiers=[0x4A]) -# vpblendvb doesn't have a 256-bit form -add_group("avx_sse4xmm0_128", - cpu=["AVX"], +# vpblendvb didn't have a 256-bit form until AVX2 +add_group("avx2_sse4xmm0", + cpu=["AVX2"], modifiers=["Op2Add"], vex=128, prefix=0x66, @@ -5825,8 +5989,18 @@ add_group("avx_sse4xmm0_128", Operand(type="SIMDReg", size=128, dest="VEX"), Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), Operand(type="SIMDReg", size=128, dest="VEXImmSrc")]) +add_group("avx2_sse4xmm0", + cpu=["AVX2"], + modifiers=["Op2Add"], + vex=256, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="SIMDReg", size=256, dest="VEX"), + Operand(type="SIMDRM", size=256, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=256, dest="VEXImmSrc")]) -add_insn("vpblendvb", "avx_sse4xmm0_128", modifiers=[0x4C]) +add_insn("vpblendvb", "avx2_sse4xmm0", modifiers=[0x4C]) for sfx, sz in zip("bwl", [8, 16, 32]): add_group("crc32", @@ -5915,6 +6089,13 @@ add_group("movntdqa", opcode=[0x0F, 0x38, 0x2A], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), Operand(type="Mem", size=128, relaxed=True, dest="EA")]) +add_group("movntdqa", + cpu=["AVX2"], + vex=256, + prefix=0x66, + opcode=[0x0F, 0x38, 0x2A], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="Mem", size=256, relaxed=True, dest="EA")]) add_insn("movntdqa", "movntdqa") add_insn("vmovntdqa", "movntdqa", modifiers=[VEXL0], avx=True) @@ -6089,6 +6270,22 @@ for sz in [16, 32, 64]: opcode=[0x0F, 0x38, 0x00], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), Operand(type="SIMDReg", size=128, dest="EA")]) + add_group("sse4m%d" % sz, + cpu=["AVX2"], + modifiers=["Op2Add"], + vex=256, + prefix=0x66, + opcode=[0x0F, 0x38, 0x00], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="Mem", size=sz*2, relaxed=True, dest="EA")]) + add_group("sse4m%d" % sz, + cpu=["AVX2"], + modifiers=["Op2Add"], + vex=256, + prefix=0x66, + opcode=[0x0F, 0x38, 0x00], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA")]) add_insn("pmovsxbw", "sse4m64", modifiers=[0x20]) add_insn("pmovsxwd", "sse4m64", modifiers=[0x23]) @@ -6365,12 +6562,22 @@ add_group("avx_ssse3_2op", opcode=[0x0F, 0x38, 0x00], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) - -add_insn("vpabsb", "avx_ssse3_2op", modifiers=[0x1C], avx=True) -add_insn("vpabsw", "avx_ssse3_2op", modifiers=[0x1D], avx=True) -add_insn("vpabsd", "avx_ssse3_2op", modifiers=[0x1E], avx=True) add_insn("vphminposuw", "avx_ssse3_2op", modifiers=[0x41], avx=True) +# VPABS* are extended to 256-bit in AVX2 +for cpu, sz in zip(["AVX", "AVX2"], [128, 256]): + add_group("avx2_ssse3_2op", + cpu=[cpu], + modifiers=["Op2Add"], + vex=sz, + prefix=0x66, + opcode=[0x0F, 0x38, 0x00], + operands=[Operand(type="SIMDReg", size=sz, dest="Spare"), + Operand(type="SIMDRM", size=sz, relaxed=True, dest="EA")]) +add_insn("vpabsb", "avx2_ssse3_2op", modifiers=[0x1C], avx=True) +add_insn("vpabsw", "avx2_ssse3_2op", modifiers=[0x1D], avx=True) +add_insn("vpabsd", "avx2_ssse3_2op", modifiers=[0x1E], avx=True) + # Some conversion functions take xmm, ymm combination # Need separate x and y versions for gas mode add_group("avx_cvt_xmm128_x", @@ -6437,6 +6644,20 @@ add_group("vbroadcastss", opcode=[0x0F, 0x38, 0x18], operands=[Operand(type="SIMDReg", size=256, dest="Spare"), Operand(type="Mem", size=32, relaxed=True, dest="EA")]) +add_group("vbroadcastss", + cpu=["AVX2"], + vex=128, + prefix=0x66, + opcode=[0x0F, 0x38, 0x18], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA")]) +add_group("vbroadcastss", + cpu=["AVX2"], + vex=256, + prefix=0x66, + opcode=[0x0F, 0x38, 0x18], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA")]) add_insn("vbroadcastss", "vbroadcastss") @@ -6447,41 +6668,51 @@ add_group("vbroadcastsd", opcode=[0x0F, 0x38, 0x19], operands=[Operand(type="SIMDReg", size=256, dest="Spare"), Operand(type="Mem", size=64, relaxed=True, dest="EA")]) +add_group("vbroadcastsd", + cpu=["AVX2"], + vex=256, + prefix=0x66, + opcode=[0x0F, 0x38, 0x19], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA")]) add_insn("vbroadcastsd", "vbroadcastsd") -add_group("vbroadcastf128", - cpu=["AVX"], +add_group("vbroadcastif128", + modifiers=["Op2Add"], vex=256, prefix=0x66, - opcode=[0x0F, 0x38, 0x1A], + opcode=[0x0F, 0x38, 0x00], operands=[Operand(type="SIMDReg", size=256, dest="Spare"), Operand(type="Mem", size=128, relaxed=True, dest="EA")]) -add_insn("vbroadcastf128", "vbroadcastf128") +add_insn("vbroadcastf128", "vbroadcastif128", modifiers=[0x1A], cpu=["AVX"]) +add_insn("vbroadcasti128", "vbroadcastif128", modifiers=[0x5A], cpu=["AVX2"]) -add_group("vextractf128", - cpu=["AVX"], +add_group("vextractif128", + modifiers=["Op2Add"], vex=256, prefix=0x66, - opcode=[0x0F, 0x3A, 0x19], + opcode=[0x0F, 0x3A, 0x00], operands=[Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), Operand(type="SIMDReg", size=256, dest="Spare"), Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) -add_insn("vextractf128", "vextractf128") +add_insn("vextractf128", "vextractif128", modifiers=[0x19], cpu=["AVX"]) +add_insn("vextracti128", "vextractif128", modifiers=[0x39], cpu=["AVX2"]) -add_group("vinsertf128", - cpu=["AVX"], +add_group("vinsertif128", + modifiers=["Op2Add"], vex=256, prefix=0x66, - opcode=[0x0F, 0x3A, 0x18], + opcode=[0x0F, 0x3A, 0x00], operands=[Operand(type="SIMDReg", size=256, dest="Spare"), Operand(type="SIMDReg", size=256, dest="VEX"), Operand(type="SIMDRM", size=128, relaxed=True, dest="EA"), Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) -add_insn("vinsertf128", "vinsertf128") +add_insn("vinsertf128", "vinsertif128", modifiers=[0x18], cpu=["AVX"]) +add_insn("vinserti128", "vinsertif128", modifiers=[0x38], cpu=["AVX2"]) add_group("vzero", cpu=["AVX"], @@ -6493,7 +6724,6 @@ add_insn("vzeroall", "vzero", modifiers=[VEXL1]) add_insn("vzeroupper", "vzero", modifiers=[VEXL0]) add_group("vmaskmov", - cpu=["AVX"], modifiers=["Op2Add"], vex=128, prefix=0x66, @@ -6502,7 +6732,6 @@ add_group("vmaskmov", Operand(type="SIMDReg", size=128, dest="VEX"), Operand(type="SIMDRM", size=128, relaxed=True, dest="EA")]) add_group("vmaskmov", - cpu=["AVX"], modifiers=["Op2Add"], vex=256, prefix=0x66, @@ -6511,7 +6740,6 @@ add_group("vmaskmov", Operand(type="SIMDReg", size=256, dest="VEX"), Operand(type="SIMDRM", size=256, relaxed=True, dest="EA")]) add_group("vmaskmov", - cpu=["AVX"], modifiers=["Op2Add"], vex=128, prefix=0x66, @@ -6520,7 +6748,6 @@ add_group("vmaskmov", Operand(type="SIMDReg", size=128, dest="VEX"), Operand(type="SIMDReg", size=128, dest="Spare")]) add_group("vmaskmov", - cpu=["AVX"], modifiers=["Op2Add"], vex=256, prefix=0x66, @@ -6529,8 +6756,8 @@ add_group("vmaskmov", Operand(type="SIMDReg", size=256, dest="VEX"), Operand(type="SIMDReg", size=256, dest="Spare")]) -add_insn("vmaskmovps", "vmaskmov", modifiers=[0x2C]) -add_insn("vmaskmovpd", "vmaskmov", modifiers=[0x2D]) +add_insn("vmaskmovps", "vmaskmov", modifiers=[0x2C], cpu=["AVX"]) +add_insn("vmaskmovpd", "vmaskmov", modifiers=[0x2D], cpu=["AVX"]) add_group("vpermil", cpu=["AVX"], @@ -6584,6 +6811,222 @@ add_group("vperm2f128", add_insn("vperm2f128", "vperm2f128") +##################################################################### +# Intel AVX2 instructions +##################################################################### + +# Most AVX2 instructions are mixed in with above SSEx/AVX groups. +# Some make more sense to have separate groups. + +# vex.vvvv=1111b +add_group("vperm_var_avx2", + cpu=["AVX2"], + modifiers=["Op2Add"], + vex=256, + vexw=0, + prefix=0x66, + opcode=[0x0F, 0x38, 0x00], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="SIMDReg", size=256, dest="VEX"), + Operand(type="SIMDRM", size=256, relaxed=True, dest="EA")]) + +add_insn("vpermd", "vperm_var_avx2", modifiers=[0x36]) +add_insn("vpermps", "vperm_var_avx2", modifiers=[0x16]) + +# vex.vvvv=1111b +add_group("vperm_imm_avx2", + cpu=["AVX2"], + modifiers=["Op2Add"], + vex=256, + vexw=1, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="SIMDRM", size=256, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + +add_insn("vpermq", "vperm_imm_avx2", modifiers=[0x00]) +add_insn("vpermpd", "vperm_imm_avx2", modifiers=[0x01]) + +add_group("vperm2i128_avx2", + cpu=["AVX2"], + vex=256, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x46], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="SIMDReg", size=256, dest="VEX"), + Operand(type="SIMDRM", size=256, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + +add_insn("vperm2i128", "vperm2i128_avx2") + +# vex.vvvv=1111b +for sz in [128, 256]: + add_group("vpbroadcastb_avx2", + cpu=["AVX2"], + vex=sz, + vexw=0, + prefix=0x66, + opcode=[0x0F, 0x38, 0x78], + operands=[Operand(type="SIMDReg", size=sz, dest="Spare"), + Operand(type="SIMDReg", size=128, relaxed=True, dest="EA")]) +# vex.vvvv=1111b +for sz in [128, 256]: + add_group("vpbroadcastb_avx2", + cpu=["AVX2"], + vex=sz, + vexw=0, + prefix=0x66, + opcode=[0x0F, 0x38, 0x78], + operands=[Operand(type="SIMDReg", size=sz, dest="Spare"), + Operand(type="RM", size=8, relaxed=True, dest="EA")]) + +add_insn("vpbroadcastb", "vpbroadcastb_avx2") + +# vex.vvvv=1111b +for sz in [128, 256]: + add_group("vpbroadcastw_avx2", + cpu=["AVX2"], + vex=sz, + vexw=0, + prefix=0x66, + opcode=[0x0F, 0x38, 0x79], + operands=[Operand(type="SIMDReg", size=sz, dest="Spare"), + Operand(type="SIMDReg", size=128, relaxed=True, dest="EA")]) +# vex.vvvv=1111b +for sz in [128, 256]: + add_group("vpbroadcastw_avx2", + cpu=["AVX2"], + vex=sz, + vexw=0, + prefix=0x66, + opcode=[0x0F, 0x38, 0x79], + operands=[Operand(type="SIMDReg", size=sz, dest="Spare"), + Operand(type="RM", size=16, relaxed=True, dest="EA")]) + +add_insn("vpbroadcastw", "vpbroadcastw_avx2") + +# vex.vvvv=1111b +for sz in [128, 256]: + add_group("vpbroadcastd_avx2", + cpu=["AVX2"], + vex=sz, + vexw=0, + prefix=0x66, + opcode=[0x0F, 0x38, 0x58], + operands=[Operand(type="SIMDReg", size=sz, dest="Spare"), + Operand(type="SIMDReg", size=128, relaxed=True, dest="EA")]) +# vex.vvvv=1111b +for sz in [128, 256]: + add_group("vpbroadcastd_avx2", + cpu=["AVX2"], + vex=sz, + vexw=0, + prefix=0x66, + opcode=[0x0F, 0x38, 0x58], + operands=[Operand(type="SIMDReg", size=sz, dest="Spare"), + Operand(type="RM", size=32, relaxed=True, dest="EA")]) + +add_insn("vpbroadcastd", "vpbroadcastd_avx2") + +# vex.vvvv=1111b +for sz in [128, 256]: + add_group("vpbroadcastq_avx2", + cpu=["AVX2"], + vex=sz, + vexw=0, + prefix=0x66, + opcode=[0x0F, 0x38, 0x59], + operands=[Operand(type="SIMDReg", size=sz, dest="Spare"), + Operand(type="SIMDReg", size=128, relaxed=True, dest="EA")]) +# vex.vvvv=1111b +for sz in [128, 256]: + add_group("vpbroadcastq_avx2", + cpu=["AVX2"], + vex=sz, + vexw=0, + prefix=0x66, + opcode=[0x0F, 0x38, 0x59], + operands=[Operand(type="SIMDReg", size=sz, dest="Spare"), + Operand(type="RM", size=64, relaxed=True, dest="EA")]) + +add_insn("vpbroadcastq", "vpbroadcastq_avx2") + +for sz in [128, 256]: + add_group("vpshiftv_vexw0_avx2", + cpu=["AVX2"], + modifiers=["Op2Add"], + vex=sz, + vexw=0, + prefix=0x66, + opcode=[0x0F, 0x38, 0x00], + operands=[Operand(type="SIMDReg", size=sz, dest="Spare"), + Operand(type="SIMDReg", size=sz, dest="VEX"), + Operand(type="SIMDRM", size=sz, relaxed=True, dest="EA")]) + +for sz in [128, 256]: + add_group("vpshiftv_vexw1_avx2", + cpu=["AVX2"], + modifiers=["Op2Add"], + vex=sz, + vexw=1, + prefix=0x66, + opcode=[0x0F, 0x38, 0x00], + operands=[Operand(type="SIMDReg", size=sz, dest="Spare"), + Operand(type="SIMDReg", size=sz, dest="VEX"), + Operand(type="SIMDRM", size=sz, relaxed=True, dest="EA")]) + +add_insn("vpsrlvd", "vpshiftv_vexw0_avx2", modifiers=[0x45]) +add_insn("vpsrlvq", "vpshiftv_vexw1_avx2", modifiers=[0x45]) +add_insn("vpsravd", "vpshiftv_vexw0_avx2", modifiers=[0x46]) + +add_insn("vpsllvd", "vpshiftv_vexw0_avx2", modifiers=[0x47]) +add_insn("vpsllvq", "vpshiftv_vexw1_avx2", modifiers=[0x47]) + +add_insn("vpmaskmovd", "vmaskmov", modifiers=[0x8C], cpu=["AVX2"]) + +# vex.vvvv=1111b +for sz in [128, 256]: + add_group("vmaskmov_vexw1_avx2", + cpu=["AVX2"], + modifiers=["Op2Add"], + vex=sz, + vexw=1, + prefix=0x66, + opcode=[0x0F, 0x38, 0x00], + operands=[Operand(type="SIMDReg", size=sz, dest="Spare"), + Operand(type="SIMDReg", size=sz, dest="VEX"), + Operand(type="SIMDRM", size=sz, relaxed=True, dest="EA")]) + +for sz in [128, 256]: + add_group("vmaskmov_vexw1_avx2", + cpu=["AVX2"], + modifiers=["Op2Add"], + vex=sz, + vexw=1, + prefix=0x66, + opcode=[0x0F, 0x38, 0x02], + operands=[Operand(type="SIMDRM", size=sz, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=sz, dest="VEX"), + Operand(type="SIMDReg", size=sz, dest="Spare")]) + +add_insn("vpmaskmovq", "vmaskmov_vexw1_avx2", modifiers=[0x8C]) + +for sz in [128, 256]: + add_group("vex_66_0F3A_imm8_avx2", + cpu=["AVX2"], + modifiers=["Op2Add"], + vex=sz, + vexw=0, + prefix=0x66, + opcode=[0x0F, 0x3A, 0x00], + operands=[Operand(type="SIMDReg", size=sz, dest="Spare"), + Operand(type="SIMDReg", size=sz, dest="VEX"), + Operand(type="SIMDRM", size=sz, relaxed=True, dest="EA"), + Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) + +add_insn("vpblendd", "vex_66_0F3A_imm8_avx2", modifiers=[0x02]) + ##################################################################### # Intel FMA instructions ##################################################################### diff --git a/modules/arch/x86/tests/Makefile.inc b/modules/arch/x86/tests/Makefile.inc index fab543b3..7aebd992 100644 --- a/modules/arch/x86/tests/Makefile.inc +++ b/modules/arch/x86/tests/Makefile.inc @@ -25,6 +25,8 @@ EXTRA_DIST += modules/arch/x86/tests/avx.asm EXTRA_DIST += modules/arch/x86/tests/avx.hex EXTRA_DIST += modules/arch/x86/tests/avx16.asm EXTRA_DIST += modules/arch/x86/tests/avx16.hex +EXTRA_DIST += modules/arch/x86/tests/avx2.asm +EXTRA_DIST += modules/arch/x86/tests/avx2.hex EXTRA_DIST += modules/arch/x86/tests/avxcc.asm EXTRA_DIST += modules/arch/x86/tests/avxcc.hex EXTRA_DIST += modules/arch/x86/tests/bittest.asm diff --git a/modules/arch/x86/tests/avx2.asm b/modules/arch/x86/tests/avx2.asm new file mode 100644 index 00000000..acf17ade --- /dev/null +++ b/modules/arch/x86/tests/avx2.asm @@ -0,0 +1,612 @@ +; Exhaustive test of AVX2 instructions +; +; Copyright (C) 2011 Peter Johnson +; +; Redistribution and use in source and binary forms, with or without +; modification, are permitted provided that the following conditions +; are met: +; 1. Redistributions of source code must retain the above copyright +; notice, this list of conditions and the following disclaimer. +; 2. Redistributions in binary form must reproduce the above copyright +; notice, this list of conditions and the following disclaimer in the +; documentation and/or other materials provided with the distribution. +; +; THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' +; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +; ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE +; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +; POSSIBILITY OF SUCH DAMAGE. +; + +[bits 64] + +vmpsadbw ymm1, ymm3, 3 ; c4 e3 75 42 cb 03 +vmpsadbw ymm1, yword [rax], 3 ; c4 e3 75 42 08 03 +vmpsadbw ymm1, ymm2, ymm3, 3 ; c4 e3 6d 42 cb 03 +vmpsadbw ymm1, ymm2, yword [rax], 3 ; c4 e3 6d 42 08 03 + +vpabsb ymm1, ymm2 ; c4 e2 7d 1c ca +vpabsb ymm1, yword [rax] ; c4 e2 7d 1c 08 + +vpabsw ymm1, ymm2 ; c4 e2 7d 1d ca +vpabsw ymm1, yword [rax] ; c4 e2 7d 1d 08 + +vpabsd ymm1, ymm2 ; c4 e2 7d 1e ca +vpabsd ymm1, yword [rax] ; c4 e2 7d 1e 08 + +vpacksswb ymm1, ymm3 ; c5 f5 63 cb +vpacksswb ymm1, yword [rax] ; c5 f5 63 08 +vpacksswb ymm1, ymm2, ymm3 ; c5 ed 63 cb +vpacksswb ymm1, ymm2, yword [rax] ; c5 ed 63 08 + +vpackssdw ymm1, ymm3 ; c5 f5 6b cb +vpackssdw ymm1, yword [rax] ; c5 f5 6b 08 +vpackssdw ymm1, ymm2, ymm3 ; c5 ed 6b cb +vpackssdw ymm1, ymm2, yword [rax] ; c5 ed 6b 08 + +vpackusdw ymm1, ymm3 ; c4 e2 75 2b cb +vpackusdw ymm1, yword [rax] ; c4 e2 75 2b 08 +vpackusdw ymm1, ymm2, ymm3 ; c4 e2 6d 2b cb +vpackusdw ymm1, ymm2, yword [rax] ; c4 e2 6d 2b 08 + +vpackuswb ymm1, ymm3 ; c5 f5 67 cb +vpackuswb ymm1, yword [rax] ; c5 f5 67 08 +vpackuswb ymm1, ymm2, ymm3 ; c5 ed 67 cb +vpackuswb ymm1, ymm2, yword [rax] ; c5 ed 67 08 + +vpaddb ymm1, ymm3 ; c5 f5 fc cb +vpaddb ymm1, yword [rax] ; c5 f5 fc 08 +vpaddb ymm1, ymm2, ymm3 ; c5 ed fc cb +vpaddb ymm1, ymm2, yword [rax] ; c5 ed fc 08 + +vpaddw ymm1, ymm3 ; c5 f5 fd cb +vpaddw ymm1, yword [rax] ; c5 f5 fd 08 +vpaddw ymm1, ymm2, ymm3 ; c5 ed fd cb +vpaddw ymm1, ymm2, yword [rax] ; c5 ed fd 08 + +vpaddd ymm1, ymm3 ; c5 f5 fe cb +vpaddd ymm1, yword [rax] ; c5 f5 fe 08 +vpaddd ymm1, ymm2, ymm3 ; c5 ed fe cb +vpaddd ymm1, ymm2, yword [rax] ; c5 ed fe 08 + +vpaddq ymm1, ymm3 ; c5 f5 d4 cb +vpaddq ymm1, yword [rax] ; c5 f5 d4 08 +vpaddq ymm1, ymm2, ymm3 ; c5 ed d4 cb +vpaddq ymm1, ymm2, yword [rax] ; c5 ed d4 08 + +vpaddsb ymm1, ymm3 ; c5 f5 ec cb +vpaddsb ymm1, yword [rax] ; c5 f5 ec 08 +vpaddsb ymm1, ymm2, ymm3 ; c5 ed ec cb +vpaddsb ymm1, ymm2, yword [rax] ; c5 ed ec 08 + +vpaddsw ymm1, ymm3 ; c5 f5 ed cb +vpaddsw ymm1, yword [rax] ; c5 f5 ed 08 +vpaddsw ymm1, ymm2, ymm3 ; c5 ed ed cb +vpaddsw ymm1, ymm2, yword [rax] ; c5 ed ed 08 + +vpaddusb ymm1, ymm3 ; c5 f5 dc cb +vpaddusb ymm1, yword [rax] ; c5 f5 dc 08 +vpaddusb ymm1, ymm2, ymm3 ; c5 ed dc cb +vpaddusb ymm1, ymm2, yword [rax] ; c5 ed dc 08 + +vpaddusw ymm1, ymm3 ; c5 f5 dd cb +vpaddusw ymm1, yword [rax] ; c5 f5 dd 08 +vpaddusw ymm1, ymm2, ymm3 ; c5 ed dd cb +vpaddusw ymm1, ymm2, yword [rax] ; c5 ed dd 08 + +vpalignr ymm1, ymm2, ymm3, 3 ; c4 e3 6d 0f cb 03 +vpalignr ymm1, ymm2, yword [rax], 3 ; c4 e3 6d 0f 08 03 + +vpand ymm1, ymm3 ; c5 f5 db cb +vpand ymm1, yword [rax] ; c5 f5 db 08 +vpand ymm1, ymm2, ymm3 ; c5 ed db cb +vpand ymm1, ymm2, yword [rax] ; c5 ed db 08 + +vpandn ymm1, ymm3 ; c5 f5 df cb +vpandn ymm1, yword [rax] ; c5 f5 df 08 +vpandn ymm1, ymm2, ymm3 ; c5 ed df cb +vpandn ymm1, ymm2, yword [rax] ; c5 ed df 08 + +vpavgb ymm1, ymm3 ; c5 f5 e0 cb +vpavgb ymm1, yword [rax] ; c5 f5 e0 08 +vpavgb ymm1, ymm2, ymm3 ; c5 ed e0 cb +vpavgb ymm1, ymm2, yword [rax] ; c5 ed e0 08 + +vpavgw ymm1, ymm3 ; c5 f5 e3 cb +vpavgw ymm1, yword [rax] ; c5 f5 e3 08 +vpavgw ymm1, ymm2, ymm3 ; c5 ed e3 cb +vpavgw ymm1, ymm2, yword [rax] ; c5 ed e3 08 + +vpblendvb ymm1, ymm2, ymm3, ymm4 ; c4 e3 6d 4c cb 40 +vpblendvb ymm1, ymm2, yword [rax], ymm4 ; c4 e3 6d 4c 08 40 + +vpblendw ymm1, ymm3, 3 ; c4 e3 75 0e cb 03 +vpblendw ymm1, yword [rax], 3 ; c4 e3 75 0e 08 03 +vpblendw ymm1, ymm2, ymm3, 3 ; c4 e3 6d 0e cb 03 +vpblendw ymm1, ymm2, yword [rax], 3 ; c4 e3 6d 0e 08 03 + +vpcmpeqb ymm1, ymm3 ; c5 f5 74 cb +vpcmpeqb ymm1, yword [rax] ; c5 f5 74 08 +vpcmpeqb ymm1, ymm2, ymm3 ; c5 ed 74 cb +vpcmpeqb ymm1, ymm2, yword [rax] ; c5 ed 74 08 + +vpcmpeqw ymm1, ymm3 ; c5 f5 75 cb +vpcmpeqw ymm1, yword [rax] ; c5 f5 75 08 +vpcmpeqw ymm1, ymm2, ymm3 ; c5 ed 75 cb +vpcmpeqw ymm1, ymm2, yword [rax] ; c5 ed 75 08 + +vpcmpeqd ymm1, ymm3 ; c5 f5 76 cb +vpcmpeqd ymm1, yword [rax] ; c5 f5 76 08 +vpcmpeqd ymm1, ymm2, ymm3 ; c5 ed 76 cb +vpcmpeqd ymm1, ymm2, yword [rax] ; c5 ed 76 08 + +vpcmpeqq ymm1, ymm3 ; c4 e2 75 29 cb +vpcmpeqq ymm1, yword [rax] ; c4 e2 75 29 08 +vpcmpeqq ymm1, ymm2, ymm3 ; c4 e2 6d 29 cb +vpcmpeqq ymm1, ymm2, yword [rax] ; c4 e2 6d 29 08 + +vpcmpgtb ymm1, ymm3 ; c5 f5 64 cb +vpcmpgtb ymm1, yword [rax] ; c5 f5 64 08 +vpcmpgtb ymm1, ymm2, ymm3 ; c5 ed 64 cb +vpcmpgtb ymm1, ymm2, yword [rax] ; c5 ed 64 08 + +vpcmpgtw ymm1, ymm3 ; c5 f5 65 cb +vpcmpgtw ymm1, yword [rax] ; c5 f5 65 08 +vpcmpgtw ymm1, ymm2, ymm3 ; c5 ed 65 cb +vpcmpgtw ymm1, ymm2, yword [rax] ; c5 ed 65 08 + +vpcmpgtd ymm1, ymm3 ; c5 f5 66 cb +vpcmpgtd ymm1, yword [rax] ; c5 f5 66 08 +vpcmpgtd ymm1, ymm2, ymm3 ; c5 ed 66 cb +vpcmpgtd ymm1, ymm2, yword [rax] ; c5 ed 66 08 + +vpcmpgtq ymm1, ymm3 ; c4 e2 75 37 cb +vpcmpgtq ymm1, yword [rax] ; c4 e2 75 37 08 +vpcmpgtq ymm1, ymm2, ymm3 ; c4 e2 6d 37 cb +vpcmpgtq ymm1, ymm2, yword [rax] ; c4 e2 6d 37 08 + +vphaddw ymm1, ymm3 ; c4 e2 75 01 cb +vphaddw ymm1, yword [rax] ; c4 e2 75 01 08 +vphaddw ymm1, ymm2, ymm3 ; c4 e2 6d 01 cb +vphaddw ymm1, ymm2, yword [rax] ; c4 e2 6d 01 08 + +vphaddd ymm1, ymm3 ; c4 e2 75 02 cb +vphaddd ymm1, yword [rax] ; c4 e2 75 02 08 +vphaddd ymm1, ymm2, ymm3 ; c4 e2 6d 02 cb +vphaddd ymm1, ymm2, yword [rax] ; c4 e2 6d 02 08 + +vphaddsw ymm1, ymm3 ; c4 e2 75 03 cb +vphaddsw ymm1, yword [rax] ; c4 e2 75 03 08 +vphaddsw ymm1, ymm2, ymm3 ; c4 e2 6d 03 cb +vphaddsw ymm1, ymm2, yword [rax] ; c4 e2 6d 03 08 + +vphsubw ymm1, ymm3 ; c4 e2 75 05 cb +vphsubw ymm1, yword [rax] ; c4 e2 75 05 08 +vphsubw ymm1, ymm2, ymm3 ; c4 e2 6d 05 cb +vphsubw ymm1, ymm2, yword [rax] ; c4 e2 6d 05 08 + +vphsubd ymm1, ymm3 ; c4 e2 75 06 cb +vphsubd ymm1, yword [rax] ; c4 e2 75 06 08 +vphsubd ymm1, ymm2, ymm3 ; c4 e2 6d 06 cb +vphsubd ymm1, ymm2, yword [rax] ; c4 e2 6d 06 08 + +vphsubsw ymm1, ymm3 ; c4 e2 75 07 cb +vphsubsw ymm1, yword [rax] ; c4 e2 75 07 08 +vphsubsw ymm1, ymm2, ymm3 ; c4 e2 6d 07 cb +vphsubsw ymm1, ymm2, yword [rax] ; c4 e2 6d 07 08 + +vpmaddubsw ymm1, ymm3 ; c4 e2 75 04 cb +vpmaddubsw ymm1, yword [rax] ; c4 e2 75 04 08 +vpmaddubsw ymm1, ymm2, ymm3 ; c4 e2 6d 04 cb +vpmaddubsw ymm1, ymm2, yword [rax] ; c4 e2 6d 04 08 + +vpmaddwd ymm1, ymm3 ; c5 f5 f5 cb +vpmaddwd ymm1, yword [rax] ; c5 f5 f5 08 +vpmaddwd ymm1, ymm2, ymm3 ; c5 ed f5 cb +vpmaddwd ymm1, ymm2, yword [rax] ; c5 ed f5 08 + +vpmaxsb ymm1, ymm3 ; c4 e2 75 3c cb +vpmaxsb ymm1, yword [rax] ; c4 e2 75 3c 08 +vpmaxsb ymm1, ymm2, ymm3 ; c4 e2 6d 3c cb +vpmaxsb ymm1, ymm2, yword [rax] ; c4 e2 6d 3c 08 + +vpmaxsw ymm1, ymm3 ; c5 f5 ee cb +vpmaxsw ymm1, yword [rax] ; c5 f5 ee 08 +vpmaxsw ymm1, ymm2, ymm3 ; c5 ed ee cb +vpmaxsw ymm1, ymm2, yword [rax] ; c5 ed ee 08 + +vpmaxsd ymm1, ymm3 ; c4 e2 75 3d cb +vpmaxsd ymm1, yword [rax] ; c4 e2 75 3d 08 +vpmaxsd ymm1, ymm2, ymm3 ; c4 e2 6d 3d cb +vpmaxsd ymm1, ymm2, yword [rax] ; c4 e2 6d 3d 08 + +vpmaxub ymm1, ymm3 ; c5 f5 de cb +vpmaxub ymm1, yword [rax] ; c5 f5 de 08 +vpmaxub ymm1, ymm2, ymm3 ; c5 ed de cb +vpmaxub ymm1, ymm2, yword [rax] ; c5 ed de 08 + +vpmaxuw ymm1, ymm3 ; c4 e2 75 3e cb +vpmaxuw ymm1, yword [rax] ; c4 e2 75 3e 08 +vpmaxuw ymm1, ymm2, ymm3 ; c4 e2 6d 3e cb +vpmaxuw ymm1, ymm2, yword [rax] ; c4 e2 6d 3e 08 + +vpmaxud ymm1, ymm3 ; c4 e2 75 3f cb +vpmaxud ymm1, yword [rax] ; c4 e2 75 3f 08 +vpmaxud ymm1, ymm2, ymm3 ; c4 e2 6d 3f cb +vpmaxud ymm1, ymm2, yword [rax] ; c4 e2 6d 3f 08 + +vpminsb ymm1, ymm3 ; c4 e2 75 38 cb +vpminsb ymm1, yword [rax] ; c4 e2 75 38 08 +vpminsb ymm1, ymm2, ymm3 ; c4 e2 6d 38 cb +vpminsb ymm1, ymm2, yword [rax] ; c4 e2 6d 38 08 + +vpminsw ymm1, ymm3 ; c5 f5 ea cb +vpminsw ymm1, yword [rax] ; c5 f5 ea 08 +vpminsw ymm1, ymm2, ymm3 ; c5 ed ea cb +vpminsw ymm1, ymm2, yword [rax] ; c5 ed ea 08 + +vpminsd ymm1, ymm3 ; c4 e2 75 39 cb +vpminsd ymm1, yword [rax] ; c4 e2 75 39 08 +vpminsd ymm1, ymm2, ymm3 ; c4 e2 6d 39 cb +vpminsd ymm1, ymm2, yword [rax] ; c4 e2 6d 39 08 + +vpminub ymm1, ymm3 ; c5 f5 da cb +vpminub ymm1, yword [rax] ; c5 f5 da 08 +vpminub ymm1, ymm2, ymm3 ; c5 ed da cb +vpminub ymm1, ymm2, yword [rax] ; c5 ed da 08 + +vpminuw ymm1, ymm3 ; c4 e2 75 3a cb +vpminuw ymm1, yword [rax] ; c4 e2 75 3a 08 +vpminuw ymm1, ymm2, ymm3 ; c4 e2 6d 3a cb +vpminuw ymm1, ymm2, yword [rax] ; c4 e2 6d 3a 08 + +vpminud ymm1, ymm3 ; c4 e2 75 3b cb +vpminud ymm1, yword [rax] ; c4 e2 75 3b 08 +vpminud ymm1, ymm2, ymm3 ; c4 e2 6d 3b cb +vpminud ymm1, ymm2, yword [rax] ; c4 e2 6d 3b 08 + +vpmovmskb eax, ymm1 ; c5 fd d7 c1 +vpmovmskb rax, ymm1 ; c5 fd d7 c1 + +vpmovsxbw ymm1, xmm2 ; c4 e2 7d 20 ca +vpmovsxbw ymm1, [rax] ; c4 e2 7d 20 08 +vpmovsxbw ymm1, oword [rax] ; c4 e2 7d 20 08 + +vpmovsxbd ymm1, xmm2 ; c4 e2 7d 21 ca +vpmovsxbd ymm1, [rax] ; c4 e2 7d 21 08 +vpmovsxbd ymm1, qword [rax] ; c4 e2 7d 21 08 + +vpmovsxbq ymm1, xmm2 ; c4 e2 7d 22 ca +vpmovsxbq ymm1, [rax] ; c4 e2 7d 22 08 +vpmovsxbq ymm1, dword [rax] ; c4 e2 7d 22 08 + +vpmovsxwd ymm1, xmm2 ; c4 e2 7d 23 ca +vpmovsxwd ymm1, [rax] ; c4 e2 7d 23 08 +vpmovsxwd ymm1, oword [rax] ; c4 e2 7d 23 08 + +vpmovsxwq ymm1, xmm2 ; c4 e2 7d 24 ca +vpmovsxwq ymm1, [rax] ; c4 e2 7d 24 08 +vpmovsxwq ymm1, qword [rax] ; c4 e2 7d 24 08 + +vpmovsxdq ymm1, xmm2 ; c4 e2 7d 25 ca +vpmovsxdq ymm1, [rax] ; c4 e2 7d 25 08 +vpmovsxdq ymm1, oword [rax] ; c4 e2 7d 25 08 + +vpmovzxbw ymm1, xmm2 ; c4 e2 7d 30 ca +vpmovzxbw ymm1, [rax] ; c4 e2 7d 30 08 +vpmovzxbw ymm1, oword [rax] ; c4 e2 7d 30 08 + +vpmovzxbd ymm1, xmm2 ; c4 e2 7d 31 ca +vpmovzxbd ymm1, [rax] ; c4 e2 7d 31 08 +vpmovzxbd ymm1, qword [rax] ; c4 e2 7d 31 08 + +vpmovzxbq ymm1, xmm2 ; c4 e2 7d 32 ca +vpmovzxbq ymm1, [rax] ; c4 e2 7d 32 08 +vpmovzxbq ymm1, dword [rax] ; c4 e2 7d 32 08 + +vpmovzxwd ymm1, xmm2 ; c4 e2 7d 33 ca +vpmovzxwd ymm1, [rax] ; c4 e2 7d 33 08 +vpmovzxwd ymm1, oword [rax] ; c4 e2 7d 33 08 + +vpmovzxwq ymm1, xmm2 ; c4 e2 7d 34 ca +vpmovzxwq ymm1, [rax] ; c4 e2 7d 34 08 +vpmovzxwq ymm1, qword [rax] ; c4 e2 7d 34 08 + +vpmovzxdq ymm1, xmm2 ; c4 e2 7d 35 ca +vpmovzxdq ymm1, [rax] ; c4 e2 7d 35 08 +vpmovzxdq ymm1, oword [rax] ; c4 e2 7d 35 08 + +vpmuldq ymm1, ymm3 ; c4 e2 75 28 cb +vpmuldq ymm1, yword [rax] ; c4 e2 75 28 08 +vpmuldq ymm1, ymm2, ymm3 ; c4 e2 6d 28 cb +vpmuldq ymm1, ymm2, yword [rax] ; c4 e2 6d 28 08 + +vpmulhrsw ymm1, ymm3 ; c4 e2 75 0b cb +vpmulhrsw ymm1, yword [rax] ; c4 e2 75 0b 08 +vpmulhrsw ymm1, ymm2, ymm3 ; c4 e2 6d 0b cb +vpmulhrsw ymm1, ymm2, yword [rax] ; c4 e2 6d 0b 08 + +vpmulhuw ymm1, ymm3 ; c5 f5 e4 cb +vpmulhuw ymm1, yword [rax] ; c5 f5 e4 08 +vpmulhuw ymm1, ymm2, ymm3 ; c5 ed e4 cb +vpmulhuw ymm1, ymm2, yword [rax] ; c5 ed e4 08 + +vpmulhw ymm1, ymm3 ; c5 f5 e5 cb +vpmulhw ymm1, yword [rax] ; c5 f5 e5 08 +vpmulhw ymm1, ymm2, ymm3 ; c5 ed e5 cb +vpmulhw ymm1, ymm2, yword [rax] ; c5 ed e5 08 + +vpmullw ymm1, ymm3 ; c5 f5 d5 cb +vpmullw ymm1, yword [rax] ; c5 f5 d5 08 +vpmullw ymm1, ymm2, ymm3 ; c5 ed d5 cb +vpmullw ymm1, ymm2, yword [rax] ; c5 ed d5 08 + +vpmulld ymm1, ymm3 ; c4 e2 75 40 cb +vpmulld ymm1, yword [rax] ; c4 e2 75 40 08 +vpmulld ymm1, ymm2, ymm3 ; c4 e2 6d 40 cb +vpmulld ymm1, ymm2, yword [rax] ; c4 e2 6d 40 08 + +vpmuludq ymm1, ymm3 ; c5 f5 f4 cb +vpmuludq ymm1, yword [rax] ; c5 f5 f4 08 +vpmuludq ymm1, ymm2, ymm3 ; c5 ed f4 cb +vpmuludq ymm1, ymm2, yword [rax] ; c5 ed f4 08 + +vpor ymm1, ymm3 ; c5 f5 eb cb +vpor ymm1, yword [rax] ; c5 f5 eb 08 +vpor ymm1, ymm2, ymm3 ; c5 ed eb cb +vpor ymm1, ymm2, yword [rax] ; c5 ed eb 08 + +vpsadbw ymm1, ymm3 ; c5 f5 f6 cb +vpsadbw ymm1, yword [rax] ; c5 f5 f6 08 +vpsadbw ymm1, ymm2, ymm3 ; c5 ed f6 cb +vpsadbw ymm1, ymm2, yword [rax] ; c5 ed f6 08 + +vpshufb ymm1, ymm3 ; c4 e2 75 00 cb +vpshufb ymm1, yword [rax] ; c4 e2 75 00 08 +vpshufb ymm1, ymm2, ymm3 ; c4 e2 6d 00 cb +vpshufb ymm1, ymm2, yword [rax] ; c4 e2 6d 00 08 + +vpshufd ymm1, ymm3, 3 ; c5 fd 70 cb 03 +vpshufd ymm1, yword [rax], 3 ; c5 fd 70 08 03 + +vpshufhw ymm1, ymm3, 3 ; c5 fe 70 cb 03 +vpshufhw ymm1, yword [rax], 3 ; c5 fe 70 08 03 + +vpshuflw ymm1, ymm3, 3 ; c5 ff 70 cb 03 +vpshuflw ymm1, yword [rax], 3 ; c5 ff 70 08 03 + +vpsignb ymm1, ymm3 ; c4 e2 75 08 cb +vpsignb ymm1, yword [rax] ; c4 e2 75 08 08 +vpsignb ymm1, ymm2, ymm3 ; c4 e2 6d 08 cb +vpsignb ymm1, ymm2, yword [rax] ; c4 e2 6d 08 08 + +vpsignw ymm1, ymm3 ; c4 e2 75 09 cb +vpsignw ymm1, yword [rax] ; c4 e2 75 09 08 +vpsignw ymm1, ymm2, ymm3 ; c4 e2 6d 09 cb +vpsignw ymm1, ymm2, yword [rax] ; c4 e2 6d 09 08 + +vpsignd ymm1, ymm3 ; c4 e2 75 0a cb +vpsignd ymm1, yword [rax] ; c4 e2 75 0a 08 +vpsignd ymm1, ymm2, ymm3 ; c4 e2 6d 0a cb +vpsignd ymm1, ymm2, yword [rax] ; c4 e2 6d 0a 08 + +vpslldq ymm1, 3 ; c5 f5 73 f9 03 +vpslldq ymm1, ymm2, 3 ; c5 f5 73 fa 03 + +vpsllw ymm1, xmm3 ; c5 f5 f1 cb +vpsllw ymm1, oword [rax] ; c5 f5 f1 08 +vpsllw ymm1, 3 ; c5 f5 71 f1 03 +vpsllw ymm1, ymm2, xmm3 ; c5 ed f1 cb +vpsllw ymm1, ymm2, oword [rax] ; c5 ed f1 08 +vpsllw ymm1, ymm2, 3 ; c5 f5 71 f2 03 + +vpslld ymm1, xmm3 ; c5 f5 f2 cb +vpslld ymm1, oword [rax] ; c5 f5 f2 08 +vpslld ymm1, 3 ; c5 f5 72 f1 03 +vpslld ymm1, ymm2, xmm3 ; c5 ed f2 cb +vpslld ymm1, ymm2, oword [rax] ; c5 ed f2 08 +vpslld ymm1, ymm2, 3 ; c5 f5 72 f2 03 + +vpsllq ymm1, xmm3 ; c5 f5 f3 cb +vpsllq ymm1, oword [rax] ; c5 f5 f3 08 +vpsllq ymm1, 3 ; c5 f5 73 f1 03 +vpsllq ymm1, ymm2, xmm3 ; c5 ed f3 cb +vpsllq ymm1, ymm2, oword [rax] ; c5 ed f3 08 +vpsllq ymm1, ymm2, 3 ; c5 f5 73 f2 03 + +vpsraw ymm1, xmm3 ; c5 f5 e1 cb +vpsraw ymm1, oword [rax] ; c5 f5 e1 08 +vpsraw ymm1, 3 ; c5 f5 71 e1 03 +vpsraw ymm1, ymm2, xmm3 ; c5 ed e1 cb +vpsraw ymm1, ymm2, oword [rax] ; c5 ed e1 08 +vpsraw ymm1, ymm2, 3 ; c5 f5 71 e2 03 + +vpsrad ymm1, xmm3 ; c5 f5 e2 cb +vpsrad ymm1, oword [rax] ; c5 f5 e2 08 +vpsrad ymm1, 3 ; c5 f5 72 e1 03 +vpsrad ymm1, ymm2, xmm3 ; c5 ed e2 cb +vpsrad ymm1, ymm2, oword [rax] ; c5 ed e2 08 +vpsrad ymm1, ymm2, 3 ; c5 f5 72 e2 03 + +vpsrldq ymm1, 3 ; c5 f5 73 d9 03 +vpsrldq ymm1, ymm2, 3 ; c5 f5 73 da 03 + +vpsrlw ymm1, xmm3 ; c5 f5 d1 cb +vpsrlw ymm1, oword [rax] ; c5 f5 d1 08 +vpsrlw ymm1, 3 ; c5 f5 71 d1 03 +vpsrlw ymm1, ymm2, xmm3 ; c5 ed d1 cb +vpsrlw ymm1, ymm2, oword [rax] ; c5 ed d1 08 +vpsrlw ymm1, ymm2, 3 ; c5 f5 71 d2 03 + +vpsrld ymm1, xmm3 ; c5 f5 d2 cb +vpsrld ymm1, oword [rax] ; c5 f5 d2 08 +vpsrld ymm1, 3 ; c5 f5 72 d1 03 +vpsrld ymm1, ymm2, xmm3 ; c5 ed d2 cb +vpsrld ymm1, ymm2, oword [rax] ; c5 ed d2 08 +vpsrld ymm1, ymm2, 3 ; c5 f5 72 d2 03 + +vpsrld ymm1, xmm3 ; c5 f5 d2 cb +vpsrld ymm1, oword [rax] ; c5 f5 d2 08 +vpsrld ymm1, 3 ; c5 f5 72 d1 03 +vpsrld ymm1, ymm2, xmm3 ; c5 ed d2 cb +vpsrld ymm1, ymm2, oword [rax] ; c5 ed d2 08 +vpsrld ymm1, ymm2, 3 ; c5 f5 72 d2 03 + +vpsubsb ymm1, ymm3 ; c5 f5 e8 cb +vpsubsb ymm1, yword [rax] ; c5 f5 e8 08 +vpsubsb ymm1, ymm2, ymm3 ; c5 ed e8 cb +vpsubsb ymm1, ymm2, yword [rax] ; c5 ed e8 08 + +vpsubsw ymm1, ymm3 ; c5 f5 e9 cb +vpsubsw ymm1, yword [rax] ; c5 f5 e9 08 +vpsubsw ymm1, ymm2, ymm3 ; c5 ed e9 cb +vpsubsw ymm1, ymm2, yword [rax] ; c5 ed e9 08 + +vpsubusb ymm1, ymm3 ; c5 f5 d8 cb +vpsubusb ymm1, yword [rax] ; c5 f5 d8 08 +vpsubusb ymm1, ymm2, ymm3 ; c5 ed d8 cb +vpsubusb ymm1, ymm2, yword [rax] ; c5 ed d8 08 + +vpsubusw ymm1, ymm3 ; c5 f5 d9 cb +vpsubusw ymm1, yword [rax] ; c5 f5 d9 08 +vpsubusw ymm1, ymm2, ymm3 ; c5 ed d9 cb +vpsubusw ymm1, ymm2, yword [rax] ; c5 ed d9 08 + +vpunpckhbw ymm1, ymm3 ; c5 f5 68 cb +vpunpckhbw ymm1, yword [rax] ; c5 f5 68 08 +vpunpckhbw ymm1, ymm2, ymm3 ; c5 ed 68 cb +vpunpckhbw ymm1, ymm2, yword [rax] ; c5 ed 68 08 + +vpunpckhwd ymm1, ymm3 ; c5 f5 69 cb +vpunpckhwd ymm1, yword [rax] ; c5 f5 69 08 +vpunpckhwd ymm1, ymm2, ymm3 ; c5 ed 69 cb +vpunpckhwd ymm1, ymm2, yword [rax] ; c5 ed 69 08 + +vpunpckhdq ymm1, ymm3 ; c5 f5 6a cb +vpunpckhdq ymm1, yword [rax] ; c5 f5 6a 08 +vpunpckhdq ymm1, ymm2, ymm3 ; c5 ed 6a cb +vpunpckhdq ymm1, ymm2, yword [rax] ; c5 ed 6a 08 + +vpunpckhqdq ymm1, ymm3 ; c5 f5 6d cb +vpunpckhqdq ymm1, yword [rax] ; c5 f5 6d 08 +vpunpckhqdq ymm1, ymm2, ymm3 ; c5 ed 6d cb +vpunpckhqdq ymm1, ymm2, yword [rax] ; c5 ed 6d 08 + +vpunpcklbw ymm1, ymm3 ; c5 f5 60 cb +vpunpcklbw ymm1, yword [rax] ; c5 f5 60 08 +vpunpcklbw ymm1, ymm2, ymm3 ; c5 ed 60 cb +vpunpcklbw ymm1, ymm2, yword [rax] ; c5 ed 60 08 + +vpunpcklwd ymm1, ymm3 ; c5 f5 61 cb +vpunpcklwd ymm1, yword [rax] ; c5 f5 61 08 +vpunpcklwd ymm1, ymm2, ymm3 ; c5 ed 61 cb +vpunpcklwd ymm1, ymm2, yword [rax] ; c5 ed 61 08 + +vpunpckldq ymm1, ymm3 ; c5 f5 62 cb +vpunpckldq ymm1, yword [rax] ; c5 f5 62 08 +vpunpckldq ymm1, ymm2, ymm3 ; c5 ed 62 cb +vpunpckldq ymm1, ymm2, yword [rax] ; c5 ed 62 08 + +vpunpcklqdq ymm1, ymm3 ; c5 f5 6c cb +vpunpcklqdq ymm1, yword [rax] ; c5 f5 6c 08 +vpunpcklqdq ymm1, ymm2, ymm3 ; c5 ed 6c cb +vpunpcklqdq ymm1, ymm2, yword [rax] ; c5 ed 6c 08 + +vpxor ymm1, ymm3 ; c5 f5 ef cb +vpxor ymm1, yword [rax] ; c5 f5 ef 08 +vpxor ymm1, ymm2, ymm3 ; c5 ed ef cb +vpxor ymm1, ymm2, yword [rax] ; c5 ed ef 08 + +vmovntdqa ymm1, yword [rax] ; c4 e2 7d 2a 08 + +vbroadcastss xmm1, xmm2 ; c4 e2 79 18 ca +vbroadcastss ymm1, xmm2 ; c4 e2 7d 18 ca + +vbroadcastsd ymm1, xmm2 ; c4 e2 7d 19 ca + +vbroadcasti128 ymm1, oword [rax] ; c4 e2 7d 5a 08 + +vpblendd ymm1, ymm2, ymm3, 3 ; c4 e3 6d 02 cb 03 +vpblendd ymm1, ymm2, yword [rax], 3 ; c4 e3 6d 02 08 03 + +vpbroadcastb xmm1, xmm2 ; c4 e2 79 78 ca +vpbroadcastb xmm1, byte [rax] ; c4 e2 79 78 08 +vpbroadcastb ymm1, xmm2 ; c4 e2 7d 78 ca +vpbroadcastb ymm1, byte [rax] ; c4 e2 7d 78 08 + +vpbroadcastw xmm1, xmm2 ; c4 e2 79 79 ca +vpbroadcastw xmm1, word [rax] ; c4 e2 79 79 08 +vpbroadcastw ymm1, xmm2 ; c4 e2 7d 79 ca +vpbroadcastw ymm1, word [rax] ; c4 e2 7d 79 08 + +vpbroadcastd xmm1, xmm2 ; c4 e2 79 58 ca +vpbroadcastd xmm1, dword [rax] ; c4 e2 79 58 08 +vpbroadcastd ymm1, xmm2 ; c4 e2 7d 58 ca +vpbroadcastd ymm1, dword [rax] ; c4 e2 7d 58 08 + +vpbroadcastq xmm1, xmm2 ; c4 e2 79 59 ca +vpbroadcastq xmm1, qword [rax] ; c4 e2 79 59 08 +vpbroadcastq ymm1, xmm2 ; c4 e2 7d 59 ca +vpbroadcastq ymm1, qword [rax] ; c4 e2 7d 59 08 + +vpermd ymm1, ymm2, ymm3 ; c4 e2 6d 36 cb +vpermd ymm1, ymm2, yword [rax] ; c4 e2 6d 36 08 + +vpermpd ymm1, ymm2, 3 ; c4 e3 fd 01 ca 03 +vpermpd ymm1, yword [rax], 3 ; c4 e3 fd 01 08 03 + +vpermps ymm1, ymm2, ymm3 ; c4 e2 6d 16 cb +vpermps ymm1, ymm2, yword [rax] ; c4 e2 6d 16 08 + +vpermq ymm1, ymm2, 3 ; c4 e3 fd 00 ca 03 +vpermq ymm1, yword [rax], 3 ; c4 e3 fd 00 08 03 + +vperm2i128 ymm1, ymm2, ymm3, 3 ; c4 e3 6d 46 cb 03 +vperm2i128 ymm1, ymm2, yword [rax], 3 ; c4 e3 6d 46 08 03 + +vextracti128 xmm1, ymm2, 3 ; c4 e3 7d 39 d1 03 +vextracti128 oword [rax], ymm2, 3 ; c4 e3 7d 39 10 03 + +vinserti128 ymm1, ymm2, xmm3, 3 ; c4 e3 6d 38 cb 03 +vinserti128 ymm1, ymm2, oword [rax], 3 ; c4 e3 6d 38 08 03 + +vpmaskmovd xmm1, xmm2, oword [rax] ; c4 e2 69 8c 08 +vpmaskmovd ymm1, ymm2, yword [rax] ; c4 e2 6d 8c 08 +vpmaskmovd oword [rax], xmm1, xmm2 ; c4 e2 71 8e 10 +vpmaskmovd yword [rax], ymm1, ymm2 ; c4 e2 75 8e 10 + +vpmaskmovq xmm1, xmm2, oword [rax] ; c4 e2 e9 8c 08 +vpmaskmovq ymm1, ymm2, yword [rax] ; c4 e2 ed 8c 08 +vpmaskmovq oword [rax], xmm1, xmm2 ; c4 e2 f1 8e 10 +vpmaskmovq yword [rax], ymm1, ymm2 ; c4 e2 f5 8e 10 + +vpsllvd xmm1, xmm2, xmm3 ; c4 e2 69 47 cb +vpsllvd xmm1, xmm2, oword [rax] ; c4 e2 69 47 08 +vpsllvd ymm1, ymm2, ymm3 ; c4 e2 6d 47 cb +vpsllvd ymm1, ymm2, yword [rax] ; c4 e2 6d 47 08 + +vpsllvq xmm1, xmm2, xmm3 ; c4 e2 e9 47 cb +vpsllvq xmm1, xmm2, oword [rax] ; c4 e2 e9 47 08 +vpsllvq ymm1, ymm2, ymm3 ; c4 e2 ed 47 cb +vpsllvq ymm1, ymm2, yword [rax] ; c4 e2 ed 47 08 + +vpsravd xmm1, xmm2, xmm3 ; c4 e2 69 46 cb +vpsravd xmm1, xmm2, oword [rax] ; c4 e2 69 46 08 +vpsravd ymm1, ymm2, ymm3 ; c4 e2 6d 46 cb +vpsravd ymm1, ymm2, yword [rax] ; c4 e2 6d 46 08 + +vpsrlvd xmm1, xmm2, xmm3 ; c4 e2 69 45 cb +vpsrlvd xmm1, xmm2, oword [rax] ; c4 e2 69 45 08 +vpsrlvd ymm1, ymm2, ymm3 ; c4 e2 6d 45 cb +vpsrlvd ymm1, ymm2, yword [rax] ; c4 e2 6d 45 08 + +vpsrlvq xmm1, xmm2, xmm3 ; c4 e2 e9 45 cb +vpsrlvq xmm1, xmm2, oword [rax] ; c4 e2 e9 45 08 +vpsrlvq ymm1, ymm2, ymm3 ; c4 e2 ed 45 cb +vpsrlvq ymm1, ymm2, yword [rax] ; c4 e2 ed 45 08 diff --git a/modules/arch/x86/tests/avx2.hex b/modules/arch/x86/tests/avx2.hex new file mode 100644 index 00000000..3d9e9cd4 --- /dev/null +++ b/modules/arch/x86/tests/avx2.hex @@ -0,0 +1,2105 @@ +c4 +e3 +75 +42 +cb +03 +c4 +e3 +75 +42 +08 +03 +c4 +e3 +6d +42 +cb +03 +c4 +e3 +6d +42 +08 +03 +c4 +e2 +7d +1c +ca +c4 +e2 +7d +1c +08 +c4 +e2 +7d +1d +ca +c4 +e2 +7d +1d +08 +c4 +e2 +7d +1e +ca +c4 +e2 +7d +1e +08 +c5 +f5 +63 +cb +c5 +f5 +63 +08 +c5 +ed +63 +cb +c5 +ed +63 +08 +c5 +f5 +6b +cb +c5 +f5 +6b +08 +c5 +ed +6b +cb +c5 +ed +6b +08 +c4 +e2 +75 +2b +cb +c4 +e2 +75 +2b +08 +c4 +e2 +6d +2b +cb +c4 +e2 +6d +2b +08 +c5 +f5 +67 +cb +c5 +f5 +67 +08 +c5 +ed +67 +cb +c5 +ed +67 +08 +c5 +f5 +fc +cb +c5 +f5 +fc +08 +c5 +ed +fc +cb +c5 +ed +fc +08 +c5 +f5 +fd +cb +c5 +f5 +fd +08 +c5 +ed +fd +cb +c5 +ed +fd +08 +c5 +f5 +fe +cb +c5 +f5 +fe +08 +c5 +ed +fe +cb +c5 +ed +fe +08 +c5 +f5 +d4 +cb +c5 +f5 +d4 +08 +c5 +ed +d4 +cb +c5 +ed +d4 +08 +c5 +f5 +ec +cb +c5 +f5 +ec +08 +c5 +ed +ec +cb +c5 +ed +ec +08 +c5 +f5 +ed +cb +c5 +f5 +ed +08 +c5 +ed +ed +cb +c5 +ed +ed +08 +c5 +f5 +dc +cb +c5 +f5 +dc +08 +c5 +ed +dc +cb +c5 +ed +dc +08 +c5 +f5 +dd +cb +c5 +f5 +dd +08 +c5 +ed +dd +cb +c5 +ed +dd +08 +c4 +e3 +6d +0f +cb +03 +c4 +e3 +6d +0f +08 +03 +c5 +f5 +db +cb +c5 +f5 +db +08 +c5 +ed +db +cb +c5 +ed +db +08 +c5 +f5 +df +cb +c5 +f5 +df +08 +c5 +ed +df +cb +c5 +ed +df +08 +c5 +f5 +e0 +cb +c5 +f5 +e0 +08 +c5 +ed +e0 +cb +c5 +ed +e0 +08 +c5 +f5 +e3 +cb +c5 +f5 +e3 +08 +c5 +ed +e3 +cb +c5 +ed +e3 +08 +c4 +e3 +6d +4c +cb +40 +c4 +e3 +6d +4c +08 +40 +c4 +e3 +75 +0e +cb +03 +c4 +e3 +75 +0e +08 +03 +c4 +e3 +6d +0e +cb +03 +c4 +e3 +6d +0e +08 +03 +c5 +f5 +74 +cb +c5 +f5 +74 +08 +c5 +ed +74 +cb +c5 +ed +74 +08 +c5 +f5 +75 +cb +c5 +f5 +75 +08 +c5 +ed +75 +cb +c5 +ed +75 +08 +c5 +f5 +76 +cb +c5 +f5 +76 +08 +c5 +ed +76 +cb +c5 +ed +76 +08 +c4 +e2 +75 +29 +cb +c4 +e2 +75 +29 +08 +c4 +e2 +6d +29 +cb +c4 +e2 +6d +29 +08 +c5 +f5 +64 +cb +c5 +f5 +64 +08 +c5 +ed +64 +cb +c5 +ed +64 +08 +c5 +f5 +65 +cb +c5 +f5 +65 +08 +c5 +ed +65 +cb +c5 +ed +65 +08 +c5 +f5 +66 +cb +c5 +f5 +66 +08 +c5 +ed +66 +cb +c5 +ed +66 +08 +c4 +e2 +75 +37 +cb +c4 +e2 +75 +37 +08 +c4 +e2 +6d +37 +cb +c4 +e2 +6d +37 +08 +c4 +e2 +75 +01 +cb +c4 +e2 +75 +01 +08 +c4 +e2 +6d +01 +cb +c4 +e2 +6d +01 +08 +c4 +e2 +75 +02 +cb +c4 +e2 +75 +02 +08 +c4 +e2 +6d +02 +cb +c4 +e2 +6d +02 +08 +c4 +e2 +75 +03 +cb +c4 +e2 +75 +03 +08 +c4 +e2 +6d +03 +cb +c4 +e2 +6d +03 +08 +c4 +e2 +75 +05 +cb +c4 +e2 +75 +05 +08 +c4 +e2 +6d +05 +cb +c4 +e2 +6d +05 +08 +c4 +e2 +75 +06 +cb +c4 +e2 +75 +06 +08 +c4 +e2 +6d +06 +cb +c4 +e2 +6d +06 +08 +c4 +e2 +75 +07 +cb +c4 +e2 +75 +07 +08 +c4 +e2 +6d +07 +cb +c4 +e2 +6d +07 +08 +c4 +e2 +75 +04 +cb +c4 +e2 +75 +04 +08 +c4 +e2 +6d +04 +cb +c4 +e2 +6d +04 +08 +c5 +f5 +f5 +cb +c5 +f5 +f5 +08 +c5 +ed +f5 +cb +c5 +ed +f5 +08 +c4 +e2 +75 +3c +cb +c4 +e2 +75 +3c +08 +c4 +e2 +6d +3c +cb +c4 +e2 +6d +3c +08 +c5 +f5 +ee +cb +c5 +f5 +ee +08 +c5 +ed +ee +cb +c5 +ed +ee +08 +c4 +e2 +75 +3d +cb +c4 +e2 +75 +3d +08 +c4 +e2 +6d +3d +cb +c4 +e2 +6d +3d +08 +c5 +f5 +de +cb +c5 +f5 +de +08 +c5 +ed +de +cb +c5 +ed +de +08 +c4 +e2 +75 +3e +cb +c4 +e2 +75 +3e +08 +c4 +e2 +6d +3e +cb +c4 +e2 +6d +3e +08 +c4 +e2 +75 +3f +cb +c4 +e2 +75 +3f +08 +c4 +e2 +6d +3f +cb +c4 +e2 +6d +3f +08 +c4 +e2 +75 +38 +cb +c4 +e2 +75 +38 +08 +c4 +e2 +6d +38 +cb +c4 +e2 +6d +38 +08 +c5 +f5 +ea +cb +c5 +f5 +ea +08 +c5 +ed +ea +cb +c5 +ed +ea +08 +c4 +e2 +75 +39 +cb +c4 +e2 +75 +39 +08 +c4 +e2 +6d +39 +cb +c4 +e2 +6d +39 +08 +c5 +f5 +da +cb +c5 +f5 +da +08 +c5 +ed +da +cb +c5 +ed +da +08 +c4 +e2 +75 +3a +cb +c4 +e2 +75 +3a +08 +c4 +e2 +6d +3a +cb +c4 +e2 +6d +3a +08 +c4 +e2 +75 +3b +cb +c4 +e2 +75 +3b +08 +c4 +e2 +6d +3b +cb +c4 +e2 +6d +3b +08 +c5 +fd +d7 +c1 +c5 +fd +d7 +c1 +c4 +e2 +7d +20 +ca +c4 +e2 +7d +20 +08 +c4 +e2 +7d +20 +08 +c4 +e2 +7d +21 +ca +c4 +e2 +7d +21 +08 +c4 +e2 +7d +21 +08 +c4 +e2 +7d +22 +ca +c4 +e2 +7d +22 +08 +c4 +e2 +7d +22 +08 +c4 +e2 +7d +23 +ca +c4 +e2 +7d +23 +08 +c4 +e2 +7d +23 +08 +c4 +e2 +7d +24 +ca +c4 +e2 +7d +24 +08 +c4 +e2 +7d +24 +08 +c4 +e2 +7d +25 +ca +c4 +e2 +7d +25 +08 +c4 +e2 +7d +25 +08 +c4 +e2 +7d +30 +ca +c4 +e2 +7d +30 +08 +c4 +e2 +7d +30 +08 +c4 +e2 +7d +31 +ca +c4 +e2 +7d +31 +08 +c4 +e2 +7d +31 +08 +c4 +e2 +7d +32 +ca +c4 +e2 +7d +32 +08 +c4 +e2 +7d +32 +08 +c4 +e2 +7d +33 +ca +c4 +e2 +7d +33 +08 +c4 +e2 +7d +33 +08 +c4 +e2 +7d +34 +ca +c4 +e2 +7d +34 +08 +c4 +e2 +7d +34 +08 +c4 +e2 +7d +35 +ca +c4 +e2 +7d +35 +08 +c4 +e2 +7d +35 +08 +c4 +e2 +75 +28 +cb +c4 +e2 +75 +28 +08 +c4 +e2 +6d +28 +cb +c4 +e2 +6d +28 +08 +c4 +e2 +75 +0b +cb +c4 +e2 +75 +0b +08 +c4 +e2 +6d +0b +cb +c4 +e2 +6d +0b +08 +c5 +f5 +e4 +cb +c5 +f5 +e4 +08 +c5 +ed +e4 +cb +c5 +ed +e4 +08 +c5 +f5 +e5 +cb +c5 +f5 +e5 +08 +c5 +ed +e5 +cb +c5 +ed +e5 +08 +c5 +f5 +d5 +cb +c5 +f5 +d5 +08 +c5 +ed +d5 +cb +c5 +ed +d5 +08 +c4 +e2 +75 +40 +cb +c4 +e2 +75 +40 +08 +c4 +e2 +6d +40 +cb +c4 +e2 +6d +40 +08 +c5 +f5 +f4 +cb +c5 +f5 +f4 +08 +c5 +ed +f4 +cb +c5 +ed +f4 +08 +c5 +f5 +eb +cb +c5 +f5 +eb +08 +c5 +ed +eb +cb +c5 +ed +eb +08 +c5 +f5 +f6 +cb +c5 +f5 +f6 +08 +c5 +ed +f6 +cb +c5 +ed +f6 +08 +c4 +e2 +75 +00 +cb +c4 +e2 +75 +00 +08 +c4 +e2 +6d +00 +cb +c4 +e2 +6d +00 +08 +c5 +fd +70 +cb +03 +c5 +fd +70 +08 +03 +c5 +fe +70 +cb +03 +c5 +fe +70 +08 +03 +c5 +ff +70 +cb +03 +c5 +ff +70 +08 +03 +c4 +e2 +75 +08 +cb +c4 +e2 +75 +08 +08 +c4 +e2 +6d +08 +cb +c4 +e2 +6d +08 +08 +c4 +e2 +75 +09 +cb +c4 +e2 +75 +09 +08 +c4 +e2 +6d +09 +cb +c4 +e2 +6d +09 +08 +c4 +e2 +75 +0a +cb +c4 +e2 +75 +0a +08 +c4 +e2 +6d +0a +cb +c4 +e2 +6d +0a +08 +c5 +f5 +73 +f9 +03 +c5 +f5 +73 +fa +03 +c5 +f5 +f1 +cb +c5 +f5 +f1 +08 +c5 +f5 +71 +f1 +03 +c5 +ed +f1 +cb +c5 +ed +f1 +08 +c5 +f5 +71 +f2 +03 +c5 +f5 +f2 +cb +c5 +f5 +f2 +08 +c5 +f5 +72 +f1 +03 +c5 +ed +f2 +cb +c5 +ed +f2 +08 +c5 +f5 +72 +f2 +03 +c5 +f5 +f3 +cb +c5 +f5 +f3 +08 +c5 +f5 +73 +f1 +03 +c5 +ed +f3 +cb +c5 +ed +f3 +08 +c5 +f5 +73 +f2 +03 +c5 +f5 +e1 +cb +c5 +f5 +e1 +08 +c5 +f5 +71 +e1 +03 +c5 +ed +e1 +cb +c5 +ed +e1 +08 +c5 +f5 +71 +e2 +03 +c5 +f5 +e2 +cb +c5 +f5 +e2 +08 +c5 +f5 +72 +e1 +03 +c5 +ed +e2 +cb +c5 +ed +e2 +08 +c5 +f5 +72 +e2 +03 +c5 +f5 +73 +d9 +03 +c5 +f5 +73 +da +03 +c5 +f5 +d1 +cb +c5 +f5 +d1 +08 +c5 +f5 +71 +d1 +03 +c5 +ed +d1 +cb +c5 +ed +d1 +08 +c5 +f5 +71 +d2 +03 +c5 +f5 +d2 +cb +c5 +f5 +d2 +08 +c5 +f5 +72 +d1 +03 +c5 +ed +d2 +cb +c5 +ed +d2 +08 +c5 +f5 +72 +d2 +03 +c5 +f5 +d2 +cb +c5 +f5 +d2 +08 +c5 +f5 +72 +d1 +03 +c5 +ed +d2 +cb +c5 +ed +d2 +08 +c5 +f5 +72 +d2 +03 +c5 +f5 +e8 +cb +c5 +f5 +e8 +08 +c5 +ed +e8 +cb +c5 +ed +e8 +08 +c5 +f5 +e9 +cb +c5 +f5 +e9 +08 +c5 +ed +e9 +cb +c5 +ed +e9 +08 +c5 +f5 +d8 +cb +c5 +f5 +d8 +08 +c5 +ed +d8 +cb +c5 +ed +d8 +08 +c5 +f5 +d9 +cb +c5 +f5 +d9 +08 +c5 +ed +d9 +cb +c5 +ed +d9 +08 +c5 +f5 +68 +cb +c5 +f5 +68 +08 +c5 +ed +68 +cb +c5 +ed +68 +08 +c5 +f5 +69 +cb +c5 +f5 +69 +08 +c5 +ed +69 +cb +c5 +ed +69 +08 +c5 +f5 +6a +cb +c5 +f5 +6a +08 +c5 +ed +6a +cb +c5 +ed +6a +08 +c5 +f5 +6d +cb +c5 +f5 +6d +08 +c5 +ed +6d +cb +c5 +ed +6d +08 +c5 +f5 +60 +cb +c5 +f5 +60 +08 +c5 +ed +60 +cb +c5 +ed +60 +08 +c5 +f5 +61 +cb +c5 +f5 +61 +08 +c5 +ed +61 +cb +c5 +ed +61 +08 +c5 +f5 +62 +cb +c5 +f5 +62 +08 +c5 +ed +62 +cb +c5 +ed +62 +08 +c5 +f5 +6c +cb +c5 +f5 +6c +08 +c5 +ed +6c +cb +c5 +ed +6c +08 +c5 +f5 +ef +cb +c5 +f5 +ef +08 +c5 +ed +ef +cb +c5 +ed +ef +08 +c4 +e2 +7d +2a +08 +c4 +e2 +79 +18 +ca +c4 +e2 +7d +18 +ca +c4 +e2 +7d +19 +ca +c4 +e2 +7d +5a +08 +c4 +e3 +6d +02 +cb +03 +c4 +e3 +6d +02 +08 +03 +c4 +e2 +79 +78 +ca +c4 +e2 +79 +78 +08 +c4 +e2 +7d +78 +ca +c4 +e2 +7d +78 +08 +c4 +e2 +79 +79 +ca +c4 +e2 +79 +79 +08 +c4 +e2 +7d +79 +ca +c4 +e2 +7d +79 +08 +c4 +e2 +79 +58 +ca +c4 +e2 +79 +58 +08 +c4 +e2 +7d +58 +ca +c4 +e2 +7d +58 +08 +c4 +e2 +79 +59 +ca +c4 +e2 +79 +59 +08 +c4 +e2 +7d +59 +ca +c4 +e2 +7d +59 +08 +c4 +e2 +6d +36 +cb +c4 +e2 +6d +36 +08 +c4 +e3 +fd +01 +ca +03 +c4 +e3 +fd +01 +08 +03 +c4 +e2 +6d +16 +cb +c4 +e2 +6d +16 +08 +c4 +e3 +fd +00 +ca +03 +c4 +e3 +fd +00 +08 +03 +c4 +e3 +6d +46 +cb +03 +c4 +e3 +6d +46 +08 +03 +c4 +e3 +7d +39 +d1 +03 +c4 +e3 +7d +39 +10 +03 +c4 +e3 +6d +38 +cb +03 +c4 +e3 +6d +38 +08 +03 +c4 +e2 +69 +8c +08 +c4 +e2 +6d +8c +08 +c4 +e2 +71 +8e +10 +c4 +e2 +75 +8e +10 +c4 +e2 +e9 +8c +08 +c4 +e2 +ed +8c +08 +c4 +e2 +f1 +8e +10 +c4 +e2 +f5 +8e +10 +c4 +e2 +69 +47 +cb +c4 +e2 +69 +47 +08 +c4 +e2 +6d +47 +cb +c4 +e2 +6d +47 +08 +c4 +e2 +e9 +47 +cb +c4 +e2 +e9 +47 +08 +c4 +e2 +ed +47 +cb +c4 +e2 +ed +47 +08 +c4 +e2 +69 +46 +cb +c4 +e2 +69 +46 +08 +c4 +e2 +6d +46 +cb +c4 +e2 +6d +46 +08 +c4 +e2 +69 +45 +cb +c4 +e2 +69 +45 +08 +c4 +e2 +6d +45 +cb +c4 +e2 +6d +45 +08 +c4 +e2 +e9 +45 +cb +c4 +e2 +e9 +45 +08 +c4 +e2 +ed +45 +cb +c4 +e2 +ed +45 +08 From ab721f347d281a430b4fe19cb2025151bcb7ef8a Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 3 Jul 2011 19:44:42 -0700 Subject: [PATCH 414/585] Add AVX2 VGATHER* and VPGATHER* instructions. These instructions use "VSIB" encoding, which takes the place of the usual SIB encoding. Several tests cover various legal and illegal modes. Last part of [#227 state:resolved]. --- modules/arch/x86/gen_x86_insn.py | 93 ++++ modules/arch/x86/tests/Makefile.inc | 6 + modules/arch/x86/tests/avx2.asm | 40 ++ modules/arch/x86/tests/avx2.hex | 192 +++++++ modules/arch/x86/tests/vsib-err.asm | 14 + modules/arch/x86/tests/vsib-err.errwarn | 7 + modules/arch/x86/tests/vsib.asm | 114 ++++ modules/arch/x86/tests/vsib.hex | 662 +++++++++++++++++++++++ modules/arch/x86/tests/vsib2-err.asm | 19 + modules/arch/x86/tests/vsib2-err.errwarn | 7 + modules/arch/x86/x86arch.h | 3 + modules/arch/x86/x86bc.c | 3 + modules/arch/x86/x86expr.c | 76 ++- modules/arch/x86/x86id.c | 67 ++- 14 files changed, 1283 insertions(+), 20 deletions(-) create mode 100644 modules/arch/x86/tests/vsib-err.asm create mode 100644 modules/arch/x86/tests/vsib-err.errwarn create mode 100644 modules/arch/x86/tests/vsib.asm create mode 100644 modules/arch/x86/tests/vsib.hex create mode 100644 modules/arch/x86/tests/vsib2-err.asm create mode 100644 modules/arch/x86/tests/vsib2-err.errwarn diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index 5dec9e81..985b3733 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -7027,6 +7027,99 @@ for sz in [128, 256]: add_insn("vpblendd", "vex_66_0F3A_imm8_avx2", modifiers=[0x02]) +# Vector register in EA. +add_group("gather_32x_32x", + cpu=["AVX2"], + modifiers=["Op2Add"], + vex=128, + vexw=1, + prefix=0x66, + opcode=[0x0F, 0x38, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="MemXMMIndex", size=32, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="VEX")]) +add_group("gather_32x_32x", + cpu=["AVX2"], + modifiers=["Op2Add"], + vex=256, + vexw=1, + prefix=0x66, + opcode=[0x0F, 0x38, 0x00], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="MemXMMIndex", size=32, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=256, dest="VEX")]) +add_insn("vgatherdpd", "gather_32x_32x", modifiers=[0x92]) +add_insn("vpgatherdq", "gather_32x_32x", modifiers=[0x90]) + +add_group("gather_64x_64y", + cpu=["AVX2"], + modifiers=["Op2Add"], + vex=128, + vexw=1, + prefix=0x66, + opcode=[0x0F, 0x38, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="MemXMMIndex", size=64, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="VEX")]) +add_group("gather_64x_64y", + cpu=["AVX2"], + modifiers=["Op2Add"], + vex=256, + vexw=1, + prefix=0x66, + opcode=[0x0F, 0x38, 0x00], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="MemYMMIndex", size=64, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=256, dest="VEX")]) +add_insn("vgatherqpd", "gather_64x_64y", modifiers=[0x93]) +add_insn("vpgatherqq", "gather_64x_64y", modifiers=[0x91]) + +add_group("gather_32x_32y", + cpu=["AVX2"], + modifiers=["Op2Add"], + vex=128, + vexw=0, + prefix=0x66, + opcode=[0x0F, 0x38, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="MemXMMIndex", size=32, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="VEX")]) +add_group("gather_32x_32y", + cpu=["AVX2"], + modifiers=["Op2Add"], + vex=256, + vexw=0, + prefix=0x66, + opcode=[0x0F, 0x38, 0x00], + operands=[Operand(type="SIMDReg", size=256, dest="Spare"), + Operand(type="MemYMMIndex", size=32, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=256, dest="VEX")]) +add_insn("vgatherdps", "gather_32x_32y", modifiers=[0x92]) +add_insn("vpgatherdd", "gather_32x_32y", modifiers=[0x90]) + +add_group("gather_64x_64y_128", + cpu=["AVX2"], + modifiers=["Op2Add"], + vex=128, + vexw=0, + prefix=0x66, + opcode=[0x0F, 0x38, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="MemXMMIndex", size=64, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="VEX")]) +add_group("gather_64x_64y_128", + cpu=["AVX2"], + modifiers=["Op2Add"], + vex=256, + vexw=0, + prefix=0x66, + opcode=[0x0F, 0x38, 0x00], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="MemYMMIndex", size=64, relaxed=True, dest="EA"), + Operand(type="SIMDReg", size=128, dest="VEX")]) +add_insn("vgatherqps", "gather_64x_64y_128", modifiers=[0x93]) +add_insn("vpgatherqd", "gather_64x_64y_128", modifiers=[0x91]) + ##################################################################### # Intel FMA instructions ##################################################################### diff --git a/modules/arch/x86/tests/Makefile.inc b/modules/arch/x86/tests/Makefile.inc index 7aebd992..07b13a80 100644 --- a/modules/arch/x86/tests/Makefile.inc +++ b/modules/arch/x86/tests/Makefile.inc @@ -237,6 +237,12 @@ EXTRA_DIST += modules/arch/x86/tests/vmx.asm EXTRA_DIST += modules/arch/x86/tests/vmx.hex EXTRA_DIST += modules/arch/x86/tests/vmx-err.asm EXTRA_DIST += modules/arch/x86/tests/vmx-err.errwarn +EXTRA_DIST += modules/arch/x86/tests/vsib.asm +EXTRA_DIST += modules/arch/x86/tests/vsib.hex +EXTRA_DIST += modules/arch/x86/tests/vsib-err.asm +EXTRA_DIST += modules/arch/x86/tests/vsib-err.errwarn +EXTRA_DIST += modules/arch/x86/tests/vsib2-err.asm +EXTRA_DIST += modules/arch/x86/tests/vsib2-err.errwarn EXTRA_DIST += modules/arch/x86/tests/x86label.asm EXTRA_DIST += modules/arch/x86/tests/x86label.hex EXTRA_DIST += modules/arch/x86/tests/xchg64.asm diff --git a/modules/arch/x86/tests/avx2.asm b/modules/arch/x86/tests/avx2.asm index acf17ade..2806d23c 100644 --- a/modules/arch/x86/tests/avx2.asm +++ b/modules/arch/x86/tests/avx2.asm @@ -610,3 +610,43 @@ vpsrlvq xmm1, xmm2, xmm3 ; c4 e2 e9 45 cb vpsrlvq xmm1, xmm2, oword [rax] ; c4 e2 e9 45 08 vpsrlvq ymm1, ymm2, ymm3 ; c4 e2 ed 45 cb vpsrlvq ymm1, ymm2, yword [rax] ; c4 e2 ed 45 08 + +vgatherdpd xmm1, [rax+xmm1], xmm2 ; c4 e2 e9 92 0c 08 +vgatherdpd xmm1, dword [rax+xmm1], xmm2 ; c4 e2 e9 92 0c 08 +vgatherdpd ymm1, [rax+xmm1], ymm2 ; c4 e2 ed 92 0c 08 +vgatherdpd ymm1, dword [rax+xmm1], ymm2 ; c4 e2 ed 92 0c 08 + +vgatherqpd xmm1, [rax+xmm1], xmm2 ; c4 e2 e9 93 0c 08 +vgatherqpd xmm1, qword [rax+xmm1], xmm2 ; c4 e2 e9 93 0c 08 +vgatherqpd ymm1, [rax+ymm1], ymm2 ; c4 e2 ed 93 0c 08 +vgatherqpd ymm1, qword [rax+ymm1], ymm2 ; c4 e2 ed 93 0c 08 + +vgatherdps xmm1, [rax+xmm1], xmm2 ; c4 e2 69 92 0c 08 +vgatherdps xmm1, dword [rax+xmm1], xmm2 ; c4 e2 69 92 0c 08 +vgatherdps ymm1, [rax+ymm1], ymm2 ; c4 e2 6d 92 0c 08 +vgatherdps ymm1, dword [rax+ymm1], ymm2 ; c4 e2 6d 92 0c 08 + +vgatherqps xmm1, [rax+xmm1], xmm2 ; c4 e2 69 93 0c 08 +vgatherqps xmm1, qword [rax+xmm1], xmm2 ; c4 e2 69 93 0c 08 +vgatherqps xmm1, [rax+ymm1], xmm2 ; c4 e2 6d 93 0c 08 +vgatherqps xmm1, qword [rax+ymm1], xmm2 ; c4 e2 6d 93 0c 08 + +vpgatherdd xmm1, [rax+xmm1], xmm2 ; c4 e2 69 90 0c 08 +vpgatherdd xmm1, dword [rax+xmm1], xmm2 ; c4 e2 69 90 0c 08 +vpgatherdd ymm1, [rax+ymm1], ymm2 ; c4 e2 6d 90 0c 08 +vpgatherdd ymm1, dword [rax+ymm1], ymm2 ; c4 e2 6d 90 0c 08 + +vpgatherqd xmm1, [rax+xmm1], xmm2 ; c4 e2 69 91 0c 08 +vpgatherqd xmm1, qword [rax+xmm1], xmm2 ; c4 e2 69 91 0c 08 +vpgatherqd xmm1, [rax+ymm1], xmm2 ; c4 e2 6d 91 0c 08 +vpgatherqd xmm1, qword [rax+ymm1], xmm2 ; c4 e2 6d 91 0c 08 + +vpgatherdq xmm1, [rax+xmm1], xmm2 ; c4 e2 e9 90 0c 08 +vpgatherdq xmm1, dword [rax+xmm1], xmm2 ; c4 e2 e9 90 0c 08 +vpgatherdq ymm1, [rax+xmm1], ymm2 ; c4 e2 ed 90 0c 08 +vpgatherdq ymm1, dword [rax+xmm1], ymm2 ; c4 e2 ed 90 0c 08 + +vpgatherqq xmm1, [rax+xmm1], xmm2 ; c4 e2 e9 91 0c 08 +vpgatherqq xmm1, qword [rax+xmm1], xmm2 ; c4 e2 e9 91 0c 08 +vpgatherqq ymm1, [rax+ymm1], ymm2 ; c4 e2 ed 91 0c 08 +vpgatherqq ymm1, qword [rax+ymm1], ymm2 ; c4 e2 ed 91 0c 08 diff --git a/modules/arch/x86/tests/avx2.hex b/modules/arch/x86/tests/avx2.hex index 3d9e9cd4..17f84bd3 100644 --- a/modules/arch/x86/tests/avx2.hex +++ b/modules/arch/x86/tests/avx2.hex @@ -2103,3 +2103,195 @@ e2 ed 45 08 +c4 +e2 +e9 +92 +0c +08 +c4 +e2 +e9 +92 +0c +08 +c4 +e2 +ed +92 +0c +08 +c4 +e2 +ed +92 +0c +08 +c4 +e2 +e9 +93 +0c +08 +c4 +e2 +e9 +93 +0c +08 +c4 +e2 +ed +93 +0c +08 +c4 +e2 +ed +93 +0c +08 +c4 +e2 +69 +92 +0c +08 +c4 +e2 +69 +92 +0c +08 +c4 +e2 +6d +92 +0c +08 +c4 +e2 +6d +92 +0c +08 +c4 +e2 +69 +93 +0c +08 +c4 +e2 +69 +93 +0c +08 +c4 +e2 +6d +93 +0c +08 +c4 +e2 +6d +93 +0c +08 +c4 +e2 +69 +90 +0c +08 +c4 +e2 +69 +90 +0c +08 +c4 +e2 +6d +90 +0c +08 +c4 +e2 +6d +90 +0c +08 +c4 +e2 +69 +91 +0c +08 +c4 +e2 +69 +91 +0c +08 +c4 +e2 +6d +91 +0c +08 +c4 +e2 +6d +91 +0c +08 +c4 +e2 +e9 +90 +0c +08 +c4 +e2 +e9 +90 +0c +08 +c4 +e2 +ed +90 +0c +08 +c4 +e2 +ed +90 +0c +08 +c4 +e2 +e9 +91 +0c +08 +c4 +e2 +e9 +91 +0c +08 +c4 +e2 +ed +91 +0c +08 +c4 +e2 +ed +91 +0c +08 diff --git a/modules/arch/x86/tests/vsib-err.asm b/modules/arch/x86/tests/vsib-err.asm new file mode 100644 index 00000000..ee306038 --- /dev/null +++ b/modules/arch/x86/tests/vsib-err.asm @@ -0,0 +1,14 @@ +; Errors caught during instruction matching + +[bits 64] + +vpgatherdq xmm0,xmm0,xmm0 ; no reg EA template + +vpgatherdq xmm0,[ymm0],xmm0 ; not a VSIB256 template +vpgatherqq ymm0,[xmm0],ymm0 ; not a VSIB128 template + +vpgatherdq xmm0,[rel 0],xmm0 +vpgatherdq xmm0,[0],xmm0 +vpgatherdq xmm0,[rax],xmm0 +vpgatherdq xmm0,[rax+rbx],xmm0 + diff --git a/modules/arch/x86/tests/vsib-err.errwarn b/modules/arch/x86/tests/vsib-err.errwarn new file mode 100644 index 00000000..8d2d084f --- /dev/null +++ b/modules/arch/x86/tests/vsib-err.errwarn @@ -0,0 +1,7 @@ +-:5: error: invalid combination of opcode and operands +-:7: error: invalid combination of opcode and operands +-:8: error: invalid combination of opcode and operands +-:10: error: invalid combination of opcode and operands +-:11: error: invalid combination of opcode and operands +-:12: error: invalid combination of opcode and operands +-:13: error: invalid combination of opcode and operands diff --git a/modules/arch/x86/tests/vsib.asm b/modules/arch/x86/tests/vsib.asm new file mode 100644 index 00000000..fc2a705b --- /dev/null +++ b/modules/arch/x86/tests/vsib.asm @@ -0,0 +1,114 @@ +[bits 16] +; test promotion to 32-bit address size +vpgatherdq xmm0,[xmm0],xmm0 ; 67 c4 e2 f9 90 04 05 00 00 00 00 +vpgatherqq ymm0,[ymm0],ymm0 ; 67 c4 e2 fd 91 04 05 00 00 00 00 + +[bits 32] +; test promotion from base to index +vpgatherdq xmm0,[xmm0],xmm0 ; c4 e2 f9 90 04 05 00 00 00 00 +vpgatherqq ymm0,[ymm0],ymm0 ; c4 e2 fd 91 04 05 00 00 00 00 + +; various combinations +vpgatherdq xmm0,[ecx+xmm5],xmm0 ; c4 e2 f9 90 04 29 +vpgatherqq ymm0,[ecx+ymm5],ymm0 ; c4 e2 fd 91 04 29 +vpgatherdq xmm0,[ebp+xmm5],xmm0 ; c4 e2 f9 90 44 2d 00 +vpgatherqq ymm0,[ebp+ymm5],ymm0 ; c4 e2 fd 91 44 2d 00 + +vpgatherdq xmm0,[xmm5+ecx],xmm0 ; c4 e2 f9 90 04 29 +vpgatherqq ymm0,[ymm5+ecx],ymm0 ; c4 e2 fd 91 04 29 +vpgatherdq xmm0,[xmm5+ebp],xmm0 ; c4 e2 f9 90 44 2d 00 +vpgatherqq ymm0,[ymm5+ebp],ymm0 ; c4 e2 fd 91 44 2d 00 + +vpgatherdq xmm0,[ecx+xmm5*1],xmm0 ; c4 e2 f9 90 04 29 +vpgatherqq ymm0,[ecx+ymm5*1],ymm0 ; c4 e2 fd 91 04 29 +vpgatherdq xmm0,[ebp+xmm5*1],xmm0 ; c4 e2 f9 90 44 2d 00 +vpgatherqq ymm0,[ebp+ymm5*1],ymm0 ; c4 e2 fd 91 44 2d 00 + +vpgatherdq xmm0,[xmm5+ecx*1],xmm0 ; c4 e2 f9 90 04 29 +vpgatherqq ymm0,[ymm5+ecx*1],ymm0 ; c4 e2 fd 91 04 29 +vpgatherdq xmm0,[xmm5+ebp*1],xmm0 ; c4 e2 f9 90 44 2d 00 +vpgatherqq ymm0,[ymm5+ebp*1],ymm0 ; c4 e2 fd 91 44 2d 00 + +vpgatherdq xmm0,[nosplit 12345678h + xmm5*1],xmm0; c4 e2 f9 90 04 2d 78 56 34 12 +vpgatherqq ymm0,[nosplit 12345678h + ymm5*1],ymm0; c4 e2 fd 91 04 2d 78 56 34 12 + +vpgatherdq xmm0,[byte ecx + 12 + xmm5*2],xmm0 ; c4 e2 f9 90 44 69 0c +vpgatherqq ymm0,[byte ecx + 12 + ymm5*2],ymm0 ; c4 e2 fd 91 44 69 0c +vpgatherdq xmm0,[byte ebp + 12 + xmm5*2],xmm0 ; c4 e2 f9 90 44 6d 0c +vpgatherqq ymm0,[byte ebp + 12 + ymm5*2],ymm0 ; c4 e2 fd 91 44 6d 0c + +vpgatherdq xmm0,[dword ecx + 12 + xmm5*4],xmm0 ; c4 e2 f9 90 84 a9 0c 00 00 00 +vpgatherqq ymm0,[dword ecx + 12 + ymm5*4],ymm0 ; c4 e2 fd 91 84 a9 0c 00 00 00 +vpgatherdq xmm0,[dword ebp + 12 + xmm5*4],xmm0 ; c4 e2 f9 90 84 ad 0c 00 00 00 +vpgatherqq ymm0,[dword ebp + 12 + ymm5*4],ymm0 ; c4 e2 fd 91 84 ad 0c 00 00 00 + +vpgatherdq xmm0,[ecx + 12345678h + xmm5*4],xmm0 ; c4 e2 f9 90 84 a9 78 56 34 12 +vpgatherqq ymm0,[ecx + 12345678h + ymm5*4],ymm0 ; c4 e2 fd 91 84 a9 78 56 34 12 +vpgatherdq xmm0,[ebp + 12345678h + xmm5*4],xmm0 ; c4 e2 f9 90 84 ad 78 56 34 12 +vpgatherqq ymm0,[ebp + 12345678h + ymm5*4],ymm0 ; c4 e2 fd 91 84 ad 78 56 34 12 + +vpgatherdq xmm0,[ecx + 12 + xmm5*4],xmm0 ; c4 e2 f9 90 44 a9 0c +vpgatherqq ymm0,[ecx + 12 + ymm5*4],ymm0 ; c4 e2 fd 91 44 a9 0c +vpgatherdq xmm0,[ebp + 12 + xmm5*4],xmm0 ; c4 e2 f9 90 44 ad 0c +vpgatherqq ymm0,[ebp + 12 + ymm5*4],ymm0 ; c4 e2 fd 91 44 ad 0c + +vpgatherdq xmm0,[dword 12 + xmm5*8],xmm0 ; c4 e2 f9 90 04 ed 0c 00 00 00 +vpgatherqq ymm0,[dword 12 + ymm5*8],ymm0 ; c4 e2 fd 91 04 ed 0c 00 00 00 +vpgatherdq xmm0,[12 + xmm5*8],xmm0 ; c4 e2 f9 90 04 ed 0c 00 00 00 +vpgatherqq ymm0,[12 + ymm5*8],ymm0 ; c4 e2 fd 91 04 ed 0c 00 00 00 + +[bits 64] +; test promotion from base to index +vpgatherdq xmm0,[xmm0],xmm0 ; c4 e2 f9 90 04 05 00 00 00 00 +vpgatherqq ymm0,[ymm0],ymm0 ; c4 e2 fd 91 04 05 00 00 00 00 + +; various combinations +vpgatherdq xmm0,[rcx+xmm5],xmm0 ; c4 e2 f9 90 04 29 +vpgatherqq ymm0,[rcx+ymm13],ymm0 ; c4 a2 fd 91 04 29 +vpgatherdq xmm0,[r13+xmm13],xmm0 ; c4 82 f9 90 44 2d 00 +vpgatherqq ymm0,[r13+ymm5],ymm0 ; c4 c2 fd 91 44 2d 00 + +vpgatherdq xmm0,[xmm5+rcx],xmm0 ; c4 e2 f9 90 04 29 +vpgatherqq ymm0,[ymm13+rcx],ymm0 ; c4 a2 fd 91 04 29 +vpgatherdq xmm0,[xmm13+r13],xmm0 ; c4 82 f9 90 44 2d 00 +vpgatherqq ymm0,[ymm5+r13],ymm0 ; c4 c2 fd 91 44 2d 00 + +vpgatherdq xmm0,[rcx+xmm5*1],xmm0 ; c4 e2 f9 90 04 29 +vpgatherqq ymm0,[rcx+ymm13*1],ymm0 ; c4 a2 fd 91 04 29 +vpgatherdq xmm0,[r13+xmm13*1],xmm0 ; c4 82 f9 90 44 2d 00 +vpgatherqq ymm0,[r13+ymm5*1],ymm0 ; c4 c2 fd 91 44 2d 00 + +vpgatherdq xmm0,[xmm5+rcx*1],xmm0 ; c4 e2 f9 90 04 29 +vpgatherqq ymm0,[ymm13+rcx*1],ymm0 ; c4 a2 fd 91 04 29 +vpgatherdq xmm0,[xmm13+r13*1],xmm0 ; c4 82 f9 90 44 2d 00 +vpgatherqq ymm0,[ymm5+r13*1],ymm0 ; c4 c2 fd 91 44 2d 00 + +vpgatherdq xmm0,[nosplit 12345678h + xmm5*1],xmm0; c4 e2 f9 90 04 2d 78 56 34 12 +vpgatherqq ymm0,[nosplit 12345678h + ymm5*1],ymm0; c4 e2 fd 91 04 2d 78 56 34 12 + +vpgatherdq xmm0,[byte rcx + 12 + xmm5*2],xmm0 ; c4 e2 f9 90 44 69 0c +vpgatherqq ymm0,[byte rcx + 12 + ymm13*2],ymm0 ; c4 a2 fd 91 44 69 0c +vpgatherdq xmm0,[byte r13 + 12 + xmm13*2],xmm0 ; c4 82 f9 90 44 6d 0c +vpgatherqq ymm0,[byte r13 + 12 + ymm5*2],ymm0 ; c4 c2 fd 91 44 6d 0c + +vpgatherdq xmm0,[dword rcx + 12 + xmm5*4],xmm0 ; c4 e2 f9 90 84 a9 0c 00 00 00 +vpgatherqq ymm0,[dword rcx + 12 + ymm13*4],ymm0 ; c4 a2 fd 91 84 a9 0c 00 00 00 +vpgatherdq xmm0,[dword r13 + 12 + xmm13*4],xmm0 ; c4 82 f9 90 84 ad 0c 00 00 00 +vpgatherqq ymm0,[dword r13 + 12 + ymm5*4],ymm0 ; c4 c2 fd 91 84 ad 0c 00 00 00 + +vpgatherdq xmm0,[rcx + 12345678h + xmm5*4],xmm0 ; c4 e2 f9 90 84 a9 78 56 34 12 +vpgatherqq ymm0,[rcx + 12345678h + ymm13*4],ymm0; c4 a2 fd 91 84 a9 78 56 34 12 +vpgatherdq xmm0,[r13 + 12345678h + xmm13*4],xmm0; c4 82 f9 90 84 ad 78 56 34 12 +vpgatherqq ymm0,[r13 + 12345678h + ymm5*4],ymm0 ; c4 c2 fd 91 84 ad 78 56 34 12 + +vpgatherdq xmm0,[rcx + 12 + xmm5*4],xmm0 ; c4 e2 f9 90 44 a9 0c +vpgatherqq ymm0,[rcx + 12 + ymm13*4],ymm0 ; c4 a2 fd 91 44 a9 0c +vpgatherdq xmm0,[r13 + 12 + xmm13*4],xmm0 ; c4 82 f9 90 44 ad 0c +vpgatherqq ymm0,[r13 + 12 + ymm5*4],ymm0 ; c4 c2 fd 91 44 ad 0c + +vpgatherdq xmm0,[dword 12 + xmm5*8],xmm0 ; c4 e2 f9 90 04 ed 0c 00 00 00 +vpgatherqq ymm0,[dword 12 + ymm13*8],ymm0 ; c4 a2 fd 91 04 ed 0c 00 00 00 +vpgatherdq xmm0,[12 + xmm13*8],xmm0 ; c4 a2 f9 90 04 ed 0c 00 00 00 +vpgatherqq ymm0,[12 + ymm5*8],ymm0 ; c4 e2 fd 91 04 ed 0c 00 00 00 + + diff --git a/modules/arch/x86/tests/vsib.hex b/modules/arch/x86/tests/vsib.hex new file mode 100644 index 00000000..7dfde886 --- /dev/null +++ b/modules/arch/x86/tests/vsib.hex @@ -0,0 +1,662 @@ +67 +c4 +e2 +f9 +90 +04 +05 +00 +00 +00 +00 +67 +c4 +e2 +fd +91 +04 +05 +00 +00 +00 +00 +c4 +e2 +f9 +90 +04 +05 +00 +00 +00 +00 +c4 +e2 +fd +91 +04 +05 +00 +00 +00 +00 +c4 +e2 +f9 +90 +04 +29 +c4 +e2 +fd +91 +04 +29 +c4 +e2 +f9 +90 +44 +2d +00 +c4 +e2 +fd +91 +44 +2d +00 +c4 +e2 +f9 +90 +04 +29 +c4 +e2 +fd +91 +04 +29 +c4 +e2 +f9 +90 +44 +2d +00 +c4 +e2 +fd +91 +44 +2d +00 +c4 +e2 +f9 +90 +04 +29 +c4 +e2 +fd +91 +04 +29 +c4 +e2 +f9 +90 +44 +2d +00 +c4 +e2 +fd +91 +44 +2d +00 +c4 +e2 +f9 +90 +04 +29 +c4 +e2 +fd +91 +04 +29 +c4 +e2 +f9 +90 +44 +2d +00 +c4 +e2 +fd +91 +44 +2d +00 +c4 +e2 +f9 +90 +04 +2d +78 +56 +34 +12 +c4 +e2 +fd +91 +04 +2d +78 +56 +34 +12 +c4 +e2 +f9 +90 +44 +69 +0c +c4 +e2 +fd +91 +44 +69 +0c +c4 +e2 +f9 +90 +44 +6d +0c +c4 +e2 +fd +91 +44 +6d +0c +c4 +e2 +f9 +90 +84 +a9 +0c +00 +00 +00 +c4 +e2 +fd +91 +84 +a9 +0c +00 +00 +00 +c4 +e2 +f9 +90 +84 +ad +0c +00 +00 +00 +c4 +e2 +fd +91 +84 +ad +0c +00 +00 +00 +c4 +e2 +f9 +90 +84 +a9 +78 +56 +34 +12 +c4 +e2 +fd +91 +84 +a9 +78 +56 +34 +12 +c4 +e2 +f9 +90 +84 +ad +78 +56 +34 +12 +c4 +e2 +fd +91 +84 +ad +78 +56 +34 +12 +c4 +e2 +f9 +90 +44 +a9 +0c +c4 +e2 +fd +91 +44 +a9 +0c +c4 +e2 +f9 +90 +44 +ad +0c +c4 +e2 +fd +91 +44 +ad +0c +c4 +e2 +f9 +90 +04 +ed +0c +00 +00 +00 +c4 +e2 +fd +91 +04 +ed +0c +00 +00 +00 +c4 +e2 +f9 +90 +04 +ed +0c +00 +00 +00 +c4 +e2 +fd +91 +04 +ed +0c +00 +00 +00 +c4 +e2 +f9 +90 +04 +05 +00 +00 +00 +00 +c4 +e2 +fd +91 +04 +05 +00 +00 +00 +00 +c4 +e2 +f9 +90 +04 +29 +c4 +a2 +fd +91 +04 +29 +c4 +82 +f9 +90 +44 +2d +00 +c4 +c2 +fd +91 +44 +2d +00 +c4 +e2 +f9 +90 +04 +29 +c4 +a2 +fd +91 +04 +29 +c4 +82 +f9 +90 +44 +2d +00 +c4 +c2 +fd +91 +44 +2d +00 +c4 +e2 +f9 +90 +04 +29 +c4 +a2 +fd +91 +04 +29 +c4 +82 +f9 +90 +44 +2d +00 +c4 +c2 +fd +91 +44 +2d +00 +c4 +e2 +f9 +90 +04 +29 +c4 +a2 +fd +91 +04 +29 +c4 +82 +f9 +90 +44 +2d +00 +c4 +c2 +fd +91 +44 +2d +00 +c4 +e2 +f9 +90 +04 +2d +78 +56 +34 +12 +c4 +e2 +fd +91 +04 +2d +78 +56 +34 +12 +c4 +e2 +f9 +90 +44 +69 +0c +c4 +a2 +fd +91 +44 +69 +0c +c4 +82 +f9 +90 +44 +6d +0c +c4 +c2 +fd +91 +44 +6d +0c +c4 +e2 +f9 +90 +84 +a9 +0c +00 +00 +00 +c4 +a2 +fd +91 +84 +a9 +0c +00 +00 +00 +c4 +82 +f9 +90 +84 +ad +0c +00 +00 +00 +c4 +c2 +fd +91 +84 +ad +0c +00 +00 +00 +c4 +e2 +f9 +90 +84 +a9 +78 +56 +34 +12 +c4 +a2 +fd +91 +84 +a9 +78 +56 +34 +12 +c4 +82 +f9 +90 +84 +ad +78 +56 +34 +12 +c4 +c2 +fd +91 +84 +ad +78 +56 +34 +12 +c4 +e2 +f9 +90 +44 +a9 +0c +c4 +a2 +fd +91 +44 +a9 +0c +c4 +82 +f9 +90 +44 +ad +0c +c4 +c2 +fd +91 +44 +ad +0c +c4 +e2 +f9 +90 +04 +ed +0c +00 +00 +00 +c4 +a2 +fd +91 +04 +ed +0c +00 +00 +00 +c4 +a2 +f9 +90 +04 +ed +0c +00 +00 +00 +c4 +e2 +fd +91 +04 +ed +0c +00 +00 +00 diff --git a/modules/arch/x86/tests/vsib2-err.asm b/modules/arch/x86/tests/vsib2-err.asm new file mode 100644 index 00000000..7e3ac55e --- /dev/null +++ b/modules/arch/x86/tests/vsib2-err.asm @@ -0,0 +1,19 @@ +; Errors caught during EA checking + +[bits 32] +vpgatherqq ymm0,[ymm0+ecx*2],ymm0 + +[bits 64] +addpd xmm0,[xmm0] ; not a VSIB128 template +addpd xmm0,[ymm0] ; not a VSIB256 template + +[bits 32] +vpgatherdq xmm0,[bp+xmm0],xmm0 + +vpgatherdq xmm0,[xmm0+ymm0],xmm0 + +vpgatherqq ymm0,[word ymm0],ymm0 + +vpgatherqq ymm0,[byte ymm0],ymm0 + + diff --git a/modules/arch/x86/tests/vsib2-err.errwarn b/modules/arch/x86/tests/vsib2-err.errwarn new file mode 100644 index 00000000..877ce62e --- /dev/null +++ b/modules/arch/x86/tests/vsib2-err.errwarn @@ -0,0 +1,7 @@ +-:4: error: invalid effective address +-:7: error: invalid effective address +-:8: error: invalid effective address +-:11: error: invalid effective address +-:13: error: invalid effective address +-:15: error: invalid effective address +-:17: warning: invalid displacement size; fixed diff --git a/modules/arch/x86/x86arch.h b/modules/arch/x86/x86arch.h index 8e7caf82..c46ea5b8 100644 --- a/modules/arch/x86/x86arch.h +++ b/modules/arch/x86/x86arch.h @@ -177,6 +177,9 @@ int yasm_x86__set_rex_from_reg(unsigned char *rex, unsigned char *low3, typedef struct x86_effaddr { yasm_effaddr ea; /* base structure */ + /* VSIB uses the normal SIB byte, but this flag enables it. */ + unsigned char vsib_mode; /* 0 if not, 1 if XMM, 2 if YMM */ + /* How the spare (register) bits in Mod/RM are handled: * Even if valid_modrm=0, the spare bits are still valid (don't overwrite!) * They're set in bytecode_create_insn(). diff --git a/modules/arch/x86/x86bc.c b/modules/arch/x86/x86bc.c index 49df4f8f..8666943e 100644 --- a/modules/arch/x86/x86bc.c +++ b/modules/arch/x86/x86bc.c @@ -191,6 +191,7 @@ ea_create(void) x86_ea->ea.pc_rel = 0; x86_ea->ea.not_pc_rel = 0; x86_ea->ea.data_len = 0; + x86_ea->vsib_mode = 0; x86_ea->modrm = 0; x86_ea->valid_modrm = 0; x86_ea->need_modrm = 0; @@ -382,6 +383,8 @@ yasm_x86__ea_print(const yasm_effaddr *ea, FILE *f, int indent_level) fprintf(f, "%*sNoSplit=%u\n", indent_level, "", (unsigned int)ea->nosplit); fprintf(f, "%*sSegmentOv=%02x\n", indent_level, "", (unsigned int)x86_ea->ea.segreg); + fprintf(f, "%*sVSIBMode=%u\n", indent_level, "", + (unsigned int)x86_ea->vsib_mode); fprintf(f, "%*sModRM=%03o ValidRM=%u NeedRM=%u\n", indent_level, "", (unsigned int)x86_ea->modrm, (unsigned int)x86_ea->valid_modrm, (unsigned int)x86_ea->need_modrm); diff --git a/modules/arch/x86/x86expr.c b/modules/arch/x86/x86expr.c index 814a9b2a..cacf827a 100644 --- a/modules/arch/x86/x86expr.c +++ b/modules/arch/x86/x86expr.c @@ -34,6 +34,7 @@ typedef struct x86_checkea_reg3264_data { int *regs; /* total multiplier for each reg */ + unsigned char vsib_mode; unsigned char bits; unsigned char addrsize; } x86_checkea_reg3264_data; @@ -58,6 +59,20 @@ x86_expr_checkea_get_reg3264(yasm_expr__item *ei, int *regnum, return 0; *regnum = (unsigned int)(ei->data.reg & 0xF); break; + case X86_XMMREG: + if (data->vsib_mode != 1) + return 0; + if (data->bits != 64 && (ei->data.reg & 0x8) == 0x8) + return 0; + *regnum = 17+(unsigned int)(ei->data.reg & 0xF); + break; + case X86_YMMREG: + if (data->vsib_mode != 2) + return 0; + if (data->bits != 64 && (ei->data.reg & 0x8) == 0x8) + return 0; + *regnum = 17+(unsigned int)(ei->data.reg & 0xF); + break; case X86_RIP: if (data->bits != 64) return 0; @@ -606,6 +621,11 @@ yasm_x86__expr_checkea(x86_effaddr *x86_ea, unsigned char *addrsize, } /*@fallthrough@*/ default: + /* If SIB is required, but we're in 16-bit mode, set to 32. */ + if (bits == 16 && x86_ea->need_sib == 1) { + *addrsize = 32; + break; + } /* check for use of 16 or 32-bit registers; if none are used * default to bits setting. */ @@ -643,13 +663,19 @@ yasm_x86__expr_checkea(x86_effaddr *x86_ea, unsigned char *addrsize, REG64_R13, REG64_R14, REG64_R15, - REG64_RIP + REG64_RIP, + SIMDREGS } reg3264type; - int reg3264mult[17] = {0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0}; + int reg3264mult[33] = + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; x86_checkea_reg3264_data reg3264_data; int basereg = REG3264_NONE; /* "base" register (for SIB) */ int indexreg = REG3264_NONE; /* "index" register (for SIB) */ + int regcount = 17; /* normally don't check SIMD regs */ + + if (x86_ea->vsib_mode != 0) + regcount = 33; /* We can only do 64-bit addresses in 64-bit mode. */ if (*addrsize == 64 && bits != 64) { @@ -665,6 +691,7 @@ yasm_x86__expr_checkea(x86_effaddr *x86_ea, unsigned char *addrsize, } reg3264_data.regs = reg3264mult; + reg3264_data.vsib_mode = x86_ea->vsib_mode; reg3264_data.bits = bits; reg3264_data.addrsize = *addrsize; if (x86_ea->ea.disp.abs) { @@ -698,7 +725,7 @@ yasm_x86__expr_checkea(x86_effaddr *x86_ea, unsigned char *addrsize, * Also, if an indexreg hasn't been assigned, try to find one. * Meanwhile, check to make sure there's no negative register mults. */ - for (i=0; i<17; i++) { + for (i=0; ivsib_mode != 0) { + /* For VSIB, the SIMD register needs to go into the indexreg. + * Also check basereg (must be a GPR if present) and indexreg + * (must be a SIMD register). + */ + if (basereg >= SIMDREGS && + (indexreg == REG3264_NONE || reg3264mult[indexreg] == 1)) { + int temp = basereg; + basereg = indexreg; + indexreg = temp; + } + if (basereg >= REG64_RIP || indexreg < SIMDREGS) { + yasm_error_set(YASM_ERROR_VALUE, + N_("invalid effective address")); + return 1; + } + } else if (indexreg != REG3264_NONE && basereg == REG3264_NONE) + /* Handle certain special cases of indexreg mults when basereg is + * empty. + */ switch (reg3264mult[indexreg]) { case 1: /* Only optimize this way if nosplit wasn't specified */ @@ -741,7 +784,7 @@ yasm_x86__expr_checkea(x86_effaddr *x86_ea, unsigned char *addrsize, /* Make sure there's no other registers than the basereg and indexreg * we just found. */ - for (i=0; i<17; i++) + for (i=0; isib |= 040; /* Any scale field is valid, just leave at 0. */ else { - if (yasm_x86__set_rex_from_reg(rex, &low3, (unsigned int) - (X86_REG64 | indexreg), bits, - X86_REX_X)) - return 1; + if (indexreg >= SIMDREGS) { + if (yasm_x86__set_rex_from_reg(rex, &low3, + (unsigned int)(X86_XMMREG | (indexreg-SIMDREGS)), + bits, X86_REX_X)) + return 1; + } else { + if (yasm_x86__set_rex_from_reg(rex, &low3, + (unsigned int)(X86_REG64 | indexreg), + bits, X86_REX_X)) + return 1; + } x86_ea->sib |= low3 << 3; /* Set scale field, 1 case -> 0, so don't bother. */ switch (reg3264mult[indexreg]) { diff --git a/modules/arch/x86/x86id.c b/modules/arch/x86/x86id.c index c734d335..0e8a5be9 100644 --- a/modules/arch/x86/x86id.c +++ b/modules/arch/x86/x86id.c @@ -111,7 +111,11 @@ enum x86_operand_type { */ OPT_MemrAX = 25, /* EAX memory operand only (EA) [special case for SVM skinit opcode] */ - OPT_MemEAX = 26 + OPT_MemEAX = 26, + /* XMM VSIB memory operand */ + OPT_MemXMMIndex = 27, + /* YMM VSIB memory operand */ + OPT_MemYMMIndex = 28 }; enum x86_operand_size { @@ -347,6 +351,37 @@ static const yasm_bytecode_callback x86_id_insn_callback = { #include "x86insns.c" +/* Looks for the first SIMD register match for the purposes of VSIB matching. + * Full legality checking is performed in EA code. + */ +static int +x86_expr_contains_simd_cb(const yasm_expr__item *ei, void *d) +{ + int ymm = *((int *)d); + if (ei->type != YASM_EXPR_REG) + return 0; + switch ((x86_expritem_reg_size)(ei->data.reg & ~0xFUL)) { + case X86_XMMREG: + if (!ymm) + return 1; + break; + case X86_YMMREG: + if (ymm) + return 1; + break; + default: + break; + } + return 0; +} + +static int +x86_expr_contains_simd(const yasm_expr *e, int ymm) +{ + return yasm_expr__traverse_leaves_in_const(e, &ymm, + x86_expr_contains_simd_cb); +} + static void x86_finalize_common(x86_common *common, const x86_insn_info *info, unsigned int mode_bits) @@ -851,6 +886,16 @@ x86_find_match(x86_id_insn *id_insn, yasm_insn_operand **ops, mismatch = 1; break; } + case OPT_MemXMMIndex: + if (op->type != YASM_INSN__OPERAND_MEMORY || + !x86_expr_contains_simd(op->data.ea->disp.abs, 0)) + mismatch = 1; + break; + case OPT_MemYMMIndex: + if (op->type != YASM_INSN__OPERAND_MEMORY || + !x86_expr_contains_simd(op->data.ea->disp.abs, 1)) + mismatch = 1; + break; default: yasm_internal_error(N_("invalid operand type")); } @@ -1231,12 +1276,20 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) if (info_ops[i].type == OPT_MemOffs) /* Special-case for MOV MemOffs instruction */ yasm_x86__ea_set_disponly(insn->x86_ea); - else if (id_insn->default_rel && - !op->data.ea->not_pc_rel && - op->data.ea->segreg != 0x6404 && - op->data.ea->segreg != 0x6505 && - !yasm_expr__contains( - op->data.ea->disp.abs, YASM_EXPR_REG)) + else if (info_ops[i].type == OPT_MemXMMIndex) { + /* Remember VSIB mode */ + insn->x86_ea->vsib_mode = 1; + insn->x86_ea->need_sib = 1; + } else if (info_ops[i].type == OPT_MemYMMIndex) { + /* Remember VSIB mode */ + insn->x86_ea->vsib_mode = 2; + insn->x86_ea->need_sib = 1; + } else if (id_insn->default_rel && + !op->data.ea->not_pc_rel && + op->data.ea->segreg != 0x6404 && + op->data.ea->segreg != 0x6505 && + !yasm_expr__contains( + op->data.ea->disp.abs, YASM_EXPR_REG)) /* Enable default PC-rel if no regs and segreg * is not FS or GS. */ From 3b65acb39d1eae22ecaf9f4286b9ea0f9a6fae93 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Mon, 4 Jul 2011 11:35:19 -0700 Subject: [PATCH 415/585] Fix VGATHER/VPGATHER memory sizes. These now match the memory fetch sizes in the AVX reference. Reported by: nasm64developer --- modules/arch/x86/gen_x86_insn.py | 24 ++++++++++++------------ modules/arch/x86/tests/avx2.asm | 16 ++++++++-------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index 985b3733..fdfe31d7 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -7028,7 +7028,7 @@ for sz in [128, 256]: add_insn("vpblendd", "vex_66_0F3A_imm8_avx2", modifiers=[0x02]) # Vector register in EA. -add_group("gather_32x_32x", +add_group("gather_64x_64x", cpu=["AVX2"], modifiers=["Op2Add"], vex=128, @@ -7036,9 +7036,9 @@ add_group("gather_32x_32x", prefix=0x66, opcode=[0x0F, 0x38, 0x00], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="MemXMMIndex", size=32, relaxed=True, dest="EA"), + Operand(type="MemXMMIndex", size=64, relaxed=True, dest="EA"), Operand(type="SIMDReg", size=128, dest="VEX")]) -add_group("gather_32x_32x", +add_group("gather_64x_64x", cpu=["AVX2"], modifiers=["Op2Add"], vex=256, @@ -7046,10 +7046,10 @@ add_group("gather_32x_32x", prefix=0x66, opcode=[0x0F, 0x38, 0x00], operands=[Operand(type="SIMDReg", size=256, dest="Spare"), - Operand(type="MemXMMIndex", size=32, relaxed=True, dest="EA"), + Operand(type="MemXMMIndex", size=64, relaxed=True, dest="EA"), Operand(type="SIMDReg", size=256, dest="VEX")]) -add_insn("vgatherdpd", "gather_32x_32x", modifiers=[0x92]) -add_insn("vpgatherdq", "gather_32x_32x", modifiers=[0x90]) +add_insn("vgatherdpd", "gather_64x_64x", modifiers=[0x92]) +add_insn("vpgatherdq", "gather_64x_64x", modifiers=[0x90]) add_group("gather_64x_64y", cpu=["AVX2"], @@ -7097,7 +7097,7 @@ add_group("gather_32x_32y", add_insn("vgatherdps", "gather_32x_32y", modifiers=[0x92]) add_insn("vpgatherdd", "gather_32x_32y", modifiers=[0x90]) -add_group("gather_64x_64y_128", +add_group("gather_32x_32y_128", cpu=["AVX2"], modifiers=["Op2Add"], vex=128, @@ -7105,9 +7105,9 @@ add_group("gather_64x_64y_128", prefix=0x66, opcode=[0x0F, 0x38, 0x00], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="MemXMMIndex", size=64, relaxed=True, dest="EA"), + Operand(type="MemXMMIndex", size=32, relaxed=True, dest="EA"), Operand(type="SIMDReg", size=128, dest="VEX")]) -add_group("gather_64x_64y_128", +add_group("gather_32x_32y_128", cpu=["AVX2"], modifiers=["Op2Add"], vex=256, @@ -7115,10 +7115,10 @@ add_group("gather_64x_64y_128", prefix=0x66, opcode=[0x0F, 0x38, 0x00], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="MemYMMIndex", size=64, relaxed=True, dest="EA"), + Operand(type="MemYMMIndex", size=32, relaxed=True, dest="EA"), Operand(type="SIMDReg", size=128, dest="VEX")]) -add_insn("vgatherqps", "gather_64x_64y_128", modifiers=[0x93]) -add_insn("vpgatherqd", "gather_64x_64y_128", modifiers=[0x91]) +add_insn("vgatherqps", "gather_32x_32y_128", modifiers=[0x93]) +add_insn("vpgatherqd", "gather_32x_32y_128", modifiers=[0x91]) ##################################################################### # Intel FMA instructions diff --git a/modules/arch/x86/tests/avx2.asm b/modules/arch/x86/tests/avx2.asm index 2806d23c..e76016ca 100644 --- a/modules/arch/x86/tests/avx2.asm +++ b/modules/arch/x86/tests/avx2.asm @@ -612,9 +612,9 @@ vpsrlvq ymm1, ymm2, ymm3 ; c4 e2 ed 45 cb vpsrlvq ymm1, ymm2, yword [rax] ; c4 e2 ed 45 08 vgatherdpd xmm1, [rax+xmm1], xmm2 ; c4 e2 e9 92 0c 08 -vgatherdpd xmm1, dword [rax+xmm1], xmm2 ; c4 e2 e9 92 0c 08 +vgatherdpd xmm1, qword [rax+xmm1], xmm2 ; c4 e2 e9 92 0c 08 vgatherdpd ymm1, [rax+xmm1], ymm2 ; c4 e2 ed 92 0c 08 -vgatherdpd ymm1, dword [rax+xmm1], ymm2 ; c4 e2 ed 92 0c 08 +vgatherdpd ymm1, qword [rax+xmm1], ymm2 ; c4 e2 ed 92 0c 08 vgatherqpd xmm1, [rax+xmm1], xmm2 ; c4 e2 e9 93 0c 08 vgatherqpd xmm1, qword [rax+xmm1], xmm2 ; c4 e2 e9 93 0c 08 @@ -627,9 +627,9 @@ vgatherdps ymm1, [rax+ymm1], ymm2 ; c4 e2 6d 92 0c 08 vgatherdps ymm1, dword [rax+ymm1], ymm2 ; c4 e2 6d 92 0c 08 vgatherqps xmm1, [rax+xmm1], xmm2 ; c4 e2 69 93 0c 08 -vgatherqps xmm1, qword [rax+xmm1], xmm2 ; c4 e2 69 93 0c 08 +vgatherqps xmm1, dword [rax+xmm1], xmm2 ; c4 e2 69 93 0c 08 vgatherqps xmm1, [rax+ymm1], xmm2 ; c4 e2 6d 93 0c 08 -vgatherqps xmm1, qword [rax+ymm1], xmm2 ; c4 e2 6d 93 0c 08 +vgatherqps xmm1, dword [rax+ymm1], xmm2 ; c4 e2 6d 93 0c 08 vpgatherdd xmm1, [rax+xmm1], xmm2 ; c4 e2 69 90 0c 08 vpgatherdd xmm1, dword [rax+xmm1], xmm2 ; c4 e2 69 90 0c 08 @@ -637,14 +637,14 @@ vpgatherdd ymm1, [rax+ymm1], ymm2 ; c4 e2 6d 90 0c 08 vpgatherdd ymm1, dword [rax+ymm1], ymm2 ; c4 e2 6d 90 0c 08 vpgatherqd xmm1, [rax+xmm1], xmm2 ; c4 e2 69 91 0c 08 -vpgatherqd xmm1, qword [rax+xmm1], xmm2 ; c4 e2 69 91 0c 08 +vpgatherqd xmm1, dword [rax+xmm1], xmm2 ; c4 e2 69 91 0c 08 vpgatherqd xmm1, [rax+ymm1], xmm2 ; c4 e2 6d 91 0c 08 -vpgatherqd xmm1, qword [rax+ymm1], xmm2 ; c4 e2 6d 91 0c 08 +vpgatherqd xmm1, dword [rax+ymm1], xmm2 ; c4 e2 6d 91 0c 08 vpgatherdq xmm1, [rax+xmm1], xmm2 ; c4 e2 e9 90 0c 08 -vpgatherdq xmm1, dword [rax+xmm1], xmm2 ; c4 e2 e9 90 0c 08 +vpgatherdq xmm1, qword [rax+xmm1], xmm2 ; c4 e2 e9 90 0c 08 vpgatherdq ymm1, [rax+xmm1], ymm2 ; c4 e2 ed 90 0c 08 -vpgatherdq ymm1, dword [rax+xmm1], ymm2 ; c4 e2 ed 90 0c 08 +vpgatherdq ymm1, qword [rax+xmm1], ymm2 ; c4 e2 ed 90 0c 08 vpgatherqq xmm1, [rax+xmm1], xmm2 ; c4 e2 e9 91 0c 08 vpgatherqq xmm1, qword [rax+xmm1], xmm2 ; c4 e2 e9 91 0c 08 From bd8401d5381bd47d61b901e7e7d111348db66cea Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 10 Jul 2011 23:44:18 -0700 Subject: [PATCH 416/585] expr_simplify_identity: Pass int_term via pointer. This allows signaling to the caller (expr_level_op) that the int_term was destroyed. Without this, the new expr-simplify-identity testcase has a use-after-free. [#232 state:resolved] --- libyasm/expr.c | 37 ++++++++++++------------ libyasm/tests/Makefile.inc | 2 ++ libyasm/tests/expr-simplify-identity.asm | 4 +++ libyasm/tests/expr-simplify-identity.hex | 13 +++++++++ 4 files changed, 38 insertions(+), 18 deletions(-) create mode 100644 libyasm/tests/expr-simplify-identity.asm create mode 100644 libyasm/tests/expr-simplify-identity.hex diff --git a/libyasm/expr.c b/libyasm/expr.c index a067229b..0c777403 100644 --- a/libyasm/expr.c +++ b/libyasm/expr.c @@ -535,7 +535,7 @@ expr_can_destroy_int_right(yasm_expr_op op, yasm_intnum *intn) * NOTE: Really designed to only be used by expr_level_op(). */ static int -expr_simplify_identity(yasm_expr *e, int numterms, int int_term, +expr_simplify_identity(yasm_expr *e, int numterms, int *int_term, int simplify_reg_mul) { int i; @@ -547,26 +547,27 @@ expr_simplify_identity(yasm_expr *e, int numterms, int int_term, save_numterms = e->numterms; e->numterms = numterms; if (simplify_reg_mul || e->op != YASM_EXPR_MUL - || !yasm_intnum_is_pos1(e->terms[int_term].data.intn) + || !yasm_intnum_is_pos1(e->terms[*int_term].data.intn) || !yasm_expr__contains(e, YASM_EXPR_REG)) { /* Check for simple identities that delete the intnum. * Don't delete if the intnum is the only thing in the expn. */ - if ((int_term == 0 && numterms > 1 && + if ((*int_term == 0 && numterms > 1 && expr_can_destroy_int_left(e->op, e->terms[0].data.intn)) || - (int_term > 0 && - expr_can_destroy_int_right(e->op, e->terms[int_term].data.intn))) { + (*int_term > 0 && + expr_can_destroy_int_right(e->op, + e->terms[*int_term].data.intn))) { /* Delete the intnum */ - yasm_intnum_destroy(e->terms[int_term].data.intn); + yasm_intnum_destroy(e->terms[*int_term].data.intn); /* Slide everything to its right over by 1 */ - if (int_term != numterms-1) /* if it wasn't last.. */ - memmove(&e->terms[int_term], &e->terms[int_term+1], - (numterms-1-int_term)*sizeof(yasm_expr__item)); + if (*int_term != numterms-1) /* if it wasn't last.. */ + memmove(&e->terms[*int_term], &e->terms[*int_term+1], + (numterms-1-*int_term)*sizeof(yasm_expr__item)); /* Update numterms */ numterms--; - int_term = -1; /* no longer an int term */ + *int_term = -1; /* no longer an int term */ } } e->numterms = save_numterms; @@ -574,23 +575,23 @@ expr_simplify_identity(yasm_expr *e, int numterms, int int_term, /* Check for simple identites that delete everything BUT the intnum. * Don't bother if the intnum is the only thing in the expn. */ - if (numterms > 1 && int_term != -1 && - expr_is_constant(e->op, e->terms[int_term].data.intn)) { + if (numterms > 1 && *int_term != -1 && + expr_is_constant(e->op, e->terms[*int_term].data.intn)) { /* Loop through, deleting everything but the integer term */ for (i=0; inumterms; i++) - if (i != int_term) + if (i != *int_term) expr_delete_term(&e->terms[i], 1); /* Move integer term to the first term (if not already there) */ - if (int_term != 0) - e->terms[0] = e->terms[int_term]; /* structure copy */ + if (*int_term != 0) + e->terms[0] = e->terms[*int_term]; /* structure copy */ /* Set numterms to 1 */ numterms = 1; } /* Compute NOT, NEG, and LNOT on single intnum. */ - if (numterms == 1 && int_term == 0 && + if (numterms == 1 && *int_term == 0 && (e->op == YASM_EXPR_NOT || e->op == YASM_EXPR_NEG || e->op == YASM_EXPR_LNOT)) yasm_intnum_calc(e->terms[0].data.intn, e->op, NULL); @@ -698,7 +699,7 @@ expr_level_op(/*@returned@*/ /*@only@*/ yasm_expr *e, int fold_const, int new_fold_numterms; /* Simplify identities and make IDENT if possible. */ new_fold_numterms = - expr_simplify_identity(e, fold_numterms, first_int_term, + expr_simplify_identity(e, fold_numterms, &first_int_term, simplify_reg_mul); level_numterms -= fold_numterms-new_fold_numterms; fold_numterms = new_fold_numterms; @@ -789,7 +790,7 @@ expr_level_op(/*@returned@*/ /*@only@*/ yasm_expr *e, int fold_const, /* Simplify identities, make IDENT if possible, and save to e->numterms. */ if (simplify_ident && first_int_term != -1) { e->numterms = expr_simplify_identity(e, level_numterms, - first_int_term, simplify_reg_mul); + &first_int_term, simplify_reg_mul); } else { e->numterms = level_numterms; if (level_numterms == 1) diff --git a/libyasm/tests/Makefile.inc b/libyasm/tests/Makefile.inc index 005fbbc5..13460c01 100644 --- a/libyasm/tests/Makefile.inc +++ b/libyasm/tests/Makefile.inc @@ -25,6 +25,8 @@ EXTRA_DIST += libyasm/tests/equ-expand.asm EXTRA_DIST += libyasm/tests/equ-expand.hex EXTRA_DIST += libyasm/tests/expr-fold-level.asm EXTRA_DIST += libyasm/tests/expr-fold-level.hex +EXTRA_DIST += libyasm/tests/expr-simplify-identity.asm +EXTRA_DIST += libyasm/tests/expr-simplify-identity.hex EXTRA_DIST += libyasm/tests/expr-wide-ident.asm EXTRA_DIST += libyasm/tests/expr-wide-ident.hex EXTRA_DIST += libyasm/tests/externdef.asm diff --git a/libyasm/tests/expr-simplify-identity.asm b/libyasm/tests/expr-simplify-identity.asm new file mode 100644 index 00000000..cda9c3bb --- /dev/null +++ b/libyasm/tests/expr-simplify-identity.asm @@ -0,0 +1,4 @@ +d_key equ 0 +cachedata: DQ 0 +dtable: +cmp al, [esi + (dtable-cachedata) + ebx*4 + d_key] diff --git a/libyasm/tests/expr-simplify-identity.hex b/libyasm/tests/expr-simplify-identity.hex new file mode 100644 index 00000000..4a236bc5 --- /dev/null +++ b/libyasm/tests/expr-simplify-identity.hex @@ -0,0 +1,13 @@ +00 +00 +00 +00 +00 +00 +00 +00 +67 +3a +44 +9e +08 From 40da5cb2c74aeea346fdd58a264c0ab6eb1648f8 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Mon, 11 Jul 2011 00:15:30 -0700 Subject: [PATCH 417/585] dwarf: Fix uninitialized structure member. dwarf2_loc.discriminator wasn't being initialized by dwarf2_generate_line_section, leading to incorrect output, including intermittent test failures in gen64/dwarf64_pathname. --- modules/dbgfmts/dwarf2/dwarf2-line.c | 1 + .../dwarf2/tests/gen64/dwarf64_pathname.hex | 86 ++++++------------- 2 files changed, 28 insertions(+), 59 deletions(-) diff --git a/modules/dbgfmts/dwarf2/dwarf2-line.c b/modules/dbgfmts/dwarf2/dwarf2-line.c index d2f55e55..a1b0fe51 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-line.c +++ b/modules/dbgfmts/dwarf2/dwarf2-line.c @@ -621,6 +621,7 @@ dwarf2_generate_line_section(yasm_section *sect, /*@null@*/ void *d) bcinfo.lastfile = 0; bcinfo.loc.isa_change = 0; bcinfo.loc.column = 0; + bcinfo.loc.discriminator = 0; bcinfo.loc.is_stmt = IS_STMT_NOCHANGE; bcinfo.loc.basic_block = 0; bcinfo.loc.prologue_end = 0; diff --git a/modules/dbgfmts/dwarf2/tests/gen64/dwarf64_pathname.hex b/modules/dbgfmts/dwarf2/tests/gen64/dwarf64_pathname.hex index 10ae2c38..c67b19de 100644 --- a/modules/dbgfmts/dwarf2/tests/gen64/dwarf64_pathname.hex +++ b/modules/dbgfmts/dwarf2/tests/gen64/dwarf64_pathname.hex @@ -38,7 +38,7 @@ 00 00 00 -80 +60 03 00 00 @@ -97,7 +97,7 @@ ec 83 ec 40 -78 +4c 00 00 00 @@ -151,10 +151,6 @@ fb 04 02 00 -02 -04 -5b -00 09 02 00 @@ -166,55 +162,15 @@ fb 00 00 01 -00 -02 -04 -5b 2e -00 -02 -04 -5b 58 -00 -02 -04 -5b 3c -00 -02 -04 -5b 3c -00 -02 -04 -5b 74 -00 -02 -04 -5b 2e -00 -02 -04 -5b 20 -00 -02 -04 -5b 20 -00 -02 -04 -5b 3c -00 -02 -04 -5b 4b 02 04 @@ -222,7 +178,7 @@ fb 01 01 00 -3c +38 00 00 00 @@ -414,6 +370,18 @@ fb 00 00 00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 2c 00 00 @@ -982,8 +950,8 @@ ff 00 00 00 -00 -02 +e0 +01 00 00 00 @@ -1046,7 +1014,7 @@ ff 00 00 00 -8c +6c 02 00 00 @@ -1110,7 +1078,7 @@ ff 00 00 00 -9c +7c 02 00 00 @@ -1246,7 +1214,7 @@ d8 00 00 00 -7c +50 00 00 00 @@ -1302,7 +1270,7 @@ d8 00 00 00 -e0 +b4 00 00 00 @@ -1366,7 +1334,7 @@ e0 00 00 00 -f8 +cc 00 00 00 @@ -1430,8 +1398,8 @@ f8 00 00 00 -0c -01 +e0 +00 00 00 00 @@ -1494,7 +1462,7 @@ f8 00 00 00 -40 +14 01 00 00 @@ -1558,7 +1526,7 @@ f8 00 00 00 -a0 +80 01 00 00 @@ -1622,7 +1590,7 @@ a0 00 00 00 -d0 +b0 01 00 00 From a9b943e5dbfdf9b7159b1c53134150a507c0954c Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 19 Aug 2011 10:07:34 -0700 Subject: [PATCH 418/585] file.h: Separate conditional inclusion of direct.h. This fixes builds on mingw64. Reported by: Pierre Muller [#235 state:resolved] --- libyasm/file.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libyasm/file.c b/libyasm/file.c index 6b0b5cc0..53e61bf8 100644 --- a/libyasm/file.c +++ b/libyasm/file.c @@ -27,10 +27,12 @@ #include /*@unused@*/ RCSID("$Id$"); -/* Need either unistd.h or direct.h (on Windows) to prototype getcwd() */ -#if defined(HAVE_UNISTD_H) +/* Need either unistd.h or direct.h to prototype getcwd() and mkdir() */ +#ifdef HAVE_UNISTD_H #include -#elif defined(HAVE_DIRECT_H) +#endif + +#ifdef HAVE_DIRECT_H #include #endif From d8d1a5ad902b58ed9b506d1bc65416e6b5f805db Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 19 Aug 2011 10:12:15 -0700 Subject: [PATCH 419/585] win64-except.c: Fix incorrect dereference. Reported by: Pierre Muller [#236 state:resolved] --- modules/objfmts/coff/win64-except.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/objfmts/coff/win64-except.c b/modules/objfmts/coff/win64-except.c index 32ef919a..71d6228b 100644 --- a/modules/objfmts/coff/win64-except.c +++ b/modules/objfmts/coff/win64-except.c @@ -296,7 +296,7 @@ win64_uwinfo_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, YASM_WRITE_8(buf, 1); /* Size of prolog */ - output_value(&info->prolog_size, buf, 1, (unsigned long)(buf-*bufstart), + output_value(&info->prolog_size, buf, 1, (unsigned long)(buf-bufstart), bc, 1, d); buf += 1; From 502eebd33964a95cb8d9aa0dfed981679c30f7da Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 19 Aug 2011 10:21:10 -0700 Subject: [PATCH 420/585] Fix const warning in elf_machine_ssym usage. Reported by: Pierre Muller [#237 state:resolved] --- modules/objfmts/elf/elf-machine.h | 2 +- modules/objfmts/elf/elf-x86-x86.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/objfmts/elf/elf-machine.h b/modules/objfmts/elf/elf-machine.h index 0d8933b1..51a4ca78 100644 --- a/modules/objfmts/elf/elf-machine.h +++ b/modules/objfmts/elf/elf-machine.h @@ -99,7 +99,7 @@ struct elf_machine_handler { func_write_reloc write_reloc; func_write_proghead write_proghead; - const elf_machine_ssym *ssyms; /* array of "special" syms */ + elf_machine_ssym *ssyms; /* array of "special" syms */ const size_t num_ssyms; /* size of array */ const int bits; /* usually 32 or 64 */ diff --git a/modules/objfmts/elf/elf-x86-x86.c b/modules/objfmts/elf/elf-x86-x86.c index 3c5157fe..6e523a6d 100644 --- a/modules/objfmts/elf/elf-x86-x86.c +++ b/modules/objfmts/elf/elf-x86-x86.c @@ -33,7 +33,7 @@ #include "elf.h" #include "elf-machine.h" -static const elf_machine_ssym elf_x86_x86_ssyms[] = { +static elf_machine_ssym elf_x86_x86_ssyms[] = { {"plt", ELF_SSYM_SYM_RELATIVE, R_386_PLT32, 32}, {"gotoff", 0, R_386_GOTOFF, 32}, /* special one for NASM */ From 94ab1135a30827eeb9a422489656c363ed115eec Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 19 Aug 2011 10:43:16 -0700 Subject: [PATCH 421/585] Remove $Id$ and RCSID() usage. These are useless now that we're using git. --- HACKING | 2 -- Makefile.am | 2 -- Mkfiles/Makefile.dj | 2 -- Mkfiles/Makefile.flat | 2 -- Mkfiles/dj/config.h | 2 -- Mkfiles/nightly-build.pl | 1 - Mkfiles/vc10/config.h | 2 -- Mkfiles/vc9/config.h | 2 -- autogen.sh | 1 - configure.ac | 1 - frontends/Makefile.inc | 2 -- frontends/tasm/Makefile.inc | 2 -- frontends/tasm/tasm-options.c | 1 - frontends/tasm/tasm-options.h | 2 +- frontends/tasm/tasm.c | 1 - frontends/vsyasm/Makefile.inc | 2 -- frontends/vsyasm/vsyasm.c | 1 - frontends/yasm/Makefile.inc | 2 -- frontends/yasm/yasm-options.c | 1 - frontends/yasm/yasm-options.h | 2 +- frontends/yasm/yasm-plugin.c | 1 - frontends/yasm/yasm-plugin.h | 2 +- frontends/yasm/yasm.c | 1 - frontends/yasm/yasm.xml | 2 -- genstring.c | 2 +- libyasm.h | 4 ---- libyasm/Makefile.inc | 2 -- libyasm/arch.h | 4 ---- libyasm/assocdat.c | 1 - libyasm/assocdat.h | 4 ---- libyasm/bc-align.c | 1 - libyasm/bc-data.c | 1 - libyasm/bc-incbin.c | 1 - libyasm/bc-org.c | 1 - libyasm/bc-reserve.c | 1 - libyasm/bitvect.c | 1 - libyasm/bitvect.h | 2 -- libyasm/bytecode.c | 1 - libyasm/bytecode.h | 4 ---- libyasm/cmake-module.c | 1 - libyasm/compat-queue.h | 2 +- libyasm/coretype.h | 4 ---- libyasm/dbgfmt.h | 4 ---- libyasm/errwarn.c | 1 - libyasm/errwarn.h | 4 ---- libyasm/expr.c | 1 - libyasm/expr.h | 4 ---- libyasm/file.c | 1 - libyasm/file.h | 4 ---- libyasm/floatnum.c | 1 - libyasm/floatnum.h | 4 ---- libyasm/genmodule.c | 2 +- libyasm/hamt.c | 1 - libyasm/hamt.h | 4 ---- libyasm/insn.c | 1 - libyasm/insn.h | 4 ---- libyasm/intnum.c | 1 - libyasm/intnum.h | 4 ---- libyasm/inttree.c | 1 - libyasm/inttree.h | 1 - libyasm/linemap.c | 1 - libyasm/linemap.h | 4 ---- libyasm/listfmt.h | 4 ---- libyasm/md5.c | 1 - libyasm/md5.h | 4 ---- libyasm/mergesort.c | 1 - libyasm/module.h | 2 +- libyasm/module.in | 1 - libyasm/objfmt.h | 4 ---- libyasm/parser.h | 4 ---- libyasm/phash.c | 1 - libyasm/phash.h | 4 +--- libyasm/preproc.h | 4 ---- libyasm/section.c | 1 - libyasm/section.h | 4 ---- libyasm/strcasecmp.c | 2 -- libyasm/strsep.c | 1 - libyasm/symrec.c | 1 - libyasm/symrec.h | 4 ---- libyasm/tests/Makefile.inc | 2 -- libyasm/tests/bitvect_test.c | 2 +- libyasm/tests/combpath_test.c | 2 +- libyasm/tests/floatnum_test.c | 2 +- libyasm/tests/leb128_test.c | 2 +- libyasm/tests/libyasm_test.sh | 1 - libyasm/tests/splitpath_test.c | 2 +- libyasm/tests/uncstring_test.c | 2 +- libyasm/valparam.c | 1 - libyasm/valparam.h | 4 ---- libyasm/value.c | 1 - libyasm/value.h | 4 ---- libyasm/xmalloc.c | 1 - libyasm/xstrdup.c | 1 - modules/Makefile.inc | 2 -- modules/arch/Makefile.inc | 2 -- modules/arch/lc3b/Makefile.inc | 2 -- modules/arch/lc3b/lc3barch.c | 1 - modules/arch/lc3b/lc3barch.h | 2 +- modules/arch/lc3b/lc3bbc.c | 1 - modules/arch/lc3b/lc3bid.re | 1 - modules/arch/lc3b/tests/Makefile.inc | 2 -- modules/arch/lc3b/tests/lc3b_test.sh | 1 - modules/arch/x86/Makefile.inc | 2 -- modules/arch/x86/gen_x86_insn.py | 9 ++------- modules/arch/x86/tests/Makefile.inc | 2 -- modules/arch/x86/tests/gas32/Makefile.inc | 2 -- modules/arch/x86/tests/gas32/x86_gas32_test.sh | 1 - modules/arch/x86/tests/gas64/Makefile.inc | 2 -- modules/arch/x86/tests/gas64/x86_gas64_test.sh | 1 - modules/arch/x86/tests/x86_test.sh | 1 - modules/arch/x86/x86arch.c | 1 - modules/arch/x86/x86arch.h | 2 +- modules/arch/x86/x86bc.c | 1 - modules/arch/x86/x86cpu.gperf | 1 - modules/arch/x86/x86expr.c | 1 - modules/arch/x86/x86id.c | 1 - modules/arch/x86/x86regtmod.gperf | 1 - modules/arch/yasm_arch.xml | 2 -- modules/dbgfmts/Makefile.inc | 2 -- modules/dbgfmts/codeview/Makefile.inc | 2 -- modules/dbgfmts/codeview/cv-dbgfmt.c | 1 - modules/dbgfmts/codeview/cv-dbgfmt.h | 2 +- modules/dbgfmts/codeview/cv-symline.c | 1 - modules/dbgfmts/codeview/cv-type.c | 1 - modules/dbgfmts/dwarf2/Makefile.inc | 2 -- modules/dbgfmts/dwarf2/dwarf2-aranges.c | 1 - modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c | 1 - modules/dbgfmts/dwarf2/dwarf2-dbgfmt.h | 2 +- modules/dbgfmts/dwarf2/dwarf2-info.c | 1 - modules/dbgfmts/dwarf2/dwarf2-line.c | 1 - modules/dbgfmts/dwarf2/tests/Makefile.inc | 2 -- modules/dbgfmts/dwarf2/tests/gen64/Makefile.inc | 2 -- .../dwarf2/tests/gen64/dwarf2_gen64_test.sh | 1 - modules/dbgfmts/dwarf2/tests/pass32/Makefile.inc | 2 -- .../dwarf2/tests/pass32/dwarf2_pass32_test.sh | 1 - modules/dbgfmts/dwarf2/tests/pass64/Makefile.inc | 2 -- .../dwarf2/tests/pass64/dwarf2_pass64_test.sh | 1 - .../dbgfmts/dwarf2/tests/passwin64/Makefile.inc | 2 -- .../tests/passwin64/dwarf2_passwin64_test.sh | 1 - modules/dbgfmts/null/Makefile.inc | 2 -- modules/dbgfmts/null/null-dbgfmt.c | 1 - modules/dbgfmts/stabs/Makefile.inc | 2 -- modules/dbgfmts/stabs/stabs-dbgfmt.c | 1 - modules/dbgfmts/stabs/tests/Makefile.inc | 2 -- modules/dbgfmts/stabs/tests/stabs_test.sh | 1 - modules/dbgfmts/yasm_dbgfmts.xml | 2 -- modules/listfmts/Makefile.inc | 2 -- modules/listfmts/nasm/Makefile.inc | 2 -- modules/listfmts/nasm/nasm-listfmt.c | 1 - modules/objfmts/Makefile.inc | 2 -- modules/objfmts/bin/Makefile.inc | 2 -- modules/objfmts/bin/bin-objfmt.c | 1 - modules/objfmts/bin/tests/Makefile.inc | 2 -- modules/objfmts/bin/tests/bin_test.sh | 1 - modules/objfmts/bin/tests/multisect/Makefile.inc | 2 -- .../objfmts/bin/tests/multisect/bin_multi_test.sh | 1 - modules/objfmts/coff/Makefile.inc | 2 -- modules/objfmts/coff/coff-objfmt.c | 1 - modules/objfmts/coff/coff-objfmt.h | 2 +- modules/objfmts/coff/tests/Makefile.inc | 2 -- modules/objfmts/coff/tests/coff_test.sh | 1 - modules/objfmts/coff/win64-except.c | 1 - modules/objfmts/dbg/Makefile.inc | 2 -- modules/objfmts/dbg/dbg-objfmt.c | 1 - modules/objfmts/elf/Makefile.inc | 2 -- modules/objfmts/elf/elf-machine.h | 2 +- modules/objfmts/elf/elf-objfmt.c | 1 - modules/objfmts/elf/elf-x86-amd64.c | 1 - modules/objfmts/elf/elf-x86-x86.c | 1 - modules/objfmts/elf/elf.c | 1 - modules/objfmts/elf/elf.h | 2 +- modules/objfmts/elf/tests/Makefile.inc | 2 -- modules/objfmts/elf/tests/amd64/Makefile.inc | 2 -- modules/objfmts/elf/tests/amd64/elf_amd64_test.sh | 1 - modules/objfmts/elf/tests/elf_test.sh | 1 - modules/objfmts/elf/tests/gas32/Makefile.inc | 2 -- modules/objfmts/elf/tests/gas32/elf_gas32_test.sh | 1 - modules/objfmts/elf/tests/gas64/Makefile.inc | 2 -- modules/objfmts/elf/tests/gas64/elf_gas64_test.sh | 1 - modules/objfmts/macho/Makefile.inc | 2 -- modules/objfmts/macho/macho-objfmt.c | 1 - modules/objfmts/macho/tests/Makefile.inc | 2 -- modules/objfmts/macho/tests/gas32/Makefile.inc | 2 -- .../objfmts/macho/tests/gas32/gas_macho32_test.sh | 1 - modules/objfmts/macho/tests/gas64/Makefile.inc | 2 -- .../objfmts/macho/tests/gas64/gas_macho64_test.sh | 1 - modules/objfmts/macho/tests/nasm32/Makefile.inc | 2 -- modules/objfmts/macho/tests/nasm32/macho32_test.sh | 1 - modules/objfmts/macho/tests/nasm64/Makefile.inc | 2 -- modules/objfmts/macho/tests/nasm64/macho64_test.sh | 1 - modules/objfmts/rdf/Makefile.inc | 2 -- modules/objfmts/rdf/rdf-objfmt.c | 1 - modules/objfmts/rdf/tests/Makefile.inc | 2 -- modules/objfmts/rdf/tests/rdf_test.sh | 1 - modules/objfmts/win32/Makefile.inc | 2 -- modules/objfmts/win32/tests/Makefile.inc | 2 -- modules/objfmts/win32/tests/gas/Makefile.inc | 2 -- modules/objfmts/win32/tests/gas/win32_gas_test.sh | 1 - modules/objfmts/win32/tests/win32_test.sh | 1 - modules/objfmts/win64/Makefile.inc | 2 -- modules/objfmts/win64/tests/Makefile.inc | 2 -- modules/objfmts/win64/tests/gas/Makefile.inc | 2 -- modules/objfmts/win64/tests/gas/win64_gas_test.sh | 1 - modules/objfmts/win64/tests/win64_test.sh | 1 - modules/objfmts/xdf/Makefile.inc | 2 -- modules/objfmts/xdf/tests/Makefile.inc | 2 -- modules/objfmts/xdf/tests/xdf_test.sh | 1 - modules/objfmts/xdf/xdf-objfmt.c | 1 - modules/objfmts/yasm_objfmts.xml | 2 -- modules/parsers/Makefile.inc | 2 -- modules/parsers/gas/Makefile.inc | 2 -- modules/parsers/gas/gas-parse-intel.c | 1 - modules/parsers/gas/gas-parse.c | 1 - modules/parsers/gas/gas-parser.c | 1 - modules/parsers/gas/gas-parser.h | 2 +- modules/parsers/gas/gas-token.re | 1 - modules/parsers/gas/tests/Makefile.inc | 2 -- modules/parsers/gas/tests/bin/Makefile.inc | 2 -- modules/parsers/gas/tests/bin/gas_bin_test.sh | 1 - modules/parsers/gas/tests/gas_test.sh | 1 - modules/parsers/nasm/Makefile.inc | 2 -- modules/parsers/nasm/nasm-parse.c | 1 - modules/parsers/nasm/nasm-parser-struct.h | 2 +- modules/parsers/nasm/nasm-parser.c | 1 - modules/parsers/nasm/nasm-parser.h | 2 +- modules/parsers/nasm/nasm-token.re | 1 - modules/parsers/nasm/tests/Makefile.inc | 2 -- modules/parsers/nasm/tests/nasm_test.sh | 1 - modules/parsers/nasm/tests/worphan/Makefile.inc | 2 -- .../nasm/tests/worphan/nasm_worphan_test.sh | 1 - modules/parsers/tasm/Makefile.inc | 2 -- modules/parsers/tasm/tests/Makefile.inc | 2 -- modules/parsers/tasm/tests/exe/Makefile.inc | 2 -- modules/parsers/tasm/tests/exe/tasm_exe_test.sh | 1 - modules/parsers/tasm/tests/tasm_test.sh | 1 - modules/parsers/yasm_parsers.xml | 2 -- modules/preprocs/Makefile.inc | 2 -- modules/preprocs/gas/Makefile.inc | 2 -- modules/preprocs/gas/gas-preproc.c | 1 - modules/preprocs/gas/tests/Makefile.inc | 2 -- modules/preprocs/nasm/Makefile.inc | 2 -- modules/preprocs/nasm/genversion.c | 2 +- modules/preprocs/nasm/nasm-preproc.c | 1 - modules/preprocs/nasm/tests/Makefile.inc | 2 -- modules/preprocs/nasm/tests/nasmpp_test.sh | 1 - modules/preprocs/raw/Makefile.inc | 2 -- modules/preprocs/raw/raw-preproc.c | 1 - modules/preprocs/raw/tests/Makefile.inc | 2 -- modules/preprocs/raw/tests/rawpp_test.sh | 1 - modules/preprocs/tasm/Makefile.inc | 2 -- modules/preprocs/tasm/tests/Makefile.inc | 2 -- modules/preprocs/tasm/tests/tasmpp_test.sh | 1 - modules/preprocs/yapp/Makefile.inc | 2 -- modules/preprocs/yapp/tests/Makefile.inc | 2 -- modules/preprocs/yapp/tests/yapp_test.sh | 1 - modules/preprocs/yapp/yapp-preproc.c | 1 - modules/preprocs/yapp/yapp-preproc.h | 2 +- modules/preprocs/yapp/yapp-token.l | 1 - out_test.sh | 1 - po/POTFILES.in | 2 -- test_hd.c | 2 +- tools/Makefile.inc | 2 -- tools/genmacro/Makefile.inc | 2 -- tools/genmacro/genmacro.c | 2 +- tools/genperf/Makefile.inc | 2 -- tools/genperf/genperf.c | 2 +- tools/genperf/perfect.c | 4 +--- tools/python-yasm/Makefile.inc | 2 -- tools/python-yasm/tests/Makefile.inc | 2 -- tools/python-yasm/tests/__init__.py | 1 - tools/python-yasm/tests/python_test.sh | 1 - tools/python-yasm/tests/test_bytecode.py | 1 - tools/python-yasm/tests/test_expr.py | 1 - tools/python-yasm/tests/test_intnum.py | 1 - tools/python-yasm/tests/test_symrec.py | 1 - tools/re2c/Makefile.inc | 2 -- tools/xdf/xdf.h | 1 - tools/xdf/xdfdump.c | 2 +- util.h | 14 +------------- 279 files changed, 34 insertions(+), 467 deletions(-) diff --git a/HACKING b/HACKING index 3980f560..0c565b87 100644 --- a/HACKING +++ b/HACKING @@ -1,5 +1,3 @@ -$Id$ - If you are contributing code to the YASM project or trying to compile YASM from a CVS checkout, please read this first. diff --git a/Makefile.am b/Makefile.am index 95dae006..f3ed7d41 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,3 @@ -# $Id$ - SUBDIRS = po . ACLOCAL_AMFLAGS = -I m4 diff --git a/Mkfiles/Makefile.dj b/Mkfiles/Makefile.dj index 419bed86..8881b544 100644 --- a/Mkfiles/Makefile.dj +++ b/Mkfiles/Makefile.dj @@ -1,5 +1,3 @@ -# $Id$ -# # Ultra-flat Makefile for DJGPP (also works for Cygwin). # Does NOT depend on or use configure. # diff --git a/Mkfiles/Makefile.flat b/Mkfiles/Makefile.flat index b979176d..3e190d73 100644 --- a/Mkfiles/Makefile.flat +++ b/Mkfiles/Makefile.flat @@ -1,5 +1,3 @@ -# $Id$ -# # Ultra-flat Makefile "prototype" for non-Unix platforms. # Does NOT depend on or use configure. # diff --git a/Mkfiles/dj/config.h b/Mkfiles/dj/config.h index 1d45e76b..46e3167e 100644 --- a/Mkfiles/dj/config.h +++ b/Mkfiles/dj/config.h @@ -1,5 +1,3 @@ -/* $Id$ */ - #define yasm__splitpath(path, tail) yasm__splitpath_win(path, tail) #define yasm__abspath(path) yasm__abspath_win(path) #define yasm__combpath(from, to) yasm__combpath_win(from, to) diff --git a/Mkfiles/nightly-build.pl b/Mkfiles/nightly-build.pl index 1ac17a29..0a029d92 100644 --- a/Mkfiles/nightly-build.pl +++ b/Mkfiles/nightly-build.pl @@ -1,5 +1,4 @@ #!/usr/bin/perl -# $Id$ use POSIX qw(strftime); $|++; diff --git a/Mkfiles/vc10/config.h b/Mkfiles/vc10/config.h index 28aa8d10..aba46abe 100644 --- a/Mkfiles/vc10/config.h +++ b/Mkfiles/vc10/config.h @@ -1,5 +1,3 @@ -/* $Id: config.h 1137 2004-09-04 01:24:57Z peter $ */ - #define yasm__splitpath(path, tail) yasm__splitpath_win(path, tail) #define yasm__abspath(path) yasm__abspath_win(path) #define yasm__combpath(from, to) yasm__combpath_win(from, to) diff --git a/Mkfiles/vc9/config.h b/Mkfiles/vc9/config.h index 28aa8d10..aba46abe 100644 --- a/Mkfiles/vc9/config.h +++ b/Mkfiles/vc9/config.h @@ -1,5 +1,3 @@ -/* $Id: config.h 1137 2004-09-04 01:24:57Z peter $ */ - #define yasm__splitpath(path, tail) yasm__splitpath_win(path, tail) #define yasm__abspath(path) yasm__abspath_win(path) #define yasm__combpath(from, to) yasm__combpath_win(from, to) diff --git a/autogen.sh b/autogen.sh index 9f9c45b2..b91fc286 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,5 +1,4 @@ #!/bin/sh -# $Id$ # Run this to set up the build system: configure, makefiles, etc. # (based on the version in enlightenment's cvs) diff --git a/configure.ac b/configure.ac index ae9dcf06..4dc92f41 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,4 @@ # Process this file with autoconf to produce a configure script. -# $Id$ # # autoconf setup diff --git a/frontends/Makefile.inc b/frontends/Makefile.inc index 72140c3f..295639e8 100644 --- a/frontends/Makefile.inc +++ b/frontends/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - EXTRA_DIST += frontends/yasm/Makefile.inc EXTRA_DIST += frontends/tasm/Makefile.inc EXTRA_DIST += frontends/vsyasm/Makefile.inc diff --git a/frontends/tasm/Makefile.inc b/frontends/tasm/Makefile.inc index 22370df8..9826e1b9 100644 --- a/frontends/tasm/Makefile.inc +++ b/frontends/tasm/Makefile.inc @@ -1,5 +1,3 @@ -# $Id: Makefile.inc 1463 2006-04-05 05:39:23Z peter $ - bin_PROGRAMS += ytasm ytasm_SOURCES = frontends/tasm/tasm.c diff --git a/frontends/tasm/tasm-options.c b/frontends/tasm/tasm-options.c index 2f8f46dd..7c23c468 100644 --- a/frontends/tasm/tasm-options.c +++ b/frontends/tasm/tasm-options.c @@ -29,7 +29,6 @@ */ #include #include -/*@unused@*/ RCSID("$Id: tasm-options.c 1197 2005-01-24 06:44:25Z peter $"); #include "tasm-options.h" diff --git a/frontends/tasm/tasm-options.h b/frontends/tasm/tasm-options.h index 6f2e7419..082409fc 100644 --- a/frontends/tasm/tasm-options.h +++ b/frontends/tasm/tasm-options.h @@ -1,4 +1,4 @@ -/* $Id: tasm-options.h 1137 2004-09-04 01:24:57Z peter $ +/* * Generic Options Support Header File * * Copyright (c) 2001 Stanislav Karchebny diff --git a/frontends/tasm/tasm.c b/frontends/tasm/tasm.c index 400e1baf..6efac28f 100644 --- a/frontends/tasm/tasm.c +++ b/frontends/tasm/tasm.c @@ -26,7 +26,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -/*@unused@*/ RCSID("$Id: tasm.c 1523 2006-05-06 16:11:56Z peter $"); #include #include diff --git a/frontends/vsyasm/Makefile.inc b/frontends/vsyasm/Makefile.inc index 1adcca8d..df8d9cf7 100644 --- a/frontends/vsyasm/Makefile.inc +++ b/frontends/vsyasm/Makefile.inc @@ -1,5 +1,3 @@ -# $Id: Makefile.inc 1463 2006-04-05 05:39:23Z peter $ - bin_PROGRAMS += vsyasm vsyasm_SOURCES = frontends/vsyasm/vsyasm.c diff --git a/frontends/vsyasm/vsyasm.c b/frontends/vsyasm/vsyasm.c index 8c966703..115e34e6 100644 --- a/frontends/vsyasm/vsyasm.c +++ b/frontends/vsyasm/vsyasm.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -/*@unused@*/ RCSID("$Id$"); #include #include diff --git a/frontends/yasm/Makefile.inc b/frontends/yasm/Makefile.inc index 1e0a8362..ff73f952 100644 --- a/frontends/yasm/Makefile.inc +++ b/frontends/yasm/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - bin_PROGRAMS += yasm dist_man_MANS += yasm.1 diff --git a/frontends/yasm/yasm-options.c b/frontends/yasm/yasm-options.c index 48c8c56d..eff6ba9a 100644 --- a/frontends/yasm/yasm-options.c +++ b/frontends/yasm/yasm-options.c @@ -29,7 +29,6 @@ */ #include #include -/*@unused@*/ RCSID("$Id$"); #include "yasm-options.h" diff --git a/frontends/yasm/yasm-options.h b/frontends/yasm/yasm-options.h index d78bec30..63c4fbea 100644 --- a/frontends/yasm/yasm-options.h +++ b/frontends/yasm/yasm-options.h @@ -1,4 +1,4 @@ -/* $Id$ +/* * Generic Options Support Header File * * Copyright (c) 2001 Stanislav Karchebny diff --git a/frontends/yasm/yasm-plugin.c b/frontends/yasm/yasm-plugin.c index a04c42bf..c64edc32 100644 --- a/frontends/yasm/yasm-plugin.c +++ b/frontends/yasm/yasm-plugin.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -/*@unused@*/ RCSID("$Id$"); #include diff --git a/frontends/yasm/yasm-plugin.h b/frontends/yasm/yasm-plugin.h index edee2537..efb1bf51 100644 --- a/frontends/yasm/yasm-plugin.h +++ b/frontends/yasm/yasm-plugin.h @@ -1,4 +1,4 @@ -/* $Id$ +/* * Semi-portable (Windows and Unix) plugin loading * * Copyright (C) 2008 Peter Johnson diff --git a/frontends/yasm/yasm.c b/frontends/yasm/yasm.c index ca049756..4c61e77e 100644 --- a/frontends/yasm/yasm.c +++ b/frontends/yasm/yasm.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -/*@unused@*/ RCSID("$Id$"); #include #include diff --git a/frontends/yasm/yasm.xml b/frontends/yasm/yasm.xml index fde13492..0f074628 100644 --- a/frontends/yasm/yasm.xml +++ b/frontends/yasm/yasm.xml @@ -2,8 +2,6 @@ - - diff --git a/genstring.c b/genstring.c index 51b76810..a66e2f56 100644 --- a/genstring.c +++ b/genstring.c @@ -1,4 +1,4 @@ -/* $Id$ +/* * * Generate array-of-const-string from text file. * diff --git a/libyasm.h b/libyasm.h index 6d7778e9..f52c133b 100644 --- a/libyasm.h +++ b/libyasm.h @@ -2,10 +2,6 @@ * \file libyasm.h * \brief YASM library primary header file. * - * \rcs - * $Id$ - * \endrcs - * * \license * Copyright (C) 2003-2007 Peter Johnson * diff --git a/libyasm/Makefile.inc b/libyasm/Makefile.inc index 482af05a..042dd390 100644 --- a/libyasm/Makefile.inc +++ b/libyasm/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - libyasm_a_SOURCES += libyasm/assocdat.c libyasm_a_SOURCES += libyasm/bitvect.c libyasm_a_SOURCES += libyasm/bc-align.c diff --git a/libyasm/arch.h b/libyasm/arch.h index eed31765..3da9f9fc 100644 --- a/libyasm/arch.h +++ b/libyasm/arch.h @@ -2,10 +2,6 @@ * \file libyasm/arch.h * \brief YASM architecture interface. * - * \rcs - * $Id$ - * \endrcs - * * \license * Copyright (C) 2002-2007 Peter Johnson * diff --git a/libyasm/assocdat.c b/libyasm/assocdat.c index 8364d6c3..cdcda62b 100644 --- a/libyasm/assocdat.c +++ b/libyasm/assocdat.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include "util.h" -/*@unused@*/ RCSID("$Id$"); #include "coretype.h" #include "assocdat.h" diff --git a/libyasm/assocdat.h b/libyasm/assocdat.h index d18e1ebf..cf423867 100644 --- a/libyasm/assocdat.h +++ b/libyasm/assocdat.h @@ -2,10 +2,6 @@ * \file assocdat.h * \brief YASM associated data storage (libyasm internal use) * - * \rcs - * $Id$ - * \endrcs - * * \license * Copyright (C) 2003-2007 Peter Johnson * diff --git a/libyasm/bc-align.c b/libyasm/bc-align.c index 763140d7..2a47882e 100644 --- a/libyasm/bc-align.c +++ b/libyasm/bc-align.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include "util.h" -/*@unused@*/ RCSID("$Id$"); #include "libyasm-stdint.h" #include "coretype.h" diff --git a/libyasm/bc-data.c b/libyasm/bc-data.c index 7fe40913..ebbdd6f9 100644 --- a/libyasm/bc-data.c +++ b/libyasm/bc-data.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include "util.h" -/*@unused@*/ RCSID("$Id$"); #include "libyasm-stdint.h" #include "coretype.h" diff --git a/libyasm/bc-incbin.c b/libyasm/bc-incbin.c index 23146015..a8fec7d6 100644 --- a/libyasm/bc-incbin.c +++ b/libyasm/bc-incbin.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include "util.h" -/*@unused@*/ RCSID("$Id$"); #include "libyasm-stdint.h" #include "coretype.h" diff --git a/libyasm/bc-org.c b/libyasm/bc-org.c index cb2d82b8..7ef96c84 100644 --- a/libyasm/bc-org.c +++ b/libyasm/bc-org.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include "util.h" -/*@unused@*/ RCSID("$Id$"); #include "libyasm-stdint.h" #include "coretype.h" diff --git a/libyasm/bc-reserve.c b/libyasm/bc-reserve.c index 09196faa..197175b4 100644 --- a/libyasm/bc-reserve.c +++ b/libyasm/bc-reserve.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include "util.h" -/*@unused@*/ RCSID("$Id$"); #include "libyasm-stdint.h" #include "coretype.h" diff --git a/libyasm/bitvect.c b/libyasm/bitvect.c index 57ad6133..dfb08252 100644 --- a/libyasm/bitvect.c +++ b/libyasm/bitvect.c @@ -1,5 +1,4 @@ #include "util.h" -RCSID("$Id$"); #include "coretype.h" diff --git a/libyasm/bitvect.h b/libyasm/bitvect.h index dc77d4fa..3aee3a53 100644 --- a/libyasm/bitvect.h +++ b/libyasm/bitvect.h @@ -1,5 +1,3 @@ -/* $Id$ */ - #ifndef YASM_BITVECT_H #define YASM_BITVECT_H /*****************************************************************************/ diff --git a/libyasm/bytecode.c b/libyasm/bytecode.c index 50a4fa0f..f864bae0 100644 --- a/libyasm/bytecode.c +++ b/libyasm/bytecode.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include "util.h" -/*@unused@*/ RCSID("$Id$"); #include "libyasm-stdint.h" #include "coretype.h" diff --git a/libyasm/bytecode.h b/libyasm/bytecode.h index 2b664271..4e8a801f 100644 --- a/libyasm/bytecode.h +++ b/libyasm/bytecode.h @@ -2,10 +2,6 @@ * \file libyasm/bytecode.h * \brief YASM bytecode interface. * - * \rcs - * $Id$ - * \endrcs - * * \license * Copyright (C) 2001-2007 Peter Johnson * diff --git a/libyasm/cmake-module.c b/libyasm/cmake-module.c index 85309946..2ee39ca8 100644 --- a/libyasm/cmake-module.c +++ b/libyasm/cmake-module.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -/*@unused@*/ RCSID("$Id: module.in 2080 2008-04-30 04:40:29Z peter $"); #include diff --git a/libyasm/compat-queue.h b/libyasm/compat-queue.h index e9077be9..da9eff46 100644 --- a/libyasm/compat-queue.h +++ b/libyasm/compat-queue.h @@ -1,4 +1,4 @@ -/* $Id$ +/* * implementation for systems that don't have it. * * Copyright (c) 1991, 1993 diff --git a/libyasm/coretype.h b/libyasm/coretype.h index a78c28f2..624e3c44 100644 --- a/libyasm/coretype.h +++ b/libyasm/coretype.h @@ -2,10 +2,6 @@ * \file libyasm/coretype.h * \brief YASM core types and utility functions. * - * \rcs - * $Id$ - * \endrcs - * * \license * Copyright (C) 2001-2007 Peter Johnson * diff --git a/libyasm/dbgfmt.h b/libyasm/dbgfmt.h index aa0690bd..8e038bbf 100644 --- a/libyasm/dbgfmt.h +++ b/libyasm/dbgfmt.h @@ -2,10 +2,6 @@ * \file libyasm/dbgfmt.h * \brief YASM debug format interface. * - * \rcs - * $Id$ - * \endrcs - * * \license * Copyright (C) 2002-2007 Peter Johnson * diff --git a/libyasm/errwarn.c b/libyasm/errwarn.c index fa136005..d51a0deb 100644 --- a/libyasm/errwarn.c +++ b/libyasm/errwarn.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include "util.h" -/*@unused@*/ RCSID("$Id$"); #include #include diff --git a/libyasm/errwarn.h b/libyasm/errwarn.h index 2cc7fb1a..ede2f287 100644 --- a/libyasm/errwarn.h +++ b/libyasm/errwarn.h @@ -2,10 +2,6 @@ * \file libyasm/errwarn.h * \brief YASM error and warning reporting interface. * - * \rcs - * $Id$ - * \endrcs - * * \license * Copyright (C) 2001-2007 Peter Johnson * diff --git a/libyasm/expr.c b/libyasm/expr.c index 0c777403..c2c868ed 100644 --- a/libyasm/expr.c +++ b/libyasm/expr.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include "util.h" -/*@unused@*/ RCSID("$Id$"); #include "libyasm-stdint.h" #include "coretype.h" diff --git a/libyasm/expr.h b/libyasm/expr.h index ee43fca6..2b06cd3a 100644 --- a/libyasm/expr.h +++ b/libyasm/expr.h @@ -2,10 +2,6 @@ * \file libyasm/expr.h * \brief YASM expression interface. * - * \rcs - * $Id$ - * \endrcs - * * \license * Copyright (C) 2001-2007 Michael Urman, Peter Johnson * diff --git a/libyasm/file.c b/libyasm/file.c index 53e61bf8..fc7dab6c 100644 --- a/libyasm/file.c +++ b/libyasm/file.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -/*@unused@*/ RCSID("$Id$"); /* Need either unistd.h or direct.h to prototype getcwd() and mkdir() */ #ifdef HAVE_UNISTD_H diff --git a/libyasm/file.h b/libyasm/file.h index d99785dd..1e9b87b0 100644 --- a/libyasm/file.h +++ b/libyasm/file.h @@ -2,10 +2,6 @@ * \file libyasm/file.h * \brief YASM file helpers. * - * \rcs - * $Id$ - * \endrcs - * * \license * Copyright (C) 2001-2007 Peter Johnson * diff --git a/libyasm/floatnum.c b/libyasm/floatnum.c index a7cfcb7e..ab67c2b2 100644 --- a/libyasm/floatnum.c +++ b/libyasm/floatnum.c @@ -27,7 +27,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include "util.h" -/*@unused@*/ RCSID("$Id$"); #include diff --git a/libyasm/floatnum.h b/libyasm/floatnum.h index 8fa3d1d5..d2c70420 100644 --- a/libyasm/floatnum.h +++ b/libyasm/floatnum.h @@ -2,10 +2,6 @@ * \file libyasm/floatnum.h * \brief YASM floating point (IEEE) interface. * - * \rcs - * $Id$ - * \endrcs - * * \license * Copyright (C) 2001-2007 Peter Johnson * diff --git a/libyasm/genmodule.c b/libyasm/genmodule.c index 4ae31083..867d93a5 100644 --- a/libyasm/genmodule.c +++ b/libyasm/genmodule.c @@ -1,4 +1,4 @@ -/* $Id$ +/* * * Generate module.c from module.in and Makefile.am or Makefile. * diff --git a/libyasm/hamt.c b/libyasm/hamt.c index 33ab83bb..59b75921 100644 --- a/libyasm/hamt.c +++ b/libyasm/hamt.c @@ -30,7 +30,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include "util.h" -/*@unused@*/ RCSID("$Id$"); #include diff --git a/libyasm/hamt.h b/libyasm/hamt.h index c54172b7..1ce9b775 100644 --- a/libyasm/hamt.h +++ b/libyasm/hamt.h @@ -2,10 +2,6 @@ * \file libyasm/hamt.h * \brief Hash Array Mapped Trie (HAMT) functions. * - * \rcs - * $Id$ - * \endrcs - * * \license * Copyright (C) 2001-2007 Peter Johnson * diff --git a/libyasm/insn.c b/libyasm/insn.c index c4c26867..8f7a4c19 100644 --- a/libyasm/insn.c +++ b/libyasm/insn.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include "util.h" -/*@unused@*/ RCSID("$Id$"); #include "libyasm-stdint.h" #include "coretype.h" diff --git a/libyasm/insn.h b/libyasm/insn.h index 99bcb841..d2d175d0 100644 --- a/libyasm/insn.h +++ b/libyasm/insn.h @@ -2,10 +2,6 @@ * \file libyasm/insn.h * \brief YASM mnenomic instruction. * - * \rcs - * $Id$ - * \endrcs - * * \license * Copyright (C) 2002-2007 Peter Johnson * diff --git a/libyasm/intnum.c b/libyasm/intnum.c index 625349c6..6feba334 100644 --- a/libyasm/intnum.c +++ b/libyasm/intnum.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include "util.h" -/*@unused@*/ RCSID("$Id$"); #include #include diff --git a/libyasm/intnum.h b/libyasm/intnum.h index 132e8b00..bec832cf 100644 --- a/libyasm/intnum.h +++ b/libyasm/intnum.h @@ -2,10 +2,6 @@ * \file libyasm/intnum.h * \brief YASM integer number interface. * - * \rcs - * $Id$ - * \endrcs - * * \license * Copyright (C) 2001-2007 Peter Johnson * diff --git a/libyasm/inttree.c b/libyasm/inttree.c index a7739fb1..2ae10e9b 100644 --- a/libyasm/inttree.c +++ b/libyasm/inttree.c @@ -1,5 +1,4 @@ #include "util.h" -/*@unused@*/ RCSID("$Id$"); #include #include diff --git a/libyasm/inttree.h b/libyasm/inttree.h index de037e44..f7a76515 100644 --- a/libyasm/inttree.h +++ b/libyasm/inttree.h @@ -1,4 +1,3 @@ -/* $Id$ */ #ifndef YASM_INTTREE_H #define YASM_INTTREE_H diff --git a/libyasm/linemap.c b/libyasm/linemap.c index abee7482..42201d3c 100644 --- a/libyasm/linemap.c +++ b/libyasm/linemap.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include "util.h" -/*@unused@*/ RCSID("$Id$"); #include "coretype.h" #include "hamt.h" diff --git a/libyasm/linemap.h b/libyasm/linemap.h index e916c6d0..1c5aa462 100644 --- a/libyasm/linemap.h +++ b/libyasm/linemap.h @@ -2,10 +2,6 @@ * \file libyasm/linemap.h * \brief YASM virtual line mapping interface. * - * \rcs - * $Id$ - * \endrcs - * * \license * Copyright (C) 2002-2007 Peter Johnson * diff --git a/libyasm/listfmt.h b/libyasm/listfmt.h index bfdfac46..945f28e5 100644 --- a/libyasm/listfmt.h +++ b/libyasm/listfmt.h @@ -2,10 +2,6 @@ * \file libyasm/listfmt.h * \brief YASM list format interface. * - * \rcs - * $Id$ - * \endrcs - * * \license * Copyright (C) 2004-2007 Peter Johnson * diff --git a/libyasm/md5.c b/libyasm/md5.c index e02bcf2c..86fb9c30 100644 --- a/libyasm/md5.c +++ b/libyasm/md5.c @@ -29,7 +29,6 @@ this file is only about 3k of object code. */ #include -/*@unused@*/ RCSID("$Id$"); #include "md5.h" diff --git a/libyasm/md5.h b/libyasm/md5.h index 7226f1dc..7872fda7 100644 --- a/libyasm/md5.h +++ b/libyasm/md5.h @@ -1,9 +1,5 @@ /* See md5.c for explanation and copyright information. */ -/* - * $Id$ - */ - #ifndef YASM_MD5_H #define YASM_MD5_H diff --git a/libyasm/mergesort.c b/libyasm/mergesort.c index a5b33da4..3eeaa827 100644 --- a/libyasm/mergesort.c +++ b/libyasm/mergesort.c @@ -32,7 +32,6 @@ * SUCH DAMAGE. */ #include "util.h" -/*@unused@*/ RCSID("$Id$"); #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)merge.c 8.2 (Berkeley) 2/14/94"; diff --git a/libyasm/module.h b/libyasm/module.h index ce2e14b7..220017de 100644 --- a/libyasm/module.h +++ b/libyasm/module.h @@ -1,4 +1,4 @@ -/* $Id$ +/* * YASM module loader header file * * Copyright (C) 2002-2007 Peter Johnson diff --git a/libyasm/module.in b/libyasm/module.in index ff1e399b..a18778b6 100644 --- a/libyasm/module.in +++ b/libyasm/module.in @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -/*@unused@*/ RCSID("$Id$"); #include diff --git a/libyasm/objfmt.h b/libyasm/objfmt.h index 6abba74d..840296a5 100644 --- a/libyasm/objfmt.h +++ b/libyasm/objfmt.h @@ -2,10 +2,6 @@ * \file libyasm/objfmt.h * \brief YASM object format module interface. * - * \rcs - * $Id$ - * \endrcs - * * \license * Copyright (C) 2001-2007 Peter Johnson * diff --git a/libyasm/parser.h b/libyasm/parser.h index 26c347be..93d4d332 100644 --- a/libyasm/parser.h +++ b/libyasm/parser.h @@ -2,10 +2,6 @@ * \file libyasm/parser.h * \brief YASM parser module interface. * - * \rcs - * $Id$ - * \endrcs - * * \license * Copyright (C) 2001-2007 Peter Johnson * diff --git a/libyasm/phash.c b/libyasm/phash.c index 21a8ad1c..cef8c781 100644 --- a/libyasm/phash.c +++ b/libyasm/phash.c @@ -1,6 +1,5 @@ /* Modified for use with yasm by Peter Johnson. */ #include "util.h" -/*@unused@*/ RCSID("$Id$"); /* -------------------------------------------------------------------- diff --git a/libyasm/phash.h b/libyasm/phash.h index f446eeab..2273a5df 100644 --- a/libyasm/phash.h +++ b/libyasm/phash.h @@ -1,6 +1,4 @@ -/* Modified for use with yasm by Peter Johnson. - * $Id$ - */ +/* Modified for use with yasm by Peter Johnson. */ /* ------------------------------------------------------------------------------ By Bob Jenkins, September 1996. diff --git a/libyasm/preproc.h b/libyasm/preproc.h index 0b8c54ff..751b19e4 100644 --- a/libyasm/preproc.h +++ b/libyasm/preproc.h @@ -2,10 +2,6 @@ * \file libyasm/preproc.h * \brief YASM preprocessor module interface. * - * \rcs - * $Id$ - * \endrcs - * * \license * Copyright (C) 2001-2007 Peter Johnson * diff --git a/libyasm/section.c b/libyasm/section.c index bb796308..9242fb01 100644 --- a/libyasm/section.c +++ b/libyasm/section.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include "util.h" -/*@unused@*/ RCSID("$Id$"); #include diff --git a/libyasm/section.h b/libyasm/section.h index 3b3942a9..2c7faa4d 100644 --- a/libyasm/section.h +++ b/libyasm/section.h @@ -2,10 +2,6 @@ * \file libyasm/section.h * \brief YASM section interface. * - * \rcs - * $Id$ - * \endrcs - * * \license * Copyright (C) 2001-2007 Peter Johnson * diff --git a/libyasm/strcasecmp.c b/libyasm/strcasecmp.c index 69d87113..a87bd88b 100644 --- a/libyasm/strcasecmp.c +++ b/libyasm/strcasecmp.c @@ -30,8 +30,6 @@ * SUCH DAMAGE. */ #include "util.h" -/*@unused@*/ RCSID("$Id$"); - #ifndef USE_OUR_OWN_STRCASECMP #undef yasm__strcasecmp diff --git a/libyasm/strsep.c b/libyasm/strsep.c index 7f538797..0fecd475 100644 --- a/libyasm/strsep.c +++ b/libyasm/strsep.c @@ -30,7 +30,6 @@ */ #define NO_STRING_INLINES #include "util.h" -/*@unused@*/ RCSID("$Id$"); #if defined(LIBC_SCCS) && !defined(lint) diff --git a/libyasm/symrec.c b/libyasm/symrec.c index 6ebfc1c6..694f0c67 100644 --- a/libyasm/symrec.c +++ b/libyasm/symrec.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include "util.h" -/*@unused@*/ RCSID("$Id$"); #include #include diff --git a/libyasm/symrec.h b/libyasm/symrec.h index 0eac87bf..62071589 100644 --- a/libyasm/symrec.h +++ b/libyasm/symrec.h @@ -2,10 +2,6 @@ * \file libyasm/symrec.h * \brief YASM symbol table interface. * - * \rcs - * $Id$ - * \endrcs - * * \license * Copyright (C) 2001-2007 Michael Urman, Peter Johnson * diff --git a/libyasm/tests/Makefile.inc b/libyasm/tests/Makefile.inc index 13460c01..9c038a14 100644 --- a/libyasm/tests/Makefile.inc +++ b/libyasm/tests/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - TESTS += bitvect_test TESTS += floatnum_test TESTS += leb128_test diff --git a/libyasm/tests/bitvect_test.c b/libyasm/tests/bitvect_test.c index ea8f561e..f7b34130 100644 --- a/libyasm/tests/bitvect_test.c +++ b/libyasm/tests/bitvect_test.c @@ -1,4 +1,4 @@ -/* $Id$ +/* * * Copyright (C) 2001-2007 Peter Johnson * diff --git a/libyasm/tests/combpath_test.c b/libyasm/tests/combpath_test.c index 35a5b454..90f2e241 100644 --- a/libyasm/tests/combpath_test.c +++ b/libyasm/tests/combpath_test.c @@ -1,4 +1,4 @@ -/* $Id$ +/* * * Copyright (C) 2006-2007 Peter Johnson * diff --git a/libyasm/tests/floatnum_test.c b/libyasm/tests/floatnum_test.c index b0526ea5..30b8d6ce 100644 --- a/libyasm/tests/floatnum_test.c +++ b/libyasm/tests/floatnum_test.c @@ -1,4 +1,4 @@ -/* $Id$ +/* * * Copyright (C) 2001-2007 Peter Johnson * diff --git a/libyasm/tests/leb128_test.c b/libyasm/tests/leb128_test.c index aca537b4..87fc8d91 100644 --- a/libyasm/tests/leb128_test.c +++ b/libyasm/tests/leb128_test.c @@ -1,4 +1,4 @@ -/* $Id$ +/* * * Copyright (C) 2005-2007 Peter Johnson * diff --git a/libyasm/tests/libyasm_test.sh b/libyasm/tests/libyasm_test.sh index 02457315..37f8717f 100755 --- a/libyasm/tests/libyasm_test.sh +++ b/libyasm/tests/libyasm_test.sh @@ -1,4 +1,3 @@ #! /bin/sh -# $Id$ ${srcdir}/out_test.sh libyasm_test libyasm/tests "libyasm" "-f bin" "" exit $? diff --git a/libyasm/tests/splitpath_test.c b/libyasm/tests/splitpath_test.c index 74792636..7f873a47 100644 --- a/libyasm/tests/splitpath_test.c +++ b/libyasm/tests/splitpath_test.c @@ -1,4 +1,4 @@ -/* $Id$ +/* * * Copyright (C) 2006-2007 Peter Johnson * diff --git a/libyasm/tests/uncstring_test.c b/libyasm/tests/uncstring_test.c index 819c06f5..73037642 100644 --- a/libyasm/tests/uncstring_test.c +++ b/libyasm/tests/uncstring_test.c @@ -1,4 +1,4 @@ -/* $Id$ +/* * * Copyright (C) 2006-2007 Peter Johnson * diff --git a/libyasm/valparam.c b/libyasm/valparam.c index 648dfaea..88e41a7c 100644 --- a/libyasm/valparam.c +++ b/libyasm/valparam.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include "util.h" -/*@unused@*/ RCSID("$Id$"); #include "libyasm-stdint.h" #include "coretype.h" diff --git a/libyasm/valparam.h b/libyasm/valparam.h index 3a7e8df6..d7343d49 100644 --- a/libyasm/valparam.h +++ b/libyasm/valparam.h @@ -2,10 +2,6 @@ * \file libyasm/valparam.h * \brief YASM value/parameter interface. * - * \rcs - * $Id$ - * \endrcs - * * \license * Copyright (C) 2001-2007 Peter Johnson * diff --git a/libyasm/value.c b/libyasm/value.c index e85d54b2..3ab73c1c 100644 --- a/libyasm/value.c +++ b/libyasm/value.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include "util.h" -/*@unused@*/ RCSID("$Id$"); #include "libyasm-stdint.h" #include "coretype.h" diff --git a/libyasm/value.h b/libyasm/value.h index 3d51ebaf..4dc294bc 100644 --- a/libyasm/value.h +++ b/libyasm/value.h @@ -2,10 +2,6 @@ * \file libyasm/value.h * \brief YASM value interface. * - * \rcs - * $Id$ - * \endrcs - * * \license * Copyright (C) 2006-2007 Peter Johnson * diff --git a/libyasm/xmalloc.c b/libyasm/xmalloc.c index 30b30f43..81b608c0 100644 --- a/libyasm/xmalloc.c +++ b/libyasm/xmalloc.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include "util.h" -RCSID("$Id$"); #include "coretype.h" #include "errwarn.h" diff --git a/libyasm/xstrdup.c b/libyasm/xstrdup.c index b0bbdfd3..b187704f 100644 --- a/libyasm/xstrdup.c +++ b/libyasm/xstrdup.c @@ -29,7 +29,6 @@ * SUCH DAMAGE. */ #include "util.h" -RCSID("$Id$"); #include "coretype.h" diff --git a/modules/Makefile.inc b/modules/Makefile.inc index 3ff8fd31..c220a84c 100644 --- a/modules/Makefile.inc +++ b/modules/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - EXTRA_DIST += modules/arch/Makefile.inc EXTRA_DIST += modules/listfmts/Makefile.inc EXTRA_DIST += modules/parsers/Makefile.inc diff --git a/modules/arch/Makefile.inc b/modules/arch/Makefile.inc index be5f2c55..5c5d9d15 100644 --- a/modules/arch/Makefile.inc +++ b/modules/arch/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - EXTRA_DIST += modules/arch/x86/Makefile.inc EXTRA_DIST += modules/arch/lc3b/Makefile.inc diff --git a/modules/arch/lc3b/Makefile.inc b/modules/arch/lc3b/Makefile.inc index 13cc33b8..fc30583d 100644 --- a/modules/arch/lc3b/Makefile.inc +++ b/modules/arch/lc3b/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - libyasm_a_SOURCES += modules/arch/lc3b/lc3barch.c libyasm_a_SOURCES += modules/arch/lc3b/lc3barch.h libyasm_a_SOURCES += modules/arch/lc3b/lc3bbc.c diff --git a/modules/arch/lc3b/lc3barch.c b/modules/arch/lc3b/lc3barch.c index 84f188a8..05145286 100644 --- a/modules/arch/lc3b/lc3barch.c +++ b/modules/arch/lc3b/lc3barch.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -/*@unused@*/ RCSID("$Id$"); #include diff --git a/modules/arch/lc3b/lc3barch.h b/modules/arch/lc3b/lc3barch.h index 4de0c45d..9ded8cbe 100644 --- a/modules/arch/lc3b/lc3barch.h +++ b/modules/arch/lc3b/lc3barch.h @@ -1,4 +1,4 @@ -/* $Id$ +/* * LC-3b Architecture header file * * Copyright (C) 2003-2007 Peter Johnson diff --git a/modules/arch/lc3b/lc3bbc.c b/modules/arch/lc3b/lc3bbc.c index 51029cdb..d077c7c5 100644 --- a/modules/arch/lc3b/lc3bbc.c +++ b/modules/arch/lc3b/lc3bbc.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -/*@unused@*/ RCSID("$Id$"); #include diff --git a/modules/arch/lc3b/lc3bid.re b/modules/arch/lc3b/lc3bid.re index de8a2bdf..2b3cf7a3 100644 --- a/modules/arch/lc3b/lc3bid.re +++ b/modules/arch/lc3b/lc3bid.re @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -RCSID("$Id$"); #include diff --git a/modules/arch/lc3b/tests/Makefile.inc b/modules/arch/lc3b/tests/Makefile.inc index 43b861ee..1ca39a3d 100644 --- a/modules/arch/lc3b/tests/Makefile.inc +++ b/modules/arch/lc3b/tests/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - TESTS += modules/arch/lc3b/tests/lc3b_test.sh EXTRA_DIST += modules/arch/lc3b/tests/lc3b_test.sh diff --git a/modules/arch/lc3b/tests/lc3b_test.sh b/modules/arch/lc3b/tests/lc3b_test.sh index 30ca95df..5c115817 100755 --- a/modules/arch/lc3b/tests/lc3b_test.sh +++ b/modules/arch/lc3b/tests/lc3b_test.sh @@ -1,4 +1,3 @@ #! /bin/sh -# $Id$ ${srcdir}/out_test.sh lc3b_test modules/arch/lc3b/tests "lc3b arch" "-a lc3b -f bin" "" exit $? diff --git a/modules/arch/x86/Makefile.inc b/modules/arch/x86/Makefile.inc index ef5e581d..e7b162e3 100644 --- a/modules/arch/x86/Makefile.inc +++ b/modules/arch/x86/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - libyasm_a_SOURCES += modules/arch/x86/x86arch.c libyasm_a_SOURCES += modules/arch/x86/x86arch.h libyasm_a_SOURCES += modules/arch/x86/x86bc.c diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index fdfe31d7..4de9d6cd 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -28,13 +28,8 @@ from sys import stdout, version_info -rcstag = "$Id$" -try: - scriptname = rcstag.split()[1] - scriptrev = rcstag.split()[2] -except IndexError: - scriptname = "gen_x86_insn.py" - scriptrev = "HEAD" +scriptname = "gen_x86_insn.py" +scriptrev = "HEAD" ordered_cpus = [ "086", "186", "286", "386", "486", "586", "686", "K6", "Athlon", "P3", diff --git a/modules/arch/x86/tests/Makefile.inc b/modules/arch/x86/tests/Makefile.inc index 07b13a80..c633e6c1 100644 --- a/modules/arch/x86/tests/Makefile.inc +++ b/modules/arch/x86/tests/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - TESTS += modules/arch/x86/tests/x86_test.sh EXTRA_DIST += modules/arch/x86/tests/x86_test.sh diff --git a/modules/arch/x86/tests/gas32/Makefile.inc b/modules/arch/x86/tests/gas32/Makefile.inc index 5fc0afbf..2f58c668 100644 --- a/modules/arch/x86/tests/gas32/Makefile.inc +++ b/modules/arch/x86/tests/gas32/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - TESTS += modules/arch/x86/tests/gas32/x86_gas32_test.sh EXTRA_DIST += modules/arch/x86/tests/gas32/x86_gas32_test.sh diff --git a/modules/arch/x86/tests/gas32/x86_gas32_test.sh b/modules/arch/x86/tests/gas32/x86_gas32_test.sh index af84899e..b1d6c03c 100755 --- a/modules/arch/x86/tests/gas32/x86_gas32_test.sh +++ b/modules/arch/x86/tests/gas32/x86_gas32_test.sh @@ -1,4 +1,3 @@ #! /bin/sh -# $Id$ ${srcdir}/out_test.sh x86_gas32_test modules/arch/x86/tests/gas32 "x86 gas format" "-f elf32 -p gas" ".o" exit $? diff --git a/modules/arch/x86/tests/gas64/Makefile.inc b/modules/arch/x86/tests/gas64/Makefile.inc index cfda8a56..00baf626 100644 --- a/modules/arch/x86/tests/gas64/Makefile.inc +++ b/modules/arch/x86/tests/gas64/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - TESTS += modules/arch/x86/tests/gas64/x86_gas64_test.sh EXTRA_DIST += modules/arch/x86/tests/gas64/x86_gas64_test.sh diff --git a/modules/arch/x86/tests/gas64/x86_gas64_test.sh b/modules/arch/x86/tests/gas64/x86_gas64_test.sh index 3379775c..b5b2cdf3 100755 --- a/modules/arch/x86/tests/gas64/x86_gas64_test.sh +++ b/modules/arch/x86/tests/gas64/x86_gas64_test.sh @@ -1,4 +1,3 @@ #! /bin/sh -# $Id$ ${srcdir}/out_test.sh x86_gas64_test modules/arch/x86/tests/gas64 "amd64 gas format" "-f elf -m amd64 -p gas" ".o" exit $? diff --git a/modules/arch/x86/tests/x86_test.sh b/modules/arch/x86/tests/x86_test.sh index d2e6e373..a4fd2e37 100755 --- a/modules/arch/x86/tests/x86_test.sh +++ b/modules/arch/x86/tests/x86_test.sh @@ -1,4 +1,3 @@ #! /bin/sh -# $Id$ ${srcdir}/out_test.sh x86_test modules/arch/x86/tests "x86 arch" "-f bin" "" exit $? diff --git a/modules/arch/x86/x86arch.c b/modules/arch/x86/x86arch.c index 95b7e385..833e94cd 100644 --- a/modules/arch/x86/x86arch.c +++ b/modules/arch/x86/x86arch.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -/*@unused@*/ RCSID("$Id$"); #include diff --git a/modules/arch/x86/x86arch.h b/modules/arch/x86/x86arch.h index c46ea5b8..0c387f70 100644 --- a/modules/arch/x86/x86arch.h +++ b/modules/arch/x86/x86arch.h @@ -1,4 +1,4 @@ -/* $Id$ +/* * x86 Architecture header file * * Copyright (C) 2001-2007 Peter Johnson diff --git a/modules/arch/x86/x86bc.c b/modules/arch/x86/x86bc.c index 8666943e..1670df78 100644 --- a/modules/arch/x86/x86bc.c +++ b/modules/arch/x86/x86bc.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -/*@unused@*/ RCSID("$Id$"); #include diff --git a/modules/arch/x86/x86cpu.gperf b/modules/arch/x86/x86cpu.gperf index 8939d636..669a588b 100644 --- a/modules/arch/x86/x86cpu.gperf +++ b/modules/arch/x86/x86cpu.gperf @@ -25,7 +25,6 @@ # POSSIBILITY OF SUCH DAMAGE. %{ #include -RCSID("$Id$"); #include #include diff --git a/modules/arch/x86/x86expr.c b/modules/arch/x86/x86expr.c index cacf827a..85feb785 100644 --- a/modules/arch/x86/x86expr.c +++ b/modules/arch/x86/x86expr.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -/*@unused@*/ RCSID("$Id$"); #include diff --git a/modules/arch/x86/x86id.c b/modules/arch/x86/x86id.c index 0e8a5be9..3f645b8e 100644 --- a/modules/arch/x86/x86id.c +++ b/modules/arch/x86/x86id.c @@ -26,7 +26,6 @@ */ #include #include -RCSID("$Id$"); #include #include diff --git a/modules/arch/x86/x86regtmod.gperf b/modules/arch/x86/x86regtmod.gperf index 5d6a3d22..64ee7d9d 100644 --- a/modules/arch/x86/x86regtmod.gperf +++ b/modules/arch/x86/x86regtmod.gperf @@ -25,7 +25,6 @@ # POSSIBILITY OF SUCH DAMAGE. %{ #include -RCSID("$Id$"); #include #include diff --git a/modules/arch/yasm_arch.xml b/modules/arch/yasm_arch.xml index 6ca9c9fd..a5e53ef6 100644 --- a/modules/arch/yasm_arch.xml +++ b/modules/arch/yasm_arch.xml @@ -2,8 +2,6 @@ - - diff --git a/modules/dbgfmts/Makefile.inc b/modules/dbgfmts/Makefile.inc index 7a5cf35a..8da62104 100644 --- a/modules/dbgfmts/Makefile.inc +++ b/modules/dbgfmts/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - EXTRA_DIST += modules/dbgfmts/codeview/Makefile.inc EXTRA_DIST += modules/dbgfmts/dwarf2/Makefile.inc EXTRA_DIST += modules/dbgfmts/null/Makefile.inc diff --git a/modules/dbgfmts/codeview/Makefile.inc b/modules/dbgfmts/codeview/Makefile.inc index 1a11f729..19f2db65 100644 --- a/modules/dbgfmts/codeview/Makefile.inc +++ b/modules/dbgfmts/codeview/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - libyasm_a_SOURCES += modules/dbgfmts/codeview/cv-dbgfmt.h libyasm_a_SOURCES += modules/dbgfmts/codeview/cv-dbgfmt.c libyasm_a_SOURCES += modules/dbgfmts/codeview/cv-symline.c diff --git a/modules/dbgfmts/codeview/cv-dbgfmt.c b/modules/dbgfmts/codeview/cv-dbgfmt.c index 65ce493e..9b06fe34 100644 --- a/modules/dbgfmts/codeview/cv-dbgfmt.c +++ b/modules/dbgfmts/codeview/cv-dbgfmt.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -/*@unused@*/ RCSID("$Id$"); #include diff --git a/modules/dbgfmts/codeview/cv-dbgfmt.h b/modules/dbgfmts/codeview/cv-dbgfmt.h index 5f415d7b..134b0b88 100644 --- a/modules/dbgfmts/codeview/cv-dbgfmt.h +++ b/modules/dbgfmts/codeview/cv-dbgfmt.h @@ -1,4 +1,4 @@ -/* $Id$ +/* * CodeView debugging formats implementation for Yasm * * Copyright (C) 2006-2007 Peter Johnson diff --git a/modules/dbgfmts/codeview/cv-symline.c b/modules/dbgfmts/codeview/cv-symline.c index 8a797295..2b71302a 100644 --- a/modules/dbgfmts/codeview/cv-symline.c +++ b/modules/dbgfmts/codeview/cv-symline.c @@ -28,7 +28,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -/*@unused@*/ RCSID("$Id$"); #include diff --git a/modules/dbgfmts/codeview/cv-type.c b/modules/dbgfmts/codeview/cv-type.c index 79516257..2a52f184 100644 --- a/modules/dbgfmts/codeview/cv-type.c +++ b/modules/dbgfmts/codeview/cv-type.c @@ -28,7 +28,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -/*@unused@*/ RCSID("$Id$"); #include diff --git a/modules/dbgfmts/dwarf2/Makefile.inc b/modules/dbgfmts/dwarf2/Makefile.inc index 602ae641..606b699e 100644 --- a/modules/dbgfmts/dwarf2/Makefile.inc +++ b/modules/dbgfmts/dwarf2/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - libyasm_a_SOURCES += modules/dbgfmts/dwarf2/dwarf2-dbgfmt.h libyasm_a_SOURCES += modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c libyasm_a_SOURCES += modules/dbgfmts/dwarf2/dwarf2-line.c diff --git a/modules/dbgfmts/dwarf2/dwarf2-aranges.c b/modules/dbgfmts/dwarf2/dwarf2-aranges.c index 0ab0dc58..f398b7fa 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-aranges.c +++ b/modules/dbgfmts/dwarf2/dwarf2-aranges.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -/*@unused@*/ RCSID("$Id$"); #include diff --git a/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c b/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c index 85c5e508..5b66f8a7 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c +++ b/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -/*@unused@*/ RCSID("$Id$"); #include diff --git a/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.h b/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.h index d939c1d4..03752345 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.h +++ b/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.h @@ -1,4 +1,4 @@ -/* $Id$ +/* * DWARF2 debugging format * * Copyright (C) 2006-2007 Peter Johnson diff --git a/modules/dbgfmts/dwarf2/dwarf2-info.c b/modules/dbgfmts/dwarf2/dwarf2-info.c index 72657504..7dbe43a9 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-info.c +++ b/modules/dbgfmts/dwarf2/dwarf2-info.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -/*@unused@*/ RCSID("$Id$"); #include diff --git a/modules/dbgfmts/dwarf2/dwarf2-line.c b/modules/dbgfmts/dwarf2/dwarf2-line.c index a1b0fe51..151dc198 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-line.c +++ b/modules/dbgfmts/dwarf2/dwarf2-line.c @@ -28,7 +28,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -/*@unused@*/ RCSID("$Id$"); #include diff --git a/modules/dbgfmts/dwarf2/tests/Makefile.inc b/modules/dbgfmts/dwarf2/tests/Makefile.inc index 5ae1d93a..e1dc1d4e 100644 --- a/modules/dbgfmts/dwarf2/tests/Makefile.inc +++ b/modules/dbgfmts/dwarf2/tests/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - EXTRA_DIST += modules/dbgfmts/dwarf2/tests/gen64/Makefile.inc EXTRA_DIST += modules/dbgfmts/dwarf2/tests/pass32/Makefile.inc EXTRA_DIST += modules/dbgfmts/dwarf2/tests/pass64/Makefile.inc diff --git a/modules/dbgfmts/dwarf2/tests/gen64/Makefile.inc b/modules/dbgfmts/dwarf2/tests/gen64/Makefile.inc index 66076da2..88ca78c6 100644 --- a/modules/dbgfmts/dwarf2/tests/gen64/Makefile.inc +++ b/modules/dbgfmts/dwarf2/tests/gen64/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - TESTS += modules/dbgfmts/dwarf2/tests/gen64/dwarf2_gen64_test.sh EXTRA_DIST += modules/dbgfmts/dwarf2/tests/gen64/dwarf2_gen64_test.sh diff --git a/modules/dbgfmts/dwarf2/tests/gen64/dwarf2_gen64_test.sh b/modules/dbgfmts/dwarf2/tests/gen64/dwarf2_gen64_test.sh index 07d1a1d7..dae5f429 100755 --- a/modules/dbgfmts/dwarf2/tests/gen64/dwarf2_gen64_test.sh +++ b/modules/dbgfmts/dwarf2/tests/gen64/dwarf2_gen64_test.sh @@ -1,4 +1,3 @@ #! /bin/sh -# $Id$ ${srcdir}/out_test.sh dwarf2_gen64_test modules/dbgfmts/dwarf2/tests/gen64 "dwarf2 dbgfmt gen64" "-f elf64 -g dwarf2" ".o" exit $? diff --git a/modules/dbgfmts/dwarf2/tests/pass32/Makefile.inc b/modules/dbgfmts/dwarf2/tests/pass32/Makefile.inc index 4c3fabc9..be69cbf8 100644 --- a/modules/dbgfmts/dwarf2/tests/pass32/Makefile.inc +++ b/modules/dbgfmts/dwarf2/tests/pass32/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - TESTS += modules/dbgfmts/dwarf2/tests/pass32/dwarf2_pass32_test.sh EXTRA_DIST += modules/dbgfmts/dwarf2/tests/pass32/dwarf2_pass32_test.sh diff --git a/modules/dbgfmts/dwarf2/tests/pass32/dwarf2_pass32_test.sh b/modules/dbgfmts/dwarf2/tests/pass32/dwarf2_pass32_test.sh index ba89b781..8b159a37 100755 --- a/modules/dbgfmts/dwarf2/tests/pass32/dwarf2_pass32_test.sh +++ b/modules/dbgfmts/dwarf2/tests/pass32/dwarf2_pass32_test.sh @@ -1,4 +1,3 @@ #! /bin/sh -# $Id$ ${srcdir}/out_test.sh dwarf2_pass32_test modules/dbgfmts/dwarf2/tests/pass32 "dwarf2 dbgfmt pass32" "-f elf -p gas -g dwarf2" ".o" exit $? diff --git a/modules/dbgfmts/dwarf2/tests/pass64/Makefile.inc b/modules/dbgfmts/dwarf2/tests/pass64/Makefile.inc index 2ca475d5..e9760145 100644 --- a/modules/dbgfmts/dwarf2/tests/pass64/Makefile.inc +++ b/modules/dbgfmts/dwarf2/tests/pass64/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - TESTS += modules/dbgfmts/dwarf2/tests/pass64/dwarf2_pass64_test.sh EXTRA_DIST += modules/dbgfmts/dwarf2/tests/pass64/dwarf2_pass64_test.sh diff --git a/modules/dbgfmts/dwarf2/tests/pass64/dwarf2_pass64_test.sh b/modules/dbgfmts/dwarf2/tests/pass64/dwarf2_pass64_test.sh index f4dddfe8..a377327c 100755 --- a/modules/dbgfmts/dwarf2/tests/pass64/dwarf2_pass64_test.sh +++ b/modules/dbgfmts/dwarf2/tests/pass64/dwarf2_pass64_test.sh @@ -1,4 +1,3 @@ #! /bin/sh -# $Id$ ${srcdir}/out_test.sh dwarf2_pass64_test modules/dbgfmts/dwarf2/tests/pass64 "dwarf2 dbgfmt pass64" "-f elf64 -p gas -g dwarf2" ".o" exit $? diff --git a/modules/dbgfmts/dwarf2/tests/passwin64/Makefile.inc b/modules/dbgfmts/dwarf2/tests/passwin64/Makefile.inc index 32027367..e1d9c4d9 100644 --- a/modules/dbgfmts/dwarf2/tests/passwin64/Makefile.inc +++ b/modules/dbgfmts/dwarf2/tests/passwin64/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - TESTS += modules/dbgfmts/dwarf2/tests/passwin64/dwarf2_passwin64_test.sh EXTRA_DIST += modules/dbgfmts/dwarf2/tests/passwin64/dwarf2_passwin64_test.sh diff --git a/modules/dbgfmts/dwarf2/tests/passwin64/dwarf2_passwin64_test.sh b/modules/dbgfmts/dwarf2/tests/passwin64/dwarf2_passwin64_test.sh index e892d33e..336ceab9 100755 --- a/modules/dbgfmts/dwarf2/tests/passwin64/dwarf2_passwin64_test.sh +++ b/modules/dbgfmts/dwarf2/tests/passwin64/dwarf2_passwin64_test.sh @@ -1,4 +1,3 @@ #! /bin/sh -# $Id$ ${srcdir}/out_test.sh dwarf2_passwin64_test modules/dbgfmts/dwarf2/tests/passwin64 "dwarf2 dbgfmt passwin64" "-f win64 -p gas -g dwarf2" ".o" exit $? diff --git a/modules/dbgfmts/null/Makefile.inc b/modules/dbgfmts/null/Makefile.inc index 6582d744..94f7cdbe 100644 --- a/modules/dbgfmts/null/Makefile.inc +++ b/modules/dbgfmts/null/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - libyasm_a_SOURCES += modules/dbgfmts/null/null-dbgfmt.c YASM_MODULES += dbgfmt_null diff --git a/modules/dbgfmts/null/null-dbgfmt.c b/modules/dbgfmts/null/null-dbgfmt.c index 1cf5f642..d2d1bed5 100644 --- a/modules/dbgfmts/null/null-dbgfmt.c +++ b/modules/dbgfmts/null/null-dbgfmt.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -/*@unused@*/ RCSID("$Id$"); #include diff --git a/modules/dbgfmts/stabs/Makefile.inc b/modules/dbgfmts/stabs/Makefile.inc index f5ba1422..745c0dec 100644 --- a/modules/dbgfmts/stabs/Makefile.inc +++ b/modules/dbgfmts/stabs/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - libyasm_a_SOURCES += modules/dbgfmts/stabs/stabs-dbgfmt.c YASM_MODULES += dbgfmt_stabs diff --git a/modules/dbgfmts/stabs/stabs-dbgfmt.c b/modules/dbgfmts/stabs/stabs-dbgfmt.c index a4ad2894..c8cf9b39 100644 --- a/modules/dbgfmts/stabs/stabs-dbgfmt.c +++ b/modules/dbgfmts/stabs/stabs-dbgfmt.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -/*@unused@*/ RCSID("$Id$"); #include diff --git a/modules/dbgfmts/stabs/tests/Makefile.inc b/modules/dbgfmts/stabs/tests/Makefile.inc index 9563d9c5..6f789eb8 100644 --- a/modules/dbgfmts/stabs/tests/Makefile.inc +++ b/modules/dbgfmts/stabs/tests/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - EXTRA_DIST += modules/dbgfmts/stabs/tests/stabs_test.sh TESTS += modules/dbgfmts/stabs/tests/stabs_test.sh diff --git a/modules/dbgfmts/stabs/tests/stabs_test.sh b/modules/dbgfmts/stabs/tests/stabs_test.sh index 64f24f33..e04b9522 100755 --- a/modules/dbgfmts/stabs/tests/stabs_test.sh +++ b/modules/dbgfmts/stabs/tests/stabs_test.sh @@ -1,5 +1,4 @@ #! /bin/sh -# $Id$ # copied from yasm/modules/objfmts/coff/tests/coff_test.sh ; s/coff/stabs/g ${srcdir}/out_test.sh stabs_test modules/dbgfmts/stabs/tests "stabs dbgfmt" "-f elf -g stabs" ".o" exit $? diff --git a/modules/dbgfmts/yasm_dbgfmts.xml b/modules/dbgfmts/yasm_dbgfmts.xml index 5b15925f..7cd38a49 100644 --- a/modules/dbgfmts/yasm_dbgfmts.xml +++ b/modules/dbgfmts/yasm_dbgfmts.xml @@ -2,8 +2,6 @@ - - diff --git a/modules/listfmts/Makefile.inc b/modules/listfmts/Makefile.inc index 2621412e..77fb2ec5 100644 --- a/modules/listfmts/Makefile.inc +++ b/modules/listfmts/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - EXTRA_DIST += modules/listfmts/nasm/Makefile.inc include modules/listfmts/nasm/Makefile.inc diff --git a/modules/listfmts/nasm/Makefile.inc b/modules/listfmts/nasm/Makefile.inc index 7df9badc..6f00499e 100644 --- a/modules/listfmts/nasm/Makefile.inc +++ b/modules/listfmts/nasm/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - libyasm_a_SOURCES += modules/listfmts/nasm/nasm-listfmt.c YASM_MODULES += listfmt_nasm diff --git a/modules/listfmts/nasm/nasm-listfmt.c b/modules/listfmts/nasm/nasm-listfmt.c index ef5adde1..1dfc5b62 100644 --- a/modules/listfmts/nasm/nasm-listfmt.c +++ b/modules/listfmts/nasm/nasm-listfmt.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -/*@unused@*/ RCSID("$Id$"); #include diff --git a/modules/objfmts/Makefile.inc b/modules/objfmts/Makefile.inc index f927a09c..a76359a4 100644 --- a/modules/objfmts/Makefile.inc +++ b/modules/objfmts/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - EXTRA_DIST += modules/objfmts/dbg/Makefile.inc EXTRA_DIST += modules/objfmts/bin/Makefile.inc EXTRA_DIST += modules/objfmts/elf/Makefile.inc diff --git a/modules/objfmts/bin/Makefile.inc b/modules/objfmts/bin/Makefile.inc index a7539fe8..ae23cfe7 100644 --- a/modules/objfmts/bin/Makefile.inc +++ b/modules/objfmts/bin/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - libyasm_a_SOURCES += modules/objfmts/bin/bin-objfmt.c YASM_MODULES += objfmt_bin objfmt_dosexe diff --git a/modules/objfmts/bin/bin-objfmt.c b/modules/objfmts/bin/bin-objfmt.c index 8d3abf8c..5f422245 100644 --- a/modules/objfmts/bin/bin-objfmt.c +++ b/modules/objfmts/bin/bin-objfmt.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -/*@unused@*/ RCSID("$Id$"); #ifdef HAVE_UNISTD_H #include diff --git a/modules/objfmts/bin/tests/Makefile.inc b/modules/objfmts/bin/tests/Makefile.inc index 92b85ff6..e29ed72f 100644 --- a/modules/objfmts/bin/tests/Makefile.inc +++ b/modules/objfmts/bin/tests/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - TESTS += modules/objfmts/bin/tests/bin_test.sh EXTRA_DIST += modules/objfmts/bin/tests/bin_test.sh diff --git a/modules/objfmts/bin/tests/bin_test.sh b/modules/objfmts/bin/tests/bin_test.sh index 49f4897c..9ab7e41a 100755 --- a/modules/objfmts/bin/tests/bin_test.sh +++ b/modules/objfmts/bin/tests/bin_test.sh @@ -1,4 +1,3 @@ #! /bin/sh -# $Id$ ${srcdir}/out_test.sh bin_test modules/objfmts/bin/tests "bin objfmt" "-f bin" "" exit $? diff --git a/modules/objfmts/bin/tests/multisect/Makefile.inc b/modules/objfmts/bin/tests/multisect/Makefile.inc index 93c1423b..dcb7d62a 100644 --- a/modules/objfmts/bin/tests/multisect/Makefile.inc +++ b/modules/objfmts/bin/tests/multisect/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - TESTS += modules/objfmts/bin/tests/multisect/bin_multi_test.sh EXTRA_DIST += modules/objfmts/bin/tests/multisect/bin_multi_test.sh diff --git a/modules/objfmts/bin/tests/multisect/bin_multi_test.sh b/modules/objfmts/bin/tests/multisect/bin_multi_test.sh index acf6ae7c..aa3f616c 100755 --- a/modules/objfmts/bin/tests/multisect/bin_multi_test.sh +++ b/modules/objfmts/bin/tests/multisect/bin_multi_test.sh @@ -1,5 +1,4 @@ #! /bin/sh -# $Id$ YASM_TEST_SUITE=1 export YASM_TEST_SUITE diff --git a/modules/objfmts/coff/Makefile.inc b/modules/objfmts/coff/Makefile.inc index e9e8576d..9564fed3 100644 --- a/modules/objfmts/coff/Makefile.inc +++ b/modules/objfmts/coff/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - libyasm_a_SOURCES += modules/objfmts/coff/coff-objfmt.c libyasm_a_SOURCES += modules/objfmts/coff/coff-objfmt.h libyasm_a_SOURCES += modules/objfmts/coff/win64-except.c diff --git a/modules/objfmts/coff/coff-objfmt.c b/modules/objfmts/coff/coff-objfmt.c index 0591884e..4278fa6d 100644 --- a/modules/objfmts/coff/coff-objfmt.c +++ b/modules/objfmts/coff/coff-objfmt.c @@ -26,7 +26,6 @@ */ #include #include -/*@unused@*/ RCSID("$Id$"); #include diff --git a/modules/objfmts/coff/coff-objfmt.h b/modules/objfmts/coff/coff-objfmt.h index 1360eade..10d88a09 100644 --- a/modules/objfmts/coff/coff-objfmt.h +++ b/modules/objfmts/coff/coff-objfmt.h @@ -1,4 +1,4 @@ -/* $Id$ +/* * COFF (DJGPP) object format * * Copyright (C) 2007 Peter Johnson diff --git a/modules/objfmts/coff/tests/Makefile.inc b/modules/objfmts/coff/tests/Makefile.inc index 869d0f87..aafdfbf2 100644 --- a/modules/objfmts/coff/tests/Makefile.inc +++ b/modules/objfmts/coff/tests/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - TESTS += modules/objfmts/coff/tests/coff_test.sh EXTRA_DIST += modules/objfmts/coff/tests/coff_test.sh diff --git a/modules/objfmts/coff/tests/coff_test.sh b/modules/objfmts/coff/tests/coff_test.sh index 42f82a76..eec61beb 100755 --- a/modules/objfmts/coff/tests/coff_test.sh +++ b/modules/objfmts/coff/tests/coff_test.sh @@ -1,4 +1,3 @@ #! /bin/sh -# $Id$ ${srcdir}/out_test.sh coff_test modules/objfmts/coff/tests "coff objfmt" "-f coff" ".o" exit $? diff --git a/modules/objfmts/coff/win64-except.c b/modules/objfmts/coff/win64-except.c index 71d6228b..8c8ecbbc 100644 --- a/modules/objfmts/coff/win64-except.c +++ b/modules/objfmts/coff/win64-except.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -/*@unused@*/ RCSID("$Id$"); #include diff --git a/modules/objfmts/dbg/Makefile.inc b/modules/objfmts/dbg/Makefile.inc index 4ccfb570..cfc9b75b 100644 --- a/modules/objfmts/dbg/Makefile.inc +++ b/modules/objfmts/dbg/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - libyasm_a_SOURCES += modules/objfmts/dbg/dbg-objfmt.c YASM_MODULES += objfmt_dbg diff --git a/modules/objfmts/dbg/dbg-objfmt.c b/modules/objfmts/dbg/dbg-objfmt.c index a6017f09..bdf403c7 100644 --- a/modules/objfmts/dbg/dbg-objfmt.c +++ b/modules/objfmts/dbg/dbg-objfmt.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -/*@unused@*/ RCSID("$Id$"); #include diff --git a/modules/objfmts/elf/Makefile.inc b/modules/objfmts/elf/Makefile.inc index 7e37b5ba..659f867e 100644 --- a/modules/objfmts/elf/Makefile.inc +++ b/modules/objfmts/elf/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - libyasm_a_SOURCES += modules/objfmts/elf/elf.c libyasm_a_SOURCES += modules/objfmts/elf/elf.h libyasm_a_SOURCES += modules/objfmts/elf/elf-objfmt.c diff --git a/modules/objfmts/elf/elf-machine.h b/modules/objfmts/elf/elf-machine.h index 51a4ca78..ea6cb4ec 100644 --- a/modules/objfmts/elf/elf-machine.h +++ b/modules/objfmts/elf/elf-machine.h @@ -1,4 +1,4 @@ -/* $Id:$ +/* * ELF object machine specific format helpers * * Copyright (C) 2004-2007 Michael Urman diff --git a/modules/objfmts/elf/elf-objfmt.c b/modules/objfmts/elf/elf-objfmt.c index 04bc7baa..1cf725f0 100644 --- a/modules/objfmts/elf/elf-objfmt.c +++ b/modules/objfmts/elf/elf-objfmt.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -/*@unused@*/ RCSID("$Id$"); /* Notes * diff --git a/modules/objfmts/elf/elf-x86-amd64.c b/modules/objfmts/elf/elf-x86-amd64.c index 16d70f9a..3ba376af 100644 --- a/modules/objfmts/elf/elf-x86-amd64.c +++ b/modules/objfmts/elf/elf-x86-amd64.c @@ -26,7 +26,6 @@ */ #include -/*@unused@*/ RCSID("$Id$"); #include #define YASM_OBJFMT_ELF_INTERNAL diff --git a/modules/objfmts/elf/elf-x86-x86.c b/modules/objfmts/elf/elf-x86-x86.c index 6e523a6d..d79ec6ea 100644 --- a/modules/objfmts/elf/elf-x86-x86.c +++ b/modules/objfmts/elf/elf-x86-x86.c @@ -26,7 +26,6 @@ */ #include -/*@unused@*/ RCSID("$Id$"); #include #define YASM_OBJFMT_ELF_INTERNAL diff --git a/modules/objfmts/elf/elf.c b/modules/objfmts/elf/elf.c index acd83d4e..b9157812 100644 --- a/modules/objfmts/elf/elf.c +++ b/modules/objfmts/elf/elf.c @@ -26,7 +26,6 @@ */ #include -/*@unused@*/ RCSID("$Id$"); #include #define YASM_OBJFMT_ELF_INTERNAL diff --git a/modules/objfmts/elf/elf.h b/modules/objfmts/elf/elf.h index 84fe83a3..fce629ae 100644 --- a/modules/objfmts/elf/elf.h +++ b/modules/objfmts/elf/elf.h @@ -1,4 +1,4 @@ -/* $Id$ +/* * ELF object format helpers * * Copyright (C) 2003-2007 Michael Urman diff --git a/modules/objfmts/elf/tests/Makefile.inc b/modules/objfmts/elf/tests/Makefile.inc index 6ed13e72..e6d421c0 100644 --- a/modules/objfmts/elf/tests/Makefile.inc +++ b/modules/objfmts/elf/tests/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - TESTS += modules/objfmts/elf/tests/elf_test.sh EXTRA_DIST += modules/objfmts/elf/tests/elf_test.sh diff --git a/modules/objfmts/elf/tests/amd64/Makefile.inc b/modules/objfmts/elf/tests/amd64/Makefile.inc index 7d10d9c1..deb54bc0 100644 --- a/modules/objfmts/elf/tests/amd64/Makefile.inc +++ b/modules/objfmts/elf/tests/amd64/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - TESTS += modules/objfmts/elf/tests/amd64/elf_amd64_test.sh EXTRA_DIST += modules/objfmts/elf/tests/amd64/elf_amd64_test.sh diff --git a/modules/objfmts/elf/tests/amd64/elf_amd64_test.sh b/modules/objfmts/elf/tests/amd64/elf_amd64_test.sh index 239443da..1f48a32a 100755 --- a/modules/objfmts/elf/tests/amd64/elf_amd64_test.sh +++ b/modules/objfmts/elf/tests/amd64/elf_amd64_test.sh @@ -1,4 +1,3 @@ #! /bin/sh -# $Id$ ${srcdir}/out_test.sh elf_amd64_test modules/objfmts/elf/tests/amd64 "elf-amd64 objfmt" "-m amd64 -f elf" ".o" exit $? diff --git a/modules/objfmts/elf/tests/elf_test.sh b/modules/objfmts/elf/tests/elf_test.sh index 420eab36..ed3766ec 100755 --- a/modules/objfmts/elf/tests/elf_test.sh +++ b/modules/objfmts/elf/tests/elf_test.sh @@ -1,5 +1,4 @@ #! /bin/sh -# $Id$ # copied from yasm/modules/objfmts/coff/tests/coff_test.sh ; s/coff/elf/g ${srcdir}/out_test.sh elf_test modules/objfmts/elf/tests "elf objfmt" "-f elf" ".o" exit $? diff --git a/modules/objfmts/elf/tests/gas32/Makefile.inc b/modules/objfmts/elf/tests/gas32/Makefile.inc index 506e3bc5..883c2143 100644 --- a/modules/objfmts/elf/tests/gas32/Makefile.inc +++ b/modules/objfmts/elf/tests/gas32/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - TESTS += modules/objfmts/elf/tests/gas32/elf_gas32_test.sh EXTRA_DIST += modules/objfmts/elf/tests/gas32/elf_gas32_test.sh diff --git a/modules/objfmts/elf/tests/gas32/elf_gas32_test.sh b/modules/objfmts/elf/tests/gas32/elf_gas32_test.sh index ca0df39a..4d346911 100755 --- a/modules/objfmts/elf/tests/gas32/elf_gas32_test.sh +++ b/modules/objfmts/elf/tests/gas32/elf_gas32_test.sh @@ -1,4 +1,3 @@ #! /bin/sh -# $Id$ ${srcdir}/out_test.sh elf_gas32_test modules/objfmts/elf/tests/gas32 "GAS elf-x86 objfmt" "-f elf32 -p gas" ".o" exit $? diff --git a/modules/objfmts/elf/tests/gas64/Makefile.inc b/modules/objfmts/elf/tests/gas64/Makefile.inc index 8cedf046..382744d1 100644 --- a/modules/objfmts/elf/tests/gas64/Makefile.inc +++ b/modules/objfmts/elf/tests/gas64/Makefile.inc @@ -1,5 +1,3 @@ -# $Id: Makefile.inc 1168 2004-10-31 01:07:52Z peter $ - TESTS += modules/objfmts/elf/tests/gas64/elf_gas64_test.sh EXTRA_DIST += modules/objfmts/elf/tests/gas64/elf_gas64_test.sh diff --git a/modules/objfmts/elf/tests/gas64/elf_gas64_test.sh b/modules/objfmts/elf/tests/gas64/elf_gas64_test.sh index de90bc13..6696ba7e 100755 --- a/modules/objfmts/elf/tests/gas64/elf_gas64_test.sh +++ b/modules/objfmts/elf/tests/gas64/elf_gas64_test.sh @@ -1,4 +1,3 @@ #! /bin/sh -# $Id: elf_amd64_test.sh 1137 2004-09-04 01:24:57Z peter $ ${srcdir}/out_test.sh elf_gas64_test modules/objfmts/elf/tests/gas64 "GAS elf-amd64 objfmt" "-f elf64 -p gas" ".o" exit $? diff --git a/modules/objfmts/macho/Makefile.inc b/modules/objfmts/macho/Makefile.inc index be9f4bcb..39eff297 100644 --- a/modules/objfmts/macho/Makefile.inc +++ b/modules/objfmts/macho/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - libyasm_a_SOURCES += modules/objfmts/macho/macho-objfmt.c YASM_MODULES += objfmt_macho objfmt_macho32 objfmt_macho64 diff --git a/modules/objfmts/macho/macho-objfmt.c b/modules/objfmts/macho/macho-objfmt.c index c80e315a..89b0be47 100644 --- a/modules/objfmts/macho/macho-objfmt.c +++ b/modules/objfmts/macho/macho-objfmt.c @@ -91,7 +91,6 @@ */ #include -/*@unused@*/ RCSID("$Id$"); #include diff --git a/modules/objfmts/macho/tests/Makefile.inc b/modules/objfmts/macho/tests/Makefile.inc index bff27f5b..e8b4dc1f 100644 --- a/modules/objfmts/macho/tests/Makefile.inc +++ b/modules/objfmts/macho/tests/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - EXTRA_DIST += modules/objfmts/macho/tests/gas32/Makefile.inc EXTRA_DIST += modules/objfmts/macho/tests/gas64/Makefile.inc EXTRA_DIST += modules/objfmts/macho/tests/nasm32/Makefile.inc diff --git a/modules/objfmts/macho/tests/gas32/Makefile.inc b/modules/objfmts/macho/tests/gas32/Makefile.inc index ac36c09c..a02b3b3e 100644 --- a/modules/objfmts/macho/tests/gas32/Makefile.inc +++ b/modules/objfmts/macho/tests/gas32/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - TESTS += modules/objfmts/macho/tests/gas32/gas_macho32_test.sh EXTRA_DIST += modules/objfmts/macho/tests/gas32/gas_macho32_test.sh diff --git a/modules/objfmts/macho/tests/gas32/gas_macho32_test.sh b/modules/objfmts/macho/tests/gas32/gas_macho32_test.sh index 48f871d4..45a1e104 100755 --- a/modules/objfmts/macho/tests/gas32/gas_macho32_test.sh +++ b/modules/objfmts/macho/tests/gas32/gas_macho32_test.sh @@ -1,4 +1,3 @@ #! /bin/sh -# $Id$ ${srcdir}/out_test.sh macho_test modules/objfmts/macho/tests/gas32 "GAS 32-bit macho objfmt" "-f macho32 -p gas" ".o" exit $? diff --git a/modules/objfmts/macho/tests/gas64/Makefile.inc b/modules/objfmts/macho/tests/gas64/Makefile.inc index 24398843..ec99a219 100644 --- a/modules/objfmts/macho/tests/gas64/Makefile.inc +++ b/modules/objfmts/macho/tests/gas64/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - TESTS += modules/objfmts/macho/tests/gas64/gas_macho64_test.sh EXTRA_DIST += modules/objfmts/macho/tests/gas64/gas_macho64_test.sh diff --git a/modules/objfmts/macho/tests/gas64/gas_macho64_test.sh b/modules/objfmts/macho/tests/gas64/gas_macho64_test.sh index 577bf83f..d3ead46c 100755 --- a/modules/objfmts/macho/tests/gas64/gas_macho64_test.sh +++ b/modules/objfmts/macho/tests/gas64/gas_macho64_test.sh @@ -1,4 +1,3 @@ #! /bin/sh -# $Id$ ${srcdir}/out_test.sh macho_test modules/objfmts/macho/tests/gas64 "GAS 64-bit macho objfmt" "-f macho64 -p gas" ".o" exit $? diff --git a/modules/objfmts/macho/tests/nasm32/Makefile.inc b/modules/objfmts/macho/tests/nasm32/Makefile.inc index d93e7ecf..2bb2d986 100644 --- a/modules/objfmts/macho/tests/nasm32/Makefile.inc +++ b/modules/objfmts/macho/tests/nasm32/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - TESTS += modules/objfmts/macho/tests/nasm32/macho32_test.sh EXTRA_DIST += modules/objfmts/macho/tests/nasm32/macho32_test.sh diff --git a/modules/objfmts/macho/tests/nasm32/macho32_test.sh b/modules/objfmts/macho/tests/nasm32/macho32_test.sh index 64d9c4a3..e5fdcc95 100755 --- a/modules/objfmts/macho/tests/nasm32/macho32_test.sh +++ b/modules/objfmts/macho/tests/nasm32/macho32_test.sh @@ -1,4 +1,3 @@ #! /bin/sh -# $Id$ ${srcdir}/out_test.sh macho_test modules/objfmts/macho/tests/nasm32 "32-bit macho objfmt" "-f macho32" ".o" exit $? diff --git a/modules/objfmts/macho/tests/nasm64/Makefile.inc b/modules/objfmts/macho/tests/nasm64/Makefile.inc index 502edca0..93ec45e9 100644 --- a/modules/objfmts/macho/tests/nasm64/Makefile.inc +++ b/modules/objfmts/macho/tests/nasm64/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - TESTS += modules/objfmts/macho/tests/nasm64/macho64_test.sh EXTRA_DIST += modules/objfmts/macho/tests/nasm64/nasm-macho64-pic.asm diff --git a/modules/objfmts/macho/tests/nasm64/macho64_test.sh b/modules/objfmts/macho/tests/nasm64/macho64_test.sh index 30e23248..f7c0bfbb 100755 --- a/modules/objfmts/macho/tests/nasm64/macho64_test.sh +++ b/modules/objfmts/macho/tests/nasm64/macho64_test.sh @@ -1,4 +1,3 @@ #! /bin/sh -# $Id$ ${srcdir}/out_test.sh macho_test modules/objfmts/macho/tests/nasm64 "64-bit macho objfmt" "-f macho64" ".o" exit $? diff --git a/modules/objfmts/rdf/Makefile.inc b/modules/objfmts/rdf/Makefile.inc index ef33dffb..f5e01e15 100644 --- a/modules/objfmts/rdf/Makefile.inc +++ b/modules/objfmts/rdf/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - libyasm_a_SOURCES += modules/objfmts/rdf/rdf-objfmt.c YASM_MODULES += objfmt_rdf diff --git a/modules/objfmts/rdf/rdf-objfmt.c b/modules/objfmts/rdf/rdf-objfmt.c index 69ce08b5..d081fc54 100644 --- a/modules/objfmts/rdf/rdf-objfmt.c +++ b/modules/objfmts/rdf/rdf-objfmt.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -/*@unused@*/ RCSID("$Id$"); #include diff --git a/modules/objfmts/rdf/tests/Makefile.inc b/modules/objfmts/rdf/tests/Makefile.inc index 39f6aab3..c547e8fd 100644 --- a/modules/objfmts/rdf/tests/Makefile.inc +++ b/modules/objfmts/rdf/tests/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - TESTS += modules/objfmts/rdf/tests/rdf_test.sh EXTRA_DIST += modules/objfmts/rdf/tests/rdf_test.sh diff --git a/modules/objfmts/rdf/tests/rdf_test.sh b/modules/objfmts/rdf/tests/rdf_test.sh index 9161c378..46584395 100755 --- a/modules/objfmts/rdf/tests/rdf_test.sh +++ b/modules/objfmts/rdf/tests/rdf_test.sh @@ -1,4 +1,3 @@ #! /bin/sh -# $Id$ ${srcdir}/out_test.sh rdf_test modules/objfmts/rdf/tests "rdf objfmt" "-f rdf" ".rdf" exit $? diff --git a/modules/objfmts/win32/Makefile.inc b/modules/objfmts/win32/Makefile.inc index ce4964fe..5b3b1626 100644 --- a/modules/objfmts/win32/Makefile.inc +++ b/modules/objfmts/win32/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - # Assume objfmt_coff is included YASM_MODULES += objfmt_win32 diff --git a/modules/objfmts/win32/tests/Makefile.inc b/modules/objfmts/win32/tests/Makefile.inc index b2b6800c..3f2ab943 100644 --- a/modules/objfmts/win32/tests/Makefile.inc +++ b/modules/objfmts/win32/tests/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - TESTS += modules/objfmts/win32/tests/win32_test.sh EXTRA_DIST += modules/objfmts/win32/tests/export.asm diff --git a/modules/objfmts/win32/tests/gas/Makefile.inc b/modules/objfmts/win32/tests/gas/Makefile.inc index b2948acf..f492cbac 100644 --- a/modules/objfmts/win32/tests/gas/Makefile.inc +++ b/modules/objfmts/win32/tests/gas/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - TESTS += modules/objfmts/win32/tests/gas/win32_gas_test.sh EXTRA_DIST += modules/objfmts/win32/tests/gas/win32_gas_test.sh diff --git a/modules/objfmts/win32/tests/gas/win32_gas_test.sh b/modules/objfmts/win32/tests/gas/win32_gas_test.sh index ed5e3c32..4a1bbe98 100755 --- a/modules/objfmts/win32/tests/gas/win32_gas_test.sh +++ b/modules/objfmts/win32/tests/gas/win32_gas_test.sh @@ -1,4 +1,3 @@ #! /bin/sh -# $Id$ ${srcdir}/out_test.sh win32_gas_test modules/objfmts/win32/tests/gas "win32 objfmt" "-f win32 -p gas" ".obj" exit $? diff --git a/modules/objfmts/win32/tests/win32_test.sh b/modules/objfmts/win32/tests/win32_test.sh index cd2ab008..6ffb349d 100755 --- a/modules/objfmts/win32/tests/win32_test.sh +++ b/modules/objfmts/win32/tests/win32_test.sh @@ -1,4 +1,3 @@ #! /bin/sh -# $Id$ ${srcdir}/out_test.sh win32_test modules/objfmts/win32/tests "win32 objfmt" "-f win32" ".obj" exit $? diff --git a/modules/objfmts/win64/Makefile.inc b/modules/objfmts/win64/Makefile.inc index 72dcd716..545c847e 100644 --- a/modules/objfmts/win64/Makefile.inc +++ b/modules/objfmts/win64/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - # Assume objfmt_coff is included YASM_MODULES += objfmt_win64 objfmt_x64 diff --git a/modules/objfmts/win64/tests/Makefile.inc b/modules/objfmts/win64/tests/Makefile.inc index ed104766..d1096268 100644 --- a/modules/objfmts/win64/tests/Makefile.inc +++ b/modules/objfmts/win64/tests/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - TESTS += modules/objfmts/win64/tests/win64_test.sh EXTRA_DIST += modules/objfmts/win64/tests/win64_test.sh diff --git a/modules/objfmts/win64/tests/gas/Makefile.inc b/modules/objfmts/win64/tests/gas/Makefile.inc index 0d16bd12..0faeec78 100644 --- a/modules/objfmts/win64/tests/gas/Makefile.inc +++ b/modules/objfmts/win64/tests/gas/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - TESTS += modules/objfmts/win64/tests/gas/win64_gas_test.sh EXTRA_DIST += modules/objfmts/win64/tests/gas/win64_gas_test.sh diff --git a/modules/objfmts/win64/tests/gas/win64_gas_test.sh b/modules/objfmts/win64/tests/gas/win64_gas_test.sh index 55753839..efc76882 100755 --- a/modules/objfmts/win64/tests/gas/win64_gas_test.sh +++ b/modules/objfmts/win64/tests/gas/win64_gas_test.sh @@ -1,4 +1,3 @@ #! /bin/sh -# $Id$ ${srcdir}/out_test.sh win64_gas_test modules/objfmts/win64/tests/gas "win64 objfmt" "-f win64 -p gas -r nasm" ".obj" exit $? diff --git a/modules/objfmts/win64/tests/win64_test.sh b/modules/objfmts/win64/tests/win64_test.sh index bf7f2d3c..4616900f 100755 --- a/modules/objfmts/win64/tests/win64_test.sh +++ b/modules/objfmts/win64/tests/win64_test.sh @@ -1,4 +1,3 @@ #! /bin/sh -# $Id$ ${srcdir}/out_test.sh win64_test modules/objfmts/win64/tests "win64 objfmt" "-f win64" ".obj" exit $? diff --git a/modules/objfmts/xdf/Makefile.inc b/modules/objfmts/xdf/Makefile.inc index 955ef218..ffdc68b8 100644 --- a/modules/objfmts/xdf/Makefile.inc +++ b/modules/objfmts/xdf/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - libyasm_a_SOURCES += modules/objfmts/xdf/xdf-objfmt.c YASM_MODULES += objfmt_xdf diff --git a/modules/objfmts/xdf/tests/Makefile.inc b/modules/objfmts/xdf/tests/Makefile.inc index 7bd402dc..c39ba301 100644 --- a/modules/objfmts/xdf/tests/Makefile.inc +++ b/modules/objfmts/xdf/tests/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - TESTS += modules/objfmts/xdf/tests/xdf_test.sh EXTRA_DIST += modules/objfmts/xdf/tests/xdf_test.sh diff --git a/modules/objfmts/xdf/tests/xdf_test.sh b/modules/objfmts/xdf/tests/xdf_test.sh index 11640fa8..ee9d5d5f 100755 --- a/modules/objfmts/xdf/tests/xdf_test.sh +++ b/modules/objfmts/xdf/tests/xdf_test.sh @@ -1,4 +1,3 @@ #! /bin/sh -# $Id$ ${srcdir}/out_test.sh xdf_test modules/objfmts/xdf/tests "xdf objfmt" "-f xdf" ".xdf" exit $? diff --git a/modules/objfmts/xdf/xdf-objfmt.c b/modules/objfmts/xdf/xdf-objfmt.c index c96786b1..aac6e777 100644 --- a/modules/objfmts/xdf/xdf-objfmt.c +++ b/modules/objfmts/xdf/xdf-objfmt.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -/*@unused@*/ RCSID("$Id$"); #include diff --git a/modules/objfmts/yasm_objfmts.xml b/modules/objfmts/yasm_objfmts.xml index 3a70fedc..13811a07 100644 --- a/modules/objfmts/yasm_objfmts.xml +++ b/modules/objfmts/yasm_objfmts.xml @@ -2,8 +2,6 @@ - - diff --git a/modules/parsers/Makefile.inc b/modules/parsers/Makefile.inc index 5daba560..b432fa9e 100644 --- a/modules/parsers/Makefile.inc +++ b/modules/parsers/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - EXTRA_DIST += modules/parsers/gas/Makefile.inc EXTRA_DIST += modules/parsers/nasm/Makefile.inc diff --git a/modules/parsers/gas/Makefile.inc b/modules/parsers/gas/Makefile.inc index ebc36576..a0264cc6 100644 --- a/modules/parsers/gas/Makefile.inc +++ b/modules/parsers/gas/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - libyasm_a_SOURCES += modules/parsers/gas/gas-parser.c libyasm_a_SOURCES += modules/parsers/gas/gas-parser.h libyasm_a_SOURCES += modules/parsers/gas/gas-parse.c diff --git a/modules/parsers/gas/gas-parse-intel.c b/modules/parsers/gas/gas-parse-intel.c index ca54d2ed..9d412fc7 100644 --- a/modules/parsers/gas/gas-parse-intel.c +++ b/modules/parsers/gas/gas-parse-intel.c @@ -28,7 +28,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -RCSID("$Id$"); #include diff --git a/modules/parsers/gas/gas-parse.c b/modules/parsers/gas/gas-parse.c index 8ab7a41b..56fb8541 100644 --- a/modules/parsers/gas/gas-parse.c +++ b/modules/parsers/gas/gas-parse.c @@ -28,7 +28,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -RCSID("$Id$"); #include diff --git a/modules/parsers/gas/gas-parser.c b/modules/parsers/gas/gas-parser.c index 948341d9..088bcdad 100644 --- a/modules/parsers/gas/gas-parser.c +++ b/modules/parsers/gas/gas-parser.c @@ -28,7 +28,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -/*@unused@*/ RCSID("$Id$"); #include diff --git a/modules/parsers/gas/gas-parser.h b/modules/parsers/gas/gas-parser.h index 2b1d311a..99659e96 100644 --- a/modules/parsers/gas/gas-parser.h +++ b/modules/parsers/gas/gas-parser.h @@ -1,4 +1,4 @@ -/* $Id$ +/* * GAS-compatible parser header file * * Copyright (C) 2005-2007 Peter Johnson diff --git a/modules/parsers/gas/gas-token.re b/modules/parsers/gas/gas-token.re index f2212af5..1a8673db 100644 --- a/modules/parsers/gas/gas-token.re +++ b/modules/parsers/gas/gas-token.re @@ -28,7 +28,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -RCSID("$Id$"); #include diff --git a/modules/parsers/gas/tests/Makefile.inc b/modules/parsers/gas/tests/Makefile.inc index aee3c461..c288adcf 100644 --- a/modules/parsers/gas/tests/Makefile.inc +++ b/modules/parsers/gas/tests/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - TESTS += modules/parsers/gas/tests/gas_test.sh EXTRA_DIST += modules/parsers/gas/tests/gas_test.sh diff --git a/modules/parsers/gas/tests/bin/Makefile.inc b/modules/parsers/gas/tests/bin/Makefile.inc index bc8f6174..5428d144 100644 --- a/modules/parsers/gas/tests/bin/Makefile.inc +++ b/modules/parsers/gas/tests/bin/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - TESTS += modules/parsers/gas/tests/bin/gas_bin_test.sh EXTRA_DIST += modules/parsers/gas/tests/bin/gas_bin_test.sh diff --git a/modules/parsers/gas/tests/bin/gas_bin_test.sh b/modules/parsers/gas/tests/bin/gas_bin_test.sh index f0c83e9f..aa35a4e7 100755 --- a/modules/parsers/gas/tests/bin/gas_bin_test.sh +++ b/modules/parsers/gas/tests/bin/gas_bin_test.sh @@ -1,4 +1,3 @@ #! /bin/sh -# $Id$ ${srcdir}/out_test.sh gas_bin_test modules/parsers/gas/tests/bin "gas-compat parser bin output" "-f bin -p gas" "" exit $? diff --git a/modules/parsers/gas/tests/gas_test.sh b/modules/parsers/gas/tests/gas_test.sh index bce85d3c..f39d4d17 100755 --- a/modules/parsers/gas/tests/gas_test.sh +++ b/modules/parsers/gas/tests/gas_test.sh @@ -1,4 +1,3 @@ #! /bin/sh -# $Id$ ${srcdir}/out_test.sh gas_test modules/parsers/gas/tests "gas-compat parser" "-f elf -p gas" ".o" exit $? diff --git a/modules/parsers/nasm/Makefile.inc b/modules/parsers/nasm/Makefile.inc index feda7e84..ed58bb63 100644 --- a/modules/parsers/nasm/Makefile.inc +++ b/modules/parsers/nasm/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - libyasm_a_SOURCES += modules/parsers/nasm/nasm-parser.c libyasm_a_SOURCES += modules/parsers/nasm/nasm-parser.h libyasm_a_SOURCES += modules/parsers/nasm/nasm-parser-struct.h diff --git a/modules/parsers/nasm/nasm-parse.c b/modules/parsers/nasm/nasm-parse.c index 8cbbe531..44d3b5d7 100644 --- a/modules/parsers/nasm/nasm-parse.c +++ b/modules/parsers/nasm/nasm-parse.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -RCSID("$Id$"); #include diff --git a/modules/parsers/nasm/nasm-parser-struct.h b/modules/parsers/nasm/nasm-parser-struct.h index 60b098a5..b9223510 100644 --- a/modules/parsers/nasm/nasm-parser-struct.h +++ b/modules/parsers/nasm/nasm-parser-struct.h @@ -1,4 +1,4 @@ -/* $Id$ +/* * NASM-compatible parser struct header file * * Copyright (C) 2002-2007 Peter Johnson diff --git a/modules/parsers/nasm/nasm-parser.c b/modules/parsers/nasm/nasm-parser.c index 11be0b6e..bd166929 100644 --- a/modules/parsers/nasm/nasm-parser.c +++ b/modules/parsers/nasm/nasm-parser.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -/*@unused@*/ RCSID("$Id$"); #include diff --git a/modules/parsers/nasm/nasm-parser.h b/modules/parsers/nasm/nasm-parser.h index 257429b8..dc19cfb5 100644 --- a/modules/parsers/nasm/nasm-parser.h +++ b/modules/parsers/nasm/nasm-parser.h @@ -1,4 +1,4 @@ -/* $Id$ +/* * NASM-compatible parser header file * * Copyright (C) 2002-2007 Peter Johnson diff --git a/modules/parsers/nasm/nasm-token.re b/modules/parsers/nasm/nasm-token.re index f057bb17..dba7137e 100644 --- a/modules/parsers/nasm/nasm-token.re +++ b/modules/parsers/nasm/nasm-token.re @@ -27,7 +27,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -RCSID("$Id$"); #include diff --git a/modules/parsers/nasm/tests/Makefile.inc b/modules/parsers/nasm/tests/Makefile.inc index ddf5910b..e8293d2a 100644 --- a/modules/parsers/nasm/tests/Makefile.inc +++ b/modules/parsers/nasm/tests/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - TESTS += modules/parsers/nasm/tests/nasm_test.sh EXTRA_DIST += modules/parsers/nasm/tests/nasm_test.sh diff --git a/modules/parsers/nasm/tests/nasm_test.sh b/modules/parsers/nasm/tests/nasm_test.sh index dc26d21f..0ff39b6e 100755 --- a/modules/parsers/nasm/tests/nasm_test.sh +++ b/modules/parsers/nasm/tests/nasm_test.sh @@ -1,4 +1,3 @@ #! /bin/sh -# $Id$ ${srcdir}/out_test.sh nasm_test modules/parsers/nasm/tests "nasm-compat parser" "-f bin" "" exit $? diff --git a/modules/parsers/nasm/tests/worphan/Makefile.inc b/modules/parsers/nasm/tests/worphan/Makefile.inc index 7495f8e8..f55b93d3 100644 --- a/modules/parsers/nasm/tests/worphan/Makefile.inc +++ b/modules/parsers/nasm/tests/worphan/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - TESTS += modules/parsers/nasm/tests/worphan/nasm_worphan_test.sh EXTRA_DIST += modules/parsers/nasm/tests/worphan/nasm_worphan_test.sh diff --git a/modules/parsers/nasm/tests/worphan/nasm_worphan_test.sh b/modules/parsers/nasm/tests/worphan/nasm_worphan_test.sh index bc772c6b..ebb6bcd2 100755 --- a/modules/parsers/nasm/tests/worphan/nasm_worphan_test.sh +++ b/modules/parsers/nasm/tests/worphan/nasm_worphan_test.sh @@ -1,4 +1,3 @@ #! /bin/sh -# $Id$ ${srcdir}/out_test.sh nasm_test modules/parsers/nasm/tests/worphan "nasm-compat parser" "-Worphan-labels -f bin" "" exit $? diff --git a/modules/parsers/tasm/Makefile.inc b/modules/parsers/tasm/Makefile.inc index e7589585..bf49f71e 100644 --- a/modules/parsers/tasm/Makefile.inc +++ b/modules/parsers/tasm/Makefile.inc @@ -1,5 +1,3 @@ -# $Id: Makefile.inc 2082 2008-05-09 06:46:02Z peter $ - EXTRA_DIST += modules/parsers/tasm/tests/Makefile.inc include modules/parsers/tasm/tests/Makefile.inc diff --git a/modules/parsers/tasm/tests/Makefile.inc b/modules/parsers/tasm/tests/Makefile.inc index 1af4dea0..d37e1e63 100644 --- a/modules/parsers/tasm/tests/Makefile.inc +++ b/modules/parsers/tasm/tests/Makefile.inc @@ -1,5 +1,3 @@ -# $Id: Makefile.inc 2063 2008-04-12 08:30:22Z peter $ - TESTS += modules/parsers/tasm/tests/tasm_test.sh EXTRA_DIST += modules/parsers/tasm/tests/tasm_test.sh diff --git a/modules/parsers/tasm/tests/exe/Makefile.inc b/modules/parsers/tasm/tests/exe/Makefile.inc index faed7f57..117012cc 100644 --- a/modules/parsers/tasm/tests/exe/Makefile.inc +++ b/modules/parsers/tasm/tests/exe/Makefile.inc @@ -1,5 +1,3 @@ -# $Id: Makefile.inc 2063 2008-04-12 08:30:22Z peter $ - TESTS += modules/parsers/tasm/tests/exe/tasm_exe_test.sh EXTRA_DIST += modules/parsers/tasm/tests/exe/tasm_exe_test.sh diff --git a/modules/parsers/tasm/tests/exe/tasm_exe_test.sh b/modules/parsers/tasm/tests/exe/tasm_exe_test.sh index 47645e3e..15fdd553 100755 --- a/modules/parsers/tasm/tests/exe/tasm_exe_test.sh +++ b/modules/parsers/tasm/tests/exe/tasm_exe_test.sh @@ -1,4 +1,3 @@ #! /bin/sh -# $Id: tasm_test.sh 1137 2004-09-04 01:24:57Z peter $ ${srcdir}/out_test.sh tasm_test modules/parsers/tasm/tests/exe "tasm-compat parser" "-f dosexe -p tasm" "" exit $? diff --git a/modules/parsers/tasm/tests/tasm_test.sh b/modules/parsers/tasm/tests/tasm_test.sh index 531e03e8..35ef7360 100755 --- a/modules/parsers/tasm/tests/tasm_test.sh +++ b/modules/parsers/tasm/tests/tasm_test.sh @@ -1,4 +1,3 @@ #! /bin/sh -# $Id: tasm_test.sh 1137 2004-09-04 01:24:57Z peter $ ${srcdir}/out_test.sh tasm_test modules/parsers/tasm/tests "tasm-compat parser" "-f bin -p tasm" "" exit $? diff --git a/modules/parsers/yasm_parsers.xml b/modules/parsers/yasm_parsers.xml index d0756ac9..28aa2e29 100644 --- a/modules/parsers/yasm_parsers.xml +++ b/modules/parsers/yasm_parsers.xml @@ -2,8 +2,6 @@ - - diff --git a/modules/preprocs/Makefile.inc b/modules/preprocs/Makefile.inc index fedcf75b..acf06838 100644 --- a/modules/preprocs/Makefile.inc +++ b/modules/preprocs/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - EXTRA_DIST += modules/preprocs/tasm/Makefile.inc EXTRA_DIST += modules/preprocs/nasm/Makefile.inc EXTRA_DIST += modules/preprocs/raw/Makefile.inc diff --git a/modules/preprocs/gas/Makefile.inc b/modules/preprocs/gas/Makefile.inc index cbef0d22..a7289a94 100644 --- a/modules/preprocs/gas/Makefile.inc +++ b/modules/preprocs/gas/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - libyasm_a_SOURCES += modules/preprocs/gas/gas-preproc.c libyasm_a_SOURCES += modules/preprocs/gas/gas-eval.h libyasm_a_SOURCES += modules/preprocs/gas/gas-eval.c diff --git a/modules/preprocs/gas/gas-preproc.c b/modules/preprocs/gas/gas-preproc.c index 8f47ec8f..96dec822 100644 --- a/modules/preprocs/gas/gas-preproc.c +++ b/modules/preprocs/gas/gas-preproc.c @@ -26,7 +26,6 @@ */ #include #include -/*@unused@*/ RCSID("$Id$"); #include #include "modules/preprocs/gas/gas-eval.h" diff --git a/modules/preprocs/gas/tests/Makefile.inc b/modules/preprocs/gas/tests/Makefile.inc index c2a07c2e..c5e628a0 100644 --- a/modules/preprocs/gas/tests/Makefile.inc +++ b/modules/preprocs/gas/tests/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - #TESTS += modules/preprocs/gas/tests/rawpp_test.sh #EXTRA_DIST += modules/preprocs/gas/tests/rawpp_test.sh diff --git a/modules/preprocs/nasm/Makefile.inc b/modules/preprocs/nasm/Makefile.inc index 922b887c..ef29d479 100644 --- a/modules/preprocs/nasm/Makefile.inc +++ b/modules/preprocs/nasm/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - libyasm_a_SOURCES += modules/preprocs/nasm/nasm-preproc.c libyasm_a_SOURCES += modules/preprocs/nasm/nasm-pp.h libyasm_a_SOURCES += modules/preprocs/nasm/nasm-pp.c diff --git a/modules/preprocs/nasm/genversion.c b/modules/preprocs/nasm/genversion.c index ac977685..a0b884b9 100644 --- a/modules/preprocs/nasm/genversion.c +++ b/modules/preprocs/nasm/genversion.c @@ -1,4 +1,4 @@ -/* $Id$ +/* * * Generate version.mac * diff --git a/modules/preprocs/nasm/nasm-preproc.c b/modules/preprocs/nasm/nasm-preproc.c index 011831b4..0b364b1f 100644 --- a/modules/preprocs/nasm/nasm-preproc.c +++ b/modules/preprocs/nasm/nasm-preproc.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -/*@unused@*/ RCSID("$Id$"); #include diff --git a/modules/preprocs/nasm/tests/Makefile.inc b/modules/preprocs/nasm/tests/Makefile.inc index 8167d08e..2d624eb5 100644 --- a/modules/preprocs/nasm/tests/Makefile.inc +++ b/modules/preprocs/nasm/tests/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - TESTS += modules/preprocs/nasm/tests/nasmpp_test.sh EXTRA_DIST += modules/preprocs/nasm/tests/nasmpp_test.sh diff --git a/modules/preprocs/nasm/tests/nasmpp_test.sh b/modules/preprocs/nasm/tests/nasmpp_test.sh index e8e07081..c55c4204 100755 --- a/modules/preprocs/nasm/tests/nasmpp_test.sh +++ b/modules/preprocs/nasm/tests/nasmpp_test.sh @@ -1,4 +1,3 @@ #! /bin/sh -# $Id$ ${srcdir}/out_test.sh nasmpp_test modules/preprocs/nasm/tests "nasm preproc" "-f bin" "" exit $? diff --git a/modules/preprocs/raw/Makefile.inc b/modules/preprocs/raw/Makefile.inc index aff8353d..5756ca91 100644 --- a/modules/preprocs/raw/Makefile.inc +++ b/modules/preprocs/raw/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - libyasm_a_SOURCES += modules/preprocs/raw/raw-preproc.c YASM_MODULES += preproc_raw diff --git a/modules/preprocs/raw/raw-preproc.c b/modules/preprocs/raw/raw-preproc.c index a441ad47..15fd7836 100644 --- a/modules/preprocs/raw/raw-preproc.c +++ b/modules/preprocs/raw/raw-preproc.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -/*@unused@*/ RCSID("$Id$"); #include diff --git a/modules/preprocs/raw/tests/Makefile.inc b/modules/preprocs/raw/tests/Makefile.inc index bfb35cab..82923d51 100644 --- a/modules/preprocs/raw/tests/Makefile.inc +++ b/modules/preprocs/raw/tests/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - TESTS += modules/preprocs/raw/tests/rawpp_test.sh EXTRA_DIST += modules/preprocs/raw/tests/rawpp_test.sh diff --git a/modules/preprocs/raw/tests/rawpp_test.sh b/modules/preprocs/raw/tests/rawpp_test.sh index d57a529b..40339545 100755 --- a/modules/preprocs/raw/tests/rawpp_test.sh +++ b/modules/preprocs/raw/tests/rawpp_test.sh @@ -1,4 +1,3 @@ #! /bin/sh -# $Id$ ${srcdir}/out_test.sh rawpp_test modules/preprocs/raw/tests "raw preproc" "-f bin -r raw" "" exit $? diff --git a/modules/preprocs/tasm/Makefile.inc b/modules/preprocs/tasm/Makefile.inc index 588a3e8f..a9468351 100644 --- a/modules/preprocs/tasm/Makefile.inc +++ b/modules/preprocs/tasm/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - EXTRA_DIST += modules/preprocs/tasm/tests/Makefile.inc include modules/preprocs/tasm/tests/Makefile.inc diff --git a/modules/preprocs/tasm/tests/Makefile.inc b/modules/preprocs/tasm/tests/Makefile.inc index e2e0beca..e2d56c19 100644 --- a/modules/preprocs/tasm/tests/Makefile.inc +++ b/modules/preprocs/tasm/tests/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - TESTS += modules/preprocs/tasm/tests/tasmpp_test.sh EXTRA_DIST += modules/preprocs/tasm/tests/tasmpp_test.sh diff --git a/modules/preprocs/tasm/tests/tasmpp_test.sh b/modules/preprocs/tasm/tests/tasmpp_test.sh index e3155b52..622e5a07 100755 --- a/modules/preprocs/tasm/tests/tasmpp_test.sh +++ b/modules/preprocs/tasm/tests/tasmpp_test.sh @@ -1,4 +1,3 @@ #! /bin/sh -# $Id$ ${srcdir}/out_test.sh tasmpp_test modules/preprocs/tasm/tests "tasm preproc" "-f bin -p tasm" "" exit $? diff --git a/modules/preprocs/yapp/Makefile.inc b/modules/preprocs/yapp/Makefile.inc index e1659032..137fe2fb 100644 --- a/modules/preprocs/yapp/Makefile.inc +++ b/modules/preprocs/yapp/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - libyasm_a_SOURCES += modules/preprocs/yapp/yapp-preproc.c libyasm_a_SOURCES += modules/preprocs/yapp/yapp-preproc.h libyasm_a_SOURCES += modules/preprocs/yapp/yapp-token.h diff --git a/modules/preprocs/yapp/tests/Makefile.inc b/modules/preprocs/yapp/tests/Makefile.inc index 7dd1285f..4ac216dc 100644 --- a/modules/preprocs/yapp/tests/Makefile.inc +++ b/modules/preprocs/yapp/tests/Makefile.inc @@ -1,5 +1,3 @@ -# $IdPath$ - TESTS += modules/preprocs/yapp/tests/yapp_test.sh EXTRA_DIST += modules/preprocs/yapp/tests/Makefile.inc diff --git a/modules/preprocs/yapp/tests/yapp_test.sh b/modules/preprocs/yapp/tests/yapp_test.sh index 4753b69d..146d5ae6 100755 --- a/modules/preprocs/yapp/tests/yapp_test.sh +++ b/modules/preprocs/yapp/tests/yapp_test.sh @@ -1,5 +1,4 @@ #! /bin/sh -# $Id$ case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' diff --git a/modules/preprocs/yapp/yapp-preproc.c b/modules/preprocs/yapp/yapp-preproc.c index 0c774049..ec91256e 100644 --- a/modules/preprocs/yapp/yapp-preproc.c +++ b/modules/preprocs/yapp/yapp-preproc.c @@ -25,7 +25,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -/*@unused@*/ RCSID("$Id$"); #include diff --git a/modules/preprocs/yapp/yapp-preproc.h b/modules/preprocs/yapp/yapp-preproc.h index 52f44b23..38065ab6 100644 --- a/modules/preprocs/yapp/yapp-preproc.h +++ b/modules/preprocs/yapp/yapp-preproc.h @@ -1,4 +1,4 @@ -/* $Id$ +/* * YAPP preprocessor (mimics NASM's preprocessor) header file * * Copyright (C) 2001 Michael Urman diff --git a/modules/preprocs/yapp/yapp-token.l b/modules/preprocs/yapp/yapp-token.l index 38a4c184..d1390777 100644 --- a/modules/preprocs/yapp/yapp-token.l +++ b/modules/preprocs/yapp/yapp-token.l @@ -26,7 +26,6 @@ */ %{ #include -/*@unused@*/ RCSID("$Id$"); #define YASM_LIB_INTERNAL #include diff --git a/out_test.sh b/out_test.sh index 2c9ad65d..b9698e50 100755 --- a/out_test.sh +++ b/out_test.sh @@ -1,5 +1,4 @@ #! /bin/sh -# $Id$ YASM_TEST_SUITE=1 export YASM_TEST_SUITE diff --git a/po/POTFILES.in b/po/POTFILES.in index bdea54fd..dc17f974 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -1,8 +1,6 @@ # List of source files containing translatable strings. # To update, try "find . -name \*.c | xargs grep -c _\( | grep -v :0 | sort" # Copyright (c) 2001 Peter Johnson -# -# $Id$ frontends/yasm/yasm-options.c frontends/yasm/yasm.c diff --git a/test_hd.c b/test_hd.c index 05b53e53..8ae5cabe 100644 --- a/test_hd.c +++ b/test_hd.c @@ -1,4 +1,4 @@ -/* $Id$ +/* * * Simple hexidecimal dump, two hex digits per line. * diff --git a/tools/Makefile.inc b/tools/Makefile.inc index 0dd462c6..dbc67fcb 100644 --- a/tools/Makefile.inc +++ b/tools/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - EXTRA_DIST += tools/re2c/Makefile.inc EXTRA_DIST += tools/genmacro/Makefile.inc EXTRA_DIST += tools/genperf/Makefile.inc diff --git a/tools/genmacro/Makefile.inc b/tools/genmacro/Makefile.inc index c81edd14..722f95da 100644 --- a/tools/genmacro/Makefile.inc +++ b/tools/genmacro/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - # These utility programs have to be built for BUILD host in cross-build. # This makes things rather non-standard automake diff --git a/tools/genmacro/genmacro.c b/tools/genmacro/genmacro.c index d3f4200a..8e702b86 100644 --- a/tools/genmacro/genmacro.c +++ b/tools/genmacro/genmacro.c @@ -1,4 +1,4 @@ -/* $Id$ +/* * * C version of NASM's macros.pl * diff --git a/tools/genperf/Makefile.inc b/tools/genperf/Makefile.inc index d9f24afa..135da6b9 100644 --- a/tools/genperf/Makefile.inc +++ b/tools/genperf/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - # These utility programs have to be built for BUILD host in cross-build. # This makes things rather non-standard automake diff --git a/tools/genperf/genperf.c b/tools/genperf/genperf.c index c05a4cc0..c3cfa766 100644 --- a/tools/genperf/genperf.c +++ b/tools/genperf/genperf.c @@ -1,4 +1,4 @@ -/* $Id$ +/* * * Generate Minimal Perfect Hash (genperf) * diff --git a/tools/genperf/perfect.c b/tools/genperf/perfect.c index 579d3606..af6b4612 100644 --- a/tools/genperf/perfect.c +++ b/tools/genperf/perfect.c @@ -1,6 +1,4 @@ -/* Modified for use with yasm by Peter Johnson. - * $Id$ - */ +/* Modified for use with yasm by Peter Johnson. */ /* ------------------------------------------------------------------------------ perfect.c: code to generate code for a hash for perfect hashing. diff --git a/tools/python-yasm/Makefile.inc b/tools/python-yasm/Makefile.inc index e4559964..fce135b4 100644 --- a/tools/python-yasm/Makefile.inc +++ b/tools/python-yasm/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - PYBINDING_DEPS = tools/python-yasm/bytecode.pxi PYBINDING_DEPS += tools/python-yasm/errwarn.pxi PYBINDING_DEPS += tools/python-yasm/expr.pxi diff --git a/tools/python-yasm/tests/Makefile.inc b/tools/python-yasm/tests/Makefile.inc index 50c499d8..c6df22c5 100644 --- a/tools/python-yasm/tests/Makefile.inc +++ b/tools/python-yasm/tests/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - EXTRA_DIST += tools/python-yasm/tests/python_test.sh EXTRA_DIST += tools/python-yasm/tests/__init__.py EXTRA_DIST += tools/python-yasm/tests/test_bytecode.py diff --git a/tools/python-yasm/tests/__init__.py b/tools/python-yasm/tests/__init__.py index 6d608f28..f5afb30c 100644 --- a/tools/python-yasm/tests/__init__.py +++ b/tools/python-yasm/tests/__init__.py @@ -1,6 +1,5 @@ # Test wrapper from Quod Libet # http://www.sacredchao.net/quodlibet/ -# $Id$ import unittest, sys suites = [] add = registerCase = suites.append diff --git a/tools/python-yasm/tests/python_test.sh b/tools/python-yasm/tests/python_test.sh index 1f3896d6..18e7a69e 100755 --- a/tools/python-yasm/tests/python_test.sh +++ b/tools/python-yasm/tests/python_test.sh @@ -1,7 +1,6 @@ #!/bin/sh # Based on _sanity.sh from Quod Libet # http://www.sacredchao.net/quodlibet/ -# $Id$ set -e diff --git a/tools/python-yasm/tests/test_bytecode.py b/tools/python-yasm/tests/test_bytecode.py index fb6c2a2b..eb0e96db 100644 --- a/tools/python-yasm/tests/test_bytecode.py +++ b/tools/python-yasm/tests/test_bytecode.py @@ -1,4 +1,3 @@ -# $Id$ from tests import TestCase, add from yasm import Bytecode, Expression diff --git a/tools/python-yasm/tests/test_expr.py b/tools/python-yasm/tests/test_expr.py index 1fb930d0..97b021c3 100644 --- a/tools/python-yasm/tests/test_expr.py +++ b/tools/python-yasm/tests/test_expr.py @@ -1,4 +1,3 @@ -# $Id$ from tests import TestCase, add from yasm import Expression import operator diff --git a/tools/python-yasm/tests/test_intnum.py b/tools/python-yasm/tests/test_intnum.py index 65e09efc..a2220180 100644 --- a/tools/python-yasm/tests/test_intnum.py +++ b/tools/python-yasm/tests/test_intnum.py @@ -1,4 +1,3 @@ -# $Id$ from tests import TestCase, add from yasm import IntNum diff --git a/tools/python-yasm/tests/test_symrec.py b/tools/python-yasm/tests/test_symrec.py index a228eebd..a575b194 100644 --- a/tools/python-yasm/tests/test_symrec.py +++ b/tools/python-yasm/tests/test_symrec.py @@ -1,4 +1,3 @@ -# $Id$ from tests import TestCase, add from yasm import SymbolTable, Expression, YasmError diff --git a/tools/re2c/Makefile.inc b/tools/re2c/Makefile.inc index ceff9087..edb89a5d 100644 --- a/tools/re2c/Makefile.inc +++ b/tools/re2c/Makefile.inc @@ -1,5 +1,3 @@ -# $Id$ - # These utility programs have to be built for BUILD host in cross-build. # This makes things rather non-standard automake diff --git a/tools/xdf/xdf.h b/tools/xdf/xdf.h index 6d5e3e79..e2150d25 100644 --- a/tools/xdf/xdf.h +++ b/tools/xdf/xdf.h @@ -1,6 +1,5 @@ /* XDF - Extended Dynamic Object Format */ /* Version 2.0 */ -/* $Id$ */ /* FILE HEADER */ /* SECTION HEADERS [] */ diff --git a/tools/xdf/xdfdump.c b/tools/xdf/xdfdump.c index b61bf92a..8d3df212 100644 --- a/tools/xdf/xdfdump.c +++ b/tools/xdf/xdfdump.c @@ -1,4 +1,4 @@ -/* $Id$ +/* * Extended Dynamic Object format dumper * * Copyright (C) 2004-2007 Peter Johnson diff --git a/util.h b/util.h index 132cba1e..634aa328 100644 --- a/util.h +++ b/util.h @@ -1,4 +1,4 @@ -/* $Id$ +/* * YASM utility functions. * * Includes standard headers and defines prototypes for replacement functions @@ -119,18 +119,6 @@ #include -#ifdef HAVE_SYS_CDEFS_H -# include -#endif - -#ifdef __RCSID -# define RCSID(s) __RCSID(s) -#elif defined(__GNUC__) && defined(__ELF__) -# define RCSID(s) __asm__(".ident\t\"" s "\"") -#else -# define RCSID(s) static const char rcsid[] = s -#endif - #ifdef WITH_DMALLOC # include # define yasm__xstrdup(str) xstrdup(str) From 8281be0c256a42fd2eab894c5788ace7674ed3cb Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 29 May 2011 16:54:34 -0700 Subject: [PATCH 422/585] Add .gitignore files. These are based on the old svn:ignore properties. --- .gitignore | 67 +++++++++++++++++++++++++++++++++++++++++++++++ config/.gitignore | 5 ++++ po/.gitignore | 10 +++++++ 3 files changed, 82 insertions(+) create mode 100644 .gitignore create mode 100644 config/.gitignore create mode 100644 po/.gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..989c3f41 --- /dev/null +++ b/.gitignore @@ -0,0 +1,67 @@ +autom4te.cache +stamp-h* +config.* +libyasm-stdint.h +nasm-token.c +nasm-macros.c +yapp-token.c +gas-token.c +license.c +module.c +x86parse.c +lc3bid.c +re2c-parser.c +re2c-parser.h +yasm +vsyasm +ytasm +re2c +cleanup +genmacro +test_hd +genperf +genversion +genmodule +genstring +version.mac +*_test +configure +configure.scan +configure.lineno +config.* +aclocal.m4 +*.tar.gz +*.la +*.lo +*.o +*.a +.libs +.deps +libtool +*.bb +*.bbg +*.da +results +Makefile +Makefile.in +.*.swp +python-setup.txt +yasm_python.c +.python-build +_yasm.pxi +yasm.pyx +build +yasm.so +x86cpu.c +x86insn_nasm.gperf +x86insn_nasm.c +x86insn_gas.gperf +x86insn_gas.c +x86insns.c +x86regtmod.c +nasm-version.c +win64-gas.c +win64-nasm.c +.sw* +*.s +*.asm diff --git a/config/.gitignore b/config/.gitignore new file mode 100644 index 00000000..4ea29110 --- /dev/null +++ b/config/.gitignore @@ -0,0 +1,5 @@ +mkinstalldirs +depcomp +compile +missing +install-sh diff --git a/po/.gitignore b/po/.gitignore new file mode 100644 index 00000000..38039dfd --- /dev/null +++ b/po/.gitignore @@ -0,0 +1,10 @@ +Makefile.in.in +POTFILES +cat-id-tbl.c +yasm.pot +stamp-cat-id +remove-potcdate.sed +Makefile +Makefile.in +.*.swp +stamp-po From 0ed2cc445131663b07b547cf5aefac893b619e9a Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 27 Aug 2011 09:25:30 -0700 Subject: [PATCH 423/585] Generate version number information from git history. Due to the svn import structure, a special case is currently implemented to look for the 1.1.0 branchpoint instead of the most recent tag on the master branch. This will be removed after the first release is tagged on the master branch in git. Specific details: autogen.sh: More aggressively clean autoconf cache. This is needed to ensure the version number is actually regenerated. Don't generate PACKAGE_PATCHLEVEL or PACKAGE_BUILD variables. The genversion program now parses PACKAGE_VERSION directly. For Mkfiles builds, YASM-VERSION.h is generated and included by the custom config.h. This avoids the need to edit config.h for versioning. --- .gitignore | 2 + CMakeLists.txt | 9 +-- Makefile.am | 8 +++ Mkfiles/Makefile.flat | 7 +- Mkfiles/dj/config.h | 11 +-- Mkfiles/vc10/config.h | 11 +-- Mkfiles/vc10/genversion/genversion.vcxproj | 5 +- Mkfiles/vc10/genversion/runpre.bat | 2 + Mkfiles/vc10/yasm.sln | 3 + Mkfiles/vc9/config.h | 11 +-- Mkfiles/vc9/genversion/genversion.vcproj | 2 + Mkfiles/vc9/genversion/runpre.bat | 2 + Mkfiles/vc9/yasm.sln | 1 + YASM-VERSION-GEN.bat | 38 +++++++++++ YASM-VERSION-GEN.sh | 52 +++++++++++++++ autogen.sh | 3 +- cmake/modules/VersionGen.cmake | 78 ++++++++++++++++++++++ config.h.cmake | 6 -- configure.ac | 8 +-- frontends/tasm/tasm.c | 2 +- frontends/vsyasm/vsyasm.c | 2 +- frontends/yasm/yasm.c | 4 +- modules/preprocs/nasm/genversion.c | 23 ++++--- 23 files changed, 232 insertions(+), 58 deletions(-) create mode 100644 Mkfiles/vc10/genversion/runpre.bat create mode 100644 Mkfiles/vc9/genversion/runpre.bat create mode 100644 YASM-VERSION-GEN.bat create mode 100755 YASM-VERSION-GEN.sh create mode 100644 cmake/modules/VersionGen.cmake diff --git a/.gitignore b/.gitignore index 989c3f41..7ca446de 100644 --- a/.gitignore +++ b/.gitignore @@ -62,6 +62,8 @@ x86regtmod.c nasm-version.c win64-gas.c win64-nasm.c +YASM-VERSION-FILE +YASM-VERSION.h .sw* *.s *.asm diff --git a/CMakeLists.txt b/CMakeLists.txt index 9237329e..b63d14b7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,7 @@ SET(BUILD_SHARED_LIBS ON) set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules") INCLUDE(YasmMacros) +INCLUDE(VersionGen) OPTION(ENABLE_NLS "Enable message translations" OFF) @@ -26,12 +27,8 @@ IF(NOT CMAKE_BUILD_TYPE) FORCE) ENDIF(NOT CMAKE_BUILD_TYPE) -set (YASM_VERSION_MAJOR 1) -set (YASM_VERSION_MINOR 1) -set (YASM_VERSION_SUBMINOR 99) -set (PACKAGE_INTVER "${YASM_VERSION_MAJOR}.${YASM_VERSION_MINOR}.${YASM_VERSION_SUBMINOR}") -set (PACKAGE_BUILD "HEAD") -set (PACKAGE_VERSION ${PACKAGE_BUILD}) +VERSION_GEN(PACKAGE_VERSION "${CMAKE_BINARY_DIR}/YASM-VERSION-FILE" "1.1.0") + set (PACKAGE_STRING "yasm ${PACKAGE_VERSION}") INCLUDE_DIRECTORIES(BEFORE ${CMAKE_BINARY_DIR} ${yasm_SOURCE_DIR}) diff --git a/Makefile.am b/Makefile.am index f3ed7d41..208dc67f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -31,6 +31,7 @@ EXTRA_DIST = config/config.rpath # libyasm-stdint.h doesn't clean up after itself? CONFIG_CLEAN_FILES = libyasm-stdint.h +CONFIG_CLEAN_FILES += YASM-VERSION-FILE EXTRA_DIST += tools/Makefile.inc EXTRA_DIST += libyasm/Makefile.inc @@ -55,6 +56,7 @@ EXTRA_DIST += BSD.txt EXTRA_DIST += GNU_GPL-2.0 EXTRA_DIST += GNU_LGPL-2.0 EXTRA_DIST += splint.sh +EXTRA_DIST += YASM-VERSION-GEN.sh EXTRA_DIST += Mkfiles/Makefile.flat EXTRA_DIST += Mkfiles/Makefile.dj EXTRA_DIST += Mkfiles/dj/config.h @@ -122,6 +124,12 @@ EXTRA_DIST += Mkfiles/vc10/re2c/run.bat # Until this gets fixed in automake DISTCLEANFILES += libyasm/stamp-h libyasm/stamp-h[0-9]* +dist-hook: YASM-VERSION-FILE + cp YASM-VERSION-FILE $(distdir)/version + +YASM-VERSION-FILE: $(top_srcdir)/YASM-VERSION-GEN.sh + $(top_srcdir)/YASM-VERSION-GEN.sh + distclean-local: -rm -rf results if HAVE_PYTHON diff --git a/Mkfiles/Makefile.flat b/Mkfiles/Makefile.flat index 3e190d73..011fbe51 100644 --- a/Mkfiles/Makefile.flat +++ b/Mkfiles/Makefile.flat @@ -197,7 +197,7 @@ win64-gas.c: modules/objfmts/coff/win64-gas.mac genmacro modules/objfmts/coff/coff-objfmt.c: win64-nasm.c win64-gas.c -genversion: modules/preprocs/nasm/genversion.c +genversion: modules/preprocs/nasm/genversion.c YASM-VERSION.h $(BUILDCC) -IMkfiles -I. -o $@ $< version.mac: genversion @@ -272,3 +272,8 @@ vsyasm: $(VSYASM_OBJS) .c.o: $(CC) -c $(CFLAGS) -o $@ $< +$(YASM_OBJS) $(YTASM_OBJS) $(VSYASM_OBJS): YASM-VERSION.h + +YASM-VERSION.h: YASM-VERSION-GEN.sh + sh YASM-VERSION-GEN.sh + diff --git a/Mkfiles/dj/config.h b/Mkfiles/dj/config.h index 46e3167e..b33554ac 100644 --- a/Mkfiles/dj/config.h +++ b/Mkfiles/dj/config.h @@ -1,3 +1,4 @@ +#include "YASM-VERSION.h" #define yasm__splitpath(path, tail) yasm__splitpath_win(path, tail) #define yasm__abspath(path) yasm__abspath_win(path) #define yasm__combpath(from, to) yasm__combpath_win(from, to) @@ -116,23 +117,17 @@ /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "bug-yasm@tortall.net" -/* Define to build version of this package. */ -#define PACKAGE_BUILD "HEAD" - -/* Define to internal version of this package. */ -#define PACKAGE_INTVER "1.1.99" - /* Define to the full name of this package. */ #define PACKAGE_NAME "yasm" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "yasm HEAD" +/*#define PACKAGE_STRING "yasm HEAD"*/ /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "yasm" /* Define to the version of this package. */ -#define PACKAGE_VERSION "HEAD" +/*#define PACKAGE_VERSION "HEAD"*/ /* Define if the C compiler supports function prototypes. */ #define PROTOTYPES 1 diff --git a/Mkfiles/vc10/config.h b/Mkfiles/vc10/config.h index aba46abe..efb7cbe4 100644 --- a/Mkfiles/vc10/config.h +++ b/Mkfiles/vc10/config.h @@ -1,3 +1,4 @@ +#include "YASM-VERSION.h" #define yasm__splitpath(path, tail) yasm__splitpath_win(path, tail) #define yasm__abspath(path) yasm__abspath_win(path) #define yasm__combpath(from, to) yasm__combpath_win(from, to) @@ -114,23 +115,17 @@ /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "bug-yasm@tortall.net" -/* Define to build version of this package. */ -#define PACKAGE_BUILD "HEAD" - -/* Define to internal version of this package. */ -#define PACKAGE_INTVER "1.1.99" - /* Define to the full name of this package. */ #define PACKAGE_NAME "yasm" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "yasm HEAD" +/*#define PACKAGE_STRING "yasm HEAD"*/ /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "yasm" /* Define to the version of this package. */ -#define PACKAGE_VERSION "HEAD" +/*#define PACKAGE_VERSION "HEAD"*/ /* Define if the C compiler supports function prototypes. */ #define PROTOTYPES 1 diff --git a/Mkfiles/vc10/genversion/genversion.vcxproj b/Mkfiles/vc10/genversion/genversion.vcxproj index cce7c7fd..1bfd9e7a 100644 --- a/Mkfiles/vc10/genversion/genversion.vcxproj +++ b/Mkfiles/vc10/genversion/genversion.vcxproj @@ -48,7 +48,7 @@ Disabled - ..\..\vc10;%(AdditionalIncludeDirectories) + ..\..\vc10;../../..;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true EnableFastChecks @@ -73,6 +73,9 @@ run.bat "$(TargetPath)" + + runpre.bat + diff --git a/Mkfiles/vc10/genversion/runpre.bat b/Mkfiles/vc10/genversion/runpre.bat new file mode 100644 index 00000000..fdd15708 --- /dev/null +++ b/Mkfiles/vc10/genversion/runpre.bat @@ -0,0 +1,2 @@ +cd ..\..\.. +YASM-VERSION-GEN.bat diff --git a/Mkfiles/vc10/yasm.sln b/Mkfiles/vc10/yasm.sln index 342bf07b..306c7b10 100644 --- a/Mkfiles/vc10/yasm.sln +++ b/Mkfiles/vc10/yasm.sln @@ -7,6 +7,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libyasm", "libyasm\libyasm.vcxproj", "{29FE7874-1256-4AD6-B889-68E399DC9608}" + ProjectSection(ProjectDependencies) = postProject + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2} = {B545983B-8EE0-4A7B-A67A-E749EEAE62A2} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "modules", "modules\modules.vcxproj", "{D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}" EndProject diff --git a/Mkfiles/vc9/config.h b/Mkfiles/vc9/config.h index aba46abe..efb7cbe4 100644 --- a/Mkfiles/vc9/config.h +++ b/Mkfiles/vc9/config.h @@ -1,3 +1,4 @@ +#include "YASM-VERSION.h" #define yasm__splitpath(path, tail) yasm__splitpath_win(path, tail) #define yasm__abspath(path) yasm__abspath_win(path) #define yasm__combpath(from, to) yasm__combpath_win(from, to) @@ -114,23 +115,17 @@ /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "bug-yasm@tortall.net" -/* Define to build version of this package. */ -#define PACKAGE_BUILD "HEAD" - -/* Define to internal version of this package. */ -#define PACKAGE_INTVER "1.1.99" - /* Define to the full name of this package. */ #define PACKAGE_NAME "yasm" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "yasm HEAD" +/*#define PACKAGE_STRING "yasm HEAD"*/ /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "yasm" /* Define to the version of this package. */ -#define PACKAGE_VERSION "HEAD" +/*#define PACKAGE_VERSION "HEAD"*/ /* Define if the C compiler supports function prototypes. */ #define PROTOTYPES 1 diff --git a/Mkfiles/vc9/genversion/genversion.vcproj b/Mkfiles/vc9/genversion/genversion.vcproj index 84c92a2d..f5a01f97 100644 --- a/Mkfiles/vc9/genversion/genversion.vcproj +++ b/Mkfiles/vc9/genversion/genversion.vcproj @@ -26,6 +26,7 @@ > YASM-VERSION-FILE +echo #define PACKAGE_STRING "yasm %_ver_%" > YASM-VERSION.h +echo #define PACKAGE_VERSION "%_ver_%" >> YASM-VERSION.h + diff --git a/YASM-VERSION-GEN.sh b/YASM-VERSION-GEN.sh new file mode 100755 index 00000000..00c0136f --- /dev/null +++ b/YASM-VERSION-GEN.sh @@ -0,0 +1,52 @@ +#!/bin/sh + +YVF=YASM-VERSION-FILE +DEF_VER=v1.1.0 + +LF=' +' + +# First see if there is a version file (included in release tarballs), +# then try git-describe, then default. +if test -f version +then + VN=$(cat version) || VN="$DEF_VER" +elif test -d .git -o -f .git && + VN=$(git describe --match "v[0-9]*" --abbrev=4 HEAD 2>/dev/null) && + case "$VN" in + *$LF*) (exit 1) ;; + v0.1.0*) + # Special handling until we get a more recent tag on the + # master branch + MERGE_BASE=$(git merge-base $DEF_VER HEAD 2>/dev/null) + VN1=$(git rev-list $MERGE_BASE..HEAD | wc -l 2>/dev/null) + VN2=$(git rev-list --max-count=1 --abbrev-commit --abbrev=4 HEAD 2>/dev/null) + VN=$(echo "v$DEF_VER-$VN1-g$VN2" | sed -e 's/ //g') + git update-index -q --refresh + test -z "$(git diff-index --name-only HEAD --)" || + VN="$VN-dirty" ;; + v[0-9]*) + git update-index -q --refresh + test -z "$(git diff-index --name-only HEAD --)" || + VN="$VN-dirty" ;; + esac +then + VN=$(echo "$VN" | sed -e 's/-/./g'); +else + VN="$DEF_VER" +fi + +VN=$(expr "$VN" : v*'\(.*\)') + +if test -r $YVF +then + VC=$(cat $YVF) +else + VC=unset +fi +test "$VN" = "$VC" || { + echo >&2 "$VN" + echo "$VN" >$YVF + echo "#define PACKAGE_STRING \"yasm $VN\"" > YASM-VERSION.h + echo "#define PACKAGE_VERSION \"$VN\"" >> YASM-VERSION.h +} diff --git a/autogen.sh b/autogen.sh index b91fc286..12da6aa4 100755 --- a/autogen.sh +++ b/autogen.sh @@ -73,7 +73,8 @@ if test ! -d "config"; then mkdir config fi -rm -f stamp-h.in +rm -rf autom4te.cache +rm -f configure config.h config.status config.log stamp-h.in #echo " gettextize -f --no-changelog" #echo "N" | gettextize -f --no-changelog || exit 1 echo " aclocal $ACLOCAL_FLAGS" diff --git a/cmake/modules/VersionGen.cmake b/cmake/modules/VersionGen.cmake new file mode 100644 index 00000000..340455b3 --- /dev/null +++ b/cmake/modules/VersionGen.cmake @@ -0,0 +1,78 @@ +# Redistribution and use is allowed according to the terms of the BSD license. +# +# Copyright (c) 2011 Peter Johnson + +macro (VERSION_GEN _version _version_file _default_version) + set (_vn "v${_default_version}") + + # First see if there is a version file (included in release tarballs), + # then try git-describe, then default. + if (EXISTS "${CMAKE_SOURCE_DIR}/version") + file (STRINGS "${CMAKE_SOURCE_DIR}/version" _version_strs LIMIT_COUNT 1) + list (GET _version_strs 0 _version_strs0) + if (NOT (${_version_strs0} STREQUAL "")) + set (_vn "v${_version_strs0}") + endif (${_version_strs0}) + elseif (EXISTS "${CMAKE_SOURCE_DIR}/.git") + execute_process (COMMAND git describe --match "v[0-9]*" --abbrev=4 HEAD + RESULT_VARIABLE _git_result + OUTPUT_VARIABLE _git_vn + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + + if (_git_result EQUAL 0) + # Special handling until we get a more recent tag on the master + # branch + if (_git_vn MATCHES "^v0[.]1[.]0") + execute_process (COMMAND git merge-base v${_default_version} HEAD + OUTPUT_VARIABLE _merge_base + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + #message (STATUS "Merge base: ${_merge_base}") + + execute_process (COMMAND git rev-list ${_merge_base}..HEAD + OUTPUT_VARIABLE _rev_list + ERROR_QUIET) + string (REGEX MATCHALL "[^\n]*\n" _rev_list_lines "${_rev_list}") + #message (STATUS "Rev list: ${_rev_list_lines}") + list (LENGTH _rev_list_lines _vn1) + + execute_process (COMMAND git rev-list --max-count=1 --abbrev-commit --abbrev=4 HEAD + OUTPUT_VARIABLE _vn2 + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + + set (_git_vn "v${_default_version}-${_vn1}-g${_vn2}") + endif (_git_vn MATCHES "^v0[.]1[.]0") + + # Append -dirty if there are local changes + execute_process (COMMAND git update-index -q --refresh) + execute_process (COMMAND git diff-index --name-only HEAD -- + OUTPUT_VARIABLE _git_vn_dirty) + if (_git_vn_dirty) + set (_git_vn "${_git_vn}-dirty") + endif (_git_vn_dirty) + + # Substitute . for - in the result + string (REPLACE "-" "." _vn "${_git_vn}") + endif (_git_result EQUAL 0) + endif (EXISTS "${CMAKE_SOURCE_DIR}/version") + + # Strip leading "v" from version + #message (STATUS "_vn: ${_vn}") + string (REGEX REPLACE "^v*(.+)" "\\1" _vn "${_vn}") + + # Update version file if required + if (EXISTS ${_version_file}) + file (STRINGS ${_version_file} _version_strs LIMIT_COUNT 1) + list (GET _version_strs 0 _vc) + else (EXISTS ${_version_file}) + set (_vc "unset") + endif (EXISTS ${_version_file}) + if (NOT ("${_vn}" STREQUAL "${_vc}")) + file (WRITE ${_version_file} "${_vn}") + endif (NOT ("${_vn}" STREQUAL "${_vc}")) + + # Set output version variable + set (${_version} ${_vn}) +endmacro (VERSION_GEN) diff --git a/config.h.cmake b/config.h.cmake index d282b931..50ed93ab 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -29,12 +29,6 @@ /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "bug-yasm@tortall.net" -/* Define to internal version of this package. */ -#define PACKAGE_INTVER "@PACKAGE_INTVER@" - -/* Define to build version of this package. */ -#define PACKAGE_BUILD "@PACKAGE_BUILD@" - /* Define to the full name of this package. */ #define PACKAGE_NAME "yasm" diff --git a/configure.ac b/configure.ac index 4dc92f41..c0507a6b 100644 --- a/configure.ac +++ b/configure.ac @@ -4,7 +4,9 @@ # autoconf setup # AC_PREREQ(2.53) -AC_INIT([yasm], [HEAD], [bug-yasm@tortall.net]) +AC_INIT([yasm], + m4_esyscmd([./YASM-VERSION-GEN.sh && tr -d '\n' \n", argv[0]); return EXIT_FAILURE; } - if (sscanf(PACKAGE_INTVER, "%d.%d.%d", &major, &minor, &subminor) != 3) { + matched = sscanf(PACKAGE_VERSION, "%d.%d.%d.%d", &major, &minor, &subminor, + &patchlevel); + + if (matched == 3) + patchlevel = 0; + else if (matched != 4) { fprintf(stderr, "Version tokenizing error\n"); return EXIT_FAILURE; } @@ -61,17 +66,15 @@ main(int argc, char *argv[]) fprintf(out, "%%define __YASM_MAJOR__ %d\n", major); fprintf(out, "%%define __YASM_MINOR__ %d\n", minor); fprintf(out, "%%define __YASM_SUBMINOR__ %d\n", subminor); - if (!isdigit(PACKAGE_BUILD[0])) - fprintf(out, "%%define __YASM_BUILD__ 0\n"); - else - fprintf(out, "%%define __YASM_BUILD__ %d\n", atoi(PACKAGE_BUILD)); + fprintf(out, "%%define __YASM_BUILD__ %d\n", patchlevel); + fprintf(out, "%%define __YASM_PATCHLEVEL__ %d\n", patchlevel); /* Version id (hex number) */ - fprintf(out, "%%define __YASM_VERSION_ID__ 0%02x%02x%02x00h\n", major, - minor, subminor); + fprintf(out, "%%define __YASM_VERSION_ID__ 0%02x%02x%02x%02xh\n", major, + minor, subminor, patchlevel); - /* Version string - version sans build */ - fprintf(out, "%%define __YASM_VER__ \"%s\"\n", PACKAGE_INTVER); + /* Version string */ + fprintf(out, "%%define __YASM_VER__ \"%s\"\n", PACKAGE_VERSION); fclose(out); return EXIT_SUCCESS; From 7d58243134087b1617bbc16c7dddb58a79fd707b Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 27 Aug 2011 10:01:26 -0700 Subject: [PATCH 424/585] macho: Support N_PEXT bit. Can be enabled via use of "private_extern" in NASM syntax. Patch by: Hironori Bono [#215 state:resolved] --- modules/objfmts/macho/macho-objfmt.c | 21 ++++++++++++++++++- .../objfmts/macho/tests/nasm32/Makefile.inc | 2 ++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/modules/objfmts/macho/macho-objfmt.c b/modules/objfmts/macho/macho-objfmt.c index 89b0be47..76b80292 100644 --- a/modules/objfmts/macho/macho-objfmt.c +++ b/modules/objfmts/macho/macho-objfmt.c @@ -921,7 +921,26 @@ macho_objfmt_output_symtable(yasm_symrec *sym, /*@null@*/ void *d) } /*printf("common symbol %s val %lu\n", name, yasm_intnum_get_uint(val));*/ } else if (vis & YASM_SYM_GLOBAL) { - n_type |= N_EXT; + yasm_valparamhead *valparams = + yasm_symrec_get_objext_valparams(sym); + + struct macho_global_data { + unsigned long flag; /* N_PEXT */ + } data; + + data.flag = 0; + + if (valparams) { + static const yasm_dir_help help[] = { + { "private_extern", 0, yasm_dir_helper_flag_set, + offsetof(struct macho_global_data, flag), N_PEXT }, + }; + yasm_dir_helper(sym, yasm_vps_first(valparams), + yasm_symrec_get_decl_line(sym), help, NELEMS(help), + &data, yasm_dir_helper_valparam_warn); + } + + n_type |= N_EXT | data.flag; } localbuf = info->buf; diff --git a/modules/objfmts/macho/tests/nasm32/Makefile.inc b/modules/objfmts/macho/tests/nasm32/Makefile.inc index 2bb2d986..2bba5de7 100644 --- a/modules/objfmts/macho/tests/nasm32/Makefile.inc +++ b/modules/objfmts/macho/tests/nasm32/Makefile.inc @@ -6,6 +6,8 @@ EXTRA_DIST += modules/objfmts/macho/tests/nasm32/machotest.asm EXTRA_DIST += modules/objfmts/macho/tests/nasm32/machotest.hex EXTRA_DIST += modules/objfmts/macho/tests/nasm32/macho-reloc.asm EXTRA_DIST += modules/objfmts/macho/tests/nasm32/macho-reloc.hex +EXTRA_DIST += modules/objfmts/macho/tests/nasm32/macho32-pext.asm +EXTRA_DIST += modules/objfmts/macho/tests/nasm32/macho32-pext.hex EXTRA_DIST += modules/objfmts/macho/tests/nasm32/macho32-pic.asm EXTRA_DIST += modules/objfmts/macho/tests/nasm32/macho32-pic.hex EXTRA_DIST += modules/objfmts/macho/tests/nasm32/macho32-sect.asm From c3b483199ce64bbb18404455f3dbd18c7e8cbfe7 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 27 Aug 2011 16:28:25 -0700 Subject: [PATCH 425/585] Regenerate man pages. --- yasm.1 | 192 ++++++++++++----------- yasm_arch.7 | 409 ++++++++++++++++++++++++++++++++++++++++--------- yasm_dbgfmts.7 | 36 +++-- yasm_objfmts.7 | 44 ++++-- yasm_parsers.7 | 34 ++-- 5 files changed, 512 insertions(+), 203 deletions(-) diff --git a/yasm.1 b/yasm.1 index 71db01e0..8b0d8456 100644 --- a/yasm.1 +++ b/yasm.1 @@ -1,47 +1,55 @@ +'\" t .\" Title: yasm .\" Author: Peter Johnson -.\" Generator: DocBook XSL Stylesheets v1.71.1 +.\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: April 2007 .\" Manual: The Yasm Modular Assembler .\" Source: Yasm +.\" Language: English .\" .TH "YASM" "1" "April 2007" "Yasm" "The Yasm Modular Assembler" +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- .SH "NAME" yasm \- The Yasm Modular Assembler .SH "SYNOPSIS" -.HP 5 +.HP \w'\fByasm\fR\ 'u \fByasm\fR [\fB\-f\ \fR\fB\fIformat\fR\fR] [\fB\-o\ \fR\fB\fIoutfile\fR\fR] [\fB\fIother\ options\fR\fR...] {\fIinfile\fR} -.HP 5 +.HP \w'\fByasm\fR\ 'u \fByasm\fR \fB\-h\fR .SH "DESCRIPTION" .PP The Yasm Modular Assembler is a portable, retargetable assembler written under the \(lqnew\(rq -(2 or 3 clause) BSD license. Yasm currently supports the x86 and AMD64 instruction sets, accepts NASM and GAS assembler syntaxes, outputs binary, ELF32, ELF64, COFF, Win32, and Win64 object formats, and generates source debugging information in STABS, DWARF 2, and CodeView 8 formats. +(2 or 3 clause) BSD license\&. Yasm currently supports the x86 and AMD64 instruction sets, accepts NASM and GAS assembler syntaxes, outputs binary, ELF32, ELF64, COFF, Win32, and Win64 object formats, and generates source debugging information in STABS, DWARF 2, and CodeView 8 formats\&. .PP YASM consists of the \fByasm\fR -command, libyasm, the core backend library, and a large number of modules. Currently, libyasm and the loadable modules are statically built into the +command, libyasm, the core backend library, and a large number of modules\&. Currently, libyasm and the loadable modules are statically built into the \fByasm\fR -executable. +executable\&. .PP The \fByasm\fR command assembles the file infile and directs output to the file \fIoutfile\fR -if specified. If +if specified\&. If \fIoutfile\fR is not specified, \fByasm\fR will derive a default output file name from the name of its input file, usually by appending -\fI.o\fR +\&.o or -\fI.obj\fR, or by removing all extensions for a raw binary file. Failing that, the output file name will be -\fIyasm.out\fR. +\&.obj, or by removing all extensions for a raw binary file\&. Failing that, the output file name will be +yasm\&.out\&. .PP If called with an \fIinfile\fR @@ -50,115 +58,115 @@ of \fByasm\fR assembles the standard input and directs output to the file \fIoutfile\fR, or -\fIyasm.out\fR +yasm\&.out if no \fIoutfile\fR -is specified. +is specified\&. .SH "OPTIONS" .PP -Many options may be given in one of two forms: either a dash followed by a single letter, or two dashes followed by a long option name. Options are listed in alphabetical order. +Many options may be given in one of two forms: either a dash followed by a single letter, or two dashes followed by a long option name\&. Options are listed in alphabetical order\&. .SS "General Options" .PP \fB\-a \fR\fB\fIarch\fR\fR or \fB\-\-arch=\fR\fB\fIarch\fR\fR: Select target architecture .RS 4 -Selects the target architecture. The default architecture is -\(lqx86\(rq, which supports both the IA\-32 and derivatives and AMD64 instruction sets. To print a list of available architectures to standard output, use +Selects the target architecture\&. The default architecture is +\(lqx86\(rq, which supports both the IA\-32 and derivatives and AMD64 instruction sets\&. To print a list of available architectures to standard output, use \(lqhelp\(rq as -\fIarch\fR. See +\fIarch\fR\&. See \fByasm_arch\fR(7) -for a list of supported architectures. +for a list of supported architectures\&. .RE .PP \fB\-f \fR\fB\fIformat\fR\fR or \fB\-\-oformat=\fR\fB\fIformat\fR\fR: Select object format .RS 4 -Selects the output object format. The default object format is -\(lqbin\(rq, which is a flat format binary with no relocation. To print a list of available object formats to standard output, use +Selects the output object format\&. The default object format is +\(lqbin\(rq, which is a flat format binary with no relocation\&. To print a list of available object formats to standard output, use \(lqhelp\(rq as -\fIformat\fR. See +\fIformat\fR\&. See \fByasm_objfmts\fR(7) -for a list of supported object formats. +for a list of supported object formats\&. .RE .PP \fB\-g \fR\fB\fIdebug\fR\fR or \fB\-\-dformat=\fR\fB\fIdebug\fR\fR: Select debugging format .RS 4 -Selects the debugging format for debug information. Debugging information can be used by a debugger to associate executable code back to the source file or get data structure and type information. Available debug formats vary between different object formats; +Selects the debugging format for debug information\&. Debugging information can be used by a debugger to associate executable code back to the source file or get data structure and type information\&. Available debug formats vary between different object formats; \fByasm\fR -will error when an invalid combination is selected. The default object format is selected by the object format. To print a list of available debugging formats to standard output, use +will error when an invalid combination is selected\&. The default object format is selected by the object format\&. To print a list of available debugging formats to standard output, use \(lqhelp\(rq as -\fIdebug\fR. See +\fIdebug\fR\&. See \fByasm_dbgfmts\fR(7) -for a list of supported debugging formats. -.RE -.PP -\fB\-h\fR or \fB\-\-help\fR: Print a summary of options -.RS 4 -Prints a summary of invocation options. All other options are ignored, and no output file is generated. +for a list of supported debugging formats\&. .RE .PP \fB\-L \fR\fB\fIlist\fR\fR or \fB\-\-lformat=\fR\fB\fIlist\fR\fR: Select list file format .RS 4 -Selects the format/style of the output list file. List files typically intermix the original source with the machine code generated by the assembler. The default list format is -\(lqnasm\(rq, which mimics the NASM list file format. To print a list of available list file formats to standard output, use +Selects the format/style of the output list file\&. List files typically intermix the original source with the machine code generated by the assembler\&. The default list format is +\(lqnasm\(rq, which mimics the NASM list file format\&. To print a list of available list file formats to standard output, use \(lqhelp\(rq as -\fIlist\fR. +\fIlist\fR\&. .RE .PP \fB\-l \fR\fB\fIlistfile\fR\fR or \fB\-\-list=\fR\fB\fIlistfile\fR\fR: Specify list filename .RS 4 -Specifies the name of the output list file. If this option is not used, no list file is generated. +Specifies the name of the output list file\&. If this option is not used, no list file is generated\&. .RE .PP \fB\-m \fR\fB\fImachine\fR\fR or \fB\-\-machine=\fR\fB\fImachine\fR\fR: Select target machine architecture .RS 4 -Selects the target machine architecture. Essentially a subtype of the selected architecture, the machine type selects between major subsets of an architecture. For example, for the +Selects the target machine architecture\&. Essentially a subtype of the selected architecture, the machine type selects between major subsets of an architecture\&. For example, for the \(lqx86\(rq architecture, the two available machines are \(lqx86\(rq, which is used for the IA\-32 and derivative 32\-bit instruction set, and -\(lqamd64\(rq, which is used for the 64\-bit instruction set. This differentiation is required to generate the proper object file for relocatable object formats such as COFF and ELF. To print a list of available machines for a given architecture to standard output, use +\(lqamd64\(rq, which is used for the 64\-bit instruction set\&. This differentiation is required to generate the proper object file for relocatable object formats such as COFF and ELF\&. To print a list of available machines for a given architecture to standard output, use \(lqhelp\(rq as \fImachine\fR and the given architecture using -\fB\-a \fR\fB\fIarch\fR\fR. See +\fB\-a \fR\fB\fIarch\fR\fR\&. See \fByasm_arch\fR(7) -for more details. +for more details\&. .RE .PP \fB\-o \fR\fB\fIfilename\fR\fR or \fB\-\-objfile=\fR\fB\fIfilename\fR\fR: Specify object filename .RS 4 -Specifies the name of the output file, overriding any default name generated by Yasm. +Specifies the name of the output file, overriding any default name generated by Yasm\&. .RE .PP \fB\-p \fR\fB\fIparser\fR\fR or \fB\-\-parser=\fR\fB\fIparser\fR\fR: Select parser .RS 4 -Selects the parser (the assembler syntax). The default parser is -\(lqnasm\(rq, which emulates the syntax of NASM, the Netwide Assembler. Another available parser is -\(lqgas\(rq, which emulates the syntax of GNU AS. To print a list of available parsers to standard output, use +Selects the parser (the assembler syntax)\&. The default parser is +\(lqnasm\(rq, which emulates the syntax of NASM, the Netwide Assembler\&. Another available parser is +\(lqgas\(rq, which emulates the syntax of GNU AS\&. To print a list of available parsers to standard output, use \(lqhelp\(rq as -\fIparser\fR. See +\fIparser\fR\&. See \fByasm_parsers\fR(7) -for a list of supported parsers. +for a list of supported parsers\&. .RE .PP \fB\-r \fR\fB\fIpreproc\fR\fR or \fB\-\-preproc=\fR\fB\fIpreproc\fR\fR: Select preprocessor .RS 4 -Selects the preprocessor to use on the input file before passing it to the parser. Preprocessors often provide macro functionality that is not included in the main parser. The default preprocessor is -\(lqnasm\(rq, which is an imported version of the actual NASM preprocessor. A +Selects the preprocessor to use on the input file before passing it to the parser\&. Preprocessors often provide macro functionality that is not included in the main parser\&. The default preprocessor is +\(lqnasm\(rq, which is an imported version of the actual NASM preprocessor\&. A \(lqraw\(rq -preprocessor is also available, which simply skips the preprocessing step, passing the input file directly to the parser. To print a list of available preprocessors to standard output, use +preprocessor is also available, which simply skips the preprocessing step, passing the input file directly to the parser\&. To print a list of available preprocessors to standard output, use \(lqhelp\(rq as -\fIpreproc\fR. +\fIpreproc\fR\&. +.RE +.PP +\fB\-h\fR or \fB\-\-help\fR: Print a summary of options +.RS 4 +Prints a summary of invocation options\&. All other options are ignored, and no output file is generated\&. .RE .PP \fB\-\-version\fR: Get the Yasm version .RS 4 -This option causes Yasm to prints the version number of Yasm as well as a license summary to standard output. All other options are ignored, and no output file is generated. +This option causes Yasm to prints the version number of Yasm as well as a license summary to standard output\&. All other options are ignored, and no output file is generated\&. .RE .SS "Warning Options" .PP @@ -166,71 +174,71 @@ This option causes Yasm to prints the version number of Yasm as well as a licens options have two contrary forms: \fB\-W\fR\fB\fIname\fR\fR and -\fB\-Wno\-\fR\fB\fIname\fR\fR. Only the non\-default forms are shown here. +\fB\-Wno\-\fR\fB\fIname\fR\fR\&. Only the non\-default forms are shown here\&. .PP The warning options are handled in the order given on the command line, so if \fB\-w\fR is followed by \fB\-Worphan\-labels\fR, all warnings are turned off \fIexcept\fR -for orphan\-labels. +for orphan\-labels\&. .PP \fB\-w\fR: Inhibit all warning messages .RS 4 -This option causes Yasm to inhibit all warning messages. As discussed above, this option may be followed by other options to re\-enable specified warnings. +This option causes Yasm to inhibit all warning messages\&. As discussed above, this option may be followed by other options to re\-enable specified warnings\&. .RE .PP \fB\-Werror\fR: Treat warnings as errors .RS 4 -This option causes Yasm to treat all warnings as errors. Normally warnings do not prevent an object file from being generated and do not result in a failure exit status from -\fByasm\fR, whereas errors do. This option makes warnings equivalent to errors in terms of this behavior. +This option causes Yasm to treat all warnings as errors\&. Normally warnings do not prevent an object file from being generated and do not result in a failure exit status from +\fByasm\fR, whereas errors do\&. This option makes warnings equivalent to errors in terms of this behavior\&. .RE .PP \fB\-Wno\-unrecognized\-char\fR: Do not warn on unrecognized input characters .RS 4 -Causes Yasm to not warn on unrecognized characters found in the input. Normally Yasm will generate a warning for any non\-ASCII character found in the input file. +Causes Yasm to not warn on unrecognized characters found in the input\&. Normally Yasm will generate a warning for any non\-ASCII character found in the input file\&. .RE .PP \fB\-Worphan\-labels\fR: Warn on labels lacking a trailing option .RS 4 -When using the NASM\-compatible parser, causes Yasm to warn about labels found alone on a line without a trailing colon. While these are legal labels in NASM syntax, they may be unintentional, due to typos or macro definition ordering. +When using the NASM\-compatible parser, causes Yasm to warn about labels found alone on a line without a trailing colon\&. While these are legal labels in NASM syntax, they may be unintentional, due to typos or macro definition ordering\&. .RE .PP \fB\-X \fR\fB\fIstyle\fR\fR: Change error/warning reporting style .RS 4 -Selects a specific output style for error and warning messages. The default is +Selects a specific output style for error and warning messages\&. The default is \(lqgnu\(rq style, which mimics the output of -\fBgcc\fR. The +\fBgcc\fR\&. The \(lqvc\(rq -style is also available, which mimics the output of Microsoft's Visual C++ compiler. +style is also available, which mimics the output of Microsoft\'s Visual C++ compiler\&. .sp This option is available so that Yasm integrates more naturally into IDE environments such as Visual Studio or -Emacs, allowing the IDE to correctly recognize the error/warning message as such and link back to the offending line of source code. +Emacs, allowing the IDE to correctly recognize the error/warning message as such and link back to the offending line of source code\&. .RE .SS "Preprocessor Options" .PP While these preprocessor options theoretically will affect any preprocessor, the only preprocessor currently in Yasm is the \(lqnasm\(rq -preprocessor. +preprocessor\&. .PP \fB\-D \fR\fB\fImacro[=value]\fR\fR: Pre\-define a macro .RS 4 -Pre\-defines a single\-line macro. The value is optional (if no value is given, the macro is still defined, but to an empty value). +Pre\-defines a single\-line macro\&. The value is optional (if no value is given, the macro is still defined, but to an empty value)\&. .RE .PP \fB\-e\fR or \fB\-\-preproc\-only\fR: Only preprocess .RS 4 -Stops assembly after the preprocessing stage; preprocessed output is sent to the specified output name or, if no output name is specified, the standard output. No object file is produced. +Stops assembly after the preprocessing stage; preprocessed output is sent to the specified output name or, if no output name is specified, the standard output\&. No object file is produced\&. .RE .PP \fB\-I \fR\fB\fIpath\fR\fR: Add include file path .RS 4 Adds directory \fIpath\fR -to the search path for include files. The search path defaults to only including the directory in which the source file resides. +to the search path for include files\&. The search path defaults to only including the directory in which the source file resides\&. .RE .PP \fB\-P \fR\fB\fIfilename\fR\fR: Pre\-include a file @@ -238,65 +246,77 @@ to the search path for include files. The search path defaults to only including Pre\-includes file \fIfilename\fR, making it look as though \fIfilename\fR -was prepended to the input. Can be useful for prepending multi\-line macros that the +was prepended to the input\&. Can be useful for prepending multi\-line macros that the \fB\-D\fR -can't support. +can\'t support\&. .RE .PP \fB\-U \fR\fB\fImacro\fR\fR: Undefine a macro .RS 4 Undefines a single\-line macro (may be either a built\-in macro or one defined earlier in the command line with -\fB\-D\fR. +\fB\-D\fR\&. .RE .SH "EXAMPLES" .PP To assemble NASM syntax, 32\-bit x86 source -\fIsource.asm\fR +source\&.asm into ELF file -\fIsource.o\fR, warning on orphan labels: +source\&.o, warning on orphan labels: .sp +.if n \{\ .RS 4 +.\} .nf -yasm \-f elf32 \-Worphan\-labels source.asm +yasm \-f elf32 \-Worphan\-labels source\&.asm .fi +.if n \{\ .RE +.\} .PP To assemble NASM syntax AMD64 source -\fIx.asm\fR +x\&.asm into Win64 file -\fIobject.obj\fR: +object\&.obj: .sp +.if n \{\ .RS 4 +.\} .nf -yasm \-f win64 \-o object.obj x.asm +yasm \-f win64 \-o object\&.obj x\&.asm .fi +.if n \{\ .RE +.\} .PP To assemble already preprocessed NASM syntax x86 source -\fIy.asm\fR +y\&.asm into flat binary file -\fIy.com\fR: +y\&.com: .sp +.if n \{\ .RS 4 +.\} .nf -yasm \-f bin \-r raw \-o y.com y.asm +yasm \-f bin \-r raw \-o y\&.com y\&.asm .fi +.if n \{\ .RE +.\} .SH "DIAGNOSTICS" .PP The \fByasm\fR -command exits 0 on success, and nonzero if an error occurs. +command exits 0 on success, and nonzero if an error occurs\&. .SH "COMPATIBILITY" .PP -Yasm's NASM parser and preprocessor, while they strive to be as compatible as possible with NASM, have a few incompatibilities due to YASM's different internal structure. +Yasm\'s NASM parser and preprocessor, while they strive to be as compatible as possible with NASM, have a few incompatibilities due to YASM\'s different internal structure\&. .PP -Yasm's GAS parser and preprocessor are missing a number of features present in GNU AS. +Yasm\'s GAS parser and preprocessor are missing a number of features present in GNU AS\&. .SH "RESTRICTIONS" .PP -As object files are often architecture and machine dependent, not all combinations of object formats, architectures, and machines are legal; trying to use an invalid combination will result in an error. +As object files are often architecture and machine dependent, not all combinations of object formats, architectures, and machines are legal; trying to use an invalid combination will result in an error\&. .PP -There is no support for symbol maps. +There is no support for symbol maps\&. .SH "SEE ALSO" .PP \fByasm_arch\fR(7), @@ -316,14 +336,14 @@ architecture, it is overly easy to generate AMD64 code (using the \fBBITS 64\fR directive) and generate a 32\-bit object file (by failing to specify \fB\-m amd64\fR -or selecting a 64\-bit object format such as ELF64 on the command line). +or selecting a 64\-bit object format such as ELF64 on the command line)\&. .SH "AUTHOR" .PP -\fBPeter Johnson\fR <\&peter@tortall.net\&> -.sp -1n -.IP "" 4 +\fBPeter Johnson\fR <\&peter@tortall\&.net\&> +.RS 4 Author. +.RE .SH "COPYRIGHT" +.br Copyright \(co 2004, 2005, 2006, 2007 Peter Johnson .br - diff --git a/yasm_arch.7 b/yasm_arch.7 index c47c4971..bd72d3ff 100644 --- a/yasm_arch.7 +++ b/yasm_arch.7 @@ -1,23 +1,31 @@ +'\" t .\" Title: yasm_arch .\" Author: Peter Johnson -.\" Generator: DocBook XSL Stylesheets v1.71.1 +.\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: October 2006 .\" Manual: Yasm Supported Architectures .\" Source: Yasm +.\" Language: English .\" .TH "YASM_ARCH" "7" "October 2006" "Yasm" "Yasm Supported Architectures" +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- .SH "NAME" yasm_arch \- Yasm Supported Target Architectures .SH "SYNOPSIS" -.HP 5 -\fByasm\fR \fB\-a\ \fR\fB\fIarch\fR\fR [\fB\-m\ \fR\fB\fImachine\fR\fR] \fB\fI...\fR\fR +.HP \w'\fByasm\fR\ 'u +\fByasm\fR \fB\-a\ \fR\fB\fIarch\fR\fR [\fB\-m\ \fR\fB\fImachine\fR\fR] \fB\fI\&.\&.\&.\fR\fR .SH "DESCRIPTION" .PP -The standard Yasm distribution includes a number of modules for different target architectures. Each target architecture can support one or more machine architectures. +The standard Yasm distribution includes a number of modules for different target architectures\&. Each target architecture can support one or more machine architectures\&. .PP The architecture and machine are selected on the \fByasm\fR(1) @@ -25,9 +33,9 @@ command line by use of the \fB\-a \fR\fB\fIarch\fR\fR and \fB\-m \fR\fB\fImachine\fR\fR -command line options, respectively. +command line options, respectively\&. .PP -The machine architecture may also automatically be selected by certain object formats. For example, the +The machine architecture may also automatically be selected by certain object formats\&. For example, the \(lqelf32\(rq object format selects the \(lqx86\(rq @@ -35,367 +43,533 @@ machine architecture by default, while the \(lqelf64\(rq object format selects the \(lqamd64\(rq -machine architecture by default. +machine architecture by default\&. .SH "X86 ARCHITECTURE" .PP The \(lqx86\(rq -architecture supports the IA\-32 instruction set and derivatives and the AMD64 instruction set. It consists of two machines: +architecture supports the IA\-32 instruction set and derivatives and the AMD64 instruction set\&. It consists of two machines: \(lqx86\(rq (for the IA\-32 and derivatives) and \(lqamd64\(rq -(for the AMD64 and derivatives). The default machine for the +(for the AMD64 and derivatives)\&. The default machine for the \(lqx86\(rq architecture is the \(lqx86\(rq -machine. +machine\&. .SS "BITS Setting" .PP -The x86 architecture BITS setting specifies to Yasm the processor mode in which the generated code is intended to execute. x86 processors can run in three different major execution modes: 16\-bit, 32\-bit, and on AMD64\-supporting processors, 64\-bit. As the x86 instruction set contains portions whose function is execution\-mode dependent (such as operand\-size and address\-size override prefixes), Yasm cannot assemble x86 instructions correctly unless it is told by the user in what processor mode the code will execute. +The x86 architecture BITS setting specifies to Yasm the processor mode in which the generated code is intended to execute\&. x86 processors can run in three different major execution modes: 16\-bit, 32\-bit, and on AMD64\-supporting processors, 64\-bit\&. As the x86 instruction set contains portions whose function is execution\-mode dependent (such as operand\-size and address\-size override prefixes), Yasm cannot assemble x86 instructions correctly unless it is told by the user in what processor mode the code will execute\&. .PP -The BITS setting can be changed in a variety of ways. When using the NASM\-compatible parser, the BITS setting can be changed directly via the use of the +The BITS setting can be changed in a variety of ways\&. When using the NASM\-compatible parser, the BITS setting can be changed directly via the use of the \fBBITS xx\fR -assembler directive. The default BITS setting is determined by the object format in use. +assembler directive\&. The default BITS setting is determined by the object format in use\&. .SS "BITS 64 Extensions" .PP -The AMD64 architecture is a new 64\-bit architecture developed by AMD, based on the 32\-bit x86 architecture. It extends the original x86 architecture by doubling the number of general purpose and SIMD registers, extending the arithmetic operations and address space to 64 bits, as well as other features. +The AMD64 architecture is a new 64\-bit architecture developed by AMD, based on the 32\-bit x86 architecture\&. It extends the original x86 architecture by doubling the number of general purpose and SIMD registers, extending the arithmetic operations and address space to 64 bits, as well as other features\&. .PP -Recently, Intel has introduced an essentially identical version of AMD64 called EM64T. +Recently, Intel has introduced an essentially identical version of AMD64 called EM64T\&. .PP -When an AMD64\-supporting processor is executing in 64\-bit mode, a number of additional extensions are available, including extra general purpose registers, extra SSE2 registers, and RIP\-relative addressing. +When an AMD64\-supporting processor is executing in 64\-bit mode, a number of additional extensions are available, including extra general purpose registers, extra SSE2 registers, and RIP\-relative addressing\&. .PP -Yasm extends the base NASM syntax to support AMD64 as follows. To enable assembly of instructions for the 64\-bit mode of AMD64 processors, use the directive -\fBBITS 64\fR. As with NASM's BITS directive, this does not change the format of the output object file to 64 bits; it only changes the assembler mode to assume that the instructions being assembled will be run in 64\-bit mode. To specify an AMD64 object file, use +Yasm extends the base NASM syntax to support AMD64 as follows\&. To enable assembly of instructions for the 64\-bit mode of AMD64 processors, use the directive +\fBBITS 64\fR\&. As with NASM\'s BITS directive, this does not change the format of the output object file to 64 bits; it only changes the assembler mode to assume that the instructions being assembled will be run in 64\-bit mode\&. To specify an AMD64 object file, use \fB\-m amd64\fR on the Yasm command line, or explicitly target a 64\-bit object format such as \fB\-f win64\fR or -\fB\-f elf64\fR. +\fB\-f elf64\fR\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br +.ps +1 \fBRegister Changes\fR -.RS -.PP -The additional 64\-bit general purpose registers are named r8\-r15. There are also 8\-bit (rXb), 16\-bit (rXw), and 32\-bit (rXd) subregisters that map to the least significant 8, 16, or 32 bits of the 64\-bit register. The original 8 general purpose registers have also been extended to 64\-bits: eax, edx, ecx, ebx, esi, edi, esp, and ebp have new 64\-bit versions called rax, rdx, rcx, rbx, rsi, rdi, rsp, and rbp respectively. The old 32\-bit registers map to the least significant bits of the new 64\-bit registers. -.PP -New 8\-bit registers are also available that map to the 8 least significant bits of rsi, rdi, rsp, and rbp. These are called sil, dil, spl, and bpl respectively. Unfortunately, due to the way instructions are encoded, these new 8\-bit registers are encoded the same as the old 8\-bit registers ah, dh, ch, and bh. The processor tells which is being used by the presence of the new REX prefix that is used to specify the other extended registers. This means it is illegal to mix the use of ah, dh, ch, and bh with an instruction that requires the REX prefix for other reasons. For instance: -.sp .RS 4 +.PP +The additional 64\-bit general purpose registers are named r8\-r15\&. There are also 8\-bit (rXb), 16\-bit (rXw), and 32\-bit (rXd) subregisters that map to the least significant 8, 16, or 32 bits of the 64\-bit register\&. The original 8 general purpose registers have also been extended to 64\-bits: eax, edx, ecx, ebx, esi, edi, esp, and ebp have new 64\-bit versions called rax, rdx, rcx, rbx, rsi, rdi, rsp, and rbp respectively\&. The old 32\-bit registers map to the least significant bits of the new 64\-bit registers\&. +.PP +New 8\-bit registers are also available that map to the 8 least significant bits of rsi, rdi, rsp, and rbp\&. These are called sil, dil, spl, and bpl respectively\&. Unfortunately, due to the way instructions are encoded, these new 8\-bit registers are encoded the same as the old 8\-bit registers ah, dh, ch, and bh\&. The processor tells which is being used by the presence of the new REX prefix that is used to specify the other extended registers\&. This means it is illegal to mix the use of ah, dh, ch, and bh with an instruction that requires the REX prefix for other reasons\&. For instance: +.sp +.if n \{\ +.RS 4 +.\} .nf add ah, [r10] .fi +.if n \{\ .RE +.\} .PP -(NASM syntax) is not a legal instruction because the use of r10 requires a REX prefix, making it impossible to use ah. +(NASM syntax) is not a legal instruction because the use of r10 requires a REX prefix, making it impossible to use ah\&. .PP -In 64\-bit mode, an additional 8 SSE2 registers are also available. These are named xmm8\-xmm15. +In 64\-bit mode, an additional 8 SSE2 registers are also available\&. These are named xmm8\-xmm15\&. .RE .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br +.ps +1 \fB64 Bit Instructions\fR -.RS -.PP -By default, most operations in 64\-bit mode remain 32\-bit; operations that are 64\-bit usually require a REX prefix (one bit in the REX prefix determines whether an operation is 64\-bit or 32\-bit). Thus, essentially all 32\-bit instructions have a 64\-bit version, and the 64\-bit versions of instructions can use extended registers -\(lqfor free\(rq -(as the REX prefix is already present). Examples in NASM syntax: -.sp .RS 4 +.PP +By default, most operations in 64\-bit mode remain 32\-bit; operations that are 64\-bit usually require a REX prefix (one bit in the REX prefix determines whether an operation is 64\-bit or 32\-bit)\&. Thus, essentially all 32\-bit instructions have a 64\-bit version, and the 64\-bit versions of instructions can use extended registers +\(lqfor free\(rq +(as the REX prefix is already present)\&. Examples in NASM syntax: +.sp +.if n \{\ +.RS 4 +.\} .nf mov eax, 1 ; 32\-bit instruction .fi +.if n \{\ .RE +.\} .sp +.if n \{\ .RS 4 +.\} .nf mov rcx, 1 ; 64\-bit instruction .fi +.if n \{\ .RE +.\} .PP -Instructions that modify the stack (push, pop, call, ret, enter, and leave) are implicitly 64\-bit. Their 32\-bit counterparts are not available, but their 16\-bit counterparts are. Examples in NASM syntax: +Instructions that modify the stack (push, pop, call, ret, enter, and leave) are implicitly 64\-bit\&. Their 32\-bit counterparts are not available, but their 16\-bit counterparts are\&. Examples in NASM syntax: .sp +.if n \{\ .RS 4 +.\} .nf push eax ; illegal instruction .fi +.if n \{\ .RE +.\} .sp +.if n \{\ .RS 4 +.\} .nf push rbx ; 1\-byte instruction .fi +.if n \{\ .RE +.\} .sp +.if n \{\ .RS 4 +.\} .nf push r11 ; 2\-byte instruction with REX prefix .fi +.if n \{\ .RE +.\} .RE .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br +.ps +1 \fBImplicit Zero Extension\fR -.RS -.PP -Results of 32\-bit operations are implicitly zero\-extended to the upper 32 bits of the corresponding 64\-bit register. 16 and 8 bit operations, on the other hand, do not affect upper bits of the register (just as in 32\-bit and 16\-bit modes). This can be used to generate smaller code in some instances. Examples in NASM syntax: -.sp .RS 4 +.PP +Results of 32\-bit operations are implicitly zero\-extended to the upper 32 bits of the corresponding 64\-bit register\&. 16 and 8 bit operations, on the other hand, do not affect upper bits of the register (just as in 32\-bit and 16\-bit modes)\&. This can be used to generate smaller code in some instances\&. Examples in NASM syntax: +.sp +.if n \{\ +.RS 4 +.\} .nf mov ecx, 1 ; 1 byte shorter than mov rcx, 1 .fi +.if n \{\ .RE +.\} .sp +.if n \{\ .RS 4 +.\} .nf and edx, 3 ; equivalent to and rdx, 3 .fi +.if n \{\ .RE +.\} .RE .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br +.ps +1 \fBImmediates\fR -.RS -.PP -For most instructions in 64\-bit mode, immediate values remain 32 bits; their value is sign\-extended into the upper 32 bits of the target register prior to being used. The exception is the mov instruction, which can take a 64\-bit immediate when the destination is a 64\-bit register. Examples in NASM syntax: -.sp .RS 4 +.PP +For most instructions in 64\-bit mode, immediate values remain 32 bits; their value is sign\-extended into the upper 32 bits of the target register prior to being used\&. The exception is the mov instruction, which can take a 64\-bit immediate when the destination is a 64\-bit register\&. Examples in NASM syntax: +.sp +.if n \{\ +.RS 4 +.\} .nf add rax, 1 ; optimized down to signed 8\-bit .fi +.if n \{\ .RE +.\} .sp +.if n \{\ .RS 4 +.\} .nf add rax, dword 1 ; force size to 32\-bit .fi +.if n \{\ .RE +.\} .sp +.if n \{\ .RS 4 +.\} .nf add rax, 0xffffffff ; sign\-extended 32\-bit .fi +.if n \{\ .RE +.\} .sp +.if n \{\ .RS 4 +.\} .nf add rax, \-1 ; same as above .fi +.if n \{\ .RE +.\} .sp +.if n \{\ .RS 4 +.\} .nf add rax, 0xffffffffffffffff ; truncated to 32\-bit (warning) .fi +.if n \{\ .RE +.\} .sp +.if n \{\ .RS 4 +.\} .nf mov eax, 1 ; 5 byte .fi +.if n \{\ .RE +.\} .sp +.if n \{\ .RS 4 +.\} .nf mov rax, 1 ; 5 byte (optimized to signed 32\-bit) .fi +.if n \{\ .RE +.\} .sp +.if n \{\ .RS 4 +.\} .nf mov rax, qword 1 ; 10 byte (forced 64\-bit) .fi +.if n \{\ .RE +.\} .sp +.if n \{\ .RS 4 +.\} .nf mov rbx, 0x1234567890abcdef ; 10 byte .fi +.if n \{\ .RE +.\} .sp +.if n \{\ .RS 4 +.\} .nf mov rcx, 0xffffffff ; 10 byte (does not fit in signed 32\-bit) .fi +.if n \{\ .RE +.\} .sp +.if n \{\ .RS 4 +.\} .nf mov ecx, \-1 ; 5 byte, equivalent to above .fi +.if n \{\ .RE +.\} .sp +.if n \{\ .RS 4 +.\} .nf mov rcx, sym ; 5 byte, 32\-bit size default for symbols .fi +.if n \{\ .RE +.\} .sp +.if n \{\ .RS 4 +.\} .nf mov rcx, qword sym ; 10 byte, override default size .fi +.if n \{\ .RE +.\} .PP -The handling of mov reg64, unsized immediate is different between YASM and NASM 2.x; YASM follows the above behavior, while NASM 2.x does the following: +The handling of mov reg64, unsized immediate is different between YASM and NASM 2\&.x; YASM follows the above behavior, while NASM 2\&.x does the following: .sp +.if n \{\ .RS 4 +.\} .nf add rax, 0xffffffff ; sign\-extended 32\-bit immediate .fi +.if n \{\ .RE +.\} .sp +.if n \{\ .RS 4 +.\} .nf add rax, \-1 ; same as above .fi +.if n \{\ .RE +.\} .sp +.if n \{\ .RS 4 +.\} .nf add rax, 0xffffffffffffffff ; truncated 32\-bit (warning) .fi +.if n \{\ .RE +.\} .sp +.if n \{\ .RS 4 +.\} .nf add rax, sym ; sign\-extended 32\-bit immediate .fi +.if n \{\ .RE +.\} .sp +.if n \{\ .RS 4 +.\} .nf mov eax, 1 ; 5 byte (32\-bit immediate) .fi +.if n \{\ .RE +.\} .sp +.if n \{\ .RS 4 +.\} .nf mov rax, 1 ; 10 byte (64\-bit immediate) .fi +.if n \{\ .RE +.\} .sp +.if n \{\ .RS 4 +.\} .nf mov rbx, 0x1234567890abcdef ; 10 byte instruction .fi +.if n \{\ .RE +.\} .sp +.if n \{\ .RS 4 +.\} .nf mov rcx, 0xffffffff ; 10 byte instruction .fi +.if n \{\ .RE +.\} .sp +.if n \{\ .RS 4 +.\} .nf mov ecx, \-1 ; 5 byte, equivalent to above .fi +.if n \{\ .RE +.\} .sp +.if n \{\ .RS 4 +.\} .nf mov ecx, sym ; 5 byte (32\-bit immediate) .fi +.if n \{\ .RE +.\} .sp +.if n \{\ .RS 4 +.\} .nf mov rcx, sym ; 10 byte instruction .fi +.if n \{\ .RE +.\} .sp +.if n \{\ .RS 4 +.\} .nf mov rcx, qword sym ; 10 byte (64\-bit immediate) .fi +.if n \{\ .RE +.\} .RE .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br +.ps +1 \fBDisplacements\fR -.RS -.PP -Just like immediates, displacements, for the most part, remain 32 bits and are sign extended prior to use. Again, the exception is one restricted form of the mov instruction: between the al/ax/eax/rax register and a 64\-bit absolute address (no registers allowed in the effective address). In NASM syntax, use of the 64\-bit absolute form requires -\fB[qword]\fR. Examples in NASM syntax: -.sp .RS 4 +.PP +Just like immediates, displacements, for the most part, remain 32 bits and are sign extended prior to use\&. Again, the exception is one restricted form of the mov instruction: between the al/ax/eax/rax register and a 64\-bit absolute address (no registers allowed in the effective address)\&. In NASM syntax, use of the 64\-bit absolute form requires +\fB[qword]\fR\&. Examples in NASM syntax: +.sp +.if n \{\ +.RS 4 +.\} .nf mov eax, [1] ; 32 bit, with sign extension .fi +.if n \{\ .RE +.\} .sp +.if n \{\ .RS 4 +.\} .nf mov al, [rax\-1] ; 32 bit, with sign extension .fi +.if n \{\ .RE +.\} .sp +.if n \{\ .RS 4 +.\} .nf mov al, [qword 0x1122334455667788] ; 64\-bit absolute .fi +.if n \{\ .RE +.\} .sp +.if n \{\ .RS 4 +.\} .nf mov al, [0x1122334455667788] ; truncated to 32\-bit (warning) .fi +.if n \{\ .RE +.\} .RE .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br +.ps +1 \fBRIP Relative Addressing\fR -.RS +.RS 4 .PP -In 64\-bit mode, a new form of effective addressing is available to make it easier to write position\-independent code. Any memory reference may be made RIP relative (RIP is the instruction pointer register, which contains the address of the location immediately following the current instruction). +In 64\-bit mode, a new form of effective addressing is available to make it easier to write position\-independent code\&. Any memory reference may be made RIP relative (RIP is the instruction pointer register, which contains the address of the location immediately following the current instruction)\&. .PP In NASM syntax, there are two ways to specify RIP\-relative addressing: .sp +.if n \{\ .RS 4 +.\} .nf mov dword [rip+10], 1 .fi +.if n \{\ .RE +.\} .PP -stores the value 1 ten bytes after the end of the instruction. +stores the value 1 ten bytes after the end of the instruction\&. \fB10\fR -can also be a symbolic constant, and will be treated the same way. On the other hand, +can also be a symbolic constant, and will be treated the same way\&. On the other hand, .sp +.if n \{\ .RS 4 +.\} .nf mov dword [symb wrt rip], 1 .fi +.if n \{\ .RE +.\} .PP stores the value 1 into the address of symbol -\fBsymb\fR. This is distinctly different than the behavior of: +\fBsymb\fR\&. This is distinctly different than the behavior of: .sp +.if n \{\ .RS 4 +.\} .nf mov dword [symb+rip], 1 .fi +.if n \{\ .RE +.\} .PP which takes the address of the end of the instruction, adds the address of \fBsymb\fR -to it, then stores the value 1 there. If +to it, then stores the value 1 there\&. If \fBsymb\fR is a variable, this will \fInot\fR @@ -405,164 +579,249 @@ variable! .PP Yasm also supports the following syntax for RIP\-relative addressing: .sp +.if n \{\ .RS 4 +.\} .nf mov [rel sym], rax ; RIP\-relative .fi +.if n \{\ .RE +.\} .sp +.if n \{\ .RS 4 +.\} .nf mov [abs sym], rax ; not RIP\-relative .fi +.if n \{\ .RE +.\} .PP The behavior of: .sp +.if n \{\ .RS 4 +.\} .nf mov [sym], rax .fi +.if n \{\ .RE +.\} .PP -Depends on a mode set by the DEFAULT directive, as follows. The default mode is always "abs", and in "rel" mode, use of registers, an fs or gs segment override, or an explicit "abs" override will result in a non\-RIP\-relative effective address. +Depends on a mode set by the DEFAULT directive, as follows\&. The default mode is always "abs", and in "rel" mode, use of registers, an fs or gs segment override, or an explicit "abs" override will result in a non\-RIP\-relative effective address\&. .sp +.if n \{\ .RS 4 +.\} .nf default rel .fi +.if n \{\ .RE +.\} .sp +.if n \{\ .RS 4 +.\} .nf mov [sym], rbx ; RIP\-relative .fi +.if n \{\ .RE +.\} .sp +.if n \{\ .RS 4 +.\} .nf mov [abs sym], rbx ; not RIP\-relative (explicit override) .fi +.if n \{\ .RE +.\} .sp +.if n \{\ .RS 4 +.\} .nf mov [rbx+1], rbx ; not RIP\-relative (register use) .fi +.if n \{\ .RE +.\} .sp +.if n \{\ .RS 4 +.\} .nf mov [fs:sym], rbx ; not RIP\-relative (fs or gs use) .fi +.if n \{\ .RE +.\} .sp +.if n \{\ .RS 4 +.\} .nf mov [ds:sym], rbx ; RIP\-relative (segment, but not fs or gs) .fi +.if n \{\ .RE +.\} .sp +.if n \{\ .RS 4 +.\} .nf mov [rel sym], rbx ; RIP\-relative (redundant override) .fi +.if n \{\ .RE +.\} .sp +.if n \{\ .RS 4 +.\} .nf default abs .fi +.if n \{\ .RE +.\} .sp +.if n \{\ .RS 4 +.\} .nf mov [sym], rbx ; not RIP\-relative .fi +.if n \{\ .RE +.\} .sp +.if n \{\ .RS 4 +.\} .nf mov [abs sym], rbx ; not RIP\-relative .fi +.if n \{\ .RE +.\} .sp +.if n \{\ .RS 4 +.\} .nf mov [rbx+1], rbx ; not RIP\-relative .fi +.if n \{\ .RE +.\} .sp +.if n \{\ .RS 4 +.\} .nf mov [fs:sym], rbx ; not RIP\-relative .fi +.if n \{\ .RE +.\} .sp +.if n \{\ .RS 4 +.\} .nf mov [ds:sym], rbx ; not RIP\-relative .fi +.if n \{\ .RE +.\} .sp +.if n \{\ .RS 4 +.\} .nf mov [rel sym], rbx ; RIP\-relative (explicit override) .fi +.if n \{\ .RE +.\} .RE .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br +.ps +1 \fBMemory references\fR -.RS -.PP -Usually the size of a memory reference can be deduced by which registers you're moving\-\-for example, "mov [rax],ecx" is a 32\-bit move, because ecx is 32 bits. YASM currently gives the non\-obvious "invalid combination of opcode and operands" error if it can't figure out how much memory you're moving. The fix in this case is to add a memory size specifier: qword, dword, word, or byte. -.PP -Here's a 64\-bit memory move, which sets 8 bytes starting at rax: -.sp .RS 4 +.PP +Usually the size of a memory reference can be deduced by which registers you\'re moving\-\-for example, "mov [rax],ecx" is a 32\-bit move, because ecx is 32 bits\&. YASM currently gives the non\-obvious "invalid combination of opcode and operands" error if it can\'t figure out how much memory you\'re moving\&. The fix in this case is to add a memory size specifier: qword, dword, word, or byte\&. +.PP +Here\'s a 64\-bit memory move, which sets 8 bytes starting at rax: +.sp +.if n \{\ +.RS 4 +.\} .nf mov qword [rax], 1 .fi +.if n \{\ .RE +.\} .PP -Here's a 32\-bit memory move, which sets 4 bytes: +Here\'s a 32\-bit memory move, which sets 4 bytes: .sp +.if n \{\ .RS 4 +.\} .nf mov dword [rax], 1 .fi +.if n \{\ .RE +.\} .PP -Here's a 16\-bit memory move, which sets 2 bytes: +Here\'s a 16\-bit memory move, which sets 2 bytes: .sp +.if n \{\ .RS 4 +.\} .nf mov word [rax], 1 .fi +.if n \{\ .RE +.\} .PP -Here's an 8\-bit memory move, which sets 1 byte: +Here\'s an 8\-bit memory move, which sets 1 byte: .sp +.if n \{\ .RS 4 +.\} .nf mov byte [rax], 1 .fi +.if n \{\ .RE +.\} .RE .SH "LC3B ARCHITECTURE" .PP The \(lqlc3b\(rq -architecture supports the LC\-3b ISA as used in the ECE 312 (now ECE 411) course at the University of Illinois, Urbana\-Champaign, as well as other university courses. See -\fI\%http://courses.ece.uiuc.edu/ece411/\fR -for more details and example code. The +architecture supports the LC\-3b ISA as used in the ECE 312 (now ECE 411) course at the University of Illinois, Urbana\-Champaign, as well as other university courses\&. See +\m[blue]\fB\%http://courses.ece.uiuc.edu/ece411/\fR\m[] +for more details and example code\&. The \(lqlc3b\(rq architecture consists of only one machine: -\(lqlc3b\(rq. +\(lqlc3b\(rq\&. .SH "SEE ALSO" .PP \fByasm\fR(1) @@ -574,17 +833,17 @@ architecture, it is overly easy to generate AMD64 code (using the \fBBITS 64\fR directive) and generate a 32\-bit object file (by failing to specify \fB\-m amd64\fR -on the command line or selecting a 64\-bit object format). Similarly, specifying +on the command line or selecting a 64\-bit object format)\&. Similarly, specifying \fB\-m amd64\fR -does not default the BITS setting to 64. An easy way to avoid this is by directly specifying a 64\-bit object format such as -\fB\-f elf64\fR. +does not default the BITS setting to 64\&. An easy way to avoid this is by directly specifying a 64\-bit object format such as +\fB\-f elf64\fR\&. .SH "AUTHOR" .PP -\fBPeter Johnson\fR <\&peter@tortall.net\&> -.sp -1n -.IP "" 4 +\fBPeter Johnson\fR <\&peter@tortall\&.net\&> +.RS 4 Author. +.RE .SH "COPYRIGHT" +.br Copyright \(co 2004, 2005, 2006, 2007 Peter Johnson .br - diff --git a/yasm_dbgfmts.7 b/yasm_dbgfmts.7 index 2227d8cf..aed28823 100644 --- a/yasm_dbgfmts.7 +++ b/yasm_dbgfmts.7 @@ -1,53 +1,63 @@ +'\" t .\" Title: yasm_dbgfmts .\" Author: Peter Johnson -.\" Generator: DocBook XSL Stylesheets v1.70.1 +.\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: October 2006 .\" Manual: Yasm Supported Debug Formats .\" Source: Yasm +.\" Language: English .\" .TH "YASM_DBGFMTS" "7" "October 2006" "Yasm" "Yasm Supported Debug Formats" +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- .SH "NAME" yasm_dbgfmts \- Yasm Supported Debugging Formats .SH "SYNOPSIS" -.HP 5 -\fByasm\fR \fB\-g\ \fR\fB\fIdbgfmt\fR\fR \fB\fI...\fR\fR +.HP \w'\fByasm\fR\ 'u +\fByasm\fR \fB\-g\ \fR\fB\fIdbgfmt\fR\fR \fB\fI\&.\&.\&.\fR\fR .SH "DESCRIPTION" .PP -The standard Yasm distribution includes a number of modules for different debugging formats. The debugging information is embedded into the object file. Use of a non\-\(lqnull\(rq -debug format also causes Yasm to output all symbols to the object file (including local symbols). +The standard Yasm distribution includes a number of modules for different debugging formats\&. The debugging information is embedded into the object file\&. Use of a non\-\(lqnull\(rq +debug format also causes Yasm to output all symbols to the object file (including local symbols)\&. .PP The debug format is selected on the \fByasm\fR(1) command line by use of the \fB\-g \fR\fB\fIdbgfmt\fR\fR -command line option. +command line option\&. .SH "CV8" .PP -The CV8 debug format is used by Microsoft Visual Studio 2005 (version 8.0) and is completely undocumented, although it bears strong similarities to earlier CodeView formats. Yasm's support for the CV8 debug format is currently limited to generating assembly\-level line number information (to allow some level of source\-level debugging). The CV8 debug information is stored in the .debug$S and .debug$T sections of the Win64 object file. +The CV8 debug format is used by Microsoft Visual Studio 2005 (version 8\&.0) and is completely undocumented, although it bears strong similarities to earlier CodeView formats\&. Yasm\'s support for the CV8 debug format is currently limited to generating assembly\-level line number information (to allow some level of source\-level debugging)\&. The CV8 debug information is stored in the \&.debug$S and \&.debug$T sections of the Win64 object file\&. .SH "DWARF2" .PP -The DWARF 2 debug format is a complex, well\-documented standard for debugging information. It was created to overcome shortcomings in STABS, allowing for much more detailed and compact descriptions of data structures, data variable movement, and complex language structures such as in C++. The debugging information is stored in sections (just like normal program sections) in the object file. Yasm supports full pass\-through of DWARF2 debugging information (e.g. from a C++ compiler), and can also generate assembly\-level line number information. +The DWARF 2 debug format is a complex, well\-documented standard for debugging information\&. It was created to overcome shortcomings in STABS, allowing for much more detailed and compact descriptions of data structures, data variable movement, and complex language structures such as in C++\&. The debugging information is stored in sections (just like normal program sections) in the object file\&. Yasm supports full pass\-through of DWARF2 debugging information (e\&.g\&. from a C++ compiler), and can also generate assembly\-level line number information\&. .SH "NULL" .PP The \(lqnull\(rq -debug format is a placeholder; it adds no debugging information to the output file. +debug format is a placeholder; it adds no debugging information to the output file\&. .SH "STABS" .PP -The STABS debug format is a poorly documented, semi\-standard format for debugging information in COFF and ELF object files. The debugging information is stored as part of the object file's symbol table and thus is limited in complexity and scope. Despite this, STABS is a common debugging format on older Unix and compatible systems, as well as DJGPP. +The STABS debug format is a poorly documented, semi\-standard format for debugging information in COFF and ELF object files\&. The debugging information is stored as part of the object file\'s symbol table and thus is limited in complexity and scope\&. Despite this, STABS is a common debugging format on older Unix and compatible systems, as well as DJGPP\&. .SH "SEE ALSO" .PP \fByasm\fR(1), \fByasm_objfmts\fR(7) .SH "AUTHOR" .PP -\fBPeter\fR \fBJohnson\fR -.sp -1n -.IP "" 3n +\fBPeter Johnson\fR <\&peter@tortall\&.net\&> +.RS 4 Author. +.RE .SH "COPYRIGHT" +.br Copyright \(co 2006 Peter Johnson +.br diff --git a/yasm_objfmts.7 b/yasm_objfmts.7 index 9825c0ac..5f642735 100644 --- a/yasm_objfmts.7 +++ b/yasm_objfmts.7 @@ -1,81 +1,91 @@ +'\" t .\" Title: yasm_objfmts .\" Author: Peter Johnson -.\" Generator: DocBook XSL Stylesheets v1.70.1 +.\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: February 2007 .\" Manual: Yasm Supported Object Formats .\" Source: Yasm +.\" Language: English .\" .TH "YASM_OBJFMTS" "7" "February 2007" "Yasm" "Yasm Supported Object Formats" +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- .SH "NAME" yasm_objfmts \- Yasm Supported Object Formats .SH "SYNOPSIS" -.HP 5 -\fByasm\fR \fB\-f\ \fR\fB\fIobjfmt\fR\fR \fB\fI...\fR\fR +.HP \w'\fByasm\fR\ 'u +\fByasm\fR \fB\-f\ \fR\fB\fIobjfmt\fR\fR \fB\fI\&.\&.\&.\fR\fR .SH "DESCRIPTION" .PP -The standard Yasm distribution includes a number of modules for different object formats (Yasm's primary output). +The standard Yasm distribution includes a number of modules for different object formats (Yasm\'s primary output)\&. .PP The object format is selected on the \fByasm\fR(1) command line by use of the \fB\-f \fR\fB\fIobjfmt\fR\fR -command line option. +command line option\&. .SH "BIN" .PP The \(lqbin\(rq -object format produces a flat\-format, non\-relocatable binary file. It is appropriate for producing DOS .COM executables or things like boot blocks. It supports only 3 sections and those sections are written in a predefined order to the output file. +object format produces a flat\-format, non\-relocatable binary file\&. It is appropriate for producing DOS \&.COM executables or things like boot blocks\&. It supports only 3 sections and those sections are written in a predefined order to the output file\&. .SH "COFF" .PP -The COFF object format is an older relocatable object format used on older Unix and compatible systems, and also (more recently) on the DJGPP development system for DOS. +The COFF object format is an older relocatable object format used on older Unix and compatible systems, and also (more recently) on the DJGPP development system for DOS\&. .SH "DBG" .PP The \(lqdbg\(rq object format is not a \(lqreal\(rq -object format; the output file it creates simply describes the sequence of calls made to it by Yasm and the final object and symbol table information in a human\-readable text format (that in a normal object format would get processed into that object format's particular binary representation). This object format is not intended for real use, but rather for debugging Yasm's internals. +object format; the output file it creates simply describes the sequence of calls made to it by Yasm and the final object and symbol table information in a human\-readable text format (that in a normal object format would get processed into that object format\'s particular binary representation)\&. This object format is not intended for real use, but rather for debugging Yasm\'s internals\&. .SH "ELF" .PP The ELF object format really comes in two flavors: \(lqelf32\(rq (for 32\-bit targets) and \(lqelf64\(rq -(for 64\-bit targets). ELF is a standard object format in common use on modern Unix and compatible systems (e.g. Linux, FreeBSD). ELF has complex support for relocatable and shared objects. +(for 64\-bit targets)\&. ELF is a standard object format in common use on modern Unix and compatible systems (e\&.g\&. Linux, FreeBSD)\&. ELF has complex support for relocatable and shared objects\&. .SH "MACHO" .PP The Mach\-O object format really comes in two flavors: \(lqmacho32\(rq (for 32\-bit targets) and \(lqmacho64\(rq -(for 64\-bit targets). Mach\-O is used as the object format on MacOS X. As Yasm currently only supports x86 and AMD64 instruction sets, it can only generate Mach\-O objects for Intel\-based Macs. +(for 64\-bit targets)\&. Mach\-O is used as the object format on MacOS X\&. As Yasm currently only supports x86 and AMD64 instruction sets, it can only generate Mach\-O objects for Intel\-based Macs\&. .SH "RDF" .PP -The RDOFF2 object format is a simple multi\-section format originally designed for NASM. It supports segment references but not WRT references. It was designed primarily for simplicity and has minimalistic headers for ease of loading and linking. A complete toolchain (linker, librarian, and loader) is distributed with NASM. +The RDOFF2 object format is a simple multi\-section format originally designed for NASM\&. It supports segment references but not WRT references\&. It was designed primarily for simplicity and has minimalistic headers for ease of loading and linking\&. A complete toolchain (linker, librarian, and loader) is distributed with NASM\&. .SH "WIN32" .PP -The Win32 object format produces object files compatible with Microsoft compilers (such as Visual C++) that target the 32\-bit x86 Windows platform. The object format itself is an extended version of COFF. +The Win32 object format produces object files compatible with Microsoft compilers (such as Visual C++) that target the 32\-bit x86 Windows platform\&. The object format itself is an extended version of COFF\&. .SH "WIN64" .PP The Win64 object format produces object files compatible with Microsoft compilers that target the 64\-bit \(lqx64\(rq -Windows platform. This format is very similar to the win32 object format, but produces 64\-bit objects. +Windows platform\&. This format is very similar to the win32 object format, but produces 64\-bit objects\&. .SH "XDF" .PP -The XDF object format is essentially a simplified version of COFF. It's a multi\-section relocatable format that supports 64\-bit physical and virtual addresses. +The XDF object format is essentially a simplified version of COFF\&. It\'s a multi\-section relocatable format that supports 64\-bit physical and virtual addresses\&. .SH "SEE ALSO" .PP \fByasm\fR(1), \fByasm_arch\fR(7) .SH "AUTHOR" .PP -\fBPeter\fR \fBJohnson\fR -.sp -1n -.IP "" 3n +\fBPeter Johnson\fR <\&peter@tortall\&.net\&> +.RS 4 Author. +.RE .SH "COPYRIGHT" +.br Copyright \(co 2006 Peter Johnson +.br diff --git a/yasm_parsers.7 b/yasm_parsers.7 index a418b6f1..058db4b7 100644 --- a/yasm_parsers.7 +++ b/yasm_parsers.7 @@ -1,48 +1,58 @@ +'\" t .\" Title: yasm_parsers .\" Author: Peter Johnson -.\" Generator: DocBook XSL Stylesheets v1.70.1 +.\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: October 2006 .\" Manual: Yasm Supported Parsers .\" Source: Yasm +.\" Language: English .\" .TH "YASM_PARSERS" "7" "October 2006" "Yasm" "Yasm Supported Parsers" +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- .SH "NAME" yasm_parsers \- Yasm Supported Parsers (Assembler Syntaxes) .SH "SYNOPSIS" -.HP 5 -\fByasm\fR \fB\-p\ \fR\fB\fIparser\fR\fR [\fB\-r\ \fR\fB\fIpreproc\fR\fR] \fB\fI...\fR\fR +.HP \w'\fByasm\fR\ 'u +\fByasm\fR \fB\-p\ \fR\fB\fIparser\fR\fR [\fB\-r\ \fR\fB\fIpreproc\fR\fR] \fB\fI\&.\&.\&.\fR\fR .SH "DESCRIPTION" .PP -The standard Yasm distribution includes a number of modules for different parsers (assembler syntaxes). +The standard Yasm distribution includes a number of modules for different parsers (assembler syntaxes)\&. .PP The parser is selected on the \fByasm\fR(1) command line by use of the \fB\-p \fR\fB\fIparser\fR\fR -command line option. +command line option\&. .SH "NASM PARSER" .PP NASM syntax, selected with -\fB\-p nasm\fR, is the most full\-featured syntax supported by Yasm. Yasm is nearly 100% compatible with NASM for 16\-bit and 32\-bit x86 code. Yasm additionally supports 64\-bit AMD64 code with Yasm extensions to the NASM syntax; see +\fB\-p nasm\fR, is the most full\-featured syntax supported by Yasm\&. Yasm is nearly 100% compatible with NASM for 16\-bit and 32\-bit x86 code\&. Yasm additionally supports 64\-bit AMD64 code with Yasm extensions to the NASM syntax; see \fByasm_arch\fR(7) -for details. NASM syntax is the Yasm default. +for details\&. NASM syntax is the Yasm default\&. .SH "GAS PARSER" .PP -The GNU Assembler (GAS) is the de\-facto cross\-platform assembler for modern Unix systems, and is used as the backend for the GCC compiler. Yasm's support for GAS syntax is moderately good, although immature: not all directives are supported, and only 32\-bit x86 and AMD64 architectures are supported. There is also no support for the GAS preprocessor. Despite these limitations, Yasm's GAS syntax support is good enough to handle essentially all x86 and AMD64 GCC compiler output. The GAS parser can be selected with -\fB\-p gas\fR. +The GNU Assembler (GAS) is the de\-facto cross\-platform assembler for modern Unix systems, and is used as the backend for the GCC compiler\&. Yasm\'s support for GAS syntax is moderately good, although immature: not all directives are supported, and only 32\-bit x86 and AMD64 architectures are supported\&. Nearly all of the GAS preprocessor is also supported\&. Yasm\'s GAS syntax support is good enough to handle essentially all x86 and AMD64 GCC compiler output\&. The GAS parser can be selected with +\fB\-p gas\fR\&. .SH "SEE ALSO" .PP \fByasm\fR(1), \fByasm_arch\fR(7) .SH "AUTHOR" .PP -\fBPeter\fR \fBJohnson\fR -.sp -1n -.IP "" 3n +\fBPeter Johnson\fR <\&peter@tortall\&.net\&> +.RS 4 Author. +.RE .SH "COPYRIGHT" +.br Copyright \(co 2006 Peter Johnson +.br From e11ea9df147b9f803f8a1bdfcdea37d454243c5a Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 3 Sep 2011 21:18:08 -0700 Subject: [PATCH 426/585] Add missing macho32-pext test case. --- .../macho/tests/nasm32/macho32-pext.asm | 4 + .../macho/tests/nasm32/macho32-pext.hex | 202 ++++++++++++++++++ 2 files changed, 206 insertions(+) create mode 100644 modules/objfmts/macho/tests/nasm32/macho32-pext.asm create mode 100644 modules/objfmts/macho/tests/nasm32/macho32-pext.hex diff --git a/modules/objfmts/macho/tests/nasm32/macho32-pext.asm b/modules/objfmts/macho/tests/nasm32/macho32-pext.asm new file mode 100644 index 00000000..f881b4fc --- /dev/null +++ b/modules/objfmts/macho/tests/nasm32/macho32-pext.asm @@ -0,0 +1,4 @@ +[GLOBAL function:private_extern] + +function: + ret diff --git a/modules/objfmts/macho/tests/nasm32/macho32-pext.hex b/modules/objfmts/macho/tests/nasm32/macho32-pext.hex new file mode 100644 index 00000000..6a8eb4f4 --- /dev/null +++ b/modules/objfmts/macho/tests/nasm32/macho32-pext.hex @@ -0,0 +1,202 @@ +ce +fa +ed +fe +07 +00 +00 +00 +03 +00 +00 +00 +01 +00 +00 +00 +02 +00 +00 +00 +94 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +7c +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +b0 +00 +00 +00 +01 +00 +00 +00 +07 +00 +00 +00 +07 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +5f +5f +74 +65 +78 +74 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +5f +5f +54 +45 +58 +54 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +b0 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +80 +00 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +18 +00 +00 +00 +b4 +00 +00 +00 +01 +00 +00 +00 +c0 +00 +00 +00 +0a +00 +00 +00 +c3 +00 +00 +00 +01 +00 +00 +00 +1f +01 +00 +00 +00 +00 +00 +00 +00 +66 +75 +6e +63 +74 +69 +6f +6e +00 From 451bfd6374db3b4134128a02ea7cc95b48949b90 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 3 Sep 2011 21:18:34 -0700 Subject: [PATCH 427/585] Fix .gitignore for some wildcards. --- .gitignore | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 7ca446de..5cb5fefc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ autom4te.cache stamp-h* -config.* libyasm-stdint.h nasm-token.c nasm-macros.c @@ -28,7 +27,7 @@ version.mac configure configure.scan configure.lineno -config.* +./config.* aclocal.m4 *.tar.gz *.la @@ -42,7 +41,7 @@ libtool *.bbg *.da results -Makefile +./Makefile Makefile.in .*.swp python-setup.txt @@ -65,5 +64,5 @@ win64-nasm.c YASM-VERSION-FILE YASM-VERSION.h .sw* -*.s -*.asm +./*.s +./*.asm From 0e3fa2d6d1fe83b86fe075a46c927d419fafef75 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 3 Sep 2011 21:27:21 -0700 Subject: [PATCH 428/585] Makefile.am: Clean YASM-VERSION.h. --- Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.am b/Makefile.am index 208dc67f..35559cb9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -32,6 +32,7 @@ EXTRA_DIST = config/config.rpath # libyasm-stdint.h doesn't clean up after itself? CONFIG_CLEAN_FILES = libyasm-stdint.h CONFIG_CLEAN_FILES += YASM-VERSION-FILE +CONFIG_CLEAN_FILES += YASM-VERSION.h EXTRA_DIST += tools/Makefile.inc EXTRA_DIST += libyasm/Makefile.inc From a2cbb10ee1b90b73647667ac849c74d65761d412 Mon Sep 17 00:00:00 2001 From: Pawel Worach Date: Sat, 24 Sep 2011 16:41:08 +0300 Subject: [PATCH 429/585] Fix clang warning: libyasm/md5.c:166:31: warning: argument to 'sizeof' in 'memset' call is the same expression as the destination; did you mean to dereference it? [-Wsizeof-pointer-memaccess] memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */ ~~~ ^~~ --- libyasm/md5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libyasm/md5.c b/libyasm/md5.c index 86fb9c30..ba1a3077 100644 --- a/libyasm/md5.c +++ b/libyasm/md5.c @@ -162,7 +162,7 @@ yasm_md5_final(unsigned char digest[16], yasm_md5_context *ctx) putu32(ctx->buf[1], digest + 4); putu32(ctx->buf[2], digest + 8); putu32(ctx->buf[3], digest + 12); - memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */ + memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */ } #ifndef ASM_MD5 From 716c17112d85cc4aa3735ce2959b3fe9c06bcb80 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 30 Sep 2011 12:52:07 -0700 Subject: [PATCH 430/585] nasm-pp.c: Plug a memory leak. --- modules/preprocs/nasm/nasm-pp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/preprocs/nasm/nasm-pp.c b/modules/preprocs/nasm/nasm-pp.c index b892a64a..06eaa9ab 100644 --- a/modules/preprocs/nasm/nasm-pp.c +++ b/modules/preprocs/nasm/nasm-pp.c @@ -5307,6 +5307,7 @@ make_tok_num(Token * tok, yasm_intnum *val) { tok->text = yasm_intnum_get_str(val); tok->type = TOK_NUMBER; + yasm_intnum_destroy(val); } Preproc nasmpp = { From 25a46fa5b0a66a327e0e9180d9aec80359c22c16 Mon Sep 17 00:00:00 2001 From: Simon Brenner Date: Sun, 2 Oct 2011 05:39:11 +0200 Subject: [PATCH 431/585] Implement the base offset parameter to 'struc' --- modules/parsers/nasm/nasm-std.mac | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/parsers/nasm/nasm-std.mac b/modules/parsers/nasm/nasm-std.mac index 3c9223ab..bb6e5c4e 100644 --- a/modules/parsers/nasm/nasm-std.mac +++ b/modules/parsers/nasm/nasm-std.mac @@ -25,14 +25,14 @@ __SECT__ %endmacro -%imacro struc 1.nolist +%imacro struc 1-2.nolist 0 %push struc %define %$strucname %1 -[absolute 0] +[absolute %2] %$strucname: ; allow definition of `.member' to work sanely %endmacro %imacro endstruc 0.nolist -%{$strucname}_size: +%{$strucname}_size EQU $ - %$strucname %pop __SECT__ %endmacro From d19cbdababcf128b993aa0f4a12a64b9cefb784f Mon Sep 17 00:00:00 2001 From: Simon Brenner Date: Sun, 2 Oct 2011 05:57:35 +0200 Subject: [PATCH 432/585] Add testcase for struc with base offset --- modules/parsers/nasm/tests/Makefile.inc | 2 ++ modules/parsers/nasm/tests/strucbase.asm | 11 +++++++++++ modules/parsers/nasm/tests/strucbase.hex | 4 ++++ 3 files changed, 17 insertions(+) create mode 100644 modules/parsers/nasm/tests/strucbase.asm create mode 100644 modules/parsers/nasm/tests/strucbase.hex diff --git a/modules/parsers/nasm/tests/Makefile.inc b/modules/parsers/nasm/tests/Makefile.inc index e8293d2a..56d0b926 100644 --- a/modules/parsers/nasm/tests/Makefile.inc +++ b/modules/parsers/nasm/tests/Makefile.inc @@ -39,6 +39,8 @@ EXTRA_DIST += modules/parsers/nasm/tests/strucalign.asm EXTRA_DIST += modules/parsers/nasm/tests/strucalign.hex EXTRA_DIST += modules/parsers/nasm/tests/struczero.asm EXTRA_DIST += modules/parsers/nasm/tests/struczero.hex +EXTRA_DIST += modules/parsers/nasm/tests/strucbase.asm +EXTRA_DIST += modules/parsers/nasm/tests/strucbase.hex EXTRA_DIST += modules/parsers/nasm/tests/syntax-err.asm EXTRA_DIST += modules/parsers/nasm/tests/syntax-err.errwarn EXTRA_DIST += modules/parsers/nasm/tests/uscore.asm diff --git a/modules/parsers/nasm/tests/strucbase.asm b/modules/parsers/nasm/tests/strucbase.asm new file mode 100644 index 00000000..81e2fc03 --- /dev/null +++ b/modules/parsers/nasm/tests/strucbase.asm @@ -0,0 +1,11 @@ +struc base, -7 +.a: resb 1 +.b: resb 1 +endstruc + +; Expect base and base.a to appear at -7, base.b at -6 +db base +db base.a +db base.b +; The size should be '2' here +db base_size diff --git a/modules/parsers/nasm/tests/strucbase.hex b/modules/parsers/nasm/tests/strucbase.hex new file mode 100644 index 00000000..5d48c5ea --- /dev/null +++ b/modules/parsers/nasm/tests/strucbase.hex @@ -0,0 +1,4 @@ +f9 +f9 +fa +02 From 2bd66514b6b100887c19d8598da38347b3cff40e Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 2 Oct 2011 23:20:38 -0700 Subject: [PATCH 433/585] re2c: Use tmpfile instead of fixed temporary filename. This could cause a race condition when running parallel make. Tracked down by Volker Braun. [#238 state:resolved] [#165 state:resolved] --- tools/re2c/code.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/re2c/code.c b/tools/re2c/code.c index a3341cb4..8a78eaa0 100644 --- a/tools/re2c/code.c +++ b/tools/re2c/code.c @@ -844,14 +844,13 @@ void DFA_emit(DFA *d, FILE *o){ nOrgOline = oline; maxFillIndexes = vFillIndexes; orgVFillIndexes = vFillIndexes; - tmpo = fopen("re2c.tmp", "wt"); + tmpo = tmpfile(); for(s = d->head; s; s = s->next){ int readCh = 0; State_emit(s, tmpo, &readCh); Go_genGoto(&s->go, tmpo, s, s->next, &readCh); } fclose(tmpo); - remove("re2c.tmp"); maxFillIndexes = vFillIndexes; vFillIndexes = orgVFillIndexes; oline = nOrgOline; From b334347286cc1cd088d79ff7c81ceca0a4ad923c Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 30 Oct 2011 22:21:57 -0700 Subject: [PATCH 434/585] win64: Default to nobase for .xdata section. Also add ..imagebase special symbol to force use of a nobase relocation. [#135 state:resolved] --- modules/objfmts/coff/coff-objfmt.c | 31 +- modules/objfmts/win64/tests/Makefile.inc | 2 + .../objfmts/win64/tests/win64-imagebase.asm | 17 + .../objfmts/win64/tests/win64-imagebase.hex | 512 ++++++++++++++++++ 4 files changed, 557 insertions(+), 5 deletions(-) create mode 100644 modules/objfmts/win64/tests/win64-imagebase.asm create mode 100644 modules/objfmts/win64/tests/win64-imagebase.hex diff --git a/modules/objfmts/coff/coff-objfmt.c b/modules/objfmts/coff/coff-objfmt.c index 4278fa6d..c9646c62 100644 --- a/modules/objfmts/coff/coff-objfmt.c +++ b/modules/objfmts/coff/coff-objfmt.c @@ -189,6 +189,8 @@ typedef struct yasm_objfmt_coff { unsigned long proc_frame; /* Line number of start of proc, or 0 */ unsigned long done_prolog; /* Line number of end of prologue, or 0 */ /*@null@*/ coff_unwind_info *unwind; /* Unwind info */ + + yasm_symrec *ssym_imagebase; /* ..imagebase symbol for win64 */ } yasm_objfmt_coff; typedef struct coff_objfmt_output_info { @@ -296,6 +298,7 @@ coff_common_create(yasm_object *object) objfmt_coff->proc_frame = 0; objfmt_coff->done_prolog = 0; objfmt_coff->unwind = NULL; + objfmt_coff->ssym_imagebase = NULL; return objfmt_coff; } @@ -382,6 +385,8 @@ win64_objfmt_create(yasm_object *object) objfmt_coff->objfmt.module = &yasm_win64_LTX_objfmt; objfmt_coff->win32 = 1; objfmt_coff->win64 = 1; + objfmt_coff->ssym_imagebase = + yasm_symtab_define_label(object->symtab, "..imagebase", NULL, 0, 0); } return (yasm_objfmt *)objfmt_coff; } @@ -489,14 +494,18 @@ coff_objfmt_output_value(yasm_value *value, unsigned char *buf, /*@dependent@*/ /*@null@*/ yasm_symrec *sym = value->rel; unsigned long addr; coff_reloc *reloc; + int nobase = info->csd->flags2 & COFF_FLAG_NOBASE; /* Sometimes we want the relocation to be generated against one * symbol but the value generated correspond to a different symbol. * This is done through (sym being referenced) WRT (sym used for * reloc). Note both syms need to be in the same section! */ - if (value->wrt) { + if (value->wrt && value->wrt == objfmt_coff->ssym_imagebase) + nobase = 1; + else if (value->wrt) { /*@dependent@*/ /*@null@*/ yasm_bytecode *rel_precbc, *wrt_precbc; + if (!yasm_symrec_get_label(sym, &rel_precbc) || !yasm_symrec_get_label(value->wrt, &wrt_precbc)) { yasm_error_set(YASM_ERROR_TOO_COMPLEX, @@ -644,13 +653,13 @@ coff_objfmt_output_value(yasm_value *value, unsigned char *buf, yasm_internal_error(N_("coff objfmt: unrecognized machine")); } else { if (objfmt_coff->machine == COFF_MACHINE_I386) { - if (info->csd->flags2 & COFF_FLAG_NOBASE) + if (nobase) reloc->type = COFF_RELOC_I386_ADDR32NB; else reloc->type = COFF_RELOC_I386_ADDR32; } else if (objfmt_coff->machine == COFF_MACHINE_AMD64) { if (valsize == 32) { - if (info->csd->flags2 & COFF_FLAG_NOBASE) + if (nobase) reloc->type = COFF_RELOC_AMD64_ADDR32NB; else reloc->type = COFF_RELOC_AMD64_ADDR32; @@ -1514,6 +1523,7 @@ coff_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, } else if (objfmt_coff->win64 && strcmp(sectname, ".xdata") == 0) { data.flags = COFF_STYP_DATA | COFF_STYP_READ; align = 8; + data.flags2 = COFF_FLAG_NOBASE; } else if (objfmt_coff->win32 && strcmp(sectname, ".sxdata") == 0) { data.flags = COFF_STYP_INFO; } else if (strcmp(sectname, ".comment") == 0) { @@ -1596,6 +1606,17 @@ coff_objfmt_get_special_sym(yasm_object *object, const char *name, return NULL; } +static /*@observer@*/ /*@null@*/ yasm_symrec * +win64_objfmt_get_special_sym(yasm_object *object, const char *name, + const char *parser) +{ + if (yasm__strcasecmp(name, "imagebase") == 0) { + yasm_objfmt_coff *objfmt_coff = (yasm_objfmt_coff *)object->objfmt; + return objfmt_coff->ssym_imagebase; + } + return NULL; +} + static void coff_section_data_destroy(void *data) { @@ -2465,7 +2486,7 @@ yasm_objfmt_module yasm_win64_LTX_objfmt = { coff_objfmt_add_default_section, coff_objfmt_init_new_section, coff_objfmt_section_switch, - coff_objfmt_get_special_sym + win64_objfmt_get_special_sym }; yasm_objfmt_module yasm_x64_LTX_objfmt = { "Win64", @@ -2483,5 +2504,5 @@ yasm_objfmt_module yasm_x64_LTX_objfmt = { coff_objfmt_add_default_section, coff_objfmt_init_new_section, coff_objfmt_section_switch, - coff_objfmt_get_special_sym + win64_objfmt_get_special_sym }; diff --git a/modules/objfmts/win64/tests/Makefile.inc b/modules/objfmts/win64/tests/Makefile.inc index d1096268..24584267 100644 --- a/modules/objfmts/win64/tests/Makefile.inc +++ b/modules/objfmts/win64/tests/Makefile.inc @@ -27,6 +27,8 @@ EXTRA_DIST += modules/objfmts/win64/tests/win64-dataref.masm EXTRA_DIST += modules/objfmts/win64/tests/win64-dataref2.asm EXTRA_DIST += modules/objfmts/win64/tests/win64-dataref2.hex EXTRA_DIST += modules/objfmts/win64/tests/win64-dataref2.masm +EXTRA_DIST += modules/objfmts/win64/tests/win64-imagebase.hex +EXTRA_DIST += modules/objfmts/win64/tests/win64-imagebase.asm EXTRA_DIST += modules/objfmts/win64/tests/gas/Makefile.inc diff --git a/modules/objfmts/win64/tests/win64-imagebase.asm b/modules/objfmts/win64/tests/win64-imagebase.asm new file mode 100644 index 00000000..bd636026 --- /dev/null +++ b/modules/objfmts/win64/tests/win64-imagebase.asm @@ -0,0 +1,17 @@ +[section .text] +handler: ret +func: ret +func_end: + +[section .pdata] + dd func + dd func_end + dd myunwnd + +[section .xdata] +myunwnd: + db 9,0,0,0 + dd handler + +[section .foo] + dd handler wrt ..imagebase diff --git a/modules/objfmts/win64/tests/win64-imagebase.hex b/modules/objfmts/win64/tests/win64-imagebase.hex new file mode 100644 index 00000000..b715eb43 --- /dev/null +++ b/modules/objfmts/win64/tests/win64-imagebase.hex @@ -0,0 +1,512 @@ +64 +86 +04 +00 +00 +00 +00 +00 +00 +01 +00 +00 +0e +00 +00 +00 +00 +00 +04 +00 +2e +74 +65 +78 +74 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +b4 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +20 +00 +50 +60 +2e +70 +64 +61 +74 +61 +00 +00 +02 +00 +00 +00 +00 +00 +00 +00 +0c +00 +00 +00 +b6 +00 +00 +00 +c2 +00 +00 +00 +00 +00 +00 +00 +03 +00 +00 +00 +40 +00 +30 +40 +2e +78 +64 +61 +74 +61 +00 +00 +0e +00 +00 +00 +00 +00 +00 +00 +08 +00 +00 +00 +e0 +00 +00 +00 +e8 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +40 +00 +40 +40 +2e +66 +6f +6f +00 +00 +00 +00 +16 +00 +00 +00 +00 +00 +00 +00 +04 +00 +00 +00 +f2 +00 +00 +00 +f6 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +20 +00 +00 +60 +c3 +c3 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +05 +00 +00 +00 +03 +00 +04 +00 +00 +00 +06 +00 +00 +00 +03 +00 +08 +00 +00 +00 +09 +00 +00 +00 +03 +00 +09 +00 +00 +00 +00 +00 +00 +00 +04 +00 +00 +00 +04 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +00 +00 +03 +00 +2e +66 +69 +6c +65 +00 +00 +00 +00 +00 +00 +00 +fe +ff +00 +00 +67 +01 +2d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +2e +74 +65 +78 +74 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +03 +01 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +68 +61 +6e +64 +6c +65 +72 +00 +00 +00 +00 +00 +01 +00 +00 +00 +03 +00 +66 +75 +6e +63 +00 +00 +00 +00 +01 +00 +00 +00 +01 +00 +00 +00 +03 +00 +66 +75 +6e +63 +5f +65 +6e +64 +02 +00 +00 +00 +01 +00 +00 +00 +03 +00 +2e +70 +64 +61 +74 +61 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +03 +01 +0c +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +6d +79 +75 +6e +77 +6e +64 +00 +00 +00 +00 +00 +03 +00 +00 +00 +03 +00 +2e +78 +64 +61 +74 +61 +00 +00 +00 +00 +00 +00 +03 +00 +00 +00 +03 +01 +08 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +2e +66 +6f +6f +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +00 +00 +03 +01 +04 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +00 +00 From ab19547382660d81e0b4a0232dccb38f44c52a36 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 30 Oct 2011 23:50:31 -0700 Subject: [PATCH 435/585] re2c: Work around tmpfile() issue on win32. tmpfile() defaults to C:\, and on Windows 7 can run into permissions issues. Add workaround implementation from cairo (http://cgit.freedesktop.org/cairo/commit/?id=4fa46e3caaffb54f4419887418d8d0ea39816092) See also: http://msdn.microsoft.com/en-us/library/x8x7sakw(v=VS.80).aspx (community content section) --- tools/re2c/code.c | 59 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/tools/re2c/code.c b/tools/re2c/code.c index 8a78eaa0..bd54baac 100644 --- a/tools/re2c/code.c +++ b/tools/re2c/code.c @@ -1,3 +1,7 @@ +#ifdef _WIN32 +#include +#include +#endif #include #include #include @@ -6,6 +10,57 @@ #include "tools/re2c/dfa.h" #include "tools/re2c/parse.h" +#ifdef _WIN32 +/* tmpfile() replacment for Windows. + * + * On Windows tmpfile() creates the file in the root directory. This + * may fail due to unsufficient privileges. + */ +static FILE * +win32_tmpfile (void) +{ + DWORD path_len; + WCHAR path_name[MAX_PATH + 1]; + WCHAR file_name[MAX_PATH + 1]; + HANDLE handle; + int fd; + FILE *fp; + + path_len = GetTempPathW (MAX_PATH, path_name); + if (path_len <= 0 || path_len >= MAX_PATH) + return NULL; + + if (GetTempFileNameW (path_name, L"ps_", 0, file_name) == 0) + return NULL; + + handle = CreateFileW (file_name, + GENERIC_READ | GENERIC_WRITE, + 0, + NULL, + CREATE_ALWAYS, + FILE_ATTRIBUTE_NORMAL | FILE_FLAG_DELETE_ON_CLOSE, + NULL); + if (handle == INVALID_HANDLE_VALUE) { + DeleteFileW (file_name); + return NULL; + } + + fd = _open_osfhandle((intptr_t) handle, 0); + if (fd < 0) { + CloseHandle (handle); + return NULL; + } + + fp = fdopen(fd, "w+b"); + if (fp == NULL) { + _close(fd); + return NULL; + } + + return fp; +} +#endif + static void useLabel(size_t value) { while (value >= vUsedLabelAlloc) { vUsedLabels = realloc(vUsedLabels, vUsedLabelAlloc * 2); @@ -844,7 +899,11 @@ void DFA_emit(DFA *d, FILE *o){ nOrgOline = oline; maxFillIndexes = vFillIndexes; orgVFillIndexes = vFillIndexes; +#ifdef _WIN32 + tmpo = win32_tmpfile(); +#else tmpo = tmpfile(); +#endif for(s = d->head; s; s = s->next){ int readCh = 0; State_emit(s, tmpo, &readCh); From c0f152742fde936a1edd6958569df0ade68192a5 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Mon, 31 Oct 2011 00:10:39 -0700 Subject: [PATCH 436/585] Copy YASM-VERSION.h to Mkfiles for distribution. --- Makefile.am | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 35559cb9..55c0c883 100644 --- a/Makefile.am +++ b/Makefile.am @@ -125,8 +125,11 @@ EXTRA_DIST += Mkfiles/vc10/re2c/run.bat # Until this gets fixed in automake DISTCLEANFILES += libyasm/stamp-h libyasm/stamp-h[0-9]* -dist-hook: YASM-VERSION-FILE +dist-hook: YASM-VERSION-FILE YASM-VERSION.h cp YASM-VERSION-FILE $(distdir)/version + cp YASM-VERSION.h $(distdir)/Mkfiles/dj/ + cp YASM-VERSION.h $(distdir)/Mkfiles/vc9/ + cp YASM-VERSION.h $(distdir)/Mkfiles/vc10/ YASM-VERSION-FILE: $(top_srcdir)/YASM-VERSION-GEN.sh $(top_srcdir)/YASM-VERSION-GEN.sh From e437ef429275706322f71362651376ba6998e4a6 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Mon, 31 Oct 2011 00:11:49 -0700 Subject: [PATCH 437/585] Add Mkfiles/vc10/out_copy_rename.bat to distribution. --- Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.am b/Makefile.am index 55c0c883..9efb16fc 100644 --- a/Makefile.am +++ b/Makefile.am @@ -90,6 +90,7 @@ EXTRA_DIST += Mkfiles/vc10/config.h EXTRA_DIST += Mkfiles/vc10/crt_secure_no_deprecate.props EXTRA_DIST += Mkfiles/vc10/crt_secure_no_deprecate.vsprops EXTRA_DIST += Mkfiles/vc10/libyasm-stdint.h +EXTRA_DIST += Mkfiles/vc10/out_copy_rename.bat EXTRA_DIST += Mkfiles/vc10/readme.vc10.txt EXTRA_DIST += Mkfiles/vc10/vsyasm.props EXTRA_DIST += Mkfiles/vc10/vsyasm.targets From 0f5e8ebdb5a273d8fd61e00e90d0c9778b7814cf Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 30 Oct 2011 22:39:50 -0700 Subject: [PATCH 438/585] Bump DEF_VER to 1.2.0 for release. --- YASM-VERSION-GEN.sh | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/YASM-VERSION-GEN.sh b/YASM-VERSION-GEN.sh index 00c0136f..3a9f7436 100755 --- a/YASM-VERSION-GEN.sh +++ b/YASM-VERSION-GEN.sh @@ -1,7 +1,7 @@ #!/bin/sh YVF=YASM-VERSION-FILE -DEF_VER=v1.1.0 +DEF_VER=v1.2.0 LF=' ' @@ -15,16 +15,6 @@ elif test -d .git -o -f .git && VN=$(git describe --match "v[0-9]*" --abbrev=4 HEAD 2>/dev/null) && case "$VN" in *$LF*) (exit 1) ;; - v0.1.0*) - # Special handling until we get a more recent tag on the - # master branch - MERGE_BASE=$(git merge-base $DEF_VER HEAD 2>/dev/null) - VN1=$(git rev-list $MERGE_BASE..HEAD | wc -l 2>/dev/null) - VN2=$(git rev-list --max-count=1 --abbrev-commit --abbrev=4 HEAD 2>/dev/null) - VN=$(echo "v$DEF_VER-$VN1-g$VN2" | sed -e 's/ //g') - git update-index -q --refresh - test -z "$(git diff-index --name-only HEAD --)" || - VN="$VN-dirty" ;; v[0-9]*) git update-index -q --refresh test -z "$(git diff-index --name-only HEAD --)" || From d0084dc8525bdd2f241d6478a46014b418e41128 Mon Sep 17 00:00:00 2001 From: BrianGladman Date: Mon, 31 Oct 2011 17:27:56 +0000 Subject: [PATCH 439/585] add path for YASM-VERSION.h --- Mkfiles/vc10/genversion/genversion.vcxproj | 239 +++++++++++---------- 1 file changed, 121 insertions(+), 118 deletions(-) diff --git a/Mkfiles/vc10/genversion/genversion.vcxproj b/Mkfiles/vc10/genversion/genversion.vcxproj index 1bfd9e7a..e8d7c2eb 100644 --- a/Mkfiles/vc10/genversion/genversion.vcxproj +++ b/Mkfiles/vc10/genversion/genversion.vcxproj @@ -1,119 +1,122 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2} - genversion - Win32Proj - - - - Application - MultiByte - - - Application - MultiByte - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - - - - Disabled - ..\..\vc10;../../..;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - Level3 - ProgramDatabase - Default - - - $(OutDir)genversion.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX86 - - - run.bat "$(TargetPath)" - - - runpre.bat - - - - - Full - ..\..\vc10;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreaded - - - $(IntDir) - Level3 - Default - - - $(OutDir)genversion.exe - $(OutDir)$(TargetName).pdb - Console - true - true - false - - - MachineX86 - - - run.bat "$(TargetPath)" - - - - - - - - - - - - - - + + + + + Debug + Win32 + + + Release + Win32 + + + + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2} + genversion + Win32Proj + + + + Application + MultiByte + + + Application + MultiByte + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + + + + Disabled + ..\..\vc10;..\..\..\;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genversion.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + ..\..\..\YASM-VERSION-GEN.bat + + + + + Full + ..\..\vc10;..\..\..\;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + Default + + + $(OutDir)genversion.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + ..\..\..\YASM-VERSION-GEN.bat + + + + + + + + + + + + + + \ No newline at end of file From 827922d98d2f76347c8d884ec66276ad0e2b35e5 Mon Sep 17 00:00:00 2001 From: BrianGladman Date: Mon, 31 Oct 2011 18:38:16 +0000 Subject: [PATCH 440/585] Add prebuild step for yasm-verssion.h --- Mkfiles/vc10/genversion/genversion.vcxproj | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Mkfiles/vc10/genversion/genversion.vcxproj b/Mkfiles/vc10/genversion/genversion.vcxproj index e8d7c2eb..24526587 100644 --- a/Mkfiles/vc10/genversion/genversion.vcxproj +++ b/Mkfiles/vc10/genversion/genversion.vcxproj @@ -74,7 +74,9 @@ run.bat "$(TargetPath)" - ..\..\..\YASM-VERSION-GEN.bat + cd ..\..\..\ +YASM-VERSION-GEN.bat + @@ -104,7 +106,9 @@ run.bat "$(TargetPath)" - ..\..\..\YASM-VERSION-GEN.bat + cd ..\..\..\ +YASM-VERSION-GEN.bat + From 5f01ee0f94329014c498a665f51d2da37bbdac46 Mon Sep 17 00:00:00 2001 From: Ami Fischman Date: Fri, 2 Mar 2012 14:12:19 -0800 Subject: [PATCH 441/585] Drop success-path chatter from genperf. --- tools/genperf/perfect.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/tools/genperf/perfect.c b/tools/genperf/perfect.c index af6b4612..7cd68678 100644 --- a/tools/genperf/perfect.c +++ b/tools/genperf/perfect.c @@ -671,8 +671,6 @@ static void hash_ab( sprintf(final->line[0], " unsigned long rsl = (a ^ scramble[tab[b]]);\n"); } - printf("success, found a perfect hash\n"); - free((void *)tabq); free((void *)tabh); } @@ -901,8 +899,6 @@ void findhash( continue; /* two keys have same (a,b) pair */ } - printf("found distinct (A,B) on attempt %ld\n", trysalt); - /* Given distinct (A,B) for all keys, build a perfect hash */ if (!perfect(*tabb, *tabh, tabq, *blen, *smax, scramble, nkeys, form)) { @@ -932,8 +928,6 @@ void findhash( break; } - printf("built perfect hash table of size %ld\n", *blen); - /* free working memory */ free((void *)tabq); } @@ -1143,7 +1137,6 @@ hashform *form; /* user directives */ /* read in the list of keywords */ getkeys(&keys, &nkeys, textroot, keyroot, form); - printf("Read in %ld keys\n",nkeys); /* find the hash */ findhash(&tab, &alen, &blen, &salt, &final, @@ -1151,13 +1144,11 @@ hashform *form; /* user directives */ /* generate the phash.c file */ make_c(tab, smax, blen, scramble, &final, form); - printf("Wrote phash.c\n"); /* clean up memory sources */ refree(textroot); refree(keyroot); free((void *)tab); - printf("Cleaned up\n"); } From a8495ad151b6db29f633d8e005e9049c7949cd05 Mon Sep 17 00:00:00 2001 From: Jason Garrett-Glaser Date: Thu, 2 Feb 2012 14:32:06 -0800 Subject: [PATCH 442/585] Add AMD TBM instructions. Reference: http://support.amd.com/us/Processor_TechDocs/24594_APM_v3.pdf Also add appropriate CPU bits and directive handling for these. --- modules/arch/x86/gen_x86_insn.py | 55 ++++++++++++++++++++++++++++++-- modules/arch/x86/x86arch.h | 1 + modules/arch/x86/x86cpu.gperf | 2 ++ modules/arch/x86/x86id.c | 5 +-- 4 files changed, 58 insertions(+), 5 deletions(-) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index 4de9d6cd..f3ced2a9 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -39,7 +39,7 @@ ordered_cpu_features = [ "SSE3", "SVM", "PadLock", "SSSE3", "SSE41", "SSE42", "SSE4a", "SSE5", "AVX", "FMA", "AES", "CLMUL", "MOVBE", "XOP", "FMA4", "F16C", "FSGSBASE", "RDRAND", "XSAVEOPT", "EPTVPID", "SMX", "AVX2", "BMI1", - "BMI2", "INVPCID", "LZCNT"] + "BMI2", "INVPCID", "LZCNT", "TBM"] unordered_cpu_features = ["Priv", "Prot", "Undoc", "Obs"] # Predefined VEX prefix field values @@ -7961,8 +7961,6 @@ for sfx, sz in zip("lq", [32, 64]): # no 16-bit forms add_insn("bzhi", "vex_gpr_reg_rm_nds_0F", modifiers=[0x00, 0x38, 0xF5], cpu=["BMI2"]) -add_insn("bextr","vex_gpr_reg_rm_nds_0F", modifiers=[0x00, 0x38, 0xF7], - cpu=["BMI1"]) add_insn("shlx", "vex_gpr_reg_rm_nds_0F", modifiers=[0x66, 0x38, 0xF7], cpu=["BMI2"]) add_insn("shrx", "vex_gpr_reg_rm_nds_0F", modifiers=[0xF2, 0x38, 0xF7], @@ -7973,7 +7971,31 @@ add_insn("sarx", "vex_gpr_reg_rm_nds_0F", modifiers=[0xF3, 0x38, 0xF7], add_insn("mulx", "vex_gpr_reg_nds_rm_0F", modifiers=[0xF2, 0x38, 0xF6], cpu=["BMI2"]) +for sfx, sz in zip("lq", [32, 64]): # no 16-bit forms + add_group("bextr", + cpu=["BMI1"], + suffix=sfx, + opersize=sz, + prefix=0x00, + opcode=[0x0F, 0x38, 0xF7], + vex=0, + operands=[Operand(type="Reg", size=sz, dest="Spare"), + Operand(type="RM", size=sz, relaxed=True, dest="EA"), + Operand(type="Reg", size=sz, dest="VEX")]) + add_group("bextr", # TBM alternate form of bextr + cpu=["TBM"], + suffix=sfx, + opersize=sz, + prefix=0x00, + opcode=[0x0A, 0x10], + xop=128, + xopw=(sz==64), + onlyavx=True, + operands=[Operand(type="Reg", size=sz, dest="Spare"), + Operand(type="RM", size=sz, relaxed=True, dest="EA"), + Operand(type="Imm", size=32, relaxed=True, dest="Imm")]) +add_insn("bextr", "bextr") ##################################################################### # Intel INVPCID instruction @@ -7995,6 +8017,33 @@ add_group("invpcid", Operand(type="Mem", size=128, relaxed=True, dest="EA")]) add_insn("invpcid", "invpcid") +##################################################################### +# AMD trailing bit manipulation (TBM) +##################################################################### + +for sfx, sz in zip("lq", [32, 64]): # no 16-bit forms + add_group("xop_gpr_reg_rm_09", + cpu=["TBM"], + suffix=sfx, + modifiers=["Op1Add","SpAdd"], + opersize=sz, + prefix=0x00, + opcode=[0x09, 0x00], + xop=128, + xopw=(sz==64), + operands=[Operand(type="Reg", size=sz, dest="VEX"), + Operand(type="RM", size=sz, relaxed=True, dest="EA")]) + +add_insn("blcfill", "xop_gpr_reg_rm_09", modifiers=[0x01, 1]) +add_insn("blci", "xop_gpr_reg_rm_09", modifiers=[0x02, 6]) +add_insn("blcic", "xop_gpr_reg_rm_09", modifiers=[0x01, 5]) +add_insn("blcmsk", "xop_gpr_reg_rm_09", modifiers=[0x02, 1]) +add_insn("blcs", "xop_gpr_reg_rm_09", modifiers=[0x01, 3]) +add_insn("blsfill", "xop_gpr_reg_rm_09", modifiers=[0x01, 2]) +add_insn("blsic", "xop_gpr_reg_rm_09", modifiers=[0x01, 6]) +add_insn("t1mskc", "xop_gpr_reg_rm_09", modifiers=[0x01, 7]) +add_insn("tzmsk", "xop_gpr_reg_rm_09", modifiers=[0x01, 4]) + ##################################################################### # AMD 3DNow! instructions ##################################################################### diff --git a/modules/arch/x86/x86arch.h b/modules/arch/x86/x86arch.h index 0c387f70..13f6c0e8 100644 --- a/modules/arch/x86/x86arch.h +++ b/modules/arch/x86/x86arch.h @@ -83,6 +83,7 @@ #define CPU_BMI2 49 /* Intel BMI2 instructions */ #define CPU_INVPCID 50 /* Intel INVPCID instruction */ #define CPU_LZCNT 51 /* Intel LZCNT instruction */ +#define CPU_TBM 52 /* AMD TBM instruction */ enum x86_parser_type { X86_PARSER_NASM = 0, diff --git a/modules/arch/x86/x86cpu.gperf b/modules/arch/x86/x86cpu.gperf index 669a588b..cbdcf58a 100644 --- a/modules/arch/x86/x86cpu.gperf +++ b/modules/arch/x86/x86cpu.gperf @@ -398,6 +398,8 @@ invpcid, x86_cpu_set, CPU_INVPCID noinvpcid, x86_cpu_clear, CPU_INVPCID lzcnt, x86_cpu_set, CPU_LZCNT nolzcnt, x86_cpu_clear, CPU_LZCNT +tbm, x86_cpu_set, CPU_TBM +notbm, x86_cpu_clear, CPU_TBM # Change NOP patterns basicnop, x86_nop, X86_NOP_BASIC intelnop, x86_nop, X86_NOP_INTEL diff --git a/modules/arch/x86/x86id.c b/modules/arch/x86/x86id.c index 3f645b8e..dc70026d 100644 --- a/modules/arch/x86/x86id.c +++ b/modules/arch/x86/x86id.c @@ -1603,8 +1603,9 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) * Leave R=X=B=1 for now. */ if (insn->opcode.opcode[0] != 0x08 && - insn->opcode.opcode[0] != 0x09) - yasm_internal_error(N_("first opcode byte of XOP must be 0x08 or 0x09")); + insn->opcode.opcode[0] != 0x09 && + insn->opcode.opcode[0] != 0x0A) + yasm_internal_error(N_("first opcode byte of XOP must be 0x08, 0x09, or 0x0A")); vex1 |= insn->opcode.opcode[0]; /* Move opcode byte back one byte to make room for XOP prefix. */ insn->opcode.opcode[2] = insn->opcode.opcode[1]; From 916ff048f79114536e1b81d8b9ab61b92ada0709 Mon Sep 17 00:00:00 2001 From: sergey semenko Date: Mon, 27 Feb 2012 12:07:03 +0200 Subject: [PATCH 443/585] Added support for HSW TSX instructions: XAXQUIRE XRELEASE XABORT XBEGIN XEND XTEST Also fixed a bug for CALL instruction (opcode 0xE8) - it allowed 16 bit operand with 0x66 prefix in 64 bit mode, while 16 bit operand is not allowed at all in 64 bit mode. Added X86_ACQREL prefix group for XACQUIRE/XRELEASE prefixes, since they need to be orthogonal to LOCKREP prefixes, because TSX prefixes must come together with F0 (LOCK) prefix. However this commit does not enforce using TSX hints only with instructions they are allowed to be used. The reason for this is that lock prefix F0 itself is not enforced to be used only with lockable instructions, this seems to be a decision made by Yasm developers, that user himself must take care of these situations. Right now TSX hints can come with F0 prefix, can come with REPNE/REPZE prefixes, but they are used together in assembly, only the leftmost would be encoded to the binary and warning will be issued. This is the behavior of Yasm for duplicate LOCKREP prefixes. --- modules/arch/x86/gen_x86_insn.py | 43 ++++++++++++++++++++++++++++++-- modules/arch/x86/x86arch.h | 6 ++++- modules/arch/x86/x86bc.c | 28 ++++++++++++++++++++- modules/arch/x86/x86cpu.gperf | 2 ++ modules/arch/x86/x86id.c | 1 + 5 files changed, 76 insertions(+), 4 deletions(-) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index f3ced2a9..6b7a333c 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -39,7 +39,7 @@ ordered_cpu_features = [ "SSE3", "SVM", "PadLock", "SSSE3", "SSE41", "SSE42", "SSE4a", "SSE5", "AVX", "FMA", "AES", "CLMUL", "MOVBE", "XOP", "FMA4", "F16C", "FSGSBASE", "RDRAND", "XSAVEOPT", "EPTVPID", "SMX", "AVX2", "BMI1", - "BMI2", "INVPCID", "LZCNT", "TBM"] + "BMI2", "INVPCID", "LZCNT", "TBM", "TSX"] unordered_cpu_features = ["Priv", "Prot", "Undoc", "Obs"] # Predefined VEX prefix field values @@ -2264,7 +2264,7 @@ add_group("call", add_group("call", opersize=16, - def_opersize_64=64, + not64=True, #there should not be 16bit call in 64bit mode opcode=[0xE8], operands=[Operand(type="Imm", size=16, tmod="Near", dest="JmpRel")]) add_group("call", @@ -7115,6 +7115,45 @@ add_group("gather_32x_32y_128", add_insn("vgatherqps", "gather_32x_32y_128", modifiers=[0x93]) add_insn("vpgatherqd", "gather_32x_32y_128", modifiers=[0x91]) +##################################################################### +# Intel TSX instructions +##################################################################### +add_prefix("xacquire", "ACQREL", 0xF2) +add_prefix("xrelease", "ACQREL", 0xF3) + +add_group("tsx_xabort", + cpu=["TSX"], + opcode=[0xC6, 0xF8], + operands=[Operand(type="Imm", size=8, relaxed=True, dest="Imm")]) +add_insn("xabort", "tsx_xabort") + + + +add_group("tsx_xbegin", + cpu=["TSX"], + opcode=[0xC7, 0xF8], + operands=[Operand(type="Imm", size=32, tmod="Near", dest="JmpRel")]) + +add_group("tsx_xbegin", + cpu=["TSX"], + opersize=16, + not64=True, #there should not be 16bit xbegin in 64bit mode + opcode=[0xC7, 0xF8], + operands=[Operand(type="Imm", size=16, tmod="Near", dest="JmpRel")]) +add_insn("xbegin", "tsx_xbegin") + +add_group("tsx_0x0F_0x01", + cpu=["TSX"], + modifiers=["Op2Add"], + opcode=[0x0F, 0x01, 0x00], + operands=[]) +add_insn("xend", "tsx_0x0F_0x01", modifiers=[0xD5]) +add_insn("xtest", "tsx_0x0F_0x01", modifiers=[0xD6]) + + + + + ##################################################################### # Intel FMA instructions ##################################################################### diff --git a/modules/arch/x86/x86arch.h b/modules/arch/x86/x86arch.h index 13f6c0e8..5c3a6cf5 100644 --- a/modules/arch/x86/x86arch.h +++ b/modules/arch/x86/x86arch.h @@ -84,6 +84,7 @@ #define CPU_INVPCID 50 /* Intel INVPCID instruction */ #define CPU_LZCNT 51 /* Intel LZCNT instruction */ #define CPU_TBM 52 /* AMD TBM instruction */ +#define CPU_TSX 53 /* Intel TSX instructions */ enum x86_parser_type { X86_PARSER_NASM = 0, @@ -140,7 +141,8 @@ typedef enum { X86_ADDRSIZE = 2<<8, X86_OPERSIZE = 3<<8, X86_SEGREG = 4<<8, - X86_REX = 5<<8 + X86_REX = 5<<8, + X86_ACQREL = 6<<8 /*TSX hint prefixes*/ } x86_parse_insn_prefix; typedef enum { @@ -220,6 +222,8 @@ typedef struct x86_common { unsigned char addrsize; /* 0 or =mode_bits => no override */ unsigned char opersize; /* 0 or =mode_bits => no override */ unsigned char lockrep_pre; /* 0 indicates no prefix */ + unsigned char acqrel_pre; /* 0 indicates no prefix. We need this because + xqcuire/xrelease might require F0 prefix */ unsigned char mode_bits; } x86_common; diff --git a/modules/arch/x86/x86bc.c b/modules/arch/x86/x86bc.c index 1670df78..a6681552 100644 --- a/modules/arch/x86/x86bc.c +++ b/modules/arch/x86/x86bc.c @@ -279,6 +279,24 @@ yasm_x86__bc_apply_prefixes(x86_common *common, unsigned char *rex, for (i=0; iacqrel_pre != 0) + yasm_warn_set(YASM_WARN_GENERAL, + N_("multiple XACQUIRE/XRELEASE prefixes, " + "using leftmost")); + common->acqrel_pre = (unsigned char)prefixes[i] & 0xff; + break; case X86_LOCKREP: if (common->lockrep_pre != 0) yasm_warn_set(YASM_WARN_GENERAL, @@ -395,11 +413,13 @@ yasm_x86__ea_print(const yasm_effaddr *ea, FILE *f, int indent_level) static void x86_common_print(const x86_common *common, FILE *f, int indent_level) { - fprintf(f, "%*sAddrSize=%u OperSize=%u LockRepPre=%02x BITS=%u\n", + fprintf(f, "%*sAddrSize=%u OperSize=%u LockRepPre=%02x " + "ACQREL_Pre=%02x BITS=%u\n", indent_level, "", (unsigned int)common->addrsize, (unsigned int)common->opersize, (unsigned int)common->lockrep_pre, + (unsigned int)common->acqrel_pre, (unsigned int)common->mode_bits); } @@ -515,6 +535,9 @@ x86_common_calc_len(const x86_common *common) len++; if (common->lockrep_pre != 0) len++; + if (common->acqrel_pre != 0) + len++; + return len; } @@ -791,6 +814,9 @@ x86_common_tobytes(const x86_common *common, unsigned char **bufp, ((common->mode_bits != 64 && common->opersize != common->mode_bits) || (common->mode_bits == 64 && common->opersize == 16))) YASM_WRITE_8(*bufp, 0x66); + /*TSX hints come before lock prefix*/ + if (common->acqrel_pre != 0) + YASM_WRITE_8(*bufp, common->acqrel_pre); if (common->lockrep_pre != 0) YASM_WRITE_8(*bufp, common->lockrep_pre); } diff --git a/modules/arch/x86/x86cpu.gperf b/modules/arch/x86/x86cpu.gperf index cbdcf58a..3d495746 100644 --- a/modules/arch/x86/x86cpu.gperf +++ b/modules/arch/x86/x86cpu.gperf @@ -390,6 +390,8 @@ smx, x86_cpu_set, CPU_SMX nosmx, x86_cpu_clear, CPU_SMX avx2, x86_cpu_set, CPU_AVX2 noavx2, x86_cpu_clear, CPU_AVX2 +tsx, x86_cpu_set, CPU_TSX +notsx, x86_cpu_clear, CPU_TSX bmi1, x86_cpu_set, CPU_BMI1 nobmi1, x86_cpu_clear, CPU_BMI1 bmi2, x86_cpu_set, CPU_BMI2 diff --git a/modules/arch/x86/x86id.c b/modules/arch/x86/x86id.c index dc70026d..b07c9fc0 100644 --- a/modules/arch/x86/x86id.c +++ b/modules/arch/x86/x86id.c @@ -388,6 +388,7 @@ x86_finalize_common(x86_common *common, const x86_insn_info *info, common->addrsize = 0; common->opersize = info->opersize; common->lockrep_pre = 0; + common->acqrel_pre = 0; common->mode_bits = (unsigned char)mode_bits; } From 01ab853e68ef8aeded716d6f5b34895200f66a51 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Tue, 6 Mar 2012 17:40:41 -0800 Subject: [PATCH 444/585] In the Mach-O writer, only warn on ignored flags if the new flags are different from the old flags. Fixes http://tortall.lighthouseapp.com/projects/78676-yasm/tickets/246 --- modules/objfmts/macho/macho-objfmt.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/objfmts/macho/macho-objfmt.c b/modules/objfmts/macho/macho-objfmt.c index 76b80292..bef564a6 100644 --- a/modules/objfmts/macho/macho-objfmt.c +++ b/modules/objfmts/macho/macho-objfmt.c @@ -1497,9 +1497,13 @@ macho_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, msd->sectname = f_sectname; msd->flags = flags; yasm_section_set_align(retval, align, line); - } else if (flags_override) - yasm_warn_set(YASM_WARN_GENERAL, - N_("section flags ignored on section redeclaration")); + } else if (flags_override) { + // align is the only value used from overrides. + if (yasm_section_get_align(retval) != align) { + yasm_warn_set(YASM_WARN_GENERAL, + N_("section flags ignored on section redeclaration")); + } + } return retval; } From 203bc94f398855e95e6d61ff083635cf325699f0 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Sat, 10 Mar 2012 22:52:34 -0800 Subject: [PATCH 445/585] Don't use a C++ comment in a C source file. --- modules/objfmts/macho/macho-objfmt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/objfmts/macho/macho-objfmt.c b/modules/objfmts/macho/macho-objfmt.c index bef564a6..1b009185 100644 --- a/modules/objfmts/macho/macho-objfmt.c +++ b/modules/objfmts/macho/macho-objfmt.c @@ -1498,7 +1498,7 @@ macho_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, msd->flags = flags; yasm_section_set_align(retval, align, line); } else if (flags_override) { - // align is the only value used from overrides. + /* align is the only value used from overrides. */ if (yasm_section_get_align(retval) != align) { yasm_warn_set(YASM_WARN_GENERAL, N_("section flags ignored on section redeclaration")); From 51b1f7ef98cdcea9cdb9d4cd613fbfae57828d32 Mon Sep 17 00:00:00 2001 From: Scott Graham Date: Wed, 9 May 2012 20:48:16 -0700 Subject: [PATCH 446/585] fix a couple warnings when building on win32 --- modules/arch/x86/x86id.c | 2 +- modules/objfmts/elf/elf.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/arch/x86/x86id.c b/modules/arch/x86/x86id.c index b07c9fc0..6207c206 100644 --- a/modules/arch/x86/x86id.c +++ b/modules/arch/x86/x86id.c @@ -643,7 +643,7 @@ x86_find_match(x86_id_insn *id_insn, yasm_insn_operand **ops, unsigned int misc_flags = info->misc_flags; unsigned int size; int mismatch = 0; - int i; + unsigned int i; /* Match CPU */ if (mode_bits != 64 && (misc_flags & ONLY_64)) diff --git a/modules/objfmts/elf/elf.c b/modules/objfmts/elf/elf.c index b9157812..7adf7ea9 100644 --- a/modules/objfmts/elf/elf.c +++ b/modules/objfmts/elf/elf.c @@ -98,7 +98,7 @@ elf_set_arch(yasm_arch *arch, yasm_symtab *symtab, int bits_pref) elf_march->ssyms[i].name, NULL, 0, 0); yasm_symrec_add_data(elf_ssyms[i], &elf_ssym_symrec_data, - &elf_march->ssyms[i]); + (void*)&elf_march->ssyms[i]); } } From 0e7f34a025dc123482055c21e40655d64c045f18 Mon Sep 17 00:00:00 2001 From: Vivek Thampi Date: Mon, 28 May 2012 23:59:55 -0700 Subject: [PATCH 447/585] Fix minor typo in the definition of pmulhrw This change fixes the definition of "pmulhrw" where it is defined as having the mnemonic "pmulhrwa". --- modules/arch/x86/gen_x86_insn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index 6b7a333c..8f4e659e 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -8120,7 +8120,7 @@ add_insn("pfsub", "now3d", modifiers=[0x9A]) add_insn("pfsubr", "now3d", modifiers=[0xAA]) add_insn("pi2fd", "now3d", modifiers=[0x0D]) add_insn("pi2fw", "now3d", modifiers=[0x0C], cpu=["Athlon", "3DNow"]) -add_insn("pmulhrwa", "now3d", modifiers=[0xB7]) +add_insn("pmulhrw", "now3d", modifiers=[0xB7]) add_insn("pswapd", "now3d", modifiers=[0xBB], cpu=["Athlon", "3DNow"]) ##################################################################### From 90a8e215d62cfb6f71c5daa4ca10447ec5bec496 Mon Sep 17 00:00:00 2001 From: Jannis Harder Date: Thu, 26 Jul 2012 23:43:37 +0200 Subject: [PATCH 448/585] Add vseg section option - Added vseg and ivseg to bin_section_data - Parsing of vseg option as expression - Conversion to integer ivsg - Output of vseg in mapfiles --- modules/objfmts/bin/bin-objfmt.c | 56 ++++++++++++++++++- .../objfmts/bin/tests/multisect/bin-align.map | 4 ++ .../bin/tests/multisect/ldlinux-sects.map | 10 ++++ .../bin/tests/multisect/multisect1.map | 4 ++ .../bin/tests/multisect/multisect2.map | 3 + .../bin/tests/multisect/multisect3.map | 3 + .../bin/tests/multisect/multisect4.map | 6 ++ .../bin/tests/multisect/multisect5.map | 10 ++++ .../bin/tests/multisect/nomultisect1.map | 3 + .../bin/tests/multisect/nomultisect2.map | 3 + 10 files changed, 101 insertions(+), 1 deletion(-) diff --git a/modules/objfmts/bin/bin-objfmt.c b/modules/objfmts/bin/bin-objfmt.c index 5f422245..12c2670d 100644 --- a/modules/objfmts/bin/bin-objfmt.c +++ b/modules/objfmts/bin/bin-objfmt.c @@ -43,12 +43,18 @@ typedef struct bin_section_data { /* User-provided starts */ /*@null@*/ /*@owned@*/ yasm_expr *start, *vstart; + /* User-provided segments */ + /*@null@*/ /*@owned@*/ yasm_expr *vseg; + /* User-provided follows */ /*@null@*/ /*@owned@*/ char *follows, *vfollows; /* Calculated (final) starts, used only during output() */ /*@null@*/ /*@owned@*/ yasm_intnum *istart, *ivstart; + /* Calculated (final) starts, used only during output() */ + /*@null@*/ /*@owned@*/ yasm_intnum *ivseg; + /* Calculated (final) length, used only during output() */ /*@null@*/ /*@owned@*/ yasm_intnum *length; } bin_section_data; @@ -287,6 +293,19 @@ bin_lma_create_group(yasm_section *sect, /*@null@*/ void *d) } else bsd->ivstart = NULL; + /* Calculate section integer vseg. */ + if (bsd->vseg) { + bsd->ivseg = yasm_expr_get_intnum(&bsd->vseg, 0); + if (!bsd->ivseg) { + yasm_error_set(YASM_ERROR_TOO_COMPLEX, + N_("vseg expression is too complex")); + yasm_errwarn_propagate(info->errwarns, bsd->vseg->line); + return 1; + } else + bsd->ivseg = yasm_intnum_copy(bsd->ivseg); + } else + bsd->ivseg = NULL; + /* Calculate section integer length. */ bsd->length = yasm_calc_bc_dist(yasm_section_bcs_first(sect), yasm_section_bcs_last(sect)); @@ -529,6 +548,7 @@ bin_objfmt_expr_xform(/*@returned@*/ /*@only@*/ yasm_expr *e, typedef struct map_output_info { /* address width */ int bytes; + int vseg_present; /* intnum output static data areas */ unsigned char *buf; @@ -557,6 +577,11 @@ map_prescan_bytes(yasm_section *sect, void *d) info->bytes *= 2; while (!yasm_intnum_check_size(bsd->ivstart, info->bytes * 8, 0, 0)) info->bytes *= 2; + if (bsd->ivseg) { + info->vseg_present = 1; + while (!yasm_intnum_check_size(bsd->ivseg, info->bytes * 8, 0, 0)) + info->bytes *= 2; + } return 0; } @@ -589,6 +614,16 @@ map_sections_summary(bin_groups *groups, map_output_info *info) map_print_intnum(info->intn, info); fprintf(info->f, " "); + if (info->vseg_present) { + if (bsd->ivseg == NULL) { + size_t i; + for (i = info->bytes; i != 0; i--) + fprintf(info->f, "--"); + } else + map_print_intnum(bsd->ivseg, info); + fprintf(info->f, " "); + } + map_print_intnum(bsd->istart, info); fprintf(info->f, " "); @@ -634,6 +669,11 @@ map_sections_detail(bin_groups *groups, map_output_info *info) bsd->follows ? bsd->follows : "not defined"); fprintf(info->f, "\nvstart: "); map_print_intnum(bsd->ivstart, info); + fprintf(info->f, "\nvseg: "); + if (bsd->ivseg) + map_print_intnum(bsd->ivseg, info); + else + fprintf(info->f, "not defined"); fprintf(info->f, "\nvalign: "); map_print_intnum(bsd->valign, info); fprintf(info->f, "\nvfollows: %s\n\n", @@ -769,6 +809,7 @@ output_map(bin_objfmt_output_info *info) * fields. Start with a minimum of 4. */ mapinfo.bytes = 4; + mapinfo.vseg_present = 0; while (!yasm_intnum_check_size(info->origin, mapinfo.bytes * 8, 0, 0)) mapinfo.bytes *= 2; yasm_object_sections_traverse(info->object, &mapinfo, map_prescan_bytes); @@ -791,9 +832,11 @@ output_map(bin_objfmt_output_info *info) fprintf(f, "-- Sections (summary) "); for (i=0; i<57; i++) fputc('-', f); - fprintf(f, "\n\n%-*s%-*s%-*s%-*s%-*s%-*s%s\n", + fprintf(f, "\n\n%-*s%-*s%-*s%-*s%-*s%-*s%-*s%s\n", mapinfo.bytes*2+2, "Vstart", mapinfo.bytes*2+2, "Vstop", + mapinfo.vseg_present ? mapinfo.bytes*2+2 : 0, + mapinfo.vseg_present ? "Vseg" : "", mapinfo.bytes*2+2, "Start", mapinfo.bytes*2+2, "Stop", mapinfo.bytes*2+2, "Length", @@ -1401,6 +1444,7 @@ bin_objfmt_init_new_section(yasm_section *sect, unsigned long line) data->valign = NULL; data->start = NULL; data->vstart = NULL; + data->vseg = NULL; data->follows = NULL; data->vfollows = NULL; data->istart = NULL; @@ -1455,6 +1499,7 @@ bin_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, /*@only@*/ /*@null@*/ char *vfollows; /*@only@*/ /*@null@*/ yasm_expr *start; /*@only@*/ /*@null@*/ yasm_expr *vstart; + /*@only@*/ /*@null@*/ yasm_expr *vseg; /*@only@*/ /*@null@*/ yasm_intnum *align; /*@only@*/ /*@null@*/ yasm_intnum *valign; unsigned long bss; @@ -1470,6 +1515,8 @@ bin_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, offsetof(struct bin_section_switch_data, start), 0 }, { "vstart", 1, yasm_dir_helper_expr, offsetof(struct bin_section_switch_data, vstart), 0 }, + { "vseg", 1, yasm_dir_helper_expr, + offsetof(struct bin_section_switch_data, vseg), 0 }, { "align", 1, yasm_dir_helper_intn, offsetof(struct bin_section_switch_data, align), 0 }, { "valign", 1, yasm_dir_helper_intn, @@ -1503,6 +1550,7 @@ bin_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, data.vfollows = bsd->vfollows; data.start = bsd->start; data.vstart = bsd->vstart; + data.vseg = bsd->vseg; data.align = NULL; data.valign = NULL; data.bss = bsd->bss; @@ -1512,6 +1560,7 @@ bin_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, data.vfollows = NULL; data.start = NULL; data.vstart = NULL; + data.vseg = NULL; data.align = NULL; data.valign = NULL; data.bss = strcmp(sectname, ".bss") == 0; @@ -1576,6 +1625,7 @@ bin_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, bsd->valign = data.valign; bsd->start = data.start; bsd->vstart = data.vstart; + bsd->vseg = data.vseg; bsd->follows = data.follows; bsd->vfollows = data.vfollows; @@ -1684,6 +1734,8 @@ bin_section_data_destroy(void *data) yasm_expr_destroy(bsd->start); if (bsd->vstart) yasm_expr_destroy(bsd->vstart); + if (bsd->vseg) + yasm_expr_destroy(bsd->vseg); if (bsd->follows) yasm_xfree(bsd->follows); if (bsd->vfollows) @@ -1719,6 +1771,8 @@ bin_section_data_print(void *data, FILE *f, int indent_level) yasm_expr_print(bsd->start, f); fprintf(f, "\n%*svstart=", indent_level, ""); yasm_expr_print(bsd->vstart, f); + fprintf(f, "\n%*svseg=", indent_level, ""); + yasm_expr_print(bsd->vseg, f); fprintf(f, "\n%*sfollows=", indent_level, ""); if (bsd->follows) diff --git a/modules/objfmts/bin/tests/multisect/bin-align.map b/modules/objfmts/bin/tests/multisect/bin-align.map index 3031bd15..7ea54184 100644 --- a/modules/objfmts/bin/tests/multisect/bin-align.map +++ b/modules/objfmts/bin/tests/multisect/bin-align.map @@ -26,6 +26,7 @@ start: 00000000 align: 00000008 follows: not defined vstart: 00000000 +vseg: not defined valign: 00000008 vfollows: not defined @@ -37,6 +38,7 @@ start: 00000010 align: 00000008 follows: not defined vstart: 00000010 +vseg: not defined valign: 00000008 vfollows: not defined @@ -48,6 +50,7 @@ start: 00000014 align: 00000004 follows: not defined vstart: 00000014 +vseg: not defined valign: 00000004 vfollows: not defined @@ -59,6 +62,7 @@ start: 00000018 align: 00000008 follows: not defined vstart: 00000018 +vseg: not defined valign: 00000004 vfollows: not defined diff --git a/modules/objfmts/bin/tests/multisect/ldlinux-sects.map b/modules/objfmts/bin/tests/multisect/ldlinux-sects.map index 03fde845..6a7b6a92 100644 --- a/modules/objfmts/bin/tests/multisect/ldlinux-sects.map +++ b/modules/objfmts/bin/tests/multisect/ldlinux-sects.map @@ -32,6 +32,7 @@ start: 00000800 align: 00000004 follows: not defined vstart: 00000800 +vseg: not defined valign: 00000004 vfollows: not defined @@ -43,6 +44,7 @@ start: 00006C00 align: 00000010 follows: not defined vstart: 00006C00 +vseg: not defined valign: 00000010 vfollows: not defined @@ -54,6 +56,7 @@ start: 00007C00 align: 00000004 follows: not defined vstart: 00007C00 +vseg: not defined valign: 00000004 vfollows: not defined @@ -65,6 +68,7 @@ start: 0000A010 align: 00000010 follows: not defined vstart: 0000A010 +vseg: not defined valign: 00000010 vfollows: not defined @@ -76,6 +80,7 @@ start: 0000A5A0 align: 00000004 follows: .data vstart: 000048D0 +vseg: not defined valign: 00000010 vfollows: .earlybss @@ -87,6 +92,7 @@ start: 0000A840 align: 00000004 follows: .bcopy32 vstart: 00004B70 +vseg: not defined valign: 00000010 vfollows: .bcopy32 @@ -98,6 +104,7 @@ start: 0000A863 align: 00000001 follows: .config vstart: 0000A863 +vseg: not defined valign: 00000001 vfollows: not defined @@ -109,6 +116,7 @@ start: 0000A870 align: 00000010 follows: .adv vstart: 0000A870 +vseg: not defined valign: 00000010 vfollows: not defined @@ -120,6 +128,7 @@ start: 0000E170 align: 00000004 follows: not defined vstart: 00004B94 +vseg: not defined valign: 00000004 vfollows: .config @@ -131,6 +140,7 @@ start: 0000E170 align: 00000004 follows: not defined vstart: 00004BA0 +vseg: not defined valign: 00000010 vfollows: .config.end diff --git a/modules/objfmts/bin/tests/multisect/multisect1.map b/modules/objfmts/bin/tests/multisect/multisect1.map index 0a56e413..a039ea35 100644 --- a/modules/objfmts/bin/tests/multisect/multisect1.map +++ b/modules/objfmts/bin/tests/multisect/multisect1.map @@ -26,6 +26,7 @@ start: 00000000 align: 00000004 follows: not defined vstart: 00000000 +vseg: not defined valign: 00000004 vfollows: not defined @@ -37,6 +38,7 @@ start: 00000000 align: 00000004 follows: not defined vstart: 00000100 +vseg: not defined valign: 00000004 vfollows: not defined @@ -48,6 +50,7 @@ start: 00000010 align: 00000001 follows: _TEXT vstart: 00000000 +vseg: not defined valign: 00000001 vfollows: not defined @@ -59,6 +62,7 @@ start: 00000020 align: 00000010 follows: GATESEG vstart: 00000020 +vseg: not defined valign: 00000010 vfollows: not defined diff --git a/modules/objfmts/bin/tests/multisect/multisect2.map b/modules/objfmts/bin/tests/multisect/multisect2.map index 82002edb..f10bf198 100644 --- a/modules/objfmts/bin/tests/multisect/multisect2.map +++ b/modules/objfmts/bin/tests/multisect/multisect2.map @@ -25,6 +25,7 @@ start: 00000100 align: 00000004 follows: not defined vstart: 00000100 +vseg: not defined valign: 00000004 vfollows: not defined @@ -36,6 +37,7 @@ start: 00000130 align: 00000004 follows: not defined vstart: 00000130 +vseg: not defined valign: 00000004 vfollows: not defined @@ -47,6 +49,7 @@ start: 00000144 align: 00000004 follows: not defined vstart: 00000144 +vseg: not defined valign: 00000004 vfollows: not defined diff --git a/modules/objfmts/bin/tests/multisect/multisect3.map b/modules/objfmts/bin/tests/multisect/multisect3.map index 1c67c227..49f4c665 100644 --- a/modules/objfmts/bin/tests/multisect/multisect3.map +++ b/modules/objfmts/bin/tests/multisect/multisect3.map @@ -25,6 +25,7 @@ start: 00000000 align: 00000004 follows: not defined vstart: 00000000 +vseg: not defined valign: 00000004 vfollows: not defined @@ -36,6 +37,7 @@ start: 00000004 align: 00000004 follows: .text vstart: 00000004 +vseg: not defined valign: 00000004 vfollows: not defined @@ -47,6 +49,7 @@ start: 00000008 align: 00000004 follows: not defined vstart: 00000008 +vseg: not defined valign: 00000004 vfollows: not defined diff --git a/modules/objfmts/bin/tests/multisect/multisect4.map b/modules/objfmts/bin/tests/multisect/multisect4.map index e1940dc6..c31fdf10 100644 --- a/modules/objfmts/bin/tests/multisect/multisect4.map +++ b/modules/objfmts/bin/tests/multisect/multisect4.map @@ -28,6 +28,7 @@ start: 00000800 align: 00000004 follows: not defined vstart: 00000800 +vseg: not defined valign: 00000004 vfollows: not defined @@ -39,6 +40,7 @@ start: 00009000 align: 00000004 follows: not defined vstart: 00009000 +vseg: not defined valign: 00000004 vfollows: not defined @@ -50,6 +52,7 @@ start: 00009100 align: 00000010 follows: .text vstart: 00009100 +vseg: not defined valign: 00000010 vfollows: not defined @@ -61,6 +64,7 @@ start: 00009200 align: 00000010 follows: .data vstart: 00000900 +vseg: not defined valign: 00000010 vfollows: .earlybss @@ -72,6 +76,7 @@ start: 00009300 align: 00000010 follows: .bcopy32 vstart: 00009300 +vseg: not defined valign: 00000010 vfollows: not defined @@ -83,6 +88,7 @@ start: 00009400 align: 00000100 follows: not defined vstart: 00000A00 +vseg: not defined valign: 00000100 vfollows: .bcopy32 diff --git a/modules/objfmts/bin/tests/multisect/multisect5.map b/modules/objfmts/bin/tests/multisect/multisect5.map index 4c052be6..86676436 100644 --- a/modules/objfmts/bin/tests/multisect/multisect5.map +++ b/modules/objfmts/bin/tests/multisect/multisect5.map @@ -32,6 +32,7 @@ start: 00000100 align: 00000004 follows: not defined vstart: 00000100 +vseg: not defined valign: 00000004 vfollows: not defined @@ -43,6 +44,7 @@ start: 00000100 align: 00000004 follows: not defined vstart: 00002000 +vseg: not defined valign: 00000004 vfollows: not defined @@ -54,6 +56,7 @@ start: 00000200 align: 00000004 follows: sect1 vstart: 00000200 +vseg: not defined valign: 00000004 vfollows: not defined @@ -65,6 +68,7 @@ start: 00000300 align: 00000004 follows: not defined vstart: 00004000 +vseg: not defined valign: 00000004 vfollows: not defined @@ -76,6 +80,7 @@ start: 00000400 align: 00000004 follows: sect3 vstart: 00000400 +vseg: not defined valign: 00000004 vfollows: not defined @@ -87,6 +92,7 @@ start: 00000500 align: 00000004 follows: not defined vstart: 00004100 +vseg: not defined valign: 00000004 vfollows: sect3 @@ -98,6 +104,7 @@ start: 00000600 align: 00000004 follows: not defined vstart: 00006000 +vseg: not defined valign: 00000004 vfollows: not defined @@ -109,6 +116,7 @@ start: 00000614 align: 00000004 follows: sect6 vstart: 00000620 +vseg: not defined valign: 00000010 vfollows: not defined @@ -120,6 +128,7 @@ start: 00000718 align: 00000004 follows: sect7 vstart: 00000730 +vseg: not defined valign: 00000010 vfollows: not defined @@ -131,6 +140,7 @@ start: 00000818 align: 00000004 follows: not defined vstart: 00000830 +vseg: not defined valign: 00000004 vfollows: sect8 diff --git a/modules/objfmts/bin/tests/multisect/nomultisect1.map b/modules/objfmts/bin/tests/multisect/nomultisect1.map index 89974207..fe5981fc 100644 --- a/modules/objfmts/bin/tests/multisect/nomultisect1.map +++ b/modules/objfmts/bin/tests/multisect/nomultisect1.map @@ -25,6 +25,7 @@ start: 00000000 align: 00000004 follows: not defined vstart: 00000000 +vseg: not defined valign: 00000004 vfollows: not defined @@ -36,6 +37,7 @@ start: 00000100 align: 00000004 follows: not defined vstart: 00000100 +vseg: not defined valign: 00000004 vfollows: not defined @@ -47,6 +49,7 @@ start: 00000200 align: 00000004 follows: not defined vstart: 00000200 +vseg: not defined valign: 00000004 vfollows: not defined diff --git a/modules/objfmts/bin/tests/multisect/nomultisect2.map b/modules/objfmts/bin/tests/multisect/nomultisect2.map index cc6d9c87..f87f4090 100644 --- a/modules/objfmts/bin/tests/multisect/nomultisect2.map +++ b/modules/objfmts/bin/tests/multisect/nomultisect2.map @@ -25,6 +25,7 @@ start: 00000100 align: 00000004 follows: not defined vstart: 00000100 +vseg: not defined valign: 00000004 vfollows: not defined @@ -36,6 +37,7 @@ start: 00000200 align: 00000004 follows: not defined vstart: 00000200 +vseg: not defined valign: 00000004 vfollows: not defined @@ -47,6 +49,7 @@ start: 00000300 align: 00000004 follows: not defined vstart: 00000300 +vseg: not defined valign: 00000004 vfollows: not defined From 662fa69efcd60312b16fe84759877b789260bbaa Mon Sep 17 00:00:00 2001 From: Jannis Harder Date: Fri, 27 Jul 2012 03:18:21 +0200 Subject: [PATCH 449/585] New wrt optimization and improved seg optimization - Improve seg optimization to handle deep segoffs - Add wrt optimization that handles deep segoffs --- libyasm/expr.c | 73 +++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 63 insertions(+), 10 deletions(-) diff --git a/libyasm/expr.c b/libyasm/expr.c index c2c868ed..fa817ebd 100644 --- a/libyasm/expr.c +++ b/libyasm/expr.c @@ -846,6 +846,68 @@ expr_expand_equ(yasm_expr *e, yasm__exprhead *eh) return e; } +static yasm_expr * +expr_simplify_seg(yasm_expr *e) +{ + yasm_expr *sube, *seg; + + if (e->op != YASM_EXPR_SEG && e->op != YASM_EXPR_WRT) + return e; + if (e->terms[0].type != YASM_EXPR_EXPR) + return e; + sube = e->terms[0].data.expn; + + seg = yasm_expr_extract_deep_segoff(&sube); + if (!seg) + return e; + + if (e->op == YASM_EXPR_SEG) { + e->op = YASM_EXPR_IDENT; + yasm_expr_destroy(sube); + e->terms[0].data.expn = seg; + } else if (e->op == YASM_EXPR_WRT) { + yasm_expr *old_base, *new_base; + yasm_expr *wrt, *off; + unsigned long line = e->line; + + off = e; + wrt = yasm_expr_extract_wrt(&off); + + assert(wrt != NULL); + + old_base = yasm_xmalloc(sizeof(yasm_expr)); + old_base->op = YASM_EXPR_MUL; + old_base->line = line; + old_base->numterms = 2; + old_base->terms[0].type = YASM_EXPR_INT; + old_base->terms[0].data.intn = yasm_intnum_create_int(16); + old_base->terms[1].type = YASM_EXPR_EXPR; + old_base->terms[1].data.expn = seg; + + new_base = yasm_xmalloc(sizeof(yasm_expr)); + new_base->op = YASM_EXPR_MUL; + new_base->line = line; + new_base->numterms = 2; + new_base->terms[0].type = YASM_EXPR_INT; + new_base->terms[0].data.intn = yasm_intnum_create_int(-16); + new_base->terms[1].type = YASM_EXPR_EXPR; + new_base->terms[1].data.expn = wrt; + + e = yasm_xmalloc(sizeof(yasm_expr)+sizeof(yasm_expr__item)); + e->op = YASM_EXPR_ADD; + e->line = line; + e->numterms = 3; + e->terms[0].type = YASM_EXPR_EXPR; + e->terms[0].data.expn = off; + e->terms[1].type = YASM_EXPR_EXPR; + e->terms[1].data.expn = old_base; + e->terms[2].type = YASM_EXPR_EXPR; + e->terms[2].data.expn = new_base; + } + + return e; +} + static yasm_expr * expr_level_tree(yasm_expr *e, int fold_const, int simplify_ident, int simplify_reg_mul, int calc_bc_dist, @@ -855,6 +917,7 @@ expr_level_tree(yasm_expr *e, int fold_const, int simplify_ident, int i; e = expr_xform_neg(e); + e = expr_simplify_seg(e); /* traverse terms */ for (i=0; inumterms; i++) { @@ -866,16 +929,6 @@ expr_level_tree(yasm_expr *e, int fold_const, int simplify_ident, expr_xform_extra, expr_xform_extra_data); } - /* Check for SEG of SEG:OFF, if we match, simplify to just the segment */ - if (e->op == YASM_EXPR_SEG && e->terms[0].type == YASM_EXPR_EXPR && - e->terms[0].data.expn->op == YASM_EXPR_SEGOFF) { - e->op = YASM_EXPR_IDENT; - e->terms[0].data.expn->op = YASM_EXPR_IDENT; - /* Destroy the second (offset) term */ - e->terms[0].data.expn->numterms = 1; - expr_delete_term(&e->terms[0].data.expn->terms[1], 1); - } - /* do callback */ e = expr_level_op(e, fold_const, simplify_ident, simplify_reg_mul); if (calc_bc_dist || expr_xform_extra) { From 8da658af79b51133699effefcc848fdb0e366fc2 Mon Sep 17 00:00:00 2001 From: Jannis Harder Date: Fri, 27 Jul 2012 17:57:23 +0200 Subject: [PATCH 450/585] Overrides and dummy value finalization for bin - Added support for overriding certain functions - Override value_finalize with dummy function for the bin objfmt --- libyasm/section.c | 7 +++++++ libyasm/section.h | 10 ++++++++++ libyasm/value.c | 11 +++++++++++ modules/objfmts/bin/bin-objfmt.c | 10 ++++++++++ 4 files changed, 38 insertions(+) diff --git a/libyasm/section.c b/libyasm/section.c index 9242fb01..7198beb7 100644 --- a/libyasm/section.c +++ b/libyasm/section.c @@ -241,6 +241,11 @@ yasm_object_create(const char *src_filename, const char *obj_filename, /* Initialize things to NULL in case of error */ object->dbgfmt = NULL; + /* Initialize override structure */ + object->overrides = yasm_xmalloc(sizeof(yasm_overrides)); + + object->overrides->value_finalize = NULL; + /* Initialize the object format */ object->objfmt = yasm_objfmt_create(objfmt_module, object); if (!object->objfmt) { @@ -485,6 +490,8 @@ yasm_object_destroy(yasm_object *object) if (object->arch) yasm_arch_destroy(object->arch); + yasm_xfree(object->overrides); + yasm_xfree(object); } diff --git a/libyasm/section.h b/libyasm/section.h index 2c7faa4d..5bdd4419 100644 --- a/libyasm/section.h +++ b/libyasm/section.h @@ -45,6 +45,15 @@ struct yasm_reloc { /*@dependent@*/ yasm_symrec *sym; /**< Relocated symbol */ }; +/** Structure of functions that can be overridden + */ +typedef struct yasm_overrides { + /** TODO: documentation + */ + int + (*value_finalize)(yasm_value *value, yasm_bytecode *precbc); +} yasm_overrides; + /** An object. This is the internal representation of an object file. */ struct yasm_object { /*@owned@*/ char *src_filename; /**< Source filename */ @@ -54,6 +63,7 @@ struct yasm_object { /*@owned@*/ yasm_arch *arch; /**< Target architecture */ /*@owned@*/ yasm_objfmt *objfmt; /**< Object format */ /*@owned@*/ yasm_dbgfmt *dbgfmt; /**< Debug format */ + /*@owned@*/ yasm_overrides *overrides; /**< Function overrides */ /** Currently active section. Used by some directives. NULL if no * section active. diff --git a/libyasm/value.c b/libyasm/value.c index 3ab73c1c..47873cf7 100644 --- a/libyasm/value.c +++ b/libyasm/value.c @@ -459,9 +459,20 @@ yasm_value_finalize_expr(yasm_value *value, yasm_expr *e, int yasm_value_finalize(yasm_value *value, yasm_bytecode *precbc) { + yasm_object *object = NULL; if (!value->abs) return 0; + if (precbc != NULL) + object = yasm_section_get_object(precbc->section); + + if (object && object->overrides->value_finalize) { + int result; + result = object->overrides->value_finalize(value, precbc); + if (result != -1) + return result; + } + value->abs = yasm_expr__level_tree(value->abs, 1, 1, 0, 0, NULL, NULL); /* quit early if there was an issue in simplify() */ diff --git a/modules/objfmts/bin/bin-objfmt.c b/modules/objfmts/bin/bin-objfmt.c index 12c2670d..215f494e 100644 --- a/modules/objfmts/bin/bin-objfmt.c +++ b/modules/objfmts/bin/bin-objfmt.c @@ -104,6 +104,7 @@ static const yasm_assoc_data_callback bin_symrec_data_cb = { yasm_objfmt_module yasm_bin_LTX_objfmt; +static int bin_objfmt_value_finalize(yasm_value *value, yasm_bytecode *precbc); static yasm_objfmt * bin_objfmt_create(yasm_object *object) @@ -115,6 +116,8 @@ bin_objfmt_create(yasm_object *object) objfmt_bin->map_filename = NULL; objfmt_bin->org = NULL; + object->overrides->value_finalize = bin_objfmt_value_finalize; + return (yasm_objfmt *)objfmt_bin; } @@ -935,6 +938,13 @@ check_lma_overlap(yasm_section *sect, /*@null@*/ void *d) return 0; } +static int +bin_objfmt_value_finalize(yasm_value *value, yasm_bytecode *precbc) +{ + /* TODO do some finalization to avoid breaking stuff that depends on it */ + return 0; +} + static int bin_objfmt_output_value(yasm_value *value, unsigned char *buf, unsigned int destsize, From d36aecd48c10d17c89ffefb6aa22c5cdfa0cd13e Mon Sep 17 00:00:00 2001 From: Jannis Harder Date: Wed, 1 Aug 2012 15:30:50 +0200 Subject: [PATCH 451/585] squashme --- modules/objfmts/bin/bin-objfmt.c | 80 +++++++++++++++++++++++++++++++- 1 file changed, 79 insertions(+), 1 deletion(-) diff --git a/modules/objfmts/bin/bin-objfmt.c b/modules/objfmts/bin/bin-objfmt.c index 215f494e..7748f1e4 100644 --- a/modules/objfmts/bin/bin-objfmt.c +++ b/modules/objfmts/bin/bin-objfmt.c @@ -941,7 +941,85 @@ check_lma_overlap(yasm_section *sect, /*@null@*/ void *d) static int bin_objfmt_value_finalize(yasm_value *value, yasm_bytecode *precbc) { - /* TODO do some finalization to avoid breaking stuff that depends on it */ + value->abs = yasm_expr__level_tree(value->abs, 1, 1, 0, 0, NULL, NULL); + + /* quit early if there was an issue in simplify() */ + if (yasm_error_occurred()) + return 1; + + /* Strip top-level AND masking to an all-1s mask the same size + * of the value size. This allows forced avoidance of overflow warnings. + */ + if (value->abs->op == YASM_EXPR_AND) { + int term; + + /* Calculate 1<size); + yasm_intnum_calc(mask, YASM_EXPR_SHL, mask_tmp); + yasm_intnum_set_uint(mask_tmp, 1); + yasm_intnum_calc(mask, YASM_EXPR_SUB, mask_tmp); + yasm_intnum_destroy(mask_tmp); + + /* Walk terms and delete matching masks */ + for (term=value->abs->numterms-1; term>=0; term--) { + if (value->abs->terms[term].type == YASM_EXPR_INT && + yasm_intnum_compare(value->abs->terms[term].data.intn, + mask) == 0) { + /* Delete the intnum */ + yasm_intnum_destroy(value->abs->terms[term].data.intn); + + /* Slide everything to its right over by 1 */ + if (term != value->abs->numterms-1) /* if it wasn't last.. */ + memmove(&value->abs->terms[term], + &value->abs->terms[term+1], + (value->abs->numterms-1-term)* + sizeof(yasm_expr__item)); + + /* Update numterms */ + value->abs->numterms--; + + /* Indicate warnings have been disabled */ + value->no_warn = 1; + } + } + if (value->abs->numterms == 1) + value->abs->op = YASM_EXPR_IDENT; + yasm_intnum_destroy(mask); + } + + /* Handle trivial (IDENT) cases immediately */ + if (value->abs->op == YASM_EXPR_IDENT) { + switch (value->abs->terms[0].type) { + case YASM_EXPR_INT: + if (yasm_intnum_is_zero(value->abs->terms[0].data.intn)) { + yasm_expr_destroy(value->abs); + value->abs = NULL; + } + return 0; + case YASM_EXPR_REG: + case YASM_EXPR_FLOAT: + return 0; + case YASM_EXPR_SYM: + value->rel = value->abs->terms[0].data.sym; + yasm_expr_destroy(value->abs); + value->abs = NULL; + return 0; + case YASM_EXPR_EXPR: + /* Bring up lower values. */ + while (value->abs->op == YASM_EXPR_IDENT + && value->abs->terms[0].type == YASM_EXPR_EXPR) { + yasm_expr *sube = value->abs->terms[0].data.expn; + yasm_xfree(value->abs); + value->abs = sube; + } + break; + default: + return 0; + } + } + + /* TODO do some more finalization to avoid breaking stuff that depends on it */ return 0; } From aaea0fc13842636103f6b7a5143d6b287e23faf9 Mon Sep 17 00:00:00 2001 From: Jannis Harder Date: Fri, 27 Jul 2012 23:19:53 +0200 Subject: [PATCH 452/585] Add segments to label addresses Generate addresses with a segment part for labels inside a section with a defined vseg --- modules/objfmts/bin/bin-objfmt.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/modules/objfmts/bin/bin-objfmt.c b/modules/objfmts/bin/bin-objfmt.c index 7748f1e4..5286c7ee 100644 --- a/modules/objfmts/bin/bin-objfmt.c +++ b/modules/objfmts/bin/bin-objfmt.c @@ -533,8 +533,20 @@ bin_objfmt_expr_xform(/*@returned@*/ /*@only@*/ yasm_expr *e, bsd = yasm_section_get_data(sect, &bin_section_data_cb); assert(bsd != NULL); yasm_intnum_calc(dist, YASM_EXPR_ADD, bsd->ivstart); - e->terms[i].type = YASM_EXPR_INT; - e->terms[i].data.intn = dist; + if (bsd->ivseg != NULL) { + yasm_expr *sube; + yasm_intnum *seg; + + seg = yasm_intnum_copy(bsd->ivseg); + sube = yasm_expr_create(YASM_EXPR_SEGOFF, + yasm_expr_int(seg), + yasm_expr_int(dist), e->line); + e->terms[i].type = YASM_EXPR_EXPR; + e->terms[i].data.expn = sube; + } else { + e->terms[i].type = YASM_EXPR_INT; + e->terms[i].data.intn = dist; + } } /* Transform our special symrecs into the appropriate value */ From 15e9012b77abf696d82d5c57341b43bf5462a0ed Mon Sep 17 00:00:00 2001 From: Jannis Harder Date: Sun, 29 Jul 2012 14:31:37 +0200 Subject: [PATCH 453/585] Generate segmented addresses for labels - Labels defined inside sections with vseg have segment:offset addresses - The section.
.vstart label has a segment:offset address --- modules/objfmts/bin/bin-objfmt.c | 40 +++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/modules/objfmts/bin/bin-objfmt.c b/modules/objfmts/bin/bin-objfmt.c index 5286c7ee..37056097 100644 --- a/modules/objfmts/bin/bin-objfmt.c +++ b/modules/objfmts/bin/bin-objfmt.c @@ -489,11 +489,13 @@ group_assign_vstart_recurse(bin_group *group, yasm_intnum *start, } } -static /*@null@*/ const yasm_intnum * -get_ssym_value(yasm_symrec *sym) +static /*@null@*/ /*@only@*/ yasm_expr * +get_ssym_value(yasm_symrec *sym, unsigned long line) { bin_symrec_data *bsymd = yasm_symrec_get_data(sym, &bin_symrec_data_cb); bin_section_data *bsd; + yasm_intnum *offset; + yasm_expr *expr; if (!bsymd) return NULL; @@ -502,11 +504,22 @@ get_ssym_value(yasm_symrec *sym) assert(bsd != NULL); switch (bsymd->which) { - case SSYM_START: return bsd->istart; - case SSYM_VSTART: return bsd->ivstart; - case SSYM_LENGTH: return bsd->length; + case SSYM_START: offset = bsd->istart; break; + case SSYM_VSTART: offset = bsd->ivstart; break; + case SSYM_LENGTH: offset = bsd->length; break; + default: return NULL; } - return NULL; + + offset = yasm_intnum_copy(offset); + + if (bsymd->which == SSYM_VSTART && bsd->ivseg != NULL) + expr = yasm_expr_create(YASM_EXPR_SEGOFF, + yasm_expr_int(yasm_intnum_copy(bsd->ivseg)), + yasm_expr_int(offset), line); + else + expr = yasm_expr_create_ident(yasm_expr_int(offset), line); + + return expr; } static /*@only@*/ yasm_expr * @@ -518,7 +531,7 @@ bin_objfmt_expr_xform(/*@returned@*/ /*@only@*/ yasm_expr *e, /*@dependent@*/ yasm_section *sect; /*@dependent@*/ /*@null@*/ yasm_bytecode *precbc; /*@null@*/ yasm_intnum *dist; - /*@null@*/ const yasm_intnum *ssymval; + /*@null@*/ /*@only@*/ yasm_expr *ssymval; /* Transform symrecs or precbcs that reference sections into * vstart + intnum(dist). @@ -551,9 +564,9 @@ bin_objfmt_expr_xform(/*@returned@*/ /*@only@*/ yasm_expr *e, /* Transform our special symrecs into the appropriate value */ if (e->terms[i].type == YASM_EXPR_SYM && - (ssymval = get_ssym_value(e->terms[i].data.sym))) { - e->terms[i].type = YASM_EXPR_INT; - e->terms[i].data.intn = yasm_intnum_copy(ssymval); + (ssymval = get_ssym_value(e->terms[i].data.sym, e->line))) { + e->terms[i].type = YASM_EXPR_EXPR; + e->terms[i].data.expn = ssymval; } } @@ -1051,7 +1064,7 @@ bin_objfmt_output_value(yasm_value *value, unsigned char *buf, if (value->rel) { unsigned int rshift = (unsigned int)value->rshift; yasm_expr *syme; - /*@null@*/ const yasm_intnum *ssymval; + /*@null@*/ yasm_expr *ssymval; if (yasm_symrec_is_abs(value->rel)) { syme = yasm_expr_create_ident(yasm_expr_int( @@ -1059,9 +1072,8 @@ bin_objfmt_output_value(yasm_value *value, unsigned char *buf, } else if (yasm_symrec_get_label(value->rel, &precbc) && (sect = yasm_bc_get_section(precbc))) { syme = yasm_expr_create_ident(yasm_expr_sym(value->rel), bc->line); - } else if ((ssymval = get_ssym_value(value->rel))) { - syme = yasm_expr_create_ident(yasm_expr_int( - yasm_intnum_copy(ssymval)), bc->line); + } else if ((ssymval = get_ssym_value(value->rel, bc->line))) { + syme = ssymval; } else goto done; From c02c6c72d0eba5552b8dfe0365934cfbcf4619df Mon Sep 17 00:00:00 2001 From: Jannis Harder Date: Sun, 29 Jul 2012 17:19:46 +0200 Subject: [PATCH 454/585] Interpret vstart as linear address Changed segment:offset calculations so that vstart = 16*segment + offset and vseg = segment instead of vstart = offset. Without this the existing code to infer vstart addresses is not useful. --- modules/objfmts/bin/bin-objfmt.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/modules/objfmts/bin/bin-objfmt.c b/modules/objfmts/bin/bin-objfmt.c index 37056097..69264a90 100644 --- a/modules/objfmts/bin/bin-objfmt.c +++ b/modules/objfmts/bin/bin-objfmt.c @@ -512,11 +512,15 @@ get_ssym_value(yasm_symrec *sym, unsigned long line) offset = yasm_intnum_copy(offset); - if (bsymd->which == SSYM_VSTART && bsd->ivseg != NULL) + if (bsymd->which == SSYM_VSTART && bsd->ivseg != NULL) { + yasm_intnum *tmp = yasm_intnum_create_int(16); + yasm_intnum_calc(tmp, YASM_EXPR_MUL, bsd->ivseg); + yasm_intnum_calc(offset, YASM_EXPR_SUB, tmp); + yasm_intnum_destroy(tmp); expr = yasm_expr_create(YASM_EXPR_SEGOFF, yasm_expr_int(yasm_intnum_copy(bsd->ivseg)), yasm_expr_int(offset), line); - else + } else expr = yasm_expr_create_ident(yasm_expr_int(offset), line); return expr; @@ -550,7 +554,11 @@ bin_objfmt_expr_xform(/*@returned@*/ /*@only@*/ yasm_expr *e, yasm_expr *sube; yasm_intnum *seg; - seg = yasm_intnum_copy(bsd->ivseg); + seg = yasm_intnum_create_int(16); + yasm_intnum_calc(seg, YASM_EXPR_MUL, bsd->ivseg); + yasm_intnum_calc(dist, YASM_EXPR_SUB, seg); + yasm_intnum_set(seg, bsd->ivseg); + sube = yasm_expr_create(YASM_EXPR_SEGOFF, yasm_expr_int(seg), yasm_expr_int(dist), e->line); From 0341b793112d739810c48f5179306547c3424e72 Mon Sep 17 00:00:00 2001 From: Jannis Harder Date: Fri, 3 Aug 2012 17:30:15 +0200 Subject: [PATCH 455/585] Better optimization of expr with segoffs Lift all segoffs to the root of the tree. Combine identical segment values while doing this. --- libyasm/coretype.h | 1 + libyasm/expr.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) diff --git a/libyasm/coretype.h b/libyasm/coretype.h index 624e3c44..c4b82cce 100644 --- a/libyasm/coretype.h +++ b/libyasm/coretype.h @@ -233,6 +233,7 @@ typedef enum yasm_expr_op { YASM_EXPR_NOR, /**< Bitwise NOR. */ YASM_EXPR_SHL, /**< Shift left (logical). */ YASM_EXPR_SHR, /**< Shift right (logical). */ + YASM_EXPR_LOGIC, /**< Start of logic operations (not an op). */ YASM_EXPR_LOR, /**< Logical OR. */ YASM_EXPR_LAND, /**< Logical AND. */ YASM_EXPR_LNOT, /**< Logical negation. */ diff --git a/libyasm/expr.c b/libyasm/expr.c index fa817ebd..1aad79df 100644 --- a/libyasm/expr.c +++ b/libyasm/expr.c @@ -908,6 +908,58 @@ expr_simplify_seg(yasm_expr *e) return e; } +static yasm_expr * +expr_lift_segoff(yasm_expr *e, int calc_bc_dist) +{ + yasm_expr *retval = NULL; + int i; + + if (e->op < YASM_EXPR_LOGIC || e->op == YASM_EXPR_SEGOFF) { + i = e->op == YASM_EXPR_SEGOFF ? 1 : 0; + for (; inumterms; i++) { + if (e->terms[i].type == YASM_EXPR_EXPR && + e->terms[i].data.expn->op == YASM_EXPR_SEGOFF) { + yasm_expr *sub = e->terms[i].data.expn; + e->terms[i] = sub->terms[1]; + retval = sub; + retval->op = YASM_EXPR_SEGOFF; + retval->line = e->line; + retval->numterms = 2; + break; + } + } + } + + if (retval != NULL && e->op == YASM_EXPR_SEGOFF) { + yasm_intnum *diff; + yasm_expr *helper; + e->op = YASM_EXPR_IDENT; + e->numterms = 1; + retval->op = YASM_EXPR_IDENT; + retval->numterms = 1; + helper = yasm_xmalloc(sizeof(yasm_expr)); + helper->op = YASM_EXPR_SUB; + helper->numterms = 2; + helper->terms[0].type = YASM_EXPR_EXPR; + helper->terms[0].data.expn = yasm_expr_copy(e); + helper->terms[1].type = YASM_EXPR_EXPR; + helper->terms[1].data.expn = yasm_expr_copy(retval); + diff = yasm_expr_get_intnum(&helper, calc_bc_dist); + if (diff != NULL && yasm_intnum_is_zero(diff)) { + yasm_expr_destroy(retval); + retval = NULL; + } else { + retval->op = YASM_EXPR_SEGOFF; + retval->numterms = 2; + } + yasm_expr_destroy(helper); + e->op = YASM_EXPR_SEGOFF; + e->numterms = 2; + } + + return retval; +} + static yasm_expr * expr_level_tree(yasm_expr *e, int fold_const, int simplify_ident, int simplify_reg_mul, int calc_bc_dist, @@ -915,6 +967,7 @@ expr_level_tree(yasm_expr *e, int fold_const, int simplify_ident, void *expr_xform_extra_data) { int i; + yasm_expr *seg; e = expr_xform_neg(e); e = expr_simplify_seg(e); @@ -931,6 +984,9 @@ expr_level_tree(yasm_expr *e, int fold_const, int simplify_ident, /* do callback */ e = expr_level_op(e, fold_const, simplify_ident, simplify_reg_mul); + seg = expr_lift_segoff(e, calc_bc_dist); + if (seg) + e = expr_level_op(e, fold_const, simplify_ident, simplify_reg_mul); if (calc_bc_dist || expr_xform_extra) { if (calc_bc_dist) e = expr_xform_bc_dist(e); @@ -939,6 +995,11 @@ expr_level_tree(yasm_expr *e, int fold_const, int simplify_ident, e = expr_level_tree(e, fold_const, simplify_ident, simplify_reg_mul, 0, NULL, NULL); } + if (seg) { + seg->terms[1].type = YASM_EXPR_EXPR; + seg->terms[1].data.expn = e; + e = seg; + } return e; } From 96edd8aa0e86611091aff4d6ec11f35d7f8cc7c1 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 18 Aug 2012 13:55:10 -0700 Subject: [PATCH 456/585] Fix vphaddudq opcode; should be DB rather than D8. --- modules/arch/x86/gen_x86_insn.py | 2 +- modules/arch/x86/tests/xop-all.hex | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index 8f4e659e..7524d78d 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -7677,7 +7677,7 @@ add_insn("vphaddubd", "vphaddsub", modifiers=[0xD2]) add_insn("vphaddubq", "vphaddsub", modifiers=[0xD3]) add_insn("vphadduwd", "vphaddsub", modifiers=[0xD6]) add_insn("vphadduwq", "vphaddsub", modifiers=[0xD7]) -add_insn("vphaddudq", "vphaddsub", modifiers=[0xD8]) +add_insn("vphaddudq", "vphaddsub", modifiers=[0xDB]) add_insn("vphsubbw", "vphaddsub", modifiers=[0xE1]) add_insn("vphsubwd", "vphaddsub", modifiers=[0xE2]) diff --git a/modules/arch/x86/tests/xop-all.hex b/modules/arch/x86/tests/xop-all.hex index 1d03cbe6..ee9fd7fb 100644 --- a/modules/arch/x86/tests/xop-all.hex +++ b/modules/arch/x86/tests/xop-all.hex @@ -500,19 +500,19 @@ d1 8f e9 78 -d8 +db ca 8f e9 78 -d8 +db 0e 00 00 8f e9 78 -d8 +db 0e 00 00 From 85f4120b6aa485a4a611a06adce8835e95bcb163 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 30 Aug 2012 23:34:49 -0700 Subject: [PATCH 457/585] Improve check for Cython version. [#249 state:resolved] --- m4/cython.m4 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/m4/cython.m4 b/m4/cython.m4 index ba6b3cab..e56bfba0 100644 --- a/m4/cython.m4 +++ b/m4/cython.m4 @@ -2,13 +2,14 @@ dnl a macro to check for the installed Cython version; note PYTHON needs to dnl be set before this function is called. dnl CYTHON_CHECK_VERSION([MIN-VERSION], [ACTION-IF-TRUE], [ACTION-IF-FALSE]) AC_DEFUN([CYTHON_CHECK_VERSION], - [prog="import sys + [prog="import re, sys from Cython.Compiler.Version import version def get_int(arg): - try: - return int(arg) - except ValueError: + matched = re.match(r'\d+', arg) + if matched is None: return 0 + else: + return int(matched.group(0)) # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for the hex conversion. ver = map(get_int, version.rstrip('abcdefghijklmnopqrstuvwxyz').split('.')) + [[0, 0, 0]] From 510c8dd7e6b28413350652b4b0284a1ae52ed96f Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 26 Jun 2012 11:34:50 -0700 Subject: [PATCH 458/585] Add support for x32 X32 is a 32-bit psABI for x86-64 with 32-bit pointer size. More info can be found at: https://sites.google.com/site/x32abi/ --- Mkfiles/Makefile.dj | 2 +- Mkfiles/Makefile.flat | 2 +- frontends/yasm/yasm.c | 12 +- modules/arch/x86/x86arch.c | 28 +- modules/arch/x86/x86arch.h | 1 + modules/arch/yasm_arch.xml | 4 +- modules/objfmts/elf/CMakeLists.txt | 2 + modules/objfmts/elf/Makefile.inc | 3 +- modules/objfmts/elf/elf-objfmt.c | 30 +- modules/objfmts/elf/elf-x86-x32.c | 251 ++++ modules/objfmts/elf/elf.c | 10 +- modules/objfmts/elf/tests/Makefile.inc | 4 + modules/objfmts/elf/tests/gasx32/Makefile.inc | 11 + .../objfmts/elf/tests/gasx32/crosssect.asm | 18 + .../objfmts/elf/tests/gasx32/crosssect.hex | 568 ++++++++ .../elf/tests/gasx32/elf_gasx32_curpos.asm | 27 + .../elf/tests/gasx32/elf_gasx32_curpos.hex | 848 ++++++++++++ .../elf/tests/gasx32/elf_gasx32_reloc.asm | 37 + .../elf/tests/gasx32/elf_gasx32_reloc.hex | 1016 ++++++++++++++ .../elf/tests/gasx32/elf_gasx32_ssym.asm | 10 + .../elf/tests/gasx32/elf_gasx32_ssym.hex | 592 +++++++++ .../elf/tests/gasx32/elf_gasx32_test.sh | 3 + modules/objfmts/elf/tests/x32/Makefile.inc | 11 + modules/objfmts/elf/tests/x32/elf-rip.asm | 7 + modules/objfmts/elf/tests/x32/elf-rip.hex | 496 +++++++ modules/objfmts/elf/tests/x32/elf_x32_test.sh | 3 + modules/objfmts/elf/tests/x32/elfsox32.asm | 90 ++ modules/objfmts/elf/tests/x32/elfsox32.hex | 1176 +++++++++++++++++ modules/objfmts/elf/tests/x32/gotpcrel.asm | 6 + modules/objfmts/elf/tests/x32/gotpcrel.hex | 496 +++++++ .../objfmts/elf/tests/x32/multiplefixup.asm | 8 + .../objfmts/elf/tests/x32/multiplefixup.hex | 680 ++++++++++ modules/objfmts/yasm_objfmts.xml | 11 +- 33 files changed, 6440 insertions(+), 23 deletions(-) create mode 100644 modules/objfmts/elf/elf-x86-x32.c create mode 100644 modules/objfmts/elf/tests/gasx32/Makefile.inc create mode 100644 modules/objfmts/elf/tests/gasx32/crosssect.asm create mode 100644 modules/objfmts/elf/tests/gasx32/crosssect.hex create mode 100644 modules/objfmts/elf/tests/gasx32/elf_gasx32_curpos.asm create mode 100644 modules/objfmts/elf/tests/gasx32/elf_gasx32_curpos.hex create mode 100644 modules/objfmts/elf/tests/gasx32/elf_gasx32_reloc.asm create mode 100644 modules/objfmts/elf/tests/gasx32/elf_gasx32_reloc.hex create mode 100644 modules/objfmts/elf/tests/gasx32/elf_gasx32_ssym.asm create mode 100644 modules/objfmts/elf/tests/gasx32/elf_gasx32_ssym.hex create mode 100755 modules/objfmts/elf/tests/gasx32/elf_gasx32_test.sh create mode 100644 modules/objfmts/elf/tests/x32/Makefile.inc create mode 100644 modules/objfmts/elf/tests/x32/elf-rip.asm create mode 100644 modules/objfmts/elf/tests/x32/elf-rip.hex create mode 100755 modules/objfmts/elf/tests/x32/elf_x32_test.sh create mode 100644 modules/objfmts/elf/tests/x32/elfsox32.asm create mode 100644 modules/objfmts/elf/tests/x32/elfsox32.hex create mode 100644 modules/objfmts/elf/tests/x32/gotpcrel.asm create mode 100644 modules/objfmts/elf/tests/x32/gotpcrel.hex create mode 100644 modules/objfmts/elf/tests/x32/multiplefixup.asm create mode 100644 modules/objfmts/elf/tests/x32/multiplefixup.hex diff --git a/Mkfiles/Makefile.dj b/Mkfiles/Makefile.dj index 8881b544..34773036 100644 --- a/Mkfiles/Makefile.dj +++ b/Mkfiles/Makefile.dj @@ -97,7 +97,7 @@ MODULES_OBJFMTS_OBJS= \ YASM_MODULES+=objfmt_dbg YASM_MODULES+=objfmt_bin objfmt_dosexe YASM_MODULES+=objfmt_coff objfmt_win32 objfmt_win64 objfmt_x64 -YASM_MODULES+=objfmt_elf objfmt_elf32 objfmt_elf64 +YASM_MODULES+=objfmt_elf objfmt_elf32 objfmt_elf64 objfmt_elfx32 YASM_MODULES+=objfmt_macho objfmt_macho32 objfmt_macho64 YASM_MODULES+=objfmt_rdf YASM_MODULES+=objfmt_xdf diff --git a/Mkfiles/Makefile.flat b/Mkfiles/Makefile.flat index 011fbe51..e4d5b219 100644 --- a/Mkfiles/Makefile.flat +++ b/Mkfiles/Makefile.flat @@ -100,7 +100,7 @@ MODULES_OBJFMTS_OBJS= \ YASM_MODULES+=objfmt_dbg YASM_MODULES+=objfmt_bin objfmt_dosexe YASM_MODULES+=objfmt_coff objfmt_win32 objfmt_win64 objfmt_x64 -YASM_MODULES+=objfmt_elf objfmt_elf32 objfmt_elf64 +YASM_MODULES+=objfmt_elf objfmt_elf32 objfmt_elf64 objfmt_elfx32 YASM_MODULES+=objfmt_macho objfmt_macho32 objfmt_macho64 YASM_MODULES+=objfmt_rdf YASM_MODULES+=objfmt_xdf diff --git a/frontends/yasm/yasm.c b/frontends/yasm/yasm.c index ddd044bb..f070a168 100644 --- a/frontends/yasm/yasm.c +++ b/frontends/yasm/yasm.c @@ -355,6 +355,7 @@ do_assemble(void) yasm_linemap *linemap; yasm_errwarns *errwarns = yasm_errwarns_create(); int i, matched; + const char *machine; /* Initialize line map */ linemap = yasm_linemap_create(); @@ -391,7 +392,16 @@ do_assemble(void) yasm__xstrdup(cur_arch_module->default_machine_keyword); } - cur_arch = yasm_arch_create(cur_arch_module, machine_name, + /* If we're using amd64 and the default objfmt is elfx32, change the + * machine to "x32". + */ + if (strcmp(machine_name, "amd64") == 0 && + strcmp(cur_objfmt_module->keyword, "elfx32") == 0) + machine = "x32"; + else + machine = machine_name; + + cur_arch = yasm_arch_create(cur_arch_module, machine, cur_parser_module->keyword, &arch_error); if (!cur_arch) { switch (arch_error) { diff --git a/modules/arch/x86/x86arch.c b/modules/arch/x86/x86arch.c index 833e94cd..bac11774 100644 --- a/modules/arch/x86/x86arch.c +++ b/modules/arch/x86/x86arch.c @@ -39,14 +39,20 @@ x86_create(const char *machine, const char *parser, /*@out@*/ yasm_arch_create_error *error) { yasm_arch_x86 *arch_x86; - unsigned int amd64_machine; + unsigned int amd64_machine, address_size; *error = YASM_ARCH_CREATE_OK; - if (yasm__strcasecmp(machine, "x86") == 0) + if (yasm__strcasecmp(machine, "x86") == 0) { amd64_machine = 0; - else if (yasm__strcasecmp(machine, "amd64") == 0) + address_size = 32; + } else if (yasm__strcasecmp(machine, "amd64") == 0) { amd64_machine = 1; + address_size = 64; + } else if (yasm__strcasecmp(machine, "x32") == 0) { + amd64_machine = 1; + address_size = 32; + } else { *error = YASM_ARCH_CREATE_BAD_MACHINE; return NULL; @@ -65,6 +71,7 @@ x86_create(const char *machine, const char *parser, arch_x86->amd64_machine = amd64_machine; arch_x86->mode_bits = 0; + arch_x86->address_size = address_size; arch_x86->force_strict = 0; arch_x86->default_rel = 0; arch_x86->gas_intel_mode = 0; @@ -101,9 +108,12 @@ static const char * x86_get_machine(const yasm_arch *arch) { const yasm_arch_x86 *arch_x86 = (const yasm_arch_x86 *)arch; - if (arch_x86->amd64_machine) - return "amd64"; - else + if (arch_x86->amd64_machine) { + if (arch_x86->address_size == 32) + return "x32"; + else + return "amd64"; + } else return "x86"; } @@ -113,10 +123,7 @@ x86_get_address_size(const yasm_arch *arch) const yasm_arch_x86 *arch_x86 = (const yasm_arch_x86 *)arch; if (arch_x86->mode_bits != 0) return arch_x86->mode_bits; - if (arch_x86->amd64_machine) - return 64; - else - return 32; + return arch_x86->address_size; } static int @@ -583,6 +590,7 @@ x86_segreg_print(yasm_arch *arch, uintptr_t segreg, FILE *f) static const yasm_arch_machine x86_machines[] = { { "IA-32 and derivatives", "x86" }, { "AMD64", "amd64" }, + { "X32", "x32" }, { NULL, NULL } }; diff --git a/modules/arch/x86/x86arch.h b/modules/arch/x86/x86arch.h index 5c3a6cf5..14b2b2e3 100644 --- a/modules/arch/x86/x86arch.h +++ b/modules/arch/x86/x86arch.h @@ -105,6 +105,7 @@ typedef struct yasm_arch_x86 { unsigned int amd64_machine; enum x86_parser_type parser; unsigned int mode_bits; + unsigned int address_size; unsigned int force_strict; unsigned int default_rel; unsigned int gas_intel_mode; diff --git a/modules/arch/yasm_arch.xml b/modules/arch/yasm_arch.xml index a5e53ef6..a35510c0 100644 --- a/modules/arch/yasm_arch.xml +++ b/modules/arch/yasm_arch.xml @@ -132,7 +132,9 @@ assembled will be run in 64-bit mode. To specify an AMD64 object file, use on the Yasm command line, or explicitly target a 64-bit object format such as or . + win64 or . can be used to select 32-bit ELF object format + for AMD64 processors. Register Changes diff --git a/modules/objfmts/elf/CMakeLists.txt b/modules/objfmts/elf/CMakeLists.txt index c06b81d8..444e9a8b 100644 --- a/modules/objfmts/elf/CMakeLists.txt +++ b/modules/objfmts/elf/CMakeLists.txt @@ -3,6 +3,8 @@ YASM_ADD_MODULE(objfmt_elf objfmts/elf/elf-objfmt.c objfmts/elf/elf-x86-x86.c objfmts/elf/elf-x86-amd64.c + objfmts/elf/elf-x86-x32.c ) list(APPEND YASM_MODULES objfmt_elf32) list(APPEND YASM_MODULES objfmt_elf64) +list(APPEND YASM_MODULES objfmt_elfx32) diff --git a/modules/objfmts/elf/Makefile.inc b/modules/objfmts/elf/Makefile.inc index 659f867e..54657657 100644 --- a/modules/objfmts/elf/Makefile.inc +++ b/modules/objfmts/elf/Makefile.inc @@ -4,8 +4,9 @@ libyasm_a_SOURCES += modules/objfmts/elf/elf-objfmt.c libyasm_a_SOURCES += modules/objfmts/elf/elf-machine.h libyasm_a_SOURCES += modules/objfmts/elf/elf-x86-x86.c libyasm_a_SOURCES += modules/objfmts/elf/elf-x86-amd64.c +libyasm_a_SOURCES += modules/objfmts/elf/elf-x86-x32.c -YASM_MODULES += objfmt_elf objfmt_elf32 objfmt_elf64 +YASM_MODULES += objfmt_elf objfmt_elf32 objfmt_elf64 objfmt_elfx32 EXTRA_DIST += modules/objfmts/elf/tests/Makefile.inc diff --git a/modules/objfmts/elf/elf-objfmt.c b/modules/objfmts/elf/elf-objfmt.c index 1cf725f0..0c3a1426 100644 --- a/modules/objfmts/elf/elf-objfmt.c +++ b/modules/objfmts/elf/elf-objfmt.c @@ -80,6 +80,7 @@ typedef struct { yasm_objfmt_module yasm_elf_LTX_objfmt; yasm_objfmt_module yasm_elf32_LTX_objfmt; yasm_objfmt_module yasm_elf64_LTX_objfmt; +yasm_objfmt_module yasm_elfx32_LTX_objfmt; static elf_symtab_entry * @@ -397,7 +398,9 @@ elf_objfmt_create(yasm_object *object) if (objfmt) { objfmt_elf = (yasm_objfmt_elf *)objfmt; /* Figure out which bitness of object format to use */ - if (elf_march->bits == 32) + if (strcmp (elf_march->machine, "x32") == 0) + objfmt_elf->objfmt.module = &yasm_elfx32_LTX_objfmt; + else if (elf_march->bits == 32) objfmt_elf->objfmt.module = &yasm_elf32_LTX_objfmt; else if (elf_march->bits == 64) objfmt_elf->objfmt.module = &yasm_elf64_LTX_objfmt; @@ -417,6 +420,12 @@ elf64_objfmt_create(yasm_object *object) return elf_objfmt_create_common(object, &yasm_elf64_LTX_objfmt, 64, NULL); } +static yasm_objfmt * +elfx32_objfmt_create(yasm_object *object) +{ + return elf_objfmt_create_common(object, &yasm_elfx32_LTX_objfmt, 32, NULL); +} + static long elf_objfmt_output_align(FILE *f, unsigned int align) { @@ -1363,3 +1372,22 @@ yasm_objfmt_module yasm_elf64_LTX_objfmt = { elf_objfmt_section_switch, elf_objfmt_get_special_sym }; + +yasm_objfmt_module yasm_elfx32_LTX_objfmt = { + "ELF (x32)", + "elfx32", + "o", + 64, + 0, + elf_objfmt_dbgfmt_keywords, + "null", + elf_objfmt_directives, + elf_objfmt_stdmacs, + elfx32_objfmt_create, + elf_objfmt_output, + elf_objfmt_destroy, + elf_objfmt_add_default_section, + elf_objfmt_init_new_section, + elf_objfmt_section_switch, + elf_objfmt_get_special_sym +}; diff --git a/modules/objfmts/elf/elf-x86-x32.c b/modules/objfmts/elf/elf-x86-x32.c new file mode 100644 index 00000000..40a25a12 --- /dev/null +++ b/modules/objfmts/elf/elf-x86-x32.c @@ -0,0 +1,251 @@ +/* + * ELF object format helpers - x86:x32 + * + * Copyright (C) 2012 Michael Urman and H.J. Lu + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include + +#include +#define YASM_OBJFMT_ELF_INTERNAL +#include "elf.h" +#include "elf-machine.h" + +static elf_machine_ssym elf_x86_x32_ssyms[] = { + {"plt", ELF_SSYM_SYM_RELATIVE, R_X86_64_PLT32, 32}, + {"gotpcrel", ELF_SSYM_SYM_RELATIVE, R_X86_64_GOTPCREL, 32}, + {"tlsgd", ELF_SSYM_SYM_RELATIVE|ELF_SSYM_THREAD_LOCAL, + R_X86_64_TLSGD, 32}, + {"tlsld", ELF_SSYM_SYM_RELATIVE|ELF_SSYM_THREAD_LOCAL, + R_X86_64_TLSLD, 32}, + {"gottpoff", ELF_SSYM_SYM_RELATIVE|ELF_SSYM_THREAD_LOCAL, + R_X86_64_GOTTPOFF, 32}, + {"tpoff", ELF_SSYM_SYM_RELATIVE|ELF_SSYM_THREAD_LOCAL, + R_X86_64_TPOFF32, 32}, + {"dtpoff", ELF_SSYM_SYM_RELATIVE|ELF_SSYM_THREAD_LOCAL, + R_X86_64_DTPOFF32, 32}, + {"got", ELF_SSYM_SYM_RELATIVE, R_X86_64_GOT32, 32}, + {"tlsdesc", ELF_SSYM_SYM_RELATIVE|ELF_SSYM_THREAD_LOCAL, + R_X86_64_GOTPC32_TLSDESC, 32}, + {"tlscall", ELF_SSYM_SYM_RELATIVE|ELF_SSYM_THREAD_LOCAL, + R_X86_64_TLSDESC_CALL, 32} +}; + +static int +elf_x86_x32_accepts_reloc(size_t val, yasm_symrec *wrt) +{ + if (wrt) { + const elf_machine_ssym *ssym = (elf_machine_ssym *) + yasm_symrec_get_data(wrt, &elf_ssym_symrec_data); + if (!ssym || val != ssym->size) + return 0; + return 1; + } + return (val&(val-1)) ? 0 : ((val & (8|16|32)) != 0); +} + +static void +elf_x86_x32_write_symtab_entry(unsigned char *bufp, + elf_symtab_entry *entry, + yasm_intnum *value_intn, + yasm_intnum *size_intn) +{ + YASM_WRITE_32_L(bufp, entry->name ? entry->name->index : 0); + YASM_WRITE_32I_L(bufp, value_intn); + YASM_WRITE_32I_L(bufp, size_intn); + + YASM_WRITE_8(bufp, ELF32_ST_INFO(entry->bind, entry->type)); + YASM_WRITE_8(bufp, ELF32_ST_OTHER(entry->vis)); + if (entry->sect) { + elf_secthead *shead = + yasm_section_get_data(entry->sect, &elf_section_data); + if (!shead) + yasm_internal_error(N_("symbol references section without data")); + YASM_WRITE_16_L(bufp, shead->index); + } else { + YASM_WRITE_16_L(bufp, entry->index); + } +} + +static void +elf_x86_x32_write_secthead(unsigned char *bufp, elf_secthead *shead) +{ + YASM_WRITE_32_L(bufp, shead->name ? shead->name->index : 0); + YASM_WRITE_32_L(bufp, shead->type); + YASM_WRITE_32_L(bufp, shead->flags); + YASM_WRITE_32_L(bufp, 0); /* vmem address */ + YASM_WRITE_32_L(bufp, shead->offset); + YASM_WRITE_32I_L(bufp, shead->size); + + YASM_WRITE_32_L(bufp, shead->link); + YASM_WRITE_32_L(bufp, shead->info); + + YASM_WRITE_32_L(bufp, shead->align); + YASM_WRITE_32_L(bufp, shead->entsize); +} + +static void +elf_x86_x32_write_secthead_rel(unsigned char *bufp, + elf_secthead *shead, + elf_section_index symtab_idx, + elf_section_index sindex) +{ + yasm_intnum *nreloc; + yasm_intnum *relocsize; + + YASM_WRITE_32_L(bufp, shead->rel_name ? shead->rel_name->index : 0); + YASM_WRITE_32_L(bufp, SHT_RELA); + YASM_WRITE_32_L(bufp, 0); + YASM_WRITE_32_L(bufp, 0); + YASM_WRITE_32_L(bufp, shead->rel_offset); + + nreloc = yasm_intnum_create_uint(shead->nreloc); + relocsize = yasm_intnum_create_uint(RELOC32A_SIZE); + yasm_intnum_calc(relocsize, YASM_EXPR_MUL, nreloc); + YASM_WRITE_32I_L(bufp, relocsize); /* size */ + yasm_intnum_destroy(nreloc); + yasm_intnum_destroy(relocsize); + + YASM_WRITE_32_L(bufp, symtab_idx); /* link: symtab index */ + YASM_WRITE_32_L(bufp, shead->index); /* info: relocated's index */ + YASM_WRITE_32_L(bufp, RELOC32_ALIGN); /* align */ + YASM_WRITE_32_L(bufp, RELOC32A_SIZE); /* entity size */ +} + +static void +elf_x86_x32_handle_reloc_addend(yasm_intnum *intn, + elf_reloc_entry *reloc, + unsigned long offset) +{ + /* .rela: copy value out as addend, replace original with 0 */ + reloc->addend = yasm_intnum_copy(intn); + yasm_intnum_zero(intn); +} + +static unsigned int +elf_x86_x32_map_reloc_info_to_type(elf_reloc_entry *reloc) +{ + if (reloc->wrt) { + const elf_machine_ssym *ssym = (elf_machine_ssym *) + yasm_symrec_get_data(reloc->wrt, &elf_ssym_symrec_data); + if (!ssym || reloc->valsize != ssym->size) + yasm_internal_error(N_("Unsupported WRT")); + + /* Force TLS type; this is required by the linker. */ + if (ssym->sym_rel & ELF_SSYM_THREAD_LOCAL) { + elf_symtab_entry *esym; + + esym = yasm_symrec_get_data(reloc->reloc.sym, &elf_symrec_data); + if (esym) + esym->type = STT_TLS; + } + /* Map PC-relative GOT to appropriate relocation */ + if (reloc->rtype_rel && ssym->reloc == R_X86_64_GOT32) + return (unsigned char) R_X86_64_GOTPCREL; + return (unsigned char) ssym->reloc; + } else if (reloc->is_GOT_sym && reloc->valsize == 32) { + return (unsigned char) R_X86_64_GOTPC32; + } else if (reloc->is_GOT_sym && reloc->valsize == 64) { + yasm_internal_error(N_("Unsupported relocation size")); + } else if (reloc->rtype_rel) { + switch (reloc->valsize) { + case 8: return (unsigned char) R_X86_64_PC8; + case 16: return (unsigned char) R_X86_64_PC16; + case 32: return (unsigned char) R_X86_64_PC32; + default: yasm_internal_error(N_("Unsupported relocation size")); + } + } else { + switch (reloc->valsize) { + case 8: return (unsigned char) R_X86_64_8; + case 16: return (unsigned char) R_X86_64_16; + case 32: return (unsigned char) R_X86_64_32; + case 64: return (unsigned char) R_X86_64_64; + default: yasm_internal_error(N_("Unsupported relocation size")); + } + } + return 0; +} + +static void +elf_x86_x32_write_reloc(unsigned char *bufp, elf_reloc_entry *reloc, + unsigned int r_type, unsigned int r_sym) +{ + YASM_WRITE_32I_L(bufp, reloc->reloc.addr); + YASM_WRITE_32_L(bufp, ELF32_R_INFO((unsigned long)r_sym, (unsigned char)r_type)); + if (reloc->addend) + YASM_WRITE_32I_L(bufp, reloc->addend); + else { + YASM_WRITE_32_L(bufp, 0); + } +} + +static void +elf_x86_x32_write_proghead(unsigned char **bufpp, + elf_offset secthead_addr, + unsigned long secthead_count, + elf_section_index shstrtab_index) +{ + unsigned char *bufp = *bufpp; + unsigned char *buf = bufp-4; + YASM_WRITE_8(bufp, ELFCLASS32); /* elf class */ + YASM_WRITE_8(bufp, ELFDATA2LSB); /* data encoding :: MSB? */ + YASM_WRITE_8(bufp, EV_CURRENT); /* elf version */ + YASM_WRITE_8(bufp, ELFOSABI_SYSV); /* os/abi */ + YASM_WRITE_8(bufp, 0); /* SYSV v3 ABI=0 */ + while (bufp-buf < EI_NIDENT) /* e_ident padding */ + YASM_WRITE_8(bufp, 0); + + YASM_WRITE_16_L(bufp, ET_REL); /* e_type - object file */ + YASM_WRITE_16_L(bufp, EM_X86_64); /* e_machine - or others */ + YASM_WRITE_32_L(bufp, EV_CURRENT); /* elf version */ + YASM_WRITE_32_L(bufp, 0); /* e_entry */ + YASM_WRITE_32_L(bufp, 0); /* e_phoff */ + YASM_WRITE_32_L(bufp, secthead_addr); /* e_shoff secthead off */ + + YASM_WRITE_32_L(bufp, 0); /* e_flags */ + YASM_WRITE_16_L(bufp, EHDR32_SIZE); /* e_ehsize */ + YASM_WRITE_16_L(bufp, 0); /* e_phentsize */ + YASM_WRITE_16_L(bufp, 0); /* e_phnum */ + YASM_WRITE_16_L(bufp, SHDR32_SIZE); /* e_shentsize */ + YASM_WRITE_16_L(bufp, secthead_count); /* e_shnum */ + YASM_WRITE_16_L(bufp, shstrtab_index); /* e_shstrndx */ + *bufpp = bufp; +} + +const elf_machine_handler +elf_machine_handler_x86_x32 = { + "x86", "x32", ".rela", + SYMTAB32_SIZE, SYMTAB32_ALIGN, RELOC32A_SIZE, SHDR32_SIZE, EHDR32_SIZE, + elf_x86_x32_accepts_reloc, + elf_x86_x32_write_symtab_entry, + elf_x86_x32_write_secthead, + elf_x86_x32_write_secthead_rel, + elf_x86_x32_handle_reloc_addend, + elf_x86_x32_map_reloc_info_to_type, + elf_x86_x32_write_reloc, + elf_x86_x32_write_proghead, + elf_x86_x32_ssyms, + sizeof(elf_x86_x32_ssyms)/sizeof(elf_x86_x32_ssyms[0]), + 32 +}; diff --git a/modules/objfmts/elf/elf.c b/modules/objfmts/elf/elf.c index 7adf7ea9..addec913 100644 --- a/modules/objfmts/elf/elf.c +++ b/modules/objfmts/elf/elf.c @@ -56,12 +56,14 @@ const yasm_assoc_data_callback elf_ssym_symrec_data = { extern elf_machine_handler elf_machine_handler_x86_x86, - elf_machine_handler_x86_amd64; + elf_machine_handler_x86_amd64, + elf_machine_handler_x86_x32; static const elf_machine_handler *elf_machine_handlers[] = { &elf_machine_handler_x86_x86, &elf_machine_handler_x86_amd64, + &elf_machine_handler_x86_x32, NULL }; static const elf_machine_handler elf_null_machine = {0, 0, 0, 0, 0, 0, 0, 0, @@ -81,9 +83,13 @@ elf_set_arch(yasm_arch *arch, yasm_symtab *symtab, int bits_pref) elf_march = elf_machine_handlers[++i]) { if (yasm__strcasecmp(yasm_arch_keyword(arch), elf_march->arch)==0) - if (yasm__strcasecmp(machine, elf_march->machine)==0) + if (yasm__strcasecmp(machine, elf_march->machine)==0) { if (bits_pref == 0 || bits_pref == elf_march->bits) break; + } else if (bits_pref == elf_march->bits + && yasm__strcasecmp(machine, "amd64") == 0 + && yasm__strcasecmp(elf_march->machine, "x32") == 0) + break; } if (elf_march && elf_march->num_ssyms > 0) diff --git a/modules/objfmts/elf/tests/Makefile.inc b/modules/objfmts/elf/tests/Makefile.inc index e6d421c0..0980329c 100644 --- a/modules/objfmts/elf/tests/Makefile.inc +++ b/modules/objfmts/elf/tests/Makefile.inc @@ -47,9 +47,13 @@ EXTRA_DIST += modules/objfmts/elf/tests/nasm-forceident.asm EXTRA_DIST += modules/objfmts/elf/tests/nasm-forceident.hex EXTRA_DIST += modules/objfmts/elf/tests/amd64/Makefile.inc +EXTRA_DIST += modules/objfmts/elf/tests/x32/Makefile.inc EXTRA_DIST += modules/objfmts/elf/tests/gas32/Makefile.inc EXTRA_DIST += modules/objfmts/elf/tests/gas64/Makefile.inc +EXTRA_DIST += modules/objfmts/elf/tests/gasx32/Makefile.inc include modules/objfmts/elf/tests/amd64/Makefile.inc +include modules/objfmts/elf/tests/x32/Makefile.inc include modules/objfmts/elf/tests/gas32/Makefile.inc include modules/objfmts/elf/tests/gas64/Makefile.inc +include modules/objfmts/elf/tests/gasx32/Makefile.inc diff --git a/modules/objfmts/elf/tests/gasx32/Makefile.inc b/modules/objfmts/elf/tests/gasx32/Makefile.inc new file mode 100644 index 00000000..6bba8bd6 --- /dev/null +++ b/modules/objfmts/elf/tests/gasx32/Makefile.inc @@ -0,0 +1,11 @@ +TESTS += modules/objfmts/elf/tests/gasx32/elf_gasx32_test.sh + +EXTRA_DIST += modules/objfmts/elf/tests/gasx32/elf_gasx32_test.sh +EXTRA_DIST += modules/objfmts/elf/tests/gasx32/crosssect.asm +EXTRA_DIST += modules/objfmts/elf/tests/gasx32/crosssect.hex +EXTRA_DIST += modules/objfmts/elf/tests/gasx32/elf_gasx32_curpos.asm +EXTRA_DIST += modules/objfmts/elf/tests/gasx32/elf_gasx32_curpos.hex +EXTRA_DIST += modules/objfmts/elf/tests/gasx32/elf_gasx32_reloc.asm +EXTRA_DIST += modules/objfmts/elf/tests/gasx32/elf_gasx32_reloc.hex +EXTRA_DIST += modules/objfmts/elf/tests/gasx32/elf_gasx32_ssym.asm +EXTRA_DIST += modules/objfmts/elf/tests/gasx32/elf_gasx32_ssym.hex diff --git a/modules/objfmts/elf/tests/gasx32/crosssect.asm b/modules/objfmts/elf/tests/gasx32/crosssect.asm new file mode 100644 index 00000000..41999791 --- /dev/null +++ b/modules/objfmts/elf/tests/gasx32/crosssect.asm @@ -0,0 +1,18 @@ +.section .rodata + .align 4 +_sys_srt: + .long 0 + +.text + .align 4,0x90 + .long _sys_srt-. + .long _sys_srt-_sys_info + #.long _sys_info-_sys_srt + #.long -(_sys_srt-_sys_info) + .long _sys_info-. + .long .-_sys_info + .long (_sys_srt-.)+(.-_sys_info) # GAS cannot handle this but we can + .long 0 + .long 65558 +_sys_info: + .long 0 diff --git a/modules/objfmts/elf/tests/gasx32/crosssect.hex b/modules/objfmts/elf/tests/gasx32/crosssect.hex new file mode 100644 index 00000000..35893c4e --- /dev/null +++ b/modules/objfmts/elf/tests/gasx32/crosssect.hex @@ -0,0 +1,568 @@ +7f +45 +4c +46 +01 +01 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +3e +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +20 +01 +00 +00 +00 +00 +00 +00 +34 +00 +00 +00 +00 +00 +28 +00 +07 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +14 +00 +00 +00 +f0 +ff +ff +ff +00 +00 +00 +00 +00 +00 +00 +00 +16 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +02 +04 +00 +00 +00 +00 +00 +00 +04 +00 +00 +00 +02 +04 +00 +00 +e8 +ff +ff +ff +10 +00 +00 +00 +02 +04 +00 +00 +f4 +ff +ff +ff +00 +00 +00 +00 +00 +2e +74 +65 +78 +74 +00 +2e +72 +6f +64 +61 +74 +61 +00 +2e +72 +65 +6c +61 +2e +74 +65 +78 +74 +00 +2e +73 +74 +72 +74 +61 +62 +00 +2e +73 +79 +6d +74 +61 +62 +00 +2e +73 +68 +73 +74 +72 +74 +61 +62 +00 +00 +2d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +f1 +ff +00 +00 +00 +00 +1c +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +06 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +00 +06 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +2a +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +88 +00 +00 +00 +34 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +1a +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +bc +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +22 +00 +00 +00 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +c0 +00 +00 +00 +60 +00 +00 +00 +02 +00 +00 +00 +06 +00 +00 +00 +04 +00 +00 +00 +10 +00 +00 +00 +01 +00 +00 +00 +01 +00 +00 +00 +06 +00 +00 +00 +00 +00 +00 +00 +40 +00 +00 +00 +20 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +0f +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +60 +00 +00 +00 +24 +00 +00 +00 +03 +00 +00 +00 +04 +00 +00 +00 +04 +00 +00 +00 +0c +00 +00 +00 +07 +00 +00 +00 +01 +00 +00 +00 +02 +00 +00 +00 +00 +00 +00 +00 +84 +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 diff --git a/modules/objfmts/elf/tests/gasx32/elf_gasx32_curpos.asm b/modules/objfmts/elf/tests/gasx32/elf_gasx32_curpos.asm new file mode 100644 index 00000000..60a893b3 --- /dev/null +++ b/modules/objfmts/elf/tests/gasx32/elf_gasx32_curpos.asm @@ -0,0 +1,27 @@ +.globl bar +.globl foo + +.section .bar +bar: +.4byte foo-. +.4byte baz-. +call foo +call baz +foo: + +.section .data +baz: +.4byte foo-. +#.4byte .-foo # illegal +.4byte baz-. +.4byte .-baz +.4byte foo+4-. # with constant +.4byte .-baz+foo+4-. # both local and cross-segment (legal) +#.4byte baz+foo+4-.-. # ditto, slightly different - GAS gets confused on this +#.4byte (bar-.)+(foo-.) # illegal (too many cross-segment) +.4byte baz-.+baz-. # two from same segment + +.section .text +movl $5, foo-. +movl $(foo-.), %eax +call foo diff --git a/modules/objfmts/elf/tests/gasx32/elf_gasx32_curpos.hex b/modules/objfmts/elf/tests/gasx32/elf_gasx32_curpos.hex new file mode 100644 index 00000000..45cb217f --- /dev/null +++ b/modules/objfmts/elf/tests/gasx32/elf_gasx32_curpos.hex @@ -0,0 +1,848 @@ +7f +45 +4c +46 +01 +01 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +3e +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +c0 +01 +00 +00 +00 +00 +00 +00 +34 +00 +00 +00 +00 +00 +28 +00 +0a +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +c7 +04 +25 +00 +00 +00 +00 +05 +00 +00 +00 +b8 +00 +00 +00 +00 +e8 +00 +00 +00 +00 +00 +00 +00 +03 +00 +00 +00 +02 +07 +00 +00 +03 +00 +00 +00 +0c +00 +00 +00 +02 +07 +00 +00 +01 +00 +00 +00 +11 +00 +00 +00 +02 +07 +00 +00 +fc +ff +ff +ff +12 +00 +00 +00 +00 +00 +00 +00 +e8 +05 +00 +00 +00 +e8 +00 +00 +00 +00 +00 +00 +04 +00 +00 +00 +02 +02 +00 +00 +00 +00 +00 +00 +0e +00 +00 +00 +02 +02 +00 +00 +fc +ff +ff +ff +00 +00 +00 +00 +fc +ff +ff +ff +08 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +d8 +ff +ff +ff +00 +00 +00 +00 +02 +07 +00 +00 +00 +00 +00 +00 +0c +00 +00 +00 +02 +07 +00 +00 +04 +00 +00 +00 +10 +00 +00 +00 +02 +07 +00 +00 +14 +00 +00 +00 +00 +2e +74 +65 +78 +74 +00 +2e +62 +61 +72 +00 +2e +64 +61 +74 +61 +00 +2e +72 +65 +6c +61 +2e +74 +65 +78 +74 +00 +2e +72 +65 +6c +61 +2e +62 +61 +72 +00 +2e +72 +65 +6c +61 +2e +64 +61 +74 +61 +00 +2e +73 +74 +72 +74 +61 +62 +00 +2e +73 +79 +6d +74 +61 +62 +00 +2e +73 +68 +73 +74 +72 +74 +61 +62 +00 +00 +2d +00 +62 +61 +72 +00 +66 +6f +6f +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +f1 +ff +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +00 +08 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +08 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +00 +06 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +00 +04 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +10 +00 +06 +00 +07 +00 +00 +00 +12 +00 +00 +00 +00 +00 +00 +00 +10 +00 +06 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +42 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +e4 +00 +00 +00 +4c +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +32 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +30 +01 +00 +00 +0b +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +3a +00 +00 +00 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +3c +01 +00 +00 +80 +00 +00 +00 +02 +00 +00 +00 +06 +00 +00 +00 +04 +00 +00 +00 +10 +00 +00 +00 +01 +00 +00 +00 +01 +00 +00 +00 +06 +00 +00 +00 +00 +00 +00 +00 +40 +00 +00 +00 +15 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +12 +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +58 +00 +00 +00 +24 +00 +00 +00 +03 +00 +00 +00 +04 +00 +00 +00 +04 +00 +00 +00 +0c +00 +00 +00 +07 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +7c +00 +00 +00 +12 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +1d +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +90 +00 +00 +00 +18 +00 +00 +00 +03 +00 +00 +00 +06 +00 +00 +00 +04 +00 +00 +00 +0c +00 +00 +00 +0c +00 +00 +00 +01 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +a8 +00 +00 +00 +18 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +27 +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +c0 +00 +00 +00 +24 +00 +00 +00 +03 +00 +00 +00 +08 +00 +00 +00 +04 +00 +00 +00 +0c +00 +00 +00 diff --git a/modules/objfmts/elf/tests/gasx32/elf_gasx32_reloc.asm b/modules/objfmts/elf/tests/gasx32/elf_gasx32_reloc.asm new file mode 100644 index 00000000..e015ce4b --- /dev/null +++ b/modules/objfmts/elf/tests/gasx32/elf_gasx32_reloc.asm @@ -0,0 +1,37 @@ +.comm _ZEROVAR, 32, 16 +.comm _VAR, 16, 16 +.data +.org 0 +_ZEROVAR: +.org 0xa0 +.globl _VAR +.type _VAR, @object +.size _VAR, 16 +_VAR: +.4byte 0 +.4byte 0 +.4byte 0 +.4byte 0 +.org 0xc0 +_VAR2: +.org 0xe0 +.globl _VAR3 +_VAR3: + +.text +movq $0, %rax +movq _VAR, %rax +movq %rax, _VAR(%rip) +movq _VAR+8(%rip), %rcx +movlpd _VAR(%rip), %xmm1 + +movq _VAR2, %rax +movq %rax, _VAR2(%rip) +movq _VAR2+8(%rip), %rcx +movlpd _VAR2(%rip), %xmm1 + +movq _VAR3, %rax +movq %rax, _VAR3(%rip) +movq _VAR3+8(%rip), %rcx +movlpd _VAR3(%rip), %xmm1 + diff --git a/modules/objfmts/elf/tests/gasx32/elf_gasx32_reloc.hex b/modules/objfmts/elf/tests/gasx32/elf_gasx32_reloc.hex new file mode 100644 index 00000000..1b46fa18 --- /dev/null +++ b/modules/objfmts/elf/tests/gasx32/elf_gasx32_reloc.hex @@ -0,0 +1,1016 @@ +7f +45 +4c +46 +01 +01 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +3e +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +e0 +02 +00 +00 +00 +00 +00 +00 +34 +00 +00 +00 +00 +00 +28 +00 +07 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +48 +c7 +c0 +00 +00 +00 +00 +48 +8b +04 +25 +00 +00 +00 +00 +48 +89 +05 +00 +00 +00 +00 +48 +8b +0d +00 +00 +00 +00 +66 +0f +12 +0d +00 +00 +00 +00 +48 +8b +04 +25 +00 +00 +00 +00 +48 +89 +05 +00 +00 +00 +00 +48 +8b +0d +00 +00 +00 +00 +66 +0f +12 +0d +00 +00 +00 +00 +48 +8b +04 +25 +00 +00 +00 +00 +48 +89 +05 +00 +00 +00 +00 +48 +8b +0d +00 +00 +00 +00 +66 +0f +12 +0d +00 +00 +00 +00 +00 +00 +00 +0b +00 +00 +00 +0a +06 +00 +00 +00 +00 +00 +00 +12 +00 +00 +00 +02 +06 +00 +00 +fc +ff +ff +ff +19 +00 +00 +00 +02 +06 +00 +00 +04 +00 +00 +00 +21 +00 +00 +00 +02 +06 +00 +00 +fc +ff +ff +ff +29 +00 +00 +00 +0a +03 +00 +00 +c0 +00 +00 +00 +30 +00 +00 +00 +02 +03 +00 +00 +bc +00 +00 +00 +37 +00 +00 +00 +02 +03 +00 +00 +c4 +00 +00 +00 +3f +00 +00 +00 +02 +03 +00 +00 +bc +00 +00 +00 +47 +00 +00 +00 +0a +07 +00 +00 +00 +00 +00 +00 +4e +00 +00 +00 +02 +07 +00 +00 +fc +ff +ff +ff +55 +00 +00 +00 +02 +07 +00 +00 +04 +00 +00 +00 +5d +00 +00 +00 +02 +07 +00 +00 +fc +ff +ff +ff +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +2e +74 +65 +78 +74 +00 +2e +64 +61 +74 +61 +00 +2e +72 +65 +6c +61 +2e +74 +65 +78 +74 +00 +2e +73 +74 +72 +74 +61 +62 +00 +2e +73 +79 +6d +74 +61 +62 +00 +2e +73 +68 +73 +74 +72 +74 +61 +62 +00 +00 +00 +00 +2d +00 +5f +56 +41 +52 +00 +5f +5a +45 +52 +4f +56 +41 +52 +00 +5f +56 +41 +52 +33 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +f1 +ff +00 +00 +00 +00 +c0 +00 +00 +00 +00 +00 +00 +00 +00 +00 +06 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +00 +06 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +00 +04 +00 +08 +00 +00 +00 +00 +00 +00 +00 +20 +00 +00 +00 +10 +00 +06 +00 +03 +00 +00 +00 +a0 +00 +00 +00 +10 +00 +00 +00 +11 +00 +06 +00 +11 +00 +00 +00 +e0 +00 +00 +00 +00 +00 +00 +00 +10 +00 +06 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +28 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +14 +02 +00 +00 +32 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +18 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +48 +02 +00 +00 +17 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +20 +00 +00 +00 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +60 +02 +00 +00 +80 +00 +00 +00 +02 +00 +00 +00 +05 +00 +00 +00 +04 +00 +00 +00 +10 +00 +00 +00 +01 +00 +00 +00 +01 +00 +00 +00 +06 +00 +00 +00 +00 +00 +00 +00 +40 +00 +00 +00 +61 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +0d +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +a4 +00 +00 +00 +90 +00 +00 +00 +03 +00 +00 +00 +04 +00 +00 +00 +04 +00 +00 +00 +0c +00 +00 +00 +07 +00 +00 +00 +01 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +34 +01 +00 +00 +e0 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 diff --git a/modules/objfmts/elf/tests/gasx32/elf_gasx32_ssym.asm b/modules/objfmts/elf/tests/gasx32/elf_gasx32_ssym.asm new file mode 100644 index 00000000..b7203f62 --- /dev/null +++ b/modules/objfmts/elf/tests/gasx32/elf_gasx32_ssym.asm @@ -0,0 +1,10 @@ +.text +foo: +movl %eax, foo@PLT +movl %eax, foo@GOTPCREL +movl %eax, bar@TLSGD +movl %eax, bar@TLSLD +movl %eax, bar@GOTTPOFF +movl %eax, bar@TPOFF +movl %eax, bar@DTPOFF +movl %eax, foo@GOT diff --git a/modules/objfmts/elf/tests/gasx32/elf_gasx32_ssym.hex b/modules/objfmts/elf/tests/gasx32/elf_gasx32_ssym.hex new file mode 100644 index 00000000..cac39900 --- /dev/null +++ b/modules/objfmts/elf/tests/gasx32/elf_gasx32_ssym.hex @@ -0,0 +1,592 @@ +7f +45 +4c +46 +01 +01 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +3e +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +60 +01 +00 +00 +00 +00 +00 +00 +34 +00 +00 +00 +00 +00 +28 +00 +06 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +89 +04 +25 +00 +00 +00 +00 +89 +04 +25 +00 +00 +00 +00 +89 +04 +25 +00 +00 +00 +00 +89 +04 +25 +00 +00 +00 +00 +89 +04 +25 +00 +00 +00 +00 +89 +04 +25 +00 +00 +00 +00 +89 +04 +25 +00 +00 +00 +00 +89 +04 +25 +00 +00 +00 +00 +03 +00 +00 +00 +04 +02 +00 +00 +00 +00 +00 +00 +0a +00 +00 +00 +09 +02 +00 +00 +00 +00 +00 +00 +11 +00 +00 +00 +13 +04 +00 +00 +00 +00 +00 +00 +18 +00 +00 +00 +14 +04 +00 +00 +00 +00 +00 +00 +1f +00 +00 +00 +16 +04 +00 +00 +00 +00 +00 +00 +26 +00 +00 +00 +17 +04 +00 +00 +00 +00 +00 +00 +2d +00 +00 +00 +15 +04 +00 +00 +00 +00 +00 +00 +34 +00 +00 +00 +03 +02 +00 +00 +00 +00 +00 +00 +00 +2e +74 +65 +78 +74 +00 +2e +72 +65 +6c +61 +2e +74 +65 +78 +74 +00 +2e +73 +74 +72 +74 +61 +62 +00 +2e +73 +79 +6d +74 +61 +62 +00 +2e +73 +68 +73 +74 +72 +74 +61 +62 +00 +00 +2d +00 +62 +61 +72 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +f1 +ff +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +00 +04 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +16 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +22 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +d8 +00 +00 +00 +2c +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +12 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +01 +00 +00 +07 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +1a +00 +00 +00 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +0c +01 +00 +00 +50 +00 +00 +00 +02 +00 +00 +00 +04 +00 +00 +00 +04 +00 +00 +00 +10 +00 +00 +00 +01 +00 +00 +00 +01 +00 +00 +00 +06 +00 +00 +00 +00 +00 +00 +00 +40 +00 +00 +00 +38 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +07 +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +78 +00 +00 +00 +60 +00 +00 +00 +03 +00 +00 +00 +04 +00 +00 +00 +04 +00 +00 +00 +0c +00 +00 +00 diff --git a/modules/objfmts/elf/tests/gasx32/elf_gasx32_test.sh b/modules/objfmts/elf/tests/gasx32/elf_gasx32_test.sh new file mode 100755 index 00000000..f5372cb5 --- /dev/null +++ b/modules/objfmts/elf/tests/gasx32/elf_gasx32_test.sh @@ -0,0 +1,3 @@ +#! /bin/sh +${srcdir}/out_test.sh elf_gasx32_test modules/objfmts/elf/tests/gasx32 "GAS elf-x32 objfmt" "-f elfx32 -p gas" ".o" +exit $? diff --git a/modules/objfmts/elf/tests/x32/Makefile.inc b/modules/objfmts/elf/tests/x32/Makefile.inc new file mode 100644 index 00000000..d62ba3ea --- /dev/null +++ b/modules/objfmts/elf/tests/x32/Makefile.inc @@ -0,0 +1,11 @@ +TESTS += modules/objfmts/elf/tests/x32/elf_x32_test.sh + +EXTRA_DIST += modules/objfmts/elf/tests/x32/elf_x32_test.sh +EXTRA_DIST += modules/objfmts/elf/tests/x32/elf-rip.asm +EXTRA_DIST += modules/objfmts/elf/tests/x32/elf-rip.hex +EXTRA_DIST += modules/objfmts/elf/tests/x32/elfso32.asm +EXTRA_DIST += modules/objfmts/elf/tests/x32/elfso32.hex +EXTRA_DIST += modules/objfmts/elf/tests/x32/gotpcrel.asm +EXTRA_DIST += modules/objfmts/elf/tests/x32/gotpcrel.hex +EXTRA_DIST += modules/objfmts/elf/tests/x32/multiplefixup.asm +EXTRA_DIST += modules/objfmts/elf/tests/x32/multiplefixup.hex diff --git a/modules/objfmts/elf/tests/x32/elf-rip.asm b/modules/objfmts/elf/tests/x32/elf-rip.asm new file mode 100644 index 00000000..5f10f096 --- /dev/null +++ b/modules/objfmts/elf/tests/x32/elf-rip.asm @@ -0,0 +1,7 @@ +[bits 64] +[extern sym] +mov eax, [rip] +mov eax, [rip+2] +mov eax, [rip+sym] +mov eax, [sym wrt rip] +call sym diff --git a/modules/objfmts/elf/tests/x32/elf-rip.hex b/modules/objfmts/elf/tests/x32/elf-rip.hex new file mode 100644 index 00000000..be5da687 --- /dev/null +++ b/modules/objfmts/elf/tests/x32/elf-rip.hex @@ -0,0 +1,496 @@ +7f +45 +4c +46 +01 +01 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +3e +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +34 +00 +00 +00 +00 +00 +28 +00 +06 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +8b +05 +00 +00 +00 +00 +8b +05 +02 +00 +00 +00 +8b +05 +00 +00 +00 +00 +8b +05 +00 +00 +00 +00 +e8 +00 +00 +00 +00 +00 +00 +00 +0e +00 +00 +00 +0a +03 +00 +00 +00 +00 +00 +00 +14 +00 +00 +00 +02 +03 +00 +00 +fc +ff +ff +ff +19 +00 +00 +00 +02 +03 +00 +00 +fc +ff +ff +ff +00 +2e +74 +65 +78 +74 +00 +2e +72 +65 +6c +61 +2e +74 +65 +78 +74 +00 +2e +73 +74 +72 +74 +61 +62 +00 +2e +73 +79 +6d +74 +61 +62 +00 +2e +73 +68 +73 +74 +72 +74 +61 +62 +00 +00 +2d +00 +73 +79 +6d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +f1 +ff +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +00 +04 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +22 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +84 +00 +00 +00 +2c +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +12 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +b0 +00 +00 +00 +07 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +1a +00 +00 +00 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +b8 +00 +00 +00 +40 +00 +00 +00 +02 +00 +00 +00 +03 +00 +00 +00 +04 +00 +00 +00 +10 +00 +00 +00 +01 +00 +00 +00 +01 +00 +00 +00 +06 +00 +00 +00 +00 +00 +00 +00 +40 +00 +00 +00 +1d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +07 +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +60 +00 +00 +00 +24 +00 +00 +00 +03 +00 +00 +00 +04 +00 +00 +00 +04 +00 +00 +00 +0c +00 +00 +00 diff --git a/modules/objfmts/elf/tests/x32/elf_x32_test.sh b/modules/objfmts/elf/tests/x32/elf_x32_test.sh new file mode 100755 index 00000000..39618166 --- /dev/null +++ b/modules/objfmts/elf/tests/x32/elf_x32_test.sh @@ -0,0 +1,3 @@ +#! /bin/sh +${srcdir}/out_test.sh elf_x32_test modules/objfmts/elf/tests/x32 "elf-x32 objfmt" "-f elf -m x32" ".o" +exit $? diff --git a/modules/objfmts/elf/tests/x32/elfsox32.asm b/modules/objfmts/elf/tests/x32/elfsox32.asm new file mode 100644 index 00000000..931c7ffe --- /dev/null +++ b/modules/objfmts/elf/tests/x32/elfsox32.asm @@ -0,0 +1,90 @@ +; This code is UNTESTED, and almost certainly DOES NOT WORK! +; Do NOT use this as an example of how to write AMD64 shared libraries! +; This code is simply to test the AMD64 ELF WRT relocations. + +; This file should test the following: +; [1] Define and export a global text-section symbol +; [2] Define and export a global data-section symbol +; [3] Define and export a global BSS-section symbol +; [4] Define a non-global text-section symbol +; [5] Define a non-global data-section symbol +; [6] Define a non-global BSS-section symbol +; [7] Define a COMMON symbol +; [8] Define a NASM local label +; [9] Reference a NASM local label +; [10] Import an external symbol +; [11] Make a PC-relative call to an external symbol +; [12] Reference a text-section symbol in the text section +; [13] Reference a data-section symbol in the text section +; [14] Reference a BSS-section symbol in the text section +; [15] Reference a text-section symbol in the data section +; [16] Reference a data-section symbol in the data section +; [17] Reference a BSS-section symbol in the data section + + [BITS 64] + [GLOBAL lrotate:function] ; [1] + [GLOBAL greet:function] ; [1] + [GLOBAL asmstr:data asmstr.end-asmstr] ; [2] + [GLOBAL textptr:data 4] ; [2] + [GLOBAL selfptr:data 4] ; [2] + [GLOBAL integer:data 4] ; [3] + [EXTERN printf] ; [10] + [COMMON commvar 4:4] ; [7] + [EXTERN _GLOBAL_OFFSET_TABLE_] + + [SECTION .text] + +; prototype: long lrotate(long x, int num); +lrotate: ; [1] + push rbp + mov rbp,rsp + mov rax,[rbp+8] + mov rcx,[rbp+12] +.label rol rax,1 ; [4] [8] + loop .label ; [9] [12] + mov rsp,rbp + pop rbp + ret + +; prototype: void greet(void); +greet push rbx ; we'll use RBX for GOT, so save it + mov rbx,[integer wrt ..gotpcrel wrt rip] + mov rax,[rbx] ; [14] + inc rax + mov rbx,[_GLOBAL_OFFSET_TABLE_ wrt ..gotpcrel wrt rip] + mov [rbx+localint wrt ..got],eax ; [14] + mov rax,[rbx+commvar wrt ..got] + push qword [rax] + mov rax,[rbx+localptr wrt ..got] ; [13] + push qword [rax] + mov rax,[rbx+integer wrt ..got] ; [1] [14] + push qword [rax] + lea rax,[rbx+printfstr wrt ..got] + push rax ; [13] + call printf wrt ..plt ; [11] + add rsp,16 + pop rbx + ret + + [SECTION .data] + +; a string +asmstr db 'hello, world', 0 ; [2] +.end + +; a string for Printf +printfstr db "integer==%d, localint==%d, commvar=%d" + db 10, 0 + +; some pointers +localptr dd localint ; [5] [17] +textptr dd greet wrt ..sym ; [15] +selfptr dd selfptr wrt ..sym ; [16] + + [SECTION .bss] + +; an integer +integer resd 1 ; [3] + +; a local integer +localint resd 1 ; [6] diff --git a/modules/objfmts/elf/tests/x32/elfsox32.hex b/modules/objfmts/elf/tests/x32/elfsox32.hex new file mode 100644 index 00000000..d423b2de --- /dev/null +++ b/modules/objfmts/elf/tests/x32/elfsox32.hex @@ -0,0 +1,1176 @@ +7f +45 +4c +46 +01 +01 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +3e +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +30 +03 +00 +00 +00 +00 +00 +00 +34 +00 +00 +00 +00 +00 +28 +00 +09 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +55 +48 +89 +e5 +48 +8b +45 +08 +48 +8b +4d +0c +48 +d1 +c0 +e2 +fb +48 +89 +ec +5d +c3 +53 +48 +8b +1d +00 +00 +00 +00 +48 +8b +03 +48 +ff +c0 +48 +8b +1d +00 +00 +00 +00 +89 +83 +00 +00 +00 +00 +48 +8b +83 +00 +00 +00 +00 +ff +30 +48 +8b +83 +00 +00 +00 +00 +ff +30 +48 +8b +83 +00 +00 +00 +00 +ff +30 +48 +8d +83 +00 +00 +00 +00 +50 +e8 +00 +00 +00 +00 +48 +83 +c4 +10 +5b +c3 +00 +1a +00 +00 +00 +09 +0f +00 +00 +fc +ff +ff +ff +27 +00 +00 +00 +09 +12 +00 +00 +fc +ff +ff +ff +2d +00 +00 +00 +03 +06 +00 +00 +00 +00 +00 +00 +34 +00 +00 +00 +03 +11 +00 +00 +00 +00 +00 +00 +3d +00 +00 +00 +03 +05 +00 +00 +00 +00 +00 +00 +46 +00 +00 +00 +03 +0f +00 +00 +00 +00 +00 +00 +4f +00 +00 +00 +03 +04 +00 +00 +00 +00 +00 +00 +55 +00 +00 +00 +04 +10 +00 +00 +fc +ff +ff +ff +68 +65 +6c +6c +6f +2c +20 +77 +6f +72 +6c +64 +00 +69 +6e +74 +65 +67 +65 +72 +3d +3d +25 +64 +2c +20 +6c +6f +63 +61 +6c +69 +6e +74 +3d +3d +25 +64 +2c +20 +63 +6f +6d +6d +76 +61 +72 +3d +25 +64 +0a +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +34 +00 +00 +00 +0a +02 +00 +00 +04 +00 +00 +00 +38 +00 +00 +00 +0a +0b +00 +00 +00 +00 +00 +00 +3c +00 +00 +00 +0a +0e +00 +00 +00 +00 +00 +00 +00 +2e +74 +65 +78 +74 +00 +2e +64 +61 +74 +61 +00 +2e +62 +73 +73 +00 +2e +72 +65 +6c +61 +2e +74 +65 +78 +74 +00 +2e +72 +65 +6c +61 +2e +64 +61 +74 +61 +00 +2e +73 +74 +72 +74 +61 +62 +00 +2e +73 +79 +6d +74 +61 +62 +00 +2e +73 +68 +73 +74 +72 +74 +61 +62 +00 +00 +00 +00 +2d +00 +6c +72 +6f +74 +61 +74 +65 +00 +67 +72 +65 +65 +74 +00 +61 +73 +6d +73 +74 +72 +00 +74 +65 +78 +74 +70 +74 +72 +00 +73 +65 +6c +66 +70 +74 +72 +00 +69 +6e +74 +65 +67 +65 +72 +00 +70 +72 +69 +6e +74 +66 +00 +63 +6f +6d +6d +76 +61 +72 +00 +5f +47 +4c +4f +42 +41 +4c +5f +4f +46 +46 +53 +45 +54 +5f +54 +41 +42 +4c +45 +5f +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +f1 +ff +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +00 +08 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +00 +06 +00 +00 +00 +00 +00 +0d +00 +00 +00 +00 +00 +00 +00 +00 +00 +06 +00 +00 +00 +00 +00 +34 +00 +00 +00 +00 +00 +00 +00 +00 +00 +06 +00 +00 +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +08 +00 +00 +00 +00 +00 +0c +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +00 +00 +00 +00 +0d +00 +00 +00 +00 +00 +00 +00 +00 +00 +06 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +00 +04 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +12 +00 +04 +00 +0b +00 +00 +00 +16 +00 +00 +00 +00 +00 +00 +00 +12 +00 +04 +00 +11 +00 +00 +00 +00 +00 +00 +00 +0d +00 +00 +00 +11 +00 +06 +00 +18 +00 +00 +00 +38 +00 +00 +00 +04 +00 +00 +00 +11 +00 +06 +00 +20 +00 +00 +00 +3c +00 +00 +00 +04 +00 +00 +00 +11 +00 +06 +00 +28 +00 +00 +00 +00 +00 +00 +00 +04 +00 +00 +00 +11 +00 +08 +00 +30 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +10 +00 +00 +00 +37 +00 +00 +00 +04 +00 +00 +00 +04 +00 +00 +00 +10 +00 +f2 +ff +3f +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +38 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +64 +01 +00 +00 +42 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +28 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +a8 +01 +00 +00 +55 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +30 +00 +00 +00 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +30 +01 +00 +00 +02 +00 +00 +00 +0a +00 +00 +00 +04 +00 +00 +00 +10 +00 +00 +00 +01 +00 +00 +00 +01 +00 +00 +00 +06 +00 +00 +00 +00 +00 +00 +00 +40 +00 +00 +00 +5f +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +12 +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +a0 +00 +00 +00 +60 +00 +00 +00 +03 +00 +00 +00 +04 +00 +00 +00 +04 +00 +00 +00 +0c +00 +00 +00 +07 +00 +00 +00 +01 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +40 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +1d +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +40 +01 +00 +00 +24 +00 +00 +00 +03 +00 +00 +00 +06 +00 +00 +00 +04 +00 +00 +00 +0c +00 +00 +00 +0d +00 +00 +00 +08 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +08 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 diff --git a/modules/objfmts/elf/tests/x32/gotpcrel.asm b/modules/objfmts/elf/tests/x32/gotpcrel.asm new file mode 100644 index 00000000..c3d12383 --- /dev/null +++ b/modules/objfmts/elf/tests/x32/gotpcrel.asm @@ -0,0 +1,6 @@ +var: +mov rax, [var wrt ..got] +mov rax, [var wrt ..gotpcrel] ; should be error/warning? +mov rax, [rel var wrt ..got] ; automatic promotion to GOTPCREL +mov rax, [rel var wrt ..gotpcrel] + diff --git a/modules/objfmts/elf/tests/x32/gotpcrel.hex b/modules/objfmts/elf/tests/x32/gotpcrel.hex new file mode 100644 index 00000000..695cf7d6 --- /dev/null +++ b/modules/objfmts/elf/tests/x32/gotpcrel.hex @@ -0,0 +1,496 @@ +7f +45 +4c +46 +01 +01 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +3e +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +34 +00 +00 +00 +00 +00 +28 +00 +06 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +48 +8b +04 +25 +00 +00 +00 +00 +48 +8b +04 +25 +00 +00 +00 +00 +48 +8b +05 +00 +00 +00 +00 +48 +8b +05 +00 +00 +00 +00 +00 +00 +04 +00 +00 +00 +03 +02 +00 +00 +00 +00 +00 +00 +0c +00 +00 +00 +09 +02 +00 +00 +00 +00 +00 +00 +13 +00 +00 +00 +09 +02 +00 +00 +fc +ff +ff +ff +1a +00 +00 +00 +09 +02 +00 +00 +fc +ff +ff +ff +00 +2e +74 +65 +78 +74 +00 +2e +72 +65 +6c +61 +2e +74 +65 +78 +74 +00 +2e +73 +74 +72 +74 +61 +62 +00 +2e +73 +79 +6d +74 +61 +62 +00 +2e +73 +68 +73 +74 +72 +74 +61 +62 +00 +00 +2d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +f1 +ff +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +22 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +90 +00 +00 +00 +2c +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +12 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +bc +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +1a +00 +00 +00 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +c0 +00 +00 +00 +40 +00 +00 +00 +02 +00 +00 +00 +04 +00 +00 +00 +04 +00 +00 +00 +10 +00 +00 +00 +01 +00 +00 +00 +01 +00 +00 +00 +06 +00 +00 +00 +00 +00 +00 +00 +40 +00 +00 +00 +1e +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +07 +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +60 +00 +00 +00 +30 +00 +00 +00 +03 +00 +00 +00 +04 +00 +00 +00 +04 +00 +00 +00 +0c +00 +00 +00 diff --git a/modules/objfmts/elf/tests/x32/multiplefixup.asm b/modules/objfmts/elf/tests/x32/multiplefixup.asm new file mode 100644 index 00000000..ec253cbb --- /dev/null +++ b/modules/objfmts/elf/tests/x32/multiplefixup.asm @@ -0,0 +1,8 @@ +[section .data] +foobar: + dq 42 +[section .text] +foo: + times 4 mov rax, [rel foobar] + times 4 mov rax, [foobar] + times 4 jmp foo diff --git a/modules/objfmts/elf/tests/x32/multiplefixup.hex b/modules/objfmts/elf/tests/x32/multiplefixup.hex new file mode 100644 index 00000000..a1874282 --- /dev/null +++ b/modules/objfmts/elf/tests/x32/multiplefixup.hex @@ -0,0 +1,680 @@ +7f +45 +4c +46 +01 +01 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +3e +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +90 +01 +00 +00 +00 +00 +00 +00 +34 +00 +00 +00 +00 +00 +28 +00 +07 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +48 +8b +05 +00 +00 +00 +00 +48 +8b +05 +00 +00 +00 +00 +48 +8b +05 +00 +00 +00 +00 +48 +8b +05 +00 +00 +00 +00 +48 +8b +04 +25 +00 +00 +00 +00 +48 +8b +04 +25 +00 +00 +00 +00 +48 +8b +04 +25 +00 +00 +00 +00 +48 +8b +04 +25 +00 +00 +00 +00 +eb +c2 +eb +c0 +eb +be +eb +bc +03 +00 +00 +00 +02 +04 +00 +00 +fc +ff +ff +ff +0a +00 +00 +00 +02 +04 +00 +00 +fc +ff +ff +ff +11 +00 +00 +00 +02 +04 +00 +00 +fc +ff +ff +ff +18 +00 +00 +00 +02 +04 +00 +00 +fc +ff +ff +ff +20 +00 +00 +00 +0a +04 +00 +00 +00 +00 +00 +00 +28 +00 +00 +00 +0a +04 +00 +00 +00 +00 +00 +00 +30 +00 +00 +00 +0a +04 +00 +00 +00 +00 +00 +00 +38 +00 +00 +00 +0a +04 +00 +00 +00 +00 +00 +00 +2a +00 +00 +00 +00 +00 +00 +00 +00 +2e +74 +65 +78 +74 +00 +2e +64 +61 +74 +61 +00 +2e +72 +65 +6c +61 +2e +74 +65 +78 +74 +00 +2e +73 +74 +72 +74 +61 +62 +00 +2e +73 +79 +6d +74 +61 +62 +00 +2e +73 +68 +73 +74 +72 +74 +61 +62 +00 +00 +00 +00 +2d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +f1 +ff +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +06 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +00 +06 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +28 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +ec +00 +00 +00 +32 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +18 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +20 +01 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +20 +00 +00 +00 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +24 +01 +00 +00 +60 +00 +00 +00 +02 +00 +00 +00 +06 +00 +00 +00 +04 +00 +00 +00 +10 +00 +00 +00 +01 +00 +00 +00 +01 +00 +00 +00 +06 +00 +00 +00 +00 +00 +00 +00 +40 +00 +00 +00 +44 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +0d +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +84 +00 +00 +00 +60 +00 +00 +00 +03 +00 +00 +00 +04 +00 +00 +00 +04 +00 +00 +00 +0c +00 +00 +00 +07 +00 +00 +00 +01 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +e4 +00 +00 +00 +08 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 diff --git a/modules/objfmts/yasm_objfmts.xml b/modules/objfmts/yasm_objfmts.xml index 13811a07..f4c9a75b 100644 --- a/modules/objfmts/yasm_objfmts.xml +++ b/modules/objfmts/yasm_objfmts.xml @@ -96,11 +96,12 @@ elf - The ELF object format really comes in two flavors: - elf32 (for 32-bit targets) and elf64 - (for 64-bit targets). ELF is a standard object format in common - use on modern Unix and compatible systems (e.g. Linux, FreeBSD). - ELF has complex support for relocatable and shared objects. + The ELF object format really comes in three flavors: + elf32 (for 32-bit targets), elf64 + (for 64-bit targets and elfx32 (for x32 targets). + ELF is a standard object format in common use on modern Unix and + compatible systems (e.g. Linux, FreeBSD). ELF has complex support + for relocatable and shared objects. From 243248dab1245bd71f81d25bd1fb113035438e88 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 30 Aug 2012 23:53:29 -0700 Subject: [PATCH 459/585] Regen yasm_arch.7 and yasm_objfmts.7. --- yasm_arch.7 | 25 ++++++++++++++++++------- yasm_objfmts.7 | 25 ++++++++++++++++++------- 2 files changed, 36 insertions(+), 14 deletions(-) diff --git a/yasm_arch.7 b/yasm_arch.7 index bd72d3ff..ccdfd056 100644 --- a/yasm_arch.7 +++ b/yasm_arch.7 @@ -1,7 +1,7 @@ '\" t .\" Title: yasm_arch .\" Author: Peter Johnson -.\" Generator: DocBook XSL Stylesheets v1.75.2 +.\" Generator: DocBook XSL Stylesheets v1.76.1 .\" Date: October 2006 .\" Manual: Yasm Supported Architectures .\" Source: Yasm @@ -9,6 +9,15 @@ .\" .TH "YASM_ARCH" "7" "October 2006" "Yasm" "Yasm Supported Architectures" .\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation @@ -73,12 +82,14 @@ Recently, Intel has introduced an essentially identical version of AMD64 called When an AMD64\-supporting processor is executing in 64\-bit mode, a number of additional extensions are available, including extra general purpose registers, extra SSE2 registers, and RIP\-relative addressing\&. .PP Yasm extends the base NASM syntax to support AMD64 as follows\&. To enable assembly of instructions for the 64\-bit mode of AMD64 processors, use the directive -\fBBITS 64\fR\&. As with NASM\'s BITS directive, this does not change the format of the output object file to 64 bits; it only changes the assembler mode to assume that the instructions being assembled will be run in 64\-bit mode\&. To specify an AMD64 object file, use +\fBBITS 64\fR\&. As with NASM\*(Aqs BITS directive, this does not change the format of the output object file to 64 bits; it only changes the assembler mode to assume that the instructions being assembled will be run in 64\-bit mode\&. To specify an AMD64 object file, use \fB\-m amd64\fR on the Yasm command line, or explicitly target a 64\-bit object format such as \fB\-f win64\fR or \fB\-f elf64\fR\&. +\fB\-f elfx32\fR +can be used to select 32\-bit ELF object format for AMD64 processors\&. .sp .it 1 an-trap .nr an-no-space-flag 1 @@ -762,9 +773,9 @@ mov [rel sym], rbx ; RIP\-relative (explicit override) \fBMemory references\fR .RS 4 .PP -Usually the size of a memory reference can be deduced by which registers you\'re moving\-\-for example, "mov [rax],ecx" is a 32\-bit move, because ecx is 32 bits\&. YASM currently gives the non\-obvious "invalid combination of opcode and operands" error if it can\'t figure out how much memory you\'re moving\&. The fix in this case is to add a memory size specifier: qword, dword, word, or byte\&. +Usually the size of a memory reference can be deduced by which registers you\*(Aqre moving\-\-for example, "mov [rax],ecx" is a 32\-bit move, because ecx is 32 bits\&. YASM currently gives the non\-obvious "invalid combination of opcode and operands" error if it can\*(Aqt figure out how much memory you\*(Aqre moving\&. The fix in this case is to add a memory size specifier: qword, dword, word, or byte\&. .PP -Here\'s a 64\-bit memory move, which sets 8 bytes starting at rax: +Here\*(Aqs a 64\-bit memory move, which sets 8 bytes starting at rax: .sp .if n \{\ .RS 4 @@ -776,7 +787,7 @@ mov qword [rax], 1 .RE .\} .PP -Here\'s a 32\-bit memory move, which sets 4 bytes: +Here\*(Aqs a 32\-bit memory move, which sets 4 bytes: .sp .if n \{\ .RS 4 @@ -788,7 +799,7 @@ mov dword [rax], 1 .RE .\} .PP -Here\'s a 16\-bit memory move, which sets 2 bytes: +Here\*(Aqs a 16\-bit memory move, which sets 2 bytes: .sp .if n \{\ .RS 4 @@ -800,7 +811,7 @@ mov word [rax], 1 .RE .\} .PP -Here\'s an 8\-bit memory move, which sets 1 byte: +Here\*(Aqs an 8\-bit memory move, which sets 1 byte: .sp .if n \{\ .RS 4 diff --git a/yasm_objfmts.7 b/yasm_objfmts.7 index 5f642735..bc649860 100644 --- a/yasm_objfmts.7 +++ b/yasm_objfmts.7 @@ -1,7 +1,7 @@ '\" t .\" Title: yasm_objfmts .\" Author: Peter Johnson -.\" Generator: DocBook XSL Stylesheets v1.75.2 +.\" Generator: DocBook XSL Stylesheets v1.76.1 .\" Date: February 2007 .\" Manual: Yasm Supported Object Formats .\" Source: Yasm @@ -9,6 +9,15 @@ .\" .TH "YASM_OBJFMTS" "7" "February 2007" "Yasm" "Yasm Supported Object Formats" .\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation @@ -25,7 +34,7 @@ yasm_objfmts \- Yasm Supported Object Formats \fByasm\fR \fB\-f\ \fR\fB\fIobjfmt\fR\fR \fB\fI\&.\&.\&.\fR\fR .SH "DESCRIPTION" .PP -The standard Yasm distribution includes a number of modules for different object formats (Yasm\'s primary output)\&. +The standard Yasm distribution includes a number of modules for different object formats (Yasm\*(Aqs primary output)\&. .PP The object format is selected on the \fByasm\fR(1) @@ -46,14 +55,16 @@ The \(lqdbg\(rq object format is not a \(lqreal\(rq -object format; the output file it creates simply describes the sequence of calls made to it by Yasm and the final object and symbol table information in a human\-readable text format (that in a normal object format would get processed into that object format\'s particular binary representation)\&. This object format is not intended for real use, but rather for debugging Yasm\'s internals\&. +object format; the output file it creates simply describes the sequence of calls made to it by Yasm and the final object and symbol table information in a human\-readable text format (that in a normal object format would get processed into that object format\*(Aqs particular binary representation)\&. This object format is not intended for real use, but rather for debugging Yasm\*(Aqs internals\&. .SH "ELF" .PP -The ELF object format really comes in two flavors: +The ELF object format really comes in three flavors: \(lqelf32\(rq -(for 32\-bit targets) and +(for 32\-bit targets), \(lqelf64\(rq -(for 64\-bit targets)\&. ELF is a standard object format in common use on modern Unix and compatible systems (e\&.g\&. Linux, FreeBSD)\&. ELF has complex support for relocatable and shared objects\&. +(for 64\-bit targets and +\(lqelfx32\(rq +(for x32 targets)\&. ELF is a standard object format in common use on modern Unix and compatible systems (e\&.g\&. Linux, FreeBSD)\&. ELF has complex support for relocatable and shared objects\&. .SH "MACHO" .PP The Mach\-O object format really comes in two flavors: @@ -74,7 +85,7 @@ The Win64 object format produces object files compatible with Microsoft compiler Windows platform\&. This format is very similar to the win32 object format, but produces 64\-bit objects\&. .SH "XDF" .PP -The XDF object format is essentially a simplified version of COFF\&. It\'s a multi\-section relocatable format that supports 64\-bit physical and virtual addresses\&. +The XDF object format is essentially a simplified version of COFF\&. It\*(Aqs a multi\-section relocatable format that supports 64\-bit physical and virtual addresses\&. .SH "SEE ALSO" .PP \fByasm\fR(1), From 73caedeebdec18e669b4c06a736c41ddcbcb4d87 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 30 Aug 2012 23:53:41 -0700 Subject: [PATCH 460/585] gas-parse.c: Eliminate warning. --- modules/parsers/gas/gas-parse.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/parsers/gas/gas-parse.c b/modules/parsers/gas/gas-parse.c index 56fb8541..14c86a70 100644 --- a/modules/parsers/gas/gas-parse.c +++ b/modules/parsers/gas/gas-parse.c @@ -905,7 +905,6 @@ parse_instr(yasm_parser_gas *parser_gas) { yasm_bytecode *bc; char *id; - size_t id_len; uintptr_t prefix; if (parser_gas->intel_syntax) { @@ -925,7 +924,6 @@ parse_instr(yasm_parser_gas *parser_gas) return NULL; id = ID_val; - id_len = ID_len; /* instructions/prefixes must start with a letter */ if (!isalpha(id[0])) From 8dd87f6b1677f56ec58c9302134c9c7f8d5230ef Mon Sep 17 00:00:00 2001 From: BrianGladman Date: Tue, 11 Sep 2012 19:57:20 +0100 Subject: [PATCH 461/585] add new elf file to visual studio 2010 build --- Mkfiles/vc10/modules/modules.vcxproj | 1 + Mkfiles/vc10/modules/modules.vcxproj.filters | 3 +++ 2 files changed, 4 insertions(+) diff --git a/Mkfiles/vc10/modules/modules.vcxproj b/Mkfiles/vc10/modules/modules.vcxproj index 9e1f917d..070e923f 100644 --- a/Mkfiles/vc10/modules/modules.vcxproj +++ b/Mkfiles/vc10/modules/modules.vcxproj @@ -208,6 +208,7 @@ + diff --git a/Mkfiles/vc10/modules/modules.vcxproj.filters b/Mkfiles/vc10/modules/modules.vcxproj.filters index d66bf489..b7912bda 100644 --- a/Mkfiles/vc10/modules/modules.vcxproj.filters +++ b/Mkfiles/vc10/modules/modules.vcxproj.filters @@ -175,6 +175,9 @@ Source Files\arch + + Source Files\objfmts + From 1db998a3d35377f96744cf596bc904461eda796b Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 19 Oct 2012 17:23:26 -0700 Subject: [PATCH 462/585] Add support for "function" decorator in win32/win64. This can be used on global directives (e.g. global _foo:function) to indicate the global is a function. This is useful for incremental linking in MSVC. --- modules/objfmts/coff/coff-objfmt.c | 11 ++ modules/objfmts/win64/tests/Makefile.inc | 2 + .../objfmts/win64/tests/win64-function.asm | 4 + .../objfmts/win64/tests/win64-function.hex | 154 ++++++++++++++++++ 4 files changed, 171 insertions(+) create mode 100644 modules/objfmts/win64/tests/win64-function.asm create mode 100644 modules/objfmts/win64/tests/win64-function.hex diff --git a/modules/objfmts/coff/coff-objfmt.c b/modules/objfmts/coff/coff-objfmt.c index c9646c62..c42bf7e3 100644 --- a/modules/objfmts/coff/coff-objfmt.c +++ b/modules/objfmts/coff/coff-objfmt.c @@ -988,10 +988,21 @@ coff_objfmt_output_sym(yasm_symrec *sym, /*@null@*/ void *d) yasm_sym_vis vis = yasm_symrec_get_visibility(sym); int is_abs = yasm_symrec_is_abs(sym); /*@dependent@*/ /*@null@*/ coff_symrec_data *csymd; + yasm_valparamhead *objext_valparams = + yasm_symrec_get_objext_valparams(sym); csymd = yasm_symrec_get_data(sym, &coff_symrec_data_cb); assert(info != NULL); + /* Look for "function" flag on global syms */ + if (csymd && csymd->type == 0 && (vis & YASM_SYM_GLOBAL) != 0) { + if (objext_valparams) { + const char *id = yasm_vp_id(yasm_vps_first(objext_valparams)); + if (yasm__strcasecmp(id, "function") == 0) + csymd->type = 0x20; + } + } + /* Don't output local syms unless outputting all syms */ if (info->all_syms || vis != YASM_SYM_LOCAL || is_abs || (csymd && csymd->forcevis)) { diff --git a/modules/objfmts/win64/tests/Makefile.inc b/modules/objfmts/win64/tests/Makefile.inc index 24584267..4062fc33 100644 --- a/modules/objfmts/win64/tests/Makefile.inc +++ b/modules/objfmts/win64/tests/Makefile.inc @@ -27,6 +27,8 @@ EXTRA_DIST += modules/objfmts/win64/tests/win64-dataref.masm EXTRA_DIST += modules/objfmts/win64/tests/win64-dataref2.asm EXTRA_DIST += modules/objfmts/win64/tests/win64-dataref2.hex EXTRA_DIST += modules/objfmts/win64/tests/win64-dataref2.masm +EXTRA_DIST += modules/objfmts/win64/tests/win64-function.asm +EXTRA_DIST += modules/objfmts/win64/tests/win64-function.hex EXTRA_DIST += modules/objfmts/win64/tests/win64-imagebase.hex EXTRA_DIST += modules/objfmts/win64/tests/win64-imagebase.asm diff --git a/modules/objfmts/win64/tests/win64-function.asm b/modules/objfmts/win64/tests/win64-function.asm new file mode 100644 index 00000000..b1af165c --- /dev/null +++ b/modules/objfmts/win64/tests/win64-function.asm @@ -0,0 +1,4 @@ +global _foo:function + +_foo: + diff --git a/modules/objfmts/win64/tests/win64-function.hex b/modules/objfmts/win64/tests/win64-function.hex new file mode 100644 index 00000000..ad94a4dd --- /dev/null +++ b/modules/objfmts/win64/tests/win64-function.hex @@ -0,0 +1,154 @@ +64 +86 +01 +00 +00 +00 +00 +00 +3c +00 +00 +00 +05 +00 +00 +00 +00 +00 +04 +00 +2e +74 +65 +78 +74 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +20 +00 +50 +60 +2e +66 +69 +6c +65 +00 +00 +00 +00 +00 +00 +00 +fe +ff +00 +00 +67 +01 +2d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +2e +74 +65 +78 +74 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +03 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +5f +66 +6f +6f +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +20 +00 +02 +00 +04 +00 +00 +00 From 607feba6d98bf549513e4eaa21445328f9c2b834 Mon Sep 17 00:00:00 2001 From: BrianGladman Date: Tue, 6 Nov 2012 09:16:28 +0000 Subject: [PATCH 463/585] Make the detection of Python in the Visual Studio 2010 build more robust --- Mkfiles/vc10/genperf/run.bat | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Mkfiles/vc10/genperf/run.bat b/Mkfiles/vc10/genperf/run.bat index 5827138b..775f1d0a 100644 --- a/Mkfiles/vc10/genperf/run.bat +++ b/Mkfiles/vc10/genperf/run.bat @@ -1,13 +1,24 @@ cd ..\..\.. @echo off -for /f "usebackq tokens=1*" %%f in (`reg query HKCR\Python.File\shell\open\command`) do (set _my_=%%f %%g) -goto next%errorlevel% -:next1 +for /f "usebackq tokens=1*" %%f in (`reg query HKCR\Applications\python.exe\shell\open\command`) do (set _my_=%%f %%g) +goto try1%errorlevel% + +:try10 +goto ok + +:try11 +for /f "usebackq tokens=1*" %%f in (`reg query HKCR\Python.File\shell\open\command`) do (set _my_=%%f %%g) +goto try2%errorlevel% + +:try20: +goto ok + +:try21: echo Building without Python ... goto therest -:next0 +:ok echo Building with Python ... set _res_=%_my_:*REG_SZ=% set _end_=%_res_:*exe"=% From 31c99f1fb24a893e0bd7778ba165a779474246b5 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 1 Jun 2013 09:40:34 -0700 Subject: [PATCH 464/585] Fix vpbroadcastq. Patch by: Jason Garrett-Glaser --- modules/arch/x86/gen_x86_insn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index 7524d78d..ceed1840 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -6943,7 +6943,7 @@ for sz in [128, 256]: prefix=0x66, opcode=[0x0F, 0x38, 0x59], operands=[Operand(type="SIMDReg", size=sz, dest="Spare"), - Operand(type="RM", size=64, relaxed=True, dest="EA")]) + Operand(type="SIMDRM", size=64, relaxed=True, dest="EA")]) add_insn("vpbroadcastq", "vpbroadcastq_avx2") From c3aa2478c674ac08206f52df44ab798da9585aa0 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 21 Jun 2013 10:02:32 -0700 Subject: [PATCH 465/585] Unbreak distcheck. --- modules/objfmts/elf/tests/x32/Makefile.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/objfmts/elf/tests/x32/Makefile.inc b/modules/objfmts/elf/tests/x32/Makefile.inc index d62ba3ea..2db20525 100644 --- a/modules/objfmts/elf/tests/x32/Makefile.inc +++ b/modules/objfmts/elf/tests/x32/Makefile.inc @@ -3,8 +3,8 @@ TESTS += modules/objfmts/elf/tests/x32/elf_x32_test.sh EXTRA_DIST += modules/objfmts/elf/tests/x32/elf_x32_test.sh EXTRA_DIST += modules/objfmts/elf/tests/x32/elf-rip.asm EXTRA_DIST += modules/objfmts/elf/tests/x32/elf-rip.hex -EXTRA_DIST += modules/objfmts/elf/tests/x32/elfso32.asm -EXTRA_DIST += modules/objfmts/elf/tests/x32/elfso32.hex +EXTRA_DIST += modules/objfmts/elf/tests/x32/elfsox32.asm +EXTRA_DIST += modules/objfmts/elf/tests/x32/elfsox32.hex EXTRA_DIST += modules/objfmts/elf/tests/x32/gotpcrel.asm EXTRA_DIST += modules/objfmts/elf/tests/x32/gotpcrel.hex EXTRA_DIST += modules/objfmts/elf/tests/x32/multiplefixup.asm From a24f4841f7f08815e4bfecb8a725659ce2095dba Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 3 Jul 2013 11:06:56 -0700 Subject: [PATCH 466/585] cv8: Fix line number issues with multiple files. Patch by: Knut St. Osmundsen [#263 state:resolved] --- modules/dbgfmts/codeview/cv-symline.c | 62 ++++++++++---------- modules/dbgfmts/codeview/cv8.txt | 18 +++--- modules/dbgfmts/codeview/tests/cv8-multi.asm | 23 ++++++++ modules/dbgfmts/codeview/tests/cv8-multi.mac | 4 ++ 4 files changed, 67 insertions(+), 40 deletions(-) create mode 100644 modules/dbgfmts/codeview/tests/cv8-multi.asm create mode 100644 modules/dbgfmts/codeview/tests/cv8-multi.mac diff --git a/modules/dbgfmts/codeview/cv-symline.c b/modules/dbgfmts/codeview/cv-symline.c index 2b71302a..8d703022 100644 --- a/modules/dbgfmts/codeview/cv-symline.c +++ b/modules/dbgfmts/codeview/cv-symline.c @@ -127,12 +127,15 @@ typedef struct cv8_lineset { size_t num_pairs; } cv8_lineset; +/* Note: Due to line number sorting requirements (by section offset it seems) + * one file may need more than one record per section. */ typedef struct cv8_lineinfo { STAILQ_ENTRY(cv8_lineinfo) link; const cv_filename *fn; /* filename associated with line numbers */ yasm_section *sect; /* section line numbers are for */ yasm_symrec *sectsym; /* symbol for beginning of sect */ unsigned long num_linenums; + int first_in_sect; /* First lineinfo for this section. */ STAILQ_HEAD(cv8_lineset_head, cv8_lineset) linesets; } cv8_lineinfo; @@ -443,23 +446,9 @@ cv_generate_line_bc(yasm_bytecode *bc, /*@null@*/ void *d) || strcmp(filename, info->cv8_cur_li->fn->filename) != 0) { yasm_bytecode *sectbc; char symname[8]; + int first_in_sect = !info->cv8_cur_li; - /* first see if we already have a lineinfo that is for this section and - * filename - */ - STAILQ_FOREACH(info->cv8_cur_li, &info->cv8_lineinfos, link) { - if (sect == info->cv8_cur_li->sect - && strcmp(filename, info->cv8_cur_li->fn->filename) == 0) - break; - } - - if (info->cv8_cur_li) { - info->cv8_cur_ls = STAILQ_LAST(&info->cv8_cur_li->linesets, - cv8_lineset, link); - goto done; /* found one */ - } - - /* Nope; find file */ + /* Find file */ for (i=0; ifilenames_size; i++) { if (strcmp(filename, dbgfmt_cv->filenames[i].filename) == 0) break; @@ -471,6 +460,7 @@ cv_generate_line_bc(yasm_bytecode *bc, /*@null@*/ void *d) info->cv8_cur_li = yasm_xmalloc(sizeof(cv8_lineinfo)); info->cv8_cur_li->fn = &dbgfmt_cv->filenames[i]; info->cv8_cur_li->sect = sect; + info->cv8_cur_li->first_in_sect = first_in_sect; sectbc = yasm_section_bcs_first(sect); if (sectbc->symrecs && sectbc->symrecs[0]) info->cv8_cur_li->sectsym = sectbc->symrecs[0]; @@ -485,7 +475,6 @@ cv_generate_line_bc(yasm_bytecode *bc, /*@null@*/ void *d) STAILQ_INSERT_TAIL(&info->cv8_lineinfos, info->cv8_cur_li, link); info->cv8_cur_ls = NULL; } -done: /* build new lineset if necessary */ if (!info->cv8_cur_ls || info->cv8_cur_ls->num_pairs >= 126) { @@ -622,13 +611,19 @@ yasm_cv__generate_symline(yasm_object *object, yasm_linemap *linemap, cv_generate_line_section); /* Output line numbers for sections */ + head = NULL; STAILQ_FOREACH(li, &info.cv8_lineinfos, link) { - head = cv8_add_symhead(info.debug_symline, CV8_LINE_NUMS, 0); + if (li->first_in_sect) { + if (head) + cv8_set_symhead_end(head, yasm_section_bcs_last(info.debug_symline)); + head = cv8_add_symhead(info.debug_symline, CV8_LINE_NUMS, 0); + } bc = yasm_bc_create_common(&cv8_lineinfo_bc_callback, li, 0); - bc->len = 24+li->num_linenums*8; + bc->len = (li->first_in_sect ? 24 : 12) + li->num_linenums*8; yasm_cv__append_bc(info.debug_symline, bc); - cv8_set_symhead_end(head, yasm_section_bcs_last(info.debug_symline)); } + if (head) + cv8_set_symhead_end(head, yasm_section_bcs_last(info.debug_symline)); /* Already aligned 4 */ @@ -880,22 +875,25 @@ cv8_lineinfo_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, unsigned long i; cv8_lineset *ls; - /* start offset and section */ - cv_out_sym(li->sectsym, (unsigned long)(buf - bufstart), bc, &buf, - d, output_value); + if (li->first_in_sect) { + /* start offset and section */ + cv_out_sym(li->sectsym, (unsigned long)(buf - bufstart), bc, &buf, + d, output_value); - /* Two bytes of pad/alignment */ - YASM_WRITE_8(buf, 0); - YASM_WRITE_8(buf, 0); + /* Two bytes of pad/alignment */ + YASM_WRITE_8(buf, 0); + YASM_WRITE_8(buf, 0); - /* Section length covered by line number info */ - cval = yasm_calc_bc_dist(yasm_section_bcs_first(li->sect), - yasm_section_bcs_last(li->sect)); - yasm_arch_intnum_tobytes(object->arch, cval, buf, 4, 32, 0, bc, 0); - buf += 4; + /* Section length covered by line number info */ + cval = yasm_calc_bc_dist(yasm_section_bcs_first(li->sect), + yasm_section_bcs_last(li->sect)); + yasm_arch_intnum_tobytes(object->arch, cval, buf, 4, 32, 0, bc, 0); + yasm_intnum_destroy(cval); + buf += 4; + } /* Offset of source file in info table */ - yasm_intnum_set_uint(cval, li->fn->info_off); + cval = yasm_intnum_create_uint(li->fn->info_off); yasm_arch_intnum_tobytes(object->arch, cval, buf, 4, 32, 0, bc, 0); buf += 4; diff --git a/modules/dbgfmts/codeview/cv8.txt b/modules/dbgfmts/codeview/cv8.txt index 04f152b2..a4bbdd8e 100644 --- a/modules/dbgfmts/codeview/cv8.txt +++ b/modules/dbgfmts/codeview/cv8.txt @@ -25,15 +25,17 @@ the end (not included in length). 2 bytes - section index (SECTION to section start) 2 bytes - pad/align (0) 4 bytes - section length covered by line number info - 4 bytes - offset of source file in source file info table - 4 bytes - number of line number pairs - 4 bytes - number of bytes of line number pairs + 12 - followed by pairs of: - 4 bytes - offset in section - 4 bytes - line number; if high bit is set, - end of statement/breakpointable (?) - e.g. lines containing - just labels should have line numbers + followed by one or more source mappings: + 4 bytes - offset of source file in source file info table + 4 bytes - number of line number pairs + 4 bytes - number of bytes this mapping takes, i.e. 12 + pair-count * 8. + + followed by pairs of: + 4 bytes - offset in section + 4 bytes - line number; if high bit is set, + end of statement/breakpointable (?) - e.g. lines containing + just labels should have line numbers 0x000000F1: symbol information enclosed data per below diff --git a/modules/dbgfmts/codeview/tests/cv8-multi.asm b/modules/dbgfmts/codeview/tests/cv8-multi.asm new file mode 100644 index 00000000..ddb9adcd --- /dev/null +++ b/modules/dbgfmts/codeview/tests/cv8-multi.asm @@ -0,0 +1,23 @@ +; +; Test for windbg's ability to single step thru two (or more) source files +; contributing instructions to the same sections. +; +; YASM 1.2.0 and earlier used to generate one CV8_LINE_NUMS per file per +; section, thus potentially having several CV8_LINE_NUMS records for each +; section. It is seems that this confuses either the linker or/and windbg +; and prevents single stepping in and out of include files. +; +; MASM generates one line number debug subsection for each code section, +; repeating the 12 bytes before the offset/lineno pairs for each new file. +; +; It also appears that line numbers must be ordered by section offset, and +; therefore cannot be grouped per file as done by YASM 1.2.0 and earlier. +; +_start: +global _start +%include "cv8-multi.mac" + mov eax, 42 +%include "cv8-multi.mac" + xor eax, eax + ret + diff --git a/modules/dbgfmts/codeview/tests/cv8-multi.mac b/modules/dbgfmts/codeview/tests/cv8-multi.mac new file mode 100644 index 00000000..5a559f48 --- /dev/null +++ b/modules/dbgfmts/codeview/tests/cv8-multi.mac @@ -0,0 +1,4 @@ + int3 + nop + ; Must be able to step back into the main file. + From d8c0c39254c32fcb78343e81f8f5c87fd3d28995 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 3 Jul 2013 11:25:50 -0700 Subject: [PATCH 467/585] Update config.guess and config.sub. [#255 state:resolved] --- config/config.guess | 1037 ++++++++++++++++++++++++------------------- config/config.sub | 482 +++++++++++++++----- 2 files changed, 960 insertions(+), 559 deletions(-) diff --git a/config/config.guess b/config/config.guess index 0e30d56e..d622a44e 100644 --- a/config/config.guess +++ b/config/config.guess @@ -1,9 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011, 2012 Free Software Foundation, Inc. -timestamp='2003-07-02' +timestamp='2012-02-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -16,24 +17,24 @@ timestamp='2003-07-02' # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. -# Originally written by Per Bothner . -# Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. + +# Originally written by Per Bothner. Please send patches (context +# diff format) to and include a ChangeLog +# entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # -# The plan is that this can be called by configure scripts if you -# don't specify an explicit build system type. +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD me=`echo "$0" | sed -e 's,.*/,,'` @@ -53,7 +54,8 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO @@ -66,11 +68,11 @@ Try \`$me --help' for more information." while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) - echo "$timestamp" ; exit 0 ;; + echo "$timestamp" ; exit ;; --version | -v ) - echo "$version" ; exit 0 ;; + echo "$version" ; exit ;; --help | --h* | -h ) - echo "$usage"; exit 0 ;; + echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. @@ -104,7 +106,7 @@ set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; @@ -123,7 +125,7 @@ case $CC_FOR_BUILD,$HOST_CC,$CC in ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ;' +esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) @@ -141,7 +143,7 @@ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward @@ -158,6 +160,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched @@ -166,7 +169,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep __ELF__ >/dev/null + | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? @@ -176,7 +179,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in fi ;; *) - os=netbsd + os=netbsd ;; esac # The OS release @@ -196,50 +199,32 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" - exit 0 ;; - amiga:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - arc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - hp300:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mac68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - macppc:OpenBSD:*:*) - echo powerpc-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme88k:OpenBSD:*:*) - echo m88k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvmeppc:OpenBSD:*:*) - echo powerpc-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - pmax:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sgi:OpenBSD:*:*) - echo mipseb-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sun3:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - wgrisc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; + exit ;; *:OpenBSD:*:*) - echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; alpha:OSF1:*:*) - if test $UNAME_RELEASE = "V4.0"; then + case $UNAME_RELEASE in + *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - fi + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU @@ -277,42 +262,52 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac + # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit 0 ;; - Alpha*:OpenVMS:*:*) - echo alpha-hp-vms - exit 0 ;; + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix - exit 0 ;; + exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 - exit 0 ;; + exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 - exit 0;; + exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos - exit 0 ;; + exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos - exit 0 ;; + exit ;; *:OS/390:*:*) echo i370-ibm-openedition - exit 0 ;; + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} - exit 0;; + exit ;; + arm:riscos:*:*|arm:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp - exit 0;; + exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then @@ -320,32 +315,51 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in else echo pyramid-pyramid-bsd fi - exit 0 ;; + exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 - exit 0 ;; + exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 - exit 0 ;; - DRS?6000:UNIX_SV:4.2*:7*) + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7 && exit 0 ;; + sparc) echo sparc-icl-nx7; exit ;; esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; + exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - i86pc:SunOS:5.*:*) - echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; + exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval $set_cc_for_build + SUN_ARCH="i386" + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH="x86_64" + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; + exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) @@ -354,10 +368,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit 0 ;; + exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} - exit 0 ;; + exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 @@ -369,10 +383,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo sparc-sun-sunos${UNAME_RELEASE} ;; esac - exit 0 ;; + exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} - exit 0 ;; + exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor @@ -382,38 +396,41 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; + exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit 0 ;; + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit 0 ;; + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit 0 ;; + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} - exit 0 ;; + exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 - exit 0 ;; + exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} - exit 0 ;; + exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} - exit 0 ;; + exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} - exit 0 ;; + exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c @@ -437,35 +454,36 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in exit (-1); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c \ - && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ - && exit 0 + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} - exit 0 ;; + exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax - exit 0 ;; + exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax - exit 0 ;; + exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax - exit 0 ;; + exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix - exit 0 ;; + exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 - exit 0 ;; + exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 - exit 0 ;; + exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 - exit 0 ;; + exit ;; AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ @@ -478,29 +496,29 @@ EOF else echo i586-dg-dgux${UNAME_RELEASE} fi - exit 0 ;; + exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 - exit 0 ;; + exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 - exit 0 ;; + exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 - exit 0 ;; + exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd - exit 0 ;; + exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit 0 ;; + exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix - exit 0 ;; + exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` @@ -508,7 +526,7 @@ EOF IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit 0 ;; + exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build @@ -523,15 +541,19 @@ EOF exit(0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 - echo rs6000-ibm-aix3.2.5 + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi - exit 0 ;; - *:AIX:*:[45]) + exit ;; + *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 @@ -544,28 +566,28 @@ EOF IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit 0 ;; + exit ;; *:AIX:*:*) echo rs6000-ibm-aix - exit 0 ;; + exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 - exit 0 ;; + exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit 0 ;; # report: romp-ibm BSD 4.3 + exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx - exit 0 ;; + exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 - exit 0 ;; + exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd - exit 0 ;; + exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 - exit 0 ;; + exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in @@ -574,52 +596,52 @@ EOF 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac + esac ;; + esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + sed 's/^ //' << EOF >$dummy.c - #define _HPUX_SOURCE - #include - #include + #define _HPUX_SOURCE + #include + #include - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa @@ -627,9 +649,19 @@ EOF esac if [ ${HP_ARCH} = "hppa2.0w" ] then - # avoid double evaluation of $set_cc_for_build - test -n "$CC_FOR_BUILD" || eval $set_cc_for_build - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ then HP_ARCH="hppa2.0w" else @@ -637,11 +669,11 @@ EOF fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit 0 ;; + exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} - exit 0 ;; + exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c @@ -669,197 +701,173 @@ EOF exit (0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 - exit 0 ;; + exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd - exit 0 ;; + exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd - exit 0 ;; + exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix - exit 0 ;; + exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf - exit 0 ;; + exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf - exit 0 ;; + exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi - exit 0 ;; + exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites - exit 0 ;; + exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd - exit 0 ;; + exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi - exit 0 ;; + exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd - exit 0 ;; + exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd - exit 0 ;; + exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd - exit 0 ;; + exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; + exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' - exit 0 ;; + exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; + exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; + exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; + exit ;; *:UNICOS/mp:*:*) - echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit 0 ;; + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit 0 ;; + exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; + exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; - *:FreeBSD:*:*|*:GNU/FreeBSD:*:*) - # Determine whether the default compiler uses glibc. - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - #if __GLIBC__ >= 2 - LIBC=gnu - #else - LIBC= - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - # GNU/FreeBSD systems have a "k" prefix to indicate we are using - # FreeBSD's kernel, but not the complete OS. - case ${LIBC} in gnu) kernel_only='k' ;; esac - echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} - exit 0 ;; + exit ;; + *:FreeBSD:*:*) + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin - exit 0 ;; - i*:MINGW*:*) + exit ;; + *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 - exit 0 ;; + exit ;; + i*:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 - exit 0 ;; - x86:Interix*:[34]*) - echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' - exit 0 ;; + exit ;; + *:Interix*:*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks - exit 0 ;; + exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix - exit 0 ;; + exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin - exit 0 ;; + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin - exit 0 ;; + exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; + exit ;; *:GNU:*:*) + # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit 0 ;; + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix - exit 0 ;; - arm*:Linux:*:*) + exit ;; + aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - cris:Linux:*:*) - echo cris-axis-linux-gnu - exit 0 ;; - ia64:Linux:*:*) + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - mips:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips - #undef mipsel - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mipsel - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips - #else - CPU= - #endif - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 - ;; - mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips64 - #undef mips64el - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mips64el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips64 - #else - CPU= - #endif - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 - ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu - exit 0 ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu - exit 0 ;; + exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; @@ -869,11 +877,90 @@ EOF EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} - exit 0 ;; + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-gnu + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + fi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + LIBC=gnu + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=${UNAME_MACHINE} + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + or32:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-gnu + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in @@ -881,109 +968,71 @@ EOF PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac - exit 0 ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu - exit 0 ;; + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux - exit 0 ;; + exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu - exit 0 ;; - i*86:Linux:*:*) - # The BFD linker knows what the default object file format is, so - # first see if it will tell us. cd to the root directory to prevent - # problems with other programs or directories called `ld' in the path. - # Set LC_ALL=C to ensure ld outputs messages in English. - ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ - | sed -ne '/supported targets:/!d - s/[ ][ ]*/ /g - s/.*supported targets: *// - s/ .*// - p'` - case "$ld_supported_targets" in - elf32-i386) - TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" - ;; - a.out-i386-linux) - echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit 0 ;; - coff-i386) - echo "${UNAME_MACHINE}-pc-linux-gnucoff" - exit 0 ;; - "") - # Either a pre-BFD a.out linker (linux-gnuoldld) or - # one that does not give us useful --help. - echo "${UNAME_MACHINE}-pc-linux-gnuoldld" - exit 0 ;; - esac - # Determine whether the default compiler is a.out or elf - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - #ifdef __ELF__ - # ifdef __GLIBC__ - # if __GLIBC__ >= 2 - LIBC=gnu - # else - LIBC=gnulibc1 - # endif - # else - LIBC=gnulibc1 - # endif - #else - #ifdef __INTEL_COMPILER - LIBC=gnu - #else - LIBC=gnuaout - #endif - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 - test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 - ;; + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 - exit 0 ;; + exit ;; i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. + # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit 0 ;; + exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx - exit 0 ;; + exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop - exit 0 ;; + exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos - exit 0 ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; + exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit 0 ;; + exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then @@ -991,15 +1040,16 @@ EOF else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi - exit 0 ;; - i*86:*:5:[78]*) + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit 0 ;; + exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi - exit 0 ;; + exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv - exit 0 ;; + exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv - exit 0 ;; + exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix - exit 0 ;; - M68*:*:R3V[567]*:*) - test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; - 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0) + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4.3${OS_REL} && exit 0 + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4 && exit 0 ;; + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; + exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 - exit 0 ;; + exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; + exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; + exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} - exit 0 ;; + exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 - exit 0 ;; + exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 - exit 0 ;; + exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` @@ -1091,68 +1154,94 @@ EOF else echo ns32k-sni-sysv fi - exit 0 ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit 0 ;; + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 - exit 0 ;; + exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 - exit 0 ;; + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos - exit 0 ;; + exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} - exit 0 ;; + exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 - exit 0 ;; + exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} + echo mips-nec-sysv${UNAME_RELEASE} else - echo mips-unknown-sysv${UNAME_RELEASE} + echo mips-unknown-sysv${UNAME_RELEASE} fi - exit 0 ;; + exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos - exit 0 ;; + exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos - exit 0 ;; + exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos - exit 0 ;; + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} - exit 0 ;; + exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} - exit 0 ;; + exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} - exit 0 ;; + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; + exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; + exit ;; *:Darwin:*:*) - case `uname -p` in - *86) UNAME_PROCESSOR=i686 ;; - powerpc) UNAME_PROCESSOR=powerpc ;; + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + i386) + eval $set_cc_for_build + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + UNAME_PROCESSOR="x86_64" + fi + fi ;; + unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit 0 ;; + exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then @@ -1160,22 +1249,28 @@ EOF UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit 0 ;; + exit ;; *:QNX:*:4*) echo i386-pc-qnx - exit 0 ;; - NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*) + exit ;; + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} - exit 0 ;; + exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux - exit 0 ;; + exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv - exit 0 ;; + exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit 0 ;; + exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 @@ -1186,28 +1281,53 @@ EOF UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 - exit 0 ;; + exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 - exit 0 ;; + exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex - exit 0 ;; + exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 - exit 0 ;; + exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 - exit 0 ;; + exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 - exit 0 ;; + exit ;; *:ITS:*:*) echo pdp10-unknown-its - exit 0 ;; + exit ;; SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} - exit 0 ;; + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; + x86_64:VMkernel:*:*) + echo ${UNAME_MACHINE}-unknown-esx + exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 @@ -1230,16 +1350,16 @@ main () #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 - "4" + "4" #else - "" + "" #endif - ); exit (0); + ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix"); exit (0); + printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) @@ -1328,11 +1448,12 @@ main () } EOF -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) @@ -1341,22 +1462,22 @@ then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd - exit 0 ;; + exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi - exit 0 ;; + exit ;; c34*) echo c34-convex-bsd - exit 0 ;; + exit ;; c38*) echo c38-convex-bsd - exit 0 ;; + exit ;; c4*) echo c4-convex-bsd - exit 0 ;; + exit ;; esac fi @@ -1367,7 +1488,9 @@ This script, last modified $timestamp, has failed to recognize the operating system you are using. It is advised that you download the most up to date version of the config scripts from - ftp://ftp.gnu.org/pub/gnu/config/ + http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +and + http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD If the version you run ($0) is already up to date, please send the following data and any information you think might be diff --git a/config/config.sub b/config/config.sub index 9d7f7339..6205f842 100644 --- a/config/config.sub +++ b/config/config.sub @@ -1,9 +1,10 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011, 2012 Free Software Foundation, Inc. -timestamp='2003-07-04' +timestamp='2012-04-18' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -20,23 +21,25 @@ timestamp='2003-07-04' # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. - +# along with this program; if not, see . +# # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. + # Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. +# diff and a properly formatted GNU ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. @@ -70,7 +73,8 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO @@ -83,11 +87,11 @@ Try \`$me --help' for more information." while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) - echo "$timestamp" ; exit 0 ;; + echo "$timestamp" ; exit ;; --version | -v ) - echo "$version" ; exit 0 ;; + echo "$version" ; exit ;; --help | --h* | -h ) - echo "$usage"; exit 0 ;; + echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. @@ -99,7 +103,7 @@ while test $# -gt 0 ; do *local*) # First pass through any local machine types. echo $1 - exit 0;; + exit ;; * ) break ;; @@ -118,10 +122,18 @@ esac # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - nto-qnx* | linux-gnu* | kfreebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; + android-linux) + os=-linux-android + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] @@ -144,10 +156,13 @@ case $os in -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis) + -apple | -axis | -knuth | -cray | -microblaze) os= basic_machine=$1 ;; + -bluegene*) + os=-cnk + ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 @@ -162,13 +177,17 @@ case $os in os=-chorusos basic_machine=$1 ;; - -chorusrdb) - os=-chorusrdb + -chorusrdb) + os=-chorusrdb basic_machine=$1 - ;; + ;; -hiux*) os=-hiuxwe2 ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` @@ -185,6 +204,10 @@ case $os in # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` @@ -202,6 +225,12 @@ case $os in -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; + -lynx*178) + os=-lynxos178 + ;; + -lynx*5) + os=-lynxos5 + ;; -lynx*) os=-lynxos ;; @@ -226,55 +255,103 @@ case $basic_machine in # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ + | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | be32 | be64 \ + | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ - | fr30 | frv \ + | epiphany \ + | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ | i370 | i860 | i960 | ia64 \ - | ip2k \ - | m32r | m68000 | m68k | m88k | mcore \ + | ip2k | iq2000 \ + | le32 | le64 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ - | mips64vr | mips64vrel \ + | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ + | moxie \ + | mt \ | msp430 \ + | nds32 | nds32le | nds32be \ + | nios | nios2 \ | ns16k | ns32k \ - | openrisc | or32 \ + | open8 \ + | or32 \ | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ - | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | rl78 | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ - | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ - | strongarm \ - | tahoe | thumb | tic4x | tic80 | tron \ - | v850 | v850e \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ - | x86 | xscale | xstormy16 | xtensa \ - | z8k) + | x86 | xc16x | xstormy16 | xtensa \ + | z8k | z80) basic_machine=$basic_machine-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12) - # Motorola 68HC11/12. + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; + ms1) + basic_machine=mt-unknown + ;; + + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and @@ -290,58 +367,80 @@ case $basic_machine in # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ + | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | amd64-* | arc-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* \ - | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ - | clipper-* | cydra-* \ + | avr-* | avr32-* \ + | be32-* | be64-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ - | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* \ - | m32r-* \ + | ip2k-* | iq2000-* \ + | le32-* | le64-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | mcore-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ - | mips64vr-* | mips64vrel-* \ + | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ | msp430-* \ - | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \ + | nds32-* | nds32le-* | nds32be-* \ + | nios-* | nios2-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ - | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ - | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile*-* \ | tron-* \ - | v850-* | v850e-* | vax-* \ + | ubicom32-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ | we32k-* \ - | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ - | xtensa-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ + | xstormy16-* | xtensa*-* \ | ymp-* \ - | z8k-*) + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. @@ -359,6 +458,9 @@ case $basic_machine in basic_machine=a29k-amd os=-udi ;; + abacus) + basic_machine=abacus-unknown + ;; adobe68k) basic_machine=m68010-adobe os=-scout @@ -376,6 +478,9 @@ case $basic_machine in amd64) basic_machine=x86_64-pc ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; amdahl) basic_machine=580-amdahl os=-sysv @@ -399,6 +504,10 @@ case $basic_machine in basic_machine=m68k-apollo os=-bsd ;; + aros) + basic_machine=i386-pc + os=-aros + ;; aux) basic_machine=m68k-apple os=-aux @@ -407,10 +516,35 @@ case $basic_machine in basic_machine=ns32k-sequent os=-dynix ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c54x-*) + basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; c90) basic_machine=c90-cray os=-unicos ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; convex-c1) basic_machine=c1-convex os=-bsd @@ -435,12 +569,27 @@ case $basic_machine in basic_machine=j90-cray os=-unicos ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16 | cr16-*) + basic_machine=cr16-unknown + os=-elf + ;; crds | unos) basic_machine=m68k-crds ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; da30 | da30-*) basic_machine=m68k-da30 ;; @@ -463,6 +612,14 @@ case $basic_machine in basic_machine=m88k-motorola os=-sysv3 ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx @@ -574,7 +731,6 @@ case $basic_machine in i370-ibm* | ibm*) basic_machine=i370-ibm ;; -# I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 @@ -613,6 +769,14 @@ case $basic_machine in basic_machine=m68k-isi os=-sysv ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; m88k-omron*) basic_machine=m88k-omron ;; @@ -624,10 +788,17 @@ case $basic_machine in basic_machine=ns32k-utek os=-sysv ;; + microblaze) + basic_machine=microblaze-xilinx + ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; miniframe) basic_machine=m68000-convergent ;; @@ -641,10 +812,6 @@ case $basic_machine in mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; - mmix*) - basic_machine=mmix-knuth - os=-mmixware - ;; monitor) basic_machine=m68k-rom68k os=-coff @@ -657,10 +824,21 @@ case $basic_machine in basic_machine=i386-pc os=-msdos ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + msys) + basic_machine=i386-pc + os=-msys + ;; mvs) basic_machine=i370-ibm os=-mvs ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; ncr3000) basic_machine=i486-ncr os=-sysv4 @@ -725,9 +903,11 @@ case $basic_machine in np1) basic_machine=np1-gould ;; - nv1) - basic_machine=nv1-cray - os=-unicosmp + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem @@ -736,9 +916,12 @@ case $basic_machine in basic_machine=hppa1.1-oki os=-proelf ;; - or32 | or32-*) + openrisc | openrisc-*) basic_machine=or32-unknown - os=-coff + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson @@ -756,6 +939,14 @@ case $basic_machine in basic_machine=i860-intel os=-osf ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; pbd) basic_machine=sparc-tti ;; @@ -765,6 +956,12 @@ case $basic_machine in pc532 | pc532-*) basic_machine=ns32k-pc532 ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; @@ -794,9 +991,10 @@ case $basic_machine in ;; power) basic_machine=power-ibm ;; - ppc) basic_machine=powerpc-unknown + ppc | ppcbe) basic_machine=powerpc-unknown ;; - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown @@ -821,6 +1019,10 @@ case $basic_machine in basic_machine=i586-unknown os=-pw32 ;; + rdos) + basic_machine=i386-pc + os=-rdos + ;; rom68k) basic_machine=m68k-rom68k os=-coff @@ -847,6 +1049,10 @@ case $basic_machine in sb1el) basic_machine=mipsisa64sb1el-unknown ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; sei) basic_machine=mips-sei os=-seiux @@ -858,6 +1064,9 @@ case $basic_machine in basic_machine=sh-hitachi os=-hms ;; + sh5el) + basic_machine=sh5le-unknown + ;; sh64) basic_machine=sh64-unknown ;; @@ -879,6 +1088,9 @@ case $basic_machine in basic_machine=i860-stratus os=-sysv4 ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; sun2) basic_machine=m68000-sun ;; @@ -935,17 +1147,9 @@ case $basic_machine in basic_machine=t90-cray os=-unicos ;; - tic54x | c54x*) - basic_machine=tic54x-unknown - os=-coff - ;; - tic55x | c55x*) - basic_machine=tic55x-unknown - os=-coff - ;; - tic6x | c6x*) - basic_machine=tic6x-unknown - os=-coff + tile*) + basic_machine=$basic_machine-unknown + os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown @@ -960,6 +1164,10 @@ case $basic_machine in tower | tower-32) basic_machine=m68k-ncr ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; udi29k) basic_machine=a29k-amd os=-udi @@ -1003,9 +1211,16 @@ case $basic_machine in basic_machine=hppa1.1-winbond os=-proelf ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; xps | xps100) basic_machine=xps100-honeywell ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; ymp) basic_machine=ymp-cray os=-unicos @@ -1014,6 +1229,10 @@ case $basic_machine in basic_machine=z8k-unknown os=-sim ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; none) basic_machine=none-none os=-none @@ -1033,6 +1252,9 @@ case $basic_machine in romp) basic_machine=romp-ibm ;; + mmix) + basic_machine=mmix-knuth + ;; rs6000) basic_machine=rs6000-ibm ;; @@ -1049,13 +1271,10 @@ case $basic_machine in we32k) basic_machine=we32k-att ;; - sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; - sh64) - basic_machine=sh64-unknown - ;; - sparc | sparcv9 | sparcv9b) + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) @@ -1099,9 +1318,12 @@ esac if [ x"$os" != x"" ] then case $os in - # First match some system type aliases - # that might get confused with valid system types. + # First match some system type aliases + # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; @@ -1122,25 +1344,31 @@ case $os in # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* \ + | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -netbsd* | -openbsd* | -kfreebsd* | -freebsd* | -riscix* \ - | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -openbsd* | -solidbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -chorusos* | -chorusrdb* | -cegcc* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei*) + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1158,12 +1386,15 @@ case $os in os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; @@ -1176,6 +1407,9 @@ case $os in -opened*) os=-openedition ;; + -os400*) + os=-os400 + ;; -wince*) os=-wince ;; @@ -1197,6 +1431,9 @@ case $os in -atheos*) os=-atheos ;; + -syllable*) + os=-syllable + ;; -386bsd) os=-bsd ;; @@ -1219,6 +1456,9 @@ case $os in -sinix*) os=-sysv4 ;; + -tpf*) + os=-tpf + ;; -triton*) os=-sysv3 ;; @@ -1255,6 +1495,14 @@ case $os in -kaos*) os=-kaos ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -nacl*) + ;; -none) ;; *) @@ -1277,6 +1525,12 @@ else # system, and we'll never get to this point. case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; *-acorn) os=-riscix1.2 ;; @@ -1286,9 +1540,21 @@ case $basic_machine in arm*-semi) os=-aout ;; - c4x-* | tic4x-*) - os=-coff - ;; + c4x-* | tic4x-*) + os=-coff + ;; + hexagon-*) + os=-elf + ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + os=-coff + ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 @@ -1307,13 +1573,13 @@ case $basic_machine in ;; m68000-sun) os=-sunos3 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 ;; m68*-cisco) os=-aout ;; + mep-*) + os=-elf + ;; mips*-cisco) os=-elf ;; @@ -1332,9 +1598,15 @@ case $basic_machine in *-be) os=-beos ;; + *-haiku) + os=-haiku + ;; *-ibm) os=-aix ;; + *-knuth) + os=-mmixware + ;; *-wec) os=-proelf ;; @@ -1437,7 +1709,7 @@ case $basic_machine in -sunos*) vendor=sun ;; - -aix*) + -cnk*|-aix*) vendor=ibm ;; -beos*) @@ -1467,9 +1739,15 @@ case $basic_machine in -mvs* | -opened*) vendor=ibm ;; + -os400*) + vendor=ibm + ;; -ptx*) vendor=sequent ;; + -tpf*) + vendor=ibm + ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; @@ -1494,7 +1772,7 @@ case $basic_machine in esac echo $basic_machine$os -exit 0 +exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) From 964fd9a016a0c34525ef2a1f335a0ed44f57c550 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 7 Aug 2013 22:11:39 -0700 Subject: [PATCH 468/585] Optimize matching loops. Reported by: Po-Chun Chang [#264 state:resolved] [#265 state:resolved] [#266 state:resolved] --- frontends/yasm/yasm.c | 7 ++++++- libyasm/assocdat.c | 4 +++- libyasm/section.c | 8 ++++++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/frontends/yasm/yasm.c b/frontends/yasm/yasm.c index f070a168..76353fc6 100644 --- a/frontends/yasm/yasm.c +++ b/frontends/yasm/yasm.c @@ -448,9 +448,14 @@ do_assemble(void) */ matched = 0; for (i=0; cur_parser_module->preproc_keywords[i]; i++) + { if (yasm__strcasecmp(cur_parser_module->preproc_keywords[i], - cur_preproc_module->keyword) == 0) + cur_preproc_module->keyword) == 0) { matched = 1; + break; + } + } + if (!matched) { print_error(_("%s: `%s' is not a valid %s for %s `%s'"), _("FATAL"), cur_preproc_module->keyword, _("preprocessor"), diff --git a/libyasm/assocdat.c b/libyasm/assocdat.c index cdcda62b..56009368 100644 --- a/libyasm/assocdat.c +++ b/libyasm/assocdat.c @@ -87,8 +87,10 @@ yasm__assoc_data_add(yasm__assoc_data *assoc_data_arg, /* See if there's already assocated data for this callback */ for (i=0; isize; i++) { - if (assoc_data->vector[i].callback == callback) + if (assoc_data->vector[i].callback == callback) { item = &assoc_data->vector[i]; + break; + } } /* No? Then append a new one */ diff --git a/libyasm/section.c b/libyasm/section.c index 9242fb01..8ad7deab 100644 --- a/libyasm/section.c +++ b/libyasm/section.c @@ -261,10 +261,14 @@ yasm_object_create(const char *src_filename, const char *obj_filename, * for the active object format. */ matched = 0; - for (i=0; objfmt_module->dbgfmt_keywords[i]; i++) + for (i=0; objfmt_module->dbgfmt_keywords[i]; i++) { if (yasm__strcasecmp(objfmt_module->dbgfmt_keywords[i], - dbgfmt_module->keyword) == 0) + dbgfmt_module->keyword) == 0) { matched = 1; + break; + } + } + if (!matched) { yasm_error_set(YASM_ERROR_GENERAL, N_("`%s' is not a valid debug format for object format `%s'"), From aba12e73f4a4a6c6b84d9f99682bc78540de7d71 Mon Sep 17 00:00:00 2001 From: briangladman Date: Wed, 13 Nov 2013 12:24:21 +0000 Subject: [PATCH 469/585] Minor change to Python detection in the Visual Studio build to avoid spurious error message --- Mkfiles/vc10/genperf/run.bat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Mkfiles/vc10/genperf/run.bat b/Mkfiles/vc10/genperf/run.bat index 775f1d0a..f67049da 100644 --- a/Mkfiles/vc10/genperf/run.bat +++ b/Mkfiles/vc10/genperf/run.bat @@ -1,14 +1,14 @@ cd ..\..\.. @echo off -for /f "usebackq tokens=1*" %%f in (`reg query HKCR\Applications\python.exe\shell\open\command`) do (set _my_=%%f %%g) +for /f "usebackq tokens=1*" %%f in (`reg query HKCR\Applications\python.exe\shell\open\command 2^>NUL`) do (set _my_=%%f %%g) goto try1%errorlevel% :try10 goto ok :try11 -for /f "usebackq tokens=1*" %%f in (`reg query HKCR\Python.File\shell\open\command`) do (set _my_=%%f %%g) +for /f "usebackq tokens=1*" %%f in (`reg query HKCR\Python.File\shell\open\command 2^>NUL`) do (set _my_=%%f %%g) goto try2%errorlevel% :try20: From 87c09baff80ca5bbe938392d8f320e621707f317 Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Wed, 13 Nov 2013 13:15:26 +0000 Subject: [PATCH 470/585] test commit --- Mkfiles/vc10/genperf/run.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mkfiles/vc10/genperf/run.bat b/Mkfiles/vc10/genperf/run.bat index f67049da..664e59ae 100644 --- a/Mkfiles/vc10/genperf/run.bat +++ b/Mkfiles/vc10/genperf/run.bat @@ -1,7 +1,7 @@ cd ..\..\.. @echo off -for /f "usebackq tokens=1*" %%f in (`reg query HKCR\Applications\python.exe\shell\open\command 2^>NUL`) do (set _my_=%%f %%g) +for /f "usebackq tokens=1*" %%f in (`reg query HKCR\Applications\python.exe\shell\open\command 2^>NUL`) do (set _my_=%%f %%g) goto try1%errorlevel% :try10 From e32ff2c2abc22532a58c9b687d922500d23fd709 Mon Sep 17 00:00:00 2001 From: Henrik Gramner Date: Thu, 16 Jan 2014 23:37:11 +0100 Subject: [PATCH 471/585] Use a larger hash table size Increases compilation speed of files with a large number of macros by around 20x. --- modules/preprocs/nasm/nasm-pp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/preprocs/nasm/nasm-pp.c b/modules/preprocs/nasm/nasm-pp.c index 06eaa9ab..27a8cc6c 100644 --- a/modules/preprocs/nasm/nasm-pp.c +++ b/modules/preprocs/nasm/nasm-pp.c @@ -366,7 +366,7 @@ static ListGen *list; * FIXME: We should *really* be able to configure this at run time, * or even have the hash table automatically expanding when necessary. */ -#define NHASH 31 +#define NHASH 4096 /* * The current set of multi-line macros we have defined. From 1a0c61d29e0a699dd216a34ee5e7228df765a8f0 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 14 Feb 2014 12:01:43 -0800 Subject: [PATCH 472/585] Add Intel SHA instructions. Contributed by: Mark Charney @ Intel --- modules/arch/x86/gen_x86_insn.py | 51 +++++++++++++++++++++++++++++++- modules/arch/x86/x86arch.h | 1 + modules/arch/x86/x86cpu.gperf | 2 ++ 3 files changed, 53 insertions(+), 1 deletion(-) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index ceed1840..c4aedf04 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -39,7 +39,7 @@ ordered_cpu_features = [ "SSE3", "SVM", "PadLock", "SSSE3", "SSE41", "SSE42", "SSE4a", "SSE5", "AVX", "FMA", "AES", "CLMUL", "MOVBE", "XOP", "FMA4", "F16C", "FSGSBASE", "RDRAND", "XSAVEOPT", "EPTVPID", "SMX", "AVX2", "BMI1", - "BMI2", "INVPCID", "LZCNT", "TBM", "TSX"] + "BMI2", "INVPCID", "LZCNT", "TBM", "TSX", "SHA"] unordered_cpu_features = ["Priv", "Prot", "Undoc", "Obs"] # Predefined VEX prefix field values @@ -8056,6 +8056,55 @@ add_group("invpcid", Operand(type="Mem", size=128, relaxed=True, dest="EA")]) add_insn("invpcid", "invpcid") + +##################################################################### +add_group("intel_SHA1MSG1", + cpu=["SHA"], + opcode=[0x0F, 0x38, 0xC9], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, dest="EA", relaxed=True)]) +add_group("intel_SHA1MSG2", + cpu=["SHA"], + opcode=[0x0F, 0x38, 0xCA], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, dest="EA", relaxed=True)]) +add_group("intel_SHA1NEXTE", + cpu=["SHA"], + opcode=[0x0F, 0x38, 0xC8], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, dest="EA", relaxed=True)]) +add_group("intel_SHA1RNDS4", + cpu=["SHA"], + opcode=[0x0F, 0x3A, 0xCC], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, dest="EA", relaxed=True), + Operand(type="Imm", size=8, dest="Imm", relaxed=True)]) +add_group("intel_SHA256MSG1", + cpu=["SHA"], + opcode=[0x0F, 0x38, 0xCC], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, dest="EA", relaxed=True)]) +add_group("intel_SHA256MSG2", + cpu=["SHA"], + opcode=[0x0F, 0x38, 0xCD], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDRM", size=128, dest="EA", relaxed=True)]) +add_group("intel_SHA256RNDS2", + cpu=["SHA"], + opcode=[0x0F, 0x38, 0xCB], + operands=[Operand(type="SIMDReg", size=128, dest="Spare"), + Operand(type="SIMDReg", size=128, dest="EA")]) + + +add_insn("SHA1MSG1", "intel_SHA1MSG1") +add_insn("SHA1MSG2", "intel_SHA1MSG2") +add_insn("SHA1NEXTE", "intel_SHA1NEXTE") +add_insn("SHA1RNDS4", "intel_SHA1RNDS4") +add_insn("SHA256MSG1", "intel_SHA256MSG1") +add_insn("SHA256MSG2", "intel_SHA256MSG2") +add_insn("SHA256RNDS2", "intel_SHA256RNDS2") + + ##################################################################### # AMD trailing bit manipulation (TBM) ##################################################################### diff --git a/modules/arch/x86/x86arch.h b/modules/arch/x86/x86arch.h index 14b2b2e3..7ad10466 100644 --- a/modules/arch/x86/x86arch.h +++ b/modules/arch/x86/x86arch.h @@ -85,6 +85,7 @@ #define CPU_LZCNT 51 /* Intel LZCNT instruction */ #define CPU_TBM 52 /* AMD TBM instruction */ #define CPU_TSX 53 /* Intel TSX instructions */ +#define CPU_SHA 54 /* Intel SHA instructions */ enum x86_parser_type { X86_PARSER_NASM = 0, diff --git a/modules/arch/x86/x86cpu.gperf b/modules/arch/x86/x86cpu.gperf index 3d495746..d6808660 100644 --- a/modules/arch/x86/x86cpu.gperf +++ b/modules/arch/x86/x86cpu.gperf @@ -402,6 +402,8 @@ lzcnt, x86_cpu_set, CPU_LZCNT nolzcnt, x86_cpu_clear, CPU_LZCNT tbm, x86_cpu_set, CPU_TBM notbm, x86_cpu_clear, CPU_TBM +sha, x86_cpu_set, CPU_SHA +nosha, x86_cpu_clear, CPU_SHA # Change NOP patterns basicnop, x86_nop, X86_NOP_BASIC intelnop, x86_nop, X86_NOP_INTEL From 0ca0ffc65f553f8d6e52fe203e4621a07c9b1506 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 5 Apr 2014 00:17:13 -0700 Subject: [PATCH 473/585] Add Intel ADX, RDSEED, and SMAP instructions. --- modules/arch/x86/gen_x86_insn.py | 46 ++++++++++++++++------ modules/arch/x86/tests/adx.asm | 10 +++++ modules/arch/x86/tests/adx.hex | 64 +++++++++++++++++++++++++++++++ modules/arch/x86/tests/rdrand.asm | 4 ++ modules/arch/x86/tests/rdrand.hex | 11 ++++++ modules/arch/x86/tests/rdseed.asm | 4 ++ modules/arch/x86/tests/rdseed.hex | 11 ++++++ modules/arch/x86/tests/smap.asm | 2 + modules/arch/x86/tests/smap.hex | 6 +++ modules/arch/x86/x86arch.h | 4 ++ modules/arch/x86/x86cpu.gperf | 8 ++++ 11 files changed, 158 insertions(+), 12 deletions(-) create mode 100644 modules/arch/x86/tests/adx.asm create mode 100644 modules/arch/x86/tests/adx.hex create mode 100644 modules/arch/x86/tests/rdrand.asm create mode 100644 modules/arch/x86/tests/rdrand.hex create mode 100644 modules/arch/x86/tests/rdseed.asm create mode 100644 modules/arch/x86/tests/rdseed.hex create mode 100644 modules/arch/x86/tests/smap.asm create mode 100644 modules/arch/x86/tests/smap.hex diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index c4aedf04..88972b01 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -39,7 +39,8 @@ ordered_cpu_features = [ "SSE3", "SVM", "PadLock", "SSSE3", "SSE41", "SSE42", "SSE4a", "SSE5", "AVX", "FMA", "AES", "CLMUL", "MOVBE", "XOP", "FMA4", "F16C", "FSGSBASE", "RDRAND", "XSAVEOPT", "EPTVPID", "SMX", "AVX2", "BMI1", - "BMI2", "INVPCID", "LZCNT", "TBM", "TSX", "SHA"] + "BMI2", "INVPCID", "LZCNT", "TBM", "TSX", "SHA", "SMAP", "RDSEED", "ADX", + "PRFCHW"] unordered_cpu_features = ["Priv", "Prot", "Undoc", "Obs"] # Predefined VEX prefix field values @@ -7371,25 +7372,23 @@ for comb, combval in zip(["lql","hql","lqh","hqh"], [0x00,0x01,0x10,0x11]): # RDRAND add_group("rdrand", - cpu=["RDRAND"], + modifiers=['SpAdd'], opersize=16, opcode=[0x0F, 0xC7], - spare=6, operands=[Operand(type="Reg", size=16, dest="EA")]) add_group("rdrand", #suffix="l", - cpu=["RDRAND"], + modifiers=['SpAdd'], opersize=32, opcode=[0x0F, 0xC7], - spare=6, operands=[Operand(type="Reg", size=32, dest="EA")]) add_group("rdrand", - cpu=["RDRAND"], + modifiers=['SpAdd'], opersize=64, opcode=[0x0F, 0xC7], - spare=6, operands=[Operand(type="Reg", size=64, dest="EA")]) -add_insn("rdrand", "rdrand") +add_insn("rdrand", "rdrand", modifiers=[6], cpu=["RDRAND"]) +add_insn("rdseed", "rdrand", modifiers=[7], cpu=["RDSEED"]) # FSGSBASE instructions add_group("fs_gs_base", @@ -7932,7 +7931,7 @@ add_insn("movbe", "movbe") add_insn("tzcnt", "cnt", modifiers=[0xBC], cpu=["BMI1"]) # LZCNT is present as AMD ext -for sfx, sz in zip("wlq", [32, 64]): +for sfx, sz in zip("lq", [32, 64]): add_group("vex_gpr_ndd_rm_0F38_regext", suffix=sfx, modifiers=["PreAdd", "Op2Add", "SpAdd" ], @@ -7951,7 +7950,7 @@ add_insn("blsmsk", "vex_gpr_ndd_rm_0F38_regext", modifiers=[0x00, 0xF3, 2], add_insn("blsi", "vex_gpr_ndd_rm_0F38_regext", modifiers=[0x00, 0xF3, 3], cpu=["BMI1"]) -for sfx, sz in zip("wlq", [32, 64]): +for sfx, sz in zip("lq", [32, 64]): add_group("vex_gpr_reg_rm_0F_imm8", suffix=sfx, modifiers=["PreAdd", "Op1Add", "Op2Add"], @@ -8057,6 +8056,8 @@ add_group("invpcid", add_insn("invpcid", "invpcid") +##################################################################### +# Intel SHA instructions ##################################################################### add_group("intel_SHA1MSG1", cpu=["SHA"], @@ -8095,7 +8096,6 @@ add_group("intel_SHA256RNDS2", operands=[Operand(type="SIMDReg", size=128, dest="Spare"), Operand(type="SIMDReg", size=128, dest="EA")]) - add_insn("SHA1MSG1", "intel_SHA1MSG1") add_insn("SHA1MSG2", "intel_SHA1MSG2") add_insn("SHA1NEXTE", "intel_SHA1NEXTE") @@ -8104,6 +8104,28 @@ add_insn("SHA256MSG1", "intel_SHA256MSG1") add_insn("SHA256MSG2", "intel_SHA256MSG2") add_insn("SHA256RNDS2", "intel_SHA256RNDS2") +##################################################################### +# Intel SMAP instructions +##################################################################### +add_insn("clac", "threebyte", modifiers=[0x0F, 0x01, 0xCA], cpu=["SMAP"]) +add_insn("stac", "threebyte", modifiers=[0x0F, 0x01, 0xCB], cpu=["SMAP"]) + +##################################################################### +# Intel ADX instructions +##################################################################### +for sfx, sz in zip("lq", [32, 64]): + add_group("vex_gpr_ndd_rm_0F38", + suffix=sfx, + modifiers=["PreAdd", "Op2Add"], + opersize=sz, + prefix=0x00, + opcode=[0x0F, 0x38, 0x00], + operands=[Operand(type="Reg", size=sz, dest="Spare"), + Operand(type="RM", size=sz, relaxed=True, dest="EA")]) + +add_insn("adcx", "vex_gpr_ndd_rm_0F38", modifiers=[0x66, 0xF6], cpu=["ADX"]) +add_insn("adox", "vex_gpr_ndd_rm_0F38", modifiers=[0xF3, 0xF6], cpu=["ADX"]) + ##################################################################### # AMD trailing bit manipulation (TBM) @@ -8137,7 +8159,7 @@ add_insn("tzmsk", "xop_gpr_reg_rm_09", modifiers=[0x01, 4]) ##################################################################### add_insn("prefetch", "twobytemem", modifiers=[0x00, 0x0F, 0x0D], cpu=["3DNow"]) -add_insn("prefetchw", "twobytemem", modifiers=[0x01, 0x0F, 0x0D], cpu=["3DNow"]) +add_insn("prefetchw", "twobytemem", modifiers=[0x01, 0x0F, 0x0D], cpu=["PRFCHW"]) add_insn("femms", "twobyte", modifiers=[0x0F, 0x0E], cpu=["3DNow"]) add_group("now3d", diff --git a/modules/arch/x86/tests/adx.asm b/modules/arch/x86/tests/adx.asm new file mode 100644 index 00000000..3feb88e0 --- /dev/null +++ b/modules/arch/x86/tests/adx.asm @@ -0,0 +1,10 @@ +[bits 64] +adcx eax, ebx +adcx ebx, [0] +adcx rax, rbx +adcx rbx, [0] + +adox eax, ebx +adox ebx, [0] +adox rax, rbx +adox rbx, [0] diff --git a/modules/arch/x86/tests/adx.hex b/modules/arch/x86/tests/adx.hex new file mode 100644 index 00000000..f6188af3 --- /dev/null +++ b/modules/arch/x86/tests/adx.hex @@ -0,0 +1,64 @@ +66 +0f +38 +f6 +c3 +66 +0f +38 +f6 +1c +25 +00 +00 +00 +00 +66 +48 +0f +38 +f6 +c3 +66 +48 +0f +38 +f6 +1c +25 +00 +00 +00 +00 +f3 +0f +38 +f6 +c3 +f3 +0f +38 +f6 +1c +25 +00 +00 +00 +00 +f3 +48 +0f +38 +f6 +c3 +f3 +48 +0f +38 +f6 +1c +25 +00 +00 +00 +00 diff --git a/modules/arch/x86/tests/rdrand.asm b/modules/arch/x86/tests/rdrand.asm new file mode 100644 index 00000000..20ade23f --- /dev/null +++ b/modules/arch/x86/tests/rdrand.asm @@ -0,0 +1,4 @@ +[bits 64] +rdrand bx +rdrand ebx +rdrand rbx diff --git a/modules/arch/x86/tests/rdrand.hex b/modules/arch/x86/tests/rdrand.hex new file mode 100644 index 00000000..25ac57c4 --- /dev/null +++ b/modules/arch/x86/tests/rdrand.hex @@ -0,0 +1,11 @@ +66 +0f +c7 +f3 +0f +c7 +f3 +48 +0f +c7 +f3 diff --git a/modules/arch/x86/tests/rdseed.asm b/modules/arch/x86/tests/rdseed.asm new file mode 100644 index 00000000..42fff846 --- /dev/null +++ b/modules/arch/x86/tests/rdseed.asm @@ -0,0 +1,4 @@ +[bits 64] +rdseed bx +rdseed ebx +rdseed rbx diff --git a/modules/arch/x86/tests/rdseed.hex b/modules/arch/x86/tests/rdseed.hex new file mode 100644 index 00000000..03f4fbd3 --- /dev/null +++ b/modules/arch/x86/tests/rdseed.hex @@ -0,0 +1,11 @@ +66 +0f +c7 +fb +0f +c7 +fb +48 +0f +c7 +fb diff --git a/modules/arch/x86/tests/smap.asm b/modules/arch/x86/tests/smap.asm new file mode 100644 index 00000000..702bc810 --- /dev/null +++ b/modules/arch/x86/tests/smap.asm @@ -0,0 +1,2 @@ +clac +stac diff --git a/modules/arch/x86/tests/smap.hex b/modules/arch/x86/tests/smap.hex new file mode 100644 index 00000000..a1034059 --- /dev/null +++ b/modules/arch/x86/tests/smap.hex @@ -0,0 +1,6 @@ +0f +01 +ca +0f +01 +cb diff --git a/modules/arch/x86/x86arch.h b/modules/arch/x86/x86arch.h index 7ad10466..78c3d739 100644 --- a/modules/arch/x86/x86arch.h +++ b/modules/arch/x86/x86arch.h @@ -86,6 +86,10 @@ #define CPU_TBM 52 /* AMD TBM instruction */ #define CPU_TSX 53 /* Intel TSX instructions */ #define CPU_SHA 54 /* Intel SHA instructions */ +#define CPU_SMAP 55 /* Intel SMAP instructions */ +#define CPU_RDSEED 56 /* Intel RDSEED instruction */ +#define CPU_ADX 57 /* Intel ADCX and ADOX instructions */ +#define CPU_PRFCHW 58 /* Intel/AMD PREFETCHW instruction */ enum x86_parser_type { X86_PARSER_NASM = 0, diff --git a/modules/arch/x86/x86cpu.gperf b/modules/arch/x86/x86cpu.gperf index d6808660..4d7d5e52 100644 --- a/modules/arch/x86/x86cpu.gperf +++ b/modules/arch/x86/x86cpu.gperf @@ -404,6 +404,14 @@ tbm, x86_cpu_set, CPU_TBM notbm, x86_cpu_clear, CPU_TBM sha, x86_cpu_set, CPU_SHA nosha, x86_cpu_clear, CPU_SHA +smap, x86_cpu_set, CPU_SMAP +nosmap, x86_cpu_clear, CPU_SMAP +rdseed, x86_cpu_set, CPU_RDSEED +nordseed, x86_cpu_clear, CPU_RDSEED +adx, x86_cpu_set, CPU_ADX +noadx, x86_cpu_clear, CPU_ADX +prfchw, x86_cpu_set, CPU_PRFCHW +noprfchw, x86_cpu_clear, CPU_PRFCHW # Change NOP patterns basicnop, x86_nop, X86_NOP_BASIC intelnop, x86_nop, X86_NOP_INTEL From 047c49b5422e4330ce36244c9819887cd098b380 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 5 Apr 2014 23:34:27 -0700 Subject: [PATCH 474/585] Add cpu ivybridge, haswell, broadwell, skylake. --- modules/arch/x86/x86cpu.gperf | 41 ++++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/modules/arch/x86/x86cpu.gperf b/modules/arch/x86/x86cpu.gperf index 4d7d5e52..334ea1c8 100644 --- a/modules/arch/x86/x86cpu.gperf +++ b/modules/arch/x86/x86cpu.gperf @@ -46,8 +46,12 @@ #define PROC_conroe 11 #define PROC_penryn 12 #define PROC_nehalem 13 -#define PROC_westmere 14 -#define PROC_sandybridge 15 +#define PROC_westmere 14 +#define PROC_sandybridge 15 +#define PROC_ivybridge 16 +#define PROC_haswell 17 +#define PROC_broadwell 18 +#define PROC_skylake 19 static void x86_cpu_intel(wordptr cpu, yasm_arch_x86 *arch_x86, unsigned int data) @@ -59,8 +63,35 @@ x86_cpu_intel(wordptr cpu, yasm_arch_x86 *arch_x86, unsigned int data) BitVector_Bit_On(cpu, CPU_Prot); if (data >= PROC_386) BitVector_Bit_On(cpu, CPU_SMM); - if (data >= PROC_sandybridge) + if (data >= PROC_skylake) { + BitVector_Bit_On(cpu, CPU_SHA); + } + if (data >= PROC_broadwell) { + BitVector_Bit_On(cpu, CPU_RDSEED); + BitVector_Bit_On(cpu, CPU_ADX); + BitVector_Bit_On(cpu, CPU_PRFCHW); + } + if (data >= PROC_haswell) { + BitVector_Bit_On(cpu, CPU_FMA); + BitVector_Bit_On(cpu, CPU_AVX2); + BitVector_Bit_On(cpu, CPU_BMI1); + BitVector_Bit_On(cpu, CPU_BMI2); + BitVector_Bit_On(cpu, CPU_INVPCID); + BitVector_Bit_On(cpu, CPU_LZCNT); + BitVector_Bit_On(cpu, CPU_TSX); + BitVector_Bit_On(cpu, CPU_SMAP); + } + if (data >= PROC_ivybridge) { + BitVector_Bit_On(cpu, CPU_F16C); + BitVector_Bit_On(cpu, CPU_FSGSBASE); + BitVector_Bit_On(cpu, CPU_RDRAND); + } + if (data >= PROC_sandybridge) { BitVector_Bit_On(cpu, CPU_AVX); + BitVector_Bit_On(cpu, CPU_XSAVEOPT); + BitVector_Bit_On(cpu, CPU_EPTVPID); + BitVector_Bit_On(cpu, CPU_SMX); + } if (data >= PROC_westmere) { BitVector_Bit_On(cpu, CPU_AES); BitVector_Bit_On(cpu, CPU_CLMUL); @@ -298,6 +329,10 @@ nehalem, x86_cpu_intel, PROC_nehalem corei7, x86_cpu_intel, PROC_nehalem westmere, x86_cpu_intel, PROC_westmere sandybridge, x86_cpu_intel, PROC_sandybridge +ivybridge, x86_cpu_intel, PROC_ivybridge +haswell, x86_cpu_intel, PROC_haswell +broadwell, x86_cpu_intel, PROC_broadwell +skylake, x86_cpu_intel, PROC_skylake # # Features have "no" versions to disable them, and only set/reset the # specific feature being changed. All other bits are left alone. From ab2cf05d1d8ba065463f81d8ec3b0bfde0c1e39a Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Sun, 6 Apr 2014 08:35:10 +0100 Subject: [PATCH 475/585] Add Visual Studio 2013 build files --- .gitignore | 1 + Mkfiles/vc12/config.h | 170 ++++++++++ Mkfiles/vc12/crt_secure_no_deprecate.props | 11 + Mkfiles/vc12/crt_secure_no_deprecate.vsprops | 11 + Mkfiles/vc12/libyasm/libyasm.vcxproj | 277 ++++++++++++++++ Mkfiles/vc12/libyasm/libyasm.vcxproj.filters | 200 ++++++++++++ Mkfiles/vc12/modules/modules.vcxproj | 324 +++++++++++++++++++ Mkfiles/vc12/modules/modules.vcxproj.filters | 256 +++++++++++++++ Mkfiles/vc12/out_copy_rename.bat | 42 +++ Mkfiles/vc12/readme.vc10.txt | 106 ++++++ Mkfiles/vc12/vsyasm.props | 27 ++ Mkfiles/vc12/vsyasm.targets | 108 +++++++ Mkfiles/vc12/vsyasm.vcxproj | 279 ++++++++++++++++ Mkfiles/vc12/vsyasm.xml | 283 ++++++++++++++++ Mkfiles/vc12/yasm.sln | 142 ++++++++ Mkfiles/vc12/yasm.vcxproj | 283 ++++++++++++++++ Mkfiles/vc12/yasm.vcxproj.filters | 41 +++ Mkfiles/vc12/ytasm.vcxproj | 278 ++++++++++++++++ 18 files changed, 2839 insertions(+) create mode 100644 Mkfiles/vc12/config.h create mode 100644 Mkfiles/vc12/crt_secure_no_deprecate.props create mode 100644 Mkfiles/vc12/crt_secure_no_deprecate.vsprops create mode 100644 Mkfiles/vc12/libyasm/libyasm.vcxproj create mode 100644 Mkfiles/vc12/libyasm/libyasm.vcxproj.filters create mode 100644 Mkfiles/vc12/modules/modules.vcxproj create mode 100644 Mkfiles/vc12/modules/modules.vcxproj.filters create mode 100644 Mkfiles/vc12/out_copy_rename.bat create mode 100644 Mkfiles/vc12/readme.vc10.txt create mode 100644 Mkfiles/vc12/vsyasm.props create mode 100644 Mkfiles/vc12/vsyasm.targets create mode 100644 Mkfiles/vc12/vsyasm.vcxproj create mode 100644 Mkfiles/vc12/vsyasm.xml create mode 100644 Mkfiles/vc12/yasm.sln create mode 100644 Mkfiles/vc12/yasm.vcxproj create mode 100644 Mkfiles/vc12/yasm.vcxproj.filters create mode 100644 Mkfiles/vc12/ytasm.vcxproj diff --git a/.gitignore b/.gitignore index 5cb5fefc..792809fe 100644 --- a/.gitignore +++ b/.gitignore @@ -66,3 +66,4 @@ YASM-VERSION.h .sw* ./*.s ./*.asm +x64 diff --git a/Mkfiles/vc12/config.h b/Mkfiles/vc12/config.h new file mode 100644 index 00000000..8515ac5a --- /dev/null +++ b/Mkfiles/vc12/config.h @@ -0,0 +1,170 @@ +#include "YASM-VERSION.h" +#define yasm__splitpath(path, tail) yasm__splitpath_win(path, tail) +#define yasm__abspath(path) yasm__abspath_win(path) +#define yasm__combpath(from, to) yasm__combpath_win(from, to) + +/* Command name to run C preprocessor */ +#define CPP_PROG "cpp" + +/* */ +/* #undef ENABLE_NLS */ + +/* Define if you have the `abort' function. */ +#define HAVE_ABORT 1 + +/* */ +/* #undef HAVE_CATGETS */ + +/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYCURRENT */ + +/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +/* #undef HAVE_DCGETTEXT */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DIRECT_H 1 + +/* Define to 1 if you have the `getcwd' function. */ +#define HAVE_GETCWD 1 + +/* */ +/* #undef HAVE_GETTEXT */ + +/* Define if you have the GNU C Library */ +/* #undef HAVE_GNU_C_LIBRARY */ + +/* Define if you have the iconv() function. */ +/* #undef HAVE_ICONV */ + +/* Define if you have the header file. */ +/* #undef HAVE_INTTYPES_H */ + +/* */ +/* #undef HAVE_LC_MESSAGES */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LIBGEN_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_MEMORY_H */ + +/* Define if you have the `mergesort' function. */ +/* #undef HAVE_MERGESORT */ + +/* Define to 1 if you have the `popen' function. */ +/* #undef HAVE_POPEN */ + +/* Define if you have the header file. */ +/* #undef HAVE_STDINT_H */ + +/* Define if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* */ +/* #undef HAVE_STPCPY */ + +/* Define if you have the `strcasecmp' function. */ +/* #undef HAVE_STRCASECMP */ + +/* Define if you have the `strcmpi' function. */ +/* #undef HAVE_STRCMPI */ + +/* Define if you have the `stricmp' function. */ +/* #undefine HAVE_STRICMP */ + +/* Define if you have the header file. */ +/* #undef HAVE_STRINGS_H */ + +/* Define if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define if you have the `strncasecmp' function. */ +/* #undef HAVE_STRNCASECMP */ + +/* Define if you have the `strsep' function. */ +/* #undef HAVE_STRSEP */ + +/* Define if you have the header file. */ +/* #undef HAVE_SYS_STAT_H */ + +/* Define if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define if you have the `toascii' function. */ +#define HAVE_TOASCII 1 +#define toascii __toascii + +/* Define if you have the header file. */ +/* #undef HAVE_UNISTD_H */ + +/* Define to 1 if you have the `vsnprintf' function. */ +/* #undef HAVE_VSNPRINTF */ + +/* Define to 1 if you have the `_stricmp' function. */ +#define HAVE__STRICMP 1 + +/* Name of package */ +#define PACKAGE "yasm" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "bug-yasm@tortall.net" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "yasm" + +/* Define to the full name and version of this package. */ +/*#define PACKAGE_STRING "yasm HEAD"*/ + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "yasm" + +/* Define to the version of this package. */ +/*#define PACKAGE_VERSION "HEAD"*/ + +/* Define if the C compiler supports function prototypes. */ +#define PROTOTYPES 1 + +/* The size of a `char', as computed by sizeof. */ +/* #undef SIZEOF_CHAR */ + +/* The size of a `int', as computed by sizeof. */ +/* #undef SIZEOF_INT */ + +/* The size of a `long', as computed by sizeof. */ +/* #undef SIZEOF_LONG */ + +/* The size of a `short', as computed by sizeof. */ +/* #undef SIZEOF_SHORT */ + +/* The size of a `void*', as computed by sizeof. */ +/* #undef SIZEOF_VOIDP */ + +/* Define if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Version number of package */ +#define VERSION "HEAD" + +/* Define if using the dmalloc debugging malloc package */ +/* #undef WITH_DMALLOC */ + +/* Define like PROTOTYPES; this can be used by system headers. */ +#define __PROTOTYPES 1 + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define as `__inline' if that's what the C compiler calls it, or to nothing + if it is not supported. */ +#ifndef __cplusplus +/* #undef inline */ +#endif + +/* Define to `unsigned' if doesn't define. */ +/* #undef size_t */ diff --git a/Mkfiles/vc12/crt_secure_no_deprecate.props b/Mkfiles/vc12/crt_secure_no_deprecate.props new file mode 100644 index 00000000..777d6d0a --- /dev/null +++ b/Mkfiles/vc12/crt_secure_no_deprecate.props @@ -0,0 +1,11 @@ + + + + <_ProjectFileVersion>10.0.21006.1 + + + + _CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + + + \ No newline at end of file diff --git a/Mkfiles/vc12/crt_secure_no_deprecate.vsprops b/Mkfiles/vc12/crt_secure_no_deprecate.vsprops new file mode 100644 index 00000000..56ab506f --- /dev/null +++ b/Mkfiles/vc12/crt_secure_no_deprecate.vsprops @@ -0,0 +1,11 @@ + + + + diff --git a/Mkfiles/vc12/libyasm/libyasm.vcxproj b/Mkfiles/vc12/libyasm/libyasm.vcxproj new file mode 100644 index 00000000..f258e027 --- /dev/null +++ b/Mkfiles/vc12/libyasm/libyasm.vcxproj @@ -0,0 +1,277 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {29FE7874-1256-4AD6-B889-68E399DC9608} + libyasm + + + + StaticLibrary + false + MultiByte + v120 + + + StaticLibrary + false + MultiByte + v120 + + + StaticLibrary + false + MultiByte + v120 + + + StaticLibrary + false + MultiByte + v120 + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + + + + Full + Default + ..;../../..;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)libyasm.lib + true + + + + + X64 + + + Full + Default + ..;../../..;%(AdditionalIncludeDirectories) + NDEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)libyasm.lib + true + + + + + Disabled + ..;../../..;%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)libyasm.lib + true + + + + + X64 + + + Disabled + ..;../../..;%(AdditionalIncludeDirectories) + _DEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)libyasm.lib + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {f0e8b707-00c5-4ff2-b8ef-7c39817132a0} + false + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc12/libyasm/libyasm.vcxproj.filters b/Mkfiles/vc12/libyasm/libyasm.vcxproj.filters new file mode 100644 index 00000000..9bdf13a4 --- /dev/null +++ b/Mkfiles/vc12/libyasm/libyasm.vcxproj.filters @@ -0,0 +1,200 @@ + + + + + {4ca3b698-9d01-4e4e-ae00-5c98da045efe} + h;hpp;hxx;hm;inl + + + {68607062-982d-4251-9a1a-30f76474983d} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Source Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc12/modules/modules.vcxproj b/Mkfiles/vc12/modules/modules.vcxproj new file mode 100644 index 00000000..1385bb61 --- /dev/null +++ b/Mkfiles/vc12/modules/modules.vcxproj @@ -0,0 +1,324 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6} + modules + + + + StaticLibrary + false + MultiByte + v120 + + + StaticLibrary + false + MultiByte + v120 + + + StaticLibrary + false + MultiByte + v120 + + + StaticLibrary + false + MultiByte + v120 + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + + + + Full + Default + ..;../../..;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)modules.lib + true + + + + + + + + + X64 + + + Full + Default + ..;../../..;%(AdditionalIncludeDirectories) + NDEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)modules.lib + true + + + + + Disabled + ..;../../..;%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)modules.lib + true + + + + + X64 + + + Disabled + ..;../../..;%(AdditionalIncludeDirectories) + _DEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)modules.lib + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {225700a5-07b8-434e-ad61-555278bf6733} + false + + + {c45a8b59-8b59-4d5d-a8e8-fb090f8dd619} + false + + + {29fe7874-1256-4ad6-b889-68e399dc9608} + false + + + {3c58be13-50a3-4583-984d-d8902b3d7713} + false + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc12/modules/modules.vcxproj.filters b/Mkfiles/vc12/modules/modules.vcxproj.filters new file mode 100644 index 00000000..e6ff3add --- /dev/null +++ b/Mkfiles/vc12/modules/modules.vcxproj.filters @@ -0,0 +1,256 @@ + + + + + {39c89f91-d860-4396-a49f-86b8b7a51c33} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {be0cdf28-cbed-4774-b3cc-b63e4e3fa0a9} + + + {491cc60a-889b-4f53-aae9-f4d7d6aa667a} + + + {c084015d-3c3e-4379-8746-ae5cffcec79e} + + + {3333e0b3-e95f-44f6-9000-58d4da368360} + + + {528f2955-ceba-4691-a36c-054f119e3dcc} + + + {81686d52-eb71-4d4a-a830-66c45afb808f} + + + {98fe1e43-3794-4639-bf29-14b0c569754f} + + + {6b3956d4-0bff-4e8e-af61-a7e59b476fa4} + + + {446fad62-ac17-49e9-8263-33481f04f182} + + + {33fb7fc8-61f9-428d-9c94-7a4912fbb678} + + + {48fc77ec-7d78-4c0a-bfc2-9aa76faf5d7f} + + + + + Source Files\parsers + + + Source Files\arch + + + Source Files\arch + + + Source Files\arch + + + Source Files\arch + + + Source Files\arch + + + Source Files\arch + + + Source Files\arch + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\listfmts\nasm + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\parsers + + + Source Files\parsers + + + Source Files\parsers + + + Source Files\parsers + + + Source Files\parsers + + + Source Files\preprocs\cpp + + + Source Files\preprocs\gas + + + Source Files\preprocs\gas + + + Source Files\preprocs\nasm + + + Source Files\preprocs\nasm + + + Source Files\preprocs\nasm + + + Source Files\preprocs\nasm + + + Source Files\preprocs\raw + + + Source Files\parsers + + + Source Files\arch + + + Source Files\arch + + + Source Files\objfmts + + + + + Source Files\arch + + + Source Files\arch + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\parsers + + + Source Files\parsers + + + Source Files\preprocs\gas + + + Source Files\preprocs\nasm + + + Source Files\preprocs\nasm + + + Source Files\preprocs\nasm + + + Source Files\preprocs\nasm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc12/out_copy_rename.bat b/Mkfiles/vc12/out_copy_rename.bat new file mode 100644 index 00000000..3179b59a --- /dev/null +++ b/Mkfiles/vc12/out_copy_rename.bat @@ -0,0 +1,42 @@ +@echo off +if not exist %1 goto nofile +if exist %2 goto copy + +echo creating directory %2 +md %2 > nul + +:copy +set str=%2 +for /f "useback tokens=*" %%a in ('%str%') do set str=%%~a +set str=%str:~-1% +if %str% == "\" goto hasbackslash + +if not exist %2\%3 goto cpy +fc %1 %2\%3 > nul && if not %errorlevel 1 goto exit +echo overwriting %2\%3 with %1 +copy %1 %2\%3 > nul +goto exit + +:cpy +echo copying %1 to %2\%3 +copy %1 %2\%3 > nul +goto exit + +:hasbackslash +if not exist %2%3 goto cpy2 +fc %1 %2%3 > nul && if not %errorlevel 1 goto exit +echo overwriting %2%3 with %1 +copy %1 %2%3 > nul +goto exit + +:cpy2 +echo copying %1 to %2%3 +copy %1 %2%3 > nul +goto exit + +:nofile +echo %1 not found + +:exit + + diff --git a/Mkfiles/vc12/readme.vc10.txt b/Mkfiles/vc12/readme.vc10.txt new file mode 100644 index 00000000..10c84f1a --- /dev/null +++ b/Mkfiles/vc12/readme.vc10.txt @@ -0,0 +1,106 @@ +Building YASM with Microsoft Visual Studio 2010 (C/C++ v10) +----------------------------------------------------------- + +This note describes how to build YASM using Microsoft Visual +Studio 2013 (C/C++ v12). + +1. YASM Download +---------------- + +First YASM needs to be downloaded and the files placed within +a suitable directory, which will be called here but can +be named and located as you wish. + +2. Building YASM with Microsoft 2013 (VC12) +------------------------------------------- + +Now locate and double click on the yasm.sln solution file in +the 'Mkfiles/vc12' subdirectory to open the build project in +the Visual Studio 2010 IDE and then select: + + win32 or x64 build + release or debug build + +as appropriate to build the YASM binaries that you need. + +4. Using YASM with Visual Sudio 2013 and VC++ version 12 +-------------------------------------------------------- + +The YASM version vsyasm.exe is designed specifically for use +with the 2010 and later versions of Visual Studio. To tell +Visual Studio where to find vsyasm.exe, the environment +variable YASMPATH can be set to the absolute path of the +directory in which vsyasm.exe is located (this path should +include the final backslash). + +Alternatively you can find the directory (or directories) +where the VC++ compiler binaries are located and put copies +of the vsyasm.exe binary in these directories. The typical +location on 64-bit Windows is: + +C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin + +On 32-bit Windows it is normally at: + +C:\Program Files\Microsoft Visual Studio 12.0\VC\bin + +Depending on your system you can use either the win32 or the +x64 version of vsyasm.exe, which must be named vsyasm.exe. + +To use the new custom tools facility in Visual Studio 2010, you +need to place a copy of three files - yasm.props, yasm.targets +and yasm.xml - into a location where they can be found by the +Visual Studio build customisation processes. There are several +ways to do this: + + a. put these files in the MSBUILD customisation directory, + which is typically at: + + C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\BuildCustomizations + + b. put them in a convenient location and set this path in the + 'Build Customisations Search Path' in the Visual Studio + 'Projects and Solutions|VC++ Project Settings' item in + the 'Tools|Options' menu; + + c. put them in a convenient location and set this path in the + 'Build Customisation dialogue (discussed later). + +To use YASM in a project, right click on the project in the Solution +Explorer and select 'Build Customisations..'. This will give you a +dialog box that allows you to select YASM as an assembler (note that +your assembler files need to have the extension '.asm'). If you have +used option c. above, you will need to let the dialogue find them +using the 'Find Existing' button below the dialogue. + +To assemble a file with YASM, select the Property Page for the file +and the select 'Yasm Assembler' in the Tool dialog entry. Then click +'Apply' and an additional property page entry will appear and enable +YASM settings to be established. + +5. A Linker Issue +----------------- + +There appears to be a linker bug in the VC++ linker that prevents +symbols with absolute addresses being linked in DLL builds. This +means, for example, that LEA instructions of the general form: + + lea, rax,[rax+symbol] + +cannot be used for DLL builds. The following general form +has to be used instead: + + lea rcx,[symbol wrt rip] + lea rax,[rax+rcx] + +This limitation may also cause problems with other instruction +that use absolute addresses. + +6. Acknowledgements +------------------- + +I am most grateful for the fantastic support that Peter Johnson, +YASM's creator, has given me in tracking down issues in using +YASM for the production of Windows x64 code. + + Brian Gladman, 6th April 2013 diff --git a/Mkfiles/vc12/vsyasm.props b/Mkfiles/vc12/vsyasm.props new file mode 100644 index 00000000..80b93c7e --- /dev/null +++ b/Mkfiles/vc12/vsyasm.props @@ -0,0 +1,27 @@ + + + + Midl + CustomBuild + + + _SelectedFiles;$(YASMDependsOn) + + + $(VCInstallDir)bin\ + + + + False + $(IntDir) + 0 + 0 + "$(YasmPath)"vsyasm.exe -Xvc -f $(Platform) [AllOptions] [AdditionalOptions] [Inputs] + %(ObjectFile) + Assembling %(Filename)%(Extension) + false + + + \ No newline at end of file diff --git a/Mkfiles/vc12/vsyasm.targets b/Mkfiles/vc12/vsyasm.targets new file mode 100644 index 00000000..3c084119 --- /dev/null +++ b/Mkfiles/vc12/vsyasm.targets @@ -0,0 +1,108 @@ + + + + + + _YASM + + + + $(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml + + + + + + + + @(YASM, '|') + + + + + + + + + $(ComputeLinkInputsTargets); + ComputeYASMOutput; + + + $(ComputeLibInputsTargets); + ComputeYASMOutput; + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc12/vsyasm.vcxproj b/Mkfiles/vc12/vsyasm.vcxproj new file mode 100644 index 00000000..b34d8e66 --- /dev/null +++ b/Mkfiles/vc12/vsyasm.vcxproj @@ -0,0 +1,279 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {7FDD85BB-CC86-442B-A425-989B5B296ED5} + vsyasm + + + + Application + false + MultiByte + v120 + + + Application + false + MultiByte + v120 + + + Application + false + MultiByte + v120 + + + Application + false + MultiByte + v120 + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + + + + $(Platform)\$(Configuration)/yasm.tlb + + + + + Disabled + .;../..;%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)vsyasm.exe + true + true + $(OutDir)$(ProjectName).pdb + Console + false + + + MachineX86 + + + + + X64 + $(Platform)\$(Configuration)/yasm.tlb + + + + + Disabled + .;../..;%(AdditionalIncludeDirectories) + _DEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)vsyasm.exe + true + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX64 + + + + + $(Platform)\$(Configuration)/yasm.tlb + + + + + Full + Default + true + .;../..;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)vsyasm.exe + true + true + $(OutDir)$(ProjectName).pdb + Console + false + + + MachineX86 + + + + + X64 + $(Platform)\$(Configuration)/yasm.tlb + + + + + Full + OnlyExplicitInline + .;../..;%(AdditionalIncludeDirectories) + NDEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)vsyasm.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX64 + true + + + + + + + + + {29fe7874-1256-4ad6-b889-68e399dc9608} + false + + + {d715a3d4-efaa-442e-ad8b-5b4ff64e1dd6} + false + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc12/vsyasm.xml b/Mkfiles/vc12/vsyasm.xml new file mode 100644 index 00000000..cd08cbba --- /dev/null +++ b/Mkfiles/vc12/vsyasm.xml @@ -0,0 +1,283 @@ + + + + + + + + + + + + + General + + + + + + Symbols + + + + + + Files + + + + + + Command Line + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Execute Before + + + Specifies the targets for the build customization to run before. + + + + + + + + + + + + Execute After + + + Specifies the targets for the build customization to run after. + + + + + + + + + + + + + + + + + + Additional Options + + + Additional Options + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc12/yasm.sln b/Mkfiles/vc12/yasm.sln new file mode 100644 index 00000000..dec8fd47 --- /dev/null +++ b/Mkfiles/vc12/yasm.sln @@ -0,0 +1,142 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{825AC694-358C-4D8D-92DE-33A2691978CE}" + ProjectSection(SolutionItems) = preProject + crt_secure_no_deprecate.vsprops = crt_secure_no_deprecate.vsprops + readme.vc10.txt = readme.vc10.txt + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libyasm", "libyasm\libyasm.vcxproj", "{29FE7874-1256-4AD6-B889-68E399DC9608}" + ProjectSection(ProjectDependencies) = postProject + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2} = {B545983B-8EE0-4A7B-A67A-E749EEAE62A2} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "modules", "modules\modules.vcxproj", "{D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yasm", "yasm.vcxproj", "{34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genmacro", "genmacro\genmacro.vcxproj", "{225700A5-07B8-434E-AD61-555278BF6733}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genversion", "genversion\genversion.vcxproj", "{B545983B-8EE0-4A7B-A67A-E749EEAE62A2}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "re2c", "re2c\re2c.vcxproj", "{3C58BE13-50A3-4583-984D-D8902B3D7713}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genperf", "genperf\genperf.vcxproj", "{C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genmodule", "genmodule\genmodule.vcxproj", "{F0E8B707-00C5-4FF2-B8EF-7C39817132A0}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genstring", "genstring\genstring.vcxproj", "{021CEB0A-F721-4F59-B349-9CEEAF244459}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ytasm", "ytasm.vcxproj", "{2162937B-0DBD-4450-B45F-DF578D8E7508}" + ProjectSection(ProjectDependencies) = postProject + {021CEB0A-F721-4F59-B349-9CEEAF244459} = {021CEB0A-F721-4F59-B349-9CEEAF244459} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vsyasm", "vsyasm.vcxproj", "{7FDD85BB-CC86-442B-A425-989B5B296ED5}" + ProjectSection(ProjectDependencies) = postProject + {021CEB0A-F721-4F59-B349-9CEEAF244459} = {021CEB0A-F721-4F59-B349-9CEEAF244459} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|Win32.ActiveCfg = Debug|Win32 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|Win32.Build.0 = Debug|Win32 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|x64.ActiveCfg = Debug|x64 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|x64.Build.0 = Debug|x64 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|Win32.ActiveCfg = Release|Win32 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|Win32.Build.0 = Release|Win32 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|x64.ActiveCfg = Release|x64 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|x64.Build.0 = Release|x64 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|Win32.ActiveCfg = Debug|Win32 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|Win32.Build.0 = Debug|Win32 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|x64.ActiveCfg = Debug|x64 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|x64.Build.0 = Debug|x64 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|Win32.ActiveCfg = Release|Win32 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|Win32.Build.0 = Release|Win32 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|x64.ActiveCfg = Release|x64 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|x64.Build.0 = Release|x64 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|Win32.ActiveCfg = Debug|Win32 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|Win32.Build.0 = Debug|Win32 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|x64.ActiveCfg = Debug|x64 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|x64.Build.0 = Debug|x64 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|Win32.ActiveCfg = Release|Win32 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|Win32.Build.0 = Release|Win32 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|x64.ActiveCfg = Release|x64 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|x64.Build.0 = Release|x64 + {225700A5-07B8-434E-AD61-555278BF6733}.Debug|Win32.ActiveCfg = Debug|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Debug|Win32.Build.0 = Debug|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Debug|x64.ActiveCfg = Debug|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Debug|x64.Build.0 = Debug|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Release|Win32.ActiveCfg = Release|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Release|Win32.Build.0 = Release|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Release|x64.ActiveCfg = Release|x64 + {225700A5-07B8-434E-AD61-555278BF6733}.Release|x64.Build.0 = Release|x64 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|Win32.ActiveCfg = Debug|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|Win32.Build.0 = Debug|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|x64.ActiveCfg = Debug|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|x64.Build.0 = Debug|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|Win32.ActiveCfg = Release|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|Win32.Build.0 = Release|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|x64.ActiveCfg = Release|x64 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|x64.Build.0 = Release|x64 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|Win32.ActiveCfg = Debug|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|Win32.Build.0 = Debug|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|x64.ActiveCfg = Debug|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|x64.Build.0 = Debug|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|Win32.ActiveCfg = Release|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|Win32.Build.0 = Release|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|x64.ActiveCfg = Release|x64 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|x64.Build.0 = Release|x64 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|Win32.ActiveCfg = Debug|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|Win32.Build.0 = Debug|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|x64.ActiveCfg = Debug|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|x64.Build.0 = Debug|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|Win32.ActiveCfg = Release|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|Win32.Build.0 = Release|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|x64.ActiveCfg = Release|x64 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|x64.Build.0 = Release|x64 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|Win32.ActiveCfg = Debug|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|Win32.Build.0 = Debug|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|x64.ActiveCfg = Debug|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|x64.Build.0 = Debug|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|Win32.ActiveCfg = Release|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|Win32.Build.0 = Release|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|x64.ActiveCfg = Release|x64 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|x64.Build.0 = Release|x64 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|Win32.ActiveCfg = Debug|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|Win32.Build.0 = Debug|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|x64.ActiveCfg = Debug|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|x64.Build.0 = Debug|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|Win32.ActiveCfg = Release|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|Win32.Build.0 = Release|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|x64.ActiveCfg = Release|x64 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|x64.Build.0 = Release|x64 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|Win32.ActiveCfg = Debug|Win32 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|Win32.Build.0 = Debug|Win32 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|x64.ActiveCfg = Debug|x64 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|x64.Build.0 = Debug|x64 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|Win32.ActiveCfg = Release|Win32 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|Win32.Build.0 = Release|Win32 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|x64.ActiveCfg = Release|x64 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|x64.Build.0 = Release|x64 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|Win32.ActiveCfg = Debug|Win32 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|Win32.Build.0 = Debug|Win32 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|x64.ActiveCfg = Debug|x64 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|x64.Build.0 = Debug|x64 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|Win32.ActiveCfg = Release|Win32 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|Win32.Build.0 = Release|Win32 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|x64.ActiveCfg = Release|x64 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Mkfiles/vc12/yasm.vcxproj b/Mkfiles/vc12/yasm.vcxproj new file mode 100644 index 00000000..18672491 --- /dev/null +++ b/Mkfiles/vc12/yasm.vcxproj @@ -0,0 +1,283 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5} + yasm + + + + Application + false + MultiByte + v120 + + + Application + false + MultiByte + v120 + + + Application + false + MultiByte + v120 + + + Application + false + MultiByte + v120 + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + + + + $(Platform)\$(Configuration)/yasm.tlb + + + + + Disabled + .;../..;%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)yasm.exe + true + true + $(OutDir)$(ProjectName).pdb + Console + false + + + MachineX86 + + + + + X64 + $(Platform)\$(Configuration)/yasm.tlb + + + + + Disabled + .;../..;%(AdditionalIncludeDirectories) + _DEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)yasm.exe + true + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX64 + + + + + $(Platform)\$(Configuration)/yasm.tlb + + + + + Full + Default + true + .;../..;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)yasm.exe + true + true + $(OutDir)$(ProjectName).pdb + Console + false + + + MachineX86 + + + + + X64 + $(Platform)\$(Configuration)/yasm.tlb + + + + + Full + OnlyExplicitInline + .;../..;%(AdditionalIncludeDirectories) + NDEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)yasm.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX64 + true + + + + + + + + + + + + + + + + + {021ceb0a-f721-4f59-b349-9ceeaf244459} + false + + + {29fe7874-1256-4ad6-b889-68e399dc9608} + false + + + {d715a3d4-efaa-442e-ad8b-5b4ff64e1dd6} + false + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc12/yasm.vcxproj.filters b/Mkfiles/vc12/yasm.vcxproj.filters new file mode 100644 index 00000000..04941c22 --- /dev/null +++ b/Mkfiles/vc12/yasm.vcxproj.filters @@ -0,0 +1,41 @@ + + + + + {51f0d88e-1373-4bf8-a72e-c79706d37f8b} + h;hpp;hxx;hm;inl + + + {db67b411-6f59-462c-9c20-75024c6b3912} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + \ No newline at end of file diff --git a/Mkfiles/vc12/ytasm.vcxproj b/Mkfiles/vc12/ytasm.vcxproj new file mode 100644 index 00000000..24d1869e --- /dev/null +++ b/Mkfiles/vc12/ytasm.vcxproj @@ -0,0 +1,278 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {2162937B-0DBD-4450-B45F-DF578D8E7508} + ytasm + + + + Application + false + MultiByte + v120 + + + Application + false + MultiByte + v120 + + + Application + false + MultiByte + v120 + + + Application + false + MultiByte + v120 + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + + + + $(Platform)\$(Configuration)/yasm.tlb + + + + + Disabled + .;../..;%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)ytasm.exe + true + true + $(OutDir)$(ProjectName).pdb + Console + false + + + MachineX86 + + + + + X64 + $(Platform)\$(Configuration)/yasm.tlb + + + + + Disabled + .;../..;%(AdditionalIncludeDirectories) + _DEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)ytasm.exe + true + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX64 + + + + + $(Platform)\$(Configuration)/yasm.tlb + + + + + Full + Default + true + .;../..;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)ytasm.exe + true + true + $(OutDir)$(ProjectName).pdb + Console + false + + + MachineX86 + + + + + X64 + $(Platform)\$(Configuration)/yasm.tlb + + + + + Full + OnlyExplicitInline + .;../..;%(AdditionalIncludeDirectories) + NDEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)ytasm.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX64 + true + + + + + + + + + + + + + + + + {29fe7874-1256-4ad6-b889-68e399dc9608} + false + + + {d715a3d4-efaa-442e-ad8b-5b4ff64e1dd6} + false + + + + + + \ No newline at end of file From fcaf3cef58608c139a4124de4a97c6da7e8bc0ed Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Sun, 6 Apr 2014 08:40:31 +0100 Subject: [PATCH 476/585] Rename a Visual Studio 2013 build file --- Mkfiles/vc12/{readme.vc10.txt => readme.vc12.txt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Mkfiles/vc12/{readme.vc10.txt => readme.vc12.txt} (100%) diff --git a/Mkfiles/vc12/readme.vc10.txt b/Mkfiles/vc12/readme.vc12.txt similarity index 100% rename from Mkfiles/vc12/readme.vc10.txt rename to Mkfiles/vc12/readme.vc12.txt From bd3a470498b57e88b94c3cfae5461b7b3728d100 Mon Sep 17 00:00:00 2001 From: Maks Naumov Date: Fri, 11 Apr 2014 21:05:55 +0300 Subject: [PATCH 477/585] missing 'break' in initalen() --- tools/genperf/perfect.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/genperf/perfect.c b/tools/genperf/perfect.c index 7cd68678..a9a14c02 100644 --- a/tools/genperf/perfect.c +++ b/tools/genperf/perfect.c @@ -750,6 +750,7 @@ static void initalen( case 0: *alen = 1; *blen = 1; + break; case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: *alen = (form->perfect == NORMAL_HP) ? *smax : *smax/2; *blen = *smax/2; From 86fc07b5745a7d103af8ac57b818eaaf2df6c87f Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 13 Apr 2014 22:55:47 -0700 Subject: [PATCH 478/585] coff-objfmt.c: Add missing break. [#268 state:resolved] --- modules/objfmts/coff/coff-objfmt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/objfmts/coff/coff-objfmt.c b/modules/objfmts/coff/coff-objfmt.c index c42bf7e3..2e96aeb7 100644 --- a/modules/objfmts/coff/coff-objfmt.c +++ b/modules/objfmts/coff/coff-objfmt.c @@ -1367,6 +1367,7 @@ coff_helper_gasflags(void *obj, yasm_valparam *vp, unsigned long line, void *d, datasect = 1; load = 1; readonly = 0; + break; case 'x': code = 1; load = 1; From f7f350151fa033848c0e7db664a56c86837874d8 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 10 Aug 2014 00:43:17 -0700 Subject: [PATCH 479/585] dist-hook: Copy YASM-VERSION.h to Mkfiles/vc12. --- Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.am b/Makefile.am index 9efb16fc..4e96a4b0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -131,6 +131,7 @@ dist-hook: YASM-VERSION-FILE YASM-VERSION.h cp YASM-VERSION.h $(distdir)/Mkfiles/dj/ cp YASM-VERSION.h $(distdir)/Mkfiles/vc9/ cp YASM-VERSION.h $(distdir)/Mkfiles/vc10/ + cp YASM-VERSION.h $(distdir)/Mkfiles/vc12/ YASM-VERSION-FILE: $(top_srcdir)/YASM-VERSION-GEN.sh $(top_srcdir)/YASM-VERSION-GEN.sh From 822bdfb4a86674aeb27173d77afa9a721c642934 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 10 Aug 2014 00:46:58 -0700 Subject: [PATCH 480/585] Add vc12 files to distribution. --- Makefile.am | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Makefile.am b/Makefile.am index 4e96a4b0..4d2e5699 100644 --- a/Makefile.am +++ b/Makefile.am @@ -122,6 +122,23 @@ EXTRA_DIST += Mkfiles/vc10/modules/modules.vcxproj.filters EXTRA_DIST += Mkfiles/vc10/re2c/re2c.vcxproj EXTRA_DIST += Mkfiles/vc10/re2c/re2c.vcxproj.filters EXTRA_DIST += Mkfiles/vc10/re2c/run.bat +EXTRA_DIST += Mkfiles/vc12/config.h +EXTRA_DIST += Mkfiles/vc12/crt_secure_no_deprecate.props +EXTRA_DIST += Mkfiles/vc12/crt_secure_no_deprecate.vsprops +EXTRA_DIST += Mkfiles/vc12/libyasm/libyasm.vcxproj +EXTRA_DIST += Mkfiles/vc12/libyasm/libyasm.vcxproj.filters +EXTRA_DIST += Mkfiles/vc12/modules/modules.vcxproj +EXTRA_DIST += Mkfiles/vc12/modules/modules.vcxproj.filters +EXTRA_DIST += Mkfiles/vc12/out_copy_rename.bat +EXTRA_DIST += Mkfiles/vc12/readme.vc12.txt +EXTRA_DIST += Mkfiles/vc12/vsyasm.props +EXTRA_DIST += Mkfiles/vc12/vsyasm.targets +EXTRA_DIST += Mkfiles/vc12/vsyasm.vcxproj +EXTRA_DIST += Mkfiles/vc12/vsyasm.xml +EXTRA_DIST += Mkfiles/vc12/yasm.sln +EXTRA_DIST += Mkfiles/vc12/yasm.vcxproj +EXTRA_DIST += Mkfiles/vc12/yasm.vcxproj.filters +EXTRA_DIST += Mkfiles/vc12/ytasm.vcxproj # Until this gets fixed in automake DISTCLEANFILES += libyasm/stamp-h libyasm/stamp-h[0-9]* From f701862b1b80c07f1d00ffb4458cb03342d6c891 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 10 Aug 2014 00:51:51 -0700 Subject: [PATCH 481/585] Bump copyright dates for 2014. --- COPYING | 2 +- frontends/yasm/yasm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/COPYING b/COPYING index ddd3c01f..430673b7 100644 --- a/COPYING +++ b/COPYING @@ -1,4 +1,4 @@ -Yasm is Copyright (c) 2001-2010 Peter Johnson and other Yasm developers. +Yasm is Copyright (c) 2001-2014 Peter Johnson and other Yasm developers. Yasm developers and/or contributors include: Peter Johnson diff --git a/frontends/yasm/yasm.c b/frontends/yasm/yasm.c index 76353fc6..44358549 100644 --- a/frontends/yasm/yasm.c +++ b/frontends/yasm/yasm.c @@ -214,7 +214,7 @@ static opt_option options[] = /*@observer@*/ static const char *version_msg[] = { PACKAGE_STRING, "Compiled on " __DATE__ ".", - "Copyright (c) 2001-2011 Peter Johnson and other Yasm developers.", + "Copyright (c) 2001-2014 Peter Johnson and other Yasm developers.", "Run yasm --license for licensing overview and summary." }; From 0b5fde735011db5dcbf4b4856917db7eaf775484 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 10 Aug 2014 10:18:30 -0700 Subject: [PATCH 482/585] Add cmake files to distribution. --- Makefile.am | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/Makefile.am b/Makefile.am index 4d2e5699..b1524aa9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -58,6 +58,63 @@ EXTRA_DIST += GNU_GPL-2.0 EXTRA_DIST += GNU_LGPL-2.0 EXTRA_DIST += splint.sh EXTRA_DIST += YASM-VERSION-GEN.sh +EXTRA_DIST += CMakeLists.txt +EXTRA_DIST += ConfigureChecks.cmake +EXTRA_DIST += config.h.cmake +EXTRA_DIST += libyasm-stdint.h.cmake +EXTRA_DIST += cmake/CMakeLists.txt +EXTRA_DIST += cmake/modules/CMakeLists.txt +EXTRA_DIST += cmake/modules/DummyCFile.c +EXTRA_DIST += cmake/modules/VersionGen.cmake +EXTRA_DIST += cmake/modules/YasmMacros.cmake +EXTRA_DIST += frontends/CMakeLists.txt +EXTRA_DIST += frontends/tasm/CMakeLists.txt +EXTRA_DIST += frontends/vsyasm/CMakeLists.txt +EXTRA_DIST += frontends/yasm/CMakeLists.txt +EXTRA_DIST += frontends/yasm/genstring.py +EXTRA_DIST += frontends/yasm/yasm-plugin.c +EXTRA_DIST += frontends/yasm/yasm-plugin.h +EXTRA_DIST += libyasm/CMakeLists.txt +EXTRA_DIST += libyasm/cmake-module.c +EXTRA_DIST += modules/arch/CMakeLists.txt +EXTRA_DIST += modules/arch/lc3b/CMakeLists.txt +EXTRA_DIST += modules/arch/x86/CMakeLists.txt +EXTRA_DIST += modules/CMakeLists.txt +EXTRA_DIST += modules/dbgfmts/CMakeLists.txt +EXTRA_DIST += modules/dbgfmts/codeview/CMakeLists.txt +EXTRA_DIST += modules/dbgfmts/dwarf2/CMakeLists.txt +EXTRA_DIST += modules/dbgfmts/null/CMakeLists.txt +EXTRA_DIST += modules/dbgfmts/stabs/CMakeLists.txt +EXTRA_DIST += modules/listfmts/CMakeLists.txt +EXTRA_DIST += modules/listfmts/nasm/CMakeLists.txt +EXTRA_DIST += modules/objfmts/bin/CMakeLists.txt +EXTRA_DIST += modules/objfmts/CMakeLists.txt +EXTRA_DIST += modules/objfmts/coff/CMakeLists.txt +EXTRA_DIST += modules/objfmts/dbg/CMakeLists.txt +EXTRA_DIST += modules/objfmts/elf/CMakeLists.txt +EXTRA_DIST += modules/objfmts/macho/CMakeLists.txt +EXTRA_DIST += modules/objfmts/rdf/CMakeLists.txt +EXTRA_DIST += modules/objfmts/xdf/CMakeLists.txt +EXTRA_DIST += modules/parsers/CMakeLists.txt +EXTRA_DIST += modules/parsers/gas/CMakeLists.txt +EXTRA_DIST += modules/parsers/nasm/CMakeLists.txt +EXTRA_DIST += modules/preprocs/CMakeLists.txt +EXTRA_DIST += modules/preprocs/cpp/CMakeLists.txt +EXTRA_DIST += modules/preprocs/gas/CMakeLists.txt +EXTRA_DIST += modules/preprocs/nasm/CMakeLists.txt +EXTRA_DIST += modules/preprocs/raw/CMakeLists.txt +EXTRA_DIST += plugins/README +EXTRA_DIST += plugins/dbg/CMakeLists.txt +EXTRA_DIST += plugins/dbg/dbg-objfmt.c +EXTRA_DIST += plugins/dbg/init_plugin.c +EXTRA_DIST += plugins/dbg/README +EXTRA_DIST += plugins/x86/CMakeLists.txt +EXTRA_DIST += plugins/x86/init_plugin.c +EXTRA_DIST += plugins/x86/README +EXTRA_DIST += tools/CMakeLists.txt +EXTRA_DIST += tools/genmacro/CMakeLists.txt +EXTRA_DIST += tools/genperf/CMakeLists.txt +EXTRA_DIST += tools/re2c/CMakeLists.txt EXTRA_DIST += Mkfiles/Makefile.flat EXTRA_DIST += Mkfiles/Makefile.dj EXTRA_DIST += Mkfiles/dj/config.h From cd1e6f51dee93cf5b66bc3047ae9bf585729abd2 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 10 Aug 2014 10:23:36 -0700 Subject: [PATCH 483/585] Update gettext. --- ABOUT-NLS | 1970 +++++++++++++++++++++++------------------- ChangeLog | 11 + config/config.rpath | 138 +-- m4/gettext.m4 | 96 +- m4/iconv.m4 | 164 +++- m4/lib-ld.m4 | 87 +- m4/lib-link.m4 | 138 ++- m4/lib-prefix.m4 | 91 +- m4/nls.m4 | 13 +- m4/po.m4 | 40 +- m4/progtest.m4 | 31 +- po/ChangeLog | 5 + po/Makefile.in.in | 57 +- po/Makevars | 12 + po/Makevars.template | 41 - po/Rules-quot | 4 +- 16 files changed, 1688 insertions(+), 1210 deletions(-) delete mode 100644 po/Makevars.template diff --git a/ABOUT-NLS b/ABOUT-NLS index 83bc72ec..b1de1b68 100644 --- a/ABOUT-NLS +++ b/ABOUT-NLS @@ -18,35 +18,7 @@ explain how users should proceed for getting the programs to use the available translations. They tell how people wanting to contribute and work on translations can contact the appropriate team. - When reporting bugs in the `intl/' directory or bugs which may be -related to internationalization, you should tell about the version of -`gettext' which is used. The information can be found in the -`intl/VERSION' file, in internationalized packages. - -1.1 Quick configuration advice -============================== - -If you want to exploit the full power of internationalization, you -should configure it using - - ./configure --with-included-gettext - -to force usage of internationalizing routines provided within this -package, despite the existence of internationalizing capabilities in the -operating system where this package is being installed. So far, only -the `gettext' implementation in the GNU C library version 2 provides as -many features (such as locale alias, message inheritance, automatic -charset conversion or plural form handling) as the implementation here. -It is also not possible to offer this additional functionality on top -of a `catgets' implementation. Future versions of GNU `gettext' will -very likely convey even more functionality. So it might be a good idea -to change to GNU `gettext' as soon as possible. - - So you need _not_ provide this option if you are using GNU libc 2 or -you have installed a recent copy of the GNU gettext package with the -included `libintl'. - -1.2 INSTALL Matters +1.1 INSTALL Matters =================== Some packages are "localizable" when properly installed; the programs @@ -56,36 +28,19 @@ internationalization, predating GNU `gettext'. By default, this package will be installed to allow translation of messages. It will automatically detect whether the system already -provides the GNU `gettext' functions. If not, the included GNU -`gettext' library will be used. This library is wholly contained -within this package, usually in the `intl/' subdirectory, so prior -installation of the GNU `gettext' package is _not_ required. -Installers may use special options at configuration time for changing -the default behaviour. The commands: +provides the GNU `gettext' functions. Installers may use special +options at configuration time for changing the default behaviour. The +command: - ./configure --with-included-gettext ./configure --disable-nls -will, respectively, bypass any pre-existing `gettext' to use the -internationalizing routines provided within this package, or else, -_totally_ disable translation of messages. +will _totally_ disable translation of messages. When you already have GNU `gettext' installed on your system and run configure without an option for your new package, `configure' will -probably detect the previously built and installed `libintl.a' file and -will decide to use this. This might not be desirable. You should use -the more recent version of the GNU `gettext' library. I.e. if the file -`intl/VERSION' shows that the library which comes with this package is -more recent, you should use - - ./configure --with-included-gettext - -to prevent auto-detection. - - The configuration process will not test for the `catgets' function -and therefore it will not be used. The reason is that even an -emulation of `gettext' on top of `catgets' could not provide all the -extensions of the GNU `gettext' library. +probably detect the previously built and installed `libintl' library +and will decide to use it. If not, you may have to to use the +`--with-libintl-prefix' option to tell `configure' where to look for it. Internationalized packages usually have many `po/LL.po' files, where LL gives an ISO 639 two-letter code identifying the language. Unless @@ -96,7 +51,7 @@ may be set, prior to configuration, to limit the installed set. `LINGUAS' should then contain a space separated list of two-letter codes, stating which languages are allowed. -1.3 Using This Package +1.2 Using This Package ====================== As a user, if your language has been installed for this package, you @@ -148,7 +103,7 @@ to denote the language's main dialect. For example, `de' is equivalent to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT' (Portuguese as spoken in Portugal) in this context. -1.4 Translating Teams +1.3 Translating Teams ===================== For the Free Translation Project to be a success, we need interested @@ -177,859 +132,1118 @@ reach the coordinator for all translator teams. the terminology in use. Proven linguistic skills are praised more than programming skills, here. -1.5 Available Packages +1.4 Available Packages ====================== Languages are not equally supported in all packages. The following -matrix shows the current state of internationalization, as of November -2007. The matrix shows, in regard of each package, for which languages +matrix shows the current state of internationalization, as of June +2010. The matrix shows, in regard of each package, for which languages PO files have been submitted to translation coordination, with a translation percentage of at least 50%. - Ready PO files af am ar az be bg bs ca cs cy da de el en en_GB eo - +----------------------------------------------------+ - Compendium | [] [] [] [] | - a2ps | [] [] [] [] [] | - aegis | () | - ant-phone | () | - anubis | [] | - ap-utils | | - aspell | [] [] [] [] [] | - bash | [] | - bfd | | - bibshelf | [] | - binutils | | - bison | [] [] | - bison-runtime | [] | - bluez-pin | [] [] [] [] [] | - cflow | [] | - clisp | [] [] [] | - console-tools | [] [] | - coreutils | [] [] [] [] | - cpio | | - cpplib | [] [] [] | - cryptonit | [] | - dialog | | - diffutils | [] [] [] [] [] [] | - doodle | [] | - e2fsprogs | [] [] | - enscript | [] [] [] [] | - fetchmail | [] [] () [] [] | - findutils | [] | - findutils_stable | [] [] [] | - flex | [] [] [] | - fslint | | - gas | | - gawk | [] [] [] | - gcal | [] | - gcc | [] | - gettext-examples | [] [] [] [] [] | - gettext-runtime | [] [] [] [] [] | - gettext-tools | [] [] | - gip | [] | - gliv | [] [] | - glunarclock | [] | - gmult | [] [] | - gnubiff | () | - gnucash | [] [] () () [] | - gnuedu | | - gnulib | [] | - gnunet | | - gnunet-gtk | | - gnutls | [] | - gpe-aerial | [] [] | - gpe-beam | [] [] | - gpe-calendar | | - gpe-clock | [] [] | - gpe-conf | [] [] | - gpe-contacts | | - gpe-edit | [] | - gpe-filemanager | | - gpe-go | [] | - gpe-login | [] [] | - gpe-ownerinfo | [] [] | - gpe-package | | - gpe-sketchbook | [] [] | - gpe-su | [] [] | - gpe-taskmanager | [] [] | - gpe-timesheet | [] | - gpe-today | [] [] | - gpe-todo | | - gphoto2 | [] [] [] [] | - gprof | [] [] | - gpsdrive | | - gramadoir | [] [] | - grep | [] [] | - gretl | () | - gsasl | | - gss | | - gst-plugins-bad | [] [] | - gst-plugins-base | [] [] | - gst-plugins-good | [] [] [] | - gst-plugins-ugly | [] [] | - gstreamer | [] [] [] [] [] [] [] | - gtick | () | - gtkam | [] [] [] [] | - gtkorphan | [] [] | - gtkspell | [] [] [] [] | - gutenprint | [] | - hello | [] [] [] [] [] | - herrie | [] | - hylafax | | - idutils | [] [] | - indent | [] [] [] [] | - iso_15924 | | - iso_3166 | [] [] [] [] [] [] [] [] [] [] [] | - iso_3166_2 | | - iso_4217 | [] [] [] | - iso_639 | [] [] [] [] | - jpilot | [] | - jtag | | - jwhois | | - kbd | [] [] [] [] | - keytouch | [] [] | - keytouch-editor | [] | - keytouch-keyboa... | [] | - latrine | () | - ld | [] | - leafpad | [] [] [] [] [] | - libc | [] [] [] [] | - libexif | [] | - libextractor | [] | - libgpewidget | [] [] [] | - libgpg-error | [] | - libgphoto2 | [] [] | - libgphoto2_port | [] [] | - libgsasl | | - libiconv | [] [] | - libidn | [] [] [] | - lifelines | [] () | - lilypond | [] | - lingoteach | | - lprng | | - lynx | [] [] [] [] | - m4 | [] [] [] [] | - mailfromd | | - mailutils | [] | - make | [] [] | - man-db | [] [] [] | - minicom | [] [] [] | - nano | [] [] [] | - opcodes | [] | - parted | [] [] | - pilot-qof | | - popt | [] [] [] | - psmisc | [] | - pwdutils | | - qof | | - radius | [] | - recode | [] [] [] [] [] [] | - rpm | [] | - screem | | - scrollkeeper | [] [] [] [] [] [] [] [] | - sed | [] [] [] | - shared-mime-info | [] [] [] [] () [] [] [] | - sharutils | [] [] [] [] [] [] | - shishi | | - skencil | [] () | - solfege | | - soundtracker | [] [] | - sp | [] | - system-tools-ba... | [] [] [] [] [] [] [] [] [] | - tar | [] [] | - texinfo | [] [] [] | - tin | () () | - tuxpaint | [] [] [] [] [] [] | - unicode-han-tra... | | - unicode-transla... | | - util-linux | [] [] [] [] | - util-linux-ng | [] [] [] [] | - vorbis-tools | [] | - wastesedge | () | - wdiff | [] [] [] [] | - wget | [] [] [] | - xchat | [] [] [] [] [] [] [] | - xkeyboard-config | [] | - xpad | [] [] [] | - +----------------------------------------------------+ - af am ar az be bg bs ca cs cy da de el en en_GB eo - 6 0 2 1 8 26 2 40 48 2 56 88 15 1 15 18 - - es et eu fa fi fr ga gl gu he hi hr hu id is it + Ready PO files af am an ar as ast az be be@latin bg bn_IN bs ca +--------------------------------------------------+ - Compendium | [] [] [] [] [] | - a2ps | [] [] [] () | + a2ps | [] [] | aegis | | - ant-phone | [] | - anubis | [] | - ap-utils | [] [] | - aspell | [] [] [] | - bash | [] | - bfd | [] [] | - bibshelf | [] [] [] | - binutils | [] [] [] | - bison | [] [] [] [] [] [] | - bison-runtime | [] [] [] [] [] | - bluez-pin | [] [] [] [] [] | - cflow | [] | - clisp | [] [] | - console-tools | | - coreutils | [] [] [] [] [] [] | - cpio | [] [] [] | - cpplib | [] [] | - cryptonit | [] | - dialog | [] [] [] | - diffutils | [] [] [] [] [] [] [] [] [] | - doodle | [] [] | - e2fsprogs | [] [] [] | - enscript | [] [] [] | - fetchmail | [] | - findutils | [] [] [] | - findutils_stable | [] [] [] [] | - flex | [] [] [] | - fslint | | - gas | [] [] | - gawk | [] [] [] [] () | - gcal | [] [] | - gcc | [] | - gettext-examples | [] [] [] [] [] [] [] | - gettext-runtime | [] [] [] [] [] [] | - gettext-tools | [] [] [] [] | - gip | [] [] [] [] | - gliv | () | - glunarclock | [] [] [] | - gmult | [] [] [] | - gnubiff | () () | - gnucash | () () () | - gnuedu | [] | - gnulib | [] [] [] | + ant-phone | | + anubis | | + aspell | [] [] | + bash | | + bfd | | + bibshelf | [] | + binutils | | + bison | | + bison-runtime | [] | + bluez-pin | [] [] | + bombono-dvd | | + buzztard | | + cflow | | + clisp | | + coreutils | [] [] | + cpio | | + cppi | | + cpplib | [] | + cryptsetup | | + dfarc | | + dialog | [] [] | + dico | | + diffutils | [] | + dink | | + doodle | | + e2fsprogs | [] | + enscript | [] | + exif | | + fetchmail | [] | + findutils | [] | + flex | [] | + freedink | | + gas | | + gawk | [] [] | + gcal | [] | + gcc | | + gettext-examples | [] [] [] [] | + gettext-runtime | [] [] | + gettext-tools | [] [] | + gip | [] | + gjay | | + gliv | [] | + glunarclock | [] [] | + gnubiff | | + gnucash | [] | + gnuedu | | + gnulib | | gnunet | | gnunet-gtk | | gnutls | | - gpe-aerial | [] [] | - gpe-beam | [] [] | + gold | | + gpe-aerial | | + gpe-beam | | + gpe-bluetooth | | gpe-calendar | | - gpe-clock | [] [] [] [] | - gpe-conf | [] | - gpe-contacts | [] [] | - gpe-edit | [] [] [] [] | - gpe-filemanager | [] | - gpe-go | [] [] [] | - gpe-login | [] [] [] | - gpe-ownerinfo | [] [] [] [] [] | - gpe-package | [] | - gpe-sketchbook | [] [] | - gpe-su | [] [] [] [] | - gpe-taskmanager | [] [] [] | - gpe-timesheet | [] [] [] [] | - gpe-today | [] [] [] [] | - gpe-todo | [] | - gphoto2 | [] [] [] [] [] | - gprof | [] [] [] [] [] | - gpsdrive | [] | - gramadoir | [] [] | - grep | [] [] [] | - gretl | [] [] [] () | - gsasl | [] [] | - gss | [] [] | - gst-plugins-bad | [] [] [] [] | - gst-plugins-base | [] [] [] [] | - gst-plugins-good | [] [] [] [] [] | - gst-plugins-ugly | [] [] [] [] | - gstreamer | [] [] [] | - gtick | [] [] [] | - gtkam | [] [] [] [] | - gtkorphan | [] [] | - gtkspell | [] [] [] [] [] [] [] | - gutenprint | [] | - hello | [] [] [] [] [] [] [] [] [] [] [] [] [] | - herrie | [] | - hylafax | | - idutils | [] [] [] [] [] | - indent | [] [] [] [] [] [] [] [] [] [] | - iso_15924 | [] | - iso_3166 | [] [] [] [] [] [] [] [] [] [] [] [] [] | - iso_3166_2 | [] | - iso_4217 | [] [] [] [] [] [] | - iso_639 | [] [] [] [] [] [] | - jpilot | [] [] | - jtag | [] | - jwhois | [] [] [] [] [] | - kbd | [] [] | - keytouch | [] [] [] | - keytouch-editor | [] | - keytouch-keyboa... | [] [] | - latrine | [] [] | - ld | [] [] [] [] | - leafpad | [] [] [] [] [] [] | - libc | [] [] [] [] [] | - libexif | [] | - libextractor | [] | - libgpewidget | [] [] [] [] [] | - libgpg-error | [] | - libgphoto2 | [] [] [] | - libgphoto2_port | [] [] | - libgsasl | [] [] | - libiconv | [] [] [] | - libidn | [] [] | - lifelines | () | - lilypond | [] [] [] | - lingoteach | [] [] [] | - lprng | | - lynx | [] [] [] | - m4 | [] [] [] [] | - mailfromd | | - mailutils | [] [] | - make | [] [] [] [] [] [] [] [] | - man-db | [] | - minicom | [] [] [] [] | - nano | [] [] [] [] [] [] [] | - opcodes | [] [] [] [] | - parted | [] [] [] | - pilot-qof | | - popt | [] [] [] [] | - psmisc | [] [] | - pwdutils | | - qof | [] | - radius | [] [] | - recode | [] [] [] [] [] [] [] [] | - rpm | [] [] | - screem | | - scrollkeeper | [] [] [] | - sed | [] [] [] [] [] | - shared-mime-info | [] [] [] [] [] [] | - sharutils | [] [] [] [] [] [] [] [] | - shishi | [] | - skencil | [] [] | - solfege | [] | - soundtracker | [] [] [] | - sp | [] | - system-tools-ba... | [] [] [] [] [] [] [] [] [] | - tar | [] [] [] [] [] | - texinfo | [] [] [] | - tin | [] () | - tuxpaint | [] [] | - unicode-han-tra... | | - unicode-transla... | [] [] | - util-linux | [] [] [] [] [] [] [] | - util-linux-ng | [] [] [] [] [] [] [] | - vorbis-tools | | - wastesedge | () | - wdiff | [] [] [] [] [] [] [] [] | - wget | [] [] [] [] [] [] [] [] | - xchat | [] [] [] [] [] [] [] | - xkeyboard-config | [] [] [] [] | - xpad | [] [] [] | - +--------------------------------------------------+ - es et eu fa fi fr ga gl gu he hi hr hu id is it - 85 22 14 2 48 101 61 12 2 8 2 6 53 29 1 52 - - ja ka ko ku ky lg lt lv mk mn ms mt nb ne nl nn - +--------------------------------------------------+ - Compendium | [] | - a2ps | () [] [] | - aegis | () | - ant-phone | [] | - anubis | [] [] [] | - ap-utils | [] | - aspell | [] [] | - bash | [] | - bfd | | - bibshelf | [] | - binutils | | - bison | [] [] [] | - bison-runtime | [] [] [] | - bluez-pin | [] [] [] | - cflow | | - clisp | [] | - console-tools | | - coreutils | [] | - cpio | [] | - cpplib | [] | - cryptonit | [] | - dialog | [] [] | - diffutils | [] [] [] | - doodle | | - e2fsprogs | [] | - enscript | [] | - fetchmail | [] [] | - findutils | [] | - findutils_stable | [] | - flex | [] [] | - fslint | | - gas | | - gawk | [] [] | - gcal | | - gcc | | - gettext-examples | [] [] [] | - gettext-runtime | [] [] [] | - gettext-tools | [] [] | - gip | [] [] | - gliv | [] | - glunarclock | [] [] | - gmult | [] [] [] | - gnubiff | | - gnucash | () () () | - gnuedu | | - gnulib | [] [] | - gnunet | | - gnunet-gtk | | - gnutls | [] | - gpe-aerial | [] | - gpe-beam | [] | - gpe-calendar | [] | - gpe-clock | [] [] [] | - gpe-conf | [] [] [] | - gpe-contacts | [] | - gpe-edit | [] [] [] | - gpe-filemanager | [] [] | - gpe-go | [] [] [] | - gpe-login | [] [] [] | - gpe-ownerinfo | [] [] | - gpe-package | [] [] | - gpe-sketchbook | [] [] | - gpe-su | [] [] [] | - gpe-taskmanager | [] [] [] [] | - gpe-timesheet | [] | - gpe-today | [] [] | - gpe-todo | [] | - gphoto2 | [] [] | - gprof | [] | - gpsdrive | [] | - gramadoir | () | - grep | [] [] | - gretl | | - gsasl | [] | + gpe-clock | [] | + gpe-conf | | + gpe-contacts | | + gpe-edit | | + gpe-filemanager | | + gpe-go | | + gpe-login | | + gpe-ownerinfo | [] | + gpe-package | | + gpe-sketchbook | | + gpe-su | [] | + gpe-taskmanager | [] | + gpe-timesheet | [] | + gpe-today | [] | + gpe-todo | | + gphoto2 | | + gprof | [] | + gpsdrive | | + gramadoir | | + grep | | + grub | [] [] | + gsasl | | gss | | - gst-plugins-bad | [] | - gst-plugins-base | [] | - gst-plugins-good | [] | - gst-plugins-ugly | [] | - gstreamer | [] | - gtick | [] | - gtkam | [] [] | - gtkorphan | [] | - gtkspell | [] [] | - gutenprint | [] | - hello | [] [] [] [] [] [] [] | - herrie | [] | + gst-plugins-bad | [] | + gst-plugins-base | [] | + gst-plugins-good | [] | + gst-plugins-ugly | [] | + gstreamer | [] [] [] | + gtick | | + gtkam | [] | + gtkorphan | [] | + gtkspell | [] [] [] | + gutenprint | | + hello | [] | + help2man | | hylafax | | - idutils | [] | - indent | [] [] | - iso_15924 | [] | - iso_3166 | [] [] [] [] [] [] [] [] | - iso_3166_2 | [] | - iso_4217 | [] [] [] | - iso_639 | [] [] [] [] | - jpilot | () () | - jtag | | - jwhois | [] | - kbd | [] | - keytouch | [] | - keytouch-editor | [] | - keytouch-keyboa... | | - latrine | [] | - ld | | - leafpad | [] [] | - libc | [] [] [] | - libexif | | + idutils | | + indent | [] [] | + iso_15924 | | + iso_3166 | [] [] [] [] [] [] [] | + iso_3166_2 | | + iso_4217 | | + iso_639 | [] [] [] [] | + iso_639_3 | | + jwhois | | + kbd | | + keytouch | [] | + keytouch-editor | | + keytouch-keyboa... | [] | + klavaro | [] | + latrine | | + ld | [] | + leafpad | [] [] | + libc | [] [] | + libexif | () | libextractor | | - libgpewidget | [] | + libgnutls | | + libgpewidget | | libgpg-error | | - libgphoto2 | [] | - libgphoto2_port | [] | - libgsasl | [] | - libiconv | [] | - libidn | [] [] | - lifelines | [] | - lilypond | [] | - lingoteach | [] | + libgphoto2 | | + libgphoto2_port | | + libgsasl | | + libiconv | [] | + libidn | | + lifelines | | + liferea | [] [] | + lilypond | | + linkdr | [] | + lordsawar | | lprng | | - lynx | [] [] | - m4 | [] [] | + lynx | [] | + m4 | | mailfromd | | mailutils | | - make | [] [] [] | + make | | man-db | | - minicom | [] | - nano | [] [] [] | - opcodes | [] | - parted | [] [] | - pilot-qof | | - popt | [] [] [] | - psmisc | [] [] [] | + man-db-manpages | | + minicom | | + mkisofs | | + myserver | | + nano | [] [] | + opcodes | | + parted | | + pies | | + popt | | + psmisc | | + pspp | [] | pwdutils | | - qof | | - radius | | - recode | [] | - rpm | [] [] | - screem | [] | - scrollkeeper | [] [] [] [] | - sed | [] [] | - shared-mime-info | [] [] [] [] [] [] [] | - sharutils | [] [] | + radius | [] | + recode | [] [] | + rosegarden | | + rpm | | + rush | | + sarg | | + screem | | + scrollkeeper | [] [] [] | + sed | [] [] | + sharutils | [] [] | shishi | | skencil | | - solfege | () () | + solfege | | + solfege-manual | | soundtracker | | - sp | () | - system-tools-ba... | [] [] [] [] | - tar | [] [] [] | - texinfo | [] [] | - tin | | - tuxpaint | () [] [] | - unicode-han-tra... | | - unicode-transla... | | - util-linux | [] [] | - util-linux-ng | [] [] | - vorbis-tools | | - wastesedge | [] | - wdiff | [] [] | - wget | [] [] | - xchat | [] [] [] [] | - xkeyboard-config | [] [] [] | - xpad | [] [] [] | - +--------------------------------------------------+ - ja ka ko ku ky lg lt lv mk mn ms mt nb ne nl nn - 51 2 25 3 2 0 6 0 2 2 20 0 11 1 103 6 - - or pa pl pt pt_BR rm ro ru rw sk sl sq sr sv ta - +--------------------------------------------------+ - Compendium | [] [] [] [] [] | - a2ps | () [] [] [] [] [] [] | - aegis | () () | - ant-phone | [] [] | - anubis | [] [] [] | - ap-utils | () | - aspell | [] [] [] | - bash | [] [] | - bfd | | - bibshelf | [] | - binutils | [] [] | - bison | [] [] [] [] [] | - bison-runtime | [] [] [] [] [] | - bluez-pin | [] [] [] [] [] [] [] [] [] | - cflow | [] | - clisp | [] | - console-tools | [] | - coreutils | [] [] [] [] | - cpio | [] [] [] | - cpplib | [] | - cryptonit | [] [] | - dialog | [] | - diffutils | [] [] [] [] [] [] | - doodle | [] [] | - e2fsprogs | [] [] | - enscript | [] [] [] [] [] | - fetchmail | [] [] [] | - findutils | [] [] [] | - findutils_stable | [] [] [] [] [] [] | - flex | [] [] [] [] [] | - fslint | [] | - gas | | - gawk | [] [] [] [] | - gcal | [] | - gcc | [] [] | - gettext-examples | [] [] [] [] [] [] [] [] | - gettext-runtime | [] [] [] [] [] [] [] [] | - gettext-tools | [] [] [] [] [] [] [] | - gip | [] [] [] [] | - gliv | [] [] [] [] [] [] | - glunarclock | [] [] [] [] [] [] | - gmult | [] [] [] [] | - gnubiff | () [] | - gnucash | () [] | - gnuedu | | - gnulib | [] [] [] | - gnunet | | - gnunet-gtk | [] | - gnutls | [] [] | - gpe-aerial | [] [] [] [] [] [] [] | - gpe-beam | [] [] [] [] [] [] [] | - gpe-calendar | [] [] [] [] | - gpe-clock | [] [] [] [] [] [] [] [] | - gpe-conf | [] [] [] [] [] [] [] | - gpe-contacts | [] [] [] [] [] | - gpe-edit | [] [] [] [] [] [] [] [] [] | - gpe-filemanager | [] [] | - gpe-go | [] [] [] [] [] [] [] [] | - gpe-login | [] [] [] [] [] [] [] [] | - gpe-ownerinfo | [] [] [] [] [] [] [] [] | - gpe-package | [] [] | - gpe-sketchbook | [] [] [] [] [] [] [] [] | - gpe-su | [] [] [] [] [] [] [] [] | - gpe-taskmanager | [] [] [] [] [] [] [] [] | - gpe-timesheet | [] [] [] [] [] [] [] [] | - gpe-today | [] [] [] [] [] [] [] [] | - gpe-todo | [] [] [] [] | - gphoto2 | [] [] [] [] [] [] | - gprof | [] [] [] | - gpsdrive | [] [] | - gramadoir | [] [] | - grep | [] [] [] [] | - gretl | [] [] [] | - gsasl | [] [] [] | - gss | [] [] [] [] | - gst-plugins-bad | [] [] [] | - gst-plugins-base | [] [] | - gst-plugins-good | [] [] | - gst-plugins-ugly | [] [] [] | - gstreamer | [] [] [] [] | - gtick | [] | - gtkam | [] [] [] [] [] | - gtkorphan | [] | - gtkspell | [] [] [] [] [] [] [] [] | - gutenprint | [] | - hello | [] [] [] [] [] [] [] [] | - herrie | [] [] [] | - hylafax | | - idutils | [] [] [] [] [] | - indent | [] [] [] [] [] [] [] | - iso_15924 | | - iso_3166 | [] [] [] [] [] [] [] [] [] [] [] [] [] | - iso_3166_2 | | - iso_4217 | [] [] [] [] [] [] [] | - iso_639 | [] [] [] [] [] [] [] | - jpilot | | - jtag | [] | - jwhois | [] [] [] [] | - kbd | [] [] [] | - keytouch | [] | - keytouch-editor | [] | - keytouch-keyboa... | [] | - latrine | | - ld | [] | - leafpad | [] [] [] [] [] [] | - libc | [] [] [] [] | - libexif | [] [] | - libextractor | [] [] | - libgpewidget | [] [] [] [] [] [] [] [] | - libgpg-error | [] [] [] | - libgphoto2 | [] | - libgphoto2_port | [] [] [] | - libgsasl | [] [] [] [] | - libiconv | [] [] [] | - libidn | [] [] () | - lifelines | [] [] | - lilypond | | - lingoteach | [] | - lprng | [] | - lynx | [] [] [] | - m4 | [] [] [] [] [] | - mailfromd | [] | - mailutils | [] [] [] | - make | [] [] [] [] | - man-db | [] [] [] [] | - minicom | [] [] [] [] [] | - nano | [] [] [] [] | - opcodes | [] [] | - parted | [] | - pilot-qof | | - popt | [] [] [] [] | - psmisc | [] [] | - pwdutils | [] [] | - qof | [] [] | - radius | [] [] | - recode | [] [] [] [] [] [] [] | - rpm | [] [] [] [] | - screem | | - scrollkeeper | [] [] [] [] [] [] [] | - sed | [] [] [] [] [] [] [] [] [] | - shared-mime-info | [] [] [] [] [] [] | - sharutils | [] [] [] [] | - shishi | [] | - skencil | [] [] [] | - solfege | [] | - soundtracker | [] [] | sp | | - system-tools-ba... | [] [] [] [] [] [] [] [] [] | - tar | [] [] [] [] | - texinfo | [] [] [] [] | - tin | () | - tuxpaint | [] [] [] [] [] [] | + sysstat | | + tar | [] | + texinfo | | + tin | | unicode-han-tra... | | unicode-transla... | | - util-linux | [] [] [] [] | - util-linux-ng | [] [] [] [] | - vorbis-tools | [] | + util-linux-ng | [] | + vice | | + vmm | | + vorbis-tools | | wastesedge | | - wdiff | [] [] [] [] [] [] [] | - wget | [] [] [] [] | - xchat | [] [] [] [] [] [] [] | - xkeyboard-config | [] [] [] | - xpad | [] [] [] | + wdiff | | + wget | [] [] | + wyslij-po | | + xchat | [] [] [] [] | + xdg-user-dirs | [] [] [] [] [] [] [] [] [] | + xkeyboard-config | [] [] | +--------------------------------------------------+ - or pa pl pt pt_BR rm ro ru rw sk sl sq sr sv ta - 0 5 77 31 53 4 58 72 3 45 46 9 45 122 3 + af am an ar as ast az be be@latin bg bn_IN bs ca + 6 0 1 2 3 19 1 10 3 28 3 1 38 - tg th tk tr uk ven vi wa xh zh_CN zh_HK zh_TW zu + crh cs da de el en en_GB en_ZA eo es et eu fa + +-------------------------------------------------+ + a2ps | [] [] [] [] [] [] [] | + aegis | [] [] [] | + ant-phone | [] () | + anubis | [] [] | + aspell | [] [] [] [] [] | + bash | [] [] [] | + bfd | [] | + bibshelf | [] [] [] | + binutils | [] | + bison | [] [] | + bison-runtime | [] [] [] [] | + bluez-pin | [] [] [] [] [] [] | + bombono-dvd | [] | + buzztard | [] [] [] | + cflow | [] [] | + clisp | [] [] [] [] | + coreutils | [] [] [] [] | + cpio | | + cppi | | + cpplib | [] [] [] | + cryptsetup | [] | + dfarc | [] [] [] | + dialog | [] [] [] [] [] | + dico | | + diffutils | [] [] [] [] [] [] | + dink | [] [] [] | + doodle | [] | + e2fsprogs | [] [] [] | + enscript | [] [] [] | + exif | () [] [] | + fetchmail | [] [] () [] [] [] | + findutils | [] [] [] | + flex | [] [] | + freedink | [] [] [] | + gas | [] | + gawk | [] [] [] | + gcal | [] | + gcc | [] [] | + gettext-examples | [] [] [] [] | + gettext-runtime | [] [] [] [] | + gettext-tools | [] [] [] | + gip | [] [] [] [] | + gjay | [] | + gliv | [] [] [] | + glunarclock | [] [] | + gnubiff | () | + gnucash | [] () () () () | + gnuedu | [] [] | + gnulib | [] [] | + gnunet | | + gnunet-gtk | [] | + gnutls | [] [] | + gold | [] | + gpe-aerial | [] [] [] [] | + gpe-beam | [] [] [] [] | + gpe-bluetooth | [] [] | + gpe-calendar | [] | + gpe-clock | [] [] [] [] | + gpe-conf | [] [] [] | + gpe-contacts | [] [] [] | + gpe-edit | [] [] | + gpe-filemanager | [] [] [] | + gpe-go | [] [] [] [] | + gpe-login | [] [] | + gpe-ownerinfo | [] [] [] [] | + gpe-package | [] [] [] | + gpe-sketchbook | [] [] [] [] | + gpe-su | [] [] [] [] | + gpe-taskmanager | [] [] [] [] | + gpe-timesheet | [] [] [] [] | + gpe-today | [] [] [] [] | + gpe-todo | [] [] [] | + gphoto2 | [] [] () [] [] [] | + gprof | [] [] [] | + gpsdrive | [] [] [] | + gramadoir | [] [] [] | + grep | [] | + grub | [] [] | + gsasl | [] | + gss | | + gst-plugins-bad | [] [] [] [] [] | + gst-plugins-base | [] [] [] [] [] | + gst-plugins-good | [] [] [] [] [] [] | + gst-plugins-ugly | [] [] [] [] [] [] | + gstreamer | [] [] [] [] [] | + gtick | [] () [] | + gtkam | [] [] () [] [] | + gtkorphan | [] [] [] [] | + gtkspell | [] [] [] [] [] [] [] | + gutenprint | [] [] [] | + hello | [] [] [] [] | + help2man | [] | + hylafax | [] [] | + idutils | [] [] | + indent | [] [] [] [] [] [] [] | + iso_15924 | [] () [] [] | + iso_3166 | [] [] [] [] () [] [] [] () | + iso_3166_2 | () | + iso_4217 | [] [] [] () [] [] | + iso_639 | [] [] [] [] () [] [] | + iso_639_3 | [] | + jwhois | [] | + kbd | [] [] [] [] [] | + keytouch | [] [] | + keytouch-editor | [] [] | + keytouch-keyboa... | [] | + klavaro | [] [] [] [] | + latrine | [] () | + ld | [] [] | + leafpad | [] [] [] [] [] [] | + libc | [] [] [] [] | + libexif | [] [] () | + libextractor | | + libgnutls | [] | + libgpewidget | [] [] | + libgpg-error | [] [] | + libgphoto2 | [] () | + libgphoto2_port | [] () [] | + libgsasl | | + libiconv | [] [] [] [] [] | + libidn | [] [] [] | + lifelines | [] () | + liferea | [] [] [] [] [] | + lilypond | [] [] [] | + linkdr | [] [] [] | + lordsawar | [] | + lprng | | + lynx | [] [] [] [] | + m4 | [] [] [] [] | + mailfromd | | + mailutils | [] | + make | [] [] [] | + man-db | | + man-db-manpages | | + minicom | [] [] [] [] | + mkisofs | | + myserver | | + nano | [] [] [] | + opcodes | [] [] | + parted | [] [] | + pies | | + popt | [] [] [] [] [] | + psmisc | [] [] [] | + pspp | [] | + pwdutils | [] | + radius | [] | + recode | [] [] [] [] [] [] | + rosegarden | () () () | + rpm | [] [] [] | + rush | | + sarg | | + screem | | + scrollkeeper | [] [] [] [] [] | + sed | [] [] [] [] [] [] | + sharutils | [] [] [] [] | + shishi | | + skencil | [] () [] | + solfege | [] [] [] | + solfege-manual | [] [] | + soundtracker | [] [] [] | + sp | [] | + sysstat | [] [] [] | + tar | [] [] [] [] | + texinfo | [] [] [] | + tin | [] [] | + unicode-han-tra... | | + unicode-transla... | | + util-linux-ng | [] [] [] [] | + vice | () () | + vmm | [] | + vorbis-tools | [] [] | + wastesedge | [] | + wdiff | [] [] | + wget | [] [] [] | + wyslij-po | | + xchat | [] [] [] [] [] | + xdg-user-dirs | [] [] [] [] [] [] [] [] [] | + xkeyboard-config | [] [] [] [] [] [] | + +-------------------------------------------------+ + crh cs da de el en en_GB en_ZA eo es et eu fa + 5 64 105 117 18 1 8 0 28 89 18 19 0 + + fi fr ga gl gu he hi hr hu hy id is it ja ka kn + +----------------------------------------------------+ + a2ps | [] [] [] [] | + aegis | [] [] | + ant-phone | [] [] | + anubis | [] [] [] [] | + aspell | [] [] [] [] | + bash | [] [] [] [] | + bfd | [] [] [] | + bibshelf | [] [] [] [] [] | + binutils | [] [] [] | + bison | [] [] [] [] | + bison-runtime | [] [] [] [] [] [] | + bluez-pin | [] [] [] [] [] [] [] [] | + bombono-dvd | [] | + buzztard | [] | + cflow | [] [] [] | + clisp | [] | + coreutils | [] [] [] [] [] | + cpio | [] [] [] [] | + cppi | [] [] | + cpplib | [] [] [] | + cryptsetup | [] [] [] | + dfarc | [] [] [] | + dialog | [] [] [] [] [] [] [] | + dico | | + diffutils | [] [] [] [] [] [] [] [] [] | + dink | [] | + doodle | [] [] | + e2fsprogs | [] [] | + enscript | [] [] [] [] | + exif | [] [] [] [] [] [] | + fetchmail | [] [] [] [] | + findutils | [] [] [] [] [] [] | + flex | [] [] [] | + freedink | [] [] [] | + gas | [] [] | + gawk | [] [] [] [] () [] | + gcal | [] | + gcc | [] | + gettext-examples | [] [] [] [] [] [] [] | + gettext-runtime | [] [] [] [] [] [] | + gettext-tools | [] [] [] [] | + gip | [] [] [] [] [] [] | + gjay | [] | + gliv | [] () | + glunarclock | [] [] [] [] | + gnubiff | () [] () | + gnucash | () () () () () [] | + gnuedu | [] [] | + gnulib | [] [] [] [] [] [] | + gnunet | | + gnunet-gtk | [] | + gnutls | [] [] | + gold | [] [] | + gpe-aerial | [] [] [] | + gpe-beam | [] [] [] [] | + gpe-bluetooth | [] [] [] [] | + gpe-calendar | [] [] | + gpe-clock | [] [] [] [] [] | + gpe-conf | [] [] [] [] | + gpe-contacts | [] [] [] [] | + gpe-edit | [] [] [] | + gpe-filemanager | [] [] [] [] | + gpe-go | [] [] [] [] [] | + gpe-login | [] [] [] | + gpe-ownerinfo | [] [] [] [] [] | + gpe-package | [] [] [] | + gpe-sketchbook | [] [] [] [] | + gpe-su | [] [] [] [] [] [] | + gpe-taskmanager | [] [] [] [] [] | + gpe-timesheet | [] [] [] [] [] | + gpe-today | [] [] [] [] [] [] [] | + gpe-todo | [] [] [] | + gphoto2 | [] [] [] [] [] [] | + gprof | [] [] [] [] | + gpsdrive | [] [] [] | + gramadoir | [] [] [] | + grep | [] [] | + grub | [] [] [] [] | + gsasl | [] [] [] [] [] | + gss | [] [] [] [] [] | + gst-plugins-bad | [] [] [] [] [] [] | + gst-plugins-base | [] [] [] [] [] [] | + gst-plugins-good | [] [] [] [] [] [] | + gst-plugins-ugly | [] [] [] [] [] [] | + gstreamer | [] [] [] [] [] | + gtick | [] [] [] [] [] | + gtkam | [] [] [] [] [] | + gtkorphan | [] [] [] | + gtkspell | [] [] [] [] [] [] [] [] [] | + gutenprint | [] [] [] [] | + hello | [] [] [] | + help2man | [] [] | + hylafax | [] | + idutils | [] [] [] [] [] [] | + indent | [] [] [] [] [] [] [] [] | + iso_15924 | [] () [] [] | + iso_3166 | [] () [] [] [] [] [] [] [] [] [] [] | + iso_3166_2 | () [] [] [] | + iso_4217 | [] () [] [] [] [] | + iso_639 | [] () [] [] [] [] [] [] [] | + iso_639_3 | () [] [] | + jwhois | [] [] [] [] [] | + kbd | [] [] | + keytouch | [] [] [] [] [] [] | + keytouch-editor | [] [] [] [] [] | + keytouch-keyboa... | [] [] [] [] [] | + klavaro | [] [] | + latrine | [] [] [] | + ld | [] [] [] [] | + leafpad | [] [] [] [] [] [] [] () | + libc | [] [] [] [] [] | + libexif | [] | + libextractor | | + libgnutls | [] [] | + libgpewidget | [] [] [] [] | + libgpg-error | [] [] | + libgphoto2 | [] [] [] | + libgphoto2_port | [] [] [] | + libgsasl | [] [] [] [] [] | + libiconv | [] [] [] [] [] [] | + libidn | [] [] [] [] | + lifelines | () | + liferea | [] [] [] [] | + lilypond | [] [] | + linkdr | [] [] [] [] [] | + lordsawar | | + lprng | [] | + lynx | [] [] [] [] [] | + m4 | [] [] [] [] [] [] | + mailfromd | | + mailutils | [] [] | + make | [] [] [] [] [] [] [] [] [] | + man-db | [] [] | + man-db-manpages | [] | + minicom | [] [] [] [] [] | + mkisofs | [] [] [] [] | + myserver | | + nano | [] [] [] [] [] [] | + opcodes | [] [] [] [] | + parted | [] [] [] [] | + pies | | + popt | [] [] [] [] [] [] [] [] [] | + psmisc | [] [] [] | + pspp | | + pwdutils | [] [] | + radius | [] [] | + recode | [] [] [] [] [] [] [] [] | + rosegarden | () () () () () | + rpm | [] [] | + rush | | + sarg | [] | + screem | [] [] | + scrollkeeper | [] [] [] [] | + sed | [] [] [] [] [] [] [] [] | + sharutils | [] [] [] [] [] [] [] | + shishi | [] | + skencil | [] | + solfege | [] [] [] [] | + solfege-manual | [] [] | + soundtracker | [] [] | + sp | [] () | + sysstat | [] [] [] [] [] | + tar | [] [] [] [] [] [] [] | + texinfo | [] [] [] [] | + tin | [] | + unicode-han-tra... | | + unicode-transla... | [] [] | + util-linux-ng | [] [] [] [] [] [] | + vice | () () () | + vmm | [] | + vorbis-tools | [] | + wastesedge | () () | + wdiff | [] | + wget | [] [] [] [] [] [] [] [] | + wyslij-po | [] [] [] | + xchat | [] [] [] [] [] [] [] [] [] | + xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] | + xkeyboard-config | [] [] [] [] [] | + +----------------------------------------------------+ + fi fr ga gl gu he hi hr hu hy id is it ja ka kn + 105 121 53 20 4 8 3 5 53 2 120 5 84 67 0 4 + + ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne + +-----------------------------------------------+ + a2ps | [] | + aegis | | + ant-phone | | + anubis | [] [] | + aspell | [] | + bash | | + bfd | | + bibshelf | [] [] | + binutils | | + bison | [] | + bison-runtime | [] [] [] [] [] | + bluez-pin | [] [] [] [] [] | + bombono-dvd | | + buzztard | | + cflow | | + clisp | | + coreutils | [] | + cpio | | + cppi | | + cpplib | | + cryptsetup | | + dfarc | [] | + dialog | [] [] [] [] [] | + dico | | + diffutils | [] [] | + dink | | + doodle | | + e2fsprogs | | + enscript | | + exif | [] | + fetchmail | | + findutils | | + flex | | + freedink | [] | + gas | | + gawk | | + gcal | | + gcc | | + gettext-examples | [] [] [] [] | + gettext-runtime | [] | + gettext-tools | [] | + gip | [] [] | + gjay | | + gliv | | + glunarclock | [] | + gnubiff | | + gnucash | () () () () | + gnuedu | | + gnulib | | + gnunet | | + gnunet-gtk | | + gnutls | [] | + gold | | + gpe-aerial | [] | + gpe-beam | [] | + gpe-bluetooth | [] [] | + gpe-calendar | [] | + gpe-clock | [] [] [] [] [] | + gpe-conf | [] [] | + gpe-contacts | [] [] | + gpe-edit | [] | + gpe-filemanager | [] [] | + gpe-go | [] [] [] | + gpe-login | [] | + gpe-ownerinfo | [] [] | + gpe-package | [] [] | + gpe-sketchbook | [] [] | + gpe-su | [] [] [] [] [] [] | + gpe-taskmanager | [] [] [] [] [] [] | + gpe-timesheet | [] [] | + gpe-today | [] [] [] [] | + gpe-todo | [] [] | + gphoto2 | | + gprof | [] | + gpsdrive | | + gramadoir | | + grep | | + grub | | + gsasl | | + gss | | + gst-plugins-bad | [] [] [] [] | + gst-plugins-base | [] [] | + gst-plugins-good | [] [] | + gst-plugins-ugly | [] [] [] [] [] | + gstreamer | | + gtick | | + gtkam | [] | + gtkorphan | [] [] | + gtkspell | [] [] [] [] [] [] [] | + gutenprint | | + hello | [] [] [] | + help2man | | + hylafax | | + idutils | | + indent | | + iso_15924 | [] [] | + iso_3166 | [] [] () [] [] [] [] [] | + iso_3166_2 | | + iso_4217 | [] [] | + iso_639 | [] [] | + iso_639_3 | [] | + jwhois | [] | + kbd | | + keytouch | [] | + keytouch-editor | [] | + keytouch-keyboa... | [] | + klavaro | [] | + latrine | [] | + ld | | + leafpad | [] [] [] | + libc | [] | + libexif | | + libextractor | | + libgnutls | [] | + libgpewidget | [] [] | + libgpg-error | | + libgphoto2 | | + libgphoto2_port | | + libgsasl | | + libiconv | | + libidn | | + lifelines | | + liferea | | + lilypond | | + linkdr | | + lordsawar | | + lprng | | + lynx | | + m4 | | + mailfromd | | + mailutils | | + make | [] | + man-db | | + man-db-manpages | | + minicom | [] | + mkisofs | | + myserver | | + nano | [] [] | + opcodes | | + parted | | + pies | | + popt | [] [] [] | + psmisc | | + pspp | | + pwdutils | | + radius | | + recode | | + rosegarden | | + rpm | | + rush | | + sarg | | + screem | | + scrollkeeper | [] [] | + sed | | + sharutils | | + shishi | | + skencil | | + solfege | [] | + solfege-manual | | + soundtracker | | + sp | | + sysstat | [] | + tar | [] | + texinfo | [] | + tin | | + unicode-han-tra... | | + unicode-transla... | | + util-linux-ng | | + vice | | + vmm | | + vorbis-tools | | + wastesedge | | + wdiff | | + wget | [] | + wyslij-po | | + xchat | [] [] [] | + xdg-user-dirs | [] [] [] [] [] [] [] [] | + xkeyboard-config | [] [] [] | + +-----------------------------------------------+ + ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne + 20 5 10 1 13 48 4 2 2 4 24 10 20 3 1 + + nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr +---------------------------------------------------+ - Compendium | [] [] [] [] | 19 - a2ps | [] [] [] | 19 - aegis | [] | 1 - ant-phone | [] [] | 6 - anubis | [] [] [] | 11 - ap-utils | () [] | 4 - aspell | [] [] [] | 16 - bash | [] | 6 - bfd | | 2 - bibshelf | [] | 7 - binutils | [] [] [] [] | 9 - bison | [] [] [] [] | 20 - bison-runtime | [] [] [] [] | 18 - bluez-pin | [] [] [] [] [] [] | 28 - cflow | [] [] | 5 - clisp | | 9 - console-tools | [] [] | 5 - coreutils | [] [] [] | 18 - cpio | [] [] [] [] | 11 - cpplib | [] [] [] [] [] | 12 - cryptonit | [] | 6 - dialog | [] [] [] | 9 - diffutils | [] [] [] [] [] | 29 - doodle | [] | 6 - e2fsprogs | [] [] | 10 - enscript | [] [] [] | 16 - fetchmail | [] [] | 12 - findutils | [] [] [] | 11 - findutils_stable | [] [] [] [] | 18 - flex | [] [] | 15 - fslint | [] | 2 - gas | [] | 3 - gawk | [] [] [] | 16 - gcal | [] | 5 - gcc | [] [] [] | 7 - gettext-examples | [] [] [] [] [] [] | 29 - gettext-runtime | [] [] [] [] [] [] | 28 - gettext-tools | [] [] [] [] [] | 20 - gip | [] [] | 13 - gliv | [] [] | 11 - glunarclock | [] [] [] | 15 - gmult | [] [] [] [] | 16 - gnubiff | [] | 2 - gnucash | () [] | 5 - gnuedu | [] | 2 - gnulib | [] | 10 - gnunet | | 0 - gnunet-gtk | [] [] | 3 - gnutls | | 4 - gpe-aerial | [] [] | 14 - gpe-beam | [] [] | 14 - gpe-calendar | [] [] | 7 - gpe-clock | [] [] [] [] | 21 - gpe-conf | [] [] [] | 16 - gpe-contacts | [] [] | 10 - gpe-edit | [] [] [] [] [] | 22 - gpe-filemanager | [] [] | 7 - gpe-go | [] [] [] [] | 19 - gpe-login | [] [] [] [] [] | 21 - gpe-ownerinfo | [] [] [] [] | 21 - gpe-package | [] | 6 - gpe-sketchbook | [] [] | 16 - gpe-su | [] [] [] [] | 21 - gpe-taskmanager | [] [] [] [] | 21 - gpe-timesheet | [] [] [] [] | 18 - gpe-today | [] [] [] [] [] | 21 - gpe-todo | [] [] | 8 - gphoto2 | [] [] [] [] | 21 - gprof | [] [] | 13 - gpsdrive | [] | 5 - gramadoir | [] | 7 - grep | [] | 12 - gretl | | 6 - gsasl | [] [] [] | 9 - gss | [] | 7 - gst-plugins-bad | [] [] [] | 13 - gst-plugins-base | [] [] | 11 - gst-plugins-good | [] [] [] [] [] | 16 - gst-plugins-ugly | [] [] [] | 13 - gstreamer | [] [] [] | 18 - gtick | [] [] | 7 - gtkam | [] | 16 - gtkorphan | [] | 7 - gtkspell | [] [] [] [] [] [] | 27 - gutenprint | | 4 - hello | [] [] [] [] [] | 38 - herrie | [] [] | 8 - hylafax | | 0 - idutils | [] [] | 15 - indent | [] [] [] [] [] | 28 - iso_15924 | [] [] | 4 - iso_3166 | [] [] [] [] [] [] [] [] [] | 54 - iso_3166_2 | [] [] | 4 - iso_4217 | [] [] [] [] [] | 24 - iso_639 | [] [] [] [] [] | 26 - jpilot | [] [] [] [] | 7 - jtag | [] | 3 - jwhois | [] [] [] | 13 - kbd | [] [] [] | 13 - keytouch | [] | 8 - keytouch-editor | [] | 5 - keytouch-keyboa... | [] | 5 - latrine | [] [] | 5 - ld | [] [] [] [] | 10 - leafpad | [] [] [] [] [] | 24 - libc | [] [] [] | 19 - libexif | [] | 5 - libextractor | [] | 5 - libgpewidget | [] [] [] | 20 - libgpg-error | [] | 6 - libgphoto2 | [] [] | 9 - libgphoto2_port | [] [] [] | 11 - libgsasl | [] | 8 - libiconv | [] [] | 11 - libidn | [] [] | 11 - lifelines | | 4 - lilypond | [] | 6 - lingoteach | [] | 6 - lprng | [] | 2 - lynx | [] [] [] | 15 - m4 | [] [] [] | 18 - mailfromd | [] [] | 3 - mailutils | [] [] | 8 - make | [] [] [] | 20 - man-db | [] | 9 - minicom | [] | 14 - nano | [] [] [] | 20 - opcodes | [] [] | 10 - parted | [] [] [] | 11 - pilot-qof | [] | 1 - popt | [] [] [] [] | 18 - psmisc | [] [] | 10 - pwdutils | [] | 3 - qof | [] | 4 - radius | [] [] | 7 - recode | [] [] [] | 25 - rpm | [] [] [] [] | 13 - screem | [] | 2 - scrollkeeper | [] [] [] [] | 26 - sed | [] [] [] [] | 23 - shared-mime-info | [] [] [] | 29 - sharutils | [] [] [] | 23 - shishi | [] | 3 - skencil | [] | 7 - solfege | [] | 3 - soundtracker | [] [] | 9 - sp | [] | 3 - system-tools-ba... | [] [] [] [] [] [] [] | 38 - tar | [] [] [] | 17 - texinfo | [] [] [] | 15 - tin | | 1 - tuxpaint | [] [] [] | 19 + a2ps | [] [] [] [] [] [] [] [] | + aegis | [] [] [] | + ant-phone | [] [] | + anubis | [] [] [] | + aspell | [] [] [] [] [] | + bash | [] [] | + bfd | [] | + bibshelf | [] [] | + binutils | [] [] | + bison | [] [] [] | + bison-runtime | [] [] [] [] [] [] [] | + bluez-pin | [] [] [] [] [] [] [] [] | + bombono-dvd | [] () | + buzztard | [] [] | + cflow | [] | + clisp | [] [] | + coreutils | [] [] [] [] [] [] | + cpio | [] [] [] | + cppi | [] | + cpplib | [] | + cryptsetup | [] | + dfarc | [] | + dialog | [] [] [] [] | + dico | [] | + diffutils | [] [] [] [] [] [] | + dink | () | + doodle | [] [] | + e2fsprogs | [] [] | + enscript | [] [] [] [] [] | + exif | [] [] [] () [] | + fetchmail | [] [] [] [] | + findutils | [] [] [] [] [] | + flex | [] [] [] [] [] | + freedink | [] [] | + gas | | + gawk | [] [] [] [] | + gcal | | + gcc | [] | + gettext-examples | [] [] [] [] [] [] [] [] | + gettext-runtime | [] [] [] [] [] [] [] [] [] | + gettext-tools | [] [] [] [] [] [] | + gip | [] [] [] [] [] | + gjay | | + gliv | [] [] [] [] [] [] | + glunarclock | [] [] [] [] [] | + gnubiff | [] () | + gnucash | [] () () () | + gnuedu | [] | + gnulib | [] [] [] [] | + gnunet | | + gnunet-gtk | | + gnutls | [] [] | + gold | | + gpe-aerial | [] [] [] [] [] [] [] | + gpe-beam | [] [] [] [] [] [] [] | + gpe-bluetooth | [] [] | + gpe-calendar | [] [] [] [] | + gpe-clock | [] [] [] [] [] [] [] [] | + gpe-conf | [] [] [] [] [] [] [] | + gpe-contacts | [] [] [] [] [] | + gpe-edit | [] [] [] | + gpe-filemanager | [] [] [] | + gpe-go | [] [] [] [] [] [] [] [] | + gpe-login | [] [] | + gpe-ownerinfo | [] [] [] [] [] [] [] [] | + gpe-package | [] [] | + gpe-sketchbook | [] [] [] [] [] [] [] | + gpe-su | [] [] [] [] [] [] [] [] | + gpe-taskmanager | [] [] [] [] [] [] [] [] | + gpe-timesheet | [] [] [] [] [] [] [] [] | + gpe-today | [] [] [] [] [] [] [] [] | + gpe-todo | [] [] [] [] [] | + gphoto2 | [] [] [] [] [] [] [] [] | + gprof | [] [] [] | + gpsdrive | [] [] | + gramadoir | [] [] | + grep | [] [] [] [] | + grub | [] [] [] | + gsasl | [] [] [] [] | + gss | [] [] [] | + gst-plugins-bad | [] [] [] [] [] [] | + gst-plugins-base | [] [] [] [] [] | + gst-plugins-good | [] [] [] [] [] | + gst-plugins-ugly | [] [] [] [] [] [] | + gstreamer | [] [] [] [] [] | + gtick | [] [] [] | + gtkam | [] [] [] [] [] [] | + gtkorphan | [] | + gtkspell | [] [] [] [] [] [] [] [] [] [] | + gutenprint | [] [] | + hello | [] [] [] [] | + help2man | [] [] | + hylafax | [] | + idutils | [] [] [] [] [] | + indent | [] [] [] [] [] [] [] | + iso_15924 | [] [] [] [] | + iso_3166 | [] [] [] [] [] () [] [] [] [] [] [] [] [] | + iso_3166_2 | [] [] [] | + iso_4217 | [] [] [] [] [] [] [] [] | + iso_639 | [] [] [] [] [] [] [] [] [] | + iso_639_3 | [] [] | + jwhois | [] [] [] [] | + kbd | [] [] [] | + keytouch | [] [] [] | + keytouch-editor | [] [] [] | + keytouch-keyboa... | [] [] [] | + klavaro | [] [] | + latrine | [] [] | + ld | | + leafpad | [] [] [] [] [] [] [] [] [] | + libc | [] [] [] [] | + libexif | [] [] () [] | + libextractor | | + libgnutls | [] [] | + libgpewidget | [] [] [] | + libgpg-error | [] [] | + libgphoto2 | [] [] | + libgphoto2_port | [] [] [] [] [] | + libgsasl | [] [] [] [] [] | + libiconv | [] [] [] [] [] | + libidn | [] [] | + lifelines | [] [] | + liferea | [] [] [] [] [] () () [] | + lilypond | [] | + linkdr | [] [] [] | + lordsawar | | + lprng | [] | + lynx | [] [] [] | + m4 | [] [] [] [] [] | + mailfromd | [] | + mailutils | [] | + make | [] [] [] [] | + man-db | [] [] [] | + man-db-manpages | [] [] [] | + minicom | [] [] [] [] | + mkisofs | [] [] [] | + myserver | | + nano | [] [] [] [] | + opcodes | [] [] | + parted | [] [] [] [] | + pies | [] | + popt | [] [] [] [] | + psmisc | [] [] [] | + pspp | [] [] | + pwdutils | [] | + radius | [] [] [] | + recode | [] [] [] [] [] [] [] [] | + rosegarden | () () | + rpm | [] [] [] | + rush | [] [] | + sarg | | + screem | | + scrollkeeper | [] [] [] [] [] [] [] [] | + sed | [] [] [] [] [] [] [] [] [] | + sharutils | [] [] [] [] | + shishi | [] | + skencil | [] [] | + solfege | [] [] [] [] | + solfege-manual | [] [] [] | + soundtracker | [] | + sp | | + sysstat | [] [] [] [] | + tar | [] [] [] [] | + texinfo | [] [] [] [] | + tin | [] | + unicode-han-tra... | | + unicode-transla... | | + util-linux-ng | [] [] [] [] [] | + vice | [] | + vmm | [] | + vorbis-tools | [] [] | + wastesedge | [] | + wdiff | [] [] | + wget | [] [] [] [] [] [] [] | + wyslij-po | [] [] [] | + xchat | [] [] [] [] [] [] [] [] [] | + xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] [] | + xkeyboard-config | [] [] [] | + +---------------------------------------------------+ + nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr + 135 10 4 7 105 1 29 62 47 91 3 54 46 9 37 + + sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW + +---------------------------------------------------+ + a2ps | [] [] [] [] [] | 27 + aegis | [] | 9 + ant-phone | [] [] [] [] | 9 + anubis | [] [] [] [] | 15 + aspell | [] [] [] | 20 + bash | [] [] [] | 12 + bfd | [] | 6 + bibshelf | [] [] [] | 16 + binutils | [] [] | 8 + bison | [] [] | 12 + bison-runtime | [] [] [] [] [] [] | 29 + bluez-pin | [] [] [] [] [] [] [] [] | 37 + bombono-dvd | [] | 4 + buzztard | [] | 7 + cflow | [] [] [] | 9 + clisp | | 10 + coreutils | [] [] [] [] | 22 + cpio | [] [] [] [] [] [] | 13 + cppi | [] [] | 5 + cpplib | [] [] [] [] [] [] | 14 + cryptsetup | [] [] | 7 + dfarc | [] | 9 + dialog | [] [] [] [] [] [] [] | 30 + dico | [] | 2 + diffutils | [] [] [] [] [] [] | 30 + dink | | 4 + doodle | [] [] | 7 + e2fsprogs | [] [] [] | 11 + enscript | [] [] [] [] | 17 + exif | [] [] [] | 16 + fetchmail | [] [] [] | 17 + findutils | [] [] [] [] [] | 20 + flex | [] [] [] [] | 15 + freedink | [] | 10 + gas | [] | 4 + gawk | [] [] [] [] | 18 + gcal | [] [] | 5 + gcc | [] [] [] | 7 + gettext-examples | [] [] [] [] [] [] [] | 34 + gettext-runtime | [] [] [] [] [] [] [] | 29 + gettext-tools | [] [] [] [] [] [] | 22 + gip | [] [] [] [] | 22 + gjay | [] | 3 + gliv | [] [] [] | 14 + glunarclock | [] [] [] [] [] | 19 + gnubiff | [] [] | 4 + gnucash | () [] () [] () | 10 + gnuedu | [] [] | 7 + gnulib | [] [] [] [] | 16 + gnunet | [] | 1 + gnunet-gtk | [] [] [] | 5 + gnutls | [] [] [] | 10 + gold | [] | 4 + gpe-aerial | [] [] [] | 18 + gpe-beam | [] [] [] | 19 + gpe-bluetooth | [] [] [] | 13 + gpe-calendar | [] [] [] [] | 12 + gpe-clock | [] [] [] [] [] | 28 + gpe-conf | [] [] [] [] | 20 + gpe-contacts | [] [] [] | 17 + gpe-edit | [] [] [] | 12 + gpe-filemanager | [] [] [] [] | 16 + gpe-go | [] [] [] [] [] | 25 + gpe-login | [] [] [] | 11 + gpe-ownerinfo | [] [] [] [] [] | 25 + gpe-package | [] [] [] | 13 + gpe-sketchbook | [] [] [] | 20 + gpe-su | [] [] [] [] [] | 30 + gpe-taskmanager | [] [] [] [] [] | 29 + gpe-timesheet | [] [] [] [] [] | 25 + gpe-today | [] [] [] [] [] [] | 30 + gpe-todo | [] [] [] [] | 17 + gphoto2 | [] [] [] [] [] | 24 + gprof | [] [] [] | 15 + gpsdrive | [] [] [] | 11 + gramadoir | [] [] [] | 11 + grep | [] [] [] | 10 + grub | [] [] [] | 14 + gsasl | [] [] [] [] | 14 + gss | [] [] [] | 11 + gst-plugins-bad | [] [] [] [] | 26 + gst-plugins-base | [] [] [] [] [] | 24 + gst-plugins-good | [] [] [] [] | 24 + gst-plugins-ugly | [] [] [] [] [] | 29 + gstreamer | [] [] [] [] | 22 + gtick | [] [] [] | 13 + gtkam | [] [] [] | 20 + gtkorphan | [] [] [] | 14 + gtkspell | [] [] [] [] [] [] [] [] [] | 45 + gutenprint | [] | 10 + hello | [] [] [] [] [] [] | 21 + help2man | [] [] | 7 + hylafax | [] | 5 + idutils | [] [] [] [] | 17 + indent | [] [] [] [] [] [] | 30 + iso_15924 | () [] () [] [] | 16 + iso_3166 | [] [] () [] [] () [] [] [] () | 53 + iso_3166_2 | () [] () [] | 9 + iso_4217 | [] () [] [] () [] [] | 26 + iso_639 | [] [] [] () [] () [] [] [] [] | 38 + iso_639_3 | [] () | 8 + jwhois | [] [] [] [] [] | 16 + kbd | [] [] [] [] [] | 15 + keytouch | [] [] [] | 16 + keytouch-editor | [] [] [] | 14 + keytouch-keyboa... | [] [] [] | 14 + klavaro | [] | 11 + latrine | [] [] [] | 10 + ld | [] [] [] [] | 11 + leafpad | [] [] [] [] [] [] | 33 + libc | [] [] [] [] [] | 21 + libexif | [] () | 7 + libextractor | [] | 1 + libgnutls | [] [] [] | 9 + libgpewidget | [] [] [] | 14 + libgpg-error | [] [] [] | 9 + libgphoto2 | [] [] | 8 + libgphoto2_port | [] [] [] [] | 14 + libgsasl | [] [] [] | 13 + libiconv | [] [] [] [] | 21 + libidn | () [] [] | 11 + lifelines | [] | 4 + liferea | [] [] [] | 21 + lilypond | [] | 7 + linkdr | [] [] [] [] [] | 17 + lordsawar | | 1 + lprng | [] | 3 + lynx | [] [] [] [] | 17 + m4 | [] [] [] [] | 19 + mailfromd | [] [] | 3 + mailutils | [] | 5 + make | [] [] [] [] | 21 + man-db | [] [] [] | 8 + man-db-manpages | | 4 + minicom | [] [] | 16 + mkisofs | [] [] | 9 + myserver | | 0 + nano | [] [] [] [] | 21 + opcodes | [] [] [] | 11 + parted | [] [] [] [] [] | 15 + pies | [] [] | 3 + popt | [] [] [] [] [] [] | 27 + psmisc | [] [] | 11 + pspp | | 4 + pwdutils | [] [] | 6 + radius | [] [] | 9 + recode | [] [] [] [] | 28 + rosegarden | () | 0 + rpm | [] [] [] | 11 + rush | [] [] | 4 + sarg | | 1 + screem | [] | 3 + scrollkeeper | [] [] [] [] [] | 27 + sed | [] [] [] [] [] | 30 + sharutils | [] [] [] [] [] | 22 + shishi | [] | 3 + skencil | [] [] | 7 + solfege | [] [] [] [] | 16 + solfege-manual | [] | 8 + soundtracker | [] [] [] | 9 + sp | [] | 3 + sysstat | [] [] | 15 + tar | [] [] [] [] [] [] | 23 + texinfo | [] [] [] [] [] | 17 + tin | | 4 unicode-han-tra... | | 0 unicode-transla... | | 2 - util-linux | [] [] [] | 20 - util-linux-ng | [] [] [] | 20 - vorbis-tools | [] [] | 4 - wastesedge | | 1 - wdiff | [] [] | 23 - wget | [] [] [] | 20 - xchat | [] [] [] [] | 29 - xkeyboard-config | [] [] [] | 14 - xpad | [] [] [] | 15 + util-linux-ng | [] [] [] [] | 20 + vice | () () | 1 + vmm | [] | 4 + vorbis-tools | [] | 6 + wastesedge | | 2 + wdiff | [] [] | 7 + wget | [] [] [] [] [] | 26 + wyslij-po | [] [] | 8 + xchat | [] [] [] [] [] [] | 36 + xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] | 63 + xkeyboard-config | [] [] [] | 22 +---------------------------------------------------+ - 76 teams tg th tk tr uk ven vi wa xh zh_CN zh_HK zh_TW zu - 163 domains 0 3 1 74 51 0 143 21 1 57 7 45 0 2036 + 85 teams sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW + 178 domains 119 1 3 3 0 10 65 51 155 17 98 7 41 2618 Some counters in the preceding matrix are higher than the number of visible blocks let us expect. This is because a few extra PO files are @@ -1042,12 +1256,12 @@ distributed as such by its maintainer. There might be an observable lag between the mere existence a PO file and its wide availability in a distribution. - If November 2007 seems to be old, you may fetch a more recent copy -of this `ABOUT-NLS' file on most GNU archive sites. The most -up-to-date matrix with full percentage details can be found at + If June 2010 seems to be old, you may fetch a more recent copy of +this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date +matrix with full percentage details can be found at `http://translationproject.org/extra/matrix.html'. -1.6 Using `gettext' in new packages +1.5 Using `gettext' in new packages =================================== If you are writing a freely available program and want to diff --git a/ChangeLog b/ChangeLog index e69de29b..1f6ad37d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -0,0 +1,11 @@ +2014-08-10 gettextize + + * m4/gettext.m4: Upgrade to gettext-0.18.3. + * m4/iconv.m4: Upgrade to gettext-0.18.3. + * m4/lib-ld.m4: Upgrade to gettext-0.18.3. + * m4/lib-link.m4: Upgrade to gettext-0.18.3. + * m4/lib-prefix.m4: Upgrade to gettext-0.18.3. + * m4/nls.m4: Upgrade to gettext-0.18.3. + * m4/po.m4: Upgrade to gettext-0.18.3. + * m4/progtest.m4: Upgrade to gettext-0.18.3. + diff --git a/config/config.rpath b/config/config.rpath index c547c688..c38b914d 100755 --- a/config/config.rpath +++ b/config/config.rpath @@ -2,7 +2,7 @@ # Output a system dependent set of variables, describing how to set the # run time search path of shared libraries in an executable. # -# Copyright 1996-2007 Free Software Foundation, Inc. +# Copyright 1996-2013 Free Software Foundation, Inc. # Taken from GNU libtool, 2001 # Originally by Gordon Matzigkeit , 1996 # @@ -25,7 +25,7 @@ # known workaround is to choose shorter directory names for the build # directory and/or the installation directory. -# All known linkers require a `.a' archive for static linking (except MSVC, +# All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a shrext=.so @@ -47,7 +47,7 @@ for cc_temp in $CC""; do done cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'` -# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC. +# Code taken from libtool.m4's _LT_COMPILER_PIC. wl= if test "$GCC" = yes; then @@ -57,14 +57,7 @@ else aix*) wl='-Wl,' ;; - darwin*) - case $cc_basename in - xlc*) - wl='-Wl,' - ;; - esac - ;; - mingw* | cygwin* | pw32* | os2*) + mingw* | cygwin* | pw32* | os2* | cegcc*) ;; hpux9* | hpux10* | hpux11*) wl='-Wl,' @@ -72,24 +65,37 @@ else irix5* | irix6* | nonstopux*) wl='-Wl,' ;; - newsos6) - ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in - icc* | ecc*) + ecc*) wl='-Wl,' ;; - pgcc | pgf77 | pgf90) + icc* | ifort*) + wl='-Wl,' + ;; + lf95*) + wl='-Wl,' + ;; + nagfor*) + wl='-Wl,-Wl,,' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) wl='-Wl,' ;; ccc*) wl='-Wl,' ;; + xl* | bgxl* | bgf* | mpixl*) + wl='-Wl,' + ;; como) wl='-lopt=' ;; *) case `$CC -V 2>&1 | sed 5q` in + *Sun\ F* | *Sun*Fortran*) + wl= + ;; *Sun\ C*) wl='-Wl,' ;; @@ -97,13 +103,24 @@ else ;; esac ;; + newsos6) + ;; + *nto* | *qnx*) + ;; osf3* | osf4* | osf5*) wl='-Wl,' ;; rdos*) ;; solaris*) - wl='-Wl,' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + wl='-Qoption ld ' + ;; + *) + wl='-Wl,' + ;; + esac ;; sunos4*) wl='-Qoption ld ' @@ -124,7 +141,7 @@ else esac fi -# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS. +# Code taken from libtool.m4's _LT_LINKER_SHLIBS. hardcode_libdir_flag_spec= hardcode_libdir_separator= @@ -132,7 +149,7 @@ hardcode_direct=no hardcode_minus_L=no case "$host_os" in - cygwin* | mingw* | pw32*) + cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. @@ -158,22 +175,21 @@ if test "$with_gnu_ld" = yes; then # option of GNU ld is called -rpath, not --rpath. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' case "$host_os" in - aix3* | aix4* | aix5*) + aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no fi ;; amigaos*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we cannot use - # them. - ld_shlibs=no + case "$host_cpu" in + powerpc) + ;; + m68k) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then @@ -182,7 +198,7 @@ if test "$with_gnu_ld" = yes; then ld_shlibs=no fi ;; - cygwin* | mingw* | pw32*) + cygwin* | mingw* | pw32* | cegcc*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' @@ -192,11 +208,13 @@ if test "$with_gnu_ld" = yes; then ld_shlibs=no fi ;; + haiku*) + ;; interix[3-9]*) hardcode_direct=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; - gnu* | linux* | k*bsd*-gnu) + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else @@ -254,7 +272,7 @@ else hardcode_direct=unsupported fi ;; - aix4* | aix5*) + aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. @@ -264,7 +282,7 @@ else # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix5*) + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes @@ -319,14 +337,18 @@ else fi ;; amigaos*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - # see comment about different semantics on the GNU ld section - ld_shlibs=no + case "$host_cpu" in + powerpc) + ;; + m68k) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac ;; bsdi[45]*) ;; - cygwin* | mingw* | pw32*) + cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is @@ -336,24 +358,15 @@ else ;; darwin* | rhapsody*) hardcode_direct=no - if test "$GCC" = yes ; then + if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then : else - case $cc_basename in - xlc*) - ;; - *) - ld_shlibs=no - ;; - esac + ld_shlibs=no fi ;; dgux*) hardcode_libdir_flag_spec='-L$libdir' ;; - freebsd1*) - ld_shlibs=no - ;; freebsd2.2*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes @@ -414,6 +427,8 @@ else hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; + *nto* | *qnx*) + ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes @@ -494,7 +509,7 @@ else fi # Check dynamic linker characteristics -# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER. +# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER. # Unlike libtool.m4, here we don't care about _all_ names of the library, but # only about the one the linker finds when passed -lNAME. This is the last # element of library_names_spec in libtool.m4, or possibly two of them if the @@ -505,11 +520,16 @@ case "$host_os" in aix3*) library_names_spec='$libname.a' ;; - aix4* | aix5*) + aix[4-9]*) library_names_spec='$libname$shrext' ;; amigaos*) - library_names_spec='$libname.a' + case "$host_cpu" in + powerpc*) + library_names_spec='$libname$shrext' ;; + m68k) + library_names_spec='$libname.a' ;; + esac ;; beos*) library_names_spec='$libname$shrext' @@ -517,7 +537,7 @@ case "$host_os" in bsdi[45]*) library_names_spec='$libname$shrext' ;; - cygwin* | mingw* | pw32*) + cygwin* | mingw* | pw32* | cegcc*) shrext=.dll library_names_spec='$libname.dll.a $libname.lib' ;; @@ -528,8 +548,6 @@ case "$host_os" in dgux*) library_names_spec='$libname$shrext' ;; - freebsd1*) - ;; freebsd* | dragonfly*) case "$host_os" in freebsd[123]*) @@ -541,6 +559,9 @@ case "$host_os" in gnu*) library_names_spec='$libname$shrext' ;; + haiku*) + library_names_spec='$libname$shrext' + ;; hpux9* | hpux10* | hpux11*) case $host_cpu in ia64*) @@ -576,7 +597,7 @@ case "$host_os" in ;; linux*oldld* | linux*aout* | linux*coff*) ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) library_names_spec='$libname$shrext' ;; knetbsd*-gnu) @@ -588,7 +609,7 @@ case "$host_os" in newsos6) library_names_spec='$libname$shrext' ;; - nto-qnx*) + *nto* | *qnx*) library_names_spec='$libname$shrext' ;; openbsd*) @@ -619,6 +640,9 @@ case "$host_os" in sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) library_names_spec='$libname$shrext' ;; + tpf*) + library_names_spec='$libname$shrext' + ;; uts4*) library_names_spec='$libname$shrext' ;; diff --git a/m4/gettext.m4 b/m4/gettext.m4 index c9ae1f7d..8d1f0665 100644 --- a/m4/gettext.m4 +++ b/m4/gettext.m4 @@ -1,5 +1,5 @@ -# gettext.m4 serial 60 (gettext-0.17) -dnl Copyright (C) 1995-2007 Free Software Foundation, Inc. +# gettext.m4 serial 66 (gettext-0.18.2) +dnl Copyright (C) 1995-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -15,7 +15,7 @@ dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. -dnl Bruno Haible , 2000-2006. +dnl Bruno Haible , 2000-2006, 2008-2010. dnl Macro to add for using GNU gettext. @@ -35,7 +35,7 @@ dnl will be ignored. If NEEDSYMBOL is specified and is dnl 'need-formatstring-macros', then GNU gettext implementations that don't dnl support the ISO C 99 formatstring macros will be ignored. dnl INTLDIR is used to find the intl libraries. If empty, -dnl the value `$(top_builddir)/intl/' is used. +dnl the value '$(top_builddir)/intl/' is used. dnl dnl The result of the configuration is one of three cases: dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled @@ -60,6 +60,8 @@ AC_DEFUN([AM_GNU_GETTEXT], ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], , [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT ])])])])]) + ifelse(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old], + [AC_DIAGNOSE([obsolete], [Use of AM_GNU_GETTEXT without [external] argument is deprecated.])]) ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT ])])])]) @@ -95,7 +97,7 @@ AC_DEFUN([AM_GNU_GETTEXT], AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) ]) - dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation. + dnl Sometimes, on Mac OS X, libintl requires linking with CoreFoundation. gt_INTL_MACOSX dnl Set USE_NLS. @@ -123,11 +125,11 @@ AC_DEFUN([AM_GNU_GETTEXT], gt_use_preinstalled_gnugettext=no ifelse(gt_included_intl, yes, [ AC_MSG_CHECKING([whether included gettext is requested]) - AC_ARG_WITH(included-gettext, + AC_ARG_WITH([included-gettext], [ --with-included-gettext use the GNU gettext library included here], nls_cv_force_use_gnu_gettext=$withval, nls_cv_force_use_gnu_gettext=no) - AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) + AC_MSG_RESULT([$nls_cv_force_use_gnu_gettext]) nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" if test "$nls_cv_force_use_gnu_gettext" != "yes"; then @@ -155,12 +157,18 @@ changequote([,])dnl fi AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc], - [AC_TRY_LINK([#include + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include $gt_revision_test_code extern int _nl_msg_cat_cntr; -extern int *_nl_domain_bindings;], - [bindtextdomain ("", ""); -return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings], +extern int *_nl_domain_bindings; + ]], + [[ +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings + ]])], [eval "$gt_func_gnugettext_libc=yes"], [eval "$gt_func_gnugettext_libc=no"])]) @@ -181,35 +189,47 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_b gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" dnl Now see whether libintl exists and does not depend on libiconv. - AC_TRY_LINK([#include + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif -const char *_nl_expand_alias (const char *);], - [bindtextdomain ("", ""); -return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")], +const char *_nl_expand_alias (const char *); + ]], + [[ +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") + ]])], [eval "$gt_func_gnugettext_libintl=yes"], [eval "$gt_func_gnugettext_libintl=no"]) dnl Now see whether libintl exists and depends on libiconv. if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" - AC_TRY_LINK([#include + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif -const char *_nl_expand_alias (const char *);], - [bindtextdomain ("", ""); -return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")], - [LIBINTL="$LIBINTL $LIBICONV" - LTLIBINTL="$LTLIBINTL $LTLIBICONV" - eval "$gt_func_gnugettext_libintl=yes" - ]) +const char *_nl_expand_alias (const char *); + ]], + [[ +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") + ]])], + [LIBINTL="$LIBINTL $LIBICONV" + LTLIBINTL="$LTLIBINTL $LTLIBICONV" + eval "$gt_func_gnugettext_libintl=yes" + ]) fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS"]) @@ -267,7 +287,7 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_a if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then - AC_DEFINE(ENABLE_NLS, 1, + AC_DEFINE([ENABLE_NLS], [1], [Define to 1 if translation of program messages to the user's native language is requested.]) else @@ -301,9 +321,9 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_a fi dnl For backward compatibility. Some packages may be using this. - AC_DEFINE(HAVE_GETTEXT, 1, + AC_DEFINE([HAVE_GETTEXT], [1], [Define if the GNU gettext() function is already present or preinstalled.]) - AC_DEFINE(HAVE_DCGETTEXT, 1, + AC_DEFINE([HAVE_DCGETTEXT], [1], [Define if the GNU dcgettext() function is already present or preinstalled.]) fi @@ -319,9 +339,9 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_a fi dnl Make all variables we use known to autoconf. - AC_SUBST(BUILD_INCLUDED_LIBINTL) - AC_SUBST(USE_INCLUDED_LIBINTL) - AC_SUBST(CATOBJEXT) + AC_SUBST([BUILD_INCLUDED_LIBINTL]) + AC_SUBST([USE_INCLUDED_LIBINTL]) + AC_SUBST([CATOBJEXT]) dnl For backward compatibility. Some configure.ins may be using this. nls_cv_header_intl= @@ -329,36 +349,36 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_a dnl For backward compatibility. Some Makefiles may be using this. DATADIRNAME=share - AC_SUBST(DATADIRNAME) + AC_SUBST([DATADIRNAME]) dnl For backward compatibility. Some Makefiles may be using this. INSTOBJEXT=.mo - AC_SUBST(INSTOBJEXT) + AC_SUBST([INSTOBJEXT]) dnl For backward compatibility. Some Makefiles may be using this. GENCAT=gencat - AC_SUBST(GENCAT) + AC_SUBST([GENCAT]) dnl For backward compatibility. Some Makefiles may be using this. INTLOBJS= if test "$USE_INCLUDED_LIBINTL" = yes; then INTLOBJS="\$(GETTOBJS)" fi - AC_SUBST(INTLOBJS) + AC_SUBST([INTLOBJS]) dnl Enable libtool support if the surrounding package wishes it. INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix - AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX) + AC_SUBST([INTL_LIBTOOL_SUFFIX_PREFIX]) ]) dnl For backward compatibility. Some Makefiles may be using this. INTLLIBS="$LIBINTL" - AC_SUBST(INTLLIBS) + AC_SUBST([INTLLIBS]) dnl Make all documented variables known to autoconf. - AC_SUBST(LIBINTL) - AC_SUBST(LTLIBINTL) - AC_SUBST(POSUB) + AC_SUBST([LIBINTL]) + AC_SUBST([LTLIBINTL]) + AC_SUBST([POSUB]) ]) diff --git a/m4/iconv.m4 b/m4/iconv.m4 index 66bc76f4..a5036465 100644 --- a/m4/iconv.m4 +++ b/m4/iconv.m4 @@ -1,5 +1,5 @@ -# iconv.m4 serial AM6 (gettext-0.17) -dnl Copyright (C) 2000-2002, 2007 Free Software Foundation, Inc. +# iconv.m4 serial 18 (gettext-0.18.2) +dnl Copyright (C) 2000-2002, 2007-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -30,44 +30,55 @@ AC_DEFUN([AM_ICONV_LINK], dnl Add $INCICONV to CPPFLAGS before performing the following checks, dnl because if the user has installed libiconv and not disabled its use dnl via --without-libiconv-prefix, he wants to use it. The first - dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed. + dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed. am_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) - AC_CACHE_CHECK([for iconv], am_cv_func_iconv, [ + AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [ am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no - AC_TRY_LINK([#include -#include ], - [iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd);], - am_cv_func_iconv=yes) + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include +#include + ]], + [[iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd);]])], + [am_cv_func_iconv=yes]) if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" - AC_TRY_LINK([#include -#include ], - [iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd);], - am_cv_lib_iconv=yes - am_cv_func_iconv=yes) + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include +#include + ]], + [[iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd);]])], + [am_cv_lib_iconv=yes] + [am_cv_func_iconv=yes]) LIBS="$am_save_LIBS" fi ]) if test "$am_cv_func_iconv" = yes; then - AC_CACHE_CHECK([for working iconv], am_cv_func_iconv_works, [ - dnl This tests against bugs in AIX 5.1 and HP-UX 11.11. + AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [ + dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11, + dnl Solaris 10. am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include #include int main () { + int result = 0; /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { @@ -84,7 +95,47 @@ int main () (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) - return 1; + result |= 1; + iconv_close (cd_utf8_to_88591); + } + } + /* Test against Solaris 10 bug: Failures are not distinguishable from + successful returns. */ + { + iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); + if (cd_ascii_to_88591 != (iconv_t)(-1)) + { + static const char input[] = "\263"; + char buf[10]; + const char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_ascii_to_88591, + (char **) &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + result |= 2; + iconv_close (cd_ascii_to_88591); + } + } + /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static const char input[] = "\304"; + static char buf[2] = { (char)0xDE, (char)0xAD }; + const char *inptr = input; + size_t inbytesleft = 1; + char *outptr = buf; + size_t outbytesleft = 1; + size_t res = iconv (cd_88591_to_utf8, + (char **) &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) + result |= 4; + iconv_close (cd_88591_to_utf8); } } #if 0 /* This bug could be worked around by the caller. */ @@ -103,7 +154,8 @@ int main () (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) - return 1; + result |= 8; + iconv_close (cd_88591_to_utf8); } } #endif @@ -117,13 +169,19 @@ int main () && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) /* Try HP-UX names. */ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) - return 1; - return 0; -}], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no], - [case "$host_os" in + result |= 16; + return result; +}]])], + [am_cv_func_iconv_works=yes], + [am_cv_func_iconv_works=no], + [ +changequote(,)dnl + case "$host_os" in aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; *) am_cv_func_iconv_works="guessing yes" ;; - esac]) + esac +changequote([,])dnl + ]) LIBS="$am_save_LIBS" ]) case "$am_cv_func_iconv_works" in @@ -134,7 +192,7 @@ int main () am_func_iconv=no am_cv_lib_iconv=no fi if test "$am_func_iconv" = yes; then - AC_DEFINE(HAVE_ICONV, 1, + AC_DEFINE([HAVE_ICONV], [1], [Define if you have the iconv() function and it works.]) fi if test "$am_cv_lib_iconv" = yes; then @@ -147,34 +205,64 @@ int main () LIBICONV= LTLIBICONV= fi - AC_SUBST(LIBICONV) - AC_SUBST(LTLIBICONV) + AC_SUBST([LIBICONV]) + AC_SUBST([LTLIBICONV]) ]) -AC_DEFUN([AM_ICONV], +dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to +dnl avoid warnings like +dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required". +dnl This is tricky because of the way 'aclocal' is implemented: +dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN. +dnl Otherwise aclocal's initial scan pass would miss the macro definition. +dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions. +dnl Otherwise aclocal would emit many "Use of uninitialized value $1" +dnl warnings. +m4_define([gl_iconv_AC_DEFUN], + m4_version_prereq([2.64], + [[AC_DEFUN_ONCE( + [$1], [$2])]], + [m4_ifdef([gl_00GNULIB], + [[AC_DEFUN_ONCE( + [$1], [$2])]], + [[AC_DEFUN( + [$1], [$2])]])])) +gl_iconv_AC_DEFUN([AM_ICONV], [ AM_ICONV_LINK if test "$am_cv_func_iconv" = yes; then AC_MSG_CHECKING([for iconv declaration]) - AC_CACHE_VAL(am_cv_proto_iconv, [ - AC_TRY_COMPILE([ + AC_CACHE_VAL([am_cv_proto_iconv], [ + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ #include #include extern #ifdef __cplusplus "C" #endif -#if defined(__STDC__) || defined(__cplusplus) +#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif -], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") + ]], + [[]])], + [am_cv_proto_iconv_arg1=""], + [am_cv_proto_iconv_arg1="const"]) am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` - AC_MSG_RESULT([$]{ac_t:- - }[$]am_cv_proto_iconv) - AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, + AC_MSG_RESULT([ + $am_cv_proto_iconv]) + AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1], [Define as const if the declaration of iconv() needs const.]) + dnl Also substitute ICONV_CONST in the gnulib generated . + m4_ifdef([gl_ICONV_H_DEFAULTS], + [AC_REQUIRE([gl_ICONV_H_DEFAULTS]) + if test -n "$am_cv_proto_iconv_arg1"; then + ICONV_CONST="const" + fi + ]) fi ]) diff --git a/m4/lib-ld.m4 b/m4/lib-ld.m4 index 96c4e2c3..c145e478 100644 --- a/m4/lib-ld.m4 +++ b/m4/lib-ld.m4 @@ -1,50 +1,56 @@ -# lib-ld.m4 serial 3 (gettext-0.13) -dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. +# lib-ld.m4 serial 6 +dnl Copyright (C) 1996-2003, 2009-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Subroutines of libtool.m4, -dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision -dnl with libtool.m4. +dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid +dnl collision with libtool.m4. -dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. +dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no. AC_DEFUN([AC_LIB_PROG_LD_GNU], -[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, -[# I'd rather use --version here, but apparently some GNU ld's only accept -v. +[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld], +[# I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } fi + ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by GCC]) + AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -54,12 +60,12 @@ if test "$GCC" = yes; then esac case $ac_prog in # Accept absolute paths. - [[\\/]* | [A-Za-z]:[\\/]*)] - [re_direlt='/[^/][^/]*/\.\./'] - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'` + while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; @@ -77,33 +83,36 @@ elif test "$with_gnu_ld" = yes; then else AC_MSG_CHECKING([for non-GNU ld]) fi -AC_CACHE_VAL(acl_cv_path_LD, +AC_CACHE_VAL([acl_cv_path_LD], [if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do + IFS="$acl_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. + # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in + case `"$acl_cv_path_LD" -v 2>&1 conftest.sh . ./conftest.sh @@ -131,11 +147,32 @@ AC_DEFUN([AC_LIB_RPATH], acl_hardcode_direct="$acl_cv_hardcode_direct" acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" dnl Determine whether the user wants rpath handling at all. - AC_ARG_ENABLE(rpath, + AC_ARG_ENABLE([rpath], [ --disable-rpath do not hardcode runtime library paths], :, enable_rpath=yes) ]) +dnl AC_LIB_FROMPACKAGE(name, package) +dnl declares that libname comes from the given package. The configure file +dnl will then not have a --with-libname-prefix option but a +dnl --with-package-prefix option. Several libraries can come from the same +dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar +dnl macro call that searches for libname. +AC_DEFUN([AC_LIB_FROMPACKAGE], +[ + pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) + define([acl_frompackage_]NAME, [$2]) + popdef([NAME]) + pushdef([PACK],[$2]) + pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) + define([acl_libsinpackage_]PACKUP, + m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1]) + popdef([PACKUP]) + popdef([PACK]) +]) + dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. @@ -144,19 +181,23 @@ dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_LINKFLAGS_BODY], [ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) - define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) + pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])]) + pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) + pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])]) dnl Autoconf >= 2.61 supports dots in --with options. - define([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit([$1],[.],[_])],[$1])]) + pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) - AC_LIB_ARG_WITH([lib]N_A_M_E[-prefix], -[ --with-lib]N_A_M_E[-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib - --without-lib]N_A_M_E[-prefix don't search for lib$1 in includedir and libdir], + AC_ARG_WITH(P_A_C_K[-prefix], +[[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib + --without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]], [ if test "X$withval" = "Xno"; then use_additional=no @@ -169,6 +210,10 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" + if test "$acl_libdirstem2" != "$acl_libdirstem" \ + && ! test -d "$withval/$acl_libdirstem"; then + additional_libdir="$withval/$acl_libdirstem2" + fi fi fi ]) @@ -178,6 +223,9 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], LTLIB[]NAME= INC[]NAME= LIB[]NAME[]_PREFIX= + dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been + dnl computed. So it has to be reset here. + HAVE_LIB[]NAME= rpathdirs= ltrpathdirs= names_already_handled= @@ -197,7 +245,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], names_already_handled="$names_already_handled $name" dnl See if it was already located by an earlier AC_LIB_LINKFLAGS dnl or AC_LIB_HAVE_LINKFLAGS call. - uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then @@ -327,7 +375,9 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], dnl Linking with a shared library. We attempt to hardcode its dnl directory into the executable's runpath, unless it's the dnl standard /usr/lib. - if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then + if test "$enable_rpath" = no \ + || test "X$found_dir" = "X/usr/$acl_libdirstem" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then dnl No hardcoding is needed. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else @@ -415,7 +465,16 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` - LIB[]NAME[]_PREFIX="$basedir" + if test "$name" = '$1'; then + LIB[]NAME[]_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem2 | */$acl_libdirstem2/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` + if test "$name" = '$1'; then + LIB[]NAME[]_PREFIX="$basedir" + fi additional_includedir="$basedir/include" ;; esac @@ -476,9 +535,11 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], dnl 3. if it's already present in $LDFLAGS or the already dnl constructed $LIBNAME, dnl 4. if it doesn't exist as a directory. - if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then + if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ + && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then haveit= - if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; @@ -609,6 +670,11 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" done fi + popdef([P_A_C_K]) + popdef([PACKLIBS]) + popdef([PACKUP]) + popdef([PACK]) + popdef([NAME]) ]) dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, @@ -654,7 +720,8 @@ AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], if test -n "$next"; then dir="$next" dnl No need to hardcode the standard /usr/lib. - if test "X$dir" != "X/usr/$acl_libdirstem"; then + if test "X$dir" != "X/usr/$acl_libdirstem" \ + && test "X$dir" != "X/usr/$acl_libdirstem2"; then rpathdirs="$rpathdirs $dir" fi next= @@ -663,7 +730,8 @@ AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], -L) next=yes ;; -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` dnl No need to hardcode the standard /usr/lib. - if test "X$dir" != "X/usr/$acl_libdirstem"; then + if test "X$dir" != "X/usr/$acl_libdirstem" \ + && test "X$dir" != "X/usr/$acl_libdirstem2"; then rpathdirs="$rpathdirs $dir" fi next= ;; diff --git a/m4/lib-prefix.m4 b/m4/lib-prefix.m4 index a8684e17..60908e8f 100644 --- a/m4/lib-prefix.m4 +++ b/m4/lib-prefix.m4 @@ -1,5 +1,5 @@ -# lib-prefix.m4 serial 5 (gettext-0.15) -dnl Copyright (C) 2001-2005 Free Software Foundation, Inc. +# lib-prefix.m4 serial 7 (gettext-0.18) +dnl Copyright (C) 2001-2005, 2008-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -153,33 +153,72 @@ AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], prefix="$acl_save_prefix" ]) -dnl AC_LIB_PREPARE_MULTILIB creates a variable acl_libdirstem, containing -dnl the basename of the libdir, either "lib" or "lib64". +dnl AC_LIB_PREPARE_MULTILIB creates +dnl - a variable acl_libdirstem, containing the basename of the libdir, either +dnl "lib" or "lib64" or "lib/64", +dnl - a variable acl_libdirstem2, as a secondary possible value for +dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or +dnl "lib/amd64". AC_DEFUN([AC_LIB_PREPARE_MULTILIB], [ - dnl There is no formal standard regarding lib and lib64. The current - dnl practice is that on a system supporting 32-bit and 64-bit instruction - dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit - dnl libraries go under $prefix/lib. We determine the compiler's default - dnl mode by looking at the compiler's library search path. If at least - dnl of its elements ends in /lib64 or points to a directory whose absolute - dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the - dnl default, namely "lib". + dnl There is no formal standard regarding lib and lib64. + dnl On glibc systems, the current practice is that on a system supporting + dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under + dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine + dnl the compiler's default mode by looking at the compiler's library search + dnl path. If at least one of its elements ends in /lib64 or points to a + dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI. + dnl Otherwise we use the default, namely "lib". + dnl On Solaris systems, the current practice is that on a system supporting + dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under + dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or + dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib. + AC_REQUIRE([AC_CANONICAL_HOST]) acl_libdirstem=lib - searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` - if test -n "$searchpath"; then - acl_save_IFS="${IFS= }"; IFS=":" - for searchdir in $searchpath; do - if test -d "$searchdir"; then - case "$searchdir" in - */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; - *) searchdir=`cd "$searchdir" && pwd` - case "$searchdir" in - */lib64 ) acl_libdirstem=lib64 ;; - esac ;; + acl_libdirstem2= + case "$host_os" in + solaris*) + dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment + dnl . + dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link." + dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the + dnl symlink is missing, so we set acl_libdirstem2 too. + AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit], + [AC_EGREP_CPP([sixtyfour bits], [ +#ifdef _LP64 +sixtyfour bits +#endif + ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no]) + ]) + if test $gl_cv_solaris_64bit = yes; then + acl_libdirstem=lib/64 + case "$host_cpu" in + sparc*) acl_libdirstem2=lib/sparcv9 ;; + i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; esac fi - done - IFS="$acl_save_IFS" - fi + ;; + *) + searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` + if test -n "$searchpath"; then + acl_save_IFS="${IFS= }"; IFS=":" + for searchdir in $searchpath; do + if test -d "$searchdir"; then + case "$searchdir" in + */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; + */../ | */.. ) + # Better ignore directories of this form. They are misleading. + ;; + *) searchdir=`cd "$searchdir" && pwd` + case "$searchdir" in + */lib64 ) acl_libdirstem=lib64 ;; + esac ;; + esac + fi + done + IFS="$acl_save_IFS" + fi + ;; + esac + test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" ]) diff --git a/m4/nls.m4 b/m4/nls.m4 index 7967cc2f..8f8a147b 100644 --- a/m4/nls.m4 +++ b/m4/nls.m4 @@ -1,5 +1,6 @@ -# nls.m4 serial 3 (gettext-0.15) -dnl Copyright (C) 1995-2003, 2005-2006 Free Software Foundation, Inc. +# nls.m4 serial 5 (gettext-0.18) +dnl Copyright (C) 1995-2003, 2005-2006, 2008-2013 Free Software Foundation, +dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -17,15 +18,15 @@ dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. -AC_PREREQ(2.50) +AC_PREREQ([2.50]) AC_DEFUN([AM_NLS], [ AC_MSG_CHECKING([whether NLS is requested]) dnl Default is enabled NLS - AC_ARG_ENABLE(nls, + AC_ARG_ENABLE([nls], [ --disable-nls do not use Native Language Support], USE_NLS=$enableval, USE_NLS=yes) - AC_MSG_RESULT($USE_NLS) - AC_SUBST(USE_NLS) + AC_MSG_RESULT([$USE_NLS]) + AC_SUBST([USE_NLS]) ]) diff --git a/m4/po.m4 b/m4/po.m4 index 0734762a..1c70b6c1 100644 --- a/m4/po.m4 +++ b/m4/po.m4 @@ -1,5 +1,5 @@ -# po.m4 serial 15 (gettext-0.17) -dnl Copyright (C) 1995-2007 Free Software Foundation, Inc. +# po.m4 serial 21 (gettext-0.18.3) +dnl Copyright (C) 1995-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -17,19 +17,20 @@ dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. -AC_PREREQ(2.50) +AC_PREREQ([2.60]) dnl Checks for all prerequisites of the po subdirectory. AC_DEFUN([AM_PO_SUBDIRS], [ AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl - AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake + AC_REQUIRE([AC_PROG_MKDIR_P])dnl + AC_REQUIRE([AC_PROG_SED])dnl AC_REQUIRE([AM_NLS])dnl dnl Release version of the gettext macros. This is used to ensure that dnl the gettext macros and po/Makefile.in.in are in sync. - AC_SUBST([GETTEXT_MACRO_VERSION], [0.17]) + AC_SUBST([GETTEXT_MACRO_VERSION], [0.18]) dnl Perform the following tests also if --disable-nls has been given, dnl because they are needed for "make dist" to work. @@ -41,7 +42,7 @@ AC_DEFUN([AM_PO_SUBDIRS], [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) - AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) + AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT]) dnl Test whether it is GNU msgfmt >= 0.15. changequote(,)dnl @@ -102,7 +103,7 @@ changequote([,])dnl case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` - ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" + ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. @@ -118,7 +119,8 @@ changequote([,])dnl if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" - cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" + gt_tab=`printf '\t'` + cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend # on $ac_dir but don't depend on user-specified configuration @@ -129,12 +131,12 @@ changequote([,])dnl test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` - # Hide the ALL_LINGUAS assigment from automake < 1.5. + # Hide the ALL_LINGUAS assignment from automake < 1.5. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. - # Hide the ALL_LINGUAS assigment from automake < 1.5. + # Hide the ALL_LINGUAS assignment from automake < 1.5. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi # Compute POFILES @@ -226,7 +228,7 @@ AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE], changequote(,)dnl # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` - ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" + ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. @@ -254,6 +256,7 @@ EOT fi # A sed script that extracts the value of VARIABLE from a Makefile. + tab=`printf '\t'` sed_x_variable=' # Test if the hold space is empty. x @@ -261,9 +264,9 @@ s/P/P/ x ta # Yes it was empty. Look if we have the expected variable definition. -/^[ ]*VARIABLE[ ]*=/{ +/^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=/{ # Seen the first line of the variable definition. - s/^[ ]*VARIABLE[ ]*=// + s/^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=// ba } bd @@ -315,7 +318,7 @@ changequote([,])dnl sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'` ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"` fi - # Hide the ALL_LINGUAS assigment from automake < 1.5. + # Hide the ALL_LINGUAS assignment from automake < 1.5. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) @@ -405,14 +408,15 @@ changequote([,])dnl fi sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp" + tab=`printf '\t'` if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` cat >> "$ac_file.tmp" <> "$ac_file.tmp" <, 1996. -AC_PREREQ(2.50) +AC_PREREQ([2.50]) # Search path for a program which passes the given test. @@ -27,15 +27,14 @@ AC_DEFUN([AM_PATH_PROG_WITH_TEST], # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } fi # Find out how to test for executable files. Don't use a zero-byte file, @@ -55,7 +54,7 @@ rm -f conf$$.file # Extract the first word of "$2", so it can be a program name with args. set dummy $2; ac_word=[$]2 AC_MSG_CHECKING([for $ac_word]) -AC_CACHE_VAL(ac_cv_path_$1, +AC_CACHE_VAL([ac_cv_path_$1], [case "[$]$1" in [[\\/]]* | ?:[[\\/]]*) ac_cv_path_$1="[$]$1" # Let the user override the test with a path. @@ -84,9 +83,9 @@ ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" esac])dnl $1="$ac_cv_path_$1" if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then - AC_MSG_RESULT([$]$1) + AC_MSG_RESULT([$][$1]) else - AC_MSG_RESULT(no) + AC_MSG_RESULT([no]) fi -AC_SUBST($1)dnl +AC_SUBST([$1])dnl ]) diff --git a/po/ChangeLog b/po/ChangeLog index 07f045bd..3cafdef3 100644 --- a/po/ChangeLog +++ b/po/ChangeLog @@ -1,3 +1,8 @@ +2014-08-10 gettextize + + * Makefile.in.in: Upgrade to gettext-0.18.3. + * Rules-quot: Upgrade to gettext-0.18.3. + 2010-06-15 gettextize * Makefile.in.in: Upgrade to gettext-0.17. diff --git a/po/Makefile.in.in b/po/Makefile.in.in index fecf500f..fabdc76c 100644 --- a/po/Makefile.in.in +++ b/po/Makefile.in.in @@ -1,5 +1,5 @@ # Makefile for PO directory in any package using GNU gettext. -# Copyright (C) 1995-1997, 2000-2007 by Ulrich Drepper +# Copyright (C) 1995-1997, 2000-2007, 2009-2010 by Ulrich Drepper # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU General Public @@ -8,13 +8,14 @@ # Please note that the actual code of GNU gettext is covered by the GNU # General Public License and is *not* in the public domain. # -# Origin: gettext-0.17 -GETTEXT_MACRO_VERSION = 0.17 +# Origin: gettext-0.18.3 +GETTEXT_MACRO_VERSION = 0.18 PACKAGE = @PACKAGE@ VERSION = @VERSION@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +SED = @SED@ SHELL = /bin/sh @SET_MAKE@ @@ -88,22 +89,22 @@ CATALOGS = @CATALOGS@ .po.gmo: @lang=`echo $* | sed -e 's,.*/,,'`; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ - echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \ - cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo + echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \ + cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo .sin.sed: sed -e '/^#/d' $< > t-$@ mv t-$@ $@ -all: check-macro-version all-@USE_NLS@ +all: all-@USE_NLS@ all-yes: stamp-po all-no: # Ensure that the gettext macros and this Makefile.in.in are in sync. -check-macro-version: - @test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \ +CHECK_MACRO_VERSION = \ + test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \ || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \ exit 1; \ } @@ -123,6 +124,7 @@ check-macro-version: # $(POFILES) has been designed to not touch files that don't need to be # changed. stamp-po: $(srcdir)/$(DOMAIN).pot + @$(CHECK_MACRO_VERSION) test ! -f $(srcdir)/$(DOMAIN).pot || \ test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) @test ! -f $(srcdir)/$(DOMAIN).pot || { \ @@ -137,8 +139,16 @@ stamp-po: $(srcdir)/$(DOMAIN).pot # This target rebuilds $(DOMAIN).pot; it is an expensive operation. # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. +# The determination of whether the package xyz is a GNU one is based on the +# heuristic whether some file in the top level directory mentions "GNU xyz". +# If GNU 'find' is available, we avoid grepping through monster files. $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed - if LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null | grep -v 'libtool:' >/dev/null; then \ + if { if (LC_ALL=C find --version) 2>/dev/null | grep GNU >/dev/null; then \ + LC_ALL=C find -L $(top_srcdir) -maxdepth 1 -type f -size -10000000c -exec grep 'GNU @PACKAGE@' /dev/null '{}' ';' 2>/dev/null; \ + else \ + LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null; \ + fi; \ + } | grep -v 'libtool:' >/dev/null; then \ package_gnu='GNU '; \ else \ package_gnu=''; \ @@ -193,8 +203,15 @@ $(POFILES): $(srcdir)/$(DOMAIN).pot @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ if test -f "$(srcdir)/$${lang}.po"; then \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ - echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \ - cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot; \ + echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \ + cd $(srcdir) \ + && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ + $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \ + *) \ + $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot;; \ + esac; \ + }; \ else \ $(MAKE) $${lang}.po-create; \ fi @@ -217,7 +234,6 @@ install-data: install-data-@USE_NLS@ fi install-data-no: all install-data-yes: all - $(mkdir_p) $(DESTDIR)$(datadir) @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ @@ -269,7 +285,6 @@ installdirs-data: installdirs-data-@USE_NLS@ fi installdirs-data-no: installdirs-data-yes: - $(mkdir_p) $(DESTDIR)$(datadir) @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ @@ -395,9 +410,15 @@ update-po: Makefile tmpdir=`pwd`; \ echo "$$lang:"; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ - echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ + echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ cd $(srcdir); \ - if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \ + if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ + $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ + *) \ + $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ + esac; \ + }; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ @@ -418,9 +439,13 @@ $(DUMMYPOFILES): update-gmo: Makefile $(GMOFILES) @: +# Recreate Makefile by invoking config.status. Explicitly invoke the shell, +# because execution permission bits may not work on the current file system. +# Use @SHELL@, which is the shell determined by autoconf for the use by its +# scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient. Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@ cd $(top_builddir) \ - && $(SHELL) ./config.status $(subdir)/$@.in po-directories + && @SHELL@ ./config.status $(subdir)/$@.in po-directories force: diff --git a/po/Makevars b/po/Makevars index 89166e06..589f9f15 100644 --- a/po/Makevars +++ b/po/Makevars @@ -39,3 +39,15 @@ MSGID_BUGS_ADDRESS = bug-yasm@tortall.net # This is the list of locale categories, beyond LC_MESSAGES, for which the # message catalogs shall be used. It is usually empty. EXTRA_LOCALE_CATEGORIES = + +# This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt' +# context. Possible values are "yes" and "no". Set this to yes if the +# package uses functions taking also a message context, like pgettext(), or +# if in $(XGETTEXT_OPTIONS) you define keywords with a context argument. +USE_MSGCTXT = no + +# These options get passed to msgmerge. +# Useful options are in particular: +# --previous to keep previous msgids of translated messages, +# --quiet to reduce the verbosity. +MSGMERGE_OPTIONS = diff --git a/po/Makevars.template b/po/Makevars.template deleted file mode 100644 index 32692ab4..00000000 --- a/po/Makevars.template +++ /dev/null @@ -1,41 +0,0 @@ -# Makefile variables for PO directory in any package using GNU gettext. - -# Usually the message domain is the same as the package name. -DOMAIN = $(PACKAGE) - -# These two variables depend on the location of this directory. -subdir = po -top_builddir = .. - -# These options get passed to xgettext. -XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ - -# This is the copyright holder that gets inserted into the header of the -# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding -# package. (Note that the msgstr strings, extracted from the package's -# sources, belong to the copyright holder of the package.) Translators are -# expected to transfer the copyright for their translations to this person -# or entity, or to disclaim their copyright. The empty string stands for -# the public domain; in this case the translators are expected to disclaim -# their copyright. -COPYRIGHT_HOLDER = Free Software Foundation, Inc. - -# This is the email address or URL to which the translators shall report -# bugs in the untranslated strings: -# - Strings which are not entire sentences, see the maintainer guidelines -# in the GNU gettext documentation, section 'Preparing Strings'. -# - Strings which use unclear terms or require additional context to be -# understood. -# - Strings which make invalid assumptions about notation of date, time or -# money. -# - Pluralisation problems. -# - Incorrect English spelling. -# - Incorrect formatting. -# It can be your email address, or a mailing list address where translators -# can write to without being subscribed, or the URL of a web page through -# which the translators can contact you. -MSGID_BUGS_ADDRESS = - -# This is the list of locale categories, beyond LC_MESSAGES, for which the -# message catalogs shall be used. It is usually empty. -EXTRA_LOCALE_CATEGORIES = diff --git a/po/Rules-quot b/po/Rules-quot index 9c2a995e..5931e539 100644 --- a/po/Rules-quot +++ b/po/Rules-quot @@ -14,13 +14,13 @@ en@boldquot.po-update: en@boldquot.po-update-en .insert-header.po-update-en: @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ - if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ + if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ ll=`echo $$lang | sed -e 's/@.*//'`; \ LC_ALL=C; export LC_ALL; \ cd $(srcdir); \ - if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$ll -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \ + if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$lang -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) $(SED) -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ From 61c143f85b82b6cbbe1ba54be14713ad5ccb450b Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 10 Aug 2014 10:26:16 -0700 Subject: [PATCH 484/585] Turn on subdir-objects automake option. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index c0507a6b..01b61097 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ AC_INIT([yasm], AC_CONFIG_AUX_DIR(config) AC_CONFIG_HEADER([config.h]) -AM_INIT_AUTOMAKE([1.9.6 foreign]) +AM_INIT_AUTOMAKE([1.9.6 foreign subdir-objects]) AM_MAINTAINER_MODE # From 5364f236cf56a8ce61a049a204997073990dac17 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 10 Aug 2014 10:28:25 -0700 Subject: [PATCH 485/585] Update .gitignore for automake changes. --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 792809fe..d76e398f 100644 --- a/.gitignore +++ b/.gitignore @@ -67,3 +67,6 @@ YASM-VERSION.h ./*.s ./*.asm x64 +*.log +*.trs +.dirstamp From edfcd8ac859d456dfd788fe952cb8283b12329aa Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 10 Aug 2014 10:40:01 -0700 Subject: [PATCH 486/585] VersionGen.cmake: Fix endif. --- cmake/modules/VersionGen.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/modules/VersionGen.cmake b/cmake/modules/VersionGen.cmake index 340455b3..f10ce33c 100644 --- a/cmake/modules/VersionGen.cmake +++ b/cmake/modules/VersionGen.cmake @@ -12,7 +12,7 @@ macro (VERSION_GEN _version _version_file _default_version) list (GET _version_strs 0 _version_strs0) if (NOT (${_version_strs0} STREQUAL "")) set (_vn "v${_version_strs0}") - endif (${_version_strs0}) + endif (NOT (${_version_strs0} STREQUAL "")) elseif (EXISTS "${CMAKE_SOURCE_DIR}/.git") execute_process (COMMAND git describe --match "v[0-9]*" --abbrev=4 HEAD RESULT_VARIABLE _git_result From f9a86422cfec3a2d63e88635ac43460c0477ed20 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 10 Aug 2014 10:41:51 -0700 Subject: [PATCH 487/585] Add vsyasm to cmake build. --- frontends/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/frontends/CMakeLists.txt b/frontends/CMakeLists.txt index 0d117734..9858b616 100644 --- a/frontends/CMakeLists.txt +++ b/frontends/CMakeLists.txt @@ -1,2 +1,3 @@ ADD_SUBDIRECTORY(yasm) ADD_SUBDIRECTORY(tasm) +ADD_SUBDIRECTORY(vsyasm) From 00c85278d1833cbdcaf9b8b0901e84a81d95804e Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 10 Aug 2014 10:58:33 -0700 Subject: [PATCH 488/585] Warnings cleanup. --- frontends/tasm/tasm-options.c | 3 +-- libyasm/section.c | 3 --- modules/arch/x86/x86expr.c | 4 ++-- modules/dbgfmts/dwarf2/dwarf2-line.c | 3 +-- modules/dbgfmts/stabs/stabs-dbgfmt.c | 4 ++-- modules/objfmts/coff/coff-objfmt.c | 3 --- modules/objfmts/elf/elf.c | 10 +++------- modules/objfmts/macho/macho-objfmt.c | 9 +-------- modules/objfmts/rdf/rdf-objfmt.c | 2 -- modules/objfmts/xdf/xdf-objfmt.c | 4 ---- 10 files changed, 10 insertions(+), 35 deletions(-) diff --git a/frontends/tasm/tasm-options.c b/frontends/tasm/tasm-options.c index 7c23c468..57c3bdfd 100644 --- a/frontends/tasm/tasm-options.c +++ b/frontends/tasm/tasm-options.c @@ -102,14 +102,13 @@ parse_cmdline(int argc, char **argv, opt_option *options, size_t nopts, void help_msg(const char *msg, const char *tail, opt_option *options, size_t nopts) { - char optbuf[100], optopt[100]; + char optbuf[100]; size_t i; printf("%s", gettext(msg)); for (i = 0; i < nopts; i++) { optbuf[0] = 0; - optopt[0] = 0; if (options[i].takes_param) { if (options[i].opt) diff --git a/libyasm/section.c b/libyasm/section.c index 8ad7deab..ba582bfa 100644 --- a/libyasm/section.c +++ b/libyasm/section.c @@ -1315,12 +1315,10 @@ yasm_object_optimize(yasm_object *object, yasm_errwarns *errwarns) unsigned long offset = 0; yasm_bytecode *bc = STAILQ_FIRST(§->bcs); - yasm_bytecode *prevbc; bc->bc_index = bc_index++; /* Skip our locally created empty bytecode first. */ - prevbc = bc; bc = STAILQ_NEXT(bc, link); /* Iterate through the remainder, if any. */ @@ -1358,7 +1356,6 @@ yasm_object_optimize(yasm_object *object, yasm_errwarns *errwarns) offset += bc->len*bc->mult_int; } - prevbc = bc; bc = STAILQ_NEXT(bc, link); } } diff --git a/modules/arch/x86/x86expr.c b/modules/arch/x86/x86expr.c index 85feb785..e9ddcce5 100644 --- a/modules/arch/x86/x86expr.c +++ b/modules/arch/x86/x86expr.c @@ -644,7 +644,7 @@ yasm_x86__expr_checkea(x86_effaddr *x86_ea, unsigned char *addrsize, (x86_ea->need_sib && !x86_ea->valid_sib))) { int i; unsigned char low3; - typedef enum { + enum { REG3264_NONE = -1, REG3264_EAX = 0, REG3264_ECX, @@ -664,7 +664,7 @@ yasm_x86__expr_checkea(x86_effaddr *x86_ea, unsigned char *addrsize, REG64_R15, REG64_RIP, SIMDREGS - } reg3264type; + }; int reg3264mult[33] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; diff --git a/modules/dbgfmts/dwarf2/dwarf2-line.c b/modules/dbgfmts/dwarf2/dwarf2-line.c index 151dc198..10bb2f29 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-line.c +++ b/modules/dbgfmts/dwarf2/dwarf2-line.c @@ -691,7 +691,7 @@ yasm_dwarf2__generate_line(yasm_object *object, yasm_linemap *linemap, dwarf2_line_info info; int new; size_t i; - yasm_bytecode *last, *sppbc; + yasm_bytecode *sppbc; dwarf2_spp *spp; dwarf2_head *head; @@ -709,7 +709,6 @@ yasm_dwarf2__generate_line(yasm_object *object, yasm_linemap *linemap, info.dbgfmt_dwarf2 = dbgfmt_dwarf2; info.debug_line = yasm_object_get_general(object, ".debug_line", 1, 0, 0, &new, 0); - last = yasm_section_bcs_last(info.debug_line); /* header */ head = yasm_dwarf2__add_head(dbgfmt_dwarf2, info.debug_line, NULL, 0, 0); diff --git a/modules/dbgfmts/stabs/stabs-dbgfmt.c b/modules/dbgfmts/stabs/stabs-dbgfmt.c index c8cf9b39..5c0cba6a 100644 --- a/modules/dbgfmts/stabs/stabs-dbgfmt.c +++ b/modules/dbgfmts/stabs/stabs-dbgfmt.c @@ -316,7 +316,7 @@ stabs_dbgfmt_generate(yasm_object *object, yasm_linemap *linemap, int new; yasm_bytecode *dbgbc; stabs_stab *stab; - yasm_bytecode *filebc, *nullbc, *laststr, *firstbc; + yasm_bytecode *filebc, *laststr, *firstbc; yasm_symrec *firstsym; yasm_section *stext; @@ -371,7 +371,7 @@ stabs_dbgfmt_generate(yasm_object *object, yasm_linemap *linemap, yasm_section_bcs_append(info.stab, dbgbc); /* initial strtab bytecodes */ - nullbc = stabs_dbgfmt_append_bcstr(info.stabstr, ""); + stabs_dbgfmt_append_bcstr(info.stabstr, ""); filebc = stabs_dbgfmt_append_bcstr(info.stabstr, object->src_filename); stext = yasm_object_find_general(object, ".text"); diff --git a/modules/objfmts/coff/coff-objfmt.c b/modules/objfmts/coff/coff-objfmt.c index 2e96aeb7..b1987ac3 100644 --- a/modules/objfmts/coff/coff-objfmt.c +++ b/modules/objfmts/coff/coff-objfmt.c @@ -524,12 +524,9 @@ coff_objfmt_output_value(yasm_value *value, unsigned char *buf, if (vis & YASM_SYM_COMMON) { /* In standard COFF, COMMON symbols have their length added in */ if (!objfmt_coff->win32) { - /*@dependent@*/ /*@null@*/ coff_symrec_data *csymd; /*@dependent@*/ /*@null@*/ yasm_expr **csize_expr; /*@dependent@*/ /*@null@*/ yasm_intnum *common_size; - csymd = yasm_symrec_get_data(sym, &coff_symrec_data_cb); - assert(csymd != NULL); csize_expr = yasm_symrec_get_common_size(sym); assert(csize_expr != NULL); common_size = yasm_expr_get_intnum(csize_expr, 1); diff --git a/modules/objfmts/elf/elf.c b/modules/objfmts/elf/elf.c index addec913..2486bba8 100644 --- a/modules/objfmts/elf/elf.c +++ b/modules/objfmts/elf/elf.c @@ -82,7 +82,7 @@ elf_set_arch(yasm_arch *arch, yasm_symtab *symtab, int bits_pref) elf_march != NULL; elf_march = elf_machine_handlers[++i]) { - if (yasm__strcasecmp(yasm_arch_keyword(arch), elf_march->arch)==0) + if (yasm__strcasecmp(yasm_arch_keyword(arch), elf_march->arch)==0) { if (yasm__strcasecmp(machine, elf_march->machine)==0) { if (bits_pref == 0 || bits_pref == elf_march->bits) break; @@ -90,6 +90,7 @@ elf_set_arch(yasm_arch *arch, yasm_symtab *symtab, int bits_pref) && yasm__strcasecmp(machine, "amd64") == 0 && yasm__strcasecmp(elf_march->machine, "x32") == 0) break; + } } if (elf_march && elf_march->num_ssyms > 0) @@ -468,13 +469,12 @@ elf_symtab_write_to_file(FILE *f, elf_symtab_head *symtab, yasm_errwarns *errwarns) { unsigned char buf[SYMTAB_MAXSIZE], *bufp; - elf_symtab_entry *entry, *prev; + elf_symtab_entry *entry; unsigned long size = 0; if (!symtab) yasm_internal_error(N_("symtab is null")); - prev = NULL; STAILQ_FOREACH(entry, symtab, qlink) { yasm_intnum *size_intn=NULL, *value_intn=NULL; @@ -537,8 +537,6 @@ elf_symtab_write_to_file(FILE *f, elf_symtab_head *symtab, yasm_intnum_destroy(size_intn); yasm_intnum_destroy(value_intn); - - prev = entry; } return size; } @@ -788,7 +786,6 @@ elf_secthead_write_relocs_to_file(FILE *f, yasm_section *sect, while (reloc) { - yasm_sym_vis vis; unsigned int r_type=0, r_sym; elf_symtab_entry *esym; @@ -798,7 +795,6 @@ elf_secthead_write_relocs_to_file(FILE *f, yasm_section *sect, else r_sym = STN_UNDEF; - vis = yasm_symrec_get_visibility(reloc->reloc.sym); if (!elf_march->map_reloc_info_to_type) yasm_internal_error(N_("Unsupported arch/machine for elf output")); r_type = elf_march->map_reloc_info_to_type(reloc); diff --git a/modules/objfmts/macho/macho-objfmt.c b/modules/objfmts/macho/macho-objfmt.c index 1b009185..0a48d9b9 100644 --- a/modules/objfmts/macho/macho-objfmt.c +++ b/modules/objfmts/macho/macho-objfmt.c @@ -730,12 +730,10 @@ static int macho_objfmt_output_secthead(yasm_section *sect, /*@null@*/ void *d) { /*@null@*/ macho_objfmt_output_info *info = (macho_objfmt_output_info *)d; - yasm_objfmt_macho *objfmt_macho; /*@dependent@*/ /*@null@*/ macho_section_data *msd; unsigned char *localbuf; assert(info != NULL); - objfmt_macho = info->objfmt_macho; msd = yasm_section_get_data(sect, &macho_section_data_cb); assert(msd != NULL); @@ -970,8 +968,6 @@ macho_objfmt_output_str(yasm_symrec *sym, /*@null@*/ void *d) { /*@null@*/ macho_objfmt_output_info *info = (macho_objfmt_output_info *)d; yasm_sym_vis vis = yasm_symrec_get_visibility(sym); - /*@null@*/ macho_symrec_data *xsymd; - assert(info != NULL); @@ -982,7 +978,6 @@ macho_objfmt_output_str(yasm_symrec *sym, /*@null@*/ void *d) yasm_symrec_get_global_name(sym, info->object); size_t len = strlen(name); - xsymd = yasm_symrec_get_data(sym, &macho_symrec_data_cb); fwrite(name, len + 1, 1, info->f); yasm_xfree(name); } @@ -1037,7 +1032,7 @@ macho_objfmt_output(yasm_object *object, FILE *f, int all_syms, unsigned long symtab_count = 0; unsigned long headsize; unsigned int macho_segcmdsize, macho_sectcmdsize, macho_nlistsize; - unsigned int macho_relinfosize, macho_segcmd; + unsigned int macho_segcmd; unsigned int head_ncmds, head_sizeofcmds; unsigned long fileoffset, fileoff_sections; yasm_intnum *val; @@ -1072,7 +1067,6 @@ macho_objfmt_output(yasm_object *object, FILE *f, int all_syms, macho_segcmdsize = MACHO_SEGCMD64_SIZE; macho_sectcmdsize = MACHO_SECTCMD64_SIZE; macho_nlistsize = MACHO_NLIST64_SIZE; - macho_relinfosize = MACHO_RELINFO64_SIZE; long_int_bytes = 8; } else { headsize = @@ -1083,7 +1077,6 @@ macho_objfmt_output(yasm_object *object, FILE *f, int all_syms, macho_segcmdsize = MACHO_SEGCMD_SIZE; macho_sectcmdsize = MACHO_SECTCMD_SIZE; macho_nlistsize = MACHO_NLIST_SIZE; - macho_relinfosize = MACHO_RELINFO_SIZE; long_int_bytes = 4; } diff --git a/modules/objfmts/rdf/rdf-objfmt.c b/modules/objfmts/rdf/rdf-objfmt.c index d081fc54..eb3c6668 100644 --- a/modules/objfmts/rdf/rdf-objfmt.c +++ b/modules/objfmts/rdf/rdf-objfmt.c @@ -183,7 +183,6 @@ rdf_objfmt_output_value(yasm_value *value, unsigned char *buf, yasm_bytecode *bc, int warn, /*@null@*/ void *d) { /*@null@*/ rdf_objfmt_output_info *info = (rdf_objfmt_output_info *)d; - yasm_objfmt_rdf *objfmt_rdf; /*@dependent@*/ /*@null@*/ yasm_intnum *intn; unsigned long intn_minus; unsigned long intn_plus; @@ -191,7 +190,6 @@ rdf_objfmt_output_value(yasm_value *value, unsigned char *buf, unsigned int valsize = value->size; assert(info != NULL); - objfmt_rdf = info->objfmt_rdf; if (value->abs) value->abs = yasm_expr_simplify(value->abs, 1); diff --git a/modules/objfmts/xdf/xdf-objfmt.c b/modules/objfmts/xdf/xdf-objfmt.c index aac6e777..9ad0e60a 100644 --- a/modules/objfmts/xdf/xdf-objfmt.c +++ b/modules/objfmts/xdf/xdf-objfmt.c @@ -149,14 +149,12 @@ xdf_objfmt_output_value(yasm_value *value, unsigned char *buf, yasm_bytecode *bc, int warn, /*@null@*/ void *d) { /*@null@*/ xdf_objfmt_output_info *info = (xdf_objfmt_output_info *)d; - yasm_objfmt_xdf *objfmt_xdf; /*@dependent@*/ /*@null@*/ yasm_intnum *intn; unsigned long intn_minus; int retval; unsigned int valsize = value->size; assert(info != NULL); - objfmt_xdf = info->objfmt_xdf; if (value->abs) value->abs = yasm_expr_simplify(value->abs, 1); @@ -375,13 +373,11 @@ static int xdf_objfmt_output_secthead(yasm_section *sect, /*@null@*/ void *d) { /*@null@*/ xdf_objfmt_output_info *info = (xdf_objfmt_output_info *)d; - yasm_objfmt_xdf *objfmt_xdf; /*@dependent@*/ /*@null@*/ xdf_section_data *xsd; /*@null@*/ xdf_symrec_data *xsymd; unsigned char *localbuf; assert(info != NULL); - objfmt_xdf = info->objfmt_xdf; xsd = yasm_section_get_data(sect, &xdf_section_data_cb); assert(xsd != NULL); From d3ea3ac89f48f0cc28c6c32507afeec6b594cbac Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 10 Aug 2014 12:32:50 -0700 Subject: [PATCH 489/585] genstring.py: Make Python3-compatible. --- frontends/yasm/genstring.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/frontends/yasm/genstring.py b/frontends/yasm/genstring.py index 96f49d9f..5e8bf8a1 100755 --- a/frontends/yasm/genstring.py +++ b/frontends/yasm/genstring.py @@ -23,19 +23,23 @@ # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. +import sys + +def lprint(s, f = sys.stdout, e = '\n') : + f.write(s + e) def file_to_string(fout, str_name, fin_name): from os.path import basename - print >>fout, "/* This file auto-generated from %s by genstring.py - don't edit it */\n" % basename(fin_name) - print >>fout, "static const char* %s[] = {" % str_name - print >>fout, "\n".join(' "%s",' % - l.strip().replace('\\', '\\\\').replace('"', '\\"') - for l in open(fin_name)) - print >>fout, "};" + lprint("/* This file auto-generated from %s by genstring.py - don't edit it */\n" % basename(fin_name), f=fout) + lprint("static const char* %s[] = {" % str_name, f=fout) + lprint("\n".join(' "%s",' % + l.strip().replace('\\', '\\\\').replace('"', '\\"') + for l in open(fin_name)), + f=fout) + lprint("};", f=fout) if __name__ == "__main__": - import sys if len(sys.argv) != 4: - print >>sys.stderr, "Usage: genstring.py " + lprint("Usage: genstring.py ", f=sys.stderr) sys.exit(2) file_to_string(open(sys.argv[2], "w"), sys.argv[1], sys.argv[3]) From 24e01c833fa94947ff815099170311355ad39949 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 10 Aug 2014 12:33:12 -0700 Subject: [PATCH 490/585] Add missing YASM_LIB_DECL declarations. --- libyasm/bytecode.h | 5 +++++ libyasm/expr.h | 2 ++ libyasm/symrec.h | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/libyasm/bytecode.h b/libyasm/bytecode.h index 4e8a801f..47cd2624 100644 --- a/libyasm/bytecode.h +++ b/libyasm/bytecode.h @@ -553,6 +553,7 @@ yasm_dataval *yasm_dv_create_expr(/*@keep@*/ yasm_expr *expn); * \param len length of string * \return Newly allocated data value. */ +YASM_LIB_DECL yasm_dataval *yasm_dv_create_string(/*@keep@*/ char *contents, size_t len); /** Create a new data value from raw bytes data. @@ -567,6 +568,7 @@ yasm_dataval *yasm_dv_create_raw(/*@keep@*/ unsigned char *contents, /** Create a new uninitialized data value. * \return Newly allocated data value. */ +YASM_LIB_DECL yasm_dataval *yasm_dv_create_reserve(void); #ifndef YASM_DOXYGEN @@ -578,6 +580,7 @@ yasm_dataval *yasm_dv_create_reserve(void); * \param dv data value * \return Value, or null if non-value (e.g. string or raw). */ +YASM_LIB_DECL yasm_value *yasm_dv_get_value(yasm_dataval *dv); /** Set multiple field of a data value. @@ -586,6 +589,7 @@ yasm_value *yasm_dv_get_value(yasm_dataval *dv); * \param dv data value * \param e multiple (kept, do not free) */ +YASM_LIB_DECL void yasm_dv_set_multiple(yasm_dataval *dv, /*@keep@*/ yasm_expr *e); /** Get the data value multiple value as an unsigned long integer. @@ -593,6 +597,7 @@ void yasm_dv_set_multiple(yasm_dataval *dv, /*@keep@*/ yasm_expr *e); * \param multiple multiple value (output) * \return 1 on error (set with yasm_error_set), 0 on success. */ +YASM_LIB_DECL int yasm_dv_get_multiple(yasm_dataval *dv, /*@out@*/ unsigned long *multiple); /** Initialize a list of data values. diff --git a/libyasm/expr.h b/libyasm/expr.h index 2b06cd3a..0de62dfe 100644 --- a/libyasm/expr.h +++ b/libyasm/expr.h @@ -296,11 +296,13 @@ void yasm_expr_print(/*@null@*/ const yasm_expr *e, FILE *f); /** Return the size of an expression, if the user provided it * \param e expression */ +YASM_LIB_DECL unsigned int yasm_expr_size(const yasm_expr *e); /** Return the segment of an expression, if the user provided it * \param e expression */ +YASM_LIB_DECL const char *yasm_expr_segment(const yasm_expr *e); /** Traverse over expression tree in order (const version). diff --git a/libyasm/symrec.h b/libyasm/symrec.h index 62071589..b1f797c6 100644 --- a/libyasm/symrec.h +++ b/libyasm/symrec.h @@ -326,24 +326,28 @@ int yasm_symrec_get_label(const yasm_symrec *sym, * \param sym symbol * \param size size to be set */ +YASM_LIB_DECL void yasm_symrec_set_size(yasm_symrec *sym, int size); /** Get the size of a symbol. * \param sym symbol * \return size of the symbol, 0 if none specified by the user. */ +YASM_LIB_DECL int yasm_symrec_get_size(const yasm_symrec *sym); /** Set the segment of a symbol. * \param sym symbol * \param segment segment to be set */ +YASM_LIB_DECL void yasm_symrec_set_segment(yasm_symrec *sym, const char *segment); /** Get the segment of a symbol. * \param sym symbol * \return segment of the symbol, NULL if none specified by the user. */ +YASM_LIB_DECL const char *yasm_symrec_get_segment(const yasm_symrec *sym); /** Determine if symbol is the "absolute" symbol created by From 636dc92558efd052cd0553203f67068171a3116c Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 10 Aug 2014 21:38:48 -0700 Subject: [PATCH 491/585] Allow building of static executables with cmake. --- CMakeLists.txt | 4 ++-- config.h.cmake | 3 +++ frontends/tasm/CMakeLists.txt | 20 ++++++++++++------ frontends/tasm/tasm.c | 12 +++++++++-- frontends/vsyasm/CMakeLists.txt | 20 ++++++++++++------ frontends/vsyasm/vsyasm.c | 18 ++++++++++++----- frontends/yasm/CMakeLists.txt | 20 ++++++++++++------ frontends/yasm/yasm.c | 18 ++++++++++++----- libyasm-stdint.h.cmake | 11 +++++++++- libyasm/CMakeLists.txt | 16 ++++++++++----- modules/CMakeLists.txt | 36 +++++++++++++++++++++------------ 11 files changed, 127 insertions(+), 51 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b63d14b7..974a34b9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ if (COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif (COMMAND cmake_policy) -SET(BUILD_SHARED_LIBS ON) +OPTION(BUILD_SHARED_LIBS "Build shared libraries" ON) # Where to look first for cmake modules set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules") @@ -31,7 +31,7 @@ VERSION_GEN(PACKAGE_VERSION "${CMAKE_BINARY_DIR}/YASM-VERSION-FILE" "1.1.0") set (PACKAGE_STRING "yasm ${PACKAGE_VERSION}") -INCLUDE_DIRECTORIES(BEFORE ${CMAKE_BINARY_DIR} ${yasm_SOURCE_DIR}) +INCLUDE_DIRECTORIES(AFTER ${CMAKE_BINARY_DIR} ${yasm_SOURCE_DIR}) INCLUDE(ConfigureChecks.cmake) diff --git a/config.h.cmake b/config.h.cmake index 50ed93ab..e0026778 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -2,6 +2,9 @@ #define CMAKE_BUILD 1 +/* Define if shared libs are being built */ +#cmakedefine BUILD_SHARED_LIBS 1 + /* Define if messsage translations are enabled */ #cmakedefine ENABLE_NLS 1 diff --git a/frontends/tasm/CMakeLists.txt b/frontends/tasm/CMakeLists.txt index 982b95d1..e275ab84 100644 --- a/frontends/tasm/CMakeLists.txt +++ b/frontends/tasm/CMakeLists.txt @@ -15,12 +15,20 @@ ADD_CUSTOM_COMMAND( SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}) -ADD_EXECUTABLE(ytasm - tasm.c - tasm-options.c - ${yasm_SOURCE_DIR}/frontends/yasm/yasm-plugin.c - ) -TARGET_LINK_LIBRARIES(ytasm libyasm ${LIBDL}) +IF(BUILD_SHARED_LIBS) + ADD_EXECUTABLE(ytasm + tasm.c + tasm-options.c + ${yasm_SOURCE_DIR}/frontends/yasm/yasm-plugin.c + ) + TARGET_LINK_LIBRARIES(ytasm libyasm ${LIBDL}) +ELSE(BUILD_SHARED_LIBS) + ADD_EXECUTABLE(ytasm + tasm.c + tasm-options.c + ) + TARGET_LINK_LIBRARIES(ytasm yasmstd libyasm) +ENDIF(BUILD_SHARED_LIBS) SET_SOURCE_FILES_PROPERTIES(tasm.c PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/license.c diff --git a/frontends/tasm/tasm.c b/frontends/tasm/tasm.c index b0b89de7..58954b64 100644 --- a/frontends/tasm/tasm.c +++ b/frontends/tasm/tasm.c @@ -38,7 +38,7 @@ #include "tasm-options.h" -#ifdef CMAKE_BUILD +#if defined(CMAKE_BUILD) && defined(BUILD_SHARED_LIBS) #include "yasm-plugin.h" #endif @@ -46,6 +46,10 @@ #define DEFAULT_OBJFMT_MODULE "bin" +#if defined(CMAKE_BUILD) && !defined(BUILD_SHARED_LIBS) +void yasm_init_plugin(void); +#endif + /*@null@*/ /*@only@*/ static char *obj_filename = NULL, *in_filename = NULL; /*@null@*/ /*@only@*/ static char *list_filename = NULL, *xref_filename = NULL; /*@null@*/ /*@only@*/ static char *machine_name = NULL; @@ -457,10 +461,14 @@ main(int argc, char *argv[]) #ifdef CMAKE_BUILD /* Load standard modules */ +#ifdef BUILD_SHARED_LIBS if (!load_plugin("yasmstd")) { print_error(_("%s: could not load standard modules"), _("FATAL")); return EXIT_FAILURE; } +#else + yasm_init_plugin(); +#endif #endif /* Initialize parameter storage */ @@ -640,7 +648,7 @@ cleanup(yasm_object *object) if (errfile != stderr && errfile != stdout) fclose(errfile); -#ifdef CMAKE_BUILD +#if defined(CMAKE_BUILD) && defined(BUILD_SHARED_LIBS) unload_plugins(); #endif } diff --git a/frontends/vsyasm/CMakeLists.txt b/frontends/vsyasm/CMakeLists.txt index 62c7405c..6815b18d 100644 --- a/frontends/vsyasm/CMakeLists.txt +++ b/frontends/vsyasm/CMakeLists.txt @@ -15,12 +15,20 @@ ADD_CUSTOM_COMMAND( SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}) -ADD_EXECUTABLE(vsyasm - vsyasm.c - ${yasm_SOURCE_DIR}/frontends/yasm/yasm-options.c - ${yasm_SOURCE_DIR}/frontends/yasm/yasm-plugin.c - ) -TARGET_LINK_LIBRARIES(vsyasm libyasm ${LIBDL}) +IF(BUILD_SHARED_LIBS) + ADD_EXECUTABLE(vsyasm + vsyasm.c + ${yasm_SOURCE_DIR}/frontends/yasm/yasm-options.c + ${yasm_SOURCE_DIR}/frontends/yasm/yasm-plugin.c + ) + TARGET_LINK_LIBRARIES(vsyasm libyasm ${LIBDL}) +ELSE(BUILD_SHARED_LIBS) + ADD_EXECUTABLE(vsyasm + vsyasm.c + ${yasm_SOURCE_DIR}/frontends/yasm/yasm-options.c + ) + TARGET_LINK_LIBRARIES(vsyasm yasmstd libyasm) +ENDIF(BUILD_SHARED_LIBS) SET_SOURCE_FILES_PROPERTIES(vsyasm.c PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/license.c diff --git a/frontends/vsyasm/vsyasm.c b/frontends/vsyasm/vsyasm.c index 4ab46369..905145fa 100644 --- a/frontends/vsyasm/vsyasm.c +++ b/frontends/vsyasm/vsyasm.c @@ -37,12 +37,16 @@ #include "frontends/yasm/yasm-options.h" -#ifdef CMAKE_BUILD +#if defined(CMAKE_BUILD) && defined(BUILD_SHARED_LIBS) #include "frontends/yasm/yasm-plugin.h" #endif #include "license.c" +#if defined(CMAKE_BUILD) && !defined(BUILD_SHARED_LIBS) +void yasm_init_plugin(void); +#endif + /*@null@*/ /*@only@*/ static char *objdir_pathname = NULL; /*@null@*/ /*@only@*/ static char *global_prefix = NULL, *global_suffix = NULL; /*@null@*/ /*@only@*/ static char *listdir_pathname = NULL; @@ -107,7 +111,7 @@ static int opt_preproc_option(char *cmd, /*@null@*/ char *param, int extra); static int opt_ewmsg_handler(char *cmd, /*@null@*/ char *param, int extra); static int opt_prefix_handler(char *cmd, /*@null@*/ char *param, int extra); static int opt_suffix_handler(char *cmd, /*@null@*/ char *param, int extra); -#ifdef CMAKE_BUILD +#if defined(CMAKE_BUILD) && defined(BUILD_SHARED_LIBS) static int opt_plugin_handler(char *cmd, /*@null@*/ char *param, int extra); #endif @@ -207,7 +211,7 @@ static opt_option options[] = N_("append argument to name of all external symbols"), N_("suffix") }, { 0, "postfix", 1, opt_suffix_handler, 0, N_("append argument to name of all external symbols"), N_("suffix") }, -#ifdef CMAKE_BUILD +#if defined(CMAKE_BUILD) && defined(BUILD_SHARED_LIBS) { 'N', "plugin", 1, opt_plugin_handler, 0, N_("load plugin module"), N_("plugin") }, #endif @@ -542,10 +546,14 @@ main(int argc, char *argv[]) #ifdef CMAKE_BUILD /* Load standard modules */ +#ifdef BUILD_SHARED_LIBS if (!load_plugin("yasmstd")) { print_error(_("%s: could not load standard modules"), _("FATAL")); return EXIT_FAILURE; } +#else + yasm_init_plugin(); +#endif #endif /* Initialize parameter storage */ @@ -783,7 +791,7 @@ cleanup(void) if (errfile != stderr && errfile != stdout) fclose(errfile); -#ifdef CMAKE_BUILD +#if defined(CMAKE_BUILD) && defined(BUILD_SHARED_LIBS) unload_plugins(); #endif } @@ -1201,7 +1209,7 @@ opt_suffix_handler(/*@unused@*/ char *cmd, char *param, /*@unused@*/ int extra) return 0; } -#ifdef CMAKE_BUILD +#if defined(CMAKE_BUILD) && defined(BUILD_SHARED_LIBS) static int opt_plugin_handler(/*@unused@*/ char *cmd, char *param, /*@unused@*/ int extra) diff --git a/frontends/yasm/CMakeLists.txt b/frontends/yasm/CMakeLists.txt index 6d963eb4..b11d7f82 100644 --- a/frontends/yasm/CMakeLists.txt +++ b/frontends/yasm/CMakeLists.txt @@ -12,12 +12,20 @@ ADD_CUSTOM_COMMAND( SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}) -ADD_EXECUTABLE(yasm - yasm.c - yasm-options.c - yasm-plugin.c - ) -TARGET_LINK_LIBRARIES(yasm libyasm ${LIBDL}) +IF(BUILD_SHARED_LIBS) + ADD_EXECUTABLE(yasm + yasm.c + yasm-options.c + yasm-plugin.c + ) + TARGET_LINK_LIBRARIES(yasm libyasm ${LIBDL}) +ELSE(BUILD_SHARED_LIBS) + ADD_EXECUTABLE(yasm + yasm.c + yasm-options.c + ) + TARGET_LINK_LIBRARIES(yasm yasmstd libyasm) +ENDIF(BUILD_SHARED_LIBS) SET_SOURCE_FILES_PROPERTIES(yasm.c PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/license.c diff --git a/frontends/yasm/yasm.c b/frontends/yasm/yasm.c index 44358549..ff4c59e2 100644 --- a/frontends/yasm/yasm.c +++ b/frontends/yasm/yasm.c @@ -37,7 +37,7 @@ #include "yasm-options.h" -#ifdef CMAKE_BUILD +#if defined(CMAKE_BUILD) && defined(BUILD_SHARED_LIBS) #include "yasm-plugin.h" #endif @@ -108,10 +108,14 @@ static int opt_ewmsg_handler(char *cmd, /*@null@*/ char *param, int extra); static int opt_makedep_handler(char *cmd, /*@null@*/ char *param, int extra); static int opt_prefix_handler(char *cmd, /*@null@*/ char *param, int extra); static int opt_suffix_handler(char *cmd, /*@null@*/ char *param, int extra); -#ifdef CMAKE_BUILD +#if defined(CMAKE_BUILD) && defined(BUILD_SHARED_LIBS) static int opt_plugin_handler(char *cmd, /*@null@*/ char *param, int extra); #endif +#if defined(CMAKE_BUILD) && !defined(BUILD_SHARED_LIBS) +void yasm_init_plugin(void); +#endif + static /*@only@*/ char *replace_extension(const char *orig, /*@null@*/ const char *ext, const char *def); static void print_error(const char *fmt, ...); @@ -204,7 +208,7 @@ static opt_option options[] = N_("append argument to name of all external symbols"), N_("suffix") }, { 0, "postfix", 1, opt_suffix_handler, 0, N_("append argument to name of all external symbols"), N_("suffix") }, -#ifdef CMAKE_BUILD +#if defined(CMAKE_BUILD) && defined(BUILD_SHARED_LIBS) { 'N', "plugin", 1, opt_plugin_handler, 0, N_("load plugin module"), N_("plugin") }, #endif @@ -611,10 +615,14 @@ main(int argc, char *argv[]) #ifdef CMAKE_BUILD /* Load standard modules */ +#ifdef BUILD_SHARED_LIBS if (!load_plugin("yasmstd")) { print_error(_("%s: could not load standard modules"), _("FATAL")); return EXIT_FAILURE; } +#else + yasm_init_plugin(); +#endif #endif /* Initialize parameter storage */ @@ -811,7 +819,7 @@ cleanup(yasm_object *object) if (errfile != stderr && errfile != stdout) fclose(errfile); -#ifdef CMAKE_BUILD +#if defined(CMAKE_BUILD) && defined(BUILD_SHARED_LIBS) unload_plugins(); #endif } @@ -1192,7 +1200,7 @@ opt_suffix_handler(/*@unused@*/ char *cmd, char *param, /*@unused@*/ int extra) return 0; } -#ifdef CMAKE_BUILD +#if defined(CMAKE_BUILD) && defined(BUILD_SHARED_LIBS) static int opt_plugin_handler(/*@unused@*/ char *cmd, char *param, /*@unused@*/ int extra) diff --git a/libyasm-stdint.h.cmake b/libyasm-stdint.h.cmake index f2361d4c..3759a035 100644 --- a/libyasm-stdint.h.cmake +++ b/libyasm-stdint.h.cmake @@ -20,8 +20,13 @@ typedef unsigned long uintptr_t; typedef unsigned long uintptr_t; #endif +#ifndef BUILD_SHARED_LIBS +#cmakedefine BUILD_SHARED_LIBS +#define BUILD_SHARED_LIBS_UNDEF +#endif + #ifndef YASM_LIB_DECL -# ifdef _MSC_VER +# if defined(BUILD_SHARED_LIBS) && defined(_MSC_VER) # ifdef YASM_LIB_SOURCE # define YASM_LIB_DECL __declspec(dllexport) # else @@ -33,5 +38,9 @@ typedef unsigned long uintptr_t; #endif #undef HAVE_STDINT_H +#ifdef BUILD_SHARED_LIBS_UNDEF +#undef BUILD_SHARED_LIBS +#undef BUILD_SHARED_LIBS_UNDEF +#endif #endif diff --git a/libyasm/CMakeLists.txt b/libyasm/CMakeLists.txt index f886f734..bd9b7b28 100644 --- a/libyasm/CMakeLists.txt +++ b/libyasm/CMakeLists.txt @@ -1,6 +1,6 @@ SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}) -ADD_LIBRARY(libyasm SHARED +ADD_LIBRARY(libyasm assocdat.c bitvect.c bc-align.c @@ -31,10 +31,16 @@ ADD_LIBRARY(libyasm SHARED xmalloc.c xstrdup.c ) -SET_TARGET_PROPERTIES(libyasm PROPERTIES - OUTPUT_NAME "yasm" - COMPILE_FLAGS -DYASM_LIB_SOURCE - ) +IF(BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES(libyasm PROPERTIES + OUTPUT_NAME "yasm" + COMPILE_FLAGS -DYASM_LIB_SOURCE + ) +ELSE(BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES(libyasm PROPERTIES + COMPILE_FLAGS -DYASM_LIB_SOURCE + ) +ENDIF(BUILD_SHARED_LIBS) INSTALL(TARGETS libyasm RUNTIME DESTINATION bin diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt index 48a3b5cf..e3f8eb11 100644 --- a/modules/CMakeLists.txt +++ b/modules/CMakeLists.txt @@ -56,9 +56,11 @@ IF(regen_init_plugin_c) FILE(APPEND ${INIT_PLUGIN_C} "extern yasm_${_type}_module yasm_${_keyword}_LTX_${_type};\n") ENDFOREACH(module) - FILE(APPEND ${INIT_PLUGIN_C} "\n#ifdef _MSC_VER\n") - FILE(APPEND ${INIT_PLUGIN_C} "__declspec(dllexport)\n") - FILE(APPEND ${INIT_PLUGIN_C} "#endif\n") + IF(BUILD_SHARED_LIBS) + FILE(APPEND ${INIT_PLUGIN_C} "\n#ifdef _MSC_VER\n") + FILE(APPEND ${INIT_PLUGIN_C} "__declspec(dllexport)\n") + FILE(APPEND ${INIT_PLUGIN_C} "#endif\n") + ENDIF(BUILD_SHARED_LIBS) FILE(APPEND ${INIT_PLUGIN_C} "void\n") FILE(APPEND ${INIT_PLUGIN_C} "yasm_init_plugin(void)\n") FILE(APPEND ${INIT_PLUGIN_C} "{\n") @@ -80,14 +82,22 @@ SET_SOURCE_FILES_PROPERTIES(init_plugin.c GENERATED) SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}) -ADD_LIBRARY(yasmstd MODULE - init_plugin.c - ${YASM_MODULES_SRC} - ) -TARGET_LINK_LIBRARIES(yasmstd libyasm) +IF(BUILD_SHARED_LIBS) + ADD_LIBRARY(yasmstd MODULE + init_plugin.c + ${YASM_MODULES_SRC} + ) + TARGET_LINK_LIBRARIES(yasmstd libyasm) -IF(WIN32) - INSTALL(TARGETS yasmstd LIBRARY DESTINATION bin) -ELSE(WIN32) - INSTALL(TARGETS yasmstd LIBRARY DESTINATION lib) -ENDIF(WIN32) + IF(WIN32) + INSTALL(TARGETS yasmstd LIBRARY DESTINATION bin) + ELSE(WIN32) + INSTALL(TARGETS yasmstd LIBRARY DESTINATION lib) + ENDIF(WIN32) +ELSE(BUILD_SHARED_LIBS) + ADD_LIBRARY(yasmstd + init_plugin.c + ${YASM_MODULES_SRC} + ) + TARGET_LINK_LIBRARIES(yasmstd libyasm) +ENDIF(BUILD_SHARED_LIBS) From ba463d3c26c0ece2e797b8d6381b161633b5971a Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 10 Aug 2014 00:48:20 -0700 Subject: [PATCH 492/585] Bump DEF_VER to 1.3.0 for release. --- CMakeLists.txt | 2 +- YASM-VERSION-GEN.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 974a34b9..8df871cf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,7 +27,7 @@ IF(NOT CMAKE_BUILD_TYPE) FORCE) ENDIF(NOT CMAKE_BUILD_TYPE) -VERSION_GEN(PACKAGE_VERSION "${CMAKE_BINARY_DIR}/YASM-VERSION-FILE" "1.1.0") +VERSION_GEN(PACKAGE_VERSION "${CMAKE_BINARY_DIR}/YASM-VERSION-FILE" "1.3.0") set (PACKAGE_STRING "yasm ${PACKAGE_VERSION}") diff --git a/YASM-VERSION-GEN.sh b/YASM-VERSION-GEN.sh index 3a9f7436..33469507 100755 --- a/YASM-VERSION-GEN.sh +++ b/YASM-VERSION-GEN.sh @@ -1,7 +1,7 @@ #!/bin/sh YVF=YASM-VERSION-FILE -DEF_VER=v1.2.0 +DEF_VER=v1.3.0 LF=' ' From 4c2772c3f90fe66c21642f838e73dba20284fb0a Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 19 Sep 2014 00:44:49 -0700 Subject: [PATCH 493/585] Add missing objfmt_x64 to CMakeLists.txt. This caused cmake builds to not recognize "x64" as an object format. Reported by: Brian Gladman --- modules/objfmts/coff/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/objfmts/coff/CMakeLists.txt b/modules/objfmts/coff/CMakeLists.txt index 5f63d4f7..b25f9ac8 100644 --- a/modules/objfmts/coff/CMakeLists.txt +++ b/modules/objfmts/coff/CMakeLists.txt @@ -25,3 +25,4 @@ YASM_ADD_MODULE(objfmt_coff ) list(APPEND YASM_MODULES objfmt_win32) list(APPEND YASM_MODULES objfmt_win64) +list(APPEND YASM_MODULES objfmt_x64) From 1910e914792399137dec0b047c59965207245df5 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 26 Sep 2014 21:12:42 -0700 Subject: [PATCH 494/585] COFF/PE: Always set paddr and vaddr to 0. It appears that GNU binutils always interpret PE/COFF object files as if they were executable files, namely that the paddr field is a rounded-up section size (aka virtual size). Yasm previously followed the Microsoft specification which stated that for object files this field should be set to the "physical address" of the section (e.g. the sum of all previous section sizes). However, several other sources state this field should be set to 0 in object files, and it appears that Microsoft tools accept this. For compatibility with the GNU tools, this commit makes Yasm always set the paddr/vsize field to 0. This commit also eliminates the COFF_SET_VMA customization for COFF files. Previously this was used to set LMA=VMA in COFF, but LMA=0 in PE. Now that VMA is always 0, this is no longer required (LMA=VMA=0 in both PE and COFF). --- .../tests/passwin64/dwarfwin64_testhd.hex | 16 +- modules/objfmts/coff/coff-objfmt.c | 55 +- modules/objfmts/coff/tests/cofftest.hex | 40 +- modules/objfmts/coff/tests/cofftimes.hex | 18 +- modules/objfmts/coff/tests/x86id.hex | 41558 ++++++++-------- modules/objfmts/win32/tests/gas/win32at.hex | 8 +- .../objfmts/win32/tests/gas/win32secrel32.hex | 4 +- modules/objfmts/win32/tests/win32-curpos.hex | 4 +- .../objfmts/win32/tests/win32-longsect.hex | 8 +- modules/objfmts/win32/tests/win32-safeseh.hex | 2 +- modules/objfmts/win32/tests/win32-segof.hex | 2 +- modules/objfmts/win32/tests/win32test.hex | 4 +- .../objfmts/win64/tests/gas/win64-gas-sce.hex | 4 +- modules/objfmts/win64/tests/sce1.hex | 4 +- modules/objfmts/win64/tests/sce2.hex | 4 +- modules/objfmts/win64/tests/sce3.hex | 4 +- modules/objfmts/win64/tests/sce4.hex | 2 +- modules/objfmts/win64/tests/win64-curpos.hex | 4 +- modules/objfmts/win64/tests/win64-dataref.hex | 20 +- .../objfmts/win64/tests/win64-dataref2.hex | 2 +- .../objfmts/win64/tests/win64-imagebase.hex | 6 +- 21 files changed, 20859 insertions(+), 20910 deletions(-) diff --git a/modules/dbgfmts/dwarf2/tests/passwin64/dwarfwin64_testhd.hex b/modules/dbgfmts/dwarf2/tests/passwin64/dwarfwin64_testhd.hex index 114906bf..18adfd50 100644 --- a/modules/dbgfmts/dwarf2/tests/passwin64/dwarfwin64_testhd.hex +++ b/modules/dbgfmts/dwarf2/tests/passwin64/dwarfwin64_testhd.hex @@ -186,8 +186,8 @@ f3 00 00 00 -04 -01 +00 +00 00 00 00 @@ -266,8 +266,8 @@ ce 00 00 00 -50 -01 +00 +00 00 00 00 @@ -466,8 +466,8 @@ aa 00 00 00 -98 -01 +00 +00 00 00 00 @@ -506,8 +506,8 @@ f4 00 00 00 -bb -01 +00 +00 00 00 00 diff --git a/modules/objfmts/coff/coff-objfmt.c b/modules/objfmts/coff/coff-objfmt.c index b1987ac3..6fcb0e3c 100644 --- a/modules/objfmts/coff/coff-objfmt.c +++ b/modules/objfmts/coff/coff-objfmt.c @@ -34,15 +34,6 @@ #define REGULAR_OUTBUF_SIZE 1024 -/* Defining this to 0 sets all section VMA's to 0 rather than as the same as - * the LMA. According to the DJGPP COFF Spec, this should be set to 1 - * (VMA=LMA), and indeed DJGPP's GCC output shows VMA=LMA. However, NASM - * outputs VMA=0 (as if this was 0), and GNU objdump output looks a lot nicer - * with VMA=0. Who's right? This is #defined as changing this setting affects - * several places in the code. - */ -#define COFF_SET_VMA (!objfmt_coff->win32) - #define COFF_MACHINE_I386 0x014C #define COFF_MACHINE_AMD64 0x8664 @@ -429,22 +420,6 @@ coff_objfmt_init_new_section(yasm_section *sect, unsigned long line) data->sym = sym; } -static int -coff_objfmt_set_section_addr(yasm_section *sect, /*@null@*/ void *d) -{ - /*@null@*/ coff_objfmt_output_info *info = (coff_objfmt_output_info *)d; - /*@dependent@*/ /*@null@*/ coff_section_data *csd; - - assert(info != NULL); - csd = yasm_section_get_data(sect, &coff_section_data_cb); - assert(csd != NULL); - - csd->addr = info->addr; - info->addr += yasm_bc_next_offset(yasm_section_bcs_last(sect)); - - return 0; -} - static int coff_objfmt_output_value(yasm_value *value, unsigned char *buf, unsigned int destsize, unsigned long offset, @@ -556,8 +531,6 @@ coff_objfmt_output_value(yasm_value *value, unsigned char *buf, assert(sym_csd != NULL); sym = sym_csd->sym; intn_val = yasm_bc_next_offset(sym_precbc); - if (COFF_SET_VMA) - intn_val += sym_csd->addr; } } @@ -586,8 +559,6 @@ coff_objfmt_output_value(yasm_value *value, unsigned char *buf, /* Generate reloc */ reloc = yasm_xmalloc(sizeof(coff_reloc)); addr = bc->offset + offset; - if (COFF_SET_VMA) - addr += info->addr; reloc->reloc.addr = yasm_intnum_create_uint(addr); reloc->reloc.sym = sym; @@ -912,16 +883,8 @@ coff_objfmt_output_secthead(yasm_section *sect, /*@null@*/ void *d) } else strncpy((char *)localbuf, yasm_section_get_name(sect), 8); localbuf += 8; - if (csd->isdebug) { - YASM_WRITE_32_L(localbuf, 0); /* physical address */ - YASM_WRITE_32_L(localbuf, 0); /* virtual address */ - } else { - YASM_WRITE_32_L(localbuf, csd->addr); /* physical address */ - if (COFF_SET_VMA) - YASM_WRITE_32_L(localbuf, csd->addr);/* virtual address */ - else - YASM_WRITE_32_L(localbuf, 0); /* virtual address */ - } + YASM_WRITE_32_L(localbuf, 0); /* physical address */ + YASM_WRITE_32_L(localbuf, 0); /* virtual address */ YASM_WRITE_32_L(localbuf, csd->size); /* section size */ YASM_WRITE_32_L(localbuf, csd->scnptr); /* file ptr to data */ YASM_WRITE_32_L(localbuf, csd->relptr); /* file ptr to relocs */ @@ -1015,7 +978,6 @@ coff_objfmt_output_sym(yasm_symrec *sym, /*@null@*/ void *d) /*@dependent@*/ /*@null@*/ yasm_bytecode *precbc; unsigned long scnlen = 0; /* for sect auxent */ unsigned long nreloc = 0; /* for sect auxent */ - yasm_objfmt_coff *objfmt_coff = info->objfmt_coff; if (is_abs) name = yasm__xstrdup(".absolut"); @@ -1043,8 +1005,6 @@ coff_objfmt_output_sym(yasm_symrec *sym, /*@null@*/ void *d) scnum = csectd->scnum; scnlen = csectd->size; nreloc = csectd->nreloc; - if (COFF_SET_VMA) - value = csectd->addr; } else yasm_internal_error(N_("didn't understand section")); if (precbc) @@ -1222,17 +1182,6 @@ coff_objfmt_output(yasm_object *object, FILE *f, int all_syms, symtab_count = info.indx; /* Section data/relocs */ - if (COFF_SET_VMA) { - /* If we're setting the VMA, we need to do a first section pass to - * determine each section's addr value before actually outputting - * relocations, as a relocation's section address is added into the - * addends in the generated code. - */ - info.addr = 0; - if (yasm_object_sections_traverse(object, &info, - coff_objfmt_set_section_addr)) - return; - } info.addr = 0; if (yasm_object_sections_traverse(object, &info, coff_objfmt_output_section)) diff --git a/modules/objfmts/coff/tests/cofftest.hex b/modules/objfmts/coff/tests/cofftest.hex index c6329775..927cf9b8 100644 --- a/modules/objfmts/coff/tests/cofftest.hex +++ b/modules/objfmts/coff/tests/cofftest.hex @@ -66,11 +66,11 @@ c9 00 00 00 -3d 00 00 00 -3d +00 +00 00 00 00 @@ -106,11 +106,11 @@ c9 00 00 00 -7d 00 00 00 -7d +00 +00 00 00 00 @@ -156,13 +156,13 @@ ec 5d c3 a1 -7d +00 00 00 00 40 a3 -81 +04 00 00 00 @@ -173,7 +173,7 @@ ff 00 00 a1 -71 +34 00 00 00 @@ -181,12 +181,12 @@ ff 30 ff 35 -7d +00 00 00 00 68 -4a +0d 00 00 00 @@ -321,7 +321,7 @@ c3 64 0a 00 -81 +04 00 00 00 @@ -329,11 +329,11 @@ c3 00 00 00 -79 +3c 00 00 00 -71 +34 00 00 00 @@ -343,7 +343,7 @@ c3 00 06 00 -75 +38 00 00 00 @@ -353,7 +353,7 @@ c3 00 06 00 -79 +3c 00 00 00 @@ -479,7 +479,7 @@ ff 74 72 00 -3d +00 00 00 00 @@ -497,7 +497,7 @@ ff 70 74 72 -75 +38 00 00 00 @@ -515,7 +515,7 @@ ff 70 74 72 -79 +3c 00 00 00 @@ -533,7 +533,7 @@ ff 67 65 72 -7d +00 00 00 00 @@ -587,7 +587,7 @@ ff 00 00 00 -3d +00 00 00 00 @@ -623,7 +623,7 @@ ff 00 00 00 -7d +00 00 00 00 diff --git a/modules/objfmts/coff/tests/cofftimes.hex b/modules/objfmts/coff/tests/cofftimes.hex index 40cf2be1..e6779362 100644 --- a/modules/objfmts/coff/tests/cofftimes.hex +++ b/modules/objfmts/coff/tests/cofftimes.hex @@ -66,11 +66,11 @@ b4 00 00 00 -04 00 00 00 -04 +00 +00 00 00 00 @@ -106,11 +106,11 @@ b8 00 00 00 -08 00 00 00 -08 +00 +00 00 00 00 @@ -146,11 +146,11 @@ bc 00 00 00 -2a 00 00 00 -2a +00 +00 00 00 00 @@ -364,7 +364,7 @@ ff 00 00 00 -04 +00 00 00 00 @@ -400,7 +400,7 @@ ff 00 00 00 -08 +00 00 00 00 @@ -436,7 +436,7 @@ ff 00 00 00 -2a +00 00 00 00 diff --git a/modules/objfmts/coff/tests/x86id.hex b/modules/objfmts/coff/tests/x86id.hex index b75ec02a..5d0af134 100644 --- a/modules/objfmts/coff/tests/x86id.hex +++ b/modules/objfmts/coff/tests/x86id.hex @@ -66,12 +66,12 @@ d4 00 00 00 -e9 -d3 00 00 -e9 -d3 +00 +00 +00 +00 00 00 04 @@ -106,12 +106,12 @@ f4 74 61 00 -ed -d3 00 00 -ed -d3 +00 +00 +00 +00 00 00 24 @@ -185,9 +185,9 @@ c8 ec 04 68 -8d -08 -01 +a0 +34 +00 00 68 07 @@ -195,9 +195,9 @@ ec 00 00 68 -a8 -08 -01 +bb +34 +00 00 ff 15 @@ -331,9 +331,9 @@ ff 75 18 68 -c4 -08 -01 +d7 +34 +00 00 e8 36 @@ -495,9 +495,9 @@ e8 05 8a 80 -85 -08 -01 +98 +34 +00 00 88 45 @@ -547,8 +547,8 @@ f6 00 8b 3d -e9 -d3 +00 +00 00 00 89 @@ -950,8 +950,8 @@ fc d0 23 05 -e9 -d3 +00 +00 00 00 39 @@ -1050,9 +1050,9 @@ f8 ff 24 85 -51 -0a -01 +64 +36 +00 00 83 7f @@ -1860,9 +1860,9 @@ eb ec 04 68 -ed -08 -01 +00 +35 +00 00 68 39 @@ -1870,9 +1870,9 @@ ed 00 00 68 -a8 -08 -01 +bb +34 +00 00 ff 15 @@ -1911,9 +1911,9 @@ e8 8b 34 85 -cd -08 -01 +e0 +34 +00 00 83 7f @@ -2090,9 +2090,9 @@ eb ec 04 68 -02 -09 -01 +15 +35 +00 00 68 6b @@ -2100,9 +2100,9 @@ ec 00 00 68 -a8 -08 -01 +bb +34 +00 00 ff 15 @@ -2258,9 +2258,9 @@ eb ec 08 68 -1f -09 -01 +32 +35 +00 00 eb 08 @@ -2268,9 +2268,9 @@ eb ec 08 68 -39 -09 -01 +4c +35 +00 00 ff 75 @@ -2289,9 +2289,9 @@ d0 ec 04 68 -6d -09 -01 +80 +35 +00 00 68 8a @@ -2299,9 +2299,9 @@ ec 00 00 68 -a8 -08 -01 +bb +34 +00 00 ff 15 @@ -2318,9 +2318,9 @@ b3 ec 04 68 -6d -09 -01 +80 +35 +00 00 68 91 @@ -2336,9 +2336,9 @@ e9 ec 04 68 -8d -09 -01 +a0 +35 +00 00 68 95 @@ -2346,9 +2346,9 @@ ec 00 00 68 -a8 -08 -01 +bb +34 +00 00 ff 15 @@ -2964,9 +2964,9 @@ eb ec 04 68 -8d -08 -01 +a0 +34 +00 00 68 e9 @@ -2974,9 +2974,9 @@ e9 00 00 68 -a8 -08 -01 +bb +34 +00 00 ff 15 @@ -3047,9 +3047,9 @@ e8 ff 34 85 -cd -08 -01 +e0 +34 +00 00 ff 77 @@ -3097,9 +3097,9 @@ e8 8a 04 85 -cd -08 -01 +e0 +34 +00 00 88 45 @@ -3113,9 +3113,9 @@ cf ec 04 68 -8d -08 -01 +a0 +34 +00 00 68 fd @@ -3157,9 +3157,9 @@ e8 8a 04 85 -cd -08 -01 +e0 +34 +00 00 88 45 @@ -3177,9 +3177,9 @@ e9 ec 04 68 -8d -08 -01 +a0 +34 +00 00 68 06 @@ -3261,9 +3261,9 @@ c0 ec 08 68 -cd -09 -01 +e0 +35 +00 00 ff 75 @@ -3282,9 +3282,9 @@ f2 ec 04 68 -8d -08 -01 +a0 +34 +00 00 68 14 @@ -3356,9 +3356,9 @@ dc ec 04 68 -8d -08 -01 +a0 +34 +00 00 68 22 @@ -3394,9 +3394,9 @@ b6 ec 04 68 -8d -08 -01 +a0 +34 +00 00 68 29 @@ -3484,9 +3484,9 @@ c0 ec 08 68 -cd -09 -01 +e0 +35 +00 00 ff 75 @@ -3534,9 +3534,9 @@ e9 ec 04 68 -8d -08 -01 +a0 +34 +00 00 68 3a @@ -3549,9 +3549,9 @@ eb ec 04 68 -f8 -09 -01 +0b +36 +00 00 68 3d @@ -3559,9 +3559,9 @@ f8 00 00 68 -a8 -08 -01 +bb +34 +00 00 ff 15 @@ -3629,9 +3629,9 @@ eb ec 04 68 -2d -0a -01 +40 +36 +00 00 68 4b @@ -3639,9 +3639,9 @@ ec 00 00 68 -a8 -08 -01 +bb +34 +00 00 ff 15 @@ -3722,9 +3722,9 @@ f8 ff 24 85 -cd -0a -01 +e0 +36 +00 00 42 8a @@ -4523,9 +4523,9 @@ f7 42 52 68 -ad -0a -01 +c0 +36 +00 00 53 6a @@ -4587,8 +4587,8 @@ bf b6 81 0d -e9 -d3 +00 +00 00 00 00 @@ -4651,8 +4651,8 @@ ff ff 81 0d -e9 -d3 +00 +00 00 00 00 @@ -4693,8 +4693,8 @@ ff ff 81 0d -e9 -d3 +00 +00 00 00 00 @@ -4727,9 +4727,9 @@ ff ff 24 85 -ad -0c -01 +c0 +38 +00 00 42 8a @@ -5015,8 +5015,8 @@ ff ff 81 25 -e9 -d3 +00 +00 00 00 ff @@ -5091,8 +5091,8 @@ ff ff 81 25 -e9 -d3 +00 +00 00 00 ff @@ -5200,8 +5200,8 @@ ff ff 81 25 -e9 -d3 +00 +00 00 00 ff @@ -5225,8 +5225,8 @@ ff ff 81 25 -e9 -d3 +00 +00 00 00 ff @@ -5267,8 +5267,8 @@ ff ff 81 25 -e9 -d3 +00 +00 00 00 ff @@ -5343,8 +5343,8 @@ ff ff 81 25 -e9 -d3 +00 +00 00 00 ff @@ -5419,8 +5419,8 @@ ff ff 81 25 -e9 -d3 +00 +00 00 00 ff @@ -5486,8 +5486,8 @@ ff ff 81 25 -e9 -d3 +00 +00 00 00 ff @@ -5511,8 +5511,8 @@ ff ff 81 25 -e9 -d3 +00 +00 00 00 ff @@ -5536,8 +5536,8 @@ ff ff 81 25 -e9 -d3 +00 +00 00 00 ff @@ -5578,8 +5578,8 @@ ff ff 81 25 -e9 -d3 +00 +00 00 00 ff @@ -5620,8 +5620,8 @@ ff ff 81 25 -e9 -d3 +00 +00 00 00 ff @@ -5662,8 +5662,8 @@ ff ff 81 0d -e9 -d3 +00 +00 00 00 00 @@ -5790,8 +5790,8 @@ ff ff c7 05 -e9 -d3 +00 +00 00 00 3f @@ -5815,8 +5815,8 @@ ff ff 81 0d -e9 -d3 +00 +00 00 00 00 @@ -5964,8 +5964,8 @@ ff ff 81 0d -e9 -d3 +00 +00 00 00 00 @@ -5989,8 +5989,8 @@ ff ff 81 0d -e9 -d3 +00 +00 00 00 00 @@ -6014,8 +6014,8 @@ ff ff 81 0d -e9 -d3 +00 +00 00 00 00 @@ -6233,8 +6233,8 @@ ff ff c7 05 -e9 -d3 +00 +00 00 00 3f @@ -6281,8 +6281,8 @@ ff ff 81 0d -e9 -d3 +00 +00 00 00 00 @@ -6459,8 +6459,8 @@ ff ff c7 05 -e9 -d3 +00 +00 00 00 ff @@ -6484,8 +6484,8 @@ ff ff c7 05 -e9 -d3 +00 +00 00 00 3f @@ -6592,8 +6592,8 @@ ff ff c7 05 -e9 -d3 +00 +00 00 00 7f @@ -6629,8 +6629,8 @@ ff ff c7 05 -e9 -d3 +00 +00 00 00 3f @@ -6654,8 +6654,8 @@ ff ff c7 05 -e9 -d3 +00 +00 00 00 3f @@ -6679,8 +6679,8 @@ ff ff c7 05 -e9 -d3 +00 +00 00 00 1f @@ -6814,8 +6814,8 @@ ff ff 81 0d -e9 -d3 +00 +00 00 00 00 @@ -6839,8 +6839,8 @@ ff ff 81 0d -e9 -d3 +00 +00 00 00 00 @@ -7252,8 +7252,8 @@ ff ff c7 05 -e9 -d3 +00 +00 00 00 0f @@ -7341,8 +7341,8 @@ ff ff 81 0d -e9 -d3 +00 +00 00 00 00 @@ -7366,8 +7366,8 @@ ff ff c7 05 -e9 -d3 +00 +00 00 00 07 @@ -7403,8 +7403,8 @@ ff ff c7 05 -e9 -d3 +00 +00 00 00 03 @@ -7440,8 +7440,8 @@ ff ff c7 05 -e9 -d3 +00 +00 00 00 01 @@ -7577,8 +7577,8 @@ ff ff c7 05 -e9 -d3 +00 +00 00 00 ff @@ -7689,8 +7689,8 @@ ff ff c7 05 -e9 -d3 +00 +00 00 00 00 @@ -7737,9 +7737,9 @@ f8 ff 24 85 -ed -0e -01 +00 +3b +00 00 41 8a @@ -7826,9 +7826,9 @@ e2 ff 24 85 -d1 -10 -01 +e4 +3c +00 00 41 8a @@ -7851,9 +7851,9 @@ c9 ff 24 85 -b5 -11 -01 +c8 +3d +00 00 41 8a @@ -8051,9 +8051,9 @@ f8 ff 24 85 -d5 -12 -01 +e8 +3e +00 00 41 8a @@ -8076,9 +8076,9 @@ e8 ff 24 85 -f5 -13 -01 +08 +40 +00 00 41 8a @@ -8101,9 +8101,9 @@ cf ff 24 85 -c5 -14 -01 +d8 +40 +00 00 41 8a @@ -8126,9 +8126,9 @@ b6 ff 24 85 -d1 -15 -01 +e4 +41 +00 00 41 8a @@ -8151,9 +8151,9 @@ f8 ff 24 85 -b1 -16 -01 +c4 +42 +00 00 41 8a @@ -8176,9 +8176,9 @@ f8 ff 24 85 -91 -17 -01 +a4 +43 +00 00 41 8a @@ -8201,9 +8201,9 @@ f8 ff 24 85 -65 -18 -01 +78 +44 +00 00 41 8a @@ -8226,9 +8226,9 @@ f8 ff 24 85 -21 -19 -01 +34 +45 +00 00 41 8a @@ -8251,9 +8251,9 @@ f8 ff 24 85 -ed -19 -01 +00 +46 +00 00 41 8a @@ -8302,9 +8302,9 @@ f8 ff 24 85 -b1 -1a -01 +c4 +46 +00 00 41 8a @@ -8327,9 +8327,9 @@ ed ff 24 85 -91 -1b -01 +a4 +47 +00 00 41 8a @@ -8352,9 +8352,9 @@ d4 ff 24 85 -55 -1c -01 +68 +48 +00 00 41 8a @@ -8844,9 +8844,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -8872,9 +8872,9 @@ ff ff c7 07 -fd +10 +2d 00 -01 00 c7 47 @@ -8950,9 +8950,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -8978,9 +8978,9 @@ ff ff c7 07 -fd +10 +2d 00 -01 00 c7 47 @@ -9023,9 +9023,9 @@ ff ff c7 07 -8d -07 -01 +a0 +33 +00 00 c7 47 @@ -9051,8 +9051,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -9079,8 +9079,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -9207,9 +9207,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -9235,9 +9235,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -9417,8 +9417,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -9462,8 +9462,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -9541,8 +9541,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -9586,8 +9586,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -9681,8 +9681,8 @@ ff ff c7 07 -3d -f7 +50 +23 00 00 c7 @@ -9709,8 +9709,8 @@ ff ff c7 07 -3d -f7 +50 +23 00 00 c7 @@ -9754,8 +9754,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -10088,9 +10088,9 @@ ff ff 24 85 -3d -1d -01 +50 +49 +00 00 41 80 @@ -10104,8 +10104,8 @@ ff ff c7 07 -0d -f3 +20 +1f 00 00 c7 @@ -10226,8 +10226,8 @@ ff ff c7 07 -0d -f3 +20 +1f 00 00 c7 @@ -10254,8 +10254,8 @@ ff ff c7 07 -0d -f3 +20 +1f 00 00 c7 @@ -10329,8 +10329,8 @@ a9 00 c7 07 -ed -f3 +00 +20 00 00 c7 @@ -10357,8 +10357,8 @@ ff ff c7 07 -0d -f3 +20 +1f 00 00 c7 @@ -10385,8 +10385,8 @@ ff ff c7 07 -0d -f3 +20 +1f 00 00 c7 @@ -10501,8 +10501,8 @@ ff ff c7 07 -0d -f3 +20 +1f 00 00 c7 @@ -10529,8 +10529,8 @@ ff ff c7 07 -0d -f3 +20 +1f 00 00 c7 @@ -10557,8 +10557,8 @@ ff ff c7 07 -0d -f3 +20 +1f 00 00 c7 @@ -10658,8 +10658,8 @@ ff ff c7 07 -0d -f3 +20 +1f 00 00 c7 @@ -10686,8 +10686,8 @@ ff ff c7 07 -0d -f3 +20 +1f 00 00 c7 @@ -10714,8 +10714,8 @@ ff ff c7 07 -0d -f3 +20 +1f 00 00 c7 @@ -10742,8 +10742,8 @@ ff ff c7 07 -0d -f3 +20 +1f 00 00 c7 @@ -10770,8 +10770,8 @@ ff ff c7 07 -4d -f0 +60 +1c 00 00 e9 @@ -10791,8 +10791,8 @@ ff ff c7 07 -0d -f3 +20 +1f 00 00 c7 @@ -10819,8 +10819,8 @@ ff ff c7 07 -0d -f3 +20 +1f 00 00 c7 @@ -10881,8 +10881,8 @@ ff ff c7 07 -ed -f3 +00 +20 00 00 c7 @@ -10926,8 +10926,8 @@ ff ff c7 07 -ed -f3 +00 +20 00 00 c7 @@ -10954,8 +10954,8 @@ ff ff c7 07 -0d -f3 +20 +1f 00 00 c7 @@ -10982,8 +10982,8 @@ ff ff c7 07 -0d -f3 +20 +1f 00 00 c7 @@ -11192,8 +11192,8 @@ ff ff c7 07 -8d -e1 +a0 +0d 00 00 e9 @@ -11311,8 +11311,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -11339,8 +11339,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -11367,8 +11367,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -11408,8 +11408,8 @@ a5 00 c7 07 -09 -d4 +1c +00 00 00 c7 @@ -11436,8 +11436,8 @@ ff ff c7 07 -8d -e6 +a0 +12 00 00 c7 @@ -11616,8 +11616,8 @@ ff ff c7 07 -41 -f6 +54 +22 00 00 c7 @@ -11694,8 +11694,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -11753,8 +11753,8 @@ ff ff c7 07 -79 -d4 +8c +00 00 00 c7 @@ -11814,8 +11814,8 @@ a5 00 c7 07 -09 -d4 +1c +00 00 00 c7 @@ -11842,8 +11842,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -11870,8 +11870,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -11898,8 +11898,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -11926,8 +11926,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -11971,8 +11971,8 @@ ff ff c7 07 -4d -ea +60 +16 00 00 c7 @@ -12016,8 +12016,8 @@ ff ff c7 07 -4d -e7 +60 +13 00 00 c7 @@ -12061,9 +12061,9 @@ ff ff c7 07 -4d -07 -01 +60 +33 +00 00 e9 87 @@ -12290,9 +12290,9 @@ ff ff 24 85 -25 -1e -01 +38 +4a +00 00 41 8a @@ -12608,9 +12608,9 @@ ff ff 24 85 -2d -1f -01 +40 +4b +00 00 41 8a @@ -12708,9 +12708,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -13142,9 +13142,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -13187,9 +13187,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -13215,9 +13215,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -13243,9 +13243,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -13350,9 +13350,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -13395,9 +13395,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -13423,9 +13423,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -13451,9 +13451,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -13541,8 +13541,8 @@ ff ff c7 07 -6d -da +80 +06 00 00 c7 @@ -13651,8 +13651,8 @@ f5 00 c7 07 -09 -d4 +1c +00 00 00 c7 @@ -13743,8 +13743,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -13771,8 +13771,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -13812,8 +13812,8 @@ ff 00 c7 07 -09 -d4 +1c +00 00 00 c7 @@ -13840,8 +13840,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -13881,8 +13881,8 @@ ff 00 c7 07 -09 -d4 +1c +00 00 00 c7 @@ -13922,8 +13922,8 @@ e6 00 c7 07 -09 -d4 +1c +00 00 00 c7 @@ -14161,9 +14161,9 @@ ff ff c7 07 -99 -06 -01 +ac +32 +00 00 c7 47 @@ -14292,9 +14292,9 @@ ff ff c7 07 -89 -01 -01 +9c +2d +00 00 c7 47 @@ -14356,9 +14356,9 @@ ff ff c7 07 -45 -04 -01 +58 +30 +00 00 e9 66 @@ -14377,9 +14377,9 @@ ff ff c7 07 -89 -01 -01 +9c +2d +00 00 c7 47 @@ -14405,9 +14405,9 @@ ff ff c7 07 -89 -01 -01 +9c +2d +00 00 c7 47 @@ -14467,9 +14467,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -14504,9 +14504,9 @@ ff ff 24 85 -09 -20 -01 +1c +4c +00 00 41 80 @@ -14520,9 +14520,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -14548,9 +14548,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -14576,9 +14576,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -14604,9 +14604,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -14782,9 +14782,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -14810,9 +14810,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -14838,9 +14838,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -14884,9 +14884,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -14912,9 +14912,9 @@ ff ff c7 07 -b5 -06 -01 +c8 +32 +00 00 c7 47 @@ -15067,9 +15067,9 @@ ff ff c7 07 -8d +a0 +2c 00 -01 00 c7 47 @@ -15118,9 +15118,9 @@ ff ff c7 07 -8d +a0 +2c 00 -01 00 c7 47 @@ -15146,9 +15146,9 @@ ff ff c7 07 -8d +a0 +2c 00 -01 00 c7 47 @@ -15174,9 +15174,9 @@ ff ff c7 07 -7d -06 -01 +90 +32 +00 00 c7 47 @@ -15202,9 +15202,9 @@ ff ff c7 07 -8d +a0 +2c 00 -01 00 c7 47 @@ -15230,9 +15230,9 @@ ff ff c7 07 -8d +a0 +2c 00 -01 00 c7 47 @@ -15321,9 +15321,9 @@ ff ff c7 07 -8d +a0 +2c 00 -01 00 c7 47 @@ -15372,9 +15372,9 @@ ff ff c7 07 -8d +a0 +2c 00 -01 00 c7 47 @@ -15400,9 +15400,9 @@ ff ff c7 07 -8d +a0 +2c 00 -01 00 c7 47 @@ -15428,9 +15428,9 @@ ff ff c7 07 -7d -06 -01 +90 +32 +00 00 c7 47 @@ -15605,8 +15605,8 @@ ff ff c7 07 -79 -d4 +8c +00 00 00 c7 @@ -15691,8 +15691,8 @@ ff ff c7 07 -79 -d4 +8c +00 00 00 c7 @@ -15719,8 +15719,8 @@ ff ff c7 07 -79 -d4 +8c +00 00 00 c7 @@ -15747,8 +15747,8 @@ ff ff c7 07 -79 -d4 +8c +00 00 00 c7 @@ -15775,8 +15775,8 @@ ff ff c7 07 -79 -d4 +8c +00 00 00 c7 @@ -15820,8 +15820,8 @@ ff ff c7 07 -79 -d4 +8c +00 00 00 c7 @@ -15910,8 +15910,8 @@ ff ff c7 07 -8d -dd +a0 +09 00 00 c7 @@ -15938,9 +15938,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -16048,8 +16048,8 @@ ff 00 c7 07 -09 -d4 +1c +00 00 00 c7 @@ -16140,8 +16140,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -16168,8 +16168,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -16196,8 +16196,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -16237,8 +16237,8 @@ e6 00 c7 07 -09 -d4 +1c +00 00 00 c7 @@ -16278,8 +16278,8 @@ b2 00 c7 07 -09 -d4 +1c +00 00 00 c7 @@ -16319,8 +16319,8 @@ ff 00 c7 07 -09 -d4 +1c +00 00 00 c7 @@ -16709,9 +16709,9 @@ ff ff c7 07 -b5 -06 -01 +c8 +32 +00 00 c7 47 @@ -16754,9 +16754,9 @@ ff ff c7 07 -b5 -06 -01 +c8 +32 +00 00 c7 47 @@ -16799,9 +16799,9 @@ ff ff c7 07 -b5 -06 -01 +c8 +32 +00 00 c7 47 @@ -16861,9 +16861,9 @@ ff ff c7 07 -b5 -06 -01 +c8 +32 +00 00 c7 47 @@ -16957,9 +16957,9 @@ ff ff c7 07 -0d -04 -01 +20 +30 +00 00 c7 47 @@ -17070,9 +17070,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -17098,9 +17098,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -17333,9 +17333,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -17361,9 +17361,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -17464,9 +17464,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -17492,9 +17492,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -17587,9 +17587,9 @@ ff ff c7 07 -b5 -06 -01 +c8 +32 +00 00 c7 47 @@ -17615,9 +17615,9 @@ ff ff c7 07 -99 -06 -01 +ac +32 +00 00 c7 47 @@ -17643,9 +17643,9 @@ ff ff c7 07 -b5 -06 -01 +c8 +32 +00 00 c7 47 @@ -17834,9 +17834,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -17862,9 +17862,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -17890,9 +17890,9 @@ ff ff c7 07 -b5 -06 -01 +c8 +32 +00 00 c7 47 @@ -17952,9 +17952,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -18031,9 +18031,9 @@ ff ff c7 07 -d1 -06 -01 +e4 +32 +00 00 c7 47 @@ -18152,9 +18152,9 @@ ff ff c7 07 -99 -06 -01 +ac +32 +00 00 c7 47 @@ -18180,9 +18180,9 @@ ff ff c7 07 -99 -06 -01 +ac +32 +00 00 c7 47 @@ -18242,9 +18242,9 @@ ff ff c7 07 -8d -03 -01 +a0 +2f +00 00 c7 47 @@ -18638,9 +18638,9 @@ ff ff c7 07 -99 -06 -01 +ac +32 +00 00 c7 47 @@ -18666,9 +18666,9 @@ ff ff c7 07 -99 -06 -01 +ac +32 +00 00 c7 47 @@ -18822,9 +18822,9 @@ ff ff c7 07 -99 -06 -01 +ac +32 +00 00 c7 47 @@ -18862,9 +18862,9 @@ ff ff c7 07 -99 -06 -01 +ac +32 +00 00 c7 47 @@ -18913,9 +18913,9 @@ ff ff c7 07 -99 -06 -01 +ac +32 +00 00 c7 47 @@ -18985,9 +18985,9 @@ ff ff c7 07 -99 -06 -01 +ac +32 +00 00 c7 47 @@ -19013,9 +19013,9 @@ ff ff c7 07 -99 -06 -01 +ac +32 +00 00 c7 47 @@ -19092,9 +19092,9 @@ ff ff c7 07 -99 -06 -01 +ac +32 +00 00 c7 47 @@ -19154,9 +19154,9 @@ ff ff c7 07 -99 -06 -01 +ac +32 +00 00 c7 47 @@ -19235,9 +19235,9 @@ ff ff c7 07 -99 -06 -01 +ac +32 +00 00 c7 47 @@ -19263,9 +19263,9 @@ ff ff c7 07 -99 -06 -01 +ac +32 +00 00 c7 47 @@ -19291,9 +19291,9 @@ ff ff c7 07 -99 -06 -01 +ac +32 +00 00 c7 47 @@ -19454,9 +19454,9 @@ ff ff c7 07 -99 -06 -01 +ac +32 +00 00 c7 47 @@ -19482,9 +19482,9 @@ ff ff c7 07 -99 -06 -01 +ac +32 +00 00 c7 47 @@ -19510,9 +19510,9 @@ ff ff c7 07 -99 -06 -01 +ac +32 +00 00 c7 47 @@ -19573,9 +19573,9 @@ ff ff c7 07 -99 -06 -01 +ac +32 +00 00 c7 47 @@ -19601,9 +19601,9 @@ ff ff c7 07 -99 -06 -01 +ac +32 +00 00 c7 47 @@ -19679,9 +19679,9 @@ ff ff c7 07 -99 -06 -01 +ac +32 +00 00 c7 47 @@ -19707,9 +19707,9 @@ ff ff c7 07 -99 -06 -01 +ac +32 +00 00 c7 47 @@ -19793,9 +19793,9 @@ ff ff c7 07 -4d -03 -01 +60 +2f +00 00 c7 47 @@ -19889,9 +19889,9 @@ ff ff c7 07 -b5 -06 -01 +c8 +32 +00 00 c7 47 @@ -20200,9 +20200,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -20228,9 +20228,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -20290,9 +20290,9 @@ ff ff c7 07 -99 -06 -01 +ac +32 +00 00 c7 47 @@ -20318,9 +20318,9 @@ ff ff c7 07 -b5 -06 -01 +c8 +32 +00 00 c7 47 @@ -20369,9 +20369,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -20397,9 +20397,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -20434,9 +20434,9 @@ ff ff 24 85 -e1 -20 -01 +f4 +4c +00 00 41 80 @@ -20450,9 +20450,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -20478,9 +20478,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -20506,9 +20506,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -20534,9 +20534,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -20712,9 +20712,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -20740,9 +20740,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -20768,9 +20768,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -20814,9 +20814,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -20842,9 +20842,9 @@ ff ff c7 07 -b5 -06 -01 +c8 +32 +00 00 c7 47 @@ -21116,9 +21116,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -21144,9 +21144,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -21172,9 +21172,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -21265,9 +21265,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -21293,9 +21293,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -21321,9 +21321,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -21418,9 +21418,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -21531,9 +21531,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -21559,9 +21559,9 @@ ff ff c7 07 -4d +60 +2c 00 -01 00 c7 47 @@ -21604,8 +21604,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -21919,8 +21919,8 @@ ff ff c7 07 -2d -f5 +40 +21 00 00 c7 @@ -21968,8 +21968,8 @@ ff ff c7 07 -2d -f5 +40 +21 00 00 c7 @@ -21996,8 +21996,8 @@ ff ff c7 07 -2d -f5 +40 +21 00 00 c7 @@ -22024,8 +22024,8 @@ ff ff c7 07 -2d -f5 +40 +21 00 00 c7 @@ -22052,8 +22052,8 @@ ff ff c7 07 -ed -f5 +00 +22 00 00 c7 @@ -22080,8 +22080,8 @@ ff ff c7 07 -ed -f5 +00 +22 00 00 c7 @@ -22142,8 +22142,8 @@ ff ff c7 07 -0d -fd +20 +29 00 00 c7 @@ -22251,8 +22251,8 @@ ff 00 c7 07 -6d -f6 +80 +22 00 00 c7 @@ -22575,9 +22575,9 @@ ff 11 53 68 -cd -0d -01 +e0 +39 +00 00 56 6a @@ -22689,8 +22689,8 @@ ff ff c7 07 -e5 -f2 +f8 +1e 00 00 c7 @@ -22734,8 +22734,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -23058,8 +23058,8 @@ ff ff c7 07 -ed -e3 +00 +10 00 00 c7 @@ -23135,9 +23135,9 @@ ff ff c7 07 -fd +10 +2d 00 -01 00 c7 47 @@ -23163,9 +23163,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -23364,8 +23364,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -23420,8 +23420,8 @@ ff ff c7 07 -ed -df +00 +0c 00 00 c7 @@ -23465,9 +23465,9 @@ ff ff c7 07 -4d -08 -01 +60 +34 +00 00 c7 47 @@ -23517,8 +23517,8 @@ ff ff c7 07 -4d -fd +60 +29 00 00 c7 @@ -23785,8 +23785,8 @@ ff ff c7 07 -4d -e7 +60 +13 00 00 c7 @@ -23922,9 +23922,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -23950,9 +23950,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -23978,9 +23978,9 @@ ff ff c7 07 -fd +10 +2d 00 -01 00 c7 47 @@ -24006,9 +24006,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -24345,8 +24345,8 @@ ff ff c7 07 -ad -d4 +c0 +00 00 00 c7 @@ -24429,8 +24429,8 @@ ff ff c7 07 -cd -fe +e0 +2a 00 00 c7 @@ -24648,8 +24648,8 @@ ff ff c7 07 -ad -ff +c0 +2b 00 00 c7 @@ -24692,9 +24692,9 @@ ff ff 24 85 -b9 -21 -01 +cc +4d +00 00 41 8a @@ -24743,8 +24743,8 @@ ff ff c7 07 -ad -d9 +c0 +05 00 00 c7 @@ -24821,9 +24821,9 @@ ff ff c7 07 -ad -04 -01 +c0 +30 +00 00 c7 47 @@ -24849,9 +24849,9 @@ ff ff c7 07 -ed -01 -01 +00 +2e +00 00 c7 47 @@ -24907,8 +24907,8 @@ ff ff c7 07 -ad -d9 +c0 +05 00 00 c7 @@ -24935,8 +24935,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -24963,8 +24963,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -24991,9 +24991,9 @@ ff ff c7 07 -6d -05 -01 +80 +31 +00 00 c7 47 @@ -25032,8 +25032,8 @@ ff 00 c7 07 -09 -d4 +1c +00 00 00 c7 @@ -25060,9 +25060,9 @@ ff ff c7 07 -ed -02 -01 +00 +2f +00 00 c7 47 @@ -25101,8 +25101,8 @@ ff 00 c7 07 -39 -da +4c +06 00 00 c7 @@ -25163,9 +25163,9 @@ ff ff c7 07 -61 -06 -01 +74 +32 +00 00 e9 63 @@ -25303,8 +25303,8 @@ ff ff c7 07 -6d -fe +80 +2a 00 00 c7 @@ -25388,9 +25388,9 @@ ff ff c7 07 -bd -02 -01 +d0 +2e +00 00 e9 94 @@ -25409,9 +25409,9 @@ ff ff c7 07 -a1 -02 -01 +b4 +2e +00 00 e9 7f @@ -25430,9 +25430,9 @@ ff ff c7 07 -41 -05 -01 +54 +31 +00 00 c7 47 @@ -25458,9 +25458,9 @@ ff ff c7 07 -41 -05 -01 +54 +31 +00 00 c7 47 @@ -25570,9 +25570,9 @@ ff ff c7 07 -25 -05 -01 +38 +31 +00 00 e9 cc @@ -25591,9 +25591,9 @@ ff ff c7 07 -85 -02 -01 +98 +2e +00 00 e9 c9 @@ -25680,9 +25680,9 @@ ff ff c7 07 -ed -04 -01 +00 +31 +00 00 c7 47 @@ -25708,9 +25708,9 @@ ff ff c7 07 -4d -02 -01 +60 +2e +00 00 c7 47 @@ -25753,9 +25753,9 @@ ff ff c7 07 -25 -02 -01 +38 +2e +00 00 c7 47 @@ -25849,9 +25849,9 @@ ff ff c7 07 -ed -04 -01 +00 +31 +00 00 c7 47 @@ -25877,9 +25877,9 @@ ff ff c7 07 -4d -02 -01 +60 +2e +00 00 c7 47 @@ -25922,9 +25922,9 @@ ff ff c7 07 -25 -02 -01 +38 +2e +00 00 c7 47 @@ -26033,9 +26033,9 @@ ff ff c7 07 -0d -06 -01 +20 +32 +00 00 c7 47 @@ -26061,9 +26061,9 @@ ff ff c7 07 -0d -06 -01 +20 +32 +00 00 c7 47 @@ -26089,9 +26089,9 @@ ff ff c7 07 -45 -06 -01 +58 +32 +00 00 e9 c5 @@ -26160,9 +26160,9 @@ ff ff c7 07 -ad -04 -01 +c0 +30 +00 00 c7 47 @@ -26188,9 +26188,9 @@ ff ff c7 07 -ed -01 -01 +00 +2e +00 00 c7 47 @@ -26400,9 +26400,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -26428,9 +26428,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -26456,9 +26456,9 @@ ff ff c7 07 -fd +10 +2d 00 -01 00 c7 47 @@ -26484,9 +26484,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -26563,8 +26563,8 @@ ff ff c7 07 -41 -d4 +54 +00 00 00 c7 @@ -26776,9 +26776,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -26804,9 +26804,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -26832,9 +26832,9 @@ ff ff c7 07 -fd +10 +2d 00 -01 00 c7 47 @@ -26860,9 +26860,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -27007,9 +27007,9 @@ ff ff c7 07 -c1 -01 -01 +d4 +2d +00 00 c7 47 @@ -27059,9 +27059,9 @@ ff ff c7 07 -dd -05 -01 +f0 +31 +00 00 c7 47 @@ -27340,9 +27340,9 @@ ff 11 53 68 -cd -0d -01 +e0 +39 +00 00 56 6a @@ -27515,8 +27515,8 @@ ff ff c7 07 -4d -e7 +60 +13 00 00 c7 @@ -27652,9 +27652,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -27680,9 +27680,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -27708,9 +27708,9 @@ ff ff c7 07 -fd +10 +2d 00 -01 00 c7 47 @@ -27736,9 +27736,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -27764,8 +27764,8 @@ ff ff c7 07 -8d -e6 +a0 +12 00 00 c7 @@ -27805,8 +27805,8 @@ ab 00 c7 07 -09 -d4 +1c +00 00 00 c7 @@ -27846,8 +27846,8 @@ ff 00 c7 07 -09 -d4 +1c +00 00 00 c7 @@ -28483,8 +28483,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -28511,8 +28511,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -29055,9 +29055,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -29117,9 +29117,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -29259,9 +29259,9 @@ ff ff c7 07 -fd +10 +2d 00 -01 00 c7 47 @@ -29287,9 +29287,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -29400,9 +29400,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -29428,9 +29428,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -29569,9 +29569,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -29597,9 +29597,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -29692,9 +29692,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -29720,9 +29720,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -29815,9 +29815,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -29843,9 +29843,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -30035,9 +30035,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -30063,9 +30063,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -30091,9 +30091,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -30235,9 +30235,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -30263,9 +30263,9 @@ ff ff c7 07 -fd +10 +2d 00 -01 00 c7 47 @@ -30291,9 +30291,9 @@ ff ff c7 07 -fd +10 +2d 00 -01 00 c7 47 @@ -30386,9 +30386,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -30414,9 +30414,9 @@ ff ff c7 07 -fd +10 +2d 00 -01 00 c7 47 @@ -30521,9 +30521,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -30549,9 +30549,9 @@ ff ff c7 07 -fd +10 +2d 00 -01 00 c7 47 @@ -30657,8 +30657,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -30769,9 +30769,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -30797,9 +30797,9 @@ ff ff c7 07 -fd +10 +2d 00 -01 00 c7 47 @@ -30825,8 +30825,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -31073,8 +31073,8 @@ ff ff c7 07 -ed -e3 +00 +10 00 00 c7 @@ -31127,9 +31127,9 @@ ff ff 24 85 -95 -22 -01 +a8 +4e +00 00 41 80 @@ -31143,8 +31143,8 @@ ff ff c7 07 -ed -fd +00 +2a 00 00 c7 @@ -31180,9 +31180,9 @@ ff ff 24 85 -7d -23 -01 +90 +4f +00 00 41 8a @@ -31284,8 +31284,8 @@ ff ff c7 07 -ed -fd +00 +2a 00 00 c7 @@ -31312,8 +31312,8 @@ ff ff c7 07 -ed -fd +00 +2a 00 00 c7 @@ -31516,8 +31516,8 @@ ff ff c7 07 -ed -fd +00 +2a 00 00 c7 @@ -31586,8 +31586,8 @@ ff ff c7 07 -ed -fd +00 +2a 00 00 c7 @@ -31654,8 +31654,8 @@ ff ff c7 07 -ed -fd +00 +2a 00 00 c7 @@ -31712,8 +31712,8 @@ ff ff c7 07 -ed -fd +00 +2a 00 00 c7 @@ -31770,8 +31770,8 @@ ff ff c7 07 -ed -fd +00 +2a 00 00 c7 @@ -31798,8 +31798,8 @@ ff ff c7 07 -ed -fd +00 +2a 00 00 c7 @@ -31826,8 +31826,8 @@ ff ff c7 07 -ed -fd +00 +2a 00 00 c7 @@ -31854,8 +31854,8 @@ ff ff c7 07 -ed -fd +00 +2a 00 00 c7 @@ -31882,8 +31882,8 @@ ff ff c7 07 -ed -fd +00 +2a 00 00 c7 @@ -31910,8 +31910,8 @@ ff ff c7 07 -ed -fd +00 +2a 00 00 c7 @@ -31938,8 +31938,8 @@ ff ff c7 07 -ed -fd +00 +2a 00 00 c7 @@ -31966,8 +31966,8 @@ ff ff c7 07 -ed -fd +00 +2a 00 00 c7 @@ -31994,8 +31994,8 @@ ff ff c7 07 -ed -fd +00 +2a 00 00 c7 @@ -32275,9 +32275,9 @@ ff ff 24 85 -65 -24 -01 +78 +50 +00 00 41 8a @@ -32391,8 +32391,8 @@ ff ff c7 07 -4d -fd +60 +29 00 00 c7 @@ -32456,8 +32456,8 @@ ff ff c7 07 -bd -fd +d0 +29 00 00 c7 @@ -32496,8 +32496,8 @@ ff ff c7 07 -4d -fd +60 +29 00 00 c7 @@ -32743,9 +32743,9 @@ ff ff c7 07 -51 -01 -01 +64 +2d +00 00 c7 47 @@ -32771,9 +32771,9 @@ ff ff c7 07 -51 -01 -01 +64 +2d +00 00 c7 47 @@ -32799,9 +32799,9 @@ ff ff c7 07 -51 -01 -01 +64 +2d +00 00 c7 47 @@ -32827,9 +32827,9 @@ ff ff c7 07 -35 -01 -01 +48 +2d +00 00 e9 fa @@ -32848,8 +32848,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -32876,8 +32876,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -32904,9 +32904,9 @@ ff ff c7 07 -6d -04 -01 +80 +30 +00 00 e9 cd @@ -32938,8 +32938,8 @@ a9 00 c7 07 -09 -d4 +1c +00 00 00 c7 @@ -32966,9 +32966,9 @@ ff ff c7 07 -89 -01 -01 +9c +2d +00 00 c7 47 @@ -32994,9 +32994,9 @@ ff ff c7 07 -6d -01 -01 +80 +2d +00 00 c7 47 @@ -33022,9 +33022,9 @@ ff ff c7 07 -89 -01 -01 +9c +2d +00 00 c7 47 @@ -33228,9 +33228,9 @@ ff ff c7 07 -51 -01 -01 +64 +2d +00 00 c7 47 @@ -33256,9 +33256,9 @@ ff ff c7 07 -51 -01 -01 +64 +2d +00 00 c7 47 @@ -33284,9 +33284,9 @@ ff ff c7 07 -51 -01 -01 +64 +2d +00 00 c7 47 @@ -33312,9 +33312,9 @@ ff ff c7 07 -35 -01 -01 +48 +2d +00 00 c7 47 @@ -33641,9 +33641,9 @@ ff ff c7 07 -51 -01 -01 +64 +2d +00 00 c7 47 @@ -33669,9 +33669,9 @@ ff ff c7 07 -51 -01 -01 +64 +2d +00 00 c7 47 @@ -33697,9 +33697,9 @@ ff ff c7 07 -51 -01 -01 +64 +2d +00 00 c7 47 @@ -33725,9 +33725,9 @@ ff ff c7 07 -35 -01 -01 +48 +2d +00 00 c7 47 @@ -33864,9 +33864,9 @@ ff ff c7 07 -51 -01 -01 +64 +2d +00 00 c7 47 @@ -33892,9 +33892,9 @@ ff ff c7 07 -51 -01 -01 +64 +2d +00 00 c7 47 @@ -33920,9 +33920,9 @@ ff ff c7 07 -51 -01 -01 +64 +2d +00 00 c7 47 @@ -33948,9 +33948,9 @@ ff ff c7 07 -35 -01 -01 +48 +2d +00 00 c7 47 @@ -34137,9 +34137,9 @@ ff ff c7 07 -51 -01 -01 +64 +2d +00 00 c7 47 @@ -34165,9 +34165,9 @@ ff ff c7 07 -51 -01 -01 +64 +2d +00 00 c7 47 @@ -34193,9 +34193,9 @@ ff ff c7 07 -51 -01 -01 +64 +2d +00 00 c7 47 @@ -34221,9 +34221,9 @@ ff ff c7 07 -35 -01 -01 +48 +2d +00 00 c7 47 @@ -34472,9 +34472,9 @@ ff ff c7 07 -51 -01 -01 +64 +2d +00 00 c7 47 @@ -34500,9 +34500,9 @@ ff ff c7 07 -51 -01 -01 +64 +2d +00 00 c7 47 @@ -34528,9 +34528,9 @@ ff ff c7 07 -35 -01 -01 +48 +2d +00 00 c7 47 @@ -34556,9 +34556,9 @@ ff ff c7 07 -51 -01 -01 +64 +2d +00 00 c7 47 @@ -34693,9 +34693,9 @@ ff ff c7 07 -51 -01 -01 +64 +2d +00 00 c7 47 @@ -34721,9 +34721,9 @@ ff ff c7 07 -51 -01 -01 +64 +2d +00 00 c7 47 @@ -34749,9 +34749,9 @@ ff ff c7 07 -35 -01 -01 +48 +2d +00 00 e9 98 @@ -34770,9 +34770,9 @@ ff ff c7 07 -51 -01 -01 +64 +2d +00 00 c7 47 @@ -34957,9 +34957,9 @@ ff ff c7 07 -51 -01 -01 +64 +2d +00 00 c7 47 @@ -34985,9 +34985,9 @@ ff ff c7 07 -51 -01 -01 +64 +2d +00 00 c7 47 @@ -35013,9 +35013,9 @@ ff ff c7 07 -35 -01 -01 +48 +2d +00 00 c7 47 @@ -35041,9 +35041,9 @@ ff ff c7 07 -51 -01 -01 +64 +2d +00 00 c7 47 @@ -35069,8 +35069,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -35097,8 +35097,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -35125,8 +35125,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -35239,8 +35239,8 @@ ff ff c7 07 -a5 -fe +b8 +2a 00 00 c7 @@ -35267,8 +35267,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -35318,8 +35318,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -35359,8 +35359,8 @@ ff 00 c7 07 -09 -d4 +1c +00 00 00 c7 @@ -35400,8 +35400,8 @@ ff 00 c7 07 -09 -d4 +1c +00 00 00 c7 @@ -35428,8 +35428,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -35473,8 +35473,8 @@ ff ff c7 07 -0d -ee +20 +1a 00 00 e9 @@ -35851,9 +35851,9 @@ ff ff 24 85 -3d -25 -01 +50 +51 +00 00 41 8a @@ -36030,9 +36030,9 @@ ff ff 24 85 -fd -25 -01 +10 +52 +00 00 41 80 @@ -36114,8 +36114,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -36228,9 +36228,9 @@ ff ff c7 07 -09 -07 -01 +1c +33 +00 00 c7 47 @@ -36273,9 +36273,9 @@ ff ff c7 07 -09 -07 -01 +1c +33 +00 00 c7 47 @@ -36301,9 +36301,9 @@ ff ff c7 07 -ed -06 -01 +00 +33 +00 00 e9 25 @@ -36424,9 +36424,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -36452,9 +36452,9 @@ ff ff c7 07 -fd +10 +2d 00 -01 00 c7 47 @@ -36480,8 +36480,8 @@ ff ff c7 07 -6d -ec +80 +18 00 00 e9 @@ -36501,8 +36501,8 @@ ff ff c7 07 -6d -ec +80 +18 00 00 e9 @@ -36711,8 +36711,8 @@ ff ff c7 07 -ad -f2 +c0 +1e 00 00 c7 @@ -36739,8 +36739,8 @@ ff ff c7 07 -ad -f2 +c0 +1e 00 00 c7 @@ -37039,8 +37039,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -37091,8 +37091,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -37136,8 +37136,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -37188,8 +37188,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -37257,8 +37257,8 @@ ff ff c7 07 -6d -ec +80 +18 00 00 e9 @@ -37278,8 +37278,8 @@ ff ff c7 07 -6d -ec +80 +18 00 00 c7 @@ -37391,9 +37391,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -37419,9 +37419,9 @@ ff ff c7 07 -fd +10 +2d 00 -01 00 c7 47 @@ -38448,8 +38448,8 @@ ff ff c7 07 -3d -f7 +50 +23 00 00 c7 @@ -38476,8 +38476,8 @@ ff ff c7 07 -ad -e3 +c0 +0f 00 00 c7 @@ -38504,8 +38504,8 @@ ff ff c7 07 -ed -f5 +00 +22 00 00 c7 @@ -38685,8 +38685,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -38737,8 +38737,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -38862,8 +38862,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -38890,8 +38890,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -38918,8 +38918,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -38959,8 +38959,8 @@ ff 00 c7 07 -09 -d4 +1c +00 00 00 c7 @@ -39040,8 +39040,8 @@ ff ff c7 07 -2d -f4 +40 +20 00 00 c7 @@ -39068,8 +39068,8 @@ ff ff c7 07 -2d -f4 +40 +20 00 00 c7 @@ -39139,8 +39139,8 @@ ff ff c7 07 -2d -f4 +40 +20 00 00 c7 @@ -39212,8 +39212,8 @@ ff ff c7 07 -3d -f7 +50 +23 00 00 c7 @@ -39257,8 +39257,8 @@ ff ff c7 07 -3d -f7 +50 +23 00 00 c7 @@ -39309,8 +39309,8 @@ ff ff c7 07 -79 -d4 +8c +00 00 00 c7 @@ -39337,8 +39337,8 @@ ff ff c7 07 -ad -e3 +c0 +0f 00 00 c7 @@ -39382,8 +39382,8 @@ ff ff c7 07 -79 -d4 +8c +00 00 00 c7 @@ -39410,8 +39410,8 @@ ff ff c7 07 -ad -e3 +c0 +0f 00 00 c7 @@ -39489,8 +39489,8 @@ ff ff c7 07 -41 -d4 +54 +00 00 00 c7 @@ -39540,8 +39540,8 @@ ff ff c7 07 -0d -e3 +20 +0f 00 00 c7 @@ -39581,8 +39581,8 @@ ab 00 c7 07 -6d -e3 +80 +0f 00 00 c7 @@ -39626,8 +39626,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -39674,8 +39674,8 @@ ff 00 c7 07 -6d -e3 +80 +0f 00 00 c7 @@ -39770,9 +39770,9 @@ ff ff c7 07 -a5 -01 -01 +b8 +2d +00 00 c7 47 @@ -39816,8 +39816,8 @@ ff ff c7 07 -ed -f5 +00 +22 00 00 c7 @@ -39857,8 +39857,8 @@ ff 00 c7 07 -09 -d4 +1c +00 00 00 c7 @@ -40239,8 +40239,8 @@ ff 00 c7 07 -a5 -f6 +b8 +22 00 00 c7 @@ -40322,8 +40322,8 @@ ff ff c7 07 -ed -e3 +00 +10 00 00 c7 @@ -40417,9 +40417,9 @@ ff ff c7 07 -fd +10 +2d 00 -01 00 c7 47 @@ -40445,9 +40445,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -40523,9 +40523,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -40551,9 +40551,9 @@ ff ff c7 07 -fd +10 +2d 00 -01 00 c7 47 @@ -40637,8 +40637,8 @@ ff ff c7 07 -ed -e3 +00 +10 00 00 c7 @@ -40665,8 +40665,8 @@ ff ff c7 07 -ed -e3 +00 +10 00 00 c7 @@ -40802,9 +40802,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -40830,9 +40830,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -40858,9 +40858,9 @@ ff ff c7 07 -fd +10 +2d 00 -01 00 c7 47 @@ -40886,9 +40886,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -40927,8 +40927,8 @@ ff 00 c7 07 -09 -d4 +1c +00 00 00 c7 @@ -40968,8 +40968,8 @@ ff 00 c7 07 -09 -d4 +1c +00 00 00 c7 @@ -41009,8 +41009,8 @@ ff 00 c7 07 -0d -ea +20 +16 00 00 c7 @@ -41050,8 +41050,8 @@ ee 00 c7 07 -0d -ea +20 +16 00 00 c7 @@ -41144,9 +41144,9 @@ ff ec 08 68 -0d -0e -01 +20 +3a +00 00 56 e8 @@ -41263,8 +41263,8 @@ ff ff c7 07 -ed -e3 +00 +10 00 00 c7 @@ -41331,8 +41331,8 @@ ff ff c7 07 -4d -e2 +60 +0e 00 00 c7 @@ -41424,8 +41424,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -41452,8 +41452,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -41480,8 +41480,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -41558,9 +41558,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -41586,9 +41586,9 @@ ff ff c7 07 -fd +10 +2d 00 -01 00 c7 47 @@ -41623,9 +41623,9 @@ ff 0b 53 68 -4d -0e -01 +60 +3a +00 00 e9 b7 @@ -41821,8 +41821,8 @@ ff ff c7 07 -cd -e7 +e0 +13 00 00 c7 @@ -42257,9 +42257,9 @@ ff ff 24 85 -c1 -26 -01 +d4 +52 +00 00 41 8a @@ -43091,8 +43091,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -43131,8 +43131,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -43323,8 +43323,8 @@ ff ff c7 07 -79 -d4 +8c +00 00 00 c7 @@ -43385,8 +43385,8 @@ ff ff c7 07 -79 -d4 +8c +00 00 00 c7 @@ -43464,8 +43464,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -43492,8 +43492,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -43520,8 +43520,8 @@ ff ff c7 07 -8d -f9 +a0 +25 00 00 c7 @@ -43582,8 +43582,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -43699,8 +43699,8 @@ ff ff c7 07 -8d -fa +a0 +26 00 00 c7 @@ -43750,8 +43750,8 @@ ff ff c7 07 -8d -fa +a0 +26 00 00 c7 @@ -43801,8 +43801,8 @@ ff ff c7 07 -8d -fa +a0 +26 00 00 c7 @@ -43829,8 +43829,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -43857,8 +43857,8 @@ ff ff c7 07 -8d -fa +a0 +26 00 00 c7 @@ -43902,8 +43902,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -44054,8 +44054,8 @@ ff ff c7 07 -2d -f9 +40 +25 00 00 c7 @@ -44255,8 +44255,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -44307,8 +44307,8 @@ ff ff c7 07 -79 -d4 +8c +00 00 00 c7 @@ -44369,8 +44369,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -44420,8 +44420,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -44482,8 +44482,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -44527,8 +44527,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -44610,8 +44610,8 @@ ff ff c7 07 -cd -fa +e0 +26 00 00 c7 @@ -44638,8 +44638,8 @@ ff ff c7 07 -8d -fb +a0 +27 00 00 c7 @@ -44689,8 +44689,8 @@ ff ff c7 07 -cd -fa +e0 +26 00 00 c7 @@ -44717,8 +44717,8 @@ ff ff c7 07 -8d -fb +a0 +27 00 00 c7 @@ -44789,8 +44789,8 @@ ff ff c7 07 -2d -f8 +40 +24 00 00 c7 @@ -44834,8 +44834,8 @@ ff ff c7 07 -ad -fc +c0 +28 00 00 e9 @@ -44872,8 +44872,8 @@ ff ff c7 07 -79 -d4 +8c +00 00 00 c7 @@ -44900,8 +44900,8 @@ ff ff c7 07 -41 -fc +54 +28 00 00 c7 @@ -44997,8 +44997,8 @@ ff ff c7 07 -5d -d4 +70 +00 00 00 c7 @@ -45076,8 +45076,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -45189,8 +45189,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -45217,8 +45217,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -45279,8 +45279,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -45324,8 +45324,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -45477,8 +45477,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -45539,8 +45539,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -45728,8 +45728,8 @@ ff ff c7 07 -5d -d4 +70 +00 00 00 c7 @@ -45756,8 +45756,8 @@ ff ff c7 07 -6d -fc +80 +28 00 00 c7 @@ -45784,8 +45784,8 @@ ff ff c7 07 -25 -fc +38 +28 00 00 c7 @@ -45829,8 +45829,8 @@ ff ff c7 07 -5d -d4 +70 +00 00 00 c7 @@ -45891,8 +45891,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -45959,8 +45959,8 @@ ff ff c7 07 -cd -fa +e0 +26 00 00 c7 @@ -45987,8 +45987,8 @@ ff ff c7 07 -8d -fb +a0 +27 00 00 c7 @@ -46179,8 +46179,8 @@ ff ff c7 07 -2d -f8 +40 +24 00 00 c7 @@ -46207,8 +46207,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -46388,8 +46388,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -46416,8 +46416,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -46522,8 +46522,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -46550,8 +46550,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -46578,8 +46578,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -46606,8 +46606,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -46651,8 +46651,8 @@ ff ff c7 07 -5d -d4 +70 +00 00 00 c7 @@ -46679,8 +46679,8 @@ ff ff c7 07 -25 -fc +38 +28 00 00 c7 @@ -46985,8 +46985,8 @@ ff ff c7 07 -41 -d4 +54 +00 00 00 c7 @@ -47047,8 +47047,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -47115,8 +47115,8 @@ ff ff c7 07 -ed -fb +00 +28 00 00 c7 @@ -47143,8 +47143,8 @@ ff ff c7 07 -ed -fb +00 +28 00 00 c7 @@ -47188,8 +47188,8 @@ ff ff c7 07 -ed -fb +00 +28 00 00 c7 @@ -47233,8 +47233,8 @@ ff ff c7 07 -ed -fb +00 +28 00 00 c7 @@ -47301,8 +47301,8 @@ ff ff c7 07 -ed -fb +00 +28 00 00 c7 @@ -47329,8 +47329,8 @@ ff ff c7 07 -ed -fb +00 +28 00 00 c7 @@ -47380,8 +47380,8 @@ ff ff c7 07 -ed -fb +00 +28 00 00 c7 @@ -47448,8 +47448,8 @@ ff ff c7 07 -ed -fb +00 +28 00 00 c7 @@ -47476,8 +47476,8 @@ ff ff c7 07 -ed -fb +00 +28 00 00 c7 @@ -47504,8 +47504,8 @@ ff ff c7 07 -ad -f8 +c0 +24 00 00 c7 @@ -47532,8 +47532,8 @@ ff ff c7 07 -ad -f8 +c0 +24 00 00 c7 @@ -47617,8 +47617,8 @@ ff ff c7 07 -e5 -fc +f8 +28 00 00 c7 @@ -47645,8 +47645,8 @@ ff ff c7 07 -e5 -fc +f8 +28 00 00 c7 @@ -47714,8 +47714,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -47835,8 +47835,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -47918,8 +47918,8 @@ ff ff c7 07 -cd -fa +e0 +26 00 00 c7 @@ -47946,8 +47946,8 @@ ff ff c7 07 -8d -fb +a0 +27 00 00 c7 @@ -47997,8 +47997,8 @@ ff ff c7 07 -cd -fa +e0 +26 00 00 c7 @@ -48025,8 +48025,8 @@ ff ff c7 07 -8d -fb +a0 +27 00 00 c7 @@ -48330,8 +48330,8 @@ ff ff c7 07 -41 -fe +54 +2a 00 00 c7 @@ -48358,8 +48358,8 @@ ff ff c7 07 -41 -fe +54 +2a 00 00 c7 @@ -48436,8 +48436,8 @@ ff ff c7 07 -41 -fe +54 +2a 00 00 c7 @@ -48487,8 +48487,8 @@ ff ff c7 07 -41 -fe +54 +2a 00 00 c7 @@ -48515,8 +48515,8 @@ ff ff c7 07 -41 -fe +54 +2a 00 00 c7 @@ -48543,8 +48543,8 @@ ff ff c7 07 -41 -fe +54 +2a 00 00 c7 @@ -48571,8 +48571,8 @@ ff ff c7 07 -41 -fe +54 +2a 00 00 c7 @@ -48616,8 +48616,8 @@ ff ff c7 07 -41 -d4 +54 +00 00 00 c7 @@ -48644,8 +48644,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -48731,8 +48731,8 @@ ff ff c7 07 -0d -fa +20 +26 00 00 c7 @@ -48759,8 +48759,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -48817,8 +48817,8 @@ ff ff c7 07 -0d -fa +20 +26 00 00 c7 @@ -48868,8 +48868,8 @@ ff ff c7 07 -8d -fa +a0 +26 00 00 c7 @@ -48893,8 +48893,8 @@ ff ff c7 07 -8d -fa +a0 +26 00 00 c7 @@ -48928,8 +48928,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -49008,8 +49008,8 @@ ff ff c7 07 -01 -f9 +14 +25 00 00 c7 @@ -49036,8 +49036,8 @@ ff ff c7 07 -01 -f9 +14 +25 00 00 c7 @@ -49120,8 +49120,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -49168,8 +49168,8 @@ ff ff c7 07 -cd -fa +e0 +26 00 00 c7 @@ -49193,8 +49193,8 @@ ff ff c7 07 -8d -fb +a0 +27 00 00 c7 @@ -49247,8 +49247,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -49504,9 +49504,9 @@ ff ff 24 85 -8d -27 -01 +a0 +53 +00 00 41 8a @@ -49786,9 +49786,9 @@ ff 11 53 68 -cd -0d -01 +e0 +39 +00 00 56 6a @@ -49838,9 +49838,9 @@ ff ff 24 85 -35 -28 -01 +48 +54 +00 00 41 8a @@ -50181,8 +50181,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -50281,8 +50281,8 @@ df 00 c7 07 -25 -d4 +38 +00 00 00 c7 @@ -50363,8 +50363,8 @@ ff 00 c7 07 -25 -d4 +38 +00 00 00 c7 @@ -50432,8 +50432,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -50531,8 +50531,8 @@ f0 00 c7 07 -41 -d4 +54 +00 00 00 c7 @@ -50612,9 +50612,9 @@ ff ff c7 07 -09 -07 -01 +1c +33 +00 00 c7 47 @@ -50654,9 +50654,9 @@ ff ff c7 07 -09 -07 -01 +1c +33 +00 00 c7 47 @@ -50679,9 +50679,9 @@ ff ff c7 07 -25 -07 -01 +38 +33 +00 00 c7 47 @@ -50769,8 +50769,8 @@ ff ff c7 07 -ed -e3 +00 +10 00 00 c7 @@ -50906,9 +50906,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -50934,9 +50934,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -50962,9 +50962,9 @@ ff ff c7 07 -fd +10 +2d 00 -01 00 c7 47 @@ -50990,9 +50990,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -51045,8 +51045,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -51073,8 +51073,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -51101,8 +51101,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -51155,8 +51155,8 @@ ff ff c7 07 -cd -f6 +e0 +22 00 00 c7 @@ -51258,9 +51258,9 @@ ff ff c7 07 -a5 -01 -01 +b8 +2d +00 00 c7 47 @@ -51376,8 +51376,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -51404,8 +51404,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -51432,8 +51432,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -51473,8 +51473,8 @@ ff 00 c7 07 -09 -d4 +1c +00 00 00 c7 @@ -51679,9 +51679,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -51707,9 +51707,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -51735,9 +51735,9 @@ ff ff c7 07 -19 -01 -01 +2c +2d +00 00 c7 47 @@ -51763,9 +51763,9 @@ ff ff c7 07 -fd +10 +2d 00 -01 00 c7 47 @@ -51874,8 +51874,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -51949,8 +51949,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -52018,8 +52018,8 @@ ff ff c7 07 -25 -d4 +38 +00 00 00 c7 @@ -52053,8 +52053,8 @@ ff ff c7 07 -6d -f7 +80 +23 00 00 c7 @@ -52095,8 +52095,8 @@ ff ff c7 07 -6d -f7 +80 +23 00 00 c7 @@ -52139,9 +52139,9 @@ ff 0b 53 68 -6d -0e -01 +80 +3a +00 00 e9 a3 @@ -52193,8 +52193,8 @@ ff ff c7 07 -79 -d4 +8c +00 00 00 c7 @@ -52321,8 +52321,8 @@ ff ff c7 07 -6d -ec +80 +18 00 00 c7 @@ -52433,9 +52433,9 @@ ff ff c7 07 -89 -01 -01 +9c +2d +00 00 c7 47 @@ -52468,9 +52468,9 @@ ff ff c7 07 -6d -01 -01 +80 +2d +00 00 c7 47 @@ -52503,8 +52503,8 @@ ff ff c7 07 -4d -ed +60 +19 00 00 c7 @@ -52531,8 +52531,8 @@ ff ff c7 07 -4d -ed +60 +19 00 00 c7 @@ -52614,8 +52614,8 @@ ff ff c7 07 -79 -d4 +8c +00 00 00 c7 @@ -52700,8 +52700,8 @@ ff ff c7 07 -41 -d4 +54 +00 00 00 c7 @@ -52744,9 +52744,9 @@ ff ff 24 85 -41 -29 -01 +54 +55 +00 00 41 8a @@ -52945,9 +52945,9 @@ ff ff 24 85 -29 -2a -01 +3c +56 +00 00 41 80 @@ -52961,8 +52961,8 @@ ff ff c7 07 -0d -f5 +20 +21 00 00 c7 @@ -53055,8 +53055,8 @@ ff ff c7 07 -0d -f5 +20 +21 00 00 c7 @@ -53083,8 +53083,8 @@ ff ff c7 07 -0d -f5 +20 +21 00 00 c7 @@ -53111,8 +53111,8 @@ ff ff c7 07 -0d -f5 +20 +21 00 00 c7 @@ -53139,8 +53139,8 @@ ff ff c7 07 -0d -f5 +20 +21 00 00 c7 @@ -53255,8 +53255,8 @@ ff ff c7 07 -0d -f5 +20 +21 00 00 c7 @@ -53283,8 +53283,8 @@ ff ff c7 07 -0d -f5 +20 +21 00 00 c7 @@ -53311,8 +53311,8 @@ ff ff c7 07 -0d -f5 +20 +21 00 00 c7 @@ -53412,8 +53412,8 @@ ff ff c7 07 -0d -f5 +20 +21 00 00 c7 @@ -53440,8 +53440,8 @@ ff ff c7 07 -0d -f5 +20 +21 00 00 c7 @@ -53468,8 +53468,8 @@ ff ff c7 07 -0d -f5 +20 +21 00 00 c7 @@ -53496,8 +53496,8 @@ ff ff c7 07 -0d -f5 +20 +21 00 00 c7 @@ -53524,8 +53524,8 @@ ff ff c7 07 -0d -f5 +20 +21 00 00 c7 @@ -53552,8 +53552,8 @@ ff ff c7 07 -0d -f5 +20 +21 00 00 c7 @@ -53580,8 +53580,8 @@ ff ff c7 07 -0d -f5 +20 +21 00 00 c7 @@ -53608,8 +53608,8 @@ ff ff c7 07 -0d -f5 +20 +21 00 00 c7 @@ -53743,8 +53743,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -53771,8 +53771,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -53799,8 +53799,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -53843,9 +53843,9 @@ ff 18 53 68 -ad -0e -01 +c0 +3a +00 00 56 6a @@ -53867,8 +53867,8 @@ e9 00 c7 07 -09 -d4 +1c +00 00 00 c7 @@ -53902,8 +53902,8 @@ ff ff c7 07 -ed -e3 +00 +10 00 00 c7 @@ -53979,8 +53979,8 @@ ff ff c7 07 -6d -ec +80 +18 00 00 c7 @@ -54007,8 +54007,8 @@ ff ff c7 07 -6d -ec +80 +18 00 00 c7 @@ -54044,8 +54044,8 @@ ff 2c c7 07 -09 -d4 +1c +00 00 00 c7 @@ -54091,9 +54091,9 @@ ec 04 53 68 -d2 -0e -01 +e5 +3a +00 00 56 e8 @@ -54103,8 +54103,8 @@ ff ff c7 07 -ed -d3 +00 +00 00 00 c7 @@ -54131,8 +54131,8 @@ de 00 c7 07 -09 -d4 +1c +00 00 00 c7 @@ -54265,8 +54265,8 @@ ff ff c7 07 -4d -e7 +60 +13 00 00 c7 @@ -54290,8 +54290,8 @@ ff ff c7 07 -09 -d4 +1c +00 00 00 c7 @@ -54333,8 +54333,8 @@ ff ff c7 07 -4d -e7 +60 +13 00 00 c7 @@ -84829,9 +84829,9 @@ e7 cf 00 00 -51 -0a -01 +64 +36 +00 00 02 00 @@ -84839,9 +84839,9 @@ cf 00 06 00 -55 -0a -01 +68 +36 +00 00 02 00 @@ -84849,9 +84849,9 @@ cf 00 06 00 -59 -0a -01 +6c +36 +00 00 02 00 @@ -84859,9 +84859,9 @@ cf 00 06 00 -5d -0a -01 +70 +36 +00 00 02 00 @@ -84869,9 +84869,9 @@ cf 00 06 00 -61 -0a -01 +74 +36 +00 00 02 00 @@ -84879,9 +84879,9 @@ cf 00 06 00 -65 -0a -01 +78 +36 +00 00 02 00 @@ -84889,9 +84889,9 @@ cf 00 06 00 -69 -0a -01 +7c +36 +00 00 02 00 @@ -84899,9 +84899,9 @@ cf 00 06 00 -6d -0a -01 +80 +36 +00 00 02 00 @@ -84909,9 +84909,9 @@ cf 00 06 00 -71 -0a -01 +84 +36 +00 00 02 00 @@ -84919,9 +84919,9 @@ cf 00 06 00 -75 -0a -01 +88 +36 +00 00 02 00 @@ -84929,9 +84929,9 @@ cf 00 06 00 -79 -0a -01 +8c +36 +00 00 02 00 @@ -84939,9 +84939,9 @@ cf 00 06 00 -7d -0a -01 +90 +36 +00 00 02 00 @@ -84949,9 +84949,9 @@ cf 00 06 00 -81 -0a -01 +94 +36 +00 00 02 00 @@ -84959,9 +84959,9 @@ cf 00 06 00 -85 -0a -01 +98 +36 +00 00 02 00 @@ -84969,9 +84969,9 @@ cf 00 06 00 -89 -0a -01 +9c +36 +00 00 02 00 @@ -84979,9 +84979,9 @@ cf 00 06 00 -8d -0a -01 +a0 +36 +00 00 02 00 @@ -84989,9 +84989,9 @@ cf 00 06 00 -91 -0a -01 +a4 +36 +00 00 02 00 @@ -84999,9 +84999,9 @@ cf 00 06 00 -95 -0a -01 +a8 +36 +00 00 02 00 @@ -85009,9 +85009,9 @@ cf 00 06 00 -99 -0a -01 +ac +36 +00 00 02 00 @@ -85019,9 +85019,9 @@ cf 00 06 00 -9d -0a -01 +b0 +36 +00 00 02 00 @@ -85029,9 +85029,9 @@ cf 00 06 00 -a1 -0a -01 +b4 +36 +00 00 02 00 @@ -85039,9 +85039,9 @@ a1 00 06 00 -a5 -0a -01 +b8 +36 +00 00 02 00 @@ -85049,9 +85049,9 @@ a5 00 06 00 -cd -0a -01 +e0 +36 +00 00 02 00 @@ -85059,9 +85059,9 @@ cd 00 06 00 -d1 -0a -01 +e4 +36 +00 00 02 00 @@ -85069,9 +85069,9 @@ d1 00 06 00 -d5 -0a -01 +e8 +36 +00 00 02 00 @@ -85079,9 +85079,9 @@ d5 00 06 00 -d9 -0a -01 +ec +36 +00 00 02 00 @@ -85089,9 +85089,9 @@ d9 00 06 00 -dd -0a -01 +f0 +36 +00 00 02 00 @@ -85099,9 +85099,9 @@ dd 00 06 00 -e1 -0a -01 +f4 +36 +00 00 02 00 @@ -85109,9 +85109,9 @@ e1 00 06 00 -e5 -0a -01 +f8 +36 +00 00 02 00 @@ -85119,9 +85119,9 @@ e5 00 06 00 -e9 -0a -01 +fc +36 +00 00 02 00 @@ -85129,9 +85129,9 @@ e9 00 06 00 -ed -0a -01 +00 +37 +00 00 02 00 @@ -85139,9 +85139,9 @@ ed 00 06 00 -f1 -0a -01 +04 +37 +00 00 02 00 @@ -85149,9 +85149,9 @@ f1 00 06 00 -f5 -0a -01 +08 +37 +00 00 02 00 @@ -85159,9 +85159,9 @@ f5 00 06 00 -f9 -0a -01 +0c +37 +00 00 02 00 @@ -85169,9 +85169,9 @@ f9 00 06 00 -fd -0a -01 +10 +37 +00 00 02 00 @@ -85179,9 +85179,9 @@ fd 00 06 00 -01 -0b -01 +14 +37 +00 00 02 00 @@ -85189,9 +85189,9 @@ fd 00 06 00 -05 -0b -01 +18 +37 +00 00 02 00 @@ -85199,9 +85199,9 @@ fd 00 06 00 -09 -0b -01 +1c +37 +00 00 02 00 @@ -85209,9 +85209,9 @@ fd 00 06 00 -0d -0b -01 +20 +37 +00 00 02 00 @@ -85219,9 +85219,9 @@ fd 00 06 00 -11 -0b -01 +24 +37 +00 00 02 00 @@ -85229,9 +85229,9 @@ fd 00 06 00 -15 -0b -01 +28 +37 +00 00 02 00 @@ -85239,9 +85239,9 @@ fd 00 06 00 -19 -0b -01 +2c +37 +00 00 02 00 @@ -85249,9 +85249,9 @@ fd 00 06 00 -1d -0b -01 +30 +37 +00 00 02 00 @@ -85259,9 +85259,9 @@ fd 00 06 00 -21 -0b -01 +34 +37 +00 00 02 00 @@ -85269,9 +85269,9 @@ fd 00 06 00 -25 -0b -01 +38 +37 +00 00 02 00 @@ -85279,9 +85279,9 @@ fd 00 06 00 -29 -0b -01 +3c +37 +00 00 02 00 @@ -85289,9 +85289,9 @@ fd 00 06 00 -2d -0b -01 +40 +37 +00 00 02 00 @@ -85299,9 +85299,9 @@ fd 00 06 00 -31 -0b -01 +44 +37 +00 00 02 00 @@ -85309,9 +85309,9 @@ fd 00 06 00 -35 -0b -01 +48 +37 +00 00 02 00 @@ -85319,639 +85319,1099 @@ fd 00 06 00 +4c +37 +00 +00 +02 +00 +00 +00 +06 +00 +50 +37 +00 +00 +02 +00 +00 +00 +06 +00 +54 +37 +00 +00 +02 +00 +00 +00 +06 +00 +58 +37 +00 +00 +02 +00 +00 +00 +06 +00 +5c +37 +00 +00 +02 +00 +00 +00 +06 +00 +60 +37 +00 +00 +02 +00 +00 +00 +06 +00 +64 +37 +00 +00 +02 +00 +00 +00 +06 +00 +68 +37 +00 +00 +02 +00 +00 +00 +06 +00 +6c +37 +00 +00 +02 +00 +00 +00 +06 +00 +70 +37 +00 +00 +02 +00 +00 +00 +06 +00 +74 +37 +00 +00 +02 +00 +00 +00 +06 +00 +78 +37 +00 +00 +02 +00 +00 +00 +06 +00 +7c +37 +00 +00 +02 +00 +00 +00 +06 +00 +80 +37 +00 +00 +02 +00 +00 +00 +06 +00 +84 +37 +00 +00 +02 +00 +00 +00 +06 +00 +88 +37 +00 +00 +02 +00 +00 +00 +06 +00 +8c +37 +00 +00 +02 +00 +00 +00 +06 +00 +90 +37 +00 +00 +02 +00 +00 +00 +06 +00 +94 +37 +00 +00 +02 +00 +00 +00 +06 +00 +98 +37 +00 +00 +02 +00 +00 +00 +06 +00 +9c +37 +00 +00 +02 +00 +00 +00 +06 +00 +a0 +37 +00 +00 +02 +00 +00 +00 +06 +00 +a4 +37 +00 +00 +02 +00 +00 +00 +06 +00 +a8 +37 +00 +00 +02 +00 +00 +00 +06 +00 +ac +37 +00 +00 +02 +00 +00 +00 +06 +00 +b0 +37 +00 +00 +02 +00 +00 +00 +06 +00 +b4 +37 +00 +00 +02 +00 +00 +00 +06 +00 +b8 +37 +00 +00 +02 +00 +00 +00 +06 +00 +bc +37 +00 +00 +02 +00 +00 +00 +06 +00 +c0 +37 +00 +00 +02 +00 +00 +00 +06 +00 +c4 +37 +00 +00 +02 +00 +00 +00 +06 +00 +c8 +37 +00 +00 +02 +00 +00 +00 +06 +00 +cc +37 +00 +00 +02 +00 +00 +00 +06 +00 +d0 +37 +00 +00 +02 +00 +00 +00 +06 +00 +d4 +37 +00 +00 +02 +00 +00 +00 +06 +00 +d8 +37 +00 +00 +02 +00 +00 +00 +06 +00 +dc +37 +00 +00 +02 +00 +00 +00 +06 +00 +e0 +37 +00 +00 +02 +00 +00 +00 +06 +00 +e4 +37 +00 +00 +02 +00 +00 +00 +06 +00 +e8 +37 +00 +00 +02 +00 +00 +00 +06 +00 +ec +37 +00 +00 +02 +00 +00 +00 +06 +00 +f0 +37 +00 +00 +02 +00 +00 +00 +06 +00 +f4 +37 +00 +00 +02 +00 +00 +00 +06 +00 +f8 +37 +00 +00 +02 +00 +00 +00 +06 +00 +fc +37 +00 +00 +02 +00 +00 +00 +06 +00 +00 +38 +00 +00 +02 +00 +00 +00 +06 +00 +04 +38 +00 +00 +02 +00 +00 +00 +06 +00 +08 +38 +00 +00 +02 +00 +00 +00 +06 +00 +0c +38 +00 +00 +02 +00 +00 +00 +06 +00 +10 +38 +00 +00 +02 +00 +00 +00 +06 +00 +14 +38 +00 +00 +02 +00 +00 +00 +06 +00 +18 +38 +00 +00 +02 +00 +00 +00 +06 +00 +1c +38 +00 +00 +02 +00 +00 +00 +06 +00 +20 +38 +00 +00 +02 +00 +00 +00 +06 +00 +24 +38 +00 +00 +02 +00 +00 +00 +06 +00 +28 +38 +00 +00 +02 +00 +00 +00 +06 +00 +2c +38 +00 +00 +02 +00 +00 +00 +06 +00 +30 +38 +00 +00 +02 +00 +00 +00 +06 +00 +34 +38 +00 +00 +02 +00 +00 +00 +06 +00 +38 +38 +00 +00 +02 +00 +00 +00 +06 +00 +3c +38 +00 +00 +02 +00 +00 +00 +06 +00 +40 +38 +00 +00 +02 +00 +00 +00 +06 +00 +44 +38 +00 +00 +02 +00 +00 +00 +06 +00 +48 +38 +00 +00 +02 +00 +00 +00 +06 +00 +4c +38 +00 +00 +02 +00 +00 +00 +06 +00 +50 +38 +00 +00 +02 +00 +00 +00 +06 +00 +54 +38 +00 +00 +02 +00 +00 +00 +06 +00 +58 +38 +00 +00 +02 +00 +00 +00 +06 +00 +5c +38 +00 +00 +02 +00 +00 +00 +06 +00 +60 +38 +00 +00 +02 +00 +00 +00 +06 +00 +64 +38 +00 +00 +02 +00 +00 +00 +06 +00 +68 +38 +00 +00 +02 +00 +00 +00 +06 +00 +6c +38 +00 +00 +02 +00 +00 +00 +06 +00 +70 +38 +00 +00 +02 +00 +00 +00 +06 +00 +74 +38 +00 +00 +02 +00 +00 +00 +06 +00 +78 +38 +00 +00 +02 +00 +00 +00 +06 +00 +7c +38 +00 +00 +02 +00 +00 +00 +06 +00 +80 +38 +00 +00 +02 +00 +00 +00 +06 +00 +84 +38 +00 +00 +02 +00 +00 +00 +06 +00 +88 +38 +00 +00 +02 +00 +00 +00 +06 +00 +8c +38 +00 +00 +02 +00 +00 +00 +06 +00 +90 +38 +00 +00 +02 +00 +00 +00 +06 +00 +94 +38 +00 +00 +02 +00 +00 +00 +06 +00 +98 +38 +00 +00 +02 +00 +00 +00 +06 +00 +9c +38 +00 +00 +02 +00 +00 +00 +06 +00 +a0 +38 +00 +00 +02 +00 +00 +00 +06 +00 +a4 +38 +00 +00 +02 +00 +00 +00 +06 +00 +a8 +38 +00 +00 +02 +00 +00 +00 +06 +00 +ac +38 +00 +00 +02 +00 +00 +00 +06 +00 +b0 +38 +00 +00 +02 +00 +00 +00 +06 +00 +b4 +38 +00 +00 +02 +00 +00 +00 +06 +00 +b8 +38 +00 +00 +02 +00 +00 +00 +06 +00 +bc +38 +00 +00 +02 +00 +00 +00 +06 +00 +c0 +38 +00 +00 +02 +00 +00 +00 +06 +00 +c4 +38 +00 +00 +02 +00 +00 +00 +06 +00 +c8 +38 +00 +00 +02 +00 +00 +00 +06 +00 +cc +38 +00 +00 +02 +00 +00 +00 +06 +00 +d0 +38 +00 +00 +02 +00 +00 +00 +06 +00 +d4 +38 +00 +00 +02 +00 +00 +00 +06 +00 +d8 +38 +00 +00 +02 +00 +00 +00 +06 +00 +dc +38 +00 +00 +02 +00 +00 +00 +06 +00 +e0 +38 +00 +00 +02 +00 +00 +00 +06 +00 +e4 +38 +00 +00 +02 +00 +00 +00 +06 +00 +e8 +38 +00 +00 +02 +00 +00 +00 +06 +00 +ec +38 +00 +00 +02 +00 +00 +00 +06 +00 +f0 +38 +00 +00 +02 +00 +00 +00 +06 +00 +f4 +38 +00 +00 +02 +00 +00 +00 +06 +00 +f8 +38 +00 +00 +02 +00 +00 +00 +06 +00 +fc +38 +00 +00 +02 +00 +00 +00 +06 +00 +00 39 -0b -01 -00 -02 -00 -00 -00 -06 -00 -3d -0b -01 -00 -02 -00 -00 -00 -06 -00 -41 -0b -01 -00 -02 -00 -00 -00 -06 -00 -45 -0b -01 -00 -02 -00 -00 -00 -06 -00 -49 -0b -01 -00 -02 -00 -00 -00 -06 -00 -4d -0b -01 -00 -02 -00 -00 -00 -06 -00 -51 -0b -01 -00 -02 -00 -00 -00 -06 -00 -55 -0b -01 -00 -02 -00 -00 -00 -06 -00 -59 -0b -01 -00 -02 -00 -00 -00 -06 -00 -5d -0b -01 -00 -02 -00 -00 -00 -06 -00 -61 -0b -01 -00 -02 -00 -00 -00 -06 -00 -65 -0b -01 -00 -02 -00 -00 -00 -06 -00 -69 -0b -01 -00 -02 -00 -00 -00 -06 -00 -6d -0b -01 -00 -02 -00 -00 -00 -06 -00 -71 -0b -01 -00 -02 -00 -00 -00 -06 -00 -75 -0b -01 -00 -02 -00 -00 -00 -06 -00 -79 -0b -01 -00 -02 -00 -00 -00 -06 -00 -7d -0b -01 -00 -02 -00 -00 -00 -06 -00 -81 -0b -01 -00 -02 -00 -00 -00 -06 -00 -85 -0b -01 -00 -02 -00 -00 -00 -06 -00 -89 -0b -01 -00 -02 -00 -00 -00 -06 -00 -8d -0b -01 -00 -02 -00 -00 -00 -06 -00 -91 -0b -01 -00 -02 -00 -00 -00 -06 -00 -95 -0b -01 -00 -02 -00 -00 -00 -06 -00 -99 -0b -01 -00 -02 -00 -00 -00 -06 -00 -9d -0b -01 -00 -02 -00 -00 -00 -06 -00 -a1 -0b -01 -00 -02 -00 -00 -00 -06 -00 -a5 -0b -01 -00 -02 -00 -00 -00 -06 -00 -a9 -0b -01 -00 -02 -00 -00 -00 -06 -00 -ad -0b -01 -00 -02 -00 -00 -00 -06 -00 -b1 -0b -01 -00 -02 -00 -00 -00 -06 -00 -b5 -0b -01 -00 -02 -00 -00 -00 -06 -00 -b9 -0b -01 -00 -02 -00 -00 -00 -06 -00 -bd -0b -01 -00 -02 -00 -00 -00 -06 -00 -c1 -0b -01 -00 -02 -00 -00 -00 -06 -00 -c5 -0b -01 -00 -02 -00 -00 -00 -06 -00 -c9 -0b -01 -00 -02 -00 -00 -00 -06 -00 -cd -0b -01 -00 -02 -00 -00 -00 -06 -00 -d1 -0b -01 -00 -02 -00 -00 -00 -06 -00 -d5 -0b -01 -00 -02 -00 -00 -00 -06 -00 -d9 -0b -01 -00 -02 -00 -00 -00 -06 -00 -dd -0b -01 -00 -02 -00 -00 -00 -06 -00 -e1 -0b -01 -00 -02 -00 -00 -00 -06 -00 -e5 -0b -01 -00 -02 -00 -00 -00 -06 -00 -e9 -0b -01 -00 -02 -00 -00 -00 -06 -00 -ed -0b -01 -00 -02 -00 -00 -00 -06 -00 -f1 -0b -01 -00 -02 -00 -00 -00 -06 -00 -f5 -0b -01 -00 -02 -00 -00 -00 -06 -00 -f9 -0b -01 -00 -02 -00 -00 -00 -06 -00 -fd -0b -01 -00 -02 -00 -00 -00 -06 -00 -01 -0c -01 -00 -02 -00 -00 -00 -06 -00 -05 -0c -01 -00 -02 -00 -00 -00 -06 -00 -09 -0c -01 -00 -02 -00 -00 -00 -06 -00 -0d -0c -01 -00 -02 -00 -00 -00 -06 -00 -11 -0c -01 -00 -02 -00 -00 -00 -06 -00 -15 -0c -01 -00 -02 -00 -00 -00 -06 -00 -19 -0c -01 -00 -02 -00 -00 -00 -06 -00 -1d -0c -01 -00 -02 -00 -00 -00 -06 -00 -21 -0c -01 -00 -02 -00 -00 -00 -06 -00 -25 -0c -01 -00 -02 -00 -00 -00 -06 -00 -29 -0c -01 -00 -02 -00 -00 -00 -06 -00 -2d -0c -01 -00 -02 -00 -00 -00 -06 -00 -31 -0c -01 -00 -02 -00 -00 -00 -06 -00 -35 -0c -01 +00 00 02 00 @@ -85959,639 +86419,9 @@ fd 00 06 00 +04 39 -0c -01 -00 -02 -00 -00 -00 -06 -00 -3d -0c -01 -00 -02 -00 -00 -00 -06 -00 -41 -0c -01 -00 -02 -00 -00 -00 -06 -00 -45 -0c -01 -00 -02 -00 -00 -00 -06 -00 -49 -0c -01 -00 -02 -00 -00 -00 -06 -00 -4d -0c -01 -00 -02 -00 -00 -00 -06 -00 -51 -0c -01 -00 -02 -00 -00 -00 -06 -00 -55 -0c -01 -00 -02 -00 -00 -00 -06 -00 -59 -0c -01 -00 -02 -00 -00 -00 -06 -00 -5d -0c -01 -00 -02 -00 -00 -00 -06 -00 -61 -0c -01 -00 -02 -00 -00 -00 -06 -00 -65 -0c -01 -00 -02 -00 -00 -00 -06 -00 -69 -0c -01 -00 -02 -00 -00 -00 -06 -00 -6d -0c -01 -00 -02 -00 -00 -00 -06 -00 -71 -0c -01 -00 -02 -00 -00 -00 -06 -00 -75 -0c -01 -00 -02 -00 -00 -00 -06 -00 -79 -0c -01 -00 -02 -00 -00 -00 -06 -00 -7d -0c -01 -00 -02 -00 -00 -00 -06 -00 -81 -0c -01 -00 -02 -00 -00 -00 -06 -00 -85 -0c -01 -00 -02 -00 -00 -00 -06 -00 -89 -0c -01 -00 -02 -00 -00 -00 -06 -00 -8d -0c -01 -00 -02 -00 -00 -00 -06 -00 -91 -0c -01 -00 -02 -00 -00 -00 -06 -00 -95 -0c -01 -00 -02 -00 -00 -00 -06 -00 -99 -0c -01 -00 -02 -00 -00 -00 -06 -00 -9d -0c -01 -00 -02 -00 -00 -00 -06 -00 -a1 -0c -01 -00 -02 -00 -00 -00 -06 -00 -a5 -0c -01 -00 -02 -00 -00 -00 -06 -00 -a9 -0c -01 -00 -02 -00 -00 -00 -06 -00 -ad -0c -01 -00 -02 -00 -00 -00 -06 -00 -b1 -0c -01 -00 -02 -00 -00 -00 -06 -00 -b5 -0c -01 -00 -02 -00 -00 -00 -06 -00 -b9 -0c -01 -00 -02 -00 -00 -00 -06 -00 -bd -0c -01 -00 -02 -00 -00 -00 -06 -00 -c1 -0c -01 -00 -02 -00 -00 -00 -06 -00 -c5 -0c -01 -00 -02 -00 -00 -00 -06 -00 -c9 -0c -01 -00 -02 -00 -00 -00 -06 -00 -cd -0c -01 -00 -02 -00 -00 -00 -06 -00 -d1 -0c -01 -00 -02 -00 -00 -00 -06 -00 -d5 -0c -01 -00 -02 -00 -00 -00 -06 -00 -d9 -0c -01 -00 -02 -00 -00 -00 -06 -00 -dd -0c -01 -00 -02 -00 -00 -00 -06 -00 -e1 -0c -01 -00 -02 -00 -00 -00 -06 -00 -e5 -0c -01 -00 -02 -00 -00 -00 -06 -00 -e9 -0c -01 -00 -02 -00 -00 -00 -06 -00 -ed -0c -01 -00 -02 -00 -00 -00 -06 -00 -f1 -0c -01 -00 -02 -00 -00 -00 -06 -00 -f5 -0c -01 -00 -02 -00 -00 -00 -06 -00 -f9 -0c -01 -00 -02 -00 -00 -00 -06 -00 -fd -0c -01 -00 -02 -00 -00 -00 -06 -00 -01 -0d -01 -00 -02 -00 -00 -00 -06 -00 -05 -0d -01 -00 -02 -00 -00 -00 -06 -00 -09 -0d -01 -00 -02 -00 -00 -00 -06 -00 -0d -0d -01 -00 -02 -00 -00 -00 -06 -00 -11 -0d -01 -00 -02 -00 -00 -00 -06 -00 -15 -0d -01 -00 -02 -00 -00 -00 -06 -00 -19 -0d -01 -00 -02 -00 -00 -00 -06 -00 -1d -0d -01 -00 -02 -00 -00 -00 -06 -00 -21 -0d -01 -00 -02 -00 -00 -00 -06 -00 -25 -0d -01 -00 -02 -00 -00 -00 -06 -00 -29 -0d -01 -00 -02 -00 -00 -00 -06 -00 -2d -0d -01 -00 -02 -00 -00 -00 -06 -00 -31 -0d -01 -00 -02 -00 -00 -00 -06 -00 -35 -0d -01 +00 00 02 00 @@ -86599,509 +86429,9 @@ fd 00 06 00 +08 39 -0d -01 -00 -02 -00 -00 -00 -06 -00 -3d -0d -01 -00 -02 -00 -00 -00 -06 -00 -41 -0d -01 -00 -02 -00 -00 -00 -06 -00 -45 -0d -01 -00 -02 -00 -00 -00 -06 -00 -49 -0d -01 -00 -02 -00 -00 -00 -06 -00 -4d -0d -01 -00 -02 -00 -00 -00 -06 -00 -51 -0d -01 -00 -02 -00 -00 -00 -06 -00 -55 -0d -01 -00 -02 -00 -00 -00 -06 -00 -59 -0d -01 -00 -02 -00 -00 -00 -06 -00 -5d -0d -01 -00 -02 -00 -00 -00 -06 -00 -61 -0d -01 -00 -02 -00 -00 -00 -06 -00 -65 -0d -01 -00 -02 -00 -00 -00 -06 -00 -69 -0d -01 -00 -02 -00 -00 -00 -06 -00 -6d -0d -01 -00 -02 -00 -00 -00 -06 -00 -71 -0d -01 -00 -02 -00 -00 -00 -06 -00 -75 -0d -01 -00 -02 -00 -00 -00 -06 -00 -79 -0d -01 -00 -02 -00 -00 -00 -06 -00 -7d -0d -01 -00 -02 -00 -00 -00 -06 -00 -81 -0d -01 -00 -02 -00 -00 -00 -06 -00 -85 -0d -01 -00 -02 -00 -00 -00 -06 -00 -89 -0d -01 -00 -02 -00 -00 -00 -06 -00 -8d -0d -01 -00 -02 -00 -00 -00 -06 -00 -91 -0d -01 -00 -02 -00 -00 -00 -06 -00 -95 -0d -01 -00 -02 -00 -00 -00 -06 -00 -99 -0d -01 -00 -02 -00 -00 -00 -06 -00 -9d -0d -01 -00 -02 -00 -00 -00 -06 -00 -a1 -0d -01 -00 -02 -00 -00 -00 -06 -00 -a5 -0d -01 -00 -02 -00 -00 -00 -06 -00 -a9 -0d -01 -00 -02 -00 -00 -00 -06 -00 -ad -0d -01 -00 -02 -00 -00 -00 -06 -00 -b1 -0d -01 -00 -02 -00 -00 -00 -06 -00 -b5 -0d -01 -00 -02 -00 -00 -00 -06 -00 -ed -0e -01 -00 -02 -00 -00 -00 -06 -00 -f1 -0e -01 -00 -02 -00 -00 -00 -06 -00 -f5 -0e -01 -00 -02 -00 -00 -00 -06 -00 -f9 -0e -01 -00 -02 -00 -00 -00 -06 -00 -fd -0e -01 -00 -02 -00 -00 -00 -06 -00 -01 -0f -01 -00 -02 -00 -00 -00 -06 -00 -05 -0f -01 -00 -02 -00 -00 -00 -06 -00 -09 -0f -01 -00 -02 -00 -00 -00 -06 -00 -0d -0f -01 -00 -02 -00 -00 -00 -06 -00 -11 -0f -01 -00 -02 -00 -00 -00 -06 -00 -15 -0f -01 -00 -02 -00 -00 -00 -06 -00 -19 -0f -01 -00 -02 -00 -00 -00 -06 -00 -1d -0f -01 -00 -02 -00 -00 -00 -06 -00 -21 -0f -01 -00 -02 -00 -00 -00 -06 -00 -25 -0f -01 -00 -02 -00 -00 -00 -06 -00 -29 -0f -01 -00 -02 -00 -00 -00 -06 -00 -2d -0f -01 -00 -02 -00 -00 -00 -06 -00 -31 -0f -01 -00 -02 -00 -00 -00 -06 -00 -35 -0f -01 +00 00 02 00 @@ -87109,9 +86439,9 @@ fd 00 06 00 +0c 39 -0f -01 +00 00 02 00 @@ -87119,1269 +86449,9 @@ fd 00 06 00 -3d -0f -01 -00 -02 -00 -00 -00 -06 -00 -41 -0f -01 -00 -02 -00 -00 -00 -06 -00 -45 -0f -01 -00 -02 -00 -00 -00 -06 -00 -49 -0f -01 -00 -02 -00 -00 -00 -06 -00 -4d -0f -01 -00 -02 -00 -00 -00 -06 -00 -51 -0f -01 -00 -02 -00 -00 -00 -06 -00 -55 -0f -01 -00 -02 -00 -00 -00 -06 -00 -59 -0f -01 -00 -02 -00 -00 -00 -06 -00 -5d -0f -01 -00 -02 -00 -00 -00 -06 -00 -61 -0f -01 -00 -02 -00 -00 -00 -06 -00 -65 -0f -01 -00 -02 -00 -00 -00 -06 -00 -69 -0f -01 -00 -02 -00 -00 -00 -06 -00 -6d -0f -01 -00 -02 -00 -00 -00 -06 -00 -71 -0f -01 -00 -02 -00 -00 -00 -06 -00 -75 -0f -01 -00 -02 -00 -00 -00 -06 -00 -79 -0f -01 -00 -02 -00 -00 -00 -06 -00 -7d -0f -01 -00 -02 -00 -00 -00 -06 -00 -81 -0f -01 -00 -02 -00 -00 -00 -06 -00 -85 -0f -01 -00 -02 -00 -00 -00 -06 -00 -89 -0f -01 -00 -02 -00 -00 -00 -06 -00 -8d -0f -01 -00 -02 -00 -00 -00 -06 -00 -91 -0f -01 -00 -02 -00 -00 -00 -06 -00 -95 -0f -01 -00 -02 -00 -00 -00 -06 -00 -99 -0f -01 -00 -02 -00 -00 -00 -06 -00 -9d -0f -01 -00 -02 -00 -00 -00 -06 -00 -a1 -0f -01 -00 -02 -00 -00 -00 -06 -00 -a5 -0f -01 -00 -02 -00 -00 -00 -06 -00 -a9 -0f -01 -00 -02 -00 -00 -00 -06 -00 -ad -0f -01 -00 -02 -00 -00 -00 -06 -00 -b1 -0f -01 -00 -02 -00 -00 -00 -06 -00 -b5 -0f -01 -00 -02 -00 -00 -00 -06 -00 -b9 -0f -01 -00 -02 -00 -00 -00 -06 -00 -bd -0f -01 -00 -02 -00 -00 -00 -06 -00 -c1 -0f -01 -00 -02 -00 -00 -00 -06 -00 -c5 -0f -01 -00 -02 -00 -00 -00 -06 -00 -c9 -0f -01 -00 -02 -00 -00 -00 -06 -00 -cd -0f -01 -00 -02 -00 -00 -00 -06 -00 -d1 -0f -01 -00 -02 -00 -00 -00 -06 -00 -d5 -0f -01 -00 -02 -00 -00 -00 -06 -00 -d9 -0f -01 -00 -02 -00 -00 -00 -06 -00 -dd -0f -01 -00 -02 -00 -00 -00 -06 -00 -e1 -0f -01 -00 -02 -00 -00 -00 -06 -00 -e5 -0f -01 -00 -02 -00 -00 -00 -06 -00 -e9 -0f -01 -00 -02 -00 -00 -00 -06 -00 -ed -0f -01 -00 -02 -00 -00 -00 -06 -00 -f1 -0f -01 -00 -02 -00 -00 -00 -06 -00 -f5 -0f -01 -00 -02 -00 -00 -00 -06 -00 -f9 -0f -01 -00 -02 -00 -00 -00 -06 -00 -fd -0f -01 -00 -02 -00 -00 -00 -06 -00 -01 10 -01 -00 -02 -00 -00 -00 -06 -00 -05 -10 -01 -00 -02 -00 -00 -00 -06 -00 -09 -10 -01 -00 -02 -00 -00 -00 -06 -00 -0d -10 -01 -00 -02 -00 -00 -00 -06 -00 -11 -10 -01 -00 -02 -00 -00 -00 -06 -00 -15 -10 -01 -00 -02 -00 -00 -00 -06 -00 -19 -10 -01 -00 -02 -00 -00 -00 -06 -00 -1d -10 -01 -00 -02 -00 -00 -00 -06 -00 -21 -10 -01 -00 -02 -00 -00 -00 -06 -00 -25 -10 -01 -00 -02 -00 -00 -00 -06 -00 -29 -10 -01 -00 -02 -00 -00 -00 -06 -00 -2d -10 -01 -00 -02 -00 -00 -00 -06 -00 -31 -10 -01 -00 -02 -00 -00 -00 -06 -00 -35 -10 -01 -00 -02 -00 -00 -00 -06 -00 39 -10 -01 -00 -02 -00 -00 -00 -06 -00 -3d -10 -01 -00 -02 -00 -00 -00 -06 -00 -41 -10 -01 -00 -02 -00 -00 -00 -06 -00 -45 -10 -01 -00 -02 -00 -00 -00 -06 -00 -49 -10 -01 -00 -02 -00 -00 -00 -06 -00 -4d -10 -01 -00 -02 -00 -00 -00 -06 -00 -51 -10 -01 -00 -02 -00 -00 -00 -06 -00 -55 -10 -01 -00 -02 -00 -00 -00 -06 -00 -59 -10 -01 -00 -02 -00 -00 -00 -06 -00 -5d -10 -01 -00 -02 -00 -00 -00 -06 -00 -61 -10 -01 -00 -02 -00 -00 -00 -06 -00 -65 -10 -01 -00 -02 -00 -00 -00 -06 -00 -69 -10 -01 -00 -02 -00 -00 -00 -06 -00 -6d -10 -01 -00 -02 -00 -00 -00 -06 -00 -71 -10 -01 -00 -02 -00 -00 -00 -06 -00 -75 -10 -01 -00 -02 -00 -00 -00 -06 -00 -79 -10 -01 -00 -02 -00 -00 -00 -06 -00 -7d -10 -01 -00 -02 -00 -00 -00 -06 -00 -81 -10 -01 -00 -02 -00 -00 -00 -06 -00 -85 -10 -01 -00 -02 -00 -00 -00 -06 -00 -89 -10 -01 -00 -02 -00 -00 -00 -06 -00 -8d -10 -01 -00 -02 -00 -00 -00 -06 -00 -91 -10 -01 -00 -02 -00 -00 -00 -06 -00 -95 -10 -01 -00 -02 -00 -00 -00 -06 -00 -99 -10 -01 -00 -02 -00 -00 -00 -06 -00 -9d -10 -01 -00 -02 -00 -00 -00 -06 -00 -a1 -10 -01 -00 -02 -00 -00 -00 -06 -00 -a5 -10 -01 -00 -02 -00 -00 -00 -06 -00 -a9 -10 -01 -00 -02 -00 -00 -00 -06 -00 -ad -10 -01 -00 -02 -00 -00 -00 -06 -00 -b1 -10 -01 -00 -02 -00 -00 -00 -06 -00 -b5 -10 -01 -00 -02 -00 -00 -00 -06 -00 -b9 -10 -01 -00 -02 -00 -00 -00 -06 -00 -bd -10 -01 -00 -02 -00 -00 -00 -06 -00 -c1 -10 -01 -00 -02 -00 -00 -00 -06 -00 -c5 -10 -01 -00 -02 -00 -00 -00 -06 -00 -c9 -10 -01 -00 -02 -00 -00 -00 -06 -00 -cd -10 -01 -00 -02 -00 -00 -00 -06 -00 -d1 -10 -01 -00 -02 -00 -00 -00 -06 -00 -d5 -10 -01 -00 -02 -00 -00 -00 -06 -00 -d9 -10 -01 -00 -02 -00 -00 -00 -06 -00 -dd -10 -01 -00 -02 -00 -00 -00 -06 -00 -e1 -10 -01 -00 -02 -00 -00 -00 -06 -00 -e5 -10 -01 -00 -02 -00 -00 -00 -06 -00 -e9 -10 -01 -00 -02 -00 -00 -00 -06 -00 -ed -10 -01 -00 -02 -00 -00 -00 -06 -00 -f1 -10 -01 -00 -02 -00 -00 -00 -06 -00 -f5 -10 -01 -00 -02 -00 -00 -00 -06 -00 -f9 -10 -01 -00 -02 -00 -00 -00 -06 -00 -fd -10 -01 -00 -02 -00 -00 -00 -06 -00 -01 -11 -01 -00 -02 -00 -00 -00 -06 -00 -05 -11 -01 -00 -02 -00 -00 -00 -06 -00 -09 -11 -01 -00 -02 -00 -00 -00 -06 -00 -0d -11 -01 -00 -02 -00 -00 -00 -06 -00 -11 -11 -01 -00 -02 -00 -00 -00 -06 -00 -15 -11 -01 -00 -02 -00 -00 -00 -06 -00 -19 -11 -01 -00 -02 -00 -00 -00 -06 -00 -1d -11 -01 -00 -02 -00 -00 -00 -06 -00 -21 -11 -01 -00 -02 -00 -00 -00 -06 -00 -25 -11 -01 -00 -02 -00 -00 -00 -06 -00 -29 -11 -01 -00 -02 -00 -00 -00 -06 -00 -2d -11 -01 -00 -02 -00 -00 -00 -06 -00 -31 -11 -01 -00 -02 -00 -00 -00 -06 -00 -35 -11 -01 +00 00 02 00 @@ -88389,639 +86459,9 @@ fd 00 06 00 +14 39 -11 -01 -00 -02 -00 -00 -00 -06 -00 -3d -11 -01 -00 -02 -00 -00 -00 -06 -00 -41 -11 -01 -00 -02 -00 -00 -00 -06 -00 -45 -11 -01 -00 -02 -00 -00 -00 -06 -00 -49 -11 -01 -00 -02 -00 -00 -00 -06 -00 -4d -11 -01 -00 -02 -00 -00 -00 -06 -00 -51 -11 -01 -00 -02 -00 -00 -00 -06 -00 -55 -11 -01 -00 -02 -00 -00 -00 -06 -00 -59 -11 -01 -00 -02 -00 -00 -00 -06 -00 -5d -11 -01 -00 -02 -00 -00 -00 -06 -00 -61 -11 -01 -00 -02 -00 -00 -00 -06 -00 -65 -11 -01 -00 -02 -00 -00 -00 -06 -00 -69 -11 -01 -00 -02 -00 -00 -00 -06 -00 -6d -11 -01 -00 -02 -00 -00 -00 -06 -00 -71 -11 -01 -00 -02 -00 -00 -00 -06 -00 -75 -11 -01 -00 -02 -00 -00 -00 -06 -00 -79 -11 -01 -00 -02 -00 -00 -00 -06 -00 -7d -11 -01 -00 -02 -00 -00 -00 -06 -00 -81 -11 -01 -00 -02 -00 -00 -00 -06 -00 -85 -11 -01 -00 -02 -00 -00 -00 -06 -00 -89 -11 -01 -00 -02 -00 -00 -00 -06 -00 -8d -11 -01 -00 -02 -00 -00 -00 -06 -00 -91 -11 -01 -00 -02 -00 -00 -00 -06 -00 -95 -11 -01 -00 -02 -00 -00 -00 -06 -00 -99 -11 -01 -00 -02 -00 -00 -00 -06 -00 -9d -11 -01 -00 -02 -00 -00 -00 -06 -00 -a1 -11 -01 -00 -02 -00 -00 -00 -06 -00 -a5 -11 -01 -00 -02 -00 -00 -00 -06 -00 -a9 -11 -01 -00 -02 -00 -00 -00 -06 -00 -ad -11 -01 -00 -02 -00 -00 -00 -06 -00 -b1 -11 -01 -00 -02 -00 -00 -00 -06 -00 -b5 -11 -01 -00 -02 -00 -00 -00 -06 -00 -b9 -11 -01 -00 -02 -00 -00 -00 -06 -00 -bd -11 -01 -00 -02 -00 -00 -00 -06 -00 -c1 -11 -01 -00 -02 -00 -00 -00 -06 -00 -c5 -11 -01 -00 -02 -00 -00 -00 -06 -00 -c9 -11 -01 -00 -02 -00 -00 -00 -06 -00 -cd -11 -01 -00 -02 -00 -00 -00 -06 -00 -d1 -11 -01 -00 -02 -00 -00 -00 -06 -00 -d5 -11 -01 -00 -02 -00 -00 -00 -06 -00 -d9 -11 -01 -00 -02 -00 -00 -00 -06 -00 -dd -11 -01 -00 -02 -00 -00 -00 -06 -00 -e1 -11 -01 -00 -02 -00 -00 -00 -06 -00 -e5 -11 -01 -00 -02 -00 -00 -00 -06 -00 -e9 -11 -01 -00 -02 -00 -00 -00 -06 -00 -ed -11 -01 -00 -02 -00 -00 -00 -06 -00 -f1 -11 -01 -00 -02 -00 -00 -00 -06 -00 -f5 -11 -01 -00 -02 -00 -00 -00 -06 -00 -f9 -11 -01 -00 -02 -00 -00 -00 -06 -00 -fd -11 -01 -00 -02 -00 -00 -00 -06 -00 -01 -12 -01 -00 -02 -00 -00 -00 -06 -00 -05 -12 -01 -00 -02 -00 -00 -00 -06 -00 -09 -12 -01 -00 -02 -00 -00 -00 -06 -00 -0d -12 -01 -00 -02 -00 -00 -00 -06 -00 -11 -12 -01 -00 -02 -00 -00 -00 -06 -00 -15 -12 -01 -00 -02 -00 -00 -00 -06 -00 -19 -12 -01 -00 -02 -00 -00 -00 -06 -00 -1d -12 -01 -00 -02 -00 -00 -00 -06 -00 -21 -12 -01 -00 -02 -00 -00 -00 -06 -00 -25 -12 -01 -00 -02 -00 -00 -00 -06 -00 -29 -12 -01 -00 -02 -00 -00 -00 -06 -00 -2d -12 -01 -00 -02 -00 -00 -00 -06 -00 -31 -12 -01 -00 -02 -00 -00 -00 -06 -00 -35 -12 -01 +00 00 02 00 @@ -89029,639 +86469,9 @@ fd 00 06 00 +18 39 -12 -01 -00 -02 -00 -00 -00 -06 -00 -3d -12 -01 -00 -02 -00 -00 -00 -06 -00 -41 -12 -01 -00 -02 -00 -00 -00 -06 -00 -45 -12 -01 -00 -02 -00 -00 -00 -06 -00 -49 -12 -01 -00 -02 -00 -00 -00 -06 -00 -4d -12 -01 -00 -02 -00 -00 -00 -06 -00 -51 -12 -01 -00 -02 -00 -00 -00 -06 -00 -55 -12 -01 -00 -02 -00 -00 -00 -06 -00 -59 -12 -01 -00 -02 -00 -00 -00 -06 -00 -5d -12 -01 -00 -02 -00 -00 -00 -06 -00 -61 -12 -01 -00 -02 -00 -00 -00 -06 -00 -65 -12 -01 -00 -02 -00 -00 -00 -06 -00 -69 -12 -01 -00 -02 -00 -00 -00 -06 -00 -6d -12 -01 -00 -02 -00 -00 -00 -06 -00 -71 -12 -01 -00 -02 -00 -00 -00 -06 -00 -75 -12 -01 -00 -02 -00 -00 -00 -06 -00 -79 -12 -01 -00 -02 -00 -00 -00 -06 -00 -7d -12 -01 -00 -02 -00 -00 -00 -06 -00 -81 -12 -01 -00 -02 -00 -00 -00 -06 -00 -85 -12 -01 -00 -02 -00 -00 -00 -06 -00 -89 -12 -01 -00 -02 -00 -00 -00 -06 -00 -8d -12 -01 -00 -02 -00 -00 -00 -06 -00 -91 -12 -01 -00 -02 -00 -00 -00 -06 -00 -95 -12 -01 -00 -02 -00 -00 -00 -06 -00 -99 -12 -01 -00 -02 -00 -00 -00 -06 -00 -9d -12 -01 -00 -02 -00 -00 -00 -06 -00 -a1 -12 -01 -00 -02 -00 -00 -00 -06 -00 -a5 -12 -01 -00 -02 -00 -00 -00 -06 -00 -a9 -12 -01 -00 -02 -00 -00 -00 -06 -00 -ad -12 -01 -00 -02 -00 -00 -00 -06 -00 -b1 -12 -01 -00 -02 -00 -00 -00 -06 -00 -b5 -12 -01 -00 -02 -00 -00 -00 -06 -00 -b9 -12 -01 -00 -02 -00 -00 -00 -06 -00 -bd -12 -01 -00 -02 -00 -00 -00 -06 -00 -c1 -12 -01 -00 -02 -00 -00 -00 -06 -00 -c5 -12 -01 -00 -02 -00 -00 -00 -06 -00 -c9 -12 -01 -00 -02 -00 -00 -00 -06 -00 -cd -12 -01 -00 -02 -00 -00 -00 -06 -00 -d1 -12 -01 -00 -02 -00 -00 -00 -06 -00 -d5 -12 -01 -00 -02 -00 -00 -00 -06 -00 -d9 -12 -01 -00 -02 -00 -00 -00 -06 -00 -dd -12 -01 -00 -02 -00 -00 -00 -06 -00 -e1 -12 -01 -00 -02 -00 -00 -00 -06 -00 -e5 -12 -01 -00 -02 -00 -00 -00 -06 -00 -e9 -12 -01 -00 -02 -00 -00 -00 -06 -00 -ed -12 -01 -00 -02 -00 -00 -00 -06 -00 -f1 -12 -01 -00 -02 -00 -00 -00 -06 -00 -f5 -12 -01 -00 -02 -00 -00 -00 -06 -00 -f9 -12 -01 -00 -02 -00 -00 -00 -06 -00 -fd -12 -01 -00 -02 -00 -00 -00 -06 -00 -01 -13 -01 -00 -02 -00 -00 -00 -06 -00 -05 -13 -01 -00 -02 -00 -00 -00 -06 -00 -09 -13 -01 -00 -02 -00 -00 -00 -06 -00 -0d -13 -01 -00 -02 -00 -00 -00 -06 -00 -11 -13 -01 -00 -02 -00 -00 -00 -06 -00 -15 -13 -01 -00 -02 -00 -00 -00 -06 -00 -19 -13 -01 -00 -02 -00 -00 -00 -06 -00 -1d -13 -01 -00 -02 -00 -00 -00 -06 -00 -21 -13 -01 -00 -02 -00 -00 -00 -06 -00 -25 -13 -01 -00 -02 -00 -00 -00 -06 -00 -29 -13 -01 -00 -02 -00 -00 -00 -06 -00 -2d -13 -01 -00 -02 -00 -00 -00 -06 -00 -31 -13 -01 -00 -02 -00 -00 -00 -06 -00 -35 -13 -01 +00 00 02 00 @@ -89669,639 +86479,9 @@ fd 00 06 00 +1c 39 -13 -01 -00 -02 -00 -00 -00 -06 -00 -3d -13 -01 -00 -02 -00 -00 -00 -06 -00 -41 -13 -01 -00 -02 -00 -00 -00 -06 -00 -45 -13 -01 -00 -02 -00 -00 -00 -06 -00 -49 -13 -01 -00 -02 -00 -00 -00 -06 -00 -4d -13 -01 -00 -02 -00 -00 -00 -06 -00 -51 -13 -01 -00 -02 -00 -00 -00 -06 -00 -55 -13 -01 -00 -02 -00 -00 -00 -06 -00 -59 -13 -01 -00 -02 -00 -00 -00 -06 -00 -5d -13 -01 -00 -02 -00 -00 -00 -06 -00 -61 -13 -01 -00 -02 -00 -00 -00 -06 -00 -65 -13 -01 -00 -02 -00 -00 -00 -06 -00 -69 -13 -01 -00 -02 -00 -00 -00 -06 -00 -6d -13 -01 -00 -02 -00 -00 -00 -06 -00 -71 -13 -01 -00 -02 -00 -00 -00 -06 -00 -75 -13 -01 -00 -02 -00 -00 -00 -06 -00 -79 -13 -01 -00 -02 -00 -00 -00 -06 -00 -7d -13 -01 -00 -02 -00 -00 -00 -06 -00 -81 -13 -01 -00 -02 -00 -00 -00 -06 -00 -85 -13 -01 -00 -02 -00 -00 -00 -06 -00 -89 -13 -01 -00 -02 -00 -00 -00 -06 -00 -8d -13 -01 -00 -02 -00 -00 -00 -06 -00 -91 -13 -01 -00 -02 -00 -00 -00 -06 -00 -95 -13 -01 -00 -02 -00 -00 -00 -06 -00 -99 -13 -01 -00 -02 -00 -00 -00 -06 -00 -9d -13 -01 -00 -02 -00 -00 -00 -06 -00 -a1 -13 -01 -00 -02 -00 -00 -00 -06 -00 -a5 -13 -01 -00 -02 -00 -00 -00 -06 -00 -a9 -13 -01 -00 -02 -00 -00 -00 -06 -00 -ad -13 -01 -00 -02 -00 -00 -00 -06 -00 -b1 -13 -01 -00 -02 -00 -00 -00 -06 -00 -b5 -13 -01 -00 -02 -00 -00 -00 -06 -00 -b9 -13 -01 -00 -02 -00 -00 -00 -06 -00 -bd -13 -01 -00 -02 -00 -00 -00 -06 -00 -c1 -13 -01 -00 -02 -00 -00 -00 -06 -00 -c5 -13 -01 -00 -02 -00 -00 -00 -06 -00 -c9 -13 -01 -00 -02 -00 -00 -00 -06 -00 -cd -13 -01 -00 -02 -00 -00 -00 -06 -00 -d1 -13 -01 -00 -02 -00 -00 -00 -06 -00 -d5 -13 -01 -00 -02 -00 -00 -00 -06 -00 -d9 -13 -01 -00 -02 -00 -00 -00 -06 -00 -dd -13 -01 -00 -02 -00 -00 -00 -06 -00 -e1 -13 -01 -00 -02 -00 -00 -00 -06 -00 -e5 -13 -01 -00 -02 -00 -00 -00 -06 -00 -e9 -13 -01 -00 -02 -00 -00 -00 -06 -00 -ed -13 -01 -00 -02 -00 -00 -00 -06 -00 -f1 -13 -01 -00 -02 -00 -00 -00 -06 -00 -f5 -13 -01 -00 -02 -00 -00 -00 -06 -00 -f9 -13 -01 -00 -02 -00 -00 -00 -06 -00 -fd -13 -01 -00 -02 -00 -00 -00 -06 -00 -01 -14 -01 -00 -02 -00 -00 -00 -06 -00 -05 -14 -01 -00 -02 -00 -00 -00 -06 -00 -09 -14 -01 -00 -02 -00 -00 -00 -06 -00 -0d -14 -01 -00 -02 -00 -00 -00 -06 -00 -11 -14 -01 -00 -02 -00 -00 -00 -06 -00 -15 -14 -01 -00 -02 -00 -00 -00 -06 -00 -19 -14 -01 -00 -02 -00 -00 -00 -06 -00 -1d -14 -01 -00 -02 -00 -00 -00 -06 -00 -21 -14 -01 -00 -02 -00 -00 -00 -06 -00 -25 -14 -01 -00 -02 -00 -00 -00 -06 -00 -29 -14 -01 -00 -02 -00 -00 -00 -06 -00 -2d -14 -01 -00 -02 -00 -00 -00 -06 -00 -31 -14 -01 -00 -02 -00 -00 -00 -06 -00 -35 -14 -01 +00 00 02 00 @@ -90309,639 +86489,9 @@ fd 00 06 00 +20 39 -14 -01 -00 -02 -00 -00 -00 -06 -00 -3d -14 -01 -00 -02 -00 -00 -00 -06 -00 -41 -14 -01 -00 -02 -00 -00 -00 -06 -00 -45 -14 -01 -00 -02 -00 -00 -00 -06 -00 -49 -14 -01 -00 -02 -00 -00 -00 -06 -00 -4d -14 -01 -00 -02 -00 -00 -00 -06 -00 -51 -14 -01 -00 -02 -00 -00 -00 -06 -00 -55 -14 -01 -00 -02 -00 -00 -00 -06 -00 -59 -14 -01 -00 -02 -00 -00 -00 -06 -00 -5d -14 -01 -00 -02 -00 -00 -00 -06 -00 -61 -14 -01 -00 -02 -00 -00 -00 -06 -00 -65 -14 -01 -00 -02 -00 -00 -00 -06 -00 -69 -14 -01 -00 -02 -00 -00 -00 -06 -00 -6d -14 -01 -00 -02 -00 -00 -00 -06 -00 -71 -14 -01 -00 -02 -00 -00 -00 -06 -00 -75 -14 -01 -00 -02 -00 -00 -00 -06 -00 -79 -14 -01 -00 -02 -00 -00 -00 -06 -00 -7d -14 -01 -00 -02 -00 -00 -00 -06 -00 -81 -14 -01 -00 -02 -00 -00 -00 -06 -00 -85 -14 -01 -00 -02 -00 -00 -00 -06 -00 -89 -14 -01 -00 -02 -00 -00 -00 -06 -00 -8d -14 -01 -00 -02 -00 -00 -00 -06 -00 -91 -14 -01 -00 -02 -00 -00 -00 -06 -00 -95 -14 -01 -00 -02 -00 -00 -00 -06 -00 -99 -14 -01 -00 -02 -00 -00 -00 -06 -00 -9d -14 -01 -00 -02 -00 -00 -00 -06 -00 -a1 -14 -01 -00 -02 -00 -00 -00 -06 -00 -a5 -14 -01 -00 -02 -00 -00 -00 -06 -00 -a9 -14 -01 -00 -02 -00 -00 -00 -06 -00 -ad -14 -01 -00 -02 -00 -00 -00 -06 -00 -b1 -14 -01 -00 -02 -00 -00 -00 -06 -00 -b5 -14 -01 -00 -02 -00 -00 -00 -06 -00 -b9 -14 -01 -00 -02 -00 -00 -00 -06 -00 -bd -14 -01 -00 -02 -00 -00 -00 -06 -00 -c1 -14 -01 -00 -02 -00 -00 -00 -06 -00 -c5 -14 -01 -00 -02 -00 -00 -00 -06 -00 -c9 -14 -01 -00 -02 -00 -00 -00 -06 -00 -cd -14 -01 -00 -02 -00 -00 -00 -06 -00 -d1 -14 -01 -00 -02 -00 -00 -00 -06 -00 -d5 -14 -01 -00 -02 -00 -00 -00 -06 -00 -d9 -14 -01 -00 -02 -00 -00 -00 -06 -00 -dd -14 -01 -00 -02 -00 -00 -00 -06 -00 -e1 -14 -01 -00 -02 -00 -00 -00 -06 -00 -e5 -14 -01 -00 -02 -00 -00 -00 -06 -00 -e9 -14 -01 -00 -02 -00 -00 -00 -06 -00 -ed -14 -01 -00 -02 -00 -00 -00 -06 -00 -f1 -14 -01 -00 -02 -00 -00 -00 -06 -00 -f5 -14 -01 -00 -02 -00 -00 -00 -06 -00 -f9 -14 -01 -00 -02 -00 -00 -00 -06 -00 -fd -14 -01 -00 -02 -00 -00 -00 -06 -00 -01 -15 -01 -00 -02 -00 -00 -00 -06 -00 -05 -15 -01 -00 -02 -00 -00 -00 -06 -00 -09 -15 -01 -00 -02 -00 -00 -00 -06 -00 -0d -15 -01 -00 -02 -00 -00 -00 -06 -00 -11 -15 -01 -00 -02 -00 -00 -00 -06 -00 -15 -15 -01 -00 -02 -00 -00 -00 -06 -00 -19 -15 -01 -00 -02 -00 -00 -00 -06 -00 -1d -15 -01 -00 -02 -00 -00 -00 -06 -00 -21 -15 -01 -00 -02 -00 -00 -00 -06 -00 -25 -15 -01 -00 -02 -00 -00 -00 -06 -00 -29 -15 -01 -00 -02 -00 -00 -00 -06 -00 -2d -15 -01 -00 -02 -00 -00 -00 -06 -00 -31 -15 -01 -00 -02 -00 -00 -00 -06 -00 -35 -15 -01 +00 00 02 00 @@ -90949,639 +86499,9 @@ fd 00 06 00 +24 39 -15 -01 -00 -02 -00 -00 -00 -06 -00 -3d -15 -01 -00 -02 -00 -00 -00 -06 -00 -41 -15 -01 -00 -02 -00 -00 -00 -06 -00 -45 -15 -01 -00 -02 -00 -00 -00 -06 -00 -49 -15 -01 -00 -02 -00 -00 -00 -06 -00 -4d -15 -01 -00 -02 -00 -00 -00 -06 -00 -51 -15 -01 -00 -02 -00 -00 -00 -06 -00 -55 -15 -01 -00 -02 -00 -00 -00 -06 -00 -59 -15 -01 -00 -02 -00 -00 -00 -06 -00 -5d -15 -01 -00 -02 -00 -00 -00 -06 -00 -61 -15 -01 -00 -02 -00 -00 -00 -06 -00 -65 -15 -01 -00 -02 -00 -00 -00 -06 -00 -69 -15 -01 -00 -02 -00 -00 -00 -06 -00 -6d -15 -01 -00 -02 -00 -00 -00 -06 -00 -71 -15 -01 -00 -02 -00 -00 -00 -06 -00 -75 -15 -01 -00 -02 -00 -00 -00 -06 -00 -79 -15 -01 -00 -02 -00 -00 -00 -06 -00 -7d -15 -01 -00 -02 -00 -00 -00 -06 -00 -81 -15 -01 -00 -02 -00 -00 -00 -06 -00 -85 -15 -01 -00 -02 -00 -00 -00 -06 -00 -89 -15 -01 -00 -02 -00 -00 -00 -06 -00 -8d -15 -01 -00 -02 -00 -00 -00 -06 -00 -91 -15 -01 -00 -02 -00 -00 -00 -06 -00 -95 -15 -01 -00 -02 -00 -00 -00 -06 -00 -99 -15 -01 -00 -02 -00 -00 -00 -06 -00 -9d -15 -01 -00 -02 -00 -00 -00 -06 -00 -a1 -15 -01 -00 -02 -00 -00 -00 -06 -00 -a5 -15 -01 -00 -02 -00 -00 -00 -06 -00 -a9 -15 -01 -00 -02 -00 -00 -00 -06 -00 -ad -15 -01 -00 -02 -00 -00 -00 -06 -00 -b1 -15 -01 -00 -02 -00 -00 -00 -06 -00 -b5 -15 -01 -00 -02 -00 -00 -00 -06 -00 -b9 -15 -01 -00 -02 -00 -00 -00 -06 -00 -bd -15 -01 -00 -02 -00 -00 -00 -06 -00 -c1 -15 -01 -00 -02 -00 -00 -00 -06 -00 -c5 -15 -01 -00 -02 -00 -00 -00 -06 -00 -c9 -15 -01 -00 -02 -00 -00 -00 -06 -00 -cd -15 -01 -00 -02 -00 -00 -00 -06 -00 -d1 -15 -01 -00 -02 -00 -00 -00 -06 -00 -d5 -15 -01 -00 -02 -00 -00 -00 -06 -00 -d9 -15 -01 -00 -02 -00 -00 -00 -06 -00 -dd -15 -01 -00 -02 -00 -00 -00 -06 -00 -e1 -15 -01 -00 -02 -00 -00 -00 -06 -00 -e5 -15 -01 -00 -02 -00 -00 -00 -06 -00 -e9 -15 -01 -00 -02 -00 -00 -00 -06 -00 -ed -15 -01 -00 -02 -00 -00 -00 -06 -00 -f1 -15 -01 -00 -02 -00 -00 -00 -06 -00 -f5 -15 -01 -00 -02 -00 -00 -00 -06 -00 -f9 -15 -01 -00 -02 -00 -00 -00 -06 -00 -fd -15 -01 -00 -02 -00 -00 -00 -06 -00 -01 -16 -01 -00 -02 -00 -00 -00 -06 -00 -05 -16 -01 -00 -02 -00 -00 -00 -06 -00 -09 -16 -01 -00 -02 -00 -00 -00 -06 -00 -0d -16 -01 -00 -02 -00 -00 -00 -06 -00 -11 -16 -01 -00 -02 -00 -00 -00 -06 -00 -15 -16 -01 -00 -02 -00 -00 -00 -06 -00 -19 -16 -01 -00 -02 -00 -00 -00 -06 -00 -1d -16 -01 -00 -02 -00 -00 -00 -06 -00 -21 -16 -01 -00 -02 -00 -00 -00 -06 -00 -25 -16 -01 -00 -02 -00 -00 -00 -06 -00 -29 -16 -01 -00 -02 -00 -00 -00 -06 -00 -2d -16 -01 -00 -02 -00 -00 -00 -06 -00 -31 -16 -01 -00 -02 -00 -00 -00 -06 -00 -35 -16 -01 +00 00 02 00 @@ -91589,639 +86509,9 @@ fd 00 06 00 +28 39 -16 -01 -00 -02 -00 -00 -00 -06 -00 -3d -16 -01 -00 -02 -00 -00 -00 -06 -00 -41 -16 -01 -00 -02 -00 -00 -00 -06 -00 -45 -16 -01 -00 -02 -00 -00 -00 -06 -00 -49 -16 -01 -00 -02 -00 -00 -00 -06 -00 -4d -16 -01 -00 -02 -00 -00 -00 -06 -00 -51 -16 -01 -00 -02 -00 -00 -00 -06 -00 -55 -16 -01 -00 -02 -00 -00 -00 -06 -00 -59 -16 -01 -00 -02 -00 -00 -00 -06 -00 -5d -16 -01 -00 -02 -00 -00 -00 -06 -00 -61 -16 -01 -00 -02 -00 -00 -00 -06 -00 -65 -16 -01 -00 -02 -00 -00 -00 -06 -00 -69 -16 -01 -00 -02 -00 -00 -00 -06 -00 -6d -16 -01 -00 -02 -00 -00 -00 -06 -00 -71 -16 -01 -00 -02 -00 -00 -00 -06 -00 -75 -16 -01 -00 -02 -00 -00 -00 -06 -00 -79 -16 -01 -00 -02 -00 -00 -00 -06 -00 -7d -16 -01 -00 -02 -00 -00 -00 -06 -00 -81 -16 -01 -00 -02 -00 -00 -00 -06 -00 -85 -16 -01 -00 -02 -00 -00 -00 -06 -00 -89 -16 -01 -00 -02 -00 -00 -00 -06 -00 -8d -16 -01 -00 -02 -00 -00 -00 -06 -00 -91 -16 -01 -00 -02 -00 -00 -00 -06 -00 -95 -16 -01 -00 -02 -00 -00 -00 -06 -00 -99 -16 -01 -00 -02 -00 -00 -00 -06 -00 -9d -16 -01 -00 -02 -00 -00 -00 -06 -00 -a1 -16 -01 -00 -02 -00 -00 -00 -06 -00 -a5 -16 -01 -00 -02 -00 -00 -00 -06 -00 -a9 -16 -01 -00 -02 -00 -00 -00 -06 -00 -ad -16 -01 -00 -02 -00 -00 -00 -06 -00 -b1 -16 -01 -00 -02 -00 -00 -00 -06 -00 -b5 -16 -01 -00 -02 -00 -00 -00 -06 -00 -b9 -16 -01 -00 -02 -00 -00 -00 -06 -00 -bd -16 -01 -00 -02 -00 -00 -00 -06 -00 -c1 -16 -01 -00 -02 -00 -00 -00 -06 -00 -c5 -16 -01 -00 -02 -00 -00 -00 -06 -00 -c9 -16 -01 -00 -02 -00 -00 -00 -06 -00 -cd -16 -01 -00 -02 -00 -00 -00 -06 -00 -d1 -16 -01 -00 -02 -00 -00 -00 -06 -00 -d5 -16 -01 -00 -02 -00 -00 -00 -06 -00 -d9 -16 -01 -00 -02 -00 -00 -00 -06 -00 -dd -16 -01 -00 -02 -00 -00 -00 -06 -00 -e1 -16 -01 -00 -02 -00 -00 -00 -06 -00 -e5 -16 -01 -00 -02 -00 -00 -00 -06 -00 -e9 -16 -01 -00 -02 -00 -00 -00 -06 -00 -ed -16 -01 -00 -02 -00 -00 -00 -06 -00 -f1 -16 -01 -00 -02 -00 -00 -00 -06 -00 -f5 -16 -01 -00 -02 -00 -00 -00 -06 -00 -f9 -16 -01 -00 -02 -00 -00 -00 -06 -00 -fd -16 -01 -00 -02 -00 -00 -00 -06 -00 -01 -17 -01 -00 -02 -00 -00 -00 -06 -00 -05 -17 -01 -00 -02 -00 -00 -00 -06 -00 -09 -17 -01 -00 -02 -00 -00 -00 -06 -00 -0d -17 -01 -00 -02 -00 -00 -00 -06 -00 -11 -17 -01 -00 -02 -00 -00 -00 -06 -00 -15 -17 -01 -00 -02 -00 -00 -00 -06 -00 -19 -17 -01 -00 -02 -00 -00 -00 -06 -00 -1d -17 -01 -00 -02 -00 -00 -00 -06 -00 -21 -17 -01 -00 -02 -00 -00 -00 -06 -00 -25 -17 -01 -00 -02 -00 -00 -00 -06 -00 -29 -17 -01 -00 -02 -00 -00 -00 -06 -00 -2d -17 -01 -00 -02 -00 -00 -00 -06 -00 -31 -17 -01 -00 -02 -00 -00 -00 -06 -00 -35 -17 -01 +00 00 02 00 @@ -92229,639 +86519,9 @@ fd 00 06 00 +2c 39 -17 -01 -00 -02 -00 -00 -00 -06 -00 -3d -17 -01 -00 -02 -00 -00 -00 -06 -00 -41 -17 -01 -00 -02 -00 -00 -00 -06 -00 -45 -17 -01 -00 -02 -00 -00 -00 -06 -00 -49 -17 -01 -00 -02 -00 -00 -00 -06 -00 -4d -17 -01 -00 -02 -00 -00 -00 -06 -00 -51 -17 -01 -00 -02 -00 -00 -00 -06 -00 -55 -17 -01 -00 -02 -00 -00 -00 -06 -00 -59 -17 -01 -00 -02 -00 -00 -00 -06 -00 -5d -17 -01 -00 -02 -00 -00 -00 -06 -00 -61 -17 -01 -00 -02 -00 -00 -00 -06 -00 -65 -17 -01 -00 -02 -00 -00 -00 -06 -00 -69 -17 -01 -00 -02 -00 -00 -00 -06 -00 -6d -17 -01 -00 -02 -00 -00 -00 -06 -00 -71 -17 -01 -00 -02 -00 -00 -00 -06 -00 -75 -17 -01 -00 -02 -00 -00 -00 -06 -00 -79 -17 -01 -00 -02 -00 -00 -00 -06 -00 -7d -17 -01 -00 -02 -00 -00 -00 -06 -00 -81 -17 -01 -00 -02 -00 -00 -00 -06 -00 -85 -17 -01 -00 -02 -00 -00 -00 -06 -00 -89 -17 -01 -00 -02 -00 -00 -00 -06 -00 -8d -17 -01 -00 -02 -00 -00 -00 -06 -00 -91 -17 -01 -00 -02 -00 -00 -00 -06 -00 -95 -17 -01 -00 -02 -00 -00 -00 -06 -00 -99 -17 -01 -00 -02 -00 -00 -00 -06 -00 -9d -17 -01 -00 -02 -00 -00 -00 -06 -00 -a1 -17 -01 -00 -02 -00 -00 -00 -06 -00 -a5 -17 -01 -00 -02 -00 -00 -00 -06 -00 -a9 -17 -01 -00 -02 -00 -00 -00 -06 -00 -ad -17 -01 -00 -02 -00 -00 -00 -06 -00 -b1 -17 -01 -00 -02 -00 -00 -00 -06 -00 -b5 -17 -01 -00 -02 -00 -00 -00 -06 -00 -b9 -17 -01 -00 -02 -00 -00 -00 -06 -00 -bd -17 -01 -00 -02 -00 -00 -00 -06 -00 -c1 -17 -01 -00 -02 -00 -00 -00 -06 -00 -c5 -17 -01 -00 -02 -00 -00 -00 -06 -00 -c9 -17 -01 -00 -02 -00 -00 -00 -06 -00 -cd -17 -01 -00 -02 -00 -00 -00 -06 -00 -d1 -17 -01 -00 -02 -00 -00 -00 -06 -00 -d5 -17 -01 -00 -02 -00 -00 -00 -06 -00 -d9 -17 -01 -00 -02 -00 -00 -00 -06 -00 -dd -17 -01 -00 -02 -00 -00 -00 -06 -00 -e1 -17 -01 -00 -02 -00 -00 -00 -06 -00 -e5 -17 -01 -00 -02 -00 -00 -00 -06 -00 -e9 -17 -01 -00 -02 -00 -00 -00 -06 -00 -ed -17 -01 -00 -02 -00 -00 -00 -06 -00 -f1 -17 -01 -00 -02 -00 -00 -00 -06 -00 -f5 -17 -01 -00 -02 -00 -00 -00 -06 -00 -f9 -17 -01 -00 -02 -00 -00 -00 -06 -00 -fd -17 -01 -00 -02 -00 -00 -00 -06 -00 -01 -18 -01 -00 -02 -00 -00 -00 -06 -00 -05 -18 -01 -00 -02 -00 -00 -00 -06 -00 -09 -18 -01 -00 -02 -00 -00 -00 -06 -00 -0d -18 -01 -00 -02 -00 -00 -00 -06 -00 -11 -18 -01 -00 -02 -00 -00 -00 -06 -00 -15 -18 -01 -00 -02 -00 -00 -00 -06 -00 -19 -18 -01 -00 -02 -00 -00 -00 -06 -00 -1d -18 -01 -00 -02 -00 -00 -00 -06 -00 -21 -18 -01 -00 -02 -00 -00 -00 -06 -00 -25 -18 -01 -00 -02 -00 -00 -00 -06 -00 -29 -18 -01 -00 -02 -00 -00 -00 -06 -00 -2d -18 -01 -00 -02 -00 -00 -00 -06 -00 -31 -18 -01 -00 -02 -00 -00 -00 -06 -00 -35 -18 -01 +00 00 02 00 @@ -92869,639 +86529,9 @@ fd 00 06 00 +30 39 -18 -01 -00 -02 -00 -00 -00 -06 -00 -3d -18 -01 -00 -02 -00 -00 -00 -06 -00 -41 -18 -01 -00 -02 -00 -00 -00 -06 -00 -45 -18 -01 -00 -02 -00 -00 -00 -06 -00 -49 -18 -01 -00 -02 -00 -00 -00 -06 -00 -4d -18 -01 -00 -02 -00 -00 -00 -06 -00 -51 -18 -01 -00 -02 -00 -00 -00 -06 -00 -55 -18 -01 -00 -02 -00 -00 -00 -06 -00 -59 -18 -01 -00 -02 -00 -00 -00 -06 -00 -5d -18 -01 -00 -02 -00 -00 -00 -06 -00 -61 -18 -01 -00 -02 -00 -00 -00 -06 -00 -65 -18 -01 -00 -02 -00 -00 -00 -06 -00 -69 -18 -01 -00 -02 -00 -00 -00 -06 -00 -6d -18 -01 -00 -02 -00 -00 -00 -06 -00 -71 -18 -01 -00 -02 -00 -00 -00 -06 -00 -75 -18 -01 -00 -02 -00 -00 -00 -06 -00 -79 -18 -01 -00 -02 -00 -00 -00 -06 -00 -7d -18 -01 -00 -02 -00 -00 -00 -06 -00 -81 -18 -01 -00 -02 -00 -00 -00 -06 -00 -85 -18 -01 -00 -02 -00 -00 -00 -06 -00 -89 -18 -01 -00 -02 -00 -00 -00 -06 -00 -8d -18 -01 -00 -02 -00 -00 -00 -06 -00 -91 -18 -01 -00 -02 -00 -00 -00 -06 -00 -95 -18 -01 -00 -02 -00 -00 -00 -06 -00 -99 -18 -01 -00 -02 -00 -00 -00 -06 -00 -9d -18 -01 -00 -02 -00 -00 -00 -06 -00 -a1 -18 -01 -00 -02 -00 -00 -00 -06 -00 -a5 -18 -01 -00 -02 -00 -00 -00 -06 -00 -a9 -18 -01 -00 -02 -00 -00 -00 -06 -00 -ad -18 -01 -00 -02 -00 -00 -00 -06 -00 -b1 -18 -01 -00 -02 -00 -00 -00 -06 -00 -b5 -18 -01 -00 -02 -00 -00 -00 -06 -00 -b9 -18 -01 -00 -02 -00 -00 -00 -06 -00 -bd -18 -01 -00 -02 -00 -00 -00 -06 -00 -c1 -18 -01 -00 -02 -00 -00 -00 -06 -00 -c5 -18 -01 -00 -02 -00 -00 -00 -06 -00 -c9 -18 -01 -00 -02 -00 -00 -00 -06 -00 -cd -18 -01 -00 -02 -00 -00 -00 -06 -00 -d1 -18 -01 -00 -02 -00 -00 -00 -06 -00 -d5 -18 -01 -00 -02 -00 -00 -00 -06 -00 -d9 -18 -01 -00 -02 -00 -00 -00 -06 -00 -dd -18 -01 -00 -02 -00 -00 -00 -06 -00 -e1 -18 -01 -00 -02 -00 -00 -00 -06 -00 -e5 -18 -01 -00 -02 -00 -00 -00 -06 -00 -e9 -18 -01 -00 -02 -00 -00 -00 -06 -00 -ed -18 -01 -00 -02 -00 -00 -00 -06 -00 -f1 -18 -01 -00 -02 -00 -00 -00 -06 -00 -f5 -18 -01 -00 -02 -00 -00 -00 -06 -00 -f9 -18 -01 -00 -02 -00 -00 -00 -06 -00 -fd -18 -01 -00 -02 -00 -00 -00 -06 -00 -01 -19 -01 -00 -02 -00 -00 -00 -06 -00 -05 -19 -01 -00 -02 -00 -00 -00 -06 -00 -09 -19 -01 -00 -02 -00 -00 -00 -06 -00 -0d -19 -01 -00 -02 -00 -00 -00 -06 -00 -11 -19 -01 -00 -02 -00 -00 -00 -06 -00 -15 -19 -01 -00 -02 -00 -00 -00 -06 -00 -19 -19 -01 -00 -02 -00 -00 -00 -06 -00 -1d -19 -01 -00 -02 -00 -00 -00 -06 -00 -21 -19 -01 -00 -02 -00 -00 -00 -06 -00 -25 -19 -01 -00 -02 -00 -00 -00 -06 -00 -29 -19 -01 -00 -02 -00 -00 -00 -06 -00 -2d -19 -01 -00 -02 -00 -00 -00 -06 -00 -31 -19 -01 -00 -02 -00 -00 -00 -06 -00 -35 -19 -01 +00 00 02 00 @@ -93509,639 +86539,9 @@ fd 00 06 00 +34 39 -19 -01 -00 -02 -00 -00 -00 -06 -00 -3d -19 -01 -00 -02 -00 -00 -00 -06 -00 -41 -19 -01 -00 -02 -00 -00 -00 -06 -00 -45 -19 -01 -00 -02 -00 -00 -00 -06 -00 -49 -19 -01 -00 -02 -00 -00 -00 -06 -00 -4d -19 -01 -00 -02 -00 -00 -00 -06 -00 -51 -19 -01 -00 -02 -00 -00 -00 -06 -00 -55 -19 -01 -00 -02 -00 -00 -00 -06 -00 -59 -19 -01 -00 -02 -00 -00 -00 -06 -00 -5d -19 -01 -00 -02 -00 -00 -00 -06 -00 -61 -19 -01 -00 -02 -00 -00 -00 -06 -00 -65 -19 -01 -00 -02 -00 -00 -00 -06 -00 -69 -19 -01 -00 -02 -00 -00 -00 -06 -00 -6d -19 -01 -00 -02 -00 -00 -00 -06 -00 -71 -19 -01 -00 -02 -00 -00 -00 -06 -00 -75 -19 -01 -00 -02 -00 -00 -00 -06 -00 -79 -19 -01 -00 -02 -00 -00 -00 -06 -00 -7d -19 -01 -00 -02 -00 -00 -00 -06 -00 -81 -19 -01 -00 -02 -00 -00 -00 -06 -00 -85 -19 -01 -00 -02 -00 -00 -00 -06 -00 -89 -19 -01 -00 -02 -00 -00 -00 -06 -00 -8d -19 -01 -00 -02 -00 -00 -00 -06 -00 -91 -19 -01 -00 -02 -00 -00 -00 -06 -00 -95 -19 -01 -00 -02 -00 -00 -00 -06 -00 -99 -19 -01 -00 -02 -00 -00 -00 -06 -00 -9d -19 -01 -00 -02 -00 -00 -00 -06 -00 -a1 -19 -01 -00 -02 -00 -00 -00 -06 -00 -a5 -19 -01 -00 -02 -00 -00 -00 -06 -00 -a9 -19 -01 -00 -02 -00 -00 -00 -06 -00 -ad -19 -01 -00 -02 -00 -00 -00 -06 -00 -b1 -19 -01 -00 -02 -00 -00 -00 -06 -00 -b5 -19 -01 -00 -02 -00 -00 -00 -06 -00 -b9 -19 -01 -00 -02 -00 -00 -00 -06 -00 -bd -19 -01 -00 -02 -00 -00 -00 -06 -00 -c1 -19 -01 -00 -02 -00 -00 -00 -06 -00 -c5 -19 -01 -00 -02 -00 -00 -00 -06 -00 -c9 -19 -01 -00 -02 -00 -00 -00 -06 -00 -cd -19 -01 -00 -02 -00 -00 -00 -06 -00 -d1 -19 -01 -00 -02 -00 -00 -00 -06 -00 -d5 -19 -01 -00 -02 -00 -00 -00 -06 -00 -d9 -19 -01 -00 -02 -00 -00 -00 -06 -00 -dd -19 -01 -00 -02 -00 -00 -00 -06 -00 -e1 -19 -01 -00 -02 -00 -00 -00 -06 -00 -e5 -19 -01 -00 -02 -00 -00 -00 -06 -00 -e9 -19 -01 -00 -02 -00 -00 -00 -06 -00 -ed -19 -01 -00 -02 -00 -00 -00 -06 -00 -f1 -19 -01 -00 -02 -00 -00 -00 -06 -00 -f5 -19 -01 -00 -02 -00 -00 -00 -06 -00 -f9 -19 -01 -00 -02 -00 -00 -00 -06 -00 -fd -19 -01 -00 -02 -00 -00 -00 -06 -00 -01 -1a -01 -00 -02 -00 -00 -00 -06 -00 -05 -1a -01 -00 -02 -00 -00 -00 -06 -00 -09 -1a -01 -00 -02 -00 -00 -00 -06 -00 -0d -1a -01 -00 -02 -00 -00 -00 -06 -00 -11 -1a -01 -00 -02 -00 -00 -00 -06 -00 -15 -1a -01 -00 -02 -00 -00 -00 -06 -00 -19 -1a -01 -00 -02 -00 -00 -00 -06 -00 -1d -1a -01 -00 -02 -00 -00 -00 -06 -00 -21 -1a -01 -00 -02 -00 -00 -00 -06 -00 -25 -1a -01 -00 -02 -00 -00 -00 -06 -00 -29 -1a -01 -00 -02 -00 -00 -00 -06 -00 -2d -1a -01 -00 -02 -00 -00 -00 -06 -00 -31 -1a -01 -00 -02 -00 -00 -00 -06 -00 -35 -1a -01 +00 00 02 00 @@ -94149,639 +86549,9 @@ fd 00 06 00 +38 39 -1a -01 -00 -02 -00 -00 -00 -06 -00 -3d -1a -01 -00 -02 -00 -00 -00 -06 -00 -41 -1a -01 -00 -02 -00 -00 -00 -06 -00 -45 -1a -01 -00 -02 -00 -00 -00 -06 -00 -49 -1a -01 -00 -02 -00 -00 -00 -06 -00 -4d -1a -01 -00 -02 -00 -00 -00 -06 -00 -51 -1a -01 -00 -02 -00 -00 -00 -06 -00 -55 -1a -01 -00 -02 -00 -00 -00 -06 -00 -59 -1a -01 -00 -02 -00 -00 -00 -06 -00 -5d -1a -01 -00 -02 -00 -00 -00 -06 -00 -61 -1a -01 -00 -02 -00 -00 -00 -06 -00 -65 -1a -01 -00 -02 -00 -00 -00 -06 -00 -69 -1a -01 -00 -02 -00 -00 -00 -06 -00 -6d -1a -01 -00 -02 -00 -00 -00 -06 -00 -71 -1a -01 -00 -02 -00 -00 -00 -06 -00 -75 -1a -01 -00 -02 -00 -00 -00 -06 -00 -79 -1a -01 -00 -02 -00 -00 -00 -06 -00 -7d -1a -01 -00 -02 -00 -00 -00 -06 -00 -81 -1a -01 -00 -02 -00 -00 -00 -06 -00 -85 -1a -01 -00 -02 -00 -00 -00 -06 -00 -89 -1a -01 -00 -02 -00 -00 -00 -06 -00 -8d -1a -01 -00 -02 -00 -00 -00 -06 -00 -91 -1a -01 -00 -02 -00 -00 -00 -06 -00 -95 -1a -01 -00 -02 -00 -00 -00 -06 -00 -99 -1a -01 -00 -02 -00 -00 -00 -06 -00 -9d -1a -01 -00 -02 -00 -00 -00 -06 -00 -a1 -1a -01 -00 -02 -00 -00 -00 -06 -00 -a5 -1a -01 -00 -02 -00 -00 -00 -06 -00 -a9 -1a -01 -00 -02 -00 -00 -00 -06 -00 -ad -1a -01 -00 -02 -00 -00 -00 -06 -00 -b1 -1a -01 -00 -02 -00 -00 -00 -06 -00 -b5 -1a -01 -00 -02 -00 -00 -00 -06 -00 -b9 -1a -01 -00 -02 -00 -00 -00 -06 -00 -bd -1a -01 -00 -02 -00 -00 -00 -06 -00 -c1 -1a -01 -00 -02 -00 -00 -00 -06 -00 -c5 -1a -01 -00 -02 -00 -00 -00 -06 -00 -c9 -1a -01 -00 -02 -00 -00 -00 -06 -00 -cd -1a -01 -00 -02 -00 -00 -00 -06 -00 -d1 -1a -01 -00 -02 -00 -00 -00 -06 -00 -d5 -1a -01 -00 -02 -00 -00 -00 -06 -00 -d9 -1a -01 -00 -02 -00 -00 -00 -06 -00 -dd -1a -01 -00 -02 -00 -00 -00 -06 -00 -e1 -1a -01 -00 -02 -00 -00 -00 -06 -00 -e5 -1a -01 -00 -02 -00 -00 -00 -06 -00 -e9 -1a -01 -00 -02 -00 -00 -00 -06 -00 -ed -1a -01 -00 -02 -00 -00 -00 -06 -00 -f1 -1a -01 -00 -02 -00 -00 -00 -06 -00 -f5 -1a -01 -00 -02 -00 -00 -00 -06 -00 -f9 -1a -01 -00 -02 -00 -00 -00 -06 -00 -fd -1a -01 -00 -02 -00 -00 -00 -06 -00 -01 -1b -01 -00 -02 -00 -00 -00 -06 -00 -05 -1b -01 -00 -02 -00 -00 -00 -06 -00 -09 -1b -01 -00 -02 -00 -00 -00 -06 -00 -0d -1b -01 -00 -02 -00 -00 -00 -06 -00 -11 -1b -01 -00 -02 -00 -00 -00 -06 -00 -15 -1b -01 -00 -02 -00 -00 -00 -06 -00 -19 -1b -01 -00 -02 -00 -00 -00 -06 -00 -1d -1b -01 -00 -02 -00 -00 -00 -06 -00 -21 -1b -01 -00 -02 -00 -00 -00 -06 -00 -25 -1b -01 -00 -02 -00 -00 -00 -06 -00 -29 -1b -01 -00 -02 -00 -00 -00 -06 -00 -2d -1b -01 -00 -02 -00 -00 -00 -06 -00 -31 -1b -01 -00 -02 -00 -00 -00 -06 -00 -35 -1b -01 +00 00 02 00 @@ -94789,639 +86559,9 @@ fd 00 06 00 +3c 39 -1b -01 -00 -02 -00 -00 -00 -06 -00 -3d -1b -01 -00 -02 -00 -00 -00 -06 -00 -41 -1b -01 -00 -02 -00 -00 -00 -06 -00 -45 -1b -01 -00 -02 -00 -00 -00 -06 -00 -49 -1b -01 -00 -02 -00 -00 -00 -06 -00 -4d -1b -01 -00 -02 -00 -00 -00 -06 -00 -51 -1b -01 -00 -02 -00 -00 -00 -06 -00 -55 -1b -01 -00 -02 -00 -00 -00 -06 -00 -59 -1b -01 -00 -02 -00 -00 -00 -06 -00 -5d -1b -01 -00 -02 -00 -00 -00 -06 -00 -61 -1b -01 -00 -02 -00 -00 -00 -06 -00 -65 -1b -01 -00 -02 -00 -00 -00 -06 -00 -69 -1b -01 -00 -02 -00 -00 -00 -06 -00 -6d -1b -01 -00 -02 -00 -00 -00 -06 -00 -71 -1b -01 -00 -02 -00 -00 -00 -06 -00 -75 -1b -01 -00 -02 -00 -00 -00 -06 -00 -79 -1b -01 -00 -02 -00 -00 -00 -06 -00 -7d -1b -01 -00 -02 -00 -00 -00 -06 -00 -81 -1b -01 -00 -02 -00 -00 -00 -06 -00 -85 -1b -01 -00 -02 -00 -00 -00 -06 -00 -89 -1b -01 -00 -02 -00 -00 -00 -06 -00 -8d -1b -01 -00 -02 -00 -00 -00 -06 -00 -91 -1b -01 -00 -02 -00 -00 -00 -06 -00 -95 -1b -01 -00 -02 -00 -00 -00 -06 -00 -99 -1b -01 -00 -02 -00 -00 -00 -06 -00 -9d -1b -01 -00 -02 -00 -00 -00 -06 -00 -a1 -1b -01 -00 -02 -00 -00 -00 -06 -00 -a5 -1b -01 -00 -02 -00 -00 -00 -06 -00 -a9 -1b -01 -00 -02 -00 -00 -00 -06 -00 -ad -1b -01 -00 -02 -00 -00 -00 -06 -00 -b1 -1b -01 -00 -02 -00 -00 -00 -06 -00 -b5 -1b -01 -00 -02 -00 -00 -00 -06 -00 -b9 -1b -01 -00 -02 -00 -00 -00 -06 -00 -bd -1b -01 -00 -02 -00 -00 -00 -06 -00 -c1 -1b -01 -00 -02 -00 -00 -00 -06 -00 -c5 -1b -01 -00 -02 -00 -00 -00 -06 -00 -c9 -1b -01 -00 -02 -00 -00 -00 -06 -00 -cd -1b -01 -00 -02 -00 -00 -00 -06 -00 -d1 -1b -01 -00 -02 -00 -00 -00 -06 -00 -d5 -1b -01 -00 -02 -00 -00 -00 -06 -00 -d9 -1b -01 -00 -02 -00 -00 -00 -06 -00 -dd -1b -01 -00 -02 -00 -00 -00 -06 -00 -e1 -1b -01 -00 -02 -00 -00 -00 -06 -00 -e5 -1b -01 -00 -02 -00 -00 -00 -06 -00 -e9 -1b -01 -00 -02 -00 -00 -00 -06 -00 -ed -1b -01 -00 -02 -00 -00 -00 -06 -00 -f1 -1b -01 -00 -02 -00 -00 -00 -06 -00 -f5 -1b -01 -00 -02 -00 -00 -00 -06 -00 -f9 -1b -01 -00 -02 -00 -00 -00 -06 -00 -fd -1b -01 -00 -02 -00 -00 -00 -06 -00 -01 -1c -01 -00 -02 -00 -00 -00 -06 -00 -05 -1c -01 -00 -02 -00 -00 -00 -06 -00 -09 -1c -01 -00 -02 -00 -00 -00 -06 -00 -0d -1c -01 -00 -02 -00 -00 -00 -06 -00 -11 -1c -01 -00 -02 -00 -00 -00 -06 -00 -15 -1c -01 -00 -02 -00 -00 -00 -06 -00 -19 -1c -01 -00 -02 -00 -00 -00 -06 -00 -1d -1c -01 -00 -02 -00 -00 -00 -06 -00 -21 -1c -01 -00 -02 -00 -00 -00 -06 -00 -25 -1c -01 -00 -02 -00 -00 -00 -06 -00 -29 -1c -01 -00 -02 -00 -00 -00 -06 -00 -2d -1c -01 -00 -02 -00 -00 -00 -06 -00 -31 -1c -01 -00 -02 -00 -00 -00 -06 -00 -35 -1c -01 +00 00 02 00 @@ -95429,639 +86569,9 @@ fd 00 06 00 +40 39 -1c -01 -00 -02 -00 -00 -00 -06 -00 -3d -1c -01 -00 -02 -00 -00 -00 -06 -00 -41 -1c -01 -00 -02 -00 -00 -00 -06 -00 -45 -1c -01 -00 -02 -00 -00 -00 -06 -00 -49 -1c -01 -00 -02 -00 -00 -00 -06 -00 -4d -1c -01 -00 -02 -00 -00 -00 -06 -00 -51 -1c -01 -00 -02 -00 -00 -00 -06 -00 -55 -1c -01 -00 -02 -00 -00 -00 -06 -00 -59 -1c -01 -00 -02 -00 -00 -00 -06 -00 -5d -1c -01 -00 -02 -00 -00 -00 -06 -00 -61 -1c -01 -00 -02 -00 -00 -00 -06 -00 -65 -1c -01 -00 -02 -00 -00 -00 -06 -00 -69 -1c -01 -00 -02 -00 -00 -00 -06 -00 -6d -1c -01 -00 -02 -00 -00 -00 -06 -00 -71 -1c -01 -00 -02 -00 -00 -00 -06 -00 -75 -1c -01 -00 -02 -00 -00 -00 -06 -00 -79 -1c -01 -00 -02 -00 -00 -00 -06 -00 -7d -1c -01 -00 -02 -00 -00 -00 -06 -00 -81 -1c -01 -00 -02 -00 -00 -00 -06 -00 -85 -1c -01 -00 -02 -00 -00 -00 -06 -00 -89 -1c -01 -00 -02 -00 -00 -00 -06 -00 -8d -1c -01 -00 -02 -00 -00 -00 -06 -00 -91 -1c -01 -00 -02 -00 -00 -00 -06 -00 -95 -1c -01 -00 -02 -00 -00 -00 -06 -00 -99 -1c -01 -00 -02 -00 -00 -00 -06 -00 -9d -1c -01 -00 -02 -00 -00 -00 -06 -00 -a1 -1c -01 -00 -02 -00 -00 -00 -06 -00 -a5 -1c -01 -00 -02 -00 -00 -00 -06 -00 -a9 -1c -01 -00 -02 -00 -00 -00 -06 -00 -ad -1c -01 -00 -02 -00 -00 -00 -06 -00 -b1 -1c -01 -00 -02 -00 -00 -00 -06 -00 -b5 -1c -01 -00 -02 -00 -00 -00 -06 -00 -b9 -1c -01 -00 -02 -00 -00 -00 -06 -00 -bd -1c -01 -00 -02 -00 -00 -00 -06 -00 -c1 -1c -01 -00 -02 -00 -00 -00 -06 -00 -c5 -1c -01 -00 -02 -00 -00 -00 -06 -00 -c9 -1c -01 -00 -02 -00 -00 -00 -06 -00 -cd -1c -01 -00 -02 -00 -00 -00 -06 -00 -d1 -1c -01 -00 -02 -00 -00 -00 -06 -00 -d5 -1c -01 -00 -02 -00 -00 -00 -06 -00 -d9 -1c -01 -00 -02 -00 -00 -00 -06 -00 -dd -1c -01 -00 -02 -00 -00 -00 -06 -00 -e1 -1c -01 -00 -02 -00 -00 -00 -06 -00 -e5 -1c -01 -00 -02 -00 -00 -00 -06 -00 -e9 -1c -01 -00 -02 -00 -00 -00 -06 -00 -ed -1c -01 -00 -02 -00 -00 -00 -06 -00 -f1 -1c -01 -00 -02 -00 -00 -00 -06 -00 -f5 -1c -01 -00 -02 -00 -00 -00 -06 -00 -f9 -1c -01 -00 -02 -00 -00 -00 -06 -00 -fd -1c -01 -00 -02 -00 -00 -00 -06 -00 -01 -1d -01 -00 -02 -00 -00 -00 -06 -00 -05 -1d -01 -00 -02 -00 -00 -00 -06 -00 -09 -1d -01 -00 -02 -00 -00 -00 -06 -00 -0d -1d -01 -00 -02 -00 -00 -00 -06 -00 -11 -1d -01 -00 -02 -00 -00 -00 -06 -00 -15 -1d -01 -00 -02 -00 -00 -00 -06 -00 -19 -1d -01 -00 -02 -00 -00 -00 -06 -00 -1d -1d -01 -00 -02 -00 -00 -00 -06 -00 -21 -1d -01 -00 -02 -00 -00 -00 -06 -00 -25 -1d -01 -00 -02 -00 -00 -00 -06 -00 -29 -1d -01 -00 -02 -00 -00 -00 -06 -00 -2d -1d -01 -00 -02 -00 -00 -00 -06 -00 -31 -1d -01 -00 -02 -00 -00 -00 -06 -00 -35 -1d -01 +00 00 02 00 @@ -96069,639 +86579,9 @@ fd 00 06 00 +44 39 -1d -01 -00 -02 -00 -00 -00 -06 -00 -3d -1d -01 -00 -02 -00 -00 -00 -06 -00 -41 -1d -01 -00 -02 -00 -00 -00 -06 -00 -45 -1d -01 -00 -02 -00 -00 -00 -06 -00 -49 -1d -01 -00 -02 -00 -00 -00 -06 -00 -4d -1d -01 -00 -02 -00 -00 -00 -06 -00 -51 -1d -01 -00 -02 -00 -00 -00 -06 -00 -55 -1d -01 -00 -02 -00 -00 -00 -06 -00 -59 -1d -01 -00 -02 -00 -00 -00 -06 -00 -5d -1d -01 -00 -02 -00 -00 -00 -06 -00 -61 -1d -01 -00 -02 -00 -00 -00 -06 -00 -65 -1d -01 -00 -02 -00 -00 -00 -06 -00 -69 -1d -01 -00 -02 -00 -00 -00 -06 -00 -6d -1d -01 -00 -02 -00 -00 -00 -06 -00 -71 -1d -01 -00 -02 -00 -00 -00 -06 -00 -75 -1d -01 -00 -02 -00 -00 -00 -06 -00 -79 -1d -01 -00 -02 -00 -00 -00 -06 -00 -7d -1d -01 -00 -02 -00 -00 -00 -06 -00 -81 -1d -01 -00 -02 -00 -00 -00 -06 -00 -85 -1d -01 -00 -02 -00 -00 -00 -06 -00 -89 -1d -01 -00 -02 -00 -00 -00 -06 -00 -8d -1d -01 -00 -02 -00 -00 -00 -06 -00 -91 -1d -01 -00 -02 -00 -00 -00 -06 -00 -95 -1d -01 -00 -02 -00 -00 -00 -06 -00 -99 -1d -01 -00 -02 -00 -00 -00 -06 -00 -9d -1d -01 -00 -02 -00 -00 -00 -06 -00 -a1 -1d -01 -00 -02 -00 -00 -00 -06 -00 -a5 -1d -01 -00 -02 -00 -00 -00 -06 -00 -a9 -1d -01 -00 -02 -00 -00 -00 -06 -00 -ad -1d -01 -00 -02 -00 -00 -00 -06 -00 -b1 -1d -01 -00 -02 -00 -00 -00 -06 -00 -b5 -1d -01 -00 -02 -00 -00 -00 -06 -00 -b9 -1d -01 -00 -02 -00 -00 -00 -06 -00 -bd -1d -01 -00 -02 -00 -00 -00 -06 -00 -c1 -1d -01 -00 -02 -00 -00 -00 -06 -00 -c5 -1d -01 -00 -02 -00 -00 -00 -06 -00 -c9 -1d -01 -00 -02 -00 -00 -00 -06 -00 -cd -1d -01 -00 -02 -00 -00 -00 -06 -00 -d1 -1d -01 -00 -02 -00 -00 -00 -06 -00 -d5 -1d -01 -00 -02 -00 -00 -00 -06 -00 -d9 -1d -01 -00 -02 -00 -00 -00 -06 -00 -dd -1d -01 -00 -02 -00 -00 -00 -06 -00 -e1 -1d -01 -00 -02 -00 -00 -00 -06 -00 -e5 -1d -01 -00 -02 -00 -00 -00 -06 -00 -e9 -1d -01 -00 -02 -00 -00 -00 -06 -00 -ed -1d -01 -00 -02 -00 -00 -00 -06 -00 -f1 -1d -01 -00 -02 -00 -00 -00 -06 -00 -f5 -1d -01 -00 -02 -00 -00 -00 -06 -00 -f9 -1d -01 -00 -02 -00 -00 -00 -06 -00 -fd -1d -01 -00 -02 -00 -00 -00 -06 -00 -01 -1e -01 -00 -02 -00 -00 -00 -06 -00 -05 -1e -01 -00 -02 -00 -00 -00 -06 -00 -09 -1e -01 -00 -02 -00 -00 -00 -06 -00 -0d -1e -01 -00 -02 -00 -00 -00 -06 -00 -11 -1e -01 -00 -02 -00 -00 -00 -06 -00 -15 -1e -01 -00 -02 -00 -00 -00 -06 -00 -19 -1e -01 -00 -02 -00 -00 -00 -06 -00 -1d -1e -01 -00 -02 -00 -00 -00 -06 -00 -21 -1e -01 -00 -02 -00 -00 -00 -06 -00 -25 -1e -01 -00 -02 -00 -00 -00 -06 -00 -29 -1e -01 -00 -02 -00 -00 -00 -06 -00 -2d -1e -01 -00 -02 -00 -00 -00 -06 -00 -31 -1e -01 -00 -02 -00 -00 -00 -06 -00 -35 -1e -01 +00 00 02 00 @@ -96709,639 +86589,9 @@ fd 00 06 00 +48 39 -1e -01 -00 -02 -00 -00 -00 -06 -00 -3d -1e -01 -00 -02 -00 -00 -00 -06 -00 -41 -1e -01 -00 -02 -00 -00 -00 -06 -00 -45 -1e -01 -00 -02 -00 -00 -00 -06 -00 -49 -1e -01 -00 -02 -00 -00 -00 -06 -00 -4d -1e -01 -00 -02 -00 -00 -00 -06 -00 -51 -1e -01 -00 -02 -00 -00 -00 -06 -00 -55 -1e -01 -00 -02 -00 -00 -00 -06 -00 -59 -1e -01 -00 -02 -00 -00 -00 -06 -00 -5d -1e -01 -00 -02 -00 -00 -00 -06 -00 -61 -1e -01 -00 -02 -00 -00 -00 -06 -00 -65 -1e -01 -00 -02 -00 -00 -00 -06 -00 -69 -1e -01 -00 -02 -00 -00 -00 -06 -00 -6d -1e -01 -00 -02 -00 -00 -00 -06 -00 -71 -1e -01 -00 -02 -00 -00 -00 -06 -00 -75 -1e -01 -00 -02 -00 -00 -00 -06 -00 -79 -1e -01 -00 -02 -00 -00 -00 -06 -00 -7d -1e -01 -00 -02 -00 -00 -00 -06 -00 -81 -1e -01 -00 -02 -00 -00 -00 -06 -00 -85 -1e -01 -00 -02 -00 -00 -00 -06 -00 -89 -1e -01 -00 -02 -00 -00 -00 -06 -00 -8d -1e -01 -00 -02 -00 -00 -00 -06 -00 -91 -1e -01 -00 -02 -00 -00 -00 -06 -00 -95 -1e -01 -00 -02 -00 -00 -00 -06 -00 -99 -1e -01 -00 -02 -00 -00 -00 -06 -00 -9d -1e -01 -00 -02 -00 -00 -00 -06 -00 -a1 -1e -01 -00 -02 -00 -00 -00 -06 -00 -a5 -1e -01 -00 -02 -00 -00 -00 -06 -00 -a9 -1e -01 -00 -02 -00 -00 -00 -06 -00 -ad -1e -01 -00 -02 -00 -00 -00 -06 -00 -b1 -1e -01 -00 -02 -00 -00 -00 -06 -00 -b5 -1e -01 -00 -02 -00 -00 -00 -06 -00 -b9 -1e -01 -00 -02 -00 -00 -00 -06 -00 -bd -1e -01 -00 -02 -00 -00 -00 -06 -00 -c1 -1e -01 -00 -02 -00 -00 -00 -06 -00 -c5 -1e -01 -00 -02 -00 -00 -00 -06 -00 -c9 -1e -01 -00 -02 -00 -00 -00 -06 -00 -cd -1e -01 -00 -02 -00 -00 -00 -06 -00 -d1 -1e -01 -00 -02 -00 -00 -00 -06 -00 -d5 -1e -01 -00 -02 -00 -00 -00 -06 -00 -d9 -1e -01 -00 -02 -00 -00 -00 -06 -00 -dd -1e -01 -00 -02 -00 -00 -00 -06 -00 -e1 -1e -01 -00 -02 -00 -00 -00 -06 -00 -e5 -1e -01 -00 -02 -00 -00 -00 -06 -00 -e9 -1e -01 -00 -02 -00 -00 -00 -06 -00 -ed -1e -01 -00 -02 -00 -00 -00 -06 -00 -f1 -1e -01 -00 -02 -00 -00 -00 -06 -00 -f5 -1e -01 -00 -02 -00 -00 -00 -06 -00 -f9 -1e -01 -00 -02 -00 -00 -00 -06 -00 -fd -1e -01 -00 -02 -00 -00 -00 -06 -00 -01 -1f -01 -00 -02 -00 -00 -00 -06 -00 -05 -1f -01 -00 -02 -00 -00 -00 -06 -00 -09 -1f -01 -00 -02 -00 -00 -00 -06 -00 -0d -1f -01 -00 -02 -00 -00 -00 -06 -00 -11 -1f -01 -00 -02 -00 -00 -00 -06 -00 -15 -1f -01 -00 -02 -00 -00 -00 -06 -00 -19 -1f -01 -00 -02 -00 -00 -00 -06 -00 -1d -1f -01 -00 -02 -00 -00 -00 -06 -00 -21 -1f -01 -00 -02 -00 -00 -00 -06 -00 -25 -1f -01 -00 -02 -00 -00 -00 -06 -00 -29 -1f -01 -00 -02 -00 -00 -00 -06 -00 -2d -1f -01 -00 -02 -00 -00 -00 -06 -00 -31 -1f -01 -00 -02 -00 -00 -00 -06 -00 -35 -1f -01 +00 00 02 00 @@ -97349,639 +86599,9 @@ fd 00 06 00 +4c 39 -1f -01 -00 -02 -00 -00 -00 -06 -00 -3d -1f -01 -00 -02 -00 -00 -00 -06 -00 -41 -1f -01 -00 -02 -00 -00 -00 -06 -00 -45 -1f -01 -00 -02 -00 -00 -00 -06 -00 -49 -1f -01 -00 -02 -00 -00 -00 -06 -00 -4d -1f -01 -00 -02 -00 -00 -00 -06 -00 -51 -1f -01 -00 -02 -00 -00 -00 -06 -00 -55 -1f -01 -00 -02 -00 -00 -00 -06 -00 -59 -1f -01 -00 -02 -00 -00 -00 -06 -00 -5d -1f -01 -00 -02 -00 -00 -00 -06 -00 -61 -1f -01 -00 -02 -00 -00 -00 -06 -00 -65 -1f -01 -00 -02 -00 -00 -00 -06 -00 -69 -1f -01 -00 -02 -00 -00 -00 -06 -00 -6d -1f -01 -00 -02 -00 -00 -00 -06 -00 -71 -1f -01 -00 -02 -00 -00 -00 -06 -00 -75 -1f -01 -00 -02 -00 -00 -00 -06 -00 -79 -1f -01 -00 -02 -00 -00 -00 -06 -00 -7d -1f -01 -00 -02 -00 -00 -00 -06 -00 -81 -1f -01 -00 -02 -00 -00 -00 -06 -00 -85 -1f -01 -00 -02 -00 -00 -00 -06 -00 -89 -1f -01 -00 -02 -00 -00 -00 -06 -00 -8d -1f -01 -00 -02 -00 -00 -00 -06 -00 -91 -1f -01 -00 -02 -00 -00 -00 -06 -00 -95 -1f -01 -00 -02 -00 -00 -00 -06 -00 -99 -1f -01 -00 -02 -00 -00 -00 -06 -00 -9d -1f -01 -00 -02 -00 -00 -00 -06 -00 -a1 -1f -01 -00 -02 -00 -00 -00 -06 -00 -a5 -1f -01 -00 -02 -00 -00 -00 -06 -00 -a9 -1f -01 -00 -02 -00 -00 -00 -06 -00 -ad -1f -01 -00 -02 -00 -00 -00 -06 -00 -b1 -1f -01 -00 -02 -00 -00 -00 -06 -00 -b5 -1f -01 -00 -02 -00 -00 -00 -06 -00 -b9 -1f -01 -00 -02 -00 -00 -00 -06 -00 -bd -1f -01 -00 -02 -00 -00 -00 -06 -00 -c1 -1f -01 -00 -02 -00 -00 -00 -06 -00 -c5 -1f -01 -00 -02 -00 -00 -00 -06 -00 -c9 -1f -01 -00 -02 -00 -00 -00 -06 -00 -cd -1f -01 -00 -02 -00 -00 -00 -06 -00 -d1 -1f -01 -00 -02 -00 -00 -00 -06 -00 -d5 -1f -01 -00 -02 -00 -00 -00 -06 -00 -d9 -1f -01 -00 -02 -00 -00 -00 -06 -00 -dd -1f -01 -00 -02 -00 -00 -00 -06 -00 -e1 -1f -01 -00 -02 -00 -00 -00 -06 -00 -e5 -1f -01 -00 -02 -00 -00 -00 -06 -00 -e9 -1f -01 -00 -02 -00 -00 -00 -06 -00 -ed -1f -01 -00 -02 -00 -00 -00 -06 -00 -f1 -1f -01 -00 -02 -00 -00 -00 -06 -00 -f5 -1f -01 -00 -02 -00 -00 -00 -06 -00 -f9 -1f -01 -00 -02 -00 -00 -00 -06 -00 -fd -1f -01 -00 -02 -00 -00 -00 -06 -00 -01 -20 -01 -00 -02 -00 -00 -00 -06 -00 -05 -20 -01 -00 -02 -00 -00 -00 -06 -00 -09 -20 -01 -00 -02 -00 -00 -00 -06 -00 -0d -20 -01 -00 -02 -00 -00 -00 -06 -00 -11 -20 -01 -00 -02 -00 -00 -00 -06 -00 -15 -20 -01 -00 -02 -00 -00 -00 -06 -00 -19 -20 -01 -00 -02 -00 -00 -00 -06 -00 -1d -20 -01 -00 -02 -00 -00 -00 -06 -00 -21 -20 -01 -00 -02 -00 -00 -00 -06 -00 -25 -20 -01 -00 -02 -00 -00 -00 -06 -00 -29 -20 -01 -00 -02 -00 -00 -00 -06 -00 -2d -20 -01 -00 -02 -00 -00 -00 -06 -00 -31 -20 -01 -00 -02 -00 -00 -00 -06 -00 -35 -20 -01 +00 00 02 00 @@ -97989,639 +86609,9 @@ fd 00 06 00 +50 39 -20 -01 -00 -02 -00 -00 -00 -06 -00 -3d -20 -01 -00 -02 -00 -00 -00 -06 -00 -41 -20 -01 -00 -02 -00 -00 -00 -06 -00 -45 -20 -01 -00 -02 -00 -00 -00 -06 -00 -49 -20 -01 -00 -02 -00 -00 -00 -06 -00 -4d -20 -01 -00 -02 -00 -00 -00 -06 -00 -51 -20 -01 -00 -02 -00 -00 -00 -06 -00 -55 -20 -01 -00 -02 -00 -00 -00 -06 -00 -59 -20 -01 -00 -02 -00 -00 -00 -06 -00 -5d -20 -01 -00 -02 -00 -00 -00 -06 -00 -61 -20 -01 -00 -02 -00 -00 -00 -06 -00 -65 -20 -01 -00 -02 -00 -00 -00 -06 -00 -69 -20 -01 -00 -02 -00 -00 -00 -06 -00 -6d -20 -01 -00 -02 -00 -00 -00 -06 -00 -71 -20 -01 -00 -02 -00 -00 -00 -06 -00 -75 -20 -01 -00 -02 -00 -00 -00 -06 -00 -79 -20 -01 -00 -02 -00 -00 -00 -06 -00 -7d -20 -01 -00 -02 -00 -00 -00 -06 -00 -81 -20 -01 -00 -02 -00 -00 -00 -06 -00 -85 -20 -01 -00 -02 -00 -00 -00 -06 -00 -89 -20 -01 -00 -02 -00 -00 -00 -06 -00 -8d -20 -01 -00 -02 -00 -00 -00 -06 -00 -91 -20 -01 -00 -02 -00 -00 -00 -06 -00 -95 -20 -01 -00 -02 -00 -00 -00 -06 -00 -99 -20 -01 -00 -02 -00 -00 -00 -06 -00 -9d -20 -01 -00 -02 -00 -00 -00 -06 -00 -a1 -20 -01 -00 -02 -00 -00 -00 -06 -00 -a5 -20 -01 -00 -02 -00 -00 -00 -06 -00 -a9 -20 -01 -00 -02 -00 -00 -00 -06 -00 -ad -20 -01 -00 -02 -00 -00 -00 -06 -00 -b1 -20 -01 -00 -02 -00 -00 -00 -06 -00 -b5 -20 -01 -00 -02 -00 -00 -00 -06 -00 -b9 -20 -01 -00 -02 -00 -00 -00 -06 -00 -bd -20 -01 -00 -02 -00 -00 -00 -06 -00 -c1 -20 -01 -00 -02 -00 -00 -00 -06 -00 -c5 -20 -01 -00 -02 -00 -00 -00 -06 -00 -c9 -20 -01 -00 -02 -00 -00 -00 -06 -00 -cd -20 -01 -00 -02 -00 -00 -00 -06 -00 -d1 -20 -01 -00 -02 -00 -00 -00 -06 -00 -d5 -20 -01 -00 -02 -00 -00 -00 -06 -00 -d9 -20 -01 -00 -02 -00 -00 -00 -06 -00 -dd -20 -01 -00 -02 -00 -00 -00 -06 -00 -e1 -20 -01 -00 -02 -00 -00 -00 -06 -00 -e5 -20 -01 -00 -02 -00 -00 -00 -06 -00 -e9 -20 -01 -00 -02 -00 -00 -00 -06 -00 -ed -20 -01 -00 -02 -00 -00 -00 -06 -00 -f1 -20 -01 -00 -02 -00 -00 -00 -06 -00 -f5 -20 -01 -00 -02 -00 -00 -00 -06 -00 -f9 -20 -01 -00 -02 -00 -00 -00 -06 -00 -fd -20 -01 -00 -02 -00 -00 -00 -06 -00 -01 -21 -01 -00 -02 -00 -00 -00 -06 -00 -05 -21 -01 -00 -02 -00 -00 -00 -06 -00 -09 -21 -01 -00 -02 -00 -00 -00 -06 -00 -0d -21 -01 -00 -02 -00 -00 -00 -06 -00 -11 -21 -01 -00 -02 -00 -00 -00 -06 -00 -15 -21 -01 -00 -02 -00 -00 -00 -06 -00 -19 -21 -01 -00 -02 -00 -00 -00 -06 -00 -1d -21 -01 -00 -02 -00 -00 -00 -06 -00 -21 -21 -01 -00 -02 -00 -00 -00 -06 -00 -25 -21 -01 -00 -02 -00 -00 -00 -06 -00 -29 -21 -01 -00 -02 -00 -00 -00 -06 -00 -2d -21 -01 -00 -02 -00 -00 -00 -06 -00 -31 -21 -01 -00 -02 -00 -00 -00 -06 -00 -35 -21 -01 +00 00 02 00 @@ -98629,639 +86619,9 @@ fd 00 06 00 +54 39 -21 -01 -00 -02 -00 -00 -00 -06 -00 -3d -21 -01 -00 -02 -00 -00 -00 -06 -00 -41 -21 -01 -00 -02 -00 -00 -00 -06 -00 -45 -21 -01 -00 -02 -00 -00 -00 -06 -00 -49 -21 -01 -00 -02 -00 -00 -00 -06 -00 -4d -21 -01 -00 -02 -00 -00 -00 -06 -00 -51 -21 -01 -00 -02 -00 -00 -00 -06 -00 -55 -21 -01 -00 -02 -00 -00 -00 -06 -00 -59 -21 -01 -00 -02 -00 -00 -00 -06 -00 -5d -21 -01 -00 -02 -00 -00 -00 -06 -00 -61 -21 -01 -00 -02 -00 -00 -00 -06 -00 -65 -21 -01 -00 -02 -00 -00 -00 -06 -00 -69 -21 -01 -00 -02 -00 -00 -00 -06 -00 -6d -21 -01 -00 -02 -00 -00 -00 -06 -00 -71 -21 -01 -00 -02 -00 -00 -00 -06 -00 -75 -21 -01 -00 -02 -00 -00 -00 -06 -00 -79 -21 -01 -00 -02 -00 -00 -00 -06 -00 -7d -21 -01 -00 -02 -00 -00 -00 -06 -00 -81 -21 -01 -00 -02 -00 -00 -00 -06 -00 -85 -21 -01 -00 -02 -00 -00 -00 -06 -00 -89 -21 -01 -00 -02 -00 -00 -00 -06 -00 -8d -21 -01 -00 -02 -00 -00 -00 -06 -00 -91 -21 -01 -00 -02 -00 -00 -00 -06 -00 -95 -21 -01 -00 -02 -00 -00 -00 -06 -00 -99 -21 -01 -00 -02 -00 -00 -00 -06 -00 -9d -21 -01 -00 -02 -00 -00 -00 -06 -00 -a1 -21 -01 -00 -02 -00 -00 -00 -06 -00 -a5 -21 -01 -00 -02 -00 -00 -00 -06 -00 -a9 -21 -01 -00 -02 -00 -00 -00 -06 -00 -ad -21 -01 -00 -02 -00 -00 -00 -06 -00 -b1 -21 -01 -00 -02 -00 -00 -00 -06 -00 -b5 -21 -01 -00 -02 -00 -00 -00 -06 -00 -b9 -21 -01 -00 -02 -00 -00 -00 -06 -00 -bd -21 -01 -00 -02 -00 -00 -00 -06 -00 -c1 -21 -01 -00 -02 -00 -00 -00 -06 -00 -c5 -21 -01 -00 -02 -00 -00 -00 -06 -00 -c9 -21 -01 -00 -02 -00 -00 -00 -06 -00 -cd -21 -01 -00 -02 -00 -00 -00 -06 -00 -d1 -21 -01 -00 -02 -00 -00 -00 -06 -00 -d5 -21 -01 -00 -02 -00 -00 -00 -06 -00 -d9 -21 -01 -00 -02 -00 -00 -00 -06 -00 -dd -21 -01 -00 -02 -00 -00 -00 -06 -00 -e1 -21 -01 -00 -02 -00 -00 -00 -06 -00 -e5 -21 -01 -00 -02 -00 -00 -00 -06 -00 -e9 -21 -01 -00 -02 -00 -00 -00 -06 -00 -ed -21 -01 -00 -02 -00 -00 -00 -06 -00 -f1 -21 -01 -00 -02 -00 -00 -00 -06 -00 -f5 -21 -01 -00 -02 -00 -00 -00 -06 -00 -f9 -21 -01 -00 -02 -00 -00 -00 -06 -00 -fd -21 -01 -00 -02 -00 -00 -00 -06 -00 -01 -22 -01 -00 -02 -00 -00 -00 -06 -00 -05 -22 -01 -00 -02 -00 -00 -00 -06 -00 -09 -22 -01 -00 -02 -00 -00 -00 -06 -00 -0d -22 -01 -00 -02 -00 -00 -00 -06 -00 -11 -22 -01 -00 -02 -00 -00 -00 -06 -00 -15 -22 -01 -00 -02 -00 -00 -00 -06 -00 -19 -22 -01 -00 -02 -00 -00 -00 -06 -00 -1d -22 -01 -00 -02 -00 -00 -00 -06 -00 -21 -22 -01 -00 -02 -00 -00 -00 -06 -00 -25 -22 -01 -00 -02 -00 -00 -00 -06 -00 -29 -22 -01 -00 -02 -00 -00 -00 -06 -00 -2d -22 -01 -00 -02 -00 -00 -00 -06 -00 -31 -22 -01 -00 -02 -00 -00 -00 -06 -00 -35 -22 -01 +00 00 02 00 @@ -99269,639 +86629,9 @@ fd 00 06 00 +58 39 -22 -01 -00 -02 -00 -00 -00 -06 -00 -3d -22 -01 -00 -02 -00 -00 -00 -06 -00 -41 -22 -01 -00 -02 -00 -00 -00 -06 -00 -45 -22 -01 -00 -02 -00 -00 -00 -06 -00 -49 -22 -01 -00 -02 -00 -00 -00 -06 -00 -4d -22 -01 -00 -02 -00 -00 -00 -06 -00 -51 -22 -01 -00 -02 -00 -00 -00 -06 -00 -55 -22 -01 -00 -02 -00 -00 -00 -06 -00 -59 -22 -01 -00 -02 -00 -00 -00 -06 -00 -5d -22 -01 -00 -02 -00 -00 -00 -06 -00 -61 -22 -01 -00 -02 -00 -00 -00 -06 -00 -65 -22 -01 -00 -02 -00 -00 -00 -06 -00 -69 -22 -01 -00 -02 -00 -00 -00 -06 -00 -6d -22 -01 -00 -02 -00 -00 -00 -06 -00 -71 -22 -01 -00 -02 -00 -00 -00 -06 -00 -75 -22 -01 -00 -02 -00 -00 -00 -06 -00 -79 -22 -01 -00 -02 -00 -00 -00 -06 -00 -7d -22 -01 -00 -02 -00 -00 -00 -06 -00 -81 -22 -01 -00 -02 -00 -00 -00 -06 -00 -85 -22 -01 -00 -02 -00 -00 -00 -06 -00 -89 -22 -01 -00 -02 -00 -00 -00 -06 -00 -8d -22 -01 -00 -02 -00 -00 -00 -06 -00 -91 -22 -01 -00 -02 -00 -00 -00 -06 -00 -95 -22 -01 -00 -02 -00 -00 -00 -06 -00 -99 -22 -01 -00 -02 -00 -00 -00 -06 -00 -9d -22 -01 -00 -02 -00 -00 -00 -06 -00 -a1 -22 -01 -00 -02 -00 -00 -00 -06 -00 -a5 -22 -01 -00 -02 -00 -00 -00 -06 -00 -a9 -22 -01 -00 -02 -00 -00 -00 -06 -00 -ad -22 -01 -00 -02 -00 -00 -00 -06 -00 -b1 -22 -01 -00 -02 -00 -00 -00 -06 -00 -b5 -22 -01 -00 -02 -00 -00 -00 -06 -00 -b9 -22 -01 -00 -02 -00 -00 -00 -06 -00 -bd -22 -01 -00 -02 -00 -00 -00 -06 -00 -c1 -22 -01 -00 -02 -00 -00 -00 -06 -00 -c5 -22 -01 -00 -02 -00 -00 -00 -06 -00 -c9 -22 -01 -00 -02 -00 -00 -00 -06 -00 -cd -22 -01 -00 -02 -00 -00 -00 -06 -00 -d1 -22 -01 -00 -02 -00 -00 -00 -06 -00 -d5 -22 -01 -00 -02 -00 -00 -00 -06 -00 -d9 -22 -01 -00 -02 -00 -00 -00 -06 -00 -dd -22 -01 -00 -02 -00 -00 -00 -06 -00 -e1 -22 -01 -00 -02 -00 -00 -00 -06 -00 -e5 -22 -01 -00 -02 -00 -00 -00 -06 -00 -e9 -22 -01 -00 -02 -00 -00 -00 -06 -00 -ed -22 -01 -00 -02 -00 -00 -00 -06 -00 -f1 -22 -01 -00 -02 -00 -00 -00 -06 -00 -f5 -22 -01 -00 -02 -00 -00 -00 -06 -00 -f9 -22 -01 -00 -02 -00 -00 -00 -06 -00 -fd -22 -01 -00 -02 -00 -00 -00 -06 -00 -01 -23 -01 -00 -02 -00 -00 -00 -06 -00 -05 -23 -01 -00 -02 -00 -00 -00 -06 -00 -09 -23 -01 -00 -02 -00 -00 -00 -06 -00 -0d -23 -01 -00 -02 -00 -00 -00 -06 -00 -11 -23 -01 -00 -02 -00 -00 -00 -06 -00 -15 -23 -01 -00 -02 -00 -00 -00 -06 -00 -19 -23 -01 -00 -02 -00 -00 -00 -06 -00 -1d -23 -01 -00 -02 -00 -00 -00 -06 -00 -21 -23 -01 -00 -02 -00 -00 -00 -06 -00 -25 -23 -01 -00 -02 -00 -00 -00 -06 -00 -29 -23 -01 -00 -02 -00 -00 -00 -06 -00 -2d -23 -01 -00 -02 -00 -00 -00 -06 -00 -31 -23 -01 -00 -02 -00 -00 -00 -06 -00 -35 -23 -01 +00 00 02 00 @@ -99909,639 +86639,9 @@ fd 00 06 00 +5c 39 -23 -01 -00 -02 -00 -00 -00 -06 -00 -3d -23 -01 -00 -02 -00 -00 -00 -06 -00 -41 -23 -01 -00 -02 -00 -00 -00 -06 -00 -45 -23 -01 -00 -02 -00 -00 -00 -06 -00 -49 -23 -01 -00 -02 -00 -00 -00 -06 -00 -4d -23 -01 -00 -02 -00 -00 -00 -06 -00 -51 -23 -01 -00 -02 -00 -00 -00 -06 -00 -55 -23 -01 -00 -02 -00 -00 -00 -06 -00 -59 -23 -01 -00 -02 -00 -00 -00 -06 -00 -5d -23 -01 -00 -02 -00 -00 -00 -06 -00 -61 -23 -01 -00 -02 -00 -00 -00 -06 -00 -65 -23 -01 -00 -02 -00 -00 -00 -06 -00 -69 -23 -01 -00 -02 -00 -00 -00 -06 -00 -6d -23 -01 -00 -02 -00 -00 -00 -06 -00 -71 -23 -01 -00 -02 -00 -00 -00 -06 -00 -75 -23 -01 -00 -02 -00 -00 -00 -06 -00 -79 -23 -01 -00 -02 -00 -00 -00 -06 -00 -7d -23 -01 -00 -02 -00 -00 -00 -06 -00 -81 -23 -01 -00 -02 -00 -00 -00 -06 -00 -85 -23 -01 -00 -02 -00 -00 -00 -06 -00 -89 -23 -01 -00 -02 -00 -00 -00 -06 -00 -8d -23 -01 -00 -02 -00 -00 -00 -06 -00 -91 -23 -01 -00 -02 -00 -00 -00 -06 -00 -95 -23 -01 -00 -02 -00 -00 -00 -06 -00 -99 -23 -01 -00 -02 -00 -00 -00 -06 -00 -9d -23 -01 -00 -02 -00 -00 -00 -06 -00 -a1 -23 -01 -00 -02 -00 -00 -00 -06 -00 -a5 -23 -01 -00 -02 -00 -00 -00 -06 -00 -a9 -23 -01 -00 -02 -00 -00 -00 -06 -00 -ad -23 -01 -00 -02 -00 -00 -00 -06 -00 -b1 -23 -01 -00 -02 -00 -00 -00 -06 -00 -b5 -23 -01 -00 -02 -00 -00 -00 -06 -00 -b9 -23 -01 -00 -02 -00 -00 -00 -06 -00 -bd -23 -01 -00 -02 -00 -00 -00 -06 -00 -c1 -23 -01 -00 -02 -00 -00 -00 -06 -00 -c5 -23 -01 -00 -02 -00 -00 -00 -06 -00 -c9 -23 -01 -00 -02 -00 -00 -00 -06 -00 -cd -23 -01 -00 -02 -00 -00 -00 -06 -00 -d1 -23 -01 -00 -02 -00 -00 -00 -06 -00 -d5 -23 -01 -00 -02 -00 -00 -00 -06 -00 -d9 -23 -01 -00 -02 -00 -00 -00 -06 -00 -dd -23 -01 -00 -02 -00 -00 -00 -06 -00 -e1 -23 -01 -00 -02 -00 -00 -00 -06 -00 -e5 -23 -01 -00 -02 -00 -00 -00 -06 -00 -e9 -23 -01 -00 -02 -00 -00 -00 -06 -00 -ed -23 -01 -00 -02 -00 -00 -00 -06 -00 -f1 -23 -01 -00 -02 -00 -00 -00 -06 -00 -f5 -23 -01 -00 -02 -00 -00 -00 -06 -00 -f9 -23 -01 -00 -02 -00 -00 -00 -06 -00 -fd -23 -01 -00 -02 -00 -00 -00 -06 -00 -01 -24 -01 -00 -02 -00 -00 -00 -06 -00 -05 -24 -01 -00 -02 -00 -00 -00 -06 -00 -09 -24 -01 -00 -02 -00 -00 -00 -06 -00 -0d -24 -01 -00 -02 -00 -00 -00 -06 -00 -11 -24 -01 -00 -02 -00 -00 -00 -06 -00 -15 -24 -01 -00 -02 -00 -00 -00 -06 -00 -19 -24 -01 -00 -02 -00 -00 -00 -06 -00 -1d -24 -01 -00 -02 -00 -00 -00 -06 -00 -21 -24 -01 -00 -02 -00 -00 -00 -06 -00 -25 -24 -01 -00 -02 -00 -00 -00 -06 -00 -29 -24 -01 -00 -02 -00 -00 -00 -06 -00 -2d -24 -01 -00 -02 -00 -00 -00 -06 -00 -31 -24 -01 -00 -02 -00 -00 -00 -06 -00 -35 -24 -01 +00 00 02 00 @@ -100549,639 +86649,9 @@ fd 00 06 00 +60 39 -24 -01 -00 -02 -00 -00 -00 -06 -00 -3d -24 -01 -00 -02 -00 -00 -00 -06 -00 -41 -24 -01 -00 -02 -00 -00 -00 -06 -00 -45 -24 -01 -00 -02 -00 -00 -00 -06 -00 -49 -24 -01 -00 -02 -00 -00 -00 -06 -00 -4d -24 -01 -00 -02 -00 -00 -00 -06 -00 -51 -24 -01 -00 -02 -00 -00 -00 -06 -00 -55 -24 -01 -00 -02 -00 -00 -00 -06 -00 -59 -24 -01 -00 -02 -00 -00 -00 -06 -00 -5d -24 -01 -00 -02 -00 -00 -00 -06 -00 -61 -24 -01 -00 -02 -00 -00 -00 -06 -00 -65 -24 -01 -00 -02 -00 -00 -00 -06 -00 -69 -24 -01 -00 -02 -00 -00 -00 -06 -00 -6d -24 -01 -00 -02 -00 -00 -00 -06 -00 -71 -24 -01 -00 -02 -00 -00 -00 -06 -00 -75 -24 -01 -00 -02 -00 -00 -00 -06 -00 -79 -24 -01 -00 -02 -00 -00 -00 -06 -00 -7d -24 -01 -00 -02 -00 -00 -00 -06 -00 -81 -24 -01 -00 -02 -00 -00 -00 -06 -00 -85 -24 -01 -00 -02 -00 -00 -00 -06 -00 -89 -24 -01 -00 -02 -00 -00 -00 -06 -00 -8d -24 -01 -00 -02 -00 -00 -00 -06 -00 -91 -24 -01 -00 -02 -00 -00 -00 -06 -00 -95 -24 -01 -00 -02 -00 -00 -00 -06 -00 -99 -24 -01 -00 -02 -00 -00 -00 -06 -00 -9d -24 -01 -00 -02 -00 -00 -00 -06 -00 -a1 -24 -01 -00 -02 -00 -00 -00 -06 -00 -a5 -24 -01 -00 -02 -00 -00 -00 -06 -00 -a9 -24 -01 -00 -02 -00 -00 -00 -06 -00 -ad -24 -01 -00 -02 -00 -00 -00 -06 -00 -b1 -24 -01 -00 -02 -00 -00 -00 -06 -00 -b5 -24 -01 -00 -02 -00 -00 -00 -06 -00 -b9 -24 -01 -00 -02 -00 -00 -00 -06 -00 -bd -24 -01 -00 -02 -00 -00 -00 -06 -00 -c1 -24 -01 -00 -02 -00 -00 -00 -06 -00 -c5 -24 -01 -00 -02 -00 -00 -00 -06 -00 -c9 -24 -01 -00 -02 -00 -00 -00 -06 -00 -cd -24 -01 -00 -02 -00 -00 -00 -06 -00 -d1 -24 -01 -00 -02 -00 -00 -00 -06 -00 -d5 -24 -01 -00 -02 -00 -00 -00 -06 -00 -d9 -24 -01 -00 -02 -00 -00 -00 -06 -00 -dd -24 -01 -00 -02 -00 -00 -00 -06 -00 -e1 -24 -01 -00 -02 -00 -00 -00 -06 -00 -e5 -24 -01 -00 -02 -00 -00 -00 -06 -00 -e9 -24 -01 -00 -02 -00 -00 -00 -06 -00 -ed -24 -01 -00 -02 -00 -00 -00 -06 -00 -f1 -24 -01 -00 -02 -00 -00 -00 -06 -00 -f5 -24 -01 -00 -02 -00 -00 -00 -06 -00 -f9 -24 -01 -00 -02 -00 -00 -00 -06 -00 -fd -24 -01 -00 -02 -00 -00 -00 -06 -00 -01 -25 -01 -00 -02 -00 -00 -00 -06 -00 -05 -25 -01 -00 -02 -00 -00 -00 -06 -00 -09 -25 -01 -00 -02 -00 -00 -00 -06 -00 -0d -25 -01 -00 -02 -00 -00 -00 -06 -00 -11 -25 -01 -00 -02 -00 -00 -00 -06 -00 -15 -25 -01 -00 -02 -00 -00 -00 -06 -00 -19 -25 -01 -00 -02 -00 -00 -00 -06 -00 -1d -25 -01 -00 -02 -00 -00 -00 -06 -00 -21 -25 -01 -00 -02 -00 -00 -00 -06 -00 -25 -25 -01 -00 -02 -00 -00 -00 -06 -00 -29 -25 -01 -00 -02 -00 -00 -00 -06 -00 -2d -25 -01 -00 -02 -00 -00 -00 -06 -00 -31 -25 -01 -00 -02 -00 -00 -00 -06 -00 -35 -25 -01 +00 00 02 00 @@ -101189,639 +86659,9 @@ fd 00 06 00 +64 39 -25 -01 -00 -02 -00 -00 -00 -06 -00 -3d -25 -01 -00 -02 -00 -00 -00 -06 -00 -41 -25 -01 -00 -02 -00 -00 -00 -06 -00 -45 -25 -01 -00 -02 -00 -00 -00 -06 -00 -49 -25 -01 -00 -02 -00 -00 -00 -06 -00 -4d -25 -01 -00 -02 -00 -00 -00 -06 -00 -51 -25 -01 -00 -02 -00 -00 -00 -06 -00 -55 -25 -01 -00 -02 -00 -00 -00 -06 -00 -59 -25 -01 -00 -02 -00 -00 -00 -06 -00 -5d -25 -01 -00 -02 -00 -00 -00 -06 -00 -61 -25 -01 -00 -02 -00 -00 -00 -06 -00 -65 -25 -01 -00 -02 -00 -00 -00 -06 -00 -69 -25 -01 -00 -02 -00 -00 -00 -06 -00 -6d -25 -01 -00 -02 -00 -00 -00 -06 -00 -71 -25 -01 -00 -02 -00 -00 -00 -06 -00 -75 -25 -01 -00 -02 -00 -00 -00 -06 -00 -79 -25 -01 -00 -02 -00 -00 -00 -06 -00 -7d -25 -01 -00 -02 -00 -00 -00 -06 -00 -81 -25 -01 -00 -02 -00 -00 -00 -06 -00 -85 -25 -01 -00 -02 -00 -00 -00 -06 -00 -89 -25 -01 -00 -02 -00 -00 -00 -06 -00 -8d -25 -01 -00 -02 -00 -00 -00 -06 -00 -91 -25 -01 -00 -02 -00 -00 -00 -06 -00 -95 -25 -01 -00 -02 -00 -00 -00 -06 -00 -99 -25 -01 -00 -02 -00 -00 -00 -06 -00 -9d -25 -01 -00 -02 -00 -00 -00 -06 -00 -a1 -25 -01 -00 -02 -00 -00 -00 -06 -00 -a5 -25 -01 -00 -02 -00 -00 -00 -06 -00 -a9 -25 -01 -00 -02 -00 -00 -00 -06 -00 -ad -25 -01 -00 -02 -00 -00 -00 -06 -00 -b1 -25 -01 -00 -02 -00 -00 -00 -06 -00 -b5 -25 -01 -00 -02 -00 -00 -00 -06 -00 -b9 -25 -01 -00 -02 -00 -00 -00 -06 -00 -bd -25 -01 -00 -02 -00 -00 -00 -06 -00 -c1 -25 -01 -00 -02 -00 -00 -00 -06 -00 -c5 -25 -01 -00 -02 -00 -00 -00 -06 -00 -c9 -25 -01 -00 -02 -00 -00 -00 -06 -00 -cd -25 -01 -00 -02 -00 -00 -00 -06 -00 -d1 -25 -01 -00 -02 -00 -00 -00 -06 -00 -d5 -25 -01 -00 -02 -00 -00 -00 -06 -00 -d9 -25 -01 -00 -02 -00 -00 -00 -06 -00 -dd -25 -01 -00 -02 -00 -00 -00 -06 -00 -e1 -25 -01 -00 -02 -00 -00 -00 -06 -00 -e5 -25 -01 -00 -02 -00 -00 -00 -06 -00 -e9 -25 -01 -00 -02 -00 -00 -00 -06 -00 -ed -25 -01 -00 -02 -00 -00 -00 -06 -00 -f1 -25 -01 -00 -02 -00 -00 -00 -06 -00 -f5 -25 -01 -00 -02 -00 -00 -00 -06 -00 -f9 -25 -01 -00 -02 -00 -00 -00 -06 -00 -fd -25 -01 -00 -02 -00 -00 -00 -06 -00 -01 -26 -01 -00 -02 -00 -00 -00 -06 -00 -05 -26 -01 -00 -02 -00 -00 -00 -06 -00 -09 -26 -01 -00 -02 -00 -00 -00 -06 -00 -0d -26 -01 -00 -02 -00 -00 -00 -06 -00 -11 -26 -01 -00 -02 -00 -00 -00 -06 -00 -15 -26 -01 -00 -02 -00 -00 -00 -06 -00 -19 -26 -01 -00 -02 -00 -00 -00 -06 -00 -1d -26 -01 -00 -02 -00 -00 -00 -06 -00 -21 -26 -01 -00 -02 -00 -00 -00 -06 -00 -25 -26 -01 -00 -02 -00 -00 -00 -06 -00 -29 -26 -01 -00 -02 -00 -00 -00 -06 -00 -2d -26 -01 -00 -02 -00 -00 -00 -06 -00 -31 -26 -01 -00 -02 -00 -00 -00 -06 -00 -35 -26 -01 +00 00 02 00 @@ -101829,639 +86669,9 @@ fd 00 06 00 +68 39 -26 -01 -00 -02 -00 -00 -00 -06 -00 -3d -26 -01 -00 -02 -00 -00 -00 -06 -00 -41 -26 -01 -00 -02 -00 -00 -00 -06 -00 -45 -26 -01 -00 -02 -00 -00 -00 -06 -00 -49 -26 -01 -00 -02 -00 -00 -00 -06 -00 -4d -26 -01 -00 -02 -00 -00 -00 -06 -00 -51 -26 -01 -00 -02 -00 -00 -00 -06 -00 -55 -26 -01 -00 -02 -00 -00 -00 -06 -00 -59 -26 -01 -00 -02 -00 -00 -00 -06 -00 -5d -26 -01 -00 -02 -00 -00 -00 -06 -00 -61 -26 -01 -00 -02 -00 -00 -00 -06 -00 -65 -26 -01 -00 -02 -00 -00 -00 -06 -00 -69 -26 -01 -00 -02 -00 -00 -00 -06 -00 -6d -26 -01 -00 -02 -00 -00 -00 -06 -00 -71 -26 -01 -00 -02 -00 -00 -00 -06 -00 -75 -26 -01 -00 -02 -00 -00 -00 -06 -00 -79 -26 -01 -00 -02 -00 -00 -00 -06 -00 -7d -26 -01 -00 -02 -00 -00 -00 -06 -00 -81 -26 -01 -00 -02 -00 -00 -00 -06 -00 -85 -26 -01 -00 -02 -00 -00 -00 -06 -00 -89 -26 -01 -00 -02 -00 -00 -00 -06 -00 -8d -26 -01 -00 -02 -00 -00 -00 -06 -00 -91 -26 -01 -00 -02 -00 -00 -00 -06 -00 -95 -26 -01 -00 -02 -00 -00 -00 -06 -00 -99 -26 -01 -00 -02 -00 -00 -00 -06 -00 -9d -26 -01 -00 -02 -00 -00 -00 -06 -00 -a1 -26 -01 -00 -02 -00 -00 -00 -06 -00 -a5 -26 -01 -00 -02 -00 -00 -00 -06 -00 -a9 -26 -01 -00 -02 -00 -00 -00 -06 -00 -ad -26 -01 -00 -02 -00 -00 -00 -06 -00 -b1 -26 -01 -00 -02 -00 -00 -00 -06 -00 -b5 -26 -01 -00 -02 -00 -00 -00 -06 -00 -b9 -26 -01 -00 -02 -00 -00 -00 -06 -00 -bd -26 -01 -00 -02 -00 -00 -00 -06 -00 -c1 -26 -01 -00 -02 -00 -00 -00 -06 -00 -c5 -26 -01 -00 -02 -00 -00 -00 -06 -00 -c9 -26 -01 -00 -02 -00 -00 -00 -06 -00 -cd -26 -01 -00 -02 -00 -00 -00 -06 -00 -d1 -26 -01 -00 -02 -00 -00 -00 -06 -00 -d5 -26 -01 -00 -02 -00 -00 -00 -06 -00 -d9 -26 -01 -00 -02 -00 -00 -00 -06 -00 -dd -26 -01 -00 -02 -00 -00 -00 -06 -00 -e1 -26 -01 -00 -02 -00 -00 -00 -06 -00 -e5 -26 -01 -00 -02 -00 -00 -00 -06 -00 -e9 -26 -01 -00 -02 -00 -00 -00 -06 -00 -ed -26 -01 -00 -02 -00 -00 -00 -06 -00 -f1 -26 -01 -00 -02 -00 -00 -00 -06 -00 -f5 -26 -01 -00 -02 -00 -00 -00 -06 -00 -f9 -26 -01 -00 -02 -00 -00 -00 -06 -00 -fd -26 -01 -00 -02 -00 -00 -00 -06 -00 -01 -27 -01 -00 -02 -00 -00 -00 -06 -00 -05 -27 -01 -00 -02 -00 -00 -00 -06 -00 -09 -27 -01 -00 -02 -00 -00 -00 -06 -00 -0d -27 -01 -00 -02 -00 -00 -00 -06 -00 -11 -27 -01 -00 -02 -00 -00 -00 -06 -00 -15 -27 -01 -00 -02 -00 -00 -00 -06 -00 -19 -27 -01 -00 -02 -00 -00 -00 -06 -00 -1d -27 -01 -00 -02 -00 -00 -00 -06 -00 -21 -27 -01 -00 -02 -00 -00 -00 -06 -00 -25 -27 -01 -00 -02 -00 -00 -00 -06 -00 -29 -27 -01 -00 -02 -00 -00 -00 -06 -00 -2d -27 -01 -00 -02 -00 -00 -00 -06 -00 -31 -27 -01 -00 -02 -00 -00 -00 -06 -00 -35 -27 -01 +00 00 02 00 @@ -102469,639 +86679,9 @@ fd 00 06 00 +6c 39 -27 -01 -00 -02 -00 -00 -00 -06 -00 -3d -27 -01 -00 -02 -00 -00 -00 -06 -00 -41 -27 -01 -00 -02 -00 -00 -00 -06 -00 -45 -27 -01 -00 -02 -00 -00 -00 -06 -00 -49 -27 -01 -00 -02 -00 -00 -00 -06 -00 -4d -27 -01 -00 -02 -00 -00 -00 -06 -00 -51 -27 -01 -00 -02 -00 -00 -00 -06 -00 -55 -27 -01 -00 -02 -00 -00 -00 -06 -00 -59 -27 -01 -00 -02 -00 -00 -00 -06 -00 -5d -27 -01 -00 -02 -00 -00 -00 -06 -00 -61 -27 -01 -00 -02 -00 -00 -00 -06 -00 -65 -27 -01 -00 -02 -00 -00 -00 -06 -00 -69 -27 -01 -00 -02 -00 -00 -00 -06 -00 -6d -27 -01 -00 -02 -00 -00 -00 -06 -00 -71 -27 -01 -00 -02 -00 -00 -00 -06 -00 -75 -27 -01 -00 -02 -00 -00 -00 -06 -00 -79 -27 -01 -00 -02 -00 -00 -00 -06 -00 -7d -27 -01 -00 -02 -00 -00 -00 -06 -00 -81 -27 -01 -00 -02 -00 -00 -00 -06 -00 -85 -27 -01 -00 -02 -00 -00 -00 -06 -00 -89 -27 -01 -00 -02 -00 -00 -00 -06 -00 -8d -27 -01 -00 -02 -00 -00 -00 -06 -00 -91 -27 -01 -00 -02 -00 -00 -00 -06 -00 -95 -27 -01 -00 -02 -00 -00 -00 -06 -00 -99 -27 -01 -00 -02 -00 -00 -00 -06 -00 -9d -27 -01 -00 -02 -00 -00 -00 -06 -00 -a1 -27 -01 -00 -02 -00 -00 -00 -06 -00 -a5 -27 -01 -00 -02 -00 -00 -00 -06 -00 -a9 -27 -01 -00 -02 -00 -00 -00 -06 -00 -ad -27 -01 -00 -02 -00 -00 -00 -06 -00 -b1 -27 -01 -00 -02 -00 -00 -00 -06 -00 -b5 -27 -01 -00 -02 -00 -00 -00 -06 -00 -b9 -27 -01 -00 -02 -00 -00 -00 -06 -00 -bd -27 -01 -00 -02 -00 -00 -00 -06 -00 -c1 -27 -01 -00 -02 -00 -00 -00 -06 -00 -c5 -27 -01 -00 -02 -00 -00 -00 -06 -00 -c9 -27 -01 -00 -02 -00 -00 -00 -06 -00 -cd -27 -01 -00 -02 -00 -00 -00 -06 -00 -d1 -27 -01 -00 -02 -00 -00 -00 -06 -00 -d5 -27 -01 -00 -02 -00 -00 -00 -06 -00 -d9 -27 -01 -00 -02 -00 -00 -00 -06 -00 -dd -27 -01 -00 -02 -00 -00 -00 -06 -00 -e1 -27 -01 -00 -02 -00 -00 -00 -06 -00 -e5 -27 -01 -00 -02 -00 -00 -00 -06 -00 -e9 -27 -01 -00 -02 -00 -00 -00 -06 -00 -ed -27 -01 -00 -02 -00 -00 -00 -06 -00 -f1 -27 -01 -00 -02 -00 -00 -00 -06 -00 -f5 -27 -01 -00 -02 -00 -00 -00 -06 -00 -f9 -27 -01 -00 -02 -00 -00 -00 -06 -00 -fd -27 -01 -00 -02 -00 -00 -00 -06 -00 -01 -28 -01 -00 -02 -00 -00 -00 -06 -00 -05 -28 -01 -00 -02 -00 -00 -00 -06 -00 -09 -28 -01 -00 -02 -00 -00 -00 -06 -00 -0d -28 -01 -00 -02 -00 -00 -00 -06 -00 -11 -28 -01 -00 -02 -00 -00 -00 -06 -00 -15 -28 -01 -00 -02 -00 -00 -00 -06 -00 -19 -28 -01 -00 -02 -00 -00 -00 -06 -00 -1d -28 -01 -00 -02 -00 -00 -00 -06 -00 -21 -28 -01 -00 -02 -00 -00 -00 -06 -00 -25 -28 -01 -00 -02 -00 -00 -00 -06 -00 -29 -28 -01 -00 -02 -00 -00 -00 -06 -00 -2d -28 -01 -00 -02 -00 -00 -00 -06 -00 -31 -28 -01 -00 -02 -00 -00 -00 -06 -00 -35 -28 -01 +00 00 02 00 @@ -103109,639 +86689,9 @@ fd 00 06 00 +70 39 -28 -01 -00 -02 -00 -00 -00 -06 -00 -3d -28 -01 -00 -02 -00 -00 -00 -06 -00 -41 -28 -01 -00 -02 -00 -00 -00 -06 -00 -45 -28 -01 -00 -02 -00 -00 -00 -06 -00 -49 -28 -01 -00 -02 -00 -00 -00 -06 -00 -4d -28 -01 -00 -02 -00 -00 -00 -06 -00 -51 -28 -01 -00 -02 -00 -00 -00 -06 -00 -55 -28 -01 -00 -02 -00 -00 -00 -06 -00 -59 -28 -01 -00 -02 -00 -00 -00 -06 -00 -5d -28 -01 -00 -02 -00 -00 -00 -06 -00 -61 -28 -01 -00 -02 -00 -00 -00 -06 -00 -65 -28 -01 -00 -02 -00 -00 -00 -06 -00 -69 -28 -01 -00 -02 -00 -00 -00 -06 -00 -6d -28 -01 -00 -02 -00 -00 -00 -06 -00 -71 -28 -01 -00 -02 -00 -00 -00 -06 -00 -75 -28 -01 -00 -02 -00 -00 -00 -06 -00 -79 -28 -01 -00 -02 -00 -00 -00 -06 -00 -7d -28 -01 -00 -02 -00 -00 -00 -06 -00 -81 -28 -01 -00 -02 -00 -00 -00 -06 -00 -85 -28 -01 -00 -02 -00 -00 -00 -06 -00 -89 -28 -01 -00 -02 -00 -00 -00 -06 -00 -8d -28 -01 -00 -02 -00 -00 -00 -06 -00 -91 -28 -01 -00 -02 -00 -00 -00 -06 -00 -95 -28 -01 -00 -02 -00 -00 -00 -06 -00 -99 -28 -01 -00 -02 -00 -00 -00 -06 -00 -9d -28 -01 -00 -02 -00 -00 -00 -06 -00 -a1 -28 -01 -00 -02 -00 -00 -00 -06 -00 -a5 -28 -01 -00 -02 -00 -00 -00 -06 -00 -a9 -28 -01 -00 -02 -00 -00 -00 -06 -00 -ad -28 -01 -00 -02 -00 -00 -00 -06 -00 -b1 -28 -01 -00 -02 -00 -00 -00 -06 -00 -b5 -28 -01 -00 -02 -00 -00 -00 -06 -00 -b9 -28 -01 -00 -02 -00 -00 -00 -06 -00 -bd -28 -01 -00 -02 -00 -00 -00 -06 -00 -c1 -28 -01 -00 -02 -00 -00 -00 -06 -00 -c5 -28 -01 -00 -02 -00 -00 -00 -06 -00 -c9 -28 -01 -00 -02 -00 -00 -00 -06 -00 -cd -28 -01 -00 -02 -00 -00 -00 -06 -00 -d1 -28 -01 -00 -02 -00 -00 -00 -06 -00 -d5 -28 -01 -00 -02 -00 -00 -00 -06 -00 -d9 -28 -01 -00 -02 -00 -00 -00 -06 -00 -dd -28 -01 -00 -02 -00 -00 -00 -06 -00 -e1 -28 -01 -00 -02 -00 -00 -00 -06 -00 -e5 -28 -01 -00 -02 -00 -00 -00 -06 -00 -e9 -28 -01 -00 -02 -00 -00 -00 -06 -00 -ed -28 -01 -00 -02 -00 -00 -00 -06 -00 -f1 -28 -01 -00 -02 -00 -00 -00 -06 -00 -f5 -28 -01 -00 -02 -00 -00 -00 -06 -00 -f9 -28 -01 -00 -02 -00 -00 -00 -06 -00 -fd -28 -01 -00 -02 -00 -00 -00 -06 -00 -01 -29 -01 -00 -02 -00 -00 -00 -06 -00 -05 -29 -01 -00 -02 -00 -00 -00 -06 -00 -09 -29 -01 -00 -02 -00 -00 -00 -06 -00 -0d -29 -01 -00 -02 -00 -00 -00 -06 -00 -11 -29 -01 -00 -02 -00 -00 -00 -06 -00 -15 -29 -01 -00 -02 -00 -00 -00 -06 -00 -19 -29 -01 -00 -02 -00 -00 -00 -06 -00 -1d -29 -01 -00 -02 -00 -00 -00 -06 -00 -21 -29 -01 -00 -02 -00 -00 -00 -06 -00 -25 -29 -01 -00 -02 -00 -00 -00 -06 -00 -29 -29 -01 -00 -02 -00 -00 -00 -06 -00 -2d -29 -01 -00 -02 -00 -00 -00 -06 -00 -31 -29 -01 -00 -02 -00 -00 -00 -06 -00 -35 -29 -01 +00 00 02 00 @@ -103749,639 +86699,9 @@ fd 00 06 00 +74 39 -29 -01 -00 -02 -00 -00 -00 -06 -00 -3d -29 -01 -00 -02 -00 -00 -00 -06 -00 -41 -29 -01 -00 -02 -00 -00 -00 -06 -00 -45 -29 -01 -00 -02 -00 -00 -00 -06 -00 -49 -29 -01 -00 -02 -00 -00 -00 -06 -00 -4d -29 -01 -00 -02 -00 -00 -00 -06 -00 -51 -29 -01 -00 -02 -00 -00 -00 -06 -00 -55 -29 -01 -00 -02 -00 -00 -00 -06 -00 -59 -29 -01 -00 -02 -00 -00 -00 -06 -00 -5d -29 -01 -00 -02 -00 -00 -00 -06 -00 -61 -29 -01 -00 -02 -00 -00 -00 -06 -00 -65 -29 -01 -00 -02 -00 -00 -00 -06 -00 -69 -29 -01 -00 -02 -00 -00 -00 -06 -00 -6d -29 -01 -00 -02 -00 -00 -00 -06 -00 -71 -29 -01 -00 -02 -00 -00 -00 -06 -00 -75 -29 -01 -00 -02 -00 -00 -00 -06 -00 -79 -29 -01 -00 -02 -00 -00 -00 -06 -00 -7d -29 -01 -00 -02 -00 -00 -00 -06 -00 -81 -29 -01 -00 -02 -00 -00 -00 -06 -00 -85 -29 -01 -00 -02 -00 -00 -00 -06 -00 -89 -29 -01 -00 -02 -00 -00 -00 -06 -00 -8d -29 -01 -00 -02 -00 -00 -00 -06 -00 -91 -29 -01 -00 -02 -00 -00 -00 -06 -00 -95 -29 -01 -00 -02 -00 -00 -00 -06 -00 -99 -29 -01 -00 -02 -00 -00 -00 -06 -00 -9d -29 -01 -00 -02 -00 -00 -00 -06 -00 -a1 -29 -01 -00 -02 -00 -00 -00 -06 -00 -a5 -29 -01 -00 -02 -00 -00 -00 -06 -00 -a9 -29 -01 -00 -02 -00 -00 -00 -06 -00 -ad -29 -01 -00 -02 -00 -00 -00 -06 -00 -b1 -29 -01 -00 -02 -00 -00 -00 -06 -00 -b5 -29 -01 -00 -02 -00 -00 -00 -06 -00 -b9 -29 -01 -00 -02 -00 -00 -00 -06 -00 -bd -29 -01 -00 -02 -00 -00 -00 -06 -00 -c1 -29 -01 -00 -02 -00 -00 -00 -06 -00 -c5 -29 -01 -00 -02 -00 -00 -00 -06 -00 -c9 -29 -01 -00 -02 -00 -00 -00 -06 -00 -cd -29 -01 -00 -02 -00 -00 -00 -06 -00 -d1 -29 -01 -00 -02 -00 -00 -00 -06 -00 -d5 -29 -01 -00 -02 -00 -00 -00 -06 -00 -d9 -29 -01 -00 -02 -00 -00 -00 -06 -00 -dd -29 -01 -00 -02 -00 -00 -00 -06 -00 -e1 -29 -01 -00 -02 -00 -00 -00 -06 -00 -e5 -29 -01 -00 -02 -00 -00 -00 -06 -00 -e9 -29 -01 -00 -02 -00 -00 -00 -06 -00 -ed -29 -01 -00 -02 -00 -00 -00 -06 -00 -f1 -29 -01 -00 -02 -00 -00 -00 -06 -00 -f5 -29 -01 -00 -02 -00 -00 -00 -06 -00 -f9 -29 -01 -00 -02 -00 -00 -00 -06 -00 -fd -29 -01 -00 -02 -00 -00 -00 -06 -00 -01 -2a -01 -00 -02 -00 -00 -00 -06 -00 -05 -2a -01 -00 -02 -00 -00 -00 -06 -00 -09 -2a -01 -00 -02 -00 -00 -00 -06 -00 -0d -2a -01 -00 -02 -00 -00 -00 -06 -00 -11 -2a -01 -00 -02 -00 -00 -00 -06 -00 -15 -2a -01 -00 -02 -00 -00 -00 -06 -00 -19 -2a -01 -00 -02 -00 -00 -00 -06 -00 -1d -2a -01 -00 -02 -00 -00 -00 -06 -00 -21 -2a -01 -00 -02 -00 -00 -00 -06 -00 -25 -2a -01 -00 -02 -00 -00 -00 -06 -00 -29 -2a -01 -00 -02 -00 -00 -00 -06 -00 -2d -2a -01 -00 -02 -00 -00 -00 -06 -00 -31 -2a -01 -00 -02 -00 -00 -00 -06 -00 -35 -2a -01 +00 00 02 00 @@ -104389,9 +86709,9 @@ fd 00 06 00 +78 39 -2a -01 +00 00 02 00 @@ -104399,9 +86719,1489 @@ fd 00 06 00 +7c +39 +00 +00 +02 +00 +00 +00 +06 +00 +80 +39 +00 +00 +02 +00 +00 +00 +06 +00 +84 +39 +00 +00 +02 +00 +00 +00 +06 +00 +88 +39 +00 +00 +02 +00 +00 +00 +06 +00 +8c +39 +00 +00 +02 +00 +00 +00 +06 +00 +90 +39 +00 +00 +02 +00 +00 +00 +06 +00 +94 +39 +00 +00 +02 +00 +00 +00 +06 +00 +98 +39 +00 +00 +02 +00 +00 +00 +06 +00 +9c +39 +00 +00 +02 +00 +00 +00 +06 +00 +a0 +39 +00 +00 +02 +00 +00 +00 +06 +00 +a4 +39 +00 +00 +02 +00 +00 +00 +06 +00 +a8 +39 +00 +00 +02 +00 +00 +00 +06 +00 +ac +39 +00 +00 +02 +00 +00 +00 +06 +00 +b0 +39 +00 +00 +02 +00 +00 +00 +06 +00 +b4 +39 +00 +00 +02 +00 +00 +00 +06 +00 +b8 +39 +00 +00 +02 +00 +00 +00 +06 +00 +bc +39 +00 +00 +02 +00 +00 +00 +06 +00 +c0 +39 +00 +00 +02 +00 +00 +00 +06 +00 +c4 +39 +00 +00 +02 +00 +00 +00 +06 +00 +c8 +39 +00 +00 +02 +00 +00 +00 +06 +00 +00 +3b +00 +00 +02 +00 +00 +00 +06 +00 +04 +3b +00 +00 +02 +00 +00 +00 +06 +00 +08 +3b +00 +00 +02 +00 +00 +00 +06 +00 +0c +3b +00 +00 +02 +00 +00 +00 +06 +00 +10 +3b +00 +00 +02 +00 +00 +00 +06 +00 +14 +3b +00 +00 +02 +00 +00 +00 +06 +00 +18 +3b +00 +00 +02 +00 +00 +00 +06 +00 +1c +3b +00 +00 +02 +00 +00 +00 +06 +00 +20 +3b +00 +00 +02 +00 +00 +00 +06 +00 +24 +3b +00 +00 +02 +00 +00 +00 +06 +00 +28 +3b +00 +00 +02 +00 +00 +00 +06 +00 +2c +3b +00 +00 +02 +00 +00 +00 +06 +00 +30 +3b +00 +00 +02 +00 +00 +00 +06 +00 +34 +3b +00 +00 +02 +00 +00 +00 +06 +00 +38 +3b +00 +00 +02 +00 +00 +00 +06 +00 +3c +3b +00 +00 +02 +00 +00 +00 +06 +00 +40 +3b +00 +00 +02 +00 +00 +00 +06 +00 +44 +3b +00 +00 +02 +00 +00 +00 +06 +00 +48 +3b +00 +00 +02 +00 +00 +00 +06 +00 +4c +3b +00 +00 +02 +00 +00 +00 +06 +00 +50 +3b +00 +00 +02 +00 +00 +00 +06 +00 +54 +3b +00 +00 +02 +00 +00 +00 +06 +00 +58 +3b +00 +00 +02 +00 +00 +00 +06 +00 +5c +3b +00 +00 +02 +00 +00 +00 +06 +00 +60 +3b +00 +00 +02 +00 +00 +00 +06 +00 +64 +3b +00 +00 +02 +00 +00 +00 +06 +00 +68 +3b +00 +00 +02 +00 +00 +00 +06 +00 +6c +3b +00 +00 +02 +00 +00 +00 +06 +00 +70 +3b +00 +00 +02 +00 +00 +00 +06 +00 +74 +3b +00 +00 +02 +00 +00 +00 +06 +00 +78 +3b +00 +00 +02 +00 +00 +00 +06 +00 +7c +3b +00 +00 +02 +00 +00 +00 +06 +00 +80 +3b +00 +00 +02 +00 +00 +00 +06 +00 +84 +3b +00 +00 +02 +00 +00 +00 +06 +00 +88 +3b +00 +00 +02 +00 +00 +00 +06 +00 +8c +3b +00 +00 +02 +00 +00 +00 +06 +00 +90 +3b +00 +00 +02 +00 +00 +00 +06 +00 +94 +3b +00 +00 +02 +00 +00 +00 +06 +00 +98 +3b +00 +00 +02 +00 +00 +00 +06 +00 +9c +3b +00 +00 +02 +00 +00 +00 +06 +00 +a0 +3b +00 +00 +02 +00 +00 +00 +06 +00 +a4 +3b +00 +00 +02 +00 +00 +00 +06 +00 +a8 +3b +00 +00 +02 +00 +00 +00 +06 +00 +ac +3b +00 +00 +02 +00 +00 +00 +06 +00 +b0 +3b +00 +00 +02 +00 +00 +00 +06 +00 +b4 +3b +00 +00 +02 +00 +00 +00 +06 +00 +b8 +3b +00 +00 +02 +00 +00 +00 +06 +00 +bc +3b +00 +00 +02 +00 +00 +00 +06 +00 +c0 +3b +00 +00 +02 +00 +00 +00 +06 +00 +c4 +3b +00 +00 +02 +00 +00 +00 +06 +00 +c8 +3b +00 +00 +02 +00 +00 +00 +06 +00 +cc +3b +00 +00 +02 +00 +00 +00 +06 +00 +d0 +3b +00 +00 +02 +00 +00 +00 +06 +00 +d4 +3b +00 +00 +02 +00 +00 +00 +06 +00 +d8 +3b +00 +00 +02 +00 +00 +00 +06 +00 +dc +3b +00 +00 +02 +00 +00 +00 +06 +00 +e0 +3b +00 +00 +02 +00 +00 +00 +06 +00 +e4 +3b +00 +00 +02 +00 +00 +00 +06 +00 +e8 +3b +00 +00 +02 +00 +00 +00 +06 +00 +ec +3b +00 +00 +02 +00 +00 +00 +06 +00 +f0 +3b +00 +00 +02 +00 +00 +00 +06 +00 +f4 +3b +00 +00 +02 +00 +00 +00 +06 +00 +f8 +3b +00 +00 +02 +00 +00 +00 +06 +00 +fc +3b +00 +00 +02 +00 +00 +00 +06 +00 +00 +3c +00 +00 +02 +00 +00 +00 +06 +00 +04 +3c +00 +00 +02 +00 +00 +00 +06 +00 +08 +3c +00 +00 +02 +00 +00 +00 +06 +00 +0c +3c +00 +00 +02 +00 +00 +00 +06 +00 +10 +3c +00 +00 +02 +00 +00 +00 +06 +00 +14 +3c +00 +00 +02 +00 +00 +00 +06 +00 +18 +3c +00 +00 +02 +00 +00 +00 +06 +00 +1c +3c +00 +00 +02 +00 +00 +00 +06 +00 +20 +3c +00 +00 +02 +00 +00 +00 +06 +00 +24 +3c +00 +00 +02 +00 +00 +00 +06 +00 +28 +3c +00 +00 +02 +00 +00 +00 +06 +00 +2c +3c +00 +00 +02 +00 +00 +00 +06 +00 +30 +3c +00 +00 +02 +00 +00 +00 +06 +00 +34 +3c +00 +00 +02 +00 +00 +00 +06 +00 +38 +3c +00 +00 +02 +00 +00 +00 +06 +00 +3c +3c +00 +00 +02 +00 +00 +00 +06 +00 +40 +3c +00 +00 +02 +00 +00 +00 +06 +00 +44 +3c +00 +00 +02 +00 +00 +00 +06 +00 +48 +3c +00 +00 +02 +00 +00 +00 +06 +00 +4c +3c +00 +00 +02 +00 +00 +00 +06 +00 +50 +3c +00 +00 +02 +00 +00 +00 +06 +00 +54 +3c +00 +00 +02 +00 +00 +00 +06 +00 +58 +3c +00 +00 +02 +00 +00 +00 +06 +00 +5c +3c +00 +00 +02 +00 +00 +00 +06 +00 +60 +3c +00 +00 +02 +00 +00 +00 +06 +00 +64 +3c +00 +00 +02 +00 +00 +00 +06 +00 +68 +3c +00 +00 +02 +00 +00 +00 +06 +00 +6c +3c +00 +00 +02 +00 +00 +00 +06 +00 +70 +3c +00 +00 +02 +00 +00 +00 +06 +00 +74 +3c +00 +00 +02 +00 +00 +00 +06 +00 +78 +3c +00 +00 +02 +00 +00 +00 +06 +00 +7c +3c +00 +00 +02 +00 +00 +00 +06 +00 +80 +3c +00 +00 +02 +00 +00 +00 +06 +00 +84 +3c +00 +00 +02 +00 +00 +00 +06 +00 +88 +3c +00 +00 +02 +00 +00 +00 +06 +00 +8c +3c +00 +00 +02 +00 +00 +00 +06 +00 +90 +3c +00 +00 +02 +00 +00 +00 +06 +00 +94 +3c +00 +00 +02 +00 +00 +00 +06 +00 +98 +3c +00 +00 +02 +00 +00 +00 +06 +00 +9c +3c +00 +00 +02 +00 +00 +00 +06 +00 +a0 +3c +00 +00 +02 +00 +00 +00 +06 +00 +a4 +3c +00 +00 +02 +00 +00 +00 +06 +00 +a8 +3c +00 +00 +02 +00 +00 +00 +06 +00 +ac +3c +00 +00 +02 +00 +00 +00 +06 +00 +b0 +3c +00 +00 +02 +00 +00 +00 +06 +00 +b4 +3c +00 +00 +02 +00 +00 +00 +06 +00 +b8 +3c +00 +00 +02 +00 +00 +00 +06 +00 +bc +3c +00 +00 +02 +00 +00 +00 +06 +00 +c0 +3c +00 +00 +02 +00 +00 +00 +06 +00 +c4 +3c +00 +00 +02 +00 +00 +00 +06 +00 +c8 +3c +00 +00 +02 +00 +00 +00 +06 +00 +cc +3c +00 +00 +02 +00 +00 +00 +06 +00 +d0 +3c +00 +00 +02 +00 +00 +00 +06 +00 +d4 +3c +00 +00 +02 +00 +00 +00 +06 +00 +d8 +3c +00 +00 +02 +00 +00 +00 +06 +00 +dc +3c +00 +00 +02 +00 +00 +00 +06 +00 +e0 +3c +00 +00 +02 +00 +00 +00 +06 +00 +e4 +3c +00 +00 +02 +00 +00 +00 +06 +00 +e8 +3c +00 +00 +02 +00 +00 +00 +06 +00 +ec +3c +00 +00 +02 +00 +00 +00 +06 +00 +f0 +3c +00 +00 +02 +00 +00 +00 +06 +00 +f4 +3c +00 +00 +02 +00 +00 +00 +06 +00 +f8 +3c +00 +00 +02 +00 +00 +00 +06 +00 +fc +3c +00 +00 +02 +00 +00 +00 +06 +00 +00 3d -2a -01 +00 00 02 00 @@ -104409,9 +88209,2559 @@ fd 00 06 00 +04 +3d +00 +00 +02 +00 +00 +00 +06 +00 +08 +3d +00 +00 +02 +00 +00 +00 +06 +00 +0c +3d +00 +00 +02 +00 +00 +00 +06 +00 +10 +3d +00 +00 +02 +00 +00 +00 +06 +00 +14 +3d +00 +00 +02 +00 +00 +00 +06 +00 +18 +3d +00 +00 +02 +00 +00 +00 +06 +00 +1c +3d +00 +00 +02 +00 +00 +00 +06 +00 +20 +3d +00 +00 +02 +00 +00 +00 +06 +00 +24 +3d +00 +00 +02 +00 +00 +00 +06 +00 +28 +3d +00 +00 +02 +00 +00 +00 +06 +00 +2c +3d +00 +00 +02 +00 +00 +00 +06 +00 +30 +3d +00 +00 +02 +00 +00 +00 +06 +00 +34 +3d +00 +00 +02 +00 +00 +00 +06 +00 +38 +3d +00 +00 +02 +00 +00 +00 +06 +00 +3c +3d +00 +00 +02 +00 +00 +00 +06 +00 +40 +3d +00 +00 +02 +00 +00 +00 +06 +00 +44 +3d +00 +00 +02 +00 +00 +00 +06 +00 +48 +3d +00 +00 +02 +00 +00 +00 +06 +00 +4c +3d +00 +00 +02 +00 +00 +00 +06 +00 +50 +3d +00 +00 +02 +00 +00 +00 +06 +00 +54 +3d +00 +00 +02 +00 +00 +00 +06 +00 +58 +3d +00 +00 +02 +00 +00 +00 +06 +00 +5c +3d +00 +00 +02 +00 +00 +00 +06 +00 +60 +3d +00 +00 +02 +00 +00 +00 +06 +00 +64 +3d +00 +00 +02 +00 +00 +00 +06 +00 +68 +3d +00 +00 +02 +00 +00 +00 +06 +00 +6c +3d +00 +00 +02 +00 +00 +00 +06 +00 +70 +3d +00 +00 +02 +00 +00 +00 +06 +00 +74 +3d +00 +00 +02 +00 +00 +00 +06 +00 +78 +3d +00 +00 +02 +00 +00 +00 +06 +00 +7c +3d +00 +00 +02 +00 +00 +00 +06 +00 +80 +3d +00 +00 +02 +00 +00 +00 +06 +00 +84 +3d +00 +00 +02 +00 +00 +00 +06 +00 +88 +3d +00 +00 +02 +00 +00 +00 +06 +00 +8c +3d +00 +00 +02 +00 +00 +00 +06 +00 +90 +3d +00 +00 +02 +00 +00 +00 +06 +00 +94 +3d +00 +00 +02 +00 +00 +00 +06 +00 +98 +3d +00 +00 +02 +00 +00 +00 +06 +00 +9c +3d +00 +00 +02 +00 +00 +00 +06 +00 +a0 +3d +00 +00 +02 +00 +00 +00 +06 +00 +a4 +3d +00 +00 +02 +00 +00 +00 +06 +00 +a8 +3d +00 +00 +02 +00 +00 +00 +06 +00 +ac +3d +00 +00 +02 +00 +00 +00 +06 +00 +b0 +3d +00 +00 +02 +00 +00 +00 +06 +00 +b4 +3d +00 +00 +02 +00 +00 +00 +06 +00 +b8 +3d +00 +00 +02 +00 +00 +00 +06 +00 +bc +3d +00 +00 +02 +00 +00 +00 +06 +00 +c0 +3d +00 +00 +02 +00 +00 +00 +06 +00 +c4 +3d +00 +00 +02 +00 +00 +00 +06 +00 +c8 +3d +00 +00 +02 +00 +00 +00 +06 +00 +cc +3d +00 +00 +02 +00 +00 +00 +06 +00 +d0 +3d +00 +00 +02 +00 +00 +00 +06 +00 +d4 +3d +00 +00 +02 +00 +00 +00 +06 +00 +d8 +3d +00 +00 +02 +00 +00 +00 +06 +00 +dc +3d +00 +00 +02 +00 +00 +00 +06 +00 +e0 +3d +00 +00 +02 +00 +00 +00 +06 +00 +e4 +3d +00 +00 +02 +00 +00 +00 +06 +00 +e8 +3d +00 +00 +02 +00 +00 +00 +06 +00 +ec +3d +00 +00 +02 +00 +00 +00 +06 +00 +f0 +3d +00 +00 +02 +00 +00 +00 +06 +00 +f4 +3d +00 +00 +02 +00 +00 +00 +06 +00 +f8 +3d +00 +00 +02 +00 +00 +00 +06 +00 +fc +3d +00 +00 +02 +00 +00 +00 +06 +00 +00 +3e +00 +00 +02 +00 +00 +00 +06 +00 +04 +3e +00 +00 +02 +00 +00 +00 +06 +00 +08 +3e +00 +00 +02 +00 +00 +00 +06 +00 +0c +3e +00 +00 +02 +00 +00 +00 +06 +00 +10 +3e +00 +00 +02 +00 +00 +00 +06 +00 +14 +3e +00 +00 +02 +00 +00 +00 +06 +00 +18 +3e +00 +00 +02 +00 +00 +00 +06 +00 +1c +3e +00 +00 +02 +00 +00 +00 +06 +00 +20 +3e +00 +00 +02 +00 +00 +00 +06 +00 +24 +3e +00 +00 +02 +00 +00 +00 +06 +00 +28 +3e +00 +00 +02 +00 +00 +00 +06 +00 +2c +3e +00 +00 +02 +00 +00 +00 +06 +00 +30 +3e +00 +00 +02 +00 +00 +00 +06 +00 +34 +3e +00 +00 +02 +00 +00 +00 +06 +00 +38 +3e +00 +00 +02 +00 +00 +00 +06 +00 +3c +3e +00 +00 +02 +00 +00 +00 +06 +00 +40 +3e +00 +00 +02 +00 +00 +00 +06 +00 +44 +3e +00 +00 +02 +00 +00 +00 +06 +00 +48 +3e +00 +00 +02 +00 +00 +00 +06 +00 +4c +3e +00 +00 +02 +00 +00 +00 +06 +00 +50 +3e +00 +00 +02 +00 +00 +00 +06 +00 +54 +3e +00 +00 +02 +00 +00 +00 +06 +00 +58 +3e +00 +00 +02 +00 +00 +00 +06 +00 +5c +3e +00 +00 +02 +00 +00 +00 +06 +00 +60 +3e +00 +00 +02 +00 +00 +00 +06 +00 +64 +3e +00 +00 +02 +00 +00 +00 +06 +00 +68 +3e +00 +00 +02 +00 +00 +00 +06 +00 +6c +3e +00 +00 +02 +00 +00 +00 +06 +00 +70 +3e +00 +00 +02 +00 +00 +00 +06 +00 +74 +3e +00 +00 +02 +00 +00 +00 +06 +00 +78 +3e +00 +00 +02 +00 +00 +00 +06 +00 +7c +3e +00 +00 +02 +00 +00 +00 +06 +00 +80 +3e +00 +00 +02 +00 +00 +00 +06 +00 +84 +3e +00 +00 +02 +00 +00 +00 +06 +00 +88 +3e +00 +00 +02 +00 +00 +00 +06 +00 +8c +3e +00 +00 +02 +00 +00 +00 +06 +00 +90 +3e +00 +00 +02 +00 +00 +00 +06 +00 +94 +3e +00 +00 +02 +00 +00 +00 +06 +00 +98 +3e +00 +00 +02 +00 +00 +00 +06 +00 +9c +3e +00 +00 +02 +00 +00 +00 +06 +00 +a0 +3e +00 +00 +02 +00 +00 +00 +06 +00 +a4 +3e +00 +00 +02 +00 +00 +00 +06 +00 +a8 +3e +00 +00 +02 +00 +00 +00 +06 +00 +ac +3e +00 +00 +02 +00 +00 +00 +06 +00 +b0 +3e +00 +00 +02 +00 +00 +00 +06 +00 +b4 +3e +00 +00 +02 +00 +00 +00 +06 +00 +b8 +3e +00 +00 +02 +00 +00 +00 +06 +00 +bc +3e +00 +00 +02 +00 +00 +00 +06 +00 +c0 +3e +00 +00 +02 +00 +00 +00 +06 +00 +c4 +3e +00 +00 +02 +00 +00 +00 +06 +00 +c8 +3e +00 +00 +02 +00 +00 +00 +06 +00 +cc +3e +00 +00 +02 +00 +00 +00 +06 +00 +d0 +3e +00 +00 +02 +00 +00 +00 +06 +00 +d4 +3e +00 +00 +02 +00 +00 +00 +06 +00 +d8 +3e +00 +00 +02 +00 +00 +00 +06 +00 +dc +3e +00 +00 +02 +00 +00 +00 +06 +00 +e0 +3e +00 +00 +02 +00 +00 +00 +06 +00 +e4 +3e +00 +00 +02 +00 +00 +00 +06 +00 +e8 +3e +00 +00 +02 +00 +00 +00 +06 +00 +ec +3e +00 +00 +02 +00 +00 +00 +06 +00 +f0 +3e +00 +00 +02 +00 +00 +00 +06 +00 +f4 +3e +00 +00 +02 +00 +00 +00 +06 +00 +f8 +3e +00 +00 +02 +00 +00 +00 +06 +00 +fc +3e +00 +00 +02 +00 +00 +00 +06 +00 +00 +3f +00 +00 +02 +00 +00 +00 +06 +00 +04 +3f +00 +00 +02 +00 +00 +00 +06 +00 +08 +3f +00 +00 +02 +00 +00 +00 +06 +00 +0c +3f +00 +00 +02 +00 +00 +00 +06 +00 +10 +3f +00 +00 +02 +00 +00 +00 +06 +00 +14 +3f +00 +00 +02 +00 +00 +00 +06 +00 +18 +3f +00 +00 +02 +00 +00 +00 +06 +00 +1c +3f +00 +00 +02 +00 +00 +00 +06 +00 +20 +3f +00 +00 +02 +00 +00 +00 +06 +00 +24 +3f +00 +00 +02 +00 +00 +00 +06 +00 +28 +3f +00 +00 +02 +00 +00 +00 +06 +00 +2c +3f +00 +00 +02 +00 +00 +00 +06 +00 +30 +3f +00 +00 +02 +00 +00 +00 +06 +00 +34 +3f +00 +00 +02 +00 +00 +00 +06 +00 +38 +3f +00 +00 +02 +00 +00 +00 +06 +00 +3c +3f +00 +00 +02 +00 +00 +00 +06 +00 +40 +3f +00 +00 +02 +00 +00 +00 +06 +00 +44 +3f +00 +00 +02 +00 +00 +00 +06 +00 +48 +3f +00 +00 +02 +00 +00 +00 +06 +00 +4c +3f +00 +00 +02 +00 +00 +00 +06 +00 +50 +3f +00 +00 +02 +00 +00 +00 +06 +00 +54 +3f +00 +00 +02 +00 +00 +00 +06 +00 +58 +3f +00 +00 +02 +00 +00 +00 +06 +00 +5c +3f +00 +00 +02 +00 +00 +00 +06 +00 +60 +3f +00 +00 +02 +00 +00 +00 +06 +00 +64 +3f +00 +00 +02 +00 +00 +00 +06 +00 +68 +3f +00 +00 +02 +00 +00 +00 +06 +00 +6c +3f +00 +00 +02 +00 +00 +00 +06 +00 +70 +3f +00 +00 +02 +00 +00 +00 +06 +00 +74 +3f +00 +00 +02 +00 +00 +00 +06 +00 +78 +3f +00 +00 +02 +00 +00 +00 +06 +00 +7c +3f +00 +00 +02 +00 +00 +00 +06 +00 +80 +3f +00 +00 +02 +00 +00 +00 +06 +00 +84 +3f +00 +00 +02 +00 +00 +00 +06 +00 +88 +3f +00 +00 +02 +00 +00 +00 +06 +00 +8c +3f +00 +00 +02 +00 +00 +00 +06 +00 +90 +3f +00 +00 +02 +00 +00 +00 +06 +00 +94 +3f +00 +00 +02 +00 +00 +00 +06 +00 +98 +3f +00 +00 +02 +00 +00 +00 +06 +00 +9c +3f +00 +00 +02 +00 +00 +00 +06 +00 +a0 +3f +00 +00 +02 +00 +00 +00 +06 +00 +a4 +3f +00 +00 +02 +00 +00 +00 +06 +00 +a8 +3f +00 +00 +02 +00 +00 +00 +06 +00 +ac +3f +00 +00 +02 +00 +00 +00 +06 +00 +b0 +3f +00 +00 +02 +00 +00 +00 +06 +00 +b4 +3f +00 +00 +02 +00 +00 +00 +06 +00 +b8 +3f +00 +00 +02 +00 +00 +00 +06 +00 +bc +3f +00 +00 +02 +00 +00 +00 +06 +00 +c0 +3f +00 +00 +02 +00 +00 +00 +06 +00 +c4 +3f +00 +00 +02 +00 +00 +00 +06 +00 +c8 +3f +00 +00 +02 +00 +00 +00 +06 +00 +cc +3f +00 +00 +02 +00 +00 +00 +06 +00 +d0 +3f +00 +00 +02 +00 +00 +00 +06 +00 +d4 +3f +00 +00 +02 +00 +00 +00 +06 +00 +d8 +3f +00 +00 +02 +00 +00 +00 +06 +00 +dc +3f +00 +00 +02 +00 +00 +00 +06 +00 +e0 +3f +00 +00 +02 +00 +00 +00 +06 +00 +e4 +3f +00 +00 +02 +00 +00 +00 +06 +00 +e8 +3f +00 +00 +02 +00 +00 +00 +06 +00 +ec +3f +00 +00 +02 +00 +00 +00 +06 +00 +f0 +3f +00 +00 +02 +00 +00 +00 +06 +00 +f4 +3f +00 +00 +02 +00 +00 +00 +06 +00 +f8 +3f +00 +00 +02 +00 +00 +00 +06 +00 +fc +3f +00 +00 +02 +00 +00 +00 +06 +00 +00 +40 +00 +00 +02 +00 +00 +00 +06 +00 +04 +40 +00 +00 +02 +00 +00 +00 +06 +00 +08 +40 +00 +00 +02 +00 +00 +00 +06 +00 +0c +40 +00 +00 +02 +00 +00 +00 +06 +00 +10 +40 +00 +00 +02 +00 +00 +00 +06 +00 +14 +40 +00 +00 +02 +00 +00 +00 +06 +00 +18 +40 +00 +00 +02 +00 +00 +00 +06 +00 +1c +40 +00 +00 +02 +00 +00 +00 +06 +00 +20 +40 +00 +00 +02 +00 +00 +00 +06 +00 +24 +40 +00 +00 +02 +00 +00 +00 +06 +00 +28 +40 +00 +00 +02 +00 +00 +00 +06 +00 +2c +40 +00 +00 +02 +00 +00 +00 +06 +00 +30 +40 +00 +00 +02 +00 +00 +00 +06 +00 +34 +40 +00 +00 +02 +00 +00 +00 +06 +00 +38 +40 +00 +00 +02 +00 +00 +00 +06 +00 +3c +40 +00 +00 +02 +00 +00 +00 +06 +00 +40 +40 +00 +00 +02 +00 +00 +00 +06 +00 +44 +40 +00 +00 +02 +00 +00 +00 +06 +00 +48 +40 +00 +00 +02 +00 +00 +00 +06 +00 +4c +40 +00 +00 +02 +00 +00 +00 +06 +00 +50 +40 +00 +00 +02 +00 +00 +00 +06 +00 +54 +40 +00 +00 +02 +00 +00 +00 +06 +00 +58 +40 +00 +00 +02 +00 +00 +00 +06 +00 +5c +40 +00 +00 +02 +00 +00 +00 +06 +00 +60 +40 +00 +00 +02 +00 +00 +00 +06 +00 +64 +40 +00 +00 +02 +00 +00 +00 +06 +00 +68 +40 +00 +00 +02 +00 +00 +00 +06 +00 +6c +40 +00 +00 +02 +00 +00 +00 +06 +00 +70 +40 +00 +00 +02 +00 +00 +00 +06 +00 +74 +40 +00 +00 +02 +00 +00 +00 +06 +00 +78 +40 +00 +00 +02 +00 +00 +00 +06 +00 +7c +40 +00 +00 +02 +00 +00 +00 +06 +00 +80 +40 +00 +00 +02 +00 +00 +00 +06 +00 +84 +40 +00 +00 +02 +00 +00 +00 +06 +00 +88 +40 +00 +00 +02 +00 +00 +00 +06 +00 +8c +40 +00 +00 +02 +00 +00 +00 +06 +00 +90 +40 +00 +00 +02 +00 +00 +00 +06 +00 +94 +40 +00 +00 +02 +00 +00 +00 +06 +00 +98 +40 +00 +00 +02 +00 +00 +00 +06 +00 +9c +40 +00 +00 +02 +00 +00 +00 +06 +00 +a0 +40 +00 +00 +02 +00 +00 +00 +06 +00 +a4 +40 +00 +00 +02 +00 +00 +00 +06 +00 +a8 +40 +00 +00 +02 +00 +00 +00 +06 +00 +ac +40 +00 +00 +02 +00 +00 +00 +06 +00 +b0 +40 +00 +00 +02 +00 +00 +00 +06 +00 +b4 +40 +00 +00 +02 +00 +00 +00 +06 +00 +b8 +40 +00 +00 +02 +00 +00 +00 +06 +00 +bc +40 +00 +00 +02 +00 +00 +00 +06 +00 +c0 +40 +00 +00 +02 +00 +00 +00 +06 +00 +c4 +40 +00 +00 +02 +00 +00 +00 +06 +00 +c8 +40 +00 +00 +02 +00 +00 +00 +06 +00 +cc +40 +00 +00 +02 +00 +00 +00 +06 +00 +d0 +40 +00 +00 +02 +00 +00 +00 +06 +00 +d4 +40 +00 +00 +02 +00 +00 +00 +06 +00 +d8 +40 +00 +00 +02 +00 +00 +00 +06 +00 +dc +40 +00 +00 +02 +00 +00 +00 +06 +00 +e0 +40 +00 +00 +02 +00 +00 +00 +06 +00 +e4 +40 +00 +00 +02 +00 +00 +00 +06 +00 +e8 +40 +00 +00 +02 +00 +00 +00 +06 +00 +ec +40 +00 +00 +02 +00 +00 +00 +06 +00 +f0 +40 +00 +00 +02 +00 +00 +00 +06 +00 +f4 +40 +00 +00 +02 +00 +00 +00 +06 +00 +f8 +40 +00 +00 +02 +00 +00 +00 +06 +00 +fc +40 +00 +00 +02 +00 +00 +00 +06 +00 +00 41 -2a -01 +00 00 02 00 @@ -104419,9 +90769,2559 @@ fd 00 06 00 +04 +41 +00 +00 +02 +00 +00 +00 +06 +00 +08 +41 +00 +00 +02 +00 +00 +00 +06 +00 +0c +41 +00 +00 +02 +00 +00 +00 +06 +00 +10 +41 +00 +00 +02 +00 +00 +00 +06 +00 +14 +41 +00 +00 +02 +00 +00 +00 +06 +00 +18 +41 +00 +00 +02 +00 +00 +00 +06 +00 +1c +41 +00 +00 +02 +00 +00 +00 +06 +00 +20 +41 +00 +00 +02 +00 +00 +00 +06 +00 +24 +41 +00 +00 +02 +00 +00 +00 +06 +00 +28 +41 +00 +00 +02 +00 +00 +00 +06 +00 +2c +41 +00 +00 +02 +00 +00 +00 +06 +00 +30 +41 +00 +00 +02 +00 +00 +00 +06 +00 +34 +41 +00 +00 +02 +00 +00 +00 +06 +00 +38 +41 +00 +00 +02 +00 +00 +00 +06 +00 +3c +41 +00 +00 +02 +00 +00 +00 +06 +00 +40 +41 +00 +00 +02 +00 +00 +00 +06 +00 +44 +41 +00 +00 +02 +00 +00 +00 +06 +00 +48 +41 +00 +00 +02 +00 +00 +00 +06 +00 +4c +41 +00 +00 +02 +00 +00 +00 +06 +00 +50 +41 +00 +00 +02 +00 +00 +00 +06 +00 +54 +41 +00 +00 +02 +00 +00 +00 +06 +00 +58 +41 +00 +00 +02 +00 +00 +00 +06 +00 +5c +41 +00 +00 +02 +00 +00 +00 +06 +00 +60 +41 +00 +00 +02 +00 +00 +00 +06 +00 +64 +41 +00 +00 +02 +00 +00 +00 +06 +00 +68 +41 +00 +00 +02 +00 +00 +00 +06 +00 +6c +41 +00 +00 +02 +00 +00 +00 +06 +00 +70 +41 +00 +00 +02 +00 +00 +00 +06 +00 +74 +41 +00 +00 +02 +00 +00 +00 +06 +00 +78 +41 +00 +00 +02 +00 +00 +00 +06 +00 +7c +41 +00 +00 +02 +00 +00 +00 +06 +00 +80 +41 +00 +00 +02 +00 +00 +00 +06 +00 +84 +41 +00 +00 +02 +00 +00 +00 +06 +00 +88 +41 +00 +00 +02 +00 +00 +00 +06 +00 +8c +41 +00 +00 +02 +00 +00 +00 +06 +00 +90 +41 +00 +00 +02 +00 +00 +00 +06 +00 +94 +41 +00 +00 +02 +00 +00 +00 +06 +00 +98 +41 +00 +00 +02 +00 +00 +00 +06 +00 +9c +41 +00 +00 +02 +00 +00 +00 +06 +00 +a0 +41 +00 +00 +02 +00 +00 +00 +06 +00 +a4 +41 +00 +00 +02 +00 +00 +00 +06 +00 +a8 +41 +00 +00 +02 +00 +00 +00 +06 +00 +ac +41 +00 +00 +02 +00 +00 +00 +06 +00 +b0 +41 +00 +00 +02 +00 +00 +00 +06 +00 +b4 +41 +00 +00 +02 +00 +00 +00 +06 +00 +b8 +41 +00 +00 +02 +00 +00 +00 +06 +00 +bc +41 +00 +00 +02 +00 +00 +00 +06 +00 +c0 +41 +00 +00 +02 +00 +00 +00 +06 +00 +c4 +41 +00 +00 +02 +00 +00 +00 +06 +00 +c8 +41 +00 +00 +02 +00 +00 +00 +06 +00 +cc +41 +00 +00 +02 +00 +00 +00 +06 +00 +d0 +41 +00 +00 +02 +00 +00 +00 +06 +00 +d4 +41 +00 +00 +02 +00 +00 +00 +06 +00 +d8 +41 +00 +00 +02 +00 +00 +00 +06 +00 +dc +41 +00 +00 +02 +00 +00 +00 +06 +00 +e0 +41 +00 +00 +02 +00 +00 +00 +06 +00 +e4 +41 +00 +00 +02 +00 +00 +00 +06 +00 +e8 +41 +00 +00 +02 +00 +00 +00 +06 +00 +ec +41 +00 +00 +02 +00 +00 +00 +06 +00 +f0 +41 +00 +00 +02 +00 +00 +00 +06 +00 +f4 +41 +00 +00 +02 +00 +00 +00 +06 +00 +f8 +41 +00 +00 +02 +00 +00 +00 +06 +00 +fc +41 +00 +00 +02 +00 +00 +00 +06 +00 +00 +42 +00 +00 +02 +00 +00 +00 +06 +00 +04 +42 +00 +00 +02 +00 +00 +00 +06 +00 +08 +42 +00 +00 +02 +00 +00 +00 +06 +00 +0c +42 +00 +00 +02 +00 +00 +00 +06 +00 +10 +42 +00 +00 +02 +00 +00 +00 +06 +00 +14 +42 +00 +00 +02 +00 +00 +00 +06 +00 +18 +42 +00 +00 +02 +00 +00 +00 +06 +00 +1c +42 +00 +00 +02 +00 +00 +00 +06 +00 +20 +42 +00 +00 +02 +00 +00 +00 +06 +00 +24 +42 +00 +00 +02 +00 +00 +00 +06 +00 +28 +42 +00 +00 +02 +00 +00 +00 +06 +00 +2c +42 +00 +00 +02 +00 +00 +00 +06 +00 +30 +42 +00 +00 +02 +00 +00 +00 +06 +00 +34 +42 +00 +00 +02 +00 +00 +00 +06 +00 +38 +42 +00 +00 +02 +00 +00 +00 +06 +00 +3c +42 +00 +00 +02 +00 +00 +00 +06 +00 +40 +42 +00 +00 +02 +00 +00 +00 +06 +00 +44 +42 +00 +00 +02 +00 +00 +00 +06 +00 +48 +42 +00 +00 +02 +00 +00 +00 +06 +00 +4c +42 +00 +00 +02 +00 +00 +00 +06 +00 +50 +42 +00 +00 +02 +00 +00 +00 +06 +00 +54 +42 +00 +00 +02 +00 +00 +00 +06 +00 +58 +42 +00 +00 +02 +00 +00 +00 +06 +00 +5c +42 +00 +00 +02 +00 +00 +00 +06 +00 +60 +42 +00 +00 +02 +00 +00 +00 +06 +00 +64 +42 +00 +00 +02 +00 +00 +00 +06 +00 +68 +42 +00 +00 +02 +00 +00 +00 +06 +00 +6c +42 +00 +00 +02 +00 +00 +00 +06 +00 +70 +42 +00 +00 +02 +00 +00 +00 +06 +00 +74 +42 +00 +00 +02 +00 +00 +00 +06 +00 +78 +42 +00 +00 +02 +00 +00 +00 +06 +00 +7c +42 +00 +00 +02 +00 +00 +00 +06 +00 +80 +42 +00 +00 +02 +00 +00 +00 +06 +00 +84 +42 +00 +00 +02 +00 +00 +00 +06 +00 +88 +42 +00 +00 +02 +00 +00 +00 +06 +00 +8c +42 +00 +00 +02 +00 +00 +00 +06 +00 +90 +42 +00 +00 +02 +00 +00 +00 +06 +00 +94 +42 +00 +00 +02 +00 +00 +00 +06 +00 +98 +42 +00 +00 +02 +00 +00 +00 +06 +00 +9c +42 +00 +00 +02 +00 +00 +00 +06 +00 +a0 +42 +00 +00 +02 +00 +00 +00 +06 +00 +a4 +42 +00 +00 +02 +00 +00 +00 +06 +00 +a8 +42 +00 +00 +02 +00 +00 +00 +06 +00 +ac +42 +00 +00 +02 +00 +00 +00 +06 +00 +b0 +42 +00 +00 +02 +00 +00 +00 +06 +00 +b4 +42 +00 +00 +02 +00 +00 +00 +06 +00 +b8 +42 +00 +00 +02 +00 +00 +00 +06 +00 +bc +42 +00 +00 +02 +00 +00 +00 +06 +00 +c0 +42 +00 +00 +02 +00 +00 +00 +06 +00 +c4 +42 +00 +00 +02 +00 +00 +00 +06 +00 +c8 +42 +00 +00 +02 +00 +00 +00 +06 +00 +cc +42 +00 +00 +02 +00 +00 +00 +06 +00 +d0 +42 +00 +00 +02 +00 +00 +00 +06 +00 +d4 +42 +00 +00 +02 +00 +00 +00 +06 +00 +d8 +42 +00 +00 +02 +00 +00 +00 +06 +00 +dc +42 +00 +00 +02 +00 +00 +00 +06 +00 +e0 +42 +00 +00 +02 +00 +00 +00 +06 +00 +e4 +42 +00 +00 +02 +00 +00 +00 +06 +00 +e8 +42 +00 +00 +02 +00 +00 +00 +06 +00 +ec +42 +00 +00 +02 +00 +00 +00 +06 +00 +f0 +42 +00 +00 +02 +00 +00 +00 +06 +00 +f4 +42 +00 +00 +02 +00 +00 +00 +06 +00 +f8 +42 +00 +00 +02 +00 +00 +00 +06 +00 +fc +42 +00 +00 +02 +00 +00 +00 +06 +00 +00 +43 +00 +00 +02 +00 +00 +00 +06 +00 +04 +43 +00 +00 +02 +00 +00 +00 +06 +00 +08 +43 +00 +00 +02 +00 +00 +00 +06 +00 +0c +43 +00 +00 +02 +00 +00 +00 +06 +00 +10 +43 +00 +00 +02 +00 +00 +00 +06 +00 +14 +43 +00 +00 +02 +00 +00 +00 +06 +00 +18 +43 +00 +00 +02 +00 +00 +00 +06 +00 +1c +43 +00 +00 +02 +00 +00 +00 +06 +00 +20 +43 +00 +00 +02 +00 +00 +00 +06 +00 +24 +43 +00 +00 +02 +00 +00 +00 +06 +00 +28 +43 +00 +00 +02 +00 +00 +00 +06 +00 +2c +43 +00 +00 +02 +00 +00 +00 +06 +00 +30 +43 +00 +00 +02 +00 +00 +00 +06 +00 +34 +43 +00 +00 +02 +00 +00 +00 +06 +00 +38 +43 +00 +00 +02 +00 +00 +00 +06 +00 +3c +43 +00 +00 +02 +00 +00 +00 +06 +00 +40 +43 +00 +00 +02 +00 +00 +00 +06 +00 +44 +43 +00 +00 +02 +00 +00 +00 +06 +00 +48 +43 +00 +00 +02 +00 +00 +00 +06 +00 +4c +43 +00 +00 +02 +00 +00 +00 +06 +00 +50 +43 +00 +00 +02 +00 +00 +00 +06 +00 +54 +43 +00 +00 +02 +00 +00 +00 +06 +00 +58 +43 +00 +00 +02 +00 +00 +00 +06 +00 +5c +43 +00 +00 +02 +00 +00 +00 +06 +00 +60 +43 +00 +00 +02 +00 +00 +00 +06 +00 +64 +43 +00 +00 +02 +00 +00 +00 +06 +00 +68 +43 +00 +00 +02 +00 +00 +00 +06 +00 +6c +43 +00 +00 +02 +00 +00 +00 +06 +00 +70 +43 +00 +00 +02 +00 +00 +00 +06 +00 +74 +43 +00 +00 +02 +00 +00 +00 +06 +00 +78 +43 +00 +00 +02 +00 +00 +00 +06 +00 +7c +43 +00 +00 +02 +00 +00 +00 +06 +00 +80 +43 +00 +00 +02 +00 +00 +00 +06 +00 +84 +43 +00 +00 +02 +00 +00 +00 +06 +00 +88 +43 +00 +00 +02 +00 +00 +00 +06 +00 +8c +43 +00 +00 +02 +00 +00 +00 +06 +00 +90 +43 +00 +00 +02 +00 +00 +00 +06 +00 +94 +43 +00 +00 +02 +00 +00 +00 +06 +00 +98 +43 +00 +00 +02 +00 +00 +00 +06 +00 +9c +43 +00 +00 +02 +00 +00 +00 +06 +00 +a0 +43 +00 +00 +02 +00 +00 +00 +06 +00 +a4 +43 +00 +00 +02 +00 +00 +00 +06 +00 +a8 +43 +00 +00 +02 +00 +00 +00 +06 +00 +ac +43 +00 +00 +02 +00 +00 +00 +06 +00 +b0 +43 +00 +00 +02 +00 +00 +00 +06 +00 +b4 +43 +00 +00 +02 +00 +00 +00 +06 +00 +b8 +43 +00 +00 +02 +00 +00 +00 +06 +00 +bc +43 +00 +00 +02 +00 +00 +00 +06 +00 +c0 +43 +00 +00 +02 +00 +00 +00 +06 +00 +c4 +43 +00 +00 +02 +00 +00 +00 +06 +00 +c8 +43 +00 +00 +02 +00 +00 +00 +06 +00 +cc +43 +00 +00 +02 +00 +00 +00 +06 +00 +d0 +43 +00 +00 +02 +00 +00 +00 +06 +00 +d4 +43 +00 +00 +02 +00 +00 +00 +06 +00 +d8 +43 +00 +00 +02 +00 +00 +00 +06 +00 +dc +43 +00 +00 +02 +00 +00 +00 +06 +00 +e0 +43 +00 +00 +02 +00 +00 +00 +06 +00 +e4 +43 +00 +00 +02 +00 +00 +00 +06 +00 +e8 +43 +00 +00 +02 +00 +00 +00 +06 +00 +ec +43 +00 +00 +02 +00 +00 +00 +06 +00 +f0 +43 +00 +00 +02 +00 +00 +00 +06 +00 +f4 +43 +00 +00 +02 +00 +00 +00 +06 +00 +f8 +43 +00 +00 +02 +00 +00 +00 +06 +00 +fc +43 +00 +00 +02 +00 +00 +00 +06 +00 +00 +44 +00 +00 +02 +00 +00 +00 +06 +00 +04 +44 +00 +00 +02 +00 +00 +00 +06 +00 +08 +44 +00 +00 +02 +00 +00 +00 +06 +00 +0c +44 +00 +00 +02 +00 +00 +00 +06 +00 +10 +44 +00 +00 +02 +00 +00 +00 +06 +00 +14 +44 +00 +00 +02 +00 +00 +00 +06 +00 +18 +44 +00 +00 +02 +00 +00 +00 +06 +00 +1c +44 +00 +00 +02 +00 +00 +00 +06 +00 +20 +44 +00 +00 +02 +00 +00 +00 +06 +00 +24 +44 +00 +00 +02 +00 +00 +00 +06 +00 +28 +44 +00 +00 +02 +00 +00 +00 +06 +00 +2c +44 +00 +00 +02 +00 +00 +00 +06 +00 +30 +44 +00 +00 +02 +00 +00 +00 +06 +00 +34 +44 +00 +00 +02 +00 +00 +00 +06 +00 +38 +44 +00 +00 +02 +00 +00 +00 +06 +00 +3c +44 +00 +00 +02 +00 +00 +00 +06 +00 +40 +44 +00 +00 +02 +00 +00 +00 +06 +00 +44 +44 +00 +00 +02 +00 +00 +00 +06 +00 +48 +44 +00 +00 +02 +00 +00 +00 +06 +00 +4c +44 +00 +00 +02 +00 +00 +00 +06 +00 +50 +44 +00 +00 +02 +00 +00 +00 +06 +00 +54 +44 +00 +00 +02 +00 +00 +00 +06 +00 +58 +44 +00 +00 +02 +00 +00 +00 +06 +00 +5c +44 +00 +00 +02 +00 +00 +00 +06 +00 +60 +44 +00 +00 +02 +00 +00 +00 +06 +00 +64 +44 +00 +00 +02 +00 +00 +00 +06 +00 +68 +44 +00 +00 +02 +00 +00 +00 +06 +00 +6c +44 +00 +00 +02 +00 +00 +00 +06 +00 +70 +44 +00 +00 +02 +00 +00 +00 +06 +00 +74 +44 +00 +00 +02 +00 +00 +00 +06 +00 +78 +44 +00 +00 +02 +00 +00 +00 +06 +00 +7c +44 +00 +00 +02 +00 +00 +00 +06 +00 +80 +44 +00 +00 +02 +00 +00 +00 +06 +00 +84 +44 +00 +00 +02 +00 +00 +00 +06 +00 +88 +44 +00 +00 +02 +00 +00 +00 +06 +00 +8c +44 +00 +00 +02 +00 +00 +00 +06 +00 +90 +44 +00 +00 +02 +00 +00 +00 +06 +00 +94 +44 +00 +00 +02 +00 +00 +00 +06 +00 +98 +44 +00 +00 +02 +00 +00 +00 +06 +00 +9c +44 +00 +00 +02 +00 +00 +00 +06 +00 +a0 +44 +00 +00 +02 +00 +00 +00 +06 +00 +a4 +44 +00 +00 +02 +00 +00 +00 +06 +00 +a8 +44 +00 +00 +02 +00 +00 +00 +06 +00 +ac +44 +00 +00 +02 +00 +00 +00 +06 +00 +b0 +44 +00 +00 +02 +00 +00 +00 +06 +00 +b4 +44 +00 +00 +02 +00 +00 +00 +06 +00 +b8 +44 +00 +00 +02 +00 +00 +00 +06 +00 +bc +44 +00 +00 +02 +00 +00 +00 +06 +00 +c0 +44 +00 +00 +02 +00 +00 +00 +06 +00 +c4 +44 +00 +00 +02 +00 +00 +00 +06 +00 +c8 +44 +00 +00 +02 +00 +00 +00 +06 +00 +cc +44 +00 +00 +02 +00 +00 +00 +06 +00 +d0 +44 +00 +00 +02 +00 +00 +00 +06 +00 +d4 +44 +00 +00 +02 +00 +00 +00 +06 +00 +d8 +44 +00 +00 +02 +00 +00 +00 +06 +00 +dc +44 +00 +00 +02 +00 +00 +00 +06 +00 +e0 +44 +00 +00 +02 +00 +00 +00 +06 +00 +e4 +44 +00 +00 +02 +00 +00 +00 +06 +00 +e8 +44 +00 +00 +02 +00 +00 +00 +06 +00 +ec +44 +00 +00 +02 +00 +00 +00 +06 +00 +f0 +44 +00 +00 +02 +00 +00 +00 +06 +00 +f4 +44 +00 +00 +02 +00 +00 +00 +06 +00 +f8 +44 +00 +00 +02 +00 +00 +00 +06 +00 +fc +44 +00 +00 +02 +00 +00 +00 +06 +00 +00 45 -2a -01 +00 00 02 00 @@ -104429,9 +93329,2559 @@ fd 00 06 00 +04 +45 +00 +00 +02 +00 +00 +00 +06 +00 +08 +45 +00 +00 +02 +00 +00 +00 +06 +00 +0c +45 +00 +00 +02 +00 +00 +00 +06 +00 +10 +45 +00 +00 +02 +00 +00 +00 +06 +00 +14 +45 +00 +00 +02 +00 +00 +00 +06 +00 +18 +45 +00 +00 +02 +00 +00 +00 +06 +00 +1c +45 +00 +00 +02 +00 +00 +00 +06 +00 +20 +45 +00 +00 +02 +00 +00 +00 +06 +00 +24 +45 +00 +00 +02 +00 +00 +00 +06 +00 +28 +45 +00 +00 +02 +00 +00 +00 +06 +00 +2c +45 +00 +00 +02 +00 +00 +00 +06 +00 +30 +45 +00 +00 +02 +00 +00 +00 +06 +00 +34 +45 +00 +00 +02 +00 +00 +00 +06 +00 +38 +45 +00 +00 +02 +00 +00 +00 +06 +00 +3c +45 +00 +00 +02 +00 +00 +00 +06 +00 +40 +45 +00 +00 +02 +00 +00 +00 +06 +00 +44 +45 +00 +00 +02 +00 +00 +00 +06 +00 +48 +45 +00 +00 +02 +00 +00 +00 +06 +00 +4c +45 +00 +00 +02 +00 +00 +00 +06 +00 +50 +45 +00 +00 +02 +00 +00 +00 +06 +00 +54 +45 +00 +00 +02 +00 +00 +00 +06 +00 +58 +45 +00 +00 +02 +00 +00 +00 +06 +00 +5c +45 +00 +00 +02 +00 +00 +00 +06 +00 +60 +45 +00 +00 +02 +00 +00 +00 +06 +00 +64 +45 +00 +00 +02 +00 +00 +00 +06 +00 +68 +45 +00 +00 +02 +00 +00 +00 +06 +00 +6c +45 +00 +00 +02 +00 +00 +00 +06 +00 +70 +45 +00 +00 +02 +00 +00 +00 +06 +00 +74 +45 +00 +00 +02 +00 +00 +00 +06 +00 +78 +45 +00 +00 +02 +00 +00 +00 +06 +00 +7c +45 +00 +00 +02 +00 +00 +00 +06 +00 +80 +45 +00 +00 +02 +00 +00 +00 +06 +00 +84 +45 +00 +00 +02 +00 +00 +00 +06 +00 +88 +45 +00 +00 +02 +00 +00 +00 +06 +00 +8c +45 +00 +00 +02 +00 +00 +00 +06 +00 +90 +45 +00 +00 +02 +00 +00 +00 +06 +00 +94 +45 +00 +00 +02 +00 +00 +00 +06 +00 +98 +45 +00 +00 +02 +00 +00 +00 +06 +00 +9c +45 +00 +00 +02 +00 +00 +00 +06 +00 +a0 +45 +00 +00 +02 +00 +00 +00 +06 +00 +a4 +45 +00 +00 +02 +00 +00 +00 +06 +00 +a8 +45 +00 +00 +02 +00 +00 +00 +06 +00 +ac +45 +00 +00 +02 +00 +00 +00 +06 +00 +b0 +45 +00 +00 +02 +00 +00 +00 +06 +00 +b4 +45 +00 +00 +02 +00 +00 +00 +06 +00 +b8 +45 +00 +00 +02 +00 +00 +00 +06 +00 +bc +45 +00 +00 +02 +00 +00 +00 +06 +00 +c0 +45 +00 +00 +02 +00 +00 +00 +06 +00 +c4 +45 +00 +00 +02 +00 +00 +00 +06 +00 +c8 +45 +00 +00 +02 +00 +00 +00 +06 +00 +cc +45 +00 +00 +02 +00 +00 +00 +06 +00 +d0 +45 +00 +00 +02 +00 +00 +00 +06 +00 +d4 +45 +00 +00 +02 +00 +00 +00 +06 +00 +d8 +45 +00 +00 +02 +00 +00 +00 +06 +00 +dc +45 +00 +00 +02 +00 +00 +00 +06 +00 +e0 +45 +00 +00 +02 +00 +00 +00 +06 +00 +e4 +45 +00 +00 +02 +00 +00 +00 +06 +00 +e8 +45 +00 +00 +02 +00 +00 +00 +06 +00 +ec +45 +00 +00 +02 +00 +00 +00 +06 +00 +f0 +45 +00 +00 +02 +00 +00 +00 +06 +00 +f4 +45 +00 +00 +02 +00 +00 +00 +06 +00 +f8 +45 +00 +00 +02 +00 +00 +00 +06 +00 +fc +45 +00 +00 +02 +00 +00 +00 +06 +00 +00 +46 +00 +00 +02 +00 +00 +00 +06 +00 +04 +46 +00 +00 +02 +00 +00 +00 +06 +00 +08 +46 +00 +00 +02 +00 +00 +00 +06 +00 +0c +46 +00 +00 +02 +00 +00 +00 +06 +00 +10 +46 +00 +00 +02 +00 +00 +00 +06 +00 +14 +46 +00 +00 +02 +00 +00 +00 +06 +00 +18 +46 +00 +00 +02 +00 +00 +00 +06 +00 +1c +46 +00 +00 +02 +00 +00 +00 +06 +00 +20 +46 +00 +00 +02 +00 +00 +00 +06 +00 +24 +46 +00 +00 +02 +00 +00 +00 +06 +00 +28 +46 +00 +00 +02 +00 +00 +00 +06 +00 +2c +46 +00 +00 +02 +00 +00 +00 +06 +00 +30 +46 +00 +00 +02 +00 +00 +00 +06 +00 +34 +46 +00 +00 +02 +00 +00 +00 +06 +00 +38 +46 +00 +00 +02 +00 +00 +00 +06 +00 +3c +46 +00 +00 +02 +00 +00 +00 +06 +00 +40 +46 +00 +00 +02 +00 +00 +00 +06 +00 +44 +46 +00 +00 +02 +00 +00 +00 +06 +00 +48 +46 +00 +00 +02 +00 +00 +00 +06 +00 +4c +46 +00 +00 +02 +00 +00 +00 +06 +00 +50 +46 +00 +00 +02 +00 +00 +00 +06 +00 +54 +46 +00 +00 +02 +00 +00 +00 +06 +00 +58 +46 +00 +00 +02 +00 +00 +00 +06 +00 +5c +46 +00 +00 +02 +00 +00 +00 +06 +00 +60 +46 +00 +00 +02 +00 +00 +00 +06 +00 +64 +46 +00 +00 +02 +00 +00 +00 +06 +00 +68 +46 +00 +00 +02 +00 +00 +00 +06 +00 +6c +46 +00 +00 +02 +00 +00 +00 +06 +00 +70 +46 +00 +00 +02 +00 +00 +00 +06 +00 +74 +46 +00 +00 +02 +00 +00 +00 +06 +00 +78 +46 +00 +00 +02 +00 +00 +00 +06 +00 +7c +46 +00 +00 +02 +00 +00 +00 +06 +00 +80 +46 +00 +00 +02 +00 +00 +00 +06 +00 +84 +46 +00 +00 +02 +00 +00 +00 +06 +00 +88 +46 +00 +00 +02 +00 +00 +00 +06 +00 +8c +46 +00 +00 +02 +00 +00 +00 +06 +00 +90 +46 +00 +00 +02 +00 +00 +00 +06 +00 +94 +46 +00 +00 +02 +00 +00 +00 +06 +00 +98 +46 +00 +00 +02 +00 +00 +00 +06 +00 +9c +46 +00 +00 +02 +00 +00 +00 +06 +00 +a0 +46 +00 +00 +02 +00 +00 +00 +06 +00 +a4 +46 +00 +00 +02 +00 +00 +00 +06 +00 +a8 +46 +00 +00 +02 +00 +00 +00 +06 +00 +ac +46 +00 +00 +02 +00 +00 +00 +06 +00 +b0 +46 +00 +00 +02 +00 +00 +00 +06 +00 +b4 +46 +00 +00 +02 +00 +00 +00 +06 +00 +b8 +46 +00 +00 +02 +00 +00 +00 +06 +00 +bc +46 +00 +00 +02 +00 +00 +00 +06 +00 +c0 +46 +00 +00 +02 +00 +00 +00 +06 +00 +c4 +46 +00 +00 +02 +00 +00 +00 +06 +00 +c8 +46 +00 +00 +02 +00 +00 +00 +06 +00 +cc +46 +00 +00 +02 +00 +00 +00 +06 +00 +d0 +46 +00 +00 +02 +00 +00 +00 +06 +00 +d4 +46 +00 +00 +02 +00 +00 +00 +06 +00 +d8 +46 +00 +00 +02 +00 +00 +00 +06 +00 +dc +46 +00 +00 +02 +00 +00 +00 +06 +00 +e0 +46 +00 +00 +02 +00 +00 +00 +06 +00 +e4 +46 +00 +00 +02 +00 +00 +00 +06 +00 +e8 +46 +00 +00 +02 +00 +00 +00 +06 +00 +ec +46 +00 +00 +02 +00 +00 +00 +06 +00 +f0 +46 +00 +00 +02 +00 +00 +00 +06 +00 +f4 +46 +00 +00 +02 +00 +00 +00 +06 +00 +f8 +46 +00 +00 +02 +00 +00 +00 +06 +00 +fc +46 +00 +00 +02 +00 +00 +00 +06 +00 +00 +47 +00 +00 +02 +00 +00 +00 +06 +00 +04 +47 +00 +00 +02 +00 +00 +00 +06 +00 +08 +47 +00 +00 +02 +00 +00 +00 +06 +00 +0c +47 +00 +00 +02 +00 +00 +00 +06 +00 +10 +47 +00 +00 +02 +00 +00 +00 +06 +00 +14 +47 +00 +00 +02 +00 +00 +00 +06 +00 +18 +47 +00 +00 +02 +00 +00 +00 +06 +00 +1c +47 +00 +00 +02 +00 +00 +00 +06 +00 +20 +47 +00 +00 +02 +00 +00 +00 +06 +00 +24 +47 +00 +00 +02 +00 +00 +00 +06 +00 +28 +47 +00 +00 +02 +00 +00 +00 +06 +00 +2c +47 +00 +00 +02 +00 +00 +00 +06 +00 +30 +47 +00 +00 +02 +00 +00 +00 +06 +00 +34 +47 +00 +00 +02 +00 +00 +00 +06 +00 +38 +47 +00 +00 +02 +00 +00 +00 +06 +00 +3c +47 +00 +00 +02 +00 +00 +00 +06 +00 +40 +47 +00 +00 +02 +00 +00 +00 +06 +00 +44 +47 +00 +00 +02 +00 +00 +00 +06 +00 +48 +47 +00 +00 +02 +00 +00 +00 +06 +00 +4c +47 +00 +00 +02 +00 +00 +00 +06 +00 +50 +47 +00 +00 +02 +00 +00 +00 +06 +00 +54 +47 +00 +00 +02 +00 +00 +00 +06 +00 +58 +47 +00 +00 +02 +00 +00 +00 +06 +00 +5c +47 +00 +00 +02 +00 +00 +00 +06 +00 +60 +47 +00 +00 +02 +00 +00 +00 +06 +00 +64 +47 +00 +00 +02 +00 +00 +00 +06 +00 +68 +47 +00 +00 +02 +00 +00 +00 +06 +00 +6c +47 +00 +00 +02 +00 +00 +00 +06 +00 +70 +47 +00 +00 +02 +00 +00 +00 +06 +00 +74 +47 +00 +00 +02 +00 +00 +00 +06 +00 +78 +47 +00 +00 +02 +00 +00 +00 +06 +00 +7c +47 +00 +00 +02 +00 +00 +00 +06 +00 +80 +47 +00 +00 +02 +00 +00 +00 +06 +00 +84 +47 +00 +00 +02 +00 +00 +00 +06 +00 +88 +47 +00 +00 +02 +00 +00 +00 +06 +00 +8c +47 +00 +00 +02 +00 +00 +00 +06 +00 +90 +47 +00 +00 +02 +00 +00 +00 +06 +00 +94 +47 +00 +00 +02 +00 +00 +00 +06 +00 +98 +47 +00 +00 +02 +00 +00 +00 +06 +00 +9c +47 +00 +00 +02 +00 +00 +00 +06 +00 +a0 +47 +00 +00 +02 +00 +00 +00 +06 +00 +a4 +47 +00 +00 +02 +00 +00 +00 +06 +00 +a8 +47 +00 +00 +02 +00 +00 +00 +06 +00 +ac +47 +00 +00 +02 +00 +00 +00 +06 +00 +b0 +47 +00 +00 +02 +00 +00 +00 +06 +00 +b4 +47 +00 +00 +02 +00 +00 +00 +06 +00 +b8 +47 +00 +00 +02 +00 +00 +00 +06 +00 +bc +47 +00 +00 +02 +00 +00 +00 +06 +00 +c0 +47 +00 +00 +02 +00 +00 +00 +06 +00 +c4 +47 +00 +00 +02 +00 +00 +00 +06 +00 +c8 +47 +00 +00 +02 +00 +00 +00 +06 +00 +cc +47 +00 +00 +02 +00 +00 +00 +06 +00 +d0 +47 +00 +00 +02 +00 +00 +00 +06 +00 +d4 +47 +00 +00 +02 +00 +00 +00 +06 +00 +d8 +47 +00 +00 +02 +00 +00 +00 +06 +00 +dc +47 +00 +00 +02 +00 +00 +00 +06 +00 +e0 +47 +00 +00 +02 +00 +00 +00 +06 +00 +e4 +47 +00 +00 +02 +00 +00 +00 +06 +00 +e8 +47 +00 +00 +02 +00 +00 +00 +06 +00 +ec +47 +00 +00 +02 +00 +00 +00 +06 +00 +f0 +47 +00 +00 +02 +00 +00 +00 +06 +00 +f4 +47 +00 +00 +02 +00 +00 +00 +06 +00 +f8 +47 +00 +00 +02 +00 +00 +00 +06 +00 +fc +47 +00 +00 +02 +00 +00 +00 +06 +00 +00 +48 +00 +00 +02 +00 +00 +00 +06 +00 +04 +48 +00 +00 +02 +00 +00 +00 +06 +00 +08 +48 +00 +00 +02 +00 +00 +00 +06 +00 +0c +48 +00 +00 +02 +00 +00 +00 +06 +00 +10 +48 +00 +00 +02 +00 +00 +00 +06 +00 +14 +48 +00 +00 +02 +00 +00 +00 +06 +00 +18 +48 +00 +00 +02 +00 +00 +00 +06 +00 +1c +48 +00 +00 +02 +00 +00 +00 +06 +00 +20 +48 +00 +00 +02 +00 +00 +00 +06 +00 +24 +48 +00 +00 +02 +00 +00 +00 +06 +00 +28 +48 +00 +00 +02 +00 +00 +00 +06 +00 +2c +48 +00 +00 +02 +00 +00 +00 +06 +00 +30 +48 +00 +00 +02 +00 +00 +00 +06 +00 +34 +48 +00 +00 +02 +00 +00 +00 +06 +00 +38 +48 +00 +00 +02 +00 +00 +00 +06 +00 +3c +48 +00 +00 +02 +00 +00 +00 +06 +00 +40 +48 +00 +00 +02 +00 +00 +00 +06 +00 +44 +48 +00 +00 +02 +00 +00 +00 +06 +00 +48 +48 +00 +00 +02 +00 +00 +00 +06 +00 +4c +48 +00 +00 +02 +00 +00 +00 +06 +00 +50 +48 +00 +00 +02 +00 +00 +00 +06 +00 +54 +48 +00 +00 +02 +00 +00 +00 +06 +00 +58 +48 +00 +00 +02 +00 +00 +00 +06 +00 +5c +48 +00 +00 +02 +00 +00 +00 +06 +00 +60 +48 +00 +00 +02 +00 +00 +00 +06 +00 +64 +48 +00 +00 +02 +00 +00 +00 +06 +00 +68 +48 +00 +00 +02 +00 +00 +00 +06 +00 +6c +48 +00 +00 +02 +00 +00 +00 +06 +00 +70 +48 +00 +00 +02 +00 +00 +00 +06 +00 +74 +48 +00 +00 +02 +00 +00 +00 +06 +00 +78 +48 +00 +00 +02 +00 +00 +00 +06 +00 +7c +48 +00 +00 +02 +00 +00 +00 +06 +00 +80 +48 +00 +00 +02 +00 +00 +00 +06 +00 +84 +48 +00 +00 +02 +00 +00 +00 +06 +00 +88 +48 +00 +00 +02 +00 +00 +00 +06 +00 +8c +48 +00 +00 +02 +00 +00 +00 +06 +00 +90 +48 +00 +00 +02 +00 +00 +00 +06 +00 +94 +48 +00 +00 +02 +00 +00 +00 +06 +00 +98 +48 +00 +00 +02 +00 +00 +00 +06 +00 +9c +48 +00 +00 +02 +00 +00 +00 +06 +00 +a0 +48 +00 +00 +02 +00 +00 +00 +06 +00 +a4 +48 +00 +00 +02 +00 +00 +00 +06 +00 +a8 +48 +00 +00 +02 +00 +00 +00 +06 +00 +ac +48 +00 +00 +02 +00 +00 +00 +06 +00 +b0 +48 +00 +00 +02 +00 +00 +00 +06 +00 +b4 +48 +00 +00 +02 +00 +00 +00 +06 +00 +b8 +48 +00 +00 +02 +00 +00 +00 +06 +00 +bc +48 +00 +00 +02 +00 +00 +00 +06 +00 +c0 +48 +00 +00 +02 +00 +00 +00 +06 +00 +c4 +48 +00 +00 +02 +00 +00 +00 +06 +00 +c8 +48 +00 +00 +02 +00 +00 +00 +06 +00 +cc +48 +00 +00 +02 +00 +00 +00 +06 +00 +d0 +48 +00 +00 +02 +00 +00 +00 +06 +00 +d4 +48 +00 +00 +02 +00 +00 +00 +06 +00 +d8 +48 +00 +00 +02 +00 +00 +00 +06 +00 +dc +48 +00 +00 +02 +00 +00 +00 +06 +00 +e0 +48 +00 +00 +02 +00 +00 +00 +06 +00 +e4 +48 +00 +00 +02 +00 +00 +00 +06 +00 +e8 +48 +00 +00 +02 +00 +00 +00 +06 +00 +ec +48 +00 +00 +02 +00 +00 +00 +06 +00 +f0 +48 +00 +00 +02 +00 +00 +00 +06 +00 +f4 +48 +00 +00 +02 +00 +00 +00 +06 +00 +f8 +48 +00 +00 +02 +00 +00 +00 +06 +00 +fc +48 +00 +00 +02 +00 +00 +00 +06 +00 +00 49 -2a -01 +00 00 02 00 @@ -104439,9 +95889,2559 @@ fd 00 06 00 +04 +49 +00 +00 +02 +00 +00 +00 +06 +00 +08 +49 +00 +00 +02 +00 +00 +00 +06 +00 +0c +49 +00 +00 +02 +00 +00 +00 +06 +00 +10 +49 +00 +00 +02 +00 +00 +00 +06 +00 +14 +49 +00 +00 +02 +00 +00 +00 +06 +00 +18 +49 +00 +00 +02 +00 +00 +00 +06 +00 +1c +49 +00 +00 +02 +00 +00 +00 +06 +00 +20 +49 +00 +00 +02 +00 +00 +00 +06 +00 +24 +49 +00 +00 +02 +00 +00 +00 +06 +00 +28 +49 +00 +00 +02 +00 +00 +00 +06 +00 +2c +49 +00 +00 +02 +00 +00 +00 +06 +00 +30 +49 +00 +00 +02 +00 +00 +00 +06 +00 +34 +49 +00 +00 +02 +00 +00 +00 +06 +00 +38 +49 +00 +00 +02 +00 +00 +00 +06 +00 +3c +49 +00 +00 +02 +00 +00 +00 +06 +00 +40 +49 +00 +00 +02 +00 +00 +00 +06 +00 +44 +49 +00 +00 +02 +00 +00 +00 +06 +00 +48 +49 +00 +00 +02 +00 +00 +00 +06 +00 +4c +49 +00 +00 +02 +00 +00 +00 +06 +00 +50 +49 +00 +00 +02 +00 +00 +00 +06 +00 +54 +49 +00 +00 +02 +00 +00 +00 +06 +00 +58 +49 +00 +00 +02 +00 +00 +00 +06 +00 +5c +49 +00 +00 +02 +00 +00 +00 +06 +00 +60 +49 +00 +00 +02 +00 +00 +00 +06 +00 +64 +49 +00 +00 +02 +00 +00 +00 +06 +00 +68 +49 +00 +00 +02 +00 +00 +00 +06 +00 +6c +49 +00 +00 +02 +00 +00 +00 +06 +00 +70 +49 +00 +00 +02 +00 +00 +00 +06 +00 +74 +49 +00 +00 +02 +00 +00 +00 +06 +00 +78 +49 +00 +00 +02 +00 +00 +00 +06 +00 +7c +49 +00 +00 +02 +00 +00 +00 +06 +00 +80 +49 +00 +00 +02 +00 +00 +00 +06 +00 +84 +49 +00 +00 +02 +00 +00 +00 +06 +00 +88 +49 +00 +00 +02 +00 +00 +00 +06 +00 +8c +49 +00 +00 +02 +00 +00 +00 +06 +00 +90 +49 +00 +00 +02 +00 +00 +00 +06 +00 +94 +49 +00 +00 +02 +00 +00 +00 +06 +00 +98 +49 +00 +00 +02 +00 +00 +00 +06 +00 +9c +49 +00 +00 +02 +00 +00 +00 +06 +00 +a0 +49 +00 +00 +02 +00 +00 +00 +06 +00 +a4 +49 +00 +00 +02 +00 +00 +00 +06 +00 +a8 +49 +00 +00 +02 +00 +00 +00 +06 +00 +ac +49 +00 +00 +02 +00 +00 +00 +06 +00 +b0 +49 +00 +00 +02 +00 +00 +00 +06 +00 +b4 +49 +00 +00 +02 +00 +00 +00 +06 +00 +b8 +49 +00 +00 +02 +00 +00 +00 +06 +00 +bc +49 +00 +00 +02 +00 +00 +00 +06 +00 +c0 +49 +00 +00 +02 +00 +00 +00 +06 +00 +c4 +49 +00 +00 +02 +00 +00 +00 +06 +00 +c8 +49 +00 +00 +02 +00 +00 +00 +06 +00 +cc +49 +00 +00 +02 +00 +00 +00 +06 +00 +d0 +49 +00 +00 +02 +00 +00 +00 +06 +00 +d4 +49 +00 +00 +02 +00 +00 +00 +06 +00 +d8 +49 +00 +00 +02 +00 +00 +00 +06 +00 +dc +49 +00 +00 +02 +00 +00 +00 +06 +00 +e0 +49 +00 +00 +02 +00 +00 +00 +06 +00 +e4 +49 +00 +00 +02 +00 +00 +00 +06 +00 +e8 +49 +00 +00 +02 +00 +00 +00 +06 +00 +ec +49 +00 +00 +02 +00 +00 +00 +06 +00 +f0 +49 +00 +00 +02 +00 +00 +00 +06 +00 +f4 +49 +00 +00 +02 +00 +00 +00 +06 +00 +f8 +49 +00 +00 +02 +00 +00 +00 +06 +00 +fc +49 +00 +00 +02 +00 +00 +00 +06 +00 +00 +4a +00 +00 +02 +00 +00 +00 +06 +00 +04 +4a +00 +00 +02 +00 +00 +00 +06 +00 +08 +4a +00 +00 +02 +00 +00 +00 +06 +00 +0c +4a +00 +00 +02 +00 +00 +00 +06 +00 +10 +4a +00 +00 +02 +00 +00 +00 +06 +00 +14 +4a +00 +00 +02 +00 +00 +00 +06 +00 +18 +4a +00 +00 +02 +00 +00 +00 +06 +00 +1c +4a +00 +00 +02 +00 +00 +00 +06 +00 +20 +4a +00 +00 +02 +00 +00 +00 +06 +00 +24 +4a +00 +00 +02 +00 +00 +00 +06 +00 +28 +4a +00 +00 +02 +00 +00 +00 +06 +00 +2c +4a +00 +00 +02 +00 +00 +00 +06 +00 +30 +4a +00 +00 +02 +00 +00 +00 +06 +00 +34 +4a +00 +00 +02 +00 +00 +00 +06 +00 +38 +4a +00 +00 +02 +00 +00 +00 +06 +00 +3c +4a +00 +00 +02 +00 +00 +00 +06 +00 +40 +4a +00 +00 +02 +00 +00 +00 +06 +00 +44 +4a +00 +00 +02 +00 +00 +00 +06 +00 +48 +4a +00 +00 +02 +00 +00 +00 +06 +00 +4c +4a +00 +00 +02 +00 +00 +00 +06 +00 +50 +4a +00 +00 +02 +00 +00 +00 +06 +00 +54 +4a +00 +00 +02 +00 +00 +00 +06 +00 +58 +4a +00 +00 +02 +00 +00 +00 +06 +00 +5c +4a +00 +00 +02 +00 +00 +00 +06 +00 +60 +4a +00 +00 +02 +00 +00 +00 +06 +00 +64 +4a +00 +00 +02 +00 +00 +00 +06 +00 +68 +4a +00 +00 +02 +00 +00 +00 +06 +00 +6c +4a +00 +00 +02 +00 +00 +00 +06 +00 +70 +4a +00 +00 +02 +00 +00 +00 +06 +00 +74 +4a +00 +00 +02 +00 +00 +00 +06 +00 +78 +4a +00 +00 +02 +00 +00 +00 +06 +00 +7c +4a +00 +00 +02 +00 +00 +00 +06 +00 +80 +4a +00 +00 +02 +00 +00 +00 +06 +00 +84 +4a +00 +00 +02 +00 +00 +00 +06 +00 +88 +4a +00 +00 +02 +00 +00 +00 +06 +00 +8c +4a +00 +00 +02 +00 +00 +00 +06 +00 +90 +4a +00 +00 +02 +00 +00 +00 +06 +00 +94 +4a +00 +00 +02 +00 +00 +00 +06 +00 +98 +4a +00 +00 +02 +00 +00 +00 +06 +00 +9c +4a +00 +00 +02 +00 +00 +00 +06 +00 +a0 +4a +00 +00 +02 +00 +00 +00 +06 +00 +a4 +4a +00 +00 +02 +00 +00 +00 +06 +00 +a8 +4a +00 +00 +02 +00 +00 +00 +06 +00 +ac +4a +00 +00 +02 +00 +00 +00 +06 +00 +b0 +4a +00 +00 +02 +00 +00 +00 +06 +00 +b4 +4a +00 +00 +02 +00 +00 +00 +06 +00 +b8 +4a +00 +00 +02 +00 +00 +00 +06 +00 +bc +4a +00 +00 +02 +00 +00 +00 +06 +00 +c0 +4a +00 +00 +02 +00 +00 +00 +06 +00 +c4 +4a +00 +00 +02 +00 +00 +00 +06 +00 +c8 +4a +00 +00 +02 +00 +00 +00 +06 +00 +cc +4a +00 +00 +02 +00 +00 +00 +06 +00 +d0 +4a +00 +00 +02 +00 +00 +00 +06 +00 +d4 +4a +00 +00 +02 +00 +00 +00 +06 +00 +d8 +4a +00 +00 +02 +00 +00 +00 +06 +00 +dc +4a +00 +00 +02 +00 +00 +00 +06 +00 +e0 +4a +00 +00 +02 +00 +00 +00 +06 +00 +e4 +4a +00 +00 +02 +00 +00 +00 +06 +00 +e8 +4a +00 +00 +02 +00 +00 +00 +06 +00 +ec +4a +00 +00 +02 +00 +00 +00 +06 +00 +f0 +4a +00 +00 +02 +00 +00 +00 +06 +00 +f4 +4a +00 +00 +02 +00 +00 +00 +06 +00 +f8 +4a +00 +00 +02 +00 +00 +00 +06 +00 +fc +4a +00 +00 +02 +00 +00 +00 +06 +00 +00 +4b +00 +00 +02 +00 +00 +00 +06 +00 +04 +4b +00 +00 +02 +00 +00 +00 +06 +00 +08 +4b +00 +00 +02 +00 +00 +00 +06 +00 +0c +4b +00 +00 +02 +00 +00 +00 +06 +00 +10 +4b +00 +00 +02 +00 +00 +00 +06 +00 +14 +4b +00 +00 +02 +00 +00 +00 +06 +00 +18 +4b +00 +00 +02 +00 +00 +00 +06 +00 +1c +4b +00 +00 +02 +00 +00 +00 +06 +00 +20 +4b +00 +00 +02 +00 +00 +00 +06 +00 +24 +4b +00 +00 +02 +00 +00 +00 +06 +00 +28 +4b +00 +00 +02 +00 +00 +00 +06 +00 +2c +4b +00 +00 +02 +00 +00 +00 +06 +00 +30 +4b +00 +00 +02 +00 +00 +00 +06 +00 +34 +4b +00 +00 +02 +00 +00 +00 +06 +00 +38 +4b +00 +00 +02 +00 +00 +00 +06 +00 +3c +4b +00 +00 +02 +00 +00 +00 +06 +00 +40 +4b +00 +00 +02 +00 +00 +00 +06 +00 +44 +4b +00 +00 +02 +00 +00 +00 +06 +00 +48 +4b +00 +00 +02 +00 +00 +00 +06 +00 +4c +4b +00 +00 +02 +00 +00 +00 +06 +00 +50 +4b +00 +00 +02 +00 +00 +00 +06 +00 +54 +4b +00 +00 +02 +00 +00 +00 +06 +00 +58 +4b +00 +00 +02 +00 +00 +00 +06 +00 +5c +4b +00 +00 +02 +00 +00 +00 +06 +00 +60 +4b +00 +00 +02 +00 +00 +00 +06 +00 +64 +4b +00 +00 +02 +00 +00 +00 +06 +00 +68 +4b +00 +00 +02 +00 +00 +00 +06 +00 +6c +4b +00 +00 +02 +00 +00 +00 +06 +00 +70 +4b +00 +00 +02 +00 +00 +00 +06 +00 +74 +4b +00 +00 +02 +00 +00 +00 +06 +00 +78 +4b +00 +00 +02 +00 +00 +00 +06 +00 +7c +4b +00 +00 +02 +00 +00 +00 +06 +00 +80 +4b +00 +00 +02 +00 +00 +00 +06 +00 +84 +4b +00 +00 +02 +00 +00 +00 +06 +00 +88 +4b +00 +00 +02 +00 +00 +00 +06 +00 +8c +4b +00 +00 +02 +00 +00 +00 +06 +00 +90 +4b +00 +00 +02 +00 +00 +00 +06 +00 +94 +4b +00 +00 +02 +00 +00 +00 +06 +00 +98 +4b +00 +00 +02 +00 +00 +00 +06 +00 +9c +4b +00 +00 +02 +00 +00 +00 +06 +00 +a0 +4b +00 +00 +02 +00 +00 +00 +06 +00 +a4 +4b +00 +00 +02 +00 +00 +00 +06 +00 +a8 +4b +00 +00 +02 +00 +00 +00 +06 +00 +ac +4b +00 +00 +02 +00 +00 +00 +06 +00 +b0 +4b +00 +00 +02 +00 +00 +00 +06 +00 +b4 +4b +00 +00 +02 +00 +00 +00 +06 +00 +b8 +4b +00 +00 +02 +00 +00 +00 +06 +00 +bc +4b +00 +00 +02 +00 +00 +00 +06 +00 +c0 +4b +00 +00 +02 +00 +00 +00 +06 +00 +c4 +4b +00 +00 +02 +00 +00 +00 +06 +00 +c8 +4b +00 +00 +02 +00 +00 +00 +06 +00 +cc +4b +00 +00 +02 +00 +00 +00 +06 +00 +d0 +4b +00 +00 +02 +00 +00 +00 +06 +00 +d4 +4b +00 +00 +02 +00 +00 +00 +06 +00 +d8 +4b +00 +00 +02 +00 +00 +00 +06 +00 +dc +4b +00 +00 +02 +00 +00 +00 +06 +00 +e0 +4b +00 +00 +02 +00 +00 +00 +06 +00 +e4 +4b +00 +00 +02 +00 +00 +00 +06 +00 +e8 +4b +00 +00 +02 +00 +00 +00 +06 +00 +ec +4b +00 +00 +02 +00 +00 +00 +06 +00 +f0 +4b +00 +00 +02 +00 +00 +00 +06 +00 +f4 +4b +00 +00 +02 +00 +00 +00 +06 +00 +f8 +4b +00 +00 +02 +00 +00 +00 +06 +00 +fc +4b +00 +00 +02 +00 +00 +00 +06 +00 +00 +4c +00 +00 +02 +00 +00 +00 +06 +00 +04 +4c +00 +00 +02 +00 +00 +00 +06 +00 +08 +4c +00 +00 +02 +00 +00 +00 +06 +00 +0c +4c +00 +00 +02 +00 +00 +00 +06 +00 +10 +4c +00 +00 +02 +00 +00 +00 +06 +00 +14 +4c +00 +00 +02 +00 +00 +00 +06 +00 +18 +4c +00 +00 +02 +00 +00 +00 +06 +00 +1c +4c +00 +00 +02 +00 +00 +00 +06 +00 +20 +4c +00 +00 +02 +00 +00 +00 +06 +00 +24 +4c +00 +00 +02 +00 +00 +00 +06 +00 +28 +4c +00 +00 +02 +00 +00 +00 +06 +00 +2c +4c +00 +00 +02 +00 +00 +00 +06 +00 +30 +4c +00 +00 +02 +00 +00 +00 +06 +00 +34 +4c +00 +00 +02 +00 +00 +00 +06 +00 +38 +4c +00 +00 +02 +00 +00 +00 +06 +00 +3c +4c +00 +00 +02 +00 +00 +00 +06 +00 +40 +4c +00 +00 +02 +00 +00 +00 +06 +00 +44 +4c +00 +00 +02 +00 +00 +00 +06 +00 +48 +4c +00 +00 +02 +00 +00 +00 +06 +00 +4c +4c +00 +00 +02 +00 +00 +00 +06 +00 +50 +4c +00 +00 +02 +00 +00 +00 +06 +00 +54 +4c +00 +00 +02 +00 +00 +00 +06 +00 +58 +4c +00 +00 +02 +00 +00 +00 +06 +00 +5c +4c +00 +00 +02 +00 +00 +00 +06 +00 +60 +4c +00 +00 +02 +00 +00 +00 +06 +00 +64 +4c +00 +00 +02 +00 +00 +00 +06 +00 +68 +4c +00 +00 +02 +00 +00 +00 +06 +00 +6c +4c +00 +00 +02 +00 +00 +00 +06 +00 +70 +4c +00 +00 +02 +00 +00 +00 +06 +00 +74 +4c +00 +00 +02 +00 +00 +00 +06 +00 +78 +4c +00 +00 +02 +00 +00 +00 +06 +00 +7c +4c +00 +00 +02 +00 +00 +00 +06 +00 +80 +4c +00 +00 +02 +00 +00 +00 +06 +00 +84 +4c +00 +00 +02 +00 +00 +00 +06 +00 +88 +4c +00 +00 +02 +00 +00 +00 +06 +00 +8c +4c +00 +00 +02 +00 +00 +00 +06 +00 +90 +4c +00 +00 +02 +00 +00 +00 +06 +00 +94 +4c +00 +00 +02 +00 +00 +00 +06 +00 +98 +4c +00 +00 +02 +00 +00 +00 +06 +00 +9c +4c +00 +00 +02 +00 +00 +00 +06 +00 +a0 +4c +00 +00 +02 +00 +00 +00 +06 +00 +a4 +4c +00 +00 +02 +00 +00 +00 +06 +00 +a8 +4c +00 +00 +02 +00 +00 +00 +06 +00 +ac +4c +00 +00 +02 +00 +00 +00 +06 +00 +b0 +4c +00 +00 +02 +00 +00 +00 +06 +00 +b4 +4c +00 +00 +02 +00 +00 +00 +06 +00 +b8 +4c +00 +00 +02 +00 +00 +00 +06 +00 +bc +4c +00 +00 +02 +00 +00 +00 +06 +00 +c0 +4c +00 +00 +02 +00 +00 +00 +06 +00 +c4 +4c +00 +00 +02 +00 +00 +00 +06 +00 +c8 +4c +00 +00 +02 +00 +00 +00 +06 +00 +cc +4c +00 +00 +02 +00 +00 +00 +06 +00 +d0 +4c +00 +00 +02 +00 +00 +00 +06 +00 +d4 +4c +00 +00 +02 +00 +00 +00 +06 +00 +d8 +4c +00 +00 +02 +00 +00 +00 +06 +00 +dc +4c +00 +00 +02 +00 +00 +00 +06 +00 +e0 +4c +00 +00 +02 +00 +00 +00 +06 +00 +e4 +4c +00 +00 +02 +00 +00 +00 +06 +00 +e8 +4c +00 +00 +02 +00 +00 +00 +06 +00 +ec +4c +00 +00 +02 +00 +00 +00 +06 +00 +f0 +4c +00 +00 +02 +00 +00 +00 +06 +00 +f4 +4c +00 +00 +02 +00 +00 +00 +06 +00 +f8 +4c +00 +00 +02 +00 +00 +00 +06 +00 +fc +4c +00 +00 +02 +00 +00 +00 +06 +00 +00 4d -2a -01 +00 00 02 00 @@ -104449,9 +98449,2559 @@ fd 00 06 00 +04 +4d +00 +00 +02 +00 +00 +00 +06 +00 +08 +4d +00 +00 +02 +00 +00 +00 +06 +00 +0c +4d +00 +00 +02 +00 +00 +00 +06 +00 +10 +4d +00 +00 +02 +00 +00 +00 +06 +00 +14 +4d +00 +00 +02 +00 +00 +00 +06 +00 +18 +4d +00 +00 +02 +00 +00 +00 +06 +00 +1c +4d +00 +00 +02 +00 +00 +00 +06 +00 +20 +4d +00 +00 +02 +00 +00 +00 +06 +00 +24 +4d +00 +00 +02 +00 +00 +00 +06 +00 +28 +4d +00 +00 +02 +00 +00 +00 +06 +00 +2c +4d +00 +00 +02 +00 +00 +00 +06 +00 +30 +4d +00 +00 +02 +00 +00 +00 +06 +00 +34 +4d +00 +00 +02 +00 +00 +00 +06 +00 +38 +4d +00 +00 +02 +00 +00 +00 +06 +00 +3c +4d +00 +00 +02 +00 +00 +00 +06 +00 +40 +4d +00 +00 +02 +00 +00 +00 +06 +00 +44 +4d +00 +00 +02 +00 +00 +00 +06 +00 +48 +4d +00 +00 +02 +00 +00 +00 +06 +00 +4c +4d +00 +00 +02 +00 +00 +00 +06 +00 +50 +4d +00 +00 +02 +00 +00 +00 +06 +00 +54 +4d +00 +00 +02 +00 +00 +00 +06 +00 +58 +4d +00 +00 +02 +00 +00 +00 +06 +00 +5c +4d +00 +00 +02 +00 +00 +00 +06 +00 +60 +4d +00 +00 +02 +00 +00 +00 +06 +00 +64 +4d +00 +00 +02 +00 +00 +00 +06 +00 +68 +4d +00 +00 +02 +00 +00 +00 +06 +00 +6c +4d +00 +00 +02 +00 +00 +00 +06 +00 +70 +4d +00 +00 +02 +00 +00 +00 +06 +00 +74 +4d +00 +00 +02 +00 +00 +00 +06 +00 +78 +4d +00 +00 +02 +00 +00 +00 +06 +00 +7c +4d +00 +00 +02 +00 +00 +00 +06 +00 +80 +4d +00 +00 +02 +00 +00 +00 +06 +00 +84 +4d +00 +00 +02 +00 +00 +00 +06 +00 +88 +4d +00 +00 +02 +00 +00 +00 +06 +00 +8c +4d +00 +00 +02 +00 +00 +00 +06 +00 +90 +4d +00 +00 +02 +00 +00 +00 +06 +00 +94 +4d +00 +00 +02 +00 +00 +00 +06 +00 +98 +4d +00 +00 +02 +00 +00 +00 +06 +00 +9c +4d +00 +00 +02 +00 +00 +00 +06 +00 +a0 +4d +00 +00 +02 +00 +00 +00 +06 +00 +a4 +4d +00 +00 +02 +00 +00 +00 +06 +00 +a8 +4d +00 +00 +02 +00 +00 +00 +06 +00 +ac +4d +00 +00 +02 +00 +00 +00 +06 +00 +b0 +4d +00 +00 +02 +00 +00 +00 +06 +00 +b4 +4d +00 +00 +02 +00 +00 +00 +06 +00 +b8 +4d +00 +00 +02 +00 +00 +00 +06 +00 +bc +4d +00 +00 +02 +00 +00 +00 +06 +00 +c0 +4d +00 +00 +02 +00 +00 +00 +06 +00 +c4 +4d +00 +00 +02 +00 +00 +00 +06 +00 +c8 +4d +00 +00 +02 +00 +00 +00 +06 +00 +cc +4d +00 +00 +02 +00 +00 +00 +06 +00 +d0 +4d +00 +00 +02 +00 +00 +00 +06 +00 +d4 +4d +00 +00 +02 +00 +00 +00 +06 +00 +d8 +4d +00 +00 +02 +00 +00 +00 +06 +00 +dc +4d +00 +00 +02 +00 +00 +00 +06 +00 +e0 +4d +00 +00 +02 +00 +00 +00 +06 +00 +e4 +4d +00 +00 +02 +00 +00 +00 +06 +00 +e8 +4d +00 +00 +02 +00 +00 +00 +06 +00 +ec +4d +00 +00 +02 +00 +00 +00 +06 +00 +f0 +4d +00 +00 +02 +00 +00 +00 +06 +00 +f4 +4d +00 +00 +02 +00 +00 +00 +06 +00 +f8 +4d +00 +00 +02 +00 +00 +00 +06 +00 +fc +4d +00 +00 +02 +00 +00 +00 +06 +00 +00 +4e +00 +00 +02 +00 +00 +00 +06 +00 +04 +4e +00 +00 +02 +00 +00 +00 +06 +00 +08 +4e +00 +00 +02 +00 +00 +00 +06 +00 +0c +4e +00 +00 +02 +00 +00 +00 +06 +00 +10 +4e +00 +00 +02 +00 +00 +00 +06 +00 +14 +4e +00 +00 +02 +00 +00 +00 +06 +00 +18 +4e +00 +00 +02 +00 +00 +00 +06 +00 +1c +4e +00 +00 +02 +00 +00 +00 +06 +00 +20 +4e +00 +00 +02 +00 +00 +00 +06 +00 +24 +4e +00 +00 +02 +00 +00 +00 +06 +00 +28 +4e +00 +00 +02 +00 +00 +00 +06 +00 +2c +4e +00 +00 +02 +00 +00 +00 +06 +00 +30 +4e +00 +00 +02 +00 +00 +00 +06 +00 +34 +4e +00 +00 +02 +00 +00 +00 +06 +00 +38 +4e +00 +00 +02 +00 +00 +00 +06 +00 +3c +4e +00 +00 +02 +00 +00 +00 +06 +00 +40 +4e +00 +00 +02 +00 +00 +00 +06 +00 +44 +4e +00 +00 +02 +00 +00 +00 +06 +00 +48 +4e +00 +00 +02 +00 +00 +00 +06 +00 +4c +4e +00 +00 +02 +00 +00 +00 +06 +00 +50 +4e +00 +00 +02 +00 +00 +00 +06 +00 +54 +4e +00 +00 +02 +00 +00 +00 +06 +00 +58 +4e +00 +00 +02 +00 +00 +00 +06 +00 +5c +4e +00 +00 +02 +00 +00 +00 +06 +00 +60 +4e +00 +00 +02 +00 +00 +00 +06 +00 +64 +4e +00 +00 +02 +00 +00 +00 +06 +00 +68 +4e +00 +00 +02 +00 +00 +00 +06 +00 +6c +4e +00 +00 +02 +00 +00 +00 +06 +00 +70 +4e +00 +00 +02 +00 +00 +00 +06 +00 +74 +4e +00 +00 +02 +00 +00 +00 +06 +00 +78 +4e +00 +00 +02 +00 +00 +00 +06 +00 +7c +4e +00 +00 +02 +00 +00 +00 +06 +00 +80 +4e +00 +00 +02 +00 +00 +00 +06 +00 +84 +4e +00 +00 +02 +00 +00 +00 +06 +00 +88 +4e +00 +00 +02 +00 +00 +00 +06 +00 +8c +4e +00 +00 +02 +00 +00 +00 +06 +00 +90 +4e +00 +00 +02 +00 +00 +00 +06 +00 +94 +4e +00 +00 +02 +00 +00 +00 +06 +00 +98 +4e +00 +00 +02 +00 +00 +00 +06 +00 +9c +4e +00 +00 +02 +00 +00 +00 +06 +00 +a0 +4e +00 +00 +02 +00 +00 +00 +06 +00 +a4 +4e +00 +00 +02 +00 +00 +00 +06 +00 +a8 +4e +00 +00 +02 +00 +00 +00 +06 +00 +ac +4e +00 +00 +02 +00 +00 +00 +06 +00 +b0 +4e +00 +00 +02 +00 +00 +00 +06 +00 +b4 +4e +00 +00 +02 +00 +00 +00 +06 +00 +b8 +4e +00 +00 +02 +00 +00 +00 +06 +00 +bc +4e +00 +00 +02 +00 +00 +00 +06 +00 +c0 +4e +00 +00 +02 +00 +00 +00 +06 +00 +c4 +4e +00 +00 +02 +00 +00 +00 +06 +00 +c8 +4e +00 +00 +02 +00 +00 +00 +06 +00 +cc +4e +00 +00 +02 +00 +00 +00 +06 +00 +d0 +4e +00 +00 +02 +00 +00 +00 +06 +00 +d4 +4e +00 +00 +02 +00 +00 +00 +06 +00 +d8 +4e +00 +00 +02 +00 +00 +00 +06 +00 +dc +4e +00 +00 +02 +00 +00 +00 +06 +00 +e0 +4e +00 +00 +02 +00 +00 +00 +06 +00 +e4 +4e +00 +00 +02 +00 +00 +00 +06 +00 +e8 +4e +00 +00 +02 +00 +00 +00 +06 +00 +ec +4e +00 +00 +02 +00 +00 +00 +06 +00 +f0 +4e +00 +00 +02 +00 +00 +00 +06 +00 +f4 +4e +00 +00 +02 +00 +00 +00 +06 +00 +f8 +4e +00 +00 +02 +00 +00 +00 +06 +00 +fc +4e +00 +00 +02 +00 +00 +00 +06 +00 +00 +4f +00 +00 +02 +00 +00 +00 +06 +00 +04 +4f +00 +00 +02 +00 +00 +00 +06 +00 +08 +4f +00 +00 +02 +00 +00 +00 +06 +00 +0c +4f +00 +00 +02 +00 +00 +00 +06 +00 +10 +4f +00 +00 +02 +00 +00 +00 +06 +00 +14 +4f +00 +00 +02 +00 +00 +00 +06 +00 +18 +4f +00 +00 +02 +00 +00 +00 +06 +00 +1c +4f +00 +00 +02 +00 +00 +00 +06 +00 +20 +4f +00 +00 +02 +00 +00 +00 +06 +00 +24 +4f +00 +00 +02 +00 +00 +00 +06 +00 +28 +4f +00 +00 +02 +00 +00 +00 +06 +00 +2c +4f +00 +00 +02 +00 +00 +00 +06 +00 +30 +4f +00 +00 +02 +00 +00 +00 +06 +00 +34 +4f +00 +00 +02 +00 +00 +00 +06 +00 +38 +4f +00 +00 +02 +00 +00 +00 +06 +00 +3c +4f +00 +00 +02 +00 +00 +00 +06 +00 +40 +4f +00 +00 +02 +00 +00 +00 +06 +00 +44 +4f +00 +00 +02 +00 +00 +00 +06 +00 +48 +4f +00 +00 +02 +00 +00 +00 +06 +00 +4c +4f +00 +00 +02 +00 +00 +00 +06 +00 +50 +4f +00 +00 +02 +00 +00 +00 +06 +00 +54 +4f +00 +00 +02 +00 +00 +00 +06 +00 +58 +4f +00 +00 +02 +00 +00 +00 +06 +00 +5c +4f +00 +00 +02 +00 +00 +00 +06 +00 +60 +4f +00 +00 +02 +00 +00 +00 +06 +00 +64 +4f +00 +00 +02 +00 +00 +00 +06 +00 +68 +4f +00 +00 +02 +00 +00 +00 +06 +00 +6c +4f +00 +00 +02 +00 +00 +00 +06 +00 +70 +4f +00 +00 +02 +00 +00 +00 +06 +00 +74 +4f +00 +00 +02 +00 +00 +00 +06 +00 +78 +4f +00 +00 +02 +00 +00 +00 +06 +00 +7c +4f +00 +00 +02 +00 +00 +00 +06 +00 +80 +4f +00 +00 +02 +00 +00 +00 +06 +00 +84 +4f +00 +00 +02 +00 +00 +00 +06 +00 +88 +4f +00 +00 +02 +00 +00 +00 +06 +00 +8c +4f +00 +00 +02 +00 +00 +00 +06 +00 +90 +4f +00 +00 +02 +00 +00 +00 +06 +00 +94 +4f +00 +00 +02 +00 +00 +00 +06 +00 +98 +4f +00 +00 +02 +00 +00 +00 +06 +00 +9c +4f +00 +00 +02 +00 +00 +00 +06 +00 +a0 +4f +00 +00 +02 +00 +00 +00 +06 +00 +a4 +4f +00 +00 +02 +00 +00 +00 +06 +00 +a8 +4f +00 +00 +02 +00 +00 +00 +06 +00 +ac +4f +00 +00 +02 +00 +00 +00 +06 +00 +b0 +4f +00 +00 +02 +00 +00 +00 +06 +00 +b4 +4f +00 +00 +02 +00 +00 +00 +06 +00 +b8 +4f +00 +00 +02 +00 +00 +00 +06 +00 +bc +4f +00 +00 +02 +00 +00 +00 +06 +00 +c0 +4f +00 +00 +02 +00 +00 +00 +06 +00 +c4 +4f +00 +00 +02 +00 +00 +00 +06 +00 +c8 +4f +00 +00 +02 +00 +00 +00 +06 +00 +cc +4f +00 +00 +02 +00 +00 +00 +06 +00 +d0 +4f +00 +00 +02 +00 +00 +00 +06 +00 +d4 +4f +00 +00 +02 +00 +00 +00 +06 +00 +d8 +4f +00 +00 +02 +00 +00 +00 +06 +00 +dc +4f +00 +00 +02 +00 +00 +00 +06 +00 +e0 +4f +00 +00 +02 +00 +00 +00 +06 +00 +e4 +4f +00 +00 +02 +00 +00 +00 +06 +00 +e8 +4f +00 +00 +02 +00 +00 +00 +06 +00 +ec +4f +00 +00 +02 +00 +00 +00 +06 +00 +f0 +4f +00 +00 +02 +00 +00 +00 +06 +00 +f4 +4f +00 +00 +02 +00 +00 +00 +06 +00 +f8 +4f +00 +00 +02 +00 +00 +00 +06 +00 +fc +4f +00 +00 +02 +00 +00 +00 +06 +00 +00 +50 +00 +00 +02 +00 +00 +00 +06 +00 +04 +50 +00 +00 +02 +00 +00 +00 +06 +00 +08 +50 +00 +00 +02 +00 +00 +00 +06 +00 +0c +50 +00 +00 +02 +00 +00 +00 +06 +00 +10 +50 +00 +00 +02 +00 +00 +00 +06 +00 +14 +50 +00 +00 +02 +00 +00 +00 +06 +00 +18 +50 +00 +00 +02 +00 +00 +00 +06 +00 +1c +50 +00 +00 +02 +00 +00 +00 +06 +00 +20 +50 +00 +00 +02 +00 +00 +00 +06 +00 +24 +50 +00 +00 +02 +00 +00 +00 +06 +00 +28 +50 +00 +00 +02 +00 +00 +00 +06 +00 +2c +50 +00 +00 +02 +00 +00 +00 +06 +00 +30 +50 +00 +00 +02 +00 +00 +00 +06 +00 +34 +50 +00 +00 +02 +00 +00 +00 +06 +00 +38 +50 +00 +00 +02 +00 +00 +00 +06 +00 +3c +50 +00 +00 +02 +00 +00 +00 +06 +00 +40 +50 +00 +00 +02 +00 +00 +00 +06 +00 +44 +50 +00 +00 +02 +00 +00 +00 +06 +00 +48 +50 +00 +00 +02 +00 +00 +00 +06 +00 +4c +50 +00 +00 +02 +00 +00 +00 +06 +00 +50 +50 +00 +00 +02 +00 +00 +00 +06 +00 +54 +50 +00 +00 +02 +00 +00 +00 +06 +00 +58 +50 +00 +00 +02 +00 +00 +00 +06 +00 +5c +50 +00 +00 +02 +00 +00 +00 +06 +00 +60 +50 +00 +00 +02 +00 +00 +00 +06 +00 +64 +50 +00 +00 +02 +00 +00 +00 +06 +00 +68 +50 +00 +00 +02 +00 +00 +00 +06 +00 +6c +50 +00 +00 +02 +00 +00 +00 +06 +00 +70 +50 +00 +00 +02 +00 +00 +00 +06 +00 +74 +50 +00 +00 +02 +00 +00 +00 +06 +00 +78 +50 +00 +00 +02 +00 +00 +00 +06 +00 +7c +50 +00 +00 +02 +00 +00 +00 +06 +00 +80 +50 +00 +00 +02 +00 +00 +00 +06 +00 +84 +50 +00 +00 +02 +00 +00 +00 +06 +00 +88 +50 +00 +00 +02 +00 +00 +00 +06 +00 +8c +50 +00 +00 +02 +00 +00 +00 +06 +00 +90 +50 +00 +00 +02 +00 +00 +00 +06 +00 +94 +50 +00 +00 +02 +00 +00 +00 +06 +00 +98 +50 +00 +00 +02 +00 +00 +00 +06 +00 +9c +50 +00 +00 +02 +00 +00 +00 +06 +00 +a0 +50 +00 +00 +02 +00 +00 +00 +06 +00 +a4 +50 +00 +00 +02 +00 +00 +00 +06 +00 +a8 +50 +00 +00 +02 +00 +00 +00 +06 +00 +ac +50 +00 +00 +02 +00 +00 +00 +06 +00 +b0 +50 +00 +00 +02 +00 +00 +00 +06 +00 +b4 +50 +00 +00 +02 +00 +00 +00 +06 +00 +b8 +50 +00 +00 +02 +00 +00 +00 +06 +00 +bc +50 +00 +00 +02 +00 +00 +00 +06 +00 +c0 +50 +00 +00 +02 +00 +00 +00 +06 +00 +c4 +50 +00 +00 +02 +00 +00 +00 +06 +00 +c8 +50 +00 +00 +02 +00 +00 +00 +06 +00 +cc +50 +00 +00 +02 +00 +00 +00 +06 +00 +d0 +50 +00 +00 +02 +00 +00 +00 +06 +00 +d4 +50 +00 +00 +02 +00 +00 +00 +06 +00 +d8 +50 +00 +00 +02 +00 +00 +00 +06 +00 +dc +50 +00 +00 +02 +00 +00 +00 +06 +00 +e0 +50 +00 +00 +02 +00 +00 +00 +06 +00 +e4 +50 +00 +00 +02 +00 +00 +00 +06 +00 +e8 +50 +00 +00 +02 +00 +00 +00 +06 +00 +ec +50 +00 +00 +02 +00 +00 +00 +06 +00 +f0 +50 +00 +00 +02 +00 +00 +00 +06 +00 +f4 +50 +00 +00 +02 +00 +00 +00 +06 +00 +f8 +50 +00 +00 +02 +00 +00 +00 +06 +00 +fc +50 +00 +00 +02 +00 +00 +00 +06 +00 +00 51 -2a -01 +00 00 02 00 @@ -104459,9 +101009,2559 @@ fd 00 06 00 +04 +51 +00 +00 +02 +00 +00 +00 +06 +00 +08 +51 +00 +00 +02 +00 +00 +00 +06 +00 +0c +51 +00 +00 +02 +00 +00 +00 +06 +00 +10 +51 +00 +00 +02 +00 +00 +00 +06 +00 +14 +51 +00 +00 +02 +00 +00 +00 +06 +00 +18 +51 +00 +00 +02 +00 +00 +00 +06 +00 +1c +51 +00 +00 +02 +00 +00 +00 +06 +00 +20 +51 +00 +00 +02 +00 +00 +00 +06 +00 +24 +51 +00 +00 +02 +00 +00 +00 +06 +00 +28 +51 +00 +00 +02 +00 +00 +00 +06 +00 +2c +51 +00 +00 +02 +00 +00 +00 +06 +00 +30 +51 +00 +00 +02 +00 +00 +00 +06 +00 +34 +51 +00 +00 +02 +00 +00 +00 +06 +00 +38 +51 +00 +00 +02 +00 +00 +00 +06 +00 +3c +51 +00 +00 +02 +00 +00 +00 +06 +00 +40 +51 +00 +00 +02 +00 +00 +00 +06 +00 +44 +51 +00 +00 +02 +00 +00 +00 +06 +00 +48 +51 +00 +00 +02 +00 +00 +00 +06 +00 +4c +51 +00 +00 +02 +00 +00 +00 +06 +00 +50 +51 +00 +00 +02 +00 +00 +00 +06 +00 +54 +51 +00 +00 +02 +00 +00 +00 +06 +00 +58 +51 +00 +00 +02 +00 +00 +00 +06 +00 +5c +51 +00 +00 +02 +00 +00 +00 +06 +00 +60 +51 +00 +00 +02 +00 +00 +00 +06 +00 +64 +51 +00 +00 +02 +00 +00 +00 +06 +00 +68 +51 +00 +00 +02 +00 +00 +00 +06 +00 +6c +51 +00 +00 +02 +00 +00 +00 +06 +00 +70 +51 +00 +00 +02 +00 +00 +00 +06 +00 +74 +51 +00 +00 +02 +00 +00 +00 +06 +00 +78 +51 +00 +00 +02 +00 +00 +00 +06 +00 +7c +51 +00 +00 +02 +00 +00 +00 +06 +00 +80 +51 +00 +00 +02 +00 +00 +00 +06 +00 +84 +51 +00 +00 +02 +00 +00 +00 +06 +00 +88 +51 +00 +00 +02 +00 +00 +00 +06 +00 +8c +51 +00 +00 +02 +00 +00 +00 +06 +00 +90 +51 +00 +00 +02 +00 +00 +00 +06 +00 +94 +51 +00 +00 +02 +00 +00 +00 +06 +00 +98 +51 +00 +00 +02 +00 +00 +00 +06 +00 +9c +51 +00 +00 +02 +00 +00 +00 +06 +00 +a0 +51 +00 +00 +02 +00 +00 +00 +06 +00 +a4 +51 +00 +00 +02 +00 +00 +00 +06 +00 +a8 +51 +00 +00 +02 +00 +00 +00 +06 +00 +ac +51 +00 +00 +02 +00 +00 +00 +06 +00 +b0 +51 +00 +00 +02 +00 +00 +00 +06 +00 +b4 +51 +00 +00 +02 +00 +00 +00 +06 +00 +b8 +51 +00 +00 +02 +00 +00 +00 +06 +00 +bc +51 +00 +00 +02 +00 +00 +00 +06 +00 +c0 +51 +00 +00 +02 +00 +00 +00 +06 +00 +c4 +51 +00 +00 +02 +00 +00 +00 +06 +00 +c8 +51 +00 +00 +02 +00 +00 +00 +06 +00 +cc +51 +00 +00 +02 +00 +00 +00 +06 +00 +d0 +51 +00 +00 +02 +00 +00 +00 +06 +00 +d4 +51 +00 +00 +02 +00 +00 +00 +06 +00 +d8 +51 +00 +00 +02 +00 +00 +00 +06 +00 +dc +51 +00 +00 +02 +00 +00 +00 +06 +00 +e0 +51 +00 +00 +02 +00 +00 +00 +06 +00 +e4 +51 +00 +00 +02 +00 +00 +00 +06 +00 +e8 +51 +00 +00 +02 +00 +00 +00 +06 +00 +ec +51 +00 +00 +02 +00 +00 +00 +06 +00 +f0 +51 +00 +00 +02 +00 +00 +00 +06 +00 +f4 +51 +00 +00 +02 +00 +00 +00 +06 +00 +f8 +51 +00 +00 +02 +00 +00 +00 +06 +00 +fc +51 +00 +00 +02 +00 +00 +00 +06 +00 +00 +52 +00 +00 +02 +00 +00 +00 +06 +00 +04 +52 +00 +00 +02 +00 +00 +00 +06 +00 +08 +52 +00 +00 +02 +00 +00 +00 +06 +00 +0c +52 +00 +00 +02 +00 +00 +00 +06 +00 +10 +52 +00 +00 +02 +00 +00 +00 +06 +00 +14 +52 +00 +00 +02 +00 +00 +00 +06 +00 +18 +52 +00 +00 +02 +00 +00 +00 +06 +00 +1c +52 +00 +00 +02 +00 +00 +00 +06 +00 +20 +52 +00 +00 +02 +00 +00 +00 +06 +00 +24 +52 +00 +00 +02 +00 +00 +00 +06 +00 +28 +52 +00 +00 +02 +00 +00 +00 +06 +00 +2c +52 +00 +00 +02 +00 +00 +00 +06 +00 +30 +52 +00 +00 +02 +00 +00 +00 +06 +00 +34 +52 +00 +00 +02 +00 +00 +00 +06 +00 +38 +52 +00 +00 +02 +00 +00 +00 +06 +00 +3c +52 +00 +00 +02 +00 +00 +00 +06 +00 +40 +52 +00 +00 +02 +00 +00 +00 +06 +00 +44 +52 +00 +00 +02 +00 +00 +00 +06 +00 +48 +52 +00 +00 +02 +00 +00 +00 +06 +00 +4c +52 +00 +00 +02 +00 +00 +00 +06 +00 +50 +52 +00 +00 +02 +00 +00 +00 +06 +00 +54 +52 +00 +00 +02 +00 +00 +00 +06 +00 +58 +52 +00 +00 +02 +00 +00 +00 +06 +00 +5c +52 +00 +00 +02 +00 +00 +00 +06 +00 +60 +52 +00 +00 +02 +00 +00 +00 +06 +00 +64 +52 +00 +00 +02 +00 +00 +00 +06 +00 +68 +52 +00 +00 +02 +00 +00 +00 +06 +00 +6c +52 +00 +00 +02 +00 +00 +00 +06 +00 +70 +52 +00 +00 +02 +00 +00 +00 +06 +00 +74 +52 +00 +00 +02 +00 +00 +00 +06 +00 +78 +52 +00 +00 +02 +00 +00 +00 +06 +00 +7c +52 +00 +00 +02 +00 +00 +00 +06 +00 +80 +52 +00 +00 +02 +00 +00 +00 +06 +00 +84 +52 +00 +00 +02 +00 +00 +00 +06 +00 +88 +52 +00 +00 +02 +00 +00 +00 +06 +00 +8c +52 +00 +00 +02 +00 +00 +00 +06 +00 +90 +52 +00 +00 +02 +00 +00 +00 +06 +00 +94 +52 +00 +00 +02 +00 +00 +00 +06 +00 +98 +52 +00 +00 +02 +00 +00 +00 +06 +00 +9c +52 +00 +00 +02 +00 +00 +00 +06 +00 +a0 +52 +00 +00 +02 +00 +00 +00 +06 +00 +a4 +52 +00 +00 +02 +00 +00 +00 +06 +00 +a8 +52 +00 +00 +02 +00 +00 +00 +06 +00 +ac +52 +00 +00 +02 +00 +00 +00 +06 +00 +b0 +52 +00 +00 +02 +00 +00 +00 +06 +00 +b4 +52 +00 +00 +02 +00 +00 +00 +06 +00 +b8 +52 +00 +00 +02 +00 +00 +00 +06 +00 +bc +52 +00 +00 +02 +00 +00 +00 +06 +00 +c0 +52 +00 +00 +02 +00 +00 +00 +06 +00 +c4 +52 +00 +00 +02 +00 +00 +00 +06 +00 +c8 +52 +00 +00 +02 +00 +00 +00 +06 +00 +cc +52 +00 +00 +02 +00 +00 +00 +06 +00 +d0 +52 +00 +00 +02 +00 +00 +00 +06 +00 +d4 +52 +00 +00 +02 +00 +00 +00 +06 +00 +d8 +52 +00 +00 +02 +00 +00 +00 +06 +00 +dc +52 +00 +00 +02 +00 +00 +00 +06 +00 +e0 +52 +00 +00 +02 +00 +00 +00 +06 +00 +e4 +52 +00 +00 +02 +00 +00 +00 +06 +00 +e8 +52 +00 +00 +02 +00 +00 +00 +06 +00 +ec +52 +00 +00 +02 +00 +00 +00 +06 +00 +f0 +52 +00 +00 +02 +00 +00 +00 +06 +00 +f4 +52 +00 +00 +02 +00 +00 +00 +06 +00 +f8 +52 +00 +00 +02 +00 +00 +00 +06 +00 +fc +52 +00 +00 +02 +00 +00 +00 +06 +00 +00 +53 +00 +00 +02 +00 +00 +00 +06 +00 +04 +53 +00 +00 +02 +00 +00 +00 +06 +00 +08 +53 +00 +00 +02 +00 +00 +00 +06 +00 +0c +53 +00 +00 +02 +00 +00 +00 +06 +00 +10 +53 +00 +00 +02 +00 +00 +00 +06 +00 +14 +53 +00 +00 +02 +00 +00 +00 +06 +00 +18 +53 +00 +00 +02 +00 +00 +00 +06 +00 +1c +53 +00 +00 +02 +00 +00 +00 +06 +00 +20 +53 +00 +00 +02 +00 +00 +00 +06 +00 +24 +53 +00 +00 +02 +00 +00 +00 +06 +00 +28 +53 +00 +00 +02 +00 +00 +00 +06 +00 +2c +53 +00 +00 +02 +00 +00 +00 +06 +00 +30 +53 +00 +00 +02 +00 +00 +00 +06 +00 +34 +53 +00 +00 +02 +00 +00 +00 +06 +00 +38 +53 +00 +00 +02 +00 +00 +00 +06 +00 +3c +53 +00 +00 +02 +00 +00 +00 +06 +00 +40 +53 +00 +00 +02 +00 +00 +00 +06 +00 +44 +53 +00 +00 +02 +00 +00 +00 +06 +00 +48 +53 +00 +00 +02 +00 +00 +00 +06 +00 +4c +53 +00 +00 +02 +00 +00 +00 +06 +00 +50 +53 +00 +00 +02 +00 +00 +00 +06 +00 +54 +53 +00 +00 +02 +00 +00 +00 +06 +00 +58 +53 +00 +00 +02 +00 +00 +00 +06 +00 +5c +53 +00 +00 +02 +00 +00 +00 +06 +00 +60 +53 +00 +00 +02 +00 +00 +00 +06 +00 +64 +53 +00 +00 +02 +00 +00 +00 +06 +00 +68 +53 +00 +00 +02 +00 +00 +00 +06 +00 +6c +53 +00 +00 +02 +00 +00 +00 +06 +00 +70 +53 +00 +00 +02 +00 +00 +00 +06 +00 +74 +53 +00 +00 +02 +00 +00 +00 +06 +00 +78 +53 +00 +00 +02 +00 +00 +00 +06 +00 +7c +53 +00 +00 +02 +00 +00 +00 +06 +00 +80 +53 +00 +00 +02 +00 +00 +00 +06 +00 +84 +53 +00 +00 +02 +00 +00 +00 +06 +00 +88 +53 +00 +00 +02 +00 +00 +00 +06 +00 +8c +53 +00 +00 +02 +00 +00 +00 +06 +00 +90 +53 +00 +00 +02 +00 +00 +00 +06 +00 +94 +53 +00 +00 +02 +00 +00 +00 +06 +00 +98 +53 +00 +00 +02 +00 +00 +00 +06 +00 +9c +53 +00 +00 +02 +00 +00 +00 +06 +00 +a0 +53 +00 +00 +02 +00 +00 +00 +06 +00 +a4 +53 +00 +00 +02 +00 +00 +00 +06 +00 +a8 +53 +00 +00 +02 +00 +00 +00 +06 +00 +ac +53 +00 +00 +02 +00 +00 +00 +06 +00 +b0 +53 +00 +00 +02 +00 +00 +00 +06 +00 +b4 +53 +00 +00 +02 +00 +00 +00 +06 +00 +b8 +53 +00 +00 +02 +00 +00 +00 +06 +00 +bc +53 +00 +00 +02 +00 +00 +00 +06 +00 +c0 +53 +00 +00 +02 +00 +00 +00 +06 +00 +c4 +53 +00 +00 +02 +00 +00 +00 +06 +00 +c8 +53 +00 +00 +02 +00 +00 +00 +06 +00 +cc +53 +00 +00 +02 +00 +00 +00 +06 +00 +d0 +53 +00 +00 +02 +00 +00 +00 +06 +00 +d4 +53 +00 +00 +02 +00 +00 +00 +06 +00 +d8 +53 +00 +00 +02 +00 +00 +00 +06 +00 +dc +53 +00 +00 +02 +00 +00 +00 +06 +00 +e0 +53 +00 +00 +02 +00 +00 +00 +06 +00 +e4 +53 +00 +00 +02 +00 +00 +00 +06 +00 +e8 +53 +00 +00 +02 +00 +00 +00 +06 +00 +ec +53 +00 +00 +02 +00 +00 +00 +06 +00 +f0 +53 +00 +00 +02 +00 +00 +00 +06 +00 +f4 +53 +00 +00 +02 +00 +00 +00 +06 +00 +f8 +53 +00 +00 +02 +00 +00 +00 +06 +00 +fc +53 +00 +00 +02 +00 +00 +00 +06 +00 +00 +54 +00 +00 +02 +00 +00 +00 +06 +00 +04 +54 +00 +00 +02 +00 +00 +00 +06 +00 +08 +54 +00 +00 +02 +00 +00 +00 +06 +00 +0c +54 +00 +00 +02 +00 +00 +00 +06 +00 +10 +54 +00 +00 +02 +00 +00 +00 +06 +00 +14 +54 +00 +00 +02 +00 +00 +00 +06 +00 +18 +54 +00 +00 +02 +00 +00 +00 +06 +00 +1c +54 +00 +00 +02 +00 +00 +00 +06 +00 +20 +54 +00 +00 +02 +00 +00 +00 +06 +00 +24 +54 +00 +00 +02 +00 +00 +00 +06 +00 +28 +54 +00 +00 +02 +00 +00 +00 +06 +00 +2c +54 +00 +00 +02 +00 +00 +00 +06 +00 +30 +54 +00 +00 +02 +00 +00 +00 +06 +00 +34 +54 +00 +00 +02 +00 +00 +00 +06 +00 +38 +54 +00 +00 +02 +00 +00 +00 +06 +00 +3c +54 +00 +00 +02 +00 +00 +00 +06 +00 +40 +54 +00 +00 +02 +00 +00 +00 +06 +00 +44 +54 +00 +00 +02 +00 +00 +00 +06 +00 +48 +54 +00 +00 +02 +00 +00 +00 +06 +00 +4c +54 +00 +00 +02 +00 +00 +00 +06 +00 +50 +54 +00 +00 +02 +00 +00 +00 +06 +00 +54 +54 +00 +00 +02 +00 +00 +00 +06 +00 +58 +54 +00 +00 +02 +00 +00 +00 +06 +00 +5c +54 +00 +00 +02 +00 +00 +00 +06 +00 +60 +54 +00 +00 +02 +00 +00 +00 +06 +00 +64 +54 +00 +00 +02 +00 +00 +00 +06 +00 +68 +54 +00 +00 +02 +00 +00 +00 +06 +00 +6c +54 +00 +00 +02 +00 +00 +00 +06 +00 +70 +54 +00 +00 +02 +00 +00 +00 +06 +00 +74 +54 +00 +00 +02 +00 +00 +00 +06 +00 +78 +54 +00 +00 +02 +00 +00 +00 +06 +00 +7c +54 +00 +00 +02 +00 +00 +00 +06 +00 +80 +54 +00 +00 +02 +00 +00 +00 +06 +00 +84 +54 +00 +00 +02 +00 +00 +00 +06 +00 +88 +54 +00 +00 +02 +00 +00 +00 +06 +00 +8c +54 +00 +00 +02 +00 +00 +00 +06 +00 +90 +54 +00 +00 +02 +00 +00 +00 +06 +00 +94 +54 +00 +00 +02 +00 +00 +00 +06 +00 +98 +54 +00 +00 +02 +00 +00 +00 +06 +00 +9c +54 +00 +00 +02 +00 +00 +00 +06 +00 +a0 +54 +00 +00 +02 +00 +00 +00 +06 +00 +a4 +54 +00 +00 +02 +00 +00 +00 +06 +00 +a8 +54 +00 +00 +02 +00 +00 +00 +06 +00 +ac +54 +00 +00 +02 +00 +00 +00 +06 +00 +b0 +54 +00 +00 +02 +00 +00 +00 +06 +00 +b4 +54 +00 +00 +02 +00 +00 +00 +06 +00 +b8 +54 +00 +00 +02 +00 +00 +00 +06 +00 +bc +54 +00 +00 +02 +00 +00 +00 +06 +00 +c0 +54 +00 +00 +02 +00 +00 +00 +06 +00 +c4 +54 +00 +00 +02 +00 +00 +00 +06 +00 +c8 +54 +00 +00 +02 +00 +00 +00 +06 +00 +cc +54 +00 +00 +02 +00 +00 +00 +06 +00 +d0 +54 +00 +00 +02 +00 +00 +00 +06 +00 +d4 +54 +00 +00 +02 +00 +00 +00 +06 +00 +d8 +54 +00 +00 +02 +00 +00 +00 +06 +00 +dc +54 +00 +00 +02 +00 +00 +00 +06 +00 +e0 +54 +00 +00 +02 +00 +00 +00 +06 +00 +e4 +54 +00 +00 +02 +00 +00 +00 +06 +00 +e8 +54 +00 +00 +02 +00 +00 +00 +06 +00 +ec +54 +00 +00 +02 +00 +00 +00 +06 +00 +f0 +54 +00 +00 +02 +00 +00 +00 +06 +00 +f4 +54 +00 +00 +02 +00 +00 +00 +06 +00 +f8 +54 +00 +00 +02 +00 +00 +00 +06 +00 +fc +54 +00 +00 +02 +00 +00 +00 +06 +00 +00 55 -2a -01 +00 00 02 00 @@ -104469,9 +103569,9 @@ fd 00 06 00 -59 -2a -01 +04 +55 +00 00 02 00 @@ -104479,9 +103579,9 @@ fd 00 06 00 -5d -2a -01 +08 +55 +00 00 02 00 @@ -104489,9 +103589,9 @@ fd 00 06 00 -61 -2a -01 +0c +55 +00 00 02 00 @@ -104499,9 +103599,9 @@ fd 00 06 00 -65 -2a -01 +10 +55 +00 00 02 00 @@ -104509,9 +103609,9 @@ fd 00 06 00 -69 -2a -01 +14 +55 +00 00 02 00 @@ -104519,9 +103619,9 @@ fd 00 06 00 -6d -2a -01 +18 +55 +00 00 02 00 @@ -104529,9 +103629,9 @@ fd 00 06 00 -71 -2a -01 +1c +55 +00 00 02 00 @@ -104539,9 +103639,9 @@ fd 00 06 00 -75 -2a -01 +20 +55 +00 00 02 00 @@ -104549,9 +103649,9 @@ fd 00 06 00 -79 -2a -01 +24 +55 +00 00 02 00 @@ -104559,9 +103659,9 @@ fd 00 06 00 -7d -2a -01 +28 +55 +00 00 02 00 @@ -104569,9 +103669,9 @@ fd 00 06 00 -81 -2a -01 +2c +55 +00 00 02 00 @@ -104579,9 +103679,9 @@ fd 00 06 00 -85 -2a -01 +30 +55 +00 00 02 00 @@ -104589,9 +103689,9 @@ fd 00 06 00 -89 -2a -01 +34 +55 +00 00 02 00 @@ -104599,9 +103699,9 @@ fd 00 06 00 -8d -2a -01 +38 +55 +00 00 02 00 @@ -104609,9 +103709,9 @@ fd 00 06 00 -91 -2a -01 +3c +55 +00 00 02 00 @@ -104619,9 +103719,9 @@ fd 00 06 00 -95 -2a -01 +40 +55 +00 00 02 00 @@ -104629,9 +103729,9 @@ fd 00 06 00 -99 -2a -01 +44 +55 +00 00 02 00 @@ -104639,9 +103739,9 @@ fd 00 06 00 -9d -2a -01 +48 +55 +00 00 02 00 @@ -104649,9 +103749,9 @@ fd 00 06 00 -a1 -2a -01 +4c +55 +00 00 02 00 @@ -104659,9 +103759,9 @@ a1 00 06 00 -a5 -2a -01 +50 +55 +00 00 02 00 @@ -104669,9 +103769,9 @@ a5 00 06 00 -a9 -2a -01 +54 +55 +00 00 02 00 @@ -104679,9 +103779,9 @@ a9 00 06 00 -ad -2a -01 +58 +55 +00 00 02 00 @@ -104689,9 +103789,9 @@ ad 00 06 00 -b1 -2a -01 +5c +55 +00 00 02 00 @@ -104699,9 +103799,9 @@ b1 00 06 00 -b5 -2a -01 +60 +55 +00 00 02 00 @@ -104709,9 +103809,9 @@ b5 00 06 00 -b9 -2a -01 +64 +55 +00 00 02 00 @@ -104719,9 +103819,9 @@ b9 00 06 00 -bd -2a -01 +68 +55 +00 00 02 00 @@ -104729,9 +103829,9 @@ bd 00 06 00 -c1 -2a -01 +6c +55 +00 00 02 00 @@ -104739,9 +103839,9 @@ c1 00 06 00 -c5 -2a -01 +70 +55 +00 00 02 00 @@ -104749,9 +103849,9 @@ c5 00 06 00 -c9 -2a -01 +74 +55 +00 00 02 00 @@ -104759,9 +103859,9 @@ c9 00 06 00 -cd -2a -01 +78 +55 +00 00 02 00 @@ -104769,9 +103869,9 @@ cd 00 06 00 -d1 -2a -01 +7c +55 +00 00 02 00 @@ -104779,9 +103879,9 @@ d1 00 06 00 -d5 -2a -01 +80 +55 +00 00 02 00 @@ -104789,9 +103889,9 @@ d5 00 06 00 -d9 -2a -01 +84 +55 +00 00 02 00 @@ -104799,9 +103899,9 @@ d9 00 06 00 -dd -2a -01 +88 +55 +00 00 02 00 @@ -104809,9 +103909,9 @@ dd 00 06 00 -e1 -2a -01 +8c +55 +00 00 02 00 @@ -104819,9 +103919,9 @@ e1 00 06 00 -e5 -2a -01 +90 +55 +00 00 02 00 @@ -104829,9 +103929,9 @@ e5 00 06 00 -e9 -2a -01 +94 +55 +00 00 02 00 @@ -104839,9 +103939,9 @@ e9 00 06 00 -ed -2a -01 +98 +55 +00 00 02 00 @@ -104849,9 +103949,9 @@ ed 00 06 00 -f1 -2a -01 +9c +55 +00 00 02 00 @@ -104859,9 +103959,9 @@ f1 00 06 00 -f5 -2a -01 +a0 +55 +00 00 02 00 @@ -104869,9 +103969,9 @@ f5 00 06 00 -f9 -2a -01 +a4 +55 +00 00 02 00 @@ -104879,9 +103979,9 @@ f9 00 06 00 -fd -2a -01 +a8 +55 +00 00 02 00 @@ -104889,9 +103989,9 @@ fd 00 06 00 -01 -2b -01 +ac +55 +00 00 02 00 @@ -104899,9 +103999,9 @@ fd 00 06 00 -05 -2b -01 +b0 +55 +00 00 02 00 @@ -104909,9 +104009,9 @@ fd 00 06 00 -09 -2b -01 +b4 +55 +00 00 02 00 @@ -104919,9 +104019,909 @@ fd 00 06 00 -0d -2b -01 +b8 +55 +00 +00 +02 +00 +00 +00 +06 +00 +bc +55 +00 +00 +02 +00 +00 +00 +06 +00 +c0 +55 +00 +00 +02 +00 +00 +00 +06 +00 +c4 +55 +00 +00 +02 +00 +00 +00 +06 +00 +c8 +55 +00 +00 +02 +00 +00 +00 +06 +00 +cc +55 +00 +00 +02 +00 +00 +00 +06 +00 +d0 +55 +00 +00 +02 +00 +00 +00 +06 +00 +d4 +55 +00 +00 +02 +00 +00 +00 +06 +00 +d8 +55 +00 +00 +02 +00 +00 +00 +06 +00 +dc +55 +00 +00 +02 +00 +00 +00 +06 +00 +e0 +55 +00 +00 +02 +00 +00 +00 +06 +00 +e4 +55 +00 +00 +02 +00 +00 +00 +06 +00 +e8 +55 +00 +00 +02 +00 +00 +00 +06 +00 +ec +55 +00 +00 +02 +00 +00 +00 +06 +00 +f0 +55 +00 +00 +02 +00 +00 +00 +06 +00 +f4 +55 +00 +00 +02 +00 +00 +00 +06 +00 +f8 +55 +00 +00 +02 +00 +00 +00 +06 +00 +fc +55 +00 +00 +02 +00 +00 +00 +06 +00 +00 +56 +00 +00 +02 +00 +00 +00 +06 +00 +04 +56 +00 +00 +02 +00 +00 +00 +06 +00 +08 +56 +00 +00 +02 +00 +00 +00 +06 +00 +0c +56 +00 +00 +02 +00 +00 +00 +06 +00 +10 +56 +00 +00 +02 +00 +00 +00 +06 +00 +14 +56 +00 +00 +02 +00 +00 +00 +06 +00 +18 +56 +00 +00 +02 +00 +00 +00 +06 +00 +1c +56 +00 +00 +02 +00 +00 +00 +06 +00 +20 +56 +00 +00 +02 +00 +00 +00 +06 +00 +24 +56 +00 +00 +02 +00 +00 +00 +06 +00 +28 +56 +00 +00 +02 +00 +00 +00 +06 +00 +2c +56 +00 +00 +02 +00 +00 +00 +06 +00 +30 +56 +00 +00 +02 +00 +00 +00 +06 +00 +34 +56 +00 +00 +02 +00 +00 +00 +06 +00 +38 +56 +00 +00 +02 +00 +00 +00 +06 +00 +3c +56 +00 +00 +02 +00 +00 +00 +06 +00 +40 +56 +00 +00 +02 +00 +00 +00 +06 +00 +44 +56 +00 +00 +02 +00 +00 +00 +06 +00 +48 +56 +00 +00 +02 +00 +00 +00 +06 +00 +4c +56 +00 +00 +02 +00 +00 +00 +06 +00 +50 +56 +00 +00 +02 +00 +00 +00 +06 +00 +54 +56 +00 +00 +02 +00 +00 +00 +06 +00 +58 +56 +00 +00 +02 +00 +00 +00 +06 +00 +5c +56 +00 +00 +02 +00 +00 +00 +06 +00 +60 +56 +00 +00 +02 +00 +00 +00 +06 +00 +64 +56 +00 +00 +02 +00 +00 +00 +06 +00 +68 +56 +00 +00 +02 +00 +00 +00 +06 +00 +6c +56 +00 +00 +02 +00 +00 +00 +06 +00 +70 +56 +00 +00 +02 +00 +00 +00 +06 +00 +74 +56 +00 +00 +02 +00 +00 +00 +06 +00 +78 +56 +00 +00 +02 +00 +00 +00 +06 +00 +7c +56 +00 +00 +02 +00 +00 +00 +06 +00 +80 +56 +00 +00 +02 +00 +00 +00 +06 +00 +84 +56 +00 +00 +02 +00 +00 +00 +06 +00 +88 +56 +00 +00 +02 +00 +00 +00 +06 +00 +8c +56 +00 +00 +02 +00 +00 +00 +06 +00 +90 +56 +00 +00 +02 +00 +00 +00 +06 +00 +94 +56 +00 +00 +02 +00 +00 +00 +06 +00 +98 +56 +00 +00 +02 +00 +00 +00 +06 +00 +9c +56 +00 +00 +02 +00 +00 +00 +06 +00 +a0 +56 +00 +00 +02 +00 +00 +00 +06 +00 +a4 +56 +00 +00 +02 +00 +00 +00 +06 +00 +a8 +56 +00 +00 +02 +00 +00 +00 +06 +00 +ac +56 +00 +00 +02 +00 +00 +00 +06 +00 +b0 +56 +00 +00 +02 +00 +00 +00 +06 +00 +b4 +56 +00 +00 +02 +00 +00 +00 +06 +00 +b8 +56 +00 +00 +02 +00 +00 +00 +06 +00 +bc +56 +00 +00 +02 +00 +00 +00 +06 +00 +c0 +56 +00 +00 +02 +00 +00 +00 +06 +00 +c4 +56 +00 +00 +02 +00 +00 +00 +06 +00 +c8 +56 +00 +00 +02 +00 +00 +00 +06 +00 +cc +56 +00 +00 +02 +00 +00 +00 +06 +00 +d0 +56 +00 +00 +02 +00 +00 +00 +06 +00 +d4 +56 +00 +00 +02 +00 +00 +00 +06 +00 +d8 +56 +00 +00 +02 +00 +00 +00 +06 +00 +dc +56 +00 +00 +02 +00 +00 +00 +06 +00 +e0 +56 +00 +00 +02 +00 +00 +00 +06 +00 +e4 +56 +00 +00 +02 +00 +00 +00 +06 +00 +e8 +56 +00 +00 +02 +00 +00 +00 +06 +00 +ec +56 +00 +00 +02 +00 +00 +00 +06 +00 +f0 +56 +00 +00 +02 +00 +00 +00 +06 +00 +f4 +56 +00 +00 +02 +00 +00 +00 +06 +00 +f8 +56 +00 +00 +02 +00 +00 +00 +06 +00 +fc +56 +00 +00 +02 +00 +00 +00 +06 +00 +00 +57 +00 +00 +02 +00 +00 +00 +06 +00 +04 +57 +00 +00 +02 +00 +00 +00 +06 +00 +08 +57 +00 +00 +02 +00 +00 +00 +06 +00 +0c +57 +00 +00 +02 +00 +00 +00 +06 +00 +10 +57 +00 +00 +02 +00 +00 +00 +06 +00 +14 +57 +00 +00 +02 +00 +00 +00 +06 +00 +18 +57 +00 +00 +02 +00 +00 +00 +06 +00 +1c +57 +00 +00 +02 +00 +00 +00 +06 +00 +20 +57 +00 00 02 00 @@ -105405,8 +105405,8 @@ f5 00 00 00 -e9 -d3 +00 +00 00 00 02 @@ -105441,8 +105441,8 @@ d3 74 61 00 -ed -d3 +00 +00 00 00 03 diff --git a/modules/objfmts/win32/tests/gas/win32at.hex b/modules/objfmts/win32/tests/gas/win32at.hex index d7bf5a0c..21edec5c 100644 --- a/modules/objfmts/win32/tests/gas/win32at.hex +++ b/modules/objfmts/win32/tests/gas/win32at.hex @@ -66,8 +66,8 @@ 74 61 00 -99 -01 +00 +00 00 00 00 @@ -106,8 +106,8 @@ 00 00 00 -07 -02 +00 +00 00 00 00 diff --git a/modules/objfmts/win32/tests/gas/win32secrel32.hex b/modules/objfmts/win32/tests/gas/win32secrel32.hex index 28cc8643..89103c06 100644 --- a/modules/objfmts/win32/tests/gas/win32secrel32.hex +++ b/modules/objfmts/win32/tests/gas/win32secrel32.hex @@ -66,7 +66,7 @@ 00 00 00 -20 +00 00 00 00 @@ -106,7 +106,7 @@ c0 61 00 00 -c0 +00 00 00 00 diff --git a/modules/objfmts/win32/tests/win32-curpos.hex b/modules/objfmts/win32/tests/win32-curpos.hex index bcedd9d5..e8cc7d68 100644 --- a/modules/objfmts/win32/tests/win32-curpos.hex +++ b/modules/objfmts/win32/tests/win32-curpos.hex @@ -66,7 +66,7 @@ a0 00 00 00 -14 +00 00 00 00 @@ -106,7 +106,7 @@ d0 00 00 00 -26 +00 00 00 00 diff --git a/modules/objfmts/win32/tests/win32-longsect.hex b/modules/objfmts/win32/tests/win32-longsect.hex index 57ab5286..fa507b16 100644 --- a/modules/objfmts/win32/tests/win32-longsect.hex +++ b/modules/objfmts/win32/tests/win32-longsect.hex @@ -106,7 +106,7 @@ 00 00 00 -04 +00 00 00 00 @@ -146,7 +146,7 @@ 6c 79 38 -08 +00 00 00 00 @@ -186,7 +186,7 @@ 00 00 00 -0c +00 00 00 00 @@ -226,7 +226,7 @@ 74 37 00 -10 +00 00 00 00 diff --git a/modules/objfmts/win32/tests/win32-safeseh.hex b/modules/objfmts/win32/tests/win32-safeseh.hex index d9a4cb5d..4ee1dd14 100644 --- a/modules/objfmts/win32/tests/win32-safeseh.hex +++ b/modules/objfmts/win32/tests/win32-safeseh.hex @@ -66,7 +66,7 @@ 74 61 00 -01 +00 00 00 00 diff --git a/modules/objfmts/win32/tests/win32-segof.hex b/modules/objfmts/win32/tests/win32-segof.hex index fd400133..6ad6a75f 100644 --- a/modules/objfmts/win32/tests/win32-segof.hex +++ b/modules/objfmts/win32/tests/win32-segof.hex @@ -66,7 +66,7 @@ 00 00 00 -0c +00 00 00 00 diff --git a/modules/objfmts/win32/tests/win32test.hex b/modules/objfmts/win32/tests/win32test.hex index 2548ee00..8e4cfa8a 100644 --- a/modules/objfmts/win32/tests/win32test.hex +++ b/modules/objfmts/win32/tests/win32test.hex @@ -66,7 +66,7 @@ c9 00 00 00 -3d +00 00 00 00 @@ -106,7 +106,7 @@ c0 00 00 00 -7d +00 00 00 00 diff --git a/modules/objfmts/win64/tests/gas/win64-gas-sce.hex b/modules/objfmts/win64/tests/gas/win64-gas-sce.hex index 4721c514..e50d860f 100644 --- a/modules/objfmts/win64/tests/gas/win64-gas-sce.hex +++ b/modules/objfmts/win64/tests/gas/win64-gas-sce.hex @@ -66,7 +66,7 @@ e9 61 00 00 -1b +00 00 00 00 @@ -106,7 +106,7 @@ a7 61 00 00 -33 +00 00 00 00 diff --git a/modules/objfmts/win64/tests/sce1.hex b/modules/objfmts/win64/tests/sce1.hex index d6b1427c..442ef944 100644 --- a/modules/objfmts/win64/tests/sce1.hex +++ b/modules/objfmts/win64/tests/sce1.hex @@ -66,7 +66,7 @@ 61 00 00 -3a +00 00 00 00 @@ -106,7 +106,7 @@ c6 61 00 00 -52 +00 00 00 00 diff --git a/modules/objfmts/win64/tests/sce2.hex b/modules/objfmts/win64/tests/sce2.hex index 1caa10c7..54bc0e9e 100644 --- a/modules/objfmts/win64/tests/sce2.hex +++ b/modules/objfmts/win64/tests/sce2.hex @@ -66,7 +66,7 @@ e3 61 00 00 -1d +00 00 00 00 @@ -106,7 +106,7 @@ a9 61 00 00 -2d +00 00 00 00 diff --git a/modules/objfmts/win64/tests/sce3.hex b/modules/objfmts/win64/tests/sce3.hex index cadf8b94..26fdb0c8 100644 --- a/modules/objfmts/win64/tests/sce3.hex +++ b/modules/objfmts/win64/tests/sce3.hex @@ -66,7 +66,7 @@ 61 00 00 -57 +00 00 00 00 @@ -106,7 +106,7 @@ e3 61 00 00 -7f +00 00 00 00 diff --git a/modules/objfmts/win64/tests/sce4.hex b/modules/objfmts/win64/tests/sce4.hex index 9a57d50d..e324697e 100644 --- a/modules/objfmts/win64/tests/sce4.hex +++ b/modules/objfmts/win64/tests/sce4.hex @@ -106,7 +106,7 @@ 61 00 00 -40 +00 00 00 00 diff --git a/modules/objfmts/win64/tests/win64-curpos.hex b/modules/objfmts/win64/tests/win64-curpos.hex index d7c51b10..14032abd 100644 --- a/modules/objfmts/win64/tests/win64-curpos.hex +++ b/modules/objfmts/win64/tests/win64-curpos.hex @@ -66,7 +66,7 @@ a1 00 00 00 -15 +00 00 00 00 @@ -106,7 +106,7 @@ d1 00 00 00 -27 +00 00 00 00 diff --git a/modules/objfmts/win64/tests/win64-dataref.hex b/modules/objfmts/win64/tests/win64-dataref.hex index fa604a6f..443727dd 100644 --- a/modules/objfmts/win64/tests/win64-dataref.hex +++ b/modules/objfmts/win64/tests/win64-dataref.hex @@ -66,8 +66,8 @@ a4 00 00 00 -a0 -01 +00 +00 00 00 00 @@ -106,8 +106,8 @@ c0 00 00 00 -ec -01 +00 +00 00 00 00 @@ -146,8 +146,8 @@ c0 61 00 00 -fc -01 +00 +00 00 00 00 @@ -186,8 +186,8 @@ fc 61 00 00 -08 -02 +00 +00 00 00 00 @@ -226,8 +226,8 @@ fc 00 00 00 -10 -02 +00 +00 00 00 00 diff --git a/modules/objfmts/win64/tests/win64-dataref2.hex b/modules/objfmts/win64/tests/win64-dataref2.hex index 1b7a430c..0555f0b2 100644 --- a/modules/objfmts/win64/tests/win64-dataref2.hex +++ b/modules/objfmts/win64/tests/win64-dataref2.hex @@ -66,7 +66,7 @@ c3 00 00 00 -29 +00 00 00 00 diff --git a/modules/objfmts/win64/tests/win64-imagebase.hex b/modules/objfmts/win64/tests/win64-imagebase.hex index b715eb43..04f00b80 100644 --- a/modules/objfmts/win64/tests/win64-imagebase.hex +++ b/modules/objfmts/win64/tests/win64-imagebase.hex @@ -66,7 +66,7 @@ b4 61 00 00 -02 +00 00 00 00 @@ -106,7 +106,7 @@ c2 61 00 00 -0e +00 00 00 00 @@ -146,7 +146,7 @@ e8 00 00 00 -16 +00 00 00 00 From 6818957d07ed4dfbcf21fbbb62fddfc2c93b28be Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 5 Oct 2014 09:48:51 -0700 Subject: [PATCH 495/585] Make cmake module search case-insensitive. This is needed to make things like "-f Win32" work, and matches the non-cmake behavior. [#276 state:resolved] --- libyasm/cmake-module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libyasm/cmake-module.c b/libyasm/cmake-module.c index 2ee39ca8..0133f902 100644 --- a/libyasm/cmake-module.c +++ b/libyasm/cmake-module.c @@ -58,7 +58,7 @@ yasm_register_module(yasm_module_type type, const char *keyword, void *data) assert(type < sizeof(loaded_modules)); if (!loaded_modules[type]) - loaded_modules[type] = HAMT_create(0, yasm_internal_error_); + loaded_modules[type] = HAMT_create(1, yasm_internal_error_); HAMT_insert(loaded_modules[type], keyword, data, &replace, load_module_destroy); From d7abe469f522d3806924dab3ac5b07dfd11986bc Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 5 Oct 2014 09:50:33 -0700 Subject: [PATCH 496/585] Fix a few more cases of case sensitivity in module handling. --- frontends/tasm/tasm.c | 7 ++++--- frontends/vsyasm/vsyasm.c | 9 +++++---- frontends/yasm/yasm.c | 13 +++++++------ 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/frontends/tasm/tasm.c b/frontends/tasm/tasm.c index 58954b64..8019ff75 100644 --- a/frontends/tasm/tasm.c +++ b/frontends/tasm/tasm.c @@ -356,7 +356,7 @@ do_assemble(void) apply_preproc_saved_options(); /* Get initial x86 BITS setting from object format */ - if (strcmp(cur_arch_module->keyword, "x86") == 0) { + if (yasm__strcasecmp(cur_arch_module->keyword, "x86") == 0) { yasm_arch_set_var(cur_arch, "mode_bits", cur_objfmt_module->default_x86_mode_bits); } @@ -380,7 +380,7 @@ do_assemble(void) check_errors(errwarns, object, linemap); /* open the object file for output (if not already opened by dbg objfmt) */ - if (!obj && strcmp(cur_objfmt_module->keyword, "dbg") != 0) { + if (!obj && yasm__strcasecmp(cur_objfmt_module->keyword, "dbg") != 0) { obj = open_file(obj_filename, "wb"); if (!obj) { cleanup(object); @@ -390,7 +390,8 @@ do_assemble(void) /* Write the object file */ yasm_objfmt_output(object, obj?obj:stderr, - strcmp(cur_dbgfmt_module->keyword, "null"), errwarns); + yasm__strcasecmp(cur_dbgfmt_module->keyword, "null"), + errwarns); /* Close object file */ if (obj) diff --git a/frontends/vsyasm/vsyasm.c b/frontends/vsyasm/vsyasm.c index 905145fa..1c0c3dfc 100644 --- a/frontends/vsyasm/vsyasm.c +++ b/frontends/vsyasm/vsyasm.c @@ -316,7 +316,7 @@ do_assemble(const char *in_filename) * machine to amd64. When we get more arches with multiple machines, * we should do this in a more modular fashion. */ - if (strcmp(cur_arch_module->keyword, "x86") == 0 && + if (yasm__strcasecmp(cur_arch_module->keyword, "x86") == 0 && cur_objfmt_module->default_x86_mode_bits == 64) machine_name = yasm__xstrdup("amd64"); else @@ -394,7 +394,7 @@ do_assemble(const char *in_filename) apply_preproc_saved_options(preproc); /* Get initial x86 BITS setting from object format */ - if (strcmp(cur_arch_module->keyword, "x86") == 0) { + if (yasm__strcasecmp(cur_arch_module->keyword, "x86") == 0) { yasm_arch_set_var(arch, "mode_bits", cur_objfmt_module->default_x86_mode_bits); } @@ -450,7 +450,7 @@ do_assemble(const char *in_filename) return EXIT_FAILURE; /* open the object file for output (if not already opened by dbg objfmt) */ - if (!obj && strcmp(cur_objfmt_module->keyword, "dbg") != 0) { + if (!obj && yasm__strcasecmp(cur_objfmt_module->keyword, "dbg") != 0) { obj = open_file(obj_filename, "wb"); if (!obj) { yasm_preproc_destroy(preproc); @@ -463,7 +463,8 @@ do_assemble(const char *in_filename) /* Write the object file */ yasm_objfmt_output(object, obj?obj:stderr, - strcmp(cur_dbgfmt_module->keyword, "null"), errwarns); + yasm__strcasecmp(cur_dbgfmt_module->keyword, "null"), + errwarns); /* Close object file */ if (obj) diff --git a/frontends/yasm/yasm.c b/frontends/yasm/yasm.c index ff4c59e2..7032e1fb 100644 --- a/frontends/yasm/yasm.c +++ b/frontends/yasm/yasm.c @@ -388,7 +388,7 @@ do_assemble(void) * machine to amd64. When we get more arches with multiple machines, * we should do this in a more modular fashion. */ - if (strcmp(cur_arch_module->keyword, "x86") == 0 && + if (yasm__strcasecmp(cur_arch_module->keyword, "x86") == 0 && cur_objfmt_module->default_x86_mode_bits == 64) machine_name = yasm__xstrdup("amd64"); else @@ -399,8 +399,8 @@ do_assemble(void) /* If we're using amd64 and the default objfmt is elfx32, change the * machine to "x32". */ - if (strcmp(machine_name, "amd64") == 0 && - strcmp(cur_objfmt_module->keyword, "elfx32") == 0) + if (yasm__strcasecmp(machine_name, "amd64") == 0 && + yasm__strcasecmp(cur_objfmt_module->keyword, "elfx32") == 0) machine = "x32"; else machine = machine_name; @@ -482,7 +482,7 @@ do_assemble(void) apply_preproc_saved_options(); /* Get initial x86 BITS setting from object format */ - if (strcmp(cur_arch_module->keyword, "x86") == 0) { + if (yasm__strcasecmp(cur_arch_module->keyword, "x86") == 0) { yasm_arch_set_var(cur_arch, "mode_bits", cur_objfmt_module->default_x86_mode_bits); } @@ -534,7 +534,7 @@ do_assemble(void) check_errors(errwarns, object, linemap); /* open the object file for output (if not already opened by dbg objfmt) */ - if (!obj && strcmp(cur_objfmt_module->keyword, "dbg") != 0) { + if (!obj && yasm__strcasecmp(cur_objfmt_module->keyword, "dbg") != 0) { obj = open_file(obj_filename, "wb"); if (!obj) { cleanup(object); @@ -544,7 +544,8 @@ do_assemble(void) /* Write the object file */ yasm_objfmt_output(object, obj?obj:stderr, - strcmp(cur_dbgfmt_module->keyword, "null"), errwarns); + yasm__strcasecmp(cur_dbgfmt_module->keyword, "null"), + errwarns); /* Close object file */ if (obj) From 85b88de12d227a3e014f3217b845876174579609 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 5 Oct 2014 10:10:08 -0700 Subject: [PATCH 497/585] Rename -E option to -Z. "-E" is too easily typoed for "-e", and is dangerous because it overwrites the following filename. "-E" is retained as a synonym for "-e". This change also makes yasm command-line consistent with NASM. --- frontends/vsyasm/vsyasm.c | 2 +- frontends/yasm/yasm.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/frontends/vsyasm/vsyasm.c b/frontends/vsyasm/vsyasm.c index 1c0c3dfc..a057b6f7 100644 --- a/frontends/vsyasm/vsyasm.c +++ b/frontends/vsyasm/vsyasm.c @@ -185,7 +185,7 @@ static opt_option options[] = N_("inhibits warning messages"), NULL }, { 'W', NULL, 0, opt_warning_handler, 0, N_("enables/disables warning"), NULL }, - { 'E', NULL, 1, opt_error_file, 0, + { 'Z', NULL, 1, opt_error_file, 0, N_("redirect error messages to file"), N_("file") }, { 's', NULL, 0, opt_error_stdout, 0, N_("redirect error messages to stdout"), NULL }, diff --git a/frontends/yasm/yasm.c b/frontends/yasm/yasm.c index 7032e1fb..74c16223 100644 --- a/frontends/yasm/yasm.c +++ b/frontends/yasm/yasm.c @@ -180,12 +180,14 @@ static opt_option options[] = N_("enables/disables warning"), NULL }, { 'M', NULL, 0, opt_makedep_handler, 0, N_("generate Makefile dependencies on stdout"), NULL }, - { 'E', NULL, 1, opt_error_file, 0, + { 'Z', NULL, 1, opt_error_file, 0, N_("redirect error messages to file"), N_("file") }, { 's', NULL, 0, opt_error_stdout, 0, N_("redirect error messages to stdout"), NULL }, { 'e', "preproc-only", 0, preproc_only_handler, 0, N_("preprocess only (writes output to stdout by default)"), NULL }, + { 'E', NULL, 0, preproc_only_handler, 0, + N_("preprocess only (writes output to stdout by default)"), NULL }, { 'i', NULL, 1, opt_include_option, 0, N_("add include path"), N_("path") }, { 'I', NULL, 1, opt_include_option, 0, From 1962750ea6c9f33c3530783c02e66f0e493bd046 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 5 Oct 2014 10:31:26 -0700 Subject: [PATCH 498/585] Allow -longopt as well as --longopt. This is more consistent with other tools. --- frontends/yasm/yasm-options.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/frontends/yasm/yasm-options.c b/frontends/yasm/yasm-options.c index eff6ba9a..1545c41a 100644 --- a/frontends/yasm/yasm-options.c +++ b/frontends/yasm/yasm-options.c @@ -112,6 +112,7 @@ parse_cmdline(int argc, char **argv, opt_option *options, size_t nopts, errors++; } else { /* sopt */ for (i = 0; i < nopts; i++) { + size_t optlen; if (argv[0][1] == options[i].sopt) { char *cmd = &argv[0][1]; char *param; @@ -137,6 +138,36 @@ parse_cmdline(int argc, char **argv, opt_option *options, size_t nopts, got_it = 1; break; } + /* also allow longopt with single dash */ + if (options[i].lopt && + strncmp(&argv[0][1], options[i].lopt, + (optlen = strlen(options[i].lopt))) == 0) { + char *param; + char c = argv[0][1 + optlen]; + + if (c != '\0' && c != '=' && !isspace(c)) + continue; + + if (options[i].takes_param) { + param = strchr(&argv[0][1], '='); + if (!param) { + print_error( + _("option `-%s' needs an argument!"), + options[i].lopt); + errors++; + goto fail; + } else { + *param = '\0'; + param++; + } + } else + param = NULL; + + if (!options[i]. + handler(&argv[0][1], param, options[i].extra)) + got_it = 1; + break; + } } if (!got_it && !other_option_handler(argv[0])) got_it = 1; From 0c2d90c6b3fed94f83d821894e926d606d091277 Mon Sep 17 00:00:00 2001 From: Denis Denisov Date: Sat, 15 Nov 2014 23:37:54 +0200 Subject: [PATCH 499/585] Fix yasm segfaults GNU assembler files on OS X Bug: http://tortall.lighthouseapp.com/projects/78676/tickets/269 --- modules/preprocs/gas/gas-preproc.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/modules/preprocs/gas/gas-preproc.c b/modules/preprocs/gas/gas-preproc.c index 96dec822..94d8f5da 100644 --- a/modules/preprocs/gas/gas-preproc.c +++ b/modules/preprocs/gas/gas-preproc.c @@ -409,12 +409,14 @@ static int gas_scan(void *preproc, struct tokenval *tokval) { "^^", TOKEN_DBL_XOR }, { "||", TOKEN_DBL_OR } }; - for (i = 0; i < sizeof(ops)/sizeof(ops[0]); i++) { - if (!strcmp(str, ops[i].op)) { - tokval->t_type = ops[i].token; - break; + if (strlen(str) > 1) { + for (i = 0; i < sizeof(ops)/sizeof(ops[0]); i++) { + if (!strncmp(str, ops[i].op, 2)) { + tokval->t_type = ops[i].token; + break; + } } - } + } } if (tokval->t_type != TOKEN_INVALID) { @@ -427,7 +429,7 @@ static int gas_scan(void *preproc, struct tokenval *tokval) tokval->t_type = c; /* Is it a symbol? If so we need to make it a TOKEN_ID. */ - if (isalpha(c) || c == '_' || c == '.') { + if (isalpha(c) || c == '_' || c == '.' || c == '%') { int symbol_length = 1; c = get_char(pp); @@ -829,7 +831,7 @@ static int eval_macro(yasm_preproc_gas *pp, int unused, char *args) skip_whitespace2(&line2); if (starts_with(line2, ".macro")) { nesting++; - } else if (starts_with(line, ".endm") && --nesting == 0) { + } else if (starts_with(line2, ".endm") && --nesting == 0) { return 1; } macro->num_lines++; From ac99773493eb399106da99d08bbf46580e4fe80b Mon Sep 17 00:00:00 2001 From: Scott Graham Date: Thu, 19 Feb 2015 17:05:38 -0800 Subject: [PATCH 500/585] Avoid shadowing warning when building with VS2015 --- tools/re2c/code.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/re2c/code.c b/tools/re2c/code.c index bd54baac..92e24d58 100644 --- a/tools/re2c/code.c +++ b/tools/re2c/code.c @@ -936,12 +936,12 @@ void DFA_emit(DFA *d, FILE *o){ oline++; useLabel(label); } else { - int i; + int j; fputs("\tswitch(YYGETSTATE()) {\n", o); fputs("\t\tcase -1: goto yy0;\n", o); - for (i=0; i Date: Sat, 16 May 2015 15:17:55 +0100 Subject: [PATCH 501/585] Add build files for Visual Studio 2015 --- Mkfiles/vc14/config.h | 170 ++++++++++ Mkfiles/vc14/crt_secure_no_deprecate.props | 11 + Mkfiles/vc14/crt_secure_no_deprecate.vsprops | 11 + Mkfiles/vc14/libyasm/libyasm.vcxproj | 277 ++++++++++++++++ Mkfiles/vc14/libyasm/libyasm.vcxproj.filters | 200 ++++++++++++ Mkfiles/vc14/modules/modules.vcxproj | 324 +++++++++++++++++++ Mkfiles/vc14/modules/modules.vcxproj.filters | 256 +++++++++++++++ Mkfiles/vc14/out_copy_rename.bat | 42 +++ Mkfiles/vc14/readme.vc14.txt | 106 ++++++ Mkfiles/vc14/vsyasm.props | 27 ++ Mkfiles/vc14/vsyasm.targets | 108 +++++++ Mkfiles/vc14/vsyasm.vcxproj | 279 ++++++++++++++++ Mkfiles/vc14/vsyasm.xml | 283 ++++++++++++++++ Mkfiles/vc14/yasm.sln | 142 ++++++++ Mkfiles/vc14/yasm.vcxproj | 283 ++++++++++++++++ Mkfiles/vc14/yasm.vcxproj.filters | 41 +++ Mkfiles/vc14/ytasm.vcxproj | 278 ++++++++++++++++ 17 files changed, 2838 insertions(+) create mode 100644 Mkfiles/vc14/config.h create mode 100644 Mkfiles/vc14/crt_secure_no_deprecate.props create mode 100644 Mkfiles/vc14/crt_secure_no_deprecate.vsprops create mode 100644 Mkfiles/vc14/libyasm/libyasm.vcxproj create mode 100644 Mkfiles/vc14/libyasm/libyasm.vcxproj.filters create mode 100644 Mkfiles/vc14/modules/modules.vcxproj create mode 100644 Mkfiles/vc14/modules/modules.vcxproj.filters create mode 100644 Mkfiles/vc14/out_copy_rename.bat create mode 100644 Mkfiles/vc14/readme.vc14.txt create mode 100644 Mkfiles/vc14/vsyasm.props create mode 100644 Mkfiles/vc14/vsyasm.targets create mode 100644 Mkfiles/vc14/vsyasm.vcxproj create mode 100644 Mkfiles/vc14/vsyasm.xml create mode 100644 Mkfiles/vc14/yasm.sln create mode 100644 Mkfiles/vc14/yasm.vcxproj create mode 100644 Mkfiles/vc14/yasm.vcxproj.filters create mode 100644 Mkfiles/vc14/ytasm.vcxproj diff --git a/Mkfiles/vc14/config.h b/Mkfiles/vc14/config.h new file mode 100644 index 00000000..8515ac5a --- /dev/null +++ b/Mkfiles/vc14/config.h @@ -0,0 +1,170 @@ +#include "YASM-VERSION.h" +#define yasm__splitpath(path, tail) yasm__splitpath_win(path, tail) +#define yasm__abspath(path) yasm__abspath_win(path) +#define yasm__combpath(from, to) yasm__combpath_win(from, to) + +/* Command name to run C preprocessor */ +#define CPP_PROG "cpp" + +/* */ +/* #undef ENABLE_NLS */ + +/* Define if you have the `abort' function. */ +#define HAVE_ABORT 1 + +/* */ +/* #undef HAVE_CATGETS */ + +/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYCURRENT */ + +/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +/* #undef HAVE_DCGETTEXT */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DIRECT_H 1 + +/* Define to 1 if you have the `getcwd' function. */ +#define HAVE_GETCWD 1 + +/* */ +/* #undef HAVE_GETTEXT */ + +/* Define if you have the GNU C Library */ +/* #undef HAVE_GNU_C_LIBRARY */ + +/* Define if you have the iconv() function. */ +/* #undef HAVE_ICONV */ + +/* Define if you have the header file. */ +/* #undef HAVE_INTTYPES_H */ + +/* */ +/* #undef HAVE_LC_MESSAGES */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LIBGEN_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_MEMORY_H */ + +/* Define if you have the `mergesort' function. */ +/* #undef HAVE_MERGESORT */ + +/* Define to 1 if you have the `popen' function. */ +/* #undef HAVE_POPEN */ + +/* Define if you have the header file. */ +/* #undef HAVE_STDINT_H */ + +/* Define if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* */ +/* #undef HAVE_STPCPY */ + +/* Define if you have the `strcasecmp' function. */ +/* #undef HAVE_STRCASECMP */ + +/* Define if you have the `strcmpi' function. */ +/* #undef HAVE_STRCMPI */ + +/* Define if you have the `stricmp' function. */ +/* #undefine HAVE_STRICMP */ + +/* Define if you have the header file. */ +/* #undef HAVE_STRINGS_H */ + +/* Define if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define if you have the `strncasecmp' function. */ +/* #undef HAVE_STRNCASECMP */ + +/* Define if you have the `strsep' function. */ +/* #undef HAVE_STRSEP */ + +/* Define if you have the header file. */ +/* #undef HAVE_SYS_STAT_H */ + +/* Define if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define if you have the `toascii' function. */ +#define HAVE_TOASCII 1 +#define toascii __toascii + +/* Define if you have the header file. */ +/* #undef HAVE_UNISTD_H */ + +/* Define to 1 if you have the `vsnprintf' function. */ +/* #undef HAVE_VSNPRINTF */ + +/* Define to 1 if you have the `_stricmp' function. */ +#define HAVE__STRICMP 1 + +/* Name of package */ +#define PACKAGE "yasm" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "bug-yasm@tortall.net" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "yasm" + +/* Define to the full name and version of this package. */ +/*#define PACKAGE_STRING "yasm HEAD"*/ + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "yasm" + +/* Define to the version of this package. */ +/*#define PACKAGE_VERSION "HEAD"*/ + +/* Define if the C compiler supports function prototypes. */ +#define PROTOTYPES 1 + +/* The size of a `char', as computed by sizeof. */ +/* #undef SIZEOF_CHAR */ + +/* The size of a `int', as computed by sizeof. */ +/* #undef SIZEOF_INT */ + +/* The size of a `long', as computed by sizeof. */ +/* #undef SIZEOF_LONG */ + +/* The size of a `short', as computed by sizeof. */ +/* #undef SIZEOF_SHORT */ + +/* The size of a `void*', as computed by sizeof. */ +/* #undef SIZEOF_VOIDP */ + +/* Define if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Version number of package */ +#define VERSION "HEAD" + +/* Define if using the dmalloc debugging malloc package */ +/* #undef WITH_DMALLOC */ + +/* Define like PROTOTYPES; this can be used by system headers. */ +#define __PROTOTYPES 1 + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define as `__inline' if that's what the C compiler calls it, or to nothing + if it is not supported. */ +#ifndef __cplusplus +/* #undef inline */ +#endif + +/* Define to `unsigned' if doesn't define. */ +/* #undef size_t */ diff --git a/Mkfiles/vc14/crt_secure_no_deprecate.props b/Mkfiles/vc14/crt_secure_no_deprecate.props new file mode 100644 index 00000000..777d6d0a --- /dev/null +++ b/Mkfiles/vc14/crt_secure_no_deprecate.props @@ -0,0 +1,11 @@ + + + + <_ProjectFileVersion>10.0.21006.1 + + + + _CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + + + \ No newline at end of file diff --git a/Mkfiles/vc14/crt_secure_no_deprecate.vsprops b/Mkfiles/vc14/crt_secure_no_deprecate.vsprops new file mode 100644 index 00000000..56ab506f --- /dev/null +++ b/Mkfiles/vc14/crt_secure_no_deprecate.vsprops @@ -0,0 +1,11 @@ + + + + diff --git a/Mkfiles/vc14/libyasm/libyasm.vcxproj b/Mkfiles/vc14/libyasm/libyasm.vcxproj new file mode 100644 index 00000000..362aa2a3 --- /dev/null +++ b/Mkfiles/vc14/libyasm/libyasm.vcxproj @@ -0,0 +1,277 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {29FE7874-1256-4AD6-B889-68E399DC9608} + libyasm + + + + StaticLibrary + false + MultiByte + v140 + + + StaticLibrary + false + MultiByte + v140 + + + StaticLibrary + false + MultiByte + v140 + + + StaticLibrary + false + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + + + + Full + Default + ..;../../..;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)libyasm.lib + true + + + + + X64 + + + Full + Default + ..;../../..;%(AdditionalIncludeDirectories) + NDEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)libyasm.lib + true + + + + + Disabled + ..;../../..;%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)libyasm.lib + true + + + + + X64 + + + Disabled + ..;../../..;%(AdditionalIncludeDirectories) + _DEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)libyasm.lib + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {f0e8b707-00c5-4ff2-b8ef-7c39817132a0} + false + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc14/libyasm/libyasm.vcxproj.filters b/Mkfiles/vc14/libyasm/libyasm.vcxproj.filters new file mode 100644 index 00000000..9bdf13a4 --- /dev/null +++ b/Mkfiles/vc14/libyasm/libyasm.vcxproj.filters @@ -0,0 +1,200 @@ + + + + + {4ca3b698-9d01-4e4e-ae00-5c98da045efe} + h;hpp;hxx;hm;inl + + + {68607062-982d-4251-9a1a-30f76474983d} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Source Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc14/modules/modules.vcxproj b/Mkfiles/vc14/modules/modules.vcxproj new file mode 100644 index 00000000..ceb14114 --- /dev/null +++ b/Mkfiles/vc14/modules/modules.vcxproj @@ -0,0 +1,324 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6} + modules + + + + StaticLibrary + false + MultiByte + v140 + + + StaticLibrary + false + MultiByte + v140 + + + StaticLibrary + false + MultiByte + v140 + + + StaticLibrary + false + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + + + + Full + Default + ..;../../..;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)modules.lib + true + + + + + + + + + X64 + + + Full + Default + ..;../../..;%(AdditionalIncludeDirectories) + NDEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)modules.lib + true + + + + + Disabled + ..;../../..;%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)modules.lib + true + + + + + X64 + + + Disabled + ..;../../..;%(AdditionalIncludeDirectories) + _DEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)modules.lib + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {225700a5-07b8-434e-ad61-555278bf6733} + false + + + {c45a8b59-8b59-4d5d-a8e8-fb090f8dd619} + false + + + {29fe7874-1256-4ad6-b889-68e399dc9608} + false + + + {3c58be13-50a3-4583-984d-d8902b3d7713} + false + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc14/modules/modules.vcxproj.filters b/Mkfiles/vc14/modules/modules.vcxproj.filters new file mode 100644 index 00000000..e6ff3add --- /dev/null +++ b/Mkfiles/vc14/modules/modules.vcxproj.filters @@ -0,0 +1,256 @@ + + + + + {39c89f91-d860-4396-a49f-86b8b7a51c33} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {be0cdf28-cbed-4774-b3cc-b63e4e3fa0a9} + + + {491cc60a-889b-4f53-aae9-f4d7d6aa667a} + + + {c084015d-3c3e-4379-8746-ae5cffcec79e} + + + {3333e0b3-e95f-44f6-9000-58d4da368360} + + + {528f2955-ceba-4691-a36c-054f119e3dcc} + + + {81686d52-eb71-4d4a-a830-66c45afb808f} + + + {98fe1e43-3794-4639-bf29-14b0c569754f} + + + {6b3956d4-0bff-4e8e-af61-a7e59b476fa4} + + + {446fad62-ac17-49e9-8263-33481f04f182} + + + {33fb7fc8-61f9-428d-9c94-7a4912fbb678} + + + {48fc77ec-7d78-4c0a-bfc2-9aa76faf5d7f} + + + + + Source Files\parsers + + + Source Files\arch + + + Source Files\arch + + + Source Files\arch + + + Source Files\arch + + + Source Files\arch + + + Source Files\arch + + + Source Files\arch + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\listfmts\nasm + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\parsers + + + Source Files\parsers + + + Source Files\parsers + + + Source Files\parsers + + + Source Files\parsers + + + Source Files\preprocs\cpp + + + Source Files\preprocs\gas + + + Source Files\preprocs\gas + + + Source Files\preprocs\nasm + + + Source Files\preprocs\nasm + + + Source Files\preprocs\nasm + + + Source Files\preprocs\nasm + + + Source Files\preprocs\raw + + + Source Files\parsers + + + Source Files\arch + + + Source Files\arch + + + Source Files\objfmts + + + + + Source Files\arch + + + Source Files\arch + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\parsers + + + Source Files\parsers + + + Source Files\preprocs\gas + + + Source Files\preprocs\nasm + + + Source Files\preprocs\nasm + + + Source Files\preprocs\nasm + + + Source Files\preprocs\nasm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc14/out_copy_rename.bat b/Mkfiles/vc14/out_copy_rename.bat new file mode 100644 index 00000000..3179b59a --- /dev/null +++ b/Mkfiles/vc14/out_copy_rename.bat @@ -0,0 +1,42 @@ +@echo off +if not exist %1 goto nofile +if exist %2 goto copy + +echo creating directory %2 +md %2 > nul + +:copy +set str=%2 +for /f "useback tokens=*" %%a in ('%str%') do set str=%%~a +set str=%str:~-1% +if %str% == "\" goto hasbackslash + +if not exist %2\%3 goto cpy +fc %1 %2\%3 > nul && if not %errorlevel 1 goto exit +echo overwriting %2\%3 with %1 +copy %1 %2\%3 > nul +goto exit + +:cpy +echo copying %1 to %2\%3 +copy %1 %2\%3 > nul +goto exit + +:hasbackslash +if not exist %2%3 goto cpy2 +fc %1 %2%3 > nul && if not %errorlevel 1 goto exit +echo overwriting %2%3 with %1 +copy %1 %2%3 > nul +goto exit + +:cpy2 +echo copying %1 to %2%3 +copy %1 %2%3 > nul +goto exit + +:nofile +echo %1 not found + +:exit + + diff --git a/Mkfiles/vc14/readme.vc14.txt b/Mkfiles/vc14/readme.vc14.txt new file mode 100644 index 00000000..ea716567 --- /dev/null +++ b/Mkfiles/vc14/readme.vc14.txt @@ -0,0 +1,106 @@ +Building YASM with Microsoft Visual Studio 2015 (C/C++ v14) +----------------------------------------------------------- + +This note describes how to build YASM using Microsoft Visual +Studio 2015 (C/C++ v14). + +1. YASM Download +---------------- + +First YASM needs to be downloaded and the files placed within +a suitable directory, which will be called here but can +be named and located as you wish. + +2. Building YASM with Microsoft 2015 (VC14) +------------------------------------------- + +Now locate and double click on the yasm.sln solution file in +the 'Mkfiles/vc14' subdirectory to open the build project in +the Visual Studio 2015 IDE and then select: + + win32 or x64 build + release or debug build + +as appropriate to build the YASM binaries that you need. + +4. Using YASM with Visual Sudio 2015 and VC++ version 14 +-------------------------------------------------------- + +The YASM version vsyasm.exe is designed specifically for use +with the 2010 and later versions of Visual Studio. To tell +Visual Studio where to find vsyasm.exe, the environment +variable YASMPATH can be set to the absolute path of the +directory in which vsyasm.exe is located (this path should +include the final backslash). + +Alternatively you can find the directory (or directories) +where the VC++ compiler binaries are located and put copies +of the vsyasm.exe binary in these directories. The typical +location on 64-bit Windows is: + +C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin + +On 32-bit Windows it is normally at: + +C:\Program Files\Microsoft Visual Studio 14.0\VC\bin + +Depending on your system you can use either the win32 or the +x64 version of vsyasm.exe, which must be named vsyasm.exe. + +To use the custom tools facility in Visual Studio 2015, you +need to place a copy of three files - yasm.props, yasm.targets +and yasm.xml - into a location where they can be found by the +Visual Studio build customisation processes. There are several +ways to do this: + + a. put these files in the MSBUILD customisation directory, + which is typically at: + + C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\BuildCustomizations + + b. put them in a convenient location and set this path in the + 'Build Customisations Search Path' in the Visual Studio + 'Projects and Solutions|VC++ Project Settings' item in + the 'Tools|Options' menu; + + c. put them in a convenient location and set this path in the + 'Build Customisation dialogue (discussed later). + +To use YASM in a project, right click on the project in the Solution +Explorer and select 'Build Customisations..'. This will give you a +dialog box that allows you to select YASM as an assembler (note that +your assembler files need to have the extension '.asm'). If you have +used option c. above, you will need to let the dialogue find them +using the 'Find Existing' button below the dialogue. + +To assemble a file with YASM, select the Property Page for the file +and the select 'Yasm Assembler' in the Tool dialog entry. Then click +'Apply' and an additional property page entry will appear and enable +YASM settings to be established. + +5. A Linker Issue +----------------- + +There appears to be a linker bug in the VC++ linker that prevents +symbols with absolute addresses being linked in DLL builds. This +means, for example, that LEA instructions of the general form: + + lea, rax,[rax+symbol] + +cannot be used for DLL builds. The following general form +has to be used instead: + + lea rcx,[symbol wrt rip] + lea rax,[rax+rcx] + +This limitation may also cause problems with other instruction +that use absolute addresses. + +6. Acknowledgements +------------------- + +I am most grateful for the fantastic support that Peter Johnson, +YASM's creator, has given me in tracking down issues in using +YASM for the production of Windows x64 code. + + Brian Gladman, 30th April 2015 diff --git a/Mkfiles/vc14/vsyasm.props b/Mkfiles/vc14/vsyasm.props new file mode 100644 index 00000000..80b93c7e --- /dev/null +++ b/Mkfiles/vc14/vsyasm.props @@ -0,0 +1,27 @@ + + + + Midl + CustomBuild + + + _SelectedFiles;$(YASMDependsOn) + + + $(VCInstallDir)bin\ + + + + False + $(IntDir) + 0 + 0 + "$(YasmPath)"vsyasm.exe -Xvc -f $(Platform) [AllOptions] [AdditionalOptions] [Inputs] + %(ObjectFile) + Assembling %(Filename)%(Extension) + false + + + \ No newline at end of file diff --git a/Mkfiles/vc14/vsyasm.targets b/Mkfiles/vc14/vsyasm.targets new file mode 100644 index 00000000..3c084119 --- /dev/null +++ b/Mkfiles/vc14/vsyasm.targets @@ -0,0 +1,108 @@ + + + + + + _YASM + + + + $(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml + + + + + + + + @(YASM, '|') + + + + + + + + + $(ComputeLinkInputsTargets); + ComputeYASMOutput; + + + $(ComputeLibInputsTargets); + ComputeYASMOutput; + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc14/vsyasm.vcxproj b/Mkfiles/vc14/vsyasm.vcxproj new file mode 100644 index 00000000..98283b10 --- /dev/null +++ b/Mkfiles/vc14/vsyasm.vcxproj @@ -0,0 +1,279 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {7FDD85BB-CC86-442B-A425-989B5B296ED5} + vsyasm + + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + + + + $(Platform)\$(Configuration)/yasm.tlb + + + + + Disabled + .;../..;%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)vsyasm.exe + true + true + $(OutDir)$(ProjectName).pdb + Console + false + + + MachineX86 + + + + + X64 + $(Platform)\$(Configuration)/yasm.tlb + + + + + Disabled + .;../..;%(AdditionalIncludeDirectories) + _DEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)vsyasm.exe + true + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX64 + + + + + $(Platform)\$(Configuration)/yasm.tlb + + + + + Full + Default + true + .;../..;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)vsyasm.exe + true + true + $(OutDir)$(ProjectName).pdb + Console + false + + + MachineX86 + + + + + X64 + $(Platform)\$(Configuration)/yasm.tlb + + + + + Full + OnlyExplicitInline + .;../..;%(AdditionalIncludeDirectories) + NDEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)vsyasm.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX64 + true + + + + + + + + + {29fe7874-1256-4ad6-b889-68e399dc9608} + false + + + {d715a3d4-efaa-442e-ad8b-5b4ff64e1dd6} + false + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc14/vsyasm.xml b/Mkfiles/vc14/vsyasm.xml new file mode 100644 index 00000000..cd08cbba --- /dev/null +++ b/Mkfiles/vc14/vsyasm.xml @@ -0,0 +1,283 @@ + + + + + + + + + + + + + General + + + + + + Symbols + + + + + + Files + + + + + + Command Line + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Execute Before + + + Specifies the targets for the build customization to run before. + + + + + + + + + + + + Execute After + + + Specifies the targets for the build customization to run after. + + + + + + + + + + + + + + + + + + Additional Options + + + Additional Options + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc14/yasm.sln b/Mkfiles/vc14/yasm.sln new file mode 100644 index 00000000..5d2dc952 --- /dev/null +++ b/Mkfiles/vc14/yasm.sln @@ -0,0 +1,142 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.22823.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{825AC694-358C-4D8D-92DE-33A2691978CE}" + ProjectSection(SolutionItems) = preProject + crt_secure_no_deprecate.vsprops = crt_secure_no_deprecate.vsprops + readme.vc14.txt = readme.vc14.txt + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libyasm", "libyasm\libyasm.vcxproj", "{29FE7874-1256-4AD6-B889-68E399DC9608}" + ProjectSection(ProjectDependencies) = postProject + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2} = {B545983B-8EE0-4A7B-A67A-E749EEAE62A2} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "modules", "modules\modules.vcxproj", "{D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yasm", "yasm.vcxproj", "{34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genmacro", "genmacro\genmacro.vcxproj", "{225700A5-07B8-434E-AD61-555278BF6733}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genversion", "genversion\genversion.vcxproj", "{B545983B-8EE0-4A7B-A67A-E749EEAE62A2}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "re2c", "re2c\re2c.vcxproj", "{3C58BE13-50A3-4583-984D-D8902B3D7713}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genperf", "genperf\genperf.vcxproj", "{C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genmodule", "genmodule\genmodule.vcxproj", "{F0E8B707-00C5-4FF2-B8EF-7C39817132A0}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genstring", "genstring\genstring.vcxproj", "{021CEB0A-F721-4F59-B349-9CEEAF244459}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ytasm", "ytasm.vcxproj", "{2162937B-0DBD-4450-B45F-DF578D8E7508}" + ProjectSection(ProjectDependencies) = postProject + {021CEB0A-F721-4F59-B349-9CEEAF244459} = {021CEB0A-F721-4F59-B349-9CEEAF244459} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vsyasm", "vsyasm.vcxproj", "{7FDD85BB-CC86-442B-A425-989B5B296ED5}" + ProjectSection(ProjectDependencies) = postProject + {021CEB0A-F721-4F59-B349-9CEEAF244459} = {021CEB0A-F721-4F59-B349-9CEEAF244459} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|Win32.ActiveCfg = Debug|Win32 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|Win32.Build.0 = Debug|Win32 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|x64.ActiveCfg = Debug|x64 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|x64.Build.0 = Debug|x64 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|Win32.ActiveCfg = Release|Win32 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|Win32.Build.0 = Release|Win32 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|x64.ActiveCfg = Release|x64 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|x64.Build.0 = Release|x64 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|Win32.ActiveCfg = Debug|Win32 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|Win32.Build.0 = Debug|Win32 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|x64.ActiveCfg = Debug|x64 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|x64.Build.0 = Debug|x64 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|Win32.ActiveCfg = Release|Win32 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|Win32.Build.0 = Release|Win32 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|x64.ActiveCfg = Release|x64 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|x64.Build.0 = Release|x64 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|Win32.ActiveCfg = Debug|Win32 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|Win32.Build.0 = Debug|Win32 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|x64.ActiveCfg = Debug|x64 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|x64.Build.0 = Debug|x64 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|Win32.ActiveCfg = Release|Win32 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|Win32.Build.0 = Release|Win32 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|x64.ActiveCfg = Release|x64 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|x64.Build.0 = Release|x64 + {225700A5-07B8-434E-AD61-555278BF6733}.Debug|Win32.ActiveCfg = Debug|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Debug|Win32.Build.0 = Debug|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Debug|x64.ActiveCfg = Debug|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Debug|x64.Build.0 = Debug|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Release|Win32.ActiveCfg = Release|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Release|Win32.Build.0 = Release|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Release|x64.ActiveCfg = Release|x64 + {225700A5-07B8-434E-AD61-555278BF6733}.Release|x64.Build.0 = Release|x64 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|Win32.ActiveCfg = Debug|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|Win32.Build.0 = Debug|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|x64.ActiveCfg = Debug|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|x64.Build.0 = Debug|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|Win32.ActiveCfg = Release|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|Win32.Build.0 = Release|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|x64.ActiveCfg = Release|x64 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|x64.Build.0 = Release|x64 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|Win32.ActiveCfg = Debug|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|Win32.Build.0 = Debug|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|x64.ActiveCfg = Debug|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|x64.Build.0 = Debug|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|Win32.ActiveCfg = Release|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|Win32.Build.0 = Release|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|x64.ActiveCfg = Release|x64 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|x64.Build.0 = Release|x64 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|Win32.ActiveCfg = Debug|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|Win32.Build.0 = Debug|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|x64.ActiveCfg = Debug|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|x64.Build.0 = Debug|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|Win32.ActiveCfg = Release|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|Win32.Build.0 = Release|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|x64.ActiveCfg = Release|x64 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|x64.Build.0 = Release|x64 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|Win32.ActiveCfg = Debug|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|Win32.Build.0 = Debug|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|x64.ActiveCfg = Debug|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|x64.Build.0 = Debug|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|Win32.ActiveCfg = Release|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|Win32.Build.0 = Release|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|x64.ActiveCfg = Release|x64 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|x64.Build.0 = Release|x64 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|Win32.ActiveCfg = Debug|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|Win32.Build.0 = Debug|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|x64.ActiveCfg = Debug|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|x64.Build.0 = Debug|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|Win32.ActiveCfg = Release|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|Win32.Build.0 = Release|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|x64.ActiveCfg = Release|x64 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|x64.Build.0 = Release|x64 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|Win32.ActiveCfg = Debug|Win32 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|Win32.Build.0 = Debug|Win32 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|x64.ActiveCfg = Debug|x64 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|x64.Build.0 = Debug|x64 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|Win32.ActiveCfg = Release|Win32 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|Win32.Build.0 = Release|Win32 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|x64.ActiveCfg = Release|x64 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|x64.Build.0 = Release|x64 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|Win32.ActiveCfg = Debug|Win32 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|Win32.Build.0 = Debug|Win32 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|x64.ActiveCfg = Debug|x64 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|x64.Build.0 = Debug|x64 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|Win32.ActiveCfg = Release|Win32 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|Win32.Build.0 = Release|Win32 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|x64.ActiveCfg = Release|x64 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Mkfiles/vc14/yasm.vcxproj b/Mkfiles/vc14/yasm.vcxproj new file mode 100644 index 00000000..867888bc --- /dev/null +++ b/Mkfiles/vc14/yasm.vcxproj @@ -0,0 +1,283 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5} + yasm + + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + + + + $(Platform)\$(Configuration)/yasm.tlb + + + + + Disabled + .;../..;%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)yasm.exe + true + true + $(OutDir)$(ProjectName).pdb + Console + false + + + MachineX86 + + + + + X64 + $(Platform)\$(Configuration)/yasm.tlb + + + + + Disabled + .;../..;%(AdditionalIncludeDirectories) + _DEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)yasm.exe + true + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX64 + + + + + $(Platform)\$(Configuration)/yasm.tlb + + + + + Full + Default + true + .;../..;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)yasm.exe + true + true + $(OutDir)$(ProjectName).pdb + Console + false + + + MachineX86 + + + + + X64 + $(Platform)\$(Configuration)/yasm.tlb + + + + + Full + OnlyExplicitInline + .;../..;%(AdditionalIncludeDirectories) + NDEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)yasm.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX64 + true + + + + + + + + + + + + + + + + + {021ceb0a-f721-4f59-b349-9ceeaf244459} + false + + + {29fe7874-1256-4ad6-b889-68e399dc9608} + false + + + {d715a3d4-efaa-442e-ad8b-5b4ff64e1dd6} + false + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc14/yasm.vcxproj.filters b/Mkfiles/vc14/yasm.vcxproj.filters new file mode 100644 index 00000000..04941c22 --- /dev/null +++ b/Mkfiles/vc14/yasm.vcxproj.filters @@ -0,0 +1,41 @@ + + + + + {51f0d88e-1373-4bf8-a72e-c79706d37f8b} + h;hpp;hxx;hm;inl + + + {db67b411-6f59-462c-9c20-75024c6b3912} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + \ No newline at end of file diff --git a/Mkfiles/vc14/ytasm.vcxproj b/Mkfiles/vc14/ytasm.vcxproj new file mode 100644 index 00000000..aabe801e --- /dev/null +++ b/Mkfiles/vc14/ytasm.vcxproj @@ -0,0 +1,278 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {2162937B-0DBD-4450-B45F-DF578D8E7508} + ytasm + + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + + + + $(Platform)\$(Configuration)/yasm.tlb + + + + + Disabled + .;../..;%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)ytasm.exe + true + true + $(OutDir)$(ProjectName).pdb + Console + false + + + MachineX86 + + + + + X64 + $(Platform)\$(Configuration)/yasm.tlb + + + + + Disabled + .;../..;%(AdditionalIncludeDirectories) + _DEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)ytasm.exe + true + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX64 + + + + + $(Platform)\$(Configuration)/yasm.tlb + + + + + Full + Default + true + .;../..;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)ytasm.exe + true + true + $(OutDir)$(ProjectName).pdb + Console + false + + + MachineX86 + + + + + X64 + $(Platform)\$(Configuration)/yasm.tlb + + + + + Full + OnlyExplicitInline + .;../..;%(AdditionalIncludeDirectories) + NDEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)ytasm.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX64 + true + + + + + + + + + + + + + + + + {29fe7874-1256-4ad6-b889-68e399dc9608} + false + + + {d715a3d4-efaa-442e-ad8b-5b4ff64e1dd6} + false + + + + + + \ No newline at end of file From 7160679eee91323db98b0974596c7221eeff772c Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Mon, 27 Jul 2015 20:48:42 +0100 Subject: [PATCH 502/585] add Visual Studio build files missed in thye initial commit --- .gitignore | 10 +- Mkfiles/vc14/genmacro/genmacro.vcxproj | 202 ++++++++++++++ .../vc14/genmacro/genmacro.vcxproj.filters | 17 ++ Mkfiles/vc14/genmacro/run.bat | 5 + Mkfiles/vc14/genmodule/genmodule.vcxproj | 207 +++++++++++++++ .../vc14/genmodule/genmodule.vcxproj.filters | 20 ++ Mkfiles/vc14/genmodule/run.bat | 3 + Mkfiles/vc14/genperf/genperf.vcxproj | 249 ++++++++++++++++++ Mkfiles/vc14/genperf/genperf.vcxproj.filters | 56 ++++ Mkfiles/vc14/genperf/run.bat | 39 +++ Mkfiles/vc14/genstring/genstring.vcxproj | 196 ++++++++++++++ .../vc14/genstring/genstring.vcxproj.filters | 17 ++ Mkfiles/vc14/genstring/run.bat | 2 + Mkfiles/vc14/genversion/genversion.vcxproj | 223 ++++++++++++++++ .../genversion/genversion.vcxproj.filters | 26 ++ Mkfiles/vc14/genversion/run.bat | 2 + Mkfiles/vc14/genversion/runpre.bat | 2 + Mkfiles/vc14/re2c/re2c.vcxproj | 221 ++++++++++++++++ Mkfiles/vc14/re2c/re2c.vcxproj.filters | 80 ++++++ Mkfiles/vc14/re2c/run.bat | 4 + 20 files changed, 1572 insertions(+), 9 deletions(-) create mode 100644 Mkfiles/vc14/genmacro/genmacro.vcxproj create mode 100644 Mkfiles/vc14/genmacro/genmacro.vcxproj.filters create mode 100644 Mkfiles/vc14/genmacro/run.bat create mode 100644 Mkfiles/vc14/genmodule/genmodule.vcxproj create mode 100644 Mkfiles/vc14/genmodule/genmodule.vcxproj.filters create mode 100644 Mkfiles/vc14/genmodule/run.bat create mode 100644 Mkfiles/vc14/genperf/genperf.vcxproj create mode 100644 Mkfiles/vc14/genperf/genperf.vcxproj.filters create mode 100644 Mkfiles/vc14/genperf/run.bat create mode 100644 Mkfiles/vc14/genstring/genstring.vcxproj create mode 100644 Mkfiles/vc14/genstring/genstring.vcxproj.filters create mode 100644 Mkfiles/vc14/genstring/run.bat create mode 100644 Mkfiles/vc14/genversion/genversion.vcxproj create mode 100644 Mkfiles/vc14/genversion/genversion.vcxproj.filters create mode 100644 Mkfiles/vc14/genversion/run.bat create mode 100644 Mkfiles/vc14/genversion/runpre.bat create mode 100644 Mkfiles/vc14/re2c/re2c.vcxproj create mode 100644 Mkfiles/vc14/re2c/re2c.vcxproj.filters create mode 100644 Mkfiles/vc14/re2c/run.bat diff --git a/.gitignore b/.gitignore index d76e398f..97d43572 100644 --- a/.gitignore +++ b/.gitignore @@ -11,17 +11,8 @@ x86parse.c lc3bid.c re2c-parser.c re2c-parser.h -yasm -vsyasm -ytasm -re2c cleanup -genmacro test_hd -genperf -genversion -genmodule -genstring version.mac *_test configure @@ -70,3 +61,4 @@ x64 *.log *.trs .dirstamp +*.user diff --git a/Mkfiles/vc14/genmacro/genmacro.vcxproj b/Mkfiles/vc14/genmacro/genmacro.vcxproj new file mode 100644 index 00000000..f4bbc6f3 --- /dev/null +++ b/Mkfiles/vc14/genmacro/genmacro.vcxproj @@ -0,0 +1,202 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {225700A5-07B8-434E-AD61-555278BF6733} + genmacro + Win32Proj + + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + + + + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genmacro.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + + + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genmacro.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + + + run.bat "$(TargetPath)" + + + + + Full + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + Default + + + $(OutDir)genmacro.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + + + Full + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + Default + + + $(OutDir)genmacro.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + + + run.bat "$(TargetPath)" + + + + + + + + + + + {b545983b-8ee0-4a7b-a67a-e749eeae62a2} + false + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc14/genmacro/genmacro.vcxproj.filters b/Mkfiles/vc14/genmacro/genmacro.vcxproj.filters new file mode 100644 index 00000000..402cf1b4 --- /dev/null +++ b/Mkfiles/vc14/genmacro/genmacro.vcxproj.filters @@ -0,0 +1,17 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Source Files + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc14/genmacro/run.bat b/Mkfiles/vc14/genmacro/run.bat new file mode 100644 index 00000000..98c337ac --- /dev/null +++ b/Mkfiles/vc14/genmacro/run.bat @@ -0,0 +1,5 @@ +cd ..\..\.. +%1 nasm-version.c nasm_version_mac version.mac +%1 nasm-macros.c nasm_standard_mac modules\parsers\nasm\nasm-std.mac +%1 win64-nasm.c win64_nasm_stdmac modules\objfmts\coff\win64-nasm.mac +%1 win64-gas.c win64_gas_stdmac modules\objfmts\coff\win64-gas.mac diff --git a/Mkfiles/vc14/genmodule/genmodule.vcxproj b/Mkfiles/vc14/genmodule/genmodule.vcxproj new file mode 100644 index 00000000..44f2a002 --- /dev/null +++ b/Mkfiles/vc14/genmodule/genmodule.vcxproj @@ -0,0 +1,207 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0} + genmodule + Win32Proj + + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + + + + Disabled + %(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;FILTERMODE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genmodule.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + + + Disabled + %(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;FILTERMODE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genmodule.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + + + run.bat "$(TargetPath)" + + + + + Full + %(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;FILTERMODE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + $(IntDir) + Level3 + Default + + + $(OutDir)genmodule.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + + + Full + %(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;FILTERMODE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + $(IntDir) + Level3 + Default + + + $(OutDir)genmodule.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + + + run.bat "$(TargetPath)" + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc14/genmodule/genmodule.vcxproj.filters b/Mkfiles/vc14/genmodule/genmodule.vcxproj.filters new file mode 100644 index 00000000..d3255c29 --- /dev/null +++ b/Mkfiles/vc14/genmodule/genmodule.vcxproj.filters @@ -0,0 +1,20 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Source Files + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc14/genmodule/run.bat b/Mkfiles/vc14/genmodule/run.bat new file mode 100644 index 00000000..00055692 --- /dev/null +++ b/Mkfiles/vc14/genmodule/run.bat @@ -0,0 +1,3 @@ +@echo off +cd ..\..\.. +%1 libyasm\module.in Makefile.am diff --git a/Mkfiles/vc14/genperf/genperf.vcxproj b/Mkfiles/vc14/genperf/genperf.vcxproj new file mode 100644 index 00000000..0cb39069 --- /dev/null +++ b/Mkfiles/vc14/genperf/genperf.vcxproj @@ -0,0 +1,249 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619} + genperf + Win32Proj + + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + false + false + false + false + false + false + false + false + + + + Disabled + ..;../../..;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;STDC_HEADERS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genperf.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX86 + + + + + + + run.bat "$(TargetPath)" + + + x86insn_nasm.c;x86insn_gas.c;x86cpu.c;x86regtmod.c;%(Outputs) + + + + + Disabled + ..;../../..;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;STDC_HEADERS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genperf.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + + + + + + + run.bat "$(TargetPath)" + + + x86insn_nasm.c;x86insn_gas.c;x86cpu.c;x86regtmod.c;%(Outputs) + + + + + Full + ..;../../..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;STDC_HEADERS;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + Default + + + $(OutDir)genperf.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + MachineX86 + + + + + + + run.bat "$(TargetPath)" + + + x86insn_nasm.c;x86insn_gas.c;x86cpu.c;x86regtmod.c;%(Outputs) + + + + + Full + ..;../../..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;STDC_HEADERS;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + Default + + + $(OutDir)genperf.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + + + + + + + run.bat "$(TargetPath)" + + + x86insn_nasm.c;x86insn_gas.c;x86cpu.c;x86regtmod.c;%(Outputs) + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc14/genperf/genperf.vcxproj.filters b/Mkfiles/vc14/genperf/genperf.vcxproj.filters new file mode 100644 index 00000000..3124b5d7 --- /dev/null +++ b/Mkfiles/vc14/genperf/genperf.vcxproj.filters @@ -0,0 +1,56 @@ + + + + + {3C1E9AA8-6338-4CED-99F1-BEBA80607BD5} + h;hpp;hxx;hm;inl;inc;xsd + + + {1062695D-1C50-4068-8313-73A409885BC1} + cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc14/genperf/run.bat b/Mkfiles/vc14/genperf/run.bat new file mode 100644 index 00000000..4f655b84 --- /dev/null +++ b/Mkfiles/vc14/genperf/run.bat @@ -0,0 +1,39 @@ +cd ..\..\.. +@echo off + +for /f "usebackq tokens=1*" %%f in (`reg query HKCR\Applications\python.exe\shell\open\command 2^>NUL`) do (set _my_=%%f %%g) +goto try1%errorlevel% + +:try10 +goto ok + +:try11 +for /f "usebackq tokens=1*" %%f in (`reg query HKCR\Python.File\shell\open\command 2^>NUL`) do (set _my_=%%f %%g) +goto try2%errorlevel% + +:try20: +goto ok + +:try21: +echo Building without Python ... +goto therest + +:ok +echo Building with Python ... +set _res_=%_my_:*REG_SZ=% +set _end_=%_res_:*exe"=% +call set _python_=%%_res_:%_end_%=%% +call %_python_% modules\arch\x86\gen_x86_insn.py + +:therest +@echo on +call :update %1 x86insn_nasm.gperf x86insn_nasm.c +call :update %1 x86insn_gas.gperf x86insn_gas.c +call :update %1 modules\arch\x86\x86cpu.gperf x86cpu.c +call :update %1 modules\arch\x86\x86regtmod.gperf x86regtmod.c +goto :eof + +:update +%1 %2 tf +call mkfiles\vc14\out_copy_rename tf .\ %3 +del tf diff --git a/Mkfiles/vc14/genstring/genstring.vcxproj b/Mkfiles/vc14/genstring/genstring.vcxproj new file mode 100644 index 00000000..239c8cf7 --- /dev/null +++ b/Mkfiles/vc14/genstring/genstring.vcxproj @@ -0,0 +1,196 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {021CEB0A-F721-4F59-B349-9CEEAF244459} + genstring + Win32Proj + + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + + + + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genstring.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + + + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genstring.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + + + run.bat "$(TargetPath)" + + + + + Full + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + Default + + + $(OutDir)genstring.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + + + Full + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + Default + + + $(OutDir)genstring.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + + + run.bat "$(TargetPath)" + + + + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc14/genstring/genstring.vcxproj.filters b/Mkfiles/vc14/genstring/genstring.vcxproj.filters new file mode 100644 index 00000000..04ed411d --- /dev/null +++ b/Mkfiles/vc14/genstring/genstring.vcxproj.filters @@ -0,0 +1,17 @@ + + + + + {28EBE11C-5BE8-4935-9381-F57696749E0C} + cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Source Files + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc14/genstring/run.bat b/Mkfiles/vc14/genstring/run.bat new file mode 100644 index 00000000..baedcecb --- /dev/null +++ b/Mkfiles/vc14/genstring/run.bat @@ -0,0 +1,2 @@ +cd ..\..\.. +%1 license_msg license.c COPYING diff --git a/Mkfiles/vc14/genversion/genversion.vcxproj b/Mkfiles/vc14/genversion/genversion.vcxproj new file mode 100644 index 00000000..f9a5298c --- /dev/null +++ b/Mkfiles/vc14/genversion/genversion.vcxproj @@ -0,0 +1,223 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2} + genversion + Win32Proj + + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + + + + Disabled + ..\..\vc10;..\..\..\;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genversion.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + cd ..\..\..\ +YASM-VERSION-GEN.bat + + + + + + Disabled + ..\..\vc10;..\..\..\;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genversion.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + + + run.bat "$(TargetPath)" + + + cd ..\..\..\ +YASM-VERSION-GEN.bat + + + + + + Full + ..\..\vc10;..\..\..\;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + Default + + + $(OutDir)genversion.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + cd ..\..\..\ +YASM-VERSION-GEN.bat + + + + + + Full + ..\..\vc10;..\..\..\;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + Default + + + $(OutDir)genversion.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + + + run.bat "$(TargetPath)" + + + cd ..\..\..\ +YASM-VERSION-GEN.bat + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc14/genversion/genversion.vcxproj.filters b/Mkfiles/vc14/genversion/genversion.vcxproj.filters new file mode 100644 index 00000000..cc088b12 --- /dev/null +++ b/Mkfiles/vc14/genversion/genversion.vcxproj.filters @@ -0,0 +1,26 @@ + + + + + {2acbec3a-0ed8-4b2e-826e-a84c7d35f205} + h;hpp;hxx;hm;inl + + + {E67ED277-E4F2-4D79-8C9E-962BAC164F3F} + cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Source Files + + + + + Header Files + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc14/genversion/run.bat b/Mkfiles/vc14/genversion/run.bat new file mode 100644 index 00000000..41b19cad --- /dev/null +++ b/Mkfiles/vc14/genversion/run.bat @@ -0,0 +1,2 @@ +cd ..\..\.. +%1 version.mac diff --git a/Mkfiles/vc14/genversion/runpre.bat b/Mkfiles/vc14/genversion/runpre.bat new file mode 100644 index 00000000..fdd15708 --- /dev/null +++ b/Mkfiles/vc14/genversion/runpre.bat @@ -0,0 +1,2 @@ +cd ..\..\.. +YASM-VERSION-GEN.bat diff --git a/Mkfiles/vc14/re2c/re2c.vcxproj b/Mkfiles/vc14/re2c/re2c.vcxproj new file mode 100644 index 00000000..135b43ba --- /dev/null +++ b/Mkfiles/vc14/re2c/re2c.vcxproj @@ -0,0 +1,221 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {3C58BE13-50A3-4583-984D-D8902B3D7713} + re2c + Win32Proj + + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + + + + Disabled + ..;../../..;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + Default + ProgramDatabase + + + $(OutDir)re2c.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + + + Disabled + ..;../../..;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + Default + ProgramDatabase + + + $(OutDir)re2c.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + + + run.bat "$(TargetPath)" + + + + + Full + ..;../../..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + Default + + + $(OutDir)re2c.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + + + Full + ..;../../..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + Default + + + $(OutDir)re2c.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + + + run.bat "$(TargetPath)" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc14/re2c/re2c.vcxproj.filters b/Mkfiles/vc14/re2c/re2c.vcxproj.filters new file mode 100644 index 00000000..da0f935c --- /dev/null +++ b/Mkfiles/vc14/re2c/re2c.vcxproj.filters @@ -0,0 +1,80 @@ + + + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc14/re2c/run.bat b/Mkfiles/vc14/re2c/run.bat new file mode 100644 index 00000000..6ac571f0 --- /dev/null +++ b/Mkfiles/vc14/re2c/run.bat @@ -0,0 +1,4 @@ +cd ..\..\..\ +%1 -s -o lc3bid.c modules\arch\lc3b\lc3bid.re +%1 -b -o nasm-token.c modules\parsers\nasm\nasm-token.re +%1 -b -o gas-token.c modules\parsers\gas\gas-token.re From 32ad9c46cebd5bf07af9c05383d3c16e6cb1f17d Mon Sep 17 00:00:00 2001 From: Henrik Gramner Date: Sat, 17 Oct 2015 21:32:34 +0200 Subject: [PATCH 503/585] Support numbers prefixed with + or - in %ifnum --- modules/preprocs/nasm/nasm-pp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/preprocs/nasm/nasm-pp.c b/modules/preprocs/nasm/nasm-pp.c index 27a8cc6c..5ea650e3 100644 --- a/modules/preprocs/nasm/nasm-pp.c +++ b/modules/preprocs/nasm/nasm-pp.c @@ -2249,7 +2249,10 @@ if_condition(Token * tline, int i) case PP_ELIFNUM: case PP_IFNNUM: case PP_ELIFNNUM: - j = (t->type == TOK_NUMBER); + while (tok_is_(t, "+") || tok_is_(t, "-") || + tok_type_(t, TOK_WHITESPACE)) + t = t->next; + j = (t && t->type == TOK_NUMBER); break; case PP_IFSTR: case PP_ELIFSTR: From 8fd3d4d95e565a27657092f5bb678815375fcfb5 Mon Sep 17 00:00:00 2001 From: darealshinji Date: Thu, 5 Nov 2015 18:57:21 +0100 Subject: [PATCH 504/585] fixing an argument parsing bug in ytasm Taken from a Debian patch. More information can be found at https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=716639 http://anonscm.debian.org/viewvc/sam-hocevar/pkg-misc/unstable/yasm/debian/patches/100_ytasm_parsing_error.diff?view=log --- frontends/tasm/tasm-options.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/frontends/tasm/tasm-options.c b/frontends/tasm/tasm-options.c index 57c3bdfd..3d40f31b 100644 --- a/frontends/tasm/tasm-options.c +++ b/frontends/tasm/tasm-options.c @@ -65,15 +65,18 @@ parse_cmdline(int argc, char **argv, opt_option *options, size_t nopts, param = &argv[0][1+len]; if (options[i].takes_param) { - if (param[0] == '\0') { + if (param[0] != '\0') { + /* do nothing */ + } else if (argc > 1) { + param = argv[1]; + argc--; + argv++; + } else { print_error( - _("option `-%c' needs an argument!"), + _("option `-%s' needs an argument!"), options[i].opt); errors++; goto fail; - } else { - argc--; - argv++; } } else param = NULL; From 86b96b21fa84101be286ead673fe5935c2099299 Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Fri, 6 Nov 2015 11:33:14 +0000 Subject: [PATCH 505/585] update MSVC14 build --- Mkfiles/vc14/genperf/genperf.vcxproj | 20 ++++++++++++++++---- Mkfiles/vc14/genperf/run.bat | 1 + Mkfiles/vc14/vsyasm.xml | 6 +++--- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/Mkfiles/vc14/genperf/genperf.vcxproj b/Mkfiles/vc14/genperf/genperf.vcxproj index 0cb39069..4ccf38a2 100644 --- a/Mkfiles/vc14/genperf/genperf.vcxproj +++ b/Mkfiles/vc14/genperf/genperf.vcxproj @@ -78,15 +78,15 @@ $(Platform)\$(Configuration)\ false false - false - false - false - false false false false false + + + + Disabled @@ -122,6 +122,9 @@ x86insn_nasm.c;x86insn_gas.c;x86cpu.c;x86regtmod.c;%(Outputs) + + run.bat "$(TargetPath)" + @@ -156,6 +159,9 @@ x86insn_nasm.c;x86insn_gas.c;x86cpu.c;x86regtmod.c;%(Outputs) + + run.bat "$(TargetPath)" + @@ -190,6 +196,9 @@ x86insn_nasm.c;x86insn_gas.c;x86cpu.c;x86regtmod.c;%(Outputs) + + run.bat "$(TargetPath)" + @@ -223,6 +232,9 @@ x86insn_nasm.c;x86insn_gas.c;x86cpu.c;x86regtmod.c;%(Outputs) + + run.bat "$(TargetPath)" + diff --git a/Mkfiles/vc14/genperf/run.bat b/Mkfiles/vc14/genperf/run.bat index 4f655b84..c6f83543 100644 --- a/Mkfiles/vc14/genperf/run.bat +++ b/Mkfiles/vc14/genperf/run.bat @@ -23,6 +23,7 @@ echo Building with Python ... set _res_=%_my_:*REG_SZ=% set _end_=%_res_:*exe"=% call set _python_=%%_res_:%_end_%=%% +echo %_python_% call %_python_% modules\arch\x86\gen_x86_insn.py :therest diff --git a/Mkfiles/vc14/vsyasm.xml b/Mkfiles/vc14/vsyasm.xml index cd08cbba..a108f005 100644 --- a/Mkfiles/vc14/vsyasm.xml +++ b/Mkfiles/vc14/vsyasm.xml @@ -125,7 +125,7 @@ HelpContext="0" DisplayName="Map File Name" Description="Select a map output by setting its file name" - Switch="--mapdir= "[value]"" /> + Switch="--mapdir="[value]"" /> + Switch="--prefix="[value]"" /> + Switch="--suffix="[value]"" /> Date: Fri, 6 Nov 2015 20:15:04 -0800 Subject: [PATCH 506/585] Added -Wno-segreg-in-64bit. This allows suppressing the annoying 'segment register ignored in 64-bit mode' warning. --- frontends/tasm/tasm.c | 2 ++ frontends/vsyasm/vsyasm.c | 2 ++ frontends/yasm/yasm.c | 2 ++ libyasm/errwarn.h | 3 ++- modules/arch/x86/x86regtmod.gperf | 2 +- 5 files changed, 9 insertions(+), 2 deletions(-) diff --git a/frontends/tasm/tasm.c b/frontends/tasm/tasm.c index 8019ff75..93c11c98 100644 --- a/frontends/tasm/tasm.c +++ b/frontends/tasm/tasm.c @@ -791,6 +791,8 @@ opt_warning_handler(char *cmd, /*@unused@*/ char *param, int extra) action(YASM_WARN_UNINIT_CONTENTS); else if (strcmp(cmd, "size-override") == 0) action(YASM_WARN_SIZE_OVERRIDE); + else if (strcmp(cmd, "segreg-in-64bit") == 0) + action(YASM_WARN_SEGREG_IN_64BIT); else return 1; diff --git a/frontends/vsyasm/vsyasm.c b/frontends/vsyasm/vsyasm.c index a057b6f7..892b9b33 100644 --- a/frontends/vsyasm/vsyasm.c +++ b/frontends/vsyasm/vsyasm.c @@ -1120,6 +1120,8 @@ opt_warning_handler(char *cmd, /*@unused@*/ char *param, int extra) action(YASM_WARN_UNINIT_CONTENTS); else if (strcmp(cmd, "size-override") == 0) action(YASM_WARN_SIZE_OVERRIDE); + else if (strcmp(cmd, "segreg-in-64bit") == 0) + action(YASM_WARN_SEGREG_IN_64BIT); else return 1; diff --git a/frontends/yasm/yasm.c b/frontends/yasm/yasm.c index 74c16223..75d96755 100644 --- a/frontends/yasm/yasm.c +++ b/frontends/yasm/yasm.c @@ -1094,6 +1094,8 @@ opt_warning_handler(char *cmd, /*@unused@*/ char *param, int extra) action(YASM_WARN_UNINIT_CONTENTS); else if (strcmp(cmd, "size-override") == 0) action(YASM_WARN_SIZE_OVERRIDE); + else if (strcmp(cmd, "segreg-in-64bit") == 0) + action(YASM_WARN_SEGREG_IN_64BIT); else return 1; diff --git a/libyasm/errwarn.h b/libyasm/errwarn.h index ede2f287..25f68226 100644 --- a/libyasm/errwarn.h +++ b/libyasm/errwarn.h @@ -43,7 +43,8 @@ typedef enum yasm_warn_class { YASM_WARN_ORPHAN_LABEL, /**< Label alone on a line without a colon */ YASM_WARN_UNINIT_CONTENTS, /**< Uninitialized space in code/data section */ YASM_WARN_SIZE_OVERRIDE,/**< Double size override */ - YASM_WARN_IMPLICIT_SIZE_OVERRIDE /**< Implicit size override */ + YASM_WARN_IMPLICIT_SIZE_OVERRIDE, /**< Implicit size override */ + YASM_WARN_SEGREG_IN_64BIT /**< Segment register ignored in 64-bit mode */ } yasm_warn_class; /** Error classes. Bitmask-based to support limited subclassing. */ diff --git a/modules/arch/x86/x86regtmod.gperf b/modules/arch/x86/x86regtmod.gperf index 64ee7d9d..38986df0 100644 --- a/modules/arch/x86/x86regtmod.gperf +++ b/modules/arch/x86/x86regtmod.gperf @@ -284,7 +284,7 @@ yasm_x86__parse_check_regtmod(yasm_arch *arch, const char *id, size_t id_len, } if (type == YASM_ARCH_SEGREG && bits != 0 && arch_x86->mode_bits == bits) { - yasm_warn_set(YASM_WARN_GENERAL, + yasm_warn_set(YASM_WARN_SEGREG_IN_64BIT, N_("`%s' segment register ignored in %u-bit mode"), id, bits); } From 6143552f926a6fd839462a310a4c04e29c9875cf Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Tue, 7 Mar 2017 20:31:18 +0000 Subject: [PATCH 507/585] add missing VC++ header --- Mkfiles/vc14/libyasm-stdint.h | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 Mkfiles/vc14/libyasm-stdint.h diff --git a/Mkfiles/vc14/libyasm-stdint.h b/Mkfiles/vc14/libyasm-stdint.h new file mode 100644 index 00000000..b66ab15f --- /dev/null +++ b/Mkfiles/vc14/libyasm-stdint.h @@ -0,0 +1,8 @@ +#ifndef _UINTPTR_T_DEFINED +#ifdef _WIN64 +#include +#else +typedef unsigned long uintptr_t; +#endif +#define _UINTPTR_T_DEFINED +#endif From 6caf1518939d41627f7d6bb220650f4ce77cd087 Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Tue, 7 Mar 2017 20:38:37 +0000 Subject: [PATCH 508/585] add Visual Studio 2017 build files --- Mkfiles/vc15/config.h | 170 +++++++++ Mkfiles/vc15/crt_secure_no_deprecate.props | 11 + Mkfiles/vc15/crt_secure_no_deprecate.vsprops | 11 + Mkfiles/vc15/genmacro/genmacro.vcxproj | 202 +++++++++++ .../vc15/genmacro/genmacro.vcxproj.filters | 17 + Mkfiles/vc15/genmacro/run.bat | 5 + Mkfiles/vc15/genmodule/genmodule.vcxproj | 207 +++++++++++ .../vc15/genmodule/genmodule.vcxproj.filters | 20 ++ Mkfiles/vc15/genmodule/run.bat | 3 + Mkfiles/vc15/genperf/genperf.vcxproj | 261 ++++++++++++++ Mkfiles/vc15/genperf/genperf.vcxproj.filters | 56 +++ Mkfiles/vc15/genperf/run.bat | 40 +++ Mkfiles/vc15/genstring/genstring.vcxproj | 196 +++++++++++ .../vc15/genstring/genstring.vcxproj.filters | 17 + Mkfiles/vc15/genstring/run.bat | 2 + Mkfiles/vc15/genversion/genversion.vcxproj | 223 ++++++++++++ .../genversion/genversion.vcxproj.filters | 26 ++ Mkfiles/vc15/genversion/run.bat | 2 + Mkfiles/vc15/genversion/runpre.bat | 2 + Mkfiles/vc15/libyasm-stdint.h | 8 + Mkfiles/vc15/libyasm/libyasm.vcxproj | 277 +++++++++++++++ Mkfiles/vc15/libyasm/libyasm.vcxproj.filters | 200 +++++++++++ Mkfiles/vc15/modules/modules.vcxproj | 324 ++++++++++++++++++ Mkfiles/vc15/modules/modules.vcxproj.filters | 256 ++++++++++++++ Mkfiles/vc15/out_copy_rename.bat | 42 +++ Mkfiles/vc15/re2c/re2c.vcxproj | 221 ++++++++++++ Mkfiles/vc15/re2c/re2c.vcxproj.filters | 80 +++++ Mkfiles/vc15/re2c/run.bat | 4 + Mkfiles/vc15/readme.vc14.txt | 106 ++++++ Mkfiles/vc15/vsyasm.props | 27 ++ Mkfiles/vc15/vsyasm.targets | 108 ++++++ Mkfiles/vc15/vsyasm.vcxproj | 279 +++++++++++++++ Mkfiles/vc15/vsyasm.xml | 283 +++++++++++++++ Mkfiles/vc15/yasm.sln | 142 ++++++++ Mkfiles/vc15/yasm.vcxproj | 283 +++++++++++++++ Mkfiles/vc15/yasm.vcxproj.filters | 41 +++ Mkfiles/vc15/ytasm.vcxproj | 278 +++++++++++++++ 37 files changed, 4430 insertions(+) create mode 100644 Mkfiles/vc15/config.h create mode 100644 Mkfiles/vc15/crt_secure_no_deprecate.props create mode 100644 Mkfiles/vc15/crt_secure_no_deprecate.vsprops create mode 100644 Mkfiles/vc15/genmacro/genmacro.vcxproj create mode 100644 Mkfiles/vc15/genmacro/genmacro.vcxproj.filters create mode 100644 Mkfiles/vc15/genmacro/run.bat create mode 100644 Mkfiles/vc15/genmodule/genmodule.vcxproj create mode 100644 Mkfiles/vc15/genmodule/genmodule.vcxproj.filters create mode 100644 Mkfiles/vc15/genmodule/run.bat create mode 100644 Mkfiles/vc15/genperf/genperf.vcxproj create mode 100644 Mkfiles/vc15/genperf/genperf.vcxproj.filters create mode 100644 Mkfiles/vc15/genperf/run.bat create mode 100644 Mkfiles/vc15/genstring/genstring.vcxproj create mode 100644 Mkfiles/vc15/genstring/genstring.vcxproj.filters create mode 100644 Mkfiles/vc15/genstring/run.bat create mode 100644 Mkfiles/vc15/genversion/genversion.vcxproj create mode 100644 Mkfiles/vc15/genversion/genversion.vcxproj.filters create mode 100644 Mkfiles/vc15/genversion/run.bat create mode 100644 Mkfiles/vc15/genversion/runpre.bat create mode 100644 Mkfiles/vc15/libyasm-stdint.h create mode 100644 Mkfiles/vc15/libyasm/libyasm.vcxproj create mode 100644 Mkfiles/vc15/libyasm/libyasm.vcxproj.filters create mode 100644 Mkfiles/vc15/modules/modules.vcxproj create mode 100644 Mkfiles/vc15/modules/modules.vcxproj.filters create mode 100644 Mkfiles/vc15/out_copy_rename.bat create mode 100644 Mkfiles/vc15/re2c/re2c.vcxproj create mode 100644 Mkfiles/vc15/re2c/re2c.vcxproj.filters create mode 100644 Mkfiles/vc15/re2c/run.bat create mode 100644 Mkfiles/vc15/readme.vc14.txt create mode 100644 Mkfiles/vc15/vsyasm.props create mode 100644 Mkfiles/vc15/vsyasm.targets create mode 100644 Mkfiles/vc15/vsyasm.vcxproj create mode 100644 Mkfiles/vc15/vsyasm.xml create mode 100644 Mkfiles/vc15/yasm.sln create mode 100644 Mkfiles/vc15/yasm.vcxproj create mode 100644 Mkfiles/vc15/yasm.vcxproj.filters create mode 100644 Mkfiles/vc15/ytasm.vcxproj diff --git a/Mkfiles/vc15/config.h b/Mkfiles/vc15/config.h new file mode 100644 index 00000000..8515ac5a --- /dev/null +++ b/Mkfiles/vc15/config.h @@ -0,0 +1,170 @@ +#include "YASM-VERSION.h" +#define yasm__splitpath(path, tail) yasm__splitpath_win(path, tail) +#define yasm__abspath(path) yasm__abspath_win(path) +#define yasm__combpath(from, to) yasm__combpath_win(from, to) + +/* Command name to run C preprocessor */ +#define CPP_PROG "cpp" + +/* */ +/* #undef ENABLE_NLS */ + +/* Define if you have the `abort' function. */ +#define HAVE_ABORT 1 + +/* */ +/* #undef HAVE_CATGETS */ + +/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYCURRENT */ + +/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +/* #undef HAVE_DCGETTEXT */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DIRECT_H 1 + +/* Define to 1 if you have the `getcwd' function. */ +#define HAVE_GETCWD 1 + +/* */ +/* #undef HAVE_GETTEXT */ + +/* Define if you have the GNU C Library */ +/* #undef HAVE_GNU_C_LIBRARY */ + +/* Define if you have the iconv() function. */ +/* #undef HAVE_ICONV */ + +/* Define if you have the header file. */ +/* #undef HAVE_INTTYPES_H */ + +/* */ +/* #undef HAVE_LC_MESSAGES */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LIBGEN_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_MEMORY_H */ + +/* Define if you have the `mergesort' function. */ +/* #undef HAVE_MERGESORT */ + +/* Define to 1 if you have the `popen' function. */ +/* #undef HAVE_POPEN */ + +/* Define if you have the header file. */ +/* #undef HAVE_STDINT_H */ + +/* Define if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* */ +/* #undef HAVE_STPCPY */ + +/* Define if you have the `strcasecmp' function. */ +/* #undef HAVE_STRCASECMP */ + +/* Define if you have the `strcmpi' function. */ +/* #undef HAVE_STRCMPI */ + +/* Define if you have the `stricmp' function. */ +/* #undefine HAVE_STRICMP */ + +/* Define if you have the header file. */ +/* #undef HAVE_STRINGS_H */ + +/* Define if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define if you have the `strncasecmp' function. */ +/* #undef HAVE_STRNCASECMP */ + +/* Define if you have the `strsep' function. */ +/* #undef HAVE_STRSEP */ + +/* Define if you have the header file. */ +/* #undef HAVE_SYS_STAT_H */ + +/* Define if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define if you have the `toascii' function. */ +#define HAVE_TOASCII 1 +#define toascii __toascii + +/* Define if you have the header file. */ +/* #undef HAVE_UNISTD_H */ + +/* Define to 1 if you have the `vsnprintf' function. */ +/* #undef HAVE_VSNPRINTF */ + +/* Define to 1 if you have the `_stricmp' function. */ +#define HAVE__STRICMP 1 + +/* Name of package */ +#define PACKAGE "yasm" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "bug-yasm@tortall.net" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "yasm" + +/* Define to the full name and version of this package. */ +/*#define PACKAGE_STRING "yasm HEAD"*/ + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "yasm" + +/* Define to the version of this package. */ +/*#define PACKAGE_VERSION "HEAD"*/ + +/* Define if the C compiler supports function prototypes. */ +#define PROTOTYPES 1 + +/* The size of a `char', as computed by sizeof. */ +/* #undef SIZEOF_CHAR */ + +/* The size of a `int', as computed by sizeof. */ +/* #undef SIZEOF_INT */ + +/* The size of a `long', as computed by sizeof. */ +/* #undef SIZEOF_LONG */ + +/* The size of a `short', as computed by sizeof. */ +/* #undef SIZEOF_SHORT */ + +/* The size of a `void*', as computed by sizeof. */ +/* #undef SIZEOF_VOIDP */ + +/* Define if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Version number of package */ +#define VERSION "HEAD" + +/* Define if using the dmalloc debugging malloc package */ +/* #undef WITH_DMALLOC */ + +/* Define like PROTOTYPES; this can be used by system headers. */ +#define __PROTOTYPES 1 + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define as `__inline' if that's what the C compiler calls it, or to nothing + if it is not supported. */ +#ifndef __cplusplus +/* #undef inline */ +#endif + +/* Define to `unsigned' if doesn't define. */ +/* #undef size_t */ diff --git a/Mkfiles/vc15/crt_secure_no_deprecate.props b/Mkfiles/vc15/crt_secure_no_deprecate.props new file mode 100644 index 00000000..777d6d0a --- /dev/null +++ b/Mkfiles/vc15/crt_secure_no_deprecate.props @@ -0,0 +1,11 @@ + + + + <_ProjectFileVersion>10.0.21006.1 + + + + _CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + + + \ No newline at end of file diff --git a/Mkfiles/vc15/crt_secure_no_deprecate.vsprops b/Mkfiles/vc15/crt_secure_no_deprecate.vsprops new file mode 100644 index 00000000..56ab506f --- /dev/null +++ b/Mkfiles/vc15/crt_secure_no_deprecate.vsprops @@ -0,0 +1,11 @@ + + + + diff --git a/Mkfiles/vc15/genmacro/genmacro.vcxproj b/Mkfiles/vc15/genmacro/genmacro.vcxproj new file mode 100644 index 00000000..794399a3 --- /dev/null +++ b/Mkfiles/vc15/genmacro/genmacro.vcxproj @@ -0,0 +1,202 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {225700A5-07B8-434E-AD61-555278BF6733} + genmacro + Win32Proj + + + + Application + MultiByte + v141 + + + Application + MultiByte + v141 + + + Application + MultiByte + v141 + + + Application + MultiByte + v141 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + + + + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genmacro.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + + + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genmacro.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + + + run.bat "$(TargetPath)" + + + + + Full + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + Default + + + $(OutDir)genmacro.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + + + Full + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + Default + + + $(OutDir)genmacro.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + + + run.bat "$(TargetPath)" + + + + + + + + + + + {b545983b-8ee0-4a7b-a67a-e749eeae62a2} + false + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc15/genmacro/genmacro.vcxproj.filters b/Mkfiles/vc15/genmacro/genmacro.vcxproj.filters new file mode 100644 index 00000000..402cf1b4 --- /dev/null +++ b/Mkfiles/vc15/genmacro/genmacro.vcxproj.filters @@ -0,0 +1,17 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Source Files + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc15/genmacro/run.bat b/Mkfiles/vc15/genmacro/run.bat new file mode 100644 index 00000000..98c337ac --- /dev/null +++ b/Mkfiles/vc15/genmacro/run.bat @@ -0,0 +1,5 @@ +cd ..\..\.. +%1 nasm-version.c nasm_version_mac version.mac +%1 nasm-macros.c nasm_standard_mac modules\parsers\nasm\nasm-std.mac +%1 win64-nasm.c win64_nasm_stdmac modules\objfmts\coff\win64-nasm.mac +%1 win64-gas.c win64_gas_stdmac modules\objfmts\coff\win64-gas.mac diff --git a/Mkfiles/vc15/genmodule/genmodule.vcxproj b/Mkfiles/vc15/genmodule/genmodule.vcxproj new file mode 100644 index 00000000..602115e2 --- /dev/null +++ b/Mkfiles/vc15/genmodule/genmodule.vcxproj @@ -0,0 +1,207 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0} + genmodule + Win32Proj + + + + Application + MultiByte + v141 + + + Application + MultiByte + v141 + + + Application + MultiByte + v141 + + + Application + MultiByte + v141 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + + + + Disabled + %(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;FILTERMODE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genmodule.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + + + Disabled + %(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;FILTERMODE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genmodule.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + + + run.bat "$(TargetPath)" + + + + + Full + %(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;FILTERMODE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + $(IntDir) + Level3 + Default + + + $(OutDir)genmodule.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + + + Full + %(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;FILTERMODE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + $(IntDir) + Level3 + Default + + + $(OutDir)genmodule.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + + + run.bat "$(TargetPath)" + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc15/genmodule/genmodule.vcxproj.filters b/Mkfiles/vc15/genmodule/genmodule.vcxproj.filters new file mode 100644 index 00000000..d3255c29 --- /dev/null +++ b/Mkfiles/vc15/genmodule/genmodule.vcxproj.filters @@ -0,0 +1,20 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Source Files + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc15/genmodule/run.bat b/Mkfiles/vc15/genmodule/run.bat new file mode 100644 index 00000000..00055692 --- /dev/null +++ b/Mkfiles/vc15/genmodule/run.bat @@ -0,0 +1,3 @@ +@echo off +cd ..\..\.. +%1 libyasm\module.in Makefile.am diff --git a/Mkfiles/vc15/genperf/genperf.vcxproj b/Mkfiles/vc15/genperf/genperf.vcxproj new file mode 100644 index 00000000..ad4e8aff --- /dev/null +++ b/Mkfiles/vc15/genperf/genperf.vcxproj @@ -0,0 +1,261 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619} + genperf + Win32Proj + + + + Application + MultiByte + v141 + + + Application + MultiByte + v141 + + + Application + MultiByte + v141 + + + Application + MultiByte + v141 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + false + false + false + false + + + + + + + + Disabled + ..;../../..;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;STDC_HEADERS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genperf.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX86 + + + + + + + run.bat "$(TargetPath)" + + + x86insn_nasm.c;x86insn_gas.c;x86cpu.c;x86regtmod.c;%(Outputs) + + + run.bat "$(TargetPath)" + + + + + Disabled + ..;../../..;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;STDC_HEADERS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genperf.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + + + + + + + run.bat "$(TargetPath)" + + + x86insn_nasm.c;x86insn_gas.c;x86cpu.c;x86regtmod.c;%(Outputs) + + + run.bat "$(TargetPath)" + + + + + Full + ..;../../..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;STDC_HEADERS;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + Default + + + $(OutDir)genperf.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + MachineX86 + + + + + + + run.bat "$(TargetPath)" + + + x86insn_nasm.c;x86insn_gas.c;x86cpu.c;x86regtmod.c;%(Outputs) + + + run.bat "$(TargetPath)" + + + + + Full + ..;../../..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;STDC_HEADERS;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + Default + + + $(OutDir)genperf.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + + + + + + + run.bat "$(TargetPath)" + + + x86insn_nasm.c;x86insn_gas.c;x86cpu.c;x86regtmod.c;%(Outputs) + + + run.bat "$(TargetPath)" + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc15/genperf/genperf.vcxproj.filters b/Mkfiles/vc15/genperf/genperf.vcxproj.filters new file mode 100644 index 00000000..3124b5d7 --- /dev/null +++ b/Mkfiles/vc15/genperf/genperf.vcxproj.filters @@ -0,0 +1,56 @@ + + + + + {3C1E9AA8-6338-4CED-99F1-BEBA80607BD5} + h;hpp;hxx;hm;inl;inc;xsd + + + {1062695D-1C50-4068-8313-73A409885BC1} + cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc15/genperf/run.bat b/Mkfiles/vc15/genperf/run.bat new file mode 100644 index 00000000..c6f83543 --- /dev/null +++ b/Mkfiles/vc15/genperf/run.bat @@ -0,0 +1,40 @@ +cd ..\..\.. +@echo off + +for /f "usebackq tokens=1*" %%f in (`reg query HKCR\Applications\python.exe\shell\open\command 2^>NUL`) do (set _my_=%%f %%g) +goto try1%errorlevel% + +:try10 +goto ok + +:try11 +for /f "usebackq tokens=1*" %%f in (`reg query HKCR\Python.File\shell\open\command 2^>NUL`) do (set _my_=%%f %%g) +goto try2%errorlevel% + +:try20: +goto ok + +:try21: +echo Building without Python ... +goto therest + +:ok +echo Building with Python ... +set _res_=%_my_:*REG_SZ=% +set _end_=%_res_:*exe"=% +call set _python_=%%_res_:%_end_%=%% +echo %_python_% +call %_python_% modules\arch\x86\gen_x86_insn.py + +:therest +@echo on +call :update %1 x86insn_nasm.gperf x86insn_nasm.c +call :update %1 x86insn_gas.gperf x86insn_gas.c +call :update %1 modules\arch\x86\x86cpu.gperf x86cpu.c +call :update %1 modules\arch\x86\x86regtmod.gperf x86regtmod.c +goto :eof + +:update +%1 %2 tf +call mkfiles\vc14\out_copy_rename tf .\ %3 +del tf diff --git a/Mkfiles/vc15/genstring/genstring.vcxproj b/Mkfiles/vc15/genstring/genstring.vcxproj new file mode 100644 index 00000000..3a9e298b --- /dev/null +++ b/Mkfiles/vc15/genstring/genstring.vcxproj @@ -0,0 +1,196 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {021CEB0A-F721-4F59-B349-9CEEAF244459} + genstring + Win32Proj + + + + Application + MultiByte + v141 + + + Application + MultiByte + v141 + + + Application + MultiByte + v141 + + + Application + MultiByte + v141 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + + + + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genstring.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + + + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genstring.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + + + run.bat "$(TargetPath)" + + + + + Full + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + Default + + + $(OutDir)genstring.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + + + Full + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + Default + + + $(OutDir)genstring.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + + + run.bat "$(TargetPath)" + + + + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc15/genstring/genstring.vcxproj.filters b/Mkfiles/vc15/genstring/genstring.vcxproj.filters new file mode 100644 index 00000000..04ed411d --- /dev/null +++ b/Mkfiles/vc15/genstring/genstring.vcxproj.filters @@ -0,0 +1,17 @@ + + + + + {28EBE11C-5BE8-4935-9381-F57696749E0C} + cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Source Files + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc15/genstring/run.bat b/Mkfiles/vc15/genstring/run.bat new file mode 100644 index 00000000..baedcecb --- /dev/null +++ b/Mkfiles/vc15/genstring/run.bat @@ -0,0 +1,2 @@ +cd ..\..\.. +%1 license_msg license.c COPYING diff --git a/Mkfiles/vc15/genversion/genversion.vcxproj b/Mkfiles/vc15/genversion/genversion.vcxproj new file mode 100644 index 00000000..69079a0a --- /dev/null +++ b/Mkfiles/vc15/genversion/genversion.vcxproj @@ -0,0 +1,223 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2} + genversion + Win32Proj + + + + Application + MultiByte + v141 + + + Application + MultiByte + v141 + + + Application + MultiByte + v141 + + + Application + MultiByte + v141 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + + + + Disabled + ..\..\vc10;..\..\..\;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genversion.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + cd ..\..\..\ +YASM-VERSION-GEN.bat + + + + + + Disabled + ..\..\vc10;..\..\..\;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genversion.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + + + run.bat "$(TargetPath)" + + + cd ..\..\..\ +YASM-VERSION-GEN.bat + + + + + + Full + ..\..\vc10;..\..\..\;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + Default + + + $(OutDir)genversion.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + cd ..\..\..\ +YASM-VERSION-GEN.bat + + + + + + Full + ..\..\vc10;..\..\..\;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + Default + + + $(OutDir)genversion.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + + + run.bat "$(TargetPath)" + + + cd ..\..\..\ +YASM-VERSION-GEN.bat + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc15/genversion/genversion.vcxproj.filters b/Mkfiles/vc15/genversion/genversion.vcxproj.filters new file mode 100644 index 00000000..cc088b12 --- /dev/null +++ b/Mkfiles/vc15/genversion/genversion.vcxproj.filters @@ -0,0 +1,26 @@ + + + + + {2acbec3a-0ed8-4b2e-826e-a84c7d35f205} + h;hpp;hxx;hm;inl + + + {E67ED277-E4F2-4D79-8C9E-962BAC164F3F} + cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Source Files + + + + + Header Files + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc15/genversion/run.bat b/Mkfiles/vc15/genversion/run.bat new file mode 100644 index 00000000..41b19cad --- /dev/null +++ b/Mkfiles/vc15/genversion/run.bat @@ -0,0 +1,2 @@ +cd ..\..\.. +%1 version.mac diff --git a/Mkfiles/vc15/genversion/runpre.bat b/Mkfiles/vc15/genversion/runpre.bat new file mode 100644 index 00000000..fdd15708 --- /dev/null +++ b/Mkfiles/vc15/genversion/runpre.bat @@ -0,0 +1,2 @@ +cd ..\..\.. +YASM-VERSION-GEN.bat diff --git a/Mkfiles/vc15/libyasm-stdint.h b/Mkfiles/vc15/libyasm-stdint.h new file mode 100644 index 00000000..b66ab15f --- /dev/null +++ b/Mkfiles/vc15/libyasm-stdint.h @@ -0,0 +1,8 @@ +#ifndef _UINTPTR_T_DEFINED +#ifdef _WIN64 +#include +#else +typedef unsigned long uintptr_t; +#endif +#define _UINTPTR_T_DEFINED +#endif diff --git a/Mkfiles/vc15/libyasm/libyasm.vcxproj b/Mkfiles/vc15/libyasm/libyasm.vcxproj new file mode 100644 index 00000000..63c5605f --- /dev/null +++ b/Mkfiles/vc15/libyasm/libyasm.vcxproj @@ -0,0 +1,277 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {29FE7874-1256-4AD6-B889-68E399DC9608} + libyasm + + + + StaticLibrary + false + MultiByte + v141 + + + StaticLibrary + false + MultiByte + v141 + + + StaticLibrary + false + MultiByte + v141 + + + StaticLibrary + false + MultiByte + v141 + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + + + + Full + Default + ..;../../..;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)libyasm.lib + true + + + + + X64 + + + Full + Default + ..;../../..;%(AdditionalIncludeDirectories) + NDEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)libyasm.lib + true + + + + + Disabled + ..;../../..;%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)libyasm.lib + true + + + + + X64 + + + Disabled + ..;../../..;%(AdditionalIncludeDirectories) + _DEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)libyasm.lib + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {f0e8b707-00c5-4ff2-b8ef-7c39817132a0} + false + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc15/libyasm/libyasm.vcxproj.filters b/Mkfiles/vc15/libyasm/libyasm.vcxproj.filters new file mode 100644 index 00000000..9bdf13a4 --- /dev/null +++ b/Mkfiles/vc15/libyasm/libyasm.vcxproj.filters @@ -0,0 +1,200 @@ + + + + + {4ca3b698-9d01-4e4e-ae00-5c98da045efe} + h;hpp;hxx;hm;inl + + + {68607062-982d-4251-9a1a-30f76474983d} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Source Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc15/modules/modules.vcxproj b/Mkfiles/vc15/modules/modules.vcxproj new file mode 100644 index 00000000..51d1dc12 --- /dev/null +++ b/Mkfiles/vc15/modules/modules.vcxproj @@ -0,0 +1,324 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6} + modules + + + + StaticLibrary + false + MultiByte + v141 + + + StaticLibrary + false + MultiByte + v141 + + + StaticLibrary + false + MultiByte + v141 + + + StaticLibrary + false + MultiByte + v141 + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + + + + Full + Default + ..;../../..;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)modules.lib + true + + + + + + + + + X64 + + + Full + Default + ..;../../..;%(AdditionalIncludeDirectories) + NDEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)modules.lib + true + + + + + Disabled + ..;../../..;%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)modules.lib + true + + + + + X64 + + + Disabled + ..;../../..;%(AdditionalIncludeDirectories) + _DEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)modules.lib + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {225700a5-07b8-434e-ad61-555278bf6733} + false + + + {c45a8b59-8b59-4d5d-a8e8-fb090f8dd619} + false + + + {29fe7874-1256-4ad6-b889-68e399dc9608} + false + + + {3c58be13-50a3-4583-984d-d8902b3d7713} + false + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc15/modules/modules.vcxproj.filters b/Mkfiles/vc15/modules/modules.vcxproj.filters new file mode 100644 index 00000000..e6ff3add --- /dev/null +++ b/Mkfiles/vc15/modules/modules.vcxproj.filters @@ -0,0 +1,256 @@ + + + + + {39c89f91-d860-4396-a49f-86b8b7a51c33} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {be0cdf28-cbed-4774-b3cc-b63e4e3fa0a9} + + + {491cc60a-889b-4f53-aae9-f4d7d6aa667a} + + + {c084015d-3c3e-4379-8746-ae5cffcec79e} + + + {3333e0b3-e95f-44f6-9000-58d4da368360} + + + {528f2955-ceba-4691-a36c-054f119e3dcc} + + + {81686d52-eb71-4d4a-a830-66c45afb808f} + + + {98fe1e43-3794-4639-bf29-14b0c569754f} + + + {6b3956d4-0bff-4e8e-af61-a7e59b476fa4} + + + {446fad62-ac17-49e9-8263-33481f04f182} + + + {33fb7fc8-61f9-428d-9c94-7a4912fbb678} + + + {48fc77ec-7d78-4c0a-bfc2-9aa76faf5d7f} + + + + + Source Files\parsers + + + Source Files\arch + + + Source Files\arch + + + Source Files\arch + + + Source Files\arch + + + Source Files\arch + + + Source Files\arch + + + Source Files\arch + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\listfmts\nasm + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\parsers + + + Source Files\parsers + + + Source Files\parsers + + + Source Files\parsers + + + Source Files\parsers + + + Source Files\preprocs\cpp + + + Source Files\preprocs\gas + + + Source Files\preprocs\gas + + + Source Files\preprocs\nasm + + + Source Files\preprocs\nasm + + + Source Files\preprocs\nasm + + + Source Files\preprocs\nasm + + + Source Files\preprocs\raw + + + Source Files\parsers + + + Source Files\arch + + + Source Files\arch + + + Source Files\objfmts + + + + + Source Files\arch + + + Source Files\arch + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\parsers + + + Source Files\parsers + + + Source Files\preprocs\gas + + + Source Files\preprocs\nasm + + + Source Files\preprocs\nasm + + + Source Files\preprocs\nasm + + + Source Files\preprocs\nasm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc15/out_copy_rename.bat b/Mkfiles/vc15/out_copy_rename.bat new file mode 100644 index 00000000..3179b59a --- /dev/null +++ b/Mkfiles/vc15/out_copy_rename.bat @@ -0,0 +1,42 @@ +@echo off +if not exist %1 goto nofile +if exist %2 goto copy + +echo creating directory %2 +md %2 > nul + +:copy +set str=%2 +for /f "useback tokens=*" %%a in ('%str%') do set str=%%~a +set str=%str:~-1% +if %str% == "\" goto hasbackslash + +if not exist %2\%3 goto cpy +fc %1 %2\%3 > nul && if not %errorlevel 1 goto exit +echo overwriting %2\%3 with %1 +copy %1 %2\%3 > nul +goto exit + +:cpy +echo copying %1 to %2\%3 +copy %1 %2\%3 > nul +goto exit + +:hasbackslash +if not exist %2%3 goto cpy2 +fc %1 %2%3 > nul && if not %errorlevel 1 goto exit +echo overwriting %2%3 with %1 +copy %1 %2%3 > nul +goto exit + +:cpy2 +echo copying %1 to %2%3 +copy %1 %2%3 > nul +goto exit + +:nofile +echo %1 not found + +:exit + + diff --git a/Mkfiles/vc15/re2c/re2c.vcxproj b/Mkfiles/vc15/re2c/re2c.vcxproj new file mode 100644 index 00000000..62eb2d0c --- /dev/null +++ b/Mkfiles/vc15/re2c/re2c.vcxproj @@ -0,0 +1,221 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {3C58BE13-50A3-4583-984D-D8902B3D7713} + re2c + Win32Proj + + + + Application + MultiByte + v141 + + + Application + MultiByte + v141 + + + Application + MultiByte + v141 + + + Application + MultiByte + v141 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + + + + Disabled + ..;../../..;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + Default + ProgramDatabase + + + $(OutDir)re2c.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + + + Disabled + ..;../../..;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + Default + ProgramDatabase + + + $(OutDir)re2c.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + + + run.bat "$(TargetPath)" + + + + + Full + ..;../../..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + Default + + + $(OutDir)re2c.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + + + Full + ..;../../..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + Default + + + $(OutDir)re2c.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + + + run.bat "$(TargetPath)" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc15/re2c/re2c.vcxproj.filters b/Mkfiles/vc15/re2c/re2c.vcxproj.filters new file mode 100644 index 00000000..da0f935c --- /dev/null +++ b/Mkfiles/vc15/re2c/re2c.vcxproj.filters @@ -0,0 +1,80 @@ + + + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc15/re2c/run.bat b/Mkfiles/vc15/re2c/run.bat new file mode 100644 index 00000000..6ac571f0 --- /dev/null +++ b/Mkfiles/vc15/re2c/run.bat @@ -0,0 +1,4 @@ +cd ..\..\..\ +%1 -s -o lc3bid.c modules\arch\lc3b\lc3bid.re +%1 -b -o nasm-token.c modules\parsers\nasm\nasm-token.re +%1 -b -o gas-token.c modules\parsers\gas\gas-token.re diff --git a/Mkfiles/vc15/readme.vc14.txt b/Mkfiles/vc15/readme.vc14.txt new file mode 100644 index 00000000..ea716567 --- /dev/null +++ b/Mkfiles/vc15/readme.vc14.txt @@ -0,0 +1,106 @@ +Building YASM with Microsoft Visual Studio 2015 (C/C++ v14) +----------------------------------------------------------- + +This note describes how to build YASM using Microsoft Visual +Studio 2015 (C/C++ v14). + +1. YASM Download +---------------- + +First YASM needs to be downloaded and the files placed within +a suitable directory, which will be called here but can +be named and located as you wish. + +2. Building YASM with Microsoft 2015 (VC14) +------------------------------------------- + +Now locate and double click on the yasm.sln solution file in +the 'Mkfiles/vc14' subdirectory to open the build project in +the Visual Studio 2015 IDE and then select: + + win32 or x64 build + release or debug build + +as appropriate to build the YASM binaries that you need. + +4. Using YASM with Visual Sudio 2015 and VC++ version 14 +-------------------------------------------------------- + +The YASM version vsyasm.exe is designed specifically for use +with the 2010 and later versions of Visual Studio. To tell +Visual Studio where to find vsyasm.exe, the environment +variable YASMPATH can be set to the absolute path of the +directory in which vsyasm.exe is located (this path should +include the final backslash). + +Alternatively you can find the directory (or directories) +where the VC++ compiler binaries are located and put copies +of the vsyasm.exe binary in these directories. The typical +location on 64-bit Windows is: + +C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin + +On 32-bit Windows it is normally at: + +C:\Program Files\Microsoft Visual Studio 14.0\VC\bin + +Depending on your system you can use either the win32 or the +x64 version of vsyasm.exe, which must be named vsyasm.exe. + +To use the custom tools facility in Visual Studio 2015, you +need to place a copy of three files - yasm.props, yasm.targets +and yasm.xml - into a location where they can be found by the +Visual Studio build customisation processes. There are several +ways to do this: + + a. put these files in the MSBUILD customisation directory, + which is typically at: + + C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\BuildCustomizations + + b. put them in a convenient location and set this path in the + 'Build Customisations Search Path' in the Visual Studio + 'Projects and Solutions|VC++ Project Settings' item in + the 'Tools|Options' menu; + + c. put them in a convenient location and set this path in the + 'Build Customisation dialogue (discussed later). + +To use YASM in a project, right click on the project in the Solution +Explorer and select 'Build Customisations..'. This will give you a +dialog box that allows you to select YASM as an assembler (note that +your assembler files need to have the extension '.asm'). If you have +used option c. above, you will need to let the dialogue find them +using the 'Find Existing' button below the dialogue. + +To assemble a file with YASM, select the Property Page for the file +and the select 'Yasm Assembler' in the Tool dialog entry. Then click +'Apply' and an additional property page entry will appear and enable +YASM settings to be established. + +5. A Linker Issue +----------------- + +There appears to be a linker bug in the VC++ linker that prevents +symbols with absolute addresses being linked in DLL builds. This +means, for example, that LEA instructions of the general form: + + lea, rax,[rax+symbol] + +cannot be used for DLL builds. The following general form +has to be used instead: + + lea rcx,[symbol wrt rip] + lea rax,[rax+rcx] + +This limitation may also cause problems with other instruction +that use absolute addresses. + +6. Acknowledgements +------------------- + +I am most grateful for the fantastic support that Peter Johnson, +YASM's creator, has given me in tracking down issues in using +YASM for the production of Windows x64 code. + + Brian Gladman, 30th April 2015 diff --git a/Mkfiles/vc15/vsyasm.props b/Mkfiles/vc15/vsyasm.props new file mode 100644 index 00000000..80b93c7e --- /dev/null +++ b/Mkfiles/vc15/vsyasm.props @@ -0,0 +1,27 @@ + + + + Midl + CustomBuild + + + _SelectedFiles;$(YASMDependsOn) + + + $(VCInstallDir)bin\ + + + + False + $(IntDir) + 0 + 0 + "$(YasmPath)"vsyasm.exe -Xvc -f $(Platform) [AllOptions] [AdditionalOptions] [Inputs] + %(ObjectFile) + Assembling %(Filename)%(Extension) + false + + + \ No newline at end of file diff --git a/Mkfiles/vc15/vsyasm.targets b/Mkfiles/vc15/vsyasm.targets new file mode 100644 index 00000000..3c084119 --- /dev/null +++ b/Mkfiles/vc15/vsyasm.targets @@ -0,0 +1,108 @@ + + + + + + _YASM + + + + $(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml + + + + + + + + @(YASM, '|') + + + + + + + + + $(ComputeLinkInputsTargets); + ComputeYASMOutput; + + + $(ComputeLibInputsTargets); + ComputeYASMOutput; + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc15/vsyasm.vcxproj b/Mkfiles/vc15/vsyasm.vcxproj new file mode 100644 index 00000000..9328dcf8 --- /dev/null +++ b/Mkfiles/vc15/vsyasm.vcxproj @@ -0,0 +1,279 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {7FDD85BB-CC86-442B-A425-989B5B296ED5} + vsyasm + + + + Application + false + MultiByte + v141 + + + Application + false + MultiByte + v141 + + + Application + false + MultiByte + v141 + + + Application + false + MultiByte + v141 + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + + + + $(Platform)\$(Configuration)/yasm.tlb + + + + + Disabled + .;../..;%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)vsyasm.exe + true + true + $(OutDir)$(ProjectName).pdb + Console + false + + + MachineX86 + + + + + X64 + $(Platform)\$(Configuration)/yasm.tlb + + + + + Disabled + .;../..;%(AdditionalIncludeDirectories) + _DEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)vsyasm.exe + true + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX64 + + + + + $(Platform)\$(Configuration)/yasm.tlb + + + + + Full + Default + true + .;../..;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)vsyasm.exe + true + true + $(OutDir)$(ProjectName).pdb + Console + false + + + MachineX86 + + + + + X64 + $(Platform)\$(Configuration)/yasm.tlb + + + + + Full + OnlyExplicitInline + .;../..;%(AdditionalIncludeDirectories) + NDEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)vsyasm.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX64 + true + + + + + + + + + {29fe7874-1256-4ad6-b889-68e399dc9608} + false + + + {d715a3d4-efaa-442e-ad8b-5b4ff64e1dd6} + false + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc15/vsyasm.xml b/Mkfiles/vc15/vsyasm.xml new file mode 100644 index 00000000..a108f005 --- /dev/null +++ b/Mkfiles/vc15/vsyasm.xml @@ -0,0 +1,283 @@ + + + + + + + + + + + + + General + + + + + + Symbols + + + + + + Files + + + + + + Command Line + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Execute Before + + + Specifies the targets for the build customization to run before. + + + + + + + + + + + + Execute After + + + Specifies the targets for the build customization to run after. + + + + + + + + + + + + + + + + + + Additional Options + + + Additional Options + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc15/yasm.sln b/Mkfiles/vc15/yasm.sln new file mode 100644 index 00000000..5d2dc952 --- /dev/null +++ b/Mkfiles/vc15/yasm.sln @@ -0,0 +1,142 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.22823.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{825AC694-358C-4D8D-92DE-33A2691978CE}" + ProjectSection(SolutionItems) = preProject + crt_secure_no_deprecate.vsprops = crt_secure_no_deprecate.vsprops + readme.vc14.txt = readme.vc14.txt + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libyasm", "libyasm\libyasm.vcxproj", "{29FE7874-1256-4AD6-B889-68E399DC9608}" + ProjectSection(ProjectDependencies) = postProject + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2} = {B545983B-8EE0-4A7B-A67A-E749EEAE62A2} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "modules", "modules\modules.vcxproj", "{D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yasm", "yasm.vcxproj", "{34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genmacro", "genmacro\genmacro.vcxproj", "{225700A5-07B8-434E-AD61-555278BF6733}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genversion", "genversion\genversion.vcxproj", "{B545983B-8EE0-4A7B-A67A-E749EEAE62A2}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "re2c", "re2c\re2c.vcxproj", "{3C58BE13-50A3-4583-984D-D8902B3D7713}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genperf", "genperf\genperf.vcxproj", "{C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genmodule", "genmodule\genmodule.vcxproj", "{F0E8B707-00C5-4FF2-B8EF-7C39817132A0}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genstring", "genstring\genstring.vcxproj", "{021CEB0A-F721-4F59-B349-9CEEAF244459}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ytasm", "ytasm.vcxproj", "{2162937B-0DBD-4450-B45F-DF578D8E7508}" + ProjectSection(ProjectDependencies) = postProject + {021CEB0A-F721-4F59-B349-9CEEAF244459} = {021CEB0A-F721-4F59-B349-9CEEAF244459} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vsyasm", "vsyasm.vcxproj", "{7FDD85BB-CC86-442B-A425-989B5B296ED5}" + ProjectSection(ProjectDependencies) = postProject + {021CEB0A-F721-4F59-B349-9CEEAF244459} = {021CEB0A-F721-4F59-B349-9CEEAF244459} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|Win32.ActiveCfg = Debug|Win32 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|Win32.Build.0 = Debug|Win32 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|x64.ActiveCfg = Debug|x64 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|x64.Build.0 = Debug|x64 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|Win32.ActiveCfg = Release|Win32 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|Win32.Build.0 = Release|Win32 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|x64.ActiveCfg = Release|x64 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|x64.Build.0 = Release|x64 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|Win32.ActiveCfg = Debug|Win32 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|Win32.Build.0 = Debug|Win32 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|x64.ActiveCfg = Debug|x64 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|x64.Build.0 = Debug|x64 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|Win32.ActiveCfg = Release|Win32 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|Win32.Build.0 = Release|Win32 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|x64.ActiveCfg = Release|x64 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|x64.Build.0 = Release|x64 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|Win32.ActiveCfg = Debug|Win32 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|Win32.Build.0 = Debug|Win32 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|x64.ActiveCfg = Debug|x64 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|x64.Build.0 = Debug|x64 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|Win32.ActiveCfg = Release|Win32 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|Win32.Build.0 = Release|Win32 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|x64.ActiveCfg = Release|x64 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|x64.Build.0 = Release|x64 + {225700A5-07B8-434E-AD61-555278BF6733}.Debug|Win32.ActiveCfg = Debug|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Debug|Win32.Build.0 = Debug|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Debug|x64.ActiveCfg = Debug|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Debug|x64.Build.0 = Debug|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Release|Win32.ActiveCfg = Release|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Release|Win32.Build.0 = Release|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Release|x64.ActiveCfg = Release|x64 + {225700A5-07B8-434E-AD61-555278BF6733}.Release|x64.Build.0 = Release|x64 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|Win32.ActiveCfg = Debug|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|Win32.Build.0 = Debug|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|x64.ActiveCfg = Debug|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|x64.Build.0 = Debug|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|Win32.ActiveCfg = Release|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|Win32.Build.0 = Release|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|x64.ActiveCfg = Release|x64 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|x64.Build.0 = Release|x64 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|Win32.ActiveCfg = Debug|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|Win32.Build.0 = Debug|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|x64.ActiveCfg = Debug|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|x64.Build.0 = Debug|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|Win32.ActiveCfg = Release|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|Win32.Build.0 = Release|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|x64.ActiveCfg = Release|x64 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|x64.Build.0 = Release|x64 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|Win32.ActiveCfg = Debug|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|Win32.Build.0 = Debug|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|x64.ActiveCfg = Debug|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|x64.Build.0 = Debug|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|Win32.ActiveCfg = Release|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|Win32.Build.0 = Release|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|x64.ActiveCfg = Release|x64 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|x64.Build.0 = Release|x64 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|Win32.ActiveCfg = Debug|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|Win32.Build.0 = Debug|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|x64.ActiveCfg = Debug|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|x64.Build.0 = Debug|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|Win32.ActiveCfg = Release|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|Win32.Build.0 = Release|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|x64.ActiveCfg = Release|x64 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|x64.Build.0 = Release|x64 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|Win32.ActiveCfg = Debug|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|Win32.Build.0 = Debug|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|x64.ActiveCfg = Debug|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|x64.Build.0 = Debug|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|Win32.ActiveCfg = Release|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|Win32.Build.0 = Release|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|x64.ActiveCfg = Release|x64 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|x64.Build.0 = Release|x64 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|Win32.ActiveCfg = Debug|Win32 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|Win32.Build.0 = Debug|Win32 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|x64.ActiveCfg = Debug|x64 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|x64.Build.0 = Debug|x64 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|Win32.ActiveCfg = Release|Win32 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|Win32.Build.0 = Release|Win32 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|x64.ActiveCfg = Release|x64 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|x64.Build.0 = Release|x64 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|Win32.ActiveCfg = Debug|Win32 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|Win32.Build.0 = Debug|Win32 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|x64.ActiveCfg = Debug|x64 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|x64.Build.0 = Debug|x64 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|Win32.ActiveCfg = Release|Win32 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|Win32.Build.0 = Release|Win32 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|x64.ActiveCfg = Release|x64 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Mkfiles/vc15/yasm.vcxproj b/Mkfiles/vc15/yasm.vcxproj new file mode 100644 index 00000000..dd041da0 --- /dev/null +++ b/Mkfiles/vc15/yasm.vcxproj @@ -0,0 +1,283 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5} + yasm + + + + Application + false + MultiByte + v141 + + + Application + false + MultiByte + v141 + + + Application + false + MultiByte + v141 + + + Application + false + MultiByte + v141 + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + + + + $(Platform)\$(Configuration)/yasm.tlb + + + + + Disabled + .;../..;%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)yasm.exe + true + true + $(OutDir)$(ProjectName).pdb + Console + false + + + MachineX86 + + + + + X64 + $(Platform)\$(Configuration)/yasm.tlb + + + + + Disabled + .;../..;%(AdditionalIncludeDirectories) + _DEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)yasm.exe + true + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX64 + + + + + $(Platform)\$(Configuration)/yasm.tlb + + + + + Full + Default + true + .;../..;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)yasm.exe + true + true + $(OutDir)$(ProjectName).pdb + Console + false + + + MachineX86 + + + + + X64 + $(Platform)\$(Configuration)/yasm.tlb + + + + + Full + OnlyExplicitInline + .;../..;%(AdditionalIncludeDirectories) + NDEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)yasm.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX64 + true + + + + + + + + + + + + + + + + + {021ceb0a-f721-4f59-b349-9ceeaf244459} + false + + + {29fe7874-1256-4ad6-b889-68e399dc9608} + false + + + {d715a3d4-efaa-442e-ad8b-5b4ff64e1dd6} + false + + + + + + \ No newline at end of file diff --git a/Mkfiles/vc15/yasm.vcxproj.filters b/Mkfiles/vc15/yasm.vcxproj.filters new file mode 100644 index 00000000..04941c22 --- /dev/null +++ b/Mkfiles/vc15/yasm.vcxproj.filters @@ -0,0 +1,41 @@ + + + + + {51f0d88e-1373-4bf8-a72e-c79706d37f8b} + h;hpp;hxx;hm;inl + + + {db67b411-6f59-462c-9c20-75024c6b3912} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + \ No newline at end of file diff --git a/Mkfiles/vc15/ytasm.vcxproj b/Mkfiles/vc15/ytasm.vcxproj new file mode 100644 index 00000000..9d90e255 --- /dev/null +++ b/Mkfiles/vc15/ytasm.vcxproj @@ -0,0 +1,278 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {2162937B-0DBD-4450-B45F-DF578D8E7508} + ytasm + + + + Application + false + MultiByte + v141 + + + Application + false + MultiByte + v141 + + + Application + false + MultiByte + v141 + + + Application + false + MultiByte + v141 + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + + + + $(Platform)\$(Configuration)/yasm.tlb + + + + + Disabled + .;../..;%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)ytasm.exe + true + true + $(OutDir)$(ProjectName).pdb + Console + false + + + MachineX86 + + + + + X64 + $(Platform)\$(Configuration)/yasm.tlb + + + + + Disabled + .;../..;%(AdditionalIncludeDirectories) + _DEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)ytasm.exe + true + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX64 + + + + + $(Platform)\$(Configuration)/yasm.tlb + + + + + Full + Default + true + .;../..;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)ytasm.exe + true + true + $(OutDir)$(ProjectName).pdb + Console + false + + + MachineX86 + + + + + X64 + $(Platform)\$(Configuration)/yasm.tlb + + + + + Full + OnlyExplicitInline + .;../..;%(AdditionalIncludeDirectories) + NDEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)ytasm.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX64 + true + + + + + + + + + + + + + + + + {29fe7874-1256-4ad6-b889-68e399dc9608} + false + + + {d715a3d4-efaa-442e-ad8b-5b4ff64e1dd6} + false + + + + + + \ No newline at end of file From 91d628ac60580a75011e49f1fcad4b3aa720ea4e Mon Sep 17 00:00:00 2001 From: Paul Blinzer Date: Sat, 23 Sep 2017 15:08:03 -0700 Subject: [PATCH 509/585] New AMD Excavator MONITORX, MWAITX instruction support (for 32bit/64bit) (#78) MONITORX has opcode "0F 01 FA". rAX contains address to be monitored ECX specifies optional extensions EDX specifies optional hints MWAITX has opcode "0F 01 FA". EAX specifies optional hints ECX specifies optional extensions Public documentation: http://support.amd.com/TechDocs/24594.pdf New CLZERO instruction support (for 32bit/64bit) * clzero has opcode "0F 01 FC". * clzero gets enabled with CPUID, 8000_0008, EBX[0] =1. * clzero instruction zero's out the 64 byte cache line specified in rAX. Bits 5:0 of rAX are ignored Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved. Redistributed under simplified 2-clause BSD licence --- modules/arch/x86/gen_x86_insn.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index 88972b01..6f221218 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -8267,6 +8267,20 @@ add_insn("vmload", "svm_rax", modifiers=[0xDA]) add_insn("vmrun", "svm_rax", modifiers=[0xD8]) add_insn("vmsave", "svm_rax", modifiers=[0xDB]) + +##################################################################### +# AMD Excavator, new instructions MONITORX, MWAITX +##################################################################### + +add_insn("monitorx", "threebyte", modifiers=[0x0F, 0x01, 0xFA], cpu=["AMD"]) +add_insn("mwaitx", "threebyte", modifiers=[0x0F, 0x01, 0xFB], cpu=["AMD"]) + +##################################################################### +# AMD Zen, new instructions CLZERO +##################################################################### + +add_insn("clzero", "threebyte", modifiers=[0x0F, 0x01, 0xFC], cpu=["AMD"]) + ##################################################################### # VIA PadLock instructions ##################################################################### From 4808260d62ab0a1e2b9b9e7ec99873cdb6e2203c Mon Sep 17 00:00:00 2001 From: bird2tori Date: Sun, 24 Sep 2017 00:08:58 +0200 Subject: [PATCH 510/585] Leak fixes (#79) * preproc/nasm: Close the input file; addressed a few memory leaks. * yasm.c: delete include paths before we exit * cv-dbgfmt.c: Free cv_filename::filename too. --- frontends/yasm/yasm.c | 1 + modules/dbgfmts/codeview/cv-dbgfmt.c | 2 ++ modules/preprocs/nasm/nasm-pp.c | 5 +++++ modules/preprocs/nasm/nasm-preproc.c | 3 +++ 4 files changed, 11 insertions(+) diff --git a/frontends/yasm/yasm.c b/frontends/yasm/yasm.c index 75d96755..bc6f379a 100644 --- a/frontends/yasm/yasm.c +++ b/frontends/yasm/yasm.c @@ -580,6 +580,7 @@ do_assemble(void) yasm_linemap_destroy(linemap); yasm_errwarns_destroy(errwarns); cleanup(object); + yasm_delete_include_paths(); return EXIT_SUCCESS; } diff --git a/modules/dbgfmts/codeview/cv-dbgfmt.c b/modules/dbgfmts/codeview/cv-dbgfmt.c index 9b06fe34..e39a725f 100644 --- a/modules/dbgfmts/codeview/cv-dbgfmt.c +++ b/modules/dbgfmts/codeview/cv-dbgfmt.c @@ -71,6 +71,8 @@ cv_dbgfmt_destroy(/*@only@*/ yasm_dbgfmt *dbgfmt) for (i=0; ifilenames_size; i++) { if (dbgfmt_cv->filenames[i].pathname) yasm_xfree(dbgfmt_cv->filenames[i].pathname); + if (dbgfmt_cv->filenames[i].filename) + yasm_xfree(dbgfmt_cv->filenames[i].filename); } yasm_xfree(dbgfmt_cv->filenames); yasm_xfree(dbgfmt); diff --git a/modules/preprocs/nasm/nasm-pp.c b/modules/preprocs/nasm/nasm-pp.c index 5ea650e3..32ebcd00 100644 --- a/modules/preprocs/nasm/nasm-pp.c +++ b/modules/preprocs/nasm/nasm-pp.c @@ -2313,6 +2313,9 @@ expand_macros_in_string(char **p) Token *line = tokenise(*p); line = expand_smacro(line); *p = detoken(line, FALSE); + do + line = delete_Token(line); + while (line); } /** @@ -2732,6 +2735,7 @@ do_directive(Token * tline) inc->next = istk; inc->conds = NULL; inc->fp = inc_fopen(p, &newname); + nasm_free(p); inc->fname = nasm_src_set_fname(newname); inc->lineno = nasm_src_set_linnum(0); inc->lineinc = 1; @@ -5051,6 +5055,7 @@ pp_getline(void) } istk = i->next; list->downlevel(LIST_INCLUDE); + nasm_free(i->fname); nasm_free(i); if (!istk) return NULL; diff --git a/modules/preprocs/nasm/nasm-preproc.c b/modules/preprocs/nasm/nasm-preproc.c index 0b364b1f..96d66dbc 100644 --- a/modules/preprocs/nasm/nasm-preproc.c +++ b/modules/preprocs/nasm/nasm-preproc.c @@ -173,9 +173,12 @@ nasm_preproc_destroy(yasm_preproc *preproc) yasm_xfree(preproc_nasm->line); if (preproc_nasm->file_name) yasm_xfree(preproc_nasm->file_name); + if (preproc_nasm->in) + fclose(preproc_nasm->in); yasm_xfree(preproc); if (preproc_deps) yasm_xfree(preproc_deps); + yasm_xfree(nasm_src_set_fname(NULL)); } static char * From 85dad85f7c282967176dec38835dedaf1322a25f Mon Sep 17 00:00:00 2001 From: Simon Brenner Date: Sun, 24 Sep 2017 00:09:47 +0200 Subject: [PATCH 511/585] Only print 'warnings treated as errors' if there were warnings (#75) This prints it as an additional error for the line that generated the first warning. --- libyasm/errwarn.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/libyasm/errwarn.c b/libyasm/errwarn.c index d51a0deb..18958db9 100644 --- a/libyasm/errwarn.c +++ b/libyasm/errwarn.c @@ -492,14 +492,6 @@ yasm_errwarns_output_all(yasm_errwarns *errwarns, yasm_linemap *lm, const char *filename, *xref_filename; unsigned long line, xref_line; - /* If we're treating warnings as errors, tell the user about it. */ - if (warning_as_error && warning_as_error != 2) { - print_error("", 0, - yasm_gettext_hook(N_("warnings being treated as errors")), - NULL, 0, NULL); - warning_as_error = 2; - } - /* Output error/warnings. */ SLIST_FOREACH(we, &errwarns->errwarns, link) { /* Output error/warning */ @@ -514,7 +506,17 @@ yasm_errwarns_output_all(yasm_errwarns *errwarns, yasm_linemap *lm, print_error(filename, line, we->msg, xref_filename, xref_line, we->xrefmsg); else + { print_warning(filename, line, we->msg); + + /* If we're treating warnings as errors, tell the user about it. */ + if (warning_as_error && warning_as_error != 2) { + const char *msg = + yasm_gettext_hook(N_("warnings being treated as errors")); + print_error(filename, line, msg, NULL, 0, NULL); + warning_as_error = 2; + } + } } } From 74184586228af6c362f970c84fce58da3fcbdec8 Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Tue, 4 Apr 2017 00:34:47 +1000 Subject: [PATCH 512/585] fix memory errors when using gas processor with coff object output. --- modules/objfmts/coff/coff-objfmt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/objfmts/coff/coff-objfmt.c b/modules/objfmts/coff/coff-objfmt.c index 6fcb0e3c..8f753bfe 100644 --- a/modules/objfmts/coff/coff-objfmt.c +++ b/modules/objfmts/coff/coff-objfmt.c @@ -290,6 +290,7 @@ coff_common_create(yasm_object *object) objfmt_coff->done_prolog = 0; objfmt_coff->unwind = NULL; objfmt_coff->ssym_imagebase = NULL; + objfmt_coff->def_sym = NULL; return objfmt_coff; } From 6eac25ff8c63a448fc6b4452a8697f8e0ee7d021 Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Tue, 4 Apr 2017 03:58:31 +1000 Subject: [PATCH 513/585] allow movbe to be suffixed with wlq in gas syntax. --- modules/arch/x86/gen_x86_insn.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index 6f221218..b21c74a2 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -7909,15 +7909,17 @@ add_insn("xsaveopt64", "xsaveopt64", modifiers=[6, 0x0F, 0xAE], ##################################################################### # Intel MOVBE instruction ##################################################################### -for sz in (16, 32, 64): +for sfx, sz in zip("wlq", [16, 32, 64]): add_group("movbe", cpu=["MOVBE"], + suffix=sfx, opersize=sz, opcode=[0x0F, 0x38, 0xF0], operands=[Operand(type="Reg", size=sz, dest="Spare"), Operand(type="Mem", size=sz, relaxed=True, dest="EA")]) add_group("movbe", cpu=["MOVBE"], + suffix=sfx, opersize=sz, opcode=[0x0F, 0x38, 0xF1], operands=[Operand(type="Mem", size=sz, relaxed=True, dest="EA"), From e256985c4929f4e550d8f70cad5fb936f81b7b06 Mon Sep 17 00:00:00 2001 From: mostynb Date: Sun, 24 Sep 2017 00:14:23 +0200 Subject: [PATCH 514/585] avoid 'return value of ftruncate ignored' warnings (#76) --- modules/objfmts/bin/bin-objfmt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/objfmts/bin/bin-objfmt.c b/modules/objfmts/bin/bin-objfmt.c index 69264a90..4a4ce96f 100644 --- a/modules/objfmts/bin/bin-objfmt.c +++ b/modules/objfmts/bin/bin-objfmt.c @@ -2040,7 +2040,8 @@ dosexe_objfmt_output(yasm_object *object, FILE *f, /*@unused@*/ int all_syms, bss_size = tot_size - size; #ifdef HAVE_FTRUNCATE if (size != tot_size) - ftruncate(fileno(f), EXE_HEADER_SIZE + size); + if (ftruncate(fileno(f), EXE_HEADER_SIZE + size)) + ; /* No-op. Report an error? */ #endif fseek(f, 0, SEEK_SET); From 627e1c29a425af7791ae6fe8a7b4d3815e3398e0 Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Thu, 27 Sep 2018 18:34:45 +0100 Subject: [PATCH 515/585] Update the files for integrating YASM into Visual Studio 2017 --- Mkfiles/vc15/vsyasm.props | 6 +- Mkfiles/vc15/vsyasm.targets | 118 ++++++++++++++++++------------------ 2 files changed, 63 insertions(+), 61 deletions(-) diff --git a/Mkfiles/vc15/vsyasm.props b/Mkfiles/vc15/vsyasm.props index 80b93c7e..889097fa 100644 --- a/Mkfiles/vc15/vsyasm.props +++ b/Mkfiles/vc15/vsyasm.props @@ -10,17 +10,17 @@ Condition="'$(ConfigurationType)' != 'Makefile'">_SelectedFiles;$(YASMDependsOn) - $(VCInstallDir)bin\ + C:\Program Files\yasm\ False - $(IntDir) + $(IntDir)%(FileName).obj 0 0 "$(YasmPath)"vsyasm.exe -Xvc -f $(Platform) [AllOptions] [AdditionalOptions] [Inputs] %(ObjectFile) - Assembling %(Filename)%(Extension) + Assembling %(Filename)%(Extension) ==> $(IntDir)%(FileName).obj false diff --git a/Mkfiles/vc15/vsyasm.targets b/Mkfiles/vc15/vsyasm.targets index 3c084119..c62d6626 100644 --- a/Mkfiles/vc15/vsyasm.targets +++ b/Mkfiles/vc15/vsyasm.targets @@ -1,5 +1,6 @@  + @@ -8,40 +9,75 @@ _YASM + + + + $(ComputeLinkInputsTargets); + ComputeYASMOutput; + + + $(ComputeLibInputsTargets); + ComputeYASMOutput; + + + $(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml + + + + + <_YASMReadTlog + Include="^%(YASM.FullPath);%(YASM.AdditionalDependencies)" + Condition="'%(YASM.ExcludedFromBuild)' != 'true' and '%(YASM.ObjectFile)' != ''"/> + <_YASMWriteTlog + Include="^%(YASM.FullPath);'$(MSBuildProjectDirectory)%(YASM.ObjectFile)'" + Condition="'%(YASM.ExcludedFromBuild)' != 'true' and '%(YASM.ObjectFile)' != ''"/> + + + + + + + + <_MasmReadTlog Remove="@(_MasmReadTlog)" /> + <_MasmWriteTlog Remove="@(_MasmWriteTlog)" /> + + + + - - - - - - @(YASM, '|') - + Inputs="%(YASM.Identity);%(YASM.AdditionalDependencies);$(MSBuildProjectFile)" + Outputs="%(YASM.ObjectFile)" + DependsOnTargets="PrepareForBuild;_WriteYasmTlogs;_SelectedFiles;$(YASMDependsOn);"> + + + + - + + Inputs="%(YASM.Identity)" /> - - - $(ComputeLinkInputsTargets); - ComputeYASMOutput; - - - $(ComputeLibInputsTargets); - ComputeYASMOutput; - - + - - - - + + - - - - - - - + \ No newline at end of file From 35af9720e36df19382a57be26643b0d6bb48a363 Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Fri, 28 Sep 2018 00:38:32 +0100 Subject: [PATCH 516/585] change vsyasm.props to use the YASM_PATH environment variable if present --- Mkfiles/vc15/vsyasm.props | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Mkfiles/vc15/vsyasm.props b/Mkfiles/vc15/vsyasm.props index 889097fa..8e2269b6 100644 --- a/Mkfiles/vc15/vsyasm.props +++ b/Mkfiles/vc15/vsyasm.props @@ -10,7 +10,7 @@ Condition="'$(ConfigurationType)' != 'Makefile'">_SelectedFiles;$(YASMDependsOn) - C:\Program Files\yasm\ + C:\Program Files\yasm\ @@ -18,10 +18,10 @@ $(IntDir)%(FileName).obj 0 0 - "$(YasmPath)"vsyasm.exe -Xvc -f $(Platform) [AllOptions] [AdditionalOptions] [Inputs] + "$(YASM_PATH)"vsyasm.exe -Xvc -f $(Platform) [AllOptions] [AdditionalOptions] [Inputs] %(ObjectFile) Assembling %(Filename)%(Extension) ==> $(IntDir)%(FileName).obj false - \ No newline at end of file + From 70f79a3a663ce58b73250819fc1a7d6b9d75a5c7 Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Tue, 4 Dec 2018 21:18:38 +0000 Subject: [PATCH 517/585] correct bug in VSYASM build integration files (vsyasm.targets) --- Mkfiles/vc15/vsyasm.targets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Mkfiles/vc15/vsyasm.targets b/Mkfiles/vc15/vsyasm.targets index c62d6626..5206c8bc 100644 --- a/Mkfiles/vc15/vsyasm.targets +++ b/Mkfiles/vc15/vsyasm.targets @@ -55,8 +55,8 @@ Encoding="Unicode"/> - <_MasmReadTlog Remove="@(_MasmReadTlog)" /> - <_MasmWriteTlog Remove="@(_MasmWriteTlog)" /> + <_YASMReadTlog Remove="@(_YASMReadTlog)" /> + <_YASMWriteTlog Remove="@(_YASMWriteTlog)" /> From a1aa3adc2ca465e23bd628830243264eb8354d0e Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Tue, 4 Dec 2018 21:18:38 +0000 Subject: [PATCH 518/585] correct bug in VSYASM build integration files (vsyasm.targets) --- Mkfiles/vc15/vsyasm.targets | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Mkfiles/vc15/vsyasm.targets b/Mkfiles/vc15/vsyasm.targets index c62d6626..8f38f2cb 100644 --- a/Mkfiles/vc15/vsyasm.targets +++ b/Mkfiles/vc15/vsyasm.targets @@ -35,8 +35,8 @@ <_YASMReadTlog Include="^%(YASM.FullPath);%(YASM.AdditionalDependencies)" Condition="'%(YASM.ExcludedFromBuild)' != 'true' and '%(YASM.ObjectFile)' != ''"/> - <_YASMWriteTlog - Include="^%(YASM.FullPath);'$(MSBuildProjectDirectory)%(YASM.ObjectFile)'" + <_YASMWriteTlog + Include="^%(YASM.FullPath);$([MSBuild]::NormalizePath('$(MSBuildProjectDirectory)', '%(YASM.ObjectFile)'))" Condition="'%(YASM.ExcludedFromBuild)' != 'true' and '%(YASM.ObjectFile)' != ''"/> @@ -55,8 +55,8 @@ Encoding="Unicode"/> - <_MasmReadTlog Remove="@(_MasmReadTlog)" /> - <_MasmWriteTlog Remove="@(_MasmWriteTlog)" /> + <_YASMReadTlog Remove="@(_YASMReadTlog)" /> + <_YASMWriteTlog Remove="@(_YASMWriteTlog)" /> From bcc01c59d8196f857989e6ae718458c296ca20e3 Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Thu, 16 May 2019 13:57:23 +0100 Subject: [PATCH 519/585] add build files for Microsoft Visual Studio 2019 --- Mkfiles/vs/config.h | 170 +++++++++ Mkfiles/vs/crt_secure_no_deprecate.props | 11 + Mkfiles/vs/crt_secure_no_deprecate.vsprops | 11 + Mkfiles/vs/genmacro/genmacro.vcxproj | 203 +++++++++++ Mkfiles/vs/genmacro/genmacro.vcxproj.filters | 17 + Mkfiles/vs/genmacro/run.bat | 5 + Mkfiles/vs/genmodule/genmodule.vcxproj | 208 +++++++++++ .../vs/genmodule/genmodule.vcxproj.filters | 20 ++ Mkfiles/vs/genmodule/run.bat | 3 + Mkfiles/vs/genperf/genperf.vcxproj | 262 ++++++++++++++ Mkfiles/vs/genperf/genperf.vcxproj.filters | 56 +++ Mkfiles/vs/genperf/run.bat | 40 +++ Mkfiles/vs/genstring/genstring.vcxproj | 197 +++++++++++ .../vs/genstring/genstring.vcxproj.filters | 17 + Mkfiles/vs/genstring/run.bat | 2 + Mkfiles/vs/genversion/genversion.vcxproj | 224 ++++++++++++ .../vs/genversion/genversion.vcxproj.filters | 26 ++ Mkfiles/vs/genversion/run.bat | 2 + Mkfiles/vs/genversion/runpre.bat | 2 + Mkfiles/vs/libyasm/libyasm.vcxproj | 278 +++++++++++++++ Mkfiles/vs/libyasm/libyasm.vcxproj.filters | 200 +++++++++++ Mkfiles/vs/modules/modules.vcxproj | 325 ++++++++++++++++++ Mkfiles/vs/modules/modules.vcxproj.filters | 256 ++++++++++++++ Mkfiles/vs/out_copy_rename.bat | 42 +++ Mkfiles/vs/re2c/re2c.vcxproj | 222 ++++++++++++ Mkfiles/vs/re2c/re2c.vcxproj.filters | 80 +++++ Mkfiles/vs/re2c/run.bat | 4 + Mkfiles/vs/readme.vs.txt | 96 ++++++ Mkfiles/vs/vsyasm.props | 27 ++ Mkfiles/vs/vsyasm.targets | 110 ++++++ Mkfiles/vs/vsyasm.vcxproj | 280 +++++++++++++++ Mkfiles/vs/vsyasm.xml | 283 +++++++++++++++ Mkfiles/vs/yasm.sln | 142 ++++++++ Mkfiles/vs/yasm.vcxproj | 284 +++++++++++++++ Mkfiles/vs/yasm.vcxproj.filters | 41 +++ Mkfiles/vs/ytasm.vcxproj | 279 +++++++++++++++ 36 files changed, 4425 insertions(+) create mode 100644 Mkfiles/vs/config.h create mode 100644 Mkfiles/vs/crt_secure_no_deprecate.props create mode 100644 Mkfiles/vs/crt_secure_no_deprecate.vsprops create mode 100644 Mkfiles/vs/genmacro/genmacro.vcxproj create mode 100644 Mkfiles/vs/genmacro/genmacro.vcxproj.filters create mode 100644 Mkfiles/vs/genmacro/run.bat create mode 100644 Mkfiles/vs/genmodule/genmodule.vcxproj create mode 100644 Mkfiles/vs/genmodule/genmodule.vcxproj.filters create mode 100644 Mkfiles/vs/genmodule/run.bat create mode 100644 Mkfiles/vs/genperf/genperf.vcxproj create mode 100644 Mkfiles/vs/genperf/genperf.vcxproj.filters create mode 100644 Mkfiles/vs/genperf/run.bat create mode 100644 Mkfiles/vs/genstring/genstring.vcxproj create mode 100644 Mkfiles/vs/genstring/genstring.vcxproj.filters create mode 100644 Mkfiles/vs/genstring/run.bat create mode 100644 Mkfiles/vs/genversion/genversion.vcxproj create mode 100644 Mkfiles/vs/genversion/genversion.vcxproj.filters create mode 100644 Mkfiles/vs/genversion/run.bat create mode 100644 Mkfiles/vs/genversion/runpre.bat create mode 100644 Mkfiles/vs/libyasm/libyasm.vcxproj create mode 100644 Mkfiles/vs/libyasm/libyasm.vcxproj.filters create mode 100644 Mkfiles/vs/modules/modules.vcxproj create mode 100644 Mkfiles/vs/modules/modules.vcxproj.filters create mode 100644 Mkfiles/vs/out_copy_rename.bat create mode 100644 Mkfiles/vs/re2c/re2c.vcxproj create mode 100644 Mkfiles/vs/re2c/re2c.vcxproj.filters create mode 100644 Mkfiles/vs/re2c/run.bat create mode 100644 Mkfiles/vs/readme.vs.txt create mode 100644 Mkfiles/vs/vsyasm.props create mode 100644 Mkfiles/vs/vsyasm.targets create mode 100644 Mkfiles/vs/vsyasm.vcxproj create mode 100644 Mkfiles/vs/vsyasm.xml create mode 100644 Mkfiles/vs/yasm.sln create mode 100644 Mkfiles/vs/yasm.vcxproj create mode 100644 Mkfiles/vs/yasm.vcxproj.filters create mode 100644 Mkfiles/vs/ytasm.vcxproj diff --git a/Mkfiles/vs/config.h b/Mkfiles/vs/config.h new file mode 100644 index 00000000..8515ac5a --- /dev/null +++ b/Mkfiles/vs/config.h @@ -0,0 +1,170 @@ +#include "YASM-VERSION.h" +#define yasm__splitpath(path, tail) yasm__splitpath_win(path, tail) +#define yasm__abspath(path) yasm__abspath_win(path) +#define yasm__combpath(from, to) yasm__combpath_win(from, to) + +/* Command name to run C preprocessor */ +#define CPP_PROG "cpp" + +/* */ +/* #undef ENABLE_NLS */ + +/* Define if you have the `abort' function. */ +#define HAVE_ABORT 1 + +/* */ +/* #undef HAVE_CATGETS */ + +/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYCURRENT */ + +/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +/* #undef HAVE_DCGETTEXT */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DIRECT_H 1 + +/* Define to 1 if you have the `getcwd' function. */ +#define HAVE_GETCWD 1 + +/* */ +/* #undef HAVE_GETTEXT */ + +/* Define if you have the GNU C Library */ +/* #undef HAVE_GNU_C_LIBRARY */ + +/* Define if you have the iconv() function. */ +/* #undef HAVE_ICONV */ + +/* Define if you have the header file. */ +/* #undef HAVE_INTTYPES_H */ + +/* */ +/* #undef HAVE_LC_MESSAGES */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LIBGEN_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_MEMORY_H */ + +/* Define if you have the `mergesort' function. */ +/* #undef HAVE_MERGESORT */ + +/* Define to 1 if you have the `popen' function. */ +/* #undef HAVE_POPEN */ + +/* Define if you have the header file. */ +/* #undef HAVE_STDINT_H */ + +/* Define if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* */ +/* #undef HAVE_STPCPY */ + +/* Define if you have the `strcasecmp' function. */ +/* #undef HAVE_STRCASECMP */ + +/* Define if you have the `strcmpi' function. */ +/* #undef HAVE_STRCMPI */ + +/* Define if you have the `stricmp' function. */ +/* #undefine HAVE_STRICMP */ + +/* Define if you have the header file. */ +/* #undef HAVE_STRINGS_H */ + +/* Define if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define if you have the `strncasecmp' function. */ +/* #undef HAVE_STRNCASECMP */ + +/* Define if you have the `strsep' function. */ +/* #undef HAVE_STRSEP */ + +/* Define if you have the header file. */ +/* #undef HAVE_SYS_STAT_H */ + +/* Define if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define if you have the `toascii' function. */ +#define HAVE_TOASCII 1 +#define toascii __toascii + +/* Define if you have the header file. */ +/* #undef HAVE_UNISTD_H */ + +/* Define to 1 if you have the `vsnprintf' function. */ +/* #undef HAVE_VSNPRINTF */ + +/* Define to 1 if you have the `_stricmp' function. */ +#define HAVE__STRICMP 1 + +/* Name of package */ +#define PACKAGE "yasm" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "bug-yasm@tortall.net" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "yasm" + +/* Define to the full name and version of this package. */ +/*#define PACKAGE_STRING "yasm HEAD"*/ + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "yasm" + +/* Define to the version of this package. */ +/*#define PACKAGE_VERSION "HEAD"*/ + +/* Define if the C compiler supports function prototypes. */ +#define PROTOTYPES 1 + +/* The size of a `char', as computed by sizeof. */ +/* #undef SIZEOF_CHAR */ + +/* The size of a `int', as computed by sizeof. */ +/* #undef SIZEOF_INT */ + +/* The size of a `long', as computed by sizeof. */ +/* #undef SIZEOF_LONG */ + +/* The size of a `short', as computed by sizeof. */ +/* #undef SIZEOF_SHORT */ + +/* The size of a `void*', as computed by sizeof. */ +/* #undef SIZEOF_VOIDP */ + +/* Define if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Version number of package */ +#define VERSION "HEAD" + +/* Define if using the dmalloc debugging malloc package */ +/* #undef WITH_DMALLOC */ + +/* Define like PROTOTYPES; this can be used by system headers. */ +#define __PROTOTYPES 1 + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define as `__inline' if that's what the C compiler calls it, or to nothing + if it is not supported. */ +#ifndef __cplusplus +/* #undef inline */ +#endif + +/* Define to `unsigned' if doesn't define. */ +/* #undef size_t */ diff --git a/Mkfiles/vs/crt_secure_no_deprecate.props b/Mkfiles/vs/crt_secure_no_deprecate.props new file mode 100644 index 00000000..777d6d0a --- /dev/null +++ b/Mkfiles/vs/crt_secure_no_deprecate.props @@ -0,0 +1,11 @@ + + + + <_ProjectFileVersion>10.0.21006.1 + + + + _CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + + + \ No newline at end of file diff --git a/Mkfiles/vs/crt_secure_no_deprecate.vsprops b/Mkfiles/vs/crt_secure_no_deprecate.vsprops new file mode 100644 index 00000000..56ab506f --- /dev/null +++ b/Mkfiles/vs/crt_secure_no_deprecate.vsprops @@ -0,0 +1,11 @@ + + + + diff --git a/Mkfiles/vs/genmacro/genmacro.vcxproj b/Mkfiles/vs/genmacro/genmacro.vcxproj new file mode 100644 index 00000000..244a7608 --- /dev/null +++ b/Mkfiles/vs/genmacro/genmacro.vcxproj @@ -0,0 +1,203 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {225700A5-07B8-434E-AD61-555278BF6733} + genmacro + Win32Proj + 10.0 + + + + Application + MultiByte + v142 + + + Application + MultiByte + v142 + + + Application + MultiByte + v142 + + + Application + MultiByte + v142 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + + + + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genmacro.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + + + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genmacro.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + + + run.bat "$(TargetPath)" + + + + + Full + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + Default + + + $(OutDir)genmacro.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + + + Full + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + Default + + + $(OutDir)genmacro.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + + + run.bat "$(TargetPath)" + + + + + + + + + + + {b545983b-8ee0-4a7b-a67a-e749eeae62a2} + false + + + + + + \ No newline at end of file diff --git a/Mkfiles/vs/genmacro/genmacro.vcxproj.filters b/Mkfiles/vs/genmacro/genmacro.vcxproj.filters new file mode 100644 index 00000000..402cf1b4 --- /dev/null +++ b/Mkfiles/vs/genmacro/genmacro.vcxproj.filters @@ -0,0 +1,17 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Source Files + + + + + + \ No newline at end of file diff --git a/Mkfiles/vs/genmacro/run.bat b/Mkfiles/vs/genmacro/run.bat new file mode 100644 index 00000000..98c337ac --- /dev/null +++ b/Mkfiles/vs/genmacro/run.bat @@ -0,0 +1,5 @@ +cd ..\..\.. +%1 nasm-version.c nasm_version_mac version.mac +%1 nasm-macros.c nasm_standard_mac modules\parsers\nasm\nasm-std.mac +%1 win64-nasm.c win64_nasm_stdmac modules\objfmts\coff\win64-nasm.mac +%1 win64-gas.c win64_gas_stdmac modules\objfmts\coff\win64-gas.mac diff --git a/Mkfiles/vs/genmodule/genmodule.vcxproj b/Mkfiles/vs/genmodule/genmodule.vcxproj new file mode 100644 index 00000000..f76065ae --- /dev/null +++ b/Mkfiles/vs/genmodule/genmodule.vcxproj @@ -0,0 +1,208 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0} + genmodule + Win32Proj + 10.0 + + + + Application + MultiByte + v142 + + + Application + MultiByte + v142 + + + Application + MultiByte + v142 + + + Application + MultiByte + v142 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + + + + Disabled + %(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;FILTERMODE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genmodule.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + + + Disabled + %(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;FILTERMODE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genmodule.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + + + run.bat "$(TargetPath)" + + + + + Full + %(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;FILTERMODE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + $(IntDir) + Level3 + Default + + + $(OutDir)genmodule.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + + + Full + %(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;FILTERMODE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + $(IntDir) + Level3 + Default + + + $(OutDir)genmodule.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + + + run.bat "$(TargetPath)" + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vs/genmodule/genmodule.vcxproj.filters b/Mkfiles/vs/genmodule/genmodule.vcxproj.filters new file mode 100644 index 00000000..d3255c29 --- /dev/null +++ b/Mkfiles/vs/genmodule/genmodule.vcxproj.filters @@ -0,0 +1,20 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Source Files + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vs/genmodule/run.bat b/Mkfiles/vs/genmodule/run.bat new file mode 100644 index 00000000..00055692 --- /dev/null +++ b/Mkfiles/vs/genmodule/run.bat @@ -0,0 +1,3 @@ +@echo off +cd ..\..\.. +%1 libyasm\module.in Makefile.am diff --git a/Mkfiles/vs/genperf/genperf.vcxproj b/Mkfiles/vs/genperf/genperf.vcxproj new file mode 100644 index 00000000..c03986a4 --- /dev/null +++ b/Mkfiles/vs/genperf/genperf.vcxproj @@ -0,0 +1,262 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619} + genperf + Win32Proj + 10.0 + + + + Application + MultiByte + v142 + + + Application + MultiByte + v142 + + + Application + MultiByte + v142 + + + Application + MultiByte + v142 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + false + false + false + false + + + + + + + + Disabled + ..;../../..;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;STDC_HEADERS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genperf.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX86 + + + + + + + run.bat "$(TargetPath)" + + + x86insn_nasm.c;x86insn_gas.c;x86cpu.c;x86regtmod.c;%(Outputs) + + + run.bat "$(TargetPath)" + + + + + Disabled + ..;../../..;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;STDC_HEADERS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genperf.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + + + + + + + run.bat "$(TargetPath)" + + + x86insn_nasm.c;x86insn_gas.c;x86cpu.c;x86regtmod.c;%(Outputs) + + + run.bat "$(TargetPath)" + + + + + Full + ..;../../..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;STDC_HEADERS;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + Default + + + $(OutDir)genperf.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + MachineX86 + + + + + + + run.bat "$(TargetPath)" + + + x86insn_nasm.c;x86insn_gas.c;x86cpu.c;x86regtmod.c;%(Outputs) + + + run.bat "$(TargetPath)" + + + + + Full + ..;../../..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;STDC_HEADERS;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + Default + + + $(OutDir)genperf.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + + + + + + + run.bat "$(TargetPath)" + + + x86insn_nasm.c;x86insn_gas.c;x86cpu.c;x86regtmod.c;%(Outputs) + + + run.bat "$(TargetPath)" + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vs/genperf/genperf.vcxproj.filters b/Mkfiles/vs/genperf/genperf.vcxproj.filters new file mode 100644 index 00000000..3124b5d7 --- /dev/null +++ b/Mkfiles/vs/genperf/genperf.vcxproj.filters @@ -0,0 +1,56 @@ + + + + + {3C1E9AA8-6338-4CED-99F1-BEBA80607BD5} + h;hpp;hxx;hm;inl;inc;xsd + + + {1062695D-1C50-4068-8313-73A409885BC1} + cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + + \ No newline at end of file diff --git a/Mkfiles/vs/genperf/run.bat b/Mkfiles/vs/genperf/run.bat new file mode 100644 index 00000000..c6f83543 --- /dev/null +++ b/Mkfiles/vs/genperf/run.bat @@ -0,0 +1,40 @@ +cd ..\..\.. +@echo off + +for /f "usebackq tokens=1*" %%f in (`reg query HKCR\Applications\python.exe\shell\open\command 2^>NUL`) do (set _my_=%%f %%g) +goto try1%errorlevel% + +:try10 +goto ok + +:try11 +for /f "usebackq tokens=1*" %%f in (`reg query HKCR\Python.File\shell\open\command 2^>NUL`) do (set _my_=%%f %%g) +goto try2%errorlevel% + +:try20: +goto ok + +:try21: +echo Building without Python ... +goto therest + +:ok +echo Building with Python ... +set _res_=%_my_:*REG_SZ=% +set _end_=%_res_:*exe"=% +call set _python_=%%_res_:%_end_%=%% +echo %_python_% +call %_python_% modules\arch\x86\gen_x86_insn.py + +:therest +@echo on +call :update %1 x86insn_nasm.gperf x86insn_nasm.c +call :update %1 x86insn_gas.gperf x86insn_gas.c +call :update %1 modules\arch\x86\x86cpu.gperf x86cpu.c +call :update %1 modules\arch\x86\x86regtmod.gperf x86regtmod.c +goto :eof + +:update +%1 %2 tf +call mkfiles\vc14\out_copy_rename tf .\ %3 +del tf diff --git a/Mkfiles/vs/genstring/genstring.vcxproj b/Mkfiles/vs/genstring/genstring.vcxproj new file mode 100644 index 00000000..435ec6f1 --- /dev/null +++ b/Mkfiles/vs/genstring/genstring.vcxproj @@ -0,0 +1,197 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {021CEB0A-F721-4F59-B349-9CEEAF244459} + genstring + Win32Proj + 10.0 + + + + Application + MultiByte + v142 + + + Application + MultiByte + v142 + + + Application + MultiByte + v142 + + + Application + MultiByte + v142 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + + + + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genstring.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + + + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genstring.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + + + run.bat "$(TargetPath)" + + + + + Full + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + Default + + + $(OutDir)genstring.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + + + Full + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + Default + + + $(OutDir)genstring.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + + + run.bat "$(TargetPath)" + + + + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vs/genstring/genstring.vcxproj.filters b/Mkfiles/vs/genstring/genstring.vcxproj.filters new file mode 100644 index 00000000..04ed411d --- /dev/null +++ b/Mkfiles/vs/genstring/genstring.vcxproj.filters @@ -0,0 +1,17 @@ + + + + + {28EBE11C-5BE8-4935-9381-F57696749E0C} + cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Source Files + + + + + + \ No newline at end of file diff --git a/Mkfiles/vs/genstring/run.bat b/Mkfiles/vs/genstring/run.bat new file mode 100644 index 00000000..baedcecb --- /dev/null +++ b/Mkfiles/vs/genstring/run.bat @@ -0,0 +1,2 @@ +cd ..\..\.. +%1 license_msg license.c COPYING diff --git a/Mkfiles/vs/genversion/genversion.vcxproj b/Mkfiles/vs/genversion/genversion.vcxproj new file mode 100644 index 00000000..e0f26a82 --- /dev/null +++ b/Mkfiles/vs/genversion/genversion.vcxproj @@ -0,0 +1,224 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2} + genversion + Win32Proj + 10.0 + + + + Application + MultiByte + v142 + + + Application + MultiByte + v142 + + + Application + MultiByte + v142 + + + Application + MultiByte + v142 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + + + + Disabled + ..\..\vc10;..\..\..\;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genversion.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + cd ..\..\..\ +YASM-VERSION-GEN.bat + + + + + + Disabled + ..\..\vc10;..\..\..\;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genversion.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + + + run.bat "$(TargetPath)" + + + cd ..\..\..\ +YASM-VERSION-GEN.bat + + + + + + Full + ..\..\vc10;..\..\..\;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + Default + + + $(OutDir)genversion.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + cd ..\..\..\ +YASM-VERSION-GEN.bat + + + + + + Full + ..\..\vc10;..\..\..\;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + Default + + + $(OutDir)genversion.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + + + run.bat "$(TargetPath)" + + + cd ..\..\..\ +YASM-VERSION-GEN.bat + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vs/genversion/genversion.vcxproj.filters b/Mkfiles/vs/genversion/genversion.vcxproj.filters new file mode 100644 index 00000000..cc088b12 --- /dev/null +++ b/Mkfiles/vs/genversion/genversion.vcxproj.filters @@ -0,0 +1,26 @@ + + + + + {2acbec3a-0ed8-4b2e-826e-a84c7d35f205} + h;hpp;hxx;hm;inl + + + {E67ED277-E4F2-4D79-8C9E-962BAC164F3F} + cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Source Files + + + + + Header Files + + + + + + \ No newline at end of file diff --git a/Mkfiles/vs/genversion/run.bat b/Mkfiles/vs/genversion/run.bat new file mode 100644 index 00000000..41b19cad --- /dev/null +++ b/Mkfiles/vs/genversion/run.bat @@ -0,0 +1,2 @@ +cd ..\..\.. +%1 version.mac diff --git a/Mkfiles/vs/genversion/runpre.bat b/Mkfiles/vs/genversion/runpre.bat new file mode 100644 index 00000000..fdd15708 --- /dev/null +++ b/Mkfiles/vs/genversion/runpre.bat @@ -0,0 +1,2 @@ +cd ..\..\.. +YASM-VERSION-GEN.bat diff --git a/Mkfiles/vs/libyasm/libyasm.vcxproj b/Mkfiles/vs/libyasm/libyasm.vcxproj new file mode 100644 index 00000000..c5237d1a --- /dev/null +++ b/Mkfiles/vs/libyasm/libyasm.vcxproj @@ -0,0 +1,278 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {29FE7874-1256-4AD6-B889-68E399DC9608} + libyasm + 10.0 + + + + StaticLibrary + false + MultiByte + v142 + + + StaticLibrary + false + MultiByte + v142 + + + StaticLibrary + false + MultiByte + v142 + + + StaticLibrary + false + MultiByte + v142 + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + + + + Full + Default + ..;../../..;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)libyasm.lib + true + + + + + X64 + + + Full + Default + ..;../../..;%(AdditionalIncludeDirectories) + NDEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)libyasm.lib + true + + + + + Disabled + ..;../../..;%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)libyasm.lib + true + + + + + X64 + + + Disabled + ..;../../..;%(AdditionalIncludeDirectories) + _DEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)libyasm.lib + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {f0e8b707-00c5-4ff2-b8ef-7c39817132a0} + false + + + + + + \ No newline at end of file diff --git a/Mkfiles/vs/libyasm/libyasm.vcxproj.filters b/Mkfiles/vs/libyasm/libyasm.vcxproj.filters new file mode 100644 index 00000000..9bdf13a4 --- /dev/null +++ b/Mkfiles/vs/libyasm/libyasm.vcxproj.filters @@ -0,0 +1,200 @@ + + + + + {4ca3b698-9d01-4e4e-ae00-5c98da045efe} + h;hpp;hxx;hm;inl + + + {68607062-982d-4251-9a1a-30f76474983d} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Source Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + + \ No newline at end of file diff --git a/Mkfiles/vs/modules/modules.vcxproj b/Mkfiles/vs/modules/modules.vcxproj new file mode 100644 index 00000000..f50de3bb --- /dev/null +++ b/Mkfiles/vs/modules/modules.vcxproj @@ -0,0 +1,325 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6} + modules + 10.0 + + + + StaticLibrary + false + MultiByte + v142 + + + StaticLibrary + false + MultiByte + v142 + + + StaticLibrary + false + MultiByte + v142 + + + StaticLibrary + false + MultiByte + v142 + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + + + + Full + Default + ..;../../..;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)modules.lib + true + + + + + + + + + X64 + + + Full + Default + ..;../../..;%(AdditionalIncludeDirectories) + NDEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)modules.lib + true + + + + + Disabled + ..;../../..;%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)modules.lib + true + + + + + X64 + + + Disabled + ..;../../..;%(AdditionalIncludeDirectories) + _DEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)modules.lib + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {225700a5-07b8-434e-ad61-555278bf6733} + false + + + {c45a8b59-8b59-4d5d-a8e8-fb090f8dd619} + false + + + {29fe7874-1256-4ad6-b889-68e399dc9608} + false + + + {3c58be13-50a3-4583-984d-d8902b3d7713} + false + + + + + + \ No newline at end of file diff --git a/Mkfiles/vs/modules/modules.vcxproj.filters b/Mkfiles/vs/modules/modules.vcxproj.filters new file mode 100644 index 00000000..e6ff3add --- /dev/null +++ b/Mkfiles/vs/modules/modules.vcxproj.filters @@ -0,0 +1,256 @@ + + + + + {39c89f91-d860-4396-a49f-86b8b7a51c33} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {be0cdf28-cbed-4774-b3cc-b63e4e3fa0a9} + + + {491cc60a-889b-4f53-aae9-f4d7d6aa667a} + + + {c084015d-3c3e-4379-8746-ae5cffcec79e} + + + {3333e0b3-e95f-44f6-9000-58d4da368360} + + + {528f2955-ceba-4691-a36c-054f119e3dcc} + + + {81686d52-eb71-4d4a-a830-66c45afb808f} + + + {98fe1e43-3794-4639-bf29-14b0c569754f} + + + {6b3956d4-0bff-4e8e-af61-a7e59b476fa4} + + + {446fad62-ac17-49e9-8263-33481f04f182} + + + {33fb7fc8-61f9-428d-9c94-7a4912fbb678} + + + {48fc77ec-7d78-4c0a-bfc2-9aa76faf5d7f} + + + + + Source Files\parsers + + + Source Files\arch + + + Source Files\arch + + + Source Files\arch + + + Source Files\arch + + + Source Files\arch + + + Source Files\arch + + + Source Files\arch + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\listfmts\nasm + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\parsers + + + Source Files\parsers + + + Source Files\parsers + + + Source Files\parsers + + + Source Files\parsers + + + Source Files\preprocs\cpp + + + Source Files\preprocs\gas + + + Source Files\preprocs\gas + + + Source Files\preprocs\nasm + + + Source Files\preprocs\nasm + + + Source Files\preprocs\nasm + + + Source Files\preprocs\nasm + + + Source Files\preprocs\raw + + + Source Files\parsers + + + Source Files\arch + + + Source Files\arch + + + Source Files\objfmts + + + + + Source Files\arch + + + Source Files\arch + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\parsers + + + Source Files\parsers + + + Source Files\preprocs\gas + + + Source Files\preprocs\nasm + + + Source Files\preprocs\nasm + + + Source Files\preprocs\nasm + + + Source Files\preprocs\nasm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vs/out_copy_rename.bat b/Mkfiles/vs/out_copy_rename.bat new file mode 100644 index 00000000..3179b59a --- /dev/null +++ b/Mkfiles/vs/out_copy_rename.bat @@ -0,0 +1,42 @@ +@echo off +if not exist %1 goto nofile +if exist %2 goto copy + +echo creating directory %2 +md %2 > nul + +:copy +set str=%2 +for /f "useback tokens=*" %%a in ('%str%') do set str=%%~a +set str=%str:~-1% +if %str% == "\" goto hasbackslash + +if not exist %2\%3 goto cpy +fc %1 %2\%3 > nul && if not %errorlevel 1 goto exit +echo overwriting %2\%3 with %1 +copy %1 %2\%3 > nul +goto exit + +:cpy +echo copying %1 to %2\%3 +copy %1 %2\%3 > nul +goto exit + +:hasbackslash +if not exist %2%3 goto cpy2 +fc %1 %2%3 > nul && if not %errorlevel 1 goto exit +echo overwriting %2%3 with %1 +copy %1 %2%3 > nul +goto exit + +:cpy2 +echo copying %1 to %2%3 +copy %1 %2%3 > nul +goto exit + +:nofile +echo %1 not found + +:exit + + diff --git a/Mkfiles/vs/re2c/re2c.vcxproj b/Mkfiles/vs/re2c/re2c.vcxproj new file mode 100644 index 00000000..eb5639ef --- /dev/null +++ b/Mkfiles/vs/re2c/re2c.vcxproj @@ -0,0 +1,222 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {3C58BE13-50A3-4583-984D-D8902B3D7713} + re2c + Win32Proj + 10.0 + + + + Application + MultiByte + v142 + + + Application + MultiByte + v142 + + + Application + MultiByte + v142 + + + Application + MultiByte + v142 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + + + + Disabled + ..;../../..;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + Default + ProgramDatabase + + + $(OutDir)re2c.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + + + Disabled + ..;../../..;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + Default + ProgramDatabase + + + $(OutDir)re2c.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + + + run.bat "$(TargetPath)" + + + + + Full + ..;../../..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + Default + + + $(OutDir)re2c.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + + + Full + ..;../../..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + Default + + + $(OutDir)re2c.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + + + run.bat "$(TargetPath)" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vs/re2c/re2c.vcxproj.filters b/Mkfiles/vs/re2c/re2c.vcxproj.filters new file mode 100644 index 00000000..da0f935c --- /dev/null +++ b/Mkfiles/vs/re2c/re2c.vcxproj.filters @@ -0,0 +1,80 @@ + + + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + + \ No newline at end of file diff --git a/Mkfiles/vs/re2c/run.bat b/Mkfiles/vs/re2c/run.bat new file mode 100644 index 00000000..6ac571f0 --- /dev/null +++ b/Mkfiles/vs/re2c/run.bat @@ -0,0 +1,4 @@ +cd ..\..\..\ +%1 -s -o lc3bid.c modules\arch\lc3b\lc3bid.re +%1 -b -o nasm-token.c modules\parsers\nasm\nasm-token.re +%1 -b -o gas-token.c modules\parsers\gas\gas-token.re diff --git a/Mkfiles/vs/readme.vs.txt b/Mkfiles/vs/readme.vs.txt new file mode 100644 index 00000000..21c70be9 --- /dev/null +++ b/Mkfiles/vs/readme.vs.txt @@ -0,0 +1,96 @@ +Building YASM with Microsoft Visual Studio +------------------------------------------ + +This note describes how to build YASM using Microsoft Visual +Studio 2019 and later versions. + +1. YASM Download +---------------- + +First YASM needs to be downloaded and the files placed within +a suitable directory, which will be called here but can +be named and located as you wish. + +2. Building YASM +---------------- + +Now locate and double click on the yasm.sln solution file in +the 'Mkfiles/vs' subdirectory to open the build project in +the Visual Studio IDE and then select: + + win32 or x64 build + release or debug build + +as appropriate to build the YASM binaries that you need. + +4. Using YASM with Visual Sudio +------------------------------- + +The YASM version vsyasm.exe is designed specifically for use +with the 2010 and later versions of Visual Studio. To tell +Visual Studio where to find vsyasm.exe, the environment +variable YASMPATH can be set to the absolute path of the +directory in which vsyasm.exe is located (this path should +include the final backslash). + +Alternatively you can find the directory (or directories) +where the VC++ compiler binaries are located and put copies +of the vsyasm.exe binary in these directories. + +Depending on your system you can use either the win32 or the +x64 version of vsyasm.exe, which must be named vsyasm.exe. + +To use the custom tools facility in Visual Studio you need to +place a copy of three files - yasm.props, yasm.targets and +yasm.xml - into a location where they can be found by the +Visual Studio build customisation processes. There are several +ways to do this: + + a. put these files in the MSBUILD customisation directory + + b. put them in a convenient location and set this path in the + 'Build Customisations Search Path' in the Visual Studio + 'Projects and Solutions|VC++ Project Settings' item in + the 'Tools|Options' menu; + + c. put them in a convenient location and set this path in the + 'Build Customisation dialogue (discussed later). + +To use YASM in a project, right click on the project in the Solution +Explorer and select 'Build Customisations..'. This will give you a +dialog box that allows you to select YASM as an assembler (note that +your assembler files need to have the extension '.asm'). If you have +used option c. above, you will need to let the dialogue find them +using the 'Find Existing' button below the dialogue. + +To assemble a file with YASM, select the Property Page for the file +and the select 'Yasm Assembler' in the Tool dialog entry. Then click +'Apply' and an additional property page entry will appear and enable +YASM settings to be established. + +5. A Linker Issue +----------------- + +There appears to be a linker bug in the VC++ linker that prevents +symbols with absolute addresses being linked in DLL builds. This +means, for example, that LEA instructions of the general form: + + lea, rax,[rax+symbol] + +cannot be used for DLL builds. The following general form +has to be used instead: + + lea rcx,[symbol wrt rip] + lea rax,[rax+rcx] + +This limitation may also cause problems with other instruction +that use absolute addresses. + +6. Acknowledgements +------------------- + +I am most grateful for the fantastic support that Peter Johnson, +YASM's creator, has given me in tracking down issues in using +YASM for the production of Windows x64 code. + + Brian Gladman, 16th May 2019 diff --git a/Mkfiles/vs/vsyasm.props b/Mkfiles/vs/vsyasm.props new file mode 100644 index 00000000..8e2269b6 --- /dev/null +++ b/Mkfiles/vs/vsyasm.props @@ -0,0 +1,27 @@ + + + + Midl + CustomBuild + + + _SelectedFiles;$(YASMDependsOn) + + + C:\Program Files\yasm\ + + + + False + $(IntDir)%(FileName).obj + 0 + 0 + "$(YASM_PATH)"vsyasm.exe -Xvc -f $(Platform) [AllOptions] [AdditionalOptions] [Inputs] + %(ObjectFile) + Assembling %(Filename)%(Extension) ==> $(IntDir)%(FileName).obj + false + + + diff --git a/Mkfiles/vs/vsyasm.targets b/Mkfiles/vs/vsyasm.targets new file mode 100644 index 00000000..8f38f2cb --- /dev/null +++ b/Mkfiles/vs/vsyasm.targets @@ -0,0 +1,110 @@ + + + + + + + _YASM + + + + + + $(ComputeLinkInputsTargets); + ComputeYASMOutput; + + + $(ComputeLibInputsTargets); + ComputeYASMOutput; + + + + + $(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml + + + + + + <_YASMReadTlog + Include="^%(YASM.FullPath);%(YASM.AdditionalDependencies)" + Condition="'%(YASM.ExcludedFromBuild)' != 'true' and '%(YASM.ObjectFile)' != ''"/> + <_YASMWriteTlog + Include="^%(YASM.FullPath);$([MSBuild]::NormalizePath('$(MSBuildProjectDirectory)', '%(YASM.ObjectFile)'))" + Condition="'%(YASM.ExcludedFromBuild)' != 'true' and '%(YASM.ObjectFile)' != ''"/> + + + + + + + + <_YASMReadTlog Remove="@(_YASMReadTlog)" /> + <_YASMWriteTlog Remove="@(_YASMWriteTlog)" /> + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vs/vsyasm.vcxproj b/Mkfiles/vs/vsyasm.vcxproj new file mode 100644 index 00000000..8c4c3920 --- /dev/null +++ b/Mkfiles/vs/vsyasm.vcxproj @@ -0,0 +1,280 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {7FDD85BB-CC86-442B-A425-989B5B296ED5} + vsyasm + 10.0 + + + + Application + false + MultiByte + v142 + + + Application + false + MultiByte + v142 + + + Application + false + MultiByte + v142 + + + Application + false + MultiByte + v142 + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + + + + $(Platform)\$(Configuration)/yasm.tlb + + + + + Disabled + .;../..;%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)vsyasm.exe + true + true + $(OutDir)$(ProjectName).pdb + Console + false + + + MachineX86 + + + + + X64 + $(Platform)\$(Configuration)/yasm.tlb + + + + + Disabled + .;../..;%(AdditionalIncludeDirectories) + _DEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)vsyasm.exe + true + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX64 + + + + + $(Platform)\$(Configuration)/yasm.tlb + + + + + Full + Default + true + .;../..;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)vsyasm.exe + true + true + $(OutDir)$(ProjectName).pdb + Console + false + + + MachineX86 + + + + + X64 + $(Platform)\$(Configuration)/yasm.tlb + + + + + Full + OnlyExplicitInline + .;../..;%(AdditionalIncludeDirectories) + NDEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)vsyasm.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX64 + true + + + + + + + + + {29fe7874-1256-4ad6-b889-68e399dc9608} + false + + + {d715a3d4-efaa-442e-ad8b-5b4ff64e1dd6} + false + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vs/vsyasm.xml b/Mkfiles/vs/vsyasm.xml new file mode 100644 index 00000000..a108f005 --- /dev/null +++ b/Mkfiles/vs/vsyasm.xml @@ -0,0 +1,283 @@ + + + + + + + + + + + + + General + + + + + + Symbols + + + + + + Files + + + + + + Command Line + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Execute Before + + + Specifies the targets for the build customization to run before. + + + + + + + + + + + + Execute After + + + Specifies the targets for the build customization to run after. + + + + + + + + + + + + + + + + + + Additional Options + + + Additional Options + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vs/yasm.sln b/Mkfiles/vs/yasm.sln new file mode 100644 index 00000000..5d2dc952 --- /dev/null +++ b/Mkfiles/vs/yasm.sln @@ -0,0 +1,142 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.22823.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{825AC694-358C-4D8D-92DE-33A2691978CE}" + ProjectSection(SolutionItems) = preProject + crt_secure_no_deprecate.vsprops = crt_secure_no_deprecate.vsprops + readme.vc14.txt = readme.vc14.txt + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libyasm", "libyasm\libyasm.vcxproj", "{29FE7874-1256-4AD6-B889-68E399DC9608}" + ProjectSection(ProjectDependencies) = postProject + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2} = {B545983B-8EE0-4A7B-A67A-E749EEAE62A2} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "modules", "modules\modules.vcxproj", "{D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yasm", "yasm.vcxproj", "{34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genmacro", "genmacro\genmacro.vcxproj", "{225700A5-07B8-434E-AD61-555278BF6733}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genversion", "genversion\genversion.vcxproj", "{B545983B-8EE0-4A7B-A67A-E749EEAE62A2}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "re2c", "re2c\re2c.vcxproj", "{3C58BE13-50A3-4583-984D-D8902B3D7713}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genperf", "genperf\genperf.vcxproj", "{C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genmodule", "genmodule\genmodule.vcxproj", "{F0E8B707-00C5-4FF2-B8EF-7C39817132A0}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genstring", "genstring\genstring.vcxproj", "{021CEB0A-F721-4F59-B349-9CEEAF244459}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ytasm", "ytasm.vcxproj", "{2162937B-0DBD-4450-B45F-DF578D8E7508}" + ProjectSection(ProjectDependencies) = postProject + {021CEB0A-F721-4F59-B349-9CEEAF244459} = {021CEB0A-F721-4F59-B349-9CEEAF244459} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vsyasm", "vsyasm.vcxproj", "{7FDD85BB-CC86-442B-A425-989B5B296ED5}" + ProjectSection(ProjectDependencies) = postProject + {021CEB0A-F721-4F59-B349-9CEEAF244459} = {021CEB0A-F721-4F59-B349-9CEEAF244459} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|Win32.ActiveCfg = Debug|Win32 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|Win32.Build.0 = Debug|Win32 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|x64.ActiveCfg = Debug|x64 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|x64.Build.0 = Debug|x64 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|Win32.ActiveCfg = Release|Win32 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|Win32.Build.0 = Release|Win32 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|x64.ActiveCfg = Release|x64 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|x64.Build.0 = Release|x64 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|Win32.ActiveCfg = Debug|Win32 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|Win32.Build.0 = Debug|Win32 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|x64.ActiveCfg = Debug|x64 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|x64.Build.0 = Debug|x64 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|Win32.ActiveCfg = Release|Win32 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|Win32.Build.0 = Release|Win32 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|x64.ActiveCfg = Release|x64 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|x64.Build.0 = Release|x64 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|Win32.ActiveCfg = Debug|Win32 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|Win32.Build.0 = Debug|Win32 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|x64.ActiveCfg = Debug|x64 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|x64.Build.0 = Debug|x64 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|Win32.ActiveCfg = Release|Win32 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|Win32.Build.0 = Release|Win32 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|x64.ActiveCfg = Release|x64 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|x64.Build.0 = Release|x64 + {225700A5-07B8-434E-AD61-555278BF6733}.Debug|Win32.ActiveCfg = Debug|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Debug|Win32.Build.0 = Debug|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Debug|x64.ActiveCfg = Debug|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Debug|x64.Build.0 = Debug|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Release|Win32.ActiveCfg = Release|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Release|Win32.Build.0 = Release|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Release|x64.ActiveCfg = Release|x64 + {225700A5-07B8-434E-AD61-555278BF6733}.Release|x64.Build.0 = Release|x64 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|Win32.ActiveCfg = Debug|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|Win32.Build.0 = Debug|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|x64.ActiveCfg = Debug|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|x64.Build.0 = Debug|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|Win32.ActiveCfg = Release|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|Win32.Build.0 = Release|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|x64.ActiveCfg = Release|x64 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|x64.Build.0 = Release|x64 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|Win32.ActiveCfg = Debug|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|Win32.Build.0 = Debug|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|x64.ActiveCfg = Debug|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|x64.Build.0 = Debug|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|Win32.ActiveCfg = Release|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|Win32.Build.0 = Release|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|x64.ActiveCfg = Release|x64 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|x64.Build.0 = Release|x64 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|Win32.ActiveCfg = Debug|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|Win32.Build.0 = Debug|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|x64.ActiveCfg = Debug|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|x64.Build.0 = Debug|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|Win32.ActiveCfg = Release|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|Win32.Build.0 = Release|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|x64.ActiveCfg = Release|x64 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|x64.Build.0 = Release|x64 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|Win32.ActiveCfg = Debug|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|Win32.Build.0 = Debug|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|x64.ActiveCfg = Debug|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|x64.Build.0 = Debug|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|Win32.ActiveCfg = Release|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|Win32.Build.0 = Release|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|x64.ActiveCfg = Release|x64 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|x64.Build.0 = Release|x64 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|Win32.ActiveCfg = Debug|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|Win32.Build.0 = Debug|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|x64.ActiveCfg = Debug|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|x64.Build.0 = Debug|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|Win32.ActiveCfg = Release|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|Win32.Build.0 = Release|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|x64.ActiveCfg = Release|x64 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|x64.Build.0 = Release|x64 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|Win32.ActiveCfg = Debug|Win32 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|Win32.Build.0 = Debug|Win32 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|x64.ActiveCfg = Debug|x64 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|x64.Build.0 = Debug|x64 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|Win32.ActiveCfg = Release|Win32 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|Win32.Build.0 = Release|Win32 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|x64.ActiveCfg = Release|x64 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|x64.Build.0 = Release|x64 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|Win32.ActiveCfg = Debug|Win32 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|Win32.Build.0 = Debug|Win32 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|x64.ActiveCfg = Debug|x64 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|x64.Build.0 = Debug|x64 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|Win32.ActiveCfg = Release|Win32 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|Win32.Build.0 = Release|Win32 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|x64.ActiveCfg = Release|x64 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Mkfiles/vs/yasm.vcxproj b/Mkfiles/vs/yasm.vcxproj new file mode 100644 index 00000000..3e3d0421 --- /dev/null +++ b/Mkfiles/vs/yasm.vcxproj @@ -0,0 +1,284 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5} + yasm + 10.0 + + + + Application + false + MultiByte + v142 + + + Application + false + MultiByte + v142 + + + Application + false + MultiByte + v142 + + + Application + false + MultiByte + v142 + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + + + + $(Platform)\$(Configuration)/yasm.tlb + + + + + Disabled + .;../..;%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)yasm.exe + true + true + $(OutDir)$(ProjectName).pdb + Console + false + + + MachineX86 + + + + + X64 + $(Platform)\$(Configuration)/yasm.tlb + + + + + Disabled + .;../..;%(AdditionalIncludeDirectories) + _DEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)yasm.exe + true + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX64 + + + + + $(Platform)\$(Configuration)/yasm.tlb + + + + + Full + Default + true + .;../..;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)yasm.exe + true + true + $(OutDir)$(ProjectName).pdb + Console + false + + + MachineX86 + + + + + X64 + $(Platform)\$(Configuration)/yasm.tlb + + + + + Full + OnlyExplicitInline + .;../..;%(AdditionalIncludeDirectories) + NDEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)yasm.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX64 + true + + + + + + + + + + + + + + + + + {021ceb0a-f721-4f59-b349-9ceeaf244459} + false + + + {29fe7874-1256-4ad6-b889-68e399dc9608} + false + + + {d715a3d4-efaa-442e-ad8b-5b4ff64e1dd6} + false + + + + + + \ No newline at end of file diff --git a/Mkfiles/vs/yasm.vcxproj.filters b/Mkfiles/vs/yasm.vcxproj.filters new file mode 100644 index 00000000..04941c22 --- /dev/null +++ b/Mkfiles/vs/yasm.vcxproj.filters @@ -0,0 +1,41 @@ + + + + + {51f0d88e-1373-4bf8-a72e-c79706d37f8b} + h;hpp;hxx;hm;inl + + + {db67b411-6f59-462c-9c20-75024c6b3912} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + \ No newline at end of file diff --git a/Mkfiles/vs/ytasm.vcxproj b/Mkfiles/vs/ytasm.vcxproj new file mode 100644 index 00000000..38e35ae3 --- /dev/null +++ b/Mkfiles/vs/ytasm.vcxproj @@ -0,0 +1,279 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {2162937B-0DBD-4450-B45F-DF578D8E7508} + ytasm + 10.0 + + + + Application + false + MultiByte + v142 + + + Application + false + MultiByte + v142 + + + Application + false + MultiByte + v142 + + + Application + false + MultiByte + v142 + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + + + + $(Platform)\$(Configuration)/yasm.tlb + + + + + Disabled + .;../..;%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)ytasm.exe + true + true + $(OutDir)$(ProjectName).pdb + Console + false + + + MachineX86 + + + + + X64 + $(Platform)\$(Configuration)/yasm.tlb + + + + + Disabled + .;../..;%(AdditionalIncludeDirectories) + _DEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)ytasm.exe + true + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX64 + + + + + $(Platform)\$(Configuration)/yasm.tlb + + + + + Full + Default + true + .;../..;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)ytasm.exe + true + true + $(OutDir)$(ProjectName).pdb + Console + false + + + MachineX86 + + + + + X64 + $(Platform)\$(Configuration)/yasm.tlb + + + + + Full + OnlyExplicitInline + .;../..;%(AdditionalIncludeDirectories) + NDEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)ytasm.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX64 + true + + + + + + + + + + + + + + + + {29fe7874-1256-4ad6-b889-68e399dc9608} + false + + + {d715a3d4-efaa-442e-ad8b-5b4ff64e1dd6} + false + + + + + + \ No newline at end of file From ea8f2393611025c5d32ddfe022dddff5a1a5c989 Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Sat, 12 Oct 2019 15:02:44 +0100 Subject: [PATCH 520/585] Allow user to set the YASM path with or without an ending backslash in Visual Studio integration --- Mkfiles/vs/vsyasm.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mkfiles/vs/vsyasm.props b/Mkfiles/vs/vsyasm.props index 8e2269b6..9d5c14fa 100644 --- a/Mkfiles/vs/vsyasm.props +++ b/Mkfiles/vs/vsyasm.props @@ -18,7 +18,7 @@ $(IntDir)%(FileName).obj 0 0 - "$(YASM_PATH)"vsyasm.exe -Xvc -f $(Platform) [AllOptions] [AdditionalOptions] [Inputs] + "$(YASM_PATH.TrimEnd('\'))"\vsyasm.exe -Xvc -f $(Platform) [AllOptions] [AdditionalOptions] [Inputs] %(ObjectFile) Assembling %(Filename)%(Extension) ==> $(IntDir)%(FileName).obj false From 976d2e093485b2d1d9d48a4905f8d4b842853b08 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Mon, 4 May 2020 09:35:04 +0300 Subject: [PATCH 521/585] Fix info.stab / info.stabstr typo in stabs-dbgfmt.c (#96) --- modules/dbgfmts/stabs/stabs-dbgfmt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/dbgfmts/stabs/stabs-dbgfmt.c b/modules/dbgfmts/stabs/stabs-dbgfmt.c index 5c0cba6a..64896cab 100644 --- a/modules/dbgfmts/stabs/stabs-dbgfmt.c +++ b/modules/dbgfmts/stabs/stabs-dbgfmt.c @@ -355,7 +355,7 @@ stabs_dbgfmt_generate(yasm_object *object, yasm_linemap *linemap, yasm_error_set(YASM_ERROR_GENERAL, N_("stabs debugging conflicts with user-defined section .stabstr")); yasm_errwarn_propagate(errwarns, - yasm_section_bcs_first(info.stab)->line); + yasm_section_bcs_first(info.stabstr)->line); } else { yasm_warn_set(YASM_WARN_GENERAL, N_("stabs debugging overrides empty section .stabstr")); From bd283fe52305f9afc4fe1f41fb7c06f1634ef4bd Mon Sep 17 00:00:00 2001 From: Denis Denisov Date: Mon, 4 May 2020 09:36:45 +0300 Subject: [PATCH 522/585] Revert optimizations added in #68 (#146) --- libyasm/coretype.h | 1 - libyasm/expr.c | 134 +---------- libyasm/section.c | 7 - libyasm/section.h | 10 - libyasm/value.c | 11 - modules/objfmts/bin/bin-objfmt.c | 208 ++---------------- .../objfmts/bin/tests/multisect/bin-align.map | 4 - .../bin/tests/multisect/ldlinux-sects.map | 10 - .../bin/tests/multisect/multisect1.map | 4 - .../bin/tests/multisect/multisect2.map | 3 - .../bin/tests/multisect/multisect3.map | 3 - .../bin/tests/multisect/multisect4.map | 6 - .../bin/tests/multisect/multisect5.map | 10 - .../bin/tests/multisect/nomultisect1.map | 3 - .../bin/tests/multisect/nomultisect2.map | 3 - 15 files changed, 27 insertions(+), 390 deletions(-) diff --git a/libyasm/coretype.h b/libyasm/coretype.h index c4b82cce..624e3c44 100644 --- a/libyasm/coretype.h +++ b/libyasm/coretype.h @@ -233,7 +233,6 @@ typedef enum yasm_expr_op { YASM_EXPR_NOR, /**< Bitwise NOR. */ YASM_EXPR_SHL, /**< Shift left (logical). */ YASM_EXPR_SHR, /**< Shift right (logical). */ - YASM_EXPR_LOGIC, /**< Start of logic operations (not an op). */ YASM_EXPR_LOR, /**< Logical OR. */ YASM_EXPR_LAND, /**< Logical AND. */ YASM_EXPR_LNOT, /**< Logical negation. */ diff --git a/libyasm/expr.c b/libyasm/expr.c index 1aad79df..c2c868ed 100644 --- a/libyasm/expr.c +++ b/libyasm/expr.c @@ -846,120 +846,6 @@ expr_expand_equ(yasm_expr *e, yasm__exprhead *eh) return e; } -static yasm_expr * -expr_simplify_seg(yasm_expr *e) -{ - yasm_expr *sube, *seg; - - if (e->op != YASM_EXPR_SEG && e->op != YASM_EXPR_WRT) - return e; - if (e->terms[0].type != YASM_EXPR_EXPR) - return e; - sube = e->terms[0].data.expn; - - seg = yasm_expr_extract_deep_segoff(&sube); - if (!seg) - return e; - - if (e->op == YASM_EXPR_SEG) { - e->op = YASM_EXPR_IDENT; - yasm_expr_destroy(sube); - e->terms[0].data.expn = seg; - } else if (e->op == YASM_EXPR_WRT) { - yasm_expr *old_base, *new_base; - yasm_expr *wrt, *off; - unsigned long line = e->line; - - off = e; - wrt = yasm_expr_extract_wrt(&off); - - assert(wrt != NULL); - - old_base = yasm_xmalloc(sizeof(yasm_expr)); - old_base->op = YASM_EXPR_MUL; - old_base->line = line; - old_base->numterms = 2; - old_base->terms[0].type = YASM_EXPR_INT; - old_base->terms[0].data.intn = yasm_intnum_create_int(16); - old_base->terms[1].type = YASM_EXPR_EXPR; - old_base->terms[1].data.expn = seg; - - new_base = yasm_xmalloc(sizeof(yasm_expr)); - new_base->op = YASM_EXPR_MUL; - new_base->line = line; - new_base->numterms = 2; - new_base->terms[0].type = YASM_EXPR_INT; - new_base->terms[0].data.intn = yasm_intnum_create_int(-16); - new_base->terms[1].type = YASM_EXPR_EXPR; - new_base->terms[1].data.expn = wrt; - - e = yasm_xmalloc(sizeof(yasm_expr)+sizeof(yasm_expr__item)); - e->op = YASM_EXPR_ADD; - e->line = line; - e->numterms = 3; - e->terms[0].type = YASM_EXPR_EXPR; - e->terms[0].data.expn = off; - e->terms[1].type = YASM_EXPR_EXPR; - e->terms[1].data.expn = old_base; - e->terms[2].type = YASM_EXPR_EXPR; - e->terms[2].data.expn = new_base; - } - - return e; -} - -static yasm_expr * -expr_lift_segoff(yasm_expr *e, int calc_bc_dist) -{ - yasm_expr *retval = NULL; - int i; - - if (e->op < YASM_EXPR_LOGIC || e->op == YASM_EXPR_SEGOFF) { - i = e->op == YASM_EXPR_SEGOFF ? 1 : 0; - for (; inumterms; i++) { - if (e->terms[i].type == YASM_EXPR_EXPR && - e->terms[i].data.expn->op == YASM_EXPR_SEGOFF) { - yasm_expr *sub = e->terms[i].data.expn; - e->terms[i] = sub->terms[1]; - retval = sub; - retval->op = YASM_EXPR_SEGOFF; - retval->line = e->line; - retval->numterms = 2; - break; - } - } - } - - if (retval != NULL && e->op == YASM_EXPR_SEGOFF) { - yasm_intnum *diff; - yasm_expr *helper; - e->op = YASM_EXPR_IDENT; - e->numterms = 1; - retval->op = YASM_EXPR_IDENT; - retval->numterms = 1; - helper = yasm_xmalloc(sizeof(yasm_expr)); - helper->op = YASM_EXPR_SUB; - helper->numterms = 2; - helper->terms[0].type = YASM_EXPR_EXPR; - helper->terms[0].data.expn = yasm_expr_copy(e); - helper->terms[1].type = YASM_EXPR_EXPR; - helper->terms[1].data.expn = yasm_expr_copy(retval); - diff = yasm_expr_get_intnum(&helper, calc_bc_dist); - if (diff != NULL && yasm_intnum_is_zero(diff)) { - yasm_expr_destroy(retval); - retval = NULL; - } else { - retval->op = YASM_EXPR_SEGOFF; - retval->numterms = 2; - } - yasm_expr_destroy(helper); - e->op = YASM_EXPR_SEGOFF; - e->numterms = 2; - } - - return retval; -} - static yasm_expr * expr_level_tree(yasm_expr *e, int fold_const, int simplify_ident, int simplify_reg_mul, int calc_bc_dist, @@ -967,10 +853,8 @@ expr_level_tree(yasm_expr *e, int fold_const, int simplify_ident, void *expr_xform_extra_data) { int i; - yasm_expr *seg; e = expr_xform_neg(e); - e = expr_simplify_seg(e); /* traverse terms */ for (i=0; inumterms; i++) { @@ -982,11 +866,18 @@ expr_level_tree(yasm_expr *e, int fold_const, int simplify_ident, expr_xform_extra, expr_xform_extra_data); } + /* Check for SEG of SEG:OFF, if we match, simplify to just the segment */ + if (e->op == YASM_EXPR_SEG && e->terms[0].type == YASM_EXPR_EXPR && + e->terms[0].data.expn->op == YASM_EXPR_SEGOFF) { + e->op = YASM_EXPR_IDENT; + e->terms[0].data.expn->op = YASM_EXPR_IDENT; + /* Destroy the second (offset) term */ + e->terms[0].data.expn->numterms = 1; + expr_delete_term(&e->terms[0].data.expn->terms[1], 1); + } + /* do callback */ e = expr_level_op(e, fold_const, simplify_ident, simplify_reg_mul); - seg = expr_lift_segoff(e, calc_bc_dist); - if (seg) - e = expr_level_op(e, fold_const, simplify_ident, simplify_reg_mul); if (calc_bc_dist || expr_xform_extra) { if (calc_bc_dist) e = expr_xform_bc_dist(e); @@ -995,11 +886,6 @@ expr_level_tree(yasm_expr *e, int fold_const, int simplify_ident, e = expr_level_tree(e, fold_const, simplify_ident, simplify_reg_mul, 0, NULL, NULL); } - if (seg) { - seg->terms[1].type = YASM_EXPR_EXPR; - seg->terms[1].data.expn = e; - e = seg; - } return e; } diff --git a/libyasm/section.c b/libyasm/section.c index 47e730c3..ba582bfa 100644 --- a/libyasm/section.c +++ b/libyasm/section.c @@ -241,11 +241,6 @@ yasm_object_create(const char *src_filename, const char *obj_filename, /* Initialize things to NULL in case of error */ object->dbgfmt = NULL; - /* Initialize override structure */ - object->overrides = yasm_xmalloc(sizeof(yasm_overrides)); - - object->overrides->value_finalize = NULL; - /* Initialize the object format */ object->objfmt = yasm_objfmt_create(objfmt_module, object); if (!object->objfmt) { @@ -494,8 +489,6 @@ yasm_object_destroy(yasm_object *object) if (object->arch) yasm_arch_destroy(object->arch); - yasm_xfree(object->overrides); - yasm_xfree(object); } diff --git a/libyasm/section.h b/libyasm/section.h index 5bdd4419..2c7faa4d 100644 --- a/libyasm/section.h +++ b/libyasm/section.h @@ -45,15 +45,6 @@ struct yasm_reloc { /*@dependent@*/ yasm_symrec *sym; /**< Relocated symbol */ }; -/** Structure of functions that can be overridden - */ -typedef struct yasm_overrides { - /** TODO: documentation - */ - int - (*value_finalize)(yasm_value *value, yasm_bytecode *precbc); -} yasm_overrides; - /** An object. This is the internal representation of an object file. */ struct yasm_object { /*@owned@*/ char *src_filename; /**< Source filename */ @@ -63,7 +54,6 @@ struct yasm_object { /*@owned@*/ yasm_arch *arch; /**< Target architecture */ /*@owned@*/ yasm_objfmt *objfmt; /**< Object format */ /*@owned@*/ yasm_dbgfmt *dbgfmt; /**< Debug format */ - /*@owned@*/ yasm_overrides *overrides; /**< Function overrides */ /** Currently active section. Used by some directives. NULL if no * section active. diff --git a/libyasm/value.c b/libyasm/value.c index 47873cf7..3ab73c1c 100644 --- a/libyasm/value.c +++ b/libyasm/value.c @@ -459,20 +459,9 @@ yasm_value_finalize_expr(yasm_value *value, yasm_expr *e, int yasm_value_finalize(yasm_value *value, yasm_bytecode *precbc) { - yasm_object *object = NULL; if (!value->abs) return 0; - if (precbc != NULL) - object = yasm_section_get_object(precbc->section); - - if (object && object->overrides->value_finalize) { - int result; - result = object->overrides->value_finalize(value, precbc); - if (result != -1) - return result; - } - value->abs = yasm_expr__level_tree(value->abs, 1, 1, 0, 0, NULL, NULL); /* quit early if there was an issue in simplify() */ diff --git a/modules/objfmts/bin/bin-objfmt.c b/modules/objfmts/bin/bin-objfmt.c index 4a4ce96f..18026750 100644 --- a/modules/objfmts/bin/bin-objfmt.c +++ b/modules/objfmts/bin/bin-objfmt.c @@ -43,18 +43,12 @@ typedef struct bin_section_data { /* User-provided starts */ /*@null@*/ /*@owned@*/ yasm_expr *start, *vstart; - /* User-provided segments */ - /*@null@*/ /*@owned@*/ yasm_expr *vseg; - /* User-provided follows */ /*@null@*/ /*@owned@*/ char *follows, *vfollows; /* Calculated (final) starts, used only during output() */ /*@null@*/ /*@owned@*/ yasm_intnum *istart, *ivstart; - /* Calculated (final) starts, used only during output() */ - /*@null@*/ /*@owned@*/ yasm_intnum *ivseg; - /* Calculated (final) length, used only during output() */ /*@null@*/ /*@owned@*/ yasm_intnum *length; } bin_section_data; @@ -104,7 +98,6 @@ static const yasm_assoc_data_callback bin_symrec_data_cb = { yasm_objfmt_module yasm_bin_LTX_objfmt; -static int bin_objfmt_value_finalize(yasm_value *value, yasm_bytecode *precbc); static yasm_objfmt * bin_objfmt_create(yasm_object *object) @@ -116,8 +109,6 @@ bin_objfmt_create(yasm_object *object) objfmt_bin->map_filename = NULL; objfmt_bin->org = NULL; - object->overrides->value_finalize = bin_objfmt_value_finalize; - return (yasm_objfmt *)objfmt_bin; } @@ -296,19 +287,6 @@ bin_lma_create_group(yasm_section *sect, /*@null@*/ void *d) } else bsd->ivstart = NULL; - /* Calculate section integer vseg. */ - if (bsd->vseg) { - bsd->ivseg = yasm_expr_get_intnum(&bsd->vseg, 0); - if (!bsd->ivseg) { - yasm_error_set(YASM_ERROR_TOO_COMPLEX, - N_("vseg expression is too complex")); - yasm_errwarn_propagate(info->errwarns, bsd->vseg->line); - return 1; - } else - bsd->ivseg = yasm_intnum_copy(bsd->ivseg); - } else - bsd->ivseg = NULL; - /* Calculate section integer length. */ bsd->length = yasm_calc_bc_dist(yasm_section_bcs_first(sect), yasm_section_bcs_last(sect)); @@ -489,13 +467,11 @@ group_assign_vstart_recurse(bin_group *group, yasm_intnum *start, } } -static /*@null@*/ /*@only@*/ yasm_expr * -get_ssym_value(yasm_symrec *sym, unsigned long line) +static /*@null@*/ const yasm_intnum * +get_ssym_value(yasm_symrec *sym) { bin_symrec_data *bsymd = yasm_symrec_get_data(sym, &bin_symrec_data_cb); bin_section_data *bsd; - yasm_intnum *offset; - yasm_expr *expr; if (!bsymd) return NULL; @@ -504,26 +480,11 @@ get_ssym_value(yasm_symrec *sym, unsigned long line) assert(bsd != NULL); switch (bsymd->which) { - case SSYM_START: offset = bsd->istart; break; - case SSYM_VSTART: offset = bsd->ivstart; break; - case SSYM_LENGTH: offset = bsd->length; break; - default: return NULL; + case SSYM_START: return bsd->istart; + case SSYM_VSTART: return bsd->ivstart; + case SSYM_LENGTH: return bsd->length; } - - offset = yasm_intnum_copy(offset); - - if (bsymd->which == SSYM_VSTART && bsd->ivseg != NULL) { - yasm_intnum *tmp = yasm_intnum_create_int(16); - yasm_intnum_calc(tmp, YASM_EXPR_MUL, bsd->ivseg); - yasm_intnum_calc(offset, YASM_EXPR_SUB, tmp); - yasm_intnum_destroy(tmp); - expr = yasm_expr_create(YASM_EXPR_SEGOFF, - yasm_expr_int(yasm_intnum_copy(bsd->ivseg)), - yasm_expr_int(offset), line); - } else - expr = yasm_expr_create_ident(yasm_expr_int(offset), line); - - return expr; + return NULL; } static /*@only@*/ yasm_expr * @@ -535,7 +496,7 @@ bin_objfmt_expr_xform(/*@returned@*/ /*@only@*/ yasm_expr *e, /*@dependent@*/ yasm_section *sect; /*@dependent@*/ /*@null@*/ yasm_bytecode *precbc; /*@null@*/ yasm_intnum *dist; - /*@null@*/ /*@only@*/ yasm_expr *ssymval; + /*@null@*/ const yasm_intnum *ssymval; /* Transform symrecs or precbcs that reference sections into * vstart + intnum(dist). @@ -550,31 +511,15 @@ bin_objfmt_expr_xform(/*@returned@*/ /*@only@*/ yasm_expr *e, bsd = yasm_section_get_data(sect, &bin_section_data_cb); assert(bsd != NULL); yasm_intnum_calc(dist, YASM_EXPR_ADD, bsd->ivstart); - if (bsd->ivseg != NULL) { - yasm_expr *sube; - yasm_intnum *seg; - - seg = yasm_intnum_create_int(16); - yasm_intnum_calc(seg, YASM_EXPR_MUL, bsd->ivseg); - yasm_intnum_calc(dist, YASM_EXPR_SUB, seg); - yasm_intnum_set(seg, bsd->ivseg); - - sube = yasm_expr_create(YASM_EXPR_SEGOFF, - yasm_expr_int(seg), - yasm_expr_int(dist), e->line); - e->terms[i].type = YASM_EXPR_EXPR; - e->terms[i].data.expn = sube; - } else { - e->terms[i].type = YASM_EXPR_INT; - e->terms[i].data.intn = dist; - } + e->terms[i].type = YASM_EXPR_INT; + e->terms[i].data.intn = dist; } /* Transform our special symrecs into the appropriate value */ if (e->terms[i].type == YASM_EXPR_SYM && - (ssymval = get_ssym_value(e->terms[i].data.sym, e->line))) { - e->terms[i].type = YASM_EXPR_EXPR; - e->terms[i].data.expn = ssymval; + (ssymval = get_ssym_value(e->terms[i].data.sym))) { + e->terms[i].type = YASM_EXPR_INT; + e->terms[i].data.intn = yasm_intnum_copy(ssymval); } } @@ -584,7 +529,6 @@ bin_objfmt_expr_xform(/*@returned@*/ /*@only@*/ yasm_expr *e, typedef struct map_output_info { /* address width */ int bytes; - int vseg_present; /* intnum output static data areas */ unsigned char *buf; @@ -613,11 +557,6 @@ map_prescan_bytes(yasm_section *sect, void *d) info->bytes *= 2; while (!yasm_intnum_check_size(bsd->ivstart, info->bytes * 8, 0, 0)) info->bytes *= 2; - if (bsd->ivseg) { - info->vseg_present = 1; - while (!yasm_intnum_check_size(bsd->ivseg, info->bytes * 8, 0, 0)) - info->bytes *= 2; - } return 0; } @@ -650,16 +589,6 @@ map_sections_summary(bin_groups *groups, map_output_info *info) map_print_intnum(info->intn, info); fprintf(info->f, " "); - if (info->vseg_present) { - if (bsd->ivseg == NULL) { - size_t i; - for (i = info->bytes; i != 0; i--) - fprintf(info->f, "--"); - } else - map_print_intnum(bsd->ivseg, info); - fprintf(info->f, " "); - } - map_print_intnum(bsd->istart, info); fprintf(info->f, " "); @@ -705,11 +634,6 @@ map_sections_detail(bin_groups *groups, map_output_info *info) bsd->follows ? bsd->follows : "not defined"); fprintf(info->f, "\nvstart: "); map_print_intnum(bsd->ivstart, info); - fprintf(info->f, "\nvseg: "); - if (bsd->ivseg) - map_print_intnum(bsd->ivseg, info); - else - fprintf(info->f, "not defined"); fprintf(info->f, "\nvalign: "); map_print_intnum(bsd->valign, info); fprintf(info->f, "\nvfollows: %s\n\n", @@ -845,7 +769,6 @@ output_map(bin_objfmt_output_info *info) * fields. Start with a minimum of 4. */ mapinfo.bytes = 4; - mapinfo.vseg_present = 0; while (!yasm_intnum_check_size(info->origin, mapinfo.bytes * 8, 0, 0)) mapinfo.bytes *= 2; yasm_object_sections_traverse(info->object, &mapinfo, map_prescan_bytes); @@ -868,11 +791,9 @@ output_map(bin_objfmt_output_info *info) fprintf(f, "-- Sections (summary) "); for (i=0; i<57; i++) fputc('-', f); - fprintf(f, "\n\n%-*s%-*s%-*s%-*s%-*s%-*s%-*s%s\n", + fprintf(f, "\n\n%-*s%-*s%-*s%-*s%-*s%-*s%s\n", mapinfo.bytes*2+2, "Vstart", mapinfo.bytes*2+2, "Vstop", - mapinfo.vseg_present ? mapinfo.bytes*2+2 : 0, - mapinfo.vseg_present ? "Vseg" : "", mapinfo.bytes*2+2, "Start", mapinfo.bytes*2+2, "Stop", mapinfo.bytes*2+2, "Length", @@ -971,91 +892,6 @@ check_lma_overlap(yasm_section *sect, /*@null@*/ void *d) return 0; } -static int -bin_objfmt_value_finalize(yasm_value *value, yasm_bytecode *precbc) -{ - value->abs = yasm_expr__level_tree(value->abs, 1, 1, 0, 0, NULL, NULL); - - /* quit early if there was an issue in simplify() */ - if (yasm_error_occurred()) - return 1; - - /* Strip top-level AND masking to an all-1s mask the same size - * of the value size. This allows forced avoidance of overflow warnings. - */ - if (value->abs->op == YASM_EXPR_AND) { - int term; - - /* Calculate 1<size); - yasm_intnum_calc(mask, YASM_EXPR_SHL, mask_tmp); - yasm_intnum_set_uint(mask_tmp, 1); - yasm_intnum_calc(mask, YASM_EXPR_SUB, mask_tmp); - yasm_intnum_destroy(mask_tmp); - - /* Walk terms and delete matching masks */ - for (term=value->abs->numterms-1; term>=0; term--) { - if (value->abs->terms[term].type == YASM_EXPR_INT && - yasm_intnum_compare(value->abs->terms[term].data.intn, - mask) == 0) { - /* Delete the intnum */ - yasm_intnum_destroy(value->abs->terms[term].data.intn); - - /* Slide everything to its right over by 1 */ - if (term != value->abs->numterms-1) /* if it wasn't last.. */ - memmove(&value->abs->terms[term], - &value->abs->terms[term+1], - (value->abs->numterms-1-term)* - sizeof(yasm_expr__item)); - - /* Update numterms */ - value->abs->numterms--; - - /* Indicate warnings have been disabled */ - value->no_warn = 1; - } - } - if (value->abs->numterms == 1) - value->abs->op = YASM_EXPR_IDENT; - yasm_intnum_destroy(mask); - } - - /* Handle trivial (IDENT) cases immediately */ - if (value->abs->op == YASM_EXPR_IDENT) { - switch (value->abs->terms[0].type) { - case YASM_EXPR_INT: - if (yasm_intnum_is_zero(value->abs->terms[0].data.intn)) { - yasm_expr_destroy(value->abs); - value->abs = NULL; - } - return 0; - case YASM_EXPR_REG: - case YASM_EXPR_FLOAT: - return 0; - case YASM_EXPR_SYM: - value->rel = value->abs->terms[0].data.sym; - yasm_expr_destroy(value->abs); - value->abs = NULL; - return 0; - case YASM_EXPR_EXPR: - /* Bring up lower values. */ - while (value->abs->op == YASM_EXPR_IDENT - && value->abs->terms[0].type == YASM_EXPR_EXPR) { - yasm_expr *sube = value->abs->terms[0].data.expn; - yasm_xfree(value->abs); - value->abs = sube; - } - break; - default: - return 0; - } - } - - /* TODO do some more finalization to avoid breaking stuff that depends on it */ - return 0; -} - static int bin_objfmt_output_value(yasm_value *value, unsigned char *buf, unsigned int destsize, @@ -1072,7 +908,7 @@ bin_objfmt_output_value(yasm_value *value, unsigned char *buf, if (value->rel) { unsigned int rshift = (unsigned int)value->rshift; yasm_expr *syme; - /*@null@*/ yasm_expr *ssymval; + /*@null@*/ const yasm_intnum *ssymval; if (yasm_symrec_is_abs(value->rel)) { syme = yasm_expr_create_ident(yasm_expr_int( @@ -1080,8 +916,9 @@ bin_objfmt_output_value(yasm_value *value, unsigned char *buf, } else if (yasm_symrec_get_label(value->rel, &precbc) && (sect = yasm_bc_get_section(precbc))) { syme = yasm_expr_create_ident(yasm_expr_sym(value->rel), bc->line); - } else if ((ssymval = get_ssym_value(value->rel, bc->line))) { - syme = ssymval; + } else if ((ssymval = get_ssym_value(value->rel))) { + syme = yasm_expr_create_ident(yasm_expr_int( + yasm_intnum_copy(ssymval)), bc->line); } else goto done; @@ -1564,7 +1401,6 @@ bin_objfmt_init_new_section(yasm_section *sect, unsigned long line) data->valign = NULL; data->start = NULL; data->vstart = NULL; - data->vseg = NULL; data->follows = NULL; data->vfollows = NULL; data->istart = NULL; @@ -1619,7 +1455,6 @@ bin_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, /*@only@*/ /*@null@*/ char *vfollows; /*@only@*/ /*@null@*/ yasm_expr *start; /*@only@*/ /*@null@*/ yasm_expr *vstart; - /*@only@*/ /*@null@*/ yasm_expr *vseg; /*@only@*/ /*@null@*/ yasm_intnum *align; /*@only@*/ /*@null@*/ yasm_intnum *valign; unsigned long bss; @@ -1635,8 +1470,6 @@ bin_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, offsetof(struct bin_section_switch_data, start), 0 }, { "vstart", 1, yasm_dir_helper_expr, offsetof(struct bin_section_switch_data, vstart), 0 }, - { "vseg", 1, yasm_dir_helper_expr, - offsetof(struct bin_section_switch_data, vseg), 0 }, { "align", 1, yasm_dir_helper_intn, offsetof(struct bin_section_switch_data, align), 0 }, { "valign", 1, yasm_dir_helper_intn, @@ -1670,7 +1503,6 @@ bin_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, data.vfollows = bsd->vfollows; data.start = bsd->start; data.vstart = bsd->vstart; - data.vseg = bsd->vseg; data.align = NULL; data.valign = NULL; data.bss = bsd->bss; @@ -1680,7 +1512,6 @@ bin_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, data.vfollows = NULL; data.start = NULL; data.vstart = NULL; - data.vseg = NULL; data.align = NULL; data.valign = NULL; data.bss = strcmp(sectname, ".bss") == 0; @@ -1745,7 +1576,6 @@ bin_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, bsd->valign = data.valign; bsd->start = data.start; bsd->vstart = data.vstart; - bsd->vseg = data.vseg; bsd->follows = data.follows; bsd->vfollows = data.vfollows; @@ -1854,8 +1684,6 @@ bin_section_data_destroy(void *data) yasm_expr_destroy(bsd->start); if (bsd->vstart) yasm_expr_destroy(bsd->vstart); - if (bsd->vseg) - yasm_expr_destroy(bsd->vseg); if (bsd->follows) yasm_xfree(bsd->follows); if (bsd->vfollows) @@ -1891,8 +1719,6 @@ bin_section_data_print(void *data, FILE *f, int indent_level) yasm_expr_print(bsd->start, f); fprintf(f, "\n%*svstart=", indent_level, ""); yasm_expr_print(bsd->vstart, f); - fprintf(f, "\n%*svseg=", indent_level, ""); - yasm_expr_print(bsd->vseg, f); fprintf(f, "\n%*sfollows=", indent_level, ""); if (bsd->follows) diff --git a/modules/objfmts/bin/tests/multisect/bin-align.map b/modules/objfmts/bin/tests/multisect/bin-align.map index 7ea54184..3031bd15 100644 --- a/modules/objfmts/bin/tests/multisect/bin-align.map +++ b/modules/objfmts/bin/tests/multisect/bin-align.map @@ -26,7 +26,6 @@ start: 00000000 align: 00000008 follows: not defined vstart: 00000000 -vseg: not defined valign: 00000008 vfollows: not defined @@ -38,7 +37,6 @@ start: 00000010 align: 00000008 follows: not defined vstart: 00000010 -vseg: not defined valign: 00000008 vfollows: not defined @@ -50,7 +48,6 @@ start: 00000014 align: 00000004 follows: not defined vstart: 00000014 -vseg: not defined valign: 00000004 vfollows: not defined @@ -62,7 +59,6 @@ start: 00000018 align: 00000008 follows: not defined vstart: 00000018 -vseg: not defined valign: 00000004 vfollows: not defined diff --git a/modules/objfmts/bin/tests/multisect/ldlinux-sects.map b/modules/objfmts/bin/tests/multisect/ldlinux-sects.map index 6a7b6a92..03fde845 100644 --- a/modules/objfmts/bin/tests/multisect/ldlinux-sects.map +++ b/modules/objfmts/bin/tests/multisect/ldlinux-sects.map @@ -32,7 +32,6 @@ start: 00000800 align: 00000004 follows: not defined vstart: 00000800 -vseg: not defined valign: 00000004 vfollows: not defined @@ -44,7 +43,6 @@ start: 00006C00 align: 00000010 follows: not defined vstart: 00006C00 -vseg: not defined valign: 00000010 vfollows: not defined @@ -56,7 +54,6 @@ start: 00007C00 align: 00000004 follows: not defined vstart: 00007C00 -vseg: not defined valign: 00000004 vfollows: not defined @@ -68,7 +65,6 @@ start: 0000A010 align: 00000010 follows: not defined vstart: 0000A010 -vseg: not defined valign: 00000010 vfollows: not defined @@ -80,7 +76,6 @@ start: 0000A5A0 align: 00000004 follows: .data vstart: 000048D0 -vseg: not defined valign: 00000010 vfollows: .earlybss @@ -92,7 +87,6 @@ start: 0000A840 align: 00000004 follows: .bcopy32 vstart: 00004B70 -vseg: not defined valign: 00000010 vfollows: .bcopy32 @@ -104,7 +98,6 @@ start: 0000A863 align: 00000001 follows: .config vstart: 0000A863 -vseg: not defined valign: 00000001 vfollows: not defined @@ -116,7 +109,6 @@ start: 0000A870 align: 00000010 follows: .adv vstart: 0000A870 -vseg: not defined valign: 00000010 vfollows: not defined @@ -128,7 +120,6 @@ start: 0000E170 align: 00000004 follows: not defined vstart: 00004B94 -vseg: not defined valign: 00000004 vfollows: .config @@ -140,7 +131,6 @@ start: 0000E170 align: 00000004 follows: not defined vstart: 00004BA0 -vseg: not defined valign: 00000010 vfollows: .config.end diff --git a/modules/objfmts/bin/tests/multisect/multisect1.map b/modules/objfmts/bin/tests/multisect/multisect1.map index a039ea35..0a56e413 100644 --- a/modules/objfmts/bin/tests/multisect/multisect1.map +++ b/modules/objfmts/bin/tests/multisect/multisect1.map @@ -26,7 +26,6 @@ start: 00000000 align: 00000004 follows: not defined vstart: 00000000 -vseg: not defined valign: 00000004 vfollows: not defined @@ -38,7 +37,6 @@ start: 00000000 align: 00000004 follows: not defined vstart: 00000100 -vseg: not defined valign: 00000004 vfollows: not defined @@ -50,7 +48,6 @@ start: 00000010 align: 00000001 follows: _TEXT vstart: 00000000 -vseg: not defined valign: 00000001 vfollows: not defined @@ -62,7 +59,6 @@ start: 00000020 align: 00000010 follows: GATESEG vstart: 00000020 -vseg: not defined valign: 00000010 vfollows: not defined diff --git a/modules/objfmts/bin/tests/multisect/multisect2.map b/modules/objfmts/bin/tests/multisect/multisect2.map index f10bf198..82002edb 100644 --- a/modules/objfmts/bin/tests/multisect/multisect2.map +++ b/modules/objfmts/bin/tests/multisect/multisect2.map @@ -25,7 +25,6 @@ start: 00000100 align: 00000004 follows: not defined vstart: 00000100 -vseg: not defined valign: 00000004 vfollows: not defined @@ -37,7 +36,6 @@ start: 00000130 align: 00000004 follows: not defined vstart: 00000130 -vseg: not defined valign: 00000004 vfollows: not defined @@ -49,7 +47,6 @@ start: 00000144 align: 00000004 follows: not defined vstart: 00000144 -vseg: not defined valign: 00000004 vfollows: not defined diff --git a/modules/objfmts/bin/tests/multisect/multisect3.map b/modules/objfmts/bin/tests/multisect/multisect3.map index 49f4c665..1c67c227 100644 --- a/modules/objfmts/bin/tests/multisect/multisect3.map +++ b/modules/objfmts/bin/tests/multisect/multisect3.map @@ -25,7 +25,6 @@ start: 00000000 align: 00000004 follows: not defined vstart: 00000000 -vseg: not defined valign: 00000004 vfollows: not defined @@ -37,7 +36,6 @@ start: 00000004 align: 00000004 follows: .text vstart: 00000004 -vseg: not defined valign: 00000004 vfollows: not defined @@ -49,7 +47,6 @@ start: 00000008 align: 00000004 follows: not defined vstart: 00000008 -vseg: not defined valign: 00000004 vfollows: not defined diff --git a/modules/objfmts/bin/tests/multisect/multisect4.map b/modules/objfmts/bin/tests/multisect/multisect4.map index c31fdf10..e1940dc6 100644 --- a/modules/objfmts/bin/tests/multisect/multisect4.map +++ b/modules/objfmts/bin/tests/multisect/multisect4.map @@ -28,7 +28,6 @@ start: 00000800 align: 00000004 follows: not defined vstart: 00000800 -vseg: not defined valign: 00000004 vfollows: not defined @@ -40,7 +39,6 @@ start: 00009000 align: 00000004 follows: not defined vstart: 00009000 -vseg: not defined valign: 00000004 vfollows: not defined @@ -52,7 +50,6 @@ start: 00009100 align: 00000010 follows: .text vstart: 00009100 -vseg: not defined valign: 00000010 vfollows: not defined @@ -64,7 +61,6 @@ start: 00009200 align: 00000010 follows: .data vstart: 00000900 -vseg: not defined valign: 00000010 vfollows: .earlybss @@ -76,7 +72,6 @@ start: 00009300 align: 00000010 follows: .bcopy32 vstart: 00009300 -vseg: not defined valign: 00000010 vfollows: not defined @@ -88,7 +83,6 @@ start: 00009400 align: 00000100 follows: not defined vstart: 00000A00 -vseg: not defined valign: 00000100 vfollows: .bcopy32 diff --git a/modules/objfmts/bin/tests/multisect/multisect5.map b/modules/objfmts/bin/tests/multisect/multisect5.map index 86676436..4c052be6 100644 --- a/modules/objfmts/bin/tests/multisect/multisect5.map +++ b/modules/objfmts/bin/tests/multisect/multisect5.map @@ -32,7 +32,6 @@ start: 00000100 align: 00000004 follows: not defined vstart: 00000100 -vseg: not defined valign: 00000004 vfollows: not defined @@ -44,7 +43,6 @@ start: 00000100 align: 00000004 follows: not defined vstart: 00002000 -vseg: not defined valign: 00000004 vfollows: not defined @@ -56,7 +54,6 @@ start: 00000200 align: 00000004 follows: sect1 vstart: 00000200 -vseg: not defined valign: 00000004 vfollows: not defined @@ -68,7 +65,6 @@ start: 00000300 align: 00000004 follows: not defined vstart: 00004000 -vseg: not defined valign: 00000004 vfollows: not defined @@ -80,7 +76,6 @@ start: 00000400 align: 00000004 follows: sect3 vstart: 00000400 -vseg: not defined valign: 00000004 vfollows: not defined @@ -92,7 +87,6 @@ start: 00000500 align: 00000004 follows: not defined vstart: 00004100 -vseg: not defined valign: 00000004 vfollows: sect3 @@ -104,7 +98,6 @@ start: 00000600 align: 00000004 follows: not defined vstart: 00006000 -vseg: not defined valign: 00000004 vfollows: not defined @@ -116,7 +109,6 @@ start: 00000614 align: 00000004 follows: sect6 vstart: 00000620 -vseg: not defined valign: 00000010 vfollows: not defined @@ -128,7 +120,6 @@ start: 00000718 align: 00000004 follows: sect7 vstart: 00000730 -vseg: not defined valign: 00000010 vfollows: not defined @@ -140,7 +131,6 @@ start: 00000818 align: 00000004 follows: not defined vstart: 00000830 -vseg: not defined valign: 00000004 vfollows: sect8 diff --git a/modules/objfmts/bin/tests/multisect/nomultisect1.map b/modules/objfmts/bin/tests/multisect/nomultisect1.map index fe5981fc..89974207 100644 --- a/modules/objfmts/bin/tests/multisect/nomultisect1.map +++ b/modules/objfmts/bin/tests/multisect/nomultisect1.map @@ -25,7 +25,6 @@ start: 00000000 align: 00000004 follows: not defined vstart: 00000000 -vseg: not defined valign: 00000004 vfollows: not defined @@ -37,7 +36,6 @@ start: 00000100 align: 00000004 follows: not defined vstart: 00000100 -vseg: not defined valign: 00000004 vfollows: not defined @@ -49,7 +47,6 @@ start: 00000200 align: 00000004 follows: not defined vstart: 00000200 -vseg: not defined valign: 00000004 vfollows: not defined diff --git a/modules/objfmts/bin/tests/multisect/nomultisect2.map b/modules/objfmts/bin/tests/multisect/nomultisect2.map index f87f4090..cc6d9c87 100644 --- a/modules/objfmts/bin/tests/multisect/nomultisect2.map +++ b/modules/objfmts/bin/tests/multisect/nomultisect2.map @@ -25,7 +25,6 @@ start: 00000100 align: 00000004 follows: not defined vstart: 00000100 -vseg: not defined valign: 00000004 vfollows: not defined @@ -37,7 +36,6 @@ start: 00000200 align: 00000004 follows: not defined vstart: 00000200 -vseg: not defined valign: 00000004 vfollows: not defined @@ -49,7 +47,6 @@ start: 00000300 align: 00000004 follows: not defined vstart: 00000300 -vseg: not defined valign: 00000004 vfollows: not defined From 98a83602f2450b3619043a705af1c7f4ee4b2f7f Mon Sep 17 00:00:00 2001 From: mx237 Date: Sun, 3 May 2020 23:38:42 -0700 Subject: [PATCH 523/585] Fix EOL handling in genmacro.c (#123) --- tools/genmacro/genmacro.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/genmacro/genmacro.c b/tools/genmacro/genmacro.c index 8e702b86..896cea5f 100644 --- a/tools/genmacro/genmacro.c +++ b/tools/genmacro/genmacro.c @@ -101,7 +101,7 @@ main(int argc, char *argv[]) strp++; len = strlen(strp); while (len > 0 && (strp[len-1] == ' ' || strp[len-1] == '\t' || - strp[len-1] == '\n')) { + strp[len-1] == '\r' || strp[len-1] == '\n')) { strp[len-1] = '\0'; len--; } From c9db6d70a9ab62ce58a1cf123f2007d7a3ccc528 Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Mon, 4 May 2020 14:54:18 +0100 Subject: [PATCH 524/585] add missing include file --- Mkfiles/vs/libyasm-stdint.h | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 Mkfiles/vs/libyasm-stdint.h diff --git a/Mkfiles/vs/libyasm-stdint.h b/Mkfiles/vs/libyasm-stdint.h new file mode 100644 index 00000000..b66ab15f --- /dev/null +++ b/Mkfiles/vs/libyasm-stdint.h @@ -0,0 +1,8 @@ +#ifndef _UINTPTR_T_DEFINED +#ifdef _WIN64 +#include +#else +typedef unsigned long uintptr_t; +#endif +#define _UINTPTR_T_DEFINED +#endif From 009450c7ad4d425fa5a10ac4bd6efbd25248d823 Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Mon, 27 Jul 2020 17:01:46 +0100 Subject: [PATCH 525/585] minor update to VS2019 build --- Mkfiles/vs/yasm.sln | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Mkfiles/vs/yasm.sln b/Mkfiles/vs/yasm.sln index 5d2dc952..8d3b03a4 100644 --- a/Mkfiles/vs/yasm.sln +++ b/Mkfiles/vs/yasm.sln @@ -1,11 +1,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.22823.1 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30320.27 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{825AC694-358C-4D8D-92DE-33A2691978CE}" ProjectSection(SolutionItems) = preProject crt_secure_no_deprecate.vsprops = crt_secure_no_deprecate.vsprops - readme.vc14.txt = readme.vc14.txt + readme.vs.txt = readme.vs.txt EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libyasm", "libyasm\libyasm.vcxproj", "{29FE7874-1256-4AD6-B889-68E399DC9608}" @@ -139,4 +139,7 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {BE3F09BB-91A9-474C-AAD9-4B4D43DCE89E} + EndGlobalSection EndGlobal From f01afb6b5109bce276211e8d64d7c8bde6b71452 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 9 Jul 2021 15:42:53 -0500 Subject: [PATCH 526/585] Fix test failures (#177) These were caused by the addition of the segreg-in-64bit warning. --- modules/arch/x86/tests/x86_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/arch/x86/tests/x86_test.sh b/modules/arch/x86/tests/x86_test.sh index a4fd2e37..56aa2154 100755 --- a/modules/arch/x86/tests/x86_test.sh +++ b/modules/arch/x86/tests/x86_test.sh @@ -1,3 +1,3 @@ #! /bin/sh -${srcdir}/out_test.sh x86_test modules/arch/x86/tests "x86 arch" "-f bin" "" +${srcdir}/out_test.sh x86_test modules/arch/x86/tests "x86 arch" "-f bin -Wsegreg-in-64bit" "" exit $? From 3e74376b5653102a3957f59005969fcdbbe5a89d Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 9 Jul 2021 16:02:37 -0500 Subject: [PATCH 527/585] Do not use AC_HEADER_STDC (#178) This fixes compatibility with autotools 2.70+ --- configure.ac | 6 ------ 1 file changed, 6 deletions(-) diff --git a/configure.ac b/configure.ac index 01b61097..2823ecd7 100644 --- a/configure.ac +++ b/configure.ac @@ -101,14 +101,8 @@ AM_WITH_DMALLOC # # Checks for header files. # -AC_HEADER_STDC AC_CHECK_HEADERS([strings.h libgen.h unistd.h direct.h sys/stat.h]) -# REQUIRE standard C headers -if test "$ac_cv_header_stdc" != yes; then - AC_MSG_ERROR([Standard (ANSI/ISO C89) header files are required.]) -fi - # # Checks for typedefs, structures, and compiler characteristics. # From d938d97505fda33d0b387c8f2456272f00ad56a2 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 9 Jul 2021 16:49:16 -0500 Subject: [PATCH 528/585] Add GitHub CI build workflow (#179) --- .github/workflows/build.yml | 41 +++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..cc7d27b5 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,41 @@ +name: Build + +on: [push, pull_request] + +jobs: + build-host: + env: + MACOSX_DEPLOYMENT_TARGET: 10.14 + strategy: + fail-fast: false + matrix: + include: + - os: macos-latest + artifact-name: macOS + - os: ubuntu-latest + artifact-name: Ubuntu + + name: "Build - ${{ matrix.artifact-name }}" + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - name: Install autotools + run: | + if [ "$RUNNER_OS" == "macOS" ]; then + brew update + brew install automake autoconf + fi + - name: Autotools + run: ./autogen.sh + - name: Build + run: make + - name: Check + run: make check + - name: Dist + run: make dist + + - uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.artifact-name }} + path: yasm-*.tar.gz + From 41762bead150fdae59687b35c8acd1c4ae0f1575 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 10 Jul 2021 14:12:45 -0500 Subject: [PATCH 529/585] Update Mach-O for newer macOS (#180) - Create a dummy .llvmasm section for bitcode - Add [buildversion] directive for setting minos and sdk versions, e.g. [buildversion minos="10.14" sdk="10.14"]. This defaults to 10.5 on x64 and 10.4 on x86. --- modules/objfmts/macho/macho-objfmt.c | 106 +++++- .../objfmts/macho/tests/gas32/gas-macho32.hex | 186 +++++++--- .../macho/tests/gas64/gas-macho64-pic.hex | 134 +++++++- .../objfmts/macho/tests/gas64/gas-macho64.hex | 214 +++++++++--- .../macho/tests/nasm32/macho-reloc.hex | 190 ++++++++--- .../macho/tests/nasm32/macho32-pext.hex | 198 ++++++++--- .../macho/tests/nasm32/macho32-pic.hex | 178 +++++++--- .../macho/tests/nasm32/macho32-sect.hex | 236 +++++++++---- .../macho/tests/nasm32/macho32-size.hex | 174 +++++++--- .../objfmts/macho/tests/nasm32/machotest.hex | 198 ++++++++--- .../tests/nasm64/macho64-buildversion.asm | 2 + .../tests/nasm64/macho64-buildversion.hex | 317 ++++++++++++++++++ .../macho/tests/nasm64/machotest64.hex | 196 ++++++++--- .../macho/tests/nasm64/nasm-macho64-pic.hex | 134 +++++++- 14 files changed, 1973 insertions(+), 490 deletions(-) create mode 100644 modules/objfmts/macho/tests/nasm64/macho64-buildversion.asm create mode 100644 modules/objfmts/macho/tests/nasm64/macho64-buildversion.hex diff --git a/modules/objfmts/macho/macho-objfmt.c b/modules/objfmts/macho/macho-objfmt.c index 0a48d9b9..74ac3573 100644 --- a/modules/objfmts/macho/macho-objfmt.c +++ b/modules/objfmts/macho/macho-objfmt.c @@ -102,6 +102,7 @@ #define MACHO_SYMCMD_SIZE 24 #define MACHO_NLIST_SIZE 12 #define MACHO_RELINFO_SIZE 8 +#define MACHO_BUILDVERSION_SIZE 24 /* 64 bit sizes */ #define MACHO_HEADER64_SIZE 32 @@ -145,7 +146,10 @@ #define LC_SEGMENT 0x1 /* segment load command */ #define LC_SYMTAB 0x2 /* symbol table load command */ #define LC_SEGMENT_64 0x19 /* segment load command */ +#define LC_BUILD_VERSION 0x32 /* build version command */ +/* Values for platform field in build version command */ +#define PLATFORM_MACOS 1 #define VM_PROT_NONE 0x00 #define VM_PROT_READ 0x01 @@ -287,6 +291,9 @@ typedef struct yasm_objfmt_macho { int bits; /* 32 / 64 */ yasm_symrec *gotpcrel_sym; /* ..gotpcrel */ + + unsigned long minos; /* minimum os version */ + unsigned long sdk; /* sdk version */ } yasm_objfmt_macho; @@ -356,6 +363,8 @@ macho_objfmt_create_common(yasm_object *object, yasm_objfmt_module *module, (bits_pref == 0 || bits_pref == 32)) { objfmt_macho->bits = 32; objfmt_macho->gotpcrel_sym = NULL; + objfmt_macho->minos = 0x000a0400; /* min OS version: 10.4 */ + objfmt_macho->sdk = 0x000a0400; /* SDK version: 10.4 */ } else if (yasm__strcasecmp(yasm_arch_get_machine(object->arch), "amd64") == 0 && (bits_pref == 0 || bits_pref == 64)) { @@ -363,6 +372,8 @@ macho_objfmt_create_common(yasm_object *object, yasm_objfmt_module *module, /* FIXME: misuse of NULL bytecode */ objfmt_macho->gotpcrel_sym = yasm_symtab_define_label(object->symtab, "..gotpcrel", NULL, 0, 0); + objfmt_macho->minos = 0x000a0500; /* min OS version: 10.5 */ + objfmt_macho->sdk = 0x000a0500; /* SDK version: 10.5 */ } else { yasm_xfree(objfmt_macho); return NULL; @@ -1062,7 +1073,7 @@ macho_objfmt_output(yasm_object *object, FILE *f, int all_syms, headsize = MACHO_HEADER64_SIZE + MACHO_SEGCMD64_SIZE + (MACHO_SECTCMD64_SIZE * (objfmt_macho->parse_scnum)) + - MACHO_SYMCMD_SIZE; + MACHO_SYMCMD_SIZE + MACHO_BUILDVERSION_SIZE; macho_segcmd = LC_SEGMENT_64; macho_segcmdsize = MACHO_SEGCMD64_SIZE; macho_sectcmdsize = MACHO_SECTCMD64_SIZE; @@ -1072,7 +1083,7 @@ macho_objfmt_output(yasm_object *object, FILE *f, int all_syms, headsize = MACHO_HEADER_SIZE + MACHO_SEGCMD_SIZE + (MACHO_SECTCMD_SIZE * (objfmt_macho->parse_scnum)) + - MACHO_SYMCMD_SIZE; + MACHO_SYMCMD_SIZE + MACHO_BUILDVERSION_SIZE; macho_segcmd = LC_SEGMENT; macho_segcmdsize = MACHO_SEGCMD_SIZE; macho_sectcmdsize = MACHO_SECTCMD_SIZE; @@ -1132,8 +1143,8 @@ macho_objfmt_output(yasm_object *object, FILE *f, int all_syms, YASM_WRITE_32_L(localbuf, MH_OBJECT); /* MACH file type */ /* calculate number of commands and their size, put to stream */ - head_ncmds = 0; - head_sizeofcmds = 0; + head_ncmds = 1; + head_sizeofcmds = MACHO_BUILDVERSION_SIZE; if (objfmt_macho->parse_scnum > 0) { head_ncmds++; head_sizeofcmds += @@ -1155,6 +1166,14 @@ macho_objfmt_output(yasm_object *object, FILE *f, int all_syms, fileoffset = MACHO_HEADER_SIZE + head_sizeofcmds; } + /* --------------- write build version command ---------------- */ + YASM_WRITE_32_L(localbuf, LC_BUILD_VERSION); + YASM_WRITE_32_L(localbuf, MACHO_BUILDVERSION_SIZE); + YASM_WRITE_32_L(localbuf, PLATFORM_MACOS); + YASM_WRITE_32_L(localbuf, objfmt_macho->minos); + YASM_WRITE_32_L(localbuf, objfmt_macho->sdk); + YASM_WRITE_32_L(localbuf, 0); /* number of tools */ + /* --------------- write segment header command ---------------- */ YASM_WRITE_32_L(localbuf, macho_segcmd); /* command LC_SEGMENT */ /* size of load command including section load commands */ @@ -1286,6 +1305,25 @@ macho_objfmt_add_default_section(yasm_object *object) macho_section_data *msd; int isnew; + /* Create a dummy __asm marker section with a single zero byte. This tells + * the Apple toolchain that the code came from assembler and has no bitcode. + */ + retval = yasm_object_get_general(object, ".llvmasm", 0, 0, 0, &isnew, 0); + if (isnew) { + yasm_datavalhead dvs; + + msd = yasm_section_get_data(retval, &macho_section_data_cb); + msd->segname = yasm__xstrdup("__LLVM"); + msd->sectname = yasm__xstrdup("__asm"); + yasm_section_set_align(retval, 0, 0); + yasm_dvs_initialize(&dvs); + yasm_dvs_append(&dvs, yasm_dv_create_expr( + yasm_expr_create_ident( + yasm_expr_int(yasm_intnum_create_uint(0)), 0))); + yasm_section_bcs_append(retval, + yasm_bc_create_data(&dvs, 1, 0, object->arch, 0)); + } + retval = yasm_object_get_general(object, "LC_SEGMENT.__TEXT.__text", 0, 1, 0, &isnew, 0); if (isnew) { @@ -1346,6 +1384,7 @@ macho_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, {".const_data", "__DATA", "__const", S_REGULAR, 0}, {".rodata", "__DATA", "__const", S_REGULAR, 0}, {".bss", "__DATA", "__bss", S_ZEROFILL, 0}, + {".llvmasm", "__LLVM", "__asm", S_REGULAR, 0}, {".objc_class_names", "__TEXT", "__cstring", S_CSTRING_LITERALS, 0}, {".objc_meth_var_types","__TEXT", "__cstring", S_CSTRING_LITERALS, 0}, {".objc_meth_var_names","__TEXT", "__cstring", S_CSTRING_LITERALS, 0}, @@ -1554,6 +1593,53 @@ macho_symrec_data_print(void *data, FILE *f, int indent_level) fprintf(f, "nil\n"); } +static void +parse_version(unsigned long *out, const yasm_valparam *vp) +{ + unsigned long major, minor, subminor; + int m; + + if (vp->type != YASM_PARAM_STRING) { + yasm_error_set(YASM_ERROR_VALUE, + N_("argument to `%s' is not a string"), vp->val); + return; + } + + m = sscanf(vp->param.str, "%lu.%lu.%lu", &major, &minor, &subminor); + if (m < 2) { + yasm_error_set(YASM_ERROR_VALUE, + N_("argument to `%s' must be `MAJOR.MINOR[.SUBMINOR]`"), + vp->val); + return; + } + + *out = ((major & 0xffff) << 16) | ((minor & 0xff) << 8) | (subminor & 0xff); +} + +static void +dir_buildversion(yasm_object *object, yasm_valparamhead *valparams, + yasm_valparamhead *objext_valparams, unsigned long line) +{ + yasm_objfmt_macho *objfmt_macho = (yasm_objfmt_macho *)object->objfmt; + yasm_valparam *vp; + + /* Accept, but do nothing with empty ident */ + if (!valparams) + return; + + vp = yasm_vps_first(valparams); + while (vp) { + if (vp->val && yasm__strcasecmp(vp->val, "minos") == 0) { + parse_version(&objfmt_macho->minos, vp); + } else if (vp->val && yasm__strcasecmp(vp->val, "sdk") == 0) { + parse_version(&objfmt_macho->sdk, vp); + } else { + yasm_dir_helper_valparam_warn(object, vp, line, NULL); + } + vp = yasm_vps_next(vp); + } +} + /* Define valid debug formats to use with this object format */ static const char *macho_objfmt_dbgfmt_keywords[] = { @@ -1561,6 +1647,12 @@ static const char *macho_objfmt_dbgfmt_keywords[] = { NULL }; +static const yasm_directive macho_objfmt_directives[] = { + { ".buildversion", "gas", dir_buildversion, YASM_DIR_ANY }, + { "buildversion", "nasm", dir_buildversion, YASM_DIR_ANY }, + { NULL, NULL, NULL, 0 } +}; + /* Define objfmt structure -- see objfmt.h for details */ yasm_objfmt_module yasm_macho_LTX_objfmt = { "Mac OS X ABI Mach-O File Format", @@ -1570,7 +1662,7 @@ yasm_objfmt_module yasm_macho_LTX_objfmt = { 0, macho_objfmt_dbgfmt_keywords, "null", - NULL, /* no directives */ + macho_objfmt_directives, NULL, /* no standard macros */ macho_objfmt_create, macho_objfmt_output, @@ -1589,7 +1681,7 @@ yasm_objfmt_module yasm_macho32_LTX_objfmt = { 0, macho_objfmt_dbgfmt_keywords, "null", - NULL, /* no directives */ + macho_objfmt_directives, NULL, /* no standard macros */ macho32_objfmt_create, macho_objfmt_output, @@ -1608,7 +1700,7 @@ yasm_objfmt_module yasm_macho64_LTX_objfmt = { 0, macho_objfmt_dbgfmt_keywords, "null", - NULL, /* no directives */ + macho_objfmt_directives, NULL, /* no standard macros */ macho64_objfmt_create, macho_objfmt_output, diff --git a/modules/objfmts/macho/tests/gas32/gas-macho32.hex b/modules/objfmts/macho/tests/gas32/gas-macho32.hex index 72cdabde..ba0d6c4d 100644 --- a/modules/objfmts/macho/tests/gas32/gas-macho32.hex +++ b/modules/objfmts/macho/tests/gas32/gas-macho32.hex @@ -14,11 +14,11 @@ fe 00 00 00 -02 +03 00 00 00 -1c +78 01 00 00 @@ -26,11 +26,35 @@ fe 00 00 00 +32 +00 +00 +00 +18 +00 +00 +00 01 00 00 00 +00 04 +0a +00 +00 +04 +0a +00 +00 +00 +00 +00 +01 +00 +00 +00 +48 01 00 00 @@ -54,15 +78,15 @@ fe 00 00 00 -89 +8a 00 00 00 -38 +94 01 00 00 -81 +82 00 00 00 @@ -74,7 +98,75 @@ fe 00 00 00 -03 +04 +00 +00 +00 +00 +00 +00 +00 +5f +5f +61 +73 +6d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +5f +5f +4c +4c +56 +4d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +94 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 00 00 00 @@ -114,7 +206,7 @@ fe 00 00 00 -00 +01 00 00 00 @@ -122,7 +214,7 @@ fe 00 00 00 -38 +95 01 00 00 @@ -130,8 +222,8 @@ fe 00 00 00 -bc -01 +18 +02 00 00 07 @@ -182,7 +274,7 @@ bc 00 00 00 -41 +42 00 00 00 @@ -190,7 +282,7 @@ bc 00 00 00 -79 +d6 01 00 00 @@ -198,8 +290,8 @@ bc 00 00 00 -f4 -01 +50 +02 00 00 03 @@ -250,7 +342,7 @@ f4 00 00 00 -81 +82 00 00 00 @@ -294,7 +386,7 @@ f4 00 00 00 -0c +68 02 00 00 @@ -302,7 +394,7 @@ f4 00 00 00 -6c +c8 02 00 00 @@ -310,6 +402,7 @@ f4 00 00 00 +00 55 89 e5 @@ -328,13 +421,13 @@ ec 5d c3 a1 -81 +82 00 00 00 40 a3 -85 +86 00 00 00 @@ -345,7 +438,7 @@ ff 00 00 a1 -75 +76 00 00 00 @@ -353,13 +446,13 @@ ff 30 ff 35 -81 +82 00 00 00 ff 35 -4e +4f 00 00 00 @@ -427,16 +520,15 @@ c3 64 0a 00 -85 +86 00 00 00 -11 +12 00 00 00 -7d -00 +7e 00 00 00 @@ -446,7 +538,7 @@ c3 00 00 00 -03 +04 00 00 04 @@ -454,7 +546,7 @@ c3 00 00 00 -03 +04 00 00 04 @@ -470,7 +562,7 @@ c3 00 00 00 -02 +03 00 00 04 @@ -478,7 +570,7 @@ c3 00 00 00 -03 +04 00 00 04 @@ -486,7 +578,7 @@ c3 00 00 00 -02 +03 00 00 04 @@ -502,7 +594,7 @@ c3 00 00 00 -03 +04 00 00 04 @@ -510,7 +602,7 @@ c3 00 00 00 -01 +02 00 00 04 @@ -518,7 +610,7 @@ c3 00 00 00 -02 +03 00 00 04 @@ -527,22 +619,22 @@ c3 00 00 0f +02 +00 +00 01 00 00 00 -00 -00 -00 0a 00 00 00 0f -01 +02 00 00 -11 +12 00 00 00 @@ -551,10 +643,10 @@ c3 00 00 0f -02 +03 00 00 -41 +42 00 00 00 @@ -563,10 +655,10 @@ c3 00 00 0f -02 +03 00 00 -79 +7a 00 00 00 @@ -575,10 +667,10 @@ c3 00 00 0f -02 +03 00 00 -7d +7e 00 00 00 @@ -587,10 +679,10 @@ c3 00 00 0f -03 +04 00 00 -81 +82 00 00 00 diff --git a/modules/objfmts/macho/tests/gas64/gas-macho64-pic.hex b/modules/objfmts/macho/tests/gas64/gas-macho64-pic.hex index 83bb7bbf..f84e075b 100644 --- a/modules/objfmts/macho/tests/gas64/gas-macho64-pic.hex +++ b/modules/objfmts/macho/tests/gas64/gas-macho64-pic.hex @@ -14,11 +14,12 @@ fe 00 00 00 -02 +03 00 00 00 -b0 +18 +01 00 00 00 @@ -29,12 +30,35 @@ b0 00 00 00 +32 +00 +00 +00 +18 +00 +00 +00 +01 +00 +00 +00 +00 +05 +0a +00 +00 +05 +0a +00 +00 +00 +00 00 19 00 00 00 -98 +e8 00 00 00 @@ -62,7 +86,7 @@ b0 00 00 00 -34 +35 00 00 00 @@ -70,15 +94,15 @@ b0 00 00 00 -d0 +38 +01 00 00 00 00 00 00 -00 -34 +35 00 00 00 @@ -94,6 +118,54 @@ d0 00 00 00 +02 +00 +00 +00 +00 +00 +00 +00 +5f +5f +61 +73 +6d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +5f +5f +4c +4c +56 +4d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 01 00 00 @@ -102,6 +174,38 @@ d0 00 00 00 +38 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 5f 5f 74 @@ -134,7 +238,7 @@ d0 00 00 00 -00 +01 00 00 00 @@ -150,15 +254,15 @@ d0 00 00 00 -d0 +39 +01 00 00 00 00 00 00 -00 -04 +70 01 00 00 @@ -190,7 +294,7 @@ d0 00 00 00 -44 +b0 01 00 00 @@ -198,7 +302,7 @@ d0 00 00 00 -54 +c0 01 00 00 @@ -206,6 +310,7 @@ d0 00 00 00 +00 e8 00 00 @@ -258,6 +363,9 @@ ff 56 34 12 +00 +00 +00 01 00 00 diff --git a/modules/objfmts/macho/tests/gas64/gas-macho64.hex b/modules/objfmts/macho/tests/gas64/gas-macho64.hex index e4fa4882..6e281529 100644 --- a/modules/objfmts/macho/tests/gas64/gas-macho64.hex +++ b/modules/objfmts/macho/tests/gas64/gas-macho64.hex @@ -14,18 +14,42 @@ fe 00 00 00 -02 +03 00 00 00 +68 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +32 +00 +00 +00 +18 +00 +00 00 01 00 00 00 00 +05 +0a 00 00 +05 +0a +00 00 00 00 @@ -34,43 +58,7 @@ fe 00 00 00 -e8 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -c5 -00 -00 -00 -00 -00 -00 -00 -20 +38 01 00 00 @@ -78,7 +66,43 @@ c5 00 00 00 -c5 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +c6 +00 +00 +00 +00 +00 +00 +00 +88 +01 +00 +00 +00 +00 +00 +00 +c6 00 00 00 @@ -94,7 +118,87 @@ c5 00 00 00 -02 +03 +00 +00 +00 +00 +00 +00 +00 +5f +5f +61 +73 +6d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +5f +5f +4c +4c +56 +4d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +88 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 00 00 00 @@ -134,7 +238,7 @@ c5 00 00 00 -00 +01 00 00 00 @@ -150,7 +254,7 @@ c5 00 00 00 -20 +89 01 00 00 @@ -158,8 +262,8 @@ c5 00 00 00 -e8 -01 +50 +02 00 00 0c @@ -214,7 +318,7 @@ e8 00 00 00 -5d +5e 00 00 00 @@ -230,7 +334,7 @@ e8 00 00 00 -7d +e6 01 00 00 @@ -270,7 +374,7 @@ e8 00 00 00 -48 +b0 02 00 00 @@ -278,7 +382,7 @@ e8 00 00 00 -88 +f0 02 00 00 @@ -286,6 +390,7 @@ e8 00 00 00 +00 e8 00 00 @@ -485,7 +590,6 @@ ff 00 00 00 -00 01 00 00 @@ -603,10 +707,10 @@ ff 00 00 0e -02 +03 00 00 -c5 +c6 00 00 00 @@ -619,10 +723,10 @@ c5 00 00 0e -02 +03 00 00 -b3 +b4 00 00 00 @@ -635,10 +739,10 @@ b3 00 00 0e -02 +03 00 00 -b3 +b4 00 00 00 diff --git a/modules/objfmts/macho/tests/nasm32/macho-reloc.hex b/modules/objfmts/macho/tests/nasm32/macho-reloc.hex index 7ef6e8a1..8dc58940 100644 --- a/modules/objfmts/macho/tests/nasm32/macho-reloc.hex +++ b/modules/objfmts/macho/tests/nasm32/macho-reloc.hex @@ -14,11 +14,127 @@ fe 00 00 00 -02 +03 +00 +00 +00 +34 +01 +00 +00 +00 +00 +00 +00 +32 +00 +00 +00 +18 +00 +00 +00 +01 +00 +00 +00 +00 +04 +0a +00 +00 +04 +0a +00 +00 +00 +00 +00 +01 +00 +00 +00 +04 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +2c +00 +00 +00 +50 +01 +00 +00 +2c +00 +00 +00 +07 +00 +00 +00 +07 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +5f +5f +61 +73 +6d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +5f +5f +4c +4c +56 +4d +00 +00 +00 +00 00 00 00 -d8 00 00 00 @@ -30,7 +146,8 @@ d8 00 00 00 -c0 +50 +01 00 00 00 @@ -54,31 +171,6 @@ c0 00 00 00 -2b -00 -00 -00 -f4 -00 -00 -00 -2b -00 -00 -00 -07 -00 -00 -00 -07 -00 -00 -00 -02 -00 -00 -00 -00 00 00 00 @@ -114,7 +206,7 @@ f4 00 00 00 -00 +01 00 00 00 @@ -122,15 +214,15 @@ f4 00 00 00 -f4 +51 +01 00 00 00 00 00 00 -00 -20 +7c 01 00 00 @@ -182,7 +274,7 @@ f4 00 00 00 -28 +29 00 00 00 @@ -190,7 +282,7 @@ f4 00 00 00 -1c +79 01 00 00 @@ -226,7 +318,7 @@ f4 00 00 00 -58 +b4 01 00 00 @@ -234,7 +326,7 @@ f4 00 00 00 -7c +d8 01 00 00 @@ -242,6 +334,7 @@ f4 00 00 00 +00 b8 02 00 @@ -263,17 +356,17 @@ a1 00 00 b8 -00 -00 -00 -00 -b8 -19 +01 00 00 00 b8 -22 +1a +00 +00 +00 +b8 +23 00 00 00 @@ -285,7 +378,6 @@ b8 05 05 00 -00 01 00 00 @@ -322,7 +414,7 @@ b8 00 00 00 -01 +02 00 00 04 @@ -330,7 +422,7 @@ b8 00 00 00 -01 +02 00 00 04 @@ -338,7 +430,7 @@ b8 00 00 00 -01 +02 00 00 04 @@ -347,10 +439,10 @@ b8 00 00 0f -02 +03 00 00 -29 +2a 00 00 00 diff --git a/modules/objfmts/macho/tests/nasm32/macho32-pext.hex b/modules/objfmts/macho/tests/nasm32/macho32-pext.hex index 6a8eb4f4..c57c549a 100644 --- a/modules/objfmts/macho/tests/nasm32/macho32-pext.hex +++ b/modules/objfmts/macho/tests/nasm32/macho32-pext.hex @@ -14,55 +14,79 @@ fe 00 00 00 +03 +00 +00 +00 +f0 +00 +00 +00 +00 +00 +00 +00 +32 +00 +00 +00 +18 +00 +00 +00 +01 +00 +00 +00 +00 +04 +0a +00 +00 +04 +0a +00 +00 +00 +00 +00 +01 +00 +00 +00 +c0 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 02 00 00 00 -94 -00 -00 -00 -00 -00 -00 -00 +0c 01 00 00 -00 -7c -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -01 -00 -00 -00 -b0 -00 -00 -00 -01 +02 00 00 00 @@ -74,10 +98,78 @@ b0 00 00 00 +02 +00 +00 +00 +00 +00 +00 +00 +5f +5f +61 +73 +6d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +5f +5f +4c +4c +56 +4d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 01 00 00 00 +0c +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 00 00 00 @@ -114,7 +206,7 @@ b0 00 00 00 -00 +01 00 00 00 @@ -122,8 +214,8 @@ b0 00 00 00 -b0 -00 +0d +01 00 00 00 @@ -158,24 +250,24 @@ b0 00 00 00 -b4 -00 +10 +01 00 00 01 00 00 00 -c0 -00 +1c +01 00 00 0a 00 00 00 -c3 00 +c3 00 00 01 @@ -183,14 +275,14 @@ c3 00 00 1f +02 +00 +00 01 00 00 00 00 -00 -00 -00 66 75 6e diff --git a/modules/objfmts/macho/tests/nasm32/macho32-pic.hex b/modules/objfmts/macho/tests/nasm32/macho32-pic.hex index f81f708c..9b92e0bf 100644 --- a/modules/objfmts/macho/tests/nasm32/macho32-pic.hex +++ b/modules/objfmts/macho/tests/nasm32/macho32-pic.hex @@ -14,11 +14,127 @@ fe 00 00 00 -02 +03 +00 +00 +00 +34 +01 +00 +00 +00 +00 +00 +00 +32 +00 +00 +00 +18 +00 +00 +00 +01 +00 +00 +00 +00 +04 +0a +00 +00 +04 +0a +00 +00 +00 +00 +00 +01 +00 +00 +00 +04 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +2a +00 +00 +00 +50 +01 +00 +00 +2a +00 +00 +00 +07 +00 +00 +00 +07 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +5f +5f +61 +73 +6d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +5f +5f +4c +4c +56 +4d +00 +00 +00 +00 00 00 00 -d8 00 00 00 @@ -30,7 +146,8 @@ d8 00 00 00 -c0 +50 +01 00 00 00 @@ -54,31 +171,6 @@ c0 00 00 00 -29 -00 -00 -00 -f4 -00 -00 -00 -29 -00 -00 -00 -07 -00 -00 -00 -07 -00 -00 -00 -02 -00 -00 -00 -00 00 00 00 @@ -114,7 +206,7 @@ f4 00 00 00 -00 +01 00 00 00 @@ -122,15 +214,15 @@ f4 00 00 00 -f4 +51 +01 00 00 00 00 00 00 -00 -20 +7c 01 00 00 @@ -182,7 +274,7 @@ f4 00 00 00 -29 +2a 00 00 00 @@ -190,7 +282,7 @@ f4 00 00 00 -1d +7a 01 00 00 @@ -226,7 +318,7 @@ f4 00 00 00 -40 +9c 01 00 00 @@ -234,7 +326,7 @@ f4 00 00 00 -4c +a8 01 00 00 @@ -242,8 +334,9 @@ f4 00 00 00 +00 e9 -24 +25 00 00 00 @@ -267,13 +360,13 @@ ed 8d 9c e9 -0c +0d 00 00 00 5d e9 -06 +07 00 00 00 @@ -285,12 +378,11 @@ ff c3 00 00 -00 01 00 00 00 -02 +03 00 00 05 @@ -298,7 +390,7 @@ c3 00 00 00 -02 +03 00 00 05 @@ -306,7 +398,7 @@ c3 00 00 00 -02 +03 00 00 05 diff --git a/modules/objfmts/macho/tests/nasm32/macho32-sect.hex b/modules/objfmts/macho/tests/nasm32/macho32-sect.hex index aeaec6f9..d4e35f01 100644 --- a/modules/objfmts/macho/tests/nasm32/macho32-sect.hex +++ b/modules/objfmts/macho/tests/nasm32/macho32-sect.hex @@ -14,15 +14,23 @@ fe 00 00 00 -01 -00 -00 -00 -e0 02 00 00 00 +3c +03 +00 +00 +00 +00 +00 +00 +32 +00 +00 +00 +18 00 00 00 @@ -30,53 +38,137 @@ e0 00 00 00 -e0 -02 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -00 -fc -02 -00 -00 -00 -00 -00 -00 -07 -00 -00 -00 -07 -00 -00 00 +04 0a 00 00 +04 +0a +00 +00 +00 +00 +00 +01 +00 +00 +00 +24 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +58 +03 +00 +00 +01 +00 +00 +00 +07 +00 +00 +00 +07 +00 +00 +00 +0b +00 +00 +00 +00 +00 +00 +00 +5f +5f +61 +73 +6d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +5f +5f +4c +4c +56 +4d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +70 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 00 00 00 @@ -114,6 +206,7 @@ fc 00 00 00 +01 00 00 00 @@ -121,8 +214,7 @@ fc 00 00 00 -00 -14 +71 03 00 00 @@ -182,6 +274,7 @@ fc 00 00 00 +01 00 00 00 @@ -189,8 +282,7 @@ fc 00 00 00 -00 -14 +71 03 00 00 @@ -250,6 +342,7 @@ fc 00 00 00 +01 00 00 00 @@ -257,8 +350,7 @@ fc 00 00 00 -00 -14 +71 03 00 00 @@ -318,6 +410,7 @@ fc 00 00 00 +01 00 00 00 @@ -325,8 +418,7 @@ fc 00 00 00 -00 -14 +71 03 00 00 @@ -386,6 +478,7 @@ fc 00 00 00 +01 00 00 00 @@ -393,8 +486,7 @@ fc 00 00 00 -00 -14 +71 03 00 00 @@ -454,6 +546,7 @@ fc 00 00 00 +01 00 00 00 @@ -461,8 +554,7 @@ fc 00 00 00 -00 -14 +71 03 00 00 @@ -522,6 +614,7 @@ fc 00 00 00 +01 00 00 00 @@ -529,8 +622,7 @@ fc 00 00 00 -00 -14 +71 03 00 00 @@ -590,6 +682,7 @@ fc 45 47 4e +01 00 00 00 @@ -597,8 +690,7 @@ fc 00 00 00 -00 -14 +71 03 00 00 @@ -658,6 +750,7 @@ fc 00 00 00 +01 00 00 00 @@ -665,8 +758,7 @@ fc 00 00 00 -00 -14 +71 03 00 00 @@ -726,6 +818,7 @@ fc 53 45 47 +01 00 00 00 @@ -733,8 +826,7 @@ fc 00 00 00 -00 -14 +71 03 00 00 @@ -770,7 +862,7 @@ fc 00 00 00 -14 +74 03 00 00 @@ -778,7 +870,7 @@ fc 00 00 00 -14 +74 03 00 00 @@ -787,3 +879,7 @@ fc 00 00 00 +00 +00 +00 +00 diff --git a/modules/objfmts/macho/tests/nasm32/macho32-size.hex b/modules/objfmts/macho/tests/nasm32/macho32-size.hex index 2ed324ea..3ae12b81 100644 --- a/modules/objfmts/macho/tests/nasm32/macho32-size.hex +++ b/modules/objfmts/macho/tests/nasm32/macho32-size.hex @@ -14,11 +14,127 @@ fe 00 00 00 -02 +03 +00 +00 +00 +34 +01 +00 +00 +00 +00 +00 +00 +32 +00 +00 +00 +18 +00 +00 +00 +01 +00 +00 +00 +00 +04 +0a +00 +00 +04 +0a +00 +00 +00 +00 +00 +01 +00 +00 +00 +04 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +48 +00 +00 +00 +50 +01 +00 +00 +2f +00 +00 +00 +07 +00 +00 +00 +07 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +5f +5f +61 +73 +6d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +5f +5f +4c +4c +56 +4d +00 +00 +00 +00 00 00 00 -d8 00 00 00 @@ -30,7 +146,8 @@ d8 00 00 00 -c0 +50 +01 00 00 00 @@ -54,31 +171,6 @@ c0 00 00 00 -38 -00 -00 -00 -f4 -00 -00 -00 -2e -00 -00 -00 -07 -00 -00 -00 -07 -00 -00 -00 -02 -00 -00 -00 -00 00 00 00 @@ -114,7 +206,7 @@ f4 00 00 00 -00 +10 00 00 00 @@ -122,15 +214,15 @@ f4 00 00 00 -f4 -00 +51 +01 00 00 04 00 00 00 -24 +80 01 00 00 @@ -182,7 +274,7 @@ f4 00 00 00 -30 +40 00 00 00 @@ -190,7 +282,7 @@ f4 00 00 00 -1a +77 01 00 00 @@ -226,7 +318,7 @@ f4 00 00 00 -2c +88 01 00 00 @@ -234,7 +326,7 @@ f4 00 00 00 -38 +94 01 00 00 @@ -242,6 +334,7 @@ f4 00 00 00 +00 53 52 56 @@ -270,7 +363,7 @@ f4 0f 6f 35 -30 +40 00 00 00 @@ -289,12 +382,11 @@ ff ff 00 00 -00 1c 00 00 00 -02 +03 00 00 04 @@ -303,10 +395,10 @@ ff 00 00 0f -01 -00 +02 00 00 +10 00 00 00 diff --git a/modules/objfmts/macho/tests/nasm32/machotest.hex b/modules/objfmts/macho/tests/nasm32/machotest.hex index e6791e4e..e4c5442a 100644 --- a/modules/objfmts/macho/tests/nasm32/machotest.hex +++ b/modules/objfmts/macho/tests/nasm32/machotest.hex @@ -14,11 +14,11 @@ fe 00 00 00 -02 +03 00 00 00 -1c +78 01 00 00 @@ -26,11 +26,35 @@ fe 00 00 00 +32 +00 +00 +00 +18 +00 +00 +00 01 00 00 00 +00 04 +0a +00 +00 +04 +0a +00 +00 +00 +00 +00 +01 +00 +00 +00 +48 01 00 00 @@ -54,15 +78,15 @@ fe 00 00 00 -8f +90 00 00 00 -38 +94 01 00 00 -87 +88 00 00 00 @@ -74,7 +98,75 @@ fe 00 00 00 -03 +04 +00 +00 +00 +00 +00 +00 +00 +5f +5f +61 +73 +6d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +5f +5f +4c +4c +56 +4d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +94 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 00 00 00 @@ -114,7 +206,7 @@ fe 00 00 00 -00 +01 00 00 00 @@ -122,7 +214,7 @@ fe 00 00 00 -38 +95 01 00 00 @@ -130,8 +222,8 @@ fe 00 00 00 -c0 -01 +1c +02 00 00 07 @@ -182,7 +274,7 @@ c0 00 00 00 -47 +48 00 00 00 @@ -190,7 +282,7 @@ c0 00 00 00 -7f +dc 01 00 00 @@ -198,8 +290,8 @@ c0 00 00 00 -f8 -01 +54 +02 00 00 03 @@ -250,7 +342,7 @@ f8 00 00 00 -87 +88 00 00 00 @@ -294,7 +386,7 @@ f8 00 00 00 -10 +6c 02 00 00 @@ -302,7 +394,7 @@ f8 00 00 00 -70 +cc 02 00 00 @@ -310,6 +402,7 @@ f8 00 00 00 +00 55 89 e5 @@ -328,13 +421,13 @@ ec 5d c3 a1 -87 +88 00 00 00 40 a3 -8b +8c 00 00 00 @@ -345,7 +438,7 @@ ff 00 00 a1 -7b +7c 00 00 00 @@ -353,12 +446,12 @@ ff 30 ff 35 -87 +88 00 00 00 68 -54 +55 00 00 00 @@ -433,16 +526,7 @@ ff 64 0a 00 -8b -00 -00 -00 -11 -00 -00 -00 -83 -00 +8c 00 00 00 @@ -450,7 +534,15 @@ ff 00 00 00 -03 +84 +00 +00 +00 +12 +00 +00 +00 +04 00 00 04 @@ -458,7 +550,7 @@ ff 00 00 00 -03 +04 00 00 04 @@ -474,7 +566,7 @@ ff 00 00 00 -02 +03 00 00 04 @@ -482,7 +574,7 @@ ff 00 00 00 -03 +04 00 00 04 @@ -490,7 +582,7 @@ ff 00 00 00 -02 +03 00 00 04 @@ -506,7 +598,7 @@ ff 00 00 00 -03 +04 00 00 04 @@ -514,7 +606,7 @@ ff 00 00 00 -01 +02 00 00 04 @@ -522,7 +614,7 @@ ff 00 00 00 -02 +03 00 00 04 @@ -531,22 +623,22 @@ ff 00 00 0f +02 +00 +00 01 00 00 00 -00 -00 -00 0a 00 00 00 0f -01 +02 00 00 -11 +12 00 00 00 @@ -555,10 +647,10 @@ ff 00 00 0f -02 +03 00 00 -47 +48 00 00 00 @@ -567,10 +659,10 @@ ff 00 00 0f -02 +03 00 00 -7f +80 00 00 00 @@ -579,10 +671,10 @@ ff 00 00 0f -02 +03 00 00 -83 +84 00 00 00 @@ -591,10 +683,10 @@ ff 00 00 0f -03 +04 00 00 -87 +88 00 00 00 diff --git a/modules/objfmts/macho/tests/nasm64/macho64-buildversion.asm b/modules/objfmts/macho/tests/nasm64/macho64-buildversion.asm new file mode 100644 index 00000000..a277f7c4 --- /dev/null +++ b/modules/objfmts/macho/tests/nasm64/macho64-buildversion.asm @@ -0,0 +1,2 @@ +[buildversion minos="10.14.2" sdk="10.7"] + diff --git a/modules/objfmts/macho/tests/nasm64/macho64-buildversion.hex b/modules/objfmts/macho/tests/nasm64/macho64-buildversion.hex new file mode 100644 index 00000000..bbb9efaa --- /dev/null +++ b/modules/objfmts/macho/tests/nasm64/macho64-buildversion.hex @@ -0,0 +1,317 @@ +cf +fa +ed +fe +07 +00 +00 +01 +03 +00 +00 +00 +01 +00 +00 +00 +02 +00 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +32 +00 +00 +00 +18 +00 +00 +00 +01 +00 +00 +00 +02 +0e +0a +00 +02 +07 +0a +00 +00 +00 +00 +00 +19 +00 +00 +00 +e8 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +20 +01 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +07 +00 +00 +00 +07 +00 +00 +00 +02 +00 +00 +00 +00 +00 +00 +00 +5f +5f +61 +73 +6d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +5f +5f +4c +4c +56 +4d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +38 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +5f +5f +74 +65 +78 +74 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +5f +5f +54 +45 +58 +54 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +39 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +80 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +18 +00 +00 +00 +3c +01 +00 +00 +00 +00 +00 +00 +3c +01 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 diff --git a/modules/objfmts/macho/tests/nasm64/machotest64.hex b/modules/objfmts/macho/tests/nasm64/machotest64.hex index 21395186..e8b38768 100644 --- a/modules/objfmts/macho/tests/nasm64/machotest64.hex +++ b/modules/objfmts/macho/tests/nasm64/machotest64.hex @@ -14,11 +14,11 @@ fe 00 00 00 -02 +03 00 00 00 -50 +b8 01 00 00 @@ -30,11 +30,35 @@ fe 00 00 00 +32 +00 +00 +00 +18 +00 +00 +00 +01 +00 +00 +00 +00 +05 +0a +00 +00 +05 +0a +00 +00 +00 +00 +00 19 00 00 00 -38 +88 01 00 00 @@ -62,7 +86,7 @@ fe 00 00 00 -d6 +d7 00 00 00 @@ -70,7 +94,7 @@ d6 00 00 00 -70 +d8 01 00 00 @@ -78,7 +102,7 @@ d6 00 00 00 -c6 +c7 00 00 00 @@ -94,7 +118,87 @@ c6 00 00 00 -03 +04 +00 +00 +00 +00 +00 +00 +00 +5f +5f +61 +73 +6d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +5f +5f +4c +4c +56 +4d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +d8 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 00 00 00 @@ -134,7 +238,7 @@ c6 00 00 00 -00 +01 00 00 00 @@ -150,7 +254,7 @@ c6 00 00 00 -70 +d9 01 00 00 @@ -158,7 +262,7 @@ c6 00 00 00 -38 +a0 02 00 00 @@ -214,7 +318,7 @@ c6 00 00 00 -7a +7b 00 00 00 @@ -230,15 +334,15 @@ c6 00 00 00 -ea -01 +53 +02 00 00 00 00 00 00 -88 +f0 02 00 00 @@ -294,7 +398,7 @@ ea 00 00 00 -c6 +c7 00 00 00 @@ -350,15 +454,15 @@ c6 00 00 00 -a0 -02 +08 +03 00 00 0f 00 00 00 -90 +f8 03 00 00 @@ -366,6 +470,7 @@ a0 00 00 00 +00 51 48 89 @@ -565,7 +670,6 @@ ff 64 00 00 -00 10 00 00 @@ -675,6 +779,9 @@ ff 00 00 0f +02 +00 +00 01 00 00 @@ -683,18 +790,15 @@ ff 00 00 00 -00 -00 -00 0a 00 00 00 0f -01 +02 00 00 -2f +30 00 00 00 @@ -707,10 +811,10 @@ ff 00 00 0f -02 +03 00 00 -b9 +ba 00 00 00 @@ -723,10 +827,10 @@ b9 00 00 0f -02 +03 00 00 -a9 +aa 00 00 00 @@ -739,10 +843,10 @@ a9 00 00 0f -02 +03 00 00 -b1 +b2 00 00 00 @@ -755,10 +859,10 @@ b1 00 00 0f -03 +04 00 00 -c6 +c7 00 00 00 @@ -803,10 +907,10 @@ c6 00 00 0f -01 +02 00 00 -0e +0f 00 00 00 @@ -819,10 +923,10 @@ c6 00 00 0f -01 +02 00 00 -19 +1a 00 00 00 @@ -835,10 +939,10 @@ c6 00 00 0e -01 +02 00 00 -07 +08 00 00 00 @@ -851,10 +955,10 @@ c6 00 00 0e -03 +04 00 00 -ce +cf 00 00 00 @@ -867,10 +971,10 @@ ce 00 00 0e -01 +02 00 00 -24 +25 00 00 00 @@ -883,10 +987,10 @@ ce 00 00 0e -02 +03 00 00 -a1 +a2 00 00 00 @@ -899,10 +1003,10 @@ a1 00 00 0e -02 +03 00 00 -7a +7b 00 00 00 diff --git a/modules/objfmts/macho/tests/nasm64/nasm-macho64-pic.hex b/modules/objfmts/macho/tests/nasm64/nasm-macho64-pic.hex index 83bb7bbf..f84e075b 100644 --- a/modules/objfmts/macho/tests/nasm64/nasm-macho64-pic.hex +++ b/modules/objfmts/macho/tests/nasm64/nasm-macho64-pic.hex @@ -14,11 +14,12 @@ fe 00 00 00 -02 +03 00 00 00 -b0 +18 +01 00 00 00 @@ -29,12 +30,35 @@ b0 00 00 00 +32 +00 +00 +00 +18 +00 +00 +00 +01 +00 +00 +00 +00 +05 +0a +00 +00 +05 +0a +00 +00 +00 +00 00 19 00 00 00 -98 +e8 00 00 00 @@ -62,7 +86,7 @@ b0 00 00 00 -34 +35 00 00 00 @@ -70,15 +94,15 @@ b0 00 00 00 -d0 +38 +01 00 00 00 00 00 00 -00 -34 +35 00 00 00 @@ -94,6 +118,54 @@ d0 00 00 00 +02 +00 +00 +00 +00 +00 +00 +00 +5f +5f +61 +73 +6d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +5f +5f +4c +4c +56 +4d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 01 00 00 @@ -102,6 +174,38 @@ d0 00 00 00 +38 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 5f 5f 74 @@ -134,7 +238,7 @@ d0 00 00 00 -00 +01 00 00 00 @@ -150,15 +254,15 @@ d0 00 00 00 -d0 +39 +01 00 00 00 00 00 00 -00 -04 +70 01 00 00 @@ -190,7 +294,7 @@ d0 00 00 00 -44 +b0 01 00 00 @@ -198,7 +302,7 @@ d0 00 00 00 -54 +c0 01 00 00 @@ -206,6 +310,7 @@ d0 00 00 00 +00 e8 00 00 @@ -258,6 +363,9 @@ ff 56 34 12 +00 +00 +00 01 00 00 From 9d02e0f49d7a317167af94ab1c825892530d6309 Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Thu, 27 Jan 2022 16:25:55 +0000 Subject: [PATCH 530/585] Update Visual Studio build to Visual STudio 2022 --- Mkfiles/vs/genmacro/genmacro.vcxproj | 8 ++++---- Mkfiles/vs/genmodule/genmodule.vcxproj | 8 ++++---- Mkfiles/vs/genperf/genperf.vcxproj | 8 ++++---- Mkfiles/vs/genstring/genstring.vcxproj | 8 ++++---- Mkfiles/vs/genversion/genversion.vcxproj | 8 ++++---- Mkfiles/vs/libyasm/libyasm.vcxproj | 8 ++++---- Mkfiles/vs/modules/modules.vcxproj | 8 ++++---- Mkfiles/vs/re2c/re2c.vcxproj | 8 ++++---- Mkfiles/vs/vsyasm.vcxproj | 8 ++++---- Mkfiles/vs/yasm.vcxproj | 8 ++++---- Mkfiles/vs/ytasm.vcxproj | 8 ++++---- 11 files changed, 44 insertions(+), 44 deletions(-) diff --git a/Mkfiles/vs/genmacro/genmacro.vcxproj b/Mkfiles/vs/genmacro/genmacro.vcxproj index 244a7608..3ecedc7c 100644 --- a/Mkfiles/vs/genmacro/genmacro.vcxproj +++ b/Mkfiles/vs/genmacro/genmacro.vcxproj @@ -28,22 +28,22 @@ Application MultiByte - v142 + v143 Application MultiByte - v142 + v143 Application MultiByte - v142 + v143 Application MultiByte - v142 + v143 diff --git a/Mkfiles/vs/genmodule/genmodule.vcxproj b/Mkfiles/vs/genmodule/genmodule.vcxproj index f76065ae..9a8459cd 100644 --- a/Mkfiles/vs/genmodule/genmodule.vcxproj +++ b/Mkfiles/vs/genmodule/genmodule.vcxproj @@ -28,22 +28,22 @@ Application MultiByte - v142 + v143 Application MultiByte - v142 + v143 Application MultiByte - v142 + v143 Application MultiByte - v142 + v143 diff --git a/Mkfiles/vs/genperf/genperf.vcxproj b/Mkfiles/vs/genperf/genperf.vcxproj index c03986a4..8f193269 100644 --- a/Mkfiles/vs/genperf/genperf.vcxproj +++ b/Mkfiles/vs/genperf/genperf.vcxproj @@ -28,22 +28,22 @@ Application MultiByte - v142 + v143 Application MultiByte - v142 + v143 Application MultiByte - v142 + v143 Application MultiByte - v142 + v143 diff --git a/Mkfiles/vs/genstring/genstring.vcxproj b/Mkfiles/vs/genstring/genstring.vcxproj index 435ec6f1..8745dd9d 100644 --- a/Mkfiles/vs/genstring/genstring.vcxproj +++ b/Mkfiles/vs/genstring/genstring.vcxproj @@ -28,22 +28,22 @@ Application MultiByte - v142 + v143 Application MultiByte - v142 + v143 Application MultiByte - v142 + v143 Application MultiByte - v142 + v143 diff --git a/Mkfiles/vs/genversion/genversion.vcxproj b/Mkfiles/vs/genversion/genversion.vcxproj index e0f26a82..7adf9c7f 100644 --- a/Mkfiles/vs/genversion/genversion.vcxproj +++ b/Mkfiles/vs/genversion/genversion.vcxproj @@ -28,22 +28,22 @@ Application MultiByte - v142 + v143 Application MultiByte - v142 + v143 Application MultiByte - v142 + v143 Application MultiByte - v142 + v143 diff --git a/Mkfiles/vs/libyasm/libyasm.vcxproj b/Mkfiles/vs/libyasm/libyasm.vcxproj index c5237d1a..f3505f4c 100644 --- a/Mkfiles/vs/libyasm/libyasm.vcxproj +++ b/Mkfiles/vs/libyasm/libyasm.vcxproj @@ -28,25 +28,25 @@ StaticLibrary false MultiByte - v142 + v143 StaticLibrary false MultiByte - v142 + v143 StaticLibrary false MultiByte - v142 + v143 StaticLibrary false MultiByte - v142 + v143 diff --git a/Mkfiles/vs/modules/modules.vcxproj b/Mkfiles/vs/modules/modules.vcxproj index f50de3bb..e915a491 100644 --- a/Mkfiles/vs/modules/modules.vcxproj +++ b/Mkfiles/vs/modules/modules.vcxproj @@ -28,25 +28,25 @@ StaticLibrary false MultiByte - v142 + v143 StaticLibrary false MultiByte - v142 + v143 StaticLibrary false MultiByte - v142 + v143 StaticLibrary false MultiByte - v142 + v143 diff --git a/Mkfiles/vs/re2c/re2c.vcxproj b/Mkfiles/vs/re2c/re2c.vcxproj index eb5639ef..51318291 100644 --- a/Mkfiles/vs/re2c/re2c.vcxproj +++ b/Mkfiles/vs/re2c/re2c.vcxproj @@ -28,22 +28,22 @@ Application MultiByte - v142 + v143 Application MultiByte - v142 + v143 Application MultiByte - v142 + v143 Application MultiByte - v142 + v143 diff --git a/Mkfiles/vs/vsyasm.vcxproj b/Mkfiles/vs/vsyasm.vcxproj index 8c4c3920..bd018821 100644 --- a/Mkfiles/vs/vsyasm.vcxproj +++ b/Mkfiles/vs/vsyasm.vcxproj @@ -28,25 +28,25 @@ Application false MultiByte - v142 + v143 Application false MultiByte - v142 + v143 Application false MultiByte - v142 + v143 Application false MultiByte - v142 + v143 diff --git a/Mkfiles/vs/yasm.vcxproj b/Mkfiles/vs/yasm.vcxproj index 3e3d0421..bceedf94 100644 --- a/Mkfiles/vs/yasm.vcxproj +++ b/Mkfiles/vs/yasm.vcxproj @@ -28,25 +28,25 @@ Application false MultiByte - v142 + v143 Application false MultiByte - v142 + v143 Application false MultiByte - v142 + v143 Application false MultiByte - v142 + v143 diff --git a/Mkfiles/vs/ytasm.vcxproj b/Mkfiles/vs/ytasm.vcxproj index 38e35ae3..7cf165a9 100644 --- a/Mkfiles/vs/ytasm.vcxproj +++ b/Mkfiles/vs/ytasm.vcxproj @@ -28,25 +28,25 @@ Application false MultiByte - v142 + v143 Application false MultiByte - v142 + v143 Application false MultiByte - v142 + v143 Application false MultiByte - v142 + v143 From 101bca9ca8ef3c07de9432dfae6e5c182ad00932 Mon Sep 17 00:00:00 2001 From: MonicaLiu <110024546+MonicaLiu0311@users.noreply.github.com> Date: Thu, 15 Sep 2022 07:38:24 +0800 Subject: [PATCH 531/585] Add vcpkg installation instructions (#200) Co-authored-by: Monica --- INSTALL | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/INSTALL b/INSTALL index b42a17ac..29a2b29e 100644 --- a/INSTALL +++ b/INSTALL @@ -51,6 +51,18 @@ The simplest way to compile this package is: all sorts of other programs in order to regenerate files that came with the distribution. +Installation using vcpkg +================== +You can build and install yasm using [vcpkg](https://github.com/Microsoft/vcpkg/) dependency manager: + + `git clone https://github.com/Microsoft/vcpkg.git' + `cd vcpkg' + `./bootstrap-vcpkg.sh' # `./bootstrap-vcpkg.bat' for Windows + `./vcpkg integrate install' + `./vcpkg install yasm' + +The yasm port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository. + Compilers and Options ===================== From 05a52bab7511a834fd197b76c3ffbee744401e78 Mon Sep 17 00:00:00 2001 From: Siddhesh Poyarekar Date: Sat, 13 May 2023 00:06:18 -0400 Subject: [PATCH 532/585] Introduce a security policy and add text to the README (#223) Add a SECURITY.md that disclaims almost all bugs as security issues. --- README | 13 +++++++++++++ SECURITY.md | 27 +++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 SECURITY.md diff --git a/README b/README index e69de29b..6d529727 100644 --- a/README +++ b/README @@ -0,0 +1,13 @@ +The Yasm Modular Assembler Project +================================== + +Yasm is a complete rewrite of the NASM assembler under the “new” BSD License +(some portions are under other licenses, see COPYING for details). + +Yasm currently supports the x86 and AMD64 instruction sets, accepts NASM and +GAS assembler syntaxes, outputs binary, ELF32, ELF64, 32 and 64-bit Mach-O, +RDOFF2, COFF, Win32, and Win64 object formats, and generates source debugging +information in STABS, DWARF 2, and CodeView 8 formats. + +Yasm can be easily integrated into Visual Studio 2005/2008 and 2010 for +assembly of NASM or GAS syntax code into Win32 or Win64 object files. diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 00000000..d205e244 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,27 @@ +Yasm Security policy +==================== + +A security bug is one that compromises the security of a system by either +making it unavailable, compromising the integrity of the data or by providing +unauthorized access to resources on the system through untrusted inputs. In +the context of yasm, it is expected that all inputs are trusted, since it is +developer code. It is the responsibility of the developer to either verify the +authenticity of the code they're building or to build untrusted code in a +sandbox to protect the system from any ill effects. This responsibility also +extends to the libyasm library. While the library aims to be robust and will +fix bugs arising from bogus inputs, it is the responsibility of the application +to ensure that either the environment under which the call is made is isolated +or that the input is sanitized. + +As such, all bugs will be deemed to have no security consequence with the +exception of bugs where yasm generates code that invoke [undefined behaviour in +a +system](https://www.cs.cmu.edu/~rdriley/487/papers/Thompson_1984_ReflectionsonTrustingTrust.pdf) +from valid, safe and trusted assembly code. + +Reporting security bugs +----------------------- + +To report security issues privately, you may reach out to one of the members of +the [Yasm Team](https://github.com/yasm/yasm/wiki/Yasmteam). Most issues +should just go into GitHub issues as regular bugs. From a277a590f00c13aed1d4244653e8bbab3c2d3558 Mon Sep 17 00:00:00 2001 From: Biswapriyo Nath Date: Sat, 13 May 2023 09:36:53 +0530 Subject: [PATCH 533/585] Fix detecting Windows platform (#204) This replaces _MSC_VER macro with _WIN32 because the former one is for MSVC and Visual Studio only and is not defined in mingw environment. Wherease, _WIN32 macro is the proper way to check Windows platform irrespective of compiler toolchain. See the following official link for more info https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros --- frontends/yasm/yasm-plugin.c | 10 +++++----- libyasm-stdint.h.cmake | 2 +- modules/CMakeLists.txt | 2 +- plugins/dbg/init_plugin.c | 2 +- plugins/x86/init_plugin.c | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/frontends/yasm/yasm-plugin.c b/frontends/yasm/yasm-plugin.c index c64edc32..573ab45b 100644 --- a/frontends/yasm/yasm-plugin.c +++ b/frontends/yasm/yasm-plugin.c @@ -31,7 +31,7 @@ #include "libyasm-stdint.h" #include "yasm-plugin.h" -#if defined(_MSC_VER) +#if defined(_WIN32) #include #elif defined(__GNUC__) #include @@ -43,7 +43,7 @@ static int num_loaded_plugins = 0; static void * load_dll(const char *name) { -#if defined(_MSC_VER) +#if defined(_WIN32) return LoadLibrary(name); #elif defined(__GNUC__) return dlopen(name, RTLD_NOW); @@ -62,7 +62,7 @@ load_plugin(const char *name) /* Load library */ path = yasm_xmalloc(strlen(name)+10); -#if defined(_MSC_VER) +#if defined(_WIN32) strcpy(path, name); strcat(path, ".dll"); lib = load_dll(path); @@ -92,7 +92,7 @@ load_plugin(const char *name) /* Get yasm_init_plugin() function and run it */ -#if defined(_MSC_VER) +#if defined(_WIN32) init_plugin = (void (*)(void))GetProcAddress((HINSTANCE)lib, "yasm_init_plugin"); #elif defined(__GNUC__) @@ -115,7 +115,7 @@ unload_plugins(void) return; for (i = 0; i < num_loaded_plugins; i++) { -#if defined(_MSC_VER) +#if defined(_WIN32) FreeLibrary((HINSTANCE)loaded_plugins[i]); #elif defined(__GNUC__) dlclose(loaded_plugins[i]); diff --git a/libyasm-stdint.h.cmake b/libyasm-stdint.h.cmake index 3759a035..049037d5 100644 --- a/libyasm-stdint.h.cmake +++ b/libyasm-stdint.h.cmake @@ -26,7 +26,7 @@ typedef unsigned long uintptr_t; #endif #ifndef YASM_LIB_DECL -# if defined(BUILD_SHARED_LIBS) && defined(_MSC_VER) +# if defined(BUILD_SHARED_LIBS) && defined(_WIN32) # ifdef YASM_LIB_SOURCE # define YASM_LIB_DECL __declspec(dllexport) # else diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt index e3f8eb11..b6eceb0e 100644 --- a/modules/CMakeLists.txt +++ b/modules/CMakeLists.txt @@ -57,7 +57,7 @@ IF(regen_init_plugin_c) "extern yasm_${_type}_module yasm_${_keyword}_LTX_${_type};\n") ENDFOREACH(module) IF(BUILD_SHARED_LIBS) - FILE(APPEND ${INIT_PLUGIN_C} "\n#ifdef _MSC_VER\n") + FILE(APPEND ${INIT_PLUGIN_C} "\n#ifdef _WIN32\n") FILE(APPEND ${INIT_PLUGIN_C} "__declspec(dllexport)\n") FILE(APPEND ${INIT_PLUGIN_C} "#endif\n") ENDIF(BUILD_SHARED_LIBS) diff --git a/plugins/dbg/init_plugin.c b/plugins/dbg/init_plugin.c index e8e53dc5..5c4eb6aa 100644 --- a/plugins/dbg/init_plugin.c +++ b/plugins/dbg/init_plugin.c @@ -3,7 +3,7 @@ extern yasm_arch_module yasm_dbg_LTX_objfmt; -#ifdef _MSC_VER +#ifdef _WIN32 __declspec(dllexport) #endif void diff --git a/plugins/x86/init_plugin.c b/plugins/x86/init_plugin.c index d2698b19..39a94ed0 100644 --- a/plugins/x86/init_plugin.c +++ b/plugins/x86/init_plugin.c @@ -3,7 +3,7 @@ extern yasm_arch_module yasm_x86_LTX_arch; -#ifdef _MSC_VER +#ifdef _WIN32 __declspec(dllexport) #endif void From 61e374f24718975e8175f048e70afaaf0c4771a9 Mon Sep 17 00:00:00 2001 From: Ismo Puustinen Date: Sat, 13 May 2023 07:07:35 +0300 Subject: [PATCH 534/585] Remove __DATE__ from version strings (#198) Having __DATE__ is causing compilation errors when it's defined by Bazel build tool like this: -D__DATE__=redacted --- frontends/tasm/tasm.c | 1 - frontends/vsyasm/vsyasm.c | 1 - frontends/yasm/yasm.c | 1 - 3 files changed, 3 deletions(-) diff --git a/frontends/tasm/tasm.c b/frontends/tasm/tasm.c index 93c11c98..353f8c58 100644 --- a/frontends/tasm/tasm.c +++ b/frontends/tasm/tasm.c @@ -228,7 +228,6 @@ static opt_option options[] = /* version message */ /*@observer@*/ static const char *version_msg[] = { PACKAGE_STRING, - "Compiled on " __DATE__ ".", "Copyright (c) 2001-2010 Peter Johnson and other Yasm developers.", "Run yasm --license for licensing overview and summary." }; diff --git a/frontends/vsyasm/vsyasm.c b/frontends/vsyasm/vsyasm.c index 892b9b33..b3a5a592 100644 --- a/frontends/vsyasm/vsyasm.c +++ b/frontends/vsyasm/vsyasm.c @@ -220,7 +220,6 @@ static opt_option options[] = /* version message */ /*@observer@*/ static const char *version_msg[] = { PACKAGE_STRING, - "Compiled on " __DATE__ ".", "Copyright (c) 2001-2010 Peter Johnson and other Yasm developers.", "Run yasm --license for licensing overview and summary." }; diff --git a/frontends/yasm/yasm.c b/frontends/yasm/yasm.c index bc6f379a..7ac141e6 100644 --- a/frontends/yasm/yasm.c +++ b/frontends/yasm/yasm.c @@ -219,7 +219,6 @@ static opt_option options[] = /* version message */ /*@observer@*/ static const char *version_msg[] = { PACKAGE_STRING, - "Compiled on " __DATE__ ".", "Copyright (c) 2001-2014 Peter Johnson and other Yasm developers.", "Run yasm --license for licensing overview and summary." }; From bfe1bc257d6d177fb495c52b0bc2a1719d8eba6b Mon Sep 17 00:00:00 2001 From: liuxiang88 <94350585+liuxiang88@users.noreply.github.com> Date: Sat, 13 May 2023 12:08:50 +0800 Subject: [PATCH 535/585] Add EM for loongarch (#192) --- modules/objfmts/elf/elf.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/objfmts/elf/elf.h b/modules/objfmts/elf/elf.h index fce629ae..69ed3f01 100644 --- a/modules/objfmts/elf/elf.h +++ b/modules/objfmts/elf/elf.h @@ -75,7 +75,8 @@ typedef enum { EM_SPARCV9 = 43, /* SPARC v9 64-bit */ EM_IA_64 = 50, /* Intel IA-64 */ EM_X86_64 = 62, /* AMD x86-64 */ - EM_ALPHA = 0x9026 /* Alpha (no ABI) */ + EM_ALPHA = 0x9026, /* Alpha (no ABI) */ + EM_LOONGARCH = 258 /* loongson LoongArch */ } elf_machine; typedef enum { From 93a960bc7da77eceb868d0dd5886c6fb844daee0 Mon Sep 17 00:00:00 2001 From: Peter Meerwald-Stadler Date: Sat, 13 May 2023 06:10:17 +0200 Subject: [PATCH 536/585] Fix memleak of codeview leaf (#114) --- modules/dbgfmts/codeview/cv-type.c | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/dbgfmts/codeview/cv-type.c b/modules/dbgfmts/codeview/cv-type.c index 2a52f184..c374c2ba 100644 --- a/modules/dbgfmts/codeview/cv-type.c +++ b/modules/dbgfmts/codeview/cv-type.c @@ -561,6 +561,7 @@ cv_leaf_destroy(cv_leaf *leaf) } ch++; } + yasm_xfree(leaf); } static unsigned long From fa9e004383690ce2a0de70976cc9b9ef58bf2b03 Mon Sep 17 00:00:00 2001 From: cryptobro Date: Sat, 13 May 2023 07:12:54 +0300 Subject: [PATCH 537/585] gas preproc: Fix UB/crashes (#186) --- modules/preprocs/gas/gas-preproc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/preprocs/gas/gas-preproc.c b/modules/preprocs/gas/gas-preproc.c index 94d8f5da..8f4c7932 100644 --- a/modules/preprocs/gas/gas-preproc.c +++ b/modules/preprocs/gas/gas-preproc.c @@ -912,6 +912,9 @@ static void expand_macro(yasm_preproc_gas *pp, macro_entry *macro, const char *a char *end = strstr(macro->params[j], "="); int len = (end ? (size_t)(end - macro->params[j]) : strlen(macro->params[j])); + if (!tokval.t_charptr) { + continue; + } if (!strncmp(tokval.t_charptr, macro->params[j], len) && tokval.t_charptr[len] == '\0') { /* now, find matching argument. */ @@ -932,6 +935,9 @@ static void expand_macro(yasm_preproc_gas *pp, macro_entry *macro, const char *a memcpy(line + cursor - len, value, value_length); pp->expr.string = work = line; pp->expr.string_cursor += delta; + if (pp->expr.symbol == tokval.t_charptr) { + tokval.t_charptr = NULL; + } if (pp->expr.symbol) { yasm_xfree(pp->expr.symbol); pp->expr.symbol = NULL; From 529c14bfdc36a36a6f0456391c908dfe3e3612d0 Mon Sep 17 00:00:00 2001 From: Fighter19 <1475802+Fighter19@users.noreply.github.com> Date: Sat, 13 May 2023 06:13:44 +0200 Subject: [PATCH 538/585] Fix badly freed pointer on indented code block after rept (#189) --- modules/preprocs/gas/gas-preproc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/preprocs/gas/gas-preproc.c b/modules/preprocs/gas/gas-preproc.c index 8f4c7932..61941bf9 100644 --- a/modules/preprocs/gas/gas-preproc.c +++ b/modules/preprocs/gas/gas-preproc.c @@ -979,10 +979,11 @@ static int eval_rept(yasm_preproc_gas *pp, int unused, const char *arg1) SLIST_INIT(&lines); while (line) { - skip_whitespace2(&line); - if (starts_with(line, ".rept")) { + char *line2 = line; + skip_whitespace2(&line2); + if (starts_with(line2, ".rept")) { nesting++; - } else if (starts_with(line, ".endr") && --nesting == 0) { + } else if (starts_with(line2, ".endr") && --nesting == 0) { for (i = 0; i < n; i++) { buffered_line *current_line; prev_bline = NULL; From ce56a6f924274a859db9bb46a8181217d9021c74 Mon Sep 17 00:00:00 2001 From: Matthieu Darbois Date: Sat, 13 May 2023 06:14:32 +0200 Subject: [PATCH 539/585] Fix test failure introduced in 51af4082cc898b122b88f11fd34033fc00fad81e (#145) modules/arch/x86/tests/x86_test.sh failed after 51af4082cc898b122b88f11fd34033fc00fad81e commit. This fixes this test. --- libyasm/errwarn.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libyasm/errwarn.c b/libyasm/errwarn.c index 18958db9..983e0819 100644 --- a/libyasm/errwarn.c +++ b/libyasm/errwarn.c @@ -111,11 +111,11 @@ void yasm_errwarn_initialize(void) { /* Default enabled warnings. See errwarn.h for a list. */ - warn_class_enabled = + warn_class_enabled = (1UL<type == WE_PARSERERROR) { - /* overwrite last error */ + /* overwrite last error */ we = ins_we; } else { /* add a new error */ From 0799f381d513e18f404654047fa1b412084968c8 Mon Sep 17 00:00:00 2001 From: kalebskeithley Date: Sat, 13 May 2023 00:15:02 -0400 Subject: [PATCH 540/585] Update elf-objfmt.c (#148) --- modules/objfmts/elf/elf-objfmt.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/objfmts/elf/elf-objfmt.c b/modules/objfmts/elf/elf-objfmt.c index 0c3a1426..c4360c03 100644 --- a/modules/objfmts/elf/elf-objfmt.c +++ b/modules/objfmts/elf/elf-objfmt.c @@ -1077,6 +1077,10 @@ elf_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, align = 0; data.type = SHT_PROGBITS; data.flags = 0; + } else if (strcmp(sectname, ".note.gnu.property") == 0) { + align = 8; + data.type = SHT_NOTE; + data.flags = 0; } else { /* Default to code */ align = 1; From 3bbfd9d8f94e3a0a083b6cd18da6de87f586a7a3 Mon Sep 17 00:00:00 2001 From: squidcc Date: Sat, 13 May 2023 14:16:26 +1000 Subject: [PATCH 541/585] Fix 128-bit variant of VPBLENDVB incorrectly marked as AVX2 instead of AVX (#112) --- modules/arch/x86/gen_x86_insn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index b21c74a2..09d64c7f 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -5976,7 +5976,7 @@ add_insn("vblendvps", "avx_sse4xmm0", modifiers=[0x4A]) # vpblendvb didn't have a 256-bit form until AVX2 add_group("avx2_sse4xmm0", - cpu=["AVX2"], + cpu=["AVX"], modifiers=["Op2Add"], vex=128, prefix=0x66, From 468014643d7a7c481ff67b9c87364d16eedc317a Mon Sep 17 00:00:00 2001 From: James Touton Date: Fri, 12 May 2023 21:16:49 -0700 Subject: [PATCH 542/585] Added missing config vars to config.h.cmake. (#160) --- ConfigureChecks.cmake | 1 + config.h.cmake | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 4b05d048..73a1a4c2 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -18,6 +18,7 @@ CHECK_INCLUDE_FILE(stdint.h HAVE_STDINT_H) CHECK_SYMBOL_EXISTS(abort "stdlib.h" HAVE_ABORT) CHECK_FUNCTION_EXISTS(getcwd HAVE_GETCWD) +CHECK_FUNCTION_EXISTS(_stricmp HAVE__STRICMP) CHECK_FUNCTION_EXISTS(toascii HAVE_TOASCII) CHECK_LIBRARY_EXISTS(dl dlopen "" HAVE_LIBDL) diff --git a/config.h.cmake b/config.h.cmake index e0026778..61e99d00 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -8,6 +8,9 @@ /* Define if messsage translations are enabled */ #cmakedefine ENABLE_NLS 1 +/* Define if you have the `abort' function. */ +#cmakedefine HAVE_ABORT 1 + /* */ #undef HAVE_GETTEXT @@ -23,6 +26,9 @@ /* Define to 1 if you have the `getcwd' function. */ #cmakedefine HAVE_GETCWD 1 +/* Define to 1 if you have the `_stricmp' function. */ +#cmakedefine HAVE__STRICMP 1 + /* Define to 1 if you have the `toascii' function. */ #cmakedefine HAVE_TOASCII 1 @@ -45,4 +51,3 @@ /* Command name to run C preprocessor */ #define CPP_PROG "@CPP_PROG@" - From f2f9f157dfbf3d43dadfdd73d03dd8c56ec84c1c Mon Sep 17 00:00:00 2001 From: Peter Meerwald-Stadler Date: Sat, 13 May 2023 06:17:09 +0200 Subject: [PATCH 543/585] Allow sha256rnds2 to have memory as 2nd operand (#108) --- modules/arch/x86/gen_x86_insn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index 09d64c7f..0a798fea 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -8096,7 +8096,7 @@ add_group("intel_SHA256RNDS2", cpu=["SHA"], opcode=[0x0F, 0x38, 0xCB], operands=[Operand(type="SIMDReg", size=128, dest="Spare"), - Operand(type="SIMDReg", size=128, dest="EA")]) + Operand(type="SIMDRM", size=128, dest="EA")]) add_insn("SHA1MSG1", "intel_SHA1MSG1") add_insn("SHA1MSG2", "intel_SHA1MSG2") From 8a87860db7d0a3ad2c61b4411d74e5a4a738b448 Mon Sep 17 00:00:00 2001 From: Kaz Wesley Date: Fri, 12 May 2023 21:18:15 -0700 Subject: [PATCH 544/585] Enable AES on westmere (#97) Prior to this change: cpu_lcd(['AVX'], ['AVX','AES']) == ['AVX'], causing AES instructions to be treated as unsupported when "cpu WESTMERE" is used, or even "cpu WESTMERE AES". Fixed by reordering ordered_cpu_features such that now, cpu_lcd(['AVX'], ['AVX','AES']) == ['AES']. I don't know if there are CPUs this would not be correct for, but this is the value that's consistent with all extant CPU definitions. --- modules/arch/x86/gen_x86_insn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index 0a798fea..8914d789 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -37,7 +37,7 @@ ordered_cpus = [ ordered_cpu_features = [ "FPU", "Cyrix", "AMD", "MMX", "3DNow", "SMM", "SSE", "SSE2", "SSE3", "SVM", "PadLock", "SSSE3", "SSE41", "SSE42", "SSE4a", "SSE5", - "AVX", "FMA", "AES", "CLMUL", "MOVBE", "XOP", "FMA4", "F16C", + "AES", "AVX", "FMA", "CLMUL", "MOVBE", "XOP", "FMA4", "F16C", "FSGSBASE", "RDRAND", "XSAVEOPT", "EPTVPID", "SMX", "AVX2", "BMI1", "BMI2", "INVPCID", "LZCNT", "TBM", "TSX", "SHA", "SMAP", "RDSEED", "ADX", "PRFCHW"] From e9badc5a77813003baae4e73d4bfd0298069459f Mon Sep 17 00:00:00 2001 From: Scott Furry Date: Fri, 12 May 2023 22:18:39 -0600 Subject: [PATCH 545/585] Python 2 to 3 migration - m4 folder (#144) Update cython.m4 and pythonhead.m4 files to be compatible with py2/3 pythonhead.m4 changes taken from: https://raw.githubusercontent.com/posborne/dbus-python/master/m4/am-check-python-headers.m4 cython.m4 changes taken from: https://raw.githubusercontent.com/alisw/rivet/master/m4/cython.m4 --- m4/cython.m4 | 55 ++++++++++++++++++++++++++++++------------------ m4/pythonhead.m4 | 37 ++++++++++++++++++++++++++------ 2 files changed, 64 insertions(+), 28 deletions(-) diff --git a/m4/cython.m4 b/m4/cython.m4 index e56bfba0..a7ed9ee1 100644 --- a/m4/cython.m4 +++ b/m4/cython.m4 @@ -1,23 +1,36 @@ -dnl a macro to check for the installed Cython version; note PYTHON needs to -dnl be set before this function is called. -dnl CYTHON_CHECK_VERSION([MIN-VERSION], [ACTION-IF-TRUE], [ACTION-IF-FALSE]) +dnl a macro to check for the installed Cython version +dnl CYTHON_CHECK_VERSION([VERSION [,[ACTION-IF-TRUE [,ACTION-IF-FALSE]]]) +dnl Check if a Cython version is installed +dnl Defines CYTHON_VERSION and CYTHON_FOUND +dnl taken from Enligntenment Foundation Libraries(GPL). AC_DEFUN([CYTHON_CHECK_VERSION], - [prog="import re, sys -from Cython.Compiler.Version import version -def get_int(arg): - matched = re.match(r'\d+', arg) - if matched is None: - return 0 - else: - return int(matched.group(0)) -# split strings by '.' and convert to numeric. Append some zeros -# because we need at least 4 digits for the hex conversion. -ver = map(get_int, version.rstrip('abcdefghijklmnopqrstuvwxyz').split('.')) + [[0, 0, 0]] -verhex = 0 -for i in range(0, 4): verhex = (verhex << 8) + ver[[i]] -minver = map(get_int, '$1'.split('.')) + [[0, 0, 0]] -minverhex = 0 -for i in range(0, 4): minverhex = (minverhex << 8) + minver[[i]] -sys.exit(verhex < minverhex)" - AS_IF([AM_RUN_LOG([$PYTHON -c "$prog"])], [$2], [$3])]) +[ +AC_REQUIRE([AM_PATH_PYTHON]) +ifelse([$1], [], [_msg=""], [_msg=" >= $1"]) +AC_MSG_CHECKING(for Cython$_msg) +AC_CACHE_VAL(py_cv_cython, [ +prog="from __future__ import print_function; import Cython.Compiler.Version; print(Cython.Compiler.Version.version)" +CYTHON_VERSION=`$PYTHON -c "$prog" 2>&AC_FD_CC` + +py_cv_cython=no +if test "x$CYTHON_VERSION" != "x"; then + py_cv_cython=yes +fi + +if test "x$py_cv_cython" = "xyes"; then + ifelse([$1], [], [:], + [AS_VERSION_COMPARE([$CYTHON_VERSION], [$1], [py_cv_cython=no])]) +fi +]) + +AC_MSG_RESULT([$py_cv_cython]) + +if test "x$py_cv_cython" = "xyes"; then + CYTHON_FOUND=yes + ifelse([$2], [], [:], [$2]) +else + CYTHON_FOUND=no + ifelse([$3], [], [AC_MSG_ERROR([Could not find usable Cython$_msg])], [$3]) +fi +]) diff --git a/m4/pythonhead.m4 b/m4/pythonhead.m4 index 1e0f2b63..15b7a333 100644 --- a/m4/pythonhead.m4 +++ b/m4/pythonhead.m4 @@ -1,16 +1,39 @@ dnl a macro to check for ability to create python extensions dnl AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE]) dnl function also defines PYTHON_INCLUDES +dnl update taken from dbus-python(GPL). AC_DEFUN([AM_CHECK_PYTHON_HEADERS], [AC_REQUIRE([AM_PATH_PYTHON]) -AC_MSG_CHECKING(for headers required to compile python extensions) -dnl deduce PYTHON_INCLUDES -py_prefix=`$PYTHON -c "import sys; print sys.prefix"` -py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"` -PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}" -if test "$py_prefix" != "$py_exec_prefix"; then - PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}" + +AC_PATH_PROGS([PYTHON_CONFIG], [python${PYTHON_VERSION}-config python-config], [no]) +if test "${PYTHON_CONFIG}" = "no"; then + AC_MSG_ERROR([cannot find python${PYTHON_VERSION}-config or python-config in PATH]) fi + +AC_ARG_VAR([PYTHON_INCLUDES], [CPPFLAGS for Python, overriding output of python2.x-config --includes, e.g. "-I/opt/misc/include/python2.7"]) + +if test "${PYTHON_INCLUDES+set}" = set; then + AC_MSG_NOTICE([PYTHON_INCLUDES overridden to: $PYTHON_INCLUDES]) +else + dnl deduce PYTHON_INCLUDES + AC_MSG_CHECKING(for Python headers using $PYTHON_CONFIG --includes) + PYTHON_INCLUDES=`$PYTHON_CONFIG --includes` + if test $? = 0; then + AC_MSG_RESULT($PYTHON_INCLUDES) + else + AC_MSG_RESULT([failed, will try another way]) + py_prefix=`$PYTHON -c "import sys; print(sys.prefix)"` + py_exec_prefix=`$PYTHON -c "import sys; print(sys.exec_prefix)"` + AC_MSG_CHECKING(for Python headers in $py_prefix and $py_exec_prefix) + PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}" + if test "$py_prefix" != "$py_exec_prefix"; then + PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}" + fi + AC_MSG_RESULT($PYTHON_INCLUDES) + fi +fi + +AC_MSG_CHECKING(whether those headers are sufficient) AC_SUBST(PYTHON_INCLUDES) dnl check if the headers exist: save_CPPFLAGS="$CPPFLAGS" From 8b6c7b237c6c36614ddc6942b9568d1c214d25ef Mon Sep 17 00:00:00 2001 From: Duncan Ogilvie Date: Sat, 13 May 2023 06:19:37 +0200 Subject: [PATCH 546/585] Fix allocator mismatch (#107) --- libyasm/bitvect.c | 4 ++-- libyasm/file.c | 4 ++-- libyasm/tests/bitvect_test.c | 2 +- libyasm/tests/floatnum_test.c | 6 +++--- modules/preprocs/nasm/nasm-pp.c | 6 +++--- tools/genperf/genperf.c | 4 ++-- tools/genperf/perfect.c | 18 +++++++++--------- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/libyasm/bitvect.c b/libyasm/bitvect.c index dfb08252..b6570ea3 100644 --- a/libyasm/bitvect.c +++ b/libyasm/bitvect.c @@ -457,7 +457,7 @@ void BitVector_Destroy_List(listptr list, N_int count) /* free list */ { BitVector_Destroy(*slot++); } - free((voidptr) list); + yasm_xfree((voidptr) list); } } @@ -496,7 +496,7 @@ listptr BitVector_Create_List(N_int bits, boolean clear, N_int count) if (count > 0) { - list = (listptr) malloc(sizeof(wordptr) * count); + list = (listptr) yasm_xmalloc(sizeof(wordptr) * count); if (list != NULL) { slot = list; diff --git a/libyasm/file.c b/libyasm/file.c index fc7dab6c..ea9f603b 100644 --- a/libyasm/file.c +++ b/libyasm/file.c @@ -473,7 +473,7 @@ yasm__createpath_common(const char *path, int win) size_t len, lth; lth = len = strlen(path); - ts = tp = (char *) malloc(len + 1); + ts = tp = (char *) yasm_xmalloc(len + 1); pe = pp + len; while (pe > pp) { if ((win && *pe == '\\') || *pe == '/') @@ -523,7 +523,7 @@ yasm__createpath_common(const char *path, int win) } *tp++ = *pp++; } - free(ts); + yasm_xfree(ts); return lth; } diff --git a/libyasm/tests/bitvect_test.c b/libyasm/tests/bitvect_test.c index f7b34130..367b12bc 100644 --- a/libyasm/tests/bitvect_test.c +++ b/libyasm/tests/bitvect_test.c @@ -109,7 +109,7 @@ num_check(Val *val) strcat(result_msg, ": "); strcat(result_msg, (char *)ascii); } - free(result); + yasm_xfree(result); return ret; } diff --git a/libyasm/tests/floatnum_test.c b/libyasm/tests/floatnum_test.c index 30b8d6ce..2447e90b 100644 --- a/libyasm/tests/floatnum_test.c +++ b/libyasm/tests/floatnum_test.c @@ -177,7 +177,7 @@ new_check_flt(Init_Entry *val) for (i=1;imantissa[i]) result = 1; - free(mantissa); + yasm_xfree(mantissa); if (result) { strcat(result_msg, "mantissa"); return 1; @@ -231,7 +231,7 @@ test_new_normalized_edgecase(void) static void get_family_setup(void) { - flt = malloc(sizeof(yasm_floatnum)); + flt = yasm_xmalloc(sizeof(yasm_floatnum)); flt->mantissa = BitVector_Create(MANT_BITS, TRUE); } @@ -239,7 +239,7 @@ static void get_family_teardown(void) { BitVector_Destroy(flt->mantissa); - free(flt); + yasm_xfree(flt); } static void diff --git a/modules/preprocs/nasm/nasm-pp.c b/modules/preprocs/nasm/nasm-pp.c index 32ebcd00..cdc059d9 100644 --- a/modules/preprocs/nasm/nasm-pp.c +++ b/modules/preprocs/nasm/nasm-pp.c @@ -705,7 +705,7 @@ check_tasm_directive(char *line) "%%define %s %%1\n"; char **data; - data = malloc(2*sizeof(char*)); + data = nasm_malloc(2*sizeof(char*)); oldline = line; line = nasm_malloc(strlen(irp_format) - 2 + len2 + 1); sprintf(line,irp_format,q); @@ -804,7 +804,7 @@ check_tasm_directive(char *line) oldline = line; line = nasm_malloc(5 + 1 + len + 1); sprintf(line, "struc %s", p); - struc = malloc(sizeof(*struc)); + struc = nasm_malloc(sizeof(*struc)); struc->name = nasm_strdup(p); struc->fields = NULL; struc->lastField = NULL; @@ -1079,7 +1079,7 @@ prepreproc(char *line) d = strchr(c+1, '\n'); if (d) *d = '\0'; - l = malloc(sizeof(*l)); + l = nasm_malloc(sizeof(*l)); l -> first = tokenise(c+1); l -> finishes = NULL; l -> next = *lp; diff --git a/tools/genperf/genperf.c b/tools/genperf/genperf.c index c3cfa766..073b7502 100644 --- a/tools/genperf/genperf.c +++ b/tools/genperf/genperf.c @@ -242,8 +242,8 @@ perfect_gen(FILE *out, const char *lookup_function_name, fprintf(out, "}\n"); fprintf(out, "\n"); - free(tab); - free(tabh); + yasm_xfree(tab); + yasm_xfree(tabh); } int diff --git a/tools/genperf/perfect.c b/tools/genperf/perfect.c index a9a14c02..fa5a4897 100644 --- a/tools/genperf/perfect.c +++ b/tools/genperf/perfect.c @@ -635,7 +635,7 @@ static void hash_ab( else { /* try with 2*smax */ - free((void *)tabh); + yasm_xfree((void *)tabh); *smax = *smax * 2; scrambleinit(scramble, *smax); tabh = (hstuff *)yasm_xmalloc(sizeof(hstuff)*(form->perfect == MINIMAL_HP ? @@ -671,8 +671,8 @@ static void hash_ab( sprintf(final->line[0], " unsigned long rsl = (a ^ scramble[tab[b]]);\n"); } - free((void *)tabq); - free((void *)tabh); + yasm_xfree((void *)tabq); + yasm_xfree((void *)tabh); } @@ -883,8 +883,8 @@ void findhash( else if (*blen < *smax) { *blen *= 2; - free(tabq); - free(*tabb); + yasm_xfree(tabq); + yasm_xfree(*tabb); *tabb = (bstuff *)yasm_xmalloc((size_t)(sizeof(bstuff)*(*blen))); tabq = (qstuff *)yasm_xmalloc((size_t)(sizeof(qstuff)*(*blen+1))); } @@ -909,8 +909,8 @@ void findhash( if (*blen < *smax) { *blen *= 2; - free(*tabb); - free(tabq); + yasm_xfree(*tabb); + yasm_xfree(tabq); *tabb = (bstuff *)yasm_xmalloc((size_t)(sizeof(bstuff)*(*blen))); tabq = (qstuff *)yasm_xmalloc((size_t)(sizeof(qstuff)*(*blen+1))); --trysalt; /* we know this salt got distinct (A,B) */ @@ -930,7 +930,7 @@ void findhash( } /* free working memory */ - free((void *)tabq); + yasm_xfree((void *)tabq); } #if 0 @@ -1149,7 +1149,7 @@ hashform *form; /* user directives */ /* clean up memory sources */ refree(textroot); refree(keyroot); - free((void *)tab); + yasm_xfree((void *)tab); } From 563a03be817a8ce08380605c9fe495ceae362d69 Mon Sep 17 00:00:00 2001 From: mackyle Date: Sat, 13 May 2023 04:20:12 +0000 Subject: [PATCH 547/585] libyasm/section.c: support gas .private_extern directive (#138) Support for "private_extern" was previously added for nasm mode via a declaration like so: global foo:private_extern foo: ; codes However, that same code in gas format looks like this: .private_extern foo foo: # codes Add support for the gas version of "private_extern" syntax by supporting a new gas `.private_extern` directive that actually has exactly the same semantics as the nasm `global ...:private_extern` directive. Signed-off-by: Kyle J. McKay --- libyasm/section.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/libyasm/section.c b/libyasm/section.c index ba582bfa..592f5b86 100644 --- a/libyasm/section.c +++ b/libyasm/section.c @@ -122,6 +122,23 @@ dir_global(yasm_object *object, yasm_valparamhead *valparams, } } +static void +dir_privextern(yasm_object *object, yasm_valparamhead *valparams, + yasm_valparamhead *objext_valparams, unsigned long line) +{ + yasm_valparamhead vps; + + yasm_vps_initialize(&vps); + if (!objext_valparams) { + yasm_valparam *vp; + + vp = yasm_vp_create_id(NULL, strdup("private_extern"), '$'); + yasm_vps_append(&vps, vp); + objext_valparams = &vps; + } + dir_global(object, valparams, objext_valparams, line); +} + static void dir_common(yasm_object *object, yasm_valparamhead *valparams, yasm_valparamhead *objext_valparams, unsigned long line) @@ -164,6 +181,7 @@ static const yasm_directive object_directives[] = { { ".extern", "gas", dir_extern, YASM_DIR_ID_REQUIRED }, { ".global", "gas", dir_global, YASM_DIR_ID_REQUIRED }, { ".globl", "gas", dir_global, YASM_DIR_ID_REQUIRED }, + { ".private_extern","gas", dir_privextern, YASM_DIR_ID_REQUIRED }, { "extern", "nasm", dir_extern, YASM_DIR_ID_REQUIRED }, { "global", "nasm", dir_global, YASM_DIR_ID_REQUIRED }, { "common", "nasm", dir_common, YASM_DIR_ID_REQUIRED }, From 241bf4c42c2403f0ccae3d52cc610d5cec5d8c2e Mon Sep 17 00:00:00 2001 From: bird2tori Date: Sat, 13 May 2023 06:22:36 +0200 Subject: [PATCH 548/585] More makedep features (#80) yasm.c: Added -MD, -MT and -MP options similar to gcc. Also added --makedep-dos2unix-slash for helping users of NUG make (and similar) on Windows. The -MD option does both assembling and Makefile dependency generation in one go, which convenient and a little quicker. nasm-preproc.c: Have to always gather dependencies to support -MD. Minimal cost. Co-authored-by: knut st. osmundsen --- frontends/yasm/yasm.c | 201 ++++++++++++++++++++++++--- modules/preprocs/nasm/nasm-preproc.c | 20 ++- 2 files changed, 188 insertions(+), 33 deletions(-) diff --git a/frontends/yasm/yasm.c b/frontends/yasm/yasm.c index 7ac141e6..d11147ec 100644 --- a/frontends/yasm/yasm.c +++ b/frontends/yasm/yasm.c @@ -70,6 +70,10 @@ static int special_options = 0; static int preproc_only = 0; static unsigned int force_strict = 0; static int generate_make_dependencies = 0; +static int makedep_with_empty_recipts = 0; +static int makedep_dos2unix_slash = 0; +/*@null@*/ /*@only@*/ static const char *makedep_out_filename = NULL; +/*@null@*/ /*@only@*/ static const char *makedep_target = NULL; static int warning_error = 0; /* warnings being treated as errors */ static FILE *errfile; /*@null@*/ /*@only@*/ static char *error_filename = NULL; @@ -105,7 +109,11 @@ static int preproc_only_handler(char *cmd, /*@null@*/ char *param, int extra); static int opt_include_option(char *cmd, /*@null@*/ char *param, int extra); static int opt_preproc_option(char *cmd, /*@null@*/ char *param, int extra); static int opt_ewmsg_handler(char *cmd, /*@null@*/ char *param, int extra); +static int opt_makedep_and_assemble_handler(char *cmd, /*@null@*/ char *param, int extra); +static int opt_makedep_empty_handler(char *cmd, /*@null@*/ char *param, int extra); +static int opt_makedep_target_handler(char *cmd, /*@null@*/ char *param, int extra); static int opt_makedep_handler(char *cmd, /*@null@*/ char *param, int extra); +static int opt_makedep_dos2unix_slash_handler(char *cmd, /*@null@*/ char *param, int extra); static int opt_prefix_handler(char *cmd, /*@null@*/ char *param, int extra); static int opt_suffix_handler(char *cmd, /*@null@*/ char *param, int extra); #if defined(CMAKE_BUILD) && defined(BUILD_SHARED_LIBS) @@ -137,6 +145,10 @@ static void apply_preproc_standard_macros(const yasm_stdmac *stdmacs); static void apply_preproc_saved_options(void); static void print_list_keyword_desc(const char *name, const char *keyword); +#ifndef MAX +# define MAX(a, b) ( ((a) > (b)) ? (a) : (b) ) +#endif + /* values for special_options */ #define SPECIAL_SHOW_HELP 0x01 #define SPECIAL_SHOW_VERSION 0x02 @@ -178,8 +190,18 @@ static opt_option options[] = N_("inhibits warning messages"), NULL }, { 'W', NULL, 0, opt_warning_handler, 0, N_("enables/disables warning"), NULL }, - { 'M', NULL, 0, opt_makedep_handler, 0, + { 0, "MD", 1, opt_makedep_and_assemble_handler, 0, + N_("generate Makefile dependencies and assemble normally"), + N_("file")}, + { 0, "MP", 0, opt_makedep_empty_handler, 0, + N_("generate empty Makefile recipts for the include files"), NULL }, + { 0, "MT", 1, opt_makedep_target_handler, 0, + N_("the Makefile target to associate the dependencies with"), + N_("target")}, + { 'M', NULL, 0, opt_makedep_handler, 0, /* -M must come after -MD and -MP'! */ N_("generate Makefile dependencies on stdout"), NULL }, + { 0, "makedep-dos2unix-slash", 0, opt_makedep_dos2unix_slash_handler, 0, + N_("convert DOS to UNIX slashes in Makefile dependencies file"), NULL }, { 'Z', NULL, 1, opt_error_file, 0, N_("redirect error messages to file"), N_("file") }, { 's', NULL, 0, opt_error_stdout, 0, @@ -247,12 +269,129 @@ typedef struct constcharparam { static constcharparam_head preproc_options; +static char * +dos2unix_slash(char *path) +{ + char *slash = strchr(path, '\\'); + while (slash) { + *slash++ = '/'; + slash = strchr(slash, '\\'); + } + return path; +} + +static int +do_generate_make_dependencies(void) +{ + size_t empty_recipts_alloc = 0; + size_t empty_recipts_len = 0; + char *empty_recipts = NULL; + char *preproc_buf; + size_t linelen; + size_t got; + FILE *depout = stdout; + const char *target; + + /* Open the -MD . */ + if ( makedep_out_filename != NULL + && strcmp(makedep_out_filename, "-") != 0) { + depout = open_file(makedep_out_filename, "wt"); + if (!depout) + return EXIT_FAILURE; + } + + /* -MT (and later -MQ?) can be used to specify the target name. + If not given, fall back on the object file. */ + target = makedep_target ? makedep_target : obj_filename; + + /* Make sure preproc_buf is large enough for either of the main + file names to avoid checking later (very ulikely that it isn't). */ + linelen = strlen(target); + got = strlen(in_filename); + preproc_buf = yasm_xmalloc(MAX(PREPROC_BUF_SIZE, MAX(got, linelen) + 1)); + + /* The target (the object file) to add the dependencies to. */ + if (!makedep_dos2unix_slash || makedep_target == NULL) + fputs(target, depout); + else + fputs(dos2unix_slash(memcpy(preproc_buf, target, linelen + 1)), + depout); + + /* The source file (no empty rule for it, thus the code duplication). */ + linelen += 2 + got; + if (linelen <= 72) + fputs(": ", depout); + else { + fputs(": \\\n ", depout); + linelen = 1 + got; + } + if (!makedep_dos2unix_slash) + fwrite(in_filename, got, 1, depout); + else + fwrite(dos2unix_slash(memcpy(preproc_buf, in_filename, got + 1)), + got, 1, depout); + + /* Now the include files. */ + while ((got = yasm_preproc_get_included_file(cur_preproc, preproc_buf, + PREPROC_BUF_SIZE)) != 0) { + linelen += 1 + got; + if (linelen <= 72) + fputc(' ', depout); + else { + fputs(" \\\n ", depout); + linelen = 1 + got; + } + if (makedep_dos2unix_slash) + dos2unix_slash(preproc_buf); + fwrite(preproc_buf, got, 1, depout); + + if (makedep_with_empty_recipts) { + /* We only get one shot at each include file, so we generate the + dummy recipts in a buffer while we're writing the dependencies + for the object file. (The empty recipts makes make shut up + about deleted includes.) */ + static const char empty_tail[] = ":\n\n"; + size_t cur_len = empty_recipts_len; + + empty_recipts_len = cur_len + got + sizeof(empty_tail) - 1; + if (empty_recipts_len >= empty_recipts_alloc) { + if (empty_recipts_alloc == 0) + empty_recipts_alloc = 4096; + while (empty_recipts_len >= empty_recipts_alloc) + empty_recipts_alloc *= 2; + empty_recipts = yasm_xrealloc(empty_recipts, + empty_recipts_alloc); + } + + memcpy(&empty_recipts[cur_len], preproc_buf, got); + cur_len += got; + memcpy(&empty_recipts[cur_len], empty_tail, sizeof(empty_tail)); + } + } + + fputc('\n', depout); + yasm_xfree(preproc_buf); + + if (empty_recipts) { + fputc('\n', depout); + fwrite(empty_recipts, empty_recipts_len, 1, depout); + yasm_xfree(empty_recipts); + } + + if ( depout != stdout + && fclose(depout) != 0) { + print_error(_("error writing `%s'"), makedep_out_filename); + return EXIT_FAILURE; + } + + return 0; +} + static int do_preproc_only(void) { yasm_linemap *linemap; char *preproc_buf; - size_t got; const char *base_filename; FILE *out = NULL; yasm_errwarns *errwarns = yasm_errwarns_create(); @@ -301,25 +440,7 @@ do_preproc_only(void) /* Pre-process until done */ if (generate_make_dependencies) { - size_t totlen; - - preproc_buf = yasm_xmalloc(PREPROC_BUF_SIZE); - - fprintf(stdout, "%s: %s", obj_filename, in_filename); - totlen = strlen(obj_filename)+2+strlen(in_filename); - - while ((got = yasm_preproc_get_included_file(cur_preproc, preproc_buf, - PREPROC_BUF_SIZE)) != 0) { - totlen += got; - if (totlen > 72) { - fputs(" \\\n ", stdout); - totlen = 2; - } - fputc(' ', stdout); - fwrite(preproc_buf, got, 1, stdout); - } - fputc('\n', stdout); - yasm_xfree(preproc_buf); + do_generate_make_dependencies(); } else { while ((preproc_buf = yasm_preproc_get_line(cur_preproc)) != NULL) { fputs(preproc_buf, out); @@ -573,6 +694,10 @@ do_assemble(void) fclose(list); } + /* Generate make dependency. */ + if (generate_make_dependencies) + do_generate_make_dependencies(); + yasm_errwarns_output_all(errwarns, linemap, warning_error, print_yasm_error, print_yasm_warning); @@ -1170,6 +1295,32 @@ opt_ewmsg_handler(/*@unused@*/ char *cmd, char *param, /*@unused@*/ int extra) return 0; } +static int +opt_makedep_and_assemble_handler(/*@unused@*/ char *cmd, char *param, + /*@unused@*/ int extra) +{ + generate_make_dependencies = 1; + makedep_out_filename = param; + return 0; +} + +static int +opt_makedep_empty_handler(/*@unused@*/ char *cmd, /*@unused@*/ char *param, + /*@unused@*/ int extra) +{ + makedep_with_empty_recipts = 1; + return 0; +} + +static int +opt_makedep_target_handler(/*@unused@*/ char *cmd, char *param, + /*@unused@*/ int extra) +{ + makedep_target = param; + return 0; +} + + static int opt_makedep_handler(/*@unused@*/ char *cmd, /*@unused@*/ char *param, /*@unused@*/ int extra) @@ -1181,6 +1332,14 @@ opt_makedep_handler(/*@unused@*/ char *cmd, /*@unused@*/ char *param, return 0; } +static int +opt_makedep_dos2unix_slash_handler(/*@unused@*/ char *cmd, /*@unused@*/ char *param, + /*@unused@*/ int extra) +{ + makedep_dos2unix_slash = 1; + return 0; +} + static int opt_prefix_handler(/*@unused@*/ char *cmd, char *param, /*@unused@*/ int extra) { diff --git a/modules/preprocs/nasm/nasm-preproc.c b/modules/preprocs/nasm/nasm-preproc.c index 96d66dbc..75e60157 100644 --- a/modules/preprocs/nasm/nasm-preproc.c +++ b/modules/preprocs/nasm/nasm-preproc.c @@ -151,7 +151,8 @@ nasm_preproc_create(const char *in_filename, yasm_symtab *symtab, nasm_symtab = symtab; cur_lm = lm; cur_errwarns = errwarns; - preproc_deps = NULL; + preproc_deps = yasm_xmalloc(sizeof(struct preproc_dep_head)); + STAILQ_INIT(preproc_deps); done_dep_preproc = 0; preproc_nasm->line = NULL; preproc_nasm->file_name = NULL; @@ -176,8 +177,12 @@ nasm_preproc_destroy(yasm_preproc *preproc) if (preproc_nasm->in) fclose(preproc_nasm->in); yasm_xfree(preproc); - if (preproc_deps) - yasm_xfree(preproc_deps); + while (!STAILQ_EMPTY(preproc_deps)) { + preproc_dep *dep = STAILQ_FIRST(preproc_deps); + STAILQ_REMOVE_HEAD(preproc_deps, link); + yasm_xfree(dep->name); + yasm_xfree(dep); + } yasm_xfree(nasm_src_set_fname(NULL)); } @@ -222,10 +227,6 @@ nasm_preproc_add_dep(char *name) { preproc_dep *dep; - /* If not processing dependencies, simply return */ - if (!preproc_deps) - return; - /* Save in preproc_deps */ dep = yasm_xmalloc(sizeof(preproc_dep)); dep->name = yasm__xstrdup(name); @@ -236,11 +237,6 @@ static size_t nasm_preproc_get_included_file(yasm_preproc *preproc, /*@out@*/ char *buf, size_t max_size) { - if (!preproc_deps) { - preproc_deps = yasm_xmalloc(sizeof(struct preproc_dep_head)); - STAILQ_INIT(preproc_deps); - } - for (;;) { char *line; From 811f24d0bfa234bd226301edb6f789320b6f8b5a Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Sat, 13 May 2023 05:23:13 +0100 Subject: [PATCH 549/585] GAS preprocessor: don't cut comments inside of string literals. (#81) --- modules/preprocs/gas/gas-preproc.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/modules/preprocs/gas/gas-preproc.c b/modules/preprocs/gas/gas-preproc.c index 61941bf9..0dd0531c 100644 --- a/modules/preprocs/gas/gas-preproc.c +++ b/modules/preprocs/gas/gas-preproc.c @@ -1049,6 +1049,32 @@ typedef int (*pp_fn2_t)(yasm_preproc_gas *pp, int param, const char *arg1, const #define FN(f) ((pp_fn0_t) &(f)) +static char *find_str_bound(char *line) +{ + for (; line[0]; ++line) { + if (line[0] == '"') return line; + if (line[0] == '\\' && line[1] == '"') ++line; + } + return NULL; +} + +static char *find_comment(char *line) +{ + char *c, *s; + + for (c = line, s = line; (c = strstr(c, "/*")); s = c) { + for (;;) { + s = find_str_bound(s); + if (!s || s > c) return c; + + s = find_str_bound(s + 1); + if (!s || s > c) return NULL; + } + } + + return NULL; +} + static void kill_comments(yasm_preproc_gas *pp, char *line) { int next = 2; @@ -1064,7 +1090,7 @@ static void kill_comments(yasm_preproc_gas *pp, char *line) cstart = line; next = 0; } else { - cstart = strstr(line, "/*"); + cstart = find_comment(line); next = 2; } From e69fba2db04078f49043a0509815424efed2227e Mon Sep 17 00:00:00 2001 From: Biswapriyo Nath Date: Sun, 14 May 2023 23:33:04 +0530 Subject: [PATCH 550/585] Fix missing yasm_xfree function declaration (#224) This fixes the following compiler error in macOS in CI. libyasm/tests/bitvect_test.c:112:5: error: implicit declaration of function 'yasm_xfree' [-Werror,-Wimplicit-function-declaration] --- libyasm/tests/bitvect_test.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libyasm/tests/bitvect_test.c b/libyasm/tests/bitvect_test.c index 367b12bc..b60b7ede 100644 --- a/libyasm/tests/bitvect_test.c +++ b/libyasm/tests/bitvect_test.c @@ -27,6 +27,7 @@ #include #include +#include "util.h" #include "libyasm/bitvect.h" static int From 22da04ee0dbd9ac16eb74dabd3df071a0f8e8eba Mon Sep 17 00:00:00 2001 From: Biswapriyo Nath Date: Thu, 18 May 2023 00:37:24 +0530 Subject: [PATCH 551/585] CI: update GitHub Actions version (#225) Node.js 12 actions are deprecated. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/ --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cc7d27b5..0454d53c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ jobs: name: "Build - ${{ matrix.artifact-name }}" runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install autotools run: | if [ "$RUNNER_OS" == "macOS" ]; then @@ -34,7 +34,7 @@ jobs: - name: Dist run: make dist - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: ${{ matrix.artifact-name }} path: yasm-*.tar.gz From f79f5e37f0e4b06d5dc303cc219929d7359dd7df Mon Sep 17 00:00:00 2001 From: Biswapriyo Nath Date: Thu, 18 May 2023 03:53:32 +0530 Subject: [PATCH 552/585] Fix function declaration warnings with clang (#226) This fixes the following compiler warnings with clang tools/genperf/perfect.c:65:6: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype] frontends/yasm/yasm.c:1379:23: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] modules/objfmts/elf/elf.c:225:18: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] --- frontends/tasm/tasm.c | 4 ++-- frontends/yasm/yasm.c | 4 ++-- modules/objfmts/elf/elf.c | 4 ++-- tools/genperf/perfect.c | 3 +-- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/frontends/tasm/tasm.c b/frontends/tasm/tasm.c index 353f8c58..9558594e 100644 --- a/frontends/tasm/tasm.c +++ b/frontends/tasm/tasm.c @@ -817,7 +817,7 @@ opt_exe_handler(char *cmd, /*@unused@*/ char *param, int extra) } static void -apply_preproc_builtins() +apply_preproc_builtins(void) { char *predef; @@ -853,7 +853,7 @@ apply_preproc_standard_macros(const yasm_stdmac *stdmacs) } static void -apply_preproc_saved_options() +apply_preproc_saved_options(void) { constcharparam *cp, *cpnext; diff --git a/frontends/yasm/yasm.c b/frontends/yasm/yasm.c index d11147ec..2aab8350 100644 --- a/frontends/yasm/yasm.c +++ b/frontends/yasm/yasm.c @@ -1376,7 +1376,7 @@ opt_plugin_handler(/*@unused@*/ char *cmd, char *param, #endif static void -apply_preproc_builtins() +apply_preproc_builtins(void) { char *predef; @@ -1409,7 +1409,7 @@ apply_preproc_standard_macros(const yasm_stdmac *stdmacs) } static void -apply_preproc_saved_options() +apply_preproc_saved_options(void) { constcharparam *cp, *cpnext; diff --git a/modules/objfmts/elf/elf.c b/modules/objfmts/elf/elf.c index 2486bba8..67fe3f26 100644 --- a/modules/objfmts/elf/elf.c +++ b/modules/objfmts/elf/elf.c @@ -222,7 +222,7 @@ elf_strtab_entry_set_str(elf_strtab_entry *entry, const char *str) } elf_strtab_head * -elf_strtab_create() +elf_strtab_create(void) { elf_strtab_head *strtab = yasm_xmalloc(sizeof(elf_strtab_head)); elf_strtab_entry *entry = yasm_xmalloc(sizeof(elf_strtab_entry)); @@ -373,7 +373,7 @@ elf_ssym_symtab_entry_print(void *data, FILE *f, int indent_level) } elf_symtab_head * -elf_symtab_create() +elf_symtab_create(void) { elf_symtab_head *symtab = yasm_xmalloc(sizeof(elf_symtab_head)); elf_symtab_entry *entry = yasm_xmalloc(sizeof(elf_symtab_entry)); diff --git a/tools/genperf/perfect.c b/tools/genperf/perfect.c index fa5a4897..318cb5e6 100644 --- a/tools/genperf/perfect.c +++ b/tools/genperf/perfect.c @@ -62,8 +62,7 @@ Find the mapping that will produce a perfect hash */ /* return the ceiling of the log (base 2) of val */ -ub4 phash_log2(val) -ub4 val; +ub4 phash_log2(ub4 val) { ub4 i; for (i=0; ((ub4)1< Date: Tue, 13 Jun 2023 05:00:47 +0900 Subject: [PATCH 553/585] Fix memory leak in bin-objfmt (#231) --- modules/objfmts/bin/bin-objfmt.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/objfmts/bin/bin-objfmt.c b/modules/objfmts/bin/bin-objfmt.c index 18026750..a38c3422 100644 --- a/modules/objfmts/bin/bin-objfmt.c +++ b/modules/objfmts/bin/bin-objfmt.c @@ -1680,6 +1680,10 @@ static void bin_section_data_destroy(void *data) { bin_section_data *bsd = (bin_section_data *)data; + if (bsd->align) + yasm_xfree(bsd->align); + if (bsd->valign) + yasm_xfree(bsd->valign); if (bsd->start) yasm_expr_destroy(bsd->start); if (bsd->vstart) From 4dc8c3bf030cfe3e71037694685c6d98b7c5f1a4 Mon Sep 17 00:00:00 2001 From: PoroCYon <3253268+PoroCYon@users.noreply.github.com> Date: Sun, 18 Jun 2023 06:44:01 +0000 Subject: [PATCH 554/585] Add support for NASM %warning preprocessor directive (#232) Regular NASM supports this, while Yasm doesn't seem to. This fixes the discrepancy. --- modules/preprocs/nasm/nasm-pp.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/preprocs/nasm/nasm-pp.c b/modules/preprocs/nasm/nasm-pp.c index cdc059d9..512f02c3 100644 --- a/modules/preprocs/nasm/nasm-pp.c +++ b/modules/preprocs/nasm/nasm-pp.c @@ -285,7 +285,7 @@ static const char *directives[] = { "%local", "%macro", "%pop", "%push", "%rep", "%repl", "%rotate", "%scope", "%stacksize", - "%strlen", "%substr", "%undef", "%xdefine" + "%strlen", "%substr", "%undef", "%warning", "%xdefine" }; enum { @@ -302,7 +302,7 @@ enum PP_LOCAL, PP_MACRO, PP_POP, PP_PUSH, PP_REP, PP_REPL, PP_ROTATE, PP_SCOPE, PP_STACKSIZE, - PP_STRLEN, PP_SUBSTR, PP_UNDEF, PP_XDEFINE + PP_STRLEN, PP_SUBSTR, PP_UNDEF, PP_WARNING, PP_XDEFINE }; /* If this is a an IF, ELIF, ELSE or ENDIF keyword */ @@ -2863,6 +2863,7 @@ do_directive(Token * tline) break; case PP_ERROR: + case PP_WARNING: tline->next = expand_smacro(tline->next); tline = tline->next; skip_white_(tline); @@ -2871,7 +2872,7 @@ do_directive(Token * tline) p = tline->text + 1; /* point past the quote to the name */ p[strlen(p) - 1] = '\0'; /* remove the trailing quote */ expand_macros_in_string(&p); - error(ERR_NONFATAL, "%s", p); + error((i == PP_ERROR) ? ERR_NONFATAL : ERR_WARNING, "%s", p); nasm_free(p); } else From 2cd3bb50e256f5ed5f611ac611d25fe673f2cec3 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 30 Jun 2023 08:08:55 -0700 Subject: [PATCH 555/585] elf.c: Fix NULL deref on bad xsize expression (#234) --- modules/objfmts/elf/elf.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/objfmts/elf/elf.c b/modules/objfmts/elf/elf.c index 67fe3f26..1ee98bfd 100644 --- a/modules/objfmts/elf/elf.c +++ b/modules/objfmts/elf/elf.c @@ -482,15 +482,15 @@ elf_symtab_write_to_file(FILE *f, elf_symtab_head *symtab, /* get size (if specified); expr overrides stored integer */ if (entry->xsize) { - size_intn = yasm_intnum_copy( - yasm_expr_get_intnum(&entry->xsize, 1)); - if (!size_intn) { + yasm_intnum *intn = yasm_expr_get_intnum(&entry->xsize, 1); + if (!intn) { yasm_error_set(YASM_ERROR_VALUE, N_("size specifier not an integer expression")); yasm_errwarn_propagate(errwarns, entry->xsize->line); - } + } else + size_intn = yasm_intnum_copy(intn); } - else + if (!size_intn) size_intn = yasm_intnum_create_uint(entry->size); /* get EQU value for constants */ From dfc1c9e84142ae84b976dd863a11a9d95528210f Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 13 Sep 2023 01:21:23 +0300 Subject: [PATCH 556/585] Fix access field adress on null pointer in x86bc.c (#238) --- modules/arch/x86/x86bc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/arch/x86/x86bc.c b/modules/arch/x86/x86bc.c index a6681552..038d7a3f 100644 --- a/modules/arch/x86/x86bc.c +++ b/modules/arch/x86/x86bc.c @@ -654,7 +654,9 @@ x86_bc_insn_expand(yasm_bytecode *bc, int span, long old_val, long new_val, { x86_insn *insn = (x86_insn *)bc->contents; x86_effaddr *x86_ea = insn->x86_ea; - yasm_effaddr *ea = &x86_ea->ea; + yasm_effaddr *ea = NULL; + if (x86_ea != NULL) + ea = &x86_ea->ea; yasm_value *imm = insn->imm; if (ea && span == 1) { From 721134a8aee87a94f19b53c6dc43a956427973a0 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 22 Sep 2023 08:04:09 +0300 Subject: [PATCH 557/585] Fix memory leak if masm mode enabled in parsers (#239) --- modules/parsers/nasm/nasm-parse.c | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/parsers/nasm/nasm-parse.c b/modules/parsers/nasm/nasm-parse.c index 44d3b5d7..680aa0e7 100644 --- a/modules/parsers/nasm/nasm-parse.c +++ b/modules/parsers/nasm/nasm-parse.c @@ -966,6 +966,7 @@ parse_operand(yasm_parser_nasm *parser_nasm) unsigned int size = SIZE_OVERRIDE_val; get_next_token(); if (parser_nasm->masm && curtok == ID && !yasm__strcasecmp(ID_val, "ptr")) { + destroy_curtok(); get_next_token(); } op = parse_operand(parser_nasm); From 0dfac4d4da1bea4b4f8528cf78df954ef0272a43 Mon Sep 17 00:00:00 2001 From: dataisland Date: Fri, 22 Sep 2023 00:04:21 -0500 Subject: [PATCH 558/585] Fix nullptr deref in yasm_expr__copy_except (#241) --- libyasm/expr.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libyasm/expr.c b/libyasm/expr.c index c2c868ed..2987def7 100644 --- a/libyasm/expr.c +++ b/libyasm/expr.c @@ -994,7 +994,10 @@ yasm_expr__copy_except(const yasm_expr *e, int except) { yasm_expr *n; int i; - + + if (e == NULL) + return NULL; + n = yasm_xmalloc(sizeof(yasm_expr) + sizeof(yasm_expr__item)*(e->numterms<2?0:e->numterms-2)); From 1f63a45d24b5d593b8bdacc91f1ce35713b20dc1 Mon Sep 17 00:00:00 2001 From: Kent Ross Date: Thu, 21 Sep 2023 22:05:25 -0700 Subject: [PATCH 559/585] Fix misleading indentation (#132) --- tools/re2c/code.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/re2c/code.c b/tools/re2c/code.c index 92e24d58..e870eb1c 100644 --- a/tools/re2c/code.c +++ b/tools/re2c/code.c @@ -461,8 +461,8 @@ Go_genSwitch(Go *g, FILE *o, State *from, State *next, int *readCh){ if(g->span[i].to != def) *(t++) = &g->span[i]; - if (dFlag) - fputs("\tYYDEBUG(-1, yych);\n", o); + if (dFlag) + fputs("\tYYDEBUG(-1, yych);\n", o); #if 0 if (*readCh) { From 84be2ee6c310607fddbe8154696c9386364679ea Mon Sep 17 00:00:00 2001 From: dataisland Date: Fri, 22 Sep 2023 00:20:58 -0500 Subject: [PATCH 560/585] Fix use-after-free in yasm_intnum_destroy (#242) --- libyasm/expr.c | 1 + libyasm/intnum.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/libyasm/expr.c b/libyasm/expr.c index 2987def7..5b0c418b 100644 --- a/libyasm/expr.c +++ b/libyasm/expr.c @@ -687,6 +687,7 @@ expr_level_op(/*@returned@*/ /*@only@*/ yasm_expr *e, int fold_const, level_numterms--; /* make sure to delete folded intnum */ yasm_intnum_destroy(e->terms[i].data.intn); + e->terms[i].data.intn = NULL; } else if (o != i) { /* copy term if it changed places */ e->terms[o++] = e->terms[i]; diff --git a/libyasm/intnum.c b/libyasm/intnum.c index 6feba334..794c0723 100644 --- a/libyasm/intnum.c +++ b/libyasm/intnum.c @@ -412,6 +412,8 @@ yasm_intnum_copy(const yasm_intnum *intn) void yasm_intnum_destroy(yasm_intnum *intn) { + if (intn == NULL) + return; if (intn->type == INTNUM_BV) BitVector_Destroy(intn->val.bv); yasm_xfree(intn); From ecb47f1c8786b4628d5cd718cdccf134ad96e0cb Mon Sep 17 00:00:00 2001 From: dataisland Date: Fri, 22 Sep 2023 00:21:10 -0500 Subject: [PATCH 561/585] Fix handle_dot_label heap-out-of-bound (#243) --- modules/parsers/nasm/nasm-token.re | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/parsers/nasm/nasm-token.re b/modules/parsers/nasm/nasm-token.re index dba7137e..b2110ce9 100644 --- a/modules/parsers/nasm/nasm-token.re +++ b/modules/parsers/nasm/nasm-token.re @@ -79,7 +79,7 @@ handle_dot_label(YYSTYPE *lvalp, char *tok, size_t toklen, size_t zeropos, lvalp->str_val = yasm__xstrndup(tok+zeropos+(parser_nasm->tasm?2:0), toklen-zeropos-(parser_nasm->tasm?2:0)); /* check for special non-local ..@label */ - if (lvalp->str_val[zeropos+2] == '@') + if (lvalp->str_val[2] == '@') return NONLOCAL_ID; return SPECIAL_ID; } From 9defefae9fbcb6958cddbfa778c1ea8605da8b8b Mon Sep 17 00:00:00 2001 From: dataisland Date: Fri, 22 Sep 2023 00:21:20 -0500 Subject: [PATCH 562/585] Fix null-pointer-dereference in yasm_expr_get_intnum (#244) --- libyasm/expr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libyasm/expr.c b/libyasm/expr.c index 5b0c418b..09ae1121 100644 --- a/libyasm/expr.c +++ b/libyasm/expr.c @@ -1264,7 +1264,7 @@ yasm_expr_get_intnum(yasm_expr **ep, int calc_bc_dist) { *ep = yasm_expr_simplify(*ep, calc_bc_dist); - if ((*ep)->op == YASM_EXPR_IDENT && (*ep)->terms[0].type == YASM_EXPR_INT) + if (*ep && (*ep)->op == YASM_EXPR_IDENT && (*ep)->terms[0].type == YASM_EXPR_INT) return (*ep)->terms[0].data.intn; else return (yasm_intnum *)NULL; From 121ab150b3577b666c79a79f4a511798d7ad2432 Mon Sep 17 00:00:00 2001 From: haruki3hhh <135201297+haruki3hhh@users.noreply.github.com> Date: Mon, 24 Jun 2024 18:08:27 -0500 Subject: [PATCH 563/585] Fix null pointer dereference in yasm_section_bcs_append (#263) --- libyasm/section.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libyasm/section.c b/libyasm/section.c index 592f5b86..1459eccc 100644 --- a/libyasm/section.c +++ b/libyasm/section.c @@ -629,6 +629,10 @@ yasm_bytecode * yasm_section_bcs_append(yasm_section *sect, yasm_bytecode *bc) { if (bc) { + if (!sect) { + yasm_error_set(YASM_ERROR_VALUE, "Attempt to append bytecode to a NULL section or with a NULL bytecode"); + return NULL; + } if (bc->callback) { bc->section = sect; /* record parent section */ STAILQ_INSERT_TAIL(§->bcs, bc, link); From e2c133fe295a48db4e0bac6710909668bb3a8002 Mon Sep 17 00:00:00 2001 From: jca Date: Tue, 27 Feb 2024 00:32:38 +0100 Subject: [PATCH 564/585] Add support for four bytes instructions --- modules/arch/x86/gen_x86_insn.py | 14 +++++++------- modules/arch/x86/x86arch.h | 2 +- modules/arch/x86/x86bc.c | 3 ++- modules/arch/x86/x86id.c | 31 +++++++++++++++++++------------ 4 files changed, 29 insertions(+), 21 deletions(-) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index 8914d789..99d26ff2 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -321,7 +321,7 @@ class GroupForm(object): cpus_str = "|".join("CPU_%s" % x for x in sorted(self.cpu)) - if len(self.modifiers) > 3: + if len(self.modifiers) > 4: raise ValueError("too many modifiers: %s" % (self.modifiers,)) cpus_str = [] @@ -337,9 +337,9 @@ class GroupForm(object): mods = ["MOD_%s" % x for x in self.modifiers] - # Ensure mods initializer string is 3 long - mods.extend(["0", "0", "0"]) - mod_str = "{" + ', '.join(mods[0:3]) + "}" + # Ensure mods initializer string is 4 long + mods.extend(["0", "0", "0", "0"]) + mod_str = "{" + ', '.join(mods[0:4]) + "}" gas_flags = [] if self.gas_only: @@ -479,12 +479,12 @@ class Insn(object): # Ensure cpus initializer string is 3 long cpus_str.extend(["0", "0", "0"]) - if len(self.modifiers) > 3: + if len(self.modifiers) > 4: raise ValueError("too many modifiers") mods_str = ["0x%02X" % x for x in self.modifiers] - # Ensure modifiers is at least 3 long - mods_str.extend(["0", "0", "0"]) + # Ensure modifiers is at least 4 long + mods_str.extend(["0", "0", "0", "0"]) return ",\t".join(["%s_insn" % self.groupname, "%d" % len(groups[self.groupname]), diff --git a/modules/arch/x86/x86arch.h b/modules/arch/x86/x86arch.h index 78c3d739..911482ee 100644 --- a/modules/arch/x86/x86arch.h +++ b/modules/arch/x86/x86arch.h @@ -235,7 +235,7 @@ typedef struct x86_common { } x86_common; typedef struct x86_opcode { - unsigned char opcode[3]; /* opcode */ + unsigned char opcode[4]; /* opcode */ unsigned char len; } x86_opcode; diff --git a/modules/arch/x86/x86bc.c b/modules/arch/x86/x86bc.c index 038d7a3f..a2c82d8c 100644 --- a/modules/arch/x86/x86bc.c +++ b/modules/arch/x86/x86bc.c @@ -426,10 +426,11 @@ x86_common_print(const x86_common *common, FILE *f, int indent_level) static void x86_opcode_print(const x86_opcode *opcode, FILE *f, int indent_level) { - fprintf(f, "%*sOpcode: %02x %02x %02x OpLen=%u\n", indent_level, "", + fprintf(f, "%*sOpcode: %02x %02x %02x %02x OpLen=%u\n", indent_level, "", (unsigned int)opcode->opcode[0], (unsigned int)opcode->opcode[1], (unsigned int)opcode->opcode[2], + (unsigned int)opcode->opcode[3], (unsigned int)opcode->len); } diff --git a/modules/arch/x86/x86id.c b/modules/arch/x86/x86id.c index 6207c206..6a766dc9 100644 --- a/modules/arch/x86/x86id.c +++ b/modules/arch/x86/x86id.c @@ -42,13 +42,14 @@ static const char *cpu_find_reverse(unsigned int cpu0, unsigned int cpu1, #define MOD_Op0Add 2 /* Parameter adds to opcode byte 0 */ #define MOD_Op1Add 3 /* Parameter adds to opcode byte 1 */ #define MOD_Op2Add 4 /* Parameter adds to opcode byte 2 */ -#define MOD_SpAdd 5 /* Parameter adds to "spare" value */ -#define MOD_OpSizeR 6 /* Parameter replaces opersize */ -#define MOD_Imm8 7 /* Parameter is included as immediate byte */ -#define MOD_AdSizeR 8 /* Parameter replaces addrsize (jmp only) */ -#define MOD_DOpS64R 9 /* Parameter replaces default 64-bit opersize */ -#define MOD_Op1AddSp 10 /* Parameter is added as "spare" to opcode byte 2 */ -#define MOD_SetVEX 11 /* Parameter replaces internal VEX prefix value */ +#define MOD_Op3Add 5 /* Parameter adds to opcode byte 3 */ +#define MOD_SpAdd 6 /* Parameter adds to "spare" value */ +#define MOD_OpSizeR 7 /* Parameter replaces opersize */ +#define MOD_Imm8 8 /* Parameter is included as immediate byte */ +#define MOD_AdSizeR 9 /* Parameter replaces addrsize (jmp only) */ +#define MOD_DOpS64R 10 /* Parameter replaces default 64-bit opersize */ +#define MOD_Op1AddSp 11 /* Parameter is added as "spare" to opcode byte 2 */ +#define MOD_SetVEX 12 /* Parameter replaces internal VEX prefix value */ /* GAS suffix flags for instructions */ enum x86_gas_suffix_flags { @@ -251,9 +252,9 @@ typedef struct x86_insn_info { * its parameter in LSB->MSB order from the arch-specific data[1] from the * lexer data, and the LSB of the arch-specific data[1] is reserved for the * count of insn_info structures in the instruction grouping, there can - * only be a maximum of 3 modifiers. + * only be a maximum of 4 modifiers. */ - unsigned char modifiers[3]; + unsigned char modifiers[4]; /* Operand Size */ unsigned char opersize; @@ -282,10 +283,10 @@ typedef struct x86_insn_info { /* The length of the basic opcode */ unsigned char opcode_len; - /* The basic 1-3 byte opcode (not including the special instruction + /* The basic 1-4 byte opcode (not including the special instruction * prefix). */ - unsigned char opcode[3]; + unsigned char opcode[4]; /* The 3-bit "spare" value (extended opcode) for the R/M byte field */ unsigned char spare; @@ -309,7 +310,7 @@ typedef struct x86_id_insn { wordptr cpu_enabled; /* Modifier data */ - unsigned char mod_data[3]; + unsigned char mod_data[4]; /* Number of elements in the instruction parse group */ unsigned int num_info:8; @@ -477,6 +478,9 @@ x86_finalize_jmpfar(yasm_bytecode *bc, yasm_bytecode *prev_bc, case MOD_Op2Add: jmpfar->opcode.opcode[2] += mod_data[i]; break; + case MOD_Op3Add: + jmpfar->opcode.opcode[3] += mod_data[i]; + break; case MOD_Op1AddSp: jmpfar->opcode.opcode[1] += mod_data[i]<<3; break; @@ -1197,6 +1201,9 @@ x86_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) case MOD_Op2Add: insn->opcode.opcode[2] += mod_data[i]; break; + case MOD_Op3Add: + insn->opcode.opcode[3] += mod_data[i]; + break; case MOD_SpAdd: spare += mod_data[i]; break; From b9c3fe6399d0d253bd3e6924f48fe29fb5cb6c23 Mon Sep 17 00:00:00 2001 From: jca Date: Tue, 27 Feb 2024 00:34:08 +0100 Subject: [PATCH 565/585] Add support for endbr32/endbr64 (#156) --- modules/arch/x86/gen_x86_insn.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py index 99d26ff2..ba41a4f1 100755 --- a/modules/arch/x86/gen_x86_insn.py +++ b/modules/arch/x86/gen_x86_insn.py @@ -691,6 +691,14 @@ add_group("threebyte", opcode=[0x00, 0x00, 0x00], operands=[]) +# +# Four byte opcode instructions with no operands +# +add_group("fourbyte", + modifiers=["Op0Add", "Op1Add", "Op2Add", "Op3Add"], + opcode=[0x00, 0x00, 0x00, 0x00], + operands=[]) + # # One byte opcode instructions with general memory operand # @@ -5475,6 +5483,9 @@ add_group("vmxthreebytemem", add_insn("vmclear", "vmxthreebytemem", modifiers=[0x66]) add_insn("vmxon", "vmxthreebytemem", modifiers=[0xF3]) +add_insn("endbr32", "fourbyte", modifiers=[0xF3, 0x0F, 0x1E, 0xFB]) +add_insn("endbr64", "fourbyte", modifiers=[0xF3, 0x0F, 0x1E, 0xFA]) + ##################################################################### # Intel SMX Instructions ##################################################################### From a2f8bdf075bcad90a1b0a446080906ef6afe6847 Mon Sep 17 00:00:00 2001 From: Yao Zi Date: Sun, 1 Jun 2025 03:09:20 +0000 Subject: [PATCH 566/585] dwarf2: Correctly initialize dwarf2_line_info.errwarns Forgetting to this causes unexpected control flow transfers and even misoptimizations. When building with LLVM 20.1.4 and LTO enabled, misoptimizations will ultimately lead to segfaults in dwarf2_gen64_test.sh. Signed-off-by: Yao Zi --- modules/dbgfmts/dwarf2/dwarf2-line.c | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/dbgfmts/dwarf2/dwarf2-line.c b/modules/dbgfmts/dwarf2/dwarf2-line.c index 10bb2f29..8943c067 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-line.c +++ b/modules/dbgfmts/dwarf2/dwarf2-line.c @@ -709,6 +709,7 @@ yasm_dwarf2__generate_line(yasm_object *object, yasm_linemap *linemap, info.dbgfmt_dwarf2 = dbgfmt_dwarf2; info.debug_line = yasm_object_get_general(object, ".debug_line", 1, 0, 0, &new, 0); + info.errwarns = errwarns; /* header */ head = yasm_dwarf2__add_head(dbgfmt_dwarf2, info.debug_line, NULL, 0, 0); From 9361f783cfa8aa8f0ad7ee34e6211dce31a2b240 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Sat, 13 Jun 2026 19:54:40 +0200 Subject: [PATCH 567/585] ci: bump dependencies + prepare for CMake build --- .github/workflows/build.yml | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0454d53c..69f42aa7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,32 +10,43 @@ jobs: fail-fast: false matrix: include: - - os: macos-latest - artifact-name: macOS - - os: ubuntu-latest - artifact-name: Ubuntu + - name: macOS + os: macos-latest + artifact: true + autotools: true + - name: Ubuntu + os: ubuntu-latest + artifact: true + autotools: true - name: "Build - ${{ matrix.artifact-name }}" + name: "Build - ${{ matrix.name }}" runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v6 - name: Install autotools + if: ${{ matrix.autotools }} run: | if [ "$RUNNER_OS" == "macOS" ]; then brew update brew install automake autoconf fi - - name: Autotools + - name: Autogen (autotools) + if: ${{ matrix.autotools }} run: ./autogen.sh - - name: Build + - name: Build (autotools) + if: ${{ matrix.autotools }} run: make - - name: Check + - name: Check (autotools) + if: ${{ matrix.autotools }} run: make check - - name: Dist + - name: Dist (autotools) + id: make-dist + if: ${{ matrix.autotools }} run: make dist - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v7 + if: ${{ matrix.artifact && always() && steps.make-dist.outcome == 'success' }} with: - name: ${{ matrix.artifact-name }} + name: ${{ matrix.name }} path: yasm-*.tar.gz From 7b15cffe2dee3099b91ec24c8166dad3266a2976 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Mon, 15 Jun 2026 11:25:14 +0200 Subject: [PATCH 568/585] ci: build CMake project on GitHub actions --- .github/workflows/build.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 69f42aa7..397a4c3e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,10 +14,15 @@ jobs: os: macos-latest artifact: true autotools: true + cmake: true - name: Ubuntu os: ubuntu-latest artifact: true autotools: true + cmake: true + - name: MSVC + os: windows-latest + cmake: true name: "Build - ${{ matrix.name }}" runs-on: ${{ matrix.os }} @@ -44,6 +49,13 @@ jobs: if: ${{ matrix.autotools }} run: make dist + - name: Configure (CMake) + if: ${{ matrix.cmake }} + run: cmake -S . -B build + - name: Build (CMake) + if: ${{ matrix.cmake }} + run: cmake --build build + - uses: actions/upload-artifact@v7 if: ${{ matrix.artifact && always() && steps.make-dist.outcome == 'success' }} with: From 1f09fa089dc3f2d54957f9ec3477b2f28f819f09 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Tue, 21 Jul 2026 07:29:03 +0200 Subject: [PATCH 569/585] cmake: register all modules in yasm_init_plugin (#301) Some modules were not registered when dynamically loading yasmstd. --- modules/objfmts/bin/CMakeLists.txt | 3 +++ modules/parsers/gas/CMakeLists.txt | 3 +++ modules/parsers/nasm/CMakeLists.txt | 3 +++ modules/preprocs/nasm/CMakeLists.txt | 2 ++ 4 files changed, 11 insertions(+) diff --git a/modules/objfmts/bin/CMakeLists.txt b/modules/objfmts/bin/CMakeLists.txt index a3d396a5..7af5e22b 100644 --- a/modules/objfmts/bin/CMakeLists.txt +++ b/modules/objfmts/bin/CMakeLists.txt @@ -1,3 +1,6 @@ YASM_ADD_MODULE(objfmt_bin objfmts/bin/bin-objfmt.c ) + +YASM_ADD_MODULE(objfmt_dosexe + ) diff --git a/modules/parsers/gas/CMakeLists.txt b/modules/parsers/gas/CMakeLists.txt index d4ecb3ea..8c59d4dd 100644 --- a/modules/parsers/gas/CMakeLists.txt +++ b/modules/parsers/gas/CMakeLists.txt @@ -10,3 +10,6 @@ YASM_ADD_MODULE(parser_gas parsers/gas/gas-parse-intel.c gas-token.c ) + +YASM_ADD_MODULE(parser_gnu + ) diff --git a/modules/parsers/nasm/CMakeLists.txt b/modules/parsers/nasm/CMakeLists.txt index 7a060d29..9f40beb2 100644 --- a/modules/parsers/nasm/CMakeLists.txt +++ b/modules/parsers/nasm/CMakeLists.txt @@ -19,3 +19,6 @@ YASM_ADD_MODULE(parser_nasm parsers/nasm/nasm-parse.c nasm-token.c ) + +YASM_ADD_MODULE(parser_tasm + ) diff --git a/modules/preprocs/nasm/CMakeLists.txt b/modules/preprocs/nasm/CMakeLists.txt index e10a9dd1..e68cd25c 100644 --- a/modules/preprocs/nasm/CMakeLists.txt +++ b/modules/preprocs/nasm/CMakeLists.txt @@ -23,3 +23,5 @@ YASM_ADD_MODULE(preproc_nasm preprocs/nasm/nasm-eval.c ) +YASM_ADD_MODULE(preproc_tasm + ) From 3199a84f0c31d4998802480c5474f8ba1be0882b Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Tue, 21 Jul 2026 07:29:56 +0200 Subject: [PATCH 570/585] Ensure all reference hex files have trailing spaces (#303) --- modules/parsers/gas/tests/bin/gas-set.hex | 22 ++++++++++---------- modules/parsers/gas/tests/bin/reptnested.hex | 20 +++++++++--------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/modules/parsers/gas/tests/bin/gas-set.hex b/modules/parsers/gas/tests/bin/gas-set.hex index 54ccb308..c0a5bfcf 100644 --- a/modules/parsers/gas/tests/bin/gas-set.hex +++ b/modules/parsers/gas/tests/bin/gas-set.hex @@ -1,12 +1,12 @@ 05 -04 -06 -04 -0a -07 -08 -04 -06 -11 -06 -fe +04 +06 +04 +0a +07 +08 +04 +06 +11 +06 +fe diff --git a/modules/parsers/gas/tests/bin/reptnested.hex b/modules/parsers/gas/tests/bin/reptnested.hex index 451c1d31..9ec32fc7 100644 --- a/modules/parsers/gas/tests/bin/reptnested.hex +++ b/modules/parsers/gas/tests/bin/reptnested.hex @@ -1,10 +1,10 @@ -01 -03 -03 -01 -03 -03 -01 -03 -03 -05 +01 +03 +03 +01 +03 +03 +01 +03 +03 +05 From 74d88e80be109af58784b28ba25195a2c1c7a631 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Tue, 21 Jul 2026 07:30:19 +0200 Subject: [PATCH 571/585] cmake: add build dependency of the frontends to yasmstd and add its directory to RUNPATH (#302) --- frontends/tasm/CMakeLists.txt | 2 ++ frontends/vsyasm/CMakeLists.txt | 2 ++ frontends/yasm/CMakeLists.txt | 2 ++ 3 files changed, 6 insertions(+) diff --git a/frontends/tasm/CMakeLists.txt b/frontends/tasm/CMakeLists.txt index e275ab84..627f9f2f 100644 --- a/frontends/tasm/CMakeLists.txt +++ b/frontends/tasm/CMakeLists.txt @@ -28,6 +28,8 @@ ELSE(BUILD_SHARED_LIBS) tasm-options.c ) TARGET_LINK_LIBRARIES(ytasm yasmstd libyasm) + ADD_DEPENDENCIES(ytasm yasmstd) + SET_PROPERTY(TARGET ytasm APPEND PROPERTY BUILD_RPATH "$") ENDIF(BUILD_SHARED_LIBS) SET_SOURCE_FILES_PROPERTIES(tasm.c PROPERTIES diff --git a/frontends/vsyasm/CMakeLists.txt b/frontends/vsyasm/CMakeLists.txt index 6815b18d..f5c1f15c 100644 --- a/frontends/vsyasm/CMakeLists.txt +++ b/frontends/vsyasm/CMakeLists.txt @@ -22,6 +22,8 @@ IF(BUILD_SHARED_LIBS) ${yasm_SOURCE_DIR}/frontends/yasm/yasm-plugin.c ) TARGET_LINK_LIBRARIES(vsyasm libyasm ${LIBDL}) + ADD_DEPENDENCIES(vsyasm yasmstd) + SET_PROPERTY(TARGET vsyasm APPEND PROPERTY BUILD_RPATH "$") ELSE(BUILD_SHARED_LIBS) ADD_EXECUTABLE(vsyasm vsyasm.c diff --git a/frontends/yasm/CMakeLists.txt b/frontends/yasm/CMakeLists.txt index b11d7f82..6da0cd49 100644 --- a/frontends/yasm/CMakeLists.txt +++ b/frontends/yasm/CMakeLists.txt @@ -19,6 +19,8 @@ IF(BUILD_SHARED_LIBS) yasm-plugin.c ) TARGET_LINK_LIBRARIES(yasm libyasm ${LIBDL}) + ADD_DEPENDENCIES(yasm yasmstd) + SET_PROPERTY(TARGET yasm APPEND PROPERTY BUILD_RPATH "$") ELSE(BUILD_SHARED_LIBS) ADD_EXECUTABLE(yasm yasm.c From 430e4f55c079141f36ccf384eac0770213b4bf8c Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Tue, 21 Jul 2026 07:30:44 +0200 Subject: [PATCH 572/585] subminor of a macho buildversion is optional (#304) This fixes a difference in behavior between yasm built by autotools and cmake (due to different compile flags) --- modules/objfmts/macho/macho-objfmt.c | 1 + modules/objfmts/macho/tests/nasm64/macho64-buildversion.hex | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/objfmts/macho/macho-objfmt.c b/modules/objfmts/macho/macho-objfmt.c index 74ac3573..7fec0147 100644 --- a/modules/objfmts/macho/macho-objfmt.c +++ b/modules/objfmts/macho/macho-objfmt.c @@ -1605,6 +1605,7 @@ parse_version(unsigned long *out, const yasm_valparam *vp) return; } + subminor = 0; m = sscanf(vp->param.str, "%lu.%lu.%lu", &major, &minor, &subminor); if (m < 2) { yasm_error_set(YASM_ERROR_VALUE, diff --git a/modules/objfmts/macho/tests/nasm64/macho64-buildversion.hex b/modules/objfmts/macho/tests/nasm64/macho64-buildversion.hex index bbb9efaa..c8ed6de9 100644 --- a/modules/objfmts/macho/tests/nasm64/macho64-buildversion.hex +++ b/modules/objfmts/macho/tests/nasm64/macho64-buildversion.hex @@ -46,7 +46,7 @@ fe 0e 0a 00 -02 +00 07 0a 00 From baa3b160ce96ec5e19d8a74b62fbb11bf668ff2f Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Tue, 21 Jul 2026 07:31:42 +0200 Subject: [PATCH 573/585] Don't output absolute output path in binfmt mapfile for tests (#305) --- modules/objfmts/bin/bin-objfmt.c | 11 ++++++++++- modules/objfmts/bin/tests/multisect/bin-align.map | 2 +- modules/objfmts/bin/tests/multisect/bin-ssym.map | 2 +- modules/objfmts/bin/tests/multisect/initbss.map | 2 +- modules/objfmts/bin/tests/multisect/ldlinux-sects.map | 2 +- modules/objfmts/bin/tests/multisect/multisect1.map | 2 +- modules/objfmts/bin/tests/multisect/multisect2.map | 2 +- modules/objfmts/bin/tests/multisect/multisect3.map | 2 +- modules/objfmts/bin/tests/multisect/multisect4.map | 2 +- modules/objfmts/bin/tests/multisect/multisect5.map | 2 +- modules/objfmts/bin/tests/multisect/nomultisect1.map | 2 +- modules/objfmts/bin/tests/multisect/nomultisect2.map | 2 +- modules/parsers/nasm/tests/worphan/orphanwarn.errwarn | 4 ++-- 13 files changed, 23 insertions(+), 14 deletions(-) diff --git a/modules/objfmts/bin/bin-objfmt.c b/modules/objfmts/bin/bin-objfmt.c index a38c3422..c5abd87a 100644 --- a/modules/objfmts/bin/bin-objfmt.c +++ b/modules/objfmts/bin/bin-objfmt.c @@ -30,6 +30,7 @@ #include #endif #include +#include #define REGULAR_OUTBUF_SIZE 1024 @@ -778,7 +779,15 @@ output_map(bin_objfmt_output_info *info) for (i=0; i<63; i++) fputc('-', f); fprintf(f, "\n\nSource file: %s\n", info->object->src_filename); - fprintf(f, "Output file: %s\n\n", info->object->obj_filename); + if (getenv("YASM_TEST_SUITE")) { + const char *filename = info->object->obj_filename; + const char *next_filename; + while ((next_filename = strpbrk(filename, "/\\"))) + filename = next_filename + 1; + fprintf(f, "Output file: %s\n\n", filename); + } else { + fprintf(f, "Output file: %s\n\n", info->object->obj_filename); + } fprintf(f, "-- Program origin "); for (i=0; i<61; i++) diff --git a/modules/objfmts/bin/tests/multisect/bin-align.map b/modules/objfmts/bin/tests/multisect/bin-align.map index 3031bd15..bb5a8f23 100644 --- a/modules/objfmts/bin/tests/multisect/bin-align.map +++ b/modules/objfmts/bin/tests/multisect/bin-align.map @@ -2,7 +2,7 @@ - YASM Map file --------------------------------------------------------------- Source file: - -Output file: results/bin-align +Output file: bin-align -- Program origin ------------------------------------------------------------- diff --git a/modules/objfmts/bin/tests/multisect/bin-ssym.map b/modules/objfmts/bin/tests/multisect/bin-ssym.map index 9ddfe168..112dc02b 100644 --- a/modules/objfmts/bin/tests/multisect/bin-ssym.map +++ b/modules/objfmts/bin/tests/multisect/bin-ssym.map @@ -2,7 +2,7 @@ - YASM Map file --------------------------------------------------------------- Source file: - -Output file: results/bin-ssym +Output file: bin-ssym -- Program origin ------------------------------------------------------------- diff --git a/modules/objfmts/bin/tests/multisect/initbss.map b/modules/objfmts/bin/tests/multisect/initbss.map index d26734de..dc444f56 100644 --- a/modules/objfmts/bin/tests/multisect/initbss.map +++ b/modules/objfmts/bin/tests/multisect/initbss.map @@ -2,7 +2,7 @@ - YASM Map file --------------------------------------------------------------- Source file: - -Output file: results/initbss +Output file: initbss -- Program origin ------------------------------------------------------------- diff --git a/modules/objfmts/bin/tests/multisect/ldlinux-sects.map b/modules/objfmts/bin/tests/multisect/ldlinux-sects.map index 03fde845..3a5e33e3 100644 --- a/modules/objfmts/bin/tests/multisect/ldlinux-sects.map +++ b/modules/objfmts/bin/tests/multisect/ldlinux-sects.map @@ -2,7 +2,7 @@ - YASM Map file --------------------------------------------------------------- Source file: - -Output file: results/ldlinux-sects +Output file: ldlinux-sects -- Program origin ------------------------------------------------------------- diff --git a/modules/objfmts/bin/tests/multisect/multisect1.map b/modules/objfmts/bin/tests/multisect/multisect1.map index 0a56e413..f52da415 100644 --- a/modules/objfmts/bin/tests/multisect/multisect1.map +++ b/modules/objfmts/bin/tests/multisect/multisect1.map @@ -2,7 +2,7 @@ - YASM Map file --------------------------------------------------------------- Source file: - -Output file: results/multisect1 +Output file: multisect1 -- Program origin ------------------------------------------------------------- diff --git a/modules/objfmts/bin/tests/multisect/multisect2.map b/modules/objfmts/bin/tests/multisect/multisect2.map index 82002edb..858da399 100644 --- a/modules/objfmts/bin/tests/multisect/multisect2.map +++ b/modules/objfmts/bin/tests/multisect/multisect2.map @@ -2,7 +2,7 @@ - YASM Map file --------------------------------------------------------------- Source file: - -Output file: results/multisect2 +Output file: multisect2 -- Program origin ------------------------------------------------------------- diff --git a/modules/objfmts/bin/tests/multisect/multisect3.map b/modules/objfmts/bin/tests/multisect/multisect3.map index 1c67c227..a3f651b2 100644 --- a/modules/objfmts/bin/tests/multisect/multisect3.map +++ b/modules/objfmts/bin/tests/multisect/multisect3.map @@ -2,7 +2,7 @@ - YASM Map file --------------------------------------------------------------- Source file: - -Output file: results/multisect3 +Output file: multisect3 -- Program origin ------------------------------------------------------------- diff --git a/modules/objfmts/bin/tests/multisect/multisect4.map b/modules/objfmts/bin/tests/multisect/multisect4.map index e1940dc6..bb97c9f2 100644 --- a/modules/objfmts/bin/tests/multisect/multisect4.map +++ b/modules/objfmts/bin/tests/multisect/multisect4.map @@ -2,7 +2,7 @@ - YASM Map file --------------------------------------------------------------- Source file: - -Output file: results/multisect4 +Output file: multisect4 -- Program origin ------------------------------------------------------------- diff --git a/modules/objfmts/bin/tests/multisect/multisect5.map b/modules/objfmts/bin/tests/multisect/multisect5.map index 4c052be6..e5c972a3 100644 --- a/modules/objfmts/bin/tests/multisect/multisect5.map +++ b/modules/objfmts/bin/tests/multisect/multisect5.map @@ -2,7 +2,7 @@ - YASM Map file --------------------------------------------------------------- Source file: - -Output file: results/multisect5 +Output file: multisect5 -- Program origin ------------------------------------------------------------- diff --git a/modules/objfmts/bin/tests/multisect/nomultisect1.map b/modules/objfmts/bin/tests/multisect/nomultisect1.map index 89974207..0745189b 100644 --- a/modules/objfmts/bin/tests/multisect/nomultisect1.map +++ b/modules/objfmts/bin/tests/multisect/nomultisect1.map @@ -2,7 +2,7 @@ - YASM Map file --------------------------------------------------------------- Source file: - -Output file: results/nomultisect1 +Output file: nomultisect1 -- Program origin ------------------------------------------------------------- diff --git a/modules/objfmts/bin/tests/multisect/nomultisect2.map b/modules/objfmts/bin/tests/multisect/nomultisect2.map index cc6d9c87..7a9d306f 100644 --- a/modules/objfmts/bin/tests/multisect/nomultisect2.map +++ b/modules/objfmts/bin/tests/multisect/nomultisect2.map @@ -2,7 +2,7 @@ - YASM Map file --------------------------------------------------------------- Source file: - -Output file: results/nomultisect2 +Output file: nomultisect2 -- Program origin ------------------------------------------------------------- diff --git a/modules/parsers/nasm/tests/worphan/orphanwarn.errwarn b/modules/parsers/nasm/tests/worphan/orphanwarn.errwarn index 0953e811..d0071f2c 100644 --- a/modules/parsers/nasm/tests/worphan/orphanwarn.errwarn +++ b/modules/parsers/nasm/tests/worphan/orphanwarn.errwarn @@ -1,2 +1,2 @@ --:2: warning: label alone on aline without a colon might be in error --:3: warning: label alone on aline without a colon might be in error +-:2: warning: label alone on a line without a colon might be in error +-:3: warning: label alone on a line without a colon might be in error From 7a7762c3378b277c90c7868e2361644d80083740 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Tue, 21 Jul 2026 07:36:19 +0200 Subject: [PATCH 574/585] cmake: support CMake 4.0 and cross building (#307) --- CMakeLists.txt | 2 +- ConfigureChecks.cmake | 3 ++- cmake/modules/YasmMacros.cmake | 13 +++---------- libyasm/CMakeLists.txt | 3 +++ modules/CMakeLists.txt | 1 + modules/preprocs/nasm/CMakeLists.txt | 12 +++++++++--- plugins/dbg/CMakeLists.txt | 3 +++ plugins/x86/CMakeLists.txt | 4 ++++ tools/genmacro/CMakeLists.txt | 8 ++++++++ tools/genperf/CMakeLists.txt | 8 ++++++++ tools/re2c/CMakeLists.txt | 8 ++++++++ 11 files changed, 50 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8df871cf..9e1bb76b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.4...4.0) PROJECT(yasm) -CMAKE_MINIMUM_REQUIRED(VERSION 2.4) if (COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif (COMMAND cmake_policy) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 73a1a4c2..1eb43acf 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -35,7 +35,8 @@ CONFIGURE_FILE(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) ADD_DEFINITIONS(-DHAVE_CONFIG_H) -INCLUDE(FindPythonInterp) +FIND_PACKAGE(Python3 REQUIRED COMPONENTS Interpreter) +set(PYTHON_EXECUTABLE "${Python3_EXECUTABLE}") IF (NOT PYTHON_EXECUTABLE) MESSAGE(FATAL_ERROR "Could not find Python executable") ENDIF (NOT PYTHON_EXECUTABLE) diff --git a/cmake/modules/YasmMacros.cmake b/cmake/modules/YasmMacros.cmake index ab1be00e..0214c908 100644 --- a/cmake/modules/YasmMacros.cmake +++ b/cmake/modules/YasmMacros.cmake @@ -58,31 +58,24 @@ macro (YASM_ADD_MODULE _module_NAME) endmacro (YASM_ADD_MODULE) macro (YASM_GENPERF _in_NAME _out_NAME) - get_target_property(_tmp_GENPERF_EXE genperf LOCATION) add_custom_command( OUTPUT ${_out_NAME} - COMMAND ${_tmp_GENPERF_EXE} ${_in_NAME} ${_out_NAME} - DEPENDS ${_tmp_GENPERF_EXE} + COMMAND yasm::genperf ${_in_NAME} ${_out_NAME} MAIN_DEPENDENCY ${_in_NAME} ) endmacro (YASM_GENPERF) macro (YASM_RE2C _in_NAME _out_NAME) - get_target_property(_tmp_RE2C_EXE re2c LOCATION) add_custom_command( OUTPUT ${_out_NAME} - COMMAND ${_tmp_RE2C_EXE} ${ARGN} -o ${_out_NAME} ${_in_NAME} - DEPENDS ${_tmp_RE2C_EXE} - MAIN_DEPENDENCY ${_in_NAME} + COMMAND yasm::re2c ${ARGN} -o ${_out_NAME} ${_in_NAME} ) endmacro (YASM_RE2C) macro (YASM_GENMACRO _in_NAME _out_NAME _var_NAME) - get_target_property(_tmp_GENMACRO_EXE genmacro LOCATION) add_custom_command( OUTPUT ${_out_NAME} - COMMAND ${_tmp_GENMACRO_EXE} ${_out_NAME} ${_var_NAME} ${_in_NAME} - DEPENDS ${_tmp_GENMACRO_EXE} + COMMAND yasm::genmacro ${_out_NAME} ${_var_NAME} ${_in_NAME} MAIN_DEPENDENCY ${_in_NAME} ) endmacro (YASM_GENMACRO) diff --git a/libyasm/CMakeLists.txt b/libyasm/CMakeLists.txt index bd9b7b28..0299ac56 100644 --- a/libyasm/CMakeLists.txt +++ b/libyasm/CMakeLists.txt @@ -36,6 +36,9 @@ IF(BUILD_SHARED_LIBS) OUTPUT_NAME "yasm" COMPILE_FLAGS -DYASM_LIB_SOURCE ) + if(WIN32) + SET_PROPERTY(TARGET libyasm PROPERTY PREFIX "") + endif() ELSE(BUILD_SHARED_LIBS) SET_TARGET_PROPERTIES(libyasm PROPERTIES COMPILE_FLAGS -DYASM_LIB_SOURCE diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt index b6eceb0e..6e59cb52 100644 --- a/modules/CMakeLists.txt +++ b/modules/CMakeLists.txt @@ -90,6 +90,7 @@ IF(BUILD_SHARED_LIBS) TARGET_LINK_LIBRARIES(yasmstd libyasm) IF(WIN32) + SET_PROPERTY(TARGET yasmstd PROPERTY PREFIX "") INSTALL(TARGETS yasmstd LIBRARY DESTINATION bin) ELSE(WIN32) INSTALL(TARGETS yasmstd LIBRARY DESTINATION lib) diff --git a/modules/preprocs/nasm/CMakeLists.txt b/modules/preprocs/nasm/CMakeLists.txt index e68cd25c..b5abaa74 100644 --- a/modules/preprocs/nasm/CMakeLists.txt +++ b/modules/preprocs/nasm/CMakeLists.txt @@ -1,9 +1,15 @@ add_executable(genversion preprocs/nasm/genversion.c) -get_target_property(_tmp_GENVERSION_EXE genversion LOCATION) +if(CMAKE_CROSSCOMPILING) + find_program(GENVERSION_BIN NAMES genversion REQUIRED) + add_executable(yasm::genversion IMPORTED GLOBAL) + set_property(TARGET yasm::genversion PROPERTY IMPORTED_LOCATION "${GENVERSION_BIN}") +else() + add_executable(yasm::genversion ALIAS genversion) +endif() + add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/version.mac - COMMAND ${_tmp_GENVERSION_EXE} ${CMAKE_CURRENT_BINARY_DIR}/version.mac - DEPENDS ${_tmp_GENVERSION_EXE} + COMMAND yasm::genversion ${CMAKE_CURRENT_BINARY_DIR}/version.mac ) YASM_GENMACRO( diff --git a/plugins/dbg/CMakeLists.txt b/plugins/dbg/CMakeLists.txt index 3d4fe681..b0b9653f 100644 --- a/plugins/dbg/CMakeLists.txt +++ b/plugins/dbg/CMakeLists.txt @@ -54,3 +54,6 @@ ADD_LIBRARY(dbgmod MODULE dbg-objfmt.c ) TARGET_LINK_LIBRARIES(dbgmod ${YASM_LIBRARY}) +if(WIN32) + SET_PROPERTY(TARGET dbgmod PROPERTY PREFIX "") +endif() diff --git a/plugins/x86/CMakeLists.txt b/plugins/x86/CMakeLists.txt index d0e10dae..87343dd3 100644 --- a/plugins/x86/CMakeLists.txt +++ b/plugins/x86/CMakeLists.txt @@ -143,3 +143,7 @@ ADD_LIBRARY(x86mod MODULE x86regtmod.c ) TARGET_LINK_LIBRARIES(x86mod ${YASM_LIBRARY}) + +if(WIN32) + SET_PROPERTY(TARGET x86mod PROPERTY PREFIX "") +endif() diff --git a/tools/genmacro/CMakeLists.txt b/tools/genmacro/CMakeLists.txt index 27ba5996..9e8933b0 100644 --- a/tools/genmacro/CMakeLists.txt +++ b/tools/genmacro/CMakeLists.txt @@ -1,3 +1,11 @@ add_executable(genmacro genmacro.c ) + +if(CMAKE_CROSSCOMPILING) + find_program(GENMACRO_BIN NAMES genmacro REQUIRED) + add_executable(yasm::genmacro IMPORTED GLOBAL) + set_property(TARGET yasm::genmacro PROPERTY IMPORTED_LOCATION "${GENMACRO_BIN}") +else() + add_executable(yasm::genmacro ALIAS genmacro) +endif() diff --git a/tools/genperf/CMakeLists.txt b/tools/genperf/CMakeLists.txt index 6f50989e..c9db7c11 100644 --- a/tools/genperf/CMakeLists.txt +++ b/tools/genperf/CMakeLists.txt @@ -6,3 +6,11 @@ add_executable(genperf ../../libyasm/xstrdup.c ) set_target_properties(genperf PROPERTIES COMPILE_FLAGS -DYASM_LIB_DECL=) + +if(CMAKE_CROSSCOMPILING) + find_program(GENPERF_BIN NAMES genperf REQUIRED) + add_executable(yasm::genperf IMPORTED GLOBAL) + set_property(TARGET yasm::genperf PROPERTY IMPORTED_LOCATION "${GENPERF_BIN}") +else() + add_executable(yasm::genperf ALIAS genperf) +endif() diff --git a/tools/re2c/CMakeLists.txt b/tools/re2c/CMakeLists.txt index 7125d496..2a25f733 100644 --- a/tools/re2c/CMakeLists.txt +++ b/tools/re2c/CMakeLists.txt @@ -9,3 +9,11 @@ add_executable(re2c substr.c translate.c ) + +if(CMAKE_CROSSCOMPILING) + find_program(RE2C_BIN NAMES re2c REQUIRED) + add_executable(yasm::re2c IMPORTED GLOBAL) + set_property(TARGET yasm::re2c PROPERTY IMPORTED_LOCATION "${RE2C_BIN}") +else() + add_executable(yasm::re2c ALIAS re2c) +endif() From 715d3d5c5c955155bd53f2577693c8803ced8d01 Mon Sep 17 00:00:00 2001 From: Martin 'JaMa' Jansa Date: Wed, 22 Jul 2026 03:45:50 +0200 Subject: [PATCH 575/585] bitvect: fix build with gcc-15 (#287) * fixes: libyasm/bitvect.h:86:32: error: cannot use keyword 'false' as enumeration constant 86 | typedef enum boolean { false = FALSE, true = TRUE } boolean; | ^~~~~ ../git/libyasm/bitvect.h:86:32: note: 'false' is a keyword with '-std=c23' onwards as suggested in: https://github.com/yasm/yasm/issues/283#issuecomment-2661108816 Signed-off-by: Martin Jansa --- libyasm/bitvect.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libyasm/bitvect.h b/libyasm/bitvect.h index 3aee3a53..a13470ad 100644 --- a/libyasm/bitvect.h +++ b/libyasm/bitvect.h @@ -83,7 +83,11 @@ typedef Z_longword *Z_longwordptr; #ifdef MACOS_TRADITIONAL #define boolean Boolean #else - typedef enum boolean { false = FALSE, true = TRUE } boolean; + #if __STDC_VERSION__ < 202311L + typedef enum boolean { false = FALSE, true = TRUE } boolean; + #else + typedef bool boolean; + #endif #endif #endif From 5062329be0d59b91f0e8b11b6a0b11525d7d7cad Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Wed, 22 Jul 2026 03:47:42 +0200 Subject: [PATCH 576/585] Remove MSBuild projects (#310) CMake supports MSVC. CMake can also drive a DJGPP toolchain, but its makefile is simple enough. --- Makefile.am | 80 --- Mkfiles/nightly-build.pl | 47 -- Mkfiles/vc10/config.h | 170 ----- Mkfiles/vc10/crt_secure_no_deprecate.props | 11 - Mkfiles/vc10/crt_secure_no_deprecate.vsprops | 11 - Mkfiles/vc10/genmacro/genmacro.vcxproj | 117 ---- .../vc10/genmacro/genmacro.vcxproj.filters | 17 - Mkfiles/vc10/genmacro/run.bat | 5 - Mkfiles/vc10/genmodule/genmodule.vcxproj | 118 ---- .../vc10/genmodule/genmodule.vcxproj.filters | 20 - Mkfiles/vc10/genmodule/run.bat | 3 - Mkfiles/vc10/genperf/genperf.vcxproj | 144 ---- Mkfiles/vc10/genperf/genperf.vcxproj.filters | 56 -- Mkfiles/vc10/genperf/run.bat | 39 -- Mkfiles/vc10/genstring/genstring.vcxproj | 111 ---- .../vc10/genstring/genstring.vcxproj.filters | 17 - Mkfiles/vc10/genstring/run.bat | 2 - Mkfiles/vc10/genversion/genversion.vcxproj | 126 ---- .../genversion/genversion.vcxproj.filters | 26 - Mkfiles/vc10/genversion/run.bat | 2 - Mkfiles/vc10/genversion/runpre.bat | 2 - Mkfiles/vc10/libyasm-stdint.h | 8 - Mkfiles/vc10/libyasm/libyasm.vcxproj | 273 -------- Mkfiles/vc10/libyasm/libyasm.vcxproj.filters | 200 ------ Mkfiles/vc10/modules/modules.vcxproj | 320 --------- Mkfiles/vc10/modules/modules.vcxproj.filters | 256 -------- Mkfiles/vc10/out_copy_rename.bat | 42 -- Mkfiles/vc10/re2c/re2c.vcxproj | 134 ---- Mkfiles/vc10/re2c/re2c.vcxproj.filters | 80 --- Mkfiles/vc10/re2c/run.bat | 4 - Mkfiles/vc10/readme.vc10.txt | 119 ---- Mkfiles/vc10/vsyasm.props | 27 - Mkfiles/vc10/vsyasm.targets | 108 --- Mkfiles/vc10/vsyasm.vcxproj | 275 -------- Mkfiles/vc10/vsyasm.xml | 283 -------- Mkfiles/vc10/yasm.sln | 140 ---- Mkfiles/vc10/yasm.vcxproj | 279 -------- Mkfiles/vc10/yasm.vcxproj.filters | 41 -- Mkfiles/vc10/ytasm.vcxproj | 274 -------- Mkfiles/vc12/config.h | 170 ----- Mkfiles/vc12/crt_secure_no_deprecate.props | 11 - Mkfiles/vc12/crt_secure_no_deprecate.vsprops | 11 - Mkfiles/vc12/libyasm/libyasm.vcxproj | 277 -------- Mkfiles/vc12/libyasm/libyasm.vcxproj.filters | 200 ------ Mkfiles/vc12/modules/modules.vcxproj | 324 --------- Mkfiles/vc12/modules/modules.vcxproj.filters | 256 -------- Mkfiles/vc12/out_copy_rename.bat | 42 -- Mkfiles/vc12/readme.vc12.txt | 106 --- Mkfiles/vc12/vsyasm.props | 27 - Mkfiles/vc12/vsyasm.targets | 108 --- Mkfiles/vc12/vsyasm.vcxproj | 279 -------- Mkfiles/vc12/vsyasm.xml | 283 -------- Mkfiles/vc12/yasm.sln | 142 ---- Mkfiles/vc12/yasm.vcxproj | 283 -------- Mkfiles/vc12/yasm.vcxproj.filters | 41 -- Mkfiles/vc12/ytasm.vcxproj | 278 -------- Mkfiles/vc14/config.h | 170 ----- Mkfiles/vc14/crt_secure_no_deprecate.props | 11 - Mkfiles/vc14/crt_secure_no_deprecate.vsprops | 11 - Mkfiles/vc14/genmacro/genmacro.vcxproj | 202 ------ .../vc14/genmacro/genmacro.vcxproj.filters | 17 - Mkfiles/vc14/genmacro/run.bat | 5 - Mkfiles/vc14/genmodule/genmodule.vcxproj | 207 ------ .../vc14/genmodule/genmodule.vcxproj.filters | 20 - Mkfiles/vc14/genmodule/run.bat | 3 - Mkfiles/vc14/genperf/genperf.vcxproj | 261 -------- Mkfiles/vc14/genperf/genperf.vcxproj.filters | 56 -- Mkfiles/vc14/genperf/run.bat | 40 -- Mkfiles/vc14/genstring/genstring.vcxproj | 196 ------ .../vc14/genstring/genstring.vcxproj.filters | 17 - Mkfiles/vc14/genstring/run.bat | 2 - Mkfiles/vc14/genversion/genversion.vcxproj | 223 ------- .../genversion/genversion.vcxproj.filters | 26 - Mkfiles/vc14/genversion/run.bat | 2 - Mkfiles/vc14/genversion/runpre.bat | 2 - Mkfiles/vc14/libyasm-stdint.h | 8 - Mkfiles/vc14/libyasm/libyasm.vcxproj | 277 -------- Mkfiles/vc14/libyasm/libyasm.vcxproj.filters | 200 ------ Mkfiles/vc14/modules/modules.vcxproj | 324 --------- Mkfiles/vc14/modules/modules.vcxproj.filters | 256 -------- Mkfiles/vc14/out_copy_rename.bat | 42 -- Mkfiles/vc14/re2c/re2c.vcxproj | 221 ------- Mkfiles/vc14/re2c/re2c.vcxproj.filters | 80 --- Mkfiles/vc14/re2c/run.bat | 4 - Mkfiles/vc14/readme.vc14.txt | 106 --- Mkfiles/vc14/vsyasm.props | 27 - Mkfiles/vc14/vsyasm.targets | 108 --- Mkfiles/vc14/vsyasm.vcxproj | 279 -------- Mkfiles/vc14/vsyasm.xml | 283 -------- Mkfiles/vc14/yasm.sln | 142 ---- Mkfiles/vc14/yasm.vcxproj | 283 -------- Mkfiles/vc14/yasm.vcxproj.filters | 41 -- Mkfiles/vc14/ytasm.vcxproj | 278 -------- Mkfiles/vc15/config.h | 170 ----- Mkfiles/vc15/crt_secure_no_deprecate.props | 11 - Mkfiles/vc15/crt_secure_no_deprecate.vsprops | 11 - Mkfiles/vc15/genmacro/genmacro.vcxproj | 202 ------ .../vc15/genmacro/genmacro.vcxproj.filters | 17 - Mkfiles/vc15/genmacro/run.bat | 5 - Mkfiles/vc15/genmodule/genmodule.vcxproj | 207 ------ .../vc15/genmodule/genmodule.vcxproj.filters | 20 - Mkfiles/vc15/genmodule/run.bat | 3 - Mkfiles/vc15/genperf/genperf.vcxproj | 261 -------- Mkfiles/vc15/genperf/genperf.vcxproj.filters | 56 -- Mkfiles/vc15/genperf/run.bat | 40 -- Mkfiles/vc15/genstring/genstring.vcxproj | 196 ------ .../vc15/genstring/genstring.vcxproj.filters | 17 - Mkfiles/vc15/genstring/run.bat | 2 - Mkfiles/vc15/genversion/genversion.vcxproj | 223 ------- .../genversion/genversion.vcxproj.filters | 26 - Mkfiles/vc15/genversion/run.bat | 2 - Mkfiles/vc15/genversion/runpre.bat | 2 - Mkfiles/vc15/libyasm-stdint.h | 8 - Mkfiles/vc15/libyasm/libyasm.vcxproj | 277 -------- Mkfiles/vc15/libyasm/libyasm.vcxproj.filters | 200 ------ Mkfiles/vc15/modules/modules.vcxproj | 324 --------- Mkfiles/vc15/modules/modules.vcxproj.filters | 256 -------- Mkfiles/vc15/out_copy_rename.bat | 42 -- Mkfiles/vc15/re2c/re2c.vcxproj | 221 ------- Mkfiles/vc15/re2c/re2c.vcxproj.filters | 80 --- Mkfiles/vc15/re2c/run.bat | 4 - Mkfiles/vc15/readme.vc14.txt | 106 --- Mkfiles/vc15/vsyasm.props | 27 - Mkfiles/vc15/vsyasm.targets | 110 ---- Mkfiles/vc15/vsyasm.vcxproj | 279 -------- Mkfiles/vc15/vsyasm.xml | 283 -------- Mkfiles/vc15/yasm.sln | 142 ---- Mkfiles/vc15/yasm.vcxproj | 283 -------- Mkfiles/vc15/yasm.vcxproj.filters | 41 -- Mkfiles/vc15/ytasm.vcxproj | 278 -------- Mkfiles/vc9/config.h | 170 ----- Mkfiles/vc9/crt_secure_no_deprecate.vsprops | 11 - Mkfiles/vc9/genmacro/genmacro.vcproj | 198 ------ Mkfiles/vc9/genmacro/run.bat | 5 - Mkfiles/vc9/genmodule/genmodule.vcproj | 202 ------ Mkfiles/vc9/genmodule/run.bat | 3 - Mkfiles/vc9/genperf/genperf.vcproj | 234 ------- Mkfiles/vc9/genperf/run.bat | 22 - Mkfiles/vc9/genstring/genstring.vcproj | 198 ------ Mkfiles/vc9/genstring/run.bat | 2 - Mkfiles/vc9/genversion/genversion.vcproj | 211 ------ Mkfiles/vc9/genversion/run.bat | 2 - Mkfiles/vc9/genversion/runpre.bat | 2 - Mkfiles/vc9/libyasm-stdint.h | 8 - Mkfiles/vc9/libyasm/libyasm.vcproj | 572 ---------------- Mkfiles/vc9/modules/modules.vcproj | 616 ------------------ Mkfiles/vc9/re2c/re2c.vcproj | 278 -------- Mkfiles/vc9/re2c/run.bat | 4 - Mkfiles/vc9/readme.vc9.txt | 132 ---- Mkfiles/vc9/vc98_swap.py | 52 -- Mkfiles/vc9/vsyasm.vcproj | 406 ------------ Mkfiles/vc9/yasm.rules | 115 ---- Mkfiles/vc9/yasm.sln | 157 ----- Mkfiles/vc9/yasm.vcproj | 410 ------------ Mkfiles/vc9/ytasm.vcproj | 410 ------------ Mkfiles/vs/config.h | 170 ----- Mkfiles/vs/crt_secure_no_deprecate.props | 11 - Mkfiles/vs/crt_secure_no_deprecate.vsprops | 11 - Mkfiles/vs/genmacro/genmacro.vcxproj | 203 ------ Mkfiles/vs/genmacro/genmacro.vcxproj.filters | 17 - Mkfiles/vs/genmacro/run.bat | 5 - Mkfiles/vs/genmodule/genmodule.vcxproj | 208 ------ .../vs/genmodule/genmodule.vcxproj.filters | 20 - Mkfiles/vs/genmodule/run.bat | 3 - Mkfiles/vs/genperf/genperf.vcxproj | 262 -------- Mkfiles/vs/genperf/genperf.vcxproj.filters | 56 -- Mkfiles/vs/genperf/run.bat | 40 -- Mkfiles/vs/genstring/genstring.vcxproj | 197 ------ .../vs/genstring/genstring.vcxproj.filters | 17 - Mkfiles/vs/genstring/run.bat | 2 - Mkfiles/vs/genversion/genversion.vcxproj | 224 ------- .../vs/genversion/genversion.vcxproj.filters | 26 - Mkfiles/vs/genversion/run.bat | 2 - Mkfiles/vs/genversion/runpre.bat | 2 - Mkfiles/vs/libyasm-stdint.h | 8 - Mkfiles/vs/libyasm/libyasm.vcxproj | 278 -------- Mkfiles/vs/libyasm/libyasm.vcxproj.filters | 200 ------ Mkfiles/vs/modules/modules.vcxproj | 325 --------- Mkfiles/vs/modules/modules.vcxproj.filters | 256 -------- Mkfiles/vs/out_copy_rename.bat | 42 -- Mkfiles/vs/re2c/re2c.vcxproj | 222 ------- Mkfiles/vs/re2c/re2c.vcxproj.filters | 80 --- Mkfiles/vs/re2c/run.bat | 4 - Mkfiles/vs/readme.vs.txt | 96 --- Mkfiles/vs/vsyasm.props | 27 - Mkfiles/vs/vsyasm.targets | 110 ---- Mkfiles/vs/vsyasm.vcxproj | 280 -------- Mkfiles/vs/vsyasm.xml | 283 -------- Mkfiles/vs/yasm.sln | 145 ----- Mkfiles/vs/yasm.vcxproj | 284 -------- Mkfiles/vs/yasm.vcxproj.filters | 41 -- Mkfiles/vs/ytasm.vcxproj | 279 -------- 192 files changed, 24543 deletions(-) delete mode 100644 Mkfiles/nightly-build.pl delete mode 100644 Mkfiles/vc10/config.h delete mode 100644 Mkfiles/vc10/crt_secure_no_deprecate.props delete mode 100644 Mkfiles/vc10/crt_secure_no_deprecate.vsprops delete mode 100644 Mkfiles/vc10/genmacro/genmacro.vcxproj delete mode 100644 Mkfiles/vc10/genmacro/genmacro.vcxproj.filters delete mode 100644 Mkfiles/vc10/genmacro/run.bat delete mode 100644 Mkfiles/vc10/genmodule/genmodule.vcxproj delete mode 100644 Mkfiles/vc10/genmodule/genmodule.vcxproj.filters delete mode 100644 Mkfiles/vc10/genmodule/run.bat delete mode 100644 Mkfiles/vc10/genperf/genperf.vcxproj delete mode 100644 Mkfiles/vc10/genperf/genperf.vcxproj.filters delete mode 100644 Mkfiles/vc10/genperf/run.bat delete mode 100644 Mkfiles/vc10/genstring/genstring.vcxproj delete mode 100644 Mkfiles/vc10/genstring/genstring.vcxproj.filters delete mode 100644 Mkfiles/vc10/genstring/run.bat delete mode 100644 Mkfiles/vc10/genversion/genversion.vcxproj delete mode 100644 Mkfiles/vc10/genversion/genversion.vcxproj.filters delete mode 100644 Mkfiles/vc10/genversion/run.bat delete mode 100644 Mkfiles/vc10/genversion/runpre.bat delete mode 100644 Mkfiles/vc10/libyasm-stdint.h delete mode 100644 Mkfiles/vc10/libyasm/libyasm.vcxproj delete mode 100644 Mkfiles/vc10/libyasm/libyasm.vcxproj.filters delete mode 100644 Mkfiles/vc10/modules/modules.vcxproj delete mode 100644 Mkfiles/vc10/modules/modules.vcxproj.filters delete mode 100644 Mkfiles/vc10/out_copy_rename.bat delete mode 100644 Mkfiles/vc10/re2c/re2c.vcxproj delete mode 100644 Mkfiles/vc10/re2c/re2c.vcxproj.filters delete mode 100644 Mkfiles/vc10/re2c/run.bat delete mode 100644 Mkfiles/vc10/readme.vc10.txt delete mode 100644 Mkfiles/vc10/vsyasm.props delete mode 100644 Mkfiles/vc10/vsyasm.targets delete mode 100644 Mkfiles/vc10/vsyasm.vcxproj delete mode 100644 Mkfiles/vc10/vsyasm.xml delete mode 100644 Mkfiles/vc10/yasm.sln delete mode 100644 Mkfiles/vc10/yasm.vcxproj delete mode 100644 Mkfiles/vc10/yasm.vcxproj.filters delete mode 100644 Mkfiles/vc10/ytasm.vcxproj delete mode 100644 Mkfiles/vc12/config.h delete mode 100644 Mkfiles/vc12/crt_secure_no_deprecate.props delete mode 100644 Mkfiles/vc12/crt_secure_no_deprecate.vsprops delete mode 100644 Mkfiles/vc12/libyasm/libyasm.vcxproj delete mode 100644 Mkfiles/vc12/libyasm/libyasm.vcxproj.filters delete mode 100644 Mkfiles/vc12/modules/modules.vcxproj delete mode 100644 Mkfiles/vc12/modules/modules.vcxproj.filters delete mode 100644 Mkfiles/vc12/out_copy_rename.bat delete mode 100644 Mkfiles/vc12/readme.vc12.txt delete mode 100644 Mkfiles/vc12/vsyasm.props delete mode 100644 Mkfiles/vc12/vsyasm.targets delete mode 100644 Mkfiles/vc12/vsyasm.vcxproj delete mode 100644 Mkfiles/vc12/vsyasm.xml delete mode 100644 Mkfiles/vc12/yasm.sln delete mode 100644 Mkfiles/vc12/yasm.vcxproj delete mode 100644 Mkfiles/vc12/yasm.vcxproj.filters delete mode 100644 Mkfiles/vc12/ytasm.vcxproj delete mode 100644 Mkfiles/vc14/config.h delete mode 100644 Mkfiles/vc14/crt_secure_no_deprecate.props delete mode 100644 Mkfiles/vc14/crt_secure_no_deprecate.vsprops delete mode 100644 Mkfiles/vc14/genmacro/genmacro.vcxproj delete mode 100644 Mkfiles/vc14/genmacro/genmacro.vcxproj.filters delete mode 100644 Mkfiles/vc14/genmacro/run.bat delete mode 100644 Mkfiles/vc14/genmodule/genmodule.vcxproj delete mode 100644 Mkfiles/vc14/genmodule/genmodule.vcxproj.filters delete mode 100644 Mkfiles/vc14/genmodule/run.bat delete mode 100644 Mkfiles/vc14/genperf/genperf.vcxproj delete mode 100644 Mkfiles/vc14/genperf/genperf.vcxproj.filters delete mode 100644 Mkfiles/vc14/genperf/run.bat delete mode 100644 Mkfiles/vc14/genstring/genstring.vcxproj delete mode 100644 Mkfiles/vc14/genstring/genstring.vcxproj.filters delete mode 100644 Mkfiles/vc14/genstring/run.bat delete mode 100644 Mkfiles/vc14/genversion/genversion.vcxproj delete mode 100644 Mkfiles/vc14/genversion/genversion.vcxproj.filters delete mode 100644 Mkfiles/vc14/genversion/run.bat delete mode 100644 Mkfiles/vc14/genversion/runpre.bat delete mode 100644 Mkfiles/vc14/libyasm-stdint.h delete mode 100644 Mkfiles/vc14/libyasm/libyasm.vcxproj delete mode 100644 Mkfiles/vc14/libyasm/libyasm.vcxproj.filters delete mode 100644 Mkfiles/vc14/modules/modules.vcxproj delete mode 100644 Mkfiles/vc14/modules/modules.vcxproj.filters delete mode 100644 Mkfiles/vc14/out_copy_rename.bat delete mode 100644 Mkfiles/vc14/re2c/re2c.vcxproj delete mode 100644 Mkfiles/vc14/re2c/re2c.vcxproj.filters delete mode 100644 Mkfiles/vc14/re2c/run.bat delete mode 100644 Mkfiles/vc14/readme.vc14.txt delete mode 100644 Mkfiles/vc14/vsyasm.props delete mode 100644 Mkfiles/vc14/vsyasm.targets delete mode 100644 Mkfiles/vc14/vsyasm.vcxproj delete mode 100644 Mkfiles/vc14/vsyasm.xml delete mode 100644 Mkfiles/vc14/yasm.sln delete mode 100644 Mkfiles/vc14/yasm.vcxproj delete mode 100644 Mkfiles/vc14/yasm.vcxproj.filters delete mode 100644 Mkfiles/vc14/ytasm.vcxproj delete mode 100644 Mkfiles/vc15/config.h delete mode 100644 Mkfiles/vc15/crt_secure_no_deprecate.props delete mode 100644 Mkfiles/vc15/crt_secure_no_deprecate.vsprops delete mode 100644 Mkfiles/vc15/genmacro/genmacro.vcxproj delete mode 100644 Mkfiles/vc15/genmacro/genmacro.vcxproj.filters delete mode 100644 Mkfiles/vc15/genmacro/run.bat delete mode 100644 Mkfiles/vc15/genmodule/genmodule.vcxproj delete mode 100644 Mkfiles/vc15/genmodule/genmodule.vcxproj.filters delete mode 100644 Mkfiles/vc15/genmodule/run.bat delete mode 100644 Mkfiles/vc15/genperf/genperf.vcxproj delete mode 100644 Mkfiles/vc15/genperf/genperf.vcxproj.filters delete mode 100644 Mkfiles/vc15/genperf/run.bat delete mode 100644 Mkfiles/vc15/genstring/genstring.vcxproj delete mode 100644 Mkfiles/vc15/genstring/genstring.vcxproj.filters delete mode 100644 Mkfiles/vc15/genstring/run.bat delete mode 100644 Mkfiles/vc15/genversion/genversion.vcxproj delete mode 100644 Mkfiles/vc15/genversion/genversion.vcxproj.filters delete mode 100644 Mkfiles/vc15/genversion/run.bat delete mode 100644 Mkfiles/vc15/genversion/runpre.bat delete mode 100644 Mkfiles/vc15/libyasm-stdint.h delete mode 100644 Mkfiles/vc15/libyasm/libyasm.vcxproj delete mode 100644 Mkfiles/vc15/libyasm/libyasm.vcxproj.filters delete mode 100644 Mkfiles/vc15/modules/modules.vcxproj delete mode 100644 Mkfiles/vc15/modules/modules.vcxproj.filters delete mode 100644 Mkfiles/vc15/out_copy_rename.bat delete mode 100644 Mkfiles/vc15/re2c/re2c.vcxproj delete mode 100644 Mkfiles/vc15/re2c/re2c.vcxproj.filters delete mode 100644 Mkfiles/vc15/re2c/run.bat delete mode 100644 Mkfiles/vc15/readme.vc14.txt delete mode 100644 Mkfiles/vc15/vsyasm.props delete mode 100644 Mkfiles/vc15/vsyasm.targets delete mode 100644 Mkfiles/vc15/vsyasm.vcxproj delete mode 100644 Mkfiles/vc15/vsyasm.xml delete mode 100644 Mkfiles/vc15/yasm.sln delete mode 100644 Mkfiles/vc15/yasm.vcxproj delete mode 100644 Mkfiles/vc15/yasm.vcxproj.filters delete mode 100644 Mkfiles/vc15/ytasm.vcxproj delete mode 100644 Mkfiles/vc9/config.h delete mode 100644 Mkfiles/vc9/crt_secure_no_deprecate.vsprops delete mode 100644 Mkfiles/vc9/genmacro/genmacro.vcproj delete mode 100644 Mkfiles/vc9/genmacro/run.bat delete mode 100644 Mkfiles/vc9/genmodule/genmodule.vcproj delete mode 100644 Mkfiles/vc9/genmodule/run.bat delete mode 100644 Mkfiles/vc9/genperf/genperf.vcproj delete mode 100644 Mkfiles/vc9/genperf/run.bat delete mode 100644 Mkfiles/vc9/genstring/genstring.vcproj delete mode 100644 Mkfiles/vc9/genstring/run.bat delete mode 100644 Mkfiles/vc9/genversion/genversion.vcproj delete mode 100644 Mkfiles/vc9/genversion/run.bat delete mode 100644 Mkfiles/vc9/genversion/runpre.bat delete mode 100644 Mkfiles/vc9/libyasm-stdint.h delete mode 100644 Mkfiles/vc9/libyasm/libyasm.vcproj delete mode 100644 Mkfiles/vc9/modules/modules.vcproj delete mode 100644 Mkfiles/vc9/re2c/re2c.vcproj delete mode 100644 Mkfiles/vc9/re2c/run.bat delete mode 100644 Mkfiles/vc9/readme.vc9.txt delete mode 100644 Mkfiles/vc9/vc98_swap.py delete mode 100644 Mkfiles/vc9/vsyasm.vcproj delete mode 100644 Mkfiles/vc9/yasm.rules delete mode 100644 Mkfiles/vc9/yasm.sln delete mode 100644 Mkfiles/vc9/yasm.vcproj delete mode 100644 Mkfiles/vc9/ytasm.vcproj delete mode 100644 Mkfiles/vs/config.h delete mode 100644 Mkfiles/vs/crt_secure_no_deprecate.props delete mode 100644 Mkfiles/vs/crt_secure_no_deprecate.vsprops delete mode 100644 Mkfiles/vs/genmacro/genmacro.vcxproj delete mode 100644 Mkfiles/vs/genmacro/genmacro.vcxproj.filters delete mode 100644 Mkfiles/vs/genmacro/run.bat delete mode 100644 Mkfiles/vs/genmodule/genmodule.vcxproj delete mode 100644 Mkfiles/vs/genmodule/genmodule.vcxproj.filters delete mode 100644 Mkfiles/vs/genmodule/run.bat delete mode 100644 Mkfiles/vs/genperf/genperf.vcxproj delete mode 100644 Mkfiles/vs/genperf/genperf.vcxproj.filters delete mode 100644 Mkfiles/vs/genperf/run.bat delete mode 100644 Mkfiles/vs/genstring/genstring.vcxproj delete mode 100644 Mkfiles/vs/genstring/genstring.vcxproj.filters delete mode 100644 Mkfiles/vs/genstring/run.bat delete mode 100644 Mkfiles/vs/genversion/genversion.vcxproj delete mode 100644 Mkfiles/vs/genversion/genversion.vcxproj.filters delete mode 100644 Mkfiles/vs/genversion/run.bat delete mode 100644 Mkfiles/vs/genversion/runpre.bat delete mode 100644 Mkfiles/vs/libyasm-stdint.h delete mode 100644 Mkfiles/vs/libyasm/libyasm.vcxproj delete mode 100644 Mkfiles/vs/libyasm/libyasm.vcxproj.filters delete mode 100644 Mkfiles/vs/modules/modules.vcxproj delete mode 100644 Mkfiles/vs/modules/modules.vcxproj.filters delete mode 100644 Mkfiles/vs/out_copy_rename.bat delete mode 100644 Mkfiles/vs/re2c/re2c.vcxproj delete mode 100644 Mkfiles/vs/re2c/re2c.vcxproj.filters delete mode 100644 Mkfiles/vs/re2c/run.bat delete mode 100644 Mkfiles/vs/readme.vs.txt delete mode 100644 Mkfiles/vs/vsyasm.props delete mode 100644 Mkfiles/vs/vsyasm.targets delete mode 100644 Mkfiles/vs/vsyasm.vcxproj delete mode 100644 Mkfiles/vs/vsyasm.xml delete mode 100644 Mkfiles/vs/yasm.sln delete mode 100644 Mkfiles/vs/yasm.vcxproj delete mode 100644 Mkfiles/vs/yasm.vcxproj.filters delete mode 100644 Mkfiles/vs/ytasm.vcxproj diff --git a/Makefile.am b/Makefile.am index b1524aa9..d955a229 100644 --- a/Makefile.am +++ b/Makefile.am @@ -119,83 +119,6 @@ EXTRA_DIST += Mkfiles/Makefile.flat EXTRA_DIST += Mkfiles/Makefile.dj EXTRA_DIST += Mkfiles/dj/config.h EXTRA_DIST += Mkfiles/dj/libyasm-stdint.h -EXTRA_DIST += Mkfiles/vc9/config.h -EXTRA_DIST += Mkfiles/vc9/crt_secure_no_deprecate.vsprops -EXTRA_DIST += Mkfiles/vc9/libyasm-stdint.h -EXTRA_DIST += Mkfiles/vc9/readme.vc9.txt -EXTRA_DIST += Mkfiles/vc9/vc98_swap.py -EXTRA_DIST += Mkfiles/vc9/vsyasm.vcproj -EXTRA_DIST += Mkfiles/vc9/yasm.sln -EXTRA_DIST += Mkfiles/vc9/yasm.vcproj -EXTRA_DIST += Mkfiles/vc9/ytasm.vcproj -EXTRA_DIST += Mkfiles/vc9/yasm.rules -EXTRA_DIST += Mkfiles/vc9/genmacro/genmacro.vcproj -EXTRA_DIST += Mkfiles/vc9/genmacro/run.bat -EXTRA_DIST += Mkfiles/vc9/genmodule/genmodule.vcproj -EXTRA_DIST += Mkfiles/vc9/genmodule/run.bat -EXTRA_DIST += Mkfiles/vc9/genperf/genperf.vcproj -EXTRA_DIST += Mkfiles/vc9/genperf/run.bat -EXTRA_DIST += Mkfiles/vc9/genstring/genstring.vcproj -EXTRA_DIST += Mkfiles/vc9/genstring/run.bat -EXTRA_DIST += Mkfiles/vc9/genversion/genversion.vcproj -EXTRA_DIST += Mkfiles/vc9/genversion/run.bat -EXTRA_DIST += Mkfiles/vc9/libyasm/libyasm.vcproj -EXTRA_DIST += Mkfiles/vc9/modules/modules.vcproj -EXTRA_DIST += Mkfiles/vc9/re2c/re2c.vcproj -EXTRA_DIST += Mkfiles/vc9/re2c/run.bat -EXTRA_DIST += Mkfiles/vc10/config.h -EXTRA_DIST += Mkfiles/vc10/crt_secure_no_deprecate.props -EXTRA_DIST += Mkfiles/vc10/crt_secure_no_deprecate.vsprops -EXTRA_DIST += Mkfiles/vc10/libyasm-stdint.h -EXTRA_DIST += Mkfiles/vc10/out_copy_rename.bat -EXTRA_DIST += Mkfiles/vc10/readme.vc10.txt -EXTRA_DIST += Mkfiles/vc10/vsyasm.props -EXTRA_DIST += Mkfiles/vc10/vsyasm.targets -EXTRA_DIST += Mkfiles/vc10/vsyasm.vcxproj -EXTRA_DIST += Mkfiles/vc10/vsyasm.xml -EXTRA_DIST += Mkfiles/vc10/yasm.sln -EXTRA_DIST += Mkfiles/vc10/yasm.vcxproj -EXTRA_DIST += Mkfiles/vc10/yasm.vcxproj.filters -EXTRA_DIST += Mkfiles/vc10/ytasm.vcxproj -EXTRA_DIST += Mkfiles/vc10/genmacro/genmacro.vcxproj -EXTRA_DIST += Mkfiles/vc10/genmacro/genmacro.vcxproj.filters -EXTRA_DIST += Mkfiles/vc10/genmacro/run.bat -EXTRA_DIST += Mkfiles/vc10/genmodule/genmodule.vcxproj -EXTRA_DIST += Mkfiles/vc10/genmodule/genmodule.vcxproj.filters -EXTRA_DIST += Mkfiles/vc10/genmodule/run.bat -EXTRA_DIST += Mkfiles/vc10/genperf/genperf.vcxproj -EXTRA_DIST += Mkfiles/vc10/genperf/genperf.vcxproj.filters -EXTRA_DIST += Mkfiles/vc10/genperf/run.bat -EXTRA_DIST += Mkfiles/vc10/genstring/genstring.vcxproj -EXTRA_DIST += Mkfiles/vc10/genstring/genstring.vcxproj.filters -EXTRA_DIST += Mkfiles/vc10/genstring/run.bat -EXTRA_DIST += Mkfiles/vc10/genversion/genversion.vcxproj -EXTRA_DIST += Mkfiles/vc10/genversion/genversion.vcxproj.filters -EXTRA_DIST += Mkfiles/vc10/genversion/run.bat -EXTRA_DIST += Mkfiles/vc10/libyasm/libyasm.vcxproj -EXTRA_DIST += Mkfiles/vc10/libyasm/libyasm.vcxproj.filters -EXTRA_DIST += Mkfiles/vc10/modules/modules.vcxproj -EXTRA_DIST += Mkfiles/vc10/modules/modules.vcxproj.filters -EXTRA_DIST += Mkfiles/vc10/re2c/re2c.vcxproj -EXTRA_DIST += Mkfiles/vc10/re2c/re2c.vcxproj.filters -EXTRA_DIST += Mkfiles/vc10/re2c/run.bat -EXTRA_DIST += Mkfiles/vc12/config.h -EXTRA_DIST += Mkfiles/vc12/crt_secure_no_deprecate.props -EXTRA_DIST += Mkfiles/vc12/crt_secure_no_deprecate.vsprops -EXTRA_DIST += Mkfiles/vc12/libyasm/libyasm.vcxproj -EXTRA_DIST += Mkfiles/vc12/libyasm/libyasm.vcxproj.filters -EXTRA_DIST += Mkfiles/vc12/modules/modules.vcxproj -EXTRA_DIST += Mkfiles/vc12/modules/modules.vcxproj.filters -EXTRA_DIST += Mkfiles/vc12/out_copy_rename.bat -EXTRA_DIST += Mkfiles/vc12/readme.vc12.txt -EXTRA_DIST += Mkfiles/vc12/vsyasm.props -EXTRA_DIST += Mkfiles/vc12/vsyasm.targets -EXTRA_DIST += Mkfiles/vc12/vsyasm.vcxproj -EXTRA_DIST += Mkfiles/vc12/vsyasm.xml -EXTRA_DIST += Mkfiles/vc12/yasm.sln -EXTRA_DIST += Mkfiles/vc12/yasm.vcxproj -EXTRA_DIST += Mkfiles/vc12/yasm.vcxproj.filters -EXTRA_DIST += Mkfiles/vc12/ytasm.vcxproj # Until this gets fixed in automake DISTCLEANFILES += libyasm/stamp-h libyasm/stamp-h[0-9]* @@ -203,9 +126,6 @@ DISTCLEANFILES += libyasm/stamp-h libyasm/stamp-h[0-9]* dist-hook: YASM-VERSION-FILE YASM-VERSION.h cp YASM-VERSION-FILE $(distdir)/version cp YASM-VERSION.h $(distdir)/Mkfiles/dj/ - cp YASM-VERSION.h $(distdir)/Mkfiles/vc9/ - cp YASM-VERSION.h $(distdir)/Mkfiles/vc10/ - cp YASM-VERSION.h $(distdir)/Mkfiles/vc12/ YASM-VERSION-FILE: $(top_srcdir)/YASM-VERSION-GEN.sh $(top_srcdir)/YASM-VERSION-GEN.sh diff --git a/Mkfiles/nightly-build.pl b/Mkfiles/nightly-build.pl deleted file mode 100644 index 0a029d92..00000000 --- a/Mkfiles/nightly-build.pl +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/perl -use POSIX qw(strftime); - -$|++; - -my $version = '0.0.1'; -my $todaydate = strftime "%Y%m%d", localtime; -my $snapshot_dir = "/home/yasm/public_html/snapshots/$todaydate"; -my $cvs_dir = '/usr/local/cvs2/yasm/chrooted-cvs/cvs'; -my $build_dir = '/home/yasm/build'; - -# Create snapshot directory -system('mkdir', $snapshot_dir); -# Relink "latest" symlink -system('rm', "$snapshot_dir/../latest"); -system('ln', '-s', $snapshot_dir, "$snapshot_dir/../latest"); -system('rm', "$snapshot_dir/../../latest"); -system('ln', '-s', $snapshot_dir, "$snapshot_dir/../../latest"); - -# Build CVS tree tarball -chdir("$cvs_dir/..") || die "Could not change to CVS directory"; -system('tar', '-czf', "$snapshot_dir/yasm-cvstree.tar.gz", 'cvs') == 0 - or die "CVS tree tarball build failed: $?."; - -# Build CVS checkout tarball -chdir($build_dir) || die "Could not change to build directory"; -system('chmod', '-R', 'u+w', 'yasm') == 0 - or die "Could not chmod old CVS checkout directory: $?."; -system('rm', '-Rf', 'yasm') == 0 - or die "Could not remove old CVS checkout directory: $?."; -system('mkdir', 'yasm') == 0 - or die "Could not create CVS checkout directory: $?."; -chdir('yasm') || die "Could not change to CVS checkout directory."; -system('cvs', '-q', "-d$cvs_dir", 'checkout', '.') == 0 - or die "CVS checkout failed: $?."; -chdir('..'); -system('tar', '-czf', "$snapshot_dir/yasm-cvs.tar.gz", 'yasm') == 0 - or die "CVS checkout tarball build failed: $?."; -chdir('yasm'); - -# Update and build distribution tarball -system("./autogen.sh >$snapshot_dir/autogen-log.txt 2>$snapshot_dir/autogen-errwarn.txt") == 0 - or die "autogen.sh failed: $?."; -system("gmake distcheck >$snapshot_dir/make-log.txt 2>$snapshot_dir/make-errwarn.txt") == 0 - or die "build failed: $?."; -system("cp *.tar.gz $snapshot_dir/") == 0 - or die "dist tarball copy failed."; diff --git a/Mkfiles/vc10/config.h b/Mkfiles/vc10/config.h deleted file mode 100644 index efb7cbe4..00000000 --- a/Mkfiles/vc10/config.h +++ /dev/null @@ -1,170 +0,0 @@ -#include "YASM-VERSION.h" -#define yasm__splitpath(path, tail) yasm__splitpath_win(path, tail) -#define yasm__abspath(path) yasm__abspath_win(path) -#define yasm__combpath(from, to) yasm__combpath_win(from, to) - -/* Command name to run C preprocessor */ -#define CPP_PROG "cpp" - -/* */ -/* #undef ENABLE_NLS */ - -/* Define if you have the `abort' function. */ -#define HAVE_ABORT 1 - -/* */ -/* #undef HAVE_CATGETS */ - -/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the - CoreFoundation framework. */ -/* #undef HAVE_CFLOCALECOPYCURRENT */ - -/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in - the CoreFoundation framework. */ -/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ - -/* Define if the GNU dcgettext() function is already present or preinstalled. - */ -/* #undef HAVE_DCGETTEXT */ - -/* Define to 1 if you have the header file. */ -#define HAVE_DIRECT_H 1 - -/* Define to 1 if you have the `getcwd' function. */ -#define HAVE_GETCWD 1 - -/* */ -/* #undef HAVE_GETTEXT */ - -/* Define if you have the GNU C Library */ -/* #undef HAVE_GNU_C_LIBRARY */ - -/* Define if you have the iconv() function. */ -/* #undef HAVE_ICONV */ - -/* Define if you have the header file. */ -/* #undef HAVE_INTTYPES_H */ - -/* */ -/* #undef HAVE_LC_MESSAGES */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_LIBGEN_H */ - -/* Define if you have the header file. */ -/* #undef HAVE_MEMORY_H */ - -/* Define if you have the `mergesort' function. */ -/* #undef HAVE_MERGESORT */ - -/* Define to 1 if you have the `popen' function. */ -/* #undef HAVE_POPEN */ - -/* Define if you have the header file. */ -/* #undef HAVE_STDINT_H */ - -/* Define if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* */ -/* #undef HAVE_STPCPY */ - -/* Define if you have the `strcasecmp' function. */ -/* #undef HAVE_STRCASECMP */ - -/* Define if you have the `strcmpi' function. */ -/* #undef HAVE_STRCMPI */ - -/* Define if you have the `stricmp' function. */ -/* #undefine HAVE_STRICMP */ - -/* Define if you have the header file. */ -/* #undef HAVE_STRINGS_H */ - -/* Define if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define if you have the `strncasecmp' function. */ -/* #undef HAVE_STRNCASECMP */ - -/* Define if you have the `strsep' function. */ -/* #undef HAVE_STRSEP */ - -/* Define if you have the header file. */ -/* #undef HAVE_SYS_STAT_H */ - -/* Define if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define if you have the `toascii' function. */ -#define HAVE_TOASCII 1 -#define toascii __toascii - -/* Define if you have the header file. */ -/* #undef HAVE_UNISTD_H */ - -/* Define to 1 if you have the `vsnprintf' function. */ -/* #undef HAVE_VSNPRINTF */ - -/* Define to 1 if you have the `_stricmp' function. */ -#define HAVE__STRICMP 1 - -/* Name of package */ -#define PACKAGE "yasm" - -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "bug-yasm@tortall.net" - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "yasm" - -/* Define to the full name and version of this package. */ -/*#define PACKAGE_STRING "yasm HEAD"*/ - -/* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "yasm" - -/* Define to the version of this package. */ -/*#define PACKAGE_VERSION "HEAD"*/ - -/* Define if the C compiler supports function prototypes. */ -#define PROTOTYPES 1 - -/* The size of a `char', as computed by sizeof. */ -/* #undef SIZEOF_CHAR */ - -/* The size of a `int', as computed by sizeof. */ -/* #undef SIZEOF_INT */ - -/* The size of a `long', as computed by sizeof. */ -/* #undef SIZEOF_LONG */ - -/* The size of a `short', as computed by sizeof. */ -/* #undef SIZEOF_SHORT */ - -/* The size of a `void*', as computed by sizeof. */ -/* #undef SIZEOF_VOIDP */ - -/* Define if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Version number of package */ -#define VERSION "HEAD" - -/* Define if using the dmalloc debugging malloc package */ -/* #undef WITH_DMALLOC */ - -/* Define like PROTOTYPES; this can be used by system headers. */ -#define __PROTOTYPES 1 - -/* Define to empty if `const' does not conform to ANSI C. */ -/* #undef const */ - -/* Define as `__inline' if that's what the C compiler calls it, or to nothing - if it is not supported. */ -#ifndef __cplusplus -/* #undef inline */ -#endif - -/* Define to `unsigned' if doesn't define. */ -/* #undef size_t */ diff --git a/Mkfiles/vc10/crt_secure_no_deprecate.props b/Mkfiles/vc10/crt_secure_no_deprecate.props deleted file mode 100644 index 16e9f0d0..00000000 --- a/Mkfiles/vc10/crt_secure_no_deprecate.props +++ /dev/null @@ -1,11 +0,0 @@ - - - - <_ProjectFileVersion>10.0.21006.1 - - - - _CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - - - \ No newline at end of file diff --git a/Mkfiles/vc10/crt_secure_no_deprecate.vsprops b/Mkfiles/vc10/crt_secure_no_deprecate.vsprops deleted file mode 100644 index d61ba30a..00000000 --- a/Mkfiles/vc10/crt_secure_no_deprecate.vsprops +++ /dev/null @@ -1,11 +0,0 @@ - - - - diff --git a/Mkfiles/vc10/genmacro/genmacro.vcxproj b/Mkfiles/vc10/genmacro/genmacro.vcxproj deleted file mode 100644 index 15cf1693..00000000 --- a/Mkfiles/vc10/genmacro/genmacro.vcxproj +++ /dev/null @@ -1,117 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {225700A5-07B8-434E-AD61-555278BF6733} - genmacro - Win32Proj - - - - Application - MultiByte - - - Application - MultiByte - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - - - - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - Level3 - ProgramDatabase - Default - - - $(OutDir)genmacro.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX86 - - - run.bat "$(TargetPath)" - - - - - Full - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreaded - - - $(IntDir) - Level3 - Default - - - $(OutDir)genmacro.exe - $(OutDir)$(TargetName).pdb - Console - true - true - false - - - MachineX86 - - - run.bat "$(TargetPath)" - - - - - - - - - - - {b545983b-8ee0-4a7b-a67a-e749eeae62a2} - false - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc10/genmacro/genmacro.vcxproj.filters b/Mkfiles/vc10/genmacro/genmacro.vcxproj.filters deleted file mode 100644 index b9d110e6..00000000 --- a/Mkfiles/vc10/genmacro/genmacro.vcxproj.filters +++ /dev/null @@ -1,17 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx - - - - - Source Files - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc10/genmacro/run.bat b/Mkfiles/vc10/genmacro/run.bat deleted file mode 100644 index d2fbb98c..00000000 --- a/Mkfiles/vc10/genmacro/run.bat +++ /dev/null @@ -1,5 +0,0 @@ -cd ..\..\.. -%1 nasm-version.c nasm_version_mac version.mac -%1 nasm-macros.c nasm_standard_mac modules\parsers\nasm\nasm-std.mac -%1 win64-nasm.c win64_nasm_stdmac modules\objfmts\coff\win64-nasm.mac -%1 win64-gas.c win64_gas_stdmac modules\objfmts\coff\win64-gas.mac diff --git a/Mkfiles/vc10/genmodule/genmodule.vcxproj b/Mkfiles/vc10/genmodule/genmodule.vcxproj deleted file mode 100644 index eca6ce85..00000000 --- a/Mkfiles/vc10/genmodule/genmodule.vcxproj +++ /dev/null @@ -1,118 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0} - genmodule - Win32Proj - - - - Application - MultiByte - - - Application - MultiByte - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - - - - Disabled - %(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;FILTERMODE;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - $(IntDir) - Level3 - ProgramDatabase - Default - - - $(OutDir)genmodule.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX86 - - - run.bat "$(TargetPath)" - - - - - Full - %(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;FILTERMODE;%(PreprocessorDefinitions) - MultiThreaded - - - $(IntDir) - $(IntDir) - Level3 - Default - - - $(OutDir)genmodule.exe - $(OutDir)$(TargetName).pdb - Console - true - true - false - - - MachineX86 - - - run.bat "$(TargetPath)" - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc10/genmodule/genmodule.vcxproj.filters b/Mkfiles/vc10/genmodule/genmodule.vcxproj.filters deleted file mode 100644 index e9777360..00000000 --- a/Mkfiles/vc10/genmodule/genmodule.vcxproj.filters +++ /dev/null @@ -1,20 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx - - - - - Source Files - - - - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc10/genmodule/run.bat b/Mkfiles/vc10/genmodule/run.bat deleted file mode 100644 index e34a4169..00000000 --- a/Mkfiles/vc10/genmodule/run.bat +++ /dev/null @@ -1,3 +0,0 @@ -@echo off -cd ..\..\.. -%1 libyasm\module.in Makefile.am diff --git a/Mkfiles/vc10/genperf/genperf.vcxproj b/Mkfiles/vc10/genperf/genperf.vcxproj deleted file mode 100644 index 9d14bf53..00000000 --- a/Mkfiles/vc10/genperf/genperf.vcxproj +++ /dev/null @@ -1,144 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619} - genperf - Win32Proj - - - - Application - MultiByte - - - Application - MultiByte - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - false - false - false - - - - Disabled - ..;../../..;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;STDC_HEADERS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - Level3 - ProgramDatabase - Default - - - $(OutDir)genperf.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX86 - - - - - - - run.bat "$(TargetPath)" - - - x86insn_nasm.c;x86insn_gas.c;x86cpu.c;x86regtmod.c;%(Outputs) - - - - - Full - ..;../../..;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;STDC_HEADERS;%(PreprocessorDefinitions) - MultiThreaded - - - $(IntDir) - Level3 - Default - - - $(OutDir)genperf.exe - $(OutDir)$(TargetName).pdb - Console - true - true - false - - - MachineX86 - - - - - - - run.bat "$(TargetPath)" - - - x86insn_nasm.c;x86insn_gas.c;x86cpu.c;x86regtmod.c;%(Outputs) - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc10/genperf/genperf.vcxproj.filters b/Mkfiles/vc10/genperf/genperf.vcxproj.filters deleted file mode 100644 index f45157d9..00000000 --- a/Mkfiles/vc10/genperf/genperf.vcxproj.filters +++ /dev/null @@ -1,56 +0,0 @@ - - - - - {3C1E9AA8-6338-4CED-99F1-BEBA80607BD5} - h;hpp;hxx;hm;inl;inc;xsd - - - {1062695D-1C50-4068-8313-73A409885BC1} - cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc10/genperf/run.bat b/Mkfiles/vc10/genperf/run.bat deleted file mode 100644 index 664e59ae..00000000 --- a/Mkfiles/vc10/genperf/run.bat +++ /dev/null @@ -1,39 +0,0 @@ -cd ..\..\.. -@echo off - -for /f "usebackq tokens=1*" %%f in (`reg query HKCR\Applications\python.exe\shell\open\command 2^>NUL`) do (set _my_=%%f %%g) -goto try1%errorlevel% - -:try10 -goto ok - -:try11 -for /f "usebackq tokens=1*" %%f in (`reg query HKCR\Python.File\shell\open\command 2^>NUL`) do (set _my_=%%f %%g) -goto try2%errorlevel% - -:try20: -goto ok - -:try21: -echo Building without Python ... -goto therest - -:ok -echo Building with Python ... -set _res_=%_my_:*REG_SZ=% -set _end_=%_res_:*exe"=% -call set _python_=%%_res_:%_end_%=%% -call %_python_% modules\arch\x86\gen_x86_insn.py - -:therest -@echo on -call :update %1 x86insn_nasm.gperf x86insn_nasm.c -call :update %1 x86insn_gas.gperf x86insn_gas.c -call :update %1 modules\arch\x86\x86cpu.gperf x86cpu.c -call :update %1 modules\arch\x86\x86regtmod.gperf x86regtmod.c -goto :eof - -:update -%1 %2 tf -call mkfiles\vc10\out_copy_rename tf .\ %3 -del tf diff --git a/Mkfiles/vc10/genstring/genstring.vcxproj b/Mkfiles/vc10/genstring/genstring.vcxproj deleted file mode 100644 index 118ec80c..00000000 --- a/Mkfiles/vc10/genstring/genstring.vcxproj +++ /dev/null @@ -1,111 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {021CEB0A-F721-4F59-B349-9CEEAF244459} - genstring - Win32Proj - - - - Application - MultiByte - - - Application - MultiByte - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - - - - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - Level3 - ProgramDatabase - Default - - - $(OutDir)genstring.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX86 - - - run.bat "$(TargetPath)" - - - - - Full - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreaded - - - $(IntDir) - Level3 - Default - - - $(OutDir)genstring.exe - $(OutDir)$(TargetName).pdb - Console - true - true - false - - - MachineX86 - - - run.bat "$(TargetPath)" - - - - - - - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc10/genstring/genstring.vcxproj.filters b/Mkfiles/vc10/genstring/genstring.vcxproj.filters deleted file mode 100644 index 4ec3efa3..00000000 --- a/Mkfiles/vc10/genstring/genstring.vcxproj.filters +++ /dev/null @@ -1,17 +0,0 @@ - - - - - {28EBE11C-5BE8-4935-9381-F57696749E0C} - cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx - - - - - Source Files - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc10/genstring/run.bat b/Mkfiles/vc10/genstring/run.bat deleted file mode 100644 index 5864b1dc..00000000 --- a/Mkfiles/vc10/genstring/run.bat +++ /dev/null @@ -1,2 +0,0 @@ -cd ..\..\.. -%1 license_msg license.c COPYING diff --git a/Mkfiles/vc10/genversion/genversion.vcxproj b/Mkfiles/vc10/genversion/genversion.vcxproj deleted file mode 100644 index 24526587..00000000 --- a/Mkfiles/vc10/genversion/genversion.vcxproj +++ /dev/null @@ -1,126 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2} - genversion - Win32Proj - - - - Application - MultiByte - - - Application - MultiByte - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - - - - Disabled - ..\..\vc10;..\..\..\;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - Level3 - ProgramDatabase - Default - - - $(OutDir)genversion.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX86 - - - run.bat "$(TargetPath)" - - - cd ..\..\..\ -YASM-VERSION-GEN.bat - - - - - - Full - ..\..\vc10;..\..\..\;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreaded - - - $(IntDir) - Level3 - Default - - - $(OutDir)genversion.exe - $(OutDir)$(TargetName).pdb - Console - true - true - false - - - MachineX86 - - - run.bat "$(TargetPath)" - - - cd ..\..\..\ -YASM-VERSION-GEN.bat - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc10/genversion/genversion.vcxproj.filters b/Mkfiles/vc10/genversion/genversion.vcxproj.filters deleted file mode 100644 index a5fd059a..00000000 --- a/Mkfiles/vc10/genversion/genversion.vcxproj.filters +++ /dev/null @@ -1,26 +0,0 @@ - - - - - {2acbec3a-0ed8-4b2e-826e-a84c7d35f205} - h;hpp;hxx;hm;inl - - - {E67ED277-E4F2-4D79-8C9E-962BAC164F3F} - cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx - - - - - Source Files - - - - - Header Files - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc10/genversion/run.bat b/Mkfiles/vc10/genversion/run.bat deleted file mode 100644 index 30edf8f1..00000000 --- a/Mkfiles/vc10/genversion/run.bat +++ /dev/null @@ -1,2 +0,0 @@ -cd ..\..\.. -%1 version.mac diff --git a/Mkfiles/vc10/genversion/runpre.bat b/Mkfiles/vc10/genversion/runpre.bat deleted file mode 100644 index fdd15708..00000000 --- a/Mkfiles/vc10/genversion/runpre.bat +++ /dev/null @@ -1,2 +0,0 @@ -cd ..\..\.. -YASM-VERSION-GEN.bat diff --git a/Mkfiles/vc10/libyasm-stdint.h b/Mkfiles/vc10/libyasm-stdint.h deleted file mode 100644 index fed61b33..00000000 --- a/Mkfiles/vc10/libyasm-stdint.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef _UINTPTR_T_DEFINED -#ifdef _WIN64 -#include -#else -typedef unsigned long uintptr_t; -#endif -#define _UINTPTR_T_DEFINED -#endif diff --git a/Mkfiles/vc10/libyasm/libyasm.vcxproj b/Mkfiles/vc10/libyasm/libyasm.vcxproj deleted file mode 100644 index 1498e312..00000000 --- a/Mkfiles/vc10/libyasm/libyasm.vcxproj +++ /dev/null @@ -1,273 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {29FE7874-1256-4AD6-B889-68E399DC9608} - libyasm - - - - StaticLibrary - false - MultiByte - - - StaticLibrary - false - MultiByte - - - StaticLibrary - false - MultiByte - - - StaticLibrary - false - MultiByte - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - - - - Full - Default - ..;../../..;%(AdditionalIncludeDirectories) - NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)libyasm.lib - true - - - - - X64 - - - Full - Default - ..;../../..;%(AdditionalIncludeDirectories) - NDEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)libyasm.lib - true - - - - - Disabled - ..;../../..;%(AdditionalIncludeDirectories) - _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)libyasm.lib - true - - - - - X64 - - - Disabled - ..;../../..;%(AdditionalIncludeDirectories) - _DEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)libyasm.lib - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {f0e8b707-00c5-4ff2-b8ef-7c39817132a0} - false - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc10/libyasm/libyasm.vcxproj.filters b/Mkfiles/vc10/libyasm/libyasm.vcxproj.filters deleted file mode 100644 index d1ee2793..00000000 --- a/Mkfiles/vc10/libyasm/libyasm.vcxproj.filters +++ /dev/null @@ -1,200 +0,0 @@ - - - - - {4ca3b698-9d01-4e4e-ae00-5c98da045efe} - h;hpp;hxx;hm;inl - - - {68607062-982d-4251-9a1a-30f76474983d} - cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Source Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc10/modules/modules.vcxproj b/Mkfiles/vc10/modules/modules.vcxproj deleted file mode 100644 index 070e923f..00000000 --- a/Mkfiles/vc10/modules/modules.vcxproj +++ /dev/null @@ -1,320 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6} - modules - - - - StaticLibrary - false - MultiByte - - - StaticLibrary - false - MultiByte - - - StaticLibrary - false - MultiByte - - - StaticLibrary - false - MultiByte - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - - - - Full - Default - ..;../../..;%(AdditionalIncludeDirectories) - NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)modules.lib - true - - - - - - - - - X64 - - - Full - Default - ..;../../..;%(AdditionalIncludeDirectories) - NDEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)modules.lib - true - - - - - Disabled - ..;../../..;%(AdditionalIncludeDirectories) - _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)modules.lib - true - - - - - X64 - - - Disabled - ..;../../..;%(AdditionalIncludeDirectories) - _DEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)modules.lib - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {225700a5-07b8-434e-ad61-555278bf6733} - false - - - {c45a8b59-8b59-4d5d-a8e8-fb090f8dd619} - false - - - {29fe7874-1256-4ad6-b889-68e399dc9608} - false - - - {3c58be13-50a3-4583-984d-d8902b3d7713} - false - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc10/modules/modules.vcxproj.filters b/Mkfiles/vc10/modules/modules.vcxproj.filters deleted file mode 100644 index b7912bda..00000000 --- a/Mkfiles/vc10/modules/modules.vcxproj.filters +++ /dev/null @@ -1,256 +0,0 @@ - - - - - {39c89f91-d860-4396-a49f-86b8b7a51c33} - cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - - - {be0cdf28-cbed-4774-b3cc-b63e4e3fa0a9} - - - {491cc60a-889b-4f53-aae9-f4d7d6aa667a} - - - {c084015d-3c3e-4379-8746-ae5cffcec79e} - - - {3333e0b3-e95f-44f6-9000-58d4da368360} - - - {528f2955-ceba-4691-a36c-054f119e3dcc} - - - {81686d52-eb71-4d4a-a830-66c45afb808f} - - - {98fe1e43-3794-4639-bf29-14b0c569754f} - - - {6b3956d4-0bff-4e8e-af61-a7e59b476fa4} - - - {446fad62-ac17-49e9-8263-33481f04f182} - - - {33fb7fc8-61f9-428d-9c94-7a4912fbb678} - - - {48fc77ec-7d78-4c0a-bfc2-9aa76faf5d7f} - - - - - Source Files\parsers - - - Source Files\arch - - - Source Files\arch - - - Source Files\arch - - - Source Files\arch - - - Source Files\arch - - - Source Files\arch - - - Source Files\arch - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\listfmts\nasm - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\parsers - - - Source Files\parsers - - - Source Files\parsers - - - Source Files\parsers - - - Source Files\parsers - - - Source Files\preprocs\cpp - - - Source Files\preprocs\gas - - - Source Files\preprocs\gas - - - Source Files\preprocs\nasm - - - Source Files\preprocs\nasm - - - Source Files\preprocs\nasm - - - Source Files\preprocs\nasm - - - Source Files\preprocs\raw - - - Source Files\parsers - - - Source Files\arch - - - Source Files\arch - - - Source Files\objfmts - - - - - Source Files\arch - - - Source Files\arch - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\parsers - - - Source Files\parsers - - - Source Files\preprocs\gas - - - Source Files\preprocs\nasm - - - Source Files\preprocs\nasm - - - Source Files\preprocs\nasm - - - Source Files\preprocs\nasm - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc10/out_copy_rename.bat b/Mkfiles/vc10/out_copy_rename.bat deleted file mode 100644 index 349ee330..00000000 --- a/Mkfiles/vc10/out_copy_rename.bat +++ /dev/null @@ -1,42 +0,0 @@ -@echo off -if not exist %1 goto nofile -if exist %2 goto copy - -echo creating directory %2 -md %2 > nul - -:copy -set str=%2 -for /f "useback tokens=*" %%a in ('%str%') do set str=%%~a -set str=%str:~-1% -if %str% == "\" goto hasbackslash - -if not exist %2\%3 goto cpy -fc %1 %2\%3 > nul && if not %errorlevel 1 goto exit -echo overwriting %2\%3 with %1 -copy %1 %2\%3 > nul -goto exit - -:cpy -echo copying %1 to %2\%3 -copy %1 %2\%3 > nul -goto exit - -:hasbackslash -if not exist %2%3 goto cpy2 -fc %1 %2%3 > nul && if not %errorlevel 1 goto exit -echo overwriting %2%3 with %1 -copy %1 %2%3 > nul -goto exit - -:cpy2 -echo copying %1 to %2%3 -copy %1 %2%3 > nul -goto exit - -:nofile -echo %1 not found - -:exit - - diff --git a/Mkfiles/vc10/re2c/re2c.vcxproj b/Mkfiles/vc10/re2c/re2c.vcxproj deleted file mode 100644 index fb50f146..00000000 --- a/Mkfiles/vc10/re2c/re2c.vcxproj +++ /dev/null @@ -1,134 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {3C58BE13-50A3-4583-984D-D8902B3D7713} - re2c - Win32Proj - - - - Application - MultiByte - - - Application - MultiByte - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - - - - Disabled - ..;../../..;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - Level3 - Default - ProgramDatabase - - - $(OutDir)re2c.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX86 - - - run.bat "$(TargetPath)" - - - - - Full - ..;../../..;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreaded - - - $(IntDir) - Level3 - Default - - - $(OutDir)re2c.exe - $(OutDir)$(TargetName).pdb - Console - true - true - false - - - MachineX86 - - - run.bat "$(TargetPath)" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc10/re2c/re2c.vcxproj.filters b/Mkfiles/vc10/re2c/re2c.vcxproj.filters deleted file mode 100644 index 426ee6eb..00000000 --- a/Mkfiles/vc10/re2c/re2c.vcxproj.filters +++ /dev/null @@ -1,80 +0,0 @@ - - - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc10/re2c/run.bat b/Mkfiles/vc10/re2c/run.bat deleted file mode 100644 index cde2a7b6..00000000 --- a/Mkfiles/vc10/re2c/run.bat +++ /dev/null @@ -1,4 +0,0 @@ -cd ..\..\..\ -%1 -s -o lc3bid.c modules\arch\lc3b\lc3bid.re -%1 -b -o nasm-token.c modules\parsers\nasm\nasm-token.re -%1 -b -o gas-token.c modules\parsers\gas\gas-token.re diff --git a/Mkfiles/vc10/readme.vc10.txt b/Mkfiles/vc10/readme.vc10.txt deleted file mode 100644 index 0182520b..00000000 --- a/Mkfiles/vc10/readme.vc10.txt +++ /dev/null @@ -1,119 +0,0 @@ -Building YASM with Microsoft Visual Studio 2010 (C/C++ v10) ------------------------------------------------------------ - -This note describes how to build YASM using Microsoft Visual -Studio 2010 (C/C++ v10). - -1. The Compiler ---------------- - -If you want to build the 64-bit version of YASM you will need -to install the Visual Studio 2010 64-bit tools, which may not -be installed by default. If using Visual C++ Express 2010, -you will need to install the Windows SDK to obtain the 64-bit -build tools. - -2. YASM Download ----------------- - -First YASM needs to be downloaded and the files placed within -a suitable directory, which will be called here but can -be named and located as you wish. - -3. Building YASM with Microsoft 2010 (VC10) -------------------------------------------- - -Now locate and double click on the yasm.sln solution file in -the 'Mkfiles/vc10' subdirectory to open the build project in -the Visual Studio 2010 IDE and then select: - - win32 or x64 build - release or debug build - -as appropriate to build the YASM binaries that you need. - -4. Using YASM with Visual Sudio 2010 and VC++ version 10 --------------------------------------------------------- - -The YASM version vsyasm.exe is designed specifically for use -with Visual Studio 2010. To tell Visual Studio where to find -vsyasm.exe, the environment variable YASMPATH can be set to -the absolute path of the directory in which vsyasm.exe is -located (this path should include the final backslash). - -Alternatively you can find the directory (or directories) -where the VC++ compiler binaries are located and put copies -of the vsyasm.exe binary in these directories. The typical -location on 64-bit Windows is: - -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin - -On 32-bit Windows it is normally at: - -C:\Program Files\Microsoft Visual Studio 10.0\VC\bin - -Depending on your system you can use either the win32 or the -x64 version of vsyasm.exe, which must be named vsyasm.exe. - -To use the new custom tools facility in Visual Studio 2010, you -need to place a copy of three files - yasm.props, yasm.targets -and yasm.xml - into a location where they can be found by the -Visual Studio build customisation processes. There are several -ways to do this: - - a. put these files in the MSBUILD customisation directory, - which is typically at: - - C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations - - or: - - C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations - - b. put them in a convenient location and set this path in the - 'Build Customisations Search Path' in the Visual Studio - 'Projects and Solutions|VC++ Project Settings' item in - the 'Tools|Options' menu; - - c. put them in a convenient location and set this path in the - 'Build Customisation dialogue (discussed later). - -To use YASM in a project, right click on the project in the Solution -Explorer and select 'Build Customisations..'. This will give you a -dialog box that allows you to select YASM as an assembler (note that -your assembler files need to have the extension '.asm'). If you have -used option c. above, you will need to let the dialogue find them -using the 'Find Existing' button below the dialogue. - -To assemble a file with YASM, select the Property Page for the -file and the select 'Yasm Assembler' in the Tool dialog entry. -Then click 'Apply' and an additional property page entry will -appear and enable YASM settings to be established. - -5. A Linker Issue ------------------ - -There appears to be a linker bug in the VC++ linker that -prevents symbols with absolute addresses being linked in DLL -builds. This means, for example, that LEA instructions of -the general form: - - lea, rax,[rax+symbol] - -cannot be used for DLL builds. The following general form -has to be used instead: - - lea rcx,[symbol wrt rip] - lea rax,[rax+rcx] - -This limitation may also cause problems with other instruction -that use absolute addresses. - -6. Acknowledgements -------------------- - -I am most grateful for the fantastic support that Peter Johnson, -YASM's creator, has given me in tracking down issues in using -YASM for the production of Windows x64 code. - - Brian Gladman, 29th January 2011 diff --git a/Mkfiles/vc10/vsyasm.props b/Mkfiles/vc10/vsyasm.props deleted file mode 100644 index 89476f2e..00000000 --- a/Mkfiles/vc10/vsyasm.props +++ /dev/null @@ -1,27 +0,0 @@ - - - - Midl - CustomBuild - - - _SelectedFiles;$(YASMDependsOn) - - - $(VCInstallDir)bin\ - - - - False - $(IntDir) - 0 - 0 - "$(YasmPath)"vsyasm.exe -Xvc -f $(Platform) [AllOptions] [AdditionalOptions] [Inputs] - %(ObjectFile) - Assembling %(Filename)%(Extension) - false - - - \ No newline at end of file diff --git a/Mkfiles/vc10/vsyasm.targets b/Mkfiles/vc10/vsyasm.targets deleted file mode 100644 index c86180dd..00000000 --- a/Mkfiles/vc10/vsyasm.targets +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - _YASM - - - - $(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml - - - - - - - - @(YASM, '|') - - - - - - - - - $(ComputeLinkInputsTargets); - ComputeYASMOutput; - - - $(ComputeLibInputsTargets); - ComputeYASMOutput; - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc10/vsyasm.vcxproj b/Mkfiles/vc10/vsyasm.vcxproj deleted file mode 100644 index a5ed2604..00000000 --- a/Mkfiles/vc10/vsyasm.vcxproj +++ /dev/null @@ -1,275 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {7FDD85BB-CC86-442B-A425-989B5B296ED5} - vsyasm - - - - Application - false - MultiByte - - - Application - false - MultiByte - - - Application - false - MultiByte - - - Application - false - MultiByte - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - - - - $(Platform)\$(Configuration)/yasm.tlb - - - - - Disabled - .;../..;%(AdditionalIncludeDirectories) - _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)vsyasm.exe - true - true - $(OutDir)$(ProjectName).pdb - Console - false - - - MachineX86 - - - - - X64 - $(Platform)\$(Configuration)/yasm.tlb - - - - - Disabled - .;../..;%(AdditionalIncludeDirectories) - _DEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)vsyasm.exe - true - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX64 - - - - - $(Platform)\$(Configuration)/yasm.tlb - - - - - Full - Default - true - .;../..;%(AdditionalIncludeDirectories) - NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)vsyasm.exe - true - true - $(OutDir)$(ProjectName).pdb - Console - false - - - MachineX86 - - - - - X64 - $(Platform)\$(Configuration)/yasm.tlb - - - - - Full - OnlyExplicitInline - .;../..;%(AdditionalIncludeDirectories) - NDEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)vsyasm.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX64 - true - - - - - - - - - {29fe7874-1256-4ad6-b889-68e399dc9608} - false - - - {d715a3d4-efaa-442e-ad8b-5b4ff64e1dd6} - false - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc10/vsyasm.xml b/Mkfiles/vc10/vsyasm.xml deleted file mode 100644 index 860bce8d..00000000 --- a/Mkfiles/vc10/vsyasm.xml +++ /dev/null @@ -1,283 +0,0 @@ - - - - - - - - - - - - - General - - - - - - Symbols - - - - - - Files - - - - - - Command Line - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Execute Before - - - Specifies the targets for the build customization to run before. - - - - - - - - - - - - Execute After - - - Specifies the targets for the build customization to run after. - - - - - - - - - - - - - - - - - - Additional Options - - - Additional Options - - - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc10/yasm.sln b/Mkfiles/vc10/yasm.sln deleted file mode 100644 index 306c7b10..00000000 --- a/Mkfiles/vc10/yasm.sln +++ /dev/null @@ -1,140 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{825AC694-358C-4D8D-92DE-33A2691978CE}" - ProjectSection(SolutionItems) = preProject - crt_secure_no_deprecate.vsprops = crt_secure_no_deprecate.vsprops - readme.vc10.txt = readme.vc10.txt - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libyasm", "libyasm\libyasm.vcxproj", "{29FE7874-1256-4AD6-B889-68E399DC9608}" - ProjectSection(ProjectDependencies) = postProject - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2} = {B545983B-8EE0-4A7B-A67A-E749EEAE62A2} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "modules", "modules\modules.vcxproj", "{D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yasm", "yasm.vcxproj", "{34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genmacro", "genmacro\genmacro.vcxproj", "{225700A5-07B8-434E-AD61-555278BF6733}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genversion", "genversion\genversion.vcxproj", "{B545983B-8EE0-4A7B-A67A-E749EEAE62A2}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "re2c", "re2c\re2c.vcxproj", "{3C58BE13-50A3-4583-984D-D8902B3D7713}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genperf", "genperf\genperf.vcxproj", "{C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genmodule", "genmodule\genmodule.vcxproj", "{F0E8B707-00C5-4FF2-B8EF-7C39817132A0}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genstring", "genstring\genstring.vcxproj", "{021CEB0A-F721-4F59-B349-9CEEAF244459}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ytasm", "ytasm.vcxproj", "{2162937B-0DBD-4450-B45F-DF578D8E7508}" - ProjectSection(ProjectDependencies) = postProject - {021CEB0A-F721-4F59-B349-9CEEAF244459} = {021CEB0A-F721-4F59-B349-9CEEAF244459} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vsyasm", "vsyasm.vcxproj", "{7FDD85BB-CC86-442B-A425-989B5B296ED5}" - ProjectSection(ProjectDependencies) = postProject - {021CEB0A-F721-4F59-B349-9CEEAF244459} = {021CEB0A-F721-4F59-B349-9CEEAF244459} - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|Win32.ActiveCfg = Debug|Win32 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|Win32.Build.0 = Debug|Win32 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|x64.ActiveCfg = Debug|x64 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|x64.Build.0 = Debug|x64 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|Win32.ActiveCfg = Release|Win32 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|Win32.Build.0 = Release|Win32 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|x64.ActiveCfg = Release|x64 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|x64.Build.0 = Release|x64 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|Win32.ActiveCfg = Debug|Win32 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|Win32.Build.0 = Debug|Win32 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|x64.ActiveCfg = Debug|x64 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|x64.Build.0 = Debug|x64 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|Win32.ActiveCfg = Release|Win32 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|Win32.Build.0 = Release|Win32 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|x64.ActiveCfg = Release|x64 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|x64.Build.0 = Release|x64 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|Win32.ActiveCfg = Debug|Win32 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|Win32.Build.0 = Debug|Win32 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|x64.ActiveCfg = Debug|x64 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|x64.Build.0 = Debug|x64 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|Win32.ActiveCfg = Release|Win32 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|Win32.Build.0 = Release|Win32 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|x64.ActiveCfg = Release|x64 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|x64.Build.0 = Release|x64 - {225700A5-07B8-434E-AD61-555278BF6733}.Debug|Win32.ActiveCfg = Debug|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Debug|Win32.Build.0 = Debug|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Debug|x64.ActiveCfg = Debug|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Debug|x64.Build.0 = Debug|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Release|Win32.ActiveCfg = Release|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Release|Win32.Build.0 = Release|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Release|x64.ActiveCfg = Release|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Release|x64.Build.0 = Release|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|Win32.ActiveCfg = Debug|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|Win32.Build.0 = Debug|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|x64.ActiveCfg = Debug|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|x64.Build.0 = Debug|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|Win32.ActiveCfg = Release|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|Win32.Build.0 = Release|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|x64.ActiveCfg = Release|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|x64.Build.0 = Release|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|Win32.ActiveCfg = Debug|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|Win32.Build.0 = Debug|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|x64.ActiveCfg = Debug|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|x64.Build.0 = Debug|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|Win32.ActiveCfg = Release|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|Win32.Build.0 = Release|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|x64.ActiveCfg = Release|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|x64.Build.0 = Release|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|Win32.ActiveCfg = Debug|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|Win32.Build.0 = Debug|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|x64.ActiveCfg = Debug|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|x64.Build.0 = Debug|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|Win32.ActiveCfg = Release|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|Win32.Build.0 = Release|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|x64.ActiveCfg = Release|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|x64.Build.0 = Release|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|Win32.ActiveCfg = Debug|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|Win32.Build.0 = Debug|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|x64.ActiveCfg = Debug|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|x64.Build.0 = Debug|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|Win32.ActiveCfg = Release|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|Win32.Build.0 = Release|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|x64.ActiveCfg = Release|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|x64.Build.0 = Release|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|Win32.ActiveCfg = Debug|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|Win32.Build.0 = Debug|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|x64.ActiveCfg = Debug|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|x64.Build.0 = Debug|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|Win32.ActiveCfg = Release|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|Win32.Build.0 = Release|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|x64.ActiveCfg = Release|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|x64.Build.0 = Release|Win32 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|Win32.ActiveCfg = Debug|Win32 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|Win32.Build.0 = Debug|Win32 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|x64.ActiveCfg = Debug|x64 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|x64.Build.0 = Debug|x64 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|Win32.ActiveCfg = Release|Win32 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|Win32.Build.0 = Release|Win32 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|x64.ActiveCfg = Release|x64 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|x64.Build.0 = Release|x64 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|Win32.ActiveCfg = Debug|Win32 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|Win32.Build.0 = Debug|Win32 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|x64.ActiveCfg = Debug|x64 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|x64.Build.0 = Debug|x64 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|Win32.ActiveCfg = Release|Win32 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|Win32.Build.0 = Release|Win32 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|x64.ActiveCfg = Release|x64 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/Mkfiles/vc10/yasm.vcxproj b/Mkfiles/vc10/yasm.vcxproj deleted file mode 100644 index 9379d70a..00000000 --- a/Mkfiles/vc10/yasm.vcxproj +++ /dev/null @@ -1,279 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5} - yasm - - - - Application - false - MultiByte - - - Application - false - MultiByte - - - Application - false - MultiByte - - - Application - false - MultiByte - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - - - - $(Platform)\$(Configuration)/yasm.tlb - - - - - Disabled - .;../..;%(AdditionalIncludeDirectories) - _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)yasm.exe - true - true - $(OutDir)$(ProjectName).pdb - Console - false - - - MachineX86 - - - - - X64 - $(Platform)\$(Configuration)/yasm.tlb - - - - - Disabled - .;../..;%(AdditionalIncludeDirectories) - _DEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)yasm.exe - true - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX64 - - - - - $(Platform)\$(Configuration)/yasm.tlb - - - - - Full - Default - true - .;../..;%(AdditionalIncludeDirectories) - NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)yasm.exe - true - true - $(OutDir)$(ProjectName).pdb - Console - false - - - MachineX86 - - - - - X64 - $(Platform)\$(Configuration)/yasm.tlb - - - - - Full - OnlyExplicitInline - .;../..;%(AdditionalIncludeDirectories) - NDEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)yasm.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX64 - true - - - - - - - - - - - - - - - - - {021ceb0a-f721-4f59-b349-9ceeaf244459} - false - - - {29fe7874-1256-4ad6-b889-68e399dc9608} - false - - - {d715a3d4-efaa-442e-ad8b-5b4ff64e1dd6} - false - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc10/yasm.vcxproj.filters b/Mkfiles/vc10/yasm.vcxproj.filters deleted file mode 100644 index df5419b8..00000000 --- a/Mkfiles/vc10/yasm.vcxproj.filters +++ /dev/null @@ -1,41 +0,0 @@ - - - - - {51f0d88e-1373-4bf8-a72e-c79706d37f8b} - h;hpp;hxx;hm;inl - - - {db67b411-6f59-462c-9c20-75024c6b3912} - cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - - - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - \ No newline at end of file diff --git a/Mkfiles/vc10/ytasm.vcxproj b/Mkfiles/vc10/ytasm.vcxproj deleted file mode 100644 index d45cdf48..00000000 --- a/Mkfiles/vc10/ytasm.vcxproj +++ /dev/null @@ -1,274 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {2162937B-0DBD-4450-B45F-DF578D8E7508} - ytasm - - - - Application - false - MultiByte - - - Application - false - MultiByte - - - Application - false - MultiByte - - - Application - false - MultiByte - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - - - - $(Platform)\$(Configuration)/yasm.tlb - - - - - Disabled - .;../..;%(AdditionalIncludeDirectories) - _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)ytasm.exe - true - true - $(OutDir)$(ProjectName).pdb - Console - false - - - MachineX86 - - - - - X64 - $(Platform)\$(Configuration)/yasm.tlb - - - - - Disabled - .;../..;%(AdditionalIncludeDirectories) - _DEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)ytasm.exe - true - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX64 - - - - - $(Platform)\$(Configuration)/yasm.tlb - - - - - Full - Default - true - .;../..;%(AdditionalIncludeDirectories) - NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)ytasm.exe - true - true - $(OutDir)$(ProjectName).pdb - Console - false - - - MachineX86 - - - - - X64 - $(Platform)\$(Configuration)/yasm.tlb - - - - - Full - OnlyExplicitInline - .;../..;%(AdditionalIncludeDirectories) - NDEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)ytasm.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX64 - true - - - - - - - - - - - - - - - - {29fe7874-1256-4ad6-b889-68e399dc9608} - false - - - {d715a3d4-efaa-442e-ad8b-5b4ff64e1dd6} - false - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc12/config.h b/Mkfiles/vc12/config.h deleted file mode 100644 index 8515ac5a..00000000 --- a/Mkfiles/vc12/config.h +++ /dev/null @@ -1,170 +0,0 @@ -#include "YASM-VERSION.h" -#define yasm__splitpath(path, tail) yasm__splitpath_win(path, tail) -#define yasm__abspath(path) yasm__abspath_win(path) -#define yasm__combpath(from, to) yasm__combpath_win(from, to) - -/* Command name to run C preprocessor */ -#define CPP_PROG "cpp" - -/* */ -/* #undef ENABLE_NLS */ - -/* Define if you have the `abort' function. */ -#define HAVE_ABORT 1 - -/* */ -/* #undef HAVE_CATGETS */ - -/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the - CoreFoundation framework. */ -/* #undef HAVE_CFLOCALECOPYCURRENT */ - -/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in - the CoreFoundation framework. */ -/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ - -/* Define if the GNU dcgettext() function is already present or preinstalled. - */ -/* #undef HAVE_DCGETTEXT */ - -/* Define to 1 if you have the header file. */ -#define HAVE_DIRECT_H 1 - -/* Define to 1 if you have the `getcwd' function. */ -#define HAVE_GETCWD 1 - -/* */ -/* #undef HAVE_GETTEXT */ - -/* Define if you have the GNU C Library */ -/* #undef HAVE_GNU_C_LIBRARY */ - -/* Define if you have the iconv() function. */ -/* #undef HAVE_ICONV */ - -/* Define if you have the header file. */ -/* #undef HAVE_INTTYPES_H */ - -/* */ -/* #undef HAVE_LC_MESSAGES */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_LIBGEN_H */ - -/* Define if you have the header file. */ -/* #undef HAVE_MEMORY_H */ - -/* Define if you have the `mergesort' function. */ -/* #undef HAVE_MERGESORT */ - -/* Define to 1 if you have the `popen' function. */ -/* #undef HAVE_POPEN */ - -/* Define if you have the header file. */ -/* #undef HAVE_STDINT_H */ - -/* Define if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* */ -/* #undef HAVE_STPCPY */ - -/* Define if you have the `strcasecmp' function. */ -/* #undef HAVE_STRCASECMP */ - -/* Define if you have the `strcmpi' function. */ -/* #undef HAVE_STRCMPI */ - -/* Define if you have the `stricmp' function. */ -/* #undefine HAVE_STRICMP */ - -/* Define if you have the header file. */ -/* #undef HAVE_STRINGS_H */ - -/* Define if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define if you have the `strncasecmp' function. */ -/* #undef HAVE_STRNCASECMP */ - -/* Define if you have the `strsep' function. */ -/* #undef HAVE_STRSEP */ - -/* Define if you have the header file. */ -/* #undef HAVE_SYS_STAT_H */ - -/* Define if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define if you have the `toascii' function. */ -#define HAVE_TOASCII 1 -#define toascii __toascii - -/* Define if you have the header file. */ -/* #undef HAVE_UNISTD_H */ - -/* Define to 1 if you have the `vsnprintf' function. */ -/* #undef HAVE_VSNPRINTF */ - -/* Define to 1 if you have the `_stricmp' function. */ -#define HAVE__STRICMP 1 - -/* Name of package */ -#define PACKAGE "yasm" - -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "bug-yasm@tortall.net" - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "yasm" - -/* Define to the full name and version of this package. */ -/*#define PACKAGE_STRING "yasm HEAD"*/ - -/* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "yasm" - -/* Define to the version of this package. */ -/*#define PACKAGE_VERSION "HEAD"*/ - -/* Define if the C compiler supports function prototypes. */ -#define PROTOTYPES 1 - -/* The size of a `char', as computed by sizeof. */ -/* #undef SIZEOF_CHAR */ - -/* The size of a `int', as computed by sizeof. */ -/* #undef SIZEOF_INT */ - -/* The size of a `long', as computed by sizeof. */ -/* #undef SIZEOF_LONG */ - -/* The size of a `short', as computed by sizeof. */ -/* #undef SIZEOF_SHORT */ - -/* The size of a `void*', as computed by sizeof. */ -/* #undef SIZEOF_VOIDP */ - -/* Define if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Version number of package */ -#define VERSION "HEAD" - -/* Define if using the dmalloc debugging malloc package */ -/* #undef WITH_DMALLOC */ - -/* Define like PROTOTYPES; this can be used by system headers. */ -#define __PROTOTYPES 1 - -/* Define to empty if `const' does not conform to ANSI C. */ -/* #undef const */ - -/* Define as `__inline' if that's what the C compiler calls it, or to nothing - if it is not supported. */ -#ifndef __cplusplus -/* #undef inline */ -#endif - -/* Define to `unsigned' if doesn't define. */ -/* #undef size_t */ diff --git a/Mkfiles/vc12/crt_secure_no_deprecate.props b/Mkfiles/vc12/crt_secure_no_deprecate.props deleted file mode 100644 index 777d6d0a..00000000 --- a/Mkfiles/vc12/crt_secure_no_deprecate.props +++ /dev/null @@ -1,11 +0,0 @@ - - - - <_ProjectFileVersion>10.0.21006.1 - - - - _CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - - - \ No newline at end of file diff --git a/Mkfiles/vc12/crt_secure_no_deprecate.vsprops b/Mkfiles/vc12/crt_secure_no_deprecate.vsprops deleted file mode 100644 index 56ab506f..00000000 --- a/Mkfiles/vc12/crt_secure_no_deprecate.vsprops +++ /dev/null @@ -1,11 +0,0 @@ - - - - diff --git a/Mkfiles/vc12/libyasm/libyasm.vcxproj b/Mkfiles/vc12/libyasm/libyasm.vcxproj deleted file mode 100644 index f258e027..00000000 --- a/Mkfiles/vc12/libyasm/libyasm.vcxproj +++ /dev/null @@ -1,277 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {29FE7874-1256-4AD6-B889-68E399DC9608} - libyasm - - - - StaticLibrary - false - MultiByte - v120 - - - StaticLibrary - false - MultiByte - v120 - - - StaticLibrary - false - MultiByte - v120 - - - StaticLibrary - false - MultiByte - v120 - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - - - - Full - Default - ..;../../..;%(AdditionalIncludeDirectories) - NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)libyasm.lib - true - - - - - X64 - - - Full - Default - ..;../../..;%(AdditionalIncludeDirectories) - NDEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)libyasm.lib - true - - - - - Disabled - ..;../../..;%(AdditionalIncludeDirectories) - _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)libyasm.lib - true - - - - - X64 - - - Disabled - ..;../../..;%(AdditionalIncludeDirectories) - _DEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)libyasm.lib - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {f0e8b707-00c5-4ff2-b8ef-7c39817132a0} - false - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc12/libyasm/libyasm.vcxproj.filters b/Mkfiles/vc12/libyasm/libyasm.vcxproj.filters deleted file mode 100644 index 9bdf13a4..00000000 --- a/Mkfiles/vc12/libyasm/libyasm.vcxproj.filters +++ /dev/null @@ -1,200 +0,0 @@ - - - - - {4ca3b698-9d01-4e4e-ae00-5c98da045efe} - h;hpp;hxx;hm;inl - - - {68607062-982d-4251-9a1a-30f76474983d} - cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Source Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc12/modules/modules.vcxproj b/Mkfiles/vc12/modules/modules.vcxproj deleted file mode 100644 index 1385bb61..00000000 --- a/Mkfiles/vc12/modules/modules.vcxproj +++ /dev/null @@ -1,324 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6} - modules - - - - StaticLibrary - false - MultiByte - v120 - - - StaticLibrary - false - MultiByte - v120 - - - StaticLibrary - false - MultiByte - v120 - - - StaticLibrary - false - MultiByte - v120 - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - - - - Full - Default - ..;../../..;%(AdditionalIncludeDirectories) - NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)modules.lib - true - - - - - - - - - X64 - - - Full - Default - ..;../../..;%(AdditionalIncludeDirectories) - NDEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)modules.lib - true - - - - - Disabled - ..;../../..;%(AdditionalIncludeDirectories) - _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)modules.lib - true - - - - - X64 - - - Disabled - ..;../../..;%(AdditionalIncludeDirectories) - _DEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)modules.lib - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {225700a5-07b8-434e-ad61-555278bf6733} - false - - - {c45a8b59-8b59-4d5d-a8e8-fb090f8dd619} - false - - - {29fe7874-1256-4ad6-b889-68e399dc9608} - false - - - {3c58be13-50a3-4583-984d-d8902b3d7713} - false - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc12/modules/modules.vcxproj.filters b/Mkfiles/vc12/modules/modules.vcxproj.filters deleted file mode 100644 index e6ff3add..00000000 --- a/Mkfiles/vc12/modules/modules.vcxproj.filters +++ /dev/null @@ -1,256 +0,0 @@ - - - - - {39c89f91-d860-4396-a49f-86b8b7a51c33} - cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - - - {be0cdf28-cbed-4774-b3cc-b63e4e3fa0a9} - - - {491cc60a-889b-4f53-aae9-f4d7d6aa667a} - - - {c084015d-3c3e-4379-8746-ae5cffcec79e} - - - {3333e0b3-e95f-44f6-9000-58d4da368360} - - - {528f2955-ceba-4691-a36c-054f119e3dcc} - - - {81686d52-eb71-4d4a-a830-66c45afb808f} - - - {98fe1e43-3794-4639-bf29-14b0c569754f} - - - {6b3956d4-0bff-4e8e-af61-a7e59b476fa4} - - - {446fad62-ac17-49e9-8263-33481f04f182} - - - {33fb7fc8-61f9-428d-9c94-7a4912fbb678} - - - {48fc77ec-7d78-4c0a-bfc2-9aa76faf5d7f} - - - - - Source Files\parsers - - - Source Files\arch - - - Source Files\arch - - - Source Files\arch - - - Source Files\arch - - - Source Files\arch - - - Source Files\arch - - - Source Files\arch - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\listfmts\nasm - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\parsers - - - Source Files\parsers - - - Source Files\parsers - - - Source Files\parsers - - - Source Files\parsers - - - Source Files\preprocs\cpp - - - Source Files\preprocs\gas - - - Source Files\preprocs\gas - - - Source Files\preprocs\nasm - - - Source Files\preprocs\nasm - - - Source Files\preprocs\nasm - - - Source Files\preprocs\nasm - - - Source Files\preprocs\raw - - - Source Files\parsers - - - Source Files\arch - - - Source Files\arch - - - Source Files\objfmts - - - - - Source Files\arch - - - Source Files\arch - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\parsers - - - Source Files\parsers - - - Source Files\preprocs\gas - - - Source Files\preprocs\nasm - - - Source Files\preprocs\nasm - - - Source Files\preprocs\nasm - - - Source Files\preprocs\nasm - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc12/out_copy_rename.bat b/Mkfiles/vc12/out_copy_rename.bat deleted file mode 100644 index 3179b59a..00000000 --- a/Mkfiles/vc12/out_copy_rename.bat +++ /dev/null @@ -1,42 +0,0 @@ -@echo off -if not exist %1 goto nofile -if exist %2 goto copy - -echo creating directory %2 -md %2 > nul - -:copy -set str=%2 -for /f "useback tokens=*" %%a in ('%str%') do set str=%%~a -set str=%str:~-1% -if %str% == "\" goto hasbackslash - -if not exist %2\%3 goto cpy -fc %1 %2\%3 > nul && if not %errorlevel 1 goto exit -echo overwriting %2\%3 with %1 -copy %1 %2\%3 > nul -goto exit - -:cpy -echo copying %1 to %2\%3 -copy %1 %2\%3 > nul -goto exit - -:hasbackslash -if not exist %2%3 goto cpy2 -fc %1 %2%3 > nul && if not %errorlevel 1 goto exit -echo overwriting %2%3 with %1 -copy %1 %2%3 > nul -goto exit - -:cpy2 -echo copying %1 to %2%3 -copy %1 %2%3 > nul -goto exit - -:nofile -echo %1 not found - -:exit - - diff --git a/Mkfiles/vc12/readme.vc12.txt b/Mkfiles/vc12/readme.vc12.txt deleted file mode 100644 index 10c84f1a..00000000 --- a/Mkfiles/vc12/readme.vc12.txt +++ /dev/null @@ -1,106 +0,0 @@ -Building YASM with Microsoft Visual Studio 2010 (C/C++ v10) ------------------------------------------------------------ - -This note describes how to build YASM using Microsoft Visual -Studio 2013 (C/C++ v12). - -1. YASM Download ----------------- - -First YASM needs to be downloaded and the files placed within -a suitable directory, which will be called here but can -be named and located as you wish. - -2. Building YASM with Microsoft 2013 (VC12) -------------------------------------------- - -Now locate and double click on the yasm.sln solution file in -the 'Mkfiles/vc12' subdirectory to open the build project in -the Visual Studio 2010 IDE and then select: - - win32 or x64 build - release or debug build - -as appropriate to build the YASM binaries that you need. - -4. Using YASM with Visual Sudio 2013 and VC++ version 12 --------------------------------------------------------- - -The YASM version vsyasm.exe is designed specifically for use -with the 2010 and later versions of Visual Studio. To tell -Visual Studio where to find vsyasm.exe, the environment -variable YASMPATH can be set to the absolute path of the -directory in which vsyasm.exe is located (this path should -include the final backslash). - -Alternatively you can find the directory (or directories) -where the VC++ compiler binaries are located and put copies -of the vsyasm.exe binary in these directories. The typical -location on 64-bit Windows is: - -C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin - -On 32-bit Windows it is normally at: - -C:\Program Files\Microsoft Visual Studio 12.0\VC\bin - -Depending on your system you can use either the win32 or the -x64 version of vsyasm.exe, which must be named vsyasm.exe. - -To use the new custom tools facility in Visual Studio 2010, you -need to place a copy of three files - yasm.props, yasm.targets -and yasm.xml - into a location where they can be found by the -Visual Studio build customisation processes. There are several -ways to do this: - - a. put these files in the MSBUILD customisation directory, - which is typically at: - - C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\BuildCustomizations - - b. put them in a convenient location and set this path in the - 'Build Customisations Search Path' in the Visual Studio - 'Projects and Solutions|VC++ Project Settings' item in - the 'Tools|Options' menu; - - c. put them in a convenient location and set this path in the - 'Build Customisation dialogue (discussed later). - -To use YASM in a project, right click on the project in the Solution -Explorer and select 'Build Customisations..'. This will give you a -dialog box that allows you to select YASM as an assembler (note that -your assembler files need to have the extension '.asm'). If you have -used option c. above, you will need to let the dialogue find them -using the 'Find Existing' button below the dialogue. - -To assemble a file with YASM, select the Property Page for the file -and the select 'Yasm Assembler' in the Tool dialog entry. Then click -'Apply' and an additional property page entry will appear and enable -YASM settings to be established. - -5. A Linker Issue ------------------ - -There appears to be a linker bug in the VC++ linker that prevents -symbols with absolute addresses being linked in DLL builds. This -means, for example, that LEA instructions of the general form: - - lea, rax,[rax+symbol] - -cannot be used for DLL builds. The following general form -has to be used instead: - - lea rcx,[symbol wrt rip] - lea rax,[rax+rcx] - -This limitation may also cause problems with other instruction -that use absolute addresses. - -6. Acknowledgements -------------------- - -I am most grateful for the fantastic support that Peter Johnson, -YASM's creator, has given me in tracking down issues in using -YASM for the production of Windows x64 code. - - Brian Gladman, 6th April 2013 diff --git a/Mkfiles/vc12/vsyasm.props b/Mkfiles/vc12/vsyasm.props deleted file mode 100644 index 80b93c7e..00000000 --- a/Mkfiles/vc12/vsyasm.props +++ /dev/null @@ -1,27 +0,0 @@ - - - - Midl - CustomBuild - - - _SelectedFiles;$(YASMDependsOn) - - - $(VCInstallDir)bin\ - - - - False - $(IntDir) - 0 - 0 - "$(YasmPath)"vsyasm.exe -Xvc -f $(Platform) [AllOptions] [AdditionalOptions] [Inputs] - %(ObjectFile) - Assembling %(Filename)%(Extension) - false - - - \ No newline at end of file diff --git a/Mkfiles/vc12/vsyasm.targets b/Mkfiles/vc12/vsyasm.targets deleted file mode 100644 index 3c084119..00000000 --- a/Mkfiles/vc12/vsyasm.targets +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - _YASM - - - - $(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml - - - - - - - - @(YASM, '|') - - - - - - - - - $(ComputeLinkInputsTargets); - ComputeYASMOutput; - - - $(ComputeLibInputsTargets); - ComputeYASMOutput; - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc12/vsyasm.vcxproj b/Mkfiles/vc12/vsyasm.vcxproj deleted file mode 100644 index b34d8e66..00000000 --- a/Mkfiles/vc12/vsyasm.vcxproj +++ /dev/null @@ -1,279 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {7FDD85BB-CC86-442B-A425-989B5B296ED5} - vsyasm - - - - Application - false - MultiByte - v120 - - - Application - false - MultiByte - v120 - - - Application - false - MultiByte - v120 - - - Application - false - MultiByte - v120 - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - - - - $(Platform)\$(Configuration)/yasm.tlb - - - - - Disabled - .;../..;%(AdditionalIncludeDirectories) - _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)vsyasm.exe - true - true - $(OutDir)$(ProjectName).pdb - Console - false - - - MachineX86 - - - - - X64 - $(Platform)\$(Configuration)/yasm.tlb - - - - - Disabled - .;../..;%(AdditionalIncludeDirectories) - _DEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)vsyasm.exe - true - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX64 - - - - - $(Platform)\$(Configuration)/yasm.tlb - - - - - Full - Default - true - .;../..;%(AdditionalIncludeDirectories) - NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)vsyasm.exe - true - true - $(OutDir)$(ProjectName).pdb - Console - false - - - MachineX86 - - - - - X64 - $(Platform)\$(Configuration)/yasm.tlb - - - - - Full - OnlyExplicitInline - .;../..;%(AdditionalIncludeDirectories) - NDEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)vsyasm.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX64 - true - - - - - - - - - {29fe7874-1256-4ad6-b889-68e399dc9608} - false - - - {d715a3d4-efaa-442e-ad8b-5b4ff64e1dd6} - false - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc12/vsyasm.xml b/Mkfiles/vc12/vsyasm.xml deleted file mode 100644 index cd08cbba..00000000 --- a/Mkfiles/vc12/vsyasm.xml +++ /dev/null @@ -1,283 +0,0 @@ - - - - - - - - - - - - - General - - - - - - Symbols - - - - - - Files - - - - - - Command Line - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Execute Before - - - Specifies the targets for the build customization to run before. - - - - - - - - - - - - Execute After - - - Specifies the targets for the build customization to run after. - - - - - - - - - - - - - - - - - - Additional Options - - - Additional Options - - - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc12/yasm.sln b/Mkfiles/vc12/yasm.sln deleted file mode 100644 index dec8fd47..00000000 --- a/Mkfiles/vc12/yasm.sln +++ /dev/null @@ -1,142 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.21005.1 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{825AC694-358C-4D8D-92DE-33A2691978CE}" - ProjectSection(SolutionItems) = preProject - crt_secure_no_deprecate.vsprops = crt_secure_no_deprecate.vsprops - readme.vc10.txt = readme.vc10.txt - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libyasm", "libyasm\libyasm.vcxproj", "{29FE7874-1256-4AD6-B889-68E399DC9608}" - ProjectSection(ProjectDependencies) = postProject - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2} = {B545983B-8EE0-4A7B-A67A-E749EEAE62A2} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "modules", "modules\modules.vcxproj", "{D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yasm", "yasm.vcxproj", "{34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genmacro", "genmacro\genmacro.vcxproj", "{225700A5-07B8-434E-AD61-555278BF6733}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genversion", "genversion\genversion.vcxproj", "{B545983B-8EE0-4A7B-A67A-E749EEAE62A2}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "re2c", "re2c\re2c.vcxproj", "{3C58BE13-50A3-4583-984D-D8902B3D7713}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genperf", "genperf\genperf.vcxproj", "{C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genmodule", "genmodule\genmodule.vcxproj", "{F0E8B707-00C5-4FF2-B8EF-7C39817132A0}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genstring", "genstring\genstring.vcxproj", "{021CEB0A-F721-4F59-B349-9CEEAF244459}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ytasm", "ytasm.vcxproj", "{2162937B-0DBD-4450-B45F-DF578D8E7508}" - ProjectSection(ProjectDependencies) = postProject - {021CEB0A-F721-4F59-B349-9CEEAF244459} = {021CEB0A-F721-4F59-B349-9CEEAF244459} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vsyasm", "vsyasm.vcxproj", "{7FDD85BB-CC86-442B-A425-989B5B296ED5}" - ProjectSection(ProjectDependencies) = postProject - {021CEB0A-F721-4F59-B349-9CEEAF244459} = {021CEB0A-F721-4F59-B349-9CEEAF244459} - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|Win32.ActiveCfg = Debug|Win32 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|Win32.Build.0 = Debug|Win32 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|x64.ActiveCfg = Debug|x64 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|x64.Build.0 = Debug|x64 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|Win32.ActiveCfg = Release|Win32 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|Win32.Build.0 = Release|Win32 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|x64.ActiveCfg = Release|x64 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|x64.Build.0 = Release|x64 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|Win32.ActiveCfg = Debug|Win32 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|Win32.Build.0 = Debug|Win32 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|x64.ActiveCfg = Debug|x64 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|x64.Build.0 = Debug|x64 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|Win32.ActiveCfg = Release|Win32 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|Win32.Build.0 = Release|Win32 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|x64.ActiveCfg = Release|x64 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|x64.Build.0 = Release|x64 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|Win32.ActiveCfg = Debug|Win32 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|Win32.Build.0 = Debug|Win32 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|x64.ActiveCfg = Debug|x64 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|x64.Build.0 = Debug|x64 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|Win32.ActiveCfg = Release|Win32 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|Win32.Build.0 = Release|Win32 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|x64.ActiveCfg = Release|x64 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|x64.Build.0 = Release|x64 - {225700A5-07B8-434E-AD61-555278BF6733}.Debug|Win32.ActiveCfg = Debug|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Debug|Win32.Build.0 = Debug|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Debug|x64.ActiveCfg = Debug|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Debug|x64.Build.0 = Debug|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Release|Win32.ActiveCfg = Release|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Release|Win32.Build.0 = Release|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Release|x64.ActiveCfg = Release|x64 - {225700A5-07B8-434E-AD61-555278BF6733}.Release|x64.Build.0 = Release|x64 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|Win32.ActiveCfg = Debug|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|Win32.Build.0 = Debug|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|x64.ActiveCfg = Debug|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|x64.Build.0 = Debug|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|Win32.ActiveCfg = Release|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|Win32.Build.0 = Release|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|x64.ActiveCfg = Release|x64 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|x64.Build.0 = Release|x64 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|Win32.ActiveCfg = Debug|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|Win32.Build.0 = Debug|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|x64.ActiveCfg = Debug|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|x64.Build.0 = Debug|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|Win32.ActiveCfg = Release|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|Win32.Build.0 = Release|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|x64.ActiveCfg = Release|x64 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|x64.Build.0 = Release|x64 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|Win32.ActiveCfg = Debug|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|Win32.Build.0 = Debug|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|x64.ActiveCfg = Debug|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|x64.Build.0 = Debug|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|Win32.ActiveCfg = Release|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|Win32.Build.0 = Release|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|x64.ActiveCfg = Release|x64 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|x64.Build.0 = Release|x64 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|Win32.ActiveCfg = Debug|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|Win32.Build.0 = Debug|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|x64.ActiveCfg = Debug|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|x64.Build.0 = Debug|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|Win32.ActiveCfg = Release|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|Win32.Build.0 = Release|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|x64.ActiveCfg = Release|x64 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|x64.Build.0 = Release|x64 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|Win32.ActiveCfg = Debug|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|Win32.Build.0 = Debug|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|x64.ActiveCfg = Debug|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|x64.Build.0 = Debug|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|Win32.ActiveCfg = Release|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|Win32.Build.0 = Release|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|x64.ActiveCfg = Release|x64 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|x64.Build.0 = Release|x64 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|Win32.ActiveCfg = Debug|Win32 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|Win32.Build.0 = Debug|Win32 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|x64.ActiveCfg = Debug|x64 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|x64.Build.0 = Debug|x64 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|Win32.ActiveCfg = Release|Win32 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|Win32.Build.0 = Release|Win32 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|x64.ActiveCfg = Release|x64 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|x64.Build.0 = Release|x64 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|Win32.ActiveCfg = Debug|Win32 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|Win32.Build.0 = Debug|Win32 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|x64.ActiveCfg = Debug|x64 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|x64.Build.0 = Debug|x64 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|Win32.ActiveCfg = Release|Win32 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|Win32.Build.0 = Release|Win32 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|x64.ActiveCfg = Release|x64 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/Mkfiles/vc12/yasm.vcxproj b/Mkfiles/vc12/yasm.vcxproj deleted file mode 100644 index 18672491..00000000 --- a/Mkfiles/vc12/yasm.vcxproj +++ /dev/null @@ -1,283 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5} - yasm - - - - Application - false - MultiByte - v120 - - - Application - false - MultiByte - v120 - - - Application - false - MultiByte - v120 - - - Application - false - MultiByte - v120 - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - - - - $(Platform)\$(Configuration)/yasm.tlb - - - - - Disabled - .;../..;%(AdditionalIncludeDirectories) - _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)yasm.exe - true - true - $(OutDir)$(ProjectName).pdb - Console - false - - - MachineX86 - - - - - X64 - $(Platform)\$(Configuration)/yasm.tlb - - - - - Disabled - .;../..;%(AdditionalIncludeDirectories) - _DEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)yasm.exe - true - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX64 - - - - - $(Platform)\$(Configuration)/yasm.tlb - - - - - Full - Default - true - .;../..;%(AdditionalIncludeDirectories) - NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)yasm.exe - true - true - $(OutDir)$(ProjectName).pdb - Console - false - - - MachineX86 - - - - - X64 - $(Platform)\$(Configuration)/yasm.tlb - - - - - Full - OnlyExplicitInline - .;../..;%(AdditionalIncludeDirectories) - NDEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)yasm.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX64 - true - - - - - - - - - - - - - - - - - {021ceb0a-f721-4f59-b349-9ceeaf244459} - false - - - {29fe7874-1256-4ad6-b889-68e399dc9608} - false - - - {d715a3d4-efaa-442e-ad8b-5b4ff64e1dd6} - false - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc12/yasm.vcxproj.filters b/Mkfiles/vc12/yasm.vcxproj.filters deleted file mode 100644 index 04941c22..00000000 --- a/Mkfiles/vc12/yasm.vcxproj.filters +++ /dev/null @@ -1,41 +0,0 @@ - - - - - {51f0d88e-1373-4bf8-a72e-c79706d37f8b} - h;hpp;hxx;hm;inl - - - {db67b411-6f59-462c-9c20-75024c6b3912} - cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - - - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - \ No newline at end of file diff --git a/Mkfiles/vc12/ytasm.vcxproj b/Mkfiles/vc12/ytasm.vcxproj deleted file mode 100644 index 24d1869e..00000000 --- a/Mkfiles/vc12/ytasm.vcxproj +++ /dev/null @@ -1,278 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {2162937B-0DBD-4450-B45F-DF578D8E7508} - ytasm - - - - Application - false - MultiByte - v120 - - - Application - false - MultiByte - v120 - - - Application - false - MultiByte - v120 - - - Application - false - MultiByte - v120 - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - - - - $(Platform)\$(Configuration)/yasm.tlb - - - - - Disabled - .;../..;%(AdditionalIncludeDirectories) - _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)ytasm.exe - true - true - $(OutDir)$(ProjectName).pdb - Console - false - - - MachineX86 - - - - - X64 - $(Platform)\$(Configuration)/yasm.tlb - - - - - Disabled - .;../..;%(AdditionalIncludeDirectories) - _DEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)ytasm.exe - true - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX64 - - - - - $(Platform)\$(Configuration)/yasm.tlb - - - - - Full - Default - true - .;../..;%(AdditionalIncludeDirectories) - NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)ytasm.exe - true - true - $(OutDir)$(ProjectName).pdb - Console - false - - - MachineX86 - - - - - X64 - $(Platform)\$(Configuration)/yasm.tlb - - - - - Full - OnlyExplicitInline - .;../..;%(AdditionalIncludeDirectories) - NDEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)ytasm.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX64 - true - - - - - - - - - - - - - - - - {29fe7874-1256-4ad6-b889-68e399dc9608} - false - - - {d715a3d4-efaa-442e-ad8b-5b4ff64e1dd6} - false - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc14/config.h b/Mkfiles/vc14/config.h deleted file mode 100644 index 8515ac5a..00000000 --- a/Mkfiles/vc14/config.h +++ /dev/null @@ -1,170 +0,0 @@ -#include "YASM-VERSION.h" -#define yasm__splitpath(path, tail) yasm__splitpath_win(path, tail) -#define yasm__abspath(path) yasm__abspath_win(path) -#define yasm__combpath(from, to) yasm__combpath_win(from, to) - -/* Command name to run C preprocessor */ -#define CPP_PROG "cpp" - -/* */ -/* #undef ENABLE_NLS */ - -/* Define if you have the `abort' function. */ -#define HAVE_ABORT 1 - -/* */ -/* #undef HAVE_CATGETS */ - -/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the - CoreFoundation framework. */ -/* #undef HAVE_CFLOCALECOPYCURRENT */ - -/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in - the CoreFoundation framework. */ -/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ - -/* Define if the GNU dcgettext() function is already present or preinstalled. - */ -/* #undef HAVE_DCGETTEXT */ - -/* Define to 1 if you have the header file. */ -#define HAVE_DIRECT_H 1 - -/* Define to 1 if you have the `getcwd' function. */ -#define HAVE_GETCWD 1 - -/* */ -/* #undef HAVE_GETTEXT */ - -/* Define if you have the GNU C Library */ -/* #undef HAVE_GNU_C_LIBRARY */ - -/* Define if you have the iconv() function. */ -/* #undef HAVE_ICONV */ - -/* Define if you have the header file. */ -/* #undef HAVE_INTTYPES_H */ - -/* */ -/* #undef HAVE_LC_MESSAGES */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_LIBGEN_H */ - -/* Define if you have the header file. */ -/* #undef HAVE_MEMORY_H */ - -/* Define if you have the `mergesort' function. */ -/* #undef HAVE_MERGESORT */ - -/* Define to 1 if you have the `popen' function. */ -/* #undef HAVE_POPEN */ - -/* Define if you have the header file. */ -/* #undef HAVE_STDINT_H */ - -/* Define if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* */ -/* #undef HAVE_STPCPY */ - -/* Define if you have the `strcasecmp' function. */ -/* #undef HAVE_STRCASECMP */ - -/* Define if you have the `strcmpi' function. */ -/* #undef HAVE_STRCMPI */ - -/* Define if you have the `stricmp' function. */ -/* #undefine HAVE_STRICMP */ - -/* Define if you have the header file. */ -/* #undef HAVE_STRINGS_H */ - -/* Define if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define if you have the `strncasecmp' function. */ -/* #undef HAVE_STRNCASECMP */ - -/* Define if you have the `strsep' function. */ -/* #undef HAVE_STRSEP */ - -/* Define if you have the header file. */ -/* #undef HAVE_SYS_STAT_H */ - -/* Define if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define if you have the `toascii' function. */ -#define HAVE_TOASCII 1 -#define toascii __toascii - -/* Define if you have the header file. */ -/* #undef HAVE_UNISTD_H */ - -/* Define to 1 if you have the `vsnprintf' function. */ -/* #undef HAVE_VSNPRINTF */ - -/* Define to 1 if you have the `_stricmp' function. */ -#define HAVE__STRICMP 1 - -/* Name of package */ -#define PACKAGE "yasm" - -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "bug-yasm@tortall.net" - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "yasm" - -/* Define to the full name and version of this package. */ -/*#define PACKAGE_STRING "yasm HEAD"*/ - -/* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "yasm" - -/* Define to the version of this package. */ -/*#define PACKAGE_VERSION "HEAD"*/ - -/* Define if the C compiler supports function prototypes. */ -#define PROTOTYPES 1 - -/* The size of a `char', as computed by sizeof. */ -/* #undef SIZEOF_CHAR */ - -/* The size of a `int', as computed by sizeof. */ -/* #undef SIZEOF_INT */ - -/* The size of a `long', as computed by sizeof. */ -/* #undef SIZEOF_LONG */ - -/* The size of a `short', as computed by sizeof. */ -/* #undef SIZEOF_SHORT */ - -/* The size of a `void*', as computed by sizeof. */ -/* #undef SIZEOF_VOIDP */ - -/* Define if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Version number of package */ -#define VERSION "HEAD" - -/* Define if using the dmalloc debugging malloc package */ -/* #undef WITH_DMALLOC */ - -/* Define like PROTOTYPES; this can be used by system headers. */ -#define __PROTOTYPES 1 - -/* Define to empty if `const' does not conform to ANSI C. */ -/* #undef const */ - -/* Define as `__inline' if that's what the C compiler calls it, or to nothing - if it is not supported. */ -#ifndef __cplusplus -/* #undef inline */ -#endif - -/* Define to `unsigned' if doesn't define. */ -/* #undef size_t */ diff --git a/Mkfiles/vc14/crt_secure_no_deprecate.props b/Mkfiles/vc14/crt_secure_no_deprecate.props deleted file mode 100644 index 777d6d0a..00000000 --- a/Mkfiles/vc14/crt_secure_no_deprecate.props +++ /dev/null @@ -1,11 +0,0 @@ - - - - <_ProjectFileVersion>10.0.21006.1 - - - - _CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - - - \ No newline at end of file diff --git a/Mkfiles/vc14/crt_secure_no_deprecate.vsprops b/Mkfiles/vc14/crt_secure_no_deprecate.vsprops deleted file mode 100644 index 56ab506f..00000000 --- a/Mkfiles/vc14/crt_secure_no_deprecate.vsprops +++ /dev/null @@ -1,11 +0,0 @@ - - - - diff --git a/Mkfiles/vc14/genmacro/genmacro.vcxproj b/Mkfiles/vc14/genmacro/genmacro.vcxproj deleted file mode 100644 index f4bbc6f3..00000000 --- a/Mkfiles/vc14/genmacro/genmacro.vcxproj +++ /dev/null @@ -1,202 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {225700A5-07B8-434E-AD61-555278BF6733} - genmacro - Win32Proj - - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - - - - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - Level3 - ProgramDatabase - Default - - - $(OutDir)genmacro.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX86 - - - run.bat "$(TargetPath)" - - - - - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - Level3 - ProgramDatabase - Default - - - $(OutDir)genmacro.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - - - run.bat "$(TargetPath)" - - - - - Full - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreaded - - - $(IntDir) - Level3 - Default - - - $(OutDir)genmacro.exe - $(OutDir)$(TargetName).pdb - Console - true - true - false - - - MachineX86 - - - run.bat "$(TargetPath)" - - - - - Full - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreaded - - - $(IntDir) - Level3 - Default - - - $(OutDir)genmacro.exe - $(OutDir)$(TargetName).pdb - Console - true - true - false - - - - - run.bat "$(TargetPath)" - - - - - - - - - - - {b545983b-8ee0-4a7b-a67a-e749eeae62a2} - false - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc14/genmacro/genmacro.vcxproj.filters b/Mkfiles/vc14/genmacro/genmacro.vcxproj.filters deleted file mode 100644 index 402cf1b4..00000000 --- a/Mkfiles/vc14/genmacro/genmacro.vcxproj.filters +++ /dev/null @@ -1,17 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx - - - - - Source Files - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc14/genmacro/run.bat b/Mkfiles/vc14/genmacro/run.bat deleted file mode 100644 index 98c337ac..00000000 --- a/Mkfiles/vc14/genmacro/run.bat +++ /dev/null @@ -1,5 +0,0 @@ -cd ..\..\.. -%1 nasm-version.c nasm_version_mac version.mac -%1 nasm-macros.c nasm_standard_mac modules\parsers\nasm\nasm-std.mac -%1 win64-nasm.c win64_nasm_stdmac modules\objfmts\coff\win64-nasm.mac -%1 win64-gas.c win64_gas_stdmac modules\objfmts\coff\win64-gas.mac diff --git a/Mkfiles/vc14/genmodule/genmodule.vcxproj b/Mkfiles/vc14/genmodule/genmodule.vcxproj deleted file mode 100644 index 44f2a002..00000000 --- a/Mkfiles/vc14/genmodule/genmodule.vcxproj +++ /dev/null @@ -1,207 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0} - genmodule - Win32Proj - - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - - - - Disabled - %(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;FILTERMODE;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - $(IntDir) - Level3 - ProgramDatabase - Default - - - $(OutDir)genmodule.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX86 - - - run.bat "$(TargetPath)" - - - - - Disabled - %(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;FILTERMODE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - $(IntDir) - Level3 - ProgramDatabase - Default - - - $(OutDir)genmodule.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - - - run.bat "$(TargetPath)" - - - - - Full - %(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;FILTERMODE;%(PreprocessorDefinitions) - MultiThreaded - - - $(IntDir) - $(IntDir) - Level3 - Default - - - $(OutDir)genmodule.exe - $(OutDir)$(TargetName).pdb - Console - true - true - false - - - MachineX86 - - - run.bat "$(TargetPath)" - - - - - Full - %(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;FILTERMODE;%(PreprocessorDefinitions) - MultiThreaded - - - $(IntDir) - $(IntDir) - Level3 - Default - - - $(OutDir)genmodule.exe - $(OutDir)$(TargetName).pdb - Console - true - true - false - - - - - run.bat "$(TargetPath)" - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc14/genmodule/genmodule.vcxproj.filters b/Mkfiles/vc14/genmodule/genmodule.vcxproj.filters deleted file mode 100644 index d3255c29..00000000 --- a/Mkfiles/vc14/genmodule/genmodule.vcxproj.filters +++ /dev/null @@ -1,20 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx - - - - - Source Files - - - - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc14/genmodule/run.bat b/Mkfiles/vc14/genmodule/run.bat deleted file mode 100644 index 00055692..00000000 --- a/Mkfiles/vc14/genmodule/run.bat +++ /dev/null @@ -1,3 +0,0 @@ -@echo off -cd ..\..\.. -%1 libyasm\module.in Makefile.am diff --git a/Mkfiles/vc14/genperf/genperf.vcxproj b/Mkfiles/vc14/genperf/genperf.vcxproj deleted file mode 100644 index 4ccf38a2..00000000 --- a/Mkfiles/vc14/genperf/genperf.vcxproj +++ /dev/null @@ -1,261 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619} - genperf - Win32Proj - - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - false - false - false - false - - - - - - - - Disabled - ..;../../..;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;STDC_HEADERS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - Level3 - ProgramDatabase - Default - - - $(OutDir)genperf.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX86 - - - - - - - run.bat "$(TargetPath)" - - - x86insn_nasm.c;x86insn_gas.c;x86cpu.c;x86regtmod.c;%(Outputs) - - - run.bat "$(TargetPath)" - - - - - Disabled - ..;../../..;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;STDC_HEADERS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - Level3 - ProgramDatabase - Default - - - $(OutDir)genperf.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - - - - - - - run.bat "$(TargetPath)" - - - x86insn_nasm.c;x86insn_gas.c;x86cpu.c;x86regtmod.c;%(Outputs) - - - run.bat "$(TargetPath)" - - - - - Full - ..;../../..;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;STDC_HEADERS;%(PreprocessorDefinitions) - MultiThreaded - - - $(IntDir) - Level3 - Default - - - $(OutDir)genperf.exe - $(OutDir)$(TargetName).pdb - Console - true - true - false - - - MachineX86 - - - - - - - run.bat "$(TargetPath)" - - - x86insn_nasm.c;x86insn_gas.c;x86cpu.c;x86regtmod.c;%(Outputs) - - - run.bat "$(TargetPath)" - - - - - Full - ..;../../..;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;STDC_HEADERS;%(PreprocessorDefinitions) - MultiThreaded - - - $(IntDir) - Level3 - Default - - - $(OutDir)genperf.exe - $(OutDir)$(TargetName).pdb - Console - true - true - false - - - - - - - - - run.bat "$(TargetPath)" - - - x86insn_nasm.c;x86insn_gas.c;x86cpu.c;x86regtmod.c;%(Outputs) - - - run.bat "$(TargetPath)" - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc14/genperf/genperf.vcxproj.filters b/Mkfiles/vc14/genperf/genperf.vcxproj.filters deleted file mode 100644 index 3124b5d7..00000000 --- a/Mkfiles/vc14/genperf/genperf.vcxproj.filters +++ /dev/null @@ -1,56 +0,0 @@ - - - - - {3C1E9AA8-6338-4CED-99F1-BEBA80607BD5} - h;hpp;hxx;hm;inl;inc;xsd - - - {1062695D-1C50-4068-8313-73A409885BC1} - cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc14/genperf/run.bat b/Mkfiles/vc14/genperf/run.bat deleted file mode 100644 index c6f83543..00000000 --- a/Mkfiles/vc14/genperf/run.bat +++ /dev/null @@ -1,40 +0,0 @@ -cd ..\..\.. -@echo off - -for /f "usebackq tokens=1*" %%f in (`reg query HKCR\Applications\python.exe\shell\open\command 2^>NUL`) do (set _my_=%%f %%g) -goto try1%errorlevel% - -:try10 -goto ok - -:try11 -for /f "usebackq tokens=1*" %%f in (`reg query HKCR\Python.File\shell\open\command 2^>NUL`) do (set _my_=%%f %%g) -goto try2%errorlevel% - -:try20: -goto ok - -:try21: -echo Building without Python ... -goto therest - -:ok -echo Building with Python ... -set _res_=%_my_:*REG_SZ=% -set _end_=%_res_:*exe"=% -call set _python_=%%_res_:%_end_%=%% -echo %_python_% -call %_python_% modules\arch\x86\gen_x86_insn.py - -:therest -@echo on -call :update %1 x86insn_nasm.gperf x86insn_nasm.c -call :update %1 x86insn_gas.gperf x86insn_gas.c -call :update %1 modules\arch\x86\x86cpu.gperf x86cpu.c -call :update %1 modules\arch\x86\x86regtmod.gperf x86regtmod.c -goto :eof - -:update -%1 %2 tf -call mkfiles\vc14\out_copy_rename tf .\ %3 -del tf diff --git a/Mkfiles/vc14/genstring/genstring.vcxproj b/Mkfiles/vc14/genstring/genstring.vcxproj deleted file mode 100644 index 239c8cf7..00000000 --- a/Mkfiles/vc14/genstring/genstring.vcxproj +++ /dev/null @@ -1,196 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {021CEB0A-F721-4F59-B349-9CEEAF244459} - genstring - Win32Proj - - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - - - - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - Level3 - ProgramDatabase - Default - - - $(OutDir)genstring.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX86 - - - run.bat "$(TargetPath)" - - - - - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - Level3 - ProgramDatabase - Default - - - $(OutDir)genstring.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - - - run.bat "$(TargetPath)" - - - - - Full - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreaded - - - $(IntDir) - Level3 - Default - - - $(OutDir)genstring.exe - $(OutDir)$(TargetName).pdb - Console - true - true - false - - - MachineX86 - - - run.bat "$(TargetPath)" - - - - - Full - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreaded - - - $(IntDir) - Level3 - Default - - - $(OutDir)genstring.exe - $(OutDir)$(TargetName).pdb - Console - true - true - false - - - - - run.bat "$(TargetPath)" - - - - - - - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc14/genstring/genstring.vcxproj.filters b/Mkfiles/vc14/genstring/genstring.vcxproj.filters deleted file mode 100644 index 04ed411d..00000000 --- a/Mkfiles/vc14/genstring/genstring.vcxproj.filters +++ /dev/null @@ -1,17 +0,0 @@ - - - - - {28EBE11C-5BE8-4935-9381-F57696749E0C} - cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx - - - - - Source Files - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc14/genstring/run.bat b/Mkfiles/vc14/genstring/run.bat deleted file mode 100644 index baedcecb..00000000 --- a/Mkfiles/vc14/genstring/run.bat +++ /dev/null @@ -1,2 +0,0 @@ -cd ..\..\.. -%1 license_msg license.c COPYING diff --git a/Mkfiles/vc14/genversion/genversion.vcxproj b/Mkfiles/vc14/genversion/genversion.vcxproj deleted file mode 100644 index f9a5298c..00000000 --- a/Mkfiles/vc14/genversion/genversion.vcxproj +++ /dev/null @@ -1,223 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2} - genversion - Win32Proj - - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - - - - Disabled - ..\..\vc10;..\..\..\;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - Level3 - ProgramDatabase - Default - - - $(OutDir)genversion.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX86 - - - run.bat "$(TargetPath)" - - - cd ..\..\..\ -YASM-VERSION-GEN.bat - - - - - - Disabled - ..\..\vc10;..\..\..\;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - Level3 - ProgramDatabase - Default - - - $(OutDir)genversion.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - - - run.bat "$(TargetPath)" - - - cd ..\..\..\ -YASM-VERSION-GEN.bat - - - - - - Full - ..\..\vc10;..\..\..\;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreaded - - - $(IntDir) - Level3 - Default - - - $(OutDir)genversion.exe - $(OutDir)$(TargetName).pdb - Console - true - true - false - - - MachineX86 - - - run.bat "$(TargetPath)" - - - cd ..\..\..\ -YASM-VERSION-GEN.bat - - - - - - Full - ..\..\vc10;..\..\..\;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreaded - - - $(IntDir) - Level3 - Default - - - $(OutDir)genversion.exe - $(OutDir)$(TargetName).pdb - Console - true - true - false - - - - - run.bat "$(TargetPath)" - - - cd ..\..\..\ -YASM-VERSION-GEN.bat - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc14/genversion/genversion.vcxproj.filters b/Mkfiles/vc14/genversion/genversion.vcxproj.filters deleted file mode 100644 index cc088b12..00000000 --- a/Mkfiles/vc14/genversion/genversion.vcxproj.filters +++ /dev/null @@ -1,26 +0,0 @@ - - - - - {2acbec3a-0ed8-4b2e-826e-a84c7d35f205} - h;hpp;hxx;hm;inl - - - {E67ED277-E4F2-4D79-8C9E-962BAC164F3F} - cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx - - - - - Source Files - - - - - Header Files - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc14/genversion/run.bat b/Mkfiles/vc14/genversion/run.bat deleted file mode 100644 index 41b19cad..00000000 --- a/Mkfiles/vc14/genversion/run.bat +++ /dev/null @@ -1,2 +0,0 @@ -cd ..\..\.. -%1 version.mac diff --git a/Mkfiles/vc14/genversion/runpre.bat b/Mkfiles/vc14/genversion/runpre.bat deleted file mode 100644 index fdd15708..00000000 --- a/Mkfiles/vc14/genversion/runpre.bat +++ /dev/null @@ -1,2 +0,0 @@ -cd ..\..\.. -YASM-VERSION-GEN.bat diff --git a/Mkfiles/vc14/libyasm-stdint.h b/Mkfiles/vc14/libyasm-stdint.h deleted file mode 100644 index b66ab15f..00000000 --- a/Mkfiles/vc14/libyasm-stdint.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef _UINTPTR_T_DEFINED -#ifdef _WIN64 -#include -#else -typedef unsigned long uintptr_t; -#endif -#define _UINTPTR_T_DEFINED -#endif diff --git a/Mkfiles/vc14/libyasm/libyasm.vcxproj b/Mkfiles/vc14/libyasm/libyasm.vcxproj deleted file mode 100644 index 362aa2a3..00000000 --- a/Mkfiles/vc14/libyasm/libyasm.vcxproj +++ /dev/null @@ -1,277 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {29FE7874-1256-4AD6-B889-68E399DC9608} - libyasm - - - - StaticLibrary - false - MultiByte - v140 - - - StaticLibrary - false - MultiByte - v140 - - - StaticLibrary - false - MultiByte - v140 - - - StaticLibrary - false - MultiByte - v140 - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - - - - Full - Default - ..;../../..;%(AdditionalIncludeDirectories) - NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)libyasm.lib - true - - - - - X64 - - - Full - Default - ..;../../..;%(AdditionalIncludeDirectories) - NDEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)libyasm.lib - true - - - - - Disabled - ..;../../..;%(AdditionalIncludeDirectories) - _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)libyasm.lib - true - - - - - X64 - - - Disabled - ..;../../..;%(AdditionalIncludeDirectories) - _DEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)libyasm.lib - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {f0e8b707-00c5-4ff2-b8ef-7c39817132a0} - false - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc14/libyasm/libyasm.vcxproj.filters b/Mkfiles/vc14/libyasm/libyasm.vcxproj.filters deleted file mode 100644 index 9bdf13a4..00000000 --- a/Mkfiles/vc14/libyasm/libyasm.vcxproj.filters +++ /dev/null @@ -1,200 +0,0 @@ - - - - - {4ca3b698-9d01-4e4e-ae00-5c98da045efe} - h;hpp;hxx;hm;inl - - - {68607062-982d-4251-9a1a-30f76474983d} - cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Source Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc14/modules/modules.vcxproj b/Mkfiles/vc14/modules/modules.vcxproj deleted file mode 100644 index ceb14114..00000000 --- a/Mkfiles/vc14/modules/modules.vcxproj +++ /dev/null @@ -1,324 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6} - modules - - - - StaticLibrary - false - MultiByte - v140 - - - StaticLibrary - false - MultiByte - v140 - - - StaticLibrary - false - MultiByte - v140 - - - StaticLibrary - false - MultiByte - v140 - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - - - - Full - Default - ..;../../..;%(AdditionalIncludeDirectories) - NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)modules.lib - true - - - - - - - - - X64 - - - Full - Default - ..;../../..;%(AdditionalIncludeDirectories) - NDEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)modules.lib - true - - - - - Disabled - ..;../../..;%(AdditionalIncludeDirectories) - _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)modules.lib - true - - - - - X64 - - - Disabled - ..;../../..;%(AdditionalIncludeDirectories) - _DEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)modules.lib - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {225700a5-07b8-434e-ad61-555278bf6733} - false - - - {c45a8b59-8b59-4d5d-a8e8-fb090f8dd619} - false - - - {29fe7874-1256-4ad6-b889-68e399dc9608} - false - - - {3c58be13-50a3-4583-984d-d8902b3d7713} - false - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc14/modules/modules.vcxproj.filters b/Mkfiles/vc14/modules/modules.vcxproj.filters deleted file mode 100644 index e6ff3add..00000000 --- a/Mkfiles/vc14/modules/modules.vcxproj.filters +++ /dev/null @@ -1,256 +0,0 @@ - - - - - {39c89f91-d860-4396-a49f-86b8b7a51c33} - cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - - - {be0cdf28-cbed-4774-b3cc-b63e4e3fa0a9} - - - {491cc60a-889b-4f53-aae9-f4d7d6aa667a} - - - {c084015d-3c3e-4379-8746-ae5cffcec79e} - - - {3333e0b3-e95f-44f6-9000-58d4da368360} - - - {528f2955-ceba-4691-a36c-054f119e3dcc} - - - {81686d52-eb71-4d4a-a830-66c45afb808f} - - - {98fe1e43-3794-4639-bf29-14b0c569754f} - - - {6b3956d4-0bff-4e8e-af61-a7e59b476fa4} - - - {446fad62-ac17-49e9-8263-33481f04f182} - - - {33fb7fc8-61f9-428d-9c94-7a4912fbb678} - - - {48fc77ec-7d78-4c0a-bfc2-9aa76faf5d7f} - - - - - Source Files\parsers - - - Source Files\arch - - - Source Files\arch - - - Source Files\arch - - - Source Files\arch - - - Source Files\arch - - - Source Files\arch - - - Source Files\arch - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\listfmts\nasm - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\parsers - - - Source Files\parsers - - - Source Files\parsers - - - Source Files\parsers - - - Source Files\parsers - - - Source Files\preprocs\cpp - - - Source Files\preprocs\gas - - - Source Files\preprocs\gas - - - Source Files\preprocs\nasm - - - Source Files\preprocs\nasm - - - Source Files\preprocs\nasm - - - Source Files\preprocs\nasm - - - Source Files\preprocs\raw - - - Source Files\parsers - - - Source Files\arch - - - Source Files\arch - - - Source Files\objfmts - - - - - Source Files\arch - - - Source Files\arch - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\parsers - - - Source Files\parsers - - - Source Files\preprocs\gas - - - Source Files\preprocs\nasm - - - Source Files\preprocs\nasm - - - Source Files\preprocs\nasm - - - Source Files\preprocs\nasm - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc14/out_copy_rename.bat b/Mkfiles/vc14/out_copy_rename.bat deleted file mode 100644 index 3179b59a..00000000 --- a/Mkfiles/vc14/out_copy_rename.bat +++ /dev/null @@ -1,42 +0,0 @@ -@echo off -if not exist %1 goto nofile -if exist %2 goto copy - -echo creating directory %2 -md %2 > nul - -:copy -set str=%2 -for /f "useback tokens=*" %%a in ('%str%') do set str=%%~a -set str=%str:~-1% -if %str% == "\" goto hasbackslash - -if not exist %2\%3 goto cpy -fc %1 %2\%3 > nul && if not %errorlevel 1 goto exit -echo overwriting %2\%3 with %1 -copy %1 %2\%3 > nul -goto exit - -:cpy -echo copying %1 to %2\%3 -copy %1 %2\%3 > nul -goto exit - -:hasbackslash -if not exist %2%3 goto cpy2 -fc %1 %2%3 > nul && if not %errorlevel 1 goto exit -echo overwriting %2%3 with %1 -copy %1 %2%3 > nul -goto exit - -:cpy2 -echo copying %1 to %2%3 -copy %1 %2%3 > nul -goto exit - -:nofile -echo %1 not found - -:exit - - diff --git a/Mkfiles/vc14/re2c/re2c.vcxproj b/Mkfiles/vc14/re2c/re2c.vcxproj deleted file mode 100644 index 135b43ba..00000000 --- a/Mkfiles/vc14/re2c/re2c.vcxproj +++ /dev/null @@ -1,221 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {3C58BE13-50A3-4583-984D-D8902B3D7713} - re2c - Win32Proj - - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - - - - Disabled - ..;../../..;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - Level3 - Default - ProgramDatabase - - - $(OutDir)re2c.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX86 - - - run.bat "$(TargetPath)" - - - - - Disabled - ..;../../..;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - Level3 - Default - ProgramDatabase - - - $(OutDir)re2c.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - - - run.bat "$(TargetPath)" - - - - - Full - ..;../../..;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreaded - - - $(IntDir) - Level3 - Default - - - $(OutDir)re2c.exe - $(OutDir)$(TargetName).pdb - Console - true - true - false - - - MachineX86 - - - run.bat "$(TargetPath)" - - - - - Full - ..;../../..;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreaded - - - $(IntDir) - Level3 - Default - - - $(OutDir)re2c.exe - $(OutDir)$(TargetName).pdb - Console - true - true - false - - - - - run.bat "$(TargetPath)" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc14/re2c/re2c.vcxproj.filters b/Mkfiles/vc14/re2c/re2c.vcxproj.filters deleted file mode 100644 index da0f935c..00000000 --- a/Mkfiles/vc14/re2c/re2c.vcxproj.filters +++ /dev/null @@ -1,80 +0,0 @@ - - - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc14/re2c/run.bat b/Mkfiles/vc14/re2c/run.bat deleted file mode 100644 index 6ac571f0..00000000 --- a/Mkfiles/vc14/re2c/run.bat +++ /dev/null @@ -1,4 +0,0 @@ -cd ..\..\..\ -%1 -s -o lc3bid.c modules\arch\lc3b\lc3bid.re -%1 -b -o nasm-token.c modules\parsers\nasm\nasm-token.re -%1 -b -o gas-token.c modules\parsers\gas\gas-token.re diff --git a/Mkfiles/vc14/readme.vc14.txt b/Mkfiles/vc14/readme.vc14.txt deleted file mode 100644 index ea716567..00000000 --- a/Mkfiles/vc14/readme.vc14.txt +++ /dev/null @@ -1,106 +0,0 @@ -Building YASM with Microsoft Visual Studio 2015 (C/C++ v14) ------------------------------------------------------------ - -This note describes how to build YASM using Microsoft Visual -Studio 2015 (C/C++ v14). - -1. YASM Download ----------------- - -First YASM needs to be downloaded and the files placed within -a suitable directory, which will be called here but can -be named and located as you wish. - -2. Building YASM with Microsoft 2015 (VC14) -------------------------------------------- - -Now locate and double click on the yasm.sln solution file in -the 'Mkfiles/vc14' subdirectory to open the build project in -the Visual Studio 2015 IDE and then select: - - win32 or x64 build - release or debug build - -as appropriate to build the YASM binaries that you need. - -4. Using YASM with Visual Sudio 2015 and VC++ version 14 --------------------------------------------------------- - -The YASM version vsyasm.exe is designed specifically for use -with the 2010 and later versions of Visual Studio. To tell -Visual Studio where to find vsyasm.exe, the environment -variable YASMPATH can be set to the absolute path of the -directory in which vsyasm.exe is located (this path should -include the final backslash). - -Alternatively you can find the directory (or directories) -where the VC++ compiler binaries are located and put copies -of the vsyasm.exe binary in these directories. The typical -location on 64-bit Windows is: - -C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin - -On 32-bit Windows it is normally at: - -C:\Program Files\Microsoft Visual Studio 14.0\VC\bin - -Depending on your system you can use either the win32 or the -x64 version of vsyasm.exe, which must be named vsyasm.exe. - -To use the custom tools facility in Visual Studio 2015, you -need to place a copy of three files - yasm.props, yasm.targets -and yasm.xml - into a location where they can be found by the -Visual Studio build customisation processes. There are several -ways to do this: - - a. put these files in the MSBUILD customisation directory, - which is typically at: - - C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\BuildCustomizations - - b. put them in a convenient location and set this path in the - 'Build Customisations Search Path' in the Visual Studio - 'Projects and Solutions|VC++ Project Settings' item in - the 'Tools|Options' menu; - - c. put them in a convenient location and set this path in the - 'Build Customisation dialogue (discussed later). - -To use YASM in a project, right click on the project in the Solution -Explorer and select 'Build Customisations..'. This will give you a -dialog box that allows you to select YASM as an assembler (note that -your assembler files need to have the extension '.asm'). If you have -used option c. above, you will need to let the dialogue find them -using the 'Find Existing' button below the dialogue. - -To assemble a file with YASM, select the Property Page for the file -and the select 'Yasm Assembler' in the Tool dialog entry. Then click -'Apply' and an additional property page entry will appear and enable -YASM settings to be established. - -5. A Linker Issue ------------------ - -There appears to be a linker bug in the VC++ linker that prevents -symbols with absolute addresses being linked in DLL builds. This -means, for example, that LEA instructions of the general form: - - lea, rax,[rax+symbol] - -cannot be used for DLL builds. The following general form -has to be used instead: - - lea rcx,[symbol wrt rip] - lea rax,[rax+rcx] - -This limitation may also cause problems with other instruction -that use absolute addresses. - -6. Acknowledgements -------------------- - -I am most grateful for the fantastic support that Peter Johnson, -YASM's creator, has given me in tracking down issues in using -YASM for the production of Windows x64 code. - - Brian Gladman, 30th April 2015 diff --git a/Mkfiles/vc14/vsyasm.props b/Mkfiles/vc14/vsyasm.props deleted file mode 100644 index 80b93c7e..00000000 --- a/Mkfiles/vc14/vsyasm.props +++ /dev/null @@ -1,27 +0,0 @@ - - - - Midl - CustomBuild - - - _SelectedFiles;$(YASMDependsOn) - - - $(VCInstallDir)bin\ - - - - False - $(IntDir) - 0 - 0 - "$(YasmPath)"vsyasm.exe -Xvc -f $(Platform) [AllOptions] [AdditionalOptions] [Inputs] - %(ObjectFile) - Assembling %(Filename)%(Extension) - false - - - \ No newline at end of file diff --git a/Mkfiles/vc14/vsyasm.targets b/Mkfiles/vc14/vsyasm.targets deleted file mode 100644 index 3c084119..00000000 --- a/Mkfiles/vc14/vsyasm.targets +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - _YASM - - - - $(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml - - - - - - - - @(YASM, '|') - - - - - - - - - $(ComputeLinkInputsTargets); - ComputeYASMOutput; - - - $(ComputeLibInputsTargets); - ComputeYASMOutput; - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc14/vsyasm.vcxproj b/Mkfiles/vc14/vsyasm.vcxproj deleted file mode 100644 index 98283b10..00000000 --- a/Mkfiles/vc14/vsyasm.vcxproj +++ /dev/null @@ -1,279 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {7FDD85BB-CC86-442B-A425-989B5B296ED5} - vsyasm - - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - - - - $(Platform)\$(Configuration)/yasm.tlb - - - - - Disabled - .;../..;%(AdditionalIncludeDirectories) - _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)vsyasm.exe - true - true - $(OutDir)$(ProjectName).pdb - Console - false - - - MachineX86 - - - - - X64 - $(Platform)\$(Configuration)/yasm.tlb - - - - - Disabled - .;../..;%(AdditionalIncludeDirectories) - _DEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)vsyasm.exe - true - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX64 - - - - - $(Platform)\$(Configuration)/yasm.tlb - - - - - Full - Default - true - .;../..;%(AdditionalIncludeDirectories) - NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)vsyasm.exe - true - true - $(OutDir)$(ProjectName).pdb - Console - false - - - MachineX86 - - - - - X64 - $(Platform)\$(Configuration)/yasm.tlb - - - - - Full - OnlyExplicitInline - .;../..;%(AdditionalIncludeDirectories) - NDEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)vsyasm.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX64 - true - - - - - - - - - {29fe7874-1256-4ad6-b889-68e399dc9608} - false - - - {d715a3d4-efaa-442e-ad8b-5b4ff64e1dd6} - false - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc14/vsyasm.xml b/Mkfiles/vc14/vsyasm.xml deleted file mode 100644 index a108f005..00000000 --- a/Mkfiles/vc14/vsyasm.xml +++ /dev/null @@ -1,283 +0,0 @@ - - - - - - - - - - - - - General - - - - - - Symbols - - - - - - Files - - - - - - Command Line - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Execute Before - - - Specifies the targets for the build customization to run before. - - - - - - - - - - - - Execute After - - - Specifies the targets for the build customization to run after. - - - - - - - - - - - - - - - - - - Additional Options - - - Additional Options - - - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc14/yasm.sln b/Mkfiles/vc14/yasm.sln deleted file mode 100644 index 5d2dc952..00000000 --- a/Mkfiles/vc14/yasm.sln +++ /dev/null @@ -1,142 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.22823.1 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{825AC694-358C-4D8D-92DE-33A2691978CE}" - ProjectSection(SolutionItems) = preProject - crt_secure_no_deprecate.vsprops = crt_secure_no_deprecate.vsprops - readme.vc14.txt = readme.vc14.txt - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libyasm", "libyasm\libyasm.vcxproj", "{29FE7874-1256-4AD6-B889-68E399DC9608}" - ProjectSection(ProjectDependencies) = postProject - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2} = {B545983B-8EE0-4A7B-A67A-E749EEAE62A2} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "modules", "modules\modules.vcxproj", "{D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yasm", "yasm.vcxproj", "{34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genmacro", "genmacro\genmacro.vcxproj", "{225700A5-07B8-434E-AD61-555278BF6733}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genversion", "genversion\genversion.vcxproj", "{B545983B-8EE0-4A7B-A67A-E749EEAE62A2}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "re2c", "re2c\re2c.vcxproj", "{3C58BE13-50A3-4583-984D-D8902B3D7713}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genperf", "genperf\genperf.vcxproj", "{C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genmodule", "genmodule\genmodule.vcxproj", "{F0E8B707-00C5-4FF2-B8EF-7C39817132A0}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genstring", "genstring\genstring.vcxproj", "{021CEB0A-F721-4F59-B349-9CEEAF244459}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ytasm", "ytasm.vcxproj", "{2162937B-0DBD-4450-B45F-DF578D8E7508}" - ProjectSection(ProjectDependencies) = postProject - {021CEB0A-F721-4F59-B349-9CEEAF244459} = {021CEB0A-F721-4F59-B349-9CEEAF244459} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vsyasm", "vsyasm.vcxproj", "{7FDD85BB-CC86-442B-A425-989B5B296ED5}" - ProjectSection(ProjectDependencies) = postProject - {021CEB0A-F721-4F59-B349-9CEEAF244459} = {021CEB0A-F721-4F59-B349-9CEEAF244459} - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|Win32.ActiveCfg = Debug|Win32 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|Win32.Build.0 = Debug|Win32 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|x64.ActiveCfg = Debug|x64 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|x64.Build.0 = Debug|x64 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|Win32.ActiveCfg = Release|Win32 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|Win32.Build.0 = Release|Win32 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|x64.ActiveCfg = Release|x64 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|x64.Build.0 = Release|x64 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|Win32.ActiveCfg = Debug|Win32 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|Win32.Build.0 = Debug|Win32 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|x64.ActiveCfg = Debug|x64 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|x64.Build.0 = Debug|x64 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|Win32.ActiveCfg = Release|Win32 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|Win32.Build.0 = Release|Win32 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|x64.ActiveCfg = Release|x64 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|x64.Build.0 = Release|x64 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|Win32.ActiveCfg = Debug|Win32 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|Win32.Build.0 = Debug|Win32 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|x64.ActiveCfg = Debug|x64 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|x64.Build.0 = Debug|x64 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|Win32.ActiveCfg = Release|Win32 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|Win32.Build.0 = Release|Win32 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|x64.ActiveCfg = Release|x64 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|x64.Build.0 = Release|x64 - {225700A5-07B8-434E-AD61-555278BF6733}.Debug|Win32.ActiveCfg = Debug|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Debug|Win32.Build.0 = Debug|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Debug|x64.ActiveCfg = Debug|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Debug|x64.Build.0 = Debug|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Release|Win32.ActiveCfg = Release|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Release|Win32.Build.0 = Release|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Release|x64.ActiveCfg = Release|x64 - {225700A5-07B8-434E-AD61-555278BF6733}.Release|x64.Build.0 = Release|x64 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|Win32.ActiveCfg = Debug|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|Win32.Build.0 = Debug|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|x64.ActiveCfg = Debug|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|x64.Build.0 = Debug|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|Win32.ActiveCfg = Release|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|Win32.Build.0 = Release|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|x64.ActiveCfg = Release|x64 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|x64.Build.0 = Release|x64 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|Win32.ActiveCfg = Debug|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|Win32.Build.0 = Debug|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|x64.ActiveCfg = Debug|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|x64.Build.0 = Debug|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|Win32.ActiveCfg = Release|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|Win32.Build.0 = Release|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|x64.ActiveCfg = Release|x64 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|x64.Build.0 = Release|x64 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|Win32.ActiveCfg = Debug|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|Win32.Build.0 = Debug|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|x64.ActiveCfg = Debug|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|x64.Build.0 = Debug|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|Win32.ActiveCfg = Release|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|Win32.Build.0 = Release|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|x64.ActiveCfg = Release|x64 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|x64.Build.0 = Release|x64 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|Win32.ActiveCfg = Debug|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|Win32.Build.0 = Debug|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|x64.ActiveCfg = Debug|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|x64.Build.0 = Debug|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|Win32.ActiveCfg = Release|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|Win32.Build.0 = Release|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|x64.ActiveCfg = Release|x64 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|x64.Build.0 = Release|x64 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|Win32.ActiveCfg = Debug|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|Win32.Build.0 = Debug|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|x64.ActiveCfg = Debug|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|x64.Build.0 = Debug|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|Win32.ActiveCfg = Release|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|Win32.Build.0 = Release|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|x64.ActiveCfg = Release|x64 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|x64.Build.0 = Release|x64 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|Win32.ActiveCfg = Debug|Win32 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|Win32.Build.0 = Debug|Win32 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|x64.ActiveCfg = Debug|x64 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|x64.Build.0 = Debug|x64 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|Win32.ActiveCfg = Release|Win32 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|Win32.Build.0 = Release|Win32 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|x64.ActiveCfg = Release|x64 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|x64.Build.0 = Release|x64 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|Win32.ActiveCfg = Debug|Win32 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|Win32.Build.0 = Debug|Win32 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|x64.ActiveCfg = Debug|x64 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|x64.Build.0 = Debug|x64 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|Win32.ActiveCfg = Release|Win32 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|Win32.Build.0 = Release|Win32 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|x64.ActiveCfg = Release|x64 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/Mkfiles/vc14/yasm.vcxproj b/Mkfiles/vc14/yasm.vcxproj deleted file mode 100644 index 867888bc..00000000 --- a/Mkfiles/vc14/yasm.vcxproj +++ /dev/null @@ -1,283 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5} - yasm - - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - - - - $(Platform)\$(Configuration)/yasm.tlb - - - - - Disabled - .;../..;%(AdditionalIncludeDirectories) - _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)yasm.exe - true - true - $(OutDir)$(ProjectName).pdb - Console - false - - - MachineX86 - - - - - X64 - $(Platform)\$(Configuration)/yasm.tlb - - - - - Disabled - .;../..;%(AdditionalIncludeDirectories) - _DEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)yasm.exe - true - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX64 - - - - - $(Platform)\$(Configuration)/yasm.tlb - - - - - Full - Default - true - .;../..;%(AdditionalIncludeDirectories) - NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)yasm.exe - true - true - $(OutDir)$(ProjectName).pdb - Console - false - - - MachineX86 - - - - - X64 - $(Platform)\$(Configuration)/yasm.tlb - - - - - Full - OnlyExplicitInline - .;../..;%(AdditionalIncludeDirectories) - NDEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)yasm.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX64 - true - - - - - - - - - - - - - - - - - {021ceb0a-f721-4f59-b349-9ceeaf244459} - false - - - {29fe7874-1256-4ad6-b889-68e399dc9608} - false - - - {d715a3d4-efaa-442e-ad8b-5b4ff64e1dd6} - false - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc14/yasm.vcxproj.filters b/Mkfiles/vc14/yasm.vcxproj.filters deleted file mode 100644 index 04941c22..00000000 --- a/Mkfiles/vc14/yasm.vcxproj.filters +++ /dev/null @@ -1,41 +0,0 @@ - - - - - {51f0d88e-1373-4bf8-a72e-c79706d37f8b} - h;hpp;hxx;hm;inl - - - {db67b411-6f59-462c-9c20-75024c6b3912} - cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - - - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - \ No newline at end of file diff --git a/Mkfiles/vc14/ytasm.vcxproj b/Mkfiles/vc14/ytasm.vcxproj deleted file mode 100644 index aabe801e..00000000 --- a/Mkfiles/vc14/ytasm.vcxproj +++ /dev/null @@ -1,278 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {2162937B-0DBD-4450-B45F-DF578D8E7508} - ytasm - - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - - - - $(Platform)\$(Configuration)/yasm.tlb - - - - - Disabled - .;../..;%(AdditionalIncludeDirectories) - _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)ytasm.exe - true - true - $(OutDir)$(ProjectName).pdb - Console - false - - - MachineX86 - - - - - X64 - $(Platform)\$(Configuration)/yasm.tlb - - - - - Disabled - .;../..;%(AdditionalIncludeDirectories) - _DEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)ytasm.exe - true - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX64 - - - - - $(Platform)\$(Configuration)/yasm.tlb - - - - - Full - Default - true - .;../..;%(AdditionalIncludeDirectories) - NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)ytasm.exe - true - true - $(OutDir)$(ProjectName).pdb - Console - false - - - MachineX86 - - - - - X64 - $(Platform)\$(Configuration)/yasm.tlb - - - - - Full - OnlyExplicitInline - .;../..;%(AdditionalIncludeDirectories) - NDEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)ytasm.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX64 - true - - - - - - - - - - - - - - - - {29fe7874-1256-4ad6-b889-68e399dc9608} - false - - - {d715a3d4-efaa-442e-ad8b-5b4ff64e1dd6} - false - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc15/config.h b/Mkfiles/vc15/config.h deleted file mode 100644 index 8515ac5a..00000000 --- a/Mkfiles/vc15/config.h +++ /dev/null @@ -1,170 +0,0 @@ -#include "YASM-VERSION.h" -#define yasm__splitpath(path, tail) yasm__splitpath_win(path, tail) -#define yasm__abspath(path) yasm__abspath_win(path) -#define yasm__combpath(from, to) yasm__combpath_win(from, to) - -/* Command name to run C preprocessor */ -#define CPP_PROG "cpp" - -/* */ -/* #undef ENABLE_NLS */ - -/* Define if you have the `abort' function. */ -#define HAVE_ABORT 1 - -/* */ -/* #undef HAVE_CATGETS */ - -/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the - CoreFoundation framework. */ -/* #undef HAVE_CFLOCALECOPYCURRENT */ - -/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in - the CoreFoundation framework. */ -/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ - -/* Define if the GNU dcgettext() function is already present or preinstalled. - */ -/* #undef HAVE_DCGETTEXT */ - -/* Define to 1 if you have the header file. */ -#define HAVE_DIRECT_H 1 - -/* Define to 1 if you have the `getcwd' function. */ -#define HAVE_GETCWD 1 - -/* */ -/* #undef HAVE_GETTEXT */ - -/* Define if you have the GNU C Library */ -/* #undef HAVE_GNU_C_LIBRARY */ - -/* Define if you have the iconv() function. */ -/* #undef HAVE_ICONV */ - -/* Define if you have the header file. */ -/* #undef HAVE_INTTYPES_H */ - -/* */ -/* #undef HAVE_LC_MESSAGES */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_LIBGEN_H */ - -/* Define if you have the header file. */ -/* #undef HAVE_MEMORY_H */ - -/* Define if you have the `mergesort' function. */ -/* #undef HAVE_MERGESORT */ - -/* Define to 1 if you have the `popen' function. */ -/* #undef HAVE_POPEN */ - -/* Define if you have the header file. */ -/* #undef HAVE_STDINT_H */ - -/* Define if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* */ -/* #undef HAVE_STPCPY */ - -/* Define if you have the `strcasecmp' function. */ -/* #undef HAVE_STRCASECMP */ - -/* Define if you have the `strcmpi' function. */ -/* #undef HAVE_STRCMPI */ - -/* Define if you have the `stricmp' function. */ -/* #undefine HAVE_STRICMP */ - -/* Define if you have the header file. */ -/* #undef HAVE_STRINGS_H */ - -/* Define if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define if you have the `strncasecmp' function. */ -/* #undef HAVE_STRNCASECMP */ - -/* Define if you have the `strsep' function. */ -/* #undef HAVE_STRSEP */ - -/* Define if you have the header file. */ -/* #undef HAVE_SYS_STAT_H */ - -/* Define if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define if you have the `toascii' function. */ -#define HAVE_TOASCII 1 -#define toascii __toascii - -/* Define if you have the header file. */ -/* #undef HAVE_UNISTD_H */ - -/* Define to 1 if you have the `vsnprintf' function. */ -/* #undef HAVE_VSNPRINTF */ - -/* Define to 1 if you have the `_stricmp' function. */ -#define HAVE__STRICMP 1 - -/* Name of package */ -#define PACKAGE "yasm" - -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "bug-yasm@tortall.net" - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "yasm" - -/* Define to the full name and version of this package. */ -/*#define PACKAGE_STRING "yasm HEAD"*/ - -/* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "yasm" - -/* Define to the version of this package. */ -/*#define PACKAGE_VERSION "HEAD"*/ - -/* Define if the C compiler supports function prototypes. */ -#define PROTOTYPES 1 - -/* The size of a `char', as computed by sizeof. */ -/* #undef SIZEOF_CHAR */ - -/* The size of a `int', as computed by sizeof. */ -/* #undef SIZEOF_INT */ - -/* The size of a `long', as computed by sizeof. */ -/* #undef SIZEOF_LONG */ - -/* The size of a `short', as computed by sizeof. */ -/* #undef SIZEOF_SHORT */ - -/* The size of a `void*', as computed by sizeof. */ -/* #undef SIZEOF_VOIDP */ - -/* Define if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Version number of package */ -#define VERSION "HEAD" - -/* Define if using the dmalloc debugging malloc package */ -/* #undef WITH_DMALLOC */ - -/* Define like PROTOTYPES; this can be used by system headers. */ -#define __PROTOTYPES 1 - -/* Define to empty if `const' does not conform to ANSI C. */ -/* #undef const */ - -/* Define as `__inline' if that's what the C compiler calls it, or to nothing - if it is not supported. */ -#ifndef __cplusplus -/* #undef inline */ -#endif - -/* Define to `unsigned' if doesn't define. */ -/* #undef size_t */ diff --git a/Mkfiles/vc15/crt_secure_no_deprecate.props b/Mkfiles/vc15/crt_secure_no_deprecate.props deleted file mode 100644 index 777d6d0a..00000000 --- a/Mkfiles/vc15/crt_secure_no_deprecate.props +++ /dev/null @@ -1,11 +0,0 @@ - - - - <_ProjectFileVersion>10.0.21006.1 - - - - _CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - - - \ No newline at end of file diff --git a/Mkfiles/vc15/crt_secure_no_deprecate.vsprops b/Mkfiles/vc15/crt_secure_no_deprecate.vsprops deleted file mode 100644 index 56ab506f..00000000 --- a/Mkfiles/vc15/crt_secure_no_deprecate.vsprops +++ /dev/null @@ -1,11 +0,0 @@ - - - - diff --git a/Mkfiles/vc15/genmacro/genmacro.vcxproj b/Mkfiles/vc15/genmacro/genmacro.vcxproj deleted file mode 100644 index 794399a3..00000000 --- a/Mkfiles/vc15/genmacro/genmacro.vcxproj +++ /dev/null @@ -1,202 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {225700A5-07B8-434E-AD61-555278BF6733} - genmacro - Win32Proj - - - - Application - MultiByte - v141 - - - Application - MultiByte - v141 - - - Application - MultiByte - v141 - - - Application - MultiByte - v141 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - - - - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - Level3 - ProgramDatabase - Default - - - $(OutDir)genmacro.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX86 - - - run.bat "$(TargetPath)" - - - - - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - Level3 - ProgramDatabase - Default - - - $(OutDir)genmacro.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - - - run.bat "$(TargetPath)" - - - - - Full - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreaded - - - $(IntDir) - Level3 - Default - - - $(OutDir)genmacro.exe - $(OutDir)$(TargetName).pdb - Console - true - true - false - - - MachineX86 - - - run.bat "$(TargetPath)" - - - - - Full - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreaded - - - $(IntDir) - Level3 - Default - - - $(OutDir)genmacro.exe - $(OutDir)$(TargetName).pdb - Console - true - true - false - - - - - run.bat "$(TargetPath)" - - - - - - - - - - - {b545983b-8ee0-4a7b-a67a-e749eeae62a2} - false - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc15/genmacro/genmacro.vcxproj.filters b/Mkfiles/vc15/genmacro/genmacro.vcxproj.filters deleted file mode 100644 index 402cf1b4..00000000 --- a/Mkfiles/vc15/genmacro/genmacro.vcxproj.filters +++ /dev/null @@ -1,17 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx - - - - - Source Files - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc15/genmacro/run.bat b/Mkfiles/vc15/genmacro/run.bat deleted file mode 100644 index 98c337ac..00000000 --- a/Mkfiles/vc15/genmacro/run.bat +++ /dev/null @@ -1,5 +0,0 @@ -cd ..\..\.. -%1 nasm-version.c nasm_version_mac version.mac -%1 nasm-macros.c nasm_standard_mac modules\parsers\nasm\nasm-std.mac -%1 win64-nasm.c win64_nasm_stdmac modules\objfmts\coff\win64-nasm.mac -%1 win64-gas.c win64_gas_stdmac modules\objfmts\coff\win64-gas.mac diff --git a/Mkfiles/vc15/genmodule/genmodule.vcxproj b/Mkfiles/vc15/genmodule/genmodule.vcxproj deleted file mode 100644 index 602115e2..00000000 --- a/Mkfiles/vc15/genmodule/genmodule.vcxproj +++ /dev/null @@ -1,207 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0} - genmodule - Win32Proj - - - - Application - MultiByte - v141 - - - Application - MultiByte - v141 - - - Application - MultiByte - v141 - - - Application - MultiByte - v141 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - - - - Disabled - %(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;FILTERMODE;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - $(IntDir) - Level3 - ProgramDatabase - Default - - - $(OutDir)genmodule.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX86 - - - run.bat "$(TargetPath)" - - - - - Disabled - %(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;FILTERMODE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - $(IntDir) - Level3 - ProgramDatabase - Default - - - $(OutDir)genmodule.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - - - run.bat "$(TargetPath)" - - - - - Full - %(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;FILTERMODE;%(PreprocessorDefinitions) - MultiThreaded - - - $(IntDir) - $(IntDir) - Level3 - Default - - - $(OutDir)genmodule.exe - $(OutDir)$(TargetName).pdb - Console - true - true - false - - - MachineX86 - - - run.bat "$(TargetPath)" - - - - - Full - %(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;FILTERMODE;%(PreprocessorDefinitions) - MultiThreaded - - - $(IntDir) - $(IntDir) - Level3 - Default - - - $(OutDir)genmodule.exe - $(OutDir)$(TargetName).pdb - Console - true - true - false - - - - - run.bat "$(TargetPath)" - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc15/genmodule/genmodule.vcxproj.filters b/Mkfiles/vc15/genmodule/genmodule.vcxproj.filters deleted file mode 100644 index d3255c29..00000000 --- a/Mkfiles/vc15/genmodule/genmodule.vcxproj.filters +++ /dev/null @@ -1,20 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx - - - - - Source Files - - - - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc15/genmodule/run.bat b/Mkfiles/vc15/genmodule/run.bat deleted file mode 100644 index 00055692..00000000 --- a/Mkfiles/vc15/genmodule/run.bat +++ /dev/null @@ -1,3 +0,0 @@ -@echo off -cd ..\..\.. -%1 libyasm\module.in Makefile.am diff --git a/Mkfiles/vc15/genperf/genperf.vcxproj b/Mkfiles/vc15/genperf/genperf.vcxproj deleted file mode 100644 index ad4e8aff..00000000 --- a/Mkfiles/vc15/genperf/genperf.vcxproj +++ /dev/null @@ -1,261 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619} - genperf - Win32Proj - - - - Application - MultiByte - v141 - - - Application - MultiByte - v141 - - - Application - MultiByte - v141 - - - Application - MultiByte - v141 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - false - false - false - false - - - - - - - - Disabled - ..;../../..;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;STDC_HEADERS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - Level3 - ProgramDatabase - Default - - - $(OutDir)genperf.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX86 - - - - - - - run.bat "$(TargetPath)" - - - x86insn_nasm.c;x86insn_gas.c;x86cpu.c;x86regtmod.c;%(Outputs) - - - run.bat "$(TargetPath)" - - - - - Disabled - ..;../../..;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;STDC_HEADERS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - Level3 - ProgramDatabase - Default - - - $(OutDir)genperf.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - - - - - - - run.bat "$(TargetPath)" - - - x86insn_nasm.c;x86insn_gas.c;x86cpu.c;x86regtmod.c;%(Outputs) - - - run.bat "$(TargetPath)" - - - - - Full - ..;../../..;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;STDC_HEADERS;%(PreprocessorDefinitions) - MultiThreaded - - - $(IntDir) - Level3 - Default - - - $(OutDir)genperf.exe - $(OutDir)$(TargetName).pdb - Console - true - true - false - - - MachineX86 - - - - - - - run.bat "$(TargetPath)" - - - x86insn_nasm.c;x86insn_gas.c;x86cpu.c;x86regtmod.c;%(Outputs) - - - run.bat "$(TargetPath)" - - - - - Full - ..;../../..;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;STDC_HEADERS;%(PreprocessorDefinitions) - MultiThreaded - - - $(IntDir) - Level3 - Default - - - $(OutDir)genperf.exe - $(OutDir)$(TargetName).pdb - Console - true - true - false - - - - - - - - - run.bat "$(TargetPath)" - - - x86insn_nasm.c;x86insn_gas.c;x86cpu.c;x86regtmod.c;%(Outputs) - - - run.bat "$(TargetPath)" - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc15/genperf/genperf.vcxproj.filters b/Mkfiles/vc15/genperf/genperf.vcxproj.filters deleted file mode 100644 index 3124b5d7..00000000 --- a/Mkfiles/vc15/genperf/genperf.vcxproj.filters +++ /dev/null @@ -1,56 +0,0 @@ - - - - - {3C1E9AA8-6338-4CED-99F1-BEBA80607BD5} - h;hpp;hxx;hm;inl;inc;xsd - - - {1062695D-1C50-4068-8313-73A409885BC1} - cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc15/genperf/run.bat b/Mkfiles/vc15/genperf/run.bat deleted file mode 100644 index c6f83543..00000000 --- a/Mkfiles/vc15/genperf/run.bat +++ /dev/null @@ -1,40 +0,0 @@ -cd ..\..\.. -@echo off - -for /f "usebackq tokens=1*" %%f in (`reg query HKCR\Applications\python.exe\shell\open\command 2^>NUL`) do (set _my_=%%f %%g) -goto try1%errorlevel% - -:try10 -goto ok - -:try11 -for /f "usebackq tokens=1*" %%f in (`reg query HKCR\Python.File\shell\open\command 2^>NUL`) do (set _my_=%%f %%g) -goto try2%errorlevel% - -:try20: -goto ok - -:try21: -echo Building without Python ... -goto therest - -:ok -echo Building with Python ... -set _res_=%_my_:*REG_SZ=% -set _end_=%_res_:*exe"=% -call set _python_=%%_res_:%_end_%=%% -echo %_python_% -call %_python_% modules\arch\x86\gen_x86_insn.py - -:therest -@echo on -call :update %1 x86insn_nasm.gperf x86insn_nasm.c -call :update %1 x86insn_gas.gperf x86insn_gas.c -call :update %1 modules\arch\x86\x86cpu.gperf x86cpu.c -call :update %1 modules\arch\x86\x86regtmod.gperf x86regtmod.c -goto :eof - -:update -%1 %2 tf -call mkfiles\vc14\out_copy_rename tf .\ %3 -del tf diff --git a/Mkfiles/vc15/genstring/genstring.vcxproj b/Mkfiles/vc15/genstring/genstring.vcxproj deleted file mode 100644 index 3a9e298b..00000000 --- a/Mkfiles/vc15/genstring/genstring.vcxproj +++ /dev/null @@ -1,196 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {021CEB0A-F721-4F59-B349-9CEEAF244459} - genstring - Win32Proj - - - - Application - MultiByte - v141 - - - Application - MultiByte - v141 - - - Application - MultiByte - v141 - - - Application - MultiByte - v141 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - - - - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - Level3 - ProgramDatabase - Default - - - $(OutDir)genstring.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX86 - - - run.bat "$(TargetPath)" - - - - - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - Level3 - ProgramDatabase - Default - - - $(OutDir)genstring.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - - - run.bat "$(TargetPath)" - - - - - Full - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreaded - - - $(IntDir) - Level3 - Default - - - $(OutDir)genstring.exe - $(OutDir)$(TargetName).pdb - Console - true - true - false - - - MachineX86 - - - run.bat "$(TargetPath)" - - - - - Full - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreaded - - - $(IntDir) - Level3 - Default - - - $(OutDir)genstring.exe - $(OutDir)$(TargetName).pdb - Console - true - true - false - - - - - run.bat "$(TargetPath)" - - - - - - - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc15/genstring/genstring.vcxproj.filters b/Mkfiles/vc15/genstring/genstring.vcxproj.filters deleted file mode 100644 index 04ed411d..00000000 --- a/Mkfiles/vc15/genstring/genstring.vcxproj.filters +++ /dev/null @@ -1,17 +0,0 @@ - - - - - {28EBE11C-5BE8-4935-9381-F57696749E0C} - cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx - - - - - Source Files - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc15/genstring/run.bat b/Mkfiles/vc15/genstring/run.bat deleted file mode 100644 index baedcecb..00000000 --- a/Mkfiles/vc15/genstring/run.bat +++ /dev/null @@ -1,2 +0,0 @@ -cd ..\..\.. -%1 license_msg license.c COPYING diff --git a/Mkfiles/vc15/genversion/genversion.vcxproj b/Mkfiles/vc15/genversion/genversion.vcxproj deleted file mode 100644 index 69079a0a..00000000 --- a/Mkfiles/vc15/genversion/genversion.vcxproj +++ /dev/null @@ -1,223 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2} - genversion - Win32Proj - - - - Application - MultiByte - v141 - - - Application - MultiByte - v141 - - - Application - MultiByte - v141 - - - Application - MultiByte - v141 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - - - - Disabled - ..\..\vc10;..\..\..\;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - Level3 - ProgramDatabase - Default - - - $(OutDir)genversion.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX86 - - - run.bat "$(TargetPath)" - - - cd ..\..\..\ -YASM-VERSION-GEN.bat - - - - - - Disabled - ..\..\vc10;..\..\..\;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - Level3 - ProgramDatabase - Default - - - $(OutDir)genversion.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - - - run.bat "$(TargetPath)" - - - cd ..\..\..\ -YASM-VERSION-GEN.bat - - - - - - Full - ..\..\vc10;..\..\..\;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreaded - - - $(IntDir) - Level3 - Default - - - $(OutDir)genversion.exe - $(OutDir)$(TargetName).pdb - Console - true - true - false - - - MachineX86 - - - run.bat "$(TargetPath)" - - - cd ..\..\..\ -YASM-VERSION-GEN.bat - - - - - - Full - ..\..\vc10;..\..\..\;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreaded - - - $(IntDir) - Level3 - Default - - - $(OutDir)genversion.exe - $(OutDir)$(TargetName).pdb - Console - true - true - false - - - - - run.bat "$(TargetPath)" - - - cd ..\..\..\ -YASM-VERSION-GEN.bat - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc15/genversion/genversion.vcxproj.filters b/Mkfiles/vc15/genversion/genversion.vcxproj.filters deleted file mode 100644 index cc088b12..00000000 --- a/Mkfiles/vc15/genversion/genversion.vcxproj.filters +++ /dev/null @@ -1,26 +0,0 @@ - - - - - {2acbec3a-0ed8-4b2e-826e-a84c7d35f205} - h;hpp;hxx;hm;inl - - - {E67ED277-E4F2-4D79-8C9E-962BAC164F3F} - cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx - - - - - Source Files - - - - - Header Files - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc15/genversion/run.bat b/Mkfiles/vc15/genversion/run.bat deleted file mode 100644 index 41b19cad..00000000 --- a/Mkfiles/vc15/genversion/run.bat +++ /dev/null @@ -1,2 +0,0 @@ -cd ..\..\.. -%1 version.mac diff --git a/Mkfiles/vc15/genversion/runpre.bat b/Mkfiles/vc15/genversion/runpre.bat deleted file mode 100644 index fdd15708..00000000 --- a/Mkfiles/vc15/genversion/runpre.bat +++ /dev/null @@ -1,2 +0,0 @@ -cd ..\..\.. -YASM-VERSION-GEN.bat diff --git a/Mkfiles/vc15/libyasm-stdint.h b/Mkfiles/vc15/libyasm-stdint.h deleted file mode 100644 index b66ab15f..00000000 --- a/Mkfiles/vc15/libyasm-stdint.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef _UINTPTR_T_DEFINED -#ifdef _WIN64 -#include -#else -typedef unsigned long uintptr_t; -#endif -#define _UINTPTR_T_DEFINED -#endif diff --git a/Mkfiles/vc15/libyasm/libyasm.vcxproj b/Mkfiles/vc15/libyasm/libyasm.vcxproj deleted file mode 100644 index 63c5605f..00000000 --- a/Mkfiles/vc15/libyasm/libyasm.vcxproj +++ /dev/null @@ -1,277 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {29FE7874-1256-4AD6-B889-68E399DC9608} - libyasm - - - - StaticLibrary - false - MultiByte - v141 - - - StaticLibrary - false - MultiByte - v141 - - - StaticLibrary - false - MultiByte - v141 - - - StaticLibrary - false - MultiByte - v141 - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - - - - Full - Default - ..;../../..;%(AdditionalIncludeDirectories) - NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)libyasm.lib - true - - - - - X64 - - - Full - Default - ..;../../..;%(AdditionalIncludeDirectories) - NDEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)libyasm.lib - true - - - - - Disabled - ..;../../..;%(AdditionalIncludeDirectories) - _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)libyasm.lib - true - - - - - X64 - - - Disabled - ..;../../..;%(AdditionalIncludeDirectories) - _DEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)libyasm.lib - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {f0e8b707-00c5-4ff2-b8ef-7c39817132a0} - false - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc15/libyasm/libyasm.vcxproj.filters b/Mkfiles/vc15/libyasm/libyasm.vcxproj.filters deleted file mode 100644 index 9bdf13a4..00000000 --- a/Mkfiles/vc15/libyasm/libyasm.vcxproj.filters +++ /dev/null @@ -1,200 +0,0 @@ - - - - - {4ca3b698-9d01-4e4e-ae00-5c98da045efe} - h;hpp;hxx;hm;inl - - - {68607062-982d-4251-9a1a-30f76474983d} - cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Source Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc15/modules/modules.vcxproj b/Mkfiles/vc15/modules/modules.vcxproj deleted file mode 100644 index 51d1dc12..00000000 --- a/Mkfiles/vc15/modules/modules.vcxproj +++ /dev/null @@ -1,324 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6} - modules - - - - StaticLibrary - false - MultiByte - v141 - - - StaticLibrary - false - MultiByte - v141 - - - StaticLibrary - false - MultiByte - v141 - - - StaticLibrary - false - MultiByte - v141 - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - - - - Full - Default - ..;../../..;%(AdditionalIncludeDirectories) - NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)modules.lib - true - - - - - - - - - X64 - - - Full - Default - ..;../../..;%(AdditionalIncludeDirectories) - NDEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)modules.lib - true - - - - - Disabled - ..;../../..;%(AdditionalIncludeDirectories) - _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)modules.lib - true - - - - - X64 - - - Disabled - ..;../../..;%(AdditionalIncludeDirectories) - _DEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)modules.lib - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {225700a5-07b8-434e-ad61-555278bf6733} - false - - - {c45a8b59-8b59-4d5d-a8e8-fb090f8dd619} - false - - - {29fe7874-1256-4ad6-b889-68e399dc9608} - false - - - {3c58be13-50a3-4583-984d-d8902b3d7713} - false - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc15/modules/modules.vcxproj.filters b/Mkfiles/vc15/modules/modules.vcxproj.filters deleted file mode 100644 index e6ff3add..00000000 --- a/Mkfiles/vc15/modules/modules.vcxproj.filters +++ /dev/null @@ -1,256 +0,0 @@ - - - - - {39c89f91-d860-4396-a49f-86b8b7a51c33} - cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - - - {be0cdf28-cbed-4774-b3cc-b63e4e3fa0a9} - - - {491cc60a-889b-4f53-aae9-f4d7d6aa667a} - - - {c084015d-3c3e-4379-8746-ae5cffcec79e} - - - {3333e0b3-e95f-44f6-9000-58d4da368360} - - - {528f2955-ceba-4691-a36c-054f119e3dcc} - - - {81686d52-eb71-4d4a-a830-66c45afb808f} - - - {98fe1e43-3794-4639-bf29-14b0c569754f} - - - {6b3956d4-0bff-4e8e-af61-a7e59b476fa4} - - - {446fad62-ac17-49e9-8263-33481f04f182} - - - {33fb7fc8-61f9-428d-9c94-7a4912fbb678} - - - {48fc77ec-7d78-4c0a-bfc2-9aa76faf5d7f} - - - - - Source Files\parsers - - - Source Files\arch - - - Source Files\arch - - - Source Files\arch - - - Source Files\arch - - - Source Files\arch - - - Source Files\arch - - - Source Files\arch - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\listfmts\nasm - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\parsers - - - Source Files\parsers - - - Source Files\parsers - - - Source Files\parsers - - - Source Files\parsers - - - Source Files\preprocs\cpp - - - Source Files\preprocs\gas - - - Source Files\preprocs\gas - - - Source Files\preprocs\nasm - - - Source Files\preprocs\nasm - - - Source Files\preprocs\nasm - - - Source Files\preprocs\nasm - - - Source Files\preprocs\raw - - - Source Files\parsers - - - Source Files\arch - - - Source Files\arch - - - Source Files\objfmts - - - - - Source Files\arch - - - Source Files\arch - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\parsers - - - Source Files\parsers - - - Source Files\preprocs\gas - - - Source Files\preprocs\nasm - - - Source Files\preprocs\nasm - - - Source Files\preprocs\nasm - - - Source Files\preprocs\nasm - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc15/out_copy_rename.bat b/Mkfiles/vc15/out_copy_rename.bat deleted file mode 100644 index 3179b59a..00000000 --- a/Mkfiles/vc15/out_copy_rename.bat +++ /dev/null @@ -1,42 +0,0 @@ -@echo off -if not exist %1 goto nofile -if exist %2 goto copy - -echo creating directory %2 -md %2 > nul - -:copy -set str=%2 -for /f "useback tokens=*" %%a in ('%str%') do set str=%%~a -set str=%str:~-1% -if %str% == "\" goto hasbackslash - -if not exist %2\%3 goto cpy -fc %1 %2\%3 > nul && if not %errorlevel 1 goto exit -echo overwriting %2\%3 with %1 -copy %1 %2\%3 > nul -goto exit - -:cpy -echo copying %1 to %2\%3 -copy %1 %2\%3 > nul -goto exit - -:hasbackslash -if not exist %2%3 goto cpy2 -fc %1 %2%3 > nul && if not %errorlevel 1 goto exit -echo overwriting %2%3 with %1 -copy %1 %2%3 > nul -goto exit - -:cpy2 -echo copying %1 to %2%3 -copy %1 %2%3 > nul -goto exit - -:nofile -echo %1 not found - -:exit - - diff --git a/Mkfiles/vc15/re2c/re2c.vcxproj b/Mkfiles/vc15/re2c/re2c.vcxproj deleted file mode 100644 index 62eb2d0c..00000000 --- a/Mkfiles/vc15/re2c/re2c.vcxproj +++ /dev/null @@ -1,221 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {3C58BE13-50A3-4583-984D-D8902B3D7713} - re2c - Win32Proj - - - - Application - MultiByte - v141 - - - Application - MultiByte - v141 - - - Application - MultiByte - v141 - - - Application - MultiByte - v141 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - - - - Disabled - ..;../../..;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - Level3 - Default - ProgramDatabase - - - $(OutDir)re2c.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX86 - - - run.bat "$(TargetPath)" - - - - - Disabled - ..;../../..;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - Level3 - Default - ProgramDatabase - - - $(OutDir)re2c.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - - - run.bat "$(TargetPath)" - - - - - Full - ..;../../..;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreaded - - - $(IntDir) - Level3 - Default - - - $(OutDir)re2c.exe - $(OutDir)$(TargetName).pdb - Console - true - true - false - - - MachineX86 - - - run.bat "$(TargetPath)" - - - - - Full - ..;../../..;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreaded - - - $(IntDir) - Level3 - Default - - - $(OutDir)re2c.exe - $(OutDir)$(TargetName).pdb - Console - true - true - false - - - - - run.bat "$(TargetPath)" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc15/re2c/re2c.vcxproj.filters b/Mkfiles/vc15/re2c/re2c.vcxproj.filters deleted file mode 100644 index da0f935c..00000000 --- a/Mkfiles/vc15/re2c/re2c.vcxproj.filters +++ /dev/null @@ -1,80 +0,0 @@ - - - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc15/re2c/run.bat b/Mkfiles/vc15/re2c/run.bat deleted file mode 100644 index 6ac571f0..00000000 --- a/Mkfiles/vc15/re2c/run.bat +++ /dev/null @@ -1,4 +0,0 @@ -cd ..\..\..\ -%1 -s -o lc3bid.c modules\arch\lc3b\lc3bid.re -%1 -b -o nasm-token.c modules\parsers\nasm\nasm-token.re -%1 -b -o gas-token.c modules\parsers\gas\gas-token.re diff --git a/Mkfiles/vc15/readme.vc14.txt b/Mkfiles/vc15/readme.vc14.txt deleted file mode 100644 index ea716567..00000000 --- a/Mkfiles/vc15/readme.vc14.txt +++ /dev/null @@ -1,106 +0,0 @@ -Building YASM with Microsoft Visual Studio 2015 (C/C++ v14) ------------------------------------------------------------ - -This note describes how to build YASM using Microsoft Visual -Studio 2015 (C/C++ v14). - -1. YASM Download ----------------- - -First YASM needs to be downloaded and the files placed within -a suitable directory, which will be called here but can -be named and located as you wish. - -2. Building YASM with Microsoft 2015 (VC14) -------------------------------------------- - -Now locate and double click on the yasm.sln solution file in -the 'Mkfiles/vc14' subdirectory to open the build project in -the Visual Studio 2015 IDE and then select: - - win32 or x64 build - release or debug build - -as appropriate to build the YASM binaries that you need. - -4. Using YASM with Visual Sudio 2015 and VC++ version 14 --------------------------------------------------------- - -The YASM version vsyasm.exe is designed specifically for use -with the 2010 and later versions of Visual Studio. To tell -Visual Studio where to find vsyasm.exe, the environment -variable YASMPATH can be set to the absolute path of the -directory in which vsyasm.exe is located (this path should -include the final backslash). - -Alternatively you can find the directory (or directories) -where the VC++ compiler binaries are located and put copies -of the vsyasm.exe binary in these directories. The typical -location on 64-bit Windows is: - -C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin - -On 32-bit Windows it is normally at: - -C:\Program Files\Microsoft Visual Studio 14.0\VC\bin - -Depending on your system you can use either the win32 or the -x64 version of vsyasm.exe, which must be named vsyasm.exe. - -To use the custom tools facility in Visual Studio 2015, you -need to place a copy of three files - yasm.props, yasm.targets -and yasm.xml - into a location where they can be found by the -Visual Studio build customisation processes. There are several -ways to do this: - - a. put these files in the MSBUILD customisation directory, - which is typically at: - - C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\BuildCustomizations - - b. put them in a convenient location and set this path in the - 'Build Customisations Search Path' in the Visual Studio - 'Projects and Solutions|VC++ Project Settings' item in - the 'Tools|Options' menu; - - c. put them in a convenient location and set this path in the - 'Build Customisation dialogue (discussed later). - -To use YASM in a project, right click on the project in the Solution -Explorer and select 'Build Customisations..'. This will give you a -dialog box that allows you to select YASM as an assembler (note that -your assembler files need to have the extension '.asm'). If you have -used option c. above, you will need to let the dialogue find them -using the 'Find Existing' button below the dialogue. - -To assemble a file with YASM, select the Property Page for the file -and the select 'Yasm Assembler' in the Tool dialog entry. Then click -'Apply' and an additional property page entry will appear and enable -YASM settings to be established. - -5. A Linker Issue ------------------ - -There appears to be a linker bug in the VC++ linker that prevents -symbols with absolute addresses being linked in DLL builds. This -means, for example, that LEA instructions of the general form: - - lea, rax,[rax+symbol] - -cannot be used for DLL builds. The following general form -has to be used instead: - - lea rcx,[symbol wrt rip] - lea rax,[rax+rcx] - -This limitation may also cause problems with other instruction -that use absolute addresses. - -6. Acknowledgements -------------------- - -I am most grateful for the fantastic support that Peter Johnson, -YASM's creator, has given me in tracking down issues in using -YASM for the production of Windows x64 code. - - Brian Gladman, 30th April 2015 diff --git a/Mkfiles/vc15/vsyasm.props b/Mkfiles/vc15/vsyasm.props deleted file mode 100644 index 8e2269b6..00000000 --- a/Mkfiles/vc15/vsyasm.props +++ /dev/null @@ -1,27 +0,0 @@ - - - - Midl - CustomBuild - - - _SelectedFiles;$(YASMDependsOn) - - - C:\Program Files\yasm\ - - - - False - $(IntDir)%(FileName).obj - 0 - 0 - "$(YASM_PATH)"vsyasm.exe -Xvc -f $(Platform) [AllOptions] [AdditionalOptions] [Inputs] - %(ObjectFile) - Assembling %(Filename)%(Extension) ==> $(IntDir)%(FileName).obj - false - - - diff --git a/Mkfiles/vc15/vsyasm.targets b/Mkfiles/vc15/vsyasm.targets deleted file mode 100644 index 8f38f2cb..00000000 --- a/Mkfiles/vc15/vsyasm.targets +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - _YASM - - - - - - $(ComputeLinkInputsTargets); - ComputeYASMOutput; - - - $(ComputeLibInputsTargets); - ComputeYASMOutput; - - - - - $(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml - - - - - - <_YASMReadTlog - Include="^%(YASM.FullPath);%(YASM.AdditionalDependencies)" - Condition="'%(YASM.ExcludedFromBuild)' != 'true' and '%(YASM.ObjectFile)' != ''"/> - <_YASMWriteTlog - Include="^%(YASM.FullPath);$([MSBuild]::NormalizePath('$(MSBuildProjectDirectory)', '%(YASM.ObjectFile)'))" - Condition="'%(YASM.ExcludedFromBuild)' != 'true' and '%(YASM.ObjectFile)' != ''"/> - - - - - - - - <_YASMReadTlog Remove="@(_YASMReadTlog)" /> - <_YASMWriteTlog Remove="@(_YASMWriteTlog)" /> - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc15/vsyasm.vcxproj b/Mkfiles/vc15/vsyasm.vcxproj deleted file mode 100644 index 9328dcf8..00000000 --- a/Mkfiles/vc15/vsyasm.vcxproj +++ /dev/null @@ -1,279 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {7FDD85BB-CC86-442B-A425-989B5B296ED5} - vsyasm - - - - Application - false - MultiByte - v141 - - - Application - false - MultiByte - v141 - - - Application - false - MultiByte - v141 - - - Application - false - MultiByte - v141 - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - - - - $(Platform)\$(Configuration)/yasm.tlb - - - - - Disabled - .;../..;%(AdditionalIncludeDirectories) - _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)vsyasm.exe - true - true - $(OutDir)$(ProjectName).pdb - Console - false - - - MachineX86 - - - - - X64 - $(Platform)\$(Configuration)/yasm.tlb - - - - - Disabled - .;../..;%(AdditionalIncludeDirectories) - _DEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)vsyasm.exe - true - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX64 - - - - - $(Platform)\$(Configuration)/yasm.tlb - - - - - Full - Default - true - .;../..;%(AdditionalIncludeDirectories) - NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)vsyasm.exe - true - true - $(OutDir)$(ProjectName).pdb - Console - false - - - MachineX86 - - - - - X64 - $(Platform)\$(Configuration)/yasm.tlb - - - - - Full - OnlyExplicitInline - .;../..;%(AdditionalIncludeDirectories) - NDEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)vsyasm.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX64 - true - - - - - - - - - {29fe7874-1256-4ad6-b889-68e399dc9608} - false - - - {d715a3d4-efaa-442e-ad8b-5b4ff64e1dd6} - false - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc15/vsyasm.xml b/Mkfiles/vc15/vsyasm.xml deleted file mode 100644 index a108f005..00000000 --- a/Mkfiles/vc15/vsyasm.xml +++ /dev/null @@ -1,283 +0,0 @@ - - - - - - - - - - - - - General - - - - - - Symbols - - - - - - Files - - - - - - Command Line - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Execute Before - - - Specifies the targets for the build customization to run before. - - - - - - - - - - - - Execute After - - - Specifies the targets for the build customization to run after. - - - - - - - - - - - - - - - - - - Additional Options - - - Additional Options - - - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc15/yasm.sln b/Mkfiles/vc15/yasm.sln deleted file mode 100644 index 5d2dc952..00000000 --- a/Mkfiles/vc15/yasm.sln +++ /dev/null @@ -1,142 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.22823.1 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{825AC694-358C-4D8D-92DE-33A2691978CE}" - ProjectSection(SolutionItems) = preProject - crt_secure_no_deprecate.vsprops = crt_secure_no_deprecate.vsprops - readme.vc14.txt = readme.vc14.txt - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libyasm", "libyasm\libyasm.vcxproj", "{29FE7874-1256-4AD6-B889-68E399DC9608}" - ProjectSection(ProjectDependencies) = postProject - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2} = {B545983B-8EE0-4A7B-A67A-E749EEAE62A2} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "modules", "modules\modules.vcxproj", "{D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yasm", "yasm.vcxproj", "{34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genmacro", "genmacro\genmacro.vcxproj", "{225700A5-07B8-434E-AD61-555278BF6733}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genversion", "genversion\genversion.vcxproj", "{B545983B-8EE0-4A7B-A67A-E749EEAE62A2}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "re2c", "re2c\re2c.vcxproj", "{3C58BE13-50A3-4583-984D-D8902B3D7713}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genperf", "genperf\genperf.vcxproj", "{C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genmodule", "genmodule\genmodule.vcxproj", "{F0E8B707-00C5-4FF2-B8EF-7C39817132A0}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genstring", "genstring\genstring.vcxproj", "{021CEB0A-F721-4F59-B349-9CEEAF244459}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ytasm", "ytasm.vcxproj", "{2162937B-0DBD-4450-B45F-DF578D8E7508}" - ProjectSection(ProjectDependencies) = postProject - {021CEB0A-F721-4F59-B349-9CEEAF244459} = {021CEB0A-F721-4F59-B349-9CEEAF244459} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vsyasm", "vsyasm.vcxproj", "{7FDD85BB-CC86-442B-A425-989B5B296ED5}" - ProjectSection(ProjectDependencies) = postProject - {021CEB0A-F721-4F59-B349-9CEEAF244459} = {021CEB0A-F721-4F59-B349-9CEEAF244459} - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|Win32.ActiveCfg = Debug|Win32 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|Win32.Build.0 = Debug|Win32 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|x64.ActiveCfg = Debug|x64 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|x64.Build.0 = Debug|x64 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|Win32.ActiveCfg = Release|Win32 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|Win32.Build.0 = Release|Win32 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|x64.ActiveCfg = Release|x64 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|x64.Build.0 = Release|x64 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|Win32.ActiveCfg = Debug|Win32 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|Win32.Build.0 = Debug|Win32 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|x64.ActiveCfg = Debug|x64 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|x64.Build.0 = Debug|x64 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|Win32.ActiveCfg = Release|Win32 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|Win32.Build.0 = Release|Win32 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|x64.ActiveCfg = Release|x64 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|x64.Build.0 = Release|x64 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|Win32.ActiveCfg = Debug|Win32 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|Win32.Build.0 = Debug|Win32 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|x64.ActiveCfg = Debug|x64 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|x64.Build.0 = Debug|x64 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|Win32.ActiveCfg = Release|Win32 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|Win32.Build.0 = Release|Win32 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|x64.ActiveCfg = Release|x64 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|x64.Build.0 = Release|x64 - {225700A5-07B8-434E-AD61-555278BF6733}.Debug|Win32.ActiveCfg = Debug|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Debug|Win32.Build.0 = Debug|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Debug|x64.ActiveCfg = Debug|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Debug|x64.Build.0 = Debug|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Release|Win32.ActiveCfg = Release|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Release|Win32.Build.0 = Release|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Release|x64.ActiveCfg = Release|x64 - {225700A5-07B8-434E-AD61-555278BF6733}.Release|x64.Build.0 = Release|x64 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|Win32.ActiveCfg = Debug|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|Win32.Build.0 = Debug|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|x64.ActiveCfg = Debug|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|x64.Build.0 = Debug|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|Win32.ActiveCfg = Release|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|Win32.Build.0 = Release|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|x64.ActiveCfg = Release|x64 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|x64.Build.0 = Release|x64 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|Win32.ActiveCfg = Debug|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|Win32.Build.0 = Debug|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|x64.ActiveCfg = Debug|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|x64.Build.0 = Debug|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|Win32.ActiveCfg = Release|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|Win32.Build.0 = Release|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|x64.ActiveCfg = Release|x64 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|x64.Build.0 = Release|x64 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|Win32.ActiveCfg = Debug|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|Win32.Build.0 = Debug|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|x64.ActiveCfg = Debug|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|x64.Build.0 = Debug|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|Win32.ActiveCfg = Release|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|Win32.Build.0 = Release|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|x64.ActiveCfg = Release|x64 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|x64.Build.0 = Release|x64 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|Win32.ActiveCfg = Debug|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|Win32.Build.0 = Debug|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|x64.ActiveCfg = Debug|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|x64.Build.0 = Debug|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|Win32.ActiveCfg = Release|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|Win32.Build.0 = Release|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|x64.ActiveCfg = Release|x64 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|x64.Build.0 = Release|x64 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|Win32.ActiveCfg = Debug|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|Win32.Build.0 = Debug|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|x64.ActiveCfg = Debug|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|x64.Build.0 = Debug|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|Win32.ActiveCfg = Release|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|Win32.Build.0 = Release|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|x64.ActiveCfg = Release|x64 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|x64.Build.0 = Release|x64 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|Win32.ActiveCfg = Debug|Win32 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|Win32.Build.0 = Debug|Win32 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|x64.ActiveCfg = Debug|x64 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|x64.Build.0 = Debug|x64 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|Win32.ActiveCfg = Release|Win32 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|Win32.Build.0 = Release|Win32 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|x64.ActiveCfg = Release|x64 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|x64.Build.0 = Release|x64 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|Win32.ActiveCfg = Debug|Win32 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|Win32.Build.0 = Debug|Win32 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|x64.ActiveCfg = Debug|x64 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|x64.Build.0 = Debug|x64 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|Win32.ActiveCfg = Release|Win32 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|Win32.Build.0 = Release|Win32 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|x64.ActiveCfg = Release|x64 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/Mkfiles/vc15/yasm.vcxproj b/Mkfiles/vc15/yasm.vcxproj deleted file mode 100644 index dd041da0..00000000 --- a/Mkfiles/vc15/yasm.vcxproj +++ /dev/null @@ -1,283 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5} - yasm - - - - Application - false - MultiByte - v141 - - - Application - false - MultiByte - v141 - - - Application - false - MultiByte - v141 - - - Application - false - MultiByte - v141 - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - - - - $(Platform)\$(Configuration)/yasm.tlb - - - - - Disabled - .;../..;%(AdditionalIncludeDirectories) - _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)yasm.exe - true - true - $(OutDir)$(ProjectName).pdb - Console - false - - - MachineX86 - - - - - X64 - $(Platform)\$(Configuration)/yasm.tlb - - - - - Disabled - .;../..;%(AdditionalIncludeDirectories) - _DEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)yasm.exe - true - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX64 - - - - - $(Platform)\$(Configuration)/yasm.tlb - - - - - Full - Default - true - .;../..;%(AdditionalIncludeDirectories) - NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)yasm.exe - true - true - $(OutDir)$(ProjectName).pdb - Console - false - - - MachineX86 - - - - - X64 - $(Platform)\$(Configuration)/yasm.tlb - - - - - Full - OnlyExplicitInline - .;../..;%(AdditionalIncludeDirectories) - NDEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)yasm.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX64 - true - - - - - - - - - - - - - - - - - {021ceb0a-f721-4f59-b349-9ceeaf244459} - false - - - {29fe7874-1256-4ad6-b889-68e399dc9608} - false - - - {d715a3d4-efaa-442e-ad8b-5b4ff64e1dd6} - false - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc15/yasm.vcxproj.filters b/Mkfiles/vc15/yasm.vcxproj.filters deleted file mode 100644 index 04941c22..00000000 --- a/Mkfiles/vc15/yasm.vcxproj.filters +++ /dev/null @@ -1,41 +0,0 @@ - - - - - {51f0d88e-1373-4bf8-a72e-c79706d37f8b} - h;hpp;hxx;hm;inl - - - {db67b411-6f59-462c-9c20-75024c6b3912} - cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - - - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - \ No newline at end of file diff --git a/Mkfiles/vc15/ytasm.vcxproj b/Mkfiles/vc15/ytasm.vcxproj deleted file mode 100644 index 9d90e255..00000000 --- a/Mkfiles/vc15/ytasm.vcxproj +++ /dev/null @@ -1,278 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {2162937B-0DBD-4450-B45F-DF578D8E7508} - ytasm - - - - Application - false - MultiByte - v141 - - - Application - false - MultiByte - v141 - - - Application - false - MultiByte - v141 - - - Application - false - MultiByte - v141 - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - - - - $(Platform)\$(Configuration)/yasm.tlb - - - - - Disabled - .;../..;%(AdditionalIncludeDirectories) - _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)ytasm.exe - true - true - $(OutDir)$(ProjectName).pdb - Console - false - - - MachineX86 - - - - - X64 - $(Platform)\$(Configuration)/yasm.tlb - - - - - Disabled - .;../..;%(AdditionalIncludeDirectories) - _DEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)ytasm.exe - true - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX64 - - - - - $(Platform)\$(Configuration)/yasm.tlb - - - - - Full - Default - true - .;../..;%(AdditionalIncludeDirectories) - NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)ytasm.exe - true - true - $(OutDir)$(ProjectName).pdb - Console - false - - - MachineX86 - - - - - X64 - $(Platform)\$(Configuration)/yasm.tlb - - - - - Full - OnlyExplicitInline - .;../..;%(AdditionalIncludeDirectories) - NDEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)ytasm.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX64 - true - - - - - - - - - - - - - - - - {29fe7874-1256-4ad6-b889-68e399dc9608} - false - - - {d715a3d4-efaa-442e-ad8b-5b4ff64e1dd6} - false - - - - - - \ No newline at end of file diff --git a/Mkfiles/vc9/config.h b/Mkfiles/vc9/config.h deleted file mode 100644 index efb7cbe4..00000000 --- a/Mkfiles/vc9/config.h +++ /dev/null @@ -1,170 +0,0 @@ -#include "YASM-VERSION.h" -#define yasm__splitpath(path, tail) yasm__splitpath_win(path, tail) -#define yasm__abspath(path) yasm__abspath_win(path) -#define yasm__combpath(from, to) yasm__combpath_win(from, to) - -/* Command name to run C preprocessor */ -#define CPP_PROG "cpp" - -/* */ -/* #undef ENABLE_NLS */ - -/* Define if you have the `abort' function. */ -#define HAVE_ABORT 1 - -/* */ -/* #undef HAVE_CATGETS */ - -/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the - CoreFoundation framework. */ -/* #undef HAVE_CFLOCALECOPYCURRENT */ - -/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in - the CoreFoundation framework. */ -/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ - -/* Define if the GNU dcgettext() function is already present or preinstalled. - */ -/* #undef HAVE_DCGETTEXT */ - -/* Define to 1 if you have the header file. */ -#define HAVE_DIRECT_H 1 - -/* Define to 1 if you have the `getcwd' function. */ -#define HAVE_GETCWD 1 - -/* */ -/* #undef HAVE_GETTEXT */ - -/* Define if you have the GNU C Library */ -/* #undef HAVE_GNU_C_LIBRARY */ - -/* Define if you have the iconv() function. */ -/* #undef HAVE_ICONV */ - -/* Define if you have the header file. */ -/* #undef HAVE_INTTYPES_H */ - -/* */ -/* #undef HAVE_LC_MESSAGES */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_LIBGEN_H */ - -/* Define if you have the header file. */ -/* #undef HAVE_MEMORY_H */ - -/* Define if you have the `mergesort' function. */ -/* #undef HAVE_MERGESORT */ - -/* Define to 1 if you have the `popen' function. */ -/* #undef HAVE_POPEN */ - -/* Define if you have the header file. */ -/* #undef HAVE_STDINT_H */ - -/* Define if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* */ -/* #undef HAVE_STPCPY */ - -/* Define if you have the `strcasecmp' function. */ -/* #undef HAVE_STRCASECMP */ - -/* Define if you have the `strcmpi' function. */ -/* #undef HAVE_STRCMPI */ - -/* Define if you have the `stricmp' function. */ -/* #undefine HAVE_STRICMP */ - -/* Define if you have the header file. */ -/* #undef HAVE_STRINGS_H */ - -/* Define if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define if you have the `strncasecmp' function. */ -/* #undef HAVE_STRNCASECMP */ - -/* Define if you have the `strsep' function. */ -/* #undef HAVE_STRSEP */ - -/* Define if you have the header file. */ -/* #undef HAVE_SYS_STAT_H */ - -/* Define if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define if you have the `toascii' function. */ -#define HAVE_TOASCII 1 -#define toascii __toascii - -/* Define if you have the header file. */ -/* #undef HAVE_UNISTD_H */ - -/* Define to 1 if you have the `vsnprintf' function. */ -/* #undef HAVE_VSNPRINTF */ - -/* Define to 1 if you have the `_stricmp' function. */ -#define HAVE__STRICMP 1 - -/* Name of package */ -#define PACKAGE "yasm" - -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "bug-yasm@tortall.net" - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "yasm" - -/* Define to the full name and version of this package. */ -/*#define PACKAGE_STRING "yasm HEAD"*/ - -/* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "yasm" - -/* Define to the version of this package. */ -/*#define PACKAGE_VERSION "HEAD"*/ - -/* Define if the C compiler supports function prototypes. */ -#define PROTOTYPES 1 - -/* The size of a `char', as computed by sizeof. */ -/* #undef SIZEOF_CHAR */ - -/* The size of a `int', as computed by sizeof. */ -/* #undef SIZEOF_INT */ - -/* The size of a `long', as computed by sizeof. */ -/* #undef SIZEOF_LONG */ - -/* The size of a `short', as computed by sizeof. */ -/* #undef SIZEOF_SHORT */ - -/* The size of a `void*', as computed by sizeof. */ -/* #undef SIZEOF_VOIDP */ - -/* Define if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Version number of package */ -#define VERSION "HEAD" - -/* Define if using the dmalloc debugging malloc package */ -/* #undef WITH_DMALLOC */ - -/* Define like PROTOTYPES; this can be used by system headers. */ -#define __PROTOTYPES 1 - -/* Define to empty if `const' does not conform to ANSI C. */ -/* #undef const */ - -/* Define as `__inline' if that's what the C compiler calls it, or to nothing - if it is not supported. */ -#ifndef __cplusplus -/* #undef inline */ -#endif - -/* Define to `unsigned' if doesn't define. */ -/* #undef size_t */ diff --git a/Mkfiles/vc9/crt_secure_no_deprecate.vsprops b/Mkfiles/vc9/crt_secure_no_deprecate.vsprops deleted file mode 100644 index d61ba30a..00000000 --- a/Mkfiles/vc9/crt_secure_no_deprecate.vsprops +++ /dev/null @@ -1,11 +0,0 @@ - - - - diff --git a/Mkfiles/vc9/genmacro/genmacro.vcproj b/Mkfiles/vc9/genmacro/genmacro.vcproj deleted file mode 100644 index 9d34e2ef..00000000 --- a/Mkfiles/vc9/genmacro/genmacro.vcproj +++ /dev/null @@ -1,198 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Mkfiles/vc9/genmacro/run.bat b/Mkfiles/vc9/genmacro/run.bat deleted file mode 100644 index d2fbb98c..00000000 --- a/Mkfiles/vc9/genmacro/run.bat +++ /dev/null @@ -1,5 +0,0 @@ -cd ..\..\.. -%1 nasm-version.c nasm_version_mac version.mac -%1 nasm-macros.c nasm_standard_mac modules\parsers\nasm\nasm-std.mac -%1 win64-nasm.c win64_nasm_stdmac modules\objfmts\coff\win64-nasm.mac -%1 win64-gas.c win64_gas_stdmac modules\objfmts\coff\win64-gas.mac diff --git a/Mkfiles/vc9/genmodule/genmodule.vcproj b/Mkfiles/vc9/genmodule/genmodule.vcproj deleted file mode 100644 index affc9735..00000000 --- a/Mkfiles/vc9/genmodule/genmodule.vcproj +++ /dev/null @@ -1,202 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Mkfiles/vc9/genmodule/run.bat b/Mkfiles/vc9/genmodule/run.bat deleted file mode 100644 index e34a4169..00000000 --- a/Mkfiles/vc9/genmodule/run.bat +++ /dev/null @@ -1,3 +0,0 @@ -@echo off -cd ..\..\.. -%1 libyasm\module.in Makefile.am diff --git a/Mkfiles/vc9/genperf/genperf.vcproj b/Mkfiles/vc9/genperf/genperf.vcproj deleted file mode 100644 index ab6e9e4e..00000000 --- a/Mkfiles/vc9/genperf/genperf.vcproj +++ /dev/null @@ -1,234 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Mkfiles/vc9/genperf/run.bat b/Mkfiles/vc9/genperf/run.bat deleted file mode 100644 index 9c22b57e..00000000 --- a/Mkfiles/vc9/genperf/run.bat +++ /dev/null @@ -1,22 +0,0 @@ -cd ..\..\.. -@echo off -for /f "usebackq tokens=1*" %%f in (`reg query HKCR\Python.File\shell\open\command`) do (set _my_=%%f %%g) -goto next%errorlevel% - -:next1 -echo Building without Python ... -goto therest - -:next0 -echo Building with Python ... -set _res_=%_my_:*REG_SZ=% -set _end_=%_res_:*exe"=% -call set _python_=%%_res_:%_end_%=%% -call %_python_% modules\arch\x86\gen_x86_insn.py - -:therest -@echo on -%1 x86insn_nasm.gperf x86insn_nasm.c -%1 x86insn_gas.gperf x86insn_gas.c -%1 modules\arch\x86\x86cpu.gperf x86cpu.c -%1 modules\arch\x86\x86regtmod.gperf x86regtmod.c diff --git a/Mkfiles/vc9/genstring/genstring.vcproj b/Mkfiles/vc9/genstring/genstring.vcproj deleted file mode 100644 index 368346e8..00000000 --- a/Mkfiles/vc9/genstring/genstring.vcproj +++ /dev/null @@ -1,198 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Mkfiles/vc9/genstring/run.bat b/Mkfiles/vc9/genstring/run.bat deleted file mode 100644 index 5864b1dc..00000000 --- a/Mkfiles/vc9/genstring/run.bat +++ /dev/null @@ -1,2 +0,0 @@ -cd ..\..\.. -%1 license_msg license.c COPYING diff --git a/Mkfiles/vc9/genversion/genversion.vcproj b/Mkfiles/vc9/genversion/genversion.vcproj deleted file mode 100644 index f5a01f97..00000000 --- a/Mkfiles/vc9/genversion/genversion.vcproj +++ /dev/null @@ -1,211 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Mkfiles/vc9/genversion/run.bat b/Mkfiles/vc9/genversion/run.bat deleted file mode 100644 index 30edf8f1..00000000 --- a/Mkfiles/vc9/genversion/run.bat +++ /dev/null @@ -1,2 +0,0 @@ -cd ..\..\.. -%1 version.mac diff --git a/Mkfiles/vc9/genversion/runpre.bat b/Mkfiles/vc9/genversion/runpre.bat deleted file mode 100644 index fdd15708..00000000 --- a/Mkfiles/vc9/genversion/runpre.bat +++ /dev/null @@ -1,2 +0,0 @@ -cd ..\..\.. -YASM-VERSION-GEN.bat diff --git a/Mkfiles/vc9/libyasm-stdint.h b/Mkfiles/vc9/libyasm-stdint.h deleted file mode 100644 index fed61b33..00000000 --- a/Mkfiles/vc9/libyasm-stdint.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef _UINTPTR_T_DEFINED -#ifdef _WIN64 -#include -#else -typedef unsigned long uintptr_t; -#endif -#define _UINTPTR_T_DEFINED -#endif diff --git a/Mkfiles/vc9/libyasm/libyasm.vcproj b/Mkfiles/vc9/libyasm/libyasm.vcproj deleted file mode 100644 index 95e3deff..00000000 --- a/Mkfiles/vc9/libyasm/libyasm.vcproj +++ /dev/null @@ -1,572 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Mkfiles/vc9/modules/modules.vcproj b/Mkfiles/vc9/modules/modules.vcproj deleted file mode 100644 index 0aa18f06..00000000 --- a/Mkfiles/vc9/modules/modules.vcproj +++ /dev/null @@ -1,616 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Mkfiles/vc9/re2c/re2c.vcproj b/Mkfiles/vc9/re2c/re2c.vcproj deleted file mode 100644 index 45bc3e36..00000000 --- a/Mkfiles/vc9/re2c/re2c.vcproj +++ /dev/null @@ -1,278 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Mkfiles/vc9/re2c/run.bat b/Mkfiles/vc9/re2c/run.bat deleted file mode 100644 index cde2a7b6..00000000 --- a/Mkfiles/vc9/re2c/run.bat +++ /dev/null @@ -1,4 +0,0 @@ -cd ..\..\..\ -%1 -s -o lc3bid.c modules\arch\lc3b\lc3bid.re -%1 -b -o nasm-token.c modules\parsers\nasm\nasm-token.re -%1 -b -o gas-token.c modules\parsers\gas\gas-token.re diff --git a/Mkfiles/vc9/readme.vc9.txt b/Mkfiles/vc9/readme.vc9.txt deleted file mode 100644 index 14b21d69..00000000 --- a/Mkfiles/vc9/readme.vc9.txt +++ /dev/null @@ -1,132 +0,0 @@ - -Building YASM with Microsoft Visual Studio 2008 (C/C++ v9) ----------------------------------------------------------- - -This note describes how to build YASM using Microsoft Visual -Studio 2008 (C/C++ v9). It also provides a way of using -these files to build YASM with Visual Studio 2005 (C/C++ v8). - -1. The Compiler ---------------- - -If you want to build the 64-bit version of YASM you will need -to install the Visual Studio 2008 64-bit tools, which may not -be installed by default. - -2. YASM Download ----------------- - -First YASM needs to be downloaded and the files placed within -a suitable directory, which will be called here but can -be named and located as you wish. - -3. Building YASM with Microsoft VC9 ------------------------------------ - -Now locate and double click on the yasm.sln solution file in -the 'Mkfiles/vc9' subdirectory to open the build project in -the Visual Studio 2008 IDE and then select: - - win32 or x64 build - release or debug build - -as appropriate to build the YASM binaries that you need. - -4. Using YASM with Visual Sudio 2008 and VC++ version 9 -------------------------------------------------------- - -1. Firstly you need to locate the directory (or directories) -where the VC++ compiler binaries are located and put copies -of the appropriate yasm.exe binary in these directories. A -typical location is: - -C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin - -Depending on your system you can use either the win32 or the -x64 version of YASM. - -2. To use the new custom tools facility in Visual Studio 2008, -you need to place a copy of the yasm.rules file in the Visual -Studio 2008 VC project defaults directory, which is typically -located at: - -C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC - \VCProjectDefaults - -This allows you to configure YASM as an assembler within the VC++ -IDE. To use YASM in a project, right click on the project in the -Solution Explorer and select 'Custom Build Rules..'. This will -give you a dialog box that allows you to select YASM as an -assembler (note that your assembler files need to have the -extension '.asm'). - -To assemble a file with YASM, select the Property Page for the -file and the select 'Yasm Assembler' in the Tool dialog entry. -Then click 'Apply' and an additional property page entry will -appear and enable YASM settings to be established. - -As alternative to placing the yasm.rules files as described -above is to set the rules file path in the Visual Studio 2008 -settings dialogue. - -5. A Linker Issue ------------------ - -There appears to be a linker bug in the VC++ v9 linker that -prevents symbols with absolute addresses being linked in DLL -builds. This means, for example, that LEA instructions of -the general form: - - lea, rax,[rax+symbol] - -cannot be used for DLL builds. The following general form -has to be used instead: - - lea rcx,[symbol wrt rip] - lea rax,[rax+rcx] - -This limitation may also cause problems with other instruction -that use absolute addresses. - -6. Building with Visual Studio 2005 ------------------------------------ - -The Python program vc98_swap.py will convert VC9 build projects -into those needed for Visual Studio 2005 (VC8). It will also -convert files that have been converted in this way back into their -original form. It does this conversion by looking for *.vcproj -and *.sln files in the current working directory and its sub-directories and changing the following line in each *.vcproj -file: - - Version="9.00" - -to: - - Version="8.00" - -or vice versa. - -The lines - - Microsoft Visual Studio Solution File, Format Version 10.00 - # Visual Studio 2008 - -in *.sln files are changed to: - - Microsoft Visual Studio Solution File, Format Version 9.00 - # Visual Studio 2005 - -or vice versa. - -Because it acts recursively on all sub-directories of this -directory it is important not to run it at a directory level -in which not all projects are to be converted. - -7. Acknowledgements -------------------- - -I am most grateful for the fantastic support that Peter Johnson, -YASM's creator, has given me in tracking down issues in using -YASM for the production of Windows x64 code. - - Brian Gladman, 10th October 2008 diff --git a/Mkfiles/vc9/vc98_swap.py b/Mkfiles/vc9/vc98_swap.py deleted file mode 100644 index d5237a2f..00000000 --- a/Mkfiles/vc9/vc98_swap.py +++ /dev/null @@ -1,52 +0,0 @@ - -# Convert between Visual Studio 2008 and 2005 Project Files -# (with thanks to Tommi Vainikainen) - -l05 = "# Visual Studio 2005\n" -l08 = "# Visual Studio 2008\n" -l09 = "Microsoft Visual Studio Solution File, Format Version 9.00\n" -l10 = "Microsoft Visual Studio Solution File, Format Version 10.00\n" - -import os, shutil, string, fileinput, sys - -def vcproj_convert(sp) : - for l in fileinput.input(sp, inplace = 1) : - p8 = l.find("Version=\"8.00\"") - p9 = l.find("Version=\"9.00\"") - if p8 != -1 or p9 != -1 : - if p8 != -1 : - l = l[ : p8 + 9] + '9' + l[ p8 + 10 : ] - else : - l = l[ : p9 + 9] + '8' + l[ p9 + 10 : ] - sys.stdout.write(l) - -def sln_convert(sp) : - cnt = 0 - for l in fileinput.input(sp, inplace = 1) : - cnt = cnt + 1 - if cnt < 3 : - p09 = l.find(l09) - p10 = l.find(l10) - if p09 != -1 or p10 != -1 : - if p09 != -1 : - l = l10 - else : - l = l09 - p05 = l.find(l05) - p08 = l.find(l08) - if p05 != -1 or p08 != -1 : - if p05 != -1 : - l = l08 - else : - l = l05 - sys.stdout.write(l) - -if os.getcwd().endswith('Mkfiles\\vc9') : - for root, dirs, files in os.walk("./") : - for file in files : - if file.endswith(".sln") : - sln_convert(os.path.join(root, file)) - if file.endswith(".vcproj") : - vcproj_convert(os.path.join(root, file)) -else : - print "This script must be run in the 'Mkfiles\vc9' directory" diff --git a/Mkfiles/vc9/vsyasm.vcproj b/Mkfiles/vc9/vsyasm.vcproj deleted file mode 100644 index 215d8edd..00000000 --- a/Mkfiles/vc9/vsyasm.vcproj +++ /dev/null @@ -1,406 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Mkfiles/vc9/yasm.rules b/Mkfiles/vc9/yasm.rules deleted file mode 100644 index 2514ae0a..00000000 --- a/Mkfiles/vc9/yasm.rules +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Mkfiles/vc9/yasm.sln b/Mkfiles/vc9/yasm.sln deleted file mode 100644 index e74fc823..00000000 --- a/Mkfiles/vc9/yasm.sln +++ /dev/null @@ -1,157 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{825AC694-358C-4D8D-92DE-33A2691978CE}" - ProjectSection(SolutionItems) = preProject - crt_secure_no_deprecate.vsprops = crt_secure_no_deprecate.vsprops - readme.vc8.txt = readme.vc8.txt - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libyasm", "libyasm\libyasm.vcproj", "{29FE7874-1256-4AD6-B889-68E399DC9608}" - ProjectSection(ProjectDependencies) = postProject - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0} = {F0E8B707-00C5-4FF2-B8EF-7C39817132A0} - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2} = {B545983B-8EE0-4A7B-A67A-E749EEAE62A2} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "modules", "modules\modules.vcproj", "{D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}" - ProjectSection(ProjectDependencies) = postProject - {3C58BE13-50A3-4583-984D-D8902B3D7713} = {3C58BE13-50A3-4583-984D-D8902B3D7713} - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619} = {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619} - {29FE7874-1256-4AD6-B889-68E399DC9608} = {29FE7874-1256-4AD6-B889-68E399DC9608} - {225700A5-07B8-434E-AD61-555278BF6733} = {225700A5-07B8-434E-AD61-555278BF6733} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yasm", "yasm.vcproj", "{34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}" - ProjectSection(ProjectDependencies) = postProject - {021CEB0A-F721-4F59-B349-9CEEAF244459} = {021CEB0A-F721-4F59-B349-9CEEAF244459} - {29FE7874-1256-4AD6-B889-68E399DC9608} = {29FE7874-1256-4AD6-B889-68E399DC9608} - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6} = {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genmacro", "genmacro\genmacro.vcproj", "{225700A5-07B8-434E-AD61-555278BF6733}" - ProjectSection(ProjectDependencies) = postProject - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2} = {B545983B-8EE0-4A7B-A67A-E749EEAE62A2} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genversion", "genversion\genversion.vcproj", "{B545983B-8EE0-4A7B-A67A-E749EEAE62A2}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "re2c", "re2c\re2c.vcproj", "{3C58BE13-50A3-4583-984D-D8902B3D7713}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genperf", "genperf\genperf.vcproj", "{C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genmodule", "genmodule\genmodule.vcproj", "{F0E8B707-00C5-4FF2-B8EF-7C39817132A0}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genstring", "genstring\genstring.vcproj", "{021CEB0A-F721-4F59-B349-9CEEAF244459}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ytasm", "ytasm.vcproj", "{2162937B-0DBD-4450-B45F-DF578D8E7508}" - ProjectSection(ProjectDependencies) = postProject - {29FE7874-1256-4AD6-B889-68E399DC9608} = {29FE7874-1256-4AD6-B889-68E399DC9608} - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6} = {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vsyasm", "vsyasm.vcproj", "{7FDD85BB-CC86-442B-A425-989B5B296ED5}" - ProjectSection(ProjectDependencies) = postProject - {29FE7874-1256-4AD6-B889-68E399DC9608} = {29FE7874-1256-4AD6-B889-68E399DC9608} - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6} = {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6} - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|Win32.ActiveCfg = Debug|Win32 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|Win32.Build.0 = Debug|Win32 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|x64.ActiveCfg = Debug|x64 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|x64.Build.0 = Debug|x64 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|Win32.ActiveCfg = Release|Win32 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|Win32.Build.0 = Release|Win32 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|x64.ActiveCfg = Release|x64 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|x64.Build.0 = Release|x64 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|Win32.ActiveCfg = Debug|Win32 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|Win32.Build.0 = Debug|Win32 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|x64.ActiveCfg = Debug|x64 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|x64.Build.0 = Debug|x64 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|Win32.ActiveCfg = Release|Win32 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|Win32.Build.0 = Release|Win32 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|x64.ActiveCfg = Release|x64 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|x64.Build.0 = Release|x64 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|Win32.ActiveCfg = Debug|Win32 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|Win32.Build.0 = Debug|Win32 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|x64.ActiveCfg = Debug|x64 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|x64.Build.0 = Debug|x64 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|Win32.ActiveCfg = Release|Win32 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|Win32.Build.0 = Release|Win32 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|x64.ActiveCfg = Release|x64 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|x64.Build.0 = Release|x64 - {225700A5-07B8-434E-AD61-555278BF6733}.Debug|Win32.ActiveCfg = Debug|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Debug|Win32.Build.0 = Debug|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Debug|x64.ActiveCfg = Debug|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Debug|x64.Build.0 = Debug|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Release|Win32.ActiveCfg = Release|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Release|Win32.Build.0 = Release|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Release|x64.ActiveCfg = Release|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Release|x64.Build.0 = Release|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|Win32.ActiveCfg = Debug|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|Win32.Build.0 = Debug|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|x64.ActiveCfg = Debug|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|x64.Build.0 = Debug|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|Win32.ActiveCfg = Release|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|Win32.Build.0 = Release|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|x64.ActiveCfg = Release|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|x64.Build.0 = Release|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|Win32.ActiveCfg = Debug|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|Win32.Build.0 = Debug|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|x64.ActiveCfg = Debug|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|x64.Build.0 = Debug|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|Win32.ActiveCfg = Release|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|Win32.Build.0 = Release|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|x64.ActiveCfg = Release|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|x64.Build.0 = Release|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|Win32.ActiveCfg = Debug|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|Win32.Build.0 = Debug|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|x64.ActiveCfg = Debug|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|x64.Build.0 = Debug|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|Win32.ActiveCfg = Release|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|Win32.Build.0 = Release|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|x64.ActiveCfg = Release|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|x64.Build.0 = Release|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|Win32.ActiveCfg = Debug|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|Win32.Build.0 = Debug|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|x64.ActiveCfg = Debug|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|x64.Build.0 = Debug|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|Win32.ActiveCfg = Release|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|Win32.Build.0 = Release|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|x64.ActiveCfg = Release|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|x64.Build.0 = Release|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|Win32.ActiveCfg = Debug|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|Win32.Build.0 = Debug|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|x64.ActiveCfg = Debug|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|x64.Build.0 = Debug|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|Win32.ActiveCfg = Release|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|Win32.Build.0 = Release|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|x64.ActiveCfg = Release|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|x64.Build.0 = Release|Win32 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|Win32.ActiveCfg = Debug|Win32 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|Win32.Build.0 = Debug|Win32 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|x64.ActiveCfg = Debug|x64 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|x64.Build.0 = Debug|x64 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|Win32.ActiveCfg = Release|Win32 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|Win32.Build.0 = Release|Win32 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|x64.ActiveCfg = Release|x64 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|x64.Build.0 = Release|x64 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|Win32.ActiveCfg = Debug|Win32 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|Win32.Build.0 = Debug|Win32 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|x64.ActiveCfg = Debug|x64 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|x64.Build.0 = Debug|x64 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|Win32.ActiveCfg = Release|Win32 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|Win32.Build.0 = Release|Win32 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|x64.ActiveCfg = Release|x64 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/Mkfiles/vc9/yasm.vcproj b/Mkfiles/vc9/yasm.vcproj deleted file mode 100644 index ad472444..00000000 --- a/Mkfiles/vc9/yasm.vcproj +++ /dev/null @@ -1,410 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Mkfiles/vc9/ytasm.vcproj b/Mkfiles/vc9/ytasm.vcproj deleted file mode 100644 index b638a40f..00000000 --- a/Mkfiles/vc9/ytasm.vcproj +++ /dev/null @@ -1,410 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Mkfiles/vs/config.h b/Mkfiles/vs/config.h deleted file mode 100644 index 8515ac5a..00000000 --- a/Mkfiles/vs/config.h +++ /dev/null @@ -1,170 +0,0 @@ -#include "YASM-VERSION.h" -#define yasm__splitpath(path, tail) yasm__splitpath_win(path, tail) -#define yasm__abspath(path) yasm__abspath_win(path) -#define yasm__combpath(from, to) yasm__combpath_win(from, to) - -/* Command name to run C preprocessor */ -#define CPP_PROG "cpp" - -/* */ -/* #undef ENABLE_NLS */ - -/* Define if you have the `abort' function. */ -#define HAVE_ABORT 1 - -/* */ -/* #undef HAVE_CATGETS */ - -/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the - CoreFoundation framework. */ -/* #undef HAVE_CFLOCALECOPYCURRENT */ - -/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in - the CoreFoundation framework. */ -/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ - -/* Define if the GNU dcgettext() function is already present or preinstalled. - */ -/* #undef HAVE_DCGETTEXT */ - -/* Define to 1 if you have the header file. */ -#define HAVE_DIRECT_H 1 - -/* Define to 1 if you have the `getcwd' function. */ -#define HAVE_GETCWD 1 - -/* */ -/* #undef HAVE_GETTEXT */ - -/* Define if you have the GNU C Library */ -/* #undef HAVE_GNU_C_LIBRARY */ - -/* Define if you have the iconv() function. */ -/* #undef HAVE_ICONV */ - -/* Define if you have the header file. */ -/* #undef HAVE_INTTYPES_H */ - -/* */ -/* #undef HAVE_LC_MESSAGES */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_LIBGEN_H */ - -/* Define if you have the header file. */ -/* #undef HAVE_MEMORY_H */ - -/* Define if you have the `mergesort' function. */ -/* #undef HAVE_MERGESORT */ - -/* Define to 1 if you have the `popen' function. */ -/* #undef HAVE_POPEN */ - -/* Define if you have the header file. */ -/* #undef HAVE_STDINT_H */ - -/* Define if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* */ -/* #undef HAVE_STPCPY */ - -/* Define if you have the `strcasecmp' function. */ -/* #undef HAVE_STRCASECMP */ - -/* Define if you have the `strcmpi' function. */ -/* #undef HAVE_STRCMPI */ - -/* Define if you have the `stricmp' function. */ -/* #undefine HAVE_STRICMP */ - -/* Define if you have the header file. */ -/* #undef HAVE_STRINGS_H */ - -/* Define if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define if you have the `strncasecmp' function. */ -/* #undef HAVE_STRNCASECMP */ - -/* Define if you have the `strsep' function. */ -/* #undef HAVE_STRSEP */ - -/* Define if you have the header file. */ -/* #undef HAVE_SYS_STAT_H */ - -/* Define if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define if you have the `toascii' function. */ -#define HAVE_TOASCII 1 -#define toascii __toascii - -/* Define if you have the header file. */ -/* #undef HAVE_UNISTD_H */ - -/* Define to 1 if you have the `vsnprintf' function. */ -/* #undef HAVE_VSNPRINTF */ - -/* Define to 1 if you have the `_stricmp' function. */ -#define HAVE__STRICMP 1 - -/* Name of package */ -#define PACKAGE "yasm" - -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "bug-yasm@tortall.net" - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "yasm" - -/* Define to the full name and version of this package. */ -/*#define PACKAGE_STRING "yasm HEAD"*/ - -/* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "yasm" - -/* Define to the version of this package. */ -/*#define PACKAGE_VERSION "HEAD"*/ - -/* Define if the C compiler supports function prototypes. */ -#define PROTOTYPES 1 - -/* The size of a `char', as computed by sizeof. */ -/* #undef SIZEOF_CHAR */ - -/* The size of a `int', as computed by sizeof. */ -/* #undef SIZEOF_INT */ - -/* The size of a `long', as computed by sizeof. */ -/* #undef SIZEOF_LONG */ - -/* The size of a `short', as computed by sizeof. */ -/* #undef SIZEOF_SHORT */ - -/* The size of a `void*', as computed by sizeof. */ -/* #undef SIZEOF_VOIDP */ - -/* Define if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Version number of package */ -#define VERSION "HEAD" - -/* Define if using the dmalloc debugging malloc package */ -/* #undef WITH_DMALLOC */ - -/* Define like PROTOTYPES; this can be used by system headers. */ -#define __PROTOTYPES 1 - -/* Define to empty if `const' does not conform to ANSI C. */ -/* #undef const */ - -/* Define as `__inline' if that's what the C compiler calls it, or to nothing - if it is not supported. */ -#ifndef __cplusplus -/* #undef inline */ -#endif - -/* Define to `unsigned' if doesn't define. */ -/* #undef size_t */ diff --git a/Mkfiles/vs/crt_secure_no_deprecate.props b/Mkfiles/vs/crt_secure_no_deprecate.props deleted file mode 100644 index 777d6d0a..00000000 --- a/Mkfiles/vs/crt_secure_no_deprecate.props +++ /dev/null @@ -1,11 +0,0 @@ - - - - <_ProjectFileVersion>10.0.21006.1 - - - - _CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - - - \ No newline at end of file diff --git a/Mkfiles/vs/crt_secure_no_deprecate.vsprops b/Mkfiles/vs/crt_secure_no_deprecate.vsprops deleted file mode 100644 index 56ab506f..00000000 --- a/Mkfiles/vs/crt_secure_no_deprecate.vsprops +++ /dev/null @@ -1,11 +0,0 @@ - - - - diff --git a/Mkfiles/vs/genmacro/genmacro.vcxproj b/Mkfiles/vs/genmacro/genmacro.vcxproj deleted file mode 100644 index 3ecedc7c..00000000 --- a/Mkfiles/vs/genmacro/genmacro.vcxproj +++ /dev/null @@ -1,203 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {225700A5-07B8-434E-AD61-555278BF6733} - genmacro - Win32Proj - 10.0 - - - - Application - MultiByte - v143 - - - Application - MultiByte - v143 - - - Application - MultiByte - v143 - - - Application - MultiByte - v143 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - - - - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - Level3 - ProgramDatabase - Default - - - $(OutDir)genmacro.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX86 - - - run.bat "$(TargetPath)" - - - - - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - Level3 - ProgramDatabase - Default - - - $(OutDir)genmacro.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - - - run.bat "$(TargetPath)" - - - - - Full - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreaded - - - $(IntDir) - Level3 - Default - - - $(OutDir)genmacro.exe - $(OutDir)$(TargetName).pdb - Console - true - true - false - - - MachineX86 - - - run.bat "$(TargetPath)" - - - - - Full - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreaded - - - $(IntDir) - Level3 - Default - - - $(OutDir)genmacro.exe - $(OutDir)$(TargetName).pdb - Console - true - true - false - - - - - run.bat "$(TargetPath)" - - - - - - - - - - - {b545983b-8ee0-4a7b-a67a-e749eeae62a2} - false - - - - - - \ No newline at end of file diff --git a/Mkfiles/vs/genmacro/genmacro.vcxproj.filters b/Mkfiles/vs/genmacro/genmacro.vcxproj.filters deleted file mode 100644 index 402cf1b4..00000000 --- a/Mkfiles/vs/genmacro/genmacro.vcxproj.filters +++ /dev/null @@ -1,17 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx - - - - - Source Files - - - - - - \ No newline at end of file diff --git a/Mkfiles/vs/genmacro/run.bat b/Mkfiles/vs/genmacro/run.bat deleted file mode 100644 index 98c337ac..00000000 --- a/Mkfiles/vs/genmacro/run.bat +++ /dev/null @@ -1,5 +0,0 @@ -cd ..\..\.. -%1 nasm-version.c nasm_version_mac version.mac -%1 nasm-macros.c nasm_standard_mac modules\parsers\nasm\nasm-std.mac -%1 win64-nasm.c win64_nasm_stdmac modules\objfmts\coff\win64-nasm.mac -%1 win64-gas.c win64_gas_stdmac modules\objfmts\coff\win64-gas.mac diff --git a/Mkfiles/vs/genmodule/genmodule.vcxproj b/Mkfiles/vs/genmodule/genmodule.vcxproj deleted file mode 100644 index 9a8459cd..00000000 --- a/Mkfiles/vs/genmodule/genmodule.vcxproj +++ /dev/null @@ -1,208 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0} - genmodule - Win32Proj - 10.0 - - - - Application - MultiByte - v143 - - - Application - MultiByte - v143 - - - Application - MultiByte - v143 - - - Application - MultiByte - v143 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - - - - Disabled - %(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;FILTERMODE;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - $(IntDir) - Level3 - ProgramDatabase - Default - - - $(OutDir)genmodule.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX86 - - - run.bat "$(TargetPath)" - - - - - Disabled - %(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;FILTERMODE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - $(IntDir) - Level3 - ProgramDatabase - Default - - - $(OutDir)genmodule.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - - - run.bat "$(TargetPath)" - - - - - Full - %(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;FILTERMODE;%(PreprocessorDefinitions) - MultiThreaded - - - $(IntDir) - $(IntDir) - Level3 - Default - - - $(OutDir)genmodule.exe - $(OutDir)$(TargetName).pdb - Console - true - true - false - - - MachineX86 - - - run.bat "$(TargetPath)" - - - - - Full - %(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;FILTERMODE;%(PreprocessorDefinitions) - MultiThreaded - - - $(IntDir) - $(IntDir) - Level3 - Default - - - $(OutDir)genmodule.exe - $(OutDir)$(TargetName).pdb - Console - true - true - false - - - - - run.bat "$(TargetPath)" - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Mkfiles/vs/genmodule/genmodule.vcxproj.filters b/Mkfiles/vs/genmodule/genmodule.vcxproj.filters deleted file mode 100644 index d3255c29..00000000 --- a/Mkfiles/vs/genmodule/genmodule.vcxproj.filters +++ /dev/null @@ -1,20 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx - - - - - Source Files - - - - - - - - - \ No newline at end of file diff --git a/Mkfiles/vs/genmodule/run.bat b/Mkfiles/vs/genmodule/run.bat deleted file mode 100644 index 00055692..00000000 --- a/Mkfiles/vs/genmodule/run.bat +++ /dev/null @@ -1,3 +0,0 @@ -@echo off -cd ..\..\.. -%1 libyasm\module.in Makefile.am diff --git a/Mkfiles/vs/genperf/genperf.vcxproj b/Mkfiles/vs/genperf/genperf.vcxproj deleted file mode 100644 index 8f193269..00000000 --- a/Mkfiles/vs/genperf/genperf.vcxproj +++ /dev/null @@ -1,262 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619} - genperf - Win32Proj - 10.0 - - - - Application - MultiByte - v143 - - - Application - MultiByte - v143 - - - Application - MultiByte - v143 - - - Application - MultiByte - v143 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - false - false - false - false - - - - - - - - Disabled - ..;../../..;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;STDC_HEADERS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - Level3 - ProgramDatabase - Default - - - $(OutDir)genperf.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX86 - - - - - - - run.bat "$(TargetPath)" - - - x86insn_nasm.c;x86insn_gas.c;x86cpu.c;x86regtmod.c;%(Outputs) - - - run.bat "$(TargetPath)" - - - - - Disabled - ..;../../..;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;STDC_HEADERS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - Level3 - ProgramDatabase - Default - - - $(OutDir)genperf.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - - - - - - - run.bat "$(TargetPath)" - - - x86insn_nasm.c;x86insn_gas.c;x86cpu.c;x86regtmod.c;%(Outputs) - - - run.bat "$(TargetPath)" - - - - - Full - ..;../../..;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;STDC_HEADERS;%(PreprocessorDefinitions) - MultiThreaded - - - $(IntDir) - Level3 - Default - - - $(OutDir)genperf.exe - $(OutDir)$(TargetName).pdb - Console - true - true - false - - - MachineX86 - - - - - - - run.bat "$(TargetPath)" - - - x86insn_nasm.c;x86insn_gas.c;x86cpu.c;x86regtmod.c;%(Outputs) - - - run.bat "$(TargetPath)" - - - - - Full - ..;../../..;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;STDC_HEADERS;%(PreprocessorDefinitions) - MultiThreaded - - - $(IntDir) - Level3 - Default - - - $(OutDir)genperf.exe - $(OutDir)$(TargetName).pdb - Console - true - true - false - - - - - - - - - run.bat "$(TargetPath)" - - - x86insn_nasm.c;x86insn_gas.c;x86cpu.c;x86regtmod.c;%(Outputs) - - - run.bat "$(TargetPath)" - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Mkfiles/vs/genperf/genperf.vcxproj.filters b/Mkfiles/vs/genperf/genperf.vcxproj.filters deleted file mode 100644 index 3124b5d7..00000000 --- a/Mkfiles/vs/genperf/genperf.vcxproj.filters +++ /dev/null @@ -1,56 +0,0 @@ - - - - - {3C1E9AA8-6338-4CED-99F1-BEBA80607BD5} - h;hpp;hxx;hm;inl;inc;xsd - - - {1062695D-1C50-4068-8313-73A409885BC1} - cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - - \ No newline at end of file diff --git a/Mkfiles/vs/genperf/run.bat b/Mkfiles/vs/genperf/run.bat deleted file mode 100644 index c6f83543..00000000 --- a/Mkfiles/vs/genperf/run.bat +++ /dev/null @@ -1,40 +0,0 @@ -cd ..\..\.. -@echo off - -for /f "usebackq tokens=1*" %%f in (`reg query HKCR\Applications\python.exe\shell\open\command 2^>NUL`) do (set _my_=%%f %%g) -goto try1%errorlevel% - -:try10 -goto ok - -:try11 -for /f "usebackq tokens=1*" %%f in (`reg query HKCR\Python.File\shell\open\command 2^>NUL`) do (set _my_=%%f %%g) -goto try2%errorlevel% - -:try20: -goto ok - -:try21: -echo Building without Python ... -goto therest - -:ok -echo Building with Python ... -set _res_=%_my_:*REG_SZ=% -set _end_=%_res_:*exe"=% -call set _python_=%%_res_:%_end_%=%% -echo %_python_% -call %_python_% modules\arch\x86\gen_x86_insn.py - -:therest -@echo on -call :update %1 x86insn_nasm.gperf x86insn_nasm.c -call :update %1 x86insn_gas.gperf x86insn_gas.c -call :update %1 modules\arch\x86\x86cpu.gperf x86cpu.c -call :update %1 modules\arch\x86\x86regtmod.gperf x86regtmod.c -goto :eof - -:update -%1 %2 tf -call mkfiles\vc14\out_copy_rename tf .\ %3 -del tf diff --git a/Mkfiles/vs/genstring/genstring.vcxproj b/Mkfiles/vs/genstring/genstring.vcxproj deleted file mode 100644 index 8745dd9d..00000000 --- a/Mkfiles/vs/genstring/genstring.vcxproj +++ /dev/null @@ -1,197 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {021CEB0A-F721-4F59-B349-9CEEAF244459} - genstring - Win32Proj - 10.0 - - - - Application - MultiByte - v143 - - - Application - MultiByte - v143 - - - Application - MultiByte - v143 - - - Application - MultiByte - v143 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - - - - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - Level3 - ProgramDatabase - Default - - - $(OutDir)genstring.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX86 - - - run.bat "$(TargetPath)" - - - - - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - Level3 - ProgramDatabase - Default - - - $(OutDir)genstring.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - - - run.bat "$(TargetPath)" - - - - - Full - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreaded - - - $(IntDir) - Level3 - Default - - - $(OutDir)genstring.exe - $(OutDir)$(TargetName).pdb - Console - true - true - false - - - MachineX86 - - - run.bat "$(TargetPath)" - - - - - Full - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreaded - - - $(IntDir) - Level3 - Default - - - $(OutDir)genstring.exe - $(OutDir)$(TargetName).pdb - Console - true - true - false - - - - - run.bat "$(TargetPath)" - - - - - - - - - - - - \ No newline at end of file diff --git a/Mkfiles/vs/genstring/genstring.vcxproj.filters b/Mkfiles/vs/genstring/genstring.vcxproj.filters deleted file mode 100644 index 04ed411d..00000000 --- a/Mkfiles/vs/genstring/genstring.vcxproj.filters +++ /dev/null @@ -1,17 +0,0 @@ - - - - - {28EBE11C-5BE8-4935-9381-F57696749E0C} - cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx - - - - - Source Files - - - - - - \ No newline at end of file diff --git a/Mkfiles/vs/genstring/run.bat b/Mkfiles/vs/genstring/run.bat deleted file mode 100644 index baedcecb..00000000 --- a/Mkfiles/vs/genstring/run.bat +++ /dev/null @@ -1,2 +0,0 @@ -cd ..\..\.. -%1 license_msg license.c COPYING diff --git a/Mkfiles/vs/genversion/genversion.vcxproj b/Mkfiles/vs/genversion/genversion.vcxproj deleted file mode 100644 index 7adf9c7f..00000000 --- a/Mkfiles/vs/genversion/genversion.vcxproj +++ /dev/null @@ -1,224 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2} - genversion - Win32Proj - 10.0 - - - - Application - MultiByte - v143 - - - Application - MultiByte - v143 - - - Application - MultiByte - v143 - - - Application - MultiByte - v143 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - - - - Disabled - ..\..\vc10;..\..\..\;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - Level3 - ProgramDatabase - Default - - - $(OutDir)genversion.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX86 - - - run.bat "$(TargetPath)" - - - cd ..\..\..\ -YASM-VERSION-GEN.bat - - - - - - Disabled - ..\..\vc10;..\..\..\;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - Level3 - ProgramDatabase - Default - - - $(OutDir)genversion.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - - - run.bat "$(TargetPath)" - - - cd ..\..\..\ -YASM-VERSION-GEN.bat - - - - - - Full - ..\..\vc10;..\..\..\;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreaded - - - $(IntDir) - Level3 - Default - - - $(OutDir)genversion.exe - $(OutDir)$(TargetName).pdb - Console - true - true - false - - - MachineX86 - - - run.bat "$(TargetPath)" - - - cd ..\..\..\ -YASM-VERSION-GEN.bat - - - - - - Full - ..\..\vc10;..\..\..\;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreaded - - - $(IntDir) - Level3 - Default - - - $(OutDir)genversion.exe - $(OutDir)$(TargetName).pdb - Console - true - true - false - - - - - run.bat "$(TargetPath)" - - - cd ..\..\..\ -YASM-VERSION-GEN.bat - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Mkfiles/vs/genversion/genversion.vcxproj.filters b/Mkfiles/vs/genversion/genversion.vcxproj.filters deleted file mode 100644 index cc088b12..00000000 --- a/Mkfiles/vs/genversion/genversion.vcxproj.filters +++ /dev/null @@ -1,26 +0,0 @@ - - - - - {2acbec3a-0ed8-4b2e-826e-a84c7d35f205} - h;hpp;hxx;hm;inl - - - {E67ED277-E4F2-4D79-8C9E-962BAC164F3F} - cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx - - - - - Source Files - - - - - Header Files - - - - - - \ No newline at end of file diff --git a/Mkfiles/vs/genversion/run.bat b/Mkfiles/vs/genversion/run.bat deleted file mode 100644 index 41b19cad..00000000 --- a/Mkfiles/vs/genversion/run.bat +++ /dev/null @@ -1,2 +0,0 @@ -cd ..\..\.. -%1 version.mac diff --git a/Mkfiles/vs/genversion/runpre.bat b/Mkfiles/vs/genversion/runpre.bat deleted file mode 100644 index fdd15708..00000000 --- a/Mkfiles/vs/genversion/runpre.bat +++ /dev/null @@ -1,2 +0,0 @@ -cd ..\..\.. -YASM-VERSION-GEN.bat diff --git a/Mkfiles/vs/libyasm-stdint.h b/Mkfiles/vs/libyasm-stdint.h deleted file mode 100644 index b66ab15f..00000000 --- a/Mkfiles/vs/libyasm-stdint.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef _UINTPTR_T_DEFINED -#ifdef _WIN64 -#include -#else -typedef unsigned long uintptr_t; -#endif -#define _UINTPTR_T_DEFINED -#endif diff --git a/Mkfiles/vs/libyasm/libyasm.vcxproj b/Mkfiles/vs/libyasm/libyasm.vcxproj deleted file mode 100644 index f3505f4c..00000000 --- a/Mkfiles/vs/libyasm/libyasm.vcxproj +++ /dev/null @@ -1,278 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {29FE7874-1256-4AD6-B889-68E399DC9608} - libyasm - 10.0 - - - - StaticLibrary - false - MultiByte - v143 - - - StaticLibrary - false - MultiByte - v143 - - - StaticLibrary - false - MultiByte - v143 - - - StaticLibrary - false - MultiByte - v143 - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - - - - Full - Default - ..;../../..;%(AdditionalIncludeDirectories) - NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)libyasm.lib - true - - - - - X64 - - - Full - Default - ..;../../..;%(AdditionalIncludeDirectories) - NDEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)libyasm.lib - true - - - - - Disabled - ..;../../..;%(AdditionalIncludeDirectories) - _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)libyasm.lib - true - - - - - X64 - - - Disabled - ..;../../..;%(AdditionalIncludeDirectories) - _DEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)libyasm.lib - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {f0e8b707-00c5-4ff2-b8ef-7c39817132a0} - false - - - - - - \ No newline at end of file diff --git a/Mkfiles/vs/libyasm/libyasm.vcxproj.filters b/Mkfiles/vs/libyasm/libyasm.vcxproj.filters deleted file mode 100644 index 9bdf13a4..00000000 --- a/Mkfiles/vs/libyasm/libyasm.vcxproj.filters +++ /dev/null @@ -1,200 +0,0 @@ - - - - - {4ca3b698-9d01-4e4e-ae00-5c98da045efe} - h;hpp;hxx;hm;inl - - - {68607062-982d-4251-9a1a-30f76474983d} - cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Source Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - - \ No newline at end of file diff --git a/Mkfiles/vs/modules/modules.vcxproj b/Mkfiles/vs/modules/modules.vcxproj deleted file mode 100644 index e915a491..00000000 --- a/Mkfiles/vs/modules/modules.vcxproj +++ /dev/null @@ -1,325 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6} - modules - 10.0 - - - - StaticLibrary - false - MultiByte - v143 - - - StaticLibrary - false - MultiByte - v143 - - - StaticLibrary - false - MultiByte - v143 - - - StaticLibrary - false - MultiByte - v143 - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - - - - Full - Default - ..;../../..;%(AdditionalIncludeDirectories) - NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)modules.lib - true - - - - - - - - - X64 - - - Full - Default - ..;../../..;%(AdditionalIncludeDirectories) - NDEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)modules.lib - true - - - - - Disabled - ..;../../..;%(AdditionalIncludeDirectories) - _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)modules.lib - true - - - - - X64 - - - Disabled - ..;../../..;%(AdditionalIncludeDirectories) - _DEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)modules.lib - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {225700a5-07b8-434e-ad61-555278bf6733} - false - - - {c45a8b59-8b59-4d5d-a8e8-fb090f8dd619} - false - - - {29fe7874-1256-4ad6-b889-68e399dc9608} - false - - - {3c58be13-50a3-4583-984d-d8902b3d7713} - false - - - - - - \ No newline at end of file diff --git a/Mkfiles/vs/modules/modules.vcxproj.filters b/Mkfiles/vs/modules/modules.vcxproj.filters deleted file mode 100644 index e6ff3add..00000000 --- a/Mkfiles/vs/modules/modules.vcxproj.filters +++ /dev/null @@ -1,256 +0,0 @@ - - - - - {39c89f91-d860-4396-a49f-86b8b7a51c33} - cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - - - {be0cdf28-cbed-4774-b3cc-b63e4e3fa0a9} - - - {491cc60a-889b-4f53-aae9-f4d7d6aa667a} - - - {c084015d-3c3e-4379-8746-ae5cffcec79e} - - - {3333e0b3-e95f-44f6-9000-58d4da368360} - - - {528f2955-ceba-4691-a36c-054f119e3dcc} - - - {81686d52-eb71-4d4a-a830-66c45afb808f} - - - {98fe1e43-3794-4639-bf29-14b0c569754f} - - - {6b3956d4-0bff-4e8e-af61-a7e59b476fa4} - - - {446fad62-ac17-49e9-8263-33481f04f182} - - - {33fb7fc8-61f9-428d-9c94-7a4912fbb678} - - - {48fc77ec-7d78-4c0a-bfc2-9aa76faf5d7f} - - - - - Source Files\parsers - - - Source Files\arch - - - Source Files\arch - - - Source Files\arch - - - Source Files\arch - - - Source Files\arch - - - Source Files\arch - - - Source Files\arch - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\listfmts\nasm - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\parsers - - - Source Files\parsers - - - Source Files\parsers - - - Source Files\parsers - - - Source Files\parsers - - - Source Files\preprocs\cpp - - - Source Files\preprocs\gas - - - Source Files\preprocs\gas - - - Source Files\preprocs\nasm - - - Source Files\preprocs\nasm - - - Source Files\preprocs\nasm - - - Source Files\preprocs\nasm - - - Source Files\preprocs\raw - - - Source Files\parsers - - - Source Files\arch - - - Source Files\arch - - - Source Files\objfmts - - - - - Source Files\arch - - - Source Files\arch - - - Source Files\dbgfmts - - - Source Files\dbgfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\objfmts - - - Source Files\parsers - - - Source Files\parsers - - - Source Files\preprocs\gas - - - Source Files\preprocs\nasm - - - Source Files\preprocs\nasm - - - Source Files\preprocs\nasm - - - Source Files\preprocs\nasm - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Mkfiles/vs/out_copy_rename.bat b/Mkfiles/vs/out_copy_rename.bat deleted file mode 100644 index 3179b59a..00000000 --- a/Mkfiles/vs/out_copy_rename.bat +++ /dev/null @@ -1,42 +0,0 @@ -@echo off -if not exist %1 goto nofile -if exist %2 goto copy - -echo creating directory %2 -md %2 > nul - -:copy -set str=%2 -for /f "useback tokens=*" %%a in ('%str%') do set str=%%~a -set str=%str:~-1% -if %str% == "\" goto hasbackslash - -if not exist %2\%3 goto cpy -fc %1 %2\%3 > nul && if not %errorlevel 1 goto exit -echo overwriting %2\%3 with %1 -copy %1 %2\%3 > nul -goto exit - -:cpy -echo copying %1 to %2\%3 -copy %1 %2\%3 > nul -goto exit - -:hasbackslash -if not exist %2%3 goto cpy2 -fc %1 %2%3 > nul && if not %errorlevel 1 goto exit -echo overwriting %2%3 with %1 -copy %1 %2%3 > nul -goto exit - -:cpy2 -echo copying %1 to %2%3 -copy %1 %2%3 > nul -goto exit - -:nofile -echo %1 not found - -:exit - - diff --git a/Mkfiles/vs/re2c/re2c.vcxproj b/Mkfiles/vs/re2c/re2c.vcxproj deleted file mode 100644 index 51318291..00000000 --- a/Mkfiles/vs/re2c/re2c.vcxproj +++ /dev/null @@ -1,222 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {3C58BE13-50A3-4583-984D-D8902B3D7713} - re2c - Win32Proj - 10.0 - - - - Application - MultiByte - v143 - - - Application - MultiByte - v143 - - - Application - MultiByte - v143 - - - Application - MultiByte - v143 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - - - - Disabled - ..;../../..;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - Level3 - Default - ProgramDatabase - - - $(OutDir)re2c.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX86 - - - run.bat "$(TargetPath)" - - - - - Disabled - ..;../../..;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - $(IntDir) - Level3 - Default - ProgramDatabase - - - $(OutDir)re2c.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - - - run.bat "$(TargetPath)" - - - - - Full - ..;../../..;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreaded - - - $(IntDir) - Level3 - Default - - - $(OutDir)re2c.exe - $(OutDir)$(TargetName).pdb - Console - true - true - false - - - MachineX86 - - - run.bat "$(TargetPath)" - - - - - Full - ..;../../..;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreaded - - - $(IntDir) - Level3 - Default - - - $(OutDir)re2c.exe - $(OutDir)$(TargetName).pdb - Console - true - true - false - - - - - run.bat "$(TargetPath)" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Mkfiles/vs/re2c/re2c.vcxproj.filters b/Mkfiles/vs/re2c/re2c.vcxproj.filters deleted file mode 100644 index da0f935c..00000000 --- a/Mkfiles/vs/re2c/re2c.vcxproj.filters +++ /dev/null @@ -1,80 +0,0 @@ - - - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - - \ No newline at end of file diff --git a/Mkfiles/vs/re2c/run.bat b/Mkfiles/vs/re2c/run.bat deleted file mode 100644 index 6ac571f0..00000000 --- a/Mkfiles/vs/re2c/run.bat +++ /dev/null @@ -1,4 +0,0 @@ -cd ..\..\..\ -%1 -s -o lc3bid.c modules\arch\lc3b\lc3bid.re -%1 -b -o nasm-token.c modules\parsers\nasm\nasm-token.re -%1 -b -o gas-token.c modules\parsers\gas\gas-token.re diff --git a/Mkfiles/vs/readme.vs.txt b/Mkfiles/vs/readme.vs.txt deleted file mode 100644 index 21c70be9..00000000 --- a/Mkfiles/vs/readme.vs.txt +++ /dev/null @@ -1,96 +0,0 @@ -Building YASM with Microsoft Visual Studio ------------------------------------------- - -This note describes how to build YASM using Microsoft Visual -Studio 2019 and later versions. - -1. YASM Download ----------------- - -First YASM needs to be downloaded and the files placed within -a suitable directory, which will be called here but can -be named and located as you wish. - -2. Building YASM ----------------- - -Now locate and double click on the yasm.sln solution file in -the 'Mkfiles/vs' subdirectory to open the build project in -the Visual Studio IDE and then select: - - win32 or x64 build - release or debug build - -as appropriate to build the YASM binaries that you need. - -4. Using YASM with Visual Sudio -------------------------------- - -The YASM version vsyasm.exe is designed specifically for use -with the 2010 and later versions of Visual Studio. To tell -Visual Studio where to find vsyasm.exe, the environment -variable YASMPATH can be set to the absolute path of the -directory in which vsyasm.exe is located (this path should -include the final backslash). - -Alternatively you can find the directory (or directories) -where the VC++ compiler binaries are located and put copies -of the vsyasm.exe binary in these directories. - -Depending on your system you can use either the win32 or the -x64 version of vsyasm.exe, which must be named vsyasm.exe. - -To use the custom tools facility in Visual Studio you need to -place a copy of three files - yasm.props, yasm.targets and -yasm.xml - into a location where they can be found by the -Visual Studio build customisation processes. There are several -ways to do this: - - a. put these files in the MSBUILD customisation directory - - b. put them in a convenient location and set this path in the - 'Build Customisations Search Path' in the Visual Studio - 'Projects and Solutions|VC++ Project Settings' item in - the 'Tools|Options' menu; - - c. put them in a convenient location and set this path in the - 'Build Customisation dialogue (discussed later). - -To use YASM in a project, right click on the project in the Solution -Explorer and select 'Build Customisations..'. This will give you a -dialog box that allows you to select YASM as an assembler (note that -your assembler files need to have the extension '.asm'). If you have -used option c. above, you will need to let the dialogue find them -using the 'Find Existing' button below the dialogue. - -To assemble a file with YASM, select the Property Page for the file -and the select 'Yasm Assembler' in the Tool dialog entry. Then click -'Apply' and an additional property page entry will appear and enable -YASM settings to be established. - -5. A Linker Issue ------------------ - -There appears to be a linker bug in the VC++ linker that prevents -symbols with absolute addresses being linked in DLL builds. This -means, for example, that LEA instructions of the general form: - - lea, rax,[rax+symbol] - -cannot be used for DLL builds. The following general form -has to be used instead: - - lea rcx,[symbol wrt rip] - lea rax,[rax+rcx] - -This limitation may also cause problems with other instruction -that use absolute addresses. - -6. Acknowledgements -------------------- - -I am most grateful for the fantastic support that Peter Johnson, -YASM's creator, has given me in tracking down issues in using -YASM for the production of Windows x64 code. - - Brian Gladman, 16th May 2019 diff --git a/Mkfiles/vs/vsyasm.props b/Mkfiles/vs/vsyasm.props deleted file mode 100644 index 9d5c14fa..00000000 --- a/Mkfiles/vs/vsyasm.props +++ /dev/null @@ -1,27 +0,0 @@ - - - - Midl - CustomBuild - - - _SelectedFiles;$(YASMDependsOn) - - - C:\Program Files\yasm\ - - - - False - $(IntDir)%(FileName).obj - 0 - 0 - "$(YASM_PATH.TrimEnd('\'))"\vsyasm.exe -Xvc -f $(Platform) [AllOptions] [AdditionalOptions] [Inputs] - %(ObjectFile) - Assembling %(Filename)%(Extension) ==> $(IntDir)%(FileName).obj - false - - - diff --git a/Mkfiles/vs/vsyasm.targets b/Mkfiles/vs/vsyasm.targets deleted file mode 100644 index 8f38f2cb..00000000 --- a/Mkfiles/vs/vsyasm.targets +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - _YASM - - - - - - $(ComputeLinkInputsTargets); - ComputeYASMOutput; - - - $(ComputeLibInputsTargets); - ComputeYASMOutput; - - - - - $(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml - - - - - - <_YASMReadTlog - Include="^%(YASM.FullPath);%(YASM.AdditionalDependencies)" - Condition="'%(YASM.ExcludedFromBuild)' != 'true' and '%(YASM.ObjectFile)' != ''"/> - <_YASMWriteTlog - Include="^%(YASM.FullPath);$([MSBuild]::NormalizePath('$(MSBuildProjectDirectory)', '%(YASM.ObjectFile)'))" - Condition="'%(YASM.ExcludedFromBuild)' != 'true' and '%(YASM.ObjectFile)' != ''"/> - - - - - - - - <_YASMReadTlog Remove="@(_YASMReadTlog)" /> - <_YASMWriteTlog Remove="@(_YASMWriteTlog)" /> - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Mkfiles/vs/vsyasm.vcxproj b/Mkfiles/vs/vsyasm.vcxproj deleted file mode 100644 index bd018821..00000000 --- a/Mkfiles/vs/vsyasm.vcxproj +++ /dev/null @@ -1,280 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {7FDD85BB-CC86-442B-A425-989B5B296ED5} - vsyasm - 10.0 - - - - Application - false - MultiByte - v143 - - - Application - false - MultiByte - v143 - - - Application - false - MultiByte - v143 - - - Application - false - MultiByte - v143 - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - - - - $(Platform)\$(Configuration)/yasm.tlb - - - - - Disabled - .;../..;%(AdditionalIncludeDirectories) - _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)vsyasm.exe - true - true - $(OutDir)$(ProjectName).pdb - Console - false - - - MachineX86 - - - - - X64 - $(Platform)\$(Configuration)/yasm.tlb - - - - - Disabled - .;../..;%(AdditionalIncludeDirectories) - _DEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)vsyasm.exe - true - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX64 - - - - - $(Platform)\$(Configuration)/yasm.tlb - - - - - Full - Default - true - .;../..;%(AdditionalIncludeDirectories) - NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)vsyasm.exe - true - true - $(OutDir)$(ProjectName).pdb - Console - false - - - MachineX86 - - - - - X64 - $(Platform)\$(Configuration)/yasm.tlb - - - - - Full - OnlyExplicitInline - .;../..;%(AdditionalIncludeDirectories) - NDEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)vsyasm.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX64 - true - - - - - - - - - {29fe7874-1256-4ad6-b889-68e399dc9608} - false - - - {d715a3d4-efaa-442e-ad8b-5b4ff64e1dd6} - false - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Mkfiles/vs/vsyasm.xml b/Mkfiles/vs/vsyasm.xml deleted file mode 100644 index a108f005..00000000 --- a/Mkfiles/vs/vsyasm.xml +++ /dev/null @@ -1,283 +0,0 @@ - - - - - - - - - - - - - General - - - - - - Symbols - - - - - - Files - - - - - - Command Line - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Execute Before - - - Specifies the targets for the build customization to run before. - - - - - - - - - - - - Execute After - - - Specifies the targets for the build customization to run after. - - - - - - - - - - - - - - - - - - Additional Options - - - Additional Options - - - - - - - - \ No newline at end of file diff --git a/Mkfiles/vs/yasm.sln b/Mkfiles/vs/yasm.sln deleted file mode 100644 index 8d3b03a4..00000000 --- a/Mkfiles/vs/yasm.sln +++ /dev/null @@ -1,145 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30320.27 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{825AC694-358C-4D8D-92DE-33A2691978CE}" - ProjectSection(SolutionItems) = preProject - crt_secure_no_deprecate.vsprops = crt_secure_no_deprecate.vsprops - readme.vs.txt = readme.vs.txt - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libyasm", "libyasm\libyasm.vcxproj", "{29FE7874-1256-4AD6-B889-68E399DC9608}" - ProjectSection(ProjectDependencies) = postProject - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2} = {B545983B-8EE0-4A7B-A67A-E749EEAE62A2} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "modules", "modules\modules.vcxproj", "{D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yasm", "yasm.vcxproj", "{34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genmacro", "genmacro\genmacro.vcxproj", "{225700A5-07B8-434E-AD61-555278BF6733}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genversion", "genversion\genversion.vcxproj", "{B545983B-8EE0-4A7B-A67A-E749EEAE62A2}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "re2c", "re2c\re2c.vcxproj", "{3C58BE13-50A3-4583-984D-D8902B3D7713}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genperf", "genperf\genperf.vcxproj", "{C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genmodule", "genmodule\genmodule.vcxproj", "{F0E8B707-00C5-4FF2-B8EF-7C39817132A0}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genstring", "genstring\genstring.vcxproj", "{021CEB0A-F721-4F59-B349-9CEEAF244459}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ytasm", "ytasm.vcxproj", "{2162937B-0DBD-4450-B45F-DF578D8E7508}" - ProjectSection(ProjectDependencies) = postProject - {021CEB0A-F721-4F59-B349-9CEEAF244459} = {021CEB0A-F721-4F59-B349-9CEEAF244459} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vsyasm", "vsyasm.vcxproj", "{7FDD85BB-CC86-442B-A425-989B5B296ED5}" - ProjectSection(ProjectDependencies) = postProject - {021CEB0A-F721-4F59-B349-9CEEAF244459} = {021CEB0A-F721-4F59-B349-9CEEAF244459} - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|Win32.ActiveCfg = Debug|Win32 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|Win32.Build.0 = Debug|Win32 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|x64.ActiveCfg = Debug|x64 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|x64.Build.0 = Debug|x64 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|Win32.ActiveCfg = Release|Win32 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|Win32.Build.0 = Release|Win32 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|x64.ActiveCfg = Release|x64 - {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|x64.Build.0 = Release|x64 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|Win32.ActiveCfg = Debug|Win32 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|Win32.Build.0 = Debug|Win32 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|x64.ActiveCfg = Debug|x64 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|x64.Build.0 = Debug|x64 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|Win32.ActiveCfg = Release|Win32 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|Win32.Build.0 = Release|Win32 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|x64.ActiveCfg = Release|x64 - {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|x64.Build.0 = Release|x64 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|Win32.ActiveCfg = Debug|Win32 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|Win32.Build.0 = Debug|Win32 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|x64.ActiveCfg = Debug|x64 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|x64.Build.0 = Debug|x64 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|Win32.ActiveCfg = Release|Win32 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|Win32.Build.0 = Release|Win32 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|x64.ActiveCfg = Release|x64 - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|x64.Build.0 = Release|x64 - {225700A5-07B8-434E-AD61-555278BF6733}.Debug|Win32.ActiveCfg = Debug|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Debug|Win32.Build.0 = Debug|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Debug|x64.ActiveCfg = Debug|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Debug|x64.Build.0 = Debug|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Release|Win32.ActiveCfg = Release|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Release|Win32.Build.0 = Release|Win32 - {225700A5-07B8-434E-AD61-555278BF6733}.Release|x64.ActiveCfg = Release|x64 - {225700A5-07B8-434E-AD61-555278BF6733}.Release|x64.Build.0 = Release|x64 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|Win32.ActiveCfg = Debug|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|Win32.Build.0 = Debug|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|x64.ActiveCfg = Debug|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|x64.Build.0 = Debug|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|Win32.ActiveCfg = Release|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|Win32.Build.0 = Release|Win32 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|x64.ActiveCfg = Release|x64 - {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|x64.Build.0 = Release|x64 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|Win32.ActiveCfg = Debug|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|Win32.Build.0 = Debug|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|x64.ActiveCfg = Debug|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|x64.Build.0 = Debug|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|Win32.ActiveCfg = Release|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|Win32.Build.0 = Release|Win32 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|x64.ActiveCfg = Release|x64 - {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|x64.Build.0 = Release|x64 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|Win32.ActiveCfg = Debug|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|Win32.Build.0 = Debug|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|x64.ActiveCfg = Debug|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|x64.Build.0 = Debug|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|Win32.ActiveCfg = Release|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|Win32.Build.0 = Release|Win32 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|x64.ActiveCfg = Release|x64 - {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|x64.Build.0 = Release|x64 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|Win32.ActiveCfg = Debug|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|Win32.Build.0 = Debug|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|x64.ActiveCfg = Debug|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|x64.Build.0 = Debug|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|Win32.ActiveCfg = Release|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|Win32.Build.0 = Release|Win32 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|x64.ActiveCfg = Release|x64 - {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|x64.Build.0 = Release|x64 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|Win32.ActiveCfg = Debug|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|Win32.Build.0 = Debug|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|x64.ActiveCfg = Debug|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|x64.Build.0 = Debug|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|Win32.ActiveCfg = Release|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|Win32.Build.0 = Release|Win32 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|x64.ActiveCfg = Release|x64 - {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|x64.Build.0 = Release|x64 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|Win32.ActiveCfg = Debug|Win32 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|Win32.Build.0 = Debug|Win32 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|x64.ActiveCfg = Debug|x64 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|x64.Build.0 = Debug|x64 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|Win32.ActiveCfg = Release|Win32 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|Win32.Build.0 = Release|Win32 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|x64.ActiveCfg = Release|x64 - {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|x64.Build.0 = Release|x64 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|Win32.ActiveCfg = Debug|Win32 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|Win32.Build.0 = Debug|Win32 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|x64.ActiveCfg = Debug|x64 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|x64.Build.0 = Debug|x64 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|Win32.ActiveCfg = Release|Win32 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|Win32.Build.0 = Release|Win32 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|x64.ActiveCfg = Release|x64 - {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {BE3F09BB-91A9-474C-AAD9-4B4D43DCE89E} - EndGlobalSection -EndGlobal diff --git a/Mkfiles/vs/yasm.vcxproj b/Mkfiles/vs/yasm.vcxproj deleted file mode 100644 index bceedf94..00000000 --- a/Mkfiles/vs/yasm.vcxproj +++ /dev/null @@ -1,284 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5} - yasm - 10.0 - - - - Application - false - MultiByte - v143 - - - Application - false - MultiByte - v143 - - - Application - false - MultiByte - v143 - - - Application - false - MultiByte - v143 - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - - - - $(Platform)\$(Configuration)/yasm.tlb - - - - - Disabled - .;../..;%(AdditionalIncludeDirectories) - _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)yasm.exe - true - true - $(OutDir)$(ProjectName).pdb - Console - false - - - MachineX86 - - - - - X64 - $(Platform)\$(Configuration)/yasm.tlb - - - - - Disabled - .;../..;%(AdditionalIncludeDirectories) - _DEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)yasm.exe - true - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX64 - - - - - $(Platform)\$(Configuration)/yasm.tlb - - - - - Full - Default - true - .;../..;%(AdditionalIncludeDirectories) - NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)yasm.exe - true - true - $(OutDir)$(ProjectName).pdb - Console - false - - - MachineX86 - - - - - X64 - $(Platform)\$(Configuration)/yasm.tlb - - - - - Full - OnlyExplicitInline - .;../..;%(AdditionalIncludeDirectories) - NDEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)yasm.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX64 - true - - - - - - - - - - - - - - - - - {021ceb0a-f721-4f59-b349-9ceeaf244459} - false - - - {29fe7874-1256-4ad6-b889-68e399dc9608} - false - - - {d715a3d4-efaa-442e-ad8b-5b4ff64e1dd6} - false - - - - - - \ No newline at end of file diff --git a/Mkfiles/vs/yasm.vcxproj.filters b/Mkfiles/vs/yasm.vcxproj.filters deleted file mode 100644 index 04941c22..00000000 --- a/Mkfiles/vs/yasm.vcxproj.filters +++ /dev/null @@ -1,41 +0,0 @@ - - - - - {51f0d88e-1373-4bf8-a72e-c79706d37f8b} - h;hpp;hxx;hm;inl - - - {db67b411-6f59-462c-9c20-75024c6b3912} - cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - - - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - \ No newline at end of file diff --git a/Mkfiles/vs/ytasm.vcxproj b/Mkfiles/vs/ytasm.vcxproj deleted file mode 100644 index 7cf165a9..00000000 --- a/Mkfiles/vs/ytasm.vcxproj +++ /dev/null @@ -1,279 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {2162937B-0DBD-4450-B45F-DF578D8E7508} - ytasm - 10.0 - - - - Application - false - MultiByte - v143 - - - Application - false - MultiByte - v143 - - - Application - false - MultiByte - v143 - - - Application - false - MultiByte - v143 - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.21006.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - - - - $(Platform)\$(Configuration)/yasm.tlb - - - - - Disabled - .;../..;%(AdditionalIncludeDirectories) - _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)ytasm.exe - true - true - $(OutDir)$(ProjectName).pdb - Console - false - - - MachineX86 - - - - - X64 - $(Platform)\$(Configuration)/yasm.tlb - - - - - Disabled - .;../..;%(AdditionalIncludeDirectories) - _DEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)ytasm.exe - true - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX64 - - - - - $(Platform)\$(Configuration)/yasm.tlb - - - - - Full - Default - true - .;../..;%(AdditionalIncludeDirectories) - NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)ytasm.exe - true - true - $(OutDir)$(ProjectName).pdb - Console - false - - - MachineX86 - - - - - X64 - $(Platform)\$(Configuration)/yasm.tlb - - - - - Full - OnlyExplicitInline - .;../..;%(AdditionalIncludeDirectories) - NDEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - - - $(IntDir) - $(IntDir) - $(IntDir) - Level3 - true - Default - ProgramDatabase - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)ytasm.exe - true - $(OutDir)$(TargetName).pdb - Console - false - - - MachineX64 - true - - - - - - - - - - - - - - - - {29fe7874-1256-4ad6-b889-68e399dc9608} - false - - - {d715a3d4-efaa-442e-ad8b-5b4ff64e1dd6} - false - - - - - - \ No newline at end of file From 8fea7b9c50c8041c09e9bbf7fe23d6086db54c80 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Wed, 22 Jul 2026 03:48:06 +0200 Subject: [PATCH 577/585] cmake: add back dependency on its input of re2c gnerated file (#308) Small fix-up of #307 --- cmake/modules/YasmMacros.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/modules/YasmMacros.cmake b/cmake/modules/YasmMacros.cmake index 0214c908..c6e01922 100644 --- a/cmake/modules/YasmMacros.cmake +++ b/cmake/modules/YasmMacros.cmake @@ -69,6 +69,7 @@ macro (YASM_RE2C _in_NAME _out_NAME) add_custom_command( OUTPUT ${_out_NAME} COMMAND yasm::re2c ${ARGN} -o ${_out_NAME} ${_in_NAME} + MAIN_DEPENDENCY ${_in_NAME} ) endmacro (YASM_RE2C) From 5500e13ed503e58dedb05410607492847f12db90 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 24 Jul 2026 17:26:01 -0500 Subject: [PATCH 578/585] Restore Mkfiles/vs project (#311) This is still consumed by users. --- Mkfiles/vs/config.h | 170 +++++++++ Mkfiles/vs/crt_secure_no_deprecate.props | 11 + Mkfiles/vs/crt_secure_no_deprecate.vsprops | 11 + Mkfiles/vs/genmacro/genmacro.vcxproj | 203 +++++++++++ Mkfiles/vs/genmacro/genmacro.vcxproj.filters | 17 + Mkfiles/vs/genmacro/run.bat | 5 + Mkfiles/vs/genmodule/genmodule.vcxproj | 208 +++++++++++ .../vs/genmodule/genmodule.vcxproj.filters | 20 ++ Mkfiles/vs/genmodule/run.bat | 3 + Mkfiles/vs/genperf/genperf.vcxproj | 262 ++++++++++++++ Mkfiles/vs/genperf/genperf.vcxproj.filters | 56 +++ Mkfiles/vs/genperf/run.bat | 40 +++ Mkfiles/vs/genstring/genstring.vcxproj | 197 +++++++++++ .../vs/genstring/genstring.vcxproj.filters | 17 + Mkfiles/vs/genstring/run.bat | 2 + Mkfiles/vs/genversion/genversion.vcxproj | 224 ++++++++++++ .../vs/genversion/genversion.vcxproj.filters | 26 ++ Mkfiles/vs/genversion/run.bat | 2 + Mkfiles/vs/genversion/runpre.bat | 2 + Mkfiles/vs/libyasm/libyasm.vcxproj | 278 +++++++++++++++ Mkfiles/vs/libyasm/libyasm.vcxproj.filters | 200 +++++++++++ Mkfiles/vs/modules/modules.vcxproj | 325 ++++++++++++++++++ Mkfiles/vs/modules/modules.vcxproj.filters | 256 ++++++++++++++ Mkfiles/vs/out_copy_rename.bat | 42 +++ Mkfiles/vs/re2c/re2c.vcxproj | 222 ++++++++++++ Mkfiles/vs/re2c/re2c.vcxproj.filters | 80 +++++ Mkfiles/vs/re2c/run.bat | 4 + Mkfiles/vs/readme.vs.txt | 96 ++++++ Mkfiles/vs/vsyasm.props | 27 ++ Mkfiles/vs/vsyasm.targets | 110 ++++++ Mkfiles/vs/vsyasm.vcxproj | 280 +++++++++++++++ Mkfiles/vs/vsyasm.xml | 283 +++++++++++++++ Mkfiles/vs/yasm.sln | 145 ++++++++ Mkfiles/vs/yasm.vcxproj | 284 +++++++++++++++ Mkfiles/vs/yasm.vcxproj.filters | 41 +++ Mkfiles/vs/ytasm.vcxproj | 279 +++++++++++++++ 36 files changed, 4428 insertions(+) create mode 100644 Mkfiles/vs/config.h create mode 100644 Mkfiles/vs/crt_secure_no_deprecate.props create mode 100644 Mkfiles/vs/crt_secure_no_deprecate.vsprops create mode 100644 Mkfiles/vs/genmacro/genmacro.vcxproj create mode 100644 Mkfiles/vs/genmacro/genmacro.vcxproj.filters create mode 100644 Mkfiles/vs/genmacro/run.bat create mode 100644 Mkfiles/vs/genmodule/genmodule.vcxproj create mode 100644 Mkfiles/vs/genmodule/genmodule.vcxproj.filters create mode 100644 Mkfiles/vs/genmodule/run.bat create mode 100644 Mkfiles/vs/genperf/genperf.vcxproj create mode 100644 Mkfiles/vs/genperf/genperf.vcxproj.filters create mode 100644 Mkfiles/vs/genperf/run.bat create mode 100644 Mkfiles/vs/genstring/genstring.vcxproj create mode 100644 Mkfiles/vs/genstring/genstring.vcxproj.filters create mode 100644 Mkfiles/vs/genstring/run.bat create mode 100644 Mkfiles/vs/genversion/genversion.vcxproj create mode 100644 Mkfiles/vs/genversion/genversion.vcxproj.filters create mode 100644 Mkfiles/vs/genversion/run.bat create mode 100644 Mkfiles/vs/genversion/runpre.bat create mode 100644 Mkfiles/vs/libyasm/libyasm.vcxproj create mode 100644 Mkfiles/vs/libyasm/libyasm.vcxproj.filters create mode 100644 Mkfiles/vs/modules/modules.vcxproj create mode 100644 Mkfiles/vs/modules/modules.vcxproj.filters create mode 100644 Mkfiles/vs/out_copy_rename.bat create mode 100644 Mkfiles/vs/re2c/re2c.vcxproj create mode 100644 Mkfiles/vs/re2c/re2c.vcxproj.filters create mode 100644 Mkfiles/vs/re2c/run.bat create mode 100644 Mkfiles/vs/readme.vs.txt create mode 100644 Mkfiles/vs/vsyasm.props create mode 100644 Mkfiles/vs/vsyasm.targets create mode 100644 Mkfiles/vs/vsyasm.vcxproj create mode 100644 Mkfiles/vs/vsyasm.xml create mode 100644 Mkfiles/vs/yasm.sln create mode 100644 Mkfiles/vs/yasm.vcxproj create mode 100644 Mkfiles/vs/yasm.vcxproj.filters create mode 100644 Mkfiles/vs/ytasm.vcxproj diff --git a/Mkfiles/vs/config.h b/Mkfiles/vs/config.h new file mode 100644 index 00000000..8515ac5a --- /dev/null +++ b/Mkfiles/vs/config.h @@ -0,0 +1,170 @@ +#include "YASM-VERSION.h" +#define yasm__splitpath(path, tail) yasm__splitpath_win(path, tail) +#define yasm__abspath(path) yasm__abspath_win(path) +#define yasm__combpath(from, to) yasm__combpath_win(from, to) + +/* Command name to run C preprocessor */ +#define CPP_PROG "cpp" + +/* */ +/* #undef ENABLE_NLS */ + +/* Define if you have the `abort' function. */ +#define HAVE_ABORT 1 + +/* */ +/* #undef HAVE_CATGETS */ + +/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYCURRENT */ + +/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +/* #undef HAVE_DCGETTEXT */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DIRECT_H 1 + +/* Define to 1 if you have the `getcwd' function. */ +#define HAVE_GETCWD 1 + +/* */ +/* #undef HAVE_GETTEXT */ + +/* Define if you have the GNU C Library */ +/* #undef HAVE_GNU_C_LIBRARY */ + +/* Define if you have the iconv() function. */ +/* #undef HAVE_ICONV */ + +/* Define if you have the header file. */ +/* #undef HAVE_INTTYPES_H */ + +/* */ +/* #undef HAVE_LC_MESSAGES */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LIBGEN_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_MEMORY_H */ + +/* Define if you have the `mergesort' function. */ +/* #undef HAVE_MERGESORT */ + +/* Define to 1 if you have the `popen' function. */ +/* #undef HAVE_POPEN */ + +/* Define if you have the header file. */ +/* #undef HAVE_STDINT_H */ + +/* Define if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* */ +/* #undef HAVE_STPCPY */ + +/* Define if you have the `strcasecmp' function. */ +/* #undef HAVE_STRCASECMP */ + +/* Define if you have the `strcmpi' function. */ +/* #undef HAVE_STRCMPI */ + +/* Define if you have the `stricmp' function. */ +/* #undefine HAVE_STRICMP */ + +/* Define if you have the header file. */ +/* #undef HAVE_STRINGS_H */ + +/* Define if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define if you have the `strncasecmp' function. */ +/* #undef HAVE_STRNCASECMP */ + +/* Define if you have the `strsep' function. */ +/* #undef HAVE_STRSEP */ + +/* Define if you have the header file. */ +/* #undef HAVE_SYS_STAT_H */ + +/* Define if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define if you have the `toascii' function. */ +#define HAVE_TOASCII 1 +#define toascii __toascii + +/* Define if you have the header file. */ +/* #undef HAVE_UNISTD_H */ + +/* Define to 1 if you have the `vsnprintf' function. */ +/* #undef HAVE_VSNPRINTF */ + +/* Define to 1 if you have the `_stricmp' function. */ +#define HAVE__STRICMP 1 + +/* Name of package */ +#define PACKAGE "yasm" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "bug-yasm@tortall.net" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "yasm" + +/* Define to the full name and version of this package. */ +/*#define PACKAGE_STRING "yasm HEAD"*/ + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "yasm" + +/* Define to the version of this package. */ +/*#define PACKAGE_VERSION "HEAD"*/ + +/* Define if the C compiler supports function prototypes. */ +#define PROTOTYPES 1 + +/* The size of a `char', as computed by sizeof. */ +/* #undef SIZEOF_CHAR */ + +/* The size of a `int', as computed by sizeof. */ +/* #undef SIZEOF_INT */ + +/* The size of a `long', as computed by sizeof. */ +/* #undef SIZEOF_LONG */ + +/* The size of a `short', as computed by sizeof. */ +/* #undef SIZEOF_SHORT */ + +/* The size of a `void*', as computed by sizeof. */ +/* #undef SIZEOF_VOIDP */ + +/* Define if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Version number of package */ +#define VERSION "HEAD" + +/* Define if using the dmalloc debugging malloc package */ +/* #undef WITH_DMALLOC */ + +/* Define like PROTOTYPES; this can be used by system headers. */ +#define __PROTOTYPES 1 + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define as `__inline' if that's what the C compiler calls it, or to nothing + if it is not supported. */ +#ifndef __cplusplus +/* #undef inline */ +#endif + +/* Define to `unsigned' if doesn't define. */ +/* #undef size_t */ diff --git a/Mkfiles/vs/crt_secure_no_deprecate.props b/Mkfiles/vs/crt_secure_no_deprecate.props new file mode 100644 index 00000000..777d6d0a --- /dev/null +++ b/Mkfiles/vs/crt_secure_no_deprecate.props @@ -0,0 +1,11 @@ + + + + <_ProjectFileVersion>10.0.21006.1 + + + + _CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + + + \ No newline at end of file diff --git a/Mkfiles/vs/crt_secure_no_deprecate.vsprops b/Mkfiles/vs/crt_secure_no_deprecate.vsprops new file mode 100644 index 00000000..56ab506f --- /dev/null +++ b/Mkfiles/vs/crt_secure_no_deprecate.vsprops @@ -0,0 +1,11 @@ + + + + diff --git a/Mkfiles/vs/genmacro/genmacro.vcxproj b/Mkfiles/vs/genmacro/genmacro.vcxproj new file mode 100644 index 00000000..3ecedc7c --- /dev/null +++ b/Mkfiles/vs/genmacro/genmacro.vcxproj @@ -0,0 +1,203 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {225700A5-07B8-434E-AD61-555278BF6733} + genmacro + Win32Proj + 10.0 + + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + + + + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genmacro.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + + + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genmacro.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + + + run.bat "$(TargetPath)" + + + + + Full + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + Default + + + $(OutDir)genmacro.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + + + Full + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + Default + + + $(OutDir)genmacro.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + + + run.bat "$(TargetPath)" + + + + + + + + + + + {b545983b-8ee0-4a7b-a67a-e749eeae62a2} + false + + + + + + \ No newline at end of file diff --git a/Mkfiles/vs/genmacro/genmacro.vcxproj.filters b/Mkfiles/vs/genmacro/genmacro.vcxproj.filters new file mode 100644 index 00000000..402cf1b4 --- /dev/null +++ b/Mkfiles/vs/genmacro/genmacro.vcxproj.filters @@ -0,0 +1,17 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Source Files + + + + + + \ No newline at end of file diff --git a/Mkfiles/vs/genmacro/run.bat b/Mkfiles/vs/genmacro/run.bat new file mode 100644 index 00000000..98c337ac --- /dev/null +++ b/Mkfiles/vs/genmacro/run.bat @@ -0,0 +1,5 @@ +cd ..\..\.. +%1 nasm-version.c nasm_version_mac version.mac +%1 nasm-macros.c nasm_standard_mac modules\parsers\nasm\nasm-std.mac +%1 win64-nasm.c win64_nasm_stdmac modules\objfmts\coff\win64-nasm.mac +%1 win64-gas.c win64_gas_stdmac modules\objfmts\coff\win64-gas.mac diff --git a/Mkfiles/vs/genmodule/genmodule.vcxproj b/Mkfiles/vs/genmodule/genmodule.vcxproj new file mode 100644 index 00000000..9a8459cd --- /dev/null +++ b/Mkfiles/vs/genmodule/genmodule.vcxproj @@ -0,0 +1,208 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0} + genmodule + Win32Proj + 10.0 + + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + + + + Disabled + %(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;FILTERMODE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genmodule.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + + + Disabled + %(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;FILTERMODE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genmodule.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + + + run.bat "$(TargetPath)" + + + + + Full + %(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;FILTERMODE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + $(IntDir) + Level3 + Default + + + $(OutDir)genmodule.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + + + Full + %(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;FILTERMODE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + $(IntDir) + Level3 + Default + + + $(OutDir)genmodule.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + + + run.bat "$(TargetPath)" + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vs/genmodule/genmodule.vcxproj.filters b/Mkfiles/vs/genmodule/genmodule.vcxproj.filters new file mode 100644 index 00000000..d3255c29 --- /dev/null +++ b/Mkfiles/vs/genmodule/genmodule.vcxproj.filters @@ -0,0 +1,20 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Source Files + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vs/genmodule/run.bat b/Mkfiles/vs/genmodule/run.bat new file mode 100644 index 00000000..00055692 --- /dev/null +++ b/Mkfiles/vs/genmodule/run.bat @@ -0,0 +1,3 @@ +@echo off +cd ..\..\.. +%1 libyasm\module.in Makefile.am diff --git a/Mkfiles/vs/genperf/genperf.vcxproj b/Mkfiles/vs/genperf/genperf.vcxproj new file mode 100644 index 00000000..8f193269 --- /dev/null +++ b/Mkfiles/vs/genperf/genperf.vcxproj @@ -0,0 +1,262 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619} + genperf + Win32Proj + 10.0 + + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + false + false + false + false + + + + + + + + Disabled + ..;../../..;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;STDC_HEADERS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genperf.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX86 + + + + + + + run.bat "$(TargetPath)" + + + x86insn_nasm.c;x86insn_gas.c;x86cpu.c;x86regtmod.c;%(Outputs) + + + run.bat "$(TargetPath)" + + + + + Disabled + ..;../../..;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;STDC_HEADERS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genperf.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + + + + + + + run.bat "$(TargetPath)" + + + x86insn_nasm.c;x86insn_gas.c;x86cpu.c;x86regtmod.c;%(Outputs) + + + run.bat "$(TargetPath)" + + + + + Full + ..;../../..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;STDC_HEADERS;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + Default + + + $(OutDir)genperf.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + MachineX86 + + + + + + + run.bat "$(TargetPath)" + + + x86insn_nasm.c;x86insn_gas.c;x86cpu.c;x86regtmod.c;%(Outputs) + + + run.bat "$(TargetPath)" + + + + + Full + ..;../../..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;STDC_HEADERS;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + Default + + + $(OutDir)genperf.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + + + + + + + run.bat "$(TargetPath)" + + + x86insn_nasm.c;x86insn_gas.c;x86cpu.c;x86regtmod.c;%(Outputs) + + + run.bat "$(TargetPath)" + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vs/genperf/genperf.vcxproj.filters b/Mkfiles/vs/genperf/genperf.vcxproj.filters new file mode 100644 index 00000000..3124b5d7 --- /dev/null +++ b/Mkfiles/vs/genperf/genperf.vcxproj.filters @@ -0,0 +1,56 @@ + + + + + {3C1E9AA8-6338-4CED-99F1-BEBA80607BD5} + h;hpp;hxx;hm;inl;inc;xsd + + + {1062695D-1C50-4068-8313-73A409885BC1} + cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + + \ No newline at end of file diff --git a/Mkfiles/vs/genperf/run.bat b/Mkfiles/vs/genperf/run.bat new file mode 100644 index 00000000..c6f83543 --- /dev/null +++ b/Mkfiles/vs/genperf/run.bat @@ -0,0 +1,40 @@ +cd ..\..\.. +@echo off + +for /f "usebackq tokens=1*" %%f in (`reg query HKCR\Applications\python.exe\shell\open\command 2^>NUL`) do (set _my_=%%f %%g) +goto try1%errorlevel% + +:try10 +goto ok + +:try11 +for /f "usebackq tokens=1*" %%f in (`reg query HKCR\Python.File\shell\open\command 2^>NUL`) do (set _my_=%%f %%g) +goto try2%errorlevel% + +:try20: +goto ok + +:try21: +echo Building without Python ... +goto therest + +:ok +echo Building with Python ... +set _res_=%_my_:*REG_SZ=% +set _end_=%_res_:*exe"=% +call set _python_=%%_res_:%_end_%=%% +echo %_python_% +call %_python_% modules\arch\x86\gen_x86_insn.py + +:therest +@echo on +call :update %1 x86insn_nasm.gperf x86insn_nasm.c +call :update %1 x86insn_gas.gperf x86insn_gas.c +call :update %1 modules\arch\x86\x86cpu.gperf x86cpu.c +call :update %1 modules\arch\x86\x86regtmod.gperf x86regtmod.c +goto :eof + +:update +%1 %2 tf +call mkfiles\vc14\out_copy_rename tf .\ %3 +del tf diff --git a/Mkfiles/vs/genstring/genstring.vcxproj b/Mkfiles/vs/genstring/genstring.vcxproj new file mode 100644 index 00000000..8745dd9d --- /dev/null +++ b/Mkfiles/vs/genstring/genstring.vcxproj @@ -0,0 +1,197 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {021CEB0A-F721-4F59-B349-9CEEAF244459} + genstring + Win32Proj + 10.0 + + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + + + + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genstring.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + + + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genstring.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + + + run.bat "$(TargetPath)" + + + + + Full + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + Default + + + $(OutDir)genstring.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + + + Full + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + Default + + + $(OutDir)genstring.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + + + run.bat "$(TargetPath)" + + + + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vs/genstring/genstring.vcxproj.filters b/Mkfiles/vs/genstring/genstring.vcxproj.filters new file mode 100644 index 00000000..04ed411d --- /dev/null +++ b/Mkfiles/vs/genstring/genstring.vcxproj.filters @@ -0,0 +1,17 @@ + + + + + {28EBE11C-5BE8-4935-9381-F57696749E0C} + cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Source Files + + + + + + \ No newline at end of file diff --git a/Mkfiles/vs/genstring/run.bat b/Mkfiles/vs/genstring/run.bat new file mode 100644 index 00000000..baedcecb --- /dev/null +++ b/Mkfiles/vs/genstring/run.bat @@ -0,0 +1,2 @@ +cd ..\..\.. +%1 license_msg license.c COPYING diff --git a/Mkfiles/vs/genversion/genversion.vcxproj b/Mkfiles/vs/genversion/genversion.vcxproj new file mode 100644 index 00000000..7adf9c7f --- /dev/null +++ b/Mkfiles/vs/genversion/genversion.vcxproj @@ -0,0 +1,224 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2} + genversion + Win32Proj + 10.0 + + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + + + + Disabled + ..\..\vc10;..\..\..\;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genversion.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + cd ..\..\..\ +YASM-VERSION-GEN.bat + + + + + + Disabled + ..\..\vc10;..\..\..\;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + ProgramDatabase + Default + + + $(OutDir)genversion.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + + + run.bat "$(TargetPath)" + + + cd ..\..\..\ +YASM-VERSION-GEN.bat + + + + + + Full + ..\..\vc10;..\..\..\;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + Default + + + $(OutDir)genversion.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + cd ..\..\..\ +YASM-VERSION-GEN.bat + + + + + + Full + ..\..\vc10;..\..\..\;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + Default + + + $(OutDir)genversion.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + + + run.bat "$(TargetPath)" + + + cd ..\..\..\ +YASM-VERSION-GEN.bat + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vs/genversion/genversion.vcxproj.filters b/Mkfiles/vs/genversion/genversion.vcxproj.filters new file mode 100644 index 00000000..cc088b12 --- /dev/null +++ b/Mkfiles/vs/genversion/genversion.vcxproj.filters @@ -0,0 +1,26 @@ + + + + + {2acbec3a-0ed8-4b2e-826e-a84c7d35f205} + h;hpp;hxx;hm;inl + + + {E67ED277-E4F2-4D79-8C9E-962BAC164F3F} + cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Source Files + + + + + Header Files + + + + + + \ No newline at end of file diff --git a/Mkfiles/vs/genversion/run.bat b/Mkfiles/vs/genversion/run.bat new file mode 100644 index 00000000..41b19cad --- /dev/null +++ b/Mkfiles/vs/genversion/run.bat @@ -0,0 +1,2 @@ +cd ..\..\.. +%1 version.mac diff --git a/Mkfiles/vs/genversion/runpre.bat b/Mkfiles/vs/genversion/runpre.bat new file mode 100644 index 00000000..fdd15708 --- /dev/null +++ b/Mkfiles/vs/genversion/runpre.bat @@ -0,0 +1,2 @@ +cd ..\..\.. +YASM-VERSION-GEN.bat diff --git a/Mkfiles/vs/libyasm/libyasm.vcxproj b/Mkfiles/vs/libyasm/libyasm.vcxproj new file mode 100644 index 00000000..f3505f4c --- /dev/null +++ b/Mkfiles/vs/libyasm/libyasm.vcxproj @@ -0,0 +1,278 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {29FE7874-1256-4AD6-B889-68E399DC9608} + libyasm + 10.0 + + + + StaticLibrary + false + MultiByte + v143 + + + StaticLibrary + false + MultiByte + v143 + + + StaticLibrary + false + MultiByte + v143 + + + StaticLibrary + false + MultiByte + v143 + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + + + + Full + Default + ..;../../..;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)libyasm.lib + true + + + + + X64 + + + Full + Default + ..;../../..;%(AdditionalIncludeDirectories) + NDEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)libyasm.lib + true + + + + + Disabled + ..;../../..;%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)libyasm.lib + true + + + + + X64 + + + Disabled + ..;../../..;%(AdditionalIncludeDirectories) + _DEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)libyasm.lib + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {f0e8b707-00c5-4ff2-b8ef-7c39817132a0} + false + + + + + + \ No newline at end of file diff --git a/Mkfiles/vs/libyasm/libyasm.vcxproj.filters b/Mkfiles/vs/libyasm/libyasm.vcxproj.filters new file mode 100644 index 00000000..9bdf13a4 --- /dev/null +++ b/Mkfiles/vs/libyasm/libyasm.vcxproj.filters @@ -0,0 +1,200 @@ + + + + + {4ca3b698-9d01-4e4e-ae00-5c98da045efe} + h;hpp;hxx;hm;inl + + + {68607062-982d-4251-9a1a-30f76474983d} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Source Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + + \ No newline at end of file diff --git a/Mkfiles/vs/modules/modules.vcxproj b/Mkfiles/vs/modules/modules.vcxproj new file mode 100644 index 00000000..e915a491 --- /dev/null +++ b/Mkfiles/vs/modules/modules.vcxproj @@ -0,0 +1,325 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6} + modules + 10.0 + + + + StaticLibrary + false + MultiByte + v143 + + + StaticLibrary + false + MultiByte + v143 + + + StaticLibrary + false + MultiByte + v143 + + + StaticLibrary + false + MultiByte + v143 + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + + + + Full + Default + ..;../../..;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)modules.lib + true + + + + + + + + + X64 + + + Full + Default + ..;../../..;%(AdditionalIncludeDirectories) + NDEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)modules.lib + true + + + + + Disabled + ..;../../..;%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)modules.lib + true + + + + + X64 + + + Disabled + ..;../../..;%(AdditionalIncludeDirectories) + _DEBUG;_LIB;HAVE_CONFIG_H;WIN64;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)modules.lib + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {225700a5-07b8-434e-ad61-555278bf6733} + false + + + {c45a8b59-8b59-4d5d-a8e8-fb090f8dd619} + false + + + {29fe7874-1256-4ad6-b889-68e399dc9608} + false + + + {3c58be13-50a3-4583-984d-d8902b3d7713} + false + + + + + + \ No newline at end of file diff --git a/Mkfiles/vs/modules/modules.vcxproj.filters b/Mkfiles/vs/modules/modules.vcxproj.filters new file mode 100644 index 00000000..e6ff3add --- /dev/null +++ b/Mkfiles/vs/modules/modules.vcxproj.filters @@ -0,0 +1,256 @@ + + + + + {39c89f91-d860-4396-a49f-86b8b7a51c33} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {be0cdf28-cbed-4774-b3cc-b63e4e3fa0a9} + + + {491cc60a-889b-4f53-aae9-f4d7d6aa667a} + + + {c084015d-3c3e-4379-8746-ae5cffcec79e} + + + {3333e0b3-e95f-44f6-9000-58d4da368360} + + + {528f2955-ceba-4691-a36c-054f119e3dcc} + + + {81686d52-eb71-4d4a-a830-66c45afb808f} + + + {98fe1e43-3794-4639-bf29-14b0c569754f} + + + {6b3956d4-0bff-4e8e-af61-a7e59b476fa4} + + + {446fad62-ac17-49e9-8263-33481f04f182} + + + {33fb7fc8-61f9-428d-9c94-7a4912fbb678} + + + {48fc77ec-7d78-4c0a-bfc2-9aa76faf5d7f} + + + + + Source Files\parsers + + + Source Files\arch + + + Source Files\arch + + + Source Files\arch + + + Source Files\arch + + + Source Files\arch + + + Source Files\arch + + + Source Files\arch + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\listfmts\nasm + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\parsers + + + Source Files\parsers + + + Source Files\parsers + + + Source Files\parsers + + + Source Files\parsers + + + Source Files\preprocs\cpp + + + Source Files\preprocs\gas + + + Source Files\preprocs\gas + + + Source Files\preprocs\nasm + + + Source Files\preprocs\nasm + + + Source Files\preprocs\nasm + + + Source Files\preprocs\nasm + + + Source Files\preprocs\raw + + + Source Files\parsers + + + Source Files\arch + + + Source Files\arch + + + Source Files\objfmts + + + + + Source Files\arch + + + Source Files\arch + + + Source Files\dbgfmts + + + Source Files\dbgfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\objfmts + + + Source Files\parsers + + + Source Files\parsers + + + Source Files\preprocs\gas + + + Source Files\preprocs\nasm + + + Source Files\preprocs\nasm + + + Source Files\preprocs\nasm + + + Source Files\preprocs\nasm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vs/out_copy_rename.bat b/Mkfiles/vs/out_copy_rename.bat new file mode 100644 index 00000000..3179b59a --- /dev/null +++ b/Mkfiles/vs/out_copy_rename.bat @@ -0,0 +1,42 @@ +@echo off +if not exist %1 goto nofile +if exist %2 goto copy + +echo creating directory %2 +md %2 > nul + +:copy +set str=%2 +for /f "useback tokens=*" %%a in ('%str%') do set str=%%~a +set str=%str:~-1% +if %str% == "\" goto hasbackslash + +if not exist %2\%3 goto cpy +fc %1 %2\%3 > nul && if not %errorlevel 1 goto exit +echo overwriting %2\%3 with %1 +copy %1 %2\%3 > nul +goto exit + +:cpy +echo copying %1 to %2\%3 +copy %1 %2\%3 > nul +goto exit + +:hasbackslash +if not exist %2%3 goto cpy2 +fc %1 %2%3 > nul && if not %errorlevel 1 goto exit +echo overwriting %2%3 with %1 +copy %1 %2%3 > nul +goto exit + +:cpy2 +echo copying %1 to %2%3 +copy %1 %2%3 > nul +goto exit + +:nofile +echo %1 not found + +:exit + + diff --git a/Mkfiles/vs/re2c/re2c.vcxproj b/Mkfiles/vs/re2c/re2c.vcxproj new file mode 100644 index 00000000..51318291 --- /dev/null +++ b/Mkfiles/vs/re2c/re2c.vcxproj @@ -0,0 +1,222 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {3C58BE13-50A3-4583-984D-D8902B3D7713} + re2c + Win32Proj + 10.0 + + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + + + + Disabled + ..;../../..;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + Default + ProgramDatabase + + + $(OutDir)re2c.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + + + Disabled + ..;../../..;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + $(IntDir) + Level3 + Default + ProgramDatabase + + + $(OutDir)re2c.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + + + run.bat "$(TargetPath)" + + + + + Full + ..;../../..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + Default + + + $(OutDir)re2c.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + MachineX86 + + + run.bat "$(TargetPath)" + + + + + Full + ..;../../..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + $(IntDir) + Level3 + Default + + + $(OutDir)re2c.exe + $(OutDir)$(TargetName).pdb + Console + true + true + false + + + + + run.bat "$(TargetPath)" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vs/re2c/re2c.vcxproj.filters b/Mkfiles/vs/re2c/re2c.vcxproj.filters new file mode 100644 index 00000000..da0f935c --- /dev/null +++ b/Mkfiles/vs/re2c/re2c.vcxproj.filters @@ -0,0 +1,80 @@ + + + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + + \ No newline at end of file diff --git a/Mkfiles/vs/re2c/run.bat b/Mkfiles/vs/re2c/run.bat new file mode 100644 index 00000000..6ac571f0 --- /dev/null +++ b/Mkfiles/vs/re2c/run.bat @@ -0,0 +1,4 @@ +cd ..\..\..\ +%1 -s -o lc3bid.c modules\arch\lc3b\lc3bid.re +%1 -b -o nasm-token.c modules\parsers\nasm\nasm-token.re +%1 -b -o gas-token.c modules\parsers\gas\gas-token.re diff --git a/Mkfiles/vs/readme.vs.txt b/Mkfiles/vs/readme.vs.txt new file mode 100644 index 00000000..21c70be9 --- /dev/null +++ b/Mkfiles/vs/readme.vs.txt @@ -0,0 +1,96 @@ +Building YASM with Microsoft Visual Studio +------------------------------------------ + +This note describes how to build YASM using Microsoft Visual +Studio 2019 and later versions. + +1. YASM Download +---------------- + +First YASM needs to be downloaded and the files placed within +a suitable directory, which will be called here but can +be named and located as you wish. + +2. Building YASM +---------------- + +Now locate and double click on the yasm.sln solution file in +the 'Mkfiles/vs' subdirectory to open the build project in +the Visual Studio IDE and then select: + + win32 or x64 build + release or debug build + +as appropriate to build the YASM binaries that you need. + +4. Using YASM with Visual Sudio +------------------------------- + +The YASM version vsyasm.exe is designed specifically for use +with the 2010 and later versions of Visual Studio. To tell +Visual Studio where to find vsyasm.exe, the environment +variable YASMPATH can be set to the absolute path of the +directory in which vsyasm.exe is located (this path should +include the final backslash). + +Alternatively you can find the directory (or directories) +where the VC++ compiler binaries are located and put copies +of the vsyasm.exe binary in these directories. + +Depending on your system you can use either the win32 or the +x64 version of vsyasm.exe, which must be named vsyasm.exe. + +To use the custom tools facility in Visual Studio you need to +place a copy of three files - yasm.props, yasm.targets and +yasm.xml - into a location where they can be found by the +Visual Studio build customisation processes. There are several +ways to do this: + + a. put these files in the MSBUILD customisation directory + + b. put them in a convenient location and set this path in the + 'Build Customisations Search Path' in the Visual Studio + 'Projects and Solutions|VC++ Project Settings' item in + the 'Tools|Options' menu; + + c. put them in a convenient location and set this path in the + 'Build Customisation dialogue (discussed later). + +To use YASM in a project, right click on the project in the Solution +Explorer and select 'Build Customisations..'. This will give you a +dialog box that allows you to select YASM as an assembler (note that +your assembler files need to have the extension '.asm'). If you have +used option c. above, you will need to let the dialogue find them +using the 'Find Existing' button below the dialogue. + +To assemble a file with YASM, select the Property Page for the file +and the select 'Yasm Assembler' in the Tool dialog entry. Then click +'Apply' and an additional property page entry will appear and enable +YASM settings to be established. + +5. A Linker Issue +----------------- + +There appears to be a linker bug in the VC++ linker that prevents +symbols with absolute addresses being linked in DLL builds. This +means, for example, that LEA instructions of the general form: + + lea, rax,[rax+symbol] + +cannot be used for DLL builds. The following general form +has to be used instead: + + lea rcx,[symbol wrt rip] + lea rax,[rax+rcx] + +This limitation may also cause problems with other instruction +that use absolute addresses. + +6. Acknowledgements +------------------- + +I am most grateful for the fantastic support that Peter Johnson, +YASM's creator, has given me in tracking down issues in using +YASM for the production of Windows x64 code. + + Brian Gladman, 16th May 2019 diff --git a/Mkfiles/vs/vsyasm.props b/Mkfiles/vs/vsyasm.props new file mode 100644 index 00000000..9d5c14fa --- /dev/null +++ b/Mkfiles/vs/vsyasm.props @@ -0,0 +1,27 @@ + + + + Midl + CustomBuild + + + _SelectedFiles;$(YASMDependsOn) + + + C:\Program Files\yasm\ + + + + False + $(IntDir)%(FileName).obj + 0 + 0 + "$(YASM_PATH.TrimEnd('\'))"\vsyasm.exe -Xvc -f $(Platform) [AllOptions] [AdditionalOptions] [Inputs] + %(ObjectFile) + Assembling %(Filename)%(Extension) ==> $(IntDir)%(FileName).obj + false + + + diff --git a/Mkfiles/vs/vsyasm.targets b/Mkfiles/vs/vsyasm.targets new file mode 100644 index 00000000..8f38f2cb --- /dev/null +++ b/Mkfiles/vs/vsyasm.targets @@ -0,0 +1,110 @@ + + + + + + + _YASM + + + + + + $(ComputeLinkInputsTargets); + ComputeYASMOutput; + + + $(ComputeLibInputsTargets); + ComputeYASMOutput; + + + + + $(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml + + + + + + <_YASMReadTlog + Include="^%(YASM.FullPath);%(YASM.AdditionalDependencies)" + Condition="'%(YASM.ExcludedFromBuild)' != 'true' and '%(YASM.ObjectFile)' != ''"/> + <_YASMWriteTlog + Include="^%(YASM.FullPath);$([MSBuild]::NormalizePath('$(MSBuildProjectDirectory)', '%(YASM.ObjectFile)'))" + Condition="'%(YASM.ExcludedFromBuild)' != 'true' and '%(YASM.ObjectFile)' != ''"/> + + + + + + + + <_YASMReadTlog Remove="@(_YASMReadTlog)" /> + <_YASMWriteTlog Remove="@(_YASMWriteTlog)" /> + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vs/vsyasm.vcxproj b/Mkfiles/vs/vsyasm.vcxproj new file mode 100644 index 00000000..bd018821 --- /dev/null +++ b/Mkfiles/vs/vsyasm.vcxproj @@ -0,0 +1,280 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {7FDD85BB-CC86-442B-A425-989B5B296ED5} + vsyasm + 10.0 + + + + Application + false + MultiByte + v143 + + + Application + false + MultiByte + v143 + + + Application + false + MultiByte + v143 + + + Application + false + MultiByte + v143 + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + + + + $(Platform)\$(Configuration)/yasm.tlb + + + + + Disabled + .;../..;%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)vsyasm.exe + true + true + $(OutDir)$(ProjectName).pdb + Console + false + + + MachineX86 + + + + + X64 + $(Platform)\$(Configuration)/yasm.tlb + + + + + Disabled + .;../..;%(AdditionalIncludeDirectories) + _DEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)vsyasm.exe + true + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX64 + + + + + $(Platform)\$(Configuration)/yasm.tlb + + + + + Full + Default + true + .;../..;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)vsyasm.exe + true + true + $(OutDir)$(ProjectName).pdb + Console + false + + + MachineX86 + + + + + X64 + $(Platform)\$(Configuration)/yasm.tlb + + + + + Full + OnlyExplicitInline + .;../..;%(AdditionalIncludeDirectories) + NDEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)vsyasm.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX64 + true + + + + + + + + + {29fe7874-1256-4ad6-b889-68e399dc9608} + false + + + {d715a3d4-efaa-442e-ad8b-5b4ff64e1dd6} + false + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vs/vsyasm.xml b/Mkfiles/vs/vsyasm.xml new file mode 100644 index 00000000..a108f005 --- /dev/null +++ b/Mkfiles/vs/vsyasm.xml @@ -0,0 +1,283 @@ + + + + + + + + + + + + + General + + + + + + Symbols + + + + + + Files + + + + + + Command Line + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Execute Before + + + Specifies the targets for the build customization to run before. + + + + + + + + + + + + Execute After + + + Specifies the targets for the build customization to run after. + + + + + + + + + + + + + + + + + + Additional Options + + + Additional Options + + + + + + + + \ No newline at end of file diff --git a/Mkfiles/vs/yasm.sln b/Mkfiles/vs/yasm.sln new file mode 100644 index 00000000..8d3b03a4 --- /dev/null +++ b/Mkfiles/vs/yasm.sln @@ -0,0 +1,145 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30320.27 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{825AC694-358C-4D8D-92DE-33A2691978CE}" + ProjectSection(SolutionItems) = preProject + crt_secure_no_deprecate.vsprops = crt_secure_no_deprecate.vsprops + readme.vs.txt = readme.vs.txt + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libyasm", "libyasm\libyasm.vcxproj", "{29FE7874-1256-4AD6-B889-68E399DC9608}" + ProjectSection(ProjectDependencies) = postProject + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2} = {B545983B-8EE0-4A7B-A67A-E749EEAE62A2} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "modules", "modules\modules.vcxproj", "{D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yasm", "yasm.vcxproj", "{34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genmacro", "genmacro\genmacro.vcxproj", "{225700A5-07B8-434E-AD61-555278BF6733}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genversion", "genversion\genversion.vcxproj", "{B545983B-8EE0-4A7B-A67A-E749EEAE62A2}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "re2c", "re2c\re2c.vcxproj", "{3C58BE13-50A3-4583-984D-D8902B3D7713}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genperf", "genperf\genperf.vcxproj", "{C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genmodule", "genmodule\genmodule.vcxproj", "{F0E8B707-00C5-4FF2-B8EF-7C39817132A0}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genstring", "genstring\genstring.vcxproj", "{021CEB0A-F721-4F59-B349-9CEEAF244459}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ytasm", "ytasm.vcxproj", "{2162937B-0DBD-4450-B45F-DF578D8E7508}" + ProjectSection(ProjectDependencies) = postProject + {021CEB0A-F721-4F59-B349-9CEEAF244459} = {021CEB0A-F721-4F59-B349-9CEEAF244459} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vsyasm", "vsyasm.vcxproj", "{7FDD85BB-CC86-442B-A425-989B5B296ED5}" + ProjectSection(ProjectDependencies) = postProject + {021CEB0A-F721-4F59-B349-9CEEAF244459} = {021CEB0A-F721-4F59-B349-9CEEAF244459} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|Win32.ActiveCfg = Debug|Win32 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|Win32.Build.0 = Debug|Win32 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|x64.ActiveCfg = Debug|x64 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Debug|x64.Build.0 = Debug|x64 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|Win32.ActiveCfg = Release|Win32 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|Win32.Build.0 = Release|Win32 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|x64.ActiveCfg = Release|x64 + {29FE7874-1256-4AD6-B889-68E399DC9608}.Release|x64.Build.0 = Release|x64 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|Win32.ActiveCfg = Debug|Win32 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|Win32.Build.0 = Debug|Win32 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|x64.ActiveCfg = Debug|x64 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Debug|x64.Build.0 = Debug|x64 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|Win32.ActiveCfg = Release|Win32 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|Win32.Build.0 = Release|Win32 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|x64.ActiveCfg = Release|x64 + {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}.Release|x64.Build.0 = Release|x64 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|Win32.ActiveCfg = Debug|Win32 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|Win32.Build.0 = Debug|Win32 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|x64.ActiveCfg = Debug|x64 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Debug|x64.Build.0 = Debug|x64 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|Win32.ActiveCfg = Release|Win32 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|Win32.Build.0 = Release|Win32 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|x64.ActiveCfg = Release|x64 + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}.Release|x64.Build.0 = Release|x64 + {225700A5-07B8-434E-AD61-555278BF6733}.Debug|Win32.ActiveCfg = Debug|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Debug|Win32.Build.0 = Debug|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Debug|x64.ActiveCfg = Debug|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Debug|x64.Build.0 = Debug|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Release|Win32.ActiveCfg = Release|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Release|Win32.Build.0 = Release|Win32 + {225700A5-07B8-434E-AD61-555278BF6733}.Release|x64.ActiveCfg = Release|x64 + {225700A5-07B8-434E-AD61-555278BF6733}.Release|x64.Build.0 = Release|x64 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|Win32.ActiveCfg = Debug|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|Win32.Build.0 = Debug|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|x64.ActiveCfg = Debug|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Debug|x64.Build.0 = Debug|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|Win32.ActiveCfg = Release|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|Win32.Build.0 = Release|Win32 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|x64.ActiveCfg = Release|x64 + {B545983B-8EE0-4A7B-A67A-E749EEAE62A2}.Release|x64.Build.0 = Release|x64 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|Win32.ActiveCfg = Debug|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|Win32.Build.0 = Debug|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|x64.ActiveCfg = Debug|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug|x64.Build.0 = Debug|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|Win32.ActiveCfg = Release|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|Win32.Build.0 = Release|Win32 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|x64.ActiveCfg = Release|x64 + {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release|x64.Build.0 = Release|x64 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|Win32.ActiveCfg = Debug|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|Win32.Build.0 = Debug|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|x64.ActiveCfg = Debug|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Debug|x64.Build.0 = Debug|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|Win32.ActiveCfg = Release|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|Win32.Build.0 = Release|Win32 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|x64.ActiveCfg = Release|x64 + {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619}.Release|x64.Build.0 = Release|x64 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|Win32.ActiveCfg = Debug|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|Win32.Build.0 = Debug|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|x64.ActiveCfg = Debug|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug|x64.Build.0 = Debug|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|Win32.ActiveCfg = Release|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|Win32.Build.0 = Release|Win32 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|x64.ActiveCfg = Release|x64 + {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release|x64.Build.0 = Release|x64 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|Win32.ActiveCfg = Debug|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|Win32.Build.0 = Debug|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|x64.ActiveCfg = Debug|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Debug|x64.Build.0 = Debug|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|Win32.ActiveCfg = Release|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|Win32.Build.0 = Release|Win32 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|x64.ActiveCfg = Release|x64 + {021CEB0A-F721-4F59-B349-9CEEAF244459}.Release|x64.Build.0 = Release|x64 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|Win32.ActiveCfg = Debug|Win32 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|Win32.Build.0 = Debug|Win32 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|x64.ActiveCfg = Debug|x64 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Debug|x64.Build.0 = Debug|x64 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|Win32.ActiveCfg = Release|Win32 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|Win32.Build.0 = Release|Win32 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|x64.ActiveCfg = Release|x64 + {2162937B-0DBD-4450-B45F-DF578D8E7508}.Release|x64.Build.0 = Release|x64 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|Win32.ActiveCfg = Debug|Win32 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|Win32.Build.0 = Debug|Win32 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|x64.ActiveCfg = Debug|x64 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Debug|x64.Build.0 = Debug|x64 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|Win32.ActiveCfg = Release|Win32 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|Win32.Build.0 = Release|Win32 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|x64.ActiveCfg = Release|x64 + {7FDD85BB-CC86-442B-A425-989B5B296ED5}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {BE3F09BB-91A9-474C-AAD9-4B4D43DCE89E} + EndGlobalSection +EndGlobal diff --git a/Mkfiles/vs/yasm.vcxproj b/Mkfiles/vs/yasm.vcxproj new file mode 100644 index 00000000..bceedf94 --- /dev/null +++ b/Mkfiles/vs/yasm.vcxproj @@ -0,0 +1,284 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5} + yasm + 10.0 + + + + Application + false + MultiByte + v143 + + + Application + false + MultiByte + v143 + + + Application + false + MultiByte + v143 + + + Application + false + MultiByte + v143 + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + + + + $(Platform)\$(Configuration)/yasm.tlb + + + + + Disabled + .;../..;%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)yasm.exe + true + true + $(OutDir)$(ProjectName).pdb + Console + false + + + MachineX86 + + + + + X64 + $(Platform)\$(Configuration)/yasm.tlb + + + + + Disabled + .;../..;%(AdditionalIncludeDirectories) + _DEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)yasm.exe + true + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX64 + + + + + $(Platform)\$(Configuration)/yasm.tlb + + + + + Full + Default + true + .;../..;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)yasm.exe + true + true + $(OutDir)$(ProjectName).pdb + Console + false + + + MachineX86 + + + + + X64 + $(Platform)\$(Configuration)/yasm.tlb + + + + + Full + OnlyExplicitInline + .;../..;%(AdditionalIncludeDirectories) + NDEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)yasm.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX64 + true + + + + + + + + + + + + + + + + + {021ceb0a-f721-4f59-b349-9ceeaf244459} + false + + + {29fe7874-1256-4ad6-b889-68e399dc9608} + false + + + {d715a3d4-efaa-442e-ad8b-5b4ff64e1dd6} + false + + + + + + \ No newline at end of file diff --git a/Mkfiles/vs/yasm.vcxproj.filters b/Mkfiles/vs/yasm.vcxproj.filters new file mode 100644 index 00000000..04941c22 --- /dev/null +++ b/Mkfiles/vs/yasm.vcxproj.filters @@ -0,0 +1,41 @@ + + + + + {51f0d88e-1373-4bf8-a72e-c79706d37f8b} + h;hpp;hxx;hm;inl + + + {db67b411-6f59-462c-9c20-75024c6b3912} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + \ No newline at end of file diff --git a/Mkfiles/vs/ytasm.vcxproj b/Mkfiles/vs/ytasm.vcxproj new file mode 100644 index 00000000..7cf165a9 --- /dev/null +++ b/Mkfiles/vs/ytasm.vcxproj @@ -0,0 +1,279 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {2162937B-0DBD-4450-B45F-DF578D8E7508} + ytasm + 10.0 + + + + Application + false + MultiByte + v143 + + + Application + false + MultiByte + v143 + + + Application + false + MultiByte + v143 + + + Application + false + MultiByte + v143 + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + + + + $(Platform)\$(Configuration)/yasm.tlb + + + + + Disabled + .;../..;%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)ytasm.exe + true + true + $(OutDir)$(ProjectName).pdb + Console + false + + + MachineX86 + + + + + X64 + $(Platform)\$(Configuration)/yasm.tlb + + + + + Disabled + .;../..;%(AdditionalIncludeDirectories) + _DEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)ytasm.exe + true + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX64 + + + + + $(Platform)\$(Configuration)/yasm.tlb + + + + + Full + Default + true + .;../..;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;VC;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)ytasm.exe + true + true + $(OutDir)$(ProjectName).pdb + Console + false + + + MachineX86 + + + + + X64 + $(Platform)\$(Configuration)/yasm.tlb + + + + + Full + OnlyExplicitInline + .;../..;%(AdditionalIncludeDirectories) + NDEBUG;_LIB;HAVE_CONFIG_H;VC;WIN64;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + + + $(IntDir) + $(IntDir) + $(IntDir) + Level3 + true + Default + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + $(OutDir)ytasm.exe + true + $(OutDir)$(TargetName).pdb + Console + false + + + MachineX64 + true + + + + + + + + + + + + + + + + {29fe7874-1256-4ad6-b889-68e399dc9608} + false + + + {d715a3d4-efaa-442e-ad8b-5b4ff64e1dd6} + false + + + + + + \ No newline at end of file From baceff9d12f7b999f3096f472b1cebbff0ca643b Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Sat, 25 Jul 2026 16:58:34 +0200 Subject: [PATCH 579/585] Fix -Wdeclaration-after-statement warning (ISO C90 forbids mixed declarations and code) (#313) --- modules/arch/x86/x86bc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/arch/x86/x86bc.c b/modules/arch/x86/x86bc.c index a2c82d8c..7f1eccea 100644 --- a/modules/arch/x86/x86bc.c +++ b/modules/arch/x86/x86bc.c @@ -656,9 +656,10 @@ x86_bc_insn_expand(yasm_bytecode *bc, int span, long old_val, long new_val, x86_insn *insn = (x86_insn *)bc->contents; x86_effaddr *x86_ea = insn->x86_ea; yasm_effaddr *ea = NULL; + yasm_value *imm; if (x86_ea != NULL) ea = &x86_ea->ea; - yasm_value *imm = insn->imm; + imm = insn->imm; if (ea && span == 1) { /* Change displacement length into word-sized */ From d196fb3cb96fb67d554ad7dfdf01fac1069d5417 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Sat, 25 Jul 2026 16:59:44 +0200 Subject: [PATCH 580/585] Fix -Wtautological-compare warning (self-comparison always evaluates to true) (#312) --- modules/arch/lc3b/lc3bid.re | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/arch/lc3b/lc3bid.re b/modules/arch/lc3b/lc3bid.re index 2b3cf7a3..cd8f1303 100644 --- a/modules/arch/lc3b/lc3bid.re +++ b/modules/arch/lc3b/lc3bid.re @@ -341,7 +341,7 @@ lc3b_id_insn_finalize(yasm_bytecode *bc, yasm_bytecode *prev_bc) #define YYCTYPE unsigned char #define YYCURSOR id -#define YYLIMIT id +#define YYLIMIT id_end #define YYMARKER marker #define YYFILL(n) (void)(n) @@ -350,6 +350,7 @@ yasm_lc3b__parse_check_regtmod(yasm_arch *arch, const char *oid, size_t id_len, uintptr_t *data) { const YYCTYPE *id = (const YYCTYPE *)oid; + const YYCTYPE *const id_end = (const YYCTYPE *)(oid + id_len); /*const char *marker;*/ /*!re2c /* integer registers */ @@ -382,6 +383,7 @@ yasm_lc3b__parse_check_insnprefix(yasm_arch *arch, const char *oid, yasm_bytecode **bc, uintptr_t *prefix) { const YYCTYPE *id = (const YYCTYPE *)oid; + const YYCTYPE *const id_end = (const YYCTYPE *)(oid + id_len); const lc3b_insn_info *group = empty_insn; unsigned long mod = 0; unsigned int nelems = NELEMS(empty_insn); From 9a05f6b3fac14e76058c3df5c4e4c7249363ef03 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Sat, 25 Jul 2026 20:01:20 +0200 Subject: [PATCH 581/585] Fix -Wunused-but-set-variable warnings (#315) --- frontends/tasm/tasm-options.c | 2 ++ frontends/yasm/yasm-options.c | 1 + tools/genmacro/genmacro.c | 4 ---- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/frontends/tasm/tasm-options.c b/frontends/tasm/tasm-options.c index 3d40f31b..941b16ef 100644 --- a/frontends/tasm/tasm-options.c +++ b/frontends/tasm/tasm-options.c @@ -98,6 +98,8 @@ parse_cmdline(int argc, char **argv, opt_option *options, size_t nopts, } } + (void) warnings; + DEBUG((stderr, "parse_cmdline: finished\n")); return errors; } diff --git a/frontends/yasm/yasm-options.c b/frontends/yasm/yasm-options.c index 1545c41a..e493207b 100644 --- a/frontends/yasm/yasm-options.c +++ b/frontends/yasm/yasm-options.c @@ -184,6 +184,7 @@ parse_cmdline(int argc, char **argv, opt_option *options, size_t nopts, } } + (void) warnings; DEBUG((stderr, "parse_cmdline: finished\n")); return errors; } diff --git a/tools/genmacro/genmacro.c b/tools/genmacro/genmacro.c index 896cea5f..73901bfc 100644 --- a/tools/genmacro/genmacro.c +++ b/tools/genmacro/genmacro.c @@ -40,8 +40,6 @@ main(int argc, char *argv[]) char *strp; char *charp; int fline; - int line = 0; - int lindex = 0; size_t len; if (argc < 4) { @@ -74,7 +72,6 @@ main(int argc, char *argv[]) fline = 0; while (fgets(str, MAXLINE, in)) { - line++; fline++; strp = str; @@ -119,7 +116,6 @@ main(int argc, char *argv[]) strp++; } fprintf(out, "\",\n"); - lindex++; } fclose(in); From 9491fc65438225ae4cc40211aa56a07d6f5d2d80 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Sat, 25 Jul 2026 20:01:37 +0200 Subject: [PATCH 582/585] =?UTF-8?q?Fix=20-Wimplicit-function-declaration?= =?UTF-8?q?=20(implicit=20declaration=20of=20function=20=E2=80=98strdup?= =?UTF-8?q?=E2=80=99)=20(#314)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libyasm/section.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libyasm/section.c b/libyasm/section.c index 1459eccc..dd067e07 100644 --- a/libyasm/section.c +++ b/libyasm/section.c @@ -132,7 +132,7 @@ dir_privextern(yasm_object *object, yasm_valparamhead *valparams, if (!objext_valparams) { yasm_valparam *vp; - vp = yasm_vp_create_id(NULL, strdup("private_extern"), '$'); + vp = yasm_vp_create_id(NULL, yasm__xstrdup("private_extern"), '$'); yasm_vps_append(&vps, vp); objext_valparams = &vps; } From 3ec3aa8c33c8b53184da4e1615de3d035640f2d1 Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Wed, 29 Jul 2026 01:43:30 +0100 Subject: [PATCH 583/585] Visual Studio 2026 build fixes (#318) --- Mkfiles/vs/config.h | 2 +- Mkfiles/vs/genmacro/genmacro.vcxproj | 10 ++++++---- Mkfiles/vs/genmodule/genmodule.vcxproj | 12 ++++++------ Mkfiles/vs/genperf/genperf.vcxproj | 8 ++++---- Mkfiles/vs/genperf/run.bat | 2 +- Mkfiles/vs/genstring/genstring.vcxproj | 8 ++++---- Mkfiles/vs/genversion/genversion.vcxproj | 12 ++++++------ Mkfiles/vs/libyasm/libyasm.vcxproj | 8 ++++---- Mkfiles/vs/modules/modules.vcxproj | 8 ++++---- Mkfiles/vs/re2c/re2c.vcxproj | 8 ++++---- Mkfiles/vs/vsyasm.vcxproj | 8 ++++---- Mkfiles/vs/yasm.vcxproj | 8 ++++---- Mkfiles/vs/ytasm.vcxproj | 8 ++++---- 13 files changed, 52 insertions(+), 50 deletions(-) diff --git a/Mkfiles/vs/config.h b/Mkfiles/vs/config.h index 8515ac5a..b7f609fc 100644 --- a/Mkfiles/vs/config.h +++ b/Mkfiles/vs/config.h @@ -119,7 +119,7 @@ #define PACKAGE_NAME "yasm" /* Define to the full name and version of this package. */ -/*#define PACKAGE_STRING "yasm HEAD"*/ +#define PACKAGE_STRING "yasm HEAD" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "yasm" diff --git a/Mkfiles/vs/genmacro/genmacro.vcxproj b/Mkfiles/vs/genmacro/genmacro.vcxproj index 3ecedc7c..15b7c844 100644 --- a/Mkfiles/vs/genmacro/genmacro.vcxproj +++ b/Mkfiles/vs/genmacro/genmacro.vcxproj @@ -28,22 +28,22 @@ Application MultiByte - v143 + v145 Application MultiByte - v143 + v145 Application MultiByte - v143 + v145 Application MultiByte - v143 + v145 @@ -120,6 +120,7 @@ Level3 ProgramDatabase Default + ..\Mkfiles\vs $(OutDir)genmacro.exe @@ -170,6 +171,7 @@ $(IntDir) Level3 Default + ..\Mkfiles\vs $(OutDir)genmacro.exe diff --git a/Mkfiles/vs/genmodule/genmodule.vcxproj b/Mkfiles/vs/genmodule/genmodule.vcxproj index 9a8459cd..ae484bfb 100644 --- a/Mkfiles/vs/genmodule/genmodule.vcxproj +++ b/Mkfiles/vs/genmodule/genmodule.vcxproj @@ -28,22 +28,22 @@ Application MultiByte - v143 + v145 Application MultiByte - v143 + v145 Application MultiByte - v143 + v145 Application MultiByte - v143 + v145 @@ -113,7 +113,7 @@ Disabled - %(AdditionalIncludeDirectories) + ..\Mkfiles\vs;;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;FILTERMODE;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebug @@ -169,7 +169,7 @@ Full - %(AdditionalIncludeDirectories) + ..\Mkfiles\vs;;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;FILTERMODE;%(PreprocessorDefinitions) MultiThreaded diff --git a/Mkfiles/vs/genperf/genperf.vcxproj b/Mkfiles/vs/genperf/genperf.vcxproj index 8f193269..231be306 100644 --- a/Mkfiles/vs/genperf/genperf.vcxproj +++ b/Mkfiles/vs/genperf/genperf.vcxproj @@ -28,22 +28,22 @@ Application MultiByte - v143 + v145 Application MultiByte - v143 + v145 Application MultiByte - v143 + v145 Application MultiByte - v143 + v145 diff --git a/Mkfiles/vs/genperf/run.bat b/Mkfiles/vs/genperf/run.bat index c6f83543..40ab8d52 100644 --- a/Mkfiles/vs/genperf/run.bat +++ b/Mkfiles/vs/genperf/run.bat @@ -36,5 +36,5 @@ goto :eof :update %1 %2 tf -call mkfiles\vc14\out_copy_rename tf .\ %3 +call mkfiles\vs\out_copy_rename tf .\ %3 del tf diff --git a/Mkfiles/vs/genstring/genstring.vcxproj b/Mkfiles/vs/genstring/genstring.vcxproj index 8745dd9d..cf4c74c4 100644 --- a/Mkfiles/vs/genstring/genstring.vcxproj +++ b/Mkfiles/vs/genstring/genstring.vcxproj @@ -28,22 +28,22 @@ Application MultiByte - v143 + v145 Application MultiByte - v143 + v145 Application MultiByte - v143 + v145 Application MultiByte - v143 + v145 diff --git a/Mkfiles/vs/genversion/genversion.vcxproj b/Mkfiles/vs/genversion/genversion.vcxproj index 7adf9c7f..ceab0767 100644 --- a/Mkfiles/vs/genversion/genversion.vcxproj +++ b/Mkfiles/vs/genversion/genversion.vcxproj @@ -28,22 +28,22 @@ Application MultiByte - v143 + v145 Application MultiByte - v143 + v145 Application MultiByte - v143 + v145 Application MultiByte - v143 + v145 @@ -117,7 +117,7 @@ YASM-VERSION-GEN.bat Disabled - ..\..\vc10;..\..\..\;%(AdditionalIncludeDirectories) + ..\..\vs;..\..\..\;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebug @@ -181,7 +181,7 @@ YASM-VERSION-GEN.bat Full - ..\..\vc10;..\..\..\;%(AdditionalIncludeDirectories) + ..\..\vs;..\..\..\;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) MultiThreaded diff --git a/Mkfiles/vs/libyasm/libyasm.vcxproj b/Mkfiles/vs/libyasm/libyasm.vcxproj index f3505f4c..5c60efd2 100644 --- a/Mkfiles/vs/libyasm/libyasm.vcxproj +++ b/Mkfiles/vs/libyasm/libyasm.vcxproj @@ -28,25 +28,25 @@ StaticLibrary false MultiByte - v143 + v145 StaticLibrary false MultiByte - v143 + v145 StaticLibrary false MultiByte - v143 + v145 StaticLibrary false MultiByte - v143 + v145 diff --git a/Mkfiles/vs/modules/modules.vcxproj b/Mkfiles/vs/modules/modules.vcxproj index e915a491..7781ac71 100644 --- a/Mkfiles/vs/modules/modules.vcxproj +++ b/Mkfiles/vs/modules/modules.vcxproj @@ -28,25 +28,25 @@ StaticLibrary false MultiByte - v143 + v145 StaticLibrary false MultiByte - v143 + v145 StaticLibrary false MultiByte - v143 + v145 StaticLibrary false MultiByte - v143 + v145 diff --git a/Mkfiles/vs/re2c/re2c.vcxproj b/Mkfiles/vs/re2c/re2c.vcxproj index 51318291..4809fec7 100644 --- a/Mkfiles/vs/re2c/re2c.vcxproj +++ b/Mkfiles/vs/re2c/re2c.vcxproj @@ -28,22 +28,22 @@ Application MultiByte - v143 + v145 Application MultiByte - v143 + v145 Application MultiByte - v143 + v145 Application MultiByte - v143 + v145 diff --git a/Mkfiles/vs/vsyasm.vcxproj b/Mkfiles/vs/vsyasm.vcxproj index bd018821..c45fa59f 100644 --- a/Mkfiles/vs/vsyasm.vcxproj +++ b/Mkfiles/vs/vsyasm.vcxproj @@ -28,25 +28,25 @@ Application false MultiByte - v143 + v145 Application false MultiByte - v143 + v145 Application false MultiByte - v143 + v145 Application false MultiByte - v143 + v145 diff --git a/Mkfiles/vs/yasm.vcxproj b/Mkfiles/vs/yasm.vcxproj index bceedf94..e928b385 100644 --- a/Mkfiles/vs/yasm.vcxproj +++ b/Mkfiles/vs/yasm.vcxproj @@ -28,25 +28,25 @@ Application false MultiByte - v143 + v145 Application false MultiByte - v143 + v145 Application false MultiByte - v143 + v145 Application false MultiByte - v143 + v145 diff --git a/Mkfiles/vs/ytasm.vcxproj b/Mkfiles/vs/ytasm.vcxproj index 7cf165a9..6e55cf89 100644 --- a/Mkfiles/vs/ytasm.vcxproj +++ b/Mkfiles/vs/ytasm.vcxproj @@ -28,25 +28,25 @@ Application false MultiByte - v143 + v145 Application false MultiByte - v143 + v145 Application false MultiByte - v143 + v145 Application false MultiByte - v143 + v145 From 8c717107dd1235fcf74e279b915837905b6918a5 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Wed, 29 Jul 2026 02:44:34 +0200 Subject: [PATCH 584/585] Emit an error when seeing an invalid condition code in a macro (nasm mode) (#316) make-check: check .errwarn file first if yasm failed --- modules/preprocs/nasm/nasm-pp.c | 46 +++++++++++++------ modules/preprocs/nasm/tests/Makefile.inc | 2 + .../preprocs/nasm/tests/nasmpp-invalidcc.asm | 9 ++++ .../nasm/tests/nasmpp-invalidcc.errwarn | 4 ++ out_test.sh | 4 +- 5 files changed, 51 insertions(+), 14 deletions(-) create mode 100644 modules/preprocs/nasm/tests/nasmpp-invalidcc.asm create mode 100644 modules/preprocs/nasm/tests/nasmpp-invalidcc.errwarn diff --git a/modules/preprocs/nasm/nasm-pp.c b/modules/preprocs/nasm/nasm-pp.c index 512f02c3..8b7ab572 100644 --- a/modules/preprocs/nasm/nasm-pp.c +++ b/modules/preprocs/nasm/nasm-pp.c @@ -3950,8 +3950,7 @@ expand_mmac_params(Token * tline) n = (n + mac->rotate) % mac->nparam; tt = mac->params[n]; } - cc = find_cc(tt); - if (cc == -1) + if (!tt) { error(ERR_NONFATAL, "macro parameter %d is not a condition code", @@ -3960,18 +3959,29 @@ expand_mmac_params(Token * tline) } else { - type = TOK_ID; - if (inverse_ccs[cc] == -1) + cc = find_cc(tt); + if (cc == -1) { error(ERR_NONFATAL, - "condition code `%s' is not invertible", - conditions[cc]); + "macro parameter %d is not a condition code", + n + 1); text = NULL; } else - text = - nasm_strdup(conditions[inverse_ccs - [cc]]); + { + type = TOK_ID; + if (inverse_ccs[cc] == -1) + { + error(ERR_NONFATAL, + "condition code `%s' is not invertible", + conditions[cc]); + text = NULL; + } + else + text = + nasm_strdup(conditions[inverse_ccs + [cc]]); + } } break; case '+': @@ -3984,8 +3994,7 @@ expand_mmac_params(Token * tline) n = (n + mac->rotate) % mac->nparam; tt = mac->params[n]; } - cc = find_cc(tt); - if (cc == -1) + if (!tt) { error(ERR_NONFATAL, "macro parameter %d is not a condition code", @@ -3994,8 +4003,19 @@ expand_mmac_params(Token * tline) } else { - type = TOK_ID; - text = nasm_strdup(conditions[cc]); + cc = find_cc(tt); + if (cc == -1) + { + error(ERR_NONFATAL, + "macro parameter %d is not a condition code", + n + 1); + text = NULL; + } + else + { + type = TOK_ID; + text = nasm_strdup(conditions[cc]); + } } break; default: diff --git a/modules/preprocs/nasm/tests/Makefile.inc b/modules/preprocs/nasm/tests/Makefile.inc index 2d624eb5..3a6a8b60 100644 --- a/modules/preprocs/nasm/tests/Makefile.inc +++ b/modules/preprocs/nasm/tests/Makefile.inc @@ -15,6 +15,8 @@ EXTRA_DIST += modules/preprocs/nasm/tests/nasmpp-bigint.asm EXTRA_DIST += modules/preprocs/nasm/tests/nasmpp-bigint.hex EXTRA_DIST += modules/preprocs/nasm/tests/nasmpp-decimal.asm EXTRA_DIST += modules/preprocs/nasm/tests/nasmpp-decimal.hex +EXTRA_DIST += modules/preprocs/nasm/tests/nasmpp-invalidcc.asm +EXTRA_DIST += modules/preprocs/nasm/tests/nasmpp-invalidcc.errwarn EXTRA_DIST += modules/preprocs/nasm/tests/nasmpp-nested.asm EXTRA_DIST += modules/preprocs/nasm/tests/nasmpp-nested.errwarn EXTRA_DIST += modules/preprocs/nasm/tests/nasmpp-nested.hex diff --git a/modules/preprocs/nasm/tests/nasmpp-invalidcc.asm b/modules/preprocs/nasm/tests/nasmpp-invalidcc.asm new file mode 100644 index 00000000..989fc3c8 --- /dev/null +++ b/modules/preprocs/nasm/tests/nasmpp-invalidcc.asm @@ -0,0 +1,9 @@ +%macro ret_if_cc 1-* + j%+2 %%skip + ret + j%-2 %%skip + ret + %%skip: +%endmacro + +ret_if_cc ne diff --git a/modules/preprocs/nasm/tests/nasmpp-invalidcc.errwarn b/modules/preprocs/nasm/tests/nasmpp-invalidcc.errwarn new file mode 100644 index 00000000..37670af2 --- /dev/null +++ b/modules/preprocs/nasm/tests/nasmpp-invalidcc.errwarn @@ -0,0 +1,4 @@ +-:9: error: (ret_if_cc:1) macro parameter 2 is not a condition code +-:9: error: instruction expected after label +-:9: error: (ret_if_cc:3) macro parameter 2 is not a condition code +-:9: error: instruction expected after label diff --git a/out_test.sh b/out_test.sh index b9698e50..c5f6efc2 100755 --- a/out_test.sh +++ b/out_test.sh @@ -28,8 +28,10 @@ do og=`echo ${asm} | sed 's,.asm$,.hex,'` e=${a}.ew eg=`echo ${asm} | sed 's,.asm$,.errwarn,'` + egp=1 if test \! -f ${eg}; then eg=/dev/null + egp=0 fi # Run within a subshell to prevent signal messages from displaying. @@ -42,7 +44,7 @@ do failedct=`expr $failedct + 1` elif test $status -gt 0; then echo ${asm} | grep err >/dev/null - if test $? -gt 0; then + if test \( $? -gt 0 \) -a \( \! $egp \); then # YASM detected errors but shouldn't have! echo $ECHO_N "E$ECHO_C" eval "failed$failedct='E: ${a} returned an error code!'" From 09d1bc90ed53d0ec3e9b074f111058cbf262ed56 Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Fri, 31 Jul 2026 23:46:22 +0100 Subject: [PATCH 585/585] Update Visual Studio build files to be version independent (#319) --- Mkfiles/vs/genmacro/genmacro.vcxproj | 9 ++++----- Mkfiles/vs/genmodule/genmodule.vcxproj | 9 ++++----- Mkfiles/vs/genperf/genperf.vcxproj | 9 ++++----- Mkfiles/vs/genstring/genstring.vcxproj | 9 ++++----- Mkfiles/vs/genversion/genversion.vcxproj | 9 ++++----- Mkfiles/vs/libyasm-stdint.h | 4 ++++ Mkfiles/vs/libyasm/libyasm.vcxproj | 8 ++++---- Mkfiles/vs/modules/modules.vcxproj | 9 ++++----- Mkfiles/vs/re2c/re2c.vcxproj | 9 ++++----- Mkfiles/vs/vsyasm.vcxproj | 8 ++++---- Mkfiles/vs/yasm.vcxproj | 9 ++++----- Mkfiles/vs/ytasm.vcxproj | 9 ++++----- 12 files changed, 48 insertions(+), 53 deletions(-) create mode 100644 Mkfiles/vs/libyasm-stdint.h diff --git a/Mkfiles/vs/genmacro/genmacro.vcxproj b/Mkfiles/vs/genmacro/genmacro.vcxproj index 15b7c844..1385ac6a 100644 --- a/Mkfiles/vs/genmacro/genmacro.vcxproj +++ b/Mkfiles/vs/genmacro/genmacro.vcxproj @@ -22,28 +22,27 @@ {225700A5-07B8-434E-AD61-555278BF6733} genmacro Win32Proj - 10.0 Application MultiByte - v145 + $(DefaultPlatformToolset) Application MultiByte - v145 + $(DefaultPlatformToolset) Application MultiByte - v145 + $(DefaultPlatformToolset) Application MultiByte - v145 + $(DefaultPlatformToolset) diff --git a/Mkfiles/vs/genmodule/genmodule.vcxproj b/Mkfiles/vs/genmodule/genmodule.vcxproj index ae484bfb..f8eb8f16 100644 --- a/Mkfiles/vs/genmodule/genmodule.vcxproj +++ b/Mkfiles/vs/genmodule/genmodule.vcxproj @@ -22,28 +22,27 @@ {F0E8B707-00C5-4FF2-B8EF-7C39817132A0} genmodule Win32Proj - 10.0 Application MultiByte - v145 + $(DefaultPlatformToolset) Application MultiByte - v145 + $(DefaultPlatformToolset) Application MultiByte - v145 + $(DefaultPlatformToolset) Application MultiByte - v145 + $(DefaultPlatformToolset) diff --git a/Mkfiles/vs/genperf/genperf.vcxproj b/Mkfiles/vs/genperf/genperf.vcxproj index 231be306..913caa89 100644 --- a/Mkfiles/vs/genperf/genperf.vcxproj +++ b/Mkfiles/vs/genperf/genperf.vcxproj @@ -22,28 +22,27 @@ {C45A8B59-8B59-4D5D-A8E8-FB090F8DD619} genperf Win32Proj - 10.0 Application MultiByte - v145 + $(DefaultPlatformToolset) Application MultiByte - v145 + $(DefaultPlatformToolset) Application MultiByte - v145 + $(DefaultPlatformToolset) Application MultiByte - v145 + $(DefaultPlatformToolset) diff --git a/Mkfiles/vs/genstring/genstring.vcxproj b/Mkfiles/vs/genstring/genstring.vcxproj index cf4c74c4..0c7d7898 100644 --- a/Mkfiles/vs/genstring/genstring.vcxproj +++ b/Mkfiles/vs/genstring/genstring.vcxproj @@ -22,28 +22,27 @@ {021CEB0A-F721-4F59-B349-9CEEAF244459} genstring Win32Proj - 10.0 Application MultiByte - v145 + $(DefaultPlatformToolset) Application MultiByte - v145 + $(DefaultPlatformToolset) Application MultiByte - v145 + $(DefaultPlatformToolset) Application MultiByte - v145 + $(DefaultPlatformToolset) diff --git a/Mkfiles/vs/genversion/genversion.vcxproj b/Mkfiles/vs/genversion/genversion.vcxproj index ceab0767..c9cbe8b2 100644 --- a/Mkfiles/vs/genversion/genversion.vcxproj +++ b/Mkfiles/vs/genversion/genversion.vcxproj @@ -22,28 +22,27 @@ {B545983B-8EE0-4A7B-A67A-E749EEAE62A2} genversion Win32Proj - 10.0 Application MultiByte - v145 + $(DefaultPlatformToolset) Application MultiByte - v145 + $(DefaultPlatformToolset) Application MultiByte - v145 + $(DefaultPlatformToolset) Application MultiByte - v145 + $(DefaultPlatformToolset) diff --git a/Mkfiles/vs/libyasm-stdint.h b/Mkfiles/vs/libyasm-stdint.h new file mode 100644 index 00000000..91d7d009 --- /dev/null +++ b/Mkfiles/vs/libyasm-stdint.h @@ -0,0 +1,4 @@ +#ifndef _UINTPTR_T_DEFINED +typedef unsigned long uintptr_t; +#define _UINTPTR_T_DEFINED +#endif diff --git a/Mkfiles/vs/libyasm/libyasm.vcxproj b/Mkfiles/vs/libyasm/libyasm.vcxproj index 5c60efd2..03a53e25 100644 --- a/Mkfiles/vs/libyasm/libyasm.vcxproj +++ b/Mkfiles/vs/libyasm/libyasm.vcxproj @@ -28,25 +28,25 @@ StaticLibrary false MultiByte - v145 + $(DefaultPlatformToolset) StaticLibrary false MultiByte - v145 + $(DefaultPlatformToolset) StaticLibrary false MultiByte - v145 + $(DefaultPlatformToolset) StaticLibrary false MultiByte - v145 + $(DefaultPlatformToolset) diff --git a/Mkfiles/vs/modules/modules.vcxproj b/Mkfiles/vs/modules/modules.vcxproj index 7781ac71..699eb6fd 100644 --- a/Mkfiles/vs/modules/modules.vcxproj +++ b/Mkfiles/vs/modules/modules.vcxproj @@ -21,32 +21,31 @@ {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6} modules - 10.0 StaticLibrary false MultiByte - v145 + $(DefaultPlatformToolset) StaticLibrary false MultiByte - v145 + $(DefaultPlatformToolset) StaticLibrary false MultiByte - v145 + $(DefaultPlatformToolset) StaticLibrary false MultiByte - v145 + $(DefaultPlatformToolset) diff --git a/Mkfiles/vs/re2c/re2c.vcxproj b/Mkfiles/vs/re2c/re2c.vcxproj index 4809fec7..d7bb0736 100644 --- a/Mkfiles/vs/re2c/re2c.vcxproj +++ b/Mkfiles/vs/re2c/re2c.vcxproj @@ -22,28 +22,27 @@ {3C58BE13-50A3-4583-984D-D8902B3D7713} re2c Win32Proj - 10.0 Application MultiByte - v145 + $(DefaultPlatformToolset) Application MultiByte - v145 + $(DefaultPlatformToolset) Application MultiByte - v145 + $(DefaultPlatformToolset) Application MultiByte - v145 + $(DefaultPlatformToolset) diff --git a/Mkfiles/vs/vsyasm.vcxproj b/Mkfiles/vs/vsyasm.vcxproj index c45fa59f..40ab4d6e 100644 --- a/Mkfiles/vs/vsyasm.vcxproj +++ b/Mkfiles/vs/vsyasm.vcxproj @@ -28,25 +28,25 @@ Application false MultiByte - v145 + $(DefaultPlatformToolset) Application false MultiByte - v145 + $(DefaultPlatformToolset) Application false MultiByte - v145 + $(DefaultPlatformToolset) Application false MultiByte - v145 + $(DefaultPlatformToolset) diff --git a/Mkfiles/vs/yasm.vcxproj b/Mkfiles/vs/yasm.vcxproj index e928b385..13363e3c 100644 --- a/Mkfiles/vs/yasm.vcxproj +++ b/Mkfiles/vs/yasm.vcxproj @@ -21,32 +21,31 @@ {34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5} yasm - 10.0 Application false MultiByte - v145 + $(DefaultPlatformToolset) Application false MultiByte - v145 + $(DefaultPlatformToolset) Application false MultiByte - v145 + $(DefaultPlatformToolset) Application false MultiByte - v145 + $(DefaultPlatformToolset) diff --git a/Mkfiles/vs/ytasm.vcxproj b/Mkfiles/vs/ytasm.vcxproj index 6e55cf89..0e9d6bfa 100644 --- a/Mkfiles/vs/ytasm.vcxproj +++ b/Mkfiles/vs/ytasm.vcxproj @@ -21,32 +21,31 @@ {2162937B-0DBD-4450-B45F-DF578D8E7508} ytasm - 10.0 Application false MultiByte - v145 + $(DefaultPlatformToolset) Application false MultiByte - v145 + $(DefaultPlatformToolset) Application false MultiByte - v145 + $(DefaultPlatformToolset) Application false MultiByte - v145 + $(DefaultPlatformToolset)