[LLVMdev] Multi instruction pattern help

Villmow, Micah Micah.Villmow at amd.com
Mon Oct 6 17:42:53 PDT 2008


I am trying to get a multi instruction pattern to work and seem to be
running into trouble.

The problem itself is fairly simple. I need to go from 64bit floats to
32bit integers. As the backend doesn't support this natively but has a
way of converting it, I'd prefer to get this working via tablegen.

 

What I thought would work from the previous discussion is the following:

def : Pat<(fp_to_uint (f64 GPR:$src0)),

          (fp_to_uint (f32 (dp_to_fp (f64 GPR:$src0))))>;

 

Which when it runs across a 64bit float, it does a double to single
conversion, and then calls the 32bit float to int routine.

 

However, tablegen fails with the following error:

1>anonymous.2:  (fp_to_uint:isInt GPR:f64:$src0)

1>f:\hq\main\sw\appeng\tools\hpc\opencl\llvm\win32\AMDIL\..\bin\Win32\De
bug\TableGen.exe: In anonymous.2: Could not infer all types in pattern!

 

Is it possible to get an example explaining what is going on and how the
patterns are used? Maybe show how you can go from three different
patterns to a single pattern using multi-instruction pattern.

 

Thanks

 

Micah Villmow

Systems Engineer

Advanced Technology & Performance

Advanced Micro Devices Inc.

4555 Great America Pkwy,

Santa Clara, CA. 95054

P: 408-572-6219

F: 408-572-6596

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20081006/b36fe42c/attachment.html>


More information about the llvm-dev mailing list