Commit Graph

821 Commits

Author SHA1 Message Date
Rafael Espindola 6f23eb380d Implement TLSLDM.
llvm-svn: 117544
2010-10-28 14:37:09 +00:00
Rafael Espindola b3b49bbc39 Implement VK_GOTNTPOFF and switch RelocNeedsGOT to use VariantKind.
llvm-svn: 117543
2010-10-28 14:22:44 +00:00
Evan Cheng 0165e25564 Disable most of the ARM vfp / NEON MC tests. These are too fragile to be useful.
I'll work with Jim, Owen, and Bill on an alternative testing strategy until
the assembly parser is available.

llvm-svn: 117530
2010-10-28 06:46:17 +00:00
Owen Anderson 2ef668840a Add correct NEON encodings for vtbl and vtbx.
llvm-svn: 117513
2010-10-28 00:18:46 +00:00
Owen Anderson 14be930317 Add correct NEON encodings for vext, vtrn, vuzp, and vzip.
llvm-svn: 117512
2010-10-27 23:56:39 +00:00
Owen Anderson 9f371e7efa Tests for NEON encoding of vrev.
llvm-svn: 117502
2010-10-27 22:54:49 +00:00
Owen Anderson fadb951e5b Provide correct encodings for NEON vcvt, which has its own special immediate encoding
for specifying fractional bits for fixed point conversions.

llvm-svn: 117501
2010-10-27 22:49:00 +00:00
Owen Anderson ed9652f959 Provide correct encodings for the get_lane and set_lane variants of vmov.
llvm-svn: 117495
2010-10-27 21:28:09 +00:00
Rafael Espindola f8537165bd Add support for R_386_TLS_GD, R_386_TLS_LE_32, R_386_TLS_IE and R_386_TLS_LE.
llvm-svn: 117494
2010-10-27 21:23:52 +00:00
Kevin Enderby 5e7cb5fc27 Added the x86 instruction ud2b (2nd official undefined instruction).
llvm-svn: 117485
2010-10-27 20:46:49 +00:00
Rafael Espindola 24c8b04d5f Implement R_X86_64_GOTTPOFF, R_X86_64_TLSGD and R_X86_64_TPOFF32.
llvm-svn: 117481
2010-10-27 20:28:07 +00:00
Owen Anderson 40d24a4abf Provide correct NEON encodings for vdup.
llvm-svn: 117475
2010-10-27 19:25:54 +00:00
Rafael Espindola 095fa9e5cc Set default type and flags for .init and .fini.
llvm-svn: 117471
2010-10-27 18:45:20 +00:00
Owen Anderson fbdeab911a Tests for NEON encoding of vmovl, vmovn, vqmovn, and vqmovun.
llvm-svn: 117469
2010-10-27 18:17:12 +00:00
Owen Anderson 5fa98baef7 Tests for NEON encoding of vcls, vclz, and vcnt.
llvm-svn: 117466
2010-10-27 18:05:25 +00:00
Owen Anderson 6b5af599c0 Tests for NEON encoding of vneg and vqneg.
llvm-svn: 117463
2010-10-27 17:57:26 +00:00
Rafael Espindola 26496e6835 Produce an error for an invalid use of .symver.
llvm-svn: 117462
2010-10-27 17:56:18 +00:00
Owen Anderson 1e5eb98ed8 Tests for NEON encoding of vabs and vqabs.
llvm-svn: 117460
2010-10-27 17:50:07 +00:00
Owen Anderson 8576a42cf3 Add correct NEON encodings for vsli and vsri.
llvm-svn: 117459
2010-10-27 17:40:08 +00:00
Owen Anderson d7e8135e1e Add correct NEON encodings for vsra and vrsra.
llvm-svn: 117458
2010-10-27 17:29:29 +00:00
Rafael Espindola cc1b168ef6 Symbols defined as the difference of other two end up in the ABS section.
llvm-svn: 117451
2010-10-27 16:04:30 +00:00
Rafael Espindola eb0c2c170d Add support for the .symver directive. This is really ugly, but most of it is
contained in the ELF object writer.

llvm-svn: 117448
2010-10-27 15:18:17 +00:00
Kevin Enderby 9ad2166899 Yet another tweak to X86 instructions to add ud2a as an alias to ud2
(still to add ud2b).

llvm-svn: 117435
2010-10-27 03:01:02 +00:00
Kevin Enderby 20b021c970 Another tweak to X86 instructions to add the missing flex instruction (without
the wait prefix).

llvm-svn: 117434
2010-10-27 02:53:04 +00:00
Kevin Enderby a1917c7555 Tweaks to X86 instructions to allow the 'w' suffix in places it makes
sense, when the instruction takes the 16-bit ax register or m16 memory
location.  These changes to llvm-mc matches what the darwin assembler
allows for these instructions.  Done differently than in r117031 that
caused a valgrind error which was later reverted.

