OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 __ ori(v0, v0, 0x8a00); // 0x00009a30 | 212 __ ori(v0, v0, 0x8a00); // 0x00009a30 |
213 __ xori(v0, v0, 0x83cc); // 0x000019fc | 213 __ xori(v0, v0, 0x83cc); // 0x000019fc |
214 __ Branch(&error, ne, v0, Operand(0x000019fc)); | 214 __ Branch(&error, ne, v0, Operand(0x000019fc)); |
215 __ nop(); | 215 __ nop(); |
216 __ lui(v1, 0x8123); // 0x81230000 | 216 __ lui(v1, 0x8123); // 0x81230000 |
217 __ Branch(&error, ne, v1, Operand(0x81230000)); | 217 __ Branch(&error, ne, v1, Operand(0x81230000)); |
218 __ nop(); | 218 __ nop(); |
219 | 219 |
220 // Bit twiddling instructions & conditional moves. | 220 // Bit twiddling instructions & conditional moves. |
221 // Uses t0-t7 as set above. | 221 // Uses t0-t7 as set above. |
222 __ clz(v0, t0); // 29 | 222 __ Clz(v0, t0); // 29 |
223 __ clz(v1, t1); // 19 | 223 __ Clz(v1, t1); // 19 |
224 __ addu(v0, v0, v1); // 48 | 224 __ addu(v0, v0, v1); // 48 |
225 __ clz(v1, t2); // 3 | 225 __ Clz(v1, t2); // 3 |
226 __ addu(v0, v0, v1); // 51 | 226 __ addu(v0, v0, v1); // 51 |
227 __ clz(v1, t7); // 0 | 227 __ Clz(v1, t7); // 0 |
228 __ addu(v0, v0, v1); // 51 | 228 __ addu(v0, v0, v1); // 51 |
229 __ Branch(&error, ne, v0, Operand(51)); | 229 __ Branch(&error, ne, v0, Operand(51)); |
230 __ movn(a0, t3, t0); // Move a0<-t3 (t0 is NOT 0). | 230 __ Movn(a0, t3, t0); // Move a0<-t3 (t0 is NOT 0). |
231 __ Ins(a0, t1, 12, 8); // 0x7ff34fff | 231 __ Ins(a0, t1, 12, 8); // 0x7ff34fff |
232 __ Branch(&error, ne, a0, Operand(0x7ff34fff)); | 232 __ Branch(&error, ne, a0, Operand(0x7ff34fff)); |
233 __ movz(a0, t6, t7); // a0 not updated (t7 is NOT 0). | 233 __ Movz(a0, t6, t7); // a0 not updated (t7 is NOT 0). |
234 __ Ext(a1, a0, 8, 12); // 0x34f | 234 __ Ext(a1, a0, 8, 12); // 0x34f |
235 __ Branch(&error, ne, a1, Operand(0x34f)); | 235 __ Branch(&error, ne, a1, Operand(0x34f)); |
236 __ movz(a0, t6, v1); // a0<-t6, v0 is 0, from 8 instr back. | 236 __ Movz(a0, t6, v1); // a0<-t6, v0 is 0, from 8 instr back. |
237 __ Branch(&error, ne, a0, Operand(t6)); | 237 __ Branch(&error, ne, a0, Operand(t6)); |
238 | 238 |
239 // Everything was correctly executed. Load the expected result. | 239 // Everything was correctly executed. Load the expected result. |
240 __ li(v0, 0x31415926); | 240 __ li(v0, 0x31415926); |
241 __ b(&exit); | 241 __ b(&exit); |
242 __ nop(); | 242 __ nop(); |
243 | 243 |
244 __ bind(&error); | 244 __ bind(&error); |
245 // Got an error. Return a wrong result. | 245 // Got an error. Return a wrong result. |
246 __ li(v0, 666); | 246 __ li(v0, 666); |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, a)) ); | 572 __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, a)) ); |
573 __ ldc1(f6, MemOperand(a0, OFFSET_OF(T, b)) ); | 573 __ ldc1(f6, MemOperand(a0, OFFSET_OF(T, b)) ); |
574 __ c(UN, D, f4, f6); | 574 __ c(UN, D, f4, f6); |
575 __ bc1f(&neither_is_nan); | 575 __ bc1f(&neither_is_nan); |
576 __ nop(); | 576 __ nop(); |
577 __ sw(zero_reg, MemOperand(a0, OFFSET_OF(T, result)) ); | 577 __ sw(zero_reg, MemOperand(a0, OFFSET_OF(T, result)) ); |
578 __ Branch(&outa_here); | 578 __ Branch(&outa_here); |
579 | 579 |
580 __ bind(&neither_is_nan); | 580 __ bind(&neither_is_nan); |
581 | 581 |
582 __ c(OLT, D, f6, f4, 2); | 582 if (kArchVariant == kLoongson) { |
583 __ bc1t(&less_than, 2); | 583 __ c(OLT, D, f6, f4); |
| 584 __ bc1t(&less_than); |
| 585 } else { |
| 586 __ c(OLT, D, f6, f4, 2); |
| 587 __ bc1t(&less_than, 2); |
| 588 } |
584 __ nop(); | 589 __ nop(); |
585 __ sw(zero_reg, MemOperand(a0, OFFSET_OF(T, result)) ); | 590 __ sw(zero_reg, MemOperand(a0, OFFSET_OF(T, result)) ); |
586 __ Branch(&outa_here); | 591 __ Branch(&outa_here); |
587 | 592 |
588 __ bind(&less_than); | 593 __ bind(&less_than); |
589 __ Addu(t0, zero_reg, Operand(1)); | 594 __ Addu(t0, zero_reg, Operand(1)); |
590 __ sw(t0, MemOperand(a0, OFFSET_OF(T, result)) ); // Set true. | 595 __ sw(t0, MemOperand(a0, OFFSET_OF(T, result)) ); // Set true. |
591 | 596 |
592 | 597 |
593 // This test-case should have additional tests. | 598 // This test-case should have additional tests. |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
767 int32_t long_hi; | 772 int32_t long_hi; |
768 int32_t long_lo; | 773 int32_t long_lo; |
769 int32_t b_long_hi; | 774 int32_t b_long_hi; |
770 int32_t b_long_lo; | 775 int32_t b_long_lo; |
771 } T; | 776 } T; |
772 T t; | 777 T t; |
773 | 778 |
774 Assembler assm(Isolate::Current(), NULL, 0); | 779 Assembler assm(Isolate::Current(), NULL, 0); |
775 Label L, C; | 780 Label L, C; |
776 | 781 |
777 if (CpuFeatures::IsSupported(FPU) && mips32r2) { | 782 if (CpuFeatures::IsSupported(FPU) && kArchVariant == kMips32r2) { |
778 CpuFeatures::Scope scope(FPU); | 783 CpuFeatures::Scope scope(FPU); |
779 | 784 |
780 // Load all structure elements to registers. | 785 // Load all structure elements to registers. |
781 __ ldc1(f0, MemOperand(a0, OFFSET_OF(T, a))); | 786 __ ldc1(f0, MemOperand(a0, OFFSET_OF(T, a))); |
782 | 787 |
783 // Save the raw bits of the double. | 788 // Save the raw bits of the double. |
784 __ mfc1(t0, f0); | 789 __ mfc1(t0, f0); |
785 __ mfc1(t1, f1); | 790 __ mfc1(t1, f1); |
786 __ sw(t0, MemOperand(a0, OFFSET_OF(T, dbl_mant))); | 791 __ sw(t0, MemOperand(a0, OFFSET_OF(T, dbl_mant))); |
787 __ sw(t1, MemOperand(a0, OFFSET_OF(T, dbl_exp))); | 792 __ sw(t1, MemOperand(a0, OFFSET_OF(T, dbl_exp))); |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1269 Label target; | 1274 Label target; |
1270 __ beq(v0, v1, &target); | 1275 __ beq(v0, v1, &target); |
1271 __ nop(); | 1276 __ nop(); |
1272 __ bne(v0, v1, &target); | 1277 __ bne(v0, v1, &target); |
1273 __ nop(); | 1278 __ nop(); |
1274 __ bind(&target); | 1279 __ bind(&target); |
1275 __ nop(); | 1280 __ nop(); |
1276 } | 1281 } |
1277 | 1282 |
1278 #undef __ | 1283 #undef __ |
OLD | NEW |