1c1
< # Copyright (c) 2007 The Hewlett-Packard Development Company
---
> # Copyright (c) 2008 The Regents of The University of Michigan
3a4,31
> # Redistribution and use in source and binary forms, with or without
> # modification, are permitted provided that the following conditions are
> # met: redistributions of source code must retain the above copyright
> # notice, this list of conditions and the following disclaimer;
> # redistributions in binary form must reproduce the above copyright
> # notice, this list of conditions and the following disclaimer in the
> # documentation and/or other materials provided with the distribution;
> # neither the name of the copyright holders nor the names of its
> # contributors may be used to endorse or promote products derived from
> # this software without specific prior written permission.
> #
> # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
> # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
> # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
> # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
> # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
> # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
> # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> #
> # Authors: Gabe Black
>
> # Copyright (c) 2007-2008 The Hewlett-Packard Development Company
> # All rights reserved.
> #
66,69c94
< srai t2, t1, "(env.dataSize == 8) ? 3 : ((env.dataSize == 4) ? 2 : 1)", \
< dataSize=asz
< add t2, t2, base, dataSize=asz
< ld t1, seg, [scale, index, t2], disp
---
> ld t1, seg, sib, disp
76,78c101
< srai t2, t1, "(env.dataSize == 8) ? 3 : ((env.dataSize == 4) ? 2 : 1)", \
< dataSize=asz
< ld t1, seg, [1, t2, t7]
---
> ld t1, seg, riprel, disp, dataSize=asz
87,90c110,113
< srai t2, reg, "(env.dataSize == 8) ? 3 : ((env.dataSize == 4) ? 2 : 1)", \
< dataSize=asz
< add t2, t2, base, dataSize=asz
< ld t1, seg, [scale, index, t2], disp
---
> srai t2, reg, 3, dataSize=asz
> srai t3, t2, ldsz, dataSize=asz
> lea t3, flatseg, [dsz, t3, base], dataSize=asz
> ld t1, seg, [scale, index, t3], disp
96,98c119,122
< srai t2, reg, "(env.dataSize == 8) ? 3 : ((env.dataSize == 4) ? 2 : 1)", \
< dataSize=asz
< ld t1, seg, [1, t2, t7]
---
> srai t2, reg, 3, dataSize=asz
> srai t3, t2, ldsz, dataSize=asz
> lea t3, flatseg, [ldsz, t3, base], dataSize=asz
> ld t1, seg, [1, t3, t7], disp
114,119c138,140
< srai t2, t1, "(env.dataSize == 8) ? 3 : ((env.dataSize == 4) ? 2 : 1)", \
< dataSize=asz
< add t2, t2, base, dataSize=asz
< limm t3, 1
< roli t3, t3, imm
< ldst t1, seg, [scale, index, t2], disp
---
> limm t4, 1
> roli t4, t4, imm
> ldst t1, seg, sib, disp
121,122c142,143
< xor t1, t1, t3
< st t1, seg, [scale, index, t2], disp
---
> xor t1, t1, t4
> st t1, seg, sib, disp
128,132c149,151
< srai t2, t1, "(env.dataSize == 8) ? 3 : ((env.dataSize == 4) ? 2 : 1)", \
< dataSize=asz
< limm t3, 1
< roli t3, t3, imm
< ldst t1, seg, [1, t2, t7]
---
> limm t4, 1
> roli t4, t4, imm
> ldst t1, seg, riprel, disp
134,135c153,154
< xor t1, t1, t3
< st t1, seg, [1, t2, t7], disp
---
> xor t1, t1, t4
> st t1, seg, riprel, disp
146,151c165,170
< srai t2, reg, "(env.dataSize == 8) ? 3 : ((env.dataSize == 4) ? 2 : 1)", \
< dataSize=asz
< add t2, t2, base, dataSize=asz
< limm t3, 1
< rol t3, t3, reg
< ldst t1, seg, [scale, index, t2], disp
---
> srai t2, reg, 3, dataSize=asz
> srai t3, t2, ldsz, dataSize=asz
> lea t3, flatseg, [dsz, t3, base], dataSize=asz
> limm t4, 1
> rol t4, t4, reg
> ldst t1, seg, [scale, index, t3], disp
153,154c172,173
< xor t1, t1, t3
< st t1, seg, [scale, index, t2], disp
---
> xor t1, t1, t4
> st t1, seg, [scale, index, t3], disp
159,163c178,183
< srai t2, reg, "(env.dataSize == 8) ? 3 : ((env.dataSize == 4) ? 2 : 1)", \
< dataSize=asz
< limm t3, 1
< rol t3, t3, reg
< ldst t1, seg, [1, t2, t7]
---
> srai t2, reg, 3, dataSize=asz
> srai t3, t2, ldsz, dataSize=asz
> lea t3, flatseg, [dsz, t3, base], dataSize=asz
> limm t4, 1
> rol t4, t4, reg
> ldst t1, seg, [1, t2, t7], disp
165c185
< xor t1, t1, t3
---
> xor t1, t1, t4
178,186c198,200
< # This fudges just a tiny bit, but it's reasonable to expect the
< # microcode generation logic to have the log of the various sizes
< # floating around as well.
< srai t2, t1, "(env.dataSize == 8) ? 3 : ((env.dataSize == 4) ? 2 : 1)", \
< dataSize=asz
< add t2, t2, base, dataSize=asz
< limm t3, "(uint64_t(-(2ULL)))"
< roli t3, t3, imm
< ldst t1, seg, [scale, index, t2], disp
---
> limm t4, "(uint64_t(-(2ULL)))"
> roli t4, t4, imm
> ldst t1, seg, sib, disp
188,189c202,203
< and t1, t1, t3
< st t1, seg, [scale, index, t2], disp
---
> and t1, t1, t4
> st t1, seg, sib, disp
195,199c209,211
< srai t2, t1, "(env.dataSize == 8) ? 3 : ((env.dataSize == 4) ? 2 : 1)", \
< dataSize=asz
< limm t3, "(uint64_t(-(2ULL)))"
< roli t3, t3, imm
< ldst t1, seg, [1, t2, t7]
---
> limm t4, "(uint64_t(-(2ULL)))"
> roli t4, t4, imm
> ldst t1, seg, riprel, disp
201,202c213,214
< and t1, t1, t3
< st t1, seg, [1, t2, t7], disp
---
> and t1, t1, t4
> st t1, seg, riprel, disp
213,218c225,230
< srai t2, reg, "(env.dataSize == 8) ? 3 : ((env.dataSize == 4) ? 2 : 1)", \
< dataSize=asz
< add t2, t2, base, dataSize=asz
< limm t3, "(uint64_t(-(2ULL)))"
< rol t3, t3, reg
< ldst t1, seg, [scale, index, t2], disp
---
> srai t2, reg, 3, dataSize=asz
> srai t3, t2, ldsz, dataSize=asz
> lea t3, flatseg, [dsz, t3, base], dataSize=asz
> limm t4, "(uint64_t(-(2ULL)))"
> rol t4, t4, reg
> ldst t1, seg, [scale, index, t3], disp
220,221c232,233
< and t1, t1, t3
< st t1, seg, [scale, index, t2], disp
---
> and t1, t1, t4
> st t1, seg, [scale, index, t3], disp
226,230c238,243
< srai t2, reg, "(env.dataSize == 8) ? 3 : ((env.dataSize == 4) ? 2 : 1)", \
< dataSize=asz
< limm t3, "(uint64_t(-(2ULL)))"
< rol t3, t3, reg
< ldst t1, seg, [1, t2, t7]
---
> srai t2, reg, 3, dataSize=asz
> srai t3, t2, ldsz, dataSize=asz
> lea t3, flatseg, [dsz, t3, base], dataSize=asz
> limm t4, "(uint64_t(-(2ULL)))"
> rol t4, t4, reg
> ldst t1, seg, [1, t3, t7], disp
232,233c245,246
< and t1, t1, t3
< st t1, seg, [1, t2, t7], disp
---
> and t1, t1, t4
> st t1, seg, [1, t3, t7], disp
245,253c258,260
< # This fudges just a tiny bit, but it's reasonable to expect the
< # microcode generation logic to have the log of the various sizes
< # floating around as well.
< srai t2, t1, "(env.dataSize == 8) ? 3 : ((env.dataSize == 4) ? 2 : 1)", \
< dataSize=asz
< add t2, t2, base, dataSize=asz
< limm t3, 1
< roli t3, t3, imm
< ldst t1, seg, [scale, index, t2], disp
---
> limm t4, 1
> roli t4, t4, imm
> ldst t1, seg, sib, disp
255,256c262,263
< or t1, t1, t3
< st t1, seg, [scale, index, t2], disp
---
> or t1, t1, t4
> st t1, seg, sib, disp
262,266c269,271
< srai t2, t1, "(env.dataSize == 8) ? 3 : ((env.dataSize == 4) ? 2 : 1)", \
< dataSize=asz
< limm t3, 1
< roli t3, t3, imm
< ldst t1, seg, [1, t2, t7]
---
> limm t4, 1
> roli t4, t4, imm
> ldst t1, seg, riprel, disp
268,269c273,274
< or t1, t1, t3
< st t1, seg, [1, t2, t7], disp
---
> or t1, t1, t4
> st t1, seg, riprel, disp
280,285c285,290
< srai t2, reg, "(env.dataSize == 8) ? 3 : ((env.dataSize == 4) ? 2 : 1)", \
< dataSize=asz
< add t2, t2, base, dataSize=asz
< limm t3, 1
< rol t3, t3, reg
< ldst t1, seg, [scale, index, t2], disp
---
> srai t2, reg, 3, dataSize=asz
> srai t3, t2, ldsz, dataSize=asz
> lea t3, flatseg, [dsz, t3, base], dataSize=asz
> limm t4, 1
> rol t4, t4, reg
> ldst t1, seg, [scale, index, t3], disp
287,288c292,293
< or t1, t1, t3
< st t1, seg, [scale, index, t2], disp
---
> or t1, t1, t4
> st t1, seg, [scale, index, t3], disp
293,297c298,303
< srai t2, reg, "(env.dataSize == 8) ? 3 : ((env.dataSize == 4) ? 2 : 1)", \
< dataSize=asz
< limm t3, 1
< rol t3, t3, reg
< ldst t1, seg, [1, t2, t7]
---
> srai t2, reg, 3, dataSize=asz
> srai t3, t2, ldsz, dataSize=asz
> lea t3, flatseg, [dsz, t3, base], dataSize=asz
> limm t4, 1
> rol t4, t4, reg
> ldst t1, seg, [1, t3, t7], disp
299,300c305,306
< or t1, t1, t3
< st t1, seg, [1, t2, t7], disp
---
> or t1, t1, t4
> st t1, seg, [1, t3, t7], disp