From patchwork Wed May 3 07:21:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 678738 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a41:0:0:0:0:0 with SMTP id v1csp914074wrs; Wed, 3 May 2023 00:40:51 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7wN1UqxWn4grChGdU6P/903hAtU+HpXeaxzO1fawJq4t9WerZKRPW+mdxXxqaEjYY9Qc8u X-Received: by 2002:ad4:5dc2:0:b0:5ef:8b3a:5d7 with SMTP id m2-20020ad45dc2000000b005ef8b3a05d7mr6297131qvh.5.1683099650800; Wed, 03 May 2023 00:40:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683099650; cv=none; d=google.com; s=arc-20160816; b=ke6IIllBIx+xtF6N7uZitUzLHMoM03jZg20JLruapDHjzQDqQCngmhXDTumullIGLi xjdEYjXPoFYyP3AWJ0UkaeMfIi9++jFoFbnfq8jXujfLqE7mHxHYsHMWNmSfIg/AmGKI +uSRQQwtbI/O3ricY9x6YwAMBPdhXSSikXYkHq+zHISCzemJ3c2A3YPitYXlwfc2tzCO /3pPURUFrFk2Cm5D4BqDkYcS1mEMCvUylzMN0vOcqb5JUUcwtLaYszjcxGVWKA75UiVZ Y3FR9gjwKwcubf4d/Bi+Ml2A2rrHb+UMDI7puhH9333suturn/iVFPnHKMdrUeYqVRuX xD8A== 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=lj2D2cXdtATJYKpTPKE6VX0lPTFHJNgX6DGhwMqHkxw=; b=cpxy/2K5o1mkNEMs1LAb5dOTlmW9p7x9NQLvRG+9MqPncIgTGFDsy1+PD386F94XE6 Gt7b7l58IsSkDKiARj+93YkvKLt2CEMxTpHA/JbX7zB0cwItidMT0kjcTW4RzX1o1EHl 8RKdMH6G0lPphqWbghtlx2G1X38WVzAaUBb82nIwDAZoemjVh4yfTmLrYt9qn4jRkC2V +Pyin/yVNHJWB2eDhg4oDMtIk6vOGgNclHvNtuqrs0Kxf/huJ11QzuG8Oj+Q6wW2jBRM PsUr0LkYuq9L9jKxp4HWc82oUcSupnexBmKQCZu6yk9ERBhjDPC95QjzLIMnagLkJv0B Lfsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CiBMUHFH; 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 ke20-20020a056214301400b00604b7e1f5ccsi3774110qvb.279.2023.05.03.00.40.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 May 2023 00:40:50 -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=CiBMUHFH; 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 1pu6pR-0008Oj-Oa; Wed, 03 May 2023 03:23:10 -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 1pu6p2-000727-So for qemu-devel@nongnu.org; Wed, 03 May 2023 03:22:45 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pu6ow-0007JF-Hv for qemu-devel@nongnu.org; Wed, 03 May 2023 03:22:44 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-3f192c23fffso29604085e9.3 for ; Wed, 03 May 2023 00:22:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683098554; x=1685690554; 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=lj2D2cXdtATJYKpTPKE6VX0lPTFHJNgX6DGhwMqHkxw=; b=CiBMUHFHnz5jxmdPfb83Zhqf624LXQZHXN/DfAbz1e/kpmQQygeqy6frhzpQ2CvyLg rWbmdd3PIqDdsusnt0Lo29VsfQt7UrwDvqucGqEBKU3OKIl4Ir6wgGCuGJfb5C3TrLDC DoRnBMMMMAOwG3S2g1AQXNa9Xy3Qhc/6EWT6mexT93ZkQzLMSKehIQapLNS+xElJrite dozt1Mw8g+Epb83SyF9RcFF8ONgibZ4/yczuqYLGj0OtRC1q3iC1rK/QR4QpAkYAWQlS wsnbr9Kz4jziXRRxfIx7610x0edj/nJY4Z1acF26Q9/sFJuQR3nJTjSSRF4ART+qHXWD GPTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683098554; x=1685690554; 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=lj2D2cXdtATJYKpTPKE6VX0lPTFHJNgX6DGhwMqHkxw=; b=MegkqNWtDvR7O+j4UmFMeCxkbmzl7TaWvOJtu12CCiWpybVEIeEUOSNYsULX2/R3sx uQsFzcszzHYRkamKQsSku+GYX8oOGca9VpRHyR5rbbXLNRr2BE2yPa4FoWjZ+XyWVfcM FdyMvy/XQfG1Bak308dE98O8pUU+f+W2aox9CPj0qMLRSxtwuZhtzwNZPWiukXRdm0R3 3WY9jdv9XBzoJTwotJKL4R2T+DDX5MIXN7r5R3BE5zO2LzSczvv3SwFVfdi02rbMwvfg DM+1f7zv1ybCFuMbZeNnZhYcBZJEvsYEagvP+QqE3R3eYcjQ8F/noHrJR9jzU2OFiheI cFpA== X-Gm-Message-State: AC+VfDybFIaWFyTdwaG4SWOtmaNicIoNbEKkWuk1Q9WAdluwWCcmq7GM 67N9OCC9jYaq5fyLRAsS927zTCYRihaSz6vio6ECSw== X-Received: by 2002:a05:600c:228f:b0:3f0:44d1:3ba5 with SMTP id 15-20020a05600c228f00b003f044d13ba5mr13750662wmf.5.1683098554129; Wed, 03 May 2023 00:22:34 -0700 (PDT) Received: from stoup.Home ([2a02:c7c:74db:8d00:c01d:9d74:b630:9087]) by smtp.gmail.com with ESMTPSA id t4-20020a7bc3c4000000b003f1745c7df3sm962789wmj.23.2023.05.03.00.22.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 May 2023 00:22:33 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: ale@rev.ng, philmd@linaro.org, marcel.apfelbaum@gmail.com, wangyanan55@huawei.com, anjo@rev.ng, Juan Quintela Subject: [PULL v2 08/12] migration/xbzrle: Use __attribute__((target)) for avx512 Date: Wed, 3 May 2023 08:21:01 +0100 Message-Id: <20230503072221.1746802-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230503072221.1746802-1-richard.henderson@linaro.org> References: <20230503072221.1746802-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=richard.henderson@linaro.org; helo=mail-wm1-x336.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 Use the attribute, which is supported by clang, instead of the #pragma, which is not supported and, for some reason, also not detected by the meson probe, so we fail by -Werror. Signed-off-by: Richard Henderson Reviewed-by: Juan Quintela Message-Id: <20230501210555.289806-1-richard.henderson@linaro.org> --- meson.build | 5 +---- migration/xbzrle.c | 9 ++++----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/meson.build b/meson.build index c44d05a13f..77d42898c8 100644 --- a/meson.build +++ b/meson.build @@ -2370,12 +2370,9 @@ config_host_data.set('CONFIG_AVX512F_OPT', get_option('avx512f') \ config_host_data.set('CONFIG_AVX512BW_OPT', get_option('avx512bw') \ .require(have_cpuid_h, error_message: 'cpuid.h not available, cannot enable AVX512BW') \ .require(cc.links(''' - #pragma GCC push_options - #pragma GCC target("avx512bw") #include #include - static int bar(void *a) { - + static int __attribute__((target("avx512bw"))) bar(void *a) { __m512i *x = a; __m512i res= _mm512_abs_epi8(*x); return res[1]; diff --git a/migration/xbzrle.c b/migration/xbzrle.c index c6f8b20917..258e4959c9 100644 --- a/migration/xbzrle.c +++ b/migration/xbzrle.c @@ -177,11 +177,11 @@ int xbzrle_decode_buffer(uint8_t *src, int slen, uint8_t *dst, int dlen) } #if defined(CONFIG_AVX512BW_OPT) -#pragma GCC push_options -#pragma GCC target("avx512bw") #include -int xbzrle_encode_buffer_avx512(uint8_t *old_buf, uint8_t *new_buf, int slen, - uint8_t *dst, int dlen) + +int __attribute__((target("avx512bw"))) +xbzrle_encode_buffer_avx512(uint8_t *old_buf, uint8_t *new_buf, int slen, + uint8_t *dst, int dlen) { uint32_t zrun_len = 0, nzrun_len = 0; int d = 0, i = 0, num = 0; @@ -296,5 +296,4 @@ int xbzrle_encode_buffer_avx512(uint8_t *old_buf, uint8_t *new_buf, int slen, } return d; } -#pragma GCC pop_options #endif