From owner-freebsd-ppc@FreeBSD.ORG Thu Aug 3 19:30:32 2006 Return-Path: X-Original-To: freebsd-ppc@freebsd.org Delivered-To: freebsd-ppc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3250616A4E0; Thu, 3 Aug 2006 19:30:32 +0000 (UTC) (envelope-from dje@watson.ibm.com) Received: from igw2.watson.ibm.com (igw2.watson.ibm.com [129.34.20.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id 27EE443D8F; Thu, 3 Aug 2006 19:30:00 +0000 (GMT) (envelope-from dje@watson.ibm.com) Received: from sp1n293en1.watson.ibm.com (sp1n293en1.watson.ibm.com [129.34.20.41]) by igw2.watson.ibm.com (8.13.1/8.13.1/8.13.1-2005-04-25 igw) with ESMTP id k73JUdMH012859; Thu, 3 Aug 2006 15:30:43 -0400 Received: from sp1n293en1.watson.ibm.com (localhost [127.0.0.1]) by sp1n293en1.watson.ibm.com (AIX5.2/8.11.6p2/8.11.7/01-14-2004_2) with ESMTP id k73JTsU54764; Thu, 3 Aug 2006 15:29:54 -0400 Received: from mgsmtp00.watson.ibm.com (mgsmtp00.watson.ibm.com [9.2.40.58]) by sp1n293en1.watson.ibm.com (AIX5.2/8.11.6p2/8.11.7/01-14-2004_1) with ESMTP id k73JTr7149388; Thu, 3 Aug 2006 15:29:53 -0400 Received: from makai.watson.ibm.com (makai.watson.ibm.com [9.2.216.144]) by mgsmtp00.watson.ibm.com (8.12.11/8.12.11/2005/09/01) with ESMTP id k73JRIhi020531; Thu, 3 Aug 2006 15:27:18 -0400 Received: from watson.ibm.com (localhost [127.0.0.1]) by makai.watson.ibm.com (AIX5.3/8.11.6p2/8.11.0/03-06-2002) with ESMTP id k73JTq834496; Thu, 3 Aug 2006 15:29:52 -0400 Message-Id: <200608031929.k73JTq834496@makai.watson.ibm.com> To: Peter Grehan In-Reply-To: Message from Peter Grehan of "Thu, 03 Aug 2006 12:10:55 PDT." <44D24A3F.5080407@freebsd.org> References: <44D23F02.9020709@FreeBSD.org> <200608031826.k73IQX835138@makai.watson.ibm.com> <44D2419F.1050100@FreeBSD.org> <44D245E5.4070102@freebsd.org> <44D24772.7080109@FreeBSD.org> <44D24A3F.5080407@freebsd.org> Date: Thu, 03 Aug 2006 15:29:52 -0400 From: David Edelsohn Cc: Maxim Sobolev , freebsd-ppc@freebsd.org Subject: Re: Unaligned 64-bits access on FreeBSD/powerpc X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Aug 2006 19:30:32 -0000 >>>>> Peter Grehan writes: >> atype = "64"; >> for (i = 0; i < 256; i++) { >> apoint = (uint8_t *)&(buf[i]); >> v64 = *(uint64_t *)apoint; >> } Peter> Would you be able to do a disassembly on this ? I suspect gcc is using Peter> floating-point regs to do the 64-bit loads. That does not matter. The OS is suppose to catch the misaligned load and emulate the instruction in a handler. If FreeBSD cannot handle that, then it needs to configure GCC for PowerPC in strict-alignment embedded mode, which is ABI incompatible. If FreeBSD wants to use the standard PPC SVR4 ABI or PPC32 Linux variant, it must support any misaligned load. That is the OS's responsibility, period. David