//Original:/testcases/core/c_dsp32shift_bitmux/c_dsp32shift_bitmux.dsp
// Spec Reference: dsp32shift bitmux
# mach: bfin

	.include "testutils.inc"

	start

	A0 = 0;
	imm32 r0, 0x01230000;
	imm32 r1, 0x12340678;
	imm32 r2, 0x23450089;
	imm32 r3, 0x3456089a;
	imm32 r4, 0x456709ab;
	imm32 r5, 0x56780abc;
	imm32 r6, 0x67890bcd;
	imm32 r7, 0x789a0cde;
//r0, r0, a0 >>= bitmux;	invalid now
	BITMUX( R0 , R1, A0) (ASR);
	BITMUX( R0 , R2, A0) (ASR);
	BITMUX( R0 , R3, A0) (ASR);
	BITMUX( R0 , R4, A0) (ASR);
	BITMUX( R0 , R5, A0) (ASR);
	BITMUX( R0 , R6, A0) (ASR);
	BITMUX( R0 , R7, A0) (ASR);
	CHECKREG r1, 0x091A033C;
	CHECKREG r0, 0x00024600;
	CHECKREG r2, 0x11A28044;
	CHECKREG r3, 0x1A2B044D;
	CHECKREG r4, 0x22B384D5;
	CHECKREG r5, 0x2B3C055E;
	CHECKREG r6, 0x33C485E6;
	CHECKREG r7, 0x3C4D066F;

	R0 = A0.w;
	R1 = A0.x;
	CHECKREG r0, 0x20000000;
	CHECKREG r1, 0x00000022;

	imm32 r0, 0x01231001;
	imm32 r1, 0x12341678;
	imm32 r2, 0x13451789;
	imm32 r3, 0x1456189a;
	imm32 r4, 0x156711ab;
	imm32 r5, 0x16781abc;
	imm32 r6, 0x17891bcd;
	imm32 r7, 0x189a1cde;
	BITMUX( R1 , R0, A0) (ASR);
//r1, r1, a0 >>= bitmux;
	BITMUX( R1 , R2, A0) (ASR);
	BITMUX( R1 , R3, A0) (ASR);
	BITMUX( R1 , R4, A0) (ASR);
	BITMUX( R1 , R5, A0) (ASR);
	BITMUX( R1 , R6, A0) (ASR);
	BITMUX( R1 , R7, A0) (ASR);
	CHECKREG r0, 0x00918800;
	CHECKREG r1, 0x0024682C;
	CHECKREG r2, 0x09A28BC4;
	CHECKREG r3, 0x0A2B0C4D;
	CHECKREG r4, 0x0AB388D5;
	CHECKREG r5, 0x0B3C0D5E;
	CHECKREG r6, 0x0BC48DE6;
	CHECKREG r7, 0x0C4D0E6F;

	R0 = A0.w;
	R1 = A0.x;
	CHECKREG r0, 0x28888000;
	CHECKREG r1, 0x00000077;

	imm32 r0, 0x31232002;
	imm32 r1, 0x22342678;
	imm32 r2, 0x23452789;
	imm32 r3, 0x2456289a;
	imm32 r4, 0x256729ab;
	imm32 r5, 0x26782abc;
	imm32 r6, 0x27892bcd;
	imm32 r7, 0x289a2cde;
	BITMUX( R2 , R0, A0) (ASR);
	BITMUX( R2 , R1, A0) (ASR);
//r2, r2, a0 >>= bitmux;
	BITMUX( R2 , R3, A0) (ASR);
	BITMUX( R2 , R4, A0) (ASR);
	BITMUX( R2 , R5, A0) (ASR);
	BITMUX( R2 , R6, A0) (ASR);
	BITMUX( R2 , R7, A0) (ASR);
	CHECKREG r0, 0x18919001;
	CHECKREG r1, 0x111A133C;
	CHECKREG r2, 0x00468A4F;
	CHECKREG r3, 0x122B144D;
	CHECKREG r4, 0x12B394D5;
	CHECKREG r5, 0x133C155E;
	CHECKREG r6, 0x13C495E6;
	CHECKREG r7, 0x144D166F;

	R0 = A0.w;
	R1 = A0.x;
	CHECKREG r0, 0x05DCA222;
	CHECKREG r1, 0x00000023;

	imm32 r0, 0x31230003;
	imm32 r1, 0x32345378;
	imm32 r2, 0x33456389;
	imm32 r3, 0x3456739a;
	imm32 r4, 0x356783ab;
	imm32 r5, 0x367893bc;
	imm32 r6, 0x3789a3cd;
	imm32 r7, 0x389ab3de;
	BITMUX( R3 , R0, A0) (ASR);
	BITMUX( R3 , R1, A0) (ASR);
	BITMUX( R3 , R2, A0) (ASR);
