summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeon/AMDGPUInstructions.td
diff options
context:
space:
mode:
authorTom Stellard <[email protected]>2012-04-19 10:09:52 -0400
committerTom Stellard <[email protected]>2012-04-23 09:34:05 -0400
commit519789d7e6f32efa0e01a9fbc7374bc494d76769 (patch)
tree233e888c27625634b99e2fd87d34c2a32efad5ad /src/gallium/drivers/radeon/AMDGPUInstructions.td
parent3c0f521cbfb551bf69cc14c606dcdd20c0529589 (diff)
r600g/llvm: Let ISel handle lowering to {INSERT,EXTRACT}_SUBREG
Diffstat (limited to 'src/gallium/drivers/radeon/AMDGPUInstructions.td')
-rw-r--r--src/gallium/drivers/radeon/AMDGPUInstructions.td21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeon/AMDGPUInstructions.td b/src/gallium/drivers/radeon/AMDGPUInstructions.td
index 10eceb6ce53..0433c8dcd95 100644
--- a/src/gallium/drivers/radeon/AMDGPUInstructions.td
+++ b/src/gallium/drivers/radeon/AMDGPUInstructions.td
@@ -84,6 +84,27 @@ class POW_Common <AMDGPUInst log_ieee, AMDGPUInst exp_ieee, AMDGPUInst mul,
(exp_ieee (mul rc:$src1, (log_ieee rc:$src0)))
>;
+/* Other helper patterns */
+/* --------------------- */
+
+/* Extract element pattern */
+class Extract_Element <ValueType sub_type, ValueType vec_type,
+ RegisterClass vec_class, int sub_idx,
+ SubRegIndex sub_reg>: Pat<
+ (sub_type (vector_extract (vec_type vec_class:$src), sub_idx)),
+ (EXTRACT_SUBREG vec_class:$src, sub_reg)
+>;
+
+/* Insert element pattern */
+class Insert_Element <ValueType elem_type, ValueType vec_type,
+ RegisterClass elem_class, RegisterClass vec_class,
+ int sub_idx, SubRegIndex sub_reg> : Pat <
+
+ (vec_type (vector_insert (vec_type vec_class:$vec),
+ (elem_type elem_class:$elem), sub_idx)),
+ (INSERT_SUBREG vec_class:$vec, elem_class:$elem, sub_reg)
+>;
+
include "R600Instructions.td"
include "SIInstrInfo.td"