The 'entry'/retw.n'-instuctions are indeed windowed instructions that seem to be unsupported on our chip: in xtensa-config.h:
#define XCHAL_HAVE_WINDOWED 0
I see all kinds of assembly sources neatly confirming to whatever this define says, either outputting optimized code if it's 1 or reverting to slower stuff if the define is 0. Unfortunately, the file that tells the compiler what to emit while outputting C code doesn't have such neatness:
gcc/config/xtensa/xtensa.c:
if (total_size < (1 << (12+3)))
insn = emit_insn (gen_entry (size_rtx));
else
{
/* Use a8 as a temporary since a0-a7 may be live. */
rtx tmp_reg = gen_rtx_REG (Pmode, A8_REG);
emit_insn (gen_entry (GEN_INT (MIN_FRAME_SIZE)));
emit_move_insn (tmp_reg, GEN_INT (total_size - MIN_FRAME_SIZE));
emit_insn (gen_subsi3 (tmp_reg, stack_pointer_rtx, tmp_reg));
insn = emit_insn (gen_movsi (stack_pointer_rtx, tmp_reg));
}
See that emit_insn (gen_entry (size_rtx))? That basically tells the compiler to directly output an "entry (something)"-instruction. No nice ifdefs for this bit of code with alternatives for non-windowed code (the 'if' you see is just for if the window size exceeds a certain limit).
As far as I can see it, apart from the scripting snafus plaguing crosstool-ng, the fact that buildroot doesn't want to build because of crtwhatever mis-assemblies etc, this is the main problem that's keeping us from compiling anything. I can see in some includes that do #ifdef the XCHAL_HAVE_WINDOWED function that
entry sp, 64
can be replaced by
addi sp, sp, -32
s32i a0, sp, 0
but I have no idea how to integrate that in the code, if I need to do something to keep a0 from clobbering, if the rest of the code will be happy with this and if this is indeed the final problem. EDIT: It's not. Nopping out code generation for these 2 instructions gives me an undefined instruction called 'call8'... I fear the entire windowed function set will have to be replaced if we want this to work.
So, unless someone with detailed gcc/xtensa knowledge can fill me in and/or hack this compiler to work, I fear all we can do is wait for Tensilica.