Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 7135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7146 | 7146 |
| 7147 RUN(); | 7147 RUN(); |
| 7148 | 7148 |
| 7149 CHECK_EQUAL_64(0, x0); | 7149 CHECK_EQUAL_64(0, x0); |
| 7150 CHECK_EQUAL_64(0, x1); | 7150 CHECK_EQUAL_64(0, x1); |
| 7151 CHECK_EQUAL_64(0, x2); | 7151 CHECK_EQUAL_64(0, x2); |
| 7152 | 7152 |
| 7153 TEARDOWN(); | 7153 TEARDOWN(); |
| 7154 } | 7154 } |
| 7155 | 7155 |
| 7156 TEST(preshift_immediates) { | |
| 7157 INIT_V8(); | |
| 7158 SETUP(); | |
| 7159 | |
| 7160 START(); | |
| 7161 // Test operations involving immediates that could be generated using a | |
| 7162 // pre-shifted encodable immediate followed by a post-shift applied to | |
| 7163 // the arithmetic or logical operation. | |
| 7164 | |
| 7165 // Save csp. | |
| 7166 __ Mov(x29, csp); | |
| 7167 | |
| 7168 // Set the registers to known values. | |
| 7169 __ Mov(x0, 0x1000); | |
| 7170 __ Mov(csp, 0x1000); | |
| 7171 | |
| 7172 // Arithmetic ops. | |
| 7173 __ Add(x1, x0, 0x1f7de); | |
|
Tobias Tebbi
2017/06/08 10:27:51
How are these constants encodable with a shift? Th
martyn.capewell
2017/06/08 10:37:17
In order to improve "encodability", ones are inser
| |
| 7174 __ Add(w2, w0, 0xffffff1); | |
| 7175 __ Adds(x3, x0, 0x18001); | |
| 7176 __ Adds(w4, w0, 0xffffff1); | |
| 7177 __ Sub(x5, x0, 0x1f7de); | |
| 7178 __ Sub(w6, w0, 0xffffff1); | |
| 7179 __ Subs(x7, x0, 0x18001); | |
| 7180 __ Subs(w8, w0, 0xffffff1); | |
| 7181 | |
| 7182 // Logical ops. | |
| 7183 __ And(x9, x0, 0x1f7de); | |
| 7184 __ Orr(w10, w0, 0xffffff1); | |
| 7185 __ Eor(x11, x0, 0x18001); | |
| 7186 | |
| 7187 // Ops using the stack pointer. | |
| 7188 __ Add(csp, csp, 0x1f7f0); | |
| 7189 __ Mov(x12, csp); | |
| 7190 __ Mov(csp, 0x1000); | |
| 7191 | |
| 7192 __ Adds(x13, csp, 0x1f7f0); | |
| 7193 | |
| 7194 __ Orr(csp, x0, 0x1f7f0); | |
| 7195 __ Mov(x14, csp); | |
| 7196 | |
| 7197 // Restore csp. | |
| 7198 __ Mov(csp, x29); | |
| 7199 END(); | |
| 7200 | |
| 7201 RUN(); | |
| 7202 | |
| 7203 CHECK_EQUAL_64(0x1000, x0); | |
| 7204 CHECK_EQUAL_64(0x207de, x1); | |
| 7205 CHECK_EQUAL_64(0x10000ff1, x2); | |
| 7206 CHECK_EQUAL_64(0x19001, x3); | |
| 7207 CHECK_EQUAL_64(0x10000ff1, x4); | |
| 7208 CHECK_EQUAL_64(0xfffffffffffe1822, x5); | |
| 7209 CHECK_EQUAL_64(0xf000100f, x6); | |
| 7210 CHECK_EQUAL_64(0xfffffffffffe8fff, x7); | |
| 7211 CHECK_EQUAL_64(0xf000100f, x8); | |
| 7212 CHECK_EQUAL_64(0x1000, x9); | |
| 7213 CHECK_EQUAL_64(0xffffff1, x10); | |
| 7214 CHECK_EQUAL_64(0x207f0, x12); | |
| 7215 CHECK_EQUAL_64(0x207f0, x13); | |
| 7216 CHECK_EQUAL_64(0x1f7f0, x14); | |
| 7217 | |
| 7218 TEARDOWN(); | |
| 7219 } | |
| 7156 | 7220 |
| 7157 TEST(claim_drop_zero) { | 7221 TEST(claim_drop_zero) { |
| 7158 INIT_V8(); | 7222 INIT_V8(); |
| 7159 SETUP(); | 7223 SETUP(); |
| 7160 | 7224 |
| 7161 START(); | 7225 START(); |
| 7162 | 7226 |
| 7163 Label start; | 7227 Label start; |
| 7164 __ Bind(&start); | 7228 __ Bind(&start); |
| 7165 __ Claim(0); | 7229 __ Claim(0); |
| (...skipping 8270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 15436 __ Mov(x0, 1); | 15500 __ Mov(x0, 1); |
| 15437 | 15501 |
| 15438 END(); | 15502 END(); |
| 15439 | 15503 |
| 15440 RUN(); | 15504 RUN(); |
| 15441 | 15505 |
| 15442 CHECK_EQUAL_64(0x1, x0); | 15506 CHECK_EQUAL_64(0x1, x0); |
| 15443 | 15507 |
| 15444 TEARDOWN(); | 15508 TEARDOWN(); |
| 15445 } | 15509 } |
| OLD | NEW |