Skip to content

Commit cc727f8

Browse files
Shahab Vahediartemiy-volkov
Shahab Vahedi
authored andcommitted
[ARCx] movqi: Add w6 immediate store
Signed-off-by: Shahab Vahedi <[email protected]>
1 parent 211a7f4 commit cc727f8

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

gcc/config/arc64/arc64.h

+1
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,7 @@ extern const enum reg_class arc64_regno_to_regclass[];
366366
#define UNSIGNED_INT32(X) (UNSIGNED(X,32))
367367

368368
#define SIGNED_INT3(X) (SIGNED(X,3))
369+
#define SIGNED_INT6(X) (SIGNED(X,6))
369370
#define SIGNED_INT7(X) (SIGNED(X,7))
370371
#define SIGNED_INT8(X) (SIGNED(X,8))
371372
#define SIGNED_INT9(X) (SIGNED(X,9))

gcc/config/arc64/arc64.md

+8-3
Original file line numberDiff line numberDiff line change
@@ -266,14 +266,19 @@ unknown, xor, xorl"
266266
;; stb_s b , [sp, u7]
267267
;; stb_s c , [b , u5]
268268
(define_insn "*arc64_movqi"
269-
[(set (match_operand:QI 0 "nonimmediate_operand" "=r, r, r, m")
270-
(match_operand:QI 1 "general_operand" " r, i, m, r"))
269+
[(set (match_operand:QI 0 "nonimmediate_operand" "=r, r, m, r, m")
270+
(match_operand:QI 1 "general_operand" " r, i, S06S0, m, r"))
271271
]
272+
; in general, at least one of the operands must be a register
272273
"register_operand (operands[0], QImode)
273-
|| register_operand (operands[1], QImode)"
274+
|| register_operand (operands[1], QImode)
275+
/* this is to match 'stb w6, [limm]' (S06S0 is the w6) */
276+
|| (satisfies_constraint_S06S0 (operands[1])
277+
&& memory_operand (operands[0], QImode))"
274278
"@
275279
mov\\t%0,%1
276280
mov\\t%0,%1
281+
stb\\t%1,[%0]
277282
ldb\\t%0,[%1]
278283
stb\\t%1,[%0]"
279284
)

gcc/config/arc64/constraints.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,14 @@
8686
(and (match_code "const_int")
8787
(match_test "UNSIGNED_INT6 (ival - 1)")))
8888

89-
;---------------------------------------------------------
9089

90+
(define_constraint "S06S0" "@internal
91+
A 6-bit signed integer constant"
92+
(and
93+
(match_code "const_int")
94+
(match_test "SIGNED_INT6 (ival)")))
95+
96+
;---------------------------------------------------------
9197

9298
(define_constraint "U06S0" "@internal
9399
A 6-bit unsigned integer constant"

0 commit comments

Comments
 (0)