diff options
author | Keith Randall <khr@golang.org> | 2015-07-19 15:48:20 -0700 |
---|---|---|
committer | Keith Randall <khr@golang.org> | 2015-07-21 04:34:02 +0000 |
commit | 67fdb0de8656f7c7b76afe8eff614da7bc13b221 (patch) | |
tree | ab6cf9659b65557f395dbbe77bc9b9e15e64c10c /src/cmd/compile/internal/ssa/func_test.go | |
parent | 8043f450c170a90de9a04bd801b4f3189ea613ea (diff) | |
download | go-67fdb0de8656f7c7b76afe8eff614da7bc13b221.tar.gz go-67fdb0de8656f7c7b76afe8eff614da7bc13b221.zip |
[dev.ssa] cmd/compile/internal/ssa: use width and sign specific opcodes
Bake the bit width and signedness into opcodes.
Pro: Rewrite rules become easier. Less chance for confusion.
Con: Lots more opcodes.
Let me know what you think. I'm leaning towards this, but I could be
convinced otherwise if people think this is too ugly.
Update #11467
Change-Id: Icf1b894268cdf73515877bb123839800d97b9df9
Reviewed-on: https://go-review.googlesource.com/12362
Reviewed-by: Alan Donovan <adonovan@google.com>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Diffstat (limited to 'src/cmd/compile/internal/ssa/func_test.go')
-rw-r--r-- | src/cmd/compile/internal/ssa/func_test.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/cmd/compile/internal/ssa/func_test.go b/src/cmd/compile/internal/ssa/func_test.go index a620e8f602..edea8f78d1 100644 --- a/src/cmd/compile/internal/ssa/func_test.go +++ b/src/cmd/compile/internal/ssa/func_test.go @@ -267,7 +267,7 @@ func TestArgs(t *testing.T) { Bloc("entry", Valu("a", OpConst, TypeInt64, 14, nil), Valu("b", OpConst, TypeInt64, 26, nil), - Valu("sum", OpAdd, TypeInt64, 0, nil, "a", "b"), + Valu("sum", OpAdd64, TypeInt64, 0, nil, "a", "b"), Valu("mem", OpArg, TypeMem, 0, ".mem"), Goto("exit")), Bloc("exit", @@ -290,7 +290,7 @@ func TestEquiv(t *testing.T) { Bloc("entry", Valu("a", OpConst, TypeInt64, 14, nil), Valu("b", OpConst, TypeInt64, 26, nil), - Valu("sum", OpAdd, TypeInt64, 0, nil, "a", "b"), + Valu("sum", OpAdd64, TypeInt64, 0, nil, "a", "b"), Valu("mem", OpArg, TypeMem, 0, ".mem"), Goto("exit")), Bloc("exit", @@ -299,7 +299,7 @@ func TestEquiv(t *testing.T) { Bloc("entry", Valu("a", OpConst, TypeInt64, 14, nil), Valu("b", OpConst, TypeInt64, 26, nil), - Valu("sum", OpAdd, TypeInt64, 0, nil, "a", "b"), + Valu("sum", OpAdd64, TypeInt64, 0, nil, "a", "b"), Valu("mem", OpArg, TypeMem, 0, ".mem"), Goto("exit")), Bloc("exit", @@ -311,7 +311,7 @@ func TestEquiv(t *testing.T) { Bloc("entry", Valu("a", OpConst, TypeInt64, 14, nil), Valu("b", OpConst, TypeInt64, 26, nil), - Valu("sum", OpAdd, TypeInt64, 0, nil, "a", "b"), + Valu("sum", OpAdd64, TypeInt64, 0, nil, "a", "b"), Valu("mem", OpArg, TypeMem, 0, ".mem"), Goto("exit")), Bloc("exit", @@ -322,7 +322,7 @@ func TestEquiv(t *testing.T) { Bloc("entry", Valu("a", OpConst, TypeInt64, 14, nil), Valu("b", OpConst, TypeInt64, 26, nil), - Valu("sum", OpAdd, TypeInt64, 0, nil, "a", "b"), + Valu("sum", OpAdd64, TypeInt64, 0, nil, "a", "b"), Valu("mem", OpArg, TypeMem, 0, ".mem"), Goto("exit"))), }, @@ -397,14 +397,14 @@ func TestEquiv(t *testing.T) { Valu("mem", OpArg, TypeMem, 0, ".mem"), Valu("a", OpConst, TypeInt64, 14, nil), Valu("b", OpConst, TypeInt64, 26, nil), - Valu("sum", OpAdd, TypeInt64, 0, nil, "a", "b"), + Valu("sum", OpAdd64, TypeInt64, 0, nil, "a", "b"), Exit("mem"))), Fun(c, "entry", Bloc("entry", Valu("mem", OpArg, TypeMem, 0, ".mem"), Valu("a", OpConst, TypeInt64, 0, nil), Valu("b", OpConst, TypeInt64, 14, nil), - Valu("sum", OpAdd, TypeInt64, 0, nil, "b", "a"), + Valu("sum", OpAdd64, TypeInt64, 0, nil, "b", "a"), Exit("mem"))), }, } |