target/m68k: optimize bcd_flags() using extract op

Done with the Coccinelle semantic patch
scripts/coccinelle/tcg_gen_extract.cocci.

Backports commit 0d9acef24062844b96c671b4379d9fb03c3ea606 from qemu
This commit is contained in:
Philippe Mathieu-Daudé 2018-03-03 23:09:02 -05:00 committed by Lioncash
parent fc52eea5e2
commit e5486b636b
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -1786,8 +1786,7 @@ static void bcd_flags(DisasContext *s, TCGv val)
tcg_gen_andi_i32(tcg_ctx, QREG_CC_C, val, 0x0ff);
tcg_gen_or_i32(tcg_ctx, QREG_CC_Z, QREG_CC_Z, QREG_CC_C);
tcg_gen_shri_i32(tcg_ctx, QREG_CC_C, val, 8);
tcg_gen_andi_i32(tcg_ctx, QREG_CC_C, QREG_CC_C, 1);
tcg_gen_extract_i32(tcg_ctx, QREG_CC_C, val, 8, 1);
tcg_gen_mov_i32(tcg_ctx, QREG_CC_X, QREG_CC_C);
}