//r3, r3, a0 >>= bitmux;
	BITMUX( R3 , R4, A0) (ASR);
	BITMUX( R3 , R5, A0) (ASR);
	BITMUX( R3 , R6, A0) (ASR);
	BITMUX( R3 , R7, A0) (ASR);
	CHECKREG r0, 0x18918001;
	CHECKREG r1, 0x191A29BC;
	CHECKREG r2, 0x19A2B1C4;
	CHECKREG r3, 0x0068ACE7;
	CHECKREG r4, 0x1AB3C1D5;
	CHECKREG r5, 0x1B3C49DE;
	CHECKREG r6, 0x1BC4D1E6;
	CHECKREG r7, 0x1C4D59EF;

	R0 = A0.w;
	R1 = A0.x;
	CHECKREG r0, 0x988C1772;
	CHECKREG r1, 0x00000027;

	imm32 r0, 0x41230044;
	imm32 r1, 0x42345648;
	imm32 r2, 0x43456749;
	imm32 r3, 0x4456784a;
	imm32 r4, 0x4567894b;
	imm32 r5, 0x46789a4c;
	imm32 r6, 0x4789ab4d;
	imm32 r7, 0x489abc44;
	BITMUX( R4 , R0, A0) (ASR);
	BITMUX( R4 , R1, A0) (ASR);
	BITMUX( R4 , R2, A0) (ASR);
	BITMUX( R4 , R3, A0) (ASR);
//r4, r4, a0 >>= bitmux;
	BITMUX( R4 , R5, A0) (ASR);
	BITMUX( R4 , R6, A0) (ASR);
	BITMUX( R4 , R7, A0) (ASR);
	CHECKREG r0, 0x20918022;
	CHECKREG r1, 0x211A2B24;
	CHECKREG r2, 0x21A2B3A4;
	CHECKREG r3, 0x222B3C25;
	CHECKREG r4, 0x008ACF12;
	CHECKREG r5, 0x233C4D26;
	CHECKREG r6, 0x23C4D5A6;
	CHECKREG r7, 0x244D5E22;

	R0 = A0.w;
	R1 = A0.x;
	CHECKREG r0, 0x949E6230;
	CHECKREG r1, 0x00000061;

	imm32 r0, 0x51235005;
	imm32 r1, 0x52345678;
	imm32 r2, 0x53455789;
	imm32 r3, 0x5456589a;
	imm32 r4, 0x556759ab;
	imm32 r5, 0x56785abc;
	imm32 r6, 0x57895bcd;
	imm32 r7, 0x589a5cde;
	BITMUX( R5 , R0, A0) (ASR);
	BITMUX( R5 , R1, A0) (ASR);
	BITMUX( R5 , R2, A0) (ASR);
	BITMUX( R5 , R3, A0) (ASR);
	BITMUX( R5 , R4, A0) (ASR);
//r5, r5, a0 >>= bitmux;
	BITMUX( R5 , R6, A0) (ASR);
	BITMUX( R5 , R7, A0) (ASR);
	CHECKREG r0, 0x2891A802;
	CHECKREG r1, 0x291A2B3C;
	CHECKREG r2, 0x29A2ABC4;
	CHECKREG r3, 0x2A2B2C4D;
	CHECKREG r4, 0x2AB3ACD5;
	CHECKREG r5, 0x00ACF0B5;
	CHECKREG r6, 0x2BC4ADE6;
	CHECKREG r7, 0x2C4D2E6F;

	R0 = A0.w;
	R1 = A0.x;
	CHECKREG r0, 0xC9865279;
	CHECKREG r1, 0x0000003D;

	imm32 r0, 0x61260006;
	imm32 r1, 0x62365678;
	imm32 r2, 0x63466789;
	imm32 r3, 0x6456789a;
	imm32 r4, 0x656689ab;
	imm32 r5, 0x66786abc;
	imm32 r6, 0x6786abcd;
	imm32 r7, 0x6896bcde;
	BITMUX( R6 , R0, A0) (ASR);
	BITMUX( R6 , R1, A0) (ASR);
	BITMUX( R6 , R2, A0) (ASR);
	BITMUX( R6 , R3, A0) (ASR);
	BITMUX( R6 , R4, A0) (ASR);
	BITMUX( R6 , R5, A0) (ASR);