llvm-svn: 117433
2010-10-27 02:32:19 +00:00
Kevin Enderby ba985d9dd5 Added some aliases to the fcomip and fucompi Intel instructions. So that llvm-mc
will accept versions that the darwin assembler allows.  Forms ending in "pi" and
forms without all the operands.

llvm-svn: 117427
2010-10-27 00:59:28 +00:00
Owen Anderson 825b2d1946 Add correct NEON encodings for vqshl, vqshrn, vqshrun, vqrshl, vqshrn, and vqrshrun.
llvm-svn: 117411
2010-10-26 22:50:46 +00:00
Owen Anderson 2888e2c7f9 Correct NEON encodings for vshrn, vrshl, vrshr, vrshrn.
llvm-svn: 117402
2010-10-26 21:58:41 +00:00
Owen Anderson c4126a1a2c Add tests for NEON encoding of vshll.
llvm-svn: 117399
2010-10-26 21:21:47 +00:00
Owen Anderson 0fbb20769f Tests for NEON encoding of vshr.
llvm-svn: 117396
2010-10-26 21:08:42 +00:00
Owen Anderson 3665fee8de Provide correct NEON encodings for vshl, register and immediate forms.
llvm-svn: 117394
2010-10-26 20:56:57 +00:00
Rafael Espindola c9fb35e73b Add support for .ident.
llvm-svn: 117389
2010-10-26 19:35:47 +00:00
Owen Anderson db192ba90f Tests for NEON encoding of vrecpe, vrecps, vrsqrte, and vsqrts.
llvm-svn: 117385
2010-10-26 18:43:13 +00:00
Owen Anderson b3bcf529fc Tests for NEON encodings of vpmin and vpmax.
llvm-svn: 117382
2010-10-26 18:31:47 +00:00
Owen Anderson 691ce68d3c Add correct NEON encoding for vpadal.
llvm-svn: 117380
2010-10-26 18:18:03 +00:00
Owen Anderson 035b3261ee Tests for NEON encoding of vpadd and vpaddl.
llvm-svn: 117377
2010-10-26 18:04:51 +00:00
Owen Anderson 284cb361d1 Add NEON encodings for vmov and vmvn of immediates.
llvm-svn: 117374
2010-10-26 17:40:54 +00:00
Rafael Espindola e8ae98817a Implement some relaxations for arithmetic instructions. The limitation
on RIP relative relocations looks artificial, but this is a superset of
what we were able to do before.

llvm-svn: 117364
2010-10-26 14:09:12 +00:00
Bob Wilson e1961fe289 When the "true" and "false" blocks of a diamond if-conversion are the same,
do not double-count the duplicate instructions by counting once from the
beginning and again from the end.  Keep track of where the duplicates from
the beginning ended and don't go past that point when counting duplicates
at the end.  Radar 8589805.

This change causes one of the MC/ARM/simple-fp-encoding tests to produce
different (better!) code without the vmovne instruction being tested.
I changed the test to produce vmovne and vmoveq instructions but moving
between register files in the opposite direction.  That's not quite the same
but predicated versions of those instructions weren't being tested before,
so at least the test coverage is not any worse, just different.

llvm-svn: 117333
2010-10-26 00:02:24 +00:00
Owen Anderson c0f777afbf Tests for NEON encoding of vmax.
llvm-svn: 117327
2010-10-25 23:45:34 +00:00
Owen Anderson 144c3f8c6a Tests for NEON encoding of vmin.
llvm-svn: 117326
2010-10-25 23:35:36 +00:00
Owen Anderson 1f6aad053d Add correct encodings for NEON vabal.
llvm-svn: 117315
2010-10-25 21:29:04 +00:00
Owen Anderson b9c91679aa Add correct NEON encodings for vaba.
llvm-svn: 117309
2010-10-25 20:52:57 +00:00
Owen Anderson 12214ddaa3 Tests for NEON encoding of vabdl.
llvm-svn: 117303
2010-10-25 20:36:28 +00:00
Owen Anderson 64aa05f865 Add tests for NEON encoding of vabd.
llvm-svn: 117302
2010-10-25 20:29:27 +00:00
Daniel Dunbar b3a48f3459 MC/AsmParser: Fix relative precedence of {+,-} and comparison ops.
llvm-svn: 117299
2010-10-25 20:18:56 +00:00
Daniel Dunbar 7484d2cbec MC/AsmLexer: Fix bug in source location for Slash token.
llvm-svn: 117298
2010-10-25 20:18:53 +00:00
Daniel Dunbar 95db1cc022 tweak test.
llvm-svn: 117297
2010-10-25 20:18:49 +00:00
Daniel Dunbar 0c193ca626 MC/AsmParser: Rewrite test to actually check some parts of expression parsing,
now that we have macros and friends. Uncovered a bug in macro expansion...

