Skip to content

Commit 38ee5e0

Browse files
author
wangyang
committed
riscv: gate D-width atomic translators on the A extension
1 parent 938efd1 commit 38ee5e0

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

qemu/target/riscv/insn_trans/trans_rva.inc.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,56 +172,67 @@ static bool trans_amomaxu_w(DisasContext *ctx, arg_amomaxu_w *a)
172172

173173
static bool trans_lr_d(DisasContext *ctx, arg_lr_d *a)
174174
{
175+
REQUIRE_EXT(ctx, RVA);
175176
return gen_lr(ctx, a, MO_ALIGN | MO_TEQ);
176177
}
177178

178179
static bool trans_sc_d(DisasContext *ctx, arg_sc_d *a)
179180
{
181+
REQUIRE_EXT(ctx, RVA);
180182
return gen_sc(ctx, a, (MO_ALIGN | MO_TEQ));
181183
}
182184

183185
static bool trans_amoswap_d(DisasContext *ctx, arg_amoswap_d *a)
184186
{
187+
REQUIRE_EXT(ctx, RVA);
185188
return gen_amo(ctx, a, &tcg_gen_atomic_xchg_tl, (MO_ALIGN | MO_TEQ));
186189
}
187190

188191
static bool trans_amoadd_d(DisasContext *ctx, arg_amoadd_d *a)
189192
{
193+
REQUIRE_EXT(ctx, RVA);
190194
return gen_amo(ctx, a, &tcg_gen_atomic_fetch_add_tl, (MO_ALIGN | MO_TEQ));
191195
}
192196

193197
static bool trans_amoxor_d(DisasContext *ctx, arg_amoxor_d *a)
194198
{
199+
REQUIRE_EXT(ctx, RVA);
195200
return gen_amo(ctx, a, &tcg_gen_atomic_fetch_xor_tl, (MO_ALIGN | MO_TEQ));
196201
}
197202

198203
static bool trans_amoand_d(DisasContext *ctx, arg_amoand_d *a)
199204
{
205+
REQUIRE_EXT(ctx, RVA);
200206
return gen_amo(ctx, a, &tcg_gen_atomic_fetch_and_tl, (MO_ALIGN | MO_TEQ));
201207
}
202208

203209
static bool trans_amoor_d(DisasContext *ctx, arg_amoor_d *a)
204210
{
211+
REQUIRE_EXT(ctx, RVA);
205212
return gen_amo(ctx, a, &tcg_gen_atomic_fetch_or_tl, (MO_ALIGN | MO_TEQ));
206213
}
207214

208215
static bool trans_amomin_d(DisasContext *ctx, arg_amomin_d *a)
209216
{
217+
REQUIRE_EXT(ctx, RVA);
210218
return gen_amo(ctx, a, &tcg_gen_atomic_fetch_smin_tl, (MO_ALIGN | MO_TEQ));
211219
}
212220

213221
static bool trans_amomax_d(DisasContext *ctx, arg_amomax_d *a)
214222
{
223+
REQUIRE_EXT(ctx, RVA);
215224
return gen_amo(ctx, a, &tcg_gen_atomic_fetch_smax_tl, (MO_ALIGN | MO_TEQ));
216225
}
217226

218227
static bool trans_amominu_d(DisasContext *ctx, arg_amominu_d *a)
219228
{
229+
REQUIRE_EXT(ctx, RVA);
220230
return gen_amo(ctx, a, &tcg_gen_atomic_fetch_umin_tl, (MO_ALIGN | MO_TEQ));
221231
}
222232

223233
static bool trans_amomaxu_d(DisasContext *ctx, arg_amomaxu_d *a)
224234
{
235+
REQUIRE_EXT(ctx, RVA);
225236
return gen_amo(ctx, a, &tcg_gen_atomic_fetch_umax_tl, (MO_ALIGN | MO_TEQ));
226237
}
227238
#endif

0 commit comments

Comments
 (0)