//r6, r6, a0 >>= bitmux;
	BITMUX( R6 , R7, A0) (ASR);
	CHECKREG r0, 0x30930003;
	CHECKREG r1, 0x311B2B3C;
	CHECKREG r2, 0x31A333C4;
	CHECKREG r3, 0x322B3C4D;
	CHECKREG r4, 0x32B344D5;
	CHECKREG r5, 0x333C355E;
	CHECKREG r6, 0x00CF0D57;
	CHECKREG r7, 0x344B5E6F;

	R0 = A0.w;
	R1 = A0.x;
	CHECKREG r0, 0xC4F72619;
	CHECKREG r1, 0x00000049;

	imm32 r0, 0x71730007;
	imm32 r1, 0x72745678;
	imm32 r2, 0x73756789;
	imm32 r3, 0x7476789a;
	imm32 r4, 0x757789ab;
	imm32 r5, 0x76789abc;
	imm32 r6, 0x7779abcd;
	imm32 r7, 0x777abcde;
	BITMUX( R7 , R0, A0) (ASR);
	BITMUX( R7 , R1, A0) (ASR);
	BITMUX( R7 , R2, A0) (ASR);
	BITMUX( R7 , R3, A0) (ASR);
	BITMUX( R7 , R4, A0) (ASR);
	BITMUX( R7 , R5, A0) (ASR);
	BITMUX( R7 , R6, A0) (ASR);
//r7, r7, a0 >>= bitmux;
	CHECKREG r0, 0x38B98003;
	CHECKREG r1, 0x393A2B3C;
	CHECKREG r2, 0x39BAB3C4;
	CHECKREG r3, 0x3A3B3C4D;
	CHECKREG r4, 0x3ABBC4D5;
	CHECKREG r5, 0x3B3C4D5E;
	CHECKREG r6, 0x3BBCD5E6;
	CHECKREG r7, 0x00EEF579;

	R0 = A0.w;
	R1 = A0.x;
	CHECKREG r0, 0xD92713DC;
	CHECKREG r1, 0xFFFFFFCD;

	imm32 r0, 0x08230080;
	imm32 r1, 0x18345688;
	imm32 r2, 0x28456789;
	imm32 r3, 0x3856788a;
	imm32 r4, 0x4867898b;
	imm32 r5, 0x58789a8c;
	imm32 r6, 0x6889ab8d;
	imm32 r7, 0x789abc8e;
//r0, r0, a0 <<= bitmux;
	BITMUX( R0 , R1, A0) (ASL);
	BITMUX( R0 , R2, A0) (ASL);
	BITMUX( R0 , R3, A0) (ASL);
	BITMUX( R0 , R4, A0) (ASL);
	BITMUX( R0 , R5, A0) (ASL);
	BITMUX( R0 , R6, A0) (ASL);
	BITMUX( R0 , R7, A0) (ASL);
	CHECKREG r1, 0x3068AD10;
	CHECKREG r0, 0x11804000;
	CHECKREG r2, 0x508ACF12;
	CHECKREG r3, 0x70ACF114;
	CHECKREG r4, 0x90CF1316;
	CHECKREG r5, 0xB0F13518;
	CHECKREG r6, 0xD113571A;
	CHECKREG r7, 0xF135791C;

	R0 = A0.w;
	R1 = A0.x;
	CHECKREG r0, 0xC4F70010;
	CHECKREG r1, 0x00000049;

	imm32 r0, 0x09230009;
	imm32 r1, 0x19345679;
	imm32 r2, 0x29456789;
	imm32 r3, 0x39567899;
	imm32 r4, 0x496789a9;
	imm32 r5, 0x59789ab9;
	imm32 r6, 0x6989abc9;
	imm32 r7, 0x799abcd9;
	BITMUX( R1 , R0, A0) (ASL);
