Index: include/llvm/Target/Target.td =================================================================== --- include/llvm/Target/Target.td +++ include/llvm/Target/Target.td @@ -1553,3 +1553,8 @@ // Pull in the common support for the Global ISel DAG-based selector generation. // include "llvm/Target/GlobalISel/SelectionDAGCompat.td" + +//===----------------------------------------------------------------------===// +// Pull in the common support for exegesis. +// +include "llvm/Target/TargetExegesis.td" Index: include/llvm/Target/TargetExegesis.td =================================================================== --- /dev/null +++ include/llvm/Target/TargetExegesis.td @@ -0,0 +1,52 @@ +//===- TargetSchedule.td - Target Independent Scheduling ---*- tablegen -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +class OperandValue; + +class ExegesisConfiguration { + Instruction Instruction = ?; + list OperandValues; +} + +class ScalarValue : OperandValue; + +class PackedValue : OperandValue { + ScalarValue BroadcastValue; +} + +// Floating Point description + +class Ieee754Precision; +def HalfPrecision : Ieee754Precision; +def SinglePrecision : Ieee754Precision; +def DoublePrecision : Ieee754Precision; +def X87Precision : Ieee754Precision; + +class RawExponentValue; +def RawExponentZero : RawExponentValue; +def RawExponentMax : RawExponentValue; +def RawExponentBias : RawExponentValue; + +class MantissaValue; +def MantissaZero : MantissaValue; +def MantissaOne : MantissaValue; +def MantissaMax : MantissaValue; + +class Ieee754 : ScalarValue { + Ieee754Precision Precision; + bit Sign; + RawExponentValue Exponent; + MantissaValue Mantissa; +} + +// Integer Description. + +class Integer : ScalarValue { + list Bits; +} Index: lib/Target/X86/X86.td =================================================================== --- lib/Target/X86/X86.td +++ lib/Target/X86/X86.td @@ -1200,3 +1200,9 @@ //===----------------------------------------------------------------------===// include "X86PfmCounters.td" + +//===----------------------------------------------------------------------===// +// Exegesis Configurations +//===----------------------------------------------------------------------===// + +include "X86ExegesisConfigurations.td" Index: lib/Target/X86/X86ExegesisConfigurations.td =================================================================== --- /dev/null +++ lib/Target/X86/X86ExegesisConfigurations.td @@ -0,0 +1,27 @@ +def One : Ieee754 { + let Precision = SinglePrecision; + let Sign = 0; + let Exponent = RawExponentBias; + let Mantissa = MantissaZero; +} + +def OnePlusEpsilon : Ieee754 { + let Precision = SinglePrecision; + let Sign = 0; + let Exponent = RawExponentBias; + let Mantissa = MantissaOne; +} + +def PackedOnes : PackedValue { + let BroadcastValue = One; +} + +def PackedOnePlusEpsilons : PackedValue { + let BroadcastValue = OnePlusEpsilon; +} + +let Instruction = VDIVPDrr in { + def VDIVPDrrExegesisConfiguration : ExegesisConfiguration { + let OperandValues = [PackedOnes, PackedOnePlusEpsilons]; + } +}