Commit Graph

36 Commits

Author SHA1 Message Date
Mark Charney
f5cc39cfe1 using is_stringish().
* bytes almost never come up except reading hash signature files.

Change-Id: I04bcfe2af016e0f29fd76cafceda72f51b9abe18
(cherry picked from commit ef74f535c2f74f30ddd7a588486253bced2a3e32)
2017-06-12 14:41:25 -04:00
Mark Charney
e7d734962c update legal header & date for py3 ported files
Change-Id: I166833daaa56c33eca01bdf7b9aa6e74a490ba9a
(cherry picked from commit 1212ba962dff6dfbfa0bd2469327ff447ce59058)
2017-06-12 14:41:24 -04:00
Mark Charney
9983af67b9 ctables: string/bytes confusion. genutil:funcs for idioms I keep replacing
Change-Id: Ic1bce8efd82be80b9911b62d0b932eba0a08ed08
(cherry picked from commit adb6a4f9032feef846f6e81660424963c18cf7da)
2017-06-12 14:41:24 -04:00
Mark Charney
c40152ab7f chipmodel: xrange() -> range()
Change-Id: I6caeb5f75ef63ee096f2f9e668389c9794d064ef
(cherry picked from commit 322c20fb02d0dd3a531453220ec64b78b84066ec)
2017-06-12 14:41:24 -04:00
Mark Charney
0e3904c7e9 more replacing file(fn).readline with open(fn,r).readline...
Change-Id: Id703f961092b33ebc2703158b0706e87194021e3
(cherry picked from commit ae122603a801f87c53619df54827417f561cce5a)
2017-06-12 14:41:24 -04:00
Mark Charney
dd5d596267 generator: division defaults to fp. use // for integer div
Change-Id: I7fd6a2ad0c099086d77ecdf0a98f7050a923659e
(cherry picked from commit eb68da22fc92558ce481d842fe2580ac6736b585)
2017-06-12 14:41:24 -04:00
Mark Charney
0d5fd4a040 more replacing of map(str with list comprehension
Change-Id: I0b3832f5e30c35927c46d177b7b3b13692c6d306
(cherry picked from commit 34c9f848802827bf4699c06b97a732ef79875218)
2017-06-12 14:41:24 -04:00
Mark Charney
8a9d024a65 replace map(str with list comprehension
* str was a function in python2. Now a function and a type name.

   * also changed bytes to bbytes to avoid name clash with type bytes.

Change-Id: Ie1e3f67ea0a54da6e7ada381667f2c545a12388b
(cherry picked from commit 9130f13f8ec8e6ee7a1fad3d5f3c8db7a8fd863f)
2017-06-12 14:41:24 -04:00
Mark Charney
46ac41f16e nt_fun_gen: add list() to fix iterator (for encoder)
Change-Id: Iaf123f3eb37a05e50806a44311b87203c60105aa
(cherry picked from commit edc5ebde1e54b78cc32ca52fa0ba3255ea223f0d)
2017-06-12 14:41:24 -04:00
Mark Charney
86be3daeb1 read-encfile: fix bad str vs bytes changes from 2to3
Change-Id: I7db27f90c43381d72e7617d73f7608aa2753b480
(cherry picked from commit 6d559184643e6df5da51d674f02c4e35f0fdc2ac)
2017-06-12 14:41:24 -04:00
Mark Charney
a3dd467d6c read_encfile: file->open
Change-Id: I6e9742248c3bff7cf6a206e261c578b9c8d726c6
(cherry picked from commit 8647d206a8bb2e6f5e4a72cb2d4115a062399a20)
2017-06-12 14:41:23 -04:00
Mark Charney
9bf8c93ad8 ins_emit.py: fix typo in key fn name
Change-Id: Iabfd28f74381c9123f6a1511e59148d57f0e2bcb
(cherry picked from commit 2f0f348612c6bc6827d207cdd16bf1cfe454a0a8)
2017-06-12 14:41:23 -04:00
Mark Charney
d65bf14bfe generator: bytes or str for type checking
Change-Id: I263f2d2cdae3e900ecbb39b50a771c7bb49810fd
(cherry picked from commit 9a08d1e8c7d7659af06ddad6a8524e179ffa6fba)
2017-06-12 14:41:23 -04:00
Mark Charney
090fe724f0 metaenum: file->open
Change-Id: I3bd4c90db49ca70a900137eda4675f63c592f2ac
(cherry picked from commit 0c2cd373a4a6142e29d08000446fe8f795f20d27)
2017-06-12 14:41:23 -04:00
Mark Charney
cce7707c80 sorting, remove cmp= comparison functions, using key functions.
* some required several key functions relying on stable sorting

Change-Id: Id8008db21377b7c3c3f2d4425c05e4b018e85d45
(cherry picked from commit 6833101d18a2ae1564a7d96c95ecc6918d86fa54)
2017-06-12 14:41:23 -04:00
Mark Charney
99e3abea6d 2to3 types fixer for removed types
Change-Id: I5e7941e2e316c40ac731b5cf2bfc48a6500d56e5
(cherry picked from commit abc4de852029e7a17f1bdd342814d74262449a11)
2017-06-12 14:41:23 -04:00
Mark Charney
4eccd7d1a4 2to3 dict transform
Change-Id: I06e7019fbe8d1331751c6ec091817c24c4e1b590
(cherry picked from commit 28d7094f0e2d78c3397a5edf0fbe96085732bedf)
2017-06-12 14:41:23 -04:00
Mark Charney
e8e1a25d6d latent bug missing n in \n
Change-Id: Ida1e3d2b4e9f4adf9ff399d44459cb43a16bb26f
(cherry picked from commit 41d32246408d4e26f16b2d8bc36c7a2fef830206)
2017-06-12 14:41:23 -04:00
Mark Charney
a3a015df71 filter() -> map(filter( ; lambda(x) -> lambda x, map(lambda -> list comprehension
Change-Id: Iea61822578f708a1485c528ed008340e2d44a687
(cherry picked from commit 369e1c06f7c70f743f7c2d92f336b3fe2a5ef07e)
2017-06-12 14:41:22 -04:00
Mark Charney
8416dbeab2 pysrc: print_function
Change-Id: I2091ba890a8909a7b56416a8f4e4a0e1ad10b626
(cherry picked from commit bc15a573fc5c83f425a1e60cb38a311408b7b0f0)
2017-06-12 14:41:22 -04:00
Mark Charney
43c5d8678c gen_inst_list.py: add ability to diff chip by instr names
* would like it to print out the isa-sets too at some point.

Change-Id: Ia8f005c0f5562b0eb7b7ee5159ede1fa661f257d
(cherry picked from commit 7a1490a17b34f2f24f798eda505a6b475c691f61)
2017-06-12 14:38:14 -04:00
Mark Charney
6a1d1cbc65 ins_emit.py clarify use of insn.map for legacy maps only
Change-Id: I5edd86f60f507cdf0dbd4f6222af66f56eb9b2ba
(cherry picked from commit a1d6ba45cbda5e693bbe2888f120822d043ad511)
2017-06-02 11:26:45 -04:00
Mark Charney
e42a647416 gen_chip_list.py: fix init for reading xed db
Change-Id: I1d64e2d5276411408580263ce0cdc51a36697386
(cherry picked from commit a893d599bbacf74545fbfff6a8dca1c798b43948)
2017-05-11 06:46:27 -04:00
Mark Charney
1662b77a7c gen_chip_list.py: fixed params required by db reader.
Change-Id: Ic4c5ec519e362c3909ecf5133e8a751e5295d8fe
(cherry picked from commit 85d6143cd8b4d4b04c3794b9537020e1c11ae8cf)
2017-05-01 12:46:32 -04:00
Mark Charney
b42583afd6 emit cdata.txt file with chip and list of isa-sets.
* cdata.txt list the isa-sets that compose to form each chip.

  * when used in conjunction with the idata.txt file one can easily
    generate lists of instructions supported by each chip.

Change-Id: Icf110b94e0a290f9c18669e9c7f055f6155d2c67
(cherry picked from commit cfa5fadbd538949b23a6bd2ea8e1df09ef9dfa29)
2017-05-01 12:16:04 -04:00
Mark Charney
7ded981665 ctables: allow composable constant tables
Change-Id: Iee95a6c98f7de4fdc50f60fb3c01d3f67acee951
(cherry picked from commit 1224c953f9e4f58c05c4d0408f21d287d91e8c67)
2017-05-01 12:16:04 -04:00
Mark Charney
bbfbde1327 generator: check cpuid file isa sets against the real list isa sets.
* there were a few typos or things that got out of sync.

Change-Id: I3766ebb3283bb320cb712cd50f8279b76d1fb7b9
(cherry picked from commit 206c19c6dbd54c7c21401bb49b1cca5582e897cf)
2017-02-15 15:05:56 -05:00
Mark Charney
18f10d3ee3 fixed dll export for xed3_{set,get}_generic_operand
Change-Id: I77a85c93e7da486c85e2caf855d0d4c56c75e5a7
(cherry picked from commit 4fe92099dc81b34c5b774eb75f555519adfcd777)
2017-02-03 09:16:33 -05:00
Mark Charney
40de12a930 Make NOP0F1F the preferred fat NOP for the encoder.
* Slightly hacky to mention the uname NOP0F1F, but it is similar to
    putting the "enc" decorator on the pattern. If we have to fiddle
    with more priorites, we can think about a better mechanism.

Change-Id: I8c72e573183cb52e869c770852328f27e00f8b03
(cherry picked from commit 431b365cc9a1736b316f814376410b1577050849)
2017-02-02 21:16:21 -05:00
Mark Charney
c7c1777216 generator: xed operand ordering sort was wrong
* the alnum_sort function did not handle numbers within names
     properly nor did it handle underscores leading to
     nondeterministic sorting. Came up as part of python3 conversion
     effort. Just falling back on normal sort. If we ever have more
     than 10 REG[0..9] operands (or any other sequence of operand
     fields) we'll need to think about sorting those with a special
     case sort function. But just those...

Change-Id: Ie8f6e2eca8b2eac6b0373f0494171fc61dfd1a1d
(cherry picked from commit 9a110642a93d24f560b8c2ab1a72ca86e9a4271f)
(cherry picked from commit 3efffc61666eff5e0633986bf42be939c77ee2ba)
2017-01-17 13:46:49 -05:00
Mark Charney
22427e1a40 generator.py: duplicate iform check now checks isa-set conflicts
* I noticed some iforms from different isa-sets were abiguous
    and added a check.

  * Did some minor clean up to the iform generation code, commenting,
    dead code elim.

Change-Id: I2afb87c7c55c86a86ecc322c0dfc48939a47b16f
(cherry picked from commit 740e181330c06c078e4efc73063a97b4baa0f34b)
2017-01-17 13:12:01 -05:00
Mark Charney
eefe8bbcb5 generator.py: fix comment typo
Change-Id: I9550d2f8c41fbae9c97c79ba0ee21f221bf9dd7f
(cherry picked from commit 4dc67c4a6f4a63bd1705a4d71530f635d64bc129)
2017-01-17 13:12:01 -05:00
klemens
218a25f092 spelling fixes 2016-12-24 07:47:12 -05:00
Mark Charney
85e545d229 remove leading/trailing underscores C-prepoc header guards
* generated header
    * static headers
    * example headers
    * datafile headers

(cherry picked from commit 02147122b27ba3ab53bd3c45d3766da0b971bc29)
2016-12-23 10:33:32 -05:00
Mark Charney
fcd2d41b2b moving headers to xed/ directory for install & kit. DISRUPTIVE CHANGE
* compiled kit users must refer to "#include "xed/xed-interface.h"
      and xed/ on any other public headers that they reference as part
      of the kit or new /usr/local installs.  Or they can change their
      -I flag to include the xed/ path component.  All the examples
      use xed/ in the #include statements now.

    * new knob --prefix=/usr/local (for example) that puts the
      compiled library in /usr/local/lib and the headers in
      /usr/local/include/xed .

    * To install in /usr/local, one typically must sudo.  If you do
      the whole build at sudo, then it'll create root-owned files in
      your build directory whic you might not want.  So I suggest
      first building as the local user and then sudo only for the
      final install.

         > ./mfile.py
	 > sudo ./mfile.py --prefix=/usr/local

    * There is also a --prefix-lib-dir knob to specify something other
      than "lib" for /usr/local/lib. Some systems use lib, lib32 or
      lib64 and I don't know how to tell which is which so I give
      users a knob so they can decide for themselves.

         > ./mfile.py --host-cpu=ia32
	 > sudo ./mfile.py --prefix=/usr/local --prefix-lib-dir=lib32
         > ./mfile.py --host-cpu=intel64
	 > sudo ./mfile.py --prefix=/usr/local --prefix-lib-dir=lib64

    * added xed-util.h to xed-interface.h

    * moved headers from include/public to include/public/xed

    * genutil minor cleanup

Change-Id: I3786d2280f24ff8d7e075fa7a75d90f3b28dd8c3
2016-12-21 13:53:14 -05:00
Mark Charney
ffd94e705c initial commit
Change-Id: I32a6db1a17988d9df8ff69aa1672dbf08b108e8a
2016-12-16 16:09:38 -05:00