llvm-svn: 117295
2010-10-25 20:18:41 +00:00
Owen Anderson dd001b89d7 Attempt to provide correct encodings for NEON vbit and vbif, even though we can't test them at the moment.
llvm-svn: 117294
2010-10-25 20:17:22 +00:00
Owen Anderson dea09c7564 Provide correct NEON encodings for vbsl.
llvm-svn: 117293
2010-10-25 20:13:13 +00:00
Owen Anderson 2477446ee5 Add correct instruction encodings for vbic, vorn, and vmvn.
llvm-svn: 117282
2010-10-25 18:43:52 +00:00
Owen Anderson dff239c5f9 Provide correct NEON encodings for vand, veor, and vorr.
llvm-svn: 117279
2010-10-25 18:28:30 +00:00
Owen Anderson d9cdda9ddc Add tests for NEON encoding of vtst.
llvm-svn: 117277
2010-10-25 18:10:34 +00:00
Owen Anderson feb3ee0c93 Add NEON encoding tests for vcgt and vacgt.
llvm-svn: 117276
2010-10-25 18:03:59 +00:00
Owen Anderson e5d0677173 Add tests for NEON encodings of vcge and vacge.
llvm-svn: 117274
2010-10-25 17:49:32 +00:00
Owen Anderson c178b80f65 Add a warning about our inability to test the encoding of vceq with immediate zero.
llvm-svn: 117273
2010-10-25 17:33:02 +00:00
Owen Anderson 02917f5b1b Add tests for NEON encoding of vceq.
llvm-svn: 117270
2010-10-25 17:20:26 +00:00
Owen Anderson a9ad6c0645 Add tests for NEON encoding of vsubhn and vrsubhn.
llvm-svn: 117269
2010-10-25 17:12:46 +00:00
Owen Anderson 358900d569 Add tests for NEON encoding of vqsub.
llvm-svn: 117214
2010-10-23 18:02:16 +00:00
Owen Anderson 92644efaf8 Add tests for NEON encoding of vhsub.
llvm-svn: 117189
2010-10-22 23:58:22 +00:00
Jim Grosbach 0ce06c08fb Add a CMP test.
llvm-svn: 117187
2010-10-22 23:48:01 +00:00
Owen Anderson f4e1a09d38 Add tests for NEON encoding of vsubw.
llvm-svn: 117186
2010-10-22 23:46:07 +00:00
Owen Anderson 9ef5c507ce Add tests for NEON encoding of vsubl.
llvm-svn: 117183
2010-10-22 23:36:36 +00:00
Owen Anderson c372775cc8 Add tests for NEON encoding of vsub.
llvm-svn: 117177
2010-10-22 23:21:04 +00:00
Owen Anderson cb5c1b75fe Add tests for NEON encoding of vqdmlsl.
llvm-svn: 117173
2010-10-22 23:08:47 +00:00
Owen Anderson d655a80774 Add tests for NEON encoding of vmlsl.
llvm-svn: 117171
2010-10-22 23:02:27 +00:00
Jim Grosbach b40a60fa2f tidy up.
llvm-svn: 117166
2010-10-22 22:15:48 +00:00
Jim Grosbach 2c9ae05c67 ARM mode encoding information for CLZ, RBIT, REV*, and PKH*.
llvm-svn: 117165
2010-10-22 22:12:16 +00:00
Owen Anderson 3c4f72c9f8 Add tests for the correct encoding of NEON vmls.
llvm-svn: 117145
2010-10-22 20:31:24 +00:00
Owen Anderson 9d0122af7d Add correct NEON encodings for vqdmlal.
llvm-svn: 117134
2010-10-22 19:35:48 +00:00
Jim Grosbach 2b80543fc2 Add the encoding information for the rest of the ARM mode multiply instructions.
llvm-svn: 117133
2010-10-22 19:15:30 +00:00
Owen Anderson 3d0264667f Provide correct encodings for NEON vmlal.
llvm-svn: 117131
2010-10-22 19:05:25 +00:00
Owen Anderson f48719f1b5 Provide correct NEON encodings for vmla.
llvm-svn: 117126
2010-10-22 18:54:37 +00:00
Jim Grosbach 6956a60563 More ARM multiply instuction binary encodings.
llvm-svn: 117121
2010-10-22 18:35:16 +00:00
Owen Anderson f6659997a1 Add testscases for encoding of NEON vdqmull.
llvm-svn: 117115
2010-10-22 17:57:37 +00:00
Jim Grosbach 22261600a8 More ARM multiply instruction encoding information.
llvm-svn: 117108
2010-10-22 17:16:17 +00:00
Andrew Trick edd006c1c3 Reverting r117031 to cleanup valgrind errors.
It doesn't look like anything is wrong with the checkin,
but the new test cases expose a mem bug in AsmParser.

