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

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

Issue 194473005: A64: Rename k<Y>RegSize to k<Y>RegSizeInBits, and k<Y>RegSizeInBytes to k<Y>RegSize. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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
« no previous file with comments | « src/a64/simulator-a64.cc ('k') | test/cctest/test-utils-a64.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 7132 matching lines...) Expand 10 before | Expand all | Expand 10 after
7143 __ Mov(x0, reinterpret_cast<int64_t>(results_scvtf_x)); 7143 __ Mov(x0, reinterpret_cast<int64_t>(results_scvtf_x));
7144 __ Mov(x1, reinterpret_cast<int64_t>(results_ucvtf_x)); 7144 __ Mov(x1, reinterpret_cast<int64_t>(results_ucvtf_x));
7145 __ Mov(x2, reinterpret_cast<int64_t>(results_scvtf_w)); 7145 __ Mov(x2, reinterpret_cast<int64_t>(results_scvtf_w));
7146 __ Mov(x3, reinterpret_cast<int64_t>(results_ucvtf_w)); 7146 __ Mov(x3, reinterpret_cast<int64_t>(results_ucvtf_w));
7147 7147
7148 __ Mov(x10, s64); 7148 __ Mov(x10, s64);
7149 7149
7150 // Corrupt the top word, in case it is accidentally used during W-register 7150 // Corrupt the top word, in case it is accidentally used during W-register
7151 // conversions. 7151 // conversions.
7152 __ Mov(x11, 0x5555555555555555); 7152 __ Mov(x11, 0x5555555555555555);
7153 __ Bfi(x11, x10, 0, kWRegSize); 7153 __ Bfi(x11, x10, 0, kWRegSizeInBits);
7154 7154
7155 // Test integer conversions. 7155 // Test integer conversions.
7156 __ Scvtf(d0, x10); 7156 __ Scvtf(d0, x10);
7157 __ Ucvtf(d1, x10); 7157 __ Ucvtf(d1, x10);
7158 __ Scvtf(d2, w11); 7158 __ Scvtf(d2, w11);
7159 __ Ucvtf(d3, w11); 7159 __ Ucvtf(d3, w11);
7160 __ Str(d0, MemOperand(x0)); 7160 __ Str(d0, MemOperand(x0));
7161 __ Str(d1, MemOperand(x1)); 7161 __ Str(d1, MemOperand(x1));
7162 __ Str(d2, MemOperand(x2)); 7162 __ Str(d2, MemOperand(x2));
7163 __ Str(d3, MemOperand(x3)); 7163 __ Str(d3, MemOperand(x3));
7164 7164
7165 // Test all possible values of fbits. 7165 // Test all possible values of fbits.
7166 for (int fbits = 1; fbits <= 32; fbits++) { 7166 for (int fbits = 1; fbits <= 32; fbits++) {
7167 __ Scvtf(d0, x10, fbits); 7167 __ Scvtf(d0, x10, fbits);
7168 __ Ucvtf(d1, x10, fbits); 7168 __ Ucvtf(d1, x10, fbits);
7169 __ Scvtf(d2, w11, fbits); 7169 __ Scvtf(d2, w11, fbits);
7170 __ Ucvtf(d3, w11, fbits); 7170 __ Ucvtf(d3, w11, fbits);
7171 __ Str(d0, MemOperand(x0, fbits * kDRegSizeInBytes)); 7171 __ Str(d0, MemOperand(x0, fbits * kDRegSize));
7172 __ Str(d1, MemOperand(x1, fbits * kDRegSizeInBytes)); 7172 __ Str(d1, MemOperand(x1, fbits * kDRegSize));
7173 __ Str(d2, MemOperand(x2, fbits * kDRegSizeInBytes)); 7173 __ Str(d2, MemOperand(x2, fbits * kDRegSize));
7174 __ Str(d3, MemOperand(x3, fbits * kDRegSizeInBytes)); 7174 __ Str(d3, MemOperand(x3, fbits * kDRegSize));
7175 } 7175 }
7176 7176
7177 // Conversions from W registers can only handle fbits values <= 32, so just 7177 // Conversions from W registers can only handle fbits values <= 32, so just
7178 // test conversions from X registers for 32 < fbits <= 64. 7178 // test conversions from X registers for 32 < fbits <= 64.
7179 for (int fbits = 33; fbits <= 64; fbits++) { 7179 for (int fbits = 33; fbits <= 64; fbits++) {
7180 __ Scvtf(d0, x10, fbits); 7180 __ Scvtf(d0, x10, fbits);
7181 __ Ucvtf(d1, x10, fbits); 7181 __ Ucvtf(d1, x10, fbits);
7182 __ Str(d0, MemOperand(x0, fbits * kDRegSizeInBytes)); 7182 __ Str(d0, MemOperand(x0, fbits * kDRegSize));
7183 __ Str(d1, MemOperand(x1, fbits * kDRegSizeInBytes)); 7183 __ Str(d1, MemOperand(x1, fbits * kDRegSize));
7184 } 7184 }
7185 7185
7186 END(); 7186 END();
7187 RUN(); 7187 RUN();
7188 7188
7189 // Check the results. 7189 // Check the results.
7190 double expected_scvtf_base = rawbits_to_double(expected_scvtf_bits); 7190 double expected_scvtf_base = rawbits_to_double(expected_scvtf_bits);
7191 double expected_ucvtf_base = rawbits_to_double(expected_ucvtf_bits); 7191 double expected_ucvtf_base = rawbits_to_double(expected_ucvtf_bits);
7192 7192
7193 for (int fbits = 0; fbits <= 32; fbits++) { 7193 for (int fbits = 0; fbits <= 32; fbits++) {
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
7298 __ Mov(x0, reinterpret_cast<int64_t>(results_scvtf_x)); 7298 __ Mov(x0, reinterpret_cast<int64_t>(results_scvtf_x));
7299 __ Mov(x1, reinterpret_cast<int64_t>(results_ucvtf_x)); 7299 __ Mov(x1, reinterpret_cast<int64_t>(results_ucvtf_x));
7300 __ Mov(x2, reinterpret_cast<int64_t>(results_scvtf_w)); 7300 __ Mov(x2, reinterpret_cast<int64_t>(results_scvtf_w));
7301 __ Mov(x3, reinterpret_cast<int64_t>(results_ucvtf_w)); 7301 __ Mov(x3, reinterpret_cast<int64_t>(results_ucvtf_w));
7302 7302
7303 __ Mov(x10, s64); 7303 __ Mov(x10, s64);
7304 7304
7305 // Corrupt the top word, in case it is accidentally used during W-register 7305 // Corrupt the top word, in case it is accidentally used during W-register
7306 // conversions. 7306 // conversions.
7307 __ Mov(x11, 0x5555555555555555); 7307 __ Mov(x11, 0x5555555555555555);
7308 __ Bfi(x11, x10, 0, kWRegSize); 7308 __ Bfi(x11, x10, 0, kWRegSizeInBits);
7309 7309
7310 // Test integer conversions. 7310 // Test integer conversions.
7311 __ Scvtf(s0, x10); 7311 __ Scvtf(s0, x10);
7312 __ Ucvtf(s1, x10); 7312 __ Ucvtf(s1, x10);
7313 __ Scvtf(s2, w11); 7313 __ Scvtf(s2, w11);
7314 __ Ucvtf(s3, w11); 7314 __ Ucvtf(s3, w11);
7315 __ Str(s0, MemOperand(x0)); 7315 __ Str(s0, MemOperand(x0));
7316 __ Str(s1, MemOperand(x1)); 7316 __ Str(s1, MemOperand(x1));
7317 __ Str(s2, MemOperand(x2)); 7317 __ Str(s2, MemOperand(x2));
7318 __ Str(s3, MemOperand(x3)); 7318 __ Str(s3, MemOperand(x3));
7319 7319
7320 // Test all possible values of fbits. 7320 // Test all possible values of fbits.
7321 for (int fbits = 1; fbits <= 32; fbits++) { 7321 for (int fbits = 1; fbits <= 32; fbits++) {
7322 __ Scvtf(s0, x10, fbits); 7322 __ Scvtf(s0, x10, fbits);
7323 __ Ucvtf(s1, x10, fbits); 7323 __ Ucvtf(s1, x10, fbits);
7324 __ Scvtf(s2, w11, fbits); 7324 __ Scvtf(s2, w11, fbits);
7325 __ Ucvtf(s3, w11, fbits); 7325 __ Ucvtf(s3, w11, fbits);
7326 __ Str(s0, MemOperand(x0, fbits * kSRegSizeInBytes)); 7326 __ Str(s0, MemOperand(x0, fbits * kSRegSize));
7327 __ Str(s1, MemOperand(x1, fbits * kSRegSizeInBytes)); 7327 __ Str(s1, MemOperand(x1, fbits * kSRegSize));
7328 __ Str(s2, MemOperand(x2, fbits * kSRegSizeInBytes)); 7328 __ Str(s2, MemOperand(x2, fbits * kSRegSize));
7329 __ Str(s3, MemOperand(x3, fbits * kSRegSizeInBytes)); 7329 __ Str(s3, MemOperand(x3, fbits * kSRegSize));
7330 } 7330 }
7331 7331
7332 // Conversions from W registers can only handle fbits values <= 32, so just 7332 // Conversions from W registers can only handle fbits values <= 32, so just
7333 // test conversions from X registers for 32 < fbits <= 64. 7333 // test conversions from X registers for 32 < fbits <= 64.
7334 for (int fbits = 33; fbits <= 64; fbits++) { 7334 for (int fbits = 33; fbits <= 64; fbits++) {
7335 __ Scvtf(s0, x10, fbits); 7335 __ Scvtf(s0, x10, fbits);
7336 __ Ucvtf(s1, x10, fbits); 7336 __ Ucvtf(s1, x10, fbits);
7337 __ Str(s0, MemOperand(x0, fbits * kSRegSizeInBytes)); 7337 __ Str(s0, MemOperand(x0, fbits * kSRegSize));
7338 __ Str(s1, MemOperand(x1, fbits * kSRegSizeInBytes)); 7338 __ Str(s1, MemOperand(x1, fbits * kSRegSize));
7339 } 7339 }
7340 7340
7341 END(); 7341 END();
7342 RUN(); 7342 RUN();
7343 7343
7344 // Check the results. 7344 // Check the results.
7345 float expected_scvtf_base = rawbits_to_float(expected_scvtf_bits); 7345 float expected_scvtf_base = rawbits_to_float(expected_scvtf_bits);
7346 float expected_ucvtf_base = rawbits_to_float(expected_ucvtf_bits); 7346 float expected_ucvtf_base = rawbits_to_float(expected_ucvtf_bits);
7347 7347
7348 for (int fbits = 0; fbits <= 32; fbits++) { 7348 for (int fbits = 0; fbits <= 32; fbits++) {
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
7974 // x6 should match x1[31:0]:x0[63:32] 7974 // x6 should match x1[31:0]:x0[63:32]
7975 // w7 should match x1[15:0]:x0[63:48] 7975 // w7 should match x1[15:0]:x0[63:48]
7976 __ Poke(x1, 8); 7976 __ Poke(x1, 8);
7977 __ Poke(x0, 0); 7977 __ Poke(x0, 0);
7978 { 7978 {
7979 ASSERT(__ StackPointer().Is(csp)); 7979 ASSERT(__ StackPointer().Is(csp));
7980 __ Mov(x4, __ StackPointer()); 7980 __ Mov(x4, __ StackPointer());
7981 __ SetStackPointer(x4); 7981 __ SetStackPointer(x4);
7982 7982
7983 __ Poke(wzr, 0); // Clobber the space we're about to drop. 7983 __ Poke(wzr, 0); // Clobber the space we're about to drop.
7984 __ Drop(1, kWRegSizeInBytes); 7984 __ Drop(1, kWRegSize);
7985 __ Peek(x6, 0); 7985 __ Peek(x6, 0);
7986 __ Claim(1); 7986 __ Claim(1);
7987 __ Peek(w7, 10); 7987 __ Peek(w7, 10);
7988 __ Poke(x3, 28); 7988 __ Poke(x3, 28);
7989 __ Poke(xzr, 0); // Clobber the space we're about to drop. 7989 __ Poke(xzr, 0); // Clobber the space we're about to drop.
7990 __ Drop(1); 7990 __ Drop(1);
7991 __ Poke(x2, 12); 7991 __ Poke(x2, 12);
7992 __ Push(w0); 7992 __ Push(w0);
7993 7993
7994 __ Mov(csp, __ StackPointer()); 7994 __ Mov(csp, __ StackPointer());
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
8156 } 8156 }
8157 8157
8158 TEARDOWN(); 8158 TEARDOWN();
8159 } 8159 }
8160 8160
8161 8161
8162 TEST(push_pop_jssp_simple_32) { 8162 TEST(push_pop_jssp_simple_32) {
8163 INIT_V8(); 8163 INIT_V8();
8164 for (int claim = 0; claim <= 8; claim++) { 8164 for (int claim = 0; claim <= 8; claim++) {
8165 for (int count = 0; count <= 8; count++) { 8165 for (int count = 0; count <= 8; count++) {
8166 PushPopJsspSimpleHelper(count, claim, kWRegSize, 8166 PushPopJsspSimpleHelper(count, claim, kWRegSizeInBits,
8167 PushPopByFour, PushPopByFour); 8167 PushPopByFour, PushPopByFour);
8168 PushPopJsspSimpleHelper(count, claim, kWRegSize, 8168 PushPopJsspSimpleHelper(count, claim, kWRegSizeInBits,
8169 PushPopByFour, PushPopRegList); 8169 PushPopByFour, PushPopRegList);
8170 PushPopJsspSimpleHelper(count, claim, kWRegSize, 8170 PushPopJsspSimpleHelper(count, claim, kWRegSizeInBits,
8171 PushPopRegList, PushPopByFour); 8171 PushPopRegList, PushPopByFour);
8172 PushPopJsspSimpleHelper(count, claim, kWRegSize, 8172 PushPopJsspSimpleHelper(count, claim, kWRegSizeInBits,
8173 PushPopRegList, PushPopRegList); 8173 PushPopRegList, PushPopRegList);
8174 } 8174 }
8175 // Test with the maximum number of registers. 8175 // Test with the maximum number of registers.
8176 PushPopJsspSimpleHelper(kPushPopJsspMaxRegCount, claim, kWRegSize, 8176 PushPopJsspSimpleHelper(kPushPopJsspMaxRegCount, claim, kWRegSizeInBits,
8177 PushPopByFour, PushPopByFour); 8177 PushPopByFour, PushPopByFour);
8178 PushPopJsspSimpleHelper(kPushPopJsspMaxRegCount, claim, kWRegSize, 8178 PushPopJsspSimpleHelper(kPushPopJsspMaxRegCount, claim, kWRegSizeInBits,
8179 PushPopByFour, PushPopRegList); 8179 PushPopByFour, PushPopRegList);
8180 PushPopJsspSimpleHelper(kPushPopJsspMaxRegCount, claim, kWRegSize, 8180 PushPopJsspSimpleHelper(kPushPopJsspMaxRegCount, claim, kWRegSizeInBits,
8181 PushPopRegList, PushPopByFour); 8181 PushPopRegList, PushPopByFour);
8182 PushPopJsspSimpleHelper(kPushPopJsspMaxRegCount, claim, kWRegSize, 8182 PushPopJsspSimpleHelper(kPushPopJsspMaxRegCount, claim, kWRegSizeInBits,
8183 PushPopRegList, PushPopRegList); 8183 PushPopRegList, PushPopRegList);
8184 } 8184 }
8185 } 8185 }
8186 8186
8187 8187
8188 TEST(push_pop_jssp_simple_64) { 8188 TEST(push_pop_jssp_simple_64) {
8189 INIT_V8(); 8189 INIT_V8();
8190 for (int claim = 0; claim <= 8; claim++) { 8190 for (int claim = 0; claim <= 8; claim++) {
8191 for (int count = 0; count <= 8; count++) { 8191 for (int count = 0; count <= 8; count++) {
8192 PushPopJsspSimpleHelper(count, claim, kXRegSize, 8192 PushPopJsspSimpleHelper(count, claim, kXRegSizeInBits,
8193 PushPopByFour, PushPopByFour); 8193 PushPopByFour, PushPopByFour);
8194 PushPopJsspSimpleHelper(count, claim, kXRegSize, 8194 PushPopJsspSimpleHelper(count, claim, kXRegSizeInBits,
8195 PushPopByFour, PushPopRegList); 8195 PushPopByFour, PushPopRegList);
8196 PushPopJsspSimpleHelper(count, claim, kXRegSize, 8196 PushPopJsspSimpleHelper(count, claim, kXRegSizeInBits,
8197 PushPopRegList, PushPopByFour); 8197 PushPopRegList, PushPopByFour);
8198 PushPopJsspSimpleHelper(count, claim, kXRegSize, 8198 PushPopJsspSimpleHelper(count, claim, kXRegSizeInBits,
8199 PushPopRegList, PushPopRegList); 8199 PushPopRegList, PushPopRegList);
8200 } 8200 }
8201 // Test with the maximum number of registers. 8201 // Test with the maximum number of registers.
8202 PushPopJsspSimpleHelper(kPushPopJsspMaxRegCount, claim, kXRegSize, 8202 PushPopJsspSimpleHelper(kPushPopJsspMaxRegCount, claim, kXRegSizeInBits,
8203 PushPopByFour, PushPopByFour); 8203 PushPopByFour, PushPopByFour);
8204 PushPopJsspSimpleHelper(kPushPopJsspMaxRegCount, claim, kXRegSize, 8204 PushPopJsspSimpleHelper(kPushPopJsspMaxRegCount, claim, kXRegSizeInBits,
8205 PushPopByFour, PushPopRegList); 8205 PushPopByFour, PushPopRegList);
8206 PushPopJsspSimpleHelper(kPushPopJsspMaxRegCount, claim, kXRegSize, 8206 PushPopJsspSimpleHelper(kPushPopJsspMaxRegCount, claim, kXRegSizeInBits,
8207 PushPopRegList, PushPopByFour); 8207 PushPopRegList, PushPopByFour);
8208 PushPopJsspSimpleHelper(kPushPopJsspMaxRegCount, claim, kXRegSize, 8208 PushPopJsspSimpleHelper(kPushPopJsspMaxRegCount, claim, kXRegSizeInBits,
8209 PushPopRegList, PushPopRegList); 8209 PushPopRegList, PushPopRegList);
8210 } 8210 }
8211 } 8211 }
8212 8212
8213 8213
8214 // The maximum number of registers that can be used by the PushPopFPJssp* tests, 8214 // The maximum number of registers that can be used by the PushPopFPJssp* tests,
8215 // where a reg_count field is provided. 8215 // where a reg_count field is provided.
8216 static int const kPushPopFPJsspMaxRegCount = -1; 8216 static int const kPushPopFPJsspMaxRegCount = -1;
8217 8217
8218 // Test a simple push-pop pattern: 8218 // Test a simple push-pop pattern:
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
8339 } 8339 }
8340 8340
8341 TEARDOWN(); 8341 TEARDOWN();
8342 } 8342 }
8343 8343
8344 8344
8345 TEST(push_pop_fp_jssp_simple_32) { 8345 TEST(push_pop_fp_jssp_simple_32) {
8346 INIT_V8(); 8346 INIT_V8();
8347 for (int claim = 0; claim <= 8; claim++) { 8347 for (int claim = 0; claim <= 8; claim++) {
8348 for (int count = 0; count <= 8; count++) { 8348 for (int count = 0; count <= 8; count++) {
8349 PushPopFPJsspSimpleHelper(count, claim, kSRegSize, 8349 PushPopFPJsspSimpleHelper(count, claim, kSRegSizeInBits,
8350 PushPopByFour, PushPopByFour); 8350 PushPopByFour, PushPopByFour);
8351 PushPopFPJsspSimpleHelper(count, claim, kSRegSize, 8351 PushPopFPJsspSimpleHelper(count, claim, kSRegSizeInBits,
8352 PushPopByFour, PushPopRegList); 8352 PushPopByFour, PushPopRegList);
8353 PushPopFPJsspSimpleHelper(count, claim, kSRegSize, 8353 PushPopFPJsspSimpleHelper(count, claim, kSRegSizeInBits,
8354 PushPopRegList, PushPopByFour); 8354 PushPopRegList, PushPopByFour);
8355 PushPopFPJsspSimpleHelper(count, claim, kSRegSize, 8355 PushPopFPJsspSimpleHelper(count, claim, kSRegSizeInBits,
8356 PushPopRegList, PushPopRegList); 8356 PushPopRegList, PushPopRegList);
8357 } 8357 }
8358 // Test with the maximum number of registers. 8358 // Test with the maximum number of registers.
8359 PushPopFPJsspSimpleHelper(kPushPopFPJsspMaxRegCount, claim, kSRegSize, 8359 PushPopFPJsspSimpleHelper(kPushPopFPJsspMaxRegCount, claim, kSRegSizeInBits,
8360 PushPopByFour, PushPopByFour); 8360 PushPopByFour, PushPopByFour);
8361 PushPopFPJsspSimpleHelper(kPushPopFPJsspMaxRegCount, claim, kSRegSize, 8361 PushPopFPJsspSimpleHelper(kPushPopFPJsspMaxRegCount, claim, kSRegSizeInBits,
8362 PushPopByFour, PushPopRegList); 8362 PushPopByFour, PushPopRegList);
8363 PushPopFPJsspSimpleHelper(kPushPopFPJsspMaxRegCount, claim, kSRegSize, 8363 PushPopFPJsspSimpleHelper(kPushPopFPJsspMaxRegCount, claim, kSRegSizeInBits,
8364 PushPopRegList, PushPopByFour); 8364 PushPopRegList, PushPopByFour);
8365 PushPopFPJsspSimpleHelper(kPushPopFPJsspMaxRegCount, claim, kSRegSize, 8365 PushPopFPJsspSimpleHelper(kPushPopFPJsspMaxRegCount, claim, kSRegSizeInBits,
8366 PushPopRegList, PushPopRegList); 8366 PushPopRegList, PushPopRegList);
8367 } 8367 }
8368 } 8368 }
8369 8369
8370 8370
8371 TEST(push_pop_fp_jssp_simple_64) { 8371 TEST(push_pop_fp_jssp_simple_64) {
8372 INIT_V8(); 8372 INIT_V8();
8373 for (int claim = 0; claim <= 8; claim++) { 8373 for (int claim = 0; claim <= 8; claim++) {
8374 for (int count = 0; count <= 8; count++) { 8374 for (int count = 0; count <= 8; count++) {
8375 PushPopFPJsspSimpleHelper(count, claim, kDRegSize, 8375 PushPopFPJsspSimpleHelper(count, claim, kDRegSizeInBits,
8376 PushPopByFour, PushPopByFour); 8376 PushPopByFour, PushPopByFour);
8377 PushPopFPJsspSimpleHelper(count, claim, kDRegSize, 8377 PushPopFPJsspSimpleHelper(count, claim, kDRegSizeInBits,
8378 PushPopByFour, PushPopRegList); 8378 PushPopByFour, PushPopRegList);
8379 PushPopFPJsspSimpleHelper(count, claim, kDRegSize, 8379 PushPopFPJsspSimpleHelper(count, claim, kDRegSizeInBits,
8380 PushPopRegList, PushPopByFour); 8380 PushPopRegList, PushPopByFour);
8381 PushPopFPJsspSimpleHelper(count, claim, kDRegSize, 8381 PushPopFPJsspSimpleHelper(count, claim, kDRegSizeInBits,
8382 PushPopRegList, PushPopRegList); 8382 PushPopRegList, PushPopRegList);
8383 } 8383 }
8384 // Test with the maximum number of registers. 8384 // Test with the maximum number of registers.
8385 PushPopFPJsspSimpleHelper(kPushPopFPJsspMaxRegCount, claim, kDRegSize, 8385 PushPopFPJsspSimpleHelper(kPushPopFPJsspMaxRegCount, claim, kDRegSizeInBits,
8386 PushPopByFour, PushPopByFour); 8386 PushPopByFour, PushPopByFour);
8387 PushPopFPJsspSimpleHelper(kPushPopFPJsspMaxRegCount, claim, kDRegSize, 8387 PushPopFPJsspSimpleHelper(kPushPopFPJsspMaxRegCount, claim, kDRegSizeInBits,
8388 PushPopByFour, PushPopRegList); 8388 PushPopByFour, PushPopRegList);
8389 PushPopFPJsspSimpleHelper(kPushPopFPJsspMaxRegCount, claim, kDRegSize, 8389 PushPopFPJsspSimpleHelper(kPushPopFPJsspMaxRegCount, claim, kDRegSizeInBits,
8390 PushPopRegList, PushPopByFour); 8390 PushPopRegList, PushPopByFour);
8391 PushPopFPJsspSimpleHelper(kPushPopFPJsspMaxRegCount, claim, kDRegSize, 8391 PushPopFPJsspSimpleHelper(kPushPopFPJsspMaxRegCount, claim, kDRegSizeInBits,
8392 PushPopRegList, PushPopRegList); 8392 PushPopRegList, PushPopRegList);
8393 } 8393 }
8394 } 8394 }
8395 8395
8396 8396
8397 // Push and pop data using an overlapping combination of Push/Pop and 8397 // Push and pop data using an overlapping combination of Push/Pop and
8398 // RegList-based methods. 8398 // RegList-based methods.
8399 static void PushPopJsspMixedMethodsHelper(int claim, int reg_size) { 8399 static void PushPopJsspMixedMethodsHelper(int claim, int reg_size) {
8400 SETUP(); 8400 SETUP();
8401 8401
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
8479 ASSERT_EQUAL_64(literal_base * 1, x[5]); 8479 ASSERT_EQUAL_64(literal_base * 1, x[5]);
8480 ASSERT_EQUAL_64(literal_base * 2, x[4]); 8480 ASSERT_EQUAL_64(literal_base * 2, x[4]);
8481 8481
8482 TEARDOWN(); 8482 TEARDOWN();
8483 } 8483 }
8484 8484
8485 8485
8486 TEST(push_pop_jssp_mixed_methods_64) { 8486 TEST(push_pop_jssp_mixed_methods_64) {
8487 INIT_V8(); 8487 INIT_V8();
8488 for (int claim = 0; claim <= 8; claim++) { 8488 for (int claim = 0; claim <= 8; claim++) {
8489 PushPopJsspMixedMethodsHelper(claim, kXRegSize); 8489 PushPopJsspMixedMethodsHelper(claim, kXRegSizeInBits);
8490 } 8490 }
8491 } 8491 }
8492 8492
8493 8493
8494 TEST(push_pop_jssp_mixed_methods_32) { 8494 TEST(push_pop_jssp_mixed_methods_32) {
8495 INIT_V8(); 8495 INIT_V8();
8496 for (int claim = 0; claim <= 8; claim++) { 8496 for (int claim = 0; claim <= 8; claim++) {
8497 PushPopJsspMixedMethodsHelper(claim, kWRegSize); 8497 PushPopJsspMixedMethodsHelper(claim, kWRegSizeInBits);
8498 } 8498 }
8499 } 8499 }
8500 8500
8501 8501
8502 // Push and pop data using overlapping X- and W-sized quantities. 8502 // Push and pop data using overlapping X- and W-sized quantities.
8503 static void PushPopJsspWXOverlapHelper(int reg_count, int claim) { 8503 static void PushPopJsspWXOverlapHelper(int reg_count, int claim) {
8504 // This test emits rather a lot of code. 8504 // This test emits rather a lot of code.
8505 SETUP_SIZE(BUF_SIZE * 2); 8505 SETUP_SIZE(BUF_SIZE * 2);
8506 8506
8507 // Work out which registers to use, based on reg_size. 8507 // Work out which registers to use, based on reg_size.
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
8626 } else { 8626 } else {
8627 stack[active_w_slots++] = literal_base_hi * i; 8627 stack[active_w_slots++] = literal_base_hi * i;
8628 stack[active_w_slots++] = literal_base_lo * i; 8628 stack[active_w_slots++] = literal_base_lo * i;
8629 } 8629 }
8630 } 8630 }
8631 } 8631 }
8632 } 8632 }
8633 // Because we were pushing several registers at a time, we probably pushed 8633 // Because we were pushing several registers at a time, we probably pushed
8634 // more than we needed to. 8634 // more than we needed to.
8635 if (active_w_slots > requested_w_slots) { 8635 if (active_w_slots > requested_w_slots) {
8636 __ Drop(active_w_slots - requested_w_slots, kWRegSizeInBytes); 8636 __ Drop(active_w_slots - requested_w_slots, kWRegSize);
8637 // Bump the number of active W-sized slots back to where it should be, 8637 // Bump the number of active W-sized slots back to where it should be,
8638 // and fill the empty space with a dummy value. 8638 // and fill the empty space with a dummy value.
8639 do { 8639 do {
8640 stack[active_w_slots--] = 0xdeadbeef; 8640 stack[active_w_slots--] = 0xdeadbeef;
8641 } while (active_w_slots > requested_w_slots); 8641 } while (active_w_slots > requested_w_slots);
8642 } 8642 }
8643 8643
8644 // ---- Pop ---- 8644 // ---- Pop ----
8645 8645
8646 Clobber(&masm, list); 8646 Clobber(&masm, list);
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
8841 __ Mov(w4, 0x12340004); 8841 __ Mov(w4, 0x12340004);
8842 __ Mov(w5, 0x12340005); 8842 __ Mov(w5, 0x12340005);
8843 __ Mov(w6, 0x12340006); 8843 __ Mov(w6, 0x12340006);
8844 __ Fmov(d0, 123400.0); 8844 __ Fmov(d0, 123400.0);
8845 __ Fmov(d1, 123401.0); 8845 __ Fmov(d1, 123401.0);
8846 __ Fmov(s2, 123402.0); 8846 __ Fmov(s2, 123402.0);
8847 8847
8848 // Actually push them. 8848 // Actually push them.
8849 queue.PushQueued(); 8849 queue.PushQueued();
8850 8850
8851 Clobber(&masm, CPURegList(CPURegister::kRegister, kXRegSize, 0, 6)); 8851 Clobber(&masm, CPURegList(CPURegister::kRegister, kXRegSizeInBits, 0, 6));
8852 Clobber(&masm, CPURegList(CPURegister::kFPRegister, kDRegSize, 0, 2)); 8852 Clobber(&masm, CPURegList(CPURegister::kFPRegister, kDRegSizeInBits, 0, 2));
8853 8853
8854 // Pop them conventionally. 8854 // Pop them conventionally.
8855 __ Pop(s2); 8855 __ Pop(s2);
8856 __ Pop(d1, d0); 8856 __ Pop(d1, d0);
8857 __ Pop(w6, w5, w4); 8857 __ Pop(w6, w5, w4);
8858 __ Pop(x3, x2, x1, x0); 8858 __ Pop(x3, x2, x1, x0);
8859 8859
8860 __ Mov(csp, __ StackPointer()); 8860 __ Mov(csp, __ StackPointer());
8861 __ SetStackPointer(csp); 8861 __ SetStackPointer(csp);
8862 8862
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
8919 8919
8920 queue.Queue(w6); 8920 queue.Queue(w6);
8921 queue.Queue(w5); 8921 queue.Queue(w5);
8922 queue.Queue(w4); 8922 queue.Queue(w4);
8923 8923
8924 queue.Queue(x3); 8924 queue.Queue(x3);
8925 queue.Queue(x2); 8925 queue.Queue(x2);
8926 queue.Queue(x1); 8926 queue.Queue(x1);
8927 queue.Queue(x0); 8927 queue.Queue(x0);
8928 8928
8929 Clobber(&masm, CPURegList(CPURegister::kRegister, kXRegSize, 0, 6)); 8929 Clobber(&masm, CPURegList(CPURegister::kRegister, kXRegSizeInBits, 0, 6));
8930 Clobber(&masm, CPURegList(CPURegister::kFPRegister, kDRegSize, 0, 2)); 8930 Clobber(&masm, CPURegList(CPURegister::kFPRegister, kDRegSizeInBits, 0, 2));
8931 8931
8932 // Actually pop them. 8932 // Actually pop them.
8933 queue.PopQueued(); 8933 queue.PopQueued();
8934 8934
8935 __ Mov(csp, __ StackPointer()); 8935 __ Mov(csp, __ StackPointer());
8936 __ SetStackPointer(csp); 8936 __ SetStackPointer(csp);
8937 8937
8938 END(); 8938 END();
8939 8939
8940 RUN(); 8940 RUN();
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
9412 } 9412 }
9413 9413
9414 9414
9415 TEST(cpureglist_utils_empty) { 9415 TEST(cpureglist_utils_empty) {
9416 // This test doesn't generate any code, but it verifies the behaviour of 9416 // This test doesn't generate any code, but it verifies the behaviour of
9417 // the CPURegList utility methods. 9417 // the CPURegList utility methods.
9418 9418
9419 // Test an empty list. 9419 // Test an empty list.
9420 // Empty lists can have type and size properties. Check that we can create 9420 // Empty lists can have type and size properties. Check that we can create
9421 // them, and that they are empty. 9421 // them, and that they are empty.
9422 CPURegList reg32(CPURegister::kRegister, kWRegSize, 0); 9422 CPURegList reg32(CPURegister::kRegister, kWRegSizeInBits, 0);
9423 CPURegList reg64(CPURegister::kRegister, kXRegSize, 0); 9423 CPURegList reg64(CPURegister::kRegister, kXRegSizeInBits, 0);
9424 CPURegList fpreg32(CPURegister::kFPRegister, kSRegSize, 0); 9424 CPURegList fpreg32(CPURegister::kFPRegister, kSRegSizeInBits, 0);
9425 CPURegList fpreg64(CPURegister::kFPRegister, kDRegSize, 0); 9425 CPURegList fpreg64(CPURegister::kFPRegister, kDRegSizeInBits, 0);
9426 9426
9427 CHECK(reg32.IsEmpty()); 9427 CHECK(reg32.IsEmpty());
9428 CHECK(reg64.IsEmpty()); 9428 CHECK(reg64.IsEmpty());
9429 CHECK(fpreg32.IsEmpty()); 9429 CHECK(fpreg32.IsEmpty());
9430 CHECK(fpreg64.IsEmpty()); 9430 CHECK(fpreg64.IsEmpty());
9431 9431
9432 CHECK(reg32.PopLowestIndex().IsNone()); 9432 CHECK(reg32.PopLowestIndex().IsNone());
9433 CHECK(reg64.PopLowestIndex().IsNone()); 9433 CHECK(reg64.PopLowestIndex().IsNone());
9434 CHECK(fpreg32.PopLowestIndex().IsNone()); 9434 CHECK(fpreg32.PopLowestIndex().IsNone());
9435 CHECK(fpreg64.PopLowestIndex().IsNone()); 9435 CHECK(fpreg64.PopLowestIndex().IsNone());
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
10023 AbsHelperX(-42); 10023 AbsHelperX(-42);
10024 AbsHelperX(kXMinInt); 10024 AbsHelperX(kXMinInt);
10025 AbsHelperX(kXMaxInt); 10025 AbsHelperX(kXMaxInt);
10026 10026
10027 AbsHelperW(0); 10027 AbsHelperW(0);
10028 AbsHelperW(42); 10028 AbsHelperW(42);
10029 AbsHelperW(-42); 10029 AbsHelperW(-42);
10030 AbsHelperW(kWMinInt); 10030 AbsHelperW(kWMinInt);
10031 AbsHelperW(kWMaxInt); 10031 AbsHelperW(kWMaxInt);
10032 } 10032 }
OLDNEW
« no previous file with comments | « src/a64/simulator-a64.cc ('k') | test/cctest/test-utils-a64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698