| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 3064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3075 Label labels[kNumCases]; | 3075 Label labels[kNumCases]; |
| 3076 | 3076 |
| 3077 __ daddiu(sp, sp, -8); | 3077 __ daddiu(sp, sp, -8); |
| 3078 __ sd(ra, MemOperand(sp)); | 3078 __ sd(ra, MemOperand(sp)); |
| 3079 if ((assm.pc_offset() & 7) == 0) { | 3079 if ((assm.pc_offset() & 7) == 0) { |
| 3080 __ nop(); | 3080 __ nop(); |
| 3081 } | 3081 } |
| 3082 | 3082 |
| 3083 Label done; | 3083 Label done; |
| 3084 { | 3084 { |
| 3085 __ BlockTrampolinePoolFor(kNumCases * 2 + 7); |
| 3085 PredictableCodeSizeScope predictable( | 3086 PredictableCodeSizeScope predictable( |
| 3086 &assm, (kNumCases * 2 + 7) * Assembler::kInstrSize); | 3087 &assm, (kNumCases * 2 + 7) * Assembler::kInstrSize); |
| 3087 Label here; | 3088 Label here; |
| 3088 | 3089 |
| 3089 __ bal(&here); | 3090 __ bal(&here); |
| 3090 __ nop(); | 3091 __ nop(); |
| 3091 __ bind(&here); | 3092 __ bind(&here); |
| 3092 __ dsll(at, a0, 3); | 3093 __ dsll(at, a0, 3); |
| 3093 __ daddu(at, at, ra); | 3094 __ daddu(at, at, ra); |
| 3094 __ ld(at, MemOperand(at, 5 * Assembler::kInstrSize)); | 3095 __ ld(at, MemOperand(at, 5 * Assembler::kInstrSize)); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3155 __ ori(v0, v0, values[i] & 0xffff); | 3156 __ ori(v0, v0, values[i] & 0xffff); |
| 3156 __ b(&done); | 3157 __ b(&done); |
| 3157 __ nop(); | 3158 __ nop(); |
| 3158 } | 3159 } |
| 3159 | 3160 |
| 3160 if ((assm.pc_offset() & 7) == 0) { | 3161 if ((assm.pc_offset() & 7) == 0) { |
| 3161 __ nop(); | 3162 __ nop(); |
| 3162 } | 3163 } |
| 3163 __ bind(&dispatch); | 3164 __ bind(&dispatch); |
| 3164 { | 3165 { |
| 3166 __ BlockTrampolinePoolFor(kNumCases * 2 + 7); |
| 3165 PredictableCodeSizeScope predictable( | 3167 PredictableCodeSizeScope predictable( |
| 3166 &assm, (kNumCases * 2 + 7) * Assembler::kInstrSize); | 3168 &assm, (kNumCases * 2 + 7) * Assembler::kInstrSize); |
| 3167 Label here; | 3169 Label here; |
| 3168 | 3170 |
| 3169 __ bal(&here); | 3171 __ bal(&here); |
| 3170 __ nop(); | 3172 __ nop(); |
| 3171 __ bind(&here); | 3173 __ bind(&here); |
| 3172 __ dsll(at, a0, 3); | 3174 __ dsll(at, a0, 3); |
| 3173 __ daddu(at, at, ra); | 3175 __ daddu(at, at, ra); |
| 3174 __ ld(at, MemOperand(at, 5 * Assembler::kInstrSize)); | 3176 __ ld(at, MemOperand(at, 5 * Assembler::kInstrSize)); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3237 __ b(&done); | 3239 __ b(&done); |
| 3238 __ nop(); | 3240 __ nop(); |
| 3239 } | 3241 } |
| 3240 | 3242 |
| 3241 __ stop("chk"); | 3243 __ stop("chk"); |
| 3242 if ((assm.pc_offset() & 7) == 0) { | 3244 if ((assm.pc_offset() & 7) == 0) { |
| 3243 __ nop(); | 3245 __ nop(); |
| 3244 } | 3246 } |
| 3245 __ bind(&dispatch); | 3247 __ bind(&dispatch); |
| 3246 { | 3248 { |
| 3249 __ BlockTrampolinePoolFor(kNumCases * 2 + 7); |
| 3247 PredictableCodeSizeScope predictable( | 3250 PredictableCodeSizeScope predictable( |
| 3248 &assm, (kNumCases * 2 + 7) * Assembler::kInstrSize); | 3251 &assm, (kNumCases * 2 + 7) * Assembler::kInstrSize); |
| 3249 Label here; | 3252 Label here; |
| 3250 | 3253 |
| 3251 __ bal(&here); | 3254 __ bal(&here); |
| 3252 __ nop(); | 3255 __ nop(); |
| 3253 __ bind(&here); | 3256 __ bind(&here); |
| 3254 __ dsll(at, a0, 3); | 3257 __ dsll(at, a0, 3); |
| 3255 __ daddu(at, at, ra); | 3258 __ daddu(at, at, ra); |
| 3256 __ ld(at, MemOperand(at, 5 * Assembler::kInstrSize)); | 3259 __ ld(at, MemOperand(at, 5 * Assembler::kInstrSize)); |
| (...skipping 2100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5357 size_t nr_test_cases = sizeof(tc) / sizeof(TestCaseBalc); | 5360 size_t nr_test_cases = sizeof(tc) / sizeof(TestCaseBalc); |
| 5358 for (size_t i = 0; i < nr_test_cases; ++i) { | 5361 for (size_t i = 0; i < nr_test_cases; ++i) { |
| 5359 int64_t res = run_balc(tc[i].offset); | 5362 int64_t res = run_balc(tc[i].offset); |
| 5360 CHECK_EQ(tc[i].expected_res, res); | 5363 CHECK_EQ(tc[i].expected_res, res); |
| 5361 } | 5364 } |
| 5362 } | 5365 } |
| 5363 } | 5366 } |
| 5364 | 5367 |
| 5365 | 5368 |
| 5366 #undef __ | 5369 #undef __ |
| OLD | NEW |