diff --git a/tests/asm/meson.build b/tests/asm/meson.build index 8e9d4f4..4f66c9b 100644 --- a/tests/asm/meson.build +++ b/tests/asm/meson.build @@ -49,6 +49,8 @@ asm_tests = { 'setwd-2': {}, 'setwd-invalidate-regs-1': {}, 'setwd-invalidate-regs-2': {}, + 'setwd-psize-1': {}, + 'setwd-psize-2': { 'should_fail': true }, 'setbn-invalidate-regs-1': {}, 'setbn-invalidate-regs-2': { 'should_fail': true }, 'setbp-invalidate-regs-1': {}, diff --git a/tests/asm/win/setwd-psize-1.S b/tests/asm/win/setwd-psize-1.S new file mode 100644 index 0000000..212e97a --- /dev/null +++ b/tests/asm/win/setwd-psize-1.S @@ -0,0 +1,20 @@ +#include "test_start.S" + + setwd wsz=8, nfx=1 + + disp %ctpr1, 0f + // psize = (8 - 4) * 2 = 8 regs + call %ctpr1, wbs=4 + + disp %ctpr1, 0f + // psize = (8 - 8) * 2 = 0 regs + call %ctpr1, wbs=8 + +#include "test_end.S" + +0: + { + setwd wsz=4, nfx=1 + return %ctpr3 + } + ct %ctpr3 diff --git a/tests/asm/win/setwd-psize-2.S b/tests/asm/win/setwd-psize-2.S new file mode 100644 index 0000000..a62104e --- /dev/null +++ b/tests/asm/win/setwd-psize-2.S @@ -0,0 +1,21 @@ +#include "test_start.S" + + { + setwd wsz=16, nfx=1 + disp %ctpr1, 0f + } + { + // psize = (16 - 4) * 2 = 24 regs + call %ctpr1, wbs=4 + } + +#include "test_end.S" + +0: + // psize = 24 + { + // try to set wsz lower than psize + setwd wsz=4, nfx=1 + return %ctpr3 + } + ct %ctpr3