llvm-svn: 117087
2010-10-22 03:58:29 +00:00
Sean Callanan 9f6c622f88 Fixed handling of immediate operand sizes, which
weren't properly reflecting the OperandSize attribute
of the instruction leading to improper decoding of
certain instructions with the 66H prefix.  Also added
a test case for this.

llvm-svn: 117084
2010-10-22 01:24:11 +00:00
Owen Anderson 28418de7ee Add tests for NEON encoding of vmull.
llvm-svn: 117077
2010-10-21 22:19:53 +00:00
Jim Grosbach a97becfaac ARM binary encodings for MVN variants.
llvm-svn: 117076
2010-10-21 22:19:32 +00:00
Owen Anderson 22c940c9ab Add tests for NEON encoding of vqdmulh and vqrdmulh.
llvm-svn: 117074
2010-10-21 22:05:33 +00:00
Jim Grosbach 5edb03ee57 ARM Binary encoding information for BFC/BFI instructions.
llvm-svn: 117072
2010-10-21 22:03:21 +00:00
Owen Anderson eff79f13a6 Add tests for NEON vmul encoding.
llvm-svn: 117069
2010-10-21 21:51:58 +00:00
Owen Anderson 6e1cf114f9 Rename this test to better reflect its contents.
llvm-svn: 117067
2010-10-21 21:40:15 +00:00
Owen Anderson c47913acd2 Add tests for NEON encodings of vaddhn and vraddhn.
llvm-svn: 117064
2010-10-21 20:56:57 +00:00
Owen Anderson d8be664273 Add tests for NEON encodings of vqadd, which was already correctly encoded.
llvm-svn: 117059
2010-10-21 20:42:04 +00:00
Owen Anderson 6b7e401049 Add correct NEON encodings for vhadd and vrhadd.
llvm-svn: 117047
2010-10-21 18:55:04 +00:00
Owen Anderson 9561084188 Add correct encodings for NEON vaddw.s* and vaddw.u*.
llvm-svn: 117040
2010-10-21 18:20:25 +00:00
Owen Anderson 15c97706e8 Provide correct NEON encodings for vaddl.u* and vaddl.s*.
llvm-svn: 117039
2010-10-21 18:09:17 +00:00
Rafael Espindola 8ba86f801d Do not recurse into symbol refs that have a variant kind. This prevents us
from losing the variant when producing a relocation on an alias.

llvm-svn: 117037
2010-10-21 18:00:20 +00:00
Kevin Enderby 0138a05557 More tweaks to X86 instructions to allow the 'w' suffix in places it makes
sense, when the instruction takes the 16-bit ax register or m16 memory
location.  These changes to llvm-mc matches what the darwin assembler allows
for these instructions.  Also added the missing flex (without the wait prefix)
and ud2a as an alias to ud2 (still to add ud2b).

llvm-svn: 117031
2010-10-21 17:16:46 +00:00
Bill Wendling 2a7d269a2b Fix whitespace.
llvm-svn: 117002
2010-10-21 06:25:08 +00:00
Andrew Trick f4ebec03e0 putback r116983 and fix simple-fp-encoding.ll tests
llvm-svn: 116992
2010-10-21 03:40:16 +00:00
Owen Anderson 6083502848 Implement correct encodings for NEON vadd, both integer and floating point.
llvm-svn: 116981
2010-10-21 00:48:00 +00:00
Bill Wendling a65f914bb0 Add encoding for moving a value between two ARM core registers and a doublework
extension register.

llvm-svn: 116970
2010-10-20 23:37:40 +00:00
Bill Wendling 058190507b Add encodings for movement between ARM core registers and single-precision
registers.

llvm-svn: 116961
2010-10-20 22:44:54 +00:00
Rafael Espindola 89f6613e76 Handle _GLOBAL_OFFSET_TABLE_ correctly.
llvm-svn: 116932
2010-10-20 16:46:08 +00:00
Jason W Kim e8b3711ae9 Fixing r116753 r116756 r116777
The failures in r116753 r116756 were caused by a python issue -
Python likes to append 'L' suffix to stringified numbers if the number
is larger than a machine int. Unfortunately, this causes a divergence of
behavior between 32 and 64 bit python versions.

I re-crafted elf-dump/common_dump to take care of these issues by:

1. always printing 0x (makes for easy sed/regex)
2. always print fixed length (exactly 2 + numBits/4 digits long)
   by mod ((2^numBits) - 1)
3. left-padded with '0'

There is a residual common routine that is also used by
macho-dump (dataToHex) , so I left the 'section_data' test values alone.

