Commit Graph

426 Commits

Author SHA1 Message Date
Chris Lattner cea0a8d7ae fix rdar://8444631 - encoder crash on 'enter'
What a weird instruction.

llvm-svn: 114190
2010-09-17 18:02:29 +00:00
Daniel Dunbar 35a7a0ee2e MC/Mach-O/i386: Fix a crash in relocation handling.
llvm-svn: 114176
2010-09-17 15:21:50 +00:00
Daniel Dunbar 55f16678e4 MC/AsmParser: Add support for 'a + 4@GOTPCREL' and friends, by reconsing the
expression to include the modifier.
 - Gross, but this a corner case we don't expect to see often in practice, but
   it is worth accepting.
 - Also improves diagnostics on invalid modifiers.

llvm-svn: 114154
2010-09-17 02:47:07 +00:00
Chris Lattner 74d320db97 fix rdar://8438816 - unrecognized 'fildq' instruction
llvm-svn: 114116
2010-09-16 20:46:38 +00:00
Rafael Espindola 44bf266111 Print the address of sections as 0 and create the metadata sections in the
same order as gnu as.

llvm-svn: 114109
2010-09-16 19:46:31 +00:00
Rafael Espindola f7f433200b Make sure that names like .note.GNU-stack are accepted as valid section names.
llvm-svn: 114091
2010-09-16 17:05:55 +00:00
Rafael Espindola 922e3f454b Add support for the .zero directive.
llvm-svn: 114077
2010-09-16 15:03:59 +00:00
Jim Grosbach 196841144d add a test of an edge case value for the FP immediate (needs all digits of
precision)

llvm-svn: 114028
2010-09-15 21:52:13 +00:00
Rafael Espindola f667d929ce Add a InitSections method to the streamer interface.
The ELF implementation now creates text, data and bss to match the gnu as
behavior.

The text streamer still has the old MachO specific behavior since
the testsuite checks that it will error when a directive is given
before a setting the current section for example.

A nice benefit is that -n is not required anymore when producing
ELF files.

llvm-svn: 114027
2010-09-15 21:48:40 +00:00
Jim Grosbach 27ab5fbd2b Teach the MC disassembler to handle vmov.f32 and vmov.f64 immediate to register
moves. Previously, the immediate was printed as the encoded integer value,
which is incorrect.

llvm-svn: 114021
2010-09-15 21:04:54 +00:00
Chris Lattner ee7e6f42f8 lcall and ljmp always default to lcalll and ljmpl. This finally
wraps up r8418316

llvm-svn: 113949
2010-09-15 05:30:20 +00:00
Chris Lattner 09bfe645f6 apparently jmpl $1,$2 is an alias for ljmpl, similiarly
for call.  Add this.

llvm-svn: 113948
2010-09-15 05:25:21 +00:00
Chris Lattner 6757eae45e Disambiguate lcall/ljmp to the 32-bit version. This happens
even in 64-bit mode apparently.

llvm-svn: 113945
2010-09-15 05:14:54 +00:00
Chris Lattner 5be87c619b fix the encoding of sldt GR16 to have the 0x66 prefix, and
add sldt GR32, which isn't documented in the intel manual
but which gas accepts.  Part of rdar://8418316

llvm-svn: 113938
2010-09-15 04:45:10 +00:00
Chris Lattner 6b40b0def1 implement aliases for shld/shrd, part of rdar://8418316
llvm-svn: 113937
2010-09-15 04:37:18 +00:00
Chris Lattner 4bd21710b6 fix rdar://8431880 - rcl/rcr with no shift amount not recognized
llvm-svn: 113936
2010-09-15 04:33:27 +00:00
Chris Lattner 81ce173860 add various broken forms of fnstsw. I didn't add the %rax
version because it adds a prefix and makes even less sense
than the other broken forms.  This wraps up rdar://8431422

llvm-svn: 113932
2010-09-15 04:15:16 +00:00
Chris Lattner 7df35dbd19 add some aliases for f[u]comi, part of rdar://8431422
llvm-svn: 113930
2010-09-15 04:08:38 +00:00
Chris Lattner 4dbcba0082 add a bunch of aliases for fp operations with no operand,
rdar://8431422

llvm-svn: 113929
2010-09-15 04:04:33 +00:00
Michael J. Spencer 46d4cc2ef7 test: Fix coff-dump section array indicies to 1 based to match file format.
llvm-svn: 113928
2010-09-15 03:58:51 +00:00
Jim Grosbach c7cf42d80b Reapply r113875 with additional cleanups.
"The register specified for a dregpair is the corresponding Q register, so to
get the pair, we need to look up the sub-regs based on the qreg. Create a
lookup function since we don't have access to TargetRegisterInfo here to
be able to use getSubReg(ARM::dsub_[01])."

Additionaly, fix the NEON VLD1* and VST1* instruction patterns not to use
the dregpair modifier for the 2xdreg versions. Explicitly specifying the two
registers as operands is more correct and more consistent with the other
instruction patterns. This enables further cleanup of special case code in the
disassembler as a nice side-effect.

llvm-svn: 113903
2010-09-14 23:54:06 +00:00
Chris Lattner 5f2311dc29 add a terrible hack to allow out with dx is parens, a gas bug.
This fixes PR8114

llvm-svn: 113894
2010-09-14 23:34:29 +00:00
Chris Lattner 1bbb14ab8f add a missed cmov alias, part of rdar://8416805
llvm-svn: 113693
2010-09-11 17:08:22 +00:00
Chris Lattner 3340c3e86c add support for all the setCC aliases. Part of rdar://8416805
llvm-svn: 113692
2010-09-11 17:06:05 +00:00
Rafael Espindola 12d73d1f18 Add support for leb128 of absolute expressions.
llvm-svn: 113691
2010-09-11 16:45:15 +00:00
Chris Lattner b47c042e09 add support for pushfd/popfd which are aliases for pushfl/popfl.
This fixes rdar://8408129 - pushfd and popfd get invalid instruction mnemonic errors

llvm-svn: 113690
2010-09-11 16:39:16 +00:00
Chris Lattner 30561aba20 implement rdar://8407928 - support for in/out with a missing "a" register.
llvm-svn: 113689
2010-09-11 16:32:12 +00:00
Rafael Espindola 2833e392ab Change section_data dumping to print hex numbers instead of using
python's %r.

llvm-svn: 113685
2010-09-11 15:25:58 +00:00
Daniel Dunbar e5444a88cd llvm-mc: Don't crash when using -n and we see a directive before the initial section.
- This is annoying, because we have to scatter this check everywhere that could emit real data, but I see no better solution.

llvm-svn: 113552
2010-09-09 22:42:59 +00:00
Daniel Dunbar 43325c4a68 llvm-mc: Make sure we exit != 0 if any errors are encountered.
llvm-svn: 113551
2010-09-09 22:42:56 +00:00
Benjamin Kramer 0a96578ac0 Add an elf-dumper utility.
- Output format and some of the code stolen from macho-dump.
- Somewhat incomplete and probably buggy.
- Comes with a very basic test.

llvm-svn: 113488
2010-09-09 15:00:41 +00:00
Chris Lattner 28a9c2f89a fix rdar://8407548, I missed the commuted form of xchg/test without a suffix.
llvm-svn: 113427
2010-09-08 22:27:05 +00:00
Chris Lattner 8ead237758 fix bugs in push/pop segment support, rdar://8407242
llvm-svn: 113422
2010-09-08 22:13:08 +00:00
Chris Lattner 2907d2e419 add support for the commuted form of the test instruction, rdar://8018260.
llvm-svn: 113352
2010-09-08 05:51:12 +00:00
Chris Lattner a9ca7837e4 implement proper support for sysret{,l,q}, rdar://8403907
llvm-svn: 113350
2010-09-08 05:45:34 +00:00
Chris Lattner 063363fa80 implement the iret suite of instructions properly,
fixing rdar://8403974

llvm-svn: 113349
2010-09-08 05:38:31 +00:00
Chris Lattner 086a83afb1 add support for instruction prefixes on the same line as the instruction,
implementing rdar://8033482 and PR7254.

llvm-svn: 113348
2010-09-08 05:17:37 +00:00
Chris Lattner 8caea68a4f gas accepts xchg <mem>, <reg> as a synonym for xchg <reg>, <mem>.
Add this to the mc assembler, fixing PR8061

llvm-svn: 113346
2010-09-08 04:53:27 +00:00
Chris Lattner 4703cb4a96 fix the encoding of the "jump on *cx" family of instructions,
rdar://8061602

llvm-svn: 113343
2010-09-08 04:30:51 +00:00
Chris Lattner 30bb384944 add missing cmov aliases, this resolves rdar://8208499
llvm-svn: 113189
2010-09-07 00:05:45 +00:00
Chris Lattner 7ece716da2 "sldt <mem>" is ambiguous in 64-bit mode, but should
always be disambiguated as sldtw.  sldtw and sldtq with
a mem operands have the same effect, but sldtw is more
compact.  Force it to sldtw, resolving rdar://8017530

llvm-svn: 113186
2010-09-06 23:51:44 +00:00
Chris Lattner 415e04fad2 fix rdar://8017621 - llvm-mc can't guess encoding for "push $(1000)"
llvm-svn: 113184
2010-09-06 23:40:56 +00:00
Chris Lattner 34e366b45c fix the operand constraints of the immediate form of in/out,
allowing unsigned 8-bit operands.  This fixes rdar://8208481

llvm-svn: 113182
2010-09-06 23:29:05 +00:00
Benjamin Kramer e39017cb97 Add AsmParser support for the ELF .previous directive. Patch by Roman Divacky.
llvm-svn: 112849
2010-09-02 18:53:37 +00:00
Michael J. Spencer d8e5dfccc1 COFF: Update tests to reflect changes in last commit.
llvm-svn: 112704
2010-09-01 14:15:31 +00:00
Chris Lattner 112b6ee3f2 fixme accomplished
llvm-svn: 112386
2010-08-28 20:40:28 +00:00
Daniel Dunbar 3d148ac089 X86: Fix misencode of RI64mi8. This fixes OpenSSL / x86_64-apple-darwin10 / clang -O3.
llvm-svn: 112089
2010-08-25 21:11:02 +00:00
Michael J. Spencer ccd28d0665 Fix COFF x86-64 relocations. PR7960.
Multiple symbol reloc handling part of the patch by Cameron Esfahani.

llvm-svn: 111963
2010-08-24 21:04:52 +00:00
Daniel Dunbar 1c8d777c93 MC/X86: Tweak imul recognition, previous hack only applies for the imul form
taking immediates.

llvm-svn: 111950
2010-08-24 19:37:56 +00:00
Daniel Dunbar 09392785b4 MC/X86: Add custom hack for recognizing "imul $12, %eax" and friends.
llvm-svn: 111947
2010-08-24 19:24:18 +00:00