mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-12 14:06:36 +00:00
4428c3483b
This patch removes the SetCC instructions and replaces them with the ICmp and FCmp instructions. The SetCondInst instruction has been removed and been replaced with ICmpInst and FCmpInst. llvm-svn: 32751
192 lines
6.5 KiB
C++
192 lines
6.5 KiB
C++
//===-- llvm/Instruction.def - File that describes Instructions -*- C++ -*-===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file was developed by the LLVM research group and is distributed under
|
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This file contains descriptions of the various LLVM instructions. This is
|
|
// used as a central place for enumerating the different instructions and
|
|
// should eventually be the place to put comments about the instructions.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// NOTE: NO INCLUDE GUARD DESIRED!
|
|
|
|
// Provide definitions of macros so that users of this file do not have to
|
|
// define everything to use it...
|
|
//
|
|
#ifndef FIRST_TERM_INST
|
|
#define FIRST_TERM_INST(num)
|
|
#endif
|
|
#ifndef HANDLE_TERM_INST
|
|
#ifndef HANDLE_INST
|
|
#define HANDLE_TERM_INST(num, opcode, Class)
|
|
#else
|
|
#define HANDLE_TERM_INST(num, opcode, Class) HANDLE_INST(num, opcode, Class)
|
|
#endif
|
|
#endif
|
|
#ifndef LAST_TERM_INST
|
|
#define LAST_TERM_INST(num)
|
|
#endif
|
|
|
|
#ifndef FIRST_BINARY_INST
|
|
#define FIRST_BINARY_INST(num)
|
|
#endif
|
|
#ifndef HANDLE_BINARY_INST
|
|
#ifndef HANDLE_INST
|
|
#define HANDLE_BINARY_INST(num, opcode, instclass)
|
|
#else
|
|
#define HANDLE_BINARY_INST(num, opcode, Class) HANDLE_INST(num, opcode, Class)
|
|
#endif
|
|
#endif
|
|
#ifndef LAST_BINARY_INST
|
|
#define LAST_BINARY_INST(num)
|
|
#endif
|
|
|
|
#ifndef FIRST_MEMORY_INST
|
|
#define FIRST_MEMORY_INST(num)
|
|
#endif
|
|
#ifndef HANDLE_MEMORY_INST
|
|
#ifndef HANDLE_INST
|
|
#define HANDLE_MEMORY_INST(num, opcode, Class)
|
|
#else
|
|
#define HANDLE_MEMORY_INST(num, opcode, Class) HANDLE_INST(num, opcode, Class)
|
|
#endif
|
|
#endif
|
|
#ifndef LAST_MEMORY_INST
|
|
#define LAST_MEMORY_INST(num)
|
|
#endif
|
|
|
|
#ifndef FIRST_CAST_INST
|
|
#define FIRST_CAST_INST(num)
|
|
#endif
|
|
#ifndef HANDLE_CAST_INST
|
|
#ifndef HANDLE_INST
|
|
#define HANDLE_CAST_INST(num, opcode, Class)
|
|
#else
|
|
#define HANDLE_CAST_INST(num, opcode, Class) HANDLE_INST(num, opcode, Class)
|
|
#endif
|
|
#endif
|
|
#ifndef LAST_CAST_INST
|
|
#define LAST_CAST_INST(num)
|
|
#endif
|
|
|
|
#ifndef FIRST_OTHER_INST
|
|
#define FIRST_OTHER_INST(num)
|
|
#endif
|
|
#ifndef HANDLE_OTHER_INST
|
|
#ifndef HANDLE_INST
|
|
#define HANDLE_OTHER_INST(num, opcode, Class)
|
|
#else
|
|
#define HANDLE_OTHER_INST(num, opcode, Class) HANDLE_INST(num, opcode, Class)
|
|
#endif
|
|
#endif
|
|
#ifndef LAST_OTHER_INST
|
|
#define LAST_OTHER_INST(num)
|
|
#endif
|
|
|
|
|
|
// Terminator Instructions - These instructions are used to terminate a basic
|
|
// block of the program. Every basic block must end with one of these
|
|
// instructions for it to be a well formed basic block.
|
|
//
|
|
FIRST_TERM_INST ( 1)
|
|
HANDLE_TERM_INST ( 1, Ret , ReturnInst)
|
|
HANDLE_TERM_INST ( 2, Br , BranchInst)
|
|
HANDLE_TERM_INST ( 3, Switch , SwitchInst)
|
|
HANDLE_TERM_INST ( 4, Invoke , InvokeInst)
|
|
HANDLE_TERM_INST ( 5, Unwind , UnwindInst)
|
|
HANDLE_TERM_INST ( 6, Unreachable, UnreachableInst)
|
|
LAST_TERM_INST ( 6)
|
|
|
|
// Standard binary operators...
|
|
FIRST_BINARY_INST( 7)
|
|
HANDLE_BINARY_INST( 7, Add , BinaryOperator)
|
|
HANDLE_BINARY_INST( 8, Sub , BinaryOperator)
|
|
HANDLE_BINARY_INST( 9, Mul , BinaryOperator)
|
|
HANDLE_BINARY_INST(10, UDiv , BinaryOperator)
|
|
HANDLE_BINARY_INST(11, SDiv , BinaryOperator)
|
|
HANDLE_BINARY_INST(12, FDiv , BinaryOperator)
|
|
HANDLE_BINARY_INST(13, URem , BinaryOperator)
|
|
HANDLE_BINARY_INST(14, SRem , BinaryOperator)
|
|
HANDLE_BINARY_INST(15, FRem , BinaryOperator)
|
|
|
|
// Logical operators...
|
|
HANDLE_BINARY_INST(16, And , BinaryOperator)
|
|
HANDLE_BINARY_INST(17, Or , BinaryOperator)
|
|
HANDLE_BINARY_INST(18, Xor , BinaryOperator)
|
|
LAST_BINARY_INST(18)
|
|
|
|
// Memory operators...
|
|
FIRST_MEMORY_INST(19)
|
|
HANDLE_MEMORY_INST(19, Malloc, MallocInst) // Heap management instructions
|
|
HANDLE_MEMORY_INST(20, Free , FreeInst )
|
|
HANDLE_MEMORY_INST(21, Alloca, AllocaInst) // Stack management
|
|
HANDLE_MEMORY_INST(22, Load , LoadInst ) // Memory manipulation instrs
|
|
HANDLE_MEMORY_INST(23, Store , StoreInst )
|
|
HANDLE_MEMORY_INST(24, GetElementPtr, GetElementPtrInst)
|
|
LAST_MEMORY_INST(24)
|
|
|
|
// Cast operators ...
|
|
// NOTE: The order matters here because CastInst::isEliminableCastPair
|
|
// NOTE: (see Instructions.cpp) encodes a table based on this ordering.
|
|
FIRST_CAST_INST(25)
|
|
HANDLE_CAST_INST(25, Trunc , TruncInst ) // Truncate integers
|
|
HANDLE_CAST_INST(26, ZExt , ZExtInst ) // Zero extend integers
|
|
HANDLE_CAST_INST(27, SExt , SExtInst ) // Sign extend integers
|
|
HANDLE_CAST_INST(28, FPToUI , FPToUIInst ) // floating point -> UInt
|
|
HANDLE_CAST_INST(29, FPToSI , FPToSIInst ) // floating point -> SInt
|
|
HANDLE_CAST_INST(30, UIToFP , UIToFPInst ) // UInt -> floating point
|
|
HANDLE_CAST_INST(31, SIToFP , SIToFPInst ) // SInt -> floating point
|
|
HANDLE_CAST_INST(32, FPTrunc , FPTruncInst ) // Truncate floating point
|
|
HANDLE_CAST_INST(33, FPExt , FPExtInst ) // Extend floating point
|
|
HANDLE_CAST_INST(34, PtrToInt, PtrToIntInst) // Pointer -> Integer
|
|
HANDLE_CAST_INST(35, IntToPtr, IntToPtrInst) // Integer -> Pointer
|
|
HANDLE_CAST_INST(36, BitCast , BitCastInst ) // Type cast
|
|
LAST_CAST_INST(36)
|
|
|
|
// Other operators...
|
|
FIRST_OTHER_INST(37)
|
|
HANDLE_OTHER_INST(37, ICmp , ICmpInst ) // Integer comparison instruction
|
|
HANDLE_OTHER_INST(38, FCmp , FCmpInst ) // Floating point comparison instr.
|
|
HANDLE_OTHER_INST(39, PHI , PHINode ) // PHI node instruction
|
|
HANDLE_OTHER_INST(40, Call , CallInst ) // Call a function
|
|
HANDLE_OTHER_INST(41, Shl , ShiftInst ) // Shift Left operations (logical)
|
|
HANDLE_OTHER_INST(42, LShr , ShiftInst ) // Logical Shift right (unsigned)
|
|
HANDLE_OTHER_INST(43, AShr , ShiftInst ) // Arithmetic shift right (signed)
|
|
HANDLE_OTHER_INST(44, Select , SelectInst ) // select instruction
|
|
HANDLE_OTHER_INST(45, UserOp1, Instruction) // May be used internally in a pass
|
|
HANDLE_OTHER_INST(46, UserOp2, Instruction) // Internal to passes only
|
|
HANDLE_OTHER_INST(47, VAArg , VAArgInst ) // vaarg instruction
|
|
HANDLE_OTHER_INST(48, ExtractElement, ExtractElementInst)// extract from vector.
|
|
HANDLE_OTHER_INST(49, InsertElement, InsertElementInst) // insert into vector
|
|
HANDLE_OTHER_INST(50, ShuffleVector, ShuffleVectorInst) // shuffle two vectors.
|
|
LAST_OTHER_INST(50)
|
|
|
|
#undef FIRST_TERM_INST
|
|
#undef HANDLE_TERM_INST
|
|
#undef LAST_TERM_INST
|
|
|
|
#undef FIRST_BINARY_INST
|
|
#undef HANDLE_BINARY_INST
|
|
#undef LAST_BINARY_INST
|
|
|
|
#undef FIRST_MEMORY_INST
|
|
#undef HANDLE_MEMORY_INST
|
|
#undef LAST_MEMORY_INST
|
|
|
|
#undef FIRST_CAST_INST
|
|
#undef HANDLE_CAST_INST
|
|
#undef LAST_CAST_INST
|
|
|
|
#undef FIRST_OTHER_INST
|
|
#undef HANDLE_OTHER_INST
|
|
#undef LAST_OTHER_INST
|
|
|
|
#ifdef HANDLE_INST
|
|
#undef HANDLE_INST
|
|
#endif
|