test_cases:
  -
    input:
      bytes: [ 0xc5, 0x57, 0x64, 0x74 ]
      arch: "CS_ARCH_LOONGARCH"
      options: [ "CS_MODE_LOONGARCH64" ]
    expected:
      insns:
        -
          asm_text: "xvavg.b $xr5, $xr30, $xr21"
  -
    input:
      bytes: [ 0x32, 0xd6, 0x64, 0x74 ]
      arch: "CS_ARCH_LOONGARCH"
      options: [ "CS_MODE_LOONGARCH64" ]
    expected:
      insns:
        -
          asm_text: "xvavg.h $xr18, $xr17, $xr21"
  -
    input:
      bytes: [ 0xe3, 0x52, 0x65, 0x74 ]
      arch: "CS_ARCH_LOONGARCH"
      options: [ "CS_MODE_LOONGARCH64" ]
    expected:
      insns:
        -
          asm_text: "xvavg.w $xr3, $xr23, $xr20"
  -
    input:
      bytes: [ 0x1b, 0xec, 0x65, 0x74 ]
      arch: "CS_ARCH_LOONGARCH"
      options: [ "CS_MODE_LOONGARCH64" ]
    expected:
      insns:
        -
          asm_text: "xvavg.d $xr27, $xr0, $xr27"
  -
    input:
      bytes: [ 0x8b, 0x40, 0x66, 0x74 ]
      arch: "CS_ARCH_LOONGARCH"
      options: [ "CS_MODE_LOONGARCH64" ]
    expected:
      insns:
        -
          asm_text: "xvavg.bu $xr11, $xr4, $xr16"
  -
    input:
      bytes: [ 0x22, 0xcc, 0x66, 0x74 ]
      arch: "CS_ARCH_LOONGARCH"
      options: [ "CS_MODE_LOONGARCH64" ]
    expected:
      insns:
        -
          asm_text: "xvavg.hu $xr2, $xr1, $xr19"
  -
    input:
      bytes: [ 0x9b, 0x6e, 0x67, 0x74 ]
      arch: "CS_ARCH_LOONGARCH"
      options: [ "CS_MODE_LOONGARCH64" ]
    expected:
      insns:
        -
          asm_text: "xvavg.wu $xr27, $xr20, $xr27"
  -
    input:
      bytes: [ 0x97, 0xf6, 0x67, 0x74 ]
      arch: "CS_ARCH_LOONGARCH"
      options: [ "CS_MODE_LOONGARCH64" ]
    expected:
      insns:
        -
          asm_text: "xvavg.du $xr23, $xr20, $xr29"
