diff mbox

[ptx] fix CLZ

Message ID 565079A8.8090201@acm.org
State New
Headers show

Commit Message

Nathan Sidwell Nov. 21, 2015, 2:03 p.m. UTC
This patch fixes CLZ.  It  always returns SImode, we should look at the input 
operand to  determine the type.  Fixes  cc.c-torture/execute/builtin-bitops-1.c

committed.

nathan
diff mbox

Patch

2015-11-21  Nathan Sidwell  <nathan@acm.org>

	* config/nvptx/nvptx.md (clz<mode>2): Use operand 1 for type.

Index: config/nvptx/nvptx.md
===================================================================
--- config/nvptx/nvptx.md	(revision 230704)
+++ config/nvptx/nvptx.md	(working copy)
@@ -731,7 +731,7 @@ 
   [(set (match_operand:SI 0 "nvptx_register_operand" "=R")
 	(clz:SI (match_operand:SDIM 1 "nvptx_register_operand" "R")))]
   ""
-  "%.\\tclz.b%T0\\t%0, %1;")
+  "%.\\tclz.b%T1\\t%0, %1;")
 
 (define_expand "ctz<mode>2"
   [(set (match_operand:SI 0 "nvptx_register_operand" "")