From 4dc004640d3768f4d01d3b9728d8a38d2d5a429c Mon Sep 17 00:00:00 2001 From: Marek Olsak Date: Tue, 3 Feb 2015 21:53:05 +0000 Subject: [PATCH] R600/SI: Rewrite VOP1InstSI to contain a pseudo and _si opcode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit What this does is that if you accidentally select these instructions on VI, the code generation will fail, because the pseudo -> _vi mapping will be undefined. The idea is to be able to catch possible future bugs easily. Tested-by: Michel Dänzer llvm-svn: 228038 --- lib/Target/R600/SIInstrInfo.td | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/lib/Target/R600/SIInstrInfo.td b/lib/Target/R600/SIInstrInfo.td index 0b0e47a1a9d..e10d8bc0596 100644 --- a/lib/Target/R600/SIInstrInfo.td +++ b/lib/Target/R600/SIInstrInfo.td @@ -842,6 +842,15 @@ multiclass VOP1_m pattern, SIMCInstr ; } +multiclass VOP1SI_m pattern, + string opName> { + def "" : VOP1_Pseudo ; + + def _si : VOP1, + SIMCInstr ; + // No VI instruction. This class is for SI only. +} + class VOP2_Pseudo pattern, string opName> : VOP2Common , VOP , @@ -938,6 +947,16 @@ multiclass VOP3_1_m ; } +multiclass VOP3SI_1_m pattern, string opName, bit HasMods = 1> { + + def "" : VOP3_Pseudo ; + + def _si : VOP3_Real_si , + VOP3DisableFields<0, 0, HasMods>; + // No VI instruction. This class is for SI only. +} + multiclass VOP3_2_m pattern, string opName, string revOp, bit HasMods = 1, bit UseFullOp = 0> { @@ -1045,17 +1064,14 @@ multiclass VOP1Inst { - def _e32 : VOP1 , - VOP ; + defm _e32 : VOP1SI_m ; - def _e64 : VOP3Common , - VOP , - VOP3e , - VOP3DisableFields<0, 0, P.HasModifiers>; + [(set P.DstVT:$dst, (node P.Src0VT:$src0))]), + opName, P.HasModifiers>; } multiclass VOP2_Helper