0

Hello support team,

I found wrong generated code regarding GNURX for RXv3 DPFPU DCMR register missing push/pop sequence. A zip file including all files for e2 studio 2022-07 and GNURX 8.3.0.202202 is posted in the following Renesas’ Japanese user forum URL.

https://community-ja.renesas.com/cafe_rene/forums-groups/tools/f/forum21/9581/gcc-for-renesas-rx-gnurx-dcmr
issue_RXv3_DPFPU_DCMR_push_pop_20221004.zip

double dbl;
void i_fnc_4_2(void);
void i_fnc_4_2(void)
{
if(dbl > 1.0)
{
dbl = 1.0;
}
}

GNURX : There are no push/pop sequence for RXv3 DPFPU DCMR register.
If the function is called from an interrupt service routine, the code may break the value at main routine.

issue_RXv3_DPFPU_DCMR_push_pop_20221004/RXv3_RegBankSave_GCC/HardwareDebug/RXv3_RegBankSave_helper.lst
7 _i_fnc_4_2:
11 0000 75 B0 01 dpushm.d dr0-dr1
15 0003 F9 03 03 00 00 F0 3F dmov.D #0x3ff00000, drh0
17 000a FB 52 00 00 00 00 mov.L #_dbl, r5
19 0010 FC C8 58 10 dmov.D [r5], dr1
20 0014 76 90 18 60 dcmple dr0, dr1
21 0018 75 90 1B mvfdr
22 001b 15 bz .L1
25 001c FC 78 58 00 dmov.D dr0, [r5]
26 .balign 8,3,1
27 .L1:
29 0020 75 B8 01 dpopm.d dr0-dr1
30 0023 02 rts

CC-RX : There is a push/pop sequence for RXv3 DPFPU DCMR register.
OK

issue_RXv3_DPFPU_DCMR_push_pop_20221004/RXv3_RegBankSave_CCRX/HardwareDebug/src/RXv3_RegBankSave_helper.lst
00000000 _i_fnc_4_2:
00000000 75B001 DPUSHM.D DR0-DR1
00000003 75A010 DPUSHM.L DCMR-DCMR <– HERE : OK
00000006 FBE2rrrrrrrr MOV.L #_dbl, R14
0000000C F903030000F03F DMOV.D #3FF00000H, DRH0
00000013 FCC8E810 DMOV.D [R14], DR1
00000017 76900841 DCMPLT DR1, DR0
0000001B 75901B MVFDR
0000001E 21rr BNE L12
00000020 L11: ; if_then_bb
00000020 F8E600 MOV.L #00000000H, [R14]
00000023 F9E2010000F03F MOV.L #3FF00000H, 04H[R14]
0000002A L12: ; return
0000002A 75A810 DPOPM.L DCMR-DCMR <– HERE : OK
0000002D 75B801 DPOPM.D DR0-DR1
00000030 02 RTS

ICCRX : There is a push/pop sequence for RXv3 DPFPU DCMR register.
OK

issue_RXv3_DPFPU_DCMR_push_pop_20221004/RXv3_RegBankSave_IAR/HardwareDebug/RXv3_RegBankSave_helper.lst
\ _i_fnc_4_2:
\ 000000 75 B0 01 DPUSHM.D DR0,DR1 ; N
\ 000003 FB 1E MOV.L #_dbl:24,R1 ; N
\ ..’….
\ 000008 75 A0 10 DPUSHM.L DCMR,DCMR ; N <– HERE : OK
\ 00000B FC C8 18 00 DMOV.D [R1],DR0 ; N
\ 00000F F9 03 10 01 DMOV.L #0x1,DRL1 ; N
\ 00 00 00
\ 000016 F9 03 12 00 DMOV.L #0x3ff00000,DRH1 ; N
\ 00 F0 3F
\ 00001D 76 90 18 60 DCMPLE DR0,DR1 ; N
\ 000021 75 90 1B MVFDR
\ 000024 21 0C BNE.B ??i_fnc_4_2_0 ; N
\ 000026 F8 16 00 MOV.L #0x0,[R1] ; N
\ 000029 F9 12 01 00 MOV.L #0x3ff00000,0x4[R1] ; N
\ 00 F0 3F
\ ??i_fnc_4_2_0:
\ 000030 75 A8 10 DPOPM.L DCMR,DCMR ; N <– HERE : OK
\ 000033 75 B8 01 DPOPM.D DR0,DR1 ; N
\ 000036 02 RTS

Best regards,
NoMaY

Open Source Tools Support 回答済