Skip to content

Commit dbc7799

Browse files
Claudiu Zissulescuartemiy-volkov
authored andcommitted
arc64: Add SRL/LRL builtins
1 parent cad6d75 commit dbc7799

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

gcc/config/arc64/arc64.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1983,6 +1983,13 @@ arc64_init_builtins (void)
19831983
tree void_ftype_usint
19841984
= build_function_type_list (void_type_node, unsigned_type_node,
19851985
NULL_TREE);
1986+
tree long_ftype_long
1987+
= build_function_type_list (long_long_integer_type_node,
1988+
long_long_integer_type_node, NULL_TREE);
1989+
1990+
tree void_ftype_long_long
1991+
= build_function_type_list (void_type_node, long_long_integer_type_node,
1992+
long_long_integer_type_node, NULL_TREE);
19861993

19871994
/* Add the builtins. */
19881995
#define DEF_BUILTIN(NAME, N_ARGS, TYPE, ICODE, MASK) \

gcc/config/arc64/arc64.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@
8080

8181
ARC64_VUNSPEC_LR
8282
ARC64_VUNSPEC_SR
83+
ARC64_VUNSPEC_LRL
84+
ARC64_VUNSPEC_SRL
8385
ARC64_VUNSPEC_FLAG
8486
ARC64_VUNSPEC_BRK
8587
ARC64_VUNSPEC_NOP
@@ -1559,6 +1561,26 @@ umod, umodl, unknown, xbfu, xor, xorl"
15591561
[(set_attr "length" "4,4,4,8")
15601562
(set_attr "type" "sr")])
15611563

1564+
(define_insn "lrl"
1565+
[(set (match_operand:DI 0 "register_operand" "=r,r,r,r")
1566+
(unspec_volatile:DI
1567+
[(match_operand:DI 1 "nonmemory_operand" "U06S0,S12S0,r,i")]
1568+
ARC64_VUNSPEC_LRL))]
1569+
""
1570+
"lrl\\t%0,[%1]"
1571+
[(set_attr "length" "4,4,4,8")
1572+
(set_attr "type" "lr")])
1573+
1574+
(define_insn "srl"
1575+
[(unspec_volatile
1576+
[(match_operand:DI 0 "register_operand" " r, r, r, r")
1577+
(match_operand:DI 1 "nonmemory_operand" "U06S0,S12S0, i, r")]
1578+
ARC64_VUNSPEC_SRL)]
1579+
""
1580+
"srl\\t%0,[%1]"
1581+
[(set_attr "length" "4,4,4,8")
1582+
(set_attr "type" "sr")])
1583+
15621584
(define_insn "flag"
15631585
[(unspec_volatile [(match_operand:SI 0 "nonmemory_operand" "U06S0,S12S0,r,i")]
15641586
ARC64_VUNSPEC_FLAG)]

gcc/config/arc64/builtins.def

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@
3131
is needed to expand the built-in, use `nothing'.
3232
MASK: CPU selector mask. */
3333

34-
DEF_BUILTIN (NOP, 0, void_ftype_void, nothing, 1)
34+
DEF_BUILTIN (NOP, 0, void_ftype_void, nothing, 1)
3535
DEF_BUILTIN (SR, 2, void_ftype_usint_usint, sr, 1)
3636
DEF_BUILTIN (LR, 1, usint_ftype_usint, lr, 1)
3737
DEF_BUILTIN (BRK, 0, void_ftype_void, brk, 1)
3838
DEF_BUILTIN (FLAG, 1, void_ftype_usint, flag, 1)
39+
DEF_BUILTIN (SRL, 2, void_ftype_long_long, srl, 1)
40+
DEF_BUILTIN (LRL, 1, long_ftype_long, lrl, 1)
3941

4042
DEF_BUILTIN (TRAP_S, 1, void_ftype_usint, trap_s, 1)

0 commit comments

Comments
 (0)