diff options
author | Andrew Stubbs <ams@codesourcery.com> | 2019-05-24 15:25:41 +0000 |
---|---|---|
committer | Andrew Stubbs <ams@gcc.gnu.org> | 2019-05-24 15:25:41 +0000 |
commit | e8daba7e0630c75c1e1d989f18c282b43fc2e1ef (patch) | |
tree | f0ad62113011170fcfa2baf8f514b2a0e831fad6 /gcc | |
parent | c2465daec4df2d1a03be26a1fa9147382964a16e (diff) | |
download | gcc-e8daba7e0630c75c1e1d989f18c282b43fc2e1ef.zip gcc-e8daba7e0630c75c1e1d989f18c282b43fc2e1ef.tar.gz gcc-e8daba7e0630c75c1e1d989f18c282b43fc2e1ef.tar.bz2 |
GCN: Wait for exit value to write before exiting.
2019-05-24 Andrew Stubbs <ams@codesourcery.com>
gcc/
* config/gcn/gcn-run.c (main): Set a non-zero return value if the
kernel does not exit cleanly.
* config/gcn/gcn.md (gcn_return): Insert s_waitcnt before s_dcache_wb.
From-SVN: r271605
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/gcn/gcn-run.c | 5 | ||||
-rw-r--r-- | gcc/config/gcn/gcn.md | 4 |
3 files changed, 12 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6bc4d1a..e340675 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-05-24 Andrew Stubbs <ams@codesourcery.com> + + * config/gcn/gcn-run.c (main): Set a non-zero return value if the + kernel does not exit cleanly. + * config/gcn/gcn.md (gcn_return): Insert s_waitcnt before s_dcache_wb. + 2019-05-24 Jason Merrill <jason@redhat.com> Revert: diff --git a/gcc/config/gcn/gcn-run.c b/gcc/config/gcn/gcn-run.c index 84718f4..21852d7 100644 --- a/gcc/config/gcn/gcn-run.c +++ b/gcc/config/gcn/gcn-run.c @@ -853,7 +853,10 @@ main (int argc, char *argv[]) unsigned int upper = (return_value & ~0xffff) >> 16; if (upper == 0xcafe) - printf ("Kernel exit value was never set\n"); + { + printf ("Kernel exit value was never set\n"); + return_value = 0xff; + } else if (upper == 0xffff) ; /* Set by exit. */ else if (upper == 0) diff --git a/gcc/config/gcn/gcn.md b/gcc/config/gcn/gcn.md index 2b805a7..1f06d0b 100644 --- a/gcc/config/gcn/gcn.md +++ b/gcc/config/gcn/gcn.md @@ -784,10 +784,10 @@ if (cfun && cfun->machine && cfun->machine->normal_function) return "s_setpc_b64\ts[18:19]"; else - return "s_dcache_wb\;s_endpgm"; + return "s_waitcnt\tlgkmcnt(0)\;s_dcache_wb\;s_endpgm"; } [(set_attr "type" "sop1") - (set_attr "length" "8")]) + (set_attr "length" "12")]) (define_expand "call" [(parallel [(call (match_operand 0 "") |