From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jerry Quinn" To: binutils@sourceware.cygnus.com Subject: Patch: add pa2.0 64 bit condition completers (2nd try) Date: Thu, 29 Jul 1999 07:33:00 -0000 Message-id: <863.933258830.0@NO-ID-FOUND.mhonarc.org> X-SW-Source: 1999-07/msg00032.html There was an undefined variable that shouldn't have been there. Here is the patch again without it. Wed Jul 28 15:11:09 EDT 1999 Jerry Quinn * gas/config/tc-hppa.c (pa_ip): Add 64 bit condition completers. * include/opcode/hppa.h: Document 64 bit condition completers. * opcodes/hppa-dis.c (compare_cond_64_names, cmpib_cond_64_names, add_cond_64_names, wide_add_cond_names, logical_cond_64_names, unit_cond_64_names, shift_cond_64_names, bb_cond_64_names): New. (print_insn_hppa): Add 64 bit condition completers. *** pa-prev/gas/config/tc-hppa.c Wed Jul 28 13:21:12 1999 --- gas-src/gas/config/tc-hppa.c Wed Jul 28 14:17:16 1999 *************** *** 1726,1731 **** --- 1726,1732 ---- INSERT_FIELD_AND_CONTINUE (opcode, cond, 0); /* Handle an add condition. */ + case 'A': case 'a': cmpltr = 0; flag = 0; *************** *** 1733,1738 **** --- 1734,1746 ---- { s++; name = s; + + /* 64 bit conditions. */ + if (*args == 'A' && *s == '*') + s++; + else + break; + while (*s != ',' && *s != ' ' && *s != '\t') s += 1; c = *s; *************** *** 1791,1797 **** cmpltr = 7; flag = 1; } ! else as_bad (_("Invalid Add Condition: %s"), name); *s = c; } --- 1799,1806 ---- cmpltr = 7; flag = 1; } ! /* ",*" is a valid condition. */ ! else if (*args == 'a') as_bad (_("Invalid Add Condition: %s"), name); *s = c; } *************** *** 1808,1813 **** --- 1817,1834 ---- } INSERT_FIELD_AND_CONTINUE (opcode, cmpltr, 13); + /* Handle negated add and branch condition. */ + case 'D': + abort (); + + /* Handle wide-mode non-negated add and branch condition. */ + case 'w': + abort (); + + /* Handle wide-mode negated add and branch condition. */ + case 'W': + abort(); + /* Handle a negated or non-negated add and branch condition. */ case '@': *************** *** 1831,1841 **** --- 1852,1869 ---- INSERT_FIELD_AND_CONTINUE (opcode, cmpltr, 13); /* Handle branch on bit conditions. */ + case 'B': case 'b': cmpltr = 0; if (*s == ',') { s++; + + if (*args == 'B' && *s == '*') + s++; + else + break; + if (strncmp (s, "<", 1) == 0) { cmpltr = 0; *************** *** 1852,1864 **** --- 1880,1901 ---- INSERT_FIELD_AND_CONTINUE (opcode, cmpltr, 15); /* Handle a compare/subtract condition. */ + case 'S': case 's': cmpltr = 0; flag = 0; if (*s == ',') { s++; name = s; + + /* 64 bit conditions. */ + if (*args == 'S' && *s == '*') + s++; + else + break; + while (*s != ',' && *s != ' ' && *s != '\t') s += 1; c = *s; *************** *** 1917,1923 **** cmpltr = 7; flag = 1; } ! else as_bad (_("Invalid Compare/Subtract Condition: %s"), name); *s = c; --- 1954,1961 ---- cmpltr = 7; flag = 1; } ! /* ",*" is a valid condition. */ ! else if (*args != 'S') as_bad (_("Invalid Compare/Subtract Condition: %s"), name); *s = c; *************** *** 1934,1939 **** --- 1972,1993 ---- cmpltr = 0; } INSERT_FIELD_AND_CONTINUE (opcode, cmpltr, 13); + + /* Handle a negated compare condition. */ + case 'T': + abort (); + + /* Handle a 64 bit non-negated compare condition. */ + case 'r': + abort (); + + /* Handle a 64 bit negated compare condition. */ + case 'R': + abort (); + + /* Handle a 64 bit cmpib condition. */ + case 'Q': + abort (); /* Handle a negated or non-negated compare/subtract condition. */ *************** *** 1959,1964 **** --- 2013,2019 ---- INSERT_FIELD_AND_CONTINUE (opcode, cmpltr, 13); /* Handle a logical instruction condition. */ + case 'L': case 'l': cmpltr = 0; flag = 0; *************** *** 1966,1971 **** --- 2021,2033 ---- { s++; name = s; + + /* 64 bit conditions. */ + if (*args == 'L' && *s == '*') + s++; + else + break; + while (*s != ',' && *s != ' ' && *s != '\t') s += 1; c = *s; *************** *** 2005,2011 **** cmpltr = 7; flag = 1; } ! else as_bad (_("Invalid Logical Instruction Condition.")); *s = c; } --- 2067,2074 ---- cmpltr = 7; flag = 1; } ! /* ",*" is a valid condition. */ ! else if (*args != 'L') as_bad (_("Invalid Logical Instruction Condition.")); *s = c; } *************** *** 2013,2018 **** --- 2076,2082 ---- INSERT_FIELD_AND_CONTINUE (opcode, flag, 12); /* Handle a shift/extract/deposit condition. */ + case 'X': case 'x': case 'y': cmpltr = 0; *************** *** 2021,2026 **** --- 2085,2097 ---- save_s = s++; name = s; + + /* 64 bit conditions. */ + if (*args == 'X' && *s == '*') + s++; + else + break; + while (*s != ',' && *s != ' ' && *s != '\t') s += 1; c = *s; *************** *** 2047,2066 **** s = save_s; continue; } ! else as_bad (_("Invalid Shift/Extract/Deposit Condition.")); *s = c; } INSERT_FIELD_AND_CONTINUE (opcode, cmpltr, 13); /* Handle a unit instruction condition. */ ! case 'u': /* unit */ cmpltr = 0; flag = 0; if (*s == ',') { s++; if (strncasecmp (s, "sbz", 3) == 0) { cmpltr = 2; --- 2118,2145 ---- s = save_s; continue; } ! /* ",*" is a valid condition. */ ! else if (*args != 'X') as_bad (_("Invalid Shift/Extract/Deposit Condition.")); *s = c; } INSERT_FIELD_AND_CONTINUE (opcode, cmpltr, 13); /* Handle a unit instruction condition. */ ! case 'U': ! case 'u': cmpltr = 0; flag = 0; if (*s == ',') { s++; + /* 64 bit conditions. */ + if (*args == 'U' && *s == '*') + s++; + else + break; + if (strncasecmp (s, "sbz", 3) == 0) { cmpltr = 2; *************** *** 2122,2128 **** flag = 1; s += 3; } ! else as_bad (_("Invalid Unit Instruction Condition.")); } opcode |= cmpltr << 13; --- 2201,2208 ---- flag = 1; s += 3; } ! /* ",*" is a valid condition. */ ! else if (*args != 'U') as_bad (_("Invalid Unit Instruction Condition.")); } opcode |= cmpltr << 13; *** pa-prev/include/opcode/hppa.h Wed Jul 28 13:21:07 1999 --- gas-src/include/opcode/hppa.h Wed Jul 28 15:10:40 1999 *************** *** 106,126 **** ?f Floating point compare conditions (encoded as 5 bits at 31) ?a add conditions ! ?d non-negated add branch conditions ?@ add branch conditions followed by nullify ?s compare/subtract conditions ?t non-negated compare conditions ?n compare conditions followed by nullify ?l logical conditions ?b branch on bit conditions ?x shift/extract/deposit conditions ?y shift/extract/deposit conditions followed by nullify for conditional branches ?u unit conditions Also these: --- 106,140 ---- ?f Floating point compare conditions (encoded as 5 bits at 31) ?a add conditions ! ?A 64 bit add conditions ?@ add branch conditions followed by nullify + ?d non-negated add branch conditions + ?D negated add branch conditions + ?w wide mode non-negated add branch conditions + ?W wide mode negated add branch conditions ?s compare/subtract conditions + ?S 64 bit compare/subtract conditions ?t non-negated compare conditions + ?T negated compare conditions + ?r 64 bit non-negated compare conditions + ?R 64 bit negated compare conditions + ?Q 64 bit compare conditions for CMPIB instruction ?n compare conditions followed by nullify ?l logical conditions + ?L 64 bit logical conditions + ?b branch on bit conditions + ?B 64 bit branch on bit conditions ?x shift/extract/deposit conditions + ?X 64 bit shift/extract/deposit conditions ?y shift/extract/deposit conditions followed by nullify for conditional branches ?u unit conditions + ?U 64 bit unit conditions Also these: *************** *** 173,179 **** 8 5 bit register field at 20 (used in 'fmpyadd' and 'fmpysub') 9 5 bit register field at 25 (used in 'fmpyadd' and 'fmpysub') H Floating Point Operand Format at 26 for 'fmpyadd' and 'fmpysub' ! (very similar to 'F') */ /* List of characters not to put a space after. Note that --- 187,194 ---- 8 5 bit register field at 20 (used in 'fmpyadd' and 'fmpysub') 9 5 bit register field at 25 (used in 'fmpyadd' and 'fmpysub') H Floating Point Operand Format at 26 for 'fmpyadd' and 'fmpysub' ! (very similar to 'F') ! */ /* List of characters not to put a space after. Note that *** pa-prev/opcodes/hppa-dis.c Wed Jul 28 13:21:26 1999 --- gas-src/opcodes/hppa-dis.c Wed Jul 28 14:53:04 1999 *************** *** 67,91 **** }; static const char compare_cond_names[][5] = { ! "", ",=", ",<", ",<=", ",<<", ",<<=", ",sv", ! ",od", ",tr", ",<>", ",>=", ",>", ",>>=", ! ",>>", ",nsv", ",ev" }; static const char add_cond_names[][5] = { ! "", ",=", ",<", ",<=", ",nuv", ",znv", ",sv", ! ",od", ",tr", ",<>", ",>=", ",>", ",uv", ! ",vnz", ",nsv", ",ev" }; static const char *const logical_cond_names[] = { "", ",=", ",<", ",<=", 0, 0, 0, ",od", ",tr", ",<>", ",>=", ",>", 0, 0, 0, ",ev"}; static const char *const unit_cond_names[] = { "", 0, ",sbz", ",shz", ",sdc", 0, ",sbc", ",shc", ",tr", 0, ",nbz", ",nhz", ",ndc", 0, ",nbc", ",nhc" }; static const char shift_cond_names[][4] = { "", ",=", ",<", ",od", ",tr", ",<>", ",>=", ",ev" }; static const char index_compl_names[][4] = {"", ",m", ",s", ",sm"}; static const char short_ldst_compl_names[][4] = {"", ",ma", "", ",mb"}; static const char *const short_bytes_compl_names[] = { --- 67,117 ---- }; static const char compare_cond_names[][5] = { ! "", ",=", ",<", ",<=", ",<<", ",<<=", ",sv", ",od", ! ",tr", ",<>", ",>=", ",>", ",>>=", ",>>", ",nsv", ",ev" ! }; ! static const char compare_cond_64_names[][6] = { ! ",*", ",*=", ",*<", ",*<=", ",*<<", ",*<<=", ",*sv", ",*od", ! ",*tr", ",*<>", ",*>=", ",*>", ",*>>=", ",*>>", ",*nsv", ",*ev" ! }; ! static const char cmpib_cond_64_names[][6] = { ! ",*<<", ",*=", ",*<", ",*<=", ",*>>=", ",*<>", ",*>=", ",*>" }; static const char add_cond_names[][5] = { ! "", ",=", ",<", ",<=", ",nuv", ",znv", ",sv", ",od", ! ",tr", ",<>", ",>=", ",>", ",uv", ",vnz", ",nsv", ",ev" ! }; ! static const char add_cond_64_names[][6] = { ! ",*", ",*=", ",*<", ",*<=", ",*nuv", ",*znv", ",*sv", ",*od", ! ",*tr", ",*<>", ",*>=", ",*>", ",*uv", ",*vnz", ",*nsv", ",*ev" ! }; ! static const char wide_add_cond_names[][5] = { ! "", ",=", ",<", ",<=", ",nuv", ",*=", ",*<", ",*<=", ! ",tr", ",<>", ",>=", ",>", ",uv", ",*<>", ",*>=", ",*>" }; static const char *const logical_cond_names[] = { "", ",=", ",<", ",<=", 0, 0, 0, ",od", ",tr", ",<>", ",>=", ",>", 0, 0, 0, ",ev"}; + static const char *const logical_cond_64_names[] = { + ",*", ",*=", ",*<", ",*<=", 0, 0, 0, ",*od", + ",*tr", ",*<>", ",*>=", ",*>", 0, 0, 0, ",*ev"}; static const char *const unit_cond_names[] = { "", 0, ",sbz", ",shz", ",sdc", 0, ",sbc", ",shc", ",tr", 0, ",nbz", ",nhz", ",ndc", 0, ",nbc", ",nhc" }; + static const char *const unit_cond_64_names[] = { + ",*", ",*swz", ",*sbz", ",*shz", ",*sdc", ",*swc", ",*sbc", ",*shc", + ",*tr", ",*nwz", ",*nbz", ",*nhz", ",*ndc", ",*nwc", ",*nbc", ",*nhc" + }; static const char shift_cond_names[][4] = { "", ",=", ",<", ",od", ",tr", ",<>", ",>=", ",ev" }; + static const char shift_cond_64_names[][5] = { + ",*", ",*=", ",*<", ",*od", ",*tr", ",*<>", ",*>=", ",*ev" + }; + static const char bb_cond_64_names[][5] = { + ",*<", ",*>=" + }; static const char index_compl_names[][4] = {"", ",m", ",s", ",sm"}; static const char short_ldst_compl_names[][4] = {"", ",ma", "", ",mb"}; static const char *const short_bytes_compl_names[] = { *************** *** 427,432 **** --- 453,474 ---- fputs_filtered (compare_cond_names[GET_FIELD (insn, 16, 18)], info); break; + case 'T': + fputs_filtered (compare_cond_names[GET_FIELD (insn, 16, 18) + + 8], info); + break; + case 'r': + fputs_filtered (compare_cond_64_names[GET_FIELD (insn, 16, 18)], + info); + break; + case 'R': + fputs_filtered (compare_cond_64_names[GET_FIELD (insn, 16, 18) + + 8], info); + break; + case 'Q': + fputs_filtered (cmpib_cond_64_names[GET_FIELD (insn, 16, 18)], + info); + break; case 'n': fputs_filtered (compare_cond_names[GET_FIELD (insn, 16, 18) + GET_FIELD (insn, 4, 4) * 8], info); *************** *** 439,461 **** --- 481,536 ---- (*info->fprintf_func) (info->stream, "%s ", compare_cond_names[GET_COND (insn)]); break; + case 'S': + (*info->fprintf_func) (info->stream, "%s ", + compare_cond_64_names[GET_COND (insn)]); + break; case 'a': (*info->fprintf_func) (info->stream, "%s ", add_cond_names[GET_COND (insn)]); break; + case 'A': + (*info->fprintf_func) (info->stream, "%s ", + add_cond_64_names[GET_COND (insn)]); + break; case 'd': (*info->fprintf_func) (info->stream, "%s", add_cond_names[GET_FIELD (insn, 16, 18)]); break; + case 'D': + (*info->fprintf_func) (info->stream, "%s", + add_cond_names[GET_FIELD (insn, 16, 18) + + 8]); + break; + case 'w': + (*info->fprintf_func) + (info->stream, "%s", + wide_add_cond_names[GET_FIELD (insn, 16, 18)]); + break; + + case 'W': + (*info->fprintf_func) + (info->stream, "%s", + wide_add_cond_names[GET_FIELD (insn, 16, 18) + 8]); + break; + case 'l': (*info->fprintf_func) (info->stream, "%s ", logical_cond_names[GET_COND (insn)]); break; + case 'L': + (*info->fprintf_func) (info->stream, "%s ", + logical_cond_64_names[GET_COND (insn)]); + break; case 'u': (*info->fprintf_func) (info->stream, "%s ", unit_cond_names[GET_COND (insn)]); break; + case 'U': + (*info->fprintf_func) (info->stream, "%s ", + unit_cond_64_names[GET_COND (insn)]); + break; case 'y': case 'x': case 'b': *************** *** 468,474 **** --- 543,562 ---- if (s[1] != 'n') (*info->fprintf_func) (info->stream, " "); break; + case 'X': + (*info->fprintf_func) (info->stream, "%s", + shift_cond_64_names[GET_FIELD (insn, 16, 18)]); + break; + case 'B': + (*info->fprintf_func) + (info->stream, "%s", + bb_cond_64_names[GET_FIELD (insn, 16, 16)]); + /* If the next character in args is 'n', it will handle + putting out the space. */ + if (s[1] != 'n') + (*info->fprintf_func) (info->stream, " "); + break; } break; }