@@ -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
@@ -1272,7 +1277,12 @@ void RegExpMacroAssemblerPPC::LoadCurrentCharacterUnchecked(int cp_offset,
1272
1277
Register offset = current_input_offset ();
1273
1278
if (cp_offset != 0 ) {
1274
1279
// r25 is not being used to store the capture start index at this point.
1275
- __ addi (r25, current_input_offset (), Operand (cp_offset * char_size ()));
1280
+ if (is_int16 (cp_offset * char_size ())) {
1281
+ __ addi (r25, current_input_offset (), Operand (cp_offset * char_size ()));
1282
+ } else {
1283
+ __ mov (r25, Operand (cp_offset * char_size ()));
1284
+ __ add (r25, r25, current_input_offset ());
1285
+ }
1276
1286
offset = r25;
1277
1287
}
1278
1288
// The lwz, stw, lhz, sth instructions can do unaligned accesses, if the CPU
0 commit comments