添加右移测试

This commit is contained in:
2025-04-17 23:48:13 +08:00
parent 29019b9b98
commit a096b91bc1

View File

@@ -71,6 +71,31 @@ void test6(int8_t a,int8_t b){
}
void test7(uint32_t a,int b){
my_printf("shift right %08x, %08x\n",a,a>>b);
}
void test8(int32_t a,int b){
my_printf("shift right %08x, %08x\n",a,a>>b);
}
void test9(uint16_t a,int b){
my_printf("shift right %08x, %08x\n",a,a>>b);
}
void test10(int16_t a,int b){
my_printf("shift right %08x, %08x\n",a,a>>b);
}
void test11(uint8_t a,int b){
my_printf("shift right %08x, %08x\n",a,a>>b);
}
void test12(int8_t a,int b){
my_printf("shift right %08x, %08x\n",a,a>>b);
}
void cpu_test() {
my_printf("test 32 bit\n");
@@ -90,7 +115,15 @@ void cpu_test() {
test5(1,-2);
test6(1,2);
test6(1,-2);
my_printf("shift test\n");
test7(0x80000000,7);
test8(0x80000000,7);
test9(0x8000,7);
test10(0x8000,7);
test11(0x80,7);
test12(0x80,7);
}