Assembler complains about use of $at after ".set noat" on sd
instr
Rohit J
mipsjunkie at gmail.com
Fri Oct 21 21:56:03 UTC 2011
>> 2. Why does it complain about ld instr so far up in the file away from
>> 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=>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 routines,
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 multiplication
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 <jmallett at freebsd.org> wrote:
> On Thu, Oct 20, 2011 at 23:38, Rohit J <mipsjunkie at gmail.com> 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
>>
>> sd k0, mpl(sp)
>>
>> which on make gives an error that says :
>>
>> Assembler 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
>> .set noat
>>
>> Silly Questions
>> 1. Why does sd instruction (store double word) end up using at ?
>> I checked the particular manual (Cavium Octeon H/w reference Manual)
>> and didn’t 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. Try running just the C preprocessor and looking at the
> resulting assembly to see what's not being resolved properly.
>
>> 2. Why 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? I suspect you're missing an include
> or something. Did you change that line? Are 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?
>
More information about the freebsd-mips
mailing list