From patchwork Sun May 26 19:36:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 799077 Delivered-To: patch@linaro.org Received: by 2002:a5d:6a47:0:b0:354:fb4b:99cd with SMTP id t7csp1594563wrw; Sun, 26 May 2024 12:37:29 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVy1v7xNA6XBbhQaS0jubm40eYx02qRwTIm/5OIaOrEDUWirHGrRohIj96SCed5xfq/y3JINbscHJG0qH9JrwXS X-Google-Smtp-Source: AGHT+IG6SAUDU0mykk1Jpsm6VcEgAJoXb6N/40SXReQXwIKNEWzqxV6S4lHivNw/7eZeTkLBkRkV X-Received: by 2002:a05:6214:3bca:b0:6ad:75ac:ae8a with SMTP id 6a1803df08f44-6ad75acaf05mr31325086d6.20.1716752249086; Sun, 26 May 2024 12:37:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716752249; cv=none; d=google.com; s=arc-20160816; b=0rZ8ZUmDH623bl+iAcW1Co6Bf9ZIBubwt3mE8p2zxId480UeCDffMGdl7tpE73HwBr /R99ZKPrcj0CknoNzvVP7wyLplD58VKIWW8Pw/WW8Mvof/SNCkZTGNJrSWyV8UMJRSUA fAbYMCek81FmMGTvoVLdqjDg1gkOJOdoYAY3OkoDFGyvLCubns/aQKl3WSblvBha5tE6 UvTRsvD0s21wjsDEz/zqcjnan7Ol474wZWC7tdpFapNRYWd++rb3cfCo+e+2Rzr4I5ud fbvDYXP37IcwYhw4PbGnPIzd1yt9m8FET0OBFPiZqCKuvaTODSCrvGIWGk8IWl71hp/W Sf5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=ZA42/hNYVPC57TtkdZ/JbMJ+HoEJ+TWNqQHDSStfx9s=; fh=TYrED6TOMxGX0VC4GtjviASLbYyJe19+7/tKWjN44KQ=; b=Cz5E88T4mpDjY9ID2Nee4k6s2hRqg3KqnztG8eQAS6s85hN35Gim9ejm7R8N7c+UtB sYGqa0U45WJb2gH3++NfQew4N3yaKYrJh+HkDV5kPBoB7d/gSs1jIsqDj6J/RIMkH+AT oMfiMj4pbmTL2fzVWa2G4fquxqy527GVcbZI0W1aF8Tfl5won9x1lQjuGeRU0WmMqHZK rIpVn5cl3A4ucloBPFMjRK6xOSW4YSwZzBrEFbobtnat1XViZEQ9+D+Eyf61Ju2BXlvQ e9MuL7cLlFymlW6cNGw/WzxQqgw+AKYaSRq5vTnKRBQJ1kLVRJ5ZUFCKvYnECV1LAUpS SbWQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uTHAI+Jg; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6ac0707f9f9si66563446d6.161.2024.05.26.12.37.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 26 May 2024 12:37:29 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uTHAI+Jg; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sBJfg-0007yd-Dl; Sun, 26 May 2024 15:36:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sBJfe-0007yB-Ie for qemu-devel@nongnu.org; Sun, 26 May 2024 15:36:42 -0400 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sBJfc-0006TO-Tc for qemu-devel@nongnu.org; Sun, 26 May 2024 15:36:42 -0400 Received: by mail-pj1-x102e.google.com with SMTP id 98e67ed59e1d1-2bf59381a11so2096778a91.1 for ; Sun, 26 May 2024 12:36:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716752199; x=1717356999; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ZA42/hNYVPC57TtkdZ/JbMJ+HoEJ+TWNqQHDSStfx9s=; b=uTHAI+JgIpkkiCZIRFiVvnrrcXcBdqUhI5std+TTY6jRdHQxtuInZgbT5BVUztMp8h gt9QLRdftEM6P/P2b/3oT02qaxk5qk5q3U0XmkLXpf87nxlTM4zjGFkMCu2/HZfDd4nz 5LkoHpcUGiExOhGupc0ZzgjjxVKc0DrXjbQ6JIUs6bKlpZtelYLO8uB6x/wwwETQlg4l 1XAjejqbUeetZHdElTDx9A7T7cYjwPS7g8Iaot/GytAaTzCtZYNjMMuIyHCcWeLH6Jx5 nL6mbsQsUabm5HfQLDnE1rieJ7RvGkso7liv5YRYxHu4gDf2x1f+1Kk2KID2AysRDWbd VH2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716752199; x=1717356999; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ZA42/hNYVPC57TtkdZ/JbMJ+HoEJ+TWNqQHDSStfx9s=; b=Cy1aNeYsugMkXVMLFVTVxGlLE3ojzqE+VRrkPNdoAdalkl9NWzCLG9MfjMWhO1ae0W Rv+amXVL3unZQVDmU9aDKdERQBmZqlXxtrZ/S42uftC2G1VBPZeD6A49r0bF3jb1Zkvc AaQWw0kLa33/9nk9CEQ8UzZ6S7/zfnX3NUqjETdfD9xr673WRq/KaKX1uw8WlPSWC6Ky fueqauhhsonRm1ApeUTHnPK5bqPg6ktriZBxPjqGia+92eJwo5VIFJ76L8mpkF+tVSkH 4nZuylTpdE/EyVBKfF0I5SBTlTi9CCYkNhXWGIEKpqaUedFdFlf4ihAXFo3UUdxx6G9z bQaQ== X-Gm-Message-State: AOJu0YwVllgRQ59ISMNj2FuVDYfx9b9TNLkCJUTexjVPa9pd071tgEeV 7hsMFdrxxbtlKkqGDcHXGErp+PPfXDlInCVBI2Ts933HvFkWz9g/82zrULpyhu5x2xKJA7rZ+/k l X-Received: by 2002:a17:90a:8a0f:b0:2bd:fa57:b360 with SMTP id 98e67ed59e1d1-2bf5f75125bmr5891986a91.49.1716752199119; Sun, 26 May 2024 12:36:39 -0700 (PDT) Received: from stoup.. (174-21-72-5.tukw.qwest.net. [174.21.72.5]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2bf5f6155b6sm4943761a91.29.2024.05.26.12.36.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 May 2024 12:36:38 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk Subject: [PATCH RISU v2 00/13] ELF and Sparc64 support Date: Sun, 26 May 2024 12:36:24 -0700 Message-Id: <20240526193637.459064-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102e; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Let risu accept elf test files, adjusted from v1. Adjust risugen to invoke the assembler and linker, with a cross-compiler prefix if needed. Add some sparc64 testing which utilizes this. Changes for v2: - Implement VIS2 through VIS4. There's something odd going on with the Sparc M8 Solaris host where the values recorded via RISU for some floating-point operations are incorrectly rounded, but performing the same operations with the same inputs in a standalone test program produces correct results. I wonder if there's some unfinished_FPop exception being generated and the operating system emulation is producing incorrect results. I'd be much happier if I could test this on Linux... r~ Richard Henderson (13): risu: Allow use of ELF test files Build elf test cases instead of raw binaries Introduce host_context_t risu: Add initial sparc64 support risugen: Be explicit about print destinations risugen: Add sparc64 support contrib/generate_all: Do not rely on ag sparc64: Add a few logical insns sparc64: Add VIS1 instructions sparc64: Add VIS2 and FMAF insns sparc64: Add VIS3 instructions sparc64: Add IMA instructions sparc64: Add VIS4 instructions Makefile | 22 ++- risu.h | 16 +- risu_reginfo_aarch64.h | 2 + risu_reginfo_arm.h | 2 + risu_reginfo_i386.h | 2 + risu_reginfo_loongarch64.h | 3 + risu_reginfo_m68k.h | 2 + risu_reginfo_ppc64.h | 2 + risu_reginfo_s390x.h | 2 + risu_reginfo_sparc64.h | 36 ++++ risu.c | 59 +++++- risu_aarch64.c | 6 +- risu_arm.c | 7 +- risu_i386.c | 7 +- risu_loongarch64.c | 6 +- risu_m68k.c | 6 +- risu_ppc64.c | 6 +- risu_reginfo_loongarch64.c | 3 +- risu_reginfo_sparc64.c | 186 ++++++++++++++++++ risu_s390x.c | 5 +- risu_sparc64.c | 52 +++++ configure | 2 + contrib/generate_all.sh | 4 +- risugen | 10 +- risugen_common.pm | 68 ++++++- risugen_sparc64.pm | 385 +++++++++++++++++++++++++++++++++++++ sparc64.risu | 298 ++++++++++++++++++++++++++++ test.ld | 12 ++ test_aarch64.s | 4 +- test_arm.s | 16 +- test_i386.S | 4 +- test_sparc64.s | 137 +++++++++++++ 32 files changed, 1298 insertions(+), 74 deletions(-) create mode 100644 risu_reginfo_sparc64.h create mode 100644 risu_reginfo_sparc64.c create mode 100644 risu_sparc64.c create mode 100644 risugen_sparc64.pm create mode 100644 sparc64.risu create mode 100644 test.ld create mode 100644 test_sparc64.s