If there is a solution to this, gcc also does not recognize it:
unsigned long long int reg64 = random_value;
unsigned int n = shift_value;
reg64 = (reg64 >> (n%64)) | (reg64 << ((64-n)%64));
leads to the following:
n = 1:
MOVS R2, R0, LSR
MOV R3, R1, RRX
ORR R2, R2, R1, ASL
n = 2-31:
MOV R2, R0, LSR
ORR R2, R2, R1, ASL
MOV R3, R0, ASL
ORR R3, R3, R1, LSR
n = 33-62:
MOV R3, R0, ASL
ORR R3, R3, R1, LSR
MOV R2, R0, LSR,
ORR R2, R2, R1, ASL
n = 63:
ADDS R2, R0, R0
ADC R3, R1, R1
ORR R2, R2, R1, LSR #31