//r1, r1, a0 <<= bitmux;
	BITMUX( R1 , R2, A0) (ASL);
	BITMUX( R1 , R3, A0) (ASL);
	BITMUX( R1 , R4, A0) (ASL);
	BITMUX( R1 , R5, A0) (ASL);
	BITMUX( R1 , R6, A0) (ASL);
	BITMUX( R1 , R7, A0) (ASL);
	CHECKREG r0, 0x12460012;
	CHECKREG r1, 0x9A2B3C80;
	CHECKREG r2, 0x528ACF12;
	CHECKREG r3, 0x72ACF132;
	CHECKREG r4, 0x92CF1352;
	CHECKREG r5, 0xB2F13572;
	CHECKREG r6, 0xD3135792;
	CHECKREG r7, 0xF33579B2;

	R0 = A0.w;
	R1 = A0.x;
	CHECKREG r0, 0xC0040050;
	CHECKREG r1, 0x0000003D;

	imm32 r0, 0x0a23000a;
	imm32 r1, 0x1a34567a;
	imm32 r2, 0x2a45678a;
	imm32 r3, 0x3a56789a;
	imm32 r4, 0x4a6789aa;
	imm32 r5, 0x5aa89aba;
	imm32 r6, 0x6a89abca;
	imm32 r7, 0x7a9abcda;
	BITMUX( R2 , R0, A0) (ASL);
	BITMUX( R2 , R1, A0) (ASL);
//r2, r2, a0 <<= bitmux;
	BITMUX( R2 , R3, A0) (ASL);
	BITMUX( R2 , R4, A0) (ASL);
	BITMUX( R2 , R5, A0) (ASL);
	BITMUX( R2 , R6, A0) (ASL);
	BITMUX( R2 , R7, A0) (ASL);
	CHECKREG r0, 0x14460014;
	CHECKREG r1, 0x3468ACF4;
	CHECKREG r2, 0x22B3C500;
	CHECKREG r3, 0x74ACF134;
	CHECKREG r4, 0x94CF1354;
	CHECKREG r5, 0xB5513574;
	CHECKREG r6, 0xD5135794;
	CHECKREG r7, 0xF53579B4;

	R0 = A0.w;
	R1 = A0.x;
	CHECKREG r0, 0x00140111;
	CHECKREG r1, 0x00000001;

	imm32 r0, 0x01b300b3;
	imm32 r1, 0x12b456b8;
	imm32 r2, 0x23b567b9;
	imm32 r3, 0x34b678ba;
	imm32 r4, 0x45b789bb;
	imm32 r5, 0x56b89abc;
	imm32 r6, 0x67b9abbd;
	imm32 r7, 0x78babcbe;
	BITMUX( R3 , R0, A0) (ASL);
	BITMUX( R3 , R1, A0) (ASL);
	BITMUX( R3 , R2, A0) (ASL);
//r3, r3, a0 <<= bitmux;
	BITMUX( R3 , R4, A0) (ASL);
	BITMUX( R3 , R5, A0) (ASL);
	BITMUX( R3 , R6, A0) (ASL);
	BITMUX( R3 , R7, A0) (ASL);
	CHECKREG r0, 0x03660166;
	CHECKREG r1, 0x2568AD70;
	CHECKREG r2, 0x476ACF72;
	CHECKREG r3, 0x5B3C5D00;
	CHECKREG r4, 0x8B6F1376;
	CHECKREG r5, 0xAD713578;
	CHECKREG r6, 0xCF73577A;
	CHECKREG r7, 0xF175797C;

	R0 = A0.w;
	R1 = A0.x;
	CHECKREG r0, 0x00444144;
	CHECKREG r1, 0x00000005;

	imm32 r0, 0x012300c4;
	imm32 r1, 0x123456c8;
	imm32 r2, 0x234567c9;
	imm32 r3, 0x345678ca;
	imm32 r4, 0x456789cb;
	imm32 r5, 0x56789acc;
	imm32 r6, 0x6789abcd;
	imm32 r7, 0x789abcce;
	BITMUX( R4 , R0, A0) (ASL);
	BITMUX( R4 , R1, A0) (ASL);
	BITMUX( R4 , R2, A0) (ASL);
	BITMUX( R4 , R3, A0) (ASL);
