1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 12:02:58 +02:00
Commit Graph

51 Commits

Author SHA1 Message Date
Eric Christopher
3cb51e059d Split out these asserts so it's more apparent why we're not assembling
that rip-relative address when executing in 32-bit mode.

llvm-svn: 105656
2010-06-08 22:57:33 +00:00
Bruno Cardoso Lopes
255fda615d Reapply r105521, this time appending "LLU" to 64 bit
immediates to avoid breaking the build.

llvm-svn: 105652
2010-06-08 22:51:23 +00:00
Chris Lattner
33d0622cdc revert r105521, which is breaking the buildbots with stuff like this:
In file included from X86InstrInfo.cpp:16:
X86GenInstrInfo.inc:2789: error: integer constant is too large for 'long' type
X86GenInstrInfo.inc:2790: error: integer constant is too large for 'long' type
X86GenInstrInfo.inc:2792: error: integer constant is too large for 'long' type
X86GenInstrInfo.inc:2793: error: integer constant is too large for 'long' type
X86GenInstrInfo.inc:2808: error: integer constant is too large for 'long' type
X86GenInstrInfo.inc:2809: error: integer constant is too large for 'long' type
X86GenInstrInfo.inc:2816: error: integer constant is too large for 'long' type
X86GenInstrInfo.inc:2817: error: integer constant is too large for 'long' type

llvm-svn: 105524
2010-06-05 04:17:30 +00:00
Bruno Cardoso Lopes
b05131d907 Initial AVX support for some instructions. No patterns matched
yet, only assembly encoding support.

llvm-svn: 105521
2010-06-05 03:53:24 +00:00
Daniel Dunbar
7252b48af1 MCCodeEmitter: Add target independent fixup flag for is-pc-relative.
llvm-svn: 98954
2010-03-19 10:43:23 +00:00
Daniel Dunbar
1a50b05aff X86MCCodeEmitter: Fix two minor issues with reloc_riprel_4byte_movq_load, we
were missing it on some movq instructions and were not including the appropriate
PCrel bias.

llvm-svn: 98880
2010-03-18 21:53:54 +00:00
Chris Lattner
bf3e096258 fix an x86-64 encoding bug Daniel found.
llvm-svn: 98855
2010-03-18 20:04:36 +00:00
Chris Lattner
45ab55ccec add a special relocation type for movq loads for object
files that produce special relocation types where the 
linker changes movq's into lea's.

llvm-svn: 98839
2010-03-18 18:10:56 +00:00
Chris Lattner
b29b154904 make pcrel immediate values relative to the start of the field,
not the end of the field, fixing rdar://7651978

llvm-svn: 96330
2010-02-16 05:03:17 +00:00
Chris Lattner
b9c4a15ad5 teach the encoder to handle pseudo instructions like FP_REG_KILL,
encoding them into nothing.

llvm-svn: 96110
2010-02-13 19:16:53 +00:00
Daniel Dunbar
1581cae46f X86: Move extended MCFixupKinds into X86FixupKinds.h
llvm-svn: 96088
2010-02-13 09:27:52 +00:00
Chris Lattner
8530ba626c add encoder support and tests for rdtscp
llvm-svn: 96076
2010-02-13 03:42:24 +00:00
Chris Lattner
5b01ab848c remove special cases for vmlaunch, vmresume, vmxoff, and swapgs
fix swapgs to be spelled right.

llvm-svn: 96058
2010-02-13 00:41:14 +00:00
Chris Lattner
1d25e3978d Remove special cases for [LM]FENCE, MONITOR and MWAIT from
encoder and decoder by using new MRM_ forms.

llvm-svn: 96048
2010-02-12 23:54:57 +00:00
Chris Lattner
4170bb81da implement the rest of correct x86-64 encoder support for
rip-relative addresses, and add a testcase.

llvm-svn: 96040
2010-02-12 23:24:09 +00:00
Chris Lattner
946403d05f give MCCodeEmitters access to the current MCContext.
llvm-svn: 96038
2010-02-12 23:12:47 +00:00
Chris Lattner
e90d092fd7 implement infrastructure to support fixups for rip-rel
addressing.  This isn't complete because I need an MCContext
to generate new MCExprs.

llvm-svn: 96036
2010-02-12 23:00:36 +00:00
Chris Lattner
0a7654c7c9 pull the rip-relative addressing mode case up early.
llvm-svn: 96031
2010-02-12 22:47:55 +00:00
Chris Lattner
3df1321651 fixme resolved!
llvm-svn: 96029
2010-02-12 22:39:06 +00:00
Chris Lattner
1e01ac75bc start producing reloc_pcrel_4byte/reloc_pcrel_1byte for calls.
llvm-svn: 96028
2010-02-12 22:36:47 +00:00
Chris Lattner
c3dbd2e2fc add a bunch of mod/rm encoding types for fixed mod/rm bytes.
This will work better for the disassembler for modeling things
like lfence/monitor/vmcall etc.

llvm-svn: 95960
2010-02-12 02:06:33 +00:00
Chris Lattner
9307e00dc0 fix the encodings of monitor and mwait, which were completely
busted in both encoders.  I'm not bothering to fix it in the
old one at this point.

llvm-svn: 95947
2010-02-12 01:06:22 +00:00
Chris Lattner
144a1b7a24 add a new MCInstPrinter::getOpcodeName interface, when it is
implemented, llvm-mc --show-inst now uses it to print the
instruction opcode as well as the number.

llvm-svn: 95929
2010-02-11 22:39:10 +00:00
Chris Lattner
b82b965968 make getFixupKindInfo return a const reference, allowing
the tables to be const.  Teach MCCodeEmitter to handle
the target-indep kinds so that we don't crash on them.

