From patchwork Thu Mar 20 10:38:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 26671 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f200.google.com (mail-ie0-f200.google.com [209.85.223.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5515C20143 for ; Thu, 20 Mar 2014 10:38:52 +0000 (UTC) Received: by mail-ie0-f200.google.com with SMTP id lx4sf2371885iec.7 for ; Thu, 20 Mar 2014 03:38:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mime-version:date:message-id :subject:from:to:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe:content-type; bh=kJWSo2hnApcBaogyAGelo2L/3Kp/FrxF6SwxKi6KPAs=; b=khi/UGbMWwbwRFRFwqHGSMmu40PtKFCYHGMaiUgOzMUsSi83zKqN6XrTaukbQYWN5G UikrX2QnNc6Cs8DqpvszKGAx1b3uKOCEQrBXdRcYK/Wqok+2CMeJjnthkViyThA05W+G RWefXmQQas3UcCHa/flngL1qLqSwojadXibNQFWP9FvhXYFRqVztO5sS3wZFTCdooptR 6qu8JJb2z5Xx640ij343BpTVB7XZDmzhrTHoxZiKtChSP6EquPIUotr7oaJRrvb3++CF TE+Fp8rM8NWtp2ybXvdwqpKk4jfymYf5wQUz8S5bxKEOcdHPAjl8+Eq5XEiiKLI2SPEK eUBg== X-Gm-Message-State: ALoCoQnNs3vmai8uvLYV09mNUD9u40F/GDuQPqwRgeDZZThnnILWVGNL8J4MoCiCounHT+0NejMA X-Received: by 10.182.109.200 with SMTP id hu8mr3320651obb.20.1395311931167; Thu, 20 Mar 2014 03:38:51 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.17.3 with SMTP id 3ls208910qgc.83.gmail; Thu, 20 Mar 2014 03:38:51 -0700 (PDT) X-Received: by 10.58.134.101 with SMTP id pj5mr3453543veb.38.1395311931050; Thu, 20 Mar 2014 03:38:51 -0700 (PDT) Received: from mail-ve0-f177.google.com (mail-ve0-f177.google.com [209.85.128.177]) by mx.google.com with ESMTPS id tr5si336924vdc.108.2014.03.20.03.38.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Mar 2014 03:38:51 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.177; Received: by mail-ve0-f177.google.com with SMTP id sa20so670244veb.8 for ; Thu, 20 Mar 2014 03:38:51 -0700 (PDT) X-Received: by 10.221.39.138 with SMTP id tm10mr33753988vcb.7.1395311930974; Thu, 20 Mar 2014 03:38:50 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.78.9 with SMTP id i9csp377081vck; Thu, 20 Mar 2014 03:38:50 -0700 (PDT) X-Received: by 10.236.92.210 with SMTP id j58mr45658322yhf.5.1395311930114; Thu, 20 Mar 2014 03:38:50 -0700 (PDT) Received: from mail-yh0-f48.google.com (mail-yh0-f48.google.com [209.85.213.48]) by mx.google.com with ESMTPS id n58si1550271yhe.202.2014.03.20.03.38.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Mar 2014 03:38:50 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.213.48 is neither permitted nor denied by best guess record for domain of riku.voipio@linaro.org) client-ip=209.85.213.48; Received: by mail-yh0-f48.google.com with SMTP id z6so551129yhz.35 for ; Thu, 20 Mar 2014 03:38:50 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.236.181.4 with SMTP id k4mr9655656yhm.129.1395311929937; Thu, 20 Mar 2014 03:38:49 -0700 (PDT) Received: by 10.170.187.130 with HTTP; Thu, 20 Mar 2014 03:38:49 -0700 (PDT) Date: Thu, 20 Mar 2014 12:38:49 +0200 Message-ID: Subject: Aarch64 support for libev From: Riku Voipio To: libev@lists.schmorp.de, Patch Tracking X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: riku.voipio@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Hi, First part of the patch adds memory fence for aarch64. Strictly, this isn't necessary, as the fallback to __atomic_thread_fence (__ATOMIC_SEQ_CST) would output the same dmb ish instruction. Second part makes sure the ancient arm float format doesn't get used. Originally I added an if defined(__aarch64__) like the rest, but then I thought perhaps reversing the the if else makes sense. old arm float format is so rare, that the default should be native float ordering. By selecting __arm__ and !( list of features known to identify native endian on arm ), we don't need to list all the architectures in world that not mixed-endian. The feature list was picked up from webkit and firefox. Alternative would be to drop all ancient arm float support - anyone still using the abi wouldn't be upgrading to new libev. --- a/ev.c +++ b/ev.c @@ -616,6 +616,8 @@ #define ECB_MEMORY_FENCE_RELEASE __asm__ __volatile__ ("") #elif __powerpc__ || __ppc__ || __powerpc64__ || __ppc64__ #define ECB_MEMORY_FENCE __asm__ __volatile__ ("sync" : : : "memory") + #elif __aarch64__ + #define ECB_MEMORY_FENCE __asm__ __volatile__ ("dmb ish" : : : "memory") #elif defined __ARM_ARCH_6__ || defined __ARM_ARCH_6J__ \ || defined __ARM_ARCH_6K__ || defined __ARM_ARCH_6ZK__ #define ECB_MEMORY_FENCE __asm__ __volatile__ ("mcr p15,0,%0,c7,c10,5" : : "r" (0) : "memory") @@ -1043,22 +1045,14 @@ /* basically, everything uses "ieee pure-endian" floating point numbers */ /* the only noteworthy exception is ancient armle, which uses order 43218765 */ -#if 0 \ - || __i386 || __i386__ \ - || __amd64 || __amd64__ || __x86_64 || __x86_64__ \ - || __powerpc__ || __ppc__ || __powerpc64__ || __ppc64__ \ - || defined __arm__ && defined __ARM_EABI__ \ - || defined __s390__ || defined __s390x__ \ - || defined __mips__ \ - || defined __alpha__ \ - || defined __hppa__ \ - || defined __ia64__ \ - || defined _M_IX86 || defined _M_AMD64 || defined _M_IA64 - #define ECB_STDFP 1 - #include /* for memcpy */ -#else +#if defined(__arm__) && ! (defined(__ARM_EABI__) || defined(__EABI__) \ + || defined(__VFP_FP__) || defined(_WIN32_WCE) || defined(ANDROID)) #define ECB_STDFP 0 #include /* for frexp*, ldexp* */ + #warning "building for ancient arm" +#else + #define ECB_STDFP 1 + #include /* for memcpy */ #endif #ifndef ECB_NO_LIBM