Thanks for the responses. As there are no mips16e specific functions in my code (yet), for me it makes no sense to use the -mips16e compiler flag. Also, I should have pointed out that I'm using GCC4.3 but don't think that makes much difference. 2 Things I still find hard to understand. One is that even though -mips16e works, I can only find -mips16 (note the missing e) documented in the GCC manuals? The other one is when does one want to use the -mips16e option? For assembly code it's obvious, but for C code? When you think the compiled code might be more efficient using the compact instruction set? The MIPS16e specs clearly mention it's designed to switch between mips32? Thanks Johan -----Original Message----- From: David Daney [mailto:ddaney@xxxxxxxxxxxxxxxxxx] Sent: Friday, 21 May 2010 6:39 a.m. To: Johan Schuld Cc: Ian Lance Taylor; gcc-help@xxxxxxxxxxx Subject: Re: -mips16e and -mips32r2 usage On 05/19/2010 08:16 PM, Ian Lance Taylor wrote: > "Johan Schuld"<Johan.Schuld@xxxxxxxxxxxxxxxxxxxxx> writes: > >> My first post in this group, so I hope it's the correct one. >> I'm using a MIPS32 base processor (4KSd) which also has the MIPS16e extensions. >> >> First of all, some of the default compiler flags I have use the >> -mips16e compiler flag, even though I can only find the -mips16 >> (so without the 'e') flag in the GNU GCC documentation >> online. (http://gcc.gnu.org/onlinedocs/gcc-4.4.4/gcc/MIPS-Options.html#MIPS-Options). I can >> not find any -mips16e specific documentation.) >> >> So for my project, I use both the -mips23r2 and -mips16e >> compiler flags. Some of my files (startup files) contain assembly >> code, and do not get compiled with the above settings (it does not >> recognize 'di' 'sync' and 'ei' as valid opcodes). These opcodes >> exist in the MIPS32r2 instruction set, but not in the MIPS16e >> extensions. >> >> My assumption was that using the -mips16e compiler flag, would >> only enable the use of the mips16e specific extensions, but it seems >> like it will only use the compact instruction set? Can I use >> -mips16e and -mips32r2 simultaneously, or does it force the compiler >> to ONLY use the compact instruction set? > > gcc will generate MIPS16e code if you use the -mips16 option in > combination with the -mips32 or -mips32r2 option. So you should > indeed get MIPS16e code with the options you are using. > > However, you are correct that using -mips16 will cause the compiler to > only use the compact instruction set. There is no way to flip back > and forth in a single source file. Files which contain non-MIPS16e > assembler code must be compiled without the -mips16 option. The GCC-4.5 manual indicates that this may not be the case. The mips16 and nomips16 function attributes appear to allow you to control this on a function by function basis. David Daney