1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 11:33:24 +02:00
Commit Graph

16140 Commits

Author SHA1 Message Date
Jim Grosbach
0b06d57ccd Add support for a few simple fixups to the ARM Darwin asm backend. This allows
constant pool references and global variable refernces to resolve properly
for object file generation. For example,

int x;
void foo(unsigned a, unsigned *p) {
  p[a] = x;
}

can now be successfully compiled directly to an (ARM mode) object file.

llvm-svn: 118469
2010-11-09 01:37:15 +00:00
Bill Wendling
41fb74d268 Revert r118457 and r118458. These won't hold for GPRs.
llvm-svn: 118462
2010-11-09 00:30:18 +00:00
Bill Wendling
f080f8ddfe Get the register and count from the register list operands.
llvm-svn: 118458
2010-11-08 23:51:20 +00:00
Bill Wendling
ab76e02a12 reglist has two operands.
llvm-svn: 118457
2010-11-08 23:50:20 +00:00
Bill Wendling
2ff2ee2765 The "addRegListOperands()" function returns the start register and the total
number of registers in the list.

llvm-svn: 118456
2010-11-08 23:49:57 +00:00
Owen Anderson
52e3873edc Add support for ARM's specialized vector-compare-against-zero instructions.
llvm-svn: 118453
2010-11-08 23:21:22 +00:00
Bruno Cardoso Lopes
64dd957550 Initial support for Mips32 and Mips32r2. Patch contributed by Akira Hatanaka (ahatanaka@mips.com)
llvm-svn: 118447
2010-11-08 21:42:32 +00:00
Bill Wendling
3e6eee5c35 Add "write back" bit encoding.
llvm-svn: 118446
2010-11-08 21:28:03 +00:00
Bruno Cardoso Lopes
9f9f796756 Fix PR8211
llvm-svn: 118445
2010-11-08 21:24:59 +00:00
Wesley Peck
f3909b741f Adding working version of assembly parser for the MBlaze backend
Major cleanup of whitespace and formatting issues in MBlaze backend

llvm-svn: 118434
2010-11-08 19:40:01 +00:00
Dale Johannesen
f16acd1325 Revert 118422 in search of bot verdancy.
llvm-svn: 118429
2010-11-08 19:17:22 +00:00
Jason W Kim
a253ed4e26 Support -mcpu=cortex-a8 in ARM attributes - Has Fixme. 1 Test modified.
llvm-svn: 118422
2010-11-08 17:58:07 +00:00
Jason W Kim
c43f11132e Complete listing of ARM/MC/ELF relocation enums
llvm-svn: 118413
2010-11-08 16:47:27 +00:00
Che-Liang Chiou
6ba699c749 Add generating function declaration for PTX
llvm-svn: 118398
2010-11-08 03:06:08 +00:00
Che-Liang Chiou
e207994d1b Add physical register counting functions
llvm-svn: 118397
2010-11-08 03:00:52 +00:00
Che-Liang Chiou
e2c8a54474 Add a dummy PTXMCAsmStreamer class
llvm-svn: 118396
2010-11-08 02:58:44 +00:00
Bill Wendling
19873cf3ff Make RegList an ASM operand so that TableGen will generate code for it. This is
an initial implementation and may change once reglists are fully fleshed out.

llvm-svn: 118390
2010-11-08 00:39:58 +00:00
Bill Wendling
611dbaee50 Revert.
llvm-svn: 118389
2010-11-08 00:32:40 +00:00
Duncan Sands
c9c7d54930 Fix a README item: when doing a comparison with the result
of a select instruction, see if doing the compare with the
true and false values of the select gives the same result.
If so, that can be used as the value of the comparison.

llvm-svn: 118378
2010-11-07 16:12:23 +00:00
Bill Wendling
1338bc5cac In this context, a reglist is a reg.
llvm-svn: 118375
2010-11-07 13:08:28 +00:00
Chris Lattner
24ba201941 implement aliases for div/idiv that have an explicit A register operand,
implementing rdar://8431864

