📄 s_cbrtl.s
字号:
.file "cbrtl.s"// Copyright (c) 2000 - 2004, Intel Corporation// All rights reserved.//// Contributed 2000 by the Intel Numerics Group, Intel Corporation//// Redistribution and use in source and binary forms, with or without// modification, are permitted provided that the following conditions are// met://// * Redistributions of source code must retain the above copyright// notice, this list of conditions and the following disclaimer.//// * Redistributions in binary form must reproduce the above copyright// notice, this list of conditions and the following disclaimer in the// documentation and/or other materials provided with the distribution.//// * The name of Intel Corporation may not be used to endorse or promote// products derived from this software without specific prior written// permission.// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR ITS// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR TORT (INCLUDING// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.//// Intel Corporation is the author of this code, and requests that all// problem reports or change requests be submitted to it directly at// http://www.intel.com/software/products/opensource/libraries/num.htm.//// History//==============================================================// 04/28/00 Initial version// 05/20/02 Cleaned up namespace and sf0 syntax// 02/06/03 Reordered header:.section,.global,.proc,.align// 11/23/04 Reformatted routine and improved speed//// API//==============================================================// long double cbrtl(long double)//// Overview of operation//==============================================================// Background//// Implementation//// The result is computed as// cbrt(x)= cbrt(1 - (1 - x*y)) * (1/cbrt(y))// where y = frcpa(x) = (-1)^sgn_y * 2^(3*k+j) * m_y, // m_y in [1,2), j in {0,1,2}//// cbrt(1 - (1 - x*y)) is approximated by a degree-6 polynomial// in r= 1 - x*y :// P = 1 - c_1 r - c_2 * r^2 - c_3 * r^3 - c_4 * r^4 - c_5 * r^5 - c_6 * r^6////// The values (1/cbrt(y)) are stored as two tables of constants T_hi// (double-extended precision) and D (single precision) as follows:// T_hi (1 + D)= 1/cbrt(y) to about 80 bits of accuracy//// The tables are only stored for three exponent values (i.e. // only for 2^j * m_y, where j in {0,1,2} and m_y covers the 256// possible mantissas for an frcpa result); the index is formed// by the 8 leading mantissa bits of x, which is the same index used// by the hardware to get frcpa(x).//// The table values are multiplied by 2^k where e is the exponent of // the input number. This multiplication is carried out in parallel with// the polynomial evaluation:// T= 2^(k) * T_hi////=======================================================================//===============// Special values//==============================================================// Registers used//==============================================================// p6, p7, p12 FR_R = f6 FR_C1 = f7 FR_C2 = f9 FR_C3 = f10 FR_C4 = f11 FR_C5 = f12 FR_C6 = f13 FR_XNORM = f14 FR_D = f15 FR_SPECIAL = f32 FR_RCP = f33 FR_R2 = f34 FR_P1 = f35 FR_P2 = f36 FR_P3 = f37 FR_P4 = f38 FR_P5 = f39 FR_R3 = f40 FR_T = f41 FR_TF = f42 FR_P = f43 FR_SGNEXP = f44 GR_ADDR = r2 GR_C_START = r2 GR_ARGSIG = r3 GR_NORMSIG = r15 GR_D_ADDR = r16 GR_D_START = r16 GR_INDEX2 = r17 GR_IX2 = r17 GR_NORMEXP = r18 GR_EXP5 = r19 GR_EXP3 = r20 GR_EXP6 = r20 GR_EXP17 = r21 GR_TMP1 = r21 GR_SGNMASK = r22 GR_T_INDEX = r23 GR_IX_T = r23 GR_IX_D = r24 GR_D_INDEX = r24 GR_TMP2 = r25 GR_TMP3 = r25 GR_TMP4 = r25 GR_EXP_RES = r26 GR_BIAS23 = r27 GR_EXPBIAS = r27 GR_EXP_MOD_3 = r28 GR_SIGN = r29 GR_EXPSIGNRES = r29 GR_REMTMP = r30 GR_NORMEXPSGN = r31// Data tables//==============================================================RODATA.align 16LOCAL_OBJECT_START(poly_coeffs) data8 0xaaaaaaaaaaaaaab1, 0x00003ffd // C_1 data8 0xe38e38e38e38e3e0, 0x00003ffb // C_2 data8 0x3faf9add3c0be9a6, 0x3fa511e8d2b1f749 // C_3, C_4 data8 0x3f9ee71b2c6ebe99, 0x3f9809180fd0340c // C_5, C_6LOCAL_OBJECT_END(poly_coeffs)LOCAL_OBJECT_START(T_table) data8 0x80155c748c374836, 0x8040404b0879f7f9 data8 0x806b5dce4b405c10, 0x8096b586974669b1 data8 0x80bcd273d952a028, 0x80e898c52813f2f3 data8 0x81149add67c2d208, 0x813b4e2c856b6e9a data8 0x8167c1dde03de7aa, 0x818ed973b811135e data8 0x81bbc0c33e13ec98, 0x81e33e69fbe7504a data8 0x820aec524e3c23e9, 0x823880f78e70b805 data8 0x826097a62a8e5200, 0x8288dfe00e9b5eaf data8 0x82b15a10c5371624, 0x82da06a527b18937 data8 0x8302e60b635ab394, 0x832bf8b2feec2f0e data8 0x83553f0ce00e276b, 0x837eb98b50f8322a data8 0x83a270f44c84f699, 0x83cc4d7cfcfac5ca data8 0x83f65f78a8872b4c, 0x8420a75f2f7b53c8 data8 0x844510461ff14209, 0x846fbd91b930bed2 data8 0x84947e18234f3294, 0x84bf92755825045a data8 0x84e4ac0ee112ba51, 0x8509ef44b86f20be data8 0x85359d5d91768427, 0x855b3bd5b7384357 data8 0x858104f0c415f79a, 0x85a6f90390d29864 data8 0x85d3772fcd56a1dd, 0x85f9c982fcc002f3 data8 0x862047e0e7ea554b, 0x8646f2a26f7f5852 data8 0x866dca21754096b5, 0x8694ceb8dfd17a37 data8 0x86bc00c49e9307e8, 0x86dccd74fce79610 data8 0x870453c845acf90f, 0x872c089a1e90342c data8 0x8753ec4a92d16c5e, 0x877bff3aca19f6b4 data8 0x879d88b6fe1c324c, 0x87c5f346dbf98c3a data8 0x87e7c653efacef2c, 0x881089d4e73ffefc data8 0x88397e6a366f2a8a, 0x885bc559e5e1c081 data8 0x887e2ee392bb7a93, 0x88a7a8587e404257 data8 0x88ca5eda67594784, 0x88f4356166bd590e data8 0x89173a0acf5ce026, 0x893a62a098b6a57b data8 0x895daf637236ae2c, 0x89883b9d1c2fa9c5 data8 0x89abd8dd374a5d7b, 0x89cf9b1dcd197fa0 data8 0x89f382a258ea79de, 0x8a178faf06648f29 data8 0x8a3bc288b3e1d18a, 0x8a601b74f4d1f835 data8 0x8a849aba14274764, 0x8aa9409f16cdbc9b data8 0x8ace0d6bbe2cb316, 0x8af301688ab33558 data8 0x8b181cdebe6f3206, 0x8b3d60185fafcb7c data8 0x8b62cb603bb2fad0, 0x8b80d7d6bc4104de data8 0x8ba68bf73ac74f39, 0x8bcc68fb9f9f7335 data8 0x8bf26f31c534fca2, 0x8c10f86e13a1a1f9 data8 0x8c3749916cc6abb5, 0x8c5dc4c4f7706032 data8 0x8c7cac3a8c42e3e0, 0x8ca373f1b7bf2716 data8 0x8cc29907fb951294, 0x8ce9ae4e9492aac8 data8 0x8d0911dddbfdad0e, 0x8d3075c4f20f04ee data8 0x8d5018a9d4de77d5, 0x8d77cc47dd143515 data8 0x8d97af6352739cb7, 0x8db7af523167800f data8 0x8ddfd80bc68c32ff, 0x8e00197e1e7c88fe data8 0x8e207859f77e20e7, 0x8e40f4ce60c9f8e2 data8 0x8e69ba46cf2fde4d, 0x8e8a7a00bd7ae63e data8 0x8eab57ef1cf2f529, 0x8ecc5442cffb1dad data8 0x8eed6f2d2a4acbfe, 0x8f0ea8dff24441ff data8 0x8f385c95d696b817, 0x8f59dc43edd930f3 data8 0x8f7b7b5f5ffad1c4, 0x8f9d3a1bea165f38 data8 0x8fbf18adc34b66da, 0x8fe117499e356095 data8 0x90033624aa685f8d, 0x9025757495f36b86 data8 0x903f3a5dcc091203, 0x9061b2fceb2bdbab data8 0x90844ca7211032a7, 0x90a7079403e6a15d data8 0x90c9e3fbafd63799, 0x90ece216c8a16ee4 data8 0x9110021e7b516f0a, 0x912a708a39be9075 data8 0x914dcc7b31146370, 0x91714af8cfe984d5 data8 0x918c00a6f3795e97, 0x91afbc299ed0295d data8 0x91d39add3e958db0, 0x91ee9920a8974d92 data8 0x9212b5fcac537c19, 0x9236f6b256923fcf data8 0x92523ee6f90dcfc3, 0x9276bef031e6eb79 data8 0x929236ec237a24ad, 0x92b6f70b7efe9dc3 data8 0x92d29f61eec7dc2b, 0x92f7a05d5b8ba92f data8 0x931379a403be5c16, 0x9338bc44de2e3f34 data8 0x9354c71412c69486, 0x937a4c273907e262 data8 0x93968919f6e7975d, 0x93bc516fdd4680c9 data8 0x93d8c123d9be59b2, 0x93f546c955e60076 data8 0x941b70a65879079f, 0x943829f337410591 data8 0x9454f995765bc4d2, 0x947b86b57f5842ed data8 0x94988aeb23470f86, 0x94b5a5dc9695f42a data8 0x94d2d7a9170d8b42, 0x94f9e87dd78bf019 data8 0x95175019a503d89e, 0x9534cefa625fcb3a data8 0x955265405c491a25, 0x9570130c1f9bb857 data8 0x9597ca4119525184, 0x95b5af6fb5aa4d3c data8 0x95d3ac9273aafd7a, 0x95f1c1cafdfd3684 data8 0x960fef3b430b8d5f, 0x962e350575b409c5 data8 0x964c934c0dfc1708, 0x966b0a31c9c6bc7d data8 0x968999d9ad8d264e, 0x96a8426705198795 data8 0x96c703fd64445ee5, 0x96e5dec0a7b4268d data8 0x9704d2d4f59f79f3, 0x9723e05ebe91b9b0 data8 0x97430782be323831, 0x97624865fc0df8bf data8 0x9781a32dcc640b2a, 0x97a117ffd0f48e46 data8 0x97c0a701f9d263c9, 0x97e0505a8637a036 data8 0x97f57a9fb0b08c6e, 0x9815503365914a9d data8 0x98354085054fd204, 0x98554bbbf8a77902 data8 0x987571fffb7f94f6, 0x9895b3791dd03c23 data8 0x98ab43a5fc65d0c8, 0x98cbb2d196bd713d data8 0x98ec3d9ec7b6f21a, 0x990ce436db5e8344 data8 0x9922b8218160967a, 0x99438d686f75779d data8 0x99647eea131fa20b, 0x997a85045a47c6d0 data8 0x999ba5f14f8add02, 0x99bce38b5465ecae data8 0x99d31ca0887f30f9, 0x99f48a669c74c09e data8 0x9a16154eb445c873, 0x9a2c822ec198d667 data8 0x9a4e3e080cd91b78, 0x9a70177afe52322e data8 0x9a86b8fa94eebe10, 0x9aa8c42866ae2958 data8 0x9abf86f9e12fc45e, 0x9ae1c462fc05f49d data8 0x9af8a8dc936b84d0, 0x9b1b19033be35730 data8 0x9b3da7daf04c2892, 0x9b54c2e4c8a9012b data8 0x9b77854e6c661200, 0x9b8ec2e678d56d2f data8 0x9ba60e6a5ca133b6, 0x9bc919ea66a151a4 data8 0x9be0887c09ef82bb, 0x9c03c8d5fffc3503 data8 0x9c1b5ad21a81cbb9, 0x9c3ed09216e9ca02 data8 0x9c568656c0423def, 0x9c7a320af242ce60 data8 0x9c920bf7a8c01dc2, 0x9ca9f475d98b159c data8 0x9ccdeca60e80b5f8, 0x9ce5f9d4653d4902 data8 0x9cfe15cb38bfdd8e, 0x9d225b983f6c1f96 data8 0x9d3a9cca32261ed7, 0x9d52ecfccebe1768 data8 0x9d77818d95b82f86, 0x9d8ff7893fa4706c data8 0x9da87cbef36f2a5e, 0x9dcd6140b4a35aeb data8 0x9de60cd06dc6e2d4, 0x9dfec7d4cc43b76f data8 0x9e17925ec9fccc4a, 0x9e3cdf6db57dc075 data8 0x9e55d110b63637a8, 0x9e6ed27594550d2e data8 0x9e87e3adc385d393, 0x9ead9b54b37a1055 data8 0x9ec6d46a3d7de215, 0x9ee01d9108be3154 data8 0x9ef976db07288d04, 0x9f12e05a4759ec25 data8 0x9f2c5a20f4da6668, 0x9f52af78ed1733ca data8 0x9f6c52426a39d003, 0x9f860593d42fd7f3 data8 0x9f9fc97fdb96bd51, 0x9fb99e194f4a7037 data8 0x9fd383731ca51db9, 0x9fed79a04fbf9423 data8 0xa00780b413b24ee8, 0xa02eab2c4474b0cd data8 0xa048dcd51ccfd142, 0xa0631fa894b11b8d data8 0xa07d73ba65e680af, 0xa097d91e6aaf71b0 data8 0xa0b24fe89e02602f, 0xa0ccd82d1bd2f68b data8 0xa0e77200215909e6, 0xa1021d760d584855 data8 0xa11cdaa36068a57d, 0xa137a99cbd3f880b data8 0xa160019ed37fb4ae, 0xa1960b5966da4608 data8 0xa1cc5dbe6dc2aab4, 0xa202f97995b69c0d data8 0xa232fe6eb0c0577d, 0xa26a2582012f6e17 data8 0xa2a197e5d10465cb, 0xa2d25a532efefbc8 data8 0xa30a5bd6e49e4ab8, 0xa33b9c9b59879e24 data8 0xa3742fca6a3c1f21, 0xa3a5f1273887bf22 data8 0xa3d7ef508ff11574, 0xa4115ce30548bc15 data8 0xa443df0e53df577a, 0xa4769fa5913c0ec3 data8 0xa4a99f303bc7def5, 0xa4dcde37779adf4b data8 0xa5105d46152c938a, 0xa5441ce89825cb8d data8 0xa5781dad3e54d899, 0xa5ac602406c4e68c data8 0xa5d9601d95c2c0bc, 0xa60e1e1a2de14745 data8 0xa6431f6e3fbd9658, 0xa67864b0d432fda4 data8 0xa6a6444aa0243c0b, 0xa6dc094d10f25792 data8 0xa70a574cc02bba69, 0xa7409e2af9549084 data8 0xa76f5c64ca2cf13b, 0xa79e4f0babab5dc0 data8 0xa7d5579ae5164b85, 0xa804bd3c6fe61cc8 data8 0xa8345895e5250a5a, 0xa8642a122b44ef0b data8 0xa89c38ca18f6108b, 0xa8cc81063b6e87ca data8 0xa8fd00bfa409285e, 0xa92db8664d5516da data8 0xa95ea86b75cc2c20, 0xa98fd141a4992deb data8 0xa9c1335cae7446ba, 0xa9ea8686f556f645 data8 0xaa1c52d17906bb19, 0xaa4e59b046dab887 data8 0xaa809b9c60d1890b, 0xaab319102f3f9b33 data8 0xaadd5a18c1e21274, 0xab1045f2ac31bdf5 data8 0xab3ae3ab2df7231e, 0xab6e3f945d1e96fc data8 0xaba1d953a08fa94e, 0xabcd090db7ef4c3f data8 0xabf864602d7c323d, 0xac2ca5886ccf9b57 data8 0xac5861d4aa441f0f, 0xac8d183fe3a2fbed data8 0xacb93703ff51571e, 0xace5830ad0c3f14b data8 0xad11fca5d78b3ff2, 0xad4797fddf91a798 data8 0xad747701e559ebcb, 0xada184a47e9c7613 data8 0xadcec13ab0dda8ff, 0xadfc2d1a5fd21ba8 data8 0xae29c89a5053c33a, 0xae5794122b638df9 data8 0xae858fda8137ae0a, 0xaeb3bc4ccc56d3d1 data8 0xaee219c374c09920, 0xaf10a899d3235fe7 data8 0xaf3f692c341fe8b4, 0xaf6e5bd7db9ae6c2 data8 0xaf9d80fb081cd91b, 0xafc35ce063eb3787
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -