1// Copyright (c) 2007 The Hewlett-Packard Development Company |
2// Copyright (c) 2012-2013 Mark D. Hill and David A. Wood |
3// All rights reserved. 4// 5// The license below extends only to copyright in the software and shall 6// not be construed as granting a license to any other intellectual 7// property including but not limited to intellectual property relating 8// to a hardware implementation of the functionality of the software 9// licensed hereunder. You may use the software subject to the license 10// terms below provided that you ensure that this notice is replicated --- 19 unchanged lines hidden (view full) --- 30// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36// 37// Authors: Gabe Black |
38// Nilay Vaish |
39 40////////////////////////////////////////////////////////////////////////// 41// 42// FpOp Microop templates 43// 44////////////////////////////////////////////////////////////////////////// 45 46def template MicroFpOpExecute {{ --- 208 unchanged lines hidden (view full) --- 255 code = 'FpDestReg = sqrt(FpSrcReg2);' 256 257 class Cosfp(FpUnaryOp): 258 code = 'FpDestReg = cos(FpSrcReg1);' 259 260 class Sinfp(FpUnaryOp): 261 code = 'FpDestReg = sin(FpSrcReg1);' 262 |
263 class Tanfp(FpUnaryOp): 264 code = 'FpDestReg = tan(FpSrcReg1);' |
265 |
266 |
267 # Conversion microops 268 class ConvOp(FpBinaryOp): 269 abstract = True 270 def __init__(self, dest, src1): 271 super(ConvOp, self).__init__(dest, src1, \ 272 "InstRegIndex(FLOATREG_MICROFP0)") 273 274 # These probably shouldn't look at the ExtMachInst directly to figure --- 30 unchanged lines hidden (view full) --- 305 code = 'FpDestReg = FpSrcReg1 * FpSrcReg2;' 306 307 class divfp(FpBinaryOp): 308 code = 'FpDestReg = FpSrcReg1 / FpSrcReg2;' 309 310 class subfp(FpBinaryOp): 311 code = 'FpDestReg = FpSrcReg1 - FpSrcReg2;' 312 |
313 class Yl2xFp(FpBinaryOp): 314 code = ''' 315 FpDestReg = FpSrcReg2 * (log(FpSrcReg1) / log(2)); 316 ''' 317 318 class PremFp(FpBinaryOp): 319 code = ''' 320 FpDestReg = fmod(FpSrcReg1, FpSrcReg2); 321 DPRINTF(X86, "src1: %lf, src2: %lf, dest: %lf\\n", FpSrcReg1, FpSrcReg2, FpDestReg); 322 ''' 323 |
324 class Compfp(FpBinaryOp): 325 def __init__(self, src1, src2, spm=0, setStatus=False, \ 326 dataSize="env.dataSize"): 327 super(Compfp, self).__init__("InstRegIndex(FLOATREG_MICROFP0)", \ 328 src1, src2, spm, setStatus, dataSize) 329 # This class sets the condition codes in rflags according to the 330 # rules for comparing floating point. 331 code = ''' --- 27 unchanged lines hidden --- |