This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: MIPS inline assembly and floating point

George Caragea <> writes:

> I am using a MIPS-variant compiler based on gcc-4.0.2. I am trying to
> use an inline assembly instruction in the code to use a special load
> instruction 'lwbufc1' that our prototype system supports. The syntax
> and semantics of the lwbufc1 are the same as lwc1 (loading from memory
> into a fp register), the only difference is in some caching
> functionality.
> The C code looks like this:
> int i,j;
> float A[100];
> float val,x;
> asm volatile ("lwbufc1 %0, %1" : "=f" (val) : "m" (A[i]));
> x = val * A[j];
> However, when I compile it, the compiler correctly loads the value
> from A[i] into val, but then attempts to convert val from fixed-point
> to floating-point, using  a cvt.s.w instruction.

When I convert your example into something that compiles, I do not see
a cvt.s.w instruction.  This is with the mainline development version
of gcc.  It is possible that some bug has been fixed since gcc 4.0.2,
although I didn't see any obvious change in the compiler after a quick


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]