background image

 

To our customers, 

 

Old Company Name in Catalogs and Other Documents 

 

On April 1

st

, 2010, NEC Electronics Corporation merged with Renesas Technology 

Corporation, and Renesas 

Electronics Corporation 

took over all the business of both 

companies. 

Therefore, although the old company name remains in this document, it is a valid 

Renesas 

Electronics document. We appreciate your understanding. 

 

Renesas Electronics website: 

http://www.renesas.com

 

 
 
 
 

April 1

st

, 2010 

Renesas Electronics Corporation 

 

 
 
 
 

Issued by: 

Renesas Electronics Corporation

 (

http://www.renesas.com

Send any inquiries to 

http://www.renesas.com/inquiry

 

Содержание M32R-FPU

Страница 1: ...ok over all the business of both companies Therefore although the old company name remains in this document it is a valid Renesas Electronics document We appreciate your understanding Renesas Electron...

Страница 2: ...t for an application categorized as Specific or for which the product is not intended where you have failed to obtain the prior written consent of Renesas Electronics The quality grade of each Renesas...

Страница 3: ...roducts and product specifications represents information on the product at the time of publication and is subject to change by Renesas Electronics Corp without notice Please review the latest informa...

Страница 4: ...here may contain technical inaccuracies or typographical errors Renesas Technology Corporation assumes no responsibility for any damage liability or other loss rising from these inaccuracies or error...

Страница 5: ...ted BTST instruction APPENDICES 3 Appendix Figure 3 1 1 corrected Incorrect The E1 stage of the FDIV instruction requires 13 cycles Correct The E1 stage of the FDIV instruction requires 14 cycles Appe...

Страница 6: ...nt Status Register FPSR CR7 1 6 1 3 6 Floating Point Exceptions FPE 1 8 1 4 Accumulator 1 11 1 5 Program counter 1 11 1 6 Data format 1 12 1 6 1 Data type 1 12 1 6 2 Data format 1 13 1 7 Addressing mo...

Страница 7: ...ppendix 5 IEEE754 Specification Overview Appendix 18 Appendix 5 1 Floating Point Formats Appendix 18 Appendix 5 2 Rounding Appendix 20 Appendix 5 3 Exceptions Appendix 20 Appendix 6 M32R FPU Specifica...

Страница 8: ...M32R FPU Software Manual Rev 1 01 This page left blank intentionally...

Страница 9: ...CHAPTER 1 CPU PROGRAMMIING MODEL 1 1 CPU Register 1 2 General purpose Registers 1 3 Control Registers 1 4 Accumulator 1 5 Program Counter 1 6 Data Format 1 7 Addressing Mode...

Страница 10: ...r calculations floating point operations etc R14 is used as the link register and R15 as the stack pointer The link register is used to store the return address when executing a subroutine call instru...

Страница 11: ...these control registers In addition the SM bit IE bit and C bit of the PSW can also be set by the SETPSW instruction or the CLRPSW instruction Figure 1 3 1 Control Registers Backup PC Floating point...

Страница 12: ...b0 0 0 0 0 0 0 0 0 0 0 0 0 0 BC SM IE C 23 24 25 26 27 28 29 30 b31 17 18 19 20 21 22 b16 BIE BSM BPSW field 0 0 PSW field At reset release B 0000 0000 0000 0000 00 000 0000 0000 b Bit Name Function...

Страница 13: ...he address of the current stack pointer These registers can be accessed as the general purpose register R15 R15 switches between representing the SPI and SPU depending on the value of the Stack Mode S...

Страница 14: ...FV Set to 1 when an invalid operation exception R W Invalid Operation Exception occurs if EIT processing is unexecuted Note 1 Flag Once set the flag retains the value 1 until it is cleared to 0 in so...

Страница 15: ...3 Zero Divide Exception 1 A zero divide exception occurred Cause Bit When the bit is set to 1 the execution of an FPU operation instruction will clear it to 0 28 CO 0 No overflow exception occurred R...

Страница 16: ...finity MAX infinity infinity infinity MAX No change 0 MAX MAX Nearest infinity infinity Note 1 When the Overflow Exception Enable EO bit FPSR register bit 20 0 Note 2 When the Overflow Exception Enabl...

Страница 17: ...register bit 17 0 Note 2 When the Inexact Exception Enable EX bit FPSR register bit 17 1 4 Zero Division Exception DIV0 The exception occurs when a finite nonzero value is divided by zero The followin...

Страница 18: ...ister bit 21 0 Note 2 When the Invalid Operation Exception Enable EV bit FPSR register bit 21 1 Notes NaN Not a Number SNaN Signaling NaN a NaN in which the MSB of the decimal fraction is 0 When SNaN...

Страница 19: ...32 63 respectively Use the MVFACHI MVFACLO and MVFACMI instructions for reading data from the accumulator The MVFACHI MVFACLO and MVFACMI instructions read data from the high order 32 bits bits 0 31 t...

Страница 20: ...e signed integers are represented by 2 s complements CPU PROGRAMMING MODEL 1 6 Data Format b7 b0 signed byte 8 bit integer unsigned byte 8 bit integer signed halfword 16 bit integer b0 b0 b0 b0 b0 b7...

Страница 21: ...6 bit data on the LSB side and the 8 bit data on the LSB side of the register are stored into memory by the ST STH and STB instructions respectively Rn b0 b31 load byte Rn b0 b31 halfword Rn b0 b31 wo...

Страница 22: ...ligned with a halfword boundary least significant address bit 0 or a word boundary two low order address bits 00 respectively If an attempt is made to access memory data that overlaps the halfword or...

Страница 23: ...he register contents Can only be specified with LD instruction Add 2 to register contents R M32R FPU extended addressing mode The contents of the register specify the memory address then 2 is added to...

Страница 24: ...1 1 16 M32R FPU Software Manual Rev 1 01 CPU PROGRAMMING MODEL 1 7 Addressing Mode This page left blank intentionally...

Страница 25: ...CHAPTER 2 INSTRUCTION SET 2 1 Instruction set overview 2 2 Instruction format...

Страница 26: ...structions M32R CPU supports compound instructions such as load address update and store address update which are useful for high speed data transfer 2 1 1 Load store instructions The load store instr...

Страница 27: ...egister specify the memory address then 2 is added to the register contents Can only be specified with STH instruction Add 4 to register contents R The contents of the register is added by 4 the regis...

Страница 28: ...ation instructions Compare arithmetic logic operation multiply and divide and shift are carried out between registers compare instructions CMP Compare CMPI Compare immediate CMPU Compare unsigned CMPU...

Страница 29: ...VU Divide unsigned MUL Multiply REM Remainder REMU Remainder unsigned shift instructions SLL Shift left logical SLL3 Shift left logical 3 operand SLLI Shift left logical immediate SRA Shift right arit...

Страница 30: ...ater than or equal to zero BGTZ Branch on greater than zero BL Branch and link BLEZ Branch on less than or equal to zero BLTZ Branch on less than zero BNC Branch on not C bit BNE Branch on not equal t...

Страница 31: ...ample refer to Figure 2 1 1 When instruction A or B is a branch instruction branching to instruction G the immediate value of either instruction A or B becomes 4 Simultaneous with execution of branchi...

Страница 32: ...ator and a general purpose register MACHI Multiply accumulate high order halfwords MACLO Multiply accumulate low order halfwords MACWHI Multiply accumulate word and high order halfword MACWLO Multiply...

Страница 33: ...ction MULWHI instruction Rsrc2 32 bits Rsrc1 0 15 16 31 H L 0 15 16 31 H L x x MACLO instruction MACHI instruction Rsrc2 ACC 0 63 0 63 Rsrc1 0 31 32 bits 0 15 16 31 H L x x MACWLO instruction MACWHI i...

Страница 34: ...essed in two steps Refer to Chapter 3 for details Fig 2 1 4 DSP function instruction operation 3 transfer between accumulator and register Rdest 0 31 ACC 0 63 15 16 31 32 47 48 MVFACHI instruction Rsr...

Страница 35: ...ing point divede FMADD Floating point multiply and add FMSUB Floating point multiply and subtract ITOF Integer to float UTOF Unsigned integer to float FTOI Float to integer FTOS Float to short FCMP Fl...

Страница 36: ...uction and 32 bit instruction 16 bit instruction op1 R1 R2 op2 op1 R1 c op1 cond c op1 R1 R2 op2 c op1 R1 R2 op2 c op1 R1 c op1 cond c 32 bit instruction R1 R1 op R2 R1 R1 op c Branch Short Displaceme...

Страница 37: ...ction as instruction B for parallel execution The MSB of the NOP instruction used for word arraignment adjustment is changed to 1 automatically by a standard Mitsubishi assembler then the M32R FPU can...

Страница 38: ...2 2 14 M32R FPU Software Manual Rev 1 01 This page left blank intentionally INSTRUCTION SET 2 2 Instruction format...

Страница 39: ...CHAPTER 3 INSTRUCTIONS 3 1 Conventions for instruction description 3 2 Instruction description...

Страница 40: ...ecify the memory address R register indirect and Subtract 4 to register contents 4 is subtract to the register register update contents hen the register contents specify the memory address imm immedia...

Страница 41: ...logical operator OR logical operator NOT logical operator execute a conditional expression conditional operator Table 3 1 4 Operation expression bit operator operator meaning bits are left shifted bi...

Страница 42: ...eption FPE and trap TRAP may result from an instruction execution Instruction format Shows the bit level instruction pattern 16 bits or 32 bits Source and or destination register numbers are put in th...

Страница 43: ...rc Add Rdest Rdest Rsrc None Add Rde 0000 dest 1010 src instruction function expression corresponds to C language method instruction description and effect on condition bit C EIT events which may occu...

Страница 44: ...c ADD 1010 arithmetic logic operation Add src Mnemonic ADD Rdest Rsrc Function Add Rdest Rdest Rsrc Description ADD adds Rsrc to Rdest and puts the result in Rdest The condition bit C is unchanged EIT...

Страница 45: ...ds the 16 bit immediate value to Rsrc and puts the result in Rdest The immediate value is sign extended to 32 bits before the operation The condition bit C is unchanged EIT occurrence None Encoding AD...

Страница 46: ...DI adds the 8 bit immediate value to Rdest and puts the result in Rdest The immediate value is sign extended to 32 bits before the operation The condition bit C is unchanged EIT occurrence None Encodi...

Страница 47: ...0 Description ADDV adds Rsrc to Rdest and puts the result in Rdest The condition bit C is set when the addition results in overflow otherwise it is cleared EIT occurrence None Encoding ADDV dest 0000...

Страница 48: ...ue to Rsrc and puts the result in Rdest The immediate value is sign extended to 32 bits before it is added to Rsrc The condition bit C is set when the addition results in overflow otherwise it is clea...

Страница 49: ...on ADDX adds Rsrc and C to Rdest and puts the result in Rdest The condition bit C is set when the addition result cannot be represented by a 32 bit unsigned integer otherwise it is cleared EIT occurre...

Страница 50: ...tion AND src dest Mnemonic AND Rdest Rsrc Function Logical AND Rdest Rdest Rsrc Description AND computes the logical AND of the corresponding bits of Rdest and Rsrc and puts the result in Rdest The co...

Страница 51: ...omputes the logical AND of the corresponding bits of Rsrc and the 16 bit immediate value which is zero extended to 32 bits and puts the result in Rdest The condition bit C is unchanged EIT occurrence...

Страница 52: ...gned x 8 8 Description BC causes a branch to the specified label when the condition bit C is 1 There are two instruction formats which allows software such as an assembler to decide on the better form...

Страница 53: ...he displacement is sign extended before the address calculation bitpos becomes 0 to 7 MSB becomes 0 and LSB becomes 7 The memory is accessed in bytes The LOCK bit is on while the BCLR instruction is e...

Страница 54: ...p16 Function Branch if Rsrc1 Rsrc2 PC PC 0xfffffffc signed short pcdisp16 2 Description BEQ causes a branch to the specified label when Rsrc1 is equal to Rsrc2 The condition bit C is unchanged EIT occ...

Страница 55: ...c pcdisp16 Function Branch if Rsrc 0 PC PC 0xfffffffc signed short pcdisp16 2 Description BEQZ causes a branch to the specified label when Rsrc is equal to zero The condition bit C is unchanged EIT oc...

Страница 56: ...Branch if signed Rsrc 0 PC PC 0xfffffffc signed short pcdisp16 2 Description BGEZ causes a branch to the specified label when Rsrc treated as a signed 32 bit value is greater than or equal to zero The...

Страница 57: ...Branch if signed Rsrc 0 PC PC 0xfffffffc signed short pcdisp16 2 Description BGTZ causes a branch to the specified label when Rsrc treated as a signed 32 bit value is greater than zero The condition b...

Страница 58: ...c sign_extend pcdisp24 2 where define sign_extend x signed x 8 8 Description BL causes an unconditional branch to the address specified by the label and puts the return address in R14 There are two in...

Страница 59: ...f signed Rsrc 0 PC PC 0xfffffffc signed short pcdisp16 2 Description BLEZ causes a branch to the specified label when the contents of Rsrc treated as a signed 32 bit value is less than or equal to zer...

Страница 60: ...Branch if signed Rsrc 0 PC PC 0xfffffffc signed short pcdisp16 2 Description BLTZ causes a branch to the specified label when Rsrc treated as a signed 32 bit value is less than zero The condition bit...

Страница 61: ...c sign_extend pcdisp24 2 where define sign_extend x signed x 8 8 Description BNC branches to the specified label when the condition bit C is 0 There are two instruction formats this allows software su...

Страница 62: ...p16 Function Branch if Rsrc1 Rsrc2 PC PC 0xfffffffc signed short pcdisp16 2 Description BNE causes a branch to the specified label when Rsrc1 is not equal to Rsrc2 The condition bit C is unchanged EIT...

Страница 63: ...c pcdisp16 Function Branch if Rsrc 0 PC PC 0xfffffffc signed short pcdisp16 2 Description BNEZ causes a branch to the specified label when Rsrc is not equal to zero The condition bit C is unchanged EI...

Страница 64: ...isp24 2 where define sign_extend x signed x 8 8 Description BRA causes an unconditional branch to the address specified by the label There are two instruction formats this allows software such as an a...

Страница 65: ...to 1 The displacement is sign extended before the address calculation bitpos becomes 0 to 7 MSB becomes 0 and LSB becomes 7 The memory is accessed in bytes The LOCK bit is on while the BSET instructio...

Страница 66: ...Instruction Mnemonic BTST bitpos Rsrc Function Remove the bit specified by the register C Rsrc 7 bitpos 1 Description Take out the bit specified as bitpos within the Rsrc lower eight bits and sets it...

Страница 67: ...tion Set the undefined SM IE and C bits of PSW to 0 PSW imm8 0xffffff00 Description Set the AND result s of the reverse value of b0 MSB b1 and b7 LSB of the 8 bit immediate value and bits SM IE and C...

Страница 68: ...igned Rsrc1 signed Rsrc2 1 0 Description The condition bit C is set to 1 when Rsrc1 is less than Rsrc2 The operands are treated as signed 32 bit values EIT occurrence None Encoding src1 0000 CMP Rsrc1...

Страница 69: ...condition bit C is set when Rsrc is less than 16 bit immediate value The operands are treated as signed 32 bit values The immediate value is sign extended to 32 bit before the opera tion EIT occurrenc...

Страница 70: ...ed Rsrc1 unsigned Rsrc2 1 0 Description The condition bit C is set when Rsrc1 is less than Rsrc2 The operands are treated as un signed 32 bit values EIT occurrence None Encoding src1 0000 CMPU Rsrc1 R...

Страница 71: ...ondition bit C is set when Rsrc is less than the 16 bit immediate value The operands are treated as unsigned 32 bit values The immediate value is sign extended to 32 bit before the operation EIT occur...

Страница 72: ...d Rdest signed Rsrc Description DIV divides Rdest by Rsrc and puts the quotient in Rdest The operands are treated as signed 32 bit values and the result is rounded toward zero The condition bit C is u...

Страница 73: ...c and puts the quotient in Rdest The operands are treated as unsigned 32 bit values and the result is rounded toward zero The condition bit C is unchanged When Rsrc is zero Rdest is unchanged EIT occu...

Страница 74: ...est The result is rounded according to the RM field of FPSR The DN bit of FPSR handles the modification of denormalized numbers The condition bit C remains unchanged EIT occurrence Floating Point Exce...

Страница 75: ...ed Number 0 Rsrc1 Rsrc2 add QNaN QNaN SNaN QNaN SNaN 0 Note Note Infinity Infinity IVLD IVLD IVLD Infinity Infinity Infinity Infinity 0 Infinity Infinity Rsrc1 Normalized Number Normalized Number Norm...

Страница 76: ...st The results of the comparison can be determined y the following methods The DN bit of FPSR handles the conversion of denormalized numbers The condition bit C remains unchanged EIT occurrence Floati...

Страница 77: ...ty IVLD comparison invalid Infinity Infinity 00000000 00000000 00000000 0 Infinity Infinity Infinity Infinity 0 Rsrc1 Normalized Number Normalized Number comparison Denormalized Number Denormalized Nu...

Страница 78: ...can be determined y the following methods Note Only when EV bit b21 of FPSR Register 0 The DN bit of FPSR handles the conversion of denormalized numbers The condition bit C remains unchanged EIT occur...

Страница 79: ...finity IVLD Infinity Infinity 00000000 00000000 00000000 0 Infinity Infinity Infinity Infinity 0 Rsrc1 Normalized Number Normalized Number Denormalized Number Denormalized Number comparison Rsrc2 QNaN...

Страница 80: ...result in Rdest The result is rounded according to the RM field of FPSR The DN bit of FPSR handles the modification of denormalized numbers The condition bit C remains unchanged EIT occurrence Floati...

Страница 81: ...SNaN QNaN SNaN 0 0 0 0 0 0 Infinity Infinity Infinity IVLD DIV0 IVLD IVLD Infinity Infinity Infinity Infinity 0 0 0 Infinity Infinity 0 Rsrc1 Normalized Number Normalized Number Denormalized Number D...

Страница 82: ...Add the result of Step 1 the rounded value and the floating point single precision value stored in Rdest The result is rounded according to the RM field of FPSR The result of this operation is stored...

Страница 83: ...d Infinity and 0 when rounding toward any other direction Rsrc2 Multiplication UIPL QNaN QNaN SNaN QNaN SNaN 0 0 0 0 Infinity Infinity Infinity IVLD Infinity Infinity IVLD IVLD Infinity Infinity Infin...

Страница 84: ...N SNaN QNaN SNaN 0 0 0 0 0 0 Infinity Infinity Infinity IVLD Infinity Infinity IVLD IVLD Infinity Infinity Infinity 0 0 Infinity Infinity Normalized Number Normalized Number Multiplication Denormalize...

Страница 85: ...t the result rounded value of Step 1 from the floating point single precision value stored in Rdest The subtraction result is rounded according to the RM field of FPSR The result of this operation is...

Страница 86: ...inity and 0 when rounding toward any other direction Rsrc2 Multiplication UIPL QNaN QNaN SNaN QNaN SNaN 0 0 0 0 Infinity Infinity Infinity IVLD Infinity Infinity IVLD IVLD Infinity Infinity Infinity 0...

Страница 87: ...N SNaN QNaN SNaN 0 0 0 0 0 0 Infinity Infinity Infinity IVLD Infinity Infinity IVLD IVLD Infinity Infinity Infinity 0 0 Infinity Infinity Normalized Number Normalized Number Multiplication Denormalize...

Страница 88: ...and store the results in Rdest The result is rounded according to the RM field of FPSR The DN bit of FPSR handles the modification of denormalized numbers The condition bit C remains unchanged EIT oc...

Страница 89: ...0 0 0 0 Infinity Infinity Infinity IVLD Infinity Infinity IVLD IVLD Infinity Infinity Infinity 0 0 0 Infinity Infinity 0 Rsrc1 Normalized Number Normalized Number Denormalized Number Denormalized Num...

Страница 90: ...1 and store the results in Rdest The result is rounded according to the RM field of FPSR The DN bit of FPSR handles the modification of denormalized numbers The condition bit C remains unchanged EIT o...

Страница 91: ...y Infinity 0 Infinity Infinity Rsrc1 Normalized Number Normalized Number Subtraction 0 0 Denormalized Number Denormalized Number 0 0 Denormalized Number Denormalized Number Supplemental Operation Desc...

Страница 92: ...on value stored in Rsrc to a 32 bit integer and store the result in Rdest The result is rounded toward 0 regardless of the value in the RM field of FPSR The condition bit C remains unchanged EIT occur...

Страница 93: ...igned bit 0 H 7FFF FFFF Signed bit 1 H 8000 0000 Note 1 Inexact Exception occurs when rounding is performed 2 Inexact Exception does not occur when Rsrc H CF00 0000 DN 1 Rsrc Value exponent with no bi...

Страница 94: ...ion value stored in Rsrc to a 16 bit integer and store the result in Rdest The result is rounded toward 0 regardless of the value in the RM field of FPSR The condition bit C remains unchanged EIT occu...

Страница 95: ...0 H 0000 7FFF Signed bit 1 H FFFF 8000 Note 1 Inexact Exception occurs when rounding is performed 2 Inexact Exception does not occur when Rsrc H CF00 0000 DN 1 Rsrc Value exponent with no bias Rdest...

Страница 96: ...ored in Rsrc to a floating point single precision value and stores the result in Rdest The result is rounded according to the RM field of FPSR The condition bit C remains unchanged H 0000 0000 is hand...

Страница 97: ...routine call register direct R14 PC 0xfffffffc 4 PC Rsrc 0xfffffffc Description JL causes an unconditional jump to the address specified by Rsrc and puts the return address in R14 The condition bit C...

Страница 98: ...n Jump Mnemonic JMP Rsrc Function Jump PC Rsrc 0xfffffffc Description JMP causes an unconditional jump to the address specified by Rsrc The condition bit C is unchanged EIT occurrence None Encoding JM...

Страница 99: ...into Rdest 2 The contents of the memory at the address specified by Rsrc are loaded into Rdest Rsrc is post incremented by 4 3 The contents of the memory at the address specified by Rsrc combined with...

Страница 100: ...Function Load the 24 bit immediate value into register Rdest imm24 0x00ffffff Description LD24 loads the 24 bit immediate value into Rdest The immediate value is zero extended to 32 bits The condition...

Страница 101: ...he byte data of the memory at the address specified by Rsrc and loads it into Rdest 2 LDB sign extends the byte data of the memory at the address specified by Rsrc combined with the 16 bit displacemen...

Страница 102: ...rd data of the memory at the address specified by Rsrc and loads it into Rdest 2 LDH sign extends the halfword data of the memory at the address specified by Rsrc combined with the 16 bit displacement...

Страница 103: ...dest signed short imm16 Description 1 LDI loads the 8 bit immediate value into Rdest The immediate value is sign extended to 32 bits 2 LDI loads the 16 bit immediate value into Rdest The immediate val...

Страница 104: ...xtends the byte data from the memory at the address specified by Rsrc and loads it into Rdest 2 LDUB zero extends the byte data of the memory at the address specified by Rsrc com bined with the 16 bit...

Страница 105: ...e halfword data from the memory at the address specified by Rsrc and loads it into Rdest 2 LDUH zero extends the halfword data in memory at the address specified by Rsrc com bined with the 16 bit disp...

Страница 106: ...ster access is not accepted The LOCK bit is cleared by executing the UNLOCK instruction The LOCK bit is located in the CPU and operates based on the LOCK and UNLOCK instruc tions The user cannot direc...

Страница 107: ...mulator and the portion corresponding to bits 8 through 15 of the accumulator is sign extended before addition The result of the addition is stored in the accumulator The high order 16 bits of Rsrc1 a...

Страница 108: ...or and the portion corresponding to bits 8 through 15 of the accumulator is sign extended before addition The result of the addition is stored in the accumulator The low order 16 bits of Rsrc1 and Rsr...

Страница 109: ...or and the portion corresponding to bits 8 through 15 of the accumulator is sign extended before addition The result of addition is stored in the accumulator The 32 bits of Rsrc1 and the high order 16...

Страница 110: ...nd the portion corresponding to bits 8 through 15 of the accumulator is sign extended before the addition The result of the addition is stored in the accumulator The 32 bits Rsrc1 and the low order 16...

Страница 111: ...64bit Rdest signed64bit Rsrc Rdest int tmp Description MUL multiplies Rdest by Rsrc and puts the result in Rdest The operands are treated as signed values The contents of the accumulator are destroyed...

Страница 112: ...cation result is aligned with bit 47 in the accumulator and the portion corresponding to bits 0 through 15 of the accumulator is sign extended Bits 48 through 63 of the accumulator are cleared to 0 Th...

Страница 113: ...sult is aligned with bit 47 in the accumulator and the portion corresponding to bits 0 through 15 of the accumulator is sign extended Bits 48 through 63 of the accumulator are cleared to 0 The low ord...

Страница 114: ...LSB of the multiplication result is aligned with the LSB of the accumulator and the portion corresponding to bits 0 through 15 of the accumulator is sign extended The 32 bits of Rsrc1 and high order 1...

Страница 115: ...B of the multiplication result is aligned with the LSB of the accumulator and the portion corresponding to bits 0 through 15 of the accumulator is sign extended The 32 bits of Rsrc1 and low order 16 b...

Страница 116: ...fer instruction Move register Mnemonic MV Rdest Rsrc Function Transfer Rdest Rsrc Description MV moves Rsrc to Rdest The condition bit C is unchanged EIT occurrence None Encoding dest 0001 MV Rdest Rs...

Страница 117: ...lator Mnemonic MVFACHI Rdest Function Transfer from accumulator to register Rdest int accumulator 32 Description MVFACHI moves the high order 32 bits of the accumulator to Rdest The condition bit C is...

Страница 118: ...ulator Mnemonic MVFACLO Rdest Function Transfer from accumulator to register Rdest int accumulator Description MVFACLO moves the low order 32 bits of the accumulator to Rdest The condition bit C is un...

Страница 119: ...umulator Mnemonic MVFACMI Rdest Function Transfer from accumulator to register Rdest int accumulator 16 Description MVFACMI moves bits16 through 47 of the accumulator to Rdest The condition bit C is u...

Страница 120: ...ontrol register Mnemonic MVFC Rdest CRsrc Function Transfer from control register to register Rdest CRsrc Description MVFC moves CRsrc to Rdest The condition bit C is unchanged EIT occurrence None Enc...

Страница 121: ...mulator Mnemonic MVTACHI Rsrc Function Transfer from register to accumulator accumulator 0 31 Rsrc Description MVTACHI moves Rsrc to the high order 32 bits of the accumulator The condition bit C is un...

Страница 122: ...mulator Mnemonic MVTACLO Rsrc Function Transfer from register to accumulator accumulator 32 63 Rsrc Description MVTACLO moves Rsrc to the low order 32 bits of the accumulator The condition bit C is un...

Страница 123: ...Rsrc CRdest Function Transfer from register to control register CRdest Rsrc Description MVTC moves Rsrc to CRdest If PSW CR0 is specified as CRdest the condition bit C is changed otherwise it is un ch...

Страница 124: ...ic NEG Rdest Rsrc Function Negate Rdest 0 Rsrc Description NEG negates changes the sign of Rsrc treated as a signed 32 bit value and puts the result in Rdest The condition bit C is unchanged EIT occur...

Страница 125: ...uction No operation Mnemonic NOP Function No operation Description NOP performs no operation The subsequent instruction then processed The condition bit C is unchanged EIT occurrence None Encoding NOP...

Страница 126: ...ical NOT Mnemonic NOT Rdest Rsrc Function Logical NOT Rdest Rsrc Description NOT inverts each of the bits of Rsrc and puts the result in Rdest The condition bit C is unchanged EIT occurrence None Enco...

Страница 127: ...st Rsrc Function Logical OR Rdest Rdest Rsrc Description OR computes the logical OR of the corresponding bits of Rdest and Rsrc and puts the result in Rdest The condition bit C is unchanged EIT occurr...

Страница 128: ...t Rsrc unsigned short imm16 Description OR3 computes the logical OR of the corresponding bits of Rsrc and the 16 bit immediate value which is zero extended to 32 bits and puts the result in Rdest The...

Страница 129: ...f 0x0000 7fff ffff 0000 tmp accumulator 0x0000 7fff ffff 0000 else if tmp 0xffff 8000 0000 0000 accumulator 0xffff 8000 0000 0000 else accumulator tmp 0xffff ffff ffff 0000 Description RAC rounds the...

Страница 130: ...s 1 the bit is carried Bits 48 to 63 are cleared to zero 0000 7FFF FFFF 8000 positive value negative value 0000 7FFF FFFF 7FFF 0000 0000 0000 0000 FFFF 8000 0000 8000 FFFF 8000 0000 7FFF supposed sign...

Страница 131: ...00 if 0x0000 7fff 0000 0000 tmp accumulator 0x0000 7fff 0000 0000 else if tmp 0xffff 8000 0000 0000 accumulator 0xffff 8000 0000 0000 else accumulator tmp 0xffff ffff 0000 0000 Description RACH rounds...

Страница 132: ...is carried Bits 32 to 63 are cleared to zero 0000 7FFE 8000 0000 positive value negative value 0000 7FFE 7FFF 7FFF 0000 0000 0000 0000 FFFF 8000 8000 0000 FFFF 8000 7FFF FFFF supposed sign extended bi...

Страница 133: ...M divides Rdest by Rsrc and puts the quotient in Rdest The operands are treated as signed 32 bit values The quotient is rounded toward zero and the quotient takes the same sign as the dividend The con...

Страница 134: ...r Rdest unsigned Rdest unsigned Rsrc Description REMU divides Rdest by Rsrc and puts the quotient in Rdest The operands are treated as unsigned 32 bit values The condition bit C is unchanged When Rsrc...

Страница 135: ...PC BPC 0xfffffffc Description RTE restores the SM IE and C bits of the PSW from the BSM BIE and BC bits and jumps to the address specified by BPC At this time because the BSM BIE and BC bits in the P...

Страница 136: ...ion Transfer instructions Rdest signed short imm16 16 Description SETH load the immediate value into the 16 most significant bits of Rdest The 16 least significant bits become zero The condition bit C...

Страница 137: ...SM IE anc C bits of PSW to 1 PSW imm8 0x000000ff Description Set the AND result of the value of b0 MSB b1 and b7 LSB of the 8 bit immediate value and bits SM IE and C of PSW to the corresponding SM I...

Страница 138: ...Rdest Rsrc 31 Description SLL left logical shifts the contents of Rdest by the number specified by Rsrc shifting zeroes into the least significant bits Only the five least significant bits of Rsrc ar...

Страница 139: ...on SLL3 left logical shifts the contents of Rsrc into Rdest by the number specified by the 16 bit immediate value shifting zeroes into the least significant bits Only the five least significant bits o...

Страница 140: ...Logical left shift Rdest Rdest imm5 Description SLLI left logical shifts the contents of Rdest by the number specified by the 5 bit immediate value shifting zeroes into the least significant bits The...

Страница 141: ...est Rsrc 31 Description SRA right arithmetic shifts the contents of Rdest by the number specified by Rsrc replicates the sign bit in the MSB of Rdest and puts the result in Rdest Only the five least s...

Страница 142: ...6 31 Description SRA3 right arithmetic shifts the contents of Rsrc into Rdest by the number specified by the 16 bit immediate value replicates the sign bit in Rsrc and puts the result in Rdest Only th...

Страница 143: ...shift Rdest signed Rdest imm5 Description SRAI right arithmetic shifts the contents of Rdest by the number specified by the 5 bit immedi ate value replicates the sign bit in MSB of Rdest and puts the...

Страница 144: ...src 31 Description SRL right logical shifts the contents of Rdest by the number specified by Rsrc shifts zeroes into the most significant bits and puts the result in Rdest Only the five least signific...

Страница 145: ...Description SRL3 right logical shifts the contents of Rsrc into Rdest by the number specified by the 16 bit immediate value shifts zeroes into the most significant bits Only the five least significant...

Страница 146: ...Logical right shift Rdest unsigned Rdest imm5 31 Description SRLI right arithmetic shifts Rdest by the number specified by the 5 bit immediate value shift ing zeroes into the most significant bits The...

Страница 147: ...dress specified by Rsrc2 2 ST increments Rsrc2 by 4 and stores Rsrc1 in the memory at the address specified by the resultant Rsrc2 3 ST decrements Rsrc2 by 4 and stores the contents of Rsrc1 in the me...

Страница 148: ...1 Encoding src1 1010 src1 0010 0111 src2 0100 src2 disp16 src1 0010 0110 src2 src1 0010 0100 src2 ST Rsrc1 Rsrc2 ST Rsrc1 Rsrc2 ST Rsrc1 Rsrc2 ST Rsrc1 disp16 Rsrc2 INSTRUCTIONS 3 2 Instruction descri...

Страница 149: ...of Rsrc1 in the memory at the address specified by Rsrc2 2 STB stores the least significant byte of Rsrc1 in the memory at the address specified by Rsrc combined with the 16 bit displacement The displ...

Страница 150: ...at the address specified by Rsrc2 2 STH stores the LSB halfword of Rsrc1 to the memory of the address specified by Rsrc2 and then increments Rsrc2 by 2 3 STH stores the least significant halfword of...

Страница 151: ...ion Subtract Mnemonic SUB Rdest Rsrc Function Subtract Rdest Rdest Rsrc Description SUB subtracts Rsrc from Rdest and puts the result in Rdest The condition bit C is unchanged EIT occurrence None Enco...

Страница 152: ...Rdest Rsrc Function Subtract Rdest Rdest Rsrc C overflow 1 0 Description SUBV subtracts Rsrc from Rdest and puts the result in Rdest The condition bit C is set when the subtraction results in overflo...

Страница 153: ...nsigned Rdest unsigned Rsrc C C borrow 1 0 Description SUBX subtracts Rsrc and C from Rdest and puts the result in Rdest The condition bit C is set when the subtraction result cannot be represented by...

Страница 154: ...n Trap occurrence BPC PC 4 BSM SM BIE IE BC C IE 0 C 0 call_trap_handler imm4 Description TRAP generates a trap with the trap number specified by the 4 bit immediate value IE and C bits are cleared to...

Страница 155: ...on clears the LOCK bit to 0 in addition to the simple storage operation The LOCK bit is internal to the CPU and cannot be accessed except by using the LOCK and UNLOCK instructions The user cannot dire...

Страница 156: ...ion value Rdest float unsigned int Rsrc Description UTOF converts the 32 bit unsigned integer stored in Rsrc to a floating point single precision value and the result is stored in Rdest The result is...

Страница 157: ...src Function Exclusive OR Rdest unsigned Rdest unsigned Rsrc Description XOR computes the logical XOR of the corresponding bits of Rdest and Rsrc and puts the result in Rdest The condition bit C is un...

Страница 158: ...est unsigned Rsrc unsigned short imm16 Description XOR3 computes the logical XOR of the corresponding bits of Rsrc and the 16 bit immediate value which is zero extended to 32 bits and puts the result...

Страница 159: ...xadecimal Instraction Code APPENDIX 2 Instruction List APPENDIX 3 Pipeline Processing APPENDIX 4 Instruction Execution Time APPENDIX 5 IEEE754 Specification Overview APPENDIX 6 M32R FPU Specification...

Страница 160: ...I MULLO MULWHI MULWLO MACHI MACLO MACWHI MACWLO Rsrc1 Rsrc2 Rsrc1 Rsrc2 Rsrc1 Rsrc2 Rsrc1 Rsrc2 Rsrc1 Rsrc2 Rsrc1 Rsrc2 Rsrc1 Rsrc2 Rsrc1 Rsrc2 ADDI Rdest imm8 Rdest imm5 Rdest imm5 Rdest imm5 SRLI SR...

Страница 161: ...SLL3 Rdest Rsrc imm16 LDI Rdest imm16 LDB Rdest disp16 Rsrc LDUB Rdest disp16 Rsrc LDH Rdest disp16 Rsrc LDUH Rdest disp16 Rsrc LD Rdest disp16 Rsrc BEQZ Rsrc pcdisp16 BNEZ Rsrc pcdisp16 BLTZ Rsrc pcd...

Страница 162: ...src 0 PC PC sh pcdisp16 2 BLTZ Rsrc pcdisp16 if Rsrc 0 PC PC sh pcdisp16 2 BNC pcdisp8 if C PC PC sb pcdisp8 2 BNC pcdisp24 if C PC PC s24 pcdisp24 2 BNE Rsrc1 Rsrc2 pcdisp16 if Rsrc1 Rsrc2 PC PC sh p...

Страница 163: ...mm8 LDUB Rdest disp16 Rsrc Rdest ub Rsrc sh disp16 LDUB Rdest Rsrc Rdest ub Rsrc LDUH Rdest disp16 Rsrc Rdest uh Rsrc sh disp16 LDUH Rdest Rsrc Rdest ub Rsrc LOCK Rdest Rsrc LOCK 1 Rdest s Rsrc MACHI...

Страница 164: ...6 31 SRAI Rdest imm5 Rdest s Rdest imm5 SRL Rdest Rsrc Rdest u Rdest Rsrc 31 SRL3 Rdest Rsrc imm16 Rdest u Rsrc imm16 31 SRLI Rdest imm5 Rdest u Rdest imm5 ST Rsrc1 disp16 Rsrc2 s Rsrc2 sh disp16 Rsrc...

Страница 165: ...rd typedef unsigned int u 32 bit unsigned integer word typedef signed short sh 16 bit signed integer halfword typedef unsigned short uh 16 bit unsigned integer halfword typedef signed char sb 8 bit si...

Страница 166: ...cuted at the same time as the E or E1 stage 6 stages IF D E1 E2 WB Pipeline Stage FPU instruction excluding FMADD FMSUB The E1 and E2 stages cannot be executed at the same time as the E stage The E1 s...

Страница 167: ...lf of the stage E stage execution stage Operations and address calculations OP are processed in the E stage If an operation result from the previous instruction is required bypass process BYP is perfo...

Страница 168: ...WB IF D WB E D WB E IF D WB E Case 2 Load store instructions to destination are accessed in 1 cycle continuously IF D E WB ST R0 R15 ST R1 R15 LDI R0 1 ADD R0 R1 OR R0 R2 CMP R0 R3 IF D WB MEM2 MEM1...

Страница 169: ...R0 R5 R6 FSUB R1 R6 R7 IF D E2 E1 WB E2 E1 WB E2 E1 WB E2 IF D FMUL R2 R7 R8 FCMP R0 R0 R3 IF D IF D EA WB FMADD R0 R5 R6 FMADD R1 R6 R7 IF D EM E2 EA WB EM E2 EA WB EM E2 EA WB EM E2 IF D FMADD R2 R...

Страница 170: ...DIV R1 R2 E E IF D stall WB ADD R3 R4 E stall IF D WB E stall stall IF D stall WB E stall ADD R5 R6 ADD R7 R8 Case 2 An instruction which requires more than 1 cycle for its operand access is executed...

Страница 171: ...ass process branch instruction is executed stall stall Case 4 The subsequent instruction uses an operand read from the memory IF D E WB LD R1 R2 IF D WB MEM2 MEM1 ADD R3 R1 stall stall IF Bypass proce...

Страница 172: ...D E1 WB FADD R0 R1 R2 IF D WB E E2 MVFC R3 FPSR stall stall IF D E1 WB FADD R0 R1 R2 IF D E2 WB E1 E2 FADD R3 R0 R4 stall stall IF D EM WB FMADD R0 R1 R2 IF D E2 WB EA EA E2 EM FMADD R0 R3 R4 stall s...

Страница 173: ...R0 R1 ADD R5 R6 FADD R2 R3 R4 FADD R7 R8 R9 Case 10 The FMADD FMSUB instructions run consecutively with the integer instruction with no register dependency IF D E WB IF D WB E2 D WB E stall stall IF D...

Страница 174: ...E1 stall IF D E2 WB EA EM EA EM stall IF Case 13 The FPU and FMADD FMSUB instructions run consecutively with register dependency FADD R0 R1 R10 FADD R5 R6 R11 FMADD R2 R3 R4 FMADD R7 R8 R9 IF D E1 E2...

Страница 175: ...ge instruction IF D E MEM1 MEM2 WB load instruction LD LDB LDUB LDH LDUH LOCK R note 1 1 1 R note 1 1 1 store instruction ST STB STH UNLOCK R note 1 1 1 W note 1 1 1 note 2 BSET BCLR instructions R no...

Страница 176: ...positive by adding 127 to a single precision value or 1023 to a double precision value biased exponent f Fraction Represents the fraction field of the value Using these symbols the floating point val...

Страница 177: ...Denormalized Numbers Denormalized numbers represent numbers values that have an absolute value less than 1 0 0 x 2 126 Single precision denormalized numbers are expressed as follows 1 s x 0 f x 2 126...

Страница 178: ...inity and Round toward Zero are used for interval arithmetic to insure precision Appendix 5 3 Exceptions IEEE754 allows the following 5 exceptions The floating point status register is used to determi...

Страница 179: ...respective conditions in which each IXCT occurs Appendix Table 5 3 3 Operation Results and Respective Conditions for IXCT Exception Result Occurrence Condition when the IXCT EIT when the IXCT EIT pro...

Страница 180: ...of result is exclusive OR EXOR of signs of divider and dividend Definition of Terms Exception Special conditions generated by execution of floating point instructions The corresponding enable bits of...

Страница 181: ...DD rounds both FMUL and FADD according to the setting of the FPSR RM field However the result of the FMADD or FMSUB instruction in Step 1 multiply stage is not rounded according to the setting of FPSR...

Страница 182: ...1 Operation Result due to OVF Exception for immediate values if an overflow occurs due to Overflow Exclusion when the EIT processing is masked Note 2 In Step 1 the rounding mode is set to Round toward...

Страница 183: ...is EIT occurs number 0 completed R0 maintained Infinity R0 maintained Denormalized Same as above Same as above number QNaN Same as above Same as above SNaN EV 0 Same as above IVLD occurs EIT occurs R...

Страница 184: ...n EV 1 IVLD occurs Type of R0 Condition FMUL FADD Operation FMADD Operation Normalized EIT occurs when FMUL is EIT occurs number 0 completed R0 maintained Infinity R0 maintained Denormalized DN 0 Same...

Страница 185: ...aintained SNaN When EX 1 IXCT occurs Type of R0 Condition FMUL FADD Operation FMADD Operation Normalized EIT occurs when FMUL is EIT occurs number 0 completed R0 maintained Infinity R0 maintained Deno...

Страница 186: ...1 Rsrc2 Rdest SNaN and QNaN SNaN converted to QNaN Note 1 Both SNaN Rsrc2 converted to QNaN Note 1 Both QNaN Rscr2 SNaN and actual number SNaN converted to QNaN Note 1 QNaN and actual number QNaN Neit...

Страница 187: ...e high order halfword of the word and data with MSB of 1 may be aligned to the following halfword In this case the M32R family upward compatible CPU recognizes the 16 bit instruction and the data as a...

Страница 188: ...APPENDICES APPENDICES 30 M32R FPU Software Manual Rev 1 01 This page left blank intentionally APPENDIX 7 Appendix 7 Precautions...

Страница 189: ...INDEX...

Страница 190: ...7 BGEZ 3 18 BGTZ 3 19 BL 3 20 BLEZ 3 21 BLTZ 3 22 BNC 3 23 BNE 3 24 BNEZ 3 25 BRA 3 26 JL 3 59 JMP 3 60 NOP 3 87 C Compare instructions 2 4 CMP 3 30 CMPI 3 31 CMPU 3 32 CMPUI 3 33 Condition Bit Regist...

Страница 191: ...Operand List 3 2 P PC relative pcdisp 1 14 3 2 Processor Status Register PSW 1 3 1 4 Program Counter PC 1 11 E EIT related instructions 2 8 RTE 3 97 TRAP 3 116 F Floating point instruction 2 11 FADD...

Страница 192: ...t and register update 1 15 3 2 Register relative indirect disp R 1 15 3 2 S Shift instructions 2 5 SLL 3 100 SLL3 3 101 SLLI 3 102 SRA 3 103 SRA3 3 104 SRAI 3 105 SRL 3 106 SRL3 3 107 SRLI 3 108 Stack...

Страница 193: ...MICROCOMPUTER SOFTWARE MANUAL M32R FPU Publication Data Rev 1 00 Jan 08 2003 Rev 1 01 Oct 31 2003 Published by Sales Strategic Planning Div Renesas Technology Corp 2003 Renesas Technology Corp All ri...

Страница 194: ...1753 Shimonumabe Nakahara ku Kawasaki shi Kanagawa 211 8668 Japan M32R FPU REJ09B0112 0101Z Software Manual...

Отзывы: