compare.py revision 7087
113540Sandrea.mondelli@ucf.edu# Copyright (c) 2007 The Hewlett-Packard Development Company
211398SN/A# All rights reserved.
311398SN/A#
411398SN/A# The license below extends only to copyright in the software and shall
511398SN/A# not be construed as granting a license to any other intellectual
611398SN/A# property including but not limited to intellectual property relating
711398SN/A# to a hardware implementation of the functionality of the software
811398SN/A# licensed hereunder.  You may use the software subject to the license
911398SN/A# terms below provided that you ensure that this notice is replicated
1011398SN/A# unmodified and in its entirety in all distributions of the software,
1111398SN/A# modified or unmodified, in source code or in binary form.
1211398SN/A#
1311398SN/A# Redistribution and use in source and binary forms, with or without
1411398SN/A# modification, are permitted provided that the following conditions are
1511397SN/A# met: redistributions of source code must retain the above copyright
1611397SN/A# notice, this list of conditions and the following disclaimer;
1711397SN/A# redistributions in binary form must reproduce the above copyright
1811397SN/A# notice, this list of conditions and the following disclaimer in the
1911397SN/A# documentation and/or other materials provided with the distribution;
2011397SN/A# neither the name of the copyright holders nor the names of its
2111397SN/A# contributors may be used to endorse or promote products derived from
2211397SN/A# this software without specific prior written permission.
2311397SN/A#
2411397SN/A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
2511397SN/A# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
2611397SN/A# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
2711397SN/A# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2811397SN/A# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2911397SN/A# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3011397SN/A# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3111397SN/A# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3211397SN/A# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3311397SN/A# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3411397SN/A# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3511397SN/A#
3611397SN/A# Authors: Gabe Black
3711397SN/A
3811397SN/Amicrocode = '''
3911397SN/Adef macroop CMP_R_M
4011397SN/A{
4111397SN/A    ld t1, seg, sib, disp
4211398SN/A    sub t0, reg, t1, flags=(OF, SF, ZF, AF, PF, CF)
4311397SN/A};
448225SN/A
458225SN/Adef macroop CMP_R_P
468225SN/A{
478225SN/A    rdip t7
488225SN/A    ld t1, seg, riprel, disp
498225SN/A    sub t0, reg, t1, flags=(OF, SF, ZF, AF, PF, CF)
508225SN/A};
518225SN/A
528225SN/Adef macroop CMP_M_I
538225SN/A{
548225SN/A    limm t2, imm
558225SN/A    ld t1, seg, sib, disp
568225SN/A    sub t0, t1, t2, flags=(OF, SF, ZF, AF, PF, CF)
578225SN/A};
588225SN/A
598225SN/Adef macroop CMP_P_I
608225SN/A{
618225SN/A    limm t2, imm
628225SN/A    rdip t7
638225SN/A    ld t1, seg, riprel, disp
648225SN/A    sub t0, t1, t2, flags=(OF, SF, ZF, AF, PF, CF)
658225SN/A};
668225SN/A
678225SN/Adef macroop CMP_M_R
688225SN/A{
698225SN/A    ld t1, seg, sib, disp
708225SN/A    sub t0, t1, reg, flags=(OF, SF, ZF, AF, PF, CF)
718225SN/A};
728225SN/A
738225SN/Adef macroop CMP_P_R
748225SN/A{
758225SN/A    rdip t7
768225SN/A    ld t1, seg, riprel, disp
778225SN/A    sub t0, t1, reg, flags=(OF, SF, ZF, AF, PF, CF)
788225SN/A};
798225SN/A
808225SN/Adef macroop CMP_R_R
818225SN/A{
828225SN/A    sub t0, reg, regm, flags=(OF, SF, ZF, AF, PF, CF)
838225SN/A};
848225SN/A
858225SN/Adef macroop CMP_R_I
868225SN/A{
878225SN/A    limm t1, imm
888225SN/A    sub t0, reg, t1, flags=(OF, SF, ZF, AF, PF, CF)
898225SN/A};
908225SN/A'''
918225SN/A