AnsweredAssumed Answered

e_cmpwi issue: operand out of range (powerpc-eabivle-4_9)

Question asked by Martin Schröder on Nov 2, 2017
Latest reply on Nov 3, 2017 by Martin Schröder

I am porting some existing (and probably long time working) code for SPC5645C (e200z0, e200z4) from Diab Compiler to S32DS_Power_Win32_v2017.R1_b171019

 

In the startup code I am struggling with the e_cmpwi instruction:

c-source:

MOVE_SYMBOL_ADDRESS_TO_REGISTER(__ROM_COPY_SIZE, r9);

/* Check length of SRAM data in ROM */
ASM2ID(e_cmpwi r9, 0);
/* Exit cfg_ROMCPY if size is zero */
ASM1ID(beq _ram_copy_end);

 

which becomes

366 ???? 7120E000          e_lis 9,__ROM_COPY_SIZE@ha
367 ???? 1D290000          e_add16i 9,9,__ROM_COPY_SIZE@l
368 ???? 1820A800          e_cmpwi 9,0
****  Error: operand out of range (9 is not between 0 and 3)
****  Error: missing operand
369 ???? 4182002C          beq _ram_copy_end

 

In EREF_RM the register value occupies 5 bits of the opcode and I could not find any constraint for register rA to be in the range 0...3. Also there is no "missing operand", so I feel quite confident that this is a bug.

 

Martin

Outcomes