From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98305C433E6 for ; Fri, 12 Feb 2021 18:06:07 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 18D3B64DA5 for ; Fri, 12 Feb 2021 18:06:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 18D3B64DA5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:43018 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lAcpS-0002c8-0e for qemu-devel@archiver.kernel.org; Fri, 12 Feb 2021 13:06:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:56590) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lAcnB-0001TV-HX for qemu-devel@nongnu.org; Fri, 12 Feb 2021 13:03:45 -0500 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]:52100) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lAcn7-0005oW-PM for qemu-devel@nongnu.org; Fri, 12 Feb 2021 13:03:45 -0500 Received: by mail-pj1-x1036.google.com with SMTP id fa16so78312pjb.1 for ; Fri, 12 Feb 2021 10:03:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=ClksEy2NdhComARvpvLs+gMW47tI2snYx/I6xaMsFuU=; b=DBaDb4CJZJwQMUXKBw48Nv6ttm7tPIzErFYfrZAIGvvjUDrGBj2llzyH8Flu+MF8sM MLQ7LzRdBAOBE94x2V/koK7QqDqzxZQtU+oPauwEm2ONThDuzm6m1e7NPOaDdgoxkyHK rDXh4qCOUYv4Wt4AcgxZHRSj1BySvTXHiQFR13GZ5VllfIfzNx3iON4DKxpfdz6JC1wG 8MCFpngWISoS3f806+WykdXMQ9hDqEKS7yqnK0fAuQXeas7A9sjDNlYI++ijYxVe7MgI Tnkuc/DYRw/V8c1q8f8LaYGGQitoFSOMUF9ND0hIWlRo5YoblJLAAuj9LONWP7kO3zgU oHSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ClksEy2NdhComARvpvLs+gMW47tI2snYx/I6xaMsFuU=; b=OlwndCNhr3DUgjzOIt3BKTKY0WDV4fW4OZ0JDQQciZhM5DY0I5toko8LpJ2E3o8coO sJ5ca8rauh+3XIL7yEzeVD17Hp6YoxsfpIoAVFbgxC/ZHm/JFLQR26Yq4FZwsTciQCHG tLOop4swRIrl2ciVlcGtAb8ueDeqlg8GrQ+T9DrAOiASB5xmGYJQ9NUyqQNw2AYoV0kP N04B94B4EP8VCni2VVTBnIlrjlRCnE4oLbVLv4F5eolN77QIOK2jbX8k6NMHLdeWxEWK JzUIqMuFW360GSZyIIdD46/3zlKO0OXiwqV+HkcrsbX68yoeKnkbGA5eulTDxgnQV33Q Jd1w== X-Gm-Message-State: AOAM5313dacWRzZoPiGAkd+forgIJ1DFgX5JLUwVrDtBUuB5Eob8Pz1V tGgt+5lNkyCkBTTXeK6dApqa8g== X-Google-Smtp-Source: ABdhPJz0BR/c9ndQKAKbjXVGw71I1Rjl1LJS1kkIRblNWMdGeI9ym9+mvI7NIFYImT4K8riD7L1Icw== X-Received: by 2002:a17:90a:e7cd:: with SMTP id kb13mr3759819pjb.10.1613153020239; Fri, 12 Feb 2021 10:03:40 -0800 (PST) Received: from [192.168.1.11] (174-21-150-71.tukw.qwest.net. [174.21.150.71]) by smtp.gmail.com with ESMTPSA id o14sm10887367pgr.44.2021.02.12.10.03.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 12 Feb 2021 10:03:39 -0800 (PST) Subject: Re: [PATCH 04/38] target/riscv: 16-bit Addition & Subtraction Instructions To: LIU Zhiwei , qemu-devel@nongnu.org References: <20210212150256.885-1-zhiwei_liu@c-sky.com> <20210212150256.885-5-zhiwei_liu@c-sky.com> From: Richard Henderson Message-ID: Date: Fri, 12 Feb 2021 10:03:37 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210212150256.885-5-zhiwei_liu@c-sky.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2607:f8b0:4864:20::1036; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1036.google.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.119, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alistair23@gmail.com, qemu-riscv@nongnu.org, palmer@dabbelt.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 2/12/21 7:02 AM, LIU Zhiwei wrote: > + if (a->rd && a->rs1 && a->rs2) { > +#ifdef TARGET_RISCV64 > + f64(vece, offsetof(CPURISCVState, gpr[a->rd]), > + offsetof(CPURISCVState, gpr[a->rs1]), > + offsetof(CPURISCVState, gpr[a->rs2]), > + 8, 8); > +#else This is not legal tcg. You cannot reference as memory anything which has an associated tcg_global_mem. Which is true for all of the gprs -- see riscv_translate_init. r~ From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lAcnE-0001Vu-0G for mharc-qemu-riscv@gnu.org; Fri, 12 Feb 2021 13:03:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:56594) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lAcnC-0001UA-5o for qemu-riscv@nongnu.org; Fri, 12 Feb 2021 13:03:46 -0500 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]:45310) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lAcn7-0005oY-Ud for qemu-riscv@nongnu.org; Fri, 12 Feb 2021 13:03:45 -0500 Received: by mail-pl1-x636.google.com with SMTP id b8so238990plh.12 for ; Fri, 12 Feb 2021 10:03:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=ClksEy2NdhComARvpvLs+gMW47tI2snYx/I6xaMsFuU=; b=DBaDb4CJZJwQMUXKBw48Nv6ttm7tPIzErFYfrZAIGvvjUDrGBj2llzyH8Flu+MF8sM MLQ7LzRdBAOBE94x2V/koK7QqDqzxZQtU+oPauwEm2ONThDuzm6m1e7NPOaDdgoxkyHK rDXh4qCOUYv4Wt4AcgxZHRSj1BySvTXHiQFR13GZ5VllfIfzNx3iON4DKxpfdz6JC1wG 8MCFpngWISoS3f806+WykdXMQ9hDqEKS7yqnK0fAuQXeas7A9sjDNlYI++ijYxVe7MgI Tnkuc/DYRw/V8c1q8f8LaYGGQitoFSOMUF9ND0hIWlRo5YoblJLAAuj9LONWP7kO3zgU oHSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ClksEy2NdhComARvpvLs+gMW47tI2snYx/I6xaMsFuU=; b=QRFFlYX+BRc6QNicjTM/vUfFCnBilS4VArmst/gqKUZ9EG8Hyw5olvdEKklpF6q8/k CfgTAonkKuepgX8weNzycid6HMIyiyDIwJ9D82vfETpNgfU8fRO94JEFeA1qRGvTyOzH nZGtGdhckas0DpGZyhrCRc1MGGd9rHXm22UaZv+D4xeH6pnjdEN2Tl2OVFcGV6qg1aQ8 oT2z8dD8T5zUL1Zedz+yMhYEbBViuWToTsXu5+IzyAy9vAv8nRPorl8qvTOVm7yFQNYx lvguSH6r1Tqn+V1zF0n4WNcb1OIVZJXmQNV0Xi54yql2S16Bhd0pUoDYPRCDnokDA0Fk QTEQ== X-Gm-Message-State: AOAM5332B1NkNfmXBkTZ//ItjMfeqZdoQ4gx9F/xuZpKxfSU7MOzp3d0 ApfYp6sYBFBRMh7P9h6OAjc9CA== X-Google-Smtp-Source: ABdhPJz0BR/c9ndQKAKbjXVGw71I1Rjl1LJS1kkIRblNWMdGeI9ym9+mvI7NIFYImT4K8riD7L1Icw== X-Received: by 2002:a17:90a:e7cd:: with SMTP id kb13mr3759819pjb.10.1613153020239; Fri, 12 Feb 2021 10:03:40 -0800 (PST) Received: from [192.168.1.11] (174-21-150-71.tukw.qwest.net. [174.21.150.71]) by smtp.gmail.com with ESMTPSA id o14sm10887367pgr.44.2021.02.12.10.03.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 12 Feb 2021 10:03:39 -0800 (PST) Subject: Re: [PATCH 04/38] target/riscv: 16-bit Addition & Subtraction Instructions To: LIU Zhiwei , qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, alistair23@gmail.com, palmer@dabbelt.com References: <20210212150256.885-1-zhiwei_liu@c-sky.com> <20210212150256.885-5-zhiwei_liu@c-sky.com> From: Richard Henderson Message-ID: Date: Fri, 12 Feb 2021 10:03:37 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210212150256.885-5-zhiwei_liu@c-sky.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x636.google.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.119, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-riscv@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 18:03:46 -0000 On 2/12/21 7:02 AM, LIU Zhiwei wrote: > + if (a->rd && a->rs1 && a->rs2) { > +#ifdef TARGET_RISCV64 > + f64(vece, offsetof(CPURISCVState, gpr[a->rd]), > + offsetof(CPURISCVState, gpr[a->rs1]), > + offsetof(CPURISCVState, gpr[a->rs2]), > + 8, 8); > +#else This is not legal tcg. You cannot reference as memory anything which has an associated tcg_global_mem. Which is true for all of the gprs -- see riscv_translate_init. r~