]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/internal/obj/riscv: add FCLASSS/FCLASSD instructions
authorJoel Sing <joel@sing.id.au>
Thu, 20 Feb 2020 16:03:57 +0000 (03:03 +1100)
committerJoel Sing <joel@sing.id.au>
Sun, 15 Mar 2020 08:13:55 +0000 (08:13 +0000)
Add support for floating-point classification instructions.

Change-Id: I64463d477b3db0cca16ff7bced64f154011ef4cb
Reviewed-on: https://go-review.googlesource.com/c/go/+/220542
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/asm/internal/asm/testdata/riscvenc.s
src/cmd/internal/obj/riscv/obj.go

index aae862628d4a407a38142c3949b334fafddd7876..06158153d8cbd2ade1d9a8005725ae25ed3bcef4 100644 (file)
@@ -225,6 +225,9 @@ start:
        FLTS    F0, F1, X7                              // d39300a0
        FLES    F0, F1, X7                              // d38300a0
 
+       // 11.9: Single-Precision Floating-Point Classify Instruction
+       FCLASSS F0, X5                                  // d31200e0
+
        // 12.3: Double-Precision Load and Store Instructions
        FLD     (X5), F0                                // 07b00200
        FLD     4(X5), F0                               // 07b04200
@@ -257,6 +260,9 @@ start:
        FMVXD   F0, X5                                  // d30200e2
        FMVDX   X5, F0                                  // 538002f2
 
+       // 12.6: Double-Precision Floating-Point Classify Instruction
+       FCLASSD F0, X5                                  // d31200e2
+
        // Privileged ISA
 
        // 3.2.1: Environment Call and Breakpoint
@@ -302,7 +308,7 @@ start:
        // These jumps can get printed as jumps to 2 because they go to the
        // second instruction in the function (the first instruction is an
        // invisible stack pointer adjustment).
-       JMP     start           // JMP  2               // 6ff01fc7
+       JMP     start           // JMP  2               // 6ff09fc6
        JMP     (X5)                                    // 67800200
        JMP     4(X5)                                   // 67804200
 
index 698d9e51dac69adae348e73162f5ac9745f2a2a0..63b5ed6119d09c5c9fd2232ff84ac00912d0883d 100644 (file)
@@ -1651,6 +1651,9 @@ var encodings = [ALAST & obj.AMask]encoding{
        AFLTS & obj.AMask: rFFIEncoding,
        AFLES & obj.AMask: rFFIEncoding,
 
+       // 11.9: Single-Precision Floating-Point Classify Instruction
+       AFCLASSS & obj.AMask: rFIEncoding,
+
        // 12.3: Double-Precision Load and Store Instructions
        AFLD & obj.AMask: iFEncoding,
        AFSD & obj.AMask: sFEncoding,
@@ -1686,6 +1689,9 @@ var encodings = [ALAST & obj.AMask]encoding{
        AFLTD & obj.AMask: rFFIEncoding,
        AFLED & obj.AMask: rFFIEncoding,
 
+       // 12.7: Double-Precision Floating-Point Classify Instruction
+       AFCLASSD & obj.AMask: rFIEncoding,
+
        // Privileged ISA
 
        // 3.2.1: Environment Call and Breakpoint