From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:50354) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QzE9R-0007OP-8q for qemu-devel@nongnu.org; Thu, 01 Sep 2011 16:46:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QzE9Q-00038i-2g for qemu-devel@nongnu.org; Thu, 01 Sep 2011 16:46:17 -0400 Received: from [188.134.19.124] (port=36848 helo=octofox.metropolis) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QzE9P-00038K-Nw for qemu-devel@nongnu.org; Thu, 01 Sep 2011 16:46:16 -0400 From: Max Filippov Date: Fri, 2 Sep 2011 00:45:33 +0400 Message-Id: <1314909960-31738-6-git-send-email-jcmvbkbc@gmail.com> In-Reply-To: <1314909960-31738-1-git-send-email-jcmvbkbc@gmail.com> References: <1314909960-31738-1-git-send-email-jcmvbkbc@gmail.com> Subject: [Qemu-devel] [PATCH v4 05/32] target-xtensa: implement RT0 group List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: jcmvbkbc@gmail.com NEG and ABS are the only members of RT0 group. Signed-off-by: Max Filippov --- 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 7404098..c9e2c06 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*/ -- 1.7.6