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

Side by Side Diff: test/cctest/test-assembler-arm.cc

Issue 19560003: [v8-dev] ARM: Make double registers low/high safe (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 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 | Annotate | Revision Log
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 1031 matching lines...) Expand 10 before | Expand all | Expand 10 after
1042 typedef struct { 1042 typedef struct {
1043 double a; 1043 double a;
1044 double b; 1044 double b;
1045 double c; 1045 double c;
1046 double x; 1046 double x;
1047 double y; 1047 double y;
1048 double z; 1048 double z;
1049 double i; 1049 double i;
1050 double j; 1050 double j;
1051 double k; 1051 double k;
1052 uint32_t low;
1053 uint32_t high;
1052 } T; 1054 } T;
1053 T t; 1055 T t;
1054 1056
1055 // Create a function that accepts &t, and loads, manipulates, and stores 1057 // Create a function that accepts &t, and loads, manipulates, and stores
1056 // the doubles and floats. 1058 // the doubles and floats.
1057 Assembler assm(isolate, NULL, 0); 1059 Assembler assm(isolate, NULL, 0);
1058 Label L, C; 1060 Label L, C;
1059 1061
1060 1062
1061 if (CpuFeatures::IsSupported(VFP3)) { 1063 if (CpuFeatures::IsSupported(VFP3)) {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
1106 1108
1107 // Move constants into d20, d21, d22 and store into i, j, k. 1109 // Move constants into d20, d21, d22 and store into i, j, k.
1108 __ vmov(d20, 14.7610017472335499); 1110 __ vmov(d20, 14.7610017472335499);
1109 __ vmov(d21, 16.0); 1111 __ vmov(d21, 16.0);
1110 __ mov(r1, Operand(372106121)); 1112 __ mov(r1, Operand(372106121));
1111 __ mov(r2, Operand(1079146608)); 1113 __ mov(r2, Operand(1079146608));
1112 __ vmov(d22, VmovIndexLo, r1); 1114 __ vmov(d22, VmovIndexLo, r1);
1113 __ vmov(d22, VmovIndexHi, r2); 1115 __ vmov(d22, VmovIndexHi, r2);
1114 __ add(r4, r0, Operand(OFFSET_OF(T, i))); 1116 __ add(r4, r0, Operand(OFFSET_OF(T, i)));
1115 __ vstm(ia_w, r4, d20, d22); 1117 __ vstm(ia_w, r4, d20, d22);
1118 // Move d22 into low and high.
1119 __ vmov(r4, VmovIndexLo, d22);
1120 __ str(r4, MemOperand(r0, OFFSET_OF(T, low)));
1121 __ vmov(r4, VmovIndexHi, d22);
1122 __ str(r4, MemOperand(r0, OFFSET_OF(T, high)));
1116 1123
1117 __ ldm(ia_w, sp, r4.bit() | pc.bit()); 1124 __ ldm(ia_w, sp, r4.bit() | pc.bit());
1118 1125
1119 CodeDesc desc; 1126 CodeDesc desc;
1120 assm.GetCode(&desc); 1127 assm.GetCode(&desc);
1121 Object* code = isolate->heap()->CreateCode( 1128 Object* code = isolate->heap()->CreateCode(
1122 desc, 1129 desc,
1123 Code::ComputeFlags(Code::STUB), 1130 Code::ComputeFlags(Code::STUB),
1124 Handle<Code>())->ToObjectChecked(); 1131 Handle<Code>())->ToObjectChecked();
1125 CHECK(code->IsCode()); 1132 CHECK(code->IsCode());
(...skipping 11 matching lines...) Expand all
1137 USE(dummy); 1144 USE(dummy);
1138 CHECK_EQ(14.7610017472335499, t.a); 1145 CHECK_EQ(14.7610017472335499, t.a);
1139 CHECK_EQ(3.84200491244266251, t.b); 1146 CHECK_EQ(3.84200491244266251, t.b);
1140 CHECK_EQ(73.8818412254460241, t.c); 1147 CHECK_EQ(73.8818412254460241, t.c);
1141 CHECK_EQ(2.75, t.x); 1148 CHECK_EQ(2.75, t.x);
1142 CHECK_EQ(1.5, t.y); 1149 CHECK_EQ(1.5, t.y);
1143 CHECK_EQ(17.0, t.z); 1150 CHECK_EQ(17.0, t.z);
1144 CHECK_EQ(14.7610017472335499, t.i); 1151 CHECK_EQ(14.7610017472335499, t.i);
1145 CHECK_EQ(16.0, t.j); 1152 CHECK_EQ(16.0, t.j);
1146 CHECK_EQ(73.8818412254460241, t.k); 1153 CHECK_EQ(73.8818412254460241, t.k);
1154 CHECK_EQ(372106121, t.low);
1155 CHECK_EQ(1079146608, t.high);
1147 } 1156 }
1148 } 1157 }
1149 1158
1150 1159
1151 TEST(14) { 1160 TEST(14) {
1152 // Test the VFP Canonicalized Nan mode. 1161 // Test the VFP Canonicalized Nan mode.
1153 CcTest::InitializeVM(); 1162 CcTest::InitializeVM();
1154 Isolate* isolate = Isolate::Current(); 1163 Isolate* isolate = Isolate::Current();
1155 HandleScope scope(isolate); 1164 HandleScope scope(isolate);
1156 1165
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
1403 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); 1412 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0);
1404 USE(dummy); 1413 USE(dummy);
1405 CHECK_EQ(0x12130304, t.dst0); 1414 CHECK_EQ(0x12130304, t.dst0);
1406 CHECK_EQ(0x01021213, t.dst1); 1415 CHECK_EQ(0x01021213, t.dst1);
1407 CHECK_EQ(0x00010003, t.dst2); 1416 CHECK_EQ(0x00010003, t.dst2);
1408 CHECK_EQ(0x00000003, t.dst3); 1417 CHECK_EQ(0x00000003, t.dst3);
1409 CHECK_EQ(0x11121313, t.dst4); 1418 CHECK_EQ(0x11121313, t.dst4);
1410 } 1419 }
1411 1420
1412 #undef __ 1421 #undef __
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698