Commit Graph

20 Commits

Author SHA1 Message Date
z b8fcf27b22 RISCV support ISRV32/ISRV64 (#1401)
* Added RISCV dir to contain the RISCV architecture engine code. Adding the TableGen files generated from llvm-tblgen. Add Disassembler.h

* Started working on RISCVDisassembler.c - RISCV_init(), RISCVDisassembler_getInstruction, and RISCV_getInstruction

* Added all functions to RISCVDisassembler.c and needed modifications to RISCVGenDisassemblerTables.inc. Add and modified RISCVGenSubtargetInfo.inc. Start creation of RISCVInstPrinter.h

* Finished RISCVGenAsmWriter.inc. Finished RISCVGenRegisterInfo.inc. Minor fixes to RISCVDisassembler.c. Working on RISCVInstPrinter

* Finished RISCVInstPrinter, RISCVMapping, RISCVBaseInfo, RISCVGenInstrInfo.inc, RISCVModule.c. Working on riscv.h

* Backport it from: 0db412ce3b

* All RISCV files added. Compiled correctly and initial test for ADD, ADDI, AND works properly.

* Add refactored cs.c for RISCV

* Testing all I instructions in test_riscv.c

* Modify the orignal backport for RISCVGenRegisterInfo.inc, capstone.h and test_iter to work w/ the current code strcuture

* Fix issue with RISCVGenRegisterInfo.inc - RISCVRegDesc[] (Excess elements in struct initializer). Added RISCV tests to test_iter.c

* fixed bug related to incorrect initialization of memory after malloc

* fix compile bug

* Fix compile errors.

* move riscv.h to include/capstone

* fix indentation issues

* fix coding style issues

* Fix indentation issues

* fix coding style

* Move variable declaration to the top of the block

* Fix coding indentation

* Move some stuff into RISCVMappingInsn.inc

* Fix code sytle

* remove cs_mode support for RISCV

* update asmwriter-inc to LLVM upstream

* update the .inc files to riscv upstream

* update riscv disassembler function for suport 16bit instructions

* update printer & tablegen inc files which have fixed arguments mismatch

* update headers and mapping source

* add riscv architecture specific test code

* fix all RISCV tons of compiler errors

* pass final tests

* add riscv tablegen patchs

* merge with upstream/next

* fix cstool missing riscv file

* fix root Makefile

* add new TableGen patchs for riscv

* fix cmakefile.txt of missing one riscv file

* fix declaration conflict

* fix incompatible declaration type

* change riscvc from arch to mode

* fix test_riscv warnning

* fix code style and add riscv part of test_basic

* add RISCV64 mode

* add suite for riscv

* crack fuzz test

* fix getfeaturebits test add riscvc

* fix test missing const qualifier warnning

* fix testcase type mismatch

* fix return value missing

* change getfeaturebits test

* add test cs files

* using a winder type contain the decode string

* fix a copy typo

* remove useless mode for riscv

* change cs file blank type

* add repo for update_riscv & fix cstool missing riscv mode

* fix typo

* add riscv for cstool useage

* add TableGen patch for riscv asmwriter

* clean ctags file

* remove black comment line

* fix fuzz related something

* fix missing RISCV string of fuzz

* update readme, etc..

* add riscv *.s.cs file

* add riscv *.s.cs file & clear ctags

* clear useless array declarations at capstone_test

* update to 5e4069f

* update readme change name more formal

* change position of riscv after bpf and modify copyright more uniform

* clear useless ctags file

* change blank with tab in riscv.h

* add riscv python bindings

* add riscv in __init__.py

* fix riscv define value for python binding

* fix test_riscv.py typo

* add missing riscvc in __init__.py of python bindings

* fix alias-insn printer bug, remove useless newline

* change inst print delimter from tab to bankspace for travis

* add riscv tablegen patch

* fix inst output more consistency

* add TableGen patch which fix inst output formal

* crack the effective address output for detail and change register print function

* fix not detail crash bug

* change item declaration position at cs_riscv

* update riscv.py

* change function name more meaningfull

* update python binding makefile

* fix register enum sequence according to riscvgenreginfo.inc

* test function name

* add enum s0/fp in riscv.h & update riscv_const.py

* add register name enum
2019-03-09 08:41:12 +08:00
Daniel Collin 2ee675c10a This adds M68K support to Capstone 2015-10-02 20:47:00 +02:00
Nguyen Anh Quynh d83c8c7d44 suite: change CS_MODE_32 -> CS_MODE_MIPS32, CS_MODE_64 -> CS_MODE_MIPS64 for fuzz.py & benchmark.py 2014-11-17 17:38:18 +08:00
Nguyen Anh Quynh 6a5cc570cc suite: support XCore in benchmark.py 2014-06-17 18:17:26 +08:00
Nguyen Anh Quynh 61aaabbba0 suite: add SystemZ support to benchmark.py & fuzz.py 2014-03-23 22:56:38 +08:00
Nguyen Anh Quynh 61b7a722c1 suite: add Sparc support 2014-03-10 15:44:48 +08:00
Nguyen Anh Quynh 07b2037816 suite: cosmetic fixes for benchmark.py 2014-03-04 12:19:49 +08:00
Nguyen Anh Quynh 1ad3723214 suite: remove some irrelevant comments in benchmark.py 2014-02-20 23:39:27 +08:00
Nguyen Anh Quynh d53c1651a0 python: implement disasm_lite() method which only return tuples of some critical info. this improves performance by 15% 2014-02-20 12:10:52 +08:00
Nguyen Anh Quynh 321163bf34 suite: turn off detail for benchmark.py 2014-02-19 10:51:10 +08:00
Nguyen Anh Quynh 94020d8478 x86: fix the issue with prefix instruction declared in 2.0's RELEASE_NOTES 2014-01-25 14:22:15 +08:00
Nguyen Anh Quynh 9389947d0d x86: fix a mem leaking issue in X86_insn_combine() 2014-01-25 13:58:58 +08:00
Nguyen Anh Quynh 11b05193ec reset prev_prefix at the entry of cs_disasm_ex(). this fixes a nasty segfault bug 2014-01-22 11:06:34 +08:00
Nguyen Anh Quynh 9162aa1756 suite: cleanup benchmark.py 2014-01-22 11:06:22 +08:00
Nguyen Anh Quynh f48a879e31 suite: benchmark.py can benchmark specific archs, rather than all archs like before 2014-01-13 16:25:36 +08:00
Nguyen Anh Quynh 783e6c006c suite: benchmark.py now exercises all archs 2014-01-13 15:55:12 +08:00
Nguyen Anh Quynh ff93d75879 suite: excercise benchmark.py 5 times more 2014-01-13 15:10:42 +08:00
Nguyen Anh Quynh 34474f8989 suite: benchmark.py get disasm code from binary file (python itself) rather than randomize data - this stablizes results, and can be compared with other bindings 2014-01-13 14:49:55 +08:00
Nguyen Anh Quynh 3079ed61cb suite: cleaning benchmark.py 2014-01-09 08:20:38 +08:00
Nguyen Anh Quynh 6d50dc3c26 add benchmark.py 2014-01-07 11:32:40 +08:00