radeon/llvm: add a pattern for fsqrt
authorVincent Lejeune <vljn@ovi.com>
Wed, 3 Oct 2012 19:40:49 +0000 (21:40 +0200)
committerVincent Lejeune <vljn@ovi.com>
Wed, 10 Oct 2012 20:02:13 +0000 (22:02 +0200)
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
src/gallium/drivers/radeon/R600Instructions.td

index 1689a2f4ab833521f18dc42a95e53e4d970694d5..01a5bba3431ae71269ed742208a84f1320190c53 100644 (file)
@@ -1018,6 +1018,9 @@ let Predicates = [isEGorCayman] in {
   def : Pat<(fp_to_uint R600_Reg32:$src),
     (FLT_TO_UINT_eg (TRUNC R600_Reg32:$src))>;
 
+  def : Pat<(fsqrt R600_Reg32:$src),
+    (MUL R600_Reg32:$src, (RECIPSQRT_CLAMPED_eg R600_Reg32:$src))>;
+
 //===----------------------------------------------------------------------===//
 // Memory read/write instructions
 //===----------------------------------------------------------------------===//