1 From 2b4b5775554c91a63ccae4ee566db696b633652e Mon Sep 17 00:00:00 2001
2 From: jcmvbkbc <jcmvbkbc@138bc75d-0d04-0410-961f-82ee72b054a4>
3 Date: Wed, 10 Jun 2015 15:07:40 +0000
4 Subject: [PATCH] xtensa: implement trap pattern
6 2015-06-10 Max Filippov <jcmvbkbc@gmail.com>
8 * config/xtensa/xtensa.h (TARGET_DEBUG): New definition.
9 * config/xtensa/xtensa.md (define_attr "type"): New type "trap".
10 (define_insn "trap"): New definition.
12 Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
14 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@224330 138bc75d-0d04-0410-961f-82ee72b054a4
16 gcc/config/xtensa/xtensa.h | 1 +
17 gcc/config/xtensa/xtensa.md | 15 ++++++++++++++-
18 2 files changed, 15 insertions(+), 1 deletion(-)
20 diff --git a/gcc/config/xtensa/xtensa.h b/gcc/config/xtensa/xtensa.h
21 index 615f741..fb8702c 100644
22 --- a/gcc/config/xtensa/xtensa.h
23 +++ b/gcc/config/xtensa/xtensa.h
24 @@ -67,6 +67,7 @@ extern unsigned xtensa_current_frame_size;
25 #define TARGET_THREADPTR XCHAL_HAVE_THREADPTR
26 #define TARGET_LOOPS XCHAL_HAVE_LOOPS
27 #define TARGET_WINDOWED_ABI (XSHAL_ABI == XTHAL_ABI_WINDOWED)
28 +#define TARGET_DEBUG XCHAL_HAVE_DEBUG
30 #define TARGET_DEFAULT \
31 ((XCHAL_HAVE_L32R ? 0 : MASK_CONST16) | \
32 diff --git a/gcc/config/xtensa/xtensa.md b/gcc/config/xtensa/xtensa.md
33 index 6d84384..a577aa3 100644
34 --- a/gcc/config/xtensa/xtensa.md
35 +++ b/gcc/config/xtensa/xtensa.md
40 - "unknown,jump,call,load,store,move,arith,multi,nop,farith,fmadd,fconv,fload,fstore,mul16,mul32,div32,mac16,rsr,wsr,entry"
41 + "unknown,jump,call,load,store,move,arith,multi,nop,farith,fmadd,fconv,fload,fstore,mul16,mul32,div32,mac16,rsr,wsr,entry,trap"
42 (const_string "unknown"))
45 @@ -1764,6 +1764,19 @@
46 [(set_attr "length" "0")
47 (set_attr "type" "nop")])
50 + [(trap_if (const_int 1) (const_int 0))]
54 + return "break\t1, 15";
56 + return (TARGET_DENSITY ? "ill.n" : "ill");
58 + [(set_attr "type" "trap")
59 + (set_attr "mode" "none")
60 + (set_attr "length" "3")])
62 ;; Setting up a frame pointer is tricky for Xtensa because GCC doesn't
63 ;; know if a frame pointer is required until the reload pass, and
64 ;; because there may be an incoming argument value in the hard frame