Commit Graph

4895 Commits

Author SHA1 Message Date
Nicolas Geoffray
de782a2321 Also emit a label for TargetInstrInfo::GC_LABEL.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81206 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 07:36:18 +00:00
Chris Lattner
f4d2f5b565 add support for some missing modifiers on jumptable/constant pool entries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81199 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 06:25:12 +00:00
Chris Lattner
5b3d580925 add a bunch more evil lowering code to work around various :subreg32 modifiers
in the .td files.  This gets us down to 18 failures in codegen/x86 with the
new asmprinter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81198 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 06:19:15 +00:00
Chris Lattner
af0b6cdb69 ADd support for "lowering" the X86::MOVZX16rr8/X86::MOVZX16rm8
subreg32 modifiers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81196 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 06:03:07 +00:00
Chris Lattner
7ffa3c8029 add a hack to lower MOV16r0 to MOV32r0 in MCInstLower, eliminating
the problem with subreg32 modifiers.  This gets all of Olden working
with the new asmprinter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81195 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 05:49:25 +00:00
Chris Lattner
ba3598cb1f fix PR4767, a crash because fp stackifier visited blocks in
depth first order, so it wouldn't process unreachable blocks.
When compiling at -O0, late dead block elimination isn't done
and the bad instructions got to isel.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81187 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 04:55:44 +00:00
Anton Korobeynikov
6c4025773a Do not create calls via PLT in compilation callback - this is higly platform
dependent. Hopefully, this will fix PR3801.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81132 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 20:21:48 +00:00
Duncan Sands
da9ad384af Remove a left over bit of code with no effect.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81128 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 19:29:07 +00:00
Duncan Sands
33ef807145 Remove unreachable code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81126 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 19:27:53 +00:00
Duncan Sands
875f4ae789 Avoid an unused variable warning when assertions are
disabled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81122 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 16:27:34 +00:00
Duncan Sands
18f13c66bf Mark more constants unsigned, as warned about by icc (#68).
Patch by Erick Tryzelaar.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81116 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 12:56:52 +00:00
Duncan Sands
c2d98bc0d6 Remove some not-really-used variables, as warned
about by icc (#593, partial).  Patch by Erick Tryzelaar.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81115 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 12:41:19 +00:00
Bill Wendling
eb3a766529 If we've pushed registers onto the stack, but aren't adjusting the stack pointer
(i.e., there are no local variables and stuff), we still need to output FDE
information for the pushed registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80960 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 22:19:22 +00:00
Dan Gohman
8d44b28bc6 Recognize more opportunities to use SSE min and max instructions,
swapping the operands if necessary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80940 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 20:34:31 +00:00
Mon P Wang
efa422023f Fixed a few problems with vector shifts
- when transforming a vector shift of a non-immediate scalar shift amount, zero
    extend the i32 shift amount to i64 since the vector shift reads 64 bits
  - when transforming i16 vectors to use a vector shift, zero extend i16 shift amount
  - improve the code quality in some cases when transforming vectors to use a vector shift



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80935 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 19:56:25 +00:00
Dan Gohman
2f67df794a Add a -disable-16bit flag and associated support for experimenting with
disabling the use of 16-bit operations on x86. This doesn't yet work for
inline asms with 16-bit constraints, vectors with 16-bit elements,
trampoline code, and perhaps other obscurities, but it's enough to try
some experiments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80930 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 17:18:51 +00:00
Kevin Enderby
7b4608dfa0 Removed the non-target independent AsmToken::Register enum constant
from MCAsmLexer.h in preparation of supporting other targets.  Changed the
X86AsmParser code to reflect this by removing AsmLexer::LexPercent and looking
for AsmToken::Percent when parsing in places that used AsmToken::Register.
Then changed X86ATTAsmParser::ParseRegister to parse out registers as an
AsmToken::Percent followed by an AsmToken::Identifier.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80929 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 17:15:07 +00:00
Chris Lattner
47ad2d6e97 don't call getOffset() on jump tables, this fixes three failing olden benchmarks
with the new asmprinter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80906 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 07:36:42 +00:00
Chris Lattner
975d7e0392 Implement support for X86II::MO_GOT_ABSOLUTE_ADDRESS. We get very
different formatting from the old asmprinter, but it should be 
semantically the same.  We used to get:

	popl	%eax
	addl	$_GLOBAL_OFFSET_TABLE_ + [.-.Lllvm$6.$piclabel], %eax
...

Now we get:

	popl	%eax
.Lpicbaseref6:
	addl	$(_GLOBAL_OFFSET_TABLE_ + (.Lpicbaseref6 - .Lllvm$6.$piclabel)), %eax
...




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80905 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 07:30:56 +00:00
Evan Cheng
63476a8040 Reference to hidden symbols do not have to go through non-lazy pointer in non-pic mode. rdar://7187172.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80904 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 07:04:02 +00:00
Chris Lattner
1fe02ffbec remove extraneous hack.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80893 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 05:54:00 +00:00
Daniel Dunbar
848113833f Make these functions static and local.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80892 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 05:47:34 +00:00
Chris Lattner
684c593d05 Thread an MCAsmInfo pointer through the various MC printing APIs,
and fix a few things using << on MCSymbols to use ->print(). No
functionality change other than unbreaking my previous patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80890 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 05:46:51 +00:00
Chris Lattner
5c5ce5cef4 just use dump()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80889 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 05:39:09 +00:00
Chris Lattner
47548d3365 merge globaladdress symbol processing stuff into other stuff. Now
all global variable operand flag processing stuff is shared between
different operand types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80886 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 05:06:07 +00:00
Evan Cheng
22f9144c9b Unbreak x86_64 build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80885 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 05:01:00 +00:00
Chris Lattner
e8c2780521 Split the "operand -> symbol" logic from the "get offset and other munging
from operand" logic.  GlobalAddress still todo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80884 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 04:56:20 +00:00
Chris Lattner
118c27c6d4 implement lowering support for constant pool index operands, this gets a bunch more
olden programs working.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80881 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 04:44:53 +00:00
Evan Cheng
d0da6ff3ad X86JITInfo::getLazyResolverFunction() should not read cpu id to determine whether sse is available. Just use consult subtarget.
No functionality changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80880 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 04:37:05 +00:00
Chris Lattner
ef6b2c05fd simplify this by using SmallString::str(), much nicer!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80874 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 03:54:02 +00:00
Sean Callanan
9947bbb297 Added opaque 32-, 48-, and 80-bit memory operand types to the X86
instruction tables to support segmented addressing (and other objects
of obscure type).
Modified the X86 assembly printers to handle these new operand types.
Added JMP and CALL instructions that use segmented addresses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80857 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 00:04:47 +00:00
Chris Lattner
3bd52827bd switch from std::string to SmallString + raw_svector_ostream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80807 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 17:37:38 +00:00
Chris Lattner
522e9a0435 split mcinst lowering stuff out to its own file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80806 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 17:35:12 +00:00
Sandeep Patel
65c3c8f323 Retype from unsigned to CallingConv::ID accordingly. Approved by Bob Wilson.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80773 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 08:44:58 +00:00
Chris Lattner
5260097283 refactor select 'sched insertion' out to its own method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80764 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 05:57:00 +00:00
Chris Lattner
700841617a Add support for modeling whether or not the processor has support for
conditional moves as a subtarget feature.  This is the easy part of 
PR4841.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80763 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 05:53:04 +00:00
Sean Callanan
a09caa56d6 Fixed the asmstrings for 8-bit, 16-bit, and 32-bit ADD %rAX, imm instructions.
Added a 64-bit ADD %RAX, imm32 instruction.
Added all 4 forms for AND %rAX, imm and CMP %rAX, imm.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80746 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 00:55:49 +00:00
Daniel Dunbar
0378b72609 Simplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80729 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 22:07:06 +00:00
Daniel Dunbar
6b677b33c0 Fix what I believe is a copy-n-pasto introduced in r78129.
- Bruno, please check!!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80728 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 22:07:00 +00:00
Daniel Dunbar
4e8d5fe510 X86/Encoding: Support ExternalSymbol operands in emitDisplacementField (for consistency).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80727 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 22:06:53 +00:00
Daniel Dunbar
31e2c7b4c1 Remove Offset from ExternalSybmol MachineOperands, this is unused (and at least partly unsupported, in X86 encoding at least).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80726 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 22:06:46 +00:00
Sean Callanan
4a93b71fe7 Added TEST %rAX, $imm instructions to the Intel tables. These are required for the X86 disassembler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80696 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 18:14:18 +00:00
Daniel Dunbar
ec2e4679fd X86/exp-asm-printer: Lower MachineOperand::MO_JumpTableIndex to MCOperand.
- Down to 7 failures on 403.gcc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80605 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 19:14:05 +00:00
Daniel Dunbar
d2a0b272fe Stop printing old asm printing code inline with -experimental-asm-printer (this allows diffing and assembling the .s)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80604 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 19:13:56 +00:00
Daniel Dunbar
64926be847 Avoid unnecessary +0 in experimental-asm-printer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80603 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 19:13:47 +00:00
Duncan Sands
c69d74a5d4 Revert commit 80428. It completely broke exception
handling on x86-32 linux.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80592 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 16:45:16 +00:00
Benjamin Kramer
b4f770b68a Normalize makefile comments and sort cmake file lists.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80584 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 13:05:24 +00:00
Daniel Dunbar
8c2eebe407 llvm-mc: Switch MCInst to storing an MCExpr* instead of an MCValue.
Also, use MCInst::print instead of custom code in MCAsmPrinter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80575 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 08:08:38 +00:00
Daniel Dunbar
df65eafe5e llvm-mc/X86: Encode constant MCValue's correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80485 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 06:17:49 +00:00
Dan Gohman
71a258c36b CMOV_GR8 clobbers EFLAGS when its expansion involves an xor to set
a register to 0. This fixes PR4814.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80445 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-29 22:19:15 +00:00
Bill Wendling
9b35a09e7e - Add target lowering methods to get the preferred format for the FDE and LSDA
encodings.
- Make some of the values emitted by the FDEs dependent upon the pointer
  size. This is in line with how GCC does things. And it has the benefit of
  working for Darwin in 64-bit mode now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80428 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-29 12:20:54 +00:00
Anton Korobeynikov
6f9bb6f31b Short-term workaround for frame-related weirdness on win64.
Some other minor win64 fixes as well.

Patch by Michael Beck!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80370 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-28 16:06:41 +00:00
Dan Gohman
a4c5c33041 Don't mark CMOV_GR8 as two-address, or commutable, since it's a pseudo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80271 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 18:16:24 +00:00
Eric Christopher
f83a5def43 Add FIXME for when we support more specific XMM registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80269 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 18:08:16 +00:00
Eric Christopher
fd17929b86 Nuke trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80268 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 18:07:15 +00:00
Daniel Dunbar
7168a7dc6d llvm-mc/X86: Implement single instruction encoding interface for MC.
- Note, this is a gigantic hack, with the sole purpose of unblocking further
   work on the assembler (its also possible to test the mathcer more completely
   now).

 - Despite being a hack, its actually good enough to work over all of 403.gcc
   (although some encodings are probably incorrect). This is a testament to the 
   beauty of X86's MachineInstr, no doubt! ;)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80234 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 08:12:55 +00:00
Daniel Dunbar
1ca3a0bf22 X86: Mark EH_RETURN as code-gen-only.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80232 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 07:58:05 +00:00
Dan Gohman
7e7f06e70a X86FastISel support for loading and storing values of type i1.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80186 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 00:31:47 +00:00
Dan Gohman
cbbea0ffc7 Expand i8 selects into control flow instead of 16-bit conditional
moves. This avoids the need to promote the operands (or implicitly
extend them, a partial register update condition), and can reduce
i8 register pressure. This substantially speeds up code such as
write_hex in lib/Support/raw_ostream.cpp.

subclass-coalesce.ll is too trivial and no longer tests what it was
originally intended to test.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80184 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 00:14:12 +00:00
Dan Gohman
af70e5c676 Don't use INSERT_SUBREG to model anyext operations on x86-64, as it
leads to partial-register definitions. To help avoid redundant
zero-extensions, also teach the h-register matching patterns that
use movzbl to match anyext as well as zext.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80099 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 14:59:13 +00:00
Dan Gohman
79b765d057 Use X86II::MO_NO_FLAG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80012 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 17:47:44 +00:00
Dale Johannesen
f6163dc856 Fix PR 4751, another difficulty with %a modifier on x86.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79961 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 00:16:14 +00:00
Chris Lattner
dbe89cd2f0 remove the last uses of Config/alloca.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79873 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 22:57:38 +00:00
Benjamin Kramer
072a56e37d Remove Streams.h from the targets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79853 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 11:52:17 +00:00
Chris Lattner
4437ae213d eliminate uses of cerr()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79834 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 07:05:07 +00:00
Chris Lattner
705e07f578 remove various std::ostream version of printing methods from
MachineInstr and MachineOperand.  This required eliminating a
bunch of stuff that was using DOUT, I hope that bill doesn't
mind me stealing his fun. ;-)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79813 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 03:41:05 +00:00
Benjamin Kramer
f682f3d019 Forgot to update some CMakeLists.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79780 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 22:20:11 +00:00
Chris Lattner
33adcfb4d2 rename TAI -> MAI, being careful not to make MAILJMP instructions :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79777 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 21:43:10 +00:00
Chris Lattner
2807afa664 rename COFFMCAsmInfo -> MCAsmInfoCOFF, likewise for darwin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79773 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 21:03:30 +00:00
Chris Lattner
af76e592c7 Rename TargetAsmInfo (and its subclasses) to MCAsmInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79763 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 20:48:53 +00:00
Devang Patel
24f20e0832 Record variable debug info at ISel time directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79742 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 17:12:53 +00:00
Anton Korobeynikov
25f1aa04ff Fix a typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79634 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-21 15:41:56 +00:00
Sean Callanan
47234e6d38 Fixed PCMPESTRM128 to have opcode 0x60 instead of 0x62, as specified by the
Intel documentation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79554 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-20 18:24:27 +00:00
Dan Gohman
ef74e9bf2a Fix an x86 code size regression: prefer RIP-relative addressing
over absolute addressing even in non-PIC mode (unless the address
has an index or something else incompatible), because it has a
smaller encoding.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79553 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-20 18:23:44 +00:00
Dale Johannesen
231843ed16 Add an extra line to conform with preferred style.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79495 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 23:44:01 +00:00
Reid Kleckner
ce4eb39bb4 Modify an assert to avoid what looks like a GCC 4.2.4 signed-ness bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79494 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 23:39:59 +00:00
Dale Johannesen
7bcec7e541 Handle 'a' modifier in X86 asms. PR 4742.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79484 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 22:44:41 +00:00
Dan Gohman
6bd4aca29f Remove temporary testing code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79443 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 18:27:08 +00:00
Dan Gohman
6a402dc952 Add an x86 peep that narrows TEST instructions to forms that use
a smaller encoding. These kinds of patterns are very frequent in
sqlite3, for example.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79439 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 18:16:17 +00:00
Chris Lattner
6c2f9e14fd eliminate AsmPrinter::SwitchToSection and just have clients
talk to the MCStreamer directly instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79405 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 05:49:37 +00:00
Eric Christopher
b120ab4057 Implement sse4.2 string/text processing instructions:
Add patterns and instruction encoding information.
Add custom lowering to deal with hardwired return register of
uncertain type (xmm0).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79377 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 22:50:32 +00:00
Chris Lattner
090d73c6bd remove some pointless null switchtosections. The IntelAsmPrinter doesn't really work anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79321 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 06:03:07 +00:00
Chris Lattner
79e6408ad3 add support for some targetflags on GV operands. This allows us to
send instructions like:

NEW: 	movl	"L___stack_chk_guard$non_lazy_ptr" - "L1$pb"(%esi), %eax
OLD: 	movl	L___stack_chk_guard$non_lazy_ptr-"L1$pb"(%esi), %eax

through the streamer.  Several fixmes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79317 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 05:33:27 +00:00
Dan Gohman
25103a2617 Fix function alignment at -Os on x86 to be 1, not 2. getFunctionAlignment
returns a log2 value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79293 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 00:20:06 +00:00
Chris Lattner
8f4b1ec02b the MinPad argument to PadToColumn only really makes sense to be 1,
just remove the argument and replace it with 1.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79246 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 15:48:08 +00:00
Dan Gohman
face41a4de Avoid emitting XMM save code in soft-float or no-implicit-float mode
or some other situation where no xmm registers need to be saved.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79207 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-16 21:24:25 +00:00
Bill Wendling
80c76436fe Styalistic and format changes. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79187 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-16 11:00:26 +00:00
Chris Lattner
9b60e04b65 add support for external symbols + X86::MOVPC32r.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79175 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-16 04:28:14 +00:00
Chris Lattner
30c74a2429 implement support for lowering references to global addresses. For example, we now
can asmprint:

NEW: 	movl	"L___stack_chk_guard$non_lazy_ptr", %eax
OLD: 	movl	L___stack_chk_guard$non_lazy_ptr, %eax

where 'new' is coming out of the MCInst version of the printer.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79170 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-16 03:12:25 +00:00
Chris Lattner
f5af556c18 more formatting improvements, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79167 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-16 02:45:18 +00:00
Chris Lattner
d8638babf9 code formatting improvements, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79165 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-16 02:36:40 +00:00
Bill Wendling
3f5bb168bc An overhaul of the exception handling code. This is arguably more correct than
what was there before. In "no FP mode", we weren't generating labels and unwind
table entries after each "push" instruction. While more than likely "okay", it's
not technically correct. The major thing was that the ordering of when to define
a new CFA register and at what offset wasn't correct. This would cause the
exception handling to fail in ways most miserable to users.

I also cleaned up some code a bit. There's one function which has a "return" at
the beginning, so it's never used. Should I just remove it? :-)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79139 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-15 21:27:32 +00:00
Bill Wendling
af56634058 Reapply r79127. It was fixed by d0k.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79136 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-15 21:21:19 +00:00
Bill Wendling
f865ea85bd Revert r79127. It was causing compilation errors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79135 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-15 21:14:01 +00:00
Evan Cheng
088880cb19 Change allowsUnalignedMemoryAccesses to take type argument since some targets
support unaligned mem access only for certain types. (Should it be size
instead?)

ARM v7 supports unaligned access for i16 and i32, some v6 variants support it
as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79127 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-15 19:23:44 +00:00
Dan Gohman
d6708eade0 On x86-64, for a varargs function, don't store the xmm registers to
the register save area if %al is 0. This avoids touching xmm
regsiters when they aren't actually used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79061 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-15 01:38:56 +00:00
Oscar Fuentes
dac19a7951 CMake: Corrected variable check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79030 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-14 19:56:04 +00:00
Anton Korobeynikov
2247276c6f Properly handle indirect win64 args when they're passed in memory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79009 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-14 18:19:10 +00:00
Daniel Dunbar
c22e0b2443 Update llvm-mc / MCAsmStreamer to print the instruction using the actual target
specific printer (this only works on x86, for now).
 - This makes it possible to do some correctness checking of the parsing and
   matching, since we can compare the results of 'as' on the original input, to
   those of 'as' on the output from llvm-mc.

 - In theory, we could now have an easy ATT -> Intel syntax converter. :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78986 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-14 03:48:55 +00:00
Daniel Dunbar
575327b77e Add virtual printMCInst method to AsmPrinter, as a quick way to expose the API
to print one instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78985 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-14 03:43:57 +00:00