7#if defined(TARGET_ARCH_ARM)
16#if defined(DART_TARGET_OS_MACOS) || defined(DART_TARGET_OS_MACOS_IOS)
17 "r0",
"r1",
"r2",
"r3",
"r4",
"pp",
"r6",
"fp",
18 "r8",
"r9",
"thr",
"r11",
"tmp",
"sp",
"lr",
"pc",
20 "r0",
"r1",
"r2",
"r3",
"r4",
"pp",
"r6",
"r7",
21 "r8",
"r9",
"thr",
"fp",
"tmp",
"sp",
"lr",
"pc",
26#if defined(DART_TARGET_OS_MACOS) || defined(DART_TARGET_OS_MACOS_IOS)
27 "r0",
"r1",
"r2",
"r3",
"r4",
"r5",
"r6",
"fp",
28 "r8",
"r9",
"r10",
"r11",
"ip",
"sp",
"lr",
"pc",
30 "r0",
"r1",
"r2",
"r3",
"r4",
"r5",
"r6",
"r7",
31 "r8",
"r9",
"r10",
"fp",
"ip",
"sp",
"lr",
"pc",
36 "q0",
"q1",
"q2",
"q3",
"q4",
"q5",
"q6",
"q7",
38 "q8",
"q9",
"q10",
"q11",
"q12",
"q13",
"q14",
"q15",
42 "d0",
"d1",
"d2",
"d3",
"d4",
"d5",
"d6",
"d7",
43 "d8",
"d9",
"d10",
"d11",
"d12",
"d13",
"d14",
"d15",
45 "d16",
"d17",
"d18",
"d19",
"d20",
"d21",
"d22",
"d23",
46 "d24",
"d25",
"d26",
"d27",
"d28",
"d29",
"d30",
"d31",
50 "s0",
"s1",
"s2",
"s3",
"s4",
"s5",
"s6",
"s7",
"s8",
"s9",
"s10",
51 "s11",
"s12",
"s13",
"s14",
"s15",
"s16",
"s17",
"s18",
"s19",
"s20",
"s21",
52 "s22",
"s23",
"s24",
"s25",
"s26",
"s27",
"s28",
"s29",
"s30",
"s31",
61 S0,
S1,
S2,
S3,
S4,
S5,
S6,
S7,
S8,
S9,
S10,
S11,
S12,
S13,
S14,
S15};
65 if (isinf(
a) || (fabs(
a) >= exp2f(126)))
66 return a >= 0.0f ? 0.0f : -0.0f;
72 uint32_t a_bits = bit_cast<uint32_t, float>(
a);
74 uint64_t scaled = (
static_cast<uint64_t
>(0x3fe) << 52) |
75 ((
static_cast<uint64_t
>(a_bits) & 0x7fffff) << 29);
77 int32_t result_exp = 253 - ((a_bits >> 23) & 0xff);
78 ASSERT((result_exp >= 1) && (result_exp <= 252));
80 double scaled_d = bit_cast<double, uint64_t>(scaled);
81 ASSERT((scaled_d >= 0.5) && (scaled_d < 1.0));
84 int32_t q =
static_cast<int32_t
>(scaled_d * 512.0);
86 double r = 1.0 / ((
static_cast<double>(q) + 0.5) / 512.0);
88 int32_t
s =
static_cast<int32_t
>(256.0 * r + 0.5);
89 double estimate =
static_cast<double>(
s) / 256.0;
90 ASSERT((estimate >= 1.0) && (estimate <= (511.0 / 256.0)));
94 (a_bits & 0x80000000) | ((result_exp & 0xff) << 23) |
95 ((bit_cast<uint64_t, double>(estimate) >> 29) & 0x7fffff);
96 return bit_cast<float, int32_t>(result_bits);
101 if ((isinf(op1) && op2 == 0.0f) || (op1 == 0.0f && isinf(op2))) {
113 else if (isinf(
a) || (fabs(
a) >= exp2f(126)))
120 uint32_t a_bits = bit_cast<uint32_t, float>(
a);
122 if (((a_bits >> 23) & 1) != 0) {
124 scaled = (
static_cast<uint64_t
>(0x3fd) << 52) |
125 ((
static_cast<uint64_t
>(a_bits) & 0x7fffff) << 29);
128 scaled = (
static_cast<uint64_t
>(0x3fe) << 52) |
129 ((
static_cast<uint64_t
>(a_bits) & 0x7fffff) << 29);
132 int32_t result_exp = (380 - ((a_bits >> 23) & 0xff)) / 2;
134 double scaled_d = bit_cast<double, uint64_t>(scaled);
135 ASSERT((scaled_d >= 0.25) && (scaled_d < 1.0));
138 if (scaled_d < 0.5) {
142 int32_t q0 =
static_cast<int32_t
>(scaled_d * 512.0);
144 r = 1.0 /
sqrt((
static_cast<double>(q0) + 0.5) / 512.0);
149 int32_t q1 =
static_cast<int32_t
>(scaled_d * 256.0);
151 r = 1.0 /
sqrt((
static_cast<double>(q1) + 0.5) / 256.0);
154 int32_t
s =
static_cast<int>(256.0 * r + 0.5);
155 double estimate =
static_cast<double>(
s) / 256.0;
156 ASSERT((estimate >= 1.0) && (estimate <= (511.0 / 256.0)));
159 int32_t result_bits =
160 ((result_exp & 0xff) << 23) |
161 ((bit_cast<uint64_t, double>(estimate) >> 29) & 0x7fffff);
162 return bit_cast<float, int32_t>(result_bits);
167 if ((isinf(op1) && op2 == 0.0f) || (op1 == 0.0f && isinf(op2))) {
172 return (3.0f -
p) / 2.0f;
static const FpuRegister FpuArgumentRegisters[]
static const Register ArgumentRegisters[]
static const DRegister FpuDArgumentRegisters[]
static const SRegister FpuSArgumentRegisters[]
float ReciprocalSqrtEstimate(float op)
DART_FORCE_INLINE D bit_cast(const S &source)
float ReciprocalStep(float op1, float op2)
const char *const fpu_reg_names[kNumberOfFpuRegisters]
const int kNumberOfFpuRegisters
const char *const fpu_d_reg_names[kNumberOfDRegisters]
const char *const cpu_reg_names[kNumberOfCpuRegisters]
float ReciprocalSqrtStep(float op1, float op2)
float ReciprocalEstimate(float op)
const char *const fpu_s_reg_names[kNumberOfSRegisters]
const char *const cpu_reg_abi_names[kNumberOfCpuRegisters]
SIN Vec< N, float > sqrt(const Vec< N, float > &x)