From owner-freebsd-mips@FreeBSD.ORG Fri Oct 21 21:56:03 2011 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D646106566C; Fri, 21 Oct 2011 21:56:03 +0000 (UTC) (envelope-from mipsjunkie@gmail.com) Received: from mail-pz0-f68.google.com (mail-pz0-f68.google.com [209.85.210.68]) by mx1.freebsd.org (Postfix) with ESMTP id D133B8FC17; Fri, 21 Oct 2011 21:56:02 +0000 (UTC) Received: by pzk33 with SMTP id 33so2903933pzk.7 for ; Fri, 21 Oct 2011 14:56:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=SOnr0odqy2Nxvbzawll4p6f2KxIbZ2yxEWrEsKli69c=; b=sdDl6XWnfADUHlGX9J878AVYQyUDogCaS22Xq087brCfeblF2Qo3cMV3yWb1vEE1yw ZXFT9VHqwfM/vZDpph4EYdN6NqTGZJ40EBuVF8fNpKBJlhKETJK0wjOcgZtaXASGypRb pwnNcWWbeEJTLxhucFk1HY2CCS4OMPvhsGUmU= MIME-Version: 1.0 Received: by 10.68.28.200 with SMTP id d8mr31190147pbh.35.1319234162623; Fri, 21 Oct 2011 14:56:02 -0700 (PDT) Received: by 10.142.200.13 with HTTP; Fri, 21 Oct 2011 14:56:02 -0700 (PDT) In-Reply-To: References: Date: Sat, 22 Oct 2011 03:26:02 +0530 Message-ID: From: Rohit J To: Juli Mallett Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Cc: freebsd-mips Subject: Re: Assembler complains about use of $at after ".set noat" on sd instr X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2011 21:56:03 -0000 >> 2. Why does it complain about ld instr so far up in the file away f= rom >> the place new code was inserted? Hi Juli, thanks for taking time to respond and so quickly and nicely. the "ld" error happened because I fat fingered the operand in vi! ;-p (yes i need to smack myself on the head!!) >> octeon_asm.S:440: Error: illegal operands `ld T3,8($7)' which should have referenced the "t3" register (in small case) >> octeon_asm.S:440: Error: illegal operands `ld t3,8($7)' the big picture story is that as a partial fix to using octeon specific very large mult instructions in our freebsd kernel (for crypto related ops), we had initially disabled interrupts=3D>context switches during these large mult ops as the code wasnt saving the mult related registers/info and if it were to context switch in the middle of these multiplication rout= ines, bad things happened. Need to see if there is a better way to do it. am now trying to see if it makes sense to save those registers and remove the disable interrupt constraint for running these large multiplicat= ion instructions. will be adapting the (multiplication context save/restore) in the octeon HRM and will revert if i have any further questions. thanks a ton rohit ps:got all excited to see that some of the files I am working on now have you as the original author/contributor! On Fri, Oct 21, 2011 at 12:43 PM, Juli Mallett wrote= : > On Thu, Oct 20, 2011 at 23:38, Rohit J wrote: >> Hi FreeBSD MIPS Gurus, >> >> Am just starting on MIPS assembly in FreeBSD. >> >> The code that I have was building just fine. >> Then I added an line to a .S file @line# 513 >> >> =A0 =A0 sd =A0k0, mpl(sp) >> >> which on make gives an error that says : >> >> =A0Assembler messages: >> octeon_asm.S:440: Error: illegal operands `ld T3,8($7)' >> octeon_asm.S:513: Error: Macro used $at after ".set noat" >> >> The .S file has a noat directive >> =A0.set noat >> >> Silly Questions >> 1. =A0 =A0 =A0Why does sd instruction (store double word) end up using a= t ? >> I checked the particular manual (Cavium Octeon H/w reference Manual) >> and didn=92t find anything about sd instr using register at. > > Probably you are using a symbol/macro that is not locally defined, and > so assembler assumes it's an external data reference, and tries to > turn sd into a series of instructions using the assembler temporary to > load a linker-resolved address into a register to be used in the sd > instruction. =A0Try running just the C preprocessor and looking at the > resulting assembly to see what's not being resolved properly. > >> 2. =A0 =A0 =A0Why does it complain about ld instr so far up in the file = away from >> the place >> new code was inserted? > > Can you send the source inline? =A0I suspect you're missing an include > or something. =A0Did you change that line? =A0Are you compiling it as it'= s > built on stock FreeBSD, or are you, say, copying the file from the > kernel and then trying to build it in userland? >