aboutsummaryrefslogtreecommitdiff
path: root/i386-asm.c
Commit message (Collapse)AuthorAgeFilesLines
* x86-asm: Reject some invalid arith imm8 instructionMichael Matz2016-05-161-0/+7
| | | | | | | There were two errors in the arithmetic imm8 instruction. They accept only REGW, and in case the user write a xxxb opcode that variant needs to be rejected as well (it's not automatically rejected by REGW in case the destination is memory).
* x86-asm: Fix signed constants and opcode orderMichael Matz2016-05-141-1/+3
| | | | | | | | Two things: negative constants were rejected (e.g. "add $-15,%eax"). Second the insn order was such that the arithmetic IM8S forms weren't used (always the IM32 ones). Switching them prefers those but requires a fix for size calculation in case the opcodes were OPC_ARITH and OPC_WLX (whose size starts with 1, not zero).
* x86-asm: Consolidate insn descriptionsMichael Matz2016-05-141-0/+2
| | | | | Use OPC_BWLX and OPC_WLX in i386-asm.h and x86_64-asm.h to reduce number of differences between both.
* x86-64-asm: Clean up 64bit immediate supportMichael Matz2016-05-111-18/+16
| | | | | | | | | Fix it to actually be able to parse 64bit immediates (enlarge operand value type). Then, generally there's no need for accepting IM64 anywhere, except in the 0xba+r mov opcodes, so OP_IM is unnecessary, as is OPT_IMNO64. Improve the generated code a bit by preferring the 0xc7 opcode for im32->reg64, instead of the im64->reg64 form (which we therefore hardcode).
* x86-asm: Get rid of is_short_jumpMichael Matz2016-05-111-7/+4
| | | | Can be implemented differently.
* x86-asm: Remove old ASM_16 codeMichael Matz2016-05-111-185/+6
| | | | | | This code was inactive since a long time (and was deactivated because it was wrong to start with) and just clutters the sources. Remove it.
* x86-64: Run asmtest as wellMichael Matz2016-05-111-0/+4
| | | | | This fixes and activates the asm test that's part of tcctest.c also on x86-64, requiring a small fix for the 'm' constraint.
* x86-64 asm: Remove useless jmp opcodeMichael Matz2016-05-111-7/+0
| | | | | Also remove the hacky mod/rm byte emission during disp/imm writing.
* x86: Improve cmov handlingMichael Matz2016-05-111-0/+5
| | | | | cmov can accept multi sizes, but is also a OPC_TEST opcode, deal with this.
* [x86] Fix some asm problemsMichael Matz2016-05-091-16/+71
| | | | | | | | | | | A bag of assembler fixes, to be either compatible with GAS (e.g. order of 'test' operands), accept more instructions, count correct foo{bwlq} variants on x86_64, fix modrm/sib bytes on x86_64 to not use %rip relative addressing mode, to not use invalid insns in tests/asmtest.S for x86_64. Result is that now output of GAS and of tcc on tests/asmtest.S is mostly the same.
* Improve hash performanceVlad Vissoultchev2016-04-171-5/+5
| | | | | | | | | | | | - better `TOK_HASH_FUNC` - increases `hash_ident` initial size to 16k (from 8k) - `cstr_cat` uses single `realloc` + `memcpy` - `cstr_cat` can append terminating zero - `tok_str_realloc` initial size to 16 (from 8) - `parse_define` uses static `tokstr_buf` - `next` uses static `tokstr_buf` - fixes two latent bugs (wrong deallocations in libtcc.c:482 and tccpp.c:2987)
* Change the way struct CStrings are handled.Edmund Grimley Evans2015-11-261-1/+1
| | | | | | | | | A CString used to be copied into a token string, which is an int array. On a 64-bit architecture the pointers were misaligned, so ASan gave lots of warnings. On a 64-bit architecture that required memory accesses to be correctly aligned it would not work at all. The CString is now included in CValue instead.
* Merge the integer members of union CValue into "uint64_t i".Edmund Grimley Evans2015-11-171-5/+5
|
* Revert all of my changes to directories & codingstyle.gus knight2015-07-291-0/+1502
|
* Reorganize the source tree.gus knight2015-07-271-1502/+0
| | | | | | | | | | * Documentation is now in "docs". * Source code is now in "src". * Misc. fixes here and there so that everything still works. I think I got everything in this commit, but I only tested this on Linux (Make) and Windows (CMake), so I might've messed something up on other platforms...
* Trim trailing spaces everywhere.gus knight2015-07-271-1/+1
|
* Convert some lines from ISO-8859-1 to UTF-8.Edmund Grimley Evans2015-03-111-1/+1
| | | | | | | | perl -i -pe 'use Text::Iconv; $c1 = Text::Iconv->new("utf-8", "utf-8"); $c2 = Text::Iconv->new("iso-8859-1", "utf-8"); if (!$c1->convert($_)) { $_ = $c2->convert($_); }' \ `find * -type f`
* Corrected spelling mistakes in comments and stringsVincent Lefevre2014-04-071-1/+1
|
* Detect correct instruction with incorrect operandsThomas Preud'homme2013-09-241-0/+4
| | | | | | Display a different warning when an instruction is recognized by tcc but the operands found do not correspond to the constraints of the instruction.
* add version number to manpageUrs Janssen2013-02-171-1/+1
| | | | | | | avoid c++/c99 style comments in preprocessor directives avoid leadings whitespaces in preprocessor directives mention implemented variable length arrays in documentation fixed ambiguous option in texi2html call (Austin English)
* rename error/warning -> tcc_(error/warning)grischka2011-08-111-26/+26
|
* tccasm: accept bracketed offset expressionsJoe Soroka2011-02-011-2/+14
|
* tccasm: allow one-line prefix+op things like "rep stosb"Joe Soroka2011-02-011-0/+5
|
* win64: add tiny unwind data for setjmp/longjmpgrischka2009-12-201-0/+4
| | | | | | | | | This enables native unwind semantics with longjmp on win64 by putting an entry into the .pdata section for each compiled fuction. Also, the function now use a fixed stack and store arguments into X(%rsp) rather than using push.
* allow tcc be build from separate objectsgrischka2009-12-201-9/+11
| | | | If you want that, run: make NOTALLINONE=1
* integrate x86_64-asm.c into i386-asm.cgrischka2009-12-191-248/+368
| | | | | Also, disable 16bit support for now as it causes bugs in 32bit mode. #define I386_ASM_16 if you want it.
* i386-asm: fix imulgrischka2009-12-061-1/+2
| | | | | | With imul the 3rd operand defaults to the 2nd on. The previous logic left 'op_type[2]' uninitialized which caused the bug to show up only sometimes.
* asm 32/64: replace (long)sym->next by sym->jnextgrischka2009-11-211-3/+3
|
* fix 32bit asmgrischka2009-11-141-25/+13
| | | | | | | The new 16bit code was causing wrong 0x66 prefixes in 32bit code. The fix possibly breaks the feature on 16bit asm.
* fix ambiguityBernhard Reutner-Fischer2009-11-131-1/+1
| | | | Signed-off-by: aldot <rep.dot.nop@gmail.com>
* Fixed compilation error in i386-asm.cFrederic Feret2009-11-131-3/+1
|
* added 16-bit x86 assembly supportFrederic Feret2009-11-131-31/+188
|
* get rid of a warning and fix .batgrischka2008-03-251-8/+7
|
* Comply to c89 compilers other than gcc (Hanzac Chen)grischka2008-03-251-0/+3
|
* allow (base,index) as alias to (base,index,1)bellard2006-02-201-2/+4
|
* segment override prefix support (Filip Navara)bellard2005-09-031-2/+26
|
* fixed 'no base' modrm generation - better asm constraints handlingbellard2004-10-181-83/+158
|
* changed license to LGPLbellard2003-05-241-11/+11
|
* added % constraintbellard2003-04-271-4/+10
|
* added 'A' asm constraintbellard2003-04-141-5/+30
|
* asm supportbellard2003-01-061-0/+1077