Skip to content

Commit c918a58

Browse files
Claudiu Zissulescuartemiy-volkov
authored andcommitted
Revert "arc64: Add table-jump support."
This reverts commit 8cc5bee986806d0dc60a11e0b7bd625f631b72ad.
1 parent 8c8df95 commit c918a58

File tree

5 files changed

+5
-94
lines changed

5 files changed

+5
-94
lines changed

gcc/config/arc64/arc64-protos.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ extern int arc64_asm_preferred_eh_data_format (int, int);
2929
extern void arc64_expand_atomic_op (enum rtx_code, rtx, rtx, rtx, rtx, rtx);
3030
extern void arc64_expand_compare_and_swap (rtx []);
3131
extern void arc64_split_compare_and_swap (rtx []);
32-
extern void arc64_expand_casesi (rtx []);
3332
extern bool arc64_allow_direct_access_p (rtx);
3433

3534
#endif /* RTX_CODE */

gcc/config/arc64/arc64.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3181,6 +3181,7 @@ arc64_split_compare_and_swap (rtx operands[])
31813181
emit_label (label2);
31823182
}
31833183

3184+
#if 0
31843185
/* Expander for casesi. The vector table is always PC-relative, and
31853186
it is made up of branch instructions. When we have CODE_DENSITY
31863187
option enabled, we use BI instruction, otherwise, depending on the
@@ -3241,6 +3242,7 @@ void arc64_expand_casesi (rtx operands[])
32413242

32423243
emit_jump_insn (gen_casesi_dispatch (operands[0], operands[3]));
32433244
}
3245+
#endif
32443246

32453247
bool
32463248
arc64_allow_direct_access_p (rtx op)

gcc/config/arc64/arc64.h

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -423,11 +423,7 @@ extern const enum reg_class arc64_regno_to_regclass[];
423423
/* Names to predefine in the preprocessor for this target machine. */
424424
#define TARGET_CPU_CPP_BUILTINS() arc64_cpu_cpp_builtins (pfile)
425425

426-
/* Dispatch tables. */
427-
#define JUMP_TABLES_IN_TEXT_SECTION 1
428-
#define CASE_VECTOR_MODE SImode
429-
#define CASE_VECTOR_PC_RELATIVE 1
430-
#define ADDR_VEC_ALIGN(VEC_INSN) 0
426+
#define CASE_VECTOR_MODE Pmode
431427

432428
/* Define this macro if it is advisable to hold scalars in registers
433429
in a wider mode than that declared by the program. In such cases,
@@ -473,16 +469,6 @@ extern const enum reg_class arc64_regno_to_regclass[];
473469
} \
474470
while (0)
475471

476-
#define LOCAL_LABEL_PREFIX "."
477-
478-
/* This is how to output an element of a PIC case-vector. */
479-
#define ASM_OUTPUT_ADDR_DIFF_ELT(STREAM, BODY, VALUE, REL) \
480-
fprintf (STREAM, "\tb\t@%sL%d\n", \
481-
LOCAL_LABEL_PREFIX, VALUE)
482-
483-
/* Defined to also emit an .align in elfos.h. We don't want that. */
484-
#undef ASM_OUTPUT_CASE_LABEL
485-
486472
/* Section selection. */
487473

488474
/* Globalizing directive for a label. */
@@ -536,8 +522,6 @@ extern const enum reg_class arc64_regno_to_regclass[];
536522

537523
#define TARGET_ARC64_MPY64 TARGET_MPY64
538524

539-
#define ARC64_HAS_CODE_DENSITY TARGET_CODE_DENSITY
540-
541525
/* IFCVT macros. */
542526
#define STORE_FLAG_VALUE 1
543527
#define MAX_CONDITIONAL_EXECUTE 12

gcc/config/arc64/arc64.md

Lines changed: 2 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,8 @@
7676
ARC64_UNSPEC_TLS_GD
7777
ARC64_UNSPEC_TLS_IE
7878
ARC64_UNSPEC_TLS_OFF
79-
ARC64_UNSPEC_MEMBAR
80-
ARC64_UNSPEC_CASESI
81-
8279
ARC64_VUNSPEC_BLOCKAGE
80+
8381
ARC64_VUNSPEC_LR
8482
ARC64_VUNSPEC_SR
8583
ARC64_VUNSPEC_FLAG
@@ -93,6 +91,7 @@
9391
ARC64_VUNSPEC_LL
9492
ARC64_VUNSPEC_SYNC
9593

