summaryrefslogtreecommitdiff
path: root/gcc/config/cris/cris.md
diff options
context:
space:
mode:
authorhp <hp@138bc75d-0d04-0410-961f-82ee72b054a4>2012-06-01 05:49:16 +0000
committerhp <hp@138bc75d-0d04-0410-961f-82ee72b054a4>2012-06-01 05:49:16 +0000
commit2ef7687b7b3f425f303f876738212a0f0ee883fb (patch)
tree3748c4b19fefbeba9a6320eb38c3640e4c85681f /gcc/config/cris/cris.md
parent4f2e7aceb7414af39652beeaef7fe213b170d8f6 (diff)
downloadgcc-2ef7687b7b3f425f303f876738212a0f0ee883fb.tar.gz
Add CRIS atomic patterns for 1, 2, and 4 bytes.
* config/cris/cris.c (cris_emit_trap_for_misalignment): New function. * config/cris/cris-protos.h: Declare it. * config/cris/cris.h [!TARGET_DEFAULT, TARGET_CPU_DEFAULT == 32] (TARGET_DEFAULT): Add alignment by 32. [!TARGET_DEFAULT, TARGET_CPU_DEFAULT == 10] (TARGET_DEFAULT): New case, as TARGET_CPU_DEFAULT == 0 but with alignment as for TARGET_CPU_DEFAULT == 32. (TARGET_TRAP_UNALIGNED_ATOMIC): New macro. * config/cris/cris.md: Include sync.md. Avoid allocating specific numbers by replacing the define_constants for all UNSPECs with the equivalent define_c_enum construct. * config/cris/cris.opt (mtrap-unaligned-atomic): New option. * config/cris/sync.md: New file. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@188096 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/cris/cris.md')
-rw-r--r--gcc/config/cris/cris.md24
1 files changed, 13 insertions, 11 deletions
diff --git a/gcc/config/cris/cris.md b/gcc/config/cris/cris.md
index 7d691f5a0b5..4b9d4c3986d 100644
--- a/gcc/config/cris/cris.md
+++ b/gcc/config/cris/cris.md
@@ -55,46 +55,46 @@
;; The movsi for a gotless symbol could be split (post reload).
-(define_constants
+(define_c_enum ""
[
;; PLT reference from call expansion: operand 0 is the address,
;; the mode is VOIDmode. Always wrapped in CONST.
;; The value is relative to the GOT.
- (CRIS_UNSPEC_PLT_GOTREL 0)
+ CRIS_UNSPEC_PLT_GOTREL
;; PLT reference from call expansion: operand 0 is the address,
;; the mode is VOIDmode. Always wrapped in CONST.
;; The value is relative to the PC. It's arch-dependent whether
;; the offset counts from the start or the end of the current item.
- (CRIS_UNSPEC_PLT_PCREL 1)
+ CRIS_UNSPEC_PLT_PCREL
;; The address of the global offset table as a source operand.
- (CRIS_UNSPEC_GOT 2)
+ CRIS_UNSPEC_GOT
;; The offset from the global offset table to the operand.
- (CRIS_UNSPEC_GOTREL 3)
+ CRIS_UNSPEC_GOTREL
;; The PC-relative offset to the operand. It's arch-dependent whether
;; the offset counts from the start or the end of the current item.
- (CRIS_UNSPEC_PCREL 4)
+ CRIS_UNSPEC_PCREL
;; The index into the global offset table of a symbol, while
;; also generating a GOT entry for the symbol.
- (CRIS_UNSPEC_GOTREAD 5)
+ CRIS_UNSPEC_GOTREAD
;; Similar to CRIS_UNSPEC_GOTREAD, but also generating a PLT entry.
- (CRIS_UNSPEC_PLTGOTREAD 6)
+ CRIS_UNSPEC_PLTGOTREAD
;; Condition for v32 casesi jump, since it needs to have if_then_else
;; form with register as one branch and default label as other.
;; Operand 0 is const_int 0.
- (CRIS_UNSPEC_CASESI 7)
+ CRIS_UNSPEC_CASESI
;; Stack frame deallocation barrier.
- (CRIS_UNSPEC_FRAME_DEALLOC 8)
+ CRIS_UNSPEC_FRAME_DEALLOC
;; Swap all 32 bits of the operand; 31 <=> 0, 30 <=> 1...
- (CRIS_UNSPEC_SWAP_BITS 9)
+ CRIS_UNSPEC_SWAP_BITS
])
;; Register numbers.
@@ -4165,6 +4165,8 @@
3 [(match_dup 0)
(match_dup 1)]))]
"")
+
+(include "sync.md")
;; Splits for all cases in side-effect insns where (possibly after reload
;; and register allocation) rx and ry in [rx=ry+i] are equal.