From 80970d232c9c4dc5dddc0597323946d9655a50d8 Mon Sep 17 00:00:00 2001 From: Jeff Bush Date: Mon, 12 Feb 2018 20:28:55 -0800 Subject: [PATCH] syscall instruction now takes an index as a parameter *This change breaks binary compatibility.* I needed to choose a different opcode number for syscall to make it fit into the immediate instruction type (which only has 5 bits) --- lib/Target/Nyuzi/NyuziInstrInfo.td | 10 ++- test/MC/Nyuzi/assembler-tests.s | 126 +++++++++++++++-------------- test/MC/Nyuzi/disassembler-tests.s | 126 +++++++++++++++-------------- test/MC/Nyuzi/make_tests.py | 4 +- 4 files changed, 137 insertions(+), 129 deletions(-) diff --git a/lib/Target/Nyuzi/NyuziInstrInfo.td b/lib/Target/Nyuzi/NyuziInstrInfo.td index d15f3e3e2e..c4a7b5a9bb 100644 --- a/lib/Target/Nyuzi/NyuziInstrInfo.td +++ b/lib/Target/Nyuzi/NyuziInstrInfo.td @@ -801,12 +801,14 @@ let usesCustomInserter = 1 in { def SYSCALL : NyuziInstruction< (outs), - (ins), - "syscall", + (ins SIMM14OP:$index), + "syscall $index", [], II_INT> { - let Inst{31-29} = 0b110; - let Inst{25-20} = 0x3f; // opcode + // immediate, format 0 + bits<14> index; + let Inst{23-10} = index; + let Inst{27-24} = 2; // opcode } def BREAK : NyuziInstruction< diff --git a/test/MC/Nyuzi/assembler-tests.s b/test/MC/Nyuzi/assembler-tests.s index 0e58149d96..8989dc41d3 100644 --- a/test/MC/Nyuzi/assembler-tests.s +++ b/test/MC/Nyuzi/assembler-tests.s @@ -5,81 +5,81 @@ or v5, v6, s7 # CHECK: 0xa6,0x80,0x03,0xc4 or_mask v9, s12, v10, s11 # CHECK: 0x2a,0xb1,0x05,0xc8 or v13, v14, v15 # CHECK: 0xae,0x81,0x07,0xd0 or_mask v17, s20, v18, v19 # CHECK: 0x32,0xd2,0x09,0xd4 -or s21, s22, -56 # CHECK: 0xb6,0x22,0xff,0x00 -or v24, v25, 82 # CHECK: 0x19,0x4b,0x01,0x20 -or_mask v27, s1, v0, 96 # CHECK: 0x60,0x07,0x30,0x60 +or s21, s22, 87 # CHECK: 0xb6,0x5e,0x01,0x00 +or v24, v25, 124 # CHECK: 0x19,0xf3,0x01,0x20 +or_mask v27, s1, v0, 71 # CHECK: 0x60,0x87,0x23,0x60 and s2, s3, s4 # CHECK: 0x43,0x00,0x12,0xc0 and v6, v7, s8 # CHECK: 0xc7,0x00,0x14,0xc4 and_mask v10, s13, v11, s12 # CHECK: 0x4b,0x35,0x16,0xc8 and v14, v15, v16 # CHECK: 0xcf,0x01,0x18,0xd0 and_mask v18, s21, v19, v20 # CHECK: 0x53,0x56,0x1a,0xd4 -and s22, s23, 54 # CHECK: 0xd7,0xda,0x00,0x01 -and v25, v26, 127 # CHECK: 0x3a,0xff,0x01,0x21 -and_mask v0, s2, v1, 26 # CHECK: 0x01,0x08,0x0d,0x61 +and s22, s23, 40 # CHECK: 0xd7,0xa2,0x00,0x01 +and v25, v26, 59 # CHECK: 0x3a,0xef,0x00,0x21 +and_mask v0, s2, v1, 126 # CHECK: 0x01,0x08,0x3f,0x61 xor s3, s4, s5 # CHECK: 0x64,0x80,0x32,0xc0 xor v7, v8, s9 # CHECK: 0xe8,0x80,0x34,0xc4 xor_mask v11, s14, v12, s13 # CHECK: 0x6c,0xb9,0x36,0xc8 xor v15, v16, v17 # CHECK: 0xf0,0x81,0x38,0xd0 xor_mask v19, s22, v20, v21 # CHECK: 0x74,0xda,0x3a,0xd4 -xor s23, s24, -53 # CHECK: 0xf8,0x2e,0xff,0x03 -xor v26, v27, -56 # CHECK: 0x5b,0x23,0xff,0x23 -xor_mask v1, s3, v2, 19 # CHECK: 0x22,0x8c,0x09,0x63 +xor s23, s24, 79 # CHECK: 0xf8,0x3e,0x01,0x03 +xor v26, v27, 25 # CHECK: 0x5b,0x67,0x00,0x23 +xor_mask v1, s3, v2, -5 # CHECK: 0x22,0x8c,0xfd,0x63 add_i s4, s5, s6 # CHECK: 0x85,0x00,0x53,0xc0 add_i v8, v9, s10 # CHECK: 0x09,0x01,0x55,0xc4 add_i_mask v12, s15, v13, s14 # CHECK: 0x8d,0x3d,0x57,0xc8 add_i v16, v17, v18 # CHECK: 0x11,0x02,0x59,0xd0 add_i_mask v20, s23, v21, v22 # CHECK: 0x95,0x5e,0x5b,0xd4 -add_i s24, s25, -119 # CHECK: 0x19,0x27,0xfe,0x05 -add_i v27, v0, -89 # CHECK: 0x60,0x9f,0xfe,0x25 -add_i_mask v2, s4, v3, 94 # CHECK: 0x43,0x10,0x2f,0x65 +add_i s24, s25, 81 # CHECK: 0x19,0x47,0x01,0x05 +add_i v27, v0, 4 # CHECK: 0x60,0x13,0x00,0x25 +add_i_mask v2, s4, v3, -79 # CHECK: 0x43,0x90,0xd8,0x65 sub_i s5, s6, s7 # CHECK: 0xa6,0x80,0x63,0xc0 sub_i v9, v10, s11 # CHECK: 0x2a,0x81,0x65,0xc4 sub_i_mask v13, s16, v14, s15 # CHECK: 0xae,0xc1,0x67,0xc8 sub_i v17, v18, v19 # CHECK: 0x32,0x82,0x69,0xd0 sub_i_mask v21, s24, v22, v23 # CHECK: 0xb6,0xe2,0x6b,0xd4 -sub_i s25, s26, 88 # CHECK: 0x3a,0x63,0x01,0x06 -sub_i v0, v1, -76 # CHECK: 0x01,0xd0,0xfe,0x26 -sub_i_mask v3, s5, v4, 115 # CHECK: 0x64,0x94,0x39,0x66 +sub_i s25, s26, 110 # CHECK: 0x3a,0xbb,0x01,0x06 +sub_i v0, v1, -52 # CHECK: 0x01,0x30,0xff,0x26 +sub_i_mask v3, s5, v4, 10 # CHECK: 0x64,0x14,0x05,0x66 mull_i s6, s7, s8 # CHECK: 0xc7,0x00,0x74,0xc0 mull_i v10, v11, s12 # CHECK: 0x4b,0x01,0x76,0xc4 mull_i_mask v14, s17, v15, s16 # CHECK: 0xcf,0x45,0x78,0xc8 mull_i v18, v19, v20 # CHECK: 0x53,0x02,0x7a,0xd0 mull_i_mask v22, s25, v23, v24 # CHECK: 0xd7,0x66,0x7c,0xd4 -mull_i s26, s27, -9 # CHECK: 0x5b,0xdf,0xff,0x07 -mull_i v1, v2, 26 # CHECK: 0x22,0x68,0x00,0x27 -mull_i_mask v4, s6, v5, 111 # CHECK: 0x85,0x98,0x37,0x67 +mull_i s26, s27, 107 # CHECK: 0x5b,0xaf,0x01,0x07 +mull_i v1, v2, -98 # CHECK: 0x22,0x78,0xfe,0x27 +mull_i_mask v4, s6, v5, 33 # CHECK: 0x85,0x98,0x10,0x67 mulh_u s7, s8, s9 # CHECK: 0xe8,0x80,0x84,0xc0 mulh_u v11, v12, s13 # CHECK: 0x6c,0x81,0x86,0xc4 mulh_u_mask v15, s18, v16, s17 # CHECK: 0xf0,0xc9,0x88,0xc8 mulh_u v19, v20, v21 # CHECK: 0x74,0x82,0x8a,0xd0 mulh_u_mask v23, s26, v24, v25 # CHECK: 0xf8,0xea,0x8c,0xd4 -mulh_u s27, s0, -73 # CHECK: 0x60,0xdf,0xfe,0x08 -mulh_u v2, v3, -59 # CHECK: 0x43,0x14,0xff,0x28 -mulh_u_mask v5, s7, v6, 116 # CHECK: 0xa6,0x1c,0x3a,0x68 +mulh_u s27, s0, -103 # CHECK: 0x60,0x67,0xfe,0x08 +mulh_u v2, v3, 44 # CHECK: 0x43,0xb0,0x00,0x28 +mulh_u_mask v5, s7, v6, 79 # CHECK: 0xa6,0x9c,0x27,0x68 ashr s8, s9, s10 # CHECK: 0x09,0x01,0x95,0xc0 ashr v12, v13, s14 # CHECK: 0x8d,0x01,0x97,0xc4 ashr_mask v16, s19, v17, s18 # CHECK: 0x11,0x4e,0x99,0xc8 ashr v20, v21, v22 # CHECK: 0x95,0x02,0x9b,0xd0 ashr_mask v24, s27, v25, v26 # CHECK: 0x19,0x6f,0x9d,0xd4 -ashr s0, s1, 63 # CHECK: 0x01,0xfc,0x00,0x09 -ashr v3, v4, 21 # CHECK: 0x64,0x54,0x00,0x29 -ashr_mask v6, s8, v7, -20 # CHECK: 0xc7,0x20,0xf6,0x69 +ashr s0, s1, 99 # CHECK: 0x01,0x8c,0x01,0x09 +ashr v3, v4, -92 # CHECK: 0x64,0x90,0xfe,0x29 +ashr_mask v6, s8, v7, 56 # CHECK: 0xc7,0x20,0x1c,0x69 shr s9, s10, s11 # CHECK: 0x2a,0x81,0xa5,0xc0 shr v13, v14, s15 # CHECK: 0xae,0x81,0xa7,0xc4 shr_mask v17, s20, v18, s19 # CHECK: 0x32,0xd2,0xa9,0xc8 shr v21, v22, v23 # CHECK: 0xb6,0x82,0xab,0xd0 shr_mask v25, s0, v26, v27 # CHECK: 0x3a,0x83,0xad,0xd4 -shr s1, s2, 4 # CHECK: 0x22,0x10,0x00,0x0a -shr v4, v5, -75 # CHECK: 0x85,0xd4,0xfe,0x2a -shr_mask v7, s9, v8, 85 # CHECK: 0xe8,0xa4,0x2a,0x6a +shr s1, s2, 93 # CHECK: 0x22,0x74,0x01,0x0a +shr v4, v5, -118 # CHECK: 0x85,0x28,0xfe,0x2a +shr_mask v7, s9, v8, -71 # CHECK: 0xe8,0xa4,0xdc,0x6a shl s10, s11, s12 # CHECK: 0x4b,0x01,0xb6,0xc0 shl v14, v15, s16 # CHECK: 0xcf,0x01,0xb8,0xc4 shl_mask v18, s21, v19, s20 # CHECK: 0x53,0x56,0xba,0xc8 shl v22, v23, v24 # CHECK: 0xd7,0x02,0xbc,0xd0 shl_mask v26, s1, v27, v0 # CHECK: 0x5b,0x07,0xb0,0xd4 -shl s2, s3, -27 # CHECK: 0x43,0x94,0xff,0x0b -shl v5, v6, -75 # CHECK: 0xa6,0xd4,0xfe,0x2b -shl_mask v8, s10, v9, 58 # CHECK: 0x09,0x29,0x1d,0x6b +shl s2, s3, -80 # CHECK: 0x43,0xc0,0xfe,0x0b +shl v5, v6, -22 # CHECK: 0xa6,0xa8,0xff,0x2b +shl_mask v8, s10, v9, -4 # CHECK: 0x09,0x29,0xfe,0x6b add_f s11, s12, s13 # CHECK: 0x6c,0x81,0x06,0xc2 add_f v15, v16, s17 # CHECK: 0xf0,0x81,0x08,0xc6 add_f_mask v19, s22, v20, s21 # CHECK: 0x74,0xda,0x0a,0xca @@ -100,9 +100,9 @@ mulh_i v19, v20, s21 # CHECK: 0x74,0x82,0xfa,0xc5 mulh_i_mask v23, s26, v24, s25 # CHECK: 0xf8,0xea,0xfc,0xc9 mulh_i v27, v0, v1 # CHECK: 0x60,0x83,0xf0,0xd1 mulh_i_mask v3, s6, v4, v5 # CHECK: 0x64,0x98,0xf2,0xd5 -mulh_i s7, s8, -41 # CHECK: 0xe8,0x5c,0xff,0x1f -mulh_i v10, v11, 49 # CHECK: 0x4b,0xc5,0x00,0x3f -mulh_i_mask v13, s15, v14, 54 # CHECK: 0xae,0x3d,0x1b,0x7f +mulh_i s7, s8, 28 # CHECK: 0xe8,0x70,0x00,0x1f +mulh_i v10, v11, 42 # CHECK: 0x4b,0xa9,0x00,0x3f +mulh_i_mask v13, s15, v14, -9 # CHECK: 0xae,0xbd,0xfb,0x7f movehi s2, 371769 # CHECK: 0x59,0x84,0xb5,0x4f clz s1, s2 # CHECK: 0x20,0x00,0xc1,0xc0 clz v1, s2 # CHECK: 0x20,0x00,0xc1,0xc4 @@ -154,53 +154,53 @@ nop # CHECK: 0x00,0x00,0x00,0x00 cmpeq_i s1, s2, s3 # CHECK: 0x22,0x80,0x01,0xc1 cmpeq_i s1, v2, s3 # CHECK: 0x22,0x80,0x01,0xc5 cmpeq_i s1, v2, v3 # CHECK: 0x22,0x80,0x01,0xd1 -cmpeq_i s1, s2, 56 # CHECK: 0x22,0xe0,0x00,0x10 -cmpeq_i s1, v2, 56 # CHECK: 0x22,0xe0,0x00,0x30 +cmpeq_i s1, s2, 228 # CHECK: 0x22,0x90,0x03,0x10 +cmpeq_i s1, v2, 228 # CHECK: 0x22,0x90,0x03,0x30 cmpne_i s4, s5, s6 # CHECK: 0x85,0x00,0x13,0xc1 cmpne_i s4, v5, s6 # CHECK: 0x85,0x00,0x13,0xc5 cmpne_i s4, v5, v6 # CHECK: 0x85,0x00,0x13,0xd1 -cmpne_i s4, s5, 20 # CHECK: 0x85,0x50,0x00,0x11 -cmpne_i s4, v5, 20 # CHECK: 0x85,0x50,0x00,0x31 +cmpne_i s4, s5, 122 # CHECK: 0x85,0xe8,0x01,0x11 +cmpne_i s4, v5, 122 # CHECK: 0x85,0xe8,0x01,0x31 cmpgt_i s7, s8, s9 # CHECK: 0xe8,0x80,0x24,0xc1 cmpgt_i s7, v8, s9 # CHECK: 0xe8,0x80,0x24,0xc5 cmpgt_i s7, v8, v9 # CHECK: 0xe8,0x80,0x24,0xd1 -cmpgt_i s7, s8, 237 # CHECK: 0xe8,0xb4,0x03,0x12 -cmpgt_i s7, v8, 237 # CHECK: 0xe8,0xb4,0x03,0x32 +cmpgt_i s7, s8, 199 # CHECK: 0xe8,0x1c,0x03,0x12 +cmpgt_i s7, v8, 199 # CHECK: 0xe8,0x1c,0x03,0x32 cmpge_i s10, s11, s12 # CHECK: 0x4b,0x01,0x36,0xc1 cmpge_i s10, v11, s12 # CHECK: 0x4b,0x01,0x36,0xc5 cmpge_i s10, v11, v12 # CHECK: 0x4b,0x01,0x36,0xd1 -cmpge_i s10, s11, 109 # CHECK: 0x4b,0xb5,0x01,0x13 -cmpge_i s10, v11, 109 # CHECK: 0x4b,0xb5,0x01,0x33 +cmpge_i s10, s11, 252 # CHECK: 0x4b,0xf1,0x03,0x13 +cmpge_i s10, v11, 252 # CHECK: 0x4b,0xf1,0x03,0x33 cmplt_i s13, s14, s15 # CHECK: 0xae,0x81,0x47,0xc1 cmplt_i s13, v14, s15 # CHECK: 0xae,0x81,0x47,0xc5 cmplt_i s13, v14, v15 # CHECK: 0xae,0x81,0x47,0xd1 -cmplt_i s13, s14, 137 # CHECK: 0xae,0x25,0x02,0x14 -cmplt_i s13, v14, 137 # CHECK: 0xae,0x25,0x02,0x34 +cmplt_i s13, s14, 82 # CHECK: 0xae,0x49,0x01,0x14 +cmplt_i s13, v14, 82 # CHECK: 0xae,0x49,0x01,0x34 cmple_i s16, s17, s18 # CHECK: 0x11,0x02,0x59,0xc1 cmple_i s16, v17, s18 # CHECK: 0x11,0x02,0x59,0xc5 cmple_i s16, v17, v18 # CHECK: 0x11,0x02,0x59,0xd1 -cmple_i s16, s17, 247 # CHECK: 0x11,0xde,0x03,0x15 -cmple_i s16, v17, 247 # CHECK: 0x11,0xde,0x03,0x35 +cmple_i s16, s17, 120 # CHECK: 0x11,0xe2,0x01,0x15 +cmple_i s16, v17, 120 # CHECK: 0x11,0xe2,0x01,0x35 cmpgt_u s19, s20, s21 # CHECK: 0x74,0x82,0x6a,0xc1 cmpgt_u s19, v20, s21 # CHECK: 0x74,0x82,0x6a,0xc5 cmpgt_u s19, v20, v21 # CHECK: 0x74,0x82,0x6a,0xd1 -cmpgt_u s19, s20, 101 # CHECK: 0x74,0x96,0x01,0x16 -cmpgt_u s19, v20, 101 # CHECK: 0x74,0x96,0x01,0x36 +cmpgt_u s19, s20, 99 # CHECK: 0x74,0x8e,0x01,0x16 +cmpgt_u s19, v20, 99 # CHECK: 0x74,0x8e,0x01,0x36 cmpge_u s22, s23, s24 # CHECK: 0xd7,0x02,0x7c,0xc1 cmpge_u s22, v23, s24 # CHECK: 0xd7,0x02,0x7c,0xc5 cmpge_u s22, v23, v24 # CHECK: 0xd7,0x02,0x7c,0xd1 -cmpge_u s22, s23, 152 # CHECK: 0xd7,0x62,0x02,0x17 -cmpge_u s22, v23, 152 # CHECK: 0xd7,0x62,0x02,0x37 +cmpge_u s22, s23, 188 # CHECK: 0xd7,0xf2,0x02,0x17 +cmpge_u s22, v23, 188 # CHECK: 0xd7,0xf2,0x02,0x37 cmplt_u s25, s26, s27 # CHECK: 0x3a,0x83,0x8d,0xc1 cmplt_u s25, v26, s27 # CHECK: 0x3a,0x83,0x8d,0xc5 cmplt_u s25, v26, v27 # CHECK: 0x3a,0x83,0x8d,0xd1 -cmplt_u s25, s26, 97 # CHECK: 0x3a,0x87,0x01,0x18 -cmplt_u s25, v26, 97 # CHECK: 0x3a,0x87,0x01,0x38 +cmplt_u s25, s26, 232 # CHECK: 0x3a,0xa3,0x03,0x18 +cmplt_u s25, v26, 232 # CHECK: 0x3a,0xa3,0x03,0x38 cmple_u s0, s1, s2 # CHECK: 0x01,0x00,0x91,0xc1 cmple_u s0, v1, s2 # CHECK: 0x01,0x00,0x91,0xc5 cmple_u s0, v1, v2 # CHECK: 0x01,0x00,0x91,0xd1 -cmple_u s0, s1, 33 # CHECK: 0x01,0x84,0x00,0x19 -cmple_u s0, v1, 33 # CHECK: 0x01,0x84,0x00,0x39 +cmple_u s0, s1, 149 # CHECK: 0x01,0x54,0x02,0x19 +cmple_u s0, v1, 149 # CHECK: 0x01,0x54,0x02,0x39 cmpgt_f s3, s4, s5 # CHECK: 0x64,0x80,0xc2,0xc2 cmpgt_f s3, v4, s5 # CHECK: 0x64,0x80,0xc2,0xc6 cmpgt_f s3, v4, v5 # CHECK: 0x64,0x80,0xc2,0xd2 @@ -233,20 +233,20 @@ store_32 s25, (s26) # CHECK: 0x3a,0x03,0x00,0x88 store_32 s25, 27(s26) # CHECK: 0x3a,0x6f,0x00,0x88 store_sync s0, (s1) # CHECK: 0x01,0x00,0x00,0x8a store_sync s0, 2(s1) # CHECK: 0x01,0x08,0x00,0x8a -load_v v1, 424(s2) # CHECK: 0x22,0xa0,0x06,0xae -load_v_mask v1, s3, 424(s2) # CHECK: 0x22,0x0c,0xd4,0xb0 +load_v v1, 400(s2) # CHECK: 0x22,0x40,0x06,0xae +load_v_mask v1, s3, 400(s2) # CHECK: 0x22,0x0c,0xc8,0xb0 load_v v1, (s2) # CHECK: 0x22,0x00,0x00,0xae load_v_mask v1, s3, (s2) # CHECK: 0x22,0x0c,0x00,0xb0 -store_v v1, 424(s2) # CHECK: 0x22,0xa0,0x06,0x8e -store_v_mask v1, s3, 424(s2) # CHECK: 0x22,0x0c,0xd4,0x90 +store_v v1, 400(s2) # CHECK: 0x22,0x40,0x06,0x8e +store_v_mask v1, s3, 400(s2) # CHECK: 0x22,0x0c,0xc8,0x90 store_v v1, (s2) # CHECK: 0x22,0x00,0x00,0x8e store_v_mask v1, s3, (s2) # CHECK: 0x22,0x0c,0x00,0x90 -load_gath v4, 312(v5) # CHECK: 0x85,0xe0,0x04,0xba -load_gath_mask v4, s6, 312(v5) # CHECK: 0x85,0x18,0x9c,0xbc +load_gath v4, 120(v5) # CHECK: 0x85,0xe0,0x01,0xba +load_gath_mask v4, s6, 120(v5) # CHECK: 0x85,0x18,0x3c,0xbc load_gath v4, (v5) # CHECK: 0x85,0x00,0x00,0xba load_gath_mask v4, s6, (v5) # CHECK: 0x85,0x18,0x00,0xbc -store_scat v4, 312(v5) # CHECK: 0x85,0xe0,0x04,0x9a -store_scat_mask v4, s6, 312(v5) # CHECK: 0x85,0x18,0x9c,0x9c +store_scat v4, 120(v5) # CHECK: 0x85,0xe0,0x01,0x9a +store_scat_mask v4, s6, 120(v5) # CHECK: 0x85,0x18,0x3c,0x9c store_scat v4, (v5) # CHECK: 0x85,0x00,0x00,0x9a store_scat_mask v4, s6, (v5) # CHECK: 0x85,0x18,0x00,0x9c getcr s7, 9 # CHECK: 0xe9,0x00,0x00,0xac @@ -260,4 +260,6 @@ tlbinvalall # CHECK: 0x00,0x00,0x00,0xec dtlbinsert s1, s2 # CHECK: 0x41,0x00,0x00,0xe0 itlbinsert s3, s4 # CHECK: 0x83,0x00,0x00,0xee break # CHECK: 0x00,0x00,0xe0,0xc3 -syscall # CHECK: 0x00,0x00,0xf0,0xc3 +syscall 0 # CHECK: 0x00,0x00,0x00,0x02 +syscall 17 # CHECK: 0x00,0x44,0x00,0x02 +syscall 1037 # CHECK: 0x00,0x34,0x10,0x02 diff --git a/test/MC/Nyuzi/disassembler-tests.s b/test/MC/Nyuzi/disassembler-tests.s index c55d5432a5..189ef36c7b 100644 --- a/test/MC/Nyuzi/disassembler-tests.s +++ b/test/MC/Nyuzi/disassembler-tests.s @@ -5,81 +5,81 @@ 0x2a 0xb1 0x05 0xc8 # CHECK: or_mask v9, s12, v10, s11 0xae 0x81 0x07 0xd0 # CHECK: or v13, v14, v15 0x32 0xd2 0x09 0xd4 # CHECK: or_mask v17, s20, v18, v19 -0xb6 0x22 0xff 0x00 # CHECK: or s21, s22, -56 -0x19 0x4b 0x01 0x20 # CHECK: or v24, v25, 82 -0x60 0x07 0x30 0x60 # CHECK: or_mask v27, s1, v0, 96 +0xb6 0x5e 0x01 0x00 # CHECK: or s21, s22, 87 +0x19 0xf3 0x01 0x20 # CHECK: or v24, v25, 124 +0x60 0x87 0x23 0x60 # CHECK: or_mask v27, s1, v0, 71 0x43 0x00 0x12 0xc0 # CHECK: and s2, s3, s4 0xc7 0x00 0x14 0xc4 # CHECK: and v6, v7, s8 0x4b 0x35 0x16 0xc8 # CHECK: and_mask v10, s13, v11, s12 0xcf 0x01 0x18 0xd0 # CHECK: and v14, v15, v16 0x53 0x56 0x1a 0xd4 # CHECK: and_mask v18, s21, v19, v20 -0xd7 0xda 0x00 0x01 # CHECK: and s22, s23, 54 -0x3a 0xff 0x01 0x21 # CHECK: and v25, v26, 127 -0x01 0x08 0x0d 0x61 # CHECK: and_mask v0, s2, v1, 26 +0xd7 0xa2 0x00 0x01 # CHECK: and s22, s23, 40 +0x3a 0xef 0x00 0x21 # CHECK: and v25, v26, 59 +0x01 0x08 0x3f 0x61 # CHECK: and_mask v0, s2, v1, 126 0x64 0x80 0x32 0xc0 # CHECK: xor s3, s4, s5 0xe8 0x80 0x34 0xc4 # CHECK: xor v7, v8, s9 0x6c 0xb9 0x36 0xc8 # CHECK: xor_mask v11, s14, v12, s13 0xf0 0x81 0x38 0xd0 # CHECK: xor v15, v16, v17 0x74 0xda 0x3a 0xd4 # CHECK: xor_mask v19, s22, v20, v21 -0xf8 0x2e 0xff 0x03 # CHECK: xor s23, s24, -53 -0x5b 0x23 0xff 0x23 # CHECK: xor v26, v27, -56 -0x22 0x8c 0x09 0x63 # CHECK: xor_mask v1, s3, v2, 19 +0xf8 0x3e 0x01 0x03 # CHECK: xor s23, s24, 79 +0x5b 0x67 0x00 0x23 # CHECK: xor v26, v27, 25 +0x22 0x8c 0xfd 0x63 # CHECK: xor_mask v1, s3, v2, -5 0x85 0x00 0x53 0xc0 # CHECK: add_i s4, s5, s6 0x09 0x01 0x55 0xc4 # CHECK: add_i v8, v9, s10 0x8d 0x3d 0x57 0xc8 # CHECK: add_i_mask v12, s15, v13, s14 0x11 0x02 0x59 0xd0 # CHECK: add_i v16, v17, v18 0x95 0x5e 0x5b 0xd4 # CHECK: add_i_mask v20, s23, v21, v22 -0x19 0x27 0xfe 0x05 # CHECK: add_i s24, s25, -119 -0x60 0x9f 0xfe 0x25 # CHECK: add_i v27, v0, -89 -0x43 0x10 0x2f 0x65 # CHECK: add_i_mask v2, s4, v3, 94 +0x19 0x47 0x01 0x05 # CHECK: add_i s24, s25, 81 +0x60 0x13 0x00 0x25 # CHECK: add_i v27, v0, 4 +0x43 0x90 0xd8 0x65 # CHECK: add_i_mask v2, s4, v3, -79 0xa6 0x80 0x63 0xc0 # CHECK: sub_i s5, s6, s7 0x2a 0x81 0x65 0xc4 # CHECK: sub_i v9, v10, s11 0xae 0xc1 0x67 0xc8 # CHECK: sub_i_mask v13, s16, v14, s15 0x32 0x82 0x69 0xd0 # CHECK: sub_i v17, v18, v19 0xb6 0xe2 0x6b 0xd4 # CHECK: sub_i_mask v21, s24, v22, v23 -0x3a 0x63 0x01 0x06 # CHECK: sub_i s25, s26, 88 -0x01 0xd0 0xfe 0x26 # CHECK: sub_i v0, v1, -76 -0x64 0x94 0x39 0x66 # CHECK: sub_i_mask v3, s5, v4, 115 +0x3a 0xbb 0x01 0x06 # CHECK: sub_i s25, s26, 110 +0x01 0x30 0xff 0x26 # CHECK: sub_i v0, v1, -52 +0x64 0x14 0x05 0x66 # CHECK: sub_i_mask v3, s5, v4, 10 0xc7 0x00 0x74 0xc0 # CHECK: mull_i s6, s7, s8 0x4b 0x01 0x76 0xc4 # CHECK: mull_i v10, v11, s12 0xcf 0x45 0x78 0xc8 # CHECK: mull_i_mask v14, s17, v15, s16 0x53 0x02 0x7a 0xd0 # CHECK: mull_i v18, v19, v20 0xd7 0x66 0x7c 0xd4 # CHECK: mull_i_mask v22, s25, v23, v24 -0x5b 0xdf 0xff 0x07 # CHECK: mull_i s26, s27, -9 -0x22 0x68 0x00 0x27 # CHECK: mull_i v1, v2, 26 -0x85 0x98 0x37 0x67 # CHECK: mull_i_mask v4, s6, v5, 111 +0x5b 0xaf 0x01 0x07 # CHECK: mull_i s26, s27, 107 +0x22 0x78 0xfe 0x27 # CHECK: mull_i v1, v2, -98 +0x85 0x98 0x10 0x67 # CHECK: mull_i_mask v4, s6, v5, 33 0xe8 0x80 0x84 0xc0 # CHECK: mulh_u s7, s8, s9 0x6c 0x81 0x86 0xc4 # CHECK: mulh_u v11, v12, s13 0xf0 0xc9 0x88 0xc8 # CHECK: mulh_u_mask v15, s18, v16, s17 0x74 0x82 0x8a 0xd0 # CHECK: mulh_u v19, v20, v21 0xf8 0xea 0x8c 0xd4 # CHECK: mulh_u_mask v23, s26, v24, v25 -0x60 0xdf 0xfe 0x08 # CHECK: mulh_u s27, s0, -73 -0x43 0x14 0xff 0x28 # CHECK: mulh_u v2, v3, -59 -0xa6 0x1c 0x3a 0x68 # CHECK: mulh_u_mask v5, s7, v6, 116 +0x60 0x67 0xfe 0x08 # CHECK: mulh_u s27, s0, -103 +0x43 0xb0 0x00 0x28 # CHECK: mulh_u v2, v3, 44 +0xa6 0x9c 0x27 0x68 # CHECK: mulh_u_mask v5, s7, v6, 79 0x09 0x01 0x95 0xc0 # CHECK: ashr s8, s9, s10 0x8d 0x01 0x97 0xc4 # CHECK: ashr v12, v13, s14 0x11 0x4e 0x99 0xc8 # CHECK: ashr_mask v16, s19, v17, s18 0x95 0x02 0x9b 0xd0 # CHECK: ashr v20, v21, v22 0x19 0x6f 0x9d 0xd4 # CHECK: ashr_mask v24, s27, v25, v26 -0x01 0xfc 0x00 0x09 # CHECK: ashr s0, s1, 63 -0x64 0x54 0x00 0x29 # CHECK: ashr v3, v4, 21 -0xc7 0x20 0xf6 0x69 # CHECK: ashr_mask v6, s8, v7, -20 +0x01 0x8c 0x01 0x09 # CHECK: ashr s0, s1, 99 +0x64 0x90 0xfe 0x29 # CHECK: ashr v3, v4, -92 +0xc7 0x20 0x1c 0x69 # CHECK: ashr_mask v6, s8, v7, 56 0x2a 0x81 0xa5 0xc0 # CHECK: shr s9, s10, s11 0xae 0x81 0xa7 0xc4 # CHECK: shr v13, v14, s15 0x32 0xd2 0xa9 0xc8 # CHECK: shr_mask v17, s20, v18, s19 0xb6 0x82 0xab 0xd0 # CHECK: shr v21, v22, v23 0x3a 0x83 0xad 0xd4 # CHECK: shr_mask v25, s0, v26, v27 -0x22 0x10 0x00 0x0a # CHECK: shr s1, s2, 4 -0x85 0xd4 0xfe 0x2a # CHECK: shr v4, v5, -75 -0xe8 0xa4 0x2a 0x6a # CHECK: shr_mask v7, s9, v8, 85 +0x22 0x74 0x01 0x0a # CHECK: shr s1, s2, 93 +0x85 0x28 0xfe 0x2a # CHECK: shr v4, v5, -118 +0xe8 0xa4 0xdc 0x6a # CHECK: shr_mask v7, s9, v8, -71 0x4b 0x01 0xb6 0xc0 # CHECK: shl s10, s11, s12 0xcf 0x01 0xb8 0xc4 # CHECK: shl v14, v15, s16 0x53 0x56 0xba 0xc8 # CHECK: shl_mask v18, s21, v19, s20 0xd7 0x02 0xbc 0xd0 # CHECK: shl v22, v23, v24 0x5b 0x07 0xb0 0xd4 # CHECK: shl_mask v26, s1, v27, v0 -0x43 0x94 0xff 0x0b # CHECK: shl s2, s3, -27 -0xa6 0xd4 0xfe 0x2b # CHECK: shl v5, v6, -75 -0x09 0x29 0x1d 0x6b # CHECK: shl_mask v8, s10, v9, 58 +0x43 0xc0 0xfe 0x0b # CHECK: shl s2, s3, -80 +0xa6 0xa8 0xff 0x2b # CHECK: shl v5, v6, -22 +0x09 0x29 0xfe 0x6b # CHECK: shl_mask v8, s10, v9, -4 0x6c 0x81 0x06 0xc2 # CHECK: add_f s11, s12, s13 0xf0 0x81 0x08 0xc6 # CHECK: add_f v15, v16, s17 0x74 0xda 0x0a 0xca # CHECK: add_f_mask v19, s22, v20, s21 @@ -100,9 +100,9 @@ 0xf8 0xea 0xfc 0xc9 # CHECK: mulh_i_mask v23, s26, v24, s25 0x60 0x83 0xf0 0xd1 # CHECK: mulh_i v27, v0, v1 0x64 0x98 0xf2 0xd5 # CHECK: mulh_i_mask v3, s6, v4, v5 -0xe8 0x5c 0xff 0x1f # CHECK: mulh_i s7, s8, -41 -0x4b 0xc5 0x00 0x3f # CHECK: mulh_i v10, v11, 49 -0xae 0x3d 0x1b 0x7f # CHECK: mulh_i_mask v13, s15, v14, 54 +0xe8 0x70 0x00 0x1f # CHECK: mulh_i s7, s8, 28 +0x4b 0xa9 0x00 0x3f # CHECK: mulh_i v10, v11, 42 +0xae 0xbd 0xfb 0x7f # CHECK: mulh_i_mask v13, s15, v14, -9 0x59 0x84 0xb5 0x4f # CHECK: movehi s2, 371769 0x20 0x00 0xc1 0xc0 # CHECK: clz s1, s2 0x20 0x00 0xc1 0xc4 # CHECK: clz v1, s2 @@ -154,53 +154,53 @@ 0x22 0x80 0x01 0xc1 # CHECK: cmpeq_i s1, s2, s3 0x22 0x80 0x01 0xc5 # CHECK: cmpeq_i s1, v2, s3 0x22 0x80 0x01 0xd1 # CHECK: cmpeq_i s1, v2, v3 -0x22 0xe0 0x00 0x10 # CHECK: cmpeq_i s1, s2, 56 -0x22 0xe0 0x00 0x30 # CHECK: cmpeq_i s1, v2, 56 +0x22 0x90 0x03 0x10 # CHECK: cmpeq_i s1, s2, 228 +0x22 0x90 0x03 0x30 # CHECK: cmpeq_i s1, v2, 228 0x85 0x00 0x13 0xc1 # CHECK: cmpne_i s4, s5, s6 0x85 0x00 0x13 0xc5 # CHECK: cmpne_i s4, v5, s6 0x85 0x00 0x13 0xd1 # CHECK: cmpne_i s4, v5, v6 -0x85 0x50 0x00 0x11 # CHECK: cmpne_i s4, s5, 20 -0x85 0x50 0x00 0x31 # CHECK: cmpne_i s4, v5, 20 +0x85 0xe8 0x01 0x11 # CHECK: cmpne_i s4, s5, 122 +0x85 0xe8 0x01 0x31 # CHECK: cmpne_i s4, v5, 122 0xe8 0x80 0x24 0xc1 # CHECK: cmpgt_i s7, s8, s9 0xe8 0x80 0x24 0xc5 # CHECK: cmpgt_i s7, v8, s9 0xe8 0x80 0x24 0xd1 # CHECK: cmpgt_i s7, v8, v9 -0xe8 0xb4 0x03 0x12 # CHECK: cmpgt_i s7, s8, 237 -0xe8 0xb4 0x03 0x32 # CHECK: cmpgt_i s7, v8, 237 +0xe8 0x1c 0x03 0x12 # CHECK: cmpgt_i s7, s8, 199 +0xe8 0x1c 0x03 0x32 # CHECK: cmpgt_i s7, v8, 199 0x4b 0x01 0x36 0xc1 # CHECK: cmpge_i s10, s11, s12 0x4b 0x01 0x36 0xc5 # CHECK: cmpge_i s10, v11, s12 0x4b 0x01 0x36 0xd1 # CHECK: cmpge_i s10, v11, v12 -0x4b 0xb5 0x01 0x13 # CHECK: cmpge_i s10, s11, 109 -0x4b 0xb5 0x01 0x33 # CHECK: cmpge_i s10, v11, 109 +0x4b 0xf1 0x03 0x13 # CHECK: cmpge_i s10, s11, 252 +0x4b 0xf1 0x03 0x33 # CHECK: cmpge_i s10, v11, 252 0xae 0x81 0x47 0xc1 # CHECK: cmplt_i s13, s14, s15 0xae 0x81 0x47 0xc5 # CHECK: cmplt_i s13, v14, s15 0xae 0x81 0x47 0xd1 # CHECK: cmplt_i s13, v14, v15 -0xae 0x25 0x02 0x14 # CHECK: cmplt_i s13, s14, 137 -0xae 0x25 0x02 0x34 # CHECK: cmplt_i s13, v14, 137 +0xae 0x49 0x01 0x14 # CHECK: cmplt_i s13, s14, 82 +0xae 0x49 0x01 0x34 # CHECK: cmplt_i s13, v14, 82 0x11 0x02 0x59 0xc1 # CHECK: cmple_i s16, s17, s18 0x11 0x02 0x59 0xc5 # CHECK: cmple_i s16, v17, s18 0x11 0x02 0x59 0xd1 # CHECK: cmple_i s16, v17, v18 -0x11 0xde 0x03 0x15 # CHECK: cmple_i s16, s17, 247 -0x11 0xde 0x03 0x35 # CHECK: cmple_i s16, v17, 247 +0x11 0xe2 0x01 0x15 # CHECK: cmple_i s16, s17, 120 +0x11 0xe2 0x01 0x35 # CHECK: cmple_i s16, v17, 120 0x74 0x82 0x6a 0xc1 # CHECK: cmpgt_u s19, s20, s21 0x74 0x82 0x6a 0xc5 # CHECK: cmpgt_u s19, v20, s21 0x74 0x82 0x6a 0xd1 # CHECK: cmpgt_u s19, v20, v21 -0x74 0x96 0x01 0x16 # CHECK: cmpgt_u s19, s20, 101 -0x74 0x96 0x01 0x36 # CHECK: cmpgt_u s19, v20, 101 +0x74 0x8e 0x01 0x16 # CHECK: cmpgt_u s19, s20, 99 +0x74 0x8e 0x01 0x36 # CHECK: cmpgt_u s19, v20, 99 0xd7 0x02 0x7c 0xc1 # CHECK: cmpge_u s22, s23, s24 0xd7 0x02 0x7c 0xc5 # CHECK: cmpge_u s22, v23, s24 0xd7 0x02 0x7c 0xd1 # CHECK: cmpge_u s22, v23, v24 -0xd7 0x62 0x02 0x17 # CHECK: cmpge_u s22, s23, 152 -0xd7 0x62 0x02 0x37 # CHECK: cmpge_u s22, v23, 152 +0xd7 0xf2 0x02 0x17 # CHECK: cmpge_u s22, s23, 188 +0xd7 0xf2 0x02 0x37 # CHECK: cmpge_u s22, v23, 188 0x3a 0x83 0x8d 0xc1 # CHECK: cmplt_u s25, s26, s27 0x3a 0x83 0x8d 0xc5 # CHECK: cmplt_u s25, v26, s27 0x3a 0x83 0x8d 0xd1 # CHECK: cmplt_u s25, v26, v27 -0x3a 0x87 0x01 0x18 # CHECK: cmplt_u s25, s26, 97 -0x3a 0x87 0x01 0x38 # CHECK: cmplt_u s25, v26, 97 +0x3a 0xa3 0x03 0x18 # CHECK: cmplt_u s25, s26, 232 +0x3a 0xa3 0x03 0x38 # CHECK: cmplt_u s25, v26, 232 0x01 0x00 0x91 0xc1 # CHECK: cmple_u s0, s1, s2 0x01 0x00 0x91 0xc5 # CHECK: cmple_u s0, v1, s2 0x01 0x00 0x91 0xd1 # CHECK: cmple_u s0, v1, v2 -0x01 0x84 0x00 0x19 # CHECK: cmple_u s0, s1, 33 -0x01 0x84 0x00 0x39 # CHECK: cmple_u s0, v1, 33 +0x01 0x54 0x02 0x19 # CHECK: cmple_u s0, s1, 149 +0x01 0x54 0x02 0x39 # CHECK: cmple_u s0, v1, 149 0x64 0x80 0xc2 0xc2 # CHECK: cmpgt_f s3, s4, s5 0x64 0x80 0xc2 0xc6 # CHECK: cmpgt_f s3, v4, s5 0x64 0x80 0xc2 0xd2 # CHECK: cmpgt_f s3, v4, v5 @@ -233,20 +233,20 @@ 0x3a 0x6f 0x00 0x88 # CHECK: store_32 s25, 27(s26) 0x01 0x00 0x00 0x8a # CHECK: store_sync s0, (s1) 0x01 0x08 0x00 0x8a # CHECK: store_sync s0, 2(s1) -0x22 0xa0 0x06 0xae # CHECK: load_v v1, 424(s2) -0x22 0x0c 0xd4 0xb0 # CHECK: load_v_mask v1, s3, 424(s2) +0x22 0x40 0x06 0xae # CHECK: load_v v1, 400(s2) +0x22 0x0c 0xc8 0xb0 # CHECK: load_v_mask v1, s3, 400(s2) 0x22 0x00 0x00 0xae # CHECK: load_v v1, (s2) 0x22 0x0c 0x00 0xb0 # CHECK: load_v_mask v1, s3, (s2) -0x22 0xa0 0x06 0x8e # CHECK: store_v v1, 424(s2) -0x22 0x0c 0xd4 0x90 # CHECK: store_v_mask v1, s3, 424(s2) +0x22 0x40 0x06 0x8e # CHECK: store_v v1, 400(s2) +0x22 0x0c 0xc8 0x90 # CHECK: store_v_mask v1, s3, 400(s2) 0x22 0x00 0x00 0x8e # CHECK: store_v v1, (s2) 0x22 0x0c 0x00 0x90 # CHECK: store_v_mask v1, s3, (s2) -0x85 0xe0 0x04 0xba # CHECK: load_gath v4, 312(v5) -0x85 0x18 0x9c 0xbc # CHECK: load_gath_mask v4, s6, 312(v5) +0x85 0xe0 0x01 0xba # CHECK: load_gath v4, 120(v5) +0x85 0x18 0x3c 0xbc # CHECK: load_gath_mask v4, s6, 120(v5) 0x85 0x00 0x00 0xba # CHECK: load_gath v4, (v5) 0x85 0x18 0x00 0xbc # CHECK: load_gath_mask v4, s6, (v5) -0x85 0xe0 0x04 0x9a # CHECK: store_scat v4, 312(v5) -0x85 0x18 0x9c 0x9c # CHECK: store_scat_mask v4, s6, 312(v5) +0x85 0xe0 0x01 0x9a # CHECK: store_scat v4, 120(v5) +0x85 0x18 0x3c 0x9c # CHECK: store_scat_mask v4, s6, 120(v5) 0x85 0x00 0x00 0x9a # CHECK: store_scat v4, (v5) 0x85 0x18 0x00 0x9c # CHECK: store_scat_mask v4, s6, (v5) 0xe9 0x00 0x00 0xac # CHECK: getcr s7, 9 @@ -260,4 +260,6 @@ 0x41 0x00 0x00 0xe0 # CHECK: dtlbinsert s1, s2 0x83 0x00 0x00 0xee # CHECK: itlbinsert s3, s4 0x00 0x00 0xe0 0xc3 # CHECK: break -0x00 0x00 0xf0 0xc3 # CHECK: syscall +0x00 0x00 0x00 0x02 # CHECK: syscall 0 +0x00 0x44 0x00 0x02 # CHECK: syscall 17 +0x00 0x34 0x10 0x02 # CHECK: syscall 1037 diff --git a/test/MC/Nyuzi/make_tests.py b/test/MC/Nyuzi/make_tests.py index 18f880d5c7..a625e87326 100755 --- a/test/MC/Nyuzi/make_tests.py +++ b/test/MC/Nyuzi/make_tests.py @@ -379,7 +379,9 @@ def getnextreg(): # Special instructions write_test_case('break', 0xc3e00000) -write_test_case('syscall', 0xc3f00000) +write_test_case('syscall 0', encode_i_instruction(0, 2, 0, 0, 0)) +write_test_case('syscall 17', encode_i_instruction(0, 2, 0, 0, 17)) +write_test_case('syscall 1037', encode_i_instruction(0, 2, 0, 0, 1037)) # Cleanup disasm_fp.close()