diff options
author | Graham Markall <graham.markall@embecosm.com> | 2016-06-03 10:48:49 +0100 |
---|---|---|
committer | Andrew Burgess <andrew.burgess@embecosm.com> | 2016-06-14 16:21:44 +0100 |
commit | 14053c1903cc0e4f0130570f61aee2825661cd7d (patch) | |
tree | f05e0caa80245cc4012817daa859d008d66e4435 /gas | |
parent | d2dfe54d6c4c307dd64a5e6bdcc7d1081b17233a (diff) | |
download | binutils-14053c1903cc0e4f0130570f61aee2825661cd7d.zip binutils-14053c1903cc0e4f0130570f61aee2825661cd7d.tar.gz binutils-14053c1903cc0e4f0130570f61aee2825661cd7d.tar.bz2 |
[ARC] Add arithmetic and logic instructions for nps
This commit completes the implementation of arithmetic and logic
instructions for the NPS-400. These instructions are:
- calcbsd / calcbxd
- calckey / calcxkey
- mxb / imxb
- addl, subl, orl, andl, xorl
- andab / orab
- lbdsize
- bdlen
- csms, csma, cbba
- zncv
- hofs
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 7 | ||||
-rw-r--r-- | gas/testsuite/gas/arc/nps400-6.d | 161 | ||||
-rw-r--r-- | gas/testsuite/gas/arc/nps400-6.s | 121 |
3 files changed, 289 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 5bc1de7..af4e9c9 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,10 @@ +2016-06-13 Graham Markall <graham.markall@embecosm.com> + + * testsuite/gas/arc/nps400-6.s: Add tests of calcbsd, calcbxd, + calckey, calcxkey, mxb, imxb, addl, subl, andl, orl, xorl, andab, orab, + lbdsize, bdlen, csms, csma, cbba, zncv, and hofs. + * testsuite/gas/arc/nps400-6.d: Likewise. + 2016-06-14 Nick Clifton <nickc@redhat.com> * config/tc-nds32.c (nds32_get_align): Avoid left shifting a diff --git a/gas/testsuite/gas/arc/nps400-6.d b/gas/testsuite/gas/arc/nps400-6.d index 3292177..6a67461 100644 --- a/gas/testsuite/gas/arc/nps400-6.d +++ b/gas/testsuite/gas/arc/nps400-6.d @@ -68,3 +68,164 @@ Disassembly of section .text: ec: 4820 4610 calcxd r0,r0,r1,0x40 f0: 4a10 4710 calcxd.f r2,r2,r0,0x80 f4: 4940 4810 calcxd r1,r1,r2,0x100 + f8: 4800 0030 calcbsd r0,r0,r0 + fc: 4910 0030 calcbsd.f r1,r1,r0 + 100: 4940 0030 calcbsd r1,r1,r2 + 104: 4b50 0030 calcbsd.f r3,r3,r2 + 108: 4800 4030 calcbxd r0,r0,r0 + 10c: 4910 4030 calcbxd.f r1,r1,r0 + 110: 4940 4030 calcbxd r1,r1,r2 + 114: 4b50 4030 calcbxd.f r3,r3,r2 + 118: 4800 0050 calckey r0,r0,r0 + 11c: 4910 0050 calckey.f r1,r1,r0 + 120: 4940 0050 calckey r1,r1,r2 + 124: 4b50 0050 calckey.f r3,r3,r2 + 128: 4800 4050 calcxkey r0,r0,r0 + 12c: 4910 4050 calcxkey.f r1,r1,r0 + 130: 4940 4050 calcxkey r1,r1,r2 + 134: 4b50 4050 calcxkey.f r3,r3,r2 + 138: 582b 0440 mxb r0,r1,0,0x1,0x2 + 13c: 582b 0e38 mxb r0,r1,0x7,0x8,0x7 + 140: 582b 01f8 mxb r0,r1,0x7,0x7,0x8 + 144: 5a6b a708 mxb.s r2,r3,0x1,0x4,0x3,0x2 + 148: 5a6b fe38 mxb.s r2,r3,0x7,0x8,0x7,0x7 + 14c: 5a6b f1f8 mxb.s r2,r3,0x7,0x7,0x8,0x7 + 150: 5a6b 8e38 mxb.s r2,r3,0x7,0x8,0x7,0x8 + 154: 582b 0441 imxb r0,r1,0,0x1,0x2 + 158: 582b 0e39 imxb r0,r1,0x7,0x8,0x7 + 15c: 582b 01f9 imxb r0,r1,0x7,0x7,0x8 + 160: 5a6b a709 imxb.s r2,r3,0x1,0x4,0x3,0x2 + 164: 5a6b fe39 imxb.s r2,r3,0x7,0x8,0x7,0x7 + 168: 5a6b f1f9 imxb.s r2,r3,0x7,0x7,0x8,0x7 + 16c: 5a6b 8e39 imxb.s r2,r3,0x7,0x8,0x7,0x8 + 170: 480a 0000 addl r0,r0,0 + 174: 484a 7fff addl r2,r2,32767 + 178: 48aa 8000 addl r5,r5,-32768 + 17c: 495a 0000 addl.f r10,r10,0 + 180: 497a 0001 addl.f r11,r11,1 + 184: 499a ffff addl.f r12,r12,-1 + 188: 480b 0000 subl r0,r0,0 + 18c: 484b 7fff subl r2,r2,32767 + 190: 48ab 8000 subl r5,r5,-32768 + 194: 495b 0000 subl.f r10,r10,0 + 198: 497b 0001 subl.f r11,r11,1 + 19c: 499b ffff subl.f r12,r12,-1 + 1a0: 480d 0000 andl r0,r0,0 + 1a4: 482d 0001 andl r1,r1,0x1 + 1a8: 484d ffff andl r2,r2,0xffff + 1ac: 495d 0000 andl.f r10,r10,0 + 1b0: 497d 0001 andl.f r11,r11,0x1 + 1b4: 499d ffff andl.f r12,r12,0xffff + 1b8: 480c 0000 orl r0,r0,0 + 1bc: 482c 0001 orl r1,r1,0x1 + 1c0: 484c ffff orl r2,r2,0xffff + 1c4: 495c 0000 orl.f r10,r10,0 + 1c8: 497c 0001 orl.f r11,r11,0x1 + 1cc: 499c ffff orl.f r12,r12,0xffff + 1d0: 480e 0000 xorl r0,r0,0 + 1d4: 482e 0001 xorl r1,r1,0x1 + 1d8: 484e ffff xorl r2,r2,0xffff + 1dc: 495e 0000 xorl.f r10,r10,0 + 1e0: 497e 0001 xorl.f r11,r11,0x1 + 1e4: 499e ffff xorl.f r12,r12,0xffff + 1e8: 4800 0011 andab r0,r0,0,0x1 + 1ec: 4940 3df1 andab r1,r2,0xf,0x10 + 1f0: 4a70 0011 andab.f r2,r3,0,0x1 + 1f4: 4cb0 3e11 andab.f r12,r13,0x10,0x10 + 1f8: 4800 8011 andab r0,r0,r0,0,0x1 + 1fc: 4940 bdf1 andab r1,r1,r2,0xf,0x10 + 200: 4a70 8011 andab.f r2,r2,r3,0,0x1 + 204: 4cb0 be11 andab.f r12,r12,r13,0x10,0x10 + 208: 4800 0012 orab r0,r0,0,0x1 + 20c: 4940 3df2 orab r1,r2,0xf,0x10 + 210: 4a70 0012 orab.f r2,r3,0,0x1 + 214: 4cb0 3e12 orab.f r12,r13,0x10,0x10 + 218: 4800 8012 orab r0,r0,r0,0,0x1 + 21c: 4940 bdf2 orab r1,r1,r2,0xf,0x10 + 220: 4a70 8012 orab.f r2,r2,r3,0,0x1 + 224: 4cb0 be12 orab.f r12,r12,r13,0x10,0x10 + 228: 382f 0045 lbdsize r0,r1 + 22c: 3a2f 00c5 lbdsize r2,r3 + 230: 382f 8045 lbdsize.f r0,r1 + 234: 3a2f 80c5 lbdsize.f r2,r3 + 238: 4820 0033 bdlen r0,r1,0x1 + 23c: 4960 0013 bdlen r1,r3,0x100 + 240: 4940 1e13 bdlen r1,r2,0xf0 + 244: 4ca0 4013 bdlen r12,r13 + 248: 4830 0033 bdlen.f r0,r1,0x1 + 24c: 4970 0013 bdlen.f r1,r3,0x100 + 250: 4cb0 4013 bdlen.f r12,r13 + 254: 3c2a 150a csma r10,r12,r20 + 258: 3e2a 7500 1234 5678 csma r0,0x12345678,r20 + 260: 3f2a 0f86 ffff ffff csma r6,r7,0xffffffff + 268: 3e2a 7f88 ffff ffff csma r8,0xffffffff,0xffffffff + 270: 3e2a 137e csma 0,r14,r13 + 274: 3e2a 72be ffff ffff csma 0,0xffffffff,r10 + 27c: 3c2a 1fbe ffff ffff csma 0,r12,0xffffffff + 284: 3d6a 0044 csma r4,r5,0x1 + 288: 3e6a 7083 1234 5678 csma r3,0x12345678,0x2 + 290: 396a 013e csma 0,r1,0x4 + 294: 3e6a 707e ffff ffff csma 0,0xffffffff,0x1 + 29c: 3c2c 150a csms r10,r12,r20 + 2a0: 3e2c 7500 1234 5678 csms r0,0x12345678,r20 + 2a8: 3f2c 0f86 ffff ffff csms r6,r7,0xffffffff + 2b0: 3e2c 7f88 ffff ffff csms r8,0xffffffff,0xffffffff + 2b8: 3e2c 137e csms 0,r14,r13 + 2bc: 3e2c 72be ffff ffff csms 0,0xffffffff,r10 + 2c4: 3c2c 1fbe ffff ffff csms 0,r12,0xffffffff + 2cc: 3d6c 0044 csms r4,r5,0x1 + 2d0: 3e6c 7083 1234 5678 csms r3,0x12345678,0x2 + 2d8: 396c 013e csms 0,r1,0x4 + 2dc: 3e6c 707e ffff ffff csms 0,0xffffffff,0x1 + 2e4: 3c2d 150a cbba r10,r12,r20 + 2e8: 3e2d 7500 1234 5678 cbba r0,0x12345678,r20 + 2f0: 3f2d 0f86 ffff ffff cbba r6,r7,0xffffffff + 2f8: 3e2d 7f88 ffff ffff cbba r8,0xffffffff,0xffffffff + 300: 3e2d 137e cbba 0,r14,r13 + 304: 3e2d 72be ffff ffff cbba 0,0xffffffff,r10 + 30c: 3c2d 1fbe ffff ffff cbba 0,r12,0xffffffff + 314: 3d6d 0044 cbba r4,r5,0x1 + 318: 3e6d 7083 1234 5678 cbba r3,0x12345678,0x2 + 320: 396d 013e cbba 0,r1,0x4 + 324: 3e6d 707e ffff ffff cbba 0,0xffffffff,0x1 + 32c: 3c2d 950a cbba.f r10,r12,r20 + 330: 3e2d f500 1234 5678 cbba.f r0,0x12345678,r20 + 338: 3f2d 8f86 ffff ffff cbba.f r6,r7,0xffffffff + 340: 3e2d ff88 ffff ffff cbba.f r8,0xffffffff,0xffffffff + 348: 3e2d 937e cbba.f 0,r14,r13 + 34c: 3e2d f2be ffff ffff cbba.f 0,0xffffffff,r10 + 354: 3c2d 9fbe ffff ffff cbba.f 0,r12,0xffffffff + 35c: 3d6d 8044 cbba.f r4,r5,0x1 + 360: 3e6d f083 1234 5678 cbba.f r3,0x12345678,0x2 + 368: 396d 813e cbba.f 0,r1,0x4 + 36c: 3e6d f07e ffff ffff cbba.f 0,0xffffffff,0x1 + 374: 3c35 150a zncv.rd r10,r12,r20 + 378: 3e35 7500 1234 5678 zncv.rd r0,0x12345678,r20 + 380: 3f35 0f86 ffff ffff zncv.rd r6,r7,0xffffffff + 388: 3e35 7f88 ffff ffff zncv.rd r8,0xffffffff,0xffffffff + 390: 3e35 137e zncv.rd 0,r14,r13 + 394: 3e35 72be ffff ffff zncv.rd 0,0xffffffff,r10 + 39c: 3c35 1fbe ffff ffff zncv.rd 0,r12,0xffffffff + 3a4: 3d75 0044 zncv.rd r4,r5,0x1 + 3a8: 3e75 7083 1234 5678 zncv.rd r3,0x12345678,0x2 + 3b0: 3975 013e zncv.rd 0,r1,0x4 + 3b4: 3e75 707e ffff ffff zncv.rd 0,0xffffffff,0x1 + 3bc: 39b5 0fff zncv.rd r1,r1,-1 + 3c0: 3eb5 7fff ffff ffff zncv.rd 0,0xffffffff,-1 + 3c8: 3c35 950a zncv.wr r10,r12,r20 + 3cc: 3e35 f500 1234 5678 zncv.wr r0,0x12345678,r20 + 3d4: 3f35 8f86 ffff ffff zncv.wr r6,r7,0xffffffff + 3dc: 3e35 ff88 ffff ffff zncv.wr r8,0xffffffff,0xffffffff + 3e4: 3e35 937e zncv.wr 0,r14,r13 + 3e8: 3e35 f2be ffff ffff zncv.wr 0,0xffffffff,r10 + 3f0: 3c35 9fbe ffff ffff zncv.wr 0,r12,0xffffffff + 3f8: 3d75 8044 zncv.wr r4,r5,0x1 + 3fc: 3e75 f083 1234 5678 zncv.wr r3,0x12345678,0x2 + 404: 3975 813e zncv.wr 0,r1,0x4 + 408: 3e75 f07e ffff ffff zncv.wr 0,0xffffffff,0x1 + 410: 39b5 8fff zncv.wr r1,r1,-1 + 414: 3eb5 ffff ffff ffff zncv.wr 0,0xffffffff,-1 + 41c: 3a36 00c1 hofs r1,r2,r3 + 420: 3d36 8184 hofs.f r4,r5,r6 + 424: 3876 13c7 hofs r7,r8,0xf0,0 + 428: 3876 9807 hofs.f r7,r8,0,0x1 diff --git a/gas/testsuite/gas/arc/nps400-6.s b/gas/testsuite/gas/arc/nps400-6.s index 4a94a0c..797097d 100644 --- a/gas/testsuite/gas/arc/nps400-6.s +++ b/gas/testsuite/gas/arc/nps400-6.s @@ -40,6 +40,52 @@ \mnem\() r1, r1, r2, 256 .endm + .macro calcbsxdkey_test mnem + \mnem\() r0, r0, r0 + \mnem\().f r1, r1, r0 + \mnem\() r1, r1, r2 + \mnem\().f r3, r3, r2 + .endm + + .macro mxb_like_test mnem + \mnem\() r0, r1, 0, 1, 2 + \mnem\() r0, r1, 7, 8, 7 + \mnem\() r0, r1, 7, 7, 8 + \mnem\().s r2, r3, 1, 4, 3, 2 + \mnem\().s r2, r3, 7, 8, 7, 7 + \mnem\().s r2, r3, 7, 7, 8, 7 + \mnem\().s r2, r3, 7, 8, 7, 8 + .endm + + .macro addsubl_test mnem + \mnem\() r0, r0, 0 + \mnem\() r2, r2, 32767 + \mnem\() r5, r5, -32768 + \mnem\().f r10, r10, 0 + \mnem\().f r11, r11, 1 + \mnem\().f r12, r12, -1 + .endm + + .macro andorxorl_test mnem + \mnem\() r0, r0, 0 + \mnem\() r1, r1, 1 + \mnem\() r2, r2, 65535 + \mnem\().f r10, r10, 0 + \mnem\().f r11, r11, 1 + \mnem\().f r12, r12, 65535 + .endm + + .macro andorab_test mnem + \mnem\() r0, r0, 0, 1 + \mnem\() r1, r2, 15, 16 + \mnem\().f r2, r3, 0, 1 + \mnem\().f r12, r13, 16, 16 + \mnem\() r0, r0, r0, 0, 1 + \mnem\() r1, r1, r2, 15, 16 + \mnem\().f r2, r2, r3, 0, 1 + \mnem\().f r12, r12, r13, 16, 16 + .endm + addb_like_test addb addb_like_test subb addb_like_test adcb @@ -65,3 +111,78 @@ calcsxd_test calcsd calcsxd_test calcxd + + calcbsxdkey_test calcbsd + calcbsxdkey_test calcbxd + calcbsxdkey_test calckey + calcbsxdkey_test calcxkey + + mxb_like_test mxb + mxb_like_test imxb + + addsubl_test addl + addsubl_test subl + + andorxorl_test andl + andorxorl_test orl + andorxorl_test xorl + + andorab_test andab + andorab_test orab + + lbdsize r0, r1 + lbdsize r2, r3 + lbdsize.f r0, r1 + lbdsize.f r2, r3 + + bdlen r0, r1, 1 + bdlen r1, r3, 256 + bdlen r1, r2, 240 + bdlen r12, r13 + bdlen.f r0, r1, 1 + bdlen.f r1, r3, 256 + bdlen.f r12, r13 + + .macro cscb_test mnem + \mnem\() r10,r12,r20 + \mnem\() r0,0x12345678,r20 + \mnem\() r6,r7,0xffffffff + \mnem\() r8,0xffffffff,0xffffffff + \mnem\() 0,r14,r13 + \mnem\() 0,0xffffffff,r10 + \mnem\() 0,r12,0xffffffff + \mnem\() r4,r5,0x1 + \mnem\() r3,0x12345678,0x2 + \mnem\() 0,r1,0x4 + \mnem\() 0,0xffffffff,0x1 + .endm + + cscb_test csma + cscb_test csms + cscb_test cbba + cscb_test cbba.f + + .macro zncv_test mnem + \mnem\() r10,r12,r20 + \mnem\() r0,0x12345678,r20 + \mnem\() r6,r7,0xffffffff + \mnem\() r8,0xffffffff,0xffffffff + \mnem\() 0,r14,r13 + \mnem\() 0,0xffffffff,r10 + \mnem\() 0,r12,0xffffffff + \mnem\() r4,r5,0x1 + \mnem\() r3,0x12345678,0x2 + \mnem\() 0,r1,0x4 + \mnem\() 0,0xffffffff,0x1 + \mnem\() r1,r1,-1 + \mnem\() 0,0xffffffff,-1 + .endm + + zncv_test zncv.rd + zncv_test zncv.wr + + hofs r1, r2, r3 + hofs.f r4, r5, r6 + hofs r7, r8, 240, 0 + hofs.f r7, r8, 0, 1 + |