From patchwork Mon Sep 21 22:26:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Gang X-Patchwork-Id: 520717 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 6AF0B1401AF for ; Tue, 22 Sep 2015 08:30:35 +1000 (AEST) Received: from localhost ([::1]:34551 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ze9bV-0001Sr-0x for incoming@patchwork.ozlabs.org; Mon, 21 Sep 2015 18:30:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39956) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ze9YE-0003yn-5b for qemu-devel@nongnu.org; Mon, 21 Sep 2015 18:27:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ze9YA-0005uA-6c for qemu-devel@nongnu.org; Mon, 21 Sep 2015 18:27:10 -0400 Received: from smtpbg64.qq.com ([103.7.28.238]:59254) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ze9Y9-0005sr-Js for qemu-devel@nongnu.org; Mon, 21 Sep 2015 18:27:06 -0400 X-QQ-mid: esmtp36t1442874416t755t28347 Received: from localhost.localdomain (unknown [223.72.67.123]) by esmtp5.qq.com (ESMTP) with id ; Tue, 22 Sep 2015 06:26:55 +0800 (CST) X-QQ-SSF: 01000000000000F0FG600F00002000H X-QQ-FEAT: OthLD3hRvFEjy0JTtT2V0LFBDGNx8HjdcbKeZLb4I8MQcR9f2F2A43zocSQRF 6Gy/Ki8f4H6vFxnw3Ei/ud7u38xpK7Qr2xGlt4acv3YfsZAchlX0NxvjmC58+Fgj/6bsUPo 3eSQlvnj9jmEzpIybIW9hU39INtYY1NQBZZ4IEwgpxijfSXtRFEFTHCYyPxCXmxlQsmSXFh nRYjmIrdx/CvCUgt1zlJfw8vE3ul2nGpoJ3CrqQYl3w== X-QQ-GoodBg: 0 X-QQ-CSender: gang.chen.5i5j@qq.com From: gang.chen.5i5j@gmail.com To: peter.maydell@linaro.org, rth@twiddle.net Date: Tue, 22 Sep 2015 06:26:54 +0800 Message-Id: <1442874414-3578-1-git-send-email-gang.chen.5i5j@gmail.com> X-Mailer: git-send-email 1.9.3 X-QQ-SENDSIZE: 520 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 103.7.28.238 Cc: qemu-devel@nongnu.org, xili_gchen_5257@hotmail.com, Chen Gang Subject: [Qemu-devel] [PATCH v2] target-tilegx: Implement v1multu instruction X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Chen Gang Only according to v1shrs implementation. Signed-off-by: Chen Gang Reviewed-by: Richard Henderson --- target-tilegx/helper.h | 2 ++ target-tilegx/simd_helper.c | 13 +++++++++++++ target-tilegx/translate.c | 4 ++++ 3 files changed, 19 insertions(+) diff --git a/target-tilegx/helper.h b/target-tilegx/helper.h index 6d98f3a..90e558d 100644 --- a/target-tilegx/helper.h +++ b/target-tilegx/helper.h @@ -16,3 +16,5 @@ DEF_HELPER_FLAGS_2(v1add, TCG_CALL_NO_RWG_SE, i64, i64, i64) DEF_HELPER_FLAGS_2(v1sub, TCG_CALL_NO_RWG_SE, i64, i64, i64) DEF_HELPER_FLAGS_2(v2add, TCG_CALL_NO_RWG_SE, i64, i64, i64) DEF_HELPER_FLAGS_2(v2sub, TCG_CALL_NO_RWG_SE, i64, i64, i64) + +DEF_HELPER_FLAGS_2(v1multu, TCG_CALL_NO_RWG_SE, i64, i64, i64) diff --git a/target-tilegx/simd_helper.c b/target-tilegx/simd_helper.c index 00265fe..b98573e 100644 --- a/target-tilegx/simd_helper.c +++ b/target-tilegx/simd_helper.c @@ -107,3 +107,16 @@ uint64_t helper_v2shrs(uint64_t a, uint64_t b) } return r; } + +uint64_t helper_v1multu(uint64_t a, uint64_t b) +{ + uint64_t r = 0; + int i; + + for (i = 0; i < 64; i += 8) { + uint64_t ae = (uint8_t)(a >> i); + uint64_t be = (uint8_t)(b >> i); + r |= ((ae * be) & 0xff) << i; + } + return r; +} diff --git a/target-tilegx/translate.c b/target-tilegx/translate.c index 297de5c..a9fc4ce 100644 --- a/target-tilegx/translate.c +++ b/target-tilegx/translate.c @@ -1113,7 +1113,11 @@ static TileExcp gen_rrr_opcode(DisasContext *dc, unsigned opext, case OE_RRR(V1MINU, 0, X1): case OE_RRR(V1MNZ, 0, X0): case OE_RRR(V1MNZ, 0, X1): + return TILEGX_EXCP_OPCODE_UNIMPLEMENTED; case OE_RRR(V1MULTU, 0, X0): + gen_helper_v1multu(tdest, tsrca, tsrcb); + mnemonic = "v1multu"; + break; case OE_RRR(V1MULUS, 0, X0): case OE_RRR(V1MULU, 0, X0): case OE_RRR(V1MZ, 0, X0):