branch.isa (7252:bba68021edca) branch.isa (7281:e67b0c646268)
1// -*- mode:c++ -*-
2
3// Copyright (c) 2010 ARM Limited
4// All rights reserved
5//
6// The license below extends only to copyright in the software and shall
7// not be construed as granting a license to any other intellectual
8// property including but not limited to intellectual property relating

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

99 decode_block = '''
100 if (bits(machInst, 11, 9) != 0x7) {
101 return new B(machInst, sext<9>(bits(machInst, 7, 0) << 1),
102 (ConditionCode)(uint32_t)bits(machInst, 11, 8));
103 } else if (bits(machInst, 8)) {
104 return new Svc(machInst);
105 } else {
106 // This space will not be allocated in the future.
1// -*- mode:c++ -*-
2
3// Copyright (c) 2010 ARM Limited
4// All rights reserved
5//
6// The license below extends only to copyright in the software and shall
7// not be construed as granting a license to any other intellectual
8// property including but not limited to intellectual property relating

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

99 decode_block = '''
100 if (bits(machInst, 11, 9) != 0x7) {
101 return new B(machInst, sext<9>(bits(machInst, 7, 0) << 1),
102 (ConditionCode)(uint32_t)bits(machInst, 11, 8));
103 } else if (bits(machInst, 8)) {
104 return new Svc(machInst);
105 } else {
106 // This space will not be allocated in the future.
107 return new WarnUnimplemented("unimplemented", machInst);
107 return new Unknown(machInst);
108 }
109 '''
110}};
111
112def format Thumb16UncondBranch() {{
113 decode_block = '''
114 return new B(machInst, sext<12>(bits(machInst, 10, 0) << 1), COND_UC);
115 '''
116}};
117
118def format Thumb32BranchesAndMiscCtrl() {{
119 decode_block = '''
120 {
121 const uint32_t op = bits(machInst, 26, 20);
122 const uint32_t op1 = bits(machInst, 14, 12);
123 switch (op1 & 0x5) {
124 case 0x0:
125 if (op == 127) {
126 if (op1 & 0x2) {
108 }
109 '''
110}};
111
112def format Thumb16UncondBranch() {{
113 decode_block = '''
114 return new B(machInst, sext<12>(bits(machInst, 10, 0) << 1), COND_UC);
115 '''
116}};
117
118def format Thumb32BranchesAndMiscCtrl() {{
119 decode_block = '''
120 {
121 const uint32_t op = bits(machInst, 26, 20);
122 const uint32_t op1 = bits(machInst, 14, 12);
123 switch (op1 & 0x5) {
124 case 0x0:
125 if (op == 127) {
126 if (op1 & 0x2) {
127 // Permanentl undefined.
128 return new WarnUnimplemented("undefined", machInst);
127 // Permanently undefined.
128 return new Unknown(machInst);
129 } else {
130 return new WarnUnimplemented("smc", machInst);
131 }
132 } else if ((op & 0x38) != 0x38) {
133 const uint32_t s = bits(machInst, 26);
134 const uint32_t j1 = bits(machInst, 13);
135 const uint32_t j2 = bits(machInst, 11);
136 const uint32_t imm6 = bits(machInst, 21, 16);

--- 135 unchanged lines hidden ---
129 } else {
130 return new WarnUnimplemented("smc", machInst);
131 }
132 } else if ((op & 0x38) != 0x38) {
133 const uint32_t s = bits(machInst, 26);
134 const uint32_t j1 = bits(machInst, 13);
135 const uint32_t j2 = bits(machInst, 11);
136 const uint32_t imm6 = bits(machInst, 21, 16);

--- 135 unchanged lines hidden ---