llvm-svn: 116823
2010-10-19 17:39:10 +00:00
Eric Christopher eac5e381cc Speculatively revert 116753 and 116756 to attempt to fix the bots.
llvm-svn: 116777
2010-10-19 00:19:49 +00:00
Kevin Enderby 49843c0162 Added a few tweaks to the Intel Descriptor-table support instructions to allow
word forms and suffixed versions to match the darwin assembler in 32-bit and
64-bit modes.  This is again for use just with assembly source for llvm-mc .

llvm-svn: 116773
2010-10-19 00:01:44 +00:00
Jason W Kim eae048885d Changed elf-dump to output hex format by default.
Also updated tests. 

llvm-svn: 116753
2010-10-18 21:32:41 +00:00
Rafael Espindola fba9f74932 Implement R_386_GOT32.
llvm-svn: 116744
2010-10-18 20:47:21 +00:00
Rafael Espindola 0a5314fdb3 Relocate with .bss instead of using the symbol. Matches gas behavior.
llvm-svn: 116741
2010-10-18 20:25:33 +00:00
Rafael Espindola e3dc9e2ea1 Produce ELF::R_386_GOTPC relocations.
llvm-svn: 116728
2010-10-18 18:36:12 +00:00
Kevin Enderby b9783dd9bc Added a handful of x86-32 instructions that were missing so that llvm-mc would
be more complete.  These are only expected to be used by llvm-mc with assembly
source so there is no pattern, [], in the .td files.  Most are being added to
X86InstrInfo.td as Chris suggested and only comments about register uses are
added.  Suggestions welcome on the .td changes as I'm not sure on every detail
of the x86 records.  More missing instructions will be coming.

llvm-svn: 116716
2010-10-18 17:04:36 +00:00
Rafael Espindola 3521f8467d Produce a R_386_PLT32 when needed. Moved the default cases of switches to the
start for consistency.

llvm-svn: 116715
2010-10-18 16:58:03 +00:00
Rafael Espindola 4464e0858f Handle GOTOFF correctly on i386.
llvm-svn: 116711
2010-10-18 16:38:04 +00:00
Rafael Espindola 4262a22225 Add a MCObjectFormat class so that code common to all targets that use a
single object format can be shared.

This also adds support for

mov zed+(bar-foo), %eax

on ELF and COFF targets.

llvm-svn: 116675
2010-10-16 18:23:53 +00:00
Benjamin Kramer 0d14b5b0fa Unbreak test on non-COFF targets.
llvm-svn: 116669
2010-10-16 11:27:13 +00:00
Michael J. Spencer 17990d5690 MC-COFF: Add support for default-null weak externals.
llvm-svn: 116666
2010-10-16 08:25:57 +00:00
Jim Grosbach 68a335e185 ARM mode encoding information for UBFX and SBFX instructions.
llvm-svn: 116588
2010-10-15 17:15:16 +00:00
Rafael Espindola fbcf0db7ee Refactor code a bit and avoid creating unnecessary entries in the string
map.

llvm-svn: 116579
2010-10-15 15:39:06 +00:00
Bob Wilson 59351844e1 ARM instructions that are both predicated and set the condition codes
have been printed with the "S" modifier after the predicate.  With ARM's
unified syntax, they are supposed to go in the other order.  We fixed this
for Thumb when we switched to unified syntax but missed changing it for
ARM.  Apparently we don't generate these instructions often because no one
noticed until now.  Thanks to Bill Wendling for the testcase!

llvm-svn: 116563
2010-10-15 03:23:44 +00:00
Jim Grosbach 0b5c743811 Simplify test file a bit.
llvm-svn: 116540
2010-10-14 23:32:44 +00:00
Jim Grosbach 89efff3763 Add testcase for RRX and ASRS (which effectively tests MOVs, since those
are just forms of that instruction).

llvm-svn: 116538
2010-10-14 23:29:18 +00:00
Jim Grosbach eafcb27ded MOVi16 and MOVT ARM mode encodings.
llvm-svn: 116498
2010-10-14 18:54:27 +00:00
Rafael Espindola bee6e9f8e0 Remove some code duplication.
llvm-svn: 116484
2010-10-14 16:34:44 +00:00
Bill Wendling 6f52f8a87d Add support for vmov.f64/.f32 encoding. There's a bit of a hack going on
here. The f32 in FCONSTS is handled as a double instead of a float in the
code. So the encoding of the immediate into the instruction isn't exactly in
line with the documentation in that regard. But given that we know it's handled
as a double, it doesn't cause any harm.

llvm-svn: 116471
2010-10-14 02:33:26 +00:00
Bill Wendling 0441c6cba0 Add encoding for 'fmstat'.
llvm-svn: 116466
2010-10-14 01:19:34 +00:00
Bill Wendling 0825f3e441 - Add encodings for multiply add/subtract instructions in all their glory.
- Add missing patterns for some multiply add/subtract instructions.
- Add encodings for VMRS and VMSR.

