load_and_store.py (5174:73a760aa0129) load_and_store.py (6460:59108c231208)
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

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

50# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
51# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
52# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
53#
54# Authors: Gabe Black
55
56microcode = '''
57def macroop SAHF {
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

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

50# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
51# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
52# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
53#
54# Authors: Gabe Black
55
56microcode = '''
57def macroop SAHF {
58 # This will fold to ah since this never executes in 64 bit mode.
59 ruflags rsp, dataSize=1
58 ruflags ah, dataSize=1
60};
61
59};
60
62# This is allows the instruction to write to ah in 64 bit mode.
63def macroop SAHF_64 {
64 ruflags t1
65 slli t1, t1, 8
66 mov t1, t1, rax, dataSize=1
67 mov rax, rax, t1, dataSize=2
68};
69
70def macroop LAHF {
61def macroop LAHF {
71 # This will fold to ah since this never executes in 64 bit mode.
72 wruflags rsp, t0, dataSize=1
62 wruflags ah, t0, dataSize=1
73};
63};
74
75# This is allows the instruction to read from ah in 64 bit mode.
76def macroop LAHF_64 {
77 srli t1, rax, 8, dataSize=2
78 wruflags t1, t0, dataSize=1
79};
80'''
64'''