summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/isa_desc81
1 files changed, 23 insertions, 58 deletions
diff --git a/arch/alpha/isa_desc b/arch/alpha/isa_desc
index 06a1081bc..080699ddb 100644
--- a/arch/alpha/isa_desc
+++ b/arch/alpha/isa_desc
@@ -2119,65 +2119,30 @@ decode OPCODE default Unknown::unknown() {
0x1c: decode INTFUNC {
0x00: decode RA { 31: sextb({{ Rc.sb = Rb_or_imm< 7:0>; }}); }
0x01: decode RA { 31: sextw({{ Rc.sw = Rb_or_imm<15:0>; }}); }
- 0x32: ctlz({{
- uint64_t count = 0;
- uint64_t temp = Rb;
- if (temp & ULL(0xffffffff00000000))
- temp >>= 32;
- else
- count += 32;
- if (temp & ULL(0xffff0000))
- temp >>= 16;
- else
- count += 16;
- if (temp & ULL(0xff00))
- temp >>= 8;
- else
- count += 8;
- if (temp & ULL(0xf0))
- temp >>= 4;
- else
- count += 4;
- if (temp & ULL(0xC))
- temp >>= 2;
- else
- count += 2;
- if (temp & ULL(0x2))
- temp >>= 1;
- else
- count += 1;
- if ((temp & ULL(0x1)) != 0x1)
- count += 1;
- Rc = count;
- }}, IntAluOp);
+ 0x32: ctlz({{
+ uint64_t count = 0;
+ uint64_t temp = Rb;
+ if (temp<63:32>) temp >>= 32; else count += 32;
+ if (temp<31:16>) temp >>= 16; else count += 16;
+ if (temp<15:8>) temp >>= 8; else count += 8;
+ if (temp<7:4>) temp >>= 4; else count += 4;
+ if (temp<3:2>) temp >>= 2; else count += 2;
+ if (temp<1:1>) temp >>= 1; else count += 1;
+ if ((temp<0:0>) != 0x1) count += 1;
+ Rc = count;
+ }}, IntAluOp);
- 0x33: cttz({{
- uint64_t count = 0;
- uint64_t temp = Rb;
- if (!(temp & ULL(0x00000000ffffffff))) {
- temp >>= 32;
- count += 32;
- }
- if (!(temp & ULL(0x0000ffff))) {
- temp >>= 16;
- count += 16;
- }
- if (!(temp & ULL(0x00ff))) {
- temp >>= 8;
- count += 8;
- }
- if (!(temp & ULL(0x0f))) {
- temp >>= 4;
- count += 4;
- }
- if (!(temp & ULL(0x3))) {
- temp >>= 2;
- count += 2;
- }
- if (!(temp & ULL(0x1)))
- count += 1;
- Rc = count;
- }}, IntAluOp);
+ 0x33: cttz({{
+ uint64_t count = 0;
+ uint64_t temp = Rb;
+ if (!(temp<31:0>)) { temp >>= 32; count += 32; }
+ if (!(temp<15:0>)) { temp >>= 16; count += 16; }
+ if (!(temp<7:0>)) { temp >>= 8; count += 8; }
+ if (!(temp<3:0>)) { temp >>= 4; count += 4; }
+ if (!(temp<1:0>)) { temp >>= 2; count += 2; }
+ if (!(temp<0:0> & ULL(0x1))) count += 1;
+ Rc = count;
+ }}, IntAluOp);
format FailUnimpl {
0x30: ctpop();