//===-- SIInstrFormats.td - SI Instruction Formats ------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // SI Instruction format definitions. // // Instructions with _32 take 32-bit operands. // Instructions with _64 take 64-bit operands. // // VOP_* instructions can use either a 32-bit or 64-bit encoding. The 32-bit // encoding is the standard encoding, but instruction that make use of // any of the instruction modifiers must use the 64-bit encoding. // // Instructions with _e32 use the 32-bit encoding. // Instructions with _e64 use the 64-bit encoding. // //===----------------------------------------------------------------------===// class VOP3_32 op, string opName, list pattern> : VOP3 ; class VOP3_64 op, string opName, list pattern> : VOP3 ; class SOP1_32 op, string opName, list pattern> : SOP1 ; class SOP1_64 op, string opName, list pattern> : SOP1 ; class SOP2_32 op, string opName, list pattern> : SOP2 ; class SOP2_64 op, string opName, list pattern> : SOP2 ; class SOP2_VCC op, string opName, list pattern> : SOP2 ; class VOP1_Helper op, RegisterClass vrc, RegisterClass arc, string opName, list pattern> : VOP1 < op, (outs vrc:$dst), (ins arc:$src0), opName, pattern >; multiclass VOP1_32 op, string opName, list pattern> { def _e32: VOP1_Helper ; def _e64 : VOP3_32 <{1, 1, op{6}, op{5}, op{4}, op{3}, op{2}, op{1}, op{0}}, opName, [] >; } multiclass VOP1_64 op, string opName, list pattern> { def _e32 : VOP1_Helper ; def _e64 : VOP3_64 < {1, 1, op{6}, op{5}, op{4}, op{3}, op{2}, op{1}, op{0}}, opName, [] >; } class VOP2_Helper op, RegisterClass vrc, RegisterClass arc, string opName, list pattern> : VOP2 < op, (outs vrc:$dst), (ins arc:$src0, vrc:$src1), opName, pattern >; multiclass VOP2_32 op, string opName, list pattern> { def _e32 : VOP2_Helper ; def _e64 : VOP3_32 <{1, 0, 0, op{5}, op{4}, op{3}, op{2}, op{1}, op{0}}, opName, [] >; } multiclass VOP2_64 op, string opName, list pattern> { def _e32: VOP2_Helper ; def _e64 : VOP3_64 < {1, 0, 0, op{5}, op{4}, op{3}, op{2}, op{1}, op{0}}, opName, [] >; } class SOPK_32 op, string opName, list pattern> : SOPK ; class SOPK_64 op, string opName, list pattern> : SOPK ; class VOPC_Helper op, RegisterClass vrc, RegisterClass arc, string opName, list pattern> : VOPC < op, (ins arc:$src0, vrc:$src1), opName, pattern >; multiclass VOPC_32 op, string opName, list pattern> { def _e32 : VOPC_Helper ; def _e64 : VOP3_32 < {0, op{7}, op{6}, op{5}, op{4}, op{3}, op{2}, op{1}, op{0}}, opName, [] >; } multiclass VOPC_64 op, string opName, list pattern> { def _e32 : VOPC_Helper ; def _e64 : VOP3_64 < {0, op{7}, op{6}, op{5}, op{4}, op{3}, op{2}, op{1}, op{0}}, opName, [] >; } class SOPC_32 op, string opName, list pattern> : SOPC ; class SOPC_64 op, string opName, list pattern> : SOPC ;