File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -108,6 +108,14 @@ bool RISCVTargetInfo::validateAsmConstraint(
108
108
return true ;
109
109
}
110
110
return false ;
111
+ case ' P' :
112
+ // An even-odd register pair - GPR
113
+ if (Name[1 ] == ' r' ) {
114
+ Info.setAllowsRegister ();
115
+ Name += 1 ;
116
+ return true ;
117
+ }
118
+ return false ;
111
119
case ' v' :
112
120
// A vector register.
113
121
if (Name[1 ] == ' r' || Name[1 ] == ' d' || Name[1 ] == ' m' ) {
@@ -122,8 +130,9 @@ bool RISCVTargetInfo::validateAsmConstraint(
122
130
std::string RISCVTargetInfo::convertConstraint (const char *&Constraint) const {
123
131
std::string R;
124
132
switch (*Constraint) {
125
- // c* and v* are two-letter constraints on RISC-V.
133
+ // c*, P*, and v* are all two-letter constraints on RISC-V.
126
134
case ' c' :
135
+ case ' P' :
127
136
case ' v' :
128
137
R = std::string (" ^" ) + std::string (Constraint, 2 );
129
138
Constraint += 1 ;
Original file line number Diff line number Diff line change @@ -33,6 +33,19 @@ void test_cf(float f, double d) {
33
33
asm volatile ("" : "=cf" (cd ) : "cf" (d ));
34
34
}
35
35
36
+ #if __riscv_xlen == 32
37
+ typedef long long double_xlen_t ;
38
+ #elif __riscv_xlen == 64
39
+ typedef __int128_t double_xlen_t ;
40
+ #endif
41
+ double_xlen_t test_Pr_wide_scalar (double_xlen_t p ) {
42
+ // CHECK-LABEL: define{{.*}} {{i128|i64}} @test_Pr_wide_scalar(
43
+ // CHECK: call {{i128|i64}} asm sideeffect "", "=^Pr,^Pr"({{i128|i64}} %{{.*}})
44
+ double_xlen_t ret ;
45
+ asm volatile ("" : "=Pr" (ret ) : "Pr" (p ));
46
+ return ret ;
47
+ }
48
+
36
49
void test_I (void ) {
37
50
// CHECK-LABEL: define{{.*}} void @test_I()
38
51
// CHECK: call void asm sideeffect "", "I"(i32 2047)
You can’t perform that action at this time.
0 commit comments