History

riscv: Add sar, shr insn

fixes 92_enum_bitfield.

Michael Matz committed 7 years ago

Commit 215bc1a1 parent f64d4601 file · +6 −2Browse files

Unified · Split

riscv64-gen.c+6−2
@@ -621,8 +621,6 @@ static void gen_opil(int op, int ll) · 620 unmodified lines
621 d = ireg(d);621 d = ireg(d);
622 switch (op) {622 switch (op) {
623 case '%':623 case '%':
624 case TOK_SAR:
625 case TOK_SHR:
626 case TOK_PDIV:624 case TOK_PDIV:
627 default:625 default:
628 tcc_error("implement me: %s(%s)", __FUNCTION__, get_tok_str(op, NULL));626 tcc_error("implement me: %s(%s)", __FUNCTION__, get_tok_str(op, NULL));
@@ -633,6 +631,12 @@ static void gen_opil(int op, int ll) · 4 unmodified lines
633 case '-':631 case '-':
634 o(0x33 | (d << 7) | (a << 15) | (b << 20) | (0x20 << 25)); //sub d, a, b632 o(0x33 | (d << 7) | (a << 15) | (b << 20) | (0x20 << 25)); //sub d, a, b
635 break;633 break;
634 case TOK_SAR:
635 o(0x33 | (d << 7) | (a << 15) | (b << 20) | (5 << 12) | (1 << 30)); //sra d, a, b
636 break;
637 case TOK_SHR:
638 o(0x33 | (d << 7) | (a << 15) | (b << 20) | (5 << 12)); //srl d, a, b
639 break;
636 case TOK_SHL:640 case TOK_SHL:
637 o(0x33 | (d << 7) | (a << 15) | (b << 20) | (1 << 12)); //sll d, a, b641 o(0x33 | (d << 7) | (a << 15) | (b << 20) | (1 << 12)); //sll d, a, b
638 break;642 break;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t