llvm-svn: 116464
2010-10-14 01:02:08 +00:00
Jim Grosbach 7e72ec6626 Refactor the ARM 'setend' instruction pattern. Use a single instruction pattern
and handle the operand explicitly. Flesh out encoding information. Add an
explicit disassembler testcase for the instruction.

llvm-svn: 116432
2010-10-13 21:00:04 +00:00
Bill Wendling f106ecfa59 Add MC encodings for VCVT* instrunctions.
llvm-svn: 116431
2010-10-13 20:58:46 +00:00
Jim Grosbach 1e7db68774 Add ARM mode encoding for [SU]XT[BH] and [SU]XTA[BH] instructions.
llvm-svn: 116421
2010-10-13 19:56:10 +00:00
Jim Grosbach 651dc7c9e9 Add ARM mode operand encoding information for ADDE/SUBE instructions.
llvm-svn: 116412
2010-10-13 18:00:52 +00:00
Bill Wendling 6e27b4f530 Add encodings for VNEG and VSQRT. Also add encodings for VMOV, but not a test
just yet.

llvm-svn: 116386
2010-10-13 01:17:33 +00:00
Bill Wendling 576fd0b110 Add encodings for VCVT instructions.
llvm-svn: 116385
2010-10-13 00:56:35 +00:00
Jim Grosbach 8c519c0d4b Add ARM encoding information for comparisons, forced-cc-out arithmetics, and
arithmetic-with-carry-in instructions.

llvm-svn: 116384
2010-10-13 00:50:27 +00:00
Bill Wendling da4ddf0fcf Add VCMPZ and VABS.
llvm-svn: 116383
2010-10-13 00:38:07 +00:00
Bill Wendling f9ca535495 Refactor VCMP instructions.
llvm-svn: 116379
2010-10-13 00:04:29 +00:00
Bill Wendling 7dd8c0b991 Add encodings for VNMUL[SD].
llvm-svn: 116375
2010-10-12 23:47:37 +00:00
Bill Wendling a06aee826c Add encodings for VDIV and VMUL.
llvm-svn: 116370
2010-10-12 23:22:27 +00:00
Jim Grosbach d5f8c3350d Be nitpicky and line up the comments.
llvm-svn: 116365
2010-10-12 23:14:03 +00:00
Bill Wendling 646a506724 Add encoding for VSUB and VCMP.
Fear not! I'm going to try a refactoring right now. :)

llvm-svn: 116359
2010-10-12 22:55:35 +00:00
Bill Wendling 9513a7e87f Don't need to specify calling convention. Add 'readnone' to functions.
llvm-svn: 116354
2010-10-12 22:24:10 +00:00
Bill Wendling ac6cd00706 Encoding for VADDD. Plus a test for the VFP instructions.
llvm-svn: 116348
2010-10-12 22:08:41 +00:00
Jim Grosbach 6fead930af Add encoding information for the remainder of the generic arithmetic
ARM instructions.

llvm-svn: 116313
2010-10-12 17:11:26 +00:00
Jim Grosbach b7c2962d20 MC machine encoding for simple aritmetic instructions that use a shifted
register operand.

llvm-svn: 116259
2010-10-11 23:16:21 +00:00
Michael J. Spencer a6a984bd96 MC-COFF: Fix .bss section size. Fixes PR8335. Patch by NAKAMUTA Takumi!
llvm-svn: 116155
2010-10-09 16:04:45 +00:00
Michael J. Spencer 86bbd71088 MC-COFF: Implement InitSections. Fixes PR8335.
llvm-svn: 116151
2010-10-09 15:44:27 +00:00
Michael J. Spencer c8dbdfd4ba MC-COFF: Add COFFAsmParser. Completes PR8343.
llvm-svn: 116150
2010-10-09 11:01:07 +00:00
Jim Grosbach c43c930690 Implement a few more binary encoding bits. Still very early stage proof-of-
concept level stuff at this point, but it is generally working for those
instructions that know how to map the operands.

This patch fills in the register operands for add/sub/or/etc instructions
and adds the conditional execution predicate encoding.

llvm-svn: 116112
2010-10-08 21:45:55 +00:00
Rafael Espindola af8b4871a8 Call InitSections in llc and clang so that the binaries produced by them
are easier to diff with those produced by llvm-mc.

llvm-svn: 116095
2010-10-08 19:37:38 +00:00
Jim Grosbach 42a07e8545 Add test file for simple ARM binary encodings with MC
llvm-svn: 116024
2010-10-08 00:47:59 +00:00
Michael J. Spencer 00be34d009 MC-COFF: Add test for my last commit.
llvm-svn: 116015
2010-10-08 00:00:28 +00:00
Michael J. Spencer 1666b61357 MC-COFF: Fix symbol aliases. Fixes PR8251.
llvm-svn: 115909
2010-10-07 06:29:33 +00:00
Rafael Espindola 5f2d6a5cd9 Get binding and visibility info from the the alias, but Type from the symbol
being aliased.

