Skip to content

Commit 97e3756

Browse files
author
astojanov
committed
PrimitiveOps updates.
1 parent ea97605 commit 97e3756

File tree

6 files changed

+553
-449
lines changed

6 files changed

+553
-449
lines changed

src/common/PrimitiveOps.scala

Lines changed: 530 additions & 419 deletions
Large diffs are not rendered by default.

test-out/epfl/test11-stencil1.check

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -28,41 +28,34 @@ overlap1:
2828
(Sym(9),Sym(15))
2929
(Sym(6),Sym(12))
3030
overlap2:
31-
var inits: List(Sym(9), Sym(6)) -> List(Variable(Sym(32)), Variable(Sym(33)))
31+
var inits: List(Sym(9), Sym(6)) -> List(Variable(Sym(25)), Variable(Sym(26)))
3232
will become var reads: List(Sym(9), Sym(6))
3333
will become var writes: List(Sym(15), Sym(12))
34-
var reads: List((Sym(9),Sym(36)), (Sym(6),Sym(37)))
34+
var reads: List((Sym(9),Sym(29)), (Sym(6),Sym(30)))
3535
var writes: List((Sym(15),Const(())), (Sym(12),Const(())))
3636
/*****************************************
3737
Emitting Generated Code
3838
*******************************************/
3939
class staged$0 extends ((Array[Double])=>(Array[Double])) {
4040
def apply(x0:Array[Double]): Array[Double] = {
4141
val x1 = new Array[Double](20)
42-
val x24 = 0.doubleValue()
43-
val x25 = 2.0 * x24
44-
val x26 = x25 + 3.0
45-
val x27 = 1.doubleValue()
46-
val x28 = 2.0 * x27
47-
val x29 = x28 + 3.0
48-
val x30 = x26 + x29
49-
val x31 = x1(0) = x30
50-
var x32: Double = x29
51-
var x33: Int = 1
52-
var x35 : Int = 1
53-
val x48 = while (x35 < 20) {
54-
val x36 = x32
55-
val x37 = x33
56-
val x39 = x35 + 1
57-
val x40 = x39.doubleValue()
58-
val x41 = 2.0 * x40
59-
val x42 = x41 + 3.0
60-
val x43 = x36 + x42
61-
val x44 = x1(x37) = x43
62-
x32 = x42
63-
x33 = x39
42+
val x24 = x1(0) = 8.0
43+
var x25: Double = 5.0
44+
var x26: Int = 1
45+
var x28 : Int = 1
46+
val x41 = while (x28 < 20) {
47+
val x29 = x25
48+
val x30 = x26
49+
val x32 = x28 + 1
50+
val x33 = x32.doubleValue()
51+
val x34 = 2.0 * x33
52+
val x35 = x34 + 3.0
53+
val x36 = x29 + x35
54+
val x37 = x1(x30) = x36
55+
x25 = x35
56+
x26 = x32
6457

65-
x35 = x35 + 1
58+
x28 = x28 + 1
6659
}
6760
x1
6861
}

test-src/epfl/test11-shonan/TestHMM.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class TestHMM extends FileDiffSuite {
2323
def staticData[T:Typ](x: T): Rep[T]
2424
def test(x: Rep[Array[Int]]): Rep[Array[Int]]
2525
}
26-
trait Impl extends DSL with Runner with ArrayOpsExpOpt with NumericOpsExpOpt with PrimitiveOpsExp with OrderingOpsExpOpt with BooleanOpsExp
26+
trait Impl extends DSL with Runner with ArrayOpsExpOpt with NumericOpsExpOpt with PrimitiveOpsExpOpt with OrderingOpsExpOpt with BooleanOpsExp
2727
with EqualExpOpt with VariablesExpOpt with RangeOpsExp with StaticDataExp
2828
with StringOpsExp with SeqOpsExp
2929
with IfThenElseExpOpt with PrintExp

test-src/epfl/test11-shonan/TestStencil.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class TestStencil extends FileDiffSuite {
2727
with OrderingOpsExpOpt with BooleanOpsExp
2828
with EqualExpOpt with VariablesExpOpt with RangeOpsExp with StaticDataExp
2929
with StringOpsExp with SeqOpsExp
30-
with IfThenElseExpOpt with PrintExp with PrimitiveOpsExp
30+
with IfThenElseExpOpt with PrintExp with PrimitiveOpsExpOpt
3131
with CompileScala { self =>
3232
//override val verbosity = 1
3333
def infix_toDouble(x: Rep[Int]): Rep[Double] = int_double_value(x)

test-src/epfl/test13-dynamic-jit/TestStable.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ class TestStable extends FileDiffSuite {
217217
with EqualExpOpt with IfThenElseFatExp with LoopsFatExp with WhileExp
218218
with RangeOpsExp with PrintExp with FatExpressions with CompileScala
219219
with SeqOpsExp with StringOpsExp
220-
with PrimitiveOpsExp with ArrayOpsExp with CastingOpsExp with StaticDataExp
220+
with PrimitiveOpsExpOpt with ArrayOpsExp with CastingOpsExp with StaticDataExp
221221
with StableVarsExp { self =>
222222
override val verbosity = 1
223223
dumpGeneratedCode = true

test-src/epfl/test5-js/TestConditional.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class TestConditional extends FileDiffSuite {
104104

105105
println("-- begin")
106106

107-
new ConditionalProg with PrimitiveOpsExpOpt with EqualExp with PrintExp
107+
new ConditionalProg with PrimitiveOpsExp with EqualExp with PrintExp
108108
with IfThenElseExp with StringOpsExp with ArrayOpsExp with SeqOpsExp
109109
with CompileScala { self =>
110110
val codegen = new ScalaGenIfThenElse with ScalaGenPrimitiveOps
@@ -117,7 +117,7 @@ class TestConditional extends FileDiffSuite {
117117
}
118118

119119
new ConditionalProg with LiftPrimitives with IfThenElseExp
120-
with PrimitiveOpsExpOpt with StringOpsExp with ArrayOpsExp with SeqOpsExp
120+
with PrimitiveOpsExp with StringOpsExp with ArrayOpsExp with SeqOpsExp
121121
with EqualExp
122122
with PrintExp { self =>
123123
val codegen = new JSGenIfThenElse with JSGenPrimitiveOps

0 commit comments

Comments
 (0)