From patchwork Sun Aug 11 06:03:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 818419 Delivered-To: patch@linaro.org Received: by 2002:a5d:5711:0:b0:367:895a:4699 with SMTP id a17csp906355wrv; Sat, 10 Aug 2024 23:04:38 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVpuJ2856NieOneCGMKbUdKeoYbJEzIbhlnP9nJbrUuC1vdbE7YCRMwN6XyyEZa9mNQwLXeHpJBEr9Q8SrPd6QZ X-Google-Smtp-Source: AGHT+IGTX5fKyPYceDwV9iftagSADkkRmyZJjK9q8bDYLEFxSnMoHSJFy37AYTE9S2+8s4Xrf5yQ X-Received: by 2002:a05:6102:b0f:b0:493:bb35:d8f9 with SMTP id ada2fe7eead31-495d83cd358mr7359846137.5.1723356278464; Sat, 10 Aug 2024 23:04:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723356278; cv=none; d=google.com; s=arc-20160816; b=z73ShDXYwBhtLrWu/XeVFnfivjL2IbOVTturGekcQRU7yUxf6Uiqj+KMM3KZOH2yqQ 7OJW1ZT6/lUCkHF8owVAaYePZMAYpJR7O1uJZTW2GjBiqKm2N4Abxy6AJcGVp4eqB0tB 3mWoDe8gMJiuuA7WY9wnYUx/cK2AFOPgkl8qEHYcTwdWm3I9eHaLyzyNWQ/kjjKRnmx0 s3EVXSu3aQeelIDiU8wbybJHaQbXuMz4ClgbbJwZTFEnGh7gJQkmj1GFD8oiC/uljR/i iRtd4Sbjs9wcspZaA2ZEkoNZ6OAcEumq8Qw7XXVhH+MOjD697BFy62mQh2TYZdQK3loM 8sXw== 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=aMh7SrBzyjxfpO4dy9t8zpG2hXG3X/1bwLNhnQIwrfo=; fh=2uesxoqJjyRqtkk3yTfcnBSFtAUtxw8KzQZeBUAogpM=; b=P+FpNfi3VFUDg1R6FrMbGjmdU3rR1LBivDkLUaMPjUFYOb8arnmNbBpwBVbdHIBb0c xj/pdCr4CJN3BHtE3WmPLTB50vZFZ4RndwwxvTRUn1DE8wtQL3kLP9KrLln/rMAW1JQ2 +bmlJwja4VMsYYfmEb75MGbSxnYst3h2DlzKuzPDNOQJrqZVh5yajCpZo+fRJhUYfjyz eG0+7Is8LyPVSobP/U/Pjsyb1j5fu5PeBBz1BtbVzpPMjt5TQxLJwj+XKTGiMM+MTe9x moutjkvPbNmMxVKpRtgZ4DBt1NhLju6Clvv0alcY2WAYQnMaKy5N7DRRnZBz+OZ2Yxif iUwg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HDxv9Sbz; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6bd82e7bf9esi36429746d6.495.2024.08.10.23.04.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Aug 2024 23:04:38 -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=HDxv9Sbz; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sd1fs-0001fQ-Se; Sun, 11 Aug 2024 02:03:28 -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 1sd1fr-0001ew-KF for qemu-devel@nongnu.org; Sun, 11 Aug 2024 02:03:27 -0400 Received: from mail-oi1-x234.google.com ([2607:f8b0:4864:20::234]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sd1fp-0003Je-ON for qemu-devel@nongnu.org; Sun, 11 Aug 2024 02:03:27 -0400 Received: by mail-oi1-x234.google.com with SMTP id 5614622812f47-3db14930a1aso2587634b6e.3 for ; Sat, 10 Aug 2024 23:03:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723356204; x=1723961004; 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=aMh7SrBzyjxfpO4dy9t8zpG2hXG3X/1bwLNhnQIwrfo=; b=HDxv9Sbz521XAq62dKyrWC9OMoAqnQhI7K6Oi2qyGNOHSuY2fLxi1K2P9ZyWENl12K A41+c8+Ip7hh8gWg1lemCeWUYrlCE0duH/7X3C/9aZMv4EVa1QsCUfW22wJImbzx76v6 xFqKIiwMGuhgWDvVWjsGVJT7o3FtEqBeDK1unHBD4lwEa81TsLKC7QP/ZSnYh53byzbr 7J5DYLtJ9zaLLBLdLn5kN2XGkPavKjchF7f40keOPzfj3i62yxzhXQg03y4vZGa9B2B1 NJVEpmooWPb4Pltv2DkDjg5f20BLVkPf6469nBwTPUEridUOKZSsCNamv/cjHZHnufnc GGiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723356204; x=1723961004; 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=aMh7SrBzyjxfpO4dy9t8zpG2hXG3X/1bwLNhnQIwrfo=; b=BsJhK8GxVHb5SzBgZrn3pUEmxvkCUEIj7qLxSPK6xb31t08xYrsjp42VPJ7hsKL7hk /sPadWm+Ak5DkDj5prMsjNiARIQGH41tsNZglu9cbXkb2Je8VE90pWj6y3Qtd/pR/asJ WNkQ3a0NEerUDEFX1qAVWB/lYpRm9HzcuCnxXLsy0fC3qsPu7KVnukoIwqgOU/r4POqK TQCrdzUA5ywgbOAFX3scw4bOvfWCWijI/I3SgUI+XIr6/FPTx1S9ayub0ZrNwfPQ6a88 XX2fl0RpVuH6HSEPX9Uiqpmdn4u5/N8zlExDAEA5M1jDQHP3a7RnmYHYqmrCbBfHm8Rj ZZQQ== X-Gm-Message-State: AOJu0Yz6YjMdHuxBEvYnr2lGwu4Tn7u2GkNWxchaHtZdjUp+dV/UbSTa JF9qGk+bhvf82xYZRUApe5eJed9yT1iG3eMRRhhykU3wdmkzSZyq71TyroRbO8POg2Ca8fRo9q2 X18ECfQ== X-Received: by 2002:a05:6808:f92:b0:3dc:15b9:3319 with SMTP id 5614622812f47-3dc417149d6mr7059573b6e.51.1723356203766; Sat, 10 Aug 2024 23:03:23 -0700 (PDT) Received: from stoup.. ([172.58.106.160]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3dd060b5388sm835591b6e.43.2024.08.10.23.03.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Aug 2024 23:03:23 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: laurent@vivier.eu Subject: [PATCH for-9.2 0/4] target/m68k: Implement fmove.p Date: Sun, 11 Aug 2024 16:03:09 +1000 Message-ID: <20240811060313.730410-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::234; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x234.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 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 Implement packed decimal real conversions. This is perhaps too trivial, as it does not produce correctly rounded results compared to the compiler. I'm not sure how else to implement this without using gmp, which seems a bit heavy-weight. Perhaps we could do better with a compile-time table of powers of 10, rather that the pile of runtime roundings that I use in this patch set. If the host libc supports float128, we could probably leverage scanf to produce properly rounded results, but that ignores other hosts. r~ Richard Henderson (4): target/m68k: Introduce M68K_FEATURE_FPU_PACKED_DECIMAL target/m68k: Implement packed decimal real loads target/m68k: Implement packed decimal real stores tests/tcg/m68k: Add packed decimal tests target/m68k/cpu.h | 2 + target/m68k/helper.h | 3 + target/m68k/cpu.c | 2 + target/m68k/fpu_helper.c | 237 +++++++++++++++++++++++++++++++ target/m68k/translate.c | 49 +++++-- tests/tcg/m68k/packeddecimal-1.c | 45 ++++++ tests/tcg/m68k/packeddecimal-2.c | 42 ++++++ tests/tcg/m68k/Makefile.target | 2 +- 8 files changed, 368 insertions(+), 14 deletions(-) create mode 100644 tests/tcg/m68k/packeddecimal-1.c create mode 100644 tests/tcg/m68k/packeddecimal-2.c