diff options
author | Max Filippov <jcmvbkbc@gmail.com> | 2011-09-06 03:55:29 +0400 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2011-09-10 16:57:36 +0000 |
commit | f331fe5e5fc05fc4626e5dfe4be8ef62a7763b99 (patch) | |
tree | b5a14c1d257ab24a12cd82f8c48e72d8dece5a0c /target-xtensa | |
parent | 67882fd177389527510eb36b3f7712011a835545 (diff) |
target-xtensa: implement RT0 group
NEG and ABS are the only members of RT0 group.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'target-xtensa')
-rw-r--r-- | target-xtensa/translate.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/target-xtensa/translate.c b/target-xtensa/translate.c index 4dfca2bcf8..92547d21f7 100644 --- a/target-xtensa/translate.c +++ b/target-xtensa/translate.c @@ -255,6 +255,25 @@ static void disas_xtensa_insn(DisasContext *dc) break; case 6: /*RT0*/ + switch (RRR_S) { + case 0: /*NEG*/ + tcg_gen_neg_i32(cpu_R[RRR_R], cpu_R[RRR_T]); + break; + + case 1: /*ABS*/ + { + int label = gen_new_label(); + tcg_gen_mov_i32(cpu_R[RRR_R], cpu_R[RRR_T]); + tcg_gen_brcondi_i32( + TCG_COND_GE, cpu_R[RRR_R], 0, label); + tcg_gen_neg_i32(cpu_R[RRR_R], cpu_R[RRR_T]); + gen_set_label(label); + } + break; + + default: /*reserved*/ + break; + } break; case 7: /*reserved*/ |