Add microblaze_legitimate_pic_operand method to prevent ICE

insn contains an invalid address

Signed-off-by: David Holsgrove <david.holsgrove@petalogix.com>
microblaze: Setup stack protection at entry.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Gcc: Added swapb and swaph instructions and mxl-reoder flag And also added fast_interrupt controller

Signed-off-by: nagaraju nmekala@xilinx.com
Signed-off-by: David Holsgrove <david.holsgrove@petalogix.com>
microblaze: Define contraint for first operand in insn matching fcmp as general register

Signed-off-by: David Holsgrove <david.holsgrove@petalogix.com>
microblaze: Check microblaze cpu version >= 8.10a before using swapb or swaph insns

Signed-off-by: David Holsgrove <david.holsgrove@petalogix.com>
microblaze: Correction - swapb and swaph insns only available from microblaze 8.30a +

Signed-off-by: David Holsgrove <david.holsgrove@petalogix.com>
microblaze: Remove MASK_REORDER from default target_flags

and instead only add to target_flags if microblaze v8.30a or greater

Signed-off-by: David Holsgrove <david.holsgrove@petalogix.com>
microblaze: Disable fivopts by default

(Edited from branch edgar/main commit bb42ba0560e098ed9f995d11a7037a145d7f2250
which adds to the gcc 4.6+ gcc/common/config/microblaze/microbaze-common.c )

Signed-off-by: David Holsgrove <david.holsgrove@petalogix.com>
testsuite: Explicitely add -fivopts for tests that depend on it

(test gcc/testsuite/gcc.dg/tree-ssa/ivopts-lt.c doesnt exist in 4.6 branch)

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
microblaze: Dont allow unsuported target rtx into call_internal1

Fix it by adding a simplified call_insn_operand, call_insn_simple_operand
that only accepts the supported rtx code types.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Merge commit 'gcc_4.6.4_master' into xlnx/gcc-4_6_4-branch
Add support for TLS (general dynamic and local dynamic models)
Add prototypes for legitimate_pic_operand_p and legitimate_const_operand_p
Add microblaze_tls_referenced_p, label_referenced_p and symbol_referenced_p on the same lines as ARM. This is to make sure a symbol mentioned any where in the expression is detected recursively wherever required.

Fix issue with load_tls_operand, ensure that @TLSGD and @TLSLDM are referenced
with respect to the pic_offset_table_rtx (earlier they were referenced with respect
to r0) which is loaded with GLOBAL_OFFSET_TABLE value.

In legitimize_tls_address, add initial support for INITIAL_EXEC and LOCAL_EXEC
models by treating them as GENERAL_DYNAMIC/LOCAL_DYNAMIC models respectively.
Required for building static libraries and binaries.

DI/DF instruction templates require offsettable-addresses. Ensure that
microblaze_classify_address rejects non-offsettable addresses for modes
larger than SIMode. This needs further analysis. This change is done to
avoid libm.a build failure.

In microblaze_classify_address, allow addresses of the form
(plus (reg (plus symbol const_int))) but not (plus (reg (plus unspec const_int)))

Also add legitimate_pic_operand_p and legitimate_const_operand_p, the later
requires further analysis to see if it is really required, but was added
in order to avoid compilation failures while building glibc 2.11, especially
with optimization, sometimes a register is replaced with the value of the
register causing invalid "const" operands that cause print_operand failures.

change pic_address_needs_scratch (mostly to make it more readable), this
function itself appears very suspicious (why would symbol + offset need
a scratch register , may have something to do with addsi not allowing
symbol as immediate operand ?)

The last change to print_operand may not be required
(handling case of (const (plus reg const)), as now these patterns are not
generated by TLS, instead addsi is extended to handle those patterns.

It appears that, function prologue was always forcing PIC register to be live,
extended this logic when TLS is enabled also ...

(REVISIT, this needs analysis so that PIC register is only used when required
in a function for PIC or for TLS)

microblaze_expand_move - BIG clean up.
Define PIC_OFFSET_TABLE_REGNUM always (to support TLS without PIC). This is ok as r20 appearst to be a fixed register always.

Add functions for LEGITIMATE_CONSTANT_P and LEGITIMATE_PIC_OPERAND_P
Change addsi3, use arith_plus_operand to allow symbols as immediates.

Change movdi_internal, use o instead of m, to indicate offsettable address

Change movsi_internal2, remove complex condition, modify operands[1]
predicate. Ideally, expand-move should have already ensured that at
least one operand is a register, so the check is redundant. The remaining
check should be part of the predicate. Renamed predicate from move_operand
to move_src_operand for additional clarity.

movdf_internal, use o instead of m

(Modified)

Signed-off-by: David Holsgrove <david.holsgrove@petalogix.com>
Add arith_plus_operand, allow symbol and unspec. (nested call to arith_operand needs to be changed ?)

Rename move_operand to move_src_operand, add check for PIC and TLS. Even
though this check is not strictly required, certain optimizations take
the libery of replacing a register with the register's value (from REG_EQUAL/
EQUIV) which causes illegitimate operands to be generated if such
an optimization involves PIC or a TLS symbol.
added a comment
gcc/config/microblaze Fix typo in predicates.md
gcc/microblaze.c Issue #41, legitimate_pic_operand_p, added missing return