adtools icon indicating copy to clipboard operation
adtools copied to clipboard

GCC returns "Unrecognized opcode"-errors when compiling for the e5500 CPU architecture

Open JosteinAarb opened this issue 7 years ago • 2 comments

As the cpu architecture of my X5000 (e5500) supports CPU instructions like ISEL, which will be beneficial for the performance, I want to optimize my C-programs to make use of them. When compiling with the following options from CLI:

gcc Test.c -o Test -mcpu=e5500 -O3

...I get the following errors from GCC: Error: unrecognized opcode: isel' Error: unrecognized opcode: cmpd' Error: unrecognized opcode: cmpdi' Error: unrecognized opcode: mulld' Error: unrecognized opcode: cmpd' Error: unrecognized opcode: cmpd' Error: unrecognized opcode: std' Error: unrecognized opcode: ld' Error: unrecognized opcode: `std'

It seems the e5500 cpu option is intended to work from both GCC & AS (according to their --help options). GCC creates all the assembly instructions as it should (seems ok). But when GCC is compiling the assembly instructions, the errors occur. I used GCC's standard mechanism to see the assembly source code (isel is in there):

gcc -S Test.c -o Test.s -mcpu=e5500 -O3

..then, I tested whether the "as" command is able to compile it. With the "-me5500" option it did. Without the option, I got the same error messages as with GCC. So, I suspect there is a "communication issue" of some kind between the steps where GCC passes the assembled source code over to the compiler, so the compiler doesn't know know that specific CPU options are required.

as Test.s -me5500 as Test.s

My system: AmigaOne X5000/20 computer running AmigaOS 4.1. gcc (adtools build 8.1.0) 8.1.0

JosteinAarb avatar Nov 10 '18 15:11 JosteinAarb

Am 2018-11-10 16:32, schrieb JosteinAarb:

As the cpu architecture of my X5000 (e5500) supports CPU instructions like ISEL, which will be beneficial for the performance, I want to optimize my C-programs to make use of them. When compiling with the following options from CLI:

gcc Test.c -o Test -mcpu=e5500 -O3

...I get the following errors from GCC: Error: unrecognized opcode: isel' Error: unrecognized opcode: cmpd' Error: unrecognized opcode: cmpdi' Error: unrecognized opcode: mulld' Error: unrecognized opcode: cmpd' Error: unrecognized opcode: cmpd' Error: unrecognized opcode: std' Error: unrecognized opcode: ld' Error: unrecognized opcode: `std'

I think that you can pass -Wa,-me5500 to gcc which then should pass this option to the assembler. I agree however that this should be not necessary if you pass -mcpu=e5500.

sba1 avatar Nov 10 '18 17:11 sba1

bruh

Saginsky avatar Mar 09 '20 18:03 Saginsky