Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3507584rdb; Wed, 13 Sep 2023 14:22:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGcqoO17Jw8gbv97BFGsY44tZNPY/r1juENQM1pz9fGTbLeU4RMgQgiCoaEnbWI/C3cvxTR X-Received: by 2002:a05:6358:7253:b0:139:c7cb:77b8 with SMTP id i19-20020a056358725300b00139c7cb77b8mr5086483rwa.20.1694640176278; Wed, 13 Sep 2023 14:22:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694640176; cv=none; d=google.com; s=arc-20160816; b=yfcMkrkN6R9L1FjsaCY5IHQx1Gnxc9oCDojzu96yHTnQMr29vDS0fa5/6sMvQocxaj KSIfuaGyTosST+bkYweAqQ00ZAzhN9fW6TYKCjJJn9JhFjFtjbXjS86qc+vgckwZROFb 6isa6unIH427+EbRVY68rTv1Q6DEai3nNZTt4trAOdAXPm0tqw9weg1CTTtCglMewTVU jhWtIqvlENicXMA1BzGrk8/I6YJIoxayW8YuDho7jRt9lCBfJjwUOnIcwHiwRW02wN70 hwhOJDGQB+teNZrfcXqkafhizzI3+e1moUyq2GFmXF0Mq6jSbYK9rHfAxPJov+oWZpim jYoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=pOYWZ5KbH/0HAS2JInGVb8ijzNcSLHL5YkOTmi/lJ34=; fh=+qX2nwDEj1wR4Hilt2oYQbwiK7O/gE5f9eeK/5aXdt0=; b=AMx56yM0QIRFrZjwJ2T4R+w+rsMr1uHxTwphIciKYHnv7aNGSy9yhNnP8ZNj1k8zv4 nlFdZ9i0LAJxwn+RgdDb/jNuHyJFE8IQY2obqA8CyMKHohr4QLaF3UdazrEB8nNWxs9v 8GYHTJWTaE6cRFN8jkNlbNy35VqCTXlnCqkHpANfmoTj2gIIRzqitqhi/+ADQ16bodGM CLI+wa7x6bDuGnj8s4mmbGePRNNE1MB3dRsdkIYL8KnnlmWFPoXB36CKsutRmZomfghW elV+ij/GN7rn+/5LMd3iHkoZZM5p+6y/5btcgqvYe2hqsjeSvPil/gFGijzL4LABV4VN 2pDg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id p13-20020a63e64d000000b0056ba5e3f604si10483702pgj.352.2023.09.13.14.22.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 14:22:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 6AA2F8328AC7; Wed, 13 Sep 2023 14:14:58 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232740AbjIMVO7 convert rfc822-to-8bit (ORCPT + 99 others); Wed, 13 Sep 2023 17:14:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232512AbjIMVO7 (ORCPT ); Wed, 13 Sep 2023 17:14:59 -0400 Received: from mail-io1-f43.google.com (mail-io1-f43.google.com [209.85.166.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A52D1739; Wed, 13 Sep 2023 14:14:55 -0700 (PDT) Received: by mail-io1-f43.google.com with SMTP id ca18e2360f4ac-79275d86bc3so10566639f.0; Wed, 13 Sep 2023 14:14:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694639694; x=1695244494; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LXBax8RnwSuSMRj84NUSnytgzb/GY+/2s76swkIeU5w=; b=KaP+7t/nOXenQIqOBNABpCeNsEogpzdtx5f0H2u31mYsiDVeNz2R8IiDmHDKQTKaOj 5iIqU6Jx+wuYUMGRX67Gt5XHmHY2cyYn7K3tuI+ft6tXCLIhtuZ2touDrLf0itH7SCwX uz2FVeQa2boIsvhyUJJKz50V5SNdOFHTyXibrCaRoPkfGMpczAoiv9aLK88rWTCXxhpQ wbNaVwdyae1FZLXdHynKvUmJfVAVfnF3eFeQy953XIOypvSvTsTELRm/rrg0LvQwnecZ a14SGEIipo6UXE2cl6o6ngCPgPQFBckteJ6zUzIXe70Bg4XCHXLyddrRqzg8iwrD5YOD d/sw== X-Gm-Message-State: AOJu0Yxnh4O8nMXeVpaO7hayod6xIvifMk6otEqPw49+KIvna+lth3H3 jha2NPNbpDkhMhaBTWalYfWX6VRHGX8SC2Vj2p4= X-Received: by 2002:a6b:6d15:0:b0:795:196c:a074 with SMTP id a21-20020a6b6d15000000b00795196ca074mr4507574iod.3.1694639694271; Wed, 13 Sep 2023 14:14:54 -0700 (PDT) MIME-Version: 1.0 References: <20230908052216.566148-1-namhyung@kernel.org> In-Reply-To: From: Namhyung Kim Date: Wed, 13 Sep 2023 14:14:42 -0700 Message-ID: Subject: Re: [PATCH] perf annotate: Add more x86 mov instruction cases To: David Laight Cc: Ian Rogers , Arnaldo Carvalho de Melo , Jiri Olsa , Adrian Hunter , Peter Zijlstra , Ingo Molnar , LKML , "linux-perf-users@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 13 Sep 2023 14:14:58 -0700 (PDT) On Mon, Sep 11, 2023 at 1:12 AM David Laight wrote: > > From: Namhyung Kim > > Sent: 09 September 2023 00:56 > > > > Hi Ian, > > > > On Thu, Sep 7, 2023 at 11:24 PM Ian Rogers wrote: > > > > > > On Thu, Sep 7, 2023 at 10:22 PM Namhyung Kim wrote: > > > > > > > > Instructions with sign- and zero- extention like movsbl and movzwq were > > > > not handled properly. As it can check different size suffix (-b, -w, -l > > > > or -q) we can omit that and add the common parts even though some > > > > combinations are not possible. > > > > > > > > Signed-off-by: Namhyung Kim > > > > --- > > > > tools/perf/arch/x86/annotate/instructions.c | 9 ++++++--- > > > > 1 file changed, 6 insertions(+), 3 deletions(-) > > > > > > > > diff --git a/tools/perf/arch/x86/annotate/instructions.c > > b/tools/perf/arch/x86/annotate/instructions.c > > > > index 5f4ac4fc7fcf..5cdf457f5cbe 100644 > > > > --- a/tools/perf/arch/x86/annotate/instructions.c > > > > +++ b/tools/perf/arch/x86/annotate/instructions.c > > > > @@ -74,12 +74,15 @@ static struct ins x86__instructions[] = { > > > > { .name = "movdqa", .ops = &mov_ops, }, > > > > { .name = "movdqu", .ops = &mov_ops, }, > > > > { .name = "movsd", .ops = &mov_ops, }, > > > > - { .name = "movslq", .ops = &mov_ops, }, > > > > { .name = "movss", .ops = &mov_ops, }, > > > > + { .name = "movsb", .ops = &mov_ops, }, > > > > + { .name = "movsw", .ops = &mov_ops, }, > > > > + { .name = "movsl", .ops = &mov_ops, }, > > > > > > In Intel's manual some of these names are "Move Data From String to > > > String" operations, movsb and movsw in particular. These instructions > > > can be used to make simple memcpy loops. Could it be the past omission > > > was deliberate due to the different way the addressing works in the > > > instructions? > > > > I don't know but in terms of instruction parsing, they are the same > > "MOVE" with two operands. I'm not aware of anything in perf with > > the operands of these instructions. So I guess it'd be fine to add > > these instructions even if they have different underlying behaviors. > > I'm pretty sure that 'rep movs[bwlq]' (aka while (cx--) *di++ = *si++) > is likely to be missing the memory argument parameters. > There is also 'fun and games' with one variant - iirc 'rep movsd' > what has been used for 64bit, but got hijacked by one of the SIMD sets. It seems perf annotate don't process the rep prefix yet. So I think there should be no functional change now. Thanks, Namhyung