File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -629,3 +629,39 @@ func constantFold3(i, j int) int {
629
629
r := (5 * i ) * (6 * j )
630
630
return r
631
631
}
632
+
633
+ // ----------------- //
634
+ // Integer Min/Max //
635
+ // ----------------- //
636
+
637
+ func Int64Min (a , b int64 ) int64 {
638
+ // amd64: "CMPQ","CMOVQLT"
639
+ // arm64: "CMP","CSEL"
640
+ // riscv64/rva20u64:"BLT\t"
641
+ // riscv64/rva22u64:"MIN\t"
642
+ return min (a , b )
643
+ }
644
+
645
+ func Int64Max (a , b int64 ) int64 {
646
+ // amd64: "CMPQ","CMOVQGT"
647
+ // arm64: "CMP","CSEL"
648
+ // riscv64/rva20u64:"BLT\t"
649
+ // riscv64/rva22u64:"MAX\t"
650
+ return max (a , b )
651
+ }
652
+
653
+ func Uint64Min (a , b uint64 ) uint64 {
654
+ // amd64: "CMPQ","CMOVQCS"
655
+ // arm64: "CMP","CSEL"
656
+ // riscv64/rva20u64:"BLTU"
657
+ // riscv64/rva22u64:"MINU"
658
+ return min (a , b )
659
+ }
660
+
661
+ func Uint64Max (a , b uint64 ) uint64 {
662
+ // amd64: "CMPQ","CMOVQHI"
663
+ // arm64: "CMP","CSEL"
664
+ // riscv64/rva20u64:"BLTU"
665
+ // riscv64/rva22u64:"MAXU"
666
+ return max (a , b )
667
+ }
You can’t perform that action at this time.
0 commit comments