Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • sac2c sac2c
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 402
    • Issues 402
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 13
    • Merge requests 13
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • sac-group
  • sac2csac2c
  • Issues
  • #2304
Closed
Open
Created Feb 26, 2022 by Sven-Bodo Scholz@sbsOwner

WLUR and foldfix

WLUR is not foldfix aware....

noinline
int[*] add ( int[*] a, int[*] b)
{  return _add_SxS_ ( a, _sel_VxA_([0], b)); }

int main()
{
    shp = [4];
    a = with {
          (_mul_SxV_(0,shp) <= iv < shp) : iv;
        } : foldfix( add, 0, 1);

     // should return 1 and *not* 6!
    return a;
}

with

sac2c -V
sac2c 1.3.3-MijasCosta-771-g499e7
build-type: RELEASE
built-by: "sbs" at 2022-02-20T11:53:21

behaves like this:

sac2c error3.sac -noWLUR -noprelude
warning: With-Loop unrolling (WLUR) was disabled using the command line. However, unrolling of single-trip with-loops is required for code generation. Therefore, WLUR will be re-enabled with the  maximum number of
warning: unrolling steps set to 1.
-sbs-Bodos-IMac-> ./a.out ; echo $?
1
-sbs-Bodos-IMac-> sac2c error3.sac -noprelude
-sbs-Bodos-IMac-> ./a.out ; echo $?
6
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking