From patchwork Sun Feb 4 04:11:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 126798 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp924401ljc; Sat, 3 Feb 2018 20:15:01 -0800 (PST) X-Google-Smtp-Source: AH8x2242jKDC0Y0v2HM1LcKfwpfOH++CGYrgdbBoCvajgFSZxkapnyXtZa5H21JF+2rTGsfEnP0s X-Received: by 10.129.46.3 with SMTP id u3mr7262503ywu.481.1517717701350; Sat, 03 Feb 2018 20:15:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517717701; cv=none; d=google.com; s=arc-20160816; b=h1P2lcSRGNRpoOI7RQsSy9cSYZo/jo83jeLUki1GrXoBfimwAKzAer6u+nLax4ku4A WQlymSAx/tqSIn9XWWuWCsSzcuo4cy1bGtyzwRotfPf8JTvIE6EnjIrlyildGBYK/Fcb lsl67xfzT1HE5hlkoUZJG074Ezw37Xd9V//TKjutVGsYpdKsq/etUWB5w9pnmEZJKMh8 Bh532/NNotyJ/ZwsZhuoJ/BAviDbyLUWVU2vo2JIq2awBHJ5O0ZLPJVf1rGpuSG0KZrs pTwRhs5EDUw8KvqoRElTigZ9l3xse19QaqV/6b4xaFuoaSg7Jp9tmVMFCJ6WaJFprzdI DY3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=QefWOD5QoOoi8TNKVFq33z0FgQ9NAGQGNRsIESMBXUI=; b=H/6PyINOkKavBXZICoIPfuWZXiO9SlpwDIDJNrZZNidHvCntt780budgiIpxIOgtlv Oqnvjj/8omM4d5+UVlTAlgee35C2AGux1F3UYpKcIdT3HVxrZoaTpEJZf8OS7UK77KxU wTlu9HUAGT0jlEf4R8rqq2isK9fLyRWJ4n5e6C5u/A+8qqHhY0MckwzLH2FwmIG2Hy3e S40f3uuvNVbr29NtKj6wVU4I5pTPMD4J1lzfADw7Wjh64toL/7XjBg6XeKrGJu4bHndJ q178I1//Z3Rj4UeJ60SbAngs2e/76/bhvk5hWBD88Pp1haDvF+3Plo8CnA70Rr4l8Skm QRKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Dnkndd4U; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 205si1020475yws.342.2018.02.03.20.15.01 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 03 Feb 2018 20:15:01 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Dnkndd4U; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:58257 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eiBhk-0007Ez-Nr for patch@linaro.org; Sat, 03 Feb 2018 23:15:00 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47299) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eiBei-0004Yg-Ai for qemu-devel@nongnu.org; Sat, 03 Feb 2018 23:11:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eiBeh-0004rx-HZ for qemu-devel@nongnu.org; Sat, 03 Feb 2018 23:11:52 -0500 Received: from mail-pg0-x242.google.com ([2607:f8b0:400e:c05::242]:41094) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eiBeh-0004rh-B1 for qemu-devel@nongnu.org; Sat, 03 Feb 2018 23:11:51 -0500 Received: by mail-pg0-x242.google.com with SMTP id 141so5380855pgd.8 for ; Sat, 03 Feb 2018 20:11:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QefWOD5QoOoi8TNKVFq33z0FgQ9NAGQGNRsIESMBXUI=; b=Dnkndd4U7LBnRXqPrBfAT+gmeWe5sH1LBgTVxyAe7pjqD5tKaiTfR/AhHTu9BjQCZo obcllywv/uBn0NKJRPzTZQ+DfH6hEyTeiU2BJ/CxrW2aXaf2HUI63Y7cb9oEjvpTzBxq Q2m/Ov5H2nmMFDUUrmk+u0JikrThhkeV/cxR4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QefWOD5QoOoi8TNKVFq33z0FgQ9NAGQGNRsIESMBXUI=; b=QRkk22xWkL9v2BJqjiTsqPGXQqgl8A9R+GTumGKBrXu13ppU/E0cf1VInPnhYyFYGQ RDh5p73e+HWe6OMIWzKd4EvPNIJXxA5f1dQ7Vhf5TpAq4rzsu03dWOZodvActz4g/qZU WSdQMjRBVHcwgQpgZaAw4pVhzStHPwsLpAOL/4we4gIRSDt6Z3nvGC8LGJfMbpnoEVP5 n8XN06QAGoBFLIAH0JOzTS3JlE/FTcWIXTy6U+qeF8gTaSG///MJIrIxAAW7pDiqA+kB K4rJ1jpMT29BFLLfUA1/Igmjdp1S8KWd/agrEyyyQbywiXHhV/OAcenHVqRWh6YAoL13 XGKw== X-Gm-Message-State: APf1xPBBNlMT2+QsuCNSF0V6YVSJXZmFKn0x5xfFhKxtshCPvbBltwO3 Ea2XfP2PbmCiGW5oQ0RzP5eD9XeQiLY= X-Received: by 10.99.6.201 with SMTP id 192mr1372598pgg.50.1517717510099; Sat, 03 Feb 2018 20:11:50 -0800 (PST) Received: from cloudburst.twiddle.net (174-21-6-47.tukw.qwest.net. [174.21.6.47]) by smtp.gmail.com with ESMTPSA id k3sm1399425pgr.12.2018.02.03.20.11.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 03 Feb 2018 20:11:49 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sat, 3 Feb 2018 20:11:19 -0800 Message-Id: <20180204041136.17525-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180204041136.17525-1-richard.henderson@linaro.org> References: <20180204041136.17525-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::242 Subject: [Qemu-devel] [PATCH 07/24] include/fpu/softfloat: implement float16_set_sign helper X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, cota@braap.org, alex.bennee@linaro.org, hsp.cat7@gmail.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Alex Bennée Signed-off-by: Alex Bennée Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- include/fpu/softfloat.h | 5 +++++ 1 file changed, 5 insertions(+) -- 2.14.3 diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h index f75aa59100..59c06ef192 100644 --- a/include/fpu/softfloat.h +++ b/include/fpu/softfloat.h @@ -281,6 +281,11 @@ static inline float16 float16_chs(float16 a) return make_float16(float16_val(a) ^ 0x8000); } +static inline float16 float16_set_sign(float16 a, int sign) +{ + return make_float16((float16_val(a) & 0x7fff) | (sign << 15)); +} + /*---------------------------------------------------------------------------- | The pattern for a default generated half-precision NaN. *----------------------------------------------------------------------------*/