TC can't simplify AKV _idxs2offset()
|Created on||Sep 02, 2011 18:31|
This isn't really a bug, inasmuch as it's desired new functionality for TC. However, the CF unit test here: cd ~/sac/testsuite/optimizations/constantfolding UnitTestRunGrep1 SCCFprf_sel4ivecyc.sac UnitTestRunGrep1 testing: SCCFprf_sel4ivecyc.sac Greptest: SCCFprf_sel4ivecyc.sac -noewlcf -docf -doawlf failed with 3 hits on phrase "NESTEDSTRUCTCON". Wanted 0 hits CF is unable to simplify the idx_sel() below, because _ivesplit_472 is not AKV, although it should be: _isaa_466_vec = 1; _ivesplit_473 = [ 3, 2 ]; _iveras_475 = 0; _ivesplit_472 = _idxs2offset_( _ivesplit_473, _iveras_475, _isaa_466_vec); _icc_28 = _idx_sel_( _ivesplit_472, NESTEDSTRUCTCON); sac2c -V sac2c v1.00-beta (Haggis And Apple) developer rev 17585:MODIFIED linux-gnu_x86_64 (Thu Sep 1 22:23:35 EDT 2011 by sac) I looked at ct_prf.c, and it does contain code, likely produced by yrs trly, for _idxs2offset. However, nowhere in ct_prf.c is there anything I can find that actually evaluates primitive expressions like "2+3", to produce an AKV result. Ah, I am beginning to see a light, perhaps: It looks as if there may be calls from TC to entries such as those in constants_struc_ops.c, probably driven by the (also undocumented) co_fun table entries in prf_info.mac. Perhaps Mr. TC can either confirm this conjecture, or provide the correct answer?
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information