llvm-svn: 118364
2010-11-06 22:41:18 +00:00
Bill Wendling
0493b6982a Add support for parsing register lists. We can't use a bitfield to keep track of
the registers, because the register numbers may be much greater than the number
of bits available in the machine's register.

I extracted the register list verification code out of the actual parsing of the
registers. This made checking for errors much easier. It also limits the number
of warnings that would be emitted for cascading infractions.

llvm-svn: 118363
2010-11-06 22:36:58 +00:00
Chris Lattner
25f31dcc8f add aliases for movs between seg registers and mem. There are multiple
different forms of this instruction (movw/movl/movq) which we reported
as being ambiguous.  Since they all do the same thing, gas just picks the
one with the shortest encoding.  Follow its lead here.

This implements rdar://8208615

llvm-svn: 118362
2010-11-06 22:35:34 +00:00
Chris Lattner
5cd42cb6f4 move the "sh[lr]d op,op" -> "shld $1, op,op" aliases to the .td file.
llvm-svn: 118361
2010-11-06 22:25:39 +00:00
Bill Wendling
7e32b2f98a Return the base register of a register list for the "getReg()" method. This is
to satisfy the ClassifyOperand method of the Asm matcher without having to add a
RegList type to every back-end.

llvm-svn: 118360
2010-11-06 22:19:43 +00:00
Chris Lattner
95add4d79a work-in-progress
llvm-svn: 118358
2010-11-06 22:05:43 +00:00
Bill Wendling
dabc5e5b02 General cleanup:
- Make ARMOperand a class so that some things are internal to the class.
- Reformatting.

llvm-svn: 118357
2010-11-06 21:42:12 +00:00
Chris Lattner
0d6d870628 go to great lengths to work around a GAS bug my previous patch
exposed:

GAS doesn't accept "fcomip %st(1)", it requires "fcomip %st(1), %st(0)"
even though st(0) is implicit in all other fp stack instructions.

Fortunately, there is an alias for fcomip named "fcompi" and gas does
accept the default argument for the alias (boggle!).

As such, switch the canonical form of this instruction to "pi" instead
of "ip".  This makes the code generator and disassembler generate pi,
avoiding the gas bug.

llvm-svn: 118356
2010-11-06 21:37:06 +00:00
Chris Lattner
bbd318b76a rework the rotate-by-1 instructions to be defined like the
shift-by-1 instructions, where the asmstring doesn't contain
the implicit 1.  It turns out that a bunch of these rotate
instructions were completely broken because they used 1 
instead of $1.

This fixes assembly mismatches on "rclb	$1, %bl" and friends,
where we used to generate the 3 byte form, we now generate the
proper 2-byte form.

llvm-svn: 118355
2010-11-06 21:23:40 +00:00
Chris Lattner
af1f50772a change the fp comparison instructions to not have %st0 explicitly
listed in its asm string, for consistency with the other similar
instructions.

llvm-svn: 118354
2010-11-06 20:55:09 +00:00
Chris Lattner
b64f8e10ab move the plethora of fp stack aliases to the .td file.
llvm-svn: 118353
2010-11-06 20:47:38 +00:00
Chris Lattner
4834890f0a add (and document) the ability for alias results to have
fixed physical registers.  Start moving fp comparison
aliases to the .td file (which default to using %st1 if
nothing is specified).

llvm-svn: 118352
2010-11-06 19:57:21 +00:00
Bill Wendling
ac0e90a877 Add a RegList (register list) object to ARMOperand. It will be used soon to hold
(surprise!) a list of registers. Register lists are consecutive, so we only need
to record the start register plus the number of registers.

llvm-svn: 118351
2010-11-06 19:56:04 +00:00
Chris Lattner
c0e756dc47 generalize alias support to allow the result of an alias to
add fixed immediate values.  Move the aad and aam aliases to
use this, and document it.

