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

Side by Side Diff: src/arm64/lithium-arm64.h

Issue 258793002: ARM64: Generate optimized code for Math.floor and Math.round with double outputs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 V(LoadKeyedFixedDouble) \ 131 V(LoadKeyedFixedDouble) \
132 V(LoadKeyedGeneric) \ 132 V(LoadKeyedGeneric) \
133 V(LoadNamedField) \ 133 V(LoadNamedField) \
134 V(LoadNamedGeneric) \ 134 V(LoadNamedGeneric) \
135 V(LoadRoot) \ 135 V(LoadRoot) \
136 V(MapEnumLength) \ 136 V(MapEnumLength) \
137 V(MathAbs) \ 137 V(MathAbs) \
138 V(MathAbsTagged) \ 138 V(MathAbsTagged) \
139 V(MathClz32) \ 139 V(MathClz32) \
140 V(MathExp) \ 140 V(MathExp) \
141 V(MathFloor) \ 141 V(MathFloorD) \
142 V(MathFloorI) \
142 V(MathLog) \ 143 V(MathLog) \
143 V(MathMinMax) \ 144 V(MathMinMax) \
144 V(MathPowHalf) \ 145 V(MathPowHalf) \
145 V(MathRound) \ 146 V(MathRoundD) \
147 V(MathRoundI) \
146 V(MathSqrt) \ 148 V(MathSqrt) \
147 V(ModByConstI) \ 149 V(ModByConstI) \
148 V(ModByPowerOf2I) \ 150 V(ModByPowerOf2I) \
149 V(ModI) \ 151 V(ModI) \
150 V(MulConstIS) \ 152 V(MulConstIS) \
151 V(MulI) \ 153 V(MulI) \
152 V(MulS) \ 154 V(MulS) \
153 V(NumberTagD) \ 155 V(NumberTagD) \
154 V(NumberTagU) \ 156 V(NumberTagU) \
155 V(NumberUntagD) \ 157 V(NumberUntagD) \
(...skipping 1767 matching lines...) Expand 10 before | Expand all | Expand 10 after
1923 1925
1924 LOperand* double_temp1() { return temps_[0]; } 1926 LOperand* double_temp1() { return temps_[0]; }
1925 LOperand* temp1() { return temps_[1]; } 1927 LOperand* temp1() { return temps_[1]; }
1926 LOperand* temp2() { return temps_[2]; } 1928 LOperand* temp2() { return temps_[2]; }
1927 LOperand* temp3() { return temps_[3]; } 1929 LOperand* temp3() { return temps_[3]; }
1928 1930
1929 DECLARE_CONCRETE_INSTRUCTION(MathExp, "math-exp") 1931 DECLARE_CONCRETE_INSTRUCTION(MathExp, "math-exp")
1930 }; 1932 };
1931 1933
1932 1934
1933 class LMathFloor V8_FINAL : public LUnaryMathOperation<0> { 1935 /* Math.floor with a double result. */
1936 class LMathFloorD V8_FINAL : public LUnaryMathOperation<0> {
1934 public: 1937 public:
1935 explicit LMathFloor(LOperand* value) : LUnaryMathOperation<0>(value) { } 1938 explicit LMathFloorD(LOperand* value) : LUnaryMathOperation<0>(value) { }
1936 DECLARE_CONCRETE_INSTRUCTION(MathFloor, "math-floor") 1939 DECLARE_CONCRETE_INSTRUCTION(MathFloorD, "math-floor-d")
1937 }; 1940 };
1938 1941
1939 1942
1943 /* Math.floor with an integer result. */
1944 class LMathFloorI V8_FINAL : public LUnaryMathOperation<0> {
1945 public:
1946 explicit LMathFloorI(LOperand* value) : LUnaryMathOperation<0>(value) { }
1947 DECLARE_CONCRETE_INSTRUCTION(MathFloorI, "math-floor-i")
1948 };
1949
1950
1940 class LFlooringDivByPowerOf2I V8_FINAL : public LTemplateInstruction<1, 1, 0> { 1951 class LFlooringDivByPowerOf2I V8_FINAL : public LTemplateInstruction<1, 1, 0> {
1941 public: 1952 public:
1942 LFlooringDivByPowerOf2I(LOperand* dividend, int32_t divisor) { 1953 LFlooringDivByPowerOf2I(LOperand* dividend, int32_t divisor) {
1943 inputs_[0] = dividend; 1954 inputs_[0] = dividend;
1944 divisor_ = divisor; 1955 divisor_ = divisor;
1945 } 1956 }
1946 1957
1947 LOperand* dividend() { return inputs_[0]; } 1958 LOperand* dividend() { return inputs_[0]; }
1948 int32_t divisor() const { return divisor_; } 1959 int32_t divisor() const { return divisor_; }
1949 1960
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
2022 }; 2033 };
2023 2034
2024 2035
2025 class LMathPowHalf V8_FINAL : public LUnaryMathOperation<0> { 2036 class LMathPowHalf V8_FINAL : public LUnaryMathOperation<0> {
2026 public: 2037 public:
2027 explicit LMathPowHalf(LOperand* value) : LUnaryMathOperation<0>(value) { } 2038 explicit LMathPowHalf(LOperand* value) : LUnaryMathOperation<0>(value) { }
2028 DECLARE_CONCRETE_INSTRUCTION(MathPowHalf, "math-pow-half") 2039 DECLARE_CONCRETE_INSTRUCTION(MathPowHalf, "math-pow-half")
2029 }; 2040 };
2030 2041
2031 2042
2032 class LMathRound V8_FINAL : public LUnaryMathOperation<1> { 2043 /* Math.round with an integer result. */
2044 class LMathRoundD V8_FINAL : public LUnaryMathOperation<1> {
2033 public: 2045 public:
2034 LMathRound(LOperand* value, LOperand* temp1) 2046 explicit LMathRoundD(LOperand* value, LOperand* temp)
2047 : LUnaryMathOperation<1>(value) {
2048 temps_[0] = temp;
2049 }
2050
2051 LOperand* temp() { return temps_[0]; }
2052
2053 DECLARE_CONCRETE_INSTRUCTION(MathRoundD, "math-round-d")
2054 };
2055
2056
2057 /* Math.round with an integer result. */
2058 class LMathRoundI V8_FINAL : public LUnaryMathOperation<1> {
2059 public:
2060 LMathRoundI(LOperand* value, LOperand* temp1)
2035 : LUnaryMathOperation<1>(value) { 2061 : LUnaryMathOperation<1>(value) {
2036 temps_[0] = temp1; 2062 temps_[0] = temp1;
2037 } 2063 }
2038 2064
2039 LOperand* temp1() { return temps_[0]; } 2065 LOperand* temp1() { return temps_[0]; }
2040 2066
2041 DECLARE_CONCRETE_INSTRUCTION(MathRound, "math-round") 2067 DECLARE_CONCRETE_INSTRUCTION(MathRoundI, "math-round-i")
2042 }; 2068 };
2043 2069
2044 2070
2045 class LMathSqrt V8_FINAL : public LUnaryMathOperation<0> { 2071 class LMathSqrt V8_FINAL : public LUnaryMathOperation<0> {
2046 public: 2072 public:
2047 explicit LMathSqrt(LOperand* value) : LUnaryMathOperation<0>(value) { } 2073 explicit LMathSqrt(LOperand* value) : LUnaryMathOperation<0>(value) { }
2048 DECLARE_CONCRETE_INSTRUCTION(MathSqrt, "math-sqrt") 2074 DECLARE_CONCRETE_INSTRUCTION(MathSqrt, "math-sqrt")
2049 }; 2075 };
2050 2076
2051 2077
(...skipping 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after
3091 3117
3092 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 3118 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
3093 }; 3119 };
3094 3120
3095 #undef DECLARE_HYDROGEN_ACCESSOR 3121 #undef DECLARE_HYDROGEN_ACCESSOR
3096 #undef DECLARE_CONCRETE_INSTRUCTION 3122 #undef DECLARE_CONCRETE_INSTRUCTION
3097 3123
3098 } } // namespace v8::internal 3124 } } // namespace v8::internal
3099 3125
3100 #endif // V8_ARM64_LITHIUM_ARM64_H_ 3126 #endif // V8_ARM64_LITHIUM_ARM64_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698