OpenCores
URL https://opencores.org/ocsvn/ao486/ao486/trunk

Subversion Repositories ao486

[/] [ao486/] [trunk/] [rtl/] [ao486/] [commands/] [CMD_XADD.txt] - Blame information for rev 6

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 alfik
 
2
3
`define CMD_XADD    #AUTOGEN_NEXT_CMD
4
 
5
`define CMDEX_XADD_FIRST        4'd0
6
`define CMDEX_XADD_LAST         4'd1
7
8
 
9
10
dec_ready_2byte_modregrm && { decoder[7:1], 1'b0 } == 8'hC0
11
prefix_group_1_lock && `DEC_MODREGRM_IS_MOD_11
12
`CMD_XADD
13
IF(decoder[0] == 1'b0); SET(dec_is_8bit); ENDIF();
14
SET(consume_modregrm_one);
15
SET(dec_is_complex);
16
17
 
18
19
`CMDEX_XADD_FIRST
20
LAST(`CMDEX_XADD_LAST);
21
22
 
23
24
IF(rd_cmd == `CMD_XADD && rd_cmdex == `CMDEX_XADD_FIRST);
25
 
26
    SET(rd_src_is_reg);
27
 
28
    // dst: reg, src: reg
29
    IF(rd_modregrm_mod == 2'b11);
30
 
31
        SET(rd_dst_is_rm);
32
 
33
        IF(rd_mutex_busy_modregrm_reg || rd_mutex_busy_modregrm_rm); SET(rd_waiting); ENDIF();
34
    ENDIF();
35
 
36
    // dst: memory, src: reg
37
    IF(rd_modregrm_mod != 2'b11);
38
 
39
        SET(rd_dst_is_memory);
40
 
41
        IF(rd_mutex_busy_modregrm_reg || rd_mutex_busy_memory); SET(rd_waiting);
42
        ELSE();
43
            SET(read_rmw_virtual);
44
 
45
            IF(~(read_for_rd_ready)); SET(rd_waiting); ENDIF();
46
        ENDIF();
47
    ENDIF();
48
ENDIF();
49
50
 
51
52
IF(rd_cmd == `CMD_XADD && rd_cmdex == `CMDEX_XADD_LAST);
53
 
54
    SET(rd_dst_is_reg);
55
 
56
    SET(rd_req_reg);
57
    SET(rd_req_eflags);
58
 
59
    SET(rd_req_rm,      rd_modregrm_mod == 2'b11);
60
    SET(rd_req_memory,  rd_modregrm_mod != 2'b11);
61
ENDIF();
62
63
 
64
65
IF(exe_cmd == `CMD_XADD && exe_cmdex == `CMDEX_XADD_FIRST);
66
 
67
    SET(exe_arith_index, (`ARITH_VALID | `ARITH_ADD));
68
    SET(exe_result,  exe_arith_add[31:0]);
69
    SAVE(exe_buffer, dst);
70
ENDIF();
71
72
 
73
74
IF(exe_cmd == `CMD_XADD && exe_cmdex == `CMDEX_XADD_LAST);
75
 
76
    SET(exe_result, exe_buffer);
77
ENDIF();
78
79
 
80
81
IF(wr_cmd == `CMD_XADD && wr_cmdex == `CMDEX_XADD_FIRST);
82
    IF(wr_dst_is_memory && ~(write_for_wr_ready)); SET(wr_waiting); ENDIF();
83
 
84
    SET(write_regrm,             wr_dst_is_rm);
85
    SET(write_rmw_virtual,       wr_dst_is_memory);
86
 
87
    SAVE(zflag, zflag_result);
88
    SAVE(sflag, sflag_result);
89
    SAVE(pflag, pflag_result);
90
 
91
    SAVE(aflag, aflag_arith);
92
    SAVE(cflag, cflag_arith);
93
    SAVE(oflag, oflag_arith);
94
 
95
    SET(wr_not_finished);
96
ENDIF();
97
98
 
99
100
IF(wr_cmd == `CMD_XADD && wr_cmdex == `CMDEX_XADD_LAST);
101
    IF(wr_modregrm_mod != 2'b11 || wr_modregrm_reg != wr_modregrm_rm);
102
        SET(write_regrm);
103
    ENDIF();
104
ENDIF();
105
106
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.