From patchwork Sat Sep 15 20:28:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Schmidt X-Patchwork-Id: 970277 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-485708-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="xSXfBuJI"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42CP9M3YTPz9sB5 for ; Sun, 16 Sep 2018 06:28:35 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:date:mime-version:content-type :content-transfer-encoding:message-id; q=dns; s=default; b=ZPGnk sw0Y1d7uRrHZWb+SyLKYzfssz+g6IlO4+5xI0sBdS0a4OkzYy35nuZ3+VeRvBzWr /8yrjpr9n07IZGQj2BAJV7TLJH61R4rSNbidgQbY1yDnecgcZn5KQvqldZ/w8C+R rmJM34BwJUuzwkMEQGv14BkoZP3TYw9miPH2l4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:date:mime-version:content-type :content-transfer-encoding:message-id; s=default; bh=m2ipJ/qBc1N mUToIzfhv3pyrusk=; b=xSXfBuJI4BSvnuT9KanU2dlCCvBQ7shE0vAWpIcE90q cUU8qZ5irZbYxhG8Hfr8ydx1FAZzZkZCJj/lqC/TGDw4Fs1bo6GVZ1gTQUKox2Qk xRNDHJOe6QOhKhJnSaz+i6Iegv4N9Z89fO53eAP6F1ygQ6vQeQZ7AFJCHj4NNLVI = Received: (qmail 123200 invoked by alias); 15 Sep 2018 20:28:27 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 123191 invoked by uid 89); 15 Sep 2018 20:28:26 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.8 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=rs6000, Schmidt, schmidt, 10687 X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 15 Sep 2018 20:28:24 +0000 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w8FKOOhc072818 for ; Sat, 15 Sep 2018 16:28:22 -0400 Received: from e11.ny.us.ibm.com (e11.ny.us.ibm.com [129.33.205.201]) by mx0a-001b2d01.pphosted.com with ESMTP id 2mgwyc8txc-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 15 Sep 2018 16:28:22 -0400 Received: from localhost by e11.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 15 Sep 2018 16:28:21 -0400 Received: from b01cxnp22035.gho.pok.ibm.com (9.57.198.25) by e11.ny.us.ibm.com (146.89.104.198) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Sat, 15 Sep 2018 16:28:19 -0400 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w8FKSIxq43647050 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Sat, 15 Sep 2018 20:28:18 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 29311B2065; Sat, 15 Sep 2018 16:26:52 -0400 (EDT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AA698B205F; Sat, 15 Sep 2018 16:26:51 -0400 (EDT) Received: from BigMac.local (unknown [9.85.164.34]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Sat, 15 Sep 2018 16:26:51 -0400 (EDT) To: GCC Patches Cc: Segher Boessenkool , David Edelsohn From: Bill Schmidt Subject: [PATCH, rs6000, committed] Use correct ABI type in mmintrin.h and xmmintrin.h Date: Sat, 15 Sep 2018 15:28:17 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 x-cbid: 18091520-2213-0000-0000-000002EF53B4 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009722; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000266; SDB=6.01088822; UDB=6.00562359; IPR=6.00868833; MB=3.00023319; MTD=3.00000008; XFM=3.00000015; UTC=2018-09-15 20:28:20 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18091520-2214-0000-0000-00005B911B59 Message-Id: <2b5f170a-0fef-274c-de8d-aa7ea1fbe198@linux.ibm.com> Hi, Jinsong Ji reported that these header files are using the non-ABI type __int128_t rather than __int128. This patch from Jinsong corrects this. Bootstrapped and tested on powerpc64le-linux-gnu with no regressions, committed as obvious. Thanks, Bill 2018-09-15 Jinsong Ji Bill Schmidt * config/rs6000/mmintrin.h (_mm_unpackhi_pi8): Change __int128_t to __int128. (_mm_unpacklo_pi8): Likewise. (_mm_add_pi8): Likewise. (_mm_add_pi16): Likewise. (_mm_add_pi32): Likewise. (_mm_sub_pi8): Likewise. (_mm_sub_pi16): Likewise. (_mm_sub_pi32): Likewise. (_mm_cmpgt_pi8): Likewise. (_mm_cmpeq_pi16): Likewise. (_mm_cmpgt_pi16): Likewise. (_mm_cmpeq_pi32): Likewise. (_mm_cmpgt_pi32): Likewise. (_mm_adds_pi8): Likewise. (_mm_adds_pi16): Likewise. (_mm_adds_pu8): Likewise. (_mm_adds_pu16): Likewise. (_mm_subs_pi8): Likewise. (_mm_subs_pi16): Likewise. (_mm_subs_pu8): Likewise. (_mm_subs_pu16): Likewise. (_mm_madd_pi16): Likewise. (_mm_mulhi_pi16): Likewise. (_mm_mullo_pi16): Likewise. (_mm_sll_pi16): Likewise. (_mm_sra_pi16): Likewise. (_mm_srl_pi16): Likewise. (_mm_set1_pi16): Likewise. (_mm_set1_pi8): Likewise. * config/rs6000/xmmintrin.h (_mm_max_pi16): Likewise. (_mm_max_pu8): Likewise. (_mm_min_pi16): Likewise. (_mm_min_pu8): Likewise. Index: gcc/config/rs6000/mmintrin.h =================================================================== --- gcc/config/rs6000/mmintrin.h (revision 264342) +++ gcc/config/rs6000/mmintrin.h (working copy) @@ -236,7 +236,7 @@ _mm_unpackhi_pi8 (__m64 __m1, __m64 __m2) a = (__vector unsigned char)vec_splats (__m1); b = (__vector unsigned char)vec_splats (__m2); c = vec_mergel (a, b); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); #else __m64_union m1, m2, res; @@ -317,7 +317,7 @@ _mm_unpacklo_pi8 (__m64 __m1, __m64 __m2) a = (__vector unsigned char)vec_splats (__m1); b = (__vector unsigned char)vec_splats (__m2); c = vec_mergel (a, b); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 1)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 1)); #else __m64_union m1, m2, res; @@ -398,7 +398,7 @@ _mm_add_pi8 (__m64 __m1, __m64 __m2) a = (__vector signed char)vec_splats (__m1); b = (__vector signed char)vec_splats (__m2); c = vec_add (a, b); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); #else __m64_union m1, m2, res; @@ -434,7 +434,7 @@ _mm_add_pi16 (__m64 __m1, __m64 __m2) a = (__vector signed short)vec_splats (__m1); b = (__vector signed short)vec_splats (__m2); c = vec_add (a, b); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); #else __m64_union m1, m2, res; @@ -466,7 +466,7 @@ _mm_add_pi32 (__m64 __m1, __m64 __m2) a = (__vector signed int)vec_splats (__m1); b = (__vector signed int)vec_splats (__m2); c = vec_add (a, b); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); #else __m64_union m1, m2, res; @@ -496,7 +496,7 @@ _mm_sub_pi8 (__m64 __m1, __m64 __m2) a = (__vector signed char)vec_splats (__m1); b = (__vector signed char)vec_splats (__m2); c = vec_sub (a, b); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); #else __m64_union m1, m2, res; @@ -532,7 +532,7 @@ _mm_sub_pi16 (__m64 __m1, __m64 __m2) a = (__vector signed short)vec_splats (__m1); b = (__vector signed short)vec_splats (__m2); c = vec_sub (a, b); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); #else __m64_union m1, m2, res; @@ -564,7 +564,7 @@ _mm_sub_pi32 (__m64 __m1, __m64 __m2) a = (__vector signed int)vec_splats (__m1); b = (__vector signed int)vec_splats (__m2); c = vec_sub (a, b); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); #else __m64_union m1, m2, res; @@ -754,7 +754,7 @@ _mm_cmpgt_pi8 (__m64 __m1, __m64 __m2) a = (__vector signed char)vec_splats (__m1); b = (__vector signed char)vec_splats (__m2); c = (__vector signed char)vec_cmpgt (a, b); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); #else __m64_union m1, m2, res; @@ -791,7 +791,7 @@ _mm_cmpeq_pi16 (__m64 __m1, __m64 __m2) a = (__vector signed short)vec_splats (__m1); b = (__vector signed short)vec_splats (__m2); c = (__vector signed short)vec_cmpeq (a, b); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); #else __m64_union m1, m2, res; @@ -822,7 +822,7 @@ _mm_cmpgt_pi16 (__m64 __m1, __m64 __m2) a = (__vector signed short)vec_splats (__m1); b = (__vector signed short)vec_splats (__m2); c = (__vector signed short)vec_cmpgt (a, b); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); #else __m64_union m1, m2, res; @@ -855,7 +855,7 @@ _mm_cmpeq_pi32 (__m64 __m1, __m64 __m2) a = (__vector signed int)vec_splats (__m1); b = (__vector signed int)vec_splats (__m2); c = (__vector signed int)vec_cmpeq (a, b); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); #else __m64_union m1, m2, res; @@ -884,7 +884,7 @@ _mm_cmpgt_pi32 (__m64 __m1, __m64 __m2) a = (__vector signed int)vec_splats (__m1); b = (__vector signed int)vec_splats (__m2); c = (__vector signed int)vec_cmpgt (a, b); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); #else __m64_union m1, m2, res; @@ -915,7 +915,7 @@ _mm_adds_pi8 (__m64 __m1, __m64 __m2) a = (__vector signed char)vec_splats (__m1); b = (__vector signed char)vec_splats (__m2); c = vec_adds (a, b); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) @@ -933,7 +933,7 @@ _mm_adds_pi16 (__m64 __m1, __m64 __m2) a = (__vector signed short)vec_splats (__m1); b = (__vector signed short)vec_splats (__m2); c = vec_adds (a, b); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) @@ -951,7 +951,7 @@ _mm_adds_pu8 (__m64 __m1, __m64 __m2) a = (__vector unsigned char)vec_splats (__m1); b = (__vector unsigned char)vec_splats (__m2); c = vec_adds (a, b); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) @@ -970,7 +970,7 @@ _mm_adds_pu16 (__m64 __m1, __m64 __m2) a = (__vector unsigned short)vec_splats (__m1); b = (__vector unsigned short)vec_splats (__m2); c = vec_adds (a, b); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) @@ -989,7 +989,7 @@ _mm_subs_pi8 (__m64 __m1, __m64 __m2) a = (__vector signed char)vec_splats (__m1); b = (__vector signed char)vec_splats (__m2); c = vec_subs (a, b); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) @@ -1008,7 +1008,7 @@ _mm_subs_pi16 (__m64 __m1, __m64 __m2) a = (__vector signed short)vec_splats (__m1); b = (__vector signed short)vec_splats (__m2); c = vec_subs (a, b); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) @@ -1027,7 +1027,7 @@ _mm_subs_pu8 (__m64 __m1, __m64 __m2) a = (__vector unsigned char)vec_splats (__m1); b = (__vector unsigned char)vec_splats (__m2); c = vec_subs (a, b); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) @@ -1046,7 +1046,7 @@ _mm_subs_pu16 (__m64 __m1, __m64 __m2) a = (__vector unsigned short)vec_splats (__m1); b = (__vector unsigned short)vec_splats (__m2); c = vec_subs (a, b); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) @@ -1068,7 +1068,7 @@ _mm_madd_pi16 (__m64 __m1, __m64 __m2) a = (__vector signed short)vec_splats (__m1); b = (__vector signed short)vec_splats (__m2); c = vec_vmsumshm (a, b, zero); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) @@ -1096,7 +1096,7 @@ _mm_mulhi_pi16 (__m64 __m1, __m64 __m2) w1 = vec_vmulosh (a, b); c = (__vector signed short)vec_perm (w0, w1, xform1); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) @@ -1115,7 +1115,7 @@ _mm_mullo_pi16 (__m64 __m1, __m64 __m2) a = (__vector signed short)vec_splats (__m1); b = (__vector signed short)vec_splats (__m2); c = a * b; - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) @@ -1136,7 +1136,7 @@ _mm_sll_pi16 (__m64 __m, __m64 __count) m = (__vector signed short)vec_splats (__m); c = (__vector unsigned short)vec_splats ((unsigned short)__count); r = vec_sl (m, (__vector unsigned short)c); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)r, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)r, 0)); } else return (0); @@ -1205,7 +1205,7 @@ _mm_sra_pi16 (__m64 __m, __m64 __count) m = (__vector signed short)vec_splats (__m); c = (__vector unsigned short)vec_splats ((unsigned short)__count); r = vec_sra (m, (__vector unsigned short)c); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)r, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)r, 0)); } else return (0); @@ -1274,7 +1274,7 @@ _mm_srl_pi16 (__m64 __m, __m64 __count) m = (__vector unsigned short)vec_splats (__m); c = (__vector unsigned short)vec_splats ((unsigned short)__count); r = vec_sr (m, (__vector unsigned short)c); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)r, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)r, 0)); } else return (0); @@ -1417,7 +1417,7 @@ _mm_set1_pi16 (short __w) __vector signed short w; w = (__vector signed short)vec_splats (__w); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)w, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)w, 0)); #else __m64_union res; @@ -1437,7 +1437,7 @@ _mm_set1_pi8 (signed char __b) __vector signed char b; b = (__vector signed char)vec_splats (__b); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)b, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)b, 0)); #else __m64_union res; Index: gcc/config/rs6000/xmmintrin.h =================================================================== --- gcc/config/rs6000/xmmintrin.h (revision 264342) +++ gcc/config/rs6000/xmmintrin.h (working copy) @@ -1421,7 +1421,7 @@ _mm_max_pi16 (__m64 __A, __m64 __B) b = (__vector signed short)vec_splats (__B); c = (__vector __bool short)vec_cmpgt (a, b); r = vec_sel (b, a, c); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)r, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)r, 0)); #else __m64_union m1, m2, res; @@ -1459,7 +1459,7 @@ _mm_max_pu8 (__m64 __A, __m64 __B) b = (__vector unsigned char)vec_splats (__B); c = (__vector __bool char)vec_cmpgt (a, b); r = vec_sel (b, a, c); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)r, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)r, 0)); #else __m64_union m1, m2, res; long i; @@ -1495,7 +1495,7 @@ _mm_min_pi16 (__m64 __A, __m64 __B) b = (__vector signed short)vec_splats (__B); c = (__vector __bool short)vec_cmplt (a, b); r = vec_sel (b, a, c); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)r, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)r, 0)); #else __m64_union m1, m2, res; @@ -1533,7 +1533,7 @@ _mm_min_pu8 (__m64 __A, __m64 __B) b = (__vector unsigned char)vec_splats (__B); c = (__vector __bool char)vec_cmplt (a, b); r = vec_sel (b, a, c); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)r, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)r, 0)); #else __m64_union m1, m2, res; long i;