94+
ARC64_UNSPEC_MEMBAR
9695
])
9796

9897
(include "constraints.md")
@@ -290,17 +289,6 @@ udivl, umod, umodl, unknown, xbfu, xor, xorl"
290289
]
291290
(const_int 8)))
292291

293-
;; Select various CPU features.
294-
(define_attr "cpu_facility" "std,cd"
295-
(const_string "std"))
296-
297-
(define_attr "enabled" "no,yes"
298-
(cond [(and (eq_attr "cpu_facility" "cd")
299-
(not (match_test ("ARC64_HAS_CODE_DENSITY"))))
300-
(const_string "no")
301-
]
302-
(const_string "yes")))
303-
304292
;; -------------------------------------------------------------------
305293
;; Pipeline descriptions and scheduling
306294
;; -------------------------------------------------------------------
@@ -925,64 +913,6 @@ udivl, umod, umodl, unknown, xbfu, xor, xorl"
925913
[(set_attr "type" "return")
926914
(set_attr "length" "4")])
927915

928-
; jump tables
929-
(define_expand "casesi"
930-
[(match_operand:SI 0 "register_operand" "") ; Index
931-
(match_operand 1 "const_int_operand" "") ; Lower bound
932-
(match_operand 2 "const_int_operand" "") ; Total range
933-
(match_operand 3 "" "") ; Table label
934-
(match_operand 4 "" "")] ; Out of range label
935-
""
936-
{
937-
arc64_expand_casesi (operands);
938-
DONE;
939-
})
940-
941-
(define_insn "casesi_dispatch"
942-
[(set (pc)
943-
(unspec:DI [(match_operand:SI 0 "register_operand" "r,q,r")
944-
(label_ref (match_operand 1 "" ""))
945-
(const_int 0)]
946-
ARC64_UNSPEC_CASESI))]
947-
""
948-
"@
949-
bi\\t[%0]
950-
j_s\\t[%0]
951-
j\\t[%0]"
952-
[(set_attr "type" "jump")
953-
(set_attr "length" "4,2,4")
954-
(set_attr "cpu_facility" "cd,*,*")])
955-
956-
(define_insn "casesi_addaddr"
957-
[(set (match_operand:SI 0 "register_operand" "=r")
958-
(unspec:SI [(match_operand:SI 1 "register_operand" "r")
959-
(label_ref (match_operand 2 "" ""))
960-
(const_int 1)]
961-
ARC64_UNSPEC_CASESI))]
962-
""
963-
"add2\\t%0,%l2,%1"
964-
[(set_attr "type" "add")
965-
(set_attr "length" "8")])
966-
967-
(define_insn "casesi_addaddrdi"
968-
[(set (match_operand:DI 0 "register_operand" "=r")
969-
(unspec:DI [(match_operand:SI 1 "register_operand" "r")
970-
(match_operand:DI 2 "register_operand" "r")
971-
(const_int 2)]
972-
ARC64_UNSPEC_CASESI))]
973-
""
974-
"add2l\\t%0,%2,%1"
975-
[(set_attr "type" "addl")
976-
(set_attr "length" "4")])
977-
978-
(define_insn "casesi_dispatchdi"
979-
[(set (pc) (match_operand:DI 0 "register_operand" "q,r"))
980-
(use (label_ref (match_operand 1 "" "")))]
981-
""
982-
"j%?\\t[%0]"
983-
[(set_attr "type" "jump")
984-
(set_attr "length" "2,4")])
985-
986916

987917
;; -------------------------------------------------------------------
988918
;; Sign/Zero extension

gcc/config/arc64/arc64.opt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,3 @@ Enable MPY64 multiplication instructions.
6767
mcpu=
6868
Target RejectNegative Joined
6969
-mcpu= Generate code for specific ARCv3 CPU variant.
70-
71-
mcode-density
72-
Target Report Mask(CODE_DENSITY)
73-
Enable code-density instructions.

0 commit comments

Comments
 (0)