Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: src/mips/lithium-mips.cc

Issue 23694014: MIPS: Support for DoubleToIStub (truncating). (Closed) Base URL: https://github.com/v8/v8.git@gbl
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1826 matching lines...) Expand 10 before | Expand all | Expand 10 after
1837 ASSERT(to.IsInteger32()); 1837 ASSERT(to.IsInteger32());
1838 LOperand* value = NULL; 1838 LOperand* value = NULL;
1839 LInstruction* res = NULL; 1839 LInstruction* res = NULL;
1840 HValue* val = instr->value(); 1840 HValue* val = instr->value();
1841 if (val->type().IsSmi() || val->representation().IsSmi()) { 1841 if (val->type().IsSmi() || val->representation().IsSmi()) {
1842 value = UseRegisterAtStart(val); 1842 value = UseRegisterAtStart(val);
1843 res = DefineAsRegister(new(zone()) LSmiUntag(value, false)); 1843 res = DefineAsRegister(new(zone()) LSmiUntag(value, false));
1844 } else { 1844 } else {
1845 value = UseRegister(val); 1845 value = UseRegister(val);
1846 LOperand* temp1 = TempRegister(); 1846 LOperand* temp1 = TempRegister();
1847 LOperand* temp2 = instr->CanTruncateToInt32() ? TempRegister() 1847 LOperand* temp2 = FixedTemp(f22);
1848 : NULL;
1849 LOperand* temp3 = FixedTemp(f22);
1850 res = DefineSameAsFirst(new(zone()) LTaggedToI(value, 1848 res = DefineSameAsFirst(new(zone()) LTaggedToI(value,
1851 temp1, 1849 temp1,
1852 temp2, 1850 temp2));
1853 temp3));
1854 res = AssignEnvironment(res); 1851 res = AssignEnvironment(res);
1855 } 1852 }
1856 return res; 1853 return res;
1857 } 1854 }
1858 } else if (from.IsDouble()) { 1855 } else if (from.IsDouble()) {
1859 if (to.IsTagged()) { 1856 if (to.IsTagged()) {
1860 info()->MarkAsDeferredCalling(); 1857 info()->MarkAsDeferredCalling();
1861 LOperand* value = UseRegister(instr->value()); 1858 LOperand* value = UseRegister(instr->value());
1862 LOperand* temp1 = TempRegister(); 1859 LOperand* temp1 = TempRegister();
1863 LOperand* temp2 = TempRegister(); 1860 LOperand* temp2 = TempRegister();
1864 1861
1865 // Make sure that the temp and result_temp registers are 1862 // Make sure that the temp and result_temp registers are
1866 // different. 1863 // different.
1867 LUnallocated* result_temp = TempRegister(); 1864 LUnallocated* result_temp = TempRegister();
1868 LNumberTagD* result = new(zone()) LNumberTagD(value, temp1, temp2); 1865 LNumberTagD* result = new(zone()) LNumberTagD(value, temp1, temp2);
1869 Define(result, result_temp); 1866 Define(result, result_temp);
1870 return AssignPointerMap(result); 1867 return AssignPointerMap(result);
1871 } else if (to.IsSmi()) { 1868 } else if (to.IsSmi()) {
1872 LOperand* value = UseRegister(instr->value()); 1869 LOperand* value = UseRegister(instr->value());
1873 return AssignEnvironment(DefineAsRegister(new(zone()) LDoubleToSmi(value, 1870 return AssignEnvironment(
1874 TempRegister(), TempRegister()))); 1871 DefineAsRegister(new(zone()) LDoubleToSmi(value)));
1875 } else { 1872 } else {
1876 ASSERT(to.IsInteger32()); 1873 ASSERT(to.IsInteger32());
1877 LOperand* value = UseRegister(instr->value()); 1874 LOperand* value = UseRegister(instr->value());
1878 LOperand* temp1 = TempRegister(); 1875 LDoubleToI* res = new(zone()) LDoubleToI(value);
1879 LOperand* temp2 = instr->CanTruncateToInt32() ? TempRegister() : NULL;
1880 LDoubleToI* res = new(zone()) LDoubleToI(value, temp1, temp2);
1881 return AssignEnvironment(DefineAsRegister(res)); 1876 return AssignEnvironment(DefineAsRegister(res));
1882 } 1877 }
1883 } else if (from.IsInteger32()) { 1878 } else if (from.IsInteger32()) {
1884 info()->MarkAsDeferredCalling(); 1879 info()->MarkAsDeferredCalling();
1885 if (to.IsTagged()) { 1880 if (to.IsTagged()) {
1886 HValue* val = instr->value(); 1881 HValue* val = instr->value();
1887 LOperand* value = UseRegisterAtStart(val); 1882 LOperand* value = UseRegisterAtStart(val);
1888 if (val->CheckFlag(HInstruction::kUint32)) { 1883 if (val->CheckFlag(HInstruction::kUint32)) {
1889 LNumberTagU* result = new(zone()) LNumberTagU(value); 1884 LNumberTagU* result = new(zone()) LNumberTagU(value);
1890 return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result))); 1885 return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result)));
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
2509 2504
2510 2505
2511 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2506 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2512 LOperand* object = UseRegister(instr->object()); 2507 LOperand* object = UseRegister(instr->object());
2513 LOperand* index = UseRegister(instr->index()); 2508 LOperand* index = UseRegister(instr->index());
2514 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); 2509 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index));
2515 } 2510 }
2516 2511
2517 2512
2518 } } // namespace v8::internal 2513 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698