From patchwork Wed May 15 07:52:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 796896 Delivered-To: patch@linaro.org Received: by 2002:a5d:452e:0:b0:34e:ceec:bfcd with SMTP id j14csp2855448wra; Wed, 15 May 2024 01:00:13 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVvW/5BKhqhpex2Ksg8sX4LywsFRdC2+hyDRlLAYcYimmLRys6m2dQUayDWUZo8tlEWRBGXkrakaHOVCuZN3bo8 X-Google-Smtp-Source: AGHT+IGB14GGGlqu4oMnyYRIbLI2WVESrj4pis0dJl8m6TZg7u5OP6rndNyOisLHtiWvVfys1diP X-Received: by 2002:a05:622a:2288:b0:43d:f37a:dbe4 with SMTP id d75a77b69052e-43dfdb0a0ddmr186572621cf.8.1715760013265; Wed, 15 May 2024 01:00:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1715760013; cv=none; d=google.com; s=arc-20160816; b=lWRoKGOlwf3mSW03FOwiPVEag1LWIRTU3fL+7BhURPEgLCZtH4CXLdGs8xtivEXHO5 KmSN//VDNJ56ckHCZQT3QK33+HvVZrZkdKjOsPLOnXWDYKO81tIszulBHRytVxXxLb9R mQ7K9JIg6MpsTfC4rtHxViSKA6RLZahhP401XTSl9b/64FLqRuTquwmfdg1RHTbTHBtP ixhqT52EOJs3/ImDEByzWcq16G9gJIf6boE55PDT1ejp3UxqdySj91nH1SVoaUlxE5Nc bfHz4icRZZyvUHh6O+ri6MKOptBOLBJmUBbYGqiKprQkEKl3nod3AXRq00tOWp3eRds3 gFtg== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=LFwVHeO0xdQZE4q/p0sWN9ZrSqg0kbbJP7VPGYxlODk=; fh=yIXiVAD5FpZIeFc+c4tpRY/5DBPhgcMqmQf6hSviIlk=; b=smAKyYCCVB6G4hLqo5WL1IzYFCiO1rIx49dSNGAYxQh5l+PJIz0pThGPyrTwcwvHrc ax8bRbxc4fj+QcDdpQkc5qSoKViLnFSN4xZAcd5Cr5WbOP39PDmhGObM78CfuBJHLMci k6f5U48fBvTOClsaxa+by4nKFaW4z3SpZF+Mczv4PWHZARWvw7Ntub+NL7XkNLXnENhd mV4NUA7EGro1pWanpOXu7oTWSfLuOWqOevOhBYaBg63ABasD1bpynPkJ6b9Ivagd/+j4 RdfVt/V8qWKjHEBAehoh5d+RcUoM3VlcsFtpjwwqX/wHIbPZbF6u9rA3DVI3LUsaust3 32pA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XRQJUHcV; 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 d75a77b69052e-43df56ecd5fsi140396301cf.781.2024.05.15.01.00.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 May 2024 01:00:13 -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=XRQJUHcV; 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 1s79Ru-0004QN-Re; Wed, 15 May 2024 03:53:19 -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 1s79Rq-0004Gd-Dp for qemu-devel@nongnu.org; Wed, 15 May 2024 03:53:14 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s79Rl-0001dI-Ul for qemu-devel@nongnu.org; Wed, 15 May 2024 03:53:13 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-420104e5390so38425885e9.1 for ; Wed, 15 May 2024 00:53:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715759586; x=1716364386; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LFwVHeO0xdQZE4q/p0sWN9ZrSqg0kbbJP7VPGYxlODk=; b=XRQJUHcVK4WDZvmB7IUyCpsvozkpcvk8sLigeUhJFdBjepKS3GbVH4CLImPvxLsqSp fcpmETKVP0z3D1ZTRjMz+OPvV+WfABIWwif51FxxjuR1sXGUFO4/qCC5/ex+ICf/Nj0C R7Wh2fftRKhf5n85f4q6XiEMlXJ7iItHMFar/33JdnV9UB/ArsH0IOiAlPqu7El5mfR1 u2mvyf0Ic+XxLBOa2vchx0EIoz9yiG8k6GclGGl5i8OyRu4A9UlJsnJsb4aDakLmqYjZ POchqwsJoGxYwxgGm9y2aD+aq1aE0w3QFJgVlG47ZwT99XcdEHIKA7wQQFuvju7OQqR2 pufQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715759586; x=1716364386; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LFwVHeO0xdQZE4q/p0sWN9ZrSqg0kbbJP7VPGYxlODk=; b=nGjAhUoMF26QDBuKFYtP6PYZlZ1+8MBzIGa3EG8lDGaX4ZDkO9WqLeuxY8IvGvIMXV BB+Cr7on9qfgUa18Ua0Ly8WzuTY4e/+VuwJy7Rakw2JegdoDSQtLeJnVcY2HAe3WpLli lX226T3DUnFvHQFDInqfiINEj2TKRDSuWeNd887rbr+pA3VejV2qvVMag0NWaHuVN983 HqFxNLnXaG/HdnFSbBNzzYN7q7fKAmfLMMrRRIeVdrLcdnx7wsAoA8AknZ2hdLOXcXQO VksNUwQqZ+Mc+oVvEWWCj4dMoiqVvn1S550Tnpo/ov4LQc05C8fBPw9JLXKIoqRFmstE uOKw== X-Gm-Message-State: AOJu0Yw0AJbIkIyisw1W8qYBTcf2gyrrk4To1QU0v3xXaAWs0eOnL4c3 OiRK29YrFV3W5fc1Tg5X44/dL4Ni+/BrrW10HYc4/i8pHAt4BHMbkV9/yip3s4eJH7LB/BDdxYk BSxM= X-Received: by 2002:a05:600c:19c8:b0:417:e60b:91f6 with SMTP id 5b1f17b1804b1-41fea9324d9mr164134675e9.4.1715759586628; Wed, 15 May 2024 00:53:06 -0700 (PDT) Received: from stoup.. ([149.14.240.163]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-41fccee9292sm222611855e9.37.2024.05.15.00.53.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 00:53:06 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: "Edgar E . Iglesias" , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PULL 27/34] target/cris: Use translator_ld* in cris_fetch Date: Wed, 15 May 2024 09:52:40 +0200 Message-Id: <20240515075247.68024-28-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240515075247.68024-1-richard.henderson@linaro.org> References: <20240515075247.68024-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=richard.henderson@linaro.org; helo=mail-wm1-x333.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 Reviewed-by: Edgar E. Iglesias Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/cris/translate.c | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/target/cris/translate.c b/target/cris/translate.c index b5410189d4..bb2d6612ba 100644 --- a/target/cris/translate.c +++ b/target/cris/translate.c @@ -222,37 +222,28 @@ static int sign_extend(unsigned int val, unsigned int width) } static int cris_fetch(CPUCRISState *env, DisasContext *dc, uint32_t addr, - unsigned int size, unsigned int sign) + unsigned int size, bool sign) { int r; switch (size) { case 4: - { - r = cpu_ldl_code(env, addr); + r = translator_ldl(env, &dc->base, addr); break; - } case 2: - { + r = translator_lduw(env, &dc->base, addr); if (sign) { - r = cpu_ldsw_code(env, addr); - } else { - r = cpu_lduw_code(env, addr); + r = (int16_t)r; } break; - } case 1: - { + r = translator_ldub(env, &dc->base, addr); if (sign) { - r = cpu_ldsb_code(env, addr); - } else { - r = cpu_ldub_code(env, addr); + r = (int8_t)r; } break; - } default: - cpu_abort(CPU(dc->cpu), "Invalid fetch size %d\n", size); - break; + g_assert_not_reached(); } return r; } @@ -2868,7 +2859,7 @@ static unsigned int crisv32_decoder(CPUCRISState *env, DisasContext *dc) int i; /* Load a halfword onto the instruction register. */ - dc->ir = cris_fetch(env, dc, dc->pc, 2, 0); + dc->ir = cris_fetch(env, dc, dc->pc, 2, 0); /* Now decode it. */ dc->opcode = EXTRACT_FIELD(dc->ir, 4, 11);