Skip to content

Commit 9998564

Browse files
author
Claudiu Zissulescu
committed
Control if an atomic instruction bypasses the chache or not
1 parent f48abc0 commit 9998564

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

gcc/ChangeLog.ARC

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2013-05-28 Claudiu Zissulescu <[email protected]>
2+
3+
* config/arc/arc.c (%+):New punctuation character.
4+
* config/arc/arc.opt (mbypass-cache): New option.
5+
* config/arc/atomic.md: Use %+ punctuation character.
6+
17
2013-05-27 Claudiu Zissulescu <[email protected]>
28

39
* config/arc/arc.md (simple_return): Use RETI when returning

gcc/config/arc/arc.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -864,6 +864,7 @@ arc_init (void)
864864
arc_punct_chars['!'] = 1;
865865
arc_punct_chars['^'] = 1;
866866
arc_punct_chars['&'] = 1;
867+
arc_punct_chars['+'] = 1;
867868

868869
/* There are two target-independent ifcvt passes, and arc_reorg may do
869870
one ore more arc_ifcvt calls. */
@@ -3300,6 +3301,11 @@ arc_print_operand (FILE *file, rtx x, int code)
33003301
else
33013302
output_operand_lossage ("invalid operand to %%U code");
33023303
return;
3304+
case '+':
3305+
/* Output cache bypass indicator for atomic instructions. */
3306+
if (TARGET_BYPASS_CACHE)
3307+
fputs (".di", file);
3308+
return;
33033309
case 'V' :
33043310
/* Output cache bypass indicator for a load/store insn. Volatile memory
33053311
refs are defined to use the cache bypass mechanism. */

gcc/config/arc/arc.opt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,3 +472,6 @@ Target Joined
472472
mmac_
473473
Target Joined
474474

475+
mbypass-cache
476+
Target Report Mask(BYPASS_CACHE)
477+
Controls the .di instruction extension of atomic instructions. When enabled, the atomic operations operates directly on external memory.

gcc/config/arc/atomic.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
[(match_operand:SI 1 "mem_noofs_operand" "ATO")]
112112
VUNSPEC_LL))]
113113
"TARGET_ATOMIC"
114-
"llock.di %0,%1"
114+
"llock%+ %0,%1"
115115
[(set_attr "type" "load")
116116
(set_attr "iscompact" "false")
117117
(set_attr "predicable" "no")
@@ -123,7 +123,7 @@
123123
VUNSPEC_SC))
124124
(clobber (reg:CC_Z CC_REG))]
125125
"TARGET_ATOMIC"
126-
"scond.di %1,%0"
126+
"scond%+ %1,%0"
127127
[(set_attr "type" "store")
128128
(set_attr "iscompact" "false")
129129
(set_attr "predicable" "no")
@@ -151,7 +151,7 @@
151151
(set (match_dup 1)
152152
(match_operand:SI 2 "register_operand" "0"))]
153153
""
154-
"ex.di %0,%1"
154+
"ex%+ %0,%1"
155155
[(set_attr "type" "load")
156156
(set_attr "iscompact" "false")
157157
(set_attr "predicable" "no")

0 commit comments

Comments
 (0)