1- use super :: { InlineAsmArch , InlineAsmType , Target } ;
2- use rustc_data_structures:: stable_set:: FxHashSet ;
1+ use super :: { InlineAsmArch , InlineAsmType } ;
32use rustc_macros:: HashStable_Generic ;
4- use rustc_span:: { sym , Symbol } ;
3+ use rustc_span:: Symbol ;
54use std:: fmt;
65
76def_reg_class ! {
@@ -43,19 +42,6 @@ impl BpfInlineAsmRegClass {
4342 }
4443}
4544
46- fn only_alu32 (
47- _arch : InlineAsmArch ,
48- target_features : & FxHashSet < Symbol > ,
49- _target : & Target ,
50- _is_clobber : bool ,
51- ) -> Result < ( ) , & ' static str > {
52- if !target_features. contains ( & sym:: alu32) {
53- Err ( "register can't be used without the `alu32` target feature" )
54- } else {
55- Ok ( ( ) )
56- }
57- }
58-
5945def_regs ! {
6046 Bpf BpfInlineAsmReg BpfInlineAsmRegClass {
6147 r0: reg = [ "r0" ] ,
@@ -68,16 +54,16 @@ def_regs! {
6854 r7: reg = [ "r7" ] ,
6955 r8: reg = [ "r8" ] ,
7056 r9: reg = [ "r9" ] ,
71- w0: wreg = [ "w0" ] % only_alu32 ,
72- w1: wreg = [ "w1" ] % only_alu32 ,
73- w2: wreg = [ "w2" ] % only_alu32 ,
74- w3: wreg = [ "w3" ] % only_alu32 ,
75- w4: wreg = [ "w4" ] % only_alu32 ,
76- w5: wreg = [ "w5" ] % only_alu32 ,
77- w6: wreg = [ "w6" ] % only_alu32 ,
78- w7: wreg = [ "w7" ] % only_alu32 ,
79- w8: wreg = [ "w8" ] % only_alu32 ,
80- w9: wreg = [ "w9" ] % only_alu32 ,
57+ w0: wreg = [ "w0" ] ,
58+ w1: wreg = [ "w1" ] ,
59+ w2: wreg = [ "w2" ] ,
60+ w3: wreg = [ "w3" ] ,
61+ w4: wreg = [ "w4" ] ,
62+ w5: wreg = [ "w5" ] ,
63+ w6: wreg = [ "w6" ] ,
64+ w7: wreg = [ "w7" ] ,
65+ w8: wreg = [ "w8" ] ,
66+ w9: wreg = [ "w9" ] ,
8167
8268 #error = [ "r10" , "w10" ] =>
8369 "the stack pointer cannot be used as an operand for inline asm" ,
0 commit comments