Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
156 user(s) are online (132 user(s) are browsing Forums)

Members: 0
Guests: 156

more...

Support us!

Headlines

 
  Register To Post  

Isel opcode unrecognized opcode?
Home away from home
Home away from home


See User information
tying to compile a small test.

using

GCC -mpowerpc -misel test.c

GCC knows -misel, but if I add ISEL to inline asm code, it does not work.

Also tried.

GCC -misel=yes test.c

but -misel=yes is reported as none supported, so -misel should work, I think.


FSEL works, but there are some issues, you can't move from GPR to FR, whit out storing into memory and loading from memory.

and there is no bit operations like "AND" oppcode for float registers, so it looks like I have do part of what I'm trying to do whit integer and the other part whit float, that sucks.


Edited by LiveForIt on 2013/11/20 2:20:11
Edited by LiveForIt on 2013/11/20 11:32:21
(NutsAboutAmiga)

Basilisk II for AmigaOS4
AmigaInputAnywhere
Excalibur
and other tools and apps.
Go to top
Re: Isel opcode unrecognized opcode?
Not too shy to talk
Not too shy to talk


See User information
@LiveForIt

Looking at the GCC doc online, I see:

Quote:

-misel
-mno-isel
This switch enables or disables the generation of ISEL instructions.
-misel=yes/no
This switch has been deprecated. Use -misel and -mno-isel instead.


So this option is about generation of the instruction. You certainly have to choose a CPU that supports the instruction.

Note that currently, we have no platform that supports this instruction.

To compile with the inline isel instruction, try something like:
gcc -mcpu=e500mc -o isel isel.c
or on recent compilers:
gcc -mtune=e500mc -o isel isel.c

Note that if you do that on AmigaOS, that will crash with an undefined instruction on our machines.

And to target the e5500 core, if the compiler does not support it, you will tune for e500mc, what could be worse than not use isel instruction.

But that's always very good to experiment !


Edited by corto on 2013/11/20 9:14:37
Edited by corto on 2013/11/20 9:31:15
Go to top
Re: Isel opcode unrecognized opcode?
Home away from home
Home away from home


See User information
@corto

Thanks, but I have also problem converting word into float.

any idea?

(NutsAboutAmiga)

Basilisk II for AmigaOS4
AmigaInputAnywhere
Excalibur
and other tools and apps.
Go to top
Re: Isel opcode unrecognized opcode?
Not too shy to talk
Not too shy to talk


See User information
As you said in your first post, you can't move directly a GPR into a FPR. The integer value must be saved in memory and then loaded into a FPR with instruction lfiwax (Load Floating-Point as Integer Word Algebraic Indexed).

For the reversed operation, a short C test with the generated asm code shew that there is a conversion:
fctiwz 0,30
before saving the register:
stfiwx 0,0,9
But this part should be investigated more. I am not very comfortable with FP instruction set.

Go to top
Re: Isel opcode unrecognized opcode?
Home away from home
Home away from home


See User information
@corto

http://wiird.l0nk.org/forum/index.php ... on=printpage;topic=6593.0

save value into int var

i = 10;

// save value 10 into var
 
1000270:       38 00 00 0a     li      r0,10
 1000274
:       90 1f 00 18     stw     r0,24(r31)


cast int var into float var.

f = (float) i;

// load int from memory 
 
1000278:       80 1f 00 18     lwz     r0,24(r31)
// first half of the converted double
 
100027c:       3d 60 43 30     lis     r11,17200
// r9 = ?????
 
1000280:       3d 20 01 00     lis     r9,256
// find some tmp address to save into.
 
1000284:       c9 a9 10 28     lfd     f13,4136(r9)
// convert number to 0x8???????
 
1000288:       6c 00 80 00     xoris   r0,r0,32768
// store first half
 
100028c:       90 1f 00 2c     stw     r0,44(r31)
// store second half
 
1000290:       91 7f 00 28     stw     r11,40(r31)
// load float as double
 
1000294:       c8 1f 00 28     lfd     f0,40(r31)
// removed the magic float number
 
1000298:       fc 00 68 28     fsub    f0,f0,f13
// ????
 
100029c:       fc 00 00 18     frsp    f0,f0
// store new float
 
10002a0:       d0 1f 00 08     stfs    f0,8(r31)


I think we can say that casting between float and int is sloooow.


Edited by LiveForIt on 2013/11/22 22:32:16
Edited by LiveForIt on 2013/11/22 22:36:58
Edited by LiveForIt on 2013/11/22 22:38:35
Edited by LiveForIt on 2013/11/22 22:50:13
(NutsAboutAmiga)

Basilisk II for AmigaOS4
AmigaInputAnywhere
Excalibur
and other tools and apps.
Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 2 ( 0 members and 2 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project