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 |
11 // with the distribution. | 11 // with the distribution. |
12 // * Neither the name of Google Inc. nor the names of its | 12 // * Neither the name of Google Inc. nor the names of its |
13 // contributors may be used to endorse or promote products derived | 13 // contributors may be used to endorse or promote products derived |
14 // from this software without specific prior written permission. | 14 // from this software without specific prior written permission. |
15 // | 15 // |
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | 16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | 17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | 18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | 19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #ifndef V8_A64_INSTRUCTIONS_A64_H_ | 28 #ifndef V8_ARM64_INSTRUCTIONS_ARM64_H_ |
29 #define V8_A64_INSTRUCTIONS_A64_H_ | 29 #define V8_ARM64_INSTRUCTIONS_ARM64_H_ |
30 | 30 |
31 #include "globals.h" | 31 #include "globals.h" |
32 #include "utils.h" | 32 #include "utils.h" |
33 #include "a64/constants-a64.h" | 33 #include "arm64/constants-arm64.h" |
34 #include "a64/utils-a64.h" | 34 #include "arm64/utils-arm64.h" |
35 | 35 |
36 namespace v8 { | 36 namespace v8 { |
37 namespace internal { | 37 namespace internal { |
38 | 38 |
39 | 39 |
40 // ISA constants. -------------------------------------------------------------- | 40 // ISA constants. -------------------------------------------------------------- |
41 | 41 |
42 typedef uint32_t Instr; | 42 typedef uint32_t Instr; |
43 | 43 |
44 // The following macros initialize a float/double variable with a bit pattern | 44 // The following macros initialize a float/double variable with a bit pattern |
45 // without using static initializers: If A64_DEFINE_FP_STATICS is defined, the | 45 // without using static initializers: If ARM64_DEFINE_FP_STATICS is defined, the |
46 // symbol is defined as uint32_t/uint64_t initialized with the desired bit | 46 // symbol is defined as uint32_t/uint64_t initialized with the desired bit |
47 // pattern. Otherwise, the same symbol is declared as an external float/double. | 47 // pattern. Otherwise, the same symbol is declared as an external float/double. |
48 #if defined(A64_DEFINE_FP_STATICS) | 48 #if defined(ARM64_DEFINE_FP_STATICS) |
49 #define DEFINE_FLOAT(name, value) extern const uint32_t name = value | 49 #define DEFINE_FLOAT(name, value) extern const uint32_t name = value |
50 #define DEFINE_DOUBLE(name, value) extern const uint64_t name = value | 50 #define DEFINE_DOUBLE(name, value) extern const uint64_t name = value |
51 #else | 51 #else |
52 #define DEFINE_FLOAT(name, value) extern const float name | 52 #define DEFINE_FLOAT(name, value) extern const float name |
53 #define DEFINE_DOUBLE(name, value) extern const double name | 53 #define DEFINE_DOUBLE(name, value) extern const double name |
54 #endif // defined(A64_DEFINE_FP_STATICS) | 54 #endif // defined(ARM64_DEFINE_FP_STATICS) |
55 | 55 |
56 DEFINE_FLOAT(kFP32PositiveInfinity, 0x7f800000); | 56 DEFINE_FLOAT(kFP32PositiveInfinity, 0x7f800000); |
57 DEFINE_FLOAT(kFP32NegativeInfinity, 0xff800000); | 57 DEFINE_FLOAT(kFP32NegativeInfinity, 0xff800000); |
58 DEFINE_DOUBLE(kFP64PositiveInfinity, 0x7ff0000000000000UL); | 58 DEFINE_DOUBLE(kFP64PositiveInfinity, 0x7ff0000000000000UL); |
59 DEFINE_DOUBLE(kFP64NegativeInfinity, 0xfff0000000000000UL); | 59 DEFINE_DOUBLE(kFP64NegativeInfinity, 0xfff0000000000000UL); |
60 | 60 |
61 // This value is a signalling NaN as both a double and as a float (taking the | 61 // This value is a signalling NaN as both a double and as a float (taking the |
62 // least-significant word). | 62 // least-significant word). |
63 DEFINE_DOUBLE(kFP64SignallingNaN, 0x7ff000007f800001); | 63 DEFINE_DOUBLE(kFP64SignallingNaN, 0x7ff000007f800001); |
64 DEFINE_FLOAT(kFP32SignallingNaN, 0x7f800001); | 64 DEFINE_FLOAT(kFP32SignallingNaN, 0x7f800001); |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 // Indicate to the Debugger that the instruction is a redirected call. | 415 // Indicate to the Debugger that the instruction is a redirected call. |
416 const Instr kImmExceptionIsRedirectedCall = 0xca11; | 416 const Instr kImmExceptionIsRedirectedCall = 0xca11; |
417 | 417 |
418 // Represent unreachable code. This is used as a guard in parts of the code that | 418 // Represent unreachable code. This is used as a guard in parts of the code that |
419 // should not be reachable, such as in data encoded inline in the instructions. | 419 // should not be reachable, such as in data encoded inline in the instructions. |
420 const Instr kImmExceptionIsUnreachable = 0xdebf; | 420 const Instr kImmExceptionIsUnreachable = 0xdebf; |
421 | 421 |
422 // A pseudo 'printf' instruction. The arguments will be passed to the platform | 422 // A pseudo 'printf' instruction. The arguments will be passed to the platform |
423 // printf method. | 423 // printf method. |
424 const Instr kImmExceptionIsPrintf = 0xdeb1; | 424 const Instr kImmExceptionIsPrintf = 0xdeb1; |
425 // Parameters are stored in A64 registers as if the printf pseudo-instruction | 425 // Parameters are stored in ARM64 registers as if the printf pseudo-instruction |
426 // was a call to the real printf method: | 426 // was a call to the real printf method: |
427 // | 427 // |
428 // x0: The format string, then either of: | 428 // x0: The format string, then either of: |
429 // x1-x7: Optional arguments. | 429 // x1-x7: Optional arguments. |
430 // d0-d7: Optional arguments. | 430 // d0-d7: Optional arguments. |
431 // | 431 // |
432 // Floating-point and integer arguments are passed in separate sets of | 432 // Floating-point and integer arguments are passed in separate sets of |
433 // registers in AAPCS64 (even for varargs functions), so it is not possible to | 433 // registers in AAPCS64 (even for varargs functions), so it is not possible to |
434 // determine the type of location of each arguments without some information | 434 // determine the type of location of each arguments without some information |
435 // about the values that were passed in. This information could be retrieved | 435 // about the values that were passed in. This information could be retrieved |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 // Trace control. | 491 // Trace control. |
492 TRACE_ENABLE = 1 << 6, | 492 TRACE_ENABLE = 1 << 6, |
493 TRACE_DISABLE = 2 << 6, | 493 TRACE_DISABLE = 2 << 6, |
494 TRACE_OVERRIDE = 3 << 6 | 494 TRACE_OVERRIDE = 3 << 6 |
495 }; | 495 }; |
496 | 496 |
497 | 497 |
498 } } // namespace v8::internal | 498 } } // namespace v8::internal |
499 | 499 |
500 | 500 |
501 #endif // V8_A64_INSTRUCTIONS_A64_H_ | 501 #endif // V8_ARM64_INSTRUCTIONS_ARM64_H_ |
OLD | NEW |