Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

esp32s2: fix JUMPS offset interpretation (make same as JUMPR) (GCC-337) #1

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gas/config/tc-esp32s2ulp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1224,7 +1224,7 @@ INSTR_T esp32s2ulp_cmd_jump_rels(Expr_Node* step, Expr_Node* thresh, int cond)
int thresh_val = EXPR_VALUE(thresh);

{
unsigned int local_op = I_JUMP_RELS(thresh_val, cond, step_val);
unsigned int local_op = I_JUMP_RELS(thresh_val, cond, step_val>>2);

INSTR_T result = conscode(gencode(local_op),
conctcode(Expr_Node_Gen_Reloc(step, BFD_RELOC_ESP32S2ULP_JUMPR_STEP),
Expand Down
2 changes: 1 addition & 1 deletion gas/config/tc-esp32ulp_esp32s2.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ INSTR_T esp32ulp_cmd_jump_rels_esp32s2(Expr_Node* step, Expr_Node* thresh, int c
int step_val = EXPR_VALUE(step);
int thresh_val = EXPR_VALUE(thresh);
{
unsigned int local_op = I_JUMP_RELS(thresh_val, cond, step_val);
unsigned int local_op = I_JUMP_RELS(thresh_val, cond, step_val>>2);

INSTR_T result = conscode(gencode(local_op),
conctcode(Expr_Node_Gen_Reloc(step, BFD_RELOC_ESP32S2ULP_JUMPR_STEP),
Expand Down
14 changes: 7 additions & 7 deletions gas/testsuite/gas/esp32ulp/esp32s2/compare/esp32s2ulp_jump.lst
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ ESP32ULP GAS ./gas/testsuite/gas/esp32ulp/esp32s2/esp32s2ulp_jump.s page 1
69 0000DE82
70
71 // Jumps commands...
72 00f0 04001288 jumps 0x4, 0x04, EQ
73 00f4 04001288 jumps 0x04, check_thres1, EQ
72 00f0 04000688 jumps 0x4, 0x04, EQ
73 00f4 04000688 jumps 0x04, check_thres1, EQ
74 00f8 0400EA8A jumps check_jump1, check_thres1, EQ
75 00fc 0000EE8A jumps check_jump1, check_thres2, EQ
76 0100 0400F28A jumps check_jump2, check_thres1, EQ
Expand All @@ -111,8 +111,8 @@ ESP32ULP GAS ./gas/testsuite/gas/esp32ulp/esp32s2/esp32s2ulp_jump.s page 1
91 00000A82
92
93 //jumps with negative offset
94 0138 0000128A jumps -0x4, 0x00, EQ
95 013c 0080108A jumps -0x4, 0x00, LT
96 0140 0080118A jumps -0x4, 0x00, GT
97 0144 0080128A jumps -0x4, 0x00, LE
98 0148 0080138A jumps -0x4, 0x00, GE
94 0138 0000068A jumps -0x4, 0x00, EQ
95 013c 0080048A jumps -0x4, 0x00, LT
96 0140 0080058A jumps -0x4, 0x00, GT
97 0144 0080068A jumps -0x4, 0x00, LE
98 0148 0080078A jumps -0x4, 0x00, GE