llvm-svn: 95924
2010-02-11 21:27:18 +00:00
Chris Lattner
a0e0de6974 switch to target-indep fixups for 1/2/4/8 byte data.
llvm-svn: 95920
2010-02-11 21:17:54 +00:00
Chris Lattner
d69e1c1bb2 refactor the conditional jump instructions in the .td file to
use a multipattern that generates both the 1-byte and 4-byte 
versions from the same defm

llvm-svn: 95901
2010-02-11 19:25:55 +00:00
Chris Lattner
83ee8edc66 dont' call getX86RegNum on X86::RIP, it doesn't like that. This
fixes the remaining x86-64 jit failures afaik.

llvm-svn: 95867
2010-02-11 08:45:56 +00:00
Chris Lattner
c279bf31b7 fix a really nasty bug I introduced in r95693: r12 (and r12d,
r12b, etc) also encodes to a R/M value of 4, which is just
as illegal as ESP/RSP for the non-sib version an address.

This fixes x86-64 jit miscompilations of a bunch of programs.

llvm-svn: 95866
2010-02-11 08:41:21 +00:00
Chris Lattner
53d91ce3e1 Add and commonize encoder support for all immediates.
Stub out some dummy fixups to make things work.

We can now emit fixups like this:
	subl	$20, %esp               ## encoding: [0x83,0xec,A]
                                        ##   fixup A - offset: 2, value: 20, kind: fixup_1byte_imm

Emitting $20 as a single-byte fixup to be later resolved
by the assembler is ridiculous of course (vs just emitting
the byte) but this is a failure of the matcher, which 
should be producing an imm of 20, not an MCExpr of 20.

llvm-svn: 95860
2010-02-11 07:06:31 +00:00
Chris Lattner
2e2935e175 generalize EmitDisplacementField to work with any size
and rename it to EmitImmediate.

llvm-svn: 95859
2010-02-11 06:54:23 +00:00
Chris Lattner
1fe88248f8 eliminate the dead IsPCRel argument.
llvm-svn: 95858
2010-02-11 06:51:36 +00:00
Chris Lattner
1d5fbc4deb eliminate the dead "PCAdj" logic.
llvm-svn: 95857
2010-02-11 06:49:52 +00:00
Chris Lattner
72dfdc8b8a emit some simple (and probably incorrect) fixups for symbolic
displacement values.

llvm-svn: 95773
2010-02-10 06:52:12 +00:00
Chris Lattner
6abaa9ee3c keep track of what the current byte being emitted is
throughout the X86 encoder.

llvm-svn: 95771
2010-02-10 06:41:02 +00:00
Chris Lattner
aa22470a1a simplify displacement handling, emit displacements by-operand
even for the immediate case.  No functionality change.

llvm-svn: 95770
2010-02-10 06:30:00 +00:00
Daniel Dunbar
ddfda89472 MC: First cut at MCFixup, for getting fixup/relocation information out of an MCCodeEmitter.
llvm-svn: 95708
2010-02-09 22:59:55 +00:00
Chris Lattner
3bdac5074e port encoder enhancements over to the new encoder.
llvm-svn: 95699
2010-02-09 21:57:34 +00:00
Chris Lattner
261d9ac280 add note.
llvm-svn: 95445
2010-02-05 22:48:33 +00:00
Chris Lattner
8db3500688 port X86InstrInfo::determineREX over to the new encoder.
llvm-svn: 95440
2010-02-05 22:10:22 +00:00
Chris Lattner
15817c2239 wire up 64-bit MCCodeEmitter.
llvm-svn: 95438
2010-02-05 21:51:35 +00:00
Chris Lattner
22151cbec5 really kill off the last MRMInitReg inst, remove logic from encoder.
llvm-svn: 95437
2010-02-05 21:34:18 +00:00
Chris Lattner
3590276566 implement the rest of the encoding types.
llvm-svn: 95414
2010-02-05 19:37:31 +00:00
Chris Lattner
a6d9d45f42 move functions for decoding X86II values into the X86II namespace.
llvm-svn: 95410
2010-02-05 19:24:13 +00:00
Chris Lattner
d43a7714c9 change getSizeOfImm and getBaseOpcodeFor to just take
TSFlags directly instead of a TargetInstrDesc.

llvm-svn: 95405
2010-02-05 19:16:26 +00:00
Chris Lattner
f20e6a05bd add some more encodings.
llvm-svn: 95403
2010-02-05 19:04:37 +00:00
Chris Lattner
c59cbacb06 implement the non-relocation forms of memory operands
llvm-svn: 95368
2010-02-05 06:16:07 +00:00
Chris Lattner
adf475aaf7 start adding MRMDestMem, which requires memory form mod/rm encoding
to start limping.

llvm-svn: 95350
2010-02-05 02:18:40 +00:00
Chris Lattner
f1f355c706 Add a few more encodings, we can now encode all of:
pushl	%ebp
	movl	%esp, %ebp
	movl	$42, %eax
	popl	%ebp
	ret

llvm-svn: 95344
2010-02-05 01:53:19 +00:00
Chris Lattner
26cf12e3c9 enhance new encoder to support prefixes + RawFrm
instructions with no operands.  It can now handle

define void @test2() nounwind { ret void }

llvm-svn: 95261
2010-02-03 21:57:59 +00:00
Chris Lattner
5078a382e4 set up some infrastructure, some minor cleanups.
llvm-svn: 95260
2010-02-03 21:43:43 +00:00