[Mesa-dev] [PATCH 14/14] R600/SI: inline V_ADD|SUB_F32 patterns
Tom Stellard
tom at stellard.net
Thu Feb 21 06:19:26 PST 2013
On Wed, Feb 20, 2013 at 06:47:00PM +0100, Christian König wrote:
> From: Christian König <christian.koenig at amd.com>
>
> Signed-off-by: Christian König <christian.koenig at amd.com>
> ---
> lib/Target/R600/SIInstructions.td | 14 +++++---------
> 1 file changed, 5 insertions(+), 9 deletions(-)
>
> diff --git a/lib/Target/R600/SIInstructions.td b/lib/Target/R600/SIInstructions.td
> index 71ae33b..9ea26d2 100644
> --- a/lib/Target/R600/SIInstructions.td
> +++ b/lib/Target/R600/SIInstructions.td
> @@ -746,17 +746,13 @@ def : Pat <
> defm V_READLANE_B32 : VOP2_32 <0x00000001, "V_READLANE_B32", []>;
> defm V_WRITELANE_B32 : VOP2_32 <0x00000002, "V_WRITELANE_B32", []>;
>
> -defm V_ADD_F32 : VOP2_32 <0x00000003, "V_ADD_F32", []>;
> -def : Pat <
> - (f32 (fadd VSrc_32:$src0, VReg_32:$src1)),
> - (V_ADD_F32_e32 VSrc_32:$src0, VReg_32:$src1)
> +defm V_ADD_F32 : VOP2_32 <0x00000003, "V_ADD_F32",
> + [(set VReg_32:$dst, (fadd VSrc_32:$src0, VReg_32:$src1))]
> >;
> -
> -defm V_SUB_F32 : VOP2_32 <0x00000004, "V_SUB_F32", []>;
> -def : Pat <
> - (f32 (fsub VSrc_32:$src0, VReg_32:$src1)),
> - (V_SUB_F32_e32 VSrc_32:$src0, VReg_32:$src1)
> +defm V_SUB_F32 : VOP2_32 <0x00000004, "V_SUB_F32",
> + [(set VReg_32:$dst, (fsub VSrc_32:$src0, VReg_32:$src1))]
> >;
> +
This looks good for now, but in the future it may be useful to simplify
all the VOP* and SOP* patterns by adding a helper that takes only an
SDPatternOperator as an argument and use that to build the pattern.
As an example, take a look at the R600_[123]OP_Helper classes in
R600Instructions.td
> defm V_SUBREV_F32 : VOP2_32 <0x00000005, "V_SUBREV_F32", []>;
> defm V_MAC_LEGACY_F32 : VOP2_32 <0x00000006, "V_MAC_LEGACY_F32", []>;
> defm V_MUL_LEGACY_F32 : VOP2_32 <
> --
> 1.7.10.4
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the mesa-dev
mailing list