• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

修訂5a7267b6a9e94c264ca77a7ca5a239e70dac81da (tree)
時間2016-11-01 05:46:48
作者Richard Henderson <rth@twid...>
CommiterRichard Henderson

Log Message

target-sparc: Use tcg_gen_atomic_cmpxchg_tl

Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Richard Henderson <rth@twiddle.net>

Change Summary

差異

--- a/target-sparc/translate.c
+++ b/target-sparc/translate.c
@@ -2391,31 +2391,21 @@ static void gen_swap_asi(DisasContext *dc, TCGv dst, TCGv src,
23912391 }
23922392 }
23932393
2394-static void gen_cas_asi(DisasContext *dc, TCGv addr, TCGv cmpr,
2394+static void gen_cas_asi(DisasContext *dc, TCGv addr, TCGv cmpv,
23952395 int insn, int rd)
23962396 {
23972397 DisasASI da = get_asi(dc, insn, MO_TEUL);
2398- TCGv cmpv, oldv, tmpv;
2398+ TCGv oldv;
23992399
24002400 switch (da.type) {
24012401 case GET_ASI_EXCP:
24022402 return;
24032403 case GET_ASI_DIRECT:
2404- cmpv = tcg_temp_new();
24052404 oldv = tcg_temp_new();
2406- tmpv = tcg_temp_new();
2407- tcg_gen_ext32u_tl(cmpv, cmpr);
2408-
2409- /* ??? Should be atomic. */
2410- tcg_gen_qemu_ld_tl(oldv, addr, da.mem_idx, da.memop);
2411- tcg_gen_movcond_tl(TCG_COND_EQ, tmpv, oldv, cmpv,
2412- gen_load_gpr(dc, rd), oldv);
2413- tcg_gen_qemu_st_tl(tmpv, addr, da.mem_idx, da.memop);
2414-
2405+ tcg_gen_atomic_cmpxchg_tl(oldv, addr, cmpv, gen_load_gpr(dc, rd),
2406+ da.mem_idx, da.memop);
24152407 gen_store_gpr(dc, rd, oldv);
2416- tcg_temp_free(cmpv);
24172408 tcg_temp_free(oldv);
2418- tcg_temp_free(tmpv);
24192409 break;
24202410 default:
24212411 /* ??? Should be DAE_invalid_asi. */
@@ -2770,24 +2760,17 @@ static void gen_casx_asi(DisasContext *dc, TCGv addr, TCGv cmpv,
27702760 int insn, int rd)
27712761 {
27722762 DisasASI da = get_asi(dc, insn, MO_TEQ);
2773- TCGv oldv, tmpv;
2763+ TCGv oldv;
27742764
27752765 switch (da.type) {
27762766 case GET_ASI_EXCP:
27772767 return;
27782768 case GET_ASI_DIRECT:
27792769 oldv = tcg_temp_new();
2780- tmpv = tcg_temp_new();
2781-
2782- /* ??? Should be atomic. */
2783- tcg_gen_qemu_ld_tl(oldv, addr, da.mem_idx, da.memop);
2784- tcg_gen_movcond_tl(TCG_COND_EQ, tmpv, oldv, cmpv,
2785- gen_load_gpr(dc, rd), oldv);
2786- tcg_gen_qemu_st_tl(tmpv, addr, da.mem_idx, da.memop);
2787-
2770+ tcg_gen_atomic_cmpxchg_tl(oldv, addr, cmpv, gen_load_gpr(dc, rd),
2771+ da.mem_idx, da.memop);
27882772 gen_store_gpr(dc, rd, oldv);
27892773 tcg_temp_free(oldv);
2790- tcg_temp_free(tmpv);
27912774 break;
27922775 default:
27932776 /* ??? Should be DAE_invalid_asi. */