llvm-svn: 118350
2010-11-06 19:25:43 +00:00
Chris Lattner
a7c7312e55 move fnstsw aliases to .td file, fix typo
llvm-svn: 118349
2010-11-06 18:58:32 +00:00
Chris Lattner
b686fb93c7 move in/out aliases to the .td files.
llvm-svn: 118348
2010-11-06 18:52:40 +00:00
Chris Lattner
6b905e3a10 move sldt, imul, and movabsq aliases from c++ to .td file.
llvm-svn: 118347
2010-11-06 18:44:26 +00:00
Chris Lattner
1beb2b3fc5 correct suffix matching to search for s/l/t suffixes on
floating point stack instructions instead of looking for b/w/l/q.

This fixes issues where we'd accidentally match fistp to fistpl,
when it is in fact an ambiguous instruction.

This changes the behavior of llvm-mc to reject fstp, which was the
correct fix for rdar://8456389:
t.s:1:1: error: ambiguous instructions require an explicit suffix (could be 'fstps', 'fstpl', or 'fstpt')
fstp	(%rax)

it also causes us to correctly reject fistp and fist, which addresses
PR8528:

t.s:2:1: error: ambiguous instructions require an explicit suffix (could be 'fistps', or 'fistpl')
fistp (%rax)
^
t.s:3:1: error: ambiguous instructions require an explicit suffix (could be 'fists', or 'fistl')
fist (%rax)
^

Thanks to Ismail Donmez for tracking down the issue here!

llvm-svn: 118346
2010-11-06 18:28:02 +00:00
Bill Wendling
e35565699c Fix grammar.
llvm-svn: 118341
2010-11-06 10:51:53 +00:00
Bill Wendling
84ce225095 Fix grammar.
llvm-svn: 118340
2010-11-06 10:48:18 +00:00
Bill Wendling
f2e9379095 MatchRegisterName() returns 0 if it can't match the register.
llvm-svn: 118339
2010-11-06 10:45:34 +00:00
Bill Wendling
f65f39e7a1 Use TryParseRegister() instead of MatchRegisterName(). The former returns -1
while the latter doesn't.

llvm-svn: 118338
2010-11-06 10:40:24 +00:00
Benjamin Kramer
16b841c233 Add a note.
llvm-svn: 118337
2010-11-06 10:37:16 +00:00
Chris Lattner
637f4910c3 fix a bug where we had an implicit assumption that the
result instruction operand numbering matched the result pattern.

Fixing this allows us to move the xchg/test aliases to the .td file.

llvm-svn: 118334
2010-11-06 08:20:59 +00:00
Eric Christopher
3a51a4ada2 Make sure we have movw on the target before using it.
Fixes 8559.

llvm-svn: 118333
2010-11-06 07:53:11 +00:00
Chris Lattner
4fd3b4ad94 move the lcall/ljmp aliases to the .td file.
llvm-svn: 118332
2010-11-06 07:48:45 +00:00
Chris Lattner
66c868f386 move the "movsd -> movsl" alias to the .td files,
tidy up the movsx and movzx aliases.

llvm-svn: 118331
2010-11-06 07:34:58 +00:00
Chris Lattner
ec0ef3385d fix some bugs in the alias support, unblocking changing of "clr" aliases
from c++ hacks to proper .td InstAlias definitions.  Change them!

llvm-svn: 118330
2010-11-06 07:31:43 +00:00
Chris Lattner
5d1361e9ed Reimplement BuildResultOperands to be in terms of the result instruction's
operand list instead of the operand list redundantly declared on the alias
or instruction.

With this change, we finally remove the ins/outs list on the alias.  Before:
  def : InstAlias<(outs GR16:$dst), (ins GR8 :$src),
                  "movsx $src, $dst",
                  (MOVSX16rr8W GR16:$dst, GR8:$src)>;
After:
  def : InstAlias<"movsx $src, $dst",
                  (MOVSX16rr8W GR16:$dst, GR8:$src)>;

This also makes the alias mechanism more general and powerful, which will
be exploited in subsequent patches.

llvm-svn: 118329
2010-11-06 07:14:44 +00:00
Jim Grosbach
009007e690 Hook up the '.code {16|32}' directive to the streamer.
llvm-svn: 118310
2010-11-05 22:40:53 +00:00