1# Copyright (c) 2013 Andreas Sandberg
2# All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met: redistributions of source code must retain the above copyright
7# notice, this list of conditions and the following disclaimer;
8# redistributions in binary form must reproduce the above copyright
--- 108 unchanged lines hidden (view full) ---
117
118fxrstorCommonTemplate = """
119 ld t1, seg, %(mode)s, "DISPLACEMENT + 0", dataSize=2
120 wrval fcw, t1
121
122 # FSW includes TOP when read
123 ld t1, seg, %(mode)s, "DISPLACEMENT + 2", dataSize=2
124 wrval fsw, t1
125 srli t1, t1, 11, dataSize=2
126 andi t1, t1, 0x7, dataSize=2
127 wrval "InstRegIndex(MISCREG_X87_TOP)", t1
128
129 # FTW
130 ld t1, seg, %(mode)s, "DISPLACEMENT + 4", dataSize=1
131 wrxftw t1
132
133 ld t1, seg, %(mode)s, "DISPLACEMENT + 6", dataSize=2
134 wrval "InstRegIndex(MISCREG_FOP)", t1
135
--- 67 unchanged lines hidden ---
2# All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met: redistributions of source code must retain the above copyright
7# notice, this list of conditions and the following disclaimer;
8# redistributions in binary form must reproduce the above copyright
--- 108 unchanged lines hidden (view full) ---
117
118fxrstorCommonTemplate = """
119 ld t1, seg, %(mode)s, "DISPLACEMENT + 0", dataSize=2
120 wrval fcw, t1
121
122 # FSW includes TOP when read
123 ld t1, seg, %(mode)s, "DISPLACEMENT + 2", dataSize=2
124 wrval fsw, t1
125 srli t1, t1, 11, dataSize=2
126 andi t1, t1, 0x7, dataSize=2
127 wrval "InstRegIndex(MISCREG_X87_TOP)", t1
128
129 # FTW
130 ld t1, seg, %(mode)s, "DISPLACEMENT + 4", dataSize=1
131 wrxftw t1
132
133 ld t1, seg, %(mode)s, "DISPLACEMENT + 6", dataSize=2
134 wrval "InstRegIndex(MISCREG_FOP)", t1
135
--- 67 unchanged lines hidden ---