stack_operations.py (5171:eab735dc951d) stack_operations.py (5175:ee904e392de2)
1# Copyright (c) 2007 The Hewlett-Packard Development Company
2# All rights reserved.
3#
4# Redistribution and use of this software in source and binary forms,
5# with or without modification, are permitted provided that the
6# following conditions are met:
7#
8# The software must be used only for Non-Commercial Use which means any

--- 155 unchanged lines hidden (view full) ---

164 # Pull the different components out of the immediate
165 limm t1, imm
166 zext t2, t1, 16, dataSize=2
167 srl t1, t1, 16
168 zext t1, t1, 6
169 # t1 is now the masked nesting level, and t2 is the amount of storage.
170
171 # Push rbp.
1# Copyright (c) 2007 The Hewlett-Packard Development Company
2# All rights reserved.
3#
4# Redistribution and use of this software in source and binary forms,
5# with or without modification, are permitted provided that the
6# following conditions are met:
7#
8# The software must be used only for Non-Commercial Use which means any

--- 155 unchanged lines hidden (view full) ---

164 # Pull the different components out of the immediate
165 limm t1, imm
166 zext t2, t1, 16, dataSize=2
167 srl t1, t1, 16
168 zext t1, t1, 6
169 # t1 is now the masked nesting level, and t2 is the amount of storage.
170
171 # Push rbp.
172 st rbp, ss, [1, t0, rsp], "-env.dataSize"
173 subi rsp, rsp, dsz
172 stupd rbp, ss, [1, t0, rsp], "-env.dataSize"
174
175 # Save the stack pointer for later
176 mov t6, t6, rsp
177
178 # If the nesting level is zero, skip all this stuff.
179 subi t0, t1, t0, flags=(EZF,), dataSize=2
180 bri t0, label("skipLoop"), flags=(CEZF,)
181
182 # If the level was 1, only push the saved rbp
183 subi t0, t1, 1, flags=(EZF,)
184 bri t0, label("bottomOfLoop"), flags=(CEZF,)
185
186 limm t4, "ULL(-1)", dataSize=8
187topOfLoop:
188 ld t5, ss, [dsz, t4, rbp]
173
174 # Save the stack pointer for later
175 mov t6, t6, rsp
176
177 # If the nesting level is zero, skip all this stuff.
178 subi t0, t1, t0, flags=(EZF,), dataSize=2
179 bri t0, label("skipLoop"), flags=(CEZF,)
180
181 # If the level was 1, only push the saved rbp
182 subi t0, t1, 1, flags=(EZF,)
183 bri t0, label("bottomOfLoop"), flags=(CEZF,)
184
185 limm t4, "ULL(-1)", dataSize=8
186topOfLoop:
187 ld t5, ss, [dsz, t4, rbp]
189 st t5, ss, [1, t0, rsp], "-env.dataSize"
190 subi rsp, rsp, dsz
188 stupd t5, ss, [1, t0, rsp], "-env.dataSize"
191
192 # If we're not done yet, loop
193 subi t4, t4, 1, dataSize=8
194 add t0, t4, t1, flags=(EZF,)
195 bri t0, label("topOfLoop"), flags=(nCEZF,)
196
197bottomOfLoop:
198 # Push the old rbp onto the stack
189
190 # If we're not done yet, loop
191 subi t4, t4, 1, dataSize=8
192 add t0, t4, t1, flags=(EZF,)
193 bri t0, label("topOfLoop"), flags=(nCEZF,)
194
195bottomOfLoop:
196 # Push the old rbp onto the stack
199 st t6, ss, [1, t0, rsp], "-env.dataSize"
200 subi rsp, rsp, dsz
197 stupd t6, ss, [1, t0, rsp], "-env.dataSize"
201
202skipLoop:
203 sub rsp, rsp, t2
204 mov rbp, rbp, t6
205};
206'''
198
199skipLoop:
200 sub rsp, rsp, t2
201 mov rbp, rbp, t6
202};
203'''