llvm-svn: 115836
2010-10-06 21:02:29 +00:00
Rafael Espindola d444577382 If a symbol is global, reloc against it even if it is in a mergeable section.
llvm-svn: 115817
2010-10-06 19:27:21 +00:00
Rafael Espindola 83b2a3337f Make sure weak symbols are listed after the local ones.
llvm-svn: 115795
2010-10-06 16:47:31 +00:00
Rafael Espindola 8f3d2c9058 Correctly handle GOTPCREL relocations.
llvm-svn: 115793
2010-10-06 16:23:36 +00:00
Rafael Espindola d7565c3a06 Use a relocation against the symbol if it is a PLT and the symbol is in another
section. Common because of linkonce sections.

llvm-svn: 115718
2010-10-05 23:57:26 +00:00
Rafael Espindola 0ad137e98e Implement more alias cases.
llvm-svn: 115699
2010-10-05 22:26:43 +00:00
Chris Lattner 13111b08fb Replace a gross hack (the MOV64ri_alt instruction) with a slightly less
gross hack (having the asmmatcher handle the alias).

llvm-svn: 115685
2010-10-05 21:09:45 +00:00
Rafael Espindola c58a37ea51 Don't crash in a strange .size directive.
llvm-svn: 115684
2010-10-05 21:02:45 +00:00
Michael J. Spencer a3b34ed2df MC-COFF: Fix (PR8278) temporary symbol relocations.
llvm-svn: 115656
2010-10-05 19:48:03 +00:00
Rafael Espindola b91bac6c96 Add support for a fill value in the .zero directive.
llvm-svn: 115655
2010-10-05 19:42:57 +00:00
Rafael Espindola b1d0789357 Implement a simple alias case and refactor the code a bit so that the
isInSymtab and isLocal logic in the two loops don't get easily out of sync.

llvm-svn: 115643
2010-10-05 18:01:23 +00:00
Michael J. Spencer 8ccdd25fbd test/COFF: Fix symbol indexes and names. Update tests to match.
llvm-svn: 115642
2010-10-05 17:57:08 +00:00
Michael J. Spencer f6230d1d4b test/COFF: Remove temp file usage.
llvm-svn: 115641
2010-10-05 17:56:56 +00:00
Michael J. Spencer 868aaf3c3d Cleanup Whitespace.
llvm-svn: 115639
2010-10-05 17:56:37 +00:00
Rafael Espindola d03e81dba8 Produce a undefined reference to _GLOBAL_OFFSET_TABLE_ when needed.
llvm-svn: 115623
2010-10-05 15:48:37 +00:00
Rafael Espindola 259bcdad06 Tests that now pass.
llvm-svn: 115622
2010-10-05 15:43:32 +00:00
Sean Callanan 6296bbbb65 Added a testcase for the ENTER instruction.
llvm-svn: 115580
2010-10-05 00:21:40 +00:00
Rafael Espindola fd1fff8b19 Implement ELF::R_X86_64_GOTPCREL.
llvm-svn: 115547
2010-10-04 19:51:39 +00:00
Rafael Espindola baadbd554a Produce a R_X86_64_PLT32 when needed.
llvm-svn: 115541
2010-10-04 19:04:13 +00:00
Rafael Espindola b2c4ca6433 Produce a R_X86_64_GOT32 when needed.
llvm-svn: 115537
2010-10-04 18:44:25 +00:00
Jan Wen Voung 87f77b5f9a Add hook in MCSection to decide when to use "optimized nops", for each
section kind. Previously, optimized nops were only used for MachO.
Also added tests for ELF and COFF.

llvm-svn: 115523
2010-10-04 17:32:41 +00:00
Rafael Espindola da0e3d07b2 Include the section address in the computation of the relocation.
llvm-svn: 115509
2010-10-04 15:59:01 +00:00
Rafael Espindola 7c48b06930 Correctly compute the relocation when it is not in the first fragment.
llvm-svn: 115506
2010-10-04 15:28:43 +00:00
Eli Friedman bb48e26732 Add 3DNowA instructions.
llvm-svn: 115477
2010-10-03 20:23:13 +00:00
Chris Lattner d3593c3a8e the immediate field of pshufw is actually an 8-bit field, not a 8-bit field that is sign extended. This fixes PR8288
llvm-svn: 115473
2010-10-03 19:09:13 +00:00
Chris Lattner b44b202d66 add support for the prefetch/prefetchw instructions, move femms into
the right file.  The assembler supports all the 3dnow instructions now,
but not the "3dnowa" ones.

