Inline Assembly Problem

Carlos Bruno Silva cbsilva at student.dei.uc.pt
Tue Aug 24 17:50:27 UTC 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Hi, I want to do a XOR of my FPU registers,but I have a problem.
If I don't use the value, it compiles perfectly.
If I print the value, the Inline Assembly gives many errors at 
compilation.

The code is something like this:

float xor_reg3;

__asm__ ("fxor %%f0, %%f1, %%f30;
         fxor %%f30, %%f2, %%f30;
         fxor %%f30, %%f3, %%f30;
         fxor %%f30, %%f4, %%f30;
         fxor %%f30, %%f5, %%f30;
         fxor %%f30, %%f6, %%f30;
         fxor %%f30, %%f7, %%f30;
         fxor %%f30, %%f8, %%f30;
         fxor %%f30, %%f9, %%f30;
         fxor %%f30, %%f10, %%f30;
         fxor %%f30, %%f11, %%f30;
         fxor %%f30, %%f12, %%f30;
         fxor %%f30, %%f13, %%f30;
         fxor %%f30, %%f14, %%f30;
         fxor %%f30, %%f15, %%f30;
         fxor %%f30, %%f16, %%f30;
         fxor %%f30, %%f17, %%f30;
         fxor %%f30, %%f18, %%f30;
         fxor %%f30, %%f19, %%f30;
         fxor %%f30, %%f20, %%f30;
         fxor %%f30, %%f21, %%f30;
         fxor %%f30, %%f22, %%f30;
         fxor %%f30, %%f23, %%f30;
         fxor %%f30, %%f24, %%f30;
         fxor %%f30, %%f25, %%f30;
         fxor %%f30, %%f26, %%f30;
         fxor %%f30, %%f27, %%f30;
         fxor %%f30, %%f28, %%f30;
         fxor %%f30, %%f29, %%f30;
         fxor %%f30, %%f31, %0" :"=f" (xor_reg3));

INFO("XOR_FLOAT: %f \n",xor_reg3);


If I comment the INFO line, it compiles perfectly.
Otherwise, the compiler gives this output:

{standard input}: Assembler messages:
{standard input}:1028: Error: Illegal operands
{standard input}:1029: Error: Architecture mismatch on "fxor".
{standard input}:1029:  (Requires v9a|v9b; requested architecture is 
sparclite.)
{standard input}:1030: Error: Illegal operands
{standard input}:1031: Error: Architecture mismatch on "fxor".
{standard input}:1031:  (Requires v9a|v9b; requested architecture is 
sparclite.)
{standard input}:1032: Error: Illegal operands
{standard input}:1033: Error: Architecture mismatch on "fxor".
{standard input}:1033:  (Requires v9a|v9b; requested architecture is 
sparclite.)
{standard input}:1034: Error: Illegal operands
{standard input}:1035: Error: Architecture mismatch on "fxor".
{standard input}:1035:  (Requires v9a|v9b; requested architecture is 
sparclite.)

(...) it continues like this....


The strange thing is that if I don't print the value xor_reg3, it compiles 
without any errors!!

Any sugestions?

Carlos S.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Made with pgp4pine 1.76

iD8DBQFBK3/82t8CVjAJenYRAhbFAKCVdMtnhCrIBeqYc7JFbq7Y3I4MFwCglp/u
6J1SlP8eay2/C2z8iKzPxms=
=PQwG
-----END PGP SIGNATURE-----




More information about the users mailing list