Attic/bench.prs
author Christian Urban <christian.urban@kcl.ac.uk>
Fri, 03 Dec 2021 18:10:33 +0000
changeset 855 1c0a684567d7
parent 710 183663740fb7
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
710
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
val bench = List(
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     2
  ArrayDef("mem", 30000),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
  Assign("ptr", Num(15000)),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
  Assign("ptr", Aop("+", Var("ptr"), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
  AssignA("mem", Var("ptr"), Aop("+", Ref("mem", Var("ptr")), Num(2))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     6
  While(
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     7
    Bop("!=", Ref("mem", Var("ptr")), Num(0)),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     8
    List(
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     9
      Assign("ptr", Aop("-", Var("ptr"), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    10
      AssignA("mem", Var("ptr"), Aop("+", Ref("mem", Var("ptr")), Num(13))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    11
      Assign("ptr", Aop("+", Var("ptr"), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    12
      AssignA("mem", Var("ptr"), Aop("-", Ref("mem", Var("ptr")), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    13
      Skip
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    14
    )
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    15
  ),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    16
  Assign("ptr", Aop("-", Var("ptr"), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    17
  While(
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    18
    Bop("!=", Ref("mem", Var("ptr")), Num(0)),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    19
    List(
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    20
      While(
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    21
        Bop("!=", Ref("mem", Var("ptr")), Num(0)),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    22
        List(
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    23
          Assign("ptr", Aop("+", Var("ptr"), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    24
          AssignA("mem", Var("ptr"), Aop("+", Ref("mem", Var("ptr")), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    25
          Assign("ptr", Aop("+", Var("ptr"), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    26
          AssignA("mem", Var("ptr"), Aop("+", Ref("mem", Var("ptr")), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    27
          Assign("ptr", Aop("-", Var("ptr"), Num(2))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    28
          AssignA("mem", Var("ptr"), Aop("-", Ref("mem", Var("ptr")), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    29
          Skip
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    30
        )
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    31
      ),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    32
      Assign("ptr", Aop("+", Var("ptr"), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    33
      While(
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    34
        Bop("!=", Ref("mem", Var("ptr")), Num(0)),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    35
        List(
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    36
          Assign("ptr", Aop("-", Var("ptr"), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    37
          AssignA("mem", Var("ptr"), Aop("+", Ref("mem", Var("ptr")), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    38
          Assign("ptr", Aop("+", Var("ptr"), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    39
          AssignA("mem", Var("ptr"), Aop("-", Ref("mem", Var("ptr")), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    40
          Skip
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    41
        )
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    42
      ),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    43
      AssignA("mem", Var("ptr"), Aop("+", Ref("mem", Var("ptr")), Num(8))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    44
      While(
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    45
        Bop("!=", Ref("mem", Var("ptr")), Num(0)),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    46
        List(
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    47
          Assign("ptr", Aop("+", Var("ptr"), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    48
          AssignA("mem", Var("ptr"), Aop("+", Ref("mem", Var("ptr")), Num(8))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    49
          Assign("ptr", Aop("-", Var("ptr"), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    50
          AssignA("mem", Var("ptr"), Aop("-", Ref("mem", Var("ptr")), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    51
          Skip
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    52
        )
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    53
      ),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    54
      Assign("ptr", Aop("+", Var("ptr"), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    55
      Assign("x", Ref("mem", Var("ptr"))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    56
      Write("x"),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    57
      AssignA("mem", Var("ptr"), Num(0)),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    58
      Assign("ptr", Aop("-", Var("ptr"), Num(2))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    59
      Assign("ptr", Aop("+", Var("ptr"), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    60
      AssignA("mem", Var("ptr"), Aop("+", Ref("mem", Var("ptr")), Num(10))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    61
      While(
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    62
        Bop("!=", Ref("mem", Var("ptr")), Num(0)),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    63
        List(
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    64
          Assign("ptr", Aop("+", Var("ptr"), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    65
          AssignA("mem", Var("ptr"), Aop("+", Ref("mem", Var("ptr")), Num(10))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    66
          While(
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    67
            Bop("!=", Ref("mem", Var("ptr")), Num(0)),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    68
            List(
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    69
              Assign("ptr", Aop("+", Var("ptr"), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    70
              AssignA("mem", Var("ptr"), Aop("+", Ref("mem", Var("ptr")), Num(2))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    71
              AssignA("mem", Var("ptr"), Aop("+", Ref("mem", Var("ptr")), Num(8))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    72
              While(
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    73
                Bop("!=", Ref("mem", Var("ptr")), Num(0)),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    74
                List(
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    75
                  Assign("ptr", Aop("+", Var("ptr"), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    76
                  AssignA("mem", Var("ptr"), Aop("+", Ref("mem", Var("ptr")), Num(10))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    77
                  While(
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    78
                    Bop("!=", Ref("mem", Var("ptr")), Num(0)),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    79
                    List(
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    80
                      Assign("ptr", Aop("+", Var("ptr"), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    81
                      AssignA("mem", Var("ptr"), Aop("+", Ref("mem", Var("ptr")), Num(10))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    82
                      While(
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    83
                        Bop("!=", Ref("mem", Var("ptr")), Num(0)),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    84
                        List(
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    85
                          Assign("ptr", Aop("+", Var("ptr"), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    86
                          AssignA("mem", Var("ptr"), Aop("+", Ref("mem", Var("ptr")), Num(10))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    87
                          While(
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    88
                            Bop("!=", Ref("mem", Var("ptr")), Num(0)),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    89
                            List(
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    90
                              Assign("ptr", Aop("+", Var("ptr"), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    91
                              AssignA("mem", Var("ptr"), Aop("+", Ref("mem", Var("ptr")), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    92
                              AssignA("mem", Var("ptr"), Aop("+", Ref("mem", Var("ptr")), Num(9))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    93
                              AssignA("mem", Var("ptr"), Num(0)),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    94
                              Assign("ptr", Aop("-", Var("ptr"), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    95
                              AssignA("mem", Var("ptr"), Aop("-", Ref("mem", Var("ptr")), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    96
                              Skip
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    97
                            )
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    98
                          ),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    99
                          Assign("ptr", Aop("-", Var("ptr"), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   100
                          AssignA("mem", Var("ptr"), Aop("-", Ref("mem", Var("ptr")), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   101
                          Skip
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   102
                        )
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   103
                      ),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   104
                      Assign("ptr", Aop("-", Var("ptr"), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   105
                      AssignA("mem", Var("ptr"), Aop("-", Ref("mem", Var("ptr")), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   106
                      Skip
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   107
                    )
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   108
                  ),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   109
                  Assign("ptr", Aop("-", Var("ptr"), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   110
                  AssignA("mem", Var("ptr"), Aop("-", Ref("mem", Var("ptr")), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   111
                  Skip
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   112
                )
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   113
              ),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   114
              Assign("ptr", Aop("-", Var("ptr"), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   115
              AssignA("mem", Var("ptr"), Aop("-", Ref("mem", Var("ptr")), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   116
              Skip
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   117
            )
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   118
          ),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   119
          Assign("ptr", Aop("-", Var("ptr"), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   120
          AssignA("mem", Var("ptr"), Aop("-", Ref("mem", Var("ptr")), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   121
          Skip
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   122
        )
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   123
      ),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   124
      Assign("ptr", Aop("-", Var("ptr"), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   125
      AssignA("mem", Var("ptr"), Aop("-", Ref("mem", Var("ptr")), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   126
      Skip
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   127
    )
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   128
  ),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   129
  AssignA("mem", Var("ptr"), Aop("+", Ref("mem", Var("ptr")), Num(10))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   130
  Assign("x", Ref("mem", Var("ptr"))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   131
  Write("x"),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   132
  Skip
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   133
)