riscv-march-$(CONFIG_RISCV_64) := rv64
riscv-march-y += ima
riscv-march-$(CONFIG_RISCV_ISA_C) += c
-riscv-march-y += _zicsr_zifencei
+riscv-march-y += _zicsr_zifencei_zbb
riscv-generic-flags := $(riscv-abi-y) -march=$(subst $(space),,$(riscv-march-y))
$(call as-insn,$(CC) $(riscv-generic-flags)_$(1),$(value $(1)-insn),_$(1)))
endef
-zbb-insn := "andn t0$(comma)t0$(comma)t0"
-$(call check-extension,zbb)
-
zihintpause-insn := "pause"
$(call check-extension,zihintpause)
-extensions := $(zbb) $(zihintpause)
+extensions := $(zihintpause)
extensions := $(subst $(space),,$(extensions))
: "r" (new) \
: "memory" );
-/*
- * To not face an issue that gas doesn't understand ANDN instruction
- * it is encoded using .insn directive.
- */
-#ifdef __riscv_zbb
-#define ANDN_INSN(rd, rs1, rs2) \
- ".insn r OP, 0x7, 0x20, " rd ", " rs1 ", " rs2 "\n"
-#else
-#define ANDN_INSN(rd, rs1, rs2) \
- "not " rd ", " rs2 "\n" \
- "and " rd ", " rs1 ", " rd "\n"
-#endif
-
/*
* For LR and SC, the A extension requires that the address held in rs1 be
* naturally aligned to the size of the operand (i.e., eight-byte aligned
\
asm volatile ( \
"0: lr.w" lr_sfx " %[old], %[ptr_]\n" \
- ANDN_INSN("%[scratch]", "%[old]", "%[mask]") \
+ " andn %[scratch], %[old], %[mask]\n" \
" or %[scratch], %[scratch], %z[new_]\n" \
" sc.w" sc_sfx " %[scratch], %[scratch], %[ptr_]\n" \
" bnez %[scratch], 0b\n" \