| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py | ||
| ; RUN: llc -mtriple=riscv32 -mattr=+zfinx -verify-machineinstrs < %s \ | ||
| ; RUN: -target-abi=ilp32f | FileCheck -check-prefix=RVZFINX %s | ||
| ; RUN: llc -mtriple=riscv64 -mattr=+zfinx -verify-machineinstrs < %s \ | ||
| ; RUN: -target-abi=lp64f | FileCheck -check-prefix=RVZFINX %s | ||
|
|
||
| define float @test_float(float %x) { | ||
| ; RVZFINX-LABEL: test_float: | ||
| ; RVZFINX: # %bb.0: | ||
| ; RVZFINX-NEXT: .cfi_def_cfa_offset 0 | ||
| ; RVZFINX-NEXT: li a0, 0 | ||
| ; RVZFINX-NEXT: #APP | ||
| ; RVZFINX-NEXT: mv a0, a0 | ||
| ; RVZFINX-NEXT: #NO_APP | ||
| ; RVZFINX-NEXT: li a0, 0 | ||
| ; RVZFINX-NEXT: ret | ||
| %1 = tail call float asm sideeffect alignstack "mv a0, a0", "={x10},{x10}"(float 0.000000e+00) | ||
| ret float 0.000000e+00 | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # RUN: not llvm-mc -triple riscv32 -mattr=+zdinx %s 2>&1 | FileCheck %s | ||
|
|
||
| # Unsupport Odd Registers in RV32 | ||
| fadd.d a0, a1, a2 # CHECK: :[[@LINE]]:12: error: invalid operand for instruction | ||
|
|
||
| # Not support float registers | ||
| flw fa4, 12(sp) # CHECK: :[[@LINE]]:1: error: instruction requires the following: 'F' (Single-Precision Floating-Point) | ||
| fadd.d fa0, fa1, fa2 # CHECK: :[[@LINE]]:1: error: instruction requires the following: 'D' (Double-Precision Floating-Point) | ||
|
|
||
| # Invalid instructions | ||
| fsw a5, 12(sp) # CHECK: :[[@LINE]]:5: error: invalid operand for instruction | ||
| fmv.x.w s0, s1 # CHECK: :[[@LINE]]:13: error: invalid operand for instruction | ||
|
|
||
| # Invalid register names | ||
| fadd.d a100, a2, a3 # CHECK: :[[@LINE]]:8: error: invalid operand for instruction | ||
| fsgnjn.d a100, a2, a3 # CHECK: :[[@LINE]]:10: error: invalid operand for instruction | ||
|
|
||
| # Rounding mode when a register is expected | ||
| fmadd.d x10, x12, x14, ree # CHECK: :[[@LINE]]:24: error: invalid operand for instruction | ||
|
|
||
| # Invalid rounding modes | ||
| fmadd.d x10, x12, x14, x16, ree # CHECK: :[[@LINE]]:29: error: operand must be a valid floating point rounding mode mnemonic | ||
| fmsub.d x10, x12, x14, x16, 0 # CHECK: :[[@LINE]]:29: error: operand must be a valid floating point rounding mode mnemonic | ||
| fnmsub.d x10, x12, x14, x16, 0b111 # CHECK: :[[@LINE]]:30: error: operand must be a valid floating point rounding mode mnemonic | ||
|
|
||
| # FP registers where integer regs are expected | ||
| fcvt.wu.d ft2, a1 # CHECK: :[[@LINE]]:11: error: invalid operand for instruction |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| # RUN: llvm-mc %s -triple=riscv32 -mattr=+zdinx -riscv-no-aliases -show-encoding \ | ||
| # RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s | ||
| # RUN: llvm-mc -filetype=obj -triple=riscv32 -mattr=+zdinx %s \ | ||
| # RUN: | llvm-objdump --mattr=+zdinx -M no-aliases -d -r - \ | ||
| # RUN: | FileCheck --check-prefix=CHECK-ASM-AND-OBJ %s | ||
| # RUN: llvm-mc %s -triple=riscv64 -mattr=+zdinx -riscv-no-aliases -show-encoding \ | ||
| # RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s | ||
| # RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=+zdinx %s \ | ||
| # RUN: | llvm-objdump --mattr=+zdinx -M no-aliases -d -r - \ | ||
| # RUN: | FileCheck --check-prefix=CHECK-ASM-AND-OBJ %s | ||
|
|
||
| # CHECK-ASM-AND-OBJ: fmadd.d a0, a2, a4, a6, dyn | ||
| # CHECK-ASM: encoding: [0x43,0x75,0xe6,0x82] | ||
| fmadd.d x10, x12, x14, x16, dyn | ||
| # CHECK-ASM-AND-OBJ: fmsub.d a0, a2, a4, a6, dyn | ||
| # CHECK-ASM: encoding: [0x47,0x75,0xe6,0x82] | ||
| fmsub.d x10, x12, x14, x16, dyn | ||
| # CHECK-ASM-AND-OBJ: fnmsub.d a0, a2, a4, a6, dyn | ||
| # CHECK-ASM: encoding: [0x4b,0x75,0xe6,0x82] | ||
| fnmsub.d x10, x12, x14, x16, dyn | ||
| # CHECK-ASM-AND-OBJ: fnmadd.d a0, a2, a4, a6, dyn | ||
| # CHECK-ASM: encoding: [0x4f,0x75,0xe6,0x82] | ||
| fnmadd.d x10, x12, x14, x16, dyn | ||
|
|
||
| # CHECK-ASM-AND-OBJ: fadd.d s10, t3, t5, dyn | ||
| # CHECK-ASM: encoding: [0x53,0x7d,0xee,0x03] | ||
| fadd.d x26, x28, x30, dyn | ||
| # CHECK-ASM-AND-OBJ: fsub.d s10, t3, t5, dyn | ||
| # CHECK-ASM: encoding: [0x53,0x7d,0xee,0x0b] | ||
| fsub.d x26, x28, x30, dyn | ||
| # CHECK-ASM-AND-OBJ: fmul.d s10, t3, t5, dyn | ||
| # CHECK-ASM: encoding: [0x53,0x7d,0xee,0x13] | ||
| fmul.d x26, x28, x30, dyn | ||
| # CHECK-ASM-AND-OBJ: fdiv.d s10, t3, t5, dyn | ||
| # CHECK-ASM: encoding: [0x53,0x7d,0xee,0x1b] | ||
| fdiv.d x26, x28, x30, dyn | ||
| # CHECK-ASM-AND-OBJ: fsqrt.d s4, s6, dyn | ||
| # CHECK-ASM: encoding: [0x53,0x7a,0x0b,0x5a] | ||
| fsqrt.d x20, x22, dyn | ||
| # CHECK-ASM-AND-OBJ: fsgnj.d s10, t3, t5 | ||
| # CHECK-ASM: encoding: [0x53,0x0d,0xee,0x23] | ||
| fsgnj.d x26, x28, x30 | ||
| # CHECK-ASM-AND-OBJ: fsgnjn.d s10, t3, t5 | ||
| # CHECK-ASM: encoding: [0x53,0x1d,0xee,0x23] | ||
| fsgnjn.d x26, x28, x30 | ||
| # CHECK-ASM-AND-OBJ: fsgnjx.d s10, t3, t5 | ||
| # CHECK-ASM: encoding: [0x53,0x2d,0xee,0x23] | ||
| fsgnjx.d x26, x28, x30 | ||
| # CHECK-ASM-AND-OBJ: fmin.d s10, t3, t5 | ||
| # CHECK-ASM: encoding: [0x53,0x0d,0xee,0x2b] | ||
| fmin.d x26, x28, x30 | ||
| # CHECK-ASM-AND-OBJ: fmax.d s10, t3, t5 | ||
| # CHECK-ASM: encoding: [0x53,0x1d,0xee,0x2b] | ||
| fmax.d x26, x28, x30 | ||
|
|
||
| # CHECK-ASM-AND-OBJ: fcvt.s.d s10, t3, dyn | ||
| # CHECK-ASM: encoding: [0x53,0x7d,0x1e,0x40] | ||
| fcvt.s.d x26, x28, dyn | ||
| # CHECK-ASM-AND-OBJ: fcvt.d.s s10, t3 | ||
| # CHECK-ASM: encoding: [0x53,0x0d,0x0e,0x42] | ||
| fcvt.d.s x26, x28 | ||
| # CHECK-ASM-AND-OBJ: feq.d s10, t3, t5 | ||
| # CHECK-ASM: encoding: [0x53,0x2d,0xee,0xa3] | ||
| feq.d x26, x28, x30 | ||
| # CHECK-ASM-AND-OBJ: flt.d s10, t3, t5 | ||
| # CHECK-ASM: encoding: [0x53,0x1d,0xee,0xa3] | ||
| flt.d x26, x28, x30 | ||
| # CHECK-ASM-AND-OBJ: fle.d s10, t3, t5 | ||
| # CHECK-ASM: encoding: [0x53,0x0d,0xee,0xa3] | ||
| fle.d x26, x28, x30 | ||
| # CHECK-ASM-AND-OBJ: fclass.d s10, t3 | ||
| # CHECK-ASM: encoding: [0x53,0x1d,0x0e,0xe2] | ||
| fclass.d x26, x28 | ||
|
|
||
| # CHECK-ASM-AND-OBJ: fcvt.w.d s4, s6, dyn | ||
| # CHECK-ASM: encoding: [0x53,0x7a,0x0b,0xc2] | ||
| fcvt.w.d x20, x22, dyn | ||
| # CHECK-ASM-AND-OBJ: fcvt.d.w s10, t3 | ||
| # CHECK-ASM: encoding: [0x53,0x0d,0x0e,0xd2] | ||
| fcvt.d.w x26, x28 | ||
| # CHECK-ASM-AND-OBJ: fcvt.d.wu s10, t3 | ||
| # CHECK-ASM: encoding: [0x53,0x0d,0x1e,0xd2] | ||
| fcvt.d.wu x26, x28 | ||
|
|
||
| # Rounding modes | ||
|
|
||
| # CHECK-ASM-AND-OBJ: fmadd.d a0, a2, a4, a6, rne | ||
| # CHECK-ASM: encoding: [0x43,0x05,0xe6,0x82] | ||
| fmadd.d x10, x12, x14, x16, rne | ||
| # CHECK-ASM-AND-OBJ: fmsub.d a0, a2, a4, a6, rtz | ||
| # CHECK-ASM: encoding: [0x47,0x15,0xe6,0x82] | ||
| fmsub.d x10, x12, x14, x16, rtz | ||
| # CHECK-ASM-AND-OBJ: fnmsub.d a0, a2, a4, a6, rdn | ||
| # CHECK-ASM: encoding: [0x4b,0x25,0xe6,0x82] | ||
| fnmsub.d x10, x12, x14, x16, rdn | ||
| # CHECK-ASM-AND-OBJ: fnmadd.d a0, a2, a4, a6, rup | ||
| # CHECK-ASM: encoding: [0x4f,0x35,0xe6,0x82] | ||
| fnmadd.d x10, x12, x14, x16, rup | ||
|
|
||
| # CHECK-ASM-AND-OBJ: fadd.d s10, t3, t5, rmm | ||
| # CHECK-ASM: encoding: [0x53,0x4d,0xee,0x03] | ||
| fadd.d x26, x28, x30, rmm | ||
| # CHECK-ASM-AND-OBJ: fsub.d s10, t3, t5, dyn | ||
| # CHECK-ASM: encoding: [0x53,0x7d,0xee,0x0b] | ||
| fsub.d x26, x28, x30, dyn | ||
| # CHECK-ASM-AND-OBJ: fmul.d s10, t3, t5, rne | ||
| # CHECK-ASM: encoding: [0x53,0x0d,0xee,0x13] | ||
| fmul.d x26, x28, x30, rne | ||
| # CHECK-ASM-AND-OBJ: fdiv.d s10, t3, t5, rtz | ||
| # CHECK-ASM: encoding: [0x53,0x1d,0xee,0x1b] | ||
| fdiv.d x26, x28, x30, rtz | ||
|
|
||
| # CHECK-ASM-AND-OBJ: fsqrt.d s4, s6, rdn | ||
| # CHECK-ASM: encoding: [0x53,0x2a,0x0b,0x5a] | ||
| fsqrt.d x20, x22, rdn | ||
| # CHECK-ASM-AND-OBJ: fcvt.s.d s4, s6, rup | ||
| # CHECK-ASM: encoding: [0x53,0x3a,0x1b,0x40] | ||
| fcvt.s.d x20, x22, rup | ||
| # CHECK-ASM-AND-OBJ: fcvt.w.d s4, s6, rmm | ||
| # CHECK-ASM: encoding: [0x53,0x4a,0x0b,0xc2] | ||
| fcvt.w.d x20, x22, rmm | ||
| # CHECK-ASM-AND-OBJ: fcvt.wu.d s4, s6, dyn | ||
| # CHECK-ASM: encoding: [0x53,0x7a,0x1b,0xc2] | ||
| fcvt.wu.d x20, x22, dyn |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # RUN: not llvm-mc -triple riscv32 -mattr=+zfinx %s 2>&1 | FileCheck %s | ||
|
|
||
| # Not support float registers | ||
| flw fa4, 12(sp) # CHECK: :[[@LINE]]:1: error: instruction requires the following: 'F' (Single-Precision Floating-Point) | ||
| fadd.s fa0, fa1, fa2 # CHECK: :[[@LINE]]:1: error: instruction requires the following: 'F' (Single-Precision Floating-Point) | ||
|
|
||
| # Invalid instructions | ||
| fsw a5, 12(sp) # CHECK: :[[@LINE]]:5: error: invalid operand for instruction | ||
| fmv.x.w s0, s1 # CHECK: :[[@LINE]]:13: error: invalid operand for instruction | ||
| fadd.d t1, t3, t5 # CHECK: :[[@LINE]]:1: error: instruction requires the following: 'Zdinx' (Double in Integer) | ||
|
|
||
| # Invalid register names | ||
| fadd.d a100, a2, a3 # CHECK: :[[@LINE]]:8: error: invalid operand for instruction | ||
| fsgnjn.s a100, a2, a3 # CHECK: :[[@LINE]]:10: error: invalid operand for instruction | ||
|
|
||
| # Rounding mode when a register is expected | ||
| fmadd.s x10, x11, x12, ree # CHECK: :[[@LINE]]:24: error: invalid operand for instruction | ||
|
|
||
| # Invalid rounding modes | ||
| fmadd.s x10, x11, x12, x13, ree # CHECK: :[[@LINE]]:29: error: operand must be a valid floating point rounding mode mnemonic | ||
| fmsub.s x14, x15, x16, x17, 0 # CHECK: :[[@LINE]]:29: error: operand must be a valid floating point rounding mode mnemonic | ||
| fnmsub.s x18, x19, x20, x21, 0b111 # CHECK: :[[@LINE]]:30: error: operand must be a valid floating point rounding mode mnemonic | ||
|
|
||
| # Using 'Zdinx' instructions for an 'Zfinx'-only target | ||
| fadd.d t0, t1, t2 # CHECK: :[[@LINE]]:8: error: invalid operand for instruction |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,128 @@ | ||
| # RUN: llvm-mc %s -triple=riscv32 -mattr=+zfinx -riscv-no-aliases -show-encoding \ | ||
| # RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s | ||
| # RUN: llvm-mc %s -triple=riscv64 -mattr=+zfinx -riscv-no-aliases -show-encoding \ | ||
| # RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s | ||
| # RUN: llvm-mc -filetype=obj -triple=riscv32 -mattr=+zfinx %s \ | ||
| # RUN: | llvm-objdump --mattr=+zfinx -M no-aliases -d -r - \ | ||
| # RUN: | FileCheck --check-prefix=CHECK-ASM-AND-OBJ %s | ||
| # RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=+zfinx %s \ | ||
| # RUN: | llvm-objdump --mattr=+zfinx -M no-aliases -d -r - \ | ||
| # RUN: | FileCheck --check-prefix=CHECK-ASM-AND-OBJ %s | ||
|
|
||
| # CHECK-ASM-AND-OBJ: fmadd.s a0, a1, a2, a3, dyn | ||
| # CHECK-ASM: encoding: [0x43,0xf5,0xc5,0x68] | ||
| fmadd.s x10, x11, x12, x13, dyn | ||
| # CHECK-ASM-AND-OBJ: fmsub.s a4, a5, a6, a7, dyn | ||
| # CHECK-ASM: encoding: [0x47,0xf7,0x07,0x89] | ||
| fmsub.s x14, x15, x16, x17, dyn | ||
| # CHECK-ASM-AND-OBJ: fnmsub.s s2, s3, s4, s5, dyn | ||
| # CHECK-ASM: encoding: [0x4b,0xf9,0x49,0xa9] | ||
| fnmsub.s x18, x19, x20, x21, dyn | ||
| # CHECK-ASM-AND-OBJ: fnmadd.s s6, s7, s8, s9, dyn | ||
| # CHECK-ASM: encoding: [0x4f,0xfb,0x8b,0xc9] | ||
| fnmadd.s x22, x23, x24, x25, dyn | ||
|
|
||
| # CHECK-ASM-AND-OBJ: fadd.s s10, s11, t3, dyn | ||
| # CHECK-ASM: encoding: [0x53,0xfd,0xcd,0x01] | ||
| fadd.s x26, x27, x28, dyn | ||
| # CHECK-ASM-AND-OBJ: fsub.s t4, t5, t6, dyn | ||
| # CHECK-ASM: encoding: [0xd3,0x7e,0xff,0x09] | ||
| fsub.s x29, x30, x31, dyn | ||
| # CHECK-ASM-AND-OBJ: fmul.s s0, s1, s2, dyn | ||
| # CHECK-ASM: encoding: [0x53,0xf4,0x24,0x11] | ||
| fmul.s s0, s1, s2, dyn | ||
| # CHECK-ASM-AND-OBJ: fdiv.s s3, s4, s5, dyn | ||
| # CHECK-ASM: encoding: [0xd3,0x79,0x5a,0x19] | ||
| fdiv.s s3, s4, s5, dyn | ||
| # CHECK-ASM-AND-OBJ: fsqrt.s t1, t2, dyn | ||
| # CHECK-ASM: encoding: [0x53,0xf3,0x03,0x58] | ||
| fsqrt.s t1, t2, dyn | ||
| # CHECK-ASM-AND-OBJ: fsgnj.s s1, a0, a1 | ||
| # CHECK-ASM: encoding: [0xd3,0x04,0xb5,0x20] | ||
| fsgnj.s s1, a0, a1 | ||
| # CHECK-ASM-AND-OBJ: fsgnjn.s a1, a3, a4 | ||
| # CHECK-ASM: encoding: [0xd3,0x95,0xe6,0x20] | ||
| fsgnjn.s a1, a3, a4 | ||
| # CHECK-ASM-AND-OBJ: fsgnjx.s a4, a3, a2 | ||
| # CHECK-ASM: encoding: [0x53,0xa7,0xc6,0x20] | ||
| fsgnjx.s a4, a3, a2 | ||
| # CHECK-ASM-AND-OBJ: fmin.s a5, a6, a7 | ||
| # CHECK-ASM: encoding: [0xd3,0x07,0x18,0x29] | ||
| fmin.s a5, a6, a7 | ||
| # CHECK-ASM-AND-OBJ: fmax.s s2, s3, s4 | ||
| # CHECK-ASM: encoding: [0x53,0x99,0x49,0x29] | ||
| fmax.s s2, s3, s4 | ||
| # CHECK-ASM-AND-OBJ: fcvt.w.s a0, s5, dyn | ||
| # CHECK-ASM: encoding: [0x53,0xf5,0x0a,0xc0] | ||
| fcvt.w.s a0, s5, dyn | ||
| # CHECK-ASM-AND-OBJ: fcvt.wu.s a1, s6, dyn | ||
| # CHECK-ASM: encoding: [0xd3,0x75,0x1b,0xc0] | ||
| fcvt.wu.s a1, s6, dyn | ||
| # CHECK-ASM-AND-OBJ: feq.s a1, s8, s9 | ||
| # CHECK-ASM: encoding: [0xd3,0x25,0x9c,0xa1] | ||
| feq.s a1, s8, s9 | ||
| # CHECK-ASM-AND-OBJ: flt.s a2, s10, s11 | ||
| # CHECK-ASM: encoding: [0x53,0x16,0xbd,0xa1] | ||
| flt.s a2, s10, s11 | ||
| # CHECK-ASM-AND-OBJ: fle.s a3, t3, t4 | ||
| # CHECK-ASM: encoding: [0xd3,0x06,0xde,0xa1] | ||
| fle.s a3, t3, t4 | ||
| # CHECK-ASM-AND-OBJ: fclass.s a3, t5 | ||
| # CHECK-ASM: encoding: [0xd3,0x16,0x0f,0xe0] | ||
| fclass.s a3, t5 | ||
| # CHECK-ASM-AND-OBJ: fcvt.s.w t6, a4, dyn | ||
| # CHECK-ASM: encoding: [0xd3,0x7f,0x07,0xd0] | ||
| fcvt.s.w t6, a4, dyn | ||
| # CHECK-ASM-AND-OBJ: fcvt.s.wu s0, a5, dyn | ||
| # CHECK-ASM: encoding: [0x53,0xf4,0x17,0xd0] | ||
| fcvt.s.wu s0, a5, dyn | ||
|
|
||
| # Rounding modes | ||
|
|
||
| # CHECK-ASM-AND-OBJ: fmadd.s a0, a1, a2, a3, rne | ||
| # CHECK-ASM: encoding: [0x43,0x85,0xc5,0x68] | ||
| fmadd.s x10, x11, x12, x13, rne | ||
| # CHECK-ASM-AND-OBJ: fmsub.s a4, a5, a6, a7, rtz | ||
| # CHECK-ASM: encoding: [0x47,0x97,0x07,0x89] | ||
| fmsub.s x14, x15, x16, x17, rtz | ||
| # CHECK-ASM-AND-OBJ: fnmsub.s s2, s3, s4, s5, rdn | ||
| # CHECK-ASM: encoding: [0x4b,0xa9,0x49,0xa9] | ||
| fnmsub.s x18, x19, x20, x21, rdn | ||
| # CHECK-ASM-AND-OBJ: fnmadd.s s6, s7, s8, s9, rup | ||
| # CHECK-ASM: encoding: [0x4f,0xbb,0x8b,0xc9] | ||
| fnmadd.s x22, x23, x24, x25, rup | ||
| # CHECK-ASM-AND-OBJ: fmadd.s a0, a1, a2, a3, rmm | ||
| # CHECK-ASM: encoding: [0x43,0xc5,0xc5,0x68] | ||
| fmadd.s x10, x11, x12, x13, rmm | ||
| # CHECK-ASM-AND-OBJ: fmsub.s a4, a5, a6, a7 | ||
| # CHECK-ASM: encoding: [0x47,0xf7,0x07,0x89] | ||
| fmsub.s x14, x15, x16, x17, dyn | ||
|
|
||
| # CHECK-ASM-AND-OBJ: fadd.s s10, s11, t3, rne | ||
| # CHECK-ASM: encoding: [0x53,0x8d,0xcd,0x01] | ||
| fadd.s x26, x27, x28, rne | ||
| # CHECK-ASM-AND-OBJ: fsub.s t4, t5, t6, rtz | ||
| # CHECK-ASM: encoding: [0xd3,0x1e,0xff,0x09] | ||
| fsub.s x29, x30, x31, rtz | ||
| # CHECK-ASM-AND-OBJ: fmul.s s0, s1, s2, rdn | ||
| # CHECK-ASM: encoding: [0x53,0xa4,0x24,0x11] | ||
| fmul.s s0, s1, s2, rdn | ||
| # CHECK-ASM-AND-OBJ: fdiv.s s3, s4, s5, rup | ||
| # CHECK-ASM: encoding: [0xd3,0x39,0x5a,0x19] | ||
| fdiv.s s3, s4, s5, rup | ||
|
|
||
| # CHECK-ASM-AND-OBJ: fsqrt.s t1, t2, rmm | ||
| # CHECK-ASM: encoding: [0x53,0xc3,0x03,0x58] | ||
| fsqrt.s t1, t2, rmm | ||
| # CHECK-ASM-AND-OBJ: fcvt.w.s a0, s5, rup | ||
| # CHECK-ASM: encoding: [0x53,0xb5,0x0a,0xc0] | ||
| fcvt.w.s a0, s5, rup | ||
| # CHECK-ASM-AND-OBJ: fcvt.wu.s a1, s6, rdn | ||
| # CHECK-ASM: encoding: [0xd3,0x25,0x1b,0xc0] | ||
| fcvt.wu.s a1, s6, rdn | ||
| # CHECK-ASM-AND-OBJ: fcvt.s.w t6, a4, rtz | ||
| # CHECK-ASM: encoding: [0xd3,0x1f,0x07,0xd0] | ||
| fcvt.s.w t6, a4, rtz | ||
| # CHECK-ASM-AND-OBJ: fcvt.s.wu s0, a5, rne | ||
| # CHECK-ASM: encoding: [0x53,0x84,0x17,0xd0] | ||
| fcvt.s.wu s0, a5, rne |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # RUN: not llvm-mc -triple riscv32 -mattr=+zhinx %s 2>&1 | FileCheck %s | ||
|
|
||
| # Not support float registers | ||
| flw fa4, 12(sp) # CHECK: :[[@LINE]]:1: error: instruction requires the following: 'F' (Single-Precision Floating-Point) | ||
| fadd.h fa0, fa1, fa2 # CHECK: :[[@LINE]]:1: error: instruction requires the following: 'Zfh' (Half-Precision Floating-Point) | ||
|
|
||
| # Invalid instructions | ||
| fsw a5, 12(sp) # CHECK: :[[@LINE]]:5: error: invalid operand for instruction | ||
| fmv.x.h s0, s1 # CHECK: :[[@LINE]]:13: error: invalid operand for instruction | ||
|
|
||
| # Invalid register names | ||
| fadd.h a100, a2, a3 # CHECK: :[[@LINE]]:8: error: invalid operand for instruction | ||
| fsgnjn.h a100, a2, a3 # CHECK: :[[@LINE]]:10: error: invalid operand for instruction | ||
|
|
||
| # Rounding mode when a register is expected | ||
| fmadd.h x10, x11, x12, ree # CHECK: :[[@LINE]]:24: error: invalid operand for instruction | ||
|
|
||
| # Invalid rounding modes | ||
| fmadd.h x10, x11, x12, x13, ree # CHECK: :[[@LINE]]:29: error: operand must be a valid floating point rounding mode mnemonic | ||
| fmsub.h x14, x15, x16, x17, 0 # CHECK: :[[@LINE]]:29: error: operand must be a valid floating point rounding mode mnemonic | ||
| fnmsub.h x18, x19, x20, x21, 0b111 # CHECK: :[[@LINE]]:30: error: operand must be a valid floating point rounding mode mnemonic | ||
|
|
||
| # FP registers where integer regs are expected | ||
| fcvt.wu.h ft2, a1 # CHECK: :[[@LINE]]:11: error: invalid operand for instruction |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,128 @@ | ||
| # RUN: llvm-mc %s -triple=riscv32 -mattr=+zhinx -riscv-no-aliases -show-encoding \ | ||
| # RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s | ||
| # RUN: llvm-mc %s -triple=riscv64 -mattr=+zhinx -riscv-no-aliases -show-encoding \ | ||
| # RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s | ||
| # RUN: llvm-mc -filetype=obj -triple=riscv32 -mattr=+zhinx %s \ | ||
| # RUN: | llvm-objdump --mattr=+zhinx -M no-aliases -d -r - \ | ||
| # RUN: | FileCheck -check-prefixes=CHECK-ASM-AND-OBJ %s | ||
| # RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=+zhinx %s \ | ||
| # RUN: | llvm-objdump --mattr=+zhinx -M no-aliases -d -r - \ | ||
| # RUN: | FileCheck -check-prefixes=CHECK-ASM-AND-OBJ %s | ||
|
|
||
| # CHECK-ASM-AND-OBJ: fmadd.h a0, a1, a2, a3, dyn | ||
| # CHECK-ASM: encoding: [0x43,0xf5,0xc5,0x6c] | ||
| fmadd.h x10, x11, x12, x13, dyn | ||
| # CHECK-ASM-AND-OBJ: fmsub.h a4, a5, a6, a7, dyn | ||
| # CHECK-ASM: encoding: [0x47,0xf7,0x07,0x8d] | ||
| fmsub.h x14, x15, x16, x17, dyn | ||
| # CHECK-ASM-AND-OBJ: fnmsub.h s2, s3, s4, s5, dyn | ||
| # CHECK-ASM: encoding: [0x4b,0xf9,0x49,0xad] | ||
| fnmsub.h x18, x19, x20, x21, dyn | ||
| # CHECK-ASM-AND-OBJ: fnmadd.h s6, s7, s8, s9, dyn | ||
| # CHECK-ASM: encoding: [0x4f,0xfb,0x8b,0xcd] | ||
| fnmadd.h x22, x23, x24, x25, dyn | ||
|
|
||
| # CHECK-ASM-AND-OBJ: fadd.h s10, s11, t3, dyn | ||
| # CHECK-ASM: encoding: [0x53,0xfd,0xcd,0x05] | ||
| fadd.h x26, x27, x28, dyn | ||
| # CHECK-ASM-AND-OBJ: fsub.h t4, t5, t6, dyn | ||
| # CHECK-ASM: encoding: [0xd3,0x7e,0xff,0x0d] | ||
| fsub.h x29, x30, x31, dyn | ||
| # CHECK-ASM-AND-OBJ: fmul.h s0, s1, s2, dyn | ||
| # CHECK-ASM: encoding: [0x53,0xf4,0x24,0x15] | ||
| fmul.h s0, s1, s2, dyn | ||
| # CHECK-ASM-AND-OBJ: fdiv.h s3, s4, s5, dyn | ||
| # CHECK-ASM: encoding: [0xd3,0x79,0x5a,0x1d] | ||
| fdiv.h s3, s4, s5, dyn | ||
| # CHECK-ASM-AND-OBJ: fsqrt.h s6, s7, dyn | ||
| # CHECK-ASM: encoding: [0x53,0xfb,0x0b,0x5c] | ||
| fsqrt.h s6, s7, dyn | ||
| # CHECK-ASM-AND-OBJ: fsgnj.h s1, a0, a1 | ||
| # CHECK-ASM: encoding: [0xd3,0x04,0xb5,0x24] | ||
| fsgnj.h x9, x10, x11 | ||
| # CHECK-ASM-AND-OBJ: fsgnjn.h a1, a3, a4 | ||
| # CHECK-ASM: encoding: [0xd3,0x95,0xe6,0x24] | ||
| fsgnjn.h x11, x13, x14 | ||
| # CHECK-ASM-AND-OBJ: fsgnjx.h a4, a3, a2 | ||
| # CHECK-ASM: encoding: [0x53,0xa7,0xc6,0x24] | ||
| fsgnjx.h x14, x13, x12 | ||
| # CHECK-ASM-AND-OBJ: fmin.h a5, a6, a7 | ||
| # CHECK-ASM: encoding: [0xd3,0x07,0x18,0x2d] | ||
| fmin.h x15, x16, x17 | ||
| # CHECK-ASM-AND-OBJ: fmax.h s2, s3, s4 | ||
| # CHECK-ASM: encoding: [0x53,0x99,0x49,0x2d] | ||
| fmax.h x18, x19, x20 | ||
| # CHECK-ASM-AND-OBJ: fcvt.w.h a0, s5, dyn | ||
| # CHECK-ASM: encoding: [0x53,0xf5,0x0a,0xc4] | ||
| fcvt.w.h x10, x21, dyn | ||
| # CHECK-ASM-AND-OBJ: fcvt.wu.h a1, s6, dyn | ||
| # CHECK-ASM: encoding: [0xd3,0x75,0x1b,0xc4] | ||
| fcvt.wu.h x11, x22, dyn | ||
| # CHECK-ASM-AND-OBJ: feq.h a1, s8, s9 | ||
| # CHECK-ASM: encoding: [0xd3,0x25,0x9c,0xa5] | ||
| feq.h x11, x24, x25 | ||
| # CHECK-ASM-AND-OBJ: flt.h a2, s10, s11 | ||
| # CHECK-ASM: encoding: [0x53,0x16,0xbd,0xa5] | ||
| flt.h x12, x26, x27 | ||
| # CHECK-ASM-AND-OBJ: fle.h a3, t3, t4 | ||
| # CHECK-ASM: encoding: [0xd3,0x06,0xde,0xa5] | ||
| fle.h x13, x28, x29 | ||
| # CHECK-ASM-AND-OBJ: fclass.h a3, t5 | ||
| # CHECK-ASM: encoding: [0xd3,0x16,0x0f,0xe4] | ||
| fclass.h x13, x30 | ||
| # CHECK-ASM-AND-OBJ: fcvt.h.w t6, a4, dyn | ||
| # CHECK-ASM: encoding: [0xd3,0x7f,0x07,0xd4] | ||
| fcvt.h.w x31, x14, dyn | ||
| # CHECK-ASM-AND-OBJ: fcvt.h.wu s0, a5, dyn | ||
| # CHECK-ASM: encoding: [0x53,0xf4,0x17,0xd4] | ||
| fcvt.h.wu s0, x15, dyn | ||
|
|
||
| # Rounding modes | ||
|
|
||
| # CHECK-ASM-AND-OBJ: fmadd.h a0, a1, a2, a3, rne | ||
| # CHECK-ASM: encoding: [0x43,0x85,0xc5,0x6c] | ||
| fmadd.h x10, x11, x12, x13, rne | ||
| # CHECK-ASM-AND-OBJ: fmsub.h a4, a5, a6, a7, rtz | ||
| # CHECK-ASM: encoding: [0x47,0x97,0x07,0x8d] | ||
| fmsub.h x14, x15, x16, x17, rtz | ||
| # CHECK-ASM-AND-OBJ: fnmsub.h s2, s3, s4, s5, rdn | ||
| # CHECK-ASM: encoding: [0x4b,0xa9,0x49,0xad] | ||
| fnmsub.h x18, x19, x20, x21, rdn | ||
| # CHECK-ASM-AND-OBJ: fnmadd.h s6, s7, s8, s9, rup | ||
| # CHECK-ASM: encoding: [0x4f,0xbb,0x8b,0xcd] | ||
| fnmadd.h x22, x23, x24, x25, rup | ||
| # CHECK-ASM-AND-OBJ: fmadd.h a0, a1, a2, a3, rmm | ||
| # CHECK-ASM: encoding: [0x43,0xc5,0xc5,0x6c] | ||
| fmadd.h x10, x11, x12, x13, rmm | ||
| # CHECK-ASM-AND-OBJ: fmsub.h a4, a5, a6, a7 | ||
| # CHECK-ASM: encoding: [0x47,0xf7,0x07,0x8d] | ||
| fmsub.h x14, x15, x16, x17, dyn | ||
|
|
||
| # CHECK-ASM-AND-OBJ: fadd.h s10, s11, t3, rne | ||
| # CHECK-ASM: encoding: [0x53,0x8d,0xcd,0x05] | ||
| fadd.h x26, x27, x28, rne | ||
| # CHECK-ASM-AND-OBJ: fsub.h t4, t5, t6, rtz | ||
| # CHECK-ASM: encoding: [0xd3,0x1e,0xff,0x0d] | ||
| fsub.h x29, x30, x31, rtz | ||
| # CHECK-ASM-AND-OBJ: fmul.h s0, s1, s2, rdn | ||
| # CHECK-ASM: encoding: [0x53,0xa4,0x24,0x15] | ||
| fmul.h s0, s1, s2, rdn | ||
| # CHECK-ASM-AND-OBJ: fdiv.h s3, s4, s5, rup | ||
| # CHECK-ASM: encoding: [0xd3,0x39,0x5a,0x1d] | ||
| fdiv.h s3, s4, s5, rup | ||
|
|
||
| # CHECK-ASM-AND-OBJ: fsqrt.h s6, s7, rmm | ||
| # CHECK-ASM: encoding: [0x53,0xcb,0x0b,0x5c] | ||
| fsqrt.h s6, s7, rmm | ||
| # CHECK-ASM-AND-OBJ: fcvt.w.h a0, s5, rup | ||
| # CHECK-ASM: encoding: [0x53,0xb5,0x0a,0xc4] | ||
| fcvt.w.h x10, x21, rup | ||
| # CHECK-ASM-AND-OBJ: fcvt.wu.h a1, s6, rdn | ||
| # CHECK-ASM: encoding: [0xd3,0x25,0x1b,0xc4] | ||
| fcvt.wu.h x11, x22, rdn | ||
| # CHECK-ASM-AND-OBJ: fcvt.h.w t6, a4, rtz | ||
| # CHECK-ASM: encoding: [0xd3,0x1f,0x07,0xd4] | ||
| fcvt.h.w x31, x14, rtz | ||
| # CHECK-ASM-AND-OBJ: fcvt.h.wu s0, a5, rne | ||
| # CHECK-ASM: encoding: [0x53,0x84,0x17,0xd4] | ||
| fcvt.h.wu s0, a5, rne |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # RUN: not llvm-mc -triple riscv32 -mattr=+zhinxmin %s 2>&1 | FileCheck %s | ||
|
|
||
| # Not support float registers | ||
| flw fa4, 12(sp) # CHECK: :[[@LINE]]:1: error: instruction requires the following: 'F' (Single-Precision Floating-Point) | ||
| fcvt.h.s fa0, fa1 # CHECK: :[[@LINE]]:1: error: instruction requires the following: 'Zfh' (Half-Precision Floating-Point) or 'Zfhmin' (Half-Precision Floating-Point Minimal) | ||
|
|
||
| # Invalid instructions | ||
| fsw a5, 12(sp) # CHECK: :[[@LINE]]:5: error: invalid operand for instruction | ||
| fmv.x.h s0, s1 # CHECK: :[[@LINE]]:13: error: invalid operand for instruction | ||
|
|
||
| # Invalid register names | ||
| fcvt.h.s a100, a1 # CHECK: :[[@LINE]]:10: error: invalid operand for instruction | ||
|
|
||
| # Valid in Zhinx | ||
| fmadd.h x10, x11, x12, x13, dyn # CHECK: :[[@LINE]]:1: error: instruction requires the following: 'Zhinx' (Half Float in Integer) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # RUN: llvm-mc %s -triple=riscv32 -mattr=+zhinxmin -riscv-no-aliases -show-encoding \ | ||
| # RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s | ||
| # RUN: llvm-mc %s -triple=riscv64 -mattr=+zhinxmin -riscv-no-aliases -show-encoding \ | ||
| # RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s | ||
| # RUN: llvm-mc -filetype=obj -triple=riscv32 -mattr=+zhinxmin %s \ | ||
| # RUN: | llvm-objdump --mattr=+zhinxmin -M no-aliases -d -r - \ | ||
| # RUN: | FileCheck -check-prefixes=CHECK-ASM-AND-OBJ %s | ||
| # RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=+zhinxmin %s \ | ||
| # RUN: | llvm-objdump --mattr=+zhinxmin -M no-aliases -d -r - \ | ||
| # RUN: | FileCheck -check-prefixes=CHECK-ASM-AND-OBJ %s | ||
|
|
||
| # CHECK-ASM-AND-OBJ: fcvt.s.h a0, a1 | ||
| # CHECK-ASM: encoding: [0x53,0x85,0x25,0x40] | ||
| fcvt.s.h a0, a1 | ||
|
|
||
| # CHECK-ASM-AND-OBJ: fcvt.h.s a0, a1, dyn | ||
| # CHECK-ASM: encoding: [0x53,0xf5,0x05,0x44] | ||
| fcvt.h.s a0, a1 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # RUN: not llvm-mc -triple riscv64 -mattr=+zdinx %s 2>&1 | FileCheck %s | ||
|
|
||
| # Invalid Instructions | ||
| fmv.x.d t2, a2 # CHECK: :[[@LINE]]:13: error: invalid operand for instruction | ||
| fmv.d.x a5, t5 # CHECK: :[[@LINE]]:9: error: invalid operand for instruction | ||
|
|
||
| # FP registers where integer regs are expected | ||
| fcvt.d.l a3, ft3 # CHECK: :[[@LINE]]:14: error: invalid operand for instruction | ||
| fcvt.d.lu a4, ft4 # CHECK: :[[@LINE]]:15: error: invalid operand for instruction |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| # RUN: llvm-mc %s -triple=riscv64 -mattr=+zdinx -riscv-no-aliases -show-encoding \ | ||
| # RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s | ||
| # RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=+zdinx %s \ | ||
| # RUN: | llvm-objdump --mattr=+zdinx -M no-aliases -d -r - \ | ||
| # RUN: | FileCheck --check-prefix=CHECK-ASM-AND-OBJ %s | ||
| # | ||
| # RUN: not llvm-mc -triple riscv32 -mattr=+zdinx %s 2>&1 \ | ||
| # RUN: | FileCheck -check-prefix=CHECK-RV32 %s | ||
|
|
||
| # CHECK-ASM-AND-OBJ: fcvt.l.d a0, t0, dyn | ||
| # CHECK-ASM: encoding: [0x53,0xf5,0x22,0xc2] | ||
| # CHECK-RV32: :[[#@LINE+1]]:14: error: invalid operand for instruction | ||
| fcvt.l.d a0, t0, dyn | ||
| # CHECK-ASM-AND-OBJ: fcvt.lu.d a1, t1, dyn | ||
| # CHECK-ASM: encoding: [0xd3,0x75,0x33,0xc2] | ||
| # CHECK-RV32: :[[#@LINE+1]]:15: error: invalid operand for instruction | ||
| fcvt.lu.d a1, t1, dyn | ||
| # CHECK-ASM-AND-OBJ: fcvt.d.l t3, a3, dyn | ||
| # CHECK-ASM: encoding: [0x53,0xfe,0x26,0xd2] | ||
| # CHECK-RV32: :[[#@LINE+1]]:10: error: invalid operand for instruction | ||
| fcvt.d.l t3, a3, dyn | ||
| # CHECK-ASM-AND-OBJ: fcvt.d.lu t4, a4, dyn | ||
| # CHECK-ASM: encoding: [0xd3,0x7e,0x37,0xd2] | ||
| # CHECK-RV32: :[[#@LINE+1]]:11: error: invalid operand for instruction | ||
| fcvt.d.lu t4, a4, dyn | ||
|
|
||
| # Rounding modes | ||
| # CHECK-ASM-AND-OBJ: fcvt.d.l t3, a3, rne | ||
| # CHECK-ASM: encoding: [0x53,0x8e,0x26,0xd2] | ||
| # CHECK-RV32: :[[#@LINE+1]]:10: error: invalid operand for instruction | ||
| fcvt.d.l t3, a3, rne | ||
| # CHECK-ASM-AND-OBJ: fcvt.d.lu t4, a4, rtz | ||
| # CHECK-ASM: encoding: [0xd3,0x1e,0x37,0xd2] | ||
| # CHECK-RV32: :[[#@LINE+1]]:11: error: invalid operand for instruction | ||
| fcvt.d.lu t4, a4, rtz | ||
| # CHECK-ASM-AND-OBJ: fcvt.l.d a0, t0, rdn | ||
| # CHECK-ASM: encoding: [0x53,0xa5,0x22,0xc2] | ||
| # CHECK-RV32: :[[#@LINE+1]]:14: error: invalid operand for instruction | ||
| fcvt.l.d a0, t0, rdn | ||
| # CHECK-ASM-AND-OBJ: fcvt.lu.d a1, t1, rup | ||
| # CHECK-ASM: encoding: [0xd3,0x35,0x33,0xc2] | ||
| # CHECK-RV32: :[[#@LINE+1]]:15: error: invalid operand for instruction | ||
| fcvt.lu.d a1, t1, rup |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # RUN: not llvm-mc -triple riscv64 -mattr=+zfinx %s 2>&1 | FileCheck %s | ||
|
|
||
| # Invalid instructions | ||
| fmv.x.w t2, a2 # CHECK: :[[@LINE]]:13: error: invalid operand for instruction | ||
| fmv.w.x a5, t5 # CHECK: :[[@LINE]]:9: error: invalid operand for instruction | ||
|
|
||
| # FP registers where integer regs are expected | ||
| fcvt.s.l a2, ft2 # CHECK: :[[@LINE]]:14: error: invalid operand for instruction | ||
| fcvt.s.lu a3, ft3 # CHECK: :[[@LINE]]:15: error: invalid operand for instruction |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| # RUN: llvm-mc %s -triple=riscv64 -mattr=+zfinx -riscv-no-aliases -show-encoding \ | ||
| # RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s | ||
| # RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=+zfinx %s \ | ||
| # RUN: | llvm-objdump --mattr=+zfinx -M no-aliases -d -r - \ | ||
| # RUN: | FileCheck --check-prefix=CHECK-ASM-AND-OBJ %s | ||
| # | ||
| # RUN: not llvm-mc -triple riscv32 -mattr=+zfinx %s 2>&1 \ | ||
| # RUN: | FileCheck -check-prefix=CHECK-RV32 %s | ||
|
|
||
| # CHECK-ASM-AND-OBJ: fcvt.l.s a0, t0, dyn | ||
| # CHECK-ASM: encoding: [0x53,0xf5,0x22,0xc0] | ||
| # CHECK-RV32: :[[#@LINE+1]]:1: error: instruction requires the following: RV64I Base Instruction Set | ||
| fcvt.l.s a0, t0, dyn | ||
| # CHECK-ASM-AND-OBJ: fcvt.lu.s a1, t1, dyn | ||
| # CHECK-ASM: encoding: [0xd3,0x75,0x33,0xc0] | ||
| # CHECK-RV32: :[[#@LINE+1]]:1: error: instruction requires the following: RV64I Base Instruction Set | ||
| fcvt.lu.s a1, t1, dyn | ||
| # CHECK-ASM-AND-OBJ: fcvt.s.l t2, a2, dyn | ||
| # CHECK-ASM: encoding: [0xd3,0x73,0x26,0xd0] | ||
| # CHECK-RV32: :[[#@LINE+1]]:1: error: instruction requires the following: RV64I Base Instruction Set | ||
| fcvt.s.l t2, a2, dyn | ||
| # CHECK-ASM-AND-OBJ: fcvt.s.lu t3, a3, dyn | ||
| # CHECK-ASM: encoding: [0x53,0xfe,0x36,0xd0] | ||
| # CHECK-RV32: :[[#@LINE+1]]:1: error: instruction requires the following: RV64I Base Instruction Set | ||
| fcvt.s.lu t3, a3, dyn | ||
|
|
||
| # Rounding modes | ||
| # CHECK-ASM-AND-OBJ: fcvt.l.s a4, t4, rne | ||
| # CHECK-ASM: encoding: [0x53,0x87,0x2e,0xc0] | ||
| # CHECK-RV32: :[[#@LINE+1]]:1: error: instruction requires the following: RV64I Base Instruction Set | ||
| fcvt.l.s a4, t4, rne | ||
| # CHECK-ASM-AND-OBJ: fcvt.lu.s a5, t5, rtz | ||
| # CHECK-ASM: encoding: [0xd3,0x17,0x3f,0xc0] | ||
| # CHECK-RV32: :[[#@LINE+1]]:1: error: instruction requires the following: RV64I Base Instruction Set | ||
| fcvt.lu.s a5, t5, rtz | ||
| # CHECK-ASM-AND-OBJ: fcvt.s.l t6, a6, rdn | ||
| # CHECK-ASM: encoding: [0xd3,0x2f,0x28,0xd0] | ||
| # CHECK-RV32: :[[#@LINE+1]]:1: error: instruction requires the following: RV64I Base Instruction Set | ||
| fcvt.s.l t6, a6, rdn | ||
| # CHECK-ASM-AND-OBJ: fcvt.s.lu s7, a7, rup | ||
| # CHECK-ASM: encoding: [0xd3,0xbb,0x38,0xd0] | ||
| # CHECK-RV32: :[[#@LINE+1]]:1: error: instruction requires the following: RV64I Base Instruction Set | ||
| fcvt.s.lu s7, a7, rup |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # RUN: not llvm-mc -triple riscv64 -mattr=+zhinx %s 2>&1 | FileCheck %s | ||
|
|
||
| # Invalid instructions | ||
| fmv.x.h t2, a2 # CHECK: :[[@LINE]]:13: error: invalid operand for instruction | ||
| fmv.h.x a5, t5 # CHECK: :[[@LINE]]:9: error: invalid operand for instruction | ||
|
|
||
| # FP registers where integer regs are expected | ||
| fcvt.h.l a2, ft2 # CHECK: :[[@LINE]]:14: error: invalid operand for instruction | ||
| fcvt.h.lu a3, ft3 # CHECK: :[[@LINE]]:15: error: invalid operand for instruction |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| # RUN: llvm-mc %s -triple=riscv64 -mattr=+zhinx -riscv-no-aliases -show-encoding \ | ||
| # RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s | ||
| # RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=+zhinx %s \ | ||
| # RUN: | llvm-objdump --mattr=+zhinx -M no-aliases -d -r - \ | ||
| # RUN: | FileCheck -check-prefixes=CHECK-ASM-AND-OBJ %s | ||
| # | ||
| # RUN: not llvm-mc -triple riscv32 -mattr=+zhinx %s 2>&1 \ | ||
| # RUN: | FileCheck -check-prefix=CHECK-RV32 %s | ||
|
|
||
| # CHECK-ASM-AND-OBJ: fcvt.l.h a0, t0, dyn | ||
| # CHECK-ASM: encoding: [0x53,0xf5,0x22,0xc4] | ||
| # CHECK-RV32: :[[#@LINE+1]]:1: error: instruction requires the following: RV64I Base Instruction Set | ||
| fcvt.l.h a0, t0, dyn | ||
| # CHECK-ASM-AND-OBJ: fcvt.lu.h a1, t1, dyn | ||
| # CHECK-ASM: encoding: [0xd3,0x75,0x33,0xc4] | ||
| # CHECK-RV32: :[[#@LINE+1]]:1: error: instruction requires the following: RV64I Base Instruction Set | ||
| fcvt.lu.h a1, t1, dyn | ||
| # CHECK-ASM-AND-OBJ: fcvt.h.l t2, a2, dyn | ||
| # CHECK-ASM: encoding: [0xd3,0x73,0x26,0xd4] | ||
| # CHECK-RV32: :[[#@LINE+1]]:1: error: instruction requires the following: RV64I Base Instruction Set | ||
| fcvt.h.l t2, a2, dyn | ||
| # CHECK-ASM-AND-OBJ: fcvt.h.lu t3, a3, dyn | ||
| # CHECK-ASM: encoding: [0x53,0xfe,0x36,0xd4] | ||
| # CHECK-RV32: :[[#@LINE+1]]:1: error: instruction requires the following: RV64I Base Instruction Set | ||
| fcvt.h.lu t3, a3, dyn | ||
|
|
||
| # Rounding modes | ||
| # CHECK-ASM-AND-OBJ: fcvt.l.h a4, t4, rne | ||
| # CHECK-ASM: encoding: [0x53,0x87,0x2e,0xc4] | ||
| # CHECK-RV32: :[[#@LINE+1]]:1: error: instruction requires the following: RV64I Base Instruction Set | ||
| fcvt.l.h a4, t4, rne | ||
| # CHECK-ASM-AND-OBJ: fcvt.lu.h a5, t5, rtz | ||
| # CHECK-ASM: encoding: [0xd3,0x17,0x3f,0xc4] | ||
| # CHECK-RV32: :[[#@LINE+1]]:1: error: instruction requires the following: RV64I Base Instruction Set | ||
| fcvt.lu.h a5, t5, rtz | ||
| # CHECK-ASM-AND-OBJ: fcvt.h.l t6, a6, rdn | ||
| # CHECK-ASM: encoding: [0xd3,0x2f,0x28,0xd4] | ||
| # CHECK-RV32: :[[#@LINE+1]]:1: error: instruction requires the following: RV64I Base Instruction Set | ||
| fcvt.h.l t6, a6, rdn | ||
| # CHECK-ASM-AND-OBJ: fcvt.h.lu s7, a7, rup | ||
| # CHECK-ASM: encoding: [0xd3,0xbb,0x38,0xd4] | ||
| # CHECK-RV32: :[[#@LINE+1]]:1: error: instruction requires the following: RV64I Base Instruction Set | ||
| fcvt.h.lu s7, a7, rup |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # RUN: not llvm-mc -triple riscv64 -mattr=+zhinx %s 2>&1 | FileCheck %s | ||
|
|
||
| # Invalid instructions | ||
| fmv.x.h t2, a2 # CHECK: :[[@LINE]]:13: error: invalid operand for instruction | ||
| fmv.h.x a5, t5 # CHECK: :[[@LINE]]:9: error: invalid operand for instruction | ||
|
|
||
| # FP registers where integer regs are expected | ||
| fcvt.d.h a0, fa2 # CHECK: :[[@LINE]]:14: error: invalid operand for instruction | ||
| fcvt.h.d a0, fa2 # CHECK: :[[@LINE]]:14: error: invalid operand for instruction |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # RUN: llvm-mc %s -triple=riscv64 -mattr=+zhinx,+zdinx -riscv-no-aliases -show-encoding \ | ||
| # RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s | ||
| # RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=+zhinx,+zdinx %s \ | ||
| # RUN: | llvm-objdump --mattr=+zhinx,+zdinx -M no-aliases -d -r - \ | ||
| # RUN: | FileCheck -check-prefixes=CHECK-ASM-AND-OBJ %s | ||
|
|
||
| # CHECK-ASM-AND-OBJ: fcvt.d.h a0, a2 | ||
| # CHECK-ASM: encoding: [0x53,0x05,0x26,0x42] | ||
| fcvt.d.h a0, a2 | ||
|
|
||
| # CHECK-ASM-AND-OBJ: fcvt.h.d a0, a2, dyn | ||
| # CHECK-ASM: encoding: [0x53,0x75,0x16,0x44] | ||
| fcvt.h.d a0, a2, dyn |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| # RUN: llvm-mc %s -triple=riscv32 -mattr=+zdinx -riscv-no-aliases \ | ||
| # RUN: | FileCheck -check-prefix=CHECK-INST %s | ||
| # RUN: llvm-mc %s -triple=riscv32 -mattr=+zdinx \ | ||
| # RUN: | FileCheck -check-prefix=CHECK-ALIAS %s | ||
| # RUN: llvm-mc %s -triple=riscv64 -mattr=+zdinx -riscv-no-aliases \ | ||
| # RUN: | FileCheck -check-prefix=CHECK-INST %s | ||
| # RUN: llvm-mc %s -triple=riscv64 -mattr=+zdinx \ | ||
| # RUN: | FileCheck -check-prefix=CHECK-ALIAS %s | ||
| # RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+zdinx %s \ | ||
| # RUN: | llvm-objdump -d --mattr=+zdinx -M no-aliases - \ | ||
| # RUN: | FileCheck -check-prefix=CHECK-INST %s | ||
| # RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+zdinx %s \ | ||
| # RUN: | llvm-objdump -d --mattr=+zdinx - \ | ||
| # RUN: | FileCheck -check-prefix=CHECK-ALIAS %s | ||
| # RUN: llvm-mc -filetype=obj -triple riscv64 -mattr=+zdinx %s \ | ||
| # RUN: | llvm-objdump -d --mattr=+zdinx -M no-aliases - \ | ||
| # RUN: | FileCheck -check-prefix=CHECK-INST %s | ||
| # RUN: llvm-mc -filetype=obj -triple riscv64 -mattr=+zdinx %s \ | ||
| # RUN: | llvm-objdump -d --mattr=+zdinx - \ | ||
| # RUN: | FileCheck -check-prefix=CHECK-ALIAS %s | ||
|
|
||
| ##===----------------------------------------------------------------------===## | ||
| ## Aliases which omit the rounding mode. | ||
| ##===----------------------------------------------------------------------===## | ||
|
|
||
| # CHECK-INST: fmadd.d a0, a2, a4, a6, dyn | ||
| # CHECK-ALIAS: fmadd.d a0, a2, a4, a6 | ||
| fmadd.d x10, x12, x14, x16 | ||
| # CHECK-INST: fmsub.d a0, a2, a4, a6, dyn | ||
| # CHECK-ALIAS: fmsub.d a0, a2, a4, a6 | ||
| fmsub.d x10, x12, x14, x16 | ||
| # CHECK-INST: fnmsub.d a0, a2, a4, a6, dyn | ||
| # CHECK-ALIAS: fnmsub.d a0, a2, a4, a6 | ||
| fnmsub.d x10, x12, x14, x16 | ||
| # CHECK-INST: fnmadd.d a0, a2, a4, a6, dyn | ||
| # CHECK-ALIAS: fnmadd.d a0, a2, a4, a6 | ||
| fnmadd.d x10, x12, x14, x16 | ||
| # CHECK-INST: fadd.d a0, a2, a4, dyn | ||
| # CHECK-ALIAS: fadd.d a0, a2, a4 | ||
| fadd.d x10, x12, x14 | ||
| # CHECK-INST: fsub.d a0, a2, a4, dyn | ||
| # CHECK-ALIAS: fsub.d a0, a2, a4 | ||
| fsub.d x10, x12, x14 | ||
| # CHECK-INST: fmul.d a0, a2, a4, dyn | ||
| # CHECK-ALIAS: fmul.d a0, a2, a4 | ||
| fmul.d x10, x12, x14 | ||
| # CHECK-INST: fdiv.d a0, a2, a4, dyn | ||
| # CHECK-ALIAS: fdiv.d a0, a2, a4 | ||
| fdiv.d x10, x12, x14 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| # RUN: llvm-mc %s -triple=riscv32 -mattr=+zfinx -riscv-no-aliases \ | ||
| # RUN: | FileCheck -check-prefix=CHECK-INST %s | ||
| # RUN: llvm-mc %s -triple=riscv32 -mattr=+zfinx \ | ||
| # RUN: | FileCheck -check-prefix=CHECK-ALIAS %s | ||
| # RUN: llvm-mc %s -triple=riscv64 -mattr=+zfinx -riscv-no-aliases \ | ||
| # RUN: | FileCheck -check-prefix=CHECK-INST %s | ||
| # RUN: llvm-mc %s -triple=riscv64 -mattr=+zfinx \ | ||
| # RUN: | FileCheck -check-prefix=CHECK-ALIAS %s | ||
| # RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+zfinx %s \ | ||
| # RUN: | llvm-objdump -d --mattr=+zfinx -M no-aliases - \ | ||
| # RUN: | FileCheck -check-prefix=CHECK-INST %s | ||
| # RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+zfinx %s \ | ||
| # RUN: | llvm-objdump -d --mattr=+zfinx - \ | ||
| # RUN: | FileCheck -check-prefix=CHECK-ALIAS %s | ||
| # RUN: llvm-mc -filetype=obj -triple riscv64 -mattr=+zfinx %s \ | ||
| # RUN: | llvm-objdump -d --mattr=+zfinx -M no-aliases - \ | ||
| # RUN: | FileCheck -check-prefix=CHECK-INST %s | ||
| # RUN: llvm-mc -filetype=obj -triple riscv64 -mattr=+zfinx %s \ | ||
| # RUN: | llvm-objdump -d --mattr=+zfinx - \ | ||
| # RUN: | FileCheck -check-prefix=CHECK-ALIAS %s | ||
|
|
||
| ##===----------------------------------------------------------------------===## | ||
| ## Assembler Pseudo Instructions (User-Level ISA, Version 2.2, Chapter 20) | ||
| ##===----------------------------------------------------------------------===## | ||
|
|
||
| # CHECK-INST: fsgnjx.s s1, s2, s2 | ||
| # CHECK-ALIAS: fabs.s s1, s2 | ||
| fabs.s s1, s2 | ||
| # CHECK-INST: fsgnjn.s s2, s3, s3 | ||
| # CHECK-ALIAS: fneg.s s2, s3 | ||
| fneg.s s2, s3 | ||
|
|
||
| # CHECK-INST: flt.s tp, s6, s5 | ||
| # CHECK-ALIAS: flt.s tp, s6, s5 | ||
| fgt.s x4, s5, s6 | ||
| # CHECK-INST: fle.s t2, s1, s0 | ||
| # CHECK-ALIAS: fle.s t2, s1, s0 | ||
| fge.s x7, x8, x9 | ||
|
|
||
| ##===----------------------------------------------------------------------===## | ||
| ## Aliases which omit the rounding mode. | ||
| ##===----------------------------------------------------------------------===## | ||
|
|
||
| # CHECK-INST: fmadd.s a0, a1, a2, a3, dyn | ||
| # CHECK-ALIAS: fmadd.s a0, a1, a2, a3 | ||
| fmadd.s x10, x11, x12, x13 | ||
| # CHECK-INST: fmsub.s a4, a5, a6, a7, dyn | ||
| # CHECK-ALIAS: fmsub.s a4, a5, a6, a7 | ||
| fmsub.s x14, x15, x16, x17 | ||
| # CHECK-INST: fnmsub.s s2, s3, s4, s5, dyn | ||
| # CHECK-ALIAS: fnmsub.s s2, s3, s4, s5 | ||
| fnmsub.s x18, x19, x20, x21 | ||
| # CHECK-INST: fnmadd.s s6, s7, s8, s9, dyn | ||
| # CHECK-ALIAS: fnmadd.s s6, s7, s8, s9 | ||
| fnmadd.s x22, x23, x24, x25 | ||
| # CHECK-INST: fadd.s s10, s11, t3, dyn | ||
| # CHECK-ALIAS: fadd.s s10, s11, t3 | ||
| fadd.s x26, x27, x28 | ||
| # CHECK-INST: fsub.s t4, t5, t6, dyn | ||
| # CHECK-ALIAS: fsub.s t4, t5, t6 | ||
| fsub.s x29, x30, x31 | ||
| # CHECK-INST: fmul.s s0, s1, s2, dyn | ||
| # CHECK-ALIAS: fmul.s s0, s1, s2 | ||
| fmul.s s0, s1, s2 | ||
| # CHECK-INST: fdiv.s s3, s4, s5, dyn | ||
| # CHECK-ALIAS: fdiv.s s3, s4, s5 | ||
| fdiv.s s3, s4, s5 | ||
| # CHECK-INST: sqrt.s s6, s7, dyn | ||
| # CHECK-ALIAS: sqrt.s s6, s7 | ||
| fsqrt.s s6, s7 | ||
| # CHECK-INST: fcvt.w.s a0, s5, dyn | ||
| # CHECK-ALIAS: fcvt.w.s a0, s5 | ||
| fcvt.w.s a0, s5 | ||
| # CHECK-INST: fcvt.wu.s a1, s6, dyn | ||
| # CHECK-ALIAS: fcvt.wu.s a1, s6 | ||
| fcvt.wu.s a1, s6 | ||
| # CHECK-INST: fcvt.s.w t6, a4, dyn | ||
| # CHECK-ALIAS: fcvt.s.w t6, a4 | ||
| fcvt.s.w t6, a4 | ||
| # CHECK-INST: fcvt.s.wu s0, a5, dyn | ||
| # CHECK-ALIAS: fcvt.s.wu s0, a5 | ||
| fcvt.s.wu s0, a5 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| # RUN: llvm-mc %s -triple=riscv32 -mattr=+zhinx -riscv-no-aliases \ | ||
| # RUN: | FileCheck -check-prefix=CHECK-INST %s | ||
| # RUN: llvm-mc %s -triple=riscv32 -mattr=+zhinx \ | ||
| # RUN: | FileCheck -check-prefix=CHECK-ALIAS %s | ||
| # RUN: llvm-mc %s -triple=riscv64 -mattr=+zhinx -riscv-no-aliases \ | ||
| # RUN: | FileCheck -check-prefix=CHECK-INST %s | ||
| # RUN: llvm-mc %s -triple=riscv64 -mattr=+zhinx \ | ||
| # RUN: | FileCheck -check-prefix=CHECK-ALIAS %s | ||
| # RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+zhinx %s \ | ||
| # RUN: | llvm-objdump -d --mattr=+zhinx -M no-aliases - \ | ||
| # RUN: | FileCheck -check-prefix=CHECK-INST %s | ||
| # RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+zhinx %s \ | ||
| # RUN: | llvm-objdump -d --mattr=+zhinx - \ | ||
| # RUN: | FileCheck -check-prefix=CHECK-ALIAS %s | ||
| # RUN: llvm-mc -filetype=obj -triple riscv64 -mattr=+zhinx %s \ | ||
| # RUN: | llvm-objdump -d --mattr=+zhinx -M no-aliases - \ | ||
| # RUN: | FileCheck -check-prefix=CHECK-INST %s | ||
| # RUN: llvm-mc -filetype=obj -triple riscv64 -mattr=+zhinx %s \ | ||
| # RUN: | llvm-objdump -d --mattr=+zhinx - \ | ||
| # RUN: | FileCheck -check-prefix=CHECK-ALIAS %s | ||
|
|
||
| ##===----------------------------------------------------------------------===## | ||
| ## Assembler Pseudo Instructions (User-Level ISA, Version 2.2, Chapter 20) | ||
| ##===----------------------------------------------------------------------===## | ||
|
|
||
| # CHECK-INST: fsgnjx.h s1, s2, s2 | ||
| # CHECK-ALIAS: fabs.h s1, s2 | ||
| fabs.h s1, s2 | ||
| # CHECK-INST: fsgnjn.h s2, s3, s3 | ||
| # CHECK-ALIAS: fneg.h s2, s3 | ||
| fneg.h s2, s3 | ||
|
|
||
| # CHECK-INST: flt.h tp, s6, s5 | ||
| # CHECK-ALIAS: flt.h tp, s6, s5 | ||
| fgt.h x4, s5, s6 | ||
| # CHECK-INST: fle.h t2, s1, s0 | ||
| # CHECK-ALIAS: fle.h t2, s1, s0 | ||
| fge.h x7, x8, x9 | ||
|
|
||
| ##===----------------------------------------------------------------------===## | ||
| ## Aliases which omit the rounding mode. | ||
| ##===----------------------------------------------------------------------===## | ||
|
|
||
| # CHECK-INST: fmadd.h a0, a1, a2, a3, dyn | ||
| # CHECK-ALIAS: fmadd.h a0, a1, a2, a3 | ||
| fmadd.h x10, x11, x12, x13 | ||
| # CHECK-INST: fmsub.h a4, a5, a6, a7, dyn | ||
| # CHECK-ALIAS: fmsub.h a4, a5, a6, a7 | ||
| fmsub.h x14, x15, x16, x17 | ||
| # CHECK-INST: fnmsub.h s2, s3, s4, s5, dyn | ||
| # CHECK-ALIAS: fnmsub.h s2, s3, s4, s5 | ||
| fnmsub.h x18, x19, x20, x21 | ||
| # CHECK-INST: fnmadd.h s6, s7, s8, s9, dyn | ||
| # CHECK-ALIAS: fnmadd.h s6, s7, s8, s9 | ||
| fnmadd.h x22, x23, x24, x25 | ||
| # CHECK-INST: fadd.h s10, s11, t3, dyn | ||
| # CHECK-ALIAS: fadd.h s10, s11, t3 | ||
| fadd.h x26, x27, x28 | ||
| # CHECK-INST: fsub.h t4, t5, t6, dyn | ||
| # CHECK-ALIAS: fsub.h t4, t5, t6 | ||
| fsub.h x29, x30, x31 | ||
| # CHECK-INST: fmul.h s0, s1, s2, dyn | ||
| # CHECK-ALIAS: fmul.h s0, s1, s2 | ||
| fmul.h s0, s1, s2 | ||
| # CHECK-INST: fdiv.h s3, s4, s5, dyn | ||
| # CHECK-ALIAS: fdiv.h s3, s4, s5 | ||
| fdiv.h s3, s4, s5 | ||
| # CHECK-INST: fsqrt.h s6, s7, dyn | ||
| # CHECK-ALIAS: fsqrt.h s6, s7 | ||
| fsqrt.h s6, s7 | ||
| # CHECK-INST: fcvt.w.h a0, s5, dyn | ||
| # CHECK-ALIAS: fcvt.w.h a0, s5 | ||
| fcvt.w.h a0, s5 | ||
| # CHECK-INST: fcvt.wu.h a1, s6, dyn | ||
| # CHECK-ALIAS: fcvt.wu.h a1, s6 | ||
| fcvt.wu.h a1, s6 | ||
| # CHECK-INST: fcvt.h.w t6, a4, dyn | ||
| # CHECK-ALIAS: fcvt.h.w t6, a4 | ||
| fcvt.h.w t6, a4 | ||
| # CHECK-INST: fcvt.h.wu s0, a5, dyn | ||
| # CHECK-ALIAS: fcvt.h.wu s0, a5 | ||
| fcvt.h.wu s0, a5 |