@@ -142,8 +142,13 @@ int RegExpMacroAssemblerPPC::stack_limit_slack() {
142
142
143
143
void RegExpMacroAssemblerPPC::AdvanceCurrentPosition (int by) {
144
144
if (by != 0 ) {
145
- __ addi (current_input_offset (), current_input_offset (),
146
- Operand (by * char_size ()));
145
+ if (is_int16 (by * char_size ())) {
146
+ __ addi (current_input_offset (), current_input_offset (),
147
+ Operand (by * char_size ()));
148
+ } else {
149
+ __ mov (r0, Operand (by * char_size ()));
150
+ __ add (current_input_offset (), r0, current_input_offset ());
151
+ }
147
152
}
148
153
}
149
154
@@ -1270,7 +1275,12 @@ void RegExpMacroAssemblerPPC::LoadCurrentCharacterUnchecked(int cp_offset,
1270
1275
Register offset = current_input_offset ();
1271
1276
if (cp_offset != 0 ) {
1272
1277
// r25 is not being used to store the capture start index at this point.
1273
- __ addi (r25, current_input_offset (), Operand (cp_offset * char_size ()));
1278
+ if (is_int16 (cp_offset * char_size ())) {
1279
+ __ addi (r25, current_input_offset (), Operand (cp_offset * char_size ()));
1280
+ } else {
1281
+ __ mov (r25, Operand (cp_offset * char_size ()));
1282
+ __ add (r25, r25, current_input_offset ());
1283
+ }
1274
1284
offset = r25;
1275
1285
}
1276
1286
// The lwz, stw, lhz, sth instructions can do unaligned accesses, if the CPU
0 commit comments