From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16961 invoked by alias); 19 Sep 2006 11:43:51 -0000 Received: (qmail 16953 invoked by uid 22791); 19 Sep 2006 11:43:51 -0000 X-Spam-Check-By: sourceware.org Received: from py-out-1112.google.com (HELO py-out-1112.google.com) (64.233.166.181) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 19 Sep 2006 11:43:47 +0000 Received: by py-out-1112.google.com with SMTP id c63so5332560pyc for ; Tue, 19 Sep 2006 04:43:45 -0700 (PDT) Received: by 10.35.9.15 with SMTP id m15mr25904118pyi; Tue, 19 Sep 2006 04:43:38 -0700 (PDT) Received: by 10.35.45.9 with HTTP; Tue, 19 Sep 2006 04:43:37 -0700 (PDT) Message-ID: <8c7950360609190443n3e48263cg5a3638da76d6dc3b@mail.gmail.com> Date: Tue, 19 Sep 2006 11:43:00 -0000 From: shanevolpe@gmail.com To: gdb@sourceware.org Subject: gdb (ARM processor) casting issues in iwmmxt.c MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-09/txt/msg00100.txt.bz2 All, I tried compiling gdb client for the xscale processor and all works good but for some casting issues in iwmmxt.c Here is what I found: There is casting occurring on the target: (unsigned long) s1 = a * b; I changed all the castings to only cast on the source and not target.. After my modifications everything compiled fine. Below is a patch file with my changes. I'm not sure if there is something I'm missing, I have never seen casting on the target before. Patch: --- gdb-6.3/sim/arm/iwmmxt~old.c 2003-03-27 12:13:33.000000000 -0500 +++ gdb-6.3/sim/arm/iwmmxt.c 2006-09-18 15:26:05.000000000 -0400 @@ -2114,7 +2114,7 @@ s = (signed long) a * (signed long) b; - (signed long long) t += s; + t += (signed long long)s; } else { @@ -2130,7 +2130,7 @@ wR [BITS (12, 15)] = 0; if (BIT (21)) /* Signed. */ - (signed long long) wR[BITS (12, 15)] += (signed long long) t; + wR[BITS (12, 15)] += (signed long long) t; else wR [BITS (12, 15)] += t; @@ -2166,7 +2166,7 @@ b = wRHALF (BITS (0, 3), i * 2); b = EXTEND16 (b); - (signed long) s1 = a * b; + s1 = (signed long)a * (signed long)b; a = wRHALF (BITS (16, 19), i * 2 + 1); a = EXTEND16 (a); @@ -2174,7 +2174,7 @@ b = wRHALF (BITS (0, 3), i * 2 + 1); b = EXTEND16 (b); - (signed long) s2 = a * b; + s2 = (signed long)a * (signed long)b; } else /* Unsigned. */ { @@ -2183,12 +2183,12 @@ a = wRHALF (BITS (16, 19), i * 2); b = wRHALF (BITS ( 0, 3), i * 2); - (unsigned long) s1 = a * b; + s1 = (unsigned long)a *(unsigned long) b; a = wRHALF (BITS (16, 19), i * 2 + 1); b = wRHALF (BITS ( 0, 3), i * 2 + 1); - (signed long) s2 = a * b; + s2 = (signed long)a * (signed long)b; } r |= (ARMdword) ((s1 + s2) & 0xffffffff) << (i ? 32 : 0); -- Registered Linux User: #293401