set_byte_on_condition.py revision 7087:fb8d5786ff30
172SN/A# Copyright (c) 2007 The Hewlett-Packard Development Company
213575Sciro.santilli@arm.com# All rights reserved.
313575Sciro.santilli@arm.com#
413575Sciro.santilli@arm.com# The license below extends only to copyright in the software and shall
513575Sciro.santilli@arm.com# not be construed as granting a license to any other intellectual
613575Sciro.santilli@arm.com# property including but not limited to intellectual property relating
713575Sciro.santilli@arm.com# to a hardware implementation of the functionality of the software
813575Sciro.santilli@arm.com# licensed hereunder.  You may use the software subject to the license
913575Sciro.santilli@arm.com# terms below provided that you ensure that this notice is replicated
1013575Sciro.santilli@arm.com# unmodified and in its entirety in all distributions of the software,
1113575Sciro.santilli@arm.com# modified or unmodified, in source code or in binary form.
1213575Sciro.santilli@arm.com#
1311274Sshingarov@labware.com# Redistribution and use in source and binary forms, with or without
1410597Sgabeblack@google.com# modification, are permitted provided that the following conditions are
151762SN/A# met: redistributions of source code must retain the above copyright
1672SN/A# notice, this list of conditions and the following disclaimer;
1772SN/A# redistributions in binary form must reproduce the above copyright
1872SN/A# notice, this list of conditions and the following disclaimer in the
1972SN/A# documentation and/or other materials provided with the distribution;
2072SN/A# neither the name of the copyright holders nor the names of its
2172SN/A# contributors may be used to endorse or promote products derived from
2272SN/A# this software without specific prior written permission.
2372SN/A#
2472SN/A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
2572SN/A# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
2672SN/A# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
2772SN/A# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2872SN/A# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2972SN/A# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3072SN/A# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3172SN/A# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3272SN/A# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3372SN/A# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3472SN/A# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3572SN/A#
3672SN/A# Authors: Gabe Black
3772SN/A
3872SN/Amicrocode = '''
3972SN/Adef macroop SALC_R
402665Ssaidi@eecs.umich.edu{
412665Ssaidi@eecs.umich.edu    sbb reg, reg, reg, dataSize=1
4211274Sshingarov@labware.com};
4372SN/A
4472SN/Adef macroop SETZ_R
452SN/A{
468332Snate@binkert.org    movi reg, reg, 1, flags=(CZF,)
478332Snate@binkert.org    movi reg, reg, 0, flags=(nCZF,)
482SN/A};
492SN/A
502SN/Adef macroop SETZ_M
512SN/A{
522SN/A    movi t1, t1, 1, flags=(CZF,)
532SN/A    movi t1, t1, 0, flags=(nCZF,)
542SN/A    st t1, seg, sib, disp
555543Ssaidi@eecs.umich.edu};
565543Ssaidi@eecs.umich.edu
572SN/Adef macroop SETZ_P
582SN/A{
592SN/A    rdip t7
602SN/A    movi t1, t1, 1, flags=(CZF,)
612SN/A    movi t1, t1, 0, flags=(nCZF,)
622SN/A    st t1, seg, riprel, disp
632SN/A};
642SN/A
652SN/Adef macroop SETNZ_R
662SN/A{
672SN/A    movi reg, reg, 1, flags=(nCZF,)
685543Ssaidi@eecs.umich.edu    movi reg, reg, 0, flags=(CZF,)
695543Ssaidi@eecs.umich.edu};
702SN/A
712SN/Adef macroop SETNZ_M
722SN/A{
732SN/A    movi t1, t1, 1, flags=(nCZF,)
742SN/A    movi t1, t1, 0, flags=(CZF,)
752SN/A    st t1, seg, sib, disp
762SN/A};
772SN/A
782SN/Adef macroop SETNZ_P
792SN/A{
802SN/A    rdip t7
812SN/A    movi t1, t1, 1, flags=(nCZF,)
822SN/A    movi t1, t1, 0, flags=(CZF,)
832SN/A    st t1, seg, riprel, disp
842SN/A};
852SN/A
865543Ssaidi@eecs.umich.edudef macroop SETB_R
872SN/A{
882SN/A    movi reg, reg, 1, flags=(CCF,)
892SN/A    movi reg, reg, 0, flags=(nCCF,)
902SN/A};
912SN/A
922SN/Adef macroop SETB_M
932SN/A{
942SN/A    movi t1, t1, 1, flags=(CCF,)
952SN/A    movi t1, t1, 0, flags=(nCCF,)
962SN/A    st t1, seg, sib, disp
972SN/A};
982SN/A
992SN/Adef macroop SETB_P
1002SN/A{
1012SN/A    rdip t7
1022SN/A    movi t1, t1, 1, flags=(CCF,)
1032SN/A    movi t1, t1, 0, flags=(nCCF,)
1042SN/A    st t1, seg, riprel, disp
1052SN/A};
1065543Ssaidi@eecs.umich.edu
1075543Ssaidi@eecs.umich.edudef macroop SETNB_R
1082SN/A{
1092SN/A    movi reg, reg, 1, flags=(nCCF,)
1102SN/A    movi reg, reg, 0, flags=(CCF,)
1112SN/A};
1122SN/A
1132SN/Adef macroop SETNB_M
1142SN/A{
1152SN/A    movi t1, t1, 1, flags=(nCCF,)
1162SN/A    movi t1, t1, 0, flags=(CCF,)
1172SN/A    st t1, seg, sib, disp
1182SN/A};
1192SN/A
1202SN/Adef macroop SETNB_P
1212SN/A{
1222SN/A    rdip t7
1232SN/A    movi t1, t1, 1, flags=(nCCF,)
1242SN/A    movi t1, t1, 0, flags=(CCF,)
1252SN/A    st t1, seg, riprel, disp
1262SN/A};
1272SN/A
1282SN/Adef macroop SETBE_R
1292SN/A{
1302SN/A    movi reg, reg, 1, flags=(CCvZF,)
1312SN/A    movi reg, reg, 0, flags=(nCCvZF,)
1322SN/A};
13311793Sbrandon.potter@amd.com
13411793Sbrandon.potter@amd.comdef macroop SETBE_M
1352SN/A{
1368229Snate@binkert.org    movi t1, t1, 1, flags=(CCvZF,)
1372SN/A    movi t1, t1, 0, flags=(nCCvZF,)
13811793Sbrandon.potter@amd.com    st t1, seg, sib, disp
13912019Sgabeblack@google.com};
1406712Snate@binkert.org
14113575Sciro.santilli@arm.comdef macroop SETBE_P
1421717SN/A{
1432SN/A    rdip t7
1442521SN/A    movi t1, t1, 1, flags=(CCvZF,)
14556SN/A    movi t1, t1, 0, flags=(nCCvZF,)
14656SN/A    st t1, seg, riprel, disp
14756SN/A};
1486658Snate@binkert.org
14910597Sgabeblack@google.comdef macroop SETNBE_R
1508229Snate@binkert.org{
1512680Sktlim@umich.edu    movi reg, reg, 1, flags=(nCCvZF,)
1528232Snate@binkert.org    movi reg, reg, 0, flags=(CCvZF,)
15311793Sbrandon.potter@amd.com};
1542521SN/A
1558706Sandreas.hansson@arm.comdef macroop SETNBE_M
1568784Sgblack@eecs.umich.edu{
1571717SN/A    movi t1, t1, 1, flags=(nCCvZF,)
1582SN/A    movi t1, t1, 0, flags=(CCvZF,)
1592SN/A    st t1, seg, sib, disp
1602107SN/A};
1612SN/A
16212031Sgabeblack@google.comdef macroop SETNBE_P
16312031Sgabeblack@google.com{
16412031Sgabeblack@google.com    rdip t7
16512031Sgabeblack@google.com    movi t1, t1, 1, flags=(nCCvZF,)
16612031Sgabeblack@google.com    movi t1, t1, 0, flags=(CCvZF,)
1673536Sgblack@eecs.umich.edu    st t1, seg, riprel, disp
1682SN/A};
16912449Sgabeblack@google.com
17012449Sgabeblack@google.comdef macroop SETS_R
17112449Sgabeblack@google.com{
17212449Sgabeblack@google.com    movi reg, reg, 1, flags=(CSF,)
17312449Sgabeblack@google.com    movi reg, reg, 0, flags=(nCSF,)
17412449Sgabeblack@google.com};
17512449Sgabeblack@google.com
17612449Sgabeblack@google.comdef macroop SETS_M
17712449Sgabeblack@google.com{
17812449Sgabeblack@google.com    movi t1, t1, 1, flags=(CSF,)
17912449Sgabeblack@google.com    movi t1, t1, 0, flags=(nCSF,)
18012449Sgabeblack@google.com    st t1, seg, sib, disp
18112449Sgabeblack@google.com};
18212449Sgabeblack@google.com
18312449Sgabeblack@google.comdef macroop SETS_P
18412449Sgabeblack@google.com{
18512466Sgabeblack@google.com    rdip t7
18612449Sgabeblack@google.com    movi t1, t1, 1, flags=(CSF,)
18712449Sgabeblack@google.com    movi t1, t1, 0, flags=(nCSF,)
18812449Sgabeblack@google.com    st t1, seg, riprel, disp
18912449Sgabeblack@google.com};
19012449Sgabeblack@google.com
19112449Sgabeblack@google.comdef macroop SETNS_R
19212449Sgabeblack@google.com{
19312449Sgabeblack@google.com    movi reg, reg, 1, flags=(nCSF,)
19412449Sgabeblack@google.com    movi reg, reg, 0, flags=(CSF,)
19512449Sgabeblack@google.com};
19612449Sgabeblack@google.com
19712449Sgabeblack@google.comdef macroop SETNS_M
19812449Sgabeblack@google.com{
19912449Sgabeblack@google.com    movi t1, t1, 1, flags=(nCSF,)
20012449Sgabeblack@google.com    movi t1, t1, 0, flags=(CSF,)
20112449Sgabeblack@google.com    st t1, seg, sib, disp
20212449Sgabeblack@google.com};
20312449Sgabeblack@google.com
20412449Sgabeblack@google.comdef macroop SETNS_P
20512449Sgabeblack@google.com{
20612449Sgabeblack@google.com    rdip t7
20712449Sgabeblack@google.com    movi t1, t1, 1, flags=(nCSF,)
20812449Sgabeblack@google.com    movi t1, t1, 0, flags=(CSF,)
20912449Sgabeblack@google.com    st t1, seg, riprel, disp
21012449Sgabeblack@google.com};
21112449Sgabeblack@google.com
21212449Sgabeblack@google.comdef macroop SETP_R
21312449Sgabeblack@google.com{
21412449Sgabeblack@google.com    movi reg, reg, 1, flags=(CPF,)
21512449Sgabeblack@google.com    movi reg, reg, 0, flags=(nCPF,)
21612449Sgabeblack@google.com};
21712449Sgabeblack@google.com
21812449Sgabeblack@google.comdef macroop SETP_M
21912449Sgabeblack@google.com{
22012449Sgabeblack@google.com    movi t1, t1, 1, flags=(CPF,)
22112449Sgabeblack@google.com    movi t1, t1, 0, flags=(nCPF,)
22212449Sgabeblack@google.com    st t1, seg, sib, disp
22312449Sgabeblack@google.com};
22412449Sgabeblack@google.com
22512449Sgabeblack@google.comdef macroop SETP_P
22612449Sgabeblack@google.com{
22712449Sgabeblack@google.com    rdip t7
22812449Sgabeblack@google.com    movi t1, t1, 1, flags=(CPF,)
22912449Sgabeblack@google.com    movi t1, t1, 0, flags=(nCPF,)
23012449Sgabeblack@google.com    st t1, seg, riprel, disp
23112449Sgabeblack@google.com};
23212449Sgabeblack@google.com
23312449Sgabeblack@google.comdef macroop SETNP_R
23412449Sgabeblack@google.com{
23512449Sgabeblack@google.com    movi reg, reg, 1, flags=(nCPF,)
23612449Sgabeblack@google.com    movi reg, reg, 0, flags=(CPF,)
23712449Sgabeblack@google.com};
23812449Sgabeblack@google.com
23912449Sgabeblack@google.comdef macroop SETNP_M
24012449Sgabeblack@google.com{
2412SN/A    movi t1, t1, 1, flags=(nCPF,)
24212449Sgabeblack@google.com    movi t1, t1, 0, flags=(CPF,)
2432SN/A    st t1, seg, sib, disp
24412449Sgabeblack@google.com};
24512449Sgabeblack@google.com
24612449Sgabeblack@google.comdef macroop SETNP_P
24712449Sgabeblack@google.com{
24812449Sgabeblack@google.com    rdip t7
24912449Sgabeblack@google.com    movi t1, t1, 1, flags=(nCPF,)
25012449Sgabeblack@google.com    movi t1, t1, 0, flags=(CPF,)
25112449Sgabeblack@google.com    st t1, seg, riprel, disp
25212449Sgabeblack@google.com};
25312449Sgabeblack@google.com
25412449Sgabeblack@google.comdef macroop SETL_R
25512449Sgabeblack@google.com{
25612449Sgabeblack@google.com    movi reg, reg, 1, flags=(CSxOF,)
25712449Sgabeblack@google.com    movi reg, reg, 0, flags=(nCSxOF,)
25812449Sgabeblack@google.com};
25912449Sgabeblack@google.com
26012449Sgabeblack@google.comdef macroop SETL_M
26112449Sgabeblack@google.com{
26212449Sgabeblack@google.com    movi t1, t1, 1, flags=(CSxOF,)
26312449Sgabeblack@google.com    movi t1, t1, 0, flags=(nCSxOF,)
26412449Sgabeblack@google.com    st t1, seg, sib, disp
26512449Sgabeblack@google.com};
26612449Sgabeblack@google.com
26712449Sgabeblack@google.comdef macroop SETL_P
26812449Sgabeblack@google.com{
26912449Sgabeblack@google.com    rdip t7
27012449Sgabeblack@google.com    movi t1, t1, 1, flags=(CSxOF,)
27112449Sgabeblack@google.com    movi t1, t1, 0, flags=(nCSxOF,)
27212449Sgabeblack@google.com    st t1, seg, riprel, disp
27312449Sgabeblack@google.com};
27412449Sgabeblack@google.com
27512449Sgabeblack@google.comdef macroop SETNL_R
27612449Sgabeblack@google.com{
27712449Sgabeblack@google.com    movi reg, reg, 1, flags=(nCSxOF,)
27812449Sgabeblack@google.com    movi reg, reg, 0, flags=(CSxOF,)
27912449Sgabeblack@google.com};
28012449Sgabeblack@google.com
28112449Sgabeblack@google.comdef macroop SETNL_M
28212449Sgabeblack@google.com{
28312449Sgabeblack@google.com    movi t1, t1, 1, flags=(nCSxOF,)
28412449Sgabeblack@google.com    movi t1, t1, 0, flags=(CSxOF,)
28512449Sgabeblack@google.com    st t1, seg, sib, disp
28612449Sgabeblack@google.com};
28712449Sgabeblack@google.com
28812449Sgabeblack@google.comdef macroop SETNL_P
28912449Sgabeblack@google.com{
29012449Sgabeblack@google.com    rdip t7
29112449Sgabeblack@google.com    movi t1, t1, 1, flags=(nCSxOF,)
29212449Sgabeblack@google.com    movi t1, t1, 0, flags=(CSxOF,)
29312449Sgabeblack@google.com    st t1, seg, riprel, disp
29412449Sgabeblack@google.com};
29512449Sgabeblack@google.com
29612449Sgabeblack@google.comdef macroop SETLE_R
29712449Sgabeblack@google.com{
29812449Sgabeblack@google.com    movi reg, reg, 1, flags=(CSxOvZF,)
29912449Sgabeblack@google.com    movi reg, reg, 0, flags=(nCSxOvZF,)
30012449Sgabeblack@google.com};
30112449Sgabeblack@google.com
30212449Sgabeblack@google.comdef macroop SETLE_M
30312487Snikos.nikoleris@arm.com{
30412449Sgabeblack@google.com    movi t1, t1, 1, flags=(CSxOvZF,)
30512449Sgabeblack@google.com    movi t1, t1, 0, flags=(nCSxOvZF,)
30612449Sgabeblack@google.com    st t1, seg, sib, disp
30712449Sgabeblack@google.com};
30812449Sgabeblack@google.com
30912449Sgabeblack@google.comdef macroop SETLE_P
31012449Sgabeblack@google.com{
31112449Sgabeblack@google.com    rdip t7
31212449Sgabeblack@google.com    movi t1, t1, 1, flags=(CSxOvZF,)
31312449Sgabeblack@google.com    movi t1, t1, 0, flags=(nCSxOvZF,)
3141910SN/A    st t1, seg, riprel, disp
3152SN/A};
31612487Snikos.nikoleris@arm.com
3172SN/Adef macroop SETNLE_R
31812449Sgabeblack@google.com{
3192SN/A    movi reg, reg, 1, flags=(nCSxOvZF,)
32012449Sgabeblack@google.com    movi reg, reg, 0, flags=(CSxOvZF,)
32112449Sgabeblack@google.com};
3222SN/A
32312449Sgabeblack@google.comdef macroop SETNLE_M
3242SN/A{
3252SN/A    movi t1, t1, 1, flags=(nCSxOvZF,)
3261910SN/A    movi t1, t1, 0, flags=(CSxOvZF,)
3272SN/A    st t1, seg, sib, disp
32812449Sgabeblack@google.com};
32912449Sgabeblack@google.com
33012449Sgabeblack@google.comdef macroop SETNLE_P
33112449Sgabeblack@google.com{
3322SN/A    rdip t7
33312449Sgabeblack@google.com    movi t1, t1, 1, flags=(nCSxOvZF,)
33412449Sgabeblack@google.com    movi t1, t1, 0, flags=(CSxOvZF,)
33512449Sgabeblack@google.com    st t1, seg, riprel, disp
33612449Sgabeblack@google.com};
33712449Sgabeblack@google.com
33812449Sgabeblack@google.comdef macroop SETO_R
33912449Sgabeblack@google.com{
3402SN/A    movi reg, reg, 1, flags=(COF,)
3412SN/A    movi reg, reg, 0, flags=(nCOF,)
342507SN/A};
34312449Sgabeblack@google.com
344507SN/Adef macroop SETO_M
34512449Sgabeblack@google.com{
346507SN/A    movi t1, t1, 1, flags=(COF,)
347507SN/A    movi t1, t1, 0, flags=(nCOF,)
3482SN/A    st t1, seg, sib, disp
34912449Sgabeblack@google.com};
3502SN/A
3515523Snate@binkert.orgdef macroop SETO_P
3525523Snate@binkert.org{
3535523Snate@binkert.org    rdip t7
3545523Snate@binkert.org    movi t1, t1, 1, flags=(COF,)
3555523Snate@binkert.org    movi t1, t1, 0, flags=(nCOF,)
35612449Sgabeblack@google.com    st t1, seg, riprel, disp
35712449Sgabeblack@google.com};
35812449Sgabeblack@google.com
3592SN/Adef macroop SETNO_R
3602SN/A{
36112449Sgabeblack@google.com    movi reg, reg, 1, flags=(nCOF,)
36212449Sgabeblack@google.com    movi reg, reg, 0, flags=(COF,)
3631910SN/A};
3641910SN/A
36512449Sgabeblack@google.comdef macroop SETNO_M
3662SN/A{
3672SN/A    movi t1, t1, 1, flags=(nCOF,)
3682SN/A    movi t1, t1, 0, flags=(COF,)
36912449Sgabeblack@google.com    st t1, seg, sib, disp
3702SN/A};
37112449Sgabeblack@google.com
37212449Sgabeblack@google.comdef macroop SETNO_P
3732SN/A{
3742SN/A    rdip t7
3752SN/A    movi t1, t1, 1, flags=(nCOF,)
3762SN/A    movi t1, t1, 0, flags=(COF,)
37712449Sgabeblack@google.com    st t1, seg, riprel, disp
3782SN/A};
3792SN/A'''
38012449Sgabeblack@google.com