From e20c07dddf528ce50951a59cb92f98b4bca8da77 Mon Sep 17 00:00:00 2001 From: Cyril SIX Date: Mon, 9 Apr 2018 13:55:44 +0200 Subject: MPPA - Optimized branch generation for word compare to 0 --- test/mppa/Makefile | 2 +- test/mppa/general/branchz.c | 12 ++++++++++++ test/mppa/general/branchzu.c | 12 ++++++++++++ test/mppa/general/output/branchz.exp | 1 + test/mppa/general/output/branchzu.exp | 1 + 5 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 test/mppa/general/branchz.c create mode 100644 test/mppa/general/branchzu.c create mode 100644 test/mppa/general/output/branchz.exp create mode 100644 test/mppa/general/output/branchzu.exp (limited to 'test/mppa') diff --git a/test/mppa/Makefile b/test/mppa/Makefile index 60433f03..36bd49bc 100644 --- a/test/mppa/Makefile +++ b/test/mppa/Makefile @@ -1,5 +1,5 @@ DIR=general -TESTNAMES=simple call branch for forvar forvarl +TESTNAMES=simple call branch for forvar forvarl branchz branchzu TESTS=$(addprefix $(DIR)/,$(TESTNAMES)) ELF=$(addsuffix .bin,$(TESTS)) diff --git a/test/mppa/general/branchz.c b/test/mppa/general/branchz.c new file mode 100644 index 00000000..5e3226d5 --- /dev/null +++ b/test/mppa/general/branchz.c @@ -0,0 +1,12 @@ +int main(void){ + int a=1; + int b; + + if(a==0){ + b = a+4; + } else { + b = a+2; + } + + return b; +} diff --git a/test/mppa/general/branchzu.c b/test/mppa/general/branchzu.c new file mode 100644 index 00000000..0ff25763 --- /dev/null +++ b/test/mppa/general/branchzu.c @@ -0,0 +1,12 @@ +int main(void){ + int a=1; + int b; + + if(!a){ + b = a+4; + } else { + b = a+2; + } + + return b; +} diff --git a/test/mppa/general/output/branchz.exp b/test/mppa/general/output/branchz.exp new file mode 100644 index 00000000..00750edc --- /dev/null +++ b/test/mppa/general/output/branchz.exp @@ -0,0 +1 @@ +3 diff --git a/test/mppa/general/output/branchzu.exp b/test/mppa/general/output/branchzu.exp new file mode 100644 index 00000000..00750edc --- /dev/null +++ b/test/mppa/general/output/branchzu.exp @@ -0,0 +1 @@ +3 -- cgit