From patchwork Tue Oct 24 12:22:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Storsj=C3=B6?= X-Patchwork-Id: 44345 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1b28:b0:15d:8365:d4b8 with SMTP id ch40csp2016502pzb; Tue, 24 Oct 2023 05:23:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEPf1UgYaeOL8sZ88VjOW1lzEvqq2D2xyJzENq4XFaun4RrquWACP1v4a5t9m5H8oJGSfgv X-Received: by 2002:a17:907:724d:b0:9bf:952d:a8ad with SMTP id ds13-20020a170907724d00b009bf952da8admr10207174ejc.5.1698150190772; Tue, 24 Oct 2023 05:23:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698150190; cv=none; d=google.com; s=arc-20160816; b=VBdNdFq+OPo4ZZfw/v35r376/9zvclXxQDtJ7NdQyzbL7yswNNmDmdPL+ROMmhZC1c QzsZeUUQ35kRKIhn2SDjL5nwK0v18UtlHwQtJLzTVHEP3kajhCq5Qh6Kr361FJQPpYyU iTf1JuUlt5KPnisgFHfnAZsqaBW1KsP612wp0+cyhxYYbTWkB3X3C0A9rlSjOPkbHrIq IeLt/3X3heaayUIWB8y8PGWrSKPzww/n7E+U5824HiAEa1pqIMMC6fiekVoLJolRGc99 HGenn5MoesZPVX0vu5UtXasJVlJHxwwXawyoNDHxRqVTVRrwP1bMmLmP6cPPgkByB1Vf 3xnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=5eA9iUCA2o4bp6W54TSXGIEKCAeTdUbeL6LEWNQIjzs=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=uZLdR6MuBmDGRfQb3KHvAyOdKsx4VkVadOiEKZiocVT3BF0zIaYtROUY1ymU+vD96c daz1Y1aG0V92vFNnyO56Rm2eqnWZPznuEjPvc/Rs839wrdfWdyq9WA85Vy7JlIHN3YfW nIRv77qQn2Sov/w72VnSZxcRNNv51fvpHnRJjGqXYQrdI5HaEZZZKQc1uEfUH2BPmAum kHdok+lfnZAxBqMAJk7w7cfm6VIiHwGsZolcnhszI1NjGU6uYIQh3eSkR/88X2Zhha/A rCDhgs257AVUc96BL/22YjUwC4DryEnIFTyvGWYll8kfsHkGhE8+5uQnia/AqFsDoEw7 TDuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@martin-st.20230601.gappssmtp.com header.s=20230601 header.b=Eune5SJB; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id j17-20020a170906279100b009c7695740e9si4573077ejc.393.2023.10.24.05.23.10; Tue, 24 Oct 2023 05:23:10 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@martin-st.20230601.gappssmtp.com header.s=20230601 header.b=Eune5SJB; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 93E6468C5D2; Tue, 24 Oct 2023 15:23:06 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3966C68C5D2 for ; Tue, 24 Oct 2023 15:23:00 +0300 (EEST) Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-5079f9ec8d9so5044775e87.0 for ; Tue, 24 Oct 2023 05:23:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=martin-st.20230601.gappssmtp.com; s=20230601; t=1698150179; x=1698754979; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=onY4n4A9fRa8pxiNER8hGFZkivB2f9J9CyrI/ZuRfUw=; b=Eune5SJBr99Zdhyu1pcQv4jVI/TV8sBanc9Bf1gaPgw6KU9eRBDEFbaQp6FqaYz8aw 0aLl+mqQpaW5yaIAens0f7dhKHIddcIKj8BMwIMZ1qss2huIoKUOUFhZKL0SavWdRZFA tPKP0H7OQaKJgjy62qKWr7c0xk2Jj0ELmz60C6BrhHDZbjZ/3bhKUXRi2OiWdugJIokb AST4gYD50DIP2Osr+0EPf61DWrmzl+33bL8W3tPOSZ1jz7N2udFk6JIV/tV8AJm6CKKP ZftwI2SNFl/rApA4UNFZR5Q62N7LqLAuNAMXC9WiJQcbOchHOAx9GSYcj5s2jWUcG9K2 SB+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698150179; x=1698754979; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=onY4n4A9fRa8pxiNER8hGFZkivB2f9J9CyrI/ZuRfUw=; b=VdMe/OzCcmtIfr6sO56BtigU4YhJgG2OsVtlsJSM3wovq0pafO/qfv8/7913rigaig poqNzJA+w6TYzz8dgFit1LfQkyufxo9QwZ1YLWWaHVZ5yg3oN6A6H/0PLf9QsuROsXCM gw7yyhWCbo2fBh9VldJaYCEuGLQSVi7b52S1oqmSEBHwAwvk9Et8x3LD0EzTR63Iw0ee y8Pq4CCDVdzEZ+F+wVTwA10y53Uciz2NlMw7YMLzkh5jTHIlUNWYd1On7E0EPhDDAqCp P+7mr1YpZIebXWQ7z0j7q9S6DawxMXbLgbAPwuV4mV03eF34lZYhFM8/8Y0NIfgLHBYz sV0w== X-Gm-Message-State: AOJu0YwsilOXBUM5sQiSvs48BfJlXJuzV+hM44AMfGZVg9ueeDFA8MYz 3ZJfPMqgY1XHGF/dUYXV69bDQa7lKSF/NqzsVWrTHA== X-Received: by 2002:a19:501c:0:b0:4f8:6d9d:abe0 with SMTP id e28-20020a19501c000000b004f86d9dabe0mr4566256lfb.33.1698150179233; Tue, 24 Oct 2023 05:22:59 -0700 (PDT) Received: from localhost.localdomain (dsl-tkubng21-58c01c-243.dhcp.inet.fi. [88.192.28.243]) by smtp.gmail.com with ESMTPSA id b5-20020a196445000000b0050307bf2bcbsm2136430lfj.185.2023.10.24.05.22.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 05:22:58 -0700 (PDT) From: =?utf-8?q?Martin_Storsj=C3=B6?= To: ffmpeg-devel@ffmpeg.org Date: Tue, 24 Oct 2023 15:22:57 +0300 Message-Id: <20231024122258.210941-1-martin@martin.st> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/2] aarch64: Simplify the linux runtime cpu detection code X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: Na8vHPTpfdQU Skip doing the whole getauxval(AT_HWCAP) if HWCAP_CPUID isn't defined. --- libavutil/aarch64/cpu.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/libavutil/aarch64/cpu.c b/libavutil/aarch64/cpu.c index bd780e8591..2b50c426bc 100644 --- a/libavutil/aarch64/cpu.c +++ b/libavutil/aarch64/cpu.c @@ -30,11 +30,9 @@ static int detect_flags(void) { int flags = 0; - unsigned long hwcap; - - hwcap = getauxval(AT_HWCAP); #if defined(HWCAP_CPUID) + unsigned long hwcap = getauxval(AT_HWCAP); // We can check for DOTPROD and I8MM using HWCAP_ASIMDDP and // HWCAP2_I8MM too, avoiding to read the CPUID registers (which triggers // a trap, handled by the kernel). However the HWCAP_* defines for these @@ -53,8 +51,6 @@ static int detect_flags(void) if (((tmp >> 52) & 0xf) == 0x1) flags |= AV_CPU_FLAG_I8MM; } -#else - (void)hwcap; #endif return flags; From patchwork Tue Oct 24 12:22:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Storsj=C3=B6?= X-Patchwork-Id: 44346 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1b28:b0:15d:8365:d4b8 with SMTP id ch40csp2016597pzb; Tue, 24 Oct 2023 05:23:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH5rZ7tU3AUOFV1I86yFHAvn+1epGQxbbqpJE2J8Ov9E0FnYUZodDxmIld0iSGLTKMEJFXb X-Received: by 2002:a17:907:9620:b0:9b2:be2f:e31a with SMTP id gb32-20020a170907962000b009b2be2fe31amr12619045ejc.31.1698150201051; Tue, 24 Oct 2023 05:23:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698150201; cv=none; d=google.com; s=arc-20160816; b=keiYUAF22PSJwUZfcvuy/TfEoiF7vrHK40HJLISz0DpIT5RDx6k5MtN7sBRPmoFyMM DXnXXfaZQZTnCOvgxNdY+BFpm07wq0D7lBjzF4RGnEdXIpnl54+xS8eF2cE32FhZe/+c cLNpjxjIcOvj3x8SxyJzW6pn1932kvlvHGuAh5vs/bR12YkFiLhGjZFM8e2VWlmb6SHb 7xzVr9+6I5EYgK2SZp0UK/+leF2g7QrGPhNlFVwe35cqgrlAETSQ0RThuMsfXsTIWtU6 nDdC+QOYNYT+gIY4yu0VxPP9Wszvv1IcGCrpggnxbObKhF79Cg5mTh4PdFB0ysEHvxg5 Xnig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=g6Y57pu0qfMfC0ppaxJVZGjY2McukbjUCSt24yJObvA=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=H3uM/XhU/fK4ZQHiPAQMO0krJzAz9SgmoQhNyvj6/Ywxv/wixeU+FeS41GyCMHZuvD flFeahf95oR03Kj537oTMFNbkDqw8LkQnwtsr1+IIgKFPa/o2eeDUFBfxgjPb0NSDf1m SFcru3R0nJaQgUtvCaNqhCe1pQSrjW5S3TtHfcC/peSfm3dfe/uGZCxRRPnA8Mv18WQ7 u5gB6insce1hnnHCfbrp+1nLQkyCVybBjxR3+tRhhqJqCvBzyns9Mp7xj+C86ur7bW+j pEXwZut3uQU5jYH77zb8BncV/SlSMFzvmMlvRjr9YBzMXrG1mJHhR58n+Z6zTr9ACDVV BUxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@martin-st.20230601.gappssmtp.com header.s=20230601 header.b=QYcWJ5Dp; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id x20-20020a170906135400b009bef6441230si4363672ejb.496.2023.10.24.05.23.20; Tue, 24 Oct 2023 05:23:21 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@martin-st.20230601.gappssmtp.com header.s=20230601 header.b=QYcWJ5Dp; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 98DB568CA2D; Tue, 24 Oct 2023 15:23:07 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7753C68C5D2 for ; Tue, 24 Oct 2023 15:23:00 +0300 (EEST) Received: by mail-lf1-f53.google.com with SMTP id 2adb3069b0e04-507c1936fd5so6138813e87.1 for ; Tue, 24 Oct 2023 05:23:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=martin-st.20230601.gappssmtp.com; s=20230601; t=1698150179; x=1698754979; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=6ngQ7S/VwuJ3JyV7IuNh6PaYQqfruWdfUd8kfaT5JHk=; b=QYcWJ5DpSuuxpxXokOaOgMDhUB6KpFQr+Zodq/KEPFKVqzNnOKv5zKUpZGM6YbLI8+ FzEKyDtypst4ew9qgjxpNyZaExeQb4A2f8xQlBUAFSXi0ULgmCi50OnbACwlF4LFt1AF yMyc9iA8+RVDo53zPRVRkTlopLVbIfMU0ux0O2KsCUJMIgqjUR2Ebjk/Ox2OD6QkPWnh CYAJmwlULNBhWFOUeeGFrIHEUwSNgdFEHyK7tDaO+v3n7U8prIhhHqyrnbbjhVFDXXXW ZPRHLPVIGrsZ3V8tOVnUlviAFLfktobJeOAA8Xyab5HtvHlGARsmX5a1Z4fItVrfg+eK AKVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698150179; x=1698754979; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6ngQ7S/VwuJ3JyV7IuNh6PaYQqfruWdfUd8kfaT5JHk=; b=u9pLHW72FfUJ0osHldMewblUVX5BPdF4sUERfGkrxj2jt+KZG1AdyVn1cg1pmeS0xd vwdXbjjmmGXBWW7AKGtZmqHaGEKKu67bR4dnXiUDnIMwAgar+7lmFikNj2BIkWtuFVLe Gp6iADu0c5AhcyxMZ+vakhOsXJvyfjQ5ji/ZQnXin6d6nzsGKrbPfWOT6Qr2tQn/yKSe GzJNIZYaejO+TW08WfDJtKqnzVeGrJplgzNskmRsToI56wcCzNcuTS2wJ+pA/V+roZoU WKYie+nwy8tNLqjZdbH6MgkdLzixT++s8RCwkPfIugRZiI903RZ9/W5SxPFUDq7eJhbO t4EQ== X-Gm-Message-State: AOJu0YzQIgqY6x6tvLvv+ucEithhNM9nP3hZYV2sKzZSV+u2aWNzlnZP mbF6YzZp3FT6mmPyLX7yClnAfHvCOwwIk/M7FC4bIA== X-Received: by 2002:a05:6512:159:b0:4fe:8ba8:1a8b with SMTP id m25-20020a056512015900b004fe8ba81a8bmr4182377lfo.7.1698150179683; Tue, 24 Oct 2023 05:22:59 -0700 (PDT) Received: from localhost.localdomain (dsl-tkubng21-58c01c-243.dhcp.inet.fi. [88.192.28.243]) by smtp.gmail.com with ESMTPSA id b5-20020a196445000000b0050307bf2bcbsm2136430lfj.185.2023.10.24.05.22.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 05:22:59 -0700 (PDT) From: =?utf-8?q?Martin_Storsj=C3=B6?= To: ffmpeg-devel@ffmpeg.org Date: Tue, 24 Oct 2023 15:22:58 +0300 Message-Id: <20231024122258.210941-2-martin@martin.st> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231024122258.210941-1-martin@martin.st> References: <20231024122258.210941-1-martin@martin.st> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/2] configure: Improve aarch64 feature detection on older, broken Clang versions X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: z/bdJheUSWND Clang versions before 17 (Xcode versions up to and including 15.0) had a very annoying bug in its behaviour of the ".arch" directive in assembly. If the directive only contained a level, such as ".arch armv8.2-a", it did validate the name of the level, but it didn't apply the level to what instructions are allowed. The level was applied if the directive contained an extra feature enabled, such as ".arch armv8.2-a+crc" though. It was also applied on the next ".arch_extension" directive. This bug, combined with the fact that the same versions of Clang didn't support the dotprod/i8mm extension names in either ".arch +" or in ".arch_extension", could lead to unexepcted build failures. As the dotprod/i8mm extensions couldn't be enabled dynamically via the ".arch_extension" directive, someone building ffmpeg could try to enable them by configuring their build with --extra-cflags="-march=armv8.6-a". During configure, we test for support for the i8mm instructions like this: # Built with -march=armv8.6-a .arch armv8.2-a # Has no visible effect here #.arch_extension i8mm # Omitted as the extension name isn't known usdot v0.4s, v0.16b, v0.16b # Successfully assembled as armv8.6-a is the effective level, # and i8mm is enabled implicitly in armv8.6-a. Thus, we would enable assembling those instructions. However if we later check for another extension, such as sve (which those versions of Clang actually do support), we can later run into the following situation when building actual code: # Built with -march=armv8.6-a .arch armv8.2-a # Has no visible effect here #.arch_extension i8mm # Omitted as the extension name isn't known .arch_extension sve # Included as "sve" is as supported extension name # .arch_extension effectively activates the previous .arch directive, # so the effective level is armv8.2-a+sve now. usdot v0.4s, v0.16b, v0.16b # Fails to build the instructions that require i8mm. Despite the # configure check, the unrelated ".arch_extension sve" directive # breaks the functionality of the i8mm feature. This patch avoids this situation: - By adding a dummy feature such as "+crc" on the .arch directive (if supported), we make sure that it does get applied immediately, avoiding it taking effect spuriously at a later unrelated ".arch_extension" directive. - By checking for higher arch levels such as armv8.4-a and armv8.6-a, we can assemble the dotprod and i8mm extensions without the user needing to pass -march=armv8.6-a. This allows using the dotprod/i8mm codepaths via runtime detection while keeping the binary runnable on older versions. I.e. this enables the i8mm codepaths on Apple M2 machines while built with Xcode's Clang. TL;DR: Enable the I8MM extensions for Apple M2 without the user needing to do a custom configuration; avoid potential build breakage if a user does such a custom configuration. Once Xcode versions that have these issues fixed are prevalent, we can consider reverting this change. --- configure | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/configure b/configure index f494da204c..e00fb6b719 100755 --- a/configure +++ b/configure @@ -6045,7 +6045,26 @@ check_inline_asm inline_asm_nonlocal_labels '"Label:\n"' if enabled aarch64; then as_arch_level="armv8-a" check_as as_arch_directive ".arch $as_arch_level" - enabled as_arch_directive && check_arch_level armv8.2-a + if enabled as_arch_directive; then + # Check for higher .arch levels. We only need armv8.2-a in order to + # enable the extensions we want below - we primarily want to control + # them via .arch_extension. However: + # + # Clang before version 17 (Xcode versions up to and including 15.0) + # didn't support controlling the dotprod/i8mm extensions via + # .arch_extension; thus try to enable them via the .arch level as well. + for level in armv8.2-a armv8.4-a armv8.6-a; do + check_arch_level $level + done + # Clang before version 17 (Xcode versions up to and including 15.0) + # also had a bug (https://github.com/llvm/llvm-project/issues/32220) + # causing a plain ".arch " to not have any effect unless it + # had an extra "+" included - but it was activate on the next + # ".arch_extension" directive. Check if we can include "+crc" as dummy + # feature to make the .arch directive behave as expected and take + # effect right away. + check_arch_level "${as_arch_level}+crc" + fi enabled armv8 && check_insn armv8 'prfm pldl1strm, [x0]' # internal assembler in clang 3.3 does not support this instruction