llvm-svn: 115468
2010-10-03 18:42:30 +00:00
Chris Lattner 3a0a620c2e what the heck, add support for the rest of the 3dNow! binary operations.
llvm-svn: 115467
2010-10-03 18:24:18 +00:00
Chris Lattner 45270db916 Implement support for the bizarre 3DNow! encoding (which is unlike anything
else in X86), and add support for pavgusb.  This is apparently the
only instruction (other than movsx) that is preventing ffmpeg from building
with clang.

If someone else is interested in banging out the rest of the 3DNow! 
instructions, it should be quite easy now.

llvm-svn: 115466
2010-10-03 18:08:05 +00:00
Rafael Espindola f70b4e0c2e Implement a very basic PIC case.
llvm-svn: 115454
2010-10-03 00:46:57 +00:00
Chris Lattner 4756bbeba0 fix a regression introduced in r115243, in which the instruction
backing int_x86_ssse3_pshuf_w got removed.  This caused PR8280.

llvm-svn: 115422
2010-10-02 21:32:15 +00:00
Chris Lattner a2f2c27b20 actually, move the elf tests into the existing elf dir.
llvm-svn: 115416
2010-10-02 18:53:48 +00:00
Chris Lattner 7b1638b40b consolidate ELF tests into asmparser tests.
llvm-svn: 115415
2010-10-02 18:52:57 +00:00
Chris Lattner fbae9435c9 move ARM MC tests up one level.
llvm-svn: 115414
2010-10-02 18:52:05 +00:00
Chris Lattner 4ca7bb52d0 move X86 subdir up a level
llvm-svn: 115292
2010-10-01 04:32:20 +00:00
Rafael Espindola f987d5ea1c Factor some logic into ShouldRelocOnSymbol. This simplifies the code and
fixes some cases where we were producing relocations with at symbol that
should use a section instead.

llvm-svn: 115194
2010-09-30 20:18:35 +00:00
Chris Lattner 1dee57fb7d more cleanups.
llvm-svn: 115178
2010-09-30 17:29:05 +00:00
Chris Lattner 288a5f9652 merge and clean up tests.
llvm-svn: 115177
2010-09-30 17:24:05 +00:00
Chris Lattner 60217e765e merge two tests.
llvm-svn: 115175
2010-09-30 17:18:22 +00:00
Chris Lattner 41a0cd14b7 rename test
llvm-svn: 115174
2010-09-30 17:16:49 +00:00
Chris Lattner ea226b24ff generalize test.
llvm-svn: 115172
2010-09-30 17:15:42 +00:00
Chris Lattner 28307d1a1e rename test.
llvm-svn: 115171
2010-09-30 17:14:55 +00:00
Chris Lattner 45a52f3c34 merge two tests.
llvm-svn: 115170
2010-09-30 17:14:30 +00:00
Chris Lattner 73a7caee4b preemptively add the rest of the non-n fpstack instructions.
llvm-svn: 115168
2010-09-30 17:11:29 +00:00
Chris Lattner 28b3b43fb4 merge two tests.
llvm-svn: 115165
2010-09-30 17:05:37 +00:00
Chris Lattner 1e9e49f421 fix this to not be completely broken.
llvm-svn: 115164
2010-09-30 17:04:59 +00:00
Chris Lattner c8f0e29b5e update, unxfail, fix bogus encodings.
llvm-svn: 115163
2010-09-30 17:03:20 +00:00
Chris Lattner a9e913e139 update and unxfail
llvm-svn: 115162
2010-09-30 17:00:53 +00:00
Chris Lattner ccf2c765f0 unxfail this by fixing syntactic differences.
llvm-svn: 115161
2010-09-30 16:59:28 +00:00
Chris Lattner 4373badcdf implement support for finit, PR8258
llvm-svn: 115156
2010-09-30 16:42:53 +00:00
Chris Lattner adc0dbe470 add support for fstcw, PR8259
llvm-svn: 115154
2010-09-30 16:39:29 +00:00
Jan Wen Voung efbdbe5565 Move logic of determining ELF entsize from the .s printer to initialization
time. That way, the EntrySize field is initialized for other code paths, 
namely, the .ll -> .o code path.

llvm-svn: 115141
2010-09-30 05:59:22 +00:00
Rafael Espindola 9d98ac645e Add another test that now passes.
llvm-svn: 115137
2010-09-30 04:22:07 +00:00
Rafael Espindola 70d6e0e0ff Correctly produce R_X86_64_32 or R_X86_64_32S.
With this patch in

movq    $foo, foo(%rip)
foo:
.long   foo

We produce a R_X86_64_32S for the first relocation and R_X86_64_32 for the
second one.

llvm-svn: 115134
2010-09-30 03:11:42 +00:00
Jan Wen Voung b96b2d8e4d Have ELFAsmParser.cpp use the already parsed "Size" (entry size) when
constructing a section. Test for a few cases also included.

llvm-svn: 115132
2010-09-30 02:41:46 +00:00