📄 s_cbrt.s
字号:
.file "cbrt.asm"// Copyright (C) 2000, 2001, Intel Corporation// All rights reserved.// // Contributed 2/2/2000 by John Harrison, Cristina Iordache, Ted Kubaska, // Bob Norin, Shane Story, and Ping Tak Peter Tang // of the Computational Software Lab, 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://developer.intel.com/opensource.//// History//==============================================================// 2/02/00: Initial version // 5/19/00: New version (modified algorithm)//// API//==============================================================// double cbrt(double)//// Overview of operation//==============================================================// Background//// Implementation//// cbrt(a) = cbrt(a y) / cbrt(y)// = cbrt(1 - (1 - a y)) * 1/cbrt(y)//// where y = frcpa(a). //// * cbrt(1 - (1 - a y)) is approximated by a degree-5 polynomial // // 1 - (1/3)*r - (1/9)*r^2 - (5/81)*r^3 - (10/243)*r^4 - (22/729)*r^5// // in r = 1 - a y.//// * The values 1/cbrt(y) are stored in a table of constants T0// to 64 bits of accuracy//// The table values are stored for three exponent values and are// then multiplied by e/3 where e is the exponent of the input number.// This computation is carried out in parallel with the polynomial// evaluation://// T = 2^(e/3) * T0//===============// input = x// C = frcpa(x)// r = 1 - C * x//// Special values //==============================================================// Registers used//==============================================================// f6-f15// r2, r23-r26, r28-r30// p6,p7,p8,p12#include "libm_support.h"// Data tables//==============================================================#ifdef _LIBC.rodata#else.data#endif.align 16poly_coeffs:ASM_TYPE_DIRECTIVE(poly_coeffs,@object)data8 0xaaaaaaaaaaaaaaab, 0x00003ffd // 1/3data8 0x3fbc71c71c71c71d, 0x3faf9add3c0ca459data8 0x3fa511e8d2b3183b, 0x3f9ee7113506ac13ASM_SIZE_DIRECTIVE(poly_coeffs)T_table:ASM_TYPE_DIRECTIVE(T_table,@object)data8 0x80155c748c374836, 0xa160019ed37fb4aedata8 0xcb51ddcb9e93095e, 0x8040404b0879f7f9data8 0xa1960b5966da4608, 0xcb95f333968ad59bdata8 0x806b5dce4b405c10, 0xa1cc5dbe6dc2aab4data8 0xcbda64292d3ffd97, 0x8096b586974669b1data8 0xa202f97995b69c0d, 0xcc1f3184af961596data8 0x80bcd273d952a028, 0xa232fe6eb0c0577ddata8 0xcc5bb1ac954d33e2, 0x80e898c52813f2f3data8 0xa26a2582012f6e17, 0xcca12e9831fc6402data8 0x81149add67c2d208, 0xa2a197e5d10465cbdata8 0xcce70a67b64f24ad, 0x813b4e2c856b6e9adata8 0xa2d25a532efefbc8, 0xcd24794726477ea5data8 0x8167c1dde03de7aa, 0xa30a5bd6e49e4ab8data8 0xcd6b096a0b70ee87, 0x818ed973b811135edata8 0xa33b9c9b59879e24, 0xcda9177738b15a90data8 0x81bbc0c33e13ec98, 0xa3742fca6a3c1f21data8 0xcdf05f2247dffab9, 0x81e33e69fbe7504adata8 0xa3a5f1273887bf22, 0xce2f0f347f96f906data8 0x820aec524e3c23e9, 0xa3d7ef508ff11574data8 0xce6e0be0cd551a61, 0x823880f78e70b805data8 0xa4115ce30548bc15, 0xceb666b2c347d1dedata8 0x826097a62a8e5200, 0xa443df0e53df577adata8 0xcef609b0cb874f00, 0x8288dfe00e9b5eafdata8 0xa4769fa5913c0ec3, 0xcf35fb5447e5c765data8 0x82b15a10c5371624, 0xa4a99f303bc7def5data8 0xcf763c47ee869f00, 0x82da06a527b18937data8 0xa4dcde37779adf4b, 0xcfb6cd3888d71785data8 0x8302e60b635ab394, 0xa5105d46152c938adata8 0xcff7aed4fbfbb447, 0x832bf8b2feec2f0edata8 0xa5441ce89825cb8d, 0xd038e1ce5167e3c6data8 0x83553f0ce00e276b, 0xa5781dad3e54d899data8 0xd07a66d7bfa0ebba, 0x837eb98b50f8322adata8 0xa5ac602406c4e68c, 0xd0bc3ea6b32d1b21data8 0x83a270f44c84f699, 0xa5d9601d95c2c0bcdata8 0xd0f4f0e8f36c1bf8, 0x83cc4d7cfcfac5cadata8 0xa60e1e1a2de14745, 0xd1376458e34b037edata8 0x83f65f78a8872b4c, 0xa6431f6e3fbd9658data8 0xd17a2ca133f78572, 0x8420a75f2f7b53c8data8 0xa67864b0d432fda4, 0xd1bd4a80301c5715data8 0x844510461ff14209, 0xa6a6444aa0243c0bdata8 0xd1f71682b2fa4575, 0x846fbd91b930bed2data8 0xa6dc094d10f25792, 0xd23ad555f773f059data8 0x84947e18234f3294, 0xa70a574cc02bba69data8 0xd2752c7039a5bf73, 0x84bf92755825045adata8 0xa7409e2af9549084, 0xd2b98ee008c06b59data8 0x84e4ac0ee112ba51, 0xa76f5c64ca2cf13bdata8 0xd2f4735ffd700280, 0x8509ef44b86f20bedata8 0xa79e4f0babab5dc0, 0xd32f99ed6d9ac0e1data8 0x85359d5d91768427, 0xa7d5579ae5164b85data8 0xd374f0666c75d51c, 0x855b3bd5b7384357data8 0xa804bd3c6fe61cc8, 0xd3b0a7d13618e4a1data8 0x858104f0c415f79a, 0xa8345895e5250a5adata8 0xd3eca2ea53bcec0c, 0x85a6f90390d29864data8 0xa8642a122b44ef0b, 0xd428e23874f13a17data8 0x85d3772fcd56a1dd, 0xa89c38ca18f6108bdata8 0xd46f82fe293bc6d3, 0x85f9c982fcc002f3data8 0xa8cc81063b6e87ca, 0xd4ac57e9b7186420data8 0x862047e0e7ea554b, 0xa8fd00bfa409285edata8 0xd4e972becb04e8b8, 0x8646f2a26f7f5852data8 0xa92db8664d5516da, 0xd526d40a7a9b43a3data8 0x866dca21754096b5, 0xa95ea86b75cc2c20data8 0xd5647c5b73917370, 0x8694ceb8dfd17a37data8 0xa98fd141a4992deb, 0xd5a26c4201bd6d13data8 0x86bc00c49e9307e8, 0xa9c1335cae7446badata8 0xd5e0a45015350a7e, 0x86dccd74fce79610data8 0xa9ea8686f556f645, 0xd614b539c6194104data8 0x870453c845acf90f, 0xaa1c52d17906bb19data8 0xd6537310e224283f, 0x872c089a1e90342cdata8 0xaa4e59b046dab887, 0xd6927ab62244c917data8 0x8753ec4a92d16c5e, 0xaa809b9c60d1890bdata8 0xd6d1ccc1fc4ef4b7, 0x877bff3aca19f6b4data8 0xaab319102f3f9b33, 0xd71169cea98fddeddata8 0x879d88b6fe1c324c, 0xaadd5a18c1e21274data8 0xd746a66a5bc9f6d9, 0x87c5f346dbf98c3adata8 0xab1045f2ac31bdf5, 0xd786ce8f0fae5317data8 0x87e7c653efacef2c, 0xab3ae3ab2df7231edata8 0xd7bc7ff214c4e75a, 0x881089d4e73ffefcdata8 0xab6e3f945d1e96fc, 0xd7fd35467a517ed1data8 0x88397e6a366f2a8a, 0xaba1d953a08fa94edata8 0xd83e38838648d815, 0x885bc559e5e1c081data8 0xabcd090db7ef4c3f, 0xd874a1db598b8951data8 0x887e2ee392bb7a93, 0xabf864602d7c323ddata8 0xd8ab42205b80edaf, 0x88a7a8587e404257data8 0xac2ca5886ccf9b57, 0xd8ed1849d202f965data8 0x88ca5eda67594784, 0xac5861d4aa441f0fdata8 0xd92432bd5a173685, 0x88f4356166bd590edata8 0xac8d183fe3a2fbed, 0xd9669ca45b03c23edata8 0x89173a0acf5ce026, 0xacb93703ff51571edata8 0xd99e3327cf89574e, 0x893a62a098b6a57bdata8 0xace5830ad0c3f14b, 0xd9d602b19b100466data8 0x895daf637236ae2c, 0xad11fca5d78b3ff2data8 0xda0e0ba86c096841, 0x89883b9d1c2fa9c5data8 0xad4797fddf91a798, 0xda5195fcdb1c3dcedata8 0x89abd8dd374a5d7b, 0xad747701e559ebcbdata8 0xda8a1eb87a491f6c, 0x89cf9b1dcd197fa0data8 0xada184a47e9c7613, 0xdac2e230b91c3f84data8 0x89f382a258ea79de, 0xadcec13ab0dda8ffdata8 0xdafbe0d0b66aea30, 0x8a178faf06648f29data8 0xadfc2d1a5fd21ba8, 0xdb351b04a8fafceddata8 0x8a3bc288b3e1d18a, 0xae29c89a5053c33adata8 0xdb6e9139e33cdd8e, 0x8a601b74f4d1f835data8 0xae5794122b638df9, 0xdba843ded7151ea1data8 0x8a849aba14274764, 0xae858fda8137ae0adata8 0xdbe2336319b61fc8, 0x8aa9409f16cdbc9bdata8 0xaeb3bc4ccc56d3d1, 0xdc1c60376789fa68data8 0x8ace0d6bbe2cb316, 0xaee219c374c09920data8 0xdc56cacda82d0cd5, 0x8af301688ab33558data8 0xaf10a899d3235fe7, 0xdc917398f2797814data8 0x8b181cdebe6f3206, 0xaf3f692c341fe8b4data8 0xdccc5b0d90a3e628, 0x8b3d60185fafcb7cdata8 0xaf6e5bd7db9ae6c2, 0xdd0781a10469f0f2data8 0x8b62cb603bb2fad0, 0xaf9d80fb081cd91bdata8 0xdd42e7ca0b52838f, 0x8b80d7d6bc4104dedata8 0xafc35ce063eb3787, 0xdd729ad01c69114ddata8 0x8ba68bf73ac74f39, 0xaff2ddcb5f28f03ddata8 0xddae749c001fbf5e, 0x8bcc68fb9f9f7335data8 0xb022923b148e05c5, 0xddea8f50a51c69b1data8 0x8bf26f31c534fca2, 0xb0527a919adbf58bdata8 0xde26eb69a0f0f111, 0x8c10f86e13a1a1f9data8 0xb078f3ab1d701c65, 0xde576480262399bcdata8 0x8c3749916cc6abb5, 0xb0a93a6870649f31data8 0xde943789645933c8, 0x8c5dc4c4f7706032data8 0xb0d9b624d62ec856, 0xded14d58139a28afdata8 0x8c7cac3a8c42e3e0, 0xb100a5f53fb3c8e1data8 0xdf025c00bbf2b5c7, 0x8ca373f1b7bf2716data8 0xb131821882f5540a, 0xdf3feb44d723a713data8 0x8cc29907fb951294, 0xb158bf8e4cb04055data8 0xdf715bc16c159be0, 0x8ce9ae4e9492aac8data8 0xb189fd69d56b238f, 0xdfaf66240e29cda8data8 0x8d0911dddbfdad0e, 0xb1b189958e8108e4data8 0xdfe139cbf6e19bdc, 0x8d3075c4f20f04eedata8 0xb1e32a8165b09832, 0xe01fc0fe94d9fc52data8 0x8d5018a9d4de77d5, 0xb20b0678fc271eecdata8 0xe051f92ffcc0bd60, 0x8d77cc47dd143515data8 0xb23d0bd3f7592b6e, 0xe090feec9c9a06acdata8 0x8d97af6352739cb7, 0xb26538b2db8420dcdata8 0xe0c39d0c9ff862d6, 0x8db7af523167800fdata8 0xb28d89e339ceca14, 0xe0f668eeb99f188ddata8 0x8ddfd80bc68c32ff, 0xb2c022ca12e55a16data8 0xe1362890eb663139, 0x8e00197e1e7c88fedata8 0xb2e8c6852c6b03f1, 0xe1695c7212aecbaadata8 0x8e207859f77e20e7, 0xb3118f4eda9fe40fdata8 0xe19cbf0391bbbbe9, 0x8e40f4ce60c9f8e2data8 0xb33a7d6268109ebe, 0xe1d050901c531e85data8 0x8e69ba46cf2fde4d, 0xb36ddbc5ea70ec55data8 0xe2110903b4f4047a, 0x8e8a7a00bd7ae63edata8 0xb3971e9b39264023, 0xe2450559b4d80b6ddata8 0x8eab57ef1cf2f529, 0xb3c0877ecc18e24adata8 0xe27931a231554ef3, 0x8ecc5442cffb1daddata8 0xb3ea16ae3a6c905f, 0xe2ad8e2ac3c5b04bdata8 0x8eed6f2d2a4acbfe, 0xb413cc67aa0e4d2ddata8 0xe2e21b41b9694cce, 0x8f0ea8dff24441ffdata8 0xb43da8e9d163e1af, 0xe316d93615862714data8 0x8f385c95d696b817, 0xb47233773b84d425data8 0xe3590bd86a0d30f9, 0x8f59dc43edd930f3data8 0xb49c6825430fe730, 0xe38e38e38e38e38edata8 0x8f7b7b5f5ffad1c4, 0xb4c6c46bcdb27dcfdata8 0xe3c397d1e6db7839, 0x8f9d3a1bea165f38data8 0xb4f1488c0b35d26f, 0xe3f928f5953feb9edata8 0x8fbf18adc34b66da, 0xb51bf4c7c51f0168data8 0xe42eeca17c62886c, 0x8fe117499e356095data8 0xb546c9616087ab9c, 0xe464e32943446305data8 0x90033624aa685f8d, 0xb571c69bdffd9a70data8 0xe49b0ce15747a8a2, 0x9025757495f36b86data8 0xb59cecbae56984c3, 0xe4d16a1eee94e9d4data8 0x903f3a5dcc091203, 0xb5bd64512bb14bb7data8 0xe4fa52107353f67d, 0x9061b2fceb2bdbabdata8 0xb5e8d2a4bf5ba416, 0xe5310a471f4d2dc3data8 0x90844ca7211032a7, 0xb6146a9a1bc47819data8 0xe567f6f1c2b9c224, 0x90a7079403e6a15ddata8 0xb6402c7749d621c0, 0xe59f18689a9e4c9adata8 0x90c9e3fbafd63799, 0xb66c1882fb435ea2data8 0xe5d66f04b8a68ecf, 0x90ece216c8a16ee4data8 0xb6982f048c999a56, 0xe60dfb2005c192e9data8 0x9110021e7b516f0a, 0xb6c47044075b4142data8 0xe645bd1544c7ea51, 0x912a708a39be9075data8 0xb6e5bd6bfd02bafd, 0xe66fb21b505b20a0data8 0x914dcc7b31146370, 0xb7124a2736ff8ef2data8 0xe6a7d32af4a7c59a, 0x91714af8cfe984d5data8 0xb73f026a01e94177, 0xe6e02b129c6a5ae4data8 0x918c00a6f3795e97, 0xb760a959f1d0a7a7data8 0xe70a9136a7403039, 0x91afbc299ed0295ddata8 0xb78dae7e06868ab0, 0xe74349fb2d92a589data8 0x91d39add3e958db0, 0xb7badff8ad9e4e02data8 0xe77c3a9c86ed7d42, 0x91ee9920a8974d92data8 0xb7dce25b8e17ae9f, 0xe7a713f88151518adata8 0x9212b5fcac537c19, 0xb80a6226904045e2data8 0xe7e067453317ed2b, 0x9236f6b256923fcfdata8 0xb8380f1cafd73c1c, 0xe819f37a81871bb5data8 0x92523ee6f90dcfc3, 0xb85a6ea8e321b4d8data8 0xe8454236bfaeca14, 0x9276bef031e6eb79data8 0xb8886b684ae7d2fa, 0xe87f32f24c3fc90edata8 0x929236ec237a24ad, 0xb8ab0726fa00cf5ddata8 0xe8aacd8688892ba6, 0x92b6f70b7efe9dc3data8 0xb8d954a4d13b7cb1, 0xe8e523fd32f606f7data8 0x92d29f61eec7dc2b, 0xb8fc2d4f6cd9f04adata8 0xe9110b5311407927, 0x92f7a05d5b8ba92fdata8 0xb92acc851476b1ab, 0xe94bc8bf0c108fa3data8 0x931379a403be5c16, 0xb94de2d841a184c2data8 0xe977fdc439c2ca3c, 0x9338bc44de2e3f34data8 0xb97cd4c36c92693c, 0xe9b3236528fc349edata8 0x9354c71412c69486, 0xb9a0297f172665e3data8 0xe9dfa70b745ac1b4, 0x937a4c273907e262data8 0xb9cf6f21e36c3924, 0xea1b36268d0eaa38data8 0x93968919f6e7975d, 0xb9f3030951267208data8 0xea480963fd394197, 0x93bc516fdd4680c9data8 0xba229d6a618e7c59, 0xea84034425f27484data8 0x93d8c123d9be59b2, 0xba467144459f9855data8 0xeab12713138dd1cc, 0x93f546c955e60076data8 0xba6a60c3c48f1a4b, 0xeade6db73a5e503bdata8 0x941b70a65879079f, 0xba9a76056b67ee7adata8 0xeb1b0268343b121b, 0x943829f337410591data8 0xbabea699563ada6e, 0xeb489b0b2bdb5f14data8 0x9454f995765bc4d2, 0xbae2f350b262cc4bdata8 0xeb765721e85f03d0, 0x947b86b57f5842eddata8 0xbb1385a23be24e57, 0xebb389645f222f62data8 0x94988aeb23470f86, 0xbb3814975e17c680data8 0xebe198f090607e0c, 0x94b5a5dc9695f42adata8 0xbb5cc031009bf467, 0xec0fcc9321024509data8 0x94d2d7a9170d8b42, 0xbb81889680024764data8 0xec3e247da8b82f61, 0x94f9e87dd78bf019data8 0xbbb2c0d8703ae95d, 0xec7c27d21321c9f7data8 0x95175019a503d89e, 0xbbd7cd09ba3c5463data8 0xecaad5278824e453, 0x9534cefa625fcb3adata8 0xbbfcf68c4977718f, 0xecd9a76d097d4e77data8 0x955265405c491a25, 0xbc223d88cfc88eee
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -