[Mesa-dev] [PATCH] R600/SI: Add pattern for fp_to_uint
Tom Stellard
tom at stellard.net
Tue Jul 30 07:47:14 PDT 2013
On Tue, Jul 30, 2013 at 03:45:13AM +0200, Marek Olšák wrote:
> This fixes the F2U opcode for the Mesa driver.
>
> Signed-off-by: Marek Olšák <marek.olsak at amd.com>
Hi Marek,
You will need to include a lit test with this patch. lit tests are
located in test/CodeGen/R600. You can reuse the existing fp_to_uint.ll
test and just add CHECK lines for SI. I just pushed a patch:
"R600/SI: Expand vector fp <-> int conversions"
which prevents that test from crashing on SI, and you can use that as an
example for how to update a test.
For commit access, you will need to email Chris, see
http://llvm.org/docs/DeveloperPolicy.html#obtaining-commit-access
for instructions.
I use git-svn for working with the LLVM repository and it works pretty
well. There are good instructions for how to set it up here:
http://llvm.org/docs/GettingStarted.html#for-developers-to-work-with-git-svn
In order to reduce the LLVM build time, I only build the R600 and X86
targets (mesa requires the X86 target even if you aren't building
llvmpipe), and I use ccache. The other thing you should do is make sure
that you don't have a debug version of clang installed on your system,
because LLVM will use clang by default and the debug versions are really
slow. The solution to this is to force LLVM to build with gcc by adding
CC=gcc CXX=g++ to your configure script or by installing a release
build of clang.
Also, if you try to run piglit with a debug version of LLVM, it will
take forever. I always install a release version of llvm for testing
and running piglit, and if I need to debug an individual test, I build
(but don't install) a debug version of LLVM using:
make ENABLE_OPTIMIZED=0
and then use LD_PRELOAD=llvm/Debug+Asserts/lib/libLLVM-3.4svn.so some_app
for testing.
Hope this helps, let me know if you have any other questions.
-Tom
> ---
> lib/Target/R600/SIInstructions.td | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/lib/Target/R600/SIInstructions.td b/lib/Target/R600/SIInstructions.td
> index 0d50c5d..c392238 100644
> --- a/lib/Target/R600/SIInstructions.td
> +++ b/lib/Target/R600/SIInstructions.td
> @@ -605,7 +605,9 @@ defm V_CVT_F32_I32 : VOP1_32 <0x00000005, "V_CVT_F32_I32",
> defm V_CVT_F32_U32 : VOP1_32 <0x00000006, "V_CVT_F32_U32",
> [(set f32:$dst, (uint_to_fp i32:$src0))]
> >;
> -defm V_CVT_U32_F32 : VOP1_32 <0x00000007, "V_CVT_U32_F32", []>;
> +defm V_CVT_U32_F32 : VOP1_32 <0x00000007, "V_CVT_U32_F32",
> + [(set i32:$dst, (fp_to_uint f32:$src0))]
> +>;
> defm V_CVT_I32_F32 : VOP1_32 <0x00000008, "V_CVT_I32_F32",
> [(set i32:$dst, (fp_to_sint f32:$src0))]
> >;
> --
> 1.8.1.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the llvm-commits
mailing list