m5op_x86.S (12424:51b6cee2e203) m5op_x86.S (12459:e1484770f671)
1/*
2 * Copyright (c) 2003-2006 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

27 *
28 * Authors: Gabe Black
29 * Nathan Binkert
30 * Ali Saidi
31 */
32
33#include <gem5/asm/generic/m5ops.h>
34
1/*
2 * Copyright (c) 2003-2006 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

27 *
28 * Authors: Gabe Black
29 * Nathan Binkert
30 * Ali Saidi
31 */
32
33#include <gem5/asm/generic/m5ops.h>
34
35#ifdef M5OP_ADDR
35#if defined(M5OP_ADDR) && defined(M5OP_PIC)
36/* Use the memory mapped m5op interface */
37#define TWO_BYTE_OP(name, number) \
38 .globl name; \
39 .func name; \
40name: \
36/* Use the memory mapped m5op interface */
37#define TWO_BYTE_OP(name, number) \
38 .globl name; \
39 .func name; \
40name: \
41 mov m5_mem, %r11; \
41 mov m5_mem@gotpcrel(%rip), %r11; \
42 mov (%r11), %r11; \
42 mov $number, %rax; \
43 shl $8, %rax; \
44 mov 0(%r11, %rax, 1), %rax; \
45 ret; \
46 .endfunc;
47
43 mov $number, %rax; \
44 shl $8, %rax; \
45 mov 0(%r11, %rax, 1), %rax; \
46 ret; \
47 .endfunc;
48
49#elif defined(M5OP_ADDR) && !defined(M5OP_PIC)
50/* Use the memory mapped m5op interface */
51#define TWO_BYTE_OP(name, number) \
52 .globl name; \
53 .func name; \
54name: \
55 mov m5_mem, %r11; \
56 mov $number, %rax; \
57 shl $8, %rax; \
58 mov 0(%r11, %rax, 1), %rax; \
59 ret; \
60 .endfunc;
48#else
49/* Use the magic instruction based m5op interface. This does not work
50 * in virtualized environments.
51 */
52
53#define TWO_BYTE_OP(name, number) \
54 .globl name; \
55 .func name; \

--- 32 unchanged lines hidden ---
61#else
62/* Use the magic instruction based m5op interface. This does not work
63 * in virtualized environments.
64 */
65
66#define TWO_BYTE_OP(name, number) \
67 .globl name; \
68 .func name; \

--- 32 unchanged lines hidden ---