//r4, r4, a0 <<= bitmux;
	BITMUX( R4 , R5, A0) (ASL);
	BITMUX( R4 , R6, A0) (ASL);
	BITMUX( R4 , R7, A0) (ASL);
	CHECKREG r0, 0x02460188;
	CHECKREG r1, 0x2468AD90;
	CHECKREG r2, 0x468ACF92;
	CHECKREG r3, 0x68ACF194;
	CHECKREG r4, 0xB3C4E580;
	CHECKREG r5, 0xACF13598;
	CHECKREG r6, 0xCF13579A;
	CHECKREG r7, 0xF135799C;

	R0 = A0.w;
	R1 = A0.x;
	CHECKREG r0, 0x10510404;
	CHECKREG r1, 0x00000011;

	imm32 r0, 0x0c230d05;
	imm32 r1, 0x1c345d78;
	imm32 r2, 0x2c456d89;
	imm32 r3, 0x3c567d9a;
	imm32 r4, 0x4c678dab;
	imm32 r5, 0x5c789dbc;
	imm32 r6, 0x6c89adcd;
	imm32 r7, 0x7c9abdde;
	BITMUX( R5 , R0, A0) (ASL);
	BITMUX( R5 , R1, A0) (ASL);
	BITMUX( R5 , R2, A0) (ASL);
	BITMUX( R5 , R3, A0) (ASL);
	BITMUX( R5 , R4, A0) (ASL);
//r5, r5, a0 <<= bitmux;
	BITMUX( R5 , R6, A0) (ASL);
	BITMUX( R5 , R7, A0) (ASL);
	CHECKREG r0, 0x18461A0A;
	CHECKREG r1, 0x3868BAF0;
	CHECKREG r2, 0x588ADB12;
	CHECKREG r3, 0x78ACFB34;
	CHECKREG r4, 0x98CF1B56;
	CHECKREG r5, 0x3C4EDE00;
	CHECKREG r6, 0xD9135B9A;
	CHECKREG r7, 0xF9357BBC;

	R0 = A0.w;
	R1 = A0.x;
	CHECKREG r0, 0x41010454;
	CHECKREG r1, 0x00000014;

	imm32 r0, 0x0d230e06;
	imm32 r1, 0x1d345e78;
	imm32 r2, 0x2d456e89;
	imm32 r3, 0x3d567e9a;
	imm32 r4, 0x4d678eab;
	imm32 r5, 0x5d789ebc;
	imm32 r6, 0x6d89aecd;
	imm32 r7, 0x7d9abede;
	BITMUX( R6 , R0, A0) (ASL);
	BITMUX( R6 , R1, A0) (ASL);
	BITMUX( R6 , R2, A0) (ASL);
	BITMUX( R6 , R3, A0) (ASL);
	BITMUX( R6 , R4, A0) (ASL);
	BITMUX( R6 , R5, A0) (ASL);
//r6, r6, a0 <<= bitmux;
	BITMUX( R6 , R7, A0) (ASL);
	CHECKREG r0, 0x1A461C0C;
	CHECKREG r1, 0x3A68BCF0;
	CHECKREG r2, 0x5A8ADD12;
	CHECKREG r3, 0x7AACFD34;
	CHECKREG r4, 0x9ACF1D56;
	CHECKREG r5, 0xBAF13D78;
	CHECKREG r6, 0xC4D76680;
	CHECKREG r7, 0xFB357DBC;

	R0 = A0.w;
	R1 = A0.x;
	CHECKREG r0, 0x41150514;
	CHECKREG r1, 0x00000040;

	imm32 r0, 0x01230007;
	imm32 r1, 0x12345678;
	imm32 r2, 0x23456789;
	imm32 r3, 0x3456789a;
	imm32 r4, 0x456789ab;
	imm32 r5, 0x56789abc;
	imm32 r6, 0x6789abcd;
	imm32 r7, 0x789abcde;
	BITMUX( R7 , R0, A0) (ASL);
	BITMUX( R7 , R1, A0) (ASL);
	BITMUX( R7 , R2, A0) (ASL);
	BITMUX( R7 , R3, A0) (ASL);
	BITMUX( R7 , R4, A0) (ASL);
	BITMUX( R7 , R5, A0) (ASL);
	BITMUX( R7 , R6, A0) (ASL);
//r7, r7, a0 <<= bitmux;

	CHECKREG r0, 0x0246000E;
	CHECKREG r1, 0x2468ACF0;
	CHECKREG r2, 0x468ACF12;
	CHECKREG r3, 0x68ACF134;
	CHECKREG r4, 0x8ACF1356;
	CHECKREG r5, 0xACF13578;
	CHECKREG r6, 0xCF13579A;
	CHECKREG r7, 0